Index: /issm/oecreview/Archive/25834-26739/Date.tex
===================================================================
--- /issm/oecreview/Archive/25834-26739/Date.tex	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/Date.tex	(revision 26740)
@@ -0,0 +1,1 @@
+21-Dec-PM
Index: /issm/oecreview/Archive/25834-26739/ISSM-25837-25838.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25837-25838.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25837-25838.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/configure.ac
+===================================================================
+--- ../trunk-jpl/configure.ac	(revision 25837)
++++ ../trunk-jpl/configure.ac	(revision 25838)
+@@ -1,7 +1,7 @@
+ # Process this file with autoconf to produce a configure script.
+ 
+ #AUTOCONF
+-AC_INIT([Ice Sheet System Model (ISSM)],[4.18],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
++AC_INIT([Ice Sheet System Model (ISSM)],[4.19],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+ AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
+ AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
+ m4_include([m4/issm_options.m4])
Index: /issm/oecreview/Archive/25834-26739/ISSM-25838-25839.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25838-25839.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25838-25839.diff	(revision 26740)
@@ -0,0 +1,1204 @@
+Index: ../trunk-jpl/test/Archives/Archive540.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive541.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive804.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive805.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test540.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.m	(revision 25838)
++++ ../trunk-jpl/test/NightlyRun/test540.m	(revision 25839)
+@@ -15,6 +15,7 @@
+ md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+ pos = find(md.mesh.vertexonboundary);
+ md.levelset.spclevelset(pos) = md.mask.ice_levelset(pos);
++md.levelset.migration_max = 1e10;
+ 
+ %Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28=1;
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 25838)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 25839)
+@@ -15,6 +15,7 @@
+ md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+ pos = find(md.mesh.vertexonboundary);
+ md.levelset.spclevelset(pos) = md.mask.ice_levelset(pos);
++md.levelset.migration_max = 1e10;
+ 
+ %Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28=1;
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 25838)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 25839)
+@@ -497,6 +497,7 @@
+ if LEVELSET
+ issm_sources += ./analyses/LevelsetAnalysis.cpp
+ issm_sources += ./modules/Calvingx/Calvingx.cpp
++issm_sources += ./modules/MovingFrontalVelx/MovingFrontalVelx.cpp
+ issm_sources += ./modules/KillIcebergsx/KillIcebergsx.cpp
+ endif
+ if EXTRAPOLATION
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 25838)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 25839)
+@@ -185,19 +185,17 @@
+ 	Element* basalelement = element->SpawnBasalElement();
+ 
+ 	/*Intermediaries */
+-	int  stabilization,dim, domaintype, calvinglaw;
++	int  stabilization,dim,domaintype;
+ 	int i,j,k,row, col;
+ 	IssmDouble kappa;
+ 	IssmDouble Jdet, dt, D_scalar;
+ 	IssmDouble h,hx,hy,hz;
+-	IssmDouble vel,v[3],w[3],c[3],m[3],dlsf[3];
+-	IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate, groundedice;
+-	IssmDouble migrationmax, calvinghaf, heaviside, haf_eps;
++	IssmDouble vel,w[3];
++	IssmDouble migrationmax;
+ 	IssmDouble* xyz_list = NULL;
+ 
+ 	/*Get problem dimension and whether there is moving front or not*/
+ 	basalelement->FindParam(&domaintype,DomainTypeEnum);
+-	basalelement->FindParam(&calvinglaw,CalvingLawEnum);
+ 	basalelement->FindParam(&stabilization,LevelsetStabilizationEnum);
+ 	switch(domaintype){
+ 		case Domain2DverticalEnum:   dim = 1; break;
+@@ -205,9 +203,6 @@
+ 		case Domain3DEnum:           dim = 2; break;
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+-
+-	/*Calving threshold*/
+-
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes    = basalelement->GetNumberOfNodes();
+ 
+@@ -224,86 +219,26 @@
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+ 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	basalelement->FindParam(&migrationmax,MigrationMaxEnum);
+-	Input* vx_input           = NULL;
+-	Input* vy_input           = NULL;
+-	Input* calvingratex_input = NULL;
+-	Input* calvingratey_input = NULL;
+-	Input* lsf_slopex_input   = NULL;
+-	Input* lsf_slopey_input   = NULL;
+-	Input* calvingrate_input  = NULL;
+-	Input* meltingrate_input  = NULL;
+-	Input* gr_input           = NULL;
+ 
++	Input* mf_vx_input        = NULL;
++	Input* mf_vy_input        = NULL;
++
+ 	/*Load velocities*/
+ 	switch(domaintype){
+ 		case Domain2DverticalEnum:
+-			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
++			mf_vx_input=basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
+ 			break;
+ 		case Domain2DhorizontalEnum:
+-			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
+-			vy_input=basalelement->GetInput(VyEnum); _assert_(vy_input);
+-			gr_input=basalelement->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
++			mf_vx_input=basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
++			mf_vy_input=basalelement->GetInput(MovingFrontalVyEnum); _assert_(mf_vy_input);
+ 			break;
+ 		case Domain3DEnum:
+-			vx_input=basalelement->GetInput(VxAverageEnum); _assert_(vx_input);
+-			vy_input=basalelement->GetInput(VyAverageEnum); _assert_(vy_input);
+-			gr_input=basalelement->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
++			mf_vx_input=basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
++			mf_vy_input=basalelement->GetInput(MovingFrontalVyEnum); _assert_(mf_vy_input);
+ 			break;
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+ 
+-	/*Load calving inputs*/
+-	switch(calvinglaw){
+-		case DefaultCalvingEnum:
+-		case CalvingVonmisesEnum:
+-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+-			calvingrate_input = basalelement->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+-			break;
+-		case CalvingLevermannEnum:
+-			switch(domaintype){
+-				case Domain2DverticalEnum:
+-					calvingratex_input=basalelement->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+-					break;
+-				case Domain2DhorizontalEnum:
+-					calvingratex_input=basalelement->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+-					calvingratey_input=basalelement->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+-					break;
+-				case Domain3DEnum:
+-					calvingratex_input=basalelement->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
+-					calvingratey_input=basalelement->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+-					break;
+-				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-			}
+-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+-			break;
+-		case CalvingMinthicknessEnum:
+-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+-			break;
+-		case CalvingHabEnum:
+-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+-			break;
+-		case CalvingCrevasseDepthEnum:
+-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+-			break;
+-		case CalvingDev2Enum:
+-			basalelement->FindParam(&calvinghaf,CalvingHeightAboveFloatationEnum);
+-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+-			calvingrate_input = basalelement->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+-			break;
+-		default:
+-			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+-	}
+-
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=basalelement->NewGauss(2);
+ 	while(gauss->next()){
+@@ -323,166 +258,19 @@
+ 			D_scalar=D_scalar*dt;
+ 		}
+ 
+-		/* Advection */
+-		vx_input->GetInputValue(&v[0],gauss);
+-		vy_input->GetInputValue(&v[1],gauss);
+-		gr_input->GetInputValue(&groundedice,gauss);
++		/* Levelset speed */
++		mf_vx_input->GetInputValue(&w[0], gauss);
++		mf_vy_input->GetInputValue(&w[1], gauss);
+ 
+-		/*Get calving speed*/
+-		switch(calvinglaw){
+-			case DefaultCalvingEnum:
+-			case CalvingVonmisesEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				calvingrate_input->GetInputValue(&calvingrate,gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
+-
+-				/*Limit calving rate to c <= v + 3 km/yr */
+-				vel=sqrt(v[0]*v[0] + v[1]*v[1]);
+-				if(calvingrate>migrationmax+vel) calvingrate = vel+migrationmax;
+-				if(groundedice<0) meltingrate = 0.;
+-
+-				norm_dlsf=0.;
+-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+-				norm_dlsf=sqrt(norm_dlsf);
+-
+-				if(norm_dlsf>1.e-10)
+-				 for(i=0;i<dim;i++){
+-					 c[i]=calvingrate*dlsf[i]/norm_dlsf; m[i]=meltingrate*dlsf[i]/norm_dlsf;
+-				 }
+-				else
+-				 for(i=0;i<dim;i++){
+-					 c[i]=0.; m[i]=0.;
+-				 }
+-				break;
+-
+-			case CalvingLevermannEnum:
+-				calvingratex_input->GetInputValue(&c[0],gauss);
+-				if(dim==2) calvingratey_input->GetInputValue(&c[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
+-				norm_calving=0.;
+-				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
+-				norm_calving=sqrt(norm_calving)+1.e-14;
+-				for(i=0;i<dim;i++) m[i]=meltingrate*c[i]/norm_calving;
+-				break;
+-
+-			case CalvingMinthicknessEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
+-
+-				norm_dlsf=0.;
+-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+-				norm_dlsf=sqrt(norm_dlsf);
+-
+-				if(norm_dlsf>1.e-10)
+-				 for(i=0;i<dim;i++){
+-					 c[i]=0.;
+-					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+-				 }
+-				else
+-				 for(i=0;i<dim;i++){
+-					 c[i]=0.;
+-					 m[i]=0.;
+-				 }
+-				break;
+-
+-			case CalvingHabEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
+-
+-				norm_dlsf=0.;
+-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+-				norm_dlsf=sqrt(norm_dlsf);
+-
+-				if(norm_dlsf>1.e-10)
+-				 for(i=0;i<dim;i++){
+-					 c[i]=0.;
+-					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+-				 }
+-				else
+-				 for(i=0;i<dim;i++){
+-					 c[i]=0.;
+-					 m[i]=0.;
+-				 }
+-				break;
+-
+-			case CalvingCrevasseDepthEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
+-
+-				if(groundedice<0) meltingrate = 0.;
+-
+-				norm_dlsf=0.;
+-				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+-				norm_dlsf=sqrt(norm_dlsf);
+-
+-				if(norm_dlsf>1.e-10)
+-				 for(i=0;i<dim;i++){
+-					 c[i]=0.;
+-					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+-				 }
+-				else
+-				 for(i=0;i<dim;i++){
+-					 c[i]=0.;
+-					 m[i]=0.;
+-				 }
+-				break;
+-
+-			case CalvingDev2Enum:
+-				  {
+-					lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-					calvingrate_input->GetInputValue(&calvingrate,gauss);
+-					meltingrate_input->GetInputValue(&meltingrate,gauss);
+-					gr_input->GetInputValue(&groundedice,gauss);
+-
+-					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
+-					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
+-					haf_eps=10.;
+-					if(groundedice-calvinghaf<=-haf_eps){
+-						// ice floats freely below calvinghaf: calve freely
+-						// undercutting has no effect:
+-						meltingrate=0.;
+-					}
+-					else if(groundedice-calvinghaf>=haf_eps){
+-						// ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity
+-						calvingrate=min(calvingrate,vel);
+-						// ice is almost grounded: frontal undercutting has maximum effect (do nothing).
+-					}
+-					else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.
+-						//heaviside: 0 for floating, 1 for grounded
+-						heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI);
+-						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
+-						meltingrate=heaviside*meltingrate+0.;
+-					}
+-
+-					norm_dlsf=0.;
+-					for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+-					norm_dlsf=sqrt(norm_dlsf);
+-
+-					if(norm_dlsf>1.e-10)
+-					 for(i=0;i<dim;i++){
+-						 c[i]=calvingrate*dlsf[i]/norm_dlsf;
+-						 m[i]=meltingrate*dlsf[i]/norm_dlsf;
+-					 }
+-					else
+-					 for(i=0;i<dim;i++){
+-						 c[i]=0.;
+-						 m[i]=0.;
+-					 }
+-					break;
+-				  }
+-
+-			default:
+-				_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
++		/* Apply limiter to the migration rate */		
++		vel = 0.;
++		for(i=0;i<dim;i++) vel += w[i]*w[i];
++		vel = sqrt(vel)+1e-14;
++		/* !!NOTE: This is different from the previous version 25838 (and before). The current threshold restrict both advance and retreat velocity. */
++		if (vel > migrationmax) {
++			for(i=0;i<dim;i++) w[i] = w[i]/vel*migrationmax;
+ 		}
+ 
+-		/*Levelset speed is ice velocity - calving rate*/
+-		for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i];
+-
+ 		/*Compute D*/
+ 		for(i=0;i<numnodes;i++){
+ 			for(j=0;j<numnodes;j++){
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 25838)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 25839)
+@@ -296,6 +296,7 @@
+ 		virtual IssmDouble MinEdgeLength(IssmDouble* xyz_list)=0;
+ 		virtual IssmDouble Misfit(int modelenum,int observationenum,int weightsenum)=0;
+ 		virtual IssmDouble MisfitArea(int weightsenum)=0;
++		virtual void	   MovingFrontalVelocity(void){_error_("not implemented yet");};
+ 		virtual Gauss*     NewGauss(void)=0;
+ 		virtual Gauss*     NewGauss(int order)=0;
+ 		virtual Gauss*     NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 25838)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 25839)
+@@ -2746,6 +2746,284 @@
+ 	return minlength;
+ }
+ /*}}}*/
++void	   Penta::MovingFrontalVelocity(void){/*{{{*/
++	if(!this->IsOnBase()) return;
++	int  dim, domaintype, calvinglaw, i;
++	IssmDouble v[3],w[3],c[3],m[3],dlsf[3];
++	IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate, groundedice;
++	IssmDouble migrationmax, calvinghaf, heaviside, haf_eps;
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  movingfrontvx[NUMVERTICES];
++	IssmDouble  movingfrontvy[NUMVERTICES];
++	IssmDouble  vel;
++	
++	/* Get node coordinates and dof list: */
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++
++	Input* vx_input           = NULL;
++	Input* vy_input           = NULL;
++	Input* calvingratex_input = NULL;
++	Input* calvingratey_input = NULL;
++	Input* lsf_slopex_input   = NULL;
++	Input* lsf_slopey_input   = NULL;
++	Input* calvingrate_input  = NULL;
++	Input* meltingrate_input  = NULL;
++	Input* gr_input           = NULL;
++
++	/*Get problem dimension and whether there is moving front or not*/
++	this->FindParam(&domaintype,DomainTypeEnum);
++	this->FindParam(&calvinglaw,CalvingLawEnum);
++
++	switch(domaintype){
++		case Domain2DverticalEnum:   dim = 1; break;
++		case Domain2DhorizontalEnum: dim = 2; break;
++		case Domain3DEnum:           dim = 2; break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++	/*Load velocities*/
++	switch(domaintype){
++		case Domain2DverticalEnum:
++			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
++			break;
++		case Domain2DhorizontalEnum:
++			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
++			vy_input=this->GetInput(VyEnum); _assert_(vy_input);
++			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
++			break;
++		case Domain3DEnum:
++			vx_input=this->GetInput(VxAverageEnum); _assert_(vx_input);
++			vy_input=this->GetInput(VyAverageEnum); _assert_(vy_input);
++			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	switch(calvinglaw){
++		case DefaultCalvingEnum:
++		case CalvingVonmisesEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingLevermannEnum:
++			switch(domaintype){
++				case Domain2DverticalEnum:
++					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
++					break;
++				case Domain2DhorizontalEnum:
++					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
++					calvingratey_input=this->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
++					break;
++				case Domain3DEnum:
++					calvingratex_input=this->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
++					calvingratey_input=this->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
++					break;
++				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++			}
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingMinthicknessEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingHabEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingCrevasseDepthEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingDev2Enum:
++			this->FindParam(&calvinghaf,CalvingHeightAboveFloatationEnum);
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		default:
++			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
++	}
++
++	/* Start looping on the number of vertices: */
++	GaussPenta* gauss=new GaussPenta();
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		gauss->GaussVertex(iv);
++
++		/* Advection */
++		vx_input->GetInputValue(&v[0],gauss);
++		vy_input->GetInputValue(&v[1],gauss);
++		gr_input->GetInputValue(&groundedice,gauss);
++
++		/*Get calving speed*/
++		switch(calvinglaw){
++			case DefaultCalvingEnum:
++			case CalvingVonmisesEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				calvingrate_input->GetInputValue(&calvingrate,gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++
++				if(groundedice<0) meltingrate = 0.;
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=calvingrate*dlsf[i]/norm_dlsf; m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.; m[i]=0.;
++				 }
++				break;
++
++			case CalvingLevermannEnum:
++				calvingratex_input->GetInputValue(&c[0],gauss);
++				if(dim==2) calvingratey_input->GetInputValue(&c[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				norm_calving=0.;
++				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
++				norm_calving=sqrt(norm_calving)+1.e-14;
++				for(i=0;i<dim;i++) m[i]=meltingrate*c[i]/norm_calving;
++				break;
++
++			case CalvingMinthicknessEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=0.;
++				 }
++				break;
++
++			case CalvingHabEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=0.;
++				 }
++				break;
++
++			case CalvingCrevasseDepthEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++
++				if(groundedice<0) meltingrate = 0.;
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=0.;
++				 }
++				break;
++
++			case CalvingDev2Enum:
++				  {
++					lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++					calvingrate_input->GetInputValue(&calvingrate,gauss);
++					meltingrate_input->GetInputValue(&meltingrate,gauss);
++					gr_input->GetInputValue(&groundedice,gauss);
++
++					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
++					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
++					haf_eps=10.;
++					if(groundedice-calvinghaf<=-haf_eps){
++						// ice floats freely below calvinghaf: calve freely
++						// undercutting has no effect:
++						meltingrate=0.;
++					}
++					else if(groundedice-calvinghaf>=haf_eps){
++						// ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity
++						calvingrate=min(calvingrate,vel);
++						// ice is almost grounded: frontal undercutting has maximum effect (do nothing).
++					}
++					else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.
++						//heaviside: 0 for floating, 1 for grounded
++						heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI);
++						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
++						meltingrate=heaviside*meltingrate+0.;
++					}
++
++					norm_dlsf=0.;
++					for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++					norm_dlsf=sqrt(norm_dlsf);
++
++					if(norm_dlsf>1.e-10)
++					 for(i=0;i<dim;i++){
++						 c[i]=calvingrate*dlsf[i]/norm_dlsf;
++						 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++					 }
++					else
++					 for(i=0;i<dim;i++){
++						 c[i]=0.;
++						 m[i]=0.;
++					 }
++					break;
++				  }
++
++			default:
++				_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
++		}
++
++		for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i];
++
++		movingfrontvx[iv] = w[0];
++		movingfrontvy[iv] = w[1];		
++	}
++
++	/*Add input*/
++	this->AddInput(MovingFrontalVxEnum,&movingfrontvx[0],P1DGEnum);
++	this->AddInput(MovingFrontalVyEnum,&movingfrontvy[0],P1DGEnum);
++
++	this->InputExtrude(MovingFrontalVxEnum,-1);
++	this->InputExtrude(MovingFrontalVyEnum,-1);
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
+ Gauss*     Penta::NewGauss(void){/*{{{*/
+ 	return new GaussPenta();
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 25838)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 25839)
+@@ -128,6 +128,7 @@
+ 		IssmDouble     MinEdgeLength(IssmDouble* xyz_list);
+ 		IssmDouble     Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
+ 		IssmDouble     MisfitArea(int weightsenum){_error_("not implemented yet");};
++		void           MovingFrontalVelocity(void);
+ 		Gauss*         NewGauss(void);
+ 		Gauss*         NewGauss(int order);
+ 		Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25838)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25839)
+@@ -3443,6 +3443,280 @@
+ 	return Jelem;
+ }
+ /*}}}*/
++void	   Tria::MovingFrontalVelocity(void){/*{{{*/
++
++	int  dim, domaintype, calvinglaw, i;
++	IssmDouble v[3],w[3],c[3],m[3],dlsf[3];
++	IssmDouble norm_dlsf, norm_calving, calvingrate, meltingrate, groundedice;
++	IssmDouble migrationmax, calvinghaf, heaviside, haf_eps;
++	IssmDouble  xyz_list[NUMVERTICES][3];
++	IssmDouble  movingfrontvx[NUMVERTICES];
++	IssmDouble  movingfrontvy[NUMVERTICES];
++	IssmDouble  vel;
++	
++	/* Get node coordinates and dof list: */
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++
++	Input* vx_input           = NULL;
++	Input* vy_input           = NULL;
++	Input* calvingratex_input = NULL;
++	Input* calvingratey_input = NULL;
++	Input* lsf_slopex_input   = NULL;
++	Input* lsf_slopey_input   = NULL;
++	Input* calvingrate_input  = NULL;
++	Input* meltingrate_input  = NULL;
++	Input* gr_input           = NULL;
++
++	/*Get problem dimension and whether there is moving front or not*/
++	this->FindParam(&domaintype,DomainTypeEnum);
++	this->FindParam(&calvinglaw,CalvingLawEnum);
++
++	switch(domaintype){
++		case Domain2DverticalEnum:   dim = 1; break;
++		case Domain2DhorizontalEnum: dim = 2; break;
++		case Domain3DEnum:           dim = 2; break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++	/*Load velocities*/
++	switch(domaintype){
++		case Domain2DverticalEnum:
++			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
++			break;
++		case Domain2DhorizontalEnum:
++			vx_input=this->GetInput(VxEnum); _assert_(vx_input);
++			vy_input=this->GetInput(VyEnum); _assert_(vy_input);
++			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
++			break;
++		case Domain3DEnum:
++			vx_input=this->GetInput(VxAverageEnum); _assert_(vx_input);
++			vy_input=this->GetInput(VyAverageEnum); _assert_(vy_input);
++			gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	switch(calvinglaw){
++		case DefaultCalvingEnum:
++		case CalvingVonmisesEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingLevermannEnum:
++			switch(domaintype){
++				case Domain2DverticalEnum:
++					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
++					break;
++				case Domain2DhorizontalEnum:
++					calvingratex_input=this->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
++					calvingratey_input=this->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
++					break;
++				case Domain3DEnum:
++					calvingratex_input=this->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
++					calvingratey_input=this->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
++					break;
++				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++			}
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingMinthicknessEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingHabEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingCrevasseDepthEnum:
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		case CalvingDev2Enum:
++			this->FindParam(&calvinghaf,CalvingHeightAboveFloatationEnum);
++			lsf_slopex_input  = this->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++			if(dim==2) lsf_slopey_input  = this->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++			calvingrate_input = this->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
++			meltingrate_input = this->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
++			break;
++		default:
++			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
++	}
++
++	/* Start looping on the number of vertices: */
++	GaussTria* gauss=new GaussTria();
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		gauss->GaussVertex(iv);
++
++		/* Advection */
++		vx_input->GetInputValue(&v[0],gauss);
++		vy_input->GetInputValue(&v[1],gauss);
++		gr_input->GetInputValue(&groundedice,gauss);
++
++		/*Get calving speed*/
++		switch(calvinglaw){
++			case DefaultCalvingEnum:
++			case CalvingVonmisesEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				calvingrate_input->GetInputValue(&calvingrate,gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				if(groundedice<0) meltingrate = 0.;
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=calvingrate*dlsf[i]/norm_dlsf; m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.; m[i]=0.;
++				 }
++				break;
++
++			case CalvingLevermannEnum:
++				calvingratex_input->GetInputValue(&c[0],gauss);
++				if(dim==2) calvingratey_input->GetInputValue(&c[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				norm_calving=0.;
++				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
++				norm_calving=sqrt(norm_calving)+1.e-14;
++				for(i=0;i<dim;i++) m[i]=meltingrate*c[i]/norm_calving;
++				break;
++
++			case CalvingMinthicknessEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=0.;
++				 }
++				break;
++
++			case CalvingHabEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=0.;
++				 }
++				break;
++
++			case CalvingCrevasseDepthEnum:
++				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++				meltingrate_input->GetInputValue(&meltingrate,gauss);
++
++				if(groundedice<0) meltingrate = 0.;
++
++				norm_dlsf=0.;
++				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++				norm_dlsf=sqrt(norm_dlsf);
++
++				if(norm_dlsf>1.e-10)
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++				 }
++				else
++				 for(i=0;i<dim;i++){
++					 c[i]=0.;
++					 m[i]=0.;
++				 }
++				break;
++
++			case CalvingDev2Enum:
++				  {
++					lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++					calvingrate_input->GetInputValue(&calvingrate,gauss);
++					meltingrate_input->GetInputValue(&meltingrate,gauss);
++					gr_input->GetInputValue(&groundedice,gauss);
++
++					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
++					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
++					haf_eps=10.;
++					if(groundedice-calvinghaf<=-haf_eps){
++						// ice floats freely below calvinghaf: calve freely
++						// undercutting has no effect:
++						meltingrate=0.;
++					}
++					else if(groundedice-calvinghaf>=haf_eps){
++						// ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity
++						calvingrate=min(calvingrate,vel);
++						// ice is almost grounded: frontal undercutting has maximum effect (do nothing).
++					}
++					else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.
++						//heaviside: 0 for floating, 1 for grounded
++						heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI);
++						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
++						meltingrate=heaviside*meltingrate+0.;
++					}
++
++					norm_dlsf=0.;
++					for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++					norm_dlsf=sqrt(norm_dlsf);
++
++					if(norm_dlsf>1.e-10)
++					 for(i=0;i<dim;i++){
++						 c[i]=calvingrate*dlsf[i]/norm_dlsf;
++						 m[i]=meltingrate*dlsf[i]/norm_dlsf;
++					 }
++					else
++					 for(i=0;i<dim;i++){
++						 c[i]=0.;
++						 m[i]=0.;
++					 }
++					break;
++				  }
++
++			default:
++				_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
++		}
++		for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i];
++				
++		movingfrontvx[iv] = w[0];
++		movingfrontvy[iv] = w[1];		
++	}
++
++	/*Add input*/
++	this->AddInput(MovingFrontalVxEnum,&movingfrontvx[0],P1DGEnum);
++	this->AddInput(MovingFrontalVyEnum,&movingfrontvy[0],P1DGEnum);
++
++	/*Clean up and return*/
++	delete gauss;
++}
++/*}}}*/
+ Gauss*     Tria::NewGauss(void){/*{{{*/
+ 	return new GaussTria();
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 25838)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 25839)
+@@ -201,6 +201,7 @@
+ 		void           JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void           JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
+ 		IssmDouble     MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
++		void	       MovingFrontalVelocity(void);
+ 		Gauss*         NewGauss(void);
+ 		Gauss*         NewGauss(int order);
+       Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
+Index: ../trunk-jpl/src/c/cores/movingfront_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 25838)
++++ ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 25839)
+@@ -110,6 +110,8 @@
+ 		}
+ 	}
+ 
++	/* Calculate the frontal velocity for levelset function */
++	MovingFrontalVelx(femmodel);
+ 
+ 	/* solve level set equation */
+ 	analysis = new LevelsetAnalysis();
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 25838)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 25839)
+@@ -71,6 +71,7 @@
+ #include "./SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h"
+ #include "./SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h"
+ #include "./ModelProcessorx/ModelProcessorx.h"
++#include "./MovingFrontalVelx/MovingFrontalVelx.h"
+ #include "./ParseToolkitsOptionsx/ParseToolkitsOptionsx.h"
+ #include "./NodalValuex/NodalValuex.h"
+ #include "./NodeConnectivityx/NodeConnectivityx.h"
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25838)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25839)
+@@ -688,6 +688,8 @@
+ syn keyword cConstant MeshVertexonboundaryEnum
+ syn keyword cConstant MeshVertexonsurfaceEnum
+ syn keyword cConstant MisfitEnum
++syn keyword cConstant MovingFrontalVxEnum
++syn keyword cConstant MovingFrontalVyEnum
+ syn keyword cConstant NeumannfluxEnum
+ syn keyword cConstant NewDamageEnum
+ syn keyword cConstant NodeEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25838)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25839)
+@@ -684,6 +684,8 @@
+ 	MeshVertexonboundaryEnum,
+ 	MeshVertexonsurfaceEnum,
+ 	MisfitEnum,
++	MovingFrontalVxEnum,
++	MovingFrontalVyEnum,
+ 	NeumannfluxEnum,
+ 	NewDamageEnum,
+ 	NodeEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25838)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25839)
+@@ -690,6 +690,8 @@
+ 		case MeshVertexonboundaryEnum : return "MeshVertexonboundary";
+ 		case MeshVertexonsurfaceEnum : return "MeshVertexonsurface";
+ 		case MisfitEnum : return "Misfit";
++		case MovingFrontalVxEnum : return "MovingFrontalVx";
++		case MovingFrontalVyEnum : return "MovingFrontalVy";
+ 		case NeumannfluxEnum : return "Neumannflux";
+ 		case NewDamageEnum : return "NewDamage";
+ 		case NodeEnum : return "Node";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25838)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25839)
+@@ -705,6 +705,8 @@
+ 	      else if (strcmp(name,"MeshVertexonboundary")==0) return MeshVertexonboundaryEnum;
+ 	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
+ 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
++	      else if (strcmp(name,"MovingFrontalVx")==0) return MovingFrontalVxEnum;
++	      else if (strcmp(name,"MovingFrontalVy")==0) return MovingFrontalVyEnum;
+ 	      else if (strcmp(name,"Neumannflux")==0) return NeumannfluxEnum;
+ 	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
+ 	      else if (strcmp(name,"Node")==0) return NodeEnum;
+@@ -749,12 +751,12 @@
+ 	      else if (strcmp(name,"SealevelriseIndices")==0) return SealevelriseIndicesEnum;
+ 	      else if (strcmp(name,"SealevelriseG")==0) return SealevelriseGEnum;
+ 	      else if (strcmp(name,"SealevelriseGU")==0) return SealevelriseGUEnum;
+-	      else if (strcmp(name,"SealevelriseGE")==0) return SealevelriseGEEnum;
+-	      else if (strcmp(name,"SealevelriseGN")==0) return SealevelriseGNEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
++	      if (strcmp(name,"SealevelriseGE")==0) return SealevelriseGEEnum;
++	      else if (strcmp(name,"SealevelriseGN")==0) return SealevelriseGNEnum;
++	      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;
+@@ -872,12 +874,12 @@
+ 	      else if (strcmp(name,"StrainRatezz")==0) return StrainRatezzEnum;
+ 	      else if (strcmp(name,"StressMaxPrincipal")==0) return StressMaxPrincipalEnum;
+ 	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+-	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
+-	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
++	      if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
++	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
++	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+ 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+ 	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+ 	      else if (strcmp(name,"SurfaceAbsMisfit")==0) return SurfaceAbsMisfitEnum;
+@@ -995,12 +997,12 @@
+ 	      else if (strcmp(name,"Outputdefinition68")==0) return Outputdefinition68Enum;
+ 	      else if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum;
+ 	      else if (strcmp(name,"Outputdefinition6")==0) return Outputdefinition6Enum;
+-	      else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
+-	      else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
++	      if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
++	      else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
++	      else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
+ 	      else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum;
+ 	      else if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum;
+ 	      else if (strcmp(name,"Outputdefinition75")==0) return Outputdefinition75Enum;
+@@ -1118,12 +1120,12 @@
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
++	      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;
+@@ -1241,12 +1243,12 @@
+ 	      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 stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
++	      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;
+@@ -1364,12 +1366,12 @@
+ 	      else if (strcmp(name,"SubelementFriction2")==0) return SubelementFriction2Enum;
+ 	      else if (strcmp(name,"SubelementMelt1")==0) return SubelementMelt1Enum;
+ 	      else if (strcmp(name,"SubelementMelt2")==0) return SubelementMelt2Enum;
+-	      else if (strcmp(name,"SubelementMigration")==0) return SubelementMigrationEnum;
+-	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
+          else stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
++	      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,"Tetra")==0) return TetraEnum;
+ 	      else if (strcmp(name,"TetraInput")==0) return TetraInputEnum;
+ 	      else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
+Index: ../trunk-jpl/test/NightlyRun/test804.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test804.m	(revision 25838)
++++ ../trunk-jpl/test/NightlyRun/test804.m	(revision 25839)
+@@ -16,6 +16,7 @@
+ 
+ md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
+ md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 1e10;
+ 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test805.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test805.m	(revision 25838)
++++ ../trunk-jpl/test/NightlyRun/test805.m	(revision 25839)
+@@ -25,6 +25,7 @@
+ md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+ md.groundingline.melt_interpolation='SubelementMelt1';
+ md.levelset.stabilization=2;
++md.levelset.migration_max = 1e10;
+ 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test806.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test806.m	(revision 25838)
++++ ../trunk-jpl/test/NightlyRun/test806.m	(revision 25839)
+@@ -31,6 +31,7 @@
+ md.calving.coeff=4.89e13*ones(md.mesh.numberofvertices,1);
+ md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+ md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 1e8;
+ 
+ md.transient.requested_outputs={'default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate'};
+ 
+Index: ../trunk-jpl/test/NightlyRun/test808.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test808.m	(revision 25838)
++++ ../trunk-jpl/test/NightlyRun/test808.m	(revision 25839)
+@@ -32,6 +32,7 @@
+ md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+ md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
+ md.levelset.reinit_frequency=1;
++md.levelset.migration_max = 1e10;
+ 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test809.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test809.m	(revision 25838)
++++ ../trunk-jpl/test/NightlyRun/test809.m	(revision 25839)
+@@ -22,6 +22,7 @@
+ md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+ md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
+ md.levelset.reinit_frequency=1;
++md.levelset.migration_max = 1e10;
+ 
+ md=solve(md,'Transient');
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25839-25840.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25839-25840.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25839-25840.diff	(revision 26740)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 25839)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 25840)
+@@ -497,7 +497,6 @@
+ if LEVELSET
+ issm_sources += ./analyses/LevelsetAnalysis.cpp
+ issm_sources += ./modules/Calvingx/Calvingx.cpp
+-issm_sources += ./modules/MovingFrontalVelx/MovingFrontalVelx.cpp
+ issm_sources += ./modules/KillIcebergsx/KillIcebergsx.cpp
+ endif
+ if EXTRAPOLATION
+Index: ../trunk-jpl/src/c/modules/Calvingx/Calvingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Calvingx/Calvingx.cpp	(revision 25839)
++++ ../trunk-jpl/src/c/modules/Calvingx/Calvingx.cpp	(revision 25840)
+@@ -38,3 +38,7 @@
+ 			_error_("Caving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+ 	}
+ }
++
++void MovingFrontalVelx(FemModel* femmodel){
++	femmodel->ElementOperationx(&Element::MovingFrontalVelocity);
++}
+\ No newline at end of file
+Index: ../trunk-jpl/src/c/modules/Calvingx/Calvingx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/Calvingx/Calvingx.h	(revision 25839)
++++ ../trunk-jpl/src/c/modules/Calvingx/Calvingx.h	(revision 25840)
+@@ -6,5 +6,6 @@
+ 
+ /* local prototypes: */
+ void Calvingx(FemModel* femmodel);
++void MovingFrontalVelx(FemModel* femmodel);
+ 
+ #endif
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 25839)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 25840)
+@@ -71,7 +71,6 @@
+ #include "./SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h"
+ #include "./SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h"
+ #include "./ModelProcessorx/ModelProcessorx.h"
+-#include "./MovingFrontalVelx/MovingFrontalVelx.h"
+ #include "./ParseToolkitsOptionsx/ParseToolkitsOptionsx.h"
+ #include "./NodalValuex/NodalValuex.h"
+ #include "./NodeConnectivityx/NodeConnectivityx.h"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25840-25841.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25840-25841.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25840-25841.diff	(revision 26740)
@@ -0,0 +1,403 @@
+Index: ../trunk-jpl/jenkins/ross-debian_linux-trunk
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-trunk	(revision 25840)
++++ ../trunk-jpl/jenkins/ross-debian_linux-trunk	(nonexistent)
+@@ -1,67 +0,0 @@
+-#--------------------#
+-# ISSM Configuration #
+-#--------------------#
+-
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-ISSM_CONFIG='\
+-	--prefix=${ISSM_DIR} \
+-	--disable-static \
+-	--enable-development \
+-	--enable-debugging \
+-	--with-numthreads=4 \
+-	--with-matlab-dir=${MATLAB_PATH} \
+-	--with-fortran-lib="-L/usr/lib/x86_64-linux-gnu -lgfortran" \
+-	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+-	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+-	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+-	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+-	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+-	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+-	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+-	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+-	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+-	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+-	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+-'
+-
+-#-------------------#
+-# External Packages #
+-#-------------------#
+-
+-EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
+-	cmake		install.sh
+-	petsc		install-3.12-linux.sh
+-	triangle	install-linux.sh
+-	chaco		install.sh
+-	m1qn3		install.sh
+-	semic		install.sh
+-	shell2junit	install.sh
+-"
+-
+-#---------#
+-# Testing #
+-#---------#
+-
+-# Test suites
+-MATLAB_TEST=1
+-PYTHON_TEST=0
+-JAVASCRIPT_TEST=0
+-EXAMPLES_TEST=0
+-
+-# Number of CPUs used in ISSM compilation
+-#
+-# NOTE: One is usually safer as some packages are very sensitive to parallel
+-# 		compilation.
+-#
+-NUMCPUS_INSTALL=8
+-
+-# Number of CPUs used in the nightly runs
+-NUMCPUS_RUN=2
+-
+-# Nightly run options
+-#
+-# See documentation in test/NightlyRun/runme.* for more information.
+-#
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
+-PYTHON_NROPTIONS=""
+
+Property changes on: ../trunk-jpl/jenkins/ross-debian_linux-trunk
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test540.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.py	(revision 25840)
++++ ../trunk-jpl/test/NightlyRun/test540.py	(revision 25841)
+@@ -1,12 +1,13 @@
+ #Test Name: PigTranCalvingDevSSA2d
++import numpy as np
++from calvingvonmises import *
++from MatlabFuncs import oshostname
+ from model import *
+-from socket import gethostname
+-from triangle import *
+-from setmask import *
+ from parameterize import *
+ from setflowequation import *
++from setmask import *
+ from solve import *
+-from calvingvonmises import *
++from triangle import *
+ 
+ md = triangle(model(), '../Exp/Pig.exp', 10000.)
+ md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+@@ -21,13 +22,14 @@
+ md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
+ md.transient.ismovingfront = 1
+ md.transient.isgroundingline = 1
+-md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
++md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
+ pos = np.where(md.mesh.vertexonboundary)
+ md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
++md.levelset.migration_max = 1e10
+ 
+ #Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+-md.cluster = generic('name', gethostname(), 'np', 2)
++md.cluster = generic('name', oshostname(), 'np', 2)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 25840)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 25841)
+@@ -1,12 +1,13 @@
+-#Test Name: PigTranCalvingDevd
++#Test Name: PigTranCalvingDevdHO3d
++import numpy as np
++from calvingvonmises import *
++from MatlabFuncs import oshostname
+ from model import *
+-from socket import gethostname
+-from triangle import *
+-from setmask import *
+ from parameterize import *
+ from setflowequation import *
++from setmask import *
+ from solve import *
+-from calvingvonmises import *
++from triangle import *
+ 
+ md = triangle(model(), '../Exp/Pig.exp', 10000.)
+ md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+@@ -21,13 +22,14 @@
+ 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, ))
++md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
+ pos = np.where(md.mesh.vertexonboundary)
+ md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
++md.levelset.migration_max = 1e10
+ 
+ #Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+-md.cluster = generic('name', gethostname(), 'np', 2)
++md.cluster = generic('name', oshostname(), 'np', 2)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25840)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25841)
+@@ -1,5 +1,5 @@
+ # NOTE: This configuration adds solid earth and Dakota capabilities to the 
+-		basic build.
++#		basic build.
+ 
+ #--------------------#
+ # ISSM Configuration #
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25840)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25841)
+@@ -1,5 +1,5 @@
+ # NOTE: This configuration adds solid earth and Dakota capabilities to the 
+-		basic build, as well as the ability to debug with Valgrind.
++#		basic build, as well as the ability to debug with Valgrind.
+ 
+ #--------------------#
+ # ISSM Configuration #
+Index: ../trunk-jpl/test/NightlyRun/test804.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test804.py	(revision 25840)
++++ ../trunk-jpl/test/NightlyRun/test804.py	(revision 25841)
+@@ -1,11 +1,12 @@
+ #Test Name: ValleyGlacierLevelsetCalvingSIA2d
++import numpy as np
++from MatlabFuncs import oshostname
+ from model import *
+-from socket import gethostname
+-from triangle import *
+-from setmask import *
+ from parameterize import *
+ from setflowequation import *
++from setmask import *
+ from solve import *
++from triangle import *
+ 
+ 
+ md = triangle(model(), '../Exp/Square.exp', 50000)
+@@ -12,7 +13,7 @@
+ md = setmask(md, '', '')
+ md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+ md = setflowequation(md, 'SIA', 'all')
+-md.cluster = generic('name', gethostname(), 'np', 3)
++md.cluster = generic('name', oshostname(), 'np', 3)
+ 
+ #Transient
+ md.transient.isstressbalance = True
+@@ -25,6 +26,7 @@
+ 
+ md.calving.calvingrate = 1000. * np.ones((md.mesh.numberofvertices))
+ md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
++md.levelset.migration_max = 1e10
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test805.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test805.py	(revision 25840)
++++ ../trunk-jpl/test/NightlyRun/test805.py	(revision 25841)
+@@ -1,11 +1,12 @@
+ #Test Name: ValleyGlacierLevelsetEnthCalvingHO3d
++import numpy as np
++from MatlabFuncs import oshostname
+ from model import *
+-from socket import gethostname
+-from triangle import *
+-from setmask import *
+ from parameterize import *
+ from setflowequation import *
++from setmask import *
+ from solve import *
++from triangle import *
+ 
+ 
+ md = triangle(model(), '../Exp/Square.exp', 50000)
+@@ -13,7 +14,7 @@
+ md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+ md.extrude(3, 2.)
+ md = setflowequation(md, 'HO', 'all')
+-md.cluster = generic('name', gethostname(), 'np', 3)
++md.cluster = generic('name', oshostname(), 'np', 3)
+ 
+ #Thermal model
+ pos_surf = np.nonzero(md.mesh.vertexonsurface)[0]
+@@ -34,6 +35,7 @@
+ md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+ md.groundingline.melt_interpolation = 'SubelementMelt1'
+ md.levelset.stabilization = 2
++md.levelset.migration_max = 1e10
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test806.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test806.py	(revision 25840)
++++ ../trunk-jpl/test/NightlyRun/test806.py	(revision 25841)
+@@ -1,19 +1,18 @@
+ #Test Name: SquareShelfLevelsetCalvingSSA2dLevermann
++import numpy as np
++from MatlabFuncs import oshostname
+ from model import *
+-from socket import gethostname
+-from triangle import *
+-from setmask import *
+ from parameterize import *
+ from setflowequation import *
++from setmask import *
+ from solve import *
++from triangle import *
+ 
+-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.cluster = generic('name', oshostname(), 'np', 3)
+ 
+ x = md.mesh.x
+ xmin = min(x)
+@@ -41,6 +40,7 @@
+ md.calving.coeff = 4.89e13 * np.ones((md.mesh.numberofvertices))
+ md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+ md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
++md.levelset.migration_max = 1e8
+ 
+ md.transient.requested_outputs = ['default', 'StrainRateparallel', 'StrainRateperpendicular', 'Calvingratex', 'Calvingratey', 'CalvingCalvingrate']
+ 
+Index: ../trunk-jpl/test/NightlyRun/test808.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test808.py	(revision 25840)
++++ ../trunk-jpl/test/NightlyRun/test808.py	(revision 25841)
+@@ -1,19 +1,19 @@
+ #Test Name: SquareShelfLevelsetCalvingSSA2dMinThickness
++import numpy as np
++from calvingminthickness import *
++from MatlabFuncs import oshostname
+ from model import *
+-from socket import gethostname
+-from triangle import *
+-from setmask import *
+ from parameterize import *
+ from setflowequation import *
++from setmask import *
+ from solve import *
+-import numpy as np
+-from calvingminthickness import *
++from triangle import *
+ 
+ md = triangle(model(), '../Exp/Square.exp', 30000.)
+ md = setmask(md, 'all', '')
+ md = parameterize(md, '../Par/SquareShelf.py')
+ md = setflowequation(md, 'SSA', 'all')
+-md.cluster = generic('name', gethostname(), 'np', 3)
++md.cluster = generic('name', oshostname(), 'np', 3)
+ 
+ #Do not kill ice bergs as all is floating
+ md.levelset.kill_icebergs = 0
+@@ -40,8 +40,9 @@
+ md.calving = calvingminthickness()
+ md.calving.min_thickness = 400
+ md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
+-md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
++md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
+ md.levelset.reinit_frequency = 1
++md.levelset.migration_max = 1e10
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test809.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test809.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test809.py	(revision 25841)
+@@ -0,0 +1,66 @@
++#Test Name: ValleyGlacierLevelsetCalvingSSA2dCrevassedepth
++import numpy as np
++from calvingcrevassedepth import *
++from MatlabFuncs import oshostname
++from model import *
++from parameterize import *
++from setflowequation import *
++from setmask import *
++from solve import *
++from triangle import *
++
++md = triangle(model(), '../Exp/Square.exp', 50000.)
++md = setmask(md, '', '')
++md = parameterize(md, '../Par/ValleyGlacierShelf.py')
++md = setflowequation(md, 'SSA', 'all')
++md.timestepping.time_step = 2
++md.timestepping.final_time = 50
++md.cluster = generic('name', 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 * np.ones((md.mesh.numberofvertices, ))
++md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
++md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices, ))
++md.levelset.reinit_frequency = 1
++md.levelset.migration_max = 1e10
++
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1'
++               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2'
++               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Thickness10', 'Surface10', 'MaskIceLevelset10']
++field_tolerances = [1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9,
++                    1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9,
++                    1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9]
++field_values = [md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Vel,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].MaskIceLevelset,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Vel,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].MaskIceLevelset,
++                md.results.TransientSolution[11].Vx,
++                md.results.TransientSolution[11].Vy,
++                md.results.TransientSolution[11].Vel,
++                md.results.TransientSolution[11].Pressure,
++                md.results.TransientSolution[11].Thickness,
++                md.results.TransientSolution[11].Surface,
++                md.results.TransientSolution[11].MaskIceLevelset]
Index: /issm/oecreview/Archive/25834-26739/ISSM-25841-25842.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25841-25842.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25841-25842.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/levelset.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.m	(revision 25841)
++++ ../trunk-jpl/src/m/classes/levelset.m	(revision 25842)
+@@ -41,7 +41,7 @@
+ 			self.stabilization    = 1;
+ 			self.reinit_frequency = 5;
+ 			self.kill_icebergs    = 1;
+-			self.migration_max      = 3000.;
++			self.migration_max      = 1e12; % No need for general cases, unless specified
+ 
+ 			%Linear elements by default
+ 			self.fe='P1';
Index: /issm/oecreview/Archive/25834-26739/ISSM-25842-25843.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25842-25843.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25842-25843.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/levelset.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.py	(revision 25842)
++++ ../trunk-jpl/src/m/classes/levelset.py	(revision 25843)
+@@ -47,7 +47,7 @@
+         self.stabilization = 1
+         self.reinit_frequency = 5
+         self.kill_icebergs = 1
+-        self.migration_max = 3000.
++        self.migration_max = 1e12 # No need for general cases, unless specified
+ 
+     #Linear elements by default
+         self.fe = 'P1'
Index: /issm/oecreview/Archive/25834-26739/ISSM-25843-25844.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25843-25844.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25843-25844.diff	(revision 26740)
@@ -0,0 +1,89 @@
+Index: ../trunk-jpl/src/m/classes/calving.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/calving.py	(revision 25843)
++++ ../trunk-jpl/src/m/classes/calving.py	(revision 25844)
+@@ -15,22 +15,21 @@
+ 
+     def __init__(self):  # {{{
+         self.calvingrate = np.nan
+-        self.setdefaultparameters()
+-
++        #self.setdefaultparameters() # Uncomment if/when setdefaultparameters is used
+     #}}}
+ 
+     def __repr__(self):  # {{{
+         s = '   Calving parameters:'
+-        s += '{}\n'.format(fielddisplay(self, 'calvingrate', 'calving rate at given location [m / a]'))
++        s += '{}\n'.format(fielddisplay(self, 'calvingrate', 'calving rate at given location [m/a]'))
+         return s
+     #}}}
+ 
+-    def extrude(self, md):  # {{{
+-        self.calvingrate = project3d(md, 'vector', self.calvingrate, 'type', 'node')
++    def setdefaultparameters(self):  # {{{
+         return self
+     #}}}
+ 
+-    def setdefaultparameters(self):  # {{{
++    def extrude(self, md):  # {{{
++        self.calvingrate = project3d(md, 'vector', self.calvingrate, 'type', 'node')
+         return self
+     #}}}
+ 
+Index: ../trunk-jpl/src/m/classes/calvingcrevassedepth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/calvingcrevassedepth.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/calvingcrevassedepth.py	(revision 25844)
+@@ -0,0 +1,52 @@
++from checkfield import checkfield
++from fielddisplay import fielddisplay
++#from project3d import project3d # Uncomment if/when extrude is implemented
++from WriteData import WriteData
++
++
++class calvingcrevassedepth(object):
++    """CALVINCREVASSEDEPTH class definition
++
++    Usage:
++        calvingcrevassedepth = calvingcrevassedepth()
++    """
++
++    def __init__(self):  # {{{
++        self.crevasse_opening_stress = 1
++        self.water_height = 0
++
++        #self.setdefaultparameters() # Uncomment if/when setdefaultparameters is used
++    #}}}
++
++    def __repr__(self):  # {{{
++        s = '   Calving Pi parameters:'
++        s += '{}\n'.format(fielddisplay(self, 'crevasse_opening_stress', '0: stress only in the ice-flow direction, 1: max principal'))
++        s += '{}\n'.format(fielddisplay(self, 'water_height', 'water height in the crevasse [m]'))
++        return s
++    #}}}
++
++    def setdefaultparameters(self):  # {{{
++        return self
++    #}}}
++
++    def extrude(self, md):  # {{{
++        return self
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        #Early return
++        if solution != 'TransientSolution' or not md.transient.ismovingfront:
++            return md
++
++        md = checkfield(md, 'fieldname', 'calving.crevasse_opening_stress', 'numel', [1], 'values', [0,1])
++        md = checkfield(md, 'fieldname', 'calving.water_height', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0) 
++
++        return md
++    # }}}
++
++    def marshall(self, prefix, md, fid):  # {{{
++        yts = md.constants.yts
++        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 6, 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'crevasse_opening_stress', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'water_height', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++    # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-25844-25845.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25844-25845.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25844-25845.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/test/NightlyRun/test809.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test809.py	(revision 25844)
++++ ../trunk-jpl/test/NightlyRun/test809.py	(revision 25845)
+@@ -57,10 +57,10 @@
+                 md.results.TransientSolution[1].Thickness,
+                 md.results.TransientSolution[1].Surface,
+                 md.results.TransientSolution[1].MaskIceLevelset,
+-                md.results.TransientSolution[11].Vx,
+-                md.results.TransientSolution[11].Vy,
+-                md.results.TransientSolution[11].Vel,
+-                md.results.TransientSolution[11].Pressure,
+-                md.results.TransientSolution[11].Thickness,
+-                md.results.TransientSolution[11].Surface,
+-                md.results.TransientSolution[11].MaskIceLevelset]
++                md.results.TransientSolution[9].Vx,
++                md.results.TransientSolution[9].Vy,
++                md.results.TransientSolution[9].Vel,
++                md.results.TransientSolution[9].Pressure,
++                md.results.TransientSolution[9].Thickness,
++                md.results.TransientSolution[9].Surface,
++                md.results.TransientSolution[9].MaskIceLevelset]
Index: /issm/oecreview/Archive/25834-26739/ISSM-25845-25846.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25845-25846.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25845-25846.diff	(revision 26740)
@@ -0,0 +1,87 @@
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh	(revision 25845)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh	(revision 25846)
+@@ -13,9 +13,14 @@
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+-
+ # NOTE:
+ # - Certain configuration tests fail if libraries are not supplied explicitly
++#
++# TODO:
++# - Compile and link curl statically (issue with DAP and system libs on macOS 
++#	with more restirctive Gatekeeper; see also --disable-dap option in 
++#	configuration)
++#
+ 
+ # Constants
+ #
+@@ -71,6 +76,3 @@
+ 	make -j $1 check
+ 	make -j $1 install
+ fi
+-
+-# Return to initial directory
+-cd ..
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 25845)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 25846)
+@@ -13,9 +13,14 @@
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+-
+ # NOTE:
+ # - Certain configuration tests fail if libraries are not supplied explicitly
++#
++# TODO:
++# - Compile and link curl statically (issue with DAP and system libs on macOS 
++#	with more restirctive Gatekeeper; see also --disable-dap option in 
++#	configuration)
++#
+ 
+ # Constants
+ #
+@@ -68,6 +73,3 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
+-
+-# Return to initial directory
+-cd ..
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with_tests.sh	(revision 25845)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with_tests.sh	(revision 25846)
+@@ -66,6 +66,3 @@
+ 	make -j $1 check
+ 	make -j $1 install
+ fi
+-
+-# Return to initial directory
+-cd ..
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh	(revision 25845)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh	(revision 25846)
+@@ -63,6 +63,3 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
+-
+-# Return to initial directory
+-cd ..
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-with_tests.sh	(revision 25845)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-with_tests.sh	(revision 25846)
+@@ -64,6 +64,3 @@
+ 	make -j $1 check
+ 	make -j $1 install
+ fi
+-
+-# Return to initial directory
+-cd ..
Index: /issm/oecreview/Archive/25834-26739/ISSM-25846-25847.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25846-25847.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25846-25847.diff	(revision 26740)
@@ -0,0 +1,501 @@
+Index: ../trunk-jpl/etc/environment.csh
+===================================================================
+--- ../trunk-jpl/etc/environment.csh	(revision 25846)
++++ ../trunk-jpl/etc/environment.csh	(revision 25847)
+@@ -3,8 +3,10 @@
+ #Load ISSM scripts
+ setenv PATH {$PATH}:{$ISSM_DIR}/scripts
+ 
++ISSM_EXT_DIR="{$ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
++
+ #MPI
+-set MPI_DIR="$ISSM_DIR/externalpackages/mpich/install"
++set MPI_DIR="{$ISSM_EXT_DIR}/mpich/install"
+ if (-d $MPI_DIR) then
+ 	setenv MPI_DIR {$MPI_DIR}
+ 	setenv PATH {$MPI_DIR}/bin:{$PATH}
+@@ -13,31 +15,31 @@
+ endif
+ 
+ #PETSC
+-set PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
++set PETSC_DIR="{$ISSM_EXT_DIR}/petsc/install"
+ if (-d $PETSC_DIR) then
+ 	setenv PETSC_DIR {$PETSC_DIR}
+ 	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$PETSC_DIR/lib
+ endif
+ 
+-set SCOTCH_DIR="$ISSM_DIR/externalpackages/scotch/install"
++set SCOTCH_DIR="{$ISSM_EXT_DIR}/scotch/install"
+ if (-d $SCOTCH_DIR) then
+ 	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SCOTCH_DIR/lib
+ endif
+ 
+ #SLEPC
+-set SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
++set SLEPC_DIR="{$ISSM_EXT_DIR}/slepc/install"
+ if (-d $SLEPC_DIR) then
+ 	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib
+ endif
+ 
+ #PETSC
+-set TAO_DIR="$ISSM_DIR/externalpackages/tao/install"
++set TAO_DIR="{$ISSM_EXT_DIR}/tao/install"
+ if (-d $TAO_DIR) then
+ 	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$TAO_DIR/lib
+ endif
+ 
+ #Dakota
+-set DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
++set DAKOTA_DIR="{$ISSM_EXT_DIR}/dakota/install"
+ if (-d $DAKOTA_DIR) then
+ 	setenv PATH {$DAKOTA_DIR}/bin:{$PATH}
+ 	setenv MANPATH {$MANPATH}:{$MPI_DIR}/man:{$DAKOTA_DIR}/docs/man:{$DAKOTA_DIR}/docs/man-ref
+@@ -45,8 +47,8 @@
+ endif
+ 
+ #Boost
+-set BOOST_DIR="$ISSM_DIR/externalpackages/boost/install"
+-set BOOSTROOT="$ISSM_DIR/externalpackages/boost/install"
++set BOOST_DIR="{$ISSM_EXT_DIR}/boost/install"
++set BOOSTROOT="{$ISSM_EXT_DIR}/boost/install"
+ if (-d $BOOST_DIR) then
+    setenv PATH {$BOOST_DIR}/bin:{$PATH}
+ 	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$BOOST_DIR/lib
+@@ -53,7 +55,7 @@
+ endif
+ 
+ #Doxygen
+-set DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
++set DOXYGEN_DIR="{$ISSM_EXT_DIR}/doxygen/install"
+ if (-d $DOXYGEN_DIR) then
+ 	setenv MANPATH {$MANPATH}:{$DOXYGEN_DIR}/man
+ 	setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin
+@@ -60,25 +62,25 @@
+ endif
+ 
+ #AUTOTOOLS
+-set AUTOTOOLS_DIR="$ISSM_DIR/externalpackages/autotools/install"
++set AUTOTOOLS_DIR="{$ISSM_EXT_DIR}/autotools/install"
+ if (-d $AUTOTOOLS_DIR) then
+ 	setenv PATH {$AUTOTOOLS_DIR}/bin:{$PATH}
+ endif
+ 
+ #SSH
+-set SSH_DIR="$ISSM_DIR/externalpackages/ssh"
++set SSH_DIR="{$ISSM_EXT_DIR}/ssh"
+ if (-d $SSH_DIR) then
+ 	setenv PATH {$PATH}:{$SSH_DIR}
+ endif
+ 
+ #VALGRIND
+-set VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"
++set VALGRIND_DIR="{$ISSM_EXT_DIR}/valgrind/install/bin"
+ if (-d $VALGRIND_DIR) then
+ 	setenv PATH {$PATH}:{$VALGRIND_DIR}
+ endif
+ 
+ #MERCURIAL
+-set MERCURIAL_DIR="$ISSM_DIR/externalpackages/mercurial/install"
++set MERCURIAL_DIR="{$ISSM_EXT_DIR}/mercurial/install"
+ if (-d $MERCURIAL_DIR) then
+ 	setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/
+ 	setenv PATH {$PATH}:{$MERCURIAL_DIR}
+@@ -85,31 +87,31 @@
+ endif
+ 
+ #GSL
+-set GSL_DIR="$ISSM_DIR/externalpackages/gsl/install"
++set GSL_DIR="{$ISSM_EXT_DIR}/gsl/install"
+ if (-d $GSL_DIR) then
+ 	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib
+ endif
+ 
+ #CMAKE
+-set CMAKE_DIR="$ISSM_DIR/externalpackages/cmake/install"
++set CMAKE_DIR="{$ISSM_EXT_DIR}/cmake/install"
+ if (-d $CMAKE_DIR) then
+ 	setenv PATH {$CMAKE_DIR}/bin:{$PATH}
+ endif
+ 
+ #YAMS
+-set YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
++set YAMS_DIR="{$ISSM_EXT_DIR}/yams/install"
+ if (-d $YAMS_DIR) then
+ 	setenv PATH {$PATH}:{$YAMS_DIR}/bin
+ endif
+ 
+ #SHELL2JUNIT
+-set SHELL2JUNIT_DIR="$ISSM_DIR/externalpackages/shell2junit"
++set SHELL2JUNIT_DIR="{$ISSM_EXT_DIR}/shell2junit"
+ if (-d $SHELL2JUNIT_DIR) then
+ 	setenv PATH {$SHELL2JUNIT_DIR}/install:{$PATH}
+ endif
+ 
+ #GMT
+-set GMT_DIR="$ISSM_DIR/externalpackages/gmt"
++set GMT_DIR="{$ISSM_EXT_DIR}/gmt"
+ if (-d $GMT_DIR) then
+ 	setenv PATH {$GMT_DIR}/install/bin/:{$PATH}
+ endif
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25846)
++++ ../trunk-jpl/etc/environment.sh	(revision 25847)
+@@ -172,18 +172,20 @@
+ # Load ISSM scripts
+ path_append "${ISSM_DIR}/scripts"
+ 
+-SVN_DIR="${ISSM_DIR}/externalpackages/svn/install"
++ISSM_EXT_DIR="${ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
++
++SVN_DIR="${ISSM_EXT_DIR}/svn/install"
+ if [ -d "${SVN_DIR}" ]; then
+ 	path_prepend   "${SVN_DIR}/bin"
+ 	ld_library_path_append "${SVN_DIR}/lib"
+ fi
+ 
+-GIT_DIR="${ISSM_DIR}/externalpackages/git/install"
++GIT_DIR="${ISSM_EXT_DIR}/git/install"
+ if [ -d "${GIT_DIR}" ]; then
+ 	path_prepend "${GIT_DIR}/bin"
+ fi
+ 
+-MPI_DIR="${ISSM_DIR}/externalpackages/mpich/install"
++MPI_DIR="${ISSM_EXT_DIR}/mpich/install"
+ if [ -d "${MPI_DIR}" ]; then
+ 	export MPI_DIR
+ 	export MPI_HOME=${MPI_DIR} # Needed by Dakota
+@@ -193,7 +195,7 @@
+ 	ld_library_path_append "${MPI_DIR}/lib"
+ fi
+ 
+-PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/install"
++PETSC_DIR="${ISSM_EXT_DIR}/petsc/install"
+ if [ -d "$PETSC_DIR" ]; then
+ 	export PETSC_DIR
+ 	ld_library_path_prepend "${PETSC_DIR}/lib"
+@@ -209,19 +211,19 @@
+ 	fi
+ fi
+ 
+-LAPACK_DIR="${ISSM_DIR}/externalpackages/lapack/install"
++LAPACK_DIR="${ISSM_EXT_DIR}/lapack/install"
+ ld_library_path_append "${LAPACK_DIR}/lib"
+ 
+-SCOTCH_DIR="${ISSM_DIR}/externalpackages/scotch/install"
++SCOTCH_DIR="${ISSM_EXT_DIR}/scotch/install"
+ ld_library_path_append "$SCOTCH_DIR/lib"
+ 
+-SLEPC_DIR="${ISSM_DIR}/externalpackages/slepc/install"
++SLEPC_DIR="${ISSM_EXT_DIR}/slepc/install"
+ ld_library_path_append "$SLEPC_DIR/lib"
+ 
+-TAO_DIR="${ISSM_DIR}/externalpackages/tao/install"
++TAO_DIR="${ISSM_EXT_DIR}/tao/install"
+ ld_library_path_append "$TAO_DIR/lib"
+ 
+-DAKOTA_DIR="${ISSM_DIR}/externalpackages/dakota/install"
++DAKOTA_DIR="${ISSM_EXT_DIR}/dakota/install"
+ if [ -d "${DAKOTA_DIR}" ]; then
+ 	path_append "${DAKOTA_DIR}/bin"
+ 	ld_library_path_append "${DAKOTA_DIR}/lib"
+@@ -228,35 +230,35 @@
+ 	dyld_library_path_prepend "${DAKOTA_DIR}/lib"
+ fi
+ 
+-DOXYGEN_DIR="${ISSM_DIR}/externalpackages/doxygen/install"
++DOXYGEN_DIR="${ISSM_EXT_DIR}/doxygen/install"
+ path_prepend "$DOXYGEN_DIR/bin"
+ 
+-AUTOTOOLS_DIR="${ISSM_DIR}/externalpackages/autotools/install"
++AUTOTOOLS_DIR="${ISSM_EXT_DIR}/autotools/install"
+ path_prepend "$AUTOTOOLS_DIR/bin"
+ 
+ SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
+ path_append "$SDK_DIR"
+ 
+-SSH_DIR="${ISSM_DIR}/externalpackages/ssh"
++SSH_DIR="${ISSM_EXT_DIR}/ssh"
+ path_append "$SSH_DIR"
+ 
+-VALGRIND_DIR="${ISSM_DIR}/externalpackages/valgrind/install"
++VALGRIND_DIR="${ISSM_EXT_DIR}/valgrind/install"
+ path_prepend "$VALGRIND_DIR/bin"
+ 
+-NCO_DIR="${ISSM_DIR}/externalpackages/nco/install/bin"
++NCO_DIR="${ISSM_EXT_DIR}/nco/install/bin"
+ path_prepend "$NCO_DIR/bin"
+ 
+-CPPCHECK_DIR="${ISSM_DIR}/externalpackages/cppcheck/install"
++CPPCHECK_DIR="${ISSM_EXT_DIR}/cppcheck/install"
+ path_append "$CPPCHECK_DIR/bin"
+ 
+-MERCURIAL_DIR="${ISSM_DIR}/externalpackages/mercurial/install"
++MERCURIAL_DIR="${ISSM_EXT_DIR}/mercurial/install"
+ if [ -d "$MERCURIAL_DIR" ]; then
+ 	export PYTHONPATH="$PYTHONPATH:$MERCURIAL_DIR/mercurial/pure/"
+ 	path_append "$MERCURIAL_DIR"
+ fi
+ 
+-BOOST_DIR="${ISSM_DIR}/externalpackages/boost/install"
+-BOOSTROOT="${ISSM_DIR}/externalpackages/boost/install"
++BOOST_DIR="${ISSM_EXT_DIR}/boost/install"
++BOOSTROOT="${ISSM_EXT_DIR}/boost/install"
+ if [ -d "${BOOST_DIR}" ]; then
+ 	export BOOSTROOT
+ 	export BOOST_DIR
+@@ -266,14 +268,14 @@
+ 	path_prepend "${BOOST_DIR}/bin"
+ fi
+ 
+-XERCESROOT="${ISSM_DIR}/externalpackages/xerces/install"
++XERCESROOT="${ISSM_EXT_DIR}/xerces/install"
+ if [ -d "$XERCESROOT" ]; then
+ 	export XERCESROOT
+-	export XERCESCROOT="${ISSM_DIR}/externalpackages/xerces/src"
++	export XERCESCROOT="${ISSM_EXT_DIR}/xerces/src"
+ fi
+ 
+ 
+-XAIFBOOSTERROOT="${ISSM_DIR}/externalpackages/xaifbooster"
++XAIFBOOSTERROOT="${ISSM_EXT_DIR}/xaifbooster"
+ XAIF_DIR="${XAIFBOOSTERROOT}/xaifBooster"
+ if [ -d "$XAIF_DIR" ]; then
+ 	export XAIFBOOSTERROOT
+@@ -282,12 +284,12 @@
+ 	export PLATFORM="x86-Linux"
+ fi
+ 
+-ANGELROOT="${ISSM_DIR}/externalpackages/angel/angel"
++ANGELROOT="${ISSM_EXT_DIR}/angel/angel"
+ if [ -d "$ANGELROOT" ]; then
+ 	export ANGELROOT
+ fi
+ 
+-OPENANALYSISROOT="${ISSM_DIR}/externalpackages/openanalysis/install"
++OPENANALYSISROOT="${ISSM_EXT_DIR}/openanalysis/install"
+ if [ -d "$OPENANALYSISROOT" ]; then
+ 	export OPENANALYSISROOT
+ 	ld_library_path_append "$OPENANALYSISROOT/lib"
+@@ -296,42 +298,42 @@
+ JVM_DIR="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/"
+ ld_library_path_append "$JVM_DIR"
+ 
+-BBFTP_DIR="${ISSM_DIR}/externalpackages/bbftp/install"
++BBFTP_DIR="${ISSM_EXT_DIR}/bbftp/install"
+ path_append "$BBFTP_DIR/bin"
+ 
+-ADIC_DIR="${ISSM_DIR}/externalpackages/adic/install"
++ADIC_DIR="${ISSM_EXT_DIR}/adic/install"
+ path_append "$ADIC_DIR/bin"
+ ld_library_path_append "$ADIC_DIR/lib"
+ 
+-COLPACK_DIR="${ISSM_DIR}/externalpackages/colpack/install"
++COLPACK_DIR="${ISSM_EXT_DIR}/colpack/install"
+ ld_library_path_append "$COLPACK_DIR/lib"
+ 
+-ECLIPSE_DIR="${ISSM_DIR}/externalpackages/eclipse/install"
++ECLIPSE_DIR="${ISSM_EXT_DIR}/eclipse/install"
+ path_append "$ECLIPSE_DIR"
+ 
+-APPSCAN_DIR="${ISSM_DIR}/externalpackages/appscan/install"
++APPSCAN_DIR="${ISSM_EXT_DIR}/appscan/install"
+ path_append "$APPSCAN_DIR/bin"
+ 
+-RATS_DIR="${ISSM_DIR}/externalpackages/rats/install"
++RATS_DIR="${ISSM_EXT_DIR}/rats/install"
+ path_append "$RATS_DIR/bin"
+ 
+-DYSON_DIR="${ISSM_DIR}/externalpackages/dyson/"
++DYSON_DIR="${ISSM_EXT_DIR}/dyson/"
+ path_append "$DYSON_DIR"
+ 
+-CMAKE_DIR="${ISSM_DIR}/externalpackages/cmake/install"
++CMAKE_DIR="${ISSM_EXT_DIR}/cmake/install"
+ path_prepend "$CMAKE_DIR/bin"
+ 
+-SHAPELIB_DIR="${ISSM_DIR}/externalpackages/shapelib/install"
++SHAPELIB_DIR="${ISSM_EXT_DIR}/shapelib/install"
+ path_append "$SHAPELIB_DIR/exec"
+ 
+-CCCL_DIR="${ISSM_DIR}/externalpackages/cccl/install"
++CCCL_DIR="${ISSM_EXT_DIR}/cccl/install"
+ path_append "$CCCL_DIR/bin"
+ 
+-PACKAGEMAKER_DIR="${ISSM_DIR}/externalpackages/packagemaker/install"
++PACKAGEMAKER_DIR="${ISSM_EXT_DIR}/packagemaker/install"
+ path_append "$PACKAGEMAKER_DIR"
+ 
+ #android-dev-dir
+-export ANDROID_DIR="${ISSM_DIR}/externalpackages/android"
++export ANDROID_DIR="${ISSM_EXT_DIR}/android"
+ 
+ export ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
+ path_append "$ANDROID_NDK_DIR/arm-linux-android-install/bin"
+@@ -339,25 +341,25 @@
+ export ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install"
+ path_append "$ANDROID_SDK_DIR/"
+ 
+-GSL_DIR="${ISSM_DIR}/externalpackages/gsl/install"
++GSL_DIR="${ISSM_EXT_DIR}/gsl/install"
+ ld_library_path_append "$GSL_DIR/lib"
+ 
+-GMAKE_DIR="${ISSM_DIR}/externalpackages/gmake/install"
++GMAKE_DIR="${ISSM_EXT_DIR}/gmake/install"
+ path_prepend "$GMAKE_DIR/bin"
+ 
+-MODELE_DIR="${ISSM_DIR}/externalpackages/modelE/install"
++MODELE_DIR="${ISSM_EXT_DIR}/modelE/install"
+ path_append "$MODELE_DIR/src/exec"
+ 
+-NCVIEW_DIR="${ISSM_DIR}/externalpackages/ncview/install"
++NCVIEW_DIR="${ISSM_EXT_DIR}/ncview/install"
+ path_append "$NCVIEW_DIR"
+ 
+-TCLX_DIR="${ISSM_DIR}/externalpackages/tclx/install/lib/tclx8.4"
++TCLX_DIR="${ISSM_EXT_DIR}/tclx/install/lib/tclx8.4"
+ ld_library_path_append "$TCLX_DIR"
+ 
+-ASPELL_DIR="${ISSM_DIR}/externalpackages/aspell/install"
++ASPELL_DIR="${ISSM_EXT_DIR}/aspell/install"
+ path_append "$ASPELL_DIR/bin"
+ 
+-NETCDF_DIR="${ISSM_DIR}/externalpackages/netcdf/install"
++NETCDF_DIR="${ISSM_EXT_DIR}/netcdf/install"
+ if [ -d "${NETCDF_DIR}" ]; then
+ 	path_append "${NETCDF_DIR}/bin"
+ 	cpath_append "${NETCDF_DIR}/include"
+@@ -366,12 +368,12 @@
+ 	ld_library_path_append "${NETCDF_DIR}/lib"
+ fi
+ 
+-NETCDF_CXX_DIR="${ISSM_DIR}/externalpackages/netcdf-cxx/install"
++NETCDF_CXX_DIR="${ISSM_EXT_DIR}/netcdf-cxx/install"
+ if [ -d "${NETCDF_CXX_DIR}" ]; then
+ 	ld_library_path_append "${NETCDF_CXX_DIR}/lib"
+ fi
+ 
+-NETCDF_PYTHON_DIR="${ISSM_DIR}/externalpackages/netcdf-python/install"
++NETCDF_PYTHON_DIR="${ISSM_EXT_DIR}/netcdf-python/install"
+ if [ -d "${NETCDF_PYTHON_DIR}" ]; then
+ 	if [ -d "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages" ]; then
+ 		ld_library_path_append "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages"
+@@ -378,7 +380,7 @@
+ 	fi
+ fi
+ 
+-HDF5_DIR="${ISSM_DIR}/externalpackages/hdf5/install"
++HDF5_DIR="${ISSM_EXT_DIR}/hdf5/install"
+ if [ -d "${HDF5_DIR}" ]; then
+ 	cpath_append "${HDF5_DIR}/include"
+ 	library_path_append "${HDF5_DIR}/lib"
+@@ -386,7 +388,7 @@
+ 	ld_library_path_append "${HDF5_DIR}/lib"
+ fi
+ 
+-SQLITE_DIR="${ISSM_DIR}/externalpackages/sqlite/install"
++SQLITE_DIR="${ISSM_EXT_DIR}/sqlite/install"
+ if [ -d "${SQLITE_DIR}" ]; then
+ 	path_append "${SQLITE_DIR}/bin"
+ 	library_path_append "${SQLITE_DIR}/lib"
+@@ -393,50 +395,50 @@
+ 	ld_library_path_append "${SQLITE_DIR}/lib"
+ fi
+ 
+-PROJ_DIR="${ISSM_DIR}/externalpackages/proj/install"
++PROJ_DIR="${ISSM_EXT_DIR}/proj/install"
+ if [ -d "${PROJ_DIR}" ]; then
+ 	dyld_library_path_prepend "${PROJ_DIR}/lib"
+ 	ld_library_path_prepend "${PROJ_DIR}/lib"
+ fi
+ 
+-GDAL_DIR="${ISSM_DIR}/externalpackages/gdal/install"
++GDAL_DIR="${ISSM_EXT_DIR}/gdal/install"
+ if [ -d "${GDAL_DIR}" ]; then
+ 	path_prepend "${GDAL_DIR}/bin"
+ 	ld_library_path_append "${GDAL_DIR}/lib"
+ fi
+ 
+-ESMF_DIR="${ISSM_DIR}/externalpackages/esmf/install"
++ESMF_DIR="${ISSM_EXT_DIR}/esmf/install"
+ if [ -d "${ESMF_DIR}" ]; then
+ 	path_prepend "${ESMF_DIR}/bin"
+ 	ld_library_path_append "${ESMF_DIR}/lib/libO/Linux.gfortran.64.mpich.default/"
+ fi
+ 
+-GMT_DIR="${ISSM_DIR}/externalpackages/gmt/install"
++GMT_DIR="${ISSM_EXT_DIR}/gmt/install"
+ if [ -d "${GMT_DIR}" ]; then
+ 	export GMT_DIR
+ 	path_prepend "${GMT_DIR}/bin"
+ fi
+ 
+-GMSH_DIR="${ISSM_DIR}/externalpackages/gmsh/install"
++GMSH_DIR="${ISSM_EXT_DIR}/gmsh/install"
+ if [ -d "${GMSH_DIR}" ]; then
+-	path_append "${ISSM_DIR}/externalpackages/gmsh/install"
++	path_append "${ISSM_EXT_DIR}/gmsh/install"
+ fi
+ 
+-CVS_DIR="${ISSM_DIR}/externalpackages/cvs/install"
++CVS_DIR="${ISSM_EXT_DIR}/cvs/install"
+ path_prepend "$CVS_DIR/bin"
+ 
+-APR_DIR="${ISSM_DIR}/externalpackages/apr/install"
++APR_DIR="${ISSM_EXT_DIR}/apr/install"
+ path_append "$APR_DIR/bin"
+ ld_library_path_append "$APR_DIR/lib"
+ 
+-APR_UTIL_DIR="${ISSM_DIR}/externalpackages/apr-util/install"
++APR_UTIL_DIR="${ISSM_EXT_DIR}/apr-util/install"
+ path_prepend "$APR_UTIL_DIR/bin"
+ ld_library_path_append "$APR_UTIL_DIR/lib"
+ 
+-YAMS_DIR="${ISSM_DIR}/externalpackages/yams/install"
++YAMS_DIR="${ISSM_EXT_DIR}/yams/install"
+ path_append "$YAMS_DIR"
+ 
+-SWIG_DIR="${ISSM_DIR}/externalpackages/swig/install"
++SWIG_DIR="${ISSM_EXT_DIR}/swig/install"
+ path_append "$SWIG_DIR"
+ 
+ #AUX-CONFIG
+@@ -443,17 +445,17 @@
+ path_append "${ISSM_DIR}/aux-config"
+ 
+ #INISHELL
+-path_append "${ISSM_DIR}/externalpackages/inishell/install"
++path_append "${ISSM_EXT_DIR}/inishell/install"
+ 
+ #SHELL2JUNIT
+-path_append "${ISSM_DIR}/externalpackages/shell2junit/install"
++path_append "${ISSM_EXT_DIR}/shell2junit/install"
+ 
+ #EXPAT
+-ld_library_path_prepend "${ISSM_DIR}/externalpackages/expat/install"
+-dyld_library_path_prepend "${ISSM_DIR}/externalpackages/expat/install"
++ld_library_path_prepend "${ISSM_EXT_DIR}/expat/install"
++dyld_library_path_prepend "${ISSM_EXT_DIR}/expat/install"
+ 
+ #CURL
+-CURL_DIR="${ISSM_DIR}/externalpackages/curl/install"
++CURL_DIR="${ISSM_EXT_DIR}/curl/install"
+ if [ -d "${CURL_DIR}" ]; then
+ 	ld_library_path_prepend "${CURL_DIR}/lib"
+ 	dyld_library_path_prepend "${CURL_DIR}/lib"
+@@ -461,12 +463,12 @@
+ fi
+ 
+ #NEOPZ
+-NEOPZ_DIR="${ISSM_DIR}/externalpackages/neopz/install"
++NEOPZ_DIR="${ISSM_EXT_DIR}/neopz/install"
+ if [ -d "$NEOPZ_DIR" ]; then
+ 	export REFPATTERNDIR="$NEOPZ_DIR/include/refpatterns"
+ fi
+ 
+-TRIANGLE_DIR="${ISSM_DIR}/externalpackages/triangle/install"
++TRIANGLE_DIR="${ISSM_EXT_DIR}/triangle/install"
+ if [ -d "${TRIANGLE_DIR}" ]; then
+ 	ld_library_path_append "${TRIANGLE_DIR}/lib"
+ 	dyld_library_path_append "${TRIANGLE_DIR}/lib"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25847-25848.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25847-25848.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25847-25848.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test905.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test905.m	(revision 25847)
++++ ../trunk-jpl/test/NightlyRun/test905.m	(revision 25848)
+@@ -59,7 +59,7 @@
+ 	     'SedimentWaterHead5','EplWaterHead5','SedimentHeadResidual5',...
+ 	     'SedimentWaterHead9','EplWaterHead9','SedimentHeadResidual9',...
+ 	     'EplWaterHead20','EplWaterHeadSubstep20','SedimentWaterHead20',...
+-	     'SedimentWaterHeadSubstep20'}
++	     'SedimentWaterHeadSubstep20'};
+ field_tolerances={1e-13,1e-13,1e-13,...
+ 		  1e-13,1e-13,1e-13,...
+ 		  1e-13,5e-12,1e-11,...
Index: /issm/oecreview/Archive/25834-26739/ISSM-25848-25849.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25848-25849.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25848-25849.diff	(revision 26740)
@@ -0,0 +1,65 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25848)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25849)
+@@ -50,7 +50,7 @@
+ 	proj		install-6.2.sh
+ 	gdal		install-3-python-netcdf.sh
+ 	gshhg		install.sh
+-	gmt			install-6.0-mac.sh
++	gmt			install-6-mac.sh
+ 	gmsh		install-4.sh
+ 	triangle	install-mac.sh
+ 	chaco		install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25848)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25849)
+@@ -50,7 +50,7 @@
+ 	proj		install-6.2.sh
+ 	gdal		install-3-python-netcdf.sh
+ 	gshhg		install.sh
+-	gmt			install-6.0-mac.sh
++	gmt			install-6-mac.sh
+ 	gmsh		install-4.sh
+ 	triangle	install-mac.sh
+ 	chaco		install.sh
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25848)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25849)
+@@ -70,7 +70,7 @@
+ ## Constants
+ #
+ MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2006,2020,2021,2051,2052,2053,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+-MATLAB_PATH="/Applications/MATLAB_R2019b.app"
++MATLAB_PATH="/Applications/MATLAB_R2018a.app"
+ NOTARIZATION_LOGFILE="notarization.log"
+ PASSWORD=$env:issm-binaries-pass
+ PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25848)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25849)
+@@ -82,7 +82,7 @@
+ NOTARIZATION_LOGFILE="notarization.log"
+ NOTARIZATION_LOGFILE_PATH="."
+ PKG="ISSM-macOS-MATLAB"
+-PRIMARY_BUNDLE_ID="**********.issm.matlab" # Maybe "nasa.jpl.issm.matlab"?
++PRIMARY_BUNDLE_ID="**********.issm.matlab" # Should be "gov.nasa.jpl.issm.matlab"
+ RETRIGGER_SIGNING_FILE="retrigger.txt"
+ SIGNED_REPO_COPY="./signed"
+ SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25848)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25849)
+@@ -78,7 +78,7 @@
+ NOTARIZATION_LOGFILE="notarization.log"
+ NOTARIZATION_LOGFILE_PATH="."
+ PKG="ISSM-macOS-Python"
+-PRIMARY_BUNDLE_ID="**********.issm.python" # Maybe "nasa.jpl.issm.matlab"?
++PRIMARY_BUNDLE_ID="**********.issm.python" # Should be "gov.nasa.jpl.issm.python"
+ RETRIGGER_SIGNING_FILE="retrigger.txt"
+ SIGNED_REPO_COPY="./signed"
+ SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25849-25850.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25849-25850.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25849-25850.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test350.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test350.py	(revision 25849)
++++ ../trunk-jpl/test/NightlyRun/test350.py	(revision 25850)
+@@ -20,7 +20,7 @@
+ md.transient = transient.deactivateall(md.transient)
+ md.transient.ishydrology = 1
+ md = setflowequation(md, 'SSA', 'all')
+-md.cluster = generic('name', gethostname(), 'np', 2)
++md.cluster = generic('name', oshostname(), 'np', 2)
+ 
+ #Use hydrology coupled friction law
+ md.friction = frictionshakti(md.friction)
Index: /issm/oecreview/Archive/25834-26739/ISSM-25850-25851.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25850-25851.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25850-25851.diff	(revision 26740)
@@ -0,0 +1,80 @@
+Index: ../trunk-jpl/test/Archives/Archive244.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive252.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive253.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25850)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25851)
+@@ -332,10 +332,10 @@
+ 				gsp[i] += D;
+ 			}
+ 			// dendricity and sphericity can not be > 1 or < 0
+-         if (gdn[i]<0.0+Gdntol)gdn[i]=0.0;
+-         if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
+-         if (gdn[i]>1.0-Gdntol)gdn[i]=1.0;
+-         if (gsp[i]>1.0-Gdntol)gsp[i]=1.0;
++         if (gdn[i]<=0.0+Gdntol)gdn[i]=0.0;
++         if (gsp[i]<=0.0+Gdntol)gsp[i]=0.0;
++         if (gdn[i]>=1.0-Gdntol)gdn[i]=1.0;
++         if (gsp[i]>=1.0-Gdntol)gsp[i]=1.0;
+ 
+          // determine new grain size (mm)
+          gsz[i] = 0.1 + (1.0-gdn[i])*0.25 + (0.5-gsp[i])*0.1;
+@@ -343,25 +343,33 @@
+ 		}
+ 		else{
+ 
+-			//When the state of "faceted crystals" (gsp==0) is fully reached,
+-			// snow evolves towards depth hoar if the gradient is
+-			// higher than 15 degC m-1 (Brun et al., 1992)
+ 			//When wet-snow grains (class 6) are submitted to a
+ 			// temperature gradient higher than 5 degC m-1, their sphericity
+ 			// 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 || (dT[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){
+-				//determine coefficients
+-				IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
+-				gsp[i] +=C;
+-				if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
+-				//determine new grain size (mm)
+-				gsz[i] = 0.35 + (0.5-gsp[i])*0.1;
++			if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol){
++
++				IssmDouble F = 0.0;
++
++				if (dT[i]>5.0+Ttol){
++					F = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
++				}
++				else if (W[i]>0.0+Wtol){
++					F = (1.0/16.0) * pow(lwc[i],3.0) * dt;
++				}
++				else{
++					F = 1e9 * exp(-6e3 / T[i]) * dt;
++				}
++				gsp[i] +=F;
++
+ 			}
++			if (gsp[i]<=0.0+Gdntol)gsp[i]=0.0;
++			if (gsp[i]>=1.0-Gdntol)gsp[i]=1.0;
++
+ 			/*Dry snow metamorphism (Marbouty, 1980) grouped model coefficents
+ 			 *from Marbouty, 1980: Figure 9*/
+-			else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol && W[i]>0.0+Wtol)){
++			if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol)){
+ 				//_printf_("Nondendritic snow metamorphism\n");
+ 				Q = Marbouty(T[i],d[i],dT[i]);
+ 
+Index: ../trunk-jpl/test/Archives/Archive243.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-25851-25852.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25851-25852.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25851-25852.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/etc/environment.csh
+===================================================================
+--- ../trunk-jpl/etc/environment.csh	(revision 25851)
++++ ../trunk-jpl/etc/environment.csh	(revision 25852)
+@@ -3,7 +3,7 @@
+ #Load ISSM scripts
+ setenv PATH {$PATH}:{$ISSM_DIR}/scripts
+ 
+-ISSM_EXT_DIR="{$ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
++set ISSM_EXT_DIR="{$ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
+ 
+ #MPI
+ set MPI_DIR="{$ISSM_EXT_DIR}/mpich/install"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25852-25853.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25852-25853.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25852-25853.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/test/NightlyRun/test243.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test243.m	(revision 25852)
++++ ../trunk-jpl/test/NightlyRun/test243.m	(revision 25853)
+@@ -53,7 +53,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names      ={'Layers','SmbDz','SmbT' ,'SmbD' ,'SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation'};
+-field_tolerances ={1e-12,2e-12,1e-12,1e-11,1e-11,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,2e-11,2e-11,1e-11,9e-10,2e-11,1e-11,9e-10,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,};
++field_tolerances ={1e-12,2e-12,1e-12,2e-11,1e-11,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,2e-11,2e-11,1e-11,9e-10,2e-11,1e-11,9e-10,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,};
+ 
+ field_values={...
+ 	(nlayers),...
+Index: ../trunk-jpl/test/NightlyRun/test243.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test243.py	(revision 25852)
++++ ../trunk-jpl/test/NightlyRun/test243.py	(revision 25853)
+@@ -70,7 +70,7 @@
+ 
+ #Fields and tolerances to track changes
+ field_names = ['Layers', 'SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbA', 'SmbEC', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF', 'SmbMeanULW', 'SmbNetLW', 'SmbNetSW', 'SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation']
+-field_tolerances = [1e-12, 2e-12, 1e-12, 1e-11, 1e-11, 2e-11, 1e-11, 1e-12, 1e-11, 1e-12, 1e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11]
++field_tolerances = [1e-12, 2e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 1e-12, 1e-11, 1e-12, 1e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11]
+ # Shape is different in python solution (fixed using reshape) which can cause test failure
+ field_values = [
+     nlayers,
+Index: ../trunk-jpl/test/NightlyRun/test252.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test252.m	(revision 25852)
++++ ../trunk-jpl/test/NightlyRun/test252.m	(revision 25853)
+@@ -66,7 +66,7 @@
+ 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-11,1e-10,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,...
+                    1e-12,1e-12,2e-12,2e-11,4e-11,1e-11,1e-12,1e-11,1e-11,1e-12,1e-12,1e-11,...
+-                   1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,1e-12,1e-10,1e-12,1e-12,2e-11};
++                   1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,3e-12,1e-10,1e-12,1e-12,2e-11};
+ 
+ field_values={...
+ 	(nlayers)...
+Index: ../trunk-jpl/test/NightlyRun/test252.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test252.py	(revision 25852)
++++ ../trunk-jpl/test/NightlyRun/test252.py	(revision 25853)
+@@ -82,7 +82,7 @@
+     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-11,1e-10,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,
+     1e-12,1e-12,2e-12,2e-11,4e-11,1e-11,1e-12,1e-11,1e-11,1e-12,1e-12,1e-11,
+-    1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,1e-12,1e-10,1e-12,1e-12,2e-11
++    1e-11,1e-11,4e-11,4e-11,1e-12,4e-11,1e-12,3e-12,1e-10,1e-12,1e-12,2e-11
+ ]
+ # Shape is different in python solution (fixed using reshape) which can cause test failure
+ field_values = [
Index: /issm/oecreview/Archive/25834-26739/ISSM-25853-25854.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25853-25854.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25853-25854.diff	(revision 26740)
@@ -0,0 +1,89 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 25853)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 25854)
+@@ -1660,7 +1660,6 @@
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+-	int frictionlaw;
+ 	Element* basalelement;
+ 
+ 	/*Get basal element*/
+@@ -1701,7 +1700,7 @@
+ 	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
+ 
+ 	/* get the friction law: if 2-Weertman, 11-Schoof, use a special name for the coefficient*/
+-	element->FindParam(&frictionlaw, FrictionLawEnum);
++	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
+ 	Input* dragcoefficient_input;
+ 	switch(frictionlaw) {
+ 		case 2:
+@@ -1789,7 +1788,20 @@
+ 		vz_input        = element->GetInput(VzEnum);                   _assert_(vy_input);
+ 		adjointz_input  = element->GetInput(AdjointzEnum);             _assert_(adjointz_input);
+ 	}
+-	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
++	/* get the friction law: 1- Budd, 11-Schoof*/
++	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
++	Input* dragcoeff_input = NULL;
++	switch(frictionlaw) {
++		case 1:
++			dragcoeff_input = element->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
++			break;
++		case 2:
++		case 11:
++			dragcoeff_input = element->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
++			break;
++		default:
++			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
++	}
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGaussBase(4);
+@@ -1881,11 +1893,25 @@
+ 	Input* vy_input        = NULL;
+ 	Input* adjointx_input  = element->GetInput(AdjointxEnum);             _assert_(adjointx_input);
+ 	Input* adjointy_input  = NULL;
+-	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
+ 	if(domaintype!=Domain2DverticalEnum){
+ 		vy_input        = element->GetInput(VyEnum);                   _assert_(vy_input);
+ 		adjointy_input  = element->GetInput(AdjointyEnum);             _assert_(adjointy_input);
+ 	}
++	/* get the friction law: 1- Budd, 11-Schoof*/
++	int frictionlaw; element->FindParam(&frictionlaw, FrictionLawEnum);
++	Input* dragcoeff_input = NULL;
++	switch(frictionlaw) {
++		case 1:
++			dragcoeff_input = element->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
++			break;
++		case 2:
++		case 11:
++			dragcoeff_input = element->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
++			break;
++		default:
++			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
++	}
++
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGaussBase(4);
+ 	while(gauss->next()){
+@@ -1957,7 +1983,6 @@
+ 
+ 	/*Fetch number of vertices for this finite element*/
+ 	int numvertices = basalelement->GetNumberOfVertices();
+-	int frictionlaw;
+ 
+ 	/*Initialize some vectors*/
+ 	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
+@@ -1976,8 +2001,8 @@
+ 	Input* adjointy_input  = basalelement->GetInput(AdjointyEnum);             _assert_(adjointy_input);
+ 
+ 	/* get the friction law: 1- Budd, 11-Schoof*/
+-	element->FindParam(&frictionlaw, FrictionLawEnum);
+-	Input* dragcoeff_input;
++	int frictionlaw;element->FindParam(&frictionlaw, FrictionLawEnum);
++	Input* dragcoeff_input = NULL;
+ 	switch(frictionlaw) {
+ 		case 1:
+ 			dragcoeff_input = basalelement->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
Index: /issm/oecreview/Archive/25834-26739/ISSM-25854-25855.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25854-25855.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25854-25855.diff	(revision 26740)
@@ -0,0 +1,319 @@
+Index: ../trunk-jpl/externalpackages/chaco/install-macosx64-sierra.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/install-macosx64-sierra.sh	(revision 25854)
++++ ../trunk-jpl/externalpackages/chaco/install-macosx64-sierra.sh	(nonexistent)
+@@ -1,55 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-# Some cleanup
+-rm -rf Chaco-2.2
+-rm -rf src 
+-rm -rf install 
+-mkdir src install 
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
+-
+-# Untar 
+-tar -xvzf Chaco-2.2.tar.gz
+-
+-# Move chaco to src directory
+-mv Chaco-2.2/* src
+-rm -rf Chaco-2.2
+-
+-# Apply patches (all at once)
+-# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
+-patch -R -p0 < chaco.patch
+-
+-# Patch src/code/Makefile
+-patch ./src/code/Makefile ./patches/Makefile.macosx64-sierra.patch
+-
+-
+-# Build chaco
+-cd src/code
+-if [ $# -eq 0 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make chacominusblas.a
+-
+-# Clean up objects (but not library or executable)
+-make clean
+-cd ../..
+-
+-# Populate install directory
+-cp -p src/exec/README install
+-cp -p src/exec/User_Params install
+-cp -p src/exec/*.coords install
+-cp -p src/exec/*.graph install
+-mkdir install/include
+-cp -p src/code/main/defs.h install/include/defs.h
+-cp -p src/code/main/params.h install/include/params.h
+-cp -p chaco.h install/include/chaco.h
+-mkdir install/lib
+-mv src/code/chaco.a install/lib/libchaco.a
+-mv src/code/chacominusblas.a install/lib/libchacominusblas.a
+-mkdir install/exec
+-mv src/exec/chaco install/exec
+
+Property changes on: ../trunk-jpl/externalpackages/chaco/install-macosx64-sierra.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/chaco/install-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/install-macosx64.sh	(revision 25854)
++++ ../trunk-jpl/externalpackages/chaco/install-macosx64.sh	(nonexistent)
+@@ -1,55 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-# Some cleanup
+-rm -rf Chaco-2.2
+-rm -rf src 
+-rm -rf install 
+-mkdir src install 
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
+-
+-# Untar 
+-tar -xvzf Chaco-2.2.tar.gz
+-
+-# Move chaco to src directory
+-mv Chaco-2.2/* src
+-rm -rf Chaco-2.2
+-
+-# Apply patches (all at once)
+-# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
+-patch -R -p0 < chaco.patch
+-
+-# Patch src/code/Makefile
+-patch ./src/code/Makefile ./patches/Makefile.patch
+-
+-
+-# Build chaco
+-cd src/code
+-if [ $# -eq 0 ]; then
+-	make
+-else
+-	make -j $1
+-fi
+-make chacominusblas.a
+-
+-# Clean up objects (but not library or executable)
+-make clean
+-cd ../..
+-
+-# Populate install directory
+-cp -p src/exec/README install
+-cp -p src/exec/User_Params install
+-cp -p src/exec/*.coords install
+-cp -p src/exec/*.graph install
+-mkdir install/include
+-cp -p src/code/main/defs.h install/include/defs.h
+-cp -p src/code/main/params.h install/include/params.h
+-cp -p chaco.h install/include/chaco.h
+-mkdir install/lib
+-mv src/code/chaco.a install/lib/libchaco.a
+-mv src/code/chacominusblas.a install/lib/libchacominusblas.a
+-mkdir install/exec
+-mv src/exec/chaco install/exec
+
+Property changes on: ../trunk-jpl/externalpackages/chaco/install-macosx64.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/chaco/install-mac-sierra.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/install-mac-sierra.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/install-mac-sierra.sh	(revision 25855)
+@@ -0,0 +1,55 @@
++#!/bin/bash
++set -eu
++
++# Some cleanup
++rm -rf Chaco-2.2
++rm -rf src 
++rm -rf install 
++mkdir src install 
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
++$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
++
++# Untar 
++tar -xvzf Chaco-2.2.tar.gz
++
++# Move chaco to src directory
++mv Chaco-2.2/* src
++rm -rf Chaco-2.2
++
++# Apply patches (all at once)
++# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
++patch -R -p0 < chaco.patch
++
++# Patch src/code/Makefile
++patch ./src/code/Makefile ./patches/Makefile.mac-sierra.patch
++
++
++# Build chaco
++cd src/code
++if [ $# -eq 0 ]; then
++	make
++else
++	make -j $1
++fi
++make chacominusblas.a
++
++# Clean up objects (but not library or executable)
++make clean
++cd ../..
++
++# Populate install directory
++cp -p src/exec/README install
++cp -p src/exec/User_Params install
++cp -p src/exec/*.coords install
++cp -p src/exec/*.graph install
++mkdir install/include
++cp -p src/code/main/defs.h install/include/defs.h
++cp -p src/code/main/params.h install/include/params.h
++cp -p chaco.h install/include/chaco.h
++mkdir install/lib
++mv src/code/chaco.a install/lib/libchaco.a
++mv src/code/chacominusblas.a install/lib/libchacominusblas.a
++mkdir install/exec
++mv src/exec/chaco install/exec
+
+Property changes on: ../trunk-jpl/externalpackages/chaco/install-mac-sierra.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/chaco/patches/Makefile.macosx64-sierra.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/patches/Makefile.macosx64-sierra.patch	(revision 25854)
++++ ../trunk-jpl/externalpackages/chaco/patches/Makefile.macosx64-sierra.patch	(nonexistent)
+@@ -1,11 +0,0 @@
+---- ./src/code/Makefile	2016-02-16 19:39:30.000000000 -0800
+-+++ ./Makefile	2016-02-16 19:37:49.000000000 -0800
+-@@ -6,7 +6,7 @@
+- #CFLAGS =	-O2
+- #OFLAGS =	-O2
+- #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
+--CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
+-+CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/usr/local/include/ -Wno-implicit-function-declaration 
+- #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
+- OFLAGS =	-O2 
+- #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
+Index: ../trunk-jpl/externalpackages/chaco/patches/Makefile.mac-sierra.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/patches/Makefile.mac-sierra.patch	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/patches/Makefile.mac-sierra.patch	(revision 25855)
+@@ -0,0 +1,11 @@
++--- ./src/code/Makefile	2016-02-16 19:39:30.000000000 -0800
+++++ ./Makefile	2016-02-16 19:37:49.000000000 -0800
++@@ -6,7 +6,7 @@
++ #CFLAGS =	-O2
++ #OFLAGS =	-O2
++ #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
++-CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
+++CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/usr/local/include/ -Wno-implicit-function-declaration 
++ #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
++ OFLAGS =	-O2 
++ #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
+Index: ../trunk-jpl/externalpackages/chaco/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/install.sh	(revision 25854)
++++ ../trunk-jpl/externalpackages/chaco/install.sh	(revision 25855)
+@@ -1,28 +1,34 @@
+ #!/bin/bash
+ set -eu
+ 
+-# Some cleanup
+-rm -rf Chaco-2.2
+-rm -rf src 
+-rm -rf install 
+-mkdir src install 
+ 
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
++## Constants
++#
++VER=2.2
+ 
+-# Untar 
+-tar -xvzf Chaco-2.2.tar.gz
++PREFIX="${ISSM_DIR}/externalpackages/chaco/install" # Set to location where external package should be installed
+ 
+-# Move chaco to src directory
+-mv Chaco-2.2/* src
+-rm -rf Chaco-2.2
++# Cleanup
++rm -rf ${PREFIX} src Chaco-${VER}
++mkdir -p ${PREFIX} src
+ 
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/Chaco-${VER}.tar.gz" "Chaco-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf" "chaco_guide.pdf"
++
++# Unpack source
++tar -xvzf Chaco-${VER}.tar.gz
++
++# Move source to 'src' directory
++mv Chaco-${VER}/* src
++rm -rf Chaco-${VER}
++
+ # Apply patches (all at once)
+-# (written by diff -rc src ~/Libs/Chaco-2.2 > chaco.patch)
++# (written by diff -rc src ~/Libs/Chaco-${VER} > chaco.patch)
+ patch -R -p0 < chaco.patch
++patch src/code/Makefile patches/Makefile.patch
+ 
+-# Build chaco
++# Compile
+ cd src/code
+ if [ $# -eq 0 ]; then
+ 	make
+@@ -35,17 +41,17 @@
+ make clean
+ cd ../..
+ 
+-# Populate install directory
+-cp -p src/exec/README install
+-cp -p src/exec/User_Params install
+-cp -p src/exec/*.coords install
+-cp -p src/exec/*.graph install
+-mkdir install/include
+-cp -p src/code/main/defs.h install/include/defs.h
+-cp -p src/code/main/params.h install/include/params.h
+-cp -p chaco.h install/include/chaco.h
+-mkdir install/lib
+-mv src/code/chaco.a install/lib/libchaco.a
+-mv src/code/chacominusblas.a install/lib/libchacominusblas.a
+-mkdir install/exec
+-mv src/exec/chaco install/exec
++# Install
++cp -p src/exec/README ${PREFIX}
++cp -p src/exec/User_Params ${PREFIX}
++cp -p src/exec/*.coords ${PREFIX}
++cp -p src/exec/*.graph ${PREFIX}
++mkdir ${PREFIX}/include
++cp -p src/code/main/defs.h ${PREFIX}/include/defs.h
++cp -p src/code/main/params.h ${PREFIX}/include/params.h
++cp -p chaco.h ${PREFIX}/include/chaco.h
++mkdir ${PREFIX}/lib
++mv src/code/chaco.a ${PREFIX}/lib/libchaco.a
++mv src/code/chacominusblas.a ${PREFIX}/lib/libchacominusblas.a
++mkdir ${PREFIX}/exec
++mv src/exec/chaco ${PREFIX}/exec
Index: /issm/oecreview/Archive/25834-26739/ISSM-25855-25856.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25855-25856.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25855-25856.diff	(revision 26740)
@@ -0,0 +1,679 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25855)
++++ ../trunk-jpl/etc/environment.sh	(revision 25856)
+@@ -164,312 +164,384 @@
+ 	fi
+ } #}}}
+ 
+-# Windows compilers:
++# Windows compilers
+ if [[ "$ISSM_ARCH" == "cygwin-intel" ]]; then
+ 	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
+ fi
+ 
+-# Load ISSM scripts
++# ISSM scripts
+ path_append "${ISSM_DIR}/scripts"
+ 
+ ISSM_EXT_DIR="${ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
+ 
+-SVN_DIR="${ISSM_EXT_DIR}/svn/install"
+-if [ -d "${SVN_DIR}" ]; then
+-	path_prepend   "${SVN_DIR}/bin"
+-	ld_library_path_append "${SVN_DIR}/lib"
+-fi
++#########################
++# Command-line utilities
++#########################
++SSH_ROOT="${ISSM_EXT_DIR}/ssh"
++path_append "${SSH_ROOT}"
+ 
+-GIT_DIR="${ISSM_EXT_DIR}/git/install"
+-if [ -d "${GIT_DIR}" ]; then
+-	path_prepend "${GIT_DIR}/bin"
++SVN_ROOT="${ISSM_EXT_DIR}/svn/install"
++if [ -d "${SVN_ROOT}" ]; then
++	path_prepend "${SVN_ROOT}/bin"
++	ld_library_path_append "${SVN_ROOT}/lib"
+ fi
+ 
+-MPI_DIR="${ISSM_EXT_DIR}/mpich/install"
+-if [ -d "${MPI_DIR}" ]; then
+-	export MPI_DIR
+-	export MPI_HOME=${MPI_DIR} # Needed by Dakota
+-	export MPI_INC_DIR="$MPI_DIR/include"
+-	path_prepend "${MPI_DIR}/bin"
+-	cpath_prepend "${MPI_DIR}/include"
+-	ld_library_path_append "${MPI_DIR}/lib"
++GIT_ROOT="${ISSM_EXT_DIR}/git/install"
++if [ -d "${GIT_ROOT}" ]; then
++	path_prepend "${GIT_ROOT}/bin"
+ fi
+ 
+-PETSC_DIR="${ISSM_EXT_DIR}/petsc/install"
+-if [ -d "$PETSC_DIR" ]; then
+-	export PETSC_DIR
+-	ld_library_path_prepend "${PETSC_DIR}/lib"
++#############################
++# Compilers / runtime / SDKs
++#############################
++export ANDROID_DIR="${ISSM_EXT_DIR}/android"
+ 
+-	# In case we have installed MPICH via PETSc
+-	if [ -f "${PETSC_DIR}/bin/mpiexec" ]; then
+-		MPI_DIR=${PETSC_DIR}
+-		export MPI_DIR
+-		export MPI_HOME=${MPI_DIR} # Needed by Dakota
+-		export MPI_INC_DIR="${MPI_DIR}/include"
+-		path_prepend "${MPI_DIR}/bin"
+-		cpath_prepend "${MPI_DIR}/include"
+-	fi
+-fi
++export ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
++path_append "$ANDROID_NDK_DIR/arm-linux-android-install/bin"
+ 
+-LAPACK_DIR="${ISSM_EXT_DIR}/lapack/install"
+-ld_library_path_append "${LAPACK_DIR}/lib"
++export ANDROID_SDK_ROOT="$ANDROID_DIR/android-sdk/install"
++path_append "$ANDROID_SDK_ROOT/"
+ 
+-SCOTCH_DIR="${ISSM_EXT_DIR}/scotch/install"
+-ld_library_path_append "$SCOTCH_DIR/lib"
+-
+-SLEPC_DIR="${ISSM_EXT_DIR}/slepc/install"
+-ld_library_path_append "$SLEPC_DIR/lib"
+-
+-TAO_DIR="${ISSM_EXT_DIR}/tao/install"
+-ld_library_path_append "$TAO_DIR/lib"
+-
+-DAKOTA_DIR="${ISSM_EXT_DIR}/dakota/install"
+-if [ -d "${DAKOTA_DIR}" ]; then
+-	path_append "${DAKOTA_DIR}/bin"
+-	ld_library_path_append "${DAKOTA_DIR}/lib"
+-	dyld_library_path_prepend "${DAKOTA_DIR}/lib"
++EMSCRIPTEN_ROOT="${ISSM_EXT_DIR}/emscripten/install"
++if [ -d ${EMSCRIPTEN_ROOT} ]; then
++	export EMSCRIPTEN_ROOT # Used in JavaScript build in installation of GSL, Triangle
+ fi
+ 
+-DOXYGEN_DIR="${ISSM_EXT_DIR}/doxygen/install"
+-path_prepend "$DOXYGEN_DIR/bin"
++JVM_ROOT="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/"
++ld_library_path_append "${JVM_ROOT}"
+ 
+-AUTOTOOLS_DIR="${ISSM_EXT_DIR}/autotools/install"
+-path_prepend "$AUTOTOOLS_DIR/bin"
++#############################
++# IDEs
++#############################
++ECLIPSE_ROOT="${ISSM_EXT_DIR}/eclipse/install"
++path_append "${ECLIPSE_ROOT}"
+ 
+-SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
+-path_append "$SDK_DIR"
++#############################
++# Build systems
++#############################
++AUTOTOOLS_ROOT="${ISSM_EXT_DIR}/autotools/install"
++path_prepend "${AUTOTOOLS_ROOT}/bin"
+ 
+-SSH_DIR="${ISSM_EXT_DIR}/ssh"
+-path_append "$SSH_DIR"
++CMAKE_ROOT="${ISSM_EXT_DIR}/cmake/install"
++path_prepend "${CMAKE_ROOT}/bin"
+ 
+-VALGRIND_DIR="${ISSM_EXT_DIR}/valgrind/install"
+-path_prepend "$VALGRIND_DIR/bin"
++GMAKE_ROOT="${ISSM_EXT_DIR}/gmake/install"
++path_prepend "${GMAKE_ROOT}/bin"
+ 
+-NCO_DIR="${ISSM_EXT_DIR}/nco/install/bin"
+-path_prepend "$NCO_DIR/bin"
++#############################
++# Packagers
++#############################
++PACKAGEMAKER_ROOT="${ISSM_EXT_DIR}/packagemaker/install"
++path_append "${PACKAGEMAKER_ROOT}"
+ 
+-CPPCHECK_DIR="${ISSM_EXT_DIR}/cppcheck/install"
+-path_append "$CPPCHECK_DIR/bin"
+-
+-MERCURIAL_DIR="${ISSM_EXT_DIR}/mercurial/install"
+-if [ -d "$MERCURIAL_DIR" ]; then
+-	export PYTHONPATH="$PYTHONPATH:$MERCURIAL_DIR/mercurial/pure/"
+-	path_append "$MERCURIAL_DIR"
++#############################
++# Libraries / binaries
++#############################
++MPI_ROOT="${ISSM_EXT_DIR}/mpich/install"
++if [ -d "${MPI_ROOT}" ]; then
++	export MPI_DIR=${MPI_ROOT}
++	export MPI_HOME=${MPI_ROOT} # Used in installation of Dakota
++	export MPI_INC_DIR="${MPI_ROOT}/include"
++	path_prepend "${MPI_ROOT}/bin"
++	cpath_prepend "${MPI_ROOT}/include"
++	ld_library_path_append "${MPI_ROOT}/lib"
+ fi
+ 
+-BOOST_DIR="${ISSM_EXT_DIR}/boost/install"
+-BOOSTROOT="${ISSM_EXT_DIR}/boost/install"
+-if [ -d "${BOOST_DIR}" ]; then
+-	export BOOSTROOT
+-	export BOOST_DIR
+-	library_path_prepend "${BOOST_DIR}/lib"
+-	ld_library_path_prepend "${BOOST_DIR}/lib"
+-	dyld_library_path_prepend "${BOOST_DIR}/lib"
+-	path_prepend "${BOOST_DIR}/bin"
+-fi
++PETSC_ROOT="${ISSM_EXT_DIR}/petsc/install"
++if [ -d "$PETSC_ROOT" ]; then
++	export PETSC_ROOT # Used in installation of Gmsh
++	ld_library_path_prepend "${PETSC_ROOT}/lib"
+ 
+-XERCESROOT="${ISSM_EXT_DIR}/xerces/install"
+-if [ -d "$XERCESROOT" ]; then
+-	export XERCESROOT
+-	export XERCESCROOT="${ISSM_EXT_DIR}/xerces/src"
+-fi
++	# In case we have installed certain external packages via PETSc
++	#
+ 
++	# BLAS
++	NUM_BLAS_LIBS=$(find ${PETSC_ROOT}/lib -name libblas.* -o -name libfblas.* | wc -l)
++	if [ ${NUM_BLAS_LIBS} -gt 0 ]; then
++		export BLAS_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
++	fi
+ 
+-XAIFBOOSTERROOT="${ISSM_EXT_DIR}/xaifbooster"
+-XAIF_DIR="${XAIFBOOSTERROOT}/xaifBooster"
+-if [ -d "$XAIF_DIR" ]; then
+-	export XAIFBOOSTERROOT
+-	export XAIF_DIR
+-	export XAIFBOOSTER_HOME=$XAIF_DIR
+-	export PLATFORM="x86-Linux"
+-fi
++	# HDF5
++	NUM_HDF5_LIBS=$(find ${PETSC_ROOT}/lib -name libhdf5.* | wc -l)
++	if [ ${NUM_HDF5_LIBS} -gt 0 ]; then
++		export HDF5_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
++		cpath_append "${PETSC_ROOT}/include"
++		library_path_append "${PETSC_ROOT}/lib"
++		dyld_library_path_append "${PETSC_ROOT}/lib"
++		ld_library_path_append "${PETSC_ROOT}/lib"
++	fi
+ 
+-ANGELROOT="${ISSM_EXT_DIR}/angel/angel"
+-if [ -d "$ANGELROOT" ]; then
+-	export ANGELROOT
+-fi
++	# LAPACK
++	NUM_LAPACK_LIBS=$(find ${PETSC_ROOT}/lib -name liblapack.* -o -name libflapack.* | wc -l)
++	if [ ${NUM_LAPACK_LIBS} -gt 0 ]; then
++		export LAPACK_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
++	fi
+ 
+-OPENANALYSISROOT="${ISSM_EXT_DIR}/openanalysis/install"
+-if [ -d "$OPENANALYSISROOT" ]; then
+-	export OPENANALYSISROOT
+-	ld_library_path_append "$OPENANALYSISROOT/lib"
+-fi
++	# METIS
++	NUM_METIS_LIBS=$(find ${PETSC_ROOT}/lib -name libmetis.* | wc -l)
++	if [ ${NUM_METIS_LIBS} -gt 0 ]; then
++		export METIS_ROOT="${PETSC_ROOT}" # Used in installation of Gmsh
++	fi
+ 
+-JVM_DIR="/usr/local/gcc/4.3.2/lib64/gcj-4.3.2-9/"
+-ld_library_path_append "$JVM_DIR"
++	# MPICH
++	if [ -f "${PETSC_ROOT}/bin/mpiexec" ]; then
++		MPI_ROOT=${PETSC_ROOT}
++		export MPI_DIR=${MPI_ROOT}
++		export MPI_HOME=${MPI_ROOT} # Used in installation of Dakota
++		export MPI_INC_DIR="${MPI_ROOT}/include"
++		path_prepend "${MPI_ROOT}/bin"
++		cpath_prepend "${MPI_ROOT}/include"
++		ld_library_path_append "${MPI_ROOT}/lib"
++	fi
+ 
+-BBFTP_DIR="${ISSM_EXT_DIR}/bbftp/install"
+-path_append "$BBFTP_DIR/bin"
++	# ZLIB
++	NUM_ZLIB_LIBS=$(find ${PETSC_ROOT}/lib -name libz.* | wc -l)
++	if [ ${NUM_ZLIB_LIBS} -gt 0 ]; then
++		export ZLIB_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
++	fi
++fi
+ 
+-ADIC_DIR="${ISSM_EXT_DIR}/adic/install"
+-path_append "$ADIC_DIR/bin"
+-ld_library_path_append "$ADIC_DIR/lib"
++LAPACK_ROOT="${ISSM_EXT_DIR}/lapack/install"
++ld_library_path_append "${LAPACK_ROOT}/lib"
+ 
+-COLPACK_DIR="${ISSM_EXT_DIR}/colpack/install"
+-ld_library_path_append "$COLPACK_DIR/lib"
++SCOTCH_ROOT="${ISSM_EXT_DIR}/scotch/install"
++ld_library_path_append "${SCOTCH_ROOT}/lib"
+ 
+-ECLIPSE_DIR="${ISSM_EXT_DIR}/eclipse/install"
+-path_append "$ECLIPSE_DIR"
++SLEPC_ROOT="${ISSM_EXT_DIR}/slepc/install"
++ld_library_path_append "${SLEPC_ROOT}/lib"
+ 
+-APPSCAN_DIR="${ISSM_EXT_DIR}/appscan/install"
+-path_append "$APPSCAN_DIR/bin"
++TAO_ROOT="${ISSM_EXT_DIR}/tao/install"
++ld_library_path_append "${TAO_ROOT}/lib"
+ 
+-RATS_DIR="${ISSM_EXT_DIR}/rats/install"
+-path_append "$RATS_DIR/bin"
++DAKOTA_ROOT="${ISSM_EXT_DIR}/dakota/install"
++if [ -d "${DAKOTA_ROOT}" ]; then
++	path_append "${DAKOTA_ROOT}/bin"
++	ld_library_path_append "${DAKOTA_ROOT}/lib"
++	dyld_library_path_prepend "${DAKOTA_ROOT}/lib"
++fi
+ 
+-DYSON_DIR="${ISSM_EXT_DIR}/dyson/"
+-path_append "$DYSON_DIR"
++NCO_ROOT="${ISSM_EXT_DIR}/nco/install/bin"
++path_prepend "${NCO_ROOT}/bin"
+ 
+-CMAKE_DIR="${ISSM_EXT_DIR}/cmake/install"
+-path_prepend "$CMAKE_DIR/bin"
++CPPCHECK_ROOT="${ISSM_EXT_DIR}/cppcheck/install"
++path_append "${CPPCHECK_ROOT}/bin"
+ 
+-SHAPELIB_DIR="${ISSM_EXT_DIR}/shapelib/install"
+-path_append "$SHAPELIB_DIR/exec"
++MERCURIAL_ROOT="${ISSM_EXT_DIR}/mercurial/install"
++if [ -d "${MERCURIAL_ROOT}" ]; then
++	export PYTHONPATH="${PYTHONPATH}:${MERCURIAL_ROOT}/mercurial/pure/"
++	path_append "${MERCURIAL_ROOT}"
++fi
+ 
+-CCCL_DIR="${ISSM_EXT_DIR}/cccl/install"
+-path_append "$CCCL_DIR/bin"
++BOOST_ROOT="${ISSM_EXT_DIR}/boost/install"
++if [ -d "${BOOST_ROOT}" ]; then
++	export BOOST_ROOT # Used in installation of Dakota
++	export BOOST_DIR=${BOOST_ROOT}
++	export BOOSTROOT=${BOOST_ROOT}
++	library_path_prepend "${BOOST_ROOT}/lib"
++	ld_library_path_prepend "${BOOST_ROOT}/lib"
++	dyld_library_path_prepend "${BOOST_ROOT}/lib"
++	path_prepend "${BOOST_ROOT}/bin"
++fi
+ 
+-PACKAGEMAKER_DIR="${ISSM_EXT_DIR}/packagemaker/install"
+-path_append "$PACKAGEMAKER_DIR"
++GSL_ROOT="${ISSM_EXT_DIR}/gsl/install"
++if [ -d "${GSL_ROOT}" ]; then
++	export GSL_HOME="${GSL_ROOT}" # Used in installation of Dakota
++	ld_library_path_append "${GSL_ROOT}/lib"
++fi
+ 
+-#android-dev-dir
+-export ANDROID_DIR="${ISSM_EXT_DIR}/android"
++NETCDF_ROOT="${ISSM_EXT_DIR}/netcdf/install"
++if [ -d "${NETCDF_ROOT}" ]; then
++	export NETCDF_ROOT # Used in installation of GDAL, GMT
++	path_append "${NETCDF_ROOT}/bin"
++	cpath_append "${NETCDF_ROOT}/include"
++	library_path_append "${NETCDF_ROOT}/lib"
++	dyld_library_path_append "${NETCDF_ROOT}/lib"
++	ld_library_path_append "${NETCDF_ROOT}/lib"
++fi
+ 
+-export ANDROID_NDK_DIR="$ANDROID_DIR/android-ndk/install"
+-path_append "$ANDROID_NDK_DIR/arm-linux-android-install/bin"
++NETCDF_CXX_ROOT="${ISSM_EXT_DIR}/netcdf-cxx/install"
++if [ -d "${NETCDF_CXX_ROOT}" ]; then
++	ld_library_path_append "${NETCDF_CXX_ROOT}/lib"
++fi
+ 
+-export ANDROID_SDK_DIR="$ANDROID_DIR/android-sdk/install"
+-path_append "$ANDROID_SDK_DIR/"
++NETCDF_PYTHON_ROOT="${ISSM_EXT_DIR}/netcdf-python/install"
++if [ -d "${NETCDF_PYTHON_ROOT}" ]; then
++	if [ -d "${NETCDF_PYTHON_ROOT}/lib/python2.7/site-packages" ]; then
++		ld_library_path_append "${NETCDF_PYTHON_ROOT}/lib/python2.7/site-packages"
++	fi
++fi
+ 
+-GSL_DIR="${ISSM_EXT_DIR}/gsl/install"
+-ld_library_path_append "$GSL_DIR/lib"
++CURL_ROOT="${ISSM_EXT_DIR}/curl/install"
++if [ -d "${CURL_ROOT}" ]; then
++	export CURL_ROOT # Used in installation of NetCDF, GDAL, GMT
++	ld_library_path_append "${CURL_ROOT}/lib"
++	dyld_library_path_append "${CURL_ROOT}/lib"
++	path_append "${CURL_ROOT}/bin"
++fi
+ 
+-GMAKE_DIR="${ISSM_EXT_DIR}/gmake/install"
+-path_prepend "$GMAKE_DIR/bin"
++HDF5_ROOT="${ISSM_EXT_DIR}/hdf5/install"
++if [ -d "${HDF5_ROOT}" ]; then
++	export HDF5_ROOT # Used in installation of NetCDF, GDAL
++	cpath_append "${HDF5_ROOT}/include"
++	library_path_append "${HDF5_ROOT}/lib"
++	dyld_library_path_append "${HDF5_ROOT}/lib"
++	ld_library_path_append "${HDF5_ROOT}/lib"
++fi
+ 
+-MODELE_DIR="${ISSM_EXT_DIR}/modelE/install"
+-path_append "$MODELE_DIR/src/exec"
+-
+-NCVIEW_DIR="${ISSM_EXT_DIR}/ncview/install"
+-path_append "$NCVIEW_DIR"
+-
+-TCLX_DIR="${ISSM_EXT_DIR}/tclx/install/lib/tclx8.4"
+-ld_library_path_append "$TCLX_DIR"
+-
+-ASPELL_DIR="${ISSM_EXT_DIR}/aspell/install"
+-path_append "$ASPELL_DIR/bin"
+-
+-NETCDF_DIR="${ISSM_EXT_DIR}/netcdf/install"
+-if [ -d "${NETCDF_DIR}" ]; then
+-	path_append "${NETCDF_DIR}/bin"
+-	cpath_append "${NETCDF_DIR}/include"
+-	library_path_append "${NETCDF_DIR}/lib"
+-	dyld_library_path_append "${NETCDF_DIR}/lib"
+-	ld_library_path_append "${NETCDF_DIR}/lib"
++ZLIB_ROOT="${ISSM_EXT_DIR}/zlib/install"
++if [ -d "${ZLIB_ROOT}" ]; then
++	export ZLIB_ROOT # Used in installation of NetCDF, GDAL, GMT
+ fi
+ 
+-NETCDF_CXX_DIR="${ISSM_EXT_DIR}/netcdf-cxx/install"
+-if [ -d "${NETCDF_CXX_DIR}" ]; then
+-	ld_library_path_append "${NETCDF_CXX_DIR}/lib"
++SQLITE_ROOT="${ISSM_EXT_DIR}/sqlite/install"
++if [ -d "${SQLITE_ROOT}" ]; then
++	path_append "${SQLITE_ROOT}/bin"
++	library_path_append "${SQLITE_ROOT}/lib"
++	ld_library_path_append "${SQLITE_ROOT}/lib"
+ fi
+ 
+-NETCDF_PYTHON_DIR="${ISSM_EXT_DIR}/netcdf-python/install"
+-if [ -d "${NETCDF_PYTHON_DIR}" ]; then
+-	if [ -d "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages" ]; then
+-		ld_library_path_append "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages"
+-	fi
++PROJ_ROOT="${ISSM_EXT_DIR}/proj/install"
++if [ -d "${PROJ_ROOT}" ]; then
++	export PROJ_ROOT # Used in installation of GDAL
++	dyld_library_path_append "${PROJ_ROOT}/lib"
++	ld_library_path_append "${PROJ_ROOT}/lib"
+ fi
+ 
+-HDF5_DIR="${ISSM_EXT_DIR}/hdf5/install"
+-if [ -d "${HDF5_DIR}" ]; then
+-	cpath_append "${HDF5_DIR}/include"
+-	library_path_append "${HDF5_DIR}/lib"
+-	dyld_library_path_append "${HDF5_DIR}/lib"
+-	ld_library_path_append "${HDF5_DIR}/lib"
++GDAL_ROOT="${ISSM_EXT_DIR}/gdal/install"
++if [ -d "${GDAL_ROOT}" ]; then
++	export GDAL_ROOT # Used in installation of GMT
++	path_prepend "${GDAL_ROOT}/bin"
++	ld_library_path_append "${GDAL_ROOT}/lib"
+ fi
+ 
+-SQLITE_DIR="${ISSM_EXT_DIR}/sqlite/install"
+-if [ -d "${SQLITE_DIR}" ]; then
+-	path_append "${SQLITE_DIR}/bin"
+-	library_path_append "${SQLITE_DIR}/lib"
+-	ld_library_path_append "${SQLITE_DIR}/lib"
++GSHHG_ROOT="${ISSM_EXT_DIR}/gshhg/install"
++if [ -d "${GSHHG_ROOT}" ]; then
++	export GSHHG_ROOT # Used in installation of GMT
+ fi
+ 
+-PROJ_DIR="${ISSM_EXT_DIR}/proj/install"
+-if [ -d "${PROJ_DIR}" ]; then
+-	dyld_library_path_prepend "${PROJ_DIR}/lib"
+-	ld_library_path_prepend "${PROJ_DIR}/lib"
++GMT_ROOT="${ISSM_EXT_DIR}/gmt/install"
++if [ -d "${GMT_ROOT}" ]; then
++	path_prepend "${GMT_ROOT}/bin"
++	ld_library_path_append "${GMT_ROOT}/lib"
++	dyld_library_path_append "${GMT_ROOT}/lib"
+ fi
+ 
+-GDAL_DIR="${ISSM_EXT_DIR}/gdal/install"
+-if [ -d "${GDAL_DIR}" ]; then
+-	path_prepend "${GDAL_DIR}/bin"
+-	ld_library_path_append "${GDAL_DIR}/lib"
++GMSH_ROOT="${ISSM_EXT_DIR}/gmt/install"
++if [ -d "${GMSH_ROOT}" ]; then
++	path_append "${GMSH_ROOT}/bin"
++	ld_library_path_append "${GMSH_ROOT}/lib"
++	dyld_library_path_append "${GMSH_ROOT}/lib"
+ fi
+ 
+-ESMF_DIR="${ISSM_EXT_DIR}/esmf/install"
+-if [ -d "${ESMF_DIR}" ]; then
+-	path_prepend "${ESMF_DIR}/bin"
+-	ld_library_path_append "${ESMF_DIR}/lib/libO/Linux.gfortran.64.mpich.default/"
++TRIANGLE_ROOT="${ISSM_EXT_DIR}/triangle/install"
++if [ -d "${TRIANGLE_ROOT}" ]; then
++	ld_library_path_append "${TRIANGLE_ROOT}/lib"
++	dyld_library_path_append "${TRIANGLE_ROOT}/lib"
+ fi
+ 
+-GMT_DIR="${ISSM_EXT_DIR}/gmt/install"
+-if [ -d "${GMT_DIR}" ]; then
+-	export GMT_DIR
+-	path_prepend "${GMT_DIR}/bin"
++ANGELROOT="${ISSM_EXT_DIR}/angel/angel"
++if [ -d "${ANGELROOT}" ]; then
++	export ANGELROOT
+ fi
+ 
+-GMSH_DIR="${ISSM_EXT_DIR}/gmsh/install"
+-if [ -d "${GMSH_DIR}" ]; then
+-	path_append "${ISSM_EXT_DIR}/gmsh/install"
++OPENANALYSISROOT="${ISSM_EXT_DIR}/openanalysis/install"
++if [ -d "${OPENANALYSISROOT}" ]; then
++	export OPENANALYSISROOT
++	ld_library_path_append "${OPENANALYSISROOT}/lib"
+ fi
+ 
+-CVS_DIR="${ISSM_EXT_DIR}/cvs/install"
+-path_prepend "$CVS_DIR/bin"
++BBFTP_ROOT="${ISSM_EXT_DIR}/bbftp/install"
++path_append "${BBFTP_ROOT}/bin"
+ 
+-APR_DIR="${ISSM_EXT_DIR}/apr/install"
+-path_append "$APR_DIR/bin"
+-ld_library_path_append "$APR_DIR/lib"
++ADIC_ROOT="${ISSM_EXT_DIR}/adic/install"
++path_append "${ADIC_ROOT}/bin"
++ld_library_path_append "${ADIC_ROOT}/lib"
+ 
+-APR_UTIL_DIR="${ISSM_EXT_DIR}/apr-util/install"
+-path_prepend "$APR_UTIL_DIR/bin"
+-ld_library_path_append "$APR_UTIL_DIR/lib"
++COLPACK_ROOT="${ISSM_EXT_DIR}/colpack/install"
++ld_library_path_append "${COLPACK_ROOT}/lib"
+ 
+-YAMS_DIR="${ISSM_EXT_DIR}/yams/install"
+-path_append "$YAMS_DIR"
++APPSCAN_ROOT="${ISSM_EXT_DIR}/appscan/install"
++path_append "${APPSCAN_ROOT}/bin"
+ 
+-SWIG_DIR="${ISSM_EXT_DIR}/swig/install"
+-path_append "$SWIG_DIR"
++RATS_ROOT="${ISSM_EXT_DIR}/rats/install"
++path_append "${RATS_ROOT}/bin"
+ 
+-#AUX-CONFIG
+-path_append "${ISSM_DIR}/aux-config"
++DYSON_ROOT="${ISSM_EXT_DIR}/dyson/"
++path_append "${DYSON_ROOT}"
+ 
+-#INISHELL
+-path_append "${ISSM_EXT_DIR}/inishell/install"
++SHAPELIB_ROOT="${ISSM_EXT_DIR}/shapelib/install"
++path_append "${SHAPELIB_ROOT}/exec"
+ 
+-#SHELL2JUNIT
+-path_append "${ISSM_EXT_DIR}/shell2junit/install"
++CCCL_ROOT="${ISSM_EXT_DIR}/cccl/install"
++path_append "${CCCL_ROOT}/bin"
+ 
+-#EXPAT
+-ld_library_path_prepend "${ISSM_EXT_DIR}/expat/install"
+-dyld_library_path_prepend "${ISSM_EXT_DIR}/expat/install"
++MODELE_ROOT="${ISSM_EXT_DIR}/modelE/install"
++path_append "${MODELE_ROOT}/src/exec"
+ 
+-#CURL
+-CURL_DIR="${ISSM_EXT_DIR}/curl/install"
+-if [ -d "${CURL_DIR}" ]; then
+-	ld_library_path_prepend "${CURL_DIR}/lib"
+-	dyld_library_path_prepend "${CURL_DIR}/lib"
+-	path_prepend "${CURL_DIR}/bin"
++NCVIEW_ROOT="${ISSM_EXT_DIR}/ncview/install"
++path_append "${NCVIEW_ROOT}"
++
++TCLX_ROOT="${ISSM_EXT_DIR}/tclx/install/lib/tclx8.4"
++ld_library_path_append "${TCLX_ROOT}"
++
++ASPELL_ROOT="${ISSM_EXT_DIR}/aspell/install"
++path_append "${ASPELL_ROOT}/bin"
++
++ESMF_ROOT="${ISSM_EXT_DIR}/esmf/install"
++if [ -d "${ESMF_ROOT}" ]; then
++	path_prepend "${ESMF_ROOT}/bin"
++	ld_library_path_append "${ESMF_ROOT}/lib/libO/Linux.gfortran.64.mpich.default/"
+ fi
+ 
+-#NEOPZ
+-NEOPZ_DIR="${ISSM_EXT_DIR}/neopz/install"
+-if [ -d "$NEOPZ_DIR" ]; then
+-	export REFPATTERNDIR="$NEOPZ_DIR/include/refpatterns"
++CVS_ROOT="${ISSM_EXT_DIR}/cvs/install"
++path_prepend "${CVS_ROOT}/bin"
++
++APR_ROOT="${ISSM_EXT_DIR}/apr/install"
++path_append "${APR_ROOT}/bin"
++ld_library_path_append "${APR_ROOT}/lib"
++
++APR_UTIL_ROOT="${ISSM_EXT_DIR}/apr-util/install"
++path_prepend "${APR_UTIL_ROOT}/bin"
++ld_library_path_append "${APR_UTIL_ROOT}/lib"
++
++YAMS_ROOT="${ISSM_EXT_DIR}/yams/install"
++path_append "${YAMS_ROOT}"
++
++SWIG_ROOT="${ISSM_EXT_DIR}/swig/install"
++path_append "${SWIG_ROOT}"
++
++INISHELL_ROOT="${ISSM_EXT_DIR}/inishell/install"
++path_append "${INISHELL_ROOT}"
++
++EXPAT_ROOT="${ISSM_EXT_DIR}/expat/install"
++ld_library_path_prepend "${EXPAT_ROOT}"
++dyld_library_path_prepend "${EXPAT_ROOT}"
++
++NEOPZ_ROOT="${ISSM_EXT_DIR}/neopz/install"
++if [ -d "${NEOPZ_ROOT}" ]; then
++	export REFPATTERNDIR="${NEOPZ_ROOT}/include/refpatterns"
+ fi
+ 
+-TRIANGLE_DIR="${ISSM_EXT_DIR}/triangle/install"
+-if [ -d "${TRIANGLE_DIR}" ]; then
+-	ld_library_path_append "${TRIANGLE_DIR}/lib"
+-	dyld_library_path_append "${TRIANGLE_DIR}/lib"
++XERCESROOT="${ISSM_EXT_DIR}/xerces/install"
++if [ -d "${XERCESROOT}" ]; then
++	export XERCESROOT
++	export XERCESCROOT="${ISSM_EXT_DIR}/xerces/src"
+ fi
++
++XAIFBOOSTERROOT="${ISSM_EXT_DIR}/xaifbooster"
++XAIF_ROOT="${XAIFBOOSTERROOT}/xaifBooster"
++if [ -d "${XAIF_ROOT}" ]; then
++	export XAIFBOOSTERROOT
++	export XAIF_DIR="${XAIF_ROOT}"
++	export XAIFBOOSTER_HOME="${XAIF_ROOT}"
++	export PLATFORM="x86-Linux"
++fi
++
++VALGRIND_ROOT="${ISSM_EXT_DIR}/valgrind/install"
++path_prepend "${VALGRIND_ROOT}/bin"
++
++DOXYGEN_ROOT="${ISSM_EXT_DIR}/doxygen/install"
++path_prepend "${DOXYGEN_ROOT}/bin"
++
++path_append "${ISSM_DIR}/aux-config"
++path_append "${ISSM_EXT_DIR}/shell2junit/install"
+Index: ../trunk-jpl/externalpackages/gmt/install-6-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-mac-static.sh	(revision 25855)
++++ ../trunk-jpl/externalpackages/gmt/install-6-mac-static.sh	(revision 25856)
+@@ -6,16 +6,12 @@
+ #
+ VER="6.0.0"
+ 
+-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-BLASLAPACK_ROOT="${PETSC_ROOT}"
+-HDF5_ROOT="${PETSC_ROOT}"
+-
+ # Find libgfortran and libgcc so we do not have to hardcode them
+ #
+ # Should retrieve a copy of gfortran that is compiled from source before returning one that is installed via package manager
+ #
+ # TODO:
++# - Move this to etc/environment.sh
+ # - Test if -static-libgfortran flag will avoid all of this.
+ # - Otherwise, refactor this to work with other gfortran installations.
+ #
+@@ -29,6 +25,9 @@
+ # Environment
+ #
+ export CC=mpicc
++export CURL_INCLUDE_DIRS="${CURL_ROOT}/include"
++export CURL_LIBRARIES="${CURL_ROOT}/lib/libcurl.a;-framework CoreFoundation;-framework Security;-lldap;-lz"
++export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
+@@ -37,8 +36,8 @@
+ tar -zxvf gmt-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+ mv gmt-${VER}/* src
+@@ -55,11 +54,18 @@
+ mkdir build
+ cd build
+ 
++# NOTE:
++# - The CMake modules used to find and probe the BLAS and LAPACK libraries do
++#	not seem to handle the situation where BLAS_LIBRARY and LAPACK_LIBRARY are
++#	set but we are working with static libraries
++#	(see customized ConfigUser.static.cmake). Using BLAS_LIBRARIES and
++#	LAPACK_LIBRARIES is a workaround.
++#
+ cmake \
+-	-DBLAS_LIBRARIES="${BLASLAPACK_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
++	-DBLAS_LIBRARIES="${BLAS_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+ 	-DGDAL_EXTRA_LIBS="${GDAL_EXTRA_LIBS}" \
+ 	-DHDF5_ROOT="${HDF5_ROOT}" \
+-	-DLAPACK_LIBRARIES="${BLASLAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
++	-DLAPACK_LIBRARIES="${LAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+ 	-DNETCDF_EXTRA_LIBS="${NETCDF_EXTRA_LIBS}" \
+ 	..
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25856-25857.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25856-25857.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25856-25857.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25856)
++++ ../trunk-jpl/etc/environment.sh	(revision 25857)
+@@ -247,6 +247,11 @@
+ 	ld_library_path_append "${MPI_ROOT}/lib"
+ fi
+ 
++LAPACK_ROOT="${ISSM_EXT_DIR}/lapack/install"
++if [ -d "${LAPACK_ROOT}" ]; then
++	ld_library_path_append "${LAPACK_ROOT}/lib"
++fi
++
+ PETSC_ROOT="${ISSM_EXT_DIR}/petsc/install"
+ if [ -d "$PETSC_ROOT" ]; then
+ 	export PETSC_ROOT # Used in installation of Gmsh
+@@ -301,9 +306,6 @@
+ 	fi
+ fi
+ 
+-LAPACK_ROOT="${ISSM_EXT_DIR}/lapack/install"
+-ld_library_path_append "${LAPACK_ROOT}/lib"
+-
+ SCOTCH_ROOT="${ISSM_EXT_DIR}/scotch/install"
+ ld_library_path_append "${SCOTCH_ROOT}/lib"
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25857-25858.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25857-25858.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25857-25858.diff	(revision 26740)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25857)
++++ ../trunk-jpl/etc/environment.sh	(revision 25858)
+@@ -261,14 +261,12 @@
+ 	#
+ 
+ 	# BLAS
+-	NUM_BLAS_LIBS=$(find ${PETSC_ROOT}/lib -name libblas.* -o -name libfblas.* | wc -l)
+-	if [ ${NUM_BLAS_LIBS} -gt 0 ]; then
++	if ls ${PETSC_ROOT}/lib/libblas.* 1> /dev/null 2>&1 || ls ${PETSC_ROOT}/lib/libfblas.* 1> /dev/null 2>&1; then
+ 		export BLAS_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
+ 	fi
+ 
+ 	# HDF5
+-	NUM_HDF5_LIBS=$(find ${PETSC_ROOT}/lib -name libhdf5.* | wc -l)
+-	if [ ${NUM_HDF5_LIBS} -gt 0 ]; then
++	if ls ${PETSC_ROOT}/lib/libhdf5.* 1> /dev/null 2>&1; then
+ 		export HDF5_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+ 		cpath_append "${PETSC_ROOT}/include"
+ 		library_path_append "${PETSC_ROOT}/lib"
+@@ -277,14 +275,12 @@
+ 	fi
+ 
+ 	# LAPACK
+-	NUM_LAPACK_LIBS=$(find ${PETSC_ROOT}/lib -name liblapack.* -o -name libflapack.* | wc -l)
+-	if [ ${NUM_LAPACK_LIBS} -gt 0 ]; then
++	if ls ${PETSC_ROOT}/lib/liblapack.* 1> /dev/null 2>&1 || ls ${PETSC_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+ 		export LAPACK_ROOT="${PETSC_ROOT}" # Used in installation of Dakota, GMT
+ 	fi
+ 
+ 	# METIS
+-	NUM_METIS_LIBS=$(find ${PETSC_ROOT}/lib -name libmetis.* | wc -l)
+-	if [ ${NUM_METIS_LIBS} -gt 0 ]; then
++	if ls ${PETSC_ROOT}/lib/libmetis.* 1> /dev/null 2>&1; then
+ 		export METIS_ROOT="${PETSC_ROOT}" # Used in installation of Gmsh
+ 	fi
+ 
+@@ -300,8 +296,7 @@
+ 	fi
+ 
+ 	# ZLIB
+-	NUM_ZLIB_LIBS=$(find ${PETSC_ROOT}/lib -name libz.* | wc -l)
+-	if [ ${NUM_ZLIB_LIBS} -gt 0 ]; then
++	if ls ${PETSC_ROOT}/lib/libz.* 1> /dev/null 2>&1; then
+ 		export ZLIB_ROOT="${PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+ 	fi
+ fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25858-25859.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25858-25859.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25858-25859.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25858)
++++ ../trunk-jpl/etc/environment.sh	(revision 25859)
+@@ -9,6 +9,9 @@
+ #	directory
+ #
+ 
++# Silence no `zsh: no matches found: <file>`
++setopt +o nomatch >1 /dev/null 2>&1
++
+ ## Functions
+ #
+ c_include_path_append(){ #{{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-25859-25860.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25859-25860.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25859-25860.diff	(revision 26740)
@@ -0,0 +1,8080 @@
+Index: ../trunk-jpl/externalpackages/boost/install-1.7-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/install-1.7-linux-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/boost/install-1.7-linux-static.sh	(revision 25860)
+@@ -6,9 +6,7 @@
+ #
+ VER="1_73_0"
+ 
+-## Envrionment
+-#
+-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
++PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/boost_${VER}.tar.gz" "boost_${VER}.tar.gz"
+@@ -17,17 +15,17 @@
+ tar -zxvf boost_${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source into 'src' directory
+-mv boost_${VER}/* src/
++mv boost_${VER}/* src
+ rm -rf boost_${VER}
+ 
+ # Configure
+ cd src
+ ./bootstrap.sh \
+-	--prefix="${BOOST_ROOT}/install" \
++	--prefix=${PREFIX} \
+ 	--with-python=python2.7
+ 
+ # Modify project config to enable MPI
+Index: ../trunk-jpl/externalpackages/boost/install-1.7-linux-valgrind.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/install-1.7-linux-valgrind.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/boost/install-1.7-linux-valgrind.sh	(revision 25860)
+@@ -6,9 +6,7 @@
+ #
+ VER="1_73_0"
+ 
+-## Envrionment
+-#
+-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
++PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/boost_${VER}.tar.gz" "boost_${VER}.tar.gz"
+@@ -17,11 +15,11 @@
+ tar -zxvf boost_${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source into 'src' directory
+-mv boost_${VER}/* src/
++mv boost_${VER}/* src
+ rm -rf boost_${VER}
+ 
+ # Copy customized source and config files to 'src' directory
+@@ -30,7 +28,7 @@
+ # Configure
+ cd src
+ ./bootstrap.sh \
+-	--prefix="${BOOST_ROOT}/install" \
++	--prefix=${PREFIX} \
+ 	--with-python=python2.7
+ 
+ # Modify project config to enable MPI
+Index: ../trunk-jpl/externalpackages/boost/install-1.7-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/install-1.7-linux.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/boost/install-1.7-linux.sh	(revision 25860)
+@@ -6,9 +6,7 @@
+ #
+ VER="1_73_0"
+ 
+-## Envrionment
+-#
+-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
++PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/boost_${VER}.tar.gz" "boost_${VER}.tar.gz"
+@@ -17,17 +15,17 @@
+ tar -zxvf boost_${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source into 'src' directory
+-mv boost_${VER}/* src/
++mv boost_${VER}/* src
+ rm -rf boost_${VER}
+ 
+ # Configure
+ cd src
+ ./bootstrap.sh \
+-	--prefix="${BOOST_ROOT}/install" \
++	--prefix=${PREFIX} \
+ 	--with-python=python2.7
+ 
+ # Modify project config to enable MPI
+Index: ../trunk-jpl/externalpackages/boost/install-1.7-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/install-1.7-mac-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/boost/install-1.7-mac-static.sh	(revision 25860)
+@@ -6,9 +6,11 @@
+ #
+ VER="1_73_0"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
++export LDFLAGS="-Wl,-headerpad_max_install_names"
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/boost_${VER}.tar.gz" "boost_${VER}.tar.gz"
+@@ -17,17 +19,17 @@
+ tar -zxvf boost_${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source into 'src' directory
+-mv boost_${VER}/* src/
++mv boost_${VER}/* src
+ rm -rf boost_${VER}
+ 
+ # Configure
+ cd src
+ ./bootstrap.sh \
+-	--prefix="${BOOST_ROOT}/install" \
++	--prefix=${PREFIX} \
+ 	--with-python=python2.7
+ 
+ # Modify project config to enable MPI
+@@ -40,4 +42,4 @@
+ #
+ # TODO: Reconfigure so that dynamic libraries are not compiled at all
+ #
+-rm -f $(find ${BOOST_ROOT}/install/lib -name *.dylib)
++rm -f $(find ${PREFIX}/lib -name *.dylib)
+Index: ../trunk-jpl/externalpackages/boost/install-1.7-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/install-1.7-mac.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/boost/install-1.7-mac.sh	(revision 25860)
+@@ -6,9 +6,10 @@
+ #
+ VER="1_73_0"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/boost/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+-export BOOST_ROOT="${ISSM_DIR}/externalpackages/boost"
+ export LDFLAGS="-Wl,-headerpad_max_install_names"
+ 
+ # Download source
+@@ -18,17 +19,17 @@
+ tar -zxvf boost_${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source into 'src' directory
+-mv boost_${VER}/* src/
++mv boost_${VER}/* src
+ rm -rf boost_${VER}
+ 
+ # Configure
+ cd src
+ ./bootstrap.sh \
+-	--prefix=${BOOST_ROOT}/install \
++	--prefix=${PREFIX} \
+ 	--with-python=python2.7
+ 
+ # Modify project config to enable MPI
+@@ -48,7 +49,7 @@
+ # - Modify the source to apply absolute paths to the library ids so that 
+ #	patching it after the fact with install_name_tool is not necessary.
+ #
+-cd ${BOOST_ROOT}/install/lib
++cd ${PREFIX}/lib
+ for name in *.dylib; do
+-	install_name_tool -id ${BOOST_ROOT}/install/lib/${name} ${name} 2>/dev/null
++	install_name_tool -id ${PREFIX}/lib/${name} ${name} 2>/dev/null
+ done
+Index: ../trunk-jpl/externalpackages/chaco/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/chaco/install.sh	(revision 25860)
+@@ -9,7 +9,7 @@
+ PREFIX="${ISSM_DIR}/externalpackages/chaco/install" # Set to location where external package should be installed
+ 
+ # Cleanup
+-rm -rf ${PREFIX} src Chaco-${VER}
++rm -rf ${PREFIX} src
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+Index: ../trunk-jpl/externalpackages/gdal/install-3-netcdf-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-netcdf-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gdal/install-3-netcdf-static.sh	(nonexistent)
+@@ -1,63 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# TODO
+-# - May want to supply path to Python instead of, effectively, using result of 
+-#	`which python`
+-#
+-
+-## Constants
+-#
+-VER="3.1.1"
+-
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
+-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-## Environment
+-#
+-export CC=mpicc
+-export CXX=mpicxx
+-export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+-export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf gdal-$VER.tar.gz
+-
+-# Move source into 'src' directory
+-mv gdal-$VER/* src
+-rm -rf gdal-$VER
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--enable-fast-install \
+-	--disable-shared \
+-	--without-ld-shared \
+-	--enable-static \
+-	--with-pic \
+-	--with-libz="${ZLIB_ROOT}" \
+-	--with-hdf5="${HDF5_ROOT}" \
+-	--with-netcdf="${NETCDF_ROOT}" \
+-	--with-proj="${PROJ_ROOT}" \
+-	--with-pg=no
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gdal/install-3-netcdf-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gdal/install-3-netcdf.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-netcdf.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gdal/install-3-netcdf.sh	(nonexistent)
+@@ -1,49 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# Constants
+-#
+-VER="3.1.1"
+-
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
+-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-## Environment
+-#
+-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf gdal-$VER.tar.gz
+-
+-# Move source into 'src' directory
+-mv gdal-$VER/* src
+-rm -rf gdal-$VER
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--enable-fast-install \
+-	--with-libz="${ZLIB_ROOT}" \
+-	--with-hdf5="${HDF5_ROOT}" \
+-	--with-netcdf="${NETCDF_ROOT}" \
+-	--with-proj="${PROJ_ROOT}"
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gdal/install-3-netcdf.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf-static.sh	(nonexistent)
+@@ -1,64 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# TODO
+-# - May want to supply path to Python instead of, effectively, using result of 
+-#	`which python`
+-#
+-
+-## Constants
+-#
+-VER="3.1.1"
+-
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
+-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-## Environment
+-#
+-export CC=mpicc
+-export CXX=mpicxx
+-export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+-export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
+-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf gdal-$VER.tar.gz
+-
+-# Move source into 'src' directory
+-mv gdal-$VER/* src
+-rm -rf gdal-$VER
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--enable-fast-install \
+-	--disable-shared \
+-	--without-ld-shared \
+-	--enable-static \
+-	--with-pic \
+-	--with-python \
+-	--with-libz="${ZLIB_ROOT}" \
+-	--with-hdf5="${HDF5_ROOT}" \
+-	--with-netcdf="${NETCDF_ROOT}" \
+-	--with-proj="${PROJ_ROOT}" \
+-	--with-pg=no
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf.sh	(nonexistent)
+@@ -1,54 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-## TODO
+-#	- May want to supply path to Python instead of, effectively, using result of `which python`
+-#
+-
+-## Constants
+-#
+-VER="3.1.1"
+-
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-NETCDF_ROOT="${ISSM_DIR}/externalpackages/netcdf/install"
+-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-## Environment
+-#
+-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build)
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf gdal-$VER.tar.gz
+-
+-# Move source into 'src' directory
+-mv gdal-$VER/* src
+-rm -rf gdal-$VER
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--enable-fast-install \
+-	--with-python \
+-	--with-libz="${ZLIB_ROOT}" \
+-	--with-hdf5="${HDF5_ROOT}" \
+-	--with-netcdf="${NETCDF_ROOT}" \
+-	--with-proj="${PROJ_ROOT}"
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gdal/install-3-python-netcdf.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/install-4-mac-python-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4-mac-python-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/install-4-mac-python-static.sh	(nonexistent)
+@@ -1,68 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# TODO:
+-# - Add support for,
+-#	- BLAS_LAPACK
+-#	- MUMPS
+-#	- NUMPY
+-#	- PETSC4PY
+-#	- PETSC
+-# (see configs/4/mac/static/CMakeLists.txt)
+-#
+-
+-## Constants
+-#
+-VER="4.5.6"
+-
+-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
+-
+-# Untar source
+-tar -xvzf gmsh-${VER}-source.tgz
+-
+-# Move source to 'src' directory
+-mv gmsh-${VER}-source/* src
+-rm -rf gmsh-${VER}-source
+-
+-# Copy customized source and config files to 'src' directory
+-cp configs/${VER}/mac/static/CMakeLists.txt src
+-
+-# Configure
+-#
+-# NOTE:
+-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
+-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
+-#	movies.
+-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
+-#	importing STEP/IGES files.
+-# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
+-#	do not need to support Apple Touch bar.
+-#
+-cd install
+-cmake ../src \
+-	-DCMAKE_BUILD_TYPE=Release \
+-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
+-	-DENABLE_BUILD_LIB=1 \
+-	-DENABLE_FLTK=0 \
+-	-DENABLE_MPEG_ENCODE=0 \
+-	-DENABLE_MPI=1 \
+-	-DENABLE_OCC=0 \
+-	-DENABLE_TOUCHBAR=0 \
+-	-DMETIS_ROOT="${PETSC_ROOT}"
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gmsh/install-4-mac-python-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/install-win64-precompiled.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-win64-precompiled.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/install-win64-precompiled.sh	(nonexistent)
+@@ -1,24 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-# Set gmsh version
+-VER="3.0.5"
+-
+-# Set tarball name
+-TARBALL_NAME="gmsh-${VER}-win64-precompiled"
+-TARBALL=${TARBALL_NAME}.tar.gz
+-
+-# Clean up from previous installation
+-rm -rf install
+-
+-# Download Windows 64-bit precompiled gmsh from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
+-
+-# Untar gmsh
+-tar -xvzf $TARBALL
+-
+-# Rename untarred dir
+-mv $TARBALL_NAME install
+-
+-# Clean up
+-rm -f $TARBALL
+
+Property changes on: ../trunk-jpl/externalpackages/gmsh/install-win64-precompiled.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/install-4-linux-python-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4-linux-python-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/install-4-linux-python-static.sh	(nonexistent)
+@@ -1,67 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# TODO:
+-# - Add support for,
+-#	- BLAS_LAPACK
+-#	- MUMPS
+-#	- NUMPY
+-#	- PETSC4PY
+-#	- PETSC
+-# (see configs/4/linux/static/CMakeLists.txt)
+-#
+-
+-## Constants
+-#
+-VER="4.5.6"
+-
+-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
+-
+-# Untar source
+-tar -xvzf gmsh-${VER}-source.tgz
+-
+-# Move source to 'src' directory
+-mv gmsh-${VER}-source/* src
+-rm -rf gmsh-${VER}-source
+-
+-# Copy customized source and config files to 'src' directory
+-cp configs/${VER}/static/CMakeLists.txt src
+-
+-# Configure
+-#
+-# NOTE:
+-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
+-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
+-#	movies.
+-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
+-#	importing STEP/IGES files.
+-# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
+-#	do not need to support Apple Touch bar.
+-#
+-cd install
+-cmake ../src \
+-	-DCMAKE_BUILD_TYPE=Release \
+-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
+-	-DENABLE_BUILD_LIB=1 \
+-	-DENABLE_FLTK=0 \
+-	-DENABLE_MPEG_ENCODE=0 \
+-	-DENABLE_MPI=1 \
+-	-DENABLE_OCC=0 \
+-	-DMETIS_ROOT="${PETSC_ROOT}"
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gmsh/install-4-linux-python-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/install-4-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4-linux-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/install-4-linux-static.sh	(nonexistent)
+@@ -1,63 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# TODO:
+-# - Add support for,
+-#	- BLAS_LAPACK
+-#	- MUMPS
+-#	- PETSC
+-# (see configs/4/linux/static/CMakeLists.txt)
+-#
+-
+-## Constants
+-#
+-VER="4.5.6"
+-
+-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
+-
+-# Untar source
+-tar -xvzf gmsh-${VER}-source.tgz
+-
+-# Move source to 'src' directory
+-mv gmsh-${VER}-source/* src
+-rm -rf gmsh-${VER}-source
+-
+-# Copy customized source and config files to 'src' directory
+-cp configs/${VER}/static/CMakeLists.txt src
+-
+-# Configure
+-#
+-# NOTE:
+-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
+-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
+-#	movies.
+-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
+-#	importing STEP/IGES files.
+-#
+-cd install
+-cmake ../src \
+-	-DCMAKE_BUILD_TYPE=Release \
+-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
+-	-DENABLE_BUILD_LIB=1 \
+-	-DENABLE_FLTK=0 \
+-	-DENABLE_MPEG_ENCODE=0 \
+-	-DENABLE_MPI=1 \
+-	-DENABLE_OCC=0 \
+-	-DMETIS_ROOT="${PETSC_ROOT}"
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gmsh/install-4-linux-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/install-mac-precompiled.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-mac-precompiled.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/install-mac-precompiled.sh	(nonexistent)
+@@ -1,23 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-# Set gmsh version
+-GMSH_VER="3.0.5"
+-
+-# Set tarball name
+-GMSH_TARBALL_NAME="gmsh-${GMSH_VER}-mac-precompiled"
+-
+-# Clean up from previous installation
+-rm -f $GMSH_TARBALL_NAME.tar.gz
+-rm -rf install src
+-
+-# Download Mac precompiled gmsh from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${GMSH_TARBALL_NAME}.tar.gz" "${GMSH_TARBALL_NAME}.tar.gz"
+-
+-# Untar gmsh
+-tar -xvzf $GMSH_TARBALL_NAME.tar.gz
+-
+-# Copy gmsh to path expected by packager
+-mkdir install
+-cp gmsh install
+-rm gmsh
+
+Property changes on: ../trunk-jpl/externalpackages/gmsh/install-mac-precompiled.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/install-4-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4-mac-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/install-4-mac-static.sh	(nonexistent)
+@@ -1,65 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# TODO:
+-# - Add support for,
+-#	- BLAS_LAPACK
+-#	- MUMPS
+-#	- PETSC
+-# (see configs/4/mac/static/CMakeLists.txt)
+-#
+-
+-## Constants
+-#
+-VER="4.5.6"
+-
+-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
+-
+-# Untar source
+-tar -xvzf gmsh-${VER}-source.tgz
+-
+-# Move source to 'src' directory
+-mv gmsh-${VER}-source/* src
+-rm -rf gmsh-${VER}-source
+-
+-# Copy customized source and config files to 'src' directory
+-cp configs/${VER}/mac/static/CMakeLists.txt src
+-
+-# Configure
+-#
+-# NOTE:
+-# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
+-# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
+-#	movies.
+-# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
+-#	importing STEP/IGES files.
+-# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
+-#	do not need to support Apple Touch bar.
+-#
+-cd install
+-cmake ../src \
+-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
+-	-DENABLE_BUILD_LIB=1 \
+-	-DENABLE_FLTK=0 \
+-	-DENABLE_MPEG_ENCODE=0 \
+-	-DENABLE_MPI=1 \
+-	-DENABLE_OCC=0 \
+-	-DENABLE_TOUCHBAR=0 \
+-	-DMETIS_ROOT="${PETSC_ROOT}"
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/gmsh/install-4-mac-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/configs/4.5.6/mac/static/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/configs/4.5.6/mac/static/CMakeLists.txt	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/configs/4.5.6/mac/static/CMakeLists.txt	(nonexistent)
+@@ -1,2141 +0,0 @@
+-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+-#
+-# See the LICENSE.txt file for license information. Please report all
+-# issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
+-
+-cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+-
+-# do not warn about non-definition of WIN32 on Cygwin
+-set(CMAKE_LEGACY_CYGWIN_WIN32 0)
+-
+-# if CMAKE_BUILD_TYPE is specified use it; otherwise set the default
+-# build type to "RelWithDebInfo" ("-O2 -g" with gcc) prior to calling
+-# project()
+-if(DEFINED CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type")
+-else()
+-  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type")
+-endif()
+-
+-project(gmsh CXX C)
+-
+-# this variable controls the default value of the options which are normally set
+-# to ON (useful if you want to configure a minimal version of Gmsh: e.g. "cmake
+-# -DDEFAULT=0 -DENABLE_POST=1 -DENABLE_PARSER=1")
+-set(DEFAULT ON CACHE INTERNAL "Default value for enabled-by-default options")
+-
+-macro(opt OPTION HELP VALUE)
+-  option(ENABLE_${OPTION} ${HELP} ${VALUE})
+-  set(OPT_TEXI "${OPT_TEXI}\n@item ENABLE_${OPTION}\n${HELP} (default: ${VALUE})")
+-endmacro()
+-
+-opt(3M "Enable proprietary 3M extension" OFF)
+-opt(ACIS "Enable ACIS geometrical models (experimental)" ${DEFAULT})
+-opt(ALGLIB "Enable ALGLIB (used by some mesh optimizers)" ${DEFAULT})
+-opt(ANN "Enable ANN (used for fast point search in mesh/post)" ${DEFAULT})
+-opt(BAMG "Enable Bamg 2D anisotropic mesh generator" ${DEFAULT})
+-opt(BLAS_LAPACK "Enable BLAS/Lapack for linear algebra (required for meshing)" ON)
+-opt(BLOSSOM "Enable Blossom algorithm (needed for full quad meshing)" ${DEFAULT})
+-opt(BUILD_LIB "Enable 'lib' target for building static Gmsh library" OFF)
+-opt(BUILD_SHARED "Enable 'shared' target for building shared Gmsh library" OFF)
+-opt(BUILD_DYNAMIC "Enable dynamic Gmsh executable (linked with shared library)" OFF)
+-opt(BUILD_ANDROID "Enable Android NDK library target (experimental)" OFF)
+-opt(BUILD_IOS "Enable iOS library target (experimental)" OFF)
+-opt(CGNS "Enable CGNS import/export (experimental)" ${DEFAULT})
+-opt(CGNS_CPEX0045 "Enable high-order CGNS import/export following CPEX0045 (experimental)" OFF)
+-opt(CAIRO "Enable Cairo to render fonts (experimental)" ${DEFAULT})
+-opt(CXX11 "Enable C++11" ON)
+-opt(C99 "Enable C99" ON)
+-opt(PROFILE "Enable profiling compiler flags" OFF)
+-opt(DINTEGRATION "Enable discrete integration (needed for levelsets)" ${DEFAULT})
+-opt(DOMHEX "Enable experimental DOMHEX code" ${DEFAULT})
+-opt(FLTK "Enable FLTK graphical user interface (requires mesh/post)" ${DEFAULT})
+-opt(GETDP "Enable GetDP solver (linked as a library, experimental)" ${DEFAULT})
+-opt(GMM "Enable GMM linear solvers (simple alternative to PETSc)" ${DEFAULT})
+-opt(GMP "Enable GMP for Kbipack (advanced)" ON)
+-opt(GRAPHICS "Enable building graphics lib even without GUI (advanced)" OFF)
+-opt(HXT "Enable HXT library (for reparametrization and meshing)" ${DEFAULT})
+-opt(KBIPACK "Enable Kbipack (neeeded by homology solver)" ${DEFAULT})
+-opt(MATHEX "Enable Mathex expression parser (used by plugins and options)" ${DEFAULT})
+-opt(MED "Enable MED mesh and post file formats" ${DEFAULT})
+-opt(MESH "Enable mesh module (required by GUI)" ${DEFAULT})
+-opt(METIS "Enable Metis mesh partitioner" ${DEFAULT})
+-opt(MMG3D "Enable MMG3D 3D anisotropic mesh refinement" ${DEFAULT})
+-opt(MPEG_ENCODE "Enable built-in MPEG movie encoder" ${DEFAULT})
+-opt(MPI "Enable MPI (experimental, not used for meshing)" OFF)
+-opt(MSVC_STATIC_RUNTIME "Enable static Visual C++ runtime" OFF)
+-opt(MUMPS "Enable MUMPS sparse direct linear solver" OFF)
+-opt(NETGEN "Enable Netgen 3D frontal mesh generator" ${DEFAULT})
+-opt(NUMPY "Enable fullMatrix and numpy array conversion for private API" OFF)
+-opt(PETSC4PY "Enable petsc4py wrappers for petsc matrices for private API" OFF)
+-opt(OCC "Enable OpenCASCADE CAD kernel" ${DEFAULT})
+-opt(OCC_CAF "Enable OpenCASCADE CAF module (for STEP/IGES attributes)" ${DEFAULT})
+-opt(OCC_STATIC "Link OpenCASCADE static instead of dynamic libraries (requires ENABLE_OCC)" OFF)
+-opt(OCC_TBB "Add TBB libraries in list of OCC libraries" OFF)
+-opt(ONELAB "Enable ONELAB solver interface" ${DEFAULT})
+-opt(ONELAB_METAMODEL "Enable ONELAB metamodels (experimental)" ${DEFAULT})
+-opt(OPENACC "Enable OpenACC" OFF)
+-opt(OPENMP "Enable OpenMP" OFF)
+-opt(OPTHOM "Enable high-order mesh optimization tools" ${DEFAULT})
+-opt(OS_SPECIFIC_INSTALL "Enable OS-specific (e.g. app bundle) installation" OFF)
+-opt(OSMESA "Enable OSMesa for offscreen rendering (experimental)" OFF)
+-opt(P4EST "Enable p4est for enabling automatic mesh size firld (experimental)" OFF)
+-opt(PACKAGE_STRIP "Strip symbols in install packages to reduce install size" ON)
+-opt(PARSER "Enable GEO file parser (required for .geo/.pos files)" ${DEFAULT})
+-opt(PETSC "Enable PETSc linear solvers (required for SLEPc)" OFF)
+-opt(PLUGINS "Enable post-processing plugins" ${DEFAULT})
+-opt(POST "Enable post-processing module (required by GUI)" ${DEFAULT})
+-opt(POPPLER "Enable Poppler for displaying PDF documents (experimental)" OFF)
+-opt(PRIVATE_API "Enable private API" OFF)
+-opt(QUADTRI "Enable QuadTri structured meshing extensions" ${DEFAULT})
+-opt(REVOROPT "Enable Revoropt (used for CVT remeshing)" OFF)
+-opt(SLEPC "Enable SLEPc eigensolvers" OFF)
+-opt(SOLVER "Enable built-in finite element solvers (required for compounds)" ${DEFAULT})
+-opt(SYSTEM_CONTRIB "Use system versions of contrib libraries, when possible" OFF)
+-opt(TCMALLOC "Enable libtcmalloc (fast malloc that does not release memory)" OFF)
+-opt(TOUCHBAR "Enable Apple Touch bar" ${DEFAULT})
+-opt(VISUDEV "Enable additional visualization capabilities for development purposes" OFF)
+-opt(VOROPP "Enable voro++ (for hex meshing, experimental)" ${DEFAULT})
+-opt(WRAP_JAVA "Enable generation of Java wrappers for private API" OFF)
+-opt(WRAP_PYTHON "Enable generation of Python wrappers for private API" OFF)
+-opt(ZIPPER "Enable Zip file compression/decompression" OFF)
+-
+-set(GMSH_MAJOR_VERSION 4)
+-set(GMSH_MINOR_VERSION 5)
+-set(GMSH_PATCH_VERSION 6)
+-set(GMSH_EXTRA_VERSION "")
+-set(GMSH_EXTRA_VERSION_TEXI "${GMSH_EXTRA_VERSION}")
+-
+-if(NOT GMSH_RELEASE)
+-  find_package(Git)
+-  if(GIT_FOUND)
+-    execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
+-                    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ERROR_QUIET
+-                    OUTPUT_VARIABLE GIT_COMMIT_HASH
+-                    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  endif()
+-  if(GIT_COMMIT_HASH)
+-    set(GMSH_EXTRA_VERSION "${GMSH_EXTRA_VERSION}-git-${GIT_COMMIT_HASH}")
+-  endif()
+-  set(GMSH_EXTRA_VERSION_TEXI "${GMSH_EXTRA_VERSION_TEXI} (development version)")
+-endif()
+-
+-set(GMSH_VERSION "${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}")
+-set(GMSH_VERSION "${GMSH_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}")
+-set(GMSH_SHORT_LICENSE "GNU General Public License")
+-
+-set(GMSH_API api/gmsh.h api/gmshc.h api/gmsh.h_cwrap)
+-
+-if(ENABLE_PRIVATE_API)
+-  message(WARNING "The private API is unsupported and undocumented. It is meant "
+-          "for expert Gmsh developers, not for regular Gmsh users, who should rely "
+-          "on the stable public API (gmsh/api) instead. If you are repackaging Gmsh, "
+-          "e.g. for a Linux distribution, please DO NOT distribute the private API "
+-          "(i.e. all the internal headers) and ship the stable public API instead "
+-          "(i.e. only the headers and modules in gmsh/api).")
+-  file(GLOB_RECURSE HEADERS Common/*.h Numeric/*.h Geo/*.h Mesh/*.h Solver/*.h
+-    Post/*.h Graphics/*.h contrib/kbipack/*.h contrib/DiscreteIntegration/*.h
+-    contrib/HighOrderMeshOptimizer/*.h contrib/MeshOptimizer/*.h
+-    contrib/MeshQualityOptimizer/*.h)
+-  set(GMSH_PRIVATE_API ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h
+-      ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h ${HEADERS})
+-  get_property(IAMCHILD DIRECTORY PROPERTY PARENT_DIRECTORY)
+-  if(IAMCHILD)
+-    set(GMSH_PRIVATE_API ${GMSH_PRIVATE_API} PARENT_SCOPE)
+-  endif()
+-endif()
+-
+-set(ONELAB_PY contrib/onelab/python/onelab.py)
+-set(GMSH_PY api/gmsh.py)
+-set(GMSH_JL api/gmsh.jl)
+-
+-if(${CMAKE_MAJOR_VERSION} GREATER 2)
+-  string(TIMESTAMP DATE "%Y%m%d")
+-else()
+-  execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE DATE
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-endif()
+-
+-if(NOT DATE)
+-  set(DATE "unknown")
+-endif()
+-set(GMSH_DATE "${DATE}")
+-
+-if(NOT GMSH_HOST)
+-  execute_process(COMMAND hostname OUTPUT_VARIABLE HOSTNAME
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  if(NOT HOSTNAME)
+-    set(HOSTNAME "unknown")
+-  endif()
+-  set(GMSH_HOST "${HOSTNAME}")
+-endif()
+-
+-if(NOT GMSH_PACKAGER)
+-  execute_process(COMMAND whoami OUTPUT_VARIABLE PACKAGER
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  if(NOT PACKAGER)
+-    set(PACKAGER "unknown")
+-  endif()
+-  string(REPLACE "\\" " " PACKAGER ${PACKAGER})
+-  set(GMSH_PACKAGER "${PACKAGER}")
+-endif()
+-
+-if(APPLE)
+-  set(GMSH_OS "MacOSX")
+-elseif(CYGWIN OR MSYS)
+-  # detect if we use the MinGW compilers on Cygwin - if we do, handle the build
+-  # as a pure Windows build
+-  if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
+-     CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-    execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
+-                    OUTPUT_VARIABLE CXX_COMPILER_MACHINE
+-                    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-    if(CXX_COMPILER_MACHINE MATCHES "mingw")
+-      set(GMSH_OS "Windows")
+-      set(WIN32 1)
+-      add_definitions(-DWIN32)
+-    endif()
+-  endif()
+-else()
+-  set(GMSH_OS "${CMAKE_SYSTEM_NAME}")
+-endif()
+-
+-include(CheckTypeSize)
+-include(CheckFunctionExists)
+-include(CheckIncludeFile)
+-include(CheckCXXCompilerFlag)
+-include(CheckCCompilerFlag)
+-
+-macro(set_config_option VARNAME STRING)
+-  set(${VARNAME} TRUE)
+-  list(APPEND CONFIG_OPTIONS ${STRING})
+-  message(STATUS "Found " ${STRING})
+-endmacro()
+-
+-# check if the machine is 64 bits (this is more reliable than using
+-# CMAKE_SIZEOF_VOID_P, which does not seem to work e.g. on some Suse
+-# machines)
+-check_type_size("void*" SIZEOF_VOID_P)
+-if(SIZEOF_VOID_P EQUAL 8)
+-  set_config_option(HAVE_64BIT_SIZE_T "64Bit")
+-endif()
+-
+-# append 32/64 to the build name on Linux and Windows
+-if(NOT APPLE)
+-  if(HAVE_64BIT_SIZE_T)
+-    set(GMSH_OS "${GMSH_OS}64")
+-  else()
+-    set(GMSH_OS "${GMSH_OS}32")
+-  endif()
+-endif()
+-
+-if(NOT ENABLE_BUILD_SHARED)
+-  if(ENABLE_WRAP_PYTHON OR ENABLE_WRAP_JAVA)
+-    set(ENABLE_BUILD_DYNAMIC ON)
+-  endif()
+-endif()
+-
+-if(ENABLE_BUILD_DYNAMIC)
+-  set(GMSH_OS "${GMSH_OS}-sdk")
+-endif()
+-
+-if(APPLE)
+-  # FIXME: change this once we understand rpaths - the options below do not work
+-  set(CMAKE_MACOSX_RPATH 0)
+-else()
+-  # make sure that dynamic libraries can be found when installing/ displacing the
+-  # binaries: from https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/
+-  # RPATH-handling:
+-
+-  # use, i.e. don't skip the full RPATH for the build tree
+-  set(CMAKE_SKIP_BUILD_RPATH  FALSE)
+-
+-  # when building, don't use the install RPATH already (but later on when
+-  # installing)
+-  set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+-
+-  # add the automatically determined parts of the RPATH which point to
+-  # directories outside the build tree to the install RPATH
+-  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+-
+-  # the RPATH to be used when installing, but only if it's not a system directory
+-  list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib"
+-       isSystemDir)
+-  if("${isSystemDir}" STREQUAL "-1")
+-     set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../lib")
+-  endif()
+-endif()
+-
+-if(MSVC)
+-  # remove annoying warning about bool/int cast performance
+-  set(GMSH_CONFIG_PRAGMAS "#pragma warning(disable:4800 4244 4267)")
+-  foreach(VAR
+-          CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+-          CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
+-          CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+-          CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
+-    if(ENABLE_MSVC_STATIC_RUNTIME AND ${VAR} MATCHES "/MD")
+-      string(REGEX REPLACE "/MD" "/MT" ${VAR} "${${VAR}}")
+-    endif()
+-    if(NOT ${VAR} MATCHES "/MP") # enable parallel compilation
+-      set(${VAR} "${${VAR}} /MP")
+-    endif()
+-  endforeach()
+-  if(ENABLE_PRIVATE_API)
+-    if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
+-      # automatically export .def file with all symbols (requires CMake 3.4);
+-      # depending on the compiling options this might lead to more than 64k export
+-      # symbols; just trim the .def file to keep the ones you need
+-      set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_OPENMP)
+-  find_package(OpenMP)
+-  if(OpenMP_FOUND)
+-    set_config_option(HAVE_OPENMP "OpenMP")
+-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+-  elseif(APPLE AND EXISTS "/opt/local/lib/libomp")
+-    # just for testing the official Apple compiler with macports' libomp
+-    set_config_option(HAVE_OPENMP "OpenMP[MacPorts]")
+-    set(CMAKE_C_FLAGS
+-        "${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp -I/opt/local/include/libomp")
+-    set(CMAKE_CXX_FLAGS
+-        "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -I/opt/local/include/libomp")
+-    list(APPEND EXTERNAL_LIBRARIES "-L/opt/local/lib/libomp -lomp")
+-  elseif(APPLE AND EXISTS "/usr/local/lib/libomp.dylib")
+-    set_config_option(HAVE_OPENMP "OpenMP[usr/local]")
+-    set(CMAKE_C_FLAGS
+-        "${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp")
+-    set(CMAKE_CXX_FLAGS
+-        "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp")
+-    list(APPEND EXTERNAL_LIBRARIES "-lomp")
+-  endif()
+-endif()
+-
+-if(ENABLE_OPENACC)
+-  find_package(OpenACC)
+-  if(OpenACC_C_FOUND AND OpenACC_CXX_FOUND)
+-    set_config_option(HAVE_OPENACC "OpenACC")
+-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenACC_C_FLAGS}")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenACC_CXX_FLAGS}")
+-  endif()
+-endif()
+-
+-if(ENABLE_CXX11)
+-  # in recent cmake versions we could do e.g. set(CMAKE_CXX_STANDARD 11)
+-  check_cxx_compiler_flag("-std=c++11" STDCXX11)
+-  if(STDCXX11)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+-  endif()
+-endif()
+-
+-if(ENABLE_C99)
+-  # in recent cmake versions we could do e.g. set(CMAKE_C_STANDARD 99)
+-  check_c_compiler_flag("-std=c99" STDC99)
+-  if(STDC99)
+-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
+-  endif()
+-endif()
+-
+-if(ENABLE_PROFILE)
+-    # Using the perf set of profiling tools doesn't work without the frame
+-    # pointer and a common optimisation is to remove it
+-    check_cxx_compiler_flag("-fno-omit-frame-pointer" FNOFP)
+-    if(FNOFP)
+-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
+-    endif()
+-endif()
+-
+-macro(append_gmsh_src DIRNAME FILES)
+-  foreach(FILE ${FILES})
+-    list(APPEND LIST ${DIRNAME}/${FILE})
+-  endforeach()
+-  set(GMSH_SRC ${GMSH_SRC};${LIST} PARENT_SCOPE)
+-  set(GMSH_DIRS ${GMSH_DIRS};${DIRNAME} PARENT_SCOPE)
+-endmacro()
+-
+-macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX)
+-  set(${VARNAME})
+-  list(LENGTH ${LISTNAME} NUM_LIST)
+-  foreach(LIB ${${LISTNAME}})
+-    if("${PATH}" STREQUAL "")
+-      find_library(FOUND_LIB ${LIB} PATH_SUFFIXES ${SUFFIX})
+-    else()
+-      find_library(FOUND_LIB ${LIB} PATHS ${PATH} NO_DEFAULT_PATH)
+-    endif()
+-    if(FOUND_LIB)
+-      list(APPEND ${VARNAME} ${FOUND_LIB})
+-    endif()
+-    unset(FOUND_LIB CACHE)
+-  endforeach()
+-  list(LENGTH ${VARNAME} NUM_FOUND_LIBRARIES)
+-  if(NUM_FOUND_LIBRARIES LESS NUM_LIST)
+-    set(${VARNAME})
+-  endif()
+-endmacro()
+-
+-macro(set_compile_flags LISTNAME FLAGS)
+-  foreach(FILE ${${LISTNAME}})
+-    get_source_file_property(PROP ${FILE} COMPILE_FLAGS)
+-    if(PROP)
+-      set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${PROP} ${FLAGS}")
+-    else()
+-      set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${FLAGS}")
+-    endif()
+-  endforeach()
+-endmacro()
+-
+-if(ENABLE_BLAS_LAPACK)
+-  if(BLAS_LAPACK_LIBRARIES)
+-    # use libs as specified in the BLAS_LAPACK_LIBRARIES variable
+-    set_config_option(HAVE_BLAS "Blas[custom]")
+-    set_config_option(HAVE_LAPACK "Lapack[custom]")
+-    set(LAPACK_LIBRARIES ${BLAS_LAPACK_LIBRARIES})
+-  else()
+-    if(MSVC)
+-      # on Windows with Visual C++ try really hard to find blas/lapack *without*
+-      # requiring a Fortran compiler: 1) try to find the Intel MKL libs using
+-      # the standard search path; if not found 2) try to get the reference
+-      # blas/lapack libs (useful for users with no Fortran compiler and no MKL
+-      # license, who can just download our precompiled "gmsh-dep" package)
+-      if(HAVE_64BIT_SIZE_T)
+-        set(MKL_PATH em64t/lib)
+-        set(MKL_LIBS_REQUIRED libguide40 mkl_intel_lp64 mkl_intel_thread mkl_core)
+-      else()
+-        set(MKL_PATH ia32/lib)
+-        set(MKL_LIBS_REQUIRED libguide40 mkl_intel_c mkl_intel_thread mkl_core)
+-      endif()
+-      find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
+-      if(LAPACK_LIBRARIES)
+-        set_config_option(HAVE_BLAS "Blas[mkl]")
+-        set_config_option(HAVE_LAPACK "Lapack[mkl]")
+-      else()
+-        set(REFLAPACK_LIBS_REQUIRED lapack blas g2c gcc)
+-        find_all_libraries(LAPACK_LIBRARIES REFLAPACK_LIBS_REQUIRED "" "")
+-        if(LAPACK_LIBRARIES)
+-          set_config_option(HAVE_BLAS "Blas[ref]")
+-          set_config_option(HAVE_LAPACK "Lapack[ref]")
+-        endif()
+-      endif()
+-    elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-      # on Linux try to find the Intel MKL without a Fortran compiler
+-      if(HAVE_64BIT_SIZE_T)
+-        set(MKL_PATH lib/em64t)
+-      else()
+-        set(MKL_PATH lib/32)
+-      endif()
+-      set(MKL_LIBS_REQUIRED mkl_gf_lp64 iomp5 mkl_gnu_thread mkl_core guide pthread)
+-      find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
+-      if(NOT LAPACK_LIBRARIES)
+-        # match lapack 9.0 on 64bit
+-        set(MKL_LIBS_REQUIRED mkl_lapack mkl_em64t guide)
+-        find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
+-      endif()
+-      if(LAPACK_LIBRARIES)
+-        set_config_option(HAVE_BLAS "Blas[mkl]")
+-        set_config_option(HAVE_LAPACK "Lapack[mkl]")
+-      else()
+-        # on Linux also try to find ATLAS without a Fortran compiler, because
+-        # cmake ships with a buggy FindBLAS e.g. on Ubuntu Lucid Lynx
+-        set(ATLAS_LIBS_REQUIRED lapack f77blas cblas atlas)
+-        find_all_libraries(LAPACK_LIBRARIES ATLAS_LIBS_REQUIRED "" "")
+-        if(LAPACK_LIBRARIES)
+-          set_config_option(HAVE_BLAS "Blas[atlas]")
+-          set_config_option(HAVE_LAPACK "Lapack[atlas]")
+-        else()
+-          # try with generic names
+-          set(GENERIC_LIBS_REQUIRED lapack blas pthread)
+-          find_all_libraries(LAPACK_LIBRARIES GENERIC_LIBS_REQUIRED "" "")
+-          if(LAPACK_LIBRARIES)
+-            set_config_option(HAVE_BLAS "Blas[generic]")
+-            set_config_option(HAVE_LAPACK "Lapack[generic]")
+-            find_library(GFORTRAN_LIB gfortran)
+-            if(GFORTRAN_LIB)
+-              list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
+-            endif()
+-          endif()
+-        endif()
+-      endif()
+-    elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+-      # on SunOS we know blas and lapack are available in sunperf
+-      set(LAPACK_LIBRARIES -library=sunperf)
+-      set_config_option(HAVE_BLAS "Blas[sunperf]")
+-      set_config_option(HAVE_LAPACK "Lapack[sunperf]")
+-    elseif(APPLE)
+-      # on Mac we also know that blas and lapack are available
+-      set(LAPACK_LIBRARIES "-llapack -lblas")
+-      set_config_option(HAVE_BLAS "Blas[veclib]")
+-      set_config_option(HAVE_LAPACK "Lapack[veclib]")
+-    endif()
+-
+-    if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
+-      # if we haven't found blas and lapack check for OpenBlas
+-      set(OPENBLAS_LIBS_REQUIRED openblas)
+-      find_all_libraries(LAPACK_LIBRARIES OPENBLAS_LIBS_REQUIRED "" "")
+-      if(LAPACK_LIBRARIES)
+-        set_config_option(HAVE_BLAS "Blas[openblas]")
+-        set_config_option(HAVE_LAPACK "Lapack[openblas]")
+-        find_library(GFORTRAN_LIB gfortran)
+-        if(GFORTRAN_LIB)
+-          list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
+-        endif()
+-      endif()
+-    endif()
+-
+-    if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
+-      # if we still haven't found blas and lapack, use the standard cmake tests,
+-      # which require a working Fortran compiler
+-      enable_language(Fortran)
+-      find_package(BLAS)
+-      if(BLAS_FOUND)
+-        set_config_option(HAVE_BLAS "Blas")
+-        find_package(LAPACK)
+-        if(LAPACK_FOUND)
+-          set_config_option(HAVE_LAPACK "Lapack")
+-        else()
+-          set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
+-        endif()
+-        if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
+-          if(CMAKE_Fortran_COMPILER MATCHES "gfortran")
+-            list(APPEND LAPACK_LIBRARIES gfortran)
+-          elseif(CMAKE_Fortran_COMPILER MATCHES "f95")
+-            list(APPEND LAPACK_LIBRARIES gfortran)
+-          elseif(CMAKE_Fortran_COMPILER MATCHES "g77")
+-            list(APPEND LAPACK_LIBRARIES g2c)
+-          endif()
+-        elseif(CMAKE_Fortran_COMPILER MATCHES "pgi")
+-          list(APPEND LAPACK_LIBRARIES -pgf77libs)
+-        endif()
+-      endif()
+-    endif()
+-
+-    if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
+-      message(WARNING "Could not find Blas or Lapack: most meshing algorithms "
+-              "will not be functional")
+-    endif()
+-
+-  endif()
+-endif()
+-
+-if(ENABLE_TCMALLOC)
+-  find_library(TCMALLOC tcmalloc)
+-  if(TCMALLOC)
+-    set_config_option(HAVE_TCMALLOC "TCMalloc")
+-    list(APPEND EXTERNAL_LIBRARIES ${TCMALLOC})
+-  endif()
+-endif()
+-
+-add_subdirectory(Common)
+-add_subdirectory(Numeric)
+-add_subdirectory(Geo)
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Mesh AND ENABLE_MESH)
+-  add_subdirectory(Mesh)
+-  set_config_option(HAVE_MESH "Mesh")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Solver AND ENABLE_SOLVER)
+-  add_subdirectory(Solver)
+-  set_config_option(HAVE_SOLVER "Solver")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Post AND ENABLE_POST)
+-  add_subdirectory(Post)
+-  set_config_option(HAVE_POST "Post")
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Plugin AND ENABLE_PLUGINS)
+-    add_subdirectory(Plugin)
+-    set_config_option(HAVE_PLUGINS "Plugins")
+-  endif()
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Parser AND ENABLE_PARSER)
+-  add_subdirectory(Parser)
+-  set_config_option(HAVE_PARSER "Parser")
+-endif()
+-
+-if(ENABLE_VISUDEV)
+-  set_config_option(HAVE_VISUDEV "VisuDev")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Fltk AND ENABLE_FLTK)
+-  # first, try to use fltk-config for fltk >= 1.3 (FindFLTK is buggy on Unix,
+-  # where e.g. xft and xinerama options are not dealt with)
+-  find_program(FLTK_CONFIG_SCRIPT fltk-config)
+-  if(FLTK_CONFIG_SCRIPT)
+-    execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --api-version
+-                    OUTPUT_VARIABLE FLTK_VERSION)
+-    string(STRIP "${FLTK_VERSION}" FLTK_VERSION)
+-    if(FLTK_VERSION VERSION_GREATER 1.1)
+-      add_subdirectory(Fltk)
+-      set_config_option(HAVE_FLTK "Fltk")
+-      message(STATUS "Using fltk-config script for Fltk " ${FLTK_VERSION})
+-      execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-gl --use-images --includedir
+-                      OUTPUT_VARIABLE FLTK_INCLUDE_DIR)
+-      string(STRIP ${FLTK_INCLUDE_DIR} FLTK_INCLUDE_DIR)
+-      list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
+-      # On linux (at least OpenSuSE) the following directories are
+-      # not existing (everything is in /usr/include). To avoid warnings
+-      # check existance of these directories before adding them
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/FL/images)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/FL/images)
+-      endif()
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/jpeg)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/jpeg)
+-      endif()
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/zlib)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/zlib)
+-      endif()
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/png)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/png)
+-      endif()
+-      execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-gl --use-images --ldflags
+-                      OUTPUT_VARIABLE FLTK_LIBRARIES)
+-      string(STRIP ${FLTK_LIBRARIES} FLTK_LIBRARIES)
+-      string(REGEX MATCH "fltk[_ ]jpeg" FLTK_JPEG ${FLTK_LIBRARIES})
+-      string(REGEX MATCH "fltk[_ ]z" FLTK_Z ${FLTK_LIBRARIES})
+-      string(REGEX MATCH "fltk[_ ]png" FLTK_PNG ${FLTK_LIBRARIES})
+-    endif()
+-  endif()
+-  # then try the built-in FindFLTK module
+-  if(NOT HAVE_FLTK)
+-    set(FLTK_SKIP_FORMS TRUE)
+-    set(FLTK_SKIP_FLUID TRUE)
+-    find_package(FLTK)
+-    if(FLTK_FOUND)
+-      add_subdirectory(Fltk)
+-      set_config_option(HAVE_FLTK "Fltk")
+-      list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
+-      # find fltk jpeg
+-      find_library(FLTK_JPEG NAMES fltk_jpeg fltkjpeg)
+-      if(FLTK_JPEG)
+-        list(APPEND EXTERNAL_LIBRARIES ${FLTK_JPEG})
+-        foreach(DIR ${FLTK_INCLUDE_DIR})
+-          list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/jpeg)
+-        endforeach()
+-      endif()
+-      # find fltk zlib
+-      find_library(FLTK_Z NAMES fltk_z fltkz)
+-      if(FLTK_Z)
+-        list(APPEND EXTERNAL_LIBRARIES ${FLTK_Z})
+-        foreach(DIR ${FLTK_INCLUDE_DIR})
+-          list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/zlib)
+-        endforeach()
+-      endif()
+-      # find fltk png
+-      find_library(FLTK_PNG NAMES fltk_png fltkpng)
+-      if(FLTK_PNG)
+-        list(APPEND EXTERNAL_LIBRARIES ${FLTK_PNG})
+-        foreach(DIR ${FLTK_INCLUDE_DIR})
+-          list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/png)
+-        endforeach()
+-      endif()
+-    endif()
+-  endif()
+-  # workaround for Fedora/Suse messing up fltk-config (see issue #417)
+-  if(HAVE_FLTK AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-    string(REGEX MATCH "X11" FLTK_X11 ${FLTK_LIBRARIES})
+-    if(NOT FLTK_X11)
+-      find_package(X11)
+-      if(X11_FOUND)
+-        list(APPEND EXTERNAL_INCLUDES ${X11_INCLUDE_DIR})
+-        list(APPEND EXTERNAL_LIBRARIES ${X11_LIBRARIES})
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-if(APPLE AND HAVE_FLTK AND ENABLE_TOUCHBAR)
+-  if(CMAKE_OSX_DEPLOYMENT_TARGET)
+-    if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_GREATER 10.11)
+-      set(GMSH_SRC ${GMSH_SRC};Fltk/touchBar.mm)
+-      set_config_option(HAVE_TOUCHBAR "TouchBar")
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_ONELAB)
+-  set_config_option(HAVE_ONELAB "ONELAB")
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/onelab)
+-    if(ENABLE_ONELAB_METAMODEL)
+-      add_subdirectory(contrib/onelab)
+-      include_directories(contrib/onelab)
+-      set_config_option(HAVE_ONELAB_METAMODEL "ONELABMetamodel")
+-    endif()
+-    file(COPY ${ONELAB_PY} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+-  endif()
+-endif()
+-
+-if(ENABLE_BUILD_IOS)
+-  find_file(CMAKE_TOOLCHAIN_FILE "ios.cmake")
+-  if(NOT CMAKE_TOOLCHAIN_FILE)
+-    message(FATAL_ERROR "Cannot compile Gmsh for iOS without a toolchain")
+-  endif()
+-  add_definitions(-DBUILD_IOS)
+-endif()
+-
+-if(HAVE_FLTK OR ENABLE_GRAPHICS)
+-  if(NOT HAVE_MESH OR NOT HAVE_POST OR NOT HAVE_PLUGINS OR NOT HAVE_ONELAB)
+-    message(SEND_ERROR "Cannot compile GUI without Mesh, Post, Plugin and ONELAB")
+-  endif()
+-
+-  if(FLTK_JPEG)
+-    set_config_option(HAVE_LIBJPEG "Jpeg[fltk]")
+-  else()
+-    find_package(JPEG)
+-    if(JPEG_FOUND)
+-      set_config_option(HAVE_LIBJPEG "Jpeg")
+-      list(APPEND EXTERNAL_LIBRARIES ${JPEG_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${JPEG_INCLUDE_DIR})
+-    endif()
+-  endif()
+-
+-  if(FLTK_Z)
+-    set_config_option(HAVE_LIBZ "Zlib[fltk]")
+-  else()
+-    find_package(ZLIB)
+-    if(ZLIB_FOUND)
+-      set_config_option(HAVE_LIBZ "Zlib")
+-      list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
+-    endif()
+-  endif()
+-
+-  if(HAVE_LIBZ)
+-    if(FLTK_PNG)
+-      set_config_option(HAVE_LIBPNG "Png[fltk]")
+-    else()
+-      find_package(PNG)
+-      if(PNG_FOUND)
+-        set_config_option(HAVE_LIBPNG "Png")
+-        list(APPEND EXTERNAL_LIBRARIES ${PNG_LIBRARIES})
+-        list(APPEND EXTERNAL_INCLUDES ${PNG_INCLUDE_DIR})
+-      endif()
+-    endif()
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/mpeg_encode AND
+-     ENABLE_MPEG_ENCODE)
+-    add_subdirectory(contrib/mpeg_encode)
+-    include_directories(contrib/mpeg_encode/headers)
+-    set_config_option(HAVE_MPEG_ENCODE "Mpeg")
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/3M AND ENABLE_3M)
+-    add_subdirectory(contrib/3M)
+-    include_directories(contrib/3M)
+-    set_config_option(HAVE_3M "3M")
+-  endif()
+-
+-  if(ENABLE_OSMESA)
+-    find_library(OSMESA_LIB OSMesa)
+-    if(OSMESA_LIB)
+-      set_config_option(HAVE_OSMESA "OSMesa")
+-      list(APPEND EXTERNAL_LIBRARIES ${OSMESA_LIB})
+-    endif()
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Graphics)
+-    set(OpenGL_GL_PREFERENCE "LEGACY")
+-    find_package(OpenGL REQUIRED)
+-    if(OPENGL_GLU_FOUND AND OPENGL_FOUND)
+-      add_subdirectory(Graphics)
+-      set_config_option(HAVE_OPENGL "OpenGL")
+-    else()
+-      message(SEND_ERROR "Could not find GLU: disabling OpenGL support")
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_ANN)
+-  find_library(ANN_LIB ANN PATH_SUFFIXES lib)
+-  find_path(ANN_INC "ANN.h" PATH_SUFFIXES src include ANN)
+-  if(ENABLE_SYSTEM_CONTRIB AND ANN_LIB AND ANN_INC)
+-    message(STATUS "Using system version of ANN")
+-    list(APPEND EXTERNAL_LIBRARIES ${ANN_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${ANN_INC})
+-    set_config_option(HAVE_ANN "Ann[system]")
+-  elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/ANN)
+-    add_subdirectory(contrib/ANN)
+-    include_directories(contrib/ANN/include)
+-    set_config_option(HAVE_ANN "Ann")
+-  endif()
+-endif()
+-
+-if(ENABLE_ALGLIB)
+-  find_library(ALGLIB_LIB alglib PATH_SUFFIXES lib)
+-  find_path(ALGLIB_INC "stdafx.h" PATH_SUFFIXES include)
+-  if(ENABLE_SYSTEM_CONTRIB AND ALGLIB_LIB AND ALGLIB_INC)
+-    list(APPEND EXTERNAL_LIBRARIES ${ALGLIB_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${ALGLIB_INC})
+-    set_config_option(HAVE_ALGLIB "ALGLIB[system]")
+-  elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/ALGLIB)
+-    add_subdirectory(contrib/ALGLIB)
+-    include_directories(contrib/ALGLIB)
+-    set_config_option(HAVE_ALGLIB "ALGLIB")
+-  endif()
+-endif()
+-
+-if(HAVE_FLTK AND ENABLE_CAIRO)
+-  find_library(CAIRO_LIB cairo)
+-  find_path(CAIRO_INC "cairo/cairo.h" PATH_SUFFIXES include)
+-  if(CAIRO_INC AND CAIRO_LIB)
+-     set_config_option(HAVE_CAIRO "Cairo")
+-     list(APPEND EXTERNAL_LIBRARIES ${CAIRO_LIB})
+-     list(APPEND EXTERNAL_INCLUDES ${CAIRO_INC})
+-  endif()
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/DiscreteIntegration AND
+-   ENABLE_DINTEGRATION)
+-  add_subdirectory(contrib/DiscreteIntegration)
+-  include_directories(contrib/DiscreteIntegration)
+-  set_config_option(HAVE_DINTEGRATION "DIntegration")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/HighOrderMeshOptimizer AND
+-   EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MeshOptimizer AND
+-   EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MeshQualityOptimizer AND
+-   ENABLE_OPTHOM AND HAVE_MESH)
+-  add_subdirectory(contrib/HighOrderMeshOptimizer)
+-  include_directories(contrib/HighOrderMeshOptimizer)
+-  add_subdirectory(contrib/MeshOptimizer)
+-  include_directories(contrib/MeshOptimizer)
+-  include_directories(${CMAKE_CURRENT_BINARY_DIR}/contrib/MeshOptimizer)
+-  add_subdirectory(contrib/MeshQualityOptimizer)
+-  include_directories(contrib/MeshQualityOptimizer)
+-  set_config_option(HAVE_OPTHOM "OptHom")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/domhex AND
+-   ENABLE_DOMHEX AND HAVE_MESH)
+-  add_subdirectory(contrib/domhex)
+-  include_directories(contrib/domhex)
+-  set_config_option(HAVE_DOMHEX "DomHex")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/QuadTri AND
+-   ENABLE_QUADTRI AND HAVE_MESH)
+-  add_subdirectory(contrib/QuadTri)
+-  include_directories(contrib/QuadTri)
+-  set_config_option(HAVE_QUADTRI "QuadTri")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/kbipack AND ENABLE_KBIPACK)
+-  set_config_option(HAVE_KBIPACK "Kbipack")
+-  add_subdirectory(contrib/kbipack)
+-  include_directories(contrib/kbipack)
+-  if(ENABLE_GMP)
+-    find_library(GMP_LIB libgmp.a)
+-    find_path(GMP_INC "gmp.h" PATH_SUFFIXES src include)
+-  endif()
+-  if(GMP_LIB AND GMP_INC)
+-    set_config_option(HAVE_GMP "GMP")
+-    list(APPEND EXTERNAL_LIBRARIES ${GMP_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${GMP_INC})
+-  else()
+-    message(STATUS "GMP not found: Kbipack uses long int")
+-  endif()
+-endif()
+-
+-if(ENABLE_MATHEX)
+-  find_library(MATHEX_LIB mathex PATH_SUFFIXES lib)
+-  find_path(MATHEX_INC "mathex.h" PATH_SUFFIXES src include)
+-  if(ENABLE_SYSTEM_CONTRIB AND MATHEX_LIB AND MATHEX_INC)
+-    list(APPEND EXTERNAL_LIBRARIES ${MATHEX_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${MATHEX_INC})
+-    set_config_option(HAVE_MATHEX "MathEx[system]")
+-  elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MathEx)
+-    add_subdirectory(contrib/MathEx)
+-    include_directories(contrib/MathEx)
+-    set_config_option(HAVE_MATHEX "MathEx")
+-  endif()
+-endif()
+-
+-if(ENABLE_MPI)
+-  find_package(MPI)
+-  if(MPI_FOUND)
+-    set_config_option(HAVE_MPI "MPI")
+-    list(APPEND EXTERNAL_INCLUDES ${MPI_CXX_INCLUDE_PATH})
+-    list(APPEND EXTERNAL_LIBRARIES ${MPI_CXX_LIBRARIES})
+-    set(CMAKE_C_COMPILER ${MPI_C_COMPILER})
+-    set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
+-    set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER})
+-  endif()
+-endif()
+-
+-if(ENABLE_POPPLER)
+-  find_library(POPPLER_LIB poppler)
+-  find_library(POPPLER_CPP_LIB poppler-cpp)
+-  find_path(POPPLER_INC "poppler/cpp/poppler-document.h" PATH_SUFFIXES src include)
+-  if(POPPLER_LIB AND POPPLER_INC)
+-    set_config_option(HAVE_POPPLER "Poppler")
+-    list(APPEND EXTERNAL_LIBRARIES ${POPPLER_LIB})
+-    list(APPEND EXTERNAL_LIBRARIES ${POPPLER_CPP_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${POPPLER_INC})
+-  endif()
+-endif()
+-
+-if(ENABLE_P4EST)
+-  find_library(P4EST_LIB p4est)
+-  find_path(P4EST_INC "p4est.h" PATH_SUFFIXES src)
+-  find_library(SC_LIB sc)
+-  if(P4EST_LIB AND P4EST_INC AND SC_LIB)
+-    set_config_option(HAVE_P4EST "P4est")
+-    list(APPEND EXTERNAL_LIBRARIES ${P4EST_LIB} ${SC_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${P4EST_INC})
+-  endif()
+-endif()
+-
+-if(HAVE_MESH OR HAVE_SOLVER)
+-  if(ENABLE_METIS)
+-    if(METIS_ROOT)
+-      find_library(METIS_LIB metis PATHS ${METIS_ROOT} PATH_SUFFIXES lib)
+-      find_path(METIS_INC "metis.h" PATHS ${METIS_ROOT} PATH_SUFFIXES include)
+-      list(APPEND EXTERNAL_LIBRARIES ${METIS_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${METIS_INC})
+-      set_config_option(HAVE_METIS "Metis")
+-    else()
+-      find_library(METIS_LIB metis PATH_SUFFIXES lib)
+-      find_path(METIS_INC "metis.h" PATH_SUFFIXES include)
+-      if(ENABLE_SYSTEM_CONTRIB AND METIS_LIB AND METIS_INC)
+-        message(STATUS "Using system version of METIS")
+-        list(APPEND EXTERNAL_LIBRARIES ${METIS_LIB})
+-        list(APPEND EXTERNAL_INCLUDES ${METIS_INC})
+-        set_config_option(HAVE_METIS "Metis[system]")
+-      elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/metis)
+-        add_definitions(-DUSE_GKREGEX)
+-        add_subdirectory(contrib/metis)
+-        include_directories(contrib/metis/include contrib/metis/libmetis
+-                          contrib/metis/GKlib)
+-        set_config_option(HAVE_METIS "Metis")
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-if(HAVE_MESH)
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Mesh/tetgenBR.cxx)
+-    set_config_option(HAVE_TETGENBR "TetGen/BR")
+-  endif()
+-
+-  if(ENABLE_VOROPP)
+-    find_library(VOROPP_LIB voro++ PATH_SUFFIXES lib)
+-    find_path(VOROPP_INC "voro++.hh" PATH_SUFFIXES include)
+-    if(ENABLE_SYSTEM_CONTRIB AND VOROPP_LIB AND VOROPP_INC)
+-      message(STATUS "Using system version of voro++")
+-      list(APPEND EXTERNAL_LIBRARIES ${VOROPP_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${VOROPP_INC})
+-      set_config_option(HAVE_VOROPP "Voro++[system]")
+-    elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/voro++)
+-      add_subdirectory(contrib/voro++)
+-      include_directories(contrib/voro++/src)
+-      set_config_option(HAVE_VOROPP "Voro++")
+-    endif()
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/blossom AND ENABLE_BLOSSOM)
+-    add_subdirectory(contrib/blossom)
+-    include_directories(contrib/blossom/MATCH contrib/blossom/concorde97
+-                        contrib/blossom/concorde97/INCLUDE)
+-    set_config_option(HAVE_BLOSSOM "Blossom")
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/Netgen AND ENABLE_NETGEN)
+-    add_subdirectory(contrib/Netgen)
+-    include_directories(contrib/Netgen contrib/Netgen/libsrc/include
+-                        contrib/Netgen/nglib)
+-    set_config_option(HAVE_NETGEN "Netgen")
+-    add_definitions(-DNO_PARALLEL_THREADS -DNOTCL)
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/bamg AND ENABLE_BAMG)
+-    add_subdirectory(contrib/bamg)
+-    include_directories(contrib/bamg contrib/bamg/bamglib)
+-    set_config_option(HAVE_BAMG "Bamg")
+-  endif()
+-
+-  if(ENABLE_MMG3D)
+-    find_library(MMG3D_LIB mmg3d PATH_SUFFIXES lib)
+-    find_path(MMG3D_INC "libmmg3d.h" PATH_SUFFIXES src include)
+-    if(ENABLE_SYSTEM_CONTRIB AND MMG3D_LIB AND MMG3D_INC)
+-      list(APPEND EXTERNAL_LIBRARIES ${MMG3D_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${MMG3D_INC})
+-      set_config_option(HAVE_MMG3D "Mmg3d[system]")
+-    elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/mmg3d)
+-      add_subdirectory(contrib/mmg3d)
+-      include_directories(contrib/mmg3d/build/sources)
+-      set_config_option(HAVE_MMG3D "Mmg3d")
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_MED OR ENABLE_CGNS)
+-  find_package(HDF5)
+-  if(HDF5_FOUND)
+-    set(HDF5_LIB "${HDF5_C_LIBRARIES}")
+-    list(APPEND EXTERNAL_INCLUDES ${HDF5_INCLUDE_DIRS})
+-    if(ENABLE_MED)
+-      find_library(MED_LIB medC)
+-      if(MED_LIB)
+-        set_config_option(HAVE_MED "Med")
+-        list(APPEND EXTERNAL_LIBRARIES ${MED_LIB})
+-      endif()
+-    endif()
+-    if(ENABLE_CGNS)
+-      find_library(CGNS_LIB cgns HINTS ENV CGNS_ROOT PATH_SUFFIXES lib)
+-      find_path(CGNS_INC "cgnslib.h" HINTS ENV CGNS_ROOT PATH_SUFFIXES include)
+-      if(CGNS_LIB AND CGNS_INC)
+-        set_config_option(HAVE_LIBCGNS "Cgns")
+-        list(APPEND EXTERNAL_LIBRARIES ${CGNS_LIB})
+-        list(APPEND EXTERNAL_INCLUDES ${CGNS_INC})
+-        if(ENABLE_CGNS_CPEX0045)
+-          set_config_option(HAVE_LIBCGNS_CPEX0045 "Cgns_CPEX0045")
+-        endif()
+-      endif()
+-    endif()
+-    if(MED_LIB OR CGNS_LIB)
+-      list(APPEND EXTERNAL_LIBRARIES ${HDF5_LIB})
+-      find_library(SZ_LIB NAMES szlib sz)
+-      if(SZ_LIB)
+-        list(APPEND EXTERNAL_LIBRARIES ${SZ_LIB})
+-      endif()
+-      if(NOT HAVE_LIBZ) # necessary for non-GUI builds
+-        find_package(ZLIB)
+-        if(ZLIB_FOUND)
+-          set_config_option(HAVE_LIBZ "Zlib")
+-          list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
+-        endif()
+-      endif()
+-    endif()
+-  else()
+-    message(STATUS "HDF5 not found")
+-  endif()
+-endif()
+-
+-if(HAVE_SOLVER)
+-  if(ENABLE_GMM)
+-    find_path(GMM_INC "gmm.h" PATH_SUFFIXES src include include/gmm)
+-    if(ENABLE_SYSTEM_CONTRIB AND GMM_INC)
+-      message(STATUS "Using system version of GMM")
+-      list(APPEND EXTERNAL_INCLUDES ${GMM_INC})
+-      set_config_option(HAVE_GMM "Gmm[system]")
+-    elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/gmm)
+-      include_directories(contrib/gmm)
+-      set_config_option(HAVE_GMM "Gmm")
+-    endif()
+-  endif()
+-
+-  if(ENABLE_PETSC)
+-    if(PETSC_DIR)
+-      set(ENV_PETSC_DIR ${PETSC_DIR})
+-    else()
+-      set(ENV_PETSC_DIR $ENV{PETSC_DIR})
+-    endif()
+-    if(PETSC_ARCH)
+-      set(ENV_PETSC_ARCH ${PETSC_ARCH})
+-    else()
+-      set(ENV_PETSC_ARCH $ENV{PETSC_ARCH})
+-    endif()
+-    set(PETSC_POSSIBLE_CONF_FILES
+-        ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables
+-        ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc-conf/petscvariables
+-        ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc/conf/petscvariables)
+-    foreach(FILE ${PETSC_POSSIBLE_CONF_FILES})
+-      if(EXISTS ${FILE})
+-        # old-style PETSc installations (using PETSC_DIR and PETSC_ARCH)
+-        message(STATUS "Using PETSc dir: ${ENV_PETSC_DIR}")
+-        message(STATUS "Using PETSc arch: ${ENV_PETSC_ARCH}")
+-        # find includes by parsing the petscvariables file
+-        file(STRINGS ${FILE} PETSC_VARIABLES NEWLINE_CONSUME)
+-      endif()
+-    endforeach()
+-    if(PETSC_VARIABLES)
+-      # try to find PETSC_CC_INCLUDES for PETSc >= 3.4
+-      string(REGEX MATCH "PETSC_CC_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
+-             ${PETSC_VARIABLES})
+-      if(PETSC_PACKAGES_INCLUDES)
+-        string(REPLACE "PETSC_CC_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
+-               ${PETSC_PACKAGES_INCLUDES})
+-      else()
+-        # try to find PETSC_PACKAGES_INCLUDES in older versions
+-        list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/include)
+-        list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/include)
+-        string(REGEX MATCH "PACKAGES_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
+-               ${PETSC_VARIABLES})
+-        string(REPLACE "PACKAGES_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
+-               ${PETSC_PACKAGES_INCLUDES})
+-      endif()
+-      if(PETSC_PACKAGES_INCLUDES)
+-        if(PETSC_PACKAGES_INCLUDES)
+-          string(REPLACE "-I" "" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
+-          string(REPLACE " " ";" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
+-          foreach(VAR ${PETSC_PACKAGES_INCLUDES})
+-            # seem to include unexisting directories (/usr/include/lib64)
+-	    # check to avoid warnings
+-	    if(EXISTS ${VAR})
+-	      list(APPEND EXTERNAL_INCLUDES ${VAR})
+-            endif()
+-          endforeach()
+-        endif()
+-      endif()
+-      # find libraries (<= 3.0)
+-      set(PETSC_LIBS_REQUIRED petscksp petscdm petscmat petscvec petsc)
+-      find_all_libraries(PETSC_LIBS PETSC_LIBS_REQUIRED
+-                         ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib "")
+-      # petsc 3.1 creates only one library (libpetsc)
+-      if(NOT PETSC_LIBS)
+-        find_library(PETSC_LIBS petsc PATHS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib
+-                     NO_DEFAULT_PATH)
+-      endif()
+-      if(PETSC_LIBS)
+-        set_config_option(HAVE_PETSC "PETSc")
+-	if(NOT HAVE_BLAS)
+-          set_config_option(HAVE_BLAS "Blas[petsc]")
+-        endif()
+-	if(NOT HAVE_LAPACK)
+-          set_config_option(HAVE_LAPACK "Lapack[petsc]")
+-        endif()
+-      endif()
+-      # find slepc (needs to be linked in before petsc)
+-      if(ENABLE_SLEPC)
+-        if(SLEPC_DIR)
+-          set(ENV_SLEPC_DIR ${SLEPC_DIR})
+-         else()
+-          set(ENV_SLEPC_DIR $ENV{SLEPC_DIR})
+-        endif()
+-        find_library(SLEPC_LIB slepc PATHS ${ENV_SLEPC_DIR}/${ENV_PETSC_ARCH}/lib
+-                     NO_DEFAULT_PATH)
+-        if(SLEPC_LIB)
+-          find_path(SLEPC_INC "slepc.h" PATHS ${ENV_SLEPC_DIR} PATH_SUFFIXES include
+-                    ${ENV_PETSC_ARCH}/include include/slepc NO_DEFAULT_PATH)
+-          if(SLEPC_INC)
+-            message(STATUS "Using SLEPc dir: ${ENV_SLEPC_DIR}")
+-            set_config_option(HAVE_SLEPC "SLEPc")
+-            list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
+-            list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC})
+-            find_path(SLEPC_INC2 "slepcconf.h" PATHS ${ENV_SLEPC_DIR}
+-                      PATH_SUFFIXES ${ENV_PETSC_ARCH}/include NO_DEFAULT_PATH)
+-            if(SLEPC_INC2)
+-              list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC2})
+-            endif()
+-          endif()
+-        endif()
+-      endif()
+-      list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
+-      # find additional libraries to link with
+-      string(REGEX MATCH "PACKAGES_LIBS = [^\n\r]*" PLIBS ${PETSC_VARIABLES})
+-      if(PLIBS)
+-        string(REPLACE "PACKAGES_LIBS = " "" PLIBS ${PLIBS})
+-        string(STRIP ${PLIBS} PLIBS)
+-        list(APPEND EXTERNAL_LIBRARIES "${PLIBS}")
+-      endif()
+-      string(REGEX MATCH "PETSC_EXTERNAL_LIB_BASIC = [^\n\r]*" PLIBS_BASIC ${PETSC_VARIABLES})
+-      if(PLIBS_BASIC)
+-        string(REPLACE "PETSC_EXTERNAL_LIB_BASIC = " "" PLIBS_BASIC ${PLIBS_BASIC})
+-        string(STRIP ${PLIBS_BASIC} PLIBS_BASIC)
+-        separate_arguments(PLIBS_BASIC)
+-        list(APPEND EXTERNAL_LIBRARIES "${PLIBS_BASIC}")
+-      endif()
+-      string(REGEX MATCH "PCC_LINKER_LIBS = [^\n\r]*" LLIBS ${PETSC_VARIABLES})
+-      if(LLIBS)
+-        string(REPLACE "PCC_LINKER_LIBS = " "" LLIBS ${LLIBS})
+-        string(STRIP ${LLIBS} LLIBS)
+-        list(APPEND EXTERNAL_LIBRARIES "${LLIBS}")
+-      endif()
+-    else()
+-      # new-style PETSc installations (in standard system directories)
+-      find_library(PETSC_LIBS petsc)
+-      find_path(PETSC_INC "petsc.h" PATH_SUFFIXES include/petsc)
+-      if(PETSC_LIBS AND PETSC_INC)
+-        set_config_option(HAVE_PETSC "PETSc")
+-        if(ENABLE_SLEPC)
+-          find_library(SLEPC_LIB slepc)
+-          find_path(SLEPC_INC "slepc.h" PATH_SUFFIXES include/slepc)
+-          if(SLEPC_LIB AND SLEPC_INC)
+-            set_config_option(HAVE_SLEPC "SLEPc")
+-            list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
+-            list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC})
+-          endif()
+-        endif()
+-        list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
+-        list(APPEND EXTERNAL_INCLUDES ${PETSC_INC})
+-      endif()
+-    endif()
+-  endif()
+-
+-  if(ENABLE_MUMPS AND HAVE_BLAS AND HAVE_LAPACK)
+-    set(MUMPS_LIBS_REQUIRED smumps dmumps cmumps zmumps mumps_common pord)
+-    if(NOT ENABLE_MPI)
+-      list(APPEND MUMPS_LIBS_REQUIRED mpiseq)
+-    endif()
+-    find_all_libraries(MUMPS_LIBRARIES MUMPS_LIBS_REQUIRED "" "lib")
+-    find_path(SMUMPS_INC "smumps_c.h" PATH_SUFFIXES src include)
+-    find_path(DMUMPS_INC "dmumps_c.h" PATH_SUFFIXES src include)
+-    find_path(CMUMPS_INC "cmumps_c.h" PATH_SUFFIXES src include)
+-    find_path(ZMUMPS_INC "zmumps_c.h" PATH_SUFFIXES src include)
+-    if(MUMPS_LIBRARIES AND SMUMPS_INC AND DMUMPS_INC AND CMUMPS_INC AND ZMUMPS_INC)
+-      set_config_option(HAVE_MUMPS "MUMPS")
+-      list(APPEND EXTERNAL_LIBRARIES ${MUMPS_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${SMUMPS_INC})
+-      list(APPEND EXTERNAL_INCLUDES ${DMUMPS_INC})
+-      list(APPEND EXTERNAL_INCLUDES ${CMUMPS_INC})
+-      list(APPEND EXTERNAL_INCLUDES ${ZMUMPS_INC})
+-      find_library(GFORTRAN_LIB gfortran)
+-      if(GFORTRAN_LIB)
+-        list(APPEND EXTERNAL_LIBRARIES ${GFORTRAN_LIB})
+-      endif()
+-      if(ENABLE_GMM) # use GMM/MUMPS interface
+-        add_definitions(-DGMM_USES_MUMPS)
+-      endif()
+-    endif()
+-  endif()
+-
+-  if(ENABLE_GETDP)
+-    find_library(GETDP_LIB GetDP)
+-    find_path(GETDP_INC "GetDP.h" PATH_SUFFIXES getdp)
+-    if(GETDP_LIB AND GETDP_INC)
+-      set_config_option(HAVE_GETDP "GetDP")
+-      list(APPEND EXTERNAL_LIBRARIES ${GETDP_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${GETDP_INC})
+-    endif()
+-  endif()
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt AND
+-   ENABLE_HXT AND HAVE_METIS)
+-  set_config_option(HAVE_HXT "Hxt")
+-  add_subdirectory(contrib/hxt)
+-  include_directories(BEFORE contrib/hxt)
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/hxt_tetDelaunay.c)
+-    set_config_option(HAVE_HXT3D "Hxt3D")
+-  endif()
+-  if(MSVC)
+-    # Visual C++ does not support C99 - force compilation as C++ code
+-    file(GLOB_RECURSE HXT_SRC contrib/hxt/*.c)
+-    set_compile_flags(HXT_SRC "/TP")
+-  endif()
+-  check_include_file("immintrin.h" HAVE_IMMINTRIN_H)
+-  if(NOT HAVE_IMMINTRIN_H)
+-    add_definitions(-DHAVE_NO_IMMINTRIN_H)
+-  endif()
+-  if(HAVE_PETSC)
+-    add_definitions(-DHXT_HAVE_PETSC)
+-  endif()
+-  if(CMAKE_C_COMPILER MATCHES "pgi")
+-    add_definitions(-DHAVE_NO_OPENMP_SIMD)
+-  endif()
+-endif()
+-
+-if(ENABLE_OCC)
+-  set(OCC_MINIMAL_VERSION "6.9.1")
+-  if(WIN32)
+-    if(HAVE_64BIT_SIZE_T)
+-      set(OCC_SYS_NAME win64)
+-    else()
+-      set(OCC_SYS_NAME win32)
+-    endif()
+-  else()
+-    set(OCC_SYS_NAME ${CMAKE_SYSTEM_NAME})
+-  endif()
+-  find_path(OCC_INC "Standard_Version.hxx" HINTS ENV CASROOT PATH_SUFFIXES
+-            inc include include/oce opencascade include/opencascade
+-            occt include/occt)
+-  if(OCC_INC)
+-    file(STRINGS ${OCC_INC}/Standard_Version.hxx
+-         OCC_MAJOR REGEX "#define OCC_VERSION_MAJOR.*")
+-    file(STRINGS ${OCC_INC}/Standard_Version.hxx
+-         OCC_MINOR REGEX "#define OCC_VERSION_MINOR.*")
+-    file(STRINGS ${OCC_INC}/Standard_Version.hxx
+-         OCC_MAINT REGEX "#define OCC_VERSION_MAINTENANCE.*")
+-    if(OCC_MAJOR AND OCC_MINOR AND OCC_MAINT)
+-      string(REGEX MATCH "[0-9]+" OCC_MAJOR "${OCC_MAJOR}")
+-      string(REGEX MATCH "[0-9]+" OCC_MINOR "${OCC_MINOR}")
+-      string(REGEX MATCH "[0-9]+" OCC_MAINT "${OCC_MAINT}")
+-      set(OCC_VERSION "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
+-      message(STATUS "Found OpenCASCADE version ${OCC_VERSION} in ${OCC_INC}")
+-    endif()
+-  endif()
+-  if(OCC_VERSION AND OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
+-    message(WARNING "Gmsh requires OpenCASCADE >= ${OCC_MINIMAL_VERSION}. "
+-        "Use CMAKE_PREFIX_PATH or the CASROOT environment variable "
+-        "to explicitely specify the installation path of OpenCASCADE")
+-  elseif(OCC_INC)
+-    set(OCC_LIBS_REQUIRED
+-	# subset of DataExchange
+-      	TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
+-      	# ModelingAlgorithms
+-      	TKOffset TKFeat TKFillet TKBool TKMesh TKHLR TKBO TKPrim TKShHealing
+-      	TKTopAlgo TKGeomAlgo
+-      	# ModelingData
+-      	TKBRep TKGeomBase TKG3d TKG2d
+-      	# FoundationClasses
+-      	TKMath TKernel)
+-    if(ENABLE_OCC_TBB)
+-      list(APPEND OCC_LIBS_REQUIRED tbb tbbmalloc)
+-    endif()
+-    list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED)
+-    if(OCC_LIBS)
+-      message(STATUS "OCC libraries specified explicitly: " ${OCC_LIBS})
+-      list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS)
+-    else()
+-      set(OCC_LIBS)
+-      foreach(OCC ${OCC_LIBS_REQUIRED})
+-        if(ENABLE_OCC_STATIC)
+-          set(LIBNAME lib${OCC}.a)
+-        else()
+-          set(LIBNAME ${OCC})
+-        endif()
+-        find_library(OCC_LIB ${LIBNAME} HINTS ENV CASROOT PATH_SUFFIXES
+-                     lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib)
+-        if(OCC_LIB)
+-	  list(APPEND OCC_LIBS ${OCC_LIB})
+-        else()
+-          message(STATUS "OCC lib " ${LIBNAME} " not Found")
+-        endif()
+-        unset(OCC_LIB CACHE)
+-      endforeach()
+-      list(LENGTH OCC_LIBS NUM_OCC_LIBS)
+-    endif()
+-  endif()
+-
+-  # additional OCC libraries to handle reading of STEP/IGES attributes. Oh my...
+-  if(ENABLE_OCC_CAF)
+-    find_package(Freetype)
+-    if(FREETYPE_FOUND)
+-      set(OCC_CAF_LIBS_REQUIRED
+-          TKXDESTEP TKXDEIGES TKXCAF TKLCAF TKVCAF TKCAF TKV3d TKService TKCDF)
+-      list(LENGTH OCC_CAF_LIBS_REQUIRED NUM_OCC_CAF_LIBS_REQUIRED)
+-      set(OCC_CAF_LIBS)
+-      foreach(OCC ${OCC_CAF_LIBS_REQUIRED})
+-        find_library(OCC_CAF_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES
+-                     lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib)
+-        if(OCC_CAF_LIB)
+-          list(APPEND OCC_CAF_LIBS ${OCC_CAF_LIB})
+-        else()
+-          message(STATUS "OCC CAF lib " ${OCC} " not Found")
+-        endif()
+-        unset(OCC_CAF_LIB CACHE)
+-      endforeach()
+-      list(LENGTH OCC_CAF_LIBS NUM_OCC_CAF_LIBS)
+-    endif()
+-  endif()
+-
+-  # append OCC CAF libraries first...
+-  if(NUM_OCC_CAF_LIBS EQUAL NUM_OCC_CAF_LIBS_REQUIRED)
+-    set_config_option(HAVE_OCC_CAF "OpenCASCADE-CAF")
+-    list(APPEND EXTERNAL_LIBRARIES ${OCC_CAF_LIBS} ${FREETYPE_LIBRARIES})
+-    list(APPEND EXTERNAL_INCLUDES ${FREETYPE_INCLUDE_DIRS})
+-    if(WIN32)
+-      list(APPEND EXTERNAL_LIBRARIES "windowscodecs")
+-      list(APPEND EXTERNAL_LIBRARIES "ole32")
+-    endif()
+-  endif()
+-
+-  # then append OCC libraries
+-  if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
+-    set_config_option(HAVE_OCC "OpenCASCADE")
+-    list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
+-    list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
+-    if(HAVE_64BIT_SIZE_T)
+-      add_definitions(-D_OCC64)
+-    endif()
+-    if(WIN32)
+-      list(APPEND EXTERNAL_LIBRARIES "winspool")
+-      add_definitions(-DOCC_CONVERT_SIGNALS)
+-    elseif(MSVC)
+-      add_definitions(-DWNT)
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_ACIS)
+-  find_library(ACIS_LIB SpaACIS PATH_SUFFIXES bin/maci386)
+-  if(ACIS_LIB)
+-    find_path(ACIS_INC "kernapi.hxx" PATH_SUFFIXES include)
+-    if(ACIS_INC)
+-      set_config_option(HAVE_ACIS "Acis")
+-      list(APPEND EXTERNAL_LIBRARIES ${ACIS_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${ACIS_INC})
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_ZIPPER)
+-  if(ENABLE_BUILD_IOS)
+-    set_config_option(HAVE_LIBZ "Zlib")
+-  endif()
+-  if(NOT HAVE_LIBZ) # necessary for non-GUI builds
+-    find_package(ZLIB)
+-    if(ZLIB_FOUND)
+-      set_config_option(HAVE_LIBZ "Zlib")
+-      list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
+-    endif()
+-  endif()
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zipper AND HAVE_LIBZ)
+-    add_subdirectory(contrib/zipper)
+-    include_directories(contrib/zipper)
+-    set_config_option(HAVE_ZIPPER "Zipper")
+-  endif()
+-endif()
+-
+-if(ENABLE_PRIVATE_API AND ENABLE_WRAP_PYTHON)
+-  find_package(SWIG REQUIRED)
+-  include(${SWIG_USE_FILE})
+-  find_package(PythonLibs)
+-  if(SWIG_FOUND AND PYTHONLIBS_FOUND)
+-    message(STATUS "Found SWIG version " ${SWIG_VERSION})
+-    find_package(PythonInterp)
+-    string(SUBSTRING ${SWIG_VERSION} 0 1 SWIG_MAJOR_VERSION)
+-    if(SWIG_MAJOR_VERSION EQUAL 1)
+-      message(WARNING "Python bindings require SWIG >= 2: disabling Python")
+-    else()
+-      set_config_option(HAVE_PYTHON "Python")
+-      mark_as_advanced(CLEAR PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
+-      if(ENABLE_NUMPY)
+-        if (NOT NUMPY_INC)
+-          EXEC_PROGRAM (${PYTHON_EXECUTABLE}
+-            ARGS "-c \"import numpy; print(numpy.get_include())\""
+-            OUTPUT_VARIABLE NUMPY_INC
+-            RETURN_VALUE NUMPY_NOT_FOUND)
+-        endif()
+-        if(NUMPY_INC)
+-          list(APPEND EXTERNAL_INCLUDES ${NUMPY_INC})
+-          set_config_option(HAVE_NUMPY "Numpy")
+-        endif()
+-      endif()
+-      if(HAVE_PETSC)
+-        if(ENABLE_PETSC4PY)
+-          EXECUTE_PROCESS(
+-            COMMAND ${PYTHON_EXECUTABLE} -c "import petsc4py; print(petsc4py.get_include())"
+-            OUTPUT_VARIABLE PETSC4PY_INC
+-            RESULT_VARIABLE PETSC4PY_NOT_FOUND
+-            ERROR_QUIET
+-            OUTPUT_STRIP_TRAILING_WHITESPACE)
+-          if(PETSC4PY_INC)
+-            list(APPEND EXTERNAL_INCLUDES ${PETSC4PY_INC})
+-            set_config_option(HAVE_PETSC4PY "PETSc4py")
+-          endif()
+-        endif()
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-check_function_exists(vsnprintf HAVE_VSNPRINTF)
+-if(NOT HAVE_VSNPRINTF AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
+-  set_config_option(HAVE_NO_VSNPRINTF "NoVsnprintf")
+-endif()
+-
+-check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
+-if(HAVE_SYS_SOCKET_H)
+-  set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
+-endif()
+-check_type_size(socklen_t SOCKLEN_T_SIZE)
+-set(CMAKE_EXTRA_INCLUDE_FILES)
+-if(NOT SOCKLEN_T_SIZE AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
+-  set_config_option(HAVE_NO_SOCKLEN_T "NoSocklenT")
+-endif()
+-
+-check_include_file(stdint.h HAVE_STDINT_H)
+-if(HAVE_STDINT_H)
+-  set(CMAKE_EXTRA_INCLUDE_FILES stdint.h)
+-else()
+-  set_config_option(HAVE_NO_STDINT_H "NoStdintH")
+-endif()
+-check_type_size(intptr_t INTPTR_T_SIZE)
+-set(CMAKE_EXTRA_INCLUDE_FILES)
+-if(NOT INTPTR_T_SIZE AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
+-  set_config_option(HAVE_NO_INTPTR_T "NoIntptrT")
+-endif()
+-
+-check_include_file(dlfcn.h DLFCN_H)
+-if(DLFCN_H)
+-  set_config_option(HAVE_DLOPEN "Dlopen")
+-  list(APPEND EXTERNAL_LIBRARIES ${CMAKE_DL_LIBS})
+-endif()
+-
+-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-  check_include_file(linux/joystick.h LINUX_JOYSTICK_H)
+-  if(LINUX_JOYSTICK_H)
+-    set_config_option(HAVE_LINUX_JOYSTICK "LinuxJoystick")
+-  endif()
+-endif()
+-
+-if(WIN32)
+-  add_definitions(-D_USE_MATH_DEFINES)
+-  list(APPEND EXTERNAL_LIBRARIES winmm wsock32 ws2_32 psapi)
+-endif()
+-
+-if(MSVC)
+-  add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE)
+-endif()
+-
+-# add C functions API
+-set(GMSH_SRC ${GMSH_SRC};api/gmshc.cpp)
+-
+-# force full warnings to encourage everybody to write clean(er) code
+-check_cxx_compiler_flag("-Wall" WALL)
+-if(WALL AND NOT MSVC)
+-  file(GLOB_RECURSE WALL_SRC Common/*.cpp Fltk/*.cpp FunctionSpace/*.cpp
+-       Geo/*.cpp Graphics/*.cpp Mesh/*.cpp Numeric/*.cpp Parser/*.cpp
+-       Plugin/*.cpp Post/*.cpp Solver/*.cpp)
+-  set(WF "-Wall")
+-  check_cxx_compiler_flag("-Wint-to-void-pointer-cast" WCAST)
+-  if(WCAST)
+-    set(WF "${WF} -Wno-int-to-void-pointer-cast")
+-  endif()
+-  check_cxx_compiler_flag("-Wdeprecated-declarations" WDEPREC)
+-  if(WDEPREC)
+-    # FIXME: remove this when we have fixed the deprecated GLU code for OpenGL3
+-    set(WF "${WF} -Wno-deprecated-declarations")
+-  endif()
+-  check_cxx_compiler_flag("-Wmisleading-indentation" WIND)
+-  if(WIND)
+-    set(WF "${WF} -Wno-misleading-indentation")
+-  endif()
+-  set_compile_flags(WALL_SRC ${WF})
+-endif()
+-
+-# don't issue warnings for contributed libraries
+-check_cxx_compiler_flag("-w" NOWARN)
+-if(NOWARN)
+-  file(GLOB_RECURSE NOWARN_SRC contrib/*.cpp contrib/*.cc contrib/*.cxx contrib/*.c)
+-  set_compile_flags(NOWARN_SRC "-w")
+-endif()
+-
+-# disable compile optimization on some known problematic files
+-check_cxx_compiler_flag("-O0" NOOPT)
+-if(NOOPT OR ENABLE_BUILD_IOS)
+-  if(ENABLE_BUILD_IOS) # optimized iOS 10 64 bits screws somewhere in Geo
+-    file(GLOB_RECURSE NOOPT_SRC Numeric/robustPredicates.cpp Geo/G*.cpp Mesh/BDS.cpp
+-         Parser/Gmsh.tab.cpp contrib/blossom/* Mesh/Background*)
+-  else()
+-    file(GLOB_RECURSE NOOPT_SRC Numeric/robustPredicates.cpp Mesh/BDS.cpp
+-         Parser/Gmsh.tab.cpp contrib/blossom/* contrib/bamg/* Mesh/Background*)
+-  endif()
+-  set_compile_flags(NOOPT_SRC "-O0")
+-endif()
+-
+-# do not use arithmetic contraction in predicates.cpp
+-# if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+-#   set_source_files_properties(Numeric/robustPredicates.cpp PROPERTIES
+-#     COMPILE_FLAGS "/fp:strict")
+-# elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
+-#   set_source_files_properties(Numeric/robustPredicates.cpp PROPERTIES
+-#     COMPILE_FLAGS "-fno-unsafe-math-optimizations -ffp-contract=off")
+-# elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
+-#   set_source_files_properties(Numeric/robustPredicates.cpp PROPERTIES
+-#     COMPILE_FLAGS "-fp-model strict")
+-# endif()
+-
+-# enable Revoropt and set compile flags for the corresponding plugin
+-if(ENABLE_REVOROPT)
+-  find_path(EIGEN3_INC "eigen3/Eigen/Dense")
+-  if(EIGEN3_INC AND HAVE_MESH AND HAVE_PLUGINS AND HAVE_ANN AND HAVE_ALGLIB)
+-    list(APPEND EXTERNAL_INCLUDES ${EIGEN3_INC} contrib/Revoropt/include)
+-    message(STATUS "using contrib/Revoropt")
+-    set_config_option(HAVE_REVOROPT "Revoropt")
+-    add_definitions(-DUSE_ANN)
+-    get_source_file_property(PROP Plugin/CVTRemesh.cpp COMPILE_FLAGS)
+-    if(PROP)
+-      set_source_files_properties(Plugin/CVTRemesh.cpp PROPERTIES
+-                                  COMPILE_FLAGS "${PROP} -std=c++11")
+-    else()
+-      set_source_files_properties(Plugin/CVTRemesh.cpp PROPERTIES
+-                                  COMPILE_FLAGS "-std=c++11")
+-    endif()
+-  else()
+-    message(WARNING "Revoropt requires Eigen3, Mesh, Plugins, ANN and ALGLIB")
+-  endif()
+-endif()
+-
+-list(SORT CONFIG_OPTIONS)
+-set(GMSH_CONFIG_OPTIONS "")
+-foreach(OPT ${CONFIG_OPTIONS})
+-  set(GMSH_CONFIG_OPTIONS "${GMSH_CONFIG_OPTIONS} ${OPT}")
+-endforeach()
+-
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Common/GmshConfig.h.in
+-               ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Common/GmshVersion.h.in
+-               ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h)
+-
+-# the texi version file is modified in the source directory (not ideal, but
+-# since git tracks the contents of the file this is acceptable as it will only
+-# change when the actual version is changed - not for each git hash)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo/version.texi.in
+-               ${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo/version.texi)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.txt
+-     ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION})
+-
+-# process cmake environment variables so we can append them to the -I include
+-# commands. This is not recommended (we should only use the cache variables) but
+-# it is very convenient: otherwise we have to remember providing the
+-# -D... options to cmake for each new build.
+-set(ENV_CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
+-set(ENV_CMAKE_INCLUDE_PATH $ENV{CMAKE_INCLUDE_PATH})
+-if(UNIX)
+-  if(ENV_CMAKE_PREFIX_PATH)
+-    string(REPLACE ":" ";" ENV_CMAKE_PREFIX_PATH ${ENV_CMAKE_PREFIX_PATH})
+-  endif()
+-  if(ENV_CMAKE_INCLUDE_PATH)
+-    string(REPLACE ":" ";" ENV_CMAKE_INCLUDE_PATH ${ENV_CMAKE_INCLUDE_PATH})
+-  endif()
+-endif()
+-list(APPEND EXTERNAL_INCLUDES ${CMAKE_INCLUDE_PATH} ${ENV_CMAKE_INCLUDE_PATH})
+-list(APPEND EXTERNAL_INCLUDES ${CMAKE_PREFIX_PATH} ${ENV_CMAKE_PREFIX_PATH})
+-foreach(DIR ${CMAKE_PREFIX_PATH} ${ENV_CMAKE_PREFIX_PATH})
+-  list(APPEND EXTERNAL_INCLUDES ${DIR}/include)
+-endforeach()
+-
+-if(EXTERNAL_INCLUDES)
+-  list(REMOVE_DUPLICATES EXTERNAL_INCLUDES)
+-endif()
+-
+-if(HAVE_FLTK)
+-  set(LINK_LIBRARIES ${FLTK_LIBRARIES} ${EXTERNAL_LIBRARIES}
+-                     ${OPENGL_LIBRARIES} ${LAPACK_LIBRARIES})
+-elseif(HAVE_OPENGL)
+-  set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${OPENGL_LIBRARIES}
+-                     ${LAPACK_LIBRARIES})
+-else()
+-  set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
+-endif()
+-
+-# try to use static gfortran on static builds (cannot do this on dynamic builds
+-# as e.g. Debian compiles libgfortran.a without -fPIC: sigh...)
+-if(NOT ENABLE_BUILD_DYNAMIC AND NOT ENABLE_BUILD_SHARED)
+-  find_library(GFORTRAN_STATIC libgfortran.a)
+-  if(GFORTRAN_STATIC)
+-    set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES)
+-    message(STATUS "Using static libgfortran")
+-    foreach(STR ${LINK_LIBRARIES})
+-      string(REPLACE "-lgfortran" ${GFORTRAN_STATIC} STR2 ${STR})
+-      list(APPEND LINK_LIBRARIES2 ${STR2})
+-    endforeach()
+-    set(LINK_LIBRARIES ${LINK_LIBRARIES2})
+-  endif()
+-endif()
+-
+-# Linux-specific linking
+-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-  if(HAVE_OCC)
+-    find_library(RT_LIB rt)
+-    if(RT_LIB)
+-      list(APPEND LINK_LIBRARIES ${RT_LIB})
+-    endif()
+-  endif()
+-  if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
+-    add_definitions(-fPIC)
+-  endif()
+-endif()
+-
+-# we could specify include dirs more selectively, but this is simpler
+-include_directories(Common Fltk Geo Graphics Mesh Solver Numeric Parser
+-  Plugin Post api ${EXTERNAL_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/Common)
+-
+-# set this for external codes that might include this CMakeList file
+-set(GMSH_EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDES} CACHE
+-    STRING "External include directories" FORCE)
+-set(GMSH_EXTERNAL_LIBRARIES ${LINK_LIBRARIES} CACHE
+-    STRING "External libraries" FORCE)
+-
+-# group sources for easier navigation in IDEs
+-foreach(DIR ${GMSH_DIRS})
+-  string(REGEX REPLACE "\\+" "\\\\+" DIR ${DIR})
+-  source_group(${DIR} REGULAR_EXPRESSION ${DIR}/.*)
+-endforeach()
+-
+-# static library target
+-if(ENABLE_BUILD_LIB)
+-  add_library(lib STATIC ${GMSH_SRC})
+-  set_target_properties(lib PROPERTIES OUTPUT_NAME gmsh)
+-  if(MSVC)
+-    set_target_properties(lib PROPERTIES DEBUG_POSTFIX d)
+-    if(ENABLE_MSVC_STATIC_RUNTIME)
+-      set_target_properties(lib PROPERTIES LINK_FLAGS_RELEASE "/nodefaultlib:LIBCMT")
+-    endif()
+-  endif()
+-endif()
+-
+-# shared library target
+-if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
+-  add_library(shared SHARED ${GMSH_SRC})
+-  set_target_properties(shared PROPERTIES OUTPUT_NAME gmsh
+-     VERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}
+-     SOVERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION})
+-  if(WIN32)
+-    set_target_properties(shared PROPERTIES PREFIX "" IMPORT_PREFIX ""
+-      IMPORT_SUFFIX ".lib" COMPILE_FLAGS "-DGMSH_DLL -DGMSH_DLL_EXPORT")
+-  endif()
+-  target_link_libraries(shared ${LINK_LIBRARIES})
+-  if(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
+-    message(STATUS "Note: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library "
+-            "won't link. In MSVC change /MT to /MD in the shared project properties")
+-  endif()
+-endif()
+-
+-# binary targets
+-if(HAVE_FLTK)
+-  if(ENABLE_BUILD_DYNAMIC)
+-    add_executable(gmsh WIN32 Common/Main.cpp)
+-    target_link_libraries(gmsh shared)
+-  else()
+-    add_executable(gmsh WIN32 Common/Main.cpp ${GMSH_SRC})
+-  endif()
+-  # we could add this to create a minimal app bundle even without install
+-  # if(APPLE AND NOT ENABLE_OS_SPECIFIC_INSTALL)
+-  #  set_target_properties(gmsh PROPERTIES MACOSX_BUNDLE ON
+-  #    MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_dev.plist)
+-  # endif()
+-else()
+-  if(ENABLE_BUILD_DYNAMIC)
+-    add_executable(gmsh Common/Main.cpp)
+-    target_link_libraries(gmsh shared)
+-  else()
+-    add_executable(gmsh Common/Main.cpp ${GMSH_SRC})
+-  endif()
+-endif()
+-target_link_libraries(gmsh ${LINK_LIBRARIES})
+-
+-# Windows specific linker options
+-if(WIN32 AND NOT MSVC)
+-  set(FLAGS "-Wl,--stack,16777216 -mwindows")
+-  if(HAVE_64BIT_SIZE_T)
+-    set(FLAGS "${FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win64Icon.res")
+-  else()
+-    set(FLAGS "${FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win32Icon.res")
+-  endif()
+-  set_target_properties(gmsh PROPERTIES LINK_FLAGS "${FLAGS} -static")
+-  if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
+-    set_target_properties(shared PROPERTIES LINK_FLAGS -static)
+-  endif()
+-  # remove -Wl,-Bdynamic flags
+-  set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)
+-  set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
+-elseif(MSVC)
+-  set_target_properties(gmsh PROPERTIES LINK_FLAGS "/STACK:16777216 /SAFESEH:NO")
+-endif()
+-
+-# android target
+-if(ENABLE_BUILD_ANDROID)
+-  find_file(CMAKE_TOOLCHAIN_FILE "android.toolchain.cmake")
+-  if(NOT CMAKE_TOOLCHAIN_FILE)
+-    message(FATAL_ERROR "Cannot compile Gmsh for android without android-cmake")
+-  endif()
+-  add_definitions(-D_GLIBCXX_USE_C99_MATH=1)
+-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+-  set(CMAKE_BUILD_TYPE Release)
+-  set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR})
+-  set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/libs/)
+-  add_definitions(-DBUILD_ANDROID)
+-  add_definitions(-DPICOJSON_USE_LOCALE=0)
+-  add_library(androidGmsh SHARED ${GMSH_SRC})
+-  set_target_properties(androidGmsh PROPERTIES OUTPUT_NAME gmsh)
+-  target_link_libraries(androidGmsh ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
+-  add_custom_command(TARGET androidGmsh POST_BUILD COMMAND
+-                     ${CMAKE_STRIP} ${LIBRARY_OUTPUT_PATH}/libgmsh.so)
+-endif()
+-
+-# parser target
+-find_program(BISON bison)
+-find_program(FLEX flex)
+-if(BISON AND FLEX)
+-  add_custom_target(parser
+-                    COMMAND ${BISON} -p gmsh_yy --output Gmsh.tab.cpp -d Gmsh.y
+-                    COMMAND ${FLEX} -P gmsh_yy -o Gmsh.yy.cpp Gmsh.l
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Parser)
+-endif()
+-
+-if(UNIX)
+-  # cannot use cmake's file search functions here (they would only find files
+-  # existing at configuration time)
+-  add_custom_target(purge
+-                    COMMAND rm -f `find . -name *~ -o -name *~~`
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-  add_custom_target(etags
+-                    COMMAND etags `find . -name *.cpp -o -name *.h -o -name *.y`
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-endif()
+-
+-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
+-   CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
+-                  OUTPUT_VARIABLE CXX_COMPILER_VERSION
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-else()
+-  set(CXX_COMPILER_VERSION "Unknown")
+-endif()
+-
+-set(WELCOME_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/WELCOME.txt)
+-set(SDK_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/SDK.txt)
+-set(LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt)
+-set(CREDITS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CREDITS.txt)
+-set(CHANGELOG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.txt)
+-file(GLOB TUTORIAL_GEO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/?*.*)
+-file(GLOB TUTORIAL_CPP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/c++/?*.*)
+-file(GLOB TUTORIAL_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/c/?*.*)
+-file(GLOB TUTORIAL_PY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/python/?*.*)
+-file(GLOB TUTORIAL_JL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/julia/?*.*)
+-file(GLOB DEMOS ${CMAKE_CURRENT_SOURCE_DIR}/demos/*)
+-foreach(SUBDIR ${DEMOS})
+-  if(IS_DIRECTORY ${SUBDIR})
+-    list(APPEND DEMOS_DIRS ${SUBDIR})
+-  endif()
+-endforeach()
+-set(TEX_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo)
+-file(GLOB TEX_SRC ${TEX_DIR}/*.texi)
+-set(TEX_OBJ ${TEX_DIR}/gmsh.aux ${TEX_DIR}/gmsh.cp ${TEX_DIR}/gmsh.cps
+-    ${TEX_DIR}/gmsh.fn ${TEX_DIR}/gmsh.html ${TEX_DIR}/gmsh.info ${TEX_DIR}/gmsh.ky
+-    ${TEX_DIR}/gmsh.log ${TEX_DIR}/gmsh.pdf ${TEX_DIR}/gmsh.pg ${TEX_DIR}/gmsh.toc
+-    ${TEX_DIR}/gmsh.tp ${TEX_DIR}/gmsh.tps ${TEX_DIR}/gmsh.txt ${TEX_DIR}/gmsh.vr)
+-
+-macro(unix2dos VARNAME)
+-  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unix2dos)
+-  set(UNIX2DOS_FILES)
+-  foreach(FILE ${${VARNAME}})
+-    file(READ ${FILE} F0)
+-    get_filename_component(N ${FILE} NAME)
+-    if(CYGWIN)
+-      string(REGEX REPLACE "\n" "\r\n" F1 "${F0}")
+-      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N} "${F1}")
+-    else() # if not in Cygwin, cmake adds '\r's automatically
+-      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N} "${F0}")
+-    endif()
+-    list(APPEND UNIX2DOS_FILES ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N})
+-  endforeach()
+-  set(${VARNAME} ${UNIX2DOS_FILES})
+-endmacro()
+-
+-if(WIN32)
+-  if(ENABLE_OS_SPECIFIC_INSTALL)
+-    set(GMSH_BIN .)
+-    set(GMSH_LIB .)
+-    set(GMSH_DOC .)
+-    set(GMSH_MAN .)
+-    set(GMSH_INC .)
+-  else()
+-    include(GNUInstallDirs)
+-    set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
+-    set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
+-    set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
+-    set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
+-    set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
+-  endif()
+-  if(CYGWIN)
+-    unix2dos(GMSH_API)
+-    if(ENABLE_PRIVATE_API)
+-      unix2dos(GMSH_PRIVATE_API)
+-    endif()
+-    unix2dos(WELCOME_FILE)
+-    unix2dos(SDK_FILE)
+-    unix2dos(LICENSE_FILE)
+-    unix2dos(CREDITS_FILE)
+-    unix2dos(CHANGELOG_FILE)
+-    unix2dos(TUTORIAL_GEO_FILES)
+-    unix2dos(TUTORIAL_CPP_FILES)
+-    unix2dos(TUTORIAL_C_FILES)
+-    unix2dos(TUTORIAL_PY_FILES)
+-    unix2dos(TUTORIAL_JL_FILES)
+-    foreach(DIR ${DEMOS_DIRS})
+-      file(GLOB DEMO_FILES ${DIR}/?*.*)
+-      unix2dos(DEMO_FILES)
+-    endforeach()
+-  endif()
+-elseif(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
+-  # set these so that the files get installed nicely in the MacOSX
+-  # .app bundle
+-  set(GMSH_BIN ../MacOS)
+-  set(GMSH_LIB ../MacOS)
+-  set(GMSH_DOC ../../..)
+-  set(GMSH_MAN ../../..)
+-  set(GMSH_INC ../MacOS)
+-else()
+-  include(GNUInstallDirs)
+-  set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
+-  set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
+-  set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
+-  set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
+-  set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
+-endif()
+-
+-# FIXME: change this once we understand rpaths
+-if(APPLE)
+-  if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
+-    set_target_properties(shared PROPERTIES INSTALL_NAME_DIR
+-                          ${CMAKE_INSTALL_PREFIX}/${GMSH_LIB})
+-  endif()
+-endif()
+-
+-# mark targets as optional so we can install them separately if needed
+-# (e.g. "make lib" or "make shared" followed by "make install/fast")
+-install(TARGETS gmsh DESTINATION ${GMSH_BIN} OPTIONAL)
+-if(ENABLE_BUILD_LIB)
+-  install(TARGETS lib DESTINATION ${GMSH_LIB} OPTIONAL)
+-endif()
+-if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
+-  install(TARGETS shared DESTINATION ${GMSH_LIB} OPTIONAL)
+-endif()
+-
+-if(ENABLE_ONELAB)
+-  install(FILES ${ONELAB_PY} DESTINATION ${GMSH_BIN})
+-endif()
+-if(ENABLE_BUILD_LIB OR ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
+-  install(FILES ${GMSH_API} DESTINATION ${GMSH_INC})
+-  install(FILES ${GMSH_PY} DESTINATION ${GMSH_LIB})
+-  install(FILES ${GMSH_JL} DESTINATION ${GMSH_LIB})
+-  if(ENABLE_PRIVATE_API)
+-    install(FILES ${GMSH_PRIVATE_API} DESTINATION ${GMSH_INC}/gmsh)
+-  endif()
+-endif()
+-if(INSTALL_SDK_README)
+-  configure_file(${SDK_FILE} ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
+-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/README.txt DESTINATION .)
+-endif()
+-install(FILES ${WELCOME_FILE} DESTINATION ${GMSH_DOC} RENAME README.txt)
+-install(FILES ${LICENSE_FILE} DESTINATION ${GMSH_DOC})
+-install(FILES ${CREDITS_FILE} DESTINATION ${GMSH_DOC})
+-install(FILES ${CHANGELOG_FILE} DESTINATION ${GMSH_DOC})
+-install(FILES ${TUTORIAL_GEO_FILES} DESTINATION ${GMSH_DOC}/tutorial)
+-install(FILES ${TUTORIAL_CPP_FILES} DESTINATION ${GMSH_DOC}/tutorial/c++)
+-install(FILES ${TUTORIAL_C_FILES} DESTINATION ${GMSH_DOC}/tutorial/c)
+-install(FILES ${TUTORIAL_PY_FILES} DESTINATION ${GMSH_DOC}/tutorial/python)
+-install(FILES ${TUTORIAL_JL_FILES} DESTINATION ${GMSH_DOC}/tutorial/julia)
+-foreach(DIR ${DEMOS_DIRS})
+-  get_filename_component(DEMOS_DIR_NAME ${DIR} NAME)
+-  file(GLOB DEMO_FILES ${DIR}/?*.*)
+-  install(FILES ${DEMO_FILES} DESTINATION ${GMSH_DOC}/demos/${DEMOS_DIR_NAME})
+-endforeach()
+-if(UNIX AND NOT CYGWIN)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/doc/gmsh.1 DESTINATION ${GMSH_MAN})
+-endif()
+-
+-add_custom_target(get_headers
+-  COMMAND ${CMAKE_COMMAND} -E make_directory Headers/gmsh
+-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+-foreach(FILE ${GMSH_API})
+-  add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
+-    -E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-endforeach()
+-if(ENABLE_PRIVATE_API)
+-  foreach(FILE ${GMSH_PRIVATE_API})
+-    add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
+-      -E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/gmsh/
+-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-  endforeach()
+-endif()
+-
+-find_program(MAKEINFO makeinfo)
+-if(MAKEINFO)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.info DEPENDS ${TEX_SRC}
+-                     COMMAND ${MAKEINFO} --split-size 1000000
+-                     ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(info DEPENDS ${TEX_DIR}/gmsh.info)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.txt DEPENDS ${TEX_SRC}
+-                     COMMAND ${MAKEINFO} --plaintext -o gmsh.txt
+-                     ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(txt DEPENDS ${TEX_DIR}/gmsh.txt)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.html DEPENDS ${TEX_SRC}
+-    COMMAND ${MAKEINFO} --html --css-ref=http://gmsh.info/gmsh.css
+-    --no-split --set-customization-variable
+-    EXTRA_HEAD='<meta name="viewport" content="width=device-width,initial-scale=1.0">'
+-    ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(html DEPENDS ${TEX_DIR}/gmsh.html)
+-  install(FILES ${TEX_DIR}/gmsh.html DESTINATION ${GMSH_DOC} OPTIONAL)
+-else()
+-  add_custom_target(html COMMAND ${CMAKE_COMMAND} -E touch ${TEX_DIR}/gmsh.html)
+-endif()
+-
+-find_program(TEXI2PDF texi2pdf)
+-if(TEXI2PDF)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.pdf DEPENDS ${TEX_SRC}
+-                     COMMAND ${TEXI2PDF} ARGS gmsh.texi
+-                     WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(pdf DEPENDS ${TEX_DIR}/gmsh.pdf)
+-  install(FILES ${TEX_DIR}/gmsh.pdf DESTINATION ${GMSH_DOC} OPTIONAL)
+-endif()
+-
+-execute_process(COMMAND ${CMAKE_COMMAND} -E echo
+-  "@c This file was generated by cmake: do not edit manually!\n${OPT_TEXI}"
+-  OUTPUT_FILE cmake_options.texi)
+-
+-if(MAKEINFO AND TEXI2PDF)
+-  add_custom_target(doc COMMAND ${CMAKE_COMMAND} -E tar zcf
+-                    ${CMAKE_CURRENT_BINARY_DIR}/gmsh-${GMSH_VERSION}-doc.tgz
+-                    CREDITS.txt LICENSE.txt CHANGELOG.txt
+-                    doc/gmsh.1 doc/texinfo/gmsh.html doc/texinfo/gmsh.info
+-                    doc/texinfo/gmsh.pdf doc/texinfo/gmsh.txt
+-                    COMMAND ${CMAKE_COMMAND} -E remove ${TEX_OBJ}
+-                    DEPENDS ${TEX_DIR}/gmsh.info ${TEX_DIR}/gmsh.txt
+-                    ${TEX_DIR}/gmsh.html ${TEX_DIR}/gmsh.pdf
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-endif()
+-
+-if(MAKEINFO OR TEXI2PDF)
+-  add_custom_target(clean_doc COMMAND ${CMAKE_COMMAND} -E remove ${TEX_OBJ})
+-endif()
+-
+-if(APPLE AND ENABLE_BUILD_LIB)
+-  file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_framework.plist F0)
+-  string(REPLACE GMSH_VERSION "${GMSH_VERSION}" F1 "${F0}")
+-  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Info_framework.plist "${F1}")
+-  get_target_property(LIBNAME lib LOCATION) # depracated
+-  #set(LIBNAME $<TARGET_FILE:lib>) # FIXME: use this in the future
+-  add_custom_target(framework DEPENDS lib
+-    COMMAND ${CMAKE_COMMAND} -E remove_directory gmsh.framework
+-    COMMAND ${CMAKE_COMMAND} -E make_directory gmsh.framework/Headers
+-    COMMAND ${CMAKE_COMMAND} -E make_directory gmsh.framework/Resources
+-    COMMAND ${CMAKE_COMMAND} -E copy ${LIBNAME} gmsh.framework/gmsh
+-    COMMAND ${CMAKE_COMMAND} -E copy Info_framework.plist
+-                                     gmsh.framework/Resources/Info.plist
+-    COMMAND ${CMAKE_COMMAND} -E create_symlink . gmsh.framework/Headers/gmsh
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+-  foreach(FILE ${GMSH_API})
+-    add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+-        ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/gmsh.framework/Headers/
+-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-  endforeach()
+-  if(ENABLE_PRIVATE_API)
+-    foreach(FILE ${GMSH_PRIVATE_API})
+-      add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+-          ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/gmsh.framework/Headers/
+-          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-    endforeach()
+-  endif()
+-endif()
+-
+-set(CPACK_PACKAGE_VENDOR "Christophe Geuzaine and Jean-Francois Remacle")
+-set(CPACK_PACKAGE_VERSION_MAJOR ${GMSH_MAJOR_VERSION})
+-set(CPACK_PACKAGE_VERSION_MINOR ${GMSH_MINOR_VERSION})
+-set(CPACK_PACKAGE_VERSION_PATCH ${GMSH_PATCH_VERSION})
+-set(CPACK_PACKAGE_DESCRIPTION_FILE ${WELCOME_FILE})
+-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
+-    "3D finite element mesh generator with built-in CAD engine and post-processor")
+-if(GMSH_EXTRA_VERSION MATCHES "-git.*") # so that we'll overwrite the archives
+-  set(CPACK_PACKAGE_FILE_NAME gmsh-git-${GMSH_OS})
+-  set(CPACK_SOURCE_PACKAGE_FILE_NAME gmsh-git-source)
+-else()
+-  set(CPACK_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-${GMSH_OS})
+-  set(CPACK_SOURCE_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-source)
+-endif()
+-set(CPACK_PACKAGE_INSTALL_DIRECTORY "gmsh")
+-set(CPACK_RESOURCE_FILE_LICENSE ${LICENSE_FILE})
+-set(CPACK_RESOURCE_FILE_README ${WELCOME_FILE})
+-set(CPACK_RESOURCE_FILE_WELCOME ${WELCOME_FILE})
+-set(CPACK_PACKAGE_EXECUTABLE "gmsh")
+-if(ENABLE_PACKAGE_STRIP)
+-  set(CPACK_STRIP_FILES TRUE)
+-else()
+-  set(CPACK_STRIP_FILES FALSE)
+-endif()
+-set(CPACK_SOURCE_GENERATOR TGZ)
+-set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR}" "/CVS/" "/.svn" "/.git"
+-    "~$" "DS_Store$" "GmshConfig.h$" "GmshVersion.h$" "/benchmarks/" "/tmp/"
+-    "/bin/" "/lib/" "/nightly/" "GPATH" "GRTAGS" "GSYMS" "GTAGS" "/HTML/"
+-    "/contrib/3M/" "/contrib/Parasolid/")
+-
+-if(UNIX)
+-  # make sure we remove previous installs before doing the next one (on Mac for
+-  # example "make package; make package_source" would lead to huge file lists
+-  # getting generated due to the 'Applications' symlink in the bundle)
+-  set(CPACK_INSTALL_COMMANDS "rm -rf ${CMAKE_CURRENT_BINARY_DIR}/_CPack_Packages")
+-endif()
+-
+-if(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
+-  set(CPACK_GENERATOR Bundle)
+-  set(CPACK_BUNDLE_NAME Gmsh)
+-  file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_app.plist F0)
+-  string(REPLACE GMSH_VERSION "${GMSH_VERSION}" F1 "${F0}")
+-  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist "${F1}")
+-  set(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
+-  set(CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIcons.icns)
+-  if(PACKAGER STREQUAL "geuzaine - removed: we sign on a separate machine")
+-    # codesigning requires CMake >= 3.2
+-    set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: Christophe Geuzaine")
+-  endif()
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsGeo.icns DESTINATION .
+-          RENAME GmshGeo.icns)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsMsh.icns DESTINATION .
+-          RENAME GmshMsh.icns)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsSol.icns DESTINATION .
+-          RENAME GmshSol.icns)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsPos.icns DESTINATION .
+-          RENAME GmshPos.icns)
+-  set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIcons.icns)
+-elseif(WIN32)
+-  set(CPACK_GENERATOR ZIP)
+-else()
+-  set(CPACK_GENERATOR TGZ)
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/utils/wrappers/gmshpy AND
+-   ENABLE_PRIVATE_API AND ENABLE_WRAP_PYTHON AND HAVE_PYTHON)
+-  add_subdirectory(utils/wrappers/gmshpy)
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/utils/wrappers/java AND
+-   ENABLE_PRIVATE_API AND ENABLE_WRAP_JAVA)
+-  add_subdirectory(utils/wrappers/java)
+-endif()
+-
+-include(CPack)
+-
+-if(NOT DISABLE_GMSH_TESTS)
+-  # disabling tests is useful when including this CMakeLists in an external project
+-  include(CTest)
+-  file(GLOB_RECURSE TESTFILES
+-       tutorial/*.geo demos/*.geo benchmarks/?d/*.geo benchmarks/extrude/*.geo
+-       benchmarks/occ/*.geo)
+-  # disable this test for now on our Linux32 machine - the current config
+-  # crashes on the OCC STL generation
+-  if(${GMSH_OS} MATCHES "Linux32")
+-    list(REMOVE_ITEM TESTFILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/t18.geo)
+-  endif()
+-  foreach(TESTFILE ${TESTFILES})
+-    # use relative path for Cygwin/MinGW (the pure win exe built with the MinGW
+-    # compilers does not understand a full Cygwin-style path)
+-    FILE(RELATIVE_PATH TEST ${CMAKE_CURRENT_BINARY_DIR} ${TESTFILE})
+-    if(HAVE_OCC OR NOT ${TEST} MATCHES "boolean" OR NOT ${TEST} MATCHES "occ")
+-      add_test(${TEST} ./gmsh ${TEST} -3 -nopopup -o ./tmp.msh)
+-    endif()
+-  endforeach()
+-  # test c++ api tutorials with dynamic builds (except on 32 bit windows for
+-  # now: our win32 setup does not currently handle exceptions)
+-  if(ENABLE_BUILD_DYNAMIC AND NOT ${GMSH_OS} MATCHES "Windows32")
+-    file(GLOB_RECURSE TESTFILES tutorial/c++/*.cpp)
+-    foreach(TESTFILE ${TESTFILES})
+-      get_filename_component(TEST ${TESTFILE} NAME_WE)
+-      add_executable(${TEST} WIN32 ${TESTFILE})
+-      target_link_libraries(${TEST} shared)
+-      if(WIN32 AND NOT MSVC)
+-        set_target_properties(${TEST} PROPERTIES LINK_FLAGS "-mwindows -static")
+-      endif()
+-      add_test(${TEST}_cpp ${TEST})
+-    endforeach()
+-  endif()
+-endif()
+-
+-message(STATUS "")
+-message(STATUS "Gmsh ${GMSH_VERSION} has been configured for ${GMSH_OS}")
+-message(STATUS "")
+-message(STATUS " * Build options:" ${GMSH_CONFIG_OPTIONS})
+-message(STATUS " * Build type: " ${CMAKE_BUILD_TYPE})
+-message(STATUS " * C compiler: " ${CMAKE_C_COMPILER})
+-message(STATUS " * C++ compiler: " ${CMAKE_CXX_COMPILER})
+-message(STATUS " * Install prefix: " ${CMAKE_INSTALL_PREFIX})
+-message(STATUS "")
+-
+-mark_as_advanced(GMSH_EXTRA_VERSION
+-                 ACIS_LIB ANN_INC ANN_LIB CAIRO_LIB CAIRO_INC CGNS_INC GMM_INC
+-                 GMP_INC GMP_LIB MMG3D_INC MMG3D_LIB HDF5_LIB
+-                 MED_LIB OCC_INC SZ_LIB
+-                 PETSC_LIBS SLEPC_INC SLEPC_INC2 SLEPC_LIB
+-                 BISON FLEX MAKEINFO TEXI2PDF FLTK_CONFIG_SCRIPT
+-                 GMSH_EXTERNAL_INCLUDE_DIRS GMSH_EXTERNAL_LIBRARIES)
+Index: ../trunk-jpl/externalpackages/gmsh/configs/4.7.0/mac/static/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/configs/4.7.0/mac/static/CMakeLists.txt	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/configs/4.7.0/mac/static/CMakeLists.txt	(nonexistent)
+@@ -1,2191 +0,0 @@
+-# Gmsh - Copyright (C) 1997-2020 C. Geuzaine, J.-F. Remacle
+-#
+-# See the LICENSE.txt file for license information. Please report all
+-# issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
+-
+-cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
+-
+-# if CMAKE_BUILD_TYPE is specified use it; otherwise set the default
+-# build type to "RelWithDebInfo" ("-O2 -g" with gcc) prior to calling
+-# project()
+-if(DEFINED CMAKE_BUILD_TYPE)
+-  set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type")
+-else()
+-  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type")
+-endif()
+-
+-project(gmsh CXX C)
+-
+-# require C++11 and request C99
+-set(CMAKE_CXX_STANDARD 11)
+-set(CMAKE_CXX_STANDARD_REQUIRED ON)
+-set(CMAKE_C_STANDARD 99)
+-
+-# this variable controls the default value of the options which are normally set
+-# to ON (useful if you want to configure a minimal version of Gmsh: e.g. "cmake
+-# -DDEFAULT=0 -DENABLE_POST=1 -DENABLE_PARSER=1")
+-set(DEFAULT ON CACHE INTERNAL "Default value for enabled-by-default options")
+-
+-macro(opt OPTION HELP VALUE)
+-  option(ENABLE_${OPTION} ${HELP} ${VALUE})
+-  set(OPT_TEXI "${OPT_TEXI}\n@item ENABLE_${OPTION}\n${HELP} (default: ${VALUE})")
+-endmacro()
+-
+-opt(3M "Enable proprietary 3M extension" OFF)
+-opt(ALGLIB "Enable ALGLIB (used by some mesh optimizers)" ${DEFAULT})
+-opt(ANN "Enable ANN (used for fast point search in mesh/post)" ${DEFAULT})
+-opt(BAMG "Enable Bamg 2D anisotropic mesh generator" ${DEFAULT})
+-opt(BLAS_LAPACK "Enable BLAS/Lapack for linear algebra (if Eigen if disabled)" OFF)
+-opt(BLOSSOM "Enable Blossom algorithm (needed for full quad meshing)" ${DEFAULT})
+-opt(BUILD_LIB "Enable 'lib' target for building static Gmsh library" OFF)
+-opt(BUILD_SHARED "Enable 'shared' target for building shared Gmsh library" OFF)
+-opt(BUILD_DYNAMIC "Enable dynamic Gmsh executable (linked with shared library)" OFF)
+-opt(BUILD_ANDROID "Enable Android NDK library target (experimental)" OFF)
+-opt(BUILD_IOS "Enable iOS library target (experimental)" OFF)
+-opt(CGNS "Enable CGNS import/export (experimental)" ${DEFAULT})
+-opt(CGNS_CPEX0045 "Enable high-order CGNS import/export following CPEX0045 (experimental)" OFF)
+-opt(CAIRO "Enable Cairo to render fonts (experimental)" ${DEFAULT})
+-opt(PROFILE "Enable profiling compiler flags" OFF)
+-opt(DINTEGRATION "Enable discrete integration (needed for levelsets)" ${DEFAULT})
+-opt(DOMHEX "Enable experimental DOMHEX code" ${DEFAULT})
+-opt(EIGEN "Enable Eigen for linear algebra (instead of Blas/Lapack)" ON)
+-opt(FLTK "Enable FLTK graphical user interface (requires mesh/post)" ${DEFAULT})
+-opt(GETDP "Enable GetDP solver (linked as a library, experimental)" ${DEFAULT})
+-opt(GMM "Enable GMM linear solvers (simple alternative to PETSc)" ${DEFAULT})
+-opt(GMP "Enable GMP for Kbipack (advanced)" ON)
+-opt(GRAPHICS "Enable building graphics lib even without GUI (advanced)" OFF)
+-opt(HXT "Enable HXT library (for reparametrization and meshing)" ${DEFAULT})
+-opt(KBIPACK "Enable Kbipack (neeeded by homology solver)" ${DEFAULT})
+-opt(MATHEX "Enable Mathex expression parser (used by plugins and options)" ${DEFAULT})
+-opt(MED "Enable MED mesh and post file formats" ${DEFAULT})
+-opt(MESH "Enable mesh module (required by GUI)" ${DEFAULT})
+-opt(METIS "Enable Metis mesh partitioner" ${DEFAULT})
+-opt(MMG "Enable Mmg mesh adaptation interface" ${DEFAULT})
+-opt(MPEG_ENCODE "Enable built-in MPEG movie encoder" ${DEFAULT})
+-opt(MPI "Enable MPI (experimental, not used for meshing)" OFF)
+-opt(MSVC_STATIC_RUNTIME "Enable static Visual C++ runtime" OFF)
+-opt(MUMPS "Enable MUMPS sparse direct linear solver" OFF)
+-opt(NETGEN "Enable Netgen 3D frontal mesh generator" ${DEFAULT})
+-opt(NUMPY "Enable fullMatrix and numpy array conversion for private API" OFF)
+-opt(PETSC4PY "Enable petsc4py wrappers for petsc matrices for private API" OFF)
+-opt(OCC "Enable OpenCASCADE CAD kernel" ${DEFAULT})
+-opt(OCC_CAF "Enable OpenCASCADE CAF module (for STEP/IGES attributes)" ${DEFAULT})
+-opt(OCC_STATIC "Link OpenCASCADE static instead of dynamic libraries (requires ENABLE_OCC)" OFF)
+-opt(OCC_TBB "Add TBB libraries in list of OCC libraries" OFF)
+-opt(ONELAB "Enable ONELAB solver interface" ${DEFAULT})
+-opt(ONELAB_METAMODEL "Enable ONELAB metamodels (experimental)" ${DEFAULT})
+-opt(OPENACC "Enable OpenACC" OFF)
+-opt(OPENMP "Enable OpenMP" OFF)
+-opt(OPTHOM "Enable high-order mesh optimization tools" ${DEFAULT})
+-opt(OS_SPECIFIC_INSTALL "Enable OS-specific (e.g. app bundle) installation" OFF)
+-opt(OSMESA "Enable OSMesa for offscreen rendering (experimental)" OFF)
+-opt(P4EST "Enable p4est for enabling automatic mesh size field (experimental)" OFF)
+-opt(PACKAGE_STRIP "Strip symbols in install packages to reduce install size" ON)
+-opt(PARSER "Enable GEO file parser (required for .geo/.pos scripts)" ${DEFAULT})
+-opt(PETSC "Enable PETSc linear solvers (required for SLEPc)" OFF)
+-opt(PLUGINS "Enable post-processing plugins" ${DEFAULT})
+-opt(POST "Enable post-processing module (required by GUI)" ${DEFAULT})
+-opt(POPPLER "Enable Poppler for displaying PDF documents (experimental)" OFF)
+-opt(PRIVATE_API "Enable private API" OFF)
+-opt(PRO "Enable PRO extensions" ${DEFAULT})
+-opt(QUADTRI "Enable QuadTri structured meshing extensions" ${DEFAULT})
+-opt(REVOROPT "Enable Revoropt (used for CVT remeshing)" OFF)
+-opt(RPATH "Use RPATH in dynamically linked targets" ON)
+-opt(SLEPC "Enable SLEPc eigensolvers" OFF)
+-opt(SOLVER "Enable built-in finite element solvers (required for reparametrization)" ${DEFAULT})
+-opt(SYSTEM_CONTRIB "Use system versions of contrib libraries, when possible" OFF)
+-opt(TCMALLOC "Enable libtcmalloc (fast malloc that does not release memory)" OFF)
+-opt(TOUCHBAR "Enable Apple Touch bar" ${DEFAULT})
+-opt(VISUDEV "Enable additional visualization capabilities for development purposes" OFF)
+-opt(VOROPP "Enable voro++ (for hex meshing, experimental)" ${DEFAULT})
+-opt(WRAP_JAVA "Generate SWIG Java wrappers for private API" OFF)
+-opt(WRAP_PYTHON "Generate SWIG Python wrappers for private API (not used by public API)" OFF)
+-opt(ZIPPER "Enable Zip file compression/decompression" OFF)
+-
+-set(GMSH_MAJOR_VERSION 4)
+-set(GMSH_MINOR_VERSION 7)
+-set(GMSH_PATCH_VERSION 0)
+-if(NOT GMSH_EXTRA_VERSION)
+-  set(GMSH_EXTRA_VERSION "")
+-endif()
+-set(GMSH_EXTRA_VERSION_TEXI "${GMSH_EXTRA_VERSION}")
+-set(GMSH_EXTRA_VERSION_ORIG ${GMSH_EXTRA_VERSION})
+-
+-if(NOT GMSH_RELEASE)
+-  find_package(Git)
+-  if(GIT_FOUND)
+-    execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
+-                    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ERROR_QUIET
+-                    OUTPUT_VARIABLE GIT_COMMIT_HASH
+-                    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  endif()
+-  if(GIT_COMMIT_HASH)
+-    set(GMSH_EXTRA_VERSION "${GMSH_EXTRA_VERSION}-git-${GIT_COMMIT_HASH}")
+-  endif()
+-  set(GMSH_EXTRA_VERSION_TEXI "${GMSH_EXTRA_VERSION_TEXI} (development version)")
+-endif()
+-
+-set(GMSH_SHORT_VERSION
+-    "${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}")
+-set(GMSH_VERSION "${GMSH_SHORT_VERSION}${GMSH_EXTRA_VERSION}")
+-set(GMSH_SHORT_LICENSE "GNU General Public License")
+-
+-set(GMSH_GITLAB_PREFIX "https://gitlab.onelab.info/gmsh/gmsh")
+-if(GMSH_RELEASE)
+-  set(GMSH_GITLAB_PREFIX "${GMSH_GITLAB_PREFIX}/blob/gmsh_${GMSH_SHORT_VERSION}")
+-else()
+-  set(GMSH_GITLAB_PREFIX "${GMSH_GITLAB_PREFIX}/blob/master")
+-endif()
+-
+-set(GMSH_API api/gmsh.h api/gmshc.h api/gmsh.h_cwrap)
+-
+-if(ENABLE_PRIVATE_API)
+-  message(WARNING "The private API is unsupported and undocumented. It is meant "
+-          "for expert Gmsh developers, not for regular Gmsh users, who should rely "
+-          "on the stable public API (gmsh/api) instead.")
+-  file(GLOB_RECURSE HEADERS Common/*.h Numeric/*.h Geo/*.h Mesh/*.h Solver/*.h
+-    Post/*.h Plugin/*.h Graphics/*.h contrib/kbipack/*.h
+-    contrib/DiscreteIntegration/*.h contrib/HighOrderMeshOptimizer/*.h
+-    contrib/MeshOptimizer/*.h contrib/MeshQualityOptimizer/*.h)
+-  set(GMSH_PRIVATE_API ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h
+-      ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h ${HEADERS})
+-  get_property(IAMCHILD DIRECTORY PROPERTY PARENT_DIRECTORY)
+-  if(IAMCHILD)
+-    set(GMSH_PRIVATE_API ${GMSH_PRIVATE_API} PARENT_SCOPE)
+-  endif()
+-  if(ENABLE_WRAP_PYTHON OR ENABLE_WRAP_JAVA)
+-    set(ENABLE_BUILD_DYNAMIC ON)
+-    message(WARNING "SWIG wrappers for the private API are unsupported and "
+-            "undocumented. The stable public Python API does not required SWIG.")
+-  endif()
+-endif()
+-
+-set(ONELAB_PY contrib/onelab/python/onelab.py)
+-set(GMSH_PY api/gmsh.py)
+-set(GMSH_JL api/gmsh.jl)
+-
+-if(${CMAKE_MAJOR_VERSION} GREATER 2)
+-  string(TIMESTAMP DATE "%Y%m%d")
+-else()
+-  execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE DATE
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-endif()
+-
+-if(NOT DATE)
+-  set(DATE "unknown")
+-endif()
+-set(GMSH_DATE "${DATE}")
+-
+-if(NOT GMSH_HOST)
+-  execute_process(COMMAND hostname OUTPUT_VARIABLE HOST
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  if(NOT HOST)
+-    set(HOST "unknown")
+-  endif()
+-  set(GMSH_HOST "${HOST}")
+-endif()
+-
+-if(NOT GMSH_PACKAGER)
+-  execute_process(COMMAND whoami OUTPUT_VARIABLE PACKAGER
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  if(NOT PACKAGER)
+-    set(PACKAGER "unknown")
+-  endif()
+-  string(REPLACE "\\" " " PACKAGER ${PACKAGER})
+-  set(GMSH_PACKAGER "${PACKAGER}")
+-endif()
+-
+-if(APPLE)
+-  set(GMSH_OS "MacOSX")
+-elseif(CYGWIN OR MSYS)
+-  # detect if we use the MinGW compilers on Cygwin - if we do, handle the build
+-  # as a pure Windows build and make cmake find pure Windows import libraries
+-  # (.lib)
+-  if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
+-     CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-    execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
+-                    OUTPUT_VARIABLE CXX_COMPILER_MACHINE
+-                    OUTPUT_STRIP_TRAILING_WHITESPACE)
+-    if(CXX_COMPILER_MACHINE MATCHES "mingw")
+-      set(GMSH_OS "Windows")
+-      set(WIN32 1)
+-      add_definitions(-DWIN32)
+-      set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
+-      set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so" ".lib" ".LIB" ".dll" ".DLL" ".dll.a")
+-    endif()
+-  endif()
+-else()
+-  set(GMSH_OS "${CMAKE_SYSTEM_NAME}")
+-endif()
+-
+-include(CheckTypeSize)
+-include(CheckFunctionExists)
+-include(CheckIncludeFile)
+-include(CheckCXXCompilerFlag)
+-include(CheckCCompilerFlag)
+-
+-macro(set_config_option VARNAME STRING)
+-  set(${VARNAME} TRUE)
+-  list(APPEND CONFIG_OPTIONS ${STRING})
+-  message(STATUS "Found " ${STRING})
+-endmacro()
+-
+-# check the size of size_t
+-check_type_size("size_t" SIZEOF_SIZE_T)
+-if(SIZEOF_SIZE_T EQUAL 8)
+-  set_config_option(HAVE_64BIT_SIZE_T "64Bit")
+-endif()
+-
+-# append 32/64 to the build name on Linux and Windows
+-if(NOT APPLE)
+-  if(HAVE_64BIT_SIZE_T)
+-    set(GMSH_OS "${GMSH_OS}64")
+-  else()
+-    set(GMSH_OS "${GMSH_OS}32")
+-  endif()
+-endif()
+-
+-if(ENABLE_BUILD_DYNAMIC)
+-  set(GMSH_OS "${GMSH_OS}-sdk")
+-endif()
+-
+-if(ENABLE_RPATH)
+-  set(CMAKE_MACOSX_RPATH 1)
+-
+-  # make sure that dynamic libraries can be found when installing/ displacing
+-  # the binaries: from https://gitlab.kitware.com/cmake/community/wikis/doc/
+-  # cmake/RPATH-handling:
+-
+-  # use, i.e. don't skip the full RPATH for the build tree
+-  set(CMAKE_SKIP_BUILD_RPATH FALSE)
+-
+-  # when building, don't use the install RPATH already (but later on when
+-  # installing)
+-  set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+-
+-  # add the automatically determined parts of the RPATH which point to
+-  # directories outside the build tree to the install RPATH
+-  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+-
+-  # the RPATH to be used when installing, but only if it's not a system directory
+-  list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib"
+-       isSystemDir)
+-  if("${isSystemDir}" STREQUAL "-1")
+-    if(APPLE)
+-      set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
+-    else()
+-      set(CMAKE_INSTALL_RPATH "\\\$ORIGIN/../lib")
+-    endif()
+-  endif()
+-else()
+-  set(CMAKE_MACOSX_RPATH 0)
+-  set(CMAKE_SKIP_BUILD_RPATH TRUE)
+-endif()
+-
+-if(MSVC)
+-  # remove annoying warning about bool/int cast performance
+-  set(GMSH_CONFIG_PRAGMAS "#pragma warning(disable:4800 4244 4267)")
+-  foreach(VAR
+-          CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+-          CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
+-          CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+-          CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
+-    if(ENABLE_MSVC_STATIC_RUNTIME AND ${VAR} MATCHES "/MD")
+-      string(REGEX REPLACE "/MD" "/MT" ${VAR} "${${VAR}}")
+-    endif()
+-    if(NOT ${VAR} MATCHES "/MP") # enable parallel compilation
+-      set(${VAR} "${${VAR}} /MP")
+-    endif()
+-  endforeach()
+-  if(ENABLE_PRIVATE_API)
+-    if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
+-      # automatically export .def file with all symbols (requires CMake 3.4);
+-      # depending on the compiling options this might lead to more than 64k export
+-      # symbols; just trim the .def file to keep the ones you need
+-      set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+-    endif()
+-  endif()
+-endif()
+-
+-# reduce memory usage of GCC on 32 bit systems
+-if(NOT HAVE_64BIT_SIZE_T AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+-  set(CMAKE_CXX_FLAGS
+-      "${CMAKE_CXX_FLAGS} --param ggc-min-expand=1 --param ggc-min-heapsize=512000")
+-endif()
+-
+-if(ENABLE_OPENMP)
+-  find_package(OpenMP)
+-  if(OpenMP_FOUND OR OPENMP_FOUND)
+-    set_config_option(HAVE_OPENMP "OpenMP")
+-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+-  elseif(APPLE AND EXISTS "/opt/local/lib/libomp")
+-    # official Apple compiler with macports' libomp
+-    set_config_option(HAVE_OPENMP "OpenMP[MacPorts]")
+-    set(CMAKE_C_FLAGS
+-        "${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp -I/opt/local/include/libomp")
+-    set(CMAKE_CXX_FLAGS
+-        "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -I/opt/local/include/libomp")
+-    list(APPEND EXTERNAL_LIBRARIES "-L/opt/local/lib/libomp -lomp")
+-  elseif(APPLE AND EXISTS "/usr/local/lib/libomp.dylib")
+-    # official Apple compiler with homebrew's libomp
+-    set_config_option(HAVE_OPENMP "OpenMP[Homebrew]")
+-    set(CMAKE_C_FLAGS
+-        "${CMAKE_C_FLAGS} -Xpreprocessor -fopenmp")
+-    set(CMAKE_CXX_FLAGS
+-        "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp")
+-    list(APPEND EXTERNAL_LIBRARIES "-L/usr/local/lib -lomp")
+-  endif()
+-endif()
+-
+-if(ENABLE_OPENACC)
+-  find_package(OpenACC)
+-  if(OpenACC_C_FOUND AND OpenACC_CXX_FOUND)
+-    set_config_option(HAVE_OPENACC "OpenACC")
+-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenACC_C_FLAGS}")
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenACC_CXX_FLAGS}")
+-  endif()
+-endif()
+-
+-if(ENABLE_PROFILE)
+-    # Using the perf set of profiling tools doesn't work without the frame
+-    # pointer and a common optimisation is to remove it
+-    check_cxx_compiler_flag("-fno-omit-frame-pointer" FNOFP)
+-    if(FNOFP)
+-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
+-    endif()
+-endif()
+-
+-macro(append_gmsh_src DIRNAME FILES)
+-  foreach(FILE ${FILES})
+-    list(APPEND LIST ${DIRNAME}/${FILE})
+-  endforeach()
+-  set(GMSH_SRC ${GMSH_SRC};${LIST} PARENT_SCOPE)
+-  set(GMSH_DIRS ${GMSH_DIRS};${DIRNAME} PARENT_SCOPE)
+-endmacro()
+-
+-macro(find_all_libraries VARNAME LISTNAME PATH SUFFIX)
+-  set(${VARNAME})
+-  list(LENGTH ${LISTNAME} NUM_LIST)
+-  foreach(LIB ${${LISTNAME}})
+-    if("${PATH}" STREQUAL "")
+-      find_library(FOUND_LIB ${LIB} PATH_SUFFIXES ${SUFFIX})
+-    else()
+-      find_library(FOUND_LIB ${LIB} PATHS ${PATH} NO_DEFAULT_PATH)
+-    endif()
+-    if(FOUND_LIB)
+-      list(APPEND ${VARNAME} ${FOUND_LIB})
+-    endif()
+-    unset(FOUND_LIB CACHE)
+-  endforeach()
+-  list(LENGTH ${VARNAME} NUM_FOUND_LIBRARIES)
+-  if(NUM_FOUND_LIBRARIES LESS NUM_LIST)
+-    set(${VARNAME})
+-  endif()
+-endmacro()
+-
+-macro(set_compile_flags LISTNAME FLAGS)
+-  foreach(FILE ${${LISTNAME}})
+-    get_source_file_property(PROP ${FILE} COMPILE_FLAGS)
+-    if(PROP)
+-      set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${PROP} ${FLAGS}")
+-    else()
+-      set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "${FLAGS}")
+-    endif()
+-  endforeach()
+-endmacro()
+-
+-if(ENABLE_EIGEN)
+-  if(ENABLE_SYSTEM_CONTRIB)
+-    find_path(EIGEN_INC "Eigen/Dense" HINTS eigen3)
+-    if(EIGEN_INC)
+-      include_directories(${EIGEN_INC})
+-      set_config_option(HAVE_EIGEN "Eigen[system]")
+-    endif()
+-  endif()
+-  if(NOT HAVE_EIGEN)
+-    include_directories(contrib/eigen)
+-    set_config_option(HAVE_EIGEN "Eigen")
+-  endif()
+-  # We could also add an option to use BLAS with Eigen
+-  # add_definitions(-DEIGEN_USE_BLAS)
+-elseif(ENABLE_BLAS_LAPACK)
+-  if(BLAS_LAPACK_LIBRARIES)
+-    # use libs as specified in the BLAS_LAPACK_LIBRARIES variable
+-    set_config_option(HAVE_BLAS "Blas[custom]")
+-    set_config_option(HAVE_LAPACK "Lapack[custom]")
+-    set(LAPACK_LIBRARIES ${BLAS_LAPACK_LIBRARIES})
+-  else()
+-    if(MSVC)
+-      # on Windows with Visual C++ try really hard to find blas/lapack *without*
+-      # requiring a Fortran compiler: 1) try to find the Intel MKL libs using
+-      # the standard search path; if not found 2) try to get the reference
+-      # blas/lapack libs (useful for users with no Fortran compiler and no MKL
+-      # license, who can just download our precompiled "gmsh-dep" package)
+-      if(HAVE_64BIT_SIZE_T)
+-        set(MKL_PATH em64t/lib)
+-        set(MKL_LIBS_REQUIRED libguide40 mkl_intel_lp64 mkl_intel_thread mkl_core)
+-      else()
+-        set(MKL_PATH ia32/lib)
+-        set(MKL_LIBS_REQUIRED libguide40 mkl_intel_c mkl_intel_thread mkl_core)
+-      endif()
+-      find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
+-      if(LAPACK_LIBRARIES)
+-        set_config_option(HAVE_BLAS "Blas[mkl]")
+-        set_config_option(HAVE_LAPACK "Lapack[mkl]")
+-      else()
+-        set(REFLAPACK_LIBS_REQUIRED lapack blas g2c gcc)
+-        find_all_libraries(LAPACK_LIBRARIES REFLAPACK_LIBS_REQUIRED "" "")
+-        if(LAPACK_LIBRARIES)
+-          set_config_option(HAVE_BLAS "Blas[ref]")
+-          set_config_option(HAVE_LAPACK "Lapack[ref]")
+-        endif()
+-      endif()
+-    elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-      # on Linux try to find the Intel MKL without a Fortran compiler
+-      if(HAVE_64BIT_SIZE_T)
+-        set(MKL_PATH lib/em64t)
+-      else()
+-        set(MKL_PATH lib/32)
+-      endif()
+-      set(MKL_LIBS_REQUIRED mkl_gf_lp64 iomp5 mkl_gnu_thread mkl_core guide pthread)
+-      find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
+-      if(NOT LAPACK_LIBRARIES)
+-        # match lapack 9.0 on 64bit
+-        set(MKL_LIBS_REQUIRED mkl_lapack mkl_em64t guide)
+-        find_all_libraries(LAPACK_LIBRARIES MKL_LIBS_REQUIRED "" ${MKL_PATH})
+-      endif()
+-      if(LAPACK_LIBRARIES)
+-        set_config_option(HAVE_BLAS "Blas[mkl]")
+-        set_config_option(HAVE_LAPACK "Lapack[mkl]")
+-      else()
+-        # on Linux also try to find ATLAS without a Fortran compiler, because
+-        # cmake ships with a buggy FindBLAS e.g. on Ubuntu Lucid Lynx
+-        set(ATLAS_LIBS_REQUIRED lapack f77blas cblas atlas)
+-        find_all_libraries(LAPACK_LIBRARIES ATLAS_LIBS_REQUIRED "" "")
+-        if(LAPACK_LIBRARIES)
+-          set_config_option(HAVE_BLAS "Blas[atlas]")
+-          set_config_option(HAVE_LAPACK "Lapack[atlas]")
+-        else()
+-          # try with generic names
+-          set(GENERIC_LIBS_REQUIRED lapack blas pthread)
+-          find_all_libraries(LAPACK_LIBRARIES GENERIC_LIBS_REQUIRED "" "")
+-          if(LAPACK_LIBRARIES)
+-            set_config_option(HAVE_BLAS "Blas[generic]")
+-            set_config_option(HAVE_LAPACK "Lapack[generic]")
+-            find_library(GFORTRAN_LIB gfortran)
+-            if(GFORTRAN_LIB)
+-              list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
+-            endif()
+-          endif()
+-        endif()
+-      endif()
+-    elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+-      # on SunOS we know blas and lapack are available in sunperf
+-      set(LAPACK_LIBRARIES -library=sunperf)
+-      set_config_option(HAVE_BLAS "Blas[sunperf]")
+-      set_config_option(HAVE_LAPACK "Lapack[sunperf]")
+-    elseif(APPLE)
+-      # on Mac we also know that blas and lapack are available
+-      set(LAPACK_LIBRARIES "-llapack -lblas")
+-      set_config_option(HAVE_BLAS "Blas[veclib]")
+-      set_config_option(HAVE_LAPACK "Lapack[veclib]")
+-    endif()
+-
+-    if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
+-      # if we haven't found blas and lapack check for OpenBlas
+-      set(OPENBLAS_LIBS_REQUIRED openblas)
+-      find_all_libraries(LAPACK_LIBRARIES OPENBLAS_LIBS_REQUIRED "" "")
+-      if(LAPACK_LIBRARIES)
+-        set_config_option(HAVE_BLAS "Blas[openblas]")
+-        set_config_option(HAVE_LAPACK "Lapack[openblas]")
+-        find_library(GFORTRAN_LIB gfortran)
+-        if(GFORTRAN_LIB)
+-          list(APPEND LAPACK_LIBRARIES ${GFORTRAN_LIB})
+-        endif()
+-      endif()
+-    endif()
+-
+-    if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
+-      # if we still haven't found blas and lapack, use the standard cmake tests,
+-      # which require a working Fortran compiler
+-      enable_language(Fortran)
+-      find_package(BLAS)
+-      if(BLAS_FOUND)
+-        set_config_option(HAVE_BLAS "Blas")
+-        find_package(LAPACK)
+-        if(LAPACK_FOUND)
+-          set_config_option(HAVE_LAPACK "Lapack")
+-        else()
+-          set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
+-        endif()
+-        if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
+-          if(CMAKE_Fortran_COMPILER MATCHES "gfortran")
+-            list(APPEND LAPACK_LIBRARIES gfortran)
+-          elseif(CMAKE_Fortran_COMPILER MATCHES "f95")
+-            list(APPEND LAPACK_LIBRARIES gfortran)
+-          elseif(CMAKE_Fortran_COMPILER MATCHES "g77")
+-            list(APPEND LAPACK_LIBRARIES g2c)
+-          endif()
+-        elseif(CMAKE_Fortran_COMPILER MATCHES "pgi")
+-          list(APPEND LAPACK_LIBRARIES -pgf77libs)
+-        endif()
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_TCMALLOC)
+-  find_library(TCMALLOC tcmalloc)
+-  if(TCMALLOC)
+-    set_config_option(HAVE_TCMALLOC "TCMalloc")
+-    list(APPEND EXTERNAL_LIBRARIES ${TCMALLOC})
+-  endif()
+-endif()
+-
+-add_subdirectory(Common)
+-add_subdirectory(Numeric)
+-add_subdirectory(Geo)
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Mesh AND ENABLE_MESH)
+-  add_subdirectory(Mesh)
+-  set_config_option(HAVE_MESH "Mesh")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Solver AND ENABLE_SOLVER)
+-  add_subdirectory(Solver)
+-  set_config_option(HAVE_SOLVER "Solver")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Post AND ENABLE_POST)
+-  add_subdirectory(Post)
+-  set_config_option(HAVE_POST "Post")
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Plugin AND ENABLE_PLUGINS)
+-    add_subdirectory(Plugin)
+-    set_config_option(HAVE_PLUGINS "Plugins")
+-  endif()
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Parser AND ENABLE_PARSER)
+-  add_subdirectory(Parser)
+-  set_config_option(HAVE_PARSER "Parser")
+-endif()
+-
+-if(ENABLE_VISUDEV)
+-  set_config_option(HAVE_VISUDEV "VisuDev")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Fltk AND ENABLE_FLTK)
+-  # first, try to use fltk-config for fltk >= 1.3 (FindFLTK is buggy on Unix,
+-  # where e.g. xft and xinerama options are not dealt with)
+-  find_program(FLTK_CONFIG_SCRIPT fltk-config)
+-  if(FLTK_CONFIG_SCRIPT)
+-    execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --api-version
+-                    OUTPUT_VARIABLE FLTK_VERSION)
+-    string(STRIP "${FLTK_VERSION}" FLTK_VERSION)
+-    if(FLTK_VERSION VERSION_GREATER 1.1)
+-      add_subdirectory(Fltk)
+-      set_config_option(HAVE_FLTK "Fltk")
+-      message(STATUS "Using fltk-config script for Fltk " ${FLTK_VERSION})
+-      execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-gl --use-images --includedir
+-                      OUTPUT_VARIABLE FLTK_INCLUDE_DIR)
+-      string(STRIP ${FLTK_INCLUDE_DIR} FLTK_INCLUDE_DIR)
+-      list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
+-      # On linux (at least OpenSuSE) the following directories are
+-      # not existing (everything is in /usr/include). To avoid warnings
+-      # check existance of these directories before adding them
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/FL/images)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/FL/images)
+-      endif()
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/jpeg)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/jpeg)
+-      endif()
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/zlib)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/zlib)
+-      endif()
+-      if(EXISTS ${FLTK_INCLUDE_DIR}/png)
+-        list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR}/png)
+-      endif()
+-      execute_process(COMMAND ${FLTK_CONFIG_SCRIPT} --use-gl --use-images --ldflags
+-                      OUTPUT_VARIABLE FLTK_LIBRARIES)
+-      string(STRIP ${FLTK_LIBRARIES} FLTK_LIBRARIES)
+-      string(REGEX MATCH "fltk[_ ]jpeg" FLTK_JPEG ${FLTK_LIBRARIES})
+-      string(REGEX MATCH "fltk[_ ]z" FLTK_Z ${FLTK_LIBRARIES})
+-      string(REGEX MATCH "fltk[_ ]png" FLTK_PNG ${FLTK_LIBRARIES})
+-    endif()
+-  endif()
+-  # then try the built-in FindFLTK module
+-  if(NOT HAVE_FLTK)
+-    set(FLTK_SKIP_FORMS TRUE)
+-    set(FLTK_SKIP_FLUID TRUE)
+-    find_package(FLTK)
+-    if(FLTK_FOUND)
+-      add_subdirectory(Fltk)
+-      set_config_option(HAVE_FLTK "Fltk")
+-      list(APPEND EXTERNAL_INCLUDES ${FLTK_INCLUDE_DIR})
+-      # find fltk jpeg
+-      find_library(FLTK_JPEG NAMES fltk_jpeg fltkjpeg)
+-      if(FLTK_JPEG)
+-        list(APPEND EXTERNAL_LIBRARIES ${FLTK_JPEG})
+-        foreach(DIR ${FLTK_INCLUDE_DIR})
+-          list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/jpeg)
+-        endforeach()
+-      endif()
+-      # find fltk zlib
+-      find_library(FLTK_Z NAMES fltk_z fltkz)
+-      if(FLTK_Z)
+-        list(APPEND EXTERNAL_LIBRARIES ${FLTK_Z})
+-        foreach(DIR ${FLTK_INCLUDE_DIR})
+-          list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/zlib)
+-        endforeach()
+-      endif()
+-      # find fltk png
+-      find_library(FLTK_PNG NAMES fltk_png fltkpng)
+-      if(FLTK_PNG)
+-        list(APPEND EXTERNAL_LIBRARIES ${FLTK_PNG})
+-        foreach(DIR ${FLTK_INCLUDE_DIR})
+-          list(APPEND EXTERNAL_INCLUDES ${DIR}/FL/images ${DIR}/png)
+-        endforeach()
+-      endif()
+-    endif()
+-  endif()
+-  # workaround for Fedora/Suse messing up fltk-config (see issue #417)
+-  if(HAVE_FLTK AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-    string(REGEX MATCH "X11" FLTK_X11 ${FLTK_LIBRARIES})
+-    if(NOT FLTK_X11)
+-      find_package(X11)
+-      if(X11_FOUND)
+-        list(APPEND EXTERNAL_INCLUDES ${X11_INCLUDE_DIR})
+-        list(APPEND EXTERNAL_LIBRARIES ${X11_LIBRARIES})
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-if(APPLE AND HAVE_FLTK AND ENABLE_TOUCHBAR)
+-  STRING(REGEX MATCH "([0-9]+.[0-9]+)" OSX_SDK_VERSION "${CMAKE_OSX_SYSROOT}")
+-  if(OSX_SDK_VERSION)
+-    if(${OSX_SDK_VERSION} VERSION_GREATER 10.11)
+-      set(GMSH_SRC ${GMSH_SRC};Fltk/touchBar.mm)
+-      set_config_option(HAVE_TOUCHBAR "TouchBar")
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_ONELAB)
+-  set_config_option(HAVE_ONELAB "ONELAB")
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/onelab)
+-    if(ENABLE_ONELAB_METAMODEL)
+-      add_subdirectory(contrib/onelab)
+-      include_directories(contrib/onelab)
+-      set_config_option(HAVE_ONELAB_METAMODEL "ONELABMetamodel")
+-    endif()
+-    file(COPY ${ONELAB_PY} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+-  endif()
+-endif()
+-
+-if(ENABLE_BUILD_IOS)
+-  find_file(CMAKE_TOOLCHAIN_FILE "ios.cmake")
+-  if(NOT CMAKE_TOOLCHAIN_FILE)
+-    message(FATAL_ERROR "Cannot compile Gmsh for iOS without a toolchain")
+-  endif()
+-  add_definitions(-DBUILD_IOS)
+-endif()
+-
+-if(HAVE_FLTK OR ENABLE_GRAPHICS)
+-  if(NOT HAVE_MESH OR NOT HAVE_POST OR NOT HAVE_PLUGINS OR NOT HAVE_ONELAB)
+-    message(SEND_ERROR "Cannot compile GUI without Mesh, Post, Plugin and ONELAB")
+-  endif()
+-
+-  if(FLTK_JPEG)
+-    set_config_option(HAVE_LIBJPEG "Jpeg[fltk]")
+-  else()
+-    find_package(JPEG)
+-    if(JPEG_FOUND)
+-      set_config_option(HAVE_LIBJPEG "Jpeg")
+-      list(APPEND EXTERNAL_LIBRARIES ${JPEG_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${JPEG_INCLUDE_DIR})
+-    endif()
+-  endif()
+-
+-  if(FLTK_Z)
+-    set_config_option(HAVE_LIBZ "Zlib[fltk]")
+-  else()
+-    find_package(ZLIB)
+-    if(ZLIB_FOUND)
+-      set_config_option(HAVE_LIBZ "Zlib")
+-      list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
+-    endif()
+-  endif()
+-
+-  if(HAVE_LIBZ)
+-    if(FLTK_PNG)
+-      set_config_option(HAVE_LIBPNG "Png[fltk]")
+-    else()
+-      find_package(PNG)
+-      if(PNG_FOUND)
+-        set_config_option(HAVE_LIBPNG "Png")
+-        list(APPEND EXTERNAL_LIBRARIES ${PNG_LIBRARIES})
+-        list(APPEND EXTERNAL_INCLUDES ${PNG_INCLUDE_DIR})
+-      endif()
+-    endif()
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/mpeg_encode AND
+-     ENABLE_MPEG_ENCODE)
+-    add_subdirectory(contrib/mpeg_encode)
+-    include_directories(contrib/mpeg_encode/headers)
+-    set_config_option(HAVE_MPEG_ENCODE "Mpeg")
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/3M AND ENABLE_3M)
+-    add_subdirectory(contrib/3M)
+-    include_directories(contrib/3M)
+-    set_config_option(HAVE_3M "3M")
+-  endif()
+-
+-  if(ENABLE_OSMESA)
+-    find_library(OSMESA_LIB OSMesa)
+-    if(OSMESA_LIB)
+-      set_config_option(HAVE_OSMESA "OSMesa")
+-      list(APPEND EXTERNAL_LIBRARIES ${OSMESA_LIB})
+-    endif()
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Graphics)
+-    set(OpenGL_GL_PREFERENCE "LEGACY")
+-    find_package(OpenGL REQUIRED)
+-    if(OPENGL_GLU_FOUND AND OPENGL_FOUND)
+-      add_subdirectory(Graphics)
+-      set_config_option(HAVE_OPENGL "OpenGL")
+-    else()
+-      message(SEND_ERROR "Could not find GLU: disabling OpenGL support")
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_ANN)
+-  find_library(ANN_LIB ANN PATH_SUFFIXES lib)
+-  find_path(ANN_INC "ANN.h" PATH_SUFFIXES src include ANN)
+-  if(ENABLE_SYSTEM_CONTRIB AND ANN_LIB AND ANN_INC)
+-    message(STATUS "Using system version of ANN")
+-    list(APPEND EXTERNAL_LIBRARIES ${ANN_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${ANN_INC})
+-    set_config_option(HAVE_ANN "ANN[system]")
+-  elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/ANN)
+-    add_subdirectory(contrib/ANN)
+-    include_directories(contrib/ANN/include)
+-    set_config_option(HAVE_ANN "ANN")
+-  endif()
+-endif()
+-
+-if(ENABLE_ALGLIB)
+-  find_library(ALGLIB_LIB alglib)
+-  find_path(ALGLIB_INC "stdafx.h" PATH_SUFFIXES libalglib)
+-  if(ENABLE_SYSTEM_CONTRIB AND ALGLIB_LIB AND ALGLIB_INC)
+-    list(APPEND EXTERNAL_LIBRARIES ${ALGLIB_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${ALGLIB_INC})
+-    set_config_option(HAVE_ALGLIB "ALGLIB[system]")
+-  elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/ALGLIB)
+-    add_subdirectory(contrib/ALGLIB)
+-    include_directories(contrib/ALGLIB)
+-    set_config_option(HAVE_ALGLIB "ALGLIB")
+-  endif()
+-endif()
+-
+-if(HAVE_FLTK AND ENABLE_CAIRO)
+-  find_library(CAIRO_LIB cairo)
+-  find_path(CAIRO_INC "cairo/cairo.h" PATH_SUFFIXES include)
+-  if(CAIRO_INC AND CAIRO_LIB)
+-     set_config_option(HAVE_CAIRO "Cairo")
+-     list(APPEND EXTERNAL_LIBRARIES ${CAIRO_LIB})
+-     list(APPEND EXTERNAL_INCLUDES ${CAIRO_INC})
+-  endif()
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/DiscreteIntegration AND
+-   ENABLE_DINTEGRATION)
+-  add_subdirectory(contrib/DiscreteIntegration)
+-  include_directories(contrib/DiscreteIntegration)
+-  set_config_option(HAVE_DINTEGRATION "DIntegration")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/HighOrderMeshOptimizer AND
+-   EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MeshOptimizer AND
+-   EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MeshQualityOptimizer AND
+-   ENABLE_OPTHOM AND HAVE_MESH)
+-  add_subdirectory(contrib/HighOrderMeshOptimizer)
+-  include_directories(contrib/HighOrderMeshOptimizer)
+-  add_subdirectory(contrib/MeshOptimizer)
+-  include_directories(contrib/MeshOptimizer)
+-  include_directories(${CMAKE_CURRENT_BINARY_DIR}/contrib/MeshOptimizer)
+-  add_subdirectory(contrib/MeshQualityOptimizer)
+-  include_directories(contrib/MeshQualityOptimizer)
+-  set_config_option(HAVE_OPTHOM "OptHom")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/domhex AND
+-   ENABLE_DOMHEX AND HAVE_MESH)
+-  add_subdirectory(contrib/domhex)
+-  include_directories(contrib/domhex)
+-  set_config_option(HAVE_DOMHEX "DomHex")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/QuadTri AND
+-   ENABLE_QUADTRI AND HAVE_MESH)
+-  add_subdirectory(contrib/QuadTri)
+-  include_directories(contrib/QuadTri)
+-  set_config_option(HAVE_QUADTRI "QuadTri")
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/kbipack AND ENABLE_KBIPACK)
+-  set_config_option(HAVE_KBIPACK "Kbipack")
+-  add_subdirectory(contrib/kbipack)
+-  include_directories(contrib/kbipack)
+-  if(ENABLE_GMP)
+-    find_library(GMP_LIB libgmp.a)
+-    find_path(GMP_INC "gmp.h" PATH_SUFFIXES src include)
+-  endif()
+-  if(GMP_LIB AND GMP_INC)
+-    set_config_option(HAVE_GMP "GMP")
+-    list(APPEND EXTERNAL_LIBRARIES ${GMP_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${GMP_INC})
+-  else()
+-    message(STATUS "GMP not found: Kbipack uses long int")
+-  endif()
+-endif()
+-
+-if(ENABLE_MATHEX)
+-  find_library(MATHEX_LIB mathex PATH_SUFFIXES lib)
+-  find_path(MATHEX_INC "mathex.h" PATH_SUFFIXES src include)
+-  if(ENABLE_SYSTEM_CONTRIB AND MATHEX_LIB AND MATHEX_INC)
+-    list(APPEND EXTERNAL_LIBRARIES ${MATHEX_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${MATHEX_INC})
+-    set_config_option(HAVE_MATHEX "MathEx[system]")
+-  elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/MathEx)
+-    add_subdirectory(contrib/MathEx)
+-    include_directories(contrib/MathEx)
+-    set_config_option(HAVE_MATHEX "MathEx")
+-  endif()
+-endif()
+-
+-if(ENABLE_MPI)
+-  find_package(MPI)
+-  if(MPI_FOUND)
+-    set_config_option(HAVE_MPI "MPI")
+-    list(APPEND EXTERNAL_INCLUDES ${MPI_CXX_INCLUDE_PATH})
+-    list(APPEND EXTERNAL_LIBRARIES ${MPI_CXX_LIBRARIES})
+-    set(CMAKE_C_COMPILER ${MPI_C_COMPILER})
+-    set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
+-    set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER})
+-  endif()
+-endif()
+-
+-if(ENABLE_POPPLER)
+-  find_library(POPPLER_LIB poppler)
+-  find_library(POPPLER_CPP_LIB poppler-cpp)
+-  find_path(POPPLER_INC "poppler/cpp/poppler-document.h" PATH_SUFFIXES src include)
+-  if(POPPLER_LIB AND POPPLER_INC)
+-    set_config_option(HAVE_POPPLER "Poppler")
+-    list(APPEND EXTERNAL_LIBRARIES ${POPPLER_LIB})
+-    list(APPEND EXTERNAL_LIBRARIES ${POPPLER_CPP_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${POPPLER_INC})
+-  endif()
+-endif()
+-
+-if(ENABLE_P4EST)
+-  find_library(P4EST_LIB p4est)
+-  find_path(P4EST_INC "p4est.h" PATH_SUFFIXES src)
+-  find_library(SC_LIB sc)
+-  if(P4EST_LIB AND P4EST_INC AND SC_LIB)
+-    set_config_option(HAVE_P4EST "P4est")
+-    list(APPEND EXTERNAL_LIBRARIES ${P4EST_LIB} ${SC_LIB})
+-    list(APPEND EXTERNAL_INCLUDES ${P4EST_INC})
+-  endif()
+-endif()
+-
+-if(HAVE_MESH OR HAVE_SOLVER)
+-  if(ENABLE_METIS)
+-    if(METIS_LIB AND METIS_INC)
+-      list(APPEND EXTERNAL_LIBRARIES ${METIS_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${METIS_INC})
+-      set_config_option(HAVE_METIS "Metis")
+-    else()
+-      find_library(METIS_LIB metis PATH_SUFFIXES lib)
+-      find_path(METIS_INC "metis.h" PATH_SUFFIXES include)
+-      if(ENABLE_SYSTEM_CONTRIB AND METIS_LIB AND METIS_INC)
+-        message(STATUS "Using system version of METIS")
+-        list(APPEND EXTERNAL_LIBRARIES ${METIS_LIB})
+-        list(APPEND EXTERNAL_INCLUDES ${METIS_INC})
+-        set_config_option(HAVE_METIS "Metis[system]")
+-      elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/metis)
+-        add_definitions(-DUSE_GKREGEX)
+-        add_subdirectory(contrib/metis)
+-        include_directories(contrib/metis/include contrib/metis/libmetis
+-                          contrib/metis/GKlib)
+-        set_config_option(HAVE_METIS "Metis")
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-if(HAVE_MESH)
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Mesh/tetgenBR.cxx)
+-    set_config_option(HAVE_TETGENBR "TetGen/BR")
+-  endif()
+-
+-  if(ENABLE_VOROPP)
+-    find_library(VOROPP_LIB voro++)
+-    find_path(VOROPP_INC "voro++.hh" PATH_SUFFIXES voro++)
+-    if(ENABLE_SYSTEM_CONTRIB AND VOROPP_LIB AND VOROPP_INC)
+-      message(STATUS "Using system version of voro++")
+-      list(APPEND EXTERNAL_LIBRARIES ${VOROPP_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${VOROPP_INC})
+-      set_config_option(HAVE_VOROPP "Voro++[system]")
+-    elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/voro++)
+-      add_subdirectory(contrib/voro++)
+-      include_directories(contrib/voro++/src)
+-      set_config_option(HAVE_VOROPP "Voro++")
+-    endif()
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/blossom AND ENABLE_BLOSSOM)
+-    add_subdirectory(contrib/blossom)
+-    include_directories(contrib/blossom/MATCH contrib/blossom/concorde97
+-                        contrib/blossom/concorde97/INCLUDE)
+-    set_config_option(HAVE_BLOSSOM "Blossom")
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/Netgen AND ENABLE_NETGEN)
+-    add_subdirectory(contrib/Netgen)
+-    include_directories(contrib/Netgen contrib/Netgen/libsrc/include
+-                        contrib/Netgen/nglib)
+-    set_config_option(HAVE_NETGEN "Netgen")
+-    add_definitions(-DNO_PARALLEL_THREADS -DNOTCL)
+-  endif()
+-
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/bamg AND ENABLE_BAMG)
+-    add_subdirectory(contrib/bamg)
+-    include_directories(contrib/bamg contrib/bamg/bamglib)
+-    set_config_option(HAVE_BAMG "Bamg")
+-  endif()
+-
+-  if(ENABLE_MMG)
+-    find_library(MMG_LIB NAMES Mmg mmg)
+-    find_path(MMG_INC "libmmg.h" PATH_SUFFIXES mmg)
+-    if(MMG_LIB AND MMG_INC)
+-      list(APPEND EXTERNAL_LIBRARIES ${MMG_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${MMG_INC})
+-      set_config_option(HAVE_MMG "Mmg")
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_MED OR ENABLE_CGNS)
+-  find_package(HDF5)
+-  if(HDF5_FOUND)
+-    set(HDF5_LIB "${HDF5_C_LIBRARIES}")
+-    list(APPEND EXTERNAL_INCLUDES ${HDF5_INCLUDE_DIRS})
+-    if(ENABLE_MED)
+-      find_library(MED_LIB medC)
+-      if(MED_LIB)
+-        set_config_option(HAVE_MED "Med")
+-        list(APPEND EXTERNAL_LIBRARIES ${MED_LIB})
+-      endif()
+-    endif()
+-    if(ENABLE_CGNS)
+-      find_library(CGNS_LIB cgns HINTS ENV CGNS_ROOT PATH_SUFFIXES lib)
+-      find_path(CGNS_INC "cgnslib.h" HINTS ENV CGNS_ROOT PATH_SUFFIXES include)
+-      if(CGNS_LIB AND CGNS_INC)
+-        set_config_option(HAVE_LIBCGNS "Cgns")
+-        list(APPEND EXTERNAL_LIBRARIES ${CGNS_LIB})
+-        list(APPEND EXTERNAL_INCLUDES ${CGNS_INC})
+-        if(ENABLE_CGNS_CPEX0045)
+-          set_config_option(HAVE_LIBCGNS_CPEX0045 "Cgns_CPEX0045")
+-        endif()
+-      endif()
+-    endif()
+-    if(MED_LIB OR CGNS_LIB)
+-      list(APPEND EXTERNAL_LIBRARIES ${HDF5_LIB})
+-      find_library(SZ_LIB NAMES szlib sz)
+-      if(SZ_LIB)
+-        list(APPEND EXTERNAL_LIBRARIES ${SZ_LIB})
+-      endif()
+-      if(NOT HAVE_LIBZ) # necessary for non-GUI builds
+-        find_package(ZLIB)
+-        if(ZLIB_FOUND)
+-          set_config_option(HAVE_LIBZ "Zlib")
+-          list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
+-        endif()
+-      endif()
+-    endif()
+-  else()
+-    message(STATUS "HDF5 not found")
+-  endif()
+-endif()
+-
+-if(HAVE_SOLVER)
+-  if(ENABLE_GMM)
+-    find_path(GMM_INC "gmm.h" PATH_SUFFIXES src include include/gmm)
+-    if(ENABLE_SYSTEM_CONTRIB AND GMM_INC)
+-      message(STATUS "Using system version of GMM")
+-      list(APPEND EXTERNAL_INCLUDES ${GMM_INC})
+-      set_config_option(HAVE_GMM "Gmm[system]")
+-    elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/gmm)
+-      include_directories(contrib/gmm)
+-      set_config_option(HAVE_GMM "Gmm")
+-    endif()
+-  endif()
+-
+-  if(ENABLE_PETSC)
+-    if(PETSC_DIR)
+-      set(ENV_PETSC_DIR ${PETSC_DIR})
+-    else()
+-      set(ENV_PETSC_DIR $ENV{PETSC_DIR})
+-    endif()
+-    if(PETSC_ARCH)
+-      set(ENV_PETSC_ARCH ${PETSC_ARCH})
+-    else()
+-      set(ENV_PETSC_ARCH $ENV{PETSC_ARCH})
+-    endif()
+-    set(PETSC_POSSIBLE_CONF_FILES
+-        ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/conf/petscvariables
+-        ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc-conf/petscvariables
+-        ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib/petsc/conf/petscvariables)
+-    foreach(FILE ${PETSC_POSSIBLE_CONF_FILES})
+-      if(EXISTS ${FILE})
+-        # old-style PETSc installations (using PETSC_DIR and PETSC_ARCH)
+-        message(STATUS "Using PETSc dir: ${ENV_PETSC_DIR}")
+-        message(STATUS "Using PETSc arch: ${ENV_PETSC_ARCH}")
+-        # find includes by parsing the petscvariables file
+-        file(STRINGS ${FILE} PETSC_VARIABLES NEWLINE_CONSUME)
+-      endif()
+-    endforeach()
+-    if(PETSC_VARIABLES)
+-      # try to find PETSC_CC_INCLUDES for PETSc >= 3.4
+-      string(REGEX MATCH "PETSC_CC_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
+-             ${PETSC_VARIABLES})
+-      if(PETSC_PACKAGES_INCLUDES)
+-        string(REPLACE "PETSC_CC_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
+-               ${PETSC_PACKAGES_INCLUDES})
+-      else()
+-        # try to find PETSC_PACKAGES_INCLUDES in older versions
+-        list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/include)
+-        list(APPEND EXTERNAL_INCLUDES ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/include)
+-        string(REGEX MATCH "PACKAGES_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
+-               ${PETSC_VARIABLES})
+-        string(REPLACE "PACKAGES_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
+-               ${PETSC_PACKAGES_INCLUDES})
+-      endif()
+-      if(PETSC_PACKAGES_INCLUDES)
+-        if(PETSC_PACKAGES_INCLUDES)
+-          string(REPLACE "-I" "" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
+-          string(REPLACE " " ";" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
+-          foreach(VAR ${PETSC_PACKAGES_INCLUDES})
+-            # seem to include unexisting directories (/usr/include/lib64)
+-	    # check to avoid warnings
+-	    if(EXISTS ${VAR})
+-	      list(APPEND EXTERNAL_INCLUDES ${VAR})
+-            endif()
+-          endforeach()
+-        endif()
+-      endif()
+-      # find libraries (<= 3.0)
+-      set(PETSC_LIBS_REQUIRED petscksp petscdm petscmat petscvec petsc)
+-      find_all_libraries(PETSC_LIBS PETSC_LIBS_REQUIRED
+-                         ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib "")
+-      # petsc 3.1 creates only one library (libpetsc)
+-      if(NOT PETSC_LIBS)
+-        find_library(PETSC_LIBS petsc PATHS ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib
+-                     NO_DEFAULT_PATH)
+-      endif()
+-      if(PETSC_LIBS)
+-        set_config_option(HAVE_PETSC "PETSc")
+-	if(NOT HAVE_BLAS)
+-          set_config_option(HAVE_BLAS "Blas[petsc]")
+-        endif()
+-	if(NOT HAVE_LAPACK)
+-          set_config_option(HAVE_LAPACK "Lapack[petsc]")
+-        endif()
+-      endif()
+-      # find slepc (needs to be linked in before petsc)
+-      if(ENABLE_SLEPC)
+-        if(SLEPC_DIR)
+-          set(ENV_SLEPC_DIR ${SLEPC_DIR})
+-         else()
+-          set(ENV_SLEPC_DIR $ENV{SLEPC_DIR})
+-        endif()
+-        find_library(SLEPC_LIB slepc PATHS ${ENV_SLEPC_DIR}/${ENV_PETSC_ARCH}/lib
+-                     NO_DEFAULT_PATH)
+-        if(SLEPC_LIB)
+-          find_path(SLEPC_INC "slepc.h" PATHS ${ENV_SLEPC_DIR} PATH_SUFFIXES include
+-                    ${ENV_PETSC_ARCH}/include include/slepc NO_DEFAULT_PATH)
+-          if(SLEPC_INC)
+-            message(STATUS "Using SLEPc dir: ${ENV_SLEPC_DIR}")
+-            set_config_option(HAVE_SLEPC "SLEPc")
+-            list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
+-            list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC})
+-            find_path(SLEPC_INC2 "slepcconf.h" PATHS ${ENV_SLEPC_DIR}
+-                      PATH_SUFFIXES ${ENV_PETSC_ARCH}/include NO_DEFAULT_PATH)
+-            if(SLEPC_INC2)
+-              list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC2})
+-            endif()
+-          endif()
+-        endif()
+-      endif()
+-      list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
+-      # find additional libraries to link with
+-      string(REGEX MATCH "PACKAGES_LIBS = [^\n\r]*" PLIBS ${PETSC_VARIABLES})
+-      if(PLIBS)
+-        string(REPLACE "PACKAGES_LIBS = " "" PLIBS ${PLIBS})
+-        string(STRIP ${PLIBS} PLIBS)
+-        list(APPEND EXTERNAL_LIBRARIES "${PLIBS}")
+-      endif()
+-      string(REGEX MATCH "PETSC_EXTERNAL_LIB_BASIC = [^\n\r]*" PLIBS_BASIC ${PETSC_VARIABLES})
+-      if(PLIBS_BASIC)
+-        string(REPLACE "PETSC_EXTERNAL_LIB_BASIC = " "" PLIBS_BASIC ${PLIBS_BASIC})
+-        string(STRIP ${PLIBS_BASIC} PLIBS_BASIC)
+-        separate_arguments(PLIBS_BASIC)
+-        list(APPEND EXTERNAL_LIBRARIES "${PLIBS_BASIC}")
+-      endif()
+-      string(REGEX MATCH "PCC_LINKER_LIBS = [^\n\r]*" LLIBS ${PETSC_VARIABLES})
+-      if(LLIBS)
+-        string(REPLACE "PCC_LINKER_LIBS = " "" LLIBS ${LLIBS})
+-        string(STRIP ${LLIBS} LLIBS)
+-        list(APPEND EXTERNAL_LIBRARIES "${LLIBS}")
+-      endif()
+-    else()
+-      # new-style PETSc installations (in standard system directories)
+-      find_library(PETSC_LIBS petsc)
+-      find_path(PETSC_INC "petsc.h" PATH_SUFFIXES include/petsc)
+-      if(PETSC_LIBS AND PETSC_INC)
+-        set_config_option(HAVE_PETSC "PETSc")
+-        if(ENABLE_SLEPC)
+-          find_library(SLEPC_LIB slepc)
+-          find_path(SLEPC_INC "slepc.h" PATH_SUFFIXES include/slepc)
+-          if(SLEPC_LIB AND SLEPC_INC)
+-            set_config_option(HAVE_SLEPC "SLEPc")
+-            list(APPEND EXTERNAL_LIBRARIES ${SLEPC_LIB})
+-            list(APPEND EXTERNAL_INCLUDES ${SLEPC_INC})
+-          endif()
+-        endif()
+-        list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
+-        list(APPEND EXTERNAL_INCLUDES ${PETSC_INC})
+-      endif()
+-    endif()
+-  endif()
+-
+-  if(ENABLE_MUMPS AND HAVE_BLAS AND HAVE_LAPACK)
+-    set(MUMPS_LIBS_REQUIRED smumps dmumps cmumps zmumps mumps_common pord)
+-    if(NOT ENABLE_MPI)
+-      list(APPEND MUMPS_LIBS_REQUIRED mpiseq)
+-    endif()
+-    find_all_libraries(MUMPS_LIBRARIES MUMPS_LIBS_REQUIRED "" "lib")
+-    find_path(SMUMPS_INC "smumps_c.h" PATH_SUFFIXES src include)
+-    find_path(DMUMPS_INC "dmumps_c.h" PATH_SUFFIXES src include)
+-    find_path(CMUMPS_INC "cmumps_c.h" PATH_SUFFIXES src include)
+-    find_path(ZMUMPS_INC "zmumps_c.h" PATH_SUFFIXES src include)
+-    if(MUMPS_LIBRARIES AND SMUMPS_INC AND DMUMPS_INC AND CMUMPS_INC AND ZMUMPS_INC)
+-      set_config_option(HAVE_MUMPS "MUMPS")
+-      list(APPEND EXTERNAL_LIBRARIES ${MUMPS_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${SMUMPS_INC})
+-      list(APPEND EXTERNAL_INCLUDES ${DMUMPS_INC})
+-      list(APPEND EXTERNAL_INCLUDES ${CMUMPS_INC})
+-      list(APPEND EXTERNAL_INCLUDES ${ZMUMPS_INC})
+-      find_library(GFORTRAN_LIB gfortran)
+-      if(GFORTRAN_LIB)
+-        list(APPEND EXTERNAL_LIBRARIES ${GFORTRAN_LIB})
+-      endif()
+-      if(ENABLE_GMM) # use GMM/MUMPS interface
+-        add_definitions(-DGMM_USES_MUMPS)
+-      endif()
+-    endif()
+-  endif()
+-
+-  if(ENABLE_GETDP)
+-    find_library(GETDP_LIB GetDP)
+-    find_path(GETDP_INC "GetDP.h" PATH_SUFFIXES getdp)
+-    if(GETDP_LIB AND GETDP_INC)
+-      set_config_option(HAVE_GETDP "GetDP")
+-      list(APPEND EXTERNAL_LIBRARIES ${GETDP_LIB})
+-      list(APPEND EXTERNAL_INCLUDES ${GETDP_INC})
+-    endif()
+-  endif()
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt AND ENABLE_HXT)
+-  add_subdirectory(contrib/hxt)
+-  include_directories(BEFORE ${HXT_INC_DIRS})
+-  set_config_option(HAVE_HXT "Hxt")
+-  # do not use arithmetic contraction in predicates.c
+-  if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND WIN32))
+-    set_source_files_properties(
+-        "${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
+-        PROPERTIES COMPILE_FLAGS "/fp:strict")
+-  elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
+-    set_source_files_properties(
+-        "${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
+-        PROPERTIES COMPILE_FLAGS "-fp-model strict")
+-  elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
+-    set_source_files_properties(
+-        "${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
+-        PROPERTIES COMPILE_FLAGS  "-fno-unsafe-math-optimizations -ffp-contract=off")
+-  else()
+-    message(WARNING
+-      "Unsupported compiler !
+-       Make sure compiled functions from predicates.c
+-       do NOT use extended double precision and follow IEEE754 standard.
+-       It is crucial for the robustness of geometric predicates.")
+-  endif()
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/pro AND ENABLE_PRO)
+-  add_subdirectory(pro)
+-endif()
+-
+-if(ENABLE_OCC)
+-  set(OCC_MINIMAL_VERSION "6.9.1")
+-  if(WIN32)
+-    if(HAVE_64BIT_SIZE_T)
+-      set(OCC_SYS_NAME win64)
+-    else()
+-      set(OCC_SYS_NAME win32)
+-    endif()
+-  else()
+-    set(OCC_SYS_NAME ${CMAKE_SYSTEM_NAME})
+-  endif()
+-  find_path(OCC_INC "Standard_Version.hxx" HINTS ENV CASROOT PATH_SUFFIXES
+-            inc include include/oce opencascade include/opencascade
+-            occt include/occt)
+-  if(OCC_INC)
+-    file(STRINGS ${OCC_INC}/Standard_Version.hxx
+-         OCC_MAJOR REGEX "#define OCC_VERSION_MAJOR.*")
+-    file(STRINGS ${OCC_INC}/Standard_Version.hxx
+-         OCC_MINOR REGEX "#define OCC_VERSION_MINOR.*")
+-    file(STRINGS ${OCC_INC}/Standard_Version.hxx
+-         OCC_MAINT REGEX "#define OCC_VERSION_MAINTENANCE.*")
+-    if(OCC_MAJOR AND OCC_MINOR AND OCC_MAINT)
+-      string(REGEX MATCH "[0-9]+" OCC_MAJOR "${OCC_MAJOR}")
+-      string(REGEX MATCH "[0-9]+" OCC_MINOR "${OCC_MINOR}")
+-      string(REGEX MATCH "[0-9]+" OCC_MAINT "${OCC_MAINT}")
+-      set(OCC_VERSION "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
+-      message(STATUS "Found OpenCASCADE version ${OCC_VERSION} in ${OCC_INC}")
+-    endif()
+-  endif()
+-  if(OCC_VERSION AND OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
+-    message(WARNING "Gmsh requires OpenCASCADE >= ${OCC_MINIMAL_VERSION}. "
+-        "Use CMAKE_PREFIX_PATH or the CASROOT environment variable "
+-        "to explicitely specify the installation path of OpenCASCADE")
+-  elseif(OCC_INC)
+-    set(OCC_LIBS_REQUIRED
+-	# subset of DataExchange
+-      	TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
+-      	# ModelingAlgorithms
+-      	TKOffset TKFeat TKFillet TKBool TKMesh TKHLR TKBO TKPrim TKShHealing
+-      	TKTopAlgo TKGeomAlgo
+-      	# ModelingData
+-      	TKBRep TKGeomBase TKG3d TKG2d
+-      	# FoundationClasses
+-      	TKMath TKernel)
+-    if(ENABLE_OCC_TBB)
+-      list(APPEND OCC_LIBS_REQUIRED tbb tbbmalloc)
+-    endif()
+-    list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS_REQUIRED)
+-    if(OCC_LIBS)
+-      message(STATUS "OCC libraries specified explicitly: " ${OCC_LIBS})
+-      list(LENGTH OCC_LIBS_REQUIRED NUM_OCC_LIBS)
+-    else()
+-      set(OCC_LIBS)
+-      foreach(OCC ${OCC_LIBS_REQUIRED})
+-        find_library(OCC_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES
+-                     lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib
+-                     ${OCC_SYS_NAME}/gcc/lib ${OCC_SYS_NAME}/gcc/bin)
+-        if(OCC_LIB)
+-	  list(APPEND OCC_LIBS ${OCC_LIB})
+-        else()
+-          message(STATUS "OCC lib " ${OCC} " not Found")
+-        endif()
+-        unset(OCC_LIB CACHE)
+-      endforeach()
+-      list(LENGTH OCC_LIBS NUM_OCC_LIBS)
+-    endif()
+-  endif()
+-
+-  # additional OCC libraries to handle reading of STEP/IGES attributes. Oh my...
+-  if(ENABLE_OCC_CAF)
+-    find_package(Freetype)
+-    if(FREETYPE_FOUND)
+-      set(OCC_CAF_LIBS_REQUIRED
+-          TKXDESTEP TKXDEIGES TKXCAF TKLCAF TKVCAF TKCAF TKV3d TKService TKCDF)
+-      list(LENGTH OCC_CAF_LIBS_REQUIRED NUM_OCC_CAF_LIBS_REQUIRED)
+-      set(OCC_CAF_LIBS)
+-      foreach(OCC ${OCC_CAF_LIBS_REQUIRED})
+-        find_library(OCC_CAF_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES
+-                     lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib
+-                     ${OCC_SYS_NAME}/gcc/lib ${OCC_SYS_NAME}/gcc/bin)
+-        if(OCC_CAF_LIB)
+-          list(APPEND OCC_CAF_LIBS ${OCC_CAF_LIB})
+-        else()
+-          message(STATUS "OCC CAF lib " ${OCC} " not Found")
+-        endif()
+-        unset(OCC_CAF_LIB CACHE)
+-      endforeach()
+-      list(LENGTH OCC_CAF_LIBS NUM_OCC_CAF_LIBS)
+-    endif()
+-  endif()
+-
+-  if(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
+-    # append OCC CAF libraries first...
+-    if(NUM_OCC_CAF_LIBS EQUAL NUM_OCC_CAF_LIBS_REQUIRED)
+-      set_config_option(HAVE_OCC_CAF "OpenCASCADE-CAF")
+-      list(APPEND EXTERNAL_LIBRARIES ${OCC_CAF_LIBS} ${FREETYPE_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${FREETYPE_INCLUDE_DIRS})
+-      if(WIN32)
+-        list(APPEND EXTERNAL_LIBRARIES "windowscodecs")
+-        list(APPEND EXTERNAL_LIBRARIES "ole32")
+-      endif()
+-    endif()
+-    # then append OCC libraries
+-    set_config_option(HAVE_OCC "OpenCASCADE")
+-    list(APPEND EXTERNAL_LIBRARIES ${OCC_LIBS})
+-    list(APPEND EXTERNAL_INCLUDES ${OCC_INC})
+-    if(HAVE_64BIT_SIZE_T)
+-      add_definitions(-D_OCC64)
+-    endif()
+-    if(WIN32)
+-      list(APPEND EXTERNAL_LIBRARIES "winspool")
+-      add_definitions(-DOCC_CONVERT_SIGNALS)
+-    elseif(MSVC)
+-      add_definitions(-DWNT)
+-    endif()
+-  endif()
+-endif()
+-
+-if(ENABLE_ZIPPER)
+-  if(ENABLE_BUILD_IOS)
+-    set_config_option(HAVE_LIBZ "Zlib")
+-  endif()
+-  if(NOT HAVE_LIBZ) # necessary for non-GUI builds
+-    find_package(ZLIB)
+-    if(ZLIB_FOUND)
+-      set_config_option(HAVE_LIBZ "Zlib")
+-      list(APPEND EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
+-      list(APPEND EXTERNAL_INCLUDES ${ZLIB_INCLUDE_DIR})
+-    endif()
+-  endif()
+-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zipper AND HAVE_LIBZ)
+-    add_subdirectory(contrib/zipper)
+-    include_directories(contrib/zipper)
+-    set_config_option(HAVE_ZIPPER "Zipper")
+-  endif()
+-endif()
+-
+-if(ENABLE_PRIVATE_API AND ENABLE_WRAP_PYTHON)
+-  find_package(SWIG REQUIRED)
+-  include(${SWIG_USE_FILE})
+-  find_package(PythonLibs)
+-  if(SWIG_FOUND AND PYTHONLIBS_FOUND)
+-    message(STATUS "Found SWIG version " ${SWIG_VERSION})
+-    find_package(PythonInterp)
+-    string(SUBSTRING ${SWIG_VERSION} 0 1 SWIG_MAJOR_VERSION)
+-    if(SWIG_MAJOR_VERSION EQUAL 1)
+-      message(WARNING "Python bindings require SWIG >= 2: disabling Python")
+-    else()
+-      set_config_option(HAVE_PYTHON "Python")
+-      mark_as_advanced(CLEAR PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
+-      if(ENABLE_NUMPY)
+-        if (NOT NUMPY_INC)
+-          EXEC_PROGRAM (${PYTHON_EXECUTABLE}
+-            ARGS "-c \"import numpy; print(numpy.get_include())\""
+-            OUTPUT_VARIABLE NUMPY_INC
+-            RETURN_VALUE NUMPY_NOT_FOUND)
+-        endif()
+-        if(NUMPY_INC)
+-          list(APPEND EXTERNAL_INCLUDES ${NUMPY_INC})
+-          set_config_option(HAVE_NUMPY "Numpy")
+-        endif()
+-      endif()
+-      if(HAVE_PETSC)
+-        if(ENABLE_PETSC4PY)
+-          EXECUTE_PROCESS(
+-            COMMAND ${PYTHON_EXECUTABLE} -c "import petsc4py; print(petsc4py.get_include())"
+-            OUTPUT_VARIABLE PETSC4PY_INC
+-            RESULT_VARIABLE PETSC4PY_NOT_FOUND
+-            ERROR_QUIET
+-            OUTPUT_STRIP_TRAILING_WHITESPACE)
+-          if(PETSC4PY_INC)
+-            list(APPEND EXTERNAL_INCLUDES ${PETSC4PY_INC})
+-            set_config_option(HAVE_PETSC4PY "PETSc4py")
+-          endif()
+-        endif()
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-check_function_exists(vsnprintf HAVE_VSNPRINTF)
+-if(NOT HAVE_VSNPRINTF AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
+-  set_config_option(HAVE_NO_VSNPRINTF "NoVsnprintf")
+-endif()
+-
+-check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
+-if(HAVE_SYS_SOCKET_H)
+-  set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
+-endif()
+-check_type_size(socklen_t SOCKLEN_T_SIZE)
+-set(CMAKE_EXTRA_INCLUDE_FILES)
+-if(NOT SOCKLEN_T_SIZE AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
+-  set_config_option(HAVE_NO_SOCKLEN_T "NoSocklenT")
+-endif()
+-
+-check_include_file(stdint.h HAVE_STDINT_H)
+-if(HAVE_STDINT_H)
+-  set(CMAKE_EXTRA_INCLUDE_FILES stdint.h)
+-else()
+-  set_config_option(HAVE_NO_STDINT_H "NoStdintH")
+-endif()
+-check_type_size(intptr_t INTPTR_T_SIZE)
+-set(CMAKE_EXTRA_INCLUDE_FILES)
+-if(NOT INTPTR_T_SIZE AND NOT ENABLE_BUILD_IOS AND NOT ENABLE_BUILD_ANDROID)
+-  set_config_option(HAVE_NO_INTPTR_T "NoIntptrT")
+-endif()
+-
+-check_include_file(dlfcn.h DLFCN_H)
+-if(DLFCN_H)
+-  set_config_option(HAVE_DLOPEN "Dlopen")
+-  list(APPEND EXTERNAL_LIBRARIES ${CMAKE_DL_LIBS})
+-endif()
+-
+-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-  check_include_file(linux/joystick.h LINUX_JOYSTICK_H)
+-  if(LINUX_JOYSTICK_H)
+-    set_config_option(HAVE_LINUX_JOYSTICK "LinuxJoystick")
+-  endif()
+-endif()
+-
+-if(WIN32)
+-  add_definitions(-D_USE_MATH_DEFINES)
+-  list(APPEND EXTERNAL_LIBRARIES winmm wsock32 ws2_32 psapi)
+-endif()
+-
+-if(MSVC)
+-  add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE)
+-endif()
+-
+-# add C functions API
+-set(GMSH_SRC ${GMSH_SRC};api/gmshc.cpp)
+-
+-# force full warnings to encourage everybody to write clean(er) code
+-check_cxx_compiler_flag("-Wall" WALL)
+-if(WALL AND NOT MSVC)
+-  file(GLOB_RECURSE WALL_SRC Common/*.cpp Fltk/*.cpp FunctionSpace/*.cpp
+-       Geo/*.cpp Graphics/*.cpp Mesh/*.cpp Numeric/*.cpp Parser/*.cpp
+-       Plugin/*.cpp Post/*.cpp Solver/*.cpp)
+-  set(WF "-Wall")
+-  check_cxx_compiler_flag("-Wint-to-void-pointer-cast" WCAST)
+-  if(WCAST)
+-    set(WF "${WF} -Wno-int-to-void-pointer-cast")
+-  endif()
+-  check_cxx_compiler_flag("-Wdeprecated-declarations" WDEPREC)
+-  if(WDEPREC)
+-    # FIXME: remove this when we have fixed the deprecated GLU code for OpenGL3
+-    set(WF "${WF} -Wno-deprecated-declarations")
+-  endif()
+-  check_cxx_compiler_flag("-Wmisleading-indentation" WIND)
+-  if(WIND)
+-    set(WF "${WF} -Wno-misleading-indentation")
+-  endif()
+-  check_cxx_compiler_flag("-Wno-attributes" WATTR)
+-  if(WATTR)
+-    # FIXME: remove this when GCC behaves more intelligently
+-    set(WF "${WF} -Wno-attributes")
+-  endif()
+-  set_compile_flags(WALL_SRC ${WF})
+-endif()
+-
+-# don't issue warnings for contributed libraries
+-check_cxx_compiler_flag("-w" NOWARN)
+-if(NOWARN)
+-  file(GLOB_RECURSE NOWARN_SRC contrib/*.cpp contrib/*.cc contrib/*.cxx contrib/*.c)
+-  set_compile_flags(NOWARN_SRC "-w")
+-endif()
+-
+-# disable compile optimization on some known problematic files
+-check_cxx_compiler_flag("-O0" NOOPT)
+-if(NOOPT OR ENABLE_BUILD_IOS)
+-  if(ENABLE_BUILD_IOS) # optimized iOS 10 64 bits screws somewhere in Geo
+-    file(GLOB_RECURSE NOOPT_SRC Numeric/robustPredicates.cpp Geo/G*.cpp Mesh/BDS.cpp
+-         Parser/Gmsh.tab.cpp contrib/blossom/* Mesh/Background*)
+-  else()
+-    file(GLOB_RECURSE NOOPT_SRC Numeric/robustPredicates.cpp Mesh/BDS.cpp
+-         Parser/Gmsh.tab.cpp contrib/blossom/* contrib/bamg/* Mesh/Background*)
+-  endif()
+-  set_compile_flags(NOOPT_SRC "-O0")
+-endif()
+-
+-# do not use arithmetic contraction in predicates.cpp
+-# if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+-#   set_source_files_properties(Numeric/robustPredicates.cpp PROPERTIES
+-#     COMPILE_FLAGS "/fp:strict")
+-# elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
+-#   set_source_files_properties(Numeric/robustPredicates.cpp PROPERTIES
+-#     COMPILE_FLAGS "-fno-unsafe-math-optimizations -ffp-contract=off")
+-# elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
+-#   set_source_files_properties(Numeric/robustPredicates.cpp PROPERTIES
+-#     COMPILE_FLAGS "-fp-model strict")
+-# endif()
+-
+-# enable Revoropt and set compile flags for the corresponding plugin
+-if(ENABLE_REVOROPT)
+-  if(HAVE_EIGEN AND HAVE_MESH AND HAVE_PLUGINS AND HAVE_ANN AND HAVE_ALGLIB)
+-    list(APPEND EXTERNAL_INCLUDES contrib/Revoropt/include)
+-    set_config_option(HAVE_REVOROPT "Revoropt")
+-    add_definitions(-DUSE_ANN)
+-  else()
+-    message(WARNING "Revoropt requires Eigen, Mesh, Plugins, ANN and ALGLIB")
+-  endif()
+-endif()
+-
+-if(HAVE_MESH AND NOT HAVE_EIGEN AND NOT HAVE_LAPACK)
+-  message(WARNING "Most meshing algorithms will not be functional without "
+-          "Eigen or Lapack")
+-endif()
+-
+-list(SORT CONFIG_OPTIONS)
+-set(GMSH_CONFIG_OPTIONS "")
+-foreach(OPT ${CONFIG_OPTIONS})
+-  set(GMSH_CONFIG_OPTIONS "${GMSH_CONFIG_OPTIONS} ${OPT}")
+-endforeach()
+-
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Common/GmshConfig.h.in
+-               ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Common/GmshVersion.h.in
+-               ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h)
+-
+-# the texi and pypi version files are modified in the source directory (not
+-# ideal for version.texi, but since git tracks the contents of the file this is
+-# acceptable as it will only change when the actual version is changed - not for
+-# each git hash; setup.py is not under version control)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo/version.texi.in
+-               ${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo/version.texi)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/gmsh/setup.py.in
+-               ${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/gmsh/setup.py)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/gmsh-dev/setup.py.in
+-               ${CMAKE_CURRENT_SOURCE_DIR}/utils/pypi/gmsh-dev/setup.py)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.txt ${GMSH_SHORT_VERSION})
+-
+-# process cmake environment variables so we can append them to the -I include
+-# commands. This is not recommended (we should only use the cache variables) but
+-# it is very convenient: otherwise we have to remember providing the
+-# -D... options to cmake for each new build.
+-set(ENV_CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
+-set(ENV_CMAKE_INCLUDE_PATH $ENV{CMAKE_INCLUDE_PATH})
+-if(UNIX)
+-  if(ENV_CMAKE_PREFIX_PATH)
+-    string(REPLACE ":" ";" ENV_CMAKE_PREFIX_PATH ${ENV_CMAKE_PREFIX_PATH})
+-  endif()
+-  if(ENV_CMAKE_INCLUDE_PATH)
+-    string(REPLACE ":" ";" ENV_CMAKE_INCLUDE_PATH ${ENV_CMAKE_INCLUDE_PATH})
+-  endif()
+-endif()
+-list(APPEND EXTERNAL_INCLUDES ${CMAKE_INCLUDE_PATH} ${ENV_CMAKE_INCLUDE_PATH})
+-list(APPEND EXTERNAL_INCLUDES ${CMAKE_PREFIX_PATH} ${ENV_CMAKE_PREFIX_PATH})
+-foreach(DIR ${CMAKE_PREFIX_PATH} ${ENV_CMAKE_PREFIX_PATH})
+-  list(APPEND EXTERNAL_INCLUDES ${DIR}/include)
+-endforeach()
+-
+-if(EXTERNAL_INCLUDES)
+-  list(REMOVE_DUPLICATES EXTERNAL_INCLUDES)
+-endif()
+-
+-if(HAVE_FLTK)
+-  set(LINK_LIBRARIES ${FLTK_LIBRARIES} ${EXTERNAL_LIBRARIES}
+-                     ${OPENGL_LIBRARIES} ${LAPACK_LIBRARIES})
+-elseif(HAVE_OPENGL)
+-  set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${OPENGL_LIBRARIES}
+-                     ${LAPACK_LIBRARIES})
+-else()
+-  set(LINK_LIBRARIES ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
+-endif()
+-
+-# try to use static gfortran on static builds (cannot do this on dynamic builds
+-# as e.g. Debian compiles libgfortran.a without -fPIC: sigh...)
+-if(NOT ENABLE_BUILD_DYNAMIC AND NOT ENABLE_BUILD_SHARED)
+-  find_library(GFORTRAN_STATIC libgfortran.a)
+-  if(GFORTRAN_STATIC)
+-    set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES)
+-    message(STATUS "Using static libgfortran")
+-    foreach(STR ${LINK_LIBRARIES})
+-      string(REPLACE "-lgfortran" ${GFORTRAN_STATIC} STR2 ${STR})
+-      list(APPEND LINK_LIBRARIES2 ${STR2})
+-    endforeach()
+-    set(LINK_LIBRARIES ${LINK_LIBRARIES2})
+-  endif()
+-endif()
+-
+-# Linux-specific linker options
+-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-  if(HAVE_OCC)
+-    find_library(RT_LIB rt)
+-    if(RT_LIB)
+-      list(APPEND LINK_LIBRARIES ${RT_LIB})
+-    endif()
+-  endif()
+-  if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
+-    add_definitions(-fPIC)
+-  endif()
+-endif()
+-
+-# we could specify include dirs more selectively, but this is simpler
+-include_directories(Common Fltk Geo Graphics Mesh Solver Numeric Parser
+-  Plugin Post api ${EXTERNAL_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/Common)
+-
+-# set this for external codes that might include this CMakeList file
+-set(GMSH_EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDES} CACHE
+-    STRING "External include directories" FORCE)
+-set(GMSH_EXTERNAL_LIBRARIES ${LINK_LIBRARIES} CACHE
+-    STRING "External libraries" FORCE)
+-
+-# group sources for easier navigation in IDEs
+-foreach(DIR ${GMSH_DIRS})
+-  string(REGEX REPLACE "\\+" "\\\\+" DIR ${DIR})
+-  source_group(${DIR} REGULAR_EXPRESSION ${DIR}/.*)
+-endforeach()
+-
+-# static library target
+-if(ENABLE_BUILD_LIB)
+-  add_library(lib STATIC ${GMSH_SRC})
+-  set_target_properties(lib PROPERTIES OUTPUT_NAME gmsh)
+-  if(MSVC)
+-    set_target_properties(lib PROPERTIES DEBUG_POSTFIX d)
+-    if(ENABLE_MSVC_STATIC_RUNTIME)
+-      set_target_properties(lib PROPERTIES LINK_FLAGS_RELEASE "/nodefaultlib:LIBCMT")
+-    endif()
+-  endif()
+-endif()
+-
+-# shared library target
+-if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
+-  add_library(shared SHARED ${GMSH_SRC})
+-  set_target_properties(shared PROPERTIES OUTPUT_NAME gmsh
+-     VERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}
+-     SOVERSION ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION})
+-  if(WIN32)
+-    set_target_properties(shared PROPERTIES PREFIX "" IMPORT_PREFIX ""
+-      IMPORT_SUFFIX ".lib" COMPILE_FLAGS "-DGMSH_DLL -DGMSH_DLL_EXPORT")
+-  endif()
+-  target_link_libraries(shared ${LINK_LIBRARIES})
+-  # don't define LC_RPATH in dylib for development, to not get endless warnings
+-  # about code signing
+-  if(APPLE AND NOT GMSH_RELEASE)
+-    set_target_properties(shared PROPERTIES INSTALL_RPATH "")
+-  endif()
+-  if(MSVC AND ENABLE_MSVC_STATIC_RUNTIME)
+-    message(STATUS "Note: By enabling ENABLE_MSVC_STATIC_RUNTIME, shared library "
+-            "won't link. In MSVC change /MT to /MD in the shared project properties")
+-  endif()
+-endif()
+-
+-# binary targets
+-if(HAVE_FLTK)
+-  if(ENABLE_BUILD_DYNAMIC)
+-    add_executable(gmsh WIN32 Common/Main.cpp)
+-    target_link_libraries(gmsh shared)
+-  else()
+-    add_executable(gmsh WIN32 Common/Main.cpp ${GMSH_SRC})
+-  endif()
+-  # we could add this to create a minimal app bundle even without install
+-  # if(APPLE AND NOT ENABLE_OS_SPECIFIC_INSTALL)
+-  #  set_target_properties(gmsh PROPERTIES MACOSX_BUNDLE ON
+-  #    MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_dev.plist)
+-  # endif()
+-else()
+-  if(ENABLE_BUILD_DYNAMIC)
+-    add_executable(gmsh Common/Main.cpp)
+-    target_link_libraries(gmsh shared)
+-  else()
+-    add_executable(gmsh Common/Main.cpp ${GMSH_SRC})
+-  endif()
+-endif()
+-target_link_libraries(gmsh ${LINK_LIBRARIES})
+-
+-# Windows specific linker options
+-if(WIN32 AND NOT MSVC)
+-  set(FLAGS "-Wl,--stack,16777216 -static -municode")
+-  if(HAVE_FLTK)
+-    set(FLAGS "${FLAGS} -mwindows")
+-  else()
+-    set(FLAGS "${FLAGS} -mconsole")
+-  endif()
+-  if(HAVE_64BIT_SIZE_T)
+-    set(FLAGS "${FLAGS} \"${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win64Icon.res\"")
+-  else()
+-    set(FLAGS "${FLAGS} \"${CMAKE_CURRENT_SOURCE_DIR}/Fltk/Win32Icon.res\"")
+-  endif()
+-  set_target_properties(gmsh PROPERTIES LINK_FLAGS "${FLAGS}")
+-  if(ENABLE_BUILD_DYNAMIC OR ENABLE_BUILD_SHARED)
+-    set_target_properties(shared PROPERTIES LINK_FLAGS -static)
+-  endif()
+-  # remove -Wl,-Bdynamic flags
+-  set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)
+-  set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
+-elseif(MSVC)
+-  set_target_properties(gmsh PROPERTIES LINK_FLAGS "/STACK:16777216 /SAFESEH:NO")
+-endif()
+-
+-# android target
+-if(ENABLE_BUILD_ANDROID)
+-  find_file(CMAKE_TOOLCHAIN_FILE "android.toolchain.cmake")
+-  if(NOT CMAKE_TOOLCHAIN_FILE)
+-    message(FATAL_ERROR "Cannot compile Gmsh for android without android-cmake")
+-  endif()
+-  add_definitions(-D_GLIBCXX_USE_C99_MATH=1)
+-  set(CMAKE_BUILD_TYPE Release)
+-  set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR})
+-  set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/libs/)
+-  add_definitions(-DBUILD_ANDROID)
+-  add_definitions(-DPICOJSON_USE_LOCALE=0)
+-  add_library(androidGmsh SHARED ${GMSH_SRC})
+-  set_target_properties(androidGmsh PROPERTIES OUTPUT_NAME gmsh)
+-  target_link_libraries(androidGmsh ${EXTERNAL_LIBRARIES} ${LAPACK_LIBRARIES})
+-  add_custom_command(TARGET androidGmsh POST_BUILD COMMAND
+-                     ${CMAKE_STRIP} ${LIBRARY_OUTPUT_PATH}/libgmsh.so)
+-endif()
+-
+-# parser target
+-find_program(BISON bison)
+-find_program(FLEX flex)
+-if(BISON AND FLEX)
+-  add_custom_target(parser
+-                    COMMAND ${BISON} -p gmsh_yy --output Gmsh.tab.cpp -d Gmsh.y
+-                    COMMAND ${FLEX} -P gmsh_yy -o Gmsh.yy.cpp Gmsh.l
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Parser)
+-endif()
+-
+-if(UNIX)
+-  # cannot use cmake's file search functions here (they would only find files
+-  # existing at configuration time)
+-  add_custom_target(purge
+-                    COMMAND rm -f `find . -name *~ -o -name *~~`
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-  add_custom_target(etags
+-                    COMMAND etags `find . -name *.cpp -o -name *.h -o -name *.y`
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-endif()
+-
+-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
+-   CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
+-                  OUTPUT_VARIABLE CXX_COMPILER_VERSION
+-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+-else()
+-  set(CXX_COMPILER_VERSION "Unknown")
+-endif()
+-
+-set(WELCOME_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/WELCOME.txt)
+-set(SDK_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/SDK.txt)
+-set(LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt)
+-set(CREDITS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CREDITS.txt)
+-set(CHANGELOG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.txt)
+-file(GLOB TUTORIAL_GEO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/?*.*)
+-file(GLOB TUTORIAL_CPP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/c++/?*.*)
+-file(GLOB TUTORIAL_C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/c/?*.*)
+-file(GLOB TUTORIAL_PY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/python/?*.*)
+-file(GLOB TUTORIAL_JL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/julia/?*.*)
+-file(GLOB DEMOS ${CMAKE_CURRENT_SOURCE_DIR}/demos/*)
+-foreach(SUBDIR ${DEMOS})
+-  if(IS_DIRECTORY ${SUBDIR})
+-    list(APPEND DEMOS_DIRS ${SUBDIR})
+-  endif()
+-endforeach()
+-set(TEX_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc/texinfo)
+-file(GLOB TEX_SRC ${TEX_DIR}/*.texi)
+-set(TEX_OBJ ${TEX_DIR}/gmsh.aux ${TEX_DIR}/gmsh.cp ${TEX_DIR}/gmsh.cps
+-    ${TEX_DIR}/gmsh.fn ${TEX_DIR}/gmsh.html ${TEX_DIR}/gmsh.info ${TEX_DIR}/gmsh.ky
+-    ${TEX_DIR}/gmsh.log ${TEX_DIR}/gmsh.pdf ${TEX_DIR}/gmsh.pg ${TEX_DIR}/gmsh.toc
+-    ${TEX_DIR}/gmsh.tp ${TEX_DIR}/gmsh.tps ${TEX_DIR}/gmsh.txt ${TEX_DIR}/gmsh.vr)
+-
+-macro(unix2dos VARNAME)
+-  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unix2dos)
+-  set(UNIX2DOS_FILES)
+-  foreach(FILE ${${VARNAME}})
+-    file(READ ${FILE} F0)
+-    get_filename_component(N ${FILE} NAME)
+-    if(CYGWIN)
+-      string(REGEX REPLACE "\n" "\r\n" F1 "${F0}")
+-      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N} "${F1}")
+-    else() # if not in Cygwin, cmake adds '\r's automatically
+-      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N} "${F0}")
+-    endif()
+-    list(APPEND UNIX2DOS_FILES ${CMAKE_CURRENT_BINARY_DIR}/unix2dos/${N})
+-  endforeach()
+-  set(${VARNAME} ${UNIX2DOS_FILES})
+-endmacro()
+-
+-if(WIN32)
+-  if(ENABLE_OS_SPECIFIC_INSTALL)
+-    set(GMSH_BIN .)
+-    set(GMSH_LIB .)
+-    set(GMSH_DOC .)
+-    set(GMSH_MAN .)
+-    set(GMSH_INC .)
+-  else()
+-    include(GNUInstallDirs)
+-    set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
+-    set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
+-    set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
+-    set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
+-    set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
+-  endif()
+-  if(CYGWIN)
+-    unix2dos(GMSH_API)
+-    if(ENABLE_PRIVATE_API)
+-      unix2dos(GMSH_PRIVATE_API)
+-    endif()
+-    unix2dos(WELCOME_FILE)
+-    unix2dos(SDK_FILE)
+-    unix2dos(LICENSE_FILE)
+-    unix2dos(CREDITS_FILE)
+-    unix2dos(CHANGELOG_FILE)
+-    unix2dos(TUTORIAL_GEO_FILES)
+-    unix2dos(TUTORIAL_CPP_FILES)
+-    unix2dos(TUTORIAL_C_FILES)
+-    unix2dos(TUTORIAL_PY_FILES)
+-    unix2dos(TUTORIAL_JL_FILES)
+-    foreach(DIR ${DEMOS_DIRS})
+-      file(GLOB DEMO_FILES ${DIR}/?*.*)
+-      unix2dos(DEMO_FILES)
+-    endforeach()
+-  endif()
+-elseif(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
+-  # set these so that the files get installed nicely in the MacOSX
+-  # .app bundle
+-  set(GMSH_BIN ../MacOS)
+-  set(GMSH_LIB ../MacOS)
+-  set(GMSH_DOC ../../..)
+-  set(GMSH_MAN ../../..)
+-  set(GMSH_INC ../MacOS)
+-else()
+-  include(GNUInstallDirs)
+-  set(GMSH_BIN ${CMAKE_INSTALL_BINDIR})
+-  set(GMSH_LIB ${CMAKE_INSTALL_LIBDIR})
+-  set(GMSH_DOC ${CMAKE_INSTALL_DOCDIR})
+-  set(GMSH_MAN ${CMAKE_INSTALL_MANDIR}/man1)
+-  set(GMSH_INC ${CMAKE_INSTALL_INCLUDEDIR})
+-endif()
+-
+-# mark targets as optional so we can install them separately if needed
+-# (e.g. "make lib" or "make shared" followed by "make install/fast")
+-install(TARGETS gmsh DESTINATION ${GMSH_BIN} OPTIONAL)
+-if(ENABLE_BUILD_LIB)
+-  install(TARGETS lib DESTINATION ${GMSH_LIB} OPTIONAL)
+-endif()
+-if(ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
+-  install(TARGETS shared DESTINATION ${GMSH_LIB} OPTIONAL)
+-endif()
+-
+-if(ENABLE_ONELAB)
+-  install(FILES ${ONELAB_PY} DESTINATION ${GMSH_BIN})
+-endif()
+-if(ENABLE_BUILD_LIB OR ENABLE_BUILD_SHARED OR ENABLE_BUILD_DYNAMIC)
+-  install(FILES ${GMSH_API} DESTINATION ${GMSH_INC})
+-  install(FILES ${GMSH_PY} DESTINATION ${GMSH_LIB})
+-  install(FILES ${GMSH_JL} DESTINATION ${GMSH_LIB})
+-  if(ENABLE_PRIVATE_API)
+-    install(FILES ${GMSH_PRIVATE_API} DESTINATION ${GMSH_INC}/gmsh)
+-  endif()
+-endif()
+-if(INSTALL_SDK_README)
+-  configure_file(${SDK_FILE} ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
+-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/README.txt DESTINATION .)
+-endif()
+-install(FILES ${WELCOME_FILE} DESTINATION ${GMSH_DOC} RENAME README.txt)
+-install(FILES ${LICENSE_FILE} DESTINATION ${GMSH_DOC})
+-install(FILES ${CREDITS_FILE} DESTINATION ${GMSH_DOC})
+-install(FILES ${CHANGELOG_FILE} DESTINATION ${GMSH_DOC})
+-install(FILES ${TUTORIAL_GEO_FILES} DESTINATION ${GMSH_DOC}/tutorial)
+-install(FILES ${TUTORIAL_CPP_FILES} DESTINATION ${GMSH_DOC}/tutorial/c++)
+-install(FILES ${TUTORIAL_C_FILES} DESTINATION ${GMSH_DOC}/tutorial/c)
+-install(FILES ${TUTORIAL_PY_FILES} DESTINATION ${GMSH_DOC}/tutorial/python)
+-install(FILES ${TUTORIAL_JL_FILES} DESTINATION ${GMSH_DOC}/tutorial/julia)
+-foreach(DIR ${DEMOS_DIRS})
+-  get_filename_component(DEMOS_DIR_NAME ${DIR} NAME)
+-  file(GLOB DEMO_FILES ${DIR}/?*.*)
+-  install(FILES ${DEMO_FILES} DESTINATION ${GMSH_DOC}/demos/${DEMOS_DIR_NAME})
+-endforeach()
+-if(UNIX AND NOT CYGWIN)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/doc/gmsh.1 DESTINATION ${GMSH_MAN})
+-endif()
+-
+-add_custom_target(get_headers
+-  COMMAND ${CMAKE_COMMAND} -E make_directory Headers/gmsh
+-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+-foreach(FILE ${GMSH_API})
+-  add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
+-    -E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-endforeach()
+-if(ENABLE_PRIVATE_API)
+-  foreach(FILE ${GMSH_PRIVATE_API})
+-    add_custom_command(TARGET get_headers POST_BUILD COMMAND ${CMAKE_COMMAND}
+-      -E copy_if_different ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/Headers/gmsh/
+-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-  endforeach()
+-endif()
+-
+-find_program(MAKEINFO makeinfo)
+-if(MAKEINFO)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.info DEPENDS ${TEX_SRC}
+-                     COMMAND ${MAKEINFO} --split-size 1000000
+-                     ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(info DEPENDS ${TEX_DIR}/gmsh.info)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.txt DEPENDS ${TEX_SRC}
+-                     COMMAND ${MAKEINFO} --plaintext -o gmsh.txt
+-                     ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(txt DEPENDS ${TEX_DIR}/gmsh.txt)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.html DEPENDS ${TEX_SRC}
+-    COMMAND ${MAKEINFO} --html --css-ref=/gmsh.css
+-    --no-split --set-customization-variable
+-    EXTRA_HEAD='<meta name="viewport" content="width=device-width,initial-scale=1.0">'
+-    ARGS ${TEX_DIR}/gmsh.texi WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(html DEPENDS ${TEX_DIR}/gmsh.html)
+-  install(FILES ${TEX_DIR}/gmsh.html DESTINATION ${GMSH_DOC} OPTIONAL)
+-else()
+-  add_custom_target(html COMMAND ${CMAKE_COMMAND} -E touch ${TEX_DIR}/gmsh.html)
+-endif()
+-
+-find_program(TEXI2PDF texi2pdf)
+-if(TEXI2PDF)
+-  add_custom_command(OUTPUT ${TEX_DIR}/gmsh.pdf DEPENDS ${TEX_SRC}
+-                     COMMAND ${TEXI2PDF} ARGS gmsh.texi
+-                     WORKING_DIRECTORY ${TEX_DIR})
+-  add_custom_target(pdf DEPENDS ${TEX_DIR}/gmsh.pdf)
+-  install(FILES ${TEX_DIR}/gmsh.pdf DESTINATION ${GMSH_DOC} OPTIONAL)
+-endif()
+-
+-execute_process(COMMAND ${CMAKE_COMMAND} -E echo
+-  "@c This file was generated by cmake: do not edit manually!\n${OPT_TEXI}"
+-  OUTPUT_FILE cmake_options.texi)
+-
+-if(MAKEINFO AND TEXI2PDF)
+-  add_custom_target(doc COMMAND ${CMAKE_COMMAND} -E tar zcf
+-                    ${CMAKE_CURRENT_BINARY_DIR}/gmsh-${GMSH_VERSION}-doc.tgz
+-                    CREDITS.txt LICENSE.txt CHANGELOG.txt
+-                    doc/gmsh.1 doc/texinfo/gmsh.html doc/texinfo/gmsh.info
+-                    doc/texinfo/gmsh.pdf doc/texinfo/gmsh.txt
+-                    COMMAND ${CMAKE_COMMAND} -E remove ${TEX_OBJ}
+-                    DEPENDS ${TEX_DIR}/gmsh.info ${TEX_DIR}/gmsh.txt
+-                    ${TEX_DIR}/gmsh.html ${TEX_DIR}/gmsh.pdf
+-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-endif()
+-
+-if(MAKEINFO OR TEXI2PDF)
+-  add_custom_target(clean_doc COMMAND ${CMAKE_COMMAND} -E remove ${TEX_OBJ})
+-endif()
+-
+-if(APPLE AND ENABLE_BUILD_LIB)
+-  file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_framework.plist F0)
+-  string(REPLACE GMSH_VERSION "${GMSH_VERSION}" F1 "${F0}")
+-  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Info_framework.plist "${F1}")
+-  set(LIBNAME $<TARGET_FILE:lib>)
+-  add_custom_target(framework DEPENDS lib
+-    COMMAND ${CMAKE_COMMAND} -E remove_directory gmsh.framework
+-    COMMAND ${CMAKE_COMMAND} -E make_directory gmsh.framework/Headers
+-    COMMAND ${CMAKE_COMMAND} -E make_directory gmsh.framework/Resources
+-    COMMAND ${CMAKE_COMMAND} -E copy ${LIBNAME} gmsh.framework/gmsh
+-    COMMAND ${CMAKE_COMMAND} -E copy Info_framework.plist
+-                                     gmsh.framework/Resources/Info.plist
+-    COMMAND ${CMAKE_COMMAND} -E create_symlink . gmsh.framework/Headers/gmsh
+-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+-  foreach(FILE ${GMSH_API})
+-    add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+-        ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/gmsh.framework/Headers/
+-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-  endforeach()
+-  if(ENABLE_PRIVATE_API)
+-    foreach(FILE ${GMSH_PRIVATE_API})
+-      add_custom_command(TARGET framework POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
+-          ${FILE} ${CMAKE_CURRENT_BINARY_DIR}/gmsh.framework/Headers/
+-          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-    endforeach()
+-  endif()
+-endif()
+-
+-set(CPACK_PACKAGE_VENDOR "Christophe Geuzaine and Jean-Francois Remacle")
+-set(CPACK_PACKAGE_VERSION_MAJOR ${GMSH_MAJOR_VERSION})
+-set(CPACK_PACKAGE_VERSION_MINOR ${GMSH_MINOR_VERSION})
+-set(CPACK_PACKAGE_VERSION_PATCH ${GMSH_PATCH_VERSION})
+-set(CPACK_PACKAGE_DESCRIPTION_FILE ${WELCOME_FILE})
+-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
+-    "3D finite element mesh generator with built-in CAD engine and post-processor")
+-if(GMSH_EXTRA_VERSION MATCHES "-git.*") # so that we'll overwrite the archives
+-  set(CPACK_PACKAGE_FILE_NAME gmsh${GMSH_EXTRA_VERSION_ORIG}-git-${GMSH_OS})
+-  set(CPACK_SOURCE_PACKAGE_FILE_NAME gmsh${GMSH_EXTRA_VERSION_ORIG}-git-source)
+-else()
+-  set(CPACK_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-${GMSH_OS})
+-  set(CPACK_SOURCE_PACKAGE_FILE_NAME gmsh-${GMSH_VERSION}-source)
+-endif()
+-set(CPACK_PACKAGE_INSTALL_DIRECTORY "gmsh")
+-set(CPACK_RESOURCE_FILE_LICENSE ${LICENSE_FILE})
+-set(CPACK_RESOURCE_FILE_README ${WELCOME_FILE})
+-set(CPACK_RESOURCE_FILE_WELCOME ${WELCOME_FILE})
+-set(CPACK_PACKAGE_EXECUTABLE "gmsh")
+-if(ENABLE_PACKAGE_STRIP)
+-  set(CPACK_STRIP_FILES TRUE)
+-else()
+-  set(CPACK_STRIP_FILES FALSE)
+-endif()
+-set(CPACK_SOURCE_GENERATOR TGZ)
+-set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_BINARY_DIR}" "/CVS/" "/.svn" "/.git"
+-    "~$" "DS_Store$" "GmshConfig.h$" "GmshVersion.h$" "/benchmarks/" "/tmp/"
+-    "/bin/" "/lib/" "/nightly/" "GPATH" "GRTAGS" "GSYMS" "GTAGS" "/HTML/"
+-    "/contrib/3M/" "/contrib/Parasolid/")
+-
+-if(UNIX)
+-  # make sure we remove previous installs before doing the next one (on Mac for
+-  # example "make package; make package_source" would lead to huge file lists
+-  # getting generated due to the 'Applications' symlink in the bundle)
+-  set(CPACK_INSTALL_COMMANDS "rm -rf ${CMAKE_CURRENT_BINARY_DIR}/_CPack_Packages")
+-endif()
+-
+-if(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
+-  set(CPACK_GENERATOR Bundle)
+-  set(CPACK_BUNDLE_NAME Gmsh)
+-  file(READ ${CMAKE_CURRENT_SOURCE_DIR}/utils/misc/gmsh_app.plist F0)
+-  string(REPLACE GMSH_VERSION "${GMSH_VERSION}" F1 "${F0}")
+-  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist "${F1}")
+-  set(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
+-  set(CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIcons.icns)
+-  if(PACKAGER STREQUAL "geuzaine - removed: we sign on a separate machine")
+-    # codesigning requires CMake >= 3.2
+-    set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: Christophe Geuzaine")
+-  endif()
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsGeo.icns DESTINATION .
+-          RENAME GmshGeo.icns)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsMsh.icns DESTINATION .
+-          RENAME GmshMsh.icns)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsSol.icns DESTINATION .
+-          RENAME GmshSol.icns)
+-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIconsPos.icns DESTINATION .
+-          RENAME GmshPos.icns)
+-  set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/Fltk/MacIcons.icns)
+-elseif(WIN32)
+-  set(CPACK_GENERATOR ZIP)
+-else()
+-  set(CPACK_GENERATOR TGZ)
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/utils/wrappers/gmshpy AND
+-   ENABLE_PRIVATE_API AND ENABLE_WRAP_PYTHON AND HAVE_PYTHON)
+-  add_subdirectory(utils/wrappers/gmshpy)
+-endif()
+-
+-if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/utils/wrappers/java AND
+-   ENABLE_PRIVATE_API AND ENABLE_WRAP_JAVA)
+-  add_subdirectory(utils/wrappers/java)
+-endif()
+-
+-include(CPack)
+-
+-macro(filter_tests IN OUT)
+-  unset(${OUT})
+-  foreach(FILE ${IN})
+-    unset(BAD1)
+-    unset(BAD2)
+-    unset(BAD3)
+-    # OS-specific
+-    if(${GMSH_OS} MATCHES "Linux32")
+-      # OCC STL generation crashes on our Linux32 docker
+-      string(REGEX MATCH "t18" BAD1 ${FILE})
+-    endif()
+-    # OpenCASCADE
+-    if(NOT HAVE_OCC AND NOT BAD1 AND NOT BAD2 AND NOT BAD3)
+-      file(STRINGS ${FILE} BAD1 REGEX "^SetFactory.*OpenCASCADE.*")
+-      file(STRINGS ${FILE} BAD2 REGEX ".*occ\\.synchronize.*")
+-      file(STRINGS ${FILE} BAD3 REGEX ".*occ::synchronize.*")
+-    endif()
+-    # Metis
+-    if(NOT HAVE_METIS AND NOT BAD1 AND NOT BAD2 AND NOT BAD3)
+-      file(STRINGS ${FILE} BAD1 REGEX ".*PartitionMesh.*")
+-      file(STRINGS ${FILE} BAD2 REGEX ".*mesh\\.partition.*")
+-      file(STRINGS ${FILE} BAD3 REGEX ".*mesh::partition.*")
+-    endif()
+-    if(BAD1 OR BAD2 OR BAD3)
+-      message("Skipping test " ${FILE})
+-    else()
+-      list(APPEND ${OUT} ${FILE})
+-    endif()
+-  endforeach()
+-endmacro()
+-
+-if(NOT DISABLE_GMSH_TESTS)
+-  # disabling tests is useful when including this CMakeLists in an external project
+-  include(CTest)
+-  file(GLOB_RECURSE ALLFILES
+-       tutorial/*.geo demos/*.geo benchmarks/?d/*.geo benchmarks/extrude/*.geo
+-       benchmarks/occ/*.geo)
+-  filter_tests("${ALLFILES}" TESTFILES)
+-  foreach(TESTFILE ${TESTFILES})
+-    # use relative path for Cygwin/MinGW (the pure win exe built with the MinGW
+-    # compilers does not understand a full Cygwin-style path)
+-    FILE(RELATIVE_PATH TEST ${CMAKE_CURRENT_BINARY_DIR} ${TESTFILE})
+-    add_test(${TEST} ./gmsh ${TEST} -3 -nopopup -o ./tmp.msh)
+-  endforeach()
+-  # test c++ api tutorials with dynamic builds (except on 32 bit windows for
+-  # now: our win32 setup does not currently handle exceptions)
+-  if(ENABLE_BUILD_DYNAMIC AND NOT ${GMSH_OS} MATCHES "Windows32")
+-    file(GLOB_RECURSE ALLFILES tutorial/c++/*.cpp)
+-    filter_tests("${ALLFILES}" TESTFILES)
+-    foreach(TESTFILE ${TESTFILES})
+-      get_filename_component(TEST ${TESTFILE} NAME_WE)
+-      add_executable(${TEST} WIN32 ${TESTFILE})
+-      target_link_libraries(${TEST} shared)
+-      if(WIN32 AND NOT MSVC)
+-        set(FLAGS "-static")
+-        if(HAVE_FLTK)
+-          set(FLAGS "${FLAGS} -mwindows")
+-        else()
+-          set(FLAGS "${FLAGS} -mconsole")
+-        endif()
+-        set_target_properties(${TEST} PROPERTIES LINK_FLAGS "${FLAGS}")
+-      endif()
+-      add_test(${TEST}_cpp ${TEST} -nopopup)
+-    endforeach()
+-  endif()
+-  # enable this once we have worked out the path issues on the build machines
+-  if(0 AND ENABLE_BUILD_DYNAMIC)
+-    find_package(PythonInterp)
+-    if(PYTHONINTERP_FOUND)
+-      file(GLOB_RECURSE ALLFILES tutorial/python/*.py demos/api/*.py)
+-      filter_tests("${ALLFILES}" TESTFILES)
+-      foreach(TESTFILE ${TESTFILES})
+-        get_filename_component(TEST ${TESTFILE} NAME_WE)
+-        add_test(NAME ${TEST}_py COMMAND ${PYTHON_EXECUTABLE} ${TESTFILE} -nopopup)
+-        set_property(TEST ${TEST}_py APPEND PROPERTY ENVIRONMENT
+-                     "PYTHONPATH=${CMAKE_SOURCE_DIR}/api")
+-        set_property(TEST ${TEST}_py APPEND PROPERTY ENVIRONMENT
+-                     "LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}")
+-        endforeach()
+-    endif()
+-  endif()
+-endif()
+-
+-message(STATUS "")
+-message(STATUS "Gmsh ${GMSH_VERSION} has been configured for ${GMSH_OS}")
+-message(STATUS "")
+-message(STATUS " * Build options:" ${GMSH_CONFIG_OPTIONS})
+-message(STATUS " * Build type: " ${CMAKE_BUILD_TYPE})
+-message(STATUS " * C compiler: " ${CMAKE_C_COMPILER})
+-message(STATUS " * C++ compiler: " ${CMAKE_CXX_COMPILER})
+-message(STATUS " * Install prefix: " ${CMAKE_INSTALL_PREFIX})
+-message(STATUS "")
+-
+-mark_as_advanced(ANN_INC ANN_LIB CAIRO_LIB CAIRO_INC CGNS_INC GMM_INC
+-                 GMP_INC GMP_LIB MMG_INC MMG_LIB HDF5_LIB
+-                 MED_LIB OCC_INC SZ_LIB
+-                 PETSC_LIBS SLEPC_INC SLEPC_INC2 SLEPC_LIB
+-                 BISON FLEX MAKEINFO TEXI2PDF FLTK_CONFIG_SCRIPT
+-                 GMSH_EXTERNAL_INCLUDE_DIRS GMSH_EXTERNAL_LIBRARIES)
+Index: ../trunk-jpl/externalpackages/gmt/install-win64-precompiled.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-win64-precompiled.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmt/install-win64-precompiled.sh	(nonexistent)
+@@ -1,24 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-# Set gmt version
+-VER="5.4.4"
+-
+-# Set tarball name
+-TARBALL_NAME="gmt-${VER}-win64-precompiled"
+-TARBALL=${TARBALL_NAME}.tar.gz
+-
+-# Clean up from previous installation
+-rm -rf install
+-
+-# Download Windows 64-bit precompiled gmsh from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
+-
+-# Untar gmt
+-tar -xvzf $TARBALL
+-
+-# Rename untarred dir
+-mv $TARBALL_NAME install
+-
+-# Clean up
+-rm -f $TARBALL
+Index: ../trunk-jpl/externalpackages/gmt/install-mac-precompiled.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-mac-precompiled.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmt/install-mac-precompiled.sh	(nonexistent)
+@@ -1,24 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-# Set gmt version
+-VER="5.4.4"
+-
+-# Set tarball name
+-TARBALL_NAME="gmt-${VER}-mac-precompiled"
+-TARBALL=${TARBALL_NAME}.tar.gz
+-
+-# Clean up from previous installation
+-rm -rf install
+-
+-# Download Mac precompiled gmsh from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
+-
+-# Untar gmt
+-tar -xvzf $TARBALL
+-
+-# Rename untarred dir
+-mv $TARBALL_NAME install
+-
+-# Clean up
+-rm -f $TARBALL
+
+Property changes on: ../trunk-jpl/externalpackages/gmt/install-mac-precompiled.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmt/configs/6/cmake/ConfigUser.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/configs/6/cmake/ConfigUser.cmake	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmt/configs/6/cmake/ConfigUser.cmake	(revision 25860)
+@@ -38,7 +38,7 @@
+ # ============================================================================
+ 
+ # Installation path (usually defaults to /usr/local) [auto]:
+-set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
++set (CMAKE_INSTALL_PREFIX "$ENV{PREFIX}")
+ 
+ # Set install name suffix used for directories and gmt executables
+ # [undefined]:
+@@ -108,7 +108,7 @@
+ #set (GMT_DATA_SERVER "data_server_url")
+ 
+ # Set path to GSHHG Shoreline Database [auto]:
+-set (GSHHG_ROOT "$ENV{ISSM_DIR}/externalpackages/gshhg/install")
++set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
+ 
+ # Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
+ #set (COPY_GSHHG TRUE)
+@@ -135,11 +135,11 @@
+ 
+ # Set location of NetCDF (can be root directory, path to header file or path
+ # to nc-config) [auto]:
+-set (NETCDF_ROOT "$ENV{ISSM_DIR}/externalpackages/netcdf/install")
++set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
+ 
+ # Set location of GDAL (can be root directory, path to header file or path to
+ # gdal-config) [auto]:
+-set (GDAL_ROOT "$ENV{ISSM_DIR}/externalpackages/gdal/install")
++set (GDAL_ROOT "$ENV{GDAL_ROOT}")
+ 
+ # Set location of PCRE (can be root directory, path to header file or path to
+ # pcre-config) [auto]:
+@@ -153,7 +153,7 @@
+ #set (FFTW3_ROOT "fftw_install_prefix")
+ 
+ # Set location of ZLIB (can be root directory or path to header file) [auto]:
+-set (ZLIB_ROOT "$ENV{ISSM_DIR}/externalpackages/petsc/install")
++set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
+ 
+ # Set location of CURL (can be root directory or path to header file) [auto]:
+ #set (CURL_ROOT "curl_install_prefix")
+@@ -166,8 +166,8 @@
+ #set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
+ 
+ # Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+-set (LAPACK_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lflapack")
+-set (BLAS_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lfblas")
++set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack")
++set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas")
+ 
+ ##
+ ## Section 3: GMT features
+Index: ../trunk-jpl/externalpackages/gshhg/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gshhg/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gshhg/install.sh	(revision 25860)
+@@ -6,8 +6,11 @@
+ #
+ VER="2.3.4"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/gshhg/install" # Set to location where external package should be installed
++
+ # Cleanup
+-rm -rf install
++rm -rf ${PREFIX}
++mkdir -p ${PREFIX}
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gshhg-gmt-${VER}.tar.gz" "gshhg-gmt-${VER}.tar.gz"
+@@ -16,4 +19,4 @@
+ tar -zxvf gshhg-gmt-${VER}.tar.gz
+ 
+ # Install
+-mv gshhg-gmt-${VER} install
++mv gshhg-gmt-${VER}/* ${PREFIX}
+Index: ../trunk-jpl/externalpackages/gsl/install-javascript.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gsl/install-javascript.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gsl/install-javascript.sh	(revision 25860)
+@@ -2,12 +2,19 @@
+ set -eu
+ 
+ 
+-# TODO:
++## TODO:
+ # - Revisit enviroment variables (especially EMCC_CFLAGS) once support for
+ #	Fortran has been accomplished.
+ #
+ 
+-# Environment
++## Constants
++#
++VER="1.15"
++
++PREFIX="${ISSM_DIR}/externalpackages/gsl/install" # Set to location where external package should be installed
++
++## Environment
++#
+ export CC=emcc
+ export CXX=em++
+ export AR=emar
+@@ -16,36 +23,36 @@
+ export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14 to avoid undefined symbol warnings from our Fortran object files being treated as errors
+ 
+ # Source Emscripten environment
+-source $ISSM_DIR/externalpackages/emscripten/install/emsdk_env.sh
++source ${EMSCRIPTEN_ROOT}/emsdk_env.sh
+ 
+ # Issue with variadic function signatures.
+ #export CFLAGS=-DSTDC_HEADERS
+ 
+-# Cleanup from previous installation
+-rm -rf src-javascript install-javascript gsl-1.15
+-mkdir src-javascript install-javascript
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gsl-${VER}.tar.gz" "gsl-${VER}.tar.gz"
+ 
+-#Untar
+-tar -zxvf  gsl-1.15.tar.gz
++# Unpack source
++tar -zxvf gsl-${VER}.tar.gz
+ 
+-#Move gsl into src directory
+-mv gsl-1.15/* src-javascript
+-rm -rf gsl-1.15
++# Move source to 'src' directory
++mv gsl-${VER}/* src
++rm -rf gsl-${VER}
+ 
+-#Configure gsl
+-cd src-javascript
+-
++# Configure
++cd src
+ ./configure \
+-	--prefix="$ISSM_DIR/externalpackages/gsl/install-javascript" \
+-	--disable-shared
++	--prefix="${PREFIX}" \
++	--disable-shared \
+ 
+ #Compile gsl
+ if [ $# -eq 0 ]; then
+ 	make
++	make install
+ else
+ 	make -j $1
++	make -j $1 install
+ fi
+-make install
+Index: ../trunk-jpl/externalpackages/gsl/install-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gsl/install-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gsl/install-static.sh	(revision 25860)
+@@ -2,15 +2,16 @@
+ set -eu
+ 
+ 
+-# Constants
++## Constants
+ #
+-GSL_ROOT=${ISSM_DIR}/externalpackages/gsl
+ VER="1.15"
+ 
+-# Cleanup=
+-rm -rf install src
+-mkdir install src
++PREFIX="${ISSM_DIR}/externalpackages/gsl/install" # Set to location where external package should be installed
+ 
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
+ # Download source
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gsl-${VER}.tar.gz" "gsl-${VER}.tar.gz"
+ 
+@@ -24,7 +25,7 @@
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${GSL_ROOT}/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-shared \
+ 	--with-pic
+ 
+Index: ../trunk-jpl/externalpackages/gsl/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gsl/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gsl/install.sh	(revision 25860)
+@@ -4,13 +4,14 @@
+ 
+ # Constants
+ #
+-GSL_ROOT=${ISSM_DIR}/externalpackages/gsl
+ VER="1.15"
+ 
+-# Cleanup=
+-rm -rf install src
+-mkdir install src
++PREFIX="${ISSM_DIR}/externalpackages/gsl/install" # Set to location where external package should be installed
+ 
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
+ # Download source
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gsl-${VER}.tar.gz" "gsl-${VER}.tar.gz"
+ 
+@@ -24,7 +25,7 @@
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${GSL_ROOT}/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static
+ 
+ # Compile and install
+Index: ../trunk-jpl/externalpackages/m1qn3/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/m1qn3/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/m1qn3/install.sh	(revision 25860)
+@@ -1,17 +1,27 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Some cleanup 
+-rm -rf install src m1qn3-3.3-distrib
+-mkdir install
+ 
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/m1qn3-3.3-distrib.tgz' 'm1qn3-3.3-distrib.tgz'
++## Constants
++#
++VER=3.3
+ 
+-#Untar 
+-tar -xzf m1qn3-3.3-distrib.tgz
+-mv m1qn3-3.3-distrib src
++PREFIX="${ISSM_DIR}/externalpackages/m1qn3/install" # Set to location where external package should be installed
+ 
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m1qn3-${VER}-distrib.tgz" "m1qn3-${VER}-distrib.tgz"
++
++# Unpack source
++tar -xzf m1qn3-${VER}-distrib.tgz
++
++# Move source to 'src' directory
++mv m1qn3-${VER}-distrib/* src
++rm -rf m1qn3-${VER}-distrib
++
+ if which ifort >/dev/null; then
+ 	FC="ifort"
+ else
+@@ -21,7 +31,7 @@
+ 	fi
+ fi
+ 
+-#Compile m1qn3
++# Compile and install
+ cd src/src/
+ (
+ cat << EOF
+@@ -28,7 +38,7 @@
+ LIB_EXT=a
+ FC=$FC
+ install: libm1qn3.\$(LIB_EXT)
+-	cp libm1qn3.\$(LIB_EXT) ../../install/
++	cp libm1qn3.\$(LIB_EXT) ${PREFIX}
+ OBJECTS= m1qn3.o
+ libm1qn3.\$(LIB_EXT): \$(OBJECTS)
+ 	ar -r libm1qn3.\$(LIB_EXT) \$(OBJECTS) 
+@@ -41,7 +51,6 @@
+ ) > Makefile
+ make
+ 
+-#compile ddot
+ cd ../blas
+ (
+ cat << EOF
+@@ -48,7 +57,7 @@
+ LIB_EXT=a
+ FC=$FC
+ install: libddot.\$(LIB_EXT)
+-	cp libddot.\$(LIB_EXT) ../../install/
++	cp libddot.\$(LIB_EXT) ${PREFIX}
+ OBJECTS= ddot.o
+ libddot.\$(LIB_EXT): \$(OBJECTS)
+ 	ar -r libddot.\$(LIB_EXT) \$(OBJECTS) 
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh	(revision 25860)
+@@ -8,8 +8,6 @@
+ # - zlib (1.2.5 or later, for netCDF-4 compression)
+ # - curl (7.18.0 or later, for DAP remote access client support)
+ #
+-# For most ISSM installations, only hdf5 will be necessary
+-#
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+@@ -26,8 +24,7 @@
+ #
+ VER="4.7.2"
+ 
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
++PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
+ 
+ # Environment
+ #
+@@ -41,20 +38,20 @@
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf netcdf-c-$VER.tar.gz
++tar -zxvf netcdf-c-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv netcdf-c-$VER/* src/
+-rm -rf netcdf-c-$VER
++mv netcdf-c-${VER}/* src
++rm -rf netcdf-c-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-shared \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh	(revision 25860)
+@@ -8,8 +8,6 @@
+ # - zlib (1.2.5 or later, for netCDF-4 compression)
+ # - curl (7.18.0 or later, for DAP remote access client support)
+ #
+-# For most ISSM installations, only hdf5 will be necessary
+-#
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+@@ -26,8 +24,7 @@
+ #
+ VER="4.7.2"
+ 
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
++PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
+ 
+ # Environment
+ #
+@@ -41,20 +38,20 @@
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf netcdf-c-$VER.tar.gz
++tar -zxvf netcdf-c-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv netcdf-c-$VER/* src/
+-rm -rf netcdf-c-$VER
++mv netcdf-c-${VER}/* src
++rm -rf netcdf-c-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-shared \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with_tests.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with_tests.sh	(revision 25860)
+@@ -8,8 +8,6 @@
+ # - zlib (1.2.5 or later, for netCDF-4 compression)
+ # - curl (7.18.0 or later, for DAP remote access client support)
+ #
+-# For most ISSM installations, only hdf5 will be necessary
+-#
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+@@ -18,9 +16,7 @@
+ #
+ VER="4.7.2"
+ 
+-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
++PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
+ 
+ # Environment
+ #
+@@ -32,20 +28,20 @@
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf netcdf-c-$VER.tar.gz
++tar -zxvf netcdf-c-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv netcdf-c-$VER/* src/
+-rm -rf netcdf-c-$VER
++mv netcdf-c-${VER}/* src
++rm -rf netcdf-c-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh	(revision 25860)
+@@ -8,8 +8,6 @@
+ # - zlib (1.2.5 or later, for netCDF-4 compression)
+ # - curl (7.18.0 or later, for DAP remote access client support)
+ #
+-# For most ISSM installations, only hdf5 will be necessary
+-#
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+@@ -18,9 +16,7 @@
+ #
+ VER="4.7.2"
+ 
+-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
++PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
+ 
+ # Environment
+ #
+@@ -32,20 +28,20 @@
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf netcdf-c-$VER.tar.gz
++tar -zxvf netcdf-c-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv netcdf-c-$VER/* src/
+-rm -rf netcdf-c-$VER
++mv netcdf-c-${VER}/* src
++rm -rf netcdf-c-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7-with_tests.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7-with_tests.sh	(revision 25860)
+@@ -8,8 +8,6 @@
+ # - zlib (1.2.5 or later, for netCDF-4 compression)
+ # - curl (7.18.0 or later, for DAP remote access client support)
+ #
+-# For most ISSM installations, only hdf5 will be necessary
+-#
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+@@ -18,9 +16,7 @@
+ #
+ VER="4.7.2"
+ 
+-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
++PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
+ 
+ # Environment
+ #
+@@ -31,20 +27,20 @@
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-c-${VER}.tar.gz" "netcdf-c-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf netcdf-c-$VER.tar.gz
++tar -zxvf netcdf-c-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv netcdf-c-$VER/* src/
+-rm -rf netcdf-c-$VER
++mv netcdf-c-${VER}/* src
++rm -rf netcdf-c-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+Index: ../trunk-jpl/externalpackages/netcdf/install-4.7.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/netcdf/install-4.7.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/netcdf/install-4.7.sh	(revision 25860)
+@@ -8,8 +8,6 @@
+ # - zlib (1.2.5 or later, for netCDF-4 compression)
+ # - curl (7.18.0 or later, for DAP remote access client support)
+ #
+-# For most ISSM installations, only hdf5 will be necessary
+-#
+ # Sources:
+ # - https://www.unidata.ucar.edu/software/netcdf/documentation/NUG/getting_and_building_netcdf.html#building
+ #
+@@ -17,10 +15,9 @@
+ # Constants
+ #
+ VER="4.7.2"
+-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+-HDF5_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-ZLIB_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/netcdf/install" # Set to location where external package should be installed
++
+ # Environment
+ #
+ export CPPFLAGS="-I${CURL_ROOT}/include -I${HDF5_ROOT}/include -I${ZLIB_ROOT}/include"
+@@ -33,17 +30,17 @@
+ tar -zxvf netcdf-c-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv netcdf-c-${VER}/* src/
++mv netcdf-c-${VER}/* src
+ rm -rf netcdf-c-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/netcdf/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-linux-solid_earth-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-linux-solid_earth-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-linux-solid_earth-static.sh	(nonexistent)
+@@ -1,60 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# NOTE: There is a single difference between the Linux and macOS 
+-#		configurations, which is the addition of the -static-libgfortran 
+-#		option to FFLAGS on the macOS static configurations. For the sake of 
+-#		consistency, we maintain separate files for each, respective Linux and 
+-#		macOS configuration.
+-
+-## Constants
+-#
+-VER="3.12.3"
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf petsc-${VER}.tar.gz
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install src
+-
+-# Move source to 'src' directory
+-mv petsc-${VER}/* src/
+-rm -rf petsc-${VER}
+-
+-# Configure
+-#
+-# NOTE: Cannot use --with-fpic option when compiling static libs,
+-#
+-#		Cannot determine compiler PIC flags if shared libraries is turned off
+-#		Either run using --with-shared-libraries or --with-pic=0 and supply the
+-#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
+-#
+-cd src
+-./config/configure.py \
+-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+-	--with-shared-libraries=0 \
+-	--CFLAGS="-fPIC" \
+-	--CXXFLAGS="-fPIC" \
+-	--FFLAGS="-fPIC" \
+-	--with-debugging=0 \
+-	--with-valgrind=0 \
+-	--with-x=0 \
+-	--with-ssl=0 \
+-	--download-fblaslapack=1 \
+-	--download-mpich=1 \
+-	--download-metis=1 \
+-	--download-parmetis=1 \
+-	--download-scalapack=1 \
+-	--download-mumps=1 \
+-	--download-zlib=1 \
+-	--download-hdf5=1
+-
+-# Compile and install
+-make
+-make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.12-linux-solid_earth-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/proj/install.sh	(nonexistent)
+@@ -1,15 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf install
+-
+-#Download trunk
+-svn checkout http://svn.osgeo.org/metacrs/proj/trunk/proj install
+-
+-#compile
+-cd install
+-./configure --prefix="$ISSM_DIR/externalpackages/proj/install"
+-make 
+-make install
+-cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/semic/surface_physics.f90.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/semic/surface_physics.f90.patch	(revision 25859)
++++ ../trunk-jpl/externalpackages/semic/surface_physics.f90.patch	(nonexistent)
+@@ -1,15 +0,0 @@
+---- surface_physics.f90	2018-12-10 08:27:55.000000000 +0100
+-+++ my_surface_physics.f90	2018-12-10 08:58:14.000000000 +0100
+-@@ -775,9 +775,9 @@
+-         n_ksub        = par%n_ksub
+- 
+-         ! Read parameters from input namelist file
+--        open(7,file=trim(filename))
+--        read(7,nml=surface_physics)
+--        close(7)
+-+        !open(7,file=trim(filename))
+-+        !read(7,nml=surface_physics)
+-+        !close(7)
+- !         write(*,nml=surface_physics)
+- 
+-         ! Store local parameter values in output object
+Index: ../trunk-jpl/externalpackages/semic/configs/surface_physics.f90.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/semic/configs/surface_physics.f90.patch	(nonexistent)
++++ ../trunk-jpl/externalpackages/semic/configs/surface_physics.f90.patch	(revision 25860)
+@@ -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: ../trunk-jpl/externalpackages/triangle/install-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-linux-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/triangle/install-linux-static.sh	(revision 25860)
+@@ -4,11 +4,11 @@
+ 
+ # Constants
+ #
+-INSTALL_DIR="install"
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+ 
+ # Cleanup
+-rm -rf ${INSTALL_DIR} src
+-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+@@ -19,7 +19,7 @@
+ # Copy customized source files to 'src' directory
+ cp configs/makefile src
+ cp configs/triangle.h src
+-cp configs/linux/configure.make src
++cp configs/mac/configure.make src
+ 
+ # Compile
+ cd src
+@@ -27,8 +27,8 @@
+ 
+ # Install
+ cd ..
+-cp src/libtriangle.* ${INSTALL_DIR}/lib
+-cp src/triangle.h ${INSTALL_DIR}/include
++cp src/libtriangle.* ${PREFIX}/lib
++cp src/triangle.h ${PREFIX}/include
+ 
+ # Cleanup
+ rm -rf src
+Index: ../trunk-jpl/externalpackages/triangle/install-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-linux.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/triangle/install-linux.sh	(revision 25860)
+@@ -4,11 +4,11 @@
+ 
+ # Constants
+ #
+-INSTALL_DIR="install"
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+ 
+ # Cleanup
+-rm -rf ${INSTALL_DIR} src
+-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+@@ -19,7 +19,7 @@
+ # Copy customized source files to 'src' directory
+ cp configs/makefile src
+ cp configs/triangle.h src
+-cp configs/linux/configure.make src
++cp configs/mac/configure.make src
+ 
+ # Compile
+ cd src
+@@ -27,8 +27,8 @@
+ 
+ # Install
+ cd ..
+-cp src/libtriangle.* ${INSTALL_DIR}/lib
+-cp src/triangle.h ${INSTALL_DIR}/include
++cp src/libtriangle.* ${PREFIX}/lib
++cp src/triangle.h ${PREFIX}/include
+ 
+ # Cleanup
+ rm -rf src
+Index: ../trunk-jpl/externalpackages/triangle/install-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-mac-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/triangle/install-mac-static.sh	(revision 25860)
+@@ -4,11 +4,11 @@
+ 
+ # Constants
+ #
+-INSTALL_DIR="install"
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+ 
+ # Cleanup
+-rm -rf ${INSTALL_DIR} src
+-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+@@ -27,8 +27,8 @@
+ 
+ # Install
+ cd ..
+-cp src/libtriangle.* ${INSTALL_DIR}/lib
+-cp src/triangle.h ${INSTALL_DIR}/include
++cp src/libtriangle.* ${PREFIX}/lib
++cp src/triangle.h ${PREFIX}/include
+ 
+ # Cleanup
+ rm -rf src
+Index: ../trunk-jpl/externalpackages/triangle/install-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-mac.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/triangle/install-mac.sh	(revision 25860)
+@@ -4,11 +4,11 @@
+ 
+ # Constants
+ #
+-export INSTALL_DIR="${ISSM_DIR}/externalpackages/triangle/install"
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+ 
+ # Cleanup
+-rm -rf ${INSTALL_DIR} src
+-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+@@ -27,8 +27,8 @@
+ 
+ # Install
+ cd ..
+-cp src/libtriangle.* ${INSTALL_DIR}/lib
+-cp src/triangle.h ${INSTALL_DIR}/include
++cp src/libtriangle.* ${PREFIX}/lib
++cp src/triangle.h ${PREFIX}/include
+ 
+ # Cleanup
+ rm -rf src
+Index: ../trunk-jpl/externalpackages/triangle/makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/makefile	(revision 25859)
++++ ../trunk-jpl/externalpackages/triangle/makefile	(revision 25860)
+@@ -34,7 +34,7 @@
+ 	$(CC) $(CSWITCHES) $(TRILIBDEFS) -shared -o $@ triangle.c
+ 
+ libtriangle.dylib: $(OBJECTS)
+-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name $(PREFIX)/$@ -o $@ triangle.c
++	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name ${PREFIX}/lib/$@ -o $@ triangle.c
+ 
+ libtriangle.lib: $(OBJECTS)
+ 	lib -out:libtriangle.$(STATIC_LIB_EXT) $(OBJECTS)
+Index: ../trunk-jpl/externalpackages/valgrind/install-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/valgrind/install-mac.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/valgrind/install-mac.sh	(revision 25860)
+@@ -2,18 +2,22 @@
+ set -eu
+ 
+ 
++## Constants
++#
++PREFIX="${ISSM_DIR}/externalpackages/valgrind/install" # Set to location where external package should be installed
++
+ # Clean up
+-rm -rf install
++rm -rf ${PREFIX}
+ 
+ # Download development version (the current release never supports the latest 
+ # OS X releases)
+-git clone git://sourceware.org/git/valgrind.git install
++git clone git://sourceware.org/git/valgrind.git ${PREFIX}
+ 
+ # Configure
+ cd install
+ ./autogen.sh
+ ./configure \
+-	--prefix="$ISSM_DIR/externalpackages/valgrind/install" \
++	--prefix="${PREFIX}" \
+ 	--enable-only64bit
+ 
+ # Compile and install
+@@ -24,4 +28,3 @@
+ 	make -j $1
+ 	make install -j $1
+ fi
+-
+Index: ../trunk-jpl/jenkins/pine_island-mac-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 25859)
++++ ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 25860)
+@@ -46,7 +46,7 @@
+ 	curl			install-7-mac.sh
+ 	netcdf			install-4.7-parallel.sh
+ 	proj			install-6.2.sh
+-	gdal			install-3-python-netcdf.sh
++	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-mac.sh
+ 	gmsh			install-4.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-python	(revision 25859)
++++ ../trunk-jpl/jenkins/pine_island-mac-python	(revision 25860)
+@@ -43,7 +43,7 @@
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+ 	proj		install-6.2.sh
+-	gdal		install-3-python-netcdf.sh
++	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+ 	gmsh		install-4.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 25859)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 25860)
+@@ -51,7 +51,7 @@
+ 	gdal		install-3-python-netcdf-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux-static.sh
+-	gmsh		install-4-linux-static.sh
++	gmsh		install-4-static.sh
+ 	triangle	install-linux-static.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 25859)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 25860)
+@@ -48,7 +48,7 @@
+ 	curl		install-7-linux.sh
+ 	netcdf		install-4.7-parallel.sh
+ 	proj		install-6.2.sh
+-	gdal		install-3-python-netcdf.sh
++	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux.sh
+ 	gmsh		install-4.sh
+Index: ../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/autotools/install.sh	(revision 25860)
+@@ -8,15 +8,17 @@
+ AUTOMAKE_VER="1.16.1"
+ LIBTOOL_VER="2.4.2"
+ M4_VER="1.4.18"
++PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+ 
+ ## Environment
+ #
+-export PATH="${ISSM_DIR}/externalpackages/autotools/install/bin:$PATH"
++export PATH="${PREFIX}/bin:$PATH"
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX}
+ 
++
+ # Install m4
+ echo " === INSTALLING M4 =="
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
+@@ -24,7 +26,7 @@
+ mv m4-${M4_VER} src
+ cd src
+ 
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++./configure --prefix="${PREFIX}"
+ make
+ make install
+ cd ..
+@@ -36,7 +38,7 @@
+ tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
+ mv autoconf-${AUTOCONF_VER} src
+ cd src
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++./configure --prefix="${PREFIX}"
+ make
+ make install
+ cd ..
+@@ -48,7 +50,7 @@
+ tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
+ mv automake-${AUTOMAKE_VER} src
+ cd src
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++./configure --prefix="${PREFIX}"
+ make
+ make install
+ cd ..
+@@ -61,7 +63,7 @@
+ rm libtool-${LIBTOOL_VER}.tar.gz
+ mv libtool-${LIBTOOL_VER} src
+ cd src
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++./configure --prefix="${PREFIX}"
+ make
+ make install
+ cd ..
+Index: ../trunk-jpl/externalpackages/cmake/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/cmake/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/cmake/install.sh	(revision 25860)
+@@ -4,8 +4,10 @@
+ 
+ ## Constants
+ #
+-VER="3.16.2"
++VER="3.19.1"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/cmake/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/cmake-${VER}.tar.gz" "cmake-${VER}.tar.gz"
+ 
+@@ -13,17 +15,17 @@
+ tar -zxvf cmake-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install
++rm -rf ${PREFIX}
+ 
+-# Move source into 'install' directory
+-mv cmake-${VER} install
++# Move source into target directory
++mv cmake-${VER} ${PREFIX}
+ 
+ # Configure
+-cd install
++cd ${PREFIX}
+ #./bootstrap \
+-#	--prefix=${ISSM_DIR}/externalpackages/cmake/install # Breaks on ronne
++#	--prefix=${PREFIX} # Breaks on ronne
+ ./configure \
+-	--prefix=${ISSM_DIR}/externalpackages/cmake/install
++	--prefix=${PREFIX}
+ 
+ # Compile
+ if [ $# -eq 0 ]; then
+Index: ../trunk-jpl/externalpackages/curl/install-7-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/curl/install-7-linux-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/curl/install-7-linux-static.sh	(revision 25860)
+@@ -6,24 +6,26 @@
+ #
+ VER="7.73.0"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf curl-$VER.tar.gz
++tar -zxvf curl-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv curl-$VER/* src
+-rm -rf curl-$VER
++mv curl-${VER}/* src
++rm -rf curl-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-shared \
+ 	--disable-dependency-tracking \
+ 	--disable-manual \
+Index: ../trunk-jpl/externalpackages/curl/install-7-linux-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/curl/install-7-linux-with_tests.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/curl/install-7-linux-with_tests.sh	(revision 25860)
+@@ -6,24 +6,26 @@
+ #
+ VER="7.73.0"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf curl-$VER.tar.gz
++tar -zxvf curl-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv curl-$VER/* src
+-rm -rf curl-$VER
++mv curl-${VER}/* src
++rm -rf curl-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static \
+ 	--disable-dependency-tracking \
+ 	--disable-manual \
+Index: ../trunk-jpl/externalpackages/curl/install-7-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/curl/install-7-linux.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/curl/install-7-linux.sh	(revision 25860)
+@@ -6,24 +6,26 @@
+ #
+ VER="7.73.0"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf curl-$VER.tar.gz
++tar -zxvf curl-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv curl-$VER/* src
+-rm -rf curl-$VER
++mv curl-${VER}/* src
++rm -rf curl-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static \
+ 	--disable-dependency-tracking \
+ 	--disable-manual \
+Index: ../trunk-jpl/externalpackages/curl/install-7-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/curl/install-7-mac-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/curl/install-7-mac-static.sh	(revision 25860)
+@@ -6,6 +6,8 @@
+ #
+ VER="7.73.0"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+ export MACOSX_DEPLOYMENT_TARGET="10.5" # Allows fall back to older API (source: https://curl.se/docs/install.html)
+@@ -14,20 +16,20 @@
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf curl-$VER.tar.gz
++tar -zxvf curl-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv curl-$VER/* src
+-rm -rf curl-$VER
++mv curl-${VER}/* src
++rm -rf curl-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-shared \
+ 	--disable-dependency-tracking \
+ 	--disable-manual \
+Index: ../trunk-jpl/externalpackages/curl/install-7-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/curl/install-7-mac.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/curl/install-7-mac.sh	(revision 25860)
+@@ -6,6 +6,8 @@
+ #
+ VER="7.73.0"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/curl/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+ export MACOSX_DEPLOYMENT_TARGET="10.5" # Allows fall back to older API (source: https://curl.se/docs/install.html)
+@@ -14,20 +16,20 @@
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/curl-${VER}.tar.gz" "curl-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf curl-$VER.tar.gz
++tar -zxvf curl-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+-mv curl-$VER/* src
+-rm -rf curl-$VER
++mv curl-${VER}/* src
++rm -rf curl-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/curl/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-static \
+ 	--disable-dependency-tracking \
+ 	--disable-manual \
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 25860)
+@@ -2,25 +2,24 @@
+ set -eu
+ 
+ 
+-# Constants
++## Constants
+ #
+-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
+ VER="6.2"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
++export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+ export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with MATLAB's Boost (absolutely necessary for this version)
+-export DAK_BUILD=${DAK_ROOT}/build
+-export DAK_INSTALL=${DAK_ROOT}/install
+-export DAK_SRC=${DAK_ROOT}/src
+-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
+-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
++export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
++export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
++export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
++export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+ 
+ # Cleanup
+-rm -rf build install src
+-mkdir build install src
++rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
++mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+ 
+ # Download source
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
+@@ -29,7 +28,7 @@
+ tar -zxvf dakota-${VER}-public-src.tar.gz
+ 
+ # Move source to 'src' directory
+-mv dakota-${VER}.0.src/* src
++mv dakota-${VER}.0.src/* ${DAK_SRC}
+ rm -rf dakota-${VER}.0.src
+ 
+ # Copy customized source and configuration files to 'src' directory
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 25860)
+@@ -2,26 +2,25 @@
+ set -eu
+ 
+ 
+-# Constants
++## Constants
+ #
+-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
+ VER="6.2"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
++export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+ export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with MATLAB's Boost (absolutely necessary for this version)
+ #export CXXFLAGS='-std=c++11'
+-export DAK_BUILD=${DAK_ROOT}/build
+-export DAK_INSTALL=${DAK_ROOT}/install
+-export DAK_SRC=${DAK_ROOT}/src
+-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
+-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
++export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
++export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
++export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
++export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+ 
+ # Cleanup
+-rm -rf build install src
+-mkdir build install src
++rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
++mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+ 
+ # Download source
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
+@@ -30,7 +29,7 @@
+ tar -zxvf dakota-${VER}-public-src.tar.gz
+ 
+ # Move source to 'src' directory
+-mv dakota-${VER}.0.src/* src
++mv dakota-${VER}.0.src/* ${DAK_SRC}
+ rm -rf dakota-${VER}.0.src
+ 
+ # Copy customized source and configuration files to 'src' directory
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 25860)
+@@ -2,11 +2,12 @@
+ set -eu
+ 
+ 
+-# Constants
++## Constants
+ #
+-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
+ VER="6.2"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+ 
+@@ -16,24 +17,23 @@
+ # returning one that is installed via package manager.
+ #
+ # TODO:
+-# - Test if -static-libgfortran flag will avoid all of this.
+-# - Otherwise, refactor this to work with other gfortran installations.
++# - Move this to etc/environment.sh
++# - Test if -static-libgfortran flag will avoid all of this
++# - Otherwise, refactor this to work with other gfortran installations
+ #
+ LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
+ LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
+ LIBGCC=$(mdfind -onlyin ${LIBGFORTRAN_ROOT} -name libgcc | grep -n libgcc.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
+ 
+-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
+-export DAK_BUILD=${DAK_ROOT}/build
+-export DAK_INSTALL=${DAK_ROOT}/install
+-export DAK_SRC=${DAK_ROOT}/src
+-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
+-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
++export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
++export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
++export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
++export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
++export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack ${LIBGFORTRAN_ROOT}/libgfortran.a ${LIBGFORTRAN_ROOT}/libquadmath.a ${LIBGCC}" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+ 
+ # Cleanup
+-rm -rf build install src
+-mkdir build install src
++rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
++mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+ 
+ # Download source
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
+@@ -42,7 +42,7 @@
+ tar -zxvf dakota-${VER}-public-src.tar.gz
+ 
+ # Move source to 'src' directory
+-mv dakota-${VER}.0.src/* src
++mv dakota-${VER}.0.src/* ${DAK_SRC}
+ rm -rf dakota-${VER}.0.src
+ 
+ # Copy customized source and configuration files to 'src' directory
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 25860)
+@@ -2,11 +2,12 @@
+ set -eu
+ 
+ 
+-# Constants
++## Constants
+ #
+-DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
+ VER="6.2"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/dakota/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+ 
+@@ -15,20 +16,21 @@
+ # Should retrieve a copy of gfortran that is compiled from source before 
+ # returning one that is installed via package manager.
+ #
++# TODO:
++# - Move this to etc/environment.sh
++#
+ LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | grep -n libgfortran.a | grep -v i386 | sed "s/[0-9]*://g" | head -1)
+ LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
+ 
+-export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+-export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
+-export DAK_BUILD=${DAK_ROOT}/build
+-export DAK_INSTALL=${DAK_ROOT}/install
+-export DAK_SRC=${DAK_ROOT}/src
+-export GSL_HOME=${ISSM_DIR}/externalpackages/gsl/install
+-export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
++export BLAS_LIBS="-L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
++export DAK_BUILD=${ISSM_DIR}/externalpackages/dakota/build # DO NOT CHANGE THIS
++export DAK_INSTALL=${PREFIX} # DO NOT CHANGE THIS
++export DAK_SRC=${ISSM_DIR}/externalpackages/dakota/src # DO NOT CHANGE THIS
++export LAPACK_LIBS="-L${LAPACK_ROOT}/lib -lflapack -L${LIBGFORTRAN_ROOT} -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
+ 
+ # Cleanup
+-rm -rf build install src
+-mkdir build install src
++rm -rf ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
++mkdir -p ${DAK_BUILD} ${DAK_INSTALL} ${DAK_SRC}
+ 
+ # Download source
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
+@@ -37,7 +39,7 @@
+ tar -zxvf dakota-${VER}-public-src.tar.gz
+ 
+ # Move source to 'src' directory
+-mv dakota-${VER}.0.src/* src
++mv dakota-${VER}.0.src/* ${DAK_SRC}
+ rm -rf dakota-${VER}.0.src
+ 
+ # Copy customized source and configuration files to 'src' directory
+Index: ../trunk-jpl/externalpackages/gdal/install-3-python-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-python-static.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/gdal/install-3-python-static.sh	(revision 25860)
+@@ -0,0 +1,58 @@
++#!/bin/bash
++set -eu
++
++
++## TODO
++#	- May want to supply path to Python instead of, effectively, using result of `which python`
++#
++
++## Constants
++#
++VER="3.1.1"
++
++## Environment
++#
++export CC=mpicc
++export CXX=mpicxx
++export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
++export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
++export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf gdal-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv gdal-${VER}/* src
++rm -rf gdal-${VER}
++
++# Configure
++cd src
++./configure \
++	--prefix="${PREFIX}" \
++	--enable-fast-install \
++	--disable-shared \
++	--without-ld-shared \
++	--enable-static \
++	--with-pic \
++	--with-python \
++	--with-libz="${ZLIB_ROOT}" \
++	--with-hdf5="${HDF5_ROOT}" \
++	--with-netcdf="${NETCDF_ROOT}" \
++	--with-proj="${PROJ_ROOT}" \
++	--with-pg=no
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/gdal/install-3-python-static.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gdal/install-3-python.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-python.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gdal/install-3-python.sh	(revision 25860)
+@@ -10,25 +10,23 @@
+ #
+ VER="3.1.1"
+ 
+-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
+-
+ ## Environment
+ #
+-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build)
++export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf gdal-$VER.tar.gz
++tar -zxvf gdal-${VER}.tar.gz
+ 
+ # Move source into 'src' directory
+-mv gdal-$VER/* src
+-rm -rf gdal-$VER
++mv gdal-${VER}/* src
++rm -rf gdal-${VER}
+ 
+ # Configure
+ cd src
+@@ -36,8 +34,9 @@
+ 	--prefix="${PREFIX}" \
+ 	--enable-fast-install \
+ 	--with-python \
+-	--without-hdf5 \
+-	--without-netcdf \
++	--with-libz="${ZLIB_ROOT}" \
++	--with-hdf5="${HDF5_ROOT}" \
++	--with-netcdf="${NETCDF_ROOT}" \
+ 	--with-proj="${PROJ_ROOT}"
+ 
+ # Compile and install
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-static.sh	(revision 25860)
+@@ -6,6 +6,8 @@
+ #
+ VER="6.2.1"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+ export CC=mpicc
+@@ -23,23 +25,23 @@
+ export SQLITE3_LIBS="-lsqlite3"
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf proj-$VER.tar.gz
++tar -zxvf proj-${VER}.tar.gz
+ 
+ # Move source into 'src' directory
+-mv proj-$VER/* src
+-rm -rf proj-$VER
++mv proj-${VER}/* src
++rm -rf proj-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+ 	--disable-shared
+Index: ../trunk-jpl/externalpackages/proj/install-6.2.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/proj/install-6.2.sh	(revision 25860)
+@@ -6,7 +6,9 @@
+ #
+ VER="6.2.1"
+ 
+-## Environnment
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
++## Environment
+ #
+ export CC=mpicc
+ export CXX=mpicxx
+@@ -23,23 +25,23 @@
+ export SQLITE3_LIBS="-lsqlite3"
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf proj-$VER.tar.gz
++tar -zxvf proj-${VER}.tar.gz
+ 
+ # Move source into 'src' directory
+-mv proj-$VER/* src
+-rm -rf proj-$VER
++mv proj-${VER}/* src
++rm -rf proj-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install
+ 
+Index: ../trunk-jpl/externalpackages/semic/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/semic/install.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/semic/install.sh	(revision 25860)
+@@ -1,11 +1,16 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Some cleanup
+-rm -rf install src
+-mkdir install
+ 
+-#Download latest version
++## Constants
++#
++PREFIX="${ISSM_DIR}/externalpackages/semic/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX}
++
++# Download source
+ git clone https://github.com/mkrapp/semic.git src
+ 
+ if which ifort >/dev/null; then
+@@ -21,7 +26,7 @@
+ 	fi
+ fi
+ 
+-#Compile semic module utils.f90
++# Compile and install semic module utils.f90
+ cd src/
+ (
+ cat << EOF
+@@ -29,8 +34,8 @@
+ FC=$FC
+ FFLAGS=$FFLAGS
+ install: libutils.\$(LIB_EXT)
+-	cp libutils.\$(LIB_EXT) ../install/
+-	cp utils.mod ../install/
++	cp libutils.\$(LIB_EXT) ${PREFIX}
++	cp utils.mod ${PREFIX}
+ OBJECTS= utils.o
+ libutils.\$(LIB_EXT): \$(OBJECTS)
+ 	ar -r libutils.\$(LIB_EXT) \$(OBJECTS) 
+@@ -43,10 +48,10 @@
+ ) > Makefile
+ make
+ 
+-# patch surface_physics
+-patch surface_physics.f90 < ../surface_physics.f90.patch
++# Apply patch surface_physics
++patch surface_physics.f90 < ../configs/surface_physics.f90.patch
+ 
+-#Compile semic module surface_physics.f90
++# Compile semic module surface_physics.f90
+ (
+ cat << EOF
+ LIB_EXT=a
+@@ -53,8 +58,8 @@
+ FC=$FC
+ FFLAGS=$FFLAGS
+ install: libsurface_physics.\$(LIB_EXT)
+-	cp libsurface_physics.\$(LIB_EXT) ../install/
+-	cp surface_physics.mod ../install/
++	cp libsurface_physics.\$(LIB_EXT) ${PREFIX}
++	cp surface_physics.mod ${PREFIX}
+ OBJECTS= surface_physics.o
+ libsurface_physics.\$(LIB_EXT): \$(OBJECTS)
+ 	ar -r libsurface_physics.\$(LIB_EXT) \$(OBJECTS) 
+Index: ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 25859)
++++ ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 25860)
+@@ -41,7 +41,7 @@
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+ 	proj			install-6.2.sh
+-	gdal			install-3-python-netcdf.sh
++	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-linux.sh
+ 	gmsh			install-4.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 25859)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 25860)
+@@ -51,7 +51,7 @@
+ 	gdal		install-3-python-netcdf-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac-static.sh
+-	gmsh		install-4-mac-python-static.sh
++	gmsh		install-4-static.sh
+ 	triangle	install-mac-static.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25859)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25860)
+@@ -48,7 +48,7 @@
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+ 	proj		install-6.2.sh
+-	gdal		install-3-python-netcdf.sh
++	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+ 	gmsh		install-4.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab	(revision 25859)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab	(revision 25860)
+@@ -49,10 +49,10 @@
+ 	curl		install-7-linux-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+ 	proj		install-6.2-static.sh
+-	gdal		install-3-netcdf-static.sh
++	gdal		install-3-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux-static.sh
+-	gmsh		install-4-linux-static.sh
++	gmsh		install-4-static.sh
+ 	triangle	install-linux-static.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 25859)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 25860)
+@@ -48,7 +48,7 @@
+ 	curl		install-7-linux.sh
+ 	netcdf		install-4.7-parallel.sh
+ 	proj		install-6.2.sh
+-	gdal		install-3-python-netcdf.sh
++	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux.sh
+ 	gmsh		install-4.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25859)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25860)
+@@ -46,10 +46,10 @@
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+ 	proj			install-6.2.sh
+-	gdal			install-3-python-netcdf.sh
++	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-linux.sh
+-	gmsh			install-4.sh
++	gmsh			install-4-linux.sh
+ 	triangle		install-linux.sh
+ 	chaco			install.sh
+ 	m1qn3			install.sh
+Index: ../trunk-jpl/src/m/coordsystems/gmtmask.m
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 25859)
++++ ../trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 25860)
+@@ -34,37 +34,12 @@
+ 	filename_oce = ['oce_vertices-' num2str(feature('GetPid')) '.txt']; 
+ 	dlmwrite(filename_all,[long lat (1:nv)'],'delimiter','\t','precision',10);
+ 
+-	%Avoid bypassing of the ld library path by Matlab (:()
+-	%
+-	% TODO: Do we really need this (we can/already set it in etc/environment.sh)?
+-	if ismac,
+-		dyld_library_path_old=getenv('DYLD_LIBRARY_PATH');
+-		setenv('DYLD_LIBRARY_PATH',[ issmdir '/externalpackages/curl/install/lib:' issmdir '/externalpackages/hdf5/install/lib:' issmdir '/externalpackages/netcdf/install/lib' ]);
+-	end
+-
+-	%Find path to gmt, list all possible known paths to gmt (you may need to add yours to the list)
+-   gmtpaths = {[issmdir '/bin/gmt'],[issmdir '/externalpackages/gmt/install/bin/gmt'],'/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt'};
+-   gmtpath = '';
+-   for i=gmtpaths
+-      if exist(i{1},'file'),
+-         gmtpath = i{1};
+-			break;
+-      end
+-   end
+-   if isempty(gmtpath),
+-      error('gmt not found! Make sure it is properly installed, or add its path to this file.');
+-   end
+-   
+ 	%figure out which vertices are on the ocean, which one on the continent:
+-	[status,result] = system([gmtpath ' gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
++	[status,result] = system(['gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
+ 	if status~=0,
+ 		error(result);
+ 	end
+ 
+-	%reset DYLD_LIBRARY_PATH to what it was: 
+-	if ismac,
+-		setenv('DYLD_LIBRARY_PATH',dyld_library_path_old);
+-	end
+ 	%read the con_vertices.txt file and flag our mesh vertices on the continent
+ 	fid=fopen(['./' filename_oce],'r');
+ 	line=fgets(fid); 
+Index: ../trunk-jpl/src/m/coordsystems/gmtmask.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 25859)
++++ ../trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 25860)
+@@ -43,44 +43,9 @@
+     #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 (:()
+-    issm_dir = issmdir()
+-
+-    try:
+-        ismac
+-    except NameError:
+-        ismac = False
+-
+-    # TODO: Do we really need this (we can/already set it in etc/environment.sh)?
+-    if ismac:
+-        dyld_library_path_old = os.getenv('DYLD_LIBRARY_PATH')
+-        os.putenv('DYLD_LIBRARY_PATH', issm_dir + '/externalpackages/curl/install/lib:' + issm_dir + '/externalpackages/hdf5/install/lib:' + issm_dir + '/externalpackages/netcdf/install/lib')
+-
+-    #Find path to gmt (you may need to add yours to the list).
+-    #
+-    # NOTE: Assumes gmtselect is also in this directory.
+-    #
+-    gmtpaths = [
+-        issm_dir + '/bin/gmt',
+-        issm_dir + '/externalpackages/gmt/install/bin/gmt',
+-        '/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt'
+-    ]
+-    gmtpath = ''
+-    for i in range(len(gmtpaths)):
+-        if os.path.isfile(gmtpaths[i]):
+-            gmtpath = gmtpaths[i]
+-            break
+-
+-    if gmtpath == '':
+-        raise Exception('gmt not found! Make sure it is properly installed, or add its path to this file.')
+-
+     #figure out which vertices are on the ocean, which one on the continent:
+-    subprocess.call(gmtpath + ' gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True)
++    subprocess.call('gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True)
+ 
+-    #reset DYLD_LIBRARY_PATH to what it was:
+-    if ismac:
+-        os.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()
+Index: ../trunk-jpl/externalpackages/gdal/install-3-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-static.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/gdal/install-3-static.sh	(revision 25860)
+@@ -0,0 +1,57 @@
++#!/bin/bash
++set -eu
++
++
++## TODO
++#	- May want to supply path to Python instead of, effectively, using result of `which python`
++#
++
++## Constants
++#
++VER="3.1.1"
++
++## Environment
++#
++export CC=mpicc
++export CXX=mpicxx
++export LDFLAGS="-L${HDF5_ROOT}/lib" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
++export LIBS="-lhdf5_hl -lhdf5" # Need to do this so HDF5 symbols referenced in NETCDF library are found at link time
++export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf gdal-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv gdal-${VER}/* src
++rm -rf gdal-${VER}
++
++# Configure
++cd src
++./configure \
++	--prefix="${PREFIX}" \
++	--enable-fast-install \
++	--disable-shared \
++	--without-ld-shared \
++	--enable-static \
++	--with-pic \
++	--with-libz="${ZLIB_ROOT}" \
++	--with-hdf5="${HDF5_ROOT}" \
++	--with-netcdf="${NETCDF_ROOT}" \
++	--with-proj="${PROJ_ROOT}" \
++	--with-pg=no
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/gdal/install-3-static.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gdal/install-3.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gdal/install-3.sh	(revision 25860)
+@@ -2,19 +2,17 @@
+ set -eu
+ 
+ 
+-# Constants
++## Constants
+ #
+ VER="3.1.1"
+ 
+-PROJ_ROOT="${ISSM_DIR}/externalpackages/proj/install"
+-
+ ## Environment
+ #
+-export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # Need this to properly set destination root for Python libraries on macOS (should not affect Linux build; do not need for this configuration, but including it for consistency)
++export PREFIX="${ISSM_DIR}/externalpackages/gdal/install" # NOTE: Need to export this to properly set destination root for Python libraries on macOS (should not affect Linux build). Set to location where external package should be installed.
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+@@ -23,8 +21,8 @@
+ tar -zxvf gdal-${VER}.tar.gz
+ 
+ # Move source into 'src' directory
+-mv gdal-$VER/* src
+-rm -rf gdal-$VER
++mv gdal-${VER}/* src
++rm -rf gdal-${VER}
+ 
+ # Configure
+ cd src
+@@ -31,8 +29,9 @@
+ ./configure \
+ 	--prefix="${PREFIX}" \
+ 	--enable-fast-install \
+-	--without-hdf5 \
+-	--without-netcdf \
++	--with-libz="${ZLIB_ROOT}" \
++	--with-hdf5="${HDF5_ROOT}" \
++	--with-netcdf="${NETCDF_ROOT}" \
+ 	--with-proj="${PROJ_ROOT}"
+ 
+ # Compile and install
+@@ -43,6 +42,3 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
+-
+-# Return to initial directory
+-cd ..
+Index: ../trunk-jpl/externalpackages/gmsh/install-4-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4-static.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/gmsh/install-4-static.sh	(revision 25860)
+@@ -0,0 +1,66 @@
++#!/bin/bash
++set -eu
++
++
++# TODO:
++# - Add support for,
++#	- BLAS_LAPACK
++#	- MUMPS
++#	- PETSC
++# (see configs/4/static/CMakeLists.txt)
++#
++
++## Constants
++#
++VER="4.5.6"
++
++PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
++
++# Unpack source
++tar -xvzf gmsh-${VER}-source.tgz
++
++# Move source to 'src' directory
++mv gmsh-${VER}-source/* src
++rm -rf gmsh-${VER}-source
++
++# Copy customized source and config files to 'src' directory
++cp configs/${VER}/static/CMakeLists.txt src
++
++# Configure
++#
++# NOTE:
++# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
++# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG 
++#	movies.
++# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
++#	importing STEP/IGES files.
++# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
++#	do not need to support Apple Touch bar (does not affect compilation on 
++#	Linux).
++#
++cd src
++cmake \
++	-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
++	-DENABLE_BUILD_LIB=1 \
++	-DENABLE_FLTK=0 \
++	-DENABLE_MPEG_ENCODE=0 \
++	-DENABLE_MPI=1 \
++	-DENABLE_OCC=0 \
++	-DENABLE_TOUCHBAR=0 \
++	-DMETIS_ROOT="${METIS_ROOT}"
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/gmsh/install-4-static.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/gmsh/install-4.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmsh/install-4.sh	(revision 25860)
+@@ -2,20 +2,28 @@
+ set -eu
+ 
+ 
++# TODO:
++# - Add support for,
++#	- BLAS_LAPACK
++#	- MUMPS
++#	- PETSC
++# (see configs/4/static/CMakeLists.txt)
++#
++
+ ## Constants
+ #
+ VER="4.5.6"
+ 
+-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
++PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" # Set to location where external package should be installed
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
+ 
+-# Untar source
++# Unpack source
+ tar -xvzf gmsh-${VER}-source.tgz
+ 
+ # Move source to 'src' directory
+@@ -31,11 +39,12 @@
+ # - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not 
+ #	importing STEP/IGES files.
+ # - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we 
+-#	do not need to support Apple Touch bar.
++#	do not need to support Apple Touch bar (does not affect compilation on 
++#	Linux).
+ #
+-cd install
+-cmake ../src \
+-	-DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" \
++cd src
++cmake \
++	-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
+ 	-DENABLE_BUILD_DYNAMIC=1 \
+ 	-DENABLE_BUILD_SHARED=1 \
+ 	-DENABLE_FLTK=0 \
+@@ -43,7 +52,7 @@
+ 	-DENABLE_MPI=1 \
+ 	-DENABLE_OCC=0 \
+ 	-DENABLE_TOUCHBAR=0 \
+-	-DMETIS_ROOT="${PETSC_ROOT}"
++	-DMETIS_ROOT="${METIS_ROOT}"
+ 
+ # Compile and install
+ if [ $# -eq 0 ]; then
+Index: ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh	(revision 25860)
+@@ -6,17 +6,12 @@
+ #
+ VER="6.0.0"
+ 
+-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+-PETSC_ROOT="${ISSM_DIR}/externalpackages/petsc/install"
+-
+-BLASLAPACK_ROOT="${PETSC_ROOT}"
+-HDF5_ROOT="${PETSC_ROOT}"
+-
+ # Find libgfortran and libgcc so we do not have to hardcode them
+ #
+ # NOTE: For now, paths are hardcoded.
+ #
+ # TODO:
++# - Move this to etc/environment.sh
+ # - Figure out how to find and grep for single result like we do with mdfind 
+ #	under macOS.
+ #
+@@ -24,8 +19,6 @@
+ LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
+ LIBGCC="/usr/lib/gcc/x86_64-linux-gnu/8/libgcc.a"
+ 
+-CURL_INCLUDE_DIRS="${CURL_ROOT}/include" \
+-CURL_LIBRARIES="${CURL_ROOT}/lib/libcurl.a;/usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a" \
+ GDAL_EXTRA_LIBS="-lstdc++" # Determined by running `$GDAL_ROOT/bin/gdal-config --dep-libs` then removing duplicate libs
+ NETCDF_EXTRA_LIBS="-lm -ldl -lz" # `$NETCDF_ROOT/bin/nc-config --libs` does not report certain dependencies of certain static libraries (see also customized configuration file ./configs/6.0/static/cmake/modules/FindNETCDF.cmake)
+ 
+@@ -32,8 +25,9 @@
+ # Environment
+ #
+ export CC=mpicc
+-export CURL_INCLUDE_DIRS=${CURL_INCLUDE_DIRS}
+-export CURL_LIBRARIES=${CURL_LIBRARIES}
++export CURL_INCLUDE_DIRS="${CURL_ROOT}/include"
++export CURL_LIBRARIES="${CURL_ROOT}/lib/libcurl.a;/usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a"
++export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
+@@ -42,8 +36,8 @@
+ tar -zxvf gmt-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+ mv gmt-${VER}/* src
+@@ -69,10 +63,10 @@
+ #	LAPACK_LIBRARIES is a workaround.
+ #
+ cmake \
+-	-DBLAS_LIBRARIES="${BLASLAPACK_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
++	-DBLAS_LIBRARIES="${BLAS_ROOT}/lib/libfblas.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+ 	-DGDAL_EXTRA_LIBS="${GDAL_EXTRA_LIBS}" \
+ 	-DHDF5_ROOT="${HDF5_ROOT}" \
+-	-DLAPACK_LIBRARIES="${BLASLAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
++	-DLAPACK_LIBRARIES="${LAPACK_ROOT}/lib/libflapack.a;${LIBGFORTRAN_ROOT}/libgfortran.a;${LIBGFORTRAN_ROOT}/libquadmath.a;${LIBGCC}" \
+ 	-DNETCDF_EXTRA_LIBS="${NETCDF_EXTRA_LIBS}" \
+ 	..
+ 
+Index: ../trunk-jpl/externalpackages/gmt/install-6-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-linux.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmt/install-6-linux.sh	(revision 25860)
+@@ -6,11 +6,10 @@
+ #
+ VER="6.0.0"
+ 
+-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+-
+ # Environment
+ #
+ export CC=mpicc
++export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
+@@ -19,8 +18,8 @@
+ tar -zxvf gmt-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+ mv gmt-${VER}/* src
+Index: ../trunk-jpl/externalpackages/gmt/install-6-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-mac.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/gmt/install-6-mac.sh	(revision 25860)
+@@ -6,11 +6,10 @@
+ #
+ VER="6.0.0"
+ 
+-CURL_ROOT="${ISSM_DIR}/externalpackages/curl/install"
+-
+ # Environment
+ #
+ export CC=mpicc
++export PREFIX="${ISSM_DIR}/externalpackages/gmt/install" # NOTE: Need to export this to be picked up by customized ConfigUser.cmake (see below). Set to location where external package should be installed.
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmt-${VER}.tar.gz" "gmt-${VER}.tar.gz"
+@@ -19,8 +18,8 @@
+ tar -zxvf gmt-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Move source to 'src' directory
+ mv gmt-${VER}/* src
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh	(revision 25860)
+@@ -2,16 +2,13 @@
+ set -eu
+ 
+ 
+-# NOTE: There is a single difference between the Linux and macOS 
+-#		configurations, which is the addition of the -static-libgfortran 
+-#		option to FFLAGS on the macOS static configurations. For the sake of 
+-#		consistency, we maintain separate files for each, respective Linux and 
+-#		macOS configuration.
+-
+ ## Constants
+ #
+ VER="3.12.3"
+ 
++PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+ 
+@@ -19,16 +16,16 @@
+ tar -zxvf petsc-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir -p ${PREFIX} ${PETSC_DIR}
+ 
+-# Move source to 'src' directory
+-mv petsc-${VER}/* src/
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
+ rm -rf petsc-${VER}
+ 
+ # Configure
+ #
+-# NOTE: 
++# NOTE:
+ # - Cannot use --with-fpic option when compiling static libs,
+ #
+ #		Cannot determine compiler PIC flags if shared libraries is turned off
+@@ -35,10 +32,17 @@
+ #		Either run using --with-shared-libraries or --with-pic=0 and supply the
+ #		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
+ #
+-cd src
++# - Added -fallow-argument-mismatch to FFLAGS in order to clear,
++#
++#		error: The Fortran compiler gfortran will not compile files that call 
++#		the same routine with arguments of different types.
++#
++#	for gfortran 10 or later (may need to remove it for earlier versions).
++#
++cd ${PETSC_DIR}
+ ./config/configure.py \
+-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
+ 	--with-shared-libraries=0 \
+ 	--CFLAGS="-fPIC" \
+ 	--CXXFLAGS="-fPIC" \
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 25860)
+@@ -6,6 +6,9 @@
+ #
+ VER="3.12.3"
+ 
++PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+ 
+@@ -13,18 +16,18 @@
+ tar -zxvf petsc-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir -p ${PREFIX} ${PETSC_DIR}
+ 
+-# Move source to 'src' directory
+-mv petsc-${VER}/* src/
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
+ rm -rf petsc-${VER}
+ 
+ # Configure
+-cd src
++cd ${PETSC_DIR}
+ ./config/configure.py \
+-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
+ 	--with-debugging=0 \
+ 	--with-valgrind=0 \
+ 	--with-x=0 \
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh	(revision 25860)
+@@ -6,6 +6,9 @@
+ #
+ VER="3.12.3"
+ 
++PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+ 
+@@ -13,16 +16,16 @@
+ tar -zxvf petsc-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir -p ${PREFIX} ${PETSC_DIR}
+ 
+-# Move source to 'src' directory
+-mv petsc-${VER}/* src/
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
+ rm -rf petsc-${VER}
+ 
+ # Configure
+ #
+-# NOTE: 
++# NOTE:
+ # - Cannot use --with-fpic option when compiling static libs,
+ #
+ #		Cannot determine compiler PIC flags if shared libraries is turned off
+@@ -40,10 +43,10 @@
+ # - Added -static-libgfortran to all macOS static builds, but this will not 
+ #	work out of the box on Linux.
+ #
+-cd src
++cd ${PETSC_DIR}
+ ./config/configure.py \
+-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
+ 	--with-shared-libraries=0 \
+ 	--CFLAGS="-fPIC -Wno-error=implicit-function-declaration" \
+ 	--CXXFLAGS="-fPIC" \
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-mac.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-mac.sh	(revision 25860)
+@@ -6,6 +6,9 @@
+ #
+ VER="3.12.3"
+ 
++PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+ 
+@@ -13,16 +16,18 @@
+ tar -zxvf petsc-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir -p ${PREFIX} ${PETSC_DIR}
+ 
+-# Move source to 'src' directory
+-mv petsc-${VER}/* src/
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
+ rm -rf petsc-${VER}
+ 
+ # Configure
+ #
+ # NOTE:
++# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
++#	(may need to remove it for earlier versions not using the C99 standard).
+ # - Added -fallow-argument-mismatch to FFLAGS in order to clear,
+ #
+ #		error: The Fortran compiler gfortran will not compile files that call 
+@@ -29,13 +34,11 @@
+ #		the same routine with arguments of different types.
+ #
+ #	for gfortran 10 or later (may need to remove it for earlier versions).
+-# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
+-#	(may need to remove it for earlier versions not using the C99 standard).
+ #
+-cd src
++cd ${PETSC_DIR}
+ ./config/configure.py \
+-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
+ 	--CFLAGS="-Wno-error=implicit-function-declaration" \
+ 	--FFLAGS="-fallow-argument-mismatch" \
+ 	--with-debugging=0 \
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh	(revision 25860)
+@@ -6,7 +6,9 @@
+ #
+ VER="6.2.1"
+ 
+-## Environnment
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
++## Environment
+ #
+ export CC=mpicc
+ export CXX=mpicxx
+@@ -23,23 +25,23 @@
+ export SQLITE3_LIBS="-lsqlite3"
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf proj-$VER.tar.gz
++tar -zxvf proj-${VER}.tar.gz
+ 
+ # Move source into 'src' directory
+-mv proj-$VER/* src
+-rm -rf proj-$VER
++mv proj-${VER}/* src
++rm -rf proj-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+ 	--disable-shared
+@@ -51,6 +53,7 @@
+ 	make install
+ else
+ 	make -j $1
+-	make -j $1 check
++	mack -j $1 check
+ 	make -j $1 install
+ fi
++
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh	(revision 25860)
+@@ -6,7 +6,9 @@
+ #
+ VER="6.2.1"
+ 
+-## Environnment
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
++## Environment
+ #
+ export CC=mpicc
+ export CXX=mpicxx
+@@ -23,23 +25,23 @@
+ export SQLITE3_LIBS="-lsqlite3"
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+-tar -zxvf proj-$VER.tar.gz
++tar -zxvf proj-${VER}.tar.gz
+ 
+ # Move source into 'src' directory
+-mv proj-$VER/* src
+-rm -rf proj-$VER
++mv proj-${VER}/* src
++rm -rf proj-${VER}
+ 
+ # Configure
+ cd src
+ ./configure \
+-	--prefix="${ISSM_DIR}/externalpackages/proj/install" \
++	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install
+ 
+@@ -50,6 +52,6 @@
+ 	make install
+ else
+ 	make -j $1
+-	make -j $1 check
++	mack -j $1 check
+ 	make -j $1 install
+ fi
+Index: ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh	(revision 25859)
++++ ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh	(revision 25860)
+@@ -9,7 +9,7 @@
+ 
+ # Constants
+ #
+-INSTALL_DIR="install-javascript"
++export PREFIX="${ISSM_DIR}/triangle/install" # Set to location where external package should be installed
+ 
+ # Environment
+ #
+@@ -21,7 +21,7 @@
+ export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14 to avoid undefined symbol warnings from our Fortran object files being treated as errors
+ 
+ # Source Emscripten environment
+-source ${ISSM_DIR}/externalpackages/emscripten/install/emsdk_env.sh
++source ${EMSCRIPTEN_ROOT}/emsdk_env.sh
+ 
+ # Cleanup
+ rm -rf ${INSTALL_DIR} src
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 25859)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 25860)
+@@ -50,10 +50,10 @@
+ 	curl		install-7-mac-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+ 	proj		install-6.2-static.sh
+-	gdal		install-3-netcdf-static.sh
++	gdal		install-3-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac-static.sh
+-	gmsh		install-4-mac-static.sh
++	gmsh		install-4-static.sh
+ 	triangle	install-mac-static.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25859)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25860)
+@@ -48,7 +48,7 @@
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+ 	proj		install-6.2.sh
+-	gdal		install-3-python-netcdf.sh
++	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+ 	gmsh		install-4.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 25859)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 25860)
+@@ -46,7 +46,7 @@
+ 	curl			install-7-mac.sh
+ 	netcdf			install-4.7-parallel.sh
+ 	proj			install-6.2.sh
+-	gdal			install-3-python-netcdf.sh
++	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-mac.sh
+ 	gmsh			install-4.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 25859)
++++ ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 25860)
+@@ -48,7 +48,7 @@
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+ 	proj			install-6.2.sh
+-	gdal			install-3-python-netcdf.sh
++	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-linux.sh
+ 	gmsh			install-4.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 25859)
++++ ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 25860)
+@@ -42,10 +42,10 @@
+ 	curl		install-7-linux.sh
+ 	netcdf		install-4.7-parallel.sh
+ 	proj		install-6.2.sh
+-	gdal		install-3-python-netcdf.sh
++	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux.sh
+-	gmsh		install-4.sh
++	gmsh		install-4-linux.sh
+ 	triangle	install-linux.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 25859)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 25860)
+@@ -14,25 +14,8 @@
+ %      md.mesh=gmshplanet('radius',6000,'resolution',100);
+ %      md.mesh=gmshplanet('radius',6000,'resolution',100);
+ 
+-	%Find path to gmsh
+-	paths = {...
+-		[issmdir() 'bin/gmsh'],...
+-		[issmdir() 'externalpackages/gmsh/install/gmsh']...
+-	};
+-	disp(paths{1})
+-	gmshpath = '';
+-	for i=paths
+-		if exist(i{1},'file'),
+-			gmshpath = i{1};
+-			break;
+-		end
+-	end
+-	if isempty(gmshpath),
+-		error('gmsh not found, make sure it is properly installed');
+-	end
+-
+ 	% Get Gmsh version
+-	[s,r]=system([gmshpath ' -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
++	[s,r]=system(['gmsh -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
+ 	if s~=0,
+ 		error(r);
+ 	end
+@@ -142,9 +125,9 @@
+ 	%		"-format" option.
+ 	%
+ 	if  exist(options,'refine'),
+-		system([gmshpath ' -tol 1e-8 -2 -format msh2 sphere.geo -bgm sphere.pos']);
++		system(['gmsh -tol 1e-8 -2 -format msh2 sphere.geo -bgm sphere.pos']);
+ 	else
+-		system([gmshpath ' -tol 1e-8 -2 -format msh2 sphere.geo']);
++		system(['gmsh -tol 1e-8 -2 -format msh2 sphere.geo']);
+ 	end
+ 
+ 	%import mesh:  {{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-25860-25861.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25860-25861.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25860-25861.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/externalpackages/triangle/configs/makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/configs/makefile	(revision 25860)
++++ ../trunk-jpl/externalpackages/triangle/configs/makefile	(revision 25861)
+@@ -34,7 +34,7 @@
+ 	$(CC) $(CSWITCHES) $(TRILIBDEFS) -shared -o $@ triangle.c
+ 
+ libtriangle.dylib: $(OBJECTS)
+-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name ${INSTALL_DIR}/lib/$@ -o $@ triangle.c
++	$(CC) $(CSWITCHES) $(TRILIBDEFS) -dynamiclib -install_name ${PREFIX}/lib/$@ -o $@ triangle.c
+ 
+ libtriangle.lib: $(OBJECTS)
+ 	lib -out:libtriangle.$(STATIC_LIB_EXT) $(OBJECTS)
+Index: ../trunk-jpl/externalpackages/triangle/install-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-linux-static.sh	(revision 25860)
++++ ../trunk-jpl/externalpackages/triangle/install-linux-static.sh	(revision 25861)
+@@ -19,7 +19,7 @@
+ # Copy customized source files to 'src' directory
+ cp configs/makefile src
+ cp configs/triangle.h src
+-cp configs/mac/configure.make src
++cp configs/linux/configure.make src
+ 
+ # Compile
+ cd src
+Index: ../trunk-jpl/externalpackages/triangle/install-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-linux.sh	(revision 25860)
++++ ../trunk-jpl/externalpackages/triangle/install-linux.sh	(revision 25861)
+@@ -19,7 +19,7 @@
+ # Copy customized source files to 'src' directory
+ cp configs/makefile src
+ cp configs/triangle.h src
+-cp configs/mac/configure.make src
++cp configs/linux/configure.make src
+ 
+ # Compile
+ cd src
Index: /issm/oecreview/Archive/25834-26739/ISSM-25861-25862.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25861-25862.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25861-25862.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/jenkins/ross-debian_linux-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 25861)
++++ ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 25862)
+@@ -45,7 +45,7 @@
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux.sh
+-	gmsh		install-4-linux.sh
++	gmsh		install-4.sh
+ 	triangle	install-linux.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25861)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25862)
+@@ -49,7 +49,7 @@
+ 	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-linux.sh
+-	gmsh			install-4-linux.sh
++	gmsh			install-4.sh
+ 	triangle		install-linux.sh
+ 	chaco			install.sh
+ 	m1qn3			install.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-25862-25863.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25862-25863.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25862-25863.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh	(revision 25862)
++++ ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh	(revision 25863)
+@@ -24,8 +24,8 @@
+ source ${EMSCRIPTEN_ROOT}/emsdk_env.sh
+ 
+ # Cleanup
+-rm -rf ${INSTALL_DIR} src
+-mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/share src
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} ${PREFIX}/include ${PREFIX}/share src
+ 
+ # Download source
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+@@ -44,5 +44,5 @@
+ 
+ # Install
+ cd ..
+-cp src/triangle.o ${INSTALL_DIR}/share
+-cp src/triangle.h ${INSTALL_DIR}/include
++cp src/triangle.o ${PREFIX}/share
++cp src/triangle.h ${PREFIX}/include
Index: /issm/oecreview/Archive/25834-26739/ISSM-25863-25864.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25863-25864.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25863-25864.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh	(revision 25863)
++++ ../trunk-jpl/externalpackages/triangle/install-linux-javascript.sh	(revision 25864)
+@@ -9,7 +9,7 @@
+ 
+ # Constants
+ #
+-export PREFIX="${ISSM_DIR}/triangle/install" # Set to location where external package should be installed
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+ 
+ # Environment
+ #
Index: /issm/oecreview/Archive/25834-26739/ISSM-25864-25865.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25864-25865.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25864-25865.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/jenkins/ross-debian_linux-javascript
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-javascript	(revision 25864)
++++ ../trunk-jpl/jenkins/ross-debian_linux-javascript	(revision 25865)
+@@ -13,8 +13,8 @@
+ 	--without-Love \
+ 	--without-kml \
+ 	--without-kriging \
+-	--with-gsl-dir="${ISSM_DIR}/externalpackages/gsl/install-javascript" \
+-	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install-javascript" \
++	--with-gsl-dir="${ISSM_DIR}/externalpackages/gsl/install" \
++	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
+ '
+ 
+ #-------------------#
Index: /issm/oecreview/Archive/25834-26739/ISSM-25865-25866.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25865-25866.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25865-25866.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25865)
++++ ../trunk-jpl/etc/environment.sh	(revision 25866)
+@@ -426,9 +426,9 @@
+ 	dyld_library_path_append "${GMT_ROOT}/lib"
+ fi
+ 
+-GMSH_ROOT="${ISSM_EXT_DIR}/gmt/install"
++GMSH_ROOT="${ISSM_EXT_DIR}/gmsh/install"
+ if [ -d "${GMSH_ROOT}" ]; then
+-	path_append "${GMSH_ROOT}/bin"
++	path_prepend "${GMSH_ROOT}/bin"
+ 	ld_library_path_append "${GMSH_ROOT}/lib"
+ 	dyld_library_path_append "${GMSH_ROOT}/lib"
+ fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25868-25869.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25868-25869.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25868-25869.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/src/m/classes/masstransport.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/masstransport.m	(revision 25868)
++++ ../trunk-jpl/src/m/classes/masstransport.m	(revision 25869)
+@@ -104,7 +104,7 @@
+ 			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, 5: streamline upwind Petrov-Galerkin (SUPG)');
++			fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
+ 
+ 			disp(sprintf('\n      %s','Penalty options:'));
+ 			fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
+Index: ../trunk-jpl/src/m/classes/masstransport.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/masstransport.py	(revision 25868)
++++ ../trunk-jpl/src/m/classes/masstransport.py	(revision 25869)
+@@ -34,7 +34,7 @@
+         s += '{}\n'.format(fielddisplay(self, 'isfreesurface', 'do we use free surfaces (FS only) or mass conservation'))
+         s += '{}\n'.format(fielddisplay(self, 'min_thickness', 'minimum ice thickness allowed [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'hydrostatic_adjustment', 'adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))
+-        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport'))
++        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)'))
+         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+         return s
+     #}}}
+@@ -70,7 +70,7 @@
+         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.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 not np.any(np.isnan(self.vertex_pairing)) and len(self.vertex_pairing) > 0:
Index: /issm/oecreview/Archive/25834-26739/ISSM-25869-25870.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25869-25870.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25869-25870.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/src/m/classes/damage.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.js	(revision 25869)
++++ ../trunk-jpl/src/m/classes/damage.js	(revision 25870)
+@@ -47,7 +47,7 @@
+ 			fielddisplay(this,'spcdamage','damage constraints (NaN means no constraint)');
+ 			fielddisplay(this,'max_damage','maximum possible damage (0<=max_damage<1)');
+ 
+-			fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: flux corrected transport');
++			fielddisplay(this,'stabilization','0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport');
+ 			fielddisplay(this,'maxiter','maximum number of non linear iterations');
+ 			fielddisplay(this,'elementinterp',"interpolation scheme for finite elements {'P1','P2'}");
+ 			fielddisplay(this,'stress_threshold','stress threshold for damage initiation [Pa]');
+Index: ../trunk-jpl/src/m/classes/damage.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.m	(revision 25869)
++++ ../trunk-jpl/src/m/classes/damage.m	(revision 25870)
+@@ -129,7 +129,7 @@
+ 				fielddisplay(self,'spcdamage','damage constraints (NaN means no constraint)');
+ 				fielddisplay(self,'max_damage','maximum possible damage (0<=max_damage<1)');
+ 				
+-				fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: flux corrected transport');
++				fielddisplay(self,'stabilization','0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport');
+ 				fielddisplay(self,'maxiter','maximum number of non linear iterations');
+ 				fielddisplay(self,'elementinterp','interpolation scheme for finite elements {''P1'',''P2''}');
+ 				fielddisplay(self,'stress_threshold','stress threshold for damage initiation (Pa)');
+Index: ../trunk-jpl/src/m/classes/damage.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.py	(revision 25869)
++++ ../trunk-jpl/src/m/classes/damage.py	(revision 25870)
+@@ -51,7 +51,7 @@
+             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, "stabilization", "0: no stabilization, 1: artificial diffusion, 2: SUPG (not working), 4: flux corrected transport")
+             s += "%s\n" % fielddisplay(self, "maxiter", "maximum number of non linear iterations")
+             s += "%s\n" % fielddisplay(self, "elementinterp", "interpolation scheme for finite elements [''P1'', ''P2'']")
+             s += "%s\n" % fielddisplay(self, "stress_threshold", "stress threshold for damage initiation (Pa)")
+Index: ../trunk-jpl/src/m/classes/masstransport.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/masstransport.js	(revision 25869)
++++ ../trunk-jpl/src/m/classes/masstransport.js	(revision 25870)
+@@ -29,7 +29,7 @@
+ 		fielddisplay(this,'isfreesurface','do we use free surfaces (FS only) or mass conservation');
+ 		fielddisplay(this,'min_thickness','minimum ice thickness allowed [m]');
+ 		fielddisplay(this,'hydrostatic_adjustment',"adjustment of ice shelves surface and bed elevations: 'Incremental' or 'Absolute' ");
+-		fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport');
++		fielddisplay(this,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
+ 
+ 		console.log(sprintf('\n      %s','Penalty options:'));
+ 		fielddisplay(this,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
Index: /issm/oecreview/Archive/25834-26739/ISSM-25870-25871.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25870-25871.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25870-25871.diff	(revision 26740)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/m/classes/clusters/greenplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 25870)
++++ ../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 25871)
+@@ -55,9 +55,9 @@
+ 		 %}}}
+ 		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'c6145','ilg2.3','default'};
+-			 queue_requirements_time=[Inf Inf];
+-			 queue_requirements_np=[80 80];
++			 available_queues={'brd2.4','has2.5','ilg2.3','m-c1.9','m-c2.2','nes2.8','sib2.9','m2090','default'};
++			 queue_requirements_time=[Inf Inf Inf Inf Inf Inf Inf Inf Inf];
++			 queue_requirements_np=[80 80 80 80 80 80 80 80 80];
+ 
+ 			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+ 
+@@ -102,10 +102,18 @@
+ 			 fid=fopen([modelname '.queue'],'w');
+ 			 fprintf(fid,'#!/bin/bash\n');
+ 			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			 fprintf(fid,'#SBATCH --partition=%s',cluster.queue{1});
++			 for i=2:length(cluster.queue) 
++				fprintf(fid,',%s',cluster.queue{i});
++			 end
++			 fprintf(fid,'\n');
++			 %fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			 %fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			 fprintf(fid,'#SBATCH --nodes=%i\n',cluster.numnodes); % in general, just 1
++			 fprintf(fid,'#SBATCH --ntasks=%i\n',cluster.cpuspernode); % in general, just 1
++			 fprintf(fid,'#SBATCH --cpus-per-task=%i\n',1); 
++			 fprintf(fid,'#SBATCH --mem=%igb\n',cluster.memory); % minimum total node memory required
++			 fprintf(fid,'#SBATCH --time=%s\n',datestr(cluster.time/24,'HH:MM:SS')); %walltime is in HH:MM:SS format. cluster.time is in hour
+ 			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+ 			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
Index: /issm/oecreview/Archive/25834-26739/ISSM-25871-25872.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25871-25872.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25871-25872.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp	(revision 25871)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp	(revision 25872)
+@@ -242,7 +242,7 @@
+ 				else{ m0=m-1; m3=m+2; }
+ 
+ 				if(n0<0 || n3>=dataN || m0<0 || m3>=dataM){
+-					interp[idx] = -9999;
++					interp[idx] = -9999.;
+ 					continue;
+ 				}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25872-25873.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25872-25873.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25872-25873.diff	(revision 26740)
@@ -0,0 +1,508 @@
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25872)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25873)
+@@ -36,7 +36,7 @@
+ #	help debug potential SVN issues.
+ #
+ # NOTE:
+-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
++# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+ #	the 'Bindings' section under a 'Username and password (separated)' binding 
+ #	(requires 'Credentials Binding Plugin').
+ # - For local debugging, the aformentioned credentials can be hardcoded into 
+@@ -72,7 +72,7 @@
+ MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2006,2020,2021,2051,2052,2053,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ MATLAB_PATH="/Applications/MATLAB_R2018a.app"
+ NOTARIZATION_LOGFILE="notarization.log"
+-PASSWORD=$env:issm-binaries-pass
++PASSWORD=${ISSM_BINARIES_PASS}
+ PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
+ RETRIGGER_SIGNING_FILE="retrigger.txt"
+ SIGNED_REPO_COPY="./signed"
+@@ -81,7 +81,7 @@
+ SIGNING_LOCK_FILE="signing.lock"
+ UNSIGNED_REPO_COPY="./unsigned"
+ UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
+-USERNAME=$env:issm-binaries-user
++USERNAME=${ISSM_BINARIES_USER}
+ 
+ COMPRESSED_PKG="${PKG}.zip"
+ 
+@@ -88,7 +88,7 @@
+ ## Environment
+ #
+ export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+-
++AGU
+ ## Parse options
+ #
+ if [ $# -gt 1 ]; then
+@@ -115,7 +115,9 @@
+ 	# Remove signing lock file from signed package repository so that a new 
+ 	# build can run
+ 	echo "Removing lock file from repository for signed packages"
+-	svn co \
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		--depth empty \
+@@ -123,7 +125,12 @@
+ 		${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+ 	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn commit --message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 	exit 1
+ fi
+@@ -148,7 +155,9 @@
+ 		#		previous signing.
+ 		#
+ 		echo "Checking out copy of repository for signed packages"
+-		svn co \
++		svn checkout \
++			--trust-server-cert \
++			--non-interactive \
+ 			--username ${USERNAME} \
+ 			--password ${PASSWORD} \
+ 			--depth empty \
+@@ -265,7 +274,12 @@
+ 	echo "Committing lock file to repository for signed packages"
+ 	touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn commit --message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ 	# Save current working copy revision number
+ 	svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
+@@ -273,7 +287,9 @@
+ 
+ 	# Check out copy of SVN repository for unsigned packages
+ 	echo "Checking out copy of repository for unsigned packages"
+-	svn co \
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		${UNSIGNED_REPO_URL} \
+@@ -288,7 +304,12 @@
+ 		echo "Committing package to repository for unsigned packages"
+ 		cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+ 		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
+-		svn commit --message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 	else
+ 		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
+ 		#		build on the remote JPL Cybersecurity Jenkins server is 
+@@ -297,7 +318,12 @@
+ 		echo "Attempting to sign existing package again"
+ 		touch ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
+ 		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-		svn commit --message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 	fi
+ 
+ 	# Check status of signing
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25872)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25873)
+@@ -36,7 +36,7 @@
+ #	help debug potential SVN issues.
+ #
+ # NOTE:
+-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
++# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+ #	the 'Bindings' section under a 'Username and password (separated)' binding 
+ #	(requires 'Credentials Binding Plugin').
+ # - For local debugging, the aformentioned credentials can be hardcoded into 
+@@ -70,7 +70,7 @@
+ ## Constants
+ #
+ NOTARIZATION_LOGFILE="notarization.log"
+-PASSWORD=$env:issm-binaries-pass
++PASSWORD=${ISSM_BINARIES_PASS}
+ PKG="ISSM-macOS-Python" # Name of directory to copy distributable files to
+ PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2006 2020 2021 2051 2052 2053 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ RETRIGGER_SIGNING_FILE="retrigger.txt"
+@@ -80,7 +80,7 @@
+ SIGNING_LOCK_FILE="signing.lock"
+ UNSIGNED_REPO_COPY="./unsigned"
+ UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
+-USERNAME=$env:issm-binaries-user
++USERNAME=${ISSM_BINARIES_USER}
+ 
+ COMPRESSED_PKG="${PKG}.zip"
+ 
+@@ -114,7 +114,9 @@
+ 	# Remove signing lock file from signed package repository so that a new 
+ 	# build can run
+ 	echo "Removing lock file from repository for signed packages"
+-	svn co \
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		--depth empty \
+@@ -122,7 +124,12 @@
+ 		${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+ 	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn commit --message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 	exit 1
+ fi
+@@ -141,7 +148,9 @@
+ 		#		from previous signing.
+ 		#
+ 		echo "Checking out copy of repository for signed packages"
+-		svn co \
++		svn checkout \
++			--trust-server-cert \
++			--non-interactive \
+ 			--username ${USERNAME} \
+ 			--password ${PASSWORD} \
+ 			--depth empty \
+@@ -266,7 +275,12 @@
+ 	echo "Committing lock file to repository for signed packages"
+ 	touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn commit --message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ 	# Save current working copy revision number
+ 	svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
+@@ -274,7 +288,9 @@
+ 
+ 	# Check out copy of SVN repository for unsigned packages
+ 	echo "Checking out copy of repository for unsigned packages"
+-	svn co \
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		${UNSIGNED_REPO_URL} \
+@@ -289,7 +305,12 @@
+ 		echo "Committing package to repository for unsigned packages"
+ 		cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+ 		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
+-		svn commit --message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 	else
+ 		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
+ 		#		build on the remote JPL Cybersecurity Jenkins server is 
+@@ -298,7 +319,12 @@
+ 		echo "Attempting to sign existing package again"
+ 		touch ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
+ 		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-		svn commit --message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 	fi
+ 
+ 	# Check status of signing
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25872)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25873)
+@@ -16,18 +16,20 @@
+ # - Navigate to 'Manage Jenkins' -> 'Manage Credentials' -> <domain> -> 
+ #	'Add Credentials' and enter the crendentials from above.
+ # - From the 'Dashboard', select 'New Item' -> 'Freestyle project'.
+-# - Under 'Source Code Management', select 'Subversion'. 
++# - Under 'Source Code Management', select 'Subversion'.
+ #		- The 'Repository URL' text field should be set to 
+-#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
++#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned".
+ #		- The 'Credentials' select menu should be set to the new credentials 
+ #		created previously.
++#		- The 'Local module directory' text field should be set to the same 
++#		value as the constant UNSIGNED_REPO_COPY (set below to './unsigned').
+ # - Under 'Build Trigggers', check the box for 'Poll SCM' and set the 
+ #	'Schedule' text area to "H/5 * * * *".
+ # - Under 'Build Environment', check the box for 'Use secret text(s) or 
+ #	file(s)', then under 'Bindings' click the 'Add...' button and select 
+ #	'Username and password (separated)'.
+-#		- Set 'Username Variable' to "issm-binaries-user”.
+-#		- Set 'Password Variable' to "issm-binaries-pass”.
++#		- Set 'Username Variable' to "ISSM_BINARIES_USER".
++#		- Set 'Password Variable' to "ISSM_BINARIES_PASS".
+ # - Under 'Credentials', select the same, new credentials that created 
+ #	previously.
+ # - The contents of this script can be copied/pasted directly into the ‘Build' 
+@@ -81,6 +83,7 @@
+ NOTARIZATION_CHECK_PERIOD=60
+ NOTARIZATION_LOGFILE="notarization.log"
+ NOTARIZATION_LOGFILE_PATH="."
++PASSWORD=${ISSM_BINARIES_PASS}
+ PKG="ISSM-macOS-MATLAB"
+ PRIMARY_BUNDLE_ID="**********.issm.matlab" # Should be "gov.nasa.jpl.issm.matlab"
+ RETRIGGER_SIGNING_FILE="retrigger.txt"
+@@ -90,6 +93,7 @@
+ SUCCESS_LOGFILE="${SIGNED_REPO_COPY}/success.log"
+ UNSIGNED_REPO_COPY="./unsigned"
+ UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
++USERNAME=${ISSM_BINARIES_USER}
+ 
+ COMPRESSED_PKG="${PKG}.zip"
+ EXE_ENTITLEMENTS_PLIST="${PKG}/bin/entitlements.plist"
+@@ -100,13 +104,18 @@
+ rm -rf ${PKG} ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
+ mkdir ${PKG}
+ 
++# NOTE: Uncomment the following for local testing (Jenkins checks out copy of 
++#		repository for unsigned packages to working directory)
++#
+ # Check out copy of repository for unsigned packages
+-echo "Checking out copy of respository for unsigned packages"
+-svn co \
+-	--username ${USERNAME} \
+-	--password ${PASSWORD} \
+-	${UNSIGNED_REPO_URL} \
+-	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++# echo "Checking out copy of respository for unsigned packages"
++# svn checkout \
++# 	--trust-server-cert \
++# 	--non-interactive \
++# 	--username ${USERNAME} \
++# 	--password ${PASSWORD} \
++# 	${UNSIGNED_REPO_URL} \
++# 	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ # Extract package contents
+ echo "Extracting package contents"
+@@ -238,11 +247,18 @@
+ 
+ # Remove dummy file for retriggering signing/notarization (if it exists)
+ svn delete ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-svn commit --message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++svn commit \
++	--trust-server-cert \
++	--non-interactive \
++	--username ${USERNAME} \
++	--password ${PASSWORD} \
++	--message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ # Check out copy of repository for signed packages
+ echo "Checking out copy of respository for signed packages"
+-svn co \
++svn checkout \
++	--trust-server-cert \
++	--non-interactive \
+ 	--username ${USERNAME} \
+ 	--password ${PASSWORD} \
+ 	${SIGNED_REPO_URL} \
+@@ -262,11 +278,21 @@
+ 
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit --message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ else
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit --message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ 	exit 1
+ fi
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25872)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25873)
+@@ -4,7 +4,7 @@
+ # Intended to be run in the context of a Jenkins project on a JPL 
+ # Cybersecurity server for signing macOS applications. Polls SCM of the 
+ # Subversion repository hosted at 
+-# https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned to trigger new 
++# https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned to trigger new 
+ # builds.
+ #
+ # In order to replicate the requried Jenkins project configuration:
+@@ -16,18 +16,20 @@
+ # - Navigate to 'Manage Jenkins' -> 'Manage Credentials' -> <domain> -> 
+ #	'Add Credentials' and enter the crendentials from above.
+ # - From the 'Dashboard', select 'New Item' -> 'Freestyle project'.
+-# - Under 'Source Code Management', select 'Subversion'. 
++# - Under 'Source Code Management', select 'Subversion'.
+ #		- The 'Repository URL' text field should be set to 
+-#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
++#		"https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned".
+ #		- The 'Credentials' select menu should be set to the new credentials 
+ #		created previously.
++#		- The 'Local module directory' text field should be set to the same 
++#		value as the constant UNSIGNED_REPO_COPY (set below to './unsigned').
+ # - Under 'Build Trigggers', check the box for 'Poll SCM' and set the 
+ #	'Schedule' text area to "H/5 * * * *".
+ # - Under 'Build Environment', check the box for 'Use secret text(s) or 
+ #	file(s)', then under 'Bindings' click the 'Add...' button and select 
+ #	'Username and password (separated)'.
+-#		- Set 'Username Variable' to "issm-binaries-user”.
+-#		- Set 'Password Variable' to "issm-binaries-pass”.
++#		- Set 'Username Variable' to "ISSM_BINARIES_USER".
++#		- Set 'Password Variable' to "ISSM_BINARIES_PASS".
+ # - Under 'Credentials', select the same, new credentials that created 
+ #	previously.
+ # - The contents of this script can be copied/pasted directly into the ‘Build' 
+@@ -46,6 +48,9 @@
+ #	the 'USERNAME' and 'PASSWORD' constants below.
+ ################################################################################
+ 
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
+ # From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+ #
+ #	Command line tool support for Subversion — including svn, git-svn, and 
+@@ -59,7 +64,8 @@
+ # when calling svn, even when subversion is installed via Homebrew and its path 
+ # is available in PATH.
+ #
+-shopt -s expand_aliases
++# NOTE: May be able to remove this after updating macOS.
++#
+ alias svn='/usr/local/bin/svn'
+ 
+ ## Override certain other aliases
+@@ -77,6 +83,7 @@
+ NOTARIZATION_CHECK_PERIOD=60
+ NOTARIZATION_LOGFILE="notarization.log"
+ NOTARIZATION_LOGFILE_PATH="."
++PASSWORD=${ISSM_BINARIES_PASS}
+ PKG="ISSM-macOS-Python"
+ PRIMARY_BUNDLE_ID="**********.issm.python" # Should be "gov.nasa.jpl.issm.python"
+ RETRIGGER_SIGNING_FILE="retrigger.txt"
+@@ -86,6 +93,7 @@
+ SUCCESS_LOGFILE="${SIGNED_REPO_COPY}/success.log"
+ UNSIGNED_REPO_COPY="./unsigned"
+ UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
++USERNAME=${ISSM_BINARIES_USER}
+ 
+ COMPRESSED_PKG="${PKG}.zip"
+ EXE_ENTITLEMENTS_PLIST="${PKG}/bin/entitlements.plist"
+@@ -96,13 +104,18 @@
+ rm -rf ${PKG} ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
+ mkdir ${PKG}
+ 
++# NOTE: Uncomment the following for local testing (Jenkins checks out copy of 
++#		repository for unsigned packages to working directory)
++#
+ # Check out copy of repository for unsigned packages
+-echo "Checking out copy of respository for unsigned packages"
+-svn co \
+-	--username ${USERNAME} \
+-	--password ${PASSWORD} \
+-	${UNSIGNED_REPO_URL} \
+-	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++# echo "Checking out copy of respository for unsigned packages"
++# svn checkout \
++# 	--trust-server-cert \
++# 	--non-interactive \
++# 	--username ${USERNAME} \
++# 	--password ${PASSWORD} \
++# 	${UNSIGNED_REPO_URL} \
++# 	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ # Extract package contents
+ echo "Extracting package contents"
+@@ -243,11 +256,18 @@
+ 
+ # Remove dummy file for retriggering signing/notarization (if it exists)
+ svn delete ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-svn commit --message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++svn commit \
++	--trust-server-cert \
++	--non-interactive \
++	--username ${USERNAME} \
++	--password ${PASSWORD} \
++	--message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ # Check out copy of repository for signed packages
+ echo "Checking out copy of respository for signed packages"
+-svn co \
++svn checkout \
++	--trust-server-cert \
++	--non-interactive \
+ 	--username ${USERNAME} \
+ 	--password ${PASSWORD} \
+ 	${SIGNED_REPO_URL} \
+@@ -267,11 +287,21 @@
+ 
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit --message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ else
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit --message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ 	exit 1
+ fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25873-25874.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25873-25874.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25873-25874.diff	(revision 26740)
@@ -0,0 +1,204 @@
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25873)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25874)
+@@ -88,7 +88,31 @@
+ ## Environment
+ #
+ export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+-AGU
++
++## Functions
++#
++validate_signed_repo_copy(){
++	# Check out copy of repository for signed binaries if it does not exist 
++	# (e.g. 'Check-out Strategy' was set to 'Use 'svn update' as much as 
++	# possible'; initial checkout failed)
++	if [ ! -d ${SIGNED_REPO_COPY} && ! -d ${SIGNED_REPO_COPY}/.svn ]; then
++		# Check out copy of SVN repository for signed packages
++		#
++		# NOTE: Get empty copy because we do not want to have to check out package from 
++		#		previous signing.
++		#
++		echo "Checking out copy of repository for signed packages"
++		svn checkout \
++			--trust-server-cert \
++			--non-interactive \
++			--depth empty \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			${SIGNED_REPO_URL} \
++			${SIGNED_REPO_COPY} > /dev/null 2>&1
++	fi
++}
++
+ ## Parse options
+ #
+ if [ $# -gt 1 ]; then
+@@ -166,7 +190,7 @@
+ 
+ 		# If lock file exists, a signing build is still in process by JPL Cybersecurity
+ 		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-		if [[ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]]; then
++		if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+ 			echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+ 			exit 1
+ 		fi
+@@ -242,7 +266,7 @@
+ 			# Check that all tests passed
+ 			numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+ 
+-			if [[ ${numTestsFailed} -ne 0 ]]; then
++			if [ ${numTestsFailed} -ne 0 ]; then
+ 				echo "One or more tests FAILED"
+ 				exit 1
+ 			else
+@@ -268,6 +292,13 @@
+ 		# Compress package
+ 		echo "Compressing package"
+ 		ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
++	else
++		# Assume that previous build was successful, but signing/notarization 
++		# failed.
++		#
++
++		# Make sure copy of repository for signed packages exists
++		validate_signed_repo_copy
+ 	fi
+ 
+ 	# Commit lock file to repository for signed packages
+@@ -359,6 +390,11 @@
+ 	# Assume that previous build resulted in successful signing of package but 
+ 	# that transfer to ISSM Web site failed and user built this project again 
+ 	# with -t/--transferonly option.
++	#
++
++	# Make sure copy of repository for signed packages exists
++	validate_signed_repo_copy
++
+ 	SUCCESS=1
+ fi
+ 
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25873)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25874)
+@@ -88,6 +88,30 @@
+ #
+ export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+ 
++## Functions
++#
++validate_signed_repo_copy(){
++	# Check out copy of repository for signed binaries if it does not exist 
++	# (e.g. 'Check-out Strategy' was set to 'Use 'svn update' as much as 
++	# possible'; initial checkout failed)
++	if [ ! -d ${SIGNED_REPO_COPY} && ! -d ${SIGNED_REPO_COPY}/.svn ]; then
++		# Check out copy of SVN repository for signed packages
++		#
++		# NOTE: Get empty copy because we do not want to have to check out package from 
++		#		previous signing.
++		#
++		echo "Checking out copy of repository for signed packages"
++		svn checkout \
++			--trust-server-cert \
++			--non-interactive \
++			--depth empty \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			${SIGNED_REPO_URL} \
++			${SIGNED_REPO_COPY} > /dev/null 2>&1
++	fi
++}
++
+ ## Parse options
+ #
+ if [ $# -gt 1 ]; then
+@@ -159,7 +183,7 @@
+ 
+ 		# If lock file exists, a signing build is still in process by JPL Cybersecurity
+ 		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-		if [[ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]]; then
++		if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+ 			echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+ 			exit 1
+ 		fi
+@@ -241,7 +265,7 @@
+ 			# Check that all tests passed
+ 			numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+ 
+-			if [[ ${numTestsFailed} -ne 0 ]]; then
++			if [ ${numTestsFailed} -ne 0 ]; then
+ 				echo "One or more tests FAILED"
+ 				exit 1
+ 			else
+@@ -269,6 +293,13 @@
+ 		# Compress package
+ 		echo "Compressing package"
+ 		ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
++	else
++		# Assume that previous build was successful, but signing/notarization 
++		# failed.
++		#
++
++		# Make sure copy of repository for signed packages exists
++		validate_signed_repo_copy
+ 	fi
+ 
+ 	# Commit lock file to repository for signed packages
+@@ -360,6 +391,11 @@
+ 	# Assume that previous build resulted in successful signing of package but 
+ 	# that transfer to ISSM Web site failed and user built this project again 
+ 	# with -t/--transferonly option.
++	#
++
++	# Make sure copy of repository for signed packages exists
++	validate_signed_repo_copy
++
+ 	SUCCESS=1
+ fi
+ 
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25873)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25874)
+@@ -166,7 +166,7 @@
+ 
+ # Check if UUID exists in response
+ HAS_UUID=$(grep 'RequestUUID = ' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}) # NOTE: Checking for "RequestUUID = " because "RequestUUID" shows up in some error messages
+-if [[ -z "${HAS_UUID}" ]]; then
++if [ -z "${HAS_UUID}" ]; then
+ 	echo "Notarization failed!"
+ 	echo "----------------------- Contents of notarization logfile -----------------------"
+ 	cat ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}
+@@ -198,7 +198,7 @@
+ 
+ 		# First, check if there is an error
+ 		ERROR_CHECK=$(grep 'Error' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE})
+-		if [[ ! -z "${ERROR_CHECK}" ]]; then
++		if [ ! -z "${ERROR_CHECK}" ]; then
+ 			break
+ 		fi
+ 
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25873)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25874)
+@@ -175,7 +175,7 @@
+ 
+ # Check if UUID exists in response
+ HAS_UUID=$(grep 'RequestUUID = ' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}) # NOTE: Checking for "RequestUUID = " because "RequestUUID" shows up in some error messages
+-if [[ -z "${HAS_UUID}" ]]; then
++if [ -z "${HAS_UUID}" ]; then
+ 	echo "Notarization failed!"
+ 	echo "----------------------- Contents of notarization logfile -----------------------"
+ 	cat ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}
+@@ -207,7 +207,7 @@
+ 
+ 		# First, check if there is an error
+ 		ERROR_CHECK=$(grep 'Error' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE})
+-		if [[ ! -z "${ERROR_CHECK}" ]]; then
++		if [ ! -z "${ERROR_CHECK}" ]; then
+ 			break
+ 		fi
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25874-25875.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25874-25875.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25874-25875.diff	(revision 26740)
@@ -0,0 +1,746 @@
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25874)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25875)
+@@ -15,8 +15,6 @@
+ #	distribution.
+ #
+ # Options:
+-# -c/--cleanup			Remove lock file from signed package repository (use if 
+-#						build is aborted to allow for subsequent fresh build)
+ # -n/--notarizeonly		Sign/notarize only (use if signing/notarization fails 
+ #						to skip tests/packaging)
+ # -s/--skiptests		Skip tests (use if this script fails for some reason 
+@@ -24,6 +22,8 @@
+ # -t/--transferonly		Transfer package to ISSM Web site only (use if 
+ #						transfer fails for some reason to skip testing and
+ #						signing)
++# -u/--unlock			Remove lock file from signed package repository (use if 
++#						build is aborted to allow for subsequent fresh build)
+ #
+ # Debugging:
+ # - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+@@ -91,25 +91,38 @@
+ 
+ ## Functions
+ #
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY}
++}
++checkout_unsigned_repo_copy(){
++	echo "Checking out copy of repository for unsigned packages"
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		${UNSIGNED_REPO_URL} \
++		${UNSIGNED_REPO_COPY}
++}
+ validate_signed_repo_copy(){
+-	# Check out copy of repository for signed binaries if it does not exist 
+-	# (e.g. 'Check-out Strategy' was set to 'Use 'svn update' as much as 
+-	# possible'; initial checkout failed)
+-	if [ ! -d ${SIGNED_REPO_COPY} && ! -d ${SIGNED_REPO_COPY}/.svn ]; then
+-		# Check out copy of SVN repository for signed packages
+-		#
+-		# NOTE: Get empty copy because we do not want to have to check out package from 
+-		#		previous signing.
+-		#
+-		echo "Checking out copy of repository for signed packages"
+-		svn checkout \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--depth empty \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			${SIGNED_REPO_URL} \
+-			${SIGNED_REPO_COPY} > /dev/null 2>&1
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
+ 	fi
+ }
+ 
+@@ -120,34 +133,27 @@
+ 	exit 1
+ fi
+ 
+-cleanup=0
+ notarize_only=0
+ skip_tests=0
+ transfer_only=0
++unlock=0
+ while [ $# -gt 0 ]; do
+     case $1 in
+-        -c|--cleanup) cleanup=1; shift ;;
+         -n|--notarizeonly) notarize_only=1; shift ;;
+         -s|--skiptests) skip_tests=1; shift ;;
+         -t|--transferonly) transfer_only=1; shift ;;
++        -u|--unlock) unlock=1; shift ;;
+         *) echo "Unknown parameter passed: $1"; exit 1 ;;
+     esac
+     shift
+ done
+ 
+-if [ ${cleanup} -eq 1 ]; then
++if [ ${unlock} -eq 1 ]; then
+ 	# Remove signing lock file from signed package repository so that a new 
+ 	# build can run
+ 	echo "Removing lock file from repository for signed packages"
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--depth empty \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	checkout_signed_repo_copy
++	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+ 	svn commit \
+ 		--trust-server-cert \
+@@ -154,12 +160,23 @@
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+-	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY}
++	svn cleanup ${SIGNED_REPO_COPY}
+ 	exit 1
+ fi
+ 
+ if [ ${transfer_only} -eq 0 ]; then
++	rm -rf ${SIGNED_REPO_COPY}
++
++	checkout_signed_repo_copy
++
++	# If lock file exists, a signing build is still in process by JPL Cybersecurity
++	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++	if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++		echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
++		exit 1
++	fi
++
+ 	if [ ${notarize_only} -eq 0 ]; then
+ 		# Check if MATLAB exists
+ 		if ! [ -d ${MATLAB_PATH} ]; then
+@@ -170,31 +187,9 @@
+ 		# Clean up from previous packaging
+ 		echo "Cleaning up existing assets"
+ 		cd ${ISSM_DIR}
+-		rm -rf ${PKG} ${COMPRESSED_PKG} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
++		rm -rf ${PKG} ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+ 		mkdir ${PKG}
+ 
+-		# Check out copy of SVN repository for signed packages
+-		#
+-		# NOTE: Get empty copy because we do not want to have to check out package from 
+-		#		previous signing.
+-		#
+-		echo "Checking out copy of repository for signed packages"
+-		svn checkout \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			--depth empty \
+-			${SIGNED_REPO_URL} \
+-			${SIGNED_REPO_COPY} > /dev/null 2>&1
+-
+-		# If lock file exists, a signing build is still in process by JPL Cybersecurity
+-		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-		if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-			echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+-			exit 1
+-		fi
+-
+ 		# Add required binaries and libraries to package and modify them where needed
+ 		cd ${ISSM_DIR}/bin
+ 
+@@ -296,9 +291,7 @@
+ 		# Assume that previous build was successful, but signing/notarization 
+ 		# failed.
+ 		#
+-
+-		# Make sure copy of repository for signed packages exists
+-		validate_signed_repo_copy
++		echo "Notarizing only"
+ 	fi
+ 
+ 	# Commit lock file to repository for signed packages
+@@ -310,21 +303,14 @@
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "ADD: New lock file" ${SIGNED_REPO_COPY}
+ 
+ 	# Save current working copy revision number
+-	svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn up ${SIGNED_REPO_COPY}
+ 	CURRENT_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+ 
+ 	# Check out copy of SVN repository for unsigned packages
+-	echo "Checking out copy of repository for unsigned packages"
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		${UNSIGNED_REPO_URL} \
+-		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++	checkout_unsigned_repo_copy
+ 
+ 	if [ ${notarize_only} -eq 0 ]; then
+ 		# Commit new compressed package to repository for unsigned binaries
+@@ -340,7 +326,7 @@
+ 			--non-interactive \
+ 			--username ${USERNAME} \
+ 			--password ${PASSWORD} \
+-			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY}
+ 	else
+ 		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
+ 		#		build on the remote JPL Cybersecurity Jenkins server is 
+@@ -347,7 +333,7 @@
+ 		#		triggered by polling SCM.
+ 		#
+ 		echo "Attempting to sign existing package again"
+-		touch ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
++		echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
+ 		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+ 		svn commit \
+ 			--trust-server-cert \
+@@ -354,7 +340,7 @@
+ 			--non-interactive \
+ 			--username ${USERNAME} \
+ 			--password ${PASSWORD} \
+-			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY}
+ 	fi
+ 
+ 	# Check status of signing
+@@ -365,14 +351,14 @@
+ 	while [ ${IN_PROCESS} -eq 1 ]; do
+ 		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+ 		sleep ${SIGNING_CHECK_PERIOD}
+-		svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		svn up ${SIGNED_REPO_COPY}
+ 		NEW_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+ 
+ 		if [ ${NEW_REV} -ne ${CURRENT_REV} ]; then
+ 			IN_PROCESS=0
+ 
+-			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} > /dev/null 2>&1
+-			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
++			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+ 
+ 			# No error, so check status
+ 			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25874)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25875)
+@@ -3,7 +3,7 @@
+ ################################################################################
+ # To be used after running,
+ #
+-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-python
++#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-matlab
+ #
+ # in the context of a Jenkins project.
+ #
+@@ -15,8 +15,6 @@
+ #	distribution.
+ #
+ # Options:
+-# -c/--cleanup			Remove lock file from signed package repository (use if 
+-#						build is aborted to allow for subsequent fresh build)
+ # -n/--notarizeonly		Sign/notarize only (use if signing/notarization fails 
+ #						to skip tests/packaging)
+ # -s/--skiptests		Skip tests (use if this script fails for some reason 
+@@ -24,12 +22,14 @@
+ # -t/--transferonly		Transfer package to ISSM Web site only (use if 
+ #						transfer fails for some reason to skip testing and
+ #						signing)
++# -u/--unlock			Remove lock file from signed package repository (use if 
++#						build is aborted to allow for subsequent fresh build)
+ #
+ # Debugging:
+ # - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+ #	Jenkins server. Debugging may be perfomed locally by running,
+ #
+-#		packagers/mac/sign-issm-mac-binaries-python.sh
++#		packagers/mac/sign-issm-mac-binaries-matlab.sh
+ #
+ #	with Apple Developer credentials.
+ # - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
+@@ -90,25 +90,38 @@
+ 
+ ## Functions
+ #
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY}
++}
++checkout_unsigned_repo_copy(){
++	echo "Checking out copy of repository for unsigned packages"
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		${UNSIGNED_REPO_URL} \
++		${UNSIGNED_REPO_COPY}
++}
+ validate_signed_repo_copy(){
+-	# Check out copy of repository for signed binaries if it does not exist 
+-	# (e.g. 'Check-out Strategy' was set to 'Use 'svn update' as much as 
+-	# possible'; initial checkout failed)
+-	if [ ! -d ${SIGNED_REPO_COPY} && ! -d ${SIGNED_REPO_COPY}/.svn ]; then
+-		# Check out copy of SVN repository for signed packages
+-		#
+-		# NOTE: Get empty copy because we do not want to have to check out package from 
+-		#		previous signing.
+-		#
+-		echo "Checking out copy of repository for signed packages"
+-		svn checkout \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--depth empty \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			${SIGNED_REPO_URL} \
+-			${SIGNED_REPO_COPY} > /dev/null 2>&1
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
+ 	fi
+ }
+ 
+@@ -119,51 +132,55 @@
+ 	exit 1
+ fi
+ 
+-cleanup=0
+ notarize_only=0
+ skip_tests=0
+ transfer_only=0
++unlock=0
+ while [ $# -gt 0 ]; do
+     case $1 in
+-        -c|--cleanup) cleanup=1; shift ;;
+         -n|--notarizeonly) notarize_only=1; shift ;;
+         -s|--skiptests) skip_tests=1; shift ;;
+         -t|--transferonly) transfer_only=1; shift ;;
++        -u|--unlock) unlock=1; shift ;;
+         *) echo "Unknown parameter passed: $1"; exit 1 ;;
+     esac
+     shift
+ done
+ 
+-if [ ${cleanup} -eq 1 ]; then
++if [ ${unlock} -eq 1 ]; then
+ 	# Remove signing lock file from signed package repository so that a new 
+ 	# build can run
+ 	echo "Removing lock file from repository for signed packages"
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--depth empty \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	checkout_signed_repo_copy
++	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 	svn commit \
+ 		--trust-server-cert \
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+-	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY}
++	svn cleanup ${SIGNED_REPO_COPY}
+ 	exit 1
+ fi
+ 
+ if [ ${transfer_only} -eq 0 ]; then
++	rm -rf ${SIGNED_REPO_COPY}
++
++	checkout_signed_repo_copy
++
++	# If lock file exists, a signing build is still in process by JPL Cybersecurity
++	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++	if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++		echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
++		exit 1
++	fi
++
+ 	if [ ${notarize_only} -eq 0 ]; then
+ 		# Clean up from previous packaging
+ 		echo "Cleaning up existing assets"
+ 		cd ${ISSM_DIR}
+-		rm -rf ${PKG} ${COMPRESSED_PKG} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
++		rm -rf ${PKG} ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+ 		mkdir ${PKG}
+ 
+ 		# Check out copy of SVN repository for signed packages
+@@ -179,10 +196,10 @@
+ 			--password ${PASSWORD} \
+ 			--depth empty \
+ 			${SIGNED_REPO_URL} \
+-			${SIGNED_REPO_COPY} > /dev/null 2>&1
++			${SIGNED_REPO_COPY}
+ 
+ 		# If lock file exists, a signing build is still in process by JPL Cybersecurity
+-		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 		if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+ 			echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+ 			exit 1
+@@ -297,35 +314,26 @@
+ 		# Assume that previous build was successful, but signing/notarization 
+ 		# failed.
+ 		#
+-
+-		# Make sure copy of repository for signed packages exists
+-		validate_signed_repo_copy
++		echo "Notarizing only"
+ 	fi
+ 
+ 	# Commit lock file to repository for signed packages
+ 	echo "Committing lock file to repository for signed packages"
+ 	touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 	svn commit \
+ 		--trust-server-cert \
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "ADD: New lock file" ${SIGNED_REPO_COPY}
+ 
+ 	# Save current working copy revision number
+-	svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn up ${SIGNED_REPO_COPY}
+ 	CURRENT_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+ 
+ 	# Check out copy of SVN repository for unsigned packages
+-	echo "Checking out copy of repository for unsigned packages"
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		${UNSIGNED_REPO_URL} \
+-		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++	checkout_unsigned_repo_copy
+ 
+ 	if [ ${notarize_only} -eq 0 ]; then
+ 		# Commit new compressed package to repository for unsigned binaries
+@@ -335,13 +343,13 @@
+ 		#
+ 		echo "Committing package to repository for unsigned packages"
+ 		cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+-		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
++		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG}
+ 		svn commit \
+ 			--trust-server-cert \
+ 			--non-interactive \
+ 			--username ${USERNAME} \
+ 			--password ${PASSWORD} \
+-			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY}
+ 	else
+ 		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
+ 		#		build on the remote JPL Cybersecurity Jenkins server is 
+@@ -348,14 +356,14 @@
+ 		#		triggered by polling SCM.
+ 		#
+ 		echo "Attempting to sign existing package again"
+-		touch ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
+-		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
++		echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
++		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
+ 		svn commit \
+ 			--trust-server-cert \
+ 			--non-interactive \
+ 			--username ${USERNAME} \
+ 			--password ${PASSWORD} \
+-			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY}
+ 	fi
+ 
+ 	# Check status of signing
+@@ -366,14 +374,14 @@
+ 	while [ ${IN_PROCESS} -eq 1 ]; do
+ 		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+ 		sleep ${SIGNING_CHECK_PERIOD}
+-		svn up ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		svn up ${SIGNED_REPO_COPY}
+ 		NEW_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+ 
+ 		if [ ${NEW_REV} -ne ${CURRENT_REV} ]; then
+ 			IN_PROCESS=0
+ 
+-			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} > /dev/null 2>&1
+-			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
++			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+ 
+ 			# No error, so check status
+ 			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25874)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25875)
+@@ -41,7 +41,7 @@
+ #	Alex Coward, alexander.g.coward@jpl.nasa.gov
+ #
+ # NOTE:
+-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
++# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+ #	the 'Bindings' section under a 'Username and password (separated)' binding 
+ #	(requires 'Credentials Binding Plugin').
+ # - For local debugging, the aformentioned credentials can be hardcoded into 
+@@ -85,8 +85,7 @@
+ NOTARIZATION_LOGFILE_PATH="."
+ PASSWORD=${ISSM_BINARIES_PASS}
+ PKG="ISSM-macOS-MATLAB"
+-PRIMARY_BUNDLE_ID="**********.issm.matlab" # Should be "gov.nasa.jpl.issm.matlab"
+-RETRIGGER_SIGNING_FILE="retrigger.txt"
++PRIMARY_BUNDLE_ID="gov.nasa.jpl.issm.matlab"
+ SIGNED_REPO_COPY="./signed"
+ SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
+ SIGNING_LOCK_FILE="signing.lock"
+@@ -98,16 +97,16 @@
+ COMPRESSED_PKG="${PKG}.zip"
+ EXE_ENTITLEMENTS_PLIST="${PKG}/bin/entitlements.plist"
+ 
+-# Clean up from previous packaging (not necessary for single builds on Jenkins, 
+-# but useful when testing packaging locally)
+-echo "Cleaning up existing assets"
+-rm -rf ${PKG} ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
+-mkdir ${PKG}
+-
+ # NOTE: Uncomment the following for local testing (Jenkins checks out copy of 
+ #		repository for unsigned packages to working directory)
+ #
+-# Check out copy of repository for unsigned packages
++
++# # Clean up from previous packaging (not necessary for single builds on Jenkins, 
++# # but useful when testing packaging locally)
++# echo "Cleaning up existing assets"
++# rm -rf ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${UNSIGNED_REPO_COPY}
++
++# # Check out copy of repository for unsigned packages
+ # echo "Checking out copy of respository for unsigned packages"
+ # svn checkout \
+ # 	--trust-server-cert \
+@@ -115,8 +114,10 @@
+ # 	--username ${USERNAME} \
+ # 	--password ${PASSWORD} \
+ # 	${UNSIGNED_REPO_URL} \
+-# 	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++# 	${UNSIGNED_REPO_COPY}
+ 
++rm -rf ${PKG} ${SIGNED_REPO_COPY}
++
+ # Extract package contents
+ echo "Extracting package contents"
+ ditto -xk ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} .
+@@ -245,15 +246,6 @@
+ 	echo "--------------------------------------------------------------------------------"
+ fi
+ 
+-# Remove dummy file for retriggering signing/notarization (if it exists)
+-svn delete ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-svn commit \
+-	--trust-server-cert \
+-	--non-interactive \
+-	--username ${USERNAME} \
+-	--password ${PASSWORD} \
+-	--message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+-
+ # Check out copy of repository for signed packages
+ echo "Checking out copy of respository for signed packages"
+ svn checkout \
+@@ -262,7 +254,7 @@
+ 	--username ${USERNAME} \
+ 	--password ${PASSWORD} \
+ 	${SIGNED_REPO_URL} \
+-	${SIGNED_REPO_COPY} > /dev/null 2>&1
++	${SIGNED_REPO_COPY}
+ 
+ # Copy notarization file to repository for signed packages
+ cp ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY}
+@@ -283,7 +275,7 @@
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY}
+ else
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+@@ -292,7 +284,7 @@
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY}
+ 
+ 	exit 1
+ fi
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25874)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25875)
+@@ -41,7 +41,7 @@
+ #	Alex Coward, alexander.g.coward@jpl.nasa.gov
+ #
+ # NOTE:
+-# - Assumes that 'issm-binaries-user' and 'issm-binaries-pass' are set up in 
++# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+ #	the 'Bindings' section under a 'Username and password (separated)' binding 
+ #	(requires 'Credentials Binding Plugin').
+ # - For local debugging, the aformentioned credentials can be hardcoded into 
+@@ -85,8 +85,7 @@
+ NOTARIZATION_LOGFILE_PATH="."
+ PASSWORD=${ISSM_BINARIES_PASS}
+ PKG="ISSM-macOS-Python"
+-PRIMARY_BUNDLE_ID="**********.issm.python" # Should be "gov.nasa.jpl.issm.python"
+-RETRIGGER_SIGNING_FILE="retrigger.txt"
++PRIMARY_BUNDLE_ID="gov.nasa.jpl.issm.python"
+ SIGNED_REPO_COPY="./signed"
+ SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
+ SIGNING_LOCK_FILE="signing.lock"
+@@ -98,16 +97,16 @@
+ COMPRESSED_PKG="${PKG}.zip"
+ EXE_ENTITLEMENTS_PLIST="${PKG}/bin/entitlements.plist"
+ 
+-# Clean up from previous packaging (not necessary for single builds on Jenkins, 
+-# but useful when testing packaging locally)
+-echo "Cleaning up existing assets"
+-rm -rf ${PKG} ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY} ${UNSIGNED_REPO_COPY}
+-mkdir ${PKG}
+-
+ # NOTE: Uncomment the following for local testing (Jenkins checks out copy of 
+ #		repository for unsigned packages to working directory)
+ #
+-# Check out copy of repository for unsigned packages
++
++# # Clean up from previous packaging (not necessary for single builds on Jenkins, 
++# # but useful when testing packaging locally)
++# echo "Cleaning up existing assets"
++# rm -rf ${COMPRESSED_PKG} ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${UNSIGNED_REPO_COPY}
++
++# # Check out copy of repository for unsigned packages
+ # echo "Checking out copy of respository for unsigned packages"
+ # svn checkout \
+ # 	--trust-server-cert \
+@@ -115,8 +114,11 @@
+ # 	--username ${USERNAME} \
+ # 	--password ${PASSWORD} \
+ # 	${UNSIGNED_REPO_URL} \
+-# 	${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++# 	${UNSIGNED_REPO_COPY}
+ 
++rm -rf ${PKG} ${SIGNED_REPO_COPY}
++
++
+ # Extract package contents
+ echo "Extracting package contents"
+ ditto -xk ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} .
+@@ -254,15 +256,6 @@
+ 	echo "--------------------------------------------------------------------------------"
+ fi
+ 
+-# Remove dummy file for retriggering signing/notarization (if it exists)
+-svn delete ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-svn commit \
+-	--trust-server-cert \
+-	--non-interactive \
+-	--username ${USERNAME} \
+-	--password ${PASSWORD} \
+-	--message "DEL: Removing dummy file for retriggering signing of same package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+-
+ # Check out copy of repository for signed packages
+ echo "Checking out copy of respository for signed packages"
+ svn checkout \
+@@ -271,7 +264,7 @@
+ 	--username ${USERNAME} \
+ 	--password ${PASSWORD} \
+ 	${SIGNED_REPO_URL} \
+-	${SIGNED_REPO_COPY} > /dev/null 2>&1
++	${SIGNED_REPO_COPY}
+ 
+ # Copy notarization file to repository for signed packages
+ cp ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY}
+@@ -278,7 +271,7 @@
+ svn add ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} > /dev/null 2>&1
+ 
+ # Remove lock file from repository for signed packages
+-svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 
+ if [ ${SUCCESS} -eq 1 ]; then
+ 	# Copy signed package to repository for signed packages
+@@ -292,7 +285,7 @@
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY}
+ else
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+@@ -301,7 +294,7 @@
+ 		--non-interactive \
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+-		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY}
+ 
+ 	exit 1
+ fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25875-25876.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25875-25876.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25875-25876.diff	(revision 26740)
@@ -0,0 +1,141 @@
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/CMakeLists.txt.pfe.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/CMakeLists.txt.pfe.patch	(revision 25875)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/CMakeLists.txt.pfe.patch	(revision 25876)
+@@ -2,5 +2,5 @@
+ < # TODO: Can't this be integrated into the following logic?
+ ---
+ > # TODO: Can't this be integrated into the following logic?
+-> set(BLAS_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
+-> set(LAPACK_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
++> set(BLAS_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core")
++> set(LAPACK_LIBS "-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core")
+Index: ../trunk-jpl/externalpackages/triangle/install-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-pleiades.sh	(revision 25875)
++++ ../trunk-jpl/externalpackages/triangle/install-pleiades.sh	(revision 25876)
+@@ -1,24 +1,34 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Some cleanup 
+-rm -rf install triangle
+-mkdir install
+ 
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
++# Constants
++#
++INSTALL_DIR="install"
+ 
+-#Untar 
+-cd install
+-cp ../triangle.zip ./
+-unzip triangle.zip
++# Cleanup
++rm -rf ${INSTALL_DIR} src
++mkdir ${INSTALL_DIR} ${INSTALL_DIR}/include ${INSTALL_DIR}/lib src
+ 
+-#copy new makefile
+-cp ../configs/pleiades/configure.make ./
+-cp ../makefile ./
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+ 
+-#Compile triangle
+-make
++# Unpack source
++unzip triangle.zip -d src
+ 
+-#Patch triangle.h
+-patch triangle.h ../triangle.h.patch
++# Copy customized source files to 'src' directory
++cp configs/makefile src
++cp configs/triangle.h src
++cp configs/linux/configure.make src
++
++# Compile
++cd src
++make shared
++
++# Install
++cd ..
++cp src/libtriangle.* ${INSTALL_DIR}/lib
++cp src/triangle.h ${INSTALL_DIR}/include
++
++# Cleanup
++rm -rf src
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch	(revision 25875)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch	(revision 25876)
+@@ -15,7 +15,7 @@
+ < #     CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+ ---
+ > set(BOOST_ROOT
+->     "/nasa/boost/1.50.0"
++>     "/nasa/pkgsrc/sles12/2018Q3/" 
+ >     CACHE PATH "Use non-standard Boost install" FORCE)
+ > set( Boost_NO_SYSTEM_PATHS TRUE
+ >      CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh	(revision 25875)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh	(revision 25876)
+@@ -21,9 +21,8 @@
+ #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.patch
++patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.pfe.patch
+ patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
+ patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.pfe.patch
+ 
+@@ -35,14 +34,21 @@
+ #Configure dakota
+ cd $DAK_BUILD
+ 
+-cmake -D CMAKE_C_COMPILER=mpicc \
+-	   -D CMAKE_CXX_COMPILER=mpicxx \
+-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+-		-DHAVE_ACRO=off \
+-		-DHAVE_JEGA=off \
+-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
+-		-C $DAK_SRC/cmake/DakotaDev.cmake \
+-		$DAK_SRC
++cmake \
++	-DBUILD_SHARED_LIBS=OFF \
++	-DBUILD_STATIC_LIBS=ON \
++	-DCMAKE_C_COMPILER=mpicc \
++	-DCMAKE_CXX_COMPILER=mpicxx \
++	-DCMAKE_Fortran_COMPILER=mpif77 \
++	-DBoost_NO_BOOST_CMAKE=TRUE \
++	-DHAVE_ACRO=OFF \
++	-DHAVE_JEGA=OFF \
++	-DHAVE_QUESO=ON \
++	-DDAKOTA_HAVE_GSL=ON \
++	-C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
++	-C${DAK_SRC}/cmake/DakotaDev.cmake \
++	${DAK_SRC}
++
+ cd ..
+ 
+ #Compile and install dakota
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 25875)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 25876)
+@@ -308,6 +308,11 @@
+ 			export CXX=g++
+ 			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11"
+ 			export CFLAGS="-O3 -march=corei7-avx"
++		elif test "${VENDOR}" == "intel-pleiades-mpi"; then
++			export CC=mpicc
++			export CXX=mpicxx
++			export CXXFLAGS="-O3 -march=corei7-avx -std=c++11"
++			export CFLAGS="-O3 -march=corei7-avx"
+ 		elif test "${VENDOR}" == "intel-pleiades-icpc"; then
+ 			export CXXFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict -std=c++11"
+ 			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25876-25877.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25876-25877.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25876-25877.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25876)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25877)
+@@ -49,7 +49,7 @@
+ #source configuration script
+ source $1;
+ #}}}
+-#Get Operating system (OS) name{{{
++#Get Operating Ersystem (OS) name{{{
+ OS=$(uname -s)
+ if [[ $OS == CYGWIN* ]]; then
+ 	OS="win";
+@@ -174,10 +174,10 @@
+ 	PACKAGENAME=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM1-$NUM1)
+ 	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
+ 
+-	cd $ISSM_DIR/externalpackages/$PACKAGENAME
+-
+ 	#install if requested or if previous install has not been successful
+ 	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ] || [[ ! -d ./install && ! -d ./install-javascript ]]; then
++		cd $ISSM_DIR/externalpackages/$PACKAGENAME
++
+ 		echo "======================================================";
+ 		echo "       Installing $PACKAGENAME                        ";
+ 		echo "======================================================";
Index: /issm/oecreview/Archive/25834-26739/ISSM-25877-25878.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25877-25878.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25877-25878.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25877)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25878)
+@@ -49,7 +49,7 @@
+ #source configuration script
+ source $1;
+ #}}}
+-#Get Operating Ersystem (OS) name{{{
++#Get Operating system (OS) name{{{
+ OS=$(uname -s)
+ if [[ $OS == CYGWIN* ]]; then
+ 	OS="win";
+@@ -548,7 +548,7 @@
+ 	done
+ 
+ 	# Check that MATLAB did not exit in error
+-	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|license" matlab_log.log | wc -l`
++	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab_log.log | wc -l`
+ 
+ 	if [ $matlabExitedInError -ne 0 ]
+ 	then
Index: /issm/oecreview/Archive/25834-26739/ISSM-25878-25879.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25878-25879.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25878-25879.diff	(revision 26740)
@@ -0,0 +1,169 @@
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25878)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25879)
+@@ -104,7 +104,7 @@
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY}
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
+ }
+ checkout_unsigned_repo_copy(){
+ 	echo "Checking out copy of repository for unsigned packages"
+@@ -114,7 +114,7 @@
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		${UNSIGNED_REPO_URL} \
+-		${UNSIGNED_REPO_COPY}
++		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ }
+ validate_signed_repo_copy(){
+ 	# Validate copy of repository for signed binaries (e.g. 
+@@ -245,7 +245,7 @@
+ 
+ 			# Check that MATLAB did not exit in error
+ 			matlabExitCode=`echo $?`
+-			matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
++			matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab.log | wc -l`
+ 
+ 			if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+ 				echo "----------MATLAB exited in error!----------"
+@@ -305,11 +305,7 @@
+ 		--password ${PASSWORD} \
+ 		--message "ADD: New lock file" ${SIGNED_REPO_COPY}
+ 
+-	# Save current working copy revision number
+-	svn up ${SIGNED_REPO_COPY}
+-	CURRENT_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+-
+-	# Check out copy of SVN repository for unsigned packages
++	# Check out copy of repository for unsigned packages
+ 	checkout_unsigned_repo_copy
+ 
+ 	if [ ${notarize_only} -eq 0 ]; then
+@@ -334,7 +330,7 @@
+ 		#
+ 		echo "Attempting to sign existing package again"
+ 		echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
+-		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
++		svcheckout_unsigned_repo_copyn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+ 		svn commit \
+ 			--trust-server-cert \
+ 			--non-interactive \
+@@ -352,15 +348,14 @@
+ 		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+ 		sleep ${SIGNING_CHECK_PERIOD}
+ 		svn up ${SIGNED_REPO_COPY}
+-		NEW_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+ 
+-		if [ ${NEW_REV} -ne ${CURRENT_REV} ]; then
++		if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+ 			IN_PROCESS=0
+ 
++			# Retrieve notarization lock file
+ 			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+ 
+-			# No error, so check status
++			# Check status
+ 			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+ 			if [[ "${STATUS}" == "success" ]]; then
+ 				echo "Notarization successful!"
+@@ -386,6 +381,9 @@
+ 
+ # Handle result of signing
+ if [ ${SUCCESS} -eq 1 ]; then
++	# Retrieve signed and notarized package
++	svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++
+ 	# Transfer signed package to ISSM Web site
+ 	echo "Transferring signed package to ISSM Web site"
+ 	scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25878)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25879)
+@@ -3,7 +3,7 @@
+ ################################################################################
+ # To be used after running,
+ #
+-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-matlab
++#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-python
+ #
+ # in the context of a Jenkins project.
+ #
+@@ -29,7 +29,7 @@
+ # - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+ #	Jenkins server. Debugging may be perfomed locally by running,
+ #
+-#		packagers/mac/sign-issm-mac-binaries-matlab.sh
++#		packagers/mac/sign-issm-mac-binaries-python.sh
+ #
+ #	with Apple Developer credentials.
+ # - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
+@@ -103,7 +103,7 @@
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY}
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
+ }
+ checkout_unsigned_repo_copy(){
+ 	echo "Checking out copy of repository for unsigned packages"
+@@ -113,7 +113,7 @@
+ 		--username ${USERNAME} \
+ 		--password ${PASSWORD} \
+ 		${UNSIGNED_REPO_URL} \
+-		${UNSIGNED_REPO_COPY}
++		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+ }
+ validate_signed_repo_copy(){
+ 	# Validate copy of repository for signed binaries (e.g. 
+@@ -328,11 +328,7 @@
+ 		--password ${PASSWORD} \
+ 		--message "ADD: New lock file" ${SIGNED_REPO_COPY}
+ 
+-	# Save current working copy revision number
+-	svn up ${SIGNED_REPO_COPY}
+-	CURRENT_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+-
+-	# Check out copy of SVN repository for unsigned packages
++	# Check out copy of repository for unsigned packages
+ 	checkout_unsigned_repo_copy
+ 
+ 	if [ ${notarize_only} -eq 0 ]; then
+@@ -375,19 +371,18 @@
+ 		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+ 		sleep ${SIGNING_CHECK_PERIOD}
+ 		svn up ${SIGNED_REPO_COPY}
+-		NEW_REV=$(svn info --show-item last-changed-revision ${SIGNED_REPO_COPY})
+ 
+-		if [ ${NEW_REV} -ne ${CURRENT_REV} ]; then
++		if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+ 			IN_PROCESS=0
+ 
++			# Retrieve notarization lock file
+ 			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-			svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+ 
+-			# No error, so check status
++			# Check status
+ 			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+ 			if [[ "${STATUS}" == "success" ]]; then
+ 				echo "Notarization successful!"
+-				
++
+ 				# Set flag indicating notarization was successful
+ 				SUCCESS=1
+ 			else
+@@ -409,6 +404,9 @@
+ 
+ # Handle result of signing
+ if [ ${SUCCESS} -eq 1 ]; then
++	# Retrieve signed and notarized package
++	svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++
+ 	# Transfer signed package to ISSM Web site
+ 	echo "Transferring signed package to ISSM Web site"
+ 	scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
Index: /issm/oecreview/Archive/25834-26739/ISSM-25879-25880.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25879-25880.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25879-25880.diff	(revision 26740)
@@ -0,0 +1,248 @@
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25879)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh	(revision 25880)
+@@ -79,7 +79,8 @@
+ AD_USERNAME="**********" # Apple Developer username
+ ALTOOL_PASSWORD="@keychain:**********" # altool password (assumed to be stored in keychain)
+ ASC_PROVIDER="**********"
+-NOTARIZATION_CHECK_ATTEMPTS=60
++MAX_SVN_ATTEMPTS=10
++NOTARIZATION_CHECK_ATTEMPTS=20
+ NOTARIZATION_CHECK_PERIOD=60
+ NOTARIZATION_LOGFILE="notarization.log"
+ NOTARIZATION_LOGFILE_PATH="."
+@@ -248,14 +249,31 @@
+ 
+ # Check out copy of repository for signed packages
+ echo "Checking out copy of respository for signed packages"
+-svn checkout \
+-	--trust-server-cert \
+-	--non-interactive \
+-	--username ${USERNAME} \
+-	--password ${PASSWORD} \
+-	${SIGNED_REPO_URL} \
+-	${SIGNED_REPO_COPY}
++SVN_ATTEMPT=0
++SVN_SUCCESS=0
++while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
++	rm -rf ${SIGNED_REPO_COPY}
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++	if [ $? -eq 0 ]; then
++		SVN_SUCCESS=1
++		break
++	else
++		((++SVN_ATTEMPT))
++		sleep 5
++	fi
++done
+ 
++if [ ${SVN_SUCCESS} -eq 0 ]; then
++	echo "Checkout of respository for signed packages failed"
++	exit 1
++fi
++
+ # Copy notarization file to repository for signed packages
+ cp ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY}
+ svn add ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} > /dev/null 2>&1
+@@ -263,6 +281,8 @@
+ # Remove lock file from repository for signed packages
+ svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+ 
++SVN_ATTEMPT=0
++SVN_SUCCESS=0
+ if [ ${SUCCESS} -eq 1 ]; then
+ 	# Copy signed package to repository for signed packages
+ 	cp ${COMPRESSED_PKG} ${SIGNED_REPO_COPY}
+@@ -270,21 +290,49 @@
+ 
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY}
++	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		if [ $? -eq 0 ]; then
++			SVN_SUCCESS=1
++			break
++		else
++			((++SVN_ATTEMPT))
++			sleep 5
++		fi
++	done
++
++	if [ ${SVN_SUCCESS} -eq 0 ]; then
++		echo "Commit to respository for signed packages failed"
++		exit 1
++	fi
+ else
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY}
++	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		if [ $? -eq 0 ]; then
++			SVN_SUCCESS=1
++			break
++		else
++			((++SVN_ATTEMPT))
++			sleep 5
++		fi
++	done
+ 
++	if [ ${SVN_SUCCESS} -eq 0 ]; then
++		echo "Commit to respository for signed packages failed"
++		exit 1
++	fi
++
+ 	exit 1
+ fi
+Index: ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25879)
++++ ../trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh	(revision 25880)
+@@ -79,7 +79,8 @@
+ AD_USERNAME="**********" # Apple Developer username
+ ALTOOL_PASSWORD="@keychain:**********" # altool password (assumed to be stored in keychain)
+ ASC_PROVIDER="**********"
+-NOTARIZATION_CHECK_ATTEMPTS=60
++MAX_SVN_ATTEMPTS=10
++NOTARIZATION_CHECK_ATTEMPTS=20
+ NOTARIZATION_CHECK_PERIOD=60
+ NOTARIZATION_LOGFILE="notarization.log"
+ NOTARIZATION_LOGFILE_PATH="."
+@@ -258,14 +259,31 @@
+ 
+ # Check out copy of repository for signed packages
+ echo "Checking out copy of respository for signed packages"
+-svn checkout \
+-	--trust-server-cert \
+-	--non-interactive \
+-	--username ${USERNAME} \
+-	--password ${PASSWORD} \
+-	${SIGNED_REPO_URL} \
+-	${SIGNED_REPO_COPY}
++SVN_ATTEMPT=0
++SVN_SUCCESS=0
++while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
++	rm -rf ${SIGNED_REPO_COPY}
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${USERNAME} \
++		--password ${PASSWORD} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++	if [ $? -eq 0 ]; then
++		SVN_SUCCESS=1
++		break
++	else
++		((++SVN_ATTEMPT))
++		sleep 5
++	fi
++done
+ 
++if [ ${SVN_SUCCESS} -eq 0 ]; then
++	echo "Checkout of respository for signed packages failed"
++	exit 1
++fi
++
+ # Copy notarization file to repository for signed packages
+ cp ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE} ${SIGNED_REPO_COPY}
+ svn add ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} > /dev/null 2>&1
+@@ -273,6 +291,8 @@
+ # Remove lock file from repository for signed packages
+ svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+ 
++SVN_ATTEMPT=0
++SVN_SUCCESS=0
+ if [ ${SUCCESS} -eq 1 ]; then
+ 	# Copy signed package to repository for signed packages
+ 	cp ${COMPRESSED_PKG} ${SIGNED_REPO_COPY}
+@@ -280,21 +300,49 @@
+ 
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY}
++	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "CHG: New signed package (success)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		if [ $? -eq 0 ]; then
++			SVN_SUCCESS=1
++			break
++		else
++			((++SVN_ATTEMPT))
++			sleep 5
++		fi
++	done
++
++	if [ ${SVN_SUCCESS} -eq 0 ]; then
++		echo "Commit to respository for signed packages failed"
++		exit 1
++	fi
+ else
+ 	# Commit changes
+ 	echo "Committing changes to repository for signed packages"
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY}
++	while [[ ${SVN_ATTEMPT} -lt ${MAX_SVN_ATTEMPTS} && ${SVN_SUCCESS} -eq 0 ]]; do
++		svn commit \
++			--trust-server-cert \
++			--non-interactive \
++			--username ${USERNAME} \
++			--password ${PASSWORD} \
++			--message "CHG: New signed package (failure)" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++		if [ $? -eq 0 ]; then
++			SVN_SUCCESS=1
++			break
++		else
++			((++SVN_ATTEMPT))
++			sleep 5
++		fi
++	done
+ 
++	if [ ${SVN_SUCCESS} -eq 0 ]; then
++		echo "Commit to respository for signed packages failed"
++		exit 1
++	fi
++
+ 	exit 1
+ fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25880-25881.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25880-25881.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25880-25881.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 25880)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 25881)
+@@ -48,7 +48,7 @@
+ 	curl		install-7-mac-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+ 	proj		install-6.2-static.sh
+-	gdal		install-3-python-netcdf-static.sh
++	gdal		install-3-python-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac-static.sh
+ 	gmsh		install-4-static.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 25880)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 25881)
+@@ -48,7 +48,7 @@
+ 	curl		install-7-linux-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+ 	proj		install-6.2-static.sh
+-	gdal		install-3-python-netcdf-static.sh
++	gdal		install-3-python-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux-static.sh
+ 	gmsh		install-4-static.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-25881-25882.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25881-25882.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25881-25882.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25881)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25882)
+@@ -1010,6 +1010,7 @@
+ 		case 9:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
++			parameters->AddObject(new IntParam(FrictionCouplingEnum,0));
+ 			break;
+ 		case 10:
+ 			parameters->AddObject(new IntParam(FrictionCouplingEnum,2)); /*comment this line to use effective pressure from Beuler and Pelt (2015)*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-25882-25883.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25882-25883.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25882-25883.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/c/cores/movingfront_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 25882)
++++ ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 25883)
+@@ -133,12 +133,6 @@
+ 	/* update vertices included for next calculation */
+ 	GetMaskOfIceVerticesLSMx(femmodel);
+ 
+-	/* add computation domain mask to outputs */
+-	if(save_results){
+-		int outputs[1] = {IceMaskNodeActivationEnum};
+-		femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],1);
+-	}
+-	
+ 	/*End profiler*/
+ 	femmodel->profiler->Stop(MOVINGFRONTCORE);
+ }
Index: /issm/oecreview/Archive/25834-26739/ISSM-25883-25884.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25883-25884.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25883-25884.diff	(revision 26740)
@@ -0,0 +1,941 @@
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25884)
+@@ -0,0 +1,216 @@
++#!/bin/bash
++
++################################################################################
++# Commits ISSM distributable package for macOS with MATLAB API to repository 
++# for signing. This repository is polled by a project running on a JPL 
++# Cybersecurity Jenkins server and performs the actual signing and 
++# notarization.
++#
++# Options:
++# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
++#						signing/notarization if it fails but build and package 
++#						are valid.
++# -u/--unlock			Remove lock file from signed package repository. Use if 
++#						build is aborted to allow for subsequent fresh build.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#		ISSM_BINARIES_REPO_PASS
++#		ISSM_BINARIES_REPO_USER
++#		SIGNED_REPO_COPY
++#		SIGNED_REPO_URL
++#
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-matlab.sh
++# - packagers/mac/sign-issm-mac-binaries-matlab.sh
++################################################################################
++
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
++# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
++#
++#	Command line tool support for Subversion — including svn, git-svn, and 
++#	related commands — is no longer provided by Xcode. (50266910)
++#
++# which results in,
++#
++#	svn: error: The subversion command line tools are no longer provided by 
++#	Xcode.
++#
++# when calling svn, even when subversion is installed via Homebrew and its path 
++# is available in PATH.
++#
++# NOTE: May be able to remove this after updating macOS.
++#
++alias svn='/usr/local/bin/svn'
++
++## Override certain other aliases
++#
++alias cp=$(which cp)
++alias grep=$(which grep)
++
++## Constants
++#
++MAX_SIGNING_CHECK_ATTEMPTS=30
++NOTARIZATION_LOGFILE="notarization.log"
++RETRIGGER_SIGNING_FILE="retrigger.txt"
++SIGNING_CHECK_PERIOD=60 # in seconds
++SIGNING_LOCK_FILE="signing.lock"
++UNSIGNED_REPO_COPY="./unsigned"
++UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
++
++## Functions
++#
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++}
++checkout_unsigned_repo_copy(){
++	echo "Checking out copy of repository for unsigned packages"
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${UNSIGNED_REPO_URL} \
++		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++}
++validate_signed_repo_copy(){
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
++	fi
++}
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can use only one option at a time"
++	exit 1
++fi
++
++retrigger_signing=0
++unlock=0
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-r|--resign)	retrigger_signing=1;	;;
++		-u|--unlock)	unlock=1;				;;
++		*) echo "Unknown parameter passed: $1"; exit 1	;;
++	esac
++fi
++
++validate_signed_repo_copy
++
++if [ ${unlock} -eq 1 ]; then
++	# Remove signing lock file from signed package repository so that a new 
++	# build can run
++	echo "Removing lock file from repository for signed packages"
++	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
++
++	echo "Remove -u/--unlock option from configuration and run again"
++	exit 1
++fi
++
++# If lock file exists, a signing build is still in process by JPL Cybersecurity
++svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++	echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
++	exit 1
++fi
++
++# Commit lock file to repository for signed packages
++echo "Committing lock file to repository for signed packages"
++touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++svn commit \
++	--trust-server-cert \
++	--non-interactive \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++
++# Check out copy of repository for unsigned packages
++checkout_unsigned_repo_copy
++
++if [ ${retrigger_signing} -eq 0 ]; then
++	# Commit new compressed package to repository for unsigned binaries
++	echo "Committing package to repository for unsigned packages"
++	cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
++	svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++else
++	# NOTE: If notarize_only == 1, we commit a dummy file as we do not want to 
++	#		have to commit the entire compressed package again simply to 
++	#		retrigger the signing build on the remote JPL Cybersecurity Jenkins 
++	#		server.
++	#
++	echo "Attempting to sign existing package again"
++	echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
++	svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++fi
++
++# Check status of signing
++echo "Checking progress of signing..."
++SIGNING_CHECK_ATTEMPT=0
++while [ ${SIGNING_CHECK_ATTEMPT} -lt ${MAX_SIGNING_CHECK_ATTEMPTS} ]; do
++	echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
++	sleep ${SIGNING_CHECK_PERIOD}
++	svn up ${SIGNED_REPO_COPY}
++
++	if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++		# Retrieve notarization lock file
++		svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++
++		# Check status
++		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
++		if [[ "${STATUS}" == "success" ]]; then
++			echo "Notarization successful!"
++		else
++			echo "Notarization failed!"
++			echo "----------------------- Contents of notarization logfile -----------------------"
++			cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++			echo "--------------------------------------------------------------------------------"
++
++			exit 1
++		fi
++	else
++		((++SIGNING_CHECK_ATTEMPT))
++	fi
++done
+
+Property changes on: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25884)
+@@ -0,0 +1,117 @@
++#!/bin/bash
++
++################################################################################
++# Wrapper script for Jenkins project to build, package, and commit ISSM 
++# distributable package for macOS with MATLAB API to repository for signing. 
++# Normally, we would put this directly into the project configuration under 
++# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
++# good idea to version it.
++#
++# When no failures/errors occur, performs the following:
++# - Builds ISSM according to configuration.
++# - Packages and compresses executables and libraries.
++# - Runs test suite against package.
++# - Commits compressed package to repository to be signed by JPL Cybersecurity.
++# - Retrieves signed package and transmits it to ISSM Web site for 
++#	distribution.
++#
++# Options:
++# -b/--skipbuild		Skip ISSM compilation.
++# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
++#						signing/notarization if it fails but build and package 
++#						are valid.
++# -s/--skiptests		Skip ISSM compilation and testing during packaging 
++#						step. Use if 
++# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
++#						fails for some reason to skip building, packaging, and 
++#						signing.
++# -u/--unlock			Remove lock file from signed package repository. Use if 
++#						build is aborted to allow for subsequent fresh build.
++#
++# Debugging:
++# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
++#	Jenkins server. Debugging may be perfomed locally by running,
++#
++#		packagers/mac/sign-issm-mac-binaries-matlab.sh
++#
++#	with "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" hardcoded to Apple 
++#	Developer credentials.
++# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
++#	help debug potential SVN issues.
++#
++# NOTE:
++# - Use only *one* of the above options at a time, and make sure it is removed 
++#	again after a single run.
++# - Builds will fail when any of the above options are used on a clean 
++#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
++#	select menu is set to "Always check out a fresh copy".
++# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
++#	the 'Bindings' section under a 'Username and password (separated)' binding 
++#	(requires 'Credentials Binding Plugin') with 'Credentials' select menu set 
++#	to "jenkins/****** (SVN repository for ISSM binaries)".
++################################################################################
++
++## Constants
++#
++PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
++SIGNED_REPO_COPY="./signed"
++SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
++
++COMPRESSED_PKG="${PKG}.zip"
++
++## Environment
++#
++export COMPRESSED_PKG
++export ISSM_BINARIES_REPO_PASS
++export ISSM_BINARIES_REPO_USER
++export PKG
++export SIGNED_REPO_COPY
++export SIGNED_REPO_URL
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can only use one option at a time"
++	exit 1
++fi
++
++# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
++#		but the following is self-documenting).
++#
++build=1
++package=1
++sign=1
++transfer=1
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-b|--skipbuild)		build=0;							shift	;;
++		-r|--resign)		build=0;	package=0;						;;
++		-s|--skiptests)		build=0;									;;
++		-t|--transferonly)	build=0;	package=0;	sign=0;		shift	;;
++		-u|--unlock)		build=0;	package=0;	transfer=0;			;;
++		*) echo "Unknown parameter passed: $1"; exit 1 					;;
++	esac
++fi
++
++# Build
++if [ ${build} -eq 1 ]; then
++	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-matlab
++fi
++
++# Package
++if [ ${package} -eq 1 ]; then
++	./packagers/mac/package-issm-mac-binaries-matlab.sh $1
++	shift # Clear $1 so that it is not passed to commit_for_signing script
++fi
++
++# Commit for signing
++if [ ${sign} -eq 1 ]; then
++	./packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh $1
++fi
++
++# Transfer distributable package to ISSM Web site
++if [ ${transfer} -eq 1 ]; then
++	./packagers/mac/transfer-issm-mac-binaries-matlab.sh
++fi
++
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25883)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25884)
+@@ -1,46 +1,21 @@
+ #!/bin/bash
+ 
+ ################################################################################
+-# To be used after running,
++# Packages and tests ISSM distributable package for macOS with MATLAB API.
+ #
+-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-matlab
+-#
+-# in the context of a Jenkins project.
+-#
+-# When no runtime errors occur, performs the following:
+-# - Checks resulting executables and libraries against test suite.
+-# - Packages and compresses executables and libraries.
+-# - Commits compressed package to repository to be signed by JPL Cybersecurity.
+-# - Retrieves signed package and transmits it to ISSM Web site for 
+-#	distribution.
+-#
+ # Options:
+-# -n/--notarizeonly		Sign/notarize only (use if signing/notarization fails 
+-#						to skip tests/packaging)
+-# -s/--skiptests		Skip tests (use if this script fails for some reason 
+-#						after tests have successfully passed to save time)
+-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
+-#						transfer fails for some reason to skip testing and
+-#						signing)
+-# -u/--unlock			Remove lock file from signed package repository (use if 
+-#						build is aborted to allow for subsequent fresh build)
++# -s/--skiptests		Skip tests and package only.
+ #
+-# Debugging:
+-# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+-#	Jenkins server. Debugging may be perfomed locally by running,
++# NOTE:
++# - Assumes that the following constants are defined,
+ #
+-#		packagers/mac/sign-issm-mac-binaries-matlab.sh
++#		COMPRESSED_PKG
++#		ISSM_DIR
++#		PKG
+ #
+-#	with Apple Developer credentials.
+-# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
+-#	help debug potential SVN issues.
+-#
+-# NOTE:
+-# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+-#	the 'Bindings' section under a 'Username and password (separated)' binding 
+-#	(requires 'Credentials Binding Plugin').
+-# - For local debugging, the aformentioned credentials can be hardcoded into 
+-#	the 'USERNAME' and 'PASSWORD' constants below.
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-matlab.sh
++# - packagers/mac/sign-issm-mac-binaries-matlab.sh
+ ################################################################################
+ 
+ # Expand aliases within the context of this script
+@@ -65,6 +40,7 @@
+ 
+ ## Override certain other aliases
+ #
++alias cp=$(which cp)
+ alias grep=$(which grep)
+ 
+ ## Constants
+@@ -71,61 +47,11 @@
+ #
+ MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2006,2020,2021,2051,2052,2053,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ MATLAB_PATH="/Applications/MATLAB_R2018a.app"
+-NOTARIZATION_LOGFILE="notarization.log"
+-PASSWORD=${ISSM_BINARIES_PASS}
+-PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
+-RETRIGGER_SIGNING_FILE="retrigger.txt"
+-SIGNED_REPO_COPY="./signed"
+-SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
+-SIGNING_CHECK_PERIOD=60 # in seconds
+-SIGNING_LOCK_FILE="signing.lock"
+-UNSIGNED_REPO_COPY="./unsigned"
+-UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
+-USERNAME=${ISSM_BINARIES_USER}
+ 
+-COMPRESSED_PKG="${PKG}.zip"
+-
+ ## Environment
+ #
+-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
++export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'; used when running tests
+ 
+-## Functions
+-#
+-checkout_signed_repo_copy(){
+-	echo "Checking out copy of repository for signed packages"
+-
+-	# NOTE: Get empty copy because we do not want to have to check out package 
+-	#		from previous signing.
+-	#
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--depth empty \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-checkout_unsigned_repo_copy(){
+-	echo "Checking out copy of repository for unsigned packages"
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		${UNSIGNED_REPO_URL} \
+-		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-validate_signed_repo_copy(){
+-	# Validate copy of repository for signed binaries (e.g. 
+-	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+-	# initial checkout failed)
+-	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+-		rm -rf ${SIGNED_REPO_COPY}
+-		checkout_signed_repo_copy
+-	fi
+-}
+-
+ ## Parse options
+ #
+ if [ $# -gt 1 ]; then
+@@ -133,269 +59,121 @@
+ 	exit 1
+ fi
+ 
+-notarize_only=0
+ skip_tests=0
+-transfer_only=0
+-unlock=0
+-while [ $# -gt 0 ]; do
+-    case $1 in
+-        -n|--notarizeonly) notarize_only=1; shift ;;
+-        -s|--skiptests) skip_tests=1; shift ;;
+-        -t|--transferonly) transfer_only=1; shift ;;
+-        -u|--unlock) unlock=1; shift ;;
+-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
+-    esac
+-    shift
+-done
+ 
+-if [ ${unlock} -eq 1 ]; then
+-	# Remove signing lock file from signed package repository so that a new 
+-	# build can run
+-	echo "Removing lock file from repository for signed packages"
+-	checkout_signed_repo_copy
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY}
+-	svn cleanup ${SIGNED_REPO_COPY}
++if [ $# -eq 1 ]; then
++	case $1 in
++		-s|--skiptests)	skip_tests=1;					;;
++		*) echo "Unknown parameter passed: $1"; exit 1	;;
++	esac
++fi
++
++# Check if MATLAB exists
++if ! [ -d ${MATLAB_PATH} ]; then
++	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+ 	exit 1
+ fi
+ 
+-if [ ${transfer_only} -eq 0 ]; then
+-	rm -rf ${SIGNED_REPO_COPY}
++# Clean up from previous packaging
++echo "Cleaning up existing assets"
++cd ${ISSM_DIR}
++rm -rf ${PKG} ${COMPRESSED_PKG}
++mkdir ${PKG}
+ 
+-	checkout_signed_repo_copy
++# Add required binaries and libraries to package and modify them where needed
++cd ${ISSM_DIR}/bin
+ 
+-	# If lock file exists, a signing build is still in process by JPL Cybersecurity
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-		echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+-		exit 1
+-	fi
++echo "Modify generic"
++cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+ 
+-	if [ ${notarize_only} -eq 0 ]; then
+-		# Check if MATLAB exists
+-		if ! [ -d ${MATLAB_PATH} ]; then
+-			echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+-			exit 1
+-		fi
++echo "Moving MPICH binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
++elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
++else
++	echo "MPICH not found"
++	exit 1
++fi
+ 
+-		# Clean up from previous packaging
+-		echo "Cleaning up existing assets"
+-		cd ${ISSM_DIR}
+-		rm -rf ${PKG} ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+-		mkdir ${PKG}
++echo "Moving GDAL binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
++else
++	echo "GDAL not found"
++	exit 1
++fi
+ 
+-		# Add required binaries and libraries to package and modify them where needed
+-		cd ${ISSM_DIR}/bin
++echo "Moving GMT binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
++else
++	echo "GMT not found"
++	exit 1
++fi
+ 
+-		echo "Modify generic"
+-		cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
++echo "Moving Gmsh binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
++	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
++else
++	echo "Gmsh not found"
++	exit 1
++fi
+ 
+-		echo "Moving MPICH binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+-		elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+-		else
+-			echo "MPICH not found"
+-			exit 1
+-		fi
++# Run tests
++if [ ${skip_tests} -eq 0 ]; then
++	echo "Running tests"
++	cd ${ISSM_DIR}/test/NightlyRun
++	rm matlab.log 2> /dev/null
+ 
+-		echo "Moving GDAL binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+-		else
+-			echo "GDAL not found"
+-			exit 1
+-		fi
++	# Run tests, redirecting output to logfile and suppressing output to console
++	${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+ 
+-		echo "Moving GMT binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+-		else
+-			echo "GMT not found"
+-			exit 1
+-		fi
++	# Check that MATLAB did not exit in error
++	matlabExitCode=`echo $?`
++	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab.log | wc -l`
+ 
+-		echo "Moving Gmsh binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+-			cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+-		else
+-			echo "Gmsh not found"
+-			exit 1
+-		fi
++	if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
++		echo "----------MATLAB exited in error!----------"
++		cat matlab.log
++		echo "-----------End of matlab.log-----------"
+ 
+-		# Run tests
+-		if [ ${skip_tests} -eq 0 ]; then
+-			echo "Running tests"
+-			cd ${ISSM_DIR}/test/NightlyRun
+-			rm matlab.log 2> /dev/null
++		# Clean up execution directory
++		rm -rf ${ISSM_DIR}/execution/*
+ 
+-			# Run tests, redirecting output to logfile and suppressing output to console
+-			${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-			# Check that MATLAB did not exit in error
+-			matlabExitCode=`echo $?`
+-			matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab.log | wc -l`
+-
+-			if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-				echo "----------MATLAB exited in error!----------"
+-				cat matlab.log
+-				echo "-----------End of matlab.log-----------"
+-
+-				# Clean up execution directory
+-				rm -rf ${ISSM_DIR}/execution/*
+-
+-				exit 1
+-			fi
+-
+-			# Check that all tests passed
+-			numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-			if [ ${numTestsFailed} -ne 0 ]; then
+-				echo "One or more tests FAILED"
+-				exit 1
+-			else
+-				echo "All tests PASSED"
+-			fi
+-		else
+-			echo "Skipping tests"
+-		fi
+-
+-		# Create package
+-		cd ${ISSM_DIR}
+-		svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+-		echo "Copying assets to package: ${PKG}"
+-		cp -rf bin examples lib scripts test ${PKG}/
+-		mkdir ${PKG}/execution
+-		cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
+-		echo "Cleaning up unneeded/unwanted files"
+-		rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+-		rm -f ${PKG}/lib/*.a # Remove static libraries from package
+-		rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+-		rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+-
+-		# Compress package
+-		echo "Compressing package"
+-		ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
+-	else
+-		# Assume that previous build was successful, but signing/notarization 
+-		# failed.
+-		#
+-		echo "Notarizing only"
++		exit 1
+ 	fi
+ 
+-	# Commit lock file to repository for signed packages
+-	echo "Committing lock file to repository for signed packages"
+-	touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "ADD: New lock file" ${SIGNED_REPO_COPY}
++	# Check that all tests passed
++	numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+ 
+-	# Check out copy of repository for unsigned packages
+-	checkout_unsigned_repo_copy
+-
+-	if [ ${notarize_only} -eq 0 ]; then
+-		# Commit new compressed package to repository for unsigned binaries
+-		#
+-		# NOTE: This will not work if, for any reason, the checksum on the compressed 
+-		#		package is unchanged.
+-		#
+-		echo "Committing package to repository for unsigned packages"
+-		cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+-		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
+-		svn commit \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY}
++	if [ ${numTestsFailed} -ne 0 ]; then
++		echo "One or more tests FAILED"
++		exit 1
+ 	else
+-		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
+-		#		build on the remote JPL Cybersecurity Jenkins server is 
+-		#		triggered by polling SCM.
+-		#
+-		echo "Attempting to sign existing package again"
+-		echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
+-		svcheckout_unsigned_repo_copyn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-		svn commit \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY}
++		echo "All tests PASSED"
+ 	fi
+-
+-	# Check status of signing
+-	echo "Checking progress of signing..."
+-	IN_PROCESS=1
+-	SUCCESS=0
+-
+-	while [ ${IN_PROCESS} -eq 1 ]; do
+-		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+-		sleep ${SIGNING_CHECK_PERIOD}
+-		svn up ${SIGNED_REPO_COPY}
+-
+-		if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-			IN_PROCESS=0
+-
+-			# Retrieve notarization lock file
+-			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-
+-			# Check status
+-			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+-			if [[ "${STATUS}" == "success" ]]; then
+-				echo "Notarization successful!"
+-
+-				# Set flag indicating notarization was successful
+-				SUCCESS=1
+-			else
+-				echo "Notarization failed!"
+-			fi
+-		fi
+-	done
+ else
+-	# Assume that previous build resulted in successful signing of package but 
+-	# that transfer to ISSM Web site failed and user built this project again 
+-	# with -t/--transferonly option.
+-	#
+-
+-	# Make sure copy of repository for signed packages exists
+-	validate_signed_repo_copy
+-
+-	SUCCESS=1
++	echo "Skipping tests"
+ fi
+ 
+-# Handle result of signing
+-if [ ${SUCCESS} -eq 1 ]; then
+-	# Retrieve signed and notarized package
+-	svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++# Create package
++cd ${ISSM_DIR}
++svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
++echo "Copying assets to package: ${PKG}"
++cp -rf bin examples lib scripts test ${PKG}/
++mkdir ${PKG}/execution
++cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
++echo "Cleaning up unneeded/unwanted files"
++rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
++rm -f ${PKG}/lib/*.a # Remove static libraries from package
++rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
++rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+ 
+-	# Transfer signed package to ISSM Web site
+-	echo "Transferring signed package to ISSM Web site"
+-	scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+-
+-	if [ $? -ne 0 ]; then
+-		echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip testing and signing)."
+-		exit 1
+-	fi
+-else
+-	echo "----------------------- Contents of notarization logfile -----------------------"
+-	cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-	echo "--------------------------------------------------------------------------------"
+-
+-	exit 1
+-fi
++# Compress package
++echo "Compressing package"
++ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25884)
+@@ -0,0 +1,85 @@
++#!/bin/bash
++
++################################################################################
++# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
++# site.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#		ISSM_BINARIES_REPO_PASS
++#		ISSM_BINARIES_REPO_USER
++#		SIGNED_REPO_COPY
++#		SIGNED_REPO_URL
++#
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-matlab.sh
++################################################################################
++
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
++# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
++#
++#	Command line tool support for Subversion — including svn, git-svn, and 
++#	related commands — is no longer provided by Xcode. (50266910)
++#
++# which results in,
++#
++#	svn: error: The subversion command line tools are no longer provided by 
++#	Xcode.
++#
++# when calling svn, even when subversion is installed via Homebrew and its path 
++# is available in PATH.
++#
++# NOTE: May be able to remove this after updating macOS.
++#
++alias svn='/usr/local/bin/svn'
++
++## Override certain other aliases
++#
++alias cp=$(which cp)
++alias grep=$(which grep)
++
++## Functions
++#
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++}
++validate_signed_repo_copy(){
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
++	fi
++}
++
++# Check if working copy of repository for signed packages is missing
++validate_signed_repo_copy
++
++# Retrieve signed and notarized package
++svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++
++# Transfer signed package to ISSM Web site
++echo "Transferring signed package to ISSM Web site"
++scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++
++if [ $? -ne 0 ]; then
++	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
++	exit 1
++fi
+
+Property changes on: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25884-25885.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25884-25885.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25884-25885.diff	(revision 26740)
@@ -0,0 +1,447 @@
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25884)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(nonexistent)
+@@ -1,117 +0,0 @@
+-#!/bin/bash
+-
+-################################################################################
+-# Wrapper script for Jenkins project to build, package, and commit ISSM 
+-# distributable package for macOS with MATLAB API to repository for signing. 
+-# Normally, we would put this directly into the project configuration under 
+-# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
+-# good idea to version it.
+-#
+-# When no failures/errors occur, performs the following:
+-# - Builds ISSM according to configuration.
+-# - Packages and compresses executables and libraries.
+-# - Runs test suite against package.
+-# - Commits compressed package to repository to be signed by JPL Cybersecurity.
+-# - Retrieves signed package and transmits it to ISSM Web site for 
+-#	distribution.
+-#
+-# Options:
+-# -b/--skipbuild		Skip ISSM compilation.
+-# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
+-#						signing/notarization if it fails but build and package 
+-#						are valid.
+-# -s/--skiptests		Skip ISSM compilation and testing during packaging 
+-#						step. Use if 
+-# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
+-#						fails for some reason to skip building, packaging, and 
+-#						signing.
+-# -u/--unlock			Remove lock file from signed package repository. Use if 
+-#						build is aborted to allow for subsequent fresh build.
+-#
+-# Debugging:
+-# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+-#	Jenkins server. Debugging may be perfomed locally by running,
+-#
+-#		packagers/mac/sign-issm-mac-binaries-matlab.sh
+-#
+-#	with "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" hardcoded to Apple 
+-#	Developer credentials.
+-# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
+-#	help debug potential SVN issues.
+-#
+-# NOTE:
+-# - Use only *one* of the above options at a time, and make sure it is removed 
+-#	again after a single run.
+-# - Builds will fail when any of the above options are used on a clean 
+-#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
+-#	select menu is set to "Always check out a fresh copy".
+-# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+-#	the 'Bindings' section under a 'Username and password (separated)' binding 
+-#	(requires 'Credentials Binding Plugin') with 'Credentials' select menu set 
+-#	to "jenkins/****** (SVN repository for ISSM binaries)".
+-################################################################################
+-
+-## Constants
+-#
+-PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
+-SIGNED_REPO_COPY="./signed"
+-SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
+-
+-COMPRESSED_PKG="${PKG}.zip"
+-
+-## Environment
+-#
+-export COMPRESSED_PKG
+-export ISSM_BINARIES_REPO_PASS
+-export ISSM_BINARIES_REPO_USER
+-export PKG
+-export SIGNED_REPO_COPY
+-export SIGNED_REPO_URL
+-
+-## Parse options
+-#
+-if [ $# -gt 1 ]; then
+-	echo "Can only use one option at a time"
+-	exit 1
+-fi
+-
+-# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
+-#		but the following is self-documenting).
+-#
+-build=1
+-package=1
+-sign=1
+-transfer=1
+-
+-if [ $# -eq 1 ]; then
+-	case $1 in
+-		-b|--skipbuild)		build=0;							shift	;;
+-		-r|--resign)		build=0;	package=0;						;;
+-		-s|--skiptests)		build=0;									;;
+-		-t|--transferonly)	build=0;	package=0;	sign=0;		shift	;;
+-		-u|--unlock)		build=0;	package=0;	transfer=0;			;;
+-		*) echo "Unknown parameter passed: $1"; exit 1 					;;
+-	esac
+-fi
+-
+-# Build
+-if [ ${build} -eq 1 ]; then
+-	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-matlab
+-fi
+-
+-# Package
+-if [ ${package} -eq 1 ]; then
+-	./packagers/mac/package-issm-mac-binaries-matlab.sh $1
+-	shift # Clear $1 so that it is not passed to commit_for_signing script
+-fi
+-
+-# Commit for signing
+-if [ ${sign} -eq 1 ]; then
+-	./packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh $1
+-fi
+-
+-# Transfer distributable package to ISSM Web site
+-if [ ${transfer} -eq 1 ]; then
+-	./packagers/mac/transfer-issm-mac-binaries-matlab.sh
+-fi
+-
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25884)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(nonexistent)
+@@ -1,85 +0,0 @@
+-#!/bin/bash
+-
+-################################################################################
+-# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
+-# site.
+-#
+-# NOTE:
+-# - Assumes that the following constants are defined,
+-#
+-#		COMPRESSED_PKG
+-#		ISSM_BINARIES_REPO_PASS
+-#		ISSM_BINARIES_REPO_USER
+-#		SIGNED_REPO_COPY
+-#		SIGNED_REPO_URL
+-#
+-# See also:
+-# - packagers/mac/complete-issm-mac-binaries-matlab.sh
+-################################################################################
+-
+-# Expand aliases within the context of this script
+-shopt -s expand_aliases
+-
+-# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+-#
+-#	Command line tool support for Subversion — including svn, git-svn, and 
+-#	related commands — is no longer provided by Xcode. (50266910)
+-#
+-# which results in,
+-#
+-#	svn: error: The subversion command line tools are no longer provided by 
+-#	Xcode.
+-#
+-# when calling svn, even when subversion is installed via Homebrew and its path 
+-# is available in PATH.
+-#
+-# NOTE: May be able to remove this after updating macOS.
+-#
+-alias svn='/usr/local/bin/svn'
+-
+-## Override certain other aliases
+-#
+-alias cp=$(which cp)
+-alias grep=$(which grep)
+-
+-## Functions
+-#
+-checkout_signed_repo_copy(){
+-	echo "Checking out copy of repository for signed packages"
+-
+-	# NOTE: Get empty copy because we do not want to have to check out package 
+-	#		from previous signing.
+-	#
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--depth empty \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_PASS} \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-validate_signed_repo_copy(){
+-	# Validate copy of repository for signed binaries (e.g. 
+-	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+-	# initial checkout failed)
+-	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+-		rm -rf ${SIGNED_REPO_COPY}
+-		checkout_signed_repo_copy
+-	fi
+-}
+-
+-# Check if working copy of repository for signed packages is missing
+-validate_signed_repo_copy
+-
+-# Retrieve signed and notarized package
+-svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+-
+-# Transfer signed package to ISSM Web site
+-echo "Transferring signed package to ISSM Web site"
+-scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+-
+-if [ $? -ne 0 ]; then
+-	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
+-	exit 1
+-fi
+
+Property changes on: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25884)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(nonexistent)
+@@ -1,216 +0,0 @@
+-#!/bin/bash
+-
+-################################################################################
+-# Commits ISSM distributable package for macOS with MATLAB API to repository 
+-# for signing. This repository is polled by a project running on a JPL 
+-# Cybersecurity Jenkins server and performs the actual signing and 
+-# notarization.
+-#
+-# Options:
+-# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
+-#						signing/notarization if it fails but build and package 
+-#						are valid.
+-# -u/--unlock			Remove lock file from signed package repository. Use if 
+-#						build is aborted to allow for subsequent fresh build.
+-#
+-# NOTE:
+-# - Assumes that the following constants are defined,
+-#
+-#		COMPRESSED_PKG
+-#		ISSM_BINARIES_REPO_PASS
+-#		ISSM_BINARIES_REPO_USER
+-#		SIGNED_REPO_COPY
+-#		SIGNED_REPO_URL
+-#
+-# See also:
+-# - packagers/mac/complete-issm-mac-binaries-matlab.sh
+-# - packagers/mac/sign-issm-mac-binaries-matlab.sh
+-################################################################################
+-
+-# Expand aliases within the context of this script
+-shopt -s expand_aliases
+-
+-# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+-#
+-#	Command line tool support for Subversion — including svn, git-svn, and 
+-#	related commands — is no longer provided by Xcode. (50266910)
+-#
+-# which results in,
+-#
+-#	svn: error: The subversion command line tools are no longer provided by 
+-#	Xcode.
+-#
+-# when calling svn, even when subversion is installed via Homebrew and its path 
+-# is available in PATH.
+-#
+-# NOTE: May be able to remove this after updating macOS.
+-#
+-alias svn='/usr/local/bin/svn'
+-
+-## Override certain other aliases
+-#
+-alias cp=$(which cp)
+-alias grep=$(which grep)
+-
+-## Constants
+-#
+-MAX_SIGNING_CHECK_ATTEMPTS=30
+-NOTARIZATION_LOGFILE="notarization.log"
+-RETRIGGER_SIGNING_FILE="retrigger.txt"
+-SIGNING_CHECK_PERIOD=60 # in seconds
+-SIGNING_LOCK_FILE="signing.lock"
+-UNSIGNED_REPO_COPY="./unsigned"
+-UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
+-
+-## Functions
+-#
+-checkout_signed_repo_copy(){
+-	echo "Checking out copy of repository for signed packages"
+-
+-	# NOTE: Get empty copy because we do not want to have to check out package 
+-	#		from previous signing.
+-	#
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--depth empty \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_PASS} \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-checkout_unsigned_repo_copy(){
+-	echo "Checking out copy of repository for unsigned packages"
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_PASS} \
+-		${UNSIGNED_REPO_URL} \
+-		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-validate_signed_repo_copy(){
+-	# Validate copy of repository for signed binaries (e.g. 
+-	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+-	# initial checkout failed)
+-	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+-		rm -rf ${SIGNED_REPO_COPY}
+-		checkout_signed_repo_copy
+-	fi
+-}
+-
+-## Parse options
+-#
+-if [ $# -gt 1 ]; then
+-	echo "Can use only one option at a time"
+-	exit 1
+-fi
+-
+-retrigger_signing=0
+-unlock=0
+-
+-if [ $# -eq 1 ]; then
+-	case $1 in
+-		-r|--resign)	retrigger_signing=1;	;;
+-		-u|--unlock)	unlock=1;				;;
+-		*) echo "Unknown parameter passed: $1"; exit 1	;;
+-	esac
+-fi
+-
+-validate_signed_repo_copy
+-
+-if [ ${unlock} -eq 1 ]; then
+-	# Remove signing lock file from signed package repository so that a new 
+-	# build can run
+-	echo "Removing lock file from repository for signed packages"
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_PASS} \
+-		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+-	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
+-
+-	echo "Remove -u/--unlock option from configuration and run again"
+-	exit 1
+-fi
+-
+-# If lock file exists, a signing build is still in process by JPL Cybersecurity
+-svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-	echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+-	exit 1
+-fi
+-
+-# Commit lock file to repository for signed packages
+-echo "Committing lock file to repository for signed packages"
+-touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+-svn commit \
+-	--trust-server-cert \
+-	--non-interactive \
+-	--username ${ISSM_BINARIES_REPO_USER} \
+-	--password ${ISSM_BINARIES_REPO_PASS} \
+-	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+-
+-# Check out copy of repository for unsigned packages
+-checkout_unsigned_repo_copy
+-
+-if [ ${retrigger_signing} -eq 0 ]; then
+-	# Commit new compressed package to repository for unsigned binaries
+-	echo "Committing package to repository for unsigned packages"
+-	cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+-	svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_PASS} \
+-		--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+-else
+-	# NOTE: If notarize_only == 1, we commit a dummy file as we do not want to 
+-	#		have to commit the entire compressed package again simply to 
+-	#		retrigger the signing build on the remote JPL Cybersecurity Jenkins 
+-	#		server.
+-	#
+-	echo "Attempting to sign existing package again"
+-	echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
+-	svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_PASS} \
+-		--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+-fi
+-
+-# Check status of signing
+-echo "Checking progress of signing..."
+-SIGNING_CHECK_ATTEMPT=0
+-while [ ${SIGNING_CHECK_ATTEMPT} -lt ${MAX_SIGNING_CHECK_ATTEMPTS} ]; do
+-	echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+-	sleep ${SIGNING_CHECK_PERIOD}
+-	svn up ${SIGNED_REPO_COPY}
+-
+-	if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-		# Retrieve notarization lock file
+-		svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-
+-		# Check status
+-		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+-		if [[ "${STATUS}" == "success" ]]; then
+-			echo "Notarization successful!"
+-		else
+-			echo "Notarization failed!"
+-			echo "----------------------- Contents of notarization logfile -----------------------"
+-			cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-			echo "--------------------------------------------------------------------------------"
+-
+-			exit 1
+-		fi
+-	else
+-		((++SIGNING_CHECK_ATTEMPT))
+-	fi
+-done
+
+Property changes on: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25885-25886.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25885-25886.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25885-25886.diff	(revision 26740)
@@ -0,0 +1,455 @@
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25886)
+@@ -0,0 +1,216 @@
++#!/bin/bash
++
++################################################################################
++# Commits ISSM distributable package for macOS with MATLAB API to repository 
++# for signing. This repository is polled by a project running on a JPL 
++# Cybersecurity Jenkins server and performs the actual signing and 
++# notarization.
++#
++# Options:
++# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
++#						signing/notarization if it fails but build and package 
++#						are valid.
++# -u/--unlock			Remove lock file from signed package repository. Use if 
++#						build is aborted to allow for subsequent fresh build.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#		ISSM_BINARIES_REPO_PASS
++#		ISSM_BINARIES_REPO_USER
++#		SIGNED_REPO_COPY
++#		SIGNED_REPO_URL
++#
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-matlab.sh
++# - packagers/mac/sign-issm-mac-binaries-matlab.sh
++################################################################################
++
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
++# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
++#
++#	Command line tool support for Subversion — including svn, git-svn, and 
++#	related commands — is no longer provided by Xcode. (50266910)
++#
++# which results in,
++#
++#	svn: error: The subversion command line tools are no longer provided by 
++#	Xcode.
++#
++# when calling svn, even when subversion is installed via Homebrew and its path 
++# is available in PATH.
++#
++# NOTE: May be able to remove this after updating macOS.
++#
++alias svn='/usr/local/bin/svn'
++
++## Override certain other aliases
++#
++alias cp=$(which cp)
++alias grep=$(which grep)
++
++## Constants
++#
++MAX_SIGNING_CHECK_ATTEMPTS=30
++NOTARIZATION_LOGFILE="notarization.log"
++RETRIGGER_SIGNING_FILE="retrigger.txt"
++SIGNING_CHECK_PERIOD=60 # in seconds
++SIGNING_LOCK_FILE="signing.lock"
++UNSIGNED_REPO_COPY="./unsigned"
++UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
++
++## Functions
++#
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++}
++checkout_unsigned_repo_copy(){
++	echo "Checking out copy of repository for unsigned packages"
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${UNSIGNED_REPO_URL} \
++		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++}
++validate_signed_repo_copy(){
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
++	fi
++}
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can use only one option at a time"
++	exit 1
++fi
++
++retrigger_signing=0
++unlock=0
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-r|--resign)	retrigger_signing=1;	;;
++		-u|--unlock)	unlock=1;				;;
++		*) echo "Unknown parameter passed: $1"; exit 1	;;
++	esac
++fi
++
++validate_signed_repo_copy
++
++if [ ${unlock} -eq 1 ]; then
++	# Remove signing lock file from signed package repository so that a new 
++	# build can run
++	echo "Removing lock file from repository for signed packages"
++	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
++
++	echo "Remove -u/--unlock option from configuration and run again"
++	exit 1
++fi
++
++# If lock file exists, a signing build is still in process by JPL Cybersecurity
++svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++	echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
++	exit 1
++fi
++
++# Commit lock file to repository for signed packages
++echo "Committing lock file to repository for signed packages"
++touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++svn commit \
++	--trust-server-cert \
++	--non-interactive \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++
++# Check out copy of repository for unsigned packages
++checkout_unsigned_repo_copy
++
++if [ ${retrigger_signing} -eq 0 ]; then
++	# Commit new compressed package to repository for unsigned binaries
++	echo "Committing package to repository for unsigned packages"
++	cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
++	svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++else
++	# NOTE: If notarize_only == 1, we commit a dummy file as we do not want to 
++	#		have to commit the entire compressed package again simply to 
++	#		retrigger the signing build on the remote JPL Cybersecurity Jenkins 
++	#		server.
++	#
++	echo "Attempting to sign existing package again"
++	echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
++	svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++fi
++
++# Check status of signing
++echo "Checking progress of signing..."
++SIGNING_CHECK_ATTEMPT=0
++while [ ${SIGNING_CHECK_ATTEMPT} -lt ${MAX_SIGNING_CHECK_ATTEMPTS} ]; do
++	echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
++	sleep ${SIGNING_CHECK_PERIOD}
++	svn up ${SIGNED_REPO_COPY}
++
++	if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++		# Retrieve notarization lock file
++		svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++
++		# Check status
++		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
++		if [[ "${STATUS}" == "success" ]]; then
++			echo "Notarization successful!"
++		else
++			echo "Notarization failed!"
++			echo "----------------------- Contents of notarization logfile -----------------------"
++			cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++			echo "--------------------------------------------------------------------------------"
++
++			exit 1
++		fi
++	else
++		((++SIGNING_CHECK_ATTEMPT))
++	fi
++done
+
+Property changes on: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25886)
+@@ -0,0 +1,118 @@
++#!/bin/bash
++
++################################################################################
++# Wrapper script to build, package, send for signing, and transfer to ISSM Web 
++# site ISSM distributable package for macOS with MATLAB API.
++#
++# Normally, we would put this directly into the project configuration under 
++# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
++# good idea to version it.
++#
++# When no failures/errors occur, performs the following:
++# - Builds ISSM according to configuration.
++# - Packages and compresses executables and libraries.
++# - Runs test suite against package.
++# - Commits compressed package to repository to be signed by JPL Cybersecurity.
++# - Retrieves signed package and transmits it to ISSM Web site for 
++#	distribution.
++#
++# Options:
++# -b/--skipbuild		Skip ISSM compilation.
++# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
++#						signing/notarization if it fails but build and package 
++#						are valid.
++# -s/--skiptests		Skip ISSM compilation and testing during packaging 
++#						step. Use if 
++# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
++#						fails for some reason to skip building, packaging, and 
++#						signing.
++# -u/--unlock			Remove lock file from signed package repository. Use if 
++#						build is aborted to allow for subsequent fresh build.
++#
++# Debugging:
++# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
++#	Jenkins server. Debugging may be perfomed locally by running,
++#
++#		packagers/mac/sign-issm-mac-binaries-matlab.sh
++#
++#	with "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" hardcoded to Apple 
++#	Developer credentials.
++# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
++#	help debug potential SVN issues.
++#
++# NOTE:
++# - Use only *one* of the above options at a time, and make sure it is removed 
++#	again after a single run.
++# - Builds will fail when any of the above options are used on a clean 
++#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
++#	select menu is set to "Always check out a fresh copy".
++# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
++#	the 'Bindings' section under a 'Username and password (separated)' binding 
++#	(requires 'Credentials Binding Plugin') with 'Credentials' select menu set 
++#	to "jenkins/****** (SVN repository for ISSM binaries)".
++################################################################################
++
++## Constants
++#
++PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
++SIGNED_REPO_COPY="./signed"
++SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
++
++COMPRESSED_PKG="${PKG}.zip"
++
++## Environment
++#
++export COMPRESSED_PKG
++export ISSM_BINARIES_REPO_PASS
++export ISSM_BINARIES_REPO_USER
++export PKG
++export SIGNED_REPO_COPY
++export SIGNED_REPO_URL
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can only use one option at a time"
++	exit 1
++fi
++
++# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
++#		but the following is self-documenting).
++#
++build=1
++package=1
++sign=1
++transfer=1
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-b|--skipbuild)		build=0;							shift	;;
++		-r|--resign)		build=0;	package=0;						;;
++		-s|--skiptests)		build=0;									;;
++		-t|--transferonly)	build=0;	package=0;	sign=0;				;;
++		-u|--unlock)		build=0;	package=0;	transfer=0;			;;
++		*) echo "Unknown parameter passed: $1"; exit 1 					;;
++	esac
++fi
++
++# Build
++if [ ${build} -eq 1 ]; then
++	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-matlab
++fi
++
++# Package
++if [ ${package} -eq 1 ]; then
++	./packagers/mac/package-issm-mac-binaries-matlab.sh $1
++	shift # Clear $1 so that it is not passed to commit_for_signing script
++fi
++
++# Commit for signing
++if [ ${sign} -eq 1 ]; then
++	./packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh $1
++fi
++
++# Transfer distributable package to ISSM Web site
++if [ ${transfer} -eq 1 ]; then
++	./packagers/mac/transfer-issm-mac-binaries-matlab.sh
++fi
++
+
+Property changes on: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25886)
+@@ -0,0 +1,85 @@
++#!/bin/bash
++
++################################################################################
++# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
++# site.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#		ISSM_BINARIES_REPO_PASS
++#		ISSM_BINARIES_REPO_USER
++#		SIGNED_REPO_COPY
++#		SIGNED_REPO_URL
++#
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-matlab.sh
++################################################################################
++
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
++# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
++#
++#	Command line tool support for Subversion — including svn, git-svn, and 
++#	related commands — is no longer provided by Xcode. (50266910)
++#
++# which results in,
++#
++#	svn: error: The subversion command line tools are no longer provided by 
++#	Xcode.
++#
++# when calling svn, even when subversion is installed via Homebrew and its path 
++# is available in PATH.
++#
++# NOTE: May be able to remove this after updating macOS.
++#
++alias svn='/usr/local/bin/svn'
++
++## Override certain other aliases
++#
++alias cp=$(which cp)
++alias grep=$(which grep)
++
++## Functions
++#
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++}
++validate_signed_repo_copy(){
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
++	fi
++}
++
++# Check if working copy of repository for signed packages is missing
++validate_signed_repo_copy
++
++# Retrieve signed and notarized package
++svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++
++# Transfer signed package to ISSM Web site
++echo "Transferring signed package to ISSM Web site"
++scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++
++if [ $? -ne 0 ]; then
++	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
++	exit 1
++fi
+
+Property changes on: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25886-25887.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25886-25887.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25886-25887.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25886)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25887)
+@@ -63,8 +63,6 @@
+ ## Environment
+ #
+ export COMPRESSED_PKG
+-export ISSM_BINARIES_REPO_PASS
+-export ISSM_BINARIES_REPO_USER
+ export PKG
+ export SIGNED_REPO_COPY
+ export SIGNED_REPO_URL
Index: /issm/oecreview/Archive/25834-26739/ISSM-25887-25888.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25887-25888.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25887-25888.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25887)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25888)
+@@ -55,7 +55,7 @@
+ 		--non-interactive \
+ 		--depth empty \
+ 		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_PASS} \
++		--password ${ISSM_BINARIES_REPO_USER} \
+ 		${SIGNED_REPO_URL} \
+ 		${SIGNED_REPO_COPY} > /dev/null 2>&1
+ }
+@@ -69,6 +69,10 @@
+ 	fi
+ }
+ 
++# TEST
++echo "ISSM_BINARIES_REPO_USER: ${ISSM_BINARIES_REPO_USER}"
++echo "ISSM_BINARIES_REPO_PASS: ${ISSM_BINARIES_REPO_PASS}"
++
+ # Check if working copy of repository for signed packages is missing
+ validate_signed_repo_copy
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25888-25889.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25888-25889.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25888-25889.diff	(revision 26740)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25888)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25889)
+@@ -69,11 +69,28 @@
+ 
+ ## Parse options
+ #
+-if [ $# -gt 1 ]; then
+-	echo "Can only use one option at a time"
++# NOTE: Checking if more than three arguments because the first two contain 
++#		the repository credentials
++#
++if [ $# -gt 3 ]; then
++	echo "Can use only one option at a time"
+ 	exit 1
+ fi
+ 
++# Retrieve repository credentials
++#
++# NOTE: This is not very secure, but better than maintaining the credentials in 
++#		plaintext
++#
++# TODO: Either maintain credentials in a secret file on node, or write out 
++#		crendentials to file in Jenkins 'Execute shell' and source it in each 
++#		script that requires them
++#
++export ISSM_BINARIES_REPO_USER="${1}" # NOTE: This is not very secure, but 
++shift
++export ISSM_BINARIES_REPO_PASS="${1}" # NOTE: This is not very secure
++shift
++
+ # NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
+ #		but the following is self-documenting).
+ #
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25888)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25889)
+@@ -69,10 +69,6 @@
+ 	fi
+ }
+ 
+-# TEST
+-echo "ISSM_BINARIES_REPO_USER: ${ISSM_BINARIES_REPO_USER}"
+-echo "ISSM_BINARIES_REPO_PASS: ${ISSM_BINARIES_REPO_PASS}"
+-
+ # Check if working copy of repository for signed packages is missing
+ validate_signed_repo_copy
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25889-25890.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25889-25890.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25889-25890.diff	(revision 26740)
@@ -0,0 +1,49 @@
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25889)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25890)
+@@ -123,7 +123,10 @@
+ 	# Remove signing lock file from signed package repository so that a new 
+ 	# build can run
+ 	echo "Removing lock file from repository for signed packages"
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn update \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+ 	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
+ 	svn commit \
+ 		--trust-server-cert \
+@@ -138,7 +141,11 @@
+ fi
+ 
+ # If lock file exists, a signing build is still in process by JPL Cybersecurity
+-svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++svn update \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++
+ if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+ 	echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+ 	exit 1
+@@ -192,11 +199,17 @@
+ while [ ${SIGNING_CHECK_ATTEMPT} -lt ${MAX_SIGNING_CHECK_ATTEMPTS} ]; do
+ 	echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+ 	sleep ${SIGNING_CHECK_PERIOD}
+-	svn up ${SIGNED_REPO_COPY}
++	svn update \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ 	if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+ 		# Retrieve notarization lock file
+-		svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++		svn update \
++			--username ${ISSM_BINARIES_REPO_USER} \
++			--password ${ISSM_BINARIES_REPO_PASS} \
++			${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+ 
+ 		# Check status
+ 		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
Index: /issm/oecreview/Archive/25834-26739/ISSM-25890-25891.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25890-25891.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25890-25891.diff	(revision 26740)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25890)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25891)
+@@ -69,28 +69,11 @@
+ 
+ ## Parse options
+ #
+-# NOTE: Checking if more than three arguments because the first two contain 
+-#		the repository credentials
+-#
+-if [ $# -gt 3 ]; then
++if [ $# -gt 1 ]; then
+ 	echo "Can use only one option at a time"
+ 	exit 1
+ fi
+ 
+-# Retrieve repository credentials
+-#
+-# NOTE: This is not very secure, but better than maintaining the credentials in 
+-#		plaintext
+-#
+-# TODO: Either maintain credentials in a secret file on node, or write out 
+-#		crendentials to file in Jenkins 'Execute shell' and source it in each 
+-#		script that requires them
+-#
+-export ISSM_BINARIES_REPO_USER="${1}" # NOTE: This is not very secure, but 
+-shift
+-export ISSM_BINARIES_REPO_PASS="${1}" # NOTE: This is not very secure
+-shift
+-
+ # NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
+ #		but the following is self-documenting).
+ #
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25890)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25891)
+@@ -73,7 +73,10 @@
+ validate_signed_repo_copy
+ 
+ # Retrieve signed and notarized package
+-svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++svn update \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+ 
+ # Transfer signed package to ISSM Web site
+ echo "Transferring signed package to ISSM Web site"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25891-25892.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25891-25892.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25891-25892.diff	(revision 26740)
@@ -0,0 +1,47 @@
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch	(nonexistent)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch	(revision 25892)
+@@ -0,0 +1,35 @@
++54,55c54,55
++< #set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} <flag>"
++< #     CACHE STRING "CXX Flags for my platform" )
++---
++> set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMPICH_IGNORE_CXX_SEEK"
++>      CACHE STRING "CXX Flags for my platform" )
++67a68,75
++> set( DAKOTA_HAVE_MPI ON
++>  CACHE BOOL "Always build with MPI enabled" FORCE)
++> set( MPI_INCLUDE_PATH
++>  "$ENV{ISSM_DIR}/externalpackages/mpich/install/include"
++>  CACHE FILEPATH "Use installed MPI headers" FORCE)
++> set( MPI_LIBRARY
++>  "$ENV{ISSM_DIR}/externalpackages/mpich/install/lib/libmpich.so"
++>  CACHE FILEPATH "Use installed MPI library" FORCE)
++73,77c73,77
++< #set(BOOST_ROOT
++< #    "path/to/custom/Boost/install/directory"
++< #    CACHE PATH "Use non-standard Boost install" FORCE)
++< #set( Boost_NO_SYSTEM_PATHS TRUE
++< #     CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
++---
++> set(BOOST_ROOT
++>     "$ENV{ISSM_DIR}/externalpackages/boost/install"
++>     CACHE PATH "Use non-standard Boost install" FORCE)
++> set( Boost_NO_SYSTEM_PATHS TRUE
++>      CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
++91,93c91,93
++< #set( CMAKE_INSTALL_PREFIX
++< #     "/path/to/Dakota/installation"
++< #     CACHE PATH "Path to Dakota installation" )
++---
++> set( CMAKE_INSTALL_PREFIX
++>      "$ENV{ISSM_DIR}/externalpackages/dakota/install"
++>      CACHE PATH "Path to Dakota installation" )
+
+Property changes on: ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25892-25893.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25892-25893.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25892-25893.diff	(revision 26740)
@@ -0,0 +1,1039 @@
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(revision 25892)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh	(nonexistent)
+@@ -1,88 +0,0 @@
+-#!/bin/bash
+-
+-################################################################################
+-# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
+-# site.
+-#
+-# NOTE:
+-# - Assumes that the following constants are defined,
+-#
+-#		COMPRESSED_PKG
+-#		ISSM_BINARIES_REPO_PASS
+-#		ISSM_BINARIES_REPO_USER
+-#		SIGNED_REPO_COPY
+-#		SIGNED_REPO_URL
+-#
+-# See also:
+-# - packagers/mac/complete-issm-mac-binaries-matlab.sh
+-################################################################################
+-
+-# Expand aliases within the context of this script
+-shopt -s expand_aliases
+-
+-# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+-#
+-#	Command line tool support for Subversion — including svn, git-svn, and 
+-#	related commands — is no longer provided by Xcode. (50266910)
+-#
+-# which results in,
+-#
+-#	svn: error: The subversion command line tools are no longer provided by 
+-#	Xcode.
+-#
+-# when calling svn, even when subversion is installed via Homebrew and its path 
+-# is available in PATH.
+-#
+-# NOTE: May be able to remove this after updating macOS.
+-#
+-alias svn='/usr/local/bin/svn'
+-
+-## Override certain other aliases
+-#
+-alias cp=$(which cp)
+-alias grep=$(which grep)
+-
+-## Functions
+-#
+-checkout_signed_repo_copy(){
+-	echo "Checking out copy of repository for signed packages"
+-
+-	# NOTE: Get empty copy because we do not want to have to check out package 
+-	#		from previous signing.
+-	#
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--depth empty \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_USER} \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-validate_signed_repo_copy(){
+-	# Validate copy of repository for signed binaries (e.g. 
+-	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+-	# initial checkout failed)
+-	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+-		rm -rf ${SIGNED_REPO_COPY}
+-		checkout_signed_repo_copy
+-	fi
+-}
+-
+-# Check if working copy of repository for signed packages is missing
+-validate_signed_repo_copy
+-
+-# Retrieve signed and notarized package
+-svn update \
+-	--username ${ISSM_BINARIES_REPO_USER} \
+-	--password ${ISSM_BINARIES_REPO_PASS} \
+-	${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+-
+-# Transfer signed package to ISSM Web site
+-echo "Transferring signed package to ISSM Web site"
+-scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+-
+-if [ $? -ne 0 ]; then
+-	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
+-	exit 1
+-fi
+
+Property changes on: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(revision 25893)
+@@ -0,0 +1,229 @@
++#!/bin/bash
++
++################################################################################
++# Commits ISSM distributable package for macOS with Python API to repository 
++# for signing. This repository is polled by a project running on a JPL 
++# Cybersecurity Jenkins server and performs the actual signing and 
++# notarization.
++#
++# Options:
++# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
++#						signing/notarization if it fails but build and package 
++#						are valid.
++# -u/--unlock			Remove lock file from signed package repository. Use if 
++#						build is aborted to allow for subsequent fresh build.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#		ISSM_BINARIES_REPO_PASS
++#		ISSM_BINARIES_REPO_USER
++#		SIGNED_REPO_COPY
++#		SIGNED_REPO_URL
++#
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-python.sh
++# - packagers/mac/sign-issm-mac-binaries-python.sh
++################################################################################
++
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
++# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
++#
++#	Command line tool support for Subversion — including svn, git-svn, and 
++#	related commands — is no longer provided by Xcode. (50266910)
++#
++# which results in,
++#
++#	svn: error: The subversion command line tools are no longer provided by 
++#	Xcode.
++#
++# when calling svn, even when subversion is installed via Homebrew and its path 
++# is available in PATH.
++#
++# NOTE: May be able to remove this after updating macOS.
++#
++alias svn='/usr/local/bin/svn'
++
++## Override certain other aliases
++#
++alias cp=$(which cp)
++alias grep=$(which grep)
++
++## Constants
++#
++MAX_SIGNING_CHECK_ATTEMPTS=30
++NOTARIZATION_LOGFILE="notarization.log"
++RETRIGGER_SIGNING_FILE="retrigger.txt"
++SIGNING_CHECK_PERIOD=60 # in seconds
++SIGNING_LOCK_FILE="signing.lock"
++UNSIGNED_REPO_COPY="./unsigned"
++UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
++
++## Functions
++#
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++}
++checkout_unsigned_repo_copy(){
++	echo "Checking out copy of repository for unsigned packages"
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${UNSIGNED_REPO_URL} \
++		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++}
++validate_signed_repo_copy(){
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
++	fi
++}
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can use only one option at a time"
++	exit 1
++fi
++
++retrigger_signing=0
++unlock=0
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-r|--resign)	retrigger_signing=1;	;;
++		-u|--unlock)	unlock=1;				;;
++		*) echo "Unknown parameter passed: $1"; exit 1	;;
++	esac
++fi
++
++validate_signed_repo_copy
++
++if [ ${unlock} -eq 1 ]; then
++	# Remove signing lock file from signed package repository so that a new 
++	# build can run
++	echo "Removing lock file from repository for signed packages"
++	svn update \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++	svn cleanup ${SIGNED_REPO_COPY} > /dev/null 2>&1
++
++	echo "Remove -u/--unlock option from configuration and run again"
++	exit 1
++fi
++
++# If lock file exists, a signing build is still in process by JPL Cybersecurity
++svn update \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++
++if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++	echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
++	exit 1
++fi
++
++# Commit lock file to repository for signed packages
++echo "Committing lock file to repository for signed packages"
++touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
++svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
++svn commit \
++	--trust-server-cert \
++	--non-interactive \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
++
++# Check out copy of repository for unsigned packages
++checkout_unsigned_repo_copy
++
++if [ ${retrigger_signing} -eq 0 ]; then
++	# Commit new compressed package to repository for unsigned binaries
++	echo "Committing package to repository for unsigned packages"
++	cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
++	svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++else
++	# NOTE: If notarize_only == 1, we commit a dummy file as we do not want to 
++	#		have to commit the entire compressed package again simply to 
++	#		retrigger the signing build on the remote JPL Cybersecurity Jenkins 
++	#		server.
++	#
++	echo "Attempting to sign existing package again"
++	echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
++	svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} > /dev/null 2>&1
++	svn commit \
++		--trust-server-cert \
++		--non-interactive \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY} > /dev/null 2>&1
++fi
++
++# Check status of signing
++echo "Checking progress of signing..."
++SIGNING_CHECK_ATTEMPT=0
++while [ ${SIGNING_CHECK_ATTEMPT} -lt ${MAX_SIGNING_CHECK_ATTEMPTS} ]; do
++	echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
++	sleep ${SIGNING_CHECK_PERIOD}
++	svn update \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_PASS} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++
++	if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
++		# Retrieve notarization lock file
++		svn update \
++			--username ${ISSM_BINARIES_REPO_USER} \
++			--password ${ISSM_BINARIES_REPO_PASS} \
++			${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++
++		# Check status
++		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
++		if [[ "${STATUS}" == "success" ]]; then
++			echo "Notarization successful!"
++		else
++			echo "Notarization failed!"
++			echo "----------------------- Contents of notarization logfile -----------------------"
++			cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
++			echo "--------------------------------------------------------------------------------"
++
++			exit 1
++		fi
++	else
++		((++SIGNING_CHECK_ATTEMPT))
++	fi
++done
+
+Property changes on: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25892)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25893)
+@@ -111,6 +111,6 @@
+ 
+ # Transfer distributable package to ISSM Web site
+ if [ ${transfer} -eq 1 ]; then
+-	./packagers/mac/transfer-issm-mac-binaries-matlab.sh
++	./packagers/mac/transfer-issm-mac-binaries.sh
+ fi
+ 
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 25893)
+@@ -0,0 +1,116 @@
++#!/bin/bash
++
++################################################################################
++# Wrapper script to build, package, send for signing, and transfer to ISSM Web 
++# site ISSM distributable package for macOS with Python API.
++#
++# Normally, we would put this directly into the project configuration under 
++# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
++# good idea to version it.
++#
++# When no failures/errors occur, performs the following:
++# - Builds ISSM according to configuration.
++# - Packages and compresses executables and libraries.
++# - Runs test suite against package.
++# - Commits compressed package to repository to be signed by JPL Cybersecurity.
++# - Retrieves signed package and transmits it to ISSM Web site for 
++#	distribution.
++#
++# Options:
++# -b/--skipbuild		Skip ISSM compilation.
++# -r/--resign			Skip ISSM compilation and packaging. Use to retrigger 
++#						signing/notarization if it fails but build and package 
++#						are valid.
++# -s/--skiptests		Skip ISSM compilation and testing during packaging 
++#						step. Use if 
++# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
++#						fails for some reason to skip building, packaging, and 
++#						signing.
++# -u/--unlock			Remove lock file from signed package repository. Use if 
++#						build is aborted to allow for subsequent fresh build.
++#
++# Debugging:
++# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
++#	Jenkins server. Debugging may be perfomed locally by running,
++#
++#		packagers/mac/sign-issm-mac-binaries-python.sh
++#
++#	with "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" hardcoded to Apple 
++#	Developer credentials.
++# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
++#	help debug potential SVN issues.
++#
++# NOTE:
++# - Use only *one* of the above options at a time, and make sure it is removed 
++#	again after a single run.
++# - Builds will fail when any of the above options are used on a clean 
++#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
++#	select menu is set to "Always check out a fresh copy".
++# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
++#	the 'Bindings' section under a 'Username and password (separated)' binding 
++#	(requires 'Credentials Binding Plugin') with 'Credentials' select menu set 
++#	to "jenkins/****** (SVN repository for ISSM binaries)".
++################################################################################
++
++## Constants
++#
++PKG="ISSM-macOS-Python" # Name of directory to copy distributable files to
++SIGNED_REPO_COPY="./signed"
++SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
++
++COMPRESSED_PKG="${PKG}.zip"
++
++## Environment
++#
++export COMPRESSED_PKG
++export PKG
++export SIGNED_REPO_COPY
++export SIGNED_REPO_URL
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can use only one option at a time"
++	exit 1
++fi
++
++# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
++#		but the following is self-documenting).
++#
++build=1
++package=1
++sign=1
++transfer=1
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-b|--skipbuild)		build=0;							shift	;;
++		-r|--resign)		build=0;	package=0;						;;
++		-s|--skiptests)		build=0;									;;
++		-t|--transferonly)	build=0;	package=0;	sign=0;				;;
++		-u|--unlock)		build=0;	package=0;	transfer=0;			;;
++		*) echo "Unknown parameter passed: $1"; exit 1 					;;
++	esac
++fi
++
++# Build
++if [ ${build} -eq 1 ]; then
++	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-python
++fi
++
++# Package
++if [ ${package} -eq 1 ]; then
++	./packagers/mac/package-issm-mac-binaries-python.sh $1
++	shift # Clear $1 so that it is not passed to commit_for_signing script
++fi
++
++# Commit for signing
++if [ ${sign} -eq 1 ]; then
++	./packagers/mac/commit_for_signing-issm-mac-binaries-python.sh $1
++fi
++
++# Transfer distributable package to ISSM Web site
++if [ ${transfer} -eq 1 ]; then
++	./packagers/mac/transfer-issm-mac-binaries.sh
++fi
++
+
+Property changes on: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25892)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25893)
+@@ -1,46 +1,21 @@
+ #!/bin/bash
+ 
+ ################################################################################
+-# To be used after running,
++# Packages and tests ISSM distributable package for macOS with Python API.
+ #
+-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-python
+-#
+-# in the context of a Jenkins project.
+-#
+-# When no runtime errors occur, performs the following:
+-# - Checks resulting executables and libraries against test suite.
+-# - Packages and compresses executables and libraries.
+-# - Commits compressed package to repository to be signed by JPL Cybersecurity.
+-# - Retrieves signed package and transmits it to ISSM Web site for 
+-#	distribution.
+-#
+ # Options:
+-# -n/--notarizeonly		Sign/notarize only (use if signing/notarization fails 
+-#						to skip tests/packaging)
+-# -s/--skiptests		Skip tests (use if this script fails for some reason 
+-#						after tests have successfully passed to save time)
+-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
+-#						transfer fails for some reason to skip testing and
+-#						signing)
+-# -u/--unlock			Remove lock file from signed package repository (use if 
+-#						build is aborted to allow for subsequent fresh build)
++# -s/--skiptests		Skip tests and package only.
+ #
+-# Debugging:
+-# - Relies on a very tight handshake with project on remote JPL Cybersecurity 
+-#	Jenkins server. Debugging may be perfomed locally by running,
++# NOTE:
++# - Assumes that the following constants are defined,
+ #
+-#		packagers/mac/sign-issm-mac-binaries-python.sh
++#		COMPRESSED_PKG
++#		ISSM_DIR
++#		PKG
+ #
+-#	with Apple Developer credentials.
+-# - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can 
+-#	help debug potential SVN issues.
+-#
+-# NOTE:
+-# - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in 
+-#	the 'Bindings' section under a 'Username and password (separated)' binding 
+-#	(requires 'Credentials Binding Plugin').
+-# - For local debugging, the aformentioned credentials can be hardcoded into 
+-#	the 'USERNAME' and 'PASSWORD' constants below.
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-python.sh
++# - packagers/mac/sign-issm-mac-binaries-python.sh
+ ################################################################################
+ 
+ # Expand aliases within the context of this script
+@@ -69,21 +44,8 @@
+ 
+ ## Constants
+ #
+-NOTARIZATION_LOGFILE="notarization.log"
+-PASSWORD=${ISSM_BINARIES_PASS}
+-PKG="ISSM-macOS-Python" # Name of directory to copy distributable files to
+ PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2006 2020 2021 2051 2052 2053 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+-RETRIGGER_SIGNING_FILE="retrigger.txt"
+-SIGNED_REPO_COPY="./signed"
+-SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
+-SIGNING_CHECK_PERIOD=60 # in seconds
+-SIGNING_LOCK_FILE="signing.lock"
+-UNSIGNED_REPO_COPY="./unsigned"
+-UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
+-USERNAME=${ISSM_BINARIES_USER}
+ 
+-COMPRESSED_PKG="${PKG}.zip"
+-
+ ## Environment
+ #
+ export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+@@ -132,293 +94,116 @@
+ 	exit 1
+ fi
+ 
+-notarize_only=0
+ skip_tests=0
+-transfer_only=0
+-unlock=0
+-while [ $# -gt 0 ]; do
+-    case $1 in
+-        -n|--notarizeonly) notarize_only=1; shift ;;
+-        -s|--skiptests) skip_tests=1; shift ;;
+-        -t|--transferonly) transfer_only=1; shift ;;
+-        -u|--unlock) unlock=1; shift ;;
+-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
+-    esac
+-    shift
+-done
+ 
+-if [ ${unlock} -eq 1 ]; then
+-	# Remove signing lock file from signed package repository so that a new 
+-	# build can run
+-	echo "Removing lock file from repository for signed packages"
+-	checkout_signed_repo_copy
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY}
+-	svn cleanup ${SIGNED_REPO_COPY}
+-	exit 1
++if [ $# -eq 1 ]; then
++	case $1 in
++		-s|--skiptests)	skip_tests=1;					;;
++		*) echo "Unknown parameter passed: $1"; exit 1	;;
++	esac
+ fi
+ 
+-if [ ${transfer_only} -eq 0 ]; then
+-	rm -rf ${SIGNED_REPO_COPY}
++# Add required binaries and libraries to package and modify them where needed
++cd ${ISSM_DIR}/bin
+ 
+-	checkout_signed_repo_copy
++echo "Modify generic"
++cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
+ 
+-	# If lock file exists, a signing build is still in process by JPL Cybersecurity
+-	svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-		echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+-		exit 1
+-	fi
++echo "Moving MPICH binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
++elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
++else
++	echo "MPICH not found"
++	exit 1
++fi
+ 
+-	if [ ${notarize_only} -eq 0 ]; then
+-		# Clean up from previous packaging
+-		echo "Cleaning up existing assets"
+-		cd ${ISSM_DIR}
+-		rm -rf ${PKG} ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+-		mkdir ${PKG}
++echo "Moving GDAL binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
++else
++	echo "GDAL not found"
++	exit 1
++fi
+ 
+-		# Check out copy of SVN repository for signed packages
+-		#
+-		# NOTE: Get empty copy because we do not want to have to check out package 
+-		#		from previous signing.
+-		#
+-		echo "Checking out copy of repository for signed packages"
+-		svn checkout \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			--depth empty \
+-			${SIGNED_REPO_URL} \
+-			${SIGNED_REPO_COPY}
++echo "Moving GMT binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
++else
++	echo "GMT not found"
++	exit 1
++fi
+ 
+-		# If lock file exists, a signing build is still in process by JPL Cybersecurity
+-		svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-		if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-			echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
+-			exit 1
+-		fi
++echo "Moving Gmsh binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
++	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
++else
++	echo "Gmsh not found"
++	exit 1
++fi
+ 
+-		# Add required binaries and libraries to package and modify them where needed
+-		cd ${ISSM_DIR}/bin
++# Run tests
++if [ ${skip_tests} -eq 0 ]; then
++	echo "Running tests"
++	cd ${ISSM_DIR}/test/NightlyRun
++	rm python.log 2> /dev/null
+ 
+-		echo "Modify generic"
+-		cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
++	# Set Python environment
++	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
++	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
++	export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+ 
+-		echo "Moving MPICH binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+-			cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+-		elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+-			cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+-		else
+-			echo "MPICH not found"
+-			exit 1
+-		fi
++	# Run tests, redirecting output to logfile and suppressing output to console
++	./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+ 
+-		echo "Moving GDAL binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+-			cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+-		else
+-			echo "GDAL not found"
+-			exit 1
+-		fi
++	# Check that Python did not exit in error
++	pythonExitCode=`echo $?`
++	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
+ 
+-		echo "Moving GMT binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+-			cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+-		else
+-			echo "GMT not found"
+-			exit 1
+-		fi
++	if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
++		echo "----------Python exited in error!----------"
++		cat python.log
++		echo "-----------End of python.log-----------"
+ 
+-		echo "Moving Gmsh binaries to bin/"
+-		if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+-			cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+-		else
+-			echo "Gmsh not found"
+-			exit 1
+-		fi
++		# Clean up execution directory
++		rm -rf ${ISSM_DIR}/execution/*
+ 
+-		# Run tests
+-		if [ ${skip_tests} -eq 0 ]; then
+-			echo "Running tests"
+-
+-			cd ${ISSM_DIR}/test/NightlyRun
+-			rm python.log 2> /dev/null
+-
+-			# Set Python environment
+-			export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+-			export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-			export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+-
+-			# Run tests, redirecting output to logfile and suppressing output to console
+-			./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+-
+-			# Check that Python did not exit in error
+-			pythonExitCode=`echo $?`
+-			pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
+-
+-			if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-				echo "----------Python exited in error!----------"
+-				cat python.log
+-				echo "-----------End of python.log-----------"
+-
+-				# Clean up execution directory
+-				rm -rf ${ISSM_DIR}/execution/*
+-
+-				exit 1
+-			fi
+-
+-			# Check that all tests passed
+-			numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-			if [ ${numTestsFailed} -ne 0 ]; then
+-				echo "One or more tests FAILED"
+-				exit 1
+-			else
+-				echo "All tests PASSED"
+-			fi
+-		else
+-			echo "Skipping tests"
+-		fi
+-
+-		# Create package
+-		cd ${ISSM_DIR}
+-		svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+-		echo "Copying assets to package: ${PKG}"
+-		cp -rf bin examples lib scripts test ${PKG}/
+-		mkdir ${PKG}/execution
+-		cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
+-		${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
+-		echo "Cleaning up unneeded/unwanted files"
+-		rm -f ${PKG}/bin/*.py # Remove all Python scripts
+-		rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+-		rm -f ${PKG}/lib/*.a # Remove static libraries from package
+-		rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+-		rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+-
+-		# Compress package
+-		echo "Compressing package"
+-		ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
+-	else
+-		# Assume that previous build was successful, but signing/notarization 
+-		# failed.
+-		#
+-		echo "Notarizing only"
++		exit 1
+ 	fi
+ 
+-	# Commit lock file to repository for signed packages
+-	echo "Committing lock file to repository for signed packages"
+-	touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
+-	svn commit \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		--message "ADD: New lock file" ${SIGNED_REPO_COPY}
++	# Check that all tests passed
++	numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+ 
+-	# Check out copy of repository for unsigned packages
+-	checkout_unsigned_repo_copy
+-
+-	if [ ${notarize_only} -eq 0 ]; then
+-		# Commit new compressed package to repository for unsigned binaries
+-		#
+-		# NOTE: This will not work if, for any reason, the checksum on the compressed 
+-		#		package is unchanged.
+-		#
+-		echo "Committing package to repository for unsigned packages"
+-		cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
+-		svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG}
+-		svn commit \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			--message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY}
++	if [ ${numTestsFailed} -ne 0 ]; then
++		echo "One or more tests FAILED"
++		exit 1
+ 	else
+-		# NOTE: If notarize_only == 1, we commit a dummy file as the signing 
+-		#		build on the remote JPL Cybersecurity Jenkins server is 
+-		#		triggered by polling SCM.
+-		#
+-		echo "Attempting to sign existing package again"
+-		echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
+-		svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
+-		svn commit \
+-			--trust-server-cert \
+-			--non-interactive \
+-			--username ${USERNAME} \
+-			--password ${PASSWORD} \
+-			--message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY}
++		echo "All tests PASSED"
+ 	fi
+-
+-	# Check status of signing
+-	echo "Checking progress of signing..."
+-	IN_PROCESS=1
+-	SUCCESS=0
+-
+-	while [ ${IN_PROCESS} -eq 1 ]; do
+-		echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
+-		sleep ${SIGNING_CHECK_PERIOD}
+-		svn up ${SIGNED_REPO_COPY}
+-
+-		if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
+-			IN_PROCESS=0
+-
+-			# Retrieve notarization lock file
+-			svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-
+-			# Check status
+-			STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+-			if [[ "${STATUS}" == "success" ]]; then
+-				echo "Notarization successful!"
+-
+-				# Set flag indicating notarization was successful
+-				SUCCESS=1
+-			else
+-				echo "Notarization failed!"
+-			fi
+-		fi
+-	done
+ else
+-	# Assume that previous build resulted in successful signing of package but 
+-	# that transfer to ISSM Web site failed and user built this project again 
+-	# with -t/--transferonly option.
+-	#
+-
+-	# Make sure copy of repository for signed packages exists
+-	validate_signed_repo_copy
+-
+-	SUCCESS=1
++	echo "Skipping tests"
+ fi
+ 
+-# Handle result of signing
+-if [ ${SUCCESS} -eq 1 ]; then
+-	# Retrieve signed and notarized package
+-	svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++# Create package
++cd ${ISSM_DIR}
++svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
++echo "Copying assets to package: ${PKG}"
++cp -rf bin examples lib scripts test ${PKG}/
++mkdir ${PKG}/execution
++cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
++${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
++echo "Cleaning up unneeded/unwanted files"
++rm -f ${PKG}/bin/*.py # Remove all Python scripts
++rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
++rm -f ${PKG}/lib/*.a # Remove static libraries from package
++rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
++rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+ 
+-	# Transfer signed package to ISSM Web site
+-	echo "Transferring signed package to ISSM Web site"
+-	scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+-
+-	if [ $? -ne 0 ]; then
+-		echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip testing and signing)."
+-		exit 1
+-	fi
+-else
+-	echo "----------------------- Contents of notarization logfile -----------------------"
+-	cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
+-	echo "--------------------------------------------------------------------------------"
+-
+-	exit 1
+-fi
++# Compress package
++echo "Compressing package"
++ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(revision 25893)
+@@ -0,0 +1,88 @@
++#!/bin/bash
++
++################################################################################
++# Transfers ISSM distributable package to ISSM Web site.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#		ISSM_BINARIES_REPO_PASS
++#		ISSM_BINARIES_REPO_USER
++#		SIGNED_REPO_COPY
++#		SIGNED_REPO_URL
++#
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-matlab.sh
++# - packagers/mac/complete-issm-mac-binaries-python.sh
++################################################################################
++
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
++# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
++#
++#	Command line tool support for Subversion — including svn, git-svn, and 
++#	related commands — is no longer provided by Xcode. (50266910)
++#
++# which results in,
++#
++#	svn: error: The subversion command line tools are no longer provided by 
++#	Xcode.
++#
++# when calling svn, even when subversion is installed via Homebrew and its path 
++# is available in PATH.
++#
++# NOTE: May be able to remove this after updating macOS.
++#
++alias svn='/usr/local/bin/svn'
++
++## Override certain other aliases
++#
++alias cp=$(which cp)
++alias grep=$(which grep)
++
++## Functions
++#
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_USER} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++}
++validate_signed_repo_copy(){
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
++	fi
++}
++
++# Check if working copy of repository for signed packages is missing
++validate_signed_repo_copy
++
++# Retrieve signed and notarized package
++svn update \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++
++# Transfer signed package to ISSM Web site
++echo "Transferring signed package to ISSM Web site"
++scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++
++if [ $? -ne 0 ]; then
++	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
++	exit 1
++fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25893-25894.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25893-25894.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25893-25894.diff	(revision 26740)
@@ -0,0 +1,74 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.7-discover.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.7-discover.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.7-discover.sh	(revision 25894)
+@@ -0,0 +1,62 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install petsc-3.7.6 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
++
++#Untar and move petsc to install directory
++tar -zxvf  petsc-3.7.6.tar.gz
++mv petsc-3.7.6/* src/
++rm -rf petsc-3.7.6
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-blas-lapack-dir="/usr/local/intel/2020/compilers_and_libraries_2020.0.166/linux/mkl/" \
++	--with-mpi-lib="/usr/local/sgi/mpi/mpt-2.17/lib/libmpi.so" \
++	--with-mpi-include="/usr/local/sgi/mpi/mpt-2.17/include/" \
++	--known-mpi-shared-libraries=1 \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-batch=1  \
++	--with-shared-libraries=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-mumps=1 \
++	--download-scalapack=1 
++
++#prepare script to reconfigure petsc
++cat > script.queue << EOF
++#!/bin/bash
++#SBATCH -J petscinstall # Job Name
++#SBATCH -N 1
++#SBATCH -n 1
++#SBATCH -A s1690
++#SBATCH -t 00:01:00 # Run time (hh:mm:ss) - 1.5 hours
++#SBATCH --qos=debug
++#SBATCH -o petscinstall.outlog
++#SBATCH -e petscinstall.errlog
++
++. /usr/share/modules/init/bash
++module purge
++module load comp/intel/20.0.0.166
++module load mpi/sgi-mpt/2.17
++module load cmake/3.17.0
++
++export PATH="$PATH:."
++export MPI_GROUP_MAX=64
++mpiexec -np 1 ./conftest-arch-linux2-c-opt
++EOF
++
++#print instructions
++echo "== Now: cd src/ "
++echo "== sbatch script.queue "
++echo "== Then run reconfigure script generated by PETSc and follow instructions"
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.7-discover.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25894-25895.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25894-25895.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25894-25895.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25894)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25895)
+@@ -215,6 +215,7 @@
+ 		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+ 		if [[ "${STATUS}" == "success" ]]; then
+ 			echo "Notarization successful!"
++			break
+ 		else
+ 			echo "Notarization failed!"
+ 			echo "----------------------- Contents of notarization logfile -----------------------"
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(revision 25894)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(revision 25895)
+@@ -215,6 +215,7 @@
+ 		STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
+ 		if [[ "${STATUS}" == "success" ]]; then
+ 			echo "Notarization successful!"
++			break
+ 		else
+ 			echo "Notarization failed!"
+ 			echo "----------------------- Contents of notarization logfile -----------------------"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25895-25896.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25895-25896.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25895-25896.diff	(revision 26740)
@@ -0,0 +1,1359 @@
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh	(revision 25895)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh	(nonexistent)
+@@ -1,155 +0,0 @@
+-#!/bin/bash
+-
+-
+-# Script to test, package, and transfer distributable to ISSM Web site.
+-# Corresponds with build generated by configuration in 
+-# $ISSM_DIR/jenkins/ross-debian_linux-binaries-with_dakota.
+-#
+-
+-## Constants
+-#
+-LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-PACKAGE="ISSM" # Name of directory to copy distributable files to
+-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
+-TARBALL_NAME="issm-linux-with_dakota"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-## Environment
+-#
+-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+-
+-# Check if MATLAB exists
+-if ! [ -d ${MATLAB_PATH} ]; then
+-	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+-	exit 1
+-fi
+-
+-# Clean up from previous packaging
+-echo "Cleaning up existing assets"
+-cd ${ISSM_DIR}
+-rm -rf ${PACKAGE}
+-mkdir ${PACKAGE}
+-
+-# Add/modify required binaries
+-cd ${ISSM_DIR}/bin
+-
+-echo "Modifying generic"
+-cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+-cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
+-
+-echo "Moving MPICH binaries to bin/"
+-if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+-elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+-else
+-	echo "MPICH not found"
+-	exit 1
+-fi
+-
+-# Add/modify required libraries
+-echo "Moving libgfortran to lib/"
+-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+-
+-# Run tests
+-echo "Running tests"
+-cd ${ISSM_DIR}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-
+-	# Clean up execution directory
+-	rm -rf ${ISSM_DIR}/execution/*
+-
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1;
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+-
+-# Check that Python tests run
+-echo "Running Python tests"
+-
+-export PATH="${PATH}:${ISSM_DIR}/bin"
+-export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+-
+-rm python.log 2> /dev/null
+-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+-
+-# Check that Python did not exit in error
+-pythonExitCode=`echo $?`
+-pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
+-
+-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-	echo "----------Python exited in error!----------"
+-	cat python.log
+-	echo "-----------End of python.log-----------"
+-
+-	# Clean up execution directory
+-	rm -rf ${ISSM_DIR}/execution/*
+-
+-	exit 1
+-fi
+-
+-# Check that all Python tests passed
+-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
+-	echo "One or more Python tests FAILED"
+-	exit 1
+-else
+-	echo "All Python tests PASSED"
+-fi
+-
+-# Create tarball
+-cd ${ISSM_DIR}
+-rm -f ${TARBALL}
+-svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+-echo "Copying assets to package: ${PACKAGE}"
+-cp -rf bin examples lib scripts test ${PACKAGE}/
+-echo "Cleaning up unneeded/unwanted files"
+-python -m compileall ${PACKAGE}/bin # Precompile all Python scripts to bytecode
+-rm -f ${PACKAGE}/bin/*.py # Remove all Python scripts
+-rm -f ${PACKAGE}/bin/generic_static.* # Remove static versions of generic cluster classes
+-rm -f ${PACKAGE}/lib/*.a # Remove static libraries from package
+-rm -f ${PACKAGE}/lib/*.la # Remove libtool libraries from package
+-rm -rf ${PACKAGE}/test/SandBox # Remove testing sandbox from package
+-echo "Creating tarball: ${TARBALL_NAME}"
+-tar -czf ${TARBALL} ${PACKAGE}
+-ls -lah ${ISSM_DIR}/${TARBALL}
+-
+-echo "Transferring binaries to ISSM Web site"
+-scp -i ~/.ssh/debian_linux-vm_to_ross ${TARBALL} jenkins@ross.ics.uci.edu:/var/www/html/${TARBALL}
+-
+-if [ $? -ne 0 ]; then
+-	echo "FAILED: Manually check connection"
+-	exit 1
+-fi
+
+Property changes on: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-with_dakota.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries.sh	(revision 25895)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries.sh	(nonexistent)
+@@ -1,114 +0,0 @@
+-#!/bin/bash
+-
+-
+-# Script to test, package, and transfer distributable to ISSM Web site.
+-# Corresponds with build generated by configuration in 
+-# $ISSM_DIR/jenkins/ross-debian_linux-binaries.
+-#
+-
+-## Constants
+-#
+-LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-PACKAGE="ISSM" # Name of directory to copy distributable files to
+-TARBALL_NAME="issm-linux"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-## Environment
+-#
+-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+-
+-# Check if MATLAB exists
+-if ! [ -d ${MATLAB_PATH} ]; then
+-	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+-	exit 1
+-fi
+-
+-# Clean up from previous packaging
+-echo "Cleaning up existing assets"
+-cd ${ISSM_DIR}
+-rm -rf ${PACKAGE}
+-mkdir ${PACKAGE}
+-
+-# Add/modify required binaries and libraries
+-cd ${ISSM_DIR}/bin
+-
+-echo "Modify generic"
+-cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+-
+-echo "Moving MPICH binaries to bin/"
+-if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+-elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+-else
+-	echo "MPICH not found"
+-	exit 1
+-fi
+-
+-echo "Moving libgfortran to lib/"
+-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+-
+-# Run tests
+-echo "Running tests"
+-cd ${ISSM_DIR}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-
+-	# Clean up execution directory
+-	rm -rf ${ISSM_DIR}/execution/*
+-
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+-
+-# Create tarball
+-cd ${ISSM_DIR}
+-rm -f ${TARBALL}
+-svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+-echo "Copying assets to package: ${PACKAGE}"
+-cp -rf bin examples lib scripts test ${PACKAGE}/
+-echo "Cleaning up unneeded/unwanted files"
+-rm -f ${PACKAGE}/bin/generic_static.* # Remove static versions of generic cluster classes
+-rm -f ${PACKAGE}/lib/*.a # Remove static libraries from package
+-rm -f ${PACKAGE}/lib/*.la # Remove libtool libraries from package
+-rm -rf ${PACKAGE}/test/SandBox # Remove testing sandbox from package
+-echo "Creating tarball: ${TARBALL_NAME}"
+-tar -czf ${TARBALL} ${PACKAGE}
+-ls -lah ${ISSM_DIR}/${TARBALL}
+-
+-echo "Transferring binaries to ISSM Web site"
+-scp -i ~/.ssh/debian_linux-vm_to_ross ${TARBALL} jenkins@ross.ics.uci.edu:/var/www/html/${TARBALL}
+-
+-if [ $? -ne 0 ]; then
+-	echo "FAILED: Manually check connection"
+-	exit 1
+-fi
+
+Property changes on: ../trunk-jpl/packagers/linux/package-issm-linux-binaries.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh	(revision 25895)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh	(nonexistent)
+@@ -1,181 +0,0 @@
+-#!/bin/bash
+-
+-
+-# Script to test, package, and transfer distributable to ISSM Web site.
+-# Corresponds with build generated by configuration in 
+-# $ISSM_DIR/jenkins/ross-debian_linux-binaries-solid_earth.
+-#
+-
+-## Constants
+-#
+-LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+-LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2002 2003 2010 2020 2021 2101]"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-PACKAGE="ISSM-Solid_Earth" # Name of directory to copy distributable files to
+-PYTHON_NROPTIONS="--benchmark slr --exclude 2002 2003 2010 2020 2021 2101"
+-TARBALL_NAME="issm-linux-solid_earth"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-## Environment
+-#
+-export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+-
+-# Check if MATLAB exists
+-if ! [ -d ${MATLAB_PATH} ]; then
+-	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+-	exit 1
+-fi
+-
+-# Clean up from previous packaging
+-echo "Cleaning up existing assets"
+-cd ${ISSM_DIR}
+-rm -rf ${PACKAGE}
+-mkdir ${PACKAGE}
+-
+-# Add/modify required binaries
+-cd ${ISSM_DIR}/bin
+-
+-echo "Modifying generic"
+-cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+-cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
+-
+-echo "Moving MPICH binaries to bin/"
+-if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+-	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+-elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+-	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+-else
+-	echo "MPICH not found"
+-	exit 1
+-fi
+-
+-echo "Moving GDAL binaries to bin/"
+-if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+-	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+-	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+-else
+-	echo "GDAL not found"
+-	exit 1
+-fi
+-
+-echo "Moving GMT binaries to bin/"
+-if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+-	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+-	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+-else
+-	echo "GMT not found"
+-	exit 1
+-fi
+-
+-echo "Moving Gmsh binaries to bin/"
+-if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+-	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+-else
+-	echo "Gmsh not found"
+-	exit 1
+-fi
+-
+-# Add/modify required libraries
+-echo "Moving libgfortran to lib/"
+-cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+-
+-# Run tests
+-echo "Running tests"
+-cd ${ISSM_DIR}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-
+-	# Clean up execution directory
+-	rm -rf ${ISSM_DIR}/execution/*
+-
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1;
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+-
+-# Check that Python tests run
+-echo "Running Python tests"
+-
+-export PATH="${PATH}:${ISSM_DIR}/bin"
+-export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+-
+-rm python.log 2> /dev/null
+-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+-
+-# Check that Python did not exit in error
+-pythonExitCode=`echo $?`
+-pythonExitedInError=`grep -E "Error|Traceback|bad interpreter" python.log | wc -l`
+-
+-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-	echo "----------Python exited in error!----------"
+-	cat python.log
+-	echo "-----------End of python.log-----------"
+-
+-	# Clean up execution directory
+-	rm -rf ${ISSM_DIR}/execution/*
+-
+-	exit 1
+-fi
+-
+-# Check that all Python tests passed
+-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
+-	echo "One or more Python tests FAILED"
+-	exit 1
+-else
+-	echo "All Python tests PASSED"
+-fi
+-
+-# Create tarball
+-cd ${ISSM_DIR}
+-rm -f ${TARBALL}
+-svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+-echo "Copying assets to package: ${PACKAGE}"
+-cp -rf bin examples lib scripts test ${PACKAGE}/
+-echo "Cleaning up unneeded/unwanted files"
+-python -m compileall ${PACKAGE}/bin # Precompile all Python scripts to bytecode
+-rm -f ${PACKAGE}/bin/*.py # Remove all Python scripts
+-rm -f ${PACKAGE}/bin/generic_static.* # Remove static versions of generic cluster classes
+-rm -f ${PACKAGE}/lib/*.a # Remove static libraries from package
+-rm -f ${PACKAGE}/lib/*.la # Remove libtool libraries from package
+-rm -rf ${PACKAGE}/test/SandBox # Remove testing sandbox from package
+-echo "Creating tarball: ${TARBALL_NAME}"
+-tar -czf ${TARBALL} ${PACKAGE}
+-ls -lah ${ISSM_DIR}/${TARBALL}
+-
+-echo "Transferring binaries to ISSM Web site"
+-scp -i ~/.ssh/debian_linux-vm_to_ross ${TARBALL} jenkins@ross.ics.uci.edu:/var/www/html/${TARBALL}
+-
+-if [ $? -ne 0 ]; then
+-	echo "FAILED: Manually check connection"
+-	exit 1
+-fi
+
+Property changes on: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-solid_earth.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh	(nonexistent)
++++ ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh	(revision 25896)
+@@ -0,0 +1,24 @@
++#!/bin/bash
++
++################################################################################
++# Transfers ISSM distributable package for Linux with MATLAB API to ISSM Web 
++# site.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#
++# See also:
++# - packagers/linux/complete-issm-linux-binaries-matlab.sh
++# - packagers/linux/complete-issm-linux-binaries-python.sh
++################################################################################
++
++# Transfer package to ISSM Web site
++echo "Transferring package to ISSM Web site"
++scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++
++if [ $? -ne 0 ]; then
++	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building and packaging)."
++	exit 1
++fi
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(revision 25895)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(revision 25896)
+@@ -1,7 +1,8 @@
+ #!/bin/bash
+ 
+ ################################################################################
+-# Transfers ISSM distributable package to ISSM Web site.
++# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
++# site.
+ #
+ # NOTE:
+ # - Assumes that the following constants are defined,
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(nonexistent)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 25896)
+@@ -0,0 +1,82 @@
++#!/bin/bash
++
++################################################################################
++# Wrapper script to build, package, and transfer to ISSM Web site ISSM 
++# distributable package for Linux with MATLAB API.
++#
++# Normally, we would put this directly into the project configuration under 
++# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
++# good idea to version it.
++#
++# When no failures/errors occur, performs the following:
++# - Builds ISSM according to configuration.
++# - Packages executables and libraries.
++# - Runs test suite against package.
++# - Transmits package to ISSM Web site for distribution.
++#
++# Options:
++# -b/--skipbuild		Skip ISSM compilation.
++# -s/--skiptests		Skip ISSM compilation and testing during packaging 
++#						step. Use if packaging fails for some reason but build 
++#						is valid.
++# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
++#						fails for some reason to skip building, packaging, and 
++#						signing.
++#
++# NOTE:
++# - Use only *one* of the above options at a time, and make sure it is removed 
++#	again after a single run.
++# - Builds will fail when any of the above options are used on a clean 
++#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
++#	select menu is set to "Always check out a fresh copy".
++################################################################################
++
++## Constants
++#
++PKG="ISSM-Linux-MATLAB" # Name of directory to copy distributable files to
++
++COMPRESSED_PKG="${PKG}.zip"
++
++## Environment
++#
++export COMPRESSED_PKG
++export PKG
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can use only one option at a time"
++	exit 1
++fi
++
++# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
++#		but the following is self-documenting).
++#
++build=1
++package=1
++transfer=1
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-b|--skipbuild)		build=0;				shift	;;
++		-s|--skiptests)		build=0;						;;
++		-t|--transferonly)	build=0;	package=0;			;;
++		*) echo "Unknown parameter passed: $1"; exit 1 		;;
++	esac
++fi
++
++# Build
++if [ ${build} -eq 1 ]; then
++	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-matlab
++fi
++
++# Package
++if [ ${package} -eq 1 ]; then
++	./packagers/linux/package-issm-linux-binaries-matlab.sh $1
++fi
++
++# Transfer distributable package to ISSM Web site
++if [ ${transfer} -eq 1 ]; then
++	./packagers/linux/transfer-issm-linux-binaries.sh
++fi
++
+
+Property changes on: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(nonexistent)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 25896)
+@@ -0,0 +1,82 @@
++#!/bin/bash
++
++################################################################################
++# Wrapper script to build, package, and transfer to ISSM Web site ISSM 
++# distributable package for Linux with Python API.
++#
++# Normally, we would put this directly into the project configuration under 
++# 'Build' -> 'Excute shell', but becasue it is a bit more involved, it is a 
++# good idea to version it.
++#
++# When no failures/errors occur, performs the following:
++# - Builds ISSM according to configuration.
++# - Packages executables and libraries.
++# - Runs test suite against package.
++# - Transmits package to ISSM Web site for distribution.
++#
++# Options:
++# -b/--skipbuild		Skip ISSM compilation.
++# -s/--skiptests		Skip ISSM compilation and testing during packaging 
++#						step. Use if packaging fails for some reason but build 
++#						is valid.
++# -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
++#						fails for some reason to skip building, packaging, and 
++#						signing.
++#
++# NOTE:
++# - Use only *one* of the above options at a time, and make sure it is removed 
++#	again after a single run.
++# - Builds will fail when any of the above options are used on a clean 
++#	workspace. For example, if 'Source Code Management' -> 'Check-out Strategy' 
++#	select menu is set to "Always check out a fresh copy".
++################################################################################
++
++## Constants
++#
++PKG="ISSM-Linux-Python" # Name of directory to copy distributable files to
++
++COMPRESSED_PKG="${PKG}.zip"
++
++## Environment
++#
++export COMPRESSED_PKG
++export PKG
++
++## Parse options
++#
++if [ $# -gt 1 ]; then
++	echo "Can use only one option at a time"
++	exit 1
++fi
++
++# NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer, 
++#		but the following is self-documenting).
++#
++build=1
++package=1
++transfer=1
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-b|--skipbuild)		build=0;				shift	;;
++		-s|--skiptests)		build=0;						;;
++		-t|--transferonly)	build=0;	package=0;			;;
++		*) echo "Unknown parameter passed: $1"; exit 1 		;;
++	esac
++fi
++
++# Build
++if [ ${build} -eq 1 ]; then
++	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-python
++fi
++
++# Package
++if [ ${package} -eq 1 ]; then
++	./packagers/linux/package-issm-linux-binaries-python.sh $1
++fi
++
++# Transfer distributable package to ISSM Web site
++if [ ${transfer} -eq 1 ]; then
++	./packagers/linux/transfer-issm-linux-binaries.sh
++fi
++
+
+Property changes on: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 25895)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 25896)
+@@ -1,23 +1,21 @@
+ #!/bin/bash
+ 
+ ################################################################################
+-# To be used after running,
++# Packages and tests ISSM distributable package for Linux with MATLAB API.
+ #
+-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/ross-debian_linux-binaries-matlab
++# Options:
++# -s/--skiptests		Skip testing during packaging Use if packaging fails 
++#						for some reason but build is valid.
+ #
+-# in the context of a Jenkins project.
++# NOTE:
++# - Assumes that the following constants are defined,
+ #
+-# When no runtime errors occur, performs the following:
+-# - Checks resulting executables and libraries against test suite.
+-# - Packages and compresses executables and libraries.
+-# - Transmits it to ISSM Web site for distribution.
++#		COMPRESSED_PKG
++#		ISSM_DIR
++#		PKG
+ #
+-# Options:
+-# -s/--skiptests		Skip tests (use if this script fails for some reason 
+-#						after tests have successfully passed to save time)
+-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
+-#						transfer fails for some reason to skip testing and
+-#						signing)
++# See also:
++# - packagers/linux/complete-issm-linux-binaries-matlab.sh
+ ################################################################################
+ 
+ # Expand aliases within the context of this script
+@@ -33,10 +31,7 @@
+ LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+ MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2002,2003,2005,2006,2010,2020,2021,2051,2052,2053,2101,2102,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-PKG="ISSM-Linux-MATLAB" # Name of directory to copy distributable files to
+ 
+-COMPRESSED_PKG="${PKG}.tar.gz"
+-
+ ## Environment
+ #
+ export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+@@ -49,137 +44,122 @@
+ fi
+ 
+ skip_tests=0
+-transfer_only=0
+ while [ $# -gt 0 ]; do
+     case $1 in
+-        -s|--skiptests) skip_tests=1; shift ;;
+-        -t|--transferonly) transfer_only=1; shift ;;
+-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
++        -s|--skiptests) skip_tests=1;					;;
++        *) echo "Unknown parameter passed: $1"; exit 1	;;
+     esac
+     shift
+ done
+ 
+-if [ ${transfer_only} -eq 0 ]; then
+-	# Check if MATLAB exists
+-	if ! [ -d ${MATLAB_PATH} ]; then
+-		echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+-		exit 1
+-	fi
++# Check if MATLAB exists
++if ! [ -d ${MATLAB_PATH} ]; then
++	echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
++	exit 1
++fi
+ 
+-	# Clean up from previous packaging
+-	echo "Cleaning up existing assets"
+-	cd ${ISSM_DIR}
+-	rm -rf ${PKG} ${COMPRESSED_PKG}
+-	mkdir ${PKG}
++# Clean up from previous packaging
++echo "Cleaning up existing assets"
++cd ${ISSM_DIR}
++rm -rf ${PKG} ${COMPRESSED_PKG}
++mkdir ${PKG}
+ 
+-	# Add/modify required binaries and libraries
+-	cd ${ISSM_DIR}/bin
++# Add/modify required binaries and libraries
++cd ${ISSM_DIR}/bin
+ 
+-	echo "Modify generic"
+-	cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
++echo "Modify generic"
++cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
+ 
+-	echo "Moving MPICH binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+-	elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+-	else
+-		echo "MPICH not found"
+-		exit 1
+-	fi
++echo "Moving MPICH binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
++elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
++else
++	echo "MPICH not found"
++	exit 1
++fi
+ 
+-	echo "Moving GDAL binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+-	else
+-		echo "GDAL not found"
+-		exit 1
+-	fi
++echo "Moving GDAL binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
++else
++	echo "GDAL not found"
++	exit 1
++fi
+ 
+-	echo "Moving GMT binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+-	else
+-		echo "GMT not found"
+-		exit 1
+-	fi
++echo "Moving GMT binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
++else
++	echo "GMT not found"
++	exit 1
++fi
+ 
+-	echo "Moving Gmsh binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+-		cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+-	else
+-		echo "Gmsh not found"
+-		exit 1
+-	fi
++echo "Moving Gmsh binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
++	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
++else
++	echo "Gmsh not found"
++	exit 1
++fi
+ 
+-	echo "Moving libgfortran to lib/"
+-	cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
++echo "Moving libgfortran to lib/"
++cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+ 
++# Run tests
++if [ ${skip_tests} -eq 0 ]; then
++	echo "Running tests"
++	cd ${ISSM_DIR}/test/NightlyRun
++	rm matlab.log 2> /dev/null
+ 
+-	# Run tests
+-	if [ ${skip_tests} -eq 0 ]; then
+-		echo "Running tests"
+-		cd ${ISSM_DIR}/test/NightlyRun
+-		rm matlab.log 2> /dev/null
++	# Run tests, redirecting output to logfile and suppressing output to console
++	${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+ 
+-		# Run tests, redirecting output to logfile and suppressing output to console
+-		${MATLAB_PATH}/bin/matlab -nojvm -nosplash -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
++	# Check that MATLAB did not exit in error
++	matlabExitCode=`echo $?`
++	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab.log | wc -l`
+ 
+-		# Check that MATLAB did not exit in error
+-		matlabExitCode=`echo $?`
+-		matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
++	if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
++		echo "----------MATLAB exited in error!----------"
++		cat matlab.log
++		echo "-----------End of matlab.log-----------"
+ 
+-		if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-			echo "----------MATLAB exited in error!----------"
+-			cat matlab.log
+-			echo "-----------End of matlab.log-----------"
++		# Clean up execution directory
++		rm -rf ${ISSM_DIR}/execution/*
+ 
+-			# Clean up execution directory
+-			rm -rf ${ISSM_DIR}/execution/*
++		exit 1
++	fi
+ 
+-			exit 1
+-		fi
++	# Check that all tests passed
++	numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+ 
+-		# Check that all tests passed
+-		numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-		if [[ ${numTestsFailed} -ne 0 ]]; then
+-			echo "One or more tests FAILED"
+-			exit 1
+-		else
+-			echo "All tests PASSED"
+-		fi
++	if [[ ${numTestsFailed} -ne 0 ]]; then
++		echo "One or more tests FAILED"
++		exit 1
+ 	else
+-		echo "Skipping tests"
++		echo "All tests PASSED"
+ 	fi
+-
+-	# Create package
+-	cd ${ISSM_DIR}
+-	svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+-	echo "Copying assets to package: ${PKG}"
+-	cp -rf bin examples lib scripts test ${PKG}/
+-	mkdir ${PKG}/execution
+-	echo "Cleaning up unneeded/unwanted files"
+-	rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+-	rm -f ${PKG}/lib/*.a # Remove static libraries from package
+-	rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+-	rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+-
+-	# Compress package
+-	echo "Compressing package"
+-	tar -czf ${COMPRESSED_PKG} ${PKG}
+-	ls -lah ${ISSM_DIR}/${COMPRESSED_PKG}
++else
++	echo "Skipping tests"
+ fi
+ 
+-# Transfer package to ISSM Web site
+-echo "Transferring package to ISSM Web site"
+-scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++# Create package
++cd ${ISSM_DIR}
++svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
++echo "Copying assets to package: ${PKG}"
++cp -rf bin examples lib scripts test ${PKG}/
++mkdir ${PKG}/execution
++echo "Cleaning up unneeded/unwanted files"
++rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
++rm -f ${PKG}/lib/*.a # Remove static libraries from package
++rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
++rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+ 
+-if [ $? -ne 0 ]; then
+-	echo "Transfer failed! Verify connection then build this project again."
+-	exit 1
+-fi
++# Compress package
++echo "Compressing package"
++tar -czf ${COMPRESSED_PKG} ${PKG}
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 25895)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 25896)
+@@ -1,23 +1,21 @@
+ #!/bin/bash
+ 
+ ################################################################################
+-# To be used after running,
++# Packages and tests ISSM distributable package for Linux with Python API.
+ #
+-#	${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/ross-debian_linux-binaries-matlab
++# Options:
++# -s/--skiptests		Skip testing during packaging Use if packaging fails 
++#						for some reason but build is valid.
+ #
+-# in the context of a Jenkins project.
++# NOTE:
++# - Assumes that the following constants are defined,
+ #
+-# When no runtime errors occur, performs the following:
+-# - Checks resulting executables and libraries against test suite.
+-# - Packages and compresses executables and libraries.
+-# - Transmits it to ISSM Web site for distribution.
++#		COMPRESSED_PKG
++#		ISSM_DIR
++#		PKG
+ #
+-# Options:
+-# -s/--skiptests		Skip tests (use if this script fails for some reason 
+-#						after tests have successfully passed to save time)
+-# -t/--transferonly		Transfer package to ISSM Web site only (use if 
+-#						transfer fails for some reason to skip testing and
+-#						signing)
++# See also:
++# - packagers/linux/complete-issm-linux-binaries-python.sh
+ ################################################################################
+ 
+ # Expand aliases within the context of this script
+@@ -32,10 +30,7 @@
+ LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+ LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+ PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2002 2003 2005 2006 2010 2020 2021 2051 2052 2053 2101 2102 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+-PKG="ISSM-Linux-Python" # Name of directory to copy distributable files to
+ 
+-COMPRESSED_PKG="${PKG}.tar.gz"
+-
+ ## Environment
+ #
+ export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+@@ -48,144 +43,124 @@
+ fi
+ 
+ skip_tests=0
+-transfer_only=0
+ while [ $# -gt 0 ]; do
+     case $1 in
+-        -s|--skiptests) skip_tests=1; shift ;;
+-        -t|--transferonly) transfer_only=1; shift ;;
+-        *) echo "Unknown parameter passed: $1"; exit 1 ;;
++        -s|--skiptests) skip_tests=1;					;;
++        *) echo "Unknown parameter passed: $1"; exit 1	;;
+     esac
+     shift
+ done
+ 
+-if [ ${transfer_only} -eq 0 ]; then
+-	# Check if MATLAB exists
+-	if ! [ -d ${MATLAB_PATH} ]; then
+-		echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."
+-		exit 1
+-	fi
++# Clean up from previous packaging
++echo "Cleaning up existing assets"
++cd ${ISSM_DIR}
++rm -rf ${PKG} ${COMPRESSED_PKG}
++mkdir ${PKG}
+ 
+-	# Clean up from previous packaging
+-	echo "Cleaning up existing assets"
+-	cd ${ISSM_DIR}
+-	rm -rf ${PKG} ${COMPRESSED_PKG}
+-	mkdir ${PKG}
++# Add/modify required binaries and libraries
++cd ${ISSM_DIR}/bin
+ 
+-	# Add/modify required binaries and libraries
+-	cd ${ISSM_DIR}/bin
++echo "Modify generic"
++cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
+ 
+-	echo "Modify generic"
+-	cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
++echo "Moving MPICH binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
++elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
++	cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
++else
++	echo "MPICH not found"
++	exit 1
++fi
+ 
+-	echo "Moving MPICH binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
+-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
+-		cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
+-	elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
+-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
+-		cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
+-	else
+-		echo "MPICH not found"
+-		exit 1
+-	fi
++echo "Moving GDAL binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
++	cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
++else
++	echo "GDAL not found"
++	exit 1
++fi
+ 
+-	echo "Moving GDAL binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
+-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
+-		cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
+-	else
+-		echo "GDAL not found"
+-		exit 1
+-	fi
++echo "Moving GMT binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
++	cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
++else
++	echo "GMT not found"
++	exit 1
++fi
+ 
+-	echo "Moving GMT binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
+-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
+-		cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
+-	else
+-		echo "GMT not found"
+-		exit 1
+-	fi
++echo "Moving Gmsh binaries to bin/"
++if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
++	cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
++else
++	echo "Gmsh not found"
++	exit 1
++fi
+ 
+-	echo "Moving Gmsh binaries to bin/"
+-	if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
+-		cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
+-	else
+-		echo "Gmsh not found"
+-		exit 1
+-	fi
++echo "Moving libgfortran to lib/"
++cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+ 
+-	echo "Moving libgfortran to lib/"
+-	cp ${LIBGFORTRAN} ${LIBGFORTRAN_DIST} 2> /dev/null
+ 
++# Run tests
++if [ ${skip_tests} -eq 0 ]; then
++	echo "Running tests"
++	cd ${ISSM_DIR}/test/NightlyRun
++	rm python.log 2> /dev/null
+ 
+-	# Run tests
+-	if [ ${skip_tests} -eq 0 ]; then
+-		echo "Running tests"
+-		cd ${ISSM_DIR}/test/NightlyRun
+-		rm python.log 2> /dev/null
++	# Set Python environment
++	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
++	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
++	export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+ 
+-		# Set Python environment
+-		export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+-		export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-		export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
++	# Run tests, redirecting output to logfile and suppressing output to console
++	./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+ 
+-		# Run tests, redirecting output to logfile and suppressing output to console
+-		./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
++	# Check that Python did not exit in error
++	pythonExitCode=`echo $?`
++	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
+ 
+-		# Check that Python did not exit in error
+-		pythonExitCode=`echo $?`
+-		pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
++	if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
++		echo "----------Python exited in error!----------"
++		cat python.log
++		echo "-----------End of python.log-----------"
+ 
+-		if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-			echo "----------Python exited in error!----------"
+-			cat python.log
+-			echo "-----------End of python.log-----------"
++		# Clean up execution directory
++		rm -rf ${ISSM_DIR}/execution/*
+ 
+-			# Clean up execution directory
+-			rm -rf ${ISSM_DIR}/execution/*
++		exit 1
++	fi
+ 
+-			exit 1
+-		fi
++	# Check that all tests passed
++	numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+ 
+-		# Check that all tests passed
+-		numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-		if [[ ${numTestsFailed} -ne 0 ]]; then
+-			echo "One or more tests FAILED"
+-			exit 1
+-		else
+-			echo "All tests PASSED"
+-		fi
++	if [[ ${numTestsFailed} -ne 0 ]]; then
++		echo "One or more tests FAILED"
++		exit 1
+ 	else
+-		echo "Skipping tests"
++		echo "All tests PASSED"
+ 	fi
+-
+-	# Create package
+-	cd ${ISSM_DIR}
+-	svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+-	echo "Copying assets to package: ${PKG}"
+-	cp -rf bin examples lib scripts test ${PKG}/
+-	mkdir ${PKG}/execution
+-	${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
+-	echo "Cleaning up unneeded/unwanted files"
+-	rm -f ${PKG}/bin/*.py # Remove all Python scripts
+-	rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+-	rm -f ${PKG}/lib/*.a # Remove static libraries from package
+-	rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
+-	rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+-
+-	# Compress package
+-	echo "Compressing package"
+-	tar -czf ${COMPRESSED_PKG} ${PKG}
+-	ls -lah ${ISSM_DIR}/${COMPRESSED_PKG}
++else
++	echo "Skipping tests"
+ fi
+ 
+-# Transfer package to ISSM Web site
+-echo "Transferring package to ISSM Web site"
+-scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++# Create package
++cd ${ISSM_DIR}
++svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
++echo "Copying assets to package: ${PKG}"
++cp -rf bin examples lib scripts test ${PKG}/
++mkdir ${PKG}/execution
++${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
++echo "Cleaning up unneeded/unwanted files"
++rm -f ${PKG}/bin/*.py # Remove all Python scripts
++rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
++rm -f ${PKG}/lib/*.a # Remove static libraries from package
++rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
++rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
+ 
+-if [ $? -ne 0 ]; then
+-	echo "Transfer failed! Verify connection then build this project again."
+-	exit 1
+-fi
++# Compress package
++echo "Compressing package"
++tar -czf ${COMPRESSED_PKG} ${PKG}
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25895)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25896)
+@@ -10,7 +10,7 @@
+ #
+ # When no failures/errors occur, performs the following:
+ # - Builds ISSM according to configuration.
+-# - Packages and compresses executables and libraries.
++# - Packages executables and libraries.
+ # - Runs test suite against package.
+ # - Commits compressed package to repository to be signed by JPL Cybersecurity.
+ # - Retrieves signed package and transmits it to ISSM Web site for 
+@@ -22,7 +22,8 @@
+ #						signing/notarization if it fails but build and package 
+ #						are valid.
+ # -s/--skiptests		Skip ISSM compilation and testing during packaging 
+-#						step. Use if 
++#						step. Use if packaging fails for some reason but build 
++#						is valid.
+ # -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
+ #						fails for some reason to skip building, packaging, and 
+ #						signing.
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 25895)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 25896)
+@@ -10,7 +10,7 @@
+ #
+ # When no failures/errors occur, performs the following:
+ # - Builds ISSM according to configuration.
+-# - Packages and compresses executables and libraries.
++# - Packages executables and libraries.
+ # - Runs test suite against package.
+ # - Commits compressed package to repository to be signed by JPL Cybersecurity.
+ # - Retrieves signed package and transmits it to ISSM Web site for 
+@@ -22,7 +22,8 @@
+ #						signing/notarization if it fails but build and package 
+ #						are valid.
+ # -s/--skiptests		Skip ISSM compilation and testing during packaging 
+-#						step. Use if 
++#						step. Use if packaging fails for some reason but build 
++#						is valid.
+ # -t/--transferonly		Transfer package to ISSM Web site only. Use if transfer 
+ #						fails for some reason to skip building, packaging, and 
+ #						signing.
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25895)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25896)
+@@ -4,7 +4,8 @@
+ # Packages and tests ISSM distributable package for macOS with MATLAB API.
+ #
+ # Options:
+-# -s/--skiptests		Skip tests and package only.
++# -s/--skiptests		Skip testing during packaging Use if packaging fails 
++#						for some reason but build is valid.
+ #
+ # NOTE:
+ # - Assumes that the following constants are defined,
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25895)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25896)
+@@ -4,7 +4,8 @@
+ # Packages and tests ISSM distributable package for macOS with Python API.
+ #
+ # Options:
+-# -s/--skiptests		Skip tests and package only.
++# -s/--skiptests		Skip testing during packaging Use if packaging fails 
++#						for some reason but build is valid.
+ #
+ # NOTE:
+ # - Assumes that the following constants are defined,
Index: /issm/oecreview/Archive/25834-26739/ISSM-25896-25897.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25896-25897.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25896-25897.diff	(revision 26740)
@@ -0,0 +1,123 @@
+Index: ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh	(revision 25896)
++++ ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh	(nonexistent)
+@@ -1,24 +0,0 @@
+-#!/bin/bash
+-
+-################################################################################
+-# Transfers ISSM distributable package for Linux with MATLAB API to ISSM Web 
+-# site.
+-#
+-# NOTE:
+-# - Assumes that the following constants are defined,
+-#
+-#		COMPRESSED_PKG
+-#
+-# See also:
+-# - packagers/linux/complete-issm-linux-binaries-matlab.sh
+-# - packagers/linux/complete-issm-linux-binaries-python.sh
+-################################################################################
+-
+-# Transfer package to ISSM Web site
+-echo "Transferring package to ISSM Web site"
+-scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+-
+-if [ $? -ne 0 ]; then
+-	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building and packaging)."
+-	exit 1
+-fi
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(revision 25896)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(nonexistent)
+@@ -1,89 +0,0 @@
+-#!/bin/bash
+-
+-################################################################################
+-# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
+-# site.
+-#
+-# NOTE:
+-# - Assumes that the following constants are defined,
+-#
+-#		COMPRESSED_PKG
+-#		ISSM_BINARIES_REPO_PASS
+-#		ISSM_BINARIES_REPO_USER
+-#		SIGNED_REPO_COPY
+-#		SIGNED_REPO_URL
+-#
+-# See also:
+-# - packagers/mac/complete-issm-mac-binaries-matlab.sh
+-# - packagers/mac/complete-issm-mac-binaries-python.sh
+-################################################################################
+-
+-# Expand aliases within the context of this script
+-shopt -s expand_aliases
+-
+-# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
+-#
+-#	Command line tool support for Subversion — including svn, git-svn, and 
+-#	related commands — is no longer provided by Xcode. (50266910)
+-#
+-# which results in,
+-#
+-#	svn: error: The subversion command line tools are no longer provided by 
+-#	Xcode.
+-#
+-# when calling svn, even when subversion is installed via Homebrew and its path 
+-# is available in PATH.
+-#
+-# NOTE: May be able to remove this after updating macOS.
+-#
+-alias svn='/usr/local/bin/svn'
+-
+-## Override certain other aliases
+-#
+-alias cp=$(which cp)
+-alias grep=$(which grep)
+-
+-## Functions
+-#
+-checkout_signed_repo_copy(){
+-	echo "Checking out copy of repository for signed packages"
+-
+-	# NOTE: Get empty copy because we do not want to have to check out package 
+-	#		from previous signing.
+-	#
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--depth empty \
+-		--username ${ISSM_BINARIES_REPO_USER} \
+-		--password ${ISSM_BINARIES_REPO_USER} \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-validate_signed_repo_copy(){
+-	# Validate copy of repository for signed binaries (e.g. 
+-	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+-	# initial checkout failed)
+-	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+-		rm -rf ${SIGNED_REPO_COPY}
+-		checkout_signed_repo_copy
+-	fi
+-}
+-
+-# Check if working copy of repository for signed packages is missing
+-validate_signed_repo_copy
+-
+-# Retrieve signed and notarized package
+-svn update \
+-	--username ${ISSM_BINARIES_REPO_USER} \
+-	--password ${ISSM_BINARIES_REPO_PASS} \
+-	${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
+-
+-# Transfer signed package to ISSM Web site
+-echo "Transferring signed package to ISSM Web site"
+-scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
+-
+-if [ $? -ne 0 ]; then
+-	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
+-	exit 1
+-fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25897-25898.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25897-25898.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25897-25898.diff	(revision 26740)
@@ -0,0 +1,137 @@
+Index: ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh	(nonexistent)
++++ ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh	(revision 25898)
+@@ -0,0 +1,24 @@
++#!/bin/bash
++
++################################################################################
++# Transfers ISSM distributable package for Linux with MATLAB API to ISSM Web 
++# site.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#
++# See also:
++# - packagers/linux/complete-issm-linux-binaries-matlab.sh
++# - packagers/linux/complete-issm-linux-binaries-python.sh
++################################################################################
++
++# Transfer package to ISSM Web site
++echo "Transferring package to ISSM Web site"
++scp -i ~/.ssh/debian_linux-vm_to_ross ${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++
++if [ $? -ne 0 ]; then
++	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building and packaging)."
++	exit 1
++fi
+
+Property changes on: ../trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(nonexistent)
++++ ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh	(revision 25898)
+@@ -0,0 +1,89 @@
++#!/bin/bash
++
++################################################################################
++# Transfers ISSM distributable package for macOS with MATLAB API to ISSM Web 
++# site.
++#
++# NOTE:
++# - Assumes that the following constants are defined,
++#
++#		COMPRESSED_PKG
++#		ISSM_BINARIES_REPO_PASS
++#		ISSM_BINARIES_REPO_USER
++#		SIGNED_REPO_COPY
++#		SIGNED_REPO_URL
++#
++# See also:
++# - packagers/mac/complete-issm-mac-binaries-matlab.sh
++# - packagers/mac/complete-issm-mac-binaries-python.sh
++################################################################################
++
++# Expand aliases within the context of this script
++shopt -s expand_aliases
++
++# From https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes,
++#
++#	Command line tool support for Subversion — including svn, git-svn, and 
++#	related commands — is no longer provided by Xcode. (50266910)
++#
++# which results in,
++#
++#	svn: error: The subversion command line tools are no longer provided by 
++#	Xcode.
++#
++# when calling svn, even when subversion is installed via Homebrew and its path 
++# is available in PATH.
++#
++# NOTE: May be able to remove this after updating macOS.
++#
++alias svn='/usr/local/bin/svn'
++
++## Override certain other aliases
++#
++alias cp=$(which cp)
++alias grep=$(which grep)
++
++## Functions
++#
++checkout_signed_repo_copy(){
++	echo "Checking out copy of repository for signed packages"
++
++	# NOTE: Get empty copy because we do not want to have to check out package 
++	#		from previous signing.
++	#
++	svn checkout \
++		--trust-server-cert \
++		--non-interactive \
++		--depth empty \
++		--username ${ISSM_BINARIES_REPO_USER} \
++		--password ${ISSM_BINARIES_REPO_USER} \
++		${SIGNED_REPO_URL} \
++		${SIGNED_REPO_COPY} > /dev/null 2>&1
++}
++validate_signed_repo_copy(){
++	# Validate copy of repository for signed binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${SIGNED_REPO_COPY}
++		checkout_signed_repo_copy
++	fi
++}
++
++# Check if working copy of repository for signed packages is missing
++validate_signed_repo_copy
++
++# Retrieve signed and notarized package
++svn update \
++	--username ${ISSM_BINARIES_REPO_USER} \
++	--password ${ISSM_BINARIES_REPO_PASS} \
++	${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
++
++# Transfer signed package to ISSM Web site
++echo "Transferring signed package to ISSM Web site"
++scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
++
++if [ $? -ne 0 ]; then
++	echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip building, packaging, and signing)."
++	exit 1
++fi
+
+Property changes on: ../trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25898-25899.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25898-25899.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25898-25899.diff	(revision 26740)
@@ -0,0 +1,66 @@
+Index: ../trunk-jpl/externalpackages/boost/configs/1.55/reverse_iterator.hpp.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/configs/1.55/reverse_iterator.hpp.patch	(nonexistent)
++++ ../trunk-jpl/externalpackages/boost/configs/1.55/reverse_iterator.hpp.patch	(revision 25899)
+@@ -0,0 +1,4 @@
++64c64
++<       return reverse_iterator<BidirectionalIterator>(x);
++---
++>       return boost::reverse_iterator<BidirectionalIterator>(x);
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh	(revision 25899)
+@@ -0,0 +1,45 @@
++#!/bin/bash
++set -eu
++
++## Constants
++#
++VER="3.12.3"
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf install src
++mkdir install src
++
++# Move source to 'src' directory
++mv petsc-${VER}/* src/
++rm -rf petsc-${VER}
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-mpi-dir="/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/" \
++	--with-blas-lapack-dir="$TACC_MKL_LIB" \
++	--with-scalapack-include="$TACC_MKL_INC" \
++	--with-scalapack-lib="$TACC_MKL_LIB/libmkl_scalapack_lp64.so $TACC_MKL_LIB/libmkl_blacs_intelmpi_lp64.so" \
++	--with-shared-libraries=1 \
++	--known-mpi-shared-libraries=1 \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-batch  \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-mumps=1 \
++	--download-scalapack=1
++
++# Compile and install
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25899-25900.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25899-25900.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25899-25900.diff	(revision 26740)
@@ -0,0 +1,187 @@
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25899)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh	(revision 25900)
+@@ -166,7 +166,7 @@
+ cd ${ISSM_DIR}
+ svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+ echo "Copying assets to package: ${PKG}"
+-cp -rf bin examples lib scripts test ${PKG}/
++cp -rf bin examples lib scripts test ${PKG}
+ mkdir ${PKG}/execution
+ cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
+ echo "Cleaning up unneeded/unwanted files"
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 25899)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 25900)
+@@ -68,6 +68,11 @@
+ # Build
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-matlab
++
++	if [ $? -ne 0 ]; then
++		echo 'Build failed'
++		exit 1
++	fi
+ fi
+ 
+ # Package
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 25899)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 25900)
+@@ -68,6 +68,11 @@
+ # Build
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-python
++
++	if [ $? -ne 0 ]; then
++		echo 'Build failed'
++		exit 1
++	fi
+ fi
+ 
+ # Package
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 25899)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 25900)
+@@ -44,12 +44,12 @@
+ fi
+ 
+ skip_tests=0
+-while [ $# -gt 0 ]; do
+-    case $1 in
+-        -s|--skiptests) skip_tests=1;					;;
+-        *) echo "Unknown parameter passed: $1"; exit 1	;;
+-    esac
+-    shift
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-s|--skiptests) skip_tests=1;					;;
++		*) echo "Unknown parameter passed: $1"; exit 1	;;
++	esac
+ done
+ 
+ # Check if MATLAB exists
+@@ -64,7 +64,7 @@
+ rm -rf ${PKG} ${COMPRESSED_PKG}
+ mkdir ${PKG}
+ 
+-# Add/modify required binaries and libraries
++# Add required binaries and libraries to package and modify them where needed
+ cd ${ISSM_DIR}/bin
+ 
+ echo "Modify generic"
+@@ -152,7 +152,7 @@
+ cd ${ISSM_DIR}
+ svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+ echo "Copying assets to package: ${PKG}"
+-cp -rf bin examples lib scripts test ${PKG}/
++cp -rf bin examples lib scripts test ${PKG}
+ mkdir ${PKG}/execution
+ echo "Cleaning up unneeded/unwanted files"
+ rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 25899)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 25900)
+@@ -43,12 +43,12 @@
+ fi
+ 
+ skip_tests=0
+-while [ $# -gt 0 ]; do
+-    case $1 in
+-        -s|--skiptests) skip_tests=1;					;;
+-        *) echo "Unknown parameter passed: $1"; exit 1	;;
+-    esac
+-    shift
++
++if [ $# -eq 1 ]; then
++	case $1 in
++		-s|--skiptests) skip_tests=1;					;;
++		*) echo "Unknown parameter passed: $1"; exit 1	;;
++	esac
+ done
+ 
+ # Clean up from previous packaging
+@@ -57,7 +57,7 @@
+ rm -rf ${PKG} ${COMPRESSED_PKG}
+ mkdir ${PKG}
+ 
+-# Add/modify required binaries and libraries
++# Add required binaries and libraries to package and modify them where needed
+ cd ${ISSM_DIR}/bin
+ 
+ echo "Modify generic"
+@@ -151,7 +151,7 @@
+ cd ${ISSM_DIR}
+ svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+ echo "Copying assets to package: ${PKG}"
+-cp -rf bin examples lib scripts test ${PKG}/
++cp -rf bin examples lib scripts test ${PKG}
+ mkdir ${PKG}/execution
+ ${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
+ echo "Cleaning up unneeded/unwanted files"
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25899)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25900)
+@@ -97,6 +97,11 @@
+ # Build
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-matlab
++
++	if [ $? -ne 0 ]; then
++		echo 'Build failed'
++		exit 1
++	fi
+ fi
+ 
+ # Package
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 25899)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 25900)
+@@ -97,6 +97,11 @@
+ # Build
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-python
++
++	if [ $? -ne 0 ]; then
++		echo 'Build failed'
++		exit 1
++	fi
+ fi
+ 
+ # Package
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25899)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25900)
+@@ -104,6 +104,12 @@
+ 	esac
+ fi
+ 
++# Clean up from previous packaging
++echo "Cleaning up existing assets"
++cd ${ISSM_DIR}
++rm -rf ${PKG} ${COMPRESSED_PKG}
++mkdir ${PKG}
++
+ # Add required binaries and libraries to package and modify them where needed
+ cd ${ISSM_DIR}/bin
+ 
+@@ -194,9 +200,8 @@
+ cd ${ISSM_DIR}
+ svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
+ echo "Copying assets to package: ${PKG}"
+-cp -rf bin examples lib scripts test ${PKG}/
++cp -rf bin examples lib scripts test ${PKG}
+ mkdir ${PKG}/execution
+-cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
+ ${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
+ echo "Cleaning up unneeded/unwanted files"
+ rm -f ${PKG}/bin/*.py # Remove all Python scripts
Index: /issm/oecreview/Archive/25834-26739/ISSM-25900-25901.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25900-25901.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25900-25901.diff	(revision 26740)
@@ -0,0 +1,128 @@
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25900)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh	(revision 25901)
+@@ -25,6 +25,10 @@
+ # See also:
+ # - packagers/mac/complete-issm-mac-binaries-matlab.sh
+ # - packagers/mac/sign-issm-mac-binaries-matlab.sh
++#
++# TODO:
++# - Generalize checkout_*_repo_copy and validate_*_repo_copy functions (e.g. 
++#	pass 'signed' or 'unsigned' as argument)
+ ################################################################################
+ 
+ # Expand aliases within the context of this script
+@@ -98,6 +102,15 @@
+ 		checkout_signed_repo_copy
+ 	fi
+ }
++validate_unsigned_repo_copy(){
++	# Validate copy of repository for unsigned binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${UNSIGNED_REPO_COPY} || ! -d ${UNSIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${UNSIGNED_REPO_COPY}
++		checkout_unsigned_repo_copy
++	fi
++}
+ 
+ ## Parse options
+ #
+@@ -163,7 +176,7 @@
+ 	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ # Check out copy of repository for unsigned packages
+-checkout_unsigned_repo_copy
++validate_unsigned_repo_copy
+ 
+ if [ ${retrigger_signing} -eq 0 ]; then
+ 	# Commit new compressed package to repository for unsigned binaries
+Index: ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(revision 25900)
++++ ../trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh	(revision 25901)
+@@ -25,6 +25,10 @@
+ # See also:
+ # - packagers/mac/complete-issm-mac-binaries-python.sh
+ # - packagers/mac/sign-issm-mac-binaries-python.sh
++#
++# TODO:
++# - Generalize checkout_*_repo_copy and validate_*_repo_copy functions (e.g. 
++#	pass 'signed' or 'unsigned' as argument)
+ ################################################################################
+ 
+ # Expand aliases within the context of this script
+@@ -98,6 +102,15 @@
+ 		checkout_signed_repo_copy
+ 	fi
+ }
++validate_unsigned_repo_copy(){
++	# Validate copy of repository for unsigned binaries (e.g. 
++	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
++	# initial checkout failed)
++	if [[ ! -d ${UNSIGNED_REPO_COPY} || ! -d ${UNSIGNED_REPO_COPY}/.svn ]]; then
++		rm -rf ${UNSIGNED_REPO_COPY}
++		checkout_unsigned_repo_copy
++	fi
++}
+ 
+ ## Parse options
+ #
+@@ -163,7 +176,7 @@
+ 	--message "ADD: New lock file" ${SIGNED_REPO_COPY} > /dev/null 2>&1
+ 
+ # Check out copy of repository for unsigned packages
+-checkout_unsigned_repo_copy
++validate_unsigned_repo_copy
+ 
+ if [ ${retrigger_signing} -eq 0 ]; then
+ 	# Commit new compressed package to repository for unsigned binaries
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25900)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25901)
+@@ -51,43 +51,6 @@
+ #
+ export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
+ 
+-## Functions
+-#
+-checkout_signed_repo_copy(){
+-	echo "Checking out copy of repository for signed packages"
+-
+-	# NOTE: Get empty copy because we do not want to have to check out package 
+-	#		from previous signing.
+-	#
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--depth empty \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		${SIGNED_REPO_URL} \
+-		${SIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-checkout_unsigned_repo_copy(){
+-	echo "Checking out copy of repository for unsigned packages"
+-	svn checkout \
+-		--trust-server-cert \
+-		--non-interactive \
+-		--username ${USERNAME} \
+-		--password ${PASSWORD} \
+-		${UNSIGNED_REPO_URL} \
+-		${UNSIGNED_REPO_COPY} > /dev/null 2>&1
+-}
+-validate_signed_repo_copy(){
+-	# Validate copy of repository for signed binaries (e.g. 
+-	# 'Check-out Strategy' was set to 'Use 'svn update' as much as possible'; 
+-	# initial checkout failed)
+-	if [[ ! -d ${SIGNED_REPO_COPY} || ! -d ${SIGNED_REPO_COPY}/.svn ]]; then
+-		rm -rf ${SIGNED_REPO_COPY}
+-		checkout_signed_repo_copy
+-	fi
+-}
+-
+ ## Parse options
+ #
+ if [ $# -gt 1 ]; then
Index: /issm/oecreview/Archive/25834-26739/ISSM-25901-25902.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25901-25902.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25901-25902.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 25901)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 25902)
+@@ -50,7 +50,7 @@
+ 		-s|--skiptests) skip_tests=1;					;;
+ 		*) echo "Unknown parameter passed: $1"; exit 1	;;
+ 	esac
+-done
++fi
+ 
+ # Check if MATLAB exists
+ if ! [ -d ${MATLAB_PATH} ]; then
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 25901)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 25902)
+@@ -49,7 +49,7 @@
+ 		-s|--skiptests) skip_tests=1;					;;
+ 		*) echo "Unknown parameter passed: $1"; exit 1	;;
+ 	esac
+-done
++fi
+ 
+ # Clean up from previous packaging
+ echo "Cleaning up existing assets"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25902-25903.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25902-25903.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25902-25903.diff	(revision 26740)
@@ -0,0 +1,150 @@
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25902)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh	(revision 25903)
+@@ -98,8 +98,7 @@
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-matlab
+ 
+-	if [ $? -ne 0 ]; then
+-		echo 'Build failed'
++	if [ $? -ne 0 ]; then 
+ 		exit 1
+ 	fi
+ fi
+@@ -108,15 +107,27 @@
+ if [ ${package} -eq 1 ]; then
+ 	./packagers/mac/package-issm-mac-binaries-matlab.sh $1
+ 	shift # Clear $1 so that it is not passed to commit_for_signing script
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+ # Commit for signing
+ if [ ${sign} -eq 1 ]; then
+ 	./packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh $1
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+ # Transfer distributable package to ISSM Web site
+ if [ ${transfer} -eq 1 ]; then
+ 	./packagers/mac/transfer-issm-mac-binaries.sh
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+Index: ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 25902)
++++ ../trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh	(revision 25903)
+@@ -98,8 +98,7 @@
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-python
+ 
+-	if [ $? -ne 0 ]; then
+-		echo 'Build failed'
++	if [ $? -ne 0 ]; then 
+ 		exit 1
+ 	fi
+ fi
+@@ -108,15 +107,27 @@
+ if [ ${package} -eq 1 ]; then
+ 	./packagers/mac/package-issm-mac-binaries-python.sh $1
+ 	shift # Clear $1 so that it is not passed to commit_for_signing script
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+ # Commit for signing
+ if [ ${sign} -eq 1 ]; then
+ 	./packagers/mac/commit_for_signing-issm-mac-binaries-python.sh $1
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+ # Transfer distributable package to ISSM Web site
+ if [ ${transfer} -eq 1 ]; then
+ 	./packagers/mac/transfer-issm-mac-binaries.sh
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 25902)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 25903)
+@@ -69,8 +69,7 @@
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-matlab
+ 
+-	if [ $? -ne 0 ]; then
+-		echo 'Build failed'
++	if [ $? -ne 0 ]; then 
+ 		exit 1
+ 	fi
+ fi
+@@ -78,10 +77,18 @@
+ # Package
+ if [ ${package} -eq 1 ]; then
+ 	./packagers/linux/package-issm-linux-binaries-matlab.sh $1
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+ # Transfer distributable package to ISSM Web site
+ if [ ${transfer} -eq 1 ]; then
+ 	./packagers/linux/transfer-issm-linux-binaries.sh
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 25902)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 25903)
+@@ -69,8 +69,7 @@
+ if [ ${build} -eq 1 ]; then
+ 	./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-python
+ 
+-	if [ $? -ne 0 ]; then
+-		echo 'Build failed'
++	if [ $? -ne 0 ]; then 
+ 		exit 1
+ 	fi
+ fi
+@@ -78,10 +77,18 @@
+ # Package
+ if [ ${package} -eq 1 ]; then
+ 	./packagers/linux/package-issm-linux-binaries-python.sh $1
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
+ # Transfer distributable package to ISSM Web site
+ if [ ${transfer} -eq 1 ]; then
+ 	./packagers/linux/transfer-issm-linux-binaries.sh
++
++	if [ $? -ne 0 ]; then 
++		exit 1
++	fi
+ fi
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25903-25904.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25903-25904.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25903-25904.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25903)
++++ ../trunk-jpl/etc/environment.sh	(revision 25904)
+@@ -10,7 +10,7 @@
+ #
+ 
+ # Silence no `zsh: no matches found: <file>`
+-setopt +o nomatch >1 /dev/null 2>&1
++setopt +o nomatch 1> /dev/null 2>&1
+ 
+ ## Functions
+ #
Index: /issm/oecreview/Archive/25834-26739/ISSM-25904-25905.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25904-25905.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25904-25905.diff	(revision 26740)
@@ -0,0 +1,966 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 25904)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 25905)
+@@ -650,26 +650,22 @@
+ 	if(!IsOnBase()) return;
+ 	const int NUM_VERTICES = this->GetNumberOfVertices();
+ 
+-	int        i;
+-	IssmDouble accuref, runoffref; //reference values at given altitude
+-	IssmDouble accualti, runoffalti; //reference altitudes
++	IssmDouble accuref, runoffref;  //reference values at given altitude
+ 	IssmDouble accugrad, runoffgrad; //gradients from reference altitude
+-	IssmDouble rho_water, rho_ice;
+-	IssmDouble time;
+ 
+-	IssmDouble*		smb	 = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble*		surf	 = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble*		accu	 = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble*		runoff = xNew<IssmDouble>(NUM_VERTICES);
++	IssmDouble smb[MAXVERTICES];
++	IssmDouble surf[MAXVERTICES];
++	IssmDouble accu[MAXVERTICES];
++	IssmDouble runoff[MAXVERTICES];
+ 
+ 	/*Get material parameters :*/
+-	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+-	rho_ice=this->FindParam(MaterialsRhoIceEnum);
++	IssmDouble rho_water = this->FindParam(MaterialsRhoSeawaterEnum);
++	IssmDouble rho_ice   = this->FindParam(MaterialsRhoIceEnum);
+ 
+ 	/*Recover parameters*/
+-	parameters->FindParam(&time,TimeEnum);
+-	parameters->FindParam(&accualti,SmbAccualtiEnum);
+-	parameters->FindParam(&runoffalti,SmbRunoffaltiEnum);
++	IssmDouble time       = this->FindParam(TimeEnum);
++	IssmDouble accualti   = this->FindParam(SmbAccualtiEnum);
++	IssmDouble runoffalti = this->FindParam(SmbRunoffaltiEnum);
+ 
+ 	/*Recover reference values at current time*/
+ 	parameters->FindParam(&accugrad,SmbAccugradEnum,time);
+@@ -682,9 +678,9 @@
+ 
+ 	/*Compute the temperature and precipitation*/
+ 	for(int iv=0;iv<NUM_VERTICES;iv++){
+-		accu[iv]=max(0.,(accuref+(surf[iv]-accualti)*accugrad));
+-		runoff[iv]=max(0.,(runoffref+(surf[iv]-runoffalti)*runoffgrad));
+-		smb[iv]=(accu[iv]-runoff[iv])*rho_ice/rho_water;
++		accu[iv]   = max(0.,(accuref+(surf[iv]-accualti)*accugrad));
++		runoff[iv] = max(0.,(runoffref+(surf[iv]-runoffalti)*runoffgrad));
++		smb[iv]    = (accu[iv]-runoff[iv])*rho_ice/rho_water;
+ 	}
+ 
+ 	switch(this->ObjectEnum()){
+@@ -700,11 +696,6 @@
+ 		break;
+ 	default: _error_("Not implemented yet");
+ 	}
+-	/*clean-up*/
+-	xDelete<IssmDouble>(surf);
+-	xDelete<IssmDouble>(accu);
+-	xDelete<IssmDouble>(runoff);
+-	xDelete<IssmDouble>(smb);
+ }
+ /*}}}*/
+ IssmDouble Element::Divergence(void){/*{{{*/
+@@ -1292,117 +1283,92 @@
+ 	delete gauss;
+ }
+ /*}}}*/
+-/* void       Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){/\*{{{*\/ */
+-
+-/* 	/\*Fetch number vertices for this element and allocate arrays*\/ */
+-/* 	const int NUM_VERTICES = this->GetNumberOfVertices(); */
+-/* 	int*        vertexpidlist = xNew<int>(NUM_VERTICES); */
+-/* 	IssmDouble* values        = xNew<IssmDouble>(NUM_VERTICES); */
+-
+-/* 	/\*Fill in values*\/ */
+-/* 	this->GetVerticesPidList(vertexpidlist); */
+-/* 	this->GetInputListOnVertices(values,input_enum); */
+-/* 	vector->SetValues(NUM_VERTICES,vertexpidlist,values,INS_VAL); */
+-
+-/* 	/\*Clean up*\/ */
+-/* 	xDelete<int>(vertexpidlist); */
+-/* 	xDelete<IssmDouble>(values); */
+-
+-/* } */
+-/* /\*}}}*\/ */
+ void       Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum,int type){/*{{{*/
+ 
+-	/*Fetch number vertices for this element and allocate arrays*/
+-	const int NUM_VERTICES = this->GetNumberOfVertices();
+ 
+-	int         numnodes    = this->GetNumberOfNodes();
+-	int*        doflist     = NULL;
+-	IssmDouble  value;
+-	IssmDouble* values      = NULL;
+-	Input*     input       = NULL;
+-
+ 	switch(type){
+-		case ElementSIdEnum:
+-			input=this->GetInput(input_enum); _assert_(input);
++		case ElementSIdEnum:{
++         IssmDouble  value;
++			Input* input=this->GetInput(input_enum); _assert_(input);
+ 			input->GetInputAverage(&value);
+ 			vector->SetValue(this->sid,value,INS_VAL);
++                          }
+ 			break;
+-		case VertexPIdEnum:
+-			doflist = xNew<int>(NUM_VERTICES);
+-			values = xNew<IssmDouble>(NUM_VERTICES);
++		case VertexPIdEnum:{
++         int        doflist[MAXVERTICES];
++         IssmDouble values[MAXVERTICES];
++			const int  NUM_VERTICES = this->GetNumberOfVertices();
+ 			/*Fill in values*/
+-			this->GetVerticesPidList(doflist);
+-			this->GetInputListOnVertices(values,input_enum);
++			this->GetVerticesPidList(&doflist[0]);
++			this->GetInputListOnVertices(&values[0],input_enum);
+ 			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
++                         }
+ 			break;
+-		case VertexSIdEnum:
+-			doflist = xNew<int>(NUM_VERTICES);
+-			values = xNew<IssmDouble>(NUM_VERTICES);
++		case VertexSIdEnum:{
++         int        doflist[MAXVERTICES];
++         IssmDouble values[MAXVERTICES];
++			const int  NUM_VERTICES = this->GetNumberOfVertices();
+ 			/*Fill in values*/
+ 			this->GetVerticesSidList(doflist);
+ 			this->GetInputListOnVertices(values,input_enum);
+ 			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
++                         }
+ 			break;
+-		case NodesEnum:
+-			doflist = xNew<int>(numnodes);
+-			values = xNew<IssmDouble>(numnodes);
++		case NodesEnum:{
++         int         numnodes = this->GetNumberOfNodes();
++         int        *doflist  = xNew<int>(numnodes);
++         IssmDouble *values   = xNew<IssmDouble>(numnodes);
+ 			/*Fill in values*/
+ 			this->GetInputListOnNodes(values,input_enum);
+ 			this->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+ 			vector->SetValues(numnodes,doflist,values,INS_VAL);
++         xDelete<int>(doflist);
++         xDelete<IssmDouble>(values);
++                     }
+ 			break;
+-		case NodeSIdEnum:
+-			doflist = xNew<int>(numnodes);
+-			values = xNew<IssmDouble>(numnodes);
++		case NodeSIdEnum:{
++         int         numnodes = this->GetNumberOfNodes();
++         int        *doflist  = xNew<int>(numnodes);
++         IssmDouble *values   = xNew<IssmDouble>(numnodes);
+ 			/*Fill in values*/
+ 			this->GetNodesSidList(doflist);
+ 			this->GetInputListOnNodes(values,input_enum);
+ 			vector->SetValues(numnodes,doflist,values,INS_VAL);
++         xDelete<int>(doflist);
++         xDelete<IssmDouble>(values);
++                       }
+ 			break;
+ 		default:
+ 			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+ 
+-	/*Clean up*/
+-	xDelete<int>(doflist);
+-	xDelete<IssmDouble>(values);
+-
+-}
+-/*}}}*/
++}/*}}}*/
+ void       Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum,int type, IssmDouble time){/*{{{*/
+ 
+-	/*Fetch number vertices for this element and allocate arrays*/
+-	const int NUM_VERTICES = this->GetNumberOfVertices();
+-
+-	int         numnodes    = this->GetNumberOfNodes();
+-	int*        doflist     = NULL;
+-	IssmDouble* values      = NULL;
+-
+ 	switch(type){
+-		case VertexPIdEnum:
+-			doflist = xNew<int>(NUM_VERTICES);
+-			values = xNew<IssmDouble>(NUM_VERTICES);
++		case VertexPIdEnum:{
++			int        doflist[MAXVERTICES];
++			IssmDouble values[MAXVERTICES];
++			const int  NUM_VERTICES = this->GetNumberOfVertices();
+ 			/*Fill in values*/
+ 			this->GetVerticesPidList(doflist);
+ 			this->GetInputListOnVerticesAtTime(values,input_enum,time);
+-			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
++			vector->SetValues(NUM_VERTICES,doflist,&values[0],INS_VAL);
++								 }
+ 			break;
+-		case VertexSIdEnum:
+-			doflist = xNew<int>(NUM_VERTICES);
+-			values = xNew<IssmDouble>(NUM_VERTICES);
++		case VertexSIdEnum:{
++			int        doflist[MAXVERTICES];
++			IssmDouble values[MAXVERTICES];
++			const int  NUM_VERTICES = this->GetNumberOfVertices();
+ 			/*Fill in values*/
+ 			this->GetVerticesSidList(doflist);
+ 			this->GetInputListOnVerticesAtTime(values,input_enum,time);
+-			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
++			vector->SetValues(NUM_VERTICES,doflist,&values[0],INS_VAL);
++								 }
+ 			break;
+ 		default:
+ 			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+ 	}
+-
+-	/*Clean up*/
+-	xDelete<int>(doflist);
+-	xDelete<IssmDouble>(values);
+-
+ }
+ /*}}}*/
+ void       Element::GetVerticesLidList(int* lidlist){/*{{{*/
+@@ -1448,13 +1414,11 @@
+ 
+ 	/*Create list of x*/
+ 	const int NUM_VERTICES = this->GetNumberOfVertices();
+-
+-	IssmDouble* x_list = xNew<IssmDouble>(NUM_VERTICES);
+-
++	IssmDouble x_list[MAXVERTICES];
+ 	for(int i=0;i<NUM_VERTICES;i++) x_list[i]=xyz_list[i*3+0];
+-	ValueP1OnGauss(&x,x_list,gauss);
+ 
+-	xDelete<IssmDouble>(x_list);
++	/*Get value at gauss point*/
++	ValueP1OnGauss(&x,&x_list[0],gauss);
+ 	return x;
+ }/*}}}*/
+ IssmDouble Element::GetYcoord(IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+@@ -1464,13 +1428,11 @@
+ 
+ 	/*Create list of y*/
+ 	const int NUM_VERTICES = this->GetNumberOfVertices();
+-
+-	IssmDouble* y_list      = xNew<IssmDouble>(NUM_VERTICES);
+-
++	IssmDouble y_list[MAXVERTICES];
+ 	for(int i=0;i<NUM_VERTICES;i++) y_list[i]=xyz_list[i*3+1];
+-	ValueP1OnGauss(&y,y_list,gauss);
+ 
+-	xDelete<IssmDouble>(y_list);
++	/*Get value at gauss point*/
++	ValueP1OnGauss(&y,&y_list[0],gauss);
+ 	return y;
+ }/*}}}*/
+ IssmDouble Element::GetZcoord(IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+@@ -1480,13 +1442,11 @@
+ 
+ 	/*Create list of z*/
+ 	const int NUM_VERTICES = this->GetNumberOfVertices();
+-
+-	IssmDouble* z_list      = xNew<IssmDouble>(NUM_VERTICES);
+-
++	IssmDouble z_list[MAXVERTICES];
+ 	for(int i=0;i<NUM_VERTICES;i++) z_list[i]=xyz_list[i*3+2];
+-	ValueP1OnGauss(&z,z_list,gauss);
+ 
+-	xDelete<IssmDouble>(z_list);
++	/*Get value at gauss point*/
++	ValueP1OnGauss(&z,&z_list[0],gauss);
+ 	return z;
+ }/*}}}*/
+ void       Element::GradientIndexing(int* indexing,int control_index){/*{{{*/
+@@ -1611,21 +1571,18 @@
+ /*}}}*/
+ void       Element::InputCreate(IssmDouble* vector,Inputs* inputs,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){/*{{{*/
+ 
+-	/*Intermediaries*/
+-	int i,t;
+-
+ 	/*Branch on type of vector: nodal or elementary: */
+ 	if(vector_type==1){ //nodal vector
+ 
+ 		const int NUM_VERTICES = this->GetNumberOfVertices();
+ 
+-		int        *vertexids  = xNew<int>(NUM_VERTICES);
+-		int        *vertexlids = xNew<int>(NUM_VERTICES);
+-		IssmDouble *values     = xNew<IssmDouble>(NUM_VERTICES);
++		int        vertexids[MAXVERTICES];
++		int        vertexlids[MAXVERTICES];
++		IssmDouble values[MAXVERTICES];
+ 
+ 		/*Recover vertices ids needed to initialize inputs*/
+ 		_assert_(iomodel->elements);
+-		for(i=0;i<NUM_VERTICES;i++){
++		for(int i=0;i<NUM_VERTICES;i++){
+ 			vertexids[i] =reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
+ 			vertexlids[i]=iomodel->my_vertices_lids[vertexids[i]-1];
+ 		}
+@@ -1636,20 +1593,20 @@
+ 			this->SetElementInput(inputs,vector_enum,vector[0]);
+ 		}
+ 		else if(M==iomodel->numberofvertices){
+-			for(i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
++			for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
+ 			this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
+ 		}
+ 		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];
++			for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+ 			inputs->SetTransientInput(vector_enum,times,N);
+ 			TransientInput* transientinput = inputs->GetTransientInput(vector_enum);
+-			for(t=0;t<N;t++){
+-				for(i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
++			for(int t=0;t<N;t++){
++				for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
+ 				switch(this->ObjectEnum()){
+-					case TriaEnum:  transientinput->AddTriaTimeInput( t,NUM_VERTICES,vertexlids,values,P1Enum); break;
+-					case PentaEnum: transientinput->AddPentaTimeInput(t,NUM_VERTICES,vertexlids,values,P1Enum); break;
++					case TriaEnum:  transientinput->AddTriaTimeInput( t,NUM_VERTICES,vertexlids,&values[0],P1Enum); break;
++					case PentaEnum: transientinput->AddPentaTimeInput(t,NUM_VERTICES,vertexlids,&values[0],P1Enum); break;
+ 					default: _error_("Not implemented yet");
+ 				}
+ 			}
+@@ -1658,34 +1615,30 @@
+ 		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];
++			IssmDouble* evalues = xNew<IssmDouble>(N);
++			for(int j=0;j<N;j++) evalues[j]=vector[this->Sid()*N+j];
+ 
+ 			if (N==this->GetNumberOfNodes(P1Enum)){
+-				this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
++				this->SetElementInput(inputs,NUM_VERTICES,vertexlids,evalues,vector_enum);
+ 			}
+ 			else if(N==this->GetNumberOfNodes(P0Enum)){
+-				this->SetElementInput(inputs,vector_enum,values[0]);
++				this->SetElementInput(inputs,vector_enum,evalues[0]);
+ 			}
+ 			else if(N==this->GetNumberOfNodes(P1xP2Enum)){ _assert_(this->ObjectEnum()==PentaEnum);
+-				inputs->SetPentaInput(vector_enum,P1xP2Enum,this->lid,N,values);
++				inputs->SetPentaInput(vector_enum,P1xP2Enum,this->lid,N,evalues);
+ 			}
+ 			else if(N==this->GetNumberOfNodes(P1xP3Enum)){ _assert_(this->ObjectEnum()==PentaEnum);
+-				inputs->SetPentaInput(vector_enum,P1xP3Enum,this->lid,N,values);
++				inputs->SetPentaInput(vector_enum,P1xP3Enum,this->lid,N,evalues);
+ 			}
+ 			else{
+ 				_error_("Patch interpolation not supported yet");
+ 			}
++			xDelete<IssmDouble>(evalues);
+ 
+ 		}
+ 		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);
+-		xDelete<int>(vertexlids);
+ 	}
+ 	else if(vector_type==2){ //element vector
+ 
+@@ -1707,10 +1660,10 @@
+ 		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];
++			for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+ 			inputs->SetTransientInput(vector_enum,times,N);
+ 			TransientInput* transientinput = inputs->GetTransientInput(vector_enum);
+-			for(t=0;t<N;t++){
++			for(int t=0;t<N;t++){
+ 				value=vector[N*this->Sid()+t];
+ 				switch(this->ObjectEnum()){
+ 					case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&(this->lid),&value,P0Enum); break;
+@@ -1727,7 +1680,7 @@
+ 		/*For right now we are static */
+ 		if(M==iomodel->numberofelements){
+ 			IssmDouble* layers = xNewZeroInit<IssmDouble>(N);
+-			for(t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
++			for(int t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
+ 			inputs->SetArrayInput(vector_enum,this->lid,layers,N);
+ 			xDelete<IssmDouble>(layers);
+ 		}
+@@ -1849,21 +1802,18 @@
+ 	 * code: what type of data is in the vector (booleans, ints, doubles)
+ 	 */
+ 
+-	/*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);
+-		int        *vertexlids = xNew<int>(NUM_VERTICES);
+-		IssmDouble *values     = xNew<IssmDouble>(NUM_VERTICES);
++		int        vertexids[MAXVERTICES];
++		int        vertexlids[MAXVERTICES];
++		IssmDouble values[MAXVERTICES];
+ 
+ 		/*Recover vertices ids needed to initialize inputs*/
+ 		_assert_(iomodel->elements);
+-		for(i=0;i<NUM_VERTICES;i++){
++		for(int i=0;i<NUM_VERTICES;i++){
+ 			vertexids[i] =reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
+ 			vertexlids[i]=iomodel->my_vertices_lids[vertexids[i]-1];
+ 		}
+@@ -1875,7 +1825,7 @@
+ 			_error_("not implemented yet");
+ 		}
+ 		else if(M==iomodel->numberofvertices){
+-			for(i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
++			for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
+ 			switch(this->ObjectEnum()){
+ 				case TriaEnum:  inputs->SetTriaDatasetInput(enum_type,input_id,P1Enum,NUM_VERTICES,vertexlids,values); break;
+ 				case PentaEnum: inputs->SetPentaDatasetInput(enum_type,input_id,P1Enum,NUM_VERTICES,vertexlids,values); break;
+@@ -1885,10 +1835,10 @@
+ 		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];
++			for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+ 			TransientInput* transientinput = inputs->SetDatasetTransientInput(enum_type,input_id,times,N);
+-			for(t=0;t<N;t++){
+-				for(i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
++			for(int t=0;t<N;t++){
++				for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
+ 				switch(this->ObjectEnum()){
+ 					case TriaEnum:  transientinput->AddTriaTimeInput( t,NUM_VERTICES,vertexlids,values,P1Enum); break;
+ 					case PentaEnum: transientinput->AddPentaTimeInput(t,NUM_VERTICES,vertexlids,values,P1Enum); break;
+@@ -1900,10 +1850,6 @@
+ 		else{
+ 			_error_("not implemented yet (M="<<M<<")");
+ 		}
+-
+-		xDelete<IssmDouble>(values);
+-		xDelete<int>(vertexids);
+-		xDelete<int>(vertexlids);
+ 	}
+ 	else if(vector_type==2){ //element vector
+ 		_error_("not supported");
+@@ -2064,7 +2010,7 @@
+ 
+ 	/*Allocate some arrays*/
+ 	const int numvertices = this->GetNumberOfVertices();
+-	IssmDouble* basalmeltrate = xNew<IssmDouble>(numvertices);
++	IssmDouble basalmeltrate[MAXVERTICES];
+ 
+ 	/*Get variables*/
+ 	IssmDouble rhoi = this->FindParam(MaterialsRhoIceEnum);
+@@ -2113,7 +2059,6 @@
+ 	xDelete<IssmDouble>(delta_t);
+ 	xDelete<IssmDouble>(mean_tf);
+ 	xDelete<IssmDouble>(depths);
+-	xDelete<IssmDouble>(basalmeltrate);
+ 
+ }/*}}}*/
+ void       Element::LinearFloatingiceMeltingRate(){/*{{{*/
+@@ -2120,11 +2065,11 @@
+ 
+ 	const int NUM_VERTICES = this->GetNumberOfVertices();
+ 
+-	IssmDouble  deepwaterel,upperwaterel,deepwatermelt,upperwatermelt;
+-	IssmDouble *base         = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble *values       = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble *perturbation = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble 	time;
++	IssmDouble deepwaterel,upperwaterel,deepwatermelt,upperwatermelt;
++	IssmDouble base[MAXVERTICES];
++	IssmDouble values[MAXVERTICES];
++	IssmDouble perturbation[MAXVERTICES];
++	IssmDouble time;
+ 
+ 	parameters->FindParam(&time,TimeEnum);
+ 	parameters->FindParam(&deepwaterel,BasalforcingsDeepwaterElevationEnum,time);
+@@ -2133,8 +2078,8 @@
+ 	parameters->FindParam(&upperwatermelt,BasalforcingsUpperwaterMeltingRateEnum,time);
+ 	_assert_(upperwaterel>deepwaterel);
+ 
+-	this->GetInputListOnVertices(base,BaseEnum);
+-   this->GetInputListOnVertices(perturbation,BasalforcingsPerturbationMeltingRateEnum);
++	this->GetInputListOnVertices(&base[0],BaseEnum);
++   this->GetInputListOnVertices(&perturbation[0],BasalforcingsPerturbationMeltingRateEnum);
+ 	for(int i=0;i<NUM_VERTICES;i++){
+ 		if(base[i]>=upperwaterel){
+ 			values[i]=upperwatermelt;
+@@ -2151,9 +2096,6 @@
+ 	}
+ 
+ 	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
+-	xDelete<IssmDouble>(base);
+-   xDelete<IssmDouble>(perturbation);
+-	xDelete<IssmDouble>(values);
+ 
+ }/*}}}*/
+ void       Element::SpatialLinearFloatingiceMeltingRate(){/*{{{*/
+@@ -2160,16 +2102,16 @@
+ 
+ 	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);
++	IssmDouble deepwatermelt[MAXVERTICES];
++	IssmDouble deepwaterel[MAXVERTICES];;
++	IssmDouble upperwaterel[MAXVERTICES];
++	IssmDouble base[MAXVERTICES];
++	IssmDouble values[MAXVERTICES];
+ 
+-	this->GetInputListOnVertices(base,BaseEnum);
+-	this->GetInputListOnVertices(deepwatermelt,BasalforcingsDeepwaterMeltingRateEnum);
+-	this->GetInputListOnVertices(deepwaterel,BasalforcingsDeepwaterElevationEnum);
+-	this->GetInputListOnVertices(upperwaterel,BasalforcingsUpperwaterElevationEnum);
++	this->GetInputListOnVertices(&base[0],BaseEnum);
++	this->GetInputListOnVertices(&deepwatermelt[0],BasalforcingsDeepwaterMeltingRateEnum);
++	this->GetInputListOnVertices(&deepwaterel[0],BasalforcingsDeepwaterElevationEnum);
++	this->GetInputListOnVertices(&upperwaterel[0],BasalforcingsUpperwaterElevationEnum);
+ 
+ 	for(int i=0;i<NUM_VERTICES;i++){
+ 		if(base[i]>upperwaterel[i])      values[i]=0;
+@@ -2177,13 +2119,7 @@
+ 		else values[i]=deepwatermelt[i]*(base[i]-upperwaterel[i])/(deepwaterel[i]-upperwaterel[i]);
+ 	}
+ 
+-	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
+-	xDelete<IssmDouble>(base);
+-	xDelete<IssmDouble>(deepwaterel);
+-	xDelete<IssmDouble>(deepwatermelt);
+-	xDelete<IssmDouble>(upperwaterel);
+-	xDelete<IssmDouble>(values);
+-
++	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&values[0],P1Enum);
+ }/*}}}*/
+ void       Element::MantlePlumeGeothermalFlux(){/*{{{*/
+ 
+@@ -2192,7 +2128,7 @@
+ 	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>(NUM_VERTICES);
++	IssmDouble  values[MAXVERTICES];
+ 	IssmDouble *xyz_list = NULL;
+ 
+ 	parameters->FindParam(&mantleconductivity,BasalforcingsMantleconductivityEnum);
+@@ -2227,9 +2163,8 @@
+ 		values[i]=crustheat+plumeheat;
+ 	}
+ 
+-	this->AddInput(BasalforcingsGeothermalfluxEnum,values,P1Enum);
++	this->AddInput(BasalforcingsGeothermalfluxEnum,&values[0],P1Enum);
+ 	xDelete<IssmDouble>(xyz_list);
+-	xDelete<IssmDouble>(values);
+ 
+ }/*}}}*/
+ void       Element::MarshallElement2(MarshallHandle* marshallhandle,int numanalyses){/*{{{*/
+@@ -2252,16 +2187,15 @@
+ void       Element::MigrateGroundingLine(IssmDouble* phi_ungrounding){/*{{{*/
+ 
+ 	const int  NUM_VERTICES = this->GetNumberOfVertices();
+-	int        i,migration_style;
++	int        migration_style;
+ 	IssmDouble bed_hydro,yts;
+-	IssmDouble rho_water,rho_ice,density;
+-	IssmDouble* melting = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble* phi     = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble* h       = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble* s       = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble* b       = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble* r       = xNew<IssmDouble>(NUM_VERTICES);
+-	IssmDouble* sl      = xNew<IssmDouble>(NUM_VERTICES);
++	IssmDouble melting[MAXVERTICES];
++	IssmDouble phi[MAXVERTICES];
++	IssmDouble h[MAXVERTICES];
++	IssmDouble s[MAXVERTICES];
++	IssmDouble b[MAXVERTICES];
++	IssmDouble r[MAXVERTICES];
++	IssmDouble sl[MAXVERTICES];
+ 
+ 	/*Recover info at the vertices: */
+ 	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
+@@ -2272,19 +2206,21 @@
+ 	GetInputListOnVertices(&r[0],BedEnum);
+ 	GetInputListOnVertices(&sl[0],SealevelEnum);
+ 	GetInputListOnVertices(&phi[0],MaskOceanLevelsetEnum);
+-	rho_water   = FindParam(MaterialsRhoSeawaterEnum);
+-	rho_ice     = FindParam(MaterialsRhoIceEnum);
+-	density     = rho_ice/rho_water;
++	IssmDouble rho_water   = FindParam(MaterialsRhoSeawaterEnum);
++	IssmDouble rho_ice     = FindParam(MaterialsRhoIceEnum);
++	IssmDouble density     = rho_ice/rho_water;
+ 
+ 	/*go through vertices, and update inputs, considering them to be TriaVertex type: */
+-	for(i=0;i<NUM_VERTICES;i++){
++	for(int i=0;i<NUM_VERTICES;i++){
+ 		/* Contact FS*/
+ 		if(migration_style == ContactEnum){
+ 			phi[i]=phi_ungrounding[vertices[i]->Pid()];
+ 			if(phi[i]>=0.) b[i]=r[i];
+ 		}
+-		else if(migration_style == GroundingOnlyEnum && b[i]<r[i]) b[i]=r[i];
+-		/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
++		else if(migration_style == GroundingOnlyEnum && b[i]<r[i]){
++			/*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
++			b[i]=r[i];
++		}
+ 		else if(phi[i]<=0.){
+ 			if(b[i]<=r[i]){
+ 				b[i]        = r[i];
+@@ -2298,12 +2234,12 @@
+ 			if (bed_hydro>r[i]){
+ 				/*Unground only if the element is connected to the ice shelf*/
+ 				if(migration_style==AggressiveMigrationEnum || migration_style==SubelementMigrationEnum){
+-					s[i]        = (1-density)*h[i]+sl[i];
+-					b[i]        = -density*h[i]+sl[i];
++					s[i] = (1.-density)*h[i]+sl[i];
++					b[i] = -density*h[i]+sl[i];
+ 				}
+ 				else if(migration_style==SoftMigrationEnum && phi_ungrounding[vertices[i]->Pid()]<0.){
+-					s[i]        = (1-density)*h[i]+sl[i];
+-					b[i]        = -density*h[i]+sl[i];
++					s[i] = (1.-density)*h[i]+sl[i];
++					b[i] = -density*h[i]+sl[i];
+ 				}
+ 				else{
+ 					if(migration_style!=SoftMigrationEnum && migration_style!=ContactEnum && migration_style!=GroundingOnlyEnum) _error_("Error: migration should be Aggressive, Soft, Subelement, Contact or GroundingOnly");
+@@ -2313,7 +2249,7 @@
+ 	}
+ 
+ 	/*Recalculate phi*/
+-	for(i=0;i<NUM_VERTICES;i++){
++	for(int i=0;i<NUM_VERTICES;i++){
+ 		if(migration_style==SoftMigrationEnum){
+ 			bed_hydro=-density*h[i]+sl[i];
+ 			if(phi[i]<0. || bed_hydro<=r[i] || phi_ungrounding[vertices[i]->Pid()]<0.){
+@@ -2320,7 +2256,9 @@
+ 				phi[i]=h[i]+(r[i]-sl[i])/density;
+ 			}
+ 		}
+-		else if(migration_style!=ContactEnum) phi[i]=h[i]+(r[i]-sl[i])/density;
++		else if(migration_style!=ContactEnum){
++			phi[i]=h[i]+(r[i]-sl[i])/density;
++		}
+ 		else{
+ 			/*do nothing*/
+ 		}
+@@ -2331,17 +2269,7 @@
+ 	this->AddInput(SurfaceEnum,&s[0],P1Enum);
+ 	this->AddInput(BaseEnum,&b[0],P1Enum);
+ 
+-	/*Delete*/
+-	xDelete<IssmDouble>(melting);
+-	xDelete<IssmDouble>(phi);
+-	xDelete<IssmDouble>(r);
+-	xDelete<IssmDouble>(b);
+-	xDelete<IssmDouble>(s);
+-	xDelete<IssmDouble>(sl);
+-	xDelete<IssmDouble>(h);
+-
+-}
+-/*}}}*/
++}/*}}}*/
+ void       Element::MismipFloatingiceMeltingRate(){/*{{{*/
+ 
+ 	IssmDouble thresholdthickness,upperdepthmelt;
+@@ -2565,7 +2493,6 @@
+ 	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;
+@@ -2592,8 +2519,9 @@
+ 	this->parameters->FindParam(&maxbox,BasalforcingsPicoMaxboxcountEnum);
+ 	this->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
+ 	this->parameters->FindParam(&isplume, BasalforcingsPicoIsplumeEnum);
+-	Input *thickness_input    = this->GetInput(ThicknessEnum);                         _assert_(thickness_input);
+-	_assert_(basinid<=num_basins);
++	Input *thickness_input = this->GetInput(ThicknessEnum); 
++   _assert_(basinid<=num_basins);
++   _assert_(thickness_input);
+ 
+ 	IssmDouble* boxareas = NULL;
+ 	this->parameters->FindParam(&boxareas,&M,BasalforcingsPicoBoxAreaEnum);
+@@ -2602,20 +2530,20 @@
+ 	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);
++	IssmDouble basalmeltrates_shelf[MAXVERTICES];
++	IssmDouble potential_pressure_melting_point[MAXVERTICES];
++	IssmDouble Tocs[MAXVERTICES];
++	IssmDouble Socs[MAXVERTICES];
+ 
+ 	/* First box calculations */
+ 	if(boxid==0){
+ 		/* Get box1 parameters and inputs */
+ 		IssmDouble time, toc_farocean, soc_farocean;
++      IssmDouble overturnings[MAXVERTICES];
+ 		this->parameters->FindParam(&time,TimeEnum);
+ 		this->parameters->FindParam(&toc_farocean, basinid, time, BasalforcingsPicoFarOceantemperatureEnum);
+ 		this->parameters->FindParam(&soc_farocean, basinid, time, BasalforcingsPicoFarOceansalinityEnum);
+-		IssmDouble 	s1 				= soc_farocean/(nu*lambda);
+-		IssmDouble* overturnings 	= xNew<IssmDouble>(NUM_VERTICES);
++		IssmDouble s1 = soc_farocean/(nu*lambda);
+ 		Input *overturningC_input = this->GetInput(BasalforcingsPicoOverturningCoeffEnum); _assert_(overturningC_input);
+ 
+ 		/* Start looping on the number of verticies and calculate ocean vars */
+@@ -2639,10 +2567,10 @@
+ 			overturnings[i] = overturning_coeff*rho_star*(Beta*(soc_farocean-Socs[i])-alpha*(toc_farocean-Tocs[i]));
+ 		}
+ 
+-		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1DGEnum);
+-		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,Tocs,P1DGEnum);
+-		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,Socs,P1DGEnum);
+-		this->AddInput(BasalforcingsPicoSubShelfOceanOverturningEnum,overturnings,P1DGEnum);
++		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&basalmeltrates_shelf[0],P1DGEnum);
++		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,&Tocs[0],P1DGEnum);
++		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,&Socs[0],P1DGEnum);
++		this->AddInput(BasalforcingsPicoSubShelfOceanOverturningEnum,&overturnings[0],P1DGEnum);
+ 
+ 		/*Cleanup and return*/
+ 		delete gauss;
+@@ -2715,7 +2643,7 @@
+ 	x0    = 0.56;          //Dimentionless scaling factor
+ 
+ 	/*Define arrays*/
+-	IssmDouble* basalmeltrates_shelf = xNew<IssmDouble>(NUM_VERTICES); //Basal melt-rate
++	IssmDouble basalmeltrates_shelf[MAXVERTICES];
+ 
+ 	/*Polynomial coefficients*/
+ 	IssmDouble p[12];
+@@ -2788,11 +2716,10 @@
+ 	}
+ 
+ 	/*Save computed melt-rate*/
+-	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1DGEnum);
++	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&basalmeltrates_shelf[0],P1DGEnum);
+ 
+ 	/*Cleanup and return*/
+ 	delete gauss;
+-
+ }/*}}}*/
+ void       Element::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac){/*{{{*/
+ 
+@@ -4231,9 +4158,8 @@
+ 
+ 	/*Fetch number vertices and allocate memory*/
+ 	const int NUM_VERTICES  = this->GetNumberOfVertices();
++	IssmDouble maxprincipal[MAXVERTICES];
+ 
+-	IssmDouble* maxprincipal = xNew<IssmDouble>(NUM_VERTICES);
+-
+ 	/*Retrieve all inputs and parameters*/
+ 	this->GetVerticesCoordinatesBase(&xyz_list);
+ 	Input* sigma_xx_input  = this->GetInput(StressTensorxxEnum); _assert_(sigma_xx_input);
+@@ -4250,7 +4176,7 @@
+ 
+ 	/*loop over vertices: */
+ 	Gauss* gauss=this->NewGauss();
+-	for (int iv=0;iv<NUM_VERTICES;iv++){
++	for(int iv=0;iv<NUM_VERTICES;iv++){
+ 		gauss->GaussVertex(iv);
+ 
+ 		sigma_xx_input->GetInputValue(&sigma_xx,gauss);
+@@ -4295,10 +4221,9 @@
+ 	}
+ 
+ 	/*Create input*/
+-	this->AddInput(StressMaxPrincipalEnum,maxprincipal,P1Enum);
++	this->AddInput(StressMaxPrincipalEnum,&maxprincipal[0],P1Enum);
+ 
+ 	/*Clean up and return*/
+-	xDelete<IssmDouble>(maxprincipal);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ }
+@@ -4574,9 +4499,8 @@
+ 
+ 	/*Fetch number vertices and allocate memory*/
+ 	const int NUM_VERTICES = this->GetNumberOfVertices();
++	IssmDouble viscousheating[MAXVERTICES];
+ 
+-	IssmDouble* viscousheating = xNew<IssmDouble>(NUM_VERTICES);
+-
+ 	/*Retrieve all inputs and parameters*/
+ 	this->GetVerticesCoordinates(&xyz_list);
+ 	Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input);
+@@ -4594,10 +4518,9 @@
+ 	}
+ 
+ 	/*Create PentaVertex input, which will hold the basal friction:*/
+-	this->AddInput(ViscousHeatingEnum,viscousheating,P1Enum);
++	this->AddInput(ViscousHeatingEnum,&viscousheating[0],P1Enum);
+ 
+ 	/*Clean up and return*/
+-	xDelete<IssmDouble>(viscousheating);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ }
+@@ -4682,8 +4605,8 @@
+ 	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);
++	IssmDouble PIE[MAXVERTICES];
++	IssmDouble dHpmp[MAXVERTICES];
+ 
+ 	for(int iv=0; iv<numvertices; iv++){
+ 		PIE[iv]=PureIceEnthalpy(pressure[iv]);
+@@ -4719,8 +4642,6 @@
+ 	}
+ 
+ 	/*Clean up and return*/
+-	xDelete<IssmDouble>(PIE);
+-	xDelete<IssmDouble>(dHpmp);
+ 	return kappa;
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25904)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25905)
+@@ -2221,7 +2221,7 @@
+ 	 * 2. fraction of intersected triangle edges intersected by levelset, lying below level*/
+ 
+ 	/*Intermediaries*/
+-	int i, numiceverts, numnoiceverts;
++	int numiceverts, numnoiceverts;
+ 	int ind0, ind1, lastindex;
+ 	int indices_ice[NUMVERTICES],indices_noice[NUMVERTICES];
+ 	IssmDouble lsf[NUMVERTICES];
+@@ -2233,7 +2233,7 @@
+ 	/* 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<NUMVERTICES;i++){ // go backwards along vertices, and check for sign change
++	for(int i=0;i<NUMVERTICES;i++){ // go backwards along vertices, and check for sign change
+ 		ind0=(NUMVERTICES-i)%NUMVERTICES;
+ 		ind1=(ind0-1+NUMVERTICES)%NUMVERTICES;
+ 		if((lsf[ind0]-level)*(lsf[ind1]-level)<=0.){ // levelset has been crossed, find last index belonging to segment
+@@ -2247,7 +2247,7 @@
+ 
+ 	numiceverts=0;
+ 	numnoiceverts=0;
+-	for(i=0;i<NUMVERTICES;i++){
++	for(int i=0;i<NUMVERTICES;i++){
+ 		ind0=(lastindex+i)%NUMVERTICES;
+ 		if(lsf[i]<=level){
+ 			indices_ice[numiceverts]=i;
+@@ -2259,26 +2259,30 @@
+ 		}
+ 	}
+ 	//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];}
++	for(int i=0;i<numiceverts;  i++){
++		indices[i]=indices_ice[i];
++	}
++	for(int i=0;i<numnoiceverts;i++){
++		indices[numiceverts+i]=indices_noice[i];
++	}
+ 
+-	switch (numiceverts){
++	switch(numiceverts){
+ 		case 0: // no vertex has ice: element is ice free, no intersection
+-			for(i=0;i<2;i++)
++			for(int i=0;i<2;i++)
+ 				fraction[i]=0.;
+ 			break;
+ 		case 1: // one vertex has ice:
+-			for(i=0;i<2;i++){
++			for(int i=0;i<2;i++){
+ 				fraction[i]=(level-lsf[indices[0]])/(lsf[indices[numiceverts+i]]-lsf[indices[0]]);
+ 			}
+ 			break;
+ 		case 2: // two vertices have ice: fraction is computed from first ice vertex to last in CCW fashion
+-			for(i=0;i<2;i++){
++			for(int i=0;i<2;i++){
+ 				fraction[i]=(level-lsf[indices[i]])/(lsf[indices[numiceverts]]-lsf[indices[i]]);
+ 			}
+ 			break;
+ 		case NUMVERTICES: // all vertices have ice: return triangle area
+-			for(i=0;i<2;i++)
++			for(int i=0;i<2;i++)
+ 				fraction[i]=1.;
+ 			break;
+ 		default:
+@@ -3256,52 +3260,40 @@
+ IssmDouble Tria::Masscon(IssmDouble* levelset){ /*{{{*/
+ 
+ 	/*intermediary: */
+-	IssmDouble* values=NULL;
+-	Input*     thickness_input=NULL;
+ 	IssmDouble  thickness;
+-	IssmDouble  weight;
+ 	IssmDouble  Jdet;
+-	IssmDouble  volume;
+-	IssmDouble  rho_ice;
+ 	int         point1;
+ 	IssmDouble  fraction1,fraction2;
+ 	bool        mainlynegative=true;
+ 
+-	/*Output:*/
+-	volume=0;
+-
+ 	/* Get node coordinates and dof list: */
+ 	IssmDouble  xyz_list[NUMVERTICES][3];
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 
+ 	/*Retrieve inputs required:*/
+-	thickness_input=this->GetInput(ThicknessEnum); _assert_(thickness_input);
++	Input* thickness_input=this->GetInput(ThicknessEnum); _assert_(thickness_input);
+ 
+ 	/*Retrieve material parameters: */
+-	rho_ice=FindParam(MaterialsRhoIceEnum);
++	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+ 
+ 	/*Retrieve values of the levelset defining the masscon: */
+-	values = xNew<IssmDouble>(NUMVERTICES);
++	IssmDouble values[NUMVERTICES];
+ 	for(int i=0;i<NUMVERTICES;i++){
+ 		values[i]=levelset[this->vertices[i]->Sid()];
+ 	}
+ 
+ 	/*Ok, use the level set values to figure out where we put our gaussian points:*/
+-	this->GetLevelsetPositivePart(&point1,&fraction1,&fraction2,&mainlynegative,values);
++	this->GetLevelsetPositivePart(&point1,&fraction1,&fraction2,&mainlynegative,&values[0]);
+ 	Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlynegative,4);
+ 
+-	volume=0;
+-
++	IssmDouble volume=0.;
+ 	while(gauss->next()){
+-
+ 		this->JacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+ 		thickness_input->GetInputValue(&thickness, gauss);
+-
+ 		volume+=thickness*gauss->weight*Jdet;
+ 	}
+ 
+ 	/* clean up and Return: */
+-	xDelete<IssmDouble>(values);
+ 	delete gauss;
+ 	return rho_ice*volume;
+ }
Index: /issm/oecreview/Archive/25834-26739/ISSM-25905-25906.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25905-25906.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25905-25906.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/scripts/DownloadExamplesDatasets.sh
+===================================================================
+--- ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(nonexistent)
++++ ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(revision 25906)
+@@ -0,0 +1,40 @@
++#!/bin/bash
++################################################################################
++# This script downloads all datasets needed for running the ISSM tutorials.
++#
++# The default behavior is to download datasets to the examples/Data directory 
++# relative to this script. An alternate output directory can be designated by 
++# supplying a command line argument.
++#
++# NOTE:
++# - This script does not clobber existing files, intentionally. To download and 
++#	unzip new copies, first remove existing files manually.
++################################################################################
++
++## Constants
++#
++DATASETS_URL="https://issm.jpl.nasa.gov/documentation/tutorials/datasets"
++DIRECTORY_PREFIX=$(cd $(dirname "$0"); pwd)"/../examples/Data" # Default behavior is to download datasets to examples/Data directory relative to this script
++
++if [ $# -gt 0 ]; then
++	DIRECTORY_PREFIX=$1
++
++	if [ ! -d ${DIRECTORY_PREFIX} ]; then
++		echo "Error: output directory ${DIRECTORY_PREFIX} does not exist"
++		exit 1
++	fi
++fi
++
++# Get content of page that hosts datasets, reduce to just datasets list, then 
++# parse out dataset links
++dataset_urls=$(\
++	curl -Ls ${DATASETS_URL} |\
++	sed '/<!--DATASETS LIST START-->/,/<!--DATASETS LIST END-->/ !d' |\
++	sed -n 's/.*<li><a href="\([^"]*\)">.*/\1/p'
++)
++
++# Get datasets
++wget --no-clobber --directory-prefix="${DIRECTORY_PREFIX}" ${dataset_urls}
++
++# Expand zip files
++unzip -n "${DIRECTORY_PREFIX}/*.zip"
+
+Property changes on: ../trunk-jpl/scripts/DownloadExamplesDatasets.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25906-25907.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25906-25907.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25906-25907.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/clusters/lonestar.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/lonestar.m	(revision 25906)
++++ ../trunk-jpl/src/m/classes/clusters/lonestar.m	(revision 25907)
+@@ -10,7 +10,7 @@
+ 		 % {{{
+ 		 name          = 'ls5.tacc.utexas.edu'
+ 		 login         = '';
+-		 modules        = {'intel/16.0.1'};
++		 modules        = {'intel/18.0.2' 'gsl'};
+ 		 numnodes      = 1;
+ 		 cpuspernode   = 24;
+ 		 port          = 1099;
Index: /issm/oecreview/Archive/25834-26739/ISSM-25907-25908.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25907-25908.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25907-25908.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25907)
++++ ../trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh	(revision 25908)
+@@ -165,6 +165,7 @@
+ echo "Copying assets to package: ${PKG}"
+ cp -rf bin examples lib scripts test ${PKG}
+ mkdir ${PKG}/execution
++cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
+ ${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
+ echo "Cleaning up unneeded/unwanted files"
+ rm -f ${PKG}/bin/*.py # Remove all Python scripts
Index: /issm/oecreview/Archive/25834-26739/ISSM-25908-25909.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25908-25909.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25908-25909.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/scripts/DownloadExamplesDatasets.sh
+===================================================================
+--- ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(revision 25908)
++++ ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(revision 25909)
+@@ -19,7 +19,7 @@
+ if [ $# -gt 0 ]; then
+ 	DIRECTORY_PREFIX=$1
+ 
+-	if [ ! -d ${DIRECTORY_PREFIX} ]; then
++	if [ ! -d "${DIRECTORY_PREFIX}" ]; then
+ 		echo "Error: output directory ${DIRECTORY_PREFIX} does not exist"
+ 		exit 1
+ 	fi
+@@ -34,7 +34,7 @@
+ )
+ 
+ # Get datasets
+-wget --no-clobber --directory-prefix="${DIRECTORY_PREFIX}" ${dataset_urls}
++wget --no-clobber --directory-prefix="${DIRECTORY_PREFIX}" "${dataset_urls}"
+ 
+ # Expand zip files
+-unzip -n "${DIRECTORY_PREFIX}/*.zip"
++unzip -n -d "${DIRECTORY_PREFIX}" "${DIRECTORY_PREFIX}/*.zip"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25909-25910.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25909-25910.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25909-25910.diff	(revision 26740)
@@ -0,0 +1,85 @@
+Index: ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 25909)
++++ ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 25910)
+@@ -270,9 +270,6 @@
+ /*}}}*/
+ void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 
+-	int i,j;
+-	IssmDouble* localvalues=NULL;
+-
+ 	/*Check that Kff has been alocated in debugging mode*/
+ 	_assert_(Kff);
+ 
+@@ -290,9 +287,9 @@
+ 
+ 		if(this->row_fsize){
+ 			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
+-			for(i=0;i<this->row_fsize;i++){
+-				for(j=0;j<this->row_fsize;j++){
++			IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
++			for(int i=0;i<this->row_fsize;i++){
++				for(int j=0;j<this->row_fsize;j++){
+ 					localvalues[this->row_fsize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]];
+ 				}
+ 			}
+@@ -306,9 +303,9 @@
+ 
+ 		if((this->row_ssize!=0) && (this->row_fsize!=0)){
+ 			/*first, retrieve values that are in the f and s-set from the g-set values matrix: */
+-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize);
+-			for(i=0;i<this->row_fsize;i++){
+-				for(j=0;j<this->row_ssize;j++){
++			IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize);
++			for(int i=0;i<this->row_fsize;i++){
++				for(int j=0;j<this->row_ssize;j++){
+ 					localvalues[this->row_ssize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]];
+ 				}
+ 			}
+@@ -327,9 +324,6 @@
+ /*}}}*/
+ void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){/*{{{*/
+ 
+-	int i,j;
+-	IssmDouble* localvalues=NULL;
+-
+ 	/*Check that Jff is not NULL*/
+ 	_assert_(Jff); 
+ 
+@@ -341,10 +335,10 @@
+ 
+ 		if(this->row_fsize){
+ 			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+-			localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
+-			for(i=0;i<this->row_fsize;i++){
+-				for(j=0;j<this->row_fsize;j++){
+-					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
++			IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
++			for(int i=0;i<this->row_fsize;i++){
++				for(int j=0;j<this->row_fsize;j++){
++					localvalues[this->row_fsize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]];
+ 				}
+ 			}
+ 			/*add local values into global  matrix, using the fglobaldoflist: */
+Index: ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 25909)
++++ ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 25910)
+@@ -237,13 +237,10 @@
+ /*}}}*/
+ void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/
+ 
+-	int i;
+-	IssmDouble* localvalues=NULL;
+-
+ 	if(this->fsize){
+ 		/*first, retrieve values that are in the f-set from the g-set values vector: */
+-		localvalues=xNew<IssmDouble>(this->fsize);
+-		for(i=0;i<this->fsize;i++){
++		IssmDouble* localvalues=xNew<IssmDouble>(this->fsize);
++		for(int i=0;i<this->fsize;i++){
+ 			localvalues[i]=this->values[this->flocaldoflist[i]];
+ 		}
+ 		/*add local values into global  vector, using the fglobaldoflist: */
Index: /issm/oecreview/Archive/25834-26739/ISSM-25910-25911.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25910-25911.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25910-25911.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/c/classes/Materials/Matestar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 25910)
++++ ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 25911)
+@@ -27,7 +27,6 @@
+ 		int      mid;
+ 		Hook    *helement;
+ 		Element *element;
+-		int      rheology_law;
+ 
+ 	public:
+ 		/*Matestar constructors, destructors: {{{*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 25910)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 25911)
+@@ -291,12 +291,12 @@
+ 	return n;
+ }
+ /*}}}*/
+-bool Matice::IsDamage(){/*{{{*/
++bool       Matice::IsDamage(){/*{{{*/
+ 
+ 	return this->isdamaged;
+ }
+ /*}}}*/
+-bool Matice::IsEnhanced(){/*{{{*/
++bool       Matice::IsEnhanced(){/*{{{*/
+ 
+ 	return this->isenhanced;
+ }
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 25910)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 25911)
+@@ -27,7 +27,6 @@
+ 		int      mid;
+ 		bool     isdamaged;
+ 		bool     isenhanced;
+-		int      rheology_law;
+ 		Hook    *helement;
+ 		Element *element;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25911-25912.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25911-25912.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25911-25912.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 25911)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 25912)
+@@ -49,7 +49,10 @@
+ 	Matlitho* matlitho=NULL;
+ 	for (Object* & object: femmodel->materials->objects){
+ 		Material* material=xDynamicCast<Material*>(object);
+-		if (material->ObjectEnum()==MatlithoEnum)matlitho=xDynamicCast<Matlitho*>(material);
++		if(material->ObjectEnum()==MatlithoEnum){
++			matlitho=xDynamicCast<Matlitho*>(material);
++			break;
++		}
+ 	}
+ 	_assert_(matlitho);
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25912-25913.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25912-25913.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25912-25913.diff	(revision 26740)
@@ -0,0 +1,503 @@
+Index: ../trunk-jpl/etc/environment.csh
+===================================================================
+--- ../trunk-jpl/etc/environment.csh	(revision 25912)
++++ ../trunk-jpl/etc/environment.csh	(revision 25913)
+@@ -1,117 +1,245 @@
+-#ISSM_DIR 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).
++#
++# TODO:
++# - Condition all path modifications on existence of external package 'install'
++#	directory
++#
+ 
+-#Load ISSM scripts
+-setenv PATH {$PATH}:{$ISSM_DIR}/scripts
++# Silence `<command>: no match`
++set nonomatch=1
+ 
++setenv PATH "{$PATH}:{$ISSM_DIR}/aux-config"
++setenv PATH "{$PATH}:{$ISSM_DIR}/scripts"
++
+ set ISSM_EXT_DIR="{$ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
+ 
+-#MPI
+-set MPI_DIR="{$ISSM_EXT_DIR}/mpich/install"
+-if (-d $MPI_DIR) then
+-	setenv MPI_DIR {$MPI_DIR}
+-	setenv PATH {$MPI_DIR}/bin:{$PATH}
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$MPI_DIR/lib
+-	setenv MANPATH {$MANPATH}:$MPI_DIR/man
++#########################
++# Command-line utilities
++#########################
++set SSH_ROOT="{$ISSM_EXT_DIR}/ssh"
++if ( -d {$SSH_ROOT} ) then
++	setenv PATH "{$PATH}:{$SSH_ROOT}"
+ endif
+ 
+-#PETSC
+-set PETSC_DIR="{$ISSM_EXT_DIR}/petsc/install"
+-if (-d $PETSC_DIR) then
+-	setenv PETSC_DIR {$PETSC_DIR}
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$PETSC_DIR/lib
++#############################
++# Build systems
++#############################
++set AUTOTOOLS_ROOT="{$ISSM_EXT_DIR}/autotools/install"
++setenv PATH "{$AUTOTOOLS_ROOT}/bin:{$PATH}"
++
++set CMAKE_ROOT="{$ISSM_EXT_DIR}/cmake/install"
++setenv PATH "{$CMAKE_ROOT}/bin:{$PATH}"
++
++#############################
++# Libraries / binaries
++#############################
++set MPI_ROOT="{$ISSM_EXT_DIR}/mpich/install"
++if ( -d {$MPI_ROOT} ) then
++	setenv MPI_DIR {$MPI_ROOT}
++	setenv MPI_HOME {$MPI_ROOT} # Used in installation of Dakota
++	setenv MPI_INC_DIR {$MPI_ROOT}/include
++	setenv PATH "{$MPI_ROOT}/bin:{$PATH}"
++	setenv CPATH "{$MPI_ROOT}/include:{$CPATH}"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib"
+ endif
+ 
+-set SCOTCH_DIR="{$ISSM_EXT_DIR}/scotch/install"
+-if (-d $SCOTCH_DIR) then
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SCOTCH_DIR/lib
++# NOTE: Check *must* come before PETSc as we prefer packages installed via 
++# 		PETSc
++#
++set ZLIB_ROOT="{$ISSM_EXT_DIR}/zlib/install"
++if ( -d {$ZLIB_ROOT} ) then
++	setenv ZLIB_ROOT {$ZLIB_ROOT} # Used in installation of NetCDF, GDAL, GMT
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$LD_LIBRARY_PATH}/lib"
+ endif
+ 
+-#SLEPC
+-set SLEPC_DIR="{$ISSM_EXT_DIR}/slepc/install"
+-if (-d $SLEPC_DIR) then
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$SLEPC_DIR/lib
++set PETSC_ROOT="{$ISSM_EXT_DIR}/petsc/install"
++if ( -d {$PETSC_ROOT} ) then
++	setenv PETSC_ROOT {$PETSC_ROOT}
++	setenv LD_LIBRARY_PATH "{$PETSC_ROOT}/lib:{$LD_LIBRARY_PATH}"
++
++	# In case we have installed certain external packages via PETSc
++	#
++
++	# BLAS
++	if ( `find {$PETSC_ROOT}/lib -name libblas.*` != "" || `find {$PETSC_ROOT}/lib -name libfblas.*` != "" ) then
++		setenv BLAS_ROOT "{$PETSC_ROOT}" # Used in installation of Dakota, GMT
++	endif
++
++	# HDF5
++	if ( `find {$PETSC_ROOT}/lib -name libhdf5.*` != "" ) then
++		setenv HDF5_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
++		setenv CPATH "{$CPATH}:{$PETSC_ROOT}/include"
++		setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$PETSC_ROOT}/lib"
++		setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$PETSC_ROOT}/lib"
++		setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib"
++	endif
++
++	# LAPACK
++	if ( `find {$PETSC_ROOT}/lib -name liblapack.*` != "" || `find {$PETSC_ROOT}/lib -name libflapack.*` != "" ) then
++		setenv LAPACK_ROOT "{$PETSC_ROOT}" # Used in installation of Dakota, GMT
++	endif
++
++	# METIS
++	if ( `find {$PETSC_ROOT}/lib -name libmetis.*` != "" ) then
++		setenv METIS_ROOT "{$PETSC_ROOT}" # Used in installation of Gmsh
++	endif
++
++	# MPICH
++	if ( -f "{$PETSC_ROOT}/bin/mpiexec" ) then
++		set MPI_ROOT={$PETSC_ROOT}
++		setenv MPI_DIR {$MPI_ROOT}
++		setenv MPI_HOME {$MPI_ROOT} # Used in installation of Dakota
++		setenv MPI_INC_DIR "{$MPI_ROOT}/include"
++		setenv PATH "{$MPI_ROOT}/bin:{$PATH}"
++		setenv CPATH "{$MPI_ROOT}/include:{$CPATH}"
++		setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib"
++	endif
++
++	# ZLIB
++	if ( `find {$PETSC_ROOT}/lib -name libz.*` != "" ) then
++		setenv ZLIB_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
++		setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib"
++	endif
+ endif
+ 
+-#PETSC
+-set TAO_DIR="{$ISSM_EXT_DIR}/tao/install"
+-if (-d $TAO_DIR) then
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$TAO_DIR/lib
++set SCOTCH_ROOT="{$ISSM_EXT_DIR}/scotch/install"
++if ( -d "{$SCOTCH_ROOT}" ) then
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$SCOTCH_ROOT}/lib"
+ endif
+ 
+-#Dakota
+-set DAKOTA_DIR="{$ISSM_EXT_DIR}/dakota/install"
+-if (-d $DAKOTA_DIR) then
+-	setenv PATH {$DAKOTA_DIR}/bin:{$PATH}
+-	setenv MANPATH {$MANPATH}:{$MPI_DIR}/man:{$DAKOTA_DIR}/docs/man:{$DAKOTA_DIR}/docs/man-ref
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$DAKOTA_DIR/lib
++set SLEPC_ROOT="{$ISSM_EXT_DIR}/slepc/install"
++if ( -d "{$SLEPC_ROOT}" ) then
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$SLEPC_ROOT}/lib"
+ endif
+ 
+-#Boost
+-set BOOST_DIR="{$ISSM_EXT_DIR}/boost/install"
+-set BOOSTROOT="{$ISSM_EXT_DIR}/boost/install"
+-if (-d $BOOST_DIR) then
+-   setenv PATH {$BOOST_DIR}/bin:{$PATH}
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:$BOOST_DIR/lib
++set TAO_ROOT="{$ISSM_EXT_DIR}/tao/install"
++if ( -d "{$TAO_ROOT}" ) then
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$TAO_ROOT}/lib"
+ endif
+ 
+-#Doxygen
+-set DOXYGEN_DIR="{$ISSM_EXT_DIR}/doxygen/install"
+-if (-d $DOXYGEN_DIR) then
+-	setenv MANPATH {$MANPATH}:{$DOXYGEN_DIR}/man
+-	setenv PATH {$PATH}:{$DOXYGEN_DIR}/bin
++set DAKOTA_ROOT="{$ISSM_EXT_DIR}/dakota/install"
++if ( -d "{$DAKOTA_ROOT}" ) then
++	setenv PATH "{$PATH}:{$DAKOTA_ROOT}/bin"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$DAKOTA_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH "{$DAKOTA_ROOT}/lib:{$DYLD_LIBRARY_PATH}"
+ endif
+ 
+-#AUTOTOOLS
+-set AUTOTOOLS_DIR="{$ISSM_EXT_DIR}/autotools/install"
+-if (-d $AUTOTOOLS_DIR) then
+-	setenv PATH {$AUTOTOOLS_DIR}/bin:{$PATH}
++set MERCURIAL_ROOT="{$ISSM_EXT_DIR}/mercurial/install"
++if ( -d {$MERCURIAL_ROOT} ) then
++	setenv PYTHONPATH "{$PYTHONPATH}:{$MERCURIAL_ROOT}/mercurial/pure"
++	setenv PATH "{$PATH}:{$MERCURIAL_ROOT}"
+ endif
+ 
+-#SSH
+-set SSH_DIR="{$ISSM_EXT_DIR}/ssh"
+-if (-d $SSH_DIR) then
+-	setenv PATH {$PATH}:{$SSH_DIR}
++set BOOST_ROOT="{$ISSM_EXT_DIR}/boost/install"
++if ( -d {$BOOST_ROOT} ) then
++	setenv BOOST_ROOT {$BOOST_ROOT} # Used in installation of Dakota
++	setenv BOOST_DIR {$BOOST_ROOT}
++	setenv BOOSTROOT {$BOOST_ROOT}
++	setenv LIBRARY_PATH "{$BOOST_ROOT}/lib:{$LIBRARY_PATH}"
++	setenv LD_LIBRARY_PATH "{$BOOST_ROOT}/lib:{$LD_LIBRARY_PATH}"
++	setenv DYLD_LIBRARY_PATH "{$BOOST_ROOT}/lib:{$DYLD_LIBRARY_PATH}"
++	setenv PATH "{$BOOST_ROOT}/bin:{$PATH}"
+ endif
+ 
+-#VALGRIND
+-set VALGRIND_DIR="{$ISSM_EXT_DIR}/valgrind/install/bin"
+-if (-d $VALGRIND_DIR) then
+-	setenv PATH {$PATH}:{$VALGRIND_DIR}
++set GSL_ROOT="{$ISSM_EXT_DIR}/gsl/install"
++if ( -d {$GSL_ROOT} ) then
++	setenv GSL_HOME "{$GSL_ROOT}" # Used in installation of Dakota
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GSL_ROOT}/lib"
+ endif
+ 
+-#MERCURIAL
+-set MERCURIAL_DIR="{$ISSM_EXT_DIR}/mercurial/install"
+-if (-d $MERCURIAL_DIR) then
+-	setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/
+-	setenv PATH {$PATH}:{$MERCURIAL_DIR}
++set NETCDF_ROOT="{$ISSM_EXT_DIR}/netcdf/install"
++if ( -d "{$NETCDF_ROOT}" ) then
++	setenv NETCDF_ROOT "{$NETCDF_ROOT}" # Used in installation of GDAL, GMT
++	setenv PATH "{$PATH}:{$NETCDF_ROOT}/bin"
++	setenv CPATH "{$CPATH}:{$NETCDF_ROOT}/include"
++	setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$NETCDF_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib"
+ endif
+ 
+-#GSL
+-set GSL_DIR="{$ISSM_EXT_DIR}/gsl/install"
+-if (-d $GSL_DIR) then
+-	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib
++set CURL_ROOT="{$ISSM_EXT_DIR}/curl/install"
++if ( -d "{$CURL_ROOT}" ) then
++	setenv CURL_ROOT "{$CURL_ROOT}" # Used in installation of NetCDF, GDAL, GMT
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$CURL_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$CURL_ROOT}/lib"
++	setenv PATH "{$PATH}:{$CURL_ROOT}/bin"
+ endif
+ 
+-#CMAKE
+-set CMAKE_DIR="{$ISSM_EXT_DIR}/cmake/install"
+-if (-d $CMAKE_DIR) then
+-	setenv PATH {$CMAKE_DIR}/bin:{$PATH}
++set HDF5_ROOT="{$ISSM_EXT_DIR}/hdf5/install"
++if ( -d "{$HDF5_ROOT}" ) then
++	setenv HDF5_ROOT "{$HDF5_ROOT}" # Used in installation of NetCDF, GDAL
++	setenv CPATH "{$CPATH}:{$HDF5_ROOT}/include"
++	setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$HDF5_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$HDF5_ROOT}/lib"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$HDF5_ROOT}/lib"
+ endif
+ 
+-#YAMS
+-set YAMS_DIR="{$ISSM_EXT_DIR}/yams/install"
+-if (-d $YAMS_DIR) then
+-	setenv PATH {$PATH}:{$YAMS_DIR}/bin
++set SQLITE_ROOT="{$ISSM_EXT_DIR}/sqlite/install"
++if ( -d "{$SQLITE_ROOT}" ) then
++	setenv PATH "{$PATH}:{$SQLITE_ROOT}/bin"
++	setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$SQLITE_ROOT}/lib"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$SQLITE_ROOT}/lib"
+ endif
+ 
+-#SHELL2JUNIT
+-set SHELL2JUNIT_DIR="{$ISSM_EXT_DIR}/shell2junit"
+-if (-d $SHELL2JUNIT_DIR) then
+-	setenv PATH {$SHELL2JUNIT_DIR}/install:{$PATH}
++set PROJ_ROOT="{$ISSM_EXT_DIR}/proj/install"
++if ( -d "{$PROJ_ROOT}" ) then
++	setenv PROJ_ROOT "${PROJ_ROOT}" # Used in installation of GDAL
++	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$PROJ_ROOT}/lib"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$PROJ_ROOT}/lib"
+ endif
+ 
+-#GMT
+-set GMT_DIR="{$ISSM_EXT_DIR}/gmt"
+-if (-d $GMT_DIR) then
+-	setenv PATH {$GMT_DIR}/install/bin/:{$PATH}
++set GDAL_ROOT="{$ISSM_EXT_DIR}/gdal/install"
++if ( -d "{$GDAL_ROOT}" ) then
++	setenv GDAL_ROOT "{$GDAL_ROOT}" # Used in installation of GMT
++	setenv PATH "{$GDAL_ROOT}/bin:{$PATH}"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GDAL_ROOT}/lib"
+ endif
++
++set GSHHG_ROOT="{$ISSM_EXT_DIR}/gshhg/install"
++if ( -d "{$GSHHG_ROOT}" ) then
++	setenv GSHHG_ROOT "{$GSHHG_ROOT}" # Used in installation of GMT
++endif
++
++set GMT_ROOT="{$ISSM_EXT_DIR}/gmt/install"
++if ( -d "{$GMT_ROOT}" ) then
++	setenv PATH "{$GMT_ROOT}/bin:{$PATH}"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GMT_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$GMT_ROOT}/lib"
++endif
++
++set GMSH_ROOT="{$ISSM_EXT_DIR}/gmsh/install"
++if ( -d "{$GMSH_ROOT}" ) then
++	setenv PATH "{$GMSH_ROOT}/bin:{$PATH}"
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GMSH_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$GMSH_ROOT}/lib"
++endif
++
++set TRIANGLE_ROOT="{$ISSM_EXT_DIR}/triangle/install"
++if ( -d "{$TRIANGLE_ROOT}" ) then
++	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib"
++endif
++
++set YAMS_ROOT="{$ISSM_EXT_DIR}/yams/install"
++if ( -d {$YAMS_ROOT} ) then
++	setenv PATH "{$PATH}:{$YAMS_ROOT}"
++endif
++
++set VALGRIND_ROOT="{$ISSM_EXT_DIR}/valgrind/install"
++if ( -d {$VALGRIND_ROOT} ) then
++	setenv PATH "{$VALGRIND_ROOT}/bin:{$PATH}"
++endif
++
++set DOXYGEN_ROOT="{$ISSM_EXT_DIR}/doxygen/install"
++if ( -d {$DOXYGEN_ROOT} ) then
++	setenv PATH "{$DOXYGEN_ROOT}/bin:{$PATH}"
++endif
++
++set SHELL2JUNIT_ROOT="{$ISSM_EXT_DIR}/shell2junit/install"
++if ( -d {$SHELL2JUNIT_ROOT} ) then
++	setenv PATH "{$PATH}:{$SHELL2JUNIT_ROOT}/install"
++endif
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 25912)
++++ ../trunk-jpl/etc/environment.sh	(revision 25913)
+@@ -9,7 +9,7 @@
+ #	directory
+ #
+ 
+-# Silence no `zsh: no matches found: <file>`
++# Silence `zsh: no matches found: <file>`
+ setopt +o nomatch 1> /dev/null 2>&1
+ 
+ ## Functions
+@@ -16,7 +16,7 @@
+ #
+ c_include_path_append(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $C_INCLUDE_PATH ]; then
++		if [ -z "${C_INCLUDE_PATH}" ]; then
+ 			export C_INCLUDE_PATH="${1}"
+ 		elif [[ ":${C_INCLUDE_PATH}:" != *":${1}:"* ]]; then
+ 			export C_INCLUDE_PATH="${C_INCLUDE_PATH}:${1}"
+@@ -25,7 +25,7 @@
+ } #}}}
+ c_include_path_prepend(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $C_INCLUDE_PATH ]; then
++		if [ -z "${C_INCLUDE_PATH}" ]; then
+ 			export C_INCLUDE_PATH="${1}"
+ 		elif [[ ":${C_INCLUDE_PATH}:" != *":${1}:"* ]]; then
+ 			export C_INCLUDE_PATH="${1}:${C_INCLUDE_PATH}"
+@@ -35,7 +35,7 @@
+ 
+ cpath_append(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $CPATH ]; then
++		if [ -z "${CPATH}" ]; then
+ 			export CPATH="${1}"
+ 		elif [[ ":${CPATH}:" != *":${1}:"* ]]; then
+ 			export CPATH="${CPATH}:${1}"
+@@ -44,7 +44,7 @@
+ } #}}}
+ cpath_prepend(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $CPATH ]; then
++		if [ -z "${CPATH}" ]; then
+ 			export CPATH="${1}"
+ 		elif [[ ":${CPATH}:" != *":${1}:"* ]]; then
+ 			export CPATH="${1}:${CPATH}"
+@@ -54,7 +54,7 @@
+ 
+ cplus_include_path_append(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $CPLUS_INCLUDE_PATH ]; then
++		if [ -z "${CPLUS_INCLUDE_PATH}" ]; then
+ 			export CPLUS_INCLUDE_PATH="${1}"
+ 		elif [[ ":${CPLUS_INCLUDE_PATH}:" != *":${1}:"* ]]; then
+ 			export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${1}"
+@@ -63,7 +63,7 @@
+ } #}}}
+ cplus_include_path_prepend(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $CPLUS_INCLUDE_PATH ]; then
++		if [ -z "${CPLUS_INCLUDE_PATH}" ]; then
+ 			export CPLUS_INCLUDE_PATH="${1}"
+ 		elif [[ ":${CPLUS_INCLUDE_PATH}:" != *":${1}:"* ]]; then
+ 			export CPLUS_INCLUDE_PATH="${1}:${CPLUS_INCLUDE_PATH}"
+@@ -73,12 +73,12 @@
+ 
+ dyld_library_path_append(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $DYLD_LIBRARY_PATH ]; then
++		if [ -z "${DYLD_LIBRARY_PATH}" ]; then
+ 			export DYLD_LIBRARY_PATH="${1}"
+ 		elif [[ ":${DYLD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
+ 			export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${1}"
+ 		fi
+-		if [ -z $LD_RUN_PATH ]; then
++		if [ -z "${LD_RUN_PATH}" ]; then
+ 			export LD_RUN_PATH=$1
+ 		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
+ 			export LD_RUN_PATH="${LD_RUN_PATH}:${1}"
+@@ -87,12 +87,12 @@
+ } #}}}
+ dyld_library_path_prepend(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $DYLD_LIBRARY_PATH ]; then
++		if [ -z "${DYLD_LIBRARY_PATH}" ]; then
+ 			export DYLD_LIBRARY_PATH="${1}"
+ 		elif [[ ":${DYLD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
+ 			export DYLD_LIBRARY_PATH="${1}:${DYLD_LIBRARY_PATH}"
+ 		fi
+-		if [ -z $LD_RUN_PATH ]; then
++		if [ -z "${LD_RUN_PATH}" ]; then
+ 			export LD_RUN_PATH="${1}"
+ 		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
+ 			export LD_RUN_PATH="${1}:${LD_RUN_PATH}"
+@@ -102,12 +102,12 @@
+ 
+ ld_library_path_append(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $LD_LIBRARY_PATH ]; then
++		if [ -z "${LD_LIBRARY_PATH}" ]; then
+ 			export LD_LIBRARY_PATH="${1}"
+ 		elif [[ ":${LD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
+ 			export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${1}"
+ 		fi
+-		if [ -z $LD_RUN_PATH ]; then
++		if [ -z "${LD_RUN_PATH}" ]; then
+ 			export LD_RUN_PATH="${1}"
+ 		elif [[ ":${LD_RUN_PATH}:" != *":$1:"* ]]; then
+ 			export LD_RUN_PATH="${LD_RUN_PATH}:${1}"
+@@ -116,12 +116,12 @@
+ } #}}}
+ ld_library_path_prepend(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $LD_LIBRARY_PATH ]; then
++		if [ -z "${LD_LIBRARY_PATH}" ]; then
+ 			export LD_LIBRARY_PATH="${1}"
+ 		elif [[ ":${LD_LIBRARY_PATH}:" != *":${1}:"* ]]; then
+ 			export LD_LIBRARY_PATH="${1}:${LD_LIBRARY_PATH}"
+ 		fi
+-		if [ -z $LD_RUN_PATH ]; then
++		if [ -z "${LD_RUN_PATH}" ]; then
+ 			export LD_RUN_PATH="${1}"
+ 		elif [[ ":${LD_RUN_PATH}:" != *":${1}:"* ]]; then
+ 			export LD_RUN_PATH="${1}:${LD_RUN_PATH}"
+@@ -131,7 +131,7 @@
+ 
+ library_path_append(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $LIBRARY_PATH ]; then
++		if [ -z "${LIBRARY_PATH}" ]; then
+ 			export LIBRARY_PATH="${1}"
+ 		elif [[ ":${LIBRARY_PATH}:" != *":$1:"* ]]; then
+ 			export LIBRARY_PATH="${LIBRARY_PATH}:${1}"
+@@ -140,7 +140,7 @@
+ } #}}}
+ library_path_prepend(){ #{{{
+ 	if [ -d "${1}" ]; then
+-		if [ -z $LIBRARY_PATH ]; then
++		if [ -z "${LIBRARY_PATH}" ]; then
+ 			export LIBRARY_PATH="${1}"
+ 		elif [[ ":${LIBRARY_PATH}:" != *":$1:"* ]]; then
+ 			export LIBRARY_PATH="${1}:${LIBRARY_PATH}"
+@@ -172,7 +172,7 @@
+ 	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
+ fi
+ 
+-# ISSM scripts
++path_append "${ISSM_DIR}/aux-config"
+ path_append "${ISSM_DIR}/scripts"
+ 
+ ISSM_EXT_DIR="${ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
+@@ -181,7 +181,9 @@
+ # Command-line utilities
+ #########################
+ SSH_ROOT="${ISSM_EXT_DIR}/ssh"
+-path_append "${SSH_ROOT}"
++if [ -d "${SSH_ROOT}" ]; then
++	path_append "${SSH_ROOT}"
++fi
+ 
+ SVN_ROOT="${ISSM_EXT_DIR}/svn/install"
+ if [ -d "${SVN_ROOT}" ]; then
+@@ -551,5 +553,5 @@
+ DOXYGEN_ROOT="${ISSM_EXT_DIR}/doxygen/install"
+ path_prepend "${DOXYGEN_ROOT}/bin"
+ 
+-path_append "${ISSM_DIR}/aux-config"
+-path_append "${ISSM_EXT_DIR}/shell2junit/install"
++SHELL2JUNIT_ROOT="${ISSM_EXT_DIR}/shell2junit/install"
++path_append "${SHELL2JUNIT_ROOT}"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25913-25914.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25913-25914.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25913-25914.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/m/classes/SMBgemb.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 25913)
++++ ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 25914)
+@@ -347,11 +347,9 @@
+ 			fielddisplay(self,'Tini','Initial snow temperature when restart [K]');
+ 			fielddisplay(self,'Sizeini','Initial number of layers when restart [-]');
+ 
+-
+ 			%additional albedo parameters:
++			fielddisplay(self,'aValue','Albedo forcing at every element.');
+ 			switch self.aIdx
+-				case {0 5}
+-					fielddisplay(self,'aValue','Albedo forcing at every element.  Used only if aIdx == {0,5}.');
+ 				case {1 2}
+ 					fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
+ 					fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
+Index: ../trunk-jpl/src/m/classes/SMBgemb.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 25913)
++++ ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 25914)
+@@ -191,13 +191,10 @@
+         string = "%s\n%s" % (string, fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [-]'))
+ 
+         #additional albedo parameters:
++        string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element.'))
+         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:
Index: /issm/oecreview/Archive/25834-26739/ISSM-25914-25915.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25914-25915.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25914-25915.diff	(revision 26740)
@@ -0,0 +1,4355 @@
+Index: ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par	(revision 25914)
++++ ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par	(nonexistent)
+@@ -1,52 +0,0 @@
+-%Parameterization for ISMIP A experiment
+-
+-%Set the Simulation generic name #md.miscellaneous
+-%->
+-
+-%Geometry
+-disp('   Constructing Geometry');
+-
+-%Define the geometry of the simulation #md.geometry
+-%surface is [-x*tan(0.5*pi/180)] #md.mesh
+-%->
+-md.geometry.surface=-md.mesh.x*tan(0.5*pi/180.);
+-%base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]
+-%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
+-%->
+-L=max(md.mesh.x)-min(md.mesh.x);
+-md.geometry.base=md.geometry.surface-1000.0+500.0*sin(md.mesh.x*2.0*pi/L).*sin(md.mesh.y*2.0*pi/L);
+-%thickness is the difference between surface and base #md.geometry
+-%->
+-md.geometry.thickness=md.geometry.surface-md.geometry.base;
+-%plot the geometry to check it out
+-%->
+-plotmodel(md,'data',md.geometry.thickness);
+-
+-disp('   Defining friction parameters');
+-
+-%These parameters will not be used but need to be fixed #md.friction
+-%one friciton coefficient per node (md.mesh.numberofvertices,1)
+-%->
+-md.friction.coefficient=200.0*ones(md.mesh.numberofvertices,1);
+-%one friciton exponent (p,q) per element
+-%->
+-md.friction.p=ones(md.mesh.numberofelements,1);
+-%->
+-md.friction.q=ones(md.mesh.numberofelements,1);
+-
+-disp('   Construct ice rheological properties');
+-
+-%The rheology parameters sit in the material section #md.materials
+-%B has one value per vertex
+-%->
+-md.materials.rheology_B=6.8067e7*ones(md.mesh.numberofvertices,1);
+-%n has one value per element
+-%->
+-md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-
+-disp('   Set boundary conditions');
+-
+-%Set the default boundary conditions for an ice-sheet 
+-% #help SetIceSheetBC
+-%->
+-md=SetIceSheetBC(md);
+Index: ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par	(revision 25914)
++++ ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par	(nonexistent)
+@@ -1,66 +0,0 @@
+-%Parameterization for ISMIP F experiment
+-
+-%Set the Simulation generic name #md.miscellaneous
+-%->
+-
+-%Geometry
+-disp('   Constructing Geometry');
+-
+-%Define the geometry of the simulation #md.geometry
+-%surface is [-x*tan(3.0*pi/180)] #md.mesh
+-%->
+-md.geometry.surface=md.mesh.x*tan(3.0*pi/180.0);
+-%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]
+-%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
+-%->
+-L=max(md.mesh.x)-min(md.mesh.x);
+-%->
+-md.geometry.base=md.geometry.surface-1000.0+100.0*exp(-((md.mesh.x-L/2.0).^2.0+(md.mesh.y-L/2.0).^2.0)/(10000.^2.0));
+-%thickness is the difference between surface and base #md.geometry
+-%->
+-md.geometry.thickness=md.geometry.surface-md.geometry.base;
+-%plot the geometry to check it out
+-%->
+-plotmodel(md,'data',md.geometry.thickness);
+-
+-disp('   Defining friction parameters');
+-
+-%These parameters will not be used but need to be fixed #md.friction
+-%one friciton coefficient per node (md.mesh.numberofvertices,1)
+-%conversion form year to seconds with #md.constants.yts
+-%->
+-md.friction.coefficient=sqrt(md.constants.yts/(1000*2.140373*10^-7))*ones(md.mesh.numberofvertices,1);
+-%one friciton exponent (p,q) per element
+-%->
+-md.friction.p=ones(md.mesh.numberofelements,1);
+-%->
+-md.friction.q=zeros(md.mesh.numberofelements,1);
+-
+-disp('   Construct ice rheological properties');
+-
+-%The rheology parameters sit in the material section #md.materials
+-%B has one value per vertex
+-%->
+-md.materials.rheology_B=(1/(2.140373*10^-7/md.constants.yts))*ones(md.mesh.numberofvertices,1);
+-%n has one value per element
+-%->
+-md.materials.rheology_n=1*ones(md.mesh.numberofelements,1);
+-
+-disp('   Set boundary conditions');
+-
+-%Set the default boundary conditions for an ice-sheet 
+-% #help SetIceSheetBC
+-%->
+-md=SetIceSheetBC(md);
+-
+-disp('   Initializing velocity and pressure');
+-
+-%initialize the velocity and pressurefields of #md.initialization
+-%->
+-md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+-%->
+-md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+-%->
+-md.initialization.vz=zeros(md.mesh.numberofvertices,1);
+-%->
+-md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/examples/ISMIP/CheatyRunme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyRunme.m	(revision 25914)
++++ ../trunk-jpl/examples/ISMIP/CheatyRunme.m	(nonexistent)
+@@ -1,221 +0,0 @@
+-%wich steps to perform steps are from 1 to 8 
+-%step 7 is specific to ISMIPA
+-%step 8 is specific to ISMIPF
+-
+-steps=[1];
+-
+-% parameter file to be used, choose between CheatyIsmipA.par or CheatyIsmipF.par
+-ParamFile='CheatyIsmipF.par'
+-
+-%Run Steps
+-
+-%Mesh Generation #1
+-if any(steps==1)
+-
+-	%initialize md as a new model #help model
+-	%->
+-	md=model();
+-	% generate a squaremesh #help squaremesh
+-	% Side is 80 km long with 20 points
+-	%->
+-	if(ParamFile=='CheatyIsmipA.par'),
+-		md=squaremesh(md,80000,80000,20,20);
+-	elseif(ParamFile=='CheatyIsmipF.par'),
+-		md=squaremesh(md,100000,100000,30,30);
+-  end
+-	% plot the given mesh #plotdoc
+-	%->
+-	plotmodel(md,'data','mesh')
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.Mesh_generation md;
+-end
+-
+-%Masks #2
+-if any(steps==2)
+-
+-	% load the preceding step #help loadmodel
+-	% path is given by the organizer with the name of the given step
+-	%->
+-	md = loadmodel('./Models/ISMIP.Mesh_generation');
+-	% set the mask #help setmask
+-	% all MISMIP nodes are grounded
+-	%->
+-	md=setmask(md,'','');
+-	% plot the given mask #md.mask to locate the field
+-	%->
+-	plotmodel(md,'data',md.mask.ocean_levelset);
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.SetMask md;
+-end
+-
+-%Parameterization #3
+-if any(steps==3)
+-
+-	% load the preceding step #help loadmodel
+-	% path is given by the organizer with the name of the given step
+-	%->
+-	md = loadmodel('./Models/ISMIP.SetMask');
+-	% parametrize the model # help parameterize
+-	% you will need to fil-up the parameter file defined by the
+-	% ParamFile variable
+-	%->
+-	md=parameterize(md,ParamFile);
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.Parameterization md;
+-end
+-
+-%Extrusion #4
+-if any(steps==4)
+-	
+-	% load the preceding step #help loadmodel
+-	% path is given by the organizer with the name of the given step
+-	%->
+-	md = loadmodel('./Models/ISMIP.Parameterization');
+-	% vertically extrude the preceding mesh #help extrude
+-	% only 5 layers exponent 1
+-	%->
+-	md=extrude(md,9,1);
+-	% plot the 3D geometry #plotdoc
+-	%->
+-	plotmodel(md,'data',md.geometry.base)
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.Extrusion md;
+-end
+-
+-%Set the flow computing method #5
+-if any(steps==5)
+-
+-	% load the preceding step #help loadmodel
+-	% path is given by the organizer with the name of the given step
+-	%->
+-	md = loadmodel('./Models/ISMIP.Extrusion');
+-	% set the approximation for the flow computation #help setflowequation
+-	% We will be using the Higher Order Model (HO)
+-	%->
+-	md=setflowequation(md,'HO','all');
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.SetFlow md;
+-end
+-
+-%Set Boundary Conditions #6
+-if any(steps==6)
+-
+-	% load the preceding step #help loadmodel
+-	% path is given by the organizer with the name of the given step
+-	%->
+-	md = loadmodel('./Models/ISMIP.SetFlow');
+-	% dirichlet boundary condition are known as SPCs
+-	% ice frozen to the base, no velocity	#md.stressbalance
+-	% SPCs are initialized at NaN one value per vertex
+-	%->
+-	md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+-	%->
+-	md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+-	%->
+-	md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+-	% extract the nodenumbers at the base #md.mesh.vertexonbase
+-	%->
+-	basalnodes=find(md.mesh.vertexonbase);
+-	% set the sliding to zero on the bed
+-	%->
+-	md.stressbalance.spcvx(basalnodes)=0.0;
+-	%->
+-	md.stressbalance.spcvy(basalnodes)=0.0;
+-	% periodic boundaries have to be fixed on the sides
+-	% create tabs with the side of the domain
+-	% for x
+-	% create maxX #help find
+-	%->
+-	maxX=find(md.mesh.x==max(md.mesh.x));
+-	% create minX
+-	%->
+-	minX=find(md.mesh.x==min(md.mesh.x));
+-	% for y, max X and minX should be excluded
+-	% create maxY
+-	%->
+-	maxY=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));
+-	% create minY
+-	%->
+-	minY=find(md.mesh.y==min(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));
+-	% set the node that should be paired together
+-	% #md.stressbalance.vertex_pairing
+-	%->
+-	md.stressbalance.vertex_pairing=[minX,maxX;minY,maxY];
+-	if (ParamFile=='CheatyIsmipF.par')
+-		% if we are dealing with IsmipF the solution is in
+-		% masstransport
+-		md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;
+-  end
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.BoundaryCondition md;
+-end
+-
+-%Solving #7
+-if any(steps==7)
+-	% load the preceding step #help loadmodel
+-	% path is given by the organizer with the name of the given step
+-	%->
+-	md = loadmodel('./Models/ISMIP.BoundaryCondition');
+-	% Set cluster #md.cluster
+-	% generic parameters #help generic
+-	% set only the name and number of process
+-	%->
+-	md.cluster=generic('name',oshostname(),'np',2);
+-	% Set which control message you want to see #help verbose
+-	%->
+-	md.verbose=verbose('convergence',true);
+-	% Solve #help solve
+-	% we are solving a StressBalanc
+-	%->
+-	md=solve(md,'Stressbalance');
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.StressBalance md;
+-	% plot the surface velocities #plotdoc
+-	%->
+-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel)
+-end
+-
+-%Solving #8
+-if any(steps==8)
+-	% load the preceding step #help loadmodel
+-	% path is given by the organizer with the name of the given step
+-	%->
+-	md = loadmodel('./Models/ISMIP.BoundaryCondition');
+-	% Set cluster #md.cluster
+-	% generic parameters #help generic
+-	% set only the name and number of process
+-	%->
+-	md.cluster=generic('name',oshostname(),'np',2);
+-	% Set which control message you want to see #help verbose
+-	%->
+-	md.verbose=verbose('convergence',true);
+-	% set the transient model to ignore the thermal model
+-	% #md.transient 
+-	%->
+-	md.transient.isthermal=0;
+-	% define the timestepping scheme
+-	% everything here should be provided in years #md.timestepping
+-	% give the length of the time_step (4 years)
+-	%->
+-	md.timestepping.time_step=4;
+-	% give final_time (20*4 years time_steps)
+-	%->
+-	md.timestepping.final_time=4*20;
+-	% Solve #help solve
+-	% we are solving a TransientSolution
+-	%->
+-	md=solve(md,'Transient');
+-	% save the given model
+-	%->
+-	save ./Models/ISMIP.Transient md;
+-	% plot the surface velocities #plotdoc
+-	%->
+-	plotmodel(md,'data',md.results.TransientSolution(20).Vel)
+-end
+Index: ../trunk-jpl/examples/IceBridge/Greenland.par
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/Greenland.par	(revision 25914)
++++ ../trunk-jpl/examples/IceBridge/Greenland.par	(revision 25915)
+@@ -29,7 +29,7 @@
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %Reading IceBridge data for Jakobshavn
+ disp('      reading IceBridge Jakobshavn bedrock');
+-fid  = fopen('../Data/Jakobshavn_2008_2011_Composite_XYZGrid.txt');
++fid  = fopen('../Data/Jakobshavn_2008_2011_Composite/grids/Jakobshavn_2008_2011_Composite_XYZGrid.txt');
+ titles = fgets(fid); 
+ data = fscanf(fid,'%g,%g,%g,%g,%g',[5 266400])';
+ fclose(fid);
+Index: ../trunk-jpl/examples/AMR/runme.m
+===================================================================
+--- ../trunk-jpl/examples/AMR/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/AMR/runme.m	(revision 25915)
+@@ -1,14 +1,15 @@
+ % Mismip3D experiment with AMR using BAMG
+-steps=[1:3]; 
++steps=[1:3];
+ 
+ if any(steps==1)
+ 	disp('   Step 1: Coarse mesh');
+-	
++
+ 	%Generate an unstructured coarse mesh on the MISMIP domain with typical element edge length equal to 10,000 m
+ 	md=bamg(model,'domain','./domain.exp','hmax',10000,'splitcorners',1);
+ 
+ 	save AMRCoarseMesh md
+-end 
++end
++
+ if any(steps==2)
+ 	disp('   Step 2: Parameterization');
+ 
+@@ -15,7 +16,7 @@
+ 	md=loadmodel('AMRCoarseMesh');
+ 
+ 	md=setmask(md,'','');
+-	
++
+ 	% Run parameterization script to set up geometry, inital velocity, material properties, etc.
+ 	md=parameterize(md,'./mismip.par');
+ 
+@@ -22,7 +23,7 @@
+ 	% Set the AMR properties and the refinement criteria
+ 	% Here, we are refining around the grounding line
+ 	% We impose the element resolution at grounding equal to 1000 m (1 km)
+-	% The criterion used is the element distance to the grounding line.
++	% The criterion used is the element distance to the grounding line
+ 	% The distance used here is 10000 m (10 km), used in both side around the grouding line (upstream and downstream)
+ 	md.amr.groundingline_resolution=1000;
+ 	md.amr.groundingline_distance=10000;
+@@ -34,20 +35,22 @@
+ 
+ 	save AMRParam md
+ end
+-if any(steps==3);
+-   disp('   Step 3: Solve!');
+-	 
++
++if any(steps==3)
++	disp('   Step 3: Solve!');
++
+ 	md=loadmodel('AMRParam');
+ 
+ 	% Run transient with adaptive mesh refinement
+ 	md.timestepping.time_step=1;
+ 	md.timestepping.final_time=500; % here, as example, only 500 yr.
+-	md.settings.output_frequency=10;% here, save results every 10 yr 
++	md.settings.output_frequency=10;% here, save results every 10 yr
+ 	md.stressbalance.maxiter=30;
+ 	md.stressbalance.abstol=NaN;
+ 	md.stressbalance.restol=1;
++	md.settings.solver_residue_threshold=1e-2; % relaxing (the first stress balance solver iteration presents values higher than the original threshold. This probably happens because the initial velocity is set to one).
+ 	md.verbose=verbose('convergence',false,'solution',true);
+-	
++
+ 	% Specify that you want to run the model on your current (local host) computer
+ 	% Change the number of processors according to your machine (here np=2)
+ 	md.cluster=generic('np',2);
+Index: ../trunk-jpl/examples/EsaGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 25915)
+@@ -1,59 +1,55 @@
+-
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1]; % [1:5] 
++steps=[1]; % [1:5]
+ 
+-if any(steps==1) 
++if any(steps==1) %{{{
+ 	disp('   Step 1: Global mesh creation');
+ 
+-	resolution=300;			% [km] 
+-	radius = 6.371012*10^3;	% [km] 
++	resolution=300;			% [km]
++	radius = 6.371012*10^3;	% [km]
+ 
+-	md=model; 
+-	md.mask=maskpsl(); 
++	md=model;
+ 	md.mesh=gmshplanet('radius',radius,'resolution',resolution);
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
++	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 	save ./Models/EsaGRACE_Mesh md;
+-	
++
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
++end %}}}
+ 
+-end 
+-
+-if any(steps==2) 
++if any(steps==2) %{{{
+ 	disp('   Step 2: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/EsaGRACE_Mesh');
+ 
+ 	year_month = 2007+15/365;
+-	time_range = [year_month year_month]; 
+-	
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
+-	
+-	md.esa.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice; % ice height equivalent 
++	time_range = [year_month year_month];
+ 
+-	save ./Models/EsaGRACE_Loads md; 
+-	
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
++
++	md.esa.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice; % ice height equivalent
++
++	save ./Models/EsaGRACE_Loads md;
++
+ 	plotmodel (md,'data',md.esa.deltathickness,...
+ 		'view',[90 -90],'caxis',[-.1 .1],...
+ 		'title','Ice height equivalent [m]');
++end %}}}
+ 
+-end 
+-
+-if any(steps==3) 
++if any(steps==3) %{{{
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/EsaGRACE_Loads');
+ 
+-	nlove=10001;	
+-	md.esa.love_h = love_numbers('h','CF'); md.esa.love_h(nlove+1:end)=[];
+-	md.esa.love_l = love_numbers('l','CF'); md.esa.love_l(nlove+1:end)=[];
++	love_numbers = lovenumbers('maxdeg',10000,'referenceframe','CF');
++	md.esa.love_h = love_numbers.h;
++	md.esa.love_l = love_numbers.l;
+ 
+-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 
+-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 
++	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
++	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
+ 	pos=find(md.esa.deltathickness~=0);
+-	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 
+-	md.mask.land_levelset = 1-md.mask.ocean_levelset; 
++	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
++	%md.mask.land_levelset = 1-md.mask.ocean_levelset;
+ 
+ 	di=md.materials.rho_ice/md.materials.rho_water;
+ 	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+@@ -60,91 +56,87 @@
+ 	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+ 	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+ 	md.geometry.bed=md.geometry.base;
+-	
++
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-	
++
+ 	md.miscellaneous.name='EsaGRACE';
+-	
+-	save ./Models/EsaGRACE_Parameterization md; 
+ 
+-end 
++	save ./Models/EsaGRACE_Parameterization md;
++end %}}}
+ 
+-if any(steps==4) 
++if any(steps==4) %{{{
+ 	disp('   Step 4: Solve Esa solver');
+ 	md = loadmodel('./Models/EsaGRACE_Parameterization');
+ 
+ 	md.esa.requested_outputs = {'EsaUmotion','EsaNmotion','EsaEmotion'};
+-	
+-	md.cluster=generic('name',oshostname(),'np',3); 
++
++	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+ 	md=solve(md,'Esa');
+ 
+-	save ./Models/EsaGRACE_Solution md; 
++	save ./Models/EsaGRACE_Solution md;
++end %}}}
+ 
+-end 
+-
+-if any(steps==5) 
++if any(steps==5) %{{{
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/EsaGRACE_Solution');
+ 
+-	sol1 = md.esa.deltathickness*100;					% [cm] 
+-	sol2 = md.results.EsaSolution.EsaUmotion*1000;	% [mm] 
+-	sol3 = md.results.EsaSolution.EsaNmotion*1000;	% [mm] 
+-	sol4 = md.results.EsaSolution.EsaEmotion*1000;	% [mm] 
++	sol1 = md.esa.deltathickness*100;				% [cm]
++	sol2 = md.results.EsaSolution.EsaUmotion*1000;	% [mm]
++	sol3 = md.results.EsaSolution.EsaNmotion*1000;	% [mm]
++	sol4 = md.results.EsaSolution.EsaEmotion*1000;	% [mm]
+ 
+ 	sol_name={'Change in water equivalent height [cm]', 'Vertical displacement [mm]',...
+-		'Horizontal (NS) displacement [mm]', 'Horizontal (EW) displacement [mm]'}; 
+-	fig_name={'Fig_dH.pdf','Fig_vert.pdf','Fig_horzNS.pdf','Fig_horzEW.pdf'}; 
++		'Horizontal (NS) displacement [mm]', 'Horizontal (EW) displacement [mm]'};
++	fig_name={'Fig_dH.pdf','Fig_vert.pdf','Fig_horzNS.pdf','Fig_horzEW.pdf'};
+ 
+-	res = 1.0; % [degree] 
++	res = 1.0; % [degree]
+ 
+ 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
+-	sol_grid = zeros(size(lat_grid)); 
++	sol_grid = zeros(size(lat_grid));
+ 
+-	for kk=1:4 
++	for kk=1:4
+ 		sol=eval(sprintf('sol%d',kk));
+-	
+-		if length(sol)==md.mesh.numberofelements 
++
++		if length(sol)==md.mesh.numberofelements
+ 			for jj=1:md.mesh.numberofelements
+ 				ii=(jj-1)*3;
+ 				pp(ii+1:ii+3)=md.mesh.elements(jj,:);
+ 			end
+ 			for jj=1:md.mesh.numberofvertices
+-				pos=ceil(find(pp==jj)/3); 
+-				temp(jj)=mean(sol(pos)); 
++				pos=ceil(find(pp==jj)/3);
++				temp(jj)=mean(sol(pos));
+ 			end
+-			sol=temp'; 
+-		end 
++			sol=temp';
++		end
+ 
+-		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol); 
++		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
+ 		F.Method = 'linear';
+-		F.ExtrapolationMethod = 'linear'; 
++		F.ExtrapolationMethod = 'linear';
+ 
+ 		sol_grid = F(lat_grid, lon_grid);
+-		sol_grid(isnan(sol_grid))=0; 
+-		sol_grid(lat_grid>85 & sol_grid==0)=NaN; 
++		sol_grid(isnan(sol_grid))=0;
++		sol_grid(lat_grid>85 & sol_grid==0)=NaN;
+ 
+ 		set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+-		figure1=figure('Position', [100, 100, 1000, 500]); 
+-		gcf; load coast; cla; 
+-		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on; 
++		figure1=figure('Position', [100, 100, 1000, 500]);
++		gcf; load coast; cla;
++		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+ 		if (kk==1)
+-			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white'); 
+-		end 
+-		plot(long,lat,'k'); hold off; 
++			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
++		end
++		plot(long,lat,'k'); hold off;
+ 		c1=colorbar;
+ 		colormap('haxby');
+-		caxis([-min(abs(min(sol)),abs(max(sol))) min(abs(min(sol)),abs(max(sol)))]); 
+-		xlim([-180 180]); 
+-		ylim([-90 90]); 
+-		grid on; 
+-		title(sol_name(kk)); 
++		caxis([-min(abs(min(sol)),abs(max(sol))) min(abs(min(sol)),abs(max(sol)))]);
++		xlim([-180 180]);
++		ylim([-90 90]);
++		grid on;
++		title(sol_name(kk));
+ 		set(gcf,'color','w');
+-		%export_fig(fig_name{kk}); 
++		%export_fig(fig_name{kk});
+ 	end
+-
+-end 
+-
++end %}}}
+Index: ../trunk-jpl/examples/EsaWahr/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaWahr/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/EsaWahr/runme.m	(revision 25915)
+@@ -1,68 +1,64 @@
+-
+ clear all;
+ addpath('../Functions');
+ 
+-steps=[0]; % [0:6] 
++steps=[1]; % [1:7]
+ 
+-if any(steps==0) 
+-	disp('   Step 0: Mesh creation');
++if any(steps==1) %{{{
++	disp('   Step 1: Mesh creation');
+ 
+-	md=roundmesh(model,100000,10000);  % Domain radius and element size [m] 
++	md=roundmesh(model,100000,10000);  % Domain radius and element size [m]
+ 
+ 	save ./Models/EsaWahr_Mesh md;
+-	
++
+ 	plotmodel(md,'data','mesh');
++end %}}}
+ 
+-end 
++if any(steps==2) %{{{
++	disp('   Step 2: Anisotropic mesh creation');
+ 
+-if any(steps==1) 
+-	disp('   Step 1: Anisotropic mesh creation');
++	md=roundmesh(model,100000,1000);
+ 
+-	md=roundmesh(model,100000,1000); 
+-
+-	disc_radius=20*1000; 
++	disc_radius=20*1000;
+ 	rad_dist=sqrt(md.mesh.x.^2+md.mesh.y.^2);	
+-	field = abs(rad_dist-disc_radius); 
++	field = abs(rad_dist-disc_radius);
+ 
+-	md = bamg(md,'field',field,'err',50,'hmax',10000); 
++	md = bamg(md,'field',field,'err',50,'hmax',10000);
+ 
+ 	save ./Models/EsaWahr_Mesh md;
+-	
++
+ 	plotmodel (md,'data','mesh');
++end %}}}
+ 
+-end 
+-
+-if any(steps==2) 
+-	disp('   Step 2: Define loads');
++if any(steps==3) %{{{
++	disp('   Step 3: Define loads');
+ 	md = loadmodel('./Models/EsaWahr_Mesh');
+ 
+-	rho_w_i=md.materials.rho_freshwater/md.materials.rho_ice; 
++	rho_w_i=md.materials.rho_freshwater/md.materials.rho_ice;
+ 
+ 	index=md.mesh.elements;		
+-	x_cent=mean(md.mesh.x(index),2); 
+-	y_cent=mean(md.mesh.y(index),2); 
++	x_cent=mean(md.mesh.x(index),2);
++	y_cent=mean(md.mesh.y(index),2);
+ 
+-	md.esa.deltathickness = zeros(md.mesh.numberofelements,1); 
+-	disc_radius=20; % [km] 
++	md.esa.deltathickness = zeros(md.mesh.numberofelements,1);
++	disc_radius=20; % [km]
+ 	rad_dist=sqrt(x_cent.^2+y_cent.^2)/1000;	
+ 	md.esa.deltathickness(rad_dist<=disc_radius) = -1.0*rho_w_i;
+ 
+-	save ./Models/EsaWahr_Loads md; 
+-	
++	save ./Models/EsaWahr_Loads md;
++
+ 	plotmodel (md,'data',md.esa.deltathickness,'title','Ice height equivalent [m]');
++end %}}}
+ 
+-end 
+-
+-if any(steps==3) 
+-	disp('   Step 3: Parameterization');
++if any(steps==4) %{{{
++	disp('   Step 4: Parameterization');
+ 	md = loadmodel('./Models/EsaWahr_Loads');
+ 
+-	nlove=10001;
+-	md.esa.love_h = love_numbers('h','CF'); md.esa.love_h(nlove+1:end)=[];
+-	md.esa.love_l = love_numbers('l','CF'); md.esa.love_l(nlove+1:end)=[];
++	love_numbers = lovenumbers('maxdeg',10000,'referenceframe','CF');
++	md.esa.love_h = love_numbers.h;
++	md.esa.love_l = love_numbers.l;
+ 
+-	md.mask.ice_levelset = -ones(md.mesh.numberofvertices,1); 
+-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 
++	md.mask.ice_levelset = -ones(md.mesh.numberofvertices,1);
++	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
+ 
+ 	di=md.materials.rho_ice/md.materials.rho_water;
+ 	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+@@ -69,42 +65,40 @@
+ 	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+ 	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+ 	md.geometry.bed=md.geometry.base;
+-	
++
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-	
++
+ 	md.miscellaneous.name='EsaWahr';
+-	
+-	save ./Models/EsaWahr_Parameterization md; 
+ 
+-end 
++	save ./Models/EsaWahr_Parameterization md;
++end %}}}
+ 
+-if any(steps==4) 
+-	disp('   Step 4: Solve Esa solver');
++if any(steps==5) %{{{
++	disp('   Step 5: Solve Esa solver');
+ 	md = loadmodel('./Models/EsaWahr_Parameterization');
+ 
+ 	md.esa.requested_outputs = {'EsaUmotion','EsaXmotion','EsaYmotion'};
+-	
+-	md.cluster=generic('name',oshostname(),'np',3); 
++
++	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+ 	md=solve(md,'Esa');
+ 
+-	save ./Models/EsaWahr_Solution md; 
++	save ./Models/EsaWahr_Solution md;
++end %}}}
+ 
+-end 
+-
+-if any(steps==5) 
+-	disp('   Step 5: Plot solutions');
++if any(steps==6) %{{{
++	disp('   Step 6: Plot solutions');
+ 	md = loadmodel('./Models/EsaWahr_Solution');
+ 
+-	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm] 
+-	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm] 
+-	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm] 
+-	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]  
++	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm]
++	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm]
++	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm]
++	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm] 
+ 
+-	set(0,'DefaultAxesFontSize',24,'DefaultAxesLineWidth',1,'DefaultTextFontSize',24,'DefaultLineMarkerSize',6); 
++	set(0,'DefaultAxesFontSize',24,'DefaultAxesLineWidth',1,'DefaultTextFontSize',24,'DefaultLineMarkerSize',6);
+ 	figure('Position', [100, 100, 800, 600]);
+ 	plotmodel(md,'data',vert,...
+ 		'xTickLabel#all',[],'yTickLabel#all',[],...
+@@ -124,50 +118,47 @@
+ 		'data',horz_e,...
+ 		'caxis#3-4',[-0.5 0.5],...
+ 		'axispos',[0.505 0.02 0.47 0.47],...
+-		'colorbarpos',[0.53,0.065,0.18,0.02],'colorbartitle#4','East-west [mm]'); 
+-	%export_fig('Fig5.pdf'); 
++		'colorbarpos',[0.53,0.065,0.18,0.02],'colorbartitle#4','East-west [mm]');
++	%export_fig('Fig5.pdf');
++end %}}}
+ 
+-end 
+-
+-if any(steps==6) 
+-	disp('   Step 6: Compare results against Wahr semi-analytic solutions');
++if any(steps==7) %{{{
++	disp('   Step 7: Compare results against Wahr semi-analytic solutions');
+ 	md = loadmodel('./Models/EsaWahr_Solution');
+ 
+-	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm] 
+-	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm] 
+-	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm] 
+-	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]  
+-	
+-	xi=[0:500:100000]; % grid points [m] 
+-	yi=zeros(1,length(xi)); 
+-	vert_track=griddata(md.mesh.x,md.mesh.y,vert,xi,yi,'linear'); 
+-	horz_track=griddata(md.mesh.x,md.mesh.y,horz,xi,yi,'linear'); 
++	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm]
++	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm]
++	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm]
++	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm] 
+ 
+-	% semi-analytic solution (Wahr et al., 2013, JGR, Figure 1) 
+-	disc_radius = 20*1000; % [m] 
++	xi=[0:500:100000]; % grid points [m]
++	yi=zeros(1,length(xi));
++	vert_track=griddata(md.mesh.x,md.mesh.y,vert,xi,yi,'linear');
++	horz_track=griddata(md.mesh.x,md.mesh.y,horz,xi,yi,'linear');
++
++	% semi-analytic solution (Wahr et al., 2013, JGR, Figure 1)
++	disc_radius = 20*1000; % [m]
+ 	[vert_wahr, horz_wahr] = wahr(disc_radius,xi,md.esa.love_h,md.esa.love_l);
+ 
+-	set(0,'DefaultAxesFontSize',16,'DefaultAxesLineWidth',1,'DefaultTextFontSize',16,'DefaultLineMarkerSize',6); 
++	set(0,'DefaultAxesFontSize',16,'DefaultAxesLineWidth',1,'DefaultTextFontSize',16,'DefaultLineMarkerSize',6);
+ 	figure1=figure('Position', [100, 100, 700, 400]);
+-	ylabel_1={'0',' ','1','','2','','3',''}; 
++	ylabel_1={'0',' ','1','','2','','3',''};
+ 	axes1 = axes('Layer','top','Position',[0.1 0.15 0.8 0.8],...
+ 		'XTick',[0:10:100],'xlim',[0 100],...
+-		'ylim',[0 3.5],'Ytick',[0:0.5:3.5],'yticklabel',ylabel_1); 
+-		box(axes1,'on'); hold(axes1,'all'); grid on; 
+-		xlabel(axes1,'Radial distance [km]'); 
++		'ylim',[0 3.5],'Ytick',[0:0.5:3.5],'yticklabel',ylabel_1);
++		box(axes1,'on'); hold(axes1,'all'); grid on;
++		xlabel(axes1,'Radial distance [km]');
+ 		ylabel(axes1,'Displacement [mm]');
+-		plot([20 20],[0 3.5],'-k','linewidth',2,'parent',axes1); 
+-		% analytic soln 
+-		h3=plot(xi/1000,vert_wahr,'-r','linewidth',5,'parent',axes1); 
+-		h4=plot(xi/1000,horz_wahr,'-m','linewidth',5,'parent',axes1); 
+-		% ISSM soln 
+-		h1=plot(xi/1000,vert_track*917/1000,'-b','linewidth',3,'parent',axes1); 
+-		h2=plot(xi/1000,horz_track*917/1000,'-c','linewidth',3,'parent',axes1); 
++		plot([20 20],[0 3.5],'-k','linewidth',2,'parent',axes1);
++		% analytic soln
++		h3=plot(xi/1000,vert_wahr,'-r','linewidth',5,'parent',axes1);
++		h4=plot(xi/1000,horz_wahr,'-m','linewidth',5,'parent',axes1);
++		% ISSM soln
++		h1=plot(xi/1000,vert_track*917/1000,'-b','linewidth',3,'parent',axes1);
++		h2=plot(xi/1000,horz_track*917/1000,'-c','linewidth',3,'parent',axes1);
+ 		ag1 = gca;
+ 		leg1a = legend(ag1,[h3,h1,h4,h2],'Vertical (Wahr)','Vertical (ISSM)','Horizontal (Wahr)','Horizontal (ISSM)');
+-		set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize',16); 
++		set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize',16);
+ 		set(gcf,'color','w');
+-	%export_fig('Fig6.pdf'); 
+-
+-end 
+-
++	%export_fig('Fig6.pdf');
++end %}}}
+Index: ../trunk-jpl/examples/Functions/grace.m
+===================================================================
+--- ../trunk-jpl/examples/Functions/grace.m	(revision 25914)
++++ ../trunk-jpl/examples/Functions/grace.m	(revision 25915)
+@@ -42,12 +42,18 @@
+ 	% }}}
+ 
+ 	% Monthly GRACE data 
+-	filename=['GRCTellus.JPL.200204_201701.LND.RL05_1.DSTvSCS1411.nc']; 
+-	time_0=ncread(filename,'time'); % days since 2002-01-01 00:00:00 UTC 
+-	long_0=ncread(filename,'lon'); % longitudes: 0.27-359.75
+-	lati_0=ncread(filename,'lat'); % latitudes: -89.75:89.75
+-	rec=ncread(filename,'lwe_thickness');% rec_ensemble_mean [cm]
++	filename=['../Data/GRCTellus.JPL.200204_201701.LND.RL05_1.DSTvSCS1411.nc'];
++	try
++		time_0=ncread(filename,'time'); % days since 2002-01-01 00:00:00 UTC
++		long_0=ncread(filename,'lon'); % longitudes: 0.27-359.75
++		lati_0=ncread(filename,'lat'); % latitudes: -89.75:89.75
++		rec=ncread(filename,'lwe_thickness');% rec_ensemble_mean [cm]
++	catch e
++		disp('If dataset file exists at another location, modify the path in examples/Functions/grace.m')
++		rethrow(e)
++	end
+ 
++
+ 	time_yr = 2002+time_0/365; % [yr] 
+ 
+ 	[nn_0,mm_0] = size(squeeze(rec(:,:,1))); 
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 25915)
+@@ -4,7 +4,7 @@
+ %Location of SeaRISE dataset
+ ncdata='../Data/Greenland_5km_dev1.2.nc';
+ 
+-if any(steps==1)
++if any(steps==1) %{{{
+ 	disp('   Step 1: Mesh creation');
+ 
+ 	%Generate initial uniform mesh (resolution = 20000 m)
+@@ -21,7 +21,7 @@
+ 
+ 	%Mesh Greenland
+ 	md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,'err',8);
+-	
++
+ 	%convert x,y coordinates (Polar stereo) to lat/lon
+ 	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
+ 
+@@ -28,9 +28,9 @@
+ 	save ./Models/Greenland.Mesh_generation md;
+ 
+ 	plotmodel (md,'data','mesh');
+-end
++end %}}}
+ 
+-if any(steps==2)
++if any(steps==2) %{{{
+ 	disp('   Step 2: Parameterization');
+ 	md = loadmodel('./Models/Greenland.Mesh_generation');
+ 
+@@ -38,10 +38,10 @@
+ 	md = parameterize(md,'./Greenland.par');
+ 	md = setflowequation(md,'SSA','all');
+ 
+-	save ./Models/Greenland.Parameterization md; 
+-end
++	save ./Models/Greenland.Parameterization md;
++end %}}}
+ 
+-if any(steps==3)
++if any(steps==3) %{{{
+ 	disp('   Step 3: Control method friction');
+ 	md = loadmodel('./Models/Greenland.Parameterization');
+ 
+@@ -65,7 +65,7 @@
+ 	md.inversion.max_parameters=200*ones(md.mesh.numberofvertices,1);
+ 
+ 	%Additional parameters
+-	md.stressbalance.restol=0.01; md.stressbalance.reltol=0.1; 
++	md.stressbalance.restol=0.01; md.stressbalance.reltol=0.1;
+ 	md.stressbalance.abstol=NaN;
+ 
+ 	%Go solve
+@@ -77,10 +77,10 @@
+ 	%Update model friction fields accordingly
+ 	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
+ 
+-	save ./Models/Greenland.Control_drag md; 
+-end
++	save ./Models/Greenland.Control_drag md;
++end %}}}
+ 
+-if any(steps==4)
++if any(steps==4) %{{{
+ 	disp('   Step 4: Transient run');
+ 	md = loadmodel('./Models/Greenland.Control_drag');
+ 
+@@ -100,8 +100,7 @@
+ 
+ 	%Additional options
+ 	md.inversion.iscontrol=0;
+-	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
+-		                             'SmbMassBalance'};
++	md.transient.requested_outputs={'IceVolume','TotalSmb','SmbMassBalance'};
+ 	md.verbose=verbose('solution',true,'module',true,'convergence',true);
+ 
+ 	%Go solve
+@@ -108,11 +107,11 @@
+ 	md.cluster=generic('name',oshostname,'np',2);
+ 	md=solve(md,'Transient');
+ 
+-	save ./Models/Greenland.Transient md; 
+-end
++	save ./Models/Greenland.Transient md;
++end %}}}
+ 
+-if any(steps==5)
+-	disp('   Step 5: Plotting'); 
++if any(steps==5) %{{{
++	disp('   Step 5: Plotting');
+ 	md = loadmodel('./Models/Greenland.Transient');
+ 
+ 	%Planview plots
+@@ -142,9 +141,9 @@
+ 	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 	subplot(3,1,3); plot([0.2:0.2:20],volume); title('Ice Volume');
+ 	xlabel('years')
+-end
++end %}}}
+ 
+-if any(steps==6)
++if any(steps==6) %{{{
+ 	disp('   Step 6: Extract Box SMB');
+ 	md = loadmodel('./Models/Greenland.Transient');
+ 
+@@ -171,10 +170,9 @@
+ 	figure; plot(t,totalsmb/1e9); title('Total Surface mass balance, Gt'); xlabel('year'); ylabel('Gt/yr');
+ 
+ 	clear smbbox
++end %}}}
+ 
+-end
+-
+-if any(steps==7)
++if any(steps==7) %{{{
+ 	disp('   Step 7: Historical Relaxation run');
+ 	md = loadmodel('./Models/Greenland.Control_drag');
+ 
+@@ -197,8 +195,7 @@
+ 
+ 	%Additional options
+ 	md.inversion.iscontrol=0;
+-	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
+-		'SmbMassBalance'};
++	md.transient.requested_outputs={'IceVolume','TotalSmb','SmbMassBalance'};
+ 	md.verbose=verbose('solution',true,'module',true);
+ 
+ 	%Go solve
+@@ -206,47 +203,37 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save ./Models/Greenland.HistoricTransient md;
+-end
++end % step 7 end
+ 
+-if any(steps==8)
++if any(steps==8) %{{{
+ 	disp('   Step 8: Plotting exercise');
+ 
+ 	%Load historic transient model
+ 
++	%Create Line Plots of relaxation run. Create a figure.
+ 
+-	%Create Line Plots of relaxation run.  Create a figure.
+-
+-
+ 	%Save surface mass balance, by looping through 200 years (1000 steps)
+-	% Note, the first output will always contain output from time step 1
++	%Note, the first output will always contain output from time step 1
+ 
+-
+ 	%Plot surface mass balance time series in first subplot
+ 
+-	
+ 	%Title this plot Mean surface mass balance
+ 
+-
+ 	%Save velocity by looping through 200 years
+ 
+-
+ 	%Plot velocity time series in second subplot
+ 
+-	
+ 	%Title this plot Mean Velocity
+ 
++	%Save Ice Volume by looping through 200 years
+ 
+-	%Save Ice Volume by looping through 200 years 
+-
+-
+ 	%Plot volume time series in third subplot
+ 
+-	
+ 	%Title this plot Mean Velocity and add an x label of years
+ 
+-end
++end % step 8 end
+ 
+-if any(steps==9)
++if any(steps==9) %{{{
+ 	disp('   Step 9: Box Transient run');
+ 	md = loadmodel('./Models/Greenland.HistoricTransient_200yr');
+ 
+@@ -291,8 +278,7 @@
+ 
+ 	%Additional options
+ 	md.inversion.iscontrol=0;
+-	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
+-		'SmbMassBalance'};
++	md.transient.requested_outputs={'IceVolume','TotalSmb','SmbMassBalance'};
+ 	md.verbose=verbose('solution',true,'module',true);
+ 
+ 	%Go solve
+@@ -300,9 +286,9 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save ./Models/Greenland.BoxTransient md;
+-end
++end %}}}
+ 
+-if any(steps==10)
++if any(steps==10) %{{{
+ 	disp('   Step 10: Plot Box Transient');
+ 	md = loadmodel('./Models/Greenland.BoxTransient');
+ 
+@@ -326,4 +312,4 @@
+ 	volume=[]; for i=1:length(t); volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 	subplot(3,1,3); plot(t,volume); title('Ice Volume');
+ 	xlabel('years')
+-end
++end %}}}
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 25915)
+@@ -1,4 +1,4 @@
+-%wich steps to perform steps are from 1 to 8 
++%which steps to perform; steps are from 1 to 8
+ %step 7 is specific to ISMIPA
+ %step 8 is specific to ISMIPF
+ 
+@@ -10,7 +10,7 @@
+ %Run Steps
+ 
+ %Mesh Generation #1
+-if any(steps==1) 
++if any(steps==1) %{{{
+ 
+ 	%initialize md as a new model #help model
+ 	%->
+@@ -25,10 +25,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end
++end %}}}
+ 
+ %Masks #2
+-if any(steps==2) 
++if any(steps==2) %{{{
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -44,10 +44,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end
++end %}}}
+ 
+ %Parameterization #3
+-if any(steps==3) 
++if any(steps==3) %{{{
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -61,10 +61,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end
++end %}}}
+ 
+ %Extrusion #4
+-if any(steps==4)
++if any(steps==4) %{{{
+ 	
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -80,10 +80,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end
++end %}}}
+ 
+ %Set the flow computing method #5
+-if any(steps==5)
++if any(steps==5) %{{{
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -96,10 +96,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end
++end %}}}
+ 
+ %Set Boundary Conditions #6
+-if any(steps==6)
++if any(steps==6) %{{{
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -117,7 +117,7 @@
+ 	% extract the nodenumbers at the base #md.mesh.vertexonbase
+ 	%->
+ 
+-  % set the sliding to zero on the bed (Vx and Vy)
++	% set the sliding to zero on the bed (Vx and Vy)
+ 	%->
+ 
+ 	%->
+@@ -145,14 +145,14 @@
+ 	if (ParamFile=='IsmipF.par')
+ 		% if we are dealing with IsmipF the solution is in masstransport
+ 		md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;
+-  end
++	end
+ 	% save the given model
+ 	%->
+ 
+-end
++end %}}}
+ 
+ %Solving #7
+-if any(steps==7)
++if any(steps==7) %{{{
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+@@ -174,10 +174,10 @@
+ 
+ 	% plot the surface velocities #plotdoc
+ 	%->
+-end
++end %}}}
+ 
+ %Solving #8
+-if any(steps==8)
++if any(steps==8) %{{{
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+@@ -211,5 +211,4 @@
+ 
+ 	% plot the surface velocities #plotdoc
+ 	%->
+-
+-end
++end %}}}
+Index: ../trunk-jpl/examples/IceBridge/runme.m
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/IceBridge/runme.m	(revision 25915)
+@@ -1,11 +1,10 @@
+ clear all;
+-close all;
+ steps=[1];
+ 
+ %Location of SeaRISE dataset
+ ncdata='../Data/Greenland_5km_dev1.2.nc';
+ 
+-if any(steps==1)
++if any(steps==1) %{{{
+ 	disp('   Step 1: Mesh creation');
+ 
+ 	%Generate initial uniform mesh (resolution = 20000 m)
+@@ -23,7 +22,7 @@
+ 	%Mesh greenland without refinement in Jak basin
+ 	md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,'err',8);
+ 	return;
+-	
++
+ 	%Refine mesh in the region of Jakobshavn (resolution = 3000 m)
+ 	hmaxVertices=NaN*ones(md.mesh.numberofvertices,1);
+ 	in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,...
+@@ -36,20 +35,20 @@
+ 	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
+ 
+ 	save ./Models/Greenland.Mesh_generation md;
+-end
++end %}}}
+ 
+-if any(steps==2)
++if any(steps==2) %{{{
+ 	disp('   Step 2: Parameterization');
+ 	md = loadmodel('./Models/Greenland.Mesh_generation');
+ 
+ 	md = setmask(md,'','');
+-	md = parameterize(md,'Greenland.par');
++	md = parameterize(md,'./Greenland.par');
+ 	md = setflowequation(md,'SSA','all');
+ 
+ 	save ./Models/Greenland.Parameterization2 md; 
+-end
++end %}}}
+ 
+-if any(steps==3)
++if any(steps==3) %{{{
+ 	disp('   Step 3: Control method friction');
+ 	md = loadmodel('./Models/Greenland.Parameterization2');
+ 
+@@ -92,9 +91,9 @@
+ 	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
+ 
+ 	save ./Models/Greenland.Control_drag md; 
+-end
++end %}}}
+ 
+-if any(steps==4)
++if any(steps==4) %{{{
+ 	disp('   Step 4: Transient run');
+ 	md = loadmodel('./Models/Greenland.Control_drag');
+ 
+@@ -121,9 +120,9 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save ./Models/Greenland.Transient md; 
+-end
++end %}}}
+ 
+-if any(steps==5)
++if any(steps==5) %{{{
+ 	disp('   Step 5: Plotting'); 
+ 	md = loadmodel('./Models/Greenland.Transient');
+ 
+@@ -154,4 +153,4 @@
+ 	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 	subplot(3,1,3); plot(time_plot,volume); title('Ice Volume');
+ 	xlabel('years')
+-end
++end %}}}
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 25915)
+@@ -1,5 +1,6 @@
+-step=1;
+-if any(step==1)
++steps=[1];
++
++if any(steps==1) %{{{
+ 	%Generate observations
+ 	md = model;
+ 	md = triangle(md,'DomainOutline.exp',100000);
+@@ -8,11 +9,12 @@
+ 	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',...
++	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[1.3 1.9]*10^8,'title','"True" B',...
+ 		'data',md.results.StressbalanceSolution.Vel,'title','"observed velocities"')
+ 	save model1 md
+-end
+-if any(step==2)
++end %}}}
++
++if any(steps==2) %{{{
+ 	%Modify rheology, now constant
+ 	loadmodel('model1.mat');
+ 	md.materials.rheology_B(:) = 1.8*10^8;
+@@ -19,16 +21,17 @@
+ 
+ 	%results of previous run are taken as observations
+ 	md.inversion=m1qn3inversion();
+-	md.inversion.vx_obs  = md.results.StressbalanceSolution.Vx;
+-	md.inversion.vy_obs  = md.results.StressbalanceSolution.Vy;
+-	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
++	md.inversion.vx_obs		= md.results.StressbalanceSolution.Vx;
++	md.inversion.vy_obs		= md.results.StressbalanceSolution.Vy;
++	md.inversion.vel_obs	= md.results.StressbalanceSolution.Vel;
+ 
+ 	md = solve(md,'Stressbalance');
+-	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'title','B first guess',...
++	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[1.3 1.9]*10^8,'title','B first guess',...
+ 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
+ 	save model2 md
+-end
+-if any(step==3)
++end %}}}
++
++if any(steps==3) %{{{
+ 	%invert for ice rigidity
+ 	loadmodel('model2.mat');
+ 
+@@ -39,8 +42,8 @@
+ 	md.inversion.maxsteps = maxsteps;
+ 	md.inversion.cost_functions = 101;
+ 	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,1);
+-	md.inversion.min_parameters    = cuffey(273)*ones(md.mesh.numberofvertices,1);
+-	md.inversion.max_parameters    = cuffey(200)*ones(md.mesh.numberofvertices,1);
++	md.inversion.min_parameters = cuffey(273)*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters = cuffey(200)*ones(md.mesh.numberofvertices,1);
+ 
+ 	%Go solve!
+ 	md.verbose=verbose(0);
+@@ -47,8 +50,9 @@
+ 	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
+-if any(step==4)
++end %}}}
++
++if any(steps==4) %{{{
+ 	%invert for ice rigidity
+ 	loadmodel('model2.mat');
+ 
+@@ -58,10 +62,10 @@
+ 	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) = 10^-16*ones(md.mesh.numberofvertices,1);
+-	md.inversion.min_parameters    = cuffey(273)*ones(md.mesh.numberofvertices,1);
+-	md.inversion.max_parameters    = cuffey(200)*ones(md.mesh.numberofvertices,1);
++	md.inversion.cost_functions_coefficients		= ones(md.mesh.numberofvertices,1);
++	md.inversion.cost_functions_coefficients(:,2)	= 10^-16*ones(md.mesh.numberofvertices,1);
++	md.inversion.min_parameters = cuffey(273)*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters = cuffey(200)*ones(md.mesh.numberofvertices,1);
+ 
+ 	%Go solve!
+ 	md.verbose=verbose(0);
+@@ -68,4 +72,4 @@
+ 	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
++end %}}}
+Index: ../trunk-jpl/examples/Jakobshavn/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Jakobshavn/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/Jakobshavn/runme.m	(revision 25915)
+@@ -1,39 +1,41 @@
+ steps=[1];
+ 
+-if any(steps==1)
+-	disp('	Step 1: Mesh creation'); 
++if any(steps==1) %{{{
++	disp('   Step 1: Mesh creation');
+ 	md=triangle(model,'Domain.exp',2000);
+ 
+ 	%Get observed velocity field on mesh nodes
+ 	ncdata='../Data/Greenland_5km_dev1.2.nc';
+-	if ~exist(ncdata,'file'), 
++	if ~exist(ncdata,'file'),
+ 		error('File Greenland_5km_dev1.2.nc not downloaded in Data Directory');
+ 	end
+-	x1   = ncread(ncdata,'x1');
+-	y1   = ncread(ncdata,'y1');
+-	velx = ncread(ncdata,'surfvelx');
+-	vely = ncread(ncdata,'surfvely');
+-	vx   = InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);
+-	vy   = InterpFromGridToMesh(x1,y1,vely',md.mesh.x,md.mesh.y,0);
+-	vel  = sqrt(vx.^2+vy.^2);
++	x1		= ncread(ncdata,'x1');
++	y1		= ncread(ncdata,'y1');
++	velx	= ncread(ncdata,'surfvelx');
++	vely	= ncread(ncdata,'surfvely');
++	vx		= InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);
++	vy		= InterpFromGridToMesh(x1,y1,vely',md.mesh.x,md.mesh.y,0);
++	vel		= sqrt(vx.^2+vy.^2);
+ 
+ 	%refine mesh using surface velocities as metric
+ 	md=bamg(md,'hmin',1200,'hmax',15000,'field',vel,'err',5);
+ 	[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
+-	
++
+ 	save JksMesh md
+-end 
+-if any(steps==2)
+-	disp('	Step 2: Parameterization');
++end %}}}
++
++if any(steps==2) %{{{
++	disp('   Step 2: Parameterization');
+ 	md=loadmodel('JksMesh');
+-	
++
+ 	md=setmask(md,'','');
+-	md=parameterize(md,'Jks.par'); 
++	md=parameterize(md,'Jks.par');
+ 
+ 	save JksPar md
+-end 
+-if any(steps==3)
+-	disp('	Step 3: Control method friction');
++end %}}}
++
++if any(steps==3) %{{{
++	disp('   Step 3: Control method friction');
+ 	md=loadmodel('JksPar');
+ 
+ 	md=setflowequation(md,'SSA','all');
+@@ -65,11 +67,12 @@
+ 	%Go solve
+ 	md.cluster=generic('name',oshostname,'np',4);
+ 	md=solve(md,'Stressbalance');
+-	
++
+ 	save JksControl md
+-end 
+-if any(steps==4)
+-	disp('	Plotting')
++end %}}}
++
++if any(steps==4) %{{{
++	disp('   Plotting')
+ 	md=loadmodel('JksControl');
+ 
+ 	plotmodel(md,'unit#all','km','axis#all','equal',...
+@@ -81,4 +84,4 @@
+ 		'data',md.results.StressbalanceSolution.FrictionCoefficient,...
+ 		'title','Friction Coefficient',...
+ 		'colorbartitle#3','(m)');
+-end
++end %}}}
+Index: ../trunk-jpl/examples/LcurveAnalysis/runme.m
+===================================================================
+--- ../trunk-jpl/examples/LcurveAnalysis/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/LcurveAnalysis/runme.m	(revision 25915)
+@@ -1,5 +1,6 @@
+-step=[1];
+-if any(step==1)
++steps=[1];
++
++if any(steps==1) %{{{
+ 	% Generate observations
+ 	md = model;
+ 	md = triangle(md,'DomainOutline.exp',100000);
+@@ -11,8 +12,9 @@
+ 	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'title','"True" B',...
+ 		'data',md.results.StressbalanceSolution.Vel,'title','"observed velocities"')
+ 	save model1 md
+-end
+-if any(step==2)
++end %}}}
++
++if any(steps==2) %{{{
+ 	% Modify rheology, now constant
+ 	loadmodel('model1.mat');
+ 	md.materials.rheology_B(:) = 1.8*10^8;
+@@ -27,8 +29,9 @@
+ 	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'title','B first guess',...
+ 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
+ 	save model2 md
+-end
+-if any(step==3)
++end %}}}
++
++if any(steps==3) %{{{
+ 	% Perform L-curve analysis for ice rigidity inversion
+ 	loadmodel('model2.mat');
+ 
+@@ -41,8 +44,8 @@
+ 	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);
+-	
++	md.verbose = verbose('solution',false,'control',true);
++
+ 	% Starting L-curve analysis:
+ 	%
+ 	% J = Jo + alpha*R.
+@@ -55,13 +58,13 @@
+ 	% 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);
++	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('------------------------------------------------------------');
+@@ -77,8 +80,8 @@
+ 	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
+-	
++	R = J(:,end-1)./alphas(:); % only the regularization term
++
+ 	% Tip:
+ 	% A rescale in the axes may be useful to visualize the L-curve.
+ 	%
+@@ -85,7 +88,7 @@
+ 	% 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 |
+@@ -99,11 +102,12 @@
+ 	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')
++		'FontSize',10,'HorizontalAlignment','left','VerticalAlignment','Middle')
+ 	xlabel('$\mathrm{log}(\mathcal{J}_0$)','Interpreter','latex')
+ 	ylabel('$\mathrm{log}(\mathcal{R})$','Interpreter','latex')
+-end
+-if any(step==4)
++end %}}}
++
++if any(steps==4) %{{{
+ 	%invert for ice rigidity
+ 	loadmodel('model2.mat');
+ 
+@@ -113,10 +117,10 @@
+ 	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);
++	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);
+@@ -123,4 +127,4 @@
+ 	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
++end %}}}
+Index: ../trunk-jpl/examples/Pig/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/Pig/runme.m	(revision 25915)
+@@ -1,41 +1,41 @@
+ steps=[1];
+ 
+-if any(steps==1)   %Mesh Generation #1
++if any(steps==1) %Mesh Generation #1 %{{{
+ 	%Mesh parameters
+ 	domain =['./DomainOutline.exp'];
+-	hinit=10000;   % element size for the initial mesh
+-	hmax=40000;    % maximum element size of the final mesh
+-	hmin=5000;     % minimum element size of the final mesh
+-	gradation=1.7; % maximum size ratio between two neighboring elements
+-	err=8;         % maximum error between interpolated and control field
++	hinit=10000;	% element size for the initial mesh
++	hmax=40000;		% maximum element size of the final mesh
++	hmin=5000;		% minimum element size of the final mesh
++	gradation=1.7;	% maximum size ratio between two neighboring elements
++	err=8;			% maximum error between interpolated and control field
+ 
+ 	% Generate an initial uniform mesh (resolution = hinit m)
+ 	md=bamg(model,'domain',domain,'hmax',hinit);
+ 
+ 	% Load Velocities
+-	nsidc_vel='../Data/Antarctica_ice_velocity.nc'; 	
++	nsidc_vel='../Data/Antarctica_ice_velocity.nc';
+ 
+ 	% Get necessary data to build up the velocity grid
+-	xmin    = ncreadatt(nsidc_vel,'/','xmin');
+-	ymax    = ncreadatt(nsidc_vel,'/','ymax');
+-	spacing = ncreadatt(nsidc_vel,'/','spacing');
+-	nx      = double(ncreadatt(nsidc_vel,'/','nx'));
+-	ny      = double(ncreadatt(nsidc_vel,'/','ny'));
+-	vx      = double(ncread(nsidc_vel,'vx'));
+-	vy      = double(ncread(nsidc_vel,'vy'));
++	xmin	= ncreadatt(nsidc_vel,'/','xmin');
++	ymax	= ncreadatt(nsidc_vel,'/','ymax');
++	spacing	= ncreadatt(nsidc_vel,'/','spacing');
++	nx		= double(ncreadatt(nsidc_vel,'/','nx'));
++	ny		= double(ncreadatt(nsidc_vel,'/','ny'));
++	vx		= double(ncread(nsidc_vel,'vx'));
++	vy		= double(ncread(nsidc_vel,'vy'));
+ 
+ 	% Read coordinates
+-	xmin = strtrim(xmin);  
+-	xmin = str2num(xmin(1:end-2)); 
+-	ymax = strtrim(ymax);  
+-	ymax = str2num(ymax(1:end-2));  
++	xmin = strtrim(xmin);
++	xmin = str2num(xmin(1:end-2));
++	ymax = strtrim(ymax);
++	ymax = str2num(ymax(1:end-2));
+ 	spacing = strtrim(spacing);
+-	spacing = str2num(spacing(1:end-2));  
++	spacing = str2num(spacing(1:end-2));
+ 
+ 	% Build the coordinates
+ 	x=xmin+(0:1:nx)'*spacing;
+ 	y=(ymax-ny*spacing)+(0:1:ny)'*spacing;
+-	
++
+ 	% Interpolate velocities onto coarse mesh
+ 	vx_obs=InterpFromGridToMesh(x,y,flipud(vx'),md.mesh.x,md.mesh.y,0);
+ 	vy_obs=InterpFromGridToMesh(x,y,flipud(vy'),md.mesh.x,md.mesh.y,0);
+@@ -44,27 +44,26 @@
+ 
+ 	% Adapt the mesh to minimize error in velocity interpolation
+ 	md=bamg(md,'hmax',hmax,'hmin',hmin,'gradation',gradation,'field',vel_obs,'err',err);
+-	
++
+ 	%ploting
+ 	plotmodel(md,'data','mesh')
+ 
+ 	% Save model
+ 	save ./Models/PIG_Mesh_generation md;
+-end
++end %}}}
+ 
+-if any(steps==2)  %Masks #2
++if any(steps==2) %Masks #2 %{{{
++	md = loadmodel('./Models/PIG_Mesh_generation');
+ 
+-	md = loadmodel('./Models/PIG_Mesh_generation');	
+-
+-	% Load SeaRISe dataset for Antarctica  
++	% Load SeaRISe dataset for Antarctica
+ 	% http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
+ 	searise='../Data/Antarctica_5km_withshelves_v0.75.nc';
+-	
++
+ 	%read thickness mask from SeaRISE
+ 	x1=double(ncread(searise,'x1'));
+ 	y1=double(ncread(searise,'y1'));
+ 	thkmask=double(ncread(searise,'thkmask'));
+-	
++
+ 	%interpolate onto our mesh vertices
+ 	groundedice=double(InterpFromGridToMesh(x1,y1,thkmask',md.mesh.x,md.mesh.y,0));
+ 	groundedice(groundedice<=0)=-1;
+@@ -76,25 +75,23 @@
+ 
+ 	%ploting
+ 	plotmodel(md,'data',md.mask.ocean_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
+-	
++
+ 	% Save model
+ 	save ./Models/PIG_SetMask md;
+-end
++end %}}}
+ 
+-if any(steps==3)  %Parameterization #3
+-
++if any(steps==3) %Parameterization #3 %{{{
+ 	md = loadmodel('./Models/PIG_SetMask');
+ 	md = parameterize(md,'./Pig.par');
+ 
+ 	% Use a MacAyeal flow model
+ 	md = setflowequation(md,'SSA','all');
+-	
++
+ 	% Save model
+ 	save ./Models/PIG_Parameterization md;
+-end
++end %}}}
+ 
+-if any(steps==4)  %Control Method #4
+-
++if any(steps==4) %Control Method #4 %{{{
+ 	md = loadmodel('./Models/PIG_Parameterization');
+ 
+ 	% Control general
+@@ -134,10 +131,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Control_drag md;
+-end
++end %}}}
+ 
+-if any(steps==5) %Plot #5
+-
++if any(steps==5) %Plot #5 %{{{
+ 	md = loadmodel('./Models/PIG_Control_drag');
+ 
+ 	plotmodel(md,...
+@@ -148,10 +144,9 @@
+ 		'colorbar#all','on','colorbartitle#1-2','(m/yr)',...
+ 		'caxis#1-2',([1.5,4000]),...
+ 		'colorbartitle#3','(m)', 'log#1-2',10);
+-end
++end %}}}
+ 
+-if any(steps==6)  %Higher-Order #6
+-
++if any(steps==6) %Higher-Order #6 %{{{
+ 	% Load Model
+ 
+ 	% Disable inversion
+@@ -164,10 +159,9 @@
+ 
+ 	% Save Model
+ 
+-end
++end % step 6 end
+ 
+-if any(steps==7)  %Plot #7
+-
++if any(steps==7) %Plot #7 %{{{
+ 	mdHO = loadmodel('./Models/PIG_ModelHO');
+ 	mdSSA = loadmodel('./Models/PIG_Control_drag');
+ 
+@@ -175,14 +169,14 @@
+ 	surf=find(mdHO.mesh.vertexonsurface);
+ 
+ 	plotmodel(mdHO,'nlines',3,'ncols',2,'axis#all','equal',...
+-						'data',mdHO.initialization.vel,'title','Observed velocity',...
+-						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
+-						'data',mdSSA.results.StressbalanceSolution.Vel,'title','Modeled SSA Velocity',...
+-						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdSSA.results.StressbalanceSolution.Vel),'title','(HO-SSA) velocities',...
+-						'data',mdHO.results.StressbalanceSolution.Vel,'title','Modeled HO surface Velocities',...
+-						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.results.StressbalanceSolution.Vel(basal)),'title','(HOsurf-HO base) velocities',...
+-						'caxis#1',([1.5,4000]),'caxis#3',([1.5,4000]),'caxis#5',([1.5,4000]),...
+-						'colorbar#all','on','view#all',2,...
+-						'colorbartitle#all','(m/yr)',...
+-						'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
+-end
++		'data',mdHO.initialization.vel,'title','Observed velocity',...
++		'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
++		'data',mdSSA.results.StressbalanceSolution.Vel,'title','Modeled SSA Velocity',...
++		'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdSSA.results.StressbalanceSolution.Vel),'title','(HO-SSA) velocities',...
++		'data',mdHO.results.StressbalanceSolution.Vel,'title','Modeled HO surface Velocities',...
++		'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.results.StressbalanceSolution.Vel(basal)),'title','(HOsurf-HO base) velocities',...
++		'caxis#1',([1.5,4000]),'caxis#3',([1.5,4000]),'caxis#5',([1.5,4000]),...
++		'colorbar#all','on','view#all',2,...
++		'colorbartitle#all','(m/yr)',...
++		'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
++end %}}}
+Index: ../trunk-jpl/examples/Pig2/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig2/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/Pig2/runme.m	(revision 25915)
+@@ -1,32 +1,32 @@
+-steps=1;
++steps=[1];
+ 
+-if any(steps==1) %Mesh Generation #1
++if any(steps==1) %Mesh Generation #1 %{{{
+ 
+ 	%Mesh parameters
+ 	domain =['./DomainOutline.exp'];
+-	hinit=5000;   % element size for the initial mesh
+-	hmax=40000;    % maximum element size of the final mesh
+-	hmin=4000;     % minimum element size of the final mesh
+-	gradation=1.7; % maximum size ratio between two neighboring elements
+-	err=8;         % maximum error between interpolated and control field
++	hinit=5000;		% element size for the initial mesh
++	hmax=40000;		% maximum element size of the final mesh
++	hmin=4000;		% minimum element size of the final mesh
++	gradation=1.7;	% maximum size ratio between two neighboring elements
++	err=8;			% maximum error between interpolated and control field
+ 
+ 	% Generate an initial uniform mesh (resolution = hinit m)
+ 	md=bamg(model,'domain',domain,'hmax',hinit);
+ 
+ 	% Get necessary data to build up the velocity grid
+-	nsidc_vel='../Data/Antarctica_ice_velocity.nc'; 	
+-	xmin    = strsplit(ncreadatt(nsidc_vel,'/','xmin'));      xmin    = str2num(xmin{2});
+-	ymax    = strsplit(ncreadatt(nsidc_vel,'/','ymax'));      ymax    = str2num(ymax{2});
+-	spacing = strsplit(ncreadatt(nsidc_vel,'/','spacing'));   spacing = str2num(spacing{2});
+-	nx      = double(ncreadatt(nsidc_vel,'/','nx'));
+-	ny      = double(ncreadatt(nsidc_vel,'/','ny'));
+-	vx      = double(ncread(nsidc_vel,'vx'));
+-	vy      = double(ncread(nsidc_vel,'vy'));
++	nsidc_vel	='../Data/Antarctica_ice_velocity.nc';
++	xmin		= strsplit(ncreadatt(nsidc_vel,'/','xmin'));	xmin	= str2num(xmin{2});
++	ymax		= strsplit(ncreadatt(nsidc_vel,'/','ymax'));	ymax	= str2num(ymax{2});
++	spacing		= strsplit(ncreadatt(nsidc_vel,'/','spacing'));	spacing	= str2num(spacing{2});
++	nx			= double(ncreadatt(nsidc_vel,'/','nx'));
++	ny			= double(ncreadatt(nsidc_vel,'/','ny'));
++	vx			= double(ncread(nsidc_vel,'vx'));
++	vy			= double(ncread(nsidc_vel,'vy'));
+ 
+ 	% Build the coordinates
+ 	x=xmin+(0:1:nx)'*spacing;
+ 	y=(ymax-ny*spacing)+(0:1:ny)'*spacing;
+-	
++
+ 	% Interpolate velocities onto coarse mesh
+ 	vx_obs=InterpFromGridToMesh(x,y,flipud(vx'),md.mesh.x,md.mesh.y,0);
+ 	vy_obs=InterpFromGridToMesh(x,y,flipud(vy'),md.mesh.x,md.mesh.y,0);
+@@ -39,20 +39,19 @@
+ 	% Plot and save model
+ 	plotmodel(md,'data','mesh')
+ 	save ./Models/PIG_Mesh_generation md;
+-end
++end %}}}
+ 
+-if any(steps==2)  %Masks #2
++if any(steps==2) %Masks #2 %{{{
++	md = loadmodel('./Models/PIG_Mesh_generation');
+ 
+-	md = loadmodel('./Models/PIG_Mesh_generation');	
+-
+ 	% Load SeaRISe dataset for Antarctica  http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
+ 	searise='../Data/Antarctica_5km_withshelves_v0.75.nc';
+-	
++
+ 	%read thickness mask from SeaRISE
+ 	x1=double(ncread(searise,'x1'));
+ 	y1=double(ncread(searise,'y1'));
+ 	thkmask=double(ncread(searise,'thkmask'));
+-	
++
+ 	%interpolate onto our mesh vertices
+ 	groundedice=double(InterpFromGridToMesh(x1,y1,thkmask',md.mesh.x,md.mesh.y,0));
+ 	groundedice(groundedice<=0)=-1;
+@@ -63,21 +62,19 @@
+ 	md.mask.ice_levelset=-1*ones(md.mesh.numberofvertices,1);%ice is present when negatvie
+ 
+ 	plotmodel(md,'data',md.mask.ocean_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
+-	
++
+ 	save ./Models/PIG_SetMask md;
+-end
++end %}}}
+ 
+-if any(steps==3)  %Parameterization #3
+-
++if any(steps==3) %Parameterization #3 %{{{
+ 	md = loadmodel('./Models/PIG_SetMask');
+ 	md = setflowequation(md,'SSA','all');
+ 	md = parameterize(md,'./Pig.par');
+-	
++
+ 	save ./Models/PIG_Parameterization md;
+-end
++end %}}}
+ 
+-if any(steps==4)  %Rheology B inversion
+-
++if any(steps==4) %Rheology B inversion %{{{
+ 	md = loadmodel('./Models/PIG_Parameterization');
+ 
+ 	% Control general
+@@ -119,10 +116,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Control_B md;
+-end
++end %}}}
+ 
+-if any(steps==5)  %drag inversion
+-
++if any(steps==5) %drag inversion %{{{
+ 	md = loadmodel('./Models/PIG_Control_B');
+ 
+ 	% Cost functions
+@@ -152,10 +148,11 @@
+ 		'colorbar#all','on','colorbartitle#1-2','(m/yr)',...
+ 		'caxis#1-2',([1.5,4000]),...
+ 		'colorbartitle#3','(m)', 'log#1-2',10);
++
+ 	save ./Models/PIG_Control_drag md;
+-end
++end %}}}
+ 
+-if any(steps==6) %Transient Run #1
++if any(steps==6) %Transient Run #1 %{{{
+ 
+ 	md = loadmodel('./Models/PIG_Control_drag');	
+ 
+@@ -182,7 +179,7 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Transient md;
+-end
++end %}}}
+ 
+ if any(steps==7) %High Melt #2
+ 	md = loadmodel('./Models/PIG_Transient');	
+@@ -195,9 +192,9 @@
+ 	plot(time,[V_control',V_melt']); legend({'Control run','High melt'});
+ 
+ 	save ./Models/PIG_HighMelt md;
+-end
++end %}}}
+ 
+-if any(steps==8) %Ice Front retreat
++if any(steps==8) %Ice Front retreat %{{{
+ 	md = loadmodel('./Models/PIG_Transient');	
+ 
+ 	pos = find(ContourToNodes(md.mesh.x,md.mesh.y,'FrontRetreat.exp',2));
+@@ -208,9 +205,9 @@
+ 	plot(time,[V_control',V_melt',V_retreat']); legend({'Control run','High melt','Retreat'});
+ 
+ 	save ./Models/PIG_FrontRetreat md;
+-end
++end %}}}
+ 
+-if any(steps==9) %High surface mass balance #3
++if any(steps==9) %High surface mass balance #3 %{{{
+ 	%Load model from PIG_Transient
+ 	%...
+ 
+@@ -228,4 +225,4 @@
+ 
+ 	%Save model
+ 	save ./Models/PIG_SMB md;
+-end
++end %}}}
+Index: ../trunk-jpl/examples/PigSensitivity/runme.m
+===================================================================
+--- ../trunk-jpl/examples/PigSensitivity/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/PigSensitivity/runme.m	(revision 25915)
+@@ -1,9 +1,12 @@
+-steps=[1];
++steps=[1:4];
+ 
+-if any(steps==1) %Transient Run #1
++try
+ 
+-	md = loadmodel('../Pig/Models/PIG_Control_drag');	
+ 
++if any(steps==1) %Transient Run #1 %{{{
++
++	md = loadmodel('../Pig/Models/PIG_Control_drag');
++
+ 	md.inversion.iscontrol=0;
+ 	md.transient.ismasstransport=1;
+ 	md.transient.isstressbalance=1;
+@@ -10,11 +13,11 @@
+ 	md.transient.isgroundingline=1;
+ 	md.transient.ismovingfront=0;
+ 	md.transient.isthermal=0;
+-	
++
+ 	pos=find(md.mask.ocean_levelset<0);
+ 	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ 	md.basalforcings.floatingice_melting_rate=25*ones(md.mesh.numberofvertices,1);
+-	
++
+ 	md.timestepping.time_step=0.1;
+ 	md.timestepping.final_time=10;
+ 	md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation'};
+@@ -23,14 +26,14 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Transient md;
+-end
++end %}}}
+ 
+-if any(steps==2) %High Melt #2
+-	md = loadmodel('./Models/PIG_Transient');	
++if any(steps==2) %High Melt #2 %{{{
++	md = loadmodel('./Models/PIG_Transient');
+ 
+ 	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ 	md.basalforcings.floatingice_melting_rate=60*ones(md.mesh.numberofvertices,1);
+-	
++
+ 	md.timestepping.time_step=0.1;
+ 	md.timestepping.final_time=10;
+ 	md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation'};
+@@ -38,10 +41,10 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save ./Models/PIG_HighMelt md;
+-end
++end %}}}
+ 
+-if any(steps==3) %Ice Front retreat
+-	md = loadmodel('./Models/PIG_Transient');	
++if any(steps==3) %Ice Front retreat %{{{
++	md = loadmodel('./Models/PIG_Transient');
+ 
+ 	md2=extract(md,'~FrontRetreat.exp');
+ 
+@@ -57,13 +60,14 @@
+ 	md2=solve(md2,'Transient');
+ 
+ 	save ./Models/PIG_FrontRetreat md2;
+-end
++end %}}}
+ 
+-if any(steps==4) %High surface mass balance #3
++if any(steps==4)
++ disp('Needs work!') %High surface mass balance #3 %{{{
+ 	%Load model
+ 
+ 	%Change external forcing basal melting rate and surface mass balance)
+-	
++
+ 	%Refine time steps and time span of the simulation
+ 
+ 	%Request additional outputs
+@@ -72,4 +76,4 @@
+ 
+ 	%Save model
+ 
+-end
++end %}}}
+Index: ../trunk-jpl/examples/SlrFarrell/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrFarrell/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/SlrFarrell/runme.m	(revision 25915)
+@@ -1,39 +1,39 @@
+-
+ clear all;
+ 
+-steps=[1]; % [1:5] 
++steps=[1:5];
+ 
+-if any(steps==1) 
++try
++ % [1:5]
++
++if any(steps==1) %{{{
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	numrefine=1;
+-	resolution=150*1e3;			% inital resolution [m] 
++	resolution=150*1e3;			% inital resolution [m]
+ 	radius = 6.371012*10^6;		% mean radius of Earth, m
+-	mindistance_coast=150*1e3;	% coastal resolution [m] 
++	mindistance_coast=150*1e3;	% coastal resolution [m]
+ 	mindistance_land=300*1e3;	% resolution on the continents [m]
+-	maxdistance=600*1e3;			% max element size (on mid-oceans) [m]
++	maxdistance=600*1e3;		% max element size (on mid-oceans) [m]
+ 
+-	md=model; 
+-	md.mask=maskpsl(); 
+-	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km] 
++	md=model;
++	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km]
+ 
+ 	for i=1:numrefine,
++		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
+-
+ 		distance=zeros(md.mesh.numberofvertices,1);
+ 
+-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);  
+-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);  
++		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);
++		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);
+ 
+ 		for j=1:md.mesh.numberofvertices
+-			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi; 
++			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+ 			if md.mask.ocean_levelset(j),
+-				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi; 
++				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+ 			else
+-				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi; 
++				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+ 			end
+@@ -40,53 +40,46 @@
+ 			distance(j)=min(d);
+ 		end
+ 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+-		
+-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land); 
+-		distance(pos2)=mindistance_land; 
+ 
+-		dist=min(maxdistance,distance); 
++		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land);
++		distance(pos2)=mindistance_land;
++
++		dist=min(maxdistance,distance);
+ 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
+-
+ 	end
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
++	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 	save ./Models/SlrFarrell_Mesh md;
+-	
++
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
++end %}}}
+ 
+-end 
+-
+-if any(steps==2) 
++if any(steps==2) %{{{
+ 	disp('   Step 2: Define source as in Farrell, 1972, Figure 1');
+ 	md = loadmodel('./Models/SlrFarrell_Mesh');
+ 
+-	md.slr.sealevel=md.mask.ocean_levelset; % 1 m SLR everywhere 
+-	
++	md.slr.sealevel=md.mask.ocean_levelset; % 1 m SLR everywhere
+ 	md.slr.deltathickness=zeros(md.mesh.numberofelements,1);
+ 	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
+ 
+-	save ./Models/SlrFarrell_Loads md; 
+-	
++	save ./Models/SlrFarrell_Loads md;
++
+ 	plotmodel (md,'data',md.slr.sealevel,'view',[90 90],'title#all','Initial sea-level [m]');
++end %}}}
+ 
+-end 
+-
+-if any(steps==3) 
++if any(steps==3) %{{{
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/SlrFarrell_Loads');
+ 
+-	nlove=10001;	
+-	md.slr.love_h = love_numbers('h','CM'); md.slr.love_h(nlove+1:end)=[];
+-	md.slr.love_k = love_numbers('k','CM'); md.slr.love_k(nlove+1:end)=[];
+-	md.slr.love_l = love_numbers('l','CM'); md.slr.love_l(nlove+1:end)=[];
++	md.solidearth.lovenumbers=lovenumbers('maxdeg',10000);
+ 
+-	md.mask.land_levelset = 1-md.mask.ocean_levelset; 
+-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 
+-	md.mask.ocean_levelset = -ones(md.mesh.numberofvertices,1); 
++	md.mask.land_levelset = 1-md.mask.ocean_levelset;
++	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
++	md.mask.ocean_levelset = -ones(md.mesh.numberofvertices,1);
+ 	pos=find(md.mesh.lat <-80);
+-	md.mask.ice_levelset(pos(1))=-1; % ice yes!  
+-	md.mask.ocean_levelset(pos(1))=1; % ice grounded!  
++	md.mask.ice_levelset(pos(1))=-1; % ice yes!
++	md.mask.ocean_levelset(pos(1))=1; % ice grounded!
+ 
+ 	di=md.materials.rho_ice/md.materials.rho_water;
+ 	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+@@ -93,68 +86,64 @@
+ 	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+ 	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+ 	md.geometry.bed=md.geometry.base;
+-	
++
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-	
++
+ 	md.miscellaneous.name='SlrFarrell';
+-	
+-	save ./Models/SlrFarrell_Parameterization md; 
+ 
+-end 
++	save ./Models/SlrFarrell_Parameterization md;
++end %}}}
+ 
+-if any(steps==4) 
++if any(steps==4) %{{{
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrFarrell_Parameterization');
+ 
+-	md.cluster=generic('name',oshostname(),'np',3); 
++	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+-	md.slr.reltol = 0.1/100; % per cent change in solution 
++	md.slr.reltol = 0.1/100; % percent change in solution
+ 
+ 	md=solve(md,'Slr');
+ 
+-	save ./Models/SlrFarrell_Solution md; 
++	save ./Models/SlrFarrell_Solution md;
++end %}}}
+ 
+-end 
+-
+-if any(steps==5) 
++if any(steps==5) %{{{
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/SlrFarrell_Solution');
+ 
+-	sol = md.results.SealevelriseSolution.Sealevel*100; % per cent normalized by GMSL (which 1 m)  
++	sol = md.results.SealevelriseSolution.Sealevel*100; % per cent normalized by GMSL (which 1 m)
+ 
+ 	res = 1; % [degree]
+ 
+ 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
+-	sol_grid = zeros(size(lat_grid)); 
++	sol_grid = zeros(size(lat_grid));
+ 
+-	F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol); 
+-	F.Method = 'linear'; 
+-	F.ExtrapolationMethod = 'linear'; 
+-	
++	F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
++	F.Method = 'linear';
++	F.ExtrapolationMethod = 'linear';
++
+ 	sol_grid = F(lat_grid, lon_grid);
+-	sol_grid(isnan(sol_grid))=0; 
+-	sol_grid(lat_grid>85 & sol_grid==0) =NaN; 
++	sol_grid(isnan(sol_grid))=0;
++	sol_grid(lat_grid>85 & sol_grid==0)=NaN;
+ 
+ 	set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+-	figure1=figure('Position', [100, 100, 1000, 500]); 
+-	gcf; load coast; cla; 
++	figure1=figure('Position', [100, 100, 1000, 500]);
++	gcf; load coast; cla;
+ 	pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+ 	[C,h]=contour(lon_grid,lat_grid,sol_grid,[96 98 100 102 104 105],'-k','linewidth',2);
+-	clabel(C,h,'FontSize',18,'Color','red','LabelSpacing',500); 
+-	geoshow(lat,long,'DisplayType','polygon','FaceColor',[.82 .82 .82]); 
+-	plot(long,lat,'k'); hold off; 
++	clabel(C,h,'FontSize',18,'Color','red','LabelSpacing',500);
++	geoshow(lat,long,'DisplayType','polygon','FaceColor',[.82 .82 .82]);
++	plot(long,lat,'k'); hold off;
+ 	c1=colorbar;
+-	colormap(flipud(haxby)); 
+-	caxis([96 105]); 
+-	xlim([-170 170]); 
+-	ylim([-85 85]); 
+-	grid on; 
+-	title('Relative sea-level [% of GMSL]'); 
++	colormap(flipud(haxby));
++	caxis([96 105]);
++	xlim([-170 170]);
++	ylim([-85 85]);
++	grid on;
++	title('Relative sea-level [% of GMSL]');
+ 	set(gcf,'color','w');
+-	%export_fig('Fig5.pdf'); 
+-
+-end 
+-
++	%export_fig('Fig5.pdf');
++end %}}}
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25915)
+@@ -1,40 +1,41 @@
+-
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1]; % [1:7]
++steps=[1:7];
+ 
+-if any(steps==1) 
++try
++ % [1:7]
++
++if any(steps==1) %{{{
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	numrefine=1;
+-	resolution=150*1e3;			% inital resolution [m] 
++	resolution=150*1e3;			% inital resolution [m]
+ 	radius = 6.371012*10^6;		% mean radius of Earth, m
+-	mindistance_coast=150*1e3;	% coastal resolution [m] 
++	mindistance_coast=150*1e3;	% coastal resolution [m]
+ 	mindistance_land=300*1e3;	% resolution on the continents [m]
+-	maxdistance=600*1e3;			% max element size (on mid-oceans) [m]
++	maxdistance=600*1e3;		% max element size (on mid-oceans) [m]
+ 
+-	md=model; 
+-	md.mask=maskpsl(); 
+-	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km] 
++	md=model;
++	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km]
+ 
+ 	for i=1:numrefine,
+ 
+-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
++		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 		distance=zeros(md.mesh.numberofvertices,1);
+ 
+-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);  
+-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);  
++		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
++		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
+ 
+ 		for j=1:md.mesh.numberofvertices
+-			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi; 
++			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+ 			if md.mask.ocean_levelset(j),
+-				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi; 
++				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+ 			else
+-				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi; 
++				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+ 			end
+@@ -42,53 +43,47 @@
+ 		end
+ 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+ 		
+-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land); 
+-		distance(pos2)=mindistance_land; 
++		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land);
++		distance(pos2)=mindistance_land;
+ 
+-		dist=min(maxdistance,distance); 
++		dist=min(maxdistance,distance);
+ 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
+-
+ 	end
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
++	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 	save ./Models/SlrGRACE_Mesh md;
+-	
++
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
++end %}}}
+ 
+-end 
+-
+-if any(steps==2) 
++if any(steps==2) %{{{
+ 	disp('   Step 2: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/SlrGRACE_Mesh');
+ 
+ 	year_month = 2007+15/365;
+-	time_range = [year_month year_month]; 
+-	
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
+-	
+-	md.slr.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice; 
++	time_range = [year_month year_month];
+ 
+-	save ./Models/SlrGRACE_Loads md; 
+-	
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
++
++	md.slr.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++
++	save ./Models/SlrGRACE_Loads md;
++
+ 	plotmodel (md,'data',md.slr.deltathickness,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');
++end %}}}
+ 
+-end 
+-
+-if any(steps==3) 
++if any(steps==3) %{{{
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/SlrGRACE_Loads');
+ 
+-	nlove=10001;
+-	md.slr.love_h = love_numbers('h','CM'); md.slr.love_h(nlove+1:end)=[];
+-	md.slr.love_k = love_numbers('k','CM'); md.slr.love_k(nlove+1:end)=[];
+-	md.slr.love_l = love_numbers('l','CM'); md.slr.love_l(nlove+1:end)=[];
++	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+ 
+-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 
+-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 
++	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
++	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
+ 	pos=find(md.slr.deltathickness~=0);
+-	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 
+-	md.mask.land_levelset = 1-md.mask.ocean_levelset; 
++	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
++	md.mask.land_levelset = 1-md.mask.ocean_levelset;
+ 
+ 	md.slr.sealevel=zeros(md.mesh.numberofvertices,1);
+ 	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
+@@ -99,207 +94,201 @@
+ 	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+ 	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+ 	md.geometry.bed=md.geometry.base;
+-	
++
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-	
++
+ 	md.miscellaneous.name='SlrGRACE';
+-	
+-	save ./Models/SlrGRACE_Parameterization md; 
+ 
+-end 
++	save ./Models/SlrGRACE_Parameterization md;
++end %}}}
+ 
+-if any(steps==4) 
++if any(steps==4) %{{{
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+-	md.slr.rigid=1; 
+-	md.slr.elastic=1; 
++	md.slr.rigid=1;
++	md.slr.elastic=1;
+ 	md.slr.rotation=1;
+ 
+-	md.cluster=generic('name',oshostname(),'np',3); 
++	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+ 	md=solve(md,'Slr');
+ 
+-	save ./Models/SlrGRACE_Solution md; 
++	save ./Models/SlrGRACE_Solution md;
++end %}}}
+ 
+-end 
+-
+-if any(steps==5) 
++if any(steps==5) %{{{
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+-	sol1 = md.slr.deltathickness*100;							% [cm] 
+-	sol2 = md.results.SealevelriseSolution.Sealevel*1000; % [mm] 
+-	
+-	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'}; 
+-	fig_name={'Fig_dH.pdf','Fig_slr.pdf'}; 
++	sol1 = md.slr.deltathickness*100;						% [cm]
++	sol2 = md.results.SealevelriseSolution.Sealevel*1000;	% [mm]
+ 
+-	res = 1.0; 
++	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
++	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+ 
++	res = 1.0;
++
+ 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
+-	sol_grid = zeros(size(lat_grid)); 
++	sol_grid = zeros(size(lat_grid));
+ 
+ 	for kk=1:2
+ 		sol=eval(sprintf('sol%d',kk));
+-	
+-		if length(sol)==md.mesh.numberofelements 
++
++		if length(sol)==md.mesh.numberofelements
+ 			for jj=1:md.mesh.numberofelements
+ 				ii=(jj-1)*3;
+ 				pp(ii+1:ii+3)=md.mesh.elements(jj,:);
+ 			end
+ 			for jj=1:md.mesh.numberofvertices
+-				pos=ceil(find(pp==jj)/3); 
+-				temp(jj)=mean(sol(pos)); 
++				pos=ceil(find(pp==jj)/3);
++				temp(jj)=mean(sol(pos));
+ 			end
+-			sol=temp'; 
+-		end 
++			sol=temp';
++		end
+ 
+-		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol); 
++		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
+ 		F.Method = 'linear';
+-		F.ExtrapolationMethod = 'linear'; 
++		F.ExtrapolationMethod = 'linear';
+ 		
+ 		sol_grid = F(lat_grid, lon_grid);
+-		sol_grid(isnan(sol_grid))=0; 
+-		sol_grid(lat_grid>85 & sol_grid==0) = NaN; 
++		sol_grid(isnan(sol_grid))=0;
++		sol_grid(lat_grid>85 & sol_grid==0) = NaN;
+ 
+ 		set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+-		figure1=figure('Position', [100, 100, 1000, 500]); 
+-		gcf; load coast; cla; 
++		figure1=figure('Position', [100, 100, 1000, 500]);
++		gcf; load coast; cla;
+ 		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+ 		if (kk==1)
+-			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white'); 
++			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
+ 		else
+-			geoshow(lat,long,'DisplayType','polygon','FaceColor','white'); 
+-		end 
+-		plot(long,lat,'k'); hold off; 
++			geoshow(lat,long,'DisplayType','polygon','FaceColor','white');
++		end
++		plot(long,lat,'k'); hold off;
+ 		c1=colorbar;
+-		colormap('haxby'); 
+-		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]); 
+-		xlim([-180 180]); 
+-		ylim([-90 90]); 
+-		grid on; 
+-		title(sol_name(kk)); 
++		colormap('haxby');
++		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]);
++		xlim([-180 180]);
++		ylim([-90 90]);
++		grid on;
++		title(sol_name(kk));
+ 		set(gcf,'color','w');
+-		%export_fig(fig_name{kk}); 
++		%export_fig(fig_name{kk});
+ 	end
++end %}}}
+ 
+-end 
+-
+-if any(steps==6) 
++if any(steps==6) %{{{
+ 	disp('   Step 6: Transient run');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+ 	disp('Projecting  loads onto the mesh...');
+-	time_range = 2007 + [15 350]/365; 
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
++	time_range = 2007 + [15 350]/365;
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+ 
+-	[ne,nt]=size(water_load); 
+-   md.slr.deltathickness = zeros(ne+1,nt);
+-	md.slr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice; 
+-	md.slr.deltathickness(ne+1,:)=[1:nt]; % times 
+-	
++	[ne,nt]=size(water_load);
++	md.slr.deltathickness = zeros(ne+1,nt);
++	md.slr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++	md.slr.deltathickness(ne+1,:)=[1:nt]; % times
++
+ 	md.transient.issmb=0;
+-	md.transient.ismasstransport=0; 
+-	md.transient.isstressbalance=0; 
++	md.transient.ismasstransport=0;
++	md.transient.isstressbalance=0;
+ 	md.transient.isthermal=0;
+ 	md.transient.isslr=1;
+-	
++
+ 	md.timestepping.start_time=-1;
+-   md.timestepping.final_time=nt; 
+-	md.timestepping.time_step=1; 
+-   md.timestepping.interp_forcings=0;
++	md.timestepping.final_time=nt;
++	md.timestepping.time_step=1;
++	md.timestepping.interp_forcings=0;
+ 	md.settings.output_frequency=1;
+ 
+-	md.cluster=generic('name',oshostname(),'np',3); 
++	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+ 	md=solve(md,'tr');
+ 
+-	save ./Models/SlrGRACE_Transient md; 
++	save ./Models/SlrGRACE_Transient md;
++end %}}}
+ 
+-end 
+-
+-if any(steps==7) 
++if any(steps==7) %{{{
+ 	disp('   Step 7: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+-	time = md.slr.deltathickness(end,:); 
++	time = md.slr.deltathickness(end,:);
+ 
+ 	for tt=1:length(time)
+ 		gmsl(tt) = md.results.TransientSolution(tt).SealevelEustatic*1000;	% GMSL rate mm/yr
+-		sol1(:,tt) = md.slr.deltathickness(1:end-1,tt)*100;						% ice equivalent height [cm/yr] 
+-	   sol2(:,tt) = md.results.TransientSolution(tt+1).Sealevel*1000;			% mm/yr
++		sol1(:,tt) = md.slr.deltathickness(1:end-1,tt)*100;					% ice equivalent height [cm/yr]
++		sol2(:,tt) = md.results.TransientSolution(tt+1).Sealevel*1000;		% mm/yr
+ 	end
+-	sol_name = {'Change in water equivalent height [cm]', 'Relative sea-level [mm]'}; 
+-	movie_name = {'Movie_dH.avi','Movie_slr.avi'}; 
++	sol_name = {'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
++	movie_name = {'Movie_dH.avi','Movie_slr.avi'};
+ 
+-	res = 1.0; 
++	res = 1.0;
+ 
+ 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
+-	sol_grid = zeros(size(lat_grid)); 
++	sol_grid = zeros(size(lat_grid));
+ 
+ 	for kk=1:2
+ 		sol=eval(sprintf('sol%d',kk));
+-	
+-		if length(sol)==md.mesh.numberofelements 
++
++		if length(sol)==md.mesh.numberofelements
+ 			for jj=1:md.mesh.numberofelements
+ 				ii=(jj-1)*3;
+ 				pp(ii+1:ii+3)=md.mesh.elements(jj,:);
+ 			end
+ 			for jj=1:md.mesh.numberofvertices
+-				pos=ceil(find(pp==jj)/3); 
+-				temp2(jj,:)=mean(sol(pos,:)); 
++				pos=ceil(find(pp==jj)/3);
++				temp2(jj,:)=mean(sol(pos,:));
+ 			end
+-			sol=temp2; 
+-		end 
++			sol=temp2;
++		end
+ 
+-		vidObj = VideoWriter(movie_name{kk}); 
+-		vidObj.FrameRate=2; % frames per second 
++		vidObj = VideoWriter(movie_name{kk});
++		vidObj.FrameRate=2; % frames per second
+ 		open(vidObj);
+ 
+ 		for jj=1:length(time)
+-			F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol(:,jj)); 
++			F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol(:,jj));
+ 			F.Method = 'linear';
+-			F.ExtrapolationMethod = 'linear'; 
++			F.ExtrapolationMethod = 'linear';
+ 			
+ 			sol_grid = F(lat_grid, lon_grid);
+-			sol_grid(isnan(sol_grid))=0; 
+-			sol_grid(lat_grid>85 & sol_grid==0) = NaN; 
++			sol_grid(isnan(sol_grid))=0;
++			sol_grid(lat_grid>85 & sol_grid==0) = NaN;
+ 
+ 			set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+-			figure1=figure('Position', [100, 100, 1000, 500]); 
+-			gcf; load coast; cla; 
++			figure1=figure('Position', [100, 100, 1000, 500]);
++			gcf; load coast; cla;
+ 			pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+ 			if (kk==1)
+-				geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white'); 
++				geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
+ 			else
+-				geoshow(lat,long,'DisplayType','polygon','FaceColor','white'); 
+-			end 
+-			plot(long,lat,'k'); hold off; 
++				geoshow(lat,long,'DisplayType','polygon','FaceColor','white');
++			end
++			plot(long,lat,'k'); hold off;
+ 			c1=colorbar;
+-			colormap('haxby'); 
+-			caxis([-floor(min(abs(min(min(sol))),abs(max(max(sol))))) floor(min(abs(min(min(sol))),abs(max(max(sol)))))]); 
+-			xlim([-180 180]); 
+-			ylim([-90 90]); 
+-			grid on; 
+-			title(sol_name(kk)); 
++			colormap('haxby');
++			caxis([-floor(min(abs(min(min(sol))),abs(max(max(sol))))) floor(min(abs(min(min(sol))),abs(max(max(sol)))))]);
++			xlim([-180 180]);
++			ylim([-90 90]);
++			grid on;
++			title(sol_name(kk));
+ 			set(gcf,'color','w');
+-			writeVideo(vidObj,getframe(gcf)); 
+-			close 
++			writeVideo(vidObj,getframe(gcf));
++			close
+ 		end
+ 		close(vidObj);
+ 	end
+-	!open *.avi; 
+-	
+-	% plot GMSL time series 
+-	plot(time,gmsl,'-*','linewidth',3); grid on; 
+-	xlabel('# month'); 
++	!open *.avi;
++
++	% plot GMSL time series
++	plot(time,gmsl,'-*','linewidth',3); grid on;
++	xlabel('# month');
+ 	ylabel('GMSL [mm/yr]');
+ 	set(gcf,'color','w');
+ 	%export_fig('Fig7.pdf');
+-
+-end 
+-
++end %}}}
+Index: ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 25915)
+@@ -1,59 +1,58 @@
+-
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1]; % [1:8]
++steps=[1:8];
+ 
+-if any(steps==1) 
++try
++ % [1:8]
++
++if any(steps==1) %{{{
+ 	disp('   Step 1: Global mesh creation');
+ 
+-	resolution=300;			% [km] 
+-	radius = 6.371012*10^3;	% [km] 
++	resolution=300;			% [km]
++	radius = 6.371012*10^3;	% [km]
+ 
+-	md=model; 
+-	md.mask=maskpsl(); 
++	md=model;
+ 	md.mesh=gmshplanet('radius',radius,'resolution',resolution);
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
++	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 	save ./Models/SlrGRACE_Mesh md;
+-	
++
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
++end %}}}
+ 
+-end 
+-
+-if any(steps==2) 
++if any(steps==2) %{{{
+ 	disp('   Step 2: Global mesh creation: refined coastlines');
+ 
+ 	numrefine=1;
+-	resolution=150*1e3;			% inital resolution [m] 
++	resolution=150*1e3;			% inital resolution [m]
+ 	radius = 6.371012*10^6;		% mean radius of Earth, m
+-	mindistance_coast=150*1e3;	% coastal resolution [m] 
+-	mindistance_source=75*1e3; % source resolution [m] 
++	mindistance_coast=150*1e3;	% coastal resolution [m]
++	mindistance_source=75*1e3;	% source resolution [m]
+ 	mindistance_land=300*1e3;	% resolution on the continents [m]
+-	maxdistance=600*1e3;			% max element size (on mid-oceans) [m]
++	maxdistance=600*1e3;		% max element size (on mid-oceans) [m]
+ 
+-	md=model; 
+-	md.mask=maskpsl(); 
+-	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km] 
++	md=model;
++	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km]
+ 
+ 	for i=1:numrefine,
+ 
+-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
++		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 		distance=zeros(md.mesh.numberofvertices,1);
+ 
+-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);  
+-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);  
++		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
++		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
+ 
+ 		for j=1:md.mesh.numberofvertices
+-			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi; 
++			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+ 			if md.mask.ocean_levelset(j),
+-				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi; 
++				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+ 			else
+-				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi; 
++				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+ 			end
+@@ -61,96 +60,90 @@
+ 		end
+ 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+ 		
+-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land); 
+-		distance(pos2)=mindistance_land; 
++		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land);
++		distance(pos2)=mindistance_land;
+ 
+ 		domain = 'Greenland'; %'Antarctica'; %'HMA'; %'Alaska'; %'Glaciers'
+-		mask = domain_mask(md.mesh.lat,md.mesh.long,domain);  
++		mask = domain_mask(md.mesh.lat,md.mesh.long,domain); 
+ 		distance(mask>0)=mindistance_source;
+ 
+-		dist=min(maxdistance,distance); 
++		dist=min(maxdistance,distance);
+ 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
+-
+ 	end
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 
++	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 	save ./Models/SlrGRACE_Mesh_refined md;
+-	
++
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
++end %}}}
+ 
+-end 
+-
+-if any(steps==3) 
++if any(steps==3) %{{{
+ 	disp('   Step 3: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/SlrGRACE_Mesh_refined');
+ 
+ 	year_month = 2007+15/365;
+-	time_range = [year_month year_month]; 
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
++	time_range = [year_month year_month];
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+ 
+-	index = md.mesh.elements; 
+-	lat=90-md.mesh.lat; 
+-	lon=md.mesh.long; 
+-	lon(lon<0)=180+(180+lon(lon<0)); 
+-	
+-	ax_0=lat(index(:,1)); ay_0=lon(index(:,1)); 
+-	bx_0=lat(index(:,2)); by_0=lon(index(:,2)); 
+-	cx_0=lat(index(:,3)); cy_0=lon(index(:,3)); 
+-	
++	index = md.mesh.elements;
++	lat=90-md.mesh.lat;
++	lon=md.mesh.long;
++	lon(lon<0)=180+(180+lon(lon<0));
++
++	ax_0=lat(index(:,1)); ay_0=lon(index(:,1));
++	bx_0=lat(index(:,2)); by_0=lon(index(:,2));
++	cx_0=lat(index(:,3)); cy_0=lon(index(:,3));
++
+ 	for ii=1:md.mesh.numberofelements
+ 		if (min([ay_0(ii),by_0(ii),cy_0(ii)])==0 && max([ay_0(ii),by_0(ii),cy_0(ii)])>180)
+ 			if ay_0(ii)==0
+ 				ay_0(ii)=360;
+-			end 
++			end
+ 			if by_0(ii)==0
+-				by_0(ii)=360; 
+-			end 
+-			if cy_0(ii)==0 
+-				cy_0(ii)=360; 
++				by_0(ii)=360;
+ 			end
+-		end 
++			if cy_0(ii)==0
++				cy_0(ii)=360;
++			end
++		end
+ 	end
+-	
+-	ay_0(ax_0==0)=(by_0(ax_0==0)+cy_0(ax_0==0))./2; 
+-	by_0(bx_0==0)=(cy_0(bx_0==0)+ay_0(bx_0==0))./2; 
+-	cy_0(cx_0==0)=(ay_0(cx_0==0)+by_0(cx_0==0))./2; 
+-	
+-	ay_0(ax_0==180)=(by_0(ax_0==180)+cy_0(ax_0==180))./2; 
+-	by_0(bx_0==180)=(cy_0(bx_0==180)+ay_0(bx_0==180))./2; 
+-	cy_0(cx_0==180)=(ay_0(cx_0==180)+by_0(cx_0==180))./2; 
+-	
+-	lat_element=(ax_0+bx_0+cx_0)/3; 
++
++	ay_0(ax_0==0)=(by_0(ax_0==0)+cy_0(ax_0==0))./2;
++	by_0(bx_0==0)=(cy_0(bx_0==0)+ay_0(bx_0==0))./2;
++	cy_0(cx_0==0)=(ay_0(cx_0==0)+by_0(cx_0==0))./2;
++
++	ay_0(ax_0==180)=(by_0(ax_0==180)+cy_0(ax_0==180))./2;
++	by_0(bx_0==180)=(cy_0(bx_0==180)+ay_0(bx_0==180))./2;
++	cy_0(cx_0==180)=(ay_0(cx_0==180)+by_0(cx_0==180))./2;
++
++	lat_element=(ax_0+bx_0+cx_0)/3;
+ 	lon_element=(ay_0+by_0+cy_0)/3;
+ 
+-	lat_element_0 = 90-lat_element;		lon_element_0 = lon_element;
++	lat_element_0 = 90-lat_element;	lon_element_0 = lon_element;
+ 	lon_element_0(lon_element>180) = (lon_element(lon_element>180)-180) - 180;
+-	
+-	domain = 'Greenland'; %'HMA'; %'Alaska'; %'Antarctica'; %'Glaciers'; 
+-	mask = domain_mask(lat_element_0,lon_element_0,domain);  
+ 
+-	md.slr.deltathickness = mask.*water_load*md.materials.rho_freshwater/md.materials.rho_ice; 
++	domain = 'Greenland'; %'HMA'; %'Alaska'; %'Antarctica'; %'Glaciers';
++	mask = domain_mask(lat_element_0,lon_element_0,domain); 
+ 
+-	save ./Models/SlrGRACE_Loads md; 
++	md.slr.deltathickness = mask.*water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+ 
+-	plotmodel(md,'data',md.slr.deltathickness,'view',[90 90],'title','Ice height equivalent [m]'); 
++	save ./Models/SlrGRACE_Loads md;
+ 
+-end 
++	plotmodel(md,'data',md.slr.deltathickness,'view',[90 90],'title','Ice height equivalent [m]');
++end %}}}
+ 
+-if any(steps==4) 
++if any(steps==4) %{{{
+ 	disp('   Step 4: Parameterization');
+ 	md = loadmodel('./Models/SlrGRACE_Loads');
+ 
+-	nlove=10001;
+-	md.slr.love_h = love_numbers('h','CM'); md.slr.love_h(nlove+1:end)=[];
+-	md.slr.love_k = love_numbers('k','CM'); md.slr.love_k(nlove+1:end)=[];
+-	md.slr.love_l = love_numbers('l','CM'); md.slr.love_l(nlove+1:end)=[];
++	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+ 
+-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 
+-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 
++	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
++	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
+ 	pos=find(md.slr.deltathickness~=0);
+-	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 
+-	md.mask.land_levelset = 1-md.mask.ocean_levelset; 
++	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
++	md.mask.land_levelset = 1-md.mask.ocean_levelset;
+ 
+ 	md.slr.sealevel=zeros(md.mesh.numberofvertices,1);
+ 	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
+@@ -160,7 +153,7 @@
+ 	md.slr.Ngia=zeros(md.mesh.numberofvertices,1);
+ 	md.slr.Ugia=zeros(md.mesh.numberofvertices,1);
+ 
+-	md.slr.geodetic=1; 
++	md.slr.geodetic=1;
+ 
+ 	di=md.materials.rho_ice/md.materials.rho_water;
+ 	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+@@ -167,150 +160,145 @@
+ 	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+ 	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+ 	md.geometry.bed=md.geometry.base;
+-	
++
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-	
++
+ 	md.miscellaneous.name='SlrGRACE';
+-	
+-	save ./Models/SlrGRACE_Parameterization md; 
+ 
+-end 
++	save ./Models/SlrGRACE_Parameterization md;
++end %}}}
+ 
+-if any(steps==5) 
++if any(steps==5) %{{{
+ 	disp('   Step 5: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+-	md.slr.rigid=1; 
+-	md.slr.elastic=1; 
++	md.slr.rigid=1;
++	md.slr.elastic=1;
+ 	md.slr.rotation=1;
+ 
+-	md.cluster=generic('name',oshostname(),'np',3); 
++	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+ 	md=solve(md,'Slr');
+ 
+-	save ./Models/SlrGRACE_Solution md; 
++	save ./Models/SlrGRACE_Solution md;
++end %}}}
+ 
+-end 
+-
+-if any(steps==6) 
++if any(steps==6) %{{{
+ 	disp('   Step 6: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+-	sol1 = md.slr.deltathickness*100;							% [cm] 
+-	sol2 = md.results.SealevelriseSolution.Sealevel*1000; % [mm] 
+-	
+-	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'}; 
+-	fig_name={'Fig_dH.pdf','Fig_slr.pdf'}; 
++	sol1 = md.slr.deltathickness*100;						% [cm]
++	sol2 = md.results.SealevelriseSolution.Sealevel*1000;	% [mm]
+ 
+-	res = 1.0; 
++	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
++	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+ 
++	res = 1.0;
++
+ 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
+-	sol_grid = zeros(size(lat_grid)); 
++	sol_grid = zeros(size(lat_grid));
+ 
+ 	for kk=1:2
+ 		sol=eval(sprintf('sol%d',kk));
+-	
+-		if length(sol)==md.mesh.numberofelements 
++
++		if length(sol)==md.mesh.numberofelements
+ 			for jj=1:md.mesh.numberofelements
+ 				ii=(jj-1)*3;
+ 				pp(ii+1:ii+3)=md.mesh.elements(jj,:);
+ 			end
+ 			for jj=1:md.mesh.numberofvertices
+-				pos=ceil(find(pp==jj)/3); 
+-				temp(jj)=mean(sol(pos)); 
++				pos=ceil(find(pp==jj)/3);
++				temp(jj)=mean(sol(pos));
+ 			end
+-			sol=temp'; 
+-		end 
++			sol=temp';
++		end
+ 
+-		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol); 
++		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
+ 		F.Method = 'linear';
+-		F.ExtrapolationMethod = 'linear'; 
++		F.ExtrapolationMethod = 'linear';
+ 		
+ 		sol_grid = F(lat_grid, lon_grid);
+-		sol_grid(isnan(sol_grid))=0; 
+-		sol_grid(lat_grid>85 & sol_grid==0) = NaN; 
++		sol_grid(isnan(sol_grid))=0;
++		sol_grid(lat_grid>85 & sol_grid==0) = NaN;
+ 
+ 		set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+-		figure1=figure('Position', [100, 100, 1000, 500]); 
+-		gcf; load coast; cla; 
++		figure1=figure('Position', [100, 100, 1000, 500]);
++		gcf; load coast; cla;
+ 		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+ 		if (kk==1)
+-			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white'); 
++			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
+ 		else
+-			geoshow(lat,long,'DisplayType','polygon','FaceColor',[0.75 0.75 0.75]); 
+-		end 
+-		plot(long,lat,'k'); hold off; 
++			geoshow(lat,long,'DisplayType','polygon','FaceColor',[0.75 0.75 0.75]);
++		end
++		plot(long,lat,'k'); hold off;
+ 		c1=colorbar;
+-		colormap('haxby'); 
+-		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]); 
+-		xlim([-180 180]); 
+-		ylim([-90 90]); 
+-		grid on; 
+-		title(sol_name(kk)); 
++		colormap('haxby');
++		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]);
++		xlim([-180 180]);
++		ylim([-90 90]);
++		grid on;
++		title(sol_name(kk));
+ 		set(gcf,'color','w');
+-		%export_fig(fig_name{kk}); 
++		%export_fig(fig_name{kk});
+ 	end
+-end 
++end %}}}
+ 
+-if any(steps==7) 
++if any(steps==7) %{{{
+ 	disp('   Step 7: Transient run');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+ 	disp('Projecting  loads onto the mesh...');
+-	time_range = [2005+15/365 2014+350/365]; 
+-	%time_range = 2007 + [15 350]/365; 
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 
++	time_range = [2005+15/365 2014+350/365];
++	%time_range = 2007 + [15 350]/365;
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+ 
+-	[ne,nt]=size(water_load); 
+-   md.slr.deltathickness = zeros(ne+1,nt);
+-	md.slr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice; 
+-	md.slr.deltathickness(ne+1,:)=[1:nt]; % times 
+-	
++	[ne,nt]=size(water_load);
++	md.slr.deltathickness = zeros(ne+1,nt);
++	md.slr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++	md.slr.deltathickness(ne+1,:)=[1:nt]; % times
++
+ 	md.transient.issmb=0;
+-	md.transient.ismasstransport=0; 
+-	md.transient.isstressbalance=0; 
++	md.transient.ismasstransport=0;
++	md.transient.isstressbalance=0;
+ 	md.transient.isthermal=0;
+ 	md.transient.isslr=1;
+-	
++
+ 	md.timestepping.start_time=-1;
+-   md.timestepping.final_time=nt; 
+-	md.timestepping.time_step=1; 
+-   md.timestepping.interp_forcings=0;
++	md.timestepping.final_time=nt;
++	md.timestepping.time_step=1;
++	md.timestepping.interp_forcings=0;
+ 	md.settings.output_frequency=1;
+ 
+-	md.cluster=generic('name',oshostname(),'np',3); 
++	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+ 	md=solve(md,'tr');
+ 
+-	save ./Models/SlrGRACE_Transient md; 
++	save ./Models/SlrGRACE_Transient md;
++end %}}}
+ 
+-end 
+-
+-if any(steps==8) 
++if any(steps==8) %{{{
+ 	disp('   Step 8: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+-	time = md.slr.deltathickness(end,:); 
++	time = md.slr.deltathickness(end,:);
+ 
+-	tide_x = 37+29/60;  % degree N
+-	tide_y = 126+20/60; % degree E
++	tide_x = 37+29/60;	% degree N
++	tide_y = 126+20/60;	% degree E
+ 
+ 	for tt=1:length(time)
+-		gmsl(tt) = md.results.TransientSolution(tt).SealevelRSLEustatic*1000; 
+-	   sol = (md.results.TransientSolution(tt+1).Sealevel-md.results.TransientSolution(tt).Sealevel)*1000; 
++		gmsl(tt) = md.results.TransientSolution(tt).SealevelRSLEustatic*1000;
++		sol = (md.results.TransientSolution(tt+1).Sealevel-md.results.TransientSolution(tt).Sealevel)*1000;
+ 		slr_incheon(tt) = griddata(md.mesh.lat,md.mesh.long,sol,tide_x,tide_y);
+ 	end
+ 
+-	plot(2005+time/12,gmsl-gmsl(1),'-*','linewidth',3); grid on; hold on; 
+-	plot(2005+time/12,slr_incheon-slr_incheon(1),'-*r','linewidth',3); hold off; 
+-	xlabel('Year'); 
++	plot(2005+time/12,gmsl-gmsl(1),'-*','linewidth',3); grid on; hold on;
++	plot(2005+time/12,slr_incheon-slr_incheon(1),'-*r','linewidth',3); hold off;
++	xlabel('Year');
+ 	ylabel('GMSL [mm]');
+ 	set(gcf,'color','w');
+-	legend('GMSL','Incheon'); 
+-
+-end 
+-
++	legend('GMSL','Incheon');
++end %}}}
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25915)
+@@ -1,9 +1,9 @@
+ %PIG Uncertainty Quantification Application
+-steps=[1]; 
++steps=[1];
+ 
+-if any(steps==1) 
+-	disp('   Step 1: plot flux gates'); 
+-	
++if any(steps==1) %{{{
++	disp('   Step 1: plot flux gates');
++
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+ 
+ 	texts=cell(1,13);
+@@ -27,16 +27,16 @@
+ 		'text',{'1','2','3','4','5','6','7',...
+ 		'8','9','10','11','12','13'},...
+ 		'textposition',textpositions);
++end %}}}
+ 
+-end
+-if any(steps==2) 
+-	disp('   Step 2: compute cross overs from CRESIS'); 
+-	
++if any(steps==2) %{{{
++	disp('   Step 2: compute cross overs from CRESIS');
++
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+ 
+ 	%load cross overs: CRESIS McCord Antarctica, 2009 (courtesy of John Paden)
+ 	load('../Data/CrossOvers2009.mat');
+-	
++
+ 	%interpolate cross over errors over our mesh vertices
+ 	DeltaHH=InterpFromMeshToMesh2d(index,x,y,dhh,md.mesh.x,md.mesh.y);
+ 
+@@ -45,41 +45,41 @@
+ 
+ 	%filter out unrealistic error ranges
+ 	flags=ContourToNodes(md.mesh.x,md.mesh.y,'ErrorContour.exp',1);
+-	pos=find(~flags); DeltaHH(pos)=0; 
++	pos=find(~flags); DeltaHH(pos)=0;
+ 
+ 	%avoid large unrealistic values
+ 	pos=find(DeltaHH>1); DeltaHH(pos)=1;
+ 	pos=find(DeltaHH<-1); DeltaHH(pos)=-1;
+-	
++
+ 	%transform into absolute errors and setup a minimum error everywhere.
+ 	DeltaHH=abs(DeltaHH);
+-	pos=find(DeltaHH==0); pos2=find(DeltaHH~=0); 
++	pos=find(DeltaHH==0); pos2=find(DeltaHH~=0);
+ 	DeltaHH(pos)=min(DeltaHH(pos2));
+ 
+ 	save Models/PIG.CrossOvers DeltaHH
++end %}}}
+ 
+-end
+-if any(steps==3) 
+-	disp('   Step 3: sampling analysis'); 
+-	
++if any(steps==3) %{{{
++	disp('   Step 3: sampling analysis');
++
+ 	%load model and cross over errors
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+ 	load -mat Models/PIG.CrossOvers
+ 
+ 	%partition the mesh
+-	md.qmu.numberofpartitions=50;
+-	md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,...
+-	'weighting','on');
+-	md.qmu.partition=md.qmu.partition-1; %switch partition to c-indexing
++	npart=50;
++	partition=partitioner(md,'package','chaco','npart',npart,'weighting','on')-1;
+ 
+ 	%make DeltaHH into our 3 sigma deviation
+ 	DeltaHH=DeltaHH/6; %2 (to transform DeltaHH into a radius) x 3 (for 3 sigma)
+-	DeltaHH_on_partition=AreaAverageOntoPartition(md,DeltaHH);
+-	DeltaHH_on_grids=DeltaHH_on_partition(md.qmu.partition+1); %just to check in case
+-	
+-	md.qmu.variables.thickness=normal_uncertain('scaled_Thickness',1,1);
+-	md.qmu.variables.thickness.stddev=DeltaHH_on_partition;
++	DeltaHH_on_partition=AreaAverageOntoPartition(md,DeltaHH,partition);
++	DeltaHH_on_grids=DeltaHH_on_partition(partition+1); %just to check in case
+ 
++	md.qmu.variables.thickness=normal_uncertain('descriptor','scaled_Thickness',...
++		'mean',ones(npart,1),...
++		'stddev',DeltaHH_on_partition,...
++		'partition',partition);
++
+ 	%responses
+ 	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],...
+ 		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+@@ -109,27 +109,31 @@
+ 		[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={'MassFlux1.exp',...
+-	                           'MassFlux2.exp',...
+-	                           'MassFlux3.exp',...
+-	                           'MassFlux4.exp',...
+-	                           'MassFlux5.exp',...
+-	                           'MassFlux6.exp',...
+-	                           'MassFlux7.exp',...
+-	                           'MassFlux8.exp',...
+-	                           'MassFlux9.exp',...
+-	                           'MassFlux10.exp',...
+-	                           'MassFlux11.exp',...
+-	                           'MassFlux12.exp',...
+-	                           'MassFlux13.exp'};
++	md.qmu.mass_flux_profiles={...
++		'MassFlux1.exp',...
++		'MassFlux2.exp',...
++		'MassFlux3.exp',...
++		'MassFlux4.exp',...
++		'MassFlux5.exp',...
++		'MassFlux6.exp',...
++		'MassFlux7.exp',...
++		'MassFlux8.exp',...
++		'MassFlux9.exp',...
++		'MassFlux10.exp',...
++		'MassFlux11.exp',...
++		'MassFlux12.exp',...
++		'MassFlux13.exp'...
++	};
+ 	md.qmu.mass_flux_profile_directory='../MassFluxes/';
+ 
+ 	%%  sampling analysis
+-	md.qmu.method     =dakota_method('nond_samp');
+-	md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
+-	'seed',1234,...
+-	'samples',30,...
+-	'sample_type','lhs'); %random or lhs
++	md.qmu.method		=dakota_method('nond_samp');
++	md.qmu.method(end)	=dmeth_params_set(...
++		md.qmu.method(end),...
++		'seed',1234,...
++		'samples',30,...
++		'sample_type','lhs'...
++	); %random or lhs
+ 
+ 	%%  a variety of parameters
+ 	md.qmu.params.direct=true;
+@@ -142,7 +146,7 @@
+ 
+ 	%Turn off verbosity
+ 	md.verbose=verbose(0);
+-	
++
+ 	%Here, we choose to run with 4 processors, 3 for DAKOTA
+ 	% while one serves as the master
+ 	md.cluster=generic('name',oshostname,'np',4);
+@@ -156,11 +160,12 @@
+ 	md.qmu.isdakota=1; md.inversion.iscontrol=0;
+ 	md=solve(md,'Stressbalance','overwrite','y');
+ 
+-	save ./Models/PIG.Sampling md; 
+-end
+-if any(steps==4) 
+-	disp('   Step 4: sensitivity analysis'); 
+-	
++	save ./Models/PIG.Sampling md;
++end %}}}
++
++if any(steps==4) %{{{
++	disp('   Step 4: sensitivity analysis');
++
+ 	%load model
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+ 
+@@ -194,19 +199,21 @@
+ 	md.qmu.responses.MassFlux13=response_function('indexed_MassFlux_13',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+ 
+ 	%mass flux profiles
+-	md.qmu.mass_flux_profiles={'MassFlux1.exp',...
+-	                           'MassFlux2.exp',...
+-	                           'MassFlux3.exp',...
+-	                           'MassFlux4.exp',...
+-	                           'MassFlux5.exp',...
+-	                           'MassFlux6.exp',...
+-	                           'MassFlux7.exp',...
+-	                           'MassFlux8.exp',...
+-	                           'MassFlux9.exp',...
+-	                           'MassFlux10.exp',...
+-	                           'MassFlux11.exp',...
+-	                           'MassFlux12.exp',...
+-	                           'MassFlux13.exp'};
++	md.qmu.mass_flux_profiles={...
++		'MassFlux1.exp',...
++		'MassFlux2.exp',...
++		'MassFlux3.exp',...
++		'MassFlux4.exp',...
++		'MassFlux5.exp',...
++		'MassFlux6.exp',...
++		'MassFlux7.exp',...
++		'MassFlux8.exp',...
++		'MassFlux9.exp',...
++		'MassFlux10.exp',...
++		'MassFlux11.exp',...
++		'MassFlux12.exp',...
++		'MassFlux13.exp'...
++	};
+ 	md.qmu.mass_flux_profile_directory='../MassFluxes/';
+ 
+ 	%method: local reliability
+@@ -226,7 +233,7 @@
+ 	%Here, we choose to run with 2 processors, 1 for DAKOTA
+ 	% while one serves as the master
+ 	md.cluster=generic('name',oshostname,'np',2);
+-	
++
+ 	%Dakota runs in parallel with a master/slave configuration.
+ 	% At least 2 cpu's are needed to run the UQ
+ 	md.qmu.params.evaluation_scheduling='master';
+@@ -237,23 +244,24 @@
+ 	md.qmu.isdakota=1; md.inversion.iscontrol=0;
+ 	md.verbose=verbose('qmu',true);
+ 	md=solve(md,'Stressbalance','overwrite','y');
+-	
+-	save ./Models/PIG.Sensitivity md; 
+-end
+-if any(steps==5) 
++
++	save ./Models/PIG.Sensitivity md;
++end %}}}
++
++if any(steps==5) %{{{
+ 	disp('   Step 5: plot partition');
+-	
++
+ 	%load model
+ 	md = loadmodel('./Models/PIG.Sampling');
+-	
++
+ 	plotmodel(md,'data','mesh','partitionedges','on',...
+ 	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
+ 	'title','Partition Edges on ISSM mesh','grid','on');
++end %}}}
+ 
+-end 
+-if any(steps==6) 
+-	disp('   Step 6: plot histogram'); 
+-	
++if any(steps==6) %{{{
++	disp('   Step 6: plot histogram');
++
+ 	%load model
+ 	md = loadmodel('./Models/PIG.Sampling');
+ 
+@@ -269,10 +277,11 @@
+ 	'xlabelplt','M (Gt/yr)','ylabelplt','F','FontSize',8,'FaceColor',...
+ 	'none','EdgeColor','red');
+ 
+-end
+-if any(steps==7) 
+-	disp('   Step 7: plot sensitivity'); 
+-	
++end %}}}
++
++if any(steps==7) %{{{
++	disp('   Step 7: plot sensitivity');
++
+ 	%load model
+ 	md = loadmodel('./Models/PIG.Sensitivity');
+ 	%copy dakota results into model qmu
+@@ -279,7 +288,7 @@
+ 	md.qmu.results=md.results.dakota;
+ 
+ 	%which profile are we looking at?
+-	index=1; 	
++	index=1;
+ 
+ 	%To plot sensitivities
+ 	sa=md.results.dakota.dresp_out(index).sens(1:10); sa=sa(md.qmu.partition+1)/1e12*60*60*24*365;
+@@ -308,5 +317,4 @@
+ 		'colorbartitle#1','If_{H}', 'colorbartitle#2','If_{\alpha}',...
+ 		'colorbartitle#3','If_{B}','unit#all','km','figure',2,...
+ 		'title','Importance Factors: H, \alpha, B');
+-
+-end
++end %}}}
+Index: ../trunk-jpl/examples/shakti/runme.m
+===================================================================
+--- ../trunk-jpl/examples/shakti/runme.m	(revision 25914)
++++ ../trunk-jpl/examples/shakti/runme.m	(revision 25915)
+@@ -1,6 +1,6 @@
+ steps=[1:3];
+ 
+-if any(steps==1)
++if any(steps==1) %{{{
+ 	disp('	Step 1: Mesh');
+ 
+ 	%Generate unstructured mesh on 1,000 m square with typical element edge length of 20 m
+@@ -7,8 +7,9 @@
+ 	md=triangle(model,'./outline.exp',20);
+ 
+ 	save MoulinMesh md
+-end
+-if any(steps==2)
++end %}}}
++
++if any(steps==2) %{{{
+ 	disp('	Step 2: Parameterization');
+ 	md=loadmodel('MoulinMesh');
+ 
+@@ -20,7 +21,7 @@
+ 	% HYDROLOGY SPECIFIC PARAMETERIZATION:
+ 	% Change hydrology class to Sommers' SHaKTI model
+ 	md.hydrology=hydrologyshakti();
+-	
++
+ 	% Define initial water head such that water pressure is 50% of ice overburden pressure
+ 	md.hydrology.head = 0.5*md.materials.rho_ice/md.materials.rho_freshwater*md.geometry.thickness + md.geometry.base;
+ 
+@@ -47,8 +48,9 @@
+ 	md.hydrology.spchead(pos)=md.geometry.base(pos);
+ 
+ 	save MoulinParam md;
+-end
+-if any(steps==3);
++end %}}}
++
++if any(steps==3) %{{{
+ 	disp('	Step 3: Solve!');
+ 	md=loadmodel('MoulinParam');
+ 
+@@ -79,4 +81,4 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save MoulinTransient md
+-end
++end %}}}
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(nonexistent)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25915)
+@@ -0,0 +1,623 @@
++#!/bin/bash
++################################################################################
++# This script runs the examples tests. It is intended to be called from 
++# jenkins/jenkins.sh and helps organization.
++#
++# TODO:
++# - Figure out how to remove \ and \n\ from multiline string variables while 
++#	preserving formatting when value is printed to file.
++################################################################################
++
++## Constants
++#
++RUNME_FILE='runme.m'
++RUN_EXAMPLE=0
++STATUS_HANDLING="\
++		disp('SUCCESS');\n\
++	catch me\n\
++		message=getReport(me);\n\
++		fprintf('%s',message);\n\
++		disp('FAILURE');\n\
++	end\n\
++	exit\n\
++"
++
++cd $ISSM_DIR/examples
++
++for dir in ./* ; do
++	if [ -d "${dir}" ]; then
++		# Some of the examples are incomplete (on purpose). As such, we 
++		# will have to populate the missing steps in order to make sure 
++		# that everything is working.
++
++		cd ${dir}
++
++		if [ "${dir}" == "./AMR" ]; then
++			sed -i '.bak' '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./Data" ]; then
++			echo 'Directory contains datasets only; no example to run.'
++			RUN_EXAMPLE=0
++		elif [ "${dir}" == "./EsaGRACE" ]; then
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./EsaWahr" ]; then
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./Functions" ]; then
++			echo "Directory contains functions only; no example to run."
++			RUN_EXAMPLE=0
++		elif [ "${dir}" == "./Greenland" ]; then
++			# STEP_SEVEN #{{{
++			STEP_SEVEN="\
++				if any(steps==7) %{{{\n\
++					disp('   Step 7: Historical Relaxation run');\n\
++					md = loadmodel('./Models/Greenland.Control_drag');\n\
++					\n\
++					load smbbox\n\
++					\n\
++					%convert mesh x,y into the Box projection\n\
++					[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);\n\
++					[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);\n\
++					\n\
++					%Interpolate and set surface mass balance\n\
++					index = BamgTriangulate(x1(:),y1(:));\n\
++					smb_mo = InterpFromMeshToMesh2d(index,x1(:),y1(:),smbmean(:),xi,yi);\n\
++					smb = smb_mo*12/1000*md.materials.rho_freshwater/md.materials.rho_ice;\n\
++					md.smb.mass_balance = [smb;1 ];\n\
++					\n\
++					%Set transient options, run for 20 years, saving every 5 timesteps\n\
++					md.timestepping.time_step=0.2;\n\
++					md.timestepping.final_time=200;\n\
++					md.settings.output_frequency=5;\n\
++					\n\
++					%Additional options\n\
++					md.inversion.iscontrol=0;\n\
++					md.transient.requested_outputs={'IceVolume','TotalSmb', ...\n\
++						'SmbMassBalance'};\n\
++					md.verbose=verbose('solution',true,'module',true);\n\
++					\n\
++					%Go solve\n\
++					md.cluster=generic('name',oshostname,'np',2);\n\
++					md=solve(md,'Transient');\n\
++					\n\
++					save ./Models/Greenland.HistoricTransient_200yr md;\n\
++				end %}}}\n\
++			"
++			#}}}
++			# STEP_EIGHT #{{{
++			STEP_EIGHT="\
++				if any(steps==8) %{{{\n\
++					%Load historic transient model\n\
++					md=loadmodel('./Models/Greenland.HistoricTransient_200yr');\n\
++					\n\
++					%Create Line Plots of relaxation run. Create a figure.\n\
++					figure;\n\
++					\n\
++					%Save surface mass balance, by looping through 200 years (1000 steps)\n\
++					%Note, the first output will always contain output from time step 1\n\
++					surfmb=[];\n\
++					for i=2:201;\n\
++						surfmb=[surfmb md.results.TransientSolution(i).SmbMassBalance];\n\
++					end\n\
++					\n\
++					%Plot surface mass balance time series in first subplot\n\
++					subplot(3,1,1);\n\
++					plot([1:200],mean(surfmb));\n\
++					\n\
++					%Title this plot Mean surface mass balance\n\
++					title('Mean Surface mass balance');\n\
++					\n\
++					%Save velocity by looping through 200 years\n\
++					vel=[];\n\
++					for i=2:201;\n\
++						vel=[vel md.results.TransientSolution(i).Vel];\n\
++					end\n\
++					\n\
++					%Plot velocity time series in second subplot\n\
++					subplot(3,1,2);\n\
++					plot([1:200],mean(vel));\n\
++					\n\
++					%Title this plot Mean Velocity\n\
++					title('Mean Velocity');\n\
++					\n\
++					%Save Ice Volume by looping through 200 years\n\
++					volume=[];\n\
++					for i=2:201;\n\
++						volume=[volume md.results.TransientSolution(i).IceVolume];\n\
++					end\n\
++					\n\
++					%Plot volume time series in third subplot\n\
++					subplot(3,1,3);\n\
++					plot([1:200],volume);\n\
++					\n\
++					%Title this plot Mean Velocity and add an x label of years\n\
++					title('Ice Volume');\n\
++					xlabel('years');\n\
++				end %}}}\n\
++			"
++			#}}}
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
++			perl -0755 -p -i -e "s|if any\(steps==7\).*% step 7 end|${STEP_SEVEN}|s" $RUNME_FILE
++			perl -0755 -p -i -e "s|if any\(steps==8\).*% step 8 end|${STEP_EIGHT}|s" $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./IceBridge" ]; then
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			perl -0755 -p -i -e "s|\n\t%Mesh greenland without.*return;\n||s" $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./IceflowModels" ]; then
++			sed -i '.bak' '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./Inversion" ]; then
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./ISMIP" ]; then
++			# TODO:
++			# - Run test again with ISMIPF configuration (will likely need to 
++			#	add conditional after 'RUN_EXAMPLE -eq 1' block)
++			#
++			# RUNME #{{{
++			RUNME="\
++				try\n\
++					%which steps to perform; steps are from 1 to 8\n\
++					%step 7 is specific to ISMIPA\n\
++					%step 8 is specific to ISMIPF\n\
++					\n\
++					steps=[1:7]; %ISMIPA\n\
++					%steps=[1:6,8]; %ISMIPF\n\
++					\n\
++					% parameter file to be used, choose between IsmipA.par or IsmipF.par\n\
++					ParamFile='IsmipA.par';\n\
++					%ParamFile='IsmipF.par';\n\
++					\n\
++					%Run Steps\n\
++					\n\
++					%Mesh Generation #1\n\
++					if any(steps==1) %{{{\n\
++						%initialize md as a new model #help model\n\
++						%->\n\
++						md=model();\n\
++						% generate a squaremesh #help squaremesh\n\
++						% Side is 80 km long with 20 points\n\
++						%->\n\
++						if(ParamFile=='IsmipA.par'),\n\
++							md=squaremesh(md,80000,80000,20,20);\n\
++						elseif(ParamFile=='IsmipF.par'),\n\
++							md=squaremesh(md,100000,100000,30,30);\n\
++						end\n\
++						% plot the given mesh #plotdoc\n\
++						%->\n\
++						plotmodel(md,'data','mesh')\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.Mesh_generation md;\n\
++					end %}}}\n\
++					\n\
++					%Masks #2\n\
++					if any(steps==2) %{{{\n\
++						% load the preceding step #help loadmodel\n\
++						% path is given by the organizer with the name of the given step\n\
++						%->\n\
++						md = loadmodel('./Models/ISMIP.Mesh_generation');\n\
++						% set the mask #help setmask\n\
++						% all MISMIP nodes are grounded\n\
++						%->\n\
++						md=setmask(md,'','');\n\
++						% plot the given mask #md.mask to locate the field\n\
++						%->\n\
++						plotmodel(md,'data',md.mask.ocean_levelset);\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.SetMask md;\n\
++					end %}}}\n\
++					\n\
++					%Parameterization #3\n\
++					if any(steps==3) %{{{\n\
++						% load the preceding step #help loadmodel\n\
++						% path is given by the organizer with the name of the given step\n\
++						%->\n\
++						md = loadmodel('./Models/ISMIP.SetMask');\n\
++						% parametrize the model # help parameterize\n\
++						% you will need to fil-up the parameter file defined by the\n\
++						% ParamFile variable\n\
++						%->\n\
++						md=parameterize(md,ParamFile);\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.Parameterization md;\n\
++					end %}}}\n\
++					\n\
++					%Extrusion #4\n\
++					if any(steps==4) %{{{\n\
++						\n\
++						% load the preceding step #help loadmodel\n\
++						% path is given by the organizer with the name of the given step\n\
++						%->\n\
++						md = loadmodel('./Models/ISMIP.Parameterization');\n\
++						% vertically extrude the preceding mesh #help extrude\n\
++						% only 5 layers exponent 1\n\
++						%->\n\
++						md=extrude(md,9,1);\n\
++						% plot the 3D geometry #plotdoc\n\
++						%->\n\
++						plotmodel(md,'data',md.geometry.base)\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.Extrusion md;\n\
++					end %}}}\n\
++					\n\
++					%Set the flow computing method #5\n\
++					if any(steps==5) %{{{\n\
++						\n\
++						% load the preceding step #help loadmodel\n\
++						% path is given by the organizer with the name of the given step\n\
++						%->\n\
++						md = loadmodel('./Models/ISMIP.Extrusion');\n\
++						% set the approximation for the flow computation #help setflowequation\n\
++						% We will be using the Higher Order Model (HO)\n\
++						%->\n\
++						md=setflowequation(md,'HO','all');\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.SetFlow md;\n\
++					end %}}}\n\
++					\n\
++					%Set Boundary Conditions #6\n\
++					if any(steps==6) %{{{\n\
++						\n\
++						% load the preceding step #help loadmodel\n\
++						% path is given by the organizer with the name of the given step\n\
++						%->\n\
++						md = loadmodel('./Models/ISMIP.SetFlow');\n\
++						% dirichlet boundary condition are known as SPCs\n\
++						% ice frozen to the base, no velocity	#md.stressbalance\n\
++						% SPCs are initialized at NaN one value per vertex\n\
++						%->\n\
++						md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);\n\
++						%->\n\
++						md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);\n\
++						%->\n\
++						md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);\n\
++						% extract the nodenumbers at the base #md.mesh.vertexonbase\n\
++						%->\n\
++						basalnodes=find(md.mesh.vertexonbase);\n\
++						% set the sliding to zero on the bed\n\
++						%->\n\
++						md.stressbalance.spcvx(basalnodes)=0.0;\n\
++						%->\n\
++						md.stressbalance.spcvy(basalnodes)=0.0;\n\
++						% periodic boundaries have to be fixed on the sides\n\
++						% create tabs with the side of the domain\n\
++						% for x\n\
++						% create maxX #help find\n\
++						%->\n\
++						maxX=find(md.mesh.x==max(md.mesh.x));\n\
++						% create minX\n\
++						%->\n\
++						minX=find(md.mesh.x==min(md.mesh.x));\n\
++						% for y, max X and minX should be excluded\n\
++						% create maxY\n\
++						%->\n\
++						maxY=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));\n\
++						% create minY\n\
++						%->\n\
++						minY=find(md.mesh.y==min(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));\n\
++						% set the node that should be paired together\n\
++						% #md.stressbalance.vertex_pairing\n\
++						%->\n\
++						md.stressbalance.vertex_pairing=[minX,maxX;minY,maxY];\n\
++						if (ParamFile=='IsmipF.par')\n\
++							% if we are dealing with IsmipF the solution is in\n\
++							% masstransport\n\
++							md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;\n\
++						end\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.BoundaryCondition md;\n\
++					end %}}}\n\
++					\n\
++					%Solving #7\n\
++					if any(steps==7) %{{{\n\
++						% load the preceding step #help loadmodel\n\
++						% path is given by the organizer with the name of the given step\n\
++						%->\n\
++						md = loadmodel('./Models/ISMIP.BoundaryCondition');\n\
++						% Set cluster #md.cluster\n\
++						% generic parameters #help generic\n\
++						% set only the name and number of process\n\
++						%->\n\
++						md.cluster=generic('name',oshostname(),'np',2);\n\
++						% Set which control message you want to see #help verbose\n\
++						%->\n\
++						md.verbose=verbose('convergence',true);\n\
++						% Solve #help solve\n\
++						% we are solving a StressBalanc\n\
++						%->\n\
++						md=solve(md,'Stressbalance');\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.StressBalance md;\n\
++						% plot the surface velocities #plotdoc\n\
++						%->\n\
++						plotmodel(md,'data',md.results.StressbalanceSolution.Vel)\n\
++					end %}}}\n\
++					\n\
++					%Solving #8\n\
++					if any(steps==8) %{{{\n\
++						% load the preceding step #help loadmodel\n\
++						% path is given by the organizer with the name of the given step\n\
++						%->\n\
++						md = loadmodel('./Models/ISMIP.BoundaryCondition');\n\
++						% Set cluster #md.cluster\n\
++						% generic parameters #help generic\n\
++						% set only the name and number of process\n\
++						%->\n\
++						md.cluster=generic('name',oshostname(),'np',2);\n\
++						% Set which control message you want to see #help verbose\n\
++						%->\n\
++						md.verbose=verbose('convergence',true);\n\
++						% set the transient model to ignore the thermal model\n\
++						% #md.transient \n\
++						%->\n\
++						md.transient.isthermal=0;\n\
++						% define the timestepping scheme\n\
++						% everything here should be provided in years #md.timestepping\n\
++						% give the length of the time_step (4 years)\n\
++						%->\n\
++						md.timestepping.time_step=4;\n\
++						% give final_time (20*4 years time_steps)\n\
++						%->\n\
++						md.timestepping.final_time=4*20;\n\
++						% Solve #help solve\n\
++						% we are solving a TransientSolution\n\
++						%->\n\
++						md=solve(md,'Transient');\n\
++						% save the given model\n\
++						%->\n\
++						save ./Models/ISMIP.Transient md;\n\
++						% plot the surface velocities #plotdoc\n\
++						%->\n\
++						plotmodel(md,'data',md.results.TransientSolution(20).Vel)\n\
++					end %}}}\n\
++			"
++			#}}}
++			# PAR_A #{{{
++			PAR_A="\
++				%Parameterization for ISMIP A experiment\n\
++				\n\
++				%Set the Simulation generic name #md.miscellaneous\n\
++				%->\n\
++				\n\
++				%Geometry\n\
++				disp('   Constructing Geometry');\n\
++				\n\
++				%Define the geometry of the simulation #md.geometry\n\
++				%surface is [-x*tan(0.5*pi/180)] #md.mesh\n\
++				%->\n\
++				md.geometry.surface=-md.mesh.x*tan(0.5*pi/180.);\n\
++				%base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]\n\
++				%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)\n\
++				%->\n\
++				L=max(md.mesh.x)-min(md.mesh.x);\n\
++				md.geometry.base=md.geometry.surface-1000.0+500.0*sin(md.mesh.x*2.0*pi/L).*sin(md.mesh.y*2.0*pi/L);\n\
++				%thickness is the difference between surface and base #md.geometry\n\
++				%->\n\
++				md.geometry.thickness=md.geometry.surface-md.geometry.base;\n\
++				%plot the geometry to check it out\n\
++				%->\n\
++				plotmodel(md,'data',md.geometry.thickness);\n\
++				\n\
++				disp('   Defining friction parameters');\n\
++				\n\
++				%These parameters will not be used but need to be fixed #md.friction\n\
++				%one friciton coefficient per node (md.mesh.numberofvertices,1)\n\
++				%->\n\
++				md.friction.coefficient=200.0*ones(md.mesh.numberofvertices,1);\n\
++				%one friciton exponent (p,q) per element\n\
++				%->\n\
++				md.friction.p=ones(md.mesh.numberofelements,1);\n\
++				%->\n\
++				md.friction.q=ones(md.mesh.numberofelements,1);\n\
++				\n\
++				disp('   Construct ice rheological properties');\n\
++				\n\
++				%The rheology parameters sit in the material section #md.materials\n\
++				%B has one value per vertex\n\
++				%->\n\
++				md.materials.rheology_B=6.8067e7*ones(md.mesh.numberofvertices,1);\n\
++				%n has one value per element\n\
++				%->\n\
++				md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);\n\
++				\n\
++				disp('   Set boundary conditions');\n\
++				\n\
++				%Set the default boundary conditions for an ice-sheet \n\
++				% #help SetIceSheetBC\n\
++				%->\n\
++				md=SetIceSheetBC(md);\n\
++			"
++			#}}}
++			# PAR_F #{{{
++			PAR_F="\
++				%Parameterization for ISMIP F experiment\n\
++				\n\
++				%Set the Simulation generic name #md.miscellaneous\n\
++				%->\n\
++				\n\
++				%Geometry\n\
++				disp('   Constructing Geometry');\n\
++				\n\
++				%Define the geometry of the simulation #md.geometry\n\
++				%surface is [-x*tan(3.0*pi/180)] #md.mesh\n\
++				%->\n\
++				md.geometry.surface=md.mesh.x*tan(3.0*pi/180.0);\n\
++				%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]\n\
++				%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)\n\
++				%->\n\
++				L=max(md.mesh.x)-min(md.mesh.x);\n\
++				%->\n\
++				md.geometry.base=md.geometry.surface-1000.0+100.0*exp(-((md.mesh.x-L/2.0).^2.0+(md.mesh.y-L/2.0).^2.0)/(10000.^2.0));\n\
++				%thickness is the difference between surface and base #md.geometry\n\
++				%->\n\
++				md.geometry.thickness=md.geometry.surface-md.geometry.base;\n\
++				%plot the geometry to check it out\n\
++				%->\n\
++				plotmodel(md,'data',md.geometry.thickness);\n\
++				\n\
++				disp('   Defining friction parameters');\n\
++				\n\
++				%These parameters will not be used but need to be fixed #md.friction\n\
++				%one friciton coefficient per node (md.mesh.numberofvertices,1)\n\
++				%conversion form year to seconds with #md.constants.yts\n\
++				%->\n\
++				md.friction.coefficient=sqrt(md.constants.yts/(1000*2.140373*10^-7))*ones(md.mesh.numberofvertices,1);\n\
++				%one friciton exponent (p,q) per element\n\
++				%->\n\
++				md.friction.p=ones(md.mesh.numberofelements,1);\n\
++				%->\n\
++				md.friction.q=zeros(md.mesh.numberofelements,1);\n\
++				\n\
++				disp('   Construct ice rheological properties');\n\
++				\n\
++				%The rheology parameters sit in the material section #md.materials\n\
++				%B has one value per vertex\n\
++				%->\n\
++				md.materials.rheology_B=(1/(2.140373*10^-7/md.constants.yts))*ones(md.mesh.numberofvertices,1);\n\
++				%n has one value per element\n\
++				%->\n\
++				md.materials.rheology_n=1*ones(md.mesh.numberofelements,1);\n\
++				\n\
++				disp('   Set boundary conditions');\n\
++				\n\
++				%Set the default boundary conditions for an ice-sheet \n\
++				% #help SetIceSheetBC\n\
++				%->\n\
++				md=SetIceSheetBC(md);\n\
++				\n\
++				disp('   Initializing velocity and pressure');\n\
++				\n\
++				%initialize the velocity and pressurefields of #md.initialization\n\
++				%->\n\
++				md.initialization.vx=zeros(md.mesh.numberofvertices,1);\n\
++				%->\n\
++				md.initialization.vy=zeros(md.mesh.numberofvertices,1);\n\
++				%->\n\
++				md.initialization.vz=zeros(md.mesh.numberofvertices,1);\n\
++				%->\n\
++				md.initialization.pressure=zeros(md.mesh.numberofvertices,1);\n\
++			"
++			#}}}
++			perl -0755 -p -i'.bak' -e "s|^.*$|${RUNME}|s" $RUNME_FILE
++			perl -0755 -p -i'.bak' -e "s|^.*$|${PAR_A}|s" IsmipA.par
++			perl -0755 -p -i'.bak' -e "s|^.*$|${PAR_F}|s" IsmipF.par
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./Jakobshavn" ]; then
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./LcurveAnalysis" ]; then
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./Mesh" ]; then
++			# NOTE: Cannot test exptool region selection without GUI
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./Pig" ]; then
++			# STEP_SIX #{{{
++			STEP_SIX="\
++				if any(steps==6) %{{{\n\
++					% Load Model\n\
++					md = loadmodel('./Models/PIG_Control_drag');\n\
++					% Disable inversion\n\
++					md.inversion.iscontrol=0;\n\
++					% Extrude Mesh\n\
++					disp('   Extruding mesh');\n\
++					number_of_layers=3;\n\
++					md=extrude(md,number_of_layers,1);\n\
++					% Set Flowequation\n\
++					disp('   Using HO Ice Flow Model');\n\
++					md=setflowequation(md,'HO','all');\n\
++					% Solve\n\
++					md=solve(md,'Stressbalance');\n\
++					% Save Model\n\
++					save ./Models/PIG_ModelHO md;\n\
++				end %}}}\n\
++			"
++			#}}}
++			mv ./DomainOutline.bkp ./DomainOutline.exp > /dev/null 2>&1
++			sed -i '.bak' "s|steps=\[1\];|steps=\[1:7\];\ntry\n|" $RUNME_FILE
++			perl -0755 -p -i -e "s|if any\(steps==6\).*% step 6 end|${STEP_SIX}|s" $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./Pig2" ]; then
++			STEP_NINE="\n disp('Needs work!'); exit"
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:9\];\n\ntry\n|' $RUNME_FILE
++			perl -0755 -p -i -e "s|if any\(steps==9\).*% step 9 end|${STEP_NINE}|s" $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./PigSensitivity" ]; then
++			# TODO: Implement step 4
++
++			# STEP_FOUR # {{{
++			STEP_FOUR="\n disp('Needs work!')"
++			#}}}
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i '' "s|if any(steps==4)|&${STEP_FOUR}|" $RUNME_FILE
++			RUN_EXAMPLE=0
++		elif [ "${dir}" == "./shakti" ]; then
++			sed -i '.bak' 's|steps=\[1:3\];|steps=\[1:3\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./SlrFarrell" ]; then
++			# TODO: Convert from md.slr
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=0
++		elif [ "${dir}" == "./SlrGRACE" ]; then
++			# TODO: Convert from md.slr
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=0
++		elif [ "${dir}" == "./SlrGRACE_NIMS" ]; then
++			# TODO: Convert from md.slr
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=0
++		elif [ "${dir}" == "./SquareIceShelf" ]; then
++			sed -i '.bak' '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			RUN_EXAMPLE=1
++		elif [ "${dir}" == "./UncertaintyQuantification" ]; then
++			#Step 3: sampling analysis
++			#Index exceeds the number of array elements (1).
++			#
++			#Error in AreaAverageOntoPartition (line 50)
++			#	partvector(i)=sum(weightedvector(pos))/sum(md.qmu.vertex_weight(pos));
++			#
++			#Error in runme (line 78)
++			#	DeltaHH_on_partition=AreaAverageOntoPartition(md,DeltaHH,partition);
++			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			RUN_EXAMPLE=0
++		else
++			echo "Not implemented yet!"
++			exit 1
++		fi
++
++		if [ $RUN_EXAMPLE -eq 1 ]; then
++			echo "Testing example: $(basename $dir)"
++			LOG_RUNME_FILE="matlab_log_$(basename $dir)_examples.log"
++			echo -e ${STATUS_HANDLING} >> ${RUNME_FILE}
++			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; runme" -logfile $ISSM_DIR/nightlylog/$LOG_RUNME_FILE
++			echo "starting: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
++			cat $ISSM_DIR/nightlylog/$LOG_RUNME_FILE >> $ISSM_DIR/nightlylog/matlab_log_examples.log
++			echo "finished: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
++			mv -f ${RUNME_FILE}.bak ${RUNME_FILE}
++		else
++			echo "Skipping: $(basename $dir)"
++		fi
++
++		# Extra clean up
++		if [ "${dir}" == "./ISMIP" ]; then
++			mv -f IsmipA.par.bak IsmipA.par
++			mv -f IsmipF.par.bak IsmipF.par
++		fi
++
++		if [ "${dir}" == "./Pig" ]; then
++			mv -f DomainOutline.exp DomainOutline.bkp
++		fi
++
++		cd ..
++	fi
++done
+
+Property changes on: ../trunk-jpl/jenkins/examples_tests.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(nonexistent)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25915)
+@@ -0,0 +1,83 @@
++# NOTE: Same configuration as pine_island-mac-full
++
++#--------------------#
++# ISSM Configuration #
++#--------------------#
++
++MATLAB_PATH="/Applications/MATLAB_R2019b.app"
++
++ISSM_CONFIG='\
++	--prefix=${ISSM_DIR} \
++	--disable-static \
++	--enable-development \
++	--enable-debugging \
++	--with-numthreads=4 \
++	--with-matlab-dir=${MATLAB_PATH} \
++	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
++	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
++	--with-mpi-libflags="-L${ISSM_EXT_SHARED_DIR}/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
++	--with-blas-lapack-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
++	--with-metis-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
++	--with-scalapack-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
++	--with-mumps-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
++	--with-hdf5-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
++	--with-petsc-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
++	--with-gsl-dir=${ISSM_EXT_SHARED_DIR}/gsl/install \
++	--with-boost-dir=${ISSM_EXT_SHARED_DIR}/boost/install \
++	--with-dakota-dir=${ISSM_EXT_SHARED_DIR}/dakota/install \
++	--with-triangle-dir=${ISSM_EXT_SHARED_DIR}/triangle/install \
++	--with-chaco-dir=${ISSM_EXT_DIR}/chaco/install \
++	--with-m1qn3-dir=${ISSM_EXT_DIR}/m1qn3/install \
++	--with-semic-dir=${ISSM_EXT_DIR}/semic/install \
++'
++
++#-------------------#
++# External Packages #
++#-------------------#
++
++EXTERNALPACKAGES="
++	autotools	install.sh
++	cmake		install.sh
++	petsc		install-3.12-mac.sh
++	gsl			install.sh
++	boost		install-1.7-mac.sh
++	dakota		install-6.2-mac.sh
++	curl		install-7-mac.sh
++	netcdf		install-4.7-parallel.sh
++	proj		install-6.2.sh
++	gdal		install-3-python.sh
++	gshhg		install.sh
++	gmt			install-6-mac.sh
++	gmsh		install-4.sh
++	triangle	install-mac.sh
++	chaco		install.sh
++	m1qn3		install.sh
++	semic		install.sh
++	shell2junit	install.sh
++"
++
++#---------#
++# Testing #
++#---------#
++
++# Test suites
++MATLAB_TEST=0
++PYTHON_TEST=0
++JAVASCRIPT_TEST=0
++EXAMPLES_TEST=1
++
++# Number of CPUs used in ISSM compilation
++#
++# NOTE: One is usually safer as some packages are very sensitive to parallel
++# 		compilation
++#
++NUMCPUS_INSTALL=8
++
++# Number of CPUs used in the nightly runs
++NUMCPUS_RUN=1
++
++# Nightly run options
++MATLAB_NROPTIONS=""
++PYTHON_NROPTIONS=""
+
+Property changes on: ../trunk-jpl/jenkins/pine_island-mac-examples
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test418.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test418.m	(revision 25914)
++++ ../trunk-jpl/test/NightlyRun/test418.m	(revision 25915)
+@@ -8,8 +8,7 @@
+ 
+ %partitioning
+ npart=100;
+-[partition, md]=partitioner(md,'package','chaco','npart',npart);
+-partition=partition-1;
++partition=partitioner(md,'package','chaco','npart',npart)-1;
+ 
+ vector=(1:1:md.mesh.numberofvertices)';
+ vector_on_partition=AreaAverageOntoPartition(md,vector,partition);
Index: /issm/oecreview/Archive/25834-26739/ISSM-25915-25916.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25915-25916.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25915-25916.diff	(revision 26740)
@@ -0,0 +1,513 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25915)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25916)
+@@ -1,6 +1,6 @@
+ #!/bin/bash
+ ################################################################################
+-# This bash script manages installation of ISSM on a given Jenkins node using a
++# This script manages installation of ISSM on a given Jenkins node using a
+ # configuration file passed as the only argument. This file also contains
+ # details about which nightly run tests should be executed after the build has
+ # been completed. Finally, results of the build and tests are emailed to the
+@@ -22,14 +22,12 @@
+ 
+ #Get configuration
+ #Source config file{{{
+-if [ $# -ne 1 ];
+-then
++if [ $# -ne 1 ]; then
+ 	#no config file specified: exit
+ 	echo "no config file specified. Exiting..." >&2 # Error message to stderr.
+ 	exit 1
+ fi
+-if [ ! -f "$1" ]
+-then
++if [ ! -f "$1" ]; then
+ 	echo "File $1 not found!" >&2 # Error message to stderr.
+ 	exit 1
+ fi
+@@ -45,10 +43,15 @@
+ NUMCPUS_INSTALL=1
+ NUMCPUS_RUN=1
+ 
+-
+ #source configuration script
+ source $1;
+ #}}}
++
++if [[ $EXAMPLES_TEST -eq 1 && $MATLAB_TEST+$PYTHON_TEST+$JAVASCRIPT_TEST -ne 0 ]]; then
++	echo "When running examples tests, set *only* EXAMPLES_TEST=1"
++	exit 1
++fi
++
+ #Get Operating system (OS) name{{{
+ OS=$(uname -s)
+ if [[ $OS == CYGWIN* ]]; then
+@@ -61,8 +64,7 @@
+ echo "======================================================";
+ echo "             Determining Installation type            "
+ echo "======================================================";
+-if [ -a $ISSM_DIR/svn_revision_old ]
+-then
++if [ -a $ISSM_DIR/svn_revision_old ]; then
+ 	SVN_PREVIOUS=$(cat $ISSM_DIR/svn_revision_old)
+ 	SVN_CURRENT=$SVN_REVISION_1
+ 	echo "Previous revision number: $SVN_PREVIOUS"
+@@ -96,11 +98,11 @@
+ 
+ 	# If the contents of the externalpackages directory were modified in any
+ 	# way, check for changed external packages
+-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep externalpackages)" ] ; then
+-		echo "  -- checking for changed externalpackages... yes";
++	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep externalpackages)" ]; then
++		echo "  -- checking for changed externalpackages... yes"
+ 		ISSM_EXTERNALPACKAGES="yes"
+ 	else
+-		echo "  -- checking for changed externalpackages... no";
++		echo "  -- checking for changed externalpackages... no"
+ 		ISSM_EXTERNALPACKAGES="no"
+ 	fi
+ 
+@@ -108,23 +110,21 @@
+ 	# binary files from a previous compilation do not exist, reconfigure
+ 	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
+ 		[ ! -f "$ISSM_DIR/bin/issm.exe" ] && [ ! -f "$ISSM_DIR/bin/issm-bin.js" ] ||
+-		[ "$ISSM_EXTERNALPACKAGES" == "yes" ] ;
+-	then
+-		echo "  -- checking for reconfiguration... yes";
++		[ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then
++		echo "  -- checking for reconfiguration... yes"
+ 		ISSM_RECONFIGURE="yes"
+ 	else
+-		echo "  -- checking for reconfiguration... no";
++		echo "  -- checking for reconfiguration... no"
+ 		ISSM_RECONFIGURE="no"
+ 	fi
+ 
+ 	# If source files were changed in any way, recompile
+ 	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
+-		[ "$ISSM_RECONFIGURE" == "yes" ] ;
+-	then
+-		echo "  -- checking for recompilation... yes";
++		[ "$ISSM_RECONFIGURE" == "yes" ]; then
++		echo "  -- checking for recompilation... yes"
+ 		ISSM_COMPILATION="yes"
+ 	else
+-		echo "  -- checking for recompilation... no";
++		echo "  -- checking for recompilation... no"
+ 		ISSM_COMPILATION="no"
+ 	fi
+ 
+@@ -133,9 +133,9 @@
+ 	rm $ISSM_DIR/TEMP
+ else
+ 	echo "Previous revision not found, this must be a fresh install"
+-	echo "  -- checking for changed externalpackages... yes";
+-	echo "  -- checking for reconfiguration... yes";
+-	echo "  -- checking for recompilation... yes";
++	echo "  -- checking for changed externalpackages... yes"
++	echo "  -- checking for reconfiguration... yes"
++	echo "  -- checking for recompilation... yes"
+ 	ISSM_EXTERNALPACKAGES="yes"
+ 	ISSM_RECONFIGURE="yes"
+ 	ISSM_COMPILATION="yes"
+@@ -167,8 +167,7 @@
+ 
+ EXTERNALPACKAGES_FAILED=0;
+ 
+-for ((i=1;i<=$NUMPACKAGES;i++))
+-do
++for ((i=1;i<=$NUMPACKAGES;i++)); do
+ 	NUM1=$((2*$i-1))
+ 	NUM2=$((2*$i))
+ 	PACKAGENAME=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM1-$NUM1)
+@@ -175,7 +174,7 @@
+ 	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
+ 
+ 	#install if requested or if previous install has not been successful
+-	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ] || [[ ! -d ./install && ! -d ./install-javascript ]]; then
++	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
+ 		cd $ISSM_DIR/externalpackages/$PACKAGENAME
+ 
+ 		echo "======================================================";
+@@ -197,7 +196,7 @@
+ 		else
+ 			echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\"/>" >> $EXTERNAL_TEST_FILE
+ 		fi
+-		source $ISSM_DIR/etc/environment.sh
++		source $ISSM_DIR/etc/environment-shared.sh
+ 
+ 		#If external package is rebuilt, we also need to recompile
+ 		ISSM_RECONFIGURE="yes"
+@@ -209,6 +208,7 @@
+ 		echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\"/>" >> $EXTERNAL_TEST_FILE
+ 	fi
+ done
++
+ echo '</testsuite>' >> $EXTERNAL_TEST_FILE
+ 
+ if [ $EXTERNALPACKAGES_FAILED -eq 1 ]; then
+@@ -219,7 +219,7 @@
+ fi
+ 
+ # Source here to include any newly installed externalpackages on the path.
+-source $ISSM_DIR/etc/environment.sh
++source $ISSM_DIR/etc/environment-shared.sh
+ 
+ if [ "$OS" == "win" ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
+@@ -248,11 +248,9 @@
+ 
+ #}}}
+ #ISSM compilation yes/no                (ISSM_COMPILATION) {{{
+-if [ "$ISSM_COMPILATION" == "yes" ]
+-then
++if [ "$ISSM_COMPILATION" == "yes" ]; then
+ 	cd $ISSM_DIR
+-	if [ "$ISSM_RECONFIGURE" == "yes" ]
+-	then
++	if [ "$ISSM_RECONFIGURE" == "yes" ]; then
+ 		echo "======================================================";
+ 		echo "             Cleaning up and reconfiguring            "
+ 		echo "======================================================";
+@@ -273,9 +271,9 @@
+ 	fi
+ 
+ 	#4: compile and install ISSM
+-	echo "======================================================";
++	echo "======================================================"
+ 	echo "                    Compiling ISSM                    "
+-	echo "======================================================";
++	echo "======================================================"
+ 	if [ $NUMCPUS_INSTALL -gt 1 ]; then
+ 		echo "Making with " $NUMCPUS_INSTALL " cpus"
+ 		make -j $NUMCPUS_INSTALL
+@@ -309,82 +307,76 @@
+ #matlab tests
+ # {{{
+ if [ $MATLAB_TEST -eq 1 ]; then
+-#Launch all tests on different cpus
+-for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+-do
+-	#Launch matlab and the nightly run script
+-	cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
+-	warning off %necessary to avoid a log of several Go for parallel runs
+-	try,
+-	$(if [ "$MATLAB_NROPTIONS" = "" ]; then
+-		echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
+-	else
+-		echo "runme($MATLAB_NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
+-	fi
+-	)
+-	catch me,
+-		%An error occured, get report and exit
+-		message=getReport(me)
+-		directory=strsplit(pwd,'/');
+-		fid=fopen([issmdir '/nightlylog/matlaberror.log'], 'at');
+-		fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
+-		fprintf(fid,'%s',message);
+-		fclose(fid);
+-	end
+-	disp('MATLABEXITEDCORRECTLY');
++	#Launch all tests on different cpus
++	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
++		#Launch matlab and the nightly run script
++		cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
++		warning off %necessary to avoid a log of several Go for parallel runs
++		try,
++			$(if [ "$MATLAB_NROPTIONS" = "" ]; then
++				echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
++			else
++				echo "runme($MATLAB_NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
++			fi)
++		catch me,
++			%An error occured, get report and exit
++			message=getReport(me)
++			directory=strsplit(pwd,'/');
++			fid=fopen([issmdir '/nightlylog/matlaberror.log'], 'at');
++			fprintf(fid,'\nMatlab error occured in: %s\n\n',directory{end});
++			fprintf(fid,'%s',message);
++			fclose(fid);
++		end
++		disp('MATLABEXITEDCORRECTLY');
++		exit
++EOF
++		cd $ISSM_DIR/test/NightlyRun
++		if [ "$OS" = "win" ]; then
++			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
++		else
++			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
++		fi
++	done
+ 
+-	exit
+-EOF
+-	cd $ISSM_DIR/test/NightlyRun
++	#wait until matlab closes
+ 	if [ "$OS" = "win" ]; then
+-		$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
++		sleep 5;
++		echo "Waiting for matlab on windows"
++		pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
++		echo '-----------------------------'
++		echo "pid: $pid"
++		echo '-----------------------------'
++		while [ -n "$pid" ]; do
++			pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
++			sleep 1;
++		done
++		echo "DONE!"
+ 	else
+-		$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
++		wait
+ 	fi
+-done
+ 
+-#wait until matlab closes
+-if [ "$OS" = "win" ]; then
+-	sleep 5;
+-	echo "Waiting for matlab on windows"
+-	pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+-	echo '-----------------------------'
+-	echo "pid: $pid"
+-	echo '-----------------------------'
+-	while [ -n "$pid" ]
+-	do
+-		pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+-		sleep 1;
+-	done
+-	echo "DONE!"
+-else
+-	wait
+-fi
++	#concatenate reports
++	cd $ISSM_DIR/nightlylog/
++	#echo 'CHECKING NIGHTLYLOG DIRECTORY'
++	#echo '-----------------------------'
++	#ls -la
++	#echo '-----------------------------'
+ 
+-#concatenate reports
+-cd $ISSM_DIR/nightlylog/
+-#echo 'CHECKING NIGHTLYLOG DIRECTORY'
+-#echo '-----------------------------'
+-#ls -la
+-#echo '-----------------------------'
++	if [ -f matlab_log.log ]; then
++		rm matlab_log.log
++	fi
+ 
+-if [ -f matlab_log.log ]; then
+-	rm matlab_log.log
+-fi
++	for job in `jobs -p`; do
++		echo "Waiting on: $job"
++		wait $job
++	done
+ 
+-for job in `jobs -p`
+-do
+-	echo "Waiting on: $job"
+-	wait $job
+-done
++	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
++		cat matlab_log$i.log >> matlab_log.log
++	done
+ 
+-for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+-do
+-	cat matlab_log$i.log >> matlab_log.log
+-done
+-
+-#filter out windows characters:
+-cat matlab_log.log | tr -cd '\11\12\40-\176' > matlab_log.log2 && mv matlab_log.log2 matlab_log.log
++	#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
+ # }}}
+ 
+@@ -428,104 +420,25 @@
+ # Clean up ADOL-C tape files
+ rm -f $ISSM_DIR/execution/*/ADOLC-*
+ 
+-# Examples Test
++# Examples Tests
+ # {{{
+-# This test will allow us to check on the status of the examples.
+-if [ $EXAMPLES_TEST -eq 1 ];
+-then
+-	FILE='runme.m'
+-	cd $ISSM_DIR/examples
+-
+-	for dir in ./* ;
+-	do
+-		if [ -d "${dir}" ];
+-		then
+-		# Some of the examples are incomplete (on purpose). As such, we will
+-		# have to populate the missing steps in order to make sure that
+-		# everything is working.
+-			echo "Testing directory example: $(basename $dir)"
+-
+-			if [ -z "$SED" ];
+-			then
+-				SED='sed'
+-			fi
+-
+-			cd ${dir}
+-
+-			if [ "${dir}" == "./Greenland" ];
+-			then
+-				# Greenland is missing step 8
+-				STEP_EIGHT="\n	disp('   Step 8: Plotting exercise');\n	md = loadmodel('.\/Models\/Greenland.HistoricTransient');\n	figure\n	surfmb=[]; for i=2:201; surfmb=[surfmb ...\n		md.results.TransientSolution(i).SmbMassBalance]; end\n	subplot(3,1,1); plot([1:200],mean(surfmb));\n	title('Mean Surface mass balance');\n	vel=[]; for i=2:201; vel=[vel md.results.TransientSolution(i).Vel]; end\n	subplot(3,1,2); plot([1:200],mean(vel));\n	title('Mean Velocity');\n	volume=[]; for i=2:201; volume=[volume md.results.TransientSolution(i).IceVolume]; end\n	subplot(3,1,3); plot([1:200],volume);\n	title('Ice Volume'); xlabel('years');"
+-
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:8\];\n\ntry\n/' $FILE
+-				$SED -i .bak "s/if any(steps==8)/&${STEP_EIGHT}/" $FILE
+-			elif [ "${dir}" == "./IceBridge" ];
+-			then
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:5\];\n\ntry\n/' $FILE
+-			elif [ "${dir}" == "./IceflowModels" ];
+-			then
+-				# Almost nothing to this example
+-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
+-			elif [ "${dir}" == "./ISMIP" ];
+-			then
+-				# Eight steps... none of which are implmented in the script...
+-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
+-			elif [ "${dir}" == "./Inversion" ];
+-			then
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
+-			elif [ "${dir}" == "./Jakobshavn" ];
+-			then
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
+-			elif [ "${dir}" == "./Jakobshavn" ];
+-			then
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
+-			elif [ "${dir}" == "./Pig" ];
+-			then
+-				# Step 6 is needed
+-				STEP_SIX="\n disp('Needs work!')"
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:7\];\n!mv DomainOutline.bkp DomainOutline.exp;\n\ntry\n/' $FILE
+-				$SED -i .bak "s/if any(steps==6)/&${STEP_SIX}/" $FILE
+-			elif [ "${dir}" == "./PigSensitivity" ];
+-			then
+-				# Step 4 is needed
+-				STEP_FOUR="\n disp('Needs work!')"
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
+-				$SED -i .bak "s/if any(steps==6)/&${STEP_FOUR}/" $FILE
+-			elif [ "${dir}" == "./SquareIceShelf" ];
+-			then
+-				# Almost nothing to this example
+-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
+-			elif [ "${dir}" == "./UncertaintyQuantification" ];
+-			then
+-				$SED -i .bak 's/steps=\[1\];/steps=\[1:7\];\n\ntry\n/' $FILE
+-			elif [ "${dir}" == "./Data" ];
+-			then
+-				echo "Data directory is used by examples. No modifications required."
+-			else
+-				echo "Not implemented yet!"
+-				$SED -i .bak '1 s/^.*$/try\n\n&/' $FILE
+-			fi
+-
+-			if [ "${dir}" == "./Data" ];
+-			then
+-				./Download.sh
+-			else
+-				LOG_FILE="matlab_log_$(basename $dir)_examples.log"
+-				echo "disp('SUCCESS');" >> $FILE
+-				echo 'catch me' >> $FILE
+-				echo 'message=getReport(me);' >> $FILE
+-				echo "fprintf('%s',message);" >> $FILE
+-				echo "disp('FAILURE');" >> $FILE
+-				echo 'end' >> $FILE
+-
+-				$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; runme" -logfile $ISSM_DIR/nightlylog/$LOG_FILE
+-				echo "starting: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+-				cat $ISSM_DIR/nightlylog/$LOG_FILE >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+-				echo "finished: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+-			fi
+-			cd ..
+-		fi
+-	done
++# The following tests check that the examples (i.e. contents of examples 
++# directory, which are implementations of the tutorials found at 
++# https://issm.jpl.nasa.gov/documentation/tutorials/) can be run.
++#
++# runme files are modifed as needed to fill in statements that would otherwise 
++# be added by user.
++#
++# NOTE: 
++# - Indentation of replacement string literals (e.g. 'STEP_EIGHT') is set to 
++# 	nest cleanly in this file, but will result in unclean nesting runme file 
++# 	(which should not be an issue)
++# - Single-line string replacements in runme.m can effectively be performed 
++#	using sed. When performing multi-line replacements, perl is a better 
++#	option.
++#
++if [ $EXAMPLES_TEST -eq 1 ]; then
++	$ISSM_DIR/jenkins/examples_tests.sh
+ fi
+ # }}}
+ 
+@@ -541,8 +454,7 @@
+ 	testlist=`cat matlab_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
+ 
+ 	#look through numtests:
+-	for i in `echo $testlist`
+-	do
++	for i in `echo $testlist`; do
+ 		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" matlab_log.log
+ 		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" matlab_log.log
+ 	done
+@@ -550,8 +462,7 @@
+ 	# Check that MATLAB did not exit in error
+ 	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab_log.log | wc -l`
+ 
+-	if [ $matlabExitedInError -ne 0 ]
+-	then
++	if [ $matlabExitedInError -ne 0 ]; then
+ 		echo "----------MATLAB exited in error!----------"
+ 		cat matlab_log.log
+ 		echo "-----------End of matlab_log.log-----------"
+@@ -569,8 +480,7 @@
+ 	testlist=`cat python_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
+ 
+ 	#look through numtests:
+-	for i in `echo $testlist`
+-	do
++	for i in `echo $testlist`; do
+ 		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" python_log.log
+ 		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" python_log.log
+ 	done
+@@ -578,8 +488,7 @@
+ 	# Check that Python did not exit in error
+ 	pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python_log.log | wc -l`
+ 
+-	if [ $pythonExitedInError -ne 0 ]
+-	then
++	if [ $pythonExitedInError -ne 0 ]; then
+ 		echo "----------Python exited in error!----------"
+ 		cat python_log.log
+ 		echo "-----------End of python_log.log-----------"
+@@ -594,17 +503,15 @@
+ 	echo "PYTHONEXITEDCORRECTLY"
+ fi
+ 
+-if [ $EXAMPLES_TEST -eq 1 ];
+-then
++if [ $EXAMPLES_TEST -eq 1 ]; then
+ 	# Inexplicably, there are backspace chars in the error output that are causing issues
+-	$SED -i .bak 's///g' matlab_log_examples.log
++	sed -i '.bak' 's///g' matlab_log_examples.log
+ 
+ 	numtests=`cat matlab_log_examples.log | grep "starting: " | wc -l`
+ 	testlist=`cat matlab_log_examples.log | grep "starting: " | sed 's/starting: //'`
+ 
+ 	echo "Processing: $numtests"
+-	for i in `echo $testlist`
+-	do
++	for i in `echo $testlist`; do
+ 		juLog -test=Example-$i -name=Error -error=FAILURE awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
+ 	done
+ fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25916-25917.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25916-25917.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25916-25917.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25916)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25917)
+@@ -196,7 +196,7 @@
+ 		else
+ 			echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\"/>" >> $EXTERNAL_TEST_FILE
+ 		fi
+-		source $ISSM_DIR/etc/environment-shared.sh
++		source $ISSM_DIR/etc/environment.sh
+ 
+ 		#If external package is rebuilt, we also need to recompile
+ 		ISSM_RECONFIGURE="yes"
+@@ -219,7 +219,7 @@
+ fi
+ 
+ # Source here to include any newly installed externalpackages on the path.
+-source $ISSM_DIR/etc/environment-shared.sh
++source $ISSM_DIR/etc/environment.sh
+ 
+ if [ "$OS" == "win" ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
Index: /issm/oecreview/Archive/25834-26739/ISSM-25917-25918.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25917-25918.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25917-25918.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test418.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test418.m	(revision 25917)
++++ ../trunk-jpl/test/NightlyRun/test418.m	(revision 25918)
+@@ -8,7 +8,7 @@
+ 
+ %partitioning
+ npart=100;
+-partition=partitioner(md,'package','chaco','npart',npart)-1;
++[partition,md]=partitioner(md,'package','chaco','npart',npart)-1;
+ 
+ vector=(1:1:md.mesh.numberofvertices)';
+ vector_on_partition=AreaAverageOntoPartition(md,vector,partition);
Index: /issm/oecreview/Archive/25834-26739/ISSM-25918-25919.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25918-25919.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25918-25919.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25918)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25919)
+@@ -4,7 +4,7 @@
+ # ISSM Configuration #
+ #--------------------#
+ 
+-MATLAB_PATH="/Applications/MATLAB_R2019b.app"
++MATLAB_PATH="/Applications/MATLAB_R2018a.app"
+ 
+ ISSM_CONFIG='\
+ 	--prefix=${ISSM_DIR} \
Index: /issm/oecreview/Archive/25834-26739/ISSM-25919-25920.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25919-25920.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25919-25920.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/m/partition/partitioner.m
+===================================================================
+--- ../trunk-jpl/src/m/partition/partitioner.m	(revision 25919)
++++ ../trunk-jpl/src/m/partition/partitioner.m	(revision 25920)
+@@ -1,4 +1,4 @@
+-function [partitionvector, md]=partitioner(md,varargin)
++function [partitionvector,md]=partitioner(md,varargin)
+ %PARTITIONER - partition mesh 
+ %
+ %   List of options to partitioner: 
+Index: ../trunk-jpl/test/NightlyRun/test418.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test418.m	(revision 25919)
++++ ../trunk-jpl/test/NightlyRun/test418.m	(revision 25920)
+@@ -8,7 +8,8 @@
+ 
+ %partitioning
+ npart=100;
+-[partition,md]=partitioner(md,'package','chaco','npart',npart)-1;
++[partition,md]=partitioner(md,'package','chaco','npart',npart);
++partition=partition-1;
+ 
+ vector=(1:1:md.mesh.numberofvertices)';
+ vector_on_partition=AreaAverageOntoPartition(md,vector,partition);
+Index: ../trunk-jpl/test/NightlyRun/test418.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test418.py	(revision 25919)
++++ ../trunk-jpl/test/NightlyRun/test418.py	(revision 25920)
+@@ -24,7 +24,7 @@
+ #partitioning
+ npart = 100
+ 
+-# Partitioner seamed to generate the following message,
++# Partitioner seemed to generate the following message,
+ #
+ #	corrupted size vs. prev_size
+ #	Aborted (core dumped)
Index: /issm/oecreview/Archive/25834-26739/ISSM-25920-25921.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25920-25921.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25920-25921.diff	(revision 26740)
@@ -0,0 +1,33 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25920)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25921)
+@@ -17,17 +17,17 @@
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+ 	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+-	--with-mpi-libflags="-L${ISSM_EXT_SHARED_DIR}/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+-	--with-blas-lapack-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
+-	--with-metis-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
+-	--with-scalapack-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
+-	--with-mumps-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
+-	--with-hdf5-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
+-	--with-petsc-dir=${ISSM_EXT_SHARED_DIR}/petsc/install \
+-	--with-gsl-dir=${ISSM_EXT_SHARED_DIR}/gsl/install \
+-	--with-boost-dir=${ISSM_EXT_SHARED_DIR}/boost/install \
+-	--with-dakota-dir=${ISSM_EXT_SHARED_DIR}/dakota/install \
+-	--with-triangle-dir=${ISSM_EXT_SHARED_DIR}/triangle/install \
++	--with-mpi-libflags="-L${ISSM_DIR}/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
++	--with-blas-lapack-dir=${ISSM_DIR}/petsc/install \
++	--with-metis-dir=${ISSM_DIR}/petsc/install \
++	--with-scalapack-dir=${ISSM_DIR}/petsc/install \
++	--with-mumps-dir=${ISSM_DIR}/petsc/install \
++	--with-hdf5-dir=${ISSM_DIR}/petsc/install \
++	--with-petsc-dir=${ISSM_DIR}/petsc/install \
++	--with-gsl-dir=${ISSM_DIR}/gsl/install \
++	--with-boost-dir=${ISSM_DIR}/boost/install \
++	--with-dakota-dir=${ISSM_DIR}/dakota/install \
++	--with-triangle-dir=${ISSM_DIR}/triangle/install \
+ 	--with-chaco-dir=${ISSM_EXT_DIR}/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_EXT_DIR}/m1qn3/install \
+ 	--with-semic-dir=${ISSM_EXT_DIR}/semic/install \
Index: /issm/oecreview/Archive/25834-26739/ISSM-25921-25922.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25921-25922.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25921-25922.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25921)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25922)
+@@ -16,18 +16,18 @@
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+ 	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+-	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+-	--with-mpi-libflags="-L${ISSM_DIR}/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+-	--with-blas-lapack-dir=${ISSM_DIR}/petsc/install \
+-	--with-metis-dir=${ISSM_DIR}/petsc/install \
+-	--with-scalapack-dir=${ISSM_DIR}/petsc/install \
+-	--with-mumps-dir=${ISSM_DIR}/petsc/install \
+-	--with-hdf5-dir=${ISSM_DIR}/petsc/install \
+-	--with-petsc-dir=${ISSM_DIR}/petsc/install \
+-	--with-gsl-dir=${ISSM_DIR}/gsl/install \
+-	--with-boost-dir=${ISSM_DIR}/boost/install \
+-	--with-dakota-dir=${ISSM_DIR}/dakota/install \
+-	--with-triangle-dir=${ISSM_DIR}/triangle/install \
++	--with-mpi-include=${ISSM_EXT_DIR}/externalpackages/petsc/install/include \
++	--with-mpi-libflags="-L${ISSM_EXT_DIR}/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
++	--with-blas-lapack-dir=${ISSM_EXT_DIR}/petsc/install \
++	--with-metis-dir=${ISSM_EXT_DIR}/petsc/install \
++	--with-scalapack-dir=${ISSM_EXT_DIR}/petsc/install \
++	--with-mumps-dir=${ISSM_EXT_DIR}/petsc/install \
++	--with-hdf5-dir=${ISSM_EXT_DIR}/petsc/install \
++	--with-petsc-dir=${ISSM_EXT_DIR}/petsc/install \
++	--with-gsl-dir=${ISSM_EXT_DIR}/gsl/install \
++	--with-boost-dir=${ISSM_EXT_DIR}/boost/install \
++	--with-dakota-dir=${ISSM_EXT_DIR}/dakota/install \
++	--with-triangle-dir=${ISSM_EXT_DIR}/triangle/install \
+ 	--with-chaco-dir=${ISSM_EXT_DIR}/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_EXT_DIR}/m1qn3/install \
+ 	--with-semic-dir=${ISSM_EXT_DIR}/semic/install \
Index: /issm/oecreview/Archive/25834-26739/ISSM-25922-25923.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25922-25923.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25922-25923.diff	(revision 26740)
@@ -0,0 +1,183 @@
+Index: ../trunk-jpl/test/NightlyRun/test417.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test417.m	(revision 25922)
++++ ../trunk-jpl/test/NightlyRun/test417.m	(revision 25923)
+@@ -20,7 +20,8 @@
+ 
+ %partitioning
+ npart=20;
+-partition=partitioner(md,'package','chaco','npart',npart,'weighting','on')-1;
++[partition,md]=partitioner(md,'package','chaco','npart',npart,'weighting','on');
++partition=partition-1;
+ md.qmu.isdakota=1;
+ 
+ md.qmu.variables.drag_coefficient=normal_uncertain('descriptor','scaled_FrictionCoefficient',...
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25922)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25923)
+@@ -68,7 +68,8 @@
+ 
+ 	%partition the mesh
+ 	npart=50;
+-	partition=partitioner(md,'package','chaco','npart',npart,'weighting','on')-1;
++	[partition,md]=partitioner(md,'package','chaco','npart',npart,'weighting','on');
++	partition=partition-1;
+ 
+ 	%make DeltaHH into our 3 sigma deviation
+ 	DeltaHH=DeltaHH/6; %2 (to transform DeltaHH into a radius) x 3 (for 3 sigma)
+@@ -81,32 +82,19 @@
+ 		'partition',partition);
+ 
+ 	%responses
+-	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]); %grounding line
+-	md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux8=response_function('indexed_MassFlux_8',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux9=response_function('indexed_MassFlux_9',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux10=response_function('indexed_MassFlux_10',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux11=response_function('indexed_MassFlux_11',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux12=response_function('indexed_MassFlux_12',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux13=response_function('indexed_MassFlux_13',[],...
+-		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux1=response_function('descriptor','indexed_MassFlux_1');
++	md.qmu.responses.MassFlux2=response_function('descriptor','indexed_MassFlux_2'); %grounding line
++	md.qmu.responses.MassFlux3=response_function('descriptor','indexed_MassFlux_3');
++	md.qmu.responses.MassFlux4=response_function('descriptor','indexed_MassFlux_4');
++	md.qmu.responses.MassFlux5=response_function('descriptor','indexed_MassFlux_5');
++	md.qmu.responses.MassFlux6=response_function('descriptor','indexed_MassFlux_6');
++	md.qmu.responses.MassFlux7=response_function('descriptor','indexed_MassFlux_7');
++	md.qmu.responses.MassFlux8=response_function('descriptor','indexed_MassFlux_8');
++	md.qmu.responses.MassFlux9=response_function('descriptor','indexed_MassFlux_9');
++	md.qmu.responses.MassFlux10=response_function('descriptor','indexed_MassFlux_10');
++	md.qmu.responses.MassFlux11=response_function('descriptor','indexed_MassFlux_11');
++	md.qmu.responses.MassFlux12=response_function('descriptor','indexed_MassFlux_12');
++	md.qmu.responses.MassFlux13=response_function('descriptor','indexed_MassFlux_13');
+ 
+ 	%mass flux profiles
+ 	md.qmu.mass_flux_profiles={...
+@@ -124,7 +112,7 @@
+ 		'MassFlux12.exp',...
+ 		'MassFlux13.exp'...
+ 	};
+-	md.qmu.mass_flux_profile_directory='../MassFluxes/';
++	md.qmu.mass_flux_profile_directory='./MassFluxes/';
+ 
+ 	%%  sampling analysis
+ 	md.qmu.method		=dakota_method('nond_samp');
+@@ -170,33 +158,40 @@
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+ 
+ 	%partition the mesh
+-	md.qmu.numberofpartitions=10;
+-	md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+-	md.qmu.partition=md.qmu.partition-1; %switch partition to c-indexing
++	npart=10;
++	[partition,md]=partitioner(md,'package','chaco','weighting','on');
++	partition=partition-1; %switch partition to c-indexing
+ 
+ 	%all types of variables and responses: scaled_Thickness, indexed_MassFlux_i,MaxVel,nodal_DragCoefficient_i. scaled variables are expanded.
+ 
+ 	%variables
+-	md.qmu.variables.DragCoefficient=normal_uncertain(...
+-	'scaled_FrictionCoefficient',1,0.05);
+-	md.qmu.variables.rheology_B=normal_uncertain(...
+-	'scaled_MaterialsRheologyB',1,0.05);
+-	md.qmu.variables.Thickness=normal_uncertain('scaled_Thickness',1,0.05);
++	md.qmu.variables.drag_coefficient=normal_uncertain('descriptor','scaled_FrictionCoefficient',...
++		'mean',ones(npart,1),...
++		'stddev',0.05*ones(npart,1),...
++		'partition',partition);
++	md.qmu.variables.rheology_B=normal_uncertain('descriptor','scaled_MaterialsRheologyB',...
++		'mean',ones(npart,1),...
++		'stddev',0.05*ones(npart,1),...
++		'partition',partition);
++	md.qmu.variables.thickness=normal_uncertain('descriptor','scaled_Thickness',...
++		'mean',ones(npart,1),...
++		'stddev',0.05*ones(npart,1),...
++		'partition',partition);
+ 
+ 	%responses
+-	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux8=response_function('indexed_MassFlux_8',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux9=response_function('indexed_MassFlux_9',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux10=response_function('indexed_MassFlux_10',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux11=response_function('indexed_MassFlux_11',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux12=response_function('indexed_MassFlux_12',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+-	md.qmu.responses.MassFlux13=response_function('indexed_MassFlux_13',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux1=response_function('descriptor','indexed_MassFlux_1');
++	md.qmu.responses.MassFlux2=response_function('descriptor','indexed_MassFlux_2');
++	md.qmu.responses.MassFlux3=response_function('descriptor','indexed_MassFlux_3');
++	md.qmu.responses.MassFlux4=response_function('descriptor','indexed_MassFlux_4');
++	md.qmu.responses.MassFlux5=response_function('descriptor','indexed_MassFlux_5');
++	md.qmu.responses.MassFlux6=response_function('descriptor','indexed_MassFlux_6');
++	md.qmu.responses.MassFlux7=response_function('descriptor','indexed_MassFlux_7');
++	md.qmu.responses.MassFlux8=response_function('descriptor','indexed_MassFlux_8');
++	md.qmu.responses.MassFlux9=response_function('descriptor','indexed_MassFlux_9');
++	md.qmu.responses.MassFlux10=response_function('descriptor','indexed_MassFlux_10');
++	md.qmu.responses.MassFlux11=response_function('descriptor','indexed_MassFlux_11');
++	md.qmu.responses.MassFlux12=response_function('descriptor','indexed_MassFlux_12');
++	md.qmu.responses.MassFlux13=response_function('descriptor','indexed_MassFlux_13');
+ 
+ 	%mass flux profiles
+ 	md.qmu.mass_flux_profiles={...
+@@ -214,7 +209,7 @@
+ 		'MassFlux12.exp',...
+ 		'MassFlux13.exp'...
+ 	};
+-	md.qmu.mass_flux_profile_directory='../MassFluxes/';
++	md.qmu.mass_flux_profile_directory='./MassFluxes/';
+ 
+ 	%method: local reliability
+ 	md.qmu.method     =dakota_method('nond_l');
+@@ -266,12 +261,12 @@
+ 	md = loadmodel('./Models/PIG.Sampling');
+ 
+ 	%which profile are we looking at?
+-	index=1; 	
++	index=1;
+ 
+ 	%retrieve results for the specific profile, mass flux in m^3 water equiv/s
+-	result=md.results.dakota.dresp_dat(md.qmu.numberofpartitions+index);
++	result=md.results.dakota.dresp_dat(npart+index);
+ 	result.sample=result.sample/1e12*60*60*24*365;
+-		
++
+ 	%plot histogram
+ 	plot_hist_norm(result,'cdfleg','off','cdfplt','off','nrmplt','off',...
+ 	'xlabelplt','M (Gt/yr)','ylabelplt','F','FontSize',8,'FaceColor',...
+@@ -291,9 +286,9 @@
+ 	index=1;
+ 
+ 	%To plot sensitivities
+-	sa=md.results.dakota.dresp_out(index).sens(1:10); sa=sa(md.qmu.partition+1)/1e12*60*60*24*365;
+-	sb=md.results.dakota.dresp_out(index).sens(11:20); sb=sb(md.qmu.partition+1)/1e12*60*60*24*365;
+-	sh=md.results.dakota.dresp_out(index).sens(21:30); sh=sh(md.qmu.partition+1)/1e12*60*60*24*365;
++	sa=md.results.dakota.dresp_out(index).sens(1:10); sa=sa(partition+1)/1e12*60*60*24*365;
++	sb=md.results.dakota.dresp_out(index).sens(11:20); sb=sb(partition+1)/1e12*60*60*24*365;
++	sh=md.results.dakota.dresp_out(index).sens(21:30); sh=sh(partition+1)/1e12*60*60*24*365;
+ 
+ 	plotmodel(md,'data',sh,'data',sa,'data',sb,'expdisp#all',...
+ 		['MassFluxes/MassFlux' num2str(index) '.exp'],...
Index: /issm/oecreview/Archive/25834-26739/ISSM-25923-25924.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25923-25924.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25923-25924.diff	(revision 26740)
@@ -0,0 +1,84 @@
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25923)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25924)
+@@ -1,8 +1,21 @@
+ #!/bin/bash
+ ################################################################################
+-# This script runs the examples tests. It is intended to be called from 
+-# jenkins/jenkins.sh and helps organization.
++# This script runs the examples tests (i.e. contents of examples directory, 
++# which are implementations of the tutorials found at 
++# https://issm.jpl.nasa.gov/documentation/tutorials/). It is intended to be 
++# called from jenkins/jenkins.sh.
+ #
++# runme files are modifed as needed to fill in statements that would otherwise 
++# be added by user.
++#
++# NOTE:
++# - Indentation of replacement string literals (e.g. 'STEP_EIGHT') is set to 
++# 	nest cleanly in this file, but will result in unclean nesting runme file 
++# 	(which should not be an issue)
++# - Single-line string replacements in runme.m can effectively be performed 
++#	using sed. When performing multi-line replacements, perl is a better 
++#	option.
++#
+ # TODO:
+ # - Figure out how to remove \ and \n\ from multiline string variables while 
+ #	preserving formatting when value is printed to file.
+@@ -26,6 +39,11 @@
+ 
+ for dir in ./* ; do
+ 	if [ -d "${dir}" ]; then
++		# Temporary short circuit to check single example
++		if [ "${dir}" != "./UncertaintyQuantification" ]; then
++			continue
++		fi
++
+ 		# Some of the examples are incomplete (on purpose). As such, we 
+ 		# will have to populate the missing steps in order to make sure 
+ 		# that everything is working.
+@@ -580,16 +598,8 @@
+ 			sed -i '.bak' '1 s|^.*$|try\n\n&|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./UncertaintyQuantification" ]; then
+-			#Step 3: sampling analysis
+-			#Index exceeds the number of array elements (1).
+-			#
+-			#Error in AreaAverageOntoPartition (line 50)
+-			#	partvector(i)=sum(weightedvector(pos))/sum(md.qmu.vertex_weight(pos));
+-			#
+-			#Error in runme (line 78)
+-			#	DeltaHH_on_partition=AreaAverageOntoPartition(md,DeltaHH,partition);
+ 			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+-			RUN_EXAMPLE=0
++			RUN_EXAMPLE=1
+ 		else
+ 			echo "Not implemented yet!"
+ 			exit 1
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25923)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25924)
+@@ -422,21 +422,6 @@
+ 
+ # Examples Tests
+ # {{{
+-# The following tests check that the examples (i.e. contents of examples 
+-# directory, which are implementations of the tutorials found at 
+-# https://issm.jpl.nasa.gov/documentation/tutorials/) can be run.
+-#
+-# runme files are modifed as needed to fill in statements that would otherwise 
+-# be added by user.
+-#
+-# NOTE: 
+-# - Indentation of replacement string literals (e.g. 'STEP_EIGHT') is set to 
+-# 	nest cleanly in this file, but will result in unclean nesting runme file 
+-# 	(which should not be an issue)
+-# - Single-line string replacements in runme.m can effectively be performed 
+-#	using sed. When performing multi-line replacements, perl is a better 
+-#	option.
+-#
+ if [ $EXAMPLES_TEST -eq 1 ]; then
+ 	$ISSM_DIR/jenkins/examples_tests.sh
+ fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25924-25925.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25924-25925.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25924-25925.diff	(revision 26740)
@@ -0,0 +1,63 @@
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25924)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25925)
+@@ -39,15 +39,10 @@
+ 
+ for dir in ./* ; do
+ 	if [ -d "${dir}" ]; then
+-		# Temporary short circuit to check single example
+-		if [ "${dir}" != "./UncertaintyQuantification" ]; then
+-			continue
+-		fi
++		# Some of the examples are incomplete (on purpose). As such, we will 
++		# have to populate the missing steps in order to make sure that 
++		# everything is working.
+ 
+-		# Some of the examples are incomplete (on purpose). As such, we 
+-		# will have to populate the missing steps in order to make sure 
+-		# that everything is working.
+-
+ 		cd ${dir}
+ 
+ 		if [ "${dir}" == "./AMR" ]; then
+@@ -571,14 +566,35 @@
+ 			perl -0755 -p -i -e "s|if any\(steps==9\).*% step 9 end|${STEP_NINE}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./PigSensitivity" ]; then
+-			# TODO: Implement step 4
+-
+ 			# STEP_FOUR # {{{
+-			STEP_FOUR="\n disp('Needs work!')"
++			STEP_FOUR="\
++				if any(steps==4)\n\
++					%Load model\n\
++					md = loadmodel('./Models/PIG_Transient');\n\
++					\n\
++					%Change external forcing basal melting rate and surface mass balance)\n\
++					md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);\n\
++					md.basalforcings.floatingice_melting_rate=25*ones(md.mesh.numberofvertices,1);\n\
++					md.smb.mass_balance=2*md.smb.mass_balance;\n\
++					\n\
++					%Define time steps and time span of the simulation\n\
++					md.timestepping.time_step=0.1;\n\
++					md.timestepping.final_time=10;\n\
++					\n\
++					%Request additional outputs\n\
++					md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation'};\n\
++					\n\
++					%Solve\n\
++					md=solve(md,'Transient');\n\
++					\n\
++					%Save model\n\
++					save ./Models/PIG_SMB md;\n\
++				end\n\
++			"
+ 			#}}}
+ 			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			sed -i '' "s|if any(steps==4)|&${STEP_FOUR}|" $RUNME_FILE
+-			RUN_EXAMPLE=0
++			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./shakti" ]; then
+ 			sed -i '.bak' 's|steps=\[1:3\];|steps=\[1:3\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
Index: /issm/oecreview/Archive/25834-26739/ISSM-25925-25926.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25925-25926.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25925-25926.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25925)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25926)
+@@ -615,7 +615,7 @@
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./UncertaintyQuantification" ]; then
+ 			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+-			RUN_EXAMPLE=1
++			RUN_EXAMPLE=0
+ 		else
+ 			echo "Not implemented yet!"
+ 			exit 1
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25925)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25926)
+@@ -423,6 +423,7 @@
+ # Examples Tests
+ # {{{
+ if [ $EXAMPLES_TEST -eq 1 ]; then
++	export MATLAB_PATH
+ 	$ISSM_DIR/jenkins/examples_tests.sh
+ fi
+ # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-25926-25927.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25926-25927.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25926-25927.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25926)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25927)
+@@ -496,9 +496,9 @@
+ 	numtests=`cat matlab_log_examples.log | grep "starting: " | wc -l`
+ 	testlist=`cat matlab_log_examples.log | grep "starting: " | sed 's/starting: //'`
+ 
+-	echo "Processing: $numtests"
+ 	for i in `echo $testlist`; do
+-		juLog -test=Example-$i -name=Error -error=FAILURE awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
++		juLog -test=Example-$i -name=Error -error=ERROR awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
++		juLog -test=Example-$i -name=Failure -error=FAILURE awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
+ 	done
+ fi
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25927-25928.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25927-25928.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25927-25928.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/scripts/DownloadExamplesDatasets.sh
+===================================================================
+--- ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(revision 25927)
++++ ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(revision 25928)
+@@ -34,7 +34,7 @@
+ )
+ 
+ # Get datasets
+-wget --no-clobber --directory-prefix="${DIRECTORY_PREFIX}" "${dataset_urls}"
++wget --no-clobber --directory-prefix="${DIRECTORY_PREFIX}" -i - <<< "${dataset_urls}"
+ 
+ # Expand zip files
+ unzip -n -d "${DIRECTORY_PREFIX}" "${DIRECTORY_PREFIX}/*.zip"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25928-25929.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25928-25929.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25928-25929.diff	(revision 26740)
@@ -0,0 +1,84 @@
+Index: ../trunk-jpl/src/m/plot/plotdoc.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotdoc.m	(revision 25928)
++++ ../trunk-jpl/src/m/plot/plotdoc.m	(revision 25929)
+@@ -121,7 +121,7 @@
+ disp('       ''textrotation'':  same as standard ''Rotation'' matlab option applied to text, use a cell of strings if more than one');
+ disp('       ''mask'': list of flags of size numberofnodes or numberofelements. Only ''true'' values are plotted ');
+ disp('       ''nan'': value assigned to NaNs (convenient when plotting BC)');
+-disp('       ''partitionedges'': ''off'' by default. overlay plot of partition edges');
++disp('       ''partition'': a partion vector. generates overlay plot of partition edges');
+ disp('       ''log'': value of log');
+ disp('       ''latlon'': ''on'' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array');
+ disp('       ''latlonnumbering'': ''on'' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,'); 
+Index: ../trunk-jpl/src/m/plot/plotdoc.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotdoc.py	(revision 25928)
++++ ../trunk-jpl/src/m/plot/plotdoc.py	(revision 25929)
+@@ -126,7 +126,7 @@
+     #                '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",
++    #                'partition: " a partion vector. generates overlay plot of partition edges",
+     #                'latlon': " 'on' or {latstep lonstep [resolution [color]]} where latstep, longstep and resolution are in degrees, color is a [r g b] array",
+     #                'latlonnumbering': " 'on' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers",
+     #                '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",
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 25928)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 25929)
+@@ -341,7 +341,6 @@
+ 	if test "x${MATLAB_ROOT}" == "xno"; then
+ 		HAVE_MATLAB=no
+ 	else
+-		HAVE_MATLAB=yes
+ 		if ! test -d "${MATLAB_ROOT}"; then
+ 			AC_MSG_ERROR([MATLAB directory provided (${MATLAB_ROOT}) does not exist!]);
+ 		fi
+@@ -348,6 +347,7 @@
+ 		if ! test -f "${MATLAB_ROOT}/extern/include/mex.h"; then
+ 			AC_MSG_ERROR([Couldn't find mex.h... check your installation of MATLAB])
+ 		fi
++		HAVE_MATLAB=yes
+ 	fi
+ 	AC_MSG_RESULT([${HAVE_MATLAB}])
+ 	AM_CONDITIONAL([MATLAB], [test "x${HAVE_MATLAB}" == "xyes"])
+Index: ../trunk-jpl/src/m/plot/applyoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/applyoptions.m	(revision 25928)
++++ ../trunk-jpl/src/m/plot/applyoptions.m	(revision 25929)
+@@ -447,12 +447,28 @@
+ end
+ 
+ %flag edges of a partition
+-if exist(options,'partitionedges') & ~strcmp(getfieldvalue(options,'partitionedges','off'),'off')
+-	mdp=getfieldvalue(options,'partitionedges','off');
+-	if ischar(mdp)
+-		mdp=md;
++%
++% TODO:
++% - Figure out how to expand string representing an object (e.g. 
++%	'md.qmu.variables.thickness.partition') to get the actual value *without* 
++%	using `eval` and like functions (md.('token').('token') works, but how do 
++%	we access md given the string 'md').
++if exist(options,'partition')
++	partition=getfieldvalue(options,'partition','');
++	if isvector(partition) & isnumeric(partition) % partition option is vector
++		% do nothing: we already have a partition vector
++	% elseif ischar(partition) & ~isempty(partition) % partition option is string
++	% 	% expand string
++	% 	partition=eval(partition);
++	% 	class(partition);
++	% 	if ~(isvector(partition) & isnumeric(partition))
++	% 		error('String passed to ''partition'' option does not represent a partition vector');
++	% 	end
++	else
++		error('If ''partition'' option is supplied, it should be a partition vector object');
+ 	end
+-	[xsegments ysegments]=flagedges(mdp.mesh.elements,mdp.mesh.x,mdp.mesh.y,mdp.qmu.partition);
++	mdp=md;
++	[xsegments ysegments]=flagedges(mdp.mesh.elements,mdp.mesh.x,mdp.mesh.y,partition);
+ 	xsegments=xsegments*getfieldvalue(options,'unit',1);
+ 	ysegments=ysegments*getfieldvalue(options,'unit',1);
+ 	color=getfieldvalue(options,'partitionedgescolor','r-');
Index: /issm/oecreview/Archive/25834-26739/ISSM-25929-25930.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25929-25930.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25929-25930.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25929)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25930)
+@@ -615,7 +615,7 @@
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./UncertaintyQuantification" ]; then
+ 			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+-			RUN_EXAMPLE=0
++			RUN_EXAMPLE=1
+ 		else
+ 			echo "Not implemented yet!"
+ 			exit 1
Index: /issm/oecreview/Archive/25834-26739/ISSM-25930-25931.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25930-25931.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25930-25931.diff	(revision 26740)
@@ -0,0 +1,554 @@
+Index: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh	(nonexistent)
++++ ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh	(revision 25931)
+@@ -0,0 +1,81 @@
++#!/bin/bash
++
++# This script is intended to test binaries downloaded to a user-end machine.
++#
++# NOTE: Tarball must already exist in INSTALL_DIR
++#
++
++MATLAB_NROPTIONS="'benchmark','slr'"
++MATLAB_PATH="/usr/local/MATLAB/R2019b"
++INSTALL_DIR=~/Downloads
++PACKAGE_NAME="ISSM-Solid_Earth"
++PYTHON_NROPTIONS="--benchmark slr"
++TARBALL_NAME="issm-linux-solid_earth"
++TARBALL="${TARBALL_NAME}.tar.gz"
++
++export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
++export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
++
++cd ${INSTALL_DIR}
++rm -rf ${PACKAGE_NAME}
++tar -zxvf ${TARBALL}
++cd ${PACKAGE_NAME}/test/NightlyRun
++
++# Check that MATLAB tests run
++echo "Running MATLAB tests"
++rm matlab.log 2> /dev/null
++
++# Run MATLAB tests redirecting output to logfile and suppressing output to console
++${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
++
++# Check that MATLAB did not exit in error
++matlabExitCode=`echo $?`
++matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
++
++if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
++	echo "----------MATLAB exited in error!----------"
++	cat matlab.log
++	echo "-----------End of matlab.log-----------"
++	exit 1
++fi
++
++# Check that all MATLAB tests passed
++numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
++
++if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
++	echo "One or more MATLAB tests FAILED"
++	exit 1
++else
++	echo "All MATLAB tests PASSED"
++fi
++
++# Check that Python tests run
++echo "Running Python tests"
++
++export PYTHONPATH="${ISSM_DIR}/scripts"
++export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
++export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
++
++rm python.log 2> /dev/null
++./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
++
++# Check that Python did not exit in error
++pythonExitCode=`echo $?`
++pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
++
++if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
++	echo "----------Python exited in error!----------"
++	cat python.log
++	echo "-----------End of python.log-----------"
++	exit 1
++fi
++
++# Check that all Python tests passed
++numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
++
++if [[ ${numPythonTestsFailed} -ne 0 ]]; then
++	echo "One or more Python tests FAILED"
++	exit 1
++else
++	echo "All Python tests PASSED"
++fi
+
+Property changes on: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh	(nonexistent)
++++ ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh	(revision 25931)
+@@ -0,0 +1,83 @@
++#!/bin/bash
++
++# This script is intended to test binaries downloaded to a user-end machine.
++#
++# NOTE: Tarball must already exist in INSTALL_DIR
++#
++
++MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
++MATLAB_PATH="/usr/local/MATLAB/R2019b"
++INSTALL_DIR=~/Downloads
++PACKAGE_NAME="ISSM"
++PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
++TARBALL_NAME="issm-linux-with_dakota"
++TARBALL="${TARBALL_NAME}.tar.gz"
++
++export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
++export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
++
++cd ${INSTALL_DIR}
++rm -rf ${PACKAGE_NAME}
++tar -zxvf ${TARBALL}
++cd ${PACKAGE_NAME}/test/NightlyRun
++
++# Check that MATLAB tests run
++echo "Running MATLAB tests"
++rm matlab.log 2> /dev/null
++
++# Run MATLAB tests redirecting output to logfile and suppressing output to console
++${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
++
++# Check that MATLAB did not exit in error
++matlabExitCode=`echo $?`
++matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
++
++if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
++	echo "----------MATLAB exited in error!----------"
++	cat matlab.log
++	echo "-----------End of matlab.log-----------"
++	exit 1
++fi
++
++# Check that all MATLAB tests passed
++numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
++
++if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
++	echo "One or more MATLAB tests FAILED"
++	exit 1
++else
++	echo "All MATLAB tests PASSED"
++fi
++
++# Check that Python tests run
++echo "Running Python tests"
++
++export ISSM_DIR="${INSTALL_DIR}"
++export PATH="${PATH}:${ISSM_DIR}/bin"
++export PYTHONPATH="${ISSM_DIR}/scripts"
++export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
++export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
++
++rm python.log 2> /dev/null
++./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
++
++# Check that Python did not exit in error
++pythonExitCode=`echo $?`
++pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
++
++if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
++	echo "----------Python exited in error!----------"
++	cat python.log
++	echo "-----------End of python.log-----------"
++	exit 1
++fi
++
++# Check that all Python tests passed
++numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
++
++if [[ ${numPythonTestsFailed} -ne 0 ]]; then
++	echo "One or more Python tests FAILED"
++	exit 1
++else
++	echo "All Python tests PASSED"
++fi
+
+Property changes on: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh	(nonexistent)
++++ ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh	(revision 25931)
+@@ -0,0 +1,49 @@
++#!/bin/bash
++
++# This script is intended to test binaries downloaded to a user-end machine.
++#
++# NOTE: Tarball must already exist in INSTALL_DIR
++#
++
++MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
++MATLAB_PATH="/usr/local/MATLAB/R2019b"
++INSTALL_DIR=~/Downloads
++PACKAGE_NAME="ISSM"
++TARBALL_NAME="issm-linux"
++TARBALL="${TARBALL_NAME}.tar.gz"
++
++export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
++export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
++
++cd ${INSTALL_DIR}
++rm -rf ${PACKAGE_NAME}
++tar -zxvf ${TARBALL}
++cd ${PACKAGE_NAME}/test/NightlyRun
++
++# Check that MATLAB tests run
++echo "Running MATLAB tests"
++rm matlab.log 2> /dev/null
++
++# Run MATLAB tests redirecting output to logfile and suppressing output to console
++${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
++
++# Check that MATLAB did not exit in error
++matlabExitCode=`echo $?`
++matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
++
++if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
++	echo "----------MATLAB exited in error!----------"
++	cat matlab.log
++	echo "-----------End of matlab.log-----------"
++	exit 1
++fi
++
++# Check that all MATLAB tests passed
++numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
++
++if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
++	echo "One or more MATLAB tests FAILED"
++	exit 1
++else
++	echo "All MATLAB tests PASSED"
++fi
+
+Property changes on: ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/scripts/test-issm-linux-binaries-with_dakota.sh
+===================================================================
+--- ../trunk-jpl/scripts/test-issm-linux-binaries-with_dakota.sh	(revision 25930)
++++ ../trunk-jpl/scripts/test-issm-linux-binaries-with_dakota.sh	(nonexistent)
+@@ -1,83 +0,0 @@
+-#!/bin/bash
+-
+-# This script is intended to test binaries downloaded to a user-end machine.
+-#
+-# NOTE: Tarball must already exist in INSTALL_DIR
+-#
+-
+-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-INSTALL_DIR=~/Downloads
+-PACKAGE_NAME="ISSM"
+-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
+-TARBALL_NAME="issm-linux-with_dakota"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
+-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
+-
+-cd ${INSTALL_DIR}
+-rm -rf ${PACKAGE_NAME}
+-tar -zxvf ${TARBALL}
+-cd ${PACKAGE_NAME}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+-
+-# Check that Python tests run
+-echo "Running Python tests"
+-
+-export ISSM_DIR="${INSTALL_DIR}"
+-export PATH="${PATH}:${ISSM_DIR}/bin"
+-export PYTHONPATH="${ISSM_DIR}/scripts"
+-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+-
+-rm python.log 2> /dev/null
+-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+-
+-# Check that Python did not exit in error
+-pythonExitCode=`echo $?`
+-pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
+-
+-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-	echo "----------Python exited in error!----------"
+-	cat python.log
+-	echo "-----------End of python.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all Python tests passed
+-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
+-	echo "One or more Python tests FAILED"
+-	exit 1
+-else
+-	echo "All Python tests PASSED"
+-fi
+
+Property changes on: ../trunk-jpl/scripts/test-issm-linux-binaries-with_dakota.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/scripts/test-issm-linux-binaries-solid_earth.sh
+===================================================================
+--- ../trunk-jpl/scripts/test-issm-linux-binaries-solid_earth.sh	(revision 25930)
++++ ../trunk-jpl/scripts/test-issm-linux-binaries-solid_earth.sh	(nonexistent)
+@@ -1,81 +0,0 @@
+-#!/bin/bash
+-
+-# This script is intended to test binaries downloaded to a user-end machine.
+-#
+-# NOTE: Tarball must already exist in INSTALL_DIR
+-#
+-
+-MATLAB_NROPTIONS="'benchmark','slr'"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-INSTALL_DIR=~/Downloads
+-PACKAGE_NAME="ISSM-Solid_Earth"
+-PYTHON_NROPTIONS="--benchmark slr"
+-TARBALL_NAME="issm-linux-solid_earth"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
+-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
+-
+-cd ${INSTALL_DIR}
+-rm -rf ${PACKAGE_NAME}
+-tar -zxvf ${TARBALL}
+-cd ${PACKAGE_NAME}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+-
+-# Check that Python tests run
+-echo "Running Python tests"
+-
+-export PYTHONPATH="${ISSM_DIR}/scripts"
+-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+-
+-rm python.log 2> /dev/null
+-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+-
+-# Check that Python did not exit in error
+-pythonExitCode=`echo $?`
+-pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
+-
+-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-	echo "----------Python exited in error!----------"
+-	cat python.log
+-	echo "-----------End of python.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all Python tests passed
+-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
+-	echo "One or more Python tests FAILED"
+-	exit 1
+-else
+-	echo "All Python tests PASSED"
+-fi
+
+Property changes on: ../trunk-jpl/scripts/test-issm-linux-binaries-solid_earth.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/scripts/test-issm-linux-binaries.sh
+===================================================================
+--- ../trunk-jpl/scripts/test-issm-linux-binaries.sh	(revision 25930)
++++ ../trunk-jpl/scripts/test-issm-linux-binaries.sh	(nonexistent)
+@@ -1,49 +0,0 @@
+-#!/bin/bash
+-
+-# This script is intended to test binaries downloaded to a user-end machine.
+-#
+-# NOTE: Tarball must already exist in INSTALL_DIR
+-#
+-
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-INSTALL_DIR=~/Downloads
+-PACKAGE_NAME="ISSM"
+-TARBALL_NAME="issm-linux"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
+-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
+-
+-cd ${INSTALL_DIR}
+-rm -rf ${PACKAGE_NAME}
+-tar -zxvf ${TARBALL}
+-cd ${PACKAGE_NAME}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+
+Property changes on: ../trunk-jpl/scripts/test-issm-linux-binaries.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/scripts/installExternalPackages.sh
+===================================================================
+--- ../trunk-jpl/scripts/installExternalPackages.sh	(revision 25930)
++++ ../trunk-jpl/scripts/installExternalPackages.sh	(nonexistent)
+@@ -1,44 +0,0 @@
+-#!/bin/bash
+-
+-#Jenkins xml files for individual packages
+-EXTERNAL_TEST_FILE="$ISSM_DIR/nightlylog/results/external.xml"
+-mkdir -p $ISSM_DIR/nightlylog/results
+-echo "<testsuite tests=\"$NUMPACKAGES\">" > $EXTERNAL_TEST_FILE
+-
+-source $ISSM_DIR/BuildConfig/externalpackages
+-
+-#number of packages: 
+-NUMPACKAGES=$(($(echo $EXTERNALPACKAGES | wc -w )/2))
+-for ((i=1;i<=$NUMPACKAGES;i++))
+-do
+-	NUM1=$((2*$i-1))
+-	NUM2=$((2*$i))
+-	PACKAGENAME=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM1-$NUM1)
+-	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
+-
+-	cd $ISSM_DIR/externalpackages/$PACKAGENAME
+-
+-	#install if requested or if previous install has not been successful
+-	echo "======================================================";
+-	echo "       Installing $PACKAGENAME                        ";
+-	echo "======================================================";
+-	echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\">" >> $EXTERNAL_TEST_FILE
+-	./$PACKAGEINST |  tee compil.log
+-	if [ $? -ne 0 ]; then
+-		echo "======================================================";
+-		echo "    ERROR: installation of $PACKAGENAME failed        ";
+-		echo "======================================================";
+-		echo '<failure message="failure">' >> $EXTERNAL_TEST_FILE
+-		cat ./compil.log >> $EXTERNAL_TEST_FILE
+-		echo '</failure>' >> $EXTERNAL_TEST_FILE
+-		exit 1
+-	else
+-		echo '<success message="success">' >> $EXTERNAL_TEST_FILE
+-		cat ./compil.log >> $EXTERNAL_TEST_FILE
+-		echo '</success>' >> $EXTERNAL_TEST_FILE
+-		touch SUCCESS
+-	fi
+-	echo '</testcase>' >> $EXTERNAL_TEST_FILE
+-	source $ISSM_DIR/etc/environment.sh
+-done
+-echo '</testsuite>' >> $EXTERNAL_TEST_FILE
+
+Property changes on: ../trunk-jpl/scripts/installExternalPackages.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25931-25932.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25931-25932.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25931-25932.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/scripts/DownloadExternalPackage.sh
+===================================================================
+--- ../trunk-jpl/scripts/DownloadExternalPackage.sh	(revision 25931)
++++ ../trunk-jpl/scripts/DownloadExternalPackage.sh	(revision 25932)
+@@ -40,13 +40,13 @@
+ fi
+ 
+ ## Download file
+-#
+-if [ ! -z `which wget` ]
++
++if [ ! -z `which curl` ]
+ then
++	curl --silent $URL -o $OUT_FILE
++elif [ ! -z `which wget` ]
++then
+ 	wget --quiet -O $OUT_FILE $URL
+-elif [ ! -z `which curl` ]
+-then
+-	curl --silent $URL -o $OUT_FILE
+ else
+ 	echo $MSG_ERR_NO_GET_CMD
+ 	exit 0
Index: /issm/oecreview/Archive/25834-26739/ISSM-25932-25933.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25932-25933.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25932-25933.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/classes/SMBgemb.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 25932)
++++ ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 25933)
+@@ -245,7 +245,7 @@
+ 			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.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);
+Index: ../trunk-jpl/src/m/classes/SMBgemb.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 25932)
++++ ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 25933)
+@@ -333,7 +333,7 @@
+             md = checkfield(md, 'fieldname', 'smb.eAir', 'size', [md.mesh.numberofelements + 1], 'message', 'eAir must have md.mesh.numberofelements+1 rows in order to force a climatology')
+ 
+         md = checkfield(md, 'fieldname', 'smb.Tmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
+-        md = checkfield(md, 'fieldname', 'smb.C', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
++        md = checkfield(md, 'fieldname', 'smb.C', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> ', 0)
+         md = checkfield(md, 'fieldname', 'smb.Vmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
+         md = checkfield(md, 'fieldname', 'smb.Tz', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 5000)
+         md = checkfield(md, 'fieldname', 'smb.Vz', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 5000)
Index: /issm/oecreview/Archive/25834-26739/ISSM-25933-25934.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25933-25934.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25933-25934.diff	(revision 26740)
@@ -0,0 +1,1257 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 25933)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 25934)
+@@ -298,24 +298,24 @@
+ 	Input* sl_input  = this->GetInput(SealevelEnum); _assert_(sl_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussPenta* gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for(int iv=0;iv<3;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Get velocity components and thickness*/
+-		B_input->GetInputValue(&B,gauss);
+-		n_input->GetInputValue(&n,gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		gr_input->GetInputValue(&groundedice,gauss);
+-		bs_input->GetInputValue(&bed,gauss);
+-		smax_fl_input->GetInputValue(&sigma_max_floating,gauss);
+-		smax_gr_input->GetInputValue(&sigma_max_grounded,gauss);
++		B_input->GetInputValue(&B,&gauss);
++		n_input->GetInputValue(&n,&gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
++		gr_input->GetInputValue(&groundedice,&gauss);
++		bs_input->GetInputValue(&bed,&gauss);
++		smax_fl_input->GetInputValue(&sigma_max_floating,&gauss);
++		smax_gr_input->GetInputValue(&sigma_max_grounded,&gauss);
+ 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
+-		sl_input->GetInputValue(&sealevel,gauss);
++		sl_input->GetInputValue(&sealevel,&gauss);
+ 
+ 		/*Compute strain rate and viscosity: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 
+ 		/*Get Eigen values*/
+ 		Matrix2x2Eigen(&lambda1,&lambda2,&ex,&ey,epsilon[0],epsilon[2],epsilon[1]);
+@@ -358,9 +358,6 @@
+ 	this->InputExtrude(CalvingrateyEnum,-1);
+ 	this->InputExtrude(CalvingCalvingrateEnum,-1);
+ 	this->InputExtrude(SigmaVMEnum,-1);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::CalvingRateLevermann(){/*{{{*/
+@@ -381,17 +378,17 @@
+ 	Input* levermanncoeff_input=this->GetInput(CalvinglevermannCoeffEnum);                     _assert_(levermanncoeff_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussPenta* gauss=new GaussPenta();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++	GaussPenta gauss;
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get the value we need*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
+ 		vel=vx*vx+vy*vy;
+-		strainparallel_input->GetInputValue(&strainparallel,gauss);
+-		strainperpendicular_input->GetInputValue(&strainperpendicular,gauss);
+-		levermanncoeff_input->GetInputValue(&propcoeff,gauss);
++		strainparallel_input->GetInputValue(&strainparallel,&gauss);
++		strainperpendicular_input->GetInputValue(&strainperpendicular,&gauss);
++		levermanncoeff_input->GetInputValue(&propcoeff,&gauss);
+ 
+ 		/*Calving rate proportionnal to the positive product of the strain rate along the ice flow direction and the strain rate perpendicular to the ice flow */
+ 		calvingrate[iv]=propcoeff*strainparallel*strainperpendicular;
+@@ -406,9 +403,6 @@
+ 	this->AddBasalInput(CalvingratexEnum,&calvingratex[0],P1DGEnum);
+ 	this->AddBasalInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);
+ 	this->AddBasalInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }/*}}}*/
+ void       Penta::CalvingFluxLevelset(){/*{{{*/
+ 
+@@ -760,7 +754,6 @@
+ 	IssmDouble	tau_xz[NUMVERTICES];
+ 	IssmDouble	tau_yz[NUMVERTICES];
+ 	IssmDouble	tau_eff[NUMVERTICES];
+-	GaussPenta* gauss=NULL;
+ 
+ 	/* Get node coordinates and dof list: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+@@ -771,13 +764,13 @@
+ 	Input* vz_input=this->GetInput(VzEnum);             _assert_(vz_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
++		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+ 
+ 		/*Compute Stress*/
+ 		tau_xx[iv]=2*viscosity*epsilon[0]; // tau = nu eps
+@@ -801,9 +794,6 @@
+ 	this->AddInput(DeviatoricStressyzEnum,&tau_yz[0],P1DGEnum);
+ 	this->AddInput(DeviatoricStresszzEnum,&tau_zz[0],P1DGEnum);
+ 	this->AddInput(DeviatoricStresseffectiveEnum,&tau_eff[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::ComputeStressTensor(){/*{{{*/
+@@ -817,7 +807,6 @@
+ 	IssmDouble  sigma_xy[NUMVERTICES];
+ 	IssmDouble	sigma_xz[NUMVERTICES];
+ 	IssmDouble	sigma_yz[NUMVERTICES];
+-	GaussPenta* gauss=NULL;
+ 
+ 	/* Get node coordinates and dof list: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+@@ -829,14 +818,14 @@
+ 	Input* vz_input=this->GetInput(VzEnum);             _assert_(vz_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussPenta();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++	GaussPenta gauss;
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		gauss.GaussVertex(iv);
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		pressure_input->GetInputValue(&pressure,gauss);
++		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
++		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
++		pressure_input->GetInputValue(&pressure,&gauss);
+ 
+ 		/*Compute Stress*/
+ 		sigma_xx[iv]=2*viscosity*epsilon[0]-pressure; // sigma = nu eps - pressure
+@@ -854,9 +843,6 @@
+ 	this->AddInput(StressTensoryyEnum,&sigma_yy[0],P1DGEnum);
+ 	this->AddInput(StressTensoryzEnum,&sigma_yz[0],P1DGEnum);
+ 	this->AddInput(StressTensorzzEnum,&sigma_zz[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::Configure(Elements* elementsin, Loads* loadsin, Nodes* nodesin,Vertices* verticesin, Materials* materialsin, Parameters* parametersin,Inputs* inputsin){/*{{{*/
+@@ -951,17 +937,16 @@
+ 		control_value->Serve(NUMVERTICES,&lidlist[0]);
+ 		control_gradient->Serve(NUMVERTICES,&lidlist[0]);
+ 
+-		GaussPenta* gauss=new GaussPenta();
++		GaussPenta gauss;
+ 		for (int iv=0;iv<NUMVERTICES;iv++){
+-			gauss->GaussVertex(iv);
++			gauss.GaussVertex(iv);
+ 
+-			control_value->GetInputValue(&value,gauss);
+-			control_gradient->GetInputValue(&gradient,gauss);
++			control_value->GetInputValue(&value,&gauss);
++			control_gradient->GetInputValue(&gradient,&gauss);
+ 
+ 			values[iv]    = reCast<IssmPDouble>(value)/reCast<IssmPDouble>(connectivity[iv]);
+ 			gradients[iv] = reCast<IssmPDouble>(gradient)/reCast<IssmPDouble>(connectivity[iv]);
+ 		}
+-		delete gauss;
+ 
+ 		vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL);
+ 		vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],ADD_VAL);
+@@ -1138,13 +1123,13 @@
+ 	Input* vz_input = this->GetInput(VzEnum); _assert_(vz_input);
+ 
+ 	/*1. Recover stresses at the base*/
+-	GaussPenta* gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
++		this->material->ViscosityFS(&viscosity,3,&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+ 		/*FIXME: this is for Hongju only*/
+ 		//pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]);
+ 		//if (pressure[iv]/pressureice[iv]>1)	pressure[iv]=pressureice[iv];
+@@ -1179,9 +1164,6 @@
+ 			else vertex_waterpressure->SetValue(vertices[i]->Pid(),+1.,ADD_VAL);
+ 		}
+ 	}
+-
+-	/*clean up*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::GetAreaCoordinates(IssmDouble* area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints){/*{{{*/
+@@ -1630,11 +1612,9 @@
+ 
+ 	int index = this->GetNodeIndex(node);
+ 
+-	GaussPenta* gauss=new GaussPenta();
+-	gauss->GaussNode(this->element_type,index);
+-
+-	input->GetInputValue(pvalue,gauss);
+-	delete gauss;
++	GaussPenta gauss;
++	gauss.GaussNode(this->element_type,index);
++	input->GetInputValue(pvalue,&gauss);
+ }
+ /*}}}*/
+ void       Penta::GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){/*{{{*/
+@@ -1644,11 +1624,9 @@
+ 
+ 	int index = this->GetVertexIndex(vertex);
+ 
+-	GaussPenta* gauss=new GaussPenta();
+-	gauss->GaussVertex(index);
+-
+-	input->GetInputValue(pvalue,gauss);
+-	delete gauss;
++	GaussPenta gauss;
++	gauss.GaussVertex(index);
++	input->GetInputValue(pvalue,&gauss);
+ }
+ /*}}}*/
+ Penta*     Penta::GetLowerPenta(void){/*{{{*/
+@@ -2850,23 +2828,23 @@
+ 	}
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussPenta* gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for(int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Advection */
+-		vx_input->GetInputValue(&v[0],gauss);
+-		vy_input->GetInputValue(&v[1],gauss);
+-		gr_input->GetInputValue(&groundedice,gauss);
++		vx_input->GetInputValue(&v[0],&gauss);
++		vy_input->GetInputValue(&v[1],&gauss);
++		gr_input->GetInputValue(&groundedice,&gauss);
+ 
+ 		/*Get calving speed*/
+ 		switch(calvinglaw){
+ 			case DefaultCalvingEnum:
+ 			case CalvingVonmisesEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				calvingrate_input->GetInputValue(&calvingrate,gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				calvingrate_input->GetInputValue(&calvingrate,&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 
+ 				if(groundedice<0) meltingrate = 0.;
+ 
+@@ -2885,9 +2863,9 @@
+ 				break;
+ 
+ 			case CalvingLevermannEnum:
+-				calvingratex_input->GetInputValue(&c[0],gauss);
+-				if(dim==2) calvingratey_input->GetInputValue(&c[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				calvingratex_input->GetInputValue(&c[0],&gauss);
++				if(dim==2) calvingratey_input->GetInputValue(&c[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 				norm_calving=0.;
+ 				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
+ 				norm_calving=sqrt(norm_calving)+1.e-14;
+@@ -2895,9 +2873,9 @@
+ 				break;
+ 
+ 			case CalvingMinthicknessEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 
+ 				norm_dlsf=0.;
+ 				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+@@ -2916,9 +2894,9 @@
+ 				break;
+ 
+ 			case CalvingHabEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 
+ 				norm_dlsf=0.;
+ 				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+@@ -2937,9 +2915,9 @@
+ 				break;
+ 
+ 			case CalvingCrevasseDepthEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 
+ 				if(groundedice<0) meltingrate = 0.;
+ 
+@@ -2961,11 +2939,11 @@
+ 
+ 			case CalvingDev2Enum:
+ 				  {
+-					lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-					calvingrate_input->GetInputValue(&calvingrate,gauss);
+-					meltingrate_input->GetInputValue(&meltingrate,gauss);
+-					gr_input->GetInputValue(&groundedice,gauss);
++					lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++					calvingrate_input->GetInputValue(&calvingrate,&gauss);
++					meltingrate_input->GetInputValue(&meltingrate,&gauss);
++					gr_input->GetInputValue(&groundedice,&gauss);
+ 
+ 					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
+ 					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
+@@ -3020,8 +2998,6 @@
+ 
+ 	this->InputExtrude(MovingFrontalVxEnum,-1);
+ 	this->InputExtrude(MovingFrontalVyEnum,-1);
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ Gauss*     Penta::NewGauss(void){/*{{{*/
+@@ -3141,7 +3117,7 @@
+ 	int i;
+ 	int found=0;
+ 	IssmDouble value;
+-	GaussPenta* gauss=NULL;
++	GaussPenta gauss;
+ 
+ 	/*First, serarch the input: */
+ 	Input* data=this->GetInput(natureofdataenum);
+@@ -3153,8 +3129,8 @@
+ 			/*Do we have natureofdataenum in our inputs? :*/
+ 			if(data){
+ 				/*ok, we are good. retrieve value of input at vertex :*/
+-				gauss=new GaussPenta(); gauss->GaussVertex(i);
+-				data->GetInputValue(&value,gauss);
++				gauss.GaussVertex(i);
++				data->GetInputValue(&value,&gauss);
+ 				found=1;
+ 				break;
+ 			}
+@@ -3161,7 +3137,6 @@
+ 		}
+ 	}
+ 
+-	delete gauss;
+ 	if(found)*pvalue=value;
+ 	return found;
+ }
+@@ -3368,13 +3343,13 @@
+ 	Input* groundedicelevelset_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(groundedicelevelset_input);
+ 
+ 	/*Loop over basal nodes and update their CS*/
+-	GaussPenta* gauss = new GaussPenta();
++	GaussPenta gauss;
+ 	for(int i=0;i<numindices;i++){//FIXME
+-		gauss->GaussNode(this->VelocityInterpolation(),indices[i]);
++		gauss.GaussNode(this->VelocityInterpolation(),indices[i]);
+ 
+-		slopex_input->GetInputValue(&slopex,gauss);
+-		slopey_input->GetInputValue(&slopey,gauss);
+-		groundedicelevelset_input->GetInputValue(&groundedice,gauss);
++		slopex_input->GetInputValue(&slopex,&gauss);
++		slopey_input->GetInputValue(&slopey,&gauss);
++		groundedicelevelset_input->GetInputValue(&groundedice,&gauss);
+ 
+ 		/*New X axis          New Z axis*/
+ 		xz_plane[0]=1.;       xz_plane[3]=-slopex;
+@@ -3405,7 +3380,6 @@
+ 
+ 	/*cleanup*/
+ 	xDelete<int>(indices);
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::ResetHooks(){/*{{{*/
+@@ -3454,14 +3428,14 @@
+ 	IssmDouble meltrates[NUMVERTICES2D];  //frontal melt-rate
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussPenta* gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for(int iv=0;iv<NUMVERTICES2D;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get variables */
+-		bed_input->GetInputValue(&bed,gauss);
+-		qsg_input->GetInputValue(&qsg,gauss);
+-		TF_input->GetInputValue(&TF,gauss);
++		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{
+@@ -3483,7 +3457,6 @@
+ 
+ 	/*Cleanup and return*/
+ 	xDelete<IssmDouble>(basin_icefront_area);
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::SetElementInput(int enum_in,IssmDouble value){/*{{{*/
+@@ -3691,7 +3664,6 @@
+ void       Penta::StrainRateparallel(){/*{{{*/
+ 
+ 	IssmDouble  epsilon[6];
+-	GaussPenta* gauss=NULL;
+ 	IssmDouble  vx,vy,vel;
+ 	IssmDouble  strainxx;
+ 	IssmDouble  strainxy;
+@@ -3708,17 +3680,17 @@
+ 	Input* vz_input=this->GetInput(VzEnum);												_assert_(vz_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get the value we need*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
+ 		vel=vx*vx+vy*vy;
+ 
+ 		/*Compute strain rate and viscosity: */
+-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+ 		strainxx=epsilon[0];
+ 		strainyy=epsilon[1];
+ 		strainxy=epsilon[3];
+@@ -3729,15 +3701,11 @@
+ 
+ 	/*Add input*/
+ 	this->AddInput(StrainRateparallelEnum,&strainparallel[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::StrainRateperpendicular(){/*{{{*/
+ 
+ 	IssmDouble  epsilon[6];
+-	GaussPenta* gauss=NULL;
+ 	IssmDouble  vx,vy,vel;
+ 	IssmDouble  strainxx;
+ 	IssmDouble  strainxy;
+@@ -3754,17 +3722,17 @@
+ 	Input* vz_input=this->GetInput(VzEnum);												_assert_(vz_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get the value we need*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
+ 		vel=vx*vx+vy*vy;
+ 
+ 		/*Compute strain rate and viscosity: */
+-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
++		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input,vz_input);
+ 		strainxx=epsilon[0];
+ 		strainyy=epsilon[1];
+ 		strainxy=epsilon[3];
+@@ -3775,9 +3743,6 @@
+ 
+ 	/*Add input*/
+ 	this->AddInput(StrainRateperpendicularEnum,&strainperpendicular[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Penta::StressIntensityFactor(){/*{{{*/
+@@ -4778,19 +4743,16 @@
+ 	Input* input = this->GetInput(extrusioninput);      _assert_(extrusioninput);
+ 	Input* onbase = this->GetInput(MeshVertexonbaseEnum); _assert_(onbase);
+ 
+-	GaussPenta* gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
+-		gauss->GaussNode(this->element_type,iv);
+-		onbase->GetInputValue(&isonbase,gauss);
++		gauss.GaussNode(this->element_type,iv);
++		onbase->GetInputValue(&isonbase,&gauss);
+ 		if(isonbase==1.){
+-			input->GetInputValue(&value,gauss);
++			input->GetInputValue(&value,&gauss);
+ 			this->nodes[iv]->ApplyConstraint(0,value);
+ 		}
+ 	}
+-	delete gauss;
+-
+-}
+-/*}}}*/
++}/*}}}*/
+ void       Penta::UpdateConstraintsExtrudeFromTop(void){/*{{{*/
+ 
+ 	if(!IsOnSurface()) return;
+@@ -4802,13 +4764,12 @@
+ 	this->parameters->FindParam(&extrusioninput,InputToExtrudeEnum);
+ 	Input* input = this->GetInput(extrusioninput); _assert_(extrusioninput);
+ 
+-	GaussPenta* gauss=new GaussPenta();
++	GaussPenta gauss;
+ 	for(int i=0;i<3;i++){
+-		gauss->GaussNode(P1Enum,indices[i]);
+-		input->GetInputValue(&value,gauss);
++		gauss.GaussNode(P1Enum,indices[i]);
++		input->GetInputValue(&value,&gauss);
+ 		this->nodes[indices[i]]->ApplyConstraint(0,value);
+ 	}
+-	delete gauss;
+ 
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25933)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25934)
+@@ -338,24 +338,24 @@
+ 
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for(int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Get velocity components and thickness*/
+-		B_input->GetInputValue(&B,gauss);
+-		n_input->GetInputValue(&n,gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		gr_input->GetInputValue(&groundedice,gauss);
+-		bs_input->GetInputValue(&bed,gauss);
+-		smax_fl_input->GetInputValue(&sigma_max_floating,gauss);
+-		smax_gr_input->GetInputValue(&sigma_max_grounded,gauss);
++		B_input->GetInputValue(&B,&gauss);
++		n_input->GetInputValue(&n,&gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
++		gr_input->GetInputValue(&groundedice,&gauss);
++		bs_input->GetInputValue(&bed,&gauss);
++		smax_fl_input->GetInputValue(&sigma_max_floating,&gauss);
++		smax_gr_input->GetInputValue(&sigma_max_grounded,&gauss);
+ 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
+-		sl_input->GetInputValue(&sealevel,gauss);
++		sl_input->GetInputValue(&sealevel,&gauss);
+ 
+ 		/*Compute strain rate and viscosity: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 
+ 		/*Get Eigen values*/
+ 		Matrix2x2Eigen(&lambda1,&lambda2,&ex,&ey,epsilon[0],epsilon[2],epsilon[1]);
+@@ -398,9 +398,6 @@
+ 	this->AddInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);
+ 	this->AddInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);
+ 	this->AddInput(SigmaVMEnum,&sigma_vm[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::CalvingCrevasseDepth(){/*{{{*/
+@@ -436,23 +433,23 @@
+ 	Input*	n_input  = this->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
+ 
+ 	/*Loop over all elements of this partition*/
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+-		H_input->GetInputValue(&thickness,gauss);
+-		bed_input->GetInputValue(&bed,gauss);
+-		surface_input->GetInputValue(&surface,gauss);
+-		strainrateparallel_input->GetInputValue(&strainparallel,gauss);
+-		strainrateeffective_input->GetInputValue(&straineffective,gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		waterheight_input->GetInputValue(&water_height,gauss);
+-		s_xx_input->GetInputValue(&s_xx,gauss);
+-		s_xy_input->GetInputValue(&s_xy,gauss);
+-		s_yy_input->GetInputValue(&s_yy,gauss);
+-		B_input->GetInputValue(&B,gauss);
+-		n_input->GetInputValue(&n,gauss);
++		H_input->GetInputValue(&thickness,&gauss);
++		bed_input->GetInputValue(&bed,&gauss);
++		surface_input->GetInputValue(&surface,&gauss);
++		strainrateparallel_input->GetInputValue(&strainparallel,&gauss);
++		strainrateeffective_input->GetInputValue(&straineffective,&gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
++		waterheight_input->GetInputValue(&water_height,&gauss);
++		s_xx_input->GetInputValue(&s_xx,&gauss);
++		s_xy_input->GetInputValue(&s_xy,&gauss);
++		s_yy_input->GetInputValue(&s_yy,&gauss);
++		B_input->GetInputValue(&B,&gauss);
++		n_input->GetInputValue(&n,&gauss);
+ 
+ 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
+ 
+@@ -493,8 +490,6 @@
+ 	this->AddInput(SurfaceCrevasseEnum,&surface_crevasse[0],P1DGEnum);
+ 	this->AddInput(BasalCrevasseEnum,&basal_crevasse[0],P1DGEnum);
+ 	this->AddInput(CrevasseDepthEnum,&crevasse_depth[0],P1DGEnum);
+-
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::CalvingRateLevermann(){/*{{{*/
+@@ -516,18 +511,18 @@
+ 	Input *levermanncoeff_input      = this->GetInput(CalvinglevermannCoeffEnum);   _assert_(levermanncoeff_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get the value we need*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
+ 		vel=vx*vx+vy*vy;
+-		strainparallel_input->GetInputValue(&strainparallel,gauss);
+-		strainperpendicular_input->GetInputValue(&strainperpendicular,gauss);
+-		levermanncoeff_input->GetInputValue(&propcoeff,gauss);
+-		bs_input->GetInputValue(&bed,gauss);
++		strainparallel_input->GetInputValue(&strainparallel,&gauss);
++		strainperpendicular_input->GetInputValue(&strainperpendicular,&gauss);
++		levermanncoeff_input->GetInputValue(&propcoeff,&gauss);
++		bs_input->GetInputValue(&bed,&gauss);
+ 
+ 		/*Calving rate proportionnal to the positive product of the strain rate along the ice flow direction and the strain rate perpendicular to the ice flow */
+ 		if(strainparallel>0. && strainperpendicular>0. && bed<=0.){
+@@ -544,9 +539,6 @@
+ 	this->AddInput(CalvingratexEnum,&calvingratex[0],P1DGEnum);
+ 	this->AddInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);
+ 	this->AddInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }/*}}}*/
+ void       Tria::CalvingFluxLevelset(){/*{{{*/
+ 
+@@ -851,7 +843,6 @@
+ 	IssmDouble  tau_e[NUMVERTICES];
+ 	IssmDouble  tau_1[NUMVERTICES];
+ 	IssmDouble  tau_2[NUMVERTICES];
+-	GaussTria*  gauss=NULL;
+ 	int domaintype,dim=2;
+ 
+ 	/*Get approximation*/
+@@ -867,21 +858,21 @@
+ 	Input* vy_input=this->GetInput(VyEnum); _assert_(vy_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Compute strain rate and viscosity: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 		switch(approximation){
+ 			case SSAApproximationEnum:
+-				this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input);
++				this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 				break;
+ 			case HOApproximationEnum:
+-				this->material->ViscosityHO(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input);
++				this->material->ViscosityHO(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 				break;
+ 			case FSApproximationEnum:
+-				this->material->ViscosityFS(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input,NULL);
++				this->material->ViscosityFS(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input,NULL);
+ 				break;
+ 			default:
+ 				_error_("not supported yet");
+@@ -907,9 +898,6 @@
+ 	this->AddInput(DeviatoricStresseffectiveEnum,&tau_e[0],P1DGEnum);
+ 	this->AddInput(DeviatoricStress1Enum,&tau_1[0],P1DGEnum);
+ 	this->AddInput(DeviatoricStress2Enum,&tau_2[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void	     Tria::ComputeEsaStrainAndVorticity(){ /*{{{*/
+@@ -920,7 +908,6 @@
+ 	IssmDouble  strain_yy[NUMVERTICES];
+ 	IssmDouble  strain_xy[NUMVERTICES];
+ 	IssmDouble  vorticity_xy[NUMVERTICES];
+-	GaussTria*  gauss=NULL;
+ 
+ 	/* Get node coordinates and dof list: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+@@ -930,12 +917,12 @@
+ 	Input* vy_input=this->GetInput(EsaYmotionEnum); _assert_(vy_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Compute strain rate and vorticity rate: */
+-		this->StrainRateESA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->StrainRateESA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 
+ 		/*Compute Stress*/
+ 		strain_xx[iv]=epsilon[0];
+@@ -949,9 +936,6 @@
+ 	this->AddInput(EsaStrainrateyyEnum,&strain_yy[0],P1DGEnum);
+ 	this->AddInput(EsaStrainratexyEnum,&strain_xy[0],P1DGEnum);
+ 	this->AddInput(EsaRotationrateEnum,&vorticity_xy[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::ComputeSigmaNN(){/*{{{*/
+@@ -1025,7 +1009,6 @@
+ 	IssmDouble  sigma_xy[NUMVERTICES];
+ 	IssmDouble	sigma_xz[NUMVERTICES]={0,0,0};
+ 	IssmDouble	sigma_yz[NUMVERTICES]={0,0,0};
+-	GaussTria*  gauss=NULL;
+ 	int domaintype,dim=2;
+ 
+ 	/* Get node coordinates and dof list: */
+@@ -1039,14 +1022,14 @@
+ 	Input* vy_input=this->GetInput(VyEnum);             _assert_(vy_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],gauss,vx_input,vy_input);
+-		pressure_input->GetInputValue(&pressure,gauss);
++		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
++		this->material->ViscositySSA(&viscosity,dim,&xyz_list[0][0],&gauss,vx_input,vy_input);
++		pressure_input->GetInputValue(&pressure,&gauss);
+ 
+ 		/*Compute Stress*/
+ 		sigma_xx[iv]=2*viscosity*epsilon[0]-pressure; // sigma = nu eps - pressure
+@@ -1061,9 +1044,6 @@
+ 	this->AddInput(StressTensoryyEnum,&sigma_yy[0],P1DGEnum);
+ 	this->AddInput(StressTensoryzEnum,&sigma_yz[0],P1DGEnum);
+ 	this->AddInput(StressTensorzzEnum,&sigma_zz[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::Configure(Elements* elementsin, Loads* loadsin,Nodes* nodesin,Vertices *verticesin,Materials* materialsin, Parameters* parametersin,Inputs* inputsin){/*{{{*/
+@@ -1175,17 +1155,16 @@
+ 		control_value->Serve(NUMVERTICES,&lidlist[0]);
+ 		control_gradient->Serve(NUMVERTICES,&lidlist[0]);
+ 
+-		GaussTria* gauss=new GaussTria();
++		GaussTria gauss;
+ 		for (int iv=0;iv<NUMVERTICES;iv++){
+-			gauss->GaussVertex(iv);
++			gauss.GaussVertex(iv);
+ 
+-			control_value->GetInputValue(&value,gauss);
+-			control_gradient->GetInputValue(&gradient,gauss);
++			control_value->GetInputValue(&value,&gauss);
++			control_gradient->GetInputValue(&gradient,&gauss);
+ 
+ 			values[iv]    = reCast<IssmPDouble>(value)/reCast<IssmPDouble>(connectivity[iv]);
+ 			gradients[iv] = reCast<IssmPDouble>(gradient)/reCast<IssmPDouble>(connectivity[iv]);
+ 		}
+-		delete gauss;
+ 
+ 		vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL);
+ 		vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],ADD_VAL);
+@@ -1413,16 +1392,16 @@
+ 	Input* vy_input       = this->GetInput(VyEnum);       _assert_(vy_input);
+ 
+ 	/*1. Recover stresses at the base*/
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		this->material->ViscosityFS(&viscosity,2,&xyz_list[0][0],gauss,vx_input,vy_input,NULL);
++		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
++		this->material->ViscosityFS(&viscosity,2,&xyz_list[0][0],&gauss,vx_input,vy_input,NULL);
+ 		/*FIXME: this is for Hongju only*/
+-	//	pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]);
+-	//	if (pressure[iv]/pressureice[iv]>1) pressure[iv]=pressureice[iv];
++		//	pressureice[iv]=gravity*rho_ice*(surface[iv]-base[iv]);
++		//	if (pressure[iv]/pressureice[iv]>1) pressure[iv]=pressureice[iv];
+ 
+ 		/*Compute Stress*/
+ 		sigmaxx[iv]=2*viscosity*epsilon[0]-pressure[iv];
+@@ -1449,9 +1428,6 @@
+ 			vertex_waterpressure->SetValue(vertices[i]->Pid(),+1.,ADD_VAL);
+ 		}
+ 	}
+-
+-	/*clean up*/
+-	delete gauss;
+ }
+ /*}}}*/
+ IssmDouble Tria::GetArea(void){/*{{{*/
+@@ -2154,11 +2130,9 @@
+ 
+ 	int index = this->GetNodeIndex(node);
+ 
+-	GaussTria* gauss=new GaussTria();
+-	gauss->GaussNode(this->element_type,index);
+-
+-	input->GetInputValue(pvalue,gauss);
+-	delete gauss;
++	GaussTria gauss;
++	gauss.GaussNode(this->element_type,index);
++	input->GetInputValue(pvalue,&gauss);
+ }
+ /*}}}*/
+ void       Tria::GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){/*{{{*/
+@@ -2168,11 +2142,9 @@
+ 
+ 	int index = this->GetVertexIndex(vertex);
+ 
+-	GaussTria* gauss=new GaussTria();
+-	gauss->GaussVertex(index);
+-
+-	input->GetInputValue(pvalue,gauss);
+-	delete gauss;
++	GaussTria gauss;
++	gauss.GaussVertex(index);
++	input->GetInputValue(pvalue,&gauss);
+ }
+ /*}}}*/
+ void       Tria::GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level){/*{{{*/
+@@ -3315,10 +3287,10 @@
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 
+ 	/*get area coordinates of 0 and 1 locations: */
+-	GaussTria* gauss_1=new GaussTria();
+-	gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
+-	GaussTria* gauss_2=new GaussTria();
+-	gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
++	GaussTria gauss_1;
++	gauss_1.GaussFromCoords(x1,y1,&xyz_list[0][0]);
++	GaussTria gauss_2;
++	gauss_2.GaussFromCoords(x2,y2,&xyz_list[0][0]);
+ 
+ 	/*Get segment length and normal (needs to be properly oriented)*/
+ 	IssmDouble nx=cos(atan2(x1-x2,y2-y1));
+@@ -3339,12 +3311,12 @@
+ 		vy_input=this->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);
++	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*(
+ 				(1./3.*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*nx+
+@@ -3352,8 +3324,6 @@
+ 				);
+ 
+ 	/*clean up and return:*/
+-	delete gauss_1;
+-	delete gauss_2;
+ 	return mass_flux;
+ }
+ /*}}}*/
+@@ -3539,23 +3509,23 @@
+ 	}
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for(int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Advection */
+-		vx_input->GetInputValue(&v[0],gauss);
+-		vy_input->GetInputValue(&v[1],gauss);
+-		gr_input->GetInputValue(&groundedice,gauss);
++		vx_input->GetInputValue(&v[0],&gauss);
++		vy_input->GetInputValue(&v[1],&gauss);
++		gr_input->GetInputValue(&groundedice,&gauss);
+ 
+ 		/*Get calving speed*/
+ 		switch(calvinglaw){
+ 			case DefaultCalvingEnum:
+ 			case CalvingVonmisesEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				calvingrate_input->GetInputValue(&calvingrate,gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				calvingrate_input->GetInputValue(&calvingrate,&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 				if(groundedice<0) meltingrate = 0.;
+ 
+ 				norm_dlsf=0.;
+@@ -3573,9 +3543,9 @@
+ 				break;
+ 
+ 			case CalvingLevermannEnum:
+-				calvingratex_input->GetInputValue(&c[0],gauss);
+-				if(dim==2) calvingratey_input->GetInputValue(&c[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				calvingratex_input->GetInputValue(&c[0],&gauss);
++				if(dim==2) calvingratey_input->GetInputValue(&c[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 				norm_calving=0.;
+ 				for(i=0;i<dim;i++) norm_calving+=pow(c[i],2);
+ 				norm_calving=sqrt(norm_calving)+1.e-14;
+@@ -3583,9 +3553,9 @@
+ 				break;
+ 
+ 			case CalvingMinthicknessEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 
+ 				norm_dlsf=0.;
+ 				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+@@ -3604,9 +3574,9 @@
+ 				break;
+ 
+ 			case CalvingHabEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 
+ 				norm_dlsf=0.;
+ 				for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+@@ -3625,9 +3595,9 @@
+ 				break;
+ 
+ 			case CalvingCrevasseDepthEnum:
+-				lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-				meltingrate_input->GetInputValue(&meltingrate,gauss);
++				lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++				if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++				meltingrate_input->GetInputValue(&meltingrate,&gauss);
+ 
+ 				if(groundedice<0) meltingrate = 0.;
+ 
+@@ -3649,11 +3619,11 @@
+ 
+ 			case CalvingDev2Enum:
+ 				  {
+-					lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
+-					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
+-					calvingrate_input->GetInputValue(&calvingrate,gauss);
+-					meltingrate_input->GetInputValue(&meltingrate,gauss);
+-					gr_input->GetInputValue(&groundedice,gauss);
++					lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++					if(dim==2) lsf_slopey_input->GetInputValue(&dlsf[1],&gauss);
++					calvingrate_input->GetInputValue(&calvingrate,&gauss);
++					meltingrate_input->GetInputValue(&meltingrate,&gauss);
++					gr_input->GetInputValue(&groundedice,&gauss);
+ 
+ 					//idea: no retreat on ice above critical calving height "calvinghaf" . Limit using regularized Heaviside function.
+ 					vel=sqrt(v[0]*v[0] + v[1]*v[1]);
+@@ -3704,9 +3674,6 @@
+ 	/*Add input*/
+ 	this->AddInput(MovingFrontalVxEnum,&movingfrontvx[0],P1DGEnum);
+ 	this->AddInput(MovingFrontalVyEnum,&movingfrontvy[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ Gauss*     Tria::NewGauss(void){/*{{{*/
+@@ -3827,7 +3794,7 @@
+ 
+ 	int         found = 0;
+ 	IssmDouble  value;
+-	GaussTria  *gauss = NULL;
++	GaussTria   gauss;
+ 
+ 	/*First, serarch the input: */
+ 	Input* data=this->GetInput(natureofdataenum);
+@@ -3839,8 +3806,8 @@
+ 			/*Do we have natureofdataenum in our inputs? :*/
+ 			if(data){
+ 				/*ok, we are good. retrieve value of input at vertex :*/
+-				gauss=new GaussTria(); gauss->GaussVertex(i);
+-				data->GetInputValue(&value,gauss);
++				gauss.GaussVertex(i);
++				data->GetInputValue(&value,&gauss);
+ 				found=1;
+ 				break;
+ 			}
+@@ -3847,9 +3814,6 @@
+ 		}
+ 	}
+ 
+-	/*clean-up*/
+-	delete gauss;
+-
+ 	if(found)*pvalue=value;
+ 	return found;
+ }
+@@ -4005,13 +3969,13 @@
+ 	this->GetInputListOnNodesVelocity(&vertexonbase[0],MeshVertexonbaseEnum);
+ 
+ 	/*Loop over basal nodes and update their CS*/
+-	GaussTria* gauss = new GaussTria();
++	GaussTria gauss;
+ 	for(int i=0;i<this->NumberofNodesVelocity();i++){
+ 
+ 		if(vertexonbase[i]==1){
+-			gauss->GaussNode(this->VelocityInterpolation(),i);
+-			slope_input->GetInputValue(&slope,gauss);
+-			groundedicelevelset_input->GetInputValue(&groundedice,gauss);
++			gauss.GaussNode(this->VelocityInterpolation(),i);
++			slope_input->GetInputValue(&slope,&gauss);
++			groundedicelevelset_input->GetInputValue(&groundedice,&gauss);
+ 			IssmDouble theta = atan(slope);
+ 
+ 			/*New X axis                  New Z axis*/
+@@ -4032,7 +3996,6 @@
+ 
+ 	/*cleanup*/
+ 	xDelete<IssmDouble>(vertexonbase);
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::ResetHooks(){/*{{{*/
+@@ -4078,14 +4041,14 @@
+ 	IssmDouble meltrates[NUMVERTICES];  //frontal melt-rate
+ 
+ 	/* Start looping on the number of vertices: */
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for(int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get variables */
+-		bed_input->GetInputValue(&bed,gauss);
+-		qsg_input->GetInputValue(&qsg,gauss);
+-		TF_input->GetInputValue(&TF,gauss);
++		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{
+@@ -4105,7 +4068,6 @@
+ 
+ 	/*Cleanup and return*/
+ 	xDelete<IssmDouble>(basin_icefront_area);
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M, int N){/*{{{*/
+@@ -4293,7 +4255,6 @@
+ void       Tria::StrainRateparallel(){/*{{{*/
+ 
+ 	IssmDouble  epsilon[3];
+-	GaussTria* gauss=NULL;
+ 	IssmDouble  vx,vy,vel;
+ 	IssmDouble  strainxx;
+ 	IssmDouble  strainxy;
+@@ -4309,17 +4270,17 @@
+ 	Input *vy_input = this->GetInput(VyEnum); _assert_(vy_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get the value we need*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
+ 		vel=vx*vx+vy*vy;
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 		strainxx=epsilon[0];
+ 		strainyy=epsilon[1];
+ 		strainxy=epsilon[2];
+@@ -4330,14 +4291,10 @@
+ 
+ 	/*Add input*/
+ 	this->AddInput(StrainRateparallelEnum,&strainparallel[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::StrainRateperpendicular(){/*{{{*/
+ 
+-	GaussTria* gauss=NULL;
+ 	IssmDouble  epsilon[3];
+ 	IssmDouble  vx,vy,vel;
+ 	IssmDouble  strainxx;
+@@ -4354,17 +4311,17 @@
+ 	Input *vy_input = this->GetInput(VyEnum); _assert_(vy_input);
+ 
+ 	/* Start looping on the number of vertices: */
+-	gauss=new GaussTria();
++	GaussTria gauss;
+ 	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
++		gauss.GaussVertex(iv);
+ 
+ 		/* Get the value we need*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		vx_input->GetInputValue(&vx,&gauss);
++		vy_input->GetInputValue(&vy,&gauss);
+ 		vel=vx*vx+vy*vy;
+ 
+ 		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
++		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],&gauss,vx_input,vy_input);
+ 		strainxx=epsilon[0];
+ 		strainyy=epsilon[1];
+ 		strainxy=epsilon[2];
+@@ -4375,9 +4332,6 @@
+ 
+ 	/*Add input*/
+ 	this->AddInput(StrainRateperpendicularEnum,&strainperpendicular[0],P1DGEnum);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+ }
+ /*}}}*/
+ IssmDouble Tria::SurfaceArea(void){/*{{{*/
+@@ -4995,16 +4949,15 @@
+ 	Input* input = this->GetInput(extrusioninput);      _assert_(input);
+ 	Input* onbase = this->GetInput(MeshVertexonbaseEnum); _assert_(onbase);
+ 
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
+-		gauss->GaussNode(this->element_type,iv);
+-		onbase->GetInputValue(&isonbase,gauss);
++		gauss.GaussNode(this->element_type,iv);
++		onbase->GetInputValue(&isonbase,&gauss);
+ 		if(isonbase==1.){
+-			input->GetInputValue(&value,gauss);
++			input->GetInputValue(&value,&gauss);
+ 			this->nodes[iv]->ApplyConstraint(0,value);
+ 		}
+ 	}
+-	delete gauss;
+ 
+ }
+ /*}}}*/
+@@ -5019,16 +4972,15 @@
+ 	Input* input = this->GetInput(extrusioninput); _assert_(input);
+ 	Input* onsurf = this->GetInput(MeshVertexonsurfaceEnum); _assert_(onsurf);
+ 
+-	GaussTria* gauss=new GaussTria();
++	GaussTria gauss;
+ 	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
+-		gauss->GaussNode(this->element_type,iv);
+-		onsurf->GetInputValue(&isonsurface,gauss);
++		gauss.GaussNode(this->element_type,iv);
++		onsurf->GetInputValue(&isonsurface,&gauss);
+ 		if(isonsurface==1.){
+-			input->GetInputValue(&value,gauss);
++			input->GetInputValue(&value,&gauss);
+ 			this->nodes[iv]->ApplyConstraint(0,value);
+ 		}
+ 	}
+-	delete gauss;
+ }
+ /*}}}*/
+ int        Tria::UpdatePotentialUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-25934-25935.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25934-25935.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25934-25935.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/solvers/asmstokesoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmstokesoptions.m	(nonexistent)
++++ ../trunk-jpl/src/m/solvers/asmstokesoptions.m	(revision 25935)
+@@ -0,0 +1,20 @@
++function asm=asmoptions(varargin)
++%ASMOPTIONS - return Additive Schwartz Method petsc options
++%
++%   Usage:
++%      options=asmoptions;
++
++%retrieve options provided in varargin
++options=pairoptions(varargin{:});
++asm=struct();
++
++%default asm options
++asm.toolkit='petsc';
++asm.mat_type=getfieldvalue(options,'mat_type','mpiaij');
++asm.ksp_type=getfieldvalue(options,'ksp_type','gmres');
++asm.pc_type=getfieldvalue(options,'pc_type','asm');
++asm.sub_pc_type=getfieldvalue(options,'sub_pc_type','lu');
++asm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',1); % COMSOL's default
++asm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
++asm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-7); %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
++asm.ksp_atol=getfieldvalue(options,'ksp_atol',1e-10); %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-25935-25936.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25935-25936.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25935-25936.diff	(revision 26740)
@@ -0,0 +1,117 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25935)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25936)
+@@ -4139,27 +4139,26 @@
+ 		/* GLS Stabilization */
+ 		mk = 1.0 /3.0;
+ 		element->ElementSizes(&hx,&hy,&hz);
+-		hk = max(max(hx, hy), hz);
+-		// if(!element->IsOnDirichletBoundary()) {
+-			Tau = - mk * hk * hk * 0.125 / viscosity;
++		// hk = max(max(hx, hy), hz);
++		hk = max(hx, hy);
++		Tau = - mk * hk * hk * 0.125 / viscosity;
+ 
+-
+ 		for (int q=0;q<dim;q++){
+ 			/* column 1-3 for the velocities */
+ 			for (int p=0;p<dim;p++){
+ 				for(int i=0;i<vnumnodes;i++){
+-					SU[q*vnumnodes*(dim+1)+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
++					SU[q*numdof+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
+ 				}
+ 			}
+ 			/* add the diagnal components */
+ 			for(int i=0;i<vnumnodes;i++){
+ 				for (int p=0;p<dim;p++){
+-					SU[q*vnumnodes*(dim+1)+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
++					SU[q*numdof+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
+ 				}
+ 			}
+ 			/* column 4 for the pressure */
+-			for(int i=0;i<vnumnodes;i++){
+-					SU[q*vnumnodes*(dim+1)+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
++			for(int i=0;i<pnumnodes;i++){
++					SU[q*numdof+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
+ 			}
+ 		}
+ 
+@@ -4225,6 +4224,7 @@
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int vnumnodes = element->NumberofNodesVelocity();
+ 	int pnumnodes = element->NumberofNodesPressure();
++	int numdof    = vnumnodes*dim + pnumnodes;
+ 
+ 	/*Prepare coordinate system list*/
+ 	int* cs_list = xNew<int>(vnumnodes+pnumnodes);
+@@ -4290,33 +4290,28 @@
+ 		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
+ 		mk = 1.0 /3.0;
+ 		element->ElementSizes(&hx,&hy,&hz);
+-		hk = max(max(hx, hy), hz);
+-		// if(!element->IsOnDirichletBoundary()) {
+-			Tau = - mk * hk * hk * 0.125 / viscosity;
+-		// }
+-		// else {
+-		// 	Tau = 0.0;
+-		// }
++		// hk = max(max(hx, hy), hz);
++		hk = max(hx, hy);
++		Tau = - mk * hk * hk * 0.125 / viscosity;
+ 
+ 		for (int q=0;q<dim;q++){
+ 			/* column 1-3 for the velocities */
+ 			for (int p=0;p<dim;p++){
+ 				for(int i=0;i<vnumnodes;i++){
+-					SU[q*vnumnodes*(dim+1)+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
++					SU[q*numdof+i*dim+p] = (-gradViscos[p])*vdbasis[q*vnumnodes+i];
+ 				}
+ 			}
+ 			/* add the diagnal components */
+ 			for(int i=0;i<vnumnodes;i++){
+ 				for (int p=0;p<dim;p++){
+-					SU[q*vnumnodes*(dim+1)+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
++					SU[q*numdof+i*dim+q] += (-gradViscos[p])*vdbasis[p*vnumnodes+i];
+ 				}
+ 			}
+ 			/* column 4 for the pressure */
+-			for(int i=0;i<vnumnodes;i++){
+-					SU[q*vnumnodes*(dim+1)+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
++			for(int i=0;i<pnumnodes;i++){
++					SU[q*numdof+dim*vnumnodes+i] = FSreconditioning*vdbasis[q*vnumnodes+i];
+ 			}
+ 		}
+-
+ 		for(i=0;i<vnumnodes;i++){
+ 			pe->values[i*dim+0] += +rho_ice*forcex *Jdet*gauss->weight*vbasis[i];
+ 			pe->values[i*dim+1] += +rho_ice*forcey *Jdet*gauss->weight*vbasis[i];
+@@ -4325,8 +4320,8 @@
+ 			pe->values[i*dim+dim-1] += -rho_ice*gravity*Jdet*gauss->weight*vbasis[i];
+ 		}
+ 
+-		for(int i=0;i<vnumnodes*(dim+1);i++){
+-			pe->values[i] += Tau*Jdet*gauss->weight*rho_ice*(-gravity)*SU[(dim-1)*(dim+1)*vnumnodes+i];
++		for(int i=0;i<numdof;i++){
++			pe->values[i] += Tau*Jdet*gauss->weight*rho_ice*(-gravity)*SU[(dim-1)*numdof+i];
+ 		}
+ 	}
+ 
+@@ -5158,7 +5153,7 @@
+ 		*/
+ 		for(int i=0;i<vnumnodes;i++){
+ 			for(int d=0;d<dim;d++){
+-				nsigma[d*vnumnodes+i] = 2.0 * viscosity * bed_normal[d]*vdbasisn[i];
++				nsigma[d*vnumnodes+i] = 1.0 * viscosity * bed_normal[d]*vdbasisn[i];
+ 			}
+ 		}
+ 		for(int i=0;i<pnumnodes;i++){
+@@ -5171,7 +5166,7 @@
+ 				for(int j=0;j<vnumnodes;j++){
+ 					for (int q=0; q<dim; q++) {
+ 						/* gamma*(n*u)*(n*v) */
+-						Ke->values[(dim*i+p)*numdof+dim*j+q] += gauss->weight*Jdet * (-gamma) * bed_normal[q] * vbasis[j]*bed_normal[p] * vbasis[i];
++						Ke->values[(dim*i+p)*numdof+dim*j+q] += gauss->weight*Jdet * (gamma) * bed_normal[q] * vbasis[j]*bed_normal[p] * vbasis[i];
+ 						/* sigma(u)*(n*v) */
+ 						Ke->values[(dim*i+p)*numdof+dim*j+q] += (- gauss->weight*Jdet)* nsigma[p*vnumnodes+i] * bed_normal[q] * vbasis[j];
+ 						/* sigma(v)*(n*u) */
Index: /issm/oecreview/Archive/25834-26739/ISSM-25936-25937.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25936-25937.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25936-25937.diff	(revision 26740)
@@ -0,0 +1,154 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25936)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25937)
+@@ -1,16 +1,13 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1:7];
++steps=[6];
+ 
+-try
+- % [1:7]
+-
+ if any(steps==1) %{{{
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	numrefine=1;
+-	resolution=150*1e3;			% inital resolution [m]
++	resolution=300*1e3;			% inital resolution [m]
+ 	radius = 6.371012*10^6;		% mean radius of Earth, m
+ 	mindistance_coast=150*1e3;	% coastal resolution [m]
+ 	mindistance_land=300*1e3;	% resolution on the continents [m]
+@@ -21,16 +18,16 @@
+ 
+ 	for i=1:numrefine,
+ 
+-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
++		ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 		distance=zeros(md.mesh.numberofvertices,1);
+ 
+-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
+-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
++		pos=find(~ocean_mask);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
++		pos=find(ocean_mask);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
+ 
+ 		for j=1:md.mesh.numberofvertices
+ 			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+-			if md.mask.ocean_levelset(j),
++			if ocean_mask(j),
+ 				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+@@ -43,7 +40,7 @@
+ 		end
+ 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+ 		
+-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land);
++		pos2=find(ocean_mask~=1 & distance>mindistance_land);
+ 		distance(pos2)=mindistance_land;
+ 
+ 		dist=min(maxdistance,distance);
+@@ -50,7 +47,10 @@
+ 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
+ 	end
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
++	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
++	pos = find(ocean_mask==0); 
++	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
++	md.mask.ocean_levelset(pos)=1; 
+ 
+ 	save ./Models/SlrGRACE_Mesh md;
+ 
+@@ -66,11 +66,11 @@
+ 
+ 	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+ 
+-	md.slr.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++	md.solidearth.surfaceload.icethicknesschange = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+ 
+ 	save ./Models/SlrGRACE_Loads md;
+ 
+-	plotmodel (md,'data',md.slr.deltathickness,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');
++	plotmodel (md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');
+ end %}}}
+ 
+ if any(steps==3) %{{{
+@@ -79,22 +79,21 @@
+ 
+ 	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+ 
+-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
+-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
+-	pos=find(md.slr.deltathickness~=0);
+-	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+-	md.mask.land_levelset = 1-md.mask.ocean_levelset;
++	md.mask.ice_levelset=-md.mask.ocean_levelset; 
+ 
+-	md.slr.sealevel=zeros(md.mesh.numberofvertices,1);
+-	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
+-	md.slr.ocean_area_scaling = 1;
++	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
++	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
++	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ 
+-	di=md.materials.rho_ice/md.materials.rho_water;
+-	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+-	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+-	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+-	md.geometry.bed=md.geometry.base;
++	md.solidearth.settings.ocean_area_scaling=1;
+ 
++	% arbitary to pass consistency check. 
++	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++	md.geometry.surface=ones(md.mesh.numberofvertices,1);
++	md.geometry.base=md.geometry.bed; 
++	md.geometry.thickness=md.geometry.surface-md.geometry.base; 
++
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+@@ -108,10 +107,12 @@
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+-	md.slr.rigid=1;
+-	md.slr.elastic=1;
+-	md.slr.rotation=1;
++	md.solidearth.settings.rigid=1;
++	md.solidearth.settings.elastic=1;
++	md.solidearth.settings.rotation=1;
+ 
++	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
++
+ 	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+@@ -124,8 +125,8 @@
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+-	sol1 = md.slr.deltathickness*100;						% [cm]
+-	sol2 = md.results.SealevelriseSolution.Sealevel*1000;	% [mm]
++	sol1 = md.solidearth.surfaceload.icethicknesschange*100;						% [cm]
++	sol2 = md.results.SealevelriseSolution.SealevelRSL*1000;	% [mm]
+ 
+ 	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
+ 	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+@@ -189,9 +190,9 @@
+ 	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+ 
+ 	[ne,nt]=size(water_load);
+-	md.slr.deltathickness = zeros(ne+1,nt);
+-	md.slr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+-	md.slr.deltathickness(ne+1,:)=[1:nt]; % times
++	md.solidearth.surfaceload.icethicknesschange = zeros(ne+1,nt);
++	md.solidearth.surfaceload.icethicknesschange(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++	md.solidearth.surfaceload.icethicknesschange(ne+1,:)=[1:nt]; % times
+ 
+ 	md.transient.issmb=0;
+ 	md.transient.ismasstransport=0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-25937-25938.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25937-25938.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25937-25938.diff	(revision 26740)
@@ -0,0 +1,47 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25937)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25938)
+@@ -1,7 +1,7 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[6];
++steps=[7];
+ 
+ if any(steps==1) %{{{
+ 	disp('   Step 1: Global mesh creation');
+@@ -198,6 +198,7 @@
+ 	md.transient.ismasstransport=0;
+ 	md.transient.isstressbalance=0;
+ 	md.transient.isthermal=0;
++	md.transient.isgia=1; 
+ 	md.transient.isslr=1;
+ 
+ 	md.timestepping.start_time=-1;
+@@ -209,6 +210,8 @@
+ 	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
++	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
++	
+ 	md=solve(md,'tr');
+ 
+ 	save ./Models/SlrGRACE_Transient md;
+@@ -218,12 +221,12 @@
+ 	disp('   Step 7: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+-	time = md.slr.deltathickness(end,:);
++	time = md.solidearth.surfaceload.icethicknesschange(end,:);
+ 
+ 	for tt=1:length(time)
+-		gmsl(tt) = md.results.TransientSolution(tt).SealevelEustatic*1000;	% GMSL rate mm/yr
+-		sol1(:,tt) = md.slr.deltathickness(1:end-1,tt)*100;					% ice equivalent height [cm/yr]
+-		sol2(:,tt) = md.results.TransientSolution(tt+1).Sealevel*1000;		% mm/yr
++		gmsl(tt) = md.results.TransientSolution(tt).Bslr*1000; % GMSL rate mm/yr
++		sol1(:,tt) = md.solidearth.surfaceload.icethicknesschange(1:end-1,tt)*100;	% ice equivalent height [cm/yr]
++		sol2(:,tt) = md.results.TransientSolution(tt+1).SealevelRSL*1000;	% mm/yr
+ 	end
+ 	sol_name = {'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
+ 	movie_name = {'Movie_dH.avi','Movie_slr.avi'};
Index: /issm/oecreview/Archive/25834-26739/ISSM-25938-25939.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25938-25939.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25938-25939.diff	(revision 26740)
@@ -0,0 +1,207 @@
+Index: ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 25938)
++++ ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 25939)
+@@ -1,11 +1,8 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1:8];
++steps=[8];
+ 
+-try
+- % [1:8]
+-
+ if any(steps==1) %{{{
+ 	disp('   Step 1: Global mesh creation');
+ 
+@@ -15,7 +12,10 @@
+ 	md=model;
+ 	md.mesh=gmshplanet('radius',radius,'resolution',resolution);
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
++	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
++	pos = find(ocean_mask==0); 
++	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
++	md.mask.ocean_levelset(pos)=1; 
+ 
+ 	save ./Models/SlrGRACE_Mesh md;
+ 
+@@ -38,16 +38,16 @@
+ 
+ 	for i=1:numrefine,
+ 
+-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
++		ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 		distance=zeros(md.mesh.numberofvertices,1);
+ 
+-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
+-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
++		pos=find(~ocean_mask);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
++		pos=find(ocean_mask);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
+ 
+ 		for j=1:md.mesh.numberofvertices
+ 			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+-			if md.mask.ocean_levelset(j),
++			if ocean_mask(j),
+ 				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+@@ -60,7 +60,7 @@
+ 		end
+ 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+ 		
+-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land);
++		pos2=find(ocean_mask~=1 & distance>mindistance_land);
+ 		distance(pos2)=mindistance_land;
+ 
+ 		domain = 'Greenland'; %'Antarctica'; %'HMA'; %'Alaska'; %'Glaciers'
+@@ -71,7 +71,10 @@
+ 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
+ 	end
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
++	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
++	pos = find(ocean_mask==0); 
++	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
++	md.mask.ocean_levelset(pos)=1; 
+ 
+ 	save ./Models/SlrGRACE_Mesh_refined md;
+ 
+@@ -126,11 +129,11 @@
+ 	domain = 'Greenland'; %'HMA'; %'Alaska'; %'Antarctica'; %'Glaciers';
+ 	mask = domain_mask(lat_element_0,lon_element_0,domain); 
+ 
+-	md.slr.deltathickness = mask.*water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++	md.solidearth.surfaceload.icethicknesschange = mask.*water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+ 
+ 	save ./Models/SlrGRACE_Loads md;
+ 
+-	plotmodel(md,'data',md.slr.deltathickness,'view',[90 90],'title','Ice height equivalent [m]');
++	plotmodel(md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 90],'title','Ice height equivalent [m]');
+ end %}}}
+ 
+ if any(steps==4) %{{{
+@@ -139,28 +142,21 @@
+ 
+ 	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+ 
+-	md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1);
+-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
+-	pos=find(md.slr.deltathickness~=0);
+-	md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+-	md.mask.land_levelset = 1-md.mask.ocean_levelset;
++	md.mask.ice_levelset=-md.mask.ocean_levelset; 
+ 
+-	md.slr.sealevel=zeros(md.mesh.numberofvertices,1);
+-	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
+-	md.slr.ocean_area_scaling = 1;
++	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
++	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
++	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ 
+-	md.slr.spcthickness=NaN*zeros(md.mesh.numberofvertices,1);
+-	md.slr.Ngia=zeros(md.mesh.numberofvertices,1);
+-	md.slr.Ugia=zeros(md.mesh.numberofvertices,1);
++	md.solidearth.settings.ocean_area_scaling=1;
+ 
+-	md.slr.geodetic=1;
++	% arbitary to pass consistency check. 
++	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++	md.geometry.surface=ones(md.mesh.numberofvertices,1);
++	md.geometry.base=md.geometry.bed; 
++	md.geometry.thickness=md.geometry.surface-md.geometry.base; 
+ 
+-	di=md.materials.rho_ice/md.materials.rho_water;
+-	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+-	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+-	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+-	md.geometry.bed=md.geometry.base;
+-
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+@@ -174,10 +170,12 @@
+ 	disp('   Step 5: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+-	md.slr.rigid=1;
+-	md.slr.elastic=1;
+-	md.slr.rotation=1;
++	md.solidearth.settings.rigid=1;
++	md.solidearth.settings.elastic=1;
++	md.solidearth.settings.rotation=1;
+ 
++	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
++
+ 	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+@@ -190,8 +188,8 @@
+ 	disp('   Step 6: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+-	sol1 = md.slr.deltathickness*100;						% [cm]
+-	sol2 = md.results.SealevelriseSolution.Sealevel*1000;	% [mm]
++	sol1 = md.solidearth.surfaceload.icethicknesschange*100;						% [cm]
++	sol2 = md.results.SealevelriseSolution.SealevelRSL*1000;	% [mm]
+ 
+ 	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
+ 	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+@@ -251,14 +249,14 @@
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+ 	disp('Projecting  loads onto the mesh...');
+-	time_range = [2005+15/365 2014+350/365];
+-	%time_range = 2007 + [15 350]/365;
++	%time_range = [2005+15/365 2014+350/365];
++	time_range = 2007 + [15 350]/365;
+ 	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+ 
+ 	[ne,nt]=size(water_load);
+-	md.slr.deltathickness = zeros(ne+1,nt);
+-	md.slr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+-	md.slr.deltathickness(ne+1,:)=[1:nt]; % times
++	md.solidearth.surfaceload.icethicknesschange = zeros(ne+1,nt);
++	md.solidearth.surfaceload.icethicknesschange(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++	md.solidearth.surfaceload.icethicknesschange(ne+1,:)=[1:nt]; % times
+ 
+ 	md.transient.issmb=0;
+ 	md.transient.ismasstransport=0;
+@@ -265,6 +263,7 @@
+ 	md.transient.isstressbalance=0;
+ 	md.transient.isthermal=0;
+ 	md.transient.isslr=1;
++	md.transient.isgia=1;
+ 
+ 	md.timestepping.start_time=-1;
+ 	md.timestepping.final_time=nt;
+@@ -272,6 +271,8 @@
+ 	md.timestepping.interp_forcings=0;
+ 	md.settings.output_frequency=1;
+ 
++	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
++	
+ 	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+@@ -284,14 +285,14 @@
+ 	disp('   Step 8: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+-	time = md.slr.deltathickness(end,:);
++	time = md.solidearth.surfaceload.icethicknesschange(end,:);
+ 
+ 	tide_x = 37+29/60;	% degree N
+ 	tide_y = 126+20/60;	% degree E
+ 
+ 	for tt=1:length(time)
+-		gmsl(tt) = md.results.TransientSolution(tt).SealevelRSLEustatic*1000;
+-		sol = (md.results.TransientSolution(tt+1).Sealevel-md.results.TransientSolution(tt).Sealevel)*1000;
++		gmsl(tt) = md.results.TransientSolution(tt).Bslr*1000;
++		sol = md.results.TransientSolution(tt+1).SealevelRSL*1000;
+ 		slr_incheon(tt) = griddata(md.mesh.lat,md.mesh.long,sol,tide_x,tide_y);
+ 	end
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25939-25940.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25939-25940.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25939-25940.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/ad/rescalegradient.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/ad/rescalegradient.m	(revision 25939)
++++ ../trunk-jpl/src/m/contrib/morlighem/ad/rescalegradient.m	(revision 25940)
+@@ -13,9 +13,9 @@
+ 	%Preallocate to speed up computation
+ 	disp('Constructing mass matrix...');
+ 	tic
+-	row   = zeros(10*md.mesh.numberofvertices);
+-	col   = zeros(10*md.mesh.numberofvertices);
+-	value = zeros(10*md.mesh.numberofvertices);
++	row   = zeros(10*md.mesh.numberofvertices,1);
++	col   = zeros(10*md.mesh.numberofvertices,1);
++	value = zeros(10*md.mesh.numberofvertices,1);
+ 
+ 	%Construct mass matrix using MATLAB's sparse function
+ 	count = 0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-25940-25941.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25940-25941.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25940-25941.diff	(revision 26740)
@@ -0,0 +1,163 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 25940)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 25941)
+@@ -111,7 +111,7 @@
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
+ 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+-	//iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum);
+ 
+ 
+ 	/*Add basal forcings to compute melt rate*/
+@@ -152,7 +152,9 @@
+ }/*}}}*/
+ void StressbalanceVerticalAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+-	/*No specific parameters*/
++	/* specific parameters*/
++	parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvzsolution",StressbalanceIsVzSolutionEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvelbc",StressbalanceIsVelBCEnum));
+ 
+ }/*}}}*/
+ 
+@@ -515,6 +517,9 @@
+ 	IssmDouble*  xyz_list = NULL;
+ 	IssmDouble   rho_ice,g;
+ 
++	int          isvzsolution;
++	IssmDouble   isvelbc, rheology_n, eta;
++
+ 	/*Get the approximation and do nothing if the element in FS or None*/
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+ 	if(approximation==FSApproximationEnum || approximation==NoneApproximationEnum){
+@@ -521,6 +526,10 @@
+ 		return;
+ 	}
+ 
++	/*Get parameters*/
++	element->FindParam(&isvzsolution,StressbalanceIsVzSolutionEnum);
++	element->FindParam(&isvelbc,StressbalanceIsVelBCEnum);
++
+ 	/*Get dof list and vertices coordinates: */
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -534,6 +543,9 @@
+ 	IssmDouble*  vel       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*  pressure  = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*  surface   = xNew<IssmDouble>(numnodes);
++	IssmDouble*  thickness = xNew<IssmDouble>(numnodes);
++	IssmDouble*  base	     = xNew<IssmDouble>(numnodes);
++	IssmDouble*  smb       = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Use the dof list to index into the solution vector vz: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+@@ -575,6 +587,31 @@
+ 		}
+ 	}
+ 
++	/*Set analytical vertical velocity field at slow flow region.*/
++	if (isvzsolution == 1){
++		rheology_n=element->material->GetN();
++		element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.);
++		element->GetInputListOnNodes(&base[0],BaseEnum,0.);
++		element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.);
++		for(i=0;i<numnodes;i++){
++			eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
++			vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i];
++		}	
++	}
++	else if (isvzsolution == 2) {
++		rheology_n=element->material->GetN();
++		element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.);
++		element->GetInputListOnNodes(&base[0],BaseEnum,0.);
++		element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.);
++		for(i=0;i<numnodes;i++){
++			if ( vx[i]*vx[i]+vy[i]*vy[i] < isvelbc*isvelbc ){
++				eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
++				vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i];
++			}
++		}	
++	}
++
++
+ 	/*Now Compute vel*/
+ 	for(i=0;i<numnodes;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+ 
+@@ -599,6 +636,9 @@
+ 	element->AddInput(VelEnum,vel,P1Enum);
+ 
+ 	/*Free ressources:*/
++	xDelete<IssmDouble>(smb);
++	xDelete<IssmDouble>(base);
++	xDelete<IssmDouble>(thickness);
+ 	xDelete<IssmDouble>(surface);
+ 	xDelete<IssmDouble>(pressure);
+ 	xDelete<IssmDouble>(vel);
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25940)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25941)
+@@ -440,6 +440,8 @@
+ 	StressbalanceRestolEnum,
+ 	StressbalanceRiftPenaltyThresholdEnum,
+ 	StressbalanceShelfDampeningEnum,
++	StressbalanceIsVzSolutionEnum,
++	StressbalanceIsVelBCEnum,
+ 	ThermalIsdrainicecolumnEnum,
+ 	ThermalIsdynamicbasalspcEnum,
+ 	ThermalIsenthalpyEnum,
+Index: ../trunk-jpl/src/m/classes/stressbalance.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.m	(revision 25940)
++++ ../trunk-jpl/src/m/classes/stressbalance.m	(revision 25941)
+@@ -22,6 +22,8 @@
+ 		referential            = NaN;
+ 		loadingforce           = NaN;
+ 		requested_outputs      = {};
++		isvzsolution           = NaN;
++		isvelbc                = NaN;	
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+@@ -74,6 +76,10 @@
+ 			 %parameter is often used.
+ 			 self.rift_penalty_lock=10;
+ 
++			 %Set vertical velocity option
++			 self.isvzsolution = 0;
++			 self.isvelbc      = 10.;
++
+ 			 %output default:
+ 			 self.requested_outputs={'default'};
+ 
+@@ -95,6 +101,8 @@
+ 			md = checkfield(md,'fieldname','stressbalance.maxiter','size',[1 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.isvzsolution','numel',[1],'values',[0 1 2]);
++			md = checkfield(md,'fieldname','stressbalance.isvelbc','numel',[1],'>=',0.0);
+ 			md = checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1);
+ 			if ~any(isnan(md.stressbalance.vertex_pairing)),
+ 				md = checkfield(md,'fieldname','stressbalance.vertex_pairing','>',0);
+@@ -158,6 +166,10 @@
+ 			fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
+ 			fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized');
+ 
++			disp(sprintf('\n      %s','Estimation of vertical velocity field options:'));
++			fielddisplay(self,'isvzsolution','0: incompressible assumption(IA), 1: internal deformation(ID), 2: IA+ID');
++			fielddisplay(self,'isvelbc','If turned on isvzsolution as 2, region (vel < isvelbc) calculates for ID.');
++
+ 			disp(sprintf('\n      %s','Other:'));
+ 			fielddisplay(self,'shelf_dampening','use dampening for floating ice ? Only for FS model');
+ 			fielddisplay(self,'FSreconditioning','multiplier for incompressibility equation. Only for FS model');
+@@ -186,6 +198,8 @@
+ 			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','isvzsolution','format','Integer','numel',1,'values',[0 1 2]);
++			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isvelbc','format','Double','numel',1,'scale',1./yts);
+ 
+ 			if size(self.loadingforce,2)==3,
+ 				WriteData(fid,prefix,'data',self.loadingforce(:,1),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
Index: /issm/oecreview/Archive/25834-26739/ISSM-25941-25942.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25941-25942.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25941-25942.diff	(revision 26740)
@@ -0,0 +1,331 @@
+Index: ../trunk-jpl/src/m/classes/stressbalance.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.m	(revision 25941)
++++ ../trunk-jpl/src/m/classes/stressbalance.m	(revision 25942)
+@@ -22,8 +22,6 @@
+ 		referential            = NaN;
+ 		loadingforce           = NaN;
+ 		requested_outputs      = {};
+-		isvzsolution           = NaN;
+-		isvelbc                = NaN;	
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+@@ -76,10 +74,6 @@
+ 			 %parameter is often used.
+ 			 self.rift_penalty_lock=10;
+ 
+-			 %Set vertical velocity option
+-			 self.isvzsolution = 0;
+-			 self.isvelbc      = 10.;
+-
+ 			 %output default:
+ 			 self.requested_outputs={'default'};
+ 
+@@ -101,8 +95,6 @@
+ 			md = checkfield(md,'fieldname','stressbalance.maxiter','size',[1 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.isvzsolution','numel',[1],'values',[0 1 2]);
+-			md = checkfield(md,'fieldname','stressbalance.isvelbc','numel',[1],'>=',0.0);
+ 			md = checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1);
+ 			if ~any(isnan(md.stressbalance.vertex_pairing)),
+ 				md = checkfield(md,'fieldname','stressbalance.vertex_pairing','>',0);
+@@ -166,10 +158,6 @@
+ 			fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
+ 			fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized');
+ 
+-			disp(sprintf('\n      %s','Estimation of vertical velocity field options:'));
+-			fielddisplay(self,'isvzsolution','0: incompressible assumption(IA), 1: internal deformation(ID), 2: IA+ID');
+-			fielddisplay(self,'isvelbc','If turned on isvzsolution as 2, region (vel < isvelbc) calculates for ID.');
+-
+ 			disp(sprintf('\n      %s','Other:'));
+ 			fielddisplay(self,'shelf_dampening','use dampening for floating ice ? Only for FS model');
+ 			fielddisplay(self,'FSreconditioning','multiplier for incompressibility equation. Only for FS model');
+@@ -198,8 +186,6 @@
+ 			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','isvzsolution','format','Integer','numel',1,'values',[0 1 2]);
+-			WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isvelbc','format','Double','numel',1,'scale',1./yts);
+ 
+ 			if size(self.loadingforce,2)==3,
+ 				WriteData(fid,prefix,'data',self.loadingforce(:,1),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 25941)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 25942)
+@@ -5,6 +5,8 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
++//#define INWOOVZ 1 //For Inwoo Park 0: incompressible assumption(IA), 1: internal deformation(ID), 2: IA+ID
++
+ /*Model processing*/
+ void StressbalanceVerticalAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 
+@@ -111,7 +113,9 @@
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
+ 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
++	#ifdef INWOOVZ
+ 	iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum);
++	#endif
+ 
+ 
+ 	/*Add basal forcings to compute melt rate*/
+@@ -153,8 +157,6 @@
+ void StressbalanceVerticalAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+ 	/* specific parameters*/
+-	parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvzsolution",StressbalanceIsVzSolutionEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isvelbc",StressbalanceIsVelBCEnum));
+ 
+ }/*}}}*/
+ 
+@@ -517,9 +519,6 @@
+ 	IssmDouble*  xyz_list = NULL;
+ 	IssmDouble   rho_ice,g;
+ 
+-	int          isvzsolution;
+-	IssmDouble   isvelbc, rheology_n, eta;
+-
+ 	/*Get the approximation and do nothing if the element in FS or None*/
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+ 	if(approximation==FSApproximationEnum || approximation==NoneApproximationEnum){
+@@ -526,10 +525,6 @@
+ 		return;
+ 	}
+ 
+-	/*Get parameters*/
+-	element->FindParam(&isvzsolution,StressbalanceIsVzSolutionEnum);
+-	element->FindParam(&isvelbc,StressbalanceIsVelBCEnum);
+-
+ 	/*Get dof list and vertices coordinates: */
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -543,9 +538,6 @@
+ 	IssmDouble*  vel       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*  pressure  = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*  surface   = xNew<IssmDouble>(numnodes);
+-	IssmDouble*  thickness = xNew<IssmDouble>(numnodes);
+-	IssmDouble*  base	     = xNew<IssmDouble>(numnodes);
+-	IssmDouble*  smb       = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Use the dof list to index into the solution vector vz: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+@@ -587,31 +579,49 @@
+ 		}
+ 	}
+ 
++
++	#ifdef INWOOVZ
++	IssmDouble*  thickness = xNew<IssmDouble>(numnodes);
++	IssmDouble*  base	     = xNew<IssmDouble>(numnodes);
++	IssmDouble*  smb       = xNew<IssmDouble>(numnodes);
++
++	IssmDouble rheology_n=element->material->GetN();
++	IssmDouble isvelbc   = 10./(365.25*24*3600); /*10 m/yr*/
+ 	/*Set analytical vertical velocity field at slow flow region.*/
+-	if (isvzsolution == 1){
+-		rheology_n=element->material->GetN();
++	if(INWOOVZ == 1){
+ 		element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.);
+ 		element->GetInputListOnNodes(&base[0],BaseEnum,0.);
+ 		element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.);
+ 		for(i=0;i<numnodes;i++){
+-			eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
++			IssmDouble eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
+ 			vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i];
+ 		}	
+ 	}
+-	else if (isvzsolution == 2) {
+-		rheology_n=element->material->GetN();
++	else if(INWOOVZ== 2) {
+ 		element->GetInputListOnNodes(&thickness[0],ThicknessEnum,0.);
+ 		element->GetInputListOnNodes(&base[0],BaseEnum,0.);
+ 		element->GetInputListOnNodes(&smb[0],SmbMassBalanceEnum,0.);
+ 		for(i=0;i<numnodes;i++){
+ 			if ( vx[i]*vx[i]+vy[i]*vy[i] < isvelbc*isvelbc ){
+-				eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
++				IssmDouble eta = (base[i]+thickness[i]-xyz_list[i*3+2])/thickness[i];
+ 				vz[i] = -(pow(eta,rheology_n+2.0)-1-(rheology_n+2.0)*(eta-1.))/(rheology_n+1.)*smb[i];
+ 			}
+ 		}	
+ 	}
++	else if(INWOOVZ==0){
++		/*nothing to add*/
++	}
++	else{
++		_error_("not supported yet");
++	}
+ 
++	/*Cleanup*/
++	xDelete<IssmDouble>(smb);
++	xDelete<IssmDouble>(base);
++	xDelete<IssmDouble>(thickness);
++	#endif
+ 
++
+ 	/*Now Compute vel*/
+ 	for(i=0;i<numnodes;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+ 
+@@ -636,9 +646,6 @@
+ 	element->AddInput(VelEnum,vel,P1Enum);
+ 
+ 	/*Free ressources:*/
+-	xDelete<IssmDouble>(smb);
+-	xDelete<IssmDouble>(base);
+-	xDelete<IssmDouble>(thickness);
+ 	xDelete<IssmDouble>(surface);
+ 	xDelete<IssmDouble>(pressure);
+ 	xDelete<IssmDouble>(vel);
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25941)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25942)
+@@ -3014,13 +3014,22 @@
+ 	GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+ 	IssmDouble* values    = xNew<IssmDouble>(numnodes);
+ 
++		if(this->Id()==104 || this->Id()==266 || this->Id()==264 || this->Id()==247 || this->Id()==263 || this->Id()==249 || this->Id()==250){
++			if(enum_type==MaskIceLevelsetEnum) printf("-----------------\n");
++		}
++
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(int i=0;i<numnodes;i++){
+ 		values[i]=solution[doflist[i]];
++		if(this->Id()==104 || this->Id()==266 || this->Id()==264 || this->Id()==247 || this->Id()==263 || this->Id()==249 || this->Id()==250){
++			if(enum_type==MaskIceLevelsetEnum) printf("%g\n",values[i]);
++			if(enum_type==MaskIceLevelsetEnum && values[i]>0.5 && values[i]<1.5 )this->nodes[i]->DeepEcho();
++		}
+ 		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector, SID = " << this->Sid());
+ 	}
+ 
++
+ 	/*Add input to the element: */
+ 	this->AddInput(enum_type,values,this->element_type);
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25941)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25942)
+@@ -1398,6 +1398,7 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
++syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1404,8 +1405,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DatasetInput
+ syn keyword cType DataSetParam
+-syn keyword cType DatasetInput
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1418,8 +1419,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType Elements
+ syn keyword cType ElementVector
+-syn keyword cType Elements
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1426,11 +1427,12 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1445,6 +1447,7 @@
+ 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
+@@ -1455,6 +1458,7 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
++syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1467,8 +1471,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType Options
+ syn keyword cType OptionUtilities
+-syn keyword cType Options
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1482,13 +1486,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType Riftfront
+ syn keyword cType RiftStruct
+-syn keyword cType Riftfront
+ syn keyword cType SealevelMasks
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType Segment
+ syn keyword cType SegRef
+-syn keyword cType Segment
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1507,10 +1511,6 @@
+ 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
+@@ -1529,8 +1529,8 @@
+ syn keyword cType ExtrudeFromTopAnalysis
+ syn keyword cType FreeSurfaceBaseAnalysis
+ syn keyword cType FreeSurfaceTopAnalysis
++syn keyword cType GiaAnalysis
+ syn keyword cType GLheightadvectionAnalysis
+-syn keyword cType GiaAnalysis
+ syn keyword cType HydrologyDCEfficientAnalysis
+ syn keyword cType HydrologyDCInefficientAnalysis
+ syn keyword cType HydrologyGlaDSAnalysis
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25941)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25942)
+@@ -440,8 +440,6 @@
+ 	StressbalanceRestolEnum,
+ 	StressbalanceRiftPenaltyThresholdEnum,
+ 	StressbalanceShelfDampeningEnum,
+-	StressbalanceIsVzSolutionEnum,
+-	StressbalanceIsVelBCEnum,
+ 	ThermalIsdrainicecolumnEnum,
+ 	ThermalIsdynamicbasalspcEnum,
+ 	ThermalIsenthalpyEnum,
Index: /issm/oecreview/Archive/25834-26739/ISSM-25942-25943.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25942-25943.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25942-25943.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 25942)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 25943)
+@@ -303,6 +303,9 @@
+ 			elseif isa(md.friction,'frictionweertmantemp'),
+ 				md.friction.C=project2d(md,md.friction.C,1);
+ 				md.friction.m=project2d(md,md.friction.m,1);
++			elseif isa(md.friction,'frictionjosh'),
++				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
++				md.friction.pressure_adjusted_temperature=project2d(md,md.friction.pressure_adjusted_temperature,1);
+ 			else
+ 				disp('friction type not supported');
+ 			end
Index: /issm/oecreview/Archive/25834-26739/ISSM-25943-25944.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25943-25944.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25943-25944.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/externalpackages/fisoc/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/fisoc/install.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/fisoc/install.sh	(revision 25944)
+@@ -0,0 +1,3 @@
++#!/bin/bash
++
++git clone https://github.com/RupertGladstone/FISOC.git 
+
+Property changes on: ../trunk-jpl/externalpackages/fisoc/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25944-25945.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25944-25945.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25944-25945.diff	(revision 26740)
@@ -0,0 +1,216 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25944)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25945)
+@@ -5047,7 +5047,6 @@
+ 	Gauss*      gauss         = NULL;
+ 	/*coefficient of Nitsche's method*/
+ 	IssmDouble gamma, hx, hy, hz;
+-	IssmDouble pnu, qnv;
+ 
+ 	/*Get problem dimension*/
+ 	element->FindParam(&dim,DomainDimensionEnum);
+@@ -5064,9 +5063,6 @@
+ 	IssmDouble* vbasis = xNew<IssmDouble>(vnumnodes);
+ 	IssmDouble* vdbasis = xNew<IssmDouble>(dim*vnumnodes);
+ 	IssmDouble* pbasis  = xNew<IssmDouble>(pnumnodes);
+-	IssmDouble* vdbasisn = xNew<IssmDouble>(vnumnodes);
+-	IssmDouble* nsigma = xNew<IssmDouble>(numdof);
+-	IssmDouble  bed_normal[3], bed_tangent[6];
+ 
+ 	/*Prepare coordinate system list*/
+ 	int* cs_list = xNew<int>(vnumnodes+pnumnodes);
+@@ -5099,8 +5095,6 @@
+ 		gauss=element->NewGaussBase(3);
+ 	}
+ 
+-	element->NormalBase(&bed_normal[0],xyz_list_base);
+-	element->TangentBase(&bed_tangent[0], &bed_normal[0]);
+ 	element->ElementSizes(&hx,&hy,&hz);
+ 	element->FindParam(&gamma,FeFSNitscheGammaEnum);
+ 
+@@ -5125,27 +5119,15 @@
+ 		element->NodalFunctionsDerivativesVelocity(vdbasis,xyz_list,gauss);
+ 		element->NodalFunctionsPressure(pbasis,gauss);
+ 		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
+-
+-		/*Frictions*/
++		
+ 		for(int i=0;i<vnumnodes;i++){
+ 			for(int j=0;j<vnumnodes;j++){
+-				for (int d=0; d<2; d++) {
+-					for (int p=0; p<dim; p++) {
+-						for (int q=0; q<dim; q++) {
+-							Ke->values[(dim*i+p)*numdof+dim*j+q] += alpha2*gauss->weight*Jdet*vbasis[i]*vbasis[j]*bed_tangent[d*3+p]*bed_tangent[d*3+q];
+-						}
+-					}
++				for (int d=0; d<dim; d++) {
++						Ke->values[(dim*i+d)*numdof+dim*j+d] += alpha2*gauss->weight*Jdet*vbasis[i]*vbasis[j];
+ 				}
+ 			}
+ 		}
+ 		/* -------- Nitsche terms -------- */
+-		/* n\cdot\nabla\phi*/
+-		for(int i=0;i<vnumnodes;i++){
+-			vdbasisn[i] = 0.0;
+-			for (int d=0; d<dim; d++) {
+-				vdbasisn[i] += bed_normal[d]*vdbasis[d*vnumnodes+i];
+-			}
+-		}
+ 		/* Boundary terms for integration by parts.
+ 			The coefficient matrix of n*sigma*n-gamma*n*u is stored in the following order:
+ 			rows--dimensions, columns--number of nodes.
+@@ -5152,53 +5134,29 @@
+ 			If we consider nsigma as a 1d vector, it has exactly the same order as the unknown vector.
+ 		*/
+ 		for(int i=0;i<vnumnodes;i++){
+-			for(int d=0;d<dim;d++){
+-				nsigma[d*vnumnodes+i] = 1.0 * viscosity * bed_normal[d]*vdbasisn[i];
++			for(int j=0;j<vnumnodes;j++){
++				/* gamma*(n*u)*(n*v) */
++				Ke->values[(dim*i+(dim-1))*numdof+dim*j+(dim-1)] += gauss->weight*Jdet * (gamma*viscosity) * vbasis[j] * vbasis[i];
++				/* -sigma(v)*(n*u) */
++				Ke->values[(dim*i+(dim-1))*numdof+dim*j+(dim-1)] += (- gauss->weight*Jdet) * 2.0 * viscosity * (-vbasis[j]) * vdbasis[(dim-1)*vnumnodes+i];
++				/* -sigma(u)*(n*v) */
++				Ke->values[(dim*i+(dim-1))*numdof+dim*j+(dim-1)] += (- gauss->weight*Jdet) * 2.0 * viscosity * vdbasis[(dim-1)*vnumnodes+j] * (-vbasis[i]);
+ 			}
+ 		}
+-		for(int i=0;i<pnumnodes;i++){
+-			nsigma[dim*vnumnodes+i] = -FSreconditioning*pbasis[i];
+-		}
+-
+-		/*velocity components A11 */
+-		for(int i=0;i<vnumnodes;i++){
+-			for (int p=0; p<dim; p++) {
+-				for(int j=0;j<vnumnodes;j++){
+-					for (int q=0; q<dim; q++) {
+-						/* gamma*(n*u)*(n*v) */
+-						Ke->values[(dim*i+p)*numdof+dim*j+q] += gauss->weight*Jdet * (gamma) * bed_normal[q] * vbasis[j]*bed_normal[p] * vbasis[i];
+-						/* sigma(u)*(n*v) */
+-						Ke->values[(dim*i+p)*numdof+dim*j+q] += (- gauss->weight*Jdet)* nsigma[p*vnumnodes+i] * bed_normal[q] * vbasis[j];
+-						/* sigma(v)*(n*u) */
+-						Ke->values[(dim*i+p)*numdof+dim*j+q] += (- gauss->weight*Jdet)* bed_normal[p] * vbasis[i] * nsigma[q*vnumnodes+j];
+-					}
+-				}
+-			}
+-		}
+-
+-		/* pressure x velocity  component A12 */
++		/* pressure x velocity  component A12, +p*(n*v) */
+ 		for(int k=0;k<pnumnodes;k++){
+-			pnu = nsigma[dim*vnumnodes+k];
+ 			for(int i=0;i<vnumnodes;i++){
+-				for (int p=0;p<dim;p++) {
+-					Ke->values[(dim*i+p)*numdof+dim*vnumnodes+k] += gauss->weight*Jdet * pnu * (- bed_normal[p] * vbasis[i]);
+-				}
++				Ke->values[(dim*i+dim-1)*numdof+dim*vnumnodes+k] += gauss->weight*Jdet * FSreconditioning*pbasis[k] * (-vbasis[i]);
+ 			}
+ 		}
+-		/* velocity x pressure component A21 */
++		/* velocity x pressure component A21, +(n*u)*q */
+ 		for(int k=0;k<pnumnodes;k++){
+-			qnv = nsigma[dim*vnumnodes+k];
+ 			for(int j=0;j<vnumnodes;j++){
+-				for (int q=0;q<dim;q++) {
+-					Ke->values[(dim*vnumnodes+k)*numdof+dim*j+q] += gauss->weight*Jdet * ( - bed_normal[q] * vbasis[j]) * qnv;
+-				}
++				Ke->values[(dim*vnumnodes+k)*numdof+dim*j+dim-1] += gauss->weight*Jdet * (-vbasis[j]) * FSreconditioning*pbasis[k];
+ 			}
+ 		}
+ 	}
+ 
+-	/*Transform Coordinate System*/
+-	element->TransformStiffnessMatrixCoord(Ke,cs_list);
+-
+ 	/*Clean up and return*/
+ 	delete gauss;
+ 	delete friction;
+@@ -5207,9 +5165,6 @@
+ 	xDelete<IssmDouble>(vbasis);
+ 	xDelete<IssmDouble>(vdbasis);
+ 	xDelete<IssmDouble>(pbasis);
+-	xDelete<IssmDouble>(vdbasisn);
+-	xDelete<IssmDouble>(nsigma);
+-	xDelete<int>(cs_list);
+ 	return Ke;
+ }/*}}}*/
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 25944)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 25945)
+@@ -3326,6 +3326,7 @@
+ 	int          approximation;
+ 	int          numindices;
+ 	int         *indices = NULL;
++	bool		isNitsche;
+ 	IssmDouble   slopex,slopey,groundedice;
+ 	IssmDouble   xz_plane[6];
+ 	IssmDouble*  vertexapproximation= NULL;
+@@ -3332,6 +3333,8 @@
+ 
+ 	/*For FS only: we want the CS to be tangential to the bedrock*/
+ 	this->Element::GetInputValue(&approximation,ApproximationEnum);
++	this->FindParam(&isNitsche,FlowequationIsNitscheEnum);
++
+ 	if(!IsOnBase() || (approximation!=FSApproximationEnum && approximation!=SSAFSApproximationEnum &&  approximation!=HOFSApproximationEnum)) return;
+ 
+ 	/*Get number of nodes for velocity only and base*/
+@@ -3356,25 +3359,26 @@
+ 		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
++		if (!isNitsche) {
++			if(groundedice>=0){
++				if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
++					this->nodes[indices[i]]->DofInSSet(2); //vz
++				}
++				else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
++					this->nodes[indices[i]]->DofInSSet(4); //vz
++				}
++				else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
+ 			}
+-			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
+-				this->nodes[indices[i]]->DofInSSet(4); //vz
++			else{
++				if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
++					this->nodes[indices[i]]->DofInFSet(2); //vz
++				}
++				else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
++					this->nodes[indices[i]]->DofInFSet(4); //vz
++				}
++				else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
+ 			}
+-			else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
+ 		}
+-		else{
+-			if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
+-				this->nodes[indices[i]]->DofInFSet(2); //vz
+-			}
+-			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
+-				this->nodes[indices[i]]->DofInFSet(4); //vz
+-			}
+-			else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
+-		}
+-
+ 		XZvectorsToCoordinateSystem(&this->nodes[indices[i]]->coord_system[0][0],&xz_plane[0]);
+ 	}
+ 
+Index: ../trunk-jpl/src/c/cores/stressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 25944)
++++ ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 25945)
+@@ -46,9 +46,7 @@
+ 		/*We need bed slopoes for the non-penetration condition*/
+ 		bedslope_core(femmodel);
+ 		femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+-		if (!isNitsche) {
+-			ResetFSBasalBoundaryConditionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+-		}
++		ResetFSBasalBoundaryConditionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 
+ 		/*We need basal melt rates for the shelf dampening*/
+ 		bmb_core(femmodel);
Index: /issm/oecreview/Archive/25834-26739/ISSM-25945-25946.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25945-25946.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25945-25946.diff	(revision 26740)
@@ -0,0 +1,127 @@
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25945)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25946)
+@@ -46,16 +46,16 @@
+ 		cd ${dir}
+ 
+ 		if [ "${dir}" == "./AMR" ]; then
+-			sed -i '.bak' '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			sed -i.bak '1 s|^.*$|try\n\n&|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Data" ]; then
+ 			echo 'Directory contains datasets only; no example to run.'
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./EsaGRACE" ]; then
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./EsaWahr" ]; then
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Functions" ]; then
+ 			echo "Directory contains functions only; no example to run."
+@@ -150,19 +150,19 @@
+ 				end %}}}\n\
+ 			"
+ 			#}}}
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==7\).*% step 7 end|${STEP_SEVEN}|s" $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==8\).*% step 8 end|${STEP_EIGHT}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./IceBridge" ]; then
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|\n\t%Mesh greenland without.*return;\n||s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./IceflowModels" ]; then
+-			sed -i '.bak' '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			sed -i.bak '1 s|^.*$|try\n\n&|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Inversion" ]; then
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./ISMIP" ]; then
+ 			# TODO:
+@@ -525,14 +525,14 @@
+ 			perl -0755 -p -i'.bak' -e "s|^.*$|${PAR_F}|s" IsmipF.par
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Jakobshavn" ]; then
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./LcurveAnalysis" ]; then
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Mesh" ]; then
+ 			# NOTE: Cannot test exptool region selection without GUI
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Pig" ]; then
+ 			# STEP_SIX #{{{
+@@ -557,12 +557,12 @@
+ 			"
+ 			#}}}
+ 			mv ./DomainOutline.bkp ./DomainOutline.exp > /dev/null 2>&1
+-			sed -i '.bak' "s|steps=\[1\];|steps=\[1:7\];\ntry\n|" $RUNME_FILE
++			sed -i.bak "s|steps=\[1\];|steps=\[1:7\];\ntry\n|" $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==6\).*% step 6 end|${STEP_SIX}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Pig2" ]; then
+ 			STEP_NINE="\n disp('Needs work!'); exit"
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:9\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:9\];\n\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==9\).*% step 9 end|${STEP_NINE}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./PigSensitivity" ]; then
+@@ -592,29 +592,29 @@
+ 				end\n\
+ 			"
+ 			#}}}
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			sed -i '' "s|if any(steps==4)|&${STEP_FOUR}|" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./shakti" ]; then
+-			sed -i '.bak' 's|steps=\[1:3\];|steps=\[1:3\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1:3\];|steps=\[1:3\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./SlrFarrell" ]; then
+ 			# TODO: Convert from md.slr
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./SlrGRACE" ]; then
+ 			# TODO: Convert from md.slr
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./SlrGRACE_NIMS" ]; then
+ 			# TODO: Convert from md.slr
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./SquareIceShelf" ]; then
+-			sed -i '.bak' '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			sed -i.bak '1 s|^.*$|try\n\n&|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./UncertaintyQuantification" ]; then
+-			sed -i '.bak' 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		else
+ 			echo "Not implemented yet!"
+@@ -630,8 +630,6 @@
+ 			cat $ISSM_DIR/nightlylog/$LOG_RUNME_FILE >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+ 			echo "finished: $(basename $dir)" >> $ISSM_DIR/nightlylog/matlab_log_examples.log
+ 			mv -f ${RUNME_FILE}.bak ${RUNME_FILE}
+-		else
+-			echo "Skipping: $(basename $dir)"
+ 		fi
+ 
+ 		# Extra clean up
Index: /issm/oecreview/Archive/25834-26739/ISSM-25946-25947.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25946-25947.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25946-25947.diff	(revision 26740)
@@ -0,0 +1,4086 @@
+Index: ../trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp	(nonexistent)
+@@ -1,504 +0,0 @@
+-#include "./SealevelriseAnalysis.h"
+-#include <math.h>
+-#include "../toolkits/toolkits.h"
+-#include "../classes/classes.h"
+-#include "../classes/Inputs/TransientInput.h"
+-#include "../shared/shared.h"
+-#include "../modules/modules.h"
+-
+-/*Model processing*/
+-void SealevelriseAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+-	/*No constraints*/
+-}/*}}}*/
+-void SealevelriseAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+-	/*No loads*/
+-}/*}}}*/
+-void SealevelriseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
+-	::CreateNodes(nodes,iomodel,SealevelriseAnalysisEnum,P1Enum);
+-}/*}}}*/
+-int  SealevelriseAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+-	return 1;
+-}/*}}}*/
+-void SealevelriseAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+-
+-	int geodetic=0;
+-	int dslmodel=0;
+-
+-	/*Update elements: */
+-	int counter=0;
+-	for(int i=0;i<iomodel->numberofelements;i++){
+-		if(iomodel->my_elements[i]){
+-			Element* element=(Element*)elements->GetObjectByOffset(counter);
+-			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
+-			counter++;
+-		}
+-	}
+-
+-	/*Create inputs: */
+-	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+-	iomodel->FetchData(&geodetic,"md.solidearth.settings.computesealevelchange");
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessChangeEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+-	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightChangeEnum);
+-		
+-	/*dynamic sea level: */
+-	iomodel->FetchData(&dslmodel,"md.dsl.model");
+-	if (dslmodel==1){ /*standard dsl model:{{{*/
+-
+-		/*deal with global mean steric rate: */
+-		IssmDouble* str=NULL; 
+-		IssmDouble* times = NULL;
+-		int M,N;
+-
+-		/*fetch str vector:*/
+-		iomodel->FetchData(&str,&M,&N,"md.dsl.global_average_thermosteric_sea_level_change"); _assert_(M==2);
+-		
+-		//recover time vector: 
+-		times=xNew<IssmDouble>(N);
+-		for(int t=0;t<N;t++) times[t] = str[N+t];
+-
+-		/*create transient input: */
+-		inputs->SetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,times,N);
+-		TransientInput* transientinput = inputs->GetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
+-		
+-			
+-		for(Object* & object : elements->objects){
+-			Element* element=xDynamicCast<Element*>(object);
+-
+-			for(int t=0;t<N;t++){
+-				switch(element->ObjectEnum()){
+-					case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
+-					case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
+-					default: _error_("Not implemented yet");
+-				}
+-			}
+-		}
+-
+-		/*cleanup:*/
+-		xDelete<IssmDouble>(times);
+-		iomodel->DeleteData(str,"md.dsl.global_average_thermosteric_sea_level_change");
+-
+-		/*deal with dynamic sea level fields: */
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid", DslSeaSurfaceHeightChangeAboveGeoidEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor", DslSeaWaterPressureChangeAtSeaFloorEnum);
+-		
+-	} /*}}}*/
+-	else if (dslmodel==2){ /*multi-model ensemble dsl model:{{{*/
+-	
+-		/*variables:*/
+-		int nummodels;
+-		IssmDouble** pstr=NULL; 
+-		IssmDouble*  str=NULL;
+-		IssmDouble*  times = NULL;
+-		int* pM = NULL;
+-		int* pN = NULL;
+-		int M,N;
+-
+-		/*deal with dsl.global_average_thermosteric_sea_level_change {{{*/
+-		iomodel->FetchData(&pstr,&pM,&pN,&nummodels,"md.dsl.global_average_thermosteric_sea_level_change");
+-
+-		/*go through the mat array and create a dataset of transient inputs:*/
+-		for (int i=0;i<nummodels;i++){
+-
+-			M=pM[i];
+-			N=pN[i];
+-			str=pstr[i];
+-
+-			//recover time vector: 
+-			times=xNew<IssmDouble>(N);
+-			for(int t=0;t<N;t++) times[t] = str[(M-1)*N+t];
+-
+-			TransientInput* transientinput=inputs->SetDatasetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,i, times,N);
+-			
+-			for(Object* & object : elements->objects){
+-				Element* element=xDynamicCast<Element*>(object);
+-
+-				for(int t=0;t<N;t++){
+-					switch(element->ObjectEnum()){
+-						case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
+-						case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
+-						default: _error_("Not implemented yet");
+-					}
+-				}
+-			}
+-			xDelete<IssmDouble>(times);
+-		}
+-		/*Delete data:*/
+-		for(int i=0;i<nummodels;i++){
+-			IssmDouble* str=pstr[i];
+-			xDelete<IssmDouble>(str);
+-		}
+-		xDelete<IssmDouble*>(pstr);
+-		xDelete<int>(pM);
+-		xDelete<int>(pN);
+-		/*}}}*/
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid",DslSeaSurfaceHeightChangeAboveGeoidEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor",DslSeaWaterPressureChangeAtSeaFloorEnum);
+-
+-	} /*}}}*/
+-	else _error_("Dsl model " << dslmodel << " not implemented yet!");
+-		
+-	
+-
+-	/*Initialize cumdeltalthickness and sealevel rise rate input*/
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelriseCumDeltathicknessEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelNEsaRateEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelUEsaRateEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelRSLRateEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelEustaticMaskEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelEustaticOceanMaskEnum);
+-
+-}/*}}}*/
+-void SealevelriseAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+-
+-	int         nl;
+-	IssmDouble* love_h=NULL;
+-	IssmDouble* love_k=NULL;
+-	IssmDouble* love_l=NULL;
+-	IssmDouble* love_th=NULL;
+-	IssmDouble* love_tk=NULL;
+-	IssmDouble* love_tl=NULL;
+-	int         dslmodel=0;
+-
+-	IssmDouble* G_rigid = NULL;
+-	IssmDouble* G_rigid_local = NULL;
+-	IssmDouble* G_elastic = NULL;
+-	IssmDouble* G_elastic_local = NULL;
+-	IssmDouble* U_elastic = NULL;
+-	IssmDouble* U_elastic_local = NULL;
+-	IssmDouble* H_elastic = NULL;
+-	IssmDouble* H_elastic_local = NULL;
+-	int         M,m,lower_row,upper_row;
+-	IssmDouble  degacc=.01;
+-	IssmDouble  planetradius=0;
+-	IssmDouble  planetarea=0;
+-	bool		rigid=false;
+-	bool		elastic=false;
+-	bool		rotation=false;
+-
+-	int     numoutputs;
+-	char**  requestedoutputs = NULL;
+-
+-	/*transition vectors: */
+-	IssmDouble **transitions    = NULL;
+-	int         *transitions_M    = NULL;
+-	int         *transitions_N    = NULL;
+-	int          ntransitions;
+-	IssmDouble*  partitionice=NULL;
+-	IssmDouble*  partitionhydro=NULL;
+-	IssmDouble*  bslrice_partition=NULL;
+-	IssmDouble*  bslrhydro_partition=NULL;
+-	int          npartice,nparthydro,nel;
+-
+-
+-	/*some constant parameters: */
+-	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.model",DslModelEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.runfrequency",SolidearthSettingsRunFrequencyEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.reltol",SolidearthSettingsReltolEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.abstol",SolidearthSettingsAbstolEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.maxiter",SolidearthSettingsMaxiterEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rigid",SolidearthSettingsRigidEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rotation",SolidearthSettingsRotationEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.equatorialmoi",RotationalEquatorialMoiEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.polarmoi",RotationalPolarMoiEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.angularvelocity",RotationalAngularVelocityEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.ocean_area_scaling",SolidearthSettingsOceanAreaScalingEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.computesealevelchange",SolidearthSettingsComputesealevelchangeEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
+-	parameters->AddObject(new DoubleParam(CumBslrEnum,0.0));
+-	parameters->AddObject(new DoubleParam(CumBslrIceEnum,0.0));
+-	parameters->AddObject(new DoubleParam(CumBslrHydroEnum,0.0));
+-	parameters->AddObject(new DoubleParam(CumGmtslrEnum,0.0));
+-
+-	/*compute planet area and plug into parameters:*/
+-	iomodel->FetchData(&planetradius,"md.solidearth.planetradius");
+-	planetarea=4*PI*planetradius*planetradius;
+-	parameters->AddObject(new DoubleParam(SolidearthPlanetAreaEnum,planetarea));
+-
+-	/*Deal with partition of the barystatic contribution:*/
+-	iomodel->FetchData(&npartice,"md.solidearth.npartice");
+-	parameters->AddObject(new IntParam(SolidearthNpartIceEnum,npartice));
+-	if(npartice){
+-		iomodel->FetchData(&partitionice,&nel,NULL,"md.solidearth.partitionice");
+-		parameters->AddObject(new DoubleMatParam(SolidearthPartitionIceEnum,partitionice,nel,1));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.npartice",SolidearthNpartIceEnum));
+-		bslrice_partition=xNewZeroInit<IssmDouble>(npartice);
+-		parameters->AddObject(new DoubleMatParam(CumBslrIcePartitionEnum,bslrice_partition,npartice,1));
+-		xDelete<IssmDouble>(partitionice);
+-	}
+-	iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro");
+-	parameters->AddObject(new IntParam(SolidearthNpartHydroEnum,nparthydro));
+-	if(nparthydro){
+-		iomodel->FetchData(&partitionhydro,&nel,NULL,"md.solidearth.partitionhydro");
+-		parameters->AddObject(new DoubleMatParam(SolidearthPartitionHydroEnum,partitionhydro,nel,1));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.nparthydro",SolidearthNpartHydroEnum));
+-		bslrhydro_partition=xNewZeroInit<IssmDouble>(nparthydro);
+-		parameters->AddObject(new DoubleMatParam(CumBslrHydroPartitionEnum,bslrhydro_partition,nparthydro,1));
+-		xDelete<IssmDouble>(partitionhydro);
+-	}
+-
+-	/*Deal with dsl multi-model ensembles: {{{*/
+-	iomodel->FetchData(&dslmodel,"md.dsl.model");
+-	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.compute_fingerprints",DslComputeFingerprintsEnum));
+-	if(dslmodel==2){
+-		IssmDouble modelid; 
+-		int nummodels;
+-		
+-		/*create double param, not int param, because Dakota will be updating it as 
+-		 * a double potentially: */
+-		iomodel->FetchData(&modelid,"md.dsl.modelid");
+-		parameters->AddObject(new DoubleParam(DslModelidEnum,modelid));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.dsl.nummodels",DslNummodelsEnum));
+-		iomodel->FetchData(&nummodels,"md.dsl.nummodels");
+-
+-		/*quick checks: */
+-		if(nummodels<=0)_error_("dslmme object in  md.dsl field should contain at least 1 ensemble model!");
+-		if(modelid<=0 || modelid>nummodels)_error_("modelid field in dslmme object of md.dsl field should be between 1 and the number of ensemble runs!");
+-	} /*}}}*/
+-	/*Deal with elasticity {{{*/
+-	iomodel->FetchData(&rigid,"md.solidearth.settings.rigid");
+-	iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
+-	iomodel->FetchData(&rotation,"md.solidearth.settings.rotation");
+-
+-	if(elastic | rigid){
+-		/*compute green functions for a range of angles*/
+-		iomodel->FetchData(&degacc,"md.solidearth.settings.degacc");
+-		M=reCast<int,IssmDouble>(180./degacc+1.);
+-	}
+-
+-	/*love numbers: */
+-	if(elastic){
+-		iomodel->FetchData(&love_h,&nl,NULL,"md.solidearth.lovenumbers.h");
+-		iomodel->FetchData(&love_k,&nl,NULL,"md.solidearth.lovenumbers.k");
+-		iomodel->FetchData(&love_l,&nl,NULL,"md.solidearth.lovenumbers.l");
+-		iomodel->FetchData(&love_th,&nl,NULL,"md.solidearth.lovenumbers.th");
+-		iomodel->FetchData(&love_tk,&nl,NULL,"md.solidearth.lovenumbers.tk");
+-		iomodel->FetchData(&love_tl,&nl,NULL,"md.solidearth.lovenumbers.tl");
+-
+-		parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,love_h,nl,1));
+-		parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,love_k,nl,1));
+-		parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,love_l,nl,1));
+-		parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,love_th,nl,1));
+-		parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,love_tk,nl,1));
+-		parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,love_tl,nl,1));
+-
+-		// AD performance is sensitive to calls to ensurecontiguous.
+-		// // Providing "t" will cause ensurecontiguous to be called.
+-		#ifdef _HAVE_AD_
+-		G_elastic=xNew<IssmDouble>(M,"t");
+-		U_elastic=xNew<IssmDouble>(M,"t");
+-		H_elastic=xNew<IssmDouble>(M,"t");
+-		#else
+-		G_elastic=xNew<IssmDouble>(M);
+-		U_elastic=xNew<IssmDouble>(M);
+-		H_elastic=xNew<IssmDouble>(M);
+-		#endif
+-	}
+-	if(rigid){
+-		#ifdef _HAVE_AD_
+-		G_rigid=xNew<IssmDouble>(M,"t");
+-		#else
+-		G_rigid=xNew<IssmDouble>(M);
+-		#endif
+-	}
+-	
+-	if(rotation)parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.lovenumbers.tk2secular",TidalLoveK2SecularEnum));
+-
+-	if(rigid | elastic){
+-
+-		/*compute combined legendre + love number (elastic green function:*/
+-		m=DetermineLocalSize(M,IssmComm::GetComm());
+-		GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
+-	}
+-	if(elastic){
+-		#ifdef _HAVE_AD_
+-		G_elastic_local=xNew<IssmDouble>(m,"t");
+-		U_elastic_local=xNew<IssmDouble>(m,"t");
+-		H_elastic_local=xNew<IssmDouble>(m,"t");
+-		#else
+-		G_elastic_local=xNew<IssmDouble>(m);
+-		U_elastic_local=xNew<IssmDouble>(m);
+-		H_elastic_local=xNew<IssmDouble>(m);
+-		#endif
+-	}
+-	if(rigid){
+-		#ifdef _HAVE_AD_
+-		G_rigid_local=xNew<IssmDouble>(m,"t");
+-		#else
+-		G_rigid_local=xNew<IssmDouble>(m);
+-		#endif
+-	}
+-
+-	if(rigid){
+-		for(int i=lower_row;i<upper_row;i++){
+-			IssmDouble alpha,x;
+-			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
+-			G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
+-		}
+-	}
+-	if(elastic){
+-		for(int i=lower_row;i<upper_row;i++){
+-			IssmDouble alpha,x;
+-			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
+-
+-			G_elastic_local[i-lower_row]= (love_k[nl-1]-love_h[nl-1])*G_rigid_local[i-lower_row];
+-			U_elastic_local[i-lower_row]= (love_h[nl-1])*G_rigid_local[i-lower_row];
+-			H_elastic_local[i-lower_row]= 0; 
+-			IssmDouble Pn = 0.; 
+-			IssmDouble Pn1 = 0.; 
+-			IssmDouble Pn2 = 0.; 
+-			IssmDouble Pn_p = 0.; 
+-			IssmDouble Pn_p1 = 0.; 
+-			IssmDouble Pn_p2 = 0.; 
+-
+-			for (int n=0;n<nl;n++) {
+-				IssmDouble deltalove_G;
+-				IssmDouble deltalove_U;
+-
+-				deltalove_G = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]);
+-				deltalove_U = (love_h[n]-love_h[nl-1]);
+-
+-				/*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
+-				if(n==0){
+-					Pn=1; 
+-					Pn_p=0; 
+-				}
+-				else if(n==1){ 
+-					Pn = cos(alpha); 
+-					Pn_p = 1; 
+-				}
+-				else{
+-					Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
+-					Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
+-				}
+-				Pn2=Pn1; Pn1=Pn;
+-				Pn_p2=Pn_p1; Pn_p1=Pn_p;
+-
+-				G_elastic_local[i-lower_row] += deltalove_G*Pn;		// gravitational potential 
+-				U_elastic_local[i-lower_row] += deltalove_U*Pn;		// vertical (up) displacement 
+-				H_elastic_local[i-lower_row] += sin(alpha)*love_l[n]*Pn_p;		// horizontal displacements 
+-			}
+-		}
+-	}
+-	if(rigid){
+-
+-		/*merge G_elastic_local into G_elastic; U_elastic_local into U_elastic; H_elastic_local to H_elastic:{{{*/
+-		int* recvcounts=xNew<int>(IssmComm::GetSize());
+-		int* displs=xNew<int>(IssmComm::GetSize());
+-
+-		//recvcounts:
+-		ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
+-
+-		/*displs: */
+-		ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
+-
+-		/*All gather:*/
+-		ISSM_MPI_Allgatherv(G_rigid_local, m, ISSM_MPI_DOUBLE, G_rigid, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-		if(elastic){
+-			ISSM_MPI_Allgatherv(G_elastic_local, m, ISSM_MPI_DOUBLE, G_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-			ISSM_MPI_Allgatherv(U_elastic_local, m, ISSM_MPI_DOUBLE, U_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-			ISSM_MPI_Allgatherv(H_elastic_local, m, ISSM_MPI_DOUBLE, H_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-		}
+-		
+-		/*free resources: */
+-		xDelete<int>(recvcounts);
+-		xDelete<int>(displs);
+-
+-		/*Avoid singularity at 0: */
+-		G_rigid[0]=G_rigid[1];
+-		if(elastic){
+-			G_elastic[0]=G_elastic[1];
+-			U_elastic[0]=U_elastic[1];
+-			H_elastic[0]=H_elastic[1];
+-		}
+-		
+-
+-		/*Save our precomputed tables into parameters*/
+-		parameters->AddObject(new DoubleVecParam(SealevelriseGRigidEnum,G_rigid,M));
+-		if(elastic){
+-			parameters->AddObject(new DoubleVecParam(SealevelriseGElasticEnum,G_elastic,M));
+-			parameters->AddObject(new DoubleVecParam(SealevelriseUElasticEnum,U_elastic,M));
+-			parameters->AddObject(new DoubleVecParam(SealevelriseHElasticEnum,H_elastic,M));
+-		}
+-
+-		/*free resources: */
+-		xDelete<IssmDouble>(G_rigid);
+-		xDelete<IssmDouble>(G_rigid_local);
+-		if(elastic){
+-			xDelete<IssmDouble>(love_h);
+-			xDelete<IssmDouble>(love_k);
+-			xDelete<IssmDouble>(love_l);
+-			xDelete<IssmDouble>(love_th);
+-			xDelete<IssmDouble>(love_tk);
+-			xDelete<IssmDouble>(love_tl);
+-			xDelete<IssmDouble>(G_elastic);
+-			xDelete<IssmDouble>(G_elastic_local);
+-			xDelete<IssmDouble>(U_elastic);
+-			xDelete<IssmDouble>(U_elastic_local);
+-			xDelete<IssmDouble>(H_elastic);
+-			xDelete<IssmDouble>(H_elastic_local);
+-		}
+-	} /*}}}*/
+-
+-	/*Indicate we have not yet run the Geometry Core module: */
+-	parameters->AddObject(new BoolParam(SealevelriseGeometryDoneEnum,false));
+-	/*}}}*/
+-
+-	/*Transitions:{{{ */
+-	iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions,"md.solidearth.transitions");
+-	if(transitions){
+-		parameters->AddObject(new DoubleMatArrayParam(SealevelriseTransitionsEnum,transitions,ntransitions,transitions_M,transitions_N));
+-
+-		for(int i=0;i<ntransitions;i++){
+-			IssmDouble* transition=transitions[i];
+-			xDelete<IssmDouble>(transition);
+-		}
+-		xDelete<IssmDouble*>(transitions);
+-		xDelete<int>(transitions_M);
+-		xDelete<int>(transitions_N);
+-	} /*}}}*/
+-	/*Requested outputs {{{*/
+-	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.solidearth.requested_outputs");
+-	if(numoutputs)parameters->AddObject(new StringArrayParam(SealevelriseRequestedOutputsEnum,requestedoutputs,numoutputs));
+-	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.solidearth.requested_outputs");
+-	/*}}}*/
+-
+-}/*}}}*/
+-
+-/*Finite Element Analysis*/
+-void           SealevelriseAnalysis::Core(FemModel* femmodel){/*{{{*/
+-	_error_("not implemented");
+-}/*}}}*/
+-ElementVector* SealevelriseAnalysis::CreateDVector(Element* element){/*{{{*/
+-	/*Default, return NULL*/
+-	return NULL;
+-}/*}}}*/
+-ElementMatrix* SealevelriseAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+-_error_("Not implemented");
+-}/*}}}*/
+-ElementMatrix* SealevelriseAnalysis::CreateKMatrix(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+-}/*}}}*/
+-ElementVector* SealevelriseAnalysis::CreatePVector(Element* element){/*{{{*/
+-_error_("not implemented yet");
+-}/*}}}*/
+-void           SealevelriseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+-	   _error_("not implemented yet");
+-}/*}}}*/
+-void           SealevelriseAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+-	_error_("Not implemented yet");
+-}/*}}}*/
+-void           SealevelriseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+-	_error_("not implemeneted yet!");
+-
+-}/*}}}*/
+-void           SealevelriseAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+-	/*Default, do nothing*/
+-	return;
+-}/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/SealevelriseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelriseAnalysis.h	(revision 25946)
++++ ../trunk-jpl/src/c/analyses/SealevelriseAnalysis.h	(nonexistent)
+@@ -1,33 +0,0 @@
+-/*! \file SealevelriseAnalysis.h 
+- *  \brief: header file for generic external result object
+- */
+-
+-#ifndef _SealevelriseAnalysis_
+-#define _SealevelriseAnalysis_
+-
+-/*Headers*/
+-#include "./Analysis.h"
+-
+-class SealevelriseAnalysis: public Analysis{
+-
+-	public:
+-		/*Model processing*/
+-		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+-		void CreateLoads(Loads* loads, IoModel* iomodel);
+-		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
+-		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+-		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
+-		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+-
+-		/*Finite element Analysis*/
+-		void           Core(FemModel* femmodel);
+-		ElementVector* CreateDVector(Element* element);
+-		ElementMatrix* CreateJacobianMatrix(Element* element);
+-		ElementMatrix* CreateKMatrix(Element* element);
+-		ElementVector* CreatePVector(Element* element);
+-		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+-		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+-		void           UpdateConstraints(FemModel* femmodel);
+-};
+-#endif
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 25946)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 25947)
+@@ -551,7 +551,7 @@
+ if SEALEVELRISE
+ issm_sources += \
+ 	./cores/sealevelchange_core.cpp \
+-	./analyses/SealevelriseAnalysis.cpp
++	./analyses/SealevelchangeAnalysis.cpp
+ endif
+ #}}}
+ #Metis sources  {{{
+Index: ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 25947)
+@@ -104,7 +104,7 @@
+ 		case MeltingAnalysisEnum : return new MeltingAnalysis();
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELRISE_
+-		case SealevelriseAnalysisEnum : return new SealevelriseAnalysis();
++		case SealevelchangeAnalysisEnum : return new SealevelchangeAnalysis();
+ 		#endif
+ 		#ifdef _HAVE_SMB_
+ 		case SmbAnalysisEnum : return new SmbAnalysis();
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 25947)
+@@ -155,7 +155,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+ 	if(isgroundingline) 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+ 	/*Initialize cumdeltalthickness input*/
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelriseCumDeltathicknessEnum);
++	InputUpdateFromConstantx(inputs,elements,0.,SealevelchangeCumDeltathicknessEnum);
+ 	/*Initialize ThicknessResidual input*/
+ 	InputUpdateFromConstantx(inputs,elements,0.,ThicknessResidualEnum);
+ 
+@@ -855,7 +855,7 @@
+ 	basalelement->GetInputListOnVertices(&oldsurface[0],SurfaceOldEnum);
+ 	basalelement->GetInputListOnVertices(&phi[0],MaskOceanLevelsetEnum);
+ 	basalelement->GetInputListOnVertices(&sealevel[0],SealevelEnum);
+-	basalelement->GetInputListOnVertices(&cumdeltathickness[0],SealevelriseCumDeltathicknessOldEnum);
++	basalelement->GetInputListOnVertices(&cumdeltathickness[0],SealevelchangeCumDeltathicknessOldEnum);
+ 
+ 	/*Do we do grounding line migration?*/
+ 	bool isgroundingline;
+@@ -862,7 +862,7 @@
+ 	element->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
+ 	if(isgroundingline) basalelement->GetInputListOnVertices(&bed[0],BedEnum);
+ 
+-	/*What is the delta thickness forcing the sea-level rise core: cumulated over time, hence the +=:*/
++	/*What is the delta thickness forcing the sea-level change core: cumulated over time, hence the +=:*/
+ 	for(int i=0;i<numvertices;i++){
+ 		cumdeltathickness[i] += newthickness[i]-oldthickness[i];
+ 		deltathickness[i]     = newthickness[i]-oldthickness[i];
+@@ -901,7 +901,7 @@
+ 	/*Add input to the element: */
+ 	element->AddBasalInput(SurfaceEnum,newsurface,P1Enum);
+ 	element->AddBasalInput(BaseEnum,newbase,P1Enum);
+-	element->AddBasalInput(SealevelriseCumDeltathicknessEnum,cumdeltathickness,P1Enum);
++	element->AddBasalInput(SealevelchangeCumDeltathicknessEnum,cumdeltathickness,P1Enum);
+ 	element->AddBasalInput(SurfaceloadIceThicknessChangeEnum,deltathickness,P1Enum);
+ 
+ 	/*Free ressources:*/
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 25947)
+@@ -0,0 +1,532 @@
++#include "./SealevelchangeAnalysis.h"
++#include <math.h>
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../classes/Inputs/TransientInput.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++
++/*Model processing*/
++void SealevelchangeAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
++	/*No constraints*/
++}/*}}}*/
++void SealevelchangeAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
++	/*No loads*/
++}/*}}}*/
++void SealevelchangeAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
++	::CreateNodes(nodes,iomodel,SealevelchangeAnalysisEnum,P1Enum);
++}/*}}}*/
++int  SealevelchangeAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
++	return 1;
++}/*}}}*/
++void SealevelchangeAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
++
++	int geodetic=0;
++	int dslmodel=0;
++	int externalnature=0;
++	int isexternal=0;
++
++	/*Update elements: */
++	int counter=0;
++	for(int i=0;i<iomodel->numberofelements;i++){
++		if(iomodel->my_elements[i]){
++			Element* element=(Element*)elements->GetObjectByOffset(counter);
++			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
++			counter++;
++		}
++	}
++
++	/*Create inputs: */
++	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
++	iomodel->FetchData(&geodetic,"md.solidearth.settings.computesealevelchange");
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessChangeEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightChangeEnum);
++		
++	/*dynamic sea level: */
++	iomodel->FetchData(&dslmodel,"md.dsl.model");
++	if (dslmodel==1){ /*standard dsl model:{{{*/
++
++		/*deal with global mean steric rate: */
++		IssmDouble* str=NULL; 
++		IssmDouble* times = NULL;
++		int M,N;
++
++		/*fetch str vector:*/
++		iomodel->FetchData(&str,&M,&N,"md.dsl.global_average_thermosteric_sea_level_change"); _assert_(M==2);
++		
++		//recover time vector: 
++		times=xNew<IssmDouble>(N);
++		for(int t=0;t<N;t++) times[t] = str[N+t];
++
++		/*create transient input: */
++		inputs->SetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,times,N);
++		TransientInput* transientinput = inputs->GetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
++		
++			
++		for(Object* & object : elements->objects){
++			Element* element=xDynamicCast<Element*>(object);
++
++			for(int t=0;t<N;t++){
++				switch(element->ObjectEnum()){
++					case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
++					case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
++					default: _error_("Not implemented yet");
++				}
++			}
++		}
++
++		/*cleanup:*/
++		xDelete<IssmDouble>(times);
++		iomodel->DeleteData(str,"md.dsl.global_average_thermosteric_sea_level_change");
++
++		/*deal with dynamic sea level fields: */
++		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid", DslSeaSurfaceHeightChangeAboveGeoidEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor", DslSeaWaterPressureChangeAtSeaFloorEnum);
++		
++	} /*}}}*/
++	else if (dslmodel==2){ /*multi-model ensemble dsl model:{{{*/
++	
++		/*variables:*/
++		int nummodels;
++		IssmDouble** pstr=NULL; 
++		IssmDouble*  str=NULL;
++		IssmDouble*  times = NULL;
++		int* pM = NULL;
++		int* pN = NULL;
++		int M,N;
++
++		/*deal with dsl.global_average_thermosteric_sea_level_change {{{*/
++		iomodel->FetchData(&pstr,&pM,&pN,&nummodels,"md.dsl.global_average_thermosteric_sea_level_change");
++
++		/*go through the mat array and create a dataset of transient inputs:*/
++		for (int i=0;i<nummodels;i++){
++
++			M=pM[i];
++			N=pN[i];
++			str=pstr[i];
++
++			//recover time vector: 
++			times=xNew<IssmDouble>(N);
++			for(int t=0;t<N;t++) times[t] = str[(M-1)*N+t];
++
++			TransientInput* transientinput=inputs->SetDatasetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,i, times,N);
++			
++			for(Object* & object : elements->objects){
++				Element* element=xDynamicCast<Element*>(object);
++
++				for(int t=0;t<N;t++){
++					switch(element->ObjectEnum()){
++						case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
++						case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
++						default: _error_("Not implemented yet");
++					}
++				}
++			}
++			xDelete<IssmDouble>(times);
++		}
++		/*Delete data:*/
++		for(int i=0;i<nummodels;i++){
++			IssmDouble* str=pstr[i];
++			xDelete<IssmDouble>(str);
++		}
++		xDelete<IssmDouble*>(pstr);
++		xDelete<int>(pM);
++		xDelete<int>(pN);
++		/*}}}*/
++		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid",DslSeaSurfaceHeightChangeAboveGeoidEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor",DslSeaWaterPressureChangeAtSeaFloorEnum);
++
++	} /*}}}*/
++	else _error_("Dsl model " << dslmodel << " not implemented yet!");
++	
++	/*external solidearthsolution: solid-Earth model*/
++	iomodel->FetchData(&isexternal,"md.solidearth.isexternal");
++	if(isexternal){
++		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementeast",SolidearthExternalDisplacementEastRateEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementnorth",SolidearthExternalDisplacementNorthRateEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementup",SolidearthExternalDisplacementUpRateEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.geoid",SolidearthExternalGeoidRateEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.barystaticsealevel",SolidearthExternalBarystaticSeaLevelRateEnum);
++	}
++
++	/*Initialize cumdeltalthickness, bedrockeast and bedrocknorth  to 0 at time step 0:*/
++	InputUpdateFromConstantx(inputs,elements,0.,BedEastEnum);
++	InputUpdateFromConstantx(inputs,elements,0.,BedNorthEnum);
++	InputUpdateFromConstantx(inputs,elements,0.,SealevelchangeCumDeltathicknessEnum);
++
++
++}/*}}}*/
++void SealevelchangeAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
++
++	int         nl;
++	IssmDouble* love_h=NULL;
++	IssmDouble* love_k=NULL;
++	IssmDouble* love_l=NULL;
++	IssmDouble* love_th=NULL;
++	IssmDouble* love_tk=NULL;
++	IssmDouble* love_tl=NULL;
++	int         dslmodel=0;
++	int         externalnature=0;
++
++	IssmDouble* G_rigid = NULL;
++	IssmDouble* G_rigid_local = NULL;
++	IssmDouble* G_elastic = NULL;
++	IssmDouble* G_elastic_local = NULL;
++	IssmDouble* U_elastic = NULL;
++	IssmDouble* U_elastic_local = NULL;
++	IssmDouble* H_elastic = NULL;
++	IssmDouble* H_elastic_local = NULL;
++	int         M,m,lower_row,upper_row;
++	IssmDouble  degacc=.01;
++	IssmDouble  planetradius=0;
++	IssmDouble  planetarea=0;
++	bool		rigid=false;
++	bool		elastic=false;
++	bool		rotation=false;
++
++	int     numoutputs;
++	char**  requestedoutputs = NULL;
++
++	/*transition vectors: */
++	IssmDouble **transitions    = NULL;
++	int         *transitions_M    = NULL;
++	int         *transitions_N    = NULL;
++	int          ntransitions;
++	IssmDouble*  partitionice=NULL;
++	IssmDouble*  partitionhydro=NULL;
++	IssmDouble*  bslrice_partition=NULL;
++	IssmDouble*  bslrhydro_partition=NULL;
++	int          npartice,nparthydro,nel;
++
++
++	/*some constant parameters: */
++	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.model",DslModelEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.isexternal",SolidearthIsExternalEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nature",SolidearthExternalNatureEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.runfrequency",SolidearthSettingsRunFrequencyEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.reltol",SolidearthSettingsReltolEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.abstol",SolidearthSettingsAbstolEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.maxiter",SolidearthSettingsMaxiterEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rigid",SolidearthSettingsRigidEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rotation",SolidearthSettingsRotationEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.equatorialmoi",RotationalEquatorialMoiEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.polarmoi",RotationalPolarMoiEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.angularvelocity",RotationalAngularVelocityEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.ocean_area_scaling",SolidearthSettingsOceanAreaScalingEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.computesealevelchange",SolidearthSettingsComputesealevelchangeEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
++	parameters->AddObject(new DoubleParam(CumBslrEnum,0.0));
++	parameters->AddObject(new DoubleParam(CumBslrIceEnum,0.0));
++	parameters->AddObject(new DoubleParam(CumBslrHydroEnum,0.0));
++	parameters->AddObject(new DoubleParam(CumGmtslrEnum,0.0));
++
++	/*compute planet area and plug into parameters:*/
++	iomodel->FetchData(&planetradius,"md.solidearth.planetradius");
++	planetarea=4*PI*planetradius*planetradius;
++	parameters->AddObject(new DoubleParam(SolidearthPlanetAreaEnum,planetarea));
++
++	/*Deal with partition of the barystatic contribution:*/
++	iomodel->FetchData(&npartice,"md.solidearth.npartice");
++	parameters->AddObject(new IntParam(SolidearthNpartIceEnum,npartice));
++	if(npartice){
++		iomodel->FetchData(&partitionice,&nel,NULL,"md.solidearth.partitionice");
++		parameters->AddObject(new DoubleMatParam(SolidearthPartitionIceEnum,partitionice,nel,1));
++		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.npartice",SolidearthNpartIceEnum));
++		bslrice_partition=xNewZeroInit<IssmDouble>(npartice);
++		parameters->AddObject(new DoubleMatParam(CumBslrIcePartitionEnum,bslrice_partition,npartice,1));
++		xDelete<IssmDouble>(partitionice);
++	}
++	iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro");
++	parameters->AddObject(new IntParam(SolidearthNpartHydroEnum,nparthydro));
++	if(nparthydro){
++		iomodel->FetchData(&partitionhydro,&nel,NULL,"md.solidearth.partitionhydro");
++		parameters->AddObject(new DoubleMatParam(SolidearthPartitionHydroEnum,partitionhydro,nel,1));
++		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.nparthydro",SolidearthNpartHydroEnum));
++		bslrhydro_partition=xNewZeroInit<IssmDouble>(nparthydro);
++		parameters->AddObject(new DoubleMatParam(CumBslrHydroPartitionEnum,bslrhydro_partition,nparthydro,1));
++		xDelete<IssmDouble>(partitionhydro);
++	}
++
++	/*Deal with dsl multi-model ensembles: {{{*/
++	iomodel->FetchData(&dslmodel,"md.dsl.model");
++	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.compute_fingerprints",DslComputeFingerprintsEnum));
++	if(dslmodel==2){
++		IssmDouble modelid; 
++		int nummodels;
++		
++		/*create double param, not int param, because Dakota will be updating it as 
++		 * a double potentially: */
++		iomodel->FetchData(&modelid,"md.dsl.modelid");
++		parameters->AddObject(new DoubleParam(DslModelidEnum,modelid));
++		parameters->AddObject(iomodel->CopyConstantObject("md.dsl.nummodels",DslNummodelsEnum));
++		iomodel->FetchData(&nummodels,"md.dsl.nummodels");
++
++		/*quick checks: */
++		if(nummodels<=0)_error_("dslmme object in  md.dsl field should contain at least 1 ensemble model!");
++		if(modelid<=0 || modelid>nummodels)_error_("modelid field in dslmme object of md.dsl field should be between 1 and the number of ensemble runs!");
++	} /*}}}*/
++	/*Deal with external multi-model ensembles: {{{*/
++	iomodel->FetchData(&externalnature,"md.solidearth.external.nature");
++	if(externalnature>=3){
++		IssmDouble modelid; 
++		int nummodels;
++		
++		/*create double param, not int param, because Dakota will be updating it as a double potentially: */
++		iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
++		parameters->AddObject(new DoubleParam(SolidearthExternalModelidEnum,modelid));
++		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nummodels",SolidearthExternalNummodelsEnum));
++		iomodel->FetchData(&nummodels,"md.solidearth.external.nummodels");
++
++		/*quick checks: */
++		if(nummodels<=0)_error_("mme solidearth solution object in  md.solidearth.external field should contain at least 1 ensemble model!");
++		if(modelid<=0 || modelid>nummodels)_error_("modelid field in md.solidearth.external field should be between 1 and the number of ensemble runs!");
++	} /*}}}*/
++
++	/*Deal with elasticity {{{*/
++	iomodel->FetchData(&rigid,"md.solidearth.settings.rigid");
++	iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
++	iomodel->FetchData(&rotation,"md.solidearth.settings.rotation");
++
++	if(elastic | rigid){
++		/*compute green functions for a range of angles*/
++		iomodel->FetchData(&degacc,"md.solidearth.settings.degacc");
++		M=reCast<int,IssmDouble>(180./degacc+1.);
++	}
++
++	/*love numbers: */
++	if(elastic){
++		iomodel->FetchData(&love_h,&nl,NULL,"md.solidearth.lovenumbers.h");
++		iomodel->FetchData(&love_k,&nl,NULL,"md.solidearth.lovenumbers.k");
++		iomodel->FetchData(&love_l,&nl,NULL,"md.solidearth.lovenumbers.l");
++		iomodel->FetchData(&love_th,&nl,NULL,"md.solidearth.lovenumbers.th");
++		iomodel->FetchData(&love_tk,&nl,NULL,"md.solidearth.lovenumbers.tk");
++		iomodel->FetchData(&love_tl,&nl,NULL,"md.solidearth.lovenumbers.tl");
++
++		parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,love_h,nl,1));
++		parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,love_k,nl,1));
++		parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,love_l,nl,1));
++		parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,love_th,nl,1));
++		parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,love_tk,nl,1));
++		parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,love_tl,nl,1));
++
++		// AD performance is sensitive to calls to ensurecontiguous.
++		// // Providing "t" will cause ensurecontiguous to be called.
++		#ifdef _HAVE_AD_
++		G_elastic=xNew<IssmDouble>(M,"t");
++		U_elastic=xNew<IssmDouble>(M,"t");
++		H_elastic=xNew<IssmDouble>(M,"t");
++		#else
++		G_elastic=xNew<IssmDouble>(M);
++		U_elastic=xNew<IssmDouble>(M);
++		H_elastic=xNew<IssmDouble>(M);
++		#endif
++	}
++	if(rigid){
++		#ifdef _HAVE_AD_
++		G_rigid=xNew<IssmDouble>(M,"t");
++		#else
++		G_rigid=xNew<IssmDouble>(M);
++		#endif
++	}
++	
++	if(rotation)parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.lovenumbers.tk2secular",TidalLoveK2SecularEnum));
++
++	if(rigid | elastic){
++
++		/*compute combined legendre + love number (elastic green function:*/
++		m=DetermineLocalSize(M,IssmComm::GetComm());
++		GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
++	}
++	if(elastic){
++		#ifdef _HAVE_AD_
++		G_elastic_local=xNew<IssmDouble>(m,"t");
++		U_elastic_local=xNew<IssmDouble>(m,"t");
++		H_elastic_local=xNew<IssmDouble>(m,"t");
++		#else
++		G_elastic_local=xNew<IssmDouble>(m);
++		U_elastic_local=xNew<IssmDouble>(m);
++		H_elastic_local=xNew<IssmDouble>(m);
++		#endif
++	}
++	if(rigid){
++		#ifdef _HAVE_AD_
++		G_rigid_local=xNew<IssmDouble>(m,"t");
++		#else
++		G_rigid_local=xNew<IssmDouble>(m);
++		#endif
++	}
++
++	if(rigid){
++		for(int i=lower_row;i<upper_row;i++){
++			IssmDouble alpha,x;
++			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
++			G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
++		}
++	}
++	if(elastic){
++		for(int i=lower_row;i<upper_row;i++){
++			IssmDouble alpha,x;
++			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
++
++			G_elastic_local[i-lower_row]= (love_k[nl-1]-love_h[nl-1])*G_rigid_local[i-lower_row];
++			U_elastic_local[i-lower_row]= (love_h[nl-1])*G_rigid_local[i-lower_row];
++			H_elastic_local[i-lower_row]= 0; 
++			IssmDouble Pn = 0.; 
++			IssmDouble Pn1 = 0.; 
++			IssmDouble Pn2 = 0.; 
++			IssmDouble Pn_p = 0.; 
++			IssmDouble Pn_p1 = 0.; 
++			IssmDouble Pn_p2 = 0.; 
++
++			for (int n=0;n<nl;n++) {
++				IssmDouble deltalove_G;
++				IssmDouble deltalove_U;
++
++				deltalove_G = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]);
++				deltalove_U = (love_h[n]-love_h[nl-1]);
++
++				/*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
++				if(n==0){
++					Pn=1; 
++					Pn_p=0; 
++				}
++				else if(n==1){ 
++					Pn = cos(alpha); 
++					Pn_p = 1; 
++				}
++				else{
++					Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
++					Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
++				}
++				Pn2=Pn1; Pn1=Pn;
++				Pn_p2=Pn_p1; Pn_p1=Pn_p;
++
++				G_elastic_local[i-lower_row] += deltalove_G*Pn;		// gravitational potential 
++				U_elastic_local[i-lower_row] += deltalove_U*Pn;		// vertical (up) displacement 
++				H_elastic_local[i-lower_row] += sin(alpha)*love_l[n]*Pn_p;		// horizontal displacements 
++			}
++		}
++	}
++	if(rigid){
++
++		/*merge G_elastic_local into G_elastic; U_elastic_local into U_elastic; H_elastic_local to H_elastic:{{{*/
++		int* recvcounts=xNew<int>(IssmComm::GetSize());
++		int* displs=xNew<int>(IssmComm::GetSize());
++
++		//recvcounts:
++		ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
++
++		/*displs: */
++		ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
++
++		/*All gather:*/
++		ISSM_MPI_Allgatherv(G_rigid_local, m, ISSM_MPI_DOUBLE, G_rigid, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++		if(elastic){
++			ISSM_MPI_Allgatherv(G_elastic_local, m, ISSM_MPI_DOUBLE, G_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++			ISSM_MPI_Allgatherv(U_elastic_local, m, ISSM_MPI_DOUBLE, U_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++			ISSM_MPI_Allgatherv(H_elastic_local, m, ISSM_MPI_DOUBLE, H_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++		}
++		
++		/*free resources: */
++		xDelete<int>(recvcounts);
++		xDelete<int>(displs);
++
++		/*Avoid singularity at 0: */
++		G_rigid[0]=G_rigid[1];
++		if(elastic){
++			G_elastic[0]=G_elastic[1];
++			U_elastic[0]=U_elastic[1];
++			H_elastic[0]=H_elastic[1];
++		}
++		
++
++		/*Save our precomputed tables into parameters*/
++		parameters->AddObject(new DoubleVecParam(SealevelchangeGRigidEnum,G_rigid,M));
++		if(elastic){
++			parameters->AddObject(new DoubleVecParam(SealevelchangeGElasticEnum,G_elastic,M));
++			parameters->AddObject(new DoubleVecParam(SealevelchangeUElasticEnum,U_elastic,M));
++			parameters->AddObject(new DoubleVecParam(SealevelchangeHElasticEnum,H_elastic,M));
++		}
++
++		/*free resources: */
++		xDelete<IssmDouble>(G_rigid);
++		xDelete<IssmDouble>(G_rigid_local);
++		if(elastic){
++			xDelete<IssmDouble>(love_h);
++			xDelete<IssmDouble>(love_k);
++			xDelete<IssmDouble>(love_l);
++			xDelete<IssmDouble>(love_th);
++			xDelete<IssmDouble>(love_tk);
++			xDelete<IssmDouble>(love_tl);
++			xDelete<IssmDouble>(G_elastic);
++			xDelete<IssmDouble>(G_elastic_local);
++			xDelete<IssmDouble>(U_elastic);
++			xDelete<IssmDouble>(U_elastic_local);
++			xDelete<IssmDouble>(H_elastic);
++			xDelete<IssmDouble>(H_elastic_local);
++		}
++	} /*}}}*/
++
++	/*Indicate we have not yet run the Geometry Core module: */
++	parameters->AddObject(new BoolParam(SealevelchangeGeometryDoneEnum,false));
++	/*}}}*/
++
++	/*Transitions:{{{ */
++	iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions,"md.solidearth.transitions");
++	if(transitions){
++		parameters->AddObject(new DoubleMatArrayParam(SealevelchangeTransitionsEnum,transitions,ntransitions,transitions_M,transitions_N));
++
++		for(int i=0;i<ntransitions;i++){
++			IssmDouble* transition=transitions[i];
++			xDelete<IssmDouble>(transition);
++		}
++		xDelete<IssmDouble*>(transitions);
++		xDelete<int>(transitions_M);
++		xDelete<int>(transitions_N);
++	} /*}}}*/
++	/*Requested outputs {{{*/
++	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.solidearth.requested_outputs");
++	if(numoutputs)parameters->AddObject(new StringArrayParam(SealevelchangeRequestedOutputsEnum,requestedoutputs,numoutputs));
++	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.solidearth.requested_outputs");
++	/*}}}*/
++
++}/*}}}*/
++
++/*Finite Element Analysis*/
++void           SealevelchangeAnalysis::Core(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
++ElementVector* SealevelchangeAnalysis::CreateDVector(Element* element){/*{{{*/
++	/*Default, return NULL*/
++	return NULL;
++}/*}}}*/
++ElementMatrix* SealevelchangeAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
++_error_("Not implemented");
++}/*}}}*/
++ElementMatrix* SealevelchangeAnalysis::CreateKMatrix(Element* element){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++ElementVector* SealevelchangeAnalysis::CreatePVector(Element* element){/*{{{*/
++_error_("not implemented yet");
++}/*}}}*/
++void           SealevelchangeAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
++	   _error_("not implemented yet");
++}/*}}}*/
++void           SealevelchangeAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
++void           SealevelchangeAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
++	_error_("not implemeneted yet!");
++
++}/*}}}*/
++void           SealevelchangeAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
++	/*Default, do nothing*/
++	return;
++}/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h	(revision 25947)
+@@ -0,0 +1,33 @@
++/*! \file SealevelchangeAnalysis.h 
++ *  \brief: header file for generic external result object
++ */
++
++#ifndef _SealevelchangeAnalysis_
++#define _SealevelchangeAnalysis_
++
++/*Headers*/
++#include "./Analysis.h"
++
++class SealevelchangeAnalysis: public Analysis{
++
++	public:
++		/*Model processing*/
++		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
++		void CreateLoads(Loads* loads, IoModel* iomodel);
++		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
++		int  DofsPerNode(int** doflist,int domaintype,int approximation);
++		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
++		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
++
++		/*Finite element Analysis*/
++		void           Core(FemModel* femmodel);
++		ElementVector* CreateDVector(Element* element);
++		ElementMatrix* CreateJacobianMatrix(Element* element);
++		ElementMatrix* CreateKMatrix(Element* element);
++		ElementVector* CreatePVector(Element* element);
++		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
++		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
++		void           UpdateConstraints(FemModel* femmodel);
++};
++#endif
+Index: ../trunk-jpl/src/c/analyses/analyses.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/analyses.h	(revision 25946)
++++ ../trunk-jpl/src/c/analyses/analyses.h	(revision 25947)
+@@ -35,7 +35,7 @@
+ #include "./LevelsetAnalysis.h"
+ #include "./MasstransportAnalysis.h"
+ #include "./SmbAnalysis.h"
+-#include "./SealevelriseAnalysis.h"
++#include "./SealevelchangeAnalysis.h"
+ #include "./MeltingAnalysis.h"
+ #include "./SmoothAnalysis.h"
+ #include "./StressbalanceAnalysis.h"
+Index: ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 25947)
+@@ -94,7 +94,7 @@
+ 		responses=xNewZeroInit<IssmDouble>(numFns);
+ 
+ 		/*Hack:*/
+-		for(int i=0;i<femmodel_init->nummodels;i++) if(femmodel_init->analysis_type_list[i]==SealevelriseAnalysisEnum) sealevelrise_core_geometry(femmodel_init);
++		for(int i=0;i<femmodel_init->nummodels;i++) if(femmodel_init->analysis_type_list[i]==SealevelchangeAnalysisEnum) sealevelchange_geometry(femmodel_init);
+ 
+ 		/*Make a copy of femmodel, so we start this new evaluation run for this specific sample with a brand 
+ 		 * new copy of the model, which has not been tempered with by previous evaluation runs: */
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 25946)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 25947)
+@@ -376,13 +376,13 @@
+ 		virtual IssmDouble    GetArea3D(void)=0;
+ 		virtual IssmDouble    GetAreaSpherical(void)=0;
+ 		virtual IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks)=0;
+-		virtual void          SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks)=0;
+-		virtual IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution,IssmDouble* partition,IssmDouble oceanarea)=0;
+-		virtual IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea)=0;
+-		virtual void          SealevelriseEustaticBottomPressure(IssmDouble* Sgi, SealevelMasks* masks)=0;
+-		virtual void          SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz)=0;
+-		virtual void          SealevelriseNonEustatic(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0;
+-		virtual void          SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
++		virtual void          SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks)=0;
++		virtual IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution,IssmDouble* partition,IssmDouble oceanarea)=0;
++		virtual IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea)=0;
++		virtual void          SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi, SealevelMasks* masks)=0;
++		virtual void          SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz)=0;
++		virtual void          SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0;
++		virtual void          DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 25946)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 25947)
+@@ -215,13 +215,13 @@
+ 		#ifdef _HAVE_SEALEVELRISE_
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
+-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseNonEustatic(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
++		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
++		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
++		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		#endif
+ 
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25947)
+@@ -139,6 +139,10 @@
+ 		case DslModelEnum : return "DslModel";
+ 		case DslModelidEnum : return "DslModelid";
+ 		case DslNummodelsEnum : return "DslNummodels";
++		case SolidearthIsExternalEnum : return "SolidearthIsExternal";
++		case SolidearthExternalNatureEnum : return "SolidearthExternalNature";
++		case SolidearthExternalModelidEnum : return "SolidearthExternalModelid";
++		case SolidearthExternalNummodelsEnum : return "SolidearthExternalNummodels";
+ 		case DslComputeFingerprintsEnum : return "DslComputeFingerprints";
+ 		case EarthIdEnum : return "EarthId";
+ 		case EplZigZagCounterEnum : return "EplZigZagCounter";
+@@ -339,7 +343,7 @@
+ 		case SolidearthSettingsAbstolEnum : return "SolidearthSettingsAbstol";
+ 		case RotationalAngularVelocityEnum : return "RotationalAngularVelocity";
+ 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
+-		case SealevelriseGeometryDoneEnum : return "SealevelriseGeometryDone";
++		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
+ 		case RotationalEquatorialMoiEnum : return "RotationalEquatorialMoi";
+ 		case TidalLoveHEnum : return "TidalLoveH";
+ 		case TidalLoveKEnum : return "TidalLoveK";
+@@ -348,24 +352,24 @@
+ 		case LoadLoveHEnum : return "LoadLoveH";
+ 		case LoadLoveKEnum : return "LoadLoveK";
+ 		case LoadLoveLEnum : return "LoadLoveL";
+-		case SealevelriseGRigidEnum : return "SealevelriseGRigid";
+-		case SealevelriseGElasticEnum : return "SealevelriseGElastic";
++		case SealevelchangeGRigidEnum : return "SealevelchangeGRigid";
++		case SealevelchangeGElasticEnum : return "SealevelchangeGElastic";
+ 		case SolidearthSettingsComputesealevelchangeEnum : return "SolidearthSettingsComputesealevelchange";
+ 		case SolidearthSettingsGRDEnum : return "SolidearthSettingsGRD";
+ 		case SolidearthSettingsGlfractionEnum : return "SolidearthSettingsGlfraction";
+ 		case SolidearthSettingsRunFrequencyEnum : return "SolidearthSettingsRunFrequency";
+-		case SealevelriseHElasticEnum : return "SealevelriseHElastic";
++		case SealevelchangeHElasticEnum : return "SealevelchangeHElastic";
+ 		case SolidearthSettingsHorizEnum : return "SolidearthSettingsHoriz";
+ 		case SolidearthSettingsMaxiterEnum : return "SolidearthSettingsMaxiter";
+ 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
+ 		case RotationalPolarMoiEnum : return "RotationalPolarMoi";
+ 		case SolidearthSettingsReltolEnum : return "SolidearthSettingsReltol";
+-		case SealevelriseRequestedOutputsEnum : return "SealevelriseRequestedOutputs";
++		case SealevelchangeRequestedOutputsEnum : return "SealevelchangeRequestedOutputs";
+ 		case SolidearthSettingsRigidEnum : return "SolidearthSettingsRigid";
+ 		case SolidearthSettingsRotationEnum : return "SolidearthSettingsRotation";
+-		case SealevelriseRunCountEnum : return "SealevelriseRunCount";
+-		case SealevelriseTransitionsEnum : return "SealevelriseTransitions";
+-		case SealevelriseUElasticEnum : return "SealevelriseUElastic";
++		case SealevelchangeRunCountEnum : return "SealevelchangeRunCount";
++		case SealevelchangeTransitionsEnum : return "SealevelchangeTransitions";
++		case SealevelchangeUElasticEnum : return "SealevelchangeUElastic";
+ 		case SettingsIoGatherEnum : return "SettingsIoGather";
+ 		case SettingsNumResultsOnNodesEnum : return "SettingsNumResultsOnNodes";
+ 		case SettingsOutputFrequencyEnum : return "SettingsOutputFrequency";
+@@ -533,6 +537,8 @@
+ 		case BaseSlopeXEnum : return "BaseSlopeX";
+ 		case BaseSlopeYEnum : return "BaseSlopeY";
+ 		case BedEnum : return "Bed";
++		case BedEastEnum : return "BedEast";
++		case BedNorthEnum : return "BedNorth";
+ 		case BedSlopeXEnum : return "BedSlopeX";
+ 		case BedSlopeYEnum : return "BedSlopeY";
+ 		case CalvingCalvingrateEnum : return "CalvingCalvingrate";
+@@ -711,8 +717,8 @@
+ 		case RheologyBInitialguessMisfitEnum : return "RheologyBInitialguessMisfit";
+ 		case RheologyBbarAbsGradientEnum : return "RheologyBbarAbsGradient";
+ 		case SealevelEnum : return "Sealevel";
+-		case SealevelEustaticMaskEnum : return "SealevelEustaticMask";
+-		case SealevelEustaticOceanMaskEnum : return "SealevelEustaticOceanMask";
++		case SealevelBarystaticMaskEnum : return "SealevelBarystaticMask";
++		case SealevelBarystaticOceanMaskEnum : return "SealevelBarystaticOceanMask";
+ 		case SealevelNEsaEnum : return "SealevelNEsa";
+ 		case SealevelNEsaRateEnum : return "SealevelNEsaRate";
+ 		case SealevelRSLEnum : return "SealevelRSL";
+@@ -721,23 +727,22 @@
+ 		case BslrHydroEnum : return "BslrHydro";
+ 		case BslrRateEnum : return "BslrRate";
+ 		case GmtslrEnum : return "Gmtslr";
+-		case SealevelRSLEustaticEnum : return "SealevelRSLEustatic";
+-		case SealevelRSLEustaticRateEnum : return "SealevelRSLEustaticRate";
++		case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic";
+ 		case SealevelRSLRateEnum : return "SealevelRSLRate";
+ 		case SealevelUEastEsaEnum : return "SealevelUEastEsa";
+ 		case SealevelUEsaEnum : return "SealevelUEsa";
+ 		case SealevelUEsaRateEnum : return "SealevelUEsaRate";
+ 		case SealevelUNorthEsaEnum : return "SealevelUNorthEsa";
+-		case SealevelriseCumDeltathicknessEnum : return "SealevelriseCumDeltathickness";
+-		case SealevelriseCumDeltathicknessOldEnum : return "SealevelriseCumDeltathicknessOld";
++		case SealevelchangeCumDeltathicknessEnum : return "SealevelchangeCumDeltathickness";
++		case SealevelchangeCumDeltathicknessOldEnum : return "SealevelchangeCumDeltathicknessOld";
+ 		case SurfaceloadOtherEnum : return "SurfaceloadOther";
+ 		case SurfaceloadIceThicknessChangeEnum : return "SurfaceloadIceThicknessChange";
+ 		case SurfaceloadWaterHeightChangeEnum : return "SurfaceloadWaterHeightChange";
+-		case SealevelriseIndicesEnum : return "SealevelriseIndices";
+-		case SealevelriseGEnum : return "SealevelriseG";
+-		case SealevelriseGUEnum : return "SealevelriseGU";
+-		case SealevelriseGEEnum : return "SealevelriseGE";
+-		case SealevelriseGNEnum : return "SealevelriseGN";
++		case SealevelchangeIndicesEnum : return "SealevelchangeIndices";
++		case SealevelchangeGEnum : return "SealevelchangeG";
++		case SealevelchangeGUEnum : return "SealevelchangeGU";
++		case SealevelchangeGEEnum : return "SealevelchangeGE";
++		case SealevelchangeGNEnum : return "SealevelchangeGN";
+ 		case SedimentHeadEnum : return "SedimentHead";
+ 		case SedimentHeadOldEnum : return "SedimentHeadOld";
+ 		case SedimentHeadSubstepEnum : return "SedimentHeadSubstep";
+@@ -845,6 +850,11 @@
+ 		case SmbZMinEnum : return "SmbZMin";
+ 		case SmbZTopEnum : return "SmbZTop";
+ 		case SmbZYEnum : return "SmbZY";
++		case SolidearthExternalDisplacementEastRateEnum : return "SolidearthExternalDisplacementEastRate";
++		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
++		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
++		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
++		case SolidearthExternalBarystaticSeaLevelRateEnum : return "SolidearthExternalBarystaticSeaLevelRate";
+ 		case StrainRateeffectiveEnum : return "StrainRateeffective";
+ 		case StrainRateparallelEnum : return "StrainRateparallel";
+ 		case StrainRateperpendicularEnum : return "StrainRateperpendicular";
+@@ -1304,8 +1314,8 @@
+ 		case SealevelInertiaTensorZZEnum : return "SealevelInertiaTensorZZ";
+ 		case SealevelNmotionEnum : return "SealevelNmotion";
+ 		case SealevelUmotionEnum : return "SealevelUmotion";
+-		case SealevelriseAnalysisEnum : return "SealevelriseAnalysis";
+-		case SealevelriseSolutionEnum : return "SealevelriseSolution";
++		case SealevelchangeAnalysisEnum : return "SealevelchangeAnalysis";
++		case SealevelchangeSolutionEnum : return "SealevelchangeSolution";
+ 		case SegEnum : return "Seg";
+ 		case SegInputEnum : return "SegInput";
+ 		case SegmentEnum : return "Segment";
+Index: ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m	(revision 25947)
+@@ -0,0 +1,43 @@
++%ADDITIONALSOLIDEARTHSOLUTION class definition
++%
++%   Usage:
++%      addsol=additionalsolidearthsolution();
++
++classdef additionalsolidearthsolution < solidearthsolution
++	properties (SetAccess=public) 
++	end
++	methods
++		function self = additionalsolidearthsolution(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++			self.setdefaultparameters@solidearthsolution();
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
++				error('additionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
++			end
++			self.checkconsistency@solidearthsolution(md,solution,analyses);
++
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   external: additionalsolidearth solution:'));
++			self.disp@solidearthsolution();
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++			WriteData(fid,prefix,'object',self,'data',1,'name','md.solidearth.external.nature','format','Integer'); %code 1 for additionalsolidearthsolution  class
++			self.marshall@solidearthsolution(prefix,md,fid);
++		end % }}}
++		function savemodeljs(self,fid,modelname) % {{{
++			self.savemodeljs@solidearthsolution(fid,modelname);
++		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 25947)
+@@ -0,0 +1,86 @@
++%MMEOFFLINESOLIDEARTHSOLUTION class definition
++%
++%   Usage:
++%      addsol=mmeofflinesolidearthsolution(); where the offline solid earth solutions %                               are based on a multi-model ensemble (ex: Caron et al 2017 statistics) 
++
++classdef mmeofflinesolidearthsolution < offlinesolidearthsolution 
++	properties (SetAccess=public) 
++		modelid; %index into the multi-model ensemble, each ensemble variable being defined 
++	         %in the father class.
++	end
++	methods
++		function self = mmeofflinesolidearthsolution(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++			self.setdefaultparameters@offlinesolidearthsolution();
++			self.modelid=0;
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
++				error('mmeofflinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
++			end
++			
++			seast=length(self.displacementeast);
++			snorth=length(self.displacementnorth);
++			sup=length(self.displacementup);
++			sgeoid=length(self.geoid);
++			sbarystaticsealevel=length(self.barystaticsealevel);
++
++			if (seast-snorth)~=0,
++				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
++			end
++
++			if (seast-sup)~=0,
++				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and displacementup should be the same size');
++			end
++
++			if (seast-sgeoid)~=0,
++				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
++			end
++
++			if (seast-sbarystaticsealevel)~=0,
++				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and barystaticsealevel should be the same size');
++			end
++			
++			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
++
++			for i=1:seast,
++				md = checkfield(md,'field',self.displacementeast{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.barystaticsealevel{i},'NaN',1,'Inf',1,'timeseries',1);
++			end
++
++
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   external: mmeofflinesolidearth solution:'));
++			self.disp@solidearthsolution();
++			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++			WriteData(fid,prefix,'object',self,'data',4,'name','md.solidearth.external.nature','format','Integer'); %code 4 for mmeofflinesolidearthsolution  class
++			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
++			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',length(self.displacementeast),'format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++
++		end % }}}
++		function savemodeljs(self,fid,modelname) % {{{
++			error('mmeofflinesolidearthsolution error message: not implemented yet');
++		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 25946)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 25947)
+@@ -40,7 +40,7 @@
+ 			self.partitionice=[];
+ 			self.partitionhydro=[];
+ 
+-			%no external solutions by defalt: 
++			%no external solutions by default: 
+ 			self.external=[];
+ 
+ 			%earth radius
+@@ -119,7 +119,10 @@
+ 			self.lovenumbers.marshall(prefix,md,fid);
+ 			self.rotational.marshall(prefix,md,fid);
+ 			if ~isempty(self.external),
++				WriteData(fid,prefix,'data',1,'format','Integer','name','md.solidearth.isexternal');
+ 				self.external.marshall(prefix,md,fid);
++			else
++				WriteData(fid,prefix,'data',0,'format','Integer','name','md.solidearth.isexternal');
+ 			end
+ 			
+ 			%process requested outputs
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 25946)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 25947)
+@@ -169,14 +169,14 @@
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ #endif
+ #ifdef _HAVE_SEALEVELRISE_
+-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
+-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseNonEustatic(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
++		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
++		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
++		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ #endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 25946)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 25947)
+@@ -176,13 +176,13 @@
+ #endif
+ #ifdef _HAVE_SEALEVELRISE_
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
+-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseNonEustatic(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelriseGeodetic(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
++		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
++		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
++		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    DeformationFromSurfaceLoads(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ #endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25947)
+@@ -5386,7 +5386,7 @@
+ 	/*how many dofs are we working with here? */
+ 	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+ 
+-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
++	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+ 	area=GetAreaSpherical();
+ 
+ 	/*element centroid (spherical): */
+@@ -5521,7 +5521,7 @@
+ 
+ }
+ /*}}}*/
+-void	Tria::SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
++void	Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
+ 	/*early return if we are not on an ice cap OR ocean:*/
+ 	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){
+ 		dI_list[0] = 0.0; // this is important!!!
+@@ -5585,7 +5585,7 @@
+ 		/*recover material parameters: */
+ 		rho_water=FindParam(MaterialsRhoSeawaterEnum);
+ 
+-		/*From Sg_old, recover water sea level rise:*/
++		/*From Sg_old, recover water sea level change:*/
+ 		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):
+@@ -5605,7 +5605,7 @@
+ 
+ 		/*Compute ice thickness change: */
+ 		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
+-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
++		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+ 		deltathickness_input->GetInputAverage(&I);
+ 
+ 		dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+@@ -5631,7 +5631,7 @@
+ 
+ }
+ /*}}}*/
+-void    Tria::SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){ /*{{{*/
++void    Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){ /*{{{*/
+ 	/*diverse:*/
+ 	int gsize;
+ 	bool spherical=true;
+@@ -5692,7 +5692,7 @@
+ 	if(!computerigid)return;
+ 
+ 	/*recover precomputed green function kernels:*/
+-	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGRigidEnum)); _assert_(parameter);
++	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
+ 	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
+ 
+ 	/*allocate indices:*/
+@@ -5700,13 +5700,13 @@
+ 	G=xNewZeroInit<IssmDouble>(gsize);
+ 
+ 	if(computeelastic){
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
+ 		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
+ 
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseHElasticEnum)); _assert_(parameter);
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHElasticEnum)); _assert_(parameter);
+ 		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&M);
+ 
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseUElasticEnum)); _assert_(parameter);
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
+ 		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
+ 
+ 		GU=xNewZeroInit<IssmDouble>(gsize);
+@@ -5774,13 +5774,13 @@
+ 	}
+ 
+ 	/*Add in inputs:*/
+-	this->inputs->SetArrayInput(SealevelriseIndicesEnum,this->lid,indices,gsize);
+-	this->inputs->SetArrayInput(SealevelriseGEnum,this->lid,G,gsize);
++	this->inputs->SetArrayInput(SealevelchangeIndicesEnum,this->lid,indices,gsize);
++	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,gsize);
+ 	if(computeelastic){
+-		this->inputs->SetArrayInput(SealevelriseGUEnum,this->lid,GU,gsize);
++		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,gsize);
+ 		if(horiz){
+-			this->inputs->SetArrayInput(SealevelriseGNEnum,this->lid,GN,gsize);
+-			this->inputs->SetArrayInput(SealevelriseGEEnum,this->lid,GE,gsize);
++			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,gsize);
++			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,gsize);
+ 		}
+ 	}
+ 	this->inputs->SetDoubleInput(AreaEnum,this->lid,area); 
+@@ -5812,12 +5812,12 @@
+ 	return;
+ }
+ /*}}}*/
+-IssmDouble Tria::SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
++IssmDouble Tria::SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize;
+ 	IssmDouble area;
+-	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes eustatic
++	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+ 	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
+ 	bool notfullygrounded=false;
+ 	bool scaleoceanarea= false;
+@@ -5839,7 +5839,7 @@
+ 	/*early return if we are not on an ice cap:*/
+ 	if(!masks->isiceonly[this->lid]){
+ 		#ifdef _ISSM_DEBUG_
+-		constant=0; this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
++		constant=0; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 		#endif
+ 		bslrice=0;
+ 		return bslrice;
+@@ -5849,7 +5849,7 @@
+ 	if (masks->isfullyfloating[this->lid]){
+ 		constant=0;
+ 		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
++		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 		#endif
+ 		bslrice=0;
+ 		return bslrice;
+@@ -5861,7 +5861,7 @@
+ 	/*Inform mask: */
+ 	constant=1;
+ 	#ifdef _ISSM_DEBUG_
+-	this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
++	this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 	#endif
+ 
+ 	/*recover some parameters:*/
+@@ -5872,9 +5872,9 @@
+ 	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+ 
+ 	/*retrieve precomputed G:*/
+-	if(computerigid)this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&gsize);
++	if(computerigid)this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&gsize);
+ 
+-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
++	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Compute fraction of the element that is grounded: */
+@@ -5885,7 +5885,7 @@
+ 		phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
+ 		if(glfraction==0)phi=1;
+ 		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelEustaticMaskEnum,&phi,P0Enum);
++		this->AddInput(SealevelBarystaticMaskEnum,&phi,P0Enum);
+ 		#endif
+ 	}
+ 	else phi=1.0;
+@@ -5892,7 +5892,7 @@
+ 
+ 	/*Retrieve ice thickness at vertices: */
+ 	Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
+-	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
++	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+ 
+ 	/*/Average ice thickness over grounded area of the element only: {{{*/
+ 	if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
+@@ -5943,7 +5943,7 @@
+ 	return bslrice;
+ }
+ /*}}}*/
+-IssmDouble Tria::SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
++IssmDouble Tria::SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize;
+@@ -5986,14 +5986,14 @@
+ 	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 
+ 	/*retrieve precomputed G:*/
+-	if(computeelastic)this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&gsize);
++	if(computeelastic)this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&gsize);
+ 
+-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
++	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Retrieve water height at vertices: */
+ 	Input* deltathickness_input=this->GetInput(SurfaceloadWaterHeightChangeEnum);
+-	if (!deltathickness_input)_error_("SurfaceloadWaterHeightChangeEnum input needed to compute sea level rise!");
++	if (!deltathickness_input)_error_("SurfaceloadWaterHeightChangeEnum input needed to compute sea level change!");
+ 	deltathickness_input->GetInputAverage(&W);
+ 
+ 	/*Compute barystatic component:*/
+@@ -6019,7 +6019,7 @@
+ 	return bslrhydro;
+ }
+ /*}}}*/
+-void    Tria::SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/
++void    Tria::SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize;
+@@ -6043,7 +6043,7 @@
+ 
+ 	/*Inform mask: */
+ 	#ifdef _ISSM_DEBUG_
+-	constant=1; this->AddInput(SealevelEustaticMaskEnum,&constant,P0Enum);
++	constant=1; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 	#endif
+ 
+ 	/*recover material parameters: */
+@@ -6050,14 +6050,14 @@
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+ 
+ 	/*retrieve precomputed G:*/
+-	this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&gsize);
++	this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&gsize);
+ 
+-	/*Get area of element: precomputed in the sealevelrise_core_geometry:*/
++	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Retrieve bottom pressure change and average over the element: */
+ 	Input* bottompressure_change_input=this->GetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
+-	if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!");
++	if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level change fingerprint!");
+ 	bottompressure_change_input->GetInputAverage(&BP);
+ 
+ 	/*convert from m to kg/m^2:*/
+@@ -6069,7 +6069,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void    Tria::SealevelriseNonEustatic(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/
++void    Tria::SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize,dummy;
+@@ -6087,13 +6087,13 @@
+ 	if (!masks->isoceanin[this->lid]){
+ 		constant=0;
+ 		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
++		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum);
+ 		#endif
+ 		return;
+ 	}
+ 	constant=1;
+ 	#ifdef _ISSM_DEBUG_
+-	this->AddInput(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
++	this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum);
+ 	#endif
+ 
+ 	/*how many dofs are we working with here? */
+@@ -6100,9 +6100,9 @@
+ 	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+ 
+ 	/*retrieve precomputed G:*/
+-	this->inputs->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&dummy); _assert_(dummy==gsize);
++	this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&dummy); _assert_(dummy==gsize);
+ 
+-	/*From Sg_old, recover water sea level rise:*/
++	/*From Sg_old, recover water sea level change:*/
+ 	S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
+ 
+ 	/*convert to kg/m^2: */
+@@ -6113,7 +6113,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void    Tria::SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
++void    Tria::DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize;
+@@ -6146,15 +6146,15 @@
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+ 
+ 	/*recover elastic Green's functions for displacement:*/
+-	this->inputs->GetArrayPtr(SealevelriseGUEnum,this->lid,&GU,&gsize);
++	this->inputs->GetArrayPtr(SealevelchangeGUEnum,this->lid,&GU,&gsize);
+ 	if(horiz){
+-		this->inputs->GetArrayPtr(SealevelriseGEEnum,this->lid,&GE,&gsize);
+-		this->inputs->GetArrayPtr(SealevelriseGNEnum,this->lid,&GN,&gsize);
++		this->inputs->GetArrayPtr(SealevelchangeGEEnum,this->lid,&GE,&gsize);
++		this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&gsize);
+ 	}
+ 
+ 
+ 	if(masks->isoceanin[this->lid]){
+-		/*From Sg, recover water sea level rise:*/
++		/*From Sg, recover water sea level change:*/
+ 		S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg[this->vertices[i]->Sid()]/NUMVERTICES;
+ 
+ 		/*convert to kg/m^2:*/
+@@ -6163,7 +6163,7 @@
+ 		/*If bottom pressures are available, retrieve them to load the bedrock:*/
+ 		if(bp_compute_fingerprints){
+ 			Input* bottompressure_change_input=this->GetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
+-			if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!");
++			if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level change fingerprint!");
+ 			bottompressure_change_input->GetInputAverage(&BP);
+ 
+ 			/*convert from m to kg/m^2:*/
+@@ -6184,7 +6184,7 @@
+ 
+ 		/*Compute ice thickness change: */
+ 		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
+-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
++		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+ 		deltathickness_input->GetInputAverage(&I);
+ 
+ 		/*convert to kg/m^2*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 25946)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 25947)
+@@ -161,14 +161,14 @@
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELRISE_
+ 		IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks);
+-		void    SealevelriseMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
++		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
+ 		void    SetSealevelMasks(SealevelMasks* masks);
+-		void    SealevelriseGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
+-		IssmDouble    SealevelriseEustaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
+-		IssmDouble    SealevelriseEustaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
+-		void    SealevelriseEustaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
+-		void    SealevelriseNonEustatic(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
+-		void    SealevelriseGeodetic(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
++		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
++		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
++		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
++		void    SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
++		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 25947)
+@@ -832,8 +832,8 @@
+ 			analyses_temp[numanalyses++]=EsaAnalysisEnum;
+ 			break;
+ 
+-		case SealevelriseSolutionEnum:
+-			analyses_temp[numanalyses++]=SealevelriseAnalysisEnum;
++		case SealevelchangeSolutionEnum:
++			analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
+ 			analyses_temp[numanalyses++]=GiaAnalysisEnum;
+ 			break;
+ 
+@@ -898,7 +898,7 @@
+ 			}
+ 			if(isslr){
+ 				analyses_temp[numanalyses++]=GiaAnalysisEnum;
+-				analyses_temp[numanalyses++]=SealevelriseAnalysisEnum;
++				analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
+ 			}
+ 			if(isesa){
+ 				analyses_temp[numanalyses++]=EsaAnalysisEnum;
+@@ -4756,7 +4756,7 @@
+ /*}}}*/
+ #endif
+ #ifdef _HAVE_SEALEVELRISE_
+-void FemModel::SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition,SealevelMasks* masks) { /*{{{*/
++void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition,SealevelMasks* masks) { /*{{{*/
+ 
+ 	/*serialized vectors:*/
+ 	IssmDouble  bslrice       = 0.;
+@@ -4779,7 +4779,7 @@
+ 	int nparthydro; 
+ 		
+ 
+-   /*Initialize temporary vector that will be used to sum eustatic components
++   /*Initialize temporary vector that will be used to sum barystatic components
+     * on all local elements, prior to assembly:*/
+ 	int gsize = this->nodes->NumberOfDofs(GsetEnum);
+ 	IssmDouble* RSLgi=xNewZeroInit<IssmDouble>(gsize);
+@@ -4786,7 +4786,7 @@
+ 	int* indices=xNew<int>(gsize);
+    for(int i=0;i<gsize;i++) indices[i]=i;
+ 
+-	/*First, figure out the area of the ocean, which is needed to compute the eustatic component: */
++	/*First, figure out the area of the ocean, which is needed to compute the barystatic component: */
+ 	int i = -1;
+ 	for(Object* & object : this->elements->objects){
+ 		i +=1;
+@@ -4812,26 +4812,26 @@
+ 	}
+ 
+ 
+-	/*Call the sea level rise core for ice : */
++	/*Call the barystatic sea level change core for ice : */
+ 	bslrice_cpu=0;
+ 	for(Object* & object : this->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		bslrice_cpu+=element->SealevelriseEustaticIce(RSLgi,masks, bslrice_partition,partitionice,oceanarea);
++		bslrice_cpu+=element->SealevelchangeBarystaticIce(RSLgi,masks, bslrice_partition,partitionice,oceanarea);
+ 	}
+ 
+-	/*Call the sea level rise core for hydro: */
++	/*Call the barystatic sea level change core for hydro: */
+ 	bslrhydro_cpu=0;
+ 	for(int i=0;i<elements->Size();i++){
+ 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-		bslrhydro_cpu+=element->SealevelriseEustaticHydro(RSLgi,masks, bslrhydro_partition,partitionhydro,oceanarea);
++		bslrhydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslrhydro_partition,partitionhydro,oceanarea);
+ 	}
+ 
+-	/*Call the sea level rise core for bottom pressures: */
++	/*Call the barystatic sea level change core for bottom pressures: */
+ 	this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
+ 	if(bp_compute_fingerprints){
+ 		for(int i=0;i<elements->Size();i++){
+ 			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-			element->SealevelriseEustaticBottomPressure(RSLgi,masks);
++			element->SealevelchangeBarystaticBottomPressure(RSLgi,masks);
+ 		}
+ 	}
+ 
+@@ -4839,7 +4839,7 @@
+ 	pRSLgi->SetValues(gsize,indices,RSLgi,ADD_VAL);
+ 	pRSLgi->Assemble();
+ 
+-	/*Sum all eustatic components from all cpus:*/
++	/*Sum all barystatic components from all cpus:*/
+ 	ISSM_MPI_Reduce (&bslrice_cpu,&bslrice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+ 	ISSM_MPI_Bcast(&bslrice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 	_assert_(!xIsNan<IssmDouble>(bslrice));
+@@ -4877,7 +4877,7 @@
+ 
+ }
+ /*}}}*/
+-void FemModel::SealevelriseNonEustatic(Vector<IssmDouble>* pRSLgo, Vector<IssmDouble>* pRSLg_old,  SealevelMasks* masks, bool verboseconvolution){/*{{{*/
++void FemModel::SealevelchangeSal(Vector<IssmDouble>* pRSLgo, Vector<IssmDouble>* pRSLg_old,  SealevelMasks* masks, bool verboseconvolution){/*{{{*/
+ 
+ 	/*serialized vectors:*/
+ 	IssmDouble* RSLg_old=NULL;
+@@ -4892,7 +4892,7 @@
+ 	/*recover computational flags: */
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 
+-	/*Initialize temporary vector that will be used to sum eustatic components on all local elements, prior
++	/*Initialize temporary vector that will be used to sum barystatic components on all local elements, prior
+ 	 * to assembly:*/
+ 	gsize = this->nodes->NumberOfDofs(GsetEnum);
+ 	RSLgo=xNewZeroInit<IssmDouble>(gsize);
+@@ -4901,11 +4901,11 @@
+ 	/*Serialize vectors from previous iteration:*/
+ 	RSLg_old=pRSLg_old->ToMPISerial();
+ 
+-	/*Call the sea level rise non-eustatic core only if required: */
++	/*Call the sal sea level change core only if required: */
+ 	if(computerigid){
+ 		for(Object* & object : this->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelriseNonEustatic(RSLgo,RSLg_old,masks);
++			element->SealevelchangeSal(RSLgo,RSLg_old,masks);
+ 		}
+ 	}
+ 	pRSLgo->SetValues(gsize,indices,RSLgo,ADD_VAL);
+@@ -4918,7 +4918,7 @@
+ 
+ }
+ /*}}}*/
+-void FemModel::SealevelriseRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz,  SealevelMasks* masks){/*{{{*/
++void FemModel::SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz,  SealevelMasks* masks){/*{{{*/
+ 
+ 	/*serialized vectors:*/
+ 	bool spherical=true;
+@@ -4941,7 +4941,7 @@
+ 	IssmDouble moi_list_cpu[3]={0,0,0};
+ 	for(Object* & object : this->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelriseMomentOfInertia(&moi_list[0],RSLg_old,masks );
++		element->SealevelchangeMomentOfInertia(&moi_list[0],RSLg_old,masks );
+ 		moi_list_cpu[0] += moi_list[0];
+ 		moi_list_cpu[1] += moi_list[1];
+ 		moi_list_cpu[2] += moi_list[2];
+@@ -5012,7 +5012,7 @@
+ 
+ }
+ /*}}}*/
+-void FemModel::SealevelriseElastic(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pRSLg, SealevelMasks* masks){/*{{{*/
++void FemModel::SealevelchangeDeformation(Vector<IssmDouble>* pgeoid, Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pRSLg, SealevelMasks* masks){/*{{{*/
+ 
+ 	/*serialized vectors:*/
+ 	IssmDouble* RSLg=NULL;
+@@ -5030,7 +5030,7 @@
+ 	/*Serialize vectors from previous iteration:*/
+ 	RSLg=pRSLg->ToMPISerial();
+ 
+-	/*Initialize temporary vector that will be used to sum eustatic components on all local elements, prior
++	/*Initialize temporary vector that will be used to sum barystatic components on all local elements, prior
+ 	 * to assembly:*/
+ 	gsize = this->nodes->NumberOfDofs(GsetEnum);
+ 	Up=xNewZeroInit<IssmDouble>(gsize);
+@@ -5040,14 +5040,19 @@
+ 	}
+ 	indices=xNew<int>(gsize); for (int i=0;i<gsize;i++)indices[i]=i;
+ 
+-	/*Call the sea level rise core: */
++	/*Call the deformation from loading routines:*/
+ 	for(Object* & object : this->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelriseGeodetic(Up,North,East,RSLg,masks);
++		element->DeformationFromSurfaceLoads(Up,North,East,RSLg,masks);
+ 	}
+ 
+ 	pUp->SetValues(gsize,indices,Up,ADD_VAL);
+ 	pUp->Assemble();
++	
++
++	/*Add RSL to Up to find the geoid: */
++	pUp->Copy(pgeoid); pgeoid->AXPY(pRSLg,1);
++
+ 	if (horiz){
+ 		pNorth->SetValues(gsize,indices,North,ADD_VAL);
+ 		pNorth->Assemble();
+@@ -5065,7 +5070,7 @@
+ 	xDelete<IssmDouble>(RSLg);
+ }
+ /*}}}*/
+-IssmDouble FemModel::SealevelriseOceanAverage(Vector<IssmDouble>* RSLg,SealevelMasks* masks, IssmDouble oceanarea) { /*{{{*/
++IssmDouble FemModel::SealevelchangeOceanAverage(Vector<IssmDouble>* RSLg,SealevelMasks* masks, IssmDouble oceanarea) { /*{{{*/
+ 
+ 	IssmDouble* RSLg_serial=NULL;
+ 	IssmDouble  oceanvalue,oceanvalue_cpu;
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 25946)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 25947)
+@@ -165,11 +165,11 @@
+ 		void EsaGeodetic3D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELRISE_
+-		void SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition, SealevelMasks* masks); 
+-		void SealevelriseNonEustatic(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
+-		void SealevelriseRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
+-		void SealevelriseElastic(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
+-		IssmDouble SealevelriseOceanAverage(Vector<IssmDouble>* Sg,SealevelMasks* masks, IssmDouble oceanarea);
++		void SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition, SealevelMasks* masks); 
++		void SealevelchangeSal(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
++		void SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
++		void SealevelchangeDeformation(Vector<IssmDouble>* pgeoid,Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
++		IssmDouble SealevelchangeOceanAverage(Vector<IssmDouble>* Sg,SealevelMasks* masks, IssmDouble oceanarea);
+ 		#endif
+ 		void HydrologyEPLupdateDomainx(IssmDouble* pEplcount);
+ 		void HydrologyIDSupdateDomainx(IssmDouble* pIDScount);
+Index: ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 25947)
+@@ -58,7 +58,7 @@
+ 		case MasstransportSolutionEnum:
+ 			solutioncore=&masstransport_core;
+ 			break;
+-		case SealevelriseSolutionEnum:
++		case SealevelchangeSolutionEnum:
+ 			solutioncore=&sealevelchange_core;
+ 			break;
+ 		case EsaSolutionEnum:
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 25946)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 25947)
+@@ -53,17 +53,17 @@
+ void smb_core(FemModel* femmodel);
+ void bmb_core(FemModel* femmodel);
+ void damage_core(FemModel* femmodel);
++
++/*sealevel change cores:*/
+ void sealevelchange_core(FemModel* femmodel);
+ void grd_core(FemModel* femmodel);
++void solidearthexternal_core(FemModel* femmodel);
+ void dynstr_core(FemModel* femmodel);
+-void sealevelrise_core_geometry(FemModel* femmodel);
+-SealevelMasks* sealevelrise_core_masks(FemModel* femmodel);
+-Vector<IssmDouble>* sealevelrise_core_eustatic(FemModel* femmodel,SealevelMasks* mask, IssmDouble* poceanarea);
+-Vector<IssmDouble>* sealevelrise_core_noneustatic(FemModel* femmodel,SealevelMasks* masks, Vector<IssmDouble>* RSLg_eustatic,IssmDouble oceanarea);
+-void sealevelrise_core_elastic(Vector<IssmDouble>** pU_radial, Vector<IssmDouble>** pU_north,Vector<IssmDouble>** pU_east,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks);
+-void sealevelrise_core_viscous(Vector<IssmDouble>** pU_gia,Vector<IssmDouble>** pN_gia,FemModel*  femmodel,Vector<IssmDouble>* RSLg);
+-void sealevelrise_diagnostics(FemModel* femmodel,Vector<IssmDouble>* RSLg);
+-IssmDouble objectivefunction(IssmDouble search_scalar,FemModel* femmodel);
++void sealevelchange_geometry(FemModel* femmodel);
++SealevelMasks* sealevel_masks(FemModel* femmodel);
++Vector<IssmDouble>* sealevelchange_core_barystatic(FemModel* femmodel,SealevelMasks* mask, IssmDouble* poceanarea);
++Vector<IssmDouble>* sealevelchange_core_sal(FemModel* femmodel,SealevelMasks* masks, Vector<IssmDouble>* RSLg_barystatic,IssmDouble oceanarea);
++void sealevelchange_core_deformation(Vector<IssmDouble>** pN_radial, Vector<IssmDouble>** pU_radial, Vector<IssmDouble>** pU_north,Vector<IssmDouble>** pU_east,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks);
+ void GetStericRate(Vector<IssmDouble> ** psteric_rate_g, FemModel* femmodel);
+ void GetDynamicRate(Vector<IssmDouble> ** pdynamic_rate_g, FemModel* femmodel);
+ void SetBottomPressure(FemModel* femmodel);
+@@ -70,6 +70,7 @@
+ 
+ //optimization
+ int GradJSearch(IssmDouble* search_vector,FemModel* femmodel,int step);
++IssmDouble objectivefunction(IssmDouble search_scalar,FemModel* femmodel);
+ 
+ //diverse
+ void ProcessArguments(int* solution,char** pbinname,char** poutbinname,char** ptoolkitsname,char** plockname,char** prestartname, char** prootpath,char** pmodelname, int argc,char **argv);
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 25947)
+@@ -63,7 +63,7 @@
+ 		InputDuplicatex(femmodel,ThicknessEnum,ThicknessOldEnum);
+ 		InputDuplicatex(femmodel,BaseEnum,BaseOldEnum);
+ 		InputDuplicatex(femmodel,SurfaceEnum,SurfaceOldEnum);
+-		InputDuplicatex(femmodel,SealevelriseCumDeltathicknessEnum,SealevelriseCumDeltathicknessOldEnum);
++		InputDuplicatex(femmodel,SealevelchangeCumDeltathicknessEnum,SealevelchangeCumDeltathicknessOldEnum);
+ 		if(stabilization==4){
+ 			solutionsequence_fct(femmodel);
+ 		}
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25947)
+@@ -24,6 +24,8 @@
+ 	bool isslr=0;
+ 	bool isgia=0;
+ 	int  grd=0;
++	int  isexternal=0;
++	int  iscoupler=0;
+ 	int solution_type;
+ 
+ 	/*Retrieve parameters:*/
+@@ -31,9 +33,11 @@
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
++	femmodel->parameters->FindParam(&isexternal,SolidearthIsExternalEnum); 
++	femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
+ 
+-	/*in case we are running SealevelriseSolutionEnum, then bypass transient settings:*/
+-	if(solution_type==SealevelriseSolutionEnum){
++	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
++	if(solution_type==SealevelchangeSolutionEnum){
+ 		isslr=1;
+ 		isgia=1;
+ 	}
+@@ -42,7 +46,7 @@
+ 	if(!isslr)return;
+ 
+ 	/*Verbose: */
+-	if(VerboseSolution()) _printf0_("   computing sea level rise\n");
++	if(VerboseSolution()) _printf0_("   computing sea level change\n");
+ 
+ 	/*Run gia core: */
+ 	if(isgia){
+@@ -54,34 +58,132 @@
+ 	}
+ 
+ 	/*set SLR configuration: */
+-	femmodel->SetCurrentConfiguration(SealevelriseAnalysisEnum);
++	femmodel->SetCurrentConfiguration(SealevelchangeAnalysisEnum);
+ 
+ 	/*run geometry core: */
+-	sealevelrise_core_geometry(femmodel);
++	sealevelchange_geometry(femmodel);
+ 
++	/*any external forcings?:*/
++	if(isexternal)solidearthexternal_core(femmodel);
++
+ 	/*Run geodetic:*/
++	//if(modelid==earthid)  //not sure how we proceed yet on coupling.
+ 	if(grd)grd_core(femmodel);
+ 
+ 	/*Run steric core for sure:*/
+ 	dynstr_core(femmodel);
+ 
++	if(iscoupler){
++		/*transfer sea level back to ice caps:*/
++		TransferSealevel(femmodel,SealevelEnum);
++		TransferSealevel(femmodel,BedEnum);
++
++		//reset cumdeltathickness  to 0: 
++		InputUpdateFromConstantx(femmodel->inputs,femmodel->elements,0.,SealevelchangeCumDeltathicknessEnum);
++	}
++
+ 	/*Save results: */
+ 	if(save_results){
+ 		int     numoutputs;
+ 		char **requested_outputs = NULL;
+ 		if(VerboseSolution()) _printf0_("   saving results\n");
+-		femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SealevelriseRequestedOutputsEnum);
++		femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SealevelchangeRequestedOutputsEnum);
+ 		femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs);
+ 		if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
+ 	}
+ 
+ 	/*requested dependents: */
+-	if(solution_type==SealevelriseSolutionEnum)femmodel->RequestedDependentsx();
++	if(solution_type==SealevelchangeSolutionEnum)femmodel->RequestedDependentsx();
+ 	
+ 	/*End profiler*/
+ 	femmodel->profiler->Stop(SLRCORE);
+ }
+ /*}}}*/
++void solidearthexternal_core(FemModel* femmodel){ /*{{{*/
++
++	/*variables:*/
++	Vector<IssmDouble> *bedrock  = NULL; 
++	Vector<IssmDouble> *bedrock_rate = NULL;
++	Vector<IssmDouble> *bedrockeast  = NULL; 
++	Vector<IssmDouble> *bedrockeast_rate = NULL;
++	Vector<IssmDouble> *bedrocknorth  = NULL; 
++	Vector<IssmDouble> *bedrocknorth_rate = NULL;
++	Vector<IssmDouble> *geoid= NULL; 
++	Vector<IssmDouble> *geoid_rate= NULL; 
++	int horiz=0;
++	int modelid=-1;
++   
++	/*parameters: */
++	bool isslr=0;
++	int  solution_type;
++	IssmDouble          dt;
++
++	/*Retrieve parameters:*/
++	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
++	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++
++	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
++	if(solution_type==SealevelchangeSolutionEnum)isslr=1;
++
++	/*Should we be here?:*/
++	if(!isslr)return;
++
++	/*Verbose: */
++	if(VerboseSolution()) _printf0_("	  computing external solid earth contributions\n");
++
++	/*Retrieve geoid viscous and elastic rates, bedrock uplift viscous and elastic rates + steric rate, as vectors:*/
++	GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
++	GetVectorFromInputsx(&geoid,femmodel,SealevelEnum,VertexSIdEnum); //In ISSM, Sealevel is absolute.
++	if(horiz){
++		GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
++		GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
++	}
++	/*Deal with Mme: */
++	if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
++		/*retrieve model id: */
++		femmodel->parameters->FindParam(&modelid,SolidearthExternalModelidEnum);
++		/*replace dataset of forcings with only one, the modelid'th:*/
++		MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
++		MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
++		MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
++		MmeToInputFromId(femmodel,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
++		MmeToInputFromId(femmodel,modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
++	}
++	
++	GetVectorFromInputsx(&geoid_rate,femmodel,SolidearthExternalGeoidRateEnum,VertexSIdEnum);
++	GetVectorFromInputsx(&bedrock_rate,femmodel,SolidearthExternalDisplacementUpRateEnum,VertexSIdEnum);
++	if(horiz){
++		GetVectorFromInputsx(&bedrockeast_rate,femmodel,SolidearthExternalDisplacementEastRateEnum,VertexSIdEnum);
++		GetVectorFromInputsx(&bedrocknorth_rate,femmodel,SolidearthExternalDisplacementNorthRateEnum,VertexSIdEnum);
++	}
++
++	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate + dynamic_rate dt*/
++	geoid->AXPY(geoid_rate,dt);
++	bedrock->AXPY(bedrock_rate,dt);
++	if(horiz){
++		bedrockeast->AXPY(bedrockeast_rate,dt);
++		bedrocknorth->AXPY(bedrocknorth_rate,dt);
++	}
++
++	/*update element inputs:*/
++	InputUpdateFromVectorx(femmodel,bedrock,BedEnum,VertexSIdEnum);	
++	InputUpdateFromVectorx(femmodel,geoid,SealevelEnum,VertexSIdEnum);	
++	if(horiz){
++		InputUpdateFromVectorx(femmodel,bedrockeast,BedEastEnum,VertexSIdEnum);	
++		InputUpdateFromVectorx(femmodel,bedrocknorth,BedNorthEnum,VertexSIdEnum);	
++	}
++
++	/*Free ressources:*/	
++	delete bedrock; delete bedrock_rate;
++	delete geoid; delete geoid_rate;
++	if(horiz){
++		delete bedrockeast; delete bedrockeast_rate;
++		delete bedrocknorth; delete bedrocknorth_rate;
++	}
++}
++/*}}}*/
+ void grd_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*Gravity rotation deformation core GRD: */
+@@ -88,19 +190,15 @@
+ 
+ 	/*variables:*/
+ 	Vector<IssmDouble> *RSLg    = NULL;
+-	Vector<IssmDouble> *BPg    = NULL;
+-	Vector<IssmDouble> *RSLg_rate    = NULL;
+-	Vector<IssmDouble> *RSLg_eustatic  = NULL; 
+-	Vector<IssmDouble> *U_esa  = NULL; 
+-	Vector<IssmDouble> *U_esa_rate  = NULL; 
+-	Vector<IssmDouble> *N_esa  = NULL; 
+-	Vector<IssmDouble> *N_esa_rate  = NULL; 
+-	Vector<IssmDouble> *U_north_esa   = NULL; 
+-	Vector<IssmDouble> *U_east_esa    = NULL; 
+-	Vector<IssmDouble> *N_gia= NULL; 
+-	Vector<IssmDouble> *U_gia= NULL; 
+-	Vector<IssmDouble> *N_gia_rate= NULL; 
+-	Vector<IssmDouble> *U_gia_rate= NULL; 
++	Vector<IssmDouble> *RSLg_barystatic  = NULL; 
++	Vector<IssmDouble> *U_grd  = NULL; 
++	Vector<IssmDouble> *N_grd  = NULL; 
++	Vector<IssmDouble> *U_north_grd   = NULL; 
++	Vector<IssmDouble> *U_east_grd    = NULL; 
++	Vector<IssmDouble> *bedrock  = NULL; 
++	Vector<IssmDouble> *bedrockeast  = NULL; 
++	Vector<IssmDouble> *bedrocknorth  = NULL; 
++	Vector<IssmDouble> *geoid= NULL; 
+ 	SealevelMasks* masks=NULL;
+ 
+ 	/*parameters:*/
+@@ -112,9 +210,8 @@
+ 	int  horiz;
+ 	IssmDouble dt;
+ 	IssmDouble oceanarea;
+-	int        bp_compute_fingerprints=0;
++	int bp_compute_fingerprints=0;
+ 
+-	
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing GRD sea level patterns\n");
+ 
+@@ -121,7 +218,7 @@
+ 	/*retrieve more parameters:*/
+ 	femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+-	femmodel->parameters->FindParam(&count,SealevelriseRunCountEnum);
++	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -135,7 +232,7 @@
+ 		/* we are here, we are not running in a coupler, so we will indeed compute SLR,
+ 		 * so make sure we are identified as being the Earth.:*/
+ 		modelid=1; earthid=1; 
+-		/* in addition, if we are running solution_type SealevelriseSolutionEnum, make sure we 
++		/* in addition, if we are running solution_type SealevelchangeSolutionEnum, make sure we 
+ 		 * run, irresepective of the time settings:*/
+ 		count=frequency;
+ 	}
+@@ -147,17 +244,17 @@
+ 
+ 	/*increment counter, or call solution core if count==frequency:*/
+ 	if (count<frequency){
+-		count++; femmodel->parameters->SetParam(count,SealevelriseRunCountEnum); 
++		count++; femmodel->parameters->SetParam(count,SealevelchangeRunCountEnum); 
+ 		return;
+ 	}
+ 
+-	/*call sea-level rise sub cores:*/
++	/*call sea-level change sub cores:*/
+ 	if(iscoupler){
+ 		/*transfer cumulated deltathickness forcing from ice caps to earth model: */
+-		TransferForcing(femmodel,SealevelriseCumDeltathicknessEnum);
++		TransferForcing(femmodel,SealevelchangeCumDeltathicknessEnum);
+ 
+ 		/*we have accumulated thicknesses, dump them in deltathcikness: */
+-		if(modelid==earthid)InputDuplicatex(femmodel,SealevelriseCumDeltathicknessEnum,SurfaceloadIceThicknessChangeEnum);
++		if(modelid==earthid)InputDuplicatex(femmodel,SealevelchangeCumDeltathicknessEnum,SurfaceloadIceThicknessChangeEnum);
+ 	}
+ 
+ 	/*run cores:*/
+@@ -164,89 +261,63 @@
+ 	if(modelid==earthid){
+ 
+ 		/*call masks core: */
+-		masks=sealevelrise_core_masks(femmodel);
++		masks=sealevel_masks(femmodel);
+ 
+ 		/*set bottom pressures:*/
+ 		SetBottomPressure(femmodel);
+ 
++		/*call barystatic core  (generalized eustatic - Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS) */
++		RSLg_barystatic=sealevelchange_core_barystatic(femmodel,masks,&oceanarea); 
+ 
+-		/*call eustatic core  (generalized eustatic - Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS) */
+-		RSLg_eustatic=sealevelrise_core_eustatic(femmodel,masks,&oceanarea); 
++		/*call self attraction and loading module (ocean loading tems  - 2nd and 5th terms on the RHS of Farrel and Clark) */
++		RSLg=sealevelchange_core_sal(femmodel,masks,RSLg_barystatic,oceanarea); 
+ 
+-		/*call non-eustatic core (ocean loading tems  - 2nd and 5th terms on the RHS of Farrel and Clark) */
+-		RSLg=sealevelrise_core_noneustatic(femmodel,masks,RSLg_eustatic,oceanarea); 
++		/*compute bedrock motion and derive geoid: */
++		sealevelchange_core_deformation(&N_grd,&U_grd,&U_north_grd,&U_east_grd,femmodel,RSLg,masks);
+ 
+-		/*compute other elastic signatures, such as components of 3-D crustal motion: */
+-		sealevelrise_core_elastic(&U_esa,&U_north_esa,&U_east_esa,femmodel,RSLg,masks);
++		/*Update bedrock motion and geoid:*/
++		GetVectorFromInputsx(&geoid,femmodel,SealevelEnum,VertexSIdEnum);
++		GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
++		if(horiz){
++			GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
++			GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
++		}
++		
++		geoid->AXPY(N_grd,1);
++		bedrock->AXPY(U_grd,1);
++		if(horiz){
++			bedrockeast->AXPY(U_east_grd,1);
++			bedrocknorth->AXPY(U_north_grd,1);
++		}
+ 
+-		/*compute viscosus (GIA) signatures:*/
+-		sealevelrise_core_viscous(&U_gia,&N_gia,femmodel,RSLg);
+-
+-		/*compute sea-level rise (low-order spherical harmonics coefficients) diagnostics:*/
+-		sealevelrise_diagnostics(femmodel,RSLg);
+-
+-		/*recover N_esa  = U_esa + RSLg:*/
+-		N_esa=U_esa->Duplicate(); U_esa->Copy(N_esa); N_esa->AXPY(RSLg,1);
+-
+-		/*transform these values into rates (as we only run this once each frequency turn:*/
+-		N_esa_rate=N_esa->Duplicate(); N_esa->Copy(N_esa_rate); N_esa_rate->Scale(1/(dt*frequency));
+-		U_esa_rate=U_esa->Duplicate(); U_esa->Copy(U_esa_rate); U_esa_rate->Scale(1/(dt*frequency));
+-		N_gia_rate=N_gia->Duplicate(); N_gia->Copy(N_gia_rate); N_gia_rate->Scale(1/(dt*frequency));
+-		U_gia_rate=U_gia->Duplicate(); U_gia->Copy(U_gia_rate); U_gia_rate->Scale(1/(dt*frequency));
+-		RSLg_rate=RSLg->Duplicate(); RSLg->Copy(RSLg_rate); RSLg_rate->Scale(1/(dt*frequency));
+-
+-		/*get some results into elements:{{{*/
+-		InputUpdateFromVectorx(femmodel,U_esa_rate,SealevelUEsaRateEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,N_esa_rate,SealevelNEsaRateEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,U_gia_rate,UGiaRateEnum,VertexSIdEnum);
+-		InputUpdateFromVectorx(femmodel,N_gia_rate,NGiaRateEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,RSLg_rate,SealevelRSLRateEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,U_esa,SealevelUEsaEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,N_esa,SealevelNEsaEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,U_gia,UGiaEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,N_gia,NGiaEnum,VertexSIdEnum); 
++		/*get some of the updates into elements:*/
++		InputUpdateFromVectorx(femmodel,U_grd,SealevelUEsaEnum,VertexSIdEnum); 
++		InputUpdateFromVectorx(femmodel,N_grd,SealevelNEsaEnum,VertexSIdEnum); 
+ 		InputUpdateFromVectorx(femmodel,RSLg,SealevelRSLEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,RSLg_eustatic,SealevelRSLEustaticEnum,VertexSIdEnum); 
+-
++		InputUpdateFromVectorx(femmodel,RSLg_barystatic,SealevelRSLBarystaticEnum,VertexSIdEnum); 
+ 		if (horiz){
+-			InputUpdateFromVectorx(femmodel,U_north_esa,SealevelUNorthEsaEnum,VertexSIdEnum);	// north motion 
+-			InputUpdateFromVectorx(femmodel,U_east_esa,SealevelUEastEsaEnum,VertexSIdEnum);		// east motion 
+-		} /*}}}*/
++			InputUpdateFromVectorx(femmodel,U_north_grd,SealevelUNorthEsaEnum,VertexSIdEnum);	
++			InputUpdateFromVectorx(femmodel,U_east_grd,SealevelUEastEsaEnum,VertexSIdEnum);	
++		} 
+ 	}
+ 
+-	if(iscoupler){
+-		/*transfer sea level back to ice caps:*/
+-		TransferSealevel(femmodel,SealevelNEsaRateEnum);
+-		TransferSealevel(femmodel,NGiaRateEnum);
+-		TransferSealevel(femmodel,SealevelUEsaRateEnum);
+-		TransferSealevel(femmodel,UGiaRateEnum);
+-
+-		//reset cumdeltathickness  to 0: 
+-		InputUpdateFromConstantx(femmodel->inputs,femmodel->elements,0.,SealevelriseCumDeltathicknessEnum);
+-	}
+-
+ 	/*reset counter to 1:*/
+-	femmodel->parameters->SetParam(1,SealevelriseRunCountEnum); //reset counter.
++	femmodel->parameters->SetParam(1,SealevelchangeRunCountEnum); //reset counter.
+ 
+ 	/*free ressources:{{{*/
+ 	delete RSLg;
+-	delete RSLg_rate;
+-	delete RSLg_eustatic;
+-	delete U_esa;
+-	delete U_esa_rate;
+-	delete N_esa;
+-	delete N_esa_rate;
+-	delete BPg;
+-
++	delete RSLg_barystatic;
++	delete U_grd;
++	delete N_grd;
++	delete bedrock; 
++	delete geoid; 
+ 	if(horiz){
+-		delete U_north_esa;
+-		delete U_east_esa;
++		delete U_north_grd;
++		delete U_east_grd;
++		delete bedrockeast; 
++		delete bedrocknorth; 
+ 	}
+-	delete N_gia;
+-	delete U_gia;
+-	delete N_gia_rate;
+-	delete U_gia_rate;
+-	//delete masks;
++	delete masks;
+ 	/*}}}*/
+ 
+ } 
+@@ -254,22 +325,17 @@
+ void dynstr_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*variables:*/
+-	Vector<IssmDouble> *bedrock  = NULL; 
+-	Vector<IssmDouble> *SL  = NULL; 
++	Vector<IssmDouble> *sealevel  = NULL; 
+ 	Vector<IssmDouble> *steric_rate_g  = NULL; 
+ 	Vector<IssmDouble> *dynamic_rate_g = NULL;
+-	Vector<IssmDouble> *U_esa_rate= NULL;
+-	Vector<IssmDouble> *N_esa_rate= NULL;
+-	Vector<IssmDouble> *U_gia_rate= NULL;
+-	Vector<IssmDouble> *N_gia_rate= NULL;
+ 
+ 	/*parameters: */
+ 	bool isslr=0;
+ 	int  solution_type;
+ 	IssmDouble          dt;
+-	int  grd=0;
+ 	int  step;
+ 	IssmDouble time;
++
+ 	IssmDouble cumgmtslr=0;
+ 	IssmDouble cumbslr=0;
+ 	IssmDouble cumgmslr=0;
+@@ -276,78 +342,59 @@
+ 	IssmDouble gmtslr=0;
+ 
+ 	/*Retrieve parameters:*/
++	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
+-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+-	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum);
+-	femmodel->parameters->FindParam(&cumgmtslr,CumGmtslrEnum); 
+-	femmodel->parameters->FindParam(&cumbslr,CumBslrEnum); 
+-	femmodel->parameters->FindParam(&step,StepEnum);
+-	femmodel->parameters->FindParam(&time,TimeEnum);
++	
++	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
++	if(solution_type==SealevelchangeSolutionEnum)isslr=1;
+ 
+-	/*in case we are running SealevelriseSolutionEnum, then bypass transient settings:*/
+-	if(solution_type==SealevelriseSolutionEnum)isslr=1;
+-
+ 	/*Should we be here?:*/
+ 	if(!isslr)return;
+ 
+ 	/*Verbose: */
+-	if(VerboseSolution()) _printf0_("	  computing steric sea level rise\n");
++	if(VerboseSolution()) _printf0_("	  computing steric sea level change\n");
+ 
+-	/*Retrieve geoid viscous and elastic rates, bedrock uplift viscous and elastic rates + steric rate, as vectors:*/
+-	GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
+-	GetVectorFromInputsx(&SL,femmodel,SealevelEnum,VertexSIdEnum);
++	/*Retrieve sealevel and add steric + dynamic rates:*/
++	GetVectorFromInputsx(&sealevel,femmodel,SealevelEnum,VertexSIdEnum);
+ 	GetStericRate(&steric_rate_g,femmodel);
+ 	GetDynamicRate(&dynamic_rate_g,femmodel);
+-	if(grd){
+-		GetVectorFromInputsx(&U_esa_rate,femmodel,SealevelUEsaRateEnum,VertexSIdEnum);
+-		GetVectorFromInputsx(&U_gia_rate,femmodel,UGiaRateEnum,VertexSIdEnum);
+-		GetVectorFromInputsx(&N_esa_rate,femmodel,SealevelNEsaRateEnum,VertexSIdEnum);
+-		GetVectorFromInputsx(&N_gia_rate,femmodel,NGiaRateEnum,VertexSIdEnum);
+-	}
+ 
+-	/*Save steric rate, and cumulate it through time, cumulate with barystatic sea level rise, and cumulate through time:*/
++	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate + dynamic_rate dt*/
++	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	sealevel->AXPY(steric_rate_g,dt);
++	sealevel->AXPY(dynamic_rate_g,dt);
++
++	/*cumulate thermal steric rate:*/
++	femmodel->parameters->FindParam(&cumgmtslr,CumGmtslrEnum); 
++	femmodel->parameters->FindParam(&cumbslr,CumBslrEnum); 
++
+ 	gmtslr=steric_rate_g->Max()*dt;
+ 	cumgmtslr+=gmtslr;
+ 	cumgmslr=cumbslr+cumgmtslr;
++
++	femmodel->parameters->SetParam(cumgmtslr,CumGmtslrEnum);
++	femmodel->parameters->SetParam(cumgmslr,CumGmslrEnum);
++	
++	/*Outputs some metrics:*/
++	femmodel->parameters->FindParam(&step,StepEnum);
++	femmodel->parameters->FindParam(&time,TimeEnum);
++
+ 	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,GmtslrEnum,gmtslr,step,time));
+ 	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmtslrEnum,cumgmtslr,step,time));
+ 	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmslrEnum,cumgmslr,step,time));
+-	femmodel->parameters->SetParam(cumgmtslr,CumGmtslrEnum);
+ 
+-	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate + dynamic_rate dt*/
+-	if(grd){
+-		SL->AXPY(N_gia_rate,dt);
+-		SL->AXPY(N_esa_rate,dt);
+-	}
+-	SL->AXPY(steric_rate_g,dt);
+-	SL->AXPY(dynamic_rate_g,dt);
+-
+-	/*compute new bedrock position: */
+-	if(grd){
+-		bedrock->AXPY(U_esa_rate,dt);
+-		bedrock->AXPY(U_gia_rate,dt);
+-	}
+-
+ 	/*update element inputs:*/
+-	InputUpdateFromVectorx(femmodel,bedrock,BedEnum,VertexSIdEnum);	
+-	InputUpdateFromVectorx(femmodel,SL,SealevelEnum,VertexSIdEnum);	
++	InputUpdateFromVectorx(femmodel,sealevel,SealevelEnum,VertexSIdEnum);	
+ 
+ 	/*Free ressources:*/	
+-	delete bedrock;
+-	delete SL;
++	delete sealevel;
+ 	delete steric_rate_g;
+ 	delete dynamic_rate_g;
+-	if(grd){
+-		delete U_esa_rate;
+-		delete U_gia_rate;
+-		delete N_esa_rate;
+-		delete N_gia_rate;
+-	}
+ }
+ /*}}}*/
+ 
+-SealevelMasks* sealevelrise_core_masks(FemModel* femmodel) {  /*{{{*/
++//Geometry:
++SealevelMasks* sealevel_masks(FemModel* femmodel) {  /*{{{*/
+ 
+ 	if(VerboseSolution()) _printf0_("	  computing sea level masks\n");
+ 	
+@@ -362,7 +409,7 @@
+ 
+ 	return masks;
+ }/*}}}*/
+-void sealevelrise_core_geometry(FemModel* femmodel) {  /*{{{*/
++void sealevelchange_geometry(FemModel* femmodel) {  /*{{{*/
+ 
+ 	/*Geometry core where we compute indices into tables pre computed in the SealevelRiseAnalysis: */
+ 
+@@ -380,7 +427,7 @@
+ 		
+ 	/*retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-	femmodel->parameters->FindParam(&geometrydone,SealevelriseGeometryDoneEnum);
++	femmodel->parameters->FindParam(&geometrydone,SealevelchangeGeometryDoneEnum);
+ 
+ 	if(geometrydone){
+ 		if(VerboseSolution()) _printf0_("	  geometrical offsets have already been computed, skipping \n");
+@@ -395,10 +442,10 @@
+ 	if(horiz) VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
+ 
+ 
+-	/*Run sealevelrise geometry routine in elements:*/
++	/*Run sealevel geometry routine in elements:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		element->SealevelriseGeometry(latitude,longitude,radius,xx,yy,zz);
++		element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz);
+ 	}
+ 
+ 	/*Free ressources:*/
+@@ -412,14 +459,16 @@
+ 	xDelete<IssmDouble>(radius);
+ 
+ 	/*Record the fact that we ran this module already: */
+-	femmodel->parameters->SetParam(true,SealevelriseGeometryDoneEnum); 
++	femmodel->parameters->SetParam(true,SealevelchangeGeometryDoneEnum); 
+ 
+ 
+ }/*}}}*/
+-Vector<IssmDouble>* sealevelrise_core_eustatic(FemModel* femmodel,SealevelMasks* masks, IssmDouble* poceanarea){ /*{{{*/
+ 
+-	/*Eustatic core of the SLR solution (terms that are constant with respect to sea-level)*/
++//GRD: 
++Vector<IssmDouble>* sealevelchange_core_barystatic(FemModel* femmodel,SealevelMasks* masks, IssmDouble* poceanarea){ /*{{{*/
+ 
++	/*Barystatic core of the SLR solution (terms that are constant with respect to sea-level)*/
++
+ 	Vector<IssmDouble> *RSLgi    = NULL;
+ 	IssmDouble          RSLgi_oceanaverage   = 0;
+ 
+@@ -463,10 +512,10 @@
+ 	RSLgi = new Vector<IssmDouble>(gsize);
+ 
+ 	/*call the bslr main module: */
+-	femmodel->SealevelriseEustatic(RSLgi,&oceanarea,&bslr, &bslrice, &bslrhydro, &bslrice_partition, &bslrhydro_partition,masks); //this computes 
++	femmodel->SealevelchangeBarystatic(RSLgi,&oceanarea,&bslr, &bslrice, &bslrhydro, &bslrice_partition, &bslrhydro_partition,masks); //this computes 
+ 
+ 	/*we need to average RSLgi over the ocean: RHS term  4 in Eq.4 of Farrel and clarke. Only the elements can do that: */
+-	RSLgi_oceanaverage=femmodel->SealevelriseOceanAverage(RSLgi,masks, oceanarea);
++	RSLgi_oceanaverage=femmodel->SealevelchangeOceanAverage(RSLgi,masks, oceanarea);
+ 
+ 	/*RSLg is the sum of the pure bslr component (term 3) and the contribution from the perturbation to the graviation potential due to the 
+ 	 * presence of ice (terms 1 and 4 in Eq.4 of Farrel and Clarke):*/
+@@ -508,10 +557,10 @@
+ 	*poceanarea=oceanarea;
+ 	return RSLgi;
+ }/*}}}*/
+-Vector<IssmDouble>* sealevelrise_core_noneustatic(FemModel* femmodel, SealevelMasks* masks, Vector<IssmDouble>* RSLg_eustatic,IssmDouble oceanarea){ /*{{{*/
++Vector<IssmDouble>* sealevelchange_core_sal(FemModel* femmodel, SealevelMasks* masks, Vector<IssmDouble>* RSLg_barystatic,IssmDouble oceanarea){ /*{{{*/
+ 
+-	/*sealevelrise_core_noneustatic.cpp //this computes the contributions from Eq.4 of Farrel and Clarke, rhs terms 2 and 5.
+-	  non eustatic core of the SLR solution */
++	/*this core computes the contributions from Eq.4 of Farrel and Clarke, rhs terms 2 and 5.
++	  sal core of the SLR solution */
+ 
+ 	Vector<IssmDouble> *RSLg    = NULL;
+ 	Vector<IssmDouble> *RSLg_old    = NULL;
+@@ -548,7 +597,7 @@
+ 	/*Initialize:*/
+ 	RSLg = new Vector<IssmDouble>(gsize);
+ 	RSLg->Assemble();
+-	RSLg_eustatic->Copy(RSLg);  //first initialize RSLg with the eustatic component computed in sealevelrise_core_eustatic.
++	RSLg_barystatic->Copy(RSLg);  //first initialize RSLg with the barystatic component computed in sealevelchange_core_barystatic.
+ 
+ 	RSLg_old = new Vector<IssmDouble>(gsize);
+ 	RSLg_old->Assemble();
+@@ -559,7 +608,7 @@
+ 	/*Start loop: */
+ 	for(;;){
+ 
+-		//save pointer to old sea level rise
++		//save pointer to old sea level
+ 		delete RSLg_old; RSLg_old=RSLg; 
+ 
+ 		/*Initialize solution vector: */
+@@ -566,8 +615,8 @@
+ 		RSLg  = new Vector<IssmDouble>(gsize); RSLg->Assemble();
+ 		RSLgo = new Vector<IssmDouble>(gsize); RSLgo->Assemble();
+ 
+-		/*call the non eustatic module: */
+-		femmodel->SealevelriseNonEustatic(RSLgo, RSLg_old,  masks, verboseconvolution);
++		/*call the sal module: */
++		femmodel->SealevelchangeSal(RSLgo, RSLg_old,  masks, verboseconvolution);
+ 
+ 		/*assemble solution vector: */
+ 		RSLgo->Assemble(); 
+@@ -576,7 +625,7 @@
+ 
+ 			/*call rotational feedback  module: */
+ 			RSLgo_rot = new Vector<IssmDouble>(gsize); RSLgo_rot->Assemble();
+-			femmodel->SealevelriseRotationalFeedback(RSLgo_rot,RSLg_old,&Ixz,&Iyz,&Izz, masks); 
++			femmodel->SealevelchangeRotationalFeedback(RSLgo_rot,RSLg_old,&Ixz,&Iyz,&Izz, masks); 
+ 			RSLgo_rot->Assemble(); 
+ 
+ 			/*save changes in inertia tensor as results: */
+@@ -588,10 +637,10 @@
+ 		}
+ 
+ 		/*we need to average RSLgo over the ocean: RHS term  5 in Eq.4 of Farrel and clarke. Only the elements can do that: */
+-		RSLgo_oceanaverage=femmodel->SealevelriseOceanAverage(RSLgo,masks, oceanarea);
++		RSLgo_oceanaverage=femmodel->SealevelchangeOceanAverage(RSLgo,masks, oceanarea);
+ 
+-		/*RSLg is the sum of the eustatic term, and the ocean terms: */
+-		RSLg_eustatic->Copy(RSLg); RSLg->AXPY(RSLgo,1); 
++		/*RSLg is the sum of the barystatic term, and the ocean terms: */
++		RSLg_barystatic->Copy(RSLg); RSLg->AXPY(RSLgo,1); 
+ 		RSLg->Shift(-RSLgo_oceanaverage);
+ 
+ 		/*convergence criterion:*/
+@@ -624,11 +673,12 @@
+ 
+ 	return RSLg;
+ } /*}}}*/
+-void sealevelrise_core_elastic(Vector<IssmDouble>** pU_esa, Vector<IssmDouble>** pU_north_esa,Vector<IssmDouble>** pU_east_esa,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks){ /*{{{*/
++void sealevelchange_core_deformation(Vector<IssmDouble>** pN_grd, Vector<IssmDouble>** pU_grd, Vector<IssmDouble>** pU_north_grd,Vector<IssmDouble>** pU_east_grd,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks){ /*{{{*/
+ 
+-	Vector<IssmDouble> *U_esa  = NULL; 
+-	Vector<IssmDouble> *U_north_esa   = NULL; 
+-	Vector<IssmDouble> *U_east_esa    = NULL; 
++	Vector<IssmDouble> *U_grd  = NULL; 
++	Vector<IssmDouble> *N_grd  = NULL; 
++	Vector<IssmDouble> *U_north_grd   = NULL; 
++	Vector<IssmDouble> *U_east_grd    = NULL; 
+ 
+ 	/*parameters: */
+ 	int  gsize;
+@@ -651,24 +701,26 @@
+ 	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
+ 
+ 	/*intialize vectors:*/
+-	U_esa = new Vector<IssmDouble>(gsize);
++	U_grd = new Vector<IssmDouble>(gsize);
++	N_grd = new Vector<IssmDouble>(gsize);
+ 	if (horiz){
+-		U_north_esa = new Vector<IssmDouble>(gsize);
+-		U_east_esa = new Vector<IssmDouble>(gsize);
++		U_north_grd = new Vector<IssmDouble>(gsize);
++		U_east_grd = new Vector<IssmDouble>(gsize);
+ 	}
+-
++	
+ 	/*retrieve geometric information: */
+ 	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
+ 	VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
+ 
+ 	/*call the elastic main modlule:*/ 
+-	femmodel->SealevelriseElastic(U_esa,U_north_esa,U_east_esa,RSLg, masks);
++	femmodel->SealevelchangeDeformation(N_grd, U_grd,U_north_grd,U_east_grd,RSLg, masks);
+ 
+ 	/*Assign output pointers:*/
+-	*pU_esa=U_esa;
++	*pU_grd=U_grd;
++	*pN_grd=N_grd;
+ 	if(horiz){
+-		*pU_east_esa=U_east_esa;
+-		*pU_north_esa=U_north_esa;
++		*pU_east_grd=U_east_grd;
++		*pU_north_grd=U_north_grd;
+ 	}
+ 
+ 	/*Free ressources: */
+@@ -680,42 +732,8 @@
+ 	xDelete<IssmDouble>(radius);
+ }
+ /*}}}*/
+-void sealevelrise_core_viscous(Vector<IssmDouble>** pU_gia, Vector<IssmDouble>** pN_gia,FemModel* femmodel,Vector<IssmDouble>* RSLg){ /*{{{*/
+ 
+-	/*variables:*/
+-	Vector<IssmDouble> *U_gia  = NULL; 
+-	Vector<IssmDouble> *N_gia  = NULL; 
+-
+-	/*parameters:*/
+-	int					frequency;
+-	IssmDouble          dt;
+-	
+-	if(VerboseSolution()) _printf0_("	  computing viscous components\n");
+-
+-	/*retrieve some parameters:*/
+-	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-
+-	/*recover GIA rates:*/
+-	GetVectorFromInputsx(&U_gia,femmodel,UGiaRateEnum,VertexSIdEnum);
+-	GetVectorFromInputsx(&N_gia,femmodel,NGiaRateEnum,VertexSIdEnum);
+-
+-	/*we just loaded rates, that's not what's being asked, scale by time:*/ 
+-	U_gia->Scale(frequency*dt);
+-	N_gia->Scale(frequency*dt);
+-
+-	/*Assign output pointers:*/
+-	*pU_gia=U_gia;
+-	*pN_gia=N_gia;
+-
+-}
+-/*}}}*/
+-void sealevelrise_diagnostics(FemModel* femmodel,Vector<IssmDouble>* RSLg){ /*{{{*/
+-
+-	/*compute spherical harmonics deg 1 and deg 2 coefficeints:*/
+-
+-}
+-/*}}}*/
++//Ocean:
+ void GetDynamicRate(Vector<IssmDouble> ** pdynamic_rate_g, FemModel* femmodel){ /*{{{*/
+ 
+ 	int dslmodel=-1;
+@@ -836,7 +854,7 @@
+ }
+ /*}}}*/
+ 
+-/*support routines:*/
++/*Support routines:*/
+ void TransferForcing(FemModel* femmodel,int forcingenum){ /*{{{*/
+ 
+ 	/*forcing being transferred from models to earth: */
+@@ -912,7 +930,7 @@
+ 		GetVectorFromInputsx(&forcingglobal,femmodel,forcingenum,VertexSIdEnum);
+ 
+ 		/*Retrieve transition vectors, used to plug from each ice cap into the global forcing:*/
+-		femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelriseTransitionsEnum);
++		femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelchangeTransitionsEnum);
+ 
+ 		if(ntransitions!=earthid)_error_("TransferForcing error message: number of transition vectors is not equal to the number of icecaps!");
+ 
+@@ -1018,7 +1036,7 @@
+ 		if(modelid==earthid){
+ 
+ 			/*Retrieve transition vectors, used to figure out global forcing contribution to each ice cap's own elements: */
+-			femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelriseTransitionsEnum);
++			femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelchangeTransitionsEnum);
+ 
+ 			if(ntransitions!=earthid)_error_("TransferSeaLevel error message: number of transition vectors is not equal to the number of icecaps!");
+ 
+@@ -1086,7 +1104,7 @@
+ 
+ 	/*This mass transport module for the Earth is because we might have thickness variations as spcs 
+ 	 * specified in the md.slr class, outside of what we will get from the icecaps. That's why we get t
+-	 * the thickness variations from SealevelriseSpcthicknessEnum.*/
++	 * the thickness variations from SealevelchangeSpcthicknessEnum.*/
+ 
+ 	/*No mass transport module was called, so we are just going to retrieve the geometry thickness 
+ 	 * at this time step, at prior time step, and plug the difference as deltathickness: */
+@@ -1094,8 +1112,8 @@
+ 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	nv=femmodel->vertices->NumberOfVertices();
+ 
+-	GetVectorFromInputsx(&newthickness,femmodel,SealevelriseSpcthicknessEnum,VertexSIdEnum);
+-	GetVectorFromInputsx(&oldthickness,femmodel,SealevelriseSpcthicknessEnum,VertexSIdEnum,time-dt);*/
++	GetVectorFromInputsx(&newthickness,femmodel,SealevelchangeSpcthicknessEnum,VertexSIdEnum);
++	GetVectorFromInputsx(&oldthickness,femmodel,SealevelchangeSpcthicknessEnum,VertexSIdEnum,time-dt);*/
+ 
+ 	/*compute deltathickness: */
+ 	/*deltathickness = new Vector<IssmDouble>(nv); 
+@@ -1105,9 +1123,9 @@
+ //	InputUpdateFromVectorx(femmodel,deltathickness,SurfaceloadIceThicknessChangeEnum,VertexSIdEnum);
+ 
+ 	/*add to cumulated delta thickness: */
+-	/*GetVectorFromInputsx(&cumdeltathickness,femmodel,SealevelriseCumDeltathicknessEnum,VertexSIdEnum);
++	/*GetVectorFromInputsx(&cumdeltathickness,femmodel,SealevelchangeCumDeltathicknessEnum,VertexSIdEnum);
+ 	cumdeltathickness->AXPY(deltathickness,1); 
+-	InputUpdateFromVectorx(femmodel,cumdeltathickness,SealevelriseCumDeltathicknessEnum,VertexSIdEnum);*/
++	InputUpdateFromVectorx(femmodel,cumdeltathickness,SealevelchangeCumDeltathicknessEnum,VertexSIdEnum);*/
+ 
+ 	/*free ressources:*/
+ 	/*delete oldthickness;
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 25947)
+@@ -61,7 +61,7 @@
+ 	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
+ 	#endif
+ 
+-	if(isslr) sealevelrise_core_geometry(femmodel);
++	if(isslr) sealevelchange_geometry(femmodel);
+ 
+ 	while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
+ 
+@@ -234,9 +234,9 @@
+ 	/*esa: */
+ 	if(isesa) esa_core(femmodel);
+ 
+-	/*Sea level rise: */
++	/*Sea level change: */
+ 	if(isslr){
+-		if(VerboseSolution()) _printf0_("   computing sea level rise\n");
++		if(VerboseSolution()) _printf0_("   computing sea level change\n");
+ 		sealevelchange_core(femmodel);
+ 	}
+ 
+@@ -274,7 +274,7 @@
+ 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
+ 	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
+ 	femmodel->parameters->FindParam(&checkpoint_frequency,SettingsCheckpointFrequencyEnum); _assert_(checkpoint_frequency>0);
+-	if(isslr) sealevelrise_core_geometry(femmodel);
++	if(isslr) sealevelchange_geometry(femmodel);
+ 
+ 	std::vector<IssmDouble> time_all;
+ 	std::vector<IssmDouble> dt_all;
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 25947)
+@@ -159,7 +159,7 @@
+ void  InputUpdateSpecialtyCode(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,char* root){ //{{{
+ 
+ 	/*Here, we put all the code that cannot be handled any other place: */
+-	if (strncmp(root,"SurfaceloadModelid",18)==0){
++	if (strncmp(root,"SurfaceloadModelid",18)==0){ //surface load in solid earth class {{{
+ 
+ 		if(VerboseQmu()){
+ 			_printf0_("      SurfaceloadModelid MME, with ids: ");
+@@ -177,7 +177,31 @@
+ 		if (femmodel->inputs->GetInputObjectEnum(MaskOceanLevelsetEnum)==DatasetInputEnum)
+ 			MmeToInput(femmodel,distributed_values,variable_partition,npart,MaskOceanLevelsetEnum, P1Enum);
+ 
+-	}
++	} /*}}}*/
++	if (strncmp(root,"SolidearthExternalModelid",18)==0){ //external solid earth solution in solid earth class {{{
++
++		if(VerboseQmu()){
++			_printf0_("      SolidearthExternalModelid MME, with ids: ");
++			for (int i=0;i<npart;i++)_printf0_((int)distributed_values[i] << " ");
++			_printf0_("\n");
++		}
++
++		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum)
++			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalDisplacementEastRateEnum, P1Enum);
++
++		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementUpRateEnum)==DatasetInputEnum)
++			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalDisplacementUpRateEnum, P1Enum);
++
++		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementNorthRateEnum)==DatasetInputEnum)
++			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
++
++		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalGeoidRateEnum)==DatasetInputEnum)
++			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalGeoidRateEnum, P1Enum);
++
++		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalBarystaticSeaLevelRateEnum)==DatasetInputEnum)
++			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
++	} /*}}}*/
++
+ 	else _error_("InputUpdateSpecialtyCode error message: " << root << " not supported yet!");
+ 
+ }	//}}}
+@@ -240,6 +264,61 @@
+ 	//reconfigure:
+ 	transientinput2->Configure(femmodel->parameters);
+ }	//}}}
++void  MmeToInputFromId(FemModel* femmodel,int id, int rootenum, int interpolationenum){ /*{{{*/
++
++	TransientInput* transientinput  = NULL;
++	TransientInput* transientinput2 = NULL;
++	Tria* element                    = NULL;
++	IssmDouble value;
++	IssmDouble* values               = NULL;
++	IssmDouble* times                = NULL;
++	int N;
++
++	/*find thickness dataset: */
++	DatasetInput* datasetinput = femmodel->inputs->GetDatasetInput(rootenum);
++
++	/*Initialize new transient input: */
++	transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);
++	transientinput->GetAllTimes(&times,&N);
++	femmodel->inputs->SetTransientInput(DummyEnum,times,N);
++	transientinput2 = femmodel->inputs->GetTransientInput(DummyEnum);
++
++	for(Object* & object : femmodel->elements->objects){
++		Tria*   element=xDynamicCast<Tria*>(object);
++
++		/*recover the right field from the mme: */
++		transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);
++
++		/*copy values from the transientinput to the final transientinput2: */
++		for (int j=0;j<N;j++){
++			TriaInput* tria_input=transientinput->GetTriaInput(j);
++			element->InputServe(tria_input);
++			if(interpolationenum==P0Enum){
++				value=tria_input->element_values[0];
++				transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);
++			}
++			else if(interpolationenum==P1Enum){
++
++				/*Get values and lid list*/
++				const int   numvertices     = element->GetNumberOfVertices();
++				int        *vertexlids      = xNew<int>(numvertices);
++				int        *vertexsids      = xNew<int>(numvertices);
++
++				/*Recover vertices ids needed to initialize inputs*/
++				element->GetVerticesLidList(&vertexlids[0]);
++				element->GetVerticesSidList(&vertexsids[0]);
++				values=tria_input->element_values;
++				transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);
++			}
++		}
++	}
++
++	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
++	femmodel->inputs->ChangeEnum(DummyEnum,rootenum);
++
++	//reconfigure:
++	transientinput2->Configure(femmodel->parameters);
++}	//}}}
+ void  InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name){ /*{{{*/
+ 
+ 	/*Copy input:*/
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 25946)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 25947)
+@@ -10,6 +10,7 @@
+ void  InputUpdateFromDakotax(FemModel* femmodel,double* variables,char* *variables_descriptors,int numvariables);
+ void  InputUpdateSpecialtyCode(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,char* root);
+ void  MmeToInput(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,int rootenum, int interpolationenum);
++void  MmeToInputFromId(FemModel* femmodel,int id, int rootenum, int interpolationenum);
+ void InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name);
+ 
+ 
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 25947)
+@@ -62,7 +62,7 @@
+ 	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));
++	parameters->AddObject(new IntParam(SealevelchangeRunCountEnum,1));
+ 
+ 	  {/*This is specific to ice...*/
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.mesh.elementtype",MeshElementtypeEnum));
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25946)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25947)
+@@ -137,6 +137,10 @@
+ syn keyword cConstant DslModelEnum
+ syn keyword cConstant DslModelidEnum
+ syn keyword cConstant DslNummodelsEnum
++syn keyword cConstant SolidearthIsExternalEnum
++syn keyword cConstant SolidearthExternalNatureEnum
++syn keyword cConstant SolidearthExternalModelidEnum
++syn keyword cConstant SolidearthExternalNummodelsEnum
+ syn keyword cConstant DslComputeFingerprintsEnum
+ syn keyword cConstant EarthIdEnum
+ syn keyword cConstant EplZigZagCounterEnum
+@@ -337,7 +341,7 @@
+ syn keyword cConstant SolidearthSettingsAbstolEnum
+ syn keyword cConstant RotationalAngularVelocityEnum
+ syn keyword cConstant SolidearthSettingsElasticEnum
+-syn keyword cConstant SealevelriseGeometryDoneEnum
++syn keyword cConstant SealevelchangeGeometryDoneEnum
+ syn keyword cConstant RotationalEquatorialMoiEnum
+ syn keyword cConstant TidalLoveHEnum
+ syn keyword cConstant TidalLoveKEnum
+@@ -346,24 +350,24 @@
+ syn keyword cConstant LoadLoveHEnum
+ syn keyword cConstant LoadLoveKEnum
+ syn keyword cConstant LoadLoveLEnum
+-syn keyword cConstant SealevelriseGRigidEnum
+-syn keyword cConstant SealevelriseGElasticEnum
++syn keyword cConstant SealevelchangeGRigidEnum
++syn keyword cConstant SealevelchangeGElasticEnum
+ syn keyword cConstant SolidearthSettingsComputesealevelchangeEnum
+ syn keyword cConstant SolidearthSettingsGRDEnum
+ syn keyword cConstant SolidearthSettingsGlfractionEnum
+ syn keyword cConstant SolidearthSettingsRunFrequencyEnum
+-syn keyword cConstant SealevelriseHElasticEnum
++syn keyword cConstant SealevelchangeHElasticEnum
+ syn keyword cConstant SolidearthSettingsHorizEnum
+ syn keyword cConstant SolidearthSettingsMaxiterEnum
+ syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
+ syn keyword cConstant RotationalPolarMoiEnum
+ syn keyword cConstant SolidearthSettingsReltolEnum
+-syn keyword cConstant SealevelriseRequestedOutputsEnum
++syn keyword cConstant SealevelchangeRequestedOutputsEnum
+ syn keyword cConstant SolidearthSettingsRigidEnum
+ syn keyword cConstant SolidearthSettingsRotationEnum
+-syn keyword cConstant SealevelriseRunCountEnum
+-syn keyword cConstant SealevelriseTransitionsEnum
+-syn keyword cConstant SealevelriseUElasticEnum
++syn keyword cConstant SealevelchangeRunCountEnum
++syn keyword cConstant SealevelchangeTransitionsEnum
++syn keyword cConstant SealevelchangeUElasticEnum
+ syn keyword cConstant SettingsIoGatherEnum
+ syn keyword cConstant SettingsNumResultsOnNodesEnum
+ syn keyword cConstant SettingsOutputFrequencyEnum
+@@ -531,6 +535,8 @@
+ syn keyword cConstant BaseSlopeXEnum
+ syn keyword cConstant BaseSlopeYEnum
+ syn keyword cConstant BedEnum
++syn keyword cConstant BedEastEnum
++syn keyword cConstant BedNorthEnum
+ syn keyword cConstant BedSlopeXEnum
+ syn keyword cConstant BedSlopeYEnum
+ syn keyword cConstant CalvingCalvingrateEnum
+@@ -709,8 +715,8 @@
+ syn keyword cConstant RheologyBInitialguessMisfitEnum
+ syn keyword cConstant RheologyBbarAbsGradientEnum
+ syn keyword cConstant SealevelEnum
+-syn keyword cConstant SealevelEustaticMaskEnum
+-syn keyword cConstant SealevelEustaticOceanMaskEnum
++syn keyword cConstant SealevelBarystaticMaskEnum
++syn keyword cConstant SealevelBarystaticOceanMaskEnum
+ syn keyword cConstant SealevelNEsaEnum
+ syn keyword cConstant SealevelNEsaRateEnum
+ syn keyword cConstant SealevelRSLEnum
+@@ -719,23 +725,22 @@
+ syn keyword cConstant BslrHydroEnum
+ syn keyword cConstant BslrRateEnum
+ syn keyword cConstant GmtslrEnum
+-syn keyword cConstant SealevelRSLEustaticEnum
+-syn keyword cConstant SealevelRSLEustaticRateEnum
++syn keyword cConstant SealevelRSLBarystaticEnum
+ syn keyword cConstant SealevelRSLRateEnum
+ syn keyword cConstant SealevelUEastEsaEnum
+ syn keyword cConstant SealevelUEsaEnum
+ syn keyword cConstant SealevelUEsaRateEnum
+ syn keyword cConstant SealevelUNorthEsaEnum
+-syn keyword cConstant SealevelriseCumDeltathicknessEnum
+-syn keyword cConstant SealevelriseCumDeltathicknessOldEnum
++syn keyword cConstant SealevelchangeCumDeltathicknessEnum
++syn keyword cConstant SealevelchangeCumDeltathicknessOldEnum
+ syn keyword cConstant SurfaceloadOtherEnum
+ syn keyword cConstant SurfaceloadIceThicknessChangeEnum
+ syn keyword cConstant SurfaceloadWaterHeightChangeEnum
+-syn keyword cConstant SealevelriseIndicesEnum
+-syn keyword cConstant SealevelriseGEnum
+-syn keyword cConstant SealevelriseGUEnum
+-syn keyword cConstant SealevelriseGEEnum
+-syn keyword cConstant SealevelriseGNEnum
++syn keyword cConstant SealevelchangeIndicesEnum
++syn keyword cConstant SealevelchangeGEnum
++syn keyword cConstant SealevelchangeGUEnum
++syn keyword cConstant SealevelchangeGEEnum
++syn keyword cConstant SealevelchangeGNEnum
+ syn keyword cConstant SedimentHeadEnum
+ syn keyword cConstant SedimentHeadOldEnum
+ syn keyword cConstant SedimentHeadSubstepEnum
+@@ -843,6 +848,11 @@
+ syn keyword cConstant SmbZMinEnum
+ syn keyword cConstant SmbZTopEnum
+ syn keyword cConstant SmbZYEnum
++syn keyword cConstant SolidearthExternalDisplacementEastRateEnum
++syn keyword cConstant SolidearthExternalDisplacementNorthRateEnum
++syn keyword cConstant SolidearthExternalDisplacementUpRateEnum
++syn keyword cConstant SolidearthExternalGeoidRateEnum
++syn keyword cConstant SolidearthExternalBarystaticSeaLevelRateEnum
+ syn keyword cConstant StrainRateeffectiveEnum
+ syn keyword cConstant StrainRateparallelEnum
+ syn keyword cConstant StrainRateperpendicularEnum
+@@ -1302,8 +1312,8 @@
+ syn keyword cConstant SealevelInertiaTensorZZEnum
+ syn keyword cConstant SealevelNmotionEnum
+ syn keyword cConstant SealevelUmotionEnum
+-syn keyword cConstant SealevelriseAnalysisEnum
+-syn keyword cConstant SealevelriseSolutionEnum
++syn keyword cConstant SealevelchangeAnalysisEnum
++syn keyword cConstant SealevelchangeSolutionEnum
+ syn keyword cConstant SegEnum
+ syn keyword cConstant SegInputEnum
+ syn keyword cConstant SegmentEnum
+@@ -1398,7 +1408,6 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
+-syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1405,8 +1414,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DataSetParam
+ syn keyword cType DatasetInput
+-syn keyword cType DataSetParam
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1419,8 +1428,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType ElementVector
+ syn keyword cType Elements
+-syn keyword cType ElementVector
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1427,12 +1436,11 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1447,7 +1455,6 @@
+ 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
+@@ -1458,7 +1465,6 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
+-syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1471,8 +1477,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType OptionUtilities
+ syn keyword cType Options
+-syn keyword cType OptionUtilities
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1486,13 +1492,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType RiftStruct
+ syn keyword cType Riftfront
+-syn keyword cType RiftStruct
+ syn keyword cType SealevelMasks
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType SegRef
+ syn keyword cType Segment
+-syn keyword cType SegRef
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1511,6 +1517,10 @@
+ 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
+@@ -1529,8 +1539,8 @@
+ syn keyword cType ExtrudeFromTopAnalysis
+ syn keyword cType FreeSurfaceBaseAnalysis
+ syn keyword cType FreeSurfaceTopAnalysis
++syn keyword cType GLheightadvectionAnalysis
+ syn keyword cType GiaAnalysis
+-syn keyword cType GLheightadvectionAnalysis
+ syn keyword cType HydrologyDCEfficientAnalysis
+ syn keyword cType HydrologyDCInefficientAnalysis
+ syn keyword cType HydrologyGlaDSAnalysis
+@@ -1543,7 +1553,7 @@
+ syn keyword cType LoveAnalysis
+ syn keyword cType MasstransportAnalysis
+ syn keyword cType MeltingAnalysis
+-syn keyword cType SealevelriseAnalysis
++syn keyword cType SealevelchangeAnalysis
+ syn keyword cType SmbAnalysis
+ syn keyword cType SmoothAnalysis
+ syn keyword cType StressbalanceAnalysis
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25946)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25947)
+@@ -131,6 +131,10 @@
+ 	DslModelEnum,
+ 	DslModelidEnum,
+ 	DslNummodelsEnum,
++	SolidearthIsExternalEnum,
++	SolidearthExternalNatureEnum,
++	SolidearthExternalModelidEnum,
++	SolidearthExternalNummodelsEnum,
+ 	DslComputeFingerprintsEnum,
+ 	EarthIdEnum,
+ 	EplZigZagCounterEnum,
+@@ -331,7 +335,7 @@
+ 	SolidearthSettingsAbstolEnum,
+ 	RotationalAngularVelocityEnum,
+ 	SolidearthSettingsElasticEnum,
+-	SealevelriseGeometryDoneEnum,
++	SealevelchangeGeometryDoneEnum,
+ 	RotationalEquatorialMoiEnum,
+ 	TidalLoveHEnum,
+ 	TidalLoveKEnum,
+@@ -340,24 +344,24 @@
+ 	LoadLoveHEnum,
+ 	LoadLoveKEnum,
+ 	LoadLoveLEnum,
+-	SealevelriseGRigidEnum,
+-	SealevelriseGElasticEnum,
++	SealevelchangeGRigidEnum,
++	SealevelchangeGElasticEnum,
+ 	SolidearthSettingsComputesealevelchangeEnum,
+ 	SolidearthSettingsGRDEnum,
+ 	SolidearthSettingsGlfractionEnum,
+ 	SolidearthSettingsRunFrequencyEnum,
+-	SealevelriseHElasticEnum,
++	SealevelchangeHElasticEnum,
+ 	SolidearthSettingsHorizEnum,
+ 	SolidearthSettingsMaxiterEnum,
+ 	SolidearthSettingsOceanAreaScalingEnum,
+ 	RotationalPolarMoiEnum,
+ 	SolidearthSettingsReltolEnum,
+-	SealevelriseRequestedOutputsEnum,
++	SealevelchangeRequestedOutputsEnum,
+ 	SolidearthSettingsRigidEnum,
+ 	SolidearthSettingsRotationEnum,
+-	SealevelriseRunCountEnum,
+-	SealevelriseTransitionsEnum,
+-	SealevelriseUElasticEnum,
++	SealevelchangeRunCountEnum,
++	SealevelchangeTransitionsEnum,
++	SealevelchangeUElasticEnum,
+ 	SettingsIoGatherEnum,
+ 	SettingsNumResultsOnNodesEnum,
+ 	SettingsOutputFrequencyEnum,
+@@ -527,6 +531,8 @@
+ 	BaseSlopeXEnum,
+ 	BaseSlopeYEnum,
+ 	BedEnum,
++	BedEastEnum,
++	BedNorthEnum,
+ 	BedSlopeXEnum,
+ 	BedSlopeYEnum,
+ 	CalvingCalvingrateEnum,
+@@ -705,8 +711,8 @@
+ 	RheologyBInitialguessMisfitEnum,
+ 	RheologyBbarAbsGradientEnum,
+ 	SealevelEnum,
+-	SealevelEustaticMaskEnum,
+-	SealevelEustaticOceanMaskEnum,
++	SealevelBarystaticMaskEnum,
++	SealevelBarystaticOceanMaskEnum,
+ 	SealevelNEsaEnum,
+ 	SealevelNEsaRateEnum,
+ 	SealevelRSLEnum,
+@@ -715,23 +721,22 @@
+ 	BslrHydroEnum,
+ 	BslrRateEnum,
+ 	GmtslrEnum,
+-	SealevelRSLEustaticEnum,
+-	SealevelRSLEustaticRateEnum,
++	SealevelRSLBarystaticEnum,
+ 	SealevelRSLRateEnum,
+ 	SealevelUEastEsaEnum,
+ 	SealevelUEsaEnum,
+ 	SealevelUEsaRateEnum,
+ 	SealevelUNorthEsaEnum,
+-	SealevelriseCumDeltathicknessEnum,
+-	SealevelriseCumDeltathicknessOldEnum,
++	SealevelchangeCumDeltathicknessEnum,
++	SealevelchangeCumDeltathicknessOldEnum,
+ 	SurfaceloadOtherEnum,
+ 	SurfaceloadIceThicknessChangeEnum,
+ 	SurfaceloadWaterHeightChangeEnum,
+-	SealevelriseIndicesEnum,
+-	SealevelriseGEnum,
+-	SealevelriseGUEnum,
+-	SealevelriseGEEnum,
+-	SealevelriseGNEnum,
++	SealevelchangeIndicesEnum,
++	SealevelchangeGEnum,
++	SealevelchangeGUEnum,
++	SealevelchangeGEEnum,
++	SealevelchangeGNEnum,
+ 	SedimentHeadEnum,
+ 	SedimentHeadOldEnum,
+ 	SedimentHeadSubstepEnum,
+@@ -840,6 +845,11 @@
+ 	SmbZMinEnum,
+ 	SmbZTopEnum,
+ 	SmbZYEnum,
++	SolidearthExternalDisplacementEastRateEnum,
++	SolidearthExternalDisplacementNorthRateEnum,
++	SolidearthExternalDisplacementUpRateEnum,
++	SolidearthExternalGeoidRateEnum,
++	SolidearthExternalBarystaticSeaLevelRateEnum,
+ 	StrainRateeffectiveEnum,
+ 	StrainRateparallelEnum,
+ 	StrainRateperpendicularEnum,
+@@ -1301,8 +1311,8 @@
+ 	SealevelInertiaTensorZZEnum,
+ 	SealevelNmotionEnum,
+ 	SealevelUmotionEnum,
+-	SealevelriseAnalysisEnum,
+-	SealevelriseSolutionEnum,
++	SealevelchangeAnalysisEnum,
++	SealevelchangeSolutionEnum,
+ 	SegEnum,
+ 	SegInputEnum,
+ 	SegmentEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25946)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25947)
+@@ -142,6 +142,10 @@
+ 	      if (strcmp(name,"DslModel")==0) return DslModelEnum;
+ 	      else if (strcmp(name,"DslModelid")==0) return DslModelidEnum;
+ 	      else if (strcmp(name,"DslNummodels")==0) return DslNummodelsEnum;
++	      else if (strcmp(name,"SolidearthIsExternal")==0) return SolidearthIsExternalEnum;
++	      else if (strcmp(name,"SolidearthExternalNature")==0) return SolidearthExternalNatureEnum;
++	      else if (strcmp(name,"SolidearthExternalModelid")==0) return SolidearthExternalModelidEnum;
++	      else if (strcmp(name,"SolidearthExternalNummodels")==0) return SolidearthExternalNummodelsEnum;
+ 	      else if (strcmp(name,"DslComputeFingerprints")==0) return DslComputeFingerprintsEnum;
+ 	      else if (strcmp(name,"EarthId")==0) return EarthIdEnum;
+ 	      else if (strcmp(name,"EplZigZagCounter")==0) return EplZigZagCounterEnum;
+@@ -255,14 +259,14 @@
+ 	      else if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
+ 	      else if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
+ 	      else if (strcmp(name,"LoveG0")==0) return LoveG0Enum;
+-	      else if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
++         else stage=3;
++   }
++   if(stage==3){
++	      if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
+ 	      else if (strcmp(name,"LoveMu0")==0) return LoveMu0Enum;
+ 	      else if (strcmp(name,"LoveNfreq")==0) return LoveNfreqEnum;
+ 	      else if (strcmp(name,"LoveR0")==0) return LoveR0Enum;
+-         else stage=3;
+-   }
+-   if(stage==3){
+-	      if (strcmp(name,"LoveShNmax")==0) return LoveShNmaxEnum;
++	      else if (strcmp(name,"LoveShNmax")==0) return LoveShNmaxEnum;
+ 	      else if (strcmp(name,"LoveShNmin")==0) return LoveShNminEnum;
+ 	      else if (strcmp(name,"MassFluxSegments")==0) return MassFluxSegmentsEnum;
+ 	      else if (strcmp(name,"MassFluxSegmentsPresent")==0) return MassFluxSegmentsPresentEnum;
+@@ -345,7 +349,7 @@
+ 	      else if (strcmp(name,"SolidearthSettingsAbstol")==0) return SolidearthSettingsAbstolEnum;
+ 	      else if (strcmp(name,"RotationalAngularVelocity")==0) return RotationalAngularVelocityEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+-	      else if (strcmp(name,"SealevelriseGeometryDone")==0) return SealevelriseGeometryDoneEnum;
++	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
+ 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
+ 	      else if (strcmp(name,"TidalLoveH")==0) return TidalLoveHEnum;
+ 	      else if (strcmp(name,"TidalLoveK")==0) return TidalLoveKEnum;
+@@ -354,24 +358,24 @@
+ 	      else if (strcmp(name,"LoadLoveH")==0) return LoadLoveHEnum;
+ 	      else if (strcmp(name,"LoadLoveK")==0) return LoadLoveKEnum;
+ 	      else if (strcmp(name,"LoadLoveL")==0) return LoadLoveLEnum;
+-	      else if (strcmp(name,"SealevelriseGRigid")==0) return SealevelriseGRigidEnum;
+-	      else if (strcmp(name,"SealevelriseGElastic")==0) return SealevelriseGElasticEnum;
++	      else if (strcmp(name,"SealevelchangeGRigid")==0) return SealevelchangeGRigidEnum;
++	      else if (strcmp(name,"SealevelchangeGElastic")==0) return SealevelchangeGElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsGRD")==0) return SolidearthSettingsGRDEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsGlfraction")==0) return SolidearthSettingsGlfractionEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRunFrequency")==0) return SolidearthSettingsRunFrequencyEnum;
+-	      else if (strcmp(name,"SealevelriseHElastic")==0) return SealevelriseHElasticEnum;
++	      else if (strcmp(name,"SealevelchangeHElastic")==0) return SealevelchangeHElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsHoriz")==0) return SolidearthSettingsHorizEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsMaxiter")==0) return SolidearthSettingsMaxiterEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+-	      else if (strcmp(name,"SealevelriseRequestedOutputs")==0) return SealevelriseRequestedOutputsEnum;
++	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+-	      else if (strcmp(name,"SealevelriseRunCount")==0) return SealevelriseRunCountEnum;
+-	      else if (strcmp(name,"SealevelriseTransitions")==0) return SealevelriseTransitionsEnum;
+-	      else if (strcmp(name,"SealevelriseUElastic")==0) return SealevelriseUElasticEnum;
++	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
++	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
++	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+ 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+ 	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+@@ -378,14 +382,14 @@
+ 	      else if (strcmp(name,"SettingsCheckpointFrequency")==0) return SettingsCheckpointFrequencyEnum;
+ 	      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 stage=4;
++   }
++   if(stage==4){
++	      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 stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
++	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
+ 	      else if (strcmp(name,"SmbAccualti")==0) return SmbAccualtiEnum;
+ 	      else if (strcmp(name,"SmbAccugrad")==0) return SmbAccugradEnum;
+ 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
+@@ -501,14 +505,14 @@
+ 	      else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
+ 	      else if (strcmp(name,"Velocity")==0) return VelocityEnum;
+-	      else if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
+ 	      else if (strcmp(name,"ParametersEND")==0) return ParametersENDEnum;
+ 	      else if (strcmp(name,"InputsSTART")==0) return InputsSTARTEnum;
+ 	      else if (strcmp(name,"Adjoint")==0) return AdjointEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
++	      else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
+ 	      else if (strcmp(name,"Adjointx")==0) return AdjointxEnum;
+ 	      else if (strcmp(name,"Adjointy")==0) return AdjointyEnum;
+ 	      else if (strcmp(name,"Adjointz")==0) return AdjointzEnum;
+@@ -545,6 +549,8 @@
+ 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
+ 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
+ 	      else if (strcmp(name,"Bed")==0) return BedEnum;
++	      else if (strcmp(name,"BedEast")==0) return BedEastEnum;
++	      else if (strcmp(name,"BedNorth")==0) return BedNorthEnum;
+ 	      else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
+ 	      else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
+ 	      else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
+@@ -622,16 +628,16 @@
+ 	      else if (strcmp(name,"FrictionCoefficient")==0) return FrictionCoefficientEnum;
+ 	      else if (strcmp(name,"FrictionCoefficientcoulomb")==0) return FrictionCoefficientcoulombEnum;
+ 	      else if (strcmp(name,"FrictionEffectivePressure")==0) return FrictionEffectivePressureEnum;
+-	      else if (strcmp(name,"FrictionM")==0) return FrictionMEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      if (strcmp(name,"FrictionM")==0) return FrictionMEnum;
+ 	      else if (strcmp(name,"FrictionP")==0) return FrictionPEnum;
+ 	      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 stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"FrictionWaterLayer")==0) return FrictionWaterLayerEnum;
++	      else if (strcmp(name,"FrictionWaterLayer")==0) return FrictionWaterLayerEnum;
+ 	      else if (strcmp(name,"Frictionf")==0) return FrictionfEnum;
+ 	      else if (strcmp(name,"FrontalForcingsBasinId")==0) return FrontalForcingsBasinIdEnum;
+ 	      else if (strcmp(name,"FrontalForcingsSubglacialDischarge")==0) return FrontalForcingsSubglacialDischargeEnum;
+@@ -726,8 +732,8 @@
+ 	      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,"SealevelBarystaticMask")==0) return SealevelBarystaticMaskEnum;
++	      else if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
+ 	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
+ 	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
+ 	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
+@@ -736,26 +742,25 @@
+ 	      else if (strcmp(name,"BslrHydro")==0) return BslrHydroEnum;
+ 	      else if (strcmp(name,"BslrRate")==0) return BslrRateEnum;
+ 	      else if (strcmp(name,"Gmtslr")==0) return GmtslrEnum;
+-	      else if (strcmp(name,"SealevelRSLEustatic")==0) return SealevelRSLEustaticEnum;
+-	      else if (strcmp(name,"SealevelRSLEustaticRate")==0) return SealevelRSLEustaticRateEnum;
++	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
+ 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
+ 	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
+ 	      else if (strcmp(name,"SealevelUEsa")==0) return SealevelUEsaEnum;
+ 	      else if (strcmp(name,"SealevelUEsaRate")==0) return SealevelUEsaRateEnum;
+ 	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+-	      else if (strcmp(name,"SealevelriseCumDeltathickness")==0) return SealevelriseCumDeltathicknessEnum;
+-	      else if (strcmp(name,"SealevelriseCumDeltathicknessOld")==0) return SealevelriseCumDeltathicknessOldEnum;
++	      else if (strcmp(name,"SealevelchangeCumDeltathickness")==0) return SealevelchangeCumDeltathicknessEnum;
++	      else if (strcmp(name,"SealevelchangeCumDeltathicknessOld")==0) return SealevelchangeCumDeltathicknessOldEnum;
+ 	      else if (strcmp(name,"SurfaceloadOther")==0) return SurfaceloadOtherEnum;
+-	      else if (strcmp(name,"SurfaceloadIceThicknessChange")==0) return SurfaceloadIceThicknessChangeEnum;
+-	      else if (strcmp(name,"SurfaceloadWaterHeightChange")==0) return SurfaceloadWaterHeightChangeEnum;
+-	      else if (strcmp(name,"SealevelriseIndices")==0) return SealevelriseIndicesEnum;
+-	      else if (strcmp(name,"SealevelriseG")==0) return SealevelriseGEnum;
+-	      else if (strcmp(name,"SealevelriseGU")==0) return SealevelriseGUEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"SealevelriseGE")==0) return SealevelriseGEEnum;
+-	      else if (strcmp(name,"SealevelriseGN")==0) return SealevelriseGNEnum;
++	      if (strcmp(name,"SurfaceloadIceThicknessChange")==0) return SurfaceloadIceThicknessChangeEnum;
++	      else if (strcmp(name,"SurfaceloadWaterHeightChange")==0) return SurfaceloadWaterHeightChangeEnum;
++	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
++	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
++	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
++	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
++	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+ 	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
+ 	      else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
+ 	      else if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum;
+@@ -863,8 +868,16 @@
+ 	      else if (strcmp(name,"SmbZMin")==0) return SmbZMinEnum;
+ 	      else if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
+ 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
++	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
++	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
++	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
++	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
++	      else if (strcmp(name,"SolidearthExternalBarystaticSeaLevelRate")==0) return SolidearthExternalBarystaticSeaLevelRateEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+-	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+ 	      else if (strcmp(name,"StrainRatexx")==0) return StrainRatexxEnum;
+ 	      else if (strcmp(name,"StrainRatexy")==0) return StrainRatexyEnum;
+@@ -874,10 +887,7 @@
+ 	      else if (strcmp(name,"StrainRatezz")==0) return StrainRatezzEnum;
+ 	      else if (strcmp(name,"StressMaxPrincipal")==0) return StressMaxPrincipalEnum;
+ 	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
++	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
+ 	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
+ 	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+ 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+@@ -987,7 +997,10 @@
+ 	      else if (strcmp(name,"Outputdefinition59")==0) return Outputdefinition59Enum;
+ 	      else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum;
+ 	      else if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
+-	      else if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
+ 	      else if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
+ 	      else if (strcmp(name,"Outputdefinition63")==0) return Outputdefinition63Enum;
+ 	      else if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
+@@ -997,10 +1010,7 @@
+ 	      else if (strcmp(name,"Outputdefinition68")==0) return Outputdefinition68Enum;
+ 	      else if (strcmp(name,"Outputdefinition69")==0) return Outputdefinition69Enum;
+ 	      else if (strcmp(name,"Outputdefinition6")==0) return Outputdefinition6Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
++	      else if (strcmp(name,"Outputdefinition70")==0) return Outputdefinition70Enum;
+ 	      else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
+ 	      else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
+ 	      else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum;
+@@ -1110,7 +1120,10 @@
+ 	      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 stage=10;
++   }
++   if(stage==10){
++	      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;
+@@ -1120,10 +1133,7 @@
+ 	      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 stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"ExtrapolationAnalysis")==0) return ExtrapolationAnalysisEnum;
++	      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;
+@@ -1233,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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,"Mathydro")==0) return MathydroEnum;
+@@ -1243,10 +1256,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
++	      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;
+@@ -1334,8 +1344,8 @@
+ 	      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,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
++	      else if (strcmp(name,"SealevelchangeSolution")==0) return SealevelchangeSolutionEnum;
+ 	      else if (strcmp(name,"Seg")==0) return SegEnum;
+ 	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
+ 	      else if (strcmp(name,"Segment")==0) return SegmentEnum;
+@@ -1356,7 +1366,10 @@
+ 	      else if (strcmp(name,"StressIntensityFactor")==0) return StressIntensityFactorEnum;
+ 	      else if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
+ 	      else if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
+-	      else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
+ 	      else if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
+ 	      else if (strcmp(name,"StressbalanceVerticalAnalysis")==0) return StressbalanceVerticalAnalysisEnum;
+ 	      else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
+@@ -1366,10 +1379,7 @@
+ 	      else if (strcmp(name,"SubelementFriction2")==0) return SubelementFriction2Enum;
+ 	      else if (strcmp(name,"SubelementMelt1")==0) return SubelementMelt1Enum;
+ 	      else if (strcmp(name,"SubelementMelt2")==0) return SubelementMelt2Enum;
+-         else stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"SubelementMigration")==0) return SubelementMigrationEnum;
++	      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,"Tetra")==0) return TetraEnum;
+Index: ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 25947)
+@@ -0,0 +1,86 @@
++%MMEADDITIONALSOLIDEARTHSOLUTION class definition
++%
++%   Usage:
++%      addsol=mmeadditionalsolidearthsolution(); where the additional solid earth solutions %                               are based on a multi-model ensemble (ex: Caron et al 2017 statistics) 
++
++classdef mmeadditionalsolidearthsolution < additionalsolidearthsolution 
++	properties (SetAccess=public) 
++		modelid; %index into the multi-model ensemble, each ensemble variable being defined 
++	         %in the father class.
++	end
++	methods
++		function self = mmeadditionalsolidearthsolution(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++			self.setdefaultparameters@additionalsolidearthsolution();
++			self.modelid=0;
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
++				error('mmeadditionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
++			end
++
++			seast=length(self.displacementeast);
++			snorth=length(self.displacementnorth);
++			sup=length(self.displacementup);
++			sgeoid=length(self.geoid);
++			sbarystaticsealevel=length(self.barystaticsealevel);
++
++			if (seast-snorth)~=0,
++				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
++			end
++
++			if (seast-sup)~=0,
++				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and displacementup should be the same size');
++			end
++
++			if (seast-sgeoid)~=0,
++				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
++			end
++
++			if (seast-sbarystaticsealevel)~=0,
++				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and barystaticsealevel should be the same size');
++			end
++			
++			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
++
++			for i=1:seast,
++				md = checkfield(md,'field',self.displacementeast{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.barystaticsealevel{i},'NaN',1,'Inf',1,'timeseries',1);
++			end
++
++
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   external: mmeadditionalsolidearth solution:'));
++			self.disp@solidearthsolution();
++			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++			WriteData(fid,prefix,'object',self,'data',3,'name','md.solidearth.external.nature','format','Integer'); %code 3 for mmeadditionalsolidearthsolution  class
++			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',length(self.displacementeast),'format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
++			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++
++		end % }}}
++		function savemodeljs(self,fid,modelname) % {{{
++			error('mmeadditionalsolidearthsolution error message: not implemented yet');
++		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 25947)
+@@ -0,0 +1,44 @@
++%OFFLINESOLIDEARTHSOLUTION class definition
++%
++%   Usage:
++%      addsol=offlinesolidearthsolution();
++
++classdef offlinesolidearthsolution < solidearthsolution
++	properties (SetAccess=public) 
++	end
++	methods
++		function self = offlinesolidearthsolution(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++			self.setdefaultparameters@solidearthsolution();
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
++				error('offlinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
++			end
++			self.checkconsistency@solidearthsolution(md,solution,analyses);
++
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   external: offlinesolidearth solution:'));
++			self.disp@solidearthsolution();
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++			disp(sprintf('   external (offlinesolidearthsolution) solution:'));
++			WriteData(fid,prefix,'object',self,'data',2,'name','md.solidearth.external.nature','format','Integer'); %code 1 for offlinesolidearthsolution  class
++			self.marshall@solidearthsolution(prefix,md,fid);
++		end % }}}
++		function savemodeljs(self,fid,modelname) % {{{
++			self.savemodeljs@solidearthsolution(fid,modelname);
++		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 25946)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 25947)
+@@ -39,20 +39,32 @@
+ 
+ 		end % }}}
+ 		function disp(self) % {{{
+-			fielddisplay(self,'displacementeast','solid-Earth Eastwards bedrock motion (m/yr)');
+-			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock motion (m/yr)');
+-			fielddisplay(self,'displacementup','solid-Earth bedrock uplift rate (m/yr)');
+-			fielddisplay(self,'geoid','solid-Earth geoid motion (m/yr)');
+-			fielddisplay(self,'barystaticsealevel','barystatic absolute sea-level rate (m/yr)');
++			disp(sprintf('%s','         units for time series is (yr)'));
++			fielddisplay(self,'displacementeast','solid-Earth Eastwards bedrock displacement series (m)');
++			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock displacement time series (m)');
++			fielddisplay(self,'displacementup','solid-Earth bedrock uplift time series (m)');
++			fielddisplay(self,'geoid','solid-Earth geoid time series (m)');
++			fielddisplay(self,'barystaticsealevel','barystatic absolute sea-level time series (m)');
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			yts=md.constants.yts;
+-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','displacementeast','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','displacementnorth','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','displacementup','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','geoid','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'class','solidearthsolution','fieldname','barystaticsealevel','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++
++			%transform our time series into time series rates 
++			time=self.displacementeast(end,:);
++			dt=diff(time,1,2);
++			
++			displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
++			displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
++			displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
++			geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
++			barystaticsealevel_rate=diff(barystaticsealevel(1:end-1,:),1,2)./dt;
++
++			WriteData(fid,prefix,'name','md.solidearth.external.displacementeast','data',displacementeast_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'name','md.solidearth.external.displacementup','data',displacementup_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'name','md.solidearth.external.displacementnorth','data',displacementnorth_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'name','md.solidearth.external.geoid','data',geoid_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'name','md.solidearth.external.barystaticsealevel','data',barystaticsealevel_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 	
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-25947-25948.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25947-25948.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25947-25948.diff	(revision 26740)
@@ -0,0 +1,114 @@
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 25947)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 25948)
+@@ -67,29 +67,29 @@
+ md.solidearth.settings.rigid=0;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelrise');
+-Seustatic=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++Seustatic=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %eustatic + rigid run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelrise');
+-Srigid=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++Srigid=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelrise');
+-Selastic=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++Selastic=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
+-md=solve(md,'Sealevelrise');
+-Srotation=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++Srotation=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %Fields and tolerances to track changes
+ field_names={'Eustatic','Rigid','Elastic','Rotation'};
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 25947)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 25948)
+@@ -70,8 +70,8 @@
+ md.solidearth.settings.rotation=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+ %md.verbose=verbose('111111111');
+-md=solve(md,'Sealevelrise');
+-SnoRotation=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++SnoRotation=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+@@ -79,8 +79,8 @@
+ md.solidearth.settings.rotation=1;
+ md.cluster=generic('name',oshostname(),'np',3);
+ %md.verbose=verbose('111111111');
+-md=solve(md,'Sealevelrise');
+-SRotation=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++SRotation=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'noRotation','Rotation'};
+Index: ../trunk-jpl/test/NightlyRun/test2004.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.m	(revision 25947)
++++ ../trunk-jpl/test/NightlyRun/test2004.m	(revision 25948)
+@@ -397,31 +397,31 @@
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.requested_outputs= {'default',...
+-	'SurfaceloadIceThicknessChange','Sealevel','SealevelRSLRate','SealevelriseCumDeltathickness',...
+-	'SealevelNEsaRate', 'SealevelUEsaRate', 'NGiaRate', 'UGiaRate','SealevelEustaticMask','SealevelEustaticOceanMask'};
+-md=solve(md,'Sealevelrise');
+-Seustatic=md.results.SealevelriseSolution.Sealevel;
++	'SurfaceloadIceThicknessChange','Sealevel','SealevelRSLRate','SealevelchangeCumDeltathickness',...
++	'SealevelNEsaRate', 'SealevelUEsaRate','SealevelStaticBarystaticMask','SealevelBarystaticOceanMask'};
++md=solve(md,'Sealevelchange');
++Seustatic=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %eustatic + rigid run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelrise');
+-Srigid=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++Srigid=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelrise');
+-Selastic=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++Selastic=md.results.SealevelchangeSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
+-md=solve(md,'Sealevelrise');
+-Srotation=md.results.SealevelriseSolution.Sealevel;
++md=solve(md,'Sealevelchange');
++Srotation=md.results.SealevelchangeSolution.Sealevel;
+ %}}}
+ 
+ %Fields and tolerances to track changes
Index: /issm/oecreview/Archive/25834-26739/ISSM-25948-25949.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25948-25949.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25948-25949.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 25948)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 25949)
+@@ -21,7 +21,7 @@
+ %   - 'Gia'                or 'gia'
+ %   - 'Love'               or 'lv'
+ %   - 'Esa'                or 'esa'
+-%   - 'Sealevelrise'       or 'slr'
++%   - 'Sealevelchange'     or 'slr'
+ %
+ %   Extra options:
+ %   - loadonly         : does not solve. only load results
+@@ -72,8 +72,8 @@
+ 	solutionstring = 'LoveSolution';
+ elseif strcmpi(solutionstring,'esa') || strcmpi(solutionstring,'Esa')
+ 	solutionstring = 'EsaSolution';
+-elseif strcmpi(solutionstring,'slr') || strcmpi(solutionstring,'Sealevelrise')
+-	solutionstring = 'SealevelriseSolution';
++elseif strcmpi(solutionstring,'slr') || strcmpi(solutionstring,'Sealevelchange')
++	solutionstring = 'SealevelchangeSolution';
+ else
+ 	error(['solutionstring ' solutionstring ' not supported!']);
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-25949-25950.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25949-25950.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25949-25950.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 25949)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 25950)
+@@ -70,7 +70,7 @@
+ 	elseif strcmp(solutiontype,'EsaSolution')
+ 		analyses={'EsaAnalysis'};
+ 	elseif strcmp(solutiontype,'TransientSolution')
+-		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','SealevelriseAnalysis'};
++		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','SealevelchangeAnalysis'};
+ 	elseif strcmp(solutiontype,'SealevelriseSolution')
+ 		analyses={'SealevelriseAnalysis'};
+ 	elseif strcmp(solutiontype,'HydrologySolution')
Index: /issm/oecreview/Archive/25834-26739/ISSM-25950-25951.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25950-25951.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25950-25951.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/test/NightlyRun/test2010.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2010.m	(revision 25950)
++++ ../trunk-jpl/test/NightlyRun/test2010.m	(revision 25951)
+@@ -73,12 +73,12 @@
+ md.cluster=generic('name',oshostname(),'np',3);
+ 
+ % uncomment following 2 lines for
+-md=solve(md,'Sealevelrise');
+-eus=md.results.SealevelriseSolution.Bslr;
+-slr=md.results.SealevelriseSolution.Sealevel;
+-moixz=md.results.SealevelriseSolution.SealevelInertiaTensorXZ;
+-moiyz=md.results.SealevelriseSolution.SealevelInertiaTensorYZ;
+-moizz=md.results.SealevelriseSolution.SealevelInertiaTensorZZ;
++md=solve(md,'Sealevelchange');
++eus=md.results.SealevelchangeSolution.Bslr;
++slr=md.results.SealevelchangeSolution.Sealevel;
++moixz=md.results.SealevelchangeSolution.SealevelInertiaTensorXZ;
++moiyz=md.results.SealevelchangeSolution.SealevelInertiaTensorYZ;
++moizz=md.results.SealevelchangeSolution.SealevelInertiaTensorZZ;
+ 
+ % analytical moi => just checking FOR ICE only!!! {{{
+ % ...have to mute ** slr induced MOI in Tria.cpp ** prior to the comparison
Index: /issm/oecreview/Archive/25834-26739/ISSM-25951-25952.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25951-25952.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25951-25952.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 25951)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 25952)
+@@ -71,8 +71,8 @@
+ 		analyses={'EsaAnalysis'};
+ 	elseif strcmp(solutiontype,'TransientSolution')
+ 		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','SealevelchangeAnalysis'};
+-	elseif strcmp(solutiontype,'SealevelriseSolution')
+-		analyses={'SealevelriseAnalysis'};
++	elseif strcmp(solutiontype,'SealevelchangeSolution')
++		analyses={'SealevelchangeAnalysis'};
+ 	elseif strcmp(solutiontype,'HydrologySolution')
+ 		analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis'};
+ 	elseif strcmp(solutiontype,'DamageEvolutionSolution')
Index: /issm/oecreview/Archive/25834-26739/ISSM-25952-25953.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25952-25953.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25952-25953.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25952)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25953)
+@@ -145,11 +145,13 @@
+ 		/*retrieve model id: */
+ 		femmodel->parameters->FindParam(&modelid,SolidearthExternalModelidEnum);
+ 		/*replace dataset of forcings with only one, the modelid'th:*/
+-		MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
+-		MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+-		MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
+-		MmeToInputFromId(femmodel,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
+-		MmeToInputFromId(femmodel,modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
++		printf("-------------- file: sealevelchange_core.cpp line: %i\n",__LINE__); 
++		printf("TEMPORARY FIX: uncomment lines below!\n");
++		//MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
++		//MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
++		//MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
++		//MmeToInputFromId(femmodel,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
++		//MmeToInputFromId(femmodel,modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
+ 	}
+ 	
+ 	GetVectorFromInputsx(&geoid_rate,femmodel,SolidearthExternalGeoidRateEnum,VertexSIdEnum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-25953-25954.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25953-25954.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25953-25954.diff	(revision 26740)
@@ -0,0 +1,187 @@
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 25953)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 25954)
+@@ -10,7 +10,6 @@
+ void  InputUpdateFromDakotax(FemModel* femmodel,double* variables,char* *variables_descriptors,int numvariables);
+ void  InputUpdateSpecialtyCode(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,char* root);
+ void  MmeToInput(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,int rootenum, int interpolationenum);
+-void  MmeToInputFromId(FemModel* femmodel,int id, int rootenum, int interpolationenum);
+ void InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name);
+ 
+ 
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 25953)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 25954)
+@@ -13,6 +13,7 @@
+ #include "../cores/cores.h"
+ #include "../shared/io/io.h"
+ #include "./classes.h"
++#include "./Inputs/TriaInput.h"
+ #include "./modules/modules.h"
+ #include "../shared/Enum/Enum.h"
+ #include "../analyses/analyses.h"
+@@ -2111,6 +2112,61 @@
+ 	*pminvz=minvz;
+ 
+ }/*}}}*/
++void FemModel::MmeToInputFromId(int id, int rootenum, int interpolationenum){ /*{{{*/
++
++	TransientInput* transientinput  = NULL;
++	TransientInput* transientinput2 = NULL;
++	Tria* element                    = NULL;
++	IssmDouble value;
++	IssmDouble* values               = NULL;
++	IssmDouble* times                = NULL;
++	int N;
++
++	/*find thickness dataset: */
++	DatasetInput* datasetinput = this->inputs->GetDatasetInput(rootenum);
++
++	/*Initialize new transient input: */
++	transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);
++	transientinput->GetAllTimes(&times,&N);
++	this->inputs->SetTransientInput(DummyEnum,times,N);
++	transientinput2 = this->inputs->GetTransientInput(DummyEnum);
++
++	for(Object* & object : this->elements->objects){
++		Tria*   element=xDynamicCast<Tria*>(object);
++
++		/*recover the right field from the mme: */
++		transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);
++
++		/*copy values from the transientinput to the final transientinput2: */
++		for (int j=0;j<N;j++){
++			TriaInput* tria_input=transientinput->GetTriaInput(j);
++			element->InputServe(tria_input);
++			if(interpolationenum==P0Enum){
++				value=tria_input->element_values[0];
++				transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);
++			}
++			else if(interpolationenum==P1Enum){
++
++				/*Get values and lid list*/
++				const int   numvertices     = element->GetNumberOfVertices();
++				int        *vertexlids      = xNew<int>(numvertices);
++				int        *vertexsids      = xNew<int>(numvertices);
++
++				/*Recover vertices ids needed to initialize inputs*/
++				element->GetVerticesLidList(&vertexlids[0]);
++				element->GetVerticesSidList(&vertexsids[0]);
++				values=tria_input->element_values;
++				transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);
++			}
++		}
++	}
++
++	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
++	this->inputs->ChangeEnum(DummyEnum,rootenum);
++
++	//reconfigure:
++	transientinput2->Configure(this->parameters);
++}	//}}}
+ void FemModel::OmegaAbsGradientx( IssmDouble* pJ){/*{{{*/
+ 
+ 	/*output: */
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 25953)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 25954)
+@@ -129,6 +129,7 @@
+ 		void MinVxx(IssmDouble* presponse);
+ 		void MinVyx(IssmDouble* presponse);
+ 		void MinVzx(IssmDouble* presponse);
++		void MmeToInputFromId(int id, int rootenum, int interpolationenum);
+ 		void DistanceToFieldValue(int fieldenum,IssmDouble fieldvalue,int distanceenum);
+ 		void ResetLevelset();
+ 		void StrainRateparallelx();
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25953)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25954)
+@@ -145,13 +145,11 @@
+ 		/*retrieve model id: */
+ 		femmodel->parameters->FindParam(&modelid,SolidearthExternalModelidEnum);
+ 		/*replace dataset of forcings with only one, the modelid'th:*/
+-		printf("-------------- file: sealevelchange_core.cpp line: %i\n",__LINE__); 
+-		printf("TEMPORARY FIX: uncomment lines below!\n");
+-		//MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
+-		//MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+-		//MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
+-		//MmeToInputFromId(femmodel,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
+-		//MmeToInputFromId(femmodel,modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
++		femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
++		femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
++		femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
++		femmodel->MmeToInputFromId(modelid,SolidearthExternalGeoidRateEnum, P1Enum);
++		femmodel->MmeToInputFromId(modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
+ 	}
+ 	
+ 	GetVectorFromInputsx(&geoid_rate,femmodel,SolidearthExternalGeoidRateEnum,VertexSIdEnum);
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 25953)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 25954)
+@@ -264,61 +264,6 @@
+ 	//reconfigure:
+ 	transientinput2->Configure(femmodel->parameters);
+ }	//}}}
+-void  MmeToInputFromId(FemModel* femmodel,int id, int rootenum, int interpolationenum){ /*{{{*/
+-
+-	TransientInput* transientinput  = NULL;
+-	TransientInput* transientinput2 = NULL;
+-	Tria* element                    = NULL;
+-	IssmDouble value;
+-	IssmDouble* values               = NULL;
+-	IssmDouble* times                = NULL;
+-	int N;
+-
+-	/*find thickness dataset: */
+-	DatasetInput* datasetinput = femmodel->inputs->GetDatasetInput(rootenum);
+-
+-	/*Initialize new transient input: */
+-	transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);
+-	transientinput->GetAllTimes(&times,&N);
+-	femmodel->inputs->SetTransientInput(DummyEnum,times,N);
+-	transientinput2 = femmodel->inputs->GetTransientInput(DummyEnum);
+-
+-	for(Object* & object : femmodel->elements->objects){
+-		Tria*   element=xDynamicCast<Tria*>(object);
+-
+-		/*recover the right field from the mme: */
+-		transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);
+-
+-		/*copy values from the transientinput to the final transientinput2: */
+-		for (int j=0;j<N;j++){
+-			TriaInput* tria_input=transientinput->GetTriaInput(j);
+-			element->InputServe(tria_input);
+-			if(interpolationenum==P0Enum){
+-				value=tria_input->element_values[0];
+-				transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);
+-			}
+-			else if(interpolationenum==P1Enum){
+-
+-				/*Get values and lid list*/
+-				const int   numvertices     = element->GetNumberOfVertices();
+-				int        *vertexlids      = xNew<int>(numvertices);
+-				int        *vertexsids      = xNew<int>(numvertices);
+-
+-				/*Recover vertices ids needed to initialize inputs*/
+-				element->GetVerticesLidList(&vertexlids[0]);
+-				element->GetVerticesSidList(&vertexsids[0]);
+-				values=tria_input->element_values;
+-				transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);
+-			}
+-		}
+-	}
+-
+-	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
+-	femmodel->inputs->ChangeEnum(DummyEnum,rootenum);
+-
+-	//reconfigure:
+-	transientinput2->Configure(femmodel->parameters);
+-}	//}}}
+ void  InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name){ /*{{{*/
+ 
+ 	/*Copy input:*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-25954-25955.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25954-25955.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25954-25955.diff	(revision 26740)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/src/m/solve/solve.js
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.js	(revision 25954)
++++ ../trunk-jpl/src/m/solve/solve.js	(revision 25955)
+@@ -19,7 +19,7 @@
+  *		- 'Hydrology'			or 'hy'
+  *		- 'DamageEvolution'		or 'da'
+  *		- 'Gia'					or 'gia'
+- *		- 'Sealevelrise'		or 'slr'
++ *		- 'Sealevelchange'		or 'slc'
+  *
+  *	extra options:
+  *		- loadonly    		: do not solve, only load results
+@@ -70,7 +70,7 @@
+ 		solutionstring = 'DamageEvolutionSolution';
+ 	} else if ((solutionStringLowerCase === 'gia') || (solutionStringLowerCase === 'gia')) {
+ 		solutionstring = 'GiaSolution';
+-	} else if ((solutionStringLowerCase === 'slr') || (solutionStringLowerCase === 'sealevelrise')) {
++	} else if ((solutionStringLowerCase === 'slc') || (solutionStringLowerCase === 'sealevelchange')) {
+ 		solutionstring = 'SealevelriseSolution';
+ 	} else {
+ 		throw Error(sprintf("%s%s%s\n",'solutionstring ',solutionstring,' not supported!'));
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 25954)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 25955)
+@@ -21,7 +21,7 @@
+ %   - 'Gia'                or 'gia'
+ %   - 'Love'               or 'lv'
+ %   - 'Esa'                or 'esa'
+-%   - 'Sealevelchange'     or 'slr'
++%   - 'Sealevelchange'     or 'slc'
+ %
+ %   Extra options:
+ %   - loadonly         : does not solve. only load results
+@@ -72,7 +72,7 @@
+ 	solutionstring = 'LoveSolution';
+ elseif strcmpi(solutionstring,'esa') || strcmpi(solutionstring,'Esa')
+ 	solutionstring = 'EsaSolution';
+-elseif strcmpi(solutionstring,'slr') || strcmpi(solutionstring,'Sealevelchange')
++elseif strcmpi(solutionstring,'slc') || strcmpi(solutionstring,'Sealevelchange')
+ 	solutionstring = 'SealevelchangeSolution';
+ else
+ 	error(['solutionstring ' solutionstring ' not supported!']);
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 25954)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 25955)
+@@ -32,7 +32,7 @@
+     - 'DamageEvolution'    or 'da'
+     - 'Gia'                or 'gia'
+     - 'Esa'                or 'esa'
+-    - 'Sealevelrise'       or 'slr'
++    - 'Sealevelchange'     or 'slc'
+     - 'Love'               or 'lv'
+ 
+     Extra options:
+@@ -77,8 +77,8 @@
+         solutionstring = 'LoveSolution'
+     elif solutionstring.lower() == 'esa':
+         solutionstring = 'EsaSolution'
+-    elif solutionstring.lower() == 'slr' or solutionstring.lower() == 'sealevelrise':
+-        solutionstring = 'SealevelriseSolution'
++    elif solutionstring.lower() == 'slc' or solutionstring.lower() == 'sealevelchange':
++        solutionstring = 'SealevelchangeSolution'
+     else:
+         raise ValueError("solutionstring '%s' not supported!" % solutionstring)
+     options = pairoptions('solutionstring', solutionstring, *args)
Index: /issm/oecreview/Archive/25834-26739/ISSM-25955-25956.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25955-25956.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25955-25956.diff	(revision 26740)
@@ -0,0 +1,2521 @@
+Index: ../trunk-jpl/src/c/main/issm_slr.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/issm_slr.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/main/issm_slr.cpp	(nonexistent)
+@@ -1,135 +0,0 @@
+-/*!\file:  issm_slr.cpp
+- * \brief: ISSM SLR main program. 
+- */ 
+-
+-#include "./issm.h"
+-#include <stdlib.h>
+-
+-int main(int argc,char **argv){
+-
+-	/*diverse:*/
+-	int    nummodels;
+-	int*   commsizes=NULL;
+-	int*   rankzeros=NULL;
+-	char** dirnames=NULL;
+-	char** modelnames=NULL;
+-	int    modelid; 
+-	int    earthid; 
+-	int    my_rank;
+-	int    count=0;
+-	ISSM_MPI_Comm worldcomm;
+-	ISSM_MPI_Comm modelcomm;
+-	ISSM_MPI_Comm toearthcomm;
+-	ISSM_MPI_Comm* fromicecomms=NULL;
+-
+-	/*Initialize exception trapping: */
+-	ExceptionTrapBegin();
+-
+-	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
+-	worldcomm=EnvironmentInit(argc,argv);
+-
+-	/*What is my rank?:*/
+-	ISSM_MPI_Comm_rank(worldcomm,&my_rank);
+-
+-	/*How many models are we going to run (along with description and number of dedicated cores):{{{*/
+-	nummodels=(int) strtol(argv[4], (char **)NULL, 10);
+-	commsizes=xNew<int>(nummodels);
+-	dirnames=xNew<char*>(nummodels);
+-	modelnames=xNew<char*>(nummodels);
+-	rankzeros=xNew<int>(nummodels);
+-	for(int i=0;i<nummodels;i++){
+-		char* string=NULL;
+-
+-		string=xNew<char>(strlen(argv[5+3*i])+1);
+-		xMemCpy<char>(string,argv[5+3*i],strlen(argv[5+3*i])+1);
+-		dirnames[i]=string;
+-
+-		string=xNew<char>(strlen(argv[5+3*i+1])+1);
+-		xMemCpy<char>(string,argv[5+3*i+1],strlen(argv[5+3*i+1])+1);
+-		modelnames[i]=string;
+-
+-		commsizes[i]=(int) strtol(argv[5+3*i+2], (char **)NULL, 10);
+-	}
+-
+-	/*Figure out which model each cpu will belong to: */
+-	count=0;
+-	for(int i=0;i<nummodels;i++){
+-		if(my_rank>=count && my_rank<(count+commsizes[i])){
+-			modelid=i;
+-			break;
+-		}
+-		count+=commsizes[i];
+-	} 
+-	/*Buil array of who is rank 0 of their own group:*/
+-	count=0;
+-	for(int i=0;i<nummodels;i++){
+-		rankzeros[i]=count;
+-		count+=commsizes[i];
+-	}
+-	/*}}}*/
+-
+-	/*Split world into sub-communicators for each and every model:*/
+-	ISSM_MPI_Comm_split(worldcomm,modelid, my_rank, &modelcomm);
+-
+-	/*Build inter communicators:*/
+-	earthid=nummodels-1; //last model to be provided in the argument list if the earth model.
+-	if(modelid==earthid){
+-		fromicecomms=xNew<ISSM_MPI_Comm>(nummodels-1);
+-		for(int i=0;i<earthid;i++){
+-			ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[i], i, fromicecomms+i); //communicate from local erth comm 9rank 0) to ice comm (rank 0) using modelid tag.
+-		}
+-	}
+-	else{
+-		ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[earthid], modelid, &toearthcomm); //communicate from local ice comm (rank 0) to earth comm (rank 0) using modelid tag.
+-	}
+-
+-	/*Supply specific argc and argv for each sub-communicator (corresponding to each  model specificatiions):{{{*/
+-	char** arguments=xNew<char*>(4);
+-	arguments[0]=xNew<char>(strlen(argv[0])+1); xMemCpy<char>(arguments[0],argv[0],strlen(argv[0])+1); //executable name
+-	arguments[1]=xNew<char>(strlen(argv[1])+1); xMemCpy<char>(arguments[1],argv[1],strlen(argv[1])+1); //solution name
+-	arguments[2]=xNew<char>(strlen(argv[5+3*modelid])+1); xMemCpy<char>(arguments[2],argv[5+3*modelid],strlen(argv[5+3*modelid])+1); //directory name
+-	arguments[3]=xNew<char>(strlen(argv[5+3*modelid+1])+1); xMemCpy<char>(arguments[3],argv[5+3*modelid+1],strlen(argv[5+3*modelid+1])+1); //model name
+-	/*}}}*/
+-
+-	/*Initialize femmodel from arguments provided command line: */
+-	FemModel *femmodel = new FemModel(4,arguments,modelcomm);
+-
+-	/*Now that the models are initialized, keep communicator information in the parameters datasets of each model: */
+-	femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(worldcomm,WorldCommEnum));
+-	femmodel->parameters->AddObject(new IntParam(NumModelsEnum,nummodels));
+-	femmodel->parameters->AddObject(new IntParam(ModelIdEnum,modelid));
+-	femmodel->parameters->AddObject(new IntParam(EarthIdEnum,earthid));
+-	if(modelid==earthid) femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm*>(fromicecomms,IcecapToEarthCommEnum));
+-	else femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(toearthcomm,IcecapToEarthCommEnum));
+-
+-	/*Solve: */
+-	femmodel->Solve();
+-
+-	/*Output results: */
+-	OutputResultsx(femmodel);
+-
+-	/*Wrap up: */
+-	femmodel->CleanUp();
+-
+-	/*Delete Model: */
+-	delete femmodel;
+-
+-	/*Finalize environment:*/
+-	EnvironmentFinalize();
+-
+-	/*Finalize exception trapping: */
+-	ExceptionTrapEnd();
+-
+-	/*Free ressources:*/
+-	xDelete<int>(commsizes);
+-	for(int i=0;i<nummodels;i++){
+-		char* string=NULL;
+-		string=dirnames[i]; xDelete<char>(string);
+-		string=modelnames[i]; xDelete<char>(string);
+-	}
+-	xDelete<char*>(dirnames);
+-	xDelete<char*>(modelnames);
+-
+-	/*Return unix success: */
+-	return 0; 
+-}
+Index: ../trunk-jpl/src/m/classes/slr.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/slr.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/slr.m	(nonexistent)
+@@ -1,257 +0,0 @@
+-%SLR class definition
+-%
+-%   Usage:
+-%      slr=slr();
+-
+-classdef slr
+-	properties (SetAccess=public) 
+-		deltathickness         = NaN;
+-		sealevel               = NaN;
+-		spcthickness           = NaN;
+-		maxiter                = 0;
+-		reltol                 = 0;
+-		abstol                 = 0;
+-		love_h                 = 0; %provided by PREM model
+-		love_k                 = 0; %ideam
+-		love_l                 = 0; %ideam
+-		tide_love_k            = 0; %ideam
+-		tide_love_h            = 0; %ideam
+-		fluid_love             = 0;
+-		equatorial_moi         = 0;
+-		polar_moi              = 0;
+-		angular_velocity       = 0;
+-		rigid                  = 0;
+-		elastic                = 0;
+-		rotation               = 0;
+-		ocean_area_scaling     = 0;
+-		hydro_rate             = 0; %rate of steric expansion from hydrological effects.
+-		geodetic_run_frequency = 1; %how many time steps we skip before we run the geodetic part of the solver during transient
+-		geodetic               = 0; %compute geodetic SLR? (in addition to steric?)
+-		degacc                 = 0;
+-		horiz                  = 0;
+-		planetradius           = planetradius('earth');
+-		requested_outputs      = {};
+-		transitions            = {};
+-	end
+-	methods
+-		function self = slr(varargin) % {{{
+-			switch nargin
+-				case 0
+-					self=setdefaultparameters(self);
+-				otherwise
+-					error('constructor not supported');
+-			end
+-		end % }}}
+-		function self = setdefaultparameters(self) % {{{
+-		
+-		%Convergence criterion: absolute, relative and residual
+-		self.reltol=0.01; % 1 per cent 
+-		self.abstol=NaN;  % default 
+-
+-		%maximum of non-linear iterations.
+-		self.maxiter=5;
+-
+-		%computational flags: 
+-		self.geodetic=0;
+-		self.rigid=1;
+-		self.elastic=1;
+-		self.ocean_area_scaling=0;
+-		self.rotation=1;
+-
+-		%tidal love numbers: 
+-		self.tide_love_h=0.6149; %degree 2
+-		self.tide_love_k=0.3055; % degree 2
+-	
+-		%secular fluid love number: 
+-		self.fluid_love=0.942; 
+-		
+-		%moment of inertia: 
+-		self.equatorial_moi=8.0077*10^37; % [kg m^2] 
+-		self.polar_moi		 =8.0345*10^37; % [kg m^2] 
+-
+-		% mean rotational velocity of earth 
+-		self.angular_velocity=7.2921*10^-5; % [s^-1] 
+-
+-		%numerical discretization accuracy
+-		self.degacc=.01;
+-
+-		%hydro
+-		self.hydro_rate=0;
+-	
+-		%how many time steps we skip before we run SLR solver during transient
+-		self.geodetic_run_frequency=1;
+-	
+-		%output default:
+-		self.requested_outputs={'default'};
+-
+-		%transitions should be a cell array of vectors: 
+-		self.transitions={};
+-
+-		%horizontal displacement?  (not by default)
+-		self.horiz=0;
+-
+-		%earth area
+-		self.planetradius= planetradius('earth');
+-		
+-		end % }}}
+-		function md = checkconsistency(self,md,solution,analyses) % {{{
+-
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
+-				return; 
+-			end
+-
+-			%md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
+-			md = checkfield(md,'fieldname','slr.deltathickness','timeseries',1,'NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+-			md = checkfield(md,'fieldname','slr.spcthickness','Inf',1,'timeseries',1);
+-			md = checkfield(md,'fieldname','slr.love_h','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.love_k','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.love_l','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.tide_love_h','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.tide_love_k','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.fluid_love','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.equatorial_moi','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.polar_moi','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.angular_velocity','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','slr.reltol','size',[1 1]);
+-			md = checkfield(md,'fieldname','slr.abstol','size',[1 1]);
+-			md = checkfield(md,'fieldname','slr.maxiter','size',[1 1],'>=',1);
+-			md = checkfield(md,'fieldname','slr.geodetic_run_frequency','size',[1 1],'>=',1);
+-			md = checkfield(md,'fieldname','slr.hydro_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+-			md = checkfield(md,'fieldname','slr.degacc','size',[1 1],'>=',1e-10);
+-			md = checkfield(md,'fieldname','slr.requested_outputs','stringrow',1);
+-			md = checkfield(md,'fieldname','slr.horiz','NaN',1,'Inf',1,'values',[0 1]);
+-
+-			%check that love numbers are provided at the same level of accuracy: 
+-			if (size(self.love_h,1)~=size(self.love_k,1) | size(self.love_h,1)~=size(self.love_l,1)),
+-				error('slr error message: love numbers should be provided at the same level of accuracy');
+-			end
+-
+-			%cross check that whereever we have an ice load, the mask is <0 on each vertex: 
+-			%pos=find(self.deltathickness);
+-			%maskpos=md.mask.ice_levelset(md.mesh.elements(pos,:)); 
+-			%[els,vertices]=find(maskpos>0);
+-			%if length(els),
+-			%	warning('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!');
+-			%end
+-
+-			%check that if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, 
+-			%a coupler to a planet model is provided. 
+-			if self.geodetic,
+-				if md.transient.iscoupler, 
+-					%we are good; 
+-				else
+-					if strcmpi(class(md.mesh),'mesh3dsurface'),
+-						%we are good
+-					else
+-						error('model is requesting geodetic computations without being a mesh3dsurface, or being coupled to one!');
+-					end
+-				end
+-			end
+-
+-		end % }}}
+-		function list=defaultoutputs(self,md) % {{{
+-			list = {'Sealevel'};
+-		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   slr parameters:'));
+-
+-			fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]');
+-			fielddisplay(self,'sealevel','current sea level (prior to computation) [m]');
+-			fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]');
+-			fielddisplay(self,'reltol','sea level rise relative convergence criterion, (default, NaN: not applied)');
+-			fielddisplay(self,'abstol','sea level rise absolute convergence criterion, NaN: not applied');
+-			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
+-			fielddisplay(self,'love_h','load Love number for radial displacement');
+-			fielddisplay(self,'love_k','load Love number for gravitational potential perturbation');
+-			fielddisplay(self,'love_l','load Love number for horizontal displacements');
+-			fielddisplay(self,'tide_love_k','tidal load Love number (deg 2)');
+-			fielddisplay(self,'tide_love_h','tidal load Love number (deg 2)');
+-			fielddisplay(self,'fluid_love','secular fluid Love number');
+-			fielddisplay(self,'equatorial_moi','mean equatorial moment of inertia [kg m^2]');
+-			fielddisplay(self,'polar_moi','polar moment of inertia [kg m^2]');
+-			fielddisplay(self,'angular_velocity','mean rotational velocity of earth [per second]'); 
+-			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
+-			fielddisplay(self,'hydro_rate','rate of hydrological expansion (in mm/yr)'); 
+-			fielddisplay(self,'geodetic','compute geodetic SLR? ( in addition to steric?) default 0');
+-			fielddisplay(self,'geodetic_run_frequency','how many time steps we skip before we run SLR solver during transient (default: 1)');
+-			fielddisplay(self,'rigid','rigid earth graviational potential perturbation');
+-			fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
+-			fielddisplay(self,'rotation','earth rotational potential perturbation');
+-			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+-			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
+-			fielddisplay(self,'requested_outputs','additional outputs requested');
+-
+-		end % }}}
+-		function marshall(self,prefix,md,fid) % {{{
+-			%WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2);
+-			WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+-			%WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1);
+-			WriteData(fid,prefix,'object',self,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','abstol','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',self,'fieldname','love_k','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',self,'fieldname','love_l','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',self,'fieldname','tide_love_h','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','tide_love_k','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','fluid_love','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','equatorial_moi','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','polar_moi','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','angular_velocity','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','rigid','format','Boolean');
+-			WriteData(fid,prefix,'object',self,'fieldname','elastic','format','Boolean');
+-			WriteData(fid,prefix,'object',self,'fieldname','rotation','format','Boolean');
+-			WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','format','Boolean');
+-			WriteData(fid,prefix,'object',self,'fieldname','geodetic_run_frequency','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','hydro_rate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
+-			WriteData(fid,prefix,'object',self,'fieldname','horiz','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','geodetic','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','planetradius','format','Double');
+-			
+-			%process requested outputs
+-			outputs = self.requested_outputs;
+-			pos  = find(ismember(outputs,'default'));
+-			if ~isempty(pos),
+-				outputs(pos) = [];                         %remove 'default' from outputs
+-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+-			end
+-			WriteData(fid,prefix,'data',outputs,'name','md.slr.requested_outputs','format','StringArray');
+-
+-		end % }}}
+-		function savemodeljs(self,fid,modelname) % {{{
+-		
+-			writejs1Darray(fid,[modelname '.slr.deltathickness'],self.deltathickness);
+-			writejs1Darray(fid,[modelname '.slr.sealevel'],self.sealevel);
+-			writejs1Darray(fid,[modelname '.slr.spcthickness'],self.spcthickness);
+-			writejsdouble(fid,[modelname '.slr.maxiter'],self.maxiter);
+-			writejsdouble(fid,[modelname '.slr.reltol'],self.reltol);
+-			writejsdouble(fid,[modelname '.slr.abstol'],self.abstol);
+-			writejs1Darray(fid,[modelname '.slr.love_h'],self.love_h);
+-			writejs1Darray(fid,[modelname '.slr.love_k'],self.love_k);
+-			writejs1Darray(fid,[modelname '.slr.love_l'],self.love_l);
+-			writejsdouble(fid,[modelname '.slr.tide_love_k'],self.tide_love_k);
+-			writejsdouble(fid,[modelname '.slr.tide_love_h'],self.tide_love_h);
+-			writejsdouble(fid,[modelname '.slr.fluid_love'],self.fluid_love);
+-			writejsdouble(fid,[modelname '.slr.equatorial_moi'],self.equatorial_moi);
+-			writejsdouble(fid,[modelname '.slr.polar_moi'],self.polar_moi);
+-			writejsdouble(fid,[modelname '.slr.angular_velocity'],self.angular_velocity);
+-			writejsdouble(fid,[modelname '.slr.rigid'],self.rigid);
+-			writejsdouble(fid,[modelname '.slr.elastic'],self.elastic);
+-			writejsdouble(fid,[modelname '.slr.rotation'],self.rotation);
+-			writejsdouble(fid,[modelname '.slr.ocean_area_scaling'],self.ocean_area_scaling);
+-			writejsdouble(fid,[modelname '.slr.geodetic_run_frequency'],self.geodetic_run_frequency);
+-			writejs1Darray(fid,[modelname '.slr.hydro_rate'],self.hydro_rate);
+-			writejsdouble(fid,[modelname '.slr.degacc'],self.degacc);
+-			writejscellstring(fid,[modelname '.slr.requested_outputs'],self.requested_outputs);
+-			writejscellarray(fid,[modelname '.slr.transitions'],self.transitions);
+-		end % }}}
+-		function self = extrude(self,md) % {{{
+-			self.sealevel=project3d(md,'vector',self.sealevel,'type','node');
+-		end % }}}
+-	end
+-end
+Index: ../trunk-jpl/src/m/classes/nodalvalue.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/nodalvalue.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/nodalvalue.m	(revision 25956)
+@@ -2,9 +2,9 @@
+ %
+ %   Usage:
+ %      nodalvalue=nodalvalue();
+-%      nodalvalue=nodalvalue('name','SealevelriseSNodalValue',...
++%      nodalvalue=nodalvalue('name','SealevelchangeSNodalValue',...
+ %                    'definitionstring','Outputdefinition1', 
+-%                    'model_string','SealevelriseS',
++%                    'model_string','SealevelchangeS',
+ %                    'node',1);
+ 
+ classdef nodalvalue
+Index: ../trunk-jpl/src/m/classes/qmustatistics.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/qmustatistics.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/qmustatistics.m	(revision 25956)
+@@ -13,7 +13,7 @@
+ 		method = struct('name',{'None'},'fields',{[]},'steps',{[]},'nbins',{NaN},'indices',{[]});
+ 
+ 		%name: name of method, one of 'None','Histogram','SampleSeries' or 'MeanVariance'
+-		%fields: fields for the  statistics being requested, ex: 'Sealevel','BslrIce','BslrHydro'
++		%fields: fields for the  statistics being requested, ex: 'Sealevel','BslcIce','BslcHydro'
+ 		%steps: time steps at which each field statistic is computed, ex: [1:2,5,20] or 1:100
+ 		%nbins: number of bins for 'Histogram' statistics
+ 		%indices: vertex indices at which to retrieve samples
+Index: ../trunk-jpl/src/m/classes/toolkits.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/toolkits.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/toolkits.m	(revision 25956)
+@@ -104,7 +104,7 @@
+ 					case 'DamageEvolutionAnalysis'
+ 					case 'LoveAnalysis'
+ 					case 'EsaAnalysis'
+-					case 'SealevelriseAnalysis'
++					case 'SealevelchangeAnalysis'
+ 					otherwise
+ 						md = checkmessage(md,['md.toolkits.' analyses{i} ' not supported yet']);
+ 				end
+Index: ../trunk-jpl/test/NightlyRun/GetIds.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/GetIds.py	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/GetIds.py	(revision 25956)
+@@ -14,8 +14,8 @@
+         ids = GetIds(101)
+         ids = GetIds('Dakota')
+         ids = GetIds([101, 102...])
+-        ids = GetIds([\'Dakota\', \'Slr\'...])
+-        ids = GetIds([[101, 102...], [\'Dakota\', \'Slr\'...]])
++        ids = GetIds([\'Dakota\', \'Slc\'...])
++        ids = GetIds([[101, 102...], [\'Dakota\', \'Slc\'...]])
+     """
+ 
+     ids = []
+Index: ../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/runme.m	(revision 25956)
+@@ -20,7 +20,7 @@
+ %                      'mesh'        : validation of mesh tests
+ %                      'qmu'         : validation of dakota tests
+ %                      'referential' : validation of referential tests
+-%                      'slr'         : validation of slr tests
++%                      'slc'         : validation of slc tests
+ %                      'thermal'     : validation of thermal tests
+ %                      'tranforcing' : validation of transient forcing tests
+ %                      ...
+@@ -53,7 +53,7 @@
+ %Process options
+ %GET benchmark {{{
+ benchmark=getfieldvalue(options,'benchmark','nightly');
+-if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr','qmu'})
++if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slc','qmu'})
+ 	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
+ 	benchmark='nightly';
+ end
+@@ -121,7 +121,7 @@
+ 	test_ids=intersect(test_ids,[1501:1502]);
+ elseif strcmpi(benchmark,'referential'),
+ 	test_ids=intersect(test_ids,[1601:1602]);
+-elseif strcmpi(benchmark,'slr'),
++elseif strcmpi(benchmark,'slc'),
+ 	test_ids=intersect(test_ids,[2001:2500]);
+ elseif strcmpi(benchmark,'adolc'),
+ 	test_ids=intersect(test_ids,[3001:3200]);
+Index: ../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.py	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/runme.py	(revision 25956)
+@@ -46,7 +46,7 @@
+                             'mesh'          : validation of mesh tests
+                             'qmu'           : validation of qmu tests
+                             'referential'   : validation of referential tests
+-                            'slr'           : validation of slr tests
++                            'slc'           : validation of slc tests
+                             'thermal'       : validation of thermal tests
+                             'tranforcing'   : validation of transient forcing tests
+ 
+@@ -62,7 +62,7 @@
+         ./runme.py -i 'SquareShelf'
+         ./runme.py -e 2001
+         ./runme.py -e 'Dakota' --benchmark 'all'
+-        ./runme.py -i [[101, 102], ['Dakota', 'Slr']]
++        ./runme.py -i [[101, 102], ['Dakota', 'Slc']]
+ 
+     TODO:
+     - At '#disp test result', make sure precision of output matches that of 
+@@ -75,7 +75,7 @@
+ 
+     #Process options
+     #GET benchmark {{{
+-    if benchmark not in ['all', 'nightly', 'validation', 'adolc', 'eismint', 'ismip', 'mesh', 'slr', 'thermal', 'tranforcing', 'qmu']:
++    if benchmark not in ['all', 'nightly', 'validation', 'adolc', 'eismint', 'ismip', 'mesh', 'slc', 'thermal', 'tranforcing', 'qmu']:
+         print(("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark)))
+         benchmark = 'nightly'
+     # }}}
+@@ -128,7 +128,7 @@
+         test_ids = test_ids.intersection(set(range(1501, 1503)))
+     elif benchmark == 'referential':
+         test_ids = test_ids.intersection(set(range(1601, 1603)))
+-    elif benchmark == 'slr':
++    elif benchmark == 'slc':
+         test_ids = test_ids.intersection(set(range(2001, 2500)))
+     elif benchmark == 'adolc':
+         test_ids = test_ids.intersection(set(range(3001, 3200)))
+Index: ../trunk-jpl/src/m/classes/surfaceload.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/surfaceload.m	(revision 25956)
+@@ -27,7 +27,7 @@
+ 		end % }}}
+ 			function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
+ 				return; 
+ 			end
+ 			if ~isempty(self.icethicknesschange),
+Index: ../trunk-jpl/src/m/solve/solveslm.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solveslm.m	(revision 25955)
++++ ../trunk-jpl/src/m/solve/solveslm.m	(revision 25956)
+@@ -6,7 +6,7 @@
+ %      where varargin is a lit of paired arguments of string OR enums
+ %
+ %   solution types available comprise:
+-%      - 'Sealevelrise'
++%      - 'Sealevelchange'
+ %      - 'Transient'
+ %
+ %  extra options:
+@@ -17,8 +17,8 @@
+ %recover and process solve options
+ if strcmpi(solutionstringi,'tr') || strcmpi(solutionstringi,'Transient')
+ 	solutionstring = 'TransientSolution';
+-elseif strcmpi(solutionstringi,'slr') || strcmpi(solutionstringi,'Sealevelrise')
+-	solutionstring = 'SealevelriseSolution';
++elseif strcmpi(solutionstringi,'slr') || strcmpi(solutionstringi,'Sealevelchange')
++	solutionstring = 'SealevelchangeSolution';
+ else
+ 	error(['solutionstring ' solutionstringi ' not supported!']);
+ end
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 25956)
+@@ -1,10 +1,10 @@
+-%Test Name: EarthSlr_rotationalFeedback
++%Test Name: EarthSlc_rotationalFeedback
+ 
+ %mesh earth:
+ md=model;
+ md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',1000.); %1000 km resolution mesh
+ 
+-%parameterize slr solution:
++%parameterize slc solution:
+ %solidearth loading:  {{{
+ md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+ md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 25955)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 25956)
+@@ -757,7 +757,7 @@
+ #Executable {{{
+ if ANDROID
+ if ANDROIDEXE
+-bin_PROGRAMS = issm issm_slr
++bin_PROGRAMS = issm issm_slc
+ else
+ bin_PROGRAMS =
+ endif
+@@ -765,7 +765,7 @@
+ if JAVASCRIPT
+ bin_PROGRAMS =
+ else
+-bin_PROGRAMS = issm issm_slr
++bin_PROGRAMS = issm issm_slc
+ endif
+ endif
+ 
+@@ -785,8 +785,8 @@
+ issm_SOURCES = main/issm.cpp 
+ issm_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
+-issm_slr_SOURCES = main/issm_slr.cpp
+-issm_slr_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
++issm_slc_SOURCES = main/issm_slc.cpp
++issm_slc_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
+ if OCEAN
+ bin_PROGRAMS += issm_ocean
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 25956)
+@@ -23,7 +23,6 @@
+ 
+ 	int geodetic=0;
+ 	int dslmodel=0;
+-	int externalnature=0;
+ 	int isexternal=0;
+ 
+ 	/*Update elements: */
+@@ -170,6 +169,7 @@
+ 	IssmDouble* love_tl=NULL;
+ 	int         dslmodel=0;
+ 	int         externalnature=0;
++	int         isexternal=0;
+ 
+ 	IssmDouble* G_rigid = NULL;
+ 	IssmDouble* G_rigid_local = NULL;
+@@ -197,8 +197,8 @@
+ 	int          ntransitions;
+ 	IssmDouble*  partitionice=NULL;
+ 	IssmDouble*  partitionhydro=NULL;
+-	IssmDouble*  bslrice_partition=NULL;
+-	IssmDouble*  bslrhydro_partition=NULL;
++	IssmDouble*  bslcice_partition=NULL;
++	IssmDouble*  bslchydro_partition=NULL;
+ 	int          npartice,nparthydro,nel;
+ 
+ 
+@@ -205,7 +205,8 @@
+ 	/*some constant parameters: */
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.model",DslModelEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.isexternal",SolidearthIsExternalEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nature",SolidearthExternalNatureEnum));
++	iomodel->FetchData(&isexternal,"md.solidearth.isexternal");
++	if(isexternal) parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nature",SolidearthExternalNatureEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.runfrequency",SolidearthSettingsRunFrequencyEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.reltol",SolidearthSettingsReltolEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.abstol",SolidearthSettingsAbstolEnum));
+@@ -222,10 +223,10 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
+-	parameters->AddObject(new DoubleParam(CumBslrEnum,0.0));
+-	parameters->AddObject(new DoubleParam(CumBslrIceEnum,0.0));
+-	parameters->AddObject(new DoubleParam(CumBslrHydroEnum,0.0));
+-	parameters->AddObject(new DoubleParam(CumGmtslrEnum,0.0));
++	parameters->AddObject(new DoubleParam(CumBslcEnum,0.0));
++	parameters->AddObject(new DoubleParam(CumBslcIceEnum,0.0));
++	parameters->AddObject(new DoubleParam(CumBslcHydroEnum,0.0));
++	parameters->AddObject(new DoubleParam(CumGmtslcEnum,0.0));
+ 
+ 	/*compute planet area and plug into parameters:*/
+ 	iomodel->FetchData(&planetradius,"md.solidearth.planetradius");
+@@ -239,8 +240,8 @@
+ 		iomodel->FetchData(&partitionice,&nel,NULL,"md.solidearth.partitionice");
+ 		parameters->AddObject(new DoubleMatParam(SolidearthPartitionIceEnum,partitionice,nel,1));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.npartice",SolidearthNpartIceEnum));
+-		bslrice_partition=xNewZeroInit<IssmDouble>(npartice);
+-		parameters->AddObject(new DoubleMatParam(CumBslrIcePartitionEnum,bslrice_partition,npartice,1));
++		bslcice_partition=xNewZeroInit<IssmDouble>(npartice);
++		parameters->AddObject(new DoubleMatParam(CumBslcIcePartitionEnum,bslcice_partition,npartice,1));
+ 		xDelete<IssmDouble>(partitionice);
+ 	}
+ 	iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro");
+@@ -249,8 +250,8 @@
+ 		iomodel->FetchData(&partitionhydro,&nel,NULL,"md.solidearth.partitionhydro");
+ 		parameters->AddObject(new DoubleMatParam(SolidearthPartitionHydroEnum,partitionhydro,nel,1));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.nparthydro",SolidearthNpartHydroEnum));
+-		bslrhydro_partition=xNewZeroInit<IssmDouble>(nparthydro);
+-		parameters->AddObject(new DoubleMatParam(CumBslrHydroPartitionEnum,bslrhydro_partition,nparthydro,1));
++		bslchydro_partition=xNewZeroInit<IssmDouble>(nparthydro);
++		parameters->AddObject(new DoubleMatParam(CumBslcHydroPartitionEnum,bslchydro_partition,nparthydro,1));
+ 		xDelete<IssmDouble>(partitionhydro);
+ 	}
+ 
+@@ -273,22 +274,24 @@
+ 		if(modelid<=0 || modelid>nummodels)_error_("modelid field in dslmme object of md.dsl field should be between 1 and the number of ensemble runs!");
+ 	} /*}}}*/
+ 	/*Deal with external multi-model ensembles: {{{*/
+-	iomodel->FetchData(&externalnature,"md.solidearth.external.nature");
+-	if(externalnature>=3){
+-		IssmDouble modelid; 
+-		int nummodels;
+-		
+-		/*create double param, not int param, because Dakota will be updating it as a double potentially: */
+-		iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
+-		parameters->AddObject(new DoubleParam(SolidearthExternalModelidEnum,modelid));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nummodels",SolidearthExternalNummodelsEnum));
+-		iomodel->FetchData(&nummodels,"md.solidearth.external.nummodels");
++	if(isexternal){
++		iomodel->FetchData(&externalnature,"md.solidearth.external.nature");
++		if(externalnature>=3){
++			IssmDouble modelid; 
++			int nummodels;
+ 
+-		/*quick checks: */
+-		if(nummodels<=0)_error_("mme solidearth solution object in  md.solidearth.external field should contain at least 1 ensemble model!");
+-		if(modelid<=0 || modelid>nummodels)_error_("modelid field in md.solidearth.external field should be between 1 and the number of ensemble runs!");
+-	} /*}}}*/
++			/*create double param, not int param, because Dakota will be updating it as a double potentially: */
++			iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
++			parameters->AddObject(new DoubleParam(SolidearthExternalModelidEnum,modelid));
++			parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.external.nummodels",SolidearthExternalNummodelsEnum));
++			iomodel->FetchData(&nummodels,"md.solidearth.external.nummodels");
+ 
++			/*quick checks: */
++			if(nummodels<=0)_error_("mme solidearth solution object in  md.solidearth.external field should contain at least 1 ensemble model!");
++			if(modelid<=0 || modelid>nummodels)_error_("modelid field in md.solidearth.external field should be between 1 and the number of ensemble runs!");
++		} /*}}}*/
++	}
++
+ 	/*Deal with elasticity {{{*/
+ 	iomodel->FetchData(&rigid,"md.solidearth.settings.rigid");
+ 	iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25956)
+@@ -5825,7 +5825,7 @@
+ 	int  glfraction=1;
+ 
+ 	/*output: */
+-	IssmDouble bslrice=0;
++	IssmDouble bslcice=0;
+ 
+ 	/*elastic green function:*/
+ 	IssmDouble* G=NULL;
+@@ -5841,8 +5841,8 @@
+ 		#ifdef _ISSM_DEBUG_
+ 		constant=0; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 		#endif
+-		bslrice=0;
+-		return bslrice;
++		bslcice=0;
++		return bslcice;
+ 	}
+ 
+ 	/*early return if we are fully floating:*/
+@@ -5851,8 +5851,8 @@
+ 		#ifdef _ISSM_DEBUG_
+ 		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 		#endif
+-		bslrice=0;
+-		return bslrice;
++		bslcice=0;
++		return bslcice;
+ 	}
+ 
+ 	/*If we are here, we are on ice that is fully grounded or half-way to floating:*/
+@@ -5923,8 +5923,8 @@
+ 	/*Compute barystatic contribution:*/
+ 	_assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslrice = rho_ice*area*phi*I/(oceanarea*rho_water);
+-	_assert_(!xIsNan<IssmDouble>(bslrice));
++	bslcice = rho_ice*area*phi*I/(oceanarea*rho_water);
++	_assert_(!xIsNan<IssmDouble>(bslcice));
+ 
+ 	if(computerigid){
+ 		/*convert from m to kg/m^2:*/
+@@ -5934,13 +5934,13 @@
+ 		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*I;
+ 	}
+ 
+-	/*Plug bslrice into barystatic contribution vector:*/
++	/*Plug bslcice into barystatic contribution vector:*/
+ 	if(barystatic_contribution){
+ 		id=reCast<int>(partition[this->Sid()])+1;
+-		barystatic_contribution->SetValue(id,bslrice,ADD_VAL);
++		barystatic_contribution->SetValue(id,bslcice,ADD_VAL);
+ 	}
+ 	/*return :*/
+-	return bslrice;
++	return bslcice;
+ }
+ /*}}}*/
+ IssmDouble Tria::SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
+@@ -5962,19 +5962,19 @@
+ 	IssmDouble rho_freshwater;
+ 
+ 	/*output:*/
+-	IssmDouble bslrhydro = 0;
++	IssmDouble bslchydro = 0;
+ 
+ 	/*early return if we are on an ice cap. Nop, we may have hydro
+ 	 * and ice on the same masscon:*/
+ 	/*if(masks->isiceonly[this->lid]){ 
+-		bslrhydro=0;
+-		return bslrhydro; 
++		bslchydro=0;
++		return bslchydro; 
+ 	}*/
+ 
+ 	/*early return if we are fully floating:*/
+ 	if (masks->isfullyfloating[this->lid]){ 
+-		bslrhydro=0;
+-		return bslrhydro; 
++		bslchydro=0;
++		return bslchydro; 
+ 	}
+ 
+ 	/*If we are here, we are on earth, not on ice: */
+@@ -5999,8 +5999,8 @@
+ 	/*Compute barystatic component:*/
+ 	_assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslrhydro = rho_freshwater*area*phi*W/(oceanarea*rho_water);
+-	_assert_(!xIsNan<IssmDouble>(bslrhydro));
++	bslchydro = rho_freshwater*area*phi*W/(oceanarea*rho_water);
++	_assert_(!xIsNan<IssmDouble>(bslchydro));
+ 
+ 	if(computeelastic){
+ 		/*convert from m to kg/m^2:*/
+@@ -6010,13 +6010,13 @@
+ 		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*W;
+ 	}
+ 
+-	/*Plug bslrice into barystatic contribution vector:*/
++	/*Plug bslcice into barystatic contribution vector:*/
+ 	if(barystatic_contribution){
+ 		id=reCast<int>(partition[this->Sid()])+1;
+-		barystatic_contribution->SetValue(id,bslrhydro,ADD_VAL);
++		barystatic_contribution->SetValue(id,bslchydro,ADD_VAL);
+ 	}
+ 	/*output:*/
+-	return bslrhydro;
++	return bslchydro;
+ }
+ /*}}}*/
+ void    Tria::SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 25956)
+@@ -848,7 +848,7 @@
+ 
+ 		case TransientSolutionEnum:{
+ 			/*We have multiple analyses here, process one by one*/
+-			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslr,isesa,isgia;
++			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,isgia;
+ 			iomodel->FindConstant(&isthermal,"md.transient.isthermal");
+ 			iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
+ 			iomodel->FindConstant(&ismasstransport,"md.transient.ismasstransport");
+@@ -857,7 +857,7 @@
+ 			iomodel->FindConstant(&isdamage,"md.transient.isdamageevolution");
+ 			iomodel->FindConstant(&ishydrology,"md.transient.ishydrology");
+ 			iomodel->FindConstant(&issmb,"md.transient.issmb");
+-			iomodel->FindConstant(&isslr,"md.transient.isslr");
++			iomodel->FindConstant(&isslc,"md.transient.isslc");
+ 			iomodel->FindConstant(&isesa,"md.transient.isesa");
+ 			iomodel->FindConstant(&isgia,"md.transient.isgia");
+          int* analyses_iter     = NULL;
+@@ -897,7 +897,7 @@
+ 			if(isdamage){
+ 				analyses_temp[numanalyses++]=DamageEvolutionAnalysisEnum;
+ 			}
+-			if(isslr){
++			if(isslc){
+ 				analyses_temp[numanalyses++]=GiaAnalysisEnum;
+ 				analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
+ 			}
+@@ -4812,25 +4812,25 @@
+ /*}}}*/
+ #endif
+ #ifdef _HAVE_SEALEVELRISE_
+-void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition,SealevelMasks* masks) { /*{{{*/
++void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition,SealevelMasks* masks) { /*{{{*/
+ 
+ 	/*serialized vectors:*/
+-	IssmDouble  bslrice       = 0.;
+-	IssmDouble  bslrice_cpu   = 0.;
+-	IssmDouble  bslrhydro       = 0.;
+-	IssmDouble  bslrhydro_cpu   = 0.;
++	IssmDouble  bslcice       = 0.;
++	IssmDouble  bslcice_cpu   = 0.;
++	IssmDouble  bslchydro       = 0.;
++	IssmDouble  bslchydro_cpu   = 0.;
+ 	IssmDouble  area      = 0.;
+ 	IssmDouble  oceanarea      = 0.;
+ 	IssmDouble  oceanarea_cpu  = 0.;
+ 	int bp_compute_fingerprints= 0;
+ 
+-	Vector<IssmDouble>* bslrice_partition=NULL;
+-	IssmDouble* bslrice_partition_serial=NULL;
++	Vector<IssmDouble>* bslcice_partition=NULL;
++	IssmDouble* bslcice_partition_serial=NULL;
+ 	IssmDouble* partitionice=NULL;
+ 	int npartice,nel; 
+ 
+-	Vector<IssmDouble>* bslrhydro_partition=NULL;
+-	IssmDouble* bslrhydro_partition_serial=NULL;
++	Vector<IssmDouble>* bslchydro_partition=NULL;
++	IssmDouble* bslchydro_partition_serial=NULL;
+ 	IssmDouble* partitionhydro=NULL;
+ 	int nparthydro; 
+ 		
+@@ -4858,28 +4858,28 @@
+ 	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+ 	if(npartice){
+ 		this->parameters->FindParam(&partitionice,&nel,NULL,SolidearthPartitionIceEnum);
+-		bslrice_partition= new Vector<IssmDouble>(npartice);
++		bslcice_partition= new Vector<IssmDouble>(npartice);
+ 	}
+ 
+ 	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
+ 	if(nparthydro){
+ 		this->parameters->FindParam(&partitionhydro,&nel,NULL,SolidearthPartitionHydroEnum);
+-		bslrhydro_partition= new Vector<IssmDouble>(nparthydro);
++		bslchydro_partition= new Vector<IssmDouble>(nparthydro);
+ 	}
+ 
+ 
+ 	/*Call the barystatic sea level change core for ice : */
+-	bslrice_cpu=0;
++	bslcice_cpu=0;
+ 	for(Object* & object : this->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		bslrice_cpu+=element->SealevelchangeBarystaticIce(RSLgi,masks, bslrice_partition,partitionice,oceanarea);
++		bslcice_cpu+=element->SealevelchangeBarystaticIce(RSLgi,masks, bslcice_partition,partitionice,oceanarea);
+ 	}
+ 
+ 	/*Call the barystatic sea level change core for hydro: */
+-	bslrhydro_cpu=0;
++	bslchydro_cpu=0;
+ 	for(int i=0;i<elements->Size();i++){
+ 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-		bslrhydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslrhydro_partition,partitionhydro,oceanarea);
++		bslchydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslchydro_partition,partitionhydro,oceanarea);
+ 	}
+ 
+ 	/*Call the barystatic sea level change core for bottom pressures: */
+@@ -4896,22 +4896,22 @@
+ 	pRSLgi->Assemble();
+ 
+ 	/*Sum all barystatic components from all cpus:*/
+-	ISSM_MPI_Reduce (&bslrice_cpu,&bslrice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&bslrice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(!xIsNan<IssmDouble>(bslrice));
++	ISSM_MPI_Reduce (&bslcice_cpu,&bslcice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&bslcice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	_assert_(!xIsNan<IssmDouble>(bslcice));
+ 
+-	ISSM_MPI_Reduce (&bslrhydro_cpu,&bslrhydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&bslrhydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(!xIsNan<IssmDouble>(bslrhydro));
++	ISSM_MPI_Reduce (&bslchydro_cpu,&bslchydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&bslchydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	_assert_(!xIsNan<IssmDouble>(bslchydro));
+ 
+ 	/*Take care of partition vectors:*/
+-	if(bslrice_partition){
+-		bslrice_partition->Assemble();
+-		bslrice_partition_serial=bslrice_partition->ToMPISerial();
++	if(bslcice_partition){
++		bslcice_partition->Assemble();
++		bslcice_partition_serial=bslcice_partition->ToMPISerial();
+ 	}
+-	if(bslrhydro_partition){
+-		bslrhydro_partition->Assemble();
+-		bslrhydro_partition_serial=bslrhydro_partition->ToMPISerial();
++	if(bslchydro_partition){
++		bslchydro_partition->Assemble();
++		bslchydro_partition_serial=bslchydro_partition->ToMPISerial();
+ 	}
+ 
+ 
+@@ -4918,18 +4918,18 @@
+ 	/*Free ressources:*/
+ 	xDelete<int>(indices);
+ 	xDelete<IssmDouble>(RSLgi);
+-	if(bslrhydro_partition)delete bslrhydro_partition;
+-	if(bslrice_partition)delete bslrice_partition;
++	if(bslchydro_partition)delete bslchydro_partition;
++	if(bslcice_partition)delete bslcice_partition;
+ 	if(partitionhydro)xDelete<IssmDouble>(partitionhydro);
+ 	if(partitionice)xDelete<IssmDouble>(partitionice);
+ 
+ 	/*Assign output pointers:*/
+ 	*poceanarea = oceanarea;
+-	*pbslrice  = bslrice;
+-	*pbslrhydro  = bslrhydro;
+-	*pbslr=bslrhydro+bslrice;
+-	*pbslrice_partition=bslrice_partition_serial;
+-	*pbslrhydro_partition=bslrhydro_partition_serial;
++	*pbslcice  = bslcice;
++	*pbslchydro  = bslchydro;
++	*pbslc=bslchydro+bslcice;
++	*pbslcice_partition=bslcice_partition_serial;
++	*pbslchydro_partition=bslchydro_partition_serial;
+ 
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 25955)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 25956)
+@@ -166,7 +166,7 @@
+ 		void EsaGeodetic3D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELRISE_
+-		void SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, IssmDouble** pbslrice_partition,IssmDouble** pbslrhydro_partition, SealevelMasks* masks); 
++		void SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition, SealevelMasks* masks); 
+ 		void SealevelchangeSal(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
+ 		void SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
+ 		void SealevelchangeDeformation(Vector<IssmDouble>* pgeoid,Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 25955)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 25956)
+@@ -80,7 +80,7 @@
+ void TransferForcing(FemModel* femmodel,int forcingenum);
+ void TransferSealevel(FemModel* femmodel,int forcingenum);
+ void EarthMassTransport(FemModel* femmodel);
+-void slrconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
++void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+ 
+ //solution configuration
+ void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype);
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25956)
+@@ -21,7 +21,7 @@
+ 
+ 	/*Parameters, variables:*/
+ 	bool save_results;
+-	bool isslr=0;
++	bool isslc=0;
+ 	bool isgia=0;
+ 	int  grd=0;
+ 	int  isexternal=0;
+@@ -29,7 +29,7 @@
+ 	int solution_type;
+ 
+ 	/*Retrieve parameters:*/
+-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
++	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+@@ -38,12 +38,12 @@
+ 
+ 	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
+ 	if(solution_type==SealevelchangeSolutionEnum){
+-		isslr=1;
++		isslc=1;
+ 		isgia=1;
+ 	}
+ 
+ 	/*Should we be here?:*/
+-	if(!isslr)return;
++	if(!isslc)return;
+ 
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("   computing sea level change\n");
+@@ -114,21 +114,21 @@
+ 	int modelid=-1;
+    
+ 	/*parameters: */
+-	bool isslr=0;
++	bool isslc=0;
+ 	int  solution_type;
+ 	IssmDouble          dt;
+ 
+ 	/*Retrieve parameters:*/
+-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
++	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 
+ 	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
+-	if(solution_type==SealevelchangeSolutionEnum)isslr=1;
++	if(solution_type==SealevelchangeSolutionEnum)isslc=1;
+ 
+ 	/*Should we be here?:*/
+-	if(!isslr)return;
++	if(!isslc)return;
+ 
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing external solid earth contributions\n");
+@@ -330,26 +330,26 @@
+ 	Vector<IssmDouble> *dynamic_rate_g = NULL;
+ 
+ 	/*parameters: */
+-	bool isslr=0;
++	bool isslc=0;
+ 	int  solution_type;
+ 	IssmDouble          dt;
+ 	int  step;
+ 	IssmDouble time;
+ 
+-	IssmDouble cumgmtslr=0;
+-	IssmDouble cumbslr=0;
+-	IssmDouble cumgmslr=0;
+-	IssmDouble gmtslr=0;
++	IssmDouble cumgmtslc=0;
++	IssmDouble cumbslc=0;
++	IssmDouble cumgmslc=0;
++	IssmDouble gmtslc=0;
+ 
+ 	/*Retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
++	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	
+ 	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
+-	if(solution_type==SealevelchangeSolutionEnum)isslr=1;
++	if(solution_type==SealevelchangeSolutionEnum)isslc=1;
+ 
+ 	/*Should we be here?:*/
+-	if(!isslr)return;
++	if(!isslc)return;
+ 
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing steric sea level change\n");
+@@ -365,23 +365,23 @@
+ 	sealevel->AXPY(dynamic_rate_g,dt);
+ 
+ 	/*cumulate thermal steric rate:*/
+-	femmodel->parameters->FindParam(&cumgmtslr,CumGmtslrEnum); 
+-	femmodel->parameters->FindParam(&cumbslr,CumBslrEnum); 
++	femmodel->parameters->FindParam(&cumgmtslc,CumGmtslcEnum); 
++	femmodel->parameters->FindParam(&cumbslc,CumBslcEnum); 
+ 
+-	gmtslr=steric_rate_g->Max()*dt;
+-	cumgmtslr+=gmtslr;
+-	cumgmslr=cumbslr+cumgmtslr;
++	gmtslc=steric_rate_g->Max()*dt;
++	cumgmtslc+=gmtslc;
++	cumgmslc=cumbslc+cumgmtslc;
+ 
+-	femmodel->parameters->SetParam(cumgmtslr,CumGmtslrEnum);
+-	femmodel->parameters->SetParam(cumgmslr,CumGmslrEnum);
++	femmodel->parameters->SetParam(cumgmtslc,CumGmtslcEnum);
++	femmodel->parameters->SetParam(cumgmslc,CumGmslcEnum);
+ 	
+ 	/*Outputs some metrics:*/
+ 	femmodel->parameters->FindParam(&step,StepEnum);
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+ 
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,GmtslrEnum,gmtslr,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmtslrEnum,cumgmtslr,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmslrEnum,cumgmslr,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,GmtslcEnum,gmtslc,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmtslcEnum,cumgmtslc,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmslcEnum,cumgmslc,step,time));
+ 
+ 	/*update element inputs:*/
+ 	InputUpdateFromVectorx(femmodel,sealevel,SealevelEnum,VertexSIdEnum);	
+@@ -479,20 +479,20 @@
+ 	IssmDouble time;
+ 
+ 	/*barystatic contribution:*/
+-	IssmDouble bslr;
+-	IssmDouble bslrice;
+-	IssmDouble* bslrice_partition=NULL;
+-	IssmDouble bslrhydro;
+-	IssmDouble* bslrhydro_partition=NULL;
+-	IssmDouble cumbslr;
+-	IssmDouble cumbslrice;
+-	IssmDouble cumbslrhydro;
+-	IssmDouble* cumbslrice_partition=NULL;
++	IssmDouble bslc;
++	IssmDouble bslcice;
++	IssmDouble* bslcice_partition=NULL;
++	IssmDouble bslchydro;
++	IssmDouble* bslchydro_partition=NULL;
++	IssmDouble cumbslc;
++	IssmDouble cumbslcice;
++	IssmDouble cumbslchydro;
++	IssmDouble* cumbslcice_partition=NULL;
+ 	int npartice;
+-	IssmDouble* cumbslrhydro_partition=NULL;
++	IssmDouble* cumbslchydro_partition=NULL;
+ 	int nparthydro;
+ 	
+-	if(VerboseSolution()) _printf0_("	  computing bslr components on ice\n");
++	if(VerboseSolution()) _printf0_("	  computing bslc components on ice\n");
+ 
+ 	/*Figure out size of g-set deflection vector and allocate solution vector: */
+ 	gsize = femmodel->nodes->NumberOfDofs(GsetEnum);
+@@ -500,56 +500,56 @@
+ 	/*some parameters:*/
+ 	femmodel->parameters->FindParam(&step,StepEnum);
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+-	femmodel->parameters->FindParam(&cumbslr,CumBslrEnum);
+-	femmodel->parameters->FindParam(&cumbslrice,CumBslrIceEnum);
+-	femmodel->parameters->FindParam(&cumbslrhydro,CumBslrHydroEnum);
++	femmodel->parameters->FindParam(&cumbslc,CumBslcEnum);
++	femmodel->parameters->FindParam(&cumbslcice,CumBslcIceEnum);
++	femmodel->parameters->FindParam(&cumbslchydro,CumBslcHydroEnum);
+ 	femmodel->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+ 	femmodel->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
+-	if(npartice) femmodel->parameters->FindParam(&cumbslrice_partition,&npartice,NULL,CumBslrIcePartitionEnum);
+-	if(nparthydro) femmodel->parameters->FindParam(&cumbslrhydro_partition,&nparthydro,NULL,CumBslrHydroPartitionEnum);
++	if(npartice) femmodel->parameters->FindParam(&cumbslcice_partition,&npartice,NULL,CumBslcIcePartitionEnum);
++	if(nparthydro) femmodel->parameters->FindParam(&cumbslchydro_partition,&nparthydro,NULL,CumBslcHydroPartitionEnum);
+ 
+ 	/*Initialize:*/
+ 	RSLgi = new Vector<IssmDouble>(gsize);
+ 
+-	/*call the bslr main module: */
+-	femmodel->SealevelchangeBarystatic(RSLgi,&oceanarea,&bslr, &bslrice, &bslrhydro, &bslrice_partition, &bslrhydro_partition,masks); //this computes 
++	/*call the bslc main module: */
++	femmodel->SealevelchangeBarystatic(RSLgi,&oceanarea,&bslc, &bslcice, &bslchydro, &bslcice_partition, &bslchydro_partition,masks); //this computes 
+ 
+ 	/*we need to average RSLgi over the ocean: RHS term  4 in Eq.4 of Farrel and clarke. Only the elements can do that: */
+ 	RSLgi_oceanaverage=femmodel->SealevelchangeOceanAverage(RSLgi,masks, oceanarea);
+ 
+-	/*RSLg is the sum of the pure bslr component (term 3) and the contribution from the perturbation to the graviation potential due to the 
++	/*RSLg is the sum of the pure bslc component (term 3) and the contribution from the perturbation to the graviation potential due to the 
+ 	 * presence of ice (terms 1 and 4 in Eq.4 of Farrel and Clarke):*/
+-	RSLgi->Shift(-bslr-RSLgi_oceanaverage);
++	RSLgi->Shift(-bslc-RSLgi_oceanaverage);
+ 
+-	/*save bslr and cumulated bslr value for results:{{{ */
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslrEnum,-bslr,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslrIceEnum,-bslrice,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslrHydroEnum,-bslrhydro,step,time));
++	/*save bslc and cumulated bslc value for results:{{{ */
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslcEnum,-bslc,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslcIceEnum,-bslcice,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslcHydroEnum,-bslchydro,step,time));
+ 
+ 	//cumulative barystatic contribution: 
+-	cumbslr=cumbslr-bslr;
+-	cumbslrice=cumbslrice-bslrice;
+-	cumbslrhydro=cumbslrhydro-bslrhydro;
++	cumbslc=cumbslc-bslc;
++	cumbslcice=cumbslcice-bslcice;
++	cumbslchydro=cumbslchydro-bslchydro;
+ 
+-	femmodel->parameters->SetParam(cumbslr,CumBslrEnum);
+-	femmodel->parameters->SetParam(cumbslrice,CumBslrIceEnum);
+-	femmodel->parameters->SetParam(cumbslrhydro,CumBslrHydroEnum);
++	femmodel->parameters->SetParam(cumbslc,CumBslcEnum);
++	femmodel->parameters->SetParam(cumbslcice,CumBslcIceEnum);
++	femmodel->parameters->SetParam(cumbslchydro,CumBslcHydroEnum);
+ 
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslrEnum,cumbslr,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslrIceEnum,cumbslrice,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslrHydroEnum,cumbslrhydro,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslcEnum,cumbslc,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslcIceEnum,cumbslcice,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslcHydroEnum,cumbslchydro,step,time));
+ 
+ 	//cumulative barystatic contributions by partition:
+ 	if(npartice){
+-		for(int i=0;i<npartice;i++) cumbslrice_partition[i] -= bslrice_partition[i];
+-		femmodel->parameters->SetParam(cumbslrice_partition,npartice,1,CumBslrIcePartitionEnum);
+-		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslrIcePartitionEnum,cumbslrice_partition,npartice,1,step,time));
++		for(int i=0;i<npartice;i++) cumbslcice_partition[i] -= bslcice_partition[i];
++		femmodel->parameters->SetParam(cumbslcice_partition,npartice,1,CumBslcIcePartitionEnum);
++		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslcIcePartitionEnum,cumbslcice_partition,npartice,1,step,time));
+ 	}
+ 
+ 	if(nparthydro){
+-		for(int i=0;i<nparthydro;i++) cumbslrhydro_partition[i] -= bslrhydro_partition[i];
+-		femmodel->parameters->SetParam(cumbslrhydro_partition,nparthydro,1,CumBslrHydroPartitionEnum);
+-		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslrHydroPartitionEnum,cumbslrhydro_partition,nparthydro,1,step,time));
++		for(int i=0;i<nparthydro;i++) cumbslchydro_partition[i] -= bslchydro_partition[i];
++		femmodel->parameters->SetParam(cumbslchydro_partition,nparthydro,1,CumBslcHydroPartitionEnum);
++		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslcHydroPartitionEnum,cumbslchydro_partition,nparthydro,1,step,time));
+ 	}
+ 	/*}}}*/
+ 	
+@@ -644,7 +644,7 @@
+ 		RSLg->Shift(-RSLgo_oceanaverage);
+ 
+ 		/*convergence criterion:*/
+-		slrconvergence(&converged,RSLg,RSLg_old,eps_rel,eps_abs);
++		slcconvergence(&converged,RSLg,RSLg_old,eps_rel,eps_abs);
+ 		
+ 	
+ 		/*free ressources: */
+@@ -1103,7 +1103,7 @@
+ 	_error_("EarthMassTransport error message: not supported anymore!");
+ 
+ 	/*This mass transport module for the Earth is because we might have thickness variations as spcs 
+-	 * specified in the md.slr class, outside of what we will get from the icecaps. That's why we get t
++	 * specified in the md.solidearth class, outside of what we will get from the icecaps. That's why we get t
+ 	 * the thickness variations from SealevelchangeSpcthicknessEnum.*/
+ 
+ 	/*No mass transport module was called, so we are just going to retrieve the geometry thickness 
+@@ -1134,7 +1134,7 @@
+ 	delete cumdeltathickness;*/
+ 
+ } /*}}}*/
+-void slrconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs){ /*{{{*/
++void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs){ /*{{{*/
+ 
+ 	bool converged=true;
+ 	IssmDouble ndS,nS; 
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 25956)
+@@ -23,7 +23,7 @@
+ 
+ 	/*parameters: */
+ 	IssmDouble finaltime,dt,yts;
+-	bool       isoceancoupling,iscontrol,isautodiff,isslr;
++	bool       isoceancoupling,iscontrol,isautodiff,isslc;
+ 	int        timestepping;
+ 	int        output_frequency,checkpoint_frequency;
+ 	int        amr_frequency,amr_restart;
+@@ -44,7 +44,7 @@
+ 	femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	femmodel->parameters->FindParam(&output_frequency,SettingsOutputFrequencyEnum);
+ 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
+-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
++	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
+ 	femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
+ 	femmodel->parameters->FindParam(&iscontrol,InversionIscontrolEnum);
+@@ -61,7 +61,7 @@
+ 	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
+ 	#endif
+ 
+-	if(isslr) sealevelchange_geometry(femmodel);
++	if(isslc) sealevelchange_geometry(femmodel);
+ 
+ 	while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
+ 
+@@ -138,7 +138,7 @@
+ 
+ 	/*parameters: */
+ 	bool isstressbalance,ismasstransport,issmb,isthermal,isgroundingline,isgia,isesa;
+-	bool isslr,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,save_results;
++	bool isslc,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,save_results;
+ 	int  step,sb_coupling_frequency;
+ 	int  domaintype,numoutputs;
+ 
+@@ -153,7 +153,7 @@
+ 	femmodel->parameters->FindParam(&isthermal,TransientIsthermalEnum);
+ 	femmodel->parameters->FindParam(&isgia,TransientIsgiaEnum);
+ 	femmodel->parameters->FindParam(&isesa,TransientIsesaEnum);
+-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
++	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
+ 	femmodel->parameters->FindParam(&ismovingfront,TransientIsmovingfrontEnum);
+ 	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
+@@ -235,7 +235,7 @@
+ 	if(isesa) esa_core(femmodel);
+ 
+ 	/*Sea level change: */
+-	if(isslr){
++	if(isslc){
+ 		if(VerboseSolution()) _printf0_("   computing sea level change\n");
+ 		sealevelchange_core(femmodel);
+ 	}
+@@ -259,7 +259,7 @@
+ 	/*parameters: */
+ 	IssmDouble output_value;
+ 	IssmDouble finaltime,dt,yts,time;
+-	bool       isoceancoupling,isslr;
++	bool       isoceancoupling,isslc;
+ 	int        step,timestepping;
+ 	int        checkpoint_frequency;
+ 
+@@ -272,9 +272,9 @@
+ 	femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 	femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
+-	femmodel->parameters->FindParam(&isslr,TransientIsslrEnum);
++	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&checkpoint_frequency,SettingsCheckpointFrequencyEnum); _assert_(checkpoint_frequency>0);
+-	if(isslr) sealevelchange_geometry(femmodel);
++	if(isslc) sealevelchange_geometry(femmodel);
+ 
+ 	std::vector<IssmDouble> time_all;
+ 	std::vector<IssmDouble> dt_all;
+Index: ../trunk-jpl/src/c/main/issm_slc.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/issm_slc.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/main/issm_slc.cpp	(revision 25956)
+@@ -0,0 +1,135 @@
++/*!\file:  issm_slc.cpp
++ * \brief: ISSM SLR main program. 
++ */ 
++
++#include "./issm.h"
++#include <stdlib.h>
++
++int main(int argc,char **argv){
++
++	/*diverse:*/
++	int    nummodels;
++	int*   commsizes=NULL;
++	int*   rankzeros=NULL;
++	char** dirnames=NULL;
++	char** modelnames=NULL;
++	int    modelid; 
++	int    earthid; 
++	int    my_rank;
++	int    count=0;
++	ISSM_MPI_Comm worldcomm;
++	ISSM_MPI_Comm modelcomm;
++	ISSM_MPI_Comm toearthcomm;
++	ISSM_MPI_Comm* fromicecomms=NULL;
++
++	/*Initialize exception trapping: */
++	ExceptionTrapBegin();
++
++	/*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/
++	worldcomm=EnvironmentInit(argc,argv);
++
++	/*What is my rank?:*/
++	ISSM_MPI_Comm_rank(worldcomm,&my_rank);
++
++	/*How many models are we going to run (along with description and number of dedicated cores):{{{*/
++	nummodels=(int) strtol(argv[4], (char **)NULL, 10);
++	commsizes=xNew<int>(nummodels);
++	dirnames=xNew<char*>(nummodels);
++	modelnames=xNew<char*>(nummodels);
++	rankzeros=xNew<int>(nummodels);
++	for(int i=0;i<nummodels;i++){
++		char* string=NULL;
++
++		string=xNew<char>(strlen(argv[5+3*i])+1);
++		xMemCpy<char>(string,argv[5+3*i],strlen(argv[5+3*i])+1);
++		dirnames[i]=string;
++
++		string=xNew<char>(strlen(argv[5+3*i+1])+1);
++		xMemCpy<char>(string,argv[5+3*i+1],strlen(argv[5+3*i+1])+1);
++		modelnames[i]=string;
++
++		commsizes[i]=(int) strtol(argv[5+3*i+2], (char **)NULL, 10);
++	}
++
++	/*Figure out which model each cpu will belong to: */
++	count=0;
++	for(int i=0;i<nummodels;i++){
++		if(my_rank>=count && my_rank<(count+commsizes[i])){
++			modelid=i;
++			break;
++		}
++		count+=commsizes[i];
++	} 
++	/*Buil array of who is rank 0 of their own group:*/
++	count=0;
++	for(int i=0;i<nummodels;i++){
++		rankzeros[i]=count;
++		count+=commsizes[i];
++	}
++	/*}}}*/
++
++	/*Split world into sub-communicators for each and every model:*/
++	ISSM_MPI_Comm_split(worldcomm,modelid, my_rank, &modelcomm);
++
++	/*Build inter communicators:*/
++	earthid=nummodels-1; //last model to be provided in the argument list if the earth model.
++	if(modelid==earthid){
++		fromicecomms=xNew<ISSM_MPI_Comm>(nummodels-1);
++		for(int i=0;i<earthid;i++){
++			ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[i], i, fromicecomms+i); //communicate from local erth comm 9rank 0) to ice comm (rank 0) using modelid tag.
++		}
++	}
++	else{
++		ISSM_MPI_Intercomm_create( modelcomm, 0, worldcomm, rankzeros[earthid], modelid, &toearthcomm); //communicate from local ice comm (rank 0) to earth comm (rank 0) using modelid tag.
++	}
++
++	/*Supply specific argc and argv for each sub-communicator (corresponding to each  model specificatiions):{{{*/
++	char** arguments=xNew<char*>(4);
++	arguments[0]=xNew<char>(strlen(argv[0])+1); xMemCpy<char>(arguments[0],argv[0],strlen(argv[0])+1); //executable name
++	arguments[1]=xNew<char>(strlen(argv[1])+1); xMemCpy<char>(arguments[1],argv[1],strlen(argv[1])+1); //solution name
++	arguments[2]=xNew<char>(strlen(argv[5+3*modelid])+1); xMemCpy<char>(arguments[2],argv[5+3*modelid],strlen(argv[5+3*modelid])+1); //directory name
++	arguments[3]=xNew<char>(strlen(argv[5+3*modelid+1])+1); xMemCpy<char>(arguments[3],argv[5+3*modelid+1],strlen(argv[5+3*modelid+1])+1); //model name
++	/*}}}*/
++
++	/*Initialize femmodel from arguments provided command line: */
++	FemModel *femmodel = new FemModel(4,arguments,modelcomm);
++
++	/*Now that the models are initialized, keep communicator information in the parameters datasets of each model: */
++	femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(worldcomm,WorldCommEnum));
++	femmodel->parameters->AddObject(new IntParam(NumModelsEnum,nummodels));
++	femmodel->parameters->AddObject(new IntParam(ModelIdEnum,modelid));
++	femmodel->parameters->AddObject(new IntParam(EarthIdEnum,earthid));
++	if(modelid==earthid) femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm*>(fromicecomms,IcecapToEarthCommEnum));
++	else femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(toearthcomm,IcecapToEarthCommEnum));
++
++	/*Solve: */
++	femmodel->Solve();
++
++	/*Output results: */
++	OutputResultsx(femmodel);
++
++	/*Wrap up: */
++	femmodel->CleanUp();
++
++	/*Delete Model: */
++	delete femmodel;
++
++	/*Finalize environment:*/
++	EnvironmentFinalize();
++
++	/*Finalize exception trapping: */
++	ExceptionTrapEnd();
++
++	/*Free ressources:*/
++	xDelete<int>(commsizes);
++	for(int i=0;i<nummodels;i++){
++		char* string=NULL;
++		string=dirnames[i]; xDelete<char>(string);
++		string=modelnames[i]; xDelete<char>(string);
++	}
++	xDelete<char*>(dirnames);
++	xDelete<char*>(modelnames);
++
++	/*Return unix success: */
++	return 0; 
++}
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 25956)
+@@ -81,7 +81,7 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isdamageevolution",TransientIsdamageevolutionEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ishydrology",TransientIshydrologyEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ismovingfront",TransientIsmovingfrontEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isslr",TransientIsslrEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isslc",TransientIsslcEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.iscoupler",TransientIscouplerEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceancoupling",TransientIsoceancouplingEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.amr_frequency",TransientAmrFrequencyEnum));
+@@ -355,7 +355,7 @@
+ 						parameters->AddObject(iomodel->CopyConstantObject("md.constants.g",ConstantsGEnum));
+ 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum));
+ 
+-						/*slr:*/
++						/*slc:*/
+ 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+ 						break;
+ 					case MathydroEnum:
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25955)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25956)
+@@ -109,13 +109,13 @@
+ syn keyword cConstant ControlInputSizeMEnum
+ syn keyword cConstant ControlInputSizeNEnum
+ syn keyword cConstant ControlInputInterpolationEnum
+-syn keyword cConstant CumBslrEnum
+-syn keyword cConstant CumBslrIceEnum
+-syn keyword cConstant CumBslrHydroEnum
+-syn keyword cConstant CumBslrIcePartitionEnum
+-syn keyword cConstant CumBslrHydroPartitionEnum
+-syn keyword cConstant CumGmtslrEnum
+-syn keyword cConstant CumGmslrEnum
++syn keyword cConstant CumBslcEnum
++syn keyword cConstant CumBslcIceEnum
++syn keyword cConstant CumBslcHydroEnum
++syn keyword cConstant CumBslcIcePartitionEnum
++syn keyword cConstant CumBslcHydroPartitionEnum
++syn keyword cConstant CumGmtslcEnum
++syn keyword cConstant CumGmslcEnum
+ syn keyword cConstant DamageC1Enum
+ syn keyword cConstant DamageC2Enum
+ syn keyword cConstant DamageC3Enum
+@@ -487,7 +487,7 @@
+ syn keyword cConstant TransientIsmasstransportEnum
+ syn keyword cConstant TransientIsmovingfrontEnum
+ syn keyword cConstant TransientIsoceancouplingEnum
+-syn keyword cConstant TransientIsslrEnum
++syn keyword cConstant TransientIsslcEnum
+ syn keyword cConstant TransientIssmbEnum
+ syn keyword cConstant TransientIsstressbalanceEnum
+ syn keyword cConstant TransientIsthermalEnum
+@@ -720,11 +720,11 @@
+ syn keyword cConstant SealevelNEsaEnum
+ syn keyword cConstant SealevelNEsaRateEnum
+ syn keyword cConstant SealevelRSLEnum
+-syn keyword cConstant BslrEnum
+-syn keyword cConstant BslrIceEnum
+-syn keyword cConstant BslrHydroEnum
+-syn keyword cConstant BslrRateEnum
+-syn keyword cConstant GmtslrEnum
++syn keyword cConstant BslcEnum
++syn keyword cConstant BslcIceEnum
++syn keyword cConstant BslcHydroEnum
++syn keyword cConstant BslcRateEnum
++syn keyword cConstant GmtslcEnum
+ syn keyword cConstant SealevelRSLBarystaticEnum
+ syn keyword cConstant SealevelRSLRateEnum
+ syn keyword cConstant SealevelUEastEsaEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25955)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25956)
+@@ -103,13 +103,13 @@
+ 	ControlInputSizeMEnum,
+ 	ControlInputSizeNEnum,
+ 	ControlInputInterpolationEnum,
+-	CumBslrEnum,
+-	CumBslrIceEnum,
+-	CumBslrHydroEnum,
+-	CumBslrIcePartitionEnum,
+-	CumBslrHydroPartitionEnum,
+-	CumGmtslrEnum,
+-	CumGmslrEnum,
++	CumBslcEnum,
++	CumBslcIceEnum,
++	CumBslcHydroEnum,
++	CumBslcIcePartitionEnum,
++	CumBslcHydroPartitionEnum,
++	CumGmtslcEnum,
++	CumGmslcEnum,
+ 	DamageC1Enum,
+ 	DamageC2Enum,
+ 	DamageC3Enum,
+@@ -481,7 +481,7 @@
+ 	TransientIsmasstransportEnum,
+ 	TransientIsmovingfrontEnum,
+ 	TransientIsoceancouplingEnum,
+-	TransientIsslrEnum,
++	TransientIsslcEnum,
+ 	TransientIssmbEnum,
+ 	TransientIsstressbalanceEnum,
+ 	TransientIsthermalEnum,
+@@ -716,11 +716,11 @@
+ 	SealevelNEsaEnum,
+ 	SealevelNEsaRateEnum,
+ 	SealevelRSLEnum,
+-	BslrEnum,
+-	BslrIceEnum,
+-	BslrHydroEnum,
+-	BslrRateEnum,
+-	GmtslrEnum,
++	BslcEnum,
++	BslcIceEnum,
++	BslcHydroEnum,
++	BslcRateEnum,
++	GmtslcEnum,
+ 	SealevelRSLBarystaticEnum,
+ 	SealevelRSLRateEnum,
+ 	SealevelUEastEsaEnum,
+Index: ../trunk-jpl/test/NightlyRun/test2010.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2010.py	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2010.py	(revision 25956)
+@@ -86,8 +86,8 @@
+ 
+ # uncomment following 2 lines for
+ md = solve(md, 'Sealevelrise')
+-eus = md.results.SealevelriseSolution.Bslr
+-slr = md.results.SealevelriseSolution.Sealevel
++eus = md.results.SealevelriseSolution.Bslc
++slc = md.results.SealevelriseSolution.Sealevel
+ moixz = md.results.SealevelriseSolution.SealevelInertiaTensorXZ
+ moiyz = md.results.SealevelriseSolution.SealevelInertiaTensorYZ
+ moizz = md.results.SealevelriseSolution.SealevelInertiaTensorZZ
+@@ -102,6 +102,6 @@
+ # }}}
+ 
+ #Fields and tolerances to track changes
+-field_names = ['eus', 'slr', 'moixz', 'moiyz', 'moizz']
++field_names = ['eus', 'slc', 'moixz', 'moiyz', 'moizz']
+ field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+-field_values = [eus, slr, moixz, moiyz, moizz]
++field_values = [eus, slc, moixz, moiyz, moizz]
+Index: ../trunk-jpl/test/NightlyRun/test2020.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2020.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2020.m	(revision 25956)
+@@ -1,4 +1,4 @@
+-%Test Name: SHslr 
++%Test Name: SHslc 
+ % spherical-harmonic (SH) approach for solving the sea-level equation. 
+ % reference: Adhikari et al., 2019, ESSD, https://doi.org/10.5194/essd-11-629-2019 
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2021.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2021.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2021.m	(revision 25956)
+@@ -1,5 +1,5 @@
+-%Test Name: SESAWslr 
+-% SESAW method of solving GRD slr 
++%Test Name: SESAWslc 
++% SESAW method of solving GRD slc 
+ % reference: Adhikari et al., 2016, GMD, https://doi.org/10.5194/gmd-9-1087-2016 
+ 
+ md=model;
+@@ -35,7 +35,7 @@
+ % Area of individual elements
+ area_element=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,md.solidearth.planetradius); 
+ 
+-% Parameters input for SESAWslr solver. 
++% Parameters input for SESAWslc solver. 
+ para.ocean_element = ocean_element; 
+ para.loads_element = loads_element; 
+ para.area_element = area_element; 
+@@ -60,22 +60,22 @@
+ para.rotational.omega = md.solidearth.rotational.angularvelocity;
+ 
+ % solve: Rigid without rotational feedbacks. 
+-disp(['Solving sesaw-slr for Rigid Earth WITHOUT rotational feedback...']); 
++disp(['Solving sesaw-slc for Rigid Earth WITHOUT rotational feedback...']); 
+ [eus_rigid,rsl_rigid] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+ 
+ % solve: Rigid with rotational feedbacks. 
+ para.rotational.flag = 1; 
+-disp(['Solving sesaw-slr for Rigid Earth WITH rotational feedback...']); 
++disp(['Solving sesaw-slc for Rigid Earth WITH rotational feedback...']); 
+ [eus_rigid_rot,rsl_rigid_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+ 
+ % solve: Elastic with rotational feedbacks. 
+ para.solidearth = 'elastic'; 
+-disp(['Solving sesaw-slr for Elastic Earth WITH rotational feedback...']); 
++disp(['Solving sesaw-slc for Elastic Earth WITH rotational feedback...']); 
+ [eus_elast_rot,rsl_elast_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+ 
+ % solve: Elastic with rotational feedbacks. 
+ para.rotational.flag = 0; 
+-disp(['Solving sesaw-slr for Elastic Earth WITHOUT rotational feedback...']); 
++disp(['Solving sesaw-slc for Elastic Earth WITHOUT rotational feedback...']); 
+ [eus_elast,rsl_elast] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/src/m/classes/matestar.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matestar.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/matestar.m	(revision 25956)
+@@ -29,7 +29,7 @@
+ 		mantle_shear_modulus       = 0.;
+ 		mantle_density             = 0.;
+ 
+-		%slr
++		%slc
+ 		earth_density              = 0;
+ 
+ 	end
+@@ -136,7 +136,7 @@
+ 				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+ 				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+ 			end
+-			if ismember('SealevelriseAnalysis',analyses),
++			if ismember('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 25956)
+@@ -23,7 +23,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
+ 				error('mmeadditionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 25956)
+@@ -59,7 +59,7 @@
+ 
+ 			%check that the transition vectors have the right size: 
+ 			for i=1:length(slm.icecaps),
+-				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.slr.transitions{i}),
++				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}),
+ 					error(['sealevelmodel checkconsistenty issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
+ 				end
+ 			end
+@@ -66,7 +66,7 @@
+ 			
+ 			%check that run_frequency is the same everywhere: 
+ 			for i=1:length(slm.icecaps),
+-				if slm.icecaps{i}.slr.geodetic_run_frequency~=slm.earth.slr.geodetic_run_frequency,
++				if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency,
+ 					error(sprintf('sealevelmodel checkconsistenty error:  icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
+ 				end
+ 			end
+@@ -74,7 +74,7 @@
+ 			%make sure steric_rate is the same everywhere: 
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+-				if ~isempty(find(md.slr.steric_rate - slm.earth.slr.steric_rate(slm.earth.slr.transitions{i}))),
++				if ~isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate(slm.earth.dsl.transitions{i}))),
+ 					error(sprintf('steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+ 				end
+ 			end
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 25956)
+@@ -59,7 +59,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
+ 				return; 
+ 			end
+ 			md = checkfield(md,'fieldname','solidearth.settings.reltol','size',[1 1]);
+@@ -92,8 +92,8 @@
+ 		function disp(self) % {{{
+ 			disp(sprintf('   solidearth settings:'));
+ 
+-			fielddisplay(self,'reltol','sea level rise relative convergence criterion, (default, NaN: not applied)');
+-			fielddisplay(self,'abstol','sea level rise absolute convergence criterion, NaN: not applied');
++			fielddisplay(self,'reltol','sea level change relative convergence criterion, (default, NaN: not applied)');
++			fielddisplay(self,'abstol','sea level change absolute convergence criterion, NaN: not applied');
+ 			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
+ 			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
+ 			fielddisplay(self,'computesealevelchange','compute sealevel change (default 1)');
+@@ -122,16 +122,16 @@
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+-			writejsdouble(fid,[modelname '.slr.settings.maxiter'],self.maxiter);
+-			writejsdouble(fid,[modelname '.slr.settings.reltol'],self.reltol);
+-			writejsdouble(fid,[modelname '.slr.settings.abstol'],self.abstol);
+-			writejsdouble(fid,[modelname '.slr.settings.rigid'],self.rigid);
+-			writejsdouble(fid,[modelname '.slr.settings.elastic'],self.elastic);
+-			writejsdouble(fid,[modelname '.slr.settings.rotation'],self.rotation);
+-			writejsdouble(fid,[modelname '.slr.settings.ocean_area_scaling'],self.ocean_area_scaling);
+-			writejsdouble(fid,[modelname '.slr.settings.run_frequency'],self.run_frequency);
+-			writejsdouble(fid,[modelname '.slr.settings.degacc'],self.degacc);
+-			writejsdouble(fid,[modelname '.slr.settings.glfraction'],self.glfraction);
++			writejsdouble(fid,[modelname '.solidearth.settings.maxiter'],self.maxiter);
++			writejsdouble(fid,[modelname '.solidearth.settings.reltol'],self.reltol);
++			writejsdouble(fid,[modelname '.solidearth.settings.abstol'],self.abstol);
++			writejsdouble(fid,[modelname '.solidearth.settings.rigid'],self.rigid);
++			writejsdouble(fid,[modelname '.solidearth.settings.elastic'],self.elastic);
++			writejsdouble(fid,[modelname '.solidearth.settings.rotation'],self.rotation);
++			writejsdouble(fid,[modelname '.solidearth.settings.ocean_area_scaling'],self.ocean_area_scaling);
++			writejsdouble(fid,[modelname '.solidearth.settings.run_frequency'],self.run_frequency);
++			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
++			writejsdouble(fid,[modelname '.solidearth.settings.glfraction'],self.glfraction);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/transient.m	(revision 25956)
+@@ -15,7 +15,7 @@
+ 		isdamageevolution = 0;
+ 		ismovingfront     = 0;
+ 		ishydrology       = 0;
+-		isslr             = 0;
++		isslc             = 0;
+ 		iscoupler         = 0;
+ 		amr_frequency     = 0;
+ 		isoceancoupling   = 0;
+@@ -43,7 +43,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   =0;
+ 			self.ishydrology     = 0;
+-			self.isslr           = 0;
++			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+ 			self.amr_frequency	= 0;
+@@ -64,7 +64,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   = 0;
+ 			self.ishydrology     = 0;
+-			self.isslr           = 0;
++			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+ 			self.amr_frequency	= 0;
+@@ -95,7 +95,7 @@
+ 			md = checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
+-			md = checkfield(md,'fieldname','transient.isslr','numel',[1],'values',[0 1]);
++			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+@@ -120,7 +120,7 @@
+ 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
+ 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
+ 			fielddisplay(self,'ishydrology','indicates whether an hydrology model is used');
+-			fielddisplay(self,'isslr','indicates whether a sea-level rise solution is used in the transient');
++			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
+ 			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+ 			fielddisplay(self,'iscoupler','indicates whether different models are being run with need for coupling');
+ 			fielddisplay(self,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
+@@ -138,7 +138,7 @@
+ 			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','isslc','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','amr_frequency','format','Integer');
+@@ -164,7 +164,7 @@
+ 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
+ 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
+ 			writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology);
+-			writejsdouble(fid,[modelname '.trans.isslr'],self.isslr);
++			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
+ 			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
+ 			writejsdouble(fid,[modelname '.trans.iscoupler'],self.iscoupler);
+ 			writejsdouble(fid,[modelname '.trans.amr_frequency'],self.amr_frequency);
+Index: ../trunk-jpl/test/NightlyRun/test2002.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.py	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2002.py	(revision 25956)
+@@ -1,4 +1,4 @@
+-#Test Name: EarthSlr
++#Test Name: EarthSlc
+ import numpy as np
+ 
+ from gmshplanet import *
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25956)
+@@ -111,13 +111,13 @@
+ 		case ControlInputSizeMEnum : return "ControlInputSizeM";
+ 		case ControlInputSizeNEnum : return "ControlInputSizeN";
+ 		case ControlInputInterpolationEnum : return "ControlInputInterpolation";
+-		case CumBslrEnum : return "CumBslr";
+-		case CumBslrIceEnum : return "CumBslrIce";
+-		case CumBslrHydroEnum : return "CumBslrHydro";
+-		case CumBslrIcePartitionEnum : return "CumBslrIcePartition";
+-		case CumBslrHydroPartitionEnum : return "CumBslrHydroPartition";
+-		case CumGmtslrEnum : return "CumGmtslr";
+-		case CumGmslrEnum : return "CumGmslr";
++		case CumBslcEnum : return "CumBslc";
++		case CumBslcIceEnum : return "CumBslcIce";
++		case CumBslcHydroEnum : return "CumBslcHydro";
++		case CumBslcIcePartitionEnum : return "CumBslcIcePartition";
++		case CumBslcHydroPartitionEnum : return "CumBslcHydroPartition";
++		case CumGmtslcEnum : return "CumGmtslc";
++		case CumGmslcEnum : return "CumGmslc";
+ 		case DamageC1Enum : return "DamageC1";
+ 		case DamageC2Enum : return "DamageC2";
+ 		case DamageC3Enum : return "DamageC3";
+@@ -489,7 +489,7 @@
+ 		case TransientIsmasstransportEnum : return "TransientIsmasstransport";
+ 		case TransientIsmovingfrontEnum : return "TransientIsmovingfront";
+ 		case TransientIsoceancouplingEnum : return "TransientIsoceancoupling";
+-		case TransientIsslrEnum : return "TransientIsslr";
++		case TransientIsslcEnum : return "TransientIsslc";
+ 		case TransientIssmbEnum : return "TransientIssmb";
+ 		case TransientIsstressbalanceEnum : return "TransientIsstressbalance";
+ 		case TransientIsthermalEnum : return "TransientIsthermal";
+@@ -722,11 +722,11 @@
+ 		case SealevelNEsaEnum : return "SealevelNEsa";
+ 		case SealevelNEsaRateEnum : return "SealevelNEsaRate";
+ 		case SealevelRSLEnum : return "SealevelRSL";
+-		case BslrEnum : return "Bslr";
+-		case BslrIceEnum : return "BslrIce";
+-		case BslrHydroEnum : return "BslrHydro";
+-		case BslrRateEnum : return "BslrRate";
+-		case GmtslrEnum : return "Gmtslr";
++		case BslcEnum : return "Bslc";
++		case BslcIceEnum : return "BslcIce";
++		case BslcHydroEnum : return "BslcHydro";
++		case BslcRateEnum : return "BslcRate";
++		case GmtslcEnum : return "Gmtslc";
+ 		case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic";
+ 		case SealevelRSLRateEnum : return "SealevelRSLRate";
+ 		case SealevelUEastEsaEnum : return "SealevelUEastEsa";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25955)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25956)
+@@ -111,13 +111,13 @@
+ 	      else if (strcmp(name,"ControlInputSizeM")==0) return ControlInputSizeMEnum;
+ 	      else if (strcmp(name,"ControlInputSizeN")==0) return ControlInputSizeNEnum;
+ 	      else if (strcmp(name,"ControlInputInterpolation")==0) return ControlInputInterpolationEnum;
+-	      else if (strcmp(name,"CumBslr")==0) return CumBslrEnum;
+-	      else if (strcmp(name,"CumBslrIce")==0) return CumBslrIceEnum;
+-	      else if (strcmp(name,"CumBslrHydro")==0) return CumBslrHydroEnum;
+-	      else if (strcmp(name,"CumBslrIcePartition")==0) return CumBslrIcePartitionEnum;
+-	      else if (strcmp(name,"CumBslrHydroPartition")==0) return CumBslrHydroPartitionEnum;
+-	      else if (strcmp(name,"CumGmtslr")==0) return CumGmtslrEnum;
+-	      else if (strcmp(name,"CumGmslr")==0) return CumGmslrEnum;
++	      else if (strcmp(name,"CumBslc")==0) return CumBslcEnum;
++	      else if (strcmp(name,"CumBslcIce")==0) return CumBslcIceEnum;
++	      else if (strcmp(name,"CumBslcHydro")==0) return CumBslcHydroEnum;
++	      else if (strcmp(name,"CumBslcIcePartition")==0) return CumBslcIcePartitionEnum;
++	      else if (strcmp(name,"CumBslcHydroPartition")==0) return CumBslcHydroPartitionEnum;
++	      else if (strcmp(name,"CumGmtslc")==0) return CumGmtslcEnum;
++	      else if (strcmp(name,"CumGmslc")==0) return CumGmslcEnum;
+ 	      else if (strcmp(name,"DamageC1")==0) return DamageC1Enum;
+ 	      else if (strcmp(name,"DamageC2")==0) return DamageC2Enum;
+ 	      else if (strcmp(name,"DamageC3")==0) return DamageC3Enum;
+@@ -498,7 +498,7 @@
+ 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+-	      else if (strcmp(name,"TransientIsslr")==0) return TransientIsslrEnum;
++	      else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum;
+ 	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
+ 	      else if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
+ 	      else if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum;
+@@ -737,11 +737,11 @@
+ 	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
+ 	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
+ 	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
+-	      else if (strcmp(name,"Bslr")==0) return BslrEnum;
+-	      else if (strcmp(name,"BslrIce")==0) return BslrIceEnum;
+-	      else if (strcmp(name,"BslrHydro")==0) return BslrHydroEnum;
+-	      else if (strcmp(name,"BslrRate")==0) return BslrRateEnum;
+-	      else if (strcmp(name,"Gmtslr")==0) return GmtslrEnum;
++	      else if (strcmp(name,"Bslc")==0) return BslcEnum;
++	      else if (strcmp(name,"BslcIce")==0) return BslcIceEnum;
++	      else if (strcmp(name,"BslcHydro")==0) return BslcHydroEnum;
++	      else if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
++	      else if (strcmp(name,"Gmtslc")==0) return GmtslcEnum;
+ 	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
+ 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
+ 	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
+Index: ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m	(revision 25956)
+@@ -20,7 +20,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==0), 
+ 				error('additionalsolidearthsolution checkconsistency error message: need to run GRD solution if you are supplying a GRD additional pattern solution');
+ 			end
+ 			self.checkconsistency@solidearthsolution(md,solution,analyses);
+Index: ../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 25956)
+@@ -164,7 +164,7 @@
+ 			if isempty(modelname), error('BuildQueueScriptMultipleModels error message: need a non empty model name!');end
+ 
+ 			%what is the executable being called?
+-			executable='issm_slr.exe';
++			executable='issm_slc.exe';
+ 
+ 			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+ 
+Index: ../trunk-jpl/src/m/classes/clusters/localpfe.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/localpfe.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/clusters/localpfe.m	(revision 25956)
+@@ -103,7 +103,7 @@
+ 			if isempty(modelname), error('BuildQueueScriptMultipleModels error message: need a non empty model name!');end
+ 
+ 			%what is the executable being called? 
+-			executable='issm_slr.exe';
++			executable='issm_slc.exe';
+ 
+ 			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+ 			
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 25956)
+@@ -213,7 +213,7 @@
+ 			if isempty(modelname), error('BuildQueueScriptMultipleModels error message: need a non empty model name!');end
+ 
+ 			%what is the executable being called? 
+-			executable='issm_slr.exe';
++			executable='issm_slc.exe';
+ 
+ 			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+ 
+Index: ../trunk-jpl/src/m/classes/dsl.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/dsl.m	(revision 25956)
+@@ -38,16 +38,16 @@
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember('SealevelriseAnalysis',analyses), return; end
+-			if (strcmp(solution,'TransientSolution') & md.transient.isslr == 0), return; end
++			if ~ismember('SealevelchangeAnalysis',analyses), return; end
++			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+ 			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level_change','NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','dsl.sea_surface_height_change_above_geoid','NaN',1,'Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','dsl.sea_water_pressure_change_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','dsl.compute_fingerprints','NaN',1,'Inf',1,'values',[0,1]);
+ 			if self.compute_fingerprints,
+-				%check geodetic flag of slr is on: 
+-				if md.slr.geodetic==0,
+-					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on');
++				%check geodetic flag of is on: 
++				if md.solidearth.settings.isgrd==0,
++					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, solidearth class should have grd flag on');
+ 				end
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/dslmme.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/dslmme.m	(revision 25956)
+@@ -36,8 +36,8 @@
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember('SealevelriseAnalysis',analyses), return; end
+-			if (strcmp(solution,'TransientSolution') & md.transient.isslr == 0), return; end
++			if ~ismember('SealevelchangeAnalysis',analyses), return; end
++			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+ 			for i=1:length(self.global_average_thermosteric_sea_level_change),
+ 				md = checkfield(md,'field',self.global_average_thermosteric_sea_level_change{i},'NaN',1,'Inf',1);
+ 				md = checkfield(md,'field',self.sea_surface_height_change_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+@@ -45,9 +45,9 @@
+ 			end
+ 			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.global_average_thermosteric_sea_level_change));
+ 			if self.compute_fingerprints,
+-				%check geodetic flag of slr is on: 
+-				if md.solidearth.settings.computesealevelchange==0,
+-					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on');
++				%check geodetic flag of solidearth is on: 
++				if md.solidearth.settings.isgrd==0,
++					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, solidearth class should have geodetic flag on');
+ 				end
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/geometry.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/geometry.m	(revision 25956)
+@@ -54,7 +54,7 @@
+ 
+ 			if (strcmp(solution,'TransientSolution') & md.transient.isgia) | strcmp(solution,'GiaSolution'),
+ 				md = checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1);
+-			elseif strcmpi(solution,'SealevelriseSolution'),
++			elseif strcmpi(solution,'SealevelchangeSolution'),
+ 				md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 				return;
+ 			elseif strcmpi(solution,'LoveSolution'),
+Index: ../trunk-jpl/src/m/classes/giamme.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/giamme.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/giamme.m	(revision 25956)
+@@ -33,8 +33,8 @@
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember('SealevelriseAnalysis',analyses), return; end
+-			if (strcmp(solution,'TransientSolution') & md.transient.isslr == 0), return; end
++			if ~ismember('SealevelchangeAnalysis',analyses), return; end
++			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+ 			md = checkfield(md,'field',self.Ngia,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'field',self.Ugia,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',0,'<=',length(self.Ngia));
+Index: ../trunk-jpl/src/m/classes/lovenumbers.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 25956)
+@@ -45,7 +45,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
+ 				return; 
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/matdamageice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/matdamageice.m	(revision 25956)
+@@ -28,7 +28,7 @@
+ 		mantle_shear_modulus       = 0.;
+ 		mantle_density             = 0.;
+ 
+-		%slr
++		%slc
+ 		earth_density              = 0;
+ 
+ 	end
+@@ -126,7 +126,7 @@
+ 				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+ 				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+ 			end
+-			if ismember('SealevelriseAnalysis',analyses),
++			if ismember('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/matenhancedice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 25956)
+@@ -129,7 +129,7 @@
+ 				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+ 				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+ 			end
+-			if ismember('SealevelriseAnalysis',analyses),
++			if ismember('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/matice.m	(revision 25956)
+@@ -28,7 +28,7 @@
+ 		mantle_shear_modulus       = 0.;
+ 		mantle_density             = 0.;
+ 
+-		%slr
++		%slc
+ 		earth_density              = 0;
+ 
+ 	end
+@@ -112,7 +112,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 	
+-			if ~strcmpi(solution,'SealevelriseSolution'),
++			if ~strcmpi(solution,'SealevelchangeSolution'),
+ 				md = checkfield(md,'fieldname','materials.rho_ice','>',0);
+ 				md = checkfield(md,'fieldname','materials.rho_water','>',0);
+ 				md = checkfield(md,'fieldname','materials.rho_freshwater','>',0);
+@@ -129,7 +129,7 @@
+ 				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+ 				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+ 			end
+-			if ismember('SealevelriseAnalysis',analyses),
++			if ismember('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 25956)
+@@ -23,7 +23,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
+ 				error('mmeofflinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
+ 			end
+ 			
+Index: ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 25956)
+@@ -20,7 +20,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
+ 				error('offlinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
+ 			end
+ 			self.checkconsistency@solidearthsolution(md,solution,analyses);
+Index: ../trunk-jpl/src/m/classes/rotational.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/rotational.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/rotational.m	(revision 25956)
+@@ -29,7 +29,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
+ 				return; 
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 25955)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 25956)
+@@ -49,7 +49,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if ~ismember('SealevelriseAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslr==0), 
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
+ 				return; 
+ 			end
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 25956)
+@@ -1,4 +1,4 @@
+-%Test Name: EarthSlr
++%Test Name: EarthSlc
+ 
+ %mesh earth:
+ md=model;
+Index: ../trunk-jpl/test/NightlyRun/test2003.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.py	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2003.py	(revision 25956)
+@@ -1,4 +1,4 @@
+-#Test Name: EarthSlr_rotationalFeedback
++#Test Name: EarthSlc_rotationalFeedback
+ import numpy as np
+ 
+ from socket import gethostname
+Index: ../trunk-jpl/test/NightlyRun/test2005.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2005.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2005.m	(revision 25956)
+@@ -1,4 +1,4 @@
+-%Test Name: EarthSlr
++%Test Name: EarthSlc
+ 
+ %mesh earth:
+ md=model;
+@@ -71,7 +71,7 @@
+ md.timestepping.start_time=0;
+ md.timestepping.final_time=10;
+ md.timestepping.time_step=1;
+-md.transient.isslr=1;
++md.transient.isslc=1;
+ md.transient.issmb=0;
+ md.transient.isgia=1;
+ md.transient.ismasstransport=0;
+@@ -96,7 +96,7 @@
+ S1=md.results.TransientSolution(1).Sealevel;
+ S5=md.results.TransientSolution(5).Sealevel;
+ S10=md.results.TransientSolution(10).Sealevel;
+-Seus10=md.results.TransientSolution(10).Bslr;
++Seus10=md.results.TransientSolution(10).Bslc;
+ 
+ %Fields and tolerances to track changes
+ field_names={'Sealevel1','Sealevel5','Sealevel10','Seustatic10'};
+Index: ../trunk-jpl/test/NightlyRun/test2010.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2010.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2010.m	(revision 25956)
+@@ -5,8 +5,8 @@
+ rad_e = 6.371012*10^3; % mean radius of Earth, km
+ md.mesh=gmshplanet('radius',rad_e,'resolution',1000.0);  % km resolution
+ 
+-%parameterize slr solution:
+-%slr loading:  {{{
++%parameterize slc solution:
++%slc loading:  {{{
+ late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+ longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ 
+@@ -74,14 +74,14 @@
+ 
+ % uncomment following 2 lines for
+ md=solve(md,'Sealevelchange');
+-eus=md.results.SealevelchangeSolution.Bslr;
+-slr=md.results.SealevelchangeSolution.Sealevel;
++eus=md.results.SealevelchangeSolution.Bslc;
++slc=md.results.SealevelchangeSolution.Sealevel;
+ moixz=md.results.SealevelchangeSolution.SealevelInertiaTensorXZ;
+ moiyz=md.results.SealevelchangeSolution.SealevelInertiaTensorYZ;
+ moizz=md.results.SealevelchangeSolution.SealevelInertiaTensorZZ;
+ 
+ % analytical moi => just checking FOR ICE only!!! {{{
+-% ...have to mute ** slr induced MOI in Tria.cpp ** prior to the comparison
++% ...have to mute ** slc 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;
+@@ -90,7 +90,7 @@
+ % }}}
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'eus','slr','moixz','moiyz','moizz'};
++field_names     ={'eus','slc','moixz','moiyz','moizz'};
+ field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
+-field_values={eus,slr,moixz,moiyz,moizz};
++field_values={eus,slc,moixz,moiyz,moizz};
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2004.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2004.m	(revision 25956)
+@@ -134,7 +134,7 @@
+ 		disp('      reading bedrock');
+ 		md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+ 	end % }}}
+-	%Slr: {{{
++	%Slc: {{{
+ 	if bas.iscontinentany('antarctica'),
+ 		if testagainst2002,
+ 			% TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.solidearth.surfaceload.icethicknesschange(pos)'
+@@ -243,7 +243,7 @@
+ 	end
+ 	% }}}
+ 	%}}}
+-	%slr loading/calibration:  {{{
++	%slc loading/calibration:  {{{
+ 	md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+ 
+ 	if testagainst2002, 
+Index: ../trunk-jpl/test/NightlyRun/test2006.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.py	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2006.py	(revision 25956)
+@@ -1,4 +1,4 @@
+-#Test Name: EarthSlr Dakota Sampling glaciers
++#Test Name: EarthSlc Dakota Sampling glaciers
+ import numpy as np
+ 
+ from dmeth_params_set import *
+@@ -86,7 +86,7 @@
+ md.timestepping.start_time = 0
+ md.timestepping.final_time = 10
+ md.timestepping.time_step = 1
+-md.transient.isslr = 1
++md.transient.isslc = 1
+ md.transient.issmb = 0
+ md.transient.isgia = 1
+ md.transient.ismasstransport = 0
+@@ -194,18 +194,18 @@
+ md.qmu.statistics.ndirectories = 5
+ 
+ md.qmu.statistics.method[0]['name'] = 'Histogram'
+-md.qmu.statistics.method[0]['fields'] = ['Sealevel', 'BslrIce']
++md.qmu.statistics.method[0]['fields'] = ['Sealevel', 'BslcIce']
+ md.qmu.statistics.method[0]['steps'] = np.arange(1, 10 + 1).reshape(1, -1)
+ md.qmu.statistics.method[0]['nbins'] = 20
+ 
+ md.qmu.statistics.addmethod()
+ md.qmu.statistics.method[1]['name'] = 'MeanVariance'
+-md.qmu.statistics.method[1]['fields'] = ['Sealevel', 'BslrIce']
++md.qmu.statistics.method[1]['fields'] = ['Sealevel', 'BslcIce']
+ md.qmu.statistics.method[1]['steps'] = np.arange(1, 10 + 1).reshape(1, -1)
+ 
+ md.qmu.statistics.addmethod()
+ md.qmu.statistics.method[2]['name'] = 'SampleSeries'
+-md.qmu.statistics.method[2]['fields'] = ['Sealevel', 'BslrIce']
++md.qmu.statistics.method[2]['fields'] = ['Sealevel', 'BslcIce']
+ md.qmu.statistics.method[2]['steps'] = np.arange(1, 10 + 1).reshape(1, -1)
+ md.qmu.statistics.method[2]['indices'] = locations.reshape(1, -1)
+ #}}}
+Index: ../trunk-jpl/test/NightlyRun/test2006.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.m	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2006.m	(revision 25956)
+@@ -1,4 +1,4 @@
+-%Test Name: EarthSlr Dakota Sampling glaciers.
++%Test Name: EarthSlc Dakota Sampling glaciers.
+ 
+ %mesh earth:
+ md=model;
+@@ -72,7 +72,7 @@
+ md.timestepping.start_time=0;
+ md.timestepping.final_time=10;
+ md.timestepping.time_step=1;
+-md.transient.isslr=1;
++md.transient.isslc=1;
+ md.transient.issmb=0;
+ md.transient.isgia=1;
+ md.transient.ismasstransport=0;
+@@ -160,16 +160,16 @@
+ md.qmu.statistics.ndirectories=5;
+ 
+ md.qmu.statistics.method(1).name='Histogram';
+-md.qmu.statistics.method(1).fields={'Sealevel','BslrIce'};
++md.qmu.statistics.method(1).fields={'Sealevel','BslcIce'};
+ md.qmu.statistics.method(1).steps=[1:10];
+ md.qmu.statistics.method(1).nbins=20;
+ 
+ md.qmu.statistics.method(2).name='MeanVariance';
+-md.qmu.statistics.method(2).fields={'Sealevel','BslrIce'};
++md.qmu.statistics.method(2).fields={'Sealevel','BslcIce'};
+ md.qmu.statistics.method(2).steps=[1:10];
+ 
+ md.qmu.statistics.method(3).name='SampleSeries';
+-md.qmu.statistics.method(3).fields={'Sealevel','BslrIce'};
++md.qmu.statistics.method(3).fields={'Sealevel','BslcIce'};
+ md.qmu.statistics.method(3).steps=[1:10];
+ md.qmu.statistics.method(3).indices=locations;
+ %}}}
+Index: ../trunk-jpl/test/NightlyRun/test2005.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2005.py	(revision 25955)
++++ ../trunk-jpl/test/NightlyRun/test2005.py	(revision 25956)
+@@ -1,4 +1,4 @@
+-#Test Name: EarthSlr
++#Test Name: EarthSlc
+ import numpy as np
+ 
+ from gmshplanet import *
+@@ -83,7 +83,7 @@
+ md.timestepping.start_time = 0
+ md.timestepping.final_time = 10
+ md.timestepping.time_step = 1
+-md.transient.isslr = 1
++md.transient.isslc = 1
+ md.transient.issmb = 0
+ md.transient.isgia = 1
+ md.transient.ismasstransport = 0
+@@ -108,7 +108,7 @@
+ S1 = md.results.TransientSolution[1 - 1].Sealevel
+ S5 = md.results.TransientSolution[5 - 1].Sealevel
+ S10 = md.results.TransientSolution[10 - 1].Sealevel
+-Seus10 = md.results.TransientSolution[10 - 1].Bslr
++Seus10 = md.results.TransientSolution[10 - 1].Bslc
+ 
+ #Fields and tolerances to track changes
+ field_names = ['Sealevel1', 'Sealevel5', 'Sealevel10', 'Seustatic10']
Index: /issm/oecreview/Archive/25834-26739/ISSM-25956-25957.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25956-25957.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25956-25957.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25956)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25957)
+@@ -25,7 +25,7 @@
+ 	bool isgia=0;
+ 	int  grd=0;
+ 	int  isexternal=0;
+-	int  iscoupler=0;
++	bool iscoupler=0;
+ 	int solution_type;
+ 
+ 	/*Retrieve parameters:*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-25957-25958.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25957-25958.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25957-25958.diff	(revision 26740)
@@ -0,0 +1,680 @@
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 25957)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 25958)
+@@ -794,9 +794,10 @@
+ }/*}}}*/
+ void           MasstransportAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
++
+ 	/*Only update if on base*/
+ 	if(!element->IsOnBase()) return;
+-
++	
+ 	/*Fetch dof list and allocate solution vector*/
+ 	int *doflist = NULL;
+ 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -804,6 +805,9 @@
+ 	int numnodes = element->GetNumberOfNodes();
+ 	IssmDouble* newthickness = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* thicknessresidual = xNew<IssmDouble>(numnodes);
++	
++	/*recover time step:*/
++	IssmDouble dt = element->FindParam(TimesteppingTimeStepEnum);
+ 
+ 	/*Use the dof list to index into the solution vector: */
+ 	IssmDouble minthickness = element->FindParam(MasstransportMinThicknessEnum);
+@@ -839,7 +843,7 @@
+ 	newthickness  = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* oldthickness      = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* cumdeltathickness = xNew<IssmDouble>(numvertices);
+-	IssmDouble* deltathickness    = xNew<IssmDouble>(numvertices);
++	IssmDouble* icethicknessrate    = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* newbase           = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* bed               = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* newsurface        = xNew<IssmDouble>(numvertices);
+@@ -865,7 +869,7 @@
+ 	/*What is the delta thickness forcing the sea-level change core: cumulated over time, hence the +=:*/
+ 	for(int i=0;i<numvertices;i++){
+ 		cumdeltathickness[i] += newthickness[i]-oldthickness[i];
+-		deltathickness[i]     = newthickness[i]-oldthickness[i];
++		icethicknessrate[i]     = (newthickness[i]-oldthickness[i])/dt;
+ 	}
+ 
+ 	/*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/
+@@ -902,7 +906,7 @@
+ 	element->AddBasalInput(SurfaceEnum,newsurface,P1Enum);
+ 	element->AddBasalInput(BaseEnum,newbase,P1Enum);
+ 	element->AddBasalInput(SealevelchangeCumDeltathicknessEnum,cumdeltathickness,P1Enum);
+-	element->AddBasalInput(SurfaceloadIceThicknessChangeEnum,deltathickness,P1Enum);
++	element->AddBasalInput(SurfaceloadIceThicknessRateEnum,icethicknessrate,P1Enum);
+ 
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(newthickness);
+@@ -910,7 +914,7 @@
+ 	xDelete<IssmDouble>(newbase);
+ 	xDelete<IssmDouble>(newsurface);
+ 	xDelete<IssmDouble>(oldthickness);
+-	xDelete<IssmDouble>(deltathickness);
++	xDelete<IssmDouble>(icethicknessrate);
+ 	xDelete<IssmDouble>(oldbase);
+ 	xDelete<IssmDouble>(oldsurface);
+ 	xDelete<IssmDouble>(phi);
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 25957)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 25958)
+@@ -39,10 +39,11 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchData(&geodetic,"md.solidearth.settings.computesealevelchange");
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessChangeEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightChangeEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessRateEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightRateEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.other",SurfaceloadOtherRateEnum);
+ 		
+ 	/*dynamic sea level: */
+ 	iomodel->FetchData(&dslmodel,"md.dsl.model");
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25957)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25958)
+@@ -5522,6 +5522,8 @@
+ }
+ /*}}}*/
+ void	Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
++
++
+ 	/*early return if we are not on an ice cap OR ocean:*/
+ 	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){
+ 		dI_list[0] = 0.0; // this is important!!!
+@@ -5598,19 +5600,22 @@
+ 		dI_list[2] = +4*PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	}
+ 	else if(masks->isiceonly[this->lid]){
+-		IssmDouble rho_ice, I;
++		IssmDouble rho_ice, dIdt, dt;
++		
+ 
+-		/*recover material parameters: */
++		/*recover parameters: */
+ 		rho_ice=FindParam(MaterialsRhoIceEnum);
++		dt=FindParam(TimesteppingTimeStepEnum);
+ 
+ 		/*Compute ice thickness change: */
+-		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
++		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
+ 		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+-		deltathickness_input->GetInputAverage(&I);
++		deltathickness_input->GetInputAverage(&dIdt);
+ 
+-		dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+-		dI_list[1] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+-		dI_list[2] = +4*PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
++
++		dI_list[0] = -4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
++		dI_list[1] = -4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
++		dI_list[2] = +4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	}
+ 
+ 	return;
+@@ -5818,11 +5823,12 @@
+ 	int gsize;
+ 	IssmDouble area;
+ 	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
++	IssmDouble Idot;  //ice thickness rate (Farrel and Clarke, Equ. 4)
+ 	bool notfullygrounded=false;
+ 	bool scaleoceanarea= false;
+ 	bool computerigid= false;
+ 	int  glfraction=1;
++	IssmDouble dt=0;
+ 
+ 	/*output: */
+ 	IssmDouble bslcice=0;
+@@ -5867,6 +5873,7 @@
+ 	/*recover some parameters:*/
+ 	rho_ice=FindParam(MaterialsRhoIceEnum);
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
++	dt=FindParam(TimesteppingTimeStepEnum);
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+@@ -5891,11 +5898,11 @@
+ 	else phi=1.0;
+ 
+ 	/*Retrieve ice thickness at vertices: */
+-	Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
++	Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
+ 	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+ 
+ 	/*/Average ice thickness over grounded area of the element only: {{{*/
+-	if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
++	if(!notfullygrounded)deltathickness_input->GetInputAverage(&Idot);
+ 	else{
+ 		IssmDouble total_weight=0;
+ 		bool mainlyfloating = true;
+@@ -5908,14 +5915,14 @@
+ 
+ 		/* Start  looping on the number of gaussian points and average over these gaussian points: */
+ 		total_weight=0;
+-		I=0;
++		Idot=0;
+ 		while(gauss->next()){
+-			IssmDouble Ig=0;
+-			deltathickness_input->GetInputValue(&Ig,gauss);
+-			I+=Ig*gauss->weight;
++			IssmDouble Idotg=0;
++			deltathickness_input->GetInputValue(&Idotg,gauss);
++			Idot+=Idotg*gauss->weight;
+ 			total_weight+=gauss->weight;
+ 		}
+-		I=I/total_weight;
++		Idot=Idot/total_weight;
+ 		delete gauss;
+ 	}
+ 	/*}}}*/
+@@ -5923,15 +5930,15 @@
+ 	/*Compute barystatic contribution:*/
+ 	_assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslcice = rho_ice*area*phi*I/(oceanarea*rho_water);
++	bslcice = rho_ice*area*phi*Idot*dt/(oceanarea*rho_water);
+ 	_assert_(!xIsNan<IssmDouble>(bslcice));
+ 
+ 	if(computerigid){
+ 		/*convert from m to kg/m^2:*/
+-		I=I*rho_ice*phi;
++		Idot=Idot*rho_ice*phi;
+ 
+ 		/*convolve:*/
+-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*I;
++		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*Idot*dt;
+ 	}
+ 
+ 	/*Plug bslcice into barystatic contribution vector:*/
+@@ -5949,7 +5956,8 @@
+ 	int gsize;
+ 	IssmDouble area;
+ 	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble W;  //change in water height thickness (Farrel and Clarke, Equ. 4)
++	IssmDouble Wdot;  //change in water height thickness (Farrel and Clarke, Equ. 4)
++	IssmDouble dt=0;
+ 	bool notfullygrounded=false;
+ 	bool scaleoceanarea= false;
+ 	bool computeelastic= false;
+@@ -5982,6 +5990,7 @@
+ 	/*recover parameters: */
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+ 	rho_freshwater=FindParam(MaterialsRhoFreshwaterEnum);
++	dt=FindParam(TimesteppingTimeStepEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 
+@@ -5992,22 +6001,22 @@
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Retrieve water height at vertices: */
+-	Input* deltathickness_input=this->GetInput(SurfaceloadWaterHeightChangeEnum);
+-	if (!deltathickness_input)_error_("SurfaceloadWaterHeightChangeEnum input needed to compute sea level change!");
+-	deltathickness_input->GetInputAverage(&W);
++	Input* deltathickness_input=this->GetInput(SurfaceloadWaterHeightRateEnum);
++	if (!deltathickness_input)_error_("SurfaceloadWaterHeightRateEnum input needed to compute sea level change!");
++	deltathickness_input->GetInputAverage(&Wdot);
+ 
+ 	/*Compute barystatic component:*/
+ 	_assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslchydro = rho_freshwater*area*phi*W/(oceanarea*rho_water);
++	bslchydro = rho_freshwater*area*phi*Wdot*dt/(oceanarea*rho_water);
+ 	_assert_(!xIsNan<IssmDouble>(bslchydro));
+ 
+ 	if(computeelastic){
+ 		/*convert from m to kg/m^2:*/
+-		W=W*rho_freshwater*phi;
++		Wdot=Wdot*rho_freshwater*phi;
+ 
+ 		/*convolve:*/
+-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*W;
++		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*Wdot*dt;
+ 	}
+ 
+ 	/*Plug bslcice into barystatic contribution vector:*/
+@@ -6117,7 +6126,7 @@
+ 
+ 	/*diverse:*/
+ 	int gsize;
+-	IssmDouble I, S, BP;		//change in relative ice thickness and sea level
++	IssmDouble Idot, S, BP;		//change in relative ice thickness and sea level
+ 	IssmDouble rho_ice,rho_water;
+ 	int horiz;
+ 	int  bp_compute_fingerprints= 0;
+@@ -6181,20 +6190,22 @@
+ 		}
+ 	}
+ 	else if (masks->isiceonly[this->lid]){
++		IssmDouble dt=0;
++		dt=FindParam(TimesteppingTimeStepEnum);
+ 
+ 		/*Compute ice thickness change: */
+-		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
++		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
+ 		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+-		deltathickness_input->GetInputAverage(&I);
++		deltathickness_input->GetInputAverage(&Idot);
+ 
+ 		/*convert to kg/m^2*/
+-		I=I*rho_ice;
++		Idot=Idot*rho_ice;
+ 
+ 		for(int i=0;i<gsize;i++){
+-			Up[i]+=I*GU[i];
++			Up[i]+=Idot*dt*GU[i];
+ 			if(horiz){
+-				North[i]+=I*GN[i];
+-				East[i]+=I*GE[i];
++				North[i]+=Idot*dt*GN[i];
++				East[i]+=Idot*dt*GE[i];
+ 			}
+ 		}
+ 	}
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25957)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 25958)
+@@ -254,7 +254,7 @@
+ 		TransferForcing(femmodel,SealevelchangeCumDeltathicknessEnum);
+ 
+ 		/*we have accumulated thicknesses, dump them in deltathcikness: */
+-		if(modelid==earthid)InputDuplicatex(femmodel,SealevelchangeCumDeltathicknessEnum,SurfaceloadIceThicknessChangeEnum);
++		if(modelid==earthid)InputDuplicatex(femmodel,SealevelchangeCumDeltathicknessEnum,SurfaceloadIceThicknessRateEnum);
+ 	}
+ 
+ 	/*run cores:*/
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25957)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25958)
+@@ -733,9 +733,10 @@
+ syn keyword cConstant SealevelUNorthEsaEnum
+ syn keyword cConstant SealevelchangeCumDeltathicknessEnum
+ syn keyword cConstant SealevelchangeCumDeltathicknessOldEnum
+-syn keyword cConstant SurfaceloadOtherEnum
+-syn keyword cConstant SurfaceloadIceThicknessChangeEnum
+-syn keyword cConstant SurfaceloadWaterHeightChangeEnum
++syn keyword cConstant SurfaceloadRateEnum
++syn keyword cConstant SurfaceloadIceThicknessRateEnum
++syn keyword cConstant SurfaceloadWaterHeightRateEnum
++syn keyword cConstant SurfaceloadOtherRateEnum
+ syn keyword cConstant SealevelchangeIndicesEnum
+ syn keyword cConstant SealevelchangeGEnum
+ syn keyword cConstant SealevelchangeGUEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25957)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25958)
+@@ -729,9 +729,10 @@
+ 	SealevelUNorthEsaEnum,
+ 	SealevelchangeCumDeltathicknessEnum,
+ 	SealevelchangeCumDeltathicknessOldEnum,
+-	SurfaceloadOtherEnum,
+-	SurfaceloadIceThicknessChangeEnum,
+-	SurfaceloadWaterHeightChangeEnum,
++	SurfaceloadRateEnum,
++	SurfaceloadIceThicknessRateEnum,
++	SurfaceloadWaterHeightRateEnum,
++	SurfaceloadOtherRateEnum,
+ 	SealevelchangeIndicesEnum,
+ 	SealevelchangeGEnum,
+ 	SealevelchangeGUEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25957)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25958)
+@@ -735,9 +735,10 @@
+ 		case SealevelUNorthEsaEnum : return "SealevelUNorthEsa";
+ 		case SealevelchangeCumDeltathicknessEnum : return "SealevelchangeCumDeltathickness";
+ 		case SealevelchangeCumDeltathicknessOldEnum : return "SealevelchangeCumDeltathicknessOld";
+-		case SurfaceloadOtherEnum : return "SurfaceloadOther";
+-		case SurfaceloadIceThicknessChangeEnum : return "SurfaceloadIceThicknessChange";
+-		case SurfaceloadWaterHeightChangeEnum : return "SurfaceloadWaterHeightChange";
++		case SurfaceloadRateEnum : return "SurfaceloadRate";
++		case SurfaceloadIceThicknessRateEnum : return "SurfaceloadIceThicknessRate";
++		case SurfaceloadWaterHeightRateEnum : return "SurfaceloadWaterHeightRate";
++		case SurfaceloadOtherRateEnum : return "SurfaceloadOtherRate";
+ 		case SealevelchangeIndicesEnum : return "SealevelchangeIndices";
+ 		case SealevelchangeGEnum : return "SealevelchangeG";
+ 		case SealevelchangeGUEnum : return "SealevelchangeGU";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25957)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25958)
+@@ -750,12 +750,13 @@
+ 	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+ 	      else if (strcmp(name,"SealevelchangeCumDeltathickness")==0) return SealevelchangeCumDeltathicknessEnum;
+ 	      else if (strcmp(name,"SealevelchangeCumDeltathicknessOld")==0) return SealevelchangeCumDeltathicknessOldEnum;
+-	      else if (strcmp(name,"SurfaceloadOther")==0) return SurfaceloadOtherEnum;
++	      else if (strcmp(name,"SurfaceloadRate")==0) return SurfaceloadRateEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"SurfaceloadIceThicknessChange")==0) return SurfaceloadIceThicknessChangeEnum;
+-	      else if (strcmp(name,"SurfaceloadWaterHeightChange")==0) return SurfaceloadWaterHeightChangeEnum;
++	      if (strcmp(name,"SurfaceloadIceThicknessRate")==0) return SurfaceloadIceThicknessRateEnum;
++	      else if (strcmp(name,"SurfaceloadWaterHeightRate")==0) return SurfaceloadWaterHeightRateEnum;
++	      else if (strcmp(name,"SurfaceloadOtherRate")==0) return SurfaceloadOtherRateEnum;
+ 	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+ 	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+ 	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+@@ -873,11 +874,11 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalBarystaticSeaLevelRate")==0) return SolidearthExternalBarystaticSeaLevelRateEnum;
+-	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
++	      if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
++	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+ 	      else if (strcmp(name,"StrainRatexx")==0) return StrainRatexxEnum;
+ 	      else if (strcmp(name,"StrainRatexy")==0) return StrainRatexyEnum;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"Outputdefinition58")==0) return Outputdefinition58Enum;
+ 	      else if (strcmp(name,"Outputdefinition59")==0) return Outputdefinition59Enum;
+ 	      else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum;
+-	      else if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
++	      if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
++	      else if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
+ 	      else if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
+ 	      else if (strcmp(name,"Outputdefinition63")==0) return Outputdefinition63Enum;
+ 	      else if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
+@@ -1119,11 +1120,11 @@
+ 	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
++	      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;
+@@ -1242,11 +1243,11 @@
+ 	      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 stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"Matestar")==0) return MatestarEnum;
++	      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,"Mathydro")==0) return MathydroEnum;
+@@ -1365,11 +1366,11 @@
+ 	      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;
+          else stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
++	      if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
++	      else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
+ 	      else if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
+ 	      else if (strcmp(name,"StressbalanceVerticalAnalysis")==0) return StressbalanceVerticalAnalysisEnum;
+ 	      else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 25957)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 25958)
+@@ -162,9 +162,9 @@
+ 		input_enum        = DamageDbarEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+-	else if(strcmp(string_in,"SurfaceloadIceThicknessChange")==0){
++	else if(strcmp(string_in,"SurfaceloadIceThicknessRate")==0){
+ 		const char* field = "md.solidearth.surfaceload.icethicknesschange";
+-		input_enum        = SurfaceloadIceThicknessChangeEnum;
++		input_enum        = SurfaceloadIceThicknessRateEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+ 	else if(strcmp(string_in,"NGiaRate")==0){
+@@ -177,9 +177,9 @@
+ 		input_enum        = DslGlobalAverageThermostericSeaLevelChangeEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+-	else if(strcmp(string_in,"SurfaceloadWaterHeightChange")==0){
++	else if(strcmp(string_in,"SurfaceloadWaterHeightRate")==0){
+ 		const char* field = "md.solidearth.surfaceload.waterheightchange";
+-		input_enum        = SurfaceloadWaterHeightChangeEnum;
++		input_enum        = SurfaceloadWaterHeightRateEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+ 	else if(strcmp(string_in,"UGiaRate")==0){
+Index: ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 25957)
++++ ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 25958)
+@@ -68,15 +68,42 @@
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'object',self,'data',3,'name','md.solidearth.external.nature','format','Integer'); %code 3 for mmeadditionalsolidearthsolution  class
+-			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',length(self.displacementeast),'format','Integer');
++			nummodels=length(self.displacementeast);
++			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+ 
++			%transform our cell array of time series into cell array of time series of rates 
++			for i=1:nummodels,
++				displacementeast=self.displacementeast{i}; 
++				displacementnorth=self.displacementnorth{i}; 
++				displacementup=self.displacementup{i}; 
++				geoid=self.geoid{i}; 
++				barystaticsealevel=self.barystaticsealevel{i}; 
++
++				time=displacementeast(end,:);
++				dt=diff(time,1,2);
++				
++				displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
++				displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
++				displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
++				geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
++				barystaticsealevel_rate=diff(barystaticsealevel(1:end-1,:),1,2)./dt;
++
++				self.displacementeast{i}=displacementeast_rate; 
++				self.displacementnorth{i}=displacementnorth_rate; 
++				self.displacementup{i}=displacementup_rate; 
++				self.geoid{i}=geoid_rate; 
++				self.barystaticsealevel{i}=barystaticsealevel_rate; 
++			end
++			
++			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++
+ 		end % }}}
++
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 			error('mmeadditionalsolidearthsolution error message: not implemented yet');
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 25957)
++++ ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 25958)
+@@ -69,13 +69,39 @@
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'object',self,'data',4,'name','md.solidearth.external.nature','format','Integer'); %code 4 for mmeofflinesolidearthsolution  class
+ 			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+-			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',length(self.displacementeast),'format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
++			nummodels=length(self.displacementeast);
++			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
+ 
++			%transform our cell array of time series into cell array of time series of rates 
++			for i=1:nummodels,
++				displacementeast=self.displacementeast{i}; 
++				displacementnorth=self.displacementnorth{i}; 
++				displacementup=self.displacementup{i}; 
++				geoid=self.geoid{i}; 
++				barystaticsealevel=self.barystaticsealevel{i}; 
++
++				time=displacementeast(end,:);
++				dt=diff(time,1,2);
++				
++				displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
++				displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
++				displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
++				geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
++				barystaticsealevel_rate=diff(barystaticsealevel(1:end-1,:),1,2)./dt;
++
++				self.displacementeast{i}=displacementeast_rate; 
++				self.displacementnorth{i}=displacementnorth_rate; 
++				self.displacementup{i}=displacementup_rate; 
++				self.geoid{i}=geoid_rate; 
++				self.barystaticsealevel{i}=barystaticsealevel_rate; 
++			end
++			
++			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
++
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 			error('mmeofflinesolidearthsolution error message: not implemented yet');
+Index: ../trunk-jpl/src/m/classes/surfaceload.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.m	(revision 25957)
++++ ../trunk-jpl/src/m/classes/surfaceload.m	(revision 25958)
+@@ -64,29 +64,92 @@
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-
++			
++			%deal with ice thickness change: {{{
+ 			if isempty(self.icethicknesschange),
+ 				self.icethicknesschange=zeros(md.mesh.numberofelements+1,1);
+ 			end
++
++			if isa(self.icethicknesschange,'cell'),
++				%transform our cell array of time series into cell array of time series of rates 
++				nummodels=length(self.icethicknesschange);
++				for i=1:nummodels,
++					icethicknesschange=self.icethicknesschange{i}; 
++					time=icethicknesschange(end,:);
++					dt=diff(time,1,2);
++					icethicknesschange_rate=diff(icethicknesschange(1:end-1,:),1,2)./dt;
++					self.icethicknesschange{i}=icethicknesschange_rate; 
++				end
++				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++			else
++				icethicknesschange=self.icethicknesschange;
++				time=icethicknesschange(end,:);
++				dt=diff(time,1,2);
++				icethicknesschange_rate=diff(icethicknesschange(1:end-1,:),1,2)./dt;
++				self.icethicknesschange=icethicknesschange_rate; 
++
++				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
++				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++			end
++			%}}}
++			%deal with water height change: {{{
+ 			if isempty(self.waterheightchange),
+ 				self.waterheightchange=zeros(md.mesh.numberofelements+1,1);
+ 			end
++
++			if isa(self.waterheightchange,'cell'),
++				%transform our cell array of time series into cell array of time series of rates 
++				nummodels=length(self.waterheightchange);
++				for i=1:nummodels,
++					waterheightchange=self.waterheightchange{i}; 
++					time=waterheightchange(end,:);
++					dt=diff(time,1,2);
++					waterheightchange_rate=diff(waterheightchange(1:end-1,:),1,2)./dt;
++					self.waterheightchange{i}=waterheightchange_rate; 
++				end
++				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++			else
++				waterheightchange=self.waterheightchange;
++				time=waterheightchange(end,:);
++				dt=diff(time,1,2);
++				waterheightchange_rate=diff(waterheightchange(1:end-1,:),1,2)./dt;
++				self.waterheightchange=waterheightchange_rate; 
++
++				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
++				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++			end
++			%}}}
++			%deal with other: {{{
+ 			if isempty(self.other),
+ 				self.other=zeros(md.mesh.numberofelements+1,1);
+ 			end
+-			if isa(self.icethicknesschange,'cell'),
+-				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
+-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++
++			if isa(self.otherchange,'cell'),
++				%transform our cell array of time series into cell array of time series of rates 
++				nummodels=length(self.otherchange);
++				for i=1:nummodels,
++					otherchange=self.otherchange{i}; 
++					time=otherchange(end,:);
++					dt=diff(time,1,2);
++					otherchange_rate=diff(otherchange(1:end-1,:),1,2)./dt;
++					self.otherchange{i}=otherchange_rate; 
++				end
++				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
+ 			else
+-				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
+-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++				otherchange=self.otherchange;
++				time=otherchange(end,:);
++				dt=diff(time,1,2);
++				otherchange_rate=diff(otherchange(1:end-1,:),1,2)./dt;
++				self.otherchange=otherchange_rate; 
++
++				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
++				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
+ 			end
++			%}}}
+ 
+-			WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
+-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','other','name','md.solidearth.surfaceload.other',...
+-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+-
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25958-25959.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25958-25959.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25958-25959.diff	(revision 26740)
@@ -0,0 +1,605 @@
+Index: ../trunk-jpl/externalpackages/autotools/install-debian-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-debian-linux.sh	(revision 25958)
++++ ../trunk-jpl/externalpackages/autotools/install-debian-linux.sh	(nonexistent)
+@@ -1,94 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-## Constants
+-#
+-AUTOCONF_VER="2.69"
+-AUTOMAKE_VER="1.16.1"
+-LIBTOOL_VER="2.4.2"
+-M4_VER="1.4.18"
+-
+-## Environment
+-#
+-export PATH="${ISSM_DIR}/externalpackages/autotools/install/bin:$PATH"
+-
+-# Cleanup
+-rm -rf install src
+-mkdir install
+-
+-# Install m4
+-echo " === INSTALLING M4 =="
+-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
+-tar -zxvf m4-${M4_VER}.tar.gz
+-mv m4-${M4_VER} src
+-cd src
+-
+-## Fixes required by glibc-2.28
+-#
+-# Source: http://www.linuxfromscratch.org/lfs/view/development/chapter06/m4.html
+-#
+-sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
+-echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
+-
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+-
+-# Install Autoconf
+-echo " === INSTALLING AUTOCONF =="
+-rm -rf src
+-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
+-tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
+-mv autoconf-${AUTOCONF_VER} src
+-cd src
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+-
+-# Install Automake
+-echo " === INSTALLING AUTOMAKE =="
+-rm -rf src
+-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
+-tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
+-mv automake-${AUTOMAKE_VER} src
+-cd src
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+-
+-# Install libtool
+-echo " === INSTALLING LIBTOOL =="
+-rm -rf src
+-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
+-tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
+-rm libtool-${LIBTOOL_VER}.tar.gz
+-mv libtool-${LIBTOOL_VER} src
+-cd src
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/autotools/install-debian-linux.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/autotools/install-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-linux.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/autotools/install-linux.sh	(revision 25959)
+@@ -0,0 +1,94 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++AUTOCONF_VER="2.69"
++AUTOMAKE_VER="1.16.1"
++LIBTOOL_VER="2.4.2"
++M4_VER="1.4.18"
++
++## Environment
++#
++export PATH="${ISSM_DIR}/externalpackages/autotools/install/bin:$PATH"
++
++# Cleanup
++rm -rf install src
++mkdir install
++
++# Install m4
++echo " === INSTALLING M4 =="
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
++tar -zxvf m4-${M4_VER}.tar.gz
++mv m4-${M4_VER} src
++cd src
++
++## Fixes required by glibc-2.28
++#
++# Source: http://www.linuxfromscratch.org/lfs/view/development/chapter06/m4.html
++#
++sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
++echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
++
++./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
++
++# Install Autoconf
++echo " === INSTALLING AUTOCONF =="
++rm -rf src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
++tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
++mv autoconf-${AUTOCONF_VER} src
++cd src
++./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
++
++# Install Automake
++echo " === INSTALLING AUTOMAKE =="
++rm -rf src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
++tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
++mv automake-${AUTOMAKE_VER} src
++cd src
++./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
++
++# Install libtool
++echo " === INSTALLING LIBTOOL =="
++rm -rf src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
++tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
++rm libtool-${LIBTOOL_VER}.tar.gz
++mv libtool-${LIBTOOL_VER} src
++cd src
++./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/autotools/install-linux.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh	(revision 25958)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh	(revision 25959)
+@@ -17,7 +17,7 @@
+ 
+ # Cleanup
+ rm -rf ${PREFIX} ${PETSC_DIR}
+-mkdir -p ${PREFIX} ${PETSC_DIR}
++mkdir -p ${PETSC_DIR}
+ 
+ # Move source to $PETSC_DIR
+ mv petsc-${VER}/* ${PETSC_DIR}
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh	(revision 25958)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh	(revision 25959)
+@@ -17,7 +17,7 @@
+ 
+ # Cleanup
+ rm -rf ${PREFIX} ${PETSC_DIR}
+-mkdir -p ${PREFIX} ${PETSC_DIR}
++mkdir -p ${PETSC_DIR}
+ 
+ # Move source to $PETSC_DIR
+ mv petsc-${VER}/* ${PETSC_DIR}
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-mac.sh	(revision 25958)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-mac.sh	(revision 25959)
+@@ -6,7 +6,7 @@
+ #
+ VER="3.12.3"
+ 
+-PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+ PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+ 
+ # Download source
+@@ -17,7 +17,7 @@
+ 
+ # Cleanup
+ rm -rf ${PREFIX} ${PETSC_DIR}
+-mkdir -p ${PREFIX} ${PETSC_DIR}
++mkdir ${PETSC_DIR}
+ 
+ # Move source to $PETSC_DIR
+ mv petsc-${VER}/* ${PETSC_DIR}
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab	(revision 25959)
+@@ -40,7 +40,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux-static.sh
+ 	gsl			install-static.sh
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 25958)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 25959)
+@@ -5,7 +5,7 @@
+ steps=[1];
+ 
+ % parameter file to be used, choose between IsmipA.par or IsmipF.par
+-ParamFile='IsmipA.par'
++ParamFile='IsmipA.par';
+ 
+ %Run Steps
+ 
+Index: ../trunk-jpl/externalpackages/cmake/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/cmake/install.sh	(revision 25958)
++++ ../trunk-jpl/externalpackages/cmake/install.sh	(revision 25959)
+@@ -4,9 +4,9 @@
+ 
+ ## Constants
+ #
+-VER="3.19.1"
++VER="3.19.3"
+ 
+-PREFIX="${ISSM_DIR}/externalpackages/cmake/install" # Set to location where external package should be installed
++PREFIX="${ISSM_DIR}/cmake/install" # Set to location where external package should be installed
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/cmake-${VER}.tar.gz" "cmake-${VER}.tar.gz"
+@@ -15,21 +15,24 @@
+ tar -zxvf cmake-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf ${PREFIX}
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX}
+ 
+-# Move source into target directory
+-mv cmake-${VER} ${PREFIX}
++# Move source into 'src' directory
++mv cmake-${VER} src
+ 
+ # Configure
+-cd ${PREFIX}
++cd src
+ #./bootstrap \
+ #	--prefix=${PREFIX} # Breaks on ronne
+ ./configure \
+-	--prefix=${PREFIX}
++	--prefix="${PREFIX}"
+ 
+-# Compile
++# Compile and install
+ if [ $# -eq 0 ]; then
+ 	make
++	make install
+ else
+-	make -j $1;
++	make -j $1
++	make install -j $1
+ fi
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 25958)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 25959)
+@@ -6,7 +6,7 @@
+ #
+ VER="3.12.3"
+ 
+-PETSC_DIR=${ISSM_DIR}/externalpackages/petsc/src # DO NOT CHANGE THIS
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+ PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+ 
+ # Download source
+@@ -17,7 +17,7 @@
+ 
+ # Cleanup
+ rm -rf ${PREFIX} ${PETSC_DIR}
+-mkdir -p ${PREFIX} ${PETSC_DIR}
++mkdir ${PETSC_DIR}
+ 
+ # Move source to $PETSC_DIR
+ mv petsc-${VER}/* ${PETSC_DIR}
+Index: ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 25958)
++++ ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 25959)
+@@ -30,7 +30,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools		install-debian-linux.sh
++	autotools		install-linux.sh
+ 	cmake			install.sh
+ 	petsc			install-3.12-linux.sh
+ 	triangle		install-linux.sh
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25958)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25959)
+@@ -446,7 +446,7 @@
+ 	done
+ 
+ 	# Check that MATLAB did not exit in error
+-	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run" matlab_log.log | wc -l`
++	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|Illegal use of reserved keyword" matlab_log.log | wc -l`
+ 
+ 	if [ $matlabExitedInError -ne 0 ]; then
+ 		echo "----------MATLAB exited in error!----------"
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25958)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25959)
+@@ -16,21 +16,21 @@
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+ 	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
+-	--with-mpi-include=${ISSM_EXT_DIR}/externalpackages/petsc/install/include \
+-	--with-mpi-libflags="-L${ISSM_EXT_DIR}/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+-	--with-blas-lapack-dir=${ISSM_EXT_DIR}/petsc/install \
+-	--with-metis-dir=${ISSM_EXT_DIR}/petsc/install \
+-	--with-scalapack-dir=${ISSM_EXT_DIR}/petsc/install \
+-	--with-mumps-dir=${ISSM_EXT_DIR}/petsc/install \
+-	--with-hdf5-dir=${ISSM_EXT_DIR}/petsc/install \
+-	--with-petsc-dir=${ISSM_EXT_DIR}/petsc/install \
+-	--with-gsl-dir=${ISSM_EXT_DIR}/gsl/install \
+-	--with-boost-dir=${ISSM_EXT_DIR}/boost/install \
+-	--with-dakota-dir=${ISSM_EXT_DIR}/dakota/install \
+-	--with-triangle-dir=${ISSM_EXT_DIR}/triangle/install \
+-	--with-chaco-dir=${ISSM_EXT_DIR}/chaco/install \
+-	--with-m1qn3-dir=${ISSM_EXT_DIR}/m1qn3/install \
+-	--with-semic-dir=${ISSM_EXT_DIR}/semic/install \
++	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
++	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
++	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
++	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
++	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
++	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
++	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
++	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+ '
+ 
+ #-------------------#
+Index: ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff	(revision 25959)
+@@ -37,7 +37,7 @@
+ #		external packages.
+ #
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion	(revision 25959)
+@@ -38,7 +38,7 @@
+ #		external packages.
+ #
+ EXTERNALPACKAGES="
+-	autotools		install-debian-linux.sh
++	autotools		install-linux.sh
+ 	cmake			install.sh
+ 	petsc			install-3.12-linux.sh
+ 	gsl				install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-basic	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-basic	(revision 25959)
+@@ -29,7 +29,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	triangle	install-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries	(revision 25959)
+@@ -37,7 +37,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux-static.sh
+ 	triangle	install-linux-static.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 25959)
+@@ -39,7 +39,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux-static.sh
+ 	gsl			install-static.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-codipack
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 25959)
+@@ -35,7 +35,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 25959)
+@@ -38,7 +38,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools		install-debian-linux.sh
++	autotools		install-linux.sh
+ 	cmake			install.sh
+ 	petsc			install-3.12-linux.sh
+ 	gsl				install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 25959)
+@@ -39,7 +39,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 25959)
+@@ -39,7 +39,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-gia
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-gia	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-gia	(revision 25959)
+@@ -30,7 +30,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	triangle	install-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-iceocean
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-iceocean	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-iceocean	(revision 25959)
+@@ -30,7 +30,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	triangle	install-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-javascript
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-javascript	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-javascript	(revision 25959)
+@@ -22,7 +22,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	emscripten	install.sh
+ 	gsl			install-javascript.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 25959)
+@@ -33,7 +33,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install-debian-linux.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25958)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25959)
+@@ -36,7 +36,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools		install-debian-linux.sh
++	autotools		install-linux.sh
+ 	cmake			install.sh
+ 	petsc			install-3.12-linux.sh
+ 	gsl				install.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-25959-25960.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25959-25960.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25959-25960.diff	(revision 26740)
@@ -0,0 +1,156 @@
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 25959)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 25960)
+@@ -43,7 +43,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessRateEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightRateEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.other",SurfaceloadOtherRateEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.otherchange",SurfaceloadOtherRateEnum);
+ 		
+ 	/*dynamic sea level: */
+ 	iomodel->FetchData(&dslmodel,"md.dsl.model");
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 25959)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 25960)
+@@ -168,8 +168,8 @@
+ 		}
+ 
+ 
+-		if (femmodel->inputs->GetInputObjectEnum(SurfaceloadIceThicknessChangeEnum)==DatasetInputEnum)
+-			MmeToInput(femmodel,distributed_values,variable_partition,npart,SurfaceloadIceThicknessChangeEnum, P0Enum);
++		if (femmodel->inputs->GetInputObjectEnum(SurfaceloadIceThicknessRateEnum)==DatasetInputEnum)
++			MmeToInput(femmodel,distributed_values,variable_partition,npart,SurfaceloadIceThicknessRateEnum, P0Enum);
+ 
+ 		if (femmodel->inputs->GetInputObjectEnum(MaskIceLevelsetEnum)==DatasetInputEnum)
+ 			MmeToInput(femmodel,distributed_values,variable_partition,npart,MaskIceLevelsetEnum, P1Enum);
+@@ -258,7 +258,7 @@
+ 		}
+ 	}
+ 
+-	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
++	/*wipe out existing SurfaceloadIceThicknessRateEnum dataset:*/
+ 	femmodel->inputs->ChangeEnum(DummyEnum,rootenum);
+ 
+ 	//reconfigure:
+Index: ../trunk-jpl/src/m/classes/surfaceload.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.m	(revision 25959)
++++ ../trunk-jpl/src/m/classes/surfaceload.m	(revision 25960)
+@@ -7,7 +7,7 @@
+ 	properties (SetAccess=public) 
+ 		icethicknesschange     = [];
+ 		waterheightchange      = [];
+-		other                  = [];
++		otherchange            = [];
+ 	end
+ 	methods
+ 		function self = surfaceload(varargin) % {{{
+@@ -22,7 +22,7 @@
+ 		
+ 			icethicknesschange=[];
+ 			waterheightchange=[];
+-			other=[];
++			otherchange=[];
+ 		
+ 		end % }}}
+ 			function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -42,7 +42,7 @@
+ 			if ~isempty(self.waterheightchange),
+ 				md = checkfield(md,'fieldname','solidearth.surfaceload.waterheightchange','timeseries',1,'NaN',1,'Inf',1);
+ 			end
+-			if ~isempty(self.other),
++			if ~isempty(self.otherchange),
+ 				md = checkfield(md,'fieldname','solidearth.surfaceload.other','timeseries',1,'NaN',1,'Inf',1);
+ 			end
+ 
+@@ -60,7 +60,7 @@
+ 
+ 			fielddisplay(self,'icethicknesschange','thickness change: ice height equivalent [mIce/yr]');
+ 			fielddisplay(self,'waterheightchange','water height change: water height equivalent [mWater/yr]');
+-			fielddisplay(self,'other','other loads (sediments) [kg/m^2/yr]');
++			fielddisplay(self,'otherchange','other loads (sediments) [kg/m^2/yr]');
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -69,6 +69,8 @@
+ 			if isempty(self.icethicknesschange),
+ 				self.icethicknesschange=zeros(md.mesh.numberofelements+1,1);
+ 			end
++			
++			yts=md.constants.yts;
+ 
+ 			if isa(self.icethicknesschange,'cell'),
+ 				%transform our cell array of time series into cell array of time series of rates 
+@@ -81,7 +83,7 @@
+ 					self.icethicknesschange{i}=icethicknesschange_rate; 
+ 				end
+ 				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
+-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+ 			else
+ 				icethicknesschange=self.icethicknesschange;
+ 				time=icethicknesschange(end,:);
+@@ -90,7 +92,7 @@
+ 				self.icethicknesschange=icethicknesschange_rate; 
+ 
+ 				WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',...
+-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+ 			end
+ 			%}}}
+ 			%deal with water height change: {{{
+@@ -109,7 +111,7 @@
+ 					self.waterheightchange{i}=waterheightchange_rate; 
+ 				end
+ 				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
+-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+ 			else
+ 				waterheightchange=self.waterheightchange;
+ 				time=waterheightchange(end,:);
+@@ -118,12 +120,12 @@
+ 				self.waterheightchange=waterheightchange_rate; 
+ 
+ 				WriteData(fid,prefix,'object',self,'fieldname','waterheightchange','name','md.solidearth.surfaceload.waterheightchange',...
+-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+ 			end
+ 			%}}}
+ 			%deal with other: {{{
+-			if isempty(self.other),
+-				self.other=zeros(md.mesh.numberofelements+1,1);
++			if isempty(self.otherchange),
++				self.otherchange=zeros(md.mesh.numberofelements+1,1);
+ 			end
+ 
+ 			if isa(self.otherchange,'cell'),
+@@ -137,7 +139,7 @@
+ 					self.otherchange{i}=otherchange_rate; 
+ 				end
+ 				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
+-				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+ 			else
+ 				otherchange=self.otherchange;
+ 				time=otherchange(end,:);
+@@ -146,7 +148,7 @@
+ 				self.otherchange=otherchange_rate; 
+ 
+ 				WriteData(fid,prefix,'object',self,'fieldname','otherchange','name','md.solidearth.surfaceload.otherchange',...
+-				'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts,'scale',1/yts);
++				'format','MatArray','timeserieslength',md.mesh.numberofelements+1,'yts',yts,'scale',1/yts);
+ 			end
+ 			%}}}
+ 
+@@ -155,7 +157,7 @@
+ 
+ 			writejs1Darray(fid,[modelname '.surfaceload.icethicknesschange'],self.icethicknesschange);
+ 			writejs1Darray(fid,[modelname '.surfaceload.waterheightchange'],self.waterheightchange);
+-			writejs1Darray(fid,[modelname '.surfaceload.other'],self.other);
++			writejs1Darray(fid,[modelname '.surfaceload.otherchange'],self.otherchange);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-25960-25961.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25960-25961.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25960-25961.diff	(revision 26740)
@@ -0,0 +1,58 @@
+Index: ../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.py	(revision 25960)
++++ ../trunk-jpl/src/m/classes/transient.py	(revision 25961)
+@@ -21,7 +21,7 @@
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+         self.ishydrology = 0
+-        self.isslr = 0
++        self.isslc = 0
+         self.iscoupler = 0
+         self.amr_frequency = 0
+         self.isoceancoupling = 0
+@@ -42,7 +42,7 @@
+         s += '{}\n'.format(fielddisplay(self, 'isdamageevolution', 'indicates whether damage evolution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'ismovingfront', 'indicates whether a moving front capability is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'ishydrology', 'indicates whether an hydrology model is used'))
+-        s += '{}\n'.format(fielddisplay(self, 'isslr', 'indicates if a sea level rise solution is used in the transient'))
++        s += '{}\n'.format(fielddisplay(self, 'isslc', 'indicates if a sea level change solution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isoceancoupling', 'indicates whether coupling with an ocean model is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'iscoupler', 'indicates whether different models are being run with need for coupling'))
+         s += '{}\n'.format(fielddisplay(self, 'amr_frequency', 'frequency at which mesh is refined in simulations with multiple time_steps'))
+@@ -68,7 +68,7 @@
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+         self.ishydrology = 0
+-        self.isslr = 0
++        self.isslc = 0
+         self.isoceancoupling = 0
+         self.iscoupler = 0
+         self.amr_frequency = 0
+@@ -90,7 +90,7 @@
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+         self.ishydrology = 0
+-        self.isslr = 0
++        self.isslc = 0
+         self.isoceancoupling = 0
+         self.iscoupler = 0
+         self.amr_frequency = 0
+@@ -115,7 +115,7 @@
+         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.isslc', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isoceancoupling', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.iscoupler', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.amr_frequency', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+@@ -138,7 +138,7 @@
+         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', 'isslc', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceancoupling', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'iscoupler', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'amr_frequency', 'format', 'Integer')
Index: /issm/oecreview/Archive/25834-26739/ISSM-25961-25962.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25961-25962.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25961-25962.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 25961)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 25962)
+@@ -43,7 +43,7 @@
+         # Early return
+         if 'SealevelriseAnalysis' not in analyses:
+             return md
+-        if solution == 'TransientSolution' and md.transient.isslr == 0:
++        if solution == 'TransientSolution' and md.transient.isslc == 0:
+             return md
+         md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level_change', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_change_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+Index: ../trunk-jpl/src/m/classes/giamme.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/giamme.py	(revision 25961)
++++ ../trunk-jpl/src/m/classes/giamme.py	(revision 25962)
+@@ -41,7 +41,7 @@
+     def checkconsistency(self, md, solution, analyses): # {{{
+         if 'SealevelriseAnalysis' not in analyses:
+             return md
+-        if solution == 'TransientSolution' and not md.transient.isslr:
++        if solution == 'TransientSolution' and not md.transient.isslc:
+             return md
+         md = checkfield(md, 'field', self.Ngia, 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'field', self.Ugia, 'NaN', 1, 'Inf', 1)
+Index: ../trunk-jpl/src/m/classes/solidearth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.py	(revision 25961)
++++ ../trunk-jpl/src/m/classes/solidearth.py	(revision 25962)
+@@ -79,7 +79,7 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
++        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+         md = checkfield(md, 'fieldname', 'solidearth.initialsealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+         md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1)
Index: /issm/oecreview/Archive/25834-26739/ISSM-25962-25963.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25962-25963.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25962-25963.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 25962)
++++ ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 25963)
+@@ -78,5 +78,5 @@
+ # NOTE:
+ # - Test 2021 is excluded as Gmsh produces different-sized meshes on macOS and Linux for 3d objects (archives are generated on macOS).
+ #
+-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2021]"
+-PYTHON_NROPTIONS="--benchmark slr --exclude 2021"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2021]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2021"
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 25962)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 25963)
+@@ -84,5 +84,5 @@
+ # NOTE:
+ # - Excluding 2006 until it can be debugged (file I/O)
+ #
+-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2006]"
+-PYTHON_NROPTIONS="--benchmark slr --exclude 2005 2006"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2006]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2005 2006"
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25962)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 25963)
+@@ -90,5 +90,5 @@
+ # generated on macOS).
+ # - Excluding 2006 until it can be debugged (PETSc crash)
+ #
+-MATLAB_NROPTIONS="'benchmark','slr','exclude',[2002 2003 2005 2006 2010 2021 2101]"
+-PYTHON_NROPTIONS="--benchmark slr --exclude 2002 2003 2005 2006 2010 2021 2101"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2005 2006 2010 2021 2101]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2005 2006 2010 2021 2101"
Index: /issm/oecreview/Archive/25834-26739/ISSM-25963-25964.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25963-25964.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25963-25964.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25963)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25964)
+@@ -484,9 +484,6 @@
+ 
+ 		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
+@@ -500,6 +497,20 @@
+ 		juLog -test=Example-$i -name=Error -error=ERROR awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
+ 		juLog -test=Example-$i -name=Failure -error=FAILURE awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
+ 	done
++
++	# Check that MATLAB did not exit in error
++	matlabExitedInError=`grep -E "Activation cannot proceed|Error in matlab_run|Illegal use of reserved keyword" matlab_log_examples.log | wc -l`
++
++	if [ $matlabExitedInError -ne 0 ]; then
++		echo "----------MATLAB exited in error!----------"
++		cat matlab_log_examples.log
++		echo "-----------End of matlab_log.log-----------"
++
++		# Clean up execution directory
++		rm -rf $ISSM_DIR/execution/*
++
++		exit 1
++	fi
+ fi
+ 
+ # Clean up execution directory
Index: /issm/oecreview/Archive/25834-26739/ISSM-25964-25965.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25964-25965.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25964-25965.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25964)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25965)
+@@ -488,7 +488,7 @@
+ 
+ if [ $EXAMPLES_TEST -eq 1 ]; then
+ 	# Inexplicably, there are backspace chars in the error output that are causing issues
+-	sed -i '.bak' 's///g' matlab_log_examples.log
++	sed -i '.bak' 's/\x08//g' matlab_log_examples.log
+ 
+ 	numtests=`cat matlab_log_examples.log | grep "starting: " | wc -l`
+ 	testlist=`cat matlab_log_examples.log | grep "starting: " | sed 's/starting: //'`
Index: /issm/oecreview/Archive/25834-26739/ISSM-25965-25966.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25965-25966.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25965-25966.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25965)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25966)
+@@ -487,8 +487,8 @@
+ fi
+ 
+ if [ $EXAMPLES_TEST -eq 1 ]; then
+-	# Inexplicably, there are backspace chars in the error output that are causing issues
+-	sed -i '.bak' 's/\x08//g' matlab_log_examples.log
++	# Inexplicably, there are backspace characters in the error output; remove them
++	perl -p -i'.bak' -e 's/\x08//g' matlab_log_examples.log
+ 
+ 	numtests=`cat matlab_log_examples.log | grep "starting: " | wc -l`
+ 	testlist=`cat matlab_log_examples.log | grep "starting: " | sed 's/starting: //'`
Index: /issm/oecreview/Archive/25834-26739/ISSM-25966-25967.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25966-25967.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25966-25967.diff	(revision 26740)
@@ -0,0 +1,104 @@
+Index: ../trunk-jpl/externalpackages/gdal/install-3-python-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-python-static.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/gdal/install-3-python-static.sh	(revision 25967)
+@@ -23,7 +23,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf gdal-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/gdal/install-3-python.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-python.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/gdal/install-3-python.sh	(revision 25967)
+@@ -19,7 +19,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf gdal-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/gdal/install-3-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3-static.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/gdal/install-3-static.sh	(revision 25967)
+@@ -23,7 +23,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf gdal-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/gdal/install-3.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-3.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/gdal/install-3.sh	(revision 25967)
+@@ -15,7 +15,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${VER}.tar.gz" "gdal-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf gdal-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh	(revision 25967)
+@@ -29,7 +29,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf proj-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-static.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-static.sh	(revision 25967)
+@@ -29,7 +29,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf proj-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh	(revision 25967)
+@@ -29,7 +29,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf proj-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/proj/install-6.2.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2.sh	(revision 25966)
++++ ../trunk-jpl/externalpackages/proj/install-6.2.sh	(revision 25967)
+@@ -29,7 +29,7 @@
+ mkdir -p ${PREFIX} src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf proj-${VER}.tar.gz
Index: /issm/oecreview/Archive/25834-26739/ISSM-25967-25968.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25967-25968.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25967-25968.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/externalpackages/gdal/install-1.10-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-1.10-macosx64.sh	(revision 25967)
++++ ../trunk-jpl/externalpackages/gdal/install-1.10-macosx64.sh	(revision 25968)
+@@ -10,7 +10,7 @@
+ 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"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
+ 
+ # Untar
+ tar -zxvf gdal-${GDAL_VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/gdal/install-1.11.2-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gdal/install-1.11.2-macosx64.sh	(revision 25967)
++++ ../trunk-jpl/externalpackages/gdal/install-1.11.2-macosx64.sh	(revision 25968)
+@@ -10,7 +10,7 @@
+ 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"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
+ 
+ # Untar
+ tar -zxvf gdal-${GDAL_VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/mpich/install-3.2-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/mpich/install-3.2-mac-static.sh	(revision 25967)
++++ ../trunk-jpl/externalpackages/mpich/install-3.2-mac-static.sh	(revision 25968)
+@@ -6,7 +6,7 @@
+ mkdir src install
+ 
+ #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
+ tar -zxvf  mpich-3.2.tar.gz
+Index: ../trunk-jpl/externalpackages/sqlite/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/sqlite/install.sh	(revision 25967)
++++ ../trunk-jpl/externalpackages/sqlite/install.sh	(revision 25968)
+@@ -9,7 +9,7 @@
+ mkdir install src
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/sqlite-autoconf-${VER}.tar.gz" "sqlite-autoconf-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/sqlite-autoconf-${VER}.tar.gz" "sqlite-autoconf-${VER}.tar.gz"
+ 
+ # Unpack source
+ tar -zxvf sqlite-autoconf-$VER.tar.gz
Index: /issm/oecreview/Archive/25834-26739/ISSM-25968-25969.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25968-25969.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25968-25969.diff	(revision 26740)
@@ -0,0 +1,85 @@
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 25968)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 25969)
+@@ -17,6 +17,23 @@
+ 		partitionice           = [];
+ 		partitionhydro         = [];
+ 	end
++	methods (Static)
++		function self = loadobj(self) % {{{
++			% This function is directly called by matlab when a model object is
++			% loaded. If the input is a struct it is an old version of this class and
++			% old fields must be recovered (make sure they are in the deprecated
++			% model properties)
++
++			if isstruct(self)
++				% 2021, Jan 10
++				if isfield(self,'sealevel')
++					self.initialsealevel = self.sealevel;
++				end
++				self = structtoobj(solidearth(),self);
++
++			end
++		end% }}}
++	end
+ 	methods
+ 		function self = solidearth(varargin) % {{{
+ 			switch nargin
+@@ -75,7 +92,7 @@
+ 		function disp(self) % {{{
+ 			disp(sprintf('   solidearth inputs, forcings and settings:'));
+ 
+-			fielddisplay(self,'initialsealevel','sea level at the start of computation) [m]');
++			fielddisplay(self,'initialsealevel','sea level at the start of computation [m]');
+ 			fielddisplay(self,'planetradius','planet radius [m]');
+ 			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
+ 			fielddisplay(self,'requested_outputs','additional outputs requested');
+Index: ../trunk-jpl/src/m/classes/solidearth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.py	(revision 25968)
++++ ../trunk-jpl/src/m/classes/solidearth.py	(revision 25969)
+@@ -40,7 +40,6 @@
+         else:
+             raise Exception('solidearth constructor error message: zero or one argument only!')
+     #}}}
+-
+     def __repr__(self):  # {{{
+         s = '   solidearthinputs, forcings and settings:\n'
+         s += '{}\n'.format(fielddisplay(self, 'initialsealevel', 'sea level at the start of computation [m]'))
+@@ -59,7 +58,6 @@
+             print(self.external)
+         return s
+     #}}}
+-
+     def setdefaultparameters(self, planet):  # {{{
+         # Default output
+         self.requested_outputs = ['default']
+@@ -77,7 +75,6 @@
+         # Earth radius
+         self.planetradius = planetradius(planet)
+     #}}}
+-
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+@@ -95,11 +92,9 @@
+             self.external.checkconsistency(md,solution,analyses)
+         return md
+     #}}}
+-
+     def defaultoutputs(self, md):  #{{{
+         return ['Sealevel']
+     #}}}
+-
+     def marshall(self, prefix, md, fid):  #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'initialsealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
+@@ -135,7 +130,6 @@
+             outputs = np.append(outputs, self.defaultoutputs(md))  #add defaults
+         WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray')
+     #}}}
+-
+     def extrude(self, md): #{{{
+         self.initialsealevel = project3d(md, 'vector', self.initialsealevel, 'type', 'node')
+         return self
Index: /issm/oecreview/Archive/25834-26739/ISSM-25969-25970.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25969-25970.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25969-25970.diff	(revision 26740)
@@ -0,0 +1,96 @@
+Index: ../trunk-jpl/src/m/classes/frictioncoulomb2.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(revision 25970)
+@@ -0,0 +1,91 @@
++%FRICTIONCOULOMB2 class definition
++%
++%   Usage:
++%      frictioncoulomb=frictioncoulomb2();
++
++classdef frictioncoulomb
++	properties (SetAccess=public) 
++		coefficient              = NaN;
++		m                        = NaN;
++		coupling                 = 0;
++		effective_pressure       = NaN;
++		effective_pressure_limit = 0;
++	end
++	methods
++		function self = extrude(self,md) % {{{
++			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
++			self.m=project3d(md,'vector',self.m,'type','element');
++			switch self.coupling
++				case 0
++				case 1
++					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
++				case 2
++					error('not implemented yet');
++				otherwise
++					error('not supported yet');		
++			end
++		end % }}}
++		function self = frictioncoulomb(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++
++			self.effective_pressure_limit = 0;
++
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			%Early return
++			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
++			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
++			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0 1 2]);
++			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);			
++			switch self.coupling
++				case 0
++				case 1
++					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
++				case 2
++					error('not implemented yet');
++				otherwise
++					error('not supported yet');		
++			end
++		end % }}}
++		function disp(self) % {{{
++         disp('Coulomb limited sliding law parameters:');
++         disp(' ');
++         disp('                     C^2 |u_b|^(m-1) * (.5*N)           ');
++         disp('      tau_b = - _________________________________   u_b ');
++         disp('                (C^(2/m) |u_b| + (0.5*N)^(1/m) )^m      ');
++         disp(' ');
++			fielddisplay(self,'coefficient','power law (Weertman) friction coefficient [SI]');
++			fielddisplay(self,'m','m exponent (Weertman would be 1/3)');
++			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
++			fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled (not implemented yet)');
++			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');	
++			end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++
++			WriteData(fid,prefix,'name','md.friction.law','data',13,'format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','m','format','DoubleMat','mattype',2);
++			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
++			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
++			switch self.coupling
++				case 0
++				case 1
++					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++				case 2
++					error('not implemented yet');
++				otherwise
++					error('not supported yet');		
++			end
++
++		end % }}}
++	end
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-25970-25971.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25970-25971.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25970-25971.diff	(revision 26740)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/externalpackages/gmsh/install-3.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-3.sh	(revision 25970)
++++ ../trunk-jpl/externalpackages/gmsh/install-3.sh	(revision 25971)
+@@ -36,3 +36,9 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
++
++# Make necessary link on RHEL
++if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
++	cd ${PREFIX}
++	ln -s ./lib64 ./lib
++fi
+Index: ../trunk-jpl/externalpackages/gmsh/install-4-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4-static.sh	(revision 25970)
++++ ../trunk-jpl/externalpackages/gmsh/install-4-static.sh	(revision 25971)
+@@ -64,3 +64,9 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
++
++# Make necessary link on RHEL
++if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
++	cd ${PREFIX}
++	ln -s ./lib64 ./lib
++fi
+Index: ../trunk-jpl/externalpackages/gmsh/install-4.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmsh/install-4.sh	(revision 25970)
++++ ../trunk-jpl/externalpackages/gmsh/install-4.sh	(revision 25971)
+@@ -62,3 +62,9 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
++
++# Make necessary link on RHEL
++if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
++	cd ${PREFIX}
++	ln -s ./lib64 ./lib
++fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25971-25972.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25971-25972.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25971-25972.diff	(revision 26740)
@@ -0,0 +1,27 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25971)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 25972)
+@@ -3014,22 +3014,13 @@
+ 	GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+ 	IssmDouble* values    = xNew<IssmDouble>(numnodes);
+ 
+-		if(this->Id()==104 || this->Id()==266 || this->Id()==264 || this->Id()==247 || this->Id()==263 || this->Id()==249 || this->Id()==250){
+-			if(enum_type==MaskIceLevelsetEnum) printf("-----------------\n");
+-		}
+-
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(int i=0;i<numnodes;i++){
+ 		values[i]=solution[doflist[i]];
+-		if(this->Id()==104 || this->Id()==266 || this->Id()==264 || this->Id()==247 || this->Id()==263 || this->Id()==249 || this->Id()==250){
+-			if(enum_type==MaskIceLevelsetEnum) printf("%g\n",values[i]);
+-			if(enum_type==MaskIceLevelsetEnum && values[i]>0.5 && values[i]<1.5 )this->nodes[i]->DeepEcho();
+-		}
+ 		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector, SID = " << this->Sid());
+ 	}
+ 
+-
+ 	/*Add input to the element: */
+ 	this->AddInput(enum_type,values,this->element_type);
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25972-25973.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25972-25973.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25972-25973.diff	(revision 26740)
@@ -0,0 +1,112 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25972)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25973)
+@@ -915,6 +915,17 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.friction.C",FrictionCEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.friction.f",FrictionfEnum);
+ 			break;
++		case 13:
++			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
++			iomodel->FetchDataToInput(inputs,elements,"md.friction.coefficient",FrictionCEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.friction.m",FrictionMEnum);
++			if(FrictionCoupling==3){
++				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
++			else if(FrictionCoupling==4){
++				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",EffectivePressureEnum);
++
++			}
++			break;
+ 		default:
+ 			_error_("friction law "<< frictionlaw <<" not supported");
+ 	}
+@@ -1028,6 +1039,10 @@
+ 			parameters->AddObject(new IntParam(FrictionCouplingEnum,2));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
+ 			break;
++		case 13:
++			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
++			break;
+ 		default: _error_("Friction law "<<frictionlaw<<" not implemented yet");
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 25972)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 25973)
+@@ -261,6 +261,9 @@
+ 		case 12:
+ 			GetAlpha2Tsai(palpha2,gauss);
+ 			break;
++		case 13:
++			GetAlpha2Coulomb2(palpha2,gauss);
++			break;
+ 	  default:
+ 			_error_("Friction law "<< this->law <<" not supported");
+ 	}
+@@ -739,7 +742,39 @@
+ 	/*Assign output pointers:*/
+ 	*palpha2=alpha2;
+ }/*}}}*/
++void Friction::GetAlpha2Coulomb2(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
+ 
++	/*This routine calculates the basal friction coefficient
++	 *
++	 *               C^2 |u_b|^(m-1) * (.5*N)
++	 * alpha2= ___________________________________
++	 *          (C^(2/m) |u_b| + (0.5*N)^(1/m) )^m
++	 *
++	 * */
++
++	/*diverse: */
++	IssmDouble  C,m,alpha2;
++
++	/*Recover parameters: */
++	element->GetInputValue(&C,gauss,FrictionCEnum);
++	element->GetInputValue(&m,gauss,FrictionMEnum);
++
++	/*Get effective pressure and velocity magnitude*/
++	IssmDouble N  = EffectivePressure(gauss);
++	IssmDouble ub = VelMag(gauss);
++
++	/*Compute alpha^2*/
++	if(ub<1e-10){
++		alpha2 = 0.;
++	}
++	else{
++		alpha2= (pow(C,2)*pow(ub,m-1.)*(0.5*N)) / pow(pow(C,2./m)*ub + pow(0.5*N,1./m),m);
++	}
++
++	/*Assign output pointers:*/
++	*palpha2=alpha2;
++}/*}}}*/
++
+ IssmDouble Friction::EffectivePressure(Gauss* gauss){/*{{{*/
+ 	/*Get effective pressure as a function of  flag */
+ 
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 25972)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 25973)
+@@ -31,6 +31,7 @@
+ 		void  GetAlphaWeertmanComplement(IssmDouble* alpha_complement,Gauss* gauss);
+ 		void  GetAlpha2(IssmDouble* palpha2,Gauss* gauss);
+ 		void  GetAlpha2Coulomb(IssmDouble* palpha2,Gauss* gauss);
++		void  GetAlpha2Coulomb2(IssmDouble* palpha2,Gauss* gauss);
+ 		void  GetAlpha2Hydro(IssmDouble* palpha2,Gauss* gauss);
+ 		void  GetAlpha2Josh(IssmDouble* palpha2,Gauss* gauss);
+ 		void  GetAlpha2Shakti(IssmDouble* palpha2,Gauss* gauss);
+Index: ../trunk-jpl/src/m/classes/frictioncoulomb2.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(revision 25972)
++++ ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(revision 25973)
+@@ -3,7 +3,7 @@
+ %   Usage:
+ %      frictioncoulomb=frictioncoulomb2();
+ 
+-classdef frictioncoulomb
++classdef frictioncoulomb2
+ 	properties (SetAccess=public) 
+ 		coefficient              = NaN;
+ 		m                        = NaN;
Index: /issm/oecreview/Archive/25834-26739/ISSM-25973-25974.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25973-25974.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25973-25974.diff	(revision 26740)
@@ -0,0 +1,62 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25973)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 25974)
+@@ -917,7 +917,7 @@
+ 			break;
+ 		case 13:
+ 			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
+-			iomodel->FetchDataToInput(inputs,elements,"md.friction.coefficient",FrictionCEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.friction.C",FrictionCEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.friction.m",FrictionMEnum);
+ 			if(FrictionCoupling==3){
+ 				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
+Index: ../trunk-jpl/src/m/classes/frictioncoulomb2.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(revision 25973)
++++ ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(revision 25974)
+@@ -5,7 +5,7 @@
+ 
+ classdef frictioncoulomb2
+ 	properties (SetAccess=public) 
+-		coefficient              = NaN;
++		C                        = NaN;
+ 		m                        = NaN;
+ 		coupling                 = 0;
+ 		effective_pressure       = NaN;
+@@ -13,7 +13,7 @@
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+-			self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1);
++			self.C=project3d(md,'vector',self.C,'type','node','layer',1);
+ 			self.m=project3d(md,'vector',self.m,'type','element');
+ 			switch self.coupling
+ 				case 0
+@@ -42,7 +42,7 @@
+ 
+ 			%Early return
+ 			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
+-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
+ 			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0 1 2]);
+ 			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);			
+@@ -63,7 +63,7 @@
+          disp('      tau_b = - _________________________________   u_b ');
+          disp('                (C^(2/m) |u_b| + (0.5*N)^(1/m) )^m      ');
+          disp(' ');
+-			fielddisplay(self,'coefficient','power law (Weertman) friction coefficient [SI]');
++			fielddisplay(self,'C','friction coefficient [SI]');
+ 			fielddisplay(self,'m','m exponent (Weertman would be 1/3)');
+ 			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
+ 			fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled (not implemented yet)');
+@@ -72,7 +72,7 @@
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			WriteData(fid,prefix,'name','md.friction.law','data',13,'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','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','m','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
Index: /issm/oecreview/Archive/25834-26739/ISSM-25974-25975.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25974-25975.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25974-25975.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 25974)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 25975)
+@@ -122,6 +122,11 @@
+ 		input_enum        = FrictionCoefficientEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
++	else if(strcmp(string_in,"FrictionC")==0 || strcmp(string_in,"md.friction.C")==0){
++		const char* field = "md.friction.C";
++		input_enum        = 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;
Index: /issm/oecreview/Archive/25834-26739/ISSM-25975-25976.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25975-25976.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25975-25976.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 25975)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 25976)
+@@ -124,7 +124,7 @@
+ 	}
+ 	else if(strcmp(string_in,"FrictionC")==0 || strcmp(string_in,"md.friction.C")==0){
+ 		const char* field = "md.friction.C";
+-		input_enum        = FrictionCoefficientEnum;
++		input_enum        = FrictionCEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+ 	else if(strcmp(string_in,"FrictionEffectivePressure")==0){
Index: /issm/oecreview/Archive/25834-26739/ISSM-25976-25977.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25976-25977.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25976-25977.diff	(revision 26740)
@@ -0,0 +1,279 @@
+Index: ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh	(revision 25976)
++++ ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh	(nonexistent)
+@@ -1,131 +0,0 @@
+-#!/bin/sh
+-### Copyright 2010 Manuel Carrasco Moñino. (manolo at apache.org) 
+-###
+-### Licensed under the Apache License, Version 2.0.
+-### You may obtain a copy of it at
+-### http://www.apache.org/licenses/LICENSE-2.0
+-
+-###
+-### A library for shell scripts which creates reports in jUnit format.
+-### These reports can be used in Hudson, or any other CI.
+-###
+-### Usage: 
+-###     - Include this file in your shell script
+-###     - Use juLog to call your command any time you want to produce a new report
+-###        Usage:   juLog <options> command arguments
+-###           options:
+-###             -name="TestName" : the test name which will be shown in the junit report
+-###             -error="RegExp"  : a regexp which sets the test as failure when the output matches it
+-###             -ierror="RegExp" : same as -error but case insensitive
+-###     - Junit reports are left in the folder 'result' under the directory where the script is executed.
+-###     - Configure hudson to parse junit files from the generated folder
+-###
+-
+-asserts=00; errors=0; total=0; content=""
+-
+-# create output folder
+-juDIR=`pwd`/results
+-mkdir -p $juDIR || exit
+-
+-# The name of the suite is calculated based in your script name
+-suite=`basename $0 | sed -e 's/.sh$//' | tr "." "_"`
+-
+-# A wrapper for the eval method witch allows catching seg-faults and use tee
+-errfile=/tmp/evErr.$$.log
+-eVal() {
+-  eval "$1"
+-  echo $? | tr -d "\n" >$errfile
+-}
+-
+-# Method to clean old tests
+-juLogClean() {
+-  echo "+++ Removing old junit reports from: $juDIR "
+-  rm -f $juDIR/TEST-*	
+-}
+-
+-# Execute a command and record its results 
+-juLog() {
+-  
+-  # parse arguments
+-  ya=""; icase=""; testname="";
+-  while [ -z "$ya" ]; do  
+-    case "$1" in
+-  	  -name=*)   name=$asserts-`echo "$1" | sed -e 's/-name=//'`;   shift;;
+-      -ierror=*) ereg=`echo "$1" | sed -e 's/-ierror=//'`; icase="-i"; shift;;
+-      -error=*)  ereg=`echo "$1" | sed -e 's/-error=//'`;  shift;;
+-      -test=*)  testname=`echo "$1" | sed -e 's/-test=//'`;  shift;;
+-      *)         ya=1;;
+-    esac
+-  done  
+-
+-  # use first arg as name if it was not given 
+-  if [ -z "$name" ]; then
+-    name="$asserts-$1" 
+-    shift
+-  fi
+-
+-  # calculate command to eval
+-  [ -z "$1" ] && return
+-  cmd="$1"; shift
+-  while [ -n "$1" ]
+-  do
+-     cmd="$cmd \"$1\""
+-     shift
+-  done
+-
+-  # eval the command sending output to a file
+-  outf=/var/tmp/ju$$.txt
+-  >$outf
+-  echo ""                         | tee -a $outf
+-  echo "+++ Running case: $testname " | tee -a $outf
+-  echo "+++ working dir: "`pwd`           | tee -a $outf
+-  #echo "+++ command: $cmd"            | tee -a $outf
+-  ini=`date +%s`
+-  eVal "$cmd" 2>&1                | tee -a $outf
+-  evErr=`cat $errfile`
+-  rm -f $errfile
+-  end=`date +%s`
+-  echo "+++ exit code: $evErr"        | tee -a $outf
+-  
+-  # set the appropriate error, based in the exit code and the regex  
+-  [ $evErr != 0 ] && err=1 || err=0
+-  out=`cat $outf | sed -e 's/^\([^+]\)/| \1/g'`
+-  if [ $err = 0 -a -n "$ereg" ]; then
+-      H=`echo "$out" | egrep $icase "$ereg"`
+-      [ -n "$H" ] && err=1
+-  fi
+-  echo "+++ error: $err"         | tee -a $outf
+-  rm -f $outf
+-
+-  # calculate vars
+-  asserts=`expr $asserts + 1`
+-  asserts=`printf "%.2d" $asserts`
+-  errors=`expr $errors + $err`
+-  time=`expr $end - $ini`
+-  total=`expr $total + $time`
+-
+-  # write the junit xml report
+-  ## failure tag
+-  [ $err = 0 ] && failure="" || failure="
+-      <failure type=\"ScriptError\" message=\"Script Error\"></failure>
+-  "
+-  ## testcase tag
+-  content="$content
+-    <testcase assertions=\"1\" name=\"$testname $ereg\" time=\"$time\">
+-    $failure
+-    <system-out>
+-<![CDATA[
+-$out
+-]]>
+-    </system-out>
+-    </testcase>
+-  "
+-  ## testsuite block
+-  cat <<EOF >$juDIR/TEST-$suite.xml
+-  <testsuite failures="0" assertions="$assertions" name="ISSM Test Suite" tests="1" errors="$errors" time="$total">
+-    $content
+-  </testsuite>
+-EOF
+-
+-}
+-
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/install.sh.old
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/install.sh.old	(revision 25976)
++++ ../trunk-jpl/externalpackages/shell2junit/install.sh.old	(nonexistent)
+@@ -1,20 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf shell2junit
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shell2junit-1.0.0.zip' 'shell2junit-1.0.0.zip'
+-
+-#Untar 
+-unzip shell2junit-1.0.0.zip
+-
+-#Move shell2junit into install directory
+-mv shell2junit/* src
+-rm -rf shell2junit
+-
+-#Copy executable: 
+-cp src/sh2ju.sh install
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/install.sh.old
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/README
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/README	(revision 25976)
++++ ../trunk-jpl/externalpackages/shell2junit/README	(nonexistent)
+@@ -1,9 +0,0 @@
+-http://code.google.com/p/shell2junit/
+-
+-Shell2junit
+-
+-Shell2junit is a simple utility which facilitates to generate junit reports for batch processes executed in shell scripts. 
+-
+-The reports can be easily parsed in Hudson and other CI software in order to monitor and generate trends and alerts. 
+-
+-This page teaches how to do it in Hudson. 
+Index: ../trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip
+___________________________________________________________________
+Deleted: svn:mime-type
+## -1 +0,0 ##
+-application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25976)
++++ ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25977)
+@@ -2,8 +2,24 @@
+ set -eu
+ 
+ 
+-#Some cleanup
+-rm -rf install 
+-mkdir install 
++## Constants
++#
++VER="1.0.0"
+ 
+-cp patch/sh2ju.sh install/
++PREFIX="${ISSM_DIR}/externalpackages/shell2junit/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX}
++mkdir -p ${PREFIX}/bin
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/shell2junit-${VER}.zip" "shell2junit-${VER}.zip"
++
++# Unpack source
++unzip -q shell2junit-${VER}.zip
++
++# Install
++mv shell2junit-${VER}/sh2ju.sh ${PREFIX}/bin
++
++# Cleanup
++rm -rf shell2junit-${VER}
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25976)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25977)
+@@ -431,7 +431,7 @@
+ #process logs to be junit compatible
+ #{{{
+ cd $ISSM_DIR/nightlylog/
+-source $ISSM_DIR/externalpackages/shell2junit/install/sh2ju.sh
++source $ISSM_DIR/externalpackages/shell2junit/install/bin/sh2ju.sh
+ juLogClean
+ 
+ if [ $MATLAB_TEST -eq 1 ]; then
+@@ -441,8 +441,8 @@
+ 
+ 	#look through numtests:
+ 	for i in `echo $testlist`; do
+-		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" matlab_log.log
+-		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" matlab_log.log
++		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" matlab_log.log
++		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" matlab_log.log
+ 	done
+ 
+ 	# Check that MATLAB did not exit in error
+@@ -467,8 +467,8 @@
+ 
+ 	#look through numtests:
+ 	for i in `echo $testlist`; do
+-		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" python_log.log
+-		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" python_log.log
++		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" python_log.log
++		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" python_log.log
+ 	done
+ 
+ 	# Check that Python did not exit in error
+@@ -494,8 +494,8 @@
+ 	testlist=`cat matlab_log_examples.log | grep "starting: " | sed 's/starting: //'`
+ 
+ 	for i in `echo $testlist`; do
+-		juLog -test=Example-$i -name=Error -error=ERROR awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
+-		juLog -test=Example-$i -name=Failure -error=FAILURE awk "/starting: $i/{flag=1;next}/finished: $i/{flag=0} flag{print}" matlab_log_examples.log
++		juLog -test=Example-$i -name=Error -error=ERROR awk "/^starting: ${i}$/{flag=1;next}/^finished: ${i}$/{flag=0} flag{print}" matlab_log_examples.log
++		juLog -test=Example-$i -name=Failure -error=FAILURE awk "/^starting: ${i}$/{flag=1;next}/^finished: ${i}$/{flag=0} flag{print}" matlab_log_examples.log
+ 	done
+ 
+ 	# Check that MATLAB did not exit in error
Index: /issm/oecreview/Archive/25834-26739/ISSM-25977-25978.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25977-25978.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25977-25978.diff	(revision 26740)
@@ -0,0 +1,233 @@
+Index: ../trunk-jpl/externalpackages/shell2junit/README
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/README	(nonexistent)
++++ ../trunk-jpl/externalpackages/shell2junit/README	(revision 25978)
+@@ -0,0 +1,9 @@
++http://code.google.com/p/shell2junit/
++
++Shell2junit
++
++Shell2junit is a simple utility which facilitates to generate junit reports for batch processes executed in shell scripts. 
++
++The reports can be easily parsed in Hudson and other CI software in order to monitor and generate trends and alerts. 
++
++This page teaches how to do it in Hudson. 
+Index: ../trunk-jpl/externalpackages/shell2junit/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25977)
++++ ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25978)
+@@ -2,24 +2,8 @@
+ set -eu
+ 
+ 
+-## Constants
+-#
+-VER="1.0.0"
++#Some cleanup
++rm -rf install 
++mkdir install 
+ 
+-PREFIX="${ISSM_DIR}/externalpackages/shell2junit/install" # Set to location where external package should be installed
+-
+-# Cleanup
+-rm -rf ${PREFIX}
+-mkdir -p ${PREFIX}/bin
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/shell2junit-${VER}.zip" "shell2junit-${VER}.zip"
+-
+-# Unpack source
+-unzip -q shell2junit-${VER}.zip
+-
+-# Install
+-mv shell2junit-${VER}/sh2ju.sh ${PREFIX}/bin
+-
+-# Cleanup
+-rm -rf shell2junit-${VER}
++cp patch/sh2ju.sh install/
+Index: ../trunk-jpl/externalpackages/shell2junit/install.sh.old
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/install.sh.old	(nonexistent)
++++ ../trunk-jpl/externalpackages/shell2junit/install.sh.old	(revision 25978)
+@@ -0,0 +1,20 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install src
++rm -rf shell2junit
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shell2junit-1.0.0.zip' 'shell2junit-1.0.0.zip'
++
++#Untar 
++unzip shell2junit-1.0.0.zip
++
++#Move shell2junit into install directory
++mv shell2junit/* src
++rm -rf shell2junit
++
++#Copy executable: 
++cp src/sh2ju.sh install
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/install.sh.old
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh	(revision 25978)
+@@ -0,0 +1,131 @@
++#!/bin/sh
++### Copyright 2010 Manuel Carrasco Moñino. (manolo at apache.org) 
++###
++### Licensed under the Apache License, Version 2.0.
++### You may obtain a copy of it at
++### http://www.apache.org/licenses/LICENSE-2.0
++
++###
++### A library for shell scripts which creates reports in jUnit format.
++### These reports can be used in Hudson, or any other CI.
++###
++### Usage: 
++###     - Include this file in your shell script
++###     - Use juLog to call your command any time you want to produce a new report
++###        Usage:   juLog <options> command arguments
++###           options:
++###             -name="TestName" : the test name which will be shown in the junit report
++###             -error="RegExp"  : a regexp which sets the test as failure when the output matches it
++###             -ierror="RegExp" : same as -error but case insensitive
++###     - Junit reports are left in the folder 'result' under the directory where the script is executed.
++###     - Configure hudson to parse junit files from the generated folder
++###
++
++asserts=00; errors=0; total=0; content=""
++
++# create output folder
++juDIR=`pwd`/results
++mkdir -p $juDIR || exit
++
++# The name of the suite is calculated based in your script name
++suite=`basename $0 | sed -e 's/.sh$//' | tr "." "_"`
++
++# A wrapper for the eval method witch allows catching seg-faults and use tee
++errfile=/tmp/evErr.$$.log
++eVal() {
++  eval "$1"
++  echo $? | tr -d "\n" >$errfile
++}
++
++# Method to clean old tests
++juLogClean() {
++  echo "+++ Removing old junit reports from: $juDIR "
++  rm -f $juDIR/TEST-*	
++}
++
++# Execute a command and record its results 
++juLog() {
++  
++  # parse arguments
++  ya=""; icase=""; testname="";
++  while [ -z "$ya" ]; do  
++    case "$1" in
++  	  -name=*)   name=$asserts-`echo "$1" | sed -e 's/-name=//'`;   shift;;
++      -ierror=*) ereg=`echo "$1" | sed -e 's/-ierror=//'`; icase="-i"; shift;;
++      -error=*)  ereg=`echo "$1" | sed -e 's/-error=//'`;  shift;;
++      -test=*)  testname=`echo "$1" | sed -e 's/-test=//'`;  shift;;
++      *)         ya=1;;
++    esac
++  done  
++
++  # use first arg as name if it was not given 
++  if [ -z "$name" ]; then
++    name="$asserts-$1" 
++    shift
++  fi
++
++  # calculate command to eval
++  [ -z "$1" ] && return
++  cmd="$1"; shift
++  while [ -n "$1" ]
++  do
++     cmd="$cmd \"$1\""
++     shift
++  done
++
++  # eval the command sending output to a file
++  outf=/var/tmp/ju$$.txt
++  >$outf
++  echo ""                         | tee -a $outf
++  echo "+++ Running case: $testname " | tee -a $outf
++  echo "+++ working dir: "`pwd`           | tee -a $outf
++  #echo "+++ command: $cmd"            | tee -a $outf
++  ini=`date +%s`
++  eVal "$cmd" 2>&1                | tee -a $outf
++  evErr=`cat $errfile`
++  rm -f $errfile
++  end=`date +%s`
++  echo "+++ exit code: $evErr"        | tee -a $outf
++  
++  # set the appropriate error, based in the exit code and the regex  
++  [ $evErr != 0 ] && err=1 || err=0
++  out=`cat $outf | sed -e 's/^\([^+]\)/| \1/g'`
++  if [ $err = 0 -a -n "$ereg" ]; then
++      H=`echo "$out" | egrep $icase "$ereg"`
++      [ -n "$H" ] && err=1
++  fi
++  echo "+++ error: $err"         | tee -a $outf
++  rm -f $outf
++
++  # calculate vars
++  asserts=`expr $asserts + 1`
++  asserts=`printf "%.2d" $asserts`
++  errors=`expr $errors + $err`
++  time=`expr $end - $ini`
++  total=`expr $total + $time`
++
++  # write the junit xml report
++  ## failure tag
++  [ $err = 0 ] && failure="" || failure="
++      <failure type=\"ScriptError\" message=\"Script Error\"></failure>
++  "
++  ## testcase tag
++  content="$content
++    <testcase assertions=\"1\" name=\"$testname $ereg\" time=\"$time\">
++    $failure
++    <system-out>
++<![CDATA[
++$out
++]]>
++    </system-out>
++    </testcase>
++  "
++  ## testsuite block
++  cat <<EOF >$juDIR/TEST-$suite.xml
++  <testsuite failures="0" assertions="$assertions" name="ISSM Test Suite" tests="1" errors="$errors" time="$total">
++    $content
++  </testsuite>
++EOF
++
++}
++
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-25978-25979.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25978-25979.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25978-25979.diff	(revision 26740)
@@ -0,0 +1,276 @@
+Index: ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh	(revision 25978)
++++ ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh	(nonexistent)
+@@ -1,131 +0,0 @@
+-#!/bin/sh
+-### Copyright 2010 Manuel Carrasco Moñino. (manolo at apache.org) 
+-###
+-### Licensed under the Apache License, Version 2.0.
+-### You may obtain a copy of it at
+-### http://www.apache.org/licenses/LICENSE-2.0
+-
+-###
+-### A library for shell scripts which creates reports in jUnit format.
+-### These reports can be used in Hudson, or any other CI.
+-###
+-### Usage: 
+-###     - Include this file in your shell script
+-###     - Use juLog to call your command any time you want to produce a new report
+-###        Usage:   juLog <options> command arguments
+-###           options:
+-###             -name="TestName" : the test name which will be shown in the junit report
+-###             -error="RegExp"  : a regexp which sets the test as failure when the output matches it
+-###             -ierror="RegExp" : same as -error but case insensitive
+-###     - Junit reports are left in the folder 'result' under the directory where the script is executed.
+-###     - Configure hudson to parse junit files from the generated folder
+-###
+-
+-asserts=00; errors=0; total=0; content=""
+-
+-# create output folder
+-juDIR=`pwd`/results
+-mkdir -p $juDIR || exit
+-
+-# The name of the suite is calculated based in your script name
+-suite=`basename $0 | sed -e 's/.sh$//' | tr "." "_"`
+-
+-# A wrapper for the eval method witch allows catching seg-faults and use tee
+-errfile=/tmp/evErr.$$.log
+-eVal() {
+-  eval "$1"
+-  echo $? | tr -d "\n" >$errfile
+-}
+-
+-# Method to clean old tests
+-juLogClean() {
+-  echo "+++ Removing old junit reports from: $juDIR "
+-  rm -f $juDIR/TEST-*	
+-}
+-
+-# Execute a command and record its results 
+-juLog() {
+-  
+-  # parse arguments
+-  ya=""; icase=""; testname="";
+-  while [ -z "$ya" ]; do  
+-    case "$1" in
+-  	  -name=*)   name=$asserts-`echo "$1" | sed -e 's/-name=//'`;   shift;;
+-      -ierror=*) ereg=`echo "$1" | sed -e 's/-ierror=//'`; icase="-i"; shift;;
+-      -error=*)  ereg=`echo "$1" | sed -e 's/-error=//'`;  shift;;
+-      -test=*)  testname=`echo "$1" | sed -e 's/-test=//'`;  shift;;
+-      *)         ya=1;;
+-    esac
+-  done  
+-
+-  # use first arg as name if it was not given 
+-  if [ -z "$name" ]; then
+-    name="$asserts-$1" 
+-    shift
+-  fi
+-
+-  # calculate command to eval
+-  [ -z "$1" ] && return
+-  cmd="$1"; shift
+-  while [ -n "$1" ]
+-  do
+-     cmd="$cmd \"$1\""
+-     shift
+-  done
+-
+-  # eval the command sending output to a file
+-  outf=/var/tmp/ju$$.txt
+-  >$outf
+-  echo ""                         | tee -a $outf
+-  echo "+++ Running case: $testname " | tee -a $outf
+-  echo "+++ working dir: "`pwd`           | tee -a $outf
+-  #echo "+++ command: $cmd"            | tee -a $outf
+-  ini=`date +%s`
+-  eVal "$cmd" 2>&1                | tee -a $outf
+-  evErr=`cat $errfile`
+-  rm -f $errfile
+-  end=`date +%s`
+-  echo "+++ exit code: $evErr"        | tee -a $outf
+-  
+-  # set the appropriate error, based in the exit code and the regex  
+-  [ $evErr != 0 ] && err=1 || err=0
+-  out=`cat $outf | sed -e 's/^\([^+]\)/| \1/g'`
+-  if [ $err = 0 -a -n "$ereg" ]; then
+-      H=`echo "$out" | egrep $icase "$ereg"`
+-      [ -n "$H" ] && err=1
+-  fi
+-  echo "+++ error: $err"         | tee -a $outf
+-  rm -f $outf
+-
+-  # calculate vars
+-  asserts=`expr $asserts + 1`
+-  asserts=`printf "%.2d" $asserts`
+-  errors=`expr $errors + $err`
+-  time=`expr $end - $ini`
+-  total=`expr $total + $time`
+-
+-  # write the junit xml report
+-  ## failure tag
+-  [ $err = 0 ] && failure="" || failure="
+-      <failure type=\"ScriptError\" message=\"Script Error\"></failure>
+-  "
+-  ## testcase tag
+-  content="$content
+-    <testcase assertions=\"1\" name=\"$testname $ereg\" time=\"$time\">
+-    $failure
+-    <system-out>
+-<![CDATA[
+-$out
+-]]>
+-    </system-out>
+-    </testcase>
+-  "
+-  ## testsuite block
+-  cat <<EOF >$juDIR/TEST-$suite.xml
+-  <testsuite failures="0" assertions="$assertions" name="ISSM Test Suite" tests="1" errors="$errors" time="$total">
+-    $content
+-  </testsuite>
+-EOF
+-
+-}
+-
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/install.sh.old
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/install.sh.old	(revision 25978)
++++ ../trunk-jpl/externalpackages/shell2junit/install.sh.old	(nonexistent)
+@@ -1,20 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf install src
+-rm -rf shell2junit
+-mkdir install src
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shell2junit-1.0.0.zip' 'shell2junit-1.0.0.zip'
+-
+-#Untar 
+-unzip shell2junit-1.0.0.zip
+-
+-#Move shell2junit into install directory
+-mv shell2junit/* src
+-rm -rf shell2junit
+-
+-#Copy executable: 
+-cp src/sh2ju.sh install
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/install.sh.old
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/README
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/README	(revision 25978)
++++ ../trunk-jpl/externalpackages/shell2junit/README	(nonexistent)
+@@ -1,9 +0,0 @@
+-http://code.google.com/p/shell2junit/
+-
+-Shell2junit
+-
+-Shell2junit is a simple utility which facilitates to generate junit reports for batch processes executed in shell scripts. 
+-
+-The reports can be easily parsed in Hudson and other CI software in order to monitor and generate trends and alerts. 
+-
+-This page teaches how to do it in Hudson. 
+Index: ../trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip
+___________________________________________________________________
+Deleted: svn:mime-type
+## -1 +0,0 ##
+-application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/shell2junit/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25978)
++++ ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25979)
+@@ -2,8 +2,24 @@
+ set -eu
+ 
+ 
+-#Some cleanup
+-rm -rf install 
+-mkdir install 
++## Constants
++#
++VER="1.0.0"
+ 
+-cp patch/sh2ju.sh install/
++PREFIX="${ISSM_EXT_DIR}/shell2junit/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX}
++mkdir -p ${PREFIX}/bin
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/shell2junit-${VER}.zip" "shell2junit-${VER}.zip"
++
++# Unpack source
++unzip -q shell2junit-${VER}.zip
++
++# Install
++mv shell2junit-${VER}/sh2ju.sh ${PREFIX}/bin
++
++# Cleanup
++rm -rf shell2junit-${VER}
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 25978)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 25979)
+@@ -430,8 +430,8 @@
+ 
+ #process logs to be junit compatible
+ #{{{
+-cd $ISSM_DIR/nightlylog/
+-source $ISSM_DIR/externalpackages/shell2junit/install/bin/sh2ju.sh
++cd $ISSM_DIR/nightlylog
++source $ISSM_EXT_DIR/shell2junit/install/bin/sh2ju.sh
+ juLogClean
+ 
+ if [ $MATLAB_TEST -eq 1 ]; then
+@@ -439,10 +439,10 @@
+ 	numtests=`cat matlab_log.log | grep "\-\-\-\-\-\-\-\-starting" | wc -l`
+ 	testlist=`cat matlab_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
+ 
+-	#look through numtests:
++	# NOTE: Matching pattern is "----------------starting:<TEST_NUM>-". Note trailing hyphen, which guards against greedy matching of, for example, "2010" when searching for "201".
+ 	for i in `echo $testlist`; do
+-		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" matlab_log.log
+-		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" matlab_log.log
++		juLog -test=MATLAB-$i -name=Error -error=ERROR awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" matlab_log.log
++		juLog -test=MATLAB-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" matlab_log.log
+ 	done
+ 
+ 	# Check that MATLAB did not exit in error
+@@ -465,10 +465,10 @@
+ 	numtests=`cat python_log.log | grep "\-\-\-\-\-\-\-\-starting" | wc -l`
+ 	testlist=`cat python_log.log | grep "\-\-\-\-\-\-\-\-starting" | sed 's/----------------starting://g' | sed 's/-//g'`
+ 
+-	#look through numtests:
++	# NOTE: Matching pattern is "----------------starting:<TEST_NUM>-". Note trailing hyphen, which guards against greedy matching of, for example, "2010" when searching for "201".
+ 	for i in `echo $testlist`; do
+-		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" python_log.log
+-		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/^starting:${i}$/{flag=1;next}/^finished:${i}$/{flag=0} flag{print}" python_log.log
++		juLog -test=PYTHON-$i -name=Error -error=ERROR awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" python_log.log
++		juLog -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:${i}-/{flag=1;next}/finished:${i}-/{flag=0} flag{print}" python_log.log
+ 	done
+ 
+ 	# Check that Python did not exit in error
Index: /issm/oecreview/Archive/25834-26739/ISSM-25979-25980.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25979-25980.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25979-25980.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/externalpackages/shell2junit/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25979)
++++ ../trunk-jpl/externalpackages/shell2junit/install.sh	(revision 25980)
+@@ -6,7 +6,7 @@
+ #
+ VER="1.0.0"
+ 
+-PREFIX="${ISSM_EXT_DIR}/shell2junit/install" # Set to location where external package should be installed
++PREFIX="${ISSM_DIR}/externalpackages/shell2junit/install" # Set to location where external package should be installed
+ 
+ # Cleanup
+ rm -rf ${PREFIX}
Index: /issm/oecreview/Archive/25834-26739/ISSM-25980-25981.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25980-25981.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25980-25981.diff	(revision 26740)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25980)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25981)
+@@ -1,4 +1,4 @@
+-%PIG Uncertainty Quantification Application
++%PIG Uncertainty Quantification Tutorial
+ steps=[1];
+ 
+ if any(steps==1) %{{{
+@@ -114,7 +114,7 @@
+ 	};
+ 	md.qmu.mass_flux_profile_directory='./MassFluxes/';
+ 
+-	%%  sampling analysis
++	%sampling analysis
+ 	md.qmu.method		=dakota_method('nond_samp');
+ 	md.qmu.method(end)	=dmeth_params_set(...
+ 		md.qmu.method(end),...
+@@ -123,7 +123,7 @@
+ 		'sample_type','lhs'...
+ 	); %random or lhs
+ 
+-	%%  a variety of parameters
++	%a variety of parameters
+ 	md.qmu.params.direct=true;
+ 	md.qmu.params.analysis_driver='';
+ 	md.qmu.params.analysis_components='';
+@@ -135,7 +135,7 @@
+ 	%Turn off verbosity
+ 	md.verbose=verbose(0);
+ 
+-	%Here, we choose to run with 4 processors, 3 for DAKOTA
++	%Here, we choose to run with 4 processors, 3 for Dakota
+ 	% while one serves as the master
+ 	md.cluster=generic('name',oshostname,'np',4);
+ 
+@@ -225,7 +225,7 @@
+ 
+ 	md.stressbalance.restol=10^-5; %tighten for qmu analyses
+ 
+-	%Here, we choose to run with 2 processors, 1 for DAKOTA
++	%Here, we choose to run with 2 processors, 1 for Dakota
+ 	% while one serves as the master
+ 	md.cluster=generic('name',oshostname,'np',2);
+ 
+@@ -249,7 +249,7 @@
+ 	%load model
+ 	md = loadmodel('./Models/PIG.Sampling');
+ 
+-	plotmodel(md,'data','mesh','partitionedges','on',...
++	plotmodel(md,'data','mesh','partition',partition,...
+ 	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
+ 	'title','Partition Edges on ISSM mesh','grid','on');
+ end %}}}
+@@ -300,9 +300,9 @@
+ 		'title','Sensitivities: H, \alpha, B');
+ 
+ 	%To plot importance factors
+-	ifa=importancefactors(md,'scaled_FrictionCoefficient',['indexed_MassFlux_' num2str(index)]);
+-	ifb=importancefactors(md,'scaled_MaterialsRheologyB',['indexed_MassFlux_' num2str(index)]);
+-	ifh=importancefactors(md,'scaled_Thickness',['indexed_MassFlux_' num2str(index)]);
++	ifa=importancefactors(md,'scaled_FrictionCoefficient',['indexed_MassFlux_' num2str(index)],partition);
++	ifb=importancefactors(md,'scaled_MaterialsRheologyB',['indexed_MassFlux_' num2str(index)],partition);
++	ifh=importancefactors(md,'scaled_Thickness',['indexed_MassFlux_' num2str(index)],partition);
+ 
+ 	plotmodel(md,'data',ifh,'data',ifa,'data',ifb,'expdisp#all',...
+ 		['MassFluxes/MassFlux' num2str(index) '.exp'],...
Index: /issm/oecreview/Archive/25834-26739/ISSM-25981-25982.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25981-25982.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25981-25982.diff	(revision 26740)
@@ -0,0 +1,637 @@
+Index: ../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install.sh	(revision 25981)
++++ ../trunk-jpl/externalpackages/autotools/install.sh	(nonexistent)
+@@ -1,69 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-## Constants
+-#
+-AUTOCONF_VER="2.69"
+-AUTOMAKE_VER="1.16.1"
+-LIBTOOL_VER="2.4.2"
+-M4_VER="1.4.18"
+-PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+-
+-## Environment
+-#
+-export PATH="${PREFIX}/bin:$PATH"
+-
+-# Cleanup
+-rm -rf ${PREFIX} src
+-mkdir -p ${PREFIX}
+-
+-
+-# Install m4
+-echo " === INSTALLING M4 =="
+-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
+-tar -zxvf m4-${M4_VER}.tar.gz
+-mv m4-${M4_VER} src
+-cd src
+-
+-./configure --prefix="${PREFIX}"
+-make
+-make install
+-cd ..
+-
+-# Install Autoconf
+-echo " === INSTALLING AUTOCONF =="
+-rm -rf src
+-${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
+-tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
+-mv autoconf-${AUTOCONF_VER} src
+-cd src
+-./configure --prefix="${PREFIX}"
+-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="${PREFIX}"
+-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="${PREFIX}"
+-make
+-make install
+-cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/autotools/install.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/autotools/install-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-linux.sh	(revision 25981)
++++ ../trunk-jpl/externalpackages/autotools/install-linux.sh	(revision 25982)
+@@ -9,16 +9,18 @@
+ LIBTOOL_VER="2.4.2"
+ M4_VER="1.4.18"
+ 
++PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
++
+ ## Environment
+ #
+-export PATH="${ISSM_DIR}/externalpackages/autotools/install/bin:$PATH"
++export PATH="${PREFIX}/bin:${PATH}"
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX}
+ 
+ # Install m4
+-echo " === INSTALLING M4 =="
++echo " === INSTALLING M4 ==="
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
+ tar -zxvf m4-${M4_VER}.tar.gz
+ mv m4-${M4_VER} src
+@@ -31,7 +33,7 @@
+ sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
+ echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
+ 
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++./configure --prefix="${PREFIX}"
+ if [ $# -eq 0 ]; then
+ 	make
+ 	make install
+@@ -42,13 +44,13 @@
+ cd ..
+ 
+ # Install Autoconf
+-echo " === INSTALLING AUTOCONF =="
++echo " === INSTALLING AUTOCONF ==="
+ rm -rf src
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
+ tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
+ mv autoconf-${AUTOCONF_VER} src
+ cd src
+-./configure --prefix="${ISSM_DIR}/externalpackages/autotools/install"
++./configure --prefix="${PREFIX}"
+ if [ $# -eq 0 ]; then
+ 	make
+ 	make install
+@@ -57,15 +59,14 @@
+ 	make -j $1 install
+ fi
+ cd ..
+-
+ # Install Automake
+-echo " === INSTALLING 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"
++./configure --prefix="${PREFIX}"
+ if [ $# -eq 0 ]; then
+ 	make
+ 	make install
+@@ -76,14 +77,13 @@
+ cd ..
+ 
+ # Install libtool
+-echo " === INSTALLING LIBTOOL =="
++echo " === INSTALLING LIBTOOL ==="
+ rm -rf src
+ ${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${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"
++./configure --prefix="${PREFIX}"
+ if [ $# -eq 0 ]; then
+ 	make
+ 	make install
+Index: ../trunk-jpl/externalpackages/autotools/install-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-mac.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/autotools/install-mac.sh	(revision 25982)
+@@ -0,0 +1,88 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++AUTOCONF_VER="2.69"
++AUTOMAKE_VER="1.16.1"
++LIBTOOL_VER="2.4.2"
++M4_VER="1.4.18"
++
++PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
++
++## Environment
++#
++export PATH="${PREFIX}/bin:${PATH}"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX}
++
++# Install m4
++echo " === INSTALLING M4 ==="
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
++tar -zxvf m4-${M4_VER}.tar.gz
++mv m4-${M4_VER} src
++cd src
++
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
++
++# Install Autoconf
++echo " === INSTALLING AUTOCONF =="
++rm -rf src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
++tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
++mv autoconf-${AUTOCONF_VER} src
++cd src
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
++
++# Install Automake
++echo " === INSTALLING AUTOMAKE ==="
++rm -rf src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
++tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
++mv automake-${AUTOMAKE_VER} src
++cd src
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
++
++# Install libtool
++echo " === INSTALLING LIBTOOL ==="
++rm -rf src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
++tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
++mv libtool-${LIBTOOL_VER} src
++cd src
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/autotools/install-mac.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/autotools/install-win.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-win.sh	(revision 25981)
++++ ../trunk-jpl/externalpackages/autotools/install-win.sh	(revision 25982)
+@@ -1,78 +1,90 @@
+ #!/bin/bash
+ set -eu
+ 
++
++## Constants
++#
+ 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"
++M4_VER="1.4.18"
+ 
+-AUTOCONF="autoconf-${AUTOCONF_VER}"
+-AUTOMAKE="automake-${AUTOMAKE_BUILD_VER}"
+-LIBTOOL="libtool-${LIBTOOL_VER}"
+-M4="m4-${M4_VER}"
++PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+ 
+-AUTOCONF_TARBALL="${AUTOCONF}.tar.gz"
+-AUTOMAKE_TARBALL="${AUTOMAKE}.tar.gz"
+-LIBTOOL_TARBALL="${LIBTOOL}.tar.gz"
+-M4_TARBALL="${M4}.tar.gz"
++## Environment
++#
++export PATH="${PREFIX}/bin:${PATH}"
+ 
+-# Clean up existing assets
+-rm -rf install src
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX}
+ 
+-# Set up for installation
+-mkdir install
+-export PATH="$ISSM_DIR/externalpackages/autotools/install/bin:$PATH"
+-
+ # Install m4
+-echo " === INSTALLING M4 =="
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${M4_TARBALL}" $M4_TARBALL
+-tar -zxvf $M4_TARBALL
+-rm -f $M4_TARBALL
+-mv $M4 src
++echo " === INSTALLING M4 ==="
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-${M4_VER}.tar.gz" "m4-${M4_VER}.tar.gz"
++tar -zxvf m4-${M4_VER}.tar.gz
++mv m4-${M4_VER} src
+ cd src
+-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
+-make
+-make install
++
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+ cd ..
+ 
+-# Install autoconf
++# Install Autoconf
+ echo " === INSTALLING AUTOCONF =="
+ rm -rf src
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${AUTOCONF_TARBALL}" $AUTOCONF_TARBALL
+-tar -zxvf $AUTOCONF_TARBALL
+-rm -f $AUTOCONF_TARBALL
+-mv $AUTOCONF src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-${AUTOCONF_VER}.tar.gz" "autoconf-${AUTOCONF_VER}.tar.gz"
++tar -zxvf autoconf-${AUTOCONF_VER}.tar.gz
++mv autoconf-${AUTOCONF_VER} src
+ cd src
+-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
+-make
+-make install
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+ cd ..
+ 
+-# Install automake
+-echo " === INSTALLING AUTOMAKE =="
++# Install Automake
++echo " === INSTALLING AUTOMAKE ==="
+ rm -rf src
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${AUTOMAKE_TARBALL}" $AUTOMAKE_TARBALL
+-tar -zxvf $AUTOMAKE_TARBALL
+-rm -f $AUTOMAKE_TARBALL
+-mv $AUTOMAKE src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-${AUTOMAKE_VER}.tar.gz" "automake-${AUTOMAKE_VER}.tar.gz"
++tar -zxvf automake-${AUTOMAKE_VER}.tar.gz
++mv automake-${AUTOMAKE_VER} src
+ cd src
+-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
+-make
+-make install
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+ cd ..
+ 
+ # Install libtool
+-echo " === INSTALLING LIBTOOL =="
++echo " === INSTALLING LIBTOOL ==="
+ rm -rf src
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${LIBTOOL_TARBALL}" $LIBTOOL_TARBALL
+-tar -zxvf $LIBTOOL_TARBALL
+-rm -f $LIBTOOL_TARBALL
+-mv $LIBTOOL src
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-${LIBTOOL_VER}.tar.gz" "libtool-${LIBTOOL_VER}.tar.gz"
++tar -zxvf libtool-${LIBTOOL_VER}.tar.gz
++mv libtool-${LIBTOOL_VER} src
+ cd src
+-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
+-make
+-make install
++./configure --prefix="${PREFIX}"
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+ cd ..
+ 
+ # This patch takes care of removing options passed to the linker that causes
+Index: ../trunk-jpl/jenkins/linux64_caladan_ad
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan_ad	(revision 25981)
++++ ../trunk-jpl/jenkins/linux64_caladan_ad	(revision 25982)
+@@ -30,7 +30,7 @@
+ 
+ #List of external pakages to be installed and their installation scripts
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-linux.sh
+ 	cmake		install.sh
+ 	mpich		install-3.2-linux64.sh
+ 	petsc		install-3.7-linux64.sh
+Index: ../trunk-jpl/jenkins/linux64_caladan_ampi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 25981)
++++ ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 25982)
+@@ -39,7 +39,7 @@
+ 
+ #List of external pakages to be installed and their installation scripts
+ EXTERNALPACKAGES="
+-	autotools		install.sh
++	autotools		install-linux.sh
+ 	cmake			install.sh
+ 	mpich			install-3.2-linux64.sh
+ 	petsc			install-3.7-linux64.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 25982)
+@@ -39,7 +39,7 @@
+ #		external packages.
+ #
+ EXTERNALPACKAGES="
+-	autotools		install.sh
++	autotools		install-mac.sh
+ 	cmake			install.sh
+ 	petsc			install-3.12-mac.sh
+ 	gsl				install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-basic
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 25982)
+@@ -31,7 +31,7 @@
+ 
+ # List of external pakages to be installed and their installation scripts
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-mac.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-mac.sh
+ 	triangle	install-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 25982)
+@@ -41,7 +41,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-mac.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-mac-static.sh
+ 	gsl			install-static.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 25982)
+@@ -39,7 +39,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-mac.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-mac-static.sh
+ 	gsl			install-static.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 25982)
+@@ -37,24 +37,24 @@
+ 
+ #List of external pakages to be installed and their installation scripts
+ EXTERNALPACKAGES="
+-	autotools		install.sh
+-	cmake			install.sh
+-	petsc			install-3.12-mac.sh
+-	gsl				install.sh
+-	boost			install-1.7-mac.sh
+-	dakota			install-6.2-mac.sh
+-	curl			install-7-mac.sh
+-	netcdf			install-4.7-parallel.sh
+-	proj			install-6.2.sh
+-	gdal			install-3-python.sh
+-	gshhg			install.sh
+-	gmt				install-6-mac.sh
+-	gmsh			install-4.sh
+-	triangle		install-mac.sh
+-	chaco			install.sh
+-	m1qn3			install.sh
+-	semic			install.sh
+-	shell2junit		install.sh
++	autotools	install-mac.sh
++	cmake		install.sh
++	petsc		install-3.12-mac.sh
++	gsl			install.sh
++	boost		install-1.7-mac.sh
++	dakota		install-6.2-mac.sh
++	curl		install-7-mac.sh
++	netcdf		install-4.7-parallel.sh
++	proj		install-6.2.sh
++	gdal		install-3-python.sh
++	gshhg		install.sh
++	gmt			install-6-mac.sh
++	gmsh		install-4.sh
++	triangle	install-mac.sh
++	chaco		install.sh
++	m1qn3		install.sh
++	semic		install.sh
++	shell2junit	install.sh
+ "
+ 
+ #---------#
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 25982)
+@@ -38,7 +38,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-mac.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 25982)
+@@ -39,7 +39,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-mac.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 25982)
+@@ -39,7 +39,7 @@
+ #-------------------#
+ 
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-mac.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-python	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-python	(revision 25982)
+@@ -34,7 +34,7 @@
+ 
+ # List of external pakages to be installed and their installation scripts
+ EXTERNALPACKAGES="
+-	autotools	install.sh
++	autotools	install-mac.sh
+ 	cmake		install.sh
+ 	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 25981)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 25982)
+@@ -37,24 +37,24 @@
+ 
+ #List of external pakages to be installed and their installation scripts
+ EXTERNALPACKAGES="
+-	autotools		install.sh
+-	cmake			install.sh
+-	petsc			install-3.12-mac.sh
+-	gsl				install.sh
+-	boost			install-1.7-mac.sh
+-	dakota			install-6.2-mac.sh
+-	curl			install-7-mac.sh
+-	netcdf			install-4.7-parallel.sh
+-	proj			install-6.2.sh
+-	gdal			install-3-python.sh
+-	gshhg			install.sh
+-	gmt				install-6-mac.sh
+-	gmsh			install-4.sh
+-	triangle		install-mac.sh
+-	chaco			install.sh
+-	m1qn3			install.sh
+-	semic			install.sh
+-	shell2junit		install.sh
++	autotools	install-mac.sh
++	cmake		install.sh
++	petsc		install-3.12-mac.sh
++	gsl			install.sh
++	boost		install-1.7-mac.sh
++	dakota		install-6.2-mac.sh
++	curl		install-7-mac.sh
++	netcdf		install-4.7-parallel.sh
++	proj		install-6.2.sh
++	gdal		install-3-python.sh
++	gshhg		install.sh
++	gmt			install-6-mac.sh
++	gmsh		install-4.sh
++	triangle	install-mac.sh
++	chaco		install.sh
++	m1qn3		install.sh
++	semic		install.sh
++	shell2junit	install.sh
+ "
+ 
+ #---------#
Index: /issm/oecreview/Archive/25834-26739/ISSM-25982-25983.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25982-25983.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25982-25983.diff	(revision 26740)
@@ -0,0 +1,230 @@
+Index: ../trunk-jpl/examples/PigSensitivity/runme.m
+===================================================================
+--- ../trunk-jpl/examples/PigSensitivity/runme.m	(revision 25982)
++++ ../trunk-jpl/examples/PigSensitivity/runme.m	(revision 25983)
+@@ -1,8 +1,5 @@
+-steps=[1:4];
++steps=[1];
+ 
+-try
+-
+-
+ if any(steps==1) %Transient Run #1 %{{{
+ 
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+@@ -24,6 +21,17 @@
+ 
+ 	md=solve(md,'Transient');
+ 
++	plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...
++		'title#1', 'Velocity t=0 years (m/yr)',...
++		'data', md.results.TransientSolution(end).Vel,...
++		'title#2', 'Velocity t=10 years (m/yr)',...
++		'data', md.results.TransientSolution(1).MaskOceanLevelset,...
++		'title#3', 'Floating ice t=0 years',...
++		'data', md.results.TransientSolution(end).MaskOceanLevelset,...
++		'title#4', 'Floating ice t=10 years',...
++		'caxis#1',([0 4500]),'caxis#2',([0 4500]),...
++		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
++
+ 	% Save model
+ 	save ./Models/PIG_Transient md;
+ end %}}}
+@@ -40,6 +48,17 @@
+ 
+ 	md=solve(md,'Transient');
+ 
++	plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...
++		'title#1', 'Velocity t=0 years (m/yr)',...
++		'data', md.results.TransientSolution(end).Vel,...
++		'title#2', 'Velocity t=10 years (m/yr)',...
++		'data', md.results.TransientSolution(1).MaskOceanLevelset,...
++		'title#3', 'Floating ice t=0 years',...
++		'data', md.results.TransientSolution(end).MaskOceanLevelset,...
++		'title#4', 'Floating ice t=10 years',...
++		'caxis#1',([0 4500]),'caxis#2',([0 4500]),...
++		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
++
+ 	save ./Models/PIG_HighMelt md;
+ end %}}}
+ 
+@@ -59,11 +78,22 @@
+ 
+ 	md2=solve(md2,'Transient');
+ 
++	plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...
++		'title#1', 'Velocity t=0 years (m/yr)',...
++		'data', md.results.TransientSolution(end).Vel,...
++		'title#2', 'Velocity t=10 years (m/yr)',...
++		'data', md.results.TransientSolution(1).MaskOceanLevelset,...
++		'title#3', 'Floating ice t=0 years',...
++		'data', md.results.TransientSolution(end).MaskOceanLevelset,...
++		'title#4', 'Floating ice t=10 years',...
++		'caxis#1',([0 4500]),'caxis#2',([0 4500]),...
++		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
++
+ 	save ./Models/PIG_FrontRetreat md2;
+ end %}}}
+ 
+-if any(steps==4)
+- disp('Needs work!') %High surface mass balance #3 %{{{
++if any(steps==4) %High surface mass balance #3 %{{{
++
+ 	%Load model
+ 
+ 	%Change external forcing basal melting rate and surface mass balance)
+@@ -76,4 +106,4 @@
+ 
+ 	%Save model
+ 
+-end %}}}
++end %}}} % step 4 end
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25982)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25983)
+@@ -46,16 +46,16 @@
+ 		cd ${dir}
+ 
+ 		if [ "${dir}" == "./AMR" ]; then
+-			sed -i.bak '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			sed -i.bak -e '1 s|^.*$|try\n\n&|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Data" ]; then
+ 			echo 'Directory contains datasets only; no example to run.'
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./EsaGRACE" ]; then
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./EsaWahr" ]; then
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Functions" ]; then
+ 			echo "Directory contains functions only; no example to run."
+@@ -150,19 +150,19 @@
+ 				end %}}}\n\
+ 			"
+ 			#}}}
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==7\).*% step 7 end|${STEP_SEVEN}|s" $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==8\).*% step 8 end|${STEP_EIGHT}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./IceBridge" ]; then
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|\n\t%Mesh greenland without.*return;\n||s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./IceflowModels" ]; then
+-			sed -i.bak '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			sed -i.bak -e '1 s|^.*$|try\n\n&|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Inversion" ]; then
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./ISMIP" ]; then
+ 			# TODO:
+@@ -525,14 +525,14 @@
+ 			perl -0755 -p -i'.bak' -e "s|^.*$|${PAR_F}|s" IsmipF.par
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Jakobshavn" ]; then
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./LcurveAnalysis" ]; then
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Mesh" ]; then
+ 			# NOTE: Cannot test exptool region selection without GUI
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Pig" ]; then
+ 			# STEP_SIX #{{{
+@@ -557,12 +557,12 @@
+ 			"
+ 			#}}}
+ 			mv ./DomainOutline.bkp ./DomainOutline.exp > /dev/null 2>&1
+-			sed -i.bak "s|steps=\[1\];|steps=\[1:7\];\ntry\n|" $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==6\).*% step 6 end|${STEP_SIX}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Pig2" ]; then
+ 			STEP_NINE="\n disp('Needs work!'); exit"
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:9\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:9\];\n\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==9\).*% step 9 end|${STEP_NINE}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./PigSensitivity" ]; then
+@@ -587,34 +587,46 @@
+ 					%Solve\n\
+ 					md=solve(md,'Transient');\n\
+ 					\n\
++					%Plot\n\
++					plotmodel(md, 'data', md.results.TransientSolution(1).Vel,...\n\
++						'title#1', 'Velocity t=0 years (m/yr)',...\n\
++						'data', md.results.TransientSolution(end).Vel,...\n\
++						'title#2', 'Velocity t=10 years (m/yr)',...\n\
++						'data', md.results.TransientSolution(1).MaskOceanLevelset,...\n\
++						'title#3', 'Floating ice t=0 years',...\n\
++						'data', md.results.TransientSolution(end).MaskOceanLevelset,...\n\
++						'title#4', 'Floating ice t=10 years',...\n\
++						'caxis#1',([0 4500]),'caxis#2',([0 4500]),...\n\
++						'caxis#3',([-1,1]),'caxis#4',([-1,1]));\n\
++					\n\
+ 					%Save model\n\
+ 					save ./Models/PIG_SMB md;\n\
+ 				end\n\
+ 			"
+ 			#}}}
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
+-			sed -i '' "s|if any(steps==4)|&${STEP_FOUR}|" $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:4\];\n\ntry\n|' $RUNME_FILE
++			perl -0755 -p -i -e "s|if any\(steps==4\).*% step 4 end|${STEP_FOUR}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./shakti" ]; then
+-			sed -i.bak 's|steps=\[1:3\];|steps=\[1:3\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1:3\];|steps=\[1:3\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./SlrFarrell" ]; then
+ 			# TODO: Convert from md.slr
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:5\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./SlrGRACE" ]; then
+ 			# TODO: Convert from md.slr
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./SlrGRACE_NIMS" ]; then
+ 			# TODO: Convert from md.slr
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./SquareIceShelf" ]; then
+-			sed -i.bak '1 s|^.*$|try\n\n&|' $RUNME_FILE
++			sed -i.bak -e '1 s|^.*$|try\n\n&|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./UncertaintyQuantification" ]; then
+-			sed -i.bak 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		else
+ 			echo "Not implemented yet!"
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 25982)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 25983)
+@@ -43,7 +43,7 @@
+ 	cmake		install.sh
+ 	petsc		install-3.12-linux.sh
+ 	gsl			install.sh
+-	boost		install-1.7-linux-valgrind.sh
++	boost		install-1.7-linux.sh
+ 	dakota		install-6.2-linux.sh
+ 	curl		install-7-linux.sh
+ 	netcdf		install-4.7-parallel.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-25983-25984.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25983-25984.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25983-25984.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25983)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25984)
+@@ -564,7 +564,7 @@
+ 			STEP_NINE="\n disp('Needs work!'); exit"
+ 			sed -i.bak -e 's|steps=\[1\];|steps=\[1:9\];\n\ntry\n|' $RUNME_FILE
+ 			perl -0755 -p -i -e "s|if any\(steps==9\).*% step 9 end|${STEP_NINE}|s" $RUNME_FILE
+-			RUN_EXAMPLE=1
++			RUN_EXAMPLE=0
+ 		elif [ "${dir}" == "./PigSensitivity" ]; then
+ 			# STEP_FOUR # {{{
+ 			STEP_FOUR="\
Index: /issm/oecreview/Archive/25834-26739/ISSM-25984-25985.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25984-25985.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25984-25985.diff	(revision 26740)
@@ -0,0 +1,74 @@
+Index: ../trunk-jpl/examples/Mesh/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Mesh/runme.m	(nonexistent)
++++ ../trunk-jpl/examples/Mesh/runme.m	(revision 25985)
+@@ -0,0 +1,69 @@
++steps=[1];
++
++if any(steps==1) % Model %{{{
++	md=model;
++end %}}}
++
++if any(steps==2) % squaremesh %{{{
++	md=squaremesh(md,100,200,15,25);
++	plotmodel(md,'data','mesh');
++end %}}}
++
++if any(steps==3) % roundmesh %{{{
++	md=roundmesh(model,100,10);
++	plotmodel(md,'data','mesh');
++end %}}}
++
++if any(steps==4) % triangle %{{{
++	md=triangle(model,'Square.exp',.2);
++	plotmodel(md,'data','mesh');
++end %}}}
++
++if any(steps==5) % bamg %{{{
++	md=bamg(model,'domain','Square.exp','hmax',.05);
++	plotmodel(md,'data','mesh');
++end %}}}
++
++if any(steps==6) % Non-Uniform mesh %{{{
++	hvertices=[0.2;0.2;0.005;0.2];
++	md=bamg(md,'domain','Square.exp','hvertices',hvertices);
++	plotmodel(md,'data','mesh');
++end %}}}
++
++if any(steps==7) % Mesh adaptation %{{{
++	md=bamg(model,'domain','Square.exp','hmax',.05);
++	vel=shock(md.mesh.x,md.mesh.y);
++	plotmodel(md,'data',vel,'edgecolor','w');
++
++	md=bamg(model,'domain','Square.exp','hmax',.005);
++	vel=shock(md.mesh.x,md.mesh.y);
++	md=bamg(md,'field',vel,'err',0.05,'hmin',0.005,'hmax',0.3);
++	vel=shock(md.mesh.x,md.mesh.y);
++	plotmodel(md,'data',vel,'edgecolor','w');
++
++	md=bamg(model,'domain','Square.exp','hmax',.005);
++	vel=shock(md.mesh.x,md.mesh.y);
++	md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',3);
++	vel=shock(md.mesh.x,md.mesh.y);
++	plotmodel(md,'data',vel,'edgecolor','w');
++
++	md=bamg(model,'domain','Square.exp','hmax',.005);
++	vel=shock(md.mesh.x,md.mesh.y);
++	md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',1.3,'anisomax',1);
++	vel=shock(md.mesh.x,md.mesh.y);
++	plotmodel(md,'data',vel,'edgecolor','w');
++end %}}}
++
++if any(steps==8) % Mesh refinement in a specific region %{{{
++	plotmodel(md,'data',vel,'edgecolor','w');
++	exptool('refinement.exp');
++	h=NaN*ones(md.mesh.numberofvertices,1);
++	in=ContourToNodes(md.mesh.x,md.mesh.y,'refinement.exp',1);
++	h(find(in))=0.02;
++	plotmodel(md,'data',in,'edgecolor','w');
++
++	vel=shock(md.mesh.x,md.mesh.y);
++	md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'hVertices',h);
++	vel=shock(md.mesh.x,md.mesh.y);
++	plotmodel(md,'data',vel,'edgecolor','w');
++end %}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-25985-25986.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25985-25986.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25985-25986.diff	(revision 26740)
@@ -0,0 +1,1612 @@
+Index: ../trunk-jpl/examples/AMR/runme.m
+===================================================================
+--- ../trunk-jpl/examples/AMR/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/AMR/runme.m	(revision 25986)
+@@ -66,4 +66,4 @@
+ 	AMRexportVTK('./VTK',md);
+ 
+ 	save AMRTransient md
+-end% }}}
++end
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 25986)
+@@ -4,7 +4,7 @@
+ %Location of SeaRISE dataset
+ ncdata='../Data/Greenland_5km_dev1.2.nc';
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Mesh creation');
+ 
+ 	%Generate initial uniform mesh (resolution = 20000 m)
+@@ -28,9 +28,9 @@
+ 	save ./Models/Greenland.Mesh_generation md;
+ 
+ 	plotmodel (md,'data','mesh');
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Parameterization');
+ 	md = loadmodel('./Models/Greenland.Mesh_generation');
+ 
+@@ -39,9 +39,9 @@
+ 	md = setflowequation(md,'SSA','all');
+ 
+ 	save ./Models/Greenland.Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Control method friction');
+ 	md = loadmodel('./Models/Greenland.Parameterization');
+ 
+@@ -78,9 +78,9 @@
+ 	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
+ 
+ 	save ./Models/Greenland.Control_drag md;
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: Transient run');
+ 	md = loadmodel('./Models/Greenland.Control_drag');
+ 
+@@ -108,9 +108,9 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save ./Models/Greenland.Transient md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: Plotting');
+ 	md = loadmodel('./Models/Greenland.Transient');
+ 
+@@ -141,9 +141,9 @@
+ 	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 	subplot(3,1,3); plot([0.2:0.2:20],volume); title('Ice Volume');
+ 	xlabel('years')
+-end %}}}
++end 
+ 
+-if any(steps==6) %{{{
++if any(steps==6) 
+ 	disp('   Step 6: Extract Box SMB');
+ 	md = loadmodel('./Models/Greenland.Transient');
+ 
+@@ -170,9 +170,9 @@
+ 	figure; plot(t,totalsmb/1e9); title('Total Surface mass balance, Gt'); xlabel('year'); ylabel('Gt/yr');
+ 
+ 	clear smbbox
+-end %}}}
++end 
+ 
+-if any(steps==7) %{{{
++if any(steps==7) 
+ 	disp('   Step 7: Historical Relaxation run');
+ 	md = loadmodel('./Models/Greenland.Control_drag');
+ 
+@@ -205,7 +205,7 @@
+ 	save ./Models/Greenland.HistoricTransient md;
+ end % step 7 end
+ 
+-if any(steps==8) %{{{
++if any(steps==8) 
+ 	disp('   Step 8: Plotting exercise');
+ 
+ 	%Load historic transient model
+@@ -233,7 +233,7 @@
+ 
+ end % step 8 end
+ 
+-if any(steps==9) %{{{
++if any(steps==9) 
+ 	disp('   Step 9: Box Transient run');
+ 	md = loadmodel('./Models/Greenland.HistoricTransient_200yr');
+ 
+@@ -286,9 +286,9 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save ./Models/Greenland.BoxTransient md;
+-end %}}}
++end 
+ 
+-if any(steps==10) %{{{
++if any(steps==10) 
+ 	disp('   Step 10: Plot Box Transient');
+ 	md = loadmodel('./Models/Greenland.BoxTransient');
+ 
+@@ -312,4 +312,4 @@
+ 	volume=[]; for i=1:length(t); volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 	subplot(3,1,3); plot(t,volume); title('Ice Volume');
+ 	xlabel('years')
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/IceBridge/runme.m
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/IceBridge/runme.m	(revision 25986)
+@@ -4,7 +4,7 @@
+ %Location of SeaRISE dataset
+ ncdata='../Data/Greenland_5km_dev1.2.nc';
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Mesh creation');
+ 
+ 	%Generate initial uniform mesh (resolution = 20000 m)
+@@ -35,9 +35,9 @@
+ 	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
+ 
+ 	save ./Models/Greenland.Mesh_generation md;
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Parameterization');
+ 	md = loadmodel('./Models/Greenland.Mesh_generation');
+ 
+@@ -46,9 +46,9 @@
+ 	md = setflowequation(md,'SSA','all');
+ 
+ 	save ./Models/Greenland.Parameterization2 md; 
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Control method friction');
+ 	md = loadmodel('./Models/Greenland.Parameterization2');
+ 
+@@ -91,9 +91,9 @@
+ 	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
+ 
+ 	save ./Models/Greenland.Control_drag md; 
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: Transient run');
+ 	md = loadmodel('./Models/Greenland.Control_drag');
+ 
+@@ -120,9 +120,9 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save ./Models/Greenland.Transient md; 
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: Plotting'); 
+ 	md = loadmodel('./Models/Greenland.Transient');
+ 
+@@ -153,4 +153,4 @@
+ 	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 	subplot(3,1,3); plot(time_plot,volume); title('Ice Volume');
+ 	xlabel('years')
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/Jakobshavn/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Jakobshavn/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/Jakobshavn/runme.m	(revision 25986)
+@@ -1,6 +1,6 @@
+ steps=[1];
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Mesh creation');
+ 	md=triangle(model,'Domain.exp',2000);
+ 
+@@ -22,9 +22,9 @@
+ 	[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
+ 
+ 	save JksMesh md
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Parameterization');
+ 	md=loadmodel('JksMesh');
+ 
+@@ -32,9 +32,9 @@
+ 	md=parameterize(md,'Jks.par');
+ 
+ 	save JksPar md
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Control method friction');
+ 	md=loadmodel('JksPar');
+ 
+@@ -69,9 +69,9 @@
+ 	md=solve(md,'Stressbalance');
+ 
+ 	save JksControl md
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Plotting')
+ 	md=loadmodel('JksControl');
+ 
+@@ -84,4 +84,4 @@
+ 		'data',md.results.StressbalanceSolution.FrictionCoefficient,...
+ 		'title','Friction Coefficient',...
+ 		'colorbartitle#3','(m)');
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/LcurveAnalysis/runme.m
+===================================================================
+--- ../trunk-jpl/examples/LcurveAnalysis/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/LcurveAnalysis/runme.m	(revision 25986)
+@@ -1,6 +1,6 @@
+ steps=[1];
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	% Generate observations
+ 	md = model;
+ 	md = triangle(md,'DomainOutline.exp',100000);
+@@ -12,9 +12,9 @@
+ 	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 %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	% Modify rheology, now constant
+ 	loadmodel('model1.mat');
+ 	md.materials.rheology_B(:) = 1.8*10^8;
+@@ -29,9 +29,9 @@
+ 	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 %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	% Perform L-curve analysis for ice rigidity inversion
+ 	loadmodel('model2.mat');
+ 
+@@ -105,9 +105,9 @@
+ 		'FontSize',10,'HorizontalAlignment','left','VerticalAlignment','Middle')
+ 	xlabel('$\mathrm{log}(\mathcal{J}_0$)','Interpreter','latex')
+ 	ylabel('$\mathrm{log}(\mathcal{R})$','Interpreter','latex')
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	%invert for ice rigidity
+ 	loadmodel('model2.mat');
+ 
+@@ -127,4 +127,4 @@
+ 	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 %}}}
++end 
+Index: ../trunk-jpl/examples/Mesh/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Mesh/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/Mesh/runme.m	(nonexistent)
+@@ -1,69 +0,0 @@
+-steps=[1];
+-
+-if any(steps==1) % Model %{{{
+-	md=model;
+-end %}}}
+-
+-if any(steps==2) % squaremesh %{{{
+-	md=squaremesh(md,100,200,15,25);
+-	plotmodel(md,'data','mesh');
+-end %}}}
+-
+-if any(steps==3) % roundmesh %{{{
+-	md=roundmesh(model,100,10);
+-	plotmodel(md,'data','mesh');
+-end %}}}
+-
+-if any(steps==4) % triangle %{{{
+-	md=triangle(model,'Square.exp',.2);
+-	plotmodel(md,'data','mesh');
+-end %}}}
+-
+-if any(steps==5) % bamg %{{{
+-	md=bamg(model,'domain','Square.exp','hmax',.05);
+-	plotmodel(md,'data','mesh');
+-end %}}}
+-
+-if any(steps==6) % Non-Uniform mesh %{{{
+-	hvertices=[0.2;0.2;0.005;0.2];
+-	md=bamg(md,'domain','Square.exp','hvertices',hvertices);
+-	plotmodel(md,'data','mesh');
+-end %}}}
+-
+-if any(steps==7) % Mesh adaptation %{{{
+-	md=bamg(model,'domain','Square.exp','hmax',.05);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	plotmodel(md,'data',vel,'edgecolor','w');
+-
+-	md=bamg(model,'domain','Square.exp','hmax',.005);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	md=bamg(md,'field',vel,'err',0.05,'hmin',0.005,'hmax',0.3);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	plotmodel(md,'data',vel,'edgecolor','w');
+-
+-	md=bamg(model,'domain','Square.exp','hmax',.005);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',3);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	plotmodel(md,'data',vel,'edgecolor','w');
+-
+-	md=bamg(model,'domain','Square.exp','hmax',.005);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',1.3,'anisomax',1);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	plotmodel(md,'data',vel,'edgecolor','w');
+-end %}}}
+-
+-if any(steps==8) % Mesh refinement in a specific region %{{{
+-	plotmodel(md,'data',vel,'edgecolor','w');
+-	exptool('refinement.exp');
+-	h=NaN*ones(md.mesh.numberofvertices,1);
+-	in=ContourToNodes(md.mesh.x,md.mesh.y,'refinement.exp',1);
+-	h(find(in))=0.02;
+-	plotmodel(md,'data',in,'edgecolor','w');
+-
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'hVertices',h);
+-	vel=shock(md.mesh.x,md.mesh.y);
+-	plotmodel(md,'data',vel,'edgecolor','w');
+-end %}}}
+Index: ../trunk-jpl/examples/Pig/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/Pig/runme.m	(revision 25986)
+@@ -1,6 +1,6 @@
+ steps=[1];
+ 
+-if any(steps==1) %Mesh Generation #1 %{{{
++if any(steps==1) %Mesh Generation #1 
+ 	%Mesh parameters
+ 	domain =['./DomainOutline.exp'];
+ 	hinit=10000;	% element size for the initial mesh
+@@ -50,9 +50,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Mesh_generation md;
+-end %}}}
++end 
+ 
+-if any(steps==2) %Masks #2 %{{{
++if any(steps==2) %Masks #2 
+ 	md = loadmodel('./Models/PIG_Mesh_generation');
+ 
+ 	% Load SeaRISe dataset for Antarctica
+@@ -78,9 +78,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_SetMask md;
+-end %}}}
++end 
+ 
+-if any(steps==3) %Parameterization #3 %{{{
++if any(steps==3) %Parameterization #3 
+ 	md = loadmodel('./Models/PIG_SetMask');
+ 	md = parameterize(md,'./Pig.par');
+ 
+@@ -89,9 +89,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==4) %Control Method #4 %{{{
++if any(steps==4) %Control Method #4 
+ 	md = loadmodel('./Models/PIG_Parameterization');
+ 
+ 	% Control general
+@@ -131,9 +131,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Control_drag md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %Plot #5 %{{{
++if any(steps==5) %Plot #5 
+ 	md = loadmodel('./Models/PIG_Control_drag');
+ 
+ 	plotmodel(md,...
+@@ -144,9 +144,9 @@
+ 		'colorbar#all','on','colorbartitle#1-2','(m/yr)',...
+ 		'caxis#1-2',([1.5,4000]),...
+ 		'colorbartitle#3','(m)', 'log#1-2',10);
+-end %}}}
++end 
+ 
+-if any(steps==6) %Higher-Order #6 %{{{
++if any(steps==6) %Higher-Order #6 
+ 	% Load Model
+ 
+ 	% Disable inversion
+@@ -161,7 +161,7 @@
+ 
+ end % step 6 end
+ 
+-if any(steps==7) %Plot #7 %{{{
++if any(steps==7) %Plot #7 
+ 	mdHO = loadmodel('./Models/PIG_ModelHO');
+ 	mdSSA = loadmodel('./Models/PIG_Control_drag');
+ 
+@@ -179,4 +179,4 @@
+ 		'colorbar#all','on','view#all',2,...
+ 		'colorbartitle#all','(m/yr)',...
+ 		'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/Pig2/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig2/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/Pig2/runme.m	(revision 25986)
+@@ -1,6 +1,6 @@
+ steps=[1];
+ 
+-if any(steps==1) %Mesh Generation #1 %{{{
++if any(steps==1) %Mesh Generation #1 
+ 
+ 	%Mesh parameters
+ 	domain =['./DomainOutline.exp'];
+@@ -39,9 +39,9 @@
+ 	% Plot and save model
+ 	plotmodel(md,'data','mesh')
+ 	save ./Models/PIG_Mesh_generation md;
+-end %}}}
++end 
+ 
+-if any(steps==2) %Masks #2 %{{{
++if any(steps==2) %Masks #2 
+ 	md = loadmodel('./Models/PIG_Mesh_generation');
+ 
+ 	% Load SeaRISe dataset for Antarctica  http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
+@@ -64,17 +64,17 @@
+ 	plotmodel(md,'data',md.mask.ocean_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
+ 
+ 	save ./Models/PIG_SetMask md;
+-end %}}}
++end 
+ 
+-if any(steps==3) %Parameterization #3 %{{{
++if any(steps==3) %Parameterization #3 
+ 	md = loadmodel('./Models/PIG_SetMask');
+ 	md = setflowequation(md,'SSA','all');
+ 	md = parameterize(md,'./Pig.par');
+ 
+ 	save ./Models/PIG_Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==4) %Rheology B inversion %{{{
++if any(steps==4) %Rheology B inversion 
+ 	md = loadmodel('./Models/PIG_Parameterization');
+ 
+ 	% Control general
+@@ -116,9 +116,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Control_B md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %drag inversion %{{{
++if any(steps==5) %drag inversion 
+ 	md = loadmodel('./Models/PIG_Control_B');
+ 
+ 	% Cost functions
+@@ -150,9 +150,9 @@
+ 		'colorbartitle#3','(m)', 'log#1-2',10);
+ 
+ 	save ./Models/PIG_Control_drag md;
+-end %}}}
++end 
+ 
+-if any(steps==6) %Transient Run #1 %{{{
++if any(steps==6) %Transient Run #1 
+ 
+ 	md = loadmodel('./Models/PIG_Control_drag');	
+ 
+@@ -179,7 +179,7 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Transient md;
+-end %}}}
++end 
+ 
+ if any(steps==7) %High Melt #2
+ 	md = loadmodel('./Models/PIG_Transient');	
+@@ -192,9 +192,9 @@
+ 	plot(time,[V_control',V_melt']); legend({'Control run','High melt'});
+ 
+ 	save ./Models/PIG_HighMelt md;
+-end %}}}
++end 
+ 
+-if any(steps==8) %Ice Front retreat %{{{
++if any(steps==8) %Ice Front retreat 
+ 	md = loadmodel('./Models/PIG_Transient');	
+ 
+ 	pos = find(ContourToNodes(md.mesh.x,md.mesh.y,'FrontRetreat.exp',2));
+@@ -205,9 +205,9 @@
+ 	plot(time,[V_control',V_melt',V_retreat']); legend({'Control run','High melt','Retreat'});
+ 
+ 	save ./Models/PIG_FrontRetreat md;
+-end %}}}
++end 
+ 
+-if any(steps==9) %High surface mass balance #3 %{{{
++if any(steps==9) %High surface mass balance #3 
+ 	%Load model from PIG_Transient
+ 	%...
+ 
+@@ -225,4 +225,4 @@
+ 
+ 	%Save model
+ 	save ./Models/PIG_SMB md;
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/PigSensitivity/runme.m
+===================================================================
+--- ../trunk-jpl/examples/PigSensitivity/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/PigSensitivity/runme.m	(revision 25986)
+@@ -1,6 +1,6 @@
+ steps=[1];
+ 
+-if any(steps==1) %Transient Run #1 %{{{
++if any(steps==1) %Transient Run #1 
+ 
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+ 
+@@ -34,9 +34,9 @@
+ 
+ 	% Save model
+ 	save ./Models/PIG_Transient md;
+-end %}}}
++end 
+ 
+-if any(steps==2) %High Melt #2 %{{{
++if any(steps==2) %High Melt #2 
+ 	md = loadmodel('./Models/PIG_Transient');
+ 
+ 	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+@@ -60,9 +60,9 @@
+ 		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
+ 
+ 	save ./Models/PIG_HighMelt md;
+-end %}}}
++end 
+ 
+-if any(steps==3) %Ice Front retreat %{{{
++if any(steps==3) %Ice Front retreat 
+ 	md = loadmodel('./Models/PIG_Transient');
+ 
+ 	md2=extract(md,'~FrontRetreat.exp');
+@@ -90,9 +90,9 @@
+ 		'caxis#3',([-1,1]),'caxis#4',([-1,1]));
+ 
+ 	save ./Models/PIG_FrontRetreat md2;
+-end %}}}
++end 
+ 
+-if any(steps==4) %High surface mass balance #3 %{{{
++if any(steps==4) %High surface mass balance #3 
+ 
+ 	%Load model
+ 
+@@ -106,4 +106,4 @@
+ 
+ 	%Save model
+ 
+-end %}}} % step 4 end
++end % step 4 end
+Index: ../trunk-jpl/examples/shakti/runme.m
+===================================================================
+--- ../trunk-jpl/examples/shakti/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/shakti/runme.m	(revision 25986)
+@@ -1,6 +1,6 @@
+ steps=[1:3];
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('	Step 1: Mesh');
+ 
+ 	%Generate unstructured mesh on 1,000 m square with typical element edge length of 20 m
+@@ -7,9 +7,9 @@
+ 	md=triangle(model,'./outline.exp',20);
+ 
+ 	save MoulinMesh md
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('	Step 2: Parameterization');
+ 	md=loadmodel('MoulinMesh');
+ 
+@@ -48,9 +48,9 @@
+ 	md.hydrology.spchead(pos)=md.geometry.base(pos);
+ 
+ 	save MoulinParam md;
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('	Step 3: Solve!');
+ 	md=loadmodel('MoulinParam');
+ 
+@@ -81,4 +81,4 @@
+ 	md=solve(md,'Transient');
+ 
+ 	save MoulinTransient md
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/EsaGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 25986)
+@@ -3,7 +3,7 @@
+ 
+ steps=[1]; % [1:5]
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	resolution=300;			% [km]
+@@ -17,9 +17,9 @@
+ 	save ./Models/EsaGRACE_Mesh md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/EsaGRACE_Mesh');
+ 
+@@ -35,9 +35,9 @@
+ 	plotmodel (md,'data',md.esa.deltathickness,...
+ 		'view',[90 -90],'caxis',[-.1 .1],...
+ 		'title','Ice height equivalent [m]');
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/EsaGRACE_Loads');
+ 
+@@ -64,9 +64,9 @@
+ 	md.miscellaneous.name='EsaGRACE';
+ 
+ 	save ./Models/EsaGRACE_Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: Solve Esa solver');
+ 	md = loadmodel('./Models/EsaGRACE_Parameterization');
+ 
+@@ -78,9 +78,9 @@
+ 	md=solve(md,'Esa');
+ 
+ 	save ./Models/EsaGRACE_Solution md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/EsaGRACE_Solution');
+ 
+@@ -139,4 +139,4 @@
+ 		set(gcf,'color','w');
+ 		%export_fig(fig_name{kk});
+ 	end
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/EsaWahr/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaWahr/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/EsaWahr/runme.m	(revision 25986)
+@@ -3,7 +3,7 @@
+ 
+ steps=[1]; % [1:7]
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Mesh creation');
+ 
+ 	md=roundmesh(model,100000,10000);  % Domain radius and element size [m]
+@@ -11,9 +11,9 @@
+ 	save ./Models/EsaWahr_Mesh md;
+ 
+ 	plotmodel(md,'data','mesh');
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Anisotropic mesh creation');
+ 
+ 	md=roundmesh(model,100000,1000);
+@@ -27,9 +27,9 @@
+ 	save ./Models/EsaWahr_Mesh md;
+ 
+ 	plotmodel (md,'data','mesh');
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Define loads');
+ 	md = loadmodel('./Models/EsaWahr_Mesh');
+ 
+@@ -47,9 +47,9 @@
+ 	save ./Models/EsaWahr_Loads md;
+ 
+ 	plotmodel (md,'data',md.esa.deltathickness,'title','Ice height equivalent [m]');
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: Parameterization');
+ 	md = loadmodel('./Models/EsaWahr_Loads');
+ 
+@@ -73,9 +73,9 @@
+ 	md.miscellaneous.name='EsaWahr';
+ 
+ 	save ./Models/EsaWahr_Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: Solve Esa solver');
+ 	md = loadmodel('./Models/EsaWahr_Parameterization');
+ 
+@@ -87,9 +87,9 @@
+ 	md=solve(md,'Esa');
+ 
+ 	save ./Models/EsaWahr_Solution md;
+-end %}}}
++end 
+ 
+-if any(steps==6) %{{{
++if any(steps==6) 
+ 	disp('   Step 6: Plot solutions');
+ 	md = loadmodel('./Models/EsaWahr_Solution');
+ 
+@@ -120,9 +120,9 @@
+ 		'axispos',[0.505 0.02 0.47 0.47],...
+ 		'colorbarpos',[0.53,0.065,0.18,0.02],'colorbartitle#4','East-west [mm]');
+ 	%export_fig('Fig5.pdf');
+-end %}}}
++end 
+ 
+-if any(steps==7) %{{{
++if any(steps==7) 
+ 	disp('   Step 7: Compare results against Wahr semi-analytic solutions');
+ 	md = loadmodel('./Models/EsaWahr_Solution');
+ 
+@@ -161,4 +161,4 @@
+ 		set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize',16);
+ 		set(gcf,'color','w');
+ 	%export_fig('Fig6.pdf');
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 25986)
+@@ -10,7 +10,7 @@
+ %Run Steps
+ 
+ %Mesh Generation #1
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 
+ 	%initialize md as a new model #help model
+ 	%->
+@@ -25,10 +25,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end %}}}
++end 
+ 
+ %Masks #2
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -44,10 +44,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end %}}}
++end 
+ 
+ %Parameterization #3
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -61,10 +61,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end %}}}
++end 
+ 
+ %Extrusion #4
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -80,10 +80,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end %}}}
++end 
+ 
+ %Set the flow computing method #5
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -96,10 +96,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end %}}}
++end 
+ 
+ %Set Boundary Conditions #6
+-if any(steps==6) %{{{
++if any(steps==6) 
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -149,10 +149,10 @@
+ 	% save the given model
+ 	%->
+ 
+-end %}}}
++end 
+ 
+ %Solving #7
+-if any(steps==7) %{{{
++if any(steps==7) 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+@@ -174,10 +174,10 @@
+ 
+ 	% plot the surface velocities #plotdoc
+ 	%->
+-end %}}}
++end 
+ 
+ %Solving #8
+-if any(steps==8) %{{{
++if any(steps==8) 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+@@ -211,4 +211,4 @@
+ 
+ 	% plot the surface velocities #plotdoc
+ 	%->
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 25986)
+@@ -1,6 +1,6 @@
+ steps=[1];
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	%Generate observations
+ 	md = model;
+ 	md = triangle(md,'DomainOutline.exp',100000);
+@@ -12,9 +12,9 @@
+ 	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 %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	%Modify rheology, now constant
+ 	loadmodel('model1.mat');
+ 	md.materials.rheology_B(:) = 1.8*10^8;
+@@ -29,9 +29,9 @@
+ 	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 %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	%invert for ice rigidity
+ 	loadmodel('model2.mat');
+ 
+@@ -50,9 +50,9 @@
+ 	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 %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	%invert for ice rigidity
+ 	loadmodel('model2.mat');
+ 
+@@ -72,4 +72,4 @@
+ 	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 %}}}
++end 
+Index: ../trunk-jpl/examples/SlrFarrell/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrFarrell/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/SlrFarrell/runme.m	(revision 25986)
+@@ -5,7 +5,7 @@
+ try
+  % [1:5]
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	numrefine=1;
+@@ -53,9 +53,9 @@
+ 	save ./Models/SlrFarrell_Mesh md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Define source as in Farrell, 1972, Figure 1');
+ 	md = loadmodel('./Models/SlrFarrell_Mesh');
+ 
+@@ -66,9 +66,9 @@
+ 	save ./Models/SlrFarrell_Loads md;
+ 
+ 	plotmodel (md,'data',md.slr.sealevel,'view',[90 90],'title#all','Initial sea-level [m]');
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/SlrFarrell_Loads');
+ 
+@@ -94,9 +94,9 @@
+ 	md.miscellaneous.name='SlrFarrell';
+ 
+ 	save ./Models/SlrFarrell_Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrFarrell_Parameterization');
+ 
+@@ -108,9 +108,9 @@
+ 	md=solve(md,'Slr');
+ 
+ 	save ./Models/SlrFarrell_Solution md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/SlrFarrell_Solution');
+ 
+@@ -146,4 +146,4 @@
+ 	title('Relative sea-level [% of GMSL]');
+ 	set(gcf,'color','w');
+ 	%export_fig('Fig5.pdf');
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 25986)
+@@ -3,7 +3,7 @@
+ 
+ steps=[7];
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	numrefine=1;
+@@ -55,9 +55,9 @@
+ 	save ./Models/SlrGRACE_Mesh md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/SlrGRACE_Mesh');
+ 
+@@ -71,9 +71,9 @@
+ 	save ./Models/SlrGRACE_Loads md;
+ 
+ 	plotmodel (md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/SlrGRACE_Loads');
+ 
+@@ -101,9 +101,9 @@
+ 	md.miscellaneous.name='SlrGRACE';
+ 
+ 	save ./Models/SlrGRACE_Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -119,9 +119,9 @@
+ 	md=solve(md,'Slr');
+ 
+ 	save ./Models/SlrGRACE_Solution md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+@@ -179,9 +179,9 @@
+ 		set(gcf,'color','w');
+ 		%export_fig(fig_name{kk});
+ 	end
+-end %}}}
++end 
+ 
+-if any(steps==6) %{{{
++if any(steps==6) 
+ 	disp('   Step 6: Transient run');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -215,9 +215,9 @@
+ 	md=solve(md,'tr');
+ 
+ 	save ./Models/SlrGRACE_Transient md;
+-end %}}}
++end 
+ 
+-if any(steps==7) %{{{
++if any(steps==7) 
+ 	disp('   Step 7: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+@@ -295,4 +295,4 @@
+ 	ylabel('GMSL [mm/yr]');
+ 	set(gcf,'color','w');
+ 	%export_fig('Fig7.pdf');
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 25986)
+@@ -3,7 +3,7 @@
+ 
+ steps=[8];
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	resolution=300;			% [km]
+@@ -20,9 +20,9 @@
+ 	save ./Models/SlrGRACE_Mesh md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: Global mesh creation: refined coastlines');
+ 
+ 	numrefine=1;
+@@ -79,9 +79,9 @@
+ 	save ./Models/SlrGRACE_Mesh_refined md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/SlrGRACE_Mesh_refined');
+ 
+@@ -134,9 +134,9 @@
+ 	save ./Models/SlrGRACE_Loads md;
+ 
+ 	plotmodel(md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 90],'title','Ice height equivalent [m]');
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: Parameterization');
+ 	md = loadmodel('./Models/SlrGRACE_Loads');
+ 
+@@ -164,9 +164,9 @@
+ 	md.miscellaneous.name='SlrGRACE';
+ 
+ 	save ./Models/SlrGRACE_Parameterization md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -182,9 +182,9 @@
+ 	md=solve(md,'Slr');
+ 
+ 	save ./Models/SlrGRACE_Solution md;
+-end %}}}
++end 
+ 
+-if any(steps==6) %{{{
++if any(steps==6) 
+ 	disp('   Step 6: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+@@ -242,9 +242,9 @@
+ 		set(gcf,'color','w');
+ 		%export_fig(fig_name{kk});
+ 	end
+-end %}}}
++end 
+ 
+-if any(steps==7) %{{{
++if any(steps==7) 
+ 	disp('   Step 7: Transient run');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -279,9 +279,9 @@
+ 	md=solve(md,'tr');
+ 
+ 	save ./Models/SlrGRACE_Transient md;
+-end %}}}
++end 
+ 
+-if any(steps==8) %{{{
++if any(steps==8) 
+ 	disp('   Step 8: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+@@ -302,4 +302,4 @@
+ 	ylabel('GMSL [mm]');
+ 	set(gcf,'color','w');
+ 	legend('GMSL','Incheon');
+-end %}}}
++end 
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25985)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25986)
+@@ -1,7 +1,7 @@
+ %PIG Uncertainty Quantification Tutorial
+ steps=[1];
+ 
+-if any(steps==1) %{{{
++if any(steps==1) 
+ 	disp('   Step 1: plot flux gates');
+ 
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+@@ -27,9 +27,9 @@
+ 		'text',{'1','2','3','4','5','6','7',...
+ 		'8','9','10','11','12','13'},...
+ 		'textposition',textpositions);
+-end %}}}
++end 
+ 
+-if any(steps==2) %{{{
++if any(steps==2) 
+ 	disp('   Step 2: compute cross overs from CRESIS');
+ 
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+@@ -57,9 +57,9 @@
+ 	DeltaHH(pos)=min(DeltaHH(pos2));
+ 
+ 	save Models/PIG.CrossOvers DeltaHH
+-end %}}}
++end 
+ 
+-if any(steps==3) %{{{
++if any(steps==3) 
+ 	disp('   Step 3: sampling analysis');
+ 
+ 	%load model and cross over errors
+@@ -149,9 +149,9 @@
+ 	md=solve(md,'Stressbalance','overwrite','y');
+ 
+ 	save ./Models/PIG.Sampling md;
+-end %}}}
++end 
+ 
+-if any(steps==4) %{{{
++if any(steps==4) 
+ 	disp('   Step 4: sensitivity analysis');
+ 
+ 	%load model
+@@ -241,9 +241,9 @@
+ 	md=solve(md,'Stressbalance','overwrite','y');
+ 
+ 	save ./Models/PIG.Sensitivity md;
+-end %}}}
++end 
+ 
+-if any(steps==5) %{{{
++if any(steps==5) 
+ 	disp('   Step 5: plot partition');
+ 
+ 	%load model
+@@ -252,9 +252,9 @@
+ 	plotmodel(md,'data','mesh','partition',partition,...
+ 	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
+ 	'title','Partition Edges on ISSM mesh','grid','on');
+-end %}}}
++end 
+ 
+-if any(steps==6) %{{{
++if any(steps==6) 
+ 	disp('   Step 6: plot histogram');
+ 
+ 	%load model
+@@ -272,9 +272,9 @@
+ 	'xlabelplt','M (Gt/yr)','ylabelplt','F','FontSize',8,'FaceColor',...
+ 	'none','EdgeColor','red');
+ 
+-end %}}}
++end 
+ 
+-if any(steps==7) %{{{
++if any(steps==7) 
+ 	disp('   Step 7: plot sensitivity');
+ 
+ 	%load model
+@@ -312,4 +312,4 @@
+ 		'colorbartitle#1','If_{H}', 'colorbartitle#2','If_{\alpha}',...
+ 		'colorbartitle#3','If_{B}','unit#all','km','figure',2,...
+ 		'title','Importance Factors: H, \alpha, B');
+-end %}}}
++end 
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 25985)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 25986)
+@@ -63,7 +63,7 @@
+ 		elif [ "${dir}" == "./Greenland" ]; then
+ 			# STEP_SEVEN #{{{
+ 			STEP_SEVEN="\
+-				if any(steps==7) %{{{\n\
++				if any(steps==7)\n\
+ 					disp('   Step 7: Historical Relaxation run');\n\
+ 					md = loadmodel('./Models/Greenland.Control_drag');\n\
+ 					\n\
+@@ -95,12 +95,12 @@
+ 					md=solve(md,'Transient');\n\
+ 					\n\
+ 					save ./Models/Greenland.HistoricTransient_200yr md;\n\
+-				end %}}}\n\
++				end\n\
+ 			"
+ 			#}}}
+ 			# STEP_EIGHT #{{{
+ 			STEP_EIGHT="\
+-				if any(steps==8) %{{{\n\
++				if any(steps==8)\n\
+ 					%Load historic transient model\n\
+ 					md=loadmodel('./Models/Greenland.HistoricTransient_200yr');\n\
+ 					\n\
+@@ -147,7 +147,7 @@
+ 					%Title this plot Mean Velocity and add an x label of years\n\
+ 					title('Ice Volume');\n\
+ 					xlabel('years');\n\
+-				end %}}}\n\
++				end\n\
+ 			"
+ 			#}}}
+ 			sed -i.bak -e 's|steps=\[1\];|steps=\[1:8\];\n\ntry\n|' $RUNME_FILE
+@@ -169,6 +169,7 @@
+ 			# - Run test again with ISMIPF configuration (will likely need to 
+ 			#	add conditional after 'RUN_EXAMPLE -eq 1' block)
+ 			#
++
+ 			# RUNME #{{{
+ 			RUNME="\
+ 				try\n\
+@@ -186,7 +187,7 @@
+ 					%Run Steps\n\
+ 					\n\
+ 					%Mesh Generation #1\n\
+-					if any(steps==1) %{{{\n\
++					if any(steps==1)\n\
+ 						%initialize md as a new model #help model\n\
+ 						%->\n\
+ 						md=model();\n\
+@@ -204,10 +205,10 @@
+ 						% save the given model\n\
+ 						%->\n\
+ 						save ./Models/ISMIP.Mesh_generation md;\n\
+-					end %}}}\n\
++					end\n\
+ 					\n\
+ 					%Masks #2\n\
+-					if any(steps==2) %{{{\n\
++					if any(steps==2)\n\
+ 						% load the preceding step #help loadmodel\n\
+ 						% path is given by the organizer with the name of the given step\n\
+ 						%->\n\
+@@ -222,10 +223,10 @@
+ 						% save the given model\n\
+ 						%->\n\
+ 						save ./Models/ISMIP.SetMask md;\n\
+-					end %}}}\n\
++					end\n\
+ 					\n\
+ 					%Parameterization #3\n\
+-					if any(steps==3) %{{{\n\
++					if any(steps==3)\n\
+ 						% load the preceding step #help loadmodel\n\
+ 						% path is given by the organizer with the name of the given step\n\
+ 						%->\n\
+@@ -238,10 +239,10 @@
+ 						% save the given model\n\
+ 						%->\n\
+ 						save ./Models/ISMIP.Parameterization md;\n\
+-					end %}}}\n\
++					end\n\
+ 					\n\
+ 					%Extrusion #4\n\
+-					if any(steps==4) %{{{\n\
++					if any(steps==4)\n\
+ 						\n\
+ 						% load the preceding step #help loadmodel\n\
+ 						% path is given by the organizer with the name of the given step\n\
+@@ -257,10 +258,10 @@
+ 						% save the given model\n\
+ 						%->\n\
+ 						save ./Models/ISMIP.Extrusion md;\n\
+-					end %}}}\n\
++					end\n\
+ 					\n\
+ 					%Set the flow computing method #5\n\
+-					if any(steps==5) %{{{\n\
++					if any(steps==5)\n\
+ 						\n\
+ 						% load the preceding step #help loadmodel\n\
+ 						% path is given by the organizer with the name of the given step\n\
+@@ -273,10 +274,10 @@
+ 						% save the given model\n\
+ 						%->\n\
+ 						save ./Models/ISMIP.SetFlow md;\n\
+-					end %}}}\n\
++					end\n\
+ 					\n\
+ 					%Set Boundary Conditions #6\n\
+-					if any(steps==6) %{{{\n\
++					if any(steps==6)\n\
+ 						\n\
+ 						% load the preceding step #help loadmodel\n\
+ 						% path is given by the organizer with the name of the given step\n\
+@@ -327,10 +328,10 @@
+ 						% save the given model\n\
+ 						%->\n\
+ 						save ./Models/ISMIP.BoundaryCondition md;\n\
+-					end %}}}\n\
++					end\n\
+ 					\n\
+ 					%Solving #7\n\
+-					if any(steps==7) %{{{\n\
++					if any(steps==7)\n\
+ 						% load the preceding step #help loadmodel\n\
+ 						% path is given by the organizer with the name of the given step\n\
+ 						%->\n\
+@@ -353,10 +354,10 @@
+ 						% plot the surface velocities #plotdoc\n\
+ 						%->\n\
+ 						plotmodel(md,'data',md.results.StressbalanceSolution.Vel)\n\
+-					end %}}}\n\
++					end\n\
+ 					\n\
+ 					%Solving #8\n\
+-					if any(steps==8) %{{{\n\
++					if any(steps==8)\n\
+ 						% load the preceding step #help loadmodel\n\
+ 						% path is given by the organizer with the name of the given step\n\
+ 						%->\n\
+@@ -391,7 +392,7 @@
+ 						% plot the surface velocities #plotdoc\n\
+ 						%->\n\
+ 						plotmodel(md,'data',md.results.TransientSolution(20).Vel)\n\
+-					end %}}}\n\
++					end\n\
+ 			"
+ 			#}}}
+ 			# PAR_A #{{{
+@@ -532,12 +533,89 @@
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Mesh" ]; then
+ 			# NOTE: Cannot test exptool region selection without GUI
+-			sed -i.bak -e 's|steps=\[1\];|steps=\[1:7\];\n\ntry\n|' $RUNME_FILE
++			#
++
++			# RUNME #{{{
++			RUNME="\
++				try\n\
++					steps=[1:7];\n\
++					\n\
++					if any(steps==1) % Model\n\
++						md=model;\n\
++					end\n\
++					\n\
++					if any(steps==2) % squaremesh\n\
++						md=squaremesh(md,100,200,15,25);\n\
++						plotmodel(md,'data','mesh');\n\
++					end\n\
++					\n\
++					if any(steps==3) % roundmesh\n\
++						md=roundmesh(model,100,10);\n\
++						plotmodel(md,'data','mesh');\n\
++					end\n\
++					\n\
++					if any(steps==4) % triangle\n\
++						md=triangle(model,'Square.exp',.2);\n\
++						plotmodel(md,'data','mesh');\n\
++					end\n\
++					\n\
++					if any(steps==5) % bamg\n\
++						md=bamg(model,'domain','Square.exp','hmax',.05);\n\
++						plotmodel(md,'data','mesh');\n\
++					end\n\
++					\n\
++					if any(steps==6) % Non-Uniform mesh\n\
++						hvertices=[0.2;0.2;0.005;0.2];\n\
++						md=bamg(md,'domain','Square.exp','hvertices',hvertices);\n\
++						plotmodel(md,'data','mesh');\n\
++					end\n\
++					\n\
++					if any(steps==7) % Mesh adaptation\n\
++						md=bamg(model,'domain','Square.exp','hmax',.05);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						plotmodel(md,'data',vel,'edgecolor','w');\n\
++						\n\
++						md=bamg(model,'domain','Square.exp','hmax',.005);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						md=bamg(md,'field',vel,'err',0.05,'hmin',0.005,'hmax',0.3);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						plotmodel(md,'data',vel,'edgecolor','w');\n\
++						\n\
++						md=bamg(model,'domain','Square.exp','hmax',.005);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',3);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						plotmodel(md,'data',vel,'edgecolor','w');\n\
++						\n\
++						md=bamg(model,'domain','Square.exp','hmax',.005);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'gradation',1.3,'anisomax',1);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						plotmodel(md,'data',vel,'edgecolor','w');\n\
++					end\n\
++					\n\
++					if any(steps==8) % Mesh refinement in a specific region\n\
++						plotmodel(md,'data',vel,'edgecolor','w');\n\
++						exptool('refinement.exp');\n\
++						h=NaN*ones(md.mesh.numberofvertices,1);\n\
++						in=ContourToNodes(md.mesh.x,md.mesh.y,'refinement.exp',1);\n\
++						h(find(in))=0.02;\n\
++						plotmodel(md,'data',in,'edgecolor','w');\n\
++						\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						md=bamg(md,'field',vel,'err',0.03,'hmin',0.005,'hmax',0.3,'hVertices',h);\n\
++						vel=shock(md.mesh.x,md.mesh.y);\n\
++						plotmodel(md,'data',vel,'edgecolor','w');\n\
++					end\n\
++			"
++			#}}}
++			touch $RUNME_FILE
++			perl -0755 -p -i'.bak' -e "s|^.*$|${RUNME}|s" $RUNME_FILE
+ 			RUN_EXAMPLE=1
+ 		elif [ "${dir}" == "./Pig" ]; then
+ 			# STEP_SIX #{{{
+ 			STEP_SIX="\
+-				if any(steps==6) %{{{\n\
++				if any(steps==6)\n\
+ 					% Load Model\n\
+ 					md = loadmodel('./Models/PIG_Control_drag');\n\
+ 					% Disable inversion\n\
+@@ -553,7 +631,7 @@
+ 					md=solve(md,'Stressbalance');\n\
+ 					% Save Model\n\
+ 					save ./Models/PIG_ModelHO md;\n\
+-				end %}}}\n\
++				end\n\
+ 			"
+ 			#}}}
+ 			mv ./DomainOutline.bkp ./DomainOutline.exp > /dev/null 2>&1
+@@ -650,6 +728,10 @@
+ 			mv -f IsmipF.par.bak IsmipF.par
+ 		fi
+ 
++		if [ "${dir}" == "./Mesh" ]; then
++			rm -f $RUNME_FILE
++		fi
++
+ 		if [ "${dir}" == "./Pig" ]; then
+ 			mv -f DomainOutline.exp DomainOutline.bkp
+ 		fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25986-25987.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25986-25987.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25986-25987.diff	(revision 26740)
@@ -0,0 +1,133 @@
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25986)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25987)
+@@ -1,7 +1,7 @@
+ %PIG Uncertainty Quantification Tutorial
+-steps=[1];
++steps=[1:7];
+ 
+-if any(steps==1) 
++if any(steps==1)
+ 	disp('   Step 1: plot flux gates');
+ 
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+@@ -27,9 +27,9 @@
+ 		'text',{'1','2','3','4','5','6','7',...
+ 		'8','9','10','11','12','13'},...
+ 		'textposition',textpositions);
+-end 
++end
+ 
+-if any(steps==2) 
++if any(steps==2)
+ 	disp('   Step 2: compute cross overs from CRESIS');
+ 
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+@@ -57,9 +57,9 @@
+ 	DeltaHH(pos)=min(DeltaHH(pos2));
+ 
+ 	save Models/PIG.CrossOvers DeltaHH
+-end 
++end
+ 
+-if any(steps==3) 
++if any(steps==3)
+ 	disp('   Step 3: sampling analysis');
+ 
+ 	%load model and cross over errors
+@@ -140,7 +140,7 @@
+ 	md.cluster=generic('name',oshostname,'np',4);
+ 
+ 	%Dakota runs in parallel with a master/slave configuration.
+-	% At least 2 cpu's are needed to run the UQ
++	% At least 2 CPUs are needed to run the UQ
+ 	md.qmu.params.evaluation_scheduling='master';
+ 	md.qmu.params.processors_per_evaluation=md.cluster.np-1;
+ 
+@@ -149,12 +149,23 @@
+ 	md=solve(md,'Stressbalance','overwrite','y');
+ 
+ 	save ./Models/PIG.Sampling md;
+-end 
++end
+ 
+-if any(steps==4) 
+-	disp('   Step 4: sensitivity analysis');
++if any(steps==4)
++	disp('   Step 4: plot partition');
+ 
+ 	%load model
++	md = loadmodel('./Models/PIG.Sampling');
++
++	plotmodel(md,'data','mesh','partition',partition,...
++	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
++	'title','Partition Edges on ISSM mesh','grid','on');
++end
++
++if any(steps==5)
++	disp('   Step 5: sensitivity analysis');
++
++	%load model
+ 	md = loadmodel('../Pig/Models/PIG_Control_drag');
+ 
+ 	%partition the mesh
+@@ -230,7 +241,7 @@
+ 	md.cluster=generic('name',oshostname,'np',2);
+ 
+ 	%Dakota runs in parallel with a master/slave configuration.
+-	% At least 2 cpu's are needed to run the UQ
++	% At least 2 CPUs are needed to run the UQ
+ 	md.qmu.params.evaluation_scheduling='master';
+ 	md.qmu.params.processors_per_evaluation=md.cluster.np-1;
+ 
+@@ -241,20 +252,9 @@
+ 	md=solve(md,'Stressbalance','overwrite','y');
+ 
+ 	save ./Models/PIG.Sensitivity md;
+-end 
++end
+ 
+-if any(steps==5) 
+-	disp('   Step 5: plot partition');
+-
+-	%load model
+-	md = loadmodel('./Models/PIG.Sampling');
+-
+-	plotmodel(md,'data','mesh','partition',partition,...
+-	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
+-	'title','Partition Edges on ISSM mesh','grid','on');
+-end 
+-
+-if any(steps==6) 
++if any(steps==6)
+ 	disp('   Step 6: plot histogram');
+ 
+ 	%load model
+@@ -271,10 +271,9 @@
+ 	plot_hist_norm(result,'cdfleg','off','cdfplt','off','nrmplt','off',...
+ 	'xlabelplt','M (Gt/yr)','ylabelplt','F','FontSize',8,'FaceColor',...
+ 	'none','EdgeColor','red');
++end
+ 
+-end 
+-
+-if any(steps==7) 
++if any(steps==7)
+ 	disp('   Step 7: plot sensitivity');
+ 
+ 	%load model
+@@ -294,6 +293,7 @@
+ 		['MassFluxes/MassFlux' num2str(index) '.exp'],...
+ 		'expstyle#all','b-','linewidth#all',2,...
+ 		'nlines',3,'ncols',1, 'axis#all','image',...
++		'caxis#1',[0 150],'caxis#2',[-20 0],'caxis#3',[-25 0],...
+ 		'colorbar#all','on','colorbarfontsize#all',10,...
+ 		'colorbartitle#1','S_{H}', 'colorbartitle#2','S_{\alpha}',...
+ 		'colorbartitle#3','S_{B}','unit#all','km','figure',1,...
+@@ -312,4 +312,4 @@
+ 		'colorbartitle#1','If_{H}', 'colorbartitle#2','If_{\alpha}',...
+ 		'colorbartitle#3','If_{B}','unit#all','km','figure',2,...
+ 		'title','Importance Factors: H, \alpha, B');
+-end 
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-25987-25988.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25987-25988.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25987-25988.diff	(revision 26740)
@@ -0,0 +1,75 @@
+Index: ../trunk-jpl/src/m/classes/model.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.js	(revision 25987)
++++ ../trunk-jpl/src/m/classes/model.js	(revision 25988)
+@@ -26,7 +26,7 @@
+ 			console.log(sprintf("//19s: //-22s -- //s","verbose"         ,"[1x1 " + typeof(this.verbose) + "]","verbosity level in solve"));
+ 			console.log(sprintf("//19s: //-22s -- //s","settings"        ,"[1x1 " + typeof(this.settings) + "]","settings properties"));
+ 			console.log(sprintf("//19s: //-22s -- //s","toolkits"        ,"[1x1 " + typeof(this.toolkits) + "]","PETSc options for each solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","cluster"         ,"[1x1 " + typeof(this.cluster) + "]","cluster parameters (number of cpus...)"));
++			console.log(sprintf("//19s: //-22s -- //s","cluster"         ,"[1x1 " + typeof(this.cluster) + "]","cluster parameters (number of CPUs...)"));
+ 			console.log(sprintf("//19s: //-22s -- //s","balancethickness","[1x1 " + typeof(this.balancethickness) + "]","parameters for balancethickness solution"));
+ 			console.log(sprintf("//19s: //-22s -- //s","stressbalance"   ,"[1x1 " + typeof(this.stressbalance) + "]","parameters for stressbalance solution"));
+ 			console.log(sprintf("//19s: //-22s -- //s","groundingline"   ,"[1x1 " + typeof(this.groundingline) + "]","parameters for groundingline solution"));
+@@ -42,7 +42,7 @@
+ 			console.log(sprintf("//19s: //-22s -- //s","esa"             ,"[1x1 " + typeof(this.esa) + "]","parameters for elastic adjustment solution"));
+ 			console.log(sprintf("//19s: //-22s -- //s","autodiff"        ,"[1x1 " + typeof(this.autodiff) + "]","automatic differentiation parameters"));
+ 			console.log(sprintf("//19s: //-22s -- //s","inversion"       ,"[1x1 " + typeof(this.inversion) + "]","parameters for inverse methods"));
+-			console.log(sprintf("//19s: //-22s -- //s","qmu"             ,"[1x1 " + typeof(this.qmu) + "]","dakota properties"));
++			console.log(sprintf("//19s: //-22s -- //s","qmu"             ,"[1x1 " + typeof(this.qmu) + "]","Dakota properties"));
+ 			console.log(sprintf("//19s: //-22s -- //s","amr"             ,"[1x1 " + typeof(this.amr) + "]","adaptive mesh refinement properties"));
+ 			console.log(sprintf("//19s: //-22s -- //s","outputdefinition","[1x1 " + typeof(this.outputdefinition) + "]","output definition"));
+ 			console.log(sprintf("//19s: //-22s -- //s","results"         ,"[1x1 " + typeof(this.results) + "]","model results"));
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 25987)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 25988)
+@@ -1489,7 +1489,7 @@
+ 			disp(sprintf('%19s: %-22s -- %s','verbose'         ,['[1x1 ' class(self.verbose) ']'],'verbosity level in solve'));
+ 			disp(sprintf('%19s: %-22s -- %s','settings'        ,['[1x1 ' class(self.settings) ']'],'settings properties'));
+ 			disp(sprintf('%19s: %-22s -- %s','toolkits'        ,['[1x1 ' class(self.toolkits) ']'],'PETSc options for each solution'));
+-			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of cpus...)'));
++			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of CPUs...)'));
+ 			disp(sprintf('%19s: %-22s -- %s','balancethickness',['[1x1 ' class(self.balancethickness) ']'],'parameters for balancethickness solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','stressbalance'   ,['[1x1 ' class(self.stressbalance) ']'],'parameters for stressbalance solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','groundingline'   ,['[1x1 ' class(self.groundingline) ']'],'parameters for groundingline solution'));
+@@ -1497,7 +1497,7 @@
+ 			disp(sprintf('%19s: %-22s -- %s','masstransport'   ,['[1x1 ' class(self.masstransport) ']'],'parameters for masstransport solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','thermal'         ,['[1x1 ' class(self.thermal) ']'],'parameters for thermal solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','steadystate'     ,['[1x1 ' class(self.steadystate) ']'],'parameters for steadystate solution'));
+-			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parameters for transient solution'));
++			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parHwoameters for transient solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
+ 			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
+ 			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
+@@ -1506,7 +1506,7 @@
+ 			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
+ 			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
+-			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'dakota properties'));
++			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'Dakota properties'));
+ 			disp(sprintf('%19s: %-22s -- %s','amr'             ,['[1x1 ' class(self.amr) ']'],'adaptive mesh refinement properties'));
+ 			disp(sprintf('%19s: %-22s -- %s','outputdefinition',['[1x1 ' class(self.outputdefinition) ']'],'output definition'));
+ 			disp(sprintf('%19s: %-22s -- %s','results'         ,['[1x1 ' class(self.results) ']'],'model results'));
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 25987)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 25988)
+@@ -209,7 +209,7 @@
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("verbose", "[%s %s]" % ("1x1", obj.verbose.__class__.__name__), "verbosity level in solve"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("settings", "[%s %s]" % ("1x1", obj.settings.__class__.__name__), "settings properties"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("toolkits", "[%s %s]" % ("1x1", obj.toolkits.__class__.__name__), "PETSc options for each solution"))
+-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("cluster", "[%s %s]" % ("1x1", obj.cluster.__class__.__name__), "cluster parameters (number of cpus...)"))
++        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("cluster", "[%s %s]" % ("1x1", obj.cluster.__class__.__name__), "cluster parameters (number of CPUs...)"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("balancethickness", "[%s %s]" % ("1x1", obj.balancethickness.__class__.__name__), "parameters for balancethickness solution"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("stressbalance", "[%s %s]" % ("1x1", obj.stressbalance.__class__.__name__), "parameters for stressbalance solution"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("groundingline", "[%s %s]" % ("1x1", obj.groundingline.__class__.__name__), "parameters for groundingline solution"))
+@@ -226,7 +226,7 @@
+         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("love", "[%s %s]" % ("1x1", obj.love.__class__.__name__), "parameters for love solution"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("autodiff", "[%s %s]" % ("1x1", obj.autodiff.__class__.__name__), "automatic differentiation parameters"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("inversion", "[%s %s]" % ("1x1", obj.inversion.__class__.__name__), "parameters for inverse methods"))
+-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("qmu", "[%s %s]" % ("1x1", obj.qmu.__class__.__name__), "dakota properties"))
++        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("qmu", "[%s %s]" % ("1x1", obj.qmu.__class__.__name__), "Dakota properties"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("amr", "[%s %s]" % ("1x1", obj.amr.__class__.__name__), "adaptive mesh refinement properties"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("outputdefinition", "[%s %s]" % ("1x1", obj.outputdefinition.__class__.__name__), "output definition"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("results", "[%s %s]" % ("1x1", obj.results.__class__.__name__), "model results"))
Index: /issm/oecreview/Archive/25834-26739/ISSM-25988-25989.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25988-25989.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25988-25989.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh	(revision 25988)
++++ ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh	(revision 25989)
+@@ -78,3 +78,9 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
++
++# Make necessary link on RHEL
++if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
++	cd ${PREFIX}
++	ln -s ./lib64 ./lib
++fi
+Index: ../trunk-jpl/externalpackages/gmt/install-6-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-linux.sh	(revision 25988)
++++ ../trunk-jpl/externalpackages/gmt/install-6-linux.sh	(revision 25989)
+@@ -53,3 +53,9 @@
+ 	make -j $1
+ 	make -j $1 install
+ fi
++
++# Make necessary link on RHEL
++if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
++	cd ${PREFIX}
++	ln -s ./lib64 ./lib
++fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-25989-25990.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25989-25990.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25989-25990.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/externalpackages/autotools/install-win.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-win.sh	(revision 25989)
++++ ../trunk-jpl/externalpackages/autotools/install-win.sh	(revision 25990)
+@@ -5,7 +5,8 @@
+ ## Constants
+ #
+ AUTOCONF_VER="2.69"
+-AUTOMAKE_VER="1.16.1"
++AUTOMAKE_MIN_VER="1.16"
++AUTOMAKE_VER="${AUTOMAKE_MIN_VER}.1"
+ LIBTOOL_VER="2.4.2"
+ M4_VER="1.4.18"
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-25990-25991.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25990-25991.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25990-25991.diff	(revision 26740)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25990)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 25991)
+@@ -1,5 +1,5 @@
+ %PIG Uncertainty Quantification Tutorial
+-steps=[1:7];
++steps=[1];
+ 
+ if any(steps==1)
+ 	disp('   Step 1: plot flux gates');
Index: /issm/oecreview/Archive/25834-26739/ISSM-25991-25992.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25991-25992.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25991-25992.diff	(revision 26740)
@@ -0,0 +1,175 @@
+Index: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 25991)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 25992)
+@@ -350,6 +350,164 @@
+ 
+ 
+ 		end % }}}
++		function setlitho2prem(self) % {{{
++			%based on materials.radius and materials.issolid, replaces materials.density, materials.lame_mu, materials.lame_lambda
++			% with volumetric averages of a polynomial version of the PREM model
++			if ~strcmpi(self.nature, 'litho')
++			error('materials setlitho2prem error message: materials.nature must be ''litho''')
++			end
++		   
++		   
++		   ra=self.radius(end);
++		   r(1) = 0.0;     r(2) = 1221.5; r(3) = 3480.0; r(4) = 3630.;
++		   r(5) = 5600.0;  r(6) = 5701.0;  r(7) = 5771.0; r(8) = 5971.;
++		   r(9) = 6151.0; r(10) = 6291.0; r(11) = 6346.6;
++		   r(12) = 6356.0; r(13) = 6368.0; r(14) = 6371.;
++		  
++		   if (r(14)*1e3 ~= ra) 
++			error(['materials setlitho2prem error message: Earth surface radius in PREM r=' num2str(r(end)*1e3) ' does not match materials.radius(end)=' num2str(self.radius(end))]); 
++		   end
++
++		  d = zeros(12,4); %polynomial coef for density
++		  d(1,1) = 13.0885; 		         	  d(1,3) = -8.8381 ;
++		  d(2,1) = 12.5815; d(2,2) = -1.2638; d(2,3) = -3.6426; d(2,4) = -5.5281;
++		  d(3,1) = 7.9565 ; d(3,2) = -6.4761;   d(3,3) = 5.5283;  d(3,4) = -3.0807;
++		  d(4,1) = 7.9565 ; d(4,2) = -6.4761;   d(4,3) = 5.5283;  d(4,4) = -3.0807;
++		  d(5,1) = 7.9565 ; d(5,2) = -6.4761;   d(5,3) = 5.5283;  d(5,4) = -3.0807;
++		  d(6,1) = 5.3197 ; d(6,2) = -1.4836;
++		  d(7,1) = 11.2494; d(7,2) = -8.0298;
++		  d(8,1) = 7.1089 ; d(8,2) = -3.8045;
++		  d(9,1) = 2.6910 ; d(9,2) = 0.6924;
++		  d(10,1) = 2.6910; d(10,2) = 0.6924;
++		  d(11,1) = 2.9  ;
++		  d(12,1) = 2.6  ;
++
++		% ocean
++		  if (~self.issolid(end)) 
++		  	d(13,1) = 1.02 ;
++
++		% continental
++		  else
++		  d(13,1) = d(12,1);
++		  end
++
++		  p = zeros(13,4); %polynomial coef for Vp, pressure wave velocity
++		  p(1,1) = 11.2622 ; p(1,3) = -6.3640;
++		  p(2,1) = 11.0487 ; p(2,2) = -4.0362; p(2,3)  = 4.8023; p(2,4) = -13.5732;
++		  p(3,1) = 15.3891 ; p(3,2) = -5.3181; p(3,3)  = 5.5242; p(3,4) = -2.5514;
++		  p(4,1) = 24.952 ; p(4,2)  = -40.4673; p(4,3) = 51.4832; p(4,4) = -26.6419;
++		  p(5,1) = 29.2766 ; p(5,2) = -23.6027; p(5,3) = 5.5242; p(5,4) = -2.5514;
++		  p(6,1) = 19.0957 ; p(6,2)  = -9.8672;
++		  p(7,1) = 39.7027 ; p(7,2)  = -32.6166;
++		  p(8,1) = 20.3926 ; p(8,2)  = -12.2569;
++		  p(9,1) = 4.1875 ; p(9,2)  = 3.9382;
++		  p(10,1) = 4.1875 ; p(10,2) = 3.9382;
++		  p(11,1) = 6.8 ;
++		  p(12,1) = 5.8;
++		%
++		% ocean
++		  if (~self.issolid(end)) 
++		  p(13,1) = 1.45 ;
++		%
++		% continental
++		  else
++		  p(13,1) = p(12,1);
++		  end
++		%----
++		%
++		  s = zeros(13,4); %polynomial coef for Vs, shear wave velocity
++		%
++		  s(1,1) = 3.6678; s(1,3) = -4.4475;
++
++		  s(3,1) = 6.9254; s(3,2) = 1.4672; s(3,3) = -2.0834; s(3,4) = 0.9783;
++		  s(4,1) = 11.1671; s(4,2) = -13.7818; s(4,3) = 17.4575; s(4,4) = -9.2777;
++		  s(5,1) = 22.3459; s(5,2) = -17.2473; s(5,3) = -2.0834; s(5,4) = 0.9783;
++		  s(6,1) = 9.9839; s(6,2) = -4.9324;
++		  s(7,1) = 22.3512; s(7,2) = -18.5856 ;
++		  s(8,1) = 8.9496; s(8,2) = -4.4597;
++		  s(9,1) = 2.1519; s(9,2) = 2.3481;
++		  s(10,1) = 2.1519; s(10,2) = 2.3481;
++		  s(11,1) = 3.9 ;
++		  s(12,1) = 3.2 ;
++		%
++		% ocean (please don't modify)
++		  if (~self.issolid(end))
++		%
++		% continental
++		  else
++		  s(13,1) = s(12,1);
++		  end
++		%
++		%
++		  r = r*1e3;
++		  
++		  %- handling the first layer : central sphere
++		  rad = self.radius;
++		  rad(1) = 0.;
++		  
++		  for j = 1:self.numlayers
++		  
++			ro = 0.;
++			vp = 0.;
++			vs = 0.;
++
++			for i = 1:13
++
++				r1 = 0.;
++				r2 = 0.;
++				if ((rad(j) > r(i)) & (rad(j) <= r(i+1))) 
++					if (rad(j+1) <= r(i+1)) 
++						r2 = rad(j+1);
++						r1 = rad(j);
++					else
++						r2 = r(i+1);
++						r1 = rad(j);
++					end
++				elseif (rad(j) <= r(i))
++					if ((rad(j+1) > r(i)) & (rad(j+1) <= r(i+1)))
++						r2 = rad(j+1);
++						r1 = r(i);
++					elseif (rad(j+1) > r(i+1))
++						r2 = r(i+1);
++						r1 = r(i);
++					end
++				end
++
++				t1 = d(i,1)/3.;
++				t2 = d(i,2)/(ra*4.);
++				t3 = d(i,3)/((ra^2)*5.);
++				t4 = d(i,4)/((ra^3)*6.);
++				ro =  ro + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
++					  
++				t1 = p(i,1)/3.;
++				t2 = p(i,2)/(ra*4.);
++				t3 = p(i,3)/((ra^2)*5.);
++				t4 = p(i,4)/((ra^3)*6.);
++				vp =  vp + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
++					  
++				t1 = s(i,1)/3.;
++				t2 = s(i,2)/(ra*4.);
++				t3 = s(i,3)/((ra^2)*5.);
++				t4 = s(i,4)/((ra^3)*6.);
++				vs =  vs + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
++
++			end 
++			ro = ro*3 / (rad(j+1)^3-rad(j)^3);
++			vp = vp*3 /(rad(j+1)^3-rad(j)^3);
++			vs = vs*3 / (rad(j+1)^3-rad(j)^3);
++			mu = ro*vs.^2;
++			la = ro*vp.^2 - 2.*mu;
++			ro = ro*1e3;
++			la = la*1e9;
++			mu = mu*1e9;
++
++			self.density(j) = ro;
++			self.lame_lambda(j) = la;
++			self.lame_mu(j) = mu;
++		  end
++
++		end % }}}
++   
+ 	end
+ end
+ 
+@@ -376,3 +534,5 @@
+ 		end
+ 	end
+ end % }}}
++
++   
Index: /issm/oecreview/Archive/25834-26739/ISSM-25992-25993.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25992-25993.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25992-25993.diff	(revision 26740)
@@ -0,0 +1,166 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 25992)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 25993)
+@@ -3550,6 +3550,10 @@
+ 	IssmDouble pAir=0.0;
+ 	IssmDouble teValue=1.0;
+ 	IssmDouble aValue=0.0;
++	IssmDouble szaValue=0.0;
++	IssmDouble cotValue=0.0;
++	IssmDouble ccsnowValue=0.0;
++	IssmDouble cciceValue=0.0;
+ 	IssmDouble dt,time,smb_dt;
+ 	int        aIdx=0;
+ 	int        denIdx=0;
+@@ -3832,6 +3836,11 @@
+ 	pAir_input->GetInputValue(&pAir,gauss);  // screen level air pressure [Pa]
+ 	teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
+ 	aValue_input->GetInputValue(&aValue,gauss);  // Albedo [0 1]
++	//Not implemented as input
++	//szaValue;  // Solar Zenith Angle [degree]
++	//cotValue;  // Cloud Optical Thickness
++	//ccsnowValue;//concentration of light absorbing carbon for snow [ppm1]
++	//cciceValue;//concentration of light absorbing carbon for ice [ppm1]
+ 	//_printf_("Time: " << t << " Ta: " << Ta << " V: " << V << " dlw: " << dlw << " dsw: " << dsw << " P: " << P << " eAir: " << eAir << " pAir: " << pAir << "\n");
+ 	/*}}}*/
+ 
+@@ -3839,7 +3848,7 @@
+ 	if(isgraingrowth)grainGrowth(&re, &gdn, &gsp, T, dz, d, W, smb_dt, m, aIdx,this->Sid());
+ 
+ 	/*Snow, firn and ice albedo:*/
+-	if(isalbedo)albedo(&a,aIdx,re,dz,d,cldFrac,aIce,aSnow,aValue,adThresh,T,W,P,EC,Msurf,t0wet,t0dry,K,smb_dt,rho_ice,m,this->Sid());
++	if(isalbedo)albedo(&a,aIdx,re,dz,d,cldFrac,aIce,aSnow,aValue,adThresh,T,W,P,EC,Msurf,ccsnowValue,cciceValue,szaValue,cotValue,t0wet,t0dry,K,smb_dt,rho_ice,m,this->Sid());
+ 
+ 	/*Distribution of absorbed short wave radation with depth:*/
+ 	if(isshortwave)shortwave(&swf, swIdx, aIdx, dsw, a[0], d, dz, re,rho_ice,m,this->Sid());
+@@ -3926,7 +3935,8 @@
+ 
+ 	/*Check mass conservation:*/
+ 	if (dMass != 0.0){
+-		_printf_("total system mass not conserved in MB function \n");
++		_printf_("Time: " << setprecision(8) << timeinputs/365.0/24.0/3600.0 << ",total system mass not conserved in MB function \n");
++		_printf_("sumMass: " << sumMass << " sumR: " << sumR << " sumW: " << sumW << " sumP: " << sumP << " sumEC: " << sumEC << " initMass: " << initMass << " sumMassAdd: " << sumMassAdd << " \n");
+ 	}
+ 	#endif
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25992)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25993)
+@@ -409,7 +409,7 @@
+ 	*pgsp=gsp;
+ 
+ }  /*}}}*/
+-void albedo(IssmDouble** pa, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* TK, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m,int sid) { /*{{{*/
++void albedo(IssmDouble** pa, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* TK, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m,int sid) { /*{{{*/
+ 
+ 	//// Calculates Snow, firn and ice albedo as a function of:
+ 	//   0 : direct input from aValue parameter
+@@ -431,6 +431,12 @@
+ 
+ 	// Methods 1 & 2
+ 	//   re      = surface effective grain radius [mm]
++	// Method 1, optional
++	//  clabSnow = concentration of light absorbing carbon  [ppm1], default 0
++	//  SZA      = solar zenith angle of the incident radiation [deg], default 0
++	//  COT      = cloud optical thickness, default 0
++	//  For TWO LAYER
++	//  clabIce  = concentration of light absorbing carbon of first ice layer [ppm1], default 0
+ 
+ 	// Methods 3
+ 	//   d       = snow surface density [kg m-3]
+@@ -484,11 +490,77 @@
+ 		if(aIdx==1){ 
+ 			//function of effective grain radius
+ 
++			//gardnerAlb(S1, c1, SZA, t, z1, S2, c2)
++			//This is an implementation of the snow and ice broadband albedo
++			//  parameterization developed by Alex Gardner.
++			//Created By: Alex S. Gardner, Jet Propulsion Laboratory [alex.s.gardner@jpl.nasa.gov]
++			//  Last Modified: June, 2014
++			//Full Reference: Gardner, A. S., and Sharp, M. J.: A review of snow and
++			//  ice albedo and the development of a new physically based broadband albedo
++			//  parameterization, J. Geophys. Res., 115, F01009, 10.1029/2009jf001444,
++			//  2010.
++
++			//INPUTS
++			// ONE LAYER
++			//  - S1    : specific surface area of the snow or ice [cm^2 g-1]
++			//  - c1    : concentration of light absorbing carbon  [ppm1]
++			//  - SZA   : solar zenith angle of the incident radiation [deg]
++			//  - t     : cloud optical thickness
++			// TWO LAYER
++			//  - z1    : depth of snow suface layer [mm w.e.]
++			//  - S2    : specific surface area of bottom ice layer [cm^2 g-1]
++			//  - c2    : concentration of light absorbing carbon of bottom ice
++			//             layer [ppm1]
++			IssmDouble c1=clabSnow;
++			IssmDouble c2=clabIce;
++			IssmDouble t=COT;
++
++			//Single layer albedo parameterization
+ 			//convert effective radius to specific surface area [cm2 g-1]
+-			IssmDouble S = 3.0 / (0.091 * re[0]);
++			IssmDouble S1 = 3.0 / (0.091 * re[0]);
+ 
+-			//determine broadband albedo
+-			a[0]= 1.48 - pow(S,-0.07);
++			//effective solar zenith angle
++			IssmDouble x = min(pow(t/(3*cos(Pi*SZA/180.0)),0.5), 1.0);
++			IssmDouble u = 0.64*x + (1-x)*cos(Pi*SZA/180.0);
++
++			// pure snow albedo
++			IssmDouble as = 1.48 - pow(S1,-0.07);
++
++			//change in pure snow albedo due to soot loading
++			IssmDouble dac = max(0.04 - as, pow(-c1,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c1,0.6))*pow(S1,-0.25)));
++
++			//Two layer albedo parameterization
++			//  do two layer calculation if there is more than 1 layer
++			IssmDouble z1=0.0;
++			int lice=0;
++			for(int l=0;(l<m & d[l]<dPHC-Dtol);l++){
++				z1=z1+dz[l]*d[l]; //mm
++				lice=l+1;
++			}
++			if (m>0 & lice<m & z1 > Dtol){
++				// determine albedo values for bottom layer
++				IssmDouble S2 = 3.0 / (0.091 * re[lice]);
++
++				// pure snow albedo
++				IssmDouble as2 = 1.48 - pow(S2,-0.07);
++
++				// change in pure snow albedo due to soot loading
++				IssmDouble dac2 = max(0.04 - as2, pow(-c2,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c2,0.6))*pow(S2,-0.25)));
++
++				// determine the effective change due to finite depth and soot loading
++				IssmDouble A = min(1.0, (2.1 * pow(z1,1.35*(1-as) - 0.1*c1 - 0.13)));
++
++				dac =  (as2 + dac2 - as) + A*((as + dac) - (as2 + dac2));
++			}
++
++			// change in albedo due to solar zenith angle
++			IssmDouble dasz = 0.53*as*(1 - (as + dac))*pow(1 - u,1.2);
++
++			// change in albedo due to cloud (apart from change in diffuse fraction)
++			IssmDouble dat = (0.1*t*pow(as + dac,1.3)) / (pow(1 + 1.5*t,as));
++
++			// Broadband albedo
++			a[0] = as + dac + dasz + dat;
+ 		}
+ 		else if(aIdx==2){
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 25992)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 25993)
+@@ -28,7 +28,7 @@
+ void       GembgridInitialize(IssmDouble** pdz, int* psize, IssmDouble zTop, IssmDouble dzTop, IssmDouble zMax, IssmDouble zY);
+ IssmDouble Marbouty(IssmDouble T, IssmDouble d, IssmDouble dT);
+ void grainGrowth(IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* T,IssmDouble* dz,IssmDouble* d, IssmDouble* W,IssmDouble smb_dt,int m,int aIdx, int sid);
+-void albedo(IssmDouble** a,int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
++void albedo(IssmDouble** a,int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
+ void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble as, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
+ void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT);
+ void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
Index: /issm/oecreview/Archive/25834-26739/ISSM-25995-25996.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25995-25996.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25995-25996.diff	(revision 26740)
@@ -0,0 +1,196 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 25995)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 25996)
+@@ -38,12 +38,13 @@
+ 		thermal          = 0;
+ 		steadystate      = 0;
+ 		transient        = 0;
+-		levelset			  = 0;
++		levelset	     = 0;
+ 		calving          = 0;
+ 		frontalforcings  = 0;
+-		love			     = 0;
+-		gia				  = 0;
++		love			 = 0;
++		gia				 = 0;
+ 		esa              = 0;
++        sampling         = 0;
+ 
+ 		autodiff         = 0;
+ 		inversion        = 0;
+@@ -186,7 +187,9 @@
+ 						md.smb.isconstrainsurfaceT = 0;
+ 					end
+ 				end
+-			end
++            end
++            %2021 February 17
++			if isa(md.sampling,'double'); md.sampling=sampling(); end
+ 		end% }}}
+ 	end
+ 	methods
+@@ -240,6 +243,7 @@
+ 			md.gia              = giamme();
+ 			md.love             = fourierlove();
+ 			md.esa              = esa();
++            md.sampling         = sampling();
+ 			md.autodiff         = autodiff();
+ 			md.inversion        = inversion();
+ 			md.qmu              = qmu();
+@@ -1504,6 +1508,7 @@
+ 			disp(sprintf('%19s: %-22s -- %s','gia'             ,['[1x1 ' class(self.gia) ']'],'parameters for gia solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
++            disp(sprintf('%19s: %-22s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
+ 			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
+ 			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
+ 			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'Dakota properties'));
+Index: ../trunk-jpl/src/m/classes/sampling.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/sampling.m	(revision 25996)
+@@ -0,0 +1,129 @@
++%SAMPLING class definition
++%
++%   Usage:
++%      sampling=sampling();
++
++classdef sampling
++	properties (SetAccess=public)
++         kappa          = NaN;
++		 tau            = 0;
++		 beta           = NaN;
++         phi            = 0;
++         alpha          = 0;
++         robin          = 0;
++         seed           = 0;
++		 requested_outputs      = {};
++    end
++	methods
++		function self = sampling(varargin) % {{{
++            switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++            end
++		end % }}}
++		function list = defaultoutputs(self,md) % {{{
++
++            list = {};
++
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++            
++            %Scaling coefficient
++			self.tau=1;  
++
++            %Apply Robin boundary conditions
++			self.robin=0;   
++            
++            %Temporal correlation factor
++			self.phi=0;  
++            
++			%Exponent in fraction SPDE (default=2, biLaplacian covariance
++			%operator)
++			self.alpha=2; % Default 
++            
++            %Seed for pseudorandom number generator (default -1 for random seed)
++            self.seed=-1;
++            
++			%default output
++			self.requested_outputs={'default'};
++
++		end % }}}
++        function md = setparameters(self,md,lc,sigma) % {{{
++            
++            nu = self.alpha-1; 
++            KAPPA = sqrt(8*nu)/lc;
++            TAU = sqrt(gamma(nu)/(gamma(self.alpha)*(4*pi)*KAPPA^(2*nu)*sigma^2));
++            md.sampling.kappa = KAPPA*ones(md.mesh.numberofvertices,1);
++            md.sampling.tau = TAU;
++       
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++            
++            if ~ismember('SamplingAnalysis',analyses), return; end
++			
++            md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++            md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
++            md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++            md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
++            md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
++            md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
++            md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
++            md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
++
++		end % }}}
++		function disp(self) % {{{
++
++            disp(sprintf('   Sampling parameters:'));
++
++			disp(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
++            fielddisplay(self,'kappa','coefficient of the identity operator');
++			fielddisplay(self,'tau','scaling coefficient of the solution (default 1.0)');
++			fielddisplay(self,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)');
++          
++			disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
++			fielddisplay(self,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default 0)');
++			fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');          
++            
++            disp(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
++			fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
++            
++			disp(sprintf('\n      %s','Other parameters of stochastic sampler:'));
++            fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)');
++			fielddisplay(self,'requested_outputs','additional outputs requested (not implemented yet)');
++ 
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++
++            WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1);
++            WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double');
++            WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1);
++            WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double');
++            WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer');
++            WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean');
++            WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer');
++            
++			%process requested outputs
++			outputs = self.requested_outputs;
++			pos  = find(ismember(outputs,'default'));
++			if ~isempty(pos),
++				outputs(pos) = [];                         %remove 'default' from outputs
++				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
++			end
++			WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
++		end % }}}
++		function savemodeljs(self,fid,modelname) % {{{
++            
++            writejsdouble(fid,[modelname '.sampling.kappa'],self.kappa);
++            writejsdouble(fid,[modelname '.sampling.tau'],self.tau);
++            writejsdouble(fid,[modelname '.sampling.beta'],self.beta);
++            writejsdouble(fid,[modelname '.sampling.phi'],self.beta);
++            writejsdouble(fid,[modelname '.sampling.alpha'],self.alpha);
++            writejsdouble(fid,[modelname '.sampling.robin'],self.robin);
++            writejsdouble(fid,[modelname '.sampling.seed'],self.seed);
++			writejscellstring(fid,[modelname '.sampling.requested_outputs'],self.requested_outputs);
++
++		end % }}}
++	end
++end
+\ No newline at end of file
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 25995)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 25996)
+@@ -77,6 +77,8 @@
+ 		analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis'};
+ 	elseif strcmp(solutiontype,'DamageEvolutionSolution')
+ 		analyses={'DamageEvolutionAnalysis'};
++    elseif strcmp(solutiontype,'SamplingSolution')
++		analyses={'SamplingAnalysis'};    
+ 	else
+ 		error(' solution type: %s' , solutiontype, ' not supported yet!');
+ 	end
Index: /issm/oecreview/Archive/25834-26739/ISSM-25996-25997.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25996-25997.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25996-25997.diff	(revision 26740)
@@ -0,0 +1,1464 @@
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 25996)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 25997)
+@@ -45,6 +45,7 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Ta",SmbTaEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.V",SmbVEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.dswrf",SmbDswrfEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.smb.dswdiffrf",SmbDswdiffrfEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.dlwrf",SmbDlwrfEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.P",SmbPEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.eAir",SmbEAirEnum);
+@@ -69,10 +70,15 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.ECini",SmbECiniEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Wini",SmbWiniEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Aini",SmbAiniEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.smb.Adiffini",SmbAdiffiniEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Tini",SmbTiniEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Sizeini",SmbSizeiniEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.aValue",SmbAValueEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.teValue",SmbTeValueEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.smb.szaValue",SmbSzaValueEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.smb.cotValue",SmbCotValueEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.smb.ccsnowValue",SmbCcsnowValueEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.smb.cciceValue",SmbCciceValueEnum);
+ 			break;
+ 		case SMBpddEnum:
+ 			iomodel->FindConstant(&isdelta18o,"md.smb.isdelta18o");
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 25996)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 25997)
+@@ -3545,6 +3545,7 @@
+ 	IssmDouble V=0.0;
+ 	IssmDouble dlw=0.0;
+ 	IssmDouble dsw=0.0;
++	IssmDouble dswdiff=0.0;
+ 	IssmDouble P=0.0;
+ 	IssmDouble eAir=0.0;
+ 	IssmDouble pAir=0.0;
+@@ -3601,6 +3602,7 @@
+ 	IssmDouble  meanSHF=0.0;
+ 	IssmDouble* W = NULL;
+ 	IssmDouble* a = NULL;
++	IssmDouble* adiff = NULL;
+ 	IssmDouble* swf=NULL;
+ 	IssmDouble* T = NULL;
+ 	IssmDouble  T_bottom = 0.0;
+@@ -3616,6 +3618,7 @@
+ 	IssmDouble* gspini = NULL;
+ 	IssmDouble* Wini = NULL;
+ 	IssmDouble* aini = NULL;
++	IssmDouble* adiffini = NULL;
+ 	IssmDouble* Tini = NULL;
+ 	int         m=0;
+ 	/*}}}*/
+@@ -3694,6 +3697,7 @@
+ 		this->inputs->GetArray(SmbGspiniEnum,this->lid,&gspini,&m);
+ 		this->inputs->GetArray(SmbWiniEnum,this->lid,&Wini,&m);
+ 		this->inputs->GetArray(SmbAiniEnum,this->lid,&aini,&m);
++		this->inputs->GetArray(SmbAdiffiniEnum,this->lid,&adiffini,&m);
+ 		this->inputs->GetArray(SmbTiniEnum,this->lid,&Tini,&m);
+ 		EC_input = this->GetInput(SmbECiniEnum);  _assert_(EC_input);
+ 		EC_input->GetInputAverage(&EC);
+@@ -3713,6 +3717,7 @@
+ 			gsp = xNew<IssmDouble>(m); for(int i=0;i<m;i++)gsp[i]=gspini[0];         //set grain sphericity to old snow
+ 			W = xNew<IssmDouble>(m); for(int i=0;i<m;i++)W[i]=Wini[0];             //set water content to zero [kg m-2]
+ 			a = xNew<IssmDouble>(m); for(int i=0;i<m;i++)a[i]=aini[0];         //set albedo equal to fresh snow [fraction]
++			adiff = xNew<IssmDouble>(m); for(int i=0;i<m;i++)adiff[i]=adiffini[0];         //set diffusive albedo equal to 1 [fraction]
+ 			T = xNew<IssmDouble>(m); for(int i=0;i<m;i++)T[i]=Tmean;         //set initial grid cell temperature to the annual mean temperature [K]
+ 			/*/!\ Default value of T can not be retrived from SMBgemb.m (like other snow properties)
+ 			 *    because don't know Tmean yet when set default values.
+@@ -3731,6 +3736,7 @@
+ 			gsp = xNew<IssmDouble>(m);for(int i=0;i<m;i++)gsp[i]=gspini[i];
+ 			W = xNew<IssmDouble>(m);for(int i=0;i<m;i++)W[i]=Wini[i];
+ 			a = xNew<IssmDouble>(m);for(int i=0;i<m;i++)a[i]=aini[i];
++			adiff = xNew<IssmDouble>(m);for(int i=0;i<m;i++)adiff[i]=adiffini[i];
+ 			T = xNew<IssmDouble>(m);for(int i=0;i<m;i++)T[i]=Tini[i];
+ 
+ 			//fixed lower temperature bounday condition - T is fixed
+@@ -3756,6 +3762,7 @@
+ 		this->inputs->GetArray(SmbGspEnum,this->lid,&gsp,&m);
+ 		this->inputs->GetArray(SmbWEnum,this->lid,&W,&m);
+ 		this->inputs->GetArray(SmbAEnum,this->lid,&a,&m);
++		this->inputs->GetArray(SmbAdiffEnum,this->lid,&adiff,&m);
+ 		this->inputs->GetArray(SmbTEnum,this->lid,&T,&m);
+ 		EC_input = this->GetInput(SmbECDtEnum);  _assert_(EC_input);
+ 		EC_input->GetInputAverage(&EC);
+@@ -3820,11 +3827,16 @@
+ 	Input *V_input   = this->GetInput(SmbVEnum,timeinputs);     _assert_(V_input);
+ 	Input *Dlwr_input= this->GetInput(SmbDlwrfEnum,timeinputs); _assert_(Dlwr_input);
+ 	Input *Dswr_input= this->GetInput(SmbDswrfEnum,timeinputs); _assert_(Dswr_input);
++	Input *Dswrdiff_input= this->GetInput(SmbDswdiffrfEnum,timeinputs); _assert_(Dswrdiff_input);
+ 	Input *P_input   = this->GetInput(SmbPEnum,timeinputs);     _assert_(P_input);
+ 	Input *eAir_input= this->GetInput(SmbEAirEnum,timeinputs);  _assert_(eAir_input);
+ 	Input *pAir_input= this->GetInput(SmbPAirEnum,timeinputs);  _assert_(pAir_input);
+ 	Input *teValue_input= this->GetInput(SmbTeValueEnum,timeinputs); _assert_(teValue_input);
+ 	Input *aValue_input= this->GetInput(SmbAValueEnum,timeinputs); _assert_(aValue_input);
++	Input *szaValue_input= this->GetInput(SmbSzaValueEnum,timeinputs); _assert_(szaValue_input);
++	Input *cotValue_input= this->GetInput(SmbCotValueEnum,timeinputs); _assert_(cotValue_input);
++	Input *ccsnowValue_input= this->GetInput(SmbCcsnowValueEnum,timeinputs); _assert_(ccsnowValue_input);
++	Input *cciceValue_input= this->GetInput(SmbCciceValueEnum,timeinputs); _assert_(cciceValue_input);
+ 
+ 	/*extract daily data:{{{*/
+ 	Ta_input->GetInputValue(&Ta,gauss);//screen level air temperature [K]
+@@ -3831,16 +3843,16 @@
+ 	V_input->GetInputValue(&V,gauss);  //wind speed [m s-1]
+ 	Dlwr_input->GetInputValue(&dlw,gauss);   //downward longwave radiation flux [W m-2]
+ 	Dswr_input->GetInputValue(&dsw,gauss);   //downward shortwave radiation flux [W m-2]
++	Dswrdiff_input->GetInputValue(&dswdiff,gauss);   //downward shortwave diffuse radiation flux [W m-2]
+ 	P_input->GetInputValue(&P,gauss);        //precipitation [kg m-2]
+ 	eAir_input->GetInputValue(&eAir,gauss);  //screen level vapor pressure [Pa]
+ 	pAir_input->GetInputValue(&pAir,gauss);  // screen level air pressure [Pa]
+ 	teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
+ 	aValue_input->GetInputValue(&aValue,gauss);  // Albedo [0 1]
+-	//Not implemented as input
+-	//szaValue;  // Solar Zenith Angle [degree]
+-	//cotValue;  // Cloud Optical Thickness
+-	//ccsnowValue;//concentration of light absorbing carbon for snow [ppm1]
+-	//cciceValue;//concentration of light absorbing carbon for ice [ppm1]
++	szaValue_input->GetInputValue(&szaValue,gauss);  // Solar Zenith Angle [degree]
++	cotValue_input->GetInputValue(&cotValue,gauss);  // Cloud Optical Thickness
++	ccsnowValue_input->GetInputValue(&ccsnowValue,gauss); //concentration of light absorbing carbon for snow [ppm1]
++	cciceValue_input->GetInputValue(&cciceValue,gauss); //concentration of light absorbing carbon for ice [ppm1]
+ 	//_printf_("Time: " << t << " Ta: " << Ta << " V: " << V << " dlw: " << dlw << " dsw: " << dsw << " P: " << P << " eAir: " << eAir << " pAir: " << pAir << "\n");
+ 	/*}}}*/
+ 
+@@ -3848,10 +3860,10 @@
+ 	if(isgraingrowth)grainGrowth(&re, &gdn, &gsp, T, dz, d, W, smb_dt, m, aIdx,this->Sid());
+ 
+ 	/*Snow, firn and ice albedo:*/
+-	if(isalbedo)albedo(&a,aIdx,re,dz,d,cldFrac,aIce,aSnow,aValue,adThresh,T,W,P,EC,Msurf,ccsnowValue,cciceValue,szaValue,cotValue,t0wet,t0dry,K,smb_dt,rho_ice,m,this->Sid());
++	if(isalbedo)albedo(&a,&adiff,aIdx,re,dz,d,cldFrac,aIce,aSnow,aValue,adThresh,T,W,P,EC,Msurf,ccsnowValue,cciceValue,szaValue,cotValue,t0wet,t0dry,K,smb_dt,rho_ice,m,this->Sid());
+ 
+ 	/*Distribution of absorbed short wave radation with depth:*/
+-	if(isshortwave)shortwave(&swf, swIdx, aIdx, dsw, a[0], d, dz, re,rho_ice,m,this->Sid());
++	if(isshortwave)shortwave(&swf, swIdx, aIdx, dsw, dswdiff, a[0], adiff[0], d, dz, re,rho_ice,m,this->Sid());
+ 
+ 	/*Calculate net shortwave [W m-2]*/
+ 	netSW = netSW + cellsum(swf,m)*smb_dt/dt;
+@@ -3868,11 +3880,11 @@
+ 	dz[0] = dz[0] + EC / d[0];
+ 
+ 	/*Add snow/rain to top grid cell adjusting cell depth, temperature and density*/
+-	if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &re, &gdn, &gsp, &m, aIdx, dsnowIdx, Tmean, Ta, P, dzMin, aSnow, C, V, Vmean, rho_ice,this->Sid());
++	if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &adiff, &re, &gdn, &gsp, &m, aIdx, dsnowIdx, Tmean, Ta, P, dzMin, aSnow, C, V, Vmean, rho_ice,this->Sid());
+ 
+ 	/*Calculate water production, M [kg m-2] resulting from snow/ice temperature exceeding 273.15 deg K
+ 	 * (> 0 deg C), runoff R [kg m-2] and resulting changes in density and determine wet compaction [m]*/
+-	if(ismelt)melt(&M, &Msurf, &R, &mAdd, &dz_add, &T, &d, &dz, &W, &a, &re, &gdn, &gsp, &m, dzMin, zMax, zMin, zTop, zY, rho_ice,this->Sid());
++	if(ismelt)melt(&M, &Msurf, &R, &mAdd, &dz_add, &T, &d, &dz, &W, &a, &adiff, &re, &gdn, &gsp, &m, dzMin, zMax, zMin, zTop, zY, rho_ice,this->Sid());
+ 
+ 	/*Allow non-melt densification and determine compaction [m]*/
+ 	if(isdensification)densification(&d,&dz, T, re, denIdx, aIdx, swIdx, adThresh, C, smb_dt, Tmean,rho_ice,m,this->Sid());
+@@ -3902,6 +3914,7 @@
+ 					<< "swf[" << netSW << "] "
+ 					<< "lwf[" << netLW << "] "
+ 					<< "a[" << a << "] "
++					<< "adiff[" << adiff << "] "
+ 					<< "te[" << teValue << "] "
+ 					<< "\n");
+ 	} /*}}}*/
+@@ -3974,6 +3987,7 @@
+ 	this->inputs->SetArrayInput(SmbTEnum,this->lid,T,m);
+ 	this->inputs->SetArrayInput(SmbWEnum,this->lid,W,m);
+ 	this->inputs->SetArrayInput(SmbAEnum,this->lid,a,m);
++	this->inputs->SetArrayInput(SmbAdiffEnum,this->lid,adiff,m);
+ 	this->SetElementInput(SmbECEnum,sumEC/dt/rho_ice);
+ 	this->SetElementInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/dt/rho_ice);
+ 	this->SetElementInput(SmbMeltEnum,sumM/dt/rho_ice);
+@@ -4000,6 +4014,7 @@
+ 	if(gsp) xDelete<IssmDouble>(gsp);
+ 	if(W) xDelete<IssmDouble>(W);
+ 	if(a) xDelete<IssmDouble>(a);
++	if(adiff) xDelete<IssmDouble>(adiff);
+ 	if(T) xDelete<IssmDouble>(T);
+ 	if(dzini) xDelete<IssmDouble>(dzini);
+ 	if(dini) xDelete<IssmDouble>(dini);
+@@ -4008,6 +4023,7 @@
+ 	if(gspini) xDelete<IssmDouble>(gspini);
+ 	if(Wini) xDelete<IssmDouble>(Wini);
+ 	if(aini) xDelete<IssmDouble>(aini);
++	if(adiffini) xDelete<IssmDouble>(adiffini);
+ 	if(Tini) xDelete<IssmDouble>(Tini);
+ 	if(swf) xDelete<IssmDouble>(swf);
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25996)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25997)
+@@ -196,6 +196,82 @@
+ 	return F*H*G*E;
+ 
+ } /*}}}*/
++IssmDouble gardnerAlb(IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble dPHC, int m){ /*{{{*/
++	//gardnerAlb(S1, c1, SZA, t, z1, S2, c2)
++	//This is an implementation of the snow and ice broadband albedo
++	//  parameterization developed by Alex Gardner.
++	//Created By: Alex S. Gardner, Jet Propulsion Laboratory [alex.s.gardner@jpl.nasa.gov]
++	//  Last Modified: June, 2014
++	//Full Reference: Gardner, A. S., and Sharp, M. J.: A review of snow and
++	//  ice albedo and the development of a new physically based broadband albedo
++	//  parameterization, J. Geophys. Res., 115, F01009, 10.1029/2009jf001444,
++	//  2010.
++
++	//INPUTS
++	// ONE LAYER
++	//  - S1    : specific surface area of the snow or ice [cm^2 g-1]
++	//  - c1    : concentration of light absorbing carbon  [ppm1]
++	//  - SZA   : solar zenith angle of the incident radiation [deg]
++	//  - t     : cloud optical thickness
++	// TWO LAYER
++	//  - z1    : depth of snow suface layer [mm w.e.]
++	//  - S2    : specific surface area of bottom ice layer [cm^2 g-1]
++	//  - c2    : concentration of light absorbing carbon of bottom ice
++	//             layer [ppm1]
++	IssmDouble c1=clabSnow;
++	IssmDouble c2=clabIce;
++	IssmDouble t=COT;
++	IssmDouble a=0.0;
++
++	//Single layer albedo parameterization
++	//convert effective radius to specific surface area [cm2 g-1]
++	IssmDouble S1 = 3.0 / (0.091 * re[0]);
++
++	//effective solar zenith angle
++	IssmDouble x = min(pow(t/(3*cos(Pi*SZA/180.0)),0.5), 1.0);
++	IssmDouble u = 0.64*x + (1-x)*cos(Pi*SZA/180.0);
++
++	// pure snow albedo
++	IssmDouble as = 1.48 - pow(S1,-0.07);
++
++	//change in pure snow albedo due to soot loading
++	IssmDouble dac = max(0.04 - as, pow(-c1,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c1,0.6))*pow(S1,-0.25)));
++
++	//Two layer albedo parameterization
++	//  do two layer calculation if there is more than 1 layer
++	IssmDouble z1=0.0;
++	int lice=0;
++	for(int l=0;(l<m & d[l]<dPHC-Dtol);l++){
++		z1=z1+dz[l]*d[l]; //mm
++		lice=l+1;
++	}
++	if (m>0 & lice<m & z1 > Dtol){
++		// determine albedo values for bottom layer
++		IssmDouble S2 = 3.0 / (0.091 * re[lice]);
++
++		// pure snow albedo
++		IssmDouble as2 = 1.48 - pow(S2,-0.07);
++
++		// change in pure snow albedo due to soot loading
++		IssmDouble dac2 = max(0.04 - as2, pow(-c2,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c2,0.6))*pow(S2,-0.25)));
++
++		// determine the effective change due to finite depth and soot loading
++		IssmDouble A = min(1.0, (2.1 * pow(z1,1.35*(1-as) - 0.1*c1 - 0.13)));
++
++		dac =  (as2 + dac2 - as) + A*((as + dac) - (as2 + dac2));
++	}
++
++	// change in albedo due to solar zenith angle
++	IssmDouble dasz = 0.53*as*(1 - (as + dac))*pow(1 - u,1.2);
++
++	// change in albedo due to cloud (apart from change in diffuse fraction)
++	IssmDouble dat = (0.1*t*pow(as + dac,1.3)) / (pow(1 + 1.5*t,as));
++
++	// Broadband albedo
++	a = as + dac + dasz + dat;
++
++	return a;
++}   /*}}}*/
+ void grainGrowth(IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* T,IssmDouble* dz,IssmDouble* d, IssmDouble* W,IssmDouble smb_dt,int m,int aIdx,int sid){ /*{{{*/
+ 
+ 	/*Created by: Alex S. Gardner, University of Alberta
+@@ -409,7 +485,7 @@
+ 	*pgsp=gsp;
+ 
+ }  /*}}}*/
+-void albedo(IssmDouble** pa, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* TK, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m,int sid) { /*{{{*/
++void albedo(IssmDouble** pa, IssmDouble** padiff, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* TK, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m,int sid) { /*{{{*/
+ 
+ 	//// Calculates Snow, firn and ice albedo as a function of:
+ 	//   0 : direct input from aValue parameter
+@@ -470,11 +546,13 @@
+ 
+ 	/*output: */
+ 	IssmDouble* a=NULL;
++	IssmDouble* adiff=NULL;
+ 
+ 	if(VerboseSmb() && sid==0 && IssmComm::GetRank()==0)_printf0_("   albedo module\n");
+ 
+ 	/*Recover pointers: */
+ 	a=*pa;
++	adiff=*padiff;
+ 
+ 	//some constants:
+ 	const IssmDouble dSnow = 300;   // density of fresh snow [kg m-3]       
+@@ -489,78 +567,9 @@
+ 	else{
+ 		if(aIdx==1){ 
+ 			//function of effective grain radius
+-
+-			//gardnerAlb(S1, c1, SZA, t, z1, S2, c2)
+-			//This is an implementation of the snow and ice broadband albedo
+-			//  parameterization developed by Alex Gardner.
+-			//Created By: Alex S. Gardner, Jet Propulsion Laboratory [alex.s.gardner@jpl.nasa.gov]
+-			//  Last Modified: June, 2014
+-			//Full Reference: Gardner, A. S., and Sharp, M. J.: A review of snow and
+-			//  ice albedo and the development of a new physically based broadband albedo
+-			//  parameterization, J. Geophys. Res., 115, F01009, 10.1029/2009jf001444,
+-			//  2010.
+-
+-			//INPUTS
+-			// ONE LAYER
+-			//  - S1    : specific surface area of the snow or ice [cm^2 g-1]
+-			//  - c1    : concentration of light absorbing carbon  [ppm1]
+-			//  - SZA   : solar zenith angle of the incident radiation [deg]
+-			//  - t     : cloud optical thickness
+-			// TWO LAYER
+-			//  - z1    : depth of snow suface layer [mm w.e.]
+-			//  - S2    : specific surface area of bottom ice layer [cm^2 g-1]
+-			//  - c2    : concentration of light absorbing carbon of bottom ice
+-			//             layer [ppm1]
+-			IssmDouble c1=clabSnow;
+-			IssmDouble c2=clabIce;
+-			IssmDouble t=COT;
+-
+-			//Single layer albedo parameterization
+-			//convert effective radius to specific surface area [cm2 g-1]
+-			IssmDouble S1 = 3.0 / (0.091 * re[0]);
+-
+-			//effective solar zenith angle
+-			IssmDouble x = min(pow(t/(3*cos(Pi*SZA/180.0)),0.5), 1.0);
+-			IssmDouble u = 0.64*x + (1-x)*cos(Pi*SZA/180.0);
+-
+-			// pure snow albedo
+-			IssmDouble as = 1.48 - pow(S1,-0.07);
+-
+-			//change in pure snow albedo due to soot loading
+-			IssmDouble dac = max(0.04 - as, pow(-c1,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c1,0.6))*pow(S1,-0.25)));
+-
+-			//Two layer albedo parameterization
+-			//  do two layer calculation if there is more than 1 layer
+-			IssmDouble z1=0.0;
+-			int lice=0;
+-			for(int l=0;(l<m & d[l]<dPHC-Dtol);l++){
+-				z1=z1+dz[l]*d[l]; //mm
+-				lice=l+1;
+-			}
+-			if (m>0 & lice<m & z1 > Dtol){
+-				// determine albedo values for bottom layer
+-				IssmDouble S2 = 3.0 / (0.091 * re[lice]);
+-
+-				// pure snow albedo
+-				IssmDouble as2 = 1.48 - pow(S2,-0.07);
+-
+-				// change in pure snow albedo due to soot loading
+-				IssmDouble dac2 = max(0.04 - as2, pow(-c2,0.55)/(0.16 + 0.6*pow(S1,0.5) + (1.8*pow(c2,0.6))*pow(S2,-0.25)));
+-
+-				// determine the effective change due to finite depth and soot loading
+-				IssmDouble A = min(1.0, (2.1 * pow(z1,1.35*(1-as) - 0.1*c1 - 0.13)));
+-
+-				dac =  (as2 + dac2 - as) + A*((as + dac) - (as2 + dac2));
+-			}
+-
+-			// change in albedo due to solar zenith angle
+-			IssmDouble dasz = 0.53*as*(1 - (as + dac))*pow(1 - u,1.2);
+-
+-			// change in albedo due to cloud (apart from change in diffuse fraction)
+-			IssmDouble dat = (0.1*t*pow(as + dac,1.3)) / (pow(1 + 1.5*t,as));
+-
+-			// Broadband albedo
+-			a[0] = as + dac + dasz + dat;
++			// clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, int m
++			a[0]=gardnerAlb(re, dz, d, clabSnow, clabIce, SZA, COT, dPHC, m);
++			adiff[0]=gardnerAlb(re, dz, d, clabSnow, clabIce, 50, COT, dPHC, m);
+ 		}
+ 		else if(aIdx==2){
+ 
+@@ -697,6 +706,7 @@
+ 
+ 	/*Assign output pointers:*/
+ 	*pa=a;
++	*padiff=adiff;
+ 
+ }  /*}}}*/
+ void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT) { /*{{{*/
+@@ -1077,7 +1087,7 @@
+ 	*pulwrf=ulwrf;
+ 
+ }  /*}}}*/
+-void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble as, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid){ /*{{{*/
++void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble dswdiff, IssmDouble as, IssmDouble asdiff, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid){ /*{{{*/
+ 
+ 	// DISTRIBUTES ABSORBED SHORTWAVE RADIATION WITHIN SNOW/ICE
+ 
+@@ -1091,7 +1101,9 @@
+ 	//   swIdx   = shortwave allowed to penetrate surface (0 = No, 1 = Yes)
+ 	//   aIdx    = method for calculating albedo (1-4)
+ 	//   dsw     = downward shortwave radiative flux [w m-2]
++	//   dswdir  = downward shortwave direct radiative flux [w m-2]
+ 	//   as      = surface albedo
++	//   asdiff  = surface albedo for diffuse radiation
+ 	//   d       = grid cell density [kg m-3]
+ 	//   dz      = grid cell depth [m]
+ 	//   re      = grid cell effective grain radius [mm]
+@@ -1112,7 +1124,12 @@
+ 	if (swIdx == 0) {// all sw radation is absorbed in by the top grid cell
+ 
+ 		// calculate surface shortwave radiation fluxes [W m-2]
+-		swf[0] = (1.0 - as) * dsw;
++		if (aIdx == 1){
++			swf[0] = (1.0 - as) * dsw +  (1.0 - asdiff) * dswdiff;
++		}
++		else{
++			swf[0] = (1.0 - as) * dsw;
++		}
+ 	}
+ 	else{ // sw radation is absorbed at depth within the glacier
+ 
+@@ -1276,7 +1293,7 @@
+ 	*pswf=swf;
+ 
+ } /*}}}*/ 
+-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble T_air, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid){ /*{{{*/
++void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, 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
+ 
+@@ -1317,6 +1334,7 @@
+ 	IssmDouble* d=NULL;
+ 	IssmDouble* W=NULL;
+ 	IssmDouble* a=NULL;
++	IssmDouble* adiff=NULL;
+ 	IssmDouble* re=NULL;
+ 	IssmDouble* gdn=NULL;
+ 	IssmDouble* gsp=NULL;
+@@ -1330,6 +1348,7 @@
+ 	d=*pd;
+ 	W=*pW;
+ 	a=*pa;
++	adiff=*padiff;
+ 	re=*pre;
+ 	gdn=*pgdn;
+ 	gsp=*pgsp;
+@@ -1388,6 +1407,7 @@
+ 				newcell(&d,dSnow,top,m); //new cell d
+ 				newcell(&W,0.0,top,m); //new cell W
+ 				newcell(&a,aSnow,top,m); //new cell a
++				newcell(&adiff,aSnow,top,m); //new cell a
+ 				newcell(&re,refall,top,m); //new cell grain size
+ 				newcell(&gdn,dfall,top,m); //new cell grain dendricity
+ 				newcell(&gsp,sfall,top,m); //new cell grain sphericity
+@@ -1456,12 +1476,13 @@
+ 	*pd=d;
+ 	*pW=W;
+ 	*pa=a;
++	*padiff=adiff;
+ 	*pre=re;
+ 	*pgdn=gdn;
+ 	*pgsp=gsp;
+ 	*pm=m;
+ } /*}}}*/
+-void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid){ /*{{{*/
++void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid){ /*{{{*/
+ 
+ 	//// MELT ROUTINE
+ 
+@@ -1503,6 +1524,7 @@
+ 	IssmDouble d_bot=0.0;
+ 	IssmDouble W_bot=0.0;
+ 	IssmDouble a_bot=0.0;
++	IssmDouble adiff_bot=0.0;
+ 	IssmDouble re_bot=0.0;
+ 	IssmDouble gdn_bot=0.0;
+ 	IssmDouble gsp_bot=0.0;
+@@ -1532,6 +1554,7 @@
+ 	IssmDouble* dz=*pdz;
+ 	IssmDouble* W=*pW;
+ 	IssmDouble* a=*pa;
++	IssmDouble* adiff=*padiff;
+ 	IssmDouble* re=*pre;
+ 	IssmDouble* gdn=*pgdn;
+ 	IssmDouble* gsp=*pgsp;
+@@ -1782,6 +1805,7 @@
+ 		celldelete(&dz,n,D,D_size);
+ 		celldelete(&T,n,D,D_size);
+ 		celldelete(&a,n,D,D_size);
++		celldelete(&adiff,n,D,D_size);
+ 		celldelete(&re,n,D,D_size);
+ 		celldelete(&gdn,n,D,D_size);
+ 		celldelete(&gsp,n,D,D_size);
+@@ -1844,6 +1868,7 @@
+ 			IssmDouble m_new = m[X2] + m[X1];
+ 			T[X1] = (T[X2]*m[X2] + T[X1]*m[X1]) / m_new;
+ 			a[X1] = (a[X2]*m[X2] + a[X1]*m[X1]) / m_new;
++			adiff[X1] = (adiff[X2]*m[X2] + adiff[X1]*m[X1]) / m_new;
+ 			re[X1] = (re[X2]*m[X2] + re[X1]*m[X1]) / m_new;
+ 			gdn[X1] = (gdn[X2]*m[X2] + gdn[X1]*m[X1]) / m_new;
+ 			gsp[X1] = (gsp[X2]*m[X2] + gsp[X1]*m[X1]) / m_new;
+@@ -1870,6 +1895,7 @@
+ 	celldelete(&d,n,D,D_size);
+ 	celldelete(&T,n,D,D_size);
+ 	celldelete(&a,n,D,D_size);
++	celldelete(&adiff,n,D,D_size);
+ 	celldelete(&re,n,D,D_size);
+ 	celldelete(&gdn,n,D,D_size);
+ 	celldelete(&gsp,n,D,D_size);
+@@ -1907,6 +1933,7 @@
+ 			cellsplit(&T, n, j,1.0);
+ 			cellsplit(&d, n, j,1.0);
+ 			cellsplit(&a, n, j,1.0);
++			cellsplit(&adiff, n, j,1.0);
+ 			cellsplit(&EI, n, j,.5);
+ 			cellsplit(&EW, n, j,.5);
+ 			cellsplit(&re, n, j,1.0);
+@@ -1935,6 +1962,7 @@
+ 		m_bot=m[n-1];
+ 		d_bot=d[n-1];
+ 		a_bot=a[n-1];
++		adiff_bot=adiff[n-1];
+ 		re_bot=re[n-1];
+ 		gdn_bot=gdn[n-1];
+ 		gsp_bot=gsp[n-1];
+@@ -1949,6 +1977,7 @@
+ 		newcell(&m,m_bot,top,n);
+ 		newcell(&d,d_bot,top,n);
+ 		newcell(&a,a_bot,top,n);
++		newcell(&adiff,adiff_bot,top,n);
+ 		newcell(&re,re_bot,top,n);
+ 		newcell(&gdn,gdn_bot,top,n);
+ 		newcell(&gsp,gsp_bot,top,n);
+@@ -1974,6 +2003,7 @@
+ 		celldelete(&m,n,D,D_size);
+ 		celldelete(&d,n,D,D_size);
+ 		celldelete(&a,n,D,D_size);
++		celldelete(&adiff,n,D,D_size);
+ 		celldelete(&re,n,D,D_size);
+ 		celldelete(&gdn,n,D,D_size);
+ 		celldelete(&gsp,n,D,D_size);
+@@ -2033,6 +2063,7 @@
+ 	*pdz=dz;
+ 	*pW=W;
+ 	*pa=a;
++	*padiff=adiff;
+ 	*pre=re;
+ 	*pgdn=gdn;
+ 	*pgsp=gsp;
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 25996)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 25997)
+@@ -27,12 +27,13 @@
+ void       Gembx(FemModel* femmodel);
+ void       GembgridInitialize(IssmDouble** pdz, int* psize, IssmDouble zTop, IssmDouble dzTop, IssmDouble zMax, IssmDouble zY);
+ IssmDouble Marbouty(IssmDouble T, IssmDouble d, IssmDouble dT);
++IssmDouble gardnerAlb(IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble dPHC, int m);
+ void grainGrowth(IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* T,IssmDouble* dz,IssmDouble* d, IssmDouble* W,IssmDouble smb_dt,int m,int aIdx, int sid);
+-void albedo(IssmDouble** a,int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
+-void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble as, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
++void albedo(IssmDouble** a, IssmDouble** adiff, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
++void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble dswdiff, IssmDouble as, IssmDouble asdiff, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
+ void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT);
+-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
+-void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid);
++void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
++void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid);
+ void densification(IssmDouble** pd,IssmDouble** pdz, IssmDouble* T, IssmDouble* re, int denIdx, int aIdx, int swIdx, IssmDouble adThresh, IssmDouble C, IssmDouble dt, IssmDouble Tmean, IssmDouble dIce, int m, int sid);
+ void turbulentFlux(IssmDouble* pshf, IssmDouble* plhf, IssmDouble* pEC, IssmDouble Ta, IssmDouble Ts, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble ds, IssmDouble Ws, IssmDouble Vz, IssmDouble Tz, IssmDouble dIce, int sid);
+ #endif  /* _SurfaceMassBalancex_H*/
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25996)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 25997)
+@@ -756,8 +756,10 @@
+ syn keyword cConstant SmbAccumulatedPrecipitationEnum
+ syn keyword cConstant SmbAccumulatedRunoffEnum
+ syn keyword cConstant SmbAEnum
++syn keyword cConstant SmbAdiffEnum
+ syn keyword cConstant SmbAValueEnum
+ syn keyword cConstant SmbAccumulationEnum
++syn keyword cConstant SmbAdiffiniEnum
+ syn keyword cConstant SmbAiniEnum
+ syn keyword cConstant SmbBMaxEnum
+ syn keyword cConstant SmbBMinEnum
+@@ -764,6 +766,9 @@
+ syn keyword cConstant SmbBNegEnum
+ syn keyword cConstant SmbBPosEnum
+ syn keyword cConstant SmbCEnum
++syn keyword cConstant SmbCcsnowValueEnum
++syn keyword cConstant SmbCciceValueEnum
++syn keyword cConstant SmbCotValueEnum
+ syn keyword cConstant SmbDEnum
+ syn keyword cConstant SmbDailyairdensityEnum
+ syn keyword cConstant SmbDailyairhumidityEnum
+@@ -777,6 +782,7 @@
+ syn keyword cConstant SmbDiniEnum
+ syn keyword cConstant SmbDlwrfEnum
+ syn keyword cConstant SmbDswrfEnum
++syn keyword cConstant SmbDswdiffrfEnum
+ syn keyword cConstant SmbDzAddEnum
+ syn keyword cConstant SmbDzEnum
+ syn keyword cConstant SmbDzMinEnum
+@@ -829,6 +835,7 @@
+ syn keyword cConstant SmbSizeiniEnum
+ syn keyword cConstant SmbSmbCorrEnum
+ syn keyword cConstant SmbSmbrefEnum
++syn keyword cConstant SmbSzaValueEnum
+ syn keyword cConstant SmbTEnum
+ syn keyword cConstant SmbTaEnum
+ syn keyword cConstant SmbTeValueEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25996)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 25997)
+@@ -752,8 +752,10 @@
+ 	SmbAccumulatedPrecipitationEnum,
+ 	SmbAccumulatedRunoffEnum,
+ 	SmbAEnum,
++	SmbAdiffEnum,
+ 	SmbAValueEnum,
+ 	SmbAccumulationEnum,
++	SmbAdiffiniEnum,
+ 	SmbAiniEnum,
+ 	SmbBMaxEnum,
+ 	SmbBMinEnum,
+@@ -760,6 +762,9 @@
+ 	SmbBNegEnum,
+ 	SmbBPosEnum,
+ 	SmbCEnum,
++	SmbCcsnowValueEnum,
++	SmbCciceValueEnum,
++	SmbCotValueEnum,
+ 	SmbDEnum,
+ 	SmbDailyairdensityEnum,
+ 	SmbDailyairhumidityEnum,
+@@ -773,6 +778,7 @@
+ 	SmbDiniEnum,
+ 	SmbDlwrfEnum,
+ 	SmbDswrfEnum,
++	SmbDswdiffrfEnum,
+ 	SmbDzAddEnum,
+ 	SmbDzEnum,
+ 	SmbDzMinEnum,
+@@ -826,6 +832,7 @@
+ 	SmbSizeiniEnum,
+ 	SmbSmbCorrEnum,
+ 	SmbSmbrefEnum,
++	SmbSzaValueEnum,
+ 	SmbTEnum,
+ 	SmbTaEnum,
+ 	SmbTeValueEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25996)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 25997)
+@@ -758,8 +758,10 @@
+ 		case SmbAccumulatedPrecipitationEnum : return "SmbAccumulatedPrecipitation";
+ 		case SmbAccumulatedRunoffEnum : return "SmbAccumulatedRunoff";
+ 		case SmbAEnum : return "SmbA";
++		case SmbAdiffEnum : return "SmbAdiff";
+ 		case SmbAValueEnum : return "SmbAValue";
+ 		case SmbAccumulationEnum : return "SmbAccumulation";
++		case SmbAdiffiniEnum : return "SmbAdiffini";
+ 		case SmbAiniEnum : return "SmbAini";
+ 		case SmbBMaxEnum : return "SmbBMax";
+ 		case SmbBMinEnum : return "SmbBMin";
+@@ -766,6 +768,9 @@
+ 		case SmbBNegEnum : return "SmbBNeg";
+ 		case SmbBPosEnum : return "SmbBPos";
+ 		case SmbCEnum : return "SmbC";
++		case SmbCcsnowValueEnum : return "SmbCcsnowValue";
++		case SmbCciceValueEnum : return "SmbCciceValue";
++		case SmbCotValueEnum : return "SmbCotValue";
+ 		case SmbDEnum : return "SmbD";
+ 		case SmbDailyairdensityEnum : return "SmbDailyairdensity";
+ 		case SmbDailyairhumidityEnum : return "SmbDailyairhumidity";
+@@ -779,6 +784,7 @@
+ 		case SmbDiniEnum : return "SmbDini";
+ 		case SmbDlwrfEnum : return "SmbDlwrf";
+ 		case SmbDswrfEnum : return "SmbDswrf";
++		case SmbDswdiffrfEnum : return "SmbDswdiffrf";
+ 		case SmbDzAddEnum : return "SmbDzAdd";
+ 		case SmbDzEnum : return "SmbDz";
+ 		case SmbDzMinEnum : return "SmbDzMin";
+@@ -831,6 +837,7 @@
+ 		case SmbSizeiniEnum : return "SmbSizeini";
+ 		case SmbSmbCorrEnum : return "SmbSmbCorr";
+ 		case SmbSmbrefEnum : return "SmbSmbref";
++		case SmbSzaValueEnum : return "SmbSzaValue";
+ 		case SmbTEnum : return "SmbT";
+ 		case SmbTaEnum : return "SmbTa";
+ 		case SmbTeValueEnum : return "SmbTeValue";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25996)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 25997)
+@@ -776,8 +776,10 @@
+ 	      else if (strcmp(name,"SmbAccumulatedPrecipitation")==0) return SmbAccumulatedPrecipitationEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedRunoff")==0) return SmbAccumulatedRunoffEnum;
+ 	      else if (strcmp(name,"SmbA")==0) return SmbAEnum;
++	      else if (strcmp(name,"SmbAdiff")==0) return SmbAdiffEnum;
+ 	      else if (strcmp(name,"SmbAValue")==0) return SmbAValueEnum;
+ 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
++	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
+ 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
+ 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+ 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+@@ -784,6 +786,9 @@
+ 	      else if (strcmp(name,"SmbBNeg")==0) return SmbBNegEnum;
+ 	      else if (strcmp(name,"SmbBPos")==0) return SmbBPosEnum;
+ 	      else if (strcmp(name,"SmbC")==0) return SmbCEnum;
++	      else if (strcmp(name,"SmbCcsnowValue")==0) return SmbCcsnowValueEnum;
++	      else if (strcmp(name,"SmbCciceValue")==0) return SmbCciceValueEnum;
++	      else if (strcmp(name,"SmbCotValue")==0) return SmbCotValueEnum;
+ 	      else if (strcmp(name,"SmbD")==0) return SmbDEnum;
+ 	      else if (strcmp(name,"SmbDailyairdensity")==0) return SmbDailyairdensityEnum;
+ 	      else if (strcmp(name,"SmbDailyairhumidity")==0) return SmbDailyairhumidityEnum;
+@@ -797,6 +802,7 @@
+ 	      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,"SmbDswdiffrf")==0) return SmbDswdiffrfEnum;
+ 	      else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
+ 	      else if (strcmp(name,"SmbDz")==0) return SmbDzEnum;
+ 	      else if (strcmp(name,"SmbDzMin")==0) return SmbDzMinEnum;
+@@ -849,6 +855,7 @@
+ 	      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,"SmbSzaValue")==0) return SmbSzaValueEnum;
+ 	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
+ 	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
+ 	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
+@@ -867,7 +874,10 @@
+ 	      else if (strcmp(name,"SmbWini")==0) return SmbWiniEnum;
+ 	      else if (strcmp(name,"SmbZMax")==0) return SmbZMaxEnum;
+ 	      else if (strcmp(name,"SmbZMin")==0) return SmbZMinEnum;
+-	      else if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
+ 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+@@ -874,10 +884,7 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalBarystaticSeaLevelRate")==0) return SolidearthExternalBarystaticSeaLevelRateEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
++	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+ 	      else if (strcmp(name,"StrainRatexx")==0) return StrainRatexxEnum;
+@@ -990,7 +997,10 @@
+ 	      else if (strcmp(name,"Outputdefinition51")==0) return Outputdefinition51Enum;
+ 	      else if (strcmp(name,"Outputdefinition52")==0) return Outputdefinition52Enum;
+ 	      else if (strcmp(name,"Outputdefinition53")==0) return Outputdefinition53Enum;
+-	      else if (strcmp(name,"Outputdefinition54")==0) return Outputdefinition54Enum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"Outputdefinition54")==0) return Outputdefinition54Enum;
+ 	      else if (strcmp(name,"Outputdefinition55")==0) return Outputdefinition55Enum;
+ 	      else if (strcmp(name,"Outputdefinition56")==0) return Outputdefinition56Enum;
+ 	      else if (strcmp(name,"Outputdefinition57")==0) return Outputdefinition57Enum;
+@@ -997,10 +1007,7 @@
+ 	      else if (strcmp(name,"Outputdefinition58")==0) return Outputdefinition58Enum;
+ 	      else if (strcmp(name,"Outputdefinition59")==0) return Outputdefinition59Enum;
+ 	      else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
++	      else if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
+ 	      else if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
+ 	      else if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
+ 	      else if (strcmp(name,"Outputdefinition63")==0) return Outputdefinition63Enum;
+@@ -1113,7 +1120,10 @@
+ 	      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 stage=10;
++   }
++   if(stage==10){
++	      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,"ArrayInput")==0) return ArrayInputEnum;
+@@ -1120,10 +1130,7 @@
+ 	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
+ 	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+ 	      else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
++	      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;
+@@ -1236,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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;
+@@ -1243,10 +1253,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"Materials")==0) return MaterialsEnum;
++	      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;
+@@ -1359,7 +1366,10 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"SpcStatic")==0) return SpcStaticEnum;
+ 	      else if (strcmp(name,"SpcTransient")==0) return SpcTransientEnum;
+ 	      else if (strcmp(name,"Sset")==0) return SsetEnum;
+ 	      else if (strcmp(name,"StatisticsSolution")==0) return StatisticsSolutionEnum;
+@@ -1366,10 +1376,7 @@
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
++	      else if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
+ 	      else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
+ 	      else if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
+ 	      else if (strcmp(name,"StressbalanceVerticalAnalysis")==0) return StressbalanceVerticalAnalysisEnum;
+Index: ../trunk-jpl/src/m/classes/SMBgemb.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 25996)
++++ ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 25997)
+@@ -40,7 +40,7 @@
+ 		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.
++		aValue = NaN; %Albedo forcing at every element.  Used only if aIdx == 0, or density exceeds adThresh
+ 		teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
+ 
+ 		% Initialization of snow properties
+@@ -52,34 +52,35 @@
+ 		ECini = NaN; %evaporation/condensation (kg m-2)
+ 		Wini = NaN; %Water content (kg m-2)
+ 		Aini = NaN; %albedo (0-1)
++		Adiffini = NaN; %albedo, diffusive radiation (0-1)
+ 		Tini = NaN; %snow temperature (K)
+ 		Sizeini = NaN; %Number of layers
+ 
+ 		%settings:
+ 		aIdx   = NaN; %method for calculating albedo and subsurface absorption (default is 1)
+-			      % 0: direct input from aValue parameter
+-			      % 1: effective grain radius [Gardner & Sharp, 2009]
+-			      % 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003]], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
+-			      % 3: density and cloud amount [Greuell & Konzelmann, 1994]
+-			      % 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
++		% 0: direct input from aValue parameter
++		% 1: effective grain radius [Gardner & Sharp, 2009]
++		% 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003]], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
++		% 3: density and cloud amount [Greuell & Konzelmann, 1994]
++		% 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+ 
+ 		swIdx  = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, with snow density (taken from Bassford, 2004))
+ 
+ 		denIdx = NaN; %densification model to use (default is 2):
+-			      % 1 = emperical model of Herron and Langway (1980)
+-			      % 2 = semi-emperical model of Anthern et al. (2010)
+-			      % 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
+-			      % 4 = DO NOT USE: emperical model of Li and Zwally (2004)
+-			      % 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
+-			      % 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
+-			      % 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
++		% 1 = emperical model of Herron and Langway (1980)
++		% 2 = semi-emperical model of Anthern et al. (2010)
++		% 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
++		% 4 = DO NOT USE: emperical model of Li and Zwally (2004)
++		% 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
++		% 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
++		% 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
+ 
+ 		dsnowIdx = NaN; %model for fresh snow accumulation density (default is 1):
+-				% 0 = Original GEMB value, 150 kg/m^3
+-				% 1 = Antarctica value of fresh snow density, 350 kg/m^3
+-				% 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)
+-				% 3 = Antarctica model of Kaspers et al. (2004)
+-				% 4 = Greenland model of Kuipers Munneke et al. (2015)
++		% 0 = Original GEMB value, 150 kg/m^3
++		% 1 = Antarctica value of fresh snow density, 350 kg/m^3
++		% 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (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]
+@@ -91,18 +92,24 @@
+ 		outputFreq = NaN; %output frequency in days (default is monthly, 30)
+ 
+ 		%specific albedo parameters:
++		%Method 1
++		dswdiffrf = NaN; %downward diffusive shortwave radiation flux [W/m^2]
++		szaValue = NaN; %Solar Zenith Angle [degree]
++		cotValue = NaN; %Cloud Optical Thickness
++		ccsnowValue = NaN; %concentration of light absorbing carbon for snow [ppm1]
++		cciceValue = NaN; %concentration of light absorbing carbon for ice [ppm1]
+ 		%Method 1 and 2:
+ 		aSnow = NaN; % new snow albedo (0.64 - 0.89)
+ 		aIce  = NaN; % range 0.27-0.58 for old snow
+-			     %Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
++		%Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
+ 		cldFrac = NaN; % average cloud amount
+-			       %Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
++		%Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
+ 		t0wet = NaN; % time scale for wet snow (15-21.9)
+ 		t0dry = NaN; % warm snow timescale (30)
+ 		K     = NaN; % time scale temperature coef. (7)
+ 		adThresh = NaN; %Apply aIdx method to all areas with densities below this value,
+-		                %or else apply direct input value from aValue, allowing albedo to be altered.
+-				%Default value is rho water (1023 kg m-3).
++		%or else apply direct input value from aValue, allowing albedo to be altered.
++		%Default value is rho water (1023 kg m-3).
+ 
+ 		%densities:
+ 		InitDensityScaling= NaN; %initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
+@@ -133,25 +140,71 @@
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 
+-			self.Ta=project3d(md,'vector',self.Ta,'type','node');
+-			self.V=project3d(md,'vector',self.V,'type','node');
+-			self.dswrf=project3d(md,'vector',self.dswrf,'type','node');
+-			self.dswrf=project3d(md,'vector',self.dswrf,'type','node');
+-			self.P=project3d(md,'vector',self.P,'type','node');
+-			self.eAir=project3d(md,'vector',self.eAir,'type','node');
+-			self.pAir=project3d(md,'vector',self.pAir,'type','node');
++			self.Ta=project3d(md,'vector',self.Ta,'type','element');
++			self.V=project3d(md,'vector',self.V,'type','element');
++			self.dswrf=project3d(md,'vector',self.dswrf,'type','element');
++			self.dslrf=project3d(md,'vector',self.dslrf,'type','element');
++			self.P=project3d(md,'vector',self.P,'type','element');
++			self.eAir=project3d(md,'vector',self.eAir,'type','element');
++			self.pAir=project3d(md,'vector',self.pAir,'type','element');
+ 
++			if ~isnan(self.Dzini)
++				self.Dzini=project3d(md,'vector',self.Dzini,'type','element');
++			end
++			if ~isnan(self.Dini)
++				self.Dini=project3d(md,'vector',self.Dini,'type','element');
++			end
++			if ~isnan(self.Reini)
++				self.Reini=project3d(md,'vector',self.Reini,'type','element');
++			end
++			if ~isnan(self.Gdnini)
++				self.Gdnini=project3d(md,'vector',self.Gdnini,'type','element');
++			end
++			if ~isnan(self.Gspini)
++				self.Gspini=project3d(md,'vector',self.Gspini,'type','element');
++			end
++			if ~isnan(self.ECini)
++				self.ECini=project3d(md,'vector',self.ECini,'type','element');
++			end
++			if ~isnan(self.Wini)
++				self.Wini=project3d(md,'vector',self.Wini,'type','element');
++			end
++			if ~isnan(self.Aini)
++				self.Aini=project3d(md,'vector',self.Aini,'type','element');
++			end
++			if ~isnan(self.Adiffini)
++				self.Adiffini=project3d(md,'vector',self.Adiffini,'type','element');
++			end
++			if ~isnan(self.Tini)
++				self.Tini=project3d(md,'vector',self.Tini,'type','element');
++			end
++
++			if ~isnan(self.dswdiffrf)
++				self.dswdiffrf=project3d(md,'vector',self.dswdiffrf,'type','element');
++			end
++			if ~isnan(self.szaValue)
++				self.szaValue=project3d(md,'vector',self.szaValue,'type','element');
++			end
++			if ~isnan(self.cotValue)
++				self.cotValue=project3d(md,'vector',self.cotValue,'type','element');
++			end
++			if ~isnan(self.ccsnowValue)
++				self.ccsnowValue=project3d(md,'vector',self.ccsnowValue,'type','element');
++			end
++			if ~isnan(self.cciceValue)
++				self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
++			end
+ 			if (aIdx == 0) & ~isnan(self.aValue)
+-				self.aValue=project3d(md,'vector',self.aValue,'type','node');
++				self.aValue=project3d(md,'vector',self.aValue,'type','element');
+ 			end
+ 			if ~isnan(self.teValue)
+-				self.teValue=project3d(md,'vector',self.teValue,'type','node');
++				self.teValue=project3d(md,'vector',self.teValue,'type','element');
+ 			end
+ 
+ 
+ 		end % }}}
+ 		function list = defaultoutputs(self,md) % {{{
+-			list = {'SmbMassBalance'};
++			list = {'SmbMassBalance','SmbAccumulatedMassBalance'};
+ 		end % }}}
+ 		function self = setdefaultparameters(self,mesh,geometry) % {{{
+ 
+@@ -195,6 +248,12 @@
+ 			self.teValue = ones(mesh.numberofelements,1);
+ 			self.aValue = self.aSnow*ones(mesh.numberofelements,1);
+ 
++			self.dswdiffrf=0.0*ones(mesh.numberofelements,1);
++			self.szaValue=0.0*ones(mesh.numberofelements,1);
++			self.cotValue=0.0*ones(mesh.numberofelements,1);
++			self.ccsnowValue=0.0*ones(mesh.numberofelements,1);
++			self.cciceValue=0.0*ones(mesh.numberofelements,1);
++
+ 			self.Dzini=0.05*ones(mesh.numberofelements,2);
+ 			self.Dini=910.0*ones(mesh.numberofelements,2);
+ 			self.Reini=2.5*ones(mesh.numberofelements,2);
+@@ -203,6 +262,7 @@
+ 			self.ECini=0.0*ones(mesh.numberofelements,1);
+ 			self.Wini=0.0*ones(mesh.numberofelements,2);
+ 			self.Aini=self.aSnow*ones(mesh.numberofelements,2);
++			self.Adiffini=ones(mesh.numberofelements,2);
+ 			self.Tini=273.15*ones(mesh.numberofelements,2);
+ 			% 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
+ 			% 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
+@@ -225,6 +285,7 @@
+ 			md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
+ 			md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<',45,'size',size(self.Ta)); %max 500 km/h
+ 			md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400,'size',size(self.Ta));
++			md = checkfield(md,'fieldname','smb.dswdiffrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400);
+ 			md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'size',size(self.Ta));
+ 			md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',200,'size',size(self.Ta));
+ 			md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1,'size',size(self.Ta));
+@@ -231,17 +292,17 @@
+ 
+ 			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']);
++					'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']);
++					'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']);
++					'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']);
++					'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']);
++					'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']);
++					'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
+@@ -272,6 +333,12 @@
+ 				case {1 2}
+ 					md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'Inf',1,'>=',.64,'<=',.89);
+ 					md = checkfield(md,'fieldname','smb.aIce','NaN',1,'Inf',1,'>=',.27,'<=',.58);
++					if self.aIdx==1
++						md = checkfield(md,'fieldname','smb.szaValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',90);
++						md = checkfield(md,'fieldname','smb.cotValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
++						md = checkfield(md,'fieldname','smb.ccsnowValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
++						md = checkfield(md,'fieldname','smb.cciceValue','timeseries',1,'NaN',1,'Inf',1,'>=',0);
++					end
+ 				case 3
+ 					md = checkfield(md,'fieldname','smb.cldFrac','NaN',1,'Inf',1,'>=',0,'<=',1);
+ 				case 4
+@@ -306,8 +373,9 @@
+ 			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,'dlwrf','downward shortwave radiation flux [W/m^2]');
+-			fielddisplay(self,'dswrf','downward longwave radiation flux [W/m^2]');
++			fielddisplay(self,'dswrf','downward shortwave radiation flux [W/m^2]');
++			fielddisplay(self,'dswdiffrf','downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]');
++			fielddisplay(self,'dlwrf','downward longwave radiation flux [W/m^2]');
+ 			fielddisplay(self,'P','precipitation [mm w.e. / m^2]');
+ 			fielddisplay(self,'eAir','screen level vapor pressure [Pa]');
+ 			fielddisplay(self,'pAir','surface pressure [Pa]');
+@@ -327,11 +395,11 @@
+ 			fielddisplay(self,'outputFreq','output frequency in days (default is monthly, 30)');
+ 			fielddisplay(self,'adThresh',{'Apply aIdx method to all areas with densities below this value,','or else apply direct input value from aValue, allowing albedo to be altered.'});
+ 			fielddisplay(self,'aIdx',{'method for calculating albedo and subsurface absorption (default is 1)',...
+-					    '0: direct input from aValue parameter',...
+-					    '1: effective grain radius [Gardner & Sharp, 2009]',...
+-					    '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',...
+-					    '3: density and cloud amount [Greuell & Konzelmann, 1994]',...
+-					    '4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
++				'0: direct input from aValue parameter',...
++				'1: effective grain radius [Gardner & Sharp, 2009]',...
++				'2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',...
++				'3: density and cloud amount [Greuell & Konzelmann, 1994]',...
++				'4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
+ 
+ 			fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)');
+ 
+@@ -344,15 +412,22 @@
+ 			fielddisplay(self,'ECini','Initial evaporation/condensation when restart [kg m-2]');
+ 			fielddisplay(self,'Wini','Initial snow water content when restart [kg m-2]');
+ 			fielddisplay(self,'Aini','Initial albedo when restart [-]');
++			fielddisplay(self,'Adiffini','Initial diffusive radiation albedo when restart (default to 1) [-]');
+ 			fielddisplay(self,'Tini','Initial snow temperature when restart [K]');
+ 			fielddisplay(self,'Sizeini','Initial number of layers when restart [-]');
+ 
+ 			%additional albedo parameters:
+-			fielddisplay(self,'aValue','Albedo forcing at every element.');
++			fielddisplay(self,'aValue','Albedo forcing at every element');
+ 			switch self.aIdx
+ 				case {1 2}
+ 					fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
+ 					fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
++					if self.aIdx==1
++						fielddisplay(self,'szaValue','Solar Zenith Angle [degree]');
++						fielddisplay(self,'cotValue','Cloud Optical Thickness');
++						fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]');
++						fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]');
++					end
+ 				case 3
+ 					fielddisplay(self,'cldFrac','average cloud amount');
+ 				case 4
+@@ -363,19 +438,19 @@
+ 
+ 			fielddisplay(self,'swIdx','apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, with snow density (taken from Bassford, 2004)]');
+ 			fielddisplay(self,'denIdx',{'densification model to use (default is 2):',...
+-					    '1 = emperical model of Herron and Langway (1980)',...
+-					    '2 = semi-emperical model of Anthern et al. (2010)',...
+-					    '3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
+-					    '4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
+-					    '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
+-					    '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
+-					    '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
++				'1 = emperical model of Herron and Langway (1980)',...
++				'2 = semi-emperical model of Anthern et al. (2010)',...
++				'3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
++				'4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
++				'5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
++				'6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
++				'7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
+ 			fielddisplay(self,'dsnowIdx',{'model for fresh snow accumulation density (default is 1):',...
+-					    '0 = Original GEMB value, 150 kg/m^3',...
+-					    '1 = Antarctica value of fresh snow density, 350 kg/m^3',...
+-					    '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)',...
+-					    '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
+-					    '4 = Greenland model of Kuipers Munneke et al. (2015)'});
++				'0 = Original GEMB value, 150 kg/m^3',...
++				'1 = Antarctica value of fresh snow density, 350 kg/m^3',...
++				'2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (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, 'averaging', 'averaging methods from short to long steps');
+@@ -406,6 +481,7 @@
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswdiffrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlwrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+@@ -440,6 +516,10 @@
+ 
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cciceValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 
+ 			%snow properties init
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Dzini','format','DoubleMat','mattype',3);
+@@ -450,6 +530,7 @@
+ 			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','Adiffini','format','DoubleMat','mattype',3);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tini','format','DoubleMat','mattype',3);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Sizeini','format','IntMat','mattype',2);
+ 			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+@@ -463,6 +544,27 @@
+ 					any(md.smb.pAir(end,:) - md.smb.Ta(end,:) ~= 0))
+ 				error('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!');
+ 			end
++			if size(md.smb.teValue,2)>1 & any(md.smb.teValue(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing teValue is transient, it must have the same time steps as input Ta in the final row!');
++			end
++			if size(md.smb.dswdiffrf,2)>1 & any(md.smb.dswdiffrf(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!');
++			end
++			if size(md.smb.aValue,2)>1 & any(md.smb.aValue(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!');
++			end
++			if size(md.smb.szaValue,2)>1 & any(md.smb.szaValue(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!');
++			end
++			if size(md.smb.cotValue,2)>1 & any(md.smb.cotValue(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing cotValue is transient, it must have the same time steps as input Ta in the final row!');
++			end
++			if size(md.smb.ccsnowValue,2)>1 & any(md.smb.ccsnowValue(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing ccsnowValue is transient, it must have the same time steps as input Ta in the final row!');
++			end
++			if size(md.smb.cciceValue,2)>1 & any(md.smb.cciceValue(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing cciceValue is transient, it must have the same time steps as input Ta in the final row!');
++			end
+ 			time=self.Ta(end,:); %assume all forcings are on the same time step
+ 			dtime=diff(time,1);
+ 			dt=min(dtime);
+Index: ../trunk-jpl/src/m/classes/SMBgemb.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 25996)
++++ ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 25997)
+@@ -46,7 +46,7 @@
+         self.Vz                     = np.nan    # height above ground at which wind (V) was sampled [m]
+ 
+         #optional inputs:
+-        self.aValue                 = np.nan    # Albedo forcing at every element.  Used only if aIdx == 0.
++        self.aValue                 = np.nan    # Albedo forcing at every element.  Used only if aIdx == 0, or density exceeds adThresh
+         self.teValue                = np.nan    # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
+ 
+         # Initialization of snow properties
+@@ -58,6 +58,7 @@
+         self.ECini                  = np.nan    # evaporation/condensation (kg m-2)
+         self.Wini                   = np.nan    # Water content (kg m-2)
+         self.Aini                   = np.nan    # albedo (0-1)
++        self.Adiffini               = np.nan    # albedo, diffusive radiation (0-1)
+         self.Tini                   = np.nan    # snow temperature (K)
+         self.Sizeini                = np.nan    # Number of layers
+ 
+@@ -95,6 +96,12 @@
+         self.outputFreq             = np.nan    # output frequency in days (default is monthly, 30)
+ 
+         #specific albedo parameters:
++        #Method 1
++        dswdiffrf                   = np.nan    #downward diffusive shortwave radiation flux [W/m^2]
++        szaValue                    = np.nan    #Solar Zenith Angle [degree]
++        cotValue                    = np.nan    #Cloud Optical Thickness
++        ccsnowValue                 = np.nan    #concentration of light absorbing carbon for snow [ppm1]
++        cciceValue                  = np.nan    #concentration of light absorbing carbon for ice [ppm1]
+         #Method 1 and 2:
+         self.aSnow                  = np.nan    # new snow albedo (0.64 - 0.89)
+         self.aIce                   = np.nan    # range 0.27-0.58 for old snow
+@@ -151,8 +158,9 @@
+         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, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
++        string = "%s\n%s" % (string, fielddisplay(self, 'dswdiffrf', 'downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]'))
++        string = "%s\n%s" % (string, fielddisplay(self, 'dlwrf', 'downward longwave radiation flux [W/m^2]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'P', 'precipitation [mm w.e. / m^2]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'eAir', 'screen level vapor pressure [Pa]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'pAir', 'surface pressure [Pa]'))
+@@ -187,14 +195,21 @@
+         string = "%s\n%s" % (string, fielddisplay(self, 'ECini', 'Initial evaporation/condensation when restart [kg m-2]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'Wini', 'Initial snow water content when restart [kg m-2]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'Aini', 'Initial albedo when restart [-]'))
++        string = "%s\n%s" % (string, fielddisplay(self, 'Adiffini', 'Initial diffusive radiation albedo when restart (default to 1) [-]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'Tini', 'Initial snow temperature when restart [K]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [-]'))
+ 
+         #additional albedo parameters:
+-        string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element.'))
++        string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element'))
+         if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
+             string = "%s\n%s" % (string, fielddisplay(self, 'aSnow', 'new snow albedo (0.64 - 0.89)'))
+             string = "%s\n%s" % (string, fielddisplay(self, 'aIce', 'albedo of ice (0.27-0.58)'))
++            if self.aIdx == 1:
++                string = "%s\n%s" % (string, fielddisplay(self,'szaValue','Solar Zenith Angle [degree]'))
++                string = "%s\n%s" % (string, fielddisplay(self,'cotValue','Cloud Optical Thickness'))
++                string = "%s\n%s" % (string, fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]'))
++                string = "%s\n%s" % (string, fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]'))
++
+         elif self.aIdx == 3:
+             string = "%s\n%s" % (string, fielddisplay(self, 'cldFrac', 'average cloud amount'))
+         elif self.aIdx == 4:
+@@ -227,24 +242,55 @@
+     #}}}
+ 
+     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')
++        self.Ta = project3d(md, 'vector', self.Ta, 'type', 'element')
++        self.V = project3d(md, 'vector', self.V, 'type', 'element')
++        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'element')
++        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'element')
++        self.P = project3d(md, 'vector', self.P, 'type', 'element')
++        self.eAir = project3d(md, 'vector', self.eAir, 'type', 'element')
++        self.pAir = project3d(md, 'vector', self.pAir, 'type', 'element')
+ 
+-        if (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')
++        if not np.isnan(self.Dzini):
++            self.self.Dzini=project3d(md,'vector',self.self.Dzini,'type','element');
++        if not np.isnan(self.Dini):
++            self.self.Dini=project3d(md,'vector',self.Dini,'type','element');
++        if not np.isnan(self.Reini):
++            self.self.Reini=project3d(md,'vector',self.Reini,'type','element');
++        if not np.isnan(self.Gdnini):
++            self.Gdnini=project3d(md,'vector',self.Gdnini,'type','element');
++        if not np.isnan(self.Gspini):
++            self.Gspini=project3d(md,'vector',self.Gspini,'type','element');
++        if not np.isnan(self.ECini):
++            self.ECini=project3d(md,'vector',self.ECini,'type','element');
++        if not np.isnan(self.Wini):
++            self.Wini=project3d(md,'vector',self.Wini,'type','element');
++        if not np.isnan(self.Aini):
++            self.Aini=project3d(md,'vector',self.Aini,'type','element');
++        if not np.isnan(self.Adiffini):
++            self.Adiffini=project3d(md,'vector',self.Adiffini,'type','element');
++        if not np.isnan(self.Tini):
++            self.Tini=project3d(md,'vector',self.Tini,'type','element');
++        if not np.isnan(self.dswdiffrf):
++            self.dswdiffrf=project3d(md,'vector',self.dswdiffrf,'type','element');
++        if not np.isnan(self.szaValue):
++            self.szaValue=project3d(md,'vector',self.szaValue,'type','element');
++        if not np.isnan(self.cotValue):
++            self.cotValue=project3d(md,'vector',self.cotValue,'type','element');
++        if not np.isnan(self.ccsnowValue):
++            self.ccsnowValue=project3d(md,'vector',self.ccsnowValue,'type','element');
++        if not np.isnan(self.cciceValue):
++            self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
+ 
++        if (self.aIdx == 0) and (not np.isnan(self.aValue)):
++            self.aValue = project3d(md, 'vector', self.aValue, 'type', 'element')
++        if not np.isnan(self.teValue):
++            self.teValue = project3d(md, 'vector', self.teValue, 'type', 'element')
++
+         return self
+     #}}}
+ 
+     def defaultoutputs(self, md):  # {{{
+-        return ['SmbMassBalance']
++        return ['SmbMassBalance','SmbAccumulatedMassBalance']
+     #}}}
+ 
+     def setdefaultparameters(self, mesh, geometry):  # {{{
+@@ -289,6 +335,12 @@
+         self.teValue = np.ones((mesh.numberofelements,))
+         self.aValue = self.aSnow * np.ones(mesh.numberofelements,)
+ 
++        self.dswdiffrf = 0.0 * np.ones(mesh.numberofelements,)
++        self.szaValue = 0.0 * np.ones(mesh.numberofelements,)
++        self.cotValue = 0.0 * np.ones(mesh.numberofelements,)
++        self.ccsnowValue = 0.0 * np.ones(mesh.numberofelements,)
++        self.cciceValue = 0.0 * np.ones(mesh.numberofelements,)
++
+         self.Dzini = 0.05 * np.ones((mesh.numberofelements, 2))
+         self.Dini = 910.0 * np.ones((mesh.numberofelements, 2))
+         self.Reini = 2.5 * np.ones((mesh.numberofelements, 2))
+@@ -297,6 +349,7 @@
+         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.Adiffini = np.ones((mesh.numberofelements, 2))
+         self.Tini = 273.15 * np.ones((mesh.numberofelements, 2))
+ #       /!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
+ #       If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
+@@ -320,6 +373,7 @@
+         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.dswdiffrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1400)
+         md = checkfield(md, 'fieldname', 'smb.dlwrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, 'size', np.shape(self.Ta))
+         md = checkfield(md, 'fieldname', 'smb.P', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 200, 'size', np.shape(self.Ta))
+         md = checkfield(md, 'fieldname', 'smb.eAir', 'timeseries', 1, 'NaN', 1, 'Inf', 1, 'size', np.shape(self.Ta))
+@@ -357,6 +411,12 @@
+         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)
++            if self.aIdx == 1:
++                md = checkfield(md,'fieldname','smb.szaValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',90)
++                md = checkfield(md,'fieldname','smb.cotValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
++                md = checkfield(md,'fieldname','smb.ccsnowValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
++                md = checkfield(md,'fieldname','smb.cciceValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
++
+         elif self.aIdx == 0:
+             md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
+         elif self.aIdx == 3:
+@@ -395,6 +455,7 @@
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswdiffrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dlwrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'P', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'eAir', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+@@ -429,6 +490,10 @@
+ 
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
++        WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
++        WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
++        WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
++        WriteData(fid,prefix,'object',self,'class','smb','fieldname','cciceValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+ 
+         #snow properties init
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Dzini', 'format', 'DoubleMat', 'mattype', 3)
+@@ -439,6 +504,7 @@
+         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', 'Adiffini', 'format', 'DoubleMat', 'mattype', 3)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tini', 'format', 'DoubleMat', 'mattype', 3)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Sizeini', 'format', 'IntMat', 'mattype', 2)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+@@ -447,6 +513,21 @@
+         if (np.any(self.P[-1] - self.Ta[-1] != 0) | np.any(self.V[-1] - self.Ta[-1] != 0) | np.any(self.dswrf[-1] - self.Ta[-1] != 0) | np.any(self.dlwrf[-1] - self.Ta[-1] != 0) | np.any(self.eAir[-1] - self.Ta[-1] != 0) | np.any(self.pAir[-1] - self.Ta[-1] != 0)):
+             raise IOError('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!')
+ 
++        if ((np.ndim(self.teValue)>1) & np.any(self.teValue[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing teValue is transient, it must have the same time steps as input Ta in the final row!')
++        if ((np.ndim(self.dswdiffrf)>1) & np.any(self.dswdiffrf[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!')
++        if ((np.ndim(self.aValue)>1) & np.any(self.aValue[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!')
++        if ((np.ndim(self.szaValue)>1) & np.any(self.szaValue[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!')
++        if ((np.ndim(self.cotValue)>1) & np.any(self.cotValue[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing cotValue is transient, it must have the same time steps as input Ta in the final row!')
++        if ((np.ndim(self.ccsnowValue)>1) & np.any(self.ccsnowValue[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing ccsnowValue is transient, it must have the same time steps as input Ta in the final row!')
++        if ((np.ndim(self.cciceValue)>1) & np.any(self.cciceValue[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing cciceValue is transient, it must have the same time steps as input Ta in the final row!')
++
+         time = self.Ta[-1]  #assume all forcings are on the same time step
+         dtime = np.diff(time, n=1, axis=0)
+         dt = min(dtime)
Index: /issm/oecreview/Archive/25834-26739/ISSM-25997-25998.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25997-25998.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25997-25998.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25997)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25998)
+@@ -1101,7 +1101,7 @@
+ 	//   swIdx   = shortwave allowed to penetrate surface (0 = No, 1 = Yes)
+ 	//   aIdx    = method for calculating albedo (1-4)
+ 	//   dsw     = downward shortwave radiative flux [w m-2]
+-	//   dswdir  = downward shortwave direct radiative flux [w m-2]
++	//   dswdiff  = downward shortwave diffuse radiative flux [w m-2]
+ 	//   as      = surface albedo
+ 	//   asdiff  = surface albedo for diffuse radiation
+ 	//   d       = grid cell density [kg m-3]
Index: /issm/oecreview/Archive/25834-26739/ISSM-25998-25999.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25998-25999.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25998-25999.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25998)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 25999)
+@@ -1125,7 +1125,7 @@
+ 
+ 		// calculate surface shortwave radiation fluxes [W m-2]
+ 		if (aIdx == 1){
+-			swf[0] = (1.0 - as) * dsw +  (1.0 - asdiff) * dswdiff;
++			swf[0] = (1.0 - as) * max(0.0,(dsw - dswdiff)) +  (1.0 - asdiff) * dswdiff;
+ 		}
+ 		else{
+ 			swf[0] = (1.0 - as) * dsw;
Index: /issm/oecreview/Archive/25834-26739/ISSM-25999-26000.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-25999-26000.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-25999-26000.diff	(revision 26740)
@@ -0,0 +1,513 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 25999)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26000)
+@@ -640,7 +640,7 @@
+ 	./modules/DistanceToMaskBoundaryx/DistanceToMaskBoundaryxt.cpp \
+ 	./modules/NodeConnectivityx/NodeConnectivityx.cpp \
+ 	./modules/ElementConnectivityx/ElementConnectivityx.cpp \
+-	./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp 
++	./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp
+ 
+ if CHACO
+ modules_sources += \
+@@ -782,7 +782,7 @@
+ LDADD += $(FLIBS) $(FORTRANLIB)
+ endif
+ 
+-issm_SOURCES = main/issm.cpp 
++issm_SOURCES = main/issm.cpp
+ issm_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
+ issm_slc_SOURCES = main/issm_slc.cpp
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26000)
+@@ -0,0 +1,420 @@
++#include "./SamplingAnalysis.h" //
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++#include <random>
++
++#define FINITEELEMENT P1Enum
++#define 	NUMVERTICES   3
++
++/* Reimplementation of IsFaceOnBoundary with two edges on boundary supported */
++bool IsFaceOnBoundary(Element*  element)
++{
++
++	IssmDouble values[NUMVERTICES];
++	IssmDouble sum;
++
++	/*Retrieve all inputs and parameters*/
++	element->GetInputListOnVertices(&values[0],MeshVertexonboundaryEnum);
++	sum = values[0]+values[1]+values[2];
++
++	_assert_(sum==0. || sum==1. || sum==2. || sum==3.);
++
++	if(sum>1.){
++	 	return true;
++	}
++	else{
++	 return false;
++	}
++}
++
++/*Model processing*/
++void SamplingAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
++	/*Default, do nothing*/
++	return;
++}/*}}}*/
++void SamplingAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
++	/*Default, do nothing*/
++	return;
++}/*}}}*/
++void SamplingAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
++
++	int finiteelement;
++	finiteelement = FINITEELEMENT;
++
++	/*Check in 2d*/
++	if(iomodel->domaintype!=Domain2DhorizontalEnum) _error_("Only 2D horizontal domain is implemented.");
++
++	::CreateNodes(nodes,iomodel,SamplingAnalysisEnum,finiteelement);
++
++}/*}}}*/
++int  SamplingAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
++	return 1;
++}/*}}}*/
++void SamplingAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
++
++	int    finiteelement;
++
++	/*Finite element type*/
++	finiteelement = FINITEELEMENT;
++
++	/*Update elements: */
++	int counter=0;
++	for(int i=0;i<iomodel->numberofelements;i++){
++		if(iomodel->my_elements[i]){
++			Element* element=(Element*)elements->GetObjectByOffset(counter);
++			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,finiteelement);
++			counter++;
++		}
++	}
++
++	/*Create inputs: */
++	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonboundary",MeshVertexonboundaryEnum);
++
++  iomodel->FetchDataToInput(inputs,elements,"md.sampling.kappa",SamplingKappaEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.sampling.beta",SamplingBetaEnum,0.);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sample",SampleEnum,0.);
++
++}/*}}}*/
++void SamplingAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
++
++	int     numoutputs;
++	char**  requestedoutputs = NULL;
++
++	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.tau",SamplingTauEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.alpha",SamplingAlphaEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.robin",SamplingRobinEnum));
++	if(solution_enum==TransientSolutionEnum) parameters->AddObject(iomodel->CopyConstantObject("md.sampling.phi",SamplingPhiEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.sampling.seed",SamplingSeedEnum));
++
++	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.sampling.requested_outputs");
++	parameters->AddObject(new IntParam(SamplingNumRequestedOutputsEnum,numoutputs));
++	if(numoutputs)parameters->AddObject(new StringArrayParam(SamplingRequestedOutputsEnum,requestedoutputs,numoutputs));
++	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.sampling.requested_outputs");
++
++}/*}}}*/
++
++/*Finite Element Analysis*/
++void           SamplingAnalysis::Core(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
++ElementVector* SamplingAnalysis::CreateDVector(Element* element){/*{{{*/
++	/*Default, return NULL*/
++	return NULL;
++}/*}}}*/
++ElementMatrix* SamplingAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
++_error_("not implemented");
++}/*}}}*/
++ElementMatrix* SamplingAnalysis::CreateKMatrix(Element* element){/*{{{*/
++
++	/* Check if ice in element */
++	//if(!element->IsIceInElement()) return NULL; // Ice in element not required for sampling capability
++
++	/*Intermediaries*/
++	bool robin;
++	int      domaintype;
++
++	/*compute all stiffness matrices for this element*/
++
++	ElementMatrix* Ke = NULL;
++	element->FindParam(&robin,SamplingRobinEnum);
++
++  if(!robin) Ke=CreateKMatrixModifiedHelmholtz(element);
++  else{
++		ElementMatrix* Ke1=CreateKMatrixModifiedHelmholtz(element);
++		ElementMatrix* Ke2=CreateKMatrixRobinBC(element);
++		Ke =new ElementMatrix(Ke1,Ke2);
++
++		delete Ke1;
++		delete Ke2;
++  }
++
++	/*clean-up and return*/
++	return Ke;
++
++}/*}}}*/
++ElementMatrix* SamplingAnalysis::CreateKMatrixModifiedHelmholtz(Element* element){/*{{{*/
++
++	/* Check if ice in element */
++	//if(!element->IsIceInElement()) return NULL;
++
++	/*Intermediaries*/
++	int dim;
++	IssmDouble  D,Jdet;
++	IssmDouble* xyz_list = NULL;
++	IssmDouble kappa;
++
++	/*Get problem dimension*/
++	dim=2;	// Only 2D horizontal domain is implemented so far
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = element->GetNumberOfNodes();
++
++	/*Initialize Element vector and other vectors*/
++	ElementMatrix* Ke     = element->NewElementMatrix();
++	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
++	IssmDouble*    dbasis = xNew<IssmDouble>(dim*numnodes);
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
++	Input2*	kappa_input=element->GetInput2(SamplingKappaEnum); _assert_(kappa_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->NodalFunctions(basis,gauss);
++		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++
++		kappa_input->GetInputValue(&kappa,gauss); _assert_(kappa>0);
++
++		D=gauss->weight*Jdet;
++
++		/* Laplacian operator */
++		for(int i=0;i<numnodes;i++){
++				for(int j=0;j<numnodes;j++){
++						Ke->values[i*numnodes+j] += D*(dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]);
++			}
++ 		}
++
++		/* Identity identity */
++		for(int i=0;i<numnodes;i++){
++				for(int j=0;j<numnodes;j++){
++					Ke->values[i*numnodes+j] += D*kappa*kappa*(basis[j]*basis[i]);
++			}
++ 		}
++
++	}
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(dbasis);
++	delete gauss;
++	return Ke;
++
++}/*}}}*/
++ElementMatrix* SamplingAnalysis::CreateKMatrixRobinBC(Element* element){/*{{{*/
++
++	/* Check if ice in element */
++	//if(!element->IsIceInElement()) return NULL;
++
++	/*If no boundary, return NULL*/
++	if(!IsFaceOnBoundary(element)) return NULL;
++
++	/*Intermediaries*/
++	IssmDouble  D,Jdet;
++	IssmDouble* xyz_list = NULL;
++	IssmDouble* xyz_list_boundary = NULL;
++	IssmDouble beta;
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = element->GetNumberOfNodes();
++
++	/*Initialize Element vector and other vectors*/
++	ElementMatrix* Ke     = element->NewElementMatrix();
++	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
++	element->GetLevelCoordinates(&xyz_list_boundary,xyz_list,MeshVertexonboundaryEnum,1.);
++	Input2*	beta_input=element->GetInput2(SamplingBetaEnum); _assert_(beta_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_boundary,3);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		element->JacobianDeterminantSurface(&Jdet,xyz_list_boundary,gauss);
++		element->NodalFunctions(basis,gauss);
++
++		beta_input->GetInputValue(&beta,gauss); _assert_(beta>=0);
++
++		D=gauss->weight*Jdet;
++
++		for(int i=0;i<numnodes;i++){
++				for(int j=0;j<numnodes;j++){
++						Ke->values[i*numnodes+j] += D*beta*(basis[j]*basis[i]);
++			}
++ 		}
++
++	}
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(xyz_list_boundary);
++	xDelete<IssmDouble>(basis);
++	delete gauss;
++	return Ke;
++
++}/*}}}*/
++ElementVector* SamplingAnalysis::CreatePVector(Element* element){/*{{{*/
++	//_error_("not supported");
++	return NULL;
++}/*}}}*/
++void           SamplingAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
++	element->GetSolutionFromInputsOneDof(solution,SampleEnum);
++}/*}}}*/
++void           SamplingAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
++	_error_("not supported");
++}/*}}}*/
++void           SamplingAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
++
++    /*Fetch number of nodes and dof for this finite element*/
++    int numnodes = element->GetNumberOfNodes();
++
++		/*Fetch dof list and allocate solution vector*/
++		int* doflist=NULL;
++    element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
++    IssmDouble* newsample = xNew<IssmDouble>(numnodes);
++
++    /*Use the dof list to index into the solution vector: */
++    for(int i=0;i<numnodes;i++){
++			newsample[i]=solution[doflist[i]];
++			/*Check solution*/
++			if(xIsNan<IssmDouble>(newsample[i])) _error_("NaN found in solution vector");
++			if(xIsInf<IssmDouble>(newsample[i])) _error_("Inf found in solution vector");
++		}
++
++    /*Add sample inputs to the tria element: */
++    element->AddInput2(SampleEnum,newsample,element->GetElementType());
++
++    /*Free ressources:*/
++    xDelete<IssmDouble>(newsample);
++    xDelete<int>(doflist);
++ }/*}}}*/
++void           SamplingAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
++	/*Default, do nothing*/
++  return;
++}/*}}}*/
++
++ElementMatrix* SamplingAnalysis::CreateMassMatrix(Element* element){/*{{{*/
++
++	/* Check if ice in element */
++	//if(!element->IsIceInElement()) return NULL;
++
++	/*Intermediaries*/
++	IssmDouble  D,Jdet;
++	IssmDouble* xyz_list = NULL;
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = element->GetNumberOfNodes();
++
++	/*Initialize Element vector and other vectors*/
++	ElementMatrix* Me     = element->NewElementMatrix();
++	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=element->NewGauss(2);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctions(basis,gauss);
++
++		D=gauss->weight*Jdet;
++		TripleMultiply(basis,1,numnodes,1,
++					&D,1,1,0,
++					basis,1,numnodes,0,
++					&Me->values[0],1);
++	}
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	delete gauss;
++	return Me;
++}/*}}}*/
++void           SamplingAnalysis::LumpedKMatrix(Vector<IssmDouble>** pKlff,FemModel* femmodel){/*{{{*/
++
++	/*Initialize Lumped mass matrix (actually we just save its diagonal)*/
++	int fsize      = femmodel->nodes->NumberOfDofs(FsetEnum);
++	int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum);
++	Vector<IssmDouble>* Klff = new Vector<IssmDouble>(flocalsize,fsize);
++
++	/*Create and assemble matrix*/
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
++		ElementMatrix* KLe     = this->CreateKMatrix(element);
++		if(KLe){
++			KLe->Lump();
++			KLe->AddDiagonalToGlobal(Klff);
++		}
++		delete KLe;
++	}
++	Klff->Assemble();
++
++	/*Assign output pointer*/
++	*pKlff=Klff;
++}/*}}}*/
++void           SamplingAnalysis::KMatrix(Matrix<IssmDouble>** pKff,FemModel* femmodel){/*{{{*/
++
++	/*Initialize K matrix*/
++	Matrix<IssmDouble> *Kff = NULL;
++	AllocateSystemMatricesx(&Kff,NULL,NULL,NULL,femmodel);
++
++	/*Create and assemble matrix*/
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
++		ElementMatrix* Ke     = this->CreateKMatrix(element);
++		if(Ke){
++			Ke->AddToGlobal(Kff);
++		}
++		delete Ke;
++	}
++	Kff->Assemble();
++
++	/*Assign output pointer*/
++	*pKff=Kff;
++
++}/*}}}*/
++void           SamplingAnalysis::LumpedMassMatrix(Vector<IssmDouble>** pMlff,FemModel* femmodel){/*{{{*/
++
++	/*Initialize Lumped mass matrix (actually we just save its diagonal)*/
++	int fsize      = femmodel->nodes->NumberOfDofs(FsetEnum);
++	int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum);
++	Vector<IssmDouble>* Mlff = new Vector<IssmDouble>(flocalsize,fsize);
++
++	/*Create and assemble matrix*/
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
++		ElementMatrix* MLe     = this->CreateMassMatrix(element);
++		if(MLe){
++			MLe->Lump();
++			MLe->AddDiagonalToGlobal(Mlff);
++		}
++		delete MLe;
++	}
++	Mlff->Assemble();
++
++	/*Assign output pointer*/
++	*pMlff=Mlff;
++}/*}}}*/
++void           SamplingAnalysis::MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel){/*{{{*/
++
++	/*Initialize Mass matrix*/
++	Matrix<IssmDouble> *Mff = NULL;
++	AllocateSystemMatricesx(&Mff,NULL,NULL,NULL,femmodel);
++
++	/*Create and assemble matrix*/
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element*       element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
++		ElementMatrix* MLe     = this->CreateMassMatrix(element);
++		if(MLe){
++			MLe->AddToGlobal(Mff);
++		}
++		delete MLe;
++	}
++	Mff->Assemble();
++
++	/*Assign output pointer*/
++	*pMff=Mff;
++}/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.h	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.h	(revision 26000)
+@@ -0,0 +1,42 @@
++/*! \file SamplingAnalysis.h
++ *  \brief: header file for generic external result object
++ */
++
++#ifndef _SamplingAnalysis_
++#define _SamplingAnalysis_
++
++/*Headers*/
++#include "./Analysis.h"
++
++class SamplingAnalysis: public Analysis{
++
++	public:
++		/*Model processing*/
++		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
++		void CreateLoads(Loads* loads, IoModel* iomodel);
++		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
++		int  DofsPerNode(int** doflist,int domaintype,int approximation);
++		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
++		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
++
++		/*Finite element Analysis*/
++		void           Core(FemModel* femmodel);
++		ElementVector* CreateDVector(Element* element);
++		ElementMatrix* CreateJacobianMatrix(Element* element);
++		ElementMatrix* CreateKMatrix(Element* element);
++		ElementMatrix* CreateKMatrixModifiedHelmholtz(Element* element);
++		ElementMatrix* CreateKMatrixRobinBC(Element* element);
++		ElementMatrix* CreateMassMatrix(Element* element);
++    ElementVector* CreatePVector(Element* element);
++		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void           GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
++		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
++		void           UpdateConstraints(FemModel* femmodel);
++
++		void           LumpedKMatrix(Vector<IssmDouble>** pKLff,FemModel* femmodel);
++		void           KMatrix(Matrix<IssmDouble>** pKff,FemModel* femmodel);
++		void           LumpedMassMatrix(Vector<IssmDouble>** pMLff,FemModel* femmodel);
++		void           MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel);
++
++};
++#endif
+Index: ../trunk-jpl/src/c/analyses/analyses.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/analyses.h	(revision 25999)
++++ ../trunk-jpl/src/c/analyses/analyses.h	(revision 26000)
+@@ -1,5 +1,5 @@
+ /*
+- * analyses.h: 
++ * analyses.h:
+  */
+ 
+ #ifndef _ANALYSES_H_
+@@ -34,6 +34,7 @@
+ #include "./HydrologyPismAnalysis.h"
+ #include "./LevelsetAnalysis.h"
+ #include "./MasstransportAnalysis.h"
++#include "./SamplingAnalysis.h"
+ #include "./SmbAnalysis.h"
+ #include "./SealevelchangeAnalysis.h"
+ #include "./MeltingAnalysis.h"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26000-26001.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26000-26001.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26000-26001.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26000)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26001)
+@@ -260,7 +260,7 @@
+ void           SamplingAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,SampleEnum);
+ }/*}}}*/
+-void           SamplingAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
++void           SamplingAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+ 	_error_("not supported");
+ }/*}}}*/
+ void           SamplingAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.h	(revision 26000)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.h	(revision 26001)
+@@ -29,7 +29,7 @@
+ 		ElementMatrix* CreateMassMatrix(Element* element);
+     ElementVector* CreatePVector(Element* element);
+ 		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void           GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
++		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+ 		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void           UpdateConstraints(FemModel* femmodel);
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26001-26002.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26001-26002.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26001-26002.diff	(revision 26740)
@@ -0,0 +1,359 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26001)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26002)
+@@ -331,6 +331,13 @@
+ syn keyword cConstant ResultsEnum
+ syn keyword cConstant RootPathEnum
+ syn keyword cConstant ModelnameEnum
++syn keyword cConstant SamplingAlphaEnum
++syn keyword cConstant SamplingPhiEnum
++syn keyword cConstant SamplingNumRequestedOutputsEnum
++syn keyword cConstant SamplingRequestedOutputsEnum
++syn keyword cConstant SamplingRobinEnum
++syn keyword cConstant SamplingSeedEnum
++syn keyword cConstant SamplingTauEnum
+ syn keyword cConstant SaveResultsEnum
+ syn keyword cConstant SolidearthPartitionIceEnum
+ syn keyword cConstant SolidearthPartitionHydroEnum
+@@ -487,6 +494,7 @@
+ syn keyword cConstant TransientIsmasstransportEnum
+ syn keyword cConstant TransientIsmovingfrontEnum
+ syn keyword cConstant TransientIsoceancouplingEnum
++syn keyword cConstant TransientIssamplingEnum
+ syn keyword cConstant TransientIsslcEnum
+ syn keyword cConstant TransientIssmbEnum
+ syn keyword cConstant TransientIsstressbalanceEnum
+@@ -714,6 +722,9 @@
+ syn keyword cConstant RheologyBInitialguessEnum
+ syn keyword cConstant RheologyBInitialguessMisfitEnum
+ syn keyword cConstant RheologyBbarAbsGradientEnum
++syn keyword cConstant SampleEnum
++syn keyword cConstant SamplingBetaEnum
++syn keyword cConstant SamplingKappaEnum
+ syn keyword cConstant SealevelEnum
+ syn keyword cConstant SealevelBarystaticMaskEnum
+ syn keyword cConstant SealevelBarystaticOceanMaskEnum
+@@ -1561,6 +1572,7 @@
+ syn keyword cType LoveAnalysis
+ syn keyword cType MasstransportAnalysis
+ syn keyword cType MeltingAnalysis
++syn keyword cType SamplingAnalysis
+ syn keyword cType SealevelchangeAnalysis
+ syn keyword cType SmbAnalysis
+ syn keyword cType SmoothAnalysis
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26001)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26002)
+@@ -325,6 +325,13 @@
+ 	ResultsEnum,
+ 	RootPathEnum,
+ 	ModelnameEnum,
++	SamplingAlphaEnum,
++	SamplingPhiEnum,
++	SamplingNumRequestedOutputsEnum,
++	SamplingRequestedOutputsEnum,
++	SamplingRobinEnum,
++	SamplingSeedEnum,
++	SamplingTauEnum,
+ 	SaveResultsEnum,
+ 	SolidearthPartitionIceEnum,
+ 	SolidearthPartitionHydroEnum,
+@@ -481,6 +488,7 @@
+ 	TransientIsmasstransportEnum,
+ 	TransientIsmovingfrontEnum,
+ 	TransientIsoceancouplingEnum,
++	TransientIssamplingEnum,
+ 	TransientIsslcEnum,
+ 	TransientIssmbEnum,
+ 	TransientIsstressbalanceEnum,
+@@ -710,6 +718,9 @@
+ 	RheologyBInitialguessEnum,
+ 	RheologyBInitialguessMisfitEnum,
+ 	RheologyBbarAbsGradientEnum,
++	SampleEnum,
++	SamplingBetaEnum,
++	SamplingKappaEnum,
+ 	SealevelEnum,
+ 	SealevelBarystaticMaskEnum,
+ 	SealevelBarystaticOceanMaskEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26001)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26002)
+@@ -333,6 +333,13 @@
+ 		case ResultsEnum : return "Results";
+ 		case RootPathEnum : return "RootPath";
+ 		case ModelnameEnum : return "Modelname";
++		case SamplingAlphaEnum : return "SamplingAlpha";
++		case SamplingPhiEnum : return "SamplingPhi";
++		case SamplingNumRequestedOutputsEnum : return "SamplingNumRequestedOutputs";
++		case SamplingRequestedOutputsEnum : return "SamplingRequestedOutputs";
++		case SamplingRobinEnum : return "SamplingRobin";
++		case SamplingSeedEnum : return "SamplingSeed";
++		case SamplingTauEnum : return "SamplingTau";
+ 		case SaveResultsEnum : return "SaveResults";
+ 		case SolidearthPartitionIceEnum : return "SolidearthPartitionIce";
+ 		case SolidearthPartitionHydroEnum : return "SolidearthPartitionHydro";
+@@ -489,6 +496,7 @@
+ 		case TransientIsmasstransportEnum : return "TransientIsmasstransport";
+ 		case TransientIsmovingfrontEnum : return "TransientIsmovingfront";
+ 		case TransientIsoceancouplingEnum : return "TransientIsoceancoupling";
++		case TransientIssamplingEnum : return "TransientIssampling";
+ 		case TransientIsslcEnum : return "TransientIsslc";
+ 		case TransientIssmbEnum : return "TransientIssmb";
+ 		case TransientIsstressbalanceEnum : return "TransientIsstressbalance";
+@@ -716,6 +724,9 @@
+ 		case RheologyBInitialguessEnum : return "RheologyBInitialguess";
+ 		case RheologyBInitialguessMisfitEnum : return "RheologyBInitialguessMisfit";
+ 		case RheologyBbarAbsGradientEnum : return "RheologyBbarAbsGradient";
++		case SampleEnum : return "Sample";
++		case SamplingBetaEnum : return "SamplingBeta";
++		case SamplingKappaEnum : return "SamplingKappa";
+ 		case SealevelEnum : return "Sealevel";
+ 		case SealevelBarystaticMaskEnum : return "SealevelBarystaticMask";
+ 		case SealevelBarystaticOceanMaskEnum : return "SealevelBarystaticOceanMask";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26001)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26002)
+@@ -339,6 +339,13 @@
+ 	      else if (strcmp(name,"Results")==0) return ResultsEnum;
+ 	      else if (strcmp(name,"RootPath")==0) return RootPathEnum;
+ 	      else if (strcmp(name,"Modelname")==0) return ModelnameEnum;
++	      else if (strcmp(name,"SamplingAlpha")==0) return SamplingAlphaEnum;
++	      else if (strcmp(name,"SamplingPhi")==0) return SamplingPhiEnum;
++	      else if (strcmp(name,"SamplingNumRequestedOutputs")==0) return SamplingNumRequestedOutputsEnum;
++	      else if (strcmp(name,"SamplingRequestedOutputs")==0) return SamplingRequestedOutputsEnum;
++	      else if (strcmp(name,"SamplingRobin")==0) return SamplingRobinEnum;
++	      else if (strcmp(name,"SamplingSeed")==0) return SamplingSeedEnum;
++	      else if (strcmp(name,"SamplingTau")==0) return SamplingTauEnum;
+ 	      else if (strcmp(name,"SaveResults")==0) return SaveResultsEnum;
+ 	      else if (strcmp(name,"SolidearthPartitionIce")==0) return SolidearthPartitionIceEnum;
+ 	      else if (strcmp(name,"SolidearthPartitionHydro")==0) return SolidearthPartitionHydroEnum;
+@@ -375,7 +382,10 @@
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+-	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+ 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+ 	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+@@ -382,10 +392,7 @@
+ 	      else if (strcmp(name,"SettingsCheckpointFrequency")==0) return SettingsCheckpointFrequencyEnum;
+ 	      else if (strcmp(name,"SettingsResultsOnNodes")==0) return SettingsResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsSbCouplingFrequency")==0) return SettingsSbCouplingFrequencyEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"SettingsSolverResidueThreshold")==0) return SettingsSolverResidueThresholdEnum;
++	      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;
+@@ -498,6 +505,10 @@
+ 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+ 	      else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum;
+ 	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
+ 	      else if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
+@@ -505,10 +516,7 @@
+ 	      else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
+ 	      else if (strcmp(name,"Velocity")==0) return VelocityEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
++	      else if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
+ 	      else if (strcmp(name,"ParametersEND")==0) return ParametersENDEnum;
+ 	      else if (strcmp(name,"InputsSTART")==0) return InputsSTARTEnum;
+ 	      else if (strcmp(name,"Adjoint")==0) return AdjointEnum;
+@@ -620,7 +628,10 @@
+ 	      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 stage=6;
++   }
++   if(stage==6){
++	      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;
+@@ -628,10 +639,7 @@
+ 	      else if (strcmp(name,"FrictionCoefficient")==0) return FrictionCoefficientEnum;
+ 	      else if (strcmp(name,"FrictionCoefficientcoulomb")==0) return FrictionCoefficientcoulombEnum;
+ 	      else if (strcmp(name,"FrictionEffectivePressure")==0) return FrictionEffectivePressureEnum;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"FrictionM")==0) return FrictionMEnum;
++	      else if (strcmp(name,"FrictionM")==0) return FrictionMEnum;
+ 	      else if (strcmp(name,"FrictionP")==0) return FrictionPEnum;
+ 	      else if (strcmp(name,"FrictionPressureAdjustedTemperature")==0) return FrictionPressureAdjustedTemperatureEnum;
+ 	      else if (strcmp(name,"FrictionQ")==0) return FrictionQEnum;
+@@ -731,6 +739,9 @@
+ 	      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,"Sample")==0) return SampleEnum;
++	      else if (strcmp(name,"SamplingBeta")==0) return SamplingBetaEnum;
++	      else if (strcmp(name,"SamplingKappa")==0) return SamplingKappaEnum;
+ 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticMask")==0) return SealevelBarystaticMaskEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
+@@ -740,7 +751,10 @@
+ 	      else if (strcmp(name,"Bslc")==0) return BslcEnum;
+ 	      else if (strcmp(name,"BslcIce")==0) return BslcIceEnum;
+ 	      else if (strcmp(name,"BslcHydro")==0) return BslcHydroEnum;
+-	      else if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
+ 	      else if (strcmp(name,"Gmtslc")==0) return GmtslcEnum;
+ 	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
+ 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
+@@ -751,10 +765,7 @@
+ 	      else if (strcmp(name,"SealevelchangeCumDeltathickness")==0) return SealevelchangeCumDeltathicknessEnum;
+ 	      else if (strcmp(name,"SealevelchangeCumDeltathicknessOld")==0) return SealevelchangeCumDeltathicknessOldEnum;
+ 	      else if (strcmp(name,"SurfaceloadRate")==0) return SurfaceloadRateEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"SurfaceloadIceThicknessRate")==0) return SurfaceloadIceThicknessRateEnum;
++	      else if (strcmp(name,"SurfaceloadIceThicknessRate")==0) return SurfaceloadIceThicknessRateEnum;
+ 	      else if (strcmp(name,"SurfaceloadWaterHeightRate")==0) return SurfaceloadWaterHeightRateEnum;
+ 	      else if (strcmp(name,"SurfaceloadOtherRate")==0) return SurfaceloadOtherRateEnum;
+ 	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+@@ -863,7 +874,10 @@
+ 	      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,"SmbTini")==0) return SmbTiniEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      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;
+@@ -874,10 +888,7 @@
+ 	      else if (strcmp(name,"SmbWini")==0) return SmbWiniEnum;
+ 	      else if (strcmp(name,"SmbZMax")==0) return SmbZMaxEnum;
+ 	      else if (strcmp(name,"SmbZMin")==0) return SmbZMinEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
++	      else if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
+ 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+@@ -986,7 +997,10 @@
+ 	      else if (strcmp(name,"Outputdefinition41")==0) return Outputdefinition41Enum;
+ 	      else if (strcmp(name,"Outputdefinition42")==0) return Outputdefinition42Enum;
+ 	      else if (strcmp(name,"Outputdefinition43")==0) return Outputdefinition43Enum;
+-	      else if (strcmp(name,"Outputdefinition44")==0) return Outputdefinition44Enum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"Outputdefinition44")==0) return Outputdefinition44Enum;
+ 	      else if (strcmp(name,"Outputdefinition45")==0) return Outputdefinition45Enum;
+ 	      else if (strcmp(name,"Outputdefinition46")==0) return Outputdefinition46Enum;
+ 	      else if (strcmp(name,"Outputdefinition47")==0) return Outputdefinition47Enum;
+@@ -997,10 +1011,7 @@
+ 	      else if (strcmp(name,"Outputdefinition51")==0) return Outputdefinition51Enum;
+ 	      else if (strcmp(name,"Outputdefinition52")==0) return Outputdefinition52Enum;
+ 	      else if (strcmp(name,"Outputdefinition53")==0) return Outputdefinition53Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition54")==0) return Outputdefinition54Enum;
++	      else if (strcmp(name,"Outputdefinition54")==0) return Outputdefinition54Enum;
+ 	      else if (strcmp(name,"Outputdefinition55")==0) return Outputdefinition55Enum;
+ 	      else if (strcmp(name,"Outputdefinition56")==0) return Outputdefinition56Enum;
+ 	      else if (strcmp(name,"Outputdefinition57")==0) return Outputdefinition57Enum;
+@@ -1109,7 +1120,10 @@
+ 	      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 stage=10;
++   }
++   if(stage==10){
++	      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;
+@@ -1120,10 +1134,7 @@
+ 	      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 stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Divergence")==0) return DivergenceEnum;
++	      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,"ArrayInput")==0) return ArrayInputEnum;
+@@ -1232,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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;
+@@ -1243,10 +1257,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"Masscon")==0) return MassconEnum;
++	      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;
+@@ -1355,7 +1366,10 @@
+ 	      else if (strcmp(name,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
+ 	      else if (strcmp(name,"SealevelchangeSolution")==0) return SealevelchangeSolutionEnum;
+ 	      else if (strcmp(name,"Seg")==0) return SegEnum;
+-	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"SegInput")==0) return SegInputEnum;
+ 	      else if (strcmp(name,"Segment")==0) return SegmentEnum;
+ 	      else if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum;
+ 	      else if (strcmp(name,"Separate")==0) return SeparateEnum;
+@@ -1366,10 +1380,7 @@
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"SpcStatic")==0) return SpcStaticEnum;
++	      else if (strcmp(name,"SpcStatic")==0) return SpcStaticEnum;
+ 	      else if (strcmp(name,"SpcTransient")==0) return SpcTransientEnum;
+ 	      else if (strcmp(name,"Sset")==0) return SsetEnum;
+ 	      else if (strcmp(name,"StatisticsSolution")==0) return StatisticsSolutionEnum;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26002-26003.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26002-26003.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26002-26003.diff	(revision 26740)
@@ -0,0 +1,55 @@
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26002)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26003)
+@@ -159,14 +159,12 @@
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+-	Input2*	kappa_input=element->GetInput2(SamplingKappaEnum); _assert_(kappa_input);
++	Input*	kappa_input=element->GetInput(SamplingKappaEnum); _assert_(kappa_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGauss(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
++	while(gauss->next()){
+ 
+-		gauss->GaussPoint(ig);
+-
+ 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+ 		element->NodalFunctions(basis,gauss);
+ 		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+@@ -223,12 +221,11 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->GetLevelCoordinates(&xyz_list_boundary,xyz_list,MeshVertexonboundaryEnum,1.);
+-	Input2*	beta_input=element->GetInput2(SamplingBetaEnum); _assert_(beta_input);
++	Input*	beta_input=element->GetInput(SamplingBetaEnum); _assert_(beta_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_boundary,3);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-		gauss->GaussPoint(ig);
++	while(gauss->next()){
+ 
+ 		element->JacobianDeterminantSurface(&Jdet,xyz_list_boundary,gauss);
+ 		element->NodalFunctions(basis,gauss);
+@@ -282,7 +279,7 @@
+ 		}
+ 
+     /*Add sample inputs to the tria element: */
+-    element->AddInput2(SampleEnum,newsample,element->GetElementType());
++    element->AddInput(SampleEnum,newsample,element->GetElementType());
+ 
+     /*Free ressources:*/
+     xDelete<IssmDouble>(newsample);
+@@ -314,8 +311,7 @@
+ 
+ 	/* 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);
++	while(gauss->next()){
+ 
+ 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+ 		element->NodalFunctions(basis,gauss);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26003-26004.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26003-26004.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26003-26004.diff	(revision 26740)
@@ -0,0 +1,529 @@
+Index: ../trunk-jpl/src/c/cores/sampling_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sampling_core.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/cores/sampling_core.cpp	(revision 26004)
+@@ -0,0 +1,48 @@
++/*!\file: sampling_core.cpp
++ * \brief: core of the sampling solution
++ */
++
++#include "../classes/classes.h"
++#include "../solutionsequences/solutionsequences.h"
++
++void sampling_core(FemModel* femmodel){
++
++	/*Start profiler*/
++	femmodel->profiler->Start(SAMPLINGCORE);
++
++	/*parameters: */
++	int    numoutputs;
++	bool   save_results;
++	int    solution_type;
++	char** requested_outputs = NULL;
++
++	/*activate configuration*/
++	femmodel->SetCurrentConfiguration(SamplingAnalysisEnum);
++
++	/*recover parameters: */
++	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
++	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++	femmodel->parameters->FindParam(&numoutputs,SamplingNumRequestedOutputsEnum);
++	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SamplingRequestedOutputsEnum);
++
++	if(VerboseSolution()) _printf0_("   Generating random samples\n");
++
++	/*Generate random sample*/
++	if(VerboseSolution()) _printf0_("   call computational core\n");
++	femmodel->SetCurrentConfiguration(SamplingAnalysisEnum);
++	solutionsequence_sampling(femmodel);
++
++	if(save_results){
++		if(VerboseSolution()) _printf0_("   saving results\n");
++		int outputs = SampleEnum;
++		femmodel->RequestedOutputsx(&femmodel->results,&outputs,1);
++	}
++
++	if(solution_type==SamplingSolutionEnum)femmodel->RequestedDependentsx();
++
++	/*Free ressources:*/
++	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
++
++	/*profiler*/
++	femmodel->profiler->Stop(SAMPLINGCORE);
++}
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequences.h
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequences.h	(revision 26003)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequences.h	(revision 26004)
+@@ -1,5 +1,5 @@
+ /*
+- * solutionsequences.h: 
++ * solutionsequences.h:
+  */
+ 
+ #ifndef _SOLUTION_SEQUENCES_H_
+@@ -24,6 +24,7 @@
+ void solutionsequence_la_theta(FemModel* femmodel);
+ void solutionsequence_adjoint_linear(FemModel* femmodel);
+ void solutionsequence_schurcg(FemModel* femmodel);
++void solutionsequence_sampling(FemModel* femmodel);
+ 
+ /*convergence*/
+ void convergence(bool* pconverged, Matrix<IssmDouble>* K_ff,Vector<IssmDouble>* p_f,Vector<IssmDouble>* u_f,Vector<IssmDouble>* u_f_old,IssmDouble eps_res,IssmDouble eps_rel,IssmDouble eps_abs);
+Index: ../trunk-jpl/m4/analyses.m4
+===================================================================
+--- ../trunk-jpl/m4/analyses.m4	(revision 26003)
++++ ../trunk-jpl/m4/analyses.m4	(revision 26004)
+@@ -429,6 +429,32 @@
+ AM_CONDITIONAL([MELTING], [test x$HAVE_MELTING = xyes])
+ AC_MSG_RESULT($HAVE_MELTING)
+ dnl }}}
++dnl with-Sampling{{{
++
++AC_ARG_WITH([Sampling],
++
++	AS_HELP_STRING([--with-Sampling = YES], [compile with Sampling capabilities (default is yes)]),
++
++	[SAMPLING=$withval],[SAMPLING=yes])
++
++AC_MSG_CHECKING(for Sampling capability compilation)
++
++
++HAVE_SAMPLING=no 
++
++if test "x$SAMPLING" = "xyes"; then
++
++	HAVE_SAMPLING=yes
++
++	AC_DEFINE([_HAVE_SAMPLING_],[1],[with Sampling capability])
++
++fi
++
++AM_CONDITIONAL([SAMPLING], [test x$HAVE_SAMPLING = xyes])
++
++AC_MSG_RESULT($HAVE_SAMPLING)
++
++dnl }}}
+ dnl with-Sealevelrise{{{
+ AC_ARG_WITH([Sealevelrise],
+ 	AS_HELP_STRING([--with-Sealevelrise = YES], [compile with Sealevelrise capabilities (default is yes)]),
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26003)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26004)
+@@ -255,6 +255,7 @@
+ 	./solutionsequences/solutionsequence_newton.cpp \
+ 	./solutionsequences/solutionsequence_fct.cpp \
+ 	./solutionsequences/solutionsequence_schurcg.cpp \
++	./solutionsequences/solutionsequence_sampling.cpp \
+ 	./solutionsequences/convergence.cpp \
+ 	./classes/Options/Options.cpp \
+ 	./classes/Options/OptionUtilities.cpp \
+@@ -547,6 +548,12 @@
+ issm_sources += ./modules/OceanExchangeDatax/OceanExchangeDatax.cpp
+ endif
+ #}}}
++#Sampling sources  {{{
++if SAMPLING
++issm_sources += \
++	./cores/sampling_core.cpp \
++	./analyses/SamplingAnalysis.cpp
++endif
+ #Slr sources  {{{
+ if SEALEVELRISE
+ issm_sources += \
+Index: ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 26003)
++++ ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 26004)
+@@ -103,6 +103,9 @@
+ 		#ifdef _HAVE_MELTING_
+ 		case MeltingAnalysisEnum : return new MeltingAnalysis();
+ 		#endif
++		#ifdef _HAVE_SAMPLING_
++		case SamplingAnalysisEnum : return new SamplingAnalysis();
++		#endif
+ 		#ifdef _HAVE_SEALEVELRISE_
+ 		case SealevelchangeAnalysisEnum : return new SealevelchangeAnalysis();
+ 		#endif
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26003)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26004)
+@@ -75,7 +75,7 @@
+ 
+   iomodel->FetchDataToInput(inputs,elements,"md.sampling.kappa",SamplingKappaEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.sampling.beta",SamplingBetaEnum,0.);
+-	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sample",SampleEnum,0.);
++	//iomodel->FetchDataToInput(inputs,elements,"md.initialization.sample",SampleEnum,0.);
+ 
+ }/*}}}*/
+ void SamplingAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26003)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26004)
+@@ -833,6 +833,10 @@
+ 			analyses_temp[numanalyses++]=EsaAnalysisEnum;
+ 			break;
+ 
++		case SamplingSolutionEnum:
++			analyses_temp[numanalyses++]=SamplingAnalysisEnum;
++			break;
++
+ 		case SealevelchangeSolutionEnum:
+ 			analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
+ 			analyses_temp[numanalyses++]=GiaAnalysisEnum;
+@@ -4827,14 +4831,14 @@
+ 	Vector<IssmDouble>* bslcice_partition=NULL;
+ 	IssmDouble* bslcice_partition_serial=NULL;
+ 	IssmDouble* partitionice=NULL;
+-	int npartice,nel; 
++	int npartice,nel;
+ 
+ 	Vector<IssmDouble>* bslchydro_partition=NULL;
+ 	IssmDouble* bslchydro_partition_serial=NULL;
+ 	IssmDouble* partitionhydro=NULL;
+-	int nparthydro; 
+-		
++	int nparthydro;
+ 
++
+    /*Initialize temporary vector that will be used to sum barystatic components
+     * on all local elements, prior to assembly:*/
+ 	int gsize = this->nodes->NumberOfDofs(GsetEnum);
+@@ -5104,8 +5108,8 @@
+ 
+ 	pUp->SetValues(gsize,indices,Up,ADD_VAL);
+ 	pUp->Assemble();
+-	
+ 
++
+ 	/*Add RSL to Up to find the geoid: */
+ 	pUp->Copy(pgeoid); pgeoid->AXPY(pRSLg,1);
+ 
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 26003)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 26004)
+@@ -26,15 +26,16 @@
+ #define GIACORE				13 /*Profiling GIA */
+ #define ESACORE				14 /*Profiling ESA */
+ #define SLRCORE				15 /*Profiling SLR */
+-#define MPISERIAL				16 /*Profiling MPISerial */
+-#define SEDLOOP				17 /*Profiling MPISerial */
+-#define SEDMatrix				18 /*Profiling MPISerial */
+-#define SEDUpdate				19 /*Profiling MPISerial */
+-#define EPLLOOP				20 /*Profiling MPISerial */
+-#define EPLMasking			21 /*Profiling MPISerial */
+-#define EPLMatrices			22 /*Profiling MPISerial */
+-#define EPLUpdate				23 /*Profiling MPISerial */
+-#define MAXPROFSIZE			24 /*Used to initialize static arrays*/
++#define SAMPLINGCORE	16 /*Profiling SAMPLING */
++#define MPISERIAL				17 /*Profiling MPISerial */
++#define SEDLOOP				18 /*Profiling MPISerial */
++#define SEDMatrix				19 /*Profiling MPISerial */
++#define SEDUpdate				20 /*Profiling MPISerial */
++#define EPLLOOP				21 /*Profiling MPISerial */
++#define EPLMasking			22 /*Profiling MPISerial */
++#define EPLMatrices			23 /*Profiling MPISerial */
++#define EPLUpdate				24 /*Profiling MPISerial */
++#define MAXPROFSIZE			25 /*Used to initialize static arrays*/
+ 
+ 
+ class Profiler: public Object{
+Index: ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 26003)
++++ ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 26004)
+@@ -1,6 +1,6 @@
+ /*!\file:  CorePointerFromSolutionEnum.cpp
+  * \brief: return type of analyses, number of analyses and core solution function.
+- */ 
++ */
+ 
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+@@ -81,6 +81,9 @@
+ 			_error_("ISSM not compiled with Love capability");
+ 			#endif
+ 			break;
++		case SamplingSolutionEnum:
++			solutioncore=&sampling_core;
++			break;
+ 
+ 		default:
+ 			_error_("solution type: " << EnumToStringx(solutiontype) << " not supported yet!");
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 26003)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 26004)
+@@ -1,5 +1,5 @@
+ /*
+- * cores.h: 
++ * cores.h:
+  */
+ 
+ #ifndef _CORES_H_
+@@ -53,6 +53,7 @@
+ void smb_core(FemModel* femmodel);
+ void bmb_core(FemModel* femmodel);
+ void damage_core(FemModel* femmodel);
++void sampling_core(FemModel* femmodel);
+ 
+ /*sealevel change cores:*/
+ void sealevelchange_core(FemModel* femmodel);
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26003)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26004)
+@@ -1306,6 +1306,8 @@
+ syn keyword cConstant RegularEnum
+ syn keyword cConstant RecoveryAnalysisEnum
+ syn keyword cConstant RiftfrontEnum
++syn keyword cConstant SamplingAnalysisEnum
++syn keyword cConstant SamplingSolutionEnum
+ syn keyword cConstant SIAApproximationEnum
+ syn keyword cConstant SMBcomponentsEnum
+ syn keyword cConstant SMBd18opddEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26003)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26004)
+@@ -1305,6 +1305,8 @@
+ 	RegularEnum,
+ 	RecoveryAnalysisEnum,
+ 	RiftfrontEnum,
++	SamplingAnalysisEnum,
++	SamplingSolutionEnum,
+ 	SIAApproximationEnum,
+ 	SMBcomponentsEnum,
+ 	SMBd18opddEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26003)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26004)
+@@ -1308,6 +1308,8 @@
+ 		case RegularEnum : return "Regular";
+ 		case RecoveryAnalysisEnum : return "RecoveryAnalysis";
+ 		case RiftfrontEnum : return "Riftfront";
++		case SamplingAnalysisEnum : return "SamplingAnalysis";
++		case SamplingSolutionEnum : return "SamplingSolution";
+ 		case SIAApproximationEnum : return "SIAApproximation";
+ 		case SMBcomponentsEnum : return "SMBcomponents";
+ 		case SMBd18opddEnum : return "SMBd18opdd";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26003)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26004)
+@@ -1338,6 +1338,8 @@
+ 	      else if (strcmp(name,"Regular")==0) return RegularEnum;
+ 	      else if (strcmp(name,"RecoveryAnalysis")==0) return RecoveryAnalysisEnum;
+ 	      else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
++	      else if (strcmp(name,"SamplingAnalysis")==0) return SamplingAnalysisEnum;
++	      else if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
+ 	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
+ 	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+ 	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
+@@ -1364,12 +1366,12 @@
+ 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
+ 	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
+ 	      else if (strcmp(name,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
+-	      else if (strcmp(name,"SealevelchangeSolution")==0) return SealevelchangeSolutionEnum;
+-	      else if (strcmp(name,"Seg")==0) return SegEnum;
+          else stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SegInput")==0) return SegInputEnum;
++	      if (strcmp(name,"SealevelchangeSolution")==0) return SealevelchangeSolutionEnum;
++	      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 if (strcmp(name,"Separate")==0) return SeparateEnum;
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26004)
+@@ -0,0 +1,160 @@
++/*!\file: solutionsequence_sampling.cpp
++ * \brief: numerical core of linear solutions
++ */
++
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++#include "../analyses/analyses.h"
++#include <random>
++
++void GaussianVector(Vector<IssmDouble>* ppf,int seed){/*{{{*/
++
++	/*Intermediaries*/
++	double      rdnumber;
++
++	/*Define random number generator*/
++	std::normal_distribution<double> distribution(0.0,1.0);  // Define probability distribution as the standard normal distribution
++	if(seed<0){
++		std::random_device rd;
++		seed = rd();
++	}
++	else
++	{
++		int my_rank;
++		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
++		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
++	}
++	std::default_random_engine generator(seed);
++
++	int        *local_indices = NULL;
++	IssmDouble *local_vector = NULL;
++	ppf->GetLocalVector(&local_vector,&local_indices);
++
++  int M;
++	ppf->GetLocalSize(&M);
++	for(int i=0;i<M;i++){
++		rdnumber = distribution(generator);
++		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
++	}
++	ppf->Assemble();
++
++}/*}}}*/
++void InsertSample(IssmDouble* u,Vector<IssmDouble>* usample,int nsize,int numsam){/*{{{*/
++
++  /*Intermediaries*/
++  int rstart = numsam*nsize;
++  double value;
++
++  /*Fill global vector*/
++  for (int i=0;i<nsize;i++)
++  {
++    usample->GetValue(&value,i);
++    u[rstart+i] = value;
++  }
++
++}/*}}}*/
++void solutionsequence_sampling(FemModel* femmodel){
++
++	/*intermediary: */
++  Matrix<IssmDouble>*  Kff = NULL;
++	Matrix<IssmDouble>*  Kfs = NULL;
++  Vector<IssmDouble>*  ug  = NULL;
++  Vector<IssmDouble>*  uf  = NULL;
++  Vector<IssmDouble>*  old_uf  = NULL;     // previous solution vector (for transient)
++  Vector<IssmDouble>*  pf  = NULL;
++  Vector<IssmDouble>*  df  = NULL;
++  Vector<IssmDouble>*  ys=NULL;
++
++  SamplingAnalysis*    analysis = NULL;
++
++  Vector<IssmDouble>*  Ml = NULL;      // diagonal lumped mass matrix
++  Vector<IssmDouble>*  Mscale = NULL;  // square root of diagonal lumped factor matrix
++
++  /*parameters:*/
++  int solution_type, alpha, step, seed, nsize;
++  IssmDouble phi, tau;
++
++  /*Recover parameters: */
++  femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++  femmodel->parameters->FindParam(&seed,SamplingSeedEnum);
++  femmodel->parameters->FindParam(&alpha,SamplingAlphaEnum);
++  femmodel->parameters->FindParam(&tau,SamplingTauEnum);
++
++  /*Recover parameters for transient simulation: */
++  if(solution_type==TransientSolutionEnum)
++  {
++    femmodel->parameters->FindParam(&step,StepEnum);
++    femmodel->parameters->FindParam(&phi,SamplingPhiEnum);
++    seed = seed + 13923272*step; // change default seed for transient simulations (by considering an arbitrary shif based on the step number)
++
++    GetSolutionFromInputsx(&ug,femmodel);
++    Reducevectorgtofx(&uf, ug, femmodel->nodes,femmodel->parameters);
++    old_uf=uf->Duplicate();
++  }
++
++  /*CreateAnalysis*/
++
++  analysis = new SamplingAnalysis();
++
++  analysis->LumpedMassMatrix(&Ml,femmodel); //Create lumped mass matrix
++
++  if(alpha%2!=0)  analysis->LumpedKMatrix(&Mscale,femmodel);   /* Compute square root of lump mass matrix (for alpha even) or stiffness matrix (for alpha odd) */
++  else{
++    Mscale=Ml->Duplicate();
++    Ml->Copy(Mscale);
++  }
++  Mscale->Pow(0.5);
++
++  femmodel->UpdateConstraintsx();
++  SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel);
++  CreateNodalConstraintsx(&ys,femmodel->nodes);
++  Reduceloadx(pf, Kfs, ys);
++  delete Kfs;
++
++  /*Copy old solution for transient run */
++  if(solution_type==TransientSolutionEnum) uf->Copy(old_uf);
++
++  /* Generate random RHS */
++  GaussianVector(pf,seed);
++
++  /* Multiply random RHS by square root of mass matrix (for alpha even) or stiffness matrix (for alpha odd) */
++  pf->PointwiseMult(pf,Mscale);
++
++  /*Go solve SPDE */
++  femmodel->profiler->Start(SOLVER);
++  Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters);
++  femmodel->profiler->Stop(SOLVER);
++
++  /* Iterate to compute a realization for alpha>2 */
++  for(int i=3;i<=alpha;i+=2){
++
++    /*Create RHS */
++    uf->Copy(pf);
++    pf->PointwiseMult(pf,Ml);
++
++    /*Go solve SPDE */
++    femmodel->profiler->Start(SOLVER);
++    Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters);
++    femmodel->profiler->Stop(SOLVER);
++
++  }
++
++  /* Divide results by tau */
++  uf->Scale(1.0/tau);
++
++  /* Update solution x_{t+1} = phi x_{t} + noise for transient */
++  if(solution_type==TransientSolutionEnum) uf->AXPY(old_uf,phi);
++
++  /* Update input */
++  Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);
++  InputUpdateFromSolutionx(femmodel,ug);
++
++  /*clean-up*/
++  delete Kff; delete pf; delete df; delete uf; delete ys; delete old_uf;
++  delete Ml; delete Mscale;
++  delete analysis;
++  delete ug;
++
++}
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 26003)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 26004)
+@@ -22,6 +22,7 @@
+ %   - 'Love'               or 'lv'
+ %   - 'Esa'                or 'esa'
+ %   - 'Sealevelchange'     or 'slc'
++%   - 'Sampling'           or 'smp'
+ %
+ %   Extra options:
+ %   - loadonly         : does not solve. only load results
+@@ -74,6 +75,8 @@
+ 	solutionstring = 'EsaSolution';
+ elseif strcmpi(solutionstring,'slc') || strcmpi(solutionstring,'Sealevelchange')
+ 	solutionstring = 'SealevelchangeSolution';
++elseif strcmpi(solutionstring,'smp') || strcmpi(solutionstring,'Sampling')
++	solutionstring = 'SamplingSolution';    
+ else
+ 	error(['solutionstring ' solutionstring ' not supported!']);
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26004-26005.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26004-26005.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26004-26005.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26004)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26005)
+@@ -41,20 +41,6 @@
+ 	ppf->Assemble();
+ 
+ }/*}}}*/
+-void InsertSample(IssmDouble* u,Vector<IssmDouble>* usample,int nsize,int numsam){/*{{{*/
+-
+-  /*Intermediaries*/
+-  int rstart = numsam*nsize;
+-  double value;
+-
+-  /*Fill global vector*/
+-  for (int i=0;i<nsize;i++)
+-  {
+-    usample->GetValue(&value,i);
+-    u[rstart+i] = value;
+-  }
+-
+-}/*}}}*/
+ void solutionsequence_sampling(FemModel* femmodel){
+ 
+ 	/*intermediary: */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26005-26006.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26005-26006.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26005-26006.diff	(revision 26740)
@@ -0,0 +1,115 @@
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26005)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26006)
+@@ -19,6 +19,7 @@
+ 		watercolumn         = NaN;
+ 		hydraulic_potential = NaN;
+ 		channelarea         = NaN;
++        sample              = NaN;
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+@@ -108,7 +109,12 @@
+ 						md = checkfield(md,'fieldname','initialization.epl_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 						md = checkfield(md,'fieldname','initialization.epl_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 					end
+-				end
++                end
++            end
++            if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
++                if ~isnan(md.initialization.sample)
++                    md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++                end
+ 			end
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -128,7 +134,7 @@
+ 			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]');
+-
++            fielddisplay(self,'sample','Realization of a Gaussian random field');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+@@ -146,7 +152,8 @@
+ 			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);
+-
++            WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
++            
+ 			if md.thermal.isenthalpy,
+ 				if numel(self.enthalpy) <= 1,
+ 					%reconstruct enthalpy
+@@ -176,7 +183,8 @@
+ 			writejs1Darray(fid,[modelname '.initialization.watercolumn'],self.watercolumn);
+ 			writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential);
+ 			writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea);
+-
++            writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
++            
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.m	(revision 26005)
++++ ../trunk-jpl/src/m/classes/transient.m	(revision 26006)
+@@ -15,6 +15,7 @@
+ 		isdamageevolution = 0;
+ 		ismovingfront     = 0;
+ 		ishydrology       = 0;
++        issampling        = 0;
+ 		isslc             = 0;
+ 		iscoupler         = 0;
+ 		amr_frequency     = 0;
+@@ -43,6 +44,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   =0;
+ 			self.ishydrology     = 0;
++            self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+@@ -64,6 +66,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   = 0;
+ 			self.ishydrology     = 0;
++            self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+@@ -98,6 +101,7 @@
+ 			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0 1]);
++            md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
+ 			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 
+ 			if (~strcmp(solution,'TransientSolution') & md.transient.iscoupling==1), 
+@@ -120,6 +124,7 @@
+ 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
+ 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
+ 			fielddisplay(self,'ishydrology','indicates whether an hydrology model is used');
++            fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
+ 			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
+ 			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+ 			fielddisplay(self,'iscoupler','indicates whether different models are being run with need for coupling');
+@@ -138,6 +143,7 @@
+ 			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','issampling','format','Boolean'); 
+ 			WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean');
+@@ -164,6 +170,7 @@
+ 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
+ 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
+ 			writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology);
++            writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
+ 			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
+ 			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
+ 			writejsdouble(fid,[modelname '.trans.iscoupler'],self.iscoupler);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26006-26007.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26006-26007.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26006-26007.diff	(revision 26740)
@@ -0,0 +1,124 @@
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26006)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26007)
+@@ -19,7 +19,7 @@
+ 		watercolumn         = NaN;
+ 		hydraulic_potential = NaN;
+ 		channelarea         = NaN;
+-        sample              = NaN;
++        %sample              = NaN;
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+@@ -111,11 +111,11 @@
+ 					end
+                 end
+             end
+-            if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
+-                if ~isnan(md.initialization.sample)
+-                    md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+-                end
+-			end
++%             if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
++%                 if ~isnan(md.initialization.sample)
++%                     md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++%                 end
++% 			end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   initial field values:'));
+@@ -134,7 +134,7 @@
+ 			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]');
+-            fielddisplay(self,'sample','Realization of a Gaussian random field');
++            %fielddisplay(self,'sample','Realization of a Gaussian random field');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+@@ -152,7 +152,7 @@
+ 			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);
+-            WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
++            %WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
+             
+ 			if md.thermal.isenthalpy,
+ 				if numel(self.enthalpy) <= 1,
+@@ -183,7 +183,7 @@
+ 			writejs1Darray(fid,[modelname '.initialization.watercolumn'],self.watercolumn);
+ 			writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential);
+ 			writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea);
+-            writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
++           % writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
+             
+ 		end % }}}
+ 	end
+Index: ../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.m	(revision 26006)
++++ ../trunk-jpl/src/m/classes/transient.m	(revision 26007)
+@@ -15,7 +15,7 @@
+ 		isdamageevolution = 0;
+ 		ismovingfront     = 0;
+ 		ishydrology       = 0;
+-        issampling        = 0;
++        %issampling        = 0;
+ 		isslc             = 0;
+ 		iscoupler         = 0;
+ 		amr_frequency     = 0;
+@@ -44,7 +44,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   =0;
+ 			self.ishydrology     = 0;
+-            self.issampling      = 0;
++            %self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+@@ -66,7 +66,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   = 0;
+ 			self.ishydrology     = 0;
+-            self.issampling      = 0;
++            %self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+@@ -101,7 +101,7 @@
+ 			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0 1]);
+-            md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
++            %md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
+ 			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 
+ 			if (~strcmp(solution,'TransientSolution') & md.transient.iscoupling==1), 
+@@ -124,7 +124,7 @@
+ 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
+ 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
+ 			fielddisplay(self,'ishydrology','indicates whether an hydrology model is used');
+-            fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
++            %fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
+ 			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
+ 			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+ 			fielddisplay(self,'iscoupler','indicates whether different models are being run with need for coupling');
+@@ -143,7 +143,7 @@
+ 			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','issampling','format','Boolean'); 
++            %WriteData(fid,prefix,'object',self,'fieldname','issampling','format','Boolean'); 
+ 			WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean');
+@@ -170,7 +170,7 @@
+ 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
+ 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
+ 			writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology);
+-            writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
++            %writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
+ 			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
+ 			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
+ 			writejsdouble(fid,[modelname '.trans.iscoupler'],self.iscoupler);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26007-26008.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26007-26008.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26007-26008.diff	(revision 26740)
@@ -0,0 +1,57 @@
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26007)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26008)
+@@ -19,7 +19,7 @@
+ 		watercolumn         = NaN;
+ 		hydraulic_potential = NaN;
+ 		channelarea         = NaN;
+-        %sample              = NaN;
++        sample              = NaN;
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+@@ -111,11 +111,11 @@
+ 					end
+                 end
+             end
+-%             if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
+-%                 if ~isnan(md.initialization.sample)
+-%                     md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+-%                 end
+-% 			end
++            if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
++                if ~isnan(md.initialization.sample)
++                    md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++                end
++			end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   initial field values:'));
+@@ -134,7 +134,7 @@
+ 			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]');
+-            %fielddisplay(self,'sample','Realization of a Gaussian random field');
++            fielddisplay(self,'sample','Realization of a Gaussian random field');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+@@ -152,7 +152,7 @@
+ 			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);
+-            %WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
++            WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
+             
+ 			if md.thermal.isenthalpy,
+ 				if numel(self.enthalpy) <= 1,
+@@ -183,7 +183,7 @@
+ 			writejs1Darray(fid,[modelname '.initialization.watercolumn'],self.watercolumn);
+ 			writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential);
+ 			writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea);
+-           % writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
++            writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
+             
+ 		end % }}}
+ 	end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26008-26009.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26008-26009.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26008-26009.diff	(revision 26740)
@@ -0,0 +1,67 @@
+Index: ../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.m	(revision 26008)
++++ ../trunk-jpl/src/m/classes/transient.m	(revision 26009)
+@@ -15,7 +15,7 @@
+ 		isdamageevolution = 0;
+ 		ismovingfront     = 0;
+ 		ishydrology       = 0;
+-        %issampling        = 0;
++        issampling        = 0;
+ 		isslc             = 0;
+ 		iscoupler         = 0;
+ 		amr_frequency     = 0;
+@@ -44,7 +44,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   =0;
+ 			self.ishydrology     = 0;
+-            %self.issampling      = 0;
++            self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+@@ -66,7 +66,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   = 0;
+ 			self.ishydrology     = 0;
+-            %self.issampling      = 0;
++            self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.iscoupler       = 0;
+@@ -101,7 +101,7 @@
+ 			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0 1]);
+-            %md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
++            md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
+ 			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 
+ 			if (~strcmp(solution,'TransientSolution') & md.transient.iscoupling==1), 
+@@ -124,7 +124,7 @@
+ 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
+ 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
+ 			fielddisplay(self,'ishydrology','indicates whether an hydrology model is used');
+-            %fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
++            fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
+ 			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
+ 			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+ 			fielddisplay(self,'iscoupler','indicates whether different models are being run with need for coupling');
+@@ -143,7 +143,7 @@
+ 			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','issampling','format','Boolean'); 
++            WriteData(fid,prefix,'object',self,'fieldname','issampling','format','Boolean'); 
+ 			WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean');
+@@ -170,7 +170,7 @@
+ 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
+ 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
+ 			writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology);
+-            %writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
++            writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
+ 			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
+ 			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
+ 			writejsdouble(fid,[modelname '.trans.iscoupler'],self.iscoupler);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26009-26010.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26009-26010.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26009-26010.diff	(revision 26740)
@@ -0,0 +1,96 @@
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26009)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26010)
+@@ -75,7 +75,7 @@
+ 
+   iomodel->FetchDataToInput(inputs,elements,"md.sampling.kappa",SamplingKappaEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.sampling.beta",SamplingBetaEnum,0.);
+-	//iomodel->FetchDataToInput(inputs,elements,"md.initialization.sample",SampleEnum,0.);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sample",SampleEnum,0.);
+ 
+ }/*}}}*/
+ void SamplingAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26009)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26010)
+@@ -852,7 +852,7 @@
+ 
+ 		case TransientSolutionEnum:{
+ 			/*We have multiple analyses here, process one by one*/
+-			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,isgia;
++			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,isgia,issampling;
+ 			iomodel->FindConstant(&isthermal,"md.transient.isthermal");
+ 			iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
+ 			iomodel->FindConstant(&ismasstransport,"md.transient.ismasstransport");
+@@ -864,8 +864,9 @@
+ 			iomodel->FindConstant(&isslc,"md.transient.isslc");
+ 			iomodel->FindConstant(&isesa,"md.transient.isesa");
+ 			iomodel->FindConstant(&isgia,"md.transient.isgia");
+-         int* analyses_iter     = NULL;
+-         int  num_analyses_iter = 0;
++			iomodel->FindConstant(&issampling,"md.transient.issampling");
++      int* analyses_iter     = NULL;
++      int  num_analyses_iter = 0;
+ 			if(isstressbalance){
+ 				SolutionAnalysesList(&analyses_iter,&num_analyses_iter,iomodel,StressbalanceSolutionEnum);
+             xMemCpy<int>(&analyses_temp[numanalyses],analyses_iter,num_analyses_iter);
+@@ -911,6 +912,9 @@
+ 			if(isgia){
+ 				analyses_temp[numanalyses++]=GiaAnalysisEnum;
+ 			}
++			if(issampling){
++				analyses_temp[numanalyses++]=SamplingAnalysisEnum;
++			}
+ 
+ 			if(iomodel->domaintype==Domain2DverticalEnum || iomodel->domaintype==Domain3DEnum){
+ 				analyses_temp[numanalyses++]=ExtrudeFromBaseAnalysisEnum;
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26009)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26010)
+@@ -137,7 +137,7 @@
+ void transient_step(FemModel* femmodel){/*{{{*/
+ 
+ 	/*parameters: */
+-	bool isstressbalance,ismasstransport,issmb,isthermal,isgroundingline,isgia,isesa;
++	bool isstressbalance,ismasstransport,issmb,isthermal,isgroundingline,isgia,isesa,issampling;;
+ 	bool isslc,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,save_results;
+ 	int  step,sb_coupling_frequency;
+ 	int  domaintype,numoutputs;
+@@ -159,6 +159,7 @@
+ 	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
+ 	femmodel->parameters->FindParam(&isdamageevolution,TransientIsdamageevolutionEnum);
+ 	femmodel->parameters->FindParam(&ishydrology,TransientIshydrologyEnum);
++	femmodel->parameters->FindParam(&issampling,TransientIssamplingEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
+ 
+ 	#if defined(_HAVE_OCEAN_ )
+@@ -240,6 +241,12 @@
+ 		sealevelchange_core(femmodel);
+ 	}
+ 
++	/*Sampling: */
++	if(issampling){
++		if(VerboseSolution()) _printf0_("   computing Gaussian random field\n");
++		sampling_core(femmodel);
++	}
++
+ 	/*Any requested output that needs to be saved?*/
+ 	if(numoutputs){
+ 		char **requested_outputs = NULL;
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26009)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26010)
+@@ -85,7 +85,8 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.iscoupler",TransientIscouplerEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceancoupling",TransientIsoceancouplingEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.amr_frequency",TransientAmrFrequencyEnum));
+-
++		parameters->AddObject(iomodel->CopyConstantObject("md.transient.issampling",TransientIssamplingEnum));
++		
+ 		/*For stress balance only*/
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isFS",FlowequationIsFSEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.rift_penalty_threshold",StressbalanceRiftPenaltyThresholdEnum));
Index: /issm/oecreview/Archive/25834-26739/ISSM-26010-26011.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26010-26011.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26010-26011.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.py	(revision 26010)
++++ ../trunk-jpl/src/m/classes/transient.py	(revision 26011)
+@@ -21,6 +21,7 @@
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+         self.ishydrology = 0
++        self.issampling = 0
+         self.isslc = 0
+         self.iscoupler = 0
+         self.amr_frequency = 0
+@@ -42,6 +43,7 @@
+         s += '{}\n'.format(fielddisplay(self, 'isdamageevolution', 'indicates whether damage evolution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'ismovingfront', 'indicates whether a moving front capability is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'ishydrology', 'indicates whether an hydrology model is used'))
++        s += '{}\n'.format(fielddisplay(self, 'issampling', 'indicates whether sampling is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isslc', 'indicates if a sea level change solution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isoceancoupling', 'indicates whether coupling with an ocean model is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'iscoupler', 'indicates whether different models are being run with need for coupling'))
+@@ -68,6 +70,7 @@
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+         self.ishydrology = 0
++        self.issampling = 0
+         self.isslc = 0
+         self.isoceancoupling = 0
+         self.iscoupler = 0
+@@ -90,6 +93,7 @@
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+         self.ishydrology = 0
++        self.issampling = 0
+         self.isslc = 0
+         self.isoceancoupling = 0
+         self.iscoupler = 0
+@@ -114,6 +118,7 @@
+         md = checkfield(md, 'fieldname', 'transient.isesa', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isdamageevolution', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.ishydrology', 'numel', [1], 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'transient.issampling', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.ismovingfront', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isslc', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isoceancoupling', 'numel', [1], 'values', [0, 1])
+@@ -138,6 +143,7 @@
+         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', 'issampling', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isslc', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceancoupling', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'iscoupler', 'format', 'Boolean')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26011-26012.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26011-26012.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26011-26012.diff	(revision 26740)
@@ -0,0 +1,112 @@
+Index: ../trunk-jpl/src/m/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/sampling.py	(nonexistent)
++++ ../trunk-jpl/src/m/sampling.py	(revision 26012)
+@@ -0,0 +1,106 @@
++import numpy as np
++
++from checkfield import checkfield
++from fielddisplay import fielddisplay
++from project3d import project3d
++from WriteData import WriteData
++
++
++class sampling(object):
++    """SAMPLING class definition
++
++    Usage:
++        sampling = sampling()
++    """
++
++    def __init__(self):  # {{{
++        self.kappa = float('NaN')
++        self.tau = 0
++        self.beta = float('NaN')
++        self.hydrostatic_adjustment = 0
++        self.phi = 0
++        self.alpha = 0
++        self.robin = 0
++        self.seed = 0
++        self.requested_outputs = []
++
++        # Set defaults
++        self.setdefaultparameters()
++
++    #}}}
++
++    def __repr__(self):  # {{{
++        s = '   Sampling parameters::\n'
++        s += '{}\n'.format(fielddisplay(self,'kappa','coefficient of the identity operator'))
++        s += '{}\n'.format(fielddisplay(self,'tau','scaling coefficient of the solution (default 1.0)'))
++        s += '{}\n'.format(fielddisplay(self,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)'))
++        s += '{}\n'.format(disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():')))
++        s += '{}\n'.format(fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)'))
++        s += '{}\n'.format(fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)'))
++        s += '{}\n'.format(fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)'))
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested (not implemented yet)'))
++        return s
++    #}}}
++
++    def defaultoutputs(self, md):  # {{{
++        return []
++
++    #}}}
++    def setdefaultparameters(self):  # {{{
++        # Scaling coefficient
++        self.tau = 1
++        # Apply Robin boundary conditions
++        self.robin = 0
++        # Temporal correlation factor
++        self.phi = 0
++        # Exponent in fraction SPDE (default=2, biLaplacian covariance operator)
++        self.alpha=2; 
++        # Seed for pseudorandom number generator (default -1 for random seed)
++        self.alpha=-1; 
++        # Default output
++        self.requested_outputs = ['default']
++        return self
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        # Early return
++        if (SamplingAnalysis' not in analyses):
++            return md
++
++        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++        md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
++        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++        md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
++        md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
++        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
++        md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
++        md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
++
++        return md
++    # }}}
++
++    def marshall(self, prefix, md, fid):  # {{{
++        WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1);
++        WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double');
++        WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1);
++        WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double');
++        WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer');
++        WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean');
++        WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer');
++
++        # Process requested outputs
++        outputs = self.requested_outputs
++        indices = [i for i, x in enumerate(outputs) if x == 'default']
++        if len(indices) > 0:
++            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
++            outputs = outputscopy
++        WriteData(fid, prefix, 'data', outputs, 'name', 'md.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.sampling.requested_outputs','format','StringArray');
++    # }}}
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26012-26013.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26012-26013.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26012-26013.diff	(revision 26740)
@@ -0,0 +1,188 @@
+Index: ../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.py	(revision 26012)
++++ ../trunk-jpl/src/m/classes/initialization.py	(revision 26013)
+@@ -28,6 +28,7 @@
+         self.epl_thickness = np.nan
+         self.hydraulic_potential = np.nan
+         self.channelarea = np.nan
++        self.sample = np.nan
+ 
+         #set defaults
+         self.setdefaultparameters()
+@@ -49,6 +50,7 @@
+         s += '{}\n'.format(fielddisplay(self, 'epl_thickness', 'thickness of the epl [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'hydraulic_potential', 'Hydraulic potential (for GlaDS) [Pa]'))
+         s += '{}\n'.format(fielddisplay(self, 'channelarea', 'subglaciale water channel area (for GlaDS) [m2]'))
++        s += '{}\n'.format(fielddisplay(self,'sample','Realization of a Gaussian random field'))
+         return s
+     #}}}
+ 
+@@ -123,6 +125,9 @@
+                 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                 md = checkfield(md, 'fieldname', 'initialization.hydraulic_potential', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                 md = checkfield(md, 'fieldname', 'initialization.channelarea', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [md.mesh.numberofelements])
++        if 'SamplingAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.issampling:
++            if np.any(np.isnan(md.initialization.sample)):
++                md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1])
+         return md
+     # }}}
+ 
+@@ -140,6 +145,7 @@
+         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)
++        WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1)
+         if md.thermal.isenthalpy:
+             if (np.size(self.enthalpy) <= 1):
+                 tpmp = md.materials.meltingpoint - md.materials.beta * md.initialization.pressure
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26012)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26013)
+@@ -75,6 +75,7 @@
+ from ElementConnectivity import ElementConnectivity
+ from contourenvelope import contourenvelope
+ from DepthAverage import DepthAverage
++from sampling import sampling
+ #}}}
+ 
+ 
+@@ -115,6 +116,7 @@
+         self.gia = None
+         self.love = None
+         self.esa = None
++        self.sampling = None
+         self.autodiff = None
+         self.inversion = None
+         self.qmu = None
+@@ -172,6 +174,7 @@
+                 'gia',
+                 'love',
+                 'esa',
++                'sampling',
+                 'autodiff',
+                 'inversion',
+                 'qmu',
+@@ -223,6 +226,7 @@
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("frontalforcings", "[%s %s]" % ("1x1", obj.frontalforcings.__class__.__name__), "parameters for frontalforcings"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("gia", "[%s %s]" % ("1x1", obj.gia.__class__.__name__), "parameters for gia solution"))
+         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("esa", "[%s %s]" % ("1x1", obj.esa.__class__.__name__), "parameters for elastic adjustment solution"))
++        s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("sampling", "[%s %s]" % ("1x1", obj.sampling.__class__.__name__), "parameters for stochastic sampler"))
+         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("love", "[%s %s]" % ("1x1", obj.love.__class__.__name__), "parameters for love solution"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("autodiff", "[%s %s]" % ("1x1", obj.autodiff.__class__.__name__), "automatic differentiation parameters"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("inversion", "[%s %s]" % ("1x1", obj.inversion.__class__.__name__), "parameters for inverse methods"))
+@@ -270,6 +274,7 @@
+         self.gia = giamme()
+         self.love = fourierlove()
+         self.esa = esa()
++        self.sampling = sampling()
+         self.autodiff = autodiff()
+         self.inversion = inversion()
+         self.qmu = qmu()
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26012)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26013)
+@@ -78,6 +78,8 @@
+         analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis']
+     elif 'DamageEvolutionSolution':
+         analyses = ['DamageEvolutionAnalysis']
++    elseif strcmp(solutiontype,'SamplingSolution')
++		analyses=['SamplingAnalysis']  
+     else:
+         raise TypeError('solution type: {} not supported yet!'.format(solutiontype))
+ 
+Index: ../trunk-jpl/src/m/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/sampling.py	(revision 26012)
++++ ../trunk-jpl/src/m/sampling.py	(revision 26013)
+@@ -54,9 +54,9 @@
+         # Temporal correlation factor
+         self.phi = 0
+         # Exponent in fraction SPDE (default=2, biLaplacian covariance operator)
+-        self.alpha=2; 
++        self.alpha = 2 
+         # Seed for pseudorandom number generator (default -1 for random seed)
+-        self.alpha=-1; 
++        self.alpha = -1 
+         # Default output
+         self.requested_outputs = ['default']
+         return self
+@@ -67,26 +67,26 @@
+         if (SamplingAnalysis' not in analyses):
+             return md
+ 
+-        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+-        md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
+-        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+-        md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
+-        md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
+-        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
+-        md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
+-        md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
++        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
++        md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0)
++        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
++        md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0)
++        md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0)
++        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1])
++        md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1)
++        md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1)
+ 
+         return md
+     # }}}
+ 
+     def marshall(self, prefix, md, fid):  # {{{
+-        WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1);
+-        WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double');
+-        WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1);
+-        WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double');
+-        WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer');
+-        WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean');
+-        WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer');
++        WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1)
++        WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double')
++        WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1)
++        WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double')
++        WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer')
++        WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean')
++        WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer')
+ 
+         # Process requested outputs
+         outputs = self.requested_outputs
+@@ -97,10 +97,10 @@
+         WriteData(fid, prefix, 'data', outputs, 'name', 'md.masstransport.requested_outputs', 'format', 'StringArray')
+ 
+         # Process requested outputs
+-		outputs = self.requested_outputs;
++		outputs = self.requested_outputs
+ 		indices = [i for i, x in enumerate(outputs) if x == 'default']
+ 		   if len(indices) > 0:
+             outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+             outputs = outputscopy
+-		WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
++		WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray')
+     # }}}
+\ No newline at end of file
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 26012)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 26013)
+@@ -34,6 +34,7 @@
+     - 'Esa'                or 'esa'
+     - 'Sealevelchange'     or 'slc'
+     - 'Love'               or 'lv'
++    - 'Sampling'           or 'smp'
+ 
+     Extra options:
+     - loadonly         : does not solve. only load results
+@@ -79,6 +80,8 @@
+         solutionstring = 'EsaSolution'
+     elif solutionstring.lower() == 'slc' or solutionstring.lower() == 'sealevelchange':
+         solutionstring = 'SealevelchangeSolution'
++    elif solutionstring.lower() == 'smp' or solutionstring.lower() == 'sampling':
++        solutionstring = 'SamplingSolution'
+     else:
+         raise ValueError("solutionstring '%s' not supported!" % solutionstring)
+     options = pairoptions('solutionstring', solutionstring, *args)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26013-26014.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26013-26014.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26013-26014.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.py	(revision 26013)
++++ ../trunk-jpl/src/m/classes/initialization.py	(revision 26014)
+@@ -127,7 +127,7 @@
+                 md = checkfield(md, 'fieldname', 'initialization.channelarea', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [md.mesh.numberofelements])
+         if 'SamplingAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.issampling:
+             if np.any(np.isnan(md.initialization.sample)):
+-                md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1])
++                md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+         return md
+     # }}}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26014-26015.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26014-26015.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26014-26015.diff	(revision 26740)
@@ -0,0 +1,112 @@
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26015)
+@@ -0,0 +1,106 @@
++import numpy as np
++
++from checkfield import checkfield
++from fielddisplay import fielddisplay
++from project3d import project3d
++from WriteData import WriteData
++
++
++class sampling(object):
++    """SAMPLING class definition
++
++    Usage:
++        sampling = sampling()
++    """
++
++    def __init__(self):  # {{{
++        self.kappa = float('NaN')
++        self.tau = 0
++        self.beta = float('NaN')
++        self.hydrostatic_adjustment = 0
++        self.phi = 0
++        self.alpha = 0
++        self.robin = 0
++        self.seed = 0
++        self.requested_outputs = []
++
++        # Set defaults
++        self.setdefaultparameters()
++
++    #}}}
++
++    def __repr__(self):  # {{{
++        s = '   Sampling parameters::\n'
++        s += '{}\n'.format(fielddisplay(self,'kappa','coefficient of the identity operator'))
++        s += '{}\n'.format(fielddisplay(self,'tau','scaling coefficient of the solution (default 1.0)'))
++        s += '{}\n'.format(fielddisplay(self,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)'))
++        s += '{}\n'.format(disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():')))
++        s += '{}\n'.format(fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)'))
++        s += '{}\n'.format(fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)'))
++        s += '{}\n'.format(fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)'))
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested (not implemented yet)'))
++        return s
++    #}}}
++
++    def defaultoutputs(self, md):  # {{{
++        return []
++
++    #}}}
++    def setdefaultparameters(self):  # {{{
++        # Scaling coefficient
++        self.tau = 1
++        # Apply Robin boundary conditions
++        self.robin = 0
++        # Temporal correlation factor
++        self.phi = 0
++        # Exponent in fraction SPDE (default=2, biLaplacian covariance operator)
++        self.alpha = 2 
++        # Seed for pseudorandom number generator (default -1 for random seed)
++        self.alpha = -1 
++        # Default output
++        self.requested_outputs = ['default']
++        return self
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        # Early return
++        if ('SamplingAnalysis' not in analyses):
++            return md
++
++        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
++        md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0)
++        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
++        md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0)
++        md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0)
++        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1])
++        md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1)
++        md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1)
++
++        return md
++    # }}}
++
++    def marshall(self, prefix, md, fid):  # {{{
++        WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1)
++        WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double')
++        WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1)
++        WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double')
++        WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer')
++        WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean')
++        WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer')
++
++        # Process requested outputs
++        outputs = self.requested_outputs
++        indices = [i for i, x in enumerate(outputs) if x == 'default']
++        if len(indices) > 0:
++            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
++            outputs = outputscopy
++        WriteData(fid, prefix, 'data', outputs, 'name', 'md.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.sampling.requested_outputs','format','StringArray')
++    # }}}
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26015-26016.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26015-26016.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26015-26016.diff	(revision 26740)
@@ -0,0 +1,112 @@
+Index: ../trunk-jpl/src/m/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/sampling.py	(revision 26015)
++++ ../trunk-jpl/src/m/sampling.py	(nonexistent)
+@@ -1,106 +0,0 @@
+-import numpy as np
+-
+-from checkfield import checkfield
+-from fielddisplay import fielddisplay
+-from project3d import project3d
+-from WriteData import WriteData
+-
+-
+-class sampling(object):
+-    """SAMPLING class definition
+-
+-    Usage:
+-        sampling = sampling()
+-    """
+-
+-    def __init__(self):  # {{{
+-        self.kappa = float('NaN')
+-        self.tau = 0
+-        self.beta = float('NaN')
+-        self.hydrostatic_adjustment = 0
+-        self.phi = 0
+-        self.alpha = 0
+-        self.robin = 0
+-        self.seed = 0
+-        self.requested_outputs = []
+-
+-        # Set defaults
+-        self.setdefaultparameters()
+-
+-    #}}}
+-
+-    def __repr__(self):  # {{{
+-        s = '   Sampling parameters::\n'
+-        s += '{}\n'.format(fielddisplay(self,'kappa','coefficient of the identity operator'))
+-        s += '{}\n'.format(fielddisplay(self,'tau','scaling coefficient of the solution (default 1.0)'))
+-        s += '{}\n'.format(fielddisplay(self,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)'))
+-        s += '{}\n'.format(disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():')))
+-        s += '{}\n'.format(fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)'))
+-        s += '{}\n'.format(fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)'))
+-        s += '{}\n'.format(fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)'))
+-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested (not implemented yet)'))
+-        return s
+-    #}}}
+-
+-    def defaultoutputs(self, md):  # {{{
+-        return []
+-
+-    #}}}
+-    def setdefaultparameters(self):  # {{{
+-        # Scaling coefficient
+-        self.tau = 1
+-        # Apply Robin boundary conditions
+-        self.robin = 0
+-        # Temporal correlation factor
+-        self.phi = 0
+-        # Exponent in fraction SPDE (default=2, biLaplacian covariance operator)
+-        self.alpha = 2 
+-        # Seed for pseudorandom number generator (default -1 for random seed)
+-        self.alpha = -1 
+-        # Default output
+-        self.requested_outputs = ['default']
+-        return self
+-    #}}}
+-
+-    def checkconsistency(self, md, solution, analyses):  # {{{
+-        # Early return
+-        if (SamplingAnalysis' not in analyses):
+-            return md
+-
+-        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
+-        md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
+-        md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0)
+-        md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1])
+-        md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1)
+-        md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1)
+-
+-        return md
+-    # }}}
+-
+-    def marshall(self, prefix, md, fid):  # {{{
+-        WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1)
+-        WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double')
+-        WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1)
+-        WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double')
+-        WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer')
+-        WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean')
+-        WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer')
+-
+-        # Process requested outputs
+-        outputs = self.requested_outputs
+-        indices = [i for i, x in enumerate(outputs) if x == 'default']
+-        if len(indices) > 0:
+-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+-            outputs = outputscopy
+-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.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.sampling.requested_outputs','format','StringArray')
+-    # }}}
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26016-26017.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26016-26017.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26016-26017.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(revision 26016)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26017)
+@@ -67,9 +67,9 @@
+         if ('SamplingAnalysis' not in analyses):
+             return md
+ 
+-        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
++        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
+         md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0)
++        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
+         md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0)
+         md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0)
+         md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1])
Index: /issm/oecreview/Archive/25834-26739/ISSM-26017-26018.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26017-26018.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26017-26018.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(revision 26017)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26018)
+@@ -72,7 +72,7 @@
+         md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
+         md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0)
+         md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1])
++        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0, 1])
+         md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1)
+         md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1)
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26018-26019.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26018-26019.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26018-26019.diff	(revision 26740)
@@ -0,0 +1,19 @@
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(revision 26018)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26019)
+@@ -89,14 +89,6 @@
+         WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer')
+ 
+         # Process requested outputs
+-        outputs = self.requested_outputs
+-        indices = [i for i, x in enumerate(outputs) if x == 'default']
+-        if len(indices) > 0:
+-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+-            outputs = outputscopy
+-        WriteData(fid, prefix, 'data', outputs, 'name', 'md.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:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26019-26020.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26019-26020.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26019-26020.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(revision 26019)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26020)
+@@ -54,9 +54,9 @@
+         # Temporal correlation factor
+         self.phi = 0
+         # Exponent in fraction SPDE (default=2, biLaplacian covariance operator)
+-        self.alpha = 2 
++        self.alpha = 2
+         # Seed for pseudorandom number generator (default -1 for random seed)
+-        self.alpha = -1 
++        self.alpha = -1
+         # Default output
+         self.requested_outputs = ['default']
+         return self
+@@ -88,11 +88,4 @@
+         WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean')
+         WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer')
+ 
+-        # Process requested outputs
+-		outputs = self.requested_outputs
+-		indices = [i for i, x in enumerate(outputs) if x == 'default']
+-		   if len(indices) > 0:
+-            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+-            outputs = outputscopy
+-		WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray')
+-    # }}}
+\ No newline at end of file
++    # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26020-26021.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26020-26021.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26020-26021.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26020)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26021)
+@@ -78,8 +78,8 @@
+         analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis']
+     elif 'DamageEvolutionSolution':
+         analyses = ['DamageEvolutionAnalysis']
+-    elseif strcmp(solutiontype,'SamplingSolution')
+-		analyses=['SamplingAnalysis']  
++    elif 'SamplingSolution':
++		analyses=['SamplingAnalysis']
+     else:
+         raise TypeError('solution type: {} not supported yet!'.format(solutiontype))
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26021-26022.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26021-26022.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26021-26022.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(revision 26021)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26022)
+@@ -88,4 +88,12 @@
+         WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean')
+         WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer')
+ 
++    #process requested outputs
++        outputs = self.requested_outputs
++        indices = [i for i, x in enumerate(outputs) if x == 'default']
++        if len(indices) > 0:
++            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
++            outputs = outputscopy
++        WriteData(fid, prefix, 'data', outputs, 'name', 'md.sampling.requested_outputs', 'format', 'StringArray')
++
+     # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26022-26023.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26022-26023.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26022-26023.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/m/classes/sampling.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.m	(revision 26022)
++++ ../trunk-jpl/src/m/classes/sampling.m	(revision 26023)
+@@ -65,10 +65,12 @@
+ 			
+             md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+             md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
+-            md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++            md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
++            if(md.sampling.robin)
++                md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++            end    
+             md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
+             md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
+-            md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
+             md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
+             md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
+ 
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(revision 26022)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26023)
+@@ -69,10 +69,11 @@
+ 
+         md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
+         md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
++        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0, 1])
++        if md.sampling.robin:
++            md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
+         md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0)
+         md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0, 1])
+         md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1)
+         md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1)
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26023-26024.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26023-26024.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26023-26024.diff	(revision 26740)
@@ -0,0 +1,128 @@
+Index: ../trunk-jpl/test/Archives/Archive127.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive127.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive128.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive128.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive129.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive129.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test127.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test127.m	(revision 26024)
+@@ -0,0 +1,19 @@
++%Test Name: SquareShelfConstrainedSampling
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md = md.sampling.setparameters(md,2e5,1);
++md.sampling.seed = 100;
++md.cluster=generic('name',oshostname(),'np',1);
++md1=solve(md,'smp');
++md.sampling.robin = 1;
++md.sampling.beta = sqrt(md.sampling.tau^2*md.sampling.kappa(1)^2)/1.42*ones(md.mesh.numberofvertices,1);
++md2=solve(md,'smp');
++
++%Fields and tolerances to track changes
++field_names     ={'Sample'};
++field_tolerances={1e-13};
++field_values={...
++	(md1.results.SamplingSolution.Sample),...
++    (md2.results.SamplingSolution.Sample),...
++	};
+\ No newline at end of file
+Index: ../trunk-jpl/test/NightlyRun/test128.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test128.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test128.m	(revision 26024)
+@@ -0,0 +1,28 @@
++%Test Name: SquareShelfConstrainedSamplingExponent
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md.sampling.seed = 100;
++md.cluster=generic('name',oshostname(),'np',1);
++md.sampling.alpha = 2;
++md = md.sampling.setparameters(md,2e5,1);
++md1=solve(md,'smp');
++md.sampling.alpha = 3;
++md = md.sampling.setparameters(md,2e5,1);
++md2=solve(md,'smp');
++md.sampling.alpha = 4;
++md = md.sampling.setparameters(md,2e5,1);
++md3=solve(md,'smp');
++md.sampling.alpha = 5;
++md = md.sampling.setparameters(md,2e5,1);
++md4=solve(md,'smp');
++
++%Fields and tolerances to track changes
++field_names     ={'Sample1','Sample2','Sample3','Sample4'};
++field_tolerances={1e-13};
++field_values={...
++	(md1.results.SamplingSolution.Sample),...
++    (md2.results.SamplingSolution.Sample),...
++    (md3.results.SamplingSolution.Sample),...
++    (md4.results.SamplingSolution.Sample),...
++	};
+\ No newline at end of file
+Index: ../trunk-jpl/test/NightlyRun/test129.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test129.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test129.m	(revision 26024)
+@@ -0,0 +1,30 @@
++%Test Name: SquareShelfConstrainedSamplingTransient
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md = md.sampling.setparameters(md,2e5,1);
++md.sampling.seed = 100;
++md.cluster=generic('name',oshostname(),'np',1);
++md=solve(md,'smp');
++  
++md.sampling.phi = 0.5;
++md = md.sampling.setparameters(md,2e5,1*sqrt(1-md.sampling.phi*md.sampling.phi));   
++md.initialization.sample = md.results.SamplingSolution.Sample;
++md.transient = md.transient.deactivateall();
++md.transient.issampling = 1;
++md.timestepping.time_step = 1;
++md.timestepping.final_time = 5;
++md.settings.output_frequency = 1; 
++md=solve(md,'transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Sample0','Sample1','Sample2','Sample3','Sample4','Sample5'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++    md.initialization.sample,...
++    md.results.TransientSolution(1).Sample,...
++    md.results.TransientSolution(2).Sample,...
++    md.results.TransientSolution(3).Sample,...
++    md.results.TransientSolution(4).Sample,...
++    md.results.TransientSolution(5).Sample,...
++	};
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26024-26025.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26024-26025.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26024-26025.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/test/Archives/Archive127.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test127.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.m	(revision 26024)
++++ ../trunk-jpl/test/NightlyRun/test127.m	(revision 26025)
+@@ -11,8 +11,8 @@
+ md2=solve(md,'smp');
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Sample'};
+-field_tolerances={1e-13};
++field_names     ={'Sample1','Sample2'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md1.results.SamplingSolution.Sample),...
+     (md2.results.SamplingSolution.Sample),...
+Index: ../trunk-jpl/test/NightlyRun/test128.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test128.m	(revision 26024)
++++ ../trunk-jpl/test/NightlyRun/test128.m	(revision 26025)
+@@ -19,7 +19,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Sample1','Sample2','Sample3','Sample4'};
+-field_tolerances={1e-13};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
+ field_values={...
+ 	(md1.results.SamplingSolution.Sample),...
+     (md2.results.SamplingSolution.Sample),...
Index: /issm/oecreview/Archive/25834-26739/ISSM-26025-26026.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26025-26026.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26025-26026.diff	(revision 26740)
@@ -0,0 +1,128 @@
+Index: ../trunk-jpl/test/Archives/Archive128.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive128.arch
+___________________________________________________________________
+Deleted: svn:mime-type
+## -1 +0,0 ##
+-application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive129.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive129.arch
+___________________________________________________________________
+Deleted: svn:mime-type
+## -1 +0,0 ##
+-application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive127.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive127.arch
+___________________________________________________________________
+Deleted: svn:mime-type
+## -1 +0,0 ##
+-application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test127.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.m	(revision 26025)
++++ ../trunk-jpl/test/NightlyRun/test127.m	(nonexistent)
+@@ -1,19 +0,0 @@
+-%Test Name: SquareShelfConstrainedSampling
+-md=triangle(model(),'../Exp/Square.exp',150000.);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md = md.sampling.setparameters(md,2e5,1);
+-md.sampling.seed = 100;
+-md.cluster=generic('name',oshostname(),'np',1);
+-md1=solve(md,'smp');
+-md.sampling.robin = 1;
+-md.sampling.beta = sqrt(md.sampling.tau^2*md.sampling.kappa(1)^2)/1.42*ones(md.mesh.numberofvertices,1);
+-md2=solve(md,'smp');
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Sample1','Sample2'};
+-field_tolerances={1e-13,1e-13};
+-field_values={...
+-	(md1.results.SamplingSolution.Sample),...
+-    (md2.results.SamplingSolution.Sample),...
+-	};
+\ No newline at end of file
+Index: ../trunk-jpl/test/NightlyRun/test129.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test129.m	(revision 26025)
++++ ../trunk-jpl/test/NightlyRun/test129.m	(nonexistent)
+@@ -1,30 +0,0 @@
+-%Test Name: SquareShelfConstrainedSamplingTransient
+-md=triangle(model(),'../Exp/Square.exp',150000.);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md = md.sampling.setparameters(md,2e5,1);
+-md.sampling.seed = 100;
+-md.cluster=generic('name',oshostname(),'np',1);
+-md=solve(md,'smp');
+-  
+-md.sampling.phi = 0.5;
+-md = md.sampling.setparameters(md,2e5,1*sqrt(1-md.sampling.phi*md.sampling.phi));   
+-md.initialization.sample = md.results.SamplingSolution.Sample;
+-md.transient = md.transient.deactivateall();
+-md.transient.issampling = 1;
+-md.timestepping.time_step = 1;
+-md.timestepping.final_time = 5;
+-md.settings.output_frequency = 1; 
+-md=solve(md,'transient');
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Sample0','Sample1','Sample2','Sample3','Sample4','Sample5'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+-field_values={...
+-    md.initialization.sample,...
+-    md.results.TransientSolution(1).Sample,...
+-    md.results.TransientSolution(2).Sample,...
+-    md.results.TransientSolution(3).Sample,...
+-    md.results.TransientSolution(4).Sample,...
+-    md.results.TransientSolution(5).Sample,...
+-	};
+\ No newline at end of file
+Index: ../trunk-jpl/test/NightlyRun/test128.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test128.m	(revision 26025)
++++ ../trunk-jpl/test/NightlyRun/test128.m	(nonexistent)
+@@ -1,28 +0,0 @@
+-%Test Name: SquareShelfConstrainedSamplingExponent
+-md=triangle(model(),'../Exp/Square.exp',150000.);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md.sampling.seed = 100;
+-md.cluster=generic('name',oshostname(),'np',1);
+-md.sampling.alpha = 2;
+-md = md.sampling.setparameters(md,2e5,1);
+-md1=solve(md,'smp');
+-md.sampling.alpha = 3;
+-md = md.sampling.setparameters(md,2e5,1);
+-md2=solve(md,'smp');
+-md.sampling.alpha = 4;
+-md = md.sampling.setparameters(md,2e5,1);
+-md3=solve(md,'smp');
+-md.sampling.alpha = 5;
+-md = md.sampling.setparameters(md,2e5,1);
+-md4=solve(md,'smp');
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Sample1','Sample2','Sample3','Sample4'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
+-field_values={...
+-	(md1.results.SamplingSolution.Sample),...
+-    (md2.results.SamplingSolution.Sample),...
+-    (md3.results.SamplingSolution.Sample),...
+-    (md4.results.SamplingSolution.Sample),...
+-	};
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26026-26027.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26026-26027.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26026-26027.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/examples/ISMIP/IsmipF.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 26026)
++++ ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 26027)
+@@ -10,7 +10,7 @@
+ %surface is [-x*tan(3.0*pi/180)] #md.mesh
+ %->
+ 
+-%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(0.1*L^2))]
++%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]
+ %L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
+ %->
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26027-26028.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26027-26028.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26027-26028.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 26027)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 26028)
+@@ -123,22 +123,25 @@
+ 	%->
+ 
+ 	% periodic boundaries have to be fixed on the sides
+-	% create tabs with the side of the domain
++	% Find the indices of the sides of the domain, separately for x and y
+ 	% for x
+-	% create maxX #help find
++	% create maxX, list of indices where x is equal to max of x (use >> help find)
+ 	%->
+ 
+-	% create minX
++	% create minX, list of indices where x is equal to min of x
+ 	%->
+ 
+-	% for y, max X and minX should be excluded
+-	% create maxY
++	% for y
++	% create maxY, list of indices where y is equal to max of y
++	%  but not where x is equal to max or min of x
++	% (i.e, indices in maxX and minX should be excluded from maxY and minY)
+ 	%->
+ 
+-	% create minY
++	% create minY, list of indices where y is equal to max of y
++	%  but not where x is equal to max or min of x
+ 	%->
+ 
+-	% set the node that should be paired together
++	% set the node that should be paired together, minX with maxX and minY with maxY
+ 	% #md.stressbalance.vertex_pairing
+ 	%->
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26028-26029.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26028-26029.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26028-26029.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/examples/ISMIP/IsmipF.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 26028)
++++ ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 26029)
+@@ -27,7 +27,7 @@
+ 
+ %These parameters will not be used but need to be fixed #md.friction
+ %one friciton coefficient per node (md.mesh.numberofvertices,1)
+-%conversion form year to seconds with #md.constants.yts
++%conversion from year to seconds with #md.constants.yts
+ %->
+ 
+ %one friciton exponent (p,q) per element
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 26028)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 26029)
+@@ -464,7 +464,7 @@
+ 				%Define the geometry of the simulation #md.geometry\n\
+ 				%surface is [-x*tan(3.0*pi/180)] #md.mesh\n\
+ 				%->\n\
+-				md.geometry.surface=md.mesh.x*tan(3.0*pi/180.0);\n\
++				md.geometry.surface=-md.mesh.x*tan(3.0*pi/180.0);\n\
+ 				%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]\n\
+ 				%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)\n\
+ 				%->\n\
+@@ -482,7 +482,7 @@
+ 				\n\
+ 				%These parameters will not be used but need to be fixed #md.friction\n\
+ 				%one friciton coefficient per node (md.mesh.numberofvertices,1)\n\
+-				%conversion form year to seconds with #md.constants.yts\n\
++				%conversion from year to seconds with #md.constants.yts\n\
+ 				%->\n\
+ 				md.friction.coefficient=sqrt(md.constants.yts/(1000*2.140373*10^-7))*ones(md.mesh.numberofvertices,1);\n\
+ 				%one friciton exponent (p,q) per element\n\
Index: /issm/oecreview/Archive/25834-26739/ISSM-26029-26030.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26029-26030.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26029-26030.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 26029)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 26030)
+@@ -251,7 +251,7 @@
+ 						% vertically extrude the preceding mesh #help extrude\n\
+ 						% only 5 layers exponent 1\n\
+ 						%->\n\
+-						md=extrude(md,9,1);\n\
++						md=extrude(md,5,1);\n\
+ 						% plot the 3D geometry #plotdoc\n\
+ 						%->\n\
+ 						plotmodel(md,'data',md.geometry.base)\n\
Index: /issm/oecreview/Archive/25834-26739/ISSM-26030-26031.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26030-26031.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26030-26031.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 26030)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 26031)
+@@ -123,7 +123,7 @@
+ 	%->
+ 
+ 	% periodic boundaries have to be fixed on the sides
+-	% Find the indices of the sides of the domain, separately for x and y
++	% Find the indices of the sides of the domain, for x and then for y
+ 	% for x
+ 	% create maxX, list of indices where x is equal to max of x (use >> help find)
+ 	%->
Index: /issm/oecreview/Archive/25834-26739/ISSM-26031-26032.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26031-26032.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26031-26032.diff	(revision 26740)
@@ -0,0 +1,57 @@
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 26031)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 26032)
+@@ -133,12 +133,12 @@
+ 
+ 	% for y
+ 	% create maxY, list of indices where y is equal to max of y
+-	%  but not where x is equal to max or min of x
+-	% (i.e, indices in maxX and minX should be excluded from maxY and minY)
++	% but not where x is equal to max or min of x
++	% (i.e, indices in maxX and minX should be excluded from maxY and minY)	
+ 	%->
+ 
+ 	% create minY, list of indices where y is equal to max of y
+-	%  but not where x is equal to max or min of x
++	% but not where x is equal to max or min of x
+ 	%->
+ 
+ 	% set the node that should be paired together, minX with maxX and minY with maxY
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 26031)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 26032)
+@@ -301,22 +301,25 @@
+ 						%->\n\
+ 						md.stressbalance.spcvy(basalnodes)=0.0;\n\
+ 						% periodic boundaries have to be fixed on the sides\n\
+-						% create tabs with the side of the domain\n\
++						% Find the indices of the sides of the domain, for x and then for y\n\
+ 						% for x\n\
+-						% create maxX #help find\n\
++						% create maxX, list of indices where x is equal to max of x (use >> help find)\n\
+ 						%->\n\
+ 						maxX=find(md.mesh.x==max(md.mesh.x));\n\
+-						% create minX\n\
++						% create minX, list of indices where x is equal to min of x\n\
+ 						%->\n\
+ 						minX=find(md.mesh.x==min(md.mesh.x));\n\
+-						% for y, max X and minX should be excluded\n\
+-						% create maxY\n\
++						% for y\n\
++						% create maxY, list of indices where y is equal to max of y\n\
++						% but not where x is equal to max or min of x\n\
++						% (i.e, indices in maxX and minX should be excluded from maxY and minY)\n\
++						% but not where x is equal to max or min of x\n\
+ 						%->\n\
+ 						maxY=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));\n\
+-						% create minY\n\
++						% create minY, list of indices where y is equal to max of y\n\
+ 						%->\n\
+ 						minY=find(md.mesh.y==min(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));\n\
+-						% set the node that should be paired together\n\
++						% set the node that should be paired together, minX with maxX and minY with maxY\n\
+ 						% #md.stressbalance.vertex_pairing\n\
+ 						%->\n\
+ 						md.stressbalance.vertex_pairing=[minX,maxX;minY,maxY];\n\
Index: /issm/oecreview/Archive/25834-26739/ISSM-26032-26033.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26032-26033.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26032-26033.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/examples/ISMIP/IsmipF.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 26032)
++++ ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 26033)
+@@ -30,7 +30,7 @@
+ %conversion from year to seconds with #md.constants.yts
+ %->
+ 
+-%one friciton exponent (p,q) per element
++%one friction exponent (p,q) per element
+ %->
+ 
+ %->
Index: /issm/oecreview/Archive/25834-26739/ISSM-26033-26034.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26033-26034.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26033-26034.diff	(revision 26740)
@@ -0,0 +1,8908 @@
+Index: ../trunk-jpl/Makefile.am
+===================================================================
+--- ../trunk-jpl/Makefile.am	(revision 26033)
++++ ../trunk-jpl/Makefile.am	(revision 26034)
+@@ -1,4 +1,4 @@
+-EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt 
++EXTRA_DIST = reconf scripts test m4 examples cron etc doc packages contributors.txt
+ SUBDIRS = src
+ bin_SCRIPTS= README.rtf
+ 
+Index: ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/Makefile	(revision 26034)
+@@ -0,0 +1,172 @@
++include make.inc
++
++#######################################################################
++#  This is the makefile to create a library for the BLAS.
++#  The files are grouped as follows:
++#
++#       SBLAS1 -- Single precision real BLAS routines
++#       CBLAS1 -- Single precision complex BLAS routines
++#       DBLAS1 -- Double precision real BLAS routines
++#       ZBLAS1 -- Double precision complex BLAS routines
++#
++#       CB1AUX -- Real BLAS routines called by complex routines
++#       ZB1AUX -- D.P. real BLAS routines called by d.p. complex
++#                 routines
++#
++#      ALLBLAS -- Auxiliary routines for Level 2 and 3 BLAS
++#
++#       SBLAS2 -- Single precision real BLAS2 routines
++#       CBLAS2 -- Single precision complex BLAS2 routines
++#       DBLAS2 -- Double precision real BLAS2 routines
++#       ZBLAS2 -- Double precision complex BLAS2 routines
++#
++#       SBLAS3 -- Single precision real BLAS3 routines
++#       CBLAS3 -- Single precision complex BLAS3 routines
++#       DBLAS3 -- Double precision real BLAS3 routines
++#       ZBLAS3 -- Double precision complex BLAS3 routines
++#
++#  The library can be set up to include routines for any combination
++#  of the four precisions.  To create or add to the library, enter make
++#  followed by one or more of the precisions desired.  Some examples:
++#       make single
++#       make single complex
++#       make single double complex complex16
++#  Note that these commands are not safe for parallel builds.
++#
++#  Alternatively, the commands
++#       make all
++#  or
++#       make
++#  without any arguments creates a library of all four precisions.
++#  The name of the library is held in BLASLIB, which is set in the
++#  make.inc
++#
++#  To remove the object files after the library is created, enter
++#       make clean
++#  To force the source files to be recompiled, enter, for example,
++#       make single FRC=FRC
++#
++#---------------------------------------------------------------------
++#
++#  Edward Anderson, University of Tennessee
++#  March 26, 1990
++#  Susan Ostrouchov,  September 30, 1994
++#  Julie Langou, March 2007
++#
++#######################################################################
++
++all: $(BLASLIB)
++ 
++#---------------------------------------------------------
++#  Comment out the next 6 definitions if you already have
++#  the Level 1 BLAS.
++#---------------------------------------------------------
++SBLAS1 = isamax.o sasum.o saxpy.o scopy.o sdot.o snrm2.o \
++	srot.o srotg.o sscal.o sswap.o sdsdot.o srotmg.o srotm.o
++$(SBLAS1): $(FRC)
++
++CBLAS1 = scabs1.o scasum.o scnrm2.o icamax.o caxpy.o ccopy.o \
++	cdotc.o cdotu.o csscal.o crotg.o cscal.o cswap.o csrot.o
++$(CBLAS1): $(FRC)
++
++DBLAS1 = idamax.o dasum.o daxpy.o dcopy.o ddot.o dnrm2.o \
++	drot.o drotg.o dscal.o dsdot.o dswap.o drotmg.o drotm.o
++$(DBLAS1): $(FRC)
++
++ZBLAS1 = dcabs1.o dzasum.o dznrm2.o izamax.o zaxpy.o zcopy.o \
++	zdotc.o zdotu.o zdscal.o zrotg.o zscal.o zswap.o zdrot.o
++$(ZBLAS1): $(FRC)
++
++CB1AUX = isamax.o sasum.o saxpy.o scopy.o snrm2.o sscal.o
++$(CB1AUX): $(FRC)
++
++ZB1AUX = idamax.o dasum.o daxpy.o dcopy.o dnrm2.o dscal.o
++$(ZB1AUX): $(FRC)
++
++#---------------------------------------------------------------------
++#  The following line defines auxiliary routines needed by both the
++#  Level 2 and Level 3 BLAS.  Comment it out only if you already have
++#  both the Level 2 and 3 BLAS.
++#---------------------------------------------------------------------
++ALLBLAS  = lsame.o xerbla.o
++$(ALLBLAS) : $(FRC)
++
++#---------------------------------------------------------
++#  Comment out the next 4 definitions if you already have
++#  the Level 2 BLAS.
++#---------------------------------------------------------
++SBLAS2 = sgemv.o sgbmv.o ssymv.o ssbmv.o sspmv.o \
++	strmv.o stbmv.o stpmv.o strsv.o stbsv.o stpsv.o \
++	sger.o ssyr.o sspr.o ssyr2.o sspr2.o
++$(SBLAS2): $(FRC)
++
++CBLAS2 = cgemv.o cgbmv.o chemv.o chbmv.o chpmv.o \
++	ctrmv.o ctbmv.o ctpmv.o ctrsv.o ctbsv.o ctpsv.o \
++	cgerc.o cgeru.o cher.o chpr.o cher2.o chpr2.o
++$(CBLAS2): $(FRC)
++
++DBLAS2 = dgemv.o dgbmv.o dsymv.o dsbmv.o dspmv.o \
++	dtrmv.o dtbmv.o dtpmv.o dtrsv.o dtbsv.o dtpsv.o \
++	dger.o dsyr.o dspr.o dsyr2.o dspr2.o
++$(DBLAS2): $(FRC)
++
++ZBLAS2 = zgemv.o zgbmv.o zhemv.o zhbmv.o zhpmv.o \
++	ztrmv.o ztbmv.o ztpmv.o ztrsv.o ztbsv.o ztpsv.o \
++	zgerc.o zgeru.o zher.o zhpr.o zher2.o zhpr2.o
++$(ZBLAS2): $(FRC)
++
++#---------------------------------------------------------
++#  Comment out the next 4 definitions if you already have
++#  the Level 3 BLAS.
++#---------------------------------------------------------
++SBLAS3 = sgemm.o ssymm.o ssyrk.o ssyr2k.o strmm.o strsm.o 
++$(SBLAS3): $(FRC)
++
++CBLAS3 = cgemm.o csymm.o csyrk.o csyr2k.o ctrmm.o ctrsm.o \
++	chemm.o cherk.o cher2k.o
++$(CBLAS3): $(FRC)
++
++DBLAS3 = dgemm.o dsymm.o dsyrk.o dsyr2k.o dtrmm.o dtrsm.o
++$(DBLAS3): $(FRC)
++
++ZBLAS3 = zgemm.o zsymm.o zsyrk.o zsyr2k.o ztrmm.o ztrsm.o \
++	zhemm.o zherk.o zher2k.o
++$(ZBLAS3): $(FRC)
++
++ALLOBJ=$(SBLAS1) $(SBLAS2) $(SBLAS3) $(DBLAS1) $(DBLAS2) $(DBLAS3) \
++	$(CBLAS1) $(CBLAS2) $(CBLAS3) $(ZBLAS1) \
++	$(ZBLAS2) $(ZBLAS3) $(ALLBLAS)
++
++$(BLASLIB): $(ALLOBJ)
++	$(FORTRAN) -shared -o $@ \
++		$(ALLOBJ) \
++		-Wl,--out-implib=$(IMP_LIB_NAME)
++
++single: $(SBLAS1) $(ALLBLAS) $(SBLAS2) $(SBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(SBLAS1) $(ALLBLAS) \
++	$(SBLAS2) $(SBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++double: $(DBLAS1) $(ALLBLAS) $(DBLAS2) $(DBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(DBLAS1) $(ALLBLAS) \
++	$(DBLAS2) $(DBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++complex: $(CBLAS1) $(CB1AUX) $(ALLBLAS) $(CBLAS2) $(CBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(CBLAS1) $(CB1AUX) \
++	$(ALLBLAS) $(CBLAS2) $(CBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++complex16: $(ZBLAS1) $(ZB1AUX) $(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(ZBLAS1) $(ZB1AUX) \
++	$(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++FRC:
++	@FRC=$(FRC)
++
++clean:
++	rm -f *.o
++
++.f.o: 
++	$(FORTRAN) $(OPTS) -c $< -o $@
+Index: ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/make.inc
+===================================================================
+--- ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/make.inc	(nonexistent)
++++ ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/make.inc	(revision 26034)
+@@ -0,0 +1,38 @@
++####################################################################
++#  BLAS make include file.                                         #
++#  March 2007                                                      #
++####################################################################
++#
++SHELL = /usr/bin/bash
++#
++#  The machine (platform) identifier to append to the library names
++#
++PLAT =
++#  
++#  Modify the FORTRAN and OPTS definitions to refer to the
++#  compiler and desired compiler options for your machine.  NOOPT
++#  refers to the compiler options desired when NO OPTIMIZATION is
++#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
++#  desired load options for your machine.
++#
++FORTRAN  = gfortran
++OPTS     = -O2 -fPIC
++DRVOPTS  = $(OPTS)
++NOOPT    = -O0 -fPIC
++LOADER   = gfortran
++LOADOPTS =
++#
++#  The archiver and the flag(s) to use when building archive (library)
++#  If you system has no ranlib, set RANLIB = echo.
++#
++ARCH     = ar
++ARCHFLAGS= cr
++RANLIB   = ranlib
++
++MODULE			= blas
++IMP_LIB_NAME	= lib$(MODULE).dll.a
++LIB_NAME		= msys-$(MODULE).dll
++#
++#  The location and name of the Reference BLAS library.
++#
++BLASLIB = $(LIB_NAME)
+Index: ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/Makefile	(revision 26034)
+@@ -0,0 +1,172 @@
++include make.inc
++
++#######################################################################
++#  This is the makefile to create a library for the BLAS.
++#  The files are grouped as follows:
++#
++#       SBLAS1 -- Single precision real BLAS routines
++#       CBLAS1 -- Single precision complex BLAS routines
++#       DBLAS1 -- Double precision real BLAS routines
++#       ZBLAS1 -- Double precision complex BLAS routines
++#
++#       CB1AUX -- Real BLAS routines called by complex routines
++#       ZB1AUX -- D.P. real BLAS routines called by d.p. complex
++#                 routines
++#
++#      ALLBLAS -- Auxiliary routines for Level 2 and 3 BLAS
++#
++#       SBLAS2 -- Single precision real BLAS2 routines
++#       CBLAS2 -- Single precision complex BLAS2 routines
++#       DBLAS2 -- Double precision real BLAS2 routines
++#       ZBLAS2 -- Double precision complex BLAS2 routines
++#
++#       SBLAS3 -- Single precision real BLAS3 routines
++#       CBLAS3 -- Single precision complex BLAS3 routines
++#       DBLAS3 -- Double precision real BLAS3 routines
++#       ZBLAS3 -- Double precision complex BLAS3 routines
++#
++#  The library can be set up to include routines for any combination
++#  of the four precisions.  To create or add to the library, enter make
++#  followed by one or more of the precisions desired.  Some examples:
++#       make single
++#       make single complex
++#       make single double complex complex16
++#  Note that these commands are not safe for parallel builds.
++#
++#  Alternatively, the commands
++#       make all
++#  or
++#       make
++#  without any arguments creates a library of all four precisions.
++#  The name of the library is held in BLASLIB, which is set in the
++#  make.inc
++#
++#  To remove the object files after the library is created, enter
++#       make clean
++#  To force the source files to be recompiled, enter, for example,
++#       make single FRC=FRC
++#
++#---------------------------------------------------------------------
++#
++#  Edward Anderson, University of Tennessee
++#  March 26, 1990
++#  Susan Ostrouchov,  September 30, 1994
++#  Julie Langou, March 2007
++#
++#######################################################################
++
++all: $(BLASLIB)
++ 
++#---------------------------------------------------------
++#  Comment out the next 6 definitions if you already have
++#  the Level 1 BLAS.
++#---------------------------------------------------------
++SBLAS1 = isamax.o sasum.o saxpy.o scopy.o sdot.o snrm2.o \
++	srot.o srotg.o sscal.o sswap.o sdsdot.o srotmg.o srotm.o
++$(SBLAS1): $(FRC)
++
++CBLAS1 = scabs1.o scasum.o scnrm2.o icamax.o caxpy.o ccopy.o \
++	cdotc.o cdotu.o csscal.o crotg.o cscal.o cswap.o csrot.o
++$(CBLAS1): $(FRC)
++
++DBLAS1 = idamax.o dasum.o daxpy.o dcopy.o ddot.o dnrm2.o \
++	drot.o drotg.o dscal.o dsdot.o dswap.o drotmg.o drotm.o
++$(DBLAS1): $(FRC)
++
++ZBLAS1 = dcabs1.o dzasum.o dznrm2.o izamax.o zaxpy.o zcopy.o \
++	zdotc.o zdotu.o zdscal.o zrotg.o zscal.o zswap.o zdrot.o
++$(ZBLAS1): $(FRC)
++
++CB1AUX = isamax.o sasum.o saxpy.o scopy.o snrm2.o sscal.o
++$(CB1AUX): $(FRC)
++
++ZB1AUX = idamax.o dasum.o daxpy.o dcopy.o dnrm2.o dscal.o
++$(ZB1AUX): $(FRC)
++
++#---------------------------------------------------------------------
++#  The following line defines auxiliary routines needed by both the
++#  Level 2 and Level 3 BLAS.  Comment it out only if you already have
++#  both the Level 2 and 3 BLAS.
++#---------------------------------------------------------------------
++ALLBLAS  = lsame.o xerbla.o
++$(ALLBLAS) : $(FRC)
++
++#---------------------------------------------------------
++#  Comment out the next 4 definitions if you already have
++#  the Level 2 BLAS.
++#---------------------------------------------------------
++SBLAS2 = sgemv.o sgbmv.o ssymv.o ssbmv.o sspmv.o \
++	strmv.o stbmv.o stpmv.o strsv.o stbsv.o stpsv.o \
++	sger.o ssyr.o sspr.o ssyr2.o sspr2.o
++$(SBLAS2): $(FRC)
++
++CBLAS2 = cgemv.o cgbmv.o chemv.o chbmv.o chpmv.o \
++	ctrmv.o ctbmv.o ctpmv.o ctrsv.o ctbsv.o ctpsv.o \
++	cgerc.o cgeru.o cher.o chpr.o cher2.o chpr2.o
++$(CBLAS2): $(FRC)
++
++DBLAS2 = dgemv.o dgbmv.o dsymv.o dsbmv.o dspmv.o \
++	dtrmv.o dtbmv.o dtpmv.o dtrsv.o dtbsv.o dtpsv.o \
++	dger.o dsyr.o dspr.o dsyr2.o dspr2.o
++$(DBLAS2): $(FRC)
++
++ZBLAS2 = zgemv.o zgbmv.o zhemv.o zhbmv.o zhpmv.o \
++	ztrmv.o ztbmv.o ztpmv.o ztrsv.o ztbsv.o ztpsv.o \
++	zgerc.o zgeru.o zher.o zhpr.o zher2.o zhpr2.o
++$(ZBLAS2): $(FRC)
++
++#---------------------------------------------------------
++#  Comment out the next 4 definitions if you already have
++#  the Level 3 BLAS.
++#---------------------------------------------------------
++SBLAS3 = sgemm.o ssymm.o ssyrk.o ssyr2k.o strmm.o strsm.o 
++$(SBLAS3): $(FRC)
++
++CBLAS3 = cgemm.o csymm.o csyrk.o csyr2k.o ctrmm.o ctrsm.o \
++	chemm.o cherk.o cher2k.o
++$(CBLAS3): $(FRC)
++
++DBLAS3 = dgemm.o dsymm.o dsyrk.o dsyr2k.o dtrmm.o dtrsm.o
++$(DBLAS3): $(FRC)
++
++ZBLAS3 = zgemm.o zsymm.o zsyrk.o zsyr2k.o ztrmm.o ztrsm.o \
++	zhemm.o zherk.o zher2k.o
++$(ZBLAS3): $(FRC)
++
++ALLOBJ=$(SBLAS1) $(SBLAS2) $(SBLAS3) $(DBLAS1) $(DBLAS2) $(DBLAS3) \
++	$(CBLAS1) $(CBLAS2) $(CBLAS3) $(ZBLAS1) \
++	$(ZBLAS2) $(ZBLAS3) $(ALLBLAS)
++
++$(BLASLIB): $(ALLOBJ)
++	$(FORTRAN) -shared -o $@ \
++		$(ALLOBJ) \
++		-Wl,--out-implib=$(IMP_LIB_NAME)
++
++single: $(SBLAS1) $(ALLBLAS) $(SBLAS2) $(SBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(SBLAS1) $(ALLBLAS) \
++	$(SBLAS2) $(SBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++double: $(DBLAS1) $(ALLBLAS) $(DBLAS2) $(DBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(DBLAS1) $(ALLBLAS) \
++	$(DBLAS2) $(DBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++complex: $(CBLAS1) $(CB1AUX) $(ALLBLAS) $(CBLAS2) $(CBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(CBLAS1) $(CB1AUX) \
++	$(ALLBLAS) $(CBLAS2) $(CBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++complex16: $(ZBLAS1) $(ZB1AUX) $(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
++	$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(ZBLAS1) $(ZB1AUX) \
++	$(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
++	$(RANLIB) $(BLASLIB)
++
++FRC:
++	@FRC=$(FRC)
++
++clean:
++	rm -f *.o
++
++.f.o: 
++	$(FORTRAN) $(OPTS) -c $< -o $@
+Index: ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/make.inc
+===================================================================
+--- ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/make.inc	(nonexistent)
++++ ../trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/make.inc	(revision 26034)
+@@ -0,0 +1,38 @@
++####################################################################
++#  BLAS make include file.                                         #
++#  March 2007                                                      #
++####################################################################
++#
++SHELL = /usr/bin/bash
++#
++#  The machine (platform) identifier to append to the library names
++#
++PLAT =
++#  
++#  Modify the FORTRAN and OPTS definitions to refer to the
++#  compiler and desired compiler options for your machine.  NOOPT
++#  refers to the compiler options desired when NO OPTIMIZATION is
++#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
++#  desired load options for your machine.
++#
++FORTRAN  = gfortran
++OPTS     = -O2 -fPIC
++DRVOPTS  = $(OPTS)
++NOOPT    = -O0 -fPIC
++LOADER   = gfortran
++LOADOPTS =
++#
++#  The archiver and the flag(s) to use when building archive (library)
++#  If you system has no ranlib, set RANLIB = echo.
++#
++ARCH     = ar
++ARCHFLAGS= cr
++RANLIB   = ranlib
++
++MODULE			= blas
++IMP_LIB_NAME	= lib$(MODULE).dll.a
++LIB_NAME		= msys-$(MODULE).dll
++#
++#  The location and name of the Reference BLAS library.
++#
++BLASLIB = $(LIB_NAME)
+Index: ../trunk-jpl/externalpackages/blas/install-3-win-msys2-gcc.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/blas/install-3-win-msys2-gcc.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/blas/install-3-win-msys2-gcc.sh	(revision 26034)
+@@ -0,0 +1,44 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++VER=3.8.0
++
++PREFIX="${ISSM_DIR}/externalpackages/blas/install"
++
++MODULE="blas"
++IMP_LIB_NAME="lib${MODULE}.dll.a"
++LIB_NAME="msys-${MODULE}.dll"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/blas-${VER}.tgz" "blas-${VER}.tgz"
++
++# Unpack source
++tar -zxvf blas-${VER}.tgz
++
++# Move source into 'src' directory
++mv BLAS-${VER}/* src
++rm -rf BLAS-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/3.8/win/msys2/gcc/make.inc src
++cp configs/3.8/win/msys2/gcc/Makefile src
++
++# Compile
++cd src
++make
++
++# Install
++mkdir ${PREFIX}/lib
++cp ${IMP_LIB_NAME} ${PREFIX}/lib
++cp ${LIB_NAME} ${PREFIX}/lib
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s ./${LIB_NAME} ./libblas.dll
+
+Property changes on: ../trunk-jpl/externalpackages/blas/install-3-win-msys2-gcc.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/blas/install-3-win-msys2-mingw.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/blas/install-3-win-msys2-mingw.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/blas/install-3-win-msys2-mingw.sh	(revision 26034)
+@@ -0,0 +1,44 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++VER=3.8.0
++
++PREFIX="${ISSM_DIR}/externalpackages/blas/install"
++
++MODULE="blas"
++IMP_LIB_NAME="lib${MODULE}.dll.a"
++LIB_NAME="msys-${MODULE}.dll"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/blas-${VER}.tgz" "blas-${VER}.tgz"
++
++# Unpack source
++tar -zxvf blas-${VER}.tgz
++
++# Move source into 'src' directory
++mv BLAS-${VER}/* src
++rm -rf BLAS-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/3.8/win/msys2/mingw/make.inc src
++cp configs/3.8/win/msys2/mingw/Makefile src
++
++# Compile
++cd src
++make
++
++# Install
++mkdir ${PREFIX}/lib
++cp ${IMP_LIB_NAME} ${PREFIX}/lib
++cp ${LIB_NAME} ${PREFIX}/lib
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s ./${LIB_NAME} ./libblas.dll
+
+Property changes on: ../trunk-jpl/externalpackages/blas/install-3-win-msys2-mingw.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main/interface.c
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main/interface.c	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main/interface.c	(revision 26034)
+@@ -0,0 +1,234 @@
++/* This software was developed by Bruce Hendrickson and Robert Leland   *
++ * at Sandia National Laboratories under US Department of Energy        *
++ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
++
++#include <stdio.h>
++#include "defs.h"
++#include "structs.h"
++
++int       Using_Main = FALSE;	/* Is main routine being called? */
++
++int       interface(nvtxs, start, adjacency, vwgts, ewgts, x, y, z,
++		              outassignname, outfilename,
++		              assignment,
++		              architecture, ndims_tot, mesh_dims, goal,
++		              global_method, local_method, rqi_flag, vmax, ndims,
++		              eigtol, seed)
++int       nvtxs;		/* number of vertices in full graph */
++int      *start;		/* start of edge list for each vertex */
++int      *adjacency;		/* edge list data */
++int      *vwgts;		/* weights for all vertices */
++float    *ewgts;		/* weights for all edges */
++float    *x, *y, *z;		/* coordinates for inertial method */
++char     *outassignname;	/* name of assignment output file */
++char     *outfilename;		/* output file name */
++short    *assignment;		/* set number of each vtx (length n) */
++int       architecture;		/* 0 => hypercube, d => d-dimensional mesh */
++int       ndims_tot;		/* total number of cube dimensions to divide */
++int       mesh_dims[3];		/* dimensions of mesh of processors */
++double   *goal;			/* desired set sizes for each set */
++int       global_method;	/* global partitioning algorithm */
++int       local_method;		/* local partitioning algorithm */
++int       rqi_flag;		/* should I use RQI/Symmlq eigensolver? */
++int       vmax;			/* how many vertices to coarsen down to? */
++int       ndims;		/* number of eigenvectors (2^d sets) */
++double    eigtol;		/* tolerance on eigenvectors */
++long      seed;			/* for random graph mutations */
++{
++    extern char *PARAMS_FILENAME;	/* name of file with parameter updates */
++    extern int MAKE_VWGTS;	/* make vertex weights equal to degrees? */
++    extern int MATCH_TYPE;      /* matching routine to use */
++    extern int FREE_GRAPH;	/* free graph data structure after reformat? */
++    extern int DEBUG_PARAMS;	/* debug flag for reading parameters */
++    extern int DEBUG_TRACE;	/* trace main execution path */
++    extern double start_time;	/* time routine is entered */
++    extern double reformat_time;/* time spent reformatting graph */
++    FILE     *params_file;	/* file for reading new parameters */
++    struct vtx_data **graph;	/* graph data structure */
++    double    vwgt_sum;		/* sum of vertex weights */
++    double    time;		/* timing variable */
++    float   **coords;		/* coordinates for vertices if used */
++    int      *vptr;		/* loops through vertex weights */
++    int       flag;		/* return code from balance */
++    int       nedges;		/* number of edges in graph */
++    int       using_vwgts;	/* are vertex weights being used? */
++    int       using_ewgts;	/* are edge weights being used? */
++    int       nsets_tot;	/* total number of sets being created */
++    int       igeom;		/* geometric dimension for inertial method */
++    int       default_goal;	/* using default goals? */
++    int       i;		/* loop counter */
++    double    seconds();
++    double   *smalloc_ret();
++    int       sfree(), submain(), reformat();
++    void      free_graph(), read_params(), strout();
++
++    if (DEBUG_TRACE > 0) {
++	printf("<Entering interface>\n");
++    }
++
++    flag = 0;
++    graph = NULL;
++    coords = NULL;
++
++    if (!Using_Main) {		/* If not using main, need to read parameters file. */
++	start_time = seconds();
++	params_file = fopen(PARAMS_FILENAME, "r");
++	if (params_file == NULL && DEBUG_PARAMS > 1) {
++	    printf("Parameter file `%s' not found; using default parameters.\n",
++		   PARAMS_FILENAME);
++	}
++	read_params(params_file);
++    }
++
++    if (goal == NULL) {	/* If not passed in, default goals have equal set sizes. */
++	default_goal = TRUE;
++	if (architecture == 0)
++	    nsets_tot = 1 << ndims_tot;
++	else if (architecture == 1) 
++	    nsets_tot = mesh_dims[0];
++	else if (architecture == 2) 
++	    nsets_tot = mesh_dims[0] * mesh_dims[1];
++	else if (architecture > 2) 
++	    nsets_tot = mesh_dims[0] * mesh_dims[1] * mesh_dims[2];
++
++	if (MAKE_VWGTS && start != NULL) {
++	    vwgt_sum = start[nvtxs] - start[0] + nvtxs;
++	}
++	else if (vwgts == NULL) {
++	    vwgt_sum = nvtxs;
++	}
++	else {
++	    vwgt_sum = 0;
++	    vptr = vwgts;
++	    for (i = nvtxs; i; i--)
++		vwgt_sum += *(vptr++);
++	}
++
++	vwgt_sum /= nsets_tot;
++	goal = (double *) smalloc_ret((unsigned) nsets_tot * sizeof(double));
++	if (goal == NULL) {
++	    strout("\nERROR: No room to make goals.\n");
++	    flag = 1;
++	    goto skip;
++	}
++	for (i = 0; i < nsets_tot; i++)
++	    goal[i] = vwgt_sum;
++    }
++    else {
++	default_goal = FALSE;
++    }
++
++    if (MAKE_VWGTS) {
++	/* Generate vertex weights equal to degree of node. */
++	if (vwgts != NULL) {
++	    strout("WARNING: Vertex weights being overwritten by vertex degrees.");
++	}
++	vwgts = (int *) smalloc_ret((unsigned) nvtxs * sizeof(int));
++	if (vwgts == NULL) {
++	    strout("\nERROR: No room to make vertex weights.\n");
++	    flag = 1;
++	    goto skip;
++	}
++	if (start != NULL) {
++	    for (i = 0; i < nvtxs; i++)
++	        vwgts[i] = 1 + start[i + 1] - start[i];
++	}
++	else {
++	    for (i = 0; i < nvtxs; i++)
++	        vwgts[i] = 1;
++	}
++    }
++
++    using_vwgts = (vwgts != NULL);
++    using_ewgts = (ewgts != NULL);
++
++    if (start != NULL || vwgts != NULL) {	/* Reformat into our data structure. */
++	time = seconds();
++	flag = reformat(start, adjacency, nvtxs, &nedges, vwgts, ewgts, &graph);
++
++	if (flag) {
++	    strout("\nERROR: No room to reformat graph.\n");
++	    goto skip;
++	}
++
++	reformat_time += seconds() - time;
++    }
++    else {
++	nedges = 0;
++    }
++
++    if (FREE_GRAPH) {		/* Free old graph data structures. */
++	sfree((char *) start);
++	sfree((char *) adjacency);
++	if (vwgts != NULL)
++	    sfree((char *) vwgts);
++	if (ewgts != NULL)
++	    sfree((char *) ewgts);
++	start = NULL;
++	adjacency = NULL;
++	vwgts = NULL;
++	ewgts = NULL;
++    }
++
++
++    if (global_method == 3 ||
++        (MATCH_TYPE == 5 && (global_method == 1 || 
++			     (global_method == 2 && rqi_flag)))) {
++	if (x == NULL) {
++	    igeom = 0;
++	}
++	else {			/* Set up coordinate data structure. */
++	    coords = (float **) smalloc_ret((unsigned) 3 * sizeof(float *));
++	    if (coords == NULL) {
++		strout("\nERROR: No room to make coordinate array.\n");
++		flag = 1;
++		goto skip;
++	    }
++	    /* Minus 1's are to allow remainder of program to index with 1. */
++	    coords[0] = x - 1;
++	    igeom = 1;
++	    if (y != NULL) {
++		coords[1] = y - 1;
++		igeom = 2;
++		if (z != NULL) {
++		    coords[2] = z - 1;
++		    igeom = 3;
++		}
++	    }
++	}
++    }
++    else {
++	igeom = 0;
++    }
++
++    /* Subtract from assignment to allow code to index from 1. */
++    assignment = assignment - 1;
++    flag = submain(graph, nvtxs, nedges, using_vwgts, using_ewgts, igeom, coords,
++		   outassignname, outfilename,
++		   assignment, goal,
++		   architecture, ndims_tot, mesh_dims,
++		   global_method, local_method, rqi_flag, vmax, ndims,
++		   eigtol, seed);
++
++skip:
++    if (coords != NULL)
++	sfree((char *) coords);
++
++    if (default_goal)
++	sfree((char *) goal);
++
++    if (graph != NULL)
++	free_graph(graph);
++
++    if (flag && FREE_GRAPH) {
++	sfree((char *) start);
++	sfree((char *) adjacency);
++	sfree((char *) vwgts);
++	sfree((char *) ewgts);
++    }
++
++    if (!Using_Main && params_file != NULL)
++	fclose(params_file);
++
++    return (flag);
++}
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/bail.c
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/bail.c	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/bail.c	(revision 26034)
+@@ -0,0 +1,27 @@
++/* This software was developed by Bruce Hendrickson and Robert Leland   *
++ * at Sandia National Laboratories under US Department of Energy        *
++ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
++
++#include	<stdlib.h>
++#include	<stdio.h>
++#include	<string.h>
++#include	"defs.h"
++
++/* Wrapper for exit() - print message and exit with status code. Exit code
++   of 0 indicates normal termination. Exit code of 1 indicates early 
++   termination following detection of some problem. Call with bail(NULL,status) 
++   to suppress message. */ 
++void      bail(msg, status)
++char     *msg;
++int       status;
++{
++    extern FILE *Output_File;		/* Output file or NULL */
++
++    if (msg != NULL && (int) strlen(msg) > 0) {
++        printf("%s\n", msg);
++	if (Output_File != NULL) {
++            fprintf(Output_File, "%s\n", msg);
++	}
++    }
++    exit(status);
++}
+Index: ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-gcc.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-gcc.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-gcc.sh	(revision 26034)
+@@ -0,0 +1,49 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++VER="3.9.0"
++
++PREFIX="${ISSM_DIR}/externalpackages/lapack/install"
++
++# Cleanup
++rm -rf ${PREFIX} build src
++mkdir ${PREFIX} build src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/lapack-${VER}.tar.gz" "lapack-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf lapack-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv lapack-${VER}/* src
++rm -rf lapack-${VER}
++
++# Configure
++#
++cd build
++cmake \
++	-DBUILD_SHARED_LIBS=ON \
++	-DCMAKE_C_COMPILER=/usr/bin/gcc \
++	-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
++	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
++	../src
++
++# Compile
++make
++
++# Copy libraries to lib directory (on Windows, CMake installs .dll files next
++# to the .exe files that need them, making tests easy to run, so let's not 
++# change the CMake configuration).
++mkdir ${PREFIX}/lib
++cp bin/msys-* ${PREFIX}/lib
++
++# Create link to versioned library
++cd ${PREFIX}/lib
++ln -s msys-lapack-3.dll msys-lapack.dll
++
++# Create link to shared version of library so that libtool can find it
++ln -s msys-lapack-3.dll liblapack.dll
+
+Property changes on: ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-gcc.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-mingw.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-mingw.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-mingw.sh	(revision 26034)
+@@ -0,0 +1,54 @@
++#!/bin/bash
++set -eu
++
++
++# TODO:
++# - Modify configuration/makefiles so that dll rather than so is produced.
++#
++
++## Constants
++#
++VER="3.9.0"
++
++PREFIX="${ISSM_DIR}/externalpackages/lapack/install"
++
++# Cleanup
++rm -rf ${PREFIX} build src
++mkdir ${PREFIX} build src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/lapack-${VER}.tar.gz" "lapack-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf lapack-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv lapack-${VER}/* src
++rm -rf lapack-${VER}
++
++# Configure
++#
++cd build
++cmake \
++	-DBUILD_SHARED_LIBS=ON \
++	-DCMAKE_C_COMPILER=/mingw64/bin/gcc \
++	-DCMAKE_Fortran_COMPILER=/mingw64/bin/gfortran \
++	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
++	../src
++
++# Compile
++make
++
++# Copy libraries to lib directory (on Windows, CMake installs .dll files next
++# to the .exe files that need them, making tests easy to run, so let's not 
++# change the CMake configuration).
++mkdir ${PREFIX}/lib
++cp lib/liblapack.* ${PREFIX}/lib
++
++# # Create link to versioned library
++# cd ${PREFIX}/lib
++# ln -s msys-lapack-3.dll msys-lapack.dll
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s liblapack.so liblapack.dll
+
+Property changes on: ../trunk-jpl/externalpackages/lapack/install-3-win-msys2-mingw.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_arch.h
+===================================================================
+--- ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_arch.h	(nonexistent)
++++ ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_arch.h	(revision 26034)
+@@ -0,0 +1,73 @@
++/*!
++\file gk_arch.h
++\brief This file contains various architecture-specific declerations
++
++\date   Started 3/27/2007
++\author George
++\version\verbatim $Id: gk_arch.h 10711 2011-08-31 22:23:04Z karypis $ \endverbatim
++*/
++
++#ifndef _GK_ARCH_H_
++#define _GK_ARCH_H_
++
++/*************************************************************************
++* Architecture-specific differences in header files
++**************************************************************************/
++#ifdef LINUX
++#if !defined(__USE_XOPEN)
++#define __USE_XOPEN
++#endif
++#if !defined(_XOPEN_SOURCE)
++#define _XOPEN_SOURCE 600
++#endif
++#if !defined(__USE_XOPEN2K)
++#define __USE_XOPEN2K
++#endif
++#endif
++
++
++#ifdef HAVE_EXECINFO_H
++#include <execinfo.h>
++#endif
++
++
++#ifdef __MSC__ 
++  #include "ms_stdint.h"
++  #include "ms_inttypes.h"
++  #include "ms_stat.h"
++#else
++#ifndef SUNOS
++  #include <stdint.h>
++#endif
++  #include <inttypes.h>
++  #include <sys/types.h>
++  #ifndef __MINGW32__
++  #include <sys/resource.h>
++  #endif
++  #include <sys/time.h>
++#endif
++
++
++/*************************************************************************
++* Architecture-specific modifications
++**************************************************************************/
++#ifdef WIN32
++typedef ptrdiff_t ssize_t;
++#endif
++
++
++#ifdef SUNOS
++#define PTRDIFF_MAX  INT64_MAX
++#endif
++
++#ifdef __MSC__
++/* MSC does not have rint() function */
++#define rint(x) ((int)((x)+0.5))  
++
++/* MSC does not have INFINITY defined */
++#ifndef INFINITY
++#define INFINITY FLT_MAX
++#endif
++#endif
++
++#endif
+Index: ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_getopt.h
+===================================================================
+--- ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_getopt.h	(nonexistent)
++++ ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk_getopt.h	(revision 26034)
+@@ -0,0 +1,53 @@
++/*!
++\file gk_getopt.h
++\brief This file contains GNU's externs/structs/prototypes
++
++\date   Started 3/27/2007
++\author George
++\version\verbatim $Id: gk_getopt.h 10711 2011-08-31 22:23:04Z karypis $ \endverbatim
++*/
++
++#ifndef _GK_GETOPT_H_
++#define _GK_GETOPT_H_
++
++
++/* Externals from getopt.c */
++extern char *gk_optarg;
++extern int gk_optind;
++extern int gk_opterr;
++extern int gk_optopt;
++
++
++/*! \brief The structure that stores the information about the command-line options 
++
++This structure describes a single long option name for the sake of 
++gk_getopt_long(). The argument <tt>long_options</tt> must be an array 
++of these structures, one for each long option. Terminate the array with 
++an element containing all zeros.
++*/
++struct gk_option {
++  char *name;       /*!< This field is the name of the option. */
++  int has_arg;      /*!< This field says whether the option takes an argument. 
++                         It is an integer, and there are three legitimate values: 
++                         no_argument, required_argument and optional_argument. 
++                         */
++  int *flag;        /*!< See the discussion on ::gk_option#val */
++  int val;          /*!< These fields control how to report or act on the option 
++                         when it occurs. 
++                         
++                         If flag is a null pointer, then the val is a value which 
++                         identifies this option. Often these values are chosen 
++                         to uniquely identify particular long options.
++
++                         If flag is not a null pointer, it should be the address 
++                         of an int variable which is the flag for this option. 
++                         The value in val is the value to store in the flag to 
++                         indicate that the option was seen. */
++};
++
++/* Names for the values of the `has_arg' field of `struct gk_option'.  */
++#define no_argument		0
++#define required_argument	1
++#define optional_argument	2
++
++#endif
+Index: ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/Makefile	(revision 26034)
+@@ -0,0 +1,133 @@
++# Configuration options.
++gdb        = not-set
++assert     = not-set
++assert2    = not-set
++debug      = not-set
++gprof      = not-set
++openmp     = not-set
++prefix     = not-set
++gklib_path = not-set
++windows    = not-set
++shared     = not-set
++cc         = not-set
++cxx        = not-set
++ar         = not-set
++gcc-ar     = not-set
++ranlib     = not-set
++gcc-ranlib = not-set
++linker     = not-set
++nm         = not-set
++objcopy    = not-set
++objdump    = not-set
++rc         = not-set
++strip      = not-set
++
++
++# Basically proxies everything to the builddir cmake.
++
++cputype = $(shell uname -m | sed "s/\\ /_/g")
++systype = $(shell uname -s)
++
++BUILDDIR = build/$(systype)-$(cputype)
++
++# Process configuration options.
++CONFIG_FLAGS = -DCMAKE_VERBOSE_MAKEFILE=1
++ifeq ($(gklib_path), not-set)
++    gklib_path = GKlib
++endif
++CONFIG_FLAGS += -DGKLIB_PATH=$(abspath $(gklib_path))
++ifneq ($(gdb), not-set)
++    CONFIG_FLAGS += -DGDB=$(gdb)
++endif
++ifneq ($(assert), not-set)
++    CONFIG_FLAGS += -DASSERT=$(assert)
++endif
++ifneq ($(assert2), not-set)
++    CONFIG_FLAGS += -DASSERT2=$(assert2)
++endif
++ifneq ($(debug), not-set)
++    CONFIG_FLAGS += -DDEBUG=$(debug)
++endif
++ifneq ($(gprof), not-set)
++    CONFIG_FLAGS += -DGPROF=$(gprof)
++endif
++ifneq ($(openmp), not-set)
++    CONFIG_FLAGS += -DOPENMP=$(openmp)
++endif
++ifneq ($(prefix), not-set)
++    CONFIG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix)
++endif
++ifneq ($(windows), not-set)
++    CONFIG_FLAGS += -DMSVC=0
++endif
++ifneq ($(shared), not-set)
++    CONFIG_FLAGS += -DSHARED=1 -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-undefined
++endif
++ifneq ($(cc), not-set)
++    CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc)
++endif
++ifneq ($(cxx), not-set)
++    CONFIG_FLAGS += -DCMAKE_CXX_COMPILER=$(cxx)
++endif
++ifneq ($(ar), not-set)
++    CONFIG_FLAGS += -DCMAKE_AR=$(ar)
++endif
++ifneq ($(gcc-ar), not-set)
++    CONFIG_FLAGS += -DCMAKE_C_COMPILER_AR=$(gcc-ar) -DCMAKE_CXX_COMPILER_AR=$(gcc-ar)
++endif
++ifneq ($(ranlib), not-set)
++    CONFIG_FLAGS += -DCMAKE_RANLIB=$(ranlib)
++endif
++ifneq ($(gcc-ranlib), not-set)
++    CONFIG_FLAGS += -DCMAKE_C_COMPILER_RANLIB=$(gcc-ranlib) -DCMAKE_CXX_COMPILER_RANLIB=$(gcc-ranlib)
++endif
++ifneq ($(linker), not-set)
++    CONFIG_FLAGS += -DCMAKE_LINKER=$(linker)
++endif
++ifneq ($(nm), not-set)
++    CONFIG_FLAGS += -DCMAKE_NM=$(nm)
++endif
++ifneq ($(objcopy), not-set)
++    CONFIG_FLAGS += -DCMAKE_OBJCOPY=$(objcopy)
++endif
++ifneq ($(objdump), not-set)
++    CONFIG_FLAGS += -DCMAKE_OBJDUMP=$(objdump)
++endif
++ifneq ($(rc), not-set)
++    CONFIG_FLAGS += -DCMAKE_RC_COMPILER=$(rc)
++endif
++ifneq ($(strip), not-set)
++    CONFIG_FLAGS += -DCMAKE_STRIP=$(strip)
++endif
++
++VERNUM=5.1.0
++PKGNAME=metis-$(VERNUM)
++
++define run-config
++mkdir -p $(BUILDDIR)
++cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS)
++endef
++
++all clean install:
++	@if [ ! -f $(BUILDDIR)/Makefile ]; then \
++		more BUILD.txt; \
++	else \
++	  	make -C $(BUILDDIR) $@ $(MAKEFLAGS); \
++	fi
++
++uninstall:
++	xargs rm < $(BUILDDIR)/install_manifest.txt
++
++config: distclean
++	$(run-config)
++
++distclean:
++	rm -rf $(BUILDDIR)
++
++remake:
++	find . -name CMakeLists.txt -exec touch {} ';'
++
++dist:
++	utils/mkdist.sh $(PKGNAME)
++
++.PHONY: config distclean all clean install uninstall remake dist
+Index: ../trunk-jpl/externalpackages/metis/install-5-win-msys2-gcc.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/metis/install-5-win-msys2-gcc.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/metis/install-5-win-msys2-gcc.sh	(revision 26034)
+@@ -0,0 +1,68 @@
++#!/bin/bash
++set -eu
++
++
++# TODO
++# - Move installation of GKlib to $PREFIX to Makefile instead of simply copying 
++#	it
++#
++
++## Constants
++#
++VER=5.1.0
++
++PREFIX="${ISSM_DIR}/externalpackages/metis/install"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/metis-${VER}.tar.gz" "metis-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf metis-$VER.tar.gz
++
++# Move source into 'src' directory
++mv metis-${VER}/* src
++rm -rf metis-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/5.1/win/msys2/Makefile src
++cp configs/5.1/win/msys2/gcc/GKlib/gk_arch.h src/GKlib
++cp configs/5.1/win/msys2/gcc/GKlib/gk_getopt.h src/GKlib
++
++# Configure
++cd src
++make config \
++	prefix=${PREFIX} \
++	shared=1 \
++	cc=/usr/bin/gcc \
++	cxx=/usr/bin/g++
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++
++# Install GKlib
++cp -R GKlib ${PREFIX}
++
++# Create link to shared version of library so that libtool can find it
++#
++# NOTE: MSYS2 needs to be run as administrator for this to work.
++#
++cd ${PREFIX}/lib
++ln -s ./msys-metis.dll ./libmetis.dll
++
++# Create link to lib directory (PETSc, by default, looks for libraries in 
++# lib64/ if it detects that 64-bit integers are being used)
++#
++# NOTE: MSYS2 needs to be run as administrator for this to work.
++#
++cd ${PREFIX}
++ln -s ./lib ./lib64
+
+Property changes on: ../trunk-jpl/externalpackages/metis/install-5-win-msys2-gcc.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/metis/install-5-win-msys2-mingw.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/metis/install-5-win-msys2-mingw.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/metis/install-5-win-msys2-mingw.sh	(revision 26034)
+@@ -0,0 +1,65 @@
++#!/bin/bash
++set -eu
++
++
++# TODO
++# - Move installation of GKlib to $PREFIX to Makefile instead of simply copying 
++#	it
++#
++
++## Constants
++#
++VER=5.1.0
++
++PREFIX="${ISSM_DIR}/externalpackages/metis/install"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/metis-${VER}.tar.gz" "metis-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf metis-$VER.tar.gz
++
++# Move source into 'src' directory
++mv metis-${VER}/* src
++rm -rf metis-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/5.1/win/msys2/Makefile src
++cp configs/5.1/win/msys2/GKlib/gk_arch.h src/GKlib
++cp configs/5.1/win/msys2/GKlib/gk_getopt.h src/GKlib
++
++# Configure
++cd src
++make config \
++	prefix=${PREFIX} \
++	shared=1 \
++	cc=/mingw64/bin/gcc \
++	cxx=/mingw64/bin/g++
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++
++# Install GKlib
++cp -R GKlib ${PREFIX}
++
++# Create link to lib directory (PETSc, by default, looks for libraries in 
++# lib64/ if it detects that 64-bit integers are being used)
++#
++# NOTE: MSYS2 needs to be run as administrator for this to work.
++#
++cd ${PREFIX}
++ln -s ./lib ./lib64
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s libmetis.so libmetis.dll
+
+Property changes on: ../trunk-jpl/externalpackages/metis/install-5-win-msys2-mingw.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/Makefile.inc
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/Makefile.inc	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/Makefile.inc	(revision 26034)
+@@ -0,0 +1,189 @@
++#
++#  This file is part of MUMPS 5.3.5, released
++#  on Thu Oct 22 09:29:08 UTC 2020
++#
++################################################################################
++#
++#   Makefile.inc.generic
++#
++#   This defines some parameters dependent on your platform; you should
++#   look for the approriate file in the directory ./Make.inc/ and copy it
++#   into a file called Makefile.inc. For example, from the MUMPS root
++#   directory, use 
++#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc"
++#   (see the main README file for details)
++#
++#   If you do not find any suitable Makefile in Makefile.inc, use this file:
++#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc" and modify it according
++#   to the comments given below. If you manage to build MUMPS on a new platform,
++#   and think that this could be useful to others, you may want to send us
++#   the corresponding Makefile.inc file.
++#
++################################################################################
++
++
++########################################################################
++#Begin orderings
++#
++# NOTE that PORD is distributed within MUMPS by default. It is recommended to
++# install other orderings. For that, you need to obtain the corresponding package
++# and modify the variables below accordingly.
++# For example, to have Metis available within MUMPS:
++#          1/ download Metis and compile it
++#          2/ uncomment (suppress # in first column) lines
++#             starting with LMETISDIR,  LMETIS
++#          3/ add -Dmetis in line ORDERINGSF
++#             ORDERINGSF  = -Dpord -Dmetis
++#          4/ Compile and install MUMPS
++#             make clean; make   (to clean up previous installation)
++#
++#          Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 6.0 and later) orderings are recommended.
++#
++
++#SCOTCHDIR  = ${HOME}/scotch_6.0
++#ISCOTCH    = -I$(SCOTCHDIR)/include
++#
++# You have to choose one among the following two lines depending on
++# the type of analysis you want to perform. If you want to perform only
++# sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF
++# variable below); for both parallel and sequential analysis choose the second 
++# line (remember to add -Dptscotch in the ORDERINGSF variable below)
++
++#LSCOTCH    = -L$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr
++#LSCOTCH    = -L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr
++
++
++LPORDDIR = $(topdir)/PORD/lib
++IPORD    = -I$(topdir)/PORD/include
++LPORD    = -L$(LPORDDIR) -lpord
++
++LMSMPIDIR = ${MSMPI_ROOT}/lib
++IMSMPIDIR = -I${MSMPI_ROOT}/include
++
++#LMETISDIR = /opt/metis-5.1.0/build/Linux-x86_64/libmetis
++#IMETIS    = /opt/metis-5.1.0/include
++
++# You have to choose one among the following two lines depending on
++# the type of analysis you want to perform. If you want to perform only
++# sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF
++# variable below); for both parallel and sequential analysis choose the second 
++# line (remember to add -Dparmetis in the ORDERINGSF variable below)
++
++#LMETIS    = -L$(LMETISDIR) -lmetis
++#LMETIS    = -L$(LMETISDIR) -lparmetis -lmetis
++
++LMETISDIR		= ${METIS_ROOT}/lib
++IMETIS			= -I${METIS_ROOT}/include
++LPARMETISDIR	= ${PARMETIS_ROOT}/lib
++IPARMETIS		= -I${PARMETIS_ROOT}/include
++
++LMETIS    = -L$(LPARMETISDIR) -lparmetis -L$(LMSMPIDIR) -lmsmpi -L$(LMETISDIR) -lmetis
++
++# The following variables will be used in the compilation process.
++# Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively.
++# If you want to use Metis 4.X or an older version, you should use -Dmetis4 instead of -Dmetis
++# or in addition with -Dparmetis (if you are using parmetis 3.X or older).
++#ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis
++#ORDERINGSF  = -Dpord
++ORDERINGSF  = -Dmetis -Dpord -Dparmetis
++ORDERINGSC  = $(ORDERINGSF)
++
++# LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH)
++# IORDERINGSF = $(ISCOTCH)
++# IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
++LORDERINGS = $(LPARMETIS) $(LMETIS)  $(LPORD) $(LSCOTCH)
++IORDERINGSF = $(ISCOTCH)
++IORDERINGSC = $(IPARMETIS) $(IMETIS) $(IPORD) $(ISCOTCH)
++
++#End orderings
++########################################################################
++
++########################################################################
++# DEFINE HERE SOME COMMON COMMANDS, THE COMPILER NAMES, ETC...
++
++# PLAT : use it to add a default suffix to the generated libraries
++PLAT    = 
++# Library extension, + C and Fortran "-o" option
++# may be different under Windows
++LIBEXT  = .dll
++OUTC    = -o 
++OUTF    = -o 
++# RM : remove files
++RM      = /usr/bin/rm -f
++# CC : C compiler
++CC      = /usr/bin/gcc
++# FC : Fortran 90 compiler
++FC      = /usr/bin/gfortran
++# FL : Fortran linker
++FL      = /usr/bin/gfortran
++# AR : Archive object in a library
++#      keep a space at the end if options have to be separated from lib name
++AR      = /usr/bin/ar cr 
++# RANLIB : generate index of an archive file
++#   (optionnal use "RANLIB = echo" in case of problem)
++RANLIB  = /usr/bin/ranlib
++#RANLIB  = echo
++
++# DEFINE HERE YOUR LAPACK LIBRARY
++
++LAPACK = -L${LAPACK_ROOT}/lib -llapack
++
++# SCALAP should define the SCALAPACK and BLACS libraries.
++SCALAP  = -L${SCALAPACK_ROOT}/lib -lscalapack
++
++# INCLUDE DIRECTORY FOR MPI
++INCPAR  = $(IMSMPIDIR)
++
++# LIBRARIES USED BY THE PARALLEL VERSION OF MUMPS: $(SCALAP) and MPI
++LIBPAR  = $(SCALAP) $(LAPACK) -L$(LMSMPIDIR) -lmsmpi
++
++# The parallel version is not concerned by the next two lines.
++# They are related to the sequential library provided by MUMPS,
++# to use instead of ScaLAPACK and MPI.
++INCSEQ  = -I$(topdir)/libseq
++LIBSEQ  = $(LAPACK) -L$(topdir)/libseq -lmpiseq
++
++# DEFINE HERE YOUR BLAS LIBRARY
++
++LIBBLAS = -L${BLAS_ROOT}/lib -lblas
++
++# DEFINE HERE YOUR PTHREAD LIBRARY
++LIBOTHERS = -lpthread
++
++# FORTRAN/C COMPATIBILITY:
++#  Use:
++#    -DAdd_ if your Fortran compiler adds an underscore at the end
++#              of symbols,
++#     -DAdd__ if your Fortran compiler adds 2 underscores,
++#
++#     -DUPPER if your Fortran compiler uses uppercase symbols
++#
++#     leave empty if your Fortran compiler does not change the symbols.
++#
++
++CDEFS = -DAdd_
++
++#COMPILER OPTIONS
++#
++# NOTE:
++# - Added -fallow-argument-mismatch option to OPTF in order to clear "Error: 
++#	Rank mismatch between actual argument at [...]"
++# - Added -fallow-invalid-boz option to OPTF in order to clear "Error: BOZ 
++#	literal constant at [...]"
++#
++OPTF    = -O -fPIC -fallow-argument-mismatch -fallow-invalid-boz
++OPTC    = -O -fPIC -I.
++OPTL    = -O
++
++# CHOOSE BETWEEN USING THE SEQUENTIAL OR THE PARALLEL VERSION.
++
++#Sequential:
++#INCS = $(INCSEQ)
++#LIBS = $(LIBSEQ)
++#LIBSEQNEEDED = libseqneeded
++
++#Parallel:
++INCS = $(INCPAR)
++LIBS = $(LIBPAR)
++LIBSEQNEEDED = libseqneeded # NOTE: Create libmpiseq because PETSc looks for it (rather than patching PETSc config tests)
++
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile	(revision 26034)
+@@ -0,0 +1,34 @@
++
++# To compile directly, uncomment the line below.
++# include ../Make.in
++#
++# Otherwise, adequate variables for CC, CFLAGS, AR and RANLIB must be passed to 
++# make.
++#
++
++INCLUDES = -I../include
++
++# NOTE:
++#- CFLAGS = $(OPTC) (see ../../src/Makefile; OPTC is set in ../../Makefile.inc)
++#
++COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS)
++
++OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \
++       multisector.o gelim.o bucket.o tree.o \
++       symbfac.o interface.o sort.o minpriority.o 
++
++# NOTE: numfac.c read.c mapping.c triangular.c matrix.c kernel.c were not 
++# directly used by MUMPS and have been removed from the original SPACE 
++# package.
++
++.c.o:
++	$(CC) $(COPTIONS) -c $*.c $(OUTC) $*.o
++
++libpord$(LIBEXT):$(OBJS)
++	$(CC) -shared $(OUTC) $@ $(OBJS)
++
++clean:
++	$(RM) *.o
++
++realclean:
++	$(RM) *.o libpord*
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile	(revision 26034)
+@@ -0,0 +1,25 @@
++#
++#  This file is part of MUMPS 5.3.5, released
++#  on Thu Oct 22 09:29:08 UTC 2020
++#
++all: libmpiseq
++
++.PHONY: all libmpiseq clean
++
++include ../Makefile.inc
++
++libmpiseq: libmpiseq$(PLAT)$(LIBEXT)
++
++# NOTE:
++# - We need to use Fortran compiler or otherwise link in Fortran libraries 
++#   using C compiler (which does not make a lot of sense, but is possible)
++#
++libmpiseq$(PLAT)$(LIBEXT): mpi.o mpic.o elapse.o
++	$(FC) -shared $(OUTF) $@ mpi.o mpic.o elapse.o
++.f.o:
++	$(FC) $(OPTF)              -c $*.f $(OUTF)$*.o
++.c.o:
++	$(CC) $(OPTC) $(CDEFS) -I. -c $*.c $(OUTC)$*.o
++
++clean:
++	$(RM) *.o *$(LIBEXT)
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src/Makefile	(revision 26034)
+@@ -0,0 +1,425 @@
++#
++#  This file is part of MUMPS 5.3.5, released
++#  on Thu Oct 22 09:29:08 UTC 2020
++#
++#
++topdir = ..
++libdir = $(topdir)/lib
++incdir = $(topdir)/include
++
++default: d
++
++.PHONY: default s d c z mumps_lib clean
++
++s:
++	$(MAKE) ARITH=s mumps_lib
++d:
++	$(MAKE) ARITH=d mumps_lib
++c:
++	$(MAKE) ARITH=c mumps_lib
++z:
++	$(MAKE) ARITH=z mumps_lib
++
++include $(topdir)/Makefile.inc
++
++mumps_lib:    $(incdir)/mumps_int_def.h \
++              $(libdir)/libmumps_common$(PLAT)$(LIBEXT) \
++              $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT)
++
++# Build $(incdir)/mumps_int_def.h, needed by mumps_c_types.h
++$(incdir)/mumps_int_def.h: build_mumps_int_def 
++	./build_mumps_int_def > $(incdir)/mumps_int_def.h
++build_mumps_int_def:build_mumps_int_def.o
++	$(CC) $(OPTL) build_mumps_int_def.o -o build_mumps_int_def
++
++OBJS_COMMON_MOD = \
++        ana_omp_m.o\
++        ana_blk_m.o\
++        ana_orderings_wrappers_m.o\
++        double_linked_list.o\
++        fac_asm_build_sort_index_ELT_m.o\
++        fac_asm_build_sort_index_m.o\
++        fac_descband_data_m.o\
++        fac_future_niv2_mod.o\
++        fac_ibct_data_m.o\
++        fac_maprow_data_m.o\
++        front_data_mgt_m.o\
++        lr_common.o \
++        mumps_comm_ibcast.o\
++        mumps_l0_omp_m.o\
++        mumps_memory_mod.o\
++        mumps_mpitoomp_m.o\
++        mumps_ooc_common.o\
++        mumps_static_mapping.o\
++        omp_tps_common_m.o
++
++
++OBJS_COMMON_OTHER = \
++        ana_blk.o\
++        ana_orderings.o\
++        ana_set_ordering.o\
++        ana_AMDMF.o\
++        bcast_errors.o\
++        estim_flops.o\
++        mumps_type_size.o \
++        mumps_type2_blocking.o \
++        mumps_version.o \
++        mumps_print_defined.o \
++        mumps_common.o\
++        mumps_pord.o\
++        mumps_metis.o\
++        mumps_metis64.o\
++        mumps_metis_int.o\
++        mumps_scotch.o\
++        mumps_scotch64.o\
++        mumps_scotch_int.o\
++        mumps_size.o\
++        mumps_io.o\
++        mumps_io_basic.o\
++        mumps_io_thread.o\
++        mumps_io_err.o\
++        mumps_numa.o \
++        mumps_thread.o \
++        mumps_save_restore_C.o \
++        mumps_config_file_C.o \
++        mumps_thread_affinity.o \
++        tools_common.o \
++        sol_common.o
++
++OBJS_MOD =   \
++        $(ARITH)ana_aux.o \
++        $(ARITH)ana_aux_par.o \
++        $(ARITH)ana_lr.o\
++        $(ARITH)fac_asm_master_ELT_m.o\
++        $(ARITH)fac_asm_master_m.o\
++        $(ARITH)fac_front_aux.o\
++        $(ARITH)fac_front_LU_type1.o\
++        $(ARITH)fac_front_LU_type2.o\
++        $(ARITH)fac_front_LDLT_type1.o\
++        $(ARITH)fac_front_LDLT_type2.o\
++        $(ARITH)fac_front_type2_aux.o\
++        $(ARITH)fac_sispointers_m.o\
++        $(ARITH)fac_lr.o\
++        $(ARITH)fac_mem_dynamic.o\
++        $(ARITH)fac_omp_m.o\
++        $(ARITH)fac_par_m.o\
++        $(ARITH)fac_sol_l0omp_m.o\
++        $(ARITH)lr_core.o\
++        $(ARITH)lr_stats.o\
++        $(ARITH)lr_type.o\
++        $(ARITH)mumps_comm_buffer.o\
++        $(ARITH)mumps_config_file.o\
++        $(ARITH)mumps_load.o\
++        $(ARITH)mumps_lr_data_m.o\
++        $(ARITH)mumps_ooc_buffer.o\
++        $(ARITH)mumps_ooc.o\
++        $(ARITH)mumps_sol_es.o\
++        $(ARITH)mumps_save_restore.o\
++        $(ARITH)mumps_save_restore_files.o\
++        $(ARITH)mumps_struc_def.o\
++        $(ARITH)omp_tps_m.o\
++        $(ARITH)sol_lr.o\
++        $(ARITH)sol_omp_m.o\
++        $(ARITH)static_ptr_m.o
++
++OBJS_OTHER = \
++        $(ARITH)ini_driver.o\
++        $(ARITH)ana_driver.o\
++        $(ARITH)fac_driver.o\
++        $(ARITH)sol_driver.o\
++        $(ARITH)sol_distrhs.o\
++        $(ARITH)end_driver.o\
++        $(ARITH)ana_aux_ELT.o\
++        $(ARITH)ana_dist_m.o\
++        $(ARITH)ana_LDLT_preprocess.o\
++        $(ARITH)ana_reordertree.o\
++        $(ARITH)arrowheads.o\
++        $(ARITH)bcast_int.o\
++        $(ARITH)fac_asm_ELT.o\
++        $(ARITH)fac_asm.o\
++        $(ARITH)fac_b.o\
++        $(ARITH)fac_distrib_distentry.o\
++        $(ARITH)fac_distrib_ELT.o\
++        $(ARITH)fac_lastrtnelind.o\
++        $(ARITH)fac_mem_alloc_cb.o\
++        $(ARITH)fac_mem_compress_cb.o\
++        $(ARITH)fac_mem_free_block_cb.o\
++        $(ARITH)fac_mem_stack_aux.o\
++        $(ARITH)fac_mem_stack.o\
++        $(ARITH)fac_process_band.o\
++        $(ARITH)fac_process_blfac_slave.o\
++        $(ARITH)fac_process_blocfacto_LDLT.o\
++        $(ARITH)fac_process_blocfacto.o\
++        $(ARITH)fac_process_bf.o\
++        $(ARITH)fac_process_end_facto_slave.o\
++        $(ARITH)fac_process_contrib_type1.o\
++        $(ARITH)fac_process_contrib_type2.o\
++        $(ARITH)fac_process_contrib_type3.o\
++        $(ARITH)fac_process_maprow.o\
++        $(ARITH)fac_process_master2.o\
++        $(ARITH)fac_process_message.o\
++        $(ARITH)fac_process_root2slave.o\
++        $(ARITH)fac_process_root2son.o\
++        $(ARITH)fac_process_rtnelind.o\
++        $(ARITH)fac_root_parallel.o\
++        $(ARITH)fac_scalings.o\
++        $(ARITH)fac_determinant.o\
++        $(ARITH)fac_scalings_simScaleAbs.o\
++        $(ARITH)fac_scalings_simScale_util.o\
++        $(ARITH)fac_sol_pool.o\
++        $(ARITH)fac_type3_symmetrize.o\
++        $(ARITH)ini_defaults.o\
++        $(ARITH)mumps_c.o\
++        $(ARITH)mumps_driver.o\
++        $(ARITH)mumps_f77.o\
++        $(ARITH)mumps_gpu.o\
++        $(ARITH)mumps_iXamax.o\
++        $(ARITH)ana_mtrans.o\
++        $(ARITH)ooc_panel_piv.o\
++        $(ARITH)rank_revealing.o\
++        $(ARITH)sol_aux.o\
++        $(ARITH)sol_bwd_aux.o\
++        $(ARITH)sol_bwd.o\
++        $(ARITH)sol_c.o\
++        $(ARITH)sol_fwd_aux.o\
++        $(ARITH)sol_fwd.o\
++        $(ARITH)sol_matvec.o\
++        $(ARITH)sol_root_parallel.o\
++        $(ARITH)tools.o\
++        $(ARITH)type3_root.o
++
++# NOTE:
++# - We need to use Fortran compiler or otherwise link in Fortran libraries 
++#	using C compiler (which does not make a lot of sense, but is possible)
++# - In case of "Makefile:[line_number]: *** missing separator.  Stop.", ensure 
++#	that $(FC) is preceded by a tab and not four spaces
++#
++$(libdir)/libmumps_common$(PLAT)$(LIBEXT):      $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
++	$(FC) -shared $(OUTF) $@ \
++		$? $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
++		-Wl,--out-implib=$(libdir)/libmumps_common$(PLAT).dll.a
++
++$(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT):    $(OBJS_MOD) $(OBJS_OTHER)
++	$(FC) -shared $(OUTF) $@ \
++		$? -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
++		-Wl,--out-implib=$(libdir)/lib$(ARITH)mumps$(PLAT).dll.a
++
++# Dependencies between modules:
++# i) arithmetic-dependent modules:
++$(ARITH)ana_aux.o:              $(ARITH)mumps_struc_def.o \
++                                mumps_static_mapping.o \
++                                ana_orderings_wrappers_m.o \
++                                ana_blk_m.o
++$(ARITH)ana_aux_par.o:          $(ARITH)mumps_struc_def.o \
++                                mumps_memory_mod.o \
++                                ana_orderings_wrappers_m.o
++$(ARITH)ana_lr.o:                $(ARITH)lr_core.o\
++                                $(ARITH)lr_stats.o\
++                                lr_common.o\
++                                ana_orderings_wrappers_m.o \
++                                ana_blk_m.o 
++$(ARITH)fac_asm_master_ELT_m.o: omp_tps_common_m.o \
++                                fac_ibct_data_m.o \
++                                fac_asm_build_sort_index_ELT_m.o \
++                                lr_common.o \
++                                $(ARITH)fac_mem_dynamic.o \
++                                $(ARITH)lr_core.o \
++                                $(ARITH)ana_lr.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                $(ARITH)mumps_struc_def.o \
++                                $(ARITH)omp_tps_m.o \
++                                $(ARITH)mumps_comm_buffer.o \
++                                $(ARITH)mumps_load.o
++$(ARITH)fac_asm_master_m.o:     omp_tps_common_m.o \
++                                fac_ibct_data_m.o \
++                                fac_asm_build_sort_index_m.o \
++                                lr_common.o \
++                                $(ARITH)fac_mem_dynamic.o \
++                                $(ARITH)lr_core.o \
++                                $(ARITH)ana_lr.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                $(ARITH)mumps_struc_def.o \
++                                $(ARITH)omp_tps_m.o \
++                                $(ARITH)mumps_comm_buffer.o \
++                                $(ARITH)mumps_load.o
++
++$(ARITH)fac_front_aux.o:        $(ARITH)lr_type.o\
++                                $(ARITH)lr_stats.o\
++                                $(ARITH)mumps_comm_buffer.o\
++                                $(ARITH)mumps_load.o\
++                                $(ARITH)mumps_ooc.o\
++                                mumps_ooc_common.o\
++                                mumps_l0_omp_m.o
++
++$(ARITH)fac_front_LU_type1.o   : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 mumps_l0_omp_m.o
++
++$(ARITH)fac_front_LU_type2.o   : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)fac_front_type2_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)mumps_comm_buffer.o\
++                                 mumps_comm_ibcast.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_core.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 $(ARITH)mumps_struc_def.o
++
++$(ARITH)fac_front_LDLT_type1.o : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 mumps_l0_omp_m.o
++
++$(ARITH)fac_front_LDLT_type2.o : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)fac_front_type2_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)mumps_comm_buffer.o\
++                                 $(ARITH)mumps_load.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 $(ARITH)mumps_struc_def.o
++
++$(ARITH)fac_front_type2_aux.o : mumps_ooc_common.o\
++                                $(ARITH)fac_front_aux.o\
++                                $(ARITH)lr_type.o\
++                                $(ARITH)mumps_struc_def.o\
++                                $(ARITH)mumps_comm_buffer.o\
++                                $(ARITH)mumps_load.o\
++                                mumps_comm_ibcast.o\
++                                fac_ibct_data_m.o
++
++$(ARITH)fac_lr.o:               $(ARITH)lr_core.o\
++                                $(ARITH)lr_type.o\
++                                $(ARITH)mumps_lr_data_m.o\
++                                $(ARITH)lr_stats.o
++
++$(ARITH)fac_mem_dynamic.o:      $(ARITH)mumps_load.o\
++                                $(ARITH)static_ptr_m.o
++
++$(ARITH)fac_omp_m.o:            $(ARITH)fac_asm_master_m.o\
++                                $(ARITH)fac_asm_master_ELT_m.o\
++                                $(ARITH)fac_front_LU_type1.o\
++                                $(ARITH)fac_front_LDLT_type1.o\
++                                $(ARITH)mumps_load.o\
++                                $(ARITH)omp_tps_m.o\
++                                $(ARITH)lr_stats.o\
++                                $(ARITH)mumps_struc_def.o\
++                                omp_tps_common_m.o\
++                                mumps_l0_omp_m.o
++
++$(ARITH)fac_sol_l0omp_m.o:      $(ARITH)mumps_struc_def.o
++
++$(ARITH)fac_omp_m.o:            $(ARITH)mumps_struc_def.o \
++                                $(ARITH)fac_mem_dynamic.o\
++                                $(ARITH)omp_tps_m.o\
++                                omp_tps_common_m.o
++
++$(ARITH)fac_par_m.o:            $(ARITH)mumps_load.o\
++                                $(ARITH)mumps_ooc.o\
++                                $(ARITH)fac_asm_master_m.o\
++                                $(ARITH)fac_asm_master_ELT_m.o\
++                                $(ARITH)omp_tps_m.o\
++                                $(ARITH)fac_front_LU_type1.o\
++                                $(ARITH)fac_front_LU_type2.o\
++                                $(ARITH)fac_front_LDLT_type1.o\
++                                $(ARITH)fac_front_LDLT_type2.o\
++                                $(ARITH)fac_mem_dynamic.o\
++                                $(ARITH)mumps_struc_def.o\
++                                $(ARITH)lr_stats.o\
++                                omp_tps_common_m.o\
++                                mumps_l0_omp_m.o
++
++$(ARITH)lr_core.o:              $(ARITH)lr_type.o\
++                                $(ARITH)mumps_lr_data_m.o\
++                                $(ARITH)lr_stats.o\
++                                lr_common.o
++
++$(ARITH)lr_stats.o:             $(ARITH)lr_type.o
++
++$(ARITH)mumps_comm_buffer.o:    mumps_comm_ibcast.o \
++                                $(ARITH)lr_type.o \
++                                $(ARITH)lr_core.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                fac_ibct_data_m.o
++
++$(ARITH)mumps_config_file.o:    $(ARITH)mumps_struc_def.o
++
++$(ARITH)mumps_load.o:           $(ARITH)mumps_comm_buffer.o \
++                                $(ARITH)mumps_struc_def.o \
++                                fac_future_niv2_mod.o
++
++$(ARITH)mumps_lr_data_m.o:      $(ARITH)lr_type.o\
++                                front_data_mgt_m.o
++
++$(ARITH)mumps_ooc_buffer.o:     mumps_ooc_common.o
++
++$(ARITH)mumps_ooc.o:            $(ARITH)mumps_struc_def.o \
++                                $(ARITH)mumps_ooc_buffer.o \
++                                mumps_ooc_common.o
++
++$(ARITH)mumps_sol_es.o:         $(ARITH)lr_type.o \
++                                $(ARITH)mumps_lr_data_m.o
++
++$(ARITH)mumps_save_restore.o:   $(ARITH)mumps_struc_def.o \
++                                $(ARITH)mumps_save_restore_files.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                $(ARITH)mumps_ooc.o \
++                                $(ARITH)fac_sol_l0omp_m.o \
++                                front_data_mgt_m.o
++
++$(ARITH)mumps_save_restore_files.o : $(ARITH)mumps_struc_def.o
++
++$(ARITH)sol_lr.o:               $(ARITH)lr_type.o\
++                                $(ARITH)lr_stats.o\
++                                $(ARITH)mumps_lr_data_m.o
++
++$(ARITH)sol_omp_m.o:            $(ARITH)mumps_struc_def.o
++
++
++
++
++
++# Dependencies between modules:
++# ii) arithmetic-independent modules:
++
++ana_omp_m.o:                     double_linked_list.o
++fac_asm_build_sort_index_ELT_m.o:omp_tps_common_m.o
++fac_asm_build_sort_index_m.o:    omp_tps_common_m.o
++fac_descband_data_m.o:           front_data_mgt_m.o
++fac_ibct_data_m.o:               front_data_mgt_m.o
++fac_maprow_data_m.o:             front_data_mgt_m.o
++mumps_comm_ibcast.o:             fac_future_niv2_mod.o
++mumps_static_mapping.o:          lr_common.o
++
++
++# Compile modules before the rest
++$(OBJS_COMMON_OTHER):$(OBJS_COMMON_MOD)
++$(OBJS_OTHER):$(OBJS_COMMON_MOD) $(OBJS_MOD)
++
++.SUFFIXES: .c .F .o
++.F.o:
++	$(FC) $(OPTF) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -c $*.F $(OUTF) $*.o
++.c.o:
++	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC) $*.o
++
++$(ARITH)mumps_c.o:	mumps_c.c
++	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) -DMUMPS_ARITH=MUMPS_ARITH_$(ARITH) \
++	      $(IORDERINGSC) $(ORDERINGSC) -c mumps_c.c $(OUTC) $@
++
++clean:
++	$(RM) *.o *.mod $(incdir)/mumps_int_def.h
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc	(revision 26034)
+@@ -0,0 +1,189 @@
++#
++#  This file is part of MUMPS 5.3.5, released
++#  on Thu Oct 22 09:29:08 UTC 2020
++#
++################################################################################
++#
++#   Makefile.inc.generic
++#
++#   This defines some parameters dependent on your platform; you should
++#   look for the approriate file in the directory ./Make.inc/ and copy it
++#   into a file called Makefile.inc. For example, from the MUMPS root
++#   directory, use 
++#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc"
++#   (see the main README file for details)
++#
++#   If you do not find any suitable Makefile in Makefile.inc, use this file:
++#   "cp Make.inc/Makefile.inc.generic ./Makefile.inc" and modify it according
++#   to the comments given below. If you manage to build MUMPS on a new platform,
++#   and think that this could be useful to others, you may want to send us
++#   the corresponding Makefile.inc file.
++#
++################################################################################
++
++
++########################################################################
++#Begin orderings
++#
++# NOTE that PORD is distributed within MUMPS by default. It is recommended to
++# install other orderings. For that, you need to obtain the corresponding package
++# and modify the variables below accordingly.
++# For example, to have Metis available within MUMPS:
++#          1/ download Metis and compile it
++#          2/ uncomment (suppress # in first column) lines
++#             starting with LMETISDIR,  LMETIS
++#          3/ add -Dmetis in line ORDERINGSF
++#             ORDERINGSF  = -Dpord -Dmetis
++#          4/ Compile and install MUMPS
++#             make clean; make   (to clean up previous installation)
++#
++#          Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 6.0 and later) orderings are recommended.
++#
++
++#SCOTCHDIR  = ${HOME}/scotch_6.0
++#ISCOTCH    = -I$(SCOTCHDIR)/include
++#
++# You have to choose one among the following two lines depending on
++# the type of analysis you want to perform. If you want to perform only
++# sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF
++# variable below); for both parallel and sequential analysis choose the second 
++# line (remember to add -Dptscotch in the ORDERINGSF variable below)
++
++#LSCOTCH    = -L$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr
++#LSCOTCH    = -L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr
++
++
++LPORDDIR = $(topdir)/PORD/lib
++IPORD    = -I$(topdir)/PORD/include
++LPORD    = -L$(LPORDDIR) -lpord
++
++LMSMPIDIR = ${MSMPI_ROOT}/lib
++IMSMPIDIR = -I${MSMPI_ROOT}/include
++
++#LMETISDIR = /opt/metis-5.1.0/build/Linux-x86_64/libmetis
++#IMETIS    = /opt/metis-5.1.0/include
++
++# You have to choose one among the following two lines depending on
++# the type of analysis you want to perform. If you want to perform only
++# sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF
++# variable below); for both parallel and sequential analysis choose the second 
++# line (remember to add -Dparmetis in the ORDERINGSF variable below)
++
++#LMETIS    = -L$(LMETISDIR) -lmetis
++#LMETIS    = -L$(LMETISDIR) -lparmetis -lmetis
++
++LMETISDIR		= ${METIS_ROOT}/lib
++IMETIS			= -I${METIS_ROOT}/include
++LPARMETISDIR	= ${PARMETIS_ROOT}/lib
++IPARMETIS		= -I${PARMETIS_ROOT}/include
++
++LMETIS    = -L$(LPARMETISDIR) -lparmetis -L$(LMSMPIDIR) -lmsmpi -L$(LMETISDIR) -lmetis
++
++# The following variables will be used in the compilation process.
++# Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively.
++# If you want to use Metis 4.X or an older version, you should use -Dmetis4 instead of -Dmetis
++# or in addition with -Dparmetis (if you are using parmetis 3.X or older).
++#ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis
++#ORDERINGSF  = -Dpord
++ORDERINGSF  = -Dmetis -Dpord -Dparmetis
++ORDERINGSC  = $(ORDERINGSF)
++
++# LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH)
++# IORDERINGSF = $(ISCOTCH)
++# IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
++LORDERINGS = $(LPARMETIS) $(LMETIS)  $(LPORD) $(LSCOTCH)
++IORDERINGSF = $(ISCOTCH)
++IORDERINGSC = $(IPARMETIS) $(IMETIS) $(IPORD) $(ISCOTCH)
++
++#End orderings
++########################################################################
++
++########################################################################
++# DEFINE HERE SOME COMMON COMMANDS, THE COMPILER NAMES, ETC...
++
++# PLAT : use it to add a default suffix to the generated libraries
++PLAT    = 
++# Library extension, + C and Fortran "-o" option
++# may be different under Windows
++LIBEXT  = .dll
++OUTC    = -o 
++OUTF    = -o 
++# RM : remove files
++RM      = /usr/bin/rm -f
++# CC : C compiler
++CC      = /mingw64/bin/gcc
++# FC : Fortran 90 compiler
++FC      = /mingw64/bin/gfortran
++# FL : Fortran linker
++FL      = /mingw64/bin/gfortran
++# AR : Archive object in a library
++#      keep a space at the end if options have to be separated from lib name
++AR      = /mingw64/bin/ar cr 
++# RANLIB : generate index of an archive file
++#   (optionnal use "RANLIB = echo" in case of problem)
++RANLIB  = /mingw64/bin/ranlib
++#RANLIB  = echo
++
++# DEFINE HERE YOUR LAPACK LIBRARY
++
++LAPACK = -L${LAPACK_ROOT}/lib -llapack
++
++# SCALAP should define the SCALAPACK and BLACS libraries.
++SCALAP  = -L${SCALAPACK_ROOT}/lib -lscalapack
++
++# INCLUDE DIRECTORY FOR MPI
++INCPAR  = $(IMSMPIDIR)
++
++# LIBRARIES USED BY THE PARALLEL VERSION OF MUMPS: $(SCALAP) and MPI
++LIBPAR  = $(SCALAP) $(LAPACK) -L$(LMSMPIDIR) -lmsmpi
++
++# The parallel version is not concerned by the next two lines.
++# They are related to the sequential library provided by MUMPS,
++# to use instead of ScaLAPACK and MPI.
++INCSEQ  = -I$(topdir)/libseq
++LIBSEQ  = $(LAPACK) -L$(topdir)/libseq -lmpiseq
++
++# DEFINE HERE YOUR BLAS LIBRARY
++
++LIBBLAS = -L${BLAS_ROOT}/lib -lblas
++
++# DEFINE HERE YOUR PTHREAD LIBRARY
++LIBOTHERS = -lpthread
++
++# FORTRAN/C COMPATIBILITY:
++#  Use:
++#    -DAdd_ if your Fortran compiler adds an underscore at the end
++#              of symbols,
++#     -DAdd__ if your Fortran compiler adds 2 underscores,
++#
++#     -DUPPER if your Fortran compiler uses uppercase symbols
++#
++#     leave empty if your Fortran compiler does not change the symbols.
++#
++
++CDEFS = -DAdd_
++
++#COMPILER OPTIONS
++#
++# NOTE:
++# - Added -fallow-argument-mismatch option to OPTF in order to clear "Error: 
++#	Rank mismatch between actual argument at [...]"
++# - Added -fallow-invalid-boz option to OPTF in order to clear "Error: BOZ 
++#	literal constant at [...]"
++#
++OPTF    = -O -fPIC -fallow-argument-mismatch -fallow-invalid-boz
++OPTC    = -O -fPIC -I.
++OPTL    = -O
++
++# CHOOSE BETWEEN USING THE SEQUENTIAL OR THE PARALLEL VERSION.
++
++#Sequential:
++#INCS = $(INCSEQ)
++#LIBS = $(LIBSEQ)
++#LIBSEQNEEDED = libseqneeded
++
++#Parallel:
++INCS = $(INCPAR)
++LIBS = $(LIBPAR)
++LIBSEQNEEDED = libseqneeded # NOTE: Create libmpiseq because PETSc looks for it (rather than patching PETSc config tests)
++
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile	(revision 26034)
+@@ -0,0 +1,34 @@
++
++# To compile directly, uncomment the line below.
++# include ../Make.in
++#
++# Otherwise, adequate variables for CC, CFLAGS, AR and RANLIB must be passed to 
++# make.
++#
++
++INCLUDES = -I../include
++
++# NOTE:
++#- CFLAGS = $(OPTC) (see ../../src/Makefile; OPTC is set in ../../Makefile.inc)
++#
++COPTIONS = $(INCLUDES) $(CFLAGS) $(OPTFLAGS)
++
++OBJS = graph.o gbipart.o gbisect.o ddcreate.o ddbisect.o nestdiss.o \
++       multisector.o gelim.o bucket.o tree.o \
++       symbfac.o interface.o sort.o minpriority.o 
++
++# NOTE: numfac.c read.c mapping.c triangular.c matrix.c kernel.c were not 
++# directly used by MUMPS and have been removed from the original SPACE 
++# package.
++
++.c.o:
++	$(CC) $(COPTIONS) -c $*.c $(OUTC) $*.o
++
++libpord$(LIBEXT):$(OBJS)
++	$(CC) -shared $(OUTC) $@ $(OBJS)
++
++clean:
++	$(RM) *.o
++
++realclean:
++	$(RM) *.o libpord*
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile	(revision 26034)
+@@ -0,0 +1,25 @@
++#
++#  This file is part of MUMPS 5.3.5, released
++#  on Thu Oct 22 09:29:08 UTC 2020
++#
++all: libmpiseq
++
++.PHONY: all libmpiseq clean
++
++include ../Makefile.inc
++
++libmpiseq: libmpiseq$(PLAT)$(LIBEXT)
++
++# NOTE:
++# - We need to use Fortran compiler or otherwise link in Fortran libraries 
++#   using C compiler (which does not make a lot of sense, but is possible)
++#
++libmpiseq$(PLAT)$(LIBEXT): mpi.o mpic.o elapse.o
++	$(FC) -shared $(OUTF) $@ mpi.o mpic.o elapse.o
++.f.o:
++	$(FC) $(OPTF)              -c $*.f $(OUTF)$*.o
++.c.o:
++	$(CC) $(OPTC) $(CDEFS) -I. -c $*.c $(OUTC)$*.o
++
++clean:
++	$(RM) *.o *$(LIBEXT)
+Index: ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src/Makefile	(revision 26034)
+@@ -0,0 +1,425 @@
++#
++#  This file is part of MUMPS 5.3.5, released
++#  on Thu Oct 22 09:29:08 UTC 2020
++#
++#
++topdir = ..
++libdir = $(topdir)/lib
++incdir = $(topdir)/include
++
++default: d
++
++.PHONY: default s d c z mumps_lib clean
++
++s:
++	$(MAKE) ARITH=s mumps_lib
++d:
++	$(MAKE) ARITH=d mumps_lib
++c:
++	$(MAKE) ARITH=c mumps_lib
++z:
++	$(MAKE) ARITH=z mumps_lib
++
++include $(topdir)/Makefile.inc
++
++mumps_lib:    $(incdir)/mumps_int_def.h \
++              $(libdir)/libmumps_common$(PLAT)$(LIBEXT) \
++              $(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT)
++
++# Build $(incdir)/mumps_int_def.h, needed by mumps_c_types.h
++$(incdir)/mumps_int_def.h: build_mumps_int_def 
++	./build_mumps_int_def > $(incdir)/mumps_int_def.h
++build_mumps_int_def:build_mumps_int_def.o
++	$(CC) $(OPTL) build_mumps_int_def.o -o build_mumps_int_def
++
++OBJS_COMMON_MOD = \
++        ana_omp_m.o\
++        ana_blk_m.o\
++        ana_orderings_wrappers_m.o\
++        double_linked_list.o\
++        fac_asm_build_sort_index_ELT_m.o\
++        fac_asm_build_sort_index_m.o\
++        fac_descband_data_m.o\
++        fac_future_niv2_mod.o\
++        fac_ibct_data_m.o\
++        fac_maprow_data_m.o\
++        front_data_mgt_m.o\
++        lr_common.o \
++        mumps_comm_ibcast.o\
++        mumps_l0_omp_m.o\
++        mumps_memory_mod.o\
++        mumps_mpitoomp_m.o\
++        mumps_ooc_common.o\
++        mumps_static_mapping.o\
++        omp_tps_common_m.o
++
++
++OBJS_COMMON_OTHER = \
++        ana_blk.o\
++        ana_orderings.o\
++        ana_set_ordering.o\
++        ana_AMDMF.o\
++        bcast_errors.o\
++        estim_flops.o\
++        mumps_type_size.o \
++        mumps_type2_blocking.o \
++        mumps_version.o \
++        mumps_print_defined.o \
++        mumps_common.o\
++        mumps_pord.o\
++        mumps_metis.o\
++        mumps_metis64.o\
++        mumps_metis_int.o\
++        mumps_scotch.o\
++        mumps_scotch64.o\
++        mumps_scotch_int.o\
++        mumps_size.o\
++        mumps_io.o\
++        mumps_io_basic.o\
++        mumps_io_thread.o\
++        mumps_io_err.o\
++        mumps_numa.o \
++        mumps_thread.o \
++        mumps_save_restore_C.o \
++        mumps_config_file_C.o \
++        mumps_thread_affinity.o \
++        tools_common.o \
++        sol_common.o
++
++OBJS_MOD =   \
++        $(ARITH)ana_aux.o \
++        $(ARITH)ana_aux_par.o \
++        $(ARITH)ana_lr.o\
++        $(ARITH)fac_asm_master_ELT_m.o\
++        $(ARITH)fac_asm_master_m.o\
++        $(ARITH)fac_front_aux.o\
++        $(ARITH)fac_front_LU_type1.o\
++        $(ARITH)fac_front_LU_type2.o\
++        $(ARITH)fac_front_LDLT_type1.o\
++        $(ARITH)fac_front_LDLT_type2.o\
++        $(ARITH)fac_front_type2_aux.o\
++        $(ARITH)fac_sispointers_m.o\
++        $(ARITH)fac_lr.o\
++        $(ARITH)fac_mem_dynamic.o\
++        $(ARITH)fac_omp_m.o\
++        $(ARITH)fac_par_m.o\
++        $(ARITH)fac_sol_l0omp_m.o\
++        $(ARITH)lr_core.o\
++        $(ARITH)lr_stats.o\
++        $(ARITH)lr_type.o\
++        $(ARITH)mumps_comm_buffer.o\
++        $(ARITH)mumps_config_file.o\
++        $(ARITH)mumps_load.o\
++        $(ARITH)mumps_lr_data_m.o\
++        $(ARITH)mumps_ooc_buffer.o\
++        $(ARITH)mumps_ooc.o\
++        $(ARITH)mumps_sol_es.o\
++        $(ARITH)mumps_save_restore.o\
++        $(ARITH)mumps_save_restore_files.o\
++        $(ARITH)mumps_struc_def.o\
++        $(ARITH)omp_tps_m.o\
++        $(ARITH)sol_lr.o\
++        $(ARITH)sol_omp_m.o\
++        $(ARITH)static_ptr_m.o
++
++OBJS_OTHER = \
++        $(ARITH)ini_driver.o\
++        $(ARITH)ana_driver.o\
++        $(ARITH)fac_driver.o\
++        $(ARITH)sol_driver.o\
++        $(ARITH)sol_distrhs.o\
++        $(ARITH)end_driver.o\
++        $(ARITH)ana_aux_ELT.o\
++        $(ARITH)ana_dist_m.o\
++        $(ARITH)ana_LDLT_preprocess.o\
++        $(ARITH)ana_reordertree.o\
++        $(ARITH)arrowheads.o\
++        $(ARITH)bcast_int.o\
++        $(ARITH)fac_asm_ELT.o\
++        $(ARITH)fac_asm.o\
++        $(ARITH)fac_b.o\
++        $(ARITH)fac_distrib_distentry.o\
++        $(ARITH)fac_distrib_ELT.o\
++        $(ARITH)fac_lastrtnelind.o\
++        $(ARITH)fac_mem_alloc_cb.o\
++        $(ARITH)fac_mem_compress_cb.o\
++        $(ARITH)fac_mem_free_block_cb.o\
++        $(ARITH)fac_mem_stack_aux.o\
++        $(ARITH)fac_mem_stack.o\
++        $(ARITH)fac_process_band.o\
++        $(ARITH)fac_process_blfac_slave.o\
++        $(ARITH)fac_process_blocfacto_LDLT.o\
++        $(ARITH)fac_process_blocfacto.o\
++        $(ARITH)fac_process_bf.o\
++        $(ARITH)fac_process_end_facto_slave.o\
++        $(ARITH)fac_process_contrib_type1.o\
++        $(ARITH)fac_process_contrib_type2.o\
++        $(ARITH)fac_process_contrib_type3.o\
++        $(ARITH)fac_process_maprow.o\
++        $(ARITH)fac_process_master2.o\
++        $(ARITH)fac_process_message.o\
++        $(ARITH)fac_process_root2slave.o\
++        $(ARITH)fac_process_root2son.o\
++        $(ARITH)fac_process_rtnelind.o\
++        $(ARITH)fac_root_parallel.o\
++        $(ARITH)fac_scalings.o\
++        $(ARITH)fac_determinant.o\
++        $(ARITH)fac_scalings_simScaleAbs.o\
++        $(ARITH)fac_scalings_simScale_util.o\
++        $(ARITH)fac_sol_pool.o\
++        $(ARITH)fac_type3_symmetrize.o\
++        $(ARITH)ini_defaults.o\
++        $(ARITH)mumps_c.o\
++        $(ARITH)mumps_driver.o\
++        $(ARITH)mumps_f77.o\
++        $(ARITH)mumps_gpu.o\
++        $(ARITH)mumps_iXamax.o\
++        $(ARITH)ana_mtrans.o\
++        $(ARITH)ooc_panel_piv.o\
++        $(ARITH)rank_revealing.o\
++        $(ARITH)sol_aux.o\
++        $(ARITH)sol_bwd_aux.o\
++        $(ARITH)sol_bwd.o\
++        $(ARITH)sol_c.o\
++        $(ARITH)sol_fwd_aux.o\
++        $(ARITH)sol_fwd.o\
++        $(ARITH)sol_matvec.o\
++        $(ARITH)sol_root_parallel.o\
++        $(ARITH)tools.o\
++        $(ARITH)type3_root.o
++
++# NOTE:
++# - We need to use Fortran compiler or otherwise link in Fortran libraries 
++#	using C compiler (which does not make a lot of sense, but is possible)
++# - In case of "Makefile:[line_number]: *** missing separator.  Stop.", ensure 
++#	that $(FC) is preceded by a tab and not four spaces
++#
++$(libdir)/libmumps_common$(PLAT)$(LIBEXT):      $(OBJS_COMMON_MOD) $(OBJS_COMMON_OTHER)
++	$(FC) -shared $(OUTF) $@ \
++		$? $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
++		-Wl,--out-implib=$(libdir)/libmumps_common$(PLAT).dll.a
++
++$(libdir)/lib$(ARITH)mumps$(PLAT)$(LIBEXT):    $(OBJS_MOD) $(OBJS_OTHER)
++	$(FC) -shared $(OUTF) $@ \
++		$? -L$(libdir) -lmumps_common$(PLAT) $(LORDERINGS) $(LIBS) $(LIBLAPACK) $(LIBBLAS) $(LIBOTHERS) \
++		-Wl,--out-implib=$(libdir)/lib$(ARITH)mumps$(PLAT).dll.a
++
++# Dependencies between modules:
++# i) arithmetic-dependent modules:
++$(ARITH)ana_aux.o:              $(ARITH)mumps_struc_def.o \
++                                mumps_static_mapping.o \
++                                ana_orderings_wrappers_m.o \
++                                ana_blk_m.o
++$(ARITH)ana_aux_par.o:          $(ARITH)mumps_struc_def.o \
++                                mumps_memory_mod.o \
++                                ana_orderings_wrappers_m.o
++$(ARITH)ana_lr.o:                $(ARITH)lr_core.o\
++                                $(ARITH)lr_stats.o\
++                                lr_common.o\
++                                ana_orderings_wrappers_m.o \
++                                ana_blk_m.o 
++$(ARITH)fac_asm_master_ELT_m.o: omp_tps_common_m.o \
++                                fac_ibct_data_m.o \
++                                fac_asm_build_sort_index_ELT_m.o \
++                                lr_common.o \
++                                $(ARITH)fac_mem_dynamic.o \
++                                $(ARITH)lr_core.o \
++                                $(ARITH)ana_lr.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                $(ARITH)mumps_struc_def.o \
++                                $(ARITH)omp_tps_m.o \
++                                $(ARITH)mumps_comm_buffer.o \
++                                $(ARITH)mumps_load.o
++$(ARITH)fac_asm_master_m.o:     omp_tps_common_m.o \
++                                fac_ibct_data_m.o \
++                                fac_asm_build_sort_index_m.o \
++                                lr_common.o \
++                                $(ARITH)fac_mem_dynamic.o \
++                                $(ARITH)lr_core.o \
++                                $(ARITH)ana_lr.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                $(ARITH)mumps_struc_def.o \
++                                $(ARITH)omp_tps_m.o \
++                                $(ARITH)mumps_comm_buffer.o \
++                                $(ARITH)mumps_load.o
++
++$(ARITH)fac_front_aux.o:        $(ARITH)lr_type.o\
++                                $(ARITH)lr_stats.o\
++                                $(ARITH)mumps_comm_buffer.o\
++                                $(ARITH)mumps_load.o\
++                                $(ARITH)mumps_ooc.o\
++                                mumps_ooc_common.o\
++                                mumps_l0_omp_m.o
++
++$(ARITH)fac_front_LU_type1.o   : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 mumps_l0_omp_m.o
++
++$(ARITH)fac_front_LU_type2.o   : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)fac_front_type2_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)mumps_comm_buffer.o\
++                                 mumps_comm_ibcast.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_core.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 $(ARITH)mumps_struc_def.o
++
++$(ARITH)fac_front_LDLT_type1.o : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 mumps_l0_omp_m.o
++
++$(ARITH)fac_front_LDLT_type2.o : $(ARITH)fac_front_aux.o\
++                                 $(ARITH)fac_front_type2_aux.o\
++                                 $(ARITH)mumps_ooc.o\
++                                 $(ARITH)mumps_comm_buffer.o\
++                                 $(ARITH)mumps_load.o\
++                                 $(ARITH)fac_lr.o\
++                                 $(ARITH)lr_type.o\
++                                 $(ARITH)lr_stats.o\
++                                 $(ARITH)ana_lr.o\
++                                 $(ARITH)mumps_lr_data_m.o\
++                                 $(ARITH)mumps_struc_def.o
++
++$(ARITH)fac_front_type2_aux.o : mumps_ooc_common.o\
++                                $(ARITH)fac_front_aux.o\
++                                $(ARITH)lr_type.o\
++                                $(ARITH)mumps_struc_def.o\
++                                $(ARITH)mumps_comm_buffer.o\
++                                $(ARITH)mumps_load.o\
++                                mumps_comm_ibcast.o\
++                                fac_ibct_data_m.o
++
++$(ARITH)fac_lr.o:               $(ARITH)lr_core.o\
++                                $(ARITH)lr_type.o\
++                                $(ARITH)mumps_lr_data_m.o\
++                                $(ARITH)lr_stats.o
++
++$(ARITH)fac_mem_dynamic.o:      $(ARITH)mumps_load.o\
++                                $(ARITH)static_ptr_m.o
++
++$(ARITH)fac_omp_m.o:            $(ARITH)fac_asm_master_m.o\
++                                $(ARITH)fac_asm_master_ELT_m.o\
++                                $(ARITH)fac_front_LU_type1.o\
++                                $(ARITH)fac_front_LDLT_type1.o\
++                                $(ARITH)mumps_load.o\
++                                $(ARITH)omp_tps_m.o\
++                                $(ARITH)lr_stats.o\
++                                $(ARITH)mumps_struc_def.o\
++                                omp_tps_common_m.o\
++                                mumps_l0_omp_m.o
++
++$(ARITH)fac_sol_l0omp_m.o:      $(ARITH)mumps_struc_def.o
++
++$(ARITH)fac_omp_m.o:            $(ARITH)mumps_struc_def.o \
++                                $(ARITH)fac_mem_dynamic.o\
++                                $(ARITH)omp_tps_m.o\
++                                omp_tps_common_m.o
++
++$(ARITH)fac_par_m.o:            $(ARITH)mumps_load.o\
++                                $(ARITH)mumps_ooc.o\
++                                $(ARITH)fac_asm_master_m.o\
++                                $(ARITH)fac_asm_master_ELT_m.o\
++                                $(ARITH)omp_tps_m.o\
++                                $(ARITH)fac_front_LU_type1.o\
++                                $(ARITH)fac_front_LU_type2.o\
++                                $(ARITH)fac_front_LDLT_type1.o\
++                                $(ARITH)fac_front_LDLT_type2.o\
++                                $(ARITH)fac_mem_dynamic.o\
++                                $(ARITH)mumps_struc_def.o\
++                                $(ARITH)lr_stats.o\
++                                omp_tps_common_m.o\
++                                mumps_l0_omp_m.o
++
++$(ARITH)lr_core.o:              $(ARITH)lr_type.o\
++                                $(ARITH)mumps_lr_data_m.o\
++                                $(ARITH)lr_stats.o\
++                                lr_common.o
++
++$(ARITH)lr_stats.o:             $(ARITH)lr_type.o
++
++$(ARITH)mumps_comm_buffer.o:    mumps_comm_ibcast.o \
++                                $(ARITH)lr_type.o \
++                                $(ARITH)lr_core.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                fac_ibct_data_m.o
++
++$(ARITH)mumps_config_file.o:    $(ARITH)mumps_struc_def.o
++
++$(ARITH)mumps_load.o:           $(ARITH)mumps_comm_buffer.o \
++                                $(ARITH)mumps_struc_def.o \
++                                fac_future_niv2_mod.o
++
++$(ARITH)mumps_lr_data_m.o:      $(ARITH)lr_type.o\
++                                front_data_mgt_m.o
++
++$(ARITH)mumps_ooc_buffer.o:     mumps_ooc_common.o
++
++$(ARITH)mumps_ooc.o:            $(ARITH)mumps_struc_def.o \
++                                $(ARITH)mumps_ooc_buffer.o \
++                                mumps_ooc_common.o
++
++$(ARITH)mumps_sol_es.o:         $(ARITH)lr_type.o \
++                                $(ARITH)mumps_lr_data_m.o
++
++$(ARITH)mumps_save_restore.o:   $(ARITH)mumps_struc_def.o \
++                                $(ARITH)mumps_save_restore_files.o \
++                                $(ARITH)mumps_lr_data_m.o \
++                                $(ARITH)mumps_ooc.o \
++                                $(ARITH)fac_sol_l0omp_m.o \
++                                front_data_mgt_m.o
++
++$(ARITH)mumps_save_restore_files.o : $(ARITH)mumps_struc_def.o
++
++$(ARITH)sol_lr.o:               $(ARITH)lr_type.o\
++                                $(ARITH)lr_stats.o\
++                                $(ARITH)mumps_lr_data_m.o
++
++$(ARITH)sol_omp_m.o:            $(ARITH)mumps_struc_def.o
++
++
++
++
++
++# Dependencies between modules:
++# ii) arithmetic-independent modules:
++
++ana_omp_m.o:                     double_linked_list.o
++fac_asm_build_sort_index_ELT_m.o:omp_tps_common_m.o
++fac_asm_build_sort_index_m.o:    omp_tps_common_m.o
++fac_descband_data_m.o:           front_data_mgt_m.o
++fac_ibct_data_m.o:               front_data_mgt_m.o
++fac_maprow_data_m.o:             front_data_mgt_m.o
++mumps_comm_ibcast.o:             fac_future_niv2_mod.o
++mumps_static_mapping.o:          lr_common.o
++
++
++# Compile modules before the rest
++$(OBJS_COMMON_OTHER):$(OBJS_COMMON_MOD)
++$(OBJS_OTHER):$(OBJS_COMMON_MOD) $(OBJS_MOD)
++
++.SUFFIXES: .c .F .o
++.F.o:
++	$(FC) $(OPTF) -I. -I../include $(INCS) $(IORDERINGSF) $(ORDERINGSF) -c $*.F $(OUTF) $*.o
++.c.o:
++	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) $(IORDERINGSC) $(ORDERINGSC) -c $*.c $(OUTC) $*.o
++
++$(ARITH)mumps_c.o:	mumps_c.c
++	$(CC) $(OPTC) -I../include $(INCS) $(CDEFS) -DMUMPS_ARITH=MUMPS_ARITH_$(ARITH) \
++	      $(IORDERINGSC) $(ORDERINGSC) -c mumps_c.c $(OUTC) $@
++
++clean:
++	$(RM) *.o *.mod $(incdir)/mumps_int_def.h
+Index: ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh	(revision 26034)
+@@ -0,0 +1,61 @@
++#!/bin/bash
++set -eu
++
++
++# Sources:
++# - https://www.scivision.dev/windows-mpi-msys2/
++#
++# NOTE:
++# - Source is pulled from https://github.com/scivision/mumps/releases, which 
++#	provides patches to the releases from developer (http://mumps-solver.org/)
++#
++# TODO:
++# - Create install alias in Makefiles
++# - Alternatively, use cmake rather than make
++#
++
++## Constants
++#
++VER=5.3.5.2
++
++PREFIX="${ISSM_DIR}/externalpackages/mumps/install"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src src/lib
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/mumps-${VER}.tar.gz" "mumps-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf mumps-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv mumps-${VER}/* src
++rm -rf mumps-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/5.3/win/msys2/gcc/msmpi/Makefile.inc src
++cp configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile src/libseq
++cp configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile src/PORD/lib
++cp configs/5.3/win/msys2/gcc/msmpi/src/Makefile src/src
++
++# Compile
++cd src
++if [ $# -eq 0 ]; then
++	make all
++else
++	make -j $1 all
++fi
++
++# Install
++mkdir ${PREFIX}/lib
++cp lib/lib* ${PREFIX}/lib
++cp libseq/lib* ${PREFIX}/lib
++mkdir ${PREFIX}/include
++cp include/* ${PREFIX}/include
++
++# Create link to lib directory (PETSc, by default, looks for libraries in 
++# lib64/ if it detects that 64-bit integers are being used).
++cd ${PREFIX}
++ln -s lib lib64
+
+Property changes on: ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh	(revision 26034)
+@@ -0,0 +1,61 @@
++#!/bin/bash
++set -eu
++
++
++# Sources:
++# - https://www.scivision.dev/windows-mpi-msys2/
++#
++# NOTE:
++# - Source is pulled from https://github.com/scivision/mumps/releases, which 
++#	provides patches to the releases from developer (http://mumps-solver.org/)
++#
++# TODO:
++# - Create install alias in Makefiles
++# - Alternatively, use cmake rather than make
++#
++
++## Constants
++#
++VER=5.3.5.2
++
++PREFIX="${ISSM_DIR}/externalpackages/mumps/install"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src src/lib
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/mumps-${VER}.tar.gz" "mumps-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf mumps-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv mumps-${VER}/* src
++rm -rf mumps-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc src
++cp configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile src/libseq
++cp configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile src/PORD/lib
++cp configs/5.3/win/msys2/mingw64/msmpi/src/Makefile src/src
++
++# Compile
++cd src
++if [ $# -eq 0 ]; then
++	make all
++else
++	make -j $1 all
++fi
++
++# Install
++mkdir ${PREFIX}/lib
++cp lib/lib* ${PREFIX}/lib
++cp libseq/lib* ${PREFIX}/lib
++mkdir ${PREFIX}/include
++cp include/* ${PREFIX}/include
++
++# Create link to lib directory (PETSc, by default, looks for libraries in 
++# lib64/ if it detects that 64-bit integers are being used).
++cd ${PREFIX}
++ln -s lib lib64
+
+Property changes on: ../trunk-jpl/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/parmetis/compil.log
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/compil.log	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/compil.log	(revision 26034)
+@@ -0,0 +1,524 @@
++File parmetis-4.0.3.tar.gz already exists and will not be downloaded...
++parmetis-4.0.3/
++parmetis-4.0.3/build/
++parmetis-4.0.3/BUILD.txt
++parmetis-4.0.3/Changelog
++parmetis-4.0.3/CMakeLists.txt
++parmetis-4.0.3/Graphs/
++parmetis-4.0.3/include/
++parmetis-4.0.3/Install.txt
++parmetis-4.0.3/libparmetis/
++parmetis-4.0.3/LICENSE.txt
++parmetis-4.0.3/Makefile
++parmetis-4.0.3/manual/
++parmetis-4.0.3/metis/
++parmetis-4.0.3/programs/
++parmetis-4.0.3/programs/adaptgraph.c
++parmetis-4.0.3/programs/CMakeLists.txt
++parmetis-4.0.3/programs/io.c
++parmetis-4.0.3/programs/mtest.c
++parmetis-4.0.3/programs/otest.c
++parmetis-4.0.3/programs/parmetis.c
++parmetis-4.0.3/programs/parmetisbin.h
++parmetis-4.0.3/programs/plotorder.pl
++parmetis-4.0.3/programs/pometis.c
++parmetis-4.0.3/programs/proto.h
++parmetis-4.0.3/programs/ptest.c
++parmetis-4.0.3/metis/build/
++parmetis-4.0.3/metis/BUILD-Windows.txt
++parmetis-4.0.3/metis/BUILD.txt
++parmetis-4.0.3/metis/Changelog
++parmetis-4.0.3/metis/CMakeLists.txt
++parmetis-4.0.3/metis/GKlib/
++parmetis-4.0.3/metis/include/
++parmetis-4.0.3/metis/Install.txt
++parmetis-4.0.3/metis/libmetis/
++parmetis-4.0.3/metis/LICENSE.txt
++parmetis-4.0.3/metis/Makefile
++parmetis-4.0.3/metis/programs/
++parmetis-4.0.3/metis/vsgen.bat
++parmetis-4.0.3/metis/programs/CMakeLists.txt
++parmetis-4.0.3/metis/programs/cmdline_gpmetis.c
++parmetis-4.0.3/metis/programs/cmdline_m2gmetis.c
++parmetis-4.0.3/metis/programs/cmdline_mpmetis.c
++parmetis-4.0.3/metis/programs/cmdline_ndmetis.c
++parmetis-4.0.3/metis/programs/cmpfillin.c
++parmetis-4.0.3/metis/programs/defs.h
++parmetis-4.0.3/metis/programs/gpmetis.c
++parmetis-4.0.3/metis/programs/graphchk.c
++parmetis-4.0.3/metis/programs/io.c
++parmetis-4.0.3/metis/programs/m2gmetis.c
++parmetis-4.0.3/metis/programs/metisbin.h
++parmetis-4.0.3/metis/programs/mpmetis.c
++parmetis-4.0.3/metis/programs/ndmetis.c
++parmetis-4.0.3/metis/programs/proto.h
++parmetis-4.0.3/metis/programs/smbfactor.c
++parmetis-4.0.3/metis/programs/stat.c
++parmetis-4.0.3/metis/programs/struct.h
++parmetis-4.0.3/metis/libmetis/auxapi.c
++parmetis-4.0.3/metis/libmetis/balance.c
++parmetis-4.0.3/metis/libmetis/bucketsort.c
++parmetis-4.0.3/metis/libmetis/checkgraph.c
++parmetis-4.0.3/metis/libmetis/CMakeLists.txt
++parmetis-4.0.3/metis/libmetis/coarsen.c
++parmetis-4.0.3/metis/libmetis/compress.c
++parmetis-4.0.3/metis/libmetis/contig.c
++parmetis-4.0.3/metis/libmetis/debug.c
++parmetis-4.0.3/metis/libmetis/defs.h
++parmetis-4.0.3/metis/libmetis/fm.c
++parmetis-4.0.3/metis/libmetis/fortran.c
++parmetis-4.0.3/metis/libmetis/frename.c
++parmetis-4.0.3/metis/libmetis/gklib.c
++parmetis-4.0.3/metis/libmetis/gklib_defs.h
++parmetis-4.0.3/metis/libmetis/gklib_rename.h
++parmetis-4.0.3/metis/libmetis/graph.c
++parmetis-4.0.3/metis/libmetis/initpart.c
++parmetis-4.0.3/metis/libmetis/kmetis.c
++parmetis-4.0.3/metis/libmetis/kwayfm.c
++parmetis-4.0.3/metis/libmetis/kwayrefine.c
++parmetis-4.0.3/metis/libmetis/macros.h
++parmetis-4.0.3/metis/libmetis/mcutil.c
++parmetis-4.0.3/metis/libmetis/mesh.c
++parmetis-4.0.3/metis/libmetis/meshpart.c
++parmetis-4.0.3/metis/libmetis/metislib.h
++parmetis-4.0.3/metis/libmetis/minconn.c
++parmetis-4.0.3/metis/libmetis/mincover.c
++parmetis-4.0.3/metis/libmetis/mmd.c
++parmetis-4.0.3/metis/libmetis/ometis.c
++parmetis-4.0.3/metis/libmetis/options.c
++parmetis-4.0.3/metis/libmetis/parmetis.c
++parmetis-4.0.3/metis/libmetis/pmetis.c
++parmetis-4.0.3/metis/libmetis/proto.h
++parmetis-4.0.3/metis/libmetis/refine.c
++parmetis-4.0.3/metis/libmetis/rename.h
++parmetis-4.0.3/metis/libmetis/separator.c
++parmetis-4.0.3/metis/libmetis/sfm.c
++parmetis-4.0.3/metis/libmetis/srefine.c
++parmetis-4.0.3/metis/libmetis/stat.c
++parmetis-4.0.3/metis/libmetis/stdheaders.h
++parmetis-4.0.3/metis/libmetis/struct.h
++parmetis-4.0.3/metis/libmetis/timing.c
++parmetis-4.0.3/metis/libmetis/util.c
++parmetis-4.0.3/metis/libmetis/wspace.c
++parmetis-4.0.3/metis/include/CMakeLists.txt
++parmetis-4.0.3/metis/include/metis.h
++parmetis-4.0.3/metis/GKlib/b64.c
++parmetis-4.0.3/metis/GKlib/blas.c
++parmetis-4.0.3/metis/GKlib/BUILD.txt
++parmetis-4.0.3/metis/GKlib/CMakeLists.txt
++parmetis-4.0.3/metis/GKlib/conf/
++parmetis-4.0.3/metis/GKlib/csr.c
++parmetis-4.0.3/metis/GKlib/error.c
++parmetis-4.0.3/metis/GKlib/evaluate.c
++parmetis-4.0.3/metis/GKlib/fkvkselect.c
++parmetis-4.0.3/metis/GKlib/fs.c
++parmetis-4.0.3/metis/GKlib/getopt.c
++parmetis-4.0.3/metis/GKlib/gk_arch.h
++parmetis-4.0.3/metis/GKlib/gk_defs.h
++parmetis-4.0.3/metis/GKlib/gk_externs.h
++parmetis-4.0.3/metis/GKlib/gk_getopt.h
++parmetis-4.0.3/metis/GKlib/gk_macros.h
++parmetis-4.0.3/metis/GKlib/gk_mkblas.h
++parmetis-4.0.3/metis/GKlib/gk_mkmemory.h
++parmetis-4.0.3/metis/GKlib/gk_mkpqueue.h
++parmetis-4.0.3/metis/GKlib/gk_mkpqueue2.h
++parmetis-4.0.3/metis/GKlib/gk_mkrandom.h
++parmetis-4.0.3/metis/GKlib/gk_mksort.h
++parmetis-4.0.3/metis/GKlib/gk_mkutils.h
++parmetis-4.0.3/metis/GKlib/gk_proto.h
++parmetis-4.0.3/metis/GKlib/gk_struct.h
++parmetis-4.0.3/metis/GKlib/gk_types.h
++parmetis-4.0.3/metis/GKlib/GKlib.h
++parmetis-4.0.3/metis/GKlib/GKlibSystem.cmake
++parmetis-4.0.3/metis/GKlib/gkregex.c
++parmetis-4.0.3/metis/GKlib/gkregex.h
++parmetis-4.0.3/metis/GKlib/graph.c
++parmetis-4.0.3/metis/GKlib/htable.c
++parmetis-4.0.3/metis/GKlib/io.c
++parmetis-4.0.3/metis/GKlib/itemsets.c
++parmetis-4.0.3/metis/GKlib/Makefile
++parmetis-4.0.3/metis/GKlib/mcore.c
++parmetis-4.0.3/metis/GKlib/memory.c
++parmetis-4.0.3/metis/GKlib/ms_inttypes.h
++parmetis-4.0.3/metis/GKlib/ms_stat.h
++parmetis-4.0.3/metis/GKlib/ms_stdint.h
++parmetis-4.0.3/metis/GKlib/omp.c
++parmetis-4.0.3/metis/GKlib/pdb.c
++parmetis-4.0.3/metis/GKlib/pqueue.c
++parmetis-4.0.3/metis/GKlib/random.c
++parmetis-4.0.3/metis/GKlib/rw.c
++parmetis-4.0.3/metis/GKlib/seq.c
++parmetis-4.0.3/metis/GKlib/sort.c
++parmetis-4.0.3/metis/GKlib/string.c
++parmetis-4.0.3/metis/GKlib/test/
++parmetis-4.0.3/metis/GKlib/timers.c
++parmetis-4.0.3/metis/GKlib/tokenizer.c
++parmetis-4.0.3/metis/GKlib/util.c
++parmetis-4.0.3/metis/GKlib/test/CMakeLists.txt
++parmetis-4.0.3/metis/GKlib/test/fis.c
++parmetis-4.0.3/metis/GKlib/test/gkgraph.c
++parmetis-4.0.3/metis/GKlib/test/gksort.c
++parmetis-4.0.3/metis/GKlib/test/Makefile.in.old
++parmetis-4.0.3/metis/GKlib/test/Makefile.old
++parmetis-4.0.3/metis/GKlib/test/rw.c
++parmetis-4.0.3/metis/GKlib/test/strings.c
++parmetis-4.0.3/metis/GKlib/conf/check_thread_storage.c
++parmetis-4.0.3/manual/manual.pdf
++parmetis-4.0.3/libparmetis/akwayfm.c
++parmetis-4.0.3/libparmetis/ametis.c
++parmetis-4.0.3/libparmetis/balancemylink.c
++parmetis-4.0.3/libparmetis/CMakeLists.txt
++parmetis-4.0.3/libparmetis/comm.c
++parmetis-4.0.3/libparmetis/csrmatch.c
++parmetis-4.0.3/libparmetis/ctrl.c
++parmetis-4.0.3/libparmetis/debug.c
++parmetis-4.0.3/libparmetis/defs.h
++parmetis-4.0.3/libparmetis/diffutil.c
++parmetis-4.0.3/libparmetis/frename.c
++parmetis-4.0.3/libparmetis/gkmetis.c
++parmetis-4.0.3/libparmetis/gkmpi.c
++parmetis-4.0.3/libparmetis/graph.c
++parmetis-4.0.3/libparmetis/initbalance.c
++parmetis-4.0.3/libparmetis/initmsection.c
++parmetis-4.0.3/libparmetis/initpart.c
++parmetis-4.0.3/libparmetis/kmetis.c
++parmetis-4.0.3/libparmetis/kwayrefine.c
++parmetis-4.0.3/libparmetis/macros.h
++parmetis-4.0.3/libparmetis/match.c
++parmetis-4.0.3/libparmetis/mdiffusion.c
++parmetis-4.0.3/libparmetis/mesh.c
++parmetis-4.0.3/libparmetis/mmetis.c
++parmetis-4.0.3/libparmetis/move.c
++parmetis-4.0.3/libparmetis/msetup.c
++parmetis-4.0.3/libparmetis/node_refine.c
++parmetis-4.0.3/libparmetis/ometis.c
++parmetis-4.0.3/libparmetis/parmetislib.h
++parmetis-4.0.3/libparmetis/proto.h
++parmetis-4.0.3/libparmetis/pspases.c
++parmetis-4.0.3/libparmetis/redomylink.c
++parmetis-4.0.3/libparmetis/remap.c
++parmetis-4.0.3/libparmetis/rename.h
++parmetis-4.0.3/libparmetis/renumber.c
++parmetis-4.0.3/libparmetis/rmetis.c
++parmetis-4.0.3/libparmetis/selectq.c
++parmetis-4.0.3/libparmetis/serial.c
++parmetis-4.0.3/libparmetis/stat.c
++parmetis-4.0.3/libparmetis/struct.h
++parmetis-4.0.3/libparmetis/timer.c
++parmetis-4.0.3/libparmetis/util.c
++parmetis-4.0.3/libparmetis/wave.c
++parmetis-4.0.3/libparmetis/weird.c
++parmetis-4.0.3/libparmetis/wspace.c
++parmetis-4.0.3/libparmetis/xyzpart.c
++parmetis-4.0.3/include/CMakeLists.txt
++parmetis-4.0.3/include/parmetis.h
++parmetis-4.0.3/Graphs/bricks.hex3d
++parmetis-4.0.3/Graphs/rotor.graph
++parmetis-4.0.3/Graphs/rotor.graph.xyz
++rm -rf build/MSYS_NT-10.0-17763-x86_64
++mkdir -p build/MSYS_NT-10.0-17763-x86_64
++cd build/MSYS_NT-10.0-17763-x86_64 && cmake /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src -DCMAKE_VERBOSE_MAKEFILE=1 -DGKLIB_PATH=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -DMETIS_PATH=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install -DLOCAL_MSMPI=1 -DMSMPI_ROOT=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI -DCMAKE_INSTALL_PREFIX=/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install -DSHARED=1 -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
++CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
++  Compatibility with CMake < 2.8.12 will be removed from a future version of
++  CMake.
++
++  Update the VERSION argument <min> value or use a ...<max> suffix to tell
++  CMake that the project does not need compatibility with older versions.
++
++
++-- The C compiler identification is GNU 10.2.0
++-- The CXX compiler identification is GNU 10.2.0
++CMake Warning at /usr/share/cmake-3.19.3/Modules/Platform/MSYS.cmake:15 (message):
++  CMake no longer defines WIN32 on MSYS!
++
++  (1) If you are just trying to build this project, ignore this warning or
++  quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
++  the CMake cache.  If later configuration or build errors occur then this
++  project may have been written under the assumption that MSYS is WIN32.  In
++  that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.
++
++  (2) If you are developing this project, add the line
++
++    set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
++
++  at the top of your top-level CMakeLists.txt file or set the minimum
++  required version of CMake to 2.8.4 or higher.  Then teach your project to
++  build on Cygwin without WIN32.
++Call Stack (most recent call first):
++  /usr/share/cmake-3.19.3/Modules/CMakeSystemSpecificInformation.cmake:27 (include)
++  CMakeLists.txt:2 (project)
++
++
++-- Detecting C compiler ABI info
++-- Detecting C compiler ABI info - done
++-- Check for working C compiler: /usr/bin/gcc - skipped
++-- Detecting C compile features
++-- Detecting C compile features - done
++-- Detecting CXX compiler ABI info
++-- Detecting CXX compiler ABI info - done
++-- Check for working CXX compiler: /usr/bin/g++ - skipped
++-- Detecting CXX compile features
++-- Detecting CXX compile features - done
++-- Looking for execinfo.h
++-- Looking for execinfo.h - not found
++-- Looking for getline
++-- Looking for getline - found
++-- checking for thread-local storage - found
++-- Found user-supplied METIS: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/lib/libmetis.dll
++-- MSMPI: /c/Windows/System32/msmpi.dll
++-- Configuring done
++-- Generating done
++-- Build files have been written to: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64
++make[1]: warning: -j4 forced in submake: resetting jobserver mode.
++make[1]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++/usr/bin/cmake.exe -S/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src -B/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 --check-build-system CMakeFiles/Makefile.cmake 0
++/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64//CMakeFiles/progress.marks
++make  -f CMakeFiles/Makefile2 all
++make[2]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/depend
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis/CMakeFiles/parmetis.dir/DependInfo.cmake --color=
++Scanning dependencies of target parmetis
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/build
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[  1%] Building C object libparmetis/CMakeFiles/parmetis.dir/akwayfm.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/akwayfm.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/akwayfm.c
++[  3%] Building C object libparmetis/CMakeFiles/parmetis.dir/ametis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/ametis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/ametis.c
++[  5%] Building C object libparmetis/CMakeFiles/parmetis.dir/balancemylink.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/balancemylink.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c
++[  7%] Building C object libparmetis/CMakeFiles/parmetis.dir/comm.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/comm.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/comm.c
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c: In function ‘libparmetis__BalanceMyLink’:
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c:324:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
++  324 |     if (where[i] != home[i])
++      |     ^~
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/balancemylink.c:327:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
++  327 |       for (j=xadj[i]; j<xadj[i+1]; j++) {
++      |       ^~~
++[  9%] Building C object libparmetis/CMakeFiles/parmetis.dir/csrmatch.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/csrmatch.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/csrmatch.c
++[ 11%] Building C object libparmetis/CMakeFiles/parmetis.dir/ctrl.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/ctrl.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/ctrl.c
++[ 12%] Building C object libparmetis/CMakeFiles/parmetis.dir/debug.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/debug.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/debug.c
++[ 14%] Building C object libparmetis/CMakeFiles/parmetis.dir/diffutil.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/diffutil.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/diffutil.c
++[ 16%] Building C object libparmetis/CMakeFiles/parmetis.dir/frename.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/frename.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/frename.c
++[ 18%] Building C object libparmetis/CMakeFiles/parmetis.dir/gkmetis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/gkmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/gkmetis.c
++[ 20%] Building C object libparmetis/CMakeFiles/parmetis.dir/gkmpi.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/gkmpi.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/gkmpi.c
++[ 22%] Building C object libparmetis/CMakeFiles/parmetis.dir/graph.c.o
++[ 24%] Building C object libparmetis/CMakeFiles/parmetis.dir/initbalance.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/graph.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/graph.c
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/initbalance.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/initbalance.c
++[ 25%] Building C object libparmetis/CMakeFiles/parmetis.dir/initmsection.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/initmsection.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/initmsection.c
++[ 27%] Building C object libparmetis/CMakeFiles/parmetis.dir/initpart.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/initpart.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/initpart.c
++[ 29%] Building C object libparmetis/CMakeFiles/parmetis.dir/kmetis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/kmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/kmetis.c
++[ 31%] Building C object libparmetis/CMakeFiles/parmetis.dir/kwayrefine.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/kwayrefine.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/kwayrefine.c
++[ 33%] Building C object libparmetis/CMakeFiles/parmetis.dir/match.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/match.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/match.c
++[ 35%] Building C object libparmetis/CMakeFiles/parmetis.dir/mdiffusion.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/mdiffusion.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/mdiffusion.c
++[ 37%] Building C object libparmetis/CMakeFiles/parmetis.dir/mesh.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/mesh.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/mesh.c
++[ 38%] Building C object libparmetis/CMakeFiles/parmetis.dir/mmetis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/mmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/mmetis.c
++[ 40%] Building C object libparmetis/CMakeFiles/parmetis.dir/move.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/move.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/move.c
++[ 42%] Building C object libparmetis/CMakeFiles/parmetis.dir/msetup.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/msetup.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/msetup.c
++[ 44%] Building C object libparmetis/CMakeFiles/parmetis.dir/node_refine.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/node_refine.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/node_refine.c
++[ 46%] Building C object libparmetis/CMakeFiles/parmetis.dir/ometis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/ometis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/ometis.c
++[ 48%] Building C object libparmetis/CMakeFiles/parmetis.dir/pspases.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/pspases.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/pspases.c
++[ 50%] Building C object libparmetis/CMakeFiles/parmetis.dir/redomylink.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/redomylink.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/redomylink.c
++[ 51%] Building C object libparmetis/CMakeFiles/parmetis.dir/remap.c.o
++[ 53%] Building C object libparmetis/CMakeFiles/parmetis.dir/renumber.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/renumber.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/renumber.c
++[ 55%] Building C object libparmetis/CMakeFiles/parmetis.dir/rmetis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/remap.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/remap.c
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/rmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/rmetis.c
++[ 57%] Building C object libparmetis/CMakeFiles/parmetis.dir/selectq.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/selectq.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/selectq.c
++[ 59%] Building C object libparmetis/CMakeFiles/parmetis.dir/serial.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/serial.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/serial.c
++[ 61%] Building C object libparmetis/CMakeFiles/parmetis.dir/stat.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/stat.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/stat.c
++[ 62%] Building C object libparmetis/CMakeFiles/parmetis.dir/timer.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/timer.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/timer.c
++[ 64%] Building C object libparmetis/CMakeFiles/parmetis.dir/util.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/util.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/util.c
++[ 66%] Building C object libparmetis/CMakeFiles/parmetis.dir/wave.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/wave.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wave.c
++[ 68%] Building C object libparmetis/CMakeFiles/parmetis.dir/weird.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/weird.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/weird.c
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wave.c: In function ‘libparmetis__WavefrontDiffusion’:
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wave.c:253:1: warning: label ‘CleanUpAndExit’ defined but not used [-Wunused-label]
++  253 | CleanUpAndExit:
++      | ^~~~~~~~~~~~~~
++[ 70%] Building C object libparmetis/CMakeFiles/parmetis.dir/wspace.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/wspace.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/wspace.c
++[ 72%] Building C object libparmetis/CMakeFiles/parmetis.dir/xyzpart.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/gcc -Dparmetis_EXPORTS -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis.dir/xyzpart.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis/xyzpart.c
++[ 74%] Linking C shared library msys-parmetis.dll
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/parmetis.dir/link.txt --verbose=1
++/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -shared -Wl,--enable-auto-import -o msys-parmetis.dll -Wl,--out-implib,libparmetis.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles/parmetis.dir/akwayfm.c.o CMakeFiles/parmetis.dir/ametis.c.o CMakeFiles/parmetis.dir/balancemylink.c.o CMakeFiles/parmetis.dir/comm.c.o CMakeFiles/parmetis.dir/csrmatch.c.o CMakeFiles/parmetis.dir/ctrl.c.o CMakeFiles/parmetis.dir/debug.c.o CMakeFiles/parmetis.dir/diffutil.c.o CMakeFiles/parmetis.dir/frename.c.o CMakeFiles/parmetis.dir/gkmetis.c.o CMakeFiles/parmetis.dir/gkmpi.c.o CMakeFiles/parmetis.dir/graph.c.o CMakeFiles/parmetis.dir/initbalance.c.o CMakeFiles/parmetis.dir/initmsection.c.o CMakeFiles/parmetis.dir/initpart.c.o CMakeFiles/parmetis.dir/kmetis.c.o CMakeFiles/parmetis.dir/kwayrefine.c.o CMakeFiles/parmetis.dir/match.c.o CMakeFiles/parmetis.dir/mdiffusion.c.o CMakeFiles/parmetis.dir/mesh.c.o CMakeFiles/parmetis.dir/mmetis.c.o CMakeFiles/parmetis.dir/move.c.o CMakeFiles/parmetis.dir/msetup.c.o CMakeFiles/parmetis.dir/node_refine.c.o CMakeFiles/parmetis.dir/ometis.c.o CMakeFiles/parmetis.dir/pspases.c.o CMakeFiles/parmetis.dir/redomylink.c.o CMakeFiles/parmetis.dir/remap.c.o CMakeFiles/parmetis.dir/renumber.c.o CMakeFiles/parmetis.dir/rmetis.c.o CMakeFiles/parmetis.dir/selectq.c.o CMakeFiles/parmetis.dir/serial.c.o CMakeFiles/parmetis.dir/stat.c.o CMakeFiles/parmetis.dir/timer.c.o CMakeFiles/parmetis.dir/util.c.o CMakeFiles/parmetis.dir/wave.c.o CMakeFiles/parmetis.dir/weird.c.o CMakeFiles/parmetis.dir/wspace.c.o CMakeFiles/parmetis.dir/xyzpart.c.o  -lmetis /c/Windows/System32/msmpi.dll 
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[ 74%] Built target parmetis
++make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/depend
++make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/depend
++make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/depend
++make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/depend
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/pometis.dir/DependInfo.cmake --color=
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/parmetis_prog.dir/DependInfo.cmake --color=
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/mtest.dir/DependInfo.cmake --color=
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/ptest.dir/DependInfo.cmake --color=
++Scanning dependencies of target pometis
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++Scanning dependencies of target mtest
++make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/build
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++Scanning dependencies of target parmetis_prog
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/build
++Scanning dependencies of target ptest
++make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/build
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/build
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[ 75%] Building C object programs/CMakeFiles/pometis.dir/pometis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/pometis.dir/pometis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/pometis.c
++[ 77%] Building C object programs/CMakeFiles/mtest.dir/mtest.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/mtest.dir/mtest.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/mtest.c
++[ 79%] Building C object programs/CMakeFiles/ptest.dir/ptest.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/ptest.dir/ptest.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c
++[ 81%] Building C object programs/CMakeFiles/parmetis_prog.dir/parmetis.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis_prog.dir/parmetis.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/parmetis.c
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c: In function ‘TestParMetis_GPart’:
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c:166:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
++  166 |     if (mype == 0)
++      |     ^~
++/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/ptest.c:169:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
++  169 |       ParMETIS_V3_PartGeom(graph.vtxdist, &ndims, xyz, part, &comm);
++      |       ^~~~~~~~~~~~~~~~~~~~
++[ 83%] Building C object programs/CMakeFiles/pometis.dir/io.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/pometis.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
++[ 85%] Building C object programs/CMakeFiles/mtest.dir/io.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/mtest.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
++[ 87%] Building C object programs/CMakeFiles/parmetis_prog.dir/io.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis_prog.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
++[ 88%] Building C object programs/CMakeFiles/ptest.dir/io.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/ptest.dir/io.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/io.c
++[ 90%] Linking C executable pometis.exe
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/pometis.dir/link.txt --verbose=1
++/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/pometis.dir/pometis.c.o CMakeFiles/pometis.dir/io.c.o -o pometis.exe -Wl,--out-implib,libpometis.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
++[ 92%] Linking C executable mtest.exe
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/mtest.dir/link.txt --verbose=1
++/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/mtest.dir/mtest.c.o CMakeFiles/mtest.dir/io.c.o -o mtest.exe -Wl,--out-implib,libmtest.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
++[ 94%] Building C object programs/CMakeFiles/parmetis_prog.dir/adaptgraph.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/parmetis_prog.dir/adaptgraph.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/adaptgraph.c
++[ 96%] Building C object programs/CMakeFiles/ptest.dir/adaptgraph.c.o
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/gcc  -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/GKlib -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/metis/install/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/MSMPI/include -I/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -o CMakeFiles/ptest.dir/adaptgraph.c.o -c /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs/adaptgraph.c
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[ 96%] Built target pometis
++[ 96%] Built target mtest
++[ 98%] Linking C executable parmetis.exe
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/parmetis_prog.dir/link.txt --verbose=1
++/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/parmetis_prog.dir/parmetis.c.o CMakeFiles/parmetis_prog.dir/io.c.o CMakeFiles/parmetis_prog.dir/adaptgraph.c.o -o parmetis.exe -Wl,--out-implib,libparmetis.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
++[100%] Linking C executable ptest.exe
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/ptest.dir/link.txt --verbose=1
++/usr/bin/gcc  -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -fPIC -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -DNDEBUG -DNDEBUG2 -DHAVE_GETLINE -O3 -Wl,--enable-auto-import CMakeFiles/ptest.dir/ptest.c.o CMakeFiles/ptest.dir/io.c.o CMakeFiles/ptest.dir/adaptgraph.c.o -o ptest.exe -Wl,--out-implib,libptest.dll.a -Wl,--major-image-version,0,--minor-image-version,0  ../libparmetis/libparmetis.dll.a -lmetis /c/Windows/System32/msmpi.dll 
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[100%] Built target parmetis_prog
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[100%] Built target ptest
++make[2]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles 0
++make[1]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[1]: warning: -j4 forced in submake: resetting jobserver mode.
++make[1]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++/usr/bin/cmake.exe -S/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src -B/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 --check-build-system CMakeFiles/Makefile.cmake 0
++/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64//CMakeFiles/progress.marks
++make  -f CMakeFiles/Makefile2 all
++make[2]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/depend
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/libparmetis/CMakeFiles/parmetis.dir/DependInfo.cmake --color=
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/build
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Nothing to be done for 'libparmetis/CMakeFiles/parmetis.dir/build'.
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[ 74%] Built target parmetis
++make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/depend
++make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/depend
++make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/depend
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/pometis.dir/DependInfo.cmake --color=
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/parmetis_prog.dir/DependInfo.cmake --color=
++make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/depend
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/ptest.dir/DependInfo.cmake --color=
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++cd /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64 /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/programs/CMakeFiles/mtest.dir/DependInfo.cmake --color=
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f programs/CMakeFiles/parmetis_prog.dir/build.make programs/CMakeFiles/parmetis_prog.dir/build
++make  -f programs/CMakeFiles/pometis.dir/build.make programs/CMakeFiles/pometis.dir/build
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Nothing to be done for 'programs/CMakeFiles/parmetis_prog.dir/build'.
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Nothing to be done for 'programs/CMakeFiles/pometis.dir/build'.
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make  -f programs/CMakeFiles/ptest.dir/build.make programs/CMakeFiles/ptest.dir/build
++make  -f programs/CMakeFiles/mtest.dir/build.make programs/CMakeFiles/mtest.dir/build
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Nothing to be done for 'programs/CMakeFiles/ptest.dir/build'.
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[ 79%] Built target pometis
++[ 87%] Built target parmetis_prog
++make[3]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[3]: Nothing to be done for 'programs/CMakeFiles/mtest.dir/build'.
++make[3]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++[ 94%] Built target ptest
++[100%] Built target mtest
++make[2]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++/usr/bin/cmake.exe -E cmake_progress_start /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64/CMakeFiles 0
++make  -f CMakeFiles/Makefile2 preinstall
++make[2]: Entering directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++make[2]: Nothing to be done for 'preinstall'.
++make[2]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
++Install the project...
++/usr/bin/cmake.exe -P cmake_install.cmake
++-- Install configuration: ""
++-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/include/parmetis.h
++-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/lib/libparmetis.dll.a
++-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/lib/msys-parmetis.dll
++-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/ptest.exe
++-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/mtest.exe
++-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/parmetis.exe
++-- Installing: /c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/install/bin/pometis.exe
++make[1]: Leaving directory '/c/Users/jdq/Repos/issm/issm/trunk-jpl-working/externalpackages/parmetis/src/build/MSYS_NT-10.0-17763-x86_64'
+Index: ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/CMakeLists.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/CMakeLists.txt	(revision 26034)
+@@ -0,0 +1,45 @@
++cmake_minimum_required(VERSION 2.8)
++project(ParMETIS)
++
++set(GKLIB_PATH METIS/GKlib CACHE PATH "path to GKlib")
++set(METIS_PATH METIS CACHE PATH "path to METIS")
++
++# Symlink ./metis to wherever metis is. This allows files to be
++# included from metis/libmetis/.
++#execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${METIS_PATH} metis)
++
++# Search for MPI.
++# GK commented this out as it seems to be creating problems
++# include(FindMPI)
++# if(NOT MPI_FOUND)
++#   message(FATAL_ERROR "mpi is not found")
++# endif()
++# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_COMPILE_FLAGS}")
++
++# Prepare libraries.
++if(SHARED)
++  set(ParMETIS_LIBRARY_TYPE SHARED)
++else()
++  set(ParMETIS_LIBRARY_TYPE STATIC)
++endif()
++
++include(${GKLIB_PATH}/GKlibSystem.cmake)
++
++# List of paths that the compiler will search for header files.
++# i.e., the -I equivalent
++include_directories(include)
++include_directories(${GKLIB_PATH})
++include_directories(${METIS_PATH}/include)
++
++if(LOCAL_MSMPI)
++	include_directories(${MSMPI_ROOT}/include)
++endif()
++
++# List of directories that cmake will look for CMakeLists.txt
++#add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
++add_subdirectory(include)
++add_subdirectory(libparmetis)
++add_subdirectory(programs)
++
++# This is for testing during development and is not being distributed
++#add_subdirectory(test)
+Index: ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/Makefile	(revision 26034)
+@@ -0,0 +1,133 @@
++# Configuration options.
++gdb              = not-set
++assert           = not-set
++assert2          = not-set
++debug            = not-set
++openmp           = not-set
++prefix           = not-set
++gklib_path       = not-set
++metis_path       = not-set
++msmpi_root       = not-set
++shared           = not-set
++cc               = mpicc
++cxx              = mpicxx
++ar               = not-set
++gcc-ar           = not-set
++ranlib           = not-set
++gcc-ranlib       = not-set
++linker           = not-set
++nm               = not-set
++objcopy          = not-set
++objdump          = not-set
++rc               = not-set
++strip            = not-set
++
++
++# Basically proxies everything to the builddir cmake.
++
++PKGNAME = parmetis-4.0.3
++
++cputype = $(shell uname -m | sed "s/\\ /_/g")
++systype = $(shell uname -s)
++
++BUILDDIR = build/$(systype)-$(cputype)
++
++# Process configuration options.
++CONFIG_FLAGS = -DCMAKE_VERBOSE_MAKEFILE=1
++ifeq ($(gklib_path), not-set)
++    gklib_path = metis/GKlib
++endif
++ifeq ($(metis_path), not-set)
++    metis_path = metis
++endif
++CONFIG_FLAGS += -DGKLIB_PATH=$(abspath $(gklib_path)) -DMETIS_PATH=$(abspath $(metis_path))
++ifneq ($(local_msmpi), not-set)
++    CONFIG_FLAGS += -DLOCAL_MSMPI=1 -DMSMPI_ROOT=$(abspath $(msmpi_root))
++endif
++ifneq ($(gdb), not-set)
++    CONFIG_FLAGS += -DGDB=$(gdb)
++endif
++ifneq ($(assert), not-set)
++    CONFIG_FLAGS += -DASSERT=$(assert)
++endif
++ifneq ($(assert2), not-set)
++    CONFIG_FLAGS += -DASSERT2=$(assert2)
++endif
++ifneq ($(debug), not-set)
++    CONFIG_FLAGS += -DDEBUG=$(debug)
++endif
++ifneq ($(openmp), not-set)
++    CONFIG_FLAGS += -DOPENMP=$(openmp)
++endif
++ifneq ($(prefix), not-set)
++    CONFIG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix)
++endif
++ifneq ($(shared), not-set)
++    CONFIG_FLAGS += -DSHARED=1
++endif
++ifneq ($(cc), not-set)
++    CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc)
++endif
++ifneq ($(cxx), not-set)
++    CONFIG_FLAGS += -DCMAKE_CXX_COMPILER=$(cxx)
++endif
++ifneq ($(ar), not-set)
++    CONFIG_FLAGS += -DCMAKE_AR=$(ar)
++endif
++ifneq ($(gcc-ar), not-set)
++    CONFIG_FLAGS += -DCMAKE_C_COMPILER_AR=$(gcc-ar) -DCMAKE_CXX_COMPILER_AR=$(gcc-ar)
++endif
++ifneq ($(ranlib), not-set)
++    CONFIG_FLAGS += -DCMAKE_RANLIB=$(ranlib)
++endif
++ifneq ($(gcc-ranlib), not-set)
++    CONFIG_FLAGS += -DCMAKE_C_COMPILER_RANLIB=$(gcc-ranlib) -DCMAKE_CXX_COMPILER_RANLIB=$(gcc-ranlib)
++endif
++ifneq ($(linker), not-set)
++    CONFIG_FLAGS += -DCMAKE_LINKER=$(linker)
++endif
++ifneq ($(nm), not-set)
++    CONFIG_FLAGS += -DCMAKE_NM=$(nm)
++endif
++ifneq ($(objcopy), not-set)
++    CONFIG_FLAGS += -DCMAKE_OBJCOPY=$(objcopy)
++endif
++ifneq ($(objdump), not-set)
++    CONFIG_FLAGS += -DCMAKE_OBJDUMP=$(objdump)
++endif
++ifneq ($(rc), not-set)
++    CONFIG_FLAGS += -DCMAKE_RC_COMPILER=$(rc)
++endif
++ifneq ($(strip), not-set)
++    CONFIG_FLAGS += -DCMAKE_STRIP=$(strip)
++endif
++
++define run-config
++mkdir -p $(BUILDDIR)
++cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS)
++endef
++
++all clean install:
++	@if [ ! -f $(BUILDDIR)/Makefile ]; then \
++		more BUILD.txt; \
++	else \
++	  	make -C $(BUILDDIR) $@ $(MAKEFLAGS); \
++	fi
++
++uninstall:
++	xargs rm < $(BUILDDIR)/install_manifest.txt
++
++config: distclean
++	$(run-config)
++
++distclean:
++	rm -rf $(BUILDDIR)
++
++remake:
++	find . -name CMakeLists.txt -exec touch {} ';'
++
++dist:
++	util/mkdist.sh $(PKGNAME)
++
++
++.PHONY: config distclean dist all clean install uninstall remake
+Index: ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt	(revision 26034)
+@@ -0,0 +1,32 @@
++# Include directories for library code.
++include_directories(.)
++# Find sources.
++file(GLOB parmetis_sources *.c)
++# Create libparmetis
++add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
++
++# Link with metis and MPI libraries.
++set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "msys-" "")
++set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
++find_library(METIS metis PATHS ${METIS_PATH}/lib)
++if(METIS)
++	message("-- Found user-supplied METIS: ${METIS}")
++	target_link_libraries(parmetis ${METIS})
++else(METIS)
++	target_link_libraries(parmetis metis)
++endif()
++
++if(LOCAL_MSMPI)
++	# Add local MS-MPI libraries
++	find_library(MSMPI msmpi PATHS ${MSMPI_ROOT}/lib)
++	message(STATUS "MSMPI: ${MSMPI}")
++	target_link_libraries(parmetis ${MSMPI})
++else(LOCAL_MSMPI)
++	target_link_libraries(parmetis ${MPI_LIBRARIES})
++	set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
++endif()
++
++install(TARGETS parmetis
++  LIBRARY DESTINATION lib
++  RUNTIME DESTINATION lib
++  ARCHIVE DESTINATION lib)
+Index: ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/include/parmetis.h
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/include/parmetis.h	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/include/parmetis.h	(revision 26034)
+@@ -0,0 +1,159 @@
++/*
++ * Copyright 1997-2003, Regents of the University of Minnesota
++ *
++ * parmetis.h
++ *
++ * This file contains function prototypes and constrant definitions for 
++ * ParMETIS
++ *
++ * Started 7/21/03
++ * George
++ *
++ */
++
++#ifndef __parmetis_h__
++#define __parmetis_h__
++
++#include <mpi.h>
++#include <metis.h>
++
++#if IDXTYPEWIDTH == 32
++  /*#define IDX_T         MPI_INT32_T */
++  #define IDX_T         MPI_INT
++  #define KEEP_BIT      0x40000000L
++#elif IDXTYPEWIDTH == 64
++  /*#define IDX_T         MPI_INT64_T */
++  #define IDX_T         MPI_LONG_LONG_INT
++  #define KEEP_BIT      0x4000000000000000LL
++#else
++  #error "Incorrect user-supplied value fo IDXTYPEWIDTH"
++#endif
++
++
++#if REALTYPEWIDTH == 32
++  #define REAL_T        MPI_FLOAT
++#elif REALTYPEWIDTH == 64
++  #define REAL_T        MPI_DOUBLE
++#else
++  #error "Incorrect user-supplied value fo REALTYPEWIDTH"
++#endif
++
++
++
++/*************************************************************************
++* Constants 
++**************************************************************************/
++#define PARMETIS_MAJOR_VERSION        4
++#define PARMETIS_MINOR_VERSION        0
++#define PARMETIS_SUBMINOR_VERSION     3
++
++
++/*************************************************************************
++* Function prototypes
++**************************************************************************/
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*-------------------------------------------------------------------
++* API Introduced with Release 3.0 (current API) 
++*--------------------------------------------------------------------*/
++int __cdecl ParMETIS_V3_PartKway(
++             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
++	     idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *nparts, 
++	     real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, idx_t *part, 
++	     MPI_Comm *comm);
++
++int __cdecl ParMETIS_V3_PartGeomKway(
++             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
++	     idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ndims, real_t *xyz, 
++	     idx_t *ncon, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, 
++	     idx_t *edgecut, idx_t *part, MPI_Comm *comm);
++
++int __cdecl ParMETIS_V3_PartGeom(
++             idx_t *vtxdist, idx_t *ndims, real_t *xyz, idx_t *part, MPI_Comm *comm);
++
++int __cdecl ParMETIS_V3_RefineKway(
++             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
++	     idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *nparts, 
++	     real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, 
++	     idx_t *part, MPI_Comm *comm);
++
++int __cdecl ParMETIS_V3_AdaptiveRepart(
++             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, 
++	     idx_t *vsize, idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, 
++	     idx_t *nparts, real_t *tpwgts, real_t *ubvec, real_t *ipc2redist, 
++	     idx_t *options, idx_t *edgecut, idx_t *part, MPI_Comm *comm);
++
++int __cdecl ParMETIS_V3_Mesh2Dual(
++             idx_t *elmdist, idx_t *eptr, idx_t *eind, idx_t *numflag, 
++	     idx_t *ncommonnodes, idx_t **xadj, idx_t **adjncy, MPI_Comm *comm);
++
++int __cdecl ParMETIS_V3_PartMeshKway(
++             idx_t *elmdist, idx_t *eptr, idx_t *eind, idx_t *elmwgt, 
++	     idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *ncommonnodes, idx_t *nparts, 
++	     real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, idx_t *part, 
++	     MPI_Comm *comm);
++
++int __cdecl ParMETIS_V3_NodeND(
++             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *numflag, 
++	     idx_t *options, idx_t *order, idx_t *sizes, MPI_Comm *comm);
++
++int __cdecl ParMETIS_V32_NodeND(
++             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
++             idx_t *numflag, idx_t *mtype, idx_t *rtype, idx_t *p_nseps, idx_t *s_nseps,
++             real_t *ubfrac, idx_t *seed, idx_t *dbglvl, idx_t *order, 
++             idx_t *sizes, MPI_Comm *comm);
++
++int __cdecl ParMETIS_SerialNodeND(
++             idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *numflag, 
++             idx_t *options, idx_t *order, idx_t *sizes, MPI_Comm *comm);
++
++#ifdef __cplusplus
++}
++#endif
++
++
++/*------------------------------------------------------------------------
++* Enum type definitions 
++*-------------------------------------------------------------------------*/
++/*! Operation type codes */
++typedef enum {
++  PARMETIS_OP_KMETIS,
++  PARMETIS_OP_GKMETIS,
++  PARMETIS_OP_GMETIS,
++  PARMETIS_OP_RMETIS,
++  PARMETIS_OP_AMETIS,
++  PARMETIS_OP_OMETIS,
++  PARMETIS_OP_M2DUAL,
++  PARMETIS_OP_MKMETIS
++} pmoptype_et;
++
++
++/*************************************************************************
++* Various constants used for the different parameters
++**************************************************************************/
++/* Matching types */
++#define PARMETIS_MTYPE_LOCAL     1    /* Restrict matching to within processor vertices */
++#define PARMETIS_MTYPE_GLOBAL    2    /* Remote vertices can be matched */
++
++/* Separator refinement types */
++#define PARMETIS_SRTYPE_GREEDY    1    /* Vertices are visted from highest to lowest gain */
++#define PARMETIS_SRTYPE_2PHASE    2    /* Separators are refined in a two-phase fashion using
++                                          PARMETIS_SRTYPE_GREEDY for the 2nd phase */
++
++/* Coupling types for ParMETIS_V3_RefineKway & ParMETIS_V3_AdaptiveRepart */
++#define PARMETIS_PSR_COUPLED    1    /* # of partitions == # of processors */
++#define PARMETIS_PSR_UNCOUPLED  2    /* # of partitions != # of processors */
++
++
++/* Debug levels (fields should be ORed) */
++#define PARMETIS_DBGLVL_TIME        1      /* Perform timing analysis */
++#define PARMETIS_DBGLVL_INFO        2      /* Perform timing analysis */
++#define PARMETIS_DBGLVL_PROGRESS    4      /* Show the coarsening progress */
++#define PARMETIS_DBGLVL_REFINEINFO  8      /* Show info on communication during folding */
++#define PARMETIS_DBGLVL_MATCHINFO   16     /* Show info on matching */
++#define PARMETIS_DBGLVL_RMOVEINFO   32     /* Show info on communication during folding */
++#define PARMETIS_DBGLVL_REMAP       64     /* Determines if remapping will take place */
++
++#endif 
+Index: ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt	(revision 26034)
+@@ -0,0 +1,32 @@
++# Include directories for library code.
++include_directories(.)
++# Find sources.
++file(GLOB parmetis_sources *.c)
++# Create libparmetis
++add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources})
++
++# Link with metis and MPI libraries.
++set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "msys-" "")
++set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
++find_library(METIS metis PATHS ${METIS_PATH}/lib)
++if(METIS)
++	message("-- Found user-supplied METIS: ${METIS}")
++	target_link_libraries(parmetis ${METIS})
++else(METIS)
++	target_link_libraries(parmetis metis)
++endif()
++
++if(LOCAL_MSMPI)
++	# Add local MS-MPI libraries
++	find_library(MSMPI msmpi PATHS ${MSMPI_ROOT}/lib)
++	message(STATUS "MSMPI: ${MSMPI}")
++	target_link_libraries(parmetis ${MSMPI})
++else(LOCAL_MSMPI)
++	target_link_libraries(parmetis ${MPI_LIBRARIES})
++	set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
++endif()
++
++install(TARGETS parmetis
++  LIBRARY DESTINATION lib
++  RUNTIME DESTINATION lib
++  ARCHIVE DESTINATION lib)
+Index: ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh	(revision 26034)
+@@ -0,0 +1,68 @@
++#!/bin/bash
++set -eu
++
++
++# NOTE:
++# - This configuration depends on the successful installation of METIS via 
++# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
++# - METIS_ROOT and MSMPI_ROOT should be available after etc/environment.sh is 
++#	sourced
++#
++
++## Constants
++#
++VER=4.0.3
++
++PREFIX="${ISSM_DIR}/externalpackages/parmetis/install"
++
++GKLIB_ROOT="${METIS_ROOT}/GKlib"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/parmetis-${VER}.tar.gz" "parmetis-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf parmetis-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv parmetis-${VER}/* src
++rm -rf parmetis-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/4.0/win/msys2/CMakeLists.txt src
++cp configs/4.0/win/msys2/Makefile src
++cp configs/4.0/win/msys2/include/parmetis.h src/include
++cp configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt src/libparmetis
++
++# Configure
++cd src
++make config \
++	prefix=${PREFIX} \
++	shared=1 \
++	cc=/usr/bin/gcc \
++	cxx=/usr/bin/g++ \
++	metis_path=${METIS_ROOT} \
++	gklib_path=${GKLIB_ROOT} \
++	local_msmpi=1 \
++	msmpi_root=${MSMPI_ROOT}
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s ./msys-parmetis.dll ./libparmetis.dll
++
++# Create link to lib directory (PETSc, by default, looks for libraries in 
++# lib64/ if it detects that 64-bit integers are being used)
++cd ${PREFIX}
++ln -s ./lib ./lib64
+
+Property changes on: ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh	(revision 26034)
+@@ -0,0 +1,68 @@
++#!/bin/bash
++set -eu
++
++
++# NOTE:
++# - This configuration depends on the successful installation of METIS via 
++# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
++# - METIS_ROOT and MSMPI_ROOT should be available after etc/environment.sh is 
++#	sourced
++#
++
++## Constants
++#
++VER=4.0.3
++
++PREFIX="${ISSM_DIR}/externalpackages/parmetis/install"
++
++GKLIB_ROOT="${METIS_ROOT}/GKlib"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/parmetis-${VER}.tar.gz" "parmetis-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf parmetis-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv parmetis-${VER}/* src
++rm -rf parmetis-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/4.0/win/msys2/CMakeLists.txt src
++cp configs/4.0/win/msys2/Makefile src
++cp configs/4.0/win/msys2/include/parmetis.h src/include
++cp configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt src/libparmetis
++
++# Configure
++cd src
++make config \
++	prefix=${PREFIX} \
++	shared=1 \
++	cc=/mingw64/bin/gcc \
++	cxx=/mingw64/bin/g++ \
++	metis_path=${METIS_ROOT} \
++	gklib_path=${GKLIB_ROOT} \
++	local_msmpi=1 \
++	msmpi_root=${MSMPI_ROOT}
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++
++# Create link to lib directory (PETSc, by default, looks for libraries in 
++# lib64/ if it detects that 64-bit integers are being used)
++cd ${PREFIX}
++ln -s ./lib ./lib64
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s libparmetis.so libparmetis.dll
+
+Property changes on: ../trunk-jpl/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh	(revision 26034)
+@@ -0,0 +1,65 @@
++#!/bin/bash
++set -u # NOTE: Do not set -e as it will cause this script to fail when there are errors in underlying Python scripts
++
++
++## Constants
++#
++VER="3.12.3"
++
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir ${PETSC_DIR}
++
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
++rm -rf petsc-${VER}
++
++# Configure
++#
++# - Added -fallow-argument-mismatch option to FFLAGS in order to clear "Error: 
++#	Rank mismatch between actual argument at [...]"
++# - Added -fallow-invalid-boz option to FFLAGS in order to clear "Error: BOZ 
++#	literal constant at [...]"
++#
++cd ${PETSC_DIR}
++./config/configure.py \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
++	--FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-pic=1 \
++	--with-mpiexec="/c/PROGRA~1/MICROS~1/Bin/mpiexec.exe" \
++	--with-mpi-lib="-L${MSMPI_ROOT}/lib -lmsmpi" \
++	--with-mpi-include="${MSMPI_ROOT}/include" \
++	--with-metis-dir=${METIS_ROOT} \
++	--with-parmetis-dir=${PARMETIS_ROOT} \
++	--with-blas-lib="-L${BLAS_ROOT}/lib -lblas" \
++	--known-64-bit-blas-indices=0 \
++	--with-lapack-lib="-L${LAPACK_ROOT}/lib -llapack" \
++	--with-scalapack-dir=${SCALAPACK_ROOT} \
++	--with-mumps-dir=${MUMPS_ROOT}
++
++# Compile and install
++make
++make install
++
++# NOTE:
++# - Hack to recover from failed installation (appears to happen only on Windows 
++#	when reproducing symbolic links in destination directory) rather than 
++#	trying to patch src/config/install.py
++#
++if [ $? -ne 0 ]; then
++	make install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt	(revision 26034)
+@@ -0,0 +1,277 @@
++cmake_minimum_required(VERSION 2.8)
++project(SCALAPACK C Fortran)
++# Configure the warning and code coverage suppression file
++configure_file( 
++  "${SCALAPACK_SOURCE_DIR}/CMAKE/CTestCustom.cmake.in"
++  "${SCALAPACK_BINARY_DIR}/CTestCustom.cmake"
++  COPYONLY
++)
++
++# Add the CMake directory for custon CMake modules
++set(CMAKE_MODULE_PATH "${SCALAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
++
++if (UNIX)
++   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
++  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
++   endif ()
++endif ()
++
++#
++#   MPI
++#
++if (LOCAL_MSMPI)
++  set(CMAKE_FIND_LIBRARY_PREFIXES "msys-" "")
++  set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
++  find_library(MSMPI msmpi PATHS ${MSMPI_ROOT}/lib)
++  if(MSMPI)
++    message(STATUS "--> Using MS-MPI library ${MSMPI}")
++  else(MSMPI)
++    message(FATAL_ERROR "MS-MPI library not found at ${MSMPI_ROOT}/lib")
++  endif()
++
++  include_directories("${MSMPI_ROOT}/include")
++endif()
++
++if (UNIX)
++   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
++  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
++   endif ()
++endif ()
++
++macro(SCALAPACK_install_library lib)
++  install(TARGETS ${lib} EXPORT scalapack-targets
++    ARCHIVE DESTINATION lib${LIB_SUFFIX}
++    LIBRARY DESTINATION lib${LIB_SUFFIX}
++    RUNTIME DESTINATION Testing
++  )
++endmacro()
++
++# --------------------------------------------------
++# Testing
++SET(DART_TESTING_TIMEOUT 600)
++
++enable_testing()
++include(CTest)
++enable_testing()
++# --------------------------------------------------
++
++# Organize output files.  On Windows this also keeps .dll files next
++# to the .exe files that need them, making tests easy to run.
++set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/TESTING)
++set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
++
++# --------------------------------------------------
++# Check for any necessary platform specific compiler flags
++include( CheckBLACSCompilerFlags )
++CheckBLACSCompilerFlags()
++
++set(prefix ${CMAKE_INSTALL_PREFIX})
++set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
++set(PKG_CONFIG_DIR ${libdir}/pkgconfig)
++
++# --------------------------------------------------
++# BLACS Internal variables
++#
++#   Fortran Mangling, MPI Tests and BLACS settings
++#
++include(FortranMangling)
++COMPILE(install_COMPILED)
++
++FORTRAN_MANGLING(CDEFS)
++#MESSAGE(STATUS "Setting CDEFS = ${CDEFS}")
++#set(CDEFS ${CDEFS} CACHE STRING "Fortran Mangling" FORCE)
++MESSAGE(STATUS "=========")
++
++# --------------------------------------------------
++# Compiler Flags
++ADD_DEFINITIONS( "-D${CDEFS}")
++
++# --------------------------------------------------
++# ScaLAPACK needs BLAS and LAPACK
++
++option(USE_OPTIMIZED_LAPACK_BLAS "Whether or not to search for optimized LAPACK and BLAS libraries on your machine (if not found, Reference LAPACK and BLAS will be downloaded and installed)" ON)
++
++message(STATUS "CHECKING BLAS AND LAPACK LIBRARIES")
++
++IF(BLAS_LIBRARIES)
++  include(CheckFortranFunctionExists)
++  message(STATUS "--> BLAS supplied by user is ${BLAS_LIBRARIES}.")
++  set(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
++  CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND)
++  unset(CMAKE_REQUIRED_LIBRARIES)
++  message(STATUS "--> BLAS routine dgemm is found: ${BLAS_FOUND}.")
++ENDIF()
++
++IF(LAPACK_LIBRARIES)
++  include(CheckFortranFunctionExists)
++  message(STATUS "--> LAPACK supplied by user is ${LAPACK_LIBRARIES}.")
++  set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
++  CHECK_FORTRAN_FUNCTION_EXISTS("dgesv" LAPACK_FOUND)
++  unset(CMAKE_REQUIRED_LIBRARIES)
++  message(STATUS "--> LAPACK routine dgesv is found: ${LAPACK_FOUND}.")
++ENDIF()
++
++if(BLAS_FOUND AND LAPACK_FOUND)
++  message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
++else(LAPACK_FOUND)
++   if(USE_OPTIMIZED_LAPACK_BLAS)
++      message(STATUS "--> Searching for optimized LAPACK and BLAS libraries on your machine.")
++      find_package(LAPACK)
++   ENDIF(USE_OPTIMIZED_LAPACK_BLAS)
++   if(NOT LAPACK_FOUND)
++      message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
++      include(ExternalProject)
++      ExternalProject_Add(
++		lapack
++		URL http://www.netlib.org/lapack/lapack.tgz
++		CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${SCALAPACK_BINARY_DIR}
++        PREFIX ${SCALAPACK_BINARY_DIR}/dependencies
++      )
++	  if (UNIX)
++         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.a CACHE STRING "LAPACK library" FORCE)
++         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.a CACHE STRING "BLAS library" FORCE)
++	  else (UNIX) # On Windows
++         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.lib CACHE STRING "LAPACK library" FORCE)
++         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.lib CACHE STRING "BLAS library" FORCE)
++      endif (UNIX)
++   ENDIF()
++ENDIF()
++
++message(STATUS "BLAS library: ${BLAS_LIBRARIES}")
++message(STATUS "LAPACK library: ${LAPACK_LIBRARIES}")
++
++MESSAGE(STATUS "=========")
++
++# --------------------------------------------------
++# By default static library
++OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF )
++OPTION(BUILD_STATIC_LIBS "Build static libraries" ON )
++
++# --------------------------------------------------
++# Subdirectories that need to be processed
++   
++macro(append_subdir_files variable dirname)
++get_directory_property(holder DIRECTORY ${dirname} DEFINITION ${variable})
++foreach(depfile ${holder})
++  list(APPEND ${variable} "${dirname}/${depfile}")
++endforeach()
++endmacro()
++
++
++#
++# BLACS
++#
++add_subdirectory(BLACS)
++append_subdir_files(blacs "BLACS/SRC")
++
++#
++# TOOLS
++#
++add_subdirectory(TOOLS)
++append_subdir_files(tools TOOLS)
++append_subdir_files(tools-C TOOLS)
++append_subdir_files(extra_lapack "TOOLS/LAPACK")
++
++#
++# PBLAS
++#
++add_subdirectory(PBLAS)
++append_subdir_files(pblas "PBLAS/SRC")
++append_subdir_files(pblas-F "PBLAS/SRC")
++append_subdir_files(pbblas "PBLAS/SRC/PBBLAS")
++append_subdir_files(ptzblas "PBLAS/SRC/PTZBLAS")
++append_subdir_files(ptools "PBLAS/SRC/PTOOLS")
++
++#
++# REDIST
++#
++add_subdirectory(REDIST)
++append_subdir_files(redist "REDIST/SRC")
++
++#
++# SRC
++#
++add_subdirectory(SRC)
++append_subdir_files(src "SRC")
++append_subdir_files(src-C "SRC")
++
++if (UNIX)
++   add_library(scalapack ${blacs} ${tools} ${tools-C} ${extra_lapack} ${pblas} ${pblas-F} ${ptzblas} ${ptools} ${pbblas} ${redist} ${src} ${src-C})
++   target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
++   scalapack_install_library(scalapack)
++else (UNIX) # Need to separate Fortran and C Code
++   OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON )
++   add_library(scalapack ${blacs} ${tools-C} ${pblas} ${ptools} ${redist} ${src-C})
++   target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
++   add_library(scalapack-F ${pblas-F} ${pbblas} ${ptzblas} ${tools} ${src} ${extra_lapack})
++   target_link_libraries( scalapack-F ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
++   scalapack_install_library(scalapack)
++   scalapack_install_library(scalapack-F)
++endif (UNIX)
++add_subdirectory(TESTING)
++
++# --------------------------------------------------
++# CPACK Packaging 
++
++SET(CPACK_PACKAGE_NAME "ScaLAPACK")
++SET(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
++SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ScaLAPACK- Linear Algebra Package")
++set(SCALAPACK_VERSION 2.0.2)
++set(CPACK_PACKAGE_VERSION_MAJOR 2)
++set(CPACK_PACKAGE_VERSION_MINOR 0)
++set(CPACK_PACKAGE_VERSION_PATCH 2)
++set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
++SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SCALAPACK")
++IF(WIN32 AND NOT UNIX)
++  # There is a bug in NSI that does not handle full unix paths properly. Make
++  # sure there is at least one set of four (4) backslashes.
++  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
++  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/scalapack")
++  SET(CPACK_NSIS_CONTACT "scalapack@eecs.utk.edu")
++  SET(CPACK_NSIS_MODIFY_PATH ON)
++  SET(CPACK_NSIS_DISPLAY_NAME "SCALAPACK-${SCALAPACK_VERSION}")
++  set(CPACK_PACKAGE_RELOCATABLE "true")
++ELSE(WIN32 AND NOT UNIX)
++  SET(CPACK_GENERATOR "TGZ")
++  SET(CPACK_SOURCE_GENERATOR TGZ)
++  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scalapack-${SCALAPACK_VERSION}" )
++  SET(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES} )
++ENDIF(WIN32 AND NOT UNIX)
++INCLUDE(CPack)
++
++
++# --------------------------------------------------
++
++
++export(TARGETS scalapack FILE scalapack-targets.cmake)
++
++if( NOT LAPACK_FOUND )
++ install(FILES
++  ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}
++  DESTINATION lib
++   )
++endif( NOT LAPACK_FOUND )
++
++configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-version.cmake.in
++  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake @ONLY)
++configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-build.cmake.in
++  ${SCALAPACK_BINARY_DIR}/scalapack-config.cmake @ONLY)
++
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scalapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc)
++ install(FILES
++  ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc
++  DESTINATION ${PKG_CONFIG_DIR}
++   )
++
++configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-install.cmake.in
++  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake @ONLY)
++install(FILES
++  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake
++  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake
++  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION}
++  )
++
++install(EXPORT scalapack-targets
++  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION})
++
+Index: ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in
+===================================================================
+--- ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in	(nonexistent)
++++ ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in	(revision 26034)
+@@ -0,0 +1,2 @@
++#define CallFromC
++#include "./@src@"
+Index: ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt	(revision 26034)
+@@ -0,0 +1,323 @@
++cmake_minimum_required(VERSION 2.8)
++project(SCALAPACK C Fortran)
++# Configure the warning and code coverage suppression file
++configure_file( 
++  "${SCALAPACK_SOURCE_DIR}/CMAKE/CTestCustom.cmake.in"
++  "${SCALAPACK_BINARY_DIR}/CTestCustom.cmake"
++  COPYONLY
++)
++
++# Add the CMake directory for custon CMake modules
++set(CMAKE_MODULE_PATH "${SCALAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
++
++if (UNIX)
++   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
++  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
++   endif ()
++endif ()
++
++#
++#   MPI
++#
++# #set(MPI_BASE_DIR "/Users/julie/opt/openmpi/" CACHE PATH "MPI Path")
++# #set(MPI_BASE_DIR "/Users/julie/opt/mpich2/" CACHE PATH "MPI Path")
++# set(CMAKE_PREFIX_PATH "${MPI_BASE_DIR};${CMAKE_PREFIX_PATH}")
++# #set(MPI_COMPILER ${MPI_BASE_DIR}/bin/mpicc)
++
++# find_package(MPI)
++# if (MPI_FOUND)
++#    message(STATUS "Found MPI_LIBRARY : ${MPI_FOUND} ")
++#    INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
++
++#    find_program(MPI_C_COMPILER
++#       NAMES mpicc
++#       HINTS "${MPI_BASE_DIR}"
++#       PATH_SUFFIXES bin
++#       DOC "MPI C compiler.")
++#    MARK_AS_ADVANCED(MPI_C_COMPILER)
++#    if ("${MPI_C_COMPILER}" STREQUAL "MPI_C_COMPILER-NOTFOUND")
++#       message(ERROR "--> MPI C Compiler NOT FOUND (please set MPI_BASE_DIR accordingly")
++#    else()
++#       message(STATUS "--> MPI C Compiler : ${MPI_C_COMPILER}")
++#       SET(CMAKE_C_COMPILER "${MPI_C_COMPILER}")
++#       message(STATUS "--> C Compiler : ${CMAKE_C_COMPILER}")
++#    endif()
++#    find_program(MPI_Fortran_COMPILER
++#       NAMES mpif77
++#       HINTS "${MPI_BASE_DIR}"
++#       PATH_SUFFIXES bin
++#       DOC "MPI Fortran compiler.")
++#    MARK_AS_ADVANCED(MPI_Fortran_COMPILER)
++   
++   
++
++#    if ("${MPI_Fortran_COMPILER}" STREQUAL "MPI_Fortran_COMPILER-NOTFOUND")
++#       message(ERROR "--> MPI Fortran Compiler NOT FOUND (please set MPI_BASE_DIR accordingly")
++#    else()
++#       message(STATUS "--> MPI Fortran Compiler : ${MPI_Fortran_COMPILER}")
++#       SET(Fortran_COMPILER "${CMAKE_Fortran_COMPILER}")
++#       SET(CMAKE_Fortran_COMPILER "${MPI_Fortran_COMPILER}")
++#       message(STATUS "--> Fortran Compiler : ${CMAKE_Fortran_COMPILER}")
++#    endif()
++   
++# else()
++#    message(STATUS "Found MPI_LIBRARY : ${MPI_FOUND} ")
++#    set(MPI_BASE_DIR ${MPI_BASE_DIR} CACHE PATH "MPI Path")
++#    UNSET(MPIEXEC CACHE)
++#    UNSET(MPIEXEC_POSTFLAGS CACHE)
++#    UNSET(MPIEXEC_PREFLAGS CACHE)
++#    UNSET(MPIEXEC_MAX_NUMPROCS CACHE)
++#    UNSET(MPIEXEC_NUMPROC_FLAG CACHE)
++#    UNSET(MPI_COMPILE_FLAGS CACHE)
++#    UNSET(MPI_LINK_FLAGS CACHE)
++#    UNSET(MPI_INCLUDE_PATH CACHE)
++#    message(FATAL_ERROR "--> MPI Library NOT FOUND -- please set MPI_BASE_DIR accordingly --")
++# endif()
++
++if (LOCAL_MSMPI)
++  set(CMAKE_FIND_LIBRARY_PREFIXES "msys-" "")
++  set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
++  find_library(MSMPI msmpi PATHS "${MSMPI_ROOT}/lib")
++  if(MSMPI)
++    message(STATUS "--> Using MS-MPI library ${MSMPI}")
++  else(MSMPI)
++    message(FATAL_ERROR "MS-MPI library not found at ${MSMPI_PATH}/lib")
++  endif()
++
++  include_directories("${MSMPI_ROOT}/include")
++endif()
++
++if (UNIX)
++   if ( "${CMAKE_Fortran_COMPILER}" MATCHES "ifort" )
++  set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fltconsistency -fp_port" )
++   endif ()
++endif ()
++
++macro(SCALAPACK_install_library lib)
++  install(TARGETS ${lib} EXPORT scalapack-targets
++    ARCHIVE DESTINATION lib${LIB_SUFFIX}
++    LIBRARY DESTINATION lib${LIB_SUFFIX}
++    RUNTIME DESTINATION Testing
++  )
++endmacro()
++
++# --------------------------------------------------
++# Testing
++SET(DART_TESTING_TIMEOUT 600)
++
++enable_testing()
++include(CTest)
++enable_testing()
++# --------------------------------------------------
++
++# Organize output files.  On Windows this also keeps .dll files next
++# to the .exe files that need them, making tests easy to run.
++set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/TESTING)
++set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCALAPACK_BINARY_DIR}/lib)
++
++# --------------------------------------------------
++# Check for any necessary platform specific compiler flags
++include( CheckBLACSCompilerFlags )
++CheckBLACSCompilerFlags()
++
++set(prefix ${CMAKE_INSTALL_PREFIX})
++set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
++set(PKG_CONFIG_DIR ${libdir}/pkgconfig)
++
++# --------------------------------------------------
++# BLACS Internal variables
++#
++#   Fortran Mangling, MPI Tests and BLACS settings
++#
++include(FortranMangling)
++COMPILE(install_COMPILED)
++
++FORTRAN_MANGLING(CDEFS)
++#MESSAGE(STATUS "Setting CDEFS = ${CDEFS}")
++#set(CDEFS ${CDEFS} CACHE STRING "Fortran Mangling" FORCE)
++MESSAGE(STATUS "=========")
++
++# --------------------------------------------------
++# Compiler Flags
++ADD_DEFINITIONS( "-D${CDEFS}")
++
++# --------------------------------------------------
++# ScaLAPACK needs BLAS and LAPACK
++
++option(USE_OPTIMIZED_LAPACK_BLAS "Whether or not to search for optimized LAPACK and BLAS libraries on your machine (if not found, Reference LAPACK and BLAS will be downloaded and installed)" ON)
++
++message(STATUS "CHECKING BLAS AND LAPACK LIBRARIES")
++
++IF(LAPACK_LIBRARIES)
++  include(CheckFortranFunctionExists)
++  message(STATUS "--> LAPACK supplied by user is ${LAPACK_LIBRARIES}.")
++  set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
++  CHECK_FORTRAN_FUNCTION_EXISTS("dgesv" LAPACK_FOUND)
++  unset( CMAKE_REQUIRED_LIBRARIES )
++  message(STATUS "--> LAPACK routine dgesv is found: ${LAPACK_FOUND}.")
++ENDIF()
++
++if(LAPACK_FOUND)
++      message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
++else(LAPACK_FOUND)
++   if(USE_OPTIMIZED_LAPACK_BLAS)
++      message(STATUS "--> Searching for optimized LAPACK and BLAS libraries on your machine.")
++      find_package(LAPACK)
++   ENDIF(USE_OPTIMIZED_LAPACK_BLAS)
++   if(NOT LAPACK_FOUND)
++      message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
++      include(ExternalProject)
++      ExternalProject_Add(
++		lapack
++		URL http://www.netlib.org/lapack/lapack.tgz
++		CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${SCALAPACK_BINARY_DIR}
++        PREFIX ${SCALAPACK_BINARY_DIR}/dependencies
++      )
++	  if (UNIX)
++         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.a CACHE STRING "LAPACK library" FORCE)
++         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.a CACHE STRING "BLAS library" FORCE)
++	  else (UNIX) # On Windows
++         SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.lib CACHE STRING "LAPACK library" FORCE)
++         SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.lib CACHE STRING "BLAS library" FORCE)
++      endif (UNIX)
++   ENDIF()
++ENDIF()
++
++message(STATUS "BLAS library: ${BLAS_LIBRARIES}")
++message(STATUS "LAPACK library: ${LAPACK_LIBRARIES}")
++
++MESSAGE(STATUS "=========")
++
++# --------------------------------------------------
++# By default static library
++OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF )
++OPTION(BUILD_STATIC_LIBS "Build static libraries" ON )
++
++# --------------------------------------------------
++# Subdirectories that need to be processed
++   
++macro(append_subdir_files variable dirname)
++get_directory_property(holder DIRECTORY ${dirname} DEFINITION ${variable})
++foreach(depfile ${holder})
++  list(APPEND ${variable} "${dirname}/${depfile}")
++endforeach()
++endmacro()
++
++
++#
++# BLACS
++#
++add_subdirectory(BLACS)
++append_subdir_files(blacs "BLACS/SRC")
++
++#
++# TOOLS
++#
++add_subdirectory(TOOLS)
++append_subdir_files(tools TOOLS)
++append_subdir_files(tools-C TOOLS)
++append_subdir_files(extra_lapack "TOOLS/LAPACK")
++
++#
++# PBLAS
++#
++add_subdirectory(PBLAS)
++append_subdir_files(pblas "PBLAS/SRC")
++append_subdir_files(pblas-F "PBLAS/SRC")
++append_subdir_files(pbblas "PBLAS/SRC/PBBLAS")
++append_subdir_files(ptzblas "PBLAS/SRC/PTZBLAS")
++append_subdir_files(ptools "PBLAS/SRC/PTOOLS")
++
++#
++# REDIST
++#
++add_subdirectory(REDIST)
++append_subdir_files(redist "REDIST/SRC")
++
++#
++# SRC
++#
++add_subdirectory(SRC)
++append_subdir_files(src "SRC")
++append_subdir_files(src-C "SRC")
++
++# if (UNIX)
++   add_library(scalapack ${blacs} ${tools} ${tools-C} ${extra_lapack} ${pblas} ${pblas-F} ${ptzblas} ${ptools} ${pbblas} ${redist} ${src} ${src-C})
++   target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
++   scalapack_install_library(scalapack)
++# else (UNIX) # Need to separate Fortran and C Code
++#    OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON )
++#    add_library(scalapack ${blacs} ${tools-C} ${pblas} ${ptools} ${redist} ${src-C})
++#    target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
++#    add_library(scalapack-F ${blacs} ${pblas-F} ${pbblas} ${ptzblas} ${tools} ${src} ${extra_lapack} )
++#    target_link_libraries( scalapack-F ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MSMPI})
++#    scalapack_install_library(scalapack)
++#    scalapack_install_library(scalapack-F)
++# endif (UNIX)
++add_subdirectory(TESTING)
++
++# --------------------------------------------------
++# CPACK Packaging 
++
++SET(CPACK_PACKAGE_NAME "ScaLAPACK")
++SET(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
++SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ScaLAPACK- Linear Algebra Package")
++set(SCALAPACK_VERSION 2.1.0)
++set(CPACK_PACKAGE_VERSION_MAJOR 2)
++set(CPACK_PACKAGE_VERSION_MINOR 1)
++set(CPACK_PACKAGE_VERSION_PATCH 0)
++set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
++SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SCALAPACK")
++IF(WIN32 AND NOT UNIX)
++  # There is a bug in NSI that does not handle full unix paths properly. Make
++  # sure there is at least one set of four (4) backlasshes.
++  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
++  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/scalapack")
++  SET(CPACK_NSIS_CONTACT "scalapack@eecs.utk.edu")
++  SET(CPACK_NSIS_MODIFY_PATH ON)
++  SET(CPACK_NSIS_DISPLAY_NAME "SCALAPACK-${SCALAPACK_VERSION}")
++  set(CPACK_PACKAGE_RELOCATABLE "true")
++ELSE(WIN32 AND NOT UNIX)
++  SET(CPACK_GENERATOR "TGZ")
++  SET(CPACK_SOURCE_GENERATOR TGZ)
++  SET(CPACK_SOURCE_PACKAGE_FILE_NAME "scalapack-${SCALAPACK_VERSION}" )
++  SET(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES} )
++ENDIF(WIN32 AND NOT UNIX)
++INCLUDE(CPack)
++
++
++# --------------------------------------------------
++
++
++export(TARGETS scalapack FILE scalapack-targets.cmake)
++
++if( NOT LAPACK_FOUND )
++ install(FILES
++  ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}
++  DESTINATION lib
++   )
++endif( NOT LAPACK_FOUND )
++
++configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-version.cmake.in
++  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake @ONLY)
++configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-build.cmake.in
++  ${SCALAPACK_BINARY_DIR}/scalapack-config.cmake @ONLY)
++
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scalapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc)
++ install(FILES
++  ${CMAKE_CURRENT_BINARY_DIR}/scalapack.pc
++  DESTINATION ${PKG_CONFIG_DIR}
++   )
++
++configure_file(${SCALAPACK_SOURCE_DIR}/CMAKE/scalapack-config-install.cmake.in
++  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake @ONLY)
++install(FILES
++  ${SCALAPACK_BINARY_DIR}/CMakeFiles/scalapack-config.cmake
++  ${SCALAPACK_BINARY_DIR}/scalapack-config-version.cmake
++  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION}
++  )
++
++install(EXPORT scalapack-targets
++  DESTINATION lib/cmake/scalapack-${SCALAPACK_VERSION})
++
+Index: ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh	(revision 26034)
+@@ -0,0 +1,70 @@
++#!/bin/bash
++set -eu
++
++
++# NOTE:
++# - This configuration depends on the successful installation of METIS via 
++# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
++# - MSMPI_ROOT should be available after etc/environment.sh is 
++#	sourced
++#
++
++## Constants
++#
++VER=2.1.0
++
++PREFIX="${ISSM_DIR}/externalpackages/scalapack/install"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/scalapack-${VER}.tgz" "scalapack-${VER}.tgz"
++
++# Unpack source
++tar -zxvf scalapack-${VER}.tgz
++
++# Move source into 'src' directory
++mv scalapack-${VER}/* src
++rm -rf scalapack-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt src
++
++# Compile
++#
++# NOTE:
++# - The CMakeLists.txt copied above is really just hacked from the original to 
++#	push through library and include paths, especially in the case of the 
++#	MS-MPI assets
++# - Added -fallow-argument-mismatch option to CMAKE_Fortran_FLAGS in order to 
++#	clear "Error: Rank mismatch between actual argument at [...]"
++# - Added -fallow-invalid-boz option to CMAKE_Fortran_FLAGS in order to clear 
++#	"Error: BOZ literal constant at [...]"
++#
++# TODO:
++# - Modify CMakeLists.txt to allow for more flexibility in configuration
++#
++cd src
++cmake \
++	-DCMAKE_INSTALL_PREFIX=${PREFIX} \
++	-DBUILD_SHARED_LIBS=ON \
++	-DCMAKE_C_COMPILER=/usr/bin/gcc \
++	-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
++	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
++	-DLOCAL_MSMPI=1 \
++	-DMSMPI_ROOT="${MSMPI_ROOT}" \
++	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
++	-DLAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -llapack" \
++	.
++
++make
++
++# Install
++mkdir ${PREFIX}/lib
++cp TESTING/msys-scalapack.dll ${PREFIX}/lib
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s ./msys-scalapack.dll ./libscalapack.dll
+
+Property changes on: ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh	(revision 26034)
+@@ -0,0 +1,73 @@
++#!/bin/bash
++set -eu
++
++
++# NOTE:
++# - This configuration depends on the successful installation of METIS via 
++# 	$ISSM_DIR/externalpackages/metis/install-5-win-msys2-gcc-msmpi.sh
++# - MSMPI_ROOT should be available after etc/environment.sh is 
++#	sourced
++#
++
++## Constants
++#
++VER=2.1.0
++
++PREFIX="${ISSM_DIR}/externalpackages/scalapack/install"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/scalapack-${VER}.tgz" "scalapack-${VER}.tgz"
++
++# Unpack source
++tar -zxvf scalapack-${VER}.tgz
++
++# Move source into 'src' directory
++mv scalapack-${VER}/* src
++rm -rf scalapack-${VER}
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt src
++cp configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in src/BLACS/SRC
++
++# Compile
++#
++# NOTE:
++# - The CMakeLists.txt copied above is really just hacked from the original to 
++#	push through library and include paths, especially in the case of the 
++#	MS-MPI assets
++# - Added -fallow-argument-mismatch option to CMAKE_Fortran_FLAGS in order to 
++#	clear "Error: Rank mismatch between actual argument at [...]"
++# - Added -fallow-invalid-boz option to CMAKE_Fortran_FLAGS in order to clear 
++#	"Error: BOZ literal constant at [...]"
++#
++# TODO:
++# - Modify CMakeLists.txt to allow for more flexibility in configuration
++#
++cd src
++cmake \
++	-DCMAKE_INSTALL_PREFIX=${PREFIX} \
++	-DBUILD_SHARED_LIBS=ON \
++	-DBUILD_STATIC_LIBS=OFF \
++	-DCMAKE_C_COMPILER=/mingw64/bin/gcc \
++	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
++	-DCMAKE_Fortran_COMPILER=/mingw64/bin/gfortran \
++	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
++	-DLOCAL_MSMPI=1 \
++	-DMSMPI_ROOT="${MSMPI_ROOT}" \
++	-DBLAS_LIBRARIES="-L${BLAS_ROOT}/lib -lblas" \
++	-DLAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -llapack" \
++	.
++
++make
++
++# Install
++mkdir ${PREFIX}/lib
++cp lib/libscalapack.* ${PREFIX}/lib
++
++# Create link to shared version of library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s liblapack.so liblapack.dll
+
+Property changes on: ../trunk-jpl/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/triangle/configs/win/msys2/gcc/configure.make
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/configs/win/msys2/gcc/configure.make	(nonexistent)
++++ ../trunk-jpl/externalpackages/triangle/configs/win/msys2/gcc/configure.make	(revision 26034)
+@@ -0,0 +1,6 @@
++CC=gcc
++CSWITCHES=$(CFLAGS) -DNO_TIMER -fpic
++TRILIBDEFS=-DTRILIBRARY
++STATIC_LIB_EXT=a
++SHARED_LIB_EXT=dll
++OBJ_EXT=o
+Index: ../trunk-jpl/externalpackages/triangle/configs/win/msys2/mingw64/configure.make
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/configs/win/msys2/mingw64/configure.make	(nonexistent)
++++ ../trunk-jpl/externalpackages/triangle/configs/win/msys2/mingw64/configure.make	(revision 26034)
+@@ -0,0 +1,6 @@
++CC=gcc
++CSWITCHES=$(CFLAGS) -DNO_TIMER -fpic
++TRILIBDEFS=-DTRILIBRARY
++STATIC_LIB_EXT=a
++SHARED_LIB_EXT=dll
++OBJ_EXT=o
+Index: ../trunk-jpl/externalpackages/triangle/install-win-msys2-gcc.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-win-msys2-gcc.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/triangle/install-win-msys2-gcc.sh	(revision 26034)
+@@ -0,0 +1,34 @@
++#!/bin/bash
++set -eu
++
++
++# Constants
++#
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
++
++# Unpack source
++unzip triangle.zip -d src
++
++# Copy customized source files to 'src' directory
++cp configs/makefile src
++cp configs/triangle.h src
++cp configs/win/msys2/gcc/configure.make src
++
++# Compile
++cd src
++make shared
++
++# Install
++cd ..
++cp src/libtriangle.* ${PREFIX}/lib
++cp src/triangle.h ${PREFIX}/include
++
++# Cleanup
++rm -rf src
+
+Property changes on: ../trunk-jpl/externalpackages/triangle/install-win-msys2-gcc.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/triangle/install-win-msys2-mingw.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-win-msys2-mingw.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/triangle/install-win-msys2-mingw.sh	(revision 26034)
+@@ -0,0 +1,34 @@
++#!/bin/bash
++set -eu
++
++
++# Constants
++#
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
++
++# Unpack source
++unzip triangle.zip -d src
++
++# Copy customized source files to 'src' directory
++cp configs/makefile src
++cp configs/triangle.h src
++cp configs/win/msys2/mingw64/configure.make src
++
++# Compile
++cd src
++make shared
++
++# Install
++cd ..
++cp src/libtriangle.* ${PREFIX}/lib
++cp src/triangle.h ${PREFIX}/include
++
++# Cleanup
++rm -rf src
+
+Property changes on: ../trunk-jpl/externalpackages/triangle/install-win-msys2-mingw.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/jenkins/ross-win-msys2-gcc-msmpi-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-win-msys2-gcc-msmpi-basic	(nonexistent)
++++ ../trunk-jpl/jenkins/ross-win-msys2-gcc-msmpi-basic	(revision 26034)
+@@ -0,0 +1,63 @@
++ISSM_CONFIG='\
++	--prefix=${ISSM_DIR} \
++	--enable-debugging \
++	--with-numthreads=4 \
++	--with-vendor="win-msys2-msmpi" \
++	--with-matlab-dir=${MATLAB_PATH} \
++	--with-mpi-include="${MSMPI_ROOT}/include" \
++	--with-mpi-libdir="${MSMPI_ROOT}/lib" \
++	--with-mpi-libflags="-lmsmpi" \
++	--with-fortran-lib="-L/c/msys64/usr/bin -lgfortran" \
++	--with-metis-dir="${ISSM_DIR}/externalpackages/metis/install" \
++	--with-parmetis-dir="${ISSM_DIR}/externalpackages/parmetis/install" \
++	--with-blas-dir="${ISSM_DIR}/externalpackages/blas/install" \
++	--with-lapack-dir="${ISSM_DIR}/externalpackages/lapack/install" \
++	--with-scalapack-dir=$ISSM_DIR/externalpackages/scalapack/install \
++	--with-mumps-dir=$ISSM_DIR/externalpackages/mumps/install \
++	--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
++'
++
++#-------------------#
++# External Packages #
++#-------------------#
++
++#List of external pakages to be installed and their installation scripts
++EXTERNALPACKAGES="
++	metis		install-5-win-msys2-gcc.sh
++	parmetis	install-4-win-msys2-gcc-msmpi.sh
++	blas		install-3-win-msys2-gcc.sh
++	lapack		install-3-win-msys2-gcc.sh
++	scalapack	install-2-win-msys2-gcc-msmpi.sh
++	mumps		install-5-win-msys2-gcc-msmpi.sh
++	petsc		install-3.12-win-msys2-gcc-msmpi.sh
++	triangle	install-win-msys2-gcc.sh
++	shell2junit	install.sh
++"
++
++#---------#
++# Testing #
++#---------#
++
++# Test suites
++MATLAB_TEST=1
++PYTHON_TEST=0
++JAVASCRIPT_TEST=0
++EXAMPLES_TEST=0
++
++# Number of CPUs used in ISSM compilation
++#
++# NOTE: One is usually safer as some packages are very sensitive to parallel
++# 		compilation
++#
++NUMCPUS_INSTALL=4
++
++# Number of CPUs used in the nightly runs
++NUMCPUS_RUN=2
++
++# Nightly run options
++#
++# See documentation in test/NightlyRun/runme.* for more information
++#
++MATLAB_NROPTIONS=""
++PYTHON_NROPTIONS=""
+Index: ../trunk-jpl/src/c/shared/io/Comm/IssmComm.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Comm/IssmComm.cpp	(revision 26033)
++++ ../trunk-jpl/src/c/shared/io/Comm/IssmComm.cpp	(revision 26034)
+@@ -12,6 +12,11 @@
+ #include "../../Numerics/types.h"
+ #include "../../Exceptions/exceptions.h"
+ 
++#ifdef _DO_NOT_LOAD_GLOBALS_
++ISSM_MPI_Comm	IssmComm::comm;
++bool			IssmComm::parallel;
++#endif
++
+ void IssmComm::SetComm(ISSM_MPI_Comm incomm){ /*{{{*/
+ 
+ 	/*A comm is provided, we are running in parallel (this is not a module)*/
+Index: ../trunk-jpl/src/c/shared/io/Print/PrintfFunction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Print/PrintfFunction.cpp	(revision 26033)
++++ ../trunk-jpl/src/c/shared/io/Print/PrintfFunction.cpp	(revision 26034)
+@@ -31,6 +31,8 @@
+ 	if(my_rank==0){
+ 		#ifdef _HAVE_ANDROID_JNI_
+ 		__android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
++		#elif _IS_MSYS2_
++		printf("%s",message.c_str());
+ 		#else
+ 		ApiPrintf(message.c_str());
+ 		#endif
+@@ -41,6 +43,8 @@
+ 
+ 	#ifdef _HAVE_ANDROID_JNI_
+ 	__android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
++	#elif _IS_MSYS2_
++	printf("%s",message.c_str());
+ 	#else
+ 	ApiPrintf(message.c_str());
+ 	#endif
+Index: ../trunk-jpl/src/c/toolkits/ToolkitOptions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/ToolkitOptions.cpp	(revision 26033)
++++ ../trunk-jpl/src/c/toolkits/ToolkitOptions.cpp	(revision 26034)
+@@ -8,6 +8,11 @@
+ #include "../shared/Exceptions/exceptions.h"
+ #include "../shared/MemOps/MemOps.h"
+ 
++#ifdef _DO_NOT_LOAD_GLOBALS_
++char* ToolkitOptions::toolkittype;
++char* ToolkitOptions::toolkitoptions;
++#endif
++
+ void  ToolkitOptions::Init(const char* toolkit_in,const char* options){ /*{{{*/
+ 
+ 	/*First, avoid a leak: */
+Index: ../trunk-jpl/src/m/classes/clusters/localpfe.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/localpfe.m	(revision 26033)
++++ ../trunk-jpl/src/m/classes/clusters/localpfe.m	(revision 26034)
+@@ -26,8 +26,8 @@
+ 	methods
+ 		function cluster=localpfe(varargin) % {{{
+ 
+-			%Change the defaults if ispc
+-			if ispc,
++			%Change the defaults if ispc and not ismingw
++			if ispc & ~ismingw,
+ 				cluster.codepath      = [issmdir() '\bin'];
+ 				cluster.etcpath       = [issmdir() '\etc'];
+ 				cluster.executionpath = [issmdir() '\execution'];
+@@ -105,7 +105,7 @@
+ 			%what is the executable being called? 
+ 			executable='issm_slc.exe';
+ 
+-			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
++			if ispc & ~ismingw, error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+ 			
+ 			%write queuing script 
+ 			fid=fopen([modelname '.queue'],'w');
+@@ -169,7 +169,7 @@
+ 		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+ 			%write queuing script 
+-			if ~ispc(),
++			if ~ispc,
+ 
+ 				fid=fopen([modelname '.queue'],'w');
+ 				fprintf(fid,'#!/bin/sh\n');
+@@ -213,7 +213,7 @@
+ 		end
+ 		%}}}
+ 		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+-			if ~ispc,
++			if ~ispc | ismingw,
+ 
+ 				%compress the files into one zip.
+ 				compressstring=['tar -zcf ' dirname '.tar.gz '];
+@@ -261,7 +261,7 @@
+ 		end %}}}
+ 		function Download(cluster,dirname,filelist)% {{{
+ 
+-			if ispc(),
++			if ispc && ~ismingw,
+ 				%do nothing
+ 				return;
+ 			end
+Index: ../trunk-jpl/src/m/os/ismingw.m
+===================================================================
+--- ../trunk-jpl/src/m/os/ismingw.m	(nonexistent)
++++ ../trunk-jpl/src/m/os/ismingw.m	(revision 26034)
+@@ -0,0 +1,11 @@
++function result=ismingw()
++%ISMINGW - Returns 1 if machine is running MinGW.
++%
++%   Usage:
++%      if ismingw,
++%         [...]
++%      end
++%
++
++[status,result]=system('uname -rs | grep "MINGW" | wc -l');
++result=str2num(result);
+Index: ../trunk-jpl/src/m/os/issmscpin.m
+===================================================================
+--- ../trunk-jpl/src/m/os/issmscpin.m	(revision 26033)
++++ ../trunk-jpl/src/m/os/issmscpin.m	(revision 26034)
+@@ -17,14 +17,11 @@
+ 
+ %if hostname and host are the same, do a simple copy
+ if strcmpi(hostname,host),
+-
+-    for i=1:numel(packages),
++	for i=1:numel(packages),
+ 		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
+ 	end
+-
+ else
+-
+-	if ispc(),
++	if ispc & ~ismingw,
+ 		%use the putty project pscp.exe: it should be in the path.
+ 
+ 		%get ISSM_DIR variable
+Index: ../trunk-jpl/src/m/os/issmscpout.m
+===================================================================
+--- ../trunk-jpl/src/m/os/issmscpout.m	(revision 26033)
++++ ../trunk-jpl/src/m/os/issmscpout.m	(revision 26034)
+@@ -23,7 +23,7 @@
+ 		eval(['cd ' path])
+ 		system(['rm -rf ' packages{i} ]);
+ 		if no_symlinks,
+-			system(['cp  ' here '/' packages{i} ' .']);
++			system(['cp ' here '/' packages{i} ' .']);
+ 		else
+ 			system(['ln -s ' here '/' packages{i} ' .']);
+ 		end
+@@ -30,7 +30,7 @@
+ 		eval(['cd ' here]);
+ 	end
+ else 
+-	if ispc(),
++	if ispc & ~ismingw,
+ 		%use the putty project pscp.exe: it should be in the path.
+ 
+ 		%get ISSM_DIR variable
+Index: ../trunk-jpl/src/m/os/issmssh.m
+===================================================================
+--- ../trunk-jpl/src/m/os/issmssh.m	(revision 26033)
++++ ../trunk-jpl/src/m/os/issmssh.m	(revision 26034)
+@@ -11,7 +11,7 @@
+ if strcmpi(host,hostname),
+ 	system(command);
+ else
+-	if ispc(),
++	if ispc & ~ismingw,
+ 		%use the putty project plink.exe: it should be in the path.
+ 
+ 		%get ISSM_DIR variable
+Index: ../trunk-jpl/src/m/os/oshostname.m
+===================================================================
+--- ../trunk-jpl/src/m/os/oshostname.m	(revision 26033)
++++ ../trunk-jpl/src/m/os/oshostname.m	(revision 26034)
+@@ -21,7 +21,7 @@
+ 
+ %Method 3, last chance
+ if isempty(hostname),
+-	if ispc
++	if ispc % If OS is MinGW, $COMPUTERNAME and $HOSTNAME are identical
+ 		hostname = getenv('COMPUTERNAME');
+ 	else
+ 		hostname = getenv('HOSTNAME');
+Index: ../trunk-jpl/src/m/solve/loadresultsfromdisk.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultsfromdisk.m	(revision 26033)
++++ ../trunk-jpl/src/m/solve/loadresultsfromdisk.m	(revision 26034)
+@@ -11,7 +11,6 @@
+ end
+ 
+ if ~md.qmu.isdakota,
+-
+ 	%Check that file exists
+ 	if ~exist(filename,'file'),
+ 		warning(sprintf(['\n'...
+Index: ../trunk-jpl/configure.ac
+===================================================================
+--- ../trunk-jpl/configure.ac	(revision 26033)
++++ ../trunk-jpl/configure.ac	(revision 26034)
+@@ -2,8 +2,8 @@
+ 
+ #AUTOCONF
+ AC_INIT([Ice Sheet System Model (ISSM)],[4.19],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+-AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
+-AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
++AC_CONFIG_AUX_DIR([./aux-config])	# Put config files in aux-config
++AC_CONFIG_MACRO_DIR([m4])			# m4 macros are located in m4
+ m4_include([m4/issm_options.m4])
+ 
+ #print header
+@@ -15,21 +15,21 @@
+ AC_CANONICAL_TARGET
+ 
+ #Compilers
+-AC_PROG_CC([icc cl icl gcc])
++AC_PROG_CC([gcc icc cl icl])
+ AC_PROG_CPP
+-AC_PROG_CXX([icpc cl icl g++])
+-AC_PROG_F77([ifort g77 gfortran])
+-AC_PROG_FC([ifort gfortran])
++AC_PROG_CXX([g++ icpc cl icl])
++AC_PROG_F77([g77 gfortran ifort])
++AC_PROG_FC([gfortran ifort])
+ 
+ #AUTOMAKE
+ #Initialize automake and declare foreign so that we don't need a ChangeLog, INSTALL, etc
+ AM_INIT_AUTOMAKE([foreign])
+-AC_CONFIG_HEADERS([./config.h])   #Config file must be config.h
+-AM_SILENT_RULES([yes])           #Do not show compilation command by default
++AC_CONFIG_HEADERS([./config.h])		# Config file must be config.h
++AM_SILENT_RULES([yes])				# Do not show compilation command by default
+ AM_PROG_AR
+ 
+ #Libtool
+-LT_INIT
++LT_INIT([win32-dll])
+ 
+ #Run issm_options.m4
+ ISSM_OPTIONS
+@@ -36,17 +36,17 @@
+ 
+ #List all Makefiles
+ AC_CONFIG_FILES([
+-					  Makefile
+-					  src/Makefile
+-					  src/c/Makefile 
+-					  src/wrappers/Makefile
+-					  src/wrappers/python/Makefile
+-					  src/wrappers/matlab/Makefile
+-					  src/wrappers/javascript/Makefile
+-					  src/mobile/Makefile
+-					  src/mobile/native/Makefile
+-					  src/m/Makefile
+-					  ])
++	Makefile
++	src/Makefile
++	src/c/Makefile
++	src/wrappers/Makefile
++	src/wrappers/python/Makefile
++	src/wrappers/matlab/Makefile
++	src/wrappers/javascript/Makefile
++	src/mobile/Makefile
++	src/mobile/native/Makefile
++	src/m/Makefile
++])
+ 
+ #End of configure.ac
+ AC_OUTPUT
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 26033)
++++ ../trunk-jpl/etc/environment.sh	(revision 26034)
+@@ -167,15 +167,40 @@
+ 	fi
+ } #}}}
+ 
++#######################
++# OS-specific handling
++#######################
++
++OS=$(uname -s)
++
++if [[ "${OS}" == MINGW* || "${OS}" == MSYS* ]]; then
++	# If this is a Windows build, we need to copy MSMPI to working $ISSM_DIR
++	MSMPI_ROOT="${ISSM_DIR}/MSMPI"
++	if [ ! -d "${MSMPI_ROOT}" ]; then
++		${ISSM_DIR}/scripts/win-msys2-create_local_msmpi_dir.sh
++	fi
++	export MSMPI_ROOT # Used in installation of ParMETIS, ScaLAPACK
++	path_prepend "${ISSM_DIR}/bin" # Lets dynamic linker find DLLs
++	cpath_prepend "${MSMPI_ROOT}/include"
++	library_path_prepend "${MSMPI_ROOT}/lib"
++fi
++
+ # Windows compilers
+-if [[ "$ISSM_ARCH" == "cygwin-intel" ]]; then
+-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
++if [[ "${ISSM_ARCH}" == "cygwin-intel" ]]; then
++	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+ fi
+ 
+ path_append "${ISSM_DIR}/aux-config"
+ path_append "${ISSM_DIR}/scripts"
+ 
+-ISSM_EXT_DIR="${ISSM_DIR}/externalpackages" # Redefine this constant if externalpackages are installed to a different directory
++# Default path to external packages. Redefine this constant if they are 
++# installed to a different directory. Alternatively, export it on the command 
++# line or in a profile initialization file (that is why we check here if it is 
++# set already).
++#
++if [ -z "${ISSM_EXT_DIR+x}" ]; then
++	export ISSM_EXT_DIR="${ISSM_DIR}/externalpackages"
++fi
+ 
+ #########################
+ # Command-line utilities
+@@ -252,18 +277,56 @@
+ 	ld_library_path_append "${MPI_ROOT}/lib"
+ fi
+ 
+-# NOTE: Check *must* come before PETSc as we prefer packages installed via 
+-# 		PETSc
++# NOTE: The following checks *must* come before PETSc as we prefer packages 
++#		installed via PETSc
+ #
+-LAPACK_ROOT="${ISSM_DIR}/lapack/install"
++BLAS_ROOT="${ISSM_EXT_DIR}/blas/install"
++if [ -d "${BLAS_ROOT}" ]; then
++	export BLAS_ROOT # Used in installation of LAPACK, ScaLAPACK, PETSc
++	path_append "${BLAS_ROOT}/lib" # Lets dynamic linker find DLLs
++	library_path_append "${BLAS_ROOT}/lib"
++	ld_library_path_append "${BLAS_ROOT}/lib"
++fi
++
++LAPACK_ROOT="${ISSM_EXT_DIR}/lapack/install"
+ if [ -d "${LAPACK_ROOT}" ]; then
++	export LAPACK_ROOT # Used in installation of ScaLAPACK, MUMPS, PETSc
++	path_append "${LAPACK_ROOT}/lib" # Lets dynamic linker find DLLs
++	library_path_append "${LAPACK_ROOT}/lib"
+ 	ld_library_path_append "${LAPACK_ROOT}/lib"
+ fi
+ 
+-# NOTE: Check *must* come before PETSc as we prefer packages installed via 
+-# 		PETSc
+-#
+-ZLIB_ROOT="${ISSM_DIR}/zlib/install"
++METIS_ROOT="${ISSM_EXT_DIR}/metis/install"
++if [ -d "${METIS_ROOT}" ]; then
++	export METIS_ROOT # Used in installation of ParMETIS, Gmsh, PETSc
++	path_append "${METIS_ROOT}/lib" # Lets dynamic linker find DLLs
++	library_path_prepend "${METIS_ROOT}/lib"
++	ld_library_path_prepend "${METIS_ROOT}/lib"
++fi
++
++MUMPS_ROOT="${ISSM_EXT_DIR}/mumps/install"
++if [ -d "${MUMPS_ROOT}" ]; then
++	export MUMPS_ROOT # Used in installation of PETSc
++	path_append "${MUMPS_ROOT}/lib" # Lets dynamic linker find DLLs
++	library_path_append "${MUMPS_ROOT}/lib"
++fi
++
++PARMETIS_ROOT="${ISSM_EXT_DIR}/parmetis/install"
++if [ -d "${PARMETIS_ROOT}" ]; then
++	export PARMETIS_ROOT # Used in installation of MUMPS, PETSc
++	path_append "${PARMETIS_ROOT}/lib" # Lets dynamic linker find DLLs
++	library_path_prepend "${PARMETIS_ROOT}/lib"
++	ld_library_path_prepend "${PARMETIS_ROOT}/lib"
++fi
++
++SCALAPACK_ROOT="${ISSM_EXT_DIR}/scalapack/install"
++if [ -d "${SCALAPACK_ROOT}" ]; then
++	export SCALAPACK_ROOT # Used in installation of MUMPS, PETSc
++	path_append "${SCALAPACK_ROOT}/lib" # Lets dynamic linker find DLLs
++	library_path_append "${SCALAPACK_ROOT}/lib"
++fi
++
++ZLIB_ROOT="${ISSM_EXT_DIR}/zlib/install"
+ if [ -d "${ZLIB_ROOT}" ]; then
+ 	export ZLIB_ROOT # Used in installation of NetCDF, GDAL, GMT
+ 	ld_library_path_append "${ZLIB_ROOT}/lib"
+@@ -270,8 +333,10 @@
+ fi
+ 
+ PETSC_ROOT="${ISSM_EXT_DIR}/petsc/install"
+-if [ -d "$PETSC_ROOT" ]; then
++if [ -d "${PETSC_ROOT}" ]; then
+ 	export PETSC_ROOT # Used in installation of Gmsh
++	path_append "${PETSC_ROOT}/lib" # Lets dynamic linker find DLLs
++	library_path_prepend "${PETSC_ROOT}/lib"
+ 	ld_library_path_prepend "${PETSC_ROOT}/lib"
+ 
+ 	# In case we have installed certain external packages via PETSc
+@@ -445,6 +510,7 @@
+ 
+ TRIANGLE_ROOT="${ISSM_EXT_DIR}/triangle/install"
+ if [ -d "${TRIANGLE_ROOT}" ]; then
++	path_append "${TRIANGLE_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	ld_library_path_append "${TRIANGLE_ROOT}/lib"
+ 	dyld_library_path_append "${TRIANGLE_ROOT}/lib"
+ fi
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(revision 26034)
+@@ -0,0 +1,106 @@
++DEST_DIR = 	../exec
++DEST=		${DEST_DIR}/chaco
++CC = 		gcc
++IFLAG =		-Imain
++CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/mingw64/x86_64-w64-mingw32/include -I/usr/include -Wno-implicit-function-declaration
++OFLAGS =	-O2
++
++FILES.c=	main/user_params.c main/interface.c main/main.c \
++		submain/balance.c submain/divide.c submain/submain.c \
++		input/input_assign.c \
++		input/check_input.c input/input.c input/input_geom.c \
++		input/input_graph.c input/read_params.c input/reflect_input.c \
++		input/read_val.c \
++		graph/check_graph.c graph/free_graph.c \
++		graph/reformat.c graph/subgraph.c graph/graph_out.c \
++		inertial/eigenvec2.c inertial/eigenvec3.c inertial/inertial.c \
++		inertial/inertial1d.c inertial/inertial2d.c \
++		inertial/inertial3d.c inertial/make_subgeom.c \
++		klspiff/buckets.c klspiff/buckets_bi.c klspiff/buckets1.c \
++		klspiff/bilistops.c klspiff/coarsen_kl.c klspiff/count_weights.c \
++		klspiff/compress_ewgts.c klspiff/kl_init.c klspiff/kl_output.c \
++		klspiff/klspiff.c klspiff/make_bndy_list.c \
++		klspiff/make_kl_list.c klspiff/nway_kl.c \
++		klvspiff/bpm_improve.c klvspiff/bucketsv.c \
++		klvspiff/clear_dvals.c klvspiff/coarsen_klv.c \
++		klvspiff/countup_vtx_sep.c klvspiff/find_bndy.c klvspiff/flow.c \
++		klvspiff/klv_init.c klvspiff/klvspiff.c klvspiff/make_bpgraph.c \
++		klvspiff/make_sep_list.c klvspiff/matching.c klvspiff/nway_klv.c \
++		klvspiff/flatten.c \
++		coarsen/coarsen.c coarsen/interpolate.c coarsen/makefgraph.c \
++		coarsen/makeccoords.c \
++		coarsen/coarsen1.c coarsen/makev2cv.c \
++		coarsen/maxmatch.c coarsen/maxmatch1.c coarsen/maxmatch2.c \
++		coarsen/maxmatch3.c coarsen/maxmatch4.c coarsen/maxmatch5.c \
++		connect/add_edges.c connect/connected.c connect/find_edges.c \
++		eigen/bidir.c eigen/bisect.c eigen/checkeig.c \
++		eigen/checkeig_ext.c \
++		eigen/checkorth.c eigen/cksturmcnt.c eigen/mkeigvecs.c\
++		eigen/eigensolve.c eigen/get_extval.c eigen/get_ritzvals.c \
++		eigen/lanczos_FO.c eigen/lanczos_SO.c eigen/lanczos_SO_float.c \
++		eigen/lanczos_ext.c eigen/lanczos_ext_float.c eigen/lanc_seconds.c\
++		eigen/lanpause.c eigen/makeorthlnk.c eigen/mkscanlist.c \
++		eigen/orthog1.c eigen/orthogonalize.c eigen/orthogvec.c \
++		eigen/ql.c eigen/rqi.c eigen/rqi_ext.c eigen/scale_diag.c \
++		eigen/scanmax.c eigen/scanmin.c eigen/solistout.c \
++                eigen/sorthog.c eigen/splarax.c eigen/sturmcnt.c \
++		eigen/Tevec.c eigen/tri_solve.c eigen/warnings.c \
++		symmlq/aprod.c symmlq/msolve.c symmlq/pow_dd.c \
++		symmlq/symmlq.c symmlq/symmlqblas.c \
++		tinvit/tinvit.c tinvit/pythag.c tinvit/epslon.c \
++		optimize/determinant.c optimize/func2d.c \
++		optimize/func3d.c optimize/opt2d.c optimize/opt3d.c \
++		assign/assign.c assign/assign_out.c assign/mapper.c \
++		assign/median.c assign/merge_assign.c \
++		assign/rec_median.c assign/rotate.c assign/y2x.c \
++		bpmatch/checkbp.c bpmatch/inits2d.c bpmatch/inits3d.c \
++		bpmatch/genvals2d.c bpmatch/genvals3d.c bpmatch/map2d.c \
++		bpmatch/map3d.c bpmatch/movevtxs.c \
++		bpmatch/sorts2d.c bpmatch/sorts3d.c \
++		refine_map/compute_cube_edata.c refine_map/compute_cube_vdata.c \
++		refine_map/refine_cube.c refine_map/update_cube_edata.c \
++		refine_map/update_cube_vdata.c refine_map/find_edge_cube.c \
++		refine_map/init_cube_edata.c refine_map/compute_mesh_edata.c \
++		refine_map/compute_mesh_vdata.c refine_map/find_edge_mesh.c \
++		refine_map/init_mesh_edata.c refine_map/refine_mesh.c \
++		refine_map/update_mesh_edata.c refine_map/update_mesh_vdata.c \
++		refine_map/refine_map.c refine_map/make_comm_graph.c \
++		refine_part/refine_part.c refine_part/kl_refine.c \
++		refine_part/make_maps_ref.c refine_part/make_terms_ref.c \
++		internal/force_internal.c internal/improve_internal.c \
++		internal/check_internal.c \
++		misc/define_subcubes.c misc/define_submeshes.c \
++		misc/divide_procs.c misc/merge_goals.c misc/make_term_props.c \
++		misc/count.c misc/countup.c misc/countup_cube.c \
++		misc/countup_mesh.c misc/make_subgoal.c \
++		misc/find_maxdeg.c misc/make_maps.c misc/make_setlists.c \
++		misc/sequence.c misc/perturb.c misc/simple_part.c \
++		misc/time_kernels.c misc/timing.c \
++		util/affirm.c util/array_alloc_2D.c util/bit_reverse.c \
++		util/checkpnt.c util/cpvec.c util/dot.c \
++		util/doubleout.c util/input_int.c util/gray.c \
++		util/machine_params.c util/makevwsqrt.c util/mkvec.c util/norm.c \
++                util/normalize.c util/mergesort.c \
++                util/randomize.c util/smalloc.c util/bail.c \
++		util/scadd.c util/seconds.c util/setvec.c util/shell_sort.c \
++		util/strout.c util/tri_prod.c util/true_or_false.c \
++		util/update.c  util/vecout.c util/vecran.c \
++                util/vecscale.c 
++
++FILES.o=	$(FILES.c:.c=.o) 
++
++
++${DEST}:	${FILES.o} Makefile
++		${CC} ${OFLAGS} ${FILES.o} -lm -L/lib/w32api -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -o ${DEST}
++
++lint:
++		lint ${IFLAG} ${FILES.c} -lm
++
++alint:
++		alint ${IFLAG} ${FILES.c} -lm
++
++clean:
++		rm -f */*.o ${DEST_DIR}/core
++
++.c.o:
++		${CC} -c ${IFLAG} ${CFLAGS} -o $*.o $*.c
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch	(revision 26034)
+@@ -0,0 +1,11 @@
++--- ./src/code/Makefile	2016-02-16 19:39:30.000000000 -0800
+++++ ./Makefile	2016-02-16 19:37:49.000000000 -0800
++@@ -6,7 +6,7 @@
++ #CFLAGS =	-O2
++ #OFLAGS =	-O2
++ #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
++-CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
+++CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/mingw64/x86_64-w64-mingw32/include -I/usr/include -Wno-implicit-function-declaration
++ #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
++ OFLAGS =	-O2 
++ #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
+Index: ../trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw/CMakeLists.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw/CMakeLists.txt	(revision 26034)
+@@ -0,0 +1,450 @@
++cmake_minimum_required(VERSION 2.8.12)
++
++project(LAPACK Fortran C)
++
++set(LAPACK_MAJOR_VERSION 3)
++set(LAPACK_MINOR_VERSION 9)
++set(LAPACK_PATCH_VERSION 0)
++set(
++  LAPACK_VERSION
++  ${LAPACK_MAJOR_VERSION}.${LAPACK_MINOR_VERSION}.${LAPACK_PATCH_VERSION}
++  )
++
++# Add the CMake directory for custon CMake modules
++set(CMAKE_MODULE_PATH "${LAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
++
++# Export all symbols on Windows when building shared libraries
++SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
++
++# Set a default build type if none was specified
++if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
++  message(STATUS "Setting build type to 'Release' as none was specified.")
++  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
++  # Set the possible values of build type for cmake-gui
++  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "Coverage")
++endif()
++
++# Coverage
++set(_is_coverage_build 0)
++set(_msg "Checking if build type is 'Coverage'")
++message(STATUS "${_msg}")
++if(NOT CMAKE_CONFIGURATION_TYPES)
++  string(TOLOWER ${CMAKE_BUILD_TYPE} _build_type_lc)
++  if(${_build_type_lc} STREQUAL "coverage")
++    set(_is_coverage_build 1)
++  endif()
++endif()
++message(STATUS "${_msg}: ${_is_coverage_build}")
++
++if(_is_coverage_build)
++  message(STATUS "Adding coverage")
++  find_package(codecov)
++endif()
++
++# By default static library
++option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
++
++include(GNUInstallDirs)
++
++# Updated OSX RPATH settings
++# In response to CMake 3.0 generating warnings regarding policy CMP0042,
++# the OSX RPATH settings have been updated per recommendations found
++# in the CMake Wiki:
++#  http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH
++set(CMAKE_MACOSX_RPATH ON)
++set(CMAKE_SKIP_BUILD_RPATH FALSE)
++set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
++list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${CMAKE_INSTALL_FULL_LIBDIR} isSystemDir)
++if("${isSystemDir}" STREQUAL "-1")
++  set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
++  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
++endif()
++
++
++# Configure the warning and code coverage suppression file
++configure_file(
++  "${LAPACK_SOURCE_DIR}/CTestCustom.cmake.in"
++  "${LAPACK_BINARY_DIR}/CTestCustom.cmake"
++  @ONLY
++)
++
++include(PreventInSourceBuilds)
++include(PreventInBuildInstalls)
++
++if(UNIX)
++  if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
++    list(APPEND CMAKE_Fortran_FLAGS -fp-model strict)
++  endif()
++  if(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
++    list(APPEND CMAKE_Fortran_FLAGS -qnosave -qstrict=none)
++  endif()
++# Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler.
++# This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin
++  string(REPLACE \;mtsk\; \; CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}")
++endif()
++
++if(CMAKE_Fortran_COMPILER_ID STREQUAL Compaq)
++  if(WIN32)
++    if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
++      get_filename_component(CMAKE_Fortran_COMPILER_CMDNAM ${CMAKE_Fortran_COMPILER} NAME_WE)
++      message(STATUS "Using Compaq Fortran compiler with command name ${CMAKE_Fortran_COMPILER_CMDNAM}")
++      set(cmd ${CMAKE_Fortran_COMPILER_CMDNAM})
++      string(TOLOWER "${cmd}" cmdlc)
++      if(cmdlc STREQUAL "df")
++        message(STATUS "Assume the Compaq Visual Fortran Compiler is being used")
++        set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1)
++        set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_INCLUDES 1)
++        #This is a workaround that is needed to avoid forward-slashes in the
++        #filenames listed in response files from incorrectly being interpreted as
++        #introducing compiler command options
++        if(${BUILD_SHARED_LIBS})
++          message(FATAL_ERROR "Making of shared libraries with CVF has not been tested.")
++        endif()
++        set(str "NMake version 9 or later should be used. NMake version 6.0 which is\n")
++        set(str "${str}   included with the CVF distribution fails to build Lapack because\n")
++        set(str "${str}   the number of source files exceeds the limit for NMake v6.0\n")
++        message(STATUS ${str})
++        set(CMAKE_Fortran_LINK_EXECUTABLE "LINK /out:<TARGET> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS>")
++      endif()
++    endif()
++  endif()
++endif()
++
++
++# --------------------------------------------------
++set(LAPACK_INSTALL_EXPORT_NAME lapack-targets)
++
++macro(lapack_install_library lib)
++  install(TARGETS ${lib}
++    EXPORT ${LAPACK_INSTALL_EXPORT_NAME}
++    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
++    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
++    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries
++  )
++endmacro()
++
++set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
++
++# --------------------------------------------------
++# Testing
++option(BUILD_TESTING "Build tests" ${_is_coverage_build})
++include(CTest)
++message(STATUS "Build tests: ${BUILD_TESTING}")
++
++# lapack_testing.py uses features from python 2.7 and greater
++if(BUILD_TESTING)
++  set(_msg "Looking for Python >= 2.7 needed for summary tests")
++  message(STATUS "${_msg}")
++  find_package(PythonInterp 2.7 QUIET)
++  if(PYTHONINTERP_FOUND)
++    message(STATUS "${_msg} - found (${PYTHON_VERSION_STRING})")
++  else()
++    message(STATUS "${_msg} - not found (skipping summary tests)")
++  endif()
++endif()
++
++# --------------------------------------------------
++# Organize output files.  On Windows this also keeps .dll files next
++# to the .exe files that need them, making tests easy to run.
++set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/bin)
++set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/lib)
++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/lib)
++
++# --------------------------------------------------
++# Check for any necessary platform specific compiler flags
++include(CheckLAPACKCompilerFlags)
++CheckLAPACKCompilerFlags()
++
++# --------------------------------------------------
++# Check second function
++
++include(CheckTimeFunction)
++set(TIME_FUNC NONE ${TIME_FUNC})
++CHECK_TIME_FUNCTION(NONE TIME_FUNC)
++CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
++CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
++CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
++CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
++message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
++
++set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
++set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
++
++# deprecated LAPACK and LAPACKE routines
++option(BUILD_DEPRECATED "Build deprecated routines" OFF)
++message(STATUS "Build deprecated routines: ${BUILD_DEPRECATED}")
++
++# --------------------------------------------------
++# Precision to build
++# By default all precisions are generated
++option(BUILD_SINGLE "Build single precision real" ON)
++option(BUILD_DOUBLE "Build double precision real" ON)
++option(BUILD_COMPLEX "Build single precision complex" ON)
++option(BUILD_COMPLEX16 "Build double precision complex" ON)
++message(STATUS "Build single precision real: ${BUILD_SINGLE}")
++message(STATUS "Build double precision real: ${BUILD_DOUBLE}")
++message(STATUS "Build single precision complex: ${BUILD_COMPLEX}")
++message(STATUS "Build double precision complex: ${BUILD_COMPLEX16}")
++
++if(NOT (BUILD_SINGLE OR BUILD_DOUBLE OR BUILD_COMPLEX OR BUILD_COMPLEX16))
++  message(FATAL_ERROR "Nothing to build, no precision selected.
++  Please enable at least one of these:
++  BUILD_SINGLE, BUILD_DOUBLE, BUILD_COMPLEX, BUILD_COMPLEX16.")
++endif()
++
++# --------------------------------------------------
++# Subdirectories that need to be processed
++option(USE_OPTIMIZED_BLAS "Whether or not to use an optimized BLAS library instead of included netlib BLAS" OFF)
++
++# Check the usage of the user provided BLAS libraries
++if(BLAS_ROOT)
++  include(CheckFortranFunctionExists)
++  set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "msys-" "")
++  set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
++  find_library(BLAS blas PATHS ${BLAS_ROOT}/lib)
++  set(CMAKE_REQUIRED_LIBRARIES ${BLAS})
++  CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND)
++  unset(CMAKE_REQUIRED_LIBRARIES)
++  if(BLAS_FOUND)
++    message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS}.")
++    set(BLAS_LIBRARIES blas)
++  else()
++    message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS}.")
++    message(ERROR "-->     Will use REFERENCE BLAS (by default)")
++    message(ERROR "-->     Or Correct your BLAS_LIBRARIES entry ")
++    message(ERROR "-->     Or Consider checking USE_OPTIMIZED_BLAS")
++  endif()
++
++# User did not provide a BLAS Library but specified to search for one
++elseif(USE_OPTIMIZED_BLAS)
++  find_package(BLAS)
++endif()
++
++# Neither user specified or optimized BLAS libraries can be used
++if(NOT BLAS_FOUND)
++  message(STATUS "Using supplied NETLIB BLAS implementation")
++  add_subdirectory(BLAS)
++  set(BLAS_LIBRARIES blas)
++else()
++  set(CMAKE_EXE_LINKER_FLAGS
++    "${CMAKE_EXE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
++    CACHE STRING "Linker flags for executables" FORCE)
++  set(CMAKE_MODULE_LINKER_FLAGS
++    "${CMAKE_MODULE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
++    CACHE STRING "Linker flags for modules" FORCE)
++  set(CMAKE_SHARED_LINKER_FLAGS
++    "${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
++    CACHE STRING "Linker flags for shared libs" FORCE)
++endif()
++
++
++# --------------------------------------------------
++# CBLAS
++option(CBLAS "Build CBLAS" OFF)
++
++if(CBLAS)
++  add_subdirectory(CBLAS)
++endif()
++
++# --------------------------------------------------
++# XBLAS
++
++option(USE_XBLAS "Build extended precision (needs XBLAS)" OFF)
++if(USE_XBLAS)
++  find_library(XBLAS_LIBRARY NAMES xblas)
++endif()
++
++option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF)
++
++# --------------------------------------------------
++# LAPACK
++# User did not provide a LAPACK Library but specified to search for one
++if(USE_OPTIMIZED_LAPACK)
++  find_package(LAPACK)
++endif()
++
++# Check the usage of the user provided or automatically found LAPACK libraries
++if(LAPACK_LIBRARIES)
++  include(CheckFortranFunctionExists)
++  set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
++  # Check if new routine of 3.4.0 is in LAPACK_LIBRARIES
++  CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LATESTLAPACK_FOUND)
++  unset(CMAKE_REQUIRED_LIBRARIES)
++  if(LATESTLAPACK_FOUND)
++    message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
++  else()
++    message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0, CANNOT USE ${LAPACK_LIBRARIES}.")
++    message(ERROR "-->     Will use REFERENCE LAPACK (by default)")
++    message(ERROR "-->     Or Correct your LAPACK_LIBRARIES entry ")
++    message(ERROR "-->     Or Consider checking USE_OPTIMIZED_LAPACK")
++  endif()
++endif()
++
++# Neither user specified or optimized LAPACK libraries can be used
++if(NOT LATESTLAPACK_FOUND)
++  message(STATUS "Using supplied NETLIB LAPACK implementation")
++  set(LAPACK_LIBRARIES lapack)
++  add_subdirectory(SRC)
++else()
++  set(CMAKE_EXE_LINKER_FLAGS
++    "${CMAKE_EXE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
++    CACHE STRING "Linker flags for executables" FORCE)
++  set(CMAKE_MODULE_LINKER_FLAGS
++    "${CMAKE_MODULE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
++    CACHE STRING "Linker flags for modules" FORCE)
++  set(CMAKE_SHARED_LINKER_FLAGS
++    "${CMAKE_SHARED_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
++    CACHE STRING "Linker flags for shared libs" FORCE)
++endif()
++
++if(BUILD_TESTING)
++  add_subdirectory(TESTING)
++endif()
++
++# --------------------------------------------------
++# LAPACKE
++option(LAPACKE "Build LAPACKE" OFF)
++
++# LAPACKE has also the interface to some routines from tmglib,
++# if LAPACKE_WITH_TMG is selected, we need to add those routines to LAPACKE
++option(LAPACKE_WITH_TMG "Build LAPACKE with tmglib routines" OFF)
++if(LAPACKE_WITH_TMG)
++  set(LAPACKE ON)
++endif()
++if(BUILD_TESTING OR LAPACKE_WITH_TMG) #already included, avoid double inclusion
++  add_subdirectory(TESTING/MATGEN)
++endif()
++
++if(LAPACKE)
++  add_subdirectory(LAPACKE)
++endif()
++
++#-------------------------------------
++# BLAS++ / LAPACK++
++option(BLAS++ "Build BLAS++" OFF)
++option(LAPACK++ "Build LAPACK++" OFF)
++ 
++ 
++function(_display_cpp_implementation_msg name)
++  string(TOLOWER ${name} name_lc)
++  message(STATUS "${name}++ enable")
++  message(STATUS "----------------")
++  message(STATUS "Thank you for your interest in ${name}++, a newly developed C++ API for ${name} library")
++  message(STATUS "The objective of ${name}++ is to provide a convenient, performance oriented API for development in the C++ language, that, for the most part, preserves established conventions, while, at the same time, takes advantages of modern C++ features, such as: namespaces, templates, exceptions, etc.")
++  message(STATUS "We are still working on integrating ${name}++ in our library. For the moment, you can download directly ${name_lc}++ from https://bitbucket.org/icl/${name_lc}pp")
++  message(STATUS "For support ${name}++ related question, please email: slate-user@icl.utk.edu")
++  message(STATUS "----------------")
++endfunction()
++if(BLAS++)
++  _display_cpp_implementation_msg("BLAS")
++endif()
++if(LAPACK++)
++  _display_cpp_implementation_msg("LAPACK")
++endif()
++
++# --------------------------------------------------
++# CPACK Packaging
++
++set(CPACK_PACKAGE_NAME "LAPACK")
++set(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
++set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LAPACK- Linear Algebra Package")
++set(CPACK_PACKAGE_VERSION_MAJOR ${LAPACK_MAJOR_VERSION})
++set(CPACK_PACKAGE_VERSION_MINOR ${LAPACK_MINOR_VERSION})
++set(CPACK_PACKAGE_VERSION_PATCH ${LAPACK_PATCH_VERSION})
++set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
++set(CPACK_MONOLITHIC_INSTALL ON)
++set(CPACK_PACKAGE_INSTALL_DIRECTORY "LAPACK")
++if(WIN32 AND NOT UNIX)
++  # There is a bug in NSI that does not handle full unix paths properly. Make
++  # sure there is at least one set of four (4) backlasshes.
++  set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
++  set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/lapack")
++  set(CPACK_NSIS_CONTACT "lapack@eecs.utk.edu")
++  set(CPACK_NSIS_MODIFY_PATH ON)
++  set(CPACK_NSIS_DISPLAY_NAME "LAPACK-${LAPACK_VERSION}")
++  set(CPACK_PACKAGE_RELOCATABLE "true")
++else()
++  set(CPACK_GENERATOR "TGZ")
++  set(CPACK_SOURCE_GENERATOR TGZ)
++  set(CPACK_SOURCE_PACKAGE_FILE_NAME "lapack-${LAPACK_VERSION}")
++  set(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES})
++endif()
++include(CPack)
++
++
++# --------------------------------------------------
++
++if(NOT BLAS_FOUND)
++  set(ALL_TARGETS ${ALL_TARGETS} blas)
++endif()
++
++if(NOT LATESTLAPACK_FOUND)
++  set(ALL_TARGETS ${ALL_TARGETS} lapack)
++endif()
++
++if(BUILD_TESTING OR LAPACKE_WITH_TMG)
++  set(ALL_TARGETS ${ALL_TARGETS} tmglib)
++endif()
++
++# Export lapack targets, not including lapacke, from the
++# install tree, if any.
++set(_lapack_config_install_guard_target "")
++if(ALL_TARGETS)
++  install(EXPORT lapack-targets
++    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION}
++    COMPONENT Development
++    )
++
++  # Choose one of the lapack targets to use as a guard for
++  # lapack-config.cmake to load targets from the install tree.
++  list(GET ALL_TARGETS 0 _lapack_config_install_guard_target)
++endif()
++
++# Include cblas in targets exported from the build tree.
++if(CBLAS)
++  set(ALL_TARGETS ${ALL_TARGETS} cblas)
++endif()
++
++# Include lapacke in targets exported from the build tree.
++if(LAPACKE)
++  set(ALL_TARGETS ${ALL_TARGETS} lapacke)
++endif()
++
++# Export lapack and lapacke targets from the build tree, if any.
++set(_lapack_config_build_guard_target "")
++if(ALL_TARGETS)
++  export(TARGETS ${ALL_TARGETS} FILE lapack-targets.cmake)
++
++  # Choose one of the lapack or lapacke targets to use as a guard
++  # for lapack-config.cmake to load targets from the build tree.
++  list(GET ALL_TARGETS 0 _lapack_config_build_guard_target)
++endif()
++
++configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-build.cmake.in
++  ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)
++
++
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc @ONLY)
++  install(FILES
++  ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc
++  DESTINATION ${PKG_CONFIG_DIR}
++  COMPONENT Development
++  )
++
++configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
++  ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
++
++include(CMakePackageConfigHelpers)
++write_basic_package_version_file(
++  ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
++  VERSION ${LAPACK_VERSION}
++  COMPATIBILITY SameMajorVersion
++  )
++
++install(FILES
++  ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake
++  ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
++  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION}
++  COMPONENT Development
++  )
++  
+Index: ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26034)
+@@ -0,0 +1,94 @@
++#!/bin/bash
++set -u # NOTE: Do not set -e as it will cause this script to fail when there are errors in underlying Python scripts
++
++# NOTE:
++# - You must install various needed packages with,
++#
++#		pacman -S autoconf make automake-wrapper bison git mingw-w64-x86_64-freeglut mingw-w64-x86_64-toolchain patch python perl pkg-config pkgfile rebase tar time tzcode unzip which mingw-w64-x86_64-libmicroutils
++#
++# then remove the MinGW 64-bit version of Python (and depdendent packages) with,
++#
++#		pacman -R mingw-w64-x86_64-gdb-multiarch mingw-w64-x86_64-gdb mingw-w64-x86_64-python
++#
++# - You must use MSYS2 MinGW 64-bit version of cmake to be able to install 
++#	external packages correctly,
++#
++#		pacman -R mingw-w64-x86_64-cmake
++#
++# Sources:
++# - https://gitlab.com/petsc/petsc/-/issues/820#note_487483240
++#
++
++## Constants
++#
++VER="3.14.4"
++
++MAKEFILE_GENERATOR='-G "MSYS Makefiles"'
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir ${PETSC_DIR}
++
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
++rm -rf petsc-${VER}
++
++# Configure
++# - Cannot use --with-fpic option when compiling static libs,
++#
++#		Cannot determine compiler PIC flags if shared libraries is turned off
++#		Either run using --with-shared-libraries or --with-pic=0 and supply the
++#		compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
++#
++# - Added -fallow-argument-mismatch option to FFLAGS in order to clear "Error: 
++#	Rank mismatch between actual argument at [...]"
++# - Added -fallow-invalid-boz option to FFLAGS in order to clear "Error: BOZ 
++#	literal constant at [...]"
++# - Argument to --with-mpi-include must be a list or it gets expanded 
++#	incorrectly
++#
++cd ${PETSC_DIR}
++./config/configure.py \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
++	--CFLAGS="-fPIC -Wno-error=implicit-function-declaration" \
++	--CXXFLAGS="-fPIC" \
++	--FFLAGS="-fPIC -fallow-argument-mismatch -fallow-invalid-boz" \
++	--with-shared-libraries=0 \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-proc-filesystem=0 \
++	--with-mpiexec="/c/PROGRA~1/MICROS~1/Bin/mpiexec.exe" \
++	--with-mpi-lib="-L${MSMPI_ROOT}/lib -lmsmpi" \
++	--with-mpi-include="${MSMPI_ROOT}/include" \
++	--download-fblaslapack=1 \
++	--download-metis=1 \
++	--download-metis-cmake-arguments="${MAKEFILE_GENERATOR}" \
++	--download-parmetis=1 \
++	--download-parmetis-cmake-arguments="${MAKEFILE_GENERATOR}" \
++	--download-scalapack=1 \
++	--download-scalapack-cmake-arguments="${MAKEFILE_GENERATOR}" \
++	--download-mumps=1
++
++# Compile and install
++make
++make install
++
++# # NOTE:
++# # - Hack to recover from failed installation (appears to happen only on Windows 
++# #	when reproducing symbolic links in destination directory) rather than 
++# #	trying to patch src/config/install.py
++# #
++# if [ $? -ne 0 ]; then
++# 	make install
++# fi
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 26033)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 26034)
+@@ -6,6 +6,10 @@
+ # been completed. Finally, results of the build and tests are emailed to the
+ # members of the ISSM development team.
+ #
++# NOTE:
++# - Variable OS is set in environment by running 
++#	`source $ISSM_DIR/etc/environment.sh`.
++#
+ # TODO:
+ # - Rename TEMP to something more descriptive (ensure first that other parts of
+ #	the build system do not rely on this name)
+@@ -13,9 +17,9 @@
+ ################################################################################
+ 
+ echo "Cleaning up execution directory"
+-rm -rf $ISSM_DIR/execution/*
+-rm -rf $ISSM_DIR/nightlylog
+-mkdir $ISSM_DIR/nightlylog
++rm -rf ${ISSM_DIR}/execution/*
++rm -rf ${ISSM_DIR}/nightlylog
++mkdir ${ISSM_DIR}/nightlylog
+ 
+ #Server URI
+ SERVER='https://ross.ics.uci.edu/jenkins'
+@@ -52,20 +56,13 @@
+ 	exit 1
+ fi
+ 
+-#Get Operating system (OS) name{{{
+-OS=$(uname -s)
+-if [[ $OS == CYGWIN* ]]; then
+-	OS="win";
+-fi
+-#}}}
+-
+ #Install ISSM
+ #Determining installation type depending on svn changes{{{
+ echo "======================================================";
+ echo "             Determining Installation type            "
+ echo "======================================================";
+-if [ -a $ISSM_DIR/svn_revision_old ]; then
+-	SVN_PREVIOUS=$(cat $ISSM_DIR/svn_revision_old)
++if [ -a ${ISSM_DIR}/svn_revision_old ]; then
++	SVN_PREVIOUS=$(cat ${ISSM_DIR}/svn_revision_old)
+ 	SVN_CURRENT=$SVN_REVISION_1
+ 	echo "Previous revision number: $SVN_PREVIOUS"
+ 	echo "Current revision number: $SVN_CURRENT"
+@@ -73,7 +70,7 @@
+ 	# 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
++	#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
+@@ -80,15 +77,15 @@
+ 	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...)
+-	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > $ISSM_DIR/TEMP
++	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > ${ISSM_DIR}/TEMP
+ 	#cat changes | grep 'document_edit' |sed -e 's/document_edit.png/document_edit.png\
+-		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > $ISSM_DIR/TEMP
+-	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
++		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > ${ISSM_DIR}/TEMP
++	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > ${ISSM_DIR}/TEMP
+ 
+ 	# Print list of changed files
+ 	echo "   "
+ 	echo "List of updated files"
+-	cat $ISSM_DIR/TEMP
++	cat ${ISSM_DIR}/TEMP
+ 	echo "   "
+ 
+ 	###################################
+@@ -98,7 +95,7 @@
+ 
+ 	# 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
++	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep externalpackages)" ]; then
+ 		echo "  -- checking for changed externalpackages... yes"
+ 		ISSM_EXTERNALPACKAGES="yes"
+ 	else
+@@ -108,8 +105,8 @@
+ 
+ 	# If the Makefile or m4 diirectory were changed in any way or if certain
+ 	# binary files from a previous compilation do not exist, reconfigure
+-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
+-		[ ! -f "$ISSM_DIR/bin/issm.exe" ] && [ ! -f "$ISSM_DIR/bin/issm-bin.js" ] ||
++	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
++		[ ! -f "${ISSM_DIR}/bin/issm.exe" ] && [ ! -f "${ISSM_DIR}/bin/issm-bin.js" ] ||
+ 		[ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then
+ 		echo "  -- checking for reconfiguration... yes"
+ 		ISSM_RECONFIGURE="yes"
+@@ -119,7 +116,7 @@
+ 	fi
+ 
+ 	# If source files were changed in any way, recompile
+-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
++	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
+ 		[ "$ISSM_RECONFIGURE" == "yes" ]; then
+ 		echo "  -- checking for recompilation... yes"
+ 		ISSM_COMPILATION="yes"
+@@ -130,7 +127,7 @@
+ 
+ 	# Cleanup
+ 	rm changes
+-	rm $ISSM_DIR/TEMP
++	rm ${ISSM_DIR}/TEMP
+ else
+ 	echo "Previous revision not found, this must be a fresh install"
+ 	echo "  -- checking for changed externalpackages... yes"
+@@ -143,7 +140,7 @@
+ 
+ echo " "
+ echo "Recording current svn version: $SVN_REVISION_1"
+-echo $SVN_REVISION_1 > $ISSM_DIR/svn_revision_old
++echo $SVN_REVISION_1 > ${ISSM_DIR}/svn_revision_old
+ #}}}
+ 
+ ## External Packages
+@@ -153,16 +150,16 @@
+ NUMPACKAGES=$(($(echo ${EXTERNALPACKAGES} | wc -w ) / 2))
+ 
+ #Jenkins XML files for individual packages
+-EXTERNAL_TEST_FILE="$ISSM_DIR/nightlylog/results/external.xml"
+-mkdir -p $ISSM_DIR/nightlylog/results
++EXTERNAL_TEST_FILE="${ISSM_DIR}/nightlylog/results/external.xml"
++mkdir -p ${ISSM_DIR}/nightlylog/results
+ echo "<testsuite tests=\"$NUMPACKAGES\">" > $EXTERNAL_TEST_FILE
+ 
+ # Need a source here for when builds start midway through installation of externalpackages.
+-source $ISSM_DIR/etc/environment.sh
++source ${ISSM_DIR}/etc/environment.sh
+ 
+-if [ "$OS" == "win" ]; then
++if [ "${OS}" == CYGWIN* ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
+-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
++	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+ fi
+ 
+ EXTERNALPACKAGES_FAILED=0;
+@@ -174,8 +171,8 @@
+ 	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
+ 
+ 	#install if requested or if previous install has not been successful
+-	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
+-		cd $ISSM_DIR/externalpackages/$PACKAGENAME
++	if [ "${ISSM_EXTERNALPACKAGES}" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
++		cd ${ISSM_DIR}/externalpackages/$PACKAGENAME
+ 
+ 		echo "======================================================";
+ 		echo "       Installing $PACKAGENAME                        ";
+@@ -182,7 +179,7 @@
+ 		echo "======================================================";
+ 
+ 		./$PACKAGEINST $NUMCPUS_INSTALL &> compil.log
+-		if [ $? -ne 0 ] && [ "$PACKAGENAME" != "boost" ]; then
++		if [ $? -ne 0 ] && [ "${PACKAGENAME}" != "boost" ]; then
+ 			cat compil.log
+ 			echo "======================================================";
+ 			echo "    ERROR: installation of $PACKAGENAME failed        ";
+@@ -196,7 +193,7 @@
+ 		else
+ 			echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\"/>" >> $EXTERNAL_TEST_FILE
+ 		fi
+-		source $ISSM_DIR/etc/environment.sh
++		source ${ISSM_DIR}/etc/environment.sh
+ 
+ 		#If external package is rebuilt, we also need to recompile
+ 		ISSM_RECONFIGURE="yes"
+@@ -219,11 +216,11 @@
+ fi
+ 
+ # Source here to include any newly installed externalpackages on the path.
+-source $ISSM_DIR/etc/environment.sh
++source ${ISSM_DIR}/etc/environment.sh
+ 
+-if [ "$OS" == "win" ]; then
++if [ "${OS}" == CYGWIN* ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
+-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
++	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+ fi
+ 
+ # Set CXX/CC flags for JS runs after exnteralpackages to avoid conflicts during their compilation
+@@ -243,14 +240,14 @@
+ 	export RANLIB=emranlib
+ 	#export EMCC_DEBUG=1 # Uncomment to enable debugging
+ 	export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14 to avoid undefined symbol warnings from our Fortran object files being treated as errors
+-	source $ISSM_DIR/externalpackages/emscripten/install/emsdk_env.sh
++	source ${ISSM_DIR}/externalpackages/emscripten/install/emsdk_env.sh
+ fi
+ 
+ #}}}
+ #ISSM compilation yes/no                (ISSM_COMPILATION) {{{
+-if [ "$ISSM_COMPILATION" == "yes" ]; then
++if [ "${ISSM_COMPILATION}" == "yes" ]; then
+ 	cd $ISSM_DIR
+-	if [ "$ISSM_RECONFIGURE" == "yes" ]; then
++	if [ "${ISSM_RECONFIGURE}" == "yes" ]; then
+ 		echo "======================================================";
+ 		echo "             Cleaning up and reconfiguring            "
+ 		echo "======================================================";
+@@ -261,7 +258,7 @@
+ 			echo "autoreconf failed!"
+ 			exit 1
+ 		fi
+-		eval "./configure $ISSM_CONFIG"
++		eval "./configure ${ISSM_CONFIG}"
+ 		if [ $? -ne 0 ]; then
+ 			echo "ISSM configuration failed (see options below)"
+ 			echo $ISSM_CONFIG
+@@ -275,9 +272,13 @@
+ 	echo "                    Compiling ISSM                    "
+ 	echo "======================================================"
+ 	if [ $NUMCPUS_INSTALL -gt 1 ]; then
+-		echo "Making with " $NUMCPUS_INSTALL " cpus"
++		echo "Making with ${NUMCPUS_INSTALL} cpus"
++
++		# To debug compilation/linking, add 'V=1' option to the call to make
++		#make -j $NUMCPUS_INSTALL V=1
+ 		make -j $NUMCPUS_INSTALL
+ 	else
++		#make V=1
+ 		make
+ 	fi
+ 	if [ $? -ne 0 ] && [ $NUMCPUS_INSTALL -gt 1 ]; then
+@@ -291,8 +292,7 @@
+ 		exit 1
+ 	fi
+ 	make install
+-elif [ "$ISSM_COMPILATION" == "no" ]
+-then
++elif [ "${ISSM_COMPILATION}" == "no" ]; then
+ 	echo "Skipping ISSM compilation"
+ else
+ 	echo "ISSM_COMPILATION supported values are: yes and no. Exiting..." >&2 # Error message to stderr.
+@@ -310,13 +310,13 @@
+ 	#Launch all tests on different cpus
+ 	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
+ 		#Launch matlab and the nightly run script
+-		cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
++		cat > ${ISSM_DIR}/nightlylog/matlab_run$i.m << EOF
+ 		warning off %necessary to avoid a log of several Go for parallel runs
+ 		try,
+-			$(if [ "$MATLAB_NROPTIONS" = "" ]; then
+-				echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
++			$(if [ "${MATLAB_NROPTIONS}" = "" ]; then
++				echo "runme('output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
+ 			else
+-				echo "runme($MATLAB_NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
++				echo "runme(${MATLAB_NROPTIONS},'output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
+ 			fi)
+ 		catch me,
+ 			%An error occured, get report and exit
+@@ -331,36 +331,44 @@
+ 		exit
+ EOF
+ 		cd $ISSM_DIR/test/NightlyRun
+-		if [ "$OS" = "win" ]; then
+-			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
++		if [[ "${OS}" == CYGWIN* || "${OS}" == MINGW* ]]; then
++			$MATLAB_PATH/bin/matlab -nodesktop -nosplash -nojvm -r "addpath ${ISSM_DIR_WIN}/src/m/dev; devpath; addpath ${ISSM_DIR_WIN}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR_WIN}/nightlylog/matlab_log$i.log &
+ 		else
+-			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
++			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath ${ISSM_DIR}/src/m/dev; devpath; addpath ${ISSM_DIR}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR}/nightlylog/matlab_log$i.log &
+ 		fi
+ 	done
+ 
+-	#wait until matlab closes
+-	if [ "$OS" = "win" ]; then
++	# Wait for MATLAB to exit
++	if [[ "${OS}" == CYGWIN* ]]; then
+ 		sleep 5;
+-		echo "Waiting for matlab on windows"
++		echo "Waiting for MATLAB to exit"
+ 		pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+ 		echo '-----------------------------'
+-		echo "pid: $pid"
++		echo "pid: ${pid}"
+ 		echo '-----------------------------'
+-		while [ -n "$pid" ]; do
++		while [ -n "${pid}" ]; do
+ 			pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+ 			sleep 1;
+ 		done
+ 		echo "DONE!"
++	elif [[ "${OS}" == MINGW* ]]; then
++		# NOTE: The PID query used here may work as well on Cygwin. If so, combine the two conditional blocks.
++		sleep 5;
++		echo "Waiting for MATLAB to exit"
++		pid=$(ps -W | grep MATLAB | awk '{print $1}')
++		echo '-----------------------------'
++		echo "pid: ${pid}"
++		echo '-----------------------------'
++		while [ -n "${pid}" ]; do
++			pid=$(ps -W | grep MATLAB | awk '{print $1}')
++			sleep 1;
++		done
+ 	else
+ 		wait
+ 	fi
+ 
+-	#concatenate reports
+-	cd $ISSM_DIR/nightlylog/
+-	#echo 'CHECKING NIGHTLYLOG DIRECTORY'
+-	#echo '-----------------------------'
+-	#ls -la
+-	#echo '-----------------------------'
++	# Concatenate logs
++	cd $ISSM_DIR/nightlylog
+ 
+ 	if [ -f matlab_log.log ]; then
+ 		rm matlab_log.log
+@@ -367,7 +375,7 @@
+ 	fi
+ 
+ 	for job in `jobs -p`; do
+-		echo "Waiting on: $job"
++		#echo "Waiting on: ${job}" # Commented out because it really has nothing to do with MATLAB processes
+ 		wait $job
+ 	done
+ 
+@@ -386,7 +394,7 @@
+ # {{{
+ if [ $PYTHON_TEST -eq 1 ]; then
+ 	#Launch all tests on different cpus
+-	export PYTHONPATH="$ISSM_DIR/src/m/dev"
++	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+ 	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+ 	export PYTHONUNBUFFERED=1 #we don't want python to buffer otherwise issm.exe output is not captured
+ 	for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+@@ -397,8 +405,8 @@
+ 		echo "--------------Running Python test for Rank $i---------------------"
+ 	done
+ 
+-	# concatenate reports
+-	cd $ISSM_DIR/nightlylog/
++	# Concatenate logs
++	cd $ISSM_DIR/nightlylog
+ 	if [ -f python_log.log ]; then
+ 		rm python_log.log
+ 	fi
+@@ -405,7 +413,7 @@
+ 
+ 	for job in `jobs -p`
+ 	do
+-		echo "Waiting on: $job"
++		echo "Waiting on: ${job}"
+ 		wait $job
+ 	done
+ 
+@@ -428,7 +436,7 @@
+ fi
+ # }}}
+ 
+-#process logs to be junit compatible
++# Process logs to be JUnit compatible
+ #{{{
+ cd $ISSM_DIR/nightlylog
+ source $ISSM_EXT_DIR/shell2junit/install/bin/sh2ju.sh
+Index: ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(nonexistent)
++++ ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26034)
+@@ -0,0 +1,57 @@
++ISSM_CONFIG='\
++	--prefix=${ISSM_DIR} \
++	--enable-development \
++	--enable-debugging \
++	--with-numthreads=4 \
++	--with-vendor="win-msys2" \
++	--with-matlab-dir=${MATLAB_PATH} \
++	--with-mpi-include="${MSMPI_ROOT}/include" \
++	--with-mpi-libdir="${MSMPI_ROOT}/lib" \
++	--with-mpi-libflags="-lmsmpi" \
++	--with-fortran-lib="-L/c/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/ -lgfortran" \
++	--with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-parmetis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-blas-lapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
++	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
++	--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
++'
++
++#-------------------#
++# External Packages #
++#-------------------#
++
++#List of external pakages to be installed and their installation scripts
++EXTERNALPACKAGES="
++	petsc		install-3.14-win-msys2-mingw-msmpi.sh
++	triangle	install-win-msys2-mingw.sh
++	shell2junit	install.sh
++"
++
++#---------#
++# Testing #
++#---------#
++
++# Test suites
++MATLAB_TEST=1
++PYTHON_TEST=0
++JAVASCRIPT_TEST=0
++EXAMPLES_TEST=0
++
++# Number of CPUs used in ISSM compilation
++#
++# NOTE: One is usually safer as some packages are very sensitive to parallel
++# 		compilation
++#
++NUMCPUS_INSTALL=4
++
++# Number of CPUs used in the nightly runs
++NUMCPUS_RUN=1
++
++# Nightly run options
++#
++# See documentation in test/NightlyRun/runme.* for more information
++#
++MATLAB_NROPTIONS="'id',[101,102,201,202]"
++PYTHON_NROPTIONS=""
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26033)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26034)
+@@ -30,7 +30,7 @@
+ 	else
+ 		PACKAGE_DATE="unknown"
+ 	fi
+-	AC_DEFINE_UNQUOTED(PACKAGE_BUILD_DATE, "$PACKAGE_DATE", [build date])
++	AC_DEFINE_UNQUOTED([PACKAGE_BUILD_DATE], "${PACKAGE_DATE}", [build date])
+ 	AC_MSG_RESULT([${PACKAGE_DATE}])
+ 
+ 	dnl User name
+@@ -45,7 +45,7 @@
+ 			user_name =`(whoami) 2>/dev/null` || user_name=unknown
+ 		fi
+ 	fi
+-	AC_DEFINE_UNQUOTED(USER_NAME, "$user_name", [user name])
++	AC_DEFINE_UNQUOTED([USER_NAME], "${user_name}", [user name])
+ 	AC_MSG_RESULT([${user_name}])
+ 
+ 	AC_MSG_CHECKING([host full OS name and version])
+@@ -54,15 +54,15 @@
+ 		dnl linux is linux is linux, regardless of RMS
+ 		linux-gnu* | lignux* )	host_os=linux ;;
+ 	esac
+-	AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", [host full OS name and version])
++	AC_DEFINE_UNQUOTED([HOST_OS], "${host_os}", [host full OS name and version])
+ 	AC_MSG_RESULT([${host_os}])
+ 
+ 	AC_MSG_CHECKING([host cpu])
+-	AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [host CPU])
++	AC_DEFINE_UNQUOTED([HOST_CPU], "${host_cpu}", [host CPU])
+ 	AC_MSG_RESULT([${host_cpu}])
+ 
+ 	AC_MSG_CHECKING([vendor])
+-	AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor", [host vendor])
++	AC_DEFINE_UNQUOTED([HOST_VENDOR], "${host_vendor}", [host vendor])
+ 	AC_MSG_RESULT([${host_vendor}])
+ 
+ 	AC_MSG_CHECKING([host OS name])
+@@ -72,7 +72,7 @@
+ 		dnl linux is linux is linux, regardless of RMS.
+ 		linux-gnu* | lignux* )	host_os_name=linux ;;
+ 	esac
+-	AC_DEFINE_UNQUOTED(HOST_OS_NAME, "$host_os_name", [host OS name])
++	AC_DEFINE_UNQUOTED([HOST_OS_NAME], "${host_os_name}", [host OS name])
+ 	AC_MSG_RESULT([${host_os_name}])
+ 
+ 	dnl Parse out the OS version of the host
+@@ -81,7 +81,7 @@
+ 	if test -z "$host_os_version"; then
+ 		host_os_version=`(uname -r) 2>/dev/null` || host_os_version=unknown
+ 	fi
+-	AC_DEFINE_UNQUOTED(HOST_OS_VERSION, "$host_os_version", [host OS version])
++	AC_DEFINE_UNQUOTED([HOST_OS_VERSION], "${host_os_version}", [host OS version])
+ 	AC_MSG_RESULT([${host_os_version}])
+ 
+ 	dnl Determine host architecture (different than CPU)
+@@ -94,7 +94,7 @@
+ 		sun )	host_arch=`(arch) 2>/dev/null` || host_arch=unknown ;;
+ 		i?86 )	host_arch=i386 ;; # all x86 should show up as i386
+ 	esac
+-	AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_arch", [host archictecture])
++	AC_DEFINE_UNQUOTED([HOST_ARCH], "${host_arch}", [host archictecture])
+ 	AC_MSG_RESULT([${host_arch}])
+ 
+ 	dnl }}}
+@@ -218,9 +218,10 @@
+ 	else
+ 		AC_MSG_RESULT([no])
+ 	fi
+-	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], $SYSTEM_FMEMOPEN, [does system copy of libc have fmemopen])
++	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], ${SYSTEM_FMEMOPEN}, [does system copy of libc have fmemopen])
+ 	AM_CONDITIONAL([SYSTEM_HAS_FMEMOPEN], [test "${SYSTEM_FMEMOPEN}" == "1"])
+ 
++	IS_MSYS2=no
+ 	IS_WINDOWS=no
+ 	AC_MSG_CHECKING([for vendor compilers])
+ 	if test -n "${VENDOR}"; then
+@@ -317,20 +318,34 @@
+ 			export CXXFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict -std=c++11"
+ 			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
+ 			AC_DEFINE([_HAVE_RESTRICT_], [1], [with restrict buffers])
++		elif test "${VENDOR}" == "win-msys2"; then
++			export LDFLAGS="${LDFLAGS} -no-undefined"
++			export OSLIBS="-Wl,-L/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0 -Wl,-L/mingw64/x86_64-w64-mingw32/lib -Wl,-lstdc++ -Wl,-lgfortran -Wl,-lmingw32 -Wl,-lgcc_s -Wl,-lmoldname -Wl,-lmingwex -Wl,-lmsvcrt -Wl,-lm -Wl,-lpthread -Wl,-lshell32 -Wl,-luser32 -Wl,-lgdi32 -Wl,-luser32 -Wl,-ladvapi32 -Wl,-lkernel32 -Wl,-lquadmath -Wl,-lstdc++ -Wl,-lgcc"
++			IS_MSYS2=yes
+ 		else
+ 			AC_MSG_ERROR([unknown compiler vendor!])
+ 		fi
+ 	fi
++	dnl Set default standard for C++
++	if test "${CXXFLAGS}" == ""; then
++		export CXXFLAGS="-std=C++11"
++	fi
+ 	AC_SUBST([OSLIBS])
+ 	AC_MSG_RESULT([done])
+ 
+-	AC_MSG_CHECKING([if this is a Windows build])
++	AC_MSG_CHECKING([if this is a MSVC (Windows) build])
+ 	AM_CONDITIONAL([WINDOWS], [test "x${IS_WINDOWS}" == "xyes"])
+ 	AC_MSG_RESULT([${IS_WINDOWS}])
++
++	AC_MSG_CHECKING([if this is a MSYS2 (Windows) build])
++	AM_CONDITIONAL([MSYS2], [test "x${IS_MSYS2}" == "xyes"])
++	AC_MSG_RESULT([${IS_MSYS2}])
++	AC_DEFINE([_IS_MSYS2_], [1], [is a MSYS2 (Windows) build])
+ 	dnl }}}
+ 	dnl MATLAB{{{
+ 
+ 	dnl See if MATLAB has been provided
++	AC_MSG_CHECKING([for MATLAB])
+ 	AC_ARG_WITH(
+ 		[matlab-dir],														dnl feature
+ 		AS_HELP_STRING([--with-matlab-dir=DIR], [MATLAB root directory]),	dnl help string
+@@ -337,7 +352,6 @@
+ 		[MATLAB_ROOT=${withval}],											dnl action if given
+ 		[MATLAB_ROOT="no"]													dnl action if not given
+ 	)
+-	AC_MSG_CHECKING([for MATLAB])
+ 	if test "x${MATLAB_ROOT}" == "xno"; then
+ 		HAVE_MATLAB=no
+ 	else
+@@ -356,7 +370,7 @@
+ 	if test "x${HAVE_MATLAB}" == "xyes"; then
+ 		AC_DEFINE([_HAVE_MATLAB_], [1], [with MATLAB in ISSM src])
+ 
+-		dnl Set MEXLIB, MEXLINK, and MEXEXT
++		dnl Set MEX* variable
+ 		AC_MSG_CHECKING([MATLAB's mex compilation flags])
+ 
+ 		dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
+@@ -366,32 +380,55 @@
+ 			*cygwin*)
+ 				if test "${VENDOR}" == "intel-win7-32"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MEXEXT=`${MATLAB_ROOT}/bin/mexext.bat`
+ 					MEXEXT=".${MEXEXT}"
+ 				elif test "${VENDOR}" == "intel-win7-64"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MEXEXT=".mexw64"
+ 				elif test "${VENDOR}" == "MSVC-Win64" || test "${VENDOR}" == "MSVC-Win64-par"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINK="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINKFLAGS="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MATLABINCL="-I`cygpath -m ${MATLAB_ROOT}/extern/include`"
+ 					MEXEXT=".mexw64"
+ 				fi
+ 			;;
++			*mingw*)
++				if test "${IS_MSYS2}" == "yes"; then
++					dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
++					MEXEXT=".mexw64"
++					MATLABINCL="-I${MATLAB_ROOT}/extern/include"
++					MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
++					MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
++					MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
++					MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
++					MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
++					MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
++				fi
++			;;
++			*msys*)
++				dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
++				MEXEXT=".mexw64"
++				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
++				MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
++				MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
++				MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
++				MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
++				MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
++				MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
++			;;
+ 			*)
++				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
+ 				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+-				MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
++				MEXLINKFLAGS=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
+ 				MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
+-				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
+-				dnl version 2014 and up
+ 				if test -z "${MEXEXT}"; then
+ 					echo "#include <mex.h>" > conftest.cpp
+ 					echo "void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}" >> conftest.cpp
+ 					${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
+ 					rm -f conftest.cpp
+-					MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
++					MEXLINKFLAGS=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
+ 					MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
+ 					MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
+ 					if test -z "${MEXEXT}"; then
+@@ -401,8 +438,8 @@
+ 				fi
+ 
+ 				dnl Make sure mexFunction.map is not in MEXLIB to avoid problems with global variables
+-				dnl MEXLINK=$(echo ${MEXLINK} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
+-				MEXLINK="" dnl We actually don't need MEXLINK????
++				dnl MEXLINKFLAGS=$(echo ${MEXLINKFLAGS} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
++				MEXLINKFLAGS="" dnl We actually don't need MEXLINK????
+ 			;;
+ 		esac
+ 		AC_MSG_RESULT([done])
+@@ -410,14 +447,17 @@
+ 			AC_MSG_ERROR([Couldn't use MATLAB's mex... check manual compilation with MATLAB or error message above])
+ 		fi
+ 
++		AC_SUBST([MEXEXT])
++		AC_SUBST([MEXOPTFLAGS])
++		AC_SUBST([MEXCFLAGS])
++		AC_SUBST([MEXCXXFLAGS])
+ 		AC_SUBST([MATLABINCL])
+-		MATLABWRAPPEREXT=${MEXEXT}
+-		AC_SUBST([MATLABWRAPPEREXT])
++		AC_SUBST([MEXLINKFLAGS])
+ 		AC_SUBST([MEXLIB])
+-		AC_SUBST([MEXLINK])
+ 	fi
+ 	dnl }}}
+ 	dnl JavaScript{{{
++	AC_MSG_CHECKING([for JavaScript])
+ 	AC_ARG_WITH(
+ 		[javascript],
+ 		AS_HELP_STRING([--with-javascript], [compile JavaScript wrappers? (default: no)]),
+@@ -424,7 +464,6 @@
+ 		[JAVASCRIPT=${withval}],
+ 		[JAVASCRIPT="no"]
+ 	)
+-	AC_MSG_CHECKING([for JavaScript])
+ 	if test "x${JAVASCRIPT}" == "xno"; then
+ 		HAVE_JAVASCRIPT=no
+ 	else
+@@ -437,6 +476,7 @@
+ 	AC_SUBST([JAVASCRIPTWRAPPEREXT])
+ 	dnl }}}
+ 	dnl Triangle {{{
++	AC_MSG_CHECKING([for triangle])
+ 	AC_ARG_WITH(
+ 		[triangle-dir],
+ 		AS_HELP_STRING([--with-triangle-dir=DIR], [Triangle root directory]),
+@@ -443,7 +483,6 @@
+ 		[TRIANGLE_ROOT=${withval}],
+ 		[TRIANGLE_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for triangle])
+ 	if test "x${TRIANGLE_ROOT}" == "xno"; then
+ 		HAVE_TRIANGLE=no
+ 	else
+@@ -482,6 +521,22 @@
+ 					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+ 				fi
+ 			;;
++			*mingw*)
++				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
++					dnl Link to the object file, not the library
++					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
++				else
++					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
++				fi
++			;;
++			*msys*)
++				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
++					dnl Link to the object file, not the library
++					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
++				else
++					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
++				fi
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_TRIANGLE_], [1], [with Triangle in ISSM src])
+ 		AC_SUBST([TRIANGLEINCL])
+@@ -489,6 +544,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Boost{{{
++	AC_MSG_CHECKING([for Boost])
+ 	AC_ARG_WITH(
+ 		[boost-dir],
+ 		AS_HELP_STRING([--with-boost-dir=DIR], [Boost root directory]),
+@@ -495,7 +551,6 @@
+ 		[BOOST_ROOT=${withval}],
+ 		[BOOST_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Boost])
+ 	if test "x${BOOST_ROOT}" == "xno"; then
+ 		HAVE_BOOST=no
+ 	else
+@@ -522,6 +577,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Dakota{{{
++	AC_MSG_CHECKING([for Dakota])
+ 	AC_ARG_WITH(
+ 		[dakota-dir],
+ 		AS_HELP_STRING([--with-dakota-dir=DIR], [Dakota root directory]),
+@@ -528,7 +584,6 @@
+ 		[DAKOTA_ROOT=${withval}],
+ 		[DAKOTA_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Dakota])
+ 	if test "x${DAKOTA_ROOT}" == "xno"; then
+ 		HAVE_DAKOTA=no
+ 	else
+@@ -546,7 +601,7 @@
+ 
+ 		AC_MSG_CHECKING(for Dakota version)
+ 		dnl TODO:	Check if this method applies to all other versions of 
+-		dnl			Dakota (it should as long as the Dakota binaries have been
++		dnl			Dakota (it should as long as the Dakota binaries have been 
+ 		dnl 		compiled). If so, we can remove the other methods of 
+ 		dnl			getting the version.
+ 		dnl
+@@ -563,7 +618,7 @@
+ 			AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
+ 		fi
+ 		AC_MSG_RESULT([${DAKOTA_VERSION}])
+-		AC_DEFINE_UNQUOTED(_DAKOTA_VERSION_, "${DAKOTA_VERSION}", [Dakota version number])
++		AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_], ${DAKOTA_VERSION}, [Dakota version number])
+ 
+ 		DAKOTAFLAGS=""
+ 
+@@ -678,13 +733,13 @@
+ 		esac
+ 		AC_MSG_CHECKING(for Dakota major version)
+ 		AC_MSG_RESULT(${DAKOTA_MAJOR})
+-		AC_DEFINE_UNQUOTED(_DAKOTA_MAJOR_, $DAKOTA_MAJOR, [Dakota major version number])
++		AC_DEFINE_UNQUOTED([_DAKOTA_MAJOR_], ${DAKOTA_MAJOR}, [Dakota major version number])
+ 		AC_MSG_CHECKING(for Dakota minor version)
+ 		AC_MSG_RESULT(${DAKOTA_MINOR})
+-		AC_DEFINE_UNQUOTED(_DAKOTA_MINOR_, $DAKOTA_MINOR, [Dakota minor version number])
++		AC_DEFINE_UNQUOTED([_DAKOTA_MINOR_], ${DAKOTA_MINOR}, [Dakota minor version number])
+ 		AC_MSG_CHECKING(for Dakota build version)
+ 		AC_MSG_RESULT(${DAKOTA_BUILD})
+-		AC_DEFINE_UNQUOTED(_DAKOTA_BUILD_, $DAKOTA_BUILD, [Dakota build version number])
++		AC_DEFINE_UNQUOTED([_DAKOTA_BUILD_], ${DAKOTA_BUILD}, [Dakota build version number])
+ 
+ 		AC_DEFINE([_HAVE_DAKOTA_], [1], [with Dakota in ISSM src])
+ 		AC_SUBST([DAKOTAINCL])
+@@ -694,6 +749,7 @@
+ 	AM_CONDITIONAL([ISSM_DAKOTA], [test "x${DAKOTA_MAJOR}" == "x6"])
+ 	dnl }}}
+ 	dnl Python{{{
++	AC_MSG_CHECKING([for Python])
+ 	AC_ARG_WITH(
+ 		[python-dir],
+ 		AS_HELP_STRING([--with-python-dir=DIR], [Python root directory]),
+@@ -707,7 +763,6 @@
+ 		[PYTHON_VERSION=${withval}],
+ 		[PYTHON_VERSION="no"]
+ 	)
+-	AC_MSG_CHECKING([for Python])
+ 	if test "x${PYTHON_ROOT}" == "xno"; then
+ 		HAVE_PYTHON=no
+ 		HAVE_PYTHON3=no
+@@ -734,7 +789,7 @@
+ 		fi
+ 		dnl Determine major version
+ 		PYTHON_MAJOR=${PYTHON_VERSION%.*}
+-		AC_DEFINE_UNQUOTED(_PYTHON_MAJOR_, $PYTHON_MAJOR, [Python version major])
++		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_], ${PYTHON_MAJOR}, [Python version major])
+ 		if test "x${PYTHON_MAJOR}" == "x3"; then
+ 			HAVE_PYTHON3="yes"
+ 		else
+@@ -750,7 +805,7 @@
+ 		elif test -f "${PYTHON_ROOT}/include/python${PYTHON_VERSION}m/Python.h"; then
+ 			PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
+ 		else
+-			AC_MSG_ERROR([Python.h not found, locate this file and contact ISSM developers]);
++			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
+ 		fi
+ 		AC_MSG_RESULT([found])
+ 		if test "x${PYTHON_MAJOR}" == "x3"; then
+@@ -763,12 +818,18 @@
+ 			*cygwin*)
+ 				PYTHONLINK="-shared"
+ 			;;
++			*darwin*)
++				PYTHONLINK="-dynamiclib"
++			;;
+ 			*linux*)
+ 				PYTHONLINK="-shared"
+ 			;;
+-			*darwin*)
+-				PYTHONLINK="-dynamiclib"
++			*mingw*)
++				PYTHONLINK="-shared"
+ 			;;
++			*msys*)
++				PYTHONLINK="-shared"
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_PYTHON_], [1], [with Python in ISSM src])
+ 		AC_SUBST([PYTHONINCL])
+@@ -780,10 +841,16 @@
+ 	AM_CONDITIONAL([PYTHON3], [test "x${HAVE_PYTHON3}" == "xyes"])
+ 	dnl }}}
+ 	dnl NumPy{{{
++	dnl NOTE: You can find NumPy by running,
++	dnl
++	dnl		>>> import numpy
++	dnl		>>> numpy.__file__
++	dnl
+ 	dnl TODO:
+ 	dnl - Replace references to python-numpy with numpy (and similar terms)
+ 	dnl	  project-wide
+ 	dnl
++	AC_MSG_CHECKING(for python-numpy)
+ 	AC_ARG_WITH(
+ 		[python-numpy-dir],
+ 		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
+@@ -790,14 +857,6 @@
+ 		[PYTHON_NUMPY_ROOT=${withval}],
+ 		[PYTHON_NUMPY_ROOT="no"]
+ 	)
+-
+-	dnl NOTE: You can find NumPy by running,
+-	dnl
+-	dnl		>>> import numpy
+-	dnl		>>> numpy.__file__
+-	dnl
+-
+-	AC_MSG_CHECKING(for python-numpy)
+ 	if test "x${PYTHON_NUMPY_ROOT}" == "xno"; then
+ 		HAVE_PYTHON_NUMPY=no
+ 	else
+@@ -816,6 +875,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Chaco{{{
++	AC_MSG_CHECKING([for Chaco])
+ 	AC_ARG_WITH(
+ 		[chaco-dir],
+ 		AS_HELP_STRING([--with-chaco-dir=DIR], [Chaco root directory]),
+@@ -822,7 +882,6 @@
+ 		[CHACO_ROOT=${withval}],
+ 		[CHACO_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Chaco])
+ 	if test "x${CHACO_ROOT}" == "xno"; then
+ 		HAVE_CHACO=no
+ 	else
+@@ -844,6 +903,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl ESMF{{{
++	AC_MSG_CHECKING([for ESMF])
+ 	AC_ARG_WITH(
+ 		[esmf-dir],
+ 		AS_HELP_STRING([--with-esmf-dir=DIR], [ESMF root directory]),
+@@ -850,7 +910,6 @@
+ 		[ESMF_ROOT=${withval}],
+ 		[ESMF_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ESMF])
+ 	if test "x${ESMF_ROOT}" == "xno"; then
+ 		HAVE_ESMF=no
+ 	else
+@@ -872,6 +931,7 @@
+ 	AM_CONDITIONAL([ESMF], [test "x${HAVE_ESMF}" == "xyes"])
+ 	dnl }}}
+ 	dnl CoDiPack{{{
++	AC_MSG_CHECKING([for CoDiPack])
+ 	AC_ARG_WITH(
+ 		[codipack-dir],
+ 		AS_HELP_STRING([--with-codipack-dir=DIR], [CoDiPack root directory]),
+@@ -878,7 +938,6 @@
+ 		[CODIPACK_ROOT=${withval}],
+ 		[CODIPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for CoDiPack])
+ 	if test "x${CODIPACK_ROOT}" == "xno"; then
+ 		HAVE_CODIPACK=no
+ 	else
+@@ -900,6 +959,7 @@
+ 	AM_COND_IF(CODIPACK, [CXXFLAGS+=" -std=c++11"])
+ 	dnl }}}
+ 	dnl Tape Allocation {{{
++	AC_MSG_CHECKING(for tape allocation)
+ 	AC_ARG_ENABLE(
+ 		[tape-alloc],																dnl feature
+ 		AS_HELP_STRING([--enable-tape-alloc], [turn tape allocation support on]),
+@@ -906,7 +966,6 @@
+ 		[enable_tape_alloc=${enableval}],
+ 		[enable_tape_alloc=no]
+ 	)
+-	AC_MSG_CHECKING(for tape allocation)
+ 	if test "x${enable_tape_alloc}" == "xyes"; then
+ 		AC_DEFINE([_AD_TAPE_ALLOC_], [1], [enable a priori tape allocation for AD])
+ 	fi
+@@ -913,6 +972,7 @@
+ 	AC_MSG_RESULT([${enable_tape_alloc}])
+ 	dnl }}}
+ 	dnl ADOL-C {{{
++	AC_MSG_CHECKING([for ADOL-C])
+ 	AC_ARG_WITH(
+ 		[adolc-dir],
+ 		AS_HELP_STRING([--with-adolc-dir=DIR], [ADOL-C root directory]),
+@@ -919,7 +979,6 @@
+ 		[ADOLC_ROOT=${withval}],
+ 		[ADOLC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ADOL-C])
+ 	if test "x${ADOLC_ROOT}" == "xno"; then
+ 		HAVE_ADOLC=no
+ 	else
+@@ -944,6 +1003,7 @@
+ 	AM_COND_IF(ADOLC, [CXXFLAGS+=" -std=c++11"])
+ 	dnl }}}
+ 	dnl ADOL-C version{{{
++	AC_MSG_CHECKING(for ADOL-C version)
+ 	AC_ARG_WITH(
+ 		[adolc-version],
+ 		AS_HELP_STRING([--with-adolc-version=number], [ADOL-C version]),
+@@ -950,12 +1010,11 @@
+ 		[ADOLC_VERSION=${withval}],
+ 		[ADOLC_VERSION=2]
+ 	)
+-	AC_MSG_CHECKING(for ADOL-C version)
+-
+-	AC_DEFINE_UNQUOTED(_ADOLC_VERSION_, $ADOLC_VERSION, [ADOL-C version])
++	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_], ${ADOLC_VERSION}, [ADOL-C version])
+ 	AC_MSG_RESULT(${ADOLC_VERSION})
+ 	dnl }}}
+ 	dnl ADIC2 {{{
++	AC_MSG_CHECKING([for ADIC2])
+ 	AC_ARG_WITH(
+ 		[adic2-dir],
+ 		AS_HELP_STRING([--with-adic2-dir=DIR], [ADIC2 root directory]),
+@@ -962,7 +1021,6 @@
+ 		[ADIC2_ROOT=${withval}],
+ 		[ADIC2_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ADIC2])
+ 	if test "x${ADIC2_ROOT}" == "xno"; then
+ 		HAVE_ADIC2=no
+ 	else
+@@ -984,6 +1042,7 @@
+ 	AM_CONDITIONAL([ADIC2], [test "x${HAVE_ADIC2}" == "xyes"])
+ 	dnl }}}
+ 	dnl ATLAS {{{
++	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
+ 	AC_ARG_WITH(
+ 		[atlas-dir],
+ 		AS_HELP_STRING([--with-atlas-dir=DIR], [ATLAS root directory]),
+@@ -990,7 +1049,6 @@
+ 		[ATLAS_ROOT=${withval}],
+ 		[ATLAS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
+ 	if test "x${ATLAS_ROOT}" == "xno"; then
+ 		HAVE_ATLAS=no
+ 	else
+@@ -1007,12 +1065,18 @@
+ 			*cygwin*)
+ 				ATLASLIB="-L`cygpath -m ${ATLAS_ROOT}` -Wl,libatlas.lib  -Wl,libcblas.lib"
+ 			;;
++			*darwin*)
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
++			;;
+ 			*linux*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+ 			;;
+-			*darwin*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
++			*mingw*)
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+ 			;;
++			*msys*)
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_ATLAS_], [1], [with ATLAS in ISSM src])
+ 		AC_SUBST([ATLASLIB])
+@@ -1019,6 +1083,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl GSL{{{
++	AC_MSG_CHECKING([for GSL])
+ 	AC_ARG_WITH(
+ 		[gsl-dir],
+ 		AS_HELP_STRING([--with-gsl-dir=DIR], [GSL root directory]),
+@@ -1025,7 +1090,6 @@
+ 		[GSL_ROOT=${withval}],
+ 		[GSL_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for GSL])
+ 	if test "x${GSL_ROOT}" == "xno"; then
+ 		HAVE_GSL=no
+ 	else
+@@ -1051,6 +1115,7 @@
+ 	AM_CONDITIONAL([GSL], [test "x${HAVE_GSL}" == "xyes"])
+ 	dnl }}}
+ 	dnl AMPI (ADOL-C){{{
++	AC_MSG_CHECKING([for AMPI])
+ 	AC_ARG_WITH(
+ 		[ampi-dir],
+ 		AS_HELP_STRING([--with-ampi-dir=DIR], [Adjoinable MPI root directory]),
+@@ -1057,7 +1122,6 @@
+ 		[AMPI_ROOT=${withval}],
+ 		[AMPI_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for AMPI])
+ 	if test "x${AMPI_ROOT}" == "xno"; then
+ 		HAVE_AMPI=no
+ 	else
+@@ -1087,6 +1151,7 @@
+ 	AM_CONDITIONAL([AMPI], [test "x${HAVE_AMPI}" == "xyes"])
+ 	dnl }}}
+ 	dnl Adjoint MPI (CoDiPack){{{
++	AC_MSG_CHECKING([for Adjoint MPI])
+ 	AC_ARG_WITH(
+ 		[adjointmpi-dir],
+ 		AS_HELP_STRING([--with-adjointmpi-dir=DIR], [Adjoint MPI root directory]),
+@@ -1093,7 +1158,6 @@
+ 		[ADJOINTMPI_ROOT=${withval}],
+ 		[ADJOINTMPI_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Adjoint MPI])
+ 	if test "x${ADJOINTMPI_ROOT}" == "xno"; then
+ 		HAVE_ADJOINTMPI=no
+ 	else
+@@ -1121,6 +1185,7 @@
+ 	AM_CONDITIONAL([ADJOINTMPI], [test "x${HAVE_ADJOINTMPI}" == "xyes"])
+ 	dnl }}}
+ 	dnl MeDiPack (CoDiPack, ADOL-C dev){{{
++	AC_MSG_CHECKING([for MeDiPack])
+ 	AC_ARG_WITH(
+ 		[medipack-dir],
+ 		AS_HELP_STRING([--with-medipack-dir=DIR], [MeDiPack root directory]),
+@@ -1127,7 +1192,6 @@
+ 		[MEDIPACK_ROOT=${withval}],
+ 		[MEDIPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MeDiPack])
+ 	if test "x${MEDIPACK_ROOT}" == "xno"; then
+ 		HAVE_MEDIPACK=no
+ 	else
+@@ -1153,6 +1217,7 @@
+ 	AM_CONDITIONAL([MEDIPACK], [test "x${HAVE_MEDIPACK}" == "xyes"])
+ 	dnl }}}
+ 	dnl HDF5 {{{
++	AC_MSG_CHECKING(for HDF5 libraries)
+ 	AC_ARG_WITH(
+ 		[hdf5-dir],
+ 		AS_HELP_STRING([--with-hdf5-dir=DIR], [HDF5 root directory]),
+@@ -1159,7 +1224,6 @@
+ 		[HDF5_ROOT=${withval}],
+ 		[HDF5_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING(for HDF5 libraries)
+ 	if test "x${HDF5_ROOT}" == "xno"; then
+ 		HAVE_HDF5=no
+ 	else
+@@ -1180,12 +1244,18 @@
+ 			*cygwin*)
+ 				HDF5LIB="-L`cygpath -m ${HDF5_ROOT}` -Wl,libhdf5.lib  -Wl,libhdf5_hl.lib"
+ 			;;
++			*darwin*)
++				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
++			;;
+ 			*linux*)
+ 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+ 			;;
+-			*darwin*)
++			*mingw*)
+ 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+ 			;;
++			*msys*)
++				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_HDF5_], [1], [with HDF5 in ISSM src])
+ 		AC_SUBST([HDF5LIB])
+@@ -1192,6 +1262,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PETSc{{{
++	AC_MSG_CHECKING([for PETSc])
+ 	AC_ARG_WITH(
+ 		[petsc-dir],
+ 		AS_HELP_STRING([--with-petsc-dir=DIR], [PETSc root directory, necessary for parallel build]),
+@@ -1198,7 +1269,6 @@
+ 		[PETSC_ROOT=${withval}],
+ 		[PETSC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for PETSc])
+ 	if test "x${PETSC_ROOT}" == "xno"; then
+ 		HAVE_PETSC=no
+ 	else
+@@ -1219,8 +1289,8 @@
+ 		AC_MSG_CHECKING(for PETSc version)
+ 		PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
+ 		PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
+-		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major])
+-		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor])
++		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], ${PETSC_MAJOR}, [PETSc version major])
++		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], ${PETSC_MINOR}, [PETSc version minor])
+ 		AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}])
+ 
+ 		AC_MSG_CHECKING(whether PETSc is the development version)
+@@ -1263,6 +1333,16 @@
+ 					PETSCINCL="/I`cygpath -m ${PETSC_ROOT}/include`"
+ 				fi
+ 			;;
++			*darwin*)
++				if test ${PETSC_MAJOR} -lt 3; then
++					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
++				else
++					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
++					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
++						PETSCLIB+=" -lmetis"
++					fi
++				fi
++			;;
+ 			*linux*)
+ 				if test ${PETSC_MAJOR} -lt 3; then
+ 					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lmpiuni -lpetsc"
+@@ -1279,16 +1359,12 @@
+ 					PETSCLIB="-L${PETSC_ROOT}/lib -lcraypetsc_intel_real -lmetis"
+ 				fi
+ 			;;
+-			*darwin*)
+-				if test ${PETSC_MAJOR} -lt 3; then
+-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
+-				else
+-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
+-					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
+-						PETSCLIB+=" -lmetis"
+-					fi
+-				fi
++			*mingw*)
++				PETSCLIB="-Wl,${PETSC_ROOT}/lib/libpetsc.a"
+ 			;;
++			*msys*)
++				PETSCLIB="${PETSC_ROOT}/lib -lpetsc"
++			;;
+ 		esac
+ 		AC_MSG_RESULT([done])
+ 		AC_DEFINE([_HAVE_PETSC_], [1], [with PETSc in ISSM src])
+@@ -1298,7 +1374,6 @@
+ 	dnl }}}
+ 	dnl MPI{{{
+ 	AC_MSG_CHECKING(for MPI)
+-
+ 	AC_ARG_WITH(
+ 		[mpi-include],
+ 		AS_HELP_STRING([--with-mpi-include=DIR], [MPI include directory, necessary for parallel build]),
+@@ -1305,7 +1380,6 @@
+ 		[MPI_INCLUDE=${withval}],
+ 		[MPI_INCLUDE=""]
+ 	)
+-
+ 	AC_ARG_WITH(
+ 		[mpi-libdir],
+ 		AS_HELP_STRING([--with-mpi-libdir=DIR], [MPI library directory, necessary for parallel build]),
+@@ -1312,7 +1386,6 @@
+ 		[MPI_LIBDIR=${withval}],
+ 		[MPI_LIBDIR=""]
+ 	)
+-
+ 	AC_ARG_WITH(
+ 		[mpi-libflags],
+ 		AS_HELP_STRING([--with-mpi-libflags=LIBS], [MPI libraries to be used, necessary for parallel build]),
+@@ -1319,7 +1392,6 @@
+ 		[MPI_LIBFLAGS=${withval}],
+ 		[MPI_LIBFLAGS=""]
+ 	)
+-
+ 	if test -z "${MPI_INCLUDE}"; then
+ 		HAVE_MPI=no
+ 	else
+@@ -1362,6 +1434,7 @@
+ 	AC_MSG_RESULT([${HAVE_MPI}])
+ 	dnl }}}
+ 	dnl SCOTCH{{{
++	AC_MSG_CHECKING([for SCOTCH])
+ 	AC_ARG_WITH(
+ 		[scotch-dir],
+ 		AS_HELP_STRING([--with-scotch-dir=DIR], [SCOTCH root directory]),
+@@ -1368,7 +1441,6 @@
+ 		[SCOTCH_ROOT=$withval],
+ 		[SCOTCH_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SCOTCH])
+ 	if test "x${SCOTCH_ROOT}" == "xno"; then
+ 		HAVE_SCOTCH=no
+ 	else
+@@ -1401,84 +1473,138 @@
+ 	fi
+ 	dnl }}}
+ 	dnl METIS{{{
+-
+-	dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
+-	dnl		  check again in the following conditionals
+-	dnl
+-	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 3 && test "${VENDOR}" != "MSVC-Win64" && test "${VENDOR}" != "MSVC-Win64-par"; then
+-		dnl In PETSc >=3.3, METIS is provided
+-		HAVE_METIS="yes"
+-		AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
+-		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
+-	else
+-		AC_ARG_WITH(
+-			[metis-dir],
+-			AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
+-			[METIS_ROOT=${withval}],
+-			[METIS_ROOT="no"]
+-		)
+-		AC_MSG_CHECKING([for METIS])
+-		if test "x${METIS_ROOT}" == "xno"; then
+-			HAVE_METIS=no
+-		else
++	AC_MSG_CHECKING([for METIS])
++	AC_ARG_WITH(
++		[metis-dir],
++		AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
++		[METIS_ROOT=${withval}],
++		[METIS_ROOT="no"]
++	)
++	HAVE_METIS=no
++	if test "x${METIS_ROOT}" == "xno"; then
++		dnl Check if METIS was installed via PETSc
++		if test -f ${PETSC_ROOT}/install/include/metis.h; then
+ 			HAVE_METIS=yes
+-			if ! test -d "${METIS_ROOT}"; then
+-				AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
+-			fi
++			METIS_ROOT="${PETSC_ROOT}"
+ 		fi
+-		AC_MSG_RESULT([${HAVE_METIS}])
+-		AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
+-
++	else
++		if ! test -d "${METIS_ROOT}"; then
++			AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
++		fi
++		HAVE_METIS=yes
++	fi
++	if test "${HAVE_METIS}" = "yes"; then
++		METIS_VERSION=$(grep "#define METIS_VER_MAJOR" ${METIS_ROOT}/include/metis.h | sed 's|.*METIS_VER_MAJOR[[:space:]]*||')
+ 		dnl METIS libraries and header files
+-		if test "x${HAVE_METIS}" == "xyes"; then
+-			dnl Retrieve METIS version (does the VERSION file exist?)
+-			if test -f "${METIS_ROOT}/VERSION"; then
+-				METIS_VERSION=4
+-			else
+-				METIS_VERSION=5
+-			fi
+-
+-			if test "x${METIS_VERSION}" == "x4"; then
+-				METISINCL="-I${METIS_ROOT}/Lib"
+-				case "${host_os}" in
+-					*cygwin*)
+-						METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
+-						METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
+-					;;
+-					*linux*)
+-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
+-					;;
+-					*darwin*)
+-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
+-					;;
+-				esac
+-				AC_DEFINE([_METIS_VERSION_], [4], [ METIS version number])
+-			fi
+-
+-			if test "x${METIS_VERSION}" == "x5"; then
+-				case "${host_os}" in
+-					*cygwin*)
+-						METISLIB="-L${METIS_ROOT} libmetis.lib"
+-					;;
+-					*linux*)
+-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
+-					;;
+-					*darwin*)
+-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
+-					;;
+-				esac
+-				METISINCL="-I${METIS_ROOT}/include"
+-				AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
+-			fi
+-
+-			AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
+-			AC_SUBST([METISINCL])
+-			AC_SUBST([METISLIB])
++		if test "x${METIS_VERSION}" == "x4"; then
++			METISINCL="-I${METIS_ROOT}/Lib"
++			case "${host_os}" in
++				*cygwin*)
++					METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
++					METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
++				;;
++				*darwin*)
++					METISLIB="-L${METIS_ROOT} -lmetis"
++				;;
++				*linux*)
++					METISLIB="-L${METIS_ROOT} -lmetis"
++				;;
++				*mingw*)
++					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
++				;;
++				*msys*)
++					METISLIB="-L${METIS_ROOT} -lmetis"
++				;;
++			esac
++		elif test "x${METIS_VERSION}" == "x5"; then
++			METISINCL="-I${METIS_ROOT}/include"
++			case "${host_os}" in
++				*cygwin*)
++					METISLIB="-L${METIS_ROOT} libmetis.lib"
++				;;
++				*darwin*)
++					METISLIB="-L${METIS_ROOT}/lib -lmetis"
++				;;
++				*linux*)
++					METISLIB="-L${METIS_ROOT}/lib -lmetis"
++				;;
++				*mingw*)
++					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
++				;;
++				*msys*)
++					METISLIB="-L${METIS_ROOT}/lib -lmetis"
++				;;
++			esac
++		else
++			AC_MSG_ERROR([METIS version ${METIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
+ 		fi
++		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
++		AC_DEFINE_UNQUOTED([_METIS_VERSION_], ${METIS_VERSION}, [METIS version number])
++		AC_SUBST([METISINCL])
++		AC_SUBST([METISLIB])
+ 	fi
+-	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
++	AC_MSG_RESULT([${HAVE_METIS}])
++	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" = "xyes"])
+ 	dnl }}}
++	dnl ParMETIS{{{
++	AC_MSG_CHECKING([for ParMETIS])
++	AC_ARG_WITH(
++		[parmetis-dir],
++		AS_HELP_STRING([--with-parmetis-dir=DIR], [ParMETIS root directory, necessary for parallel build]),
++		[PARMETIS_ROOT=${withval}],
++		[PARMETIS_ROOT="no"]
++	)
++	HAVE_PARMETIS=no
++	if test "x${PARMETIS_ROOT}" == "xno"; then
++		dnl Check if ParMETIS was installed via PETSc
++		if test -f ${PETSC_ROOT}/install/include/parmetis.h; then
++			HAVE_PARMETIS="yes"
++			PARMETIS_ROOT="${PETSC_ROOT}"
++		fi
++	else
++		if ! test -d "${PARMETIS_ROOT}"; then
++			AC_MSG_ERROR([ParMETIS directory provided (${PARMETIS_ROOT}) does not exist!]);
++		fi
++		if ! test -d "${METIS_ROOT}"; then
++			AC_MSG_ERROR([If supplying path to ParMETIS with option --with-parmetis-dir, must also supply path to METIS with option --with-metis-dir]);
++		fi
++		HAVE_PARMETIS="yes"
++	fi
++	if test "${HAVE_PARMETIS}" == "yes"; then
++		#PARMETIS_VERSION=$(grep "#define PARMETIS_MAJOR_VERSION" ${PARMETIS_ROOT}/include/parmetis.h | sed 's|.*PARMETIS_MAJOR_VERSION[[:space:]]*||')
++		dnl METIS libraries and header files
++		#if test "x${PARMETIS_VERSION}" == "x4"; then
++			PARMETISINCL="-I${PARMETIS_ROOT}/include"
++			case "${host_os}" in
++				*cygwin*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++				*darwin*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++				*linux*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++				*mingw*)
++					PARMETISLIB="-Wl,${PARMETIS_ROOT}/lib/libparmetis.a"
++				;;
++				*msys*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++			esac
++		#else
++		#	AC_MSG_ERROR([ParMETIS version ${PARMETIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
++		#fi
++		AC_DEFINE([_HAVE_PARMETIS_], [1], [with ParMETIS in ISSM src])
++		#AC_DEFINE([_PARMETIS_VERSION_], [${PARMETIS_VERSION}], [ParMETIS version number])
++		AC_SUBST([PARMETISINCL])
++		AC_SUBST([PARMETISLIB])
++	fi
++	AC_MSG_RESULT([${HAVE_PARMETIS}])
++	AM_CONDITIONAL([PARMETIS], [test "x${HAVE_PARMETIS}" = "xyes"])
++	dnl }}}
+ 	dnl Toolkit for Advanced Optimization (TAO){{{
++	AC_MSG_CHECKING([for TAO])
+ 	AC_ARG_WITH(
+ 		[tao-dir],
+ 		AS_HELP_STRING([--with-tao-dir=DIR], [TAO root directory]),
+@@ -1485,8 +1611,6 @@
+ 		[TAO_ROOT=${withval}],
+ 		[TAO_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for TAO])
+-
+ 	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 5; then
+ 		dnl In PETSc >= 3.5, TAO is provided
+ 		HAVE_TAO="yes"
+@@ -1514,6 +1638,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl M1QN3{{{
++	AC_MSG_CHECKING([for M1QN3])
+ 	AC_ARG_WITH(
+ 		[m1qn3-dir],
+ 		AS_HELP_STRING([--with-m1qn3-dir=DIR], [M1QN3 root directory]),
+@@ -1520,7 +1645,6 @@
+ 		[M1QN3_ROOT=${withval}],
+ 		[M1QN3_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for M1QN3])
+ 	if test "x${M1QN3_ROOT}" == "xno"; then
+ 		HAVE_M1QN3=no
+ 	else
+@@ -1539,6 +1663,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PROJ{{{
++	AC_MSG_CHECKING([for PROJ])
+ 	AC_ARG_WITH(
+ 		[proj-dir],
+ 		AS_HELP_STRING([--with-proj-dir=DIR], [PROJ root directory]),
+@@ -1545,7 +1670,6 @@
+ 		[PROJ_ROOT=${withval}],
+ 		[PROJ_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for PROJ])
+ 	if test "x${PROJ_ROOT}" == "xno"; then
+ 		HAVE_PROJ=no
+ 	else
+@@ -1567,6 +1691,7 @@
+ 	AM_CONDITIONAL([PROJ], [test "x${HAVE_PROJ}" == "xyes"])
+ 	dnl }}}
+ 	dnl SLEPc{{{
++	AC_MSG_CHECKING([for SLEPc])
+ 	AC_ARG_WITH(
+ 		[slepc-dir],
+ 		AS_HELP_STRING([--with-slepc-dir=DIR], [SLEPc root directory]),
+@@ -1573,7 +1698,6 @@
+ 		[SLEPC_ROOT=${withval}],
+ 		[SLEPC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SLEPc])
+ 	if test "x${SLEPC_ROOT}" == "xno"; then
+ 		HAVE_SLEPC=no
+ 	else
+@@ -1594,6 +1718,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl shapelib{{{
++	AC_MSG_CHECKING([for shapelib])
+ 	AC_ARG_WITH(
+ 		[shapelib-dir],
+ 		AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
+@@ -1600,7 +1725,6 @@
+ 		[SHAPELIB_ROOT=${withval}],
+ 		[SHAPELIB_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for shapelib])
+ 	if test "x${SHAPELIB_ROOT}" == "xno"; then
+ 		HAVE_SHAPELIB=no
+ 	else
+@@ -1621,8 +1745,9 @@
+ 	fi
+ 	dnl }}}
+ 	dnl ScaLAPACK{{{
+-
+ 	dnl NOTE: User should supply path to root directory or libraries, but not both
++	dnl
++	AC_MSG_CHECKING([for ScaLAPACK])
+ 	AC_ARG_WITH(
+ 		[scalapack-dir],
+ 		AS_HELP_STRING([--with-scalapack-dir=DIR], [ScaLAPACK root directory]),
+@@ -1635,7 +1760,6 @@
+ 		[SCALAPACKLIB=${withval}],
+ 		[SCALAPACKLIB="no"]
+ 	)
+-	AC_MSG_CHECKING([for ScaLAPACK])
+ 	if test "x${SCALAPACK_ROOT}" == "xno" && test "x${SCALAPACKLIB}" == "xno"; then
+ 		HAVE_SCALAPACK=no
+ 		SCALAPACKLIB=""
+@@ -1644,7 +1768,11 @@
+ 			AC_MSG_ERROR([ScaLAPACK directory provided (${SCALAPACK_ROOT}) does not exist!]);
+ 		fi
+ 		HAVE_SCALAPACK=yes
+-		SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
++		if test "${VENDOR}" == "win-msys2"; then
++			SCALAPACKLIB="-Wl,${SCALAPACK_ROOT}/lib/libscalapack.a"
++		else
++			SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
++		fi
+ 	elif test "x${SCALAPACKLIB}" != "xno"; then
+ 		dnl Value of SCALAPACKLIB should be valid here, so no need to set it (as above)
+ 		HAVE_SCALAPACK=yes
+@@ -1660,19 +1788,33 @@
+ 	fi
+ 	dnl }}}
+ 	dnl BLAS/LAPACK{{{
++	AC_MSG_CHECKING([for BLAS/LAPACK])
+ 	AC_ARG_WITH(
++		[blas-dir],
++		[AS_HELP_STRING([--with-blas-dir=DIR], [BLAS root directory])],
++		[BLAS_ROOT=$withval],
++		[BLAS_ROOT="no"]
++	)
++	AC_ARG_WITH(
++		[lapack-dir],
++		[AS_HELP_STRING([--with-lapack-dir=DIR], [LAPACK root directory])],
++		[LAPACK_ROOT=$withval],
++		[LAPACK_ROOT="no"]
++	)
++	AC_ARG_WITH(
+ 		[blas-lapack-dir],
+ 		AS_HELP_STRING([--with-blas-lapack-dir=DIR], [BLAS/LAPACK root directory]),
+ 		[BLASLAPACK_ROOT=$withval],
+ 		[BLASLAPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for BLAS/LAPACK])
+-	if test "x${BLASLAPACK_ROOT}" == "xno" ; then
++	if (test "x${BLAS_ROOT}" = "xno" || test "x${LAPACK_ROOT}" = "xno") && test "x${BLASLAPACK_ROOT}" = "xno"; then
+ 		HAVE_BLASLAPACK=no
+ 	else
+ 		HAVE_BLASLAPACK=yes
+-		if ! test -d "${BLASLAPACK_ROOT}"; then
+-			AC_MSG_ERROR([BLAS/LAPACK directory provided (${BLASLAPACK_ROOT}) does not exist!]);
++		if ! test -d "${BLAS_ROOT}" || ! test -d "${LAPACK_ROOT}"; then
++			if ! test -d "${BLASLAPACK_ROOT}"; then
++				AC_MSG_ERROR([Use either --with-blas-dir and --with-lapack-dir *or* --with-blaslapack-dir]);
++			fi
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT([${HAVE_BLASLAPACK}])
+@@ -1679,7 +1821,6 @@
+ 
+ 	dnl BLAS/LAPACK libraries and header files
+ 	if test "x${HAVE_BLASLAPACK}" == "xyes"; then
+-		BLASLAPACKINCL=""
+ 		case "${host_os}" in
+ 			*cygwin*)
+ 				BLASLAPACKLIB="-L`cygpath -m ${BLASLAPACK_ROOT}` -Wl,libf2cblas.lib  -Wl,libf2clapack.lib"
+@@ -1708,13 +1849,44 @@
+ 					BLASLAPACKLIB+=" -llapack -lblas"
+ 				fi
+ 			;;
++			*mingw*)
++				if test -d "${BLASLAPACK_ROOT}"; then
++					BLASLAPACKLIB="-L${BLASLAPACK_ROOT}/lib"
++					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB+=" -lopenblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB="-Wl,${BLASLAPACK_ROOT}/lib/libflapack.a -Wl,${BLASLAPACK_ROOT}/lib/libfblas.a"
++					else
++						BLASLAPACKLIB+=" -llapack -lblas"
++					fi
++				else
++					BLASLAPACKLIB="-Wl,${LAPACK_ROOT}/lib/liblapack.a -Wl,${BLAS_ROOT}/lib/libblas.a"
++				fi
++			;;
++			*msys*)
++				if test -d "${BLASLAPACK_ROOT}"; then
++					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB=" -lopenblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB=" -lf2clapack -lf2cblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB+=" -lflapack -lfblas"
++					else
++						BLASLAPACKLIB=" -llapack -lblas"
++					fi
++				else
++					BLASLAPACKLIB="-L${LAPACK_ROOT}/lib -llapack -L${BLAS_ROOT}/lib -lblas"
++				fi
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_BLASLAPACK_], [1], [with BLAS/LAPACK in ISSM src])
+ 		AC_SUBST([BLASLAPACKLIB])
+-		AC_SUBST([BLASLAPACKINCL])
+ 	fi
+ 	dnl }}}
+ 	dnl Math Kernel Library (MKL){{{
++	AC_MSG_CHECKING([for MKL])
+ 	AC_ARG_WITH(
+ 		[mkl-libflags],
+ 		AS_HELP_STRING([--with-mkl-libflags=LIBS], [MKL libraries to be used]),
+@@ -1721,7 +1893,6 @@
+ 		[MKL_LIBFLAGS=${withval}],
+ 		[MKL_LIBFLAGS="no"]
+ 	)
+-	AC_MSG_CHECKING([for MKL])
+ 	if test "x${MKL_LIBFLAGS}" == "xno"; then
+ 		HAVE_MKL=no
+ 	else
+@@ -1734,7 +1905,6 @@
+ 	AC_MSG_RESULT([${HAVE_MKL}])
+ 	dnl }}}
+ 	dnl PlaLAPACK{{{
+-
+ 	dnl TODO: 	Handle user supplying path to root directory *or* individual
+ 	dnl 		arguments (like ScaLAPACK)
+ 	dnl
+@@ -1769,6 +1939,7 @@
+ 	AC_MSG_RESULT([${HAVE_PLAPACK}])
+ 	dnl }}}
+ 	dnl MUMPS{{{
++	AC_MSG_CHECKING([for MUMPS])
+ 	AC_ARG_WITH(
+ 		[mumps-dir],
+ 		AS_HELP_STRING([--with-mumps-dir=DIR], [MUMPS root directory]),
+@@ -1775,7 +1946,6 @@
+ 		[MUMPS_ROOT=${withval}],
+ 		[MUMPS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MUMPS])
+ 	if test "x${MUMPS_ROOT}" == "xno"; then
+ 		HAVE_MUMPS=no
+ 	else
+@@ -1790,8 +1960,8 @@
+ 	if test "x${HAVE_MUMPS}" == "xyes"; then
+ 		MUMPSINCL="-I${MUMPS_ROOT}/include"
+ 		if test "x${MUMPS_ROOT}" == "x${PETSC_ROOT}"; then
+-			if test "x${PETSC_MAJOR}" == "x2"; then
+-				MUMPSLIB="-L${MUMPS_ROOT}/lib "
++			if test "${VENDOR}" == "win-msys2"; then
++				MUMPSLIB="-Wl,${MUMPS_ROOT}/lib/libcmumps.a -Wl,${MUMPS_ROOT}/lib/libdmumps.a -Wl,${MUMPS_ROOT}/lib/libsmumps.a -Wl,${MUMPS_ROOT}/lib/libzmumps.a -Wl,${MUMPS_ROOT}/lib/libmumps_common.a -Wl,${MUMPS_ROOT}/lib/libpord.a"
+ 			else
+ 				MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lcmumps -lmumps_common -lpord -lparmetis -lzmumps -lmetis"
+ 			fi
+@@ -1840,6 +2010,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl BLACS{{{
++	AC_MSG_CHECKING([for BLACS])
+ 	AC_ARG_WITH(
+ 		[blacs-dir],
+ 		AS_HELP_STRING([--with-blacs-dir=DIR], [BLACS root directory]),
+@@ -1846,7 +2017,6 @@
+ 		[BLACS_ROOT=${withval}],
+ 		[BLACS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for BLACS])
+ 	if test "x${BLACS_ROOT}" == "xno"; then
+ 		HAVE_BLACS=no
+ 	else
+@@ -1867,6 +2037,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl HYPRE{{{
++	AC_MSG_CHECKING([for HYPRE])
+ 	AC_ARG_WITH(
+ 		[hypre-dir],
+ 		AS_HELP_STRING([--with-hypre-dir=DIR], [HYPRE root directory]),
+@@ -1873,7 +2044,6 @@
+ 		[HYPRE_ROOT=${withval}],
+ 		[HYPRE_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for HYPRE])
+ 	if test "x${HYPRE_ROOT}" == "xno"; then
+ 		HAVE_HYPRE=no
+ 	else
+@@ -1894,6 +2064,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Prometheus{{{
++	AC_MSG_CHECKING([for Prometheus])
+ 	AC_ARG_WITH(
+ 		[prometheus-dir],
+ 		AS_HELP_STRING([--with-prometheus-dir=DIR], [Prometheus root directory]),
+@@ -1900,7 +2071,6 @@
+ 		[PROMETHEUS_ROOT=${withval}],
+ 		[PROMETHEUS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Prometheus])
+ 	if test "x${PROMETHEUS_ROOT}" == "xno"; then
+ 		HAVE_PROMETHEUS=no
+ 	else
+@@ -1921,6 +2091,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SEMIC{{{
++	AC_MSG_CHECKING([for SEMIC])
+ 	AC_ARG_WITH(
+ 		[semic-dir],
+ 		AS_HELP_STRING([--with-semic-dir=DIR], [SEMIC root directory]),
+@@ -1927,7 +2098,6 @@
+ 		[SEMIC_ROOT=${withval}],
+ 		[SEMIC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SEMIC])
+ 	if test "x${SEMIC_ROOT}" == "xno"; then
+ 		HAVE_SEMIC=no
+ 	else
+@@ -1949,6 +2119,7 @@
+ 	AM_CONDITIONAL([SEMIC], [test "x${HAVE_SEMIC}" == "xyes"])
+ 	dnl }}}
+ 	dnl SPAI{{{
++	AC_MSG_CHECKING([for SPAI])
+ 	AC_ARG_WITH(
+ 		[spai-dir],
+ 		AS_HELP_STRING([--with-spai-dir=DIR], [SPAI root directory]),
+@@ -1955,7 +2126,6 @@
+ 		[SPAI_ROOT=${withval}],
+ 		[SPAI_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SPAI])
+ 	if test "x${SPAI_ROOT}" == "xno"; then
+ 		HAVE_SPAI=no
+ 	else
+@@ -1976,6 +2146,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SuperLU{{{
++	AC_MSG_CHECKING([for SuperLU])
+ 	AC_ARG_WITH(
+ 		[superlu-dir],
+ 		AS_HELP_STRING([--with-superlu-dir=DIR], [SuperLU root directory]),
+@@ -1982,7 +2153,6 @@
+ 		[SUPERLU_ROOT=${withval}],
+ 		[SUPERLU_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SuperLU])
+ 	if test "x${SUPERLU_ROOT}" == "xno"; then
+ 		HAVE_SUPERLU=no
+ 	else
+@@ -2003,6 +2173,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SPOOLES{{{
++	AC_MSG_CHECKING([for SPOOLES])
+ 	AC_ARG_WITH(
+ 		[spooles-dir],
+ 		AS_HELP_STRING([--with-spooles-dir=DIR], [SPOOLES root directory]),
+@@ -2009,7 +2180,6 @@
+ 		[SPOOLES_ROOT=${withval}],
+ 		[SPOOLES_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SPOOLES])
+ 	if test "x${SPOOLES_ROOT}" == "xno"; then
+ 		HAVE_SPOOLES=no
+ 	else
+@@ -2030,6 +2200,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PaStiX{{{
++	AC_MSG_CHECKING([for PaStiX])
+ 	AC_ARG_WITH(
+ 		[pastix-dir],
+ 		AS_HELP_STRING([--with-pastix-dir=DIR], [PaStiX root directory]),
+@@ -2036,7 +2207,6 @@
+ 		[PASTIX_ROOT=${withval}],
+ 		[PASTIX_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for PaStiX])
+ 	if test "x${PASTIX_ROOT}" == "xno"; then
+ 		HAVE_PASTIX=no
+ 	else
+@@ -2058,6 +2228,7 @@
+ 	dnl }}}
+ 	dnl }}}
+ 	dnl ml{{{
++	AC_MSG_CHECKING([for ml])
+ 	AC_ARG_WITH(
+ 		[ml-dir],
+ 		AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
+@@ -2064,7 +2235,6 @@
+ 		[ML_ROOT=$withval],
+ 		[ML_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ml])
+ 	if test "x${ML_ROOT}" == "xno"; then
+ 		HAVE_ML=no
+ 	else
+@@ -2085,6 +2255,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl UMFPACK{{{
++	AC_MSG_CHECKING([for UMFPACK])
+ 	AC_ARG_WITH(
+ 		[umfpack-dir],
+ 		AS_HELP_STRING([--with-umfpack-dir=DIR], [UMFPACK root directory]),
+@@ -2091,7 +2262,6 @@
+ 		[UMFPACK_ROOT=${withval}],
+ 		[UMFPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for UMFPACK])
+ 	if test "x${UMFPACK_ROOT}" == "xno"; then
+ 		HAVE_UMFPACK=no
+ 	else
+@@ -2128,6 +2298,7 @@
+ 	AC_MSG_RESULT([done])
+ 	dnl }}}
+ 	dnl MATH77{{{
++	AC_MSG_CHECKING([for MATH77])
+ 	AC_ARG_WITH(
+ 		[math77-dir],
+ 		AS_HELP_STRING([--with-math77-dir=DIR], [MATH77 root directory]),
+@@ -2134,7 +2305,6 @@
+ 		[MATH77_ROOT=${withval}],
+ 		[MATH77_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MATH77])
+ 	if test "x${MATH77_ROOT}" == "xno"; then
+ 		HAVE_MATH77=no
+ 	else
+@@ -2153,6 +2323,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Fortran{{{
++	AC_MSG_CHECKING(for Fortran compilation)
+ 	AC_ARG_WITH(
+ 		[fortran],
+ 		AS_HELP_STRING([--with-fortran=YES], [do we compile Fortran code (default: yes)]),
+@@ -2159,7 +2330,6 @@
+ 		[FORTRAN=${withval}],
+ 		[FORTRAN=yes]
+ 	)
+-	AC_MSG_CHECKING(for Fortran compilation)
+ 	if test "x${FORTRAN}" == "xyes"; then
+ 		HAVE_FORTRAN=yes
+ 		AC_DEFINE([_HAVE_FORTRAN_], [1], [with Fortran capability])
+@@ -2223,6 +2393,7 @@
+ 	AC_MSG_RESULT([done])
+ 	dnl }}}
+ 	dnl MeteoIO{{{
++	AC_MSG_CHECKING([for MeteoIO])
+ 	AC_ARG_WITH(
+ 		[meteoio-dir],
+ 		AS_HELP_STRING([--with-meteoio-dir=DIR], [use MeteoIO in conjunction with SNOWPACK model]),
+@@ -2229,7 +2400,6 @@
+ 		[METEOIO_ROOT=${withval}],
+ 		[METEOIO_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MeteoIO])
+ 	if test "x${METEOIO_ROOT}" == "xno"; then
+ 		HAVE_METEOIO=no
+ 	else
+@@ -2252,6 +2422,7 @@
+ 	AM_CONDITIONAL([METEOIO], [test "x${HAVE_METEOIO}" == "xyes"])
+ 	dnl }}}
+ 	dnl SNOWPACK{{{
++	AC_MSG_CHECKING([for SNOWPACK])
+ 	AC_ARG_WITH(
+ 		[snowpack-dir],
+ 		AS_HELP_STRING([--with-snowpack-dir=DIR], [use SNOWPACK for surface mass balance model]),
+@@ -2258,7 +2429,6 @@
+ 		[SNOWPACK_ROOT=${withval}],
+ 		[SNOWPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SNOWPACK])
+ 	if test "x${SNOWPACK_ROOT}" == "xno"; then
+ 		HAVE_SNOWPACK=no
+ 	else
+@@ -2280,6 +2450,7 @@
+ 	AM_CONDITIONAL([SNOWPACK], [test "x${HAVE_SNOWPACK}" == "xyes"])
+ 	dnl }}}
+ 	dnl NeoPZ{{{
++	AC_MSG_CHECKING([for NeoPZ])
+ 	AC_ARG_WITH(
+ 		[neopz-dir],
+ 		AS_HELP_STRING([--with-neopz-dir=DIR], [NeoPZ root directory]),
+@@ -2286,7 +2457,6 @@
+ 		[NEOPZ_ROOT=${withval}],
+ 		[NEOPZ_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for NeoPZ])
+ 	if test "x${NEOPZ_ROOT}" == "xno"; then
+ 		HAVE_NEOPZ=no
+ 	else
+@@ -2355,11 +2525,12 @@
+ 		AC_MSG_CHECKING(for Gmsh version)
+ 		GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
+ 		AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
+-		AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
++		AC_DEFINE_UNQUOTED([_GMSH_VERSION_MAJOR_], ${GMSH_VERSION_MAJOR}, [Gmsh major version])
+ 	fi	
+ 	dnl }}}
+ 	dnl Capabilities
+ 	dnl with-bamg{{{
++	AC_MSG_CHECKING([for BAMG capability compilation])
+ 	AC_ARG_WITH(
+ 		[bamg],
+ 		AS_HELP_STRING([--with-bamg=YES], [compile with BAMG capabilities (default: yes)]),
+@@ -2366,7 +2537,6 @@
+ 		[BAMG=${withval}],
+ 		[BAMG=yes]
+ 	)
+-	AC_MSG_CHECKING([for BAMG capability compilation])
+ 	HAVE_BAMG=no
+ 	if test "x${BAMG}" == "xyes"; then
+ 		HAVE_BAMG=yes
+@@ -2376,6 +2546,7 @@
+ 	AC_MSG_RESULT([${HAVE_BAMG}])
+ 	dnl }}}
+ 	dnl with-ocean{{{
++	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
+ 	AC_ARG_WITH(
+ 		[ocean],
+ 		AS_HELP_STRING([--with-ocean = YES], [compile with ice/ocean coupling capability (default: no)]),
+@@ -2382,8 +2553,6 @@
+ 		[OCEAN=${withval}],
+ 		[OCEAN=no]
+ 	)
+-	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
+-
+ 	HAVE_OCEAN=no
+ 	if test "x${OCEAN}" == "xyes"; then
+ 		HAVE_OCEAN=yes
+@@ -2393,6 +2562,7 @@
+ 	AC_MSG_RESULT([${HAVE_OCEAN}])
+ 	dnl }}}
+ 	dnl with-kml{{{
++	AC_MSG_CHECKING(for kml capability compilation)
+ 	AC_ARG_WITH(
+ 		[kml],
+ 		AS_HELP_STRING([--with-kml=YES], [compile with kml capabilities (default: no)]),
+@@ -2399,8 +2569,6 @@
+ 		[KML=${withval}],
+ 		[KML=no]
+ 	)
+-	AC_MSG_CHECKING(for kml capability compilation)
+-
+ 	HAVE_KML=no
+ 	if test "x${KML}" == "xyes"; then
+ 		HAVE_KML=yes
+@@ -2410,6 +2578,7 @@
+ 	AC_MSG_RESULT([${HAVE_KML}])
+ 	dnl }}}
+ 	dnl with-kriging{{{
++	AC_MSG_CHECKING(for kriging capability compilation)
+ 	AC_ARG_WITH(
+ 		[kriging],
+ 		AS_HELP_STRING([--with-kriging=YES], [compile with kriging capabilities (default: yes)]),
+@@ -2416,8 +2585,6 @@
+ 		[KRIGING=${withval}],
+ 		[KRIGING=yes]
+ 	)
+-	AC_MSG_CHECKING(for kriging capability compilation)
+-
+ 	HAVE_KRIGING=no
+ 	if test "x${KRIGING}" == "xyes"; then
+ 		HAVE_KRIGING=yes
+@@ -2432,6 +2599,7 @@
+ 
+ 	dnl Platform specifics
+ 	dnl with-ios{{{
++	AC_MSG_CHECKING(for iOS compilation)
+ 	AC_ARG_WITH(
+ 		[ios],
+ 		AS_HELP_STRING([--with-ios=YES], [compile with iOS capabilities (default: no)]),
+@@ -2438,8 +2606,6 @@
+ 		[IOS=${withval}],
+ 		[IOS=no]
+ 	)
+-	AC_MSG_CHECKING(for iOS compilation)
+-
+ 	HAVE_IOS=no
+ 	if test "x${IOS}" == "xyes"; then
+ 		HAVE_IOS=yes
+@@ -2449,13 +2615,13 @@
+ 	AC_MSG_RESULT([${HAVE_IOS}])
+ 	dnl }}}
+ 	dnl with-android{{{
++	AC_MSG_CHECKING([for Android capability compilation])
+ 	AC_ARG_WITH(
+ 		[android],
+ 		AS_HELP_STRING([--with-android=EXE], [compile with Android capabilities (default: "no"; alternatives: "exe", "jni")]),
+ 		[ANDROID=${withval}],
+-		[ANDROID=no])
+-	AC_MSG_CHECKING([for Android capability compilation])
+-
++		[ANDROID=no]
++	)
+ 	if test "x${ANDROID}" == "xjni"; then
+ 		HAVE_ANDROID=jni
+ 		AC_DEFINE([_HAVE_ANDROID_], [1], [with Android capability])
+@@ -2474,6 +2640,7 @@
+ 	AC_MSG_RESULT([${HAVE_ANDROID}])
+ 	dnl }}}
+ 	dnl with-android-ndk{{{
++	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
+ 	AC_ARG_WITH(
+ 		[android-ndk],
+ 		AS_HELP_STRING([--with-android-ndk=DIR], [Android NDK root directory]),
+@@ -2480,8 +2647,6 @@
+ 		[ANDROID_NDK_ROOT=${withval}],
+ 		[ANDROID_NDK_ROOT=""]
+ 	)
+-	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
+-
+ 	if test -d "${ANDROID_NDK_ROOT}"; then
+ 		HAVE_ANDROID_NDK=yes
+ 		ANDROID_NDKINCL="-I${ANDROID_NDK_ROOT}/arm-linux-android-install/sysroot/usr/include"
+@@ -2495,18 +2660,19 @@
+ 
+ 	dnl other options
+ 	dnl optimization{{{
+-	dnl -- bypass standard optimization -g -O2 -fPIC -std=c++11?
++	dnl -- bypass standard optimization -g -O2 -fPIC?
++	AC_MSG_CHECKING(for C++ optimization flags)
+ 	AC_ARG_WITH(
+ 		[cxxoptflags],
+ 		AS_HELP_STRING([--with-cxxoptflags=CXXOPTFLAGS], [C++ optimization flags (i.e. --with-cxxoptflags="-march=opteron -O3 -std=c++11"]),
+ 		[CXXOPTFLAGS=${withval}],
+-		[CXXOPTFLAGS="-g -O2 -fPIC -std=c++11"]
++		[CXXOPTFLAGS="-g -O2 -fPIC"]
+ 	)
+-	AC_MSG_CHECKING(for C++ optimization flags)
+ 	AC_SUBST([CXXOPTFLAGS])
+-	AC_MSG_RESULT([done])
++	AC_MSG_RESULT([${CXXOPTFLAGS}])
+ 	dnl }}}
+ 	dnl multithreading{{{
++	AC_MSG_CHECKING(for number of threads)
+ 	AC_ARG_WITH(
+ 		[numthreads],
+ 		AS_HELP_STRING([--with-numthreads=NUMTHREADS_VALUE], [number of threads (default: 1)]),
+@@ -2513,7 +2679,6 @@
+ 		[NUMTHREADS_VALUE=${withval}],
+ 		[NUMTHREADS_VALUE=1]
+ 	)
+-	AC_MSG_CHECKING(for number of threads)
+ 	dnl Check that supplied value is an integer
+ 	if [[ "${NUMTHREADS_VALUE}" != "${NUMTHREADS_VALUE}" 2> /dev/null ]]; then
+ 		AC_MSG_ERROR([Number of threads provided (${NUMTHREADS_VALUE}) is not an integer!]);
+@@ -2528,20 +2693,27 @@
+ 			*cygwin*)
+ 				MULTITHREADINGLIB="-lpthread -lrt"
+ 			;;
++			*darwin*)
++				MULTITHREADINGLIB="-lpthread"
++			;;
+ 			*linux*)
+ 				MULTITHREADINGLIB="-lpthread -lrt"
+ 			;;
+-			*darwin*)
+-				MULTITHREADINGLIB="-lpthread"
++			*mingw*)
++				MULTITHREADINGLIB=""
+ 			;;
++			*msys*)
++				MULTITHREADINGLIB=""
++			;;
+ 		esac
+ 		AC_DEFINE([_MULTITHREADING_], [1], [with multithreading enabled])
+ 	fi
+-	AC_DEFINE_UNQUOTED(_NUMTHREADS_, $NUMTHREADS_VALUE, [number of threads])
++	AC_DEFINE_UNQUOTED([_NUMTHREADS_], ${NUMTHREADS_VALUE}, [number of threads])
+ 	AC_SUBST([MULTITHREADINGLIB])
+ 	AC_MSG_RESULT([${NUMTHREADS_VALUE}])
+ 	dnl }}}
+ 	dnl 64-bit indices{{{
++	AC_MSG_CHECKING([for 64-bit indices])
+ 	AC_ARG_WITH(
+ 		[64bit-indices],
+ 		AS_HELP_STRING([--with-64bit-indices=bool], [use 64-bit indices (default: 0)]),
+@@ -2548,8 +2720,6 @@
+ 		[USE_64BIT_INDICES=${withval}],
+ 		[USE_64BIT_INDICES=0]
+ 	)
+-	AC_MSG_CHECKING([for 64-bit indices])
+-
+ 	if test "x${USE_64BIT_INDICES}" == "x1"; then
+ 		AC_DEFINE([ISSM_USE_64BIT_INDICES], [1], [with 64-bit indices])
+ 	else
+@@ -2559,7 +2729,7 @@
+ 	dnl }}}
+ 
+ 	dnl Checks {{{
+-	AC_MSG_CHECKING(consistency between all libraries)
++	AC_MSG_CHECKING(consistency between all external packages)
+ 
+ 	dnl Check that if PETSc is requested, MPI is specified
+ 	if test "x${HAVE_PETSC}" == "xyes"; then
+@@ -2589,7 +2759,7 @@
+ 	fi
+ 
+ 	dnl Check that if we run ADOL-C, we don't compile kriging.exe
+-	if test "x$HAVE_ADOLC" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
++	if test "x${HAVE_ADOLC}" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
+ 		AC_MSG_ERROR([cannot compile kriging.exe under ADOL-C conditions!]);
+ 	fi
+ 
+Index: ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh
+===================================================================
+--- ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh	(nonexistent)
++++ ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh	(revision 26034)
+@@ -0,0 +1,52 @@
++#!/bin/bash
++#
++# Creates a local MS-MPI directory to be used for supplying header and library
++# paths to ISSM configuration as well as the configuration of certain external
++# packages.
++#
++# Local MS-MPI include and library paths are made available as environment
++# variables LOCAL_MSMPI_INC and LOCAL_MSMPI_LIB, respectively (script can be
++# sourced again).
++#
++# Paths may need to be modified in the future if Microsoft changes the
++# directory structure and/or file naming in the MS-MPI package. Paths are
++# based on Microsoft MPI v10.0,
++#	https://www.microsoft.com/en-us/download/details.aspx?id=57467
++#
++LOCAL_MSMPI_ROOT="${ISSM_DIR}/MSMPI"
++LOCAL_MSMPI_INC="${LOCAL_MSMPI_ROOT}/include"
++LOCAL_MSMPI_LIB="${LOCAL_MSMPI_ROOT}/lib"
++MSMPI_RUNTIME_LIB="/c/Windows/System32/msmpi.dll"
++MSMPI_INC="/c/PROGRA~2/MICROS~2/MPI/Include"
++MSMPI_LIB="${ISSM_DIR}/externalpackages/windows/MSMPI/lib"
++
++cd ${ISSM_DIR}
++
++if [ -d ${LOCAL_MSMPI_ROOT} ]; then
++	echo "'${LOCAL_MSMPI_ROOT}' already exists!"
++	echo "If you need to recreate local MS-MPI directory, remove '${LOCAL_MSMPI_ROOT}' and rerun this script."
++else
++	mkdir ${LOCAL_MSMPI_ROOT} ${LOCAL_MSMPI_INC} ${LOCAL_MSMPI_LIB}
++
++	# Make SVN ignore local MS-MPI directory so that we do not accidentally
++	# commit it
++	svn propset svn:ignore ${LOCAL_MSMPI_ROOT} . &>/dev/null
++
++	# Copy MS-MPI header files
++	cp $MSMPI_INC/mpi.h ${LOCAL_MSMPI_INC}
++	cp $MSMPI_INC/mpi.f90 ${LOCAL_MSMPI_INC}
++	cp $MSMPI_INC/mpif.h ${LOCAL_MSMPI_INC}
++	cp $MSMPI_INC/mpio.h ${LOCAL_MSMPI_INC}
++	cp $MSMPI_INC/x64/mpifptr.h ${LOCAL_MSMPI_INC}
++
++	# Copy MS-MPI libraries
++	cp ${MSMPI_RUNTIME_LIB} ${LOCAL_MSMPI_LIB}
++
++	cd ${LOCAL_MSMPI_LIB}
++
++	# Create link to runtime library with MSYS prefix
++	ln -s ./msmpi.dll ./msys-msmpi.dll
++
++	# Create link to runtime library with lib prefix
++	ln -s ./msmpi.dll ./libmsmpi.dll
++fi
+
+Property changes on: ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26033)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26034)
+@@ -1,4 +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@ @PROJINCL@ @ESMFINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
+ AM_FCFLAGS = @SEMICINCL@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+@@ -7,7 +7,10 @@
+ 
+ #Library declaration {{{
+ if !WINDOWS
+-lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la
++lib_LTLIBRARIES = libISSMCore.la
++if !MSYS2
++lib_LTLIBRARIES += libISSMOverload.la
++endif
+ if WRAPPERS
+ lib_LTLIBRARIES += libISSMModules.la
+ endif
+@@ -681,15 +684,20 @@
+ endif
+ #}}}
+ #Library flags and sources {{{
+-ALLCXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
++ALL_CXXFLAGS = $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
++# Cannot have undefined symbols under msys2
++if MSYS2
++ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_
++endif
++
+ libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMCore_la_CXXFLAGS = $(ALLCXXFLAGS) $(DAKOTAFLAGS)
++libISSMCore_la_CXXFLAGS = $(ALL_CXXFLAGS) $(DAKOTAFLAGS)
+ libISSMCore_la_FFLAGS = $(AM_FFLAGS)
+ 
+ if !WINDOWS
+ if !STANDALONE_LIBRARIES
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
+ if FORTRAN
+ libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
+ endif
+@@ -710,7 +718,7 @@
+ libISSMModules_la_SOURCES += $(kml_sources)
+ endif
+ 
+-libISSMModules_la_CXXFLAGS = $(ALLCXXFLAGS)
++libISSMModules_la_CXXFLAGS = $(ALL_CXXFLAGS)
+ if !WINDOWS
+ if STANDALONE_LIBRARIES
+ libISSMModules_la_LIBADD = ./libISSMCore.la
+@@ -742,24 +750,41 @@
+ endif
+ endif
+ 
+-if STANDALONE_LIBRARIES
+-libISSMCore_la_LDFLAGS = -static
+-libISSMOverload_la_LDFLAGS = -static
++if VERSION
++libISSMCore_la_LDFLAGS =
+ if WRAPPERS
+-libISSMModules_la_LDFLAGS = -static
+-else
+ libISSMModules_la_LDFLAGS =
+ endif
+ else
+-libISSMCore_la_LDFLAGS =
+-libISSMOverload_la_LDFLAGS =
++libISSMCore_la_LDFLAGS = -avoid-version
++if WRAPPERS
++libISSMModules_la_LDFLAGS = -avoid-version
+ endif
++endif
+ 
++if STANDALONE_LIBRARIES
++libISSMCore_la_LDFLAGS += -static
++if WRAPPERS
++libISSMModules_la_LDFLAGS += -static
++endif
++endif
+ #}}}
++
++if !MSYS2
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_la_SOURCES = ./shared/String/ApiPrintf.cpp
++libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
+ 
+-libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
++if VERSION
++libISSMOverload_la_LDFLAGS =
++else
++libISSMOverload_la_LDFLAGS = -avoid-version
++endif
++
++if STANDALONE_LIBRARIES
++libISSMOverload_la_LDFLAGS += -static
++endif
++endif
+ #}}}
+ #Executable {{{
+ if ANDROID
+@@ -777,13 +802,18 @@
+ endif
+ 
+ #Standard libraries
+-LDADD = ./libISSMCore.la ./libISSMOverload.la
++LDADD = ./libISSMCore.la 
++
++if !MSYS2
++LDADD += ./libISSMOverload.la
++endif
++
+ if WRAPPERS
+ LDADD += ./libISSMModules.la $(TRIANGLELIB)
+ endif
+ 
+ #External packages
+-LDADD += $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB)
++LDADD +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
+ 
+ if FORTRAN
+ LDADD += $(FLIBS) $(FORTRANLIB)
+Index: ../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26033)
++++ ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26034)
+@@ -27,7 +27,7 @@
+ 		function cluster=generic(varargin) % {{{
+ 
+ 			%Change the defaults if ispc
+-			if ispc,
++			if ispc & ~ismingw,
+ 				cluster.codepath      = [issmdir() '\bin'];
+ 				cluster.etcpath       = [issmdir() '\etc'];
+ 				cluster.executionpath = [issmdir() '\execution'];
+@@ -144,7 +144,8 @@
+ 				end
+ 
+ 				if cluster.np>1,
+-					fprintf(fid,'"C:\\Program Files\\MPICH2\\bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s ',cluster.np,cluster.codepath,executable,solution,modelname);
++					% fprintf(fid,'"C:\\Program Files\\MPICH2\\bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s ',cluster.np,cluster.codepath,executable,solution,modelname);
++					fprintf(fid,'"C:\\PROGRA~1\\MICROS~1\\Bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s ',cluster.np,cluster.codepath,executable,solution,modelname);
+ 				else
+ 					fprintf(fid,'"%s/%s" %s ./ %s ',cluster.codepath,executable,solution,modelname);
+ 				end
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 26033)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 26034)
+@@ -215,7 +215,7 @@
+ 			%what is the executable being called? 
+ 			executable='issm_slc.exe';
+ 
+-			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
++			if ispc & ~ismingw, error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+ 
+ 			%write queuing script 
+ 			fid=fopen([modelname '.queue'],'w');
+Index: ../trunk-jpl/src/m/dev/devpath.m
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.m	(revision 26033)
++++ ../trunk-jpl/src/m/dev/devpath.m	(revision 26034)
+@@ -2,11 +2,12 @@
+ lastwarn(''); 
+ 
+ %Recover ISSM_DIR , or if on a Windows machine, ISSM_DIR_WIN
+-if ~ispc,
++if ispc,
++	ISSM_DIR=getenv('ISSM_DIR_WIN');
++else
+ 	ISSM_DIR=getenv('ISSM_DIR');
+-else
+-	ISSM_DIR=getenv('ISSM_DIR_WIN');
+ end
++
+ if (isempty(ISSM_DIR)),
+ 	error('''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+ end
+@@ -17,7 +18,7 @@
+ 
+ %ISSM path
+ addpath([ISSM_DIR '/src/m/os/']); %load recursivepath
+-addpath([ISSM_DIR '/lib']);       %load mex
++addpath([ISSM_DIR '/lib']);       %load MEX files
+ addpath(recursivepath([ISSM_DIR '/src/m']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/canos']));
+Index: ../trunk-jpl/src/wrappers/Triangle/Triangle.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/Triangle/Triangle.h	(revision 26033)
++++ ../trunk-jpl/src/wrappers/Triangle/Triangle.h	(revision 26034)
+@@ -18,7 +18,7 @@
+ 
+ #ifdef _HAVE_JAVASCRIPT_MODULES_
+ #undef _DO_NOT_LOAD_GLOBALS_ /*only module where this needs to be undefined, so as to 
+-							   not include IssmComm several times in the javascript Modle construct.*/
++							   not include IssmComm several times in the JavaScript module construct.*/
+ #endif
+ 
+ /*Header files: */
+Index: ../trunk-jpl/src/wrappers/javascript/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26033)
++++ ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26034)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(JAVASCRIPTWRAPPEREXT)
+@@ -59,7 +59,7 @@
+ AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER -D_WRAPPERS_
+ AM_CXXFLAGS +=  -D_HAVE_JAVASCRIPT_MODULES_ -fPIC
+ 
+-deps = ./libISSMJavascript.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
++deps = ./libISSMJavascript.la ./libISSMApi.la ../../c/libISSMCore.la ../../c/libISSMModules.la
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26033)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26034)
+@@ -19,10 +19,17 @@
+ 	./io/FetchMatlabData.cpp \
+ 	./io/WriteMatlabData.cpp
+ 
+-ALLCXXFLAGS= -fPIC -D_WRAPPERS_ $(CXXFLAGS) $(CXXOPTFLAGS)
++ALL_CXXFLAGS = -fPIC -D_WRAPPERS_
+ 
++# Cannot have undefined symbols under msys2
++if MSYS2
++ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_
++endif
++
++ALL_CXXFLAGS += $(CXXOPTFLAGS) $(CXXFLAGS)
++
+ libISSMMatlab_la_SOURCES = $(io_sources)
+-libISSMMatlab_la_CXXFLAGS= $(ALLCXXFLAGS)
++libISSMMatlab_la_CXXFLAGS = ${ALL_CXXFLAGS}
+ #}}}
+ #api io{{{
+ if !WINDOWS
+@@ -31,10 +38,12 @@
+ noinst_LTLIBRARIES += libISSMApi.la
+ endif
+ 
++if !MSYS2
+ api_sources= ./io/ApiPrintf.cpp
+ 
+ libISSMApi_la_SOURCES = $(api_sources)
+-libISSMApi_la_CXXFLAGS= $(ALLCXXFLAGS)
++libISSMApi_la_CXXFLAGS = ${ALL_CXXFLAGS}
++endif
+ #}}}
+ #Wrappers {{{
+ lib_LTLIBRARIES += \
+@@ -81,11 +90,23 @@
+ deps = $(MATHLIB)
+ 
+ #Triangle library
+-AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER -D_WRAPPERS_
++TRI_CXXFLAGS = -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+ 
+ #Matlab part
+-AM_LDFLAGS = -module $(MEXLINK) -shrext ${EXEEXT} --export-dynamic -rdynamic -no-undefined
++MEX_CXXFLAGS = -D_HAVE_MATLAB_MODULES_ $(MEXOPTFLAGS) $(MEXCXXFLAGS)
++MEX_CPPFLAGS = $(MATLABINCL)
++MEX_LDFLAGS = -module -shrext $(MEXEXT) -no-undefined
++MEX_LIBADD = $(MEXLINKFLAGS) $(MEXLIB)
+ 
++AM_CPPFLAGS += ${MEX_CPPFLAGS}
++AM_CXXFLAGS = ${TRI_CXXFLAGS} ${MEX_CXXFLAGS}
++AM_LDFLAGS = ${MEX_LDFLAGS}
++AM_LIBADD = ${MEX_LIBADD}
++
++if !MSYS2
++AM_LDFLAGS += --export-dynamic -rdynamic
++endif
++
+ if !VERSION
+ AM_LDFLAGS += -avoid-version
+ endif
+@@ -107,12 +128,16 @@
+ 
+ AM_CXXFLAGS += -D_HAVE_MATLAB_MODULES_ -fPIC
+ 
+-deps += ./libISSMMatlab.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
++deps += ./libISSMMatlab.la ../../c/libISSMCore.la ../../c/libISSMModules.la
+ 
+-if WINDOWS
+-deps += $(METISLIB)
++if !MSYS2
++deps += ./libISSMApi.la
+ endif
+ 
++# if WINDOWS
++# deps += $(METISLIB)
++# endif
++
+ if ADOLC
+ deps += $(ADOLCLIB)
+ endif
+@@ -121,138 +146,146 @@
+ deps += $(FLIBS) $(FORTRANLIB)
+ endif
+ 
+-#MEXLIB needs to be the last (undefined references on larsen)
+-deps += ${MEXLIB}
++# #MEXLIB needs to be the last (undefined references on larsen)
++# deps += ${MEXLIB}
+ 
+-#Optimization flags:
+-AM_CXXFLAGS += $(CXXOPTFLAGS)
++# #Optimization flags:
++# AM_CXXFLAGS += $(CXXOPTFLAGS)
+ #}}}
+ # Module sources and dependencies {{{
+ if !WINDOWS
+-libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
++libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+ endif
+ 
++if VERSION
++libISSMMatlab_la_LDFLAGS =
++libISSMApi_la_LDFLAGS =
++else
++libISSMMatlab_la_LDFLAGS = -avoid-version
++libISSMApi_la_LDFLAGS = -avoid-version
++endif
++
+ if STANDALONE_LIBRARIES
+-libISSMMatlab_la_LDFLAGS = -static
+-libISSMApi_la_LDFLAGS = -static
+-deps += $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
++libISSMMatlab_la_LDFLAGS += -static
++libISSMApi_la_LDFLAGS += -static
++deps +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
+ endif
+ 
+ if !WINDOWS
+-libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
++libISSMApi_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+ endif
+ 
+ BamgConvertMesh_matlab_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp
+ BamgConvertMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgConvertMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++BamgConvertMesh_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ BamgMesher_matlab_la_SOURCES = ../BamgMesher/BamgMesher.cpp
+ BamgMesher_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgMesher_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++BamgMesher_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ BamgTriangulate_matlab_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp
+ BamgTriangulate_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgTriangulate_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++BamgTriangulate_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ if CHACO
+ Chaco_matlab_la_SOURCES = ../Chaco/Chaco.cpp
+ Chaco_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Chaco_matlab_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++Chaco_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ endif
+ 
+ ContourToMesh_matlab_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp
+ ContourToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ContourToMesh_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ ContourToNodes_matlab_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp
+ ContourToNodes_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToNodes_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ContourToNodes_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ CoordTransform_matlab_la_SOURCES = ../CoordTransform/CoordTransform.cpp
+ CoordTransform_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-CoordTransform_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++CoordTransform_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ DistanceToMaskBoundary_matlab_la_SOURCES = ../DistanceToMaskBoundary/DistanceToMaskBoundary.cpp
+ DistanceToMaskBoundary_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-DistanceToMaskBoundary_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++DistanceToMaskBoundary_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ ElementConnectivity_matlab_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp
+ ElementConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ElementConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ElementConnectivity_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ ExpToLevelSet_matlab_la_SOURCES = ../ExpToLevelSet/ExpToLevelSet.cpp
+ ExpToLevelSet_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ExpToLevelSet_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ExpToLevelSet_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ ExpSimplify_matlab_la_SOURCES = ../ExpSimplify/ExpSimplify.cpp
+ ExpSimplify_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ExpSimplify_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(NEOPZLIB)
++ExpSimplify_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ InterpFromGridToMesh_matlab_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp
+ InterpFromGridToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromGridToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromGridToMesh_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ InterpFromMesh2d_matlab_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp
+ InterpFromMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMesh2d_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ InterpFromMeshToGrid_matlab_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
+ InterpFromMeshToGrid_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToGrid_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMeshToGrid_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ InterpFromMeshToMesh2d_matlab_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
+ InterpFromMeshToMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ InterpFromMeshToMesh3d_matlab_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+ InterpFromMeshToMesh3d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ IssmConfig_matlab_la_SOURCES = ../IssmConfig/IssmConfig.cpp
+ IssmConfig_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-IssmConfig_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB)
++IssmConfig_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ Kriging_matlab_la_SOURCES = ../Kriging/Kriging.cpp
+ Kriging_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Kriging_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJLIB)
++Kriging_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ M1qn3_matlab_la_SOURCES = ../M1qn3/M1qn3.cpp
+ M1qn3_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-M1qn3_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(M1QN3LIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++M1qn3_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ MeshPartition_matlab_la_SOURCES = ../MeshPartition/MeshPartition.cpp
+ MeshPartition_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshPartition_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++MeshPartition_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ MeshProfileIntersection_matlab_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp
+ MeshProfileIntersection_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshProfileIntersection_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++MeshProfileIntersection_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ NodeConnectivity_matlab_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp
+ NodeConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-NodeConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++NodeConnectivity_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ PointCloudFindNeighbors_matlab_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
+ PointCloudFindNeighbors_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-PointCloudFindNeighbors_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++PointCloudFindNeighbors_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ PropagateFlagsFromConnectivity_matlab_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp
+ PropagateFlagsFromConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ Scotch_matlab_la_SOURCES = ../Scotch/Scotch.cpp
+ Scotch_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Scotch_matlab_la_LIBADD = ${deps}  $(PETSCLIB) $(HDF5LIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(BLASLAPACKLIB)
++Scotch_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ ShpRead_matlab_la_SOURCES = ../ShpRead/ShpRead.cpp
+ ShpRead_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ShpRead_matlab_la_LIBADD = ${deps} $(SHAPELIBLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ShpRead_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ 
+ Triangle_matlab_la_SOURCES = ../Triangle/Triangle.cpp
+ Triangle_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB) ${AM_LIBADD}
+ 
+ ProcessRifts_matlab_la_SOURCES = ../ProcessRifts/ProcessRifts.cpp
+ ProcessRifts_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ProcessRifts_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ProcessRifts_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
+ #}}}
+Index: ../trunk-jpl/src/wrappers/matlab/include/wrapper_macros.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/include/wrapper_macros.h	(revision 26033)
++++ ../trunk-jpl/src/wrappers/matlab/include/wrapper_macros.h	(revision 26034)
+@@ -33,7 +33,7 @@
+ 	}
+ /*}}}*/
+ /* WRAPPER {{{*/
+-#define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) 
++#define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) /* NOTE: In this case, modulename is thrown away in the macro expansion whereas it is used in for the Python wrappers (see also: src/wrappers/python/include/wrapper_macros.h, any result of `grep -r 'WRAPPER(' $ISSM_DIR/src)` */
+ /*}}}*/
+ /* CHECKARGUMENTS {{{*/
+ #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,functionpointer)
+Index: ../trunk-jpl/src/wrappers/python/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26033)
++++ ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26034)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+@@ -69,7 +69,7 @@
+ #	generate static libraries for external packages. Dynamic system libraries
+ #	will be linked to, whether we like it or not, if no static version is
+ #	available.
+-# - On macOS, static linking of binaries is not supported.
++# - On macOC, static linking of binaries is not supported.
+ #
+ if STANDALONE_MODULES
+ if MAC
+@@ -86,7 +86,7 @@
+ AM_CXXFLAGS += -DNPY_NO_DEPRECATED_API
+ endif
+ 
+-deps += ./libISSMPython.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
++deps += ./libISSMPython.la ./libISSMApi.la ../../c/libISSMCore.la ../../c/libISSMModules.la
+ 
+ if ADOLC
+ deps += $(ADOLCLIB)
+@@ -105,7 +105,7 @@
+ if STANDALONE_LIBRARIES
+ libISSMPython_la_LDFLAGS = -static
+ libISSMApi_la_LDFLAGS = -static
+-deps += $(DAKOTALIB) $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
++deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
+ endif
+ 
+ libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26034-26035.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26034-26035.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26034-26035.diff	(revision 26740)
@@ -0,0 +1,342 @@
+Index: ../trunk-jpl/externalpackages/codipack/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/codipack/install.sh	(revision 26034)
++++ ../trunk-jpl/externalpackages/codipack/install.sh	(revision 26035)
+@@ -4,10 +4,10 @@
+ VER=1.8
+ 
+ # Cleanup from previous installation
+-rm -rf install CoDiPack-$VER.tar.gz
++rm -rf src CoDiPack-$VER.tar.gz
+ 
+ #Download development version
+-svn co https://github.com/SciCompKL/CoDiPack.git/trunk install
++svn co https://github.com/SciCompKL/CoDiPack.git/trunk src
+ 
+ ## Download source
+ #$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/CoDiPack-${VER}.tar.gz" "CoDiPack-${VER}.tar.gz"
+Index: ../trunk-jpl/externalpackages/medipack/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/medipack/install.sh	(revision 26034)
++++ ../trunk-jpl/externalpackages/medipack/install.sh	(revision 26035)
+@@ -2,7 +2,7 @@
+ set -eu
+ 
+ #Some cleanup
+-rm -rf install 
++rm -rf src
+ 
+ #Download development version
+-svn co https://github.com/SciCompKL/MeDiPack/trunk install
++svn co https://github.com/SciCompKL/MeDiPack/trunk src
+Index: ../trunk-jpl/jenkins/linux64_caladan
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan	(revision 26034)
++++ ../trunk-jpl/jenkins/linux64_caladan	(revision 26035)
+@@ -15,6 +15,7 @@
+ 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi" \
+ 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+Index: ../trunk-jpl/jenkins/pine_island-mac-basic
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26035)
+@@ -16,6 +16,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 26035)
+@@ -23,6 +23,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 26035)
+@@ -21,6 +21,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26035)
+@@ -18,6 +18,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26035)
+@@ -20,6 +20,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26035)
+@@ -21,6 +21,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26035)
+@@ -21,6 +21,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26035)
+@@ -15,6 +15,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26035)
+@@ -18,6 +18,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-basic	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-basic	(revision 26035)
+@@ -15,6 +15,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries	(revision 26035)
+@@ -24,6 +24,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 26035)
+@@ -22,6 +22,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 26035)
+@@ -21,6 +21,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 26035)
+@@ -21,6 +21,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-gia
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-gia	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-gia	(revision 26035)
+@@ -18,6 +18,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-iceocean
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-iceocean	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-iceocean	(revision 26035)
+@@ -16,6 +16,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 26035)
+@@ -15,6 +15,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/linux64_caladan_ampi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 26034)
++++ ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 26035)
+@@ -18,6 +18,7 @@
+ 	--with-ampi-dir=$ISSM_DIR/externalpackages/adjoinablempi/install \
+ 	--with-matlab-dir=$MATLAB_PATH \
+ 	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include \
+ 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi" \
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26034)
++++ ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26035)
+@@ -22,6 +22,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff	(revision 26035)
+@@ -20,6 +20,7 @@
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include  \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion	(revision 26035)
+@@ -21,6 +21,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-ampi-dir=${ISSM_DIR}/externalpackages/adjoinablempi/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-codipack
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 26035)
+@@ -19,6 +19,7 @@
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+@@ -26,8 +27,8 @@
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+ 	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+-	--with-medipack-dir="${ISSM_DIR}/externalpackages/medipack/install" \
+-	--with-codipack-dir="${ISSM_DIR}/externalpackages/codipack/install" \
++	--with-medipack-dir="${ISSM_DIR}/externalpackages/medipack/src" \
++	--with-codipack-dir="${ISSM_DIR}/externalpackages/codipack/src" \
+ '
+ 
+ #-------------------#
+Index: ../trunk-jpl/jenkins/ross-debian_linux-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 26035)
+@@ -20,6 +20,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26034)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26035)
+@@ -18,6 +18,7 @@
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
Index: /issm/oecreview/Archive/25834-26739/ISSM-26035-26036.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26035-26036.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26035-26036.diff	(revision 26740)
@@ -0,0 +1,2541 @@
+Index: ../trunk-jpl/src/wrappers/Triangle/Triangle.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/Triangle/Triangle.h	(revision 26035)
++++ ../trunk-jpl/src/wrappers/Triangle/Triangle.h	(revision 26036)
+@@ -18,7 +18,7 @@
+ 
+ #ifdef _HAVE_JAVASCRIPT_MODULES_
+ #undef _DO_NOT_LOAD_GLOBALS_ /*only module where this needs to be undefined, so as to 
+-							   not include IssmComm several times in the JavaScript module construct.*/
++							   not include IssmComm several times in the javascript Modle construct.*/
+ #endif
+ 
+ /*Header files: */
+Index: ../trunk-jpl/src/wrappers/javascript/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26035)
++++ ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26036)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(JAVASCRIPTWRAPPEREXT)
+@@ -59,7 +59,7 @@
+ AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER -D_WRAPPERS_
+ AM_CXXFLAGS +=  -D_HAVE_JAVASCRIPT_MODULES_ -fPIC
+ 
+-deps = ./libISSMJavascript.la ./libISSMApi.la ../../c/libISSMCore.la ../../c/libISSMModules.la
++deps = ./libISSMJavascript.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS) 
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26035)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26036)
+@@ -19,17 +19,10 @@
+ 	./io/FetchMatlabData.cpp \
+ 	./io/WriteMatlabData.cpp
+ 
+-ALL_CXXFLAGS = -fPIC -D_WRAPPERS_
++ALLCXXFLAGS= -fPIC -D_WRAPPERS_ $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
+-# Cannot have undefined symbols under msys2
+-if MSYS2
+-ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_
+-endif
+-
+-ALL_CXXFLAGS += $(CXXOPTFLAGS) $(CXXFLAGS)
+-
+ libISSMMatlab_la_SOURCES = $(io_sources)
+-libISSMMatlab_la_CXXFLAGS = ${ALL_CXXFLAGS}
++libISSMMatlab_la_CXXFLAGS= $(ALLCXXFLAGS)
+ #}}}
+ #api io{{{
+ if !WINDOWS
+@@ -38,12 +31,10 @@
+ noinst_LTLIBRARIES += libISSMApi.la
+ endif
+ 
+-if !MSYS2
+ api_sources= ./io/ApiPrintf.cpp
+ 
+ libISSMApi_la_SOURCES = $(api_sources)
+-libISSMApi_la_CXXFLAGS = ${ALL_CXXFLAGS}
+-endif
++libISSMApi_la_CXXFLAGS= $(ALLCXXFLAGS)
+ #}}}
+ #Wrappers {{{
+ lib_LTLIBRARIES += \
+@@ -90,23 +81,11 @@
+ deps = $(MATHLIB)
+ 
+ #Triangle library
+-TRI_CXXFLAGS = -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
++AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER -D_WRAPPERS_
+ 
+ #Matlab part
+-MEX_CXXFLAGS = -D_HAVE_MATLAB_MODULES_ $(MEXOPTFLAGS) $(MEXCXXFLAGS)
+-MEX_CPPFLAGS = $(MATLABINCL)
+-MEX_LDFLAGS = -module -shrext $(MEXEXT) -no-undefined
+-MEX_LIBADD = $(MEXLINKFLAGS) $(MEXLIB)
++AM_LDFLAGS = -module $(MEXLINK) -shrext ${EXEEXT} --export-dynamic -rdynamic -no-undefined
+ 
+-AM_CPPFLAGS += ${MEX_CPPFLAGS}
+-AM_CXXFLAGS = ${TRI_CXXFLAGS} ${MEX_CXXFLAGS}
+-AM_LDFLAGS = ${MEX_LDFLAGS}
+-AM_LIBADD = ${MEX_LIBADD}
+-
+-if !MSYS2
+-AM_LDFLAGS += --export-dynamic -rdynamic
+-endif
+-
+ if !VERSION
+ AM_LDFLAGS += -avoid-version
+ endif
+@@ -128,16 +107,12 @@
+ 
+ AM_CXXFLAGS += -D_HAVE_MATLAB_MODULES_ -fPIC
+ 
+-deps += ./libISSMMatlab.la ../../c/libISSMCore.la ../../c/libISSMModules.la
++deps += ./libISSMMatlab.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
+ 
+-if !MSYS2
+-deps += ./libISSMApi.la
++if WINDOWS
++deps += $(METISLIB)
+ endif
+ 
+-# if WINDOWS
+-# deps += $(METISLIB)
+-# endif
+-
+ if ADOLC
+ deps += $(ADOLCLIB)
+ endif
+@@ -146,146 +121,138 @@
+ deps += $(FLIBS) $(FORTRANLIB)
+ endif
+ 
+-# #MEXLIB needs to be the last (undefined references on larsen)
+-# deps += ${MEXLIB}
++#MEXLIB needs to be the last (undefined references on larsen)
++deps += ${MEXLIB}
+ 
+-# #Optimization flags:
+-# AM_CXXFLAGS += $(CXXOPTFLAGS)
++#Optimization flags:
++AM_CXXFLAGS += $(CXXOPTFLAGS)
+ #}}}
+ # Module sources and dependencies {{{
+ if !WINDOWS
+-libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
++libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+ endif
+ 
+-if VERSION
+-libISSMMatlab_la_LDFLAGS =
+-libISSMApi_la_LDFLAGS =
+-else
+-libISSMMatlab_la_LDFLAGS = -avoid-version
+-libISSMApi_la_LDFLAGS = -avoid-version
+-endif
+-
+ if STANDALONE_LIBRARIES
+-libISSMMatlab_la_LDFLAGS += -static
+-libISSMApi_la_LDFLAGS += -static
+-deps +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
++libISSMMatlab_la_LDFLAGS = -static
++libISSMApi_la_LDFLAGS = -static
++deps += $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+ endif
+ 
+ if !WINDOWS
+-libISSMApi_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
++libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+ endif
+ 
+ BamgConvertMesh_matlab_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp
+ BamgConvertMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgConvertMesh_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++BamgConvertMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ BamgMesher_matlab_la_SOURCES = ../BamgMesher/BamgMesher.cpp
+ BamgMesher_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgMesher_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++BamgMesher_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ BamgTriangulate_matlab_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp
+ BamgTriangulate_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgTriangulate_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++BamgTriangulate_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ if CHACO
+ Chaco_matlab_la_SOURCES = ../Chaco/Chaco.cpp
+ Chaco_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Chaco_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++Chaco_matlab_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ endif
+ 
+ ContourToMesh_matlab_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp
+ ContourToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToMesh_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++ContourToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ ContourToNodes_matlab_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp
+ ContourToNodes_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToNodes_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++ContourToNodes_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ CoordTransform_matlab_la_SOURCES = ../CoordTransform/CoordTransform.cpp
+ CoordTransform_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-CoordTransform_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++CoordTransform_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ DistanceToMaskBoundary_matlab_la_SOURCES = ../DistanceToMaskBoundary/DistanceToMaskBoundary.cpp
+ DistanceToMaskBoundary_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-DistanceToMaskBoundary_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++DistanceToMaskBoundary_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ ElementConnectivity_matlab_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp
+ ElementConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ElementConnectivity_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++ElementConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ ExpToLevelSet_matlab_la_SOURCES = ../ExpToLevelSet/ExpToLevelSet.cpp
+ ExpToLevelSet_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ExpToLevelSet_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++ExpToLevelSet_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ ExpSimplify_matlab_la_SOURCES = ../ExpSimplify/ExpSimplify.cpp
+ ExpSimplify_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ExpSimplify_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++ExpSimplify_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(NEOPZLIB)
+ 
+ InterpFromGridToMesh_matlab_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp
+ InterpFromGridToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromGridToMesh_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++InterpFromGridToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ InterpFromMesh2d_matlab_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp
+ InterpFromMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMesh2d_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++InterpFromMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ InterpFromMeshToGrid_matlab_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
+ InterpFromMeshToGrid_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToGrid_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++InterpFromMeshToGrid_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ InterpFromMeshToMesh2d_matlab_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
+ InterpFromMeshToMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ InterpFromMeshToMesh3d_matlab_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+ InterpFromMeshToMesh3d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ IssmConfig_matlab_la_SOURCES = ../IssmConfig/IssmConfig.cpp
+ IssmConfig_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-IssmConfig_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++IssmConfig_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB)
+ 
+ Kriging_matlab_la_SOURCES = ../Kriging/Kriging.cpp
+ Kriging_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Kriging_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++Kriging_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJLIB)
+ 
+ M1qn3_matlab_la_SOURCES = ../M1qn3/M1qn3.cpp
+ M1qn3_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-M1qn3_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++M1qn3_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(M1QN3LIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ MeshPartition_matlab_la_SOURCES = ../MeshPartition/MeshPartition.cpp
+ MeshPartition_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshPartition_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++MeshPartition_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ MeshProfileIntersection_matlab_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp
+ MeshProfileIntersection_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshProfileIntersection_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++MeshProfileIntersection_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ NodeConnectivity_matlab_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp
+ NodeConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-NodeConnectivity_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++NodeConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ PointCloudFindNeighbors_matlab_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
+ PointCloudFindNeighbors_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-PointCloudFindNeighbors_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++PointCloudFindNeighbors_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ PropagateFlagsFromConnectivity_matlab_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp
+ PropagateFlagsFromConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ Scotch_matlab_la_SOURCES = ../Scotch/Scotch.cpp
+ Scotch_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Scotch_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++Scotch_matlab_la_LIBADD = ${deps}  $(PETSCLIB) $(HDF5LIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(BLASLAPACKLIB)
+ 
+ ShpRead_matlab_la_SOURCES = ../ShpRead/ShpRead.cpp
+ ShpRead_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ShpRead_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++ShpRead_matlab_la_LIBADD = ${deps} $(SHAPELIBLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ Triangle_matlab_la_SOURCES = ../Triangle/Triangle.cpp
+ Triangle_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB) ${AM_LIBADD}
++Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ 
+ ProcessRifts_matlab_la_SOURCES = ../ProcessRifts/ProcessRifts.cpp
+ ProcessRifts_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ProcessRifts_matlab_la_LIBADD = ${deps} ${AM_LIBADD}
++ProcessRifts_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
+ #}}}
+Index: ../trunk-jpl/src/wrappers/matlab/include/wrapper_macros.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/include/wrapper_macros.h	(revision 26035)
++++ ../trunk-jpl/src/wrappers/matlab/include/wrapper_macros.h	(revision 26036)
+@@ -33,7 +33,7 @@
+ 	}
+ /*}}}*/
+ /* WRAPPER {{{*/
+-#define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) /* NOTE: In this case, modulename is thrown away in the macro expansion whereas it is used in for the Python wrappers (see also: src/wrappers/python/include/wrapper_macros.h, any result of `grep -r 'WRAPPER(' $ISSM_DIR/src)` */
++#define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) 
+ /*}}}*/
+ /* CHECKARGUMENTS {{{*/
+ #define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,functionpointer)
+Index: ../trunk-jpl/src/wrappers/python/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26035)
++++ ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26036)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+@@ -69,7 +69,7 @@
+ #	generate static libraries for external packages. Dynamic system libraries
+ #	will be linked to, whether we like it or not, if no static version is
+ #	available.
+-# - On macOC, static linking of binaries is not supported.
++# - On macOS, static linking of binaries is not supported.
+ #
+ if STANDALONE_MODULES
+ if MAC
+@@ -86,7 +86,7 @@
+ AM_CXXFLAGS += -DNPY_NO_DEPRECATED_API
+ endif
+ 
+-deps += ./libISSMPython.la ./libISSMApi.la ../../c/libISSMCore.la ../../c/libISSMModules.la
++deps += ./libISSMPython.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
+ 
+ if ADOLC
+ deps += $(ADOLCLIB)
+@@ -105,7 +105,7 @@
+ if STANDALONE_LIBRARIES
+ libISSMPython_la_LDFLAGS = -static
+ libISSMApi_la_LDFLAGS = -static
+-deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
++deps += $(DAKOTALIB) $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+ endif
+ 
+ libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB)
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 26035)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 26036)
+@@ -6,10 +6,6 @@
+ # been completed. Finally, results of the build and tests are emailed to the
+ # members of the ISSM development team.
+ #
+-# NOTE:
+-# - Variable OS is set in environment by running 
+-#	`source $ISSM_DIR/etc/environment.sh`.
+-#
+ # TODO:
+ # - Rename TEMP to something more descriptive (ensure first that other parts of
+ #	the build system do not rely on this name)
+@@ -17,9 +13,9 @@
+ ################################################################################
+ 
+ echo "Cleaning up execution directory"
+-rm -rf ${ISSM_DIR}/execution/*
+-rm -rf ${ISSM_DIR}/nightlylog
+-mkdir ${ISSM_DIR}/nightlylog
++rm -rf $ISSM_DIR/execution/*
++rm -rf $ISSM_DIR/nightlylog
++mkdir $ISSM_DIR/nightlylog
+ 
+ #Server URI
+ SERVER='https://ross.ics.uci.edu/jenkins'
+@@ -56,13 +52,20 @@
+ 	exit 1
+ fi
+ 
++#Get Operating system (OS) name{{{
++OS=$(uname -s)
++if [[ $OS == CYGWIN* ]]; then
++	OS="win";
++fi
++#}}}
++
+ #Install ISSM
+ #Determining installation type depending on svn changes{{{
+ echo "======================================================";
+ echo "             Determining Installation type            "
+ echo "======================================================";
+-if [ -a ${ISSM_DIR}/svn_revision_old ]; then
+-	SVN_PREVIOUS=$(cat ${ISSM_DIR}/svn_revision_old)
++if [ -a $ISSM_DIR/svn_revision_old ]; then
++	SVN_PREVIOUS=$(cat $ISSM_DIR/svn_revision_old)
+ 	SVN_CURRENT=$SVN_REVISION_1
+ 	echo "Previous revision number: $SVN_PREVIOUS"
+ 	echo "Current revision number: $SVN_CURRENT"
+@@ -70,7 +73,7 @@
+ 	# 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
++	#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
+@@ -77,15 +80,15 @@
+ 	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...)
+-	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > ${ISSM_DIR}/TEMP
++	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > $ISSM_DIR/TEMP
+ 	#cat changes | grep 'document_edit' |sed -e 's/document_edit.png/document_edit.png\
+-		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > ${ISSM_DIR}/TEMP
+-	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > ${ISSM_DIR}/TEMP
++		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > $ISSM_DIR/TEMP
++	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
+ 
+ 	# Print list of changed files
+ 	echo "   "
+ 	echo "List of updated files"
+-	cat ${ISSM_DIR}/TEMP
++	cat $ISSM_DIR/TEMP
+ 	echo "   "
+ 
+ 	###################################
+@@ -95,7 +98,7 @@
+ 
+ 	# 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
++	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep externalpackages)" ]; then
+ 		echo "  -- checking for changed externalpackages... yes"
+ 		ISSM_EXTERNALPACKAGES="yes"
+ 	else
+@@ -105,8 +108,8 @@
+ 
+ 	# If the Makefile or m4 diirectory were changed in any way or if certain
+ 	# binary files from a previous compilation do not exist, reconfigure
+-	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
+-		[ ! -f "${ISSM_DIR}/bin/issm.exe" ] && [ ! -f "${ISSM_DIR}/bin/issm-bin.js" ] ||
++	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
++		[ ! -f "$ISSM_DIR/bin/issm.exe" ] && [ ! -f "$ISSM_DIR/bin/issm-bin.js" ] ||
+ 		[ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then
+ 		echo "  -- checking for reconfiguration... yes"
+ 		ISSM_RECONFIGURE="yes"
+@@ -116,7 +119,7 @@
+ 	fi
+ 
+ 	# If source files were changed in any way, recompile
+-	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
++	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
+ 		[ "$ISSM_RECONFIGURE" == "yes" ]; then
+ 		echo "  -- checking for recompilation... yes"
+ 		ISSM_COMPILATION="yes"
+@@ -127,7 +130,7 @@
+ 
+ 	# Cleanup
+ 	rm changes
+-	rm ${ISSM_DIR}/TEMP
++	rm $ISSM_DIR/TEMP
+ else
+ 	echo "Previous revision not found, this must be a fresh install"
+ 	echo "  -- checking for changed externalpackages... yes"
+@@ -140,7 +143,7 @@
+ 
+ echo " "
+ echo "Recording current svn version: $SVN_REVISION_1"
+-echo $SVN_REVISION_1 > ${ISSM_DIR}/svn_revision_old
++echo $SVN_REVISION_1 > $ISSM_DIR/svn_revision_old
+ #}}}
+ 
+ ## External Packages
+@@ -150,16 +153,16 @@
+ NUMPACKAGES=$(($(echo ${EXTERNALPACKAGES} | wc -w ) / 2))
+ 
+ #Jenkins XML files for individual packages
+-EXTERNAL_TEST_FILE="${ISSM_DIR}/nightlylog/results/external.xml"
+-mkdir -p ${ISSM_DIR}/nightlylog/results
++EXTERNAL_TEST_FILE="$ISSM_DIR/nightlylog/results/external.xml"
++mkdir -p $ISSM_DIR/nightlylog/results
+ echo "<testsuite tests=\"$NUMPACKAGES\">" > $EXTERNAL_TEST_FILE
+ 
+ # Need a source here for when builds start midway through installation of externalpackages.
+-source ${ISSM_DIR}/etc/environment.sh
++source $ISSM_DIR/etc/environment.sh
+ 
+-if [ "${OS}" == CYGWIN* ]; then
++if [ "$OS" == "win" ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
+-	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
++	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
+ fi
+ 
+ EXTERNALPACKAGES_FAILED=0;
+@@ -171,8 +174,8 @@
+ 	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
+ 
+ 	#install if requested or if previous install has not been successful
+-	if [ "${ISSM_EXTERNALPACKAGES}" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
+-		cd ${ISSM_DIR}/externalpackages/$PACKAGENAME
++	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
++		cd $ISSM_DIR/externalpackages/$PACKAGENAME
+ 
+ 		echo "======================================================";
+ 		echo "       Installing $PACKAGENAME                        ";
+@@ -179,7 +182,7 @@
+ 		echo "======================================================";
+ 
+ 		./$PACKAGEINST $NUMCPUS_INSTALL &> compil.log
+-		if [ $? -ne 0 ] && [ "${PACKAGENAME}" != "boost" ]; then
++		if [ $? -ne 0 ] && [ "$PACKAGENAME" != "boost" ]; then
+ 			cat compil.log
+ 			echo "======================================================";
+ 			echo "    ERROR: installation of $PACKAGENAME failed        ";
+@@ -193,7 +196,7 @@
+ 		else
+ 			echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\"/>" >> $EXTERNAL_TEST_FILE
+ 		fi
+-		source ${ISSM_DIR}/etc/environment.sh
++		source $ISSM_DIR/etc/environment.sh
+ 
+ 		#If external package is rebuilt, we also need to recompile
+ 		ISSM_RECONFIGURE="yes"
+@@ -216,11 +219,11 @@
+ fi
+ 
+ # Source here to include any newly installed externalpackages on the path.
+-source ${ISSM_DIR}/etc/environment.sh
++source $ISSM_DIR/etc/environment.sh
+ 
+-if [ "${OS}" == CYGWIN* ]; then
++if [ "$OS" == "win" ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
+-	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
++	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
+ fi
+ 
+ # Set CXX/CC flags for JS runs after exnteralpackages to avoid conflicts during their compilation
+@@ -240,14 +243,14 @@
+ 	export RANLIB=emranlib
+ 	#export EMCC_DEBUG=1 # Uncomment to enable debugging
+ 	export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14 to avoid undefined symbol warnings from our Fortran object files being treated as errors
+-	source ${ISSM_DIR}/externalpackages/emscripten/install/emsdk_env.sh
++	source $ISSM_DIR/externalpackages/emscripten/install/emsdk_env.sh
+ fi
+ 
+ #}}}
+ #ISSM compilation yes/no                (ISSM_COMPILATION) {{{
+-if [ "${ISSM_COMPILATION}" == "yes" ]; then
++if [ "$ISSM_COMPILATION" == "yes" ]; then
+ 	cd $ISSM_DIR
+-	if [ "${ISSM_RECONFIGURE}" == "yes" ]; then
++	if [ "$ISSM_RECONFIGURE" == "yes" ]; then
+ 		echo "======================================================";
+ 		echo "             Cleaning up and reconfiguring            "
+ 		echo "======================================================";
+@@ -258,7 +261,7 @@
+ 			echo "autoreconf failed!"
+ 			exit 1
+ 		fi
+-		eval "./configure ${ISSM_CONFIG}"
++		eval "./configure $ISSM_CONFIG"
+ 		if [ $? -ne 0 ]; then
+ 			echo "ISSM configuration failed (see options below)"
+ 			echo $ISSM_CONFIG
+@@ -272,13 +275,9 @@
+ 	echo "                    Compiling ISSM                    "
+ 	echo "======================================================"
+ 	if [ $NUMCPUS_INSTALL -gt 1 ]; then
+-		echo "Making with ${NUMCPUS_INSTALL} cpus"
+-
+-		# To debug compilation/linking, add 'V=1' option to the call to make
+-		#make -j $NUMCPUS_INSTALL V=1
++		echo "Making with " $NUMCPUS_INSTALL " cpus"
+ 		make -j $NUMCPUS_INSTALL
+ 	else
+-		#make V=1
+ 		make
+ 	fi
+ 	if [ $? -ne 0 ] && [ $NUMCPUS_INSTALL -gt 1 ]; then
+@@ -292,7 +291,8 @@
+ 		exit 1
+ 	fi
+ 	make install
+-elif [ "${ISSM_COMPILATION}" == "no" ]; then
++elif [ "$ISSM_COMPILATION" == "no" ]
++then
+ 	echo "Skipping ISSM compilation"
+ else
+ 	echo "ISSM_COMPILATION supported values are: yes and no. Exiting..." >&2 # Error message to stderr.
+@@ -310,13 +310,13 @@
+ 	#Launch all tests on different cpus
+ 	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
+ 		#Launch matlab and the nightly run script
+-		cat > ${ISSM_DIR}/nightlylog/matlab_run$i.m << EOF
++		cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
+ 		warning off %necessary to avoid a log of several Go for parallel runs
+ 		try,
+-			$(if [ "${MATLAB_NROPTIONS}" = "" ]; then
+-				echo "runme('output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
++			$(if [ "$MATLAB_NROPTIONS" = "" ]; then
++				echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
+ 			else
+-				echo "runme(${MATLAB_NROPTIONS},'output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
++				echo "runme($MATLAB_NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
+ 			fi)
+ 		catch me,
+ 			%An error occured, get report and exit
+@@ -331,44 +331,36 @@
+ 		exit
+ EOF
+ 		cd $ISSM_DIR/test/NightlyRun
+-		if [[ "${OS}" == CYGWIN* || "${OS}" == MINGW* ]]; then
+-			$MATLAB_PATH/bin/matlab -nodesktop -nosplash -nojvm -r "addpath ${ISSM_DIR_WIN}/src/m/dev; devpath; addpath ${ISSM_DIR_WIN}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR_WIN}/nightlylog/matlab_log$i.log &
++		if [ "$OS" = "win" ]; then
++			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
+ 		else
+-			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath ${ISSM_DIR}/src/m/dev; devpath; addpath ${ISSM_DIR}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR}/nightlylog/matlab_log$i.log &
++			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
+ 		fi
+ 	done
+ 
+-	# Wait for MATLAB to exit
+-	if [[ "${OS}" == CYGWIN* ]]; then
++	#wait until matlab closes
++	if [ "$OS" = "win" ]; then
+ 		sleep 5;
+-		echo "Waiting for MATLAB to exit"
++		echo "Waiting for matlab on windows"
+ 		pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+ 		echo '-----------------------------'
+-		echo "pid: ${pid}"
++		echo "pid: $pid"
+ 		echo '-----------------------------'
+-		while [ -n "${pid}" ]; do
++		while [ -n "$pid" ]; do
+ 			pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+ 			sleep 1;
+ 		done
+ 		echo "DONE!"
+-	elif [[ "${OS}" == MINGW* ]]; then
+-		# NOTE: The PID query used here may work as well on Cygwin. If so, combine the two conditional blocks.
+-		sleep 5;
+-		echo "Waiting for MATLAB to exit"
+-		pid=$(ps -W | grep MATLAB | awk '{print $1}')
+-		echo '-----------------------------'
+-		echo "pid: ${pid}"
+-		echo '-----------------------------'
+-		while [ -n "${pid}" ]; do
+-			pid=$(ps -W | grep MATLAB | awk '{print $1}')
+-			sleep 1;
+-		done
+ 	else
+ 		wait
+ 	fi
+ 
+-	# Concatenate logs
+-	cd $ISSM_DIR/nightlylog
++	#concatenate reports
++	cd $ISSM_DIR/nightlylog/
++	#echo 'CHECKING NIGHTLYLOG DIRECTORY'
++	#echo '-----------------------------'
++	#ls -la
++	#echo '-----------------------------'
+ 
+ 	if [ -f matlab_log.log ]; then
+ 		rm matlab_log.log
+@@ -375,7 +367,7 @@
+ 	fi
+ 
+ 	for job in `jobs -p`; do
+-		#echo "Waiting on: ${job}" # Commented out because it really has nothing to do with MATLAB processes
++		echo "Waiting on: $job"
+ 		wait $job
+ 	done
+ 
+@@ -394,7 +386,7 @@
+ # {{{
+ if [ $PYTHON_TEST -eq 1 ]; then
+ 	#Launch all tests on different cpus
+-	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
++	export PYTHONPATH="$ISSM_DIR/src/m/dev"
+ 	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+ 	export PYTHONUNBUFFERED=1 #we don't want python to buffer otherwise issm.exe output is not captured
+ 	for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+@@ -405,8 +397,8 @@
+ 		echo "--------------Running Python test for Rank $i---------------------"
+ 	done
+ 
+-	# Concatenate logs
+-	cd $ISSM_DIR/nightlylog
++	# concatenate reports
++	cd $ISSM_DIR/nightlylog/
+ 	if [ -f python_log.log ]; then
+ 		rm python_log.log
+ 	fi
+@@ -413,7 +405,7 @@
+ 
+ 	for job in `jobs -p`
+ 	do
+-		echo "Waiting on: ${job}"
++		echo "Waiting on: $job"
+ 		wait $job
+ 	done
+ 
+@@ -436,7 +428,7 @@
+ fi
+ # }}}
+ 
+-# Process logs to be JUnit compatible
++#process logs to be junit compatible
+ #{{{
+ cd $ISSM_DIR/nightlylog
+ source $ISSM_EXT_DIR/shell2junit/install/bin/sh2ju.sh
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26035)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26036)
+@@ -30,7 +30,7 @@
+ 	else
+ 		PACKAGE_DATE="unknown"
+ 	fi
+-	AC_DEFINE_UNQUOTED([PACKAGE_BUILD_DATE], "${PACKAGE_DATE}", [build date])
++	AC_DEFINE_UNQUOTED(PACKAGE_BUILD_DATE, "$PACKAGE_DATE", [build date])
+ 	AC_MSG_RESULT([${PACKAGE_DATE}])
+ 
+ 	dnl User name
+@@ -45,7 +45,7 @@
+ 			user_name =`(whoami) 2>/dev/null` || user_name=unknown
+ 		fi
+ 	fi
+-	AC_DEFINE_UNQUOTED([USER_NAME], "${user_name}", [user name])
++	AC_DEFINE_UNQUOTED(USER_NAME, "$user_name", [user name])
+ 	AC_MSG_RESULT([${user_name}])
+ 
+ 	AC_MSG_CHECKING([host full OS name and version])
+@@ -54,15 +54,15 @@
+ 		dnl linux is linux is linux, regardless of RMS
+ 		linux-gnu* | lignux* )	host_os=linux ;;
+ 	esac
+-	AC_DEFINE_UNQUOTED([HOST_OS], "${host_os}", [host full OS name and version])
++	AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", [host full OS name and version])
+ 	AC_MSG_RESULT([${host_os}])
+ 
+ 	AC_MSG_CHECKING([host cpu])
+-	AC_DEFINE_UNQUOTED([HOST_CPU], "${host_cpu}", [host CPU])
++	AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [host CPU])
+ 	AC_MSG_RESULT([${host_cpu}])
+ 
+ 	AC_MSG_CHECKING([vendor])
+-	AC_DEFINE_UNQUOTED([HOST_VENDOR], "${host_vendor}", [host vendor])
++	AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor", [host vendor])
+ 	AC_MSG_RESULT([${host_vendor}])
+ 
+ 	AC_MSG_CHECKING([host OS name])
+@@ -72,7 +72,7 @@
+ 		dnl linux is linux is linux, regardless of RMS.
+ 		linux-gnu* | lignux* )	host_os_name=linux ;;
+ 	esac
+-	AC_DEFINE_UNQUOTED([HOST_OS_NAME], "${host_os_name}", [host OS name])
++	AC_DEFINE_UNQUOTED(HOST_OS_NAME, "$host_os_name", [host OS name])
+ 	AC_MSG_RESULT([${host_os_name}])
+ 
+ 	dnl Parse out the OS version of the host
+@@ -81,7 +81,7 @@
+ 	if test -z "$host_os_version"; then
+ 		host_os_version=`(uname -r) 2>/dev/null` || host_os_version=unknown
+ 	fi
+-	AC_DEFINE_UNQUOTED([HOST_OS_VERSION], "${host_os_version}", [host OS version])
++	AC_DEFINE_UNQUOTED(HOST_OS_VERSION, "$host_os_version", [host OS version])
+ 	AC_MSG_RESULT([${host_os_version}])
+ 
+ 	dnl Determine host architecture (different than CPU)
+@@ -94,7 +94,7 @@
+ 		sun )	host_arch=`(arch) 2>/dev/null` || host_arch=unknown ;;
+ 		i?86 )	host_arch=i386 ;; # all x86 should show up as i386
+ 	esac
+-	AC_DEFINE_UNQUOTED([HOST_ARCH], "${host_arch}", [host archictecture])
++	AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_arch", [host archictecture])
+ 	AC_MSG_RESULT([${host_arch}])
+ 
+ 	dnl }}}
+@@ -218,10 +218,9 @@
+ 	else
+ 		AC_MSG_RESULT([no])
+ 	fi
+-	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], ${SYSTEM_FMEMOPEN}, [does system copy of libc have fmemopen])
++	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], $SYSTEM_FMEMOPEN, [does system copy of libc have fmemopen])
+ 	AM_CONDITIONAL([SYSTEM_HAS_FMEMOPEN], [test "${SYSTEM_FMEMOPEN}" == "1"])
+ 
+-	IS_MSYS2=no
+ 	IS_WINDOWS=no
+ 	AC_MSG_CHECKING([for vendor compilers])
+ 	if test -n "${VENDOR}"; then
+@@ -318,34 +317,20 @@
+ 			export CXXFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict -std=c++11"
+ 			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
+ 			AC_DEFINE([_HAVE_RESTRICT_], [1], [with restrict buffers])
+-		elif test "${VENDOR}" == "win-msys2"; then
+-			export LDFLAGS="${LDFLAGS} -no-undefined"
+-			export OSLIBS="-Wl,-L/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0 -Wl,-L/mingw64/x86_64-w64-mingw32/lib -Wl,-lstdc++ -Wl,-lgfortran -Wl,-lmingw32 -Wl,-lgcc_s -Wl,-lmoldname -Wl,-lmingwex -Wl,-lmsvcrt -Wl,-lm -Wl,-lpthread -Wl,-lshell32 -Wl,-luser32 -Wl,-lgdi32 -Wl,-luser32 -Wl,-ladvapi32 -Wl,-lkernel32 -Wl,-lquadmath -Wl,-lstdc++ -Wl,-lgcc"
+-			IS_MSYS2=yes
+ 		else
+ 			AC_MSG_ERROR([unknown compiler vendor!])
+ 		fi
+ 	fi
+-	dnl Set default standard for C++
+-	if test "${CXXFLAGS}" == ""; then
+-		export CXXFLAGS="-std=C++11"
+-	fi
+ 	AC_SUBST([OSLIBS])
+ 	AC_MSG_RESULT([done])
+ 
+-	AC_MSG_CHECKING([if this is a MSVC (Windows) build])
++	AC_MSG_CHECKING([if this is a Windows build])
+ 	AM_CONDITIONAL([WINDOWS], [test "x${IS_WINDOWS}" == "xyes"])
+ 	AC_MSG_RESULT([${IS_WINDOWS}])
+-
+-	AC_MSG_CHECKING([if this is a MSYS2 (Windows) build])
+-	AM_CONDITIONAL([MSYS2], [test "x${IS_MSYS2}" == "xyes"])
+-	AC_MSG_RESULT([${IS_MSYS2}])
+-	AC_DEFINE([_IS_MSYS2_], [1], [is a MSYS2 (Windows) build])
+ 	dnl }}}
+ 	dnl MATLAB{{{
+ 
+ 	dnl See if MATLAB has been provided
+-	AC_MSG_CHECKING([for MATLAB])
+ 	AC_ARG_WITH(
+ 		[matlab-dir],														dnl feature
+ 		AS_HELP_STRING([--with-matlab-dir=DIR], [MATLAB root directory]),	dnl help string
+@@ -352,6 +337,7 @@
+ 		[MATLAB_ROOT=${withval}],											dnl action if given
+ 		[MATLAB_ROOT="no"]													dnl action if not given
+ 	)
++	AC_MSG_CHECKING([for MATLAB])
+ 	if test "x${MATLAB_ROOT}" == "xno"; then
+ 		HAVE_MATLAB=no
+ 	else
+@@ -370,7 +356,7 @@
+ 	if test "x${HAVE_MATLAB}" == "xyes"; then
+ 		AC_DEFINE([_HAVE_MATLAB_], [1], [with MATLAB in ISSM src])
+ 
+-		dnl Set MEX* variable
++		dnl Set MEXLIB, MEXLINK, and MEXEXT
+ 		AC_MSG_CHECKING([MATLAB's mex compilation flags])
+ 
+ 		dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
+@@ -380,55 +366,32 @@
+ 			*cygwin*)
+ 				if test "${VENDOR}" == "intel-win7-32"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MEXEXT=`${MATLAB_ROOT}/bin/mexext.bat`
+ 					MEXEXT=".${MEXEXT}"
+ 				elif test "${VENDOR}" == "intel-win7-64"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MEXEXT=".mexw64"
+ 				elif test "${VENDOR}" == "MSVC-Win64" || test "${VENDOR}" == "MSVC-Win64-par"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINKFLAGS="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINK="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MATLABINCL="-I`cygpath -m ${MATLAB_ROOT}/extern/include`"
+ 					MEXEXT=".mexw64"
+ 				fi
+ 			;;
+-			*mingw*)
+-				if test "${IS_MSYS2}" == "yes"; then
+-					dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
+-					MEXEXT=".mexw64"
+-					MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+-					MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
+-					MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
+-					MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
+-					MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
+-					MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
+-					MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
+-				fi
+-			;;
+-			*msys*)
+-				dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
+-				MEXEXT=".mexw64"
+-				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+-				MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
+-				MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
+-				MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
+-				MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
+-				MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
+-				MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
+-			;;
+ 			*)
+-				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
+ 				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+-				MEXLINKFLAGS=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
++				MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
+ 				MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
++				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
++				dnl version 2014 and up
+ 				if test -z "${MEXEXT}"; then
+ 					echo "#include <mex.h>" > conftest.cpp
+ 					echo "void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}" >> conftest.cpp
+ 					${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
+ 					rm -f conftest.cpp
+-					MEXLINKFLAGS=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
++					MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
+ 					MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
+ 					MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
+ 					if test -z "${MEXEXT}"; then
+@@ -438,8 +401,8 @@
+ 				fi
+ 
+ 				dnl Make sure mexFunction.map is not in MEXLIB to avoid problems with global variables
+-				dnl MEXLINKFLAGS=$(echo ${MEXLINKFLAGS} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
+-				MEXLINKFLAGS="" dnl We actually don't need MEXLINK????
++				dnl MEXLINK=$(echo ${MEXLINK} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
++				MEXLINK="" dnl We actually don't need MEXLINK????
+ 			;;
+ 		esac
+ 		AC_MSG_RESULT([done])
+@@ -447,17 +410,14 @@
+ 			AC_MSG_ERROR([Couldn't use MATLAB's mex... check manual compilation with MATLAB or error message above])
+ 		fi
+ 
+-		AC_SUBST([MEXEXT])
+-		AC_SUBST([MEXOPTFLAGS])
+-		AC_SUBST([MEXCFLAGS])
+-		AC_SUBST([MEXCXXFLAGS])
+ 		AC_SUBST([MATLABINCL])
+-		AC_SUBST([MEXLINKFLAGS])
++		MATLABWRAPPEREXT=${MEXEXT}
++		AC_SUBST([MATLABWRAPPEREXT])
+ 		AC_SUBST([MEXLIB])
++		AC_SUBST([MEXLINK])
+ 	fi
+ 	dnl }}}
+ 	dnl JavaScript{{{
+-	AC_MSG_CHECKING([for JavaScript])
+ 	AC_ARG_WITH(
+ 		[javascript],
+ 		AS_HELP_STRING([--with-javascript], [compile JavaScript wrappers? (default: no)]),
+@@ -464,6 +424,7 @@
+ 		[JAVASCRIPT=${withval}],
+ 		[JAVASCRIPT="no"]
+ 	)
++	AC_MSG_CHECKING([for JavaScript])
+ 	if test "x${JAVASCRIPT}" == "xno"; then
+ 		HAVE_JAVASCRIPT=no
+ 	else
+@@ -476,7 +437,6 @@
+ 	AC_SUBST([JAVASCRIPTWRAPPEREXT])
+ 	dnl }}}
+ 	dnl Triangle {{{
+-	AC_MSG_CHECKING([for triangle])
+ 	AC_ARG_WITH(
+ 		[triangle-dir],
+ 		AS_HELP_STRING([--with-triangle-dir=DIR], [Triangle root directory]),
+@@ -483,6 +443,7 @@
+ 		[TRIANGLE_ROOT=${withval}],
+ 		[TRIANGLE_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for triangle])
+ 	if test "x${TRIANGLE_ROOT}" == "xno"; then
+ 		HAVE_TRIANGLE=no
+ 	else
+@@ -521,22 +482,6 @@
+ 					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+ 				fi
+ 			;;
+-			*mingw*)
+-				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
+-					dnl Link to the object file, not the library
+-					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
+-				else
+-					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+-				fi
+-			;;
+-			*msys*)
+-				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
+-					dnl Link to the object file, not the library
+-					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
+-				else
+-					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+-				fi
+-			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_TRIANGLE_], [1], [with Triangle in ISSM src])
+ 		AC_SUBST([TRIANGLEINCL])
+@@ -544,7 +489,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Boost{{{
+-	AC_MSG_CHECKING([for Boost])
+ 	AC_ARG_WITH(
+ 		[boost-dir],
+ 		AS_HELP_STRING([--with-boost-dir=DIR], [Boost root directory]),
+@@ -551,6 +495,7 @@
+ 		[BOOST_ROOT=${withval}],
+ 		[BOOST_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for Boost])
+ 	if test "x${BOOST_ROOT}" == "xno"; then
+ 		HAVE_BOOST=no
+ 	else
+@@ -577,7 +522,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Dakota{{{
+-	AC_MSG_CHECKING([for Dakota])
+ 	AC_ARG_WITH(
+ 		[dakota-dir],
+ 		AS_HELP_STRING([--with-dakota-dir=DIR], [Dakota root directory]),
+@@ -584,6 +528,7 @@
+ 		[DAKOTA_ROOT=${withval}],
+ 		[DAKOTA_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for Dakota])
+ 	if test "x${DAKOTA_ROOT}" == "xno"; then
+ 		HAVE_DAKOTA=no
+ 	else
+@@ -601,7 +546,7 @@
+ 
+ 		AC_MSG_CHECKING(for Dakota version)
+ 		dnl TODO:	Check if this method applies to all other versions of 
+-		dnl			Dakota (it should as long as the Dakota binaries have been 
++		dnl			Dakota (it should as long as the Dakota binaries have been
+ 		dnl 		compiled). If so, we can remove the other methods of 
+ 		dnl			getting the version.
+ 		dnl
+@@ -618,7 +563,7 @@
+ 			AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
+ 		fi
+ 		AC_MSG_RESULT([${DAKOTA_VERSION}])
+-		AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_], ${DAKOTA_VERSION}, [Dakota version number])
++		AC_DEFINE_UNQUOTED(_DAKOTA_VERSION_, "${DAKOTA_VERSION}", [Dakota version number])
+ 
+ 		DAKOTAFLAGS=""
+ 
+@@ -733,13 +678,13 @@
+ 		esac
+ 		AC_MSG_CHECKING(for Dakota major version)
+ 		AC_MSG_RESULT(${DAKOTA_MAJOR})
+-		AC_DEFINE_UNQUOTED([_DAKOTA_MAJOR_], ${DAKOTA_MAJOR}, [Dakota major version number])
++		AC_DEFINE_UNQUOTED(_DAKOTA_MAJOR_, $DAKOTA_MAJOR, [Dakota major version number])
+ 		AC_MSG_CHECKING(for Dakota minor version)
+ 		AC_MSG_RESULT(${DAKOTA_MINOR})
+-		AC_DEFINE_UNQUOTED([_DAKOTA_MINOR_], ${DAKOTA_MINOR}, [Dakota minor version number])
++		AC_DEFINE_UNQUOTED(_DAKOTA_MINOR_, $DAKOTA_MINOR, [Dakota minor version number])
+ 		AC_MSG_CHECKING(for Dakota build version)
+ 		AC_MSG_RESULT(${DAKOTA_BUILD})
+-		AC_DEFINE_UNQUOTED([_DAKOTA_BUILD_], ${DAKOTA_BUILD}, [Dakota build version number])
++		AC_DEFINE_UNQUOTED(_DAKOTA_BUILD_, $DAKOTA_BUILD, [Dakota build version number])
+ 
+ 		AC_DEFINE([_HAVE_DAKOTA_], [1], [with Dakota in ISSM src])
+ 		AC_SUBST([DAKOTAINCL])
+@@ -749,7 +694,6 @@
+ 	AM_CONDITIONAL([ISSM_DAKOTA], [test "x${DAKOTA_MAJOR}" == "x6"])
+ 	dnl }}}
+ 	dnl Python{{{
+-	AC_MSG_CHECKING([for Python])
+ 	AC_ARG_WITH(
+ 		[python-dir],
+ 		AS_HELP_STRING([--with-python-dir=DIR], [Python root directory]),
+@@ -763,6 +707,7 @@
+ 		[PYTHON_VERSION=${withval}],
+ 		[PYTHON_VERSION="no"]
+ 	)
++	AC_MSG_CHECKING([for Python])
+ 	if test "x${PYTHON_ROOT}" == "xno"; then
+ 		HAVE_PYTHON=no
+ 		HAVE_PYTHON3=no
+@@ -789,7 +734,7 @@
+ 		fi
+ 		dnl Determine major version
+ 		PYTHON_MAJOR=${PYTHON_VERSION%.*}
+-		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_], ${PYTHON_MAJOR}, [Python version major])
++		AC_DEFINE_UNQUOTED(_PYTHON_MAJOR_, $PYTHON_MAJOR, [Python version major])
+ 		if test "x${PYTHON_MAJOR}" == "x3"; then
+ 			HAVE_PYTHON3="yes"
+ 		else
+@@ -805,7 +750,7 @@
+ 		elif test -f "${PYTHON_ROOT}/include/python${PYTHON_VERSION}m/Python.h"; then
+ 			PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
+ 		else
+-			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
++			AC_MSG_ERROR([Python.h not found, locate this file and contact ISSM developers]);
+ 		fi
+ 		AC_MSG_RESULT([found])
+ 		if test "x${PYTHON_MAJOR}" == "x3"; then
+@@ -818,18 +763,12 @@
+ 			*cygwin*)
+ 				PYTHONLINK="-shared"
+ 			;;
+-			*darwin*)
+-				PYTHONLINK="-dynamiclib"
+-			;;
+ 			*linux*)
+ 				PYTHONLINK="-shared"
+ 			;;
+-			*mingw*)
+-				PYTHONLINK="-shared"
++			*darwin*)
++				PYTHONLINK="-dynamiclib"
+ 			;;
+-			*msys*)
+-				PYTHONLINK="-shared"
+-			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_PYTHON_], [1], [with Python in ISSM src])
+ 		AC_SUBST([PYTHONINCL])
+@@ -841,16 +780,10 @@
+ 	AM_CONDITIONAL([PYTHON3], [test "x${HAVE_PYTHON3}" == "xyes"])
+ 	dnl }}}
+ 	dnl NumPy{{{
+-	dnl NOTE: You can find NumPy by running,
+-	dnl
+-	dnl		>>> import numpy
+-	dnl		>>> numpy.__file__
+-	dnl
+ 	dnl TODO:
+ 	dnl - Replace references to python-numpy with numpy (and similar terms)
+ 	dnl	  project-wide
+ 	dnl
+-	AC_MSG_CHECKING(for python-numpy)
+ 	AC_ARG_WITH(
+ 		[python-numpy-dir],
+ 		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
+@@ -857,6 +790,14 @@
+ 		[PYTHON_NUMPY_ROOT=${withval}],
+ 		[PYTHON_NUMPY_ROOT="no"]
+ 	)
++
++	dnl NOTE: You can find NumPy by running,
++	dnl
++	dnl		>>> import numpy
++	dnl		>>> numpy.__file__
++	dnl
++
++	AC_MSG_CHECKING(for python-numpy)
+ 	if test "x${PYTHON_NUMPY_ROOT}" == "xno"; then
+ 		HAVE_PYTHON_NUMPY=no
+ 	else
+@@ -875,7 +816,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Chaco{{{
+-	AC_MSG_CHECKING([for Chaco])
+ 	AC_ARG_WITH(
+ 		[chaco-dir],
+ 		AS_HELP_STRING([--with-chaco-dir=DIR], [Chaco root directory]),
+@@ -882,6 +822,7 @@
+ 		[CHACO_ROOT=${withval}],
+ 		[CHACO_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for Chaco])
+ 	if test "x${CHACO_ROOT}" == "xno"; then
+ 		HAVE_CHACO=no
+ 	else
+@@ -903,7 +844,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl ESMF{{{
+-	AC_MSG_CHECKING([for ESMF])
+ 	AC_ARG_WITH(
+ 		[esmf-dir],
+ 		AS_HELP_STRING([--with-esmf-dir=DIR], [ESMF root directory]),
+@@ -910,6 +850,7 @@
+ 		[ESMF_ROOT=${withval}],
+ 		[ESMF_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for ESMF])
+ 	if test "x${ESMF_ROOT}" == "xno"; then
+ 		HAVE_ESMF=no
+ 	else
+@@ -931,7 +872,6 @@
+ 	AM_CONDITIONAL([ESMF], [test "x${HAVE_ESMF}" == "xyes"])
+ 	dnl }}}
+ 	dnl CoDiPack{{{
+-	AC_MSG_CHECKING([for CoDiPack])
+ 	AC_ARG_WITH(
+ 		[codipack-dir],
+ 		AS_HELP_STRING([--with-codipack-dir=DIR], [CoDiPack root directory]),
+@@ -938,6 +878,7 @@
+ 		[CODIPACK_ROOT=${withval}],
+ 		[CODIPACK_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for CoDiPack])
+ 	if test "x${CODIPACK_ROOT}" == "xno"; then
+ 		HAVE_CODIPACK=no
+ 	else
+@@ -959,7 +900,6 @@
+ 	AM_COND_IF(CODIPACK, [CXXFLAGS+=" -std=c++11"])
+ 	dnl }}}
+ 	dnl Tape Allocation {{{
+-	AC_MSG_CHECKING(for tape allocation)
+ 	AC_ARG_ENABLE(
+ 		[tape-alloc],																dnl feature
+ 		AS_HELP_STRING([--enable-tape-alloc], [turn tape allocation support on]),
+@@ -966,6 +906,7 @@
+ 		[enable_tape_alloc=${enableval}],
+ 		[enable_tape_alloc=no]
+ 	)
++	AC_MSG_CHECKING(for tape allocation)
+ 	if test "x${enable_tape_alloc}" == "xyes"; then
+ 		AC_DEFINE([_AD_TAPE_ALLOC_], [1], [enable a priori tape allocation for AD])
+ 	fi
+@@ -972,7 +913,6 @@
+ 	AC_MSG_RESULT([${enable_tape_alloc}])
+ 	dnl }}}
+ 	dnl ADOL-C {{{
+-	AC_MSG_CHECKING([for ADOL-C])
+ 	AC_ARG_WITH(
+ 		[adolc-dir],
+ 		AS_HELP_STRING([--with-adolc-dir=DIR], [ADOL-C root directory]),
+@@ -979,6 +919,7 @@
+ 		[ADOLC_ROOT=${withval}],
+ 		[ADOLC_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for ADOL-C])
+ 	if test "x${ADOLC_ROOT}" == "xno"; then
+ 		HAVE_ADOLC=no
+ 	else
+@@ -1003,7 +944,6 @@
+ 	AM_COND_IF(ADOLC, [CXXFLAGS+=" -std=c++11"])
+ 	dnl }}}
+ 	dnl ADOL-C version{{{
+-	AC_MSG_CHECKING(for ADOL-C version)
+ 	AC_ARG_WITH(
+ 		[adolc-version],
+ 		AS_HELP_STRING([--with-adolc-version=number], [ADOL-C version]),
+@@ -1010,11 +950,12 @@
+ 		[ADOLC_VERSION=${withval}],
+ 		[ADOLC_VERSION=2]
+ 	)
+-	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_], ${ADOLC_VERSION}, [ADOL-C version])
++	AC_MSG_CHECKING(for ADOL-C version)
++
++	AC_DEFINE_UNQUOTED(_ADOLC_VERSION_, $ADOLC_VERSION, [ADOL-C version])
+ 	AC_MSG_RESULT(${ADOLC_VERSION})
+ 	dnl }}}
+ 	dnl ADIC2 {{{
+-	AC_MSG_CHECKING([for ADIC2])
+ 	AC_ARG_WITH(
+ 		[adic2-dir],
+ 		AS_HELP_STRING([--with-adic2-dir=DIR], [ADIC2 root directory]),
+@@ -1021,6 +962,7 @@
+ 		[ADIC2_ROOT=${withval}],
+ 		[ADIC2_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for ADIC2])
+ 	if test "x${ADIC2_ROOT}" == "xno"; then
+ 		HAVE_ADIC2=no
+ 	else
+@@ -1042,7 +984,6 @@
+ 	AM_CONDITIONAL([ADIC2], [test "x${HAVE_ADIC2}" == "xyes"])
+ 	dnl }}}
+ 	dnl ATLAS {{{
+-	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
+ 	AC_ARG_WITH(
+ 		[atlas-dir],
+ 		AS_HELP_STRING([--with-atlas-dir=DIR], [ATLAS root directory]),
+@@ -1049,6 +990,7 @@
+ 		[ATLAS_ROOT=${withval}],
+ 		[ATLAS_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
+ 	if test "x${ATLAS_ROOT}" == "xno"; then
+ 		HAVE_ATLAS=no
+ 	else
+@@ -1065,18 +1007,12 @@
+ 			*cygwin*)
+ 				ATLASLIB="-L`cygpath -m ${ATLAS_ROOT}` -Wl,libatlas.lib  -Wl,libcblas.lib"
+ 			;;
+-			*darwin*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+-			;;
+ 			*linux*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
+ 			;;
+-			*mingw*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
++			*darwin*)
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
+ 			;;
+-			*msys*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+-			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_ATLAS_], [1], [with ATLAS in ISSM src])
+ 		AC_SUBST([ATLASLIB])
+@@ -1083,7 +1019,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl GSL{{{
+-	AC_MSG_CHECKING([for GSL])
+ 	AC_ARG_WITH(
+ 		[gsl-dir],
+ 		AS_HELP_STRING([--with-gsl-dir=DIR], [GSL root directory]),
+@@ -1090,6 +1025,7 @@
+ 		[GSL_ROOT=${withval}],
+ 		[GSL_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for GSL])
+ 	if test "x${GSL_ROOT}" == "xno"; then
+ 		HAVE_GSL=no
+ 	else
+@@ -1115,7 +1051,6 @@
+ 	AM_CONDITIONAL([GSL], [test "x${HAVE_GSL}" == "xyes"])
+ 	dnl }}}
+ 	dnl AMPI (ADOL-C){{{
+-	AC_MSG_CHECKING([for AMPI])
+ 	AC_ARG_WITH(
+ 		[ampi-dir],
+ 		AS_HELP_STRING([--with-ampi-dir=DIR], [Adjoinable MPI root directory]),
+@@ -1122,6 +1057,7 @@
+ 		[AMPI_ROOT=${withval}],
+ 		[AMPI_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for AMPI])
+ 	if test "x${AMPI_ROOT}" == "xno"; then
+ 		HAVE_AMPI=no
+ 	else
+@@ -1151,7 +1087,6 @@
+ 	AM_CONDITIONAL([AMPI], [test "x${HAVE_AMPI}" == "xyes"])
+ 	dnl }}}
+ 	dnl Adjoint MPI (CoDiPack){{{
+-	AC_MSG_CHECKING([for Adjoint MPI])
+ 	AC_ARG_WITH(
+ 		[adjointmpi-dir],
+ 		AS_HELP_STRING([--with-adjointmpi-dir=DIR], [Adjoint MPI root directory]),
+@@ -1158,6 +1093,7 @@
+ 		[ADJOINTMPI_ROOT=${withval}],
+ 		[ADJOINTMPI_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for Adjoint MPI])
+ 	if test "x${ADJOINTMPI_ROOT}" == "xno"; then
+ 		HAVE_ADJOINTMPI=no
+ 	else
+@@ -1185,7 +1121,6 @@
+ 	AM_CONDITIONAL([ADJOINTMPI], [test "x${HAVE_ADJOINTMPI}" == "xyes"])
+ 	dnl }}}
+ 	dnl MeDiPack (CoDiPack, ADOL-C dev){{{
+-	AC_MSG_CHECKING([for MeDiPack])
+ 	AC_ARG_WITH(
+ 		[medipack-dir],
+ 		AS_HELP_STRING([--with-medipack-dir=DIR], [MeDiPack root directory]),
+@@ -1192,6 +1127,7 @@
+ 		[MEDIPACK_ROOT=${withval}],
+ 		[MEDIPACK_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for MeDiPack])
+ 	if test "x${MEDIPACK_ROOT}" == "xno"; then
+ 		HAVE_MEDIPACK=no
+ 	else
+@@ -1217,7 +1153,6 @@
+ 	AM_CONDITIONAL([MEDIPACK], [test "x${HAVE_MEDIPACK}" == "xyes"])
+ 	dnl }}}
+ 	dnl HDF5 {{{
+-	AC_MSG_CHECKING(for HDF5 libraries)
+ 	AC_ARG_WITH(
+ 		[hdf5-dir],
+ 		AS_HELP_STRING([--with-hdf5-dir=DIR], [HDF5 root directory]),
+@@ -1224,6 +1159,7 @@
+ 		[HDF5_ROOT=${withval}],
+ 		[HDF5_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING(for HDF5 libraries)
+ 	if test "x${HDF5_ROOT}" == "xno"; then
+ 		HAVE_HDF5=no
+ 	else
+@@ -1244,18 +1180,12 @@
+ 			*cygwin*)
+ 				HDF5LIB="-L`cygpath -m ${HDF5_ROOT}` -Wl,libhdf5.lib  -Wl,libhdf5_hl.lib"
+ 			;;
+-			*darwin*)
+-				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+-			;;
+ 			*linux*)
+ 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+ 			;;
+-			*mingw*)
++			*darwin*)
+ 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+ 			;;
+-			*msys*)
+-				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+-			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_HDF5_], [1], [with HDF5 in ISSM src])
+ 		AC_SUBST([HDF5LIB])
+@@ -1262,7 +1192,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PETSc{{{
+-	AC_MSG_CHECKING([for PETSc])
+ 	AC_ARG_WITH(
+ 		[petsc-dir],
+ 		AS_HELP_STRING([--with-petsc-dir=DIR], [PETSc root directory, necessary for parallel build]),
+@@ -1269,6 +1198,7 @@
+ 		[PETSC_ROOT=${withval}],
+ 		[PETSC_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for PETSc])
+ 	if test "x${PETSC_ROOT}" == "xno"; then
+ 		HAVE_PETSC=no
+ 	else
+@@ -1289,8 +1219,8 @@
+ 		AC_MSG_CHECKING(for PETSc version)
+ 		PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
+ 		PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
+-		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], ${PETSC_MAJOR}, [PETSc version major])
+-		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], ${PETSC_MINOR}, [PETSc version minor])
++		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major])
++		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor])
+ 		AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}])
+ 
+ 		AC_MSG_CHECKING(whether PETSc is the development version)
+@@ -1333,16 +1263,6 @@
+ 					PETSCINCL="/I`cygpath -m ${PETSC_ROOT}/include`"
+ 				fi
+ 			;;
+-			*darwin*)
+-				if test ${PETSC_MAJOR} -lt 3; then
+-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
+-				else
+-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
+-					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
+-						PETSCLIB+=" -lmetis"
+-					fi
+-				fi
+-			;;
+ 			*linux*)
+ 				if test ${PETSC_MAJOR} -lt 3; then
+ 					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lmpiuni -lpetsc"
+@@ -1359,12 +1279,16 @@
+ 					PETSCLIB="-L${PETSC_ROOT}/lib -lcraypetsc_intel_real -lmetis"
+ 				fi
+ 			;;
+-			*mingw*)
+-				PETSCLIB="-Wl,${PETSC_ROOT}/lib/libpetsc.a"
++			*darwin*)
++				if test ${PETSC_MAJOR} -lt 3; then
++					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
++				else
++					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
++					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
++						PETSCLIB+=" -lmetis"
++					fi
++				fi
+ 			;;
+-			*msys*)
+-				PETSCLIB="${PETSC_ROOT}/lib -lpetsc"
+-			;;
+ 		esac
+ 		AC_MSG_RESULT([done])
+ 		AC_DEFINE([_HAVE_PETSC_], [1], [with PETSc in ISSM src])
+@@ -1374,6 +1298,7 @@
+ 	dnl }}}
+ 	dnl MPI{{{
+ 	AC_MSG_CHECKING(for MPI)
++
+ 	AC_ARG_WITH(
+ 		[mpi-include],
+ 		AS_HELP_STRING([--with-mpi-include=DIR], [MPI include directory, necessary for parallel build]),
+@@ -1380,6 +1305,7 @@
+ 		[MPI_INCLUDE=${withval}],
+ 		[MPI_INCLUDE=""]
+ 	)
++
+ 	AC_ARG_WITH(
+ 		[mpi-libdir],
+ 		AS_HELP_STRING([--with-mpi-libdir=DIR], [MPI library directory, necessary for parallel build]),
+@@ -1386,6 +1312,7 @@
+ 		[MPI_LIBDIR=${withval}],
+ 		[MPI_LIBDIR=""]
+ 	)
++
+ 	AC_ARG_WITH(
+ 		[mpi-libflags],
+ 		AS_HELP_STRING([--with-mpi-libflags=LIBS], [MPI libraries to be used, necessary for parallel build]),
+@@ -1392,6 +1319,7 @@
+ 		[MPI_LIBFLAGS=${withval}],
+ 		[MPI_LIBFLAGS=""]
+ 	)
++
+ 	if test -z "${MPI_INCLUDE}"; then
+ 		HAVE_MPI=no
+ 	else
+@@ -1434,7 +1362,6 @@
+ 	AC_MSG_RESULT([${HAVE_MPI}])
+ 	dnl }}}
+ 	dnl SCOTCH{{{
+-	AC_MSG_CHECKING([for SCOTCH])
+ 	AC_ARG_WITH(
+ 		[scotch-dir],
+ 		AS_HELP_STRING([--with-scotch-dir=DIR], [SCOTCH root directory]),
+@@ -1441,6 +1368,7 @@
+ 		[SCOTCH_ROOT=$withval],
+ 		[SCOTCH_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for SCOTCH])
+ 	if test "x${SCOTCH_ROOT}" == "xno"; then
+ 		HAVE_SCOTCH=no
+ 	else
+@@ -1473,138 +1401,84 @@
+ 	fi
+ 	dnl }}}
+ 	dnl METIS{{{
+-	AC_MSG_CHECKING([for METIS])
+-	AC_ARG_WITH(
+-		[metis-dir],
+-		AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
+-		[METIS_ROOT=${withval}],
+-		[METIS_ROOT="no"]
+-	)
+-	HAVE_METIS=no
+-	if test "x${METIS_ROOT}" == "xno"; then
+-		dnl Check if METIS was installed via PETSc
+-		if test -f ${PETSC_ROOT}/install/include/metis.h; then
++
++	dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
++	dnl		  check again in the following conditionals
++	dnl
++	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 3 && test "${VENDOR}" != "MSVC-Win64" && test "${VENDOR}" != "MSVC-Win64-par"; then
++		dnl In PETSc >=3.3, METIS is provided
++		HAVE_METIS="yes"
++		AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
++		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
++	else
++		AC_ARG_WITH(
++			[metis-dir],
++			AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
++			[METIS_ROOT=${withval}],
++			[METIS_ROOT="no"]
++		)
++		AC_MSG_CHECKING([for METIS])
++		if test "x${METIS_ROOT}" == "xno"; then
++			HAVE_METIS=no
++		else
+ 			HAVE_METIS=yes
+-			METIS_ROOT="${PETSC_ROOT}"
++			if ! test -d "${METIS_ROOT}"; then
++				AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
++			fi
+ 		fi
+-	else
+-		if ! test -d "${METIS_ROOT}"; then
+-			AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
+-		fi
+-		HAVE_METIS=yes
+-	fi
+-	if test "${HAVE_METIS}" = "yes"; then
+-		METIS_VERSION=$(grep "#define METIS_VER_MAJOR" ${METIS_ROOT}/include/metis.h | sed 's|.*METIS_VER_MAJOR[[:space:]]*||')
++		AC_MSG_RESULT([${HAVE_METIS}])
++		AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
++
+ 		dnl METIS libraries and header files
+-		if test "x${METIS_VERSION}" == "x4"; then
+-			METISINCL="-I${METIS_ROOT}/Lib"
+-			case "${host_os}" in
+-				*cygwin*)
+-					METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
+-					METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
+-				;;
+-				*darwin*)
+-					METISLIB="-L${METIS_ROOT} -lmetis"
+-				;;
+-				*linux*)
+-					METISLIB="-L${METIS_ROOT} -lmetis"
+-				;;
+-				*mingw*)
+-					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
+-				;;
+-				*msys*)
+-					METISLIB="-L${METIS_ROOT} -lmetis"
+-				;;
+-			esac
+-		elif test "x${METIS_VERSION}" == "x5"; then
+-			METISINCL="-I${METIS_ROOT}/include"
+-			case "${host_os}" in
+-				*cygwin*)
+-					METISLIB="-L${METIS_ROOT} libmetis.lib"
+-				;;
+-				*darwin*)
+-					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+-				;;
+-				*linux*)
+-					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+-				;;
+-				*mingw*)
+-					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
+-				;;
+-				*msys*)
+-					METISLIB="-L${METIS_ROOT}/lib -lmetis"
+-				;;
+-			esac
+-		else
+-			AC_MSG_ERROR([METIS version ${METIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
++		if test "x${HAVE_METIS}" == "xyes"; then
++			dnl Retrieve METIS version (does the VERSION file exist?)
++			if test -f "${METIS_ROOT}/VERSION"; then
++				METIS_VERSION=4
++			else
++				METIS_VERSION=5
++			fi
++
++			if test "x${METIS_VERSION}" == "x4"; then
++				METISINCL="-I${METIS_ROOT}/Lib"
++				case "${host_os}" in
++					*cygwin*)
++						METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
++						METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
++					;;
++					*linux*)
++						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
++					;;
++					*darwin*)
++						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
++					;;
++				esac
++				AC_DEFINE([_METIS_VERSION_], [4], [ METIS version number])
++			fi
++
++			if test "x${METIS_VERSION}" == "x5"; then
++				case "${host_os}" in
++					*cygwin*)
++						METISLIB="-L${METIS_ROOT} libmetis.lib"
++					;;
++					*linux*)
++						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
++					;;
++					*darwin*)
++						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
++					;;
++				esac
++				METISINCL="-I${METIS_ROOT}/include"
++				AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
++			fi
++
++			AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
++			AC_SUBST([METISINCL])
++			AC_SUBST([METISLIB])
+ 		fi
+-		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
+-		AC_DEFINE_UNQUOTED([_METIS_VERSION_], ${METIS_VERSION}, [METIS version number])
+-		AC_SUBST([METISINCL])
+-		AC_SUBST([METISLIB])
+ 	fi
+-	AC_MSG_RESULT([${HAVE_METIS}])
+-	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" = "xyes"])
++	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
+ 	dnl }}}
+-	dnl ParMETIS{{{
+-	AC_MSG_CHECKING([for ParMETIS])
+-	AC_ARG_WITH(
+-		[parmetis-dir],
+-		AS_HELP_STRING([--with-parmetis-dir=DIR], [ParMETIS root directory, necessary for parallel build]),
+-		[PARMETIS_ROOT=${withval}],
+-		[PARMETIS_ROOT="no"]
+-	)
+-	HAVE_PARMETIS=no
+-	if test "x${PARMETIS_ROOT}" == "xno"; then
+-		dnl Check if ParMETIS was installed via PETSc
+-		if test -f ${PETSC_ROOT}/install/include/parmetis.h; then
+-			HAVE_PARMETIS="yes"
+-			PARMETIS_ROOT="${PETSC_ROOT}"
+-		fi
+-	else
+-		if ! test -d "${PARMETIS_ROOT}"; then
+-			AC_MSG_ERROR([ParMETIS directory provided (${PARMETIS_ROOT}) does not exist!]);
+-		fi
+-		if ! test -d "${METIS_ROOT}"; then
+-			AC_MSG_ERROR([If supplying path to ParMETIS with option --with-parmetis-dir, must also supply path to METIS with option --with-metis-dir]);
+-		fi
+-		HAVE_PARMETIS="yes"
+-	fi
+-	if test "${HAVE_PARMETIS}" == "yes"; then
+-		#PARMETIS_VERSION=$(grep "#define PARMETIS_MAJOR_VERSION" ${PARMETIS_ROOT}/include/parmetis.h | sed 's|.*PARMETIS_MAJOR_VERSION[[:space:]]*||')
+-		dnl METIS libraries and header files
+-		#if test "x${PARMETIS_VERSION}" == "x4"; then
+-			PARMETISINCL="-I${PARMETIS_ROOT}/include"
+-			case "${host_os}" in
+-				*cygwin*)
+-					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+-				;;
+-				*darwin*)
+-					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+-				;;
+-				*linux*)
+-					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+-				;;
+-				*mingw*)
+-					PARMETISLIB="-Wl,${PARMETIS_ROOT}/lib/libparmetis.a"
+-				;;
+-				*msys*)
+-					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
+-				;;
+-			esac
+-		#else
+-		#	AC_MSG_ERROR([ParMETIS version ${PARMETIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
+-		#fi
+-		AC_DEFINE([_HAVE_PARMETIS_], [1], [with ParMETIS in ISSM src])
+-		#AC_DEFINE([_PARMETIS_VERSION_], [${PARMETIS_VERSION}], [ParMETIS version number])
+-		AC_SUBST([PARMETISINCL])
+-		AC_SUBST([PARMETISLIB])
+-	fi
+-	AC_MSG_RESULT([${HAVE_PARMETIS}])
+-	AM_CONDITIONAL([PARMETIS], [test "x${HAVE_PARMETIS}" = "xyes"])
+-	dnl }}}
+ 	dnl Toolkit for Advanced Optimization (TAO){{{
+-	AC_MSG_CHECKING([for TAO])
+ 	AC_ARG_WITH(
+ 		[tao-dir],
+ 		AS_HELP_STRING([--with-tao-dir=DIR], [TAO root directory]),
+@@ -1611,6 +1485,8 @@
+ 		[TAO_ROOT=${withval}],
+ 		[TAO_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for TAO])
++
+ 	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 5; then
+ 		dnl In PETSc >= 3.5, TAO is provided
+ 		HAVE_TAO="yes"
+@@ -1638,7 +1514,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl M1QN3{{{
+-	AC_MSG_CHECKING([for M1QN3])
+ 	AC_ARG_WITH(
+ 		[m1qn3-dir],
+ 		AS_HELP_STRING([--with-m1qn3-dir=DIR], [M1QN3 root directory]),
+@@ -1645,6 +1520,7 @@
+ 		[M1QN3_ROOT=${withval}],
+ 		[M1QN3_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for M1QN3])
+ 	if test "x${M1QN3_ROOT}" == "xno"; then
+ 		HAVE_M1QN3=no
+ 	else
+@@ -1663,7 +1539,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PROJ{{{
+-	AC_MSG_CHECKING([for PROJ])
+ 	AC_ARG_WITH(
+ 		[proj-dir],
+ 		AS_HELP_STRING([--with-proj-dir=DIR], [PROJ root directory]),
+@@ -1670,6 +1545,7 @@
+ 		[PROJ_ROOT=${withval}],
+ 		[PROJ_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for PROJ])
+ 	if test "x${PROJ_ROOT}" == "xno"; then
+ 		HAVE_PROJ=no
+ 	else
+@@ -1691,7 +1567,6 @@
+ 	AM_CONDITIONAL([PROJ], [test "x${HAVE_PROJ}" == "xyes"])
+ 	dnl }}}
+ 	dnl SLEPc{{{
+-	AC_MSG_CHECKING([for SLEPc])
+ 	AC_ARG_WITH(
+ 		[slepc-dir],
+ 		AS_HELP_STRING([--with-slepc-dir=DIR], [SLEPc root directory]),
+@@ -1698,6 +1573,7 @@
+ 		[SLEPC_ROOT=${withval}],
+ 		[SLEPC_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for SLEPc])
+ 	if test "x${SLEPC_ROOT}" == "xno"; then
+ 		HAVE_SLEPC=no
+ 	else
+@@ -1718,7 +1594,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl shapelib{{{
+-	AC_MSG_CHECKING([for shapelib])
+ 	AC_ARG_WITH(
+ 		[shapelib-dir],
+ 		AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
+@@ -1725,6 +1600,7 @@
+ 		[SHAPELIB_ROOT=${withval}],
+ 		[SHAPELIB_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for shapelib])
+ 	if test "x${SHAPELIB_ROOT}" == "xno"; then
+ 		HAVE_SHAPELIB=no
+ 	else
+@@ -1745,9 +1621,8 @@
+ 	fi
+ 	dnl }}}
+ 	dnl ScaLAPACK{{{
++
+ 	dnl NOTE: User should supply path to root directory or libraries, but not both
+-	dnl
+-	AC_MSG_CHECKING([for ScaLAPACK])
+ 	AC_ARG_WITH(
+ 		[scalapack-dir],
+ 		AS_HELP_STRING([--with-scalapack-dir=DIR], [ScaLAPACK root directory]),
+@@ -1760,6 +1635,7 @@
+ 		[SCALAPACKLIB=${withval}],
+ 		[SCALAPACKLIB="no"]
+ 	)
++	AC_MSG_CHECKING([for ScaLAPACK])
+ 	if test "x${SCALAPACK_ROOT}" == "xno" && test "x${SCALAPACKLIB}" == "xno"; then
+ 		HAVE_SCALAPACK=no
+ 		SCALAPACKLIB=""
+@@ -1768,11 +1644,7 @@
+ 			AC_MSG_ERROR([ScaLAPACK directory provided (${SCALAPACK_ROOT}) does not exist!]);
+ 		fi
+ 		HAVE_SCALAPACK=yes
+-		if test "${VENDOR}" == "win-msys2"; then
+-			SCALAPACKLIB="-Wl,${SCALAPACK_ROOT}/lib/libscalapack.a"
+-		else
+-			SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
+-		fi
++		SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
+ 	elif test "x${SCALAPACKLIB}" != "xno"; then
+ 		dnl Value of SCALAPACKLIB should be valid here, so no need to set it (as above)
+ 		HAVE_SCALAPACK=yes
+@@ -1788,33 +1660,19 @@
+ 	fi
+ 	dnl }}}
+ 	dnl BLAS/LAPACK{{{
+-	AC_MSG_CHECKING([for BLAS/LAPACK])
+ 	AC_ARG_WITH(
+-		[blas-dir],
+-		[AS_HELP_STRING([--with-blas-dir=DIR], [BLAS root directory])],
+-		[BLAS_ROOT=$withval],
+-		[BLAS_ROOT="no"]
+-	)
+-	AC_ARG_WITH(
+-		[lapack-dir],
+-		[AS_HELP_STRING([--with-lapack-dir=DIR], [LAPACK root directory])],
+-		[LAPACK_ROOT=$withval],
+-		[LAPACK_ROOT="no"]
+-	)
+-	AC_ARG_WITH(
+ 		[blas-lapack-dir],
+ 		AS_HELP_STRING([--with-blas-lapack-dir=DIR], [BLAS/LAPACK root directory]),
+ 		[BLASLAPACK_ROOT=$withval],
+ 		[BLASLAPACK_ROOT="no"]
+ 	)
+-	if (test "x${BLAS_ROOT}" = "xno" || test "x${LAPACK_ROOT}" = "xno") && test "x${BLASLAPACK_ROOT}" = "xno"; then
++	AC_MSG_CHECKING([for BLAS/LAPACK])
++	if test "x${BLASLAPACK_ROOT}" == "xno" ; then
+ 		HAVE_BLASLAPACK=no
+ 	else
+ 		HAVE_BLASLAPACK=yes
+-		if ! test -d "${BLAS_ROOT}" || ! test -d "${LAPACK_ROOT}"; then
+-			if ! test -d "${BLASLAPACK_ROOT}"; then
+-				AC_MSG_ERROR([Use either --with-blas-dir and --with-lapack-dir *or* --with-blaslapack-dir]);
+-			fi
++		if ! test -d "${BLASLAPACK_ROOT}"; then
++			AC_MSG_ERROR([BLAS/LAPACK directory provided (${BLASLAPACK_ROOT}) does not exist!]);
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT([${HAVE_BLASLAPACK}])
+@@ -1821,6 +1679,7 @@
+ 
+ 	dnl BLAS/LAPACK libraries and header files
+ 	if test "x${HAVE_BLASLAPACK}" == "xyes"; then
++		BLASLAPACKINCL=""
+ 		case "${host_os}" in
+ 			*cygwin*)
+ 				BLASLAPACKLIB="-L`cygpath -m ${BLASLAPACK_ROOT}` -Wl,libf2cblas.lib  -Wl,libf2clapack.lib"
+@@ -1849,44 +1708,13 @@
+ 					BLASLAPACKLIB+=" -llapack -lblas"
+ 				fi
+ 			;;
+-			*mingw*)
+-				if test -d "${BLASLAPACK_ROOT}"; then
+-					BLASLAPACKLIB="-L${BLASLAPACK_ROOT}/lib"
+-					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
+-						BLASLAPACKLIB+=" -lopenblas"
+-					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
+-						BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
+-					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+-						BLASLAPACKLIB="-Wl,${BLASLAPACK_ROOT}/lib/libflapack.a -Wl,${BLASLAPACK_ROOT}/lib/libfblas.a"
+-					else
+-						BLASLAPACKLIB+=" -llapack -lblas"
+-					fi
+-				else
+-					BLASLAPACKLIB="-Wl,${LAPACK_ROOT}/lib/liblapack.a -Wl,${BLAS_ROOT}/lib/libblas.a"
+-				fi
+-			;;
+-			*msys*)
+-				if test -d "${BLASLAPACK_ROOT}"; then
+-					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
+-						BLASLAPACKLIB=" -lopenblas"
+-					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
+-						BLASLAPACKLIB=" -lf2clapack -lf2cblas"
+-					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
+-						BLASLAPACKLIB+=" -lflapack -lfblas"
+-					else
+-						BLASLAPACKLIB=" -llapack -lblas"
+-					fi
+-				else
+-					BLASLAPACKLIB="-L${LAPACK_ROOT}/lib -llapack -L${BLAS_ROOT}/lib -lblas"
+-				fi
+-			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_BLASLAPACK_], [1], [with BLAS/LAPACK in ISSM src])
+ 		AC_SUBST([BLASLAPACKLIB])
++		AC_SUBST([BLASLAPACKINCL])
+ 	fi
+ 	dnl }}}
+ 	dnl Math Kernel Library (MKL){{{
+-	AC_MSG_CHECKING([for MKL])
+ 	AC_ARG_WITH(
+ 		[mkl-libflags],
+ 		AS_HELP_STRING([--with-mkl-libflags=LIBS], [MKL libraries to be used]),
+@@ -1893,6 +1721,7 @@
+ 		[MKL_LIBFLAGS=${withval}],
+ 		[MKL_LIBFLAGS="no"]
+ 	)
++	AC_MSG_CHECKING([for MKL])
+ 	if test "x${MKL_LIBFLAGS}" == "xno"; then
+ 		HAVE_MKL=no
+ 	else
+@@ -1905,6 +1734,7 @@
+ 	AC_MSG_RESULT([${HAVE_MKL}])
+ 	dnl }}}
+ 	dnl PlaLAPACK{{{
++
+ 	dnl TODO: 	Handle user supplying path to root directory *or* individual
+ 	dnl 		arguments (like ScaLAPACK)
+ 	dnl
+@@ -1939,7 +1769,6 @@
+ 	AC_MSG_RESULT([${HAVE_PLAPACK}])
+ 	dnl }}}
+ 	dnl MUMPS{{{
+-	AC_MSG_CHECKING([for MUMPS])
+ 	AC_ARG_WITH(
+ 		[mumps-dir],
+ 		AS_HELP_STRING([--with-mumps-dir=DIR], [MUMPS root directory]),
+@@ -1946,6 +1775,7 @@
+ 		[MUMPS_ROOT=${withval}],
+ 		[MUMPS_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for MUMPS])
+ 	if test "x${MUMPS_ROOT}" == "xno"; then
+ 		HAVE_MUMPS=no
+ 	else
+@@ -1960,8 +1790,8 @@
+ 	if test "x${HAVE_MUMPS}" == "xyes"; then
+ 		MUMPSINCL="-I${MUMPS_ROOT}/include"
+ 		if test "x${MUMPS_ROOT}" == "x${PETSC_ROOT}"; then
+-			if test "${VENDOR}" == "win-msys2"; then
+-				MUMPSLIB="-Wl,${MUMPS_ROOT}/lib/libcmumps.a -Wl,${MUMPS_ROOT}/lib/libdmumps.a -Wl,${MUMPS_ROOT}/lib/libsmumps.a -Wl,${MUMPS_ROOT}/lib/libzmumps.a -Wl,${MUMPS_ROOT}/lib/libmumps_common.a -Wl,${MUMPS_ROOT}/lib/libpord.a"
++			if test "x${PETSC_MAJOR}" == "x2"; then
++				MUMPSLIB="-L${MUMPS_ROOT}/lib "
+ 			else
+ 				MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lcmumps -lmumps_common -lpord -lparmetis -lzmumps -lmetis"
+ 			fi
+@@ -2010,7 +1840,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl BLACS{{{
+-	AC_MSG_CHECKING([for BLACS])
+ 	AC_ARG_WITH(
+ 		[blacs-dir],
+ 		AS_HELP_STRING([--with-blacs-dir=DIR], [BLACS root directory]),
+@@ -2017,6 +1846,7 @@
+ 		[BLACS_ROOT=${withval}],
+ 		[BLACS_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for BLACS])
+ 	if test "x${BLACS_ROOT}" == "xno"; then
+ 		HAVE_BLACS=no
+ 	else
+@@ -2037,7 +1867,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl HYPRE{{{
+-	AC_MSG_CHECKING([for HYPRE])
+ 	AC_ARG_WITH(
+ 		[hypre-dir],
+ 		AS_HELP_STRING([--with-hypre-dir=DIR], [HYPRE root directory]),
+@@ -2044,6 +1873,7 @@
+ 		[HYPRE_ROOT=${withval}],
+ 		[HYPRE_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for HYPRE])
+ 	if test "x${HYPRE_ROOT}" == "xno"; then
+ 		HAVE_HYPRE=no
+ 	else
+@@ -2064,7 +1894,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Prometheus{{{
+-	AC_MSG_CHECKING([for Prometheus])
+ 	AC_ARG_WITH(
+ 		[prometheus-dir],
+ 		AS_HELP_STRING([--with-prometheus-dir=DIR], [Prometheus root directory]),
+@@ -2071,6 +1900,7 @@
+ 		[PROMETHEUS_ROOT=${withval}],
+ 		[PROMETHEUS_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for Prometheus])
+ 	if test "x${PROMETHEUS_ROOT}" == "xno"; then
+ 		HAVE_PROMETHEUS=no
+ 	else
+@@ -2091,7 +1921,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SEMIC{{{
+-	AC_MSG_CHECKING([for SEMIC])
+ 	AC_ARG_WITH(
+ 		[semic-dir],
+ 		AS_HELP_STRING([--with-semic-dir=DIR], [SEMIC root directory]),
+@@ -2098,6 +1927,7 @@
+ 		[SEMIC_ROOT=${withval}],
+ 		[SEMIC_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for SEMIC])
+ 	if test "x${SEMIC_ROOT}" == "xno"; then
+ 		HAVE_SEMIC=no
+ 	else
+@@ -2119,7 +1949,6 @@
+ 	AM_CONDITIONAL([SEMIC], [test "x${HAVE_SEMIC}" == "xyes"])
+ 	dnl }}}
+ 	dnl SPAI{{{
+-	AC_MSG_CHECKING([for SPAI])
+ 	AC_ARG_WITH(
+ 		[spai-dir],
+ 		AS_HELP_STRING([--with-spai-dir=DIR], [SPAI root directory]),
+@@ -2126,6 +1955,7 @@
+ 		[SPAI_ROOT=${withval}],
+ 		[SPAI_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for SPAI])
+ 	if test "x${SPAI_ROOT}" == "xno"; then
+ 		HAVE_SPAI=no
+ 	else
+@@ -2146,7 +1976,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SuperLU{{{
+-	AC_MSG_CHECKING([for SuperLU])
+ 	AC_ARG_WITH(
+ 		[superlu-dir],
+ 		AS_HELP_STRING([--with-superlu-dir=DIR], [SuperLU root directory]),
+@@ -2153,6 +1982,7 @@
+ 		[SUPERLU_ROOT=${withval}],
+ 		[SUPERLU_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for SuperLU])
+ 	if test "x${SUPERLU_ROOT}" == "xno"; then
+ 		HAVE_SUPERLU=no
+ 	else
+@@ -2173,7 +2003,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SPOOLES{{{
+-	AC_MSG_CHECKING([for SPOOLES])
+ 	AC_ARG_WITH(
+ 		[spooles-dir],
+ 		AS_HELP_STRING([--with-spooles-dir=DIR], [SPOOLES root directory]),
+@@ -2180,6 +2009,7 @@
+ 		[SPOOLES_ROOT=${withval}],
+ 		[SPOOLES_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for SPOOLES])
+ 	if test "x${SPOOLES_ROOT}" == "xno"; then
+ 		HAVE_SPOOLES=no
+ 	else
+@@ -2200,7 +2030,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PaStiX{{{
+-	AC_MSG_CHECKING([for PaStiX])
+ 	AC_ARG_WITH(
+ 		[pastix-dir],
+ 		AS_HELP_STRING([--with-pastix-dir=DIR], [PaStiX root directory]),
+@@ -2207,6 +2036,7 @@
+ 		[PASTIX_ROOT=${withval}],
+ 		[PASTIX_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for PaStiX])
+ 	if test "x${PASTIX_ROOT}" == "xno"; then
+ 		HAVE_PASTIX=no
+ 	else
+@@ -2228,7 +2058,6 @@
+ 	dnl }}}
+ 	dnl }}}
+ 	dnl ml{{{
+-	AC_MSG_CHECKING([for ml])
+ 	AC_ARG_WITH(
+ 		[ml-dir],
+ 		AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
+@@ -2235,6 +2064,7 @@
+ 		[ML_ROOT=$withval],
+ 		[ML_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for ml])
+ 	if test "x${ML_ROOT}" == "xno"; then
+ 		HAVE_ML=no
+ 	else
+@@ -2255,7 +2085,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl UMFPACK{{{
+-	AC_MSG_CHECKING([for UMFPACK])
+ 	AC_ARG_WITH(
+ 		[umfpack-dir],
+ 		AS_HELP_STRING([--with-umfpack-dir=DIR], [UMFPACK root directory]),
+@@ -2262,6 +2091,7 @@
+ 		[UMFPACK_ROOT=${withval}],
+ 		[UMFPACK_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for UMFPACK])
+ 	if test "x${UMFPACK_ROOT}" == "xno"; then
+ 		HAVE_UMFPACK=no
+ 	else
+@@ -2298,7 +2128,6 @@
+ 	AC_MSG_RESULT([done])
+ 	dnl }}}
+ 	dnl MATH77{{{
+-	AC_MSG_CHECKING([for MATH77])
+ 	AC_ARG_WITH(
+ 		[math77-dir],
+ 		AS_HELP_STRING([--with-math77-dir=DIR], [MATH77 root directory]),
+@@ -2305,6 +2134,7 @@
+ 		[MATH77_ROOT=${withval}],
+ 		[MATH77_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for MATH77])
+ 	if test "x${MATH77_ROOT}" == "xno"; then
+ 		HAVE_MATH77=no
+ 	else
+@@ -2323,7 +2153,6 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Fortran{{{
+-	AC_MSG_CHECKING(for Fortran compilation)
+ 	AC_ARG_WITH(
+ 		[fortran],
+ 		AS_HELP_STRING([--with-fortran=YES], [do we compile Fortran code (default: yes)]),
+@@ -2330,6 +2159,7 @@
+ 		[FORTRAN=${withval}],
+ 		[FORTRAN=yes]
+ 	)
++	AC_MSG_CHECKING(for Fortran compilation)
+ 	if test "x${FORTRAN}" == "xyes"; then
+ 		HAVE_FORTRAN=yes
+ 		AC_DEFINE([_HAVE_FORTRAN_], [1], [with Fortran capability])
+@@ -2393,7 +2223,6 @@
+ 	AC_MSG_RESULT([done])
+ 	dnl }}}
+ 	dnl MeteoIO{{{
+-	AC_MSG_CHECKING([for MeteoIO])
+ 	AC_ARG_WITH(
+ 		[meteoio-dir],
+ 		AS_HELP_STRING([--with-meteoio-dir=DIR], [use MeteoIO in conjunction with SNOWPACK model]),
+@@ -2400,6 +2229,7 @@
+ 		[METEOIO_ROOT=${withval}],
+ 		[METEOIO_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for MeteoIO])
+ 	if test "x${METEOIO_ROOT}" == "xno"; then
+ 		HAVE_METEOIO=no
+ 	else
+@@ -2422,7 +2252,6 @@
+ 	AM_CONDITIONAL([METEOIO], [test "x${HAVE_METEOIO}" == "xyes"])
+ 	dnl }}}
+ 	dnl SNOWPACK{{{
+-	AC_MSG_CHECKING([for SNOWPACK])
+ 	AC_ARG_WITH(
+ 		[snowpack-dir],
+ 		AS_HELP_STRING([--with-snowpack-dir=DIR], [use SNOWPACK for surface mass balance model]),
+@@ -2429,6 +2258,7 @@
+ 		[SNOWPACK_ROOT=${withval}],
+ 		[SNOWPACK_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for SNOWPACK])
+ 	if test "x${SNOWPACK_ROOT}" == "xno"; then
+ 		HAVE_SNOWPACK=no
+ 	else
+@@ -2450,7 +2280,6 @@
+ 	AM_CONDITIONAL([SNOWPACK], [test "x${HAVE_SNOWPACK}" == "xyes"])
+ 	dnl }}}
+ 	dnl NeoPZ{{{
+-	AC_MSG_CHECKING([for NeoPZ])
+ 	AC_ARG_WITH(
+ 		[neopz-dir],
+ 		AS_HELP_STRING([--with-neopz-dir=DIR], [NeoPZ root directory]),
+@@ -2457,6 +2286,7 @@
+ 		[NEOPZ_ROOT=${withval}],
+ 		[NEOPZ_ROOT="no"]
+ 	)
++	AC_MSG_CHECKING([for NeoPZ])
+ 	if test "x${NEOPZ_ROOT}" == "xno"; then
+ 		HAVE_NEOPZ=no
+ 	else
+@@ -2525,12 +2355,11 @@
+ 		AC_MSG_CHECKING(for Gmsh version)
+ 		GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
+ 		AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
+-		AC_DEFINE_UNQUOTED([_GMSH_VERSION_MAJOR_], ${GMSH_VERSION_MAJOR}, [Gmsh major version])
++		AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
+ 	fi	
+ 	dnl }}}
+ 	dnl Capabilities
+ 	dnl with-bamg{{{
+-	AC_MSG_CHECKING([for BAMG capability compilation])
+ 	AC_ARG_WITH(
+ 		[bamg],
+ 		AS_HELP_STRING([--with-bamg=YES], [compile with BAMG capabilities (default: yes)]),
+@@ -2537,6 +2366,7 @@
+ 		[BAMG=${withval}],
+ 		[BAMG=yes]
+ 	)
++	AC_MSG_CHECKING([for BAMG capability compilation])
+ 	HAVE_BAMG=no
+ 	if test "x${BAMG}" == "xyes"; then
+ 		HAVE_BAMG=yes
+@@ -2546,7 +2376,6 @@
+ 	AC_MSG_RESULT([${HAVE_BAMG}])
+ 	dnl }}}
+ 	dnl with-ocean{{{
+-	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
+ 	AC_ARG_WITH(
+ 		[ocean],
+ 		AS_HELP_STRING([--with-ocean = YES], [compile with ice/ocean coupling capability (default: no)]),
+@@ -2553,6 +2382,8 @@
+ 		[OCEAN=${withval}],
+ 		[OCEAN=no]
+ 	)
++	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
++
+ 	HAVE_OCEAN=no
+ 	if test "x${OCEAN}" == "xyes"; then
+ 		HAVE_OCEAN=yes
+@@ -2562,7 +2393,6 @@
+ 	AC_MSG_RESULT([${HAVE_OCEAN}])
+ 	dnl }}}
+ 	dnl with-kml{{{
+-	AC_MSG_CHECKING(for kml capability compilation)
+ 	AC_ARG_WITH(
+ 		[kml],
+ 		AS_HELP_STRING([--with-kml=YES], [compile with kml capabilities (default: no)]),
+@@ -2569,6 +2399,8 @@
+ 		[KML=${withval}],
+ 		[KML=no]
+ 	)
++	AC_MSG_CHECKING(for kml capability compilation)
++
+ 	HAVE_KML=no
+ 	if test "x${KML}" == "xyes"; then
+ 		HAVE_KML=yes
+@@ -2578,7 +2410,6 @@
+ 	AC_MSG_RESULT([${HAVE_KML}])
+ 	dnl }}}
+ 	dnl with-kriging{{{
+-	AC_MSG_CHECKING(for kriging capability compilation)
+ 	AC_ARG_WITH(
+ 		[kriging],
+ 		AS_HELP_STRING([--with-kriging=YES], [compile with kriging capabilities (default: yes)]),
+@@ -2585,6 +2416,8 @@
+ 		[KRIGING=${withval}],
+ 		[KRIGING=yes]
+ 	)
++	AC_MSG_CHECKING(for kriging capability compilation)
++
+ 	HAVE_KRIGING=no
+ 	if test "x${KRIGING}" == "xyes"; then
+ 		HAVE_KRIGING=yes
+@@ -2599,7 +2432,6 @@
+ 
+ 	dnl Platform specifics
+ 	dnl with-ios{{{
+-	AC_MSG_CHECKING(for iOS compilation)
+ 	AC_ARG_WITH(
+ 		[ios],
+ 		AS_HELP_STRING([--with-ios=YES], [compile with iOS capabilities (default: no)]),
+@@ -2606,6 +2438,8 @@
+ 		[IOS=${withval}],
+ 		[IOS=no]
+ 	)
++	AC_MSG_CHECKING(for iOS compilation)
++
+ 	HAVE_IOS=no
+ 	if test "x${IOS}" == "xyes"; then
+ 		HAVE_IOS=yes
+@@ -2615,13 +2449,13 @@
+ 	AC_MSG_RESULT([${HAVE_IOS}])
+ 	dnl }}}
+ 	dnl with-android{{{
+-	AC_MSG_CHECKING([for Android capability compilation])
+ 	AC_ARG_WITH(
+ 		[android],
+ 		AS_HELP_STRING([--with-android=EXE], [compile with Android capabilities (default: "no"; alternatives: "exe", "jni")]),
+ 		[ANDROID=${withval}],
+-		[ANDROID=no]
+-	)
++		[ANDROID=no])
++	AC_MSG_CHECKING([for Android capability compilation])
++
+ 	if test "x${ANDROID}" == "xjni"; then
+ 		HAVE_ANDROID=jni
+ 		AC_DEFINE([_HAVE_ANDROID_], [1], [with Android capability])
+@@ -2640,7 +2474,6 @@
+ 	AC_MSG_RESULT([${HAVE_ANDROID}])
+ 	dnl }}}
+ 	dnl with-android-ndk{{{
+-	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
+ 	AC_ARG_WITH(
+ 		[android-ndk],
+ 		AS_HELP_STRING([--with-android-ndk=DIR], [Android NDK root directory]),
+@@ -2647,6 +2480,8 @@
+ 		[ANDROID_NDK_ROOT=${withval}],
+ 		[ANDROID_NDK_ROOT=""]
+ 	)
++	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
++
+ 	if test -d "${ANDROID_NDK_ROOT}"; then
+ 		HAVE_ANDROID_NDK=yes
+ 		ANDROID_NDKINCL="-I${ANDROID_NDK_ROOT}/arm-linux-android-install/sysroot/usr/include"
+@@ -2660,19 +2495,18 @@
+ 
+ 	dnl other options
+ 	dnl optimization{{{
+-	dnl -- bypass standard optimization -g -O2 -fPIC?
+-	AC_MSG_CHECKING(for C++ optimization flags)
++	dnl -- bypass standard optimization -g -O2 -fPIC -std=c++11?
+ 	AC_ARG_WITH(
+ 		[cxxoptflags],
+ 		AS_HELP_STRING([--with-cxxoptflags=CXXOPTFLAGS], [C++ optimization flags (i.e. --with-cxxoptflags="-march=opteron -O3 -std=c++11"]),
+ 		[CXXOPTFLAGS=${withval}],
+-		[CXXOPTFLAGS="-g -O2 -fPIC"]
++		[CXXOPTFLAGS="-g -O2 -fPIC -std=c++11"]
+ 	)
++	AC_MSG_CHECKING(for C++ optimization flags)
+ 	AC_SUBST([CXXOPTFLAGS])
+-	AC_MSG_RESULT([${CXXOPTFLAGS}])
++	AC_MSG_RESULT([done])
+ 	dnl }}}
+ 	dnl multithreading{{{
+-	AC_MSG_CHECKING(for number of threads)
+ 	AC_ARG_WITH(
+ 		[numthreads],
+ 		AS_HELP_STRING([--with-numthreads=NUMTHREADS_VALUE], [number of threads (default: 1)]),
+@@ -2679,6 +2513,7 @@
+ 		[NUMTHREADS_VALUE=${withval}],
+ 		[NUMTHREADS_VALUE=1]
+ 	)
++	AC_MSG_CHECKING(for number of threads)
+ 	dnl Check that supplied value is an integer
+ 	if [[ "${NUMTHREADS_VALUE}" != "${NUMTHREADS_VALUE}" 2> /dev/null ]]; then
+ 		AC_MSG_ERROR([Number of threads provided (${NUMTHREADS_VALUE}) is not an integer!]);
+@@ -2693,27 +2528,20 @@
+ 			*cygwin*)
+ 				MULTITHREADINGLIB="-lpthread -lrt"
+ 			;;
+-			*darwin*)
+-				MULTITHREADINGLIB="-lpthread"
+-			;;
+ 			*linux*)
+ 				MULTITHREADINGLIB="-lpthread -lrt"
+ 			;;
+-			*mingw*)
+-				MULTITHREADINGLIB=""
++			*darwin*)
++				MULTITHREADINGLIB="-lpthread"
+ 			;;
+-			*msys*)
+-				MULTITHREADINGLIB=""
+-			;;
+ 		esac
+ 		AC_DEFINE([_MULTITHREADING_], [1], [with multithreading enabled])
+ 	fi
+-	AC_DEFINE_UNQUOTED([_NUMTHREADS_], ${NUMTHREADS_VALUE}, [number of threads])
++	AC_DEFINE_UNQUOTED(_NUMTHREADS_, $NUMTHREADS_VALUE, [number of threads])
+ 	AC_SUBST([MULTITHREADINGLIB])
+ 	AC_MSG_RESULT([${NUMTHREADS_VALUE}])
+ 	dnl }}}
+ 	dnl 64-bit indices{{{
+-	AC_MSG_CHECKING([for 64-bit indices])
+ 	AC_ARG_WITH(
+ 		[64bit-indices],
+ 		AS_HELP_STRING([--with-64bit-indices=bool], [use 64-bit indices (default: 0)]),
+@@ -2720,6 +2548,8 @@
+ 		[USE_64BIT_INDICES=${withval}],
+ 		[USE_64BIT_INDICES=0]
+ 	)
++	AC_MSG_CHECKING([for 64-bit indices])
++
+ 	if test "x${USE_64BIT_INDICES}" == "x1"; then
+ 		AC_DEFINE([ISSM_USE_64BIT_INDICES], [1], [with 64-bit indices])
+ 	else
+@@ -2729,7 +2559,7 @@
+ 	dnl }}}
+ 
+ 	dnl Checks {{{
+-	AC_MSG_CHECKING(consistency between all external packages)
++	AC_MSG_CHECKING(consistency between all libraries)
+ 
+ 	dnl Check that if PETSc is requested, MPI is specified
+ 	if test "x${HAVE_PETSC}" == "xyes"; then
+@@ -2759,7 +2589,7 @@
+ 	fi
+ 
+ 	dnl Check that if we run ADOL-C, we don't compile kriging.exe
+-	if test "x${HAVE_ADOLC}" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
++	if test "x$HAVE_ADOLC" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
+ 		AC_MSG_ERROR([cannot compile kriging.exe under ADOL-C conditions!]);
+ 	fi
+ 
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26035)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26036)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
+ AM_FCFLAGS = @SEMICINCL@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+@@ -7,10 +7,7 @@
+ 
+ #Library declaration {{{
+ if !WINDOWS
+-lib_LTLIBRARIES = libISSMCore.la
+-if !MSYS2
+-lib_LTLIBRARIES += libISSMOverload.la
+-endif
++lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la
+ if WRAPPERS
+ lib_LTLIBRARIES += libISSMModules.la
+ endif
+@@ -684,20 +681,15 @@
+ endif
+ #}}}
+ #Library flags and sources {{{
+-ALL_CXXFLAGS = $(CXXFLAGS) $(CXXOPTFLAGS)
++ALLCXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
+-# Cannot have undefined symbols under msys2
+-if MSYS2
+-ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_
+-endif
+-
+ libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMCore_la_CXXFLAGS = $(ALL_CXXFLAGS) $(DAKOTAFLAGS)
++libISSMCore_la_CXXFLAGS = $(ALLCXXFLAGS) $(DAKOTAFLAGS)
+ libISSMCore_la_FFLAGS = $(AM_FFLAGS)
+ 
+ if !WINDOWS
+ if !STANDALONE_LIBRARIES
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+ if FORTRAN
+ libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
+ endif
+@@ -718,7 +710,7 @@
+ libISSMModules_la_SOURCES += $(kml_sources)
+ endif
+ 
+-libISSMModules_la_CXXFLAGS = $(ALL_CXXFLAGS)
++libISSMModules_la_CXXFLAGS = $(ALLCXXFLAGS)
+ if !WINDOWS
+ if STANDALONE_LIBRARIES
+ libISSMModules_la_LIBADD = ./libISSMCore.la
+@@ -750,41 +742,24 @@
+ endif
+ endif
+ 
+-if VERSION
+-libISSMCore_la_LDFLAGS =
++if STANDALONE_LIBRARIES
++libISSMCore_la_LDFLAGS = -static
++libISSMOverload_la_LDFLAGS = -static
+ if WRAPPERS
++libISSMModules_la_LDFLAGS = -static
++else
+ libISSMModules_la_LDFLAGS =
+ endif
+ else
+-libISSMCore_la_LDFLAGS = -avoid-version
+-if WRAPPERS
+-libISSMModules_la_LDFLAGS = -avoid-version
++libISSMCore_la_LDFLAGS =
++libISSMOverload_la_LDFLAGS =
+ endif
+-endif
+ 
+-if STANDALONE_LIBRARIES
+-libISSMCore_la_LDFLAGS += -static
+-if WRAPPERS
+-libISSMModules_la_LDFLAGS += -static
+-endif
+-endif
+ #}}}
+-
+-if !MSYS2
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_la_SOURCES = ./shared/String/ApiPrintf.cpp
++
+ libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
+-
+-if VERSION
+-libISSMOverload_la_LDFLAGS =
+-else
+-libISSMOverload_la_LDFLAGS = -avoid-version
+-endif
+-
+-if STANDALONE_LIBRARIES
+-libISSMOverload_la_LDFLAGS += -static
+-endif
+-endif
+ #}}}
+ #Executable {{{
+ if ANDROID
+@@ -802,18 +777,13 @@
+ endif
+ 
+ #Standard libraries
+-LDADD = ./libISSMCore.la 
+-
+-if !MSYS2
+-LDADD += ./libISSMOverload.la
+-endif
+-
++LDADD = ./libISSMCore.la ./libISSMOverload.la
+ if WRAPPERS
+ LDADD += ./libISSMModules.la $(TRIANGLELIB)
+ endif
+ 
+ #External packages
+-LDADD +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
++LDADD += $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB)
+ 
+ if FORTRAN
+ LDADD += $(FLIBS) $(FORTRANLIB)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26036-26037.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26036-26037.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26036-26037.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26036)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26037)
+@@ -41,7 +41,7 @@
+ 	iomodel->FetchData(&geodetic,"md.solidearth.settings.computesealevelchange");
+ 	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessRateEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessRateEnum,0.);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightRateEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.otherchange",SurfaceloadOtherRateEnum);
+ 		
Index: /issm/oecreview/Archive/25834-26739/ISSM-26037-26038.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26037-26038.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26037-26038.diff	(revision 26740)
@@ -0,0 +1,38 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26037)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26038)
+@@ -2031,12 +2031,29 @@
+ 		basalelement->NodalFunctionsP1(basis,gauss);
+ 
+ 		/*Build gradient vector (actually -dJ/dD): */
+-		for(int i=0;i<numvertices;i++){
+-			ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
+-			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		if(control_interp==P1Enum){
++			for(int i=0;i<numvertices;i++){
++				ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
++				_assert_(!xIsNan<IssmDouble>(ge[i]));
++			}
+ 		}
++		else if(control_interp==P0Enum){
++			ge[0]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight;
++			_assert_(!xIsNan<IssmDouble>(ge[0]));
++		}
++		else{
++			_error_("not supported");
++		}
+ 	}
+-	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++	if(control_interp==P1Enum){
++		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++	}
++	else if(control_interp==P0Enum){
++		gradient->SetValue(vertexpidlist[0],ge[0],ADD_VAL);
++	}
++	else{
++		_error_("not supported");
++	}
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26038-26039.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26038-26039.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26038-26039.diff	(revision 26740)
@@ -0,0 +1,431 @@
+Index: ../trunk-jpl/externalpackages/mingw-mex/README
+===================================================================
+--- ../trunk-jpl/externalpackages/mingw-mex/README	(nonexistent)
++++ ../trunk-jpl/externalpackages/mingw-mex/README	(revision 26039)
+@@ -0,0 +1,55 @@
++This directory contains instructions (this file) and supporting files for 
++setting up mex to use MinGW compilers to produce MEX-files.
++
++NOTE: This does not apply to the 'MATLAB Support for MinGW-w64 C/C++ Compiler' 
++Add-On: what we are concerned with here is setting mex to use external MinGW 
++compilers.
++
++==========================================
++Setup MinGW compilers to produce MEX files
++==========================================
++- Start an instance of MATLAB
++- Navigate to $ISSM_DIR/externalpackages/mingw-mex
++- In the MATLAB Command Window run,
++
++	>> configuremingw
++
++- In the resulting prompt, navigate to the root MinGW gcc directory (if you 
++have followed the Windows installation instructions on our Web site, 
++https://issm.jpl.nasa.gov/download/windows, this should be 
++'C:\msys64\mingw64').
++- Verify that configuration was successful,
++
++	>> mex -setup C
++	MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
++	>> mex -setup C++
++	MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.
++
++If configuration was unsuccessful, see if a new version of configuremingw.p is 
++available at,
++
++	https://www.mathworks.com/matlabcentral/answers/313298-i-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with-matlab
++
++If so, please notify us on the ISSM Forum at https://issm.ess.uci.edu/forum so 
++that we can update the file in our repository.
++
++=========================
++Building yprime.c Example
++=========================
++- Start an instance of MATLAB
++- Navigate to $ISSM_DIR/externalpackages/mingw-mex
++- In the MATLAB Command Window run,
++
++	>> copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'),'.','f')
++	>> mex yprime.c
++
++- Test the generate MEX file with,
++
++	>> yprime(1,1:4)
++
++	ans =
++
++	    2.0000    8.9685    4.0000   -1.0947
++
++Sources:
++- https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html
+Index: ../trunk-jpl/externalpackages/mingw-mex/configuremingw.p
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/externalpackages/mingw-mex/configuremingw.p
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/msmpi/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/msmpi/install.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/msmpi/install.sh	(revision 26039)
+@@ -0,0 +1,55 @@
++#!/bin/bash
++#
++# Creates a local MS-MPI directory to be used for supplying MPI headers files 
++# and libraries to ISSM configuration and certain external packages.
++#
++# Assumes that Microsoft MPI and MPI SDK have been installed. To do so,
++# - Navigate to https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi
++# - Under the 'MS-MPI Downloads' heading, click the link for 
++#	'MS-MPI v<version>', where <version> is the latest version available (as of 
++#	this writing, 10.1.2)
++# - Click the 'Download' button
++# - Make sure both boxes are checked
++# - Click the 'Save File' button in each prompt
++# - When the downloads are complete, run each installer
++#
++# TODO:
++# - Commit Microsoft MPI and Microsoft SDK installers or source code to 
++#	external packages source repository, then update this documentation to note 
++#	that they are available
++# - Attempt to download Microsoft MPI and Microsoft SDK installers or source 
++#	code and (compile and) install with this script
++# - Alternatively, instruct users to install MSYS2 MinGW 64-bit MS-MPI package 
++#	with,
++#
++#		pacman -S mingw-w64-x86_64-msmpi
++#
++# remove this script, its parent directory, and references to it from 
++# configuration files in $ISSM_DIR/jenkins directory and documentation
++#
++
++
++## Constants
++#
++PREFIX="${ISSM_DIR}/externalpackages/msmpi/install"
++
++MSMPI_LIB="/c/Windows/System32/msmpi.dll"
++MSMPI_INC=$(cygpath -u $(cygpath -ms "/c/Program Files (x86)/Microsoft SDKs/MPI/Include"))
++
++# Cleanup
++rm -rf ${PREFIX}
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib
++
++# Copy MS-MPI header files to 'include' directory
++cp ${MSMPI_INC}/mpi.h ${PREFIX}/include
++cp ${MSMPI_INC}/mpi.f90 ${PREFIX}/include
++cp ${MSMPI_INC}/mpif.h ${PREFIX}/include
++cp ${MSMPI_INC}/mpio.h ${PREFIX}/include
++cp ${MSMPI_INC}/x64/mpifptr.h ${PREFIX}/include
++
++# Copy MS-MPI library to 'lib' directory
++cp ${MSMPI_LIB} ${PREFIX}/lib
++
++# Create link to shared library so that libtool can find it
++cd ${PREFIX}/lib
++ln -s msmpi.dll libmsmpi.dll
+
+Property changes on: ../trunk-jpl/externalpackages/msmpi/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/m/solve/waitonlock.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.m	(revision 26038)
++++ ../trunk-jpl/src/m/solve/waitonlock.m	(revision 26039)
+@@ -1,9 +1,9 @@
+ function ispresent=waitonlock(md)
+ %WAITONLOCK - wait for a file
+ %
+-%   This routine will return when a file named 'lockfilename' is written to disk.
+-%   Also check for outlog file be cause it might bewritten several seconds
+-%   after the lock file.
++%   This routine will return when a file named 'lockfilename' is written to 
++%   disk. Also check for outlog file be cause it might be written several 
++%   seconds after the lock file.
+ %   If the time limit given in input is exceeded, return 0
+ %
+ %   Usage:
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 26038)
++++ ../trunk-jpl/etc/environment.sh	(revision 26039)
+@@ -167,6 +167,18 @@
+ 	fi
+ } #}}}
+ 
++path_append "${ISSM_DIR}/aux-config"
++path_append "${ISSM_DIR}/scripts"
++
++# Default path to external packages. Redefine this constant if they are 
++# installed to a different directory. Alternatively, export it on the command 
++# line or in a profile initialization file (that is why we check here if it is 
++# set already).
++#
++if [ -z "${ISSM_EXT_DIR+x}" ]; then
++	export ISSM_EXT_DIR="${ISSM_DIR}/externalpackages"
++fi
++
+ #######################
+ # OS-specific handling
+ #######################
+@@ -173,16 +185,22 @@
+ 
+ OS=$(uname -s)
+ 
+-if [[ "${OS}" == MINGW* || "${OS}" == MSYS* ]]; then
+-	# If this is a Windows build, we need to copy MSMPI to working $ISSM_DIR
+-	MSMPI_ROOT="${ISSM_DIR}/MSMPI"
+-	if [ ! -d "${MSMPI_ROOT}" ]; then
+-		${ISSM_DIR}/scripts/win-msys2-create_local_msmpi_dir.sh
++if [[ "${OS}" == MINGW* ]]; then
++	MSMPI_ROOT="${ISSM_EXT_DIR}/msmpi/install"
++	if [ -d "${MSMPI_ROOT}" ]; then
++		export MSMPI_ROOT # Used in installation of ParMETIS, ScaLAPACK
++		path_prepend "${ISSM_DIR}/bin" # Allows dynamic loaded to find DLLs
++		cpath_prepend "${MSMPI_ROOT}/include"
++		library_path_prepend "${MSMPI_ROOT}/lib"
+ 	fi
+-	export MSMPI_ROOT # Used in installation of ParMETIS, ScaLAPACK
+-	path_prepend "${ISSM_DIR}/bin" # Lets dynamic linker find DLLs
+-	cpath_prepend "${MSMPI_ROOT}/include"
+-	library_path_prepend "${MSMPI_ROOT}/lib"
++
++	MPIEXEC_DIR=$(cygpath -u $(cygpath -ms "/c/Program Files/Microsoft MPI/Bin"))
++	if [ -d "${MPIEXEC_DIR}" ]; then
++		export MPIEXEC_DIR
++		path_append "${MPIEXEC_DIR}"
++	fi
++
++	path_prepend "${ISSM_DIR}/bin" # Allows dynamic loader to find DLLs
+ fi
+ 
+ # Windows compilers
+@@ -190,18 +208,6 @@
+ 	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+ fi
+ 
+-path_append "${ISSM_DIR}/aux-config"
+-path_append "${ISSM_DIR}/scripts"
+-
+-# Default path to external packages. Redefine this constant if they are 
+-# installed to a different directory. Alternatively, export it on the command 
+-# line or in a profile initialization file (that is why we check here if it is 
+-# set already).
+-#
+-if [ -z "${ISSM_EXT_DIR+x}" ]; then
+-	export ISSM_EXT_DIR="${ISSM_DIR}/externalpackages"
+-fi
+-
+ #########################
+ # Command-line utilities
+ #########################
+@@ -283,47 +289,65 @@
+ BLAS_ROOT="${ISSM_EXT_DIR}/blas/install"
+ if [ -d "${BLAS_ROOT}" ]; then
+ 	export BLAS_ROOT # Used in installation of LAPACK, ScaLAPACK, PETSc
+-	path_append "${BLAS_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	library_path_append "${BLAS_ROOT}/lib"
+ 	ld_library_path_append "${BLAS_ROOT}/lib"
++
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${BLAS_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
+ fi
+ 
+ LAPACK_ROOT="${ISSM_EXT_DIR}/lapack/install"
+ if [ -d "${LAPACK_ROOT}" ]; then
+ 	export LAPACK_ROOT # Used in installation of ScaLAPACK, MUMPS, PETSc
+-	path_append "${LAPACK_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	library_path_append "${LAPACK_ROOT}/lib"
+ 	ld_library_path_append "${LAPACK_ROOT}/lib"
++
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${LAPACK_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
+ fi
+ 
+ METIS_ROOT="${ISSM_EXT_DIR}/metis/install"
+ if [ -d "${METIS_ROOT}" ]; then
+ 	export METIS_ROOT # Used in installation of ParMETIS, Gmsh, PETSc
+-	path_append "${METIS_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	library_path_prepend "${METIS_ROOT}/lib"
+ 	ld_library_path_prepend "${METIS_ROOT}/lib"
++
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${METIS_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
+ fi
+ 
+ MUMPS_ROOT="${ISSM_EXT_DIR}/mumps/install"
+ if [ -d "${MUMPS_ROOT}" ]; then
+ 	export MUMPS_ROOT # Used in installation of PETSc
+-	path_append "${MUMPS_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	library_path_append "${MUMPS_ROOT}/lib"
++
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${MUMPS_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
+ fi
+ 
+ PARMETIS_ROOT="${ISSM_EXT_DIR}/parmetis/install"
+ if [ -d "${PARMETIS_ROOT}" ]; then
+ 	export PARMETIS_ROOT # Used in installation of MUMPS, PETSc
+-	path_append "${PARMETIS_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	library_path_prepend "${PARMETIS_ROOT}/lib"
+ 	ld_library_path_prepend "${PARMETIS_ROOT}/lib"
++
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${PARMETIS_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
+ fi
+ 
+ SCALAPACK_ROOT="${ISSM_EXT_DIR}/scalapack/install"
+ if [ -d "${SCALAPACK_ROOT}" ]; then
+ 	export SCALAPACK_ROOT # Used in installation of MUMPS, PETSc
+-	path_append "${SCALAPACK_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	library_path_append "${SCALAPACK_ROOT}/lib"
++
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${SCALAPACK_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
+ fi
+ 
+ ZLIB_ROOT="${ISSM_EXT_DIR}/zlib/install"
+@@ -335,10 +359,13 @@
+ PETSC_ROOT="${ISSM_EXT_DIR}/petsc/install"
+ if [ -d "${PETSC_ROOT}" ]; then
+ 	export PETSC_ROOT # Used in installation of Gmsh
+-	path_append "${PETSC_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	library_path_prepend "${PETSC_ROOT}/lib"
+ 	ld_library_path_prepend "${PETSC_ROOT}/lib"
+ 
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${PETSC_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
++
+ 	# In case we have installed certain external packages via PETSc
+ 	#
+ 
+@@ -510,9 +537,12 @@
+ 
+ TRIANGLE_ROOT="${ISSM_EXT_DIR}/triangle/install"
+ if [ -d "${TRIANGLE_ROOT}" ]; then
+-	path_append "${TRIANGLE_ROOT}/lib" # Lets dynamic linker find DLLs
+ 	ld_library_path_append "${TRIANGLE_ROOT}/lib"
+ 	dyld_library_path_append "${TRIANGLE_ROOT}/lib"
++
++	if [[ "${OS}" == MINGW* ]]; then
++		path_append "${TRIANGLE_ROOT}/lib" # Allows dynamic loaded to find DLLs
++	fi
+ fi
+ 
+ ANGELROOT="${ISSM_EXT_DIR}/angel/angel"
+Index: ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26038)
++++ ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26039)
+@@ -4,9 +4,9 @@
+ # NOTE:
+ # - You must install various needed packages with,
+ #
+-#		pacman -S autoconf make automake-wrapper bison git mingw-w64-x86_64-freeglut mingw-w64-x86_64-toolchain patch python perl pkg-config pkgfile rebase tar time tzcode unzip which mingw-w64-x86_64-libmicroutils
++#		pacman -S git mingw-w64-x86_64-freeglut mingw-w64-x86_64-toolchain python pkg-config mingw-w64-x86_64-libmicroutils
+ #
+-# then remove the MinGW 64-bit version of Python (and depdendent packages) with,
++# then remove the MinGW 64-bit version of Python (and dependent packages) with,
+ #
+ #		pacman -R mingw-w64-x86_64-gdb-multiarch mingw-w64-x86_64-gdb mingw-w64-x86_64-python
+ #
+@@ -68,7 +68,7 @@
+ 	--with-x=0 \
+ 	--with-ssl=0 \
+ 	--with-proc-filesystem=0 \
+-	--with-mpiexec="/c/PROGRA~1/MICROS~1/Bin/mpiexec.exe" \
++	--with-mpiexec="${MPIEXEC_DIR}/mpiexec.exe" \
+ 	--with-mpi-lib="-L${MSMPI_ROOT}/lib -lmsmpi" \
+ 	--with-mpi-include="${MSMPI_ROOT}/include" \
+ 	--download-fblaslapack=1 \
+Index: ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26038)
++++ ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26039)
+@@ -1,3 +1,5 @@
++MATLAB_PATH=$(cygpath -u $(cygpath -ms "/c/Program Files/MATLAB/R2019b"))
++
+ ISSM_CONFIG='\
+ 	--prefix=${ISSM_DIR} \
+ 	--enable-development \
+@@ -24,6 +26,7 @@
+ 
+ #List of external pakages to be installed and their installation scripts
+ EXTERNALPACKAGES="
++	msmpi		install.sh
+ 	petsc		install-3.14-win-msys2-mingw-msmpi.sh
+ 	triangle	install-win-msys2-mingw.sh
+ 	shell2junit	install.sh
+@@ -47,7 +50,7 @@
+ NUMCPUS_INSTALL=4
+ 
+ # Number of CPUs used in the nightly runs
+-NUMCPUS_RUN=1
++NUMCPUS_RUN=2
+ 
+ # Nightly run options
+ #
+Index: ../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26038)
++++ ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26039)
+@@ -138,16 +138,16 @@
+ 				fid=fopen([modelname '.bat'],'w');
+ 				fprintf(fid,'@echo off\n');
+ 
+-				if IssmConfig('_HAVE_PETSC_MPI_'),
+-					warning('parallel runs not allowed yet in Windows. Defaulting to 1 cpus');
+-					cluster.np=1;
+-				end
++				% if IssmConfig('_HAVE_PETSC_MPI_'),
++				% 	warning('parallel runs not allowed yet in Windows. Defaulting to 1 cpus');
++				% 	cluster.np=1;
++				% end
+ 
+ 				if cluster.np>1,
+-					% fprintf(fid,'"C:\\Program Files\\MPICH2\\bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s ',cluster.np,cluster.codepath,executable,solution,modelname);
+-					fprintf(fid,'"C:\\PROGRA~1\\MICROS~1\\Bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s ',cluster.np,cluster.codepath,executable,solution,modelname);
++					% fprintf(fid,'"C:\\Program Files\\MPICH2\\bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s',cluster.np,cluster.codepath,executable,solution,modelname);
++					fprintf(fid,'"C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec.exe" -n %i "%s/%s" %s ./ %s',cluster.np,cluster.codepath,executable,solution,modelname);
+ 				else
+-					fprintf(fid,'"%s/%s" %s ./ %s ',cluster.codepath,executable,solution,modelname);
++					fprintf(fid,'"%s/%s" %s ./ %s',cluster.codepath,executable,solution,modelname);
+ 				end
+ 				fclose(fid);
+ 			end
+@@ -304,7 +304,6 @@
+ 		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+ 
+ 			if ~ispc,
+-
+ 				%figure out what shell extension we will use:
+ 				if isempty(strfind(cluster.shell,'csh')),
+ 					shellext='sh';
+@@ -318,10 +317,10 @@
+ 					launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && cd ' dirname ' && source ' modelname '.queue '];
+ 				else
+ 					if ~batch,
+-					launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++						launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+ 						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
+ 					else
+-					launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++						launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+ 						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz '];
+ 					end
+ 				end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26039-26040.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26039-26040.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26039-26040.diff	(revision 26740)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh
+===================================================================
+--- ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh	(revision 26039)
++++ ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh	(nonexistent)
+@@ -1,52 +0,0 @@
+-#!/bin/bash
+-#
+-# Creates a local MS-MPI directory to be used for supplying header and library
+-# paths to ISSM configuration as well as the configuration of certain external
+-# packages.
+-#
+-# Local MS-MPI include and library paths are made available as environment
+-# variables LOCAL_MSMPI_INC and LOCAL_MSMPI_LIB, respectively (script can be
+-# sourced again).
+-#
+-# Paths may need to be modified in the future if Microsoft changes the
+-# directory structure and/or file naming in the MS-MPI package. Paths are
+-# based on Microsoft MPI v10.0,
+-#	https://www.microsoft.com/en-us/download/details.aspx?id=57467
+-#
+-LOCAL_MSMPI_ROOT="${ISSM_DIR}/MSMPI"
+-LOCAL_MSMPI_INC="${LOCAL_MSMPI_ROOT}/include"
+-LOCAL_MSMPI_LIB="${LOCAL_MSMPI_ROOT}/lib"
+-MSMPI_RUNTIME_LIB="/c/Windows/System32/msmpi.dll"
+-MSMPI_INC="/c/PROGRA~2/MICROS~2/MPI/Include"
+-MSMPI_LIB="${ISSM_DIR}/externalpackages/windows/MSMPI/lib"
+-
+-cd ${ISSM_DIR}
+-
+-if [ -d ${LOCAL_MSMPI_ROOT} ]; then
+-	echo "'${LOCAL_MSMPI_ROOT}' already exists!"
+-	echo "If you need to recreate local MS-MPI directory, remove '${LOCAL_MSMPI_ROOT}' and rerun this script."
+-else
+-	mkdir ${LOCAL_MSMPI_ROOT} ${LOCAL_MSMPI_INC} ${LOCAL_MSMPI_LIB}
+-
+-	# Make SVN ignore local MS-MPI directory so that we do not accidentally
+-	# commit it
+-	svn propset svn:ignore ${LOCAL_MSMPI_ROOT} . &>/dev/null
+-
+-	# Copy MS-MPI header files
+-	cp $MSMPI_INC/mpi.h ${LOCAL_MSMPI_INC}
+-	cp $MSMPI_INC/mpi.f90 ${LOCAL_MSMPI_INC}
+-	cp $MSMPI_INC/mpif.h ${LOCAL_MSMPI_INC}
+-	cp $MSMPI_INC/mpio.h ${LOCAL_MSMPI_INC}
+-	cp $MSMPI_INC/x64/mpifptr.h ${LOCAL_MSMPI_INC}
+-
+-	# Copy MS-MPI libraries
+-	cp ${MSMPI_RUNTIME_LIB} ${LOCAL_MSMPI_LIB}
+-
+-	cd ${LOCAL_MSMPI_LIB}
+-
+-	# Create link to runtime library with MSYS prefix
+-	ln -s ./msmpi.dll ./msys-msmpi.dll
+-
+-	# Create link to runtime library with lib prefix
+-	ln -s ./msmpi.dll ./libmsmpi.dll
+-fi
+
+Property changes on: ../trunk-jpl/scripts/win-msys2-create_local_msmpi_dir.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26040-26041.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26040-26041.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26040-26041.diff	(revision 26740)
@@ -0,0 +1,49 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26040)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26041)
+@@ -9,29 +9,7 @@
+    end
+ end
+ if nargin<5
+-	%ncdate='2014-03-12';
+-	%ncdate='2014-04-28';
+-	%ncdate='2014-07-31';
+-	%ncdate='2014-09-23';
+-	%ncdate='2015-11-06';
+-	%ncdate='2015-12-09';
+-	ncdate='2016-06-10';
+-	ncdate='2016-08-26';
+-	ncdate='2016-11-17';
+-	ncdate='2017-01-05';
+-	ncdate='2017-03-10';
+-	ncdate='2018-02-02';
+-	ncdate='2018-03-20';
+-	ncdate='2018-05-18';
+-	ncdate='2018-06-08';
+-	ncdate='2018-09-26';
+-	ncdate='2018-11-14';
+-	ncdate='2019-01-30';
+-	ncdate='2019-03-12';
+-	ncdate='2019-04-02';
+-	ncdate='2019-04-15'; % no need of firn correction
+-	ncdate='2020-06-18';
+-	ncdate='2020-07-15'; %BedMachine v2?
++	ncdate='2020-07-15'; %BedMachine v2
+ end
+ 
+ basename = 'BedMachineAntarctica';
+@@ -43,7 +21,12 @@
+ 	case {'thwaites','murdo','astrid'}
+ 		nc=['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'];
+ 	otherwise
+-		error('hostname not supported yet');
++		if nargin==5
++			nc = ncdate;
++			disp(['Using provided path: ' nc]);
++		else
++			error('hostname not supported and path not provided');
++		end
+ end
+ 
+ if nargout==2,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26041-26042.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26041-26042.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26041-26042.diff	(revision 26740)
@@ -0,0 +1,283 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26041)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26042)
+@@ -1,58 +1,82 @@
+ function output = interpBedmachineAntarctica(X,Y,string,method,ncdate),
++%INTERPBEDMACHINEANTARCTICA - interpolate BedMachine data onto X and Y
++%
++%   Examples:
++%      bed       = interpBedmachineAntarctica(X,Y,'bed');
++%      surface   = interpBedmachineAntarctica(X,Y,'surface');
++%      thickness = interpBedmachineAntarctica(X,Y,'thickness');
++%      mask      = interpBedmachineAntarctica(X,Y,'mask');
++%      mask      = interpBedmachineAntarctica(X,Y,'mask','nearest','../Data/BedMachineAntarctica_2020-07-15_v02.nc');
++%
++%   - mask:   0 ocean, 1 land (ice free), 2 grounded ice, 3 floating ice
++%   - source: 1 IBCSO/RTopo-2, 2 MC, 3 interpolation, 4 hydrostatic eq, 
++%             5 Streamline diffusion, 6 Gravity inversion
++%   - optional 4th input argument: interpolation method.
++%             Supported interpolation methos: 'linear','cubic','nearest'
++%   - optional 5th input argument: path to dataset.
++%
++% Version 11/30/2018 Mathieu Morlighem mmorligh@uci.edu
+ 
+ if nargin<3, string = 'bed'; end
+ if nargin<4
+ 	if strcmp(string,'mask') | strcmp(string,'source')
+-      method='nearest'; % default method
+-   else
+-      method='cubic'; % default method
+-   end
++		method='nearest'; % default method
++	else
++		method='cubic'; % default method
++	end
+ end
+ if nargin<5
+ 	ncdate='2020-07-15'; %BedMachine v2
+ end
+-
+ basename = 'BedMachineAntarctica';
+ 
+-%read data
+-switch (oshostname()),
+-	case {'ronne'}
+-		nc=['/home/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'];
+-	case {'thwaites','murdo','astrid'}
+-		nc=['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'];
+-	otherwise
+-		if nargin==5
+-			nc = ncdate;
+-			disp(['Using provided path: ' nc]);
+-		else
+-			error('hostname not supported and path not provided');
++if nargin==5
++	ncfile = ncdate;
++else
++	%List of common paths to try
++	paths = {...
++		['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
++		['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
++		['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
++		['./' basename '-' ncdate '.nc'],...
++		};
++
++	found = 0;
++	for i=1:numel(paths)
++		if exist(paths{i},'file')
++			ncfile = paths{i};
++			found = 1;
++			break;
+ 		end
+-end
++	end
+ 
+-if nargout==2,
+-	string = 'bed';
++	if ~found
++		error(['Could not find ' basename '-' ncdate '.nc, you can add the path to the list or provide its path as a 5th argument']);
++	end
+ end
+ 
+ disp(['   -- BedMachine Antarctica version: ' ncdate]);
+-xdata = double(ncread(nc,'x'));
+-ydata = double(ncread(nc,'y'));
++xdata = double(ncread(ncfile,'x'));
++ydata = double(ncread(ncfile,'y'));
+ 
+ offset=2;
+ 
+ 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);
+ 
+ if strcmp(string,'icemask'),
+ 	disp(['   -- BedMachine Antarctica: loading ' string]);
+-	%data  = double(ncread(nc,'mask'))';
+-	data  = double(ncread(nc,'mask',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
++	%data  = double(ncread(ncfile,'mask'))';
++	data  = double(ncread(ncfile,'mask',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+ 	xdata=xdata(id1x:id2x);
+ 	ydata=ydata(id1y:id2y);
+ 	%ice ocean interface is between 0 and 3, so we might get some 1 by interpolating
+@@ -59,8 +83,8 @@
+ 	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]))';
++	%data  = double(ncread(ncfile,string))';
++	data  = double(ncread(ncfile,string,[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+ 	xdata=xdata(id1x:id2x);
+ 	ydata=ydata(id1y:id2y);
+ end
+@@ -69,9 +93,7 @@
+ 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
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26041)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26042)
+@@ -1,36 +1,62 @@
+ function output = interpBedmachineGreenland(X,Y,string,ncdate),
++%INTERPBEDMACHINEGREENLAND - interpolate BedMachine data onto X and Y
++%
++%   Examples:
++%      bed       = interpBedmachineGreenland(X,Y,'bed');
++%      surface   = interpBedmachineGreenland(X,Y,'surface');
++%      thickness = interpBedmachineGreenland(X,Y,'thickness');
++%      mask      = interpBedmachineGreenland(X,Y,'mask');
++%      mask      = interpBedmachineGreenland(X,Y,'mask','nearest','../Data/BedMachineGreenland_2020-07-15_v03.nc');
++%
++%   - mask:   0 ocean, 1 land (ice free), 2 grounded ice, 3 floating ice
++%   - source: 1 IBCSO/RTopo-2, 2 MC, 3 interpolation, 4 hydrostatic eq, 
++%             5 Streamline diffusion, 6 Gravity inversion
++%   - optional 4th input argument: interpolation method.
++%             Supported interpolation methos: 'linear','cubic','nearest'
++%   - optional 5th input argument: path to dataset.
++%
++% Version 11/30/2018 Mathieu Morlighem mmorligh@uci.edu
+ 
+ if nargin<3, string = 'bed'; end
+-if nargin<4,
++if nargin<4
++	if strcmp(string,'mask') | strcmp(string,'source')
++		method='nearest'; % default method
++	else
++		method='cubic'; % default method
++	end
++end
++if nargin<5
+ 	%ncdate='2015-04-27'; %BedMachine v2
+ 	ncdate='2017-09-25'; %BedMachine v3
+ 	ncdate='2020-04-14';
+ end
+-
+ basename = 'BedMachineGreenland';
+ 
+-%List of common paths to try
+-paths = {...
+-	['/u/astrid-r1b/ModelData/ModelData/MCdataset-' ncdate '.nc'],...
+-	['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
+-	['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+-	['./' basename '-' ncdate '.nc'],...
+-	};
++if nargin==5
++	ncfile = ncdate;
++else
++	%List of common paths to try
++	paths = {...
++		['/u/astrid-r1b/ModelData/ModelData/MCdataset-' ncdate '.nc'],...
++		['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
++		['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
++		['./' basename '-' ncdate '.nc'],...
++		};
+ 
+-found = 0;
+-for i=1:numel(paths)
+-	if exist(paths{i},'file')
+-		ncfile = paths{i};
+-		found = 1;
+-		break;
++	found = 0;
++	for i=1:numel(paths)
++		if exist(paths{i},'file')
++			ncfile = paths{i};
++			found = 1;
++			break;
++		end
+ 	end
+-end
+ 
+-if ~found
+-	error(['Could not find ' basename '-' ncdate '.nc, you can add the path to the list']);
++	if ~found
++		error(['Could not find ' basename '-' ncdate '.nc, you can add the path to the list or provide its path as a 5th argument']);
++	end
+ end
+ 
+-
+ disp(['   -- BedMachine Greenland version: ' ncdate]);
+ xdata = double(ncread(ncfile,'x'));
+ ydata = double(ncread(ncfile,'y'));
+@@ -56,6 +82,7 @@
+ data(find(data==-9999))=NaN;
+ 
+ disp(['   -- BedMachine Greenland: interpolating ' string]);
++disp(['       -- Interpolation method: ' method]);
+ if strcmp(string,'mask') | strcmp(string,'source'),
+ 	%Need nearest neighbor to avoid interpolation between 0 and 2
+ 	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y),'nearest');
+@@ -63,4 +90,55 @@
+ 	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y));
+ end
+ 
+-%TEST https://www.mathworks.com/matlabcentral/fileexchange/10772-fast-2-dimensional-interpolation
++end
++function zi = FastInterp(x,y,data,xi,yi,method)
++
++	%get data size
++	[M N] = size(data);
++
++	% Get X and Y library array spacing
++	ndx = 1/(x(2)-x(1));    ndy = 1/(y(2)-y(1));
++	% Begin mapping xi and yi vectors onto index space by subtracting library
++	% array minima and scaling to index spacing
++
++	xi = (xi - x(1))*ndx;       yi = (yi - y(1))*ndy;
++
++	% Fill Zi with NaNs
++	zi = NaN(size(xi));
++
++	if strcmpi(method,'nearest'),
++		% Find the nearest point in index space
++		rxi = round(xi)+1;  ryi = round(yi)+1;
++		% Find points that are in X,Y range
++		flag = rxi>0 & rxi<=N & ~isnan(rxi) & ryi>0 & ryi<=M & ~isnan(ryi);
++		% Map subscripts to indices
++		ind = ryi + M*(rxi-1);
++		zi(flag) = data(ind(flag));
++
++	else %Bilinear
++
++		% Transform to unit square
++		fxi = floor(xi)+1;  fyi = floor(yi)+1; % x_i and y_i
++		dfxi = xi-fxi+1;    dfyi = yi-fyi+1;   % Location in unit square
++
++		% flagIn determines whether the requested location is inside of the data arrays
++		flagIn = fxi>0 & fxi<N & ~isnan(fxi) & fyi>0 & fyi<M & ~isnan(fyi);
++
++		%Toss all out-of-bounds variables now to save time
++		fxi  = fxi(flagIn);  fyi  = fyi(flagIn);
++		dfxi = dfxi(flagIn); dfyi = dfyi(flagIn);
++
++		%Find bounding vertices
++		ind1 = fyi + M*(fxi-1);     % indices of (  x_i  ,  y_i  )
++		ind2 = fyi + M*fxi;         % indices of ( x_i+1 ,  y_i  )
++		ind3 = fyi + 1 + M*fxi;     % indices of ( x_i+1 , y_i+1 )
++		ind4 = fyi + 1 + M*(fxi-1); % indices of (  x_i  , y_i+1 )
++
++		% Bilinear interpolation
++		zi(flagIn) = ...
++			data(ind1).*(1-dfxi).*(1-dfyi) + ...
++			data(ind2).*dfxi.*(1-dfyi) + ...
++			data(ind4).*(1-dfxi).*dfyi + ...
++			data(ind3).*dfxi.*dfyi;
++	end
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26042-26043.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26042-26043.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26042-26043.diff	(revision 26740)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26042)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26043)
+@@ -1,4 +1,4 @@
+-function output = interpBedmachineGreenland(X,Y,string,ncdate),
++function output = interpBedmachineGreenland(X,Y,string,method,ncdate)
+ %INTERPBEDMACHINEGREENLAND - interpolate BedMachine data onto X and Y
+ %
+ %   Examples:
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26042)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26043)
+@@ -1,4 +1,4 @@
+-function output = interpBedmachineAntarctica(X,Y,string,method,ncdate),
++function output = interpBedmachineAntarctica(X,Y,string,method,ncdate)
+ %INTERPBEDMACHINEANTARCTICA - interpolate BedMachine data onto X and Y
+ %
+ %   Examples:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26043-26044.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26043-26044.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26043-26044.diff	(revision 26740)
@@ -0,0 +1,1987 @@
+Index: ../trunk-jpl/src/wrappers/python/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26043)
++++ ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26044)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+@@ -105,7 +105,7 @@
+ if STANDALONE_LIBRARIES
+ libISSMPython_la_LDFLAGS = -static
+ libISSMApi_la_LDFLAGS = -static
+-deps += $(DAKOTALIB) $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
++deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
+ endif
+ 
+ libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB)
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 26043)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 26044)
+@@ -12,6 +12,9 @@
+ # - Investigate refactoring parsing of list of changed files
+ ################################################################################
+ 
++# Override certain aliases
++alias grep=$(which grep)
++
+ echo "Cleaning up execution directory"
+ rm -rf $ISSM_DIR/execution/*
+ rm -rf $ISSM_DIR/nightlylog
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26043)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26044)
+@@ -30,7 +30,7 @@
+ 	else
+ 		PACKAGE_DATE="unknown"
+ 	fi
+-	AC_DEFINE_UNQUOTED(PACKAGE_BUILD_DATE, "$PACKAGE_DATE", [build date])
++	AC_DEFINE_UNQUOTED([PACKAGE_BUILD_DATE], "${PACKAGE_DATE}", [build date])
+ 	AC_MSG_RESULT([${PACKAGE_DATE}])
+ 
+ 	dnl User name
+@@ -45,7 +45,7 @@
+ 			user_name =`(whoami) 2>/dev/null` || user_name=unknown
+ 		fi
+ 	fi
+-	AC_DEFINE_UNQUOTED(USER_NAME, "$user_name", [user name])
++	AC_DEFINE_UNQUOTED([USER_NAME], "${user_name}", [user name])
+ 	AC_MSG_RESULT([${user_name}])
+ 
+ 	AC_MSG_CHECKING([host full OS name and version])
+@@ -54,15 +54,15 @@
+ 		dnl linux is linux is linux, regardless of RMS
+ 		linux-gnu* | lignux* )	host_os=linux ;;
+ 	esac
+-	AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", [host full OS name and version])
++	AC_DEFINE_UNQUOTED([HOST_OS], "${host_os}", [host full OS name and version])
+ 	AC_MSG_RESULT([${host_os}])
+ 
+ 	AC_MSG_CHECKING([host cpu])
+-	AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu", [host CPU])
++	AC_DEFINE_UNQUOTED([HOST_CPU], "${host_cpu}", [host CPU])
+ 	AC_MSG_RESULT([${host_cpu}])
+ 
+ 	AC_MSG_CHECKING([vendor])
+-	AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor", [host vendor])
++	AC_DEFINE_UNQUOTED([HOST_VENDOR], "${host_vendor}", [host vendor])
+ 	AC_MSG_RESULT([${host_vendor}])
+ 
+ 	AC_MSG_CHECKING([host OS name])
+@@ -72,7 +72,7 @@
+ 		dnl linux is linux is linux, regardless of RMS.
+ 		linux-gnu* | lignux* )	host_os_name=linux ;;
+ 	esac
+-	AC_DEFINE_UNQUOTED(HOST_OS_NAME, "$host_os_name", [host OS name])
++	AC_DEFINE_UNQUOTED([HOST_OS_NAME], "${host_os_name}", [host OS name])
+ 	AC_MSG_RESULT([${host_os_name}])
+ 
+ 	dnl Parse out the OS version of the host
+@@ -81,7 +81,7 @@
+ 	if test -z "$host_os_version"; then
+ 		host_os_version=`(uname -r) 2>/dev/null` || host_os_version=unknown
+ 	fi
+-	AC_DEFINE_UNQUOTED(HOST_OS_VERSION, "$host_os_version", [host OS version])
++	AC_DEFINE_UNQUOTED([HOST_OS_VERSION], "${host_os_version}", [host OS version])
+ 	AC_MSG_RESULT([${host_os_version}])
+ 
+ 	dnl Determine host architecture (different than CPU)
+@@ -94,7 +94,7 @@
+ 		sun )	host_arch=`(arch) 2>/dev/null` || host_arch=unknown ;;
+ 		i?86 )	host_arch=i386 ;; # all x86 should show up as i386
+ 	esac
+-	AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_arch", [host archictecture])
++	AC_DEFINE_UNQUOTED([HOST_ARCH], "${host_arch}", [host archictecture])
+ 	AC_MSG_RESULT([${host_arch}])
+ 
+ 	dnl }}}
+@@ -218,9 +218,10 @@
+ 	else
+ 		AC_MSG_RESULT([no])
+ 	fi
+-	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], $SYSTEM_FMEMOPEN, [does system copy of libc have fmemopen])
++	AC_DEFINE_UNQUOTED([_SYSTEM_HAS_FMEMOPEN_], ${SYSTEM_FMEMOPEN}, [does system copy of libc have fmemopen])
+ 	AM_CONDITIONAL([SYSTEM_HAS_FMEMOPEN], [test "${SYSTEM_FMEMOPEN}" == "1"])
+ 
++	IS_MSYS2=no
+ 	IS_WINDOWS=no
+ 	AC_MSG_CHECKING([for vendor compilers])
+ 	if test -n "${VENDOR}"; then
+@@ -317,20 +318,34 @@
+ 			export CXXFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict -std=c++11"
+ 			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
+ 			AC_DEFINE([_HAVE_RESTRICT_], [1], [with restrict buffers])
++		elif test "${VENDOR}" == "win-msys2"; then
++			export LDFLAGS="${LDFLAGS} -no-undefined"
++			export OSLIBS="-Wl,-L/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0 -Wl,-L/mingw64/x86_64-w64-mingw32/lib -Wl,-lstdc++ -Wl,-lgfortran -Wl,-lmingw32 -Wl,-lgcc_s -Wl,-lmoldname -Wl,-lmingwex -Wl,-lmsvcrt -Wl,-lm -Wl,-lpthread -Wl,-lshell32 -Wl,-luser32 -Wl,-lgdi32 -Wl,-luser32 -Wl,-ladvapi32 -Wl,-lkernel32 -Wl,-lquadmath -Wl,-lstdc++ -Wl,-lgcc"
++			IS_MSYS2=yes
+ 		else
+ 			AC_MSG_ERROR([unknown compiler vendor!])
+ 		fi
+ 	fi
++	dnl Set default standard for C++
++	if test "${CXXFLAGS}" == ""; then
++		export CXXFLAGS="-std=C++11"
++	fi
+ 	AC_SUBST([OSLIBS])
+ 	AC_MSG_RESULT([done])
+ 
+-	AC_MSG_CHECKING([if this is a Windows build])
++	AC_MSG_CHECKING([if this is a MSVC (Windows) build])
+ 	AM_CONDITIONAL([WINDOWS], [test "x${IS_WINDOWS}" == "xyes"])
+ 	AC_MSG_RESULT([${IS_WINDOWS}])
++
++	AC_MSG_CHECKING([if this is a MSYS2 (Windows) build])
++	AM_CONDITIONAL([MSYS2], [test "x${IS_MSYS2}" == "xyes"])
++	AC_MSG_RESULT([${IS_MSYS2}])
++	AC_DEFINE([_IS_MSYS2_], [1], [is a MSYS2 (Windows) build])
+ 	dnl }}}
+ 	dnl MATLAB{{{
+ 
+ 	dnl See if MATLAB has been provided
++	AC_MSG_CHECKING([for MATLAB])
+ 	AC_ARG_WITH(
+ 		[matlab-dir],														dnl feature
+ 		AS_HELP_STRING([--with-matlab-dir=DIR], [MATLAB root directory]),	dnl help string
+@@ -337,7 +352,6 @@
+ 		[MATLAB_ROOT=${withval}],											dnl action if given
+ 		[MATLAB_ROOT="no"]													dnl action if not given
+ 	)
+-	AC_MSG_CHECKING([for MATLAB])
+ 	if test "x${MATLAB_ROOT}" == "xno"; then
+ 		HAVE_MATLAB=no
+ 	else
+@@ -356,7 +370,7 @@
+ 	if test "x${HAVE_MATLAB}" == "xyes"; then
+ 		AC_DEFINE([_HAVE_MATLAB_], [1], [with MATLAB in ISSM src])
+ 
+-		dnl Set MEXLIB, MEXLINK, and MEXEXT
++		dnl Set MEX* variable
+ 		AC_MSG_CHECKING([MATLAB's mex compilation flags])
+ 
+ 		dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
+@@ -366,32 +380,55 @@
+ 			*cygwin*)
+ 				if test "${VENDOR}" == "intel-win7-32"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win32/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MEXEXT=`${MATLAB_ROOT}/bin/mexext.bat`
+ 					MEXEXT=".${MEXEXT}"
+ 				elif test "${VENDOR}" == "intel-win7-64"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINK="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINKFLAGS="-Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MEXEXT=".mexw64"
+ 				elif test "${VENDOR}" == "MSVC-Win64" || test "${VENDOR}" == "MSVC-Win64-par"; then
+ 					MEXLIB="-Wl,libmx.lib -Wl,libmex.lib -Wl,libmat.lib ${OSLIBS} -Wl,libf2cblas.lib -Wl,libf2clapack.lib"
+-					MEXLINK="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
++					MEXLINKFLAGS="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${MATLAB_ROOT}/extern/lib/win64/microsoft` -Wl,/link -Wl,/EXPORT:mexFunction -Wl,/DLL"
+ 					MATLABINCL="-I`cygpath -m ${MATLAB_ROOT}/extern/include`"
+ 					MEXEXT=".mexw64"
+ 				fi
+ 			;;
++			*mingw*)
++				if test "${IS_MSYS2}" == "yes"; then
++					dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
++					MEXEXT=".mexw64"
++					MATLABINCL="-I${MATLAB_ROOT}/extern/include"
++					MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
++					MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
++					MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
++					MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
++					MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
++					MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
++				fi
++			;;
++			*msys*)
++				dnl Value to set MEXEXT to can be found on Windows by running $MATLAB_ROOT/bin/mexext.bat
++				MEXEXT=".mexw64"
++				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
++				MEXOPTFLAGS="-O2 -fwrapv -DNDEBUG -g"
++				MEXCFLAGS="-fexceptions -fno-omit-frame-pointer -m64 -DMATLAB_MEX_FILE"
++				MEXCXXFLAGS="-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE"
++				MEXLINKFLAGS="-m64 -Wl,--no-undefined -shared -static -Wl,${MATLAB_ROOT}/extern/lib/win64/mingw64/mexFunction.def"
++				MEXLIB_DIR="${MATLAB_ROOT}/extern/lib/win64/mingw64"
++				MEXLIB="-L${MEXLIB_DIR} -lmx -lmex -lmat -lm -lmwlapack -lmwblas"
++			;;
+ 			*)
++				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
+ 				MATLABINCL="-I${MATLAB_ROOT}/extern/include"
+-				MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
++				MEXLINKFLAGS=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/         LDFLAGS            = //g")
+ 				MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/         CXXLIBS            = //g")
+-				MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
+-				dnl version 2014 and up
+ 				if test -z "${MEXEXT}"; then
+ 					echo "#include <mex.h>" > conftest.cpp
+ 					echo "void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}" >> conftest.cpp
+ 					${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1
+ 					rm -f conftest.cpp
+-					MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
++					MEXLINKFLAGS=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")
+ 					MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
+ 					MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
+ 					if test -z "${MEXEXT}"; then
+@@ -401,8 +438,8 @@
+ 				fi
+ 
+ 				dnl Make sure mexFunction.map is not in MEXLIB to avoid problems with global variables
+-				dnl MEXLINK=$(echo ${MEXLINK} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
+-				MEXLINK="" dnl We actually don't need MEXLINK????
++				dnl MEXLINKFLAGS=$(echo ${MEXLINKFLAGS} | sed -e "s/,-expo.*mexFunction\\.map\"//g" | sed -e "s/-[[^ ]]*mexFunction\\.map//g")
++				MEXLINKFLAGS="" dnl We actually don't need MEXLINK????
+ 			;;
+ 		esac
+ 		AC_MSG_RESULT([done])
+@@ -410,14 +447,17 @@
+ 			AC_MSG_ERROR([Couldn't use MATLAB's mex... check manual compilation with MATLAB or error message above])
+ 		fi
+ 
++		AC_SUBST([MEXEXT])
++		AC_SUBST([MEXOPTFLAGS])
++		AC_SUBST([MEXCFLAGS])
++		AC_SUBST([MEXCXXFLAGS])
+ 		AC_SUBST([MATLABINCL])
+-		MATLABWRAPPEREXT=${MEXEXT}
+-		AC_SUBST([MATLABWRAPPEREXT])
++		AC_SUBST([MEXLINKFLAGS])
+ 		AC_SUBST([MEXLIB])
+-		AC_SUBST([MEXLINK])
+ 	fi
+ 	dnl }}}
+ 	dnl JavaScript{{{
++	AC_MSG_CHECKING([for JavaScript])
+ 	AC_ARG_WITH(
+ 		[javascript],
+ 		AS_HELP_STRING([--with-javascript], [compile JavaScript wrappers? (default: no)]),
+@@ -424,7 +464,6 @@
+ 		[JAVASCRIPT=${withval}],
+ 		[JAVASCRIPT="no"]
+ 	)
+-	AC_MSG_CHECKING([for JavaScript])
+ 	if test "x${JAVASCRIPT}" == "xno"; then
+ 		HAVE_JAVASCRIPT=no
+ 	else
+@@ -437,6 +476,7 @@
+ 	AC_SUBST([JAVASCRIPTWRAPPEREXT])
+ 	dnl }}}
+ 	dnl Triangle {{{
++	AC_MSG_CHECKING([for triangle])
+ 	AC_ARG_WITH(
+ 		[triangle-dir],
+ 		AS_HELP_STRING([--with-triangle-dir=DIR], [Triangle root directory]),
+@@ -443,7 +483,6 @@
+ 		[TRIANGLE_ROOT=${withval}],
+ 		[TRIANGLE_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for triangle])
+ 	if test "x${TRIANGLE_ROOT}" == "xno"; then
+ 		HAVE_TRIANGLE=no
+ 	else
+@@ -482,6 +521,22 @@
+ 					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
+ 				fi
+ 			;;
++			*mingw*)
++				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
++					dnl Link to the object file, not the library
++					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
++				else
++					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
++				fi
++			;;
++			*msys*)
++				if test "x${HAVE_JAVASCRIPT}" == "xyes"; then
++					dnl Link to the object file, not the library
++					TRIANGLELIB=${TRIANGLE_ROOT}/share/triangle.o
++				else
++					TRIANGLELIB="-L${TRIANGLE_ROOT}/lib -ltriangle"
++				fi
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_TRIANGLE_], [1], [with Triangle in ISSM src])
+ 		AC_SUBST([TRIANGLEINCL])
+@@ -489,6 +544,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Boost{{{
++	AC_MSG_CHECKING([for Boost])
+ 	AC_ARG_WITH(
+ 		[boost-dir],
+ 		AS_HELP_STRING([--with-boost-dir=DIR], [Boost root directory]),
+@@ -495,7 +551,6 @@
+ 		[BOOST_ROOT=${withval}],
+ 		[BOOST_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Boost])
+ 	if test "x${BOOST_ROOT}" == "xno"; then
+ 		HAVE_BOOST=no
+ 	else
+@@ -522,6 +577,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Dakota{{{
++	AC_MSG_CHECKING([for Dakota])
+ 	AC_ARG_WITH(
+ 		[dakota-dir],
+ 		AS_HELP_STRING([--with-dakota-dir=DIR], [Dakota root directory]),
+@@ -528,7 +584,6 @@
+ 		[DAKOTA_ROOT=${withval}],
+ 		[DAKOTA_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Dakota])
+ 	if test "x${DAKOTA_ROOT}" == "xno"; then
+ 		HAVE_DAKOTA=no
+ 	else
+@@ -545,11 +600,16 @@
+ 		DAKOTAINCL=-I${DAKOTA_ROOT}/include
+ 
+ 		AC_MSG_CHECKING(for Dakota version)
+-		dnl TODO:	Check if this method applies to all other versions of 
+-		dnl			Dakota (it should as long as the Dakota binaries have been
+-		dnl 		compiled). If so, we can remove the other methods of 
+-		dnl			getting the version.
++		dnl TODO:
++		dnl - Check if this method applies to all other versions of Dakota (it 
++		dnl   should as long as the Dakota binaries have been compiled). If so, 
++		dnl   we can remove the other methods of getting the version.
++		dnl - Modify src/wrappers/IssmConfig/IssmConfig.cpp so that strlen is 
++		dnl   not called with _DAKOTA_VERSION_ as an argument so that we can 
++		dnl   do,
+ 		dnl
++		dnl   	AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_], ${DAKOTA_VERSION}, [Dakota version number])
++		dnl
+ 		DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
+ 		if test -n "${DAKOTA_VERSION_OUTPUT}"; then
+ 			DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
+@@ -678,13 +738,13 @@
+ 		esac
+ 		AC_MSG_CHECKING(for Dakota major version)
+ 		AC_MSG_RESULT(${DAKOTA_MAJOR})
+-		AC_DEFINE_UNQUOTED(_DAKOTA_MAJOR_, $DAKOTA_MAJOR, [Dakota major version number])
++		AC_DEFINE_UNQUOTED([_DAKOTA_MAJOR_], ${DAKOTA_MAJOR}, [Dakota major version number])
+ 		AC_MSG_CHECKING(for Dakota minor version)
+ 		AC_MSG_RESULT(${DAKOTA_MINOR})
+-		AC_DEFINE_UNQUOTED(_DAKOTA_MINOR_, $DAKOTA_MINOR, [Dakota minor version number])
++		AC_DEFINE_UNQUOTED([_DAKOTA_MINOR_], ${DAKOTA_MINOR}, [Dakota minor version number])
+ 		AC_MSG_CHECKING(for Dakota build version)
+ 		AC_MSG_RESULT(${DAKOTA_BUILD})
+-		AC_DEFINE_UNQUOTED(_DAKOTA_BUILD_, $DAKOTA_BUILD, [Dakota build version number])
++		AC_DEFINE_UNQUOTED([_DAKOTA_BUILD_], ${DAKOTA_BUILD}, [Dakota build version number])
+ 
+ 		AC_DEFINE([_HAVE_DAKOTA_], [1], [with Dakota in ISSM src])
+ 		AC_SUBST([DAKOTAINCL])
+@@ -694,6 +754,7 @@
+ 	AM_CONDITIONAL([ISSM_DAKOTA], [test "x${DAKOTA_MAJOR}" == "x6"])
+ 	dnl }}}
+ 	dnl Python{{{
++	AC_MSG_CHECKING([for Python])
+ 	AC_ARG_WITH(
+ 		[python-dir],
+ 		AS_HELP_STRING([--with-python-dir=DIR], [Python root directory]),
+@@ -707,7 +768,6 @@
+ 		[PYTHON_VERSION=${withval}],
+ 		[PYTHON_VERSION="no"]
+ 	)
+-	AC_MSG_CHECKING([for Python])
+ 	if test "x${PYTHON_ROOT}" == "xno"; then
+ 		HAVE_PYTHON=no
+ 		HAVE_PYTHON3=no
+@@ -734,7 +794,7 @@
+ 		fi
+ 		dnl Determine major version
+ 		PYTHON_MAJOR=${PYTHON_VERSION%.*}
+-		AC_DEFINE_UNQUOTED(_PYTHON_MAJOR_, $PYTHON_MAJOR, [Python version major])
++		AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_], ${PYTHON_MAJOR}, [Python version major])
+ 		if test "x${PYTHON_MAJOR}" == "x3"; then
+ 			HAVE_PYTHON3="yes"
+ 		else
+@@ -750,7 +810,7 @@
+ 		elif test -f "${PYTHON_ROOT}/include/python${PYTHON_VERSION}m/Python.h"; then
+ 			PYTHONINCL=-I${PYTHON_ROOT}/include/python${PYTHON_VERSION}m
+ 		else
+-			AC_MSG_ERROR([Python.h not found, locate this file and contact ISSM developers]);
++			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
+ 		fi
+ 		AC_MSG_RESULT([found])
+ 		if test "x${PYTHON_MAJOR}" == "x3"; then
+@@ -763,12 +823,18 @@
+ 			*cygwin*)
+ 				PYTHONLINK="-shared"
+ 			;;
++			*darwin*)
++				PYTHONLINK="-dynamiclib"
++			;;
+ 			*linux*)
+ 				PYTHONLINK="-shared"
+ 			;;
+-			*darwin*)
+-				PYTHONLINK="-dynamiclib"
++			*mingw*)
++				PYTHONLINK="-shared"
+ 			;;
++			*msys*)
++				PYTHONLINK="-shared"
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_PYTHON_], [1], [with Python in ISSM src])
+ 		AC_SUBST([PYTHONINCL])
+@@ -780,10 +846,16 @@
+ 	AM_CONDITIONAL([PYTHON3], [test "x${HAVE_PYTHON3}" == "xyes"])
+ 	dnl }}}
+ 	dnl NumPy{{{
++	dnl NOTE: You can find NumPy by running,
++	dnl
++	dnl		>>> import numpy
++	dnl		>>> numpy.__file__
++	dnl
+ 	dnl TODO:
+ 	dnl - Replace references to python-numpy with numpy (and similar terms)
+ 	dnl	  project-wide
+ 	dnl
++	AC_MSG_CHECKING(for python-numpy)
+ 	AC_ARG_WITH(
+ 		[python-numpy-dir],
+ 		AS_HELP_STRING([--with-python-numpy-dir=DIR], [python-numpy root directory]),
+@@ -790,14 +862,6 @@
+ 		[PYTHON_NUMPY_ROOT=${withval}],
+ 		[PYTHON_NUMPY_ROOT="no"]
+ 	)
+-
+-	dnl NOTE: You can find NumPy by running,
+-	dnl
+-	dnl		>>> import numpy
+-	dnl		>>> numpy.__file__
+-	dnl
+-
+-	AC_MSG_CHECKING(for python-numpy)
+ 	if test "x${PYTHON_NUMPY_ROOT}" == "xno"; then
+ 		HAVE_PYTHON_NUMPY=no
+ 	else
+@@ -816,6 +880,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Chaco{{{
++	AC_MSG_CHECKING([for Chaco])
+ 	AC_ARG_WITH(
+ 		[chaco-dir],
+ 		AS_HELP_STRING([--with-chaco-dir=DIR], [Chaco root directory]),
+@@ -822,7 +887,6 @@
+ 		[CHACO_ROOT=${withval}],
+ 		[CHACO_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Chaco])
+ 	if test "x${CHACO_ROOT}" == "xno"; then
+ 		HAVE_CHACO=no
+ 	else
+@@ -844,6 +908,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl ESMF{{{
++	AC_MSG_CHECKING([for ESMF])
+ 	AC_ARG_WITH(
+ 		[esmf-dir],
+ 		AS_HELP_STRING([--with-esmf-dir=DIR], [ESMF root directory]),
+@@ -850,7 +915,6 @@
+ 		[ESMF_ROOT=${withval}],
+ 		[ESMF_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ESMF])
+ 	if test "x${ESMF_ROOT}" == "xno"; then
+ 		HAVE_ESMF=no
+ 	else
+@@ -872,6 +936,7 @@
+ 	AM_CONDITIONAL([ESMF], [test "x${HAVE_ESMF}" == "xyes"])
+ 	dnl }}}
+ 	dnl CoDiPack{{{
++	AC_MSG_CHECKING([for CoDiPack])
+ 	AC_ARG_WITH(
+ 		[codipack-dir],
+ 		AS_HELP_STRING([--with-codipack-dir=DIR], [CoDiPack root directory]),
+@@ -878,7 +943,6 @@
+ 		[CODIPACK_ROOT=${withval}],
+ 		[CODIPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for CoDiPack])
+ 	if test "x${CODIPACK_ROOT}" == "xno"; then
+ 		HAVE_CODIPACK=no
+ 	else
+@@ -900,6 +964,7 @@
+ 	AM_COND_IF(CODIPACK, [CXXFLAGS+=" -std=c++11"])
+ 	dnl }}}
+ 	dnl Tape Allocation {{{
++	AC_MSG_CHECKING(for tape allocation)
+ 	AC_ARG_ENABLE(
+ 		[tape-alloc],																dnl feature
+ 		AS_HELP_STRING([--enable-tape-alloc], [turn tape allocation support on]),
+@@ -906,7 +971,6 @@
+ 		[enable_tape_alloc=${enableval}],
+ 		[enable_tape_alloc=no]
+ 	)
+-	AC_MSG_CHECKING(for tape allocation)
+ 	if test "x${enable_tape_alloc}" == "xyes"; then
+ 		AC_DEFINE([_AD_TAPE_ALLOC_], [1], [enable a priori tape allocation for AD])
+ 	fi
+@@ -913,6 +977,7 @@
+ 	AC_MSG_RESULT([${enable_tape_alloc}])
+ 	dnl }}}
+ 	dnl ADOL-C {{{
++	AC_MSG_CHECKING([for ADOL-C])
+ 	AC_ARG_WITH(
+ 		[adolc-dir],
+ 		AS_HELP_STRING([--with-adolc-dir=DIR], [ADOL-C root directory]),
+@@ -919,7 +984,6 @@
+ 		[ADOLC_ROOT=${withval}],
+ 		[ADOLC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ADOL-C])
+ 	if test "x${ADOLC_ROOT}" == "xno"; then
+ 		HAVE_ADOLC=no
+ 	else
+@@ -944,6 +1008,7 @@
+ 	AM_COND_IF(ADOLC, [CXXFLAGS+=" -std=c++11"])
+ 	dnl }}}
+ 	dnl ADOL-C version{{{
++	AC_MSG_CHECKING(for ADOL-C version)
+ 	AC_ARG_WITH(
+ 		[adolc-version],
+ 		AS_HELP_STRING([--with-adolc-version=number], [ADOL-C version]),
+@@ -950,12 +1015,11 @@
+ 		[ADOLC_VERSION=${withval}],
+ 		[ADOLC_VERSION=2]
+ 	)
+-	AC_MSG_CHECKING(for ADOL-C version)
+-
+-	AC_DEFINE_UNQUOTED(_ADOLC_VERSION_, $ADOLC_VERSION, [ADOL-C version])
++	AC_DEFINE_UNQUOTED([_ADOLC_VERSION_], ${ADOLC_VERSION}, [ADOL-C version])
+ 	AC_MSG_RESULT(${ADOLC_VERSION})
+ 	dnl }}}
+ 	dnl ADIC2 {{{
++	AC_MSG_CHECKING([for ADIC2])
+ 	AC_ARG_WITH(
+ 		[adic2-dir],
+ 		AS_HELP_STRING([--with-adic2-dir=DIR], [ADIC2 root directory]),
+@@ -962,7 +1026,6 @@
+ 		[ADIC2_ROOT=${withval}],
+ 		[ADIC2_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ADIC2])
+ 	if test "x${ADIC2_ROOT}" == "xno"; then
+ 		HAVE_ADIC2=no
+ 	else
+@@ -984,6 +1047,7 @@
+ 	AM_CONDITIONAL([ADIC2], [test "x${HAVE_ADIC2}" == "xyes"])
+ 	dnl }}}
+ 	dnl ATLAS {{{
++	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
+ 	AC_ARG_WITH(
+ 		[atlas-dir],
+ 		AS_HELP_STRING([--with-atlas-dir=DIR], [ATLAS root directory]),
+@@ -990,7 +1054,6 @@
+ 		[ATLAS_ROOT=${withval}],
+ 		[ATLAS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING(for ATLAS and CBLAS libraries)
+ 	if test "x${ATLAS_ROOT}" == "xno"; then
+ 		HAVE_ATLAS=no
+ 	else
+@@ -1007,12 +1070,18 @@
+ 			*cygwin*)
+ 				ATLASLIB="-L`cygpath -m ${ATLAS_ROOT}` -Wl,libatlas.lib  -Wl,libcblas.lib"
+ 			;;
++			*darwin*)
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
++			;;
+ 			*linux*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+ 			;;
+-			*darwin*)
+-				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm "
++			*mingw*)
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
+ 			;;
++			*msys*)
++				ATLASLIB="-L${ATLAS_ROOT}/lib -lcblas -latlas -lm"
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_ATLAS_], [1], [with ATLAS in ISSM src])
+ 		AC_SUBST([ATLASLIB])
+@@ -1019,6 +1088,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl GSL{{{
++	AC_MSG_CHECKING([for GSL])
+ 	AC_ARG_WITH(
+ 		[gsl-dir],
+ 		AS_HELP_STRING([--with-gsl-dir=DIR], [GSL root directory]),
+@@ -1025,7 +1095,6 @@
+ 		[GSL_ROOT=${withval}],
+ 		[GSL_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for GSL])
+ 	if test "x${GSL_ROOT}" == "xno"; then
+ 		HAVE_GSL=no
+ 	else
+@@ -1051,6 +1120,7 @@
+ 	AM_CONDITIONAL([GSL], [test "x${HAVE_GSL}" == "xyes"])
+ 	dnl }}}
+ 	dnl AMPI (ADOL-C){{{
++	AC_MSG_CHECKING([for AMPI])
+ 	AC_ARG_WITH(
+ 		[ampi-dir],
+ 		AS_HELP_STRING([--with-ampi-dir=DIR], [Adjoinable MPI root directory]),
+@@ -1057,7 +1127,6 @@
+ 		[AMPI_ROOT=${withval}],
+ 		[AMPI_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for AMPI])
+ 	if test "x${AMPI_ROOT}" == "xno"; then
+ 		HAVE_AMPI=no
+ 	else
+@@ -1087,6 +1156,7 @@
+ 	AM_CONDITIONAL([AMPI], [test "x${HAVE_AMPI}" == "xyes"])
+ 	dnl }}}
+ 	dnl Adjoint MPI (CoDiPack){{{
++	AC_MSG_CHECKING([for Adjoint MPI])
+ 	AC_ARG_WITH(
+ 		[adjointmpi-dir],
+ 		AS_HELP_STRING([--with-adjointmpi-dir=DIR], [Adjoint MPI root directory]),
+@@ -1093,7 +1163,6 @@
+ 		[ADJOINTMPI_ROOT=${withval}],
+ 		[ADJOINTMPI_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Adjoint MPI])
+ 	if test "x${ADJOINTMPI_ROOT}" == "xno"; then
+ 		HAVE_ADJOINTMPI=no
+ 	else
+@@ -1121,6 +1190,7 @@
+ 	AM_CONDITIONAL([ADJOINTMPI], [test "x${HAVE_ADJOINTMPI}" == "xyes"])
+ 	dnl }}}
+ 	dnl MeDiPack (CoDiPack, ADOL-C dev){{{
++	AC_MSG_CHECKING([for MeDiPack])
+ 	AC_ARG_WITH(
+ 		[medipack-dir],
+ 		AS_HELP_STRING([--with-medipack-dir=DIR], [MeDiPack root directory]),
+@@ -1127,7 +1197,6 @@
+ 		[MEDIPACK_ROOT=${withval}],
+ 		[MEDIPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MeDiPack])
+ 	if test "x${MEDIPACK_ROOT}" == "xno"; then
+ 		HAVE_MEDIPACK=no
+ 	else
+@@ -1153,6 +1222,7 @@
+ 	AM_CONDITIONAL([MEDIPACK], [test "x${HAVE_MEDIPACK}" == "xyes"])
+ 	dnl }}}
+ 	dnl HDF5 {{{
++	AC_MSG_CHECKING(for HDF5 libraries)
+ 	AC_ARG_WITH(
+ 		[hdf5-dir],
+ 		AS_HELP_STRING([--with-hdf5-dir=DIR], [HDF5 root directory]),
+@@ -1159,7 +1229,6 @@
+ 		[HDF5_ROOT=${withval}],
+ 		[HDF5_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING(for HDF5 libraries)
+ 	if test "x${HDF5_ROOT}" == "xno"; then
+ 		HAVE_HDF5=no
+ 	else
+@@ -1180,12 +1249,18 @@
+ 			*cygwin*)
+ 				HDF5LIB="-L`cygpath -m ${HDF5_ROOT}` -Wl,libhdf5.lib  -Wl,libhdf5_hl.lib"
+ 			;;
++			*darwin*)
++				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
++			;;
+ 			*linux*)
+ 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+ 			;;
+-			*darwin*)
++			*mingw*)
+ 				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
+ 			;;
++			*msys*)
++				HDF5LIB="-L${HDF5_ROOT}/lib -lhdf5 -lhdf5_hl"
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_HDF5_], [1], [with HDF5 in ISSM src])
+ 		AC_SUBST([HDF5LIB])
+@@ -1192,6 +1267,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PETSc{{{
++	AC_MSG_CHECKING([for PETSc])
+ 	AC_ARG_WITH(
+ 		[petsc-dir],
+ 		AS_HELP_STRING([--with-petsc-dir=DIR], [PETSc root directory, necessary for parallel build]),
+@@ -1198,7 +1274,6 @@
+ 		[PETSC_ROOT=${withval}],
+ 		[PETSC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for PETSc])
+ 	if test "x${PETSC_ROOT}" == "xno"; then
+ 		HAVE_PETSC=no
+ 	else
+@@ -1219,8 +1294,8 @@
+ 		AC_MSG_CHECKING(for PETSc version)
+ 		PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'`
+ 		PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'`
+-		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major])
+-		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor])
++		AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], ${PETSC_MAJOR}, [PETSc version major])
++		AC_DEFINE_UNQUOTED([_PETSC_MINOR_], ${PETSC_MINOR}, [PETSc version minor])
+ 		AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}])
+ 
+ 		AC_MSG_CHECKING(whether PETSc is the development version)
+@@ -1263,6 +1338,16 @@
+ 					PETSCINCL="/I`cygpath -m ${PETSC_ROOT}/include`"
+ 				fi
+ 			;;
++			*darwin*)
++				if test ${PETSC_MAJOR} -lt 3; then
++					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
++				else
++					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
++					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
++						PETSCLIB+=" -lmetis"
++					fi
++				fi
++			;;
+ 			*linux*)
+ 				if test ${PETSC_MAJOR} -lt 3; then
+ 					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lmpiuni -lpetsc"
+@@ -1279,16 +1364,12 @@
+ 					PETSCLIB="-L${PETSC_ROOT}/lib -lcraypetsc_intel_real -lmetis"
+ 				fi
+ 			;;
+-			*darwin*)
+-				if test ${PETSC_MAJOR} -lt 3; then
+-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsnes -lpetscts -lpetsc"
+-				else
+-					PETSCLIB="-L${PETSC_ROOT}/lib -lpetsc"
+-					if test ${PETSC_MAJOR} -gt 3 || test ${PETSC_MINOR} -ge 3; then
+-						PETSCLIB+=" -lmetis"
+-					fi
+-				fi
++			*mingw*)
++				PETSCLIB="-Wl,${PETSC_ROOT}/lib/libpetsc.a"
+ 			;;
++			*msys*)
++				PETSCLIB="${PETSC_ROOT}/lib -lpetsc"
++			;;
+ 		esac
+ 		AC_MSG_RESULT([done])
+ 		AC_DEFINE([_HAVE_PETSC_], [1], [with PETSc in ISSM src])
+@@ -1298,7 +1379,6 @@
+ 	dnl }}}
+ 	dnl MPI{{{
+ 	AC_MSG_CHECKING(for MPI)
+-
+ 	AC_ARG_WITH(
+ 		[mpi-include],
+ 		AS_HELP_STRING([--with-mpi-include=DIR], [MPI include directory, necessary for parallel build]),
+@@ -1305,7 +1385,6 @@
+ 		[MPI_INCLUDE=${withval}],
+ 		[MPI_INCLUDE=""]
+ 	)
+-
+ 	AC_ARG_WITH(
+ 		[mpi-libdir],
+ 		AS_HELP_STRING([--with-mpi-libdir=DIR], [MPI library directory, necessary for parallel build]),
+@@ -1312,7 +1391,6 @@
+ 		[MPI_LIBDIR=${withval}],
+ 		[MPI_LIBDIR=""]
+ 	)
+-
+ 	AC_ARG_WITH(
+ 		[mpi-libflags],
+ 		AS_HELP_STRING([--with-mpi-libflags=LIBS], [MPI libraries to be used, necessary for parallel build]),
+@@ -1319,7 +1397,6 @@
+ 		[MPI_LIBFLAGS=${withval}],
+ 		[MPI_LIBFLAGS=""]
+ 	)
+-
+ 	if test -z "${MPI_INCLUDE}"; then
+ 		HAVE_MPI=no
+ 	else
+@@ -1362,6 +1439,7 @@
+ 	AC_MSG_RESULT([${HAVE_MPI}])
+ 	dnl }}}
+ 	dnl SCOTCH{{{
++	AC_MSG_CHECKING([for SCOTCH])
+ 	AC_ARG_WITH(
+ 		[scotch-dir],
+ 		AS_HELP_STRING([--with-scotch-dir=DIR], [SCOTCH root directory]),
+@@ -1368,7 +1446,6 @@
+ 		[SCOTCH_ROOT=$withval],
+ 		[SCOTCH_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SCOTCH])
+ 	if test "x${SCOTCH_ROOT}" == "xno"; then
+ 		HAVE_SCOTCH=no
+ 	else
+@@ -1401,84 +1478,138 @@
+ 	fi
+ 	dnl }}}
+ 	dnl METIS{{{
+-
+-	dnl NOTE: We know $VENDOR cannot be empty at this point, so no need to
+-	dnl		  check again in the following conditionals
+-	dnl
+-	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 3 && test "${VENDOR}" != "MSVC-Win64" && test "${VENDOR}" != "MSVC-Win64-par"; then
+-		dnl In PETSc >=3.3, METIS is provided
+-		HAVE_METIS="yes"
+-		AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
+-		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
+-	else
+-		AC_ARG_WITH(
+-			[metis-dir],
+-			AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
+-			[METIS_ROOT=${withval}],
+-			[METIS_ROOT="no"]
+-		)
+-		AC_MSG_CHECKING([for METIS])
+-		if test "x${METIS_ROOT}" == "xno"; then
+-			HAVE_METIS=no
+-		else
++	AC_MSG_CHECKING([for METIS])
++	AC_ARG_WITH(
++		[metis-dir],
++		AS_HELP_STRING([--with-metis-dir=DIR], [METIS root directory, necessary for serial build]),
++		[METIS_ROOT=${withval}],
++		[METIS_ROOT="no"]
++	)
++	HAVE_METIS=no
++	if test "x${METIS_ROOT}" == "xno"; then
++		dnl Check if METIS was installed via PETSc
++		if test -f ${PETSC_ROOT}/install/include/metis.h; then
+ 			HAVE_METIS=yes
+-			if ! test -d "${METIS_ROOT}"; then
+-				AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
+-			fi
++			METIS_ROOT="${PETSC_ROOT}"
+ 		fi
+-		AC_MSG_RESULT([${HAVE_METIS}])
+-		AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
+-
++	else
++		if ! test -d "${METIS_ROOT}"; then
++			AC_MSG_ERROR([METIS directory provided (${METIS_ROOT}) does not exist!]);
++		fi
++		HAVE_METIS=yes
++	fi
++	if test "${HAVE_METIS}" = "yes"; then
++		METIS_VERSION=$(grep "#define METIS_VER_MAJOR" ${METIS_ROOT}/include/metis.h | sed 's|.*METIS_VER_MAJOR[[:space:]]*||')
+ 		dnl METIS libraries and header files
+-		if test "x${HAVE_METIS}" == "xyes"; then
+-			dnl Retrieve METIS version (does the VERSION file exist?)
+-			if test -f "${METIS_ROOT}/VERSION"; then
+-				METIS_VERSION=4
+-			else
+-				METIS_VERSION=5
+-			fi
+-
+-			if test "x${METIS_VERSION}" == "x4"; then
+-				METISINCL="-I${METIS_ROOT}/Lib"
+-				case "${host_os}" in
+-					*cygwin*)
+-						METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
+-						METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
+-					;;
+-					*linux*)
+-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
+-					;;
+-					*darwin*)
+-						METISLIB="-L${METIS_ROOT} -lparmetis -lmetis"
+-					;;
+-				esac
+-				AC_DEFINE([_METIS_VERSION_], [4], [ METIS version number])
+-			fi
+-
+-			if test "x${METIS_VERSION}" == "x5"; then
+-				case "${host_os}" in
+-					*cygwin*)
+-						METISLIB="-L${METIS_ROOT} libmetis.lib"
+-					;;
+-					*linux*)
+-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
+-					;;
+-					*darwin*)
+-						METISLIB="-L${METIS_ROOT}/lib -lparmetis -lmetis"
+-					;;
+-				esac
+-				METISINCL="-I${METIS_ROOT}/include"
+-				AC_DEFINE([_METIS_VERSION_], [5], [METIS version number])
+-			fi
+-
+-			AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
+-			AC_SUBST([METISINCL])
+-			AC_SUBST([METISLIB])
++		if test "x${METIS_VERSION}" == "x4"; then
++			METISINCL="-I${METIS_ROOT}/Lib"
++			case "${host_os}" in
++				*cygwin*)
++					METISINCL="/I`cygpath -m ${METIS_ROOT}/Lib`"
++					METISLIB="-Wl,/link -Wl,/LIBPATH:`cygpath -m ${METIS_ROOT}` -Wl,libmetis.lib"
++				;;
++				*darwin*)
++					METISLIB="-L${METIS_ROOT} -lmetis"
++				;;
++				*linux*)
++					METISLIB="-L${METIS_ROOT} -lmetis"
++				;;
++				*mingw*)
++					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
++				;;
++				*msys*)
++					METISLIB="-L${METIS_ROOT} -lmetis"
++				;;
++			esac
++		elif test "x${METIS_VERSION}" == "x5"; then
++			METISINCL="-I${METIS_ROOT}/include"
++			case "${host_os}" in
++				*cygwin*)
++					METISLIB="-L${METIS_ROOT} libmetis.lib"
++				;;
++				*darwin*)
++					METISLIB="-L${METIS_ROOT}/lib -lmetis"
++				;;
++				*linux*)
++					METISLIB="-L${METIS_ROOT}/lib -lmetis"
++				;;
++				*mingw*)
++					METISLIB="-Wl,${METIS_ROOT}/lib/libmetis.a"
++				;;
++				*msys*)
++					METISLIB="-L${METIS_ROOT}/lib -lmetis"
++				;;
++			esac
++		else
++			AC_MSG_ERROR([METIS version ${METIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
+ 		fi
++		AC_DEFINE([_HAVE_METIS_], [1], [with METIS in ISSM src])
++		AC_DEFINE_UNQUOTED([_METIS_VERSION_], ${METIS_VERSION}, [METIS version number])
++		AC_SUBST([METISINCL])
++		AC_SUBST([METISLIB])
+ 	fi
+-	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" == "xyes"])
++	AC_MSG_RESULT([${HAVE_METIS}])
++	AM_CONDITIONAL([METIS], [test "x${HAVE_METIS}" = "xyes"])
+ 	dnl }}}
++	dnl ParMETIS{{{
++	AC_MSG_CHECKING([for ParMETIS])
++	AC_ARG_WITH(
++		[parmetis-dir],
++		AS_HELP_STRING([--with-parmetis-dir=DIR], [ParMETIS root directory, necessary for parallel build]),
++		[PARMETIS_ROOT=${withval}],
++		[PARMETIS_ROOT="no"]
++	)
++	HAVE_PARMETIS=no
++	if test "x${PARMETIS_ROOT}" == "xno"; then
++		dnl Check if ParMETIS was installed via PETSc
++		if test -f ${PETSC_ROOT}/install/include/parmetis.h; then
++			HAVE_PARMETIS="yes"
++			PARMETIS_ROOT="${PETSC_ROOT}"
++		fi
++	else
++		if ! test -d "${PARMETIS_ROOT}"; then
++			AC_MSG_ERROR([ParMETIS directory provided (${PARMETIS_ROOT}) does not exist!]);
++		fi
++		if ! test -d "${METIS_ROOT}"; then
++			AC_MSG_ERROR([If supplying path to ParMETIS with option --with-parmetis-dir, must also supply path to METIS with option --with-metis-dir]);
++		fi
++		HAVE_PARMETIS="yes"
++	fi
++	if test "${HAVE_PARMETIS}" == "yes"; then
++		#PARMETIS_VERSION=$(grep "#define PARMETIS_MAJOR_VERSION" ${PARMETIS_ROOT}/include/parmetis.h | sed 's|.*PARMETIS_MAJOR_VERSION[[:space:]]*||')
++		dnl METIS libraries and header files
++		#if test "x${PARMETIS_VERSION}" == "x4"; then
++			PARMETISINCL="-I${PARMETIS_ROOT}/include"
++			case "${host_os}" in
++				*cygwin*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++				*darwin*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++				*linux*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++				*mingw*)
++					PARMETISLIB="-Wl,${PARMETIS_ROOT}/lib/libparmetis.a"
++				;;
++				*msys*)
++					PARMETISLIB="-L${PARMETIS_ROOT}/lib -lparmetis"
++				;;
++			esac
++		#else
++		#	AC_MSG_ERROR([ParMETIS version ${PARMETIS_VERSION} not yet supported! Please contact ISSM developers via forum or email.])
++		#fi
++		AC_DEFINE([_HAVE_PARMETIS_], [1], [with ParMETIS in ISSM src])
++		#AC_DEFINE([_PARMETIS_VERSION_], [${PARMETIS_VERSION}], [ParMETIS version number])
++		AC_SUBST([PARMETISINCL])
++		AC_SUBST([PARMETISLIB])
++	fi
++	AC_MSG_RESULT([${HAVE_PARMETIS}])
++	AM_CONDITIONAL([PARMETIS], [test "x${HAVE_PARMETIS}" = "xyes"])
++	dnl }}}
+ 	dnl Toolkit for Advanced Optimization (TAO){{{
++	AC_MSG_CHECKING([for TAO])
+ 	AC_ARG_WITH(
+ 		[tao-dir],
+ 		AS_HELP_STRING([--with-tao-dir=DIR], [TAO root directory]),
+@@ -1485,8 +1616,6 @@
+ 		[TAO_ROOT=${withval}],
+ 		[TAO_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for TAO])
+-
+ 	if test "x${HAVE_PETSC}" == "xyes" && test "x${PETSC_MAJOR}" == "x3" && test ${PETSC_MINOR} -ge 5; then
+ 		dnl In PETSc >= 3.5, TAO is provided
+ 		HAVE_TAO="yes"
+@@ -1514,6 +1643,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl M1QN3{{{
++	AC_MSG_CHECKING([for M1QN3])
+ 	AC_ARG_WITH(
+ 		[m1qn3-dir],
+ 		AS_HELP_STRING([--with-m1qn3-dir=DIR], [M1QN3 root directory]),
+@@ -1520,7 +1650,6 @@
+ 		[M1QN3_ROOT=${withval}],
+ 		[M1QN3_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for M1QN3])
+ 	if test "x${M1QN3_ROOT}" == "xno"; then
+ 		HAVE_M1QN3=no
+ 	else
+@@ -1539,6 +1668,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PROJ{{{
++	AC_MSG_CHECKING([for PROJ])
+ 	AC_ARG_WITH(
+ 		[proj-dir],
+ 		AS_HELP_STRING([--with-proj-dir=DIR], [PROJ root directory]),
+@@ -1545,7 +1675,6 @@
+ 		[PROJ_ROOT=${withval}],
+ 		[PROJ_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for PROJ])
+ 	if test "x${PROJ_ROOT}" == "xno"; then
+ 		HAVE_PROJ=no
+ 	else
+@@ -1567,6 +1696,7 @@
+ 	AM_CONDITIONAL([PROJ], [test "x${HAVE_PROJ}" == "xyes"])
+ 	dnl }}}
+ 	dnl SLEPc{{{
++	AC_MSG_CHECKING([for SLEPc])
+ 	AC_ARG_WITH(
+ 		[slepc-dir],
+ 		AS_HELP_STRING([--with-slepc-dir=DIR], [SLEPc root directory]),
+@@ -1573,7 +1703,6 @@
+ 		[SLEPC_ROOT=${withval}],
+ 		[SLEPC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SLEPc])
+ 	if test "x${SLEPC_ROOT}" == "xno"; then
+ 		HAVE_SLEPC=no
+ 	else
+@@ -1594,6 +1723,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl shapelib{{{
++	AC_MSG_CHECKING([for shapelib])
+ 	AC_ARG_WITH(
+ 		[shapelib-dir],
+ 		AS_HELP_STRING([--with-shapelib-dir=DIR], [shapelib root directory]),
+@@ -1600,7 +1730,6 @@
+ 		[SHAPELIB_ROOT=${withval}],
+ 		[SHAPELIB_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for shapelib])
+ 	if test "x${SHAPELIB_ROOT}" == "xno"; then
+ 		HAVE_SHAPELIB=no
+ 	else
+@@ -1621,8 +1750,9 @@
+ 	fi
+ 	dnl }}}
+ 	dnl ScaLAPACK{{{
+-
+ 	dnl NOTE: User should supply path to root directory or libraries, but not both
++	dnl
++	AC_MSG_CHECKING([for ScaLAPACK])
+ 	AC_ARG_WITH(
+ 		[scalapack-dir],
+ 		AS_HELP_STRING([--with-scalapack-dir=DIR], [ScaLAPACK root directory]),
+@@ -1635,7 +1765,6 @@
+ 		[SCALAPACKLIB=${withval}],
+ 		[SCALAPACKLIB="no"]
+ 	)
+-	AC_MSG_CHECKING([for ScaLAPACK])
+ 	if test "x${SCALAPACK_ROOT}" == "xno" && test "x${SCALAPACKLIB}" == "xno"; then
+ 		HAVE_SCALAPACK=no
+ 		SCALAPACKLIB=""
+@@ -1644,7 +1773,11 @@
+ 			AC_MSG_ERROR([ScaLAPACK directory provided (${SCALAPACK_ROOT}) does not exist!]);
+ 		fi
+ 		HAVE_SCALAPACK=yes
+-		SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
++		if test "${VENDOR}" == "win-msys2"; then
++			SCALAPACKLIB="-Wl,${SCALAPACK_ROOT}/lib/libscalapack.a"
++		else
++			SCALAPACKLIB="-L${SCALAPACK_ROOT}/lib -lscalapack"
++		fi
+ 	elif test "x${SCALAPACKLIB}" != "xno"; then
+ 		dnl Value of SCALAPACKLIB should be valid here, so no need to set it (as above)
+ 		HAVE_SCALAPACK=yes
+@@ -1660,19 +1793,33 @@
+ 	fi
+ 	dnl }}}
+ 	dnl BLAS/LAPACK{{{
++	AC_MSG_CHECKING([for BLAS/LAPACK])
+ 	AC_ARG_WITH(
++		[blas-dir],
++		[AS_HELP_STRING([--with-blas-dir=DIR], [BLAS root directory])],
++		[BLAS_ROOT=$withval],
++		[BLAS_ROOT="no"]
++	)
++	AC_ARG_WITH(
++		[lapack-dir],
++		[AS_HELP_STRING([--with-lapack-dir=DIR], [LAPACK root directory])],
++		[LAPACK_ROOT=$withval],
++		[LAPACK_ROOT="no"]
++	)
++	AC_ARG_WITH(
+ 		[blas-lapack-dir],
+ 		AS_HELP_STRING([--with-blas-lapack-dir=DIR], [BLAS/LAPACK root directory]),
+ 		[BLASLAPACK_ROOT=$withval],
+ 		[BLASLAPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for BLAS/LAPACK])
+-	if test "x${BLASLAPACK_ROOT}" == "xno" ; then
++	if (test "x${BLAS_ROOT}" = "xno" || test "x${LAPACK_ROOT}" = "xno") && test "x${BLASLAPACK_ROOT}" = "xno"; then
+ 		HAVE_BLASLAPACK=no
+ 	else
+ 		HAVE_BLASLAPACK=yes
+-		if ! test -d "${BLASLAPACK_ROOT}"; then
+-			AC_MSG_ERROR([BLAS/LAPACK directory provided (${BLASLAPACK_ROOT}) does not exist!]);
++		if ! test -d "${BLAS_ROOT}" || ! test -d "${LAPACK_ROOT}"; then
++			if ! test -d "${BLASLAPACK_ROOT}"; then
++				AC_MSG_ERROR([Use either --with-blas-dir and --with-lapack-dir *or* --with-blaslapack-dir]);
++			fi
+ 		fi
+ 	fi
+ 	AC_MSG_RESULT([${HAVE_BLASLAPACK}])
+@@ -1679,7 +1826,6 @@
+ 
+ 	dnl BLAS/LAPACK libraries and header files
+ 	if test "x${HAVE_BLASLAPACK}" == "xyes"; then
+-		BLASLAPACKINCL=""
+ 		case "${host_os}" in
+ 			*cygwin*)
+ 				BLASLAPACKLIB="-L`cygpath -m ${BLASLAPACK_ROOT}` -Wl,libf2cblas.lib  -Wl,libf2clapack.lib"
+@@ -1708,13 +1854,44 @@
+ 					BLASLAPACKLIB+=" -llapack -lblas"
+ 				fi
+ 			;;
++			*mingw*)
++				if test -d "${BLASLAPACK_ROOT}"; then
++					BLASLAPACKLIB="-L${BLASLAPACK_ROOT}/lib"
++					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB+=" -lopenblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB+=" -lf2clapack -lf2cblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB="-Wl,${BLASLAPACK_ROOT}/lib/libflapack.a -Wl,${BLASLAPACK_ROOT}/lib/libfblas.a"
++					else
++						BLASLAPACKLIB+=" -llapack -lblas"
++					fi
++				else
++					BLASLAPACKLIB="-Wl,${LAPACK_ROOT}/lib/liblapack.a -Wl,${BLAS_ROOT}/lib/libblas.a"
++				fi
++			;;
++			*msys*)
++				if test -d "${BLASLAPACK_ROOT}"; then
++					if ls ${BLASLAPACK_ROOT}/lib/libopenblas.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB=" -lopenblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libf2clapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB=" -lf2clapack -lf2cblas"
++					elif ls ${BLASLAPACK_ROOT}/lib/libflapack.* 1> /dev/null 2>&1; then
++						BLASLAPACKLIB+=" -lflapack -lfblas"
++					else
++						BLASLAPACKLIB=" -llapack -lblas"
++					fi
++				else
++					BLASLAPACKLIB="-L${LAPACK_ROOT}/lib -llapack -L${BLAS_ROOT}/lib -lblas"
++				fi
++			;;
+ 		esac
+ 		AC_DEFINE([_HAVE_BLASLAPACK_], [1], [with BLAS/LAPACK in ISSM src])
+ 		AC_SUBST([BLASLAPACKLIB])
+-		AC_SUBST([BLASLAPACKINCL])
+ 	fi
+ 	dnl }}}
+ 	dnl Math Kernel Library (MKL){{{
++	AC_MSG_CHECKING([for MKL])
+ 	AC_ARG_WITH(
+ 		[mkl-libflags],
+ 		AS_HELP_STRING([--with-mkl-libflags=LIBS], [MKL libraries to be used]),
+@@ -1721,7 +1898,6 @@
+ 		[MKL_LIBFLAGS=${withval}],
+ 		[MKL_LIBFLAGS="no"]
+ 	)
+-	AC_MSG_CHECKING([for MKL])
+ 	if test "x${MKL_LIBFLAGS}" == "xno"; then
+ 		HAVE_MKL=no
+ 	else
+@@ -1734,7 +1910,6 @@
+ 	AC_MSG_RESULT([${HAVE_MKL}])
+ 	dnl }}}
+ 	dnl PlaLAPACK{{{
+-
+ 	dnl TODO: 	Handle user supplying path to root directory *or* individual
+ 	dnl 		arguments (like ScaLAPACK)
+ 	dnl
+@@ -1769,6 +1944,7 @@
+ 	AC_MSG_RESULT([${HAVE_PLAPACK}])
+ 	dnl }}}
+ 	dnl MUMPS{{{
++	AC_MSG_CHECKING([for MUMPS])
+ 	AC_ARG_WITH(
+ 		[mumps-dir],
+ 		AS_HELP_STRING([--with-mumps-dir=DIR], [MUMPS root directory]),
+@@ -1775,7 +1951,6 @@
+ 		[MUMPS_ROOT=${withval}],
+ 		[MUMPS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MUMPS])
+ 	if test "x${MUMPS_ROOT}" == "xno"; then
+ 		HAVE_MUMPS=no
+ 	else
+@@ -1790,8 +1965,8 @@
+ 	if test "x${HAVE_MUMPS}" == "xyes"; then
+ 		MUMPSINCL="-I${MUMPS_ROOT}/include"
+ 		if test "x${MUMPS_ROOT}" == "x${PETSC_ROOT}"; then
+-			if test "x${PETSC_MAJOR}" == "x2"; then
+-				MUMPSLIB="-L${MUMPS_ROOT}/lib "
++			if test "${VENDOR}" == "win-msys2"; then
++				MUMPSLIB="-Wl,${MUMPS_ROOT}/lib/libcmumps.a -Wl,${MUMPS_ROOT}/lib/libdmumps.a -Wl,${MUMPS_ROOT}/lib/libsmumps.a -Wl,${MUMPS_ROOT}/lib/libzmumps.a -Wl,${MUMPS_ROOT}/lib/libmumps_common.a -Wl,${MUMPS_ROOT}/lib/libpord.a"
+ 			else
+ 				MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lcmumps -lmumps_common -lpord -lparmetis -lzmumps -lmetis"
+ 			fi
+@@ -1840,6 +2015,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl BLACS{{{
++	AC_MSG_CHECKING([for BLACS])
+ 	AC_ARG_WITH(
+ 		[blacs-dir],
+ 		AS_HELP_STRING([--with-blacs-dir=DIR], [BLACS root directory]),
+@@ -1846,7 +2022,6 @@
+ 		[BLACS_ROOT=${withval}],
+ 		[BLACS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for BLACS])
+ 	if test "x${BLACS_ROOT}" == "xno"; then
+ 		HAVE_BLACS=no
+ 	else
+@@ -1867,6 +2042,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl HYPRE{{{
++	AC_MSG_CHECKING([for HYPRE])
+ 	AC_ARG_WITH(
+ 		[hypre-dir],
+ 		AS_HELP_STRING([--with-hypre-dir=DIR], [HYPRE root directory]),
+@@ -1873,7 +2049,6 @@
+ 		[HYPRE_ROOT=${withval}],
+ 		[HYPRE_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for HYPRE])
+ 	if test "x${HYPRE_ROOT}" == "xno"; then
+ 		HAVE_HYPRE=no
+ 	else
+@@ -1894,6 +2069,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Prometheus{{{
++	AC_MSG_CHECKING([for Prometheus])
+ 	AC_ARG_WITH(
+ 		[prometheus-dir],
+ 		AS_HELP_STRING([--with-prometheus-dir=DIR], [Prometheus root directory]),
+@@ -1900,7 +2076,6 @@
+ 		[PROMETHEUS_ROOT=${withval}],
+ 		[PROMETHEUS_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for Prometheus])
+ 	if test "x${PROMETHEUS_ROOT}" == "xno"; then
+ 		HAVE_PROMETHEUS=no
+ 	else
+@@ -1921,6 +2096,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SEMIC{{{
++	AC_MSG_CHECKING([for SEMIC])
+ 	AC_ARG_WITH(
+ 		[semic-dir],
+ 		AS_HELP_STRING([--with-semic-dir=DIR], [SEMIC root directory]),
+@@ -1927,7 +2103,6 @@
+ 		[SEMIC_ROOT=${withval}],
+ 		[SEMIC_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SEMIC])
+ 	if test "x${SEMIC_ROOT}" == "xno"; then
+ 		HAVE_SEMIC=no
+ 	else
+@@ -1949,6 +2124,7 @@
+ 	AM_CONDITIONAL([SEMIC], [test "x${HAVE_SEMIC}" == "xyes"])
+ 	dnl }}}
+ 	dnl SPAI{{{
++	AC_MSG_CHECKING([for SPAI])
+ 	AC_ARG_WITH(
+ 		[spai-dir],
+ 		AS_HELP_STRING([--with-spai-dir=DIR], [SPAI root directory]),
+@@ -1955,7 +2131,6 @@
+ 		[SPAI_ROOT=${withval}],
+ 		[SPAI_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SPAI])
+ 	if test "x${SPAI_ROOT}" == "xno"; then
+ 		HAVE_SPAI=no
+ 	else
+@@ -1976,6 +2151,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SuperLU{{{
++	AC_MSG_CHECKING([for SuperLU])
+ 	AC_ARG_WITH(
+ 		[superlu-dir],
+ 		AS_HELP_STRING([--with-superlu-dir=DIR], [SuperLU root directory]),
+@@ -1982,7 +2158,6 @@
+ 		[SUPERLU_ROOT=${withval}],
+ 		[SUPERLU_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SuperLU])
+ 	if test "x${SUPERLU_ROOT}" == "xno"; then
+ 		HAVE_SUPERLU=no
+ 	else
+@@ -2003,6 +2178,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl SPOOLES{{{
++	AC_MSG_CHECKING([for SPOOLES])
+ 	AC_ARG_WITH(
+ 		[spooles-dir],
+ 		AS_HELP_STRING([--with-spooles-dir=DIR], [SPOOLES root directory]),
+@@ -2009,7 +2185,6 @@
+ 		[SPOOLES_ROOT=${withval}],
+ 		[SPOOLES_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SPOOLES])
+ 	if test "x${SPOOLES_ROOT}" == "xno"; then
+ 		HAVE_SPOOLES=no
+ 	else
+@@ -2030,6 +2205,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl PaStiX{{{
++	AC_MSG_CHECKING([for PaStiX])
+ 	AC_ARG_WITH(
+ 		[pastix-dir],
+ 		AS_HELP_STRING([--with-pastix-dir=DIR], [PaStiX root directory]),
+@@ -2036,7 +2212,6 @@
+ 		[PASTIX_ROOT=${withval}],
+ 		[PASTIX_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for PaStiX])
+ 	if test "x${PASTIX_ROOT}" == "xno"; then
+ 		HAVE_PASTIX=no
+ 	else
+@@ -2058,6 +2233,7 @@
+ 	dnl }}}
+ 	dnl }}}
+ 	dnl ml{{{
++	AC_MSG_CHECKING([for ml])
+ 	AC_ARG_WITH(
+ 		[ml-dir],
+ 		AS_HELP_STRING([--with-ml-dir=DIR],[ml root directory]),
+@@ -2064,7 +2240,6 @@
+ 		[ML_ROOT=$withval],
+ 		[ML_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for ml])
+ 	if test "x${ML_ROOT}" == "xno"; then
+ 		HAVE_ML=no
+ 	else
+@@ -2085,6 +2260,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl UMFPACK{{{
++	AC_MSG_CHECKING([for UMFPACK])
+ 	AC_ARG_WITH(
+ 		[umfpack-dir],
+ 		AS_HELP_STRING([--with-umfpack-dir=DIR], [UMFPACK root directory]),
+@@ -2091,7 +2267,6 @@
+ 		[UMFPACK_ROOT=${withval}],
+ 		[UMFPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for UMFPACK])
+ 	if test "x${UMFPACK_ROOT}" == "xno"; then
+ 		HAVE_UMFPACK=no
+ 	else
+@@ -2128,6 +2303,7 @@
+ 	AC_MSG_RESULT([done])
+ 	dnl }}}
+ 	dnl MATH77{{{
++	AC_MSG_CHECKING([for MATH77])
+ 	AC_ARG_WITH(
+ 		[math77-dir],
+ 		AS_HELP_STRING([--with-math77-dir=DIR], [MATH77 root directory]),
+@@ -2134,7 +2310,6 @@
+ 		[MATH77_ROOT=${withval}],
+ 		[MATH77_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MATH77])
+ 	if test "x${MATH77_ROOT}" == "xno"; then
+ 		HAVE_MATH77=no
+ 	else
+@@ -2153,6 +2328,7 @@
+ 	fi
+ 	dnl }}}
+ 	dnl Fortran{{{
++	AC_MSG_CHECKING(for Fortran compilation)
+ 	AC_ARG_WITH(
+ 		[fortran],
+ 		AS_HELP_STRING([--with-fortran=YES], [do we compile Fortran code (default: yes)]),
+@@ -2159,7 +2335,6 @@
+ 		[FORTRAN=${withval}],
+ 		[FORTRAN=yes]
+ 	)
+-	AC_MSG_CHECKING(for Fortran compilation)
+ 	if test "x${FORTRAN}" == "xyes"; then
+ 		HAVE_FORTRAN=yes
+ 		AC_DEFINE([_HAVE_FORTRAN_], [1], [with Fortran capability])
+@@ -2223,6 +2398,7 @@
+ 	AC_MSG_RESULT([done])
+ 	dnl }}}
+ 	dnl MeteoIO{{{
++	AC_MSG_CHECKING([for MeteoIO])
+ 	AC_ARG_WITH(
+ 		[meteoio-dir],
+ 		AS_HELP_STRING([--with-meteoio-dir=DIR], [use MeteoIO in conjunction with SNOWPACK model]),
+@@ -2229,7 +2405,6 @@
+ 		[METEOIO_ROOT=${withval}],
+ 		[METEOIO_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for MeteoIO])
+ 	if test "x${METEOIO_ROOT}" == "xno"; then
+ 		HAVE_METEOIO=no
+ 	else
+@@ -2252,6 +2427,7 @@
+ 	AM_CONDITIONAL([METEOIO], [test "x${HAVE_METEOIO}" == "xyes"])
+ 	dnl }}}
+ 	dnl SNOWPACK{{{
++	AC_MSG_CHECKING([for SNOWPACK])
+ 	AC_ARG_WITH(
+ 		[snowpack-dir],
+ 		AS_HELP_STRING([--with-snowpack-dir=DIR], [use SNOWPACK for surface mass balance model]),
+@@ -2258,7 +2434,6 @@
+ 		[SNOWPACK_ROOT=${withval}],
+ 		[SNOWPACK_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for SNOWPACK])
+ 	if test "x${SNOWPACK_ROOT}" == "xno"; then
+ 		HAVE_SNOWPACK=no
+ 	else
+@@ -2280,6 +2455,7 @@
+ 	AM_CONDITIONAL([SNOWPACK], [test "x${HAVE_SNOWPACK}" == "xyes"])
+ 	dnl }}}
+ 	dnl NeoPZ{{{
++	AC_MSG_CHECKING([for NeoPZ])
+ 	AC_ARG_WITH(
+ 		[neopz-dir],
+ 		AS_HELP_STRING([--with-neopz-dir=DIR], [NeoPZ root directory]),
+@@ -2286,7 +2462,6 @@
+ 		[NEOPZ_ROOT=${withval}],
+ 		[NEOPZ_ROOT="no"]
+ 	)
+-	AC_MSG_CHECKING([for NeoPZ])
+ 	if test "x${NEOPZ_ROOT}" == "xno"; then
+ 		HAVE_NEOPZ=no
+ 	else
+@@ -2355,11 +2530,12 @@
+ 		AC_MSG_CHECKING(for Gmsh version)
+ 		GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
+ 		AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
+-		AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
++		AC_DEFINE_UNQUOTED([_GMSH_VERSION_MAJOR_], ${GMSH_VERSION_MAJOR}, [Gmsh major version])
+ 	fi	
+ 	dnl }}}
+ 	dnl Capabilities
+ 	dnl with-bamg{{{
++	AC_MSG_CHECKING([for BAMG capability compilation])
+ 	AC_ARG_WITH(
+ 		[bamg],
+ 		AS_HELP_STRING([--with-bamg=YES], [compile with BAMG capabilities (default: yes)]),
+@@ -2366,7 +2542,6 @@
+ 		[BAMG=${withval}],
+ 		[BAMG=yes]
+ 	)
+-	AC_MSG_CHECKING([for BAMG capability compilation])
+ 	HAVE_BAMG=no
+ 	if test "x${BAMG}" == "xyes"; then
+ 		HAVE_BAMG=yes
+@@ -2376,6 +2551,7 @@
+ 	AC_MSG_RESULT([${HAVE_BAMG}])
+ 	dnl }}}
+ 	dnl with-ocean{{{
++	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
+ 	AC_ARG_WITH(
+ 		[ocean],
+ 		AS_HELP_STRING([--with-ocean = YES], [compile with ice/ocean coupling capability (default: no)]),
+@@ -2382,8 +2558,6 @@
+ 		[OCEAN=${withval}],
+ 		[OCEAN=no]
+ 	)
+-	AC_MSG_CHECKING(for ice/ocean coupling capability compilation)
+-
+ 	HAVE_OCEAN=no
+ 	if test "x${OCEAN}" == "xyes"; then
+ 		HAVE_OCEAN=yes
+@@ -2393,6 +2567,7 @@
+ 	AC_MSG_RESULT([${HAVE_OCEAN}])
+ 	dnl }}}
+ 	dnl with-kml{{{
++	AC_MSG_CHECKING(for kml capability compilation)
+ 	AC_ARG_WITH(
+ 		[kml],
+ 		AS_HELP_STRING([--with-kml=YES], [compile with kml capabilities (default: no)]),
+@@ -2399,8 +2574,6 @@
+ 		[KML=${withval}],
+ 		[KML=no]
+ 	)
+-	AC_MSG_CHECKING(for kml capability compilation)
+-
+ 	HAVE_KML=no
+ 	if test "x${KML}" == "xyes"; then
+ 		HAVE_KML=yes
+@@ -2410,6 +2583,7 @@
+ 	AC_MSG_RESULT([${HAVE_KML}])
+ 	dnl }}}
+ 	dnl with-kriging{{{
++	AC_MSG_CHECKING(for kriging capability compilation)
+ 	AC_ARG_WITH(
+ 		[kriging],
+ 		AS_HELP_STRING([--with-kriging=YES], [compile with kriging capabilities (default: yes)]),
+@@ -2416,8 +2590,6 @@
+ 		[KRIGING=${withval}],
+ 		[KRIGING=yes]
+ 	)
+-	AC_MSG_CHECKING(for kriging capability compilation)
+-
+ 	HAVE_KRIGING=no
+ 	if test "x${KRIGING}" == "xyes"; then
+ 		HAVE_KRIGING=yes
+@@ -2432,6 +2604,7 @@
+ 
+ 	dnl Platform specifics
+ 	dnl with-ios{{{
++	AC_MSG_CHECKING(for iOS compilation)
+ 	AC_ARG_WITH(
+ 		[ios],
+ 		AS_HELP_STRING([--with-ios=YES], [compile with iOS capabilities (default: no)]),
+@@ -2438,8 +2611,6 @@
+ 		[IOS=${withval}],
+ 		[IOS=no]
+ 	)
+-	AC_MSG_CHECKING(for iOS compilation)
+-
+ 	HAVE_IOS=no
+ 	if test "x${IOS}" == "xyes"; then
+ 		HAVE_IOS=yes
+@@ -2449,13 +2620,13 @@
+ 	AC_MSG_RESULT([${HAVE_IOS}])
+ 	dnl }}}
+ 	dnl with-android{{{
++	AC_MSG_CHECKING([for Android capability compilation])
+ 	AC_ARG_WITH(
+ 		[android],
+ 		AS_HELP_STRING([--with-android=EXE], [compile with Android capabilities (default: "no"; alternatives: "exe", "jni")]),
+ 		[ANDROID=${withval}],
+-		[ANDROID=no])
+-	AC_MSG_CHECKING([for Android capability compilation])
+-
++		[ANDROID=no]
++	)
+ 	if test "x${ANDROID}" == "xjni"; then
+ 		HAVE_ANDROID=jni
+ 		AC_DEFINE([_HAVE_ANDROID_], [1], [with Android capability])
+@@ -2474,6 +2645,7 @@
+ 	AC_MSG_RESULT([${HAVE_ANDROID}])
+ 	dnl }}}
+ 	dnl with-android-ndk{{{
++	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
+ 	AC_ARG_WITH(
+ 		[android-ndk],
+ 		AS_HELP_STRING([--with-android-ndk=DIR], [Android NDK root directory]),
+@@ -2480,8 +2652,6 @@
+ 		[ANDROID_NDK_ROOT=${withval}],
+ 		[ANDROID_NDK_ROOT=""]
+ 	)
+-	AC_MSG_CHECKING([with Android Native Development Kit (NDK)])
+-
+ 	if test -d "${ANDROID_NDK_ROOT}"; then
+ 		HAVE_ANDROID_NDK=yes
+ 		ANDROID_NDKINCL="-I${ANDROID_NDK_ROOT}/arm-linux-android-install/sysroot/usr/include"
+@@ -2495,7 +2665,8 @@
+ 
+ 	dnl other options
+ 	dnl optimization{{{
+-	dnl -- bypass standard optimization -g -O2 -fPIC -std=c++11?
++	dnl -- bypass standard optimization -g -O2 -fPIC?
++	AC_MSG_CHECKING(for C++ optimization flags)
+ 	AC_ARG_WITH(
+ 		[cxxoptflags],
+ 		AS_HELP_STRING([--with-cxxoptflags=CXXOPTFLAGS], [C++ optimization flags (i.e. --with-cxxoptflags="-march=opteron -O3 -std=c++11"]),
+@@ -2502,11 +2673,11 @@
+ 		[CXXOPTFLAGS=${withval}],
+ 		[CXXOPTFLAGS="-g -O2 -fPIC -std=c++11"]
+ 	)
+-	AC_MSG_CHECKING(for C++ optimization flags)
+ 	AC_SUBST([CXXOPTFLAGS])
+-	AC_MSG_RESULT([done])
++	AC_MSG_RESULT([${CXXOPTFLAGS}])
+ 	dnl }}}
+ 	dnl multithreading{{{
++	AC_MSG_CHECKING(for number of threads)
+ 	AC_ARG_WITH(
+ 		[numthreads],
+ 		AS_HELP_STRING([--with-numthreads=NUMTHREADS_VALUE], [number of threads (default: 1)]),
+@@ -2513,7 +2684,6 @@
+ 		[NUMTHREADS_VALUE=${withval}],
+ 		[NUMTHREADS_VALUE=1]
+ 	)
+-	AC_MSG_CHECKING(for number of threads)
+ 	dnl Check that supplied value is an integer
+ 	if [[ "${NUMTHREADS_VALUE}" != "${NUMTHREADS_VALUE}" 2> /dev/null ]]; then
+ 		AC_MSG_ERROR([Number of threads provided (${NUMTHREADS_VALUE}) is not an integer!]);
+@@ -2528,20 +2698,27 @@
+ 			*cygwin*)
+ 				MULTITHREADINGLIB="-lpthread -lrt"
+ 			;;
++			*darwin*)
++				MULTITHREADINGLIB="-lpthread"
++			;;
+ 			*linux*)
+ 				MULTITHREADINGLIB="-lpthread -lrt"
+ 			;;
+-			*darwin*)
+-				MULTITHREADINGLIB="-lpthread"
++			*mingw*)
++				MULTITHREADINGLIB=""
+ 			;;
++			*msys*)
++				MULTITHREADINGLIB=""
++			;;
+ 		esac
+ 		AC_DEFINE([_MULTITHREADING_], [1], [with multithreading enabled])
+ 	fi
+-	AC_DEFINE_UNQUOTED(_NUMTHREADS_, $NUMTHREADS_VALUE, [number of threads])
++	AC_DEFINE_UNQUOTED([_NUMTHREADS_], ${NUMTHREADS_VALUE}, [number of threads])
+ 	AC_SUBST([MULTITHREADINGLIB])
+ 	AC_MSG_RESULT([${NUMTHREADS_VALUE}])
+ 	dnl }}}
+ 	dnl 64-bit indices{{{
++	AC_MSG_CHECKING([for 64-bit indices])
+ 	AC_ARG_WITH(
+ 		[64bit-indices],
+ 		AS_HELP_STRING([--with-64bit-indices=bool], [use 64-bit indices (default: 0)]),
+@@ -2548,8 +2725,6 @@
+ 		[USE_64BIT_INDICES=${withval}],
+ 		[USE_64BIT_INDICES=0]
+ 	)
+-	AC_MSG_CHECKING([for 64-bit indices])
+-
+ 	if test "x${USE_64BIT_INDICES}" == "x1"; then
+ 		AC_DEFINE([ISSM_USE_64BIT_INDICES], [1], [with 64-bit indices])
+ 	else
+@@ -2559,7 +2734,7 @@
+ 	dnl }}}
+ 
+ 	dnl Checks {{{
+-	AC_MSG_CHECKING(consistency between all libraries)
++	AC_MSG_CHECKING(consistency between all external packages)
+ 
+ 	dnl Check that if PETSc is requested, MPI is specified
+ 	if test "x${HAVE_PETSC}" == "xyes"; then
+@@ -2589,7 +2764,7 @@
+ 	fi
+ 
+ 	dnl Check that if we run ADOL-C, we don't compile kriging.exe
+-	if test "x$HAVE_ADOLC" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
++	if test "x${HAVE_ADOLC}" == "xyes" && test "${HAVE_KRIGING}" == "xyes"; then
+ 		AC_MSG_ERROR([cannot compile kriging.exe under ADOL-C conditions!]);
+ 	fi
+ 
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26043)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26044)
+@@ -1,4 +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@ @PROJINCL@ @ESMFINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
+ AM_FCFLAGS = @SEMICINCL@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+@@ -7,7 +7,10 @@
+ 
+ #Library declaration {{{
+ if !WINDOWS
+-lib_LTLIBRARIES = libISSMCore.la libISSMOverload.la
++lib_LTLIBRARIES = libISSMCore.la
++if !MSYS2
++lib_LTLIBRARIES += libISSMOverload.la
++endif
+ if WRAPPERS
+ lib_LTLIBRARIES += libISSMModules.la
+ endif
+@@ -681,15 +684,20 @@
+ endif
+ #}}}
+ #Library flags and sources {{{
+-ALLCXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS)
++ALL_CXXFLAGS = $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
++if MSYS2
++ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_ # Cannot have undefined symbols under MSYS2
++ALL_CXXFLAGS += -D_USE_MATH_DEFINES # Need to open fence to math.h definitions when --std=c++ is used (which is the default)
++endif
++
+ libISSMCore_la_SOURCES  = $(issm_sources)
+-libISSMCore_la_CXXFLAGS = $(ALLCXXFLAGS) $(DAKOTAFLAGS)
++libISSMCore_la_CXXFLAGS = $(ALL_CXXFLAGS) $(DAKOTAFLAGS)
+ libISSMCore_la_FFLAGS = $(AM_FFLAGS)
+ 
+ if !WINDOWS
+ if !STANDALONE_LIBRARIES
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
++libISSMCore_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
+ if FORTRAN
+ libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
+ endif
+@@ -710,7 +718,7 @@
+ libISSMModules_la_SOURCES += $(kml_sources)
+ endif
+ 
+-libISSMModules_la_CXXFLAGS = $(ALLCXXFLAGS)
++libISSMModules_la_CXXFLAGS = $(ALL_CXXFLAGS)
+ if !WINDOWS
+ if STANDALONE_LIBRARIES
+ libISSMModules_la_LIBADD = ./libISSMCore.la
+@@ -742,24 +750,41 @@
+ endif
+ endif
+ 
+-if STANDALONE_LIBRARIES
+-libISSMCore_la_LDFLAGS = -static
+-libISSMOverload_la_LDFLAGS = -static
++if VERSION
++libISSMCore_la_LDFLAGS =
+ if WRAPPERS
+-libISSMModules_la_LDFLAGS = -static
+-else
+ libISSMModules_la_LDFLAGS =
+ endif
+ else
+-libISSMCore_la_LDFLAGS =
+-libISSMOverload_la_LDFLAGS =
++libISSMCore_la_LDFLAGS = -avoid-version
++if WRAPPERS
++libISSMModules_la_LDFLAGS = -avoid-version
+ endif
++endif
+ 
++if STANDALONE_LIBRARIES
++libISSMCore_la_LDFLAGS += -static
++if WRAPPERS
++libISSMModules_la_LDFLAGS += -static
++endif
++endif
+ #}}}
++
++if !MSYS2
+ #Overload library, to overload any non-standard symbols. {{{
+ libISSMOverload_la_SOURCES = ./shared/String/ApiPrintf.cpp
++libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
+ 
+-libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
++if VERSION
++libISSMOverload_la_LDFLAGS =
++else
++libISSMOverload_la_LDFLAGS = -avoid-version
++endif
++
++if STANDALONE_LIBRARIES
++libISSMOverload_la_LDFLAGS += -static
++endif
++endif
+ #}}}
+ #Executable {{{
+ if ANDROID
+@@ -777,13 +802,18 @@
+ endif
+ 
+ #Standard libraries
+-LDADD = ./libISSMCore.la ./libISSMOverload.la
++LDADD = ./libISSMCore.la 
++
++if !MSYS2
++LDADD += ./libISSMOverload.la
++endif
++
+ if WRAPPERS
+ LDADD += ./libISSMModules.la $(TRIANGLELIB)
+ endif
+ 
+ #External packages
+-LDADD += $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB)
++LDADD +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
+ 
+ if FORTRAN
+ LDADD += $(FLIBS) $(FORTRANLIB)
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26043)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26044)
+@@ -19,10 +19,17 @@
+ 	./io/FetchMatlabData.cpp \
+ 	./io/WriteMatlabData.cpp
+ 
+-ALLCXXFLAGS= -fPIC -D_WRAPPERS_ $(CXXFLAGS) $(CXXOPTFLAGS)
++ALL_CXXFLAGS = -fPIC -D_WRAPPERS_
+ 
++if MSYS2
++ALL_CXXFLAGS += -D_DO_NOT_LOAD_GLOBALS_ # Cannot have undefined symbols under MSYS2
++ALL_CXXFLAGS += -D_USE_MATH_DEFINES # Need to open fence to math.h definitions when --std=c++ is used (which is the default)
++endif
++
++ALL_CXXFLAGS += $(CXXOPTFLAGS) $(CXXFLAGS)
++
+ libISSMMatlab_la_SOURCES = $(io_sources)
+-libISSMMatlab_la_CXXFLAGS= $(ALLCXXFLAGS)
++libISSMMatlab_la_CXXFLAGS = ${ALL_CXXFLAGS}
+ #}}}
+ #api io{{{
+ if !WINDOWS
+@@ -31,10 +38,12 @@
+ noinst_LTLIBRARIES += libISSMApi.la
+ endif
+ 
++if !MSYS2
+ api_sources= ./io/ApiPrintf.cpp
+ 
+ libISSMApi_la_SOURCES = $(api_sources)
+-libISSMApi_la_CXXFLAGS= $(ALLCXXFLAGS)
++libISSMApi_la_CXXFLAGS = ${ALL_CXXFLAGS}
++endif
+ #}}}
+ #Wrappers {{{
+ lib_LTLIBRARIES += \
+@@ -81,11 +90,23 @@
+ deps = $(MATHLIB)
+ 
+ #Triangle library
+-AM_CXXFLAGS =  -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER -D_WRAPPERS_
++TRI_CXXFLAGS = -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+ 
+ #Matlab part
+-AM_LDFLAGS = -module $(MEXLINK) -shrext ${EXEEXT} --export-dynamic -rdynamic -no-undefined
++MEX_CXXFLAGS = -D_HAVE_MATLAB_MODULES_ $(MEXOPTFLAGS) $(MEXCXXFLAGS)
++MEX_CPPFLAGS = $(MATLABINCL)
++MEX_LDFLAGS = -module -shrext $(MEXEXT) -no-undefined
++MEX_LIBADD = $(MEXLINKFLAGS) $(MEXLIB)
+ 
++AM_CPPFLAGS += ${MEX_CPPFLAGS}
++AM_CXXFLAGS = ${TRI_CXXFLAGS} ${MEX_CXXFLAGS}
++AM_LDFLAGS = ${MEX_LDFLAGS}
++AM_LIBADD = ${MEX_LIBADD}
++
++if !MSYS2
++AM_LDFLAGS += --export-dynamic -rdynamic
++endif
++
+ if !VERSION
+ AM_LDFLAGS += -avoid-version
+ endif
+@@ -105,14 +126,18 @@
+ endif
+ endif
+ 
+-AM_CXXFLAGS += -D_HAVE_MATLAB_MODULES_ -fPIC
++AM_CXXFLAGS += -fPIC -D_WRAPPERS_
+ 
+-deps += ./libISSMMatlab.la ../../c/libISSMModules.la ../../c/libISSMCore.la ./libISSMApi.la
++deps += ./libISSMMatlab.la ../../c/libISSMCore.la ../../c/libISSMModules.la
+ 
+-if WINDOWS
+-deps += $(METISLIB)
++if !MSYS2
++deps += ./libISSMApi.la
+ endif
+ 
++# if WINDOWS
++# deps += $(METISLIB)
++# endif
++
+ if ADOLC
+ deps += $(ADOLCLIB)
+ endif
+@@ -121,8 +146,8 @@
+ deps += $(FLIBS) $(FORTRANLIB)
+ endif
+ 
+-#MEXLIB needs to be the last (undefined references on larsen)
+-deps += ${MEXLIB}
++# #MEXLIB needs to be the last (undefined references on larsen)
++# deps += ${MEXLIB}
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS)
+@@ -129,17 +154,25 @@
+ #}}}
+ # Module sources and dependencies {{{
+ if !WINDOWS
+-libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
++libISSMMatlab_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+ endif
+ 
++if VERSION
++libISSMMatlab_la_LDFLAGS =
++libISSMApi_la_LDFLAGS =
++else
++libISSMMatlab_la_LDFLAGS = -avoid-version
++libISSMApi_la_LDFLAGS = -avoid-version
++endif
++
+ if STANDALONE_LIBRARIES
+-libISSMMatlab_la_LDFLAGS = -static
+-libISSMApi_la_LDFLAGS = -static
+-deps += $(PETSCLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
++libISSMMatlab_la_LDFLAGS += -static
++libISSMApi_la_LDFLAGS += -static
++deps +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(NEOPZLIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
+ endif
+ 
+ if !WINDOWS
+-libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
++libISSMApi_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MATHLIB) $(MEXLIB)
+ endif
+ 
+ BamgConvertMesh_matlab_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp
Index: /issm/oecreview/Archive/25834-26739/ISSM-26044-26045.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26044-26045.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26044-26045.diff	(revision 26740)
@@ -0,0 +1,369 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 26044)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 26045)
+@@ -6,6 +6,10 @@
+ # been completed. Finally, results of the build and tests are emailed to the
+ # members of the ISSM development team.
+ #
++# NOTE:
++# - Variable OS is set in environment by running 
++#	`source $ISSM_DIR/etc/environment.sh`.
++#
+ # TODO:
+ # - Rename TEMP to something more descriptive (ensure first that other parts of
+ #	the build system do not rely on this name)
+@@ -16,9 +20,9 @@
+ alias grep=$(which grep)
+ 
+ echo "Cleaning up execution directory"
+-rm -rf $ISSM_DIR/execution/*
+-rm -rf $ISSM_DIR/nightlylog
+-mkdir $ISSM_DIR/nightlylog
++rm -rf ${ISSM_DIR}/execution/*
++rm -rf ${ISSM_DIR}/nightlylog
++mkdir ${ISSM_DIR}/nightlylog
+ 
+ #Server URI
+ SERVER='https://ross.ics.uci.edu/jenkins'
+@@ -55,20 +59,13 @@
+ 	exit 1
+ fi
+ 
+-#Get Operating system (OS) name{{{
+-OS=$(uname -s)
+-if [[ $OS == CYGWIN* ]]; then
+-	OS="win";
+-fi
+-#}}}
+-
+ #Install ISSM
+ #Determining installation type depending on svn changes{{{
+ echo "======================================================";
+ echo "             Determining Installation type            "
+ echo "======================================================";
+-if [ -a $ISSM_DIR/svn_revision_old ]; then
+-	SVN_PREVIOUS=$(cat $ISSM_DIR/svn_revision_old)
++if [ -a ${ISSM_DIR}/svn_revision_old ]; then
++	SVN_PREVIOUS=$(cat ${ISSM_DIR}/svn_revision_old)
+ 	SVN_CURRENT=$SVN_REVISION_1
+ 	echo "Previous revision number: $SVN_PREVIOUS"
+ 	echo "Current revision number: $SVN_CURRENT"
+@@ -76,7 +73,7 @@
+ 	# 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
++	#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
+@@ -83,15 +80,15 @@
+ 	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...)
+-	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > $ISSM_DIR/TEMP
++	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > ${ISSM_DIR}/TEMP
+ 	#cat changes | grep 'document_edit' |sed -e 's/document_edit.png/document_edit.png\
+-		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > $ISSM_DIR/TEMP
+-	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
++		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > ${ISSM_DIR}/TEMP
++	cat changes | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > ${ISSM_DIR}/TEMP
+ 
+ 	# Print list of changed files
+ 	echo "   "
+ 	echo "List of updated files"
+-	cat $ISSM_DIR/TEMP
++	cat ${ISSM_DIR}/TEMP
+ 	echo "   "
+ 
+ 	###################################
+@@ -101,7 +98,7 @@
+ 
+ 	# 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
++	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep externalpackages)" ]; then
+ 		echo "  -- checking for changed externalpackages... yes"
+ 		ISSM_EXTERNALPACKAGES="yes"
+ 	else
+@@ -111,8 +108,8 @@
+ 
+ 	# If the Makefile or m4 diirectory were changed in any way or if certain
+ 	# binary files from a previous compilation do not exist, reconfigure
+-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
+-		[ ! -f "$ISSM_DIR/bin/issm.exe" ] && [ ! -f "$ISSM_DIR/bin/issm-bin.js" ] ||
++	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
++		[ ! -f "${ISSM_DIR}/bin/issm.exe" ] && [ ! -f "${ISSM_DIR}/bin/issm-bin.js" ] ||
+ 		[ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then
+ 		echo "  -- checking for reconfiguration... yes"
+ 		ISSM_RECONFIGURE="yes"
+@@ -122,7 +119,7 @@
+ 	fi
+ 
+ 	# If source files were changed in any way, recompile
+-	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
++	if [ ! -z "$(cat ${ISSM_DIR}/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
+ 		[ "$ISSM_RECONFIGURE" == "yes" ]; then
+ 		echo "  -- checking for recompilation... yes"
+ 		ISSM_COMPILATION="yes"
+@@ -133,7 +130,7 @@
+ 
+ 	# Cleanup
+ 	rm changes
+-	rm $ISSM_DIR/TEMP
++	rm ${ISSM_DIR}/TEMP
+ else
+ 	echo "Previous revision not found, this must be a fresh install"
+ 	echo "  -- checking for changed externalpackages... yes"
+@@ -146,7 +143,7 @@
+ 
+ echo " "
+ echo "Recording current svn version: $SVN_REVISION_1"
+-echo $SVN_REVISION_1 > $ISSM_DIR/svn_revision_old
++echo $SVN_REVISION_1 > ${ISSM_DIR}/svn_revision_old
+ #}}}
+ 
+ ## External Packages
+@@ -156,16 +153,16 @@
+ NUMPACKAGES=$(($(echo ${EXTERNALPACKAGES} | wc -w ) / 2))
+ 
+ #Jenkins XML files for individual packages
+-EXTERNAL_TEST_FILE="$ISSM_DIR/nightlylog/results/external.xml"
+-mkdir -p $ISSM_DIR/nightlylog/results
++EXTERNAL_TEST_FILE="${ISSM_DIR}/nightlylog/results/external.xml"
++mkdir -p ${ISSM_DIR}/nightlylog/results
+ echo "<testsuite tests=\"$NUMPACKAGES\">" > $EXTERNAL_TEST_FILE
+ 
+ # Need a source here for when builds start midway through installation of externalpackages.
+-source $ISSM_DIR/etc/environment.sh
++source ${ISSM_DIR}/etc/environment.sh
+ 
+-if [ "$OS" == "win" ]; then
++if [ "${OS}" == CYGWIN* ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
+-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
++	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+ fi
+ 
+ EXTERNALPACKAGES_FAILED=0;
+@@ -177,8 +174,8 @@
+ 	PACKAGEINST=$(echo $EXTERNALPACKAGES | cut -d " " -f $NUM2-$NUM2)
+ 
+ 	#install if requested or if previous install has not been successful
+-	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
+-		cd $ISSM_DIR/externalpackages/$PACKAGENAME
++	if [ "${ISSM_EXTERNALPACKAGES}" == "yes" ]; then # NOTE: Removed check on if 'install' directory exist
++		cd ${ISSM_DIR}/externalpackages/$PACKAGENAME
+ 
+ 		echo "======================================================";
+ 		echo "       Installing $PACKAGENAME                        ";
+@@ -185,7 +182,7 @@
+ 		echo "======================================================";
+ 
+ 		./$PACKAGEINST $NUMCPUS_INSTALL &> compil.log
+-		if [ $? -ne 0 ] && [ "$PACKAGENAME" != "boost" ]; then
++		if [ $? -ne 0 ] && [ "${PACKAGENAME}" != "boost" ]; then
+ 			cat compil.log
+ 			echo "======================================================";
+ 			echo "    ERROR: installation of $PACKAGENAME failed        ";
+@@ -199,7 +196,7 @@
+ 		else
+ 			echo "<testcase classname=\"externalpackages\" name=\"$PACKAGENAME\"/>" >> $EXTERNAL_TEST_FILE
+ 		fi
+-		source $ISSM_DIR/etc/environment.sh
++		source ${ISSM_DIR}/etc/environment.sh
+ 
+ 		#If external package is rebuilt, we also need to recompile
+ 		ISSM_RECONFIGURE="yes"
+@@ -222,11 +219,11 @@
+ fi
+ 
+ # Source here to include any newly installed externalpackages on the path.
+-source $ISSM_DIR/etc/environment.sh
++source ${ISSM_DIR}/etc/environment.sh
+ 
+-if [ "$OS" == "win" ]; then
++if [ "${OS}" == CYGWIN* ]; then
+ 	echo " == WINDOWS ENVIRONMENT DETECTED =="
+-	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
++	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+ fi
+ 
+ # Set CXX/CC flags for JS runs after exnteralpackages to avoid conflicts during their compilation
+@@ -246,14 +243,14 @@
+ 	export RANLIB=emranlib
+ 	#export EMCC_DEBUG=1 # Uncomment to enable debugging
+ 	export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14 to avoid undefined symbol warnings from our Fortran object files being treated as errors
+-	source $ISSM_DIR/externalpackages/emscripten/install/emsdk_env.sh
++	source ${ISSM_DIR}/externalpackages/emscripten/install/emsdk_env.sh
+ fi
+ 
+ #}}}
+ #ISSM compilation yes/no                (ISSM_COMPILATION) {{{
+-if [ "$ISSM_COMPILATION" == "yes" ]; then
++if [ "${ISSM_COMPILATION}" == "yes" ]; then
+ 	cd $ISSM_DIR
+-	if [ "$ISSM_RECONFIGURE" == "yes" ]; then
++	if [ "${ISSM_RECONFIGURE}" == "yes" ]; then
+ 		echo "======================================================";
+ 		echo "             Cleaning up and reconfiguring            "
+ 		echo "======================================================";
+@@ -264,7 +261,7 @@
+ 			echo "autoreconf failed!"
+ 			exit 1
+ 		fi
+-		eval "./configure $ISSM_CONFIG"
++		eval "./configure ${ISSM_CONFIG}"
+ 		if [ $? -ne 0 ]; then
+ 			echo "ISSM configuration failed (see options below)"
+ 			echo $ISSM_CONFIG
+@@ -278,9 +275,13 @@
+ 	echo "                    Compiling ISSM                    "
+ 	echo "======================================================"
+ 	if [ $NUMCPUS_INSTALL -gt 1 ]; then
+-		echo "Making with " $NUMCPUS_INSTALL " cpus"
++		echo "Making with ${NUMCPUS_INSTALL} cpus"
++
++		# To debug compilation/linking, add 'V=1' option to the call to make
++		#make -j $NUMCPUS_INSTALL V=1
+ 		make -j $NUMCPUS_INSTALL
+ 	else
++		#make V=1
+ 		make
+ 	fi
+ 	if [ $? -ne 0 ] && [ $NUMCPUS_INSTALL -gt 1 ]; then
+@@ -294,8 +295,7 @@
+ 		exit 1
+ 	fi
+ 	make install
+-elif [ "$ISSM_COMPILATION" == "no" ]
+-then
++elif [ "${ISSM_COMPILATION}" == "no" ]; then
+ 	echo "Skipping ISSM compilation"
+ else
+ 	echo "ISSM_COMPILATION supported values are: yes and no. Exiting..." >&2 # Error message to stderr.
+@@ -313,13 +313,13 @@
+ 	#Launch all tests on different cpus
+ 	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
+ 		#Launch matlab and the nightly run script
+-		cat > $ISSM_DIR/nightlylog/matlab_run$i.m << EOF
++		cat > ${ISSM_DIR}/nightlylog/matlab_run$i.m << EOF
+ 		warning off %necessary to avoid a log of several Go for parallel runs
+ 		try,
+-			$(if [ "$MATLAB_NROPTIONS" = "" ]; then
+-				echo "runme('output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
++			$(if [ "${MATLAB_NROPTIONS}" = "" ]; then
++				echo "runme('output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
+ 			else
+-				echo "runme($MATLAB_NROPTIONS,'output','nightly','rank',$i,'numprocs',$NUMCPUS_RUN);"
++				echo "runme(${MATLAB_NROPTIONS},'output','nightly','rank',${i},'numprocs',${NUMCPUS_RUN});"
+ 			fi)
+ 		catch me,
+ 			%An error occured, get report and exit
+@@ -334,36 +334,44 @@
+ 		exit
+ EOF
+ 		cd $ISSM_DIR/test/NightlyRun
+-		if [ "$OS" = "win" ]; then
+-			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR_WIN/src/m/dev; devpath; addpath $ISSM_DIR_WIN/nightlylog/; matlab_run$i" -logfile $ISSM_DIR_WIN/nightlylog/matlab_log$i.log &
++		if [[ "${OS}" == CYGWIN* || "${OS}" == MINGW* ]]; then
++			$MATLAB_PATH/bin/matlab -nodesktop -nosplash -nojvm -r "addpath ${ISSM_DIR_WIN}/src/m/dev; devpath; addpath ${ISSM_DIR_WIN}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR_WIN}/nightlylog/matlab_log$i.log &
+ 		else
+-			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath $ISSM_DIR/src/m/dev; devpath; addpath $ISSM_DIR/nightlylog/; matlab_run$i" -logfile $ISSM_DIR/nightlylog/matlab_log$i.log &
++			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath ${ISSM_DIR}/src/m/dev; devpath; addpath ${ISSM_DIR}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR}/nightlylog/matlab_log$i.log &
+ 		fi
+ 	done
+ 
+-	#wait until matlab closes
+-	if [ "$OS" = "win" ]; then
++	# Wait for MATLAB to exit
++	if [[ "${OS}" == CYGWIN* ]]; then
+ 		sleep 5;
+-		echo "Waiting for matlab on windows"
++		echo "Waiting for MATLAB to exit"
+ 		pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+ 		echo '-----------------------------'
+-		echo "pid: $pid"
++		echo "pid: ${pid}"
+ 		echo '-----------------------------'
+-		while [ -n "$pid" ]; do
++		while [ -n "${pid}" ]; do
+ 			pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
+ 			sleep 1;
+ 		done
+ 		echo "DONE!"
++	elif [[ "${OS}" == MINGW* ]]; then
++		# NOTE: The PID query used here may work as well on Cygwin. If so, combine the two conditional blocks.
++		sleep 5;
++		echo "Waiting for MATLAB to exit"
++		pid=$(ps -W | grep MATLAB | awk '{print $1}')
++		echo '-----------------------------'
++		echo "pid: ${pid}"
++		echo '-----------------------------'
++		while [ -n "${pid}" ]; do
++			pid=$(ps -W | grep MATLAB | awk '{print $1}')
++			sleep 1;
++		done
+ 	else
+ 		wait
+ 	fi
+ 
+-	#concatenate reports
+-	cd $ISSM_DIR/nightlylog/
+-	#echo 'CHECKING NIGHTLYLOG DIRECTORY'
+-	#echo '-----------------------------'
+-	#ls -la
+-	#echo '-----------------------------'
++	# Concatenate logs
++	cd $ISSM_DIR/nightlylog
+ 
+ 	if [ -f matlab_log.log ]; then
+ 		rm matlab_log.log
+@@ -370,7 +378,7 @@
+ 	fi
+ 
+ 	for job in `jobs -p`; do
+-		echo "Waiting on: $job"
++		#echo "Waiting on: ${job}" # Commented out because it really has nothing to do with MATLAB processes
+ 		wait $job
+ 	done
+ 
+@@ -389,7 +397,7 @@
+ # {{{
+ if [ $PYTHON_TEST -eq 1 ]; then
+ 	#Launch all tests on different cpus
+-	export PYTHONPATH="$ISSM_DIR/src/m/dev"
++	export PYTHONPATH="${ISSM_DIR}/src/m/dev"
+ 	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+ 	export PYTHONUNBUFFERED=1 #we don't want python to buffer otherwise issm.exe output is not captured
+ 	for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+@@ -400,8 +408,8 @@
+ 		echo "--------------Running Python test for Rank $i---------------------"
+ 	done
+ 
+-	# concatenate reports
+-	cd $ISSM_DIR/nightlylog/
++	# Concatenate logs
++	cd $ISSM_DIR/nightlylog
+ 	if [ -f python_log.log ]; then
+ 		rm python_log.log
+ 	fi
+@@ -408,7 +416,7 @@
+ 
+ 	for job in `jobs -p`
+ 	do
+-		echo "Waiting on: $job"
++		echo "Waiting on: ${job}"
+ 		wait $job
+ 	done
+ 
+@@ -431,7 +439,7 @@
+ fi
+ # }}}
+ 
+-#process logs to be junit compatible
++# Process logs to be JUnit compatible
+ #{{{
+ cd $ISSM_DIR/nightlylog
+ source $ISSM_EXT_DIR/shell2junit/install/bin/sh2ju.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26045-26046.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26045-26046.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26045-26046.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26045)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26046)
+@@ -813,7 +813,7 @@
+ endif
+ 
+ #External packages
+-LDADD +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
++LDADD += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
+ 
+ if FORTRAN
+ LDADD += $(FLIBS) $(FORTRANLIB)
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26045)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26046)
+@@ -168,7 +168,7 @@
+ if STANDALONE_LIBRARIES
+ libISSMMatlab_la_LDFLAGS += -static
+ libISSMApi_la_LDFLAGS += -static
+-deps +=  $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(NEOPZLIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
++deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(NEOPZLIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
+ endif
+ 
+ if !WINDOWS
Index: /issm/oecreview/Archive/25834-26739/ISSM-26046-26047.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26046-26047.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26046-26047.diff	(revision 26740)
@@ -0,0 +1,7771 @@
+Index: ../trunk-jpl/src/c/analyses/GiaAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GiaAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/GiaAnalysis.h	(nonexistent)
+@@ -1,33 +0,0 @@
+-/*! \file GiaAnalysis.h 
+- *  \brief: header file for generic external result object
+- */
+-
+-#ifndef _GiaAnalysis_
+-#define _GiaAnalysis_
+-
+-/*Headers*/
+-#include "./Analysis.h"
+-
+-class GiaAnalysis: public Analysis{
+-
+-	public:
+-		/*Model processing*/
+-		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+-		void CreateLoads(Loads* loads, IoModel* iomodel);
+-		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
+-		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+-		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
+-		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+-
+-		/*Finite element Analysis*/
+-		void           Core(FemModel* femmodel);
+-		ElementVector* CreateDVector(Element* element);
+-		ElementMatrix* CreateJacobianMatrix(Element* element);
+-		ElementMatrix* CreateKMatrix(Element* element);
+-		ElementVector* CreatePVector(Element* element);
+-		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+-		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+-		void           UpdateConstraints(FemModel* femmodel);
+-};
+-#endif
+Index: ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp	(nonexistent)
+@@ -1,117 +0,0 @@
+-#include "./GiaAnalysis.h"
+-#include "../toolkits/toolkits.h"
+-#include "../classes/classes.h"
+-#include "../shared/shared.h"
+-#include "../modules/modules.h"
+-
+-/*Model processing*/
+-void GiaAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+-	/*No constraints*/
+-}/*}}}*/
+-void GiaAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+-	/*No loads*/
+-}/*}}}*/
+-void GiaAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
+-	::CreateNodes(nodes,iomodel,GiaAnalysisEnum,P1Enum);
+-}/*}}}*/
+-int  GiaAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+-	return 1;
+-}/*}}}*/
+-void GiaAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+-
+-	int giamodel=0;
+-	int nummodels=0;
+-
+-	/*Update elements: */
+-	int counter=0;
+-	for(int i=0;i<iomodel->numberofelements;i++){
+-		if(iomodel->my_elements[i]){
+-			Element* element=(Element*)elements->GetObjectByOffset(counter);
+-			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
+-			counter++;
+-		}
+-	}
+-
+-	/*fetch gia model type: */
+-	iomodel->FetchData(&giamodel,"md.gia.model");
+-	if(giamodel==1){ //GiaIvins
+-		iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.gia.mantle_viscosity",GiaMantleViscosityEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.gia.lithosphere_thickness",GiaLithosphereThicknessEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+-	}
+-	else if(giamodel==2){ //GiaCaron: not implemneted yet
+-	}
+-	else if(giamodel==3){
+-		/*take Ngia and Ugia from the offline models and plug into the element inputs:*/
+-		iomodel->FetchDataToDatasetInput(inputs,elements,"md.gia.Ngia",GiaMmeNgiaEnum);
+-		iomodel->FetchDataToDatasetInput(inputs,elements,"md.gia.Ugia",GiaMmeUgiaEnum);
+-	}
+-}/*}}}*/
+-void GiaAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+-
+-	int                 giamodel;
+-	IssmDouble          modelid; 
+-	int                 nummodels;
+-
+-	/*find gia model type: */
+-	parameters->AddObject(iomodel->CopyConstantObject("md.gia.model",GiaModelEnum));
+-	parameters->FindParam(&giamodel,GiaModelEnum);
+-
+-	if(giamodel==1){ //GiaIvins
+-		parameters->AddObject(iomodel->CopyConstantObject("md.gia.cross_section_shape",GiaCrossSectionShapeEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_shear_modulus",MaterialsLithosphereShearModulusEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_density",MaterialsLithosphereDensityEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_shear_modulus",MaterialsMantleShearModulusEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_density",MaterialsMantleDensityEnum));
+-	}
+-	else if(giamodel==2){ //GiaCaron
+-	}
+-	else if(giamodel==3){ //GiaMme
+-		
+-		parameters->AddObject(iomodel->CopyConstantObject("md.gia.nummodels",GiaNummodelsEnum));
+-		parameters->FindParam(&nummodels,GiaNummodelsEnum);
+-
+-		/*create double param, not int param, because Dakota will be updating it as 
+-		 * a double potentially: */
+-		iomodel->FetchData(&modelid,"md.gia.modelid");
+-		parameters->AddObject(new DoubleParam(GiaModelidEnum,modelid));
+-
+-		/*quick checks: */
+-		if(nummodels<=0)_error_("giamme object in  md.gia field should contain at least 1 ensemble model!");
+-		if(modelid<=0 || modelid>nummodels)_error_("modelid field in giamme object of md.gia field should be between 1 and the number of ensemble runs!");
+-	} 
+-
+-
+-}/*}}}*/
+-
+-/*Finite Element Analysis*/
+-void           GiaAnalysis::Core(FemModel* femmodel){/*{{{*/
+-	_error_("not implemented");
+-}/*}}}*/
+-ElementVector* GiaAnalysis::CreateDVector(Element* element){/*{{{*/
+-	/*Default, return NULL*/
+-	return NULL;
+-}/*}}}*/
+-ElementMatrix* GiaAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+-_error_("Not implemented");
+-}/*}}}*/
+-ElementMatrix* GiaAnalysis::CreateKMatrix(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+-}/*}}}*/
+-ElementVector* GiaAnalysis::CreatePVector(Element* element){/*{{{*/
+-_error_("not implemented yet");
+-}/*}}}*/
+-void           GiaAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+-	   _error_("not implemented yet");
+-}/*}}}*/
+-void           GiaAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+-	_error_("Not implemented yet");
+-}/*}}}*/
+-void           GiaAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+-	_error_("not implemented yet");
+-}/*}}}*/
+-void           GiaAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+-	/*Default, do nothing*/
+-	return;
+-}/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 26047)
+@@ -29,6 +29,9 @@
+ void           AdjointBalancethickness2Analysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           AdjointBalancethickness2Analysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* AdjointBalancethickness2Analysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Analysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/Analysis.h	(revision 26047)
+@@ -38,11 +38,12 @@
+ 		virtual void CreateLoads(Loads* loads, 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,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type)=0;
++		virtual void UpdateElements(Elements* elements,Inputs* inputs, IoModel* iomodel,int analysis_counter,int analysis_type)=0;
+ 		virtual void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum)=0;
+ 
+ 		/*Finite element Analysis*/
+ 		virtual void           Core(FemModel* femmodel)=0;
++		virtual void           PreCore(FemModel* femmodel)=0;
+ 		virtual ElementVector* CreateDVector(Element* element)=0;
+ 		virtual ElementMatrix* CreateJacobianMatrix(Element* element)=0;
+ 		virtual ElementMatrix* CreateKMatrix(Element* element)=0;
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 26047)
+@@ -31,7 +31,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+@@ -58,6 +58,9 @@
+ void           Balancethickness2Analysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
++void           Balancethickness2Analysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
+ ElementVector* Balancethickness2Analysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 26047)
+@@ -28,6 +28,9 @@
+ void           BalancethicknessSoftAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           BalancethicknessSoftAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* BalancethicknessSoftAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp	(revision 26047)
+@@ -39,6 +39,9 @@
+ void           DepthAverageAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           DepthAverageAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* DepthAverageAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h	(revision 26047)
+@@ -25,6 +25,7 @@
+ 		static void       ComputeBasalMeltingrate(FemModel* femmodel);
+ 		static void       ComputeBasalMeltingrate(Element* element);
+ 		void              Core(FemModel* femmodel);
++		void              PreCore(FemModel* femmodel);
+ 		ElementVector*    CreateDVector(Element* element);
+ 		ElementMatrix*    CreateJacobianMatrix(Element* element);
+ 		ElementMatrix*    CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/EnumToAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnumToAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/EnumToAnalysis.h	(revision 26047)
+@@ -16,6 +16,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/EsaAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EsaAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/EsaAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 26047)
+@@ -71,6 +71,9 @@
+ 		femmodel->RequestedOutputsx(&femmodel->results,&extvar_enum,1);
+ 	}
+ }/*}}}*/
++void           ExtrapolationAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* ExtrapolationAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 	/*Finite element Analysis*/
+ 	void           Core(FemModel* femmodel);
++	void           PreCore(FemModel* femmodel);
+ 	ElementVector* CreateDVector(Element* element);
+ 	ElementMatrix* CreateJacobianMatrix(Element* element);
+ 	ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 26047)
+@@ -39,6 +39,9 @@
+ void           ExtrudeFromBaseAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           ExtrudeFromBaseAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* ExtrudeFromBaseAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 26047)
+@@ -39,6 +39,9 @@
+ void           ExtrudeFromTopAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           ExtrudeFromTopAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* ExtrudeFromTopAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 26047)
+@@ -24,6 +24,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 26047)
+@@ -22,6 +22,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		void           CreateHydrologyWaterVelocityInput(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.h	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.h	(revision 26047)
+@@ -0,0 +1,34 @@
++/*! \file HydrologyTwsAnalysis.h 
++ *  \brief: header file for generic external result object
++ */
++
++#ifndef _HydrologyTwsAnalysis_
++#define _HydrologyTwsAnalysis_
++
++/*Headers*/
++#include "./Analysis.h"
++
++class HydrologyTwsAnalysis: public Analysis{
++
++	public:
++		/*Model processing*/
++		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
++		void CreateLoads(Loads* loads, IoModel* iomodel);
++		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
++		int  DofsPerNode(int** doflist,int domaintype,int approximation);
++		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
++		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
++
++		/*Finite element Analysis*/
++		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
++		ElementVector* CreateDVector(Element* element);
++		ElementMatrix* CreateJacobianMatrix(Element* element);
++		ElementMatrix* CreateKMatrix(Element* element);
++		ElementVector* CreatePVector(Element* element);
++		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
++		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
++		void           UpdateConstraints(FemModel* femmodel);
++};
++#endif
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/LoveAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LoveAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/LoveAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/OceantransportAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/OceantransportAnalysis.h	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/OceantransportAnalysis.h	(revision 26047)
+@@ -0,0 +1,34 @@
++/*! \file OceantransportAnalysis.h 
++ *  \brief: header file for generic external result object
++ */
++
++#ifndef _OceantransportAnalysis_
++#define _OceantransportAnalysis_
++
++/*Headers*/
++#include "./Analysis.h"
++
++class OceantransportAnalysis: public Analysis{
++
++	public:
++		/*Model processing*/
++		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
++		void CreateLoads(Loads* loads, IoModel* iomodel);
++		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
++		int  DofsPerNode(int** doflist,int domaintype,int approximation);
++		void UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type);
++		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
++
++		/*Finite element Analysis*/
++		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
++		ElementVector* CreateDVector(Element* element);
++		ElementMatrix* CreateJacobianMatrix(Element* element);
++		ElementMatrix* CreateKMatrix(Element* element);
++		ElementVector* CreatePVector(Element* element);
++		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
++		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
++		void           UpdateConstraints(FemModel* femmodel);
++};
++#endif
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.cpp	(revision 26047)
+@@ -100,6 +100,9 @@
+ void           SamplingAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           SamplingAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* SamplingAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/SamplingAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SamplingAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SamplingAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/SmoothAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SmoothAnalysis.cpp	(revision 26047)
+@@ -36,6 +36,9 @@
+ void           SmoothAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           SmoothAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* SmoothAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/SmoothAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SmoothAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 26047)
+@@ -181,6 +181,9 @@
+ 		femmodel->SetCurrentConfiguration(StressbalanceSIAAnalysisEnum);
+ 		solutionsequence_linear(femmodel);
+ }/*}}}*/
++void           StressbalanceSIAAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++_error_("not implemented");
++}/*}}}*/
+ ElementVector* StressbalanceSIAAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26047)
+@@ -106,7 +106,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+@@ -167,6 +167,9 @@
+ 		femmodel->SetCurrentConfiguration(StressbalanceVerticalAnalysisEnum);
+ 		solutionsequence_linear(femmodel);
+ }/*}}}*/
++void           StressbalanceVerticalAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* StressbalanceVerticalAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 26047)
+@@ -62,6 +62,9 @@
+ void           UzawaPressureAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           UzawaPressureAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* UzawaPressureAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/analyses/analyses.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/analyses.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/analyses.h	(revision 26047)
+@@ -22,7 +22,6 @@
+ #include "./ExtrapolationAnalysis.h"
+ #include "./FreeSurfaceBaseAnalysis.h"
+ #include "./FreeSurfaceTopAnalysis.h"
+-#include "./GiaAnalysis.h"
+ #include "./GLheightadvectionAnalysis.h"
+ #include "./LoveAnalysis.h"
+ #include "./EsaAnalysis.h"
+@@ -29,11 +28,13 @@
+ #include "./HydrologyDCEfficientAnalysis.h"
+ #include "./HydrologyDCInefficientAnalysis.h"
+ #include "./HydrologyShreveAnalysis.h"
++#include "./HydrologyTwsAnalysis.h"
+ #include "./HydrologyGlaDSAnalysis.h"
+ #include "./HydrologyShaktiAnalysis.h"
+ #include "./HydrologyPismAnalysis.h"
+ #include "./LevelsetAnalysis.h"
+ #include "./MasstransportAnalysis.h"
++#include "./OceantransportAnalysis.h"
+ #include "./SamplingAnalysis.h"
+ #include "./SmbAnalysis.h"
+ #include "./SealevelchangeAnalysis.h"
+Index: ../trunk-jpl/src/c/cores/gia_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/gia_core.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/cores/gia_core.cpp	(nonexistent)
+@@ -1,94 +0,0 @@
+-/*!\file: gia_core.cpp
+- * \brief: core of the GIA solution 
+- */ 
+-
+-#include "./cores.h"
+-#include "../toolkits/toolkits.h"
+-#include "../classes/classes.h"
+-#include "../classes/Inputs/TriaInput.h"
+-#include "../classes/Inputs/DatasetInput.h"
+-#include "../shared/shared.h"
+-#include "../modules/modules.h"
+-#include "../solutionsequences/solutionsequences.h"
+-void gia_core(FemModel* femmodel){
+-
+-	Vector<IssmDouble> *wg    = NULL;
+-	Vector<IssmDouble> *dwdtg = NULL;
+-	IssmDouble          *x    = NULL;
+-	IssmDouble          *y    = NULL;
+-	int nummodels,giamodel;
+-	IssmDouble modelid; 
+-
+-	/*parameters: */
+-	bool save_results;
+-	int  gsize;
+-	
+-	/*Start profiler*/
+-	femmodel->profiler->Start(GIACORE);
+-
+-	/*Recover some parameters: */
+-	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-
+-	if(VerboseSolution()) _printf0_("   computing GIA\n");
+-
+-	/*Call on core computations: */
+-	femmodel->SetCurrentConfiguration(GiaAnalysisEnum);
+-
+-	/*Figure out type of gia model:*/
+-	femmodel->parameters->FindParam(&giamodel,GiaModelEnum);
+-
+-	if(giamodel==1){ //GiaIvins
+-		/*Figure out size of g-set deflection vector and allocate solution vector: */
+-		gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
+-		wg = new Vector<IssmDouble>(gsize);
+-		dwdtg = new Vector<IssmDouble>(gsize);
+-
+-		/*first, recover x and y vectors from vertices: */
+-		VertexCoordinatesx(&x,&y,NULL,femmodel->vertices); //no need for z coordinate
+-
+-		/*call the main module: */
+-		femmodel->Deflection(wg,dwdtg,x,y);
+-
+-		/*assemble vector: */
+-		wg->Assemble();
+-		dwdtg->Assemble();
+-
+-		InputUpdateFromVectorx(femmodel,wg,UGiaEnum,VertexSIdEnum);
+-		InputUpdateFromVectorx(femmodel,dwdtg,UGiaRateEnum,VertexSIdEnum);
+-
+-		if(save_results){
+-			int outputs[2] = {UGiaEnum,UGiaRateEnum};
+-			femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],2);
+-		}
+-
+-		xDelete<IssmDouble>(x);
+-		xDelete<IssmDouble>(y);
+-	}
+-	else if(giamodel==2){ //GiaCaron
+-		/*not implemneted yet*/
+-	}
+-	else if(giamodel==3){ //GiaMme
+-		
+-		/*Go grab the values for Ngia and Ugia in the offline GiaMme class:*/ 
+-		femmodel->parameters->FindParam(&modelid,GiaModelidEnum); 
+-		modelid--; //from matlab
+-
+-		/*find the Ngia and Ugia dataset:*/
+-		DatasetInput* dataset_input_ngia=femmodel->inputs->GetDatasetInput(GiaMmeNgiaEnum);
+-		DatasetInput* dataset_input_ugia=femmodel->inputs->GetDatasetInput(GiaMmeUgiaEnum);
+-		/*Go find the modelid'th input:*/
+-		TriaInput* tria_input_ngia=dataset_input_ngia->GetTriaInputByOffset(modelid);
+-		TriaInput* tria_input_ugia=dataset_input_ugia->GetTriaInputByOffset(modelid);
+-
+-		/*Plug into SealevelUGiaRate and SealevelNGiaRate inputs:*/
+-		Input* tria_input_copy_ngia=tria_input_ngia->copy();
+-		Input* tria_input_copy_ugia=tria_input_ugia->copy();
+-		tria_input_copy_ngia->ChangeEnum(NGiaRateEnum);
+-		tria_input_copy_ugia->ChangeEnum(UGiaRateEnum);
+-		femmodel->inputs->AddInput(tria_input_copy_ngia);
+-		femmodel->inputs->AddInput(tria_input_copy_ugia);
+-	}
+-	
+-	/*End profiler*/
+-	femmodel->profiler->Stop(GIACORE);
+-}
+Index: ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp	(revision 26047)
+@@ -45,6 +45,9 @@
+ void           LoveAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_(" not needed!");
+ }/*}}}*/
++void           LoveAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_(" not needed!");
++}/*}}}*/
+ ElementVector* LoveAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	_error_(" not needed!");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26047)
+@@ -3,6 +3,7 @@
+ #include "../classes/classes.h"
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
++#include "../classes/Inputs/TransientInput.h"
+ 
+ #define FINITEELEMENT P1Enum
+ 
+@@ -118,6 +119,7 @@
+ 	bool   ismovingfront;
+ 	bool   isoceancoupling;
+ 	bool   issmb;
++	int    grdmodel;
+ 
+ 	/*Fetch data needed: */
+ 	iomodel->FindConstant(&stabilization,"md.masstransport.stabilization");
+@@ -147,7 +149,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+@@ -154,8 +156,6 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+ 	if(isgroundingline) 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+-	/*Initialize cumdeltalthickness input*/
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelchangeCumDeltathicknessEnum);
+ 	/*Initialize ThicknessResidual input*/
+ 	InputUpdateFromConstantx(inputs,elements,0.,ThicknessResidualEnum);
+ 
+@@ -225,6 +225,15 @@
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
+ 
++	/*Initialize sea level cumulated sea level loads :*/
++	InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaIceThicknessEnum);
++	InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaIceThicknessEnum);
++
++	/*for Ivins deformation model, initialize history of ice thickness changes:*/
++	iomodel->FindConstant(&grdmodel,"md.solidearth.settings.grdmodel");
++	if(grdmodel==IvinsEnum) inputs->SetTransientInput(TransientAccumulatedDeltaIceThicknessEnum,NULL,0);
++
++
+ }/*}}}*/
+ void MasstransportAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+@@ -249,6 +258,9 @@
+ void           MasstransportAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           MasstransportAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* MasstransportAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+@@ -794,10 +806,18 @@
+ }/*}}}*/
+ void           MasstransportAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+-
+ 	/*Only update if on base*/
+ 	if(!element->IsOnBase()) return;
+-	
++
++	/*deal with logic of accumulating thickness if we are coupled to a 
++	 * sea level core:*/
++	int frequency,count,isgrd;
++	element->FindParam(&isgrd,SolidearthSettingsGRDEnum);
++	if(isgrd){
++		element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++		element->FindParam(&count,SealevelchangeRunCountEnum);
++	}
++		
+ 	/*Fetch dof list and allocate solution vector*/
+ 	int *doflist = NULL;
+ 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -805,9 +825,6 @@
+ 	int numnodes = element->GetNumberOfNodes();
+ 	IssmDouble* newthickness = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* thicknessresidual = xNew<IssmDouble>(numnodes);
+-	
+-	/*recover time step:*/
+-	IssmDouble dt = element->FindParam(TimesteppingTimeStepEnum);
+ 
+ 	/*Use the dof list to index into the solution vector: */
+ 	IssmDouble minthickness = element->FindParam(MasstransportMinThicknessEnum);
+@@ -843,7 +860,7 @@
+ 	newthickness  = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* oldthickness      = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* cumdeltathickness = xNew<IssmDouble>(numvertices);
+-	IssmDouble* icethicknessrate    = xNew<IssmDouble>(numvertices);
++	IssmDouble* deltathickness = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* newbase           = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* bed               = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* newsurface        = xNew<IssmDouble>(numvertices);
+@@ -859,7 +876,7 @@
+ 	basalelement->GetInputListOnVertices(&oldsurface[0],SurfaceOldEnum);
+ 	basalelement->GetInputListOnVertices(&phi[0],MaskOceanLevelsetEnum);
+ 	basalelement->GetInputListOnVertices(&sealevel[0],SealevelEnum);
+-	basalelement->GetInputListOnVertices(&cumdeltathickness[0],SealevelchangeCumDeltathicknessOldEnum);
++	if(isgrd)basalelement->GetInputListOnVertices(&cumdeltathickness[0],AccumulatedDeltaIceThicknessEnum);
+ 
+ 	/*Do we do grounding line migration?*/
+ 	bool isgroundingline;
+@@ -867,9 +884,10 @@
+ 	if(isgroundingline) basalelement->GetInputListOnVertices(&bed[0],BedEnum);
+ 
+ 	/*What is the delta thickness forcing the sea-level change core: cumulated over time, hence the +=:*/
+-	for(int i=0;i<numvertices;i++){
+-		cumdeltathickness[i] += newthickness[i]-oldthickness[i];
+-		icethicknessrate[i]     = (newthickness[i]-oldthickness[i])/dt;
++	if(isgrd){
++		for(int i=0;i<numvertices;i++){
++			cumdeltathickness[i] += newthickness[i]-oldthickness[i];
++		}
+ 	}
+ 
+ 	/*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/
+@@ -905,9 +923,51 @@
+ 	/*Add input to the element: */
+ 	element->AddBasalInput(SurfaceEnum,newsurface,P1Enum);
+ 	element->AddBasalInput(BaseEnum,newbase,P1Enum);
+-	element->AddBasalInput(SealevelchangeCumDeltathicknessEnum,cumdeltathickness,P1Enum);
+-	element->AddBasalInput(SurfaceloadIceThicknessRateEnum,icethicknessrate,P1Enum);
++	if(isgrd){
++		int grdmodel;
+ 
++		/*accumulate ice thickness changes: */
++		element->AddBasalInput(AccumulatedDeltaIceThicknessEnum,cumdeltathickness,P1Enum);
++
++		/*for Ivins deformation model, keep history of ice thickness changes:*/
++		element->FindParam(&grdmodel,GrdModelEnum);
++		if(grdmodel==IvinsEnum){
++			int *vertexlids = NULL;
++			int *vertexsids= NULL;
++			IssmDouble time;
++
++			TransientInput* transientinput = basalelement->inputs->GetTransientInput(TransientAccumulatedDeltaIceThicknessEnum);
++
++			/*Get values and lid list and recover vertices ids needed to initialize inputs*/
++			vertexlids      = xNew<int>(numvertices);
++			vertexsids      = xNew<int>(numvertices);
++			element->FindParam(&time,TimeEnum);
++			element->GetVerticesLidList(&vertexlids[0]);
++			element->GetVerticesSidList(&vertexsids[0]);
++
++			/*Add the current time cumdeltathickness to the existing time series: */
++			switch(element->ObjectEnum()){
++				case TriaEnum:  transientinput->AddTriaTimeInput( time,numvertices,vertexlids,cumdeltathickness,P1Enum); break;
++				default: _error_("Not implemented yet");
++			}
++			xDelete<int>(vertexlids);
++			xDelete<int>(vertexsids);
++		}
++			
++		/*compute total ice thickness change between two sea-level solver time steps, ie. every frequency*dt:*/
++		if(count==frequency){
++			IssmDouble* oldcumdeltathickness = xNew<IssmDouble>(numvertices);
++
++			basalelement->GetInputListOnVertices(&oldcumdeltathickness[0],OldAccumulatedDeltaIceThicknessEnum);
++			element->AddBasalInput(OldAccumulatedDeltaIceThicknessEnum,cumdeltathickness,P1Enum);
++			for(int i=0;i<numvertices;i++)deltathickness[i]=cumdeltathickness[i]-oldcumdeltathickness[i];
++			element->AddBasalInput(DeltaIceThicknessEnum,deltathickness,P1Enum);
++
++			xDelete<IssmDouble>(oldcumdeltathickness);
++		}
++
++	}
++
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(newthickness);
+ 	xDelete<IssmDouble>(cumdeltathickness);
+@@ -914,7 +974,6 @@
+ 	xDelete<IssmDouble>(newbase);
+ 	xDelete<IssmDouble>(newsurface);
+ 	xDelete<IssmDouble>(oldthickness);
+-	xDelete<IssmDouble>(icethicknessrate);
+ 	xDelete<IssmDouble>(oldbase);
+ 	xDelete<IssmDouble>(oldsurface);
+ 	xDelete<IssmDouble>(phi);
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 26047)
+@@ -55,7 +55,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+@@ -70,6 +70,9 @@
+ void           MeltingAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           MeltingAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* MeltingAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/m4/analyses.m4
+===================================================================
+--- ../trunk-jpl/m4/analyses.m4	(revision 26046)
++++ ../trunk-jpl/m4/analyses.m4	(revision 26047)
+@@ -303,6 +303,20 @@
+ AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
+ AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
+ dnl }}}
++dnl with-HydrologyTws{{{
++AC_ARG_WITH([HydrologyTws],
++	AS_HELP_STRING([--with-HydrologyTws = YES], [compile with HydrologyTws capabilities (default is yes)]),
++	[HYDROLOGYTWS=$withval],[HYDROLOGYTWS=yes])
++AC_MSG_CHECKING(for HydrologyTws capability compilation)
++
++HAVE_HYDROLOGYTWS=no 
++if test "x$HYDROLOGYTWS" = "xyes"; then
++	HAVE_HYDROLOGYTWS=yes
++	AC_DEFINE([_HAVE_HYDROLOGYTWS_],[1],[with HydrologyTws capability])
++fi
++AM_CONDITIONAL([HYDROLOGYTWS], [test x$HAVE_HYDROLOGYTWS = xyes])
++AC_MSG_RESULT($HAVE_HYDROLOGYTWS)
++dnl }}}
+ dnl with-HydrologyGlaDS{{{
+ AC_ARG_WITH([HydrologyGlaDS],
+ 	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
+@@ -415,6 +429,20 @@
+ AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
+ AC_MSG_RESULT($HAVE_MASSTRANSPORT)
+ dnl }}}
++dnl with-Oceanmasstransport{{{
++AC_ARG_WITH([Oceanmasstransport],
++	AS_HELP_STRING([--with-Oceanmasstransport = YES], [compile with Oceanmasstransport capabilities (default is yes)]),
++	[OCEANMASSTRANSPORT=$withval],[OCEANMASSTRANSPORT=yes])
++AC_MSG_CHECKING(for Oceanmasstransport capability compilation)
++
++HAVE_OCEANMASSTRANSPORT=no 
++if test "x$OCEANMASSTRANSPORT" = "xyes"; then
++	HAVE_OCEANMASSTRANSPORT=yes
++	AC_DEFINE([_HAVE_OCEANMASSTRANSPORT_],[1],[with Oceanmasstransport capability])
++fi
++AM_CONDITIONAL([OCEANMASSTRANSPORT], [test x$HAVE_OCEANMASSTRANSPORT = xyes])
++AC_MSG_RESULT($HAVE_OCEANMASSTRANSPORT)
++dnl }}}
+ dnl with-Melting{{{
+ AC_ARG_WITH([Melting],
+ 	AS_HELP_STRING([--with-Melting = YES], [compile with Melting capabilities (default is yes)]),
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26046)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26047)
+@@ -193,6 +193,7 @@
+ 	./toolkits/mpi/commops/DetermineRowRankFromLocalSize.cpp \
+ 	./toolkits/mpi/commops/GetOwnershipBoundariesFromRange.cpp \
+ 	./toolkits/ToolkitOptions.cpp \
++	./modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp\
+ 	./modules/ModelProcessorx/ModelProcessorx.cpp \
+ 	./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp \
+ 	./modules/ModelProcessorx/NodesPartitioning.cpp \
+@@ -267,6 +268,7 @@
+ 	./cores/transient_core.cpp \
+ 	./cores/steadystate_core.cpp \
+ 	./cores/masstransport_core.cpp \
++	./cores/oceantransport_core.cpp \
+ 	./cores/depthaverage_core.cpp \
+ 	./cores/extrudefrombase_core.cpp \
+ 	./cores/extrudefromtop_core.cpp \
+@@ -449,6 +451,10 @@
+ if HYDROLOGYSHREVE
+ issm_sources += ./analyses/HydrologyShreveAnalysis.cpp
+ endif
++if HYDROLOGYTWS
++issm_sources += ./analyses/HydrologyTwsAnalysis.cpp
++endif
++
+ if HYDROLOGYSHAKTI
+ issm_sources += ./analyses/HydrologyShaktiAnalysis.cpp
+ endif
+@@ -473,6 +479,9 @@
+ if MASSTRANSPORT
+ issm_sources += ./analyses/MasstransportAnalysis.cpp
+ endif
++if OCEANMASSTRANSPORT
++issm_sources += ./analyses/OceantransportAnalysis.cpp
++endif
+ if SMB
+ issm_sources += ./analyses/SmbAnalysis.cpp
+ endif
+@@ -511,8 +520,6 @@
+ if GIA
+ if FORTRAN
+ issm_sources += \
+-	./cores/gia_core.cpp \
+-	./analyses/GiaAnalysis.cpp \
+ 	./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp \
+ 	./modules/GiaDeflectionCorex/distme.f \
+ 	./modules/GiaDeflectionCorex/freed.f \
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26047)
+@@ -29,6 +29,9 @@
+ void           AdjointBalancethicknessAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           AdjointBalancethicknessAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* AdjointBalancethicknessAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26047)
+@@ -29,6 +29,9 @@
+ void AdjointHorizAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void AdjointHorizAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* AdjointHorizAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 26047)
+@@ -98,7 +98,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+@@ -119,6 +119,9 @@
+ void           BalancethicknessAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           BalancethicknessAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* BalancethicknessAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 26047)
+@@ -40,7 +40,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+@@ -60,6 +60,9 @@
+ void           BalancevelocityAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           BalancevelocityAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* BalancevelocityAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26047)
+@@ -122,6 +122,9 @@
+ void           DamageEvolutionAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           DamageEvolutionAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ void           DamageEvolutionAnalysis::CreateDamageFInput(Element* element){/*{{{*/
+ 
+ 	/*Fetch number of vertices and allocate output*/
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		void           CreateDamageFInput(Element* element);
+ 		void           CreateDamageFInputArctan(Element* element);
+ 		void           CreateDamageFInputExp(Element* element);
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26047)
+@@ -135,7 +135,7 @@
+ 
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+@@ -547,6 +547,9 @@
+ 	PostProcessing(femmodel);
+ 
+ }/*}}}*/
++void           EnthalpyAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* EnthalpyAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 26047)
+@@ -64,9 +64,6 @@
+ 		#ifdef _HAVE_GLHEIGHTADVECTION_
+ 		case GLheightadvectionAnalysisEnum : return new GLheightadvectionAnalysis();
+ 		#endif
+-		#ifdef _HAVE_GIA_
+-		case GiaAnalysisEnum : return new GiaAnalysis();
+-		#endif
+ 		#ifdef _HAVE_HYDROLOGYDCEFFICIENT_
+ 		case HydrologyDCEfficientAnalysisEnum : return new HydrologyDCEfficientAnalysis();
+ 		#endif
+Index: ../trunk-jpl/src/c/analyses/EsaAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EsaAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/EsaAnalysis.cpp	(revision 26047)
+@@ -31,7 +31,7 @@
+ 
+ 	/*Create inputs: */
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.esa.deltathickness",EsaDeltathicknessEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.esa.deltathickness",DeltaIceThicknessEnum);
+ 
+ }/*}}}*/
+ void EsaAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+@@ -188,6 +188,9 @@
+ void           EsaAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           EsaAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* EsaAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26047)
+@@ -73,7 +73,7 @@
+ 	}
+ 
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum,0.);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+@@ -128,6 +128,9 @@
+ void           FreeSurfaceBaseAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           FreeSurfaceBaseAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* FreeSurfaceBaseAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 26047)
+@@ -76,7 +76,7 @@
+ 	}
+ 
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+@@ -102,6 +102,9 @@
+ void           FreeSurfaceTopAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           FreeSurfaceTopAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* FreeSurfaceTopAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26047)
+@@ -48,6 +48,9 @@
+ void           GLheightadvectionAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           GLheightadvectionAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* GLheightadvectionAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26047)
+@@ -155,6 +155,9 @@
+ void HydrologyDCEfficientAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void HydrologyDCEfficientAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* HydrologyDCEfficientAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 26047)
+@@ -177,6 +177,9 @@
+ void           HydrologyDCInefficientAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           HydrologyDCInefficientAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* HydrologyDCInefficientAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26047)
+@@ -128,7 +128,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0); /*Needed for friction*/
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+@@ -214,6 +214,9 @@
+ void           HydrologyGlaDSAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           HydrologyGlaDSAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* HydrologyGlaDSAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 26047)
+@@ -63,6 +63,9 @@
+ void           HydrologyPismAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           HydrologyPismAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* HydrologyPismAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 26047)
+@@ -132,7 +132,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+@@ -298,6 +298,9 @@
+ void           ThermalAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           ThermalAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* ThermalAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26047)
+@@ -22,6 +22,7 @@
+ class Vertex;
+ class Materials;
+ class Material;
++class Matlitho;
+ class Inputs;
+ class Inputs;
+ class Input;
+@@ -365,7 +366,7 @@
+ 		virtual void       WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue){_error_("not implemented yet");};
+ 
+ 		#ifdef _HAVE_GIA_
+-		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y)=0;
++		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+ 		#endif
+ 		#ifdef _HAVE_ESA_
+ 		virtual void          EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26047)
+@@ -16,6 +16,7 @@
+ class Results;
+ class Node;
+ class Material;
++class Matlitho;
+ class ElementMatrix;
+ class ElementVector;
+ class Vertex;
+@@ -162,7 +163,7 @@
+ 		IssmDouble     GetAreaSpherical(void){_error_("not implemented yet!");};
+ 
+ #ifdef _HAVE_GIA_
+-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ #endif
+ #ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26047)
+@@ -16,6 +16,7 @@
+ class Results;
+ class Node;
+ class Material;
++class Matlitho;
+ class Seg;
+ class ElementMatrix;
+ class ElementVector;
+@@ -153,7 +154,7 @@
+ 		void			WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue);
+ 
+ 		#ifdef _HAVE_GIA_
+-		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
++		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+ 		#endif
+ 		#ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,  Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy);
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26047)
+@@ -233,6 +233,29 @@
+ 	this->inputs[index_new] = copy;
+ }
+ /*}}}*/
++void Inputs::AXPY(IssmDouble alpha, int xenum, int yenum, int zenum){/*{{{*/
++
++	_assert_(this);
++
++	/*Get indices from enums*/
++	int index_x = EnumToIndex(xenum);
++	int index_y = EnumToIndex(yenum);
++	int index_z = EnumToIndex(zenum);
++
++	/*Delete output if it already exists*/
++	if(this->inputs[index_z]) delete this->inputs[index_z];
++
++	/*Make sure that old one exists*/
++	if(!this->inputs[index_x]) _error_("Input "<<EnumToStringx(xenum)<<" not found");
++	if(!this->inputs[index_y]) _error_("Input "<<EnumToStringx(yenum)<<" not found");
++
++	/*Make a copy*/
++	Input* z=this->inputs[index_y]->copy();
++
++	/*AXPY: */
++	this->inputs[index_z]->AXPY(this->inputs[index_x],alpha);
++}
++/*}}}*/
+ int  Inputs::EnumToIndex(int enum_in){/*{{{*/
+ 
+ 	_assert_(this);
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 26047)
+@@ -21,21 +21,22 @@
+ #define DAMAGECORE			8 /*Profiling DAMAGE */
+ #define MOVINGFRONTCORE		9 /*Profiling MOVINGFRONT */
+ #define MASSTRANSPORTCORE	10 /*Profiling MASSTRANSPORT */
+-#define SMBCORE				11 /*Profiling SMB */
+-#define GROUNDINGLINECORE	12 /*Profiling GROUDINGLINE MIGRATION */
+-#define GIACORE				13 /*Profiling GIA */
+-#define ESACORE				14 /*Profiling ESA */
+-#define SLRCORE				15 /*Profiling SLR */
+-#define SAMPLINGCORE	16 /*Profiling SAMPLING */
+-#define MPISERIAL				17 /*Profiling MPISerial */
+-#define SEDLOOP				18 /*Profiling MPISerial */
+-#define SEDMatrix				19 /*Profiling MPISerial */
+-#define SEDUpdate				20 /*Profiling MPISerial */
+-#define EPLLOOP				21 /*Profiling MPISerial */
+-#define EPLMasking			22 /*Profiling MPISerial */
+-#define EPLMatrices			23 /*Profiling MPISerial */
+-#define EPLUpdate				24 /*Profiling MPISerial */
+-#define MAXPROFSIZE			25 /*Used to initialize static arrays*/
++#define OCEANTRANSPORTCORE	11 /*Profiling OCEANTRANSPORT */
++#define SMBCORE				12 /*Profiling SMB */
++#define GROUNDINGLINECORE	13 /*Profiling GROUDINGLINE MIGRATION */
++#define GIACORE				14 /*Profiling GIA */
++#define ESACORE				15 /*Profiling ESA */
++#define SLRCORE				16 /*Profiling SLR */
++#define SAMPLINGCORE	17 /*Profiling SAMPLING */
++#define MPISERIAL				18 /*Profiling MPISerial */
++#define SEDLOOP				19 /*Profiling MPISerial */
++#define SEDMatrix				20 /*Profiling MPISerial */
++#define SEDUpdate				21 /*Profiling MPISerial */
++#define EPLLOOP				22 /*Profiling MPISerial */
++#define EPLMasking			23 /*Profiling MPISerial */
++#define EPLMatrices			24 /*Profiling MPISerial */
++#define EPLUpdate				25 /*Profiling MPISerial */
++#define MAXPROFSIZE			26 /*Used to initialize static arrays*/
+ 
+ 
+ class Profiler: public Object{
+Index: ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp	(revision 26047)
+@@ -58,19 +58,12 @@
+ 		case MasstransportSolutionEnum:
+ 			solutioncore=&masstransport_core;
+ 			break;
+-		case SealevelchangeSolutionEnum:
+-			solutioncore=&sealevelchange_core;
++		case OceantransportSolutionEnum:
++			solutioncore=&oceantransport_core;
+ 			break;
+ 		case EsaSolutionEnum:
+ 			solutioncore=&esa_core;
+ 			break;
+-		case GiaSolutionEnum:
+-			#if _HAVE_GIA_
+-			solutioncore=&gia_core;
+-			#else
+-			_error_("ISSM not compiled with Gia capability");
+-			#endif
+-			break;
+ 		case DamageEvolutionSolutionEnum:
+ 			solutioncore=&damage_core;
+ 			break;
+Index: ../trunk-jpl/src/c/main/issm.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/issm.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/main/issm.cpp	(revision 26047)
+@@ -14,6 +14,9 @@
+ 
+ 	/*Initialize femmodel from arguments provided command line: */
+ 	FemModel *femmodel = new FemModel(argc,argv,comm_init);
++	
++	/*Need to know we are firing up from ISSM main, not a coupler driver like issm_slcp or issm_ocean:*/
++	femmodel->parameters->AddObject(new IntParam(IsSlcCouplingEnum,0));
+ 
+ 	/*Solve: */
+ 	femmodel->Solve();
+Index: ../trunk-jpl/src/c/main/issm_slc.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/issm_slc.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/main/issm_slc.cpp	(revision 26047)
+@@ -99,6 +99,7 @@
+ 	femmodel->parameters->AddObject(new IntParam(NumModelsEnum,nummodels));
+ 	femmodel->parameters->AddObject(new IntParam(ModelIdEnum,modelid));
+ 	femmodel->parameters->AddObject(new IntParam(EarthIdEnum,earthid));
++	femmodel->parameters->AddObject(new IntParam(IsSlcCouplingEnum,1));
+ 	if(modelid==earthid) femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm*>(fromicecomms,IcecapToEarthCommEnum));
+ 	else femmodel->parameters->AddObject(new GenericParam<ISSM_MPI_Comm>(toearthcomm,IcecapToEarthCommEnum));
+ 
+Index: ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.h	(nonexistent)
++++ ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.h	(revision 26047)
+@@ -0,0 +1,11 @@
++#ifndef _MMETOINPUTFROMIDX_H
++#define _MMETOINPUTFROMIDX_H
++
++class Inputs; 
++class Elements; 
++class Parameters;
++
++/* local prototypes: */
++void  MmeToInputFromIdx(Inputs* inputs, Elements* elements, int id, int rootenum, int interpolationenum);
++
++#endif
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26047)
+@@ -167,9 +167,9 @@
+ 		input_enum        = DamageDbarEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+-	else if(strcmp(string_in,"SurfaceloadIceThicknessRate")==0){
+-		const char* field = "md.solidearth.surfaceload.icethicknesschange";
+-		input_enum        = SurfaceloadIceThicknessRateEnum;
++	else if(strcmp(string_in,"IceLoad")==0){
++		const char* field = "md.masstransport.spcthickness";
++		input_enum        = MasstransportSpcthicknessEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+ 	else if(strcmp(string_in,"NGiaRate")==0){
+@@ -177,16 +177,26 @@
+ 		input_enum        = NGiaRateEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+-	else if(strcmp(string_in,"DslGlobalAverageThermostericSeaLevelChange")==0){
+-		const char* field = "md.dsl.global_average_thermosteric_sea_level_change";
+-		input_enum        = DslGlobalAverageThermostericSeaLevelChangeEnum;
++	else if(strcmp(string_in,"DslGlobalAverageThermostericSeaLevel")==0){
++		const char* field = "md.dsl.global_average_thermosteric_sea_level";
++		input_enum        = OceantransportSpcstrEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
+-	else if(strcmp(string_in,"SurfaceloadWaterHeightRate")==0){
+-		const char* field = "md.solidearth.surfaceload.waterheightchange";
+-		input_enum        = SurfaceloadWaterHeightRateEnum;
++	else if(strcmp(string_in,"DslSeaWaterPressureAtSeaFloor")==0){
++		const char* field = "md.dsl.sea_water_pressure_at_sea_floor";
++		input_enum        = OceantransportSpcbottompressureEnum;
+ 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+ 	}
++	else if(strcmp(string_in,"DslSeaSurfaceHeightAboveGeoid")==0){
++		const char* field = "md.dsl.sea_surface_height_above_geoid";
++		input_enum        = OceantransportSpcdslEnum;
++		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
++	}
++	else if(strcmp(string_in,"TwsLoad")==0){
++		const char* field = "md.hydrology.spcwatercolumn";
++		input_enum        = HydrologyTwsSpcEnum;
++		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
++	}
+ 	else if(strcmp(string_in,"UGiaRate")==0){
+ 		const char* field = "md.gia.Ugia";
+ 		input_enum        = UGiaRateEnum;
+@@ -272,6 +282,7 @@
+ 		case 3: return HydrologyshaktiEnum;
+ 		case 4: return HydrologypismEnum;
+ 		case 5: return HydrologyGlaDSEnum;
++		case 6: return HydrologyTwsEnum;
+ 		default: _error_("Marshalled hydrology code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+@@ -313,6 +324,14 @@
+ 		default: _error_("Marshalled AMR code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
++int IoCodeToEnumGrd(int enum_in){/*{{{*/
++	switch(enum_in){
++		case 0: return NoneEnum;
++		case 1: return ElasticEnum;
++		case 2: return IvinsEnum;
++		default: _error_("Marshalled GRD code \""<<enum_in<<"\" not supported yet");
++	}
++}/*}}}*/
+ 
+ int IoCodeToEnumVertexEquation(int enum_in){/*{{{*/
+ 	switch(enum_in){
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.h	(revision 26046)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.h	(revision 26047)
+@@ -12,6 +12,7 @@
+ int IoCodeToEnumNature(int enum_in);
+ int IoCodeToEnumTimestepping(int enum_in);
+ int IoCodeToEnumAmr(int enum_in);
++int IoCodeToEnumGrd(int enum_in);
+ 
+ int IoCodeToEnumVertexEquation(int enum_in);
+ int IoCodeToEnumElementEquation(int enum_in);
+Index: ../trunk-jpl/src/m/classes/giaivins.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/giaivins.js	(revision 26046)
++++ ../trunk-jpl/src/m/classes/giaivins.js	(nonexistent)
+@@ -1,64 +0,0 @@
+-//GIA class definition for Ivins and James model 
+-//
+-//   Usage:
+-//      giaivins=new giaivins();
+-
+-function giaivins (){
+-	//methods
+-	this.setdefaultparameters = function(){// {{{
+-
+-		this.cross_section_shape=1; //square as default (see iedge in GiaDeflectionCorex)
+-	
+-	}// }}}
+-	this.disp= function(){// {{{
+-
+-		console.log(sprintf('   giaivins parameters:'));
+-
+-		fielddisplay(this,'mantle_viscosity','mantle viscosity[Pa s]');
+-		fielddisplay(this,'lithosphere_thickness','lithosphere thickness (km)');
+-		fielddisplay(this,'cross_section_shape','1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore');
+-
+-	}// }}}
+-	this.classname= function(){// {{{
+-		return "giaivins";
+-	}// }}}
+-	this.checkconsistency = function(md,solution,analyses) { // {{{
+-
+-		if(!ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1))return;
+-
+-		checkfield(md,'fieldname','gia.mantle_viscosity','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
+-		checkfield(md,'fieldname','gia.lithosphere_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
+-		checkfield(md,'fieldname','gia.cross_section_shape','numel',[1],'values',[1,2]);
+-
+-		//be sure that if we are running a masstransport ice flow model coupled with giaivins, that thickness forcings 
+-		//are not provided into the future.
+-		if (solution=='TransientSolution' & md.trans.ismasstransport & md.trans.isgia){
+-			//figure out if thickness is a transient forcing: 
+-			if (md.geometry.thickness.length == (md.mesh.numberofvertices+1)){
+-				//recover the furthest time "in time": 
+-				t=md.geometry.thickness[0].length;
+-				if(md.geometry.thickness[md.geometry.thickness.length-1][t-1]!=md.timestepping.start_time){
+-					md.checkmessage('if ismasstransport is on, transient thickness forcing for the giaivins model should not be provided in the future. Synchronize your start_time to correspond to the most recent transient thickness forcing timestep');
+-				}
+-			}
+-		}
+-	} // }}}
+-		this.marshall=function(md,prefix,fid) { //{{{
+-			WriteData(fid,prefix,'object',this,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',this,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',Math.pow(10,3)); //from km to m
+-			WriteData(fid,prefix,'object',this,'fieldname','cross_section_shape','format','Integer');
+-		}//}}}
+-		this.fix=function() { //{{{
+-			this.mantle_viscosity=NullFix(this.mantle_viscosity,NaN);
+-			this.lithosphere_thickness=NullFix(this.lithosphere_thickness,NaN);
+-		}//}}}
+-	//properties 
+-	// {{{
+-
+-	this.mantle_viscosity              = NaN;
+-	this.lithosphere_thickness         = NaN;
+-	this.cross_section_shape           = 0;
+-
+-	this.setdefaultparameters();
+-	//}}}
+-}
+Index: ../trunk-jpl/src/m/classes/giaivins.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/giaivins.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/giaivins.m	(nonexistent)
+@@ -1,73 +0,0 @@
+-%GIA class definition for Ivins and James model 
+-%
+-%   Usage:
+-%      giaivins=giaivins();
+-
+-classdef giaivins
+-	properties (SetAccess=public) 
+-		mantle_viscosity              = NaN;
+-		lithosphere_thickness         = NaN;
+-		cross_section_shape           = 0;
+-	end
+-	methods
+-		function self = giaivins(varargin) % {{{
+-			switch nargin
+-				case 0
+-					self=setdefaultparameters(self);
+-				otherwise
+-					error('constructor not supported');
+-			end
+-		end % }}}
+-		function self = setdefaultparameters(self) % {{{
+-		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
+-		end % }}}
+-		function md = checkconsistency(self,md,solution,analyses) % {{{
+-
+-			if ~ismember('GiaAnalysis',analyses), return; end
+-			md = checkfield(md,'fieldname','gia.mantle_viscosity','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+-			md = checkfield(md,'fieldname','gia.lithosphere_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+-			md = checkfield(md,'fieldname','gia.cross_section_shape','numel',[1],'values',[1,2]);
+-
+-			%be sure that if we are running a masstransport ice flow model coupled with giaivins, that thickness forcings 
+-			%are not provided into the future.
+-			if strcmp(solution,'TransientSolution') & md.transient.ismasstransport & md.transient.isgia,
+-				%figure out if thickness is a transient forcing: 
+-				if size(md.geometry.thickness,1)==md.mesh.numberofvertices+1,
+-					%recover the furthest time "in time": 
+-					if(md.geometry.thickness(end,end)~=md.timestepping.start_time),
+-						md = checkmessage(md,['if ismasstransport is on, transient thickness forcing'...
+-							' for the giaivins model should not be provided in the future.'...
+-							' Synchronize your start_time to correspond to the most recent transient'...
+-							' thickness forcing timestep']);
+-					end
+-				end
+-			end
+-
+-		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   giaivins parameters:'));
+-
+-			fielddisplay(self,'mantle_viscosity','mantle viscosity[Pa s]');
+-			fielddisplay(self,'lithosphere_thickness','lithosphere thickness (km)');
+-			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore');
+-
+-		end % }}}
+-		function marshall(self,prefix,md,fid) % {{{
+-			WriteData(fid,prefix,'name','md.gia.model','data',1,'format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10^3); %from km to m
+-			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','format','Integer');
+-		end % }}}
+-		function savemodeljs(self,fid,modelname) % {{{
+-		
+-			writejsdouble(fid,[modelname '.gia.mantle_viscosity'],self.mantle_viscosity);
+-			writejsdouble(fid,[modelname '.gia.lithosphere_thickness'],self.lithosphere_thickness);
+-			writejsdouble(fid,[modelname '.gia.cross_section_shape'],self.cross_section_shape);
+-
+-		end % }}}
+-		function self = extrude(self,md) % {{{
+-			self.mantle_viscosity=project3d(md,'vector',self.mantle_viscosity,'type','node');
+-			self.lithosphere_thickness=project3d(md,'vector',self.lithosphere_thickness,'type','node');
+-		end % }}}
+-	end
+-end
+Index: ../trunk-jpl/src/m/classes/giaivins.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/giaivins.py	(revision 26046)
++++ ../trunk-jpl/src/m/classes/giaivins.py	(nonexistent)
+@@ -1,72 +0,0 @@
+-import numpy as np
+-
+-from checkfield import checkfield
+-from fielddisplay import fielddisplay
+-from project3d import project3d
+-from WriteData import WriteData
+-
+-
+-class giaivins(object):
+-    """GIA class definition for Ivins and James model
+-
+-    Usage:
+-        giaivins = giaivins()
+-    """
+-
+-    def __init__(self, *args): #{{{
+-        self.mantle_viscosity       = np.nan
+-        self.lithosphere_thickness  = np.nan
+-        self.cross_section_shape    = 0
+-
+-        nargin = len(args)
+-        if nargin == 0:
+-            self.setdefaultparameters()
+-        else:
+-            raise Exception('constructor not supported')
+-    #}}}
+-
+-    def __repr__(self): #{{{
+-        s = '   giaivins parameters:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'mantle_viscosity', 'mantle viscosity [Pa s]'))
+-        s += '{}\n'.format(fielddisplay(self, 'lithosphere_thickness', 'lithosphere thickness (km)'))
+-        s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', "1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore"))
+-        return s
+-    #}}}
+-
+-    def setdefaultparameters(self): #{{{
+-        self.cross_section_shape = 1
+-        return self
+-    #}}}
+-
+-    def checkconsistency(self, md, solution, analyses): #{{{
+-        if 'GiaAnalysis' not in analyses:
+-            return md
+-
+-        md = checkfield(md, 'fieldname', 'gia.mantle_viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
+-        md = checkfield(md, 'fieldname', 'gia.lithosphere_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
+-        md = checkfield(md, 'fieldname', 'gia.cross_section_shape', 'numel', [1], 'values', [1, 2])
+-
+-        # Be sure that if we are running a masstransport ice flow model coupled 
+-        # with giaivins, that thickness forcings are not provided into the 
+-        # future.
+-        if solution == 'TransientSolution' and md.transient.ismasstransport and md.transient.isgia:
+-            # Figure out if thickness is a transient forcing
+-            if md.geometry.thickness.shape[0] == md.mesh.numberofvertices + 1:
+-                # Recover the furthest time "in time"
+-                if md.geometry.thickness[-1, -1] != md.timestepping.start_time:
+-                    md.checkmessage('if masstransport is on, transient thickness forcing for the giaivins model should not be provided in the future. Synchronize your start_time to correspond to the most recent transient thickness forcing timestep')
+-        return md
+-    #}}}
+-
+-    def marshall(self, prefix, md, fid): #{{{
+-        WriteData(fid, prefix, 'name', 'md.gia.model', 'data', 1, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'mantle_viscosity', 'format', 'DoubleMat', 'mattype', 1)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'lithosphere_thickness', 'format', 'DoubleMat', 'mattype', 1, 'scale', 10.**3.)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'format', 'Integer')
+-    #}}}
+-
+-    def extrude(self, md): #{{{
+-        self.mantle_viscosity = project3d(md, 'vector', self.mantle_viscosity, 'type', 'node')
+-        self.lithosphere_thickness = project3d(md, 'vector', self.lithosphere_thickness, 'type', 'node')
+-        return self
+-    #}}}
+Index: ../trunk-jpl/src/m/classes/giamme.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/giamme.py	(revision 26046)
++++ ../trunk-jpl/src/m/classes/giamme.py	(nonexistent)
+@@ -1,72 +0,0 @@
+-import numpy as np
+-
+-from checkfield import checkfield
+-from fielddisplay import fielddisplay
+-from project3d import project3d
+-from WriteData import WriteData
+-
+-
+-class giamme(object):
+-    """GIAMME class definition
+-
+-    Usage:
+-        gia = giamme() #gia class based on a multi-model ensemble (ex: Caron et al 2017 statistics)
+-    """
+-
+-    def __init__(self, *args): #{{{
+-        self.modelid    = 0 #index into the multi-model ensemble
+-        self.Ngia       = [] #geoid ensemble
+-        self.Ugia       = [] #uplift ensemble
+-        
+-        nargin = len(args)
+-
+-        if nargin == 0:
+-            self.setdefaultparameters()
+-        else:
+-            raise Exception('constructor not supported')
+-    #}}}
+-
+-    def __repr__(self): # {{{
+-        s = '   gia mme parameters:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'modelid', 'index into the multi-model ensemble, determines which field will be used.'))
+-        s += '{}\n'.format(fielddisplay(self, 'Ngia', 'geoid (mm/yr).'))
+-        s += '{}\n'.format(fielddisplay(self, 'Ugia', 'uplift (mm/yr).'))
+-        return s
+-    #}}}
+-
+-    def setdefaultparameters(self): # {{{
+-        return self
+-    #}}}
+-
+-    def checkconsistency(self, md, solution, analyses): # {{{
+-        if 'SealevelriseAnalysis' not in analyses:
+-            return md
+-        if solution == 'TransientSolution' and not md.transient.isslc:
+-            return md
+-        md = checkfield(md, 'field', self.Ngia, 'NaN', 1, 'Inf', 1)
+-        md = checkfield(md, 'field', self.Ugia, 'NaN', 1, 'Inf', 1)
+-        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', len(self.Ngia))
+-        return md
+-    #}}}
+-
+-    def marshall(self, prefix, md, fid): #{{{
+-        WriteData(fid, prefix, 'name', 'md.gia.model', 'data', 3, 'format', 'Integer')
+-
+-        if isinstance(self.Ngia, list) or self.Ngia.ndim == 1: #list or 1D numpy.ndarray
+-            WriteData(fid, prefix, 'data', np.zeros((md.mesh.numberofvertices, 1)), 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.gia.Ngia')
+-            WriteData(fid, prefix, 'data', np.zeros((md.mesh.numberofvertices, 1)), 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.gia.Ugia')
+-            WriteData(fid, prefix, 'data', 1, 'name', 'md.gia.modelid', 'format', 'Double')
+-            WriteData(fid, prefix, 'name', 'md.gia.nummodels', 'data', 1, 'format', 'Integer')
+-        else: #2D numpy.ndarray
+-            WriteData(fid, prefix, 'object ', self, 'fieldname', 'Ngia', 'format', 'DoubleMat', 'scale', 1 / 1000 / md.constants.yts)
+-            WriteData(fid, prefix, 'object ', self, 'fieldname', 'Ugia', 'format', 'DoubleMat', 'scale', 1 / 1000 / md.constants.yts)
+-            WriteData(fid, prefix, 'object ', self, 'fieldname', 'modelid', 'format', 'Double')
+-            WriteData(fid, prefix, 'name', 'md.gia.nummodels', 'data', self.Ngia.shape[1],'format', 'Integer') #NOTE: <<numpy.ndarray>>.shape[1] gives length of second dimension
+-    #}}}
+-
+-    def extrude(self, md): #{{{
+-        for i in range(len(self.Ngia)):
+-            self.Ngia[i] = project3d(md, 'vector', self.Ngia[i], 'type', 'node', 'layer', 1)
+-            self.Ugia[i] = project3d(md, 'vector', self.Ugia[i], 'type', 'node', 'layer', 1)
+-        return self
+-    #}}}
+Index: ../trunk-jpl/src/m/classes/giamme.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/giamme.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/giamme.m	(nonexistent)
+@@ -1,77 +0,0 @@
+-%GIAMME class definition
+-%
+-%   Usage:
+-%      gia=giamme(); %gia class based on a multi-model 
+-%                     ensemble  (ex: Caron et al 2017 statistics)
+-
+-classdef giamme
+-	properties (SetAccess=public) 
+-
+-		modelid; %index into the multi-model ensemble
+-		Ngia;  %geoid ensemble
+-		Ugia;  %uplift ensemble
+-
+-	end
+-	methods
+-		function self = giamme(varargin) % {{{
+-			switch nargin
+-				case 0
+-					self=setdefaultparameters(self);
+-				case 1
+-					self=structtoobj(gia(),varargin{1});
+-				otherwise
+-					error('constructor not supported');
+-			end
+-		end % }}}
+-		function self = setdefaultparameters(self) % {{{
+-
+-			self.modelid=0;
+-			self.Ngia=[];
+-			self.Ugia=[];
+-
+-		end % }}}
+-		function md = checkconsistency(self,md,solution,analyses) % {{{
+-
+-			%Early return
+-			if ~ismember('SealevelchangeAnalysis',analyses), return; end
+-			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+-			md = checkfield(md,'field',self.Ngia,'NaN',1,'Inf',1);
+-			md = checkfield(md,'field',self.Ugia,'NaN',1,'Inf',1);
+-			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',0,'<=',length(self.Ngia));
+-		end % }}}
+-		function disp(self) % {{{
+-
+-			disp(sprintf('   gia mme parameters:'));
+-			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
+-			fielddisplay(self,'Ngia','geoid (mm/yr).');
+-			fielddisplay(self,'Ugia','uplift (mm/yr).');
+-		end % }}}
+-		function marshall(self,prefix,md,fid) % {{{
+-			WriteData(fid,prefix,'name','md.gia.model','data',3,'format','Integer');
+-			if size(self.Ngia,2)==0,
+-				WriteData(fid,prefix,'data',zeros(md.mesh.numberofvertices,1),'format','DoubleMat','mattype',1,'name','md.gia.Ngia');
+-				WriteData(fid,prefix,'data',zeros(md.mesh.numberofvertices,1),'format','DoubleMat','mattype',1,'name','md.gia.Ugia');
+-				WriteData(fid,prefix,'data',1,'name','md.gia.modelid','format','Double');
+-				WriteData(fid,prefix,'name','md.gia.nummodels','data',1,'format','Integer');
+-			else
+-				WriteData(fid,prefix,'object',self,'fieldname','Ngia','format','DoubleMat','scale',1/1000/md.constants.yts);
+-				WriteData(fid,prefix,'object',self,'fieldname','Ugia','format','DoubleMat','scale',1/1000/md.constants.yts);
+-				WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+-				WriteData(fid,prefix,'name','md.gia.nummodels','data',size(self.Ngia,2),'format','Integer');
+-			end
+-		end % }}}
+-		function savemodeljs(self,fid,modelname) % {{{
+-			
+-			writejsdouble(fid,[modelname '.gia.modelid'],self.modelid);
+-			writejscellarray(fid,[modelname '.gia.Ngia'],self.Ngia);
+-			writejscellarray(fid,[modelname '.gia.Ugia'],self.Ugia);
+-
+-		end % }}}
+-		function self = extrude(self,md) % {{{
+-			for i=1:length(self.Ngia),
+-				self.Ngia{i}=project3d(md,'vector',self.Ngia{i},'type','node','layer',1);
+-				self.Ugia{i}=project3d(md,'vector',self.Ugia{i},'type','node','layer',1);
+-			end
+-		end % }}}
+-	end
+-end
+Index: ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(revision 26047)
+@@ -0,0 +1,259 @@
++#include "./OceantransportAnalysis.h"
++#include <math.h>
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../classes/Inputs/TransientInput.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++
++/*Model processing*/
++void OceantransportAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
++	/*No constraints*/
++}/*}}}*/
++void OceantransportAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
++	/*No loads*/
++}/*}}}*/
++void OceantransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
++	::CreateNodes(nodes,iomodel,OceantransportAnalysisEnum,P1Enum);
++}/*}}}*/
++int  OceantransportAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
++	return 1;
++}/*}}}*/
++void OceantransportAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
++
++	int  nature=0;
++	bool isdakota=0;
++
++	/*Update elements: */
++	int counter=0;
++	for(int i=0;i<iomodel->numberofelements;i++){
++		if(iomodel->my_elements[i]){
++			Element* element=(Element*)elements->GetObjectByOffset(counter);
++			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
++			counter++;
++		}
++	}
++
++	/*Plug inputs into element:*/
++	iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_at_sea_floor", OceantransportSpcbottompressureEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_above_geoid",  OceantransportSpcdslEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.dsl.global_average_thermosteric_sea_level",OceantransportSpcstrEnum);
++
++	/*Resolve mmes if we not running Dakota. Otherwise, Dakota will provide a modelid, which will be use to resolve Mme, 
++	 *but it will be done in InputUpdateFromDakota:*/
++	iomodel->FetchData(&isdakota,"md.qmu.isdakota");
++	if (inputs->GetInputObjectEnum(OceantransportSpcbottompressureEnum)==DatasetInputEnum && isdakota){
++		int modelid;
++
++		/*retrieve model id: */
++		iomodel->FetchData(&modelid,"md.dsl.modelid");
++
++		/*replace dataset of forcings with only one, the modelid'th:*/
++		MmeToInputFromIdx(inputs,elements,modelid,OceantransportSpcbottompressureEnum, P1Enum);
++		MmeToInputFromIdx(inputs,elements,modelid,OceantransportSpcdslEnum, P1Enum);
++		MmeToInputFromIdx(inputs,elements,modelid,OceantransportSpcstrEnum, P0Enum);
++	}
++
++	/*Initialize sea level cumulated sea level loads :*/
++	InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaBottomPressureEnum);
++	InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaBottomPressureEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.bottompressure",BottomPressureEnum);
++
++
++}/*}}}*/
++void OceantransportAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
++
++	int dslmodel=0;
++	int     numoutputs;
++	char**  requestedoutputs = NULL;
++
++	/*Deal with dsl multi-model ensembles: {{{*/
++	iomodel->FetchData(&dslmodel,"md.dsl.model");
++	if(dslmodel==2){
++		IssmDouble modelid; 
++		int nummodels;
++		
++		/*create double param, not int param, because Dakota will be updating it as 
++		 * a double potentially: */
++		iomodel->FetchData(&modelid,"md.dsl.modelid");
++		parameters->AddObject(new DoubleParam(DslModelidEnum,modelid));
++		parameters->AddObject(iomodel->CopyConstantObject("md.dsl.nummodels",DslNummodelsEnum));
++		iomodel->FetchData(&nummodels,"md.dsl.nummodels");
++
++		/*quick checks: */
++		if(nummodels<=0)_error_("dslmme object in  md.dsl field should contain at least 1 ensemble model!");
++		if(modelid<=0 || modelid>nummodels)_error_("modelid field in dslmme object of md.dsl field should be between 1 and the number of ensemble runs!");
++	} /*}}}*/
++	/*Requested outputs {{{*/
++	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.solidearth.requested_outputs");
++	if(numoutputs)parameters->AddObject(new StringArrayParam(SealevelchangeRequestedOutputsEnum,requestedoutputs,numoutputs));
++	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.solidearth.requested_outputs");
++	/*}}}*/
++
++}/*}}}*/
++
++/*Finite Element Analysis*/
++void           OceantransportAnalysis::Core(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
++void           OceantransportAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
++ElementVector* OceantransportAnalysis::CreateDVector(Element* element){/*{{{*/
++	/*Default, return NULL*/
++	return NULL;
++}/*}}}*/
++ElementMatrix* OceantransportAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
++_error_("Not implemented");
++}/*}}}*/
++ElementMatrix* OceantransportAnalysis::CreateKMatrix(Element* element){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++ElementVector* OceantransportAnalysis::CreatePVector(Element* element){/*{{{*/
++_error_("not implemented yet");
++}/*}}}*/
++void           OceantransportAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
++
++	/*retrieve bottom pressure, dsl and str from the spcs in our element:*/
++
++	IssmDouble bp,dsl,str;
++	int       *doflist = NULL;
++
++	/*Fetch number of nodes and initialize values*/
++	int         numnodes = element->GetNumberOfNodes();
++	int         numdof   = numnodes*3;
++	IssmDouble* values   = xNew<IssmDouble>(numdof);
++
++	/*Get dof list and inputs */
++	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
++	Input* bp_input=element->GetInput(OceantransportSpcbottompressureEnum); _assert_(bp_input);
++	Input* dsl_input=element->GetInput(OceantransportSpcdslEnum); _assert_(dsl_input);
++	Input* str_input=element->GetInput(OceantransportSpcstrEnum); _assert_(str_input);
++
++	/*Ok, we have the velocities in inputs, fill in solution */
++	Gauss* gauss=element->NewGauss();
++	for(int i=0;i<numnodes;i++){
++		gauss->GaussVertex(i);
++		bp_input->GetInputValue(&bp,gauss);
++		dsl_input->GetInputValue(&dsl,gauss);
++		str_input->GetInputValue(&str,gauss);
++		values[i*3+0]=bp;
++		values[i*3+1]=dsl;
++		values[i*3+2]=str;
++	}
++
++	/*Add value to global vector*/
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<int>(doflist);
++	xDelete<IssmDouble>(values);
++}/*}}}*/
++void           OceantransportAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
++void           OceantransportAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
++
++	int         i,domaintype;
++	int*        doflist=NULL;
++	int         isgrd=0;
++	int         frequency,count;
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = element->GetNumberOfNodes();
++	int numdof   = numnodes*3;
++
++	/*Fetch dof list and allocate solution vectors*/
++	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
++	IssmDouble* values    = xNew<IssmDouble>(numdof);
++	IssmDouble* bp        = xNew<IssmDouble>(numnodes);
++	IssmDouble* dsl        = xNew<IssmDouble>(numnodes);
++	IssmDouble* str        = xNew<IssmDouble>(numnodes);
++	IssmDouble  strmean;
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Retrieve bp,dsl and str:*/
++	strmean=0;
++	for(i=0;i<numnodes;i++){
++		bp[i]=values[i*3+0];
++		dsl[i]=values[i*3+1];
++		str[i]=values[i*3+2];
++		strmean+=str[i]/numnodes;
++
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(bp[i])) _error_("NaN found in bottom pressure solution vector");
++		if(xIsInf<IssmDouble>(bp[i])) _error_("Inf found in bottom pressure  solution vector");
++		if(xIsNan<IssmDouble>(dsl[i])) _error_("NaN found in dsl solution vector");
++		if(xIsInf<IssmDouble>(dsl[i])) _error_("Inf found in dsl solution vector");
++		if(xIsNan<IssmDouble>(str[i])) _error_("NaN found in str solution vector");
++		if(xIsInf<IssmDouble>(str[i])) _error_("Inf found in str solution vector");
++	}
++
++	/*Add bp, dsl and str as inputs to the tria element: */
++	element->AddInput(BottomPressureEnum,bp,P1Enum);
++	element->AddInput(DslEnum,dsl,P1Enum);
++	element->AddInput(StrEnum,&strmean,P0Enum); 
++
++	/*Now, we need to do some "processing"*/
++	IssmDouble* oldbp      = xNew<IssmDouble>(numnodes);
++	IssmDouble* cumdeltabp = xNew<IssmDouble>(numnodes);
++	IssmDouble* oldcumdeltabp = xNew<IssmDouble>(numnodes);
++	IssmDouble* deltabp = xNew<IssmDouble>(numnodes);
++	IssmDouble* olddsl      = xNew<IssmDouble>(numnodes);
++	IssmDouble* deltadsl      = xNew<IssmDouble>(numnodes);
++	IssmDouble  oldstr,deltastr;
++
++	/*Deal with bottom pressure first. First get previous bottom pressure:*/
++	element->GetInputListOnVertices(&oldbp[0],BottomPressureOldEnum);
++	element->FindParam(&isgrd,SolidearthSettingsGRDEnum);
++	if(isgrd)element->GetInputListOnVertices(&cumdeltabp[0],AccumulatedDeltaBottomPressureEnum);
++
++	/*What is the delta bottompressure forcing the sea-level change core: cumulated over time, hence the +=:*/
++	if(isgrd){
++		for(int i=0;i<numnodes;i++){
++			cumdeltabp[i] += bp[i]-oldbp[i];
++		}
++	}
++
++	/*Add input to the element: */
++	if(isgrd){
++		element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++		element->FindParam(&count,SealevelchangeRunCountEnum);
++		element->AddInput(AccumulatedDeltaBottomPressureEnum,cumdeltabp,P1Enum);
++		if(count==frequency){
++			element->GetInputListOnVertices(&oldcumdeltabp[0],OldAccumulatedDeltaBottomPressureEnum);
++			element->AddInput(OldAccumulatedDeltaBottomPressureEnum,cumdeltabp,P1Enum);
++			for(int i=0;i<numnodes;i++)deltabp[i]=cumdeltabp[i]-oldcumdeltabp[i];
++			element->AddInput(DeltaBottomPressureEnum,deltabp,P1Enum);
++
++		}
++	}
++
++	/*Deal with dsl and str:*/
++	element->GetInputListOnVertices(&olddsl[0],DslOldEnum);
++	element->GetInputValue(&oldstr,StrOldEnum);
++	for (int i=0;i<numnodes;i++) deltadsl[i]=dsl[i]-olddsl[i];
++	deltastr=strmean-oldstr;
++	element->AddInput(DeltaDslEnum,deltadsl,P1Enum);
++	element->AddInput(DeltaStrEnum,&deltastr,P0Enum);
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(bp);
++	xDelete<IssmDouble>(deltabp);
++	xDelete<IssmDouble>(cumdeltabp);
++	xDelete<IssmDouble>(oldcumdeltabp);
++	xDelete<IssmDouble>(oldbp);
++	xDelete<IssmDouble>(dsl);
++	xDelete<IssmDouble>(olddsl);
++	xDelete<IssmDouble>(deltadsl);
++	xDelete<IssmDouble>(values);
++	xDelete<int>(doflist);
++
++}/*}}}*/
++void           OceantransportAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
++	/*Default, do nothing*/
++	return;
++}/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26047)
+@@ -5,6 +5,7 @@
+ #include "../classes/Inputs/TransientInput.h"
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
++#include "../cores/cores.h"
+ 
+ /*Model processing*/
+ void SealevelchangeAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+@@ -21,8 +22,6 @@
+ }/*}}}*/
+ void SealevelchangeAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+-	int geodetic=0;
+-	int dslmodel=0;
+ 	int isexternal=0;
+ 
+ 	/*Update elements: */
+@@ -38,110 +37,8 @@
+ 	/*Create inputs: */
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+-	iomodel->FetchData(&geodetic,"md.solidearth.settings.computesealevelchange");
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.icethicknesschange",SurfaceloadIceThicknessRateEnum,0.);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.waterheightchange",SurfaceloadWaterHeightRateEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.surfaceload.otherchange",SurfaceloadOtherRateEnum);
+-		
+-	/*dynamic sea level: */
+-	iomodel->FetchData(&dslmodel,"md.dsl.model");
+-	if (dslmodel==1){ /*standard dsl model:{{{*/
+ 
+-		/*deal with global mean steric rate: */
+-		IssmDouble* str=NULL; 
+-		IssmDouble* times = NULL;
+-		int M,N;
+-
+-		/*fetch str vector:*/
+-		iomodel->FetchData(&str,&M,&N,"md.dsl.global_average_thermosteric_sea_level_change"); _assert_(M==2);
+-		
+-		//recover time vector: 
+-		times=xNew<IssmDouble>(N);
+-		for(int t=0;t<N;t++) times[t] = str[N+t];
+-
+-		/*create transient input: */
+-		inputs->SetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,times,N);
+-		TransientInput* transientinput = inputs->GetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
+-		
+-			
+-		for(Object* & object : elements->objects){
+-			Element* element=xDynamicCast<Element*>(object);
+-
+-			for(int t=0;t<N;t++){
+-				switch(element->ObjectEnum()){
+-					case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
+-					case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
+-					default: _error_("Not implemented yet");
+-				}
+-			}
+-		}
+-
+-		/*cleanup:*/
+-		xDelete<IssmDouble>(times);
+-		iomodel->DeleteData(str,"md.dsl.global_average_thermosteric_sea_level_change");
+-
+-		/*deal with dynamic sea level fields: */
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid", DslSeaSurfaceHeightChangeAboveGeoidEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor", DslSeaWaterPressureChangeAtSeaFloorEnum);
+-		
+-	} /*}}}*/
+-	else if (dslmodel==2){ /*multi-model ensemble dsl model:{{{*/
+-	
+-		/*variables:*/
+-		int nummodels;
+-		IssmDouble** pstr=NULL; 
+-		IssmDouble*  str=NULL;
+-		IssmDouble*  times = NULL;
+-		int* pM = NULL;
+-		int* pN = NULL;
+-		int M,N;
+-
+-		/*deal with dsl.global_average_thermosteric_sea_level_change {{{*/
+-		iomodel->FetchData(&pstr,&pM,&pN,&nummodels,"md.dsl.global_average_thermosteric_sea_level_change");
+-
+-		/*go through the mat array and create a dataset of transient inputs:*/
+-		for (int i=0;i<nummodels;i++){
+-
+-			M=pM[i];
+-			N=pN[i];
+-			str=pstr[i];
+-
+-			//recover time vector: 
+-			times=xNew<IssmDouble>(N);
+-			for(int t=0;t<N;t++) times[t] = str[(M-1)*N+t];
+-
+-			TransientInput* transientinput=inputs->SetDatasetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum,i, times,N);
+-			
+-			for(Object* & object : elements->objects){
+-				Element* element=xDynamicCast<Element*>(object);
+-
+-				for(int t=0;t<N;t++){
+-					switch(element->ObjectEnum()){
+-						case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&str[t],P0Enum); break;
+-						case PentaEnum: transientinput->AddPentaTimeInput(t,1,&element->lid,&str[t],P0Enum); break;
+-						default: _error_("Not implemented yet");
+-					}
+-				}
+-			}
+-			xDelete<IssmDouble>(times);
+-		}
+-		/*Delete data:*/
+-		for(int i=0;i<nummodels;i++){
+-			IssmDouble* str=pstr[i];
+-			xDelete<IssmDouble>(str);
+-		}
+-		xDelete<IssmDouble*>(pstr);
+-		xDelete<int>(pM);
+-		xDelete<int>(pN);
+-		/*}}}*/
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_surface_height_change_above_geoid",DslSeaSurfaceHeightChangeAboveGeoidEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.dsl.sea_water_pressure_change_at_sea_floor",DslSeaWaterPressureChangeAtSeaFloorEnum);
+-
+-	} /*}}}*/
+-	else _error_("Dsl model " << dslmodel << " not implemented yet!");
+-	
+ 	/*external solidearthsolution: solid-Earth model*/
+ 	iomodel->FetchData(&isexternal,"md.solidearth.isexternal");
+ 	if(isexternal){
+@@ -150,12 +47,27 @@
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementup",SolidearthExternalDisplacementUpRateEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.geoid",SolidearthExternalGeoidRateEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.barystaticsealevel",SolidearthExternalBarystaticSeaLevelRateEnum);
++
++		/*Resolve Mmes using the modelid, if necessary:*/
++		if (inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
++			int modelid;
++			
++			/*retrieve model id: */
++			iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
++		
++			/*replace dataset of forcings with only one, the modelid'th:*/
++			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
++			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
++			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
++			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
++			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
++		}
+ 	}
+ 
+-	/*Initialize cumdeltalthickness, bedrockeast and bedrocknorth  to 0 at time step 0:*/
++	/*Initialize solid earth motion and sea level: */
+ 	InputUpdateFromConstantx(inputs,elements,0.,BedEastEnum);
+ 	InputUpdateFromConstantx(inputs,elements,0.,BedNorthEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,SealevelchangeCumDeltathicknessEnum);
++    iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum);
+ 
+ 
+ }/*}}}*/
+@@ -168,7 +80,6 @@
+ 	IssmDouble* love_th=NULL;
+ 	IssmDouble* love_tk=NULL;
+ 	IssmDouble* love_tl=NULL;
+-	int         dslmodel=0;
+ 	int         externalnature=0;
+ 	int         isexternal=0;
+ 
+@@ -222,8 +133,10 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.ocean_area_scaling",SolidearthSettingsOceanAreaScalingEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.computesealevelchange",SolidearthSettingsComputesealevelchangeEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.compute_bp_grd",SolidearthSettingsComputeBpGrdEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.cross_section_shape",SolidearthSettingsCrossSectionShapeEnum));
+ 	parameters->AddObject(new DoubleParam(CumBslcEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcIceEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcHydroEnum,0.0));
+@@ -256,24 +169,7 @@
+ 		xDelete<IssmDouble>(partitionhydro);
+ 	}
+ 
+-	/*Deal with dsl multi-model ensembles: {{{*/
+-	iomodel->FetchData(&dslmodel,"md.dsl.model");
+-	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.compute_fingerprints",DslComputeFingerprintsEnum));
+-	if(dslmodel==2){
+-		IssmDouble modelid; 
+-		int nummodels;
+-		
+-		/*create double param, not int param, because Dakota will be updating it as 
+-		 * a double potentially: */
+-		iomodel->FetchData(&modelid,"md.dsl.modelid");
+-		parameters->AddObject(new DoubleParam(DslModelidEnum,modelid));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.dsl.nummodels",DslNummodelsEnum));
+-		iomodel->FetchData(&nummodels,"md.dsl.nummodels");
+-
+-		/*quick checks: */
+-		if(nummodels<=0)_error_("dslmme object in  md.dsl field should contain at least 1 ensemble model!");
+-		if(modelid<=0 || modelid>nummodels)_error_("modelid field in dslmme object of md.dsl field should be between 1 and the number of ensemble runs!");
+-	} /*}}}*/
++	
+ 	/*Deal with external multi-model ensembles: {{{*/
+ 	if(isexternal){
+ 		iomodel->FetchData(&externalnature,"md.solidearth.external.nature");
+@@ -507,6 +403,12 @@
+ void           SealevelchangeAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           SealevelchangeAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++
++	/*run sea level change core geometry only once, after the Model Processor is done:*/
++	sealevelchange_geometry(femmodel);
++
++}/*}}}*/
+ ElementVector* SealevelchangeAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26047)
+@@ -502,6 +502,9 @@
+ 	}
+ 
+ }/*}}}*/
++void           SmbAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* SmbAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26047)
+@@ -767,7 +767,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum,0.);
+@@ -1112,6 +1112,9 @@
+ 	}
+ 
+ }/*}}}*/
++void           StressbalanceAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* StressbalanceAnalysis::CreateDVector(Element* element){/*{{{*/
+ 
+ 	int approximation;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26047)
+@@ -1673,6 +1673,25 @@
+ 			}
+ 			xDelete<IssmDouble>(times);
+ 		}
++		else if(M==1 || M==2){
++			/*create transient input: */
++			IssmDouble* times = xNew<IssmDouble>(N);
++			if(M==1)times[0]=0;
++			if(M==2)for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
++			
++			inputs->SetTransientInput(vector_enum,times,N);
++			TransientInput* transientinput = inputs->GetTransientInput(vector_enum);
++		
++			for(int t=0;t<N;t++){
++				value=vector[t]; //values are on the first line, times are on the second line
++				switch(this->ObjectEnum()){
++					case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&(this->lid),&value,P0Enum); break;
++					case PentaEnum: transientinput->AddPentaTimeInput(t,1,&(this->lid),&value,P0Enum); break;
++					default: _error_("Not implemented yet");
++				}
++			}
++			xDelete<IssmDouble>(times);
++		}
+ 		else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
+ 	}
+ 	else if(vector_type==3){ //Double array matrix
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26047)
+@@ -18,6 +18,7 @@
+ class IoModel;
+ class Node;
+ class Material;
++class Matlitho;
+ class Tria;
+ class ElementMatrix;
+ class ElementVector;
+@@ -206,7 +207,7 @@
+ 		#endif
+ 
+ 		#ifdef _HAVE_GIA_
+-		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
++		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 		#endif
+ 		#ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26047)
+@@ -5088,12 +5088,12 @@
+ /*}}}*/
+ 
+ #ifdef _HAVE_GIA_
+-void       Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x, IssmDouble* y){/*{{{*/
++void    Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
+ 
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+ 	/*gia solution parameters:*/
+-	IssmDouble lithosphere_thickness,mantle_viscosity,ice_mask;
++	IssmDouble ice_mask;
+ 
+ 	/*output: */
+ 	IssmDouble  wi;
+@@ -5110,7 +5110,7 @@
+ 	
+ 	/*recover gia solution parameters: */
+ 	int cross_section_shape;
+-	this->parameters->FindParam(&cross_section_shape,GiaCrossSectionShapeEnum);
++	this->parameters->FindParam(&cross_section_shape,SolidearthSettingsCrossSectionShapeEnum);
+ 
+ 	/*what time is it? :*/
+ 	IssmDouble currenttime;
+@@ -5117,12 +5117,20 @@
+ 	this->parameters->FindParam(&currenttime,TimeEnum);
+ 
+ 	/*recover material parameters: */
+-	IssmDouble lithosphere_shear_modulus = FindParam(MaterialsLithosphereShearModulusEnum);
+-	IssmDouble lithosphere_density       = FindParam(MaterialsLithosphereDensityEnum);
+-	IssmDouble mantle_shear_modulus      = FindParam(MaterialsMantleShearModulusEnum);
+-	IssmDouble mantle_density            = FindParam(MaterialsMantleDensityEnum);
+ 	IssmDouble rho_ice                   = FindParam(MaterialsRhoIceEnum);
++	
++	/*recover mantle and lithosphere material properties:*/
++	int numlayers=litho->numlayers;
+ 
++	/*lithosphere is the last layer, mantle is the penultimate layer. Watch out, radius represents the layers 
++	 *from center to surface of the Earth:*/
++	IssmDouble lithosphere_thickness = litho->radius[numlayers] - litho->radius[numlayers-1];
++	IssmDouble lithosphere_shear_modulus = litho->lame_mu[numlayers-1];
++	IssmDouble lithosphere_density = litho->density[numlayers-1];
++	IssmDouble mantle_shear_modulus = litho->lame_mu[numlayers-2];
++	IssmDouble mantle_density = litho->density[numlayers-2];
++	IssmDouble mantle_viscosity = litho->viscosity[numlayers-2];
++
+ 	/*early return if we are NOT on an icy element:*/
+ 	if(!IsIceInElement()) return;
+ 
+@@ -5130,18 +5138,13 @@
+ 	IssmDouble *hes      = NULL;
+ 	IssmDouble *times    = NULL;
+ 	int         numtimes;
+-	this->GetInputAveragesUpToCurrentTime(ThicknessEnum,&hes,&times,&numtimes,currenttime);
++	this->GetInputAveragesUpToCurrentTime(TransientAccumulatedDeltaIceThicknessEnum,&hes,&times,&numtimes,currenttime);
+ 
+-	/*recover mantle viscosity: */
+-	Input* mantle_viscosity_input=this->GetInput(GiaMantleViscosityEnum);
+-	if (!mantle_viscosity_input)_error_("mantle viscosity input needed to compute gia deflection!");
+-	mantle_viscosity_input->GetInputAverage(&mantle_viscosity);
++	if(this->Id()==1){
++		_printf_("numtimes: " << numtimes << "\n");
++		for (int i=0;i<numtimes;i++)_printf_(times[i] << " " << hes[i] << "\n");
++	}
+ 
+-	/*recover lithosphere thickness: */
+-	Input* lithosphere_thickness_input=this->GetInput(GiaLithosphereThicknessEnum);
+-	if (!lithosphere_thickness_input)_error_("lithosphere thickness input needed to compute gia deflection!");
+-	lithosphere_thickness_input->GetInputAverage(&lithosphere_thickness);
+-
+ 	/*pull area of this Tria: */
+ 	IssmDouble area=this->GetArea();
+ 
+@@ -5222,7 +5225,7 @@
+ 	bool store_green_functions=false;
+ 
+ 	/*Compute ice thickness change: */
+-	Input* deltathickness_input=this->GetInput(EsaDeltathicknessEnum);
++	Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+ 	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
+ 	deltathickness_input->GetInputAverage(&I);
+ 
+@@ -5360,7 +5363,7 @@
+ 	bool store_green_functions=false;
+ 
+ 	/*Compute ice thickness change: */
+-	Input* deltathickness_input=this->GetInput(EsaDeltathicknessEnum);
++	Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+ 	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
+ 	deltathickness_input->GetInputAverage(&I);
+ 
+@@ -5513,8 +5516,6 @@
+ }
+ /*}}}*/
+ void	Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
+-
+-
+ 	/*early return if we are not on an ice cap OR ocean:*/
+ 	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){
+ 		dI_list[0] = 0.0; // this is important!!!
+@@ -5591,22 +5592,19 @@
+ 		dI_list[2] = +4*PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	}
+ 	else if(masks->isiceonly[this->lid]){
+-		IssmDouble rho_ice, dIdt, dt;
+-		
++		IssmDouble rho_ice, I;
+ 
+-		/*recover parameters: */
++		/*recover material parameters: */
+ 		rho_ice=FindParam(MaterialsRhoIceEnum);
+-		dt=FindParam(TimesteppingTimeStepEnum);
+ 
+ 		/*Compute ice thickness change: */
+-		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
+-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+-		deltathickness_input->GetInputAverage(&dIdt);
++		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
++		if (!deltathickness_input)_error_("DeltaIceThicknessEnum delta ice thickness input needed to compute sea level change!");
++		deltathickness_input->GetInputAverage(&I);
+ 
+-
+-		dI_list[0] = -4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+-		dI_list[1] = -4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+-		dI_list[2] = +4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
++		dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
++		dI_list[1] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
++		dI_list[2] = +4*PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	}
+ 
+ 	return;
+@@ -5814,12 +5812,11 @@
+ 	int gsize;
+ 	IssmDouble area;
+ 	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble Idot;  //ice thickness rate (Farrel and Clarke, Equ. 4)
++	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
+ 	bool notfullygrounded=false;
+ 	bool scaleoceanarea= false;
+ 	bool computerigid= false;
+ 	int  glfraction=1;
+-	IssmDouble dt=0;
+ 
+ 	/*output: */
+ 	IssmDouble bslcice=0;
+@@ -5864,7 +5861,6 @@
+ 	/*recover some parameters:*/
+ 	rho_ice=FindParam(MaterialsRhoIceEnum);
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-	dt=FindParam(TimesteppingTimeStepEnum);
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+@@ -5888,12 +5884,12 @@
+ 	}
+ 	else phi=1.0;
+ 
+-	/*Retrieve ice thickness at vertices: */
+-	Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
++	/*Retrieve surface load for ice: */
++	Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+ 	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+ 
+ 	/*/Average ice thickness over grounded area of the element only: {{{*/
+-	if(!notfullygrounded)deltathickness_input->GetInputAverage(&Idot);
++	if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
+ 	else{
+ 		IssmDouble total_weight=0;
+ 		bool mainlyfloating = true;
+@@ -5906,14 +5902,14 @@
+ 
+ 		/* Start  looping on the number of gaussian points and average over these gaussian points: */
+ 		total_weight=0;
+-		Idot=0;
++		I=0;
+ 		while(gauss->next()){
+-			IssmDouble Idotg=0;
+-			deltathickness_input->GetInputValue(&Idotg,gauss);
+-			Idot+=Idotg*gauss->weight;
++			IssmDouble Ig=0;
++			deltathickness_input->GetInputValue(&Ig,gauss);
++			I+=Ig*gauss->weight;
+ 			total_weight+=gauss->weight;
+ 		}
+-		Idot=Idot/total_weight;
++		I=I/total_weight;
+ 		delete gauss;
+ 	}
+ 	/*}}}*/
+@@ -5921,15 +5917,15 @@
+ 	/*Compute barystatic contribution:*/
+ 	_assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslcice = rho_ice*area*phi*Idot*dt/(oceanarea*rho_water);
++	bslcice = rho_ice*area*phi*I/(oceanarea*rho_water);
+ 	_assert_(!xIsNan<IssmDouble>(bslcice));
+ 
+ 	if(computerigid){
+ 		/*convert from m to kg/m^2:*/
+-		Idot=Idot*rho_ice*phi;
++		I=I*rho_ice*phi;
+ 
+ 		/*convolve:*/
+-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*Idot*dt;
++		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*I;
+ 	}
+ 
+ 	/*Plug bslcice into barystatic contribution vector:*/
+@@ -5947,8 +5943,7 @@
+ 	int gsize;
+ 	IssmDouble area;
+ 	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble Wdot;  //change in water height thickness (Farrel and Clarke, Equ. 4)
+-	IssmDouble dt=0;
++	IssmDouble W;  //change in water height thickness (Farrel and Clarke, Equ. 4)
+ 	bool notfullygrounded=false;
+ 	bool scaleoceanarea= false;
+ 	bool computeelastic= false;
+@@ -5981,7 +5976,6 @@
+ 	/*recover parameters: */
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+ 	rho_freshwater=FindParam(MaterialsRhoFreshwaterEnum);
+-	dt=FindParam(TimesteppingTimeStepEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 
+@@ -5992,22 +5986,22 @@
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Retrieve water height at vertices: */
+-	Input* deltathickness_input=this->GetInput(SurfaceloadWaterHeightRateEnum);
+-	if (!deltathickness_input)_error_("SurfaceloadWaterHeightRateEnum input needed to compute sea level change!");
+-	deltathickness_input->GetInputAverage(&Wdot);
++	Input* deltathickness_input=this->GetInput(DeltaTwsEnum);
++	if (!deltathickness_input)_error_("DeltaTwsEnum input needed to compute sea level change!");
++	deltathickness_input->GetInputAverage(&W);
+ 
+ 	/*Compute barystatic component:*/
+ 	_assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslchydro = rho_freshwater*area*phi*Wdot*dt/(oceanarea*rho_water);
++	bslchydro = rho_freshwater*area*phi*W/(oceanarea*rho_water);
+ 	_assert_(!xIsNan<IssmDouble>(bslchydro));
+ 
+ 	if(computeelastic){
+ 		/*convert from m to kg/m^2:*/
+-		Wdot=Wdot*rho_freshwater*phi;
++		W=W*rho_freshwater*phi;
+ 
+ 		/*convolve:*/
+-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*Wdot*dt;
++		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*W;
+ 	}
+ 
+ 	/*Plug bslcice into barystatic contribution vector:*/
+@@ -6056,8 +6050,8 @@
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Retrieve bottom pressure change and average over the element: */
+-	Input* bottompressure_change_input=this->GetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
+-	if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level change fingerprint!");
++	Input* bottompressure_change_input=this->GetInput(DeltaBottomPressureEnum);
++	if (!bottompressure_change_input)_error_("DeltaBottomPressureEnum pressure input needed to compute sea level change fingerprint!");
+ 	bottompressure_change_input->GetInputAverage(&BP);
+ 
+ 	/*convert from m to kg/m^2:*/
+@@ -6077,10 +6071,8 @@
+ 	IssmDouble constant=0;
+ 	IssmDouble rho_water;
+ 	IssmDouble* G=NULL;
+-	int  bp_compute_fingerprints= 0;
+ 
+ 	/*retrieve parameters:*/
+-	this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+ 
+ 	/*early return if we are not on the ocean:*/
+@@ -6117,7 +6109,7 @@
+ 
+ 	/*diverse:*/
+ 	int gsize;
+-	IssmDouble Idot, S, BP;		//change in relative ice thickness and sea level
++	IssmDouble I, S, BP;		//change in relative ice thickness and sea level
+ 	IssmDouble rho_ice,rho_water;
+ 	int horiz;
+ 	int  bp_compute_fingerprints= 0;
+@@ -6136,7 +6128,7 @@
+ 	/*recover parameters:*/
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-	this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
++	this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);
+ 
+ 	/*early return if elastic not requested:*/
+ 	if(!computeelastic) return;
+@@ -6162,7 +6154,7 @@
+ 		
+ 		/*If bottom pressures are available, retrieve them to load the bedrock:*/
+ 		if(bp_compute_fingerprints){
+-			Input* bottompressure_change_input=this->GetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
++			Input* bottompressure_change_input=this->GetInput(DeltaBottomPressureEnum);
+ 			if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level change fingerprint!");
+ 			bottompressure_change_input->GetInputAverage(&BP);
+ 
+@@ -6181,22 +6173,20 @@
+ 		}
+ 	}
+ 	else if (masks->isiceonly[this->lid]){
+-		IssmDouble dt=0;
+-		dt=FindParam(TimesteppingTimeStepEnum);
+ 
+ 		/*Compute ice thickness change: */
+-		Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
+-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+-		deltathickness_input->GetInputAverage(&Idot);
++		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
++		if (!deltathickness_input)_error_("DeltaIceThicknessEnum delta thickness input needed to compute sea level change!");
++		deltathickness_input->GetInputAverage(&I);
+ 
+ 		/*convert to kg/m^2*/
+-		Idot=Idot*rho_ice;
++		I=I*rho_ice;
+ 
+ 		for(int i=0;i<gsize;i++){
+-			Up[i]+=Idot*dt*GU[i];
++			Up[i]+=I*GU[i];
+ 			if(horiz){
+-				North[i]+=Idot*dt*GN[i];
+-				East[i]+=Idot*dt*GE[i];
++				North[i]+=I*GN[i];
++				East[i]+=I*GE[i];
+ 			}
+ 		}
+ 	}
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 26047)
+@@ -159,7 +159,7 @@
+ 		void ThicknessAbsGradientx( IssmDouble* pJ);
+ 		void ThicknessPositivex(IssmDouble* pJ);
+ 		#ifdef _HAVE_GIA_
+-		void Deflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y);
++		void IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y);
+ 		#endif
+ 		#ifdef _HAVE_ESA_
+ 		void EsaGeodetic2D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY, IssmDouble* xx, IssmDouble* yy);
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26047)
+@@ -655,6 +655,7 @@
+ 					if(strcmp(record_name,"md.materials.nature")==0) integer = IoCodeToEnumNature(integer);
+ 					if(strcmp(record_name,"md.timestepping.type")==0) integer = IoCodeToEnumTimestepping(integer);
+ 					if(strcmp(record_name,"md.amr.type")==0) integer = IoCodeToEnumAmr(integer);
++					if(strcmp(record_name,"md.solidearth.settings.grdmodel")==0) integer = IoCodeToEnumGrd(integer);
+ 
+ 					/*Broadcast to other cpus*/
+ 					ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+@@ -1821,10 +1822,7 @@
+ 				N=pN[i];
+ 				matrix=array[i];
+ 
+-				//recover time vector: 
+-				times=xNew<IssmDouble>(N);
+-				for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
+-
++				
+ 				//initialize transient input dataset:
+ 				TransientInput* transientinput=inputs->SetDatasetTransientInput(input_enum,i, times,N);
+ 				for(Object* & object : elements->objects){
+@@ -1847,6 +1845,11 @@
+ 
+ 					if(M==this->numberofvertices || M==(this->numberofvertices+1)){
+ 
++						//recover time vector: 
++						times=xNew<IssmDouble>(N);
++						if(M==this->numberofvertices) times[0] = matrix[M-1];
++						if(M==this->numberofvertices+1) for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
++
+ 						IssmDouble* values=xNew<IssmDouble>(numvertices);
+ 
+ 						for(int t=0;t<N;t++){
+@@ -1864,10 +1867,14 @@
+ 
+ 						IssmDouble value;
+ 
++						//recover time vector: 
++						times=xNew<IssmDouble>(N);
++						if(M==this->numberofelements) times[0] = matrix[M-1];
++						if(M==this->numberofelements+1) for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
++
+ 						for(int t=0;t<N;t++){ 
+ 
+ 							value=matrix[N*element->Sid()+t];
+-							//if(element->Sid()==188 && t==0)_printf_("value: " << value << "\n");
+ 							switch(element->ObjectEnum()){
+ 								case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&value,P0Enum); break;
+ 								case PentaEnum:  transientinput->AddPentaTimeInput( t,1,&element->lid,&value,P0Enum); break;
+@@ -1875,6 +1882,25 @@
+ 							}
+ 						}
+ 					}
++					else if(M==2 || M==1){
++						IssmDouble value;
++
++						//recover time vector: 
++						times=xNew<IssmDouble>(N);
++						if(M==1) times[0] = 0;
++						if(M==2) for(int t=0;t<N;t++) times[t] = matrix[(M-1)*N+t];
++
++						for(int t=0;t<N;t++){ 
++
++							value=matrix[t];
++							switch(element->ObjectEnum()){
++								case TriaEnum:  transientinput->AddTriaTimeInput( t,1,&element->lid,&value,P0Enum); break;
++								case PentaEnum:  transientinput->AddPentaTimeInput( t,1,&element->lid,&value,P0Enum); break;
++								default: _error_("Not implemented yet");
++							}
++						}
++
++					}
+ 					else _error_("FetchDataToInput error message: row size of MatArray elements should be either numberofelements (+1) or numberofvertices (+1)");
+ 					
+ 					xDelete<int>(vertexlids);
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26047)
+@@ -161,6 +161,9 @@
+ void           HydrologyShaktiAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           HydrologyShaktiAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* HydrologyShaktiAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26047)
+@@ -57,7 +57,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.thickness",ThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+@@ -94,6 +94,9 @@
+ void           HydrologyShreveAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           HydrologyShreveAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* HydrologyShreveAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+@@ -291,21 +294,35 @@
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+-	IssmDouble* values = xNew<IssmDouble>(numnodes);
++	IssmDouble* watercolumn = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(int i=0;i<numnodes;i++){
+-		values[i]=solution[doflist[i]];
+-		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+-		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
+-		if (values[i]<10e-10) values[i]=10e-10; //correcting the water column to positive values
++		watercolumn[i]=solution[doflist[i]];
++		if(xIsNan<IssmDouble>(watercolumn[i])) _error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(watercolumn[i])) _error_("Inf found in solution vector");
++		if (watercolumn[i]<10e-10) watercolumn[i]=10e-10; //correcting the water column to positive watercolumn
+ 	}
+ 
+ 	/*Add input to the element: */
+-	element->AddInput(WatercolumnEnum,values,element->GetElementType());
++	element->AddInput(WatercolumnEnum,watercolumn,element->GetElementType());
++	
++	/*Also update the hydrological loads for the sealevel core: */
++	IssmDouble* oldwatercolumn      = xNew<IssmDouble>(numnodes);
++	IssmDouble* deltawatercolumn = xNew<IssmDouble>(numnodes);
+ 
++	element->GetInputListOnVertices(&watercolumn[0],WatercolumnEnum);
++	element->GetInputListOnVertices(&oldwatercolumn[0],WaterColumnOldEnum);
++	element->GetInputListOnVertices(&deltawatercolumn[0],AccumulatedDeltaTwsEnum);
++	for(int i=0;i<numnodes;i++){
++		deltawatercolumn[i] += watercolumn[i]-oldwatercolumn[i];
++	}
++	element->AddInput(AccumulatedDeltaTwsEnum,deltawatercolumn,P1Enum);
++
+ 	/*Free ressources:*/
+-	xDelete<IssmDouble>(values);
++	xDelete<IssmDouble>(oldwatercolumn);
++	xDelete<IssmDouble>(deltawatercolumn);
++	xDelete<IssmDouble>(watercolumn);
+ 	xDelete<int>(doflist);
+ }/*}}}*/
+ void           HydrologyShreveAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp	(revision 26047)
+@@ -0,0 +1,158 @@
++#include "./HydrologyTwsAnalysis.h"
++#include <math.h>
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../classes/Inputs/TransientInput.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++
++/*Model processing*/
++void HydrologyTwsAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
++	/*No constraints*/
++}/*}}}*/
++void HydrologyTwsAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
++	/*No loads*/
++}/*}}}*/
++void HydrologyTwsAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
++	::CreateNodes(nodes,iomodel,HydrologyTwsAnalysisEnum,P1Enum);
++}/*}}}*/
++int  HydrologyTwsAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
++	return 1;
++}/*}}}*/
++void HydrologyTwsAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
++
++	int nature=0;
++
++	/*Update elements: */
++	int counter=0;
++	for(int i=0;i<iomodel->numberofelements;i++){
++		if(iomodel->my_elements[i]){
++			Element* element=(Element*)elements->GetObjectByOffset(counter);
++			element->Update(inputs,i,iomodel,analysis_counter,analysis_type,P1Enum);
++			counter++;
++		}
++	}
++
++	/*Plug inputs into element:*/
++	iomodel->FetchDataToInput(inputs,elements,"md.hydrology.spcwatercolum", HydrologyTwsSpcEnum);
++
++	/*Initialize sea level cumulated sea level loads :*/
++	InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaTwsEnum);
++	InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaTwsEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum);
++
++
++}/*}}}*/
++void HydrologyTwsAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
++
++}/*}}}*/
++
++/*Finite Element Analysis*/
++void           HydrologyTwsAnalysis::Core(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
++void           HydrologyTwsAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
++ElementVector* HydrologyTwsAnalysis::CreateDVector(Element* element){/*{{{*/
++	/*Default, return NULL*/
++	return NULL;
++}/*}}}*/
++ElementMatrix* HydrologyTwsAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
++_error_("Not implemented");
++}/*}}}*/
++ElementMatrix* HydrologyTwsAnalysis::CreateKMatrix(Element* element){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++ElementVector* HydrologyTwsAnalysis::CreatePVector(Element* element){/*{{{*/
++_error_("not implemented yet");
++}/*}}}*/
++void           HydrologyTwsAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
++	   _error_("not implemented yet");
++}/*}}}*/
++void           HydrologyTwsAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
++void           HydrologyTwsAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
++
++	/*Only update if on base*/
++	if(!element->IsOnBase()) return;
++
++	/*deal with logic of accumulating thickness if we are coupled to a 
++	 * sea level core:*/
++	int frequency,count,isgrd;
++	element->FindParam(&isgrd,SolidearthSettingsGRDEnum);
++	if(isgrd){
++		element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++		element->FindParam(&count,SealevelchangeRunCountEnum);
++	}	
++	/*Fetch dof list and allocate solution vector*/
++	int *doflist = NULL;
++	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
++
++	int numnodes = element->GetNumberOfNodes();
++	IssmDouble* watercolumn = xNew<IssmDouble>(numnodes);
++	
++	/*Use the dof list to index into the solution vector: */
++	for(int i=0;i<numnodes;i++){
++		watercolumn[i]=solution[doflist[i]];
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(watercolumn[i])) _error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(watercolumn[i])) _error_("Inf found in solution vector");
++	}
++	element->AddBasalInput(WatercolumnEnum,watercolumn,element->GetElementType());
++
++	xDelete<int>(doflist);
++	xDelete<IssmDouble>(watercolumn);
++
++	/*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"*/
++	watercolumn  = xNew<IssmDouble>(numvertices);
++	IssmDouble* oldwatercolumn      = xNew<IssmDouble>(numvertices);
++	IssmDouble* cumdeltawatercolumn = xNew<IssmDouble>(numvertices);
++	IssmDouble* oldcumdeltawatercolumn = xNew<IssmDouble>(numvertices);
++	IssmDouble* deltawatercolumn = xNew<IssmDouble>(numvertices);
++
++	/*Get previous base, tws, surfac and current sealevel and bed:*/
++	basalelement->GetInputListOnVertices(&watercolumn[0],WatercolumnEnum);
++	basalelement->GetInputListOnVertices(&oldwatercolumn[0],WaterColumnOldEnum);
++	basalelement->GetInputListOnVertices(&cumdeltawatercolumn[0],AccumulatedDeltaTwsEnum);
++
++	/*What is the delta tws forcing the sea-level change core: cumulated over time, hence the +=:*/
++	if(isgrd){
++		for(int i=0;i<numvertices;i++){
++			cumdeltawatercolumn[i] += watercolumn[i]-oldwatercolumn[i];
++		}
++	}
++
++	/*Add input to the element: */
++	if(isgrd){
++		element->AddBasalInput(AccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);
++		if(count==frequency){
++			basalelement->GetInputListOnVertices(&oldcumdeltawatercolumn[0],OldAccumulatedDeltaTwsEnum);
++			element->AddBasalInput(OldAccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);
++			for(int i=0;i<numvertices;i++)deltawatercolumn[i]=cumdeltawatercolumn[i]-oldcumdeltawatercolumn[i];
++			element->AddBasalInput(DeltaTwsEnum,deltawatercolumn,P1Enum);
++		}
++	}
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(watercolumn);
++	xDelete<IssmDouble>(deltawatercolumn);
++	xDelete<IssmDouble>(cumdeltawatercolumn);
++	xDelete<IssmDouble>(oldcumdeltawatercolumn);
++	xDelete<IssmDouble>(oldwatercolumn);
++	xDelete<int>(doflist);
++	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++}/*}}}*/
++void           HydrologyTwsAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
++	/*Default, do nothing*/
++	return;
++}/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26047)
+@@ -40,8 +40,8 @@
+ 	}
+ 
+ 	iomodel->FetchDataToInput(inputs,elements,"md.geometry.surface",SurfaceEnum);
+-   iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.solidearth.initialsealevel",SealevelEnum,0);
++	iomodel->FetchDataToInput(inputs,elements,"md.geometry.base",BaseEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum,0);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+@@ -55,6 +55,9 @@
+ void           L2ProjectionBaseAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           L2ProjectionBaseAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* L2ProjectionBaseAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 26047)
+@@ -73,6 +73,9 @@
+ void           L2ProjectionEPLAnalysis::Core(FemModel* femmodel){/*{{{*/
+ 	_error_("not implemented");
+ }/*}}}*/
++void           L2ProjectionEPLAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* L2ProjectionEPLAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26047)
+@@ -171,6 +171,9 @@
+ 		femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],1);
+ 	}
+ }/*}}}*/
++void           LevelsetAnalysis::PreCore(FemModel* femmodel){/*{{{*/
++	_error_("not implemented");
++}/*}}}*/
+ ElementVector* LevelsetAnalysis::CreateDVector(Element* element){/*{{{*/
+ 	/*Default, return NULL*/
+ 	return NULL;
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 26046)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 26047)
+@@ -21,6 +21,7 @@
+ 
+ 		/*Finite element Analysis*/
+ 		void           Core(FemModel* femmodel);
++		void           PreCore(FemModel* femmodel);
+ 		ElementVector* CreateDVector(Element* element);
+ 		ElementMatrix* CreateJacobianMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrix(Element* element);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26047)
+@@ -4850,13 +4850,6 @@
+ }
+ /*}}}*/
+ 
+-#ifdef _HAVE_GIA_
+-void       Penta::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){/*{{{*/
+-	_error_("GIA deflection not implemented yet!");
+-}
+-/*}}}*/
+-#endif
+-
+ #ifdef _HAVE_DAKOTA_
+ void       Penta::InputScaleFromDakota(IssmDouble* distributed_values, IssmDouble* partition, int npart, int nt, int name){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26047)
+@@ -16,6 +16,7 @@
+ class Results;
+ class Node;
+ class Material;
++class Matlitho;
+ class ElementMatrix;
+ class ElementVector;
+ class Vertex;
+@@ -168,7 +169,7 @@
+ 		void        ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 
+ #ifdef _HAVE_GIA_
+-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ #endif
+ #ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26047)
+@@ -821,10 +821,6 @@
+ 			analyses_temp[numanalyses++]=L2ProjectionBaseAnalysisEnum;
+ 			break;
+ 
+-		case GiaSolutionEnum:
+-			analyses_temp[numanalyses++]=GiaAnalysisEnum;
+-			break;
+-
+ 		case LoveSolutionEnum:
+ 			analyses_temp[numanalyses++]=LoveAnalysisEnum;
+ 			break;
+@@ -837,11 +833,6 @@
+ 			analyses_temp[numanalyses++]=SamplingAnalysisEnum;
+ 			break;
+ 
+-		case SealevelchangeSolutionEnum:
+-			analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
+-			analyses_temp[numanalyses++]=GiaAnalysisEnum;
+-			break;
+-
+ 		case SmbSolutionEnum:
+ 			analyses_temp[numanalyses++]=SmbAnalysisEnum;
+ 			break;
+@@ -852,7 +843,7 @@
+ 
+ 		case TransientSolutionEnum:{
+ 			/*We have multiple analyses here, process one by one*/
+-			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,isgia,issampling;
++			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,issampling;
+ 			iomodel->FindConstant(&isthermal,"md.transient.isthermal");
+ 			iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
+ 			iomodel->FindConstant(&ismasstransport,"md.transient.ismasstransport");
+@@ -863,7 +854,6 @@
+ 			iomodel->FindConstant(&issmb,"md.transient.issmb");
+ 			iomodel->FindConstant(&isslc,"md.transient.isslc");
+ 			iomodel->FindConstant(&isesa,"md.transient.isesa");
+-			iomodel->FindConstant(&isgia,"md.transient.isgia");
+ 			iomodel->FindConstant(&issampling,"md.transient.issampling");
+       int* analyses_iter     = NULL;
+       int  num_analyses_iter = 0;
+@@ -903,15 +893,11 @@
+ 				analyses_temp[numanalyses++]=DamageEvolutionAnalysisEnum;
+ 			}
+ 			if(isslc){
+-				analyses_temp[numanalyses++]=GiaAnalysisEnum;
+ 				analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
+ 			}
+ 			if(isesa){
+ 				analyses_temp[numanalyses++]=EsaAnalysisEnum;
+ 			}
+-			if(isgia){
+-				analyses_temp[numanalyses++]=GiaAnalysisEnum;
+-			}
+ 			if(issampling){
+ 				analyses_temp[numanalyses++]=SamplingAnalysisEnum;
+ 			}
+@@ -2122,58 +2108,8 @@
+ }/*}}}*/
+ void FemModel::MmeToInputFromId(int id, int rootenum, int interpolationenum){ /*{{{*/
+ 
+-	TransientInput* transientinput  = NULL;
+-	TransientInput* transientinput2 = NULL;
+-	Tria* element                    = NULL;
+-	IssmDouble value;
+-	IssmDouble* values               = NULL;
+-	IssmDouble* times                = NULL;
+-	int N;
++	MmeToInputFromIdx(this->inputs,this->elements,id,rootenum,interpolationenum);
+ 
+-	/*find thickness dataset: */
+-	DatasetInput* datasetinput = this->inputs->GetDatasetInput(rootenum);
+-
+-	/*Initialize new transient input: */
+-	transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);
+-	transientinput->GetAllTimes(&times,&N);
+-	this->inputs->SetTransientInput(DummyEnum,times,N);
+-	transientinput2 = this->inputs->GetTransientInput(DummyEnum);
+-
+-	for(Object* & object : this->elements->objects){
+-		Tria*   element=xDynamicCast<Tria*>(object);
+-
+-		/*recover the right field from the mme: */
+-		transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);
+-
+-		/*copy values from the transientinput to the final transientinput2: */
+-		for (int j=0;j<N;j++){
+-			TriaInput* tria_input=transientinput->GetTriaInput(j);
+-			element->InputServe(tria_input);
+-			if(interpolationenum==P0Enum){
+-				value=tria_input->element_values[0];
+-				transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);
+-			}
+-			else if(interpolationenum==P1Enum){
+-
+-				/*Get values and lid list*/
+-				const int   numvertices     = element->GetNumberOfVertices();
+-				int        *vertexlids      = xNew<int>(numvertices);
+-				int        *vertexsids      = xNew<int>(numvertices);
+-
+-				/*Recover vertices ids needed to initialize inputs*/
+-				element->GetVerticesLidList(&vertexlids[0]);
+-				element->GetVerticesSidList(&vertexsids[0]);
+-				values=tria_input->element_values;
+-				transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);
+-			}
+-		}
+-	}
+-
+-	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
+-	this->inputs->ChangeEnum(DummyEnum,rootenum);
+-
+-	//reconfigure:
+-	transientinput2->Configure(this->parameters);
+ }	//}}}
+ void FemModel::OmegaAbsGradientx( IssmDouble* pJ){/*{{{*/
+ 
+@@ -4731,12 +4667,24 @@
+ /*}}}*/
+ #endif
+ #ifdef _HAVE_GIA_
+-void FemModel::Deflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y){ /*{{{*/
++void FemModel::IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y){ /*{{{*/
+ 
++	/*Find the litho material to be used by all the elements:*/
++	Matlitho* matlitho=NULL;
++	for (Object* & object: this->materials->objects){
++		Material* material=xDynamicCast<Material*>(object);
++		if(material->ObjectEnum()==MatlithoEnum){
++			matlitho=xDynamicCast<Matlitho*>(material);
++			break;
++		}
++	}
++	_assert_(matlitho);
++
++
+ 	/*Go through elements, and add contribution from each element to the deflection vector wg:*/
+ 	for(Object* & object : this->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->GiaDeflection(wg,dwgdt, x,y);
++		element->GiaDeflection(wg,dwgdt, matlitho, x,y);
+ 	}
+ }
+ /*}}}*/
+@@ -4841,6 +4789,7 @@
+ 	IssmDouble* bslchydro_partition_serial=NULL;
+ 	IssmDouble* partitionhydro=NULL;
+ 	int nparthydro;
++	int istws=0;
+ 
+ 
+    /*Initialize temporary vector that will be used to sum barystatic components
+@@ -4884,14 +4833,17 @@
+ 	}
+ 
+ 	/*Call the barystatic sea level change core for hydro: */
+-	bslchydro_cpu=0;
+-	for(int i=0;i<elements->Size();i++){
+-		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-		bslchydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslchydro_partition,partitionhydro,oceanarea);
++	bslchydro_cpu=0; //make sure to initialize this, so we have a total barystatic contribution computed at 0.
++	this->parameters->FindParam(&istws,TransientIshydrologyEnum);
++	if(istws){
++		for(int i=0;i<elements->Size();i++){
++			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
++			bslchydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslchydro_partition,partitionhydro,oceanarea);
++		}
+ 	}
+ 
+ 	/*Call the barystatic sea level change core for bottom pressures: */
+-	this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
++	this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);
+ 	if(bp_compute_fingerprints){
+ 		for(int i=0;i<elements->Size();i++){
+ 			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26046)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26047)
+@@ -45,6 +45,7 @@
+ 		Inputs* Copy(void);
+ 		int      DeleteInput(int enum_type);
+ 		void     DuplicateInput(int original_enum,int new_enum);
++		void     AXPY(IssmDouble alpha, int xenum, int yenum, int zenum);
+ 		void     DeepEcho(void);
+ 		void     Echo(void);
+ 		bool     Exist(int enum_type);
+Index: ../trunk-jpl/src/m/plot/radarpower.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/radarpower.m	(revision 26046)
++++ ../trunk-jpl/src/m/plot/radarpower.m	(revision 26047)
+@@ -45,7 +45,7 @@
+ 		if highres,
+ 			paths = {'/u/astrid-r1b/ModelData/MOG/mog100_r2_hp1.tif','/home/ModelData/Greenland/MOG/mog100_r2_hp1.tif'};
+ 		else
+-			paths = {'/u/astrid-r1b/ModelData/MOG/mog500_r2_hp1.tif','/home/ModelData/Greenland/MOG/mog500_r2_hp1.tif'};
++			paths = {'/u/astrid-r1b/ModelData/MOG/mog500_r2_hp1.tif','/home/ModelData/Greenland/MOG/mog500_r2_hp1.tif','/Users/larour/ModelData/MOG/mog500_r2_hp1.tif'};
+ 		end
+ 	else
+ 		error('Need to provide geotiff for areas outside of Greenland and Antarctica');
+Index: ../trunk-jpl/src/c/cores/esa_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 26047)
+@@ -40,7 +40,7 @@
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 	femmodel->parameters->FindParam(&isesa,TransientIsesaEnum);
+-	femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
++	femmodel->parameters->FindParam(&iscoupler,IsSlcCouplingEnum);
+ 
+ 	/* recover coordinates of vertices: */
+ 	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26047)
+@@ -21,67 +21,34 @@
+ 
+ 	/*Parameters, variables:*/
+ 	bool save_results;
+-	bool isslc=0;
+-	bool isgia=0;
+-	int  grd=0;
+-	int  isexternal=0;
+-	bool iscoupler=0;
+-	int solution_type;
+ 
+ 	/*Retrieve parameters:*/
+-	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+-	femmodel->parameters->FindParam(&isexternal,SolidearthIsExternalEnum); 
+-	femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
+-
+-	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
+-	if(solution_type==SealevelchangeSolutionEnum){
+-		isslc=1;
+-		isgia=1;
+-	}
+-
+-	/*Should we be here?:*/
+-	if(!isslc)return;
+-
++	
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("   computing sea level change\n");
+ 
+-	/*Run gia core: */
+-	if(isgia){
+-		#ifdef _HAVE_GIA_
+-		gia_core(femmodel);
+-		#else
+-		_error_("ISSM was not compiled with gia capabilities. Exiting");
+-		#endif
+-	}
+-
+ 	/*set SLR configuration: */
+ 	femmodel->SetCurrentConfiguration(SealevelchangeAnalysisEnum);
+ 
+ 	/*run geometry core: */
+ 	sealevelchange_geometry(femmodel);
+-
++	
+ 	/*any external forcings?:*/
+-	if(isexternal)solidearthexternal_core(femmodel);
++	solidearthexternal_core(femmodel);
+ 
++	/*Run coupler input transfer:*/
++	couplerinput_core(femmodel);
++
+ 	/*Run geodetic:*/
+-	//if(modelid==earthid)  //not sure how we proceed yet on coupling.
+-	if(grd)grd_core(femmodel);
++	grd_core(femmodel);
+ 
+ 	/*Run steric core for sure:*/
+ 	dynstr_core(femmodel);
+ 
+-	if(iscoupler){
+-		/*transfer sea level back to ice caps:*/
+-		TransferSealevel(femmodel,SealevelEnum);
+-		TransferSealevel(femmodel,BedEnum);
++	/*Run coupler output transfer: */
++	coupleroutput_core(femmodel);
+ 
+-		//reset cumdeltathickness  to 0: 
+-		InputUpdateFromConstantx(femmodel->inputs,femmodel->elements,0.,SealevelchangeCumDeltathicknessEnum);
+-	}
+-
+ 	/*Save results: */
+ 	if(save_results){
+ 		int     numoutputs;
+@@ -92,13 +59,11 @@
+ 		if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
+ 	}
+ 
+-	/*requested dependents: */
+-	if(solution_type==SealevelchangeSolutionEnum)femmodel->RequestedDependentsx();
+-	
+ 	/*End profiler*/
+ 	femmodel->profiler->Stop(SLRCORE);
+ }
+ /*}}}*/
++
+ void solidearthexternal_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*variables:*/
+@@ -112,24 +77,19 @@
+ 	Vector<IssmDouble> *geoid_rate= NULL; 
+ 	int horiz=0;
+ 	int modelid=-1;
+-   
++	int  isexternal=0;
++ 
+ 	/*parameters: */
+-	bool isslc=0;
+-	int  solution_type;
+ 	IssmDouble          dt;
+ 
+ 	/*Retrieve parameters:*/
+-	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++	femmodel->parameters->FindParam(&isexternal,SolidearthIsExternalEnum); 
++	
++	/*Early return:*/
++	if (!isexternal)return;
+ 
+-	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
+-	if(solution_type==SealevelchangeSolutionEnum)isslc=1;
+-
+-	/*Should we be here?:*/
+-	if(!isslc)return;
+-
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing external solid earth contributions\n");
+ 
+@@ -140,17 +100,6 @@
+ 		GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
+ 		GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
+ 	}
+-	/*Deal with Mme: */
+-	if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
+-		/*retrieve model id: */
+-		femmodel->parameters->FindParam(&modelid,SolidearthExternalModelidEnum);
+-		/*replace dataset of forcings with only one, the modelid'th:*/
+-		femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
+-		femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+-		femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
+-		femmodel->MmeToInputFromId(modelid,SolidearthExternalGeoidRateEnum, P1Enum);
+-		femmodel->MmeToInputFromId(modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
+-	}
+ 	
+ 	GetVectorFromInputsx(&geoid_rate,femmodel,SolidearthExternalGeoidRateEnum,VertexSIdEnum);
+ 	GetVectorFromInputsx(&bedrock_rate,femmodel,SolidearthExternalDisplacementUpRateEnum,VertexSIdEnum);
+@@ -184,6 +133,69 @@
+ 	}
+ }
+ /*}}}*/
++void couplerinput_core(FemModel* femmodel){  /*{{{*/
++
++	/*Be very careful here, everything is well thought through, do not remove 
++	 * without taking big risks:*/
++	
++	/*parameters:*/
++	int  iscoupling;
++	int  modelid,earthid;
++	int  count,frequency;
++	int  horiz;
++
++	/*retrieve more parameters:*/
++	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
++	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
++
++	if(iscoupling){
++		femmodel->parameters->FindParam(&modelid,ModelIdEnum);
++		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
++	}
++	else{
++		/* we are here, we are not running in a coupler, so we will indeed compute SLR,
++		 * so make sure we are identified as being the Earth.:*/
++		modelid=1; earthid=1; 
++	}
++
++	/*if we are carrying loads but are not yet computing grd core, accumulate them and skip 
++	 * the rest: */
++	if (count<frequency){
++		count++; 
++		femmodel->parameters->SetParam(count,SealevelchangeRunCountEnum); 
++		return;
++	}
++
++	/*Basins are supposed to accumulate loads and hand them over to the Earth
++	  for slr computations every "frequency" time steps. If we are here, we
++	  have reached the "frequency"'th time step, and we are going to pick up
++	  the old loads, the current loads, and send them to the Earth for slr
++	  computations.  So the Earth is never supposed to compute loads. Except,
++	  when we are running the Earth as a giant basin (ex: running a
++	  Peltier-style GIA model, or running a "Snow Ball" Earth) which only
++	  happens when we are not coupled, at which point we are sending these
++	  loads to ourselves (hence the convoluted condition).
++	  */
++
++	/*transer loads from basins to Earth for grd core computations. :*/
++	if(iscoupling){
++	
++		/*transfer ice thickness change load from basins to earth: */
++		TransferForcing(femmodel,DeltaIceThicknessEnum);
++		TransferForcing(femmodel,DeltaBottomPressureEnum);
++		TransferForcing(femmodel,DeltaTwsEnum);
++
++		/*transfer external forcings back to Earth:*/
++		TransferSealevel(femmodel,BedEnum);
++		TransferSealevel(femmodel,SealevelEnum);
++		if(horiz){
++			TransferSealevel(femmodel,BedEastEnum);
++			TransferSealevel(femmodel,BedNorthEnum);
++		}
++	}
++	
++}; /*}}}*/
+ void grd_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*Gravity rotation deformation core GRD: */
+@@ -202,105 +214,68 @@
+ 	SealevelMasks* masks=NULL;
+ 
+ 	/*parameters:*/
+-	bool iscoupler;
+-	int  solution_type;
+ 	int  modelid,earthid;
+-	bool istransientmasstransport;
+-	int  frequency,count;
+ 	int  horiz;
+-	IssmDouble dt;
+ 	IssmDouble oceanarea;
+-	int bp_compute_fingerprints=0;
++	int  count,frequency,iscoupling;
++	int  grd=0;
+ 
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing GRD sea level patterns\n");
+-
+-	/*retrieve more parameters:*/
+-	femmodel->parameters->FindParam(&iscoupler,TransientIscouplerEnum);
++	
++	/*retrieve parameters:*/
++	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+-	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 
+-	if(iscoupler){
++	/*only run if grd was requested, if we are the earth, and we have reached
++	 * the necessary number of time steps dictated by :*/
++	if(!grd)            return;
++	if(count!=frequency)return;
++	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
++	if(iscoupling){
+ 		femmodel->parameters->FindParam(&modelid,ModelIdEnum);
+ 		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
+-		femmodel->parameters->FindParam(&istransientmasstransport,TransientIsmasstransportEnum);
++		if(modelid!=earthid)return;
+ 	}
+-	else{
+-		/* we are here, we are not running in a coupler, so we will indeed compute SLR,
+-		 * so make sure we are identified as being the Earth.:*/
+-		modelid=1; earthid=1; 
+-		/* in addition, if we are running solution_type SealevelchangeSolutionEnum, make sure we 
+-		 * run, irresepective of the time settings:*/
+-		count=frequency;
+-	}
+ 
+-	/*If we are running in coupled mode, the Earth model needs to run its own mass transport (if 
+-	 * not already done by the mass trasnport module. For ice caps, they rely on the transient mass 
+-	 * transport module exclusively:*/
+-	if(iscoupler) if(modelid==earthid) if(!istransientmasstransport) EarthMassTransport(femmodel);
++	/*call masks core: */
++	masks=sealevel_masks(femmodel);
+ 
+-	/*increment counter, or call solution core if count==frequency:*/
+-	if (count<frequency){
+-		count++; femmodel->parameters->SetParam(count,SealevelchangeRunCountEnum); 
+-		return;
+-	}
++	/*call barystatic core  (generalized eustatic - Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS) */
++	RSLg_barystatic=sealevelchange_core_barystatic(femmodel,masks,&oceanarea); 
+ 
+-	/*call sea-level change sub cores:*/
+-	if(iscoupler){
+-		/*transfer cumulated deltathickness forcing from ice caps to earth model: */
+-		TransferForcing(femmodel,SealevelchangeCumDeltathicknessEnum);
++	/*call self attraction and loading module (ocean loading tems  - 2nd and 5th terms on the RHS of Farrel and Clark) */
++	RSLg=sealevelchange_core_sal(femmodel,masks,RSLg_barystatic,oceanarea); 
+ 
+-		/*we have accumulated thicknesses, dump them in deltathcikness: */
+-		if(modelid==earthid)InputDuplicatex(femmodel,SealevelchangeCumDeltathicknessEnum,SurfaceloadIceThicknessRateEnum);
++	/*compute bedrock motion and derive geoid: */
++	sealevelchange_core_deformation(&N_grd,&U_grd,&U_north_grd,&U_east_grd,femmodel,RSLg,masks);
++
++	/*Update bedrock motion and geoid:*/
++	GetVectorFromInputsx(&geoid,femmodel,SealevelEnum,VertexSIdEnum);
++	GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
++	if(horiz){
++		GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
++		GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
+ 	}
+ 
+-	/*run cores:*/
+-	if(modelid==earthid){
++	geoid->AXPY(N_grd,1);
++	bedrock->AXPY(U_grd,1);
++	if(horiz){
++		bedrockeast->AXPY(U_east_grd,1);
++		bedrocknorth->AXPY(U_north_grd,1);
++	}
+ 
+-		/*call masks core: */
+-		masks=sealevel_masks(femmodel);
++	/*get some of the updates into elements:*/
++	InputUpdateFromVectorx(femmodel,U_grd,SealevelUGrdEnum,VertexSIdEnum); 
++	InputUpdateFromVectorx(femmodel,N_grd,SealevelNGrdEnum,VertexSIdEnum); 
++	if(RSLg)InputUpdateFromVectorx(femmodel,RSLg,SealevelRSLEnum,VertexSIdEnum); 
++	if(RSLg_barystatic)InputUpdateFromVectorx(femmodel,RSLg_barystatic,SealevelRSLBarystaticEnum,VertexSIdEnum); 
++	if (horiz){
++		InputUpdateFromVectorx(femmodel,U_north_grd,SealevelUNorthEsaEnum,VertexSIdEnum);	
++		InputUpdateFromVectorx(femmodel,U_east_grd,SealevelUEastEsaEnum,VertexSIdEnum);	
++	} 
+ 
+-		/*set bottom pressures:*/
+-		SetBottomPressure(femmodel);
+-
+-		/*call barystatic core  (generalized eustatic - Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS) */
+-		RSLg_barystatic=sealevelchange_core_barystatic(femmodel,masks,&oceanarea); 
+-
+-		/*call self attraction and loading module (ocean loading tems  - 2nd and 5th terms on the RHS of Farrel and Clark) */
+-		RSLg=sealevelchange_core_sal(femmodel,masks,RSLg_barystatic,oceanarea); 
+-
+-		/*compute bedrock motion and derive geoid: */
+-		sealevelchange_core_deformation(&N_grd,&U_grd,&U_north_grd,&U_east_grd,femmodel,RSLg,masks);
+-
+-		/*Update bedrock motion and geoid:*/
+-		GetVectorFromInputsx(&geoid,femmodel,SealevelEnum,VertexSIdEnum);
+-		GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
+-		if(horiz){
+-			GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
+-			GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
+-		}
+-		
+-		geoid->AXPY(N_grd,1);
+-		bedrock->AXPY(U_grd,1);
+-		if(horiz){
+-			bedrockeast->AXPY(U_east_grd,1);
+-			bedrocknorth->AXPY(U_north_grd,1);
+-		}
+-
+-		/*get some of the updates into elements:*/
+-		InputUpdateFromVectorx(femmodel,U_grd,SealevelUEsaEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,N_grd,SealevelNEsaEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,RSLg,SealevelRSLEnum,VertexSIdEnum); 
+-		InputUpdateFromVectorx(femmodel,RSLg_barystatic,SealevelRSLBarystaticEnum,VertexSIdEnum); 
+-		if (horiz){
+-			InputUpdateFromVectorx(femmodel,U_north_grd,SealevelUNorthEsaEnum,VertexSIdEnum);	
+-			InputUpdateFromVectorx(femmodel,U_east_grd,SealevelUEastEsaEnum,VertexSIdEnum);	
+-		} 
+-	}
+-
+ 	/*reset counter to 1:*/
+ 	femmodel->parameters->SetParam(1,SealevelchangeRunCountEnum); //reset counter.
+ 
+@@ -326,14 +301,12 @@
+ 
+ 	/*variables:*/
+ 	Vector<IssmDouble> *sealevel  = NULL; 
+-	Vector<IssmDouble> *steric_rate_g  = NULL; 
+-	Vector<IssmDouble> *dynamic_rate_g = NULL;
++	Vector<IssmDouble> *deltadsl  = NULL; 
++	Vector<IssmDouble> *deltastr = NULL;
+ 
+ 	/*parameters: */
+-	bool isslc=0;
+-	int  solution_type;
+-	IssmDouble          dt;
+ 	int  step;
++	int computesealevel=0;
+ 	IssmDouble time;
+ 
+ 	IssmDouble cumgmtslc=0;
+@@ -341,34 +314,27 @@
+ 	IssmDouble cumgmslc=0;
+ 	IssmDouble gmtslc=0;
+ 
+-	/*Retrieve parameters:*/
+-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+-	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
++	/*early return if we are not computing sea level, but rather deformation: */
++	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
++	if (!computesealevel)return;
+ 	
+-	/*in case we are running SealevelchangeSolutionEnum, then bypass transient settings:*/
+-	if(solution_type==SealevelchangeSolutionEnum)isslc=1;
+-
+-	/*Should we be here?:*/
+-	if(!isslc)return;
+-
+ 	/*Verbose: */
+-	if(VerboseSolution()) _printf0_("	  computing steric sea level change\n");
++	if(VerboseSolution()) _printf0_("	  computing steric and dynamic sea level change\n");
+ 
+ 	/*Retrieve sealevel and add steric + dynamic rates:*/
+ 	GetVectorFromInputsx(&sealevel,femmodel,SealevelEnum,VertexSIdEnum);
+-	GetStericRate(&steric_rate_g,femmodel);
+-	GetDynamicRate(&dynamic_rate_g,femmodel);
++	GetVectorFromInputsx(&deltadsl,femmodel,DeltaDslEnum,VertexSIdEnum);
++	GetVectorFromInputsx(&deltastr,femmodel,DeltaStrEnum,VertexSIdEnum);
+ 
+-	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate + dynamic_rate dt*/
+-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	sealevel->AXPY(steric_rate_g,dt);
+-	sealevel->AXPY(dynamic_rate_g,dt);
++	/*compute: sea level change = initial sea level + steric + dynamic*/
++	sealevel->AXPY(deltadsl,1);
++	sealevel->AXPY(deltastr,1);
+ 
+ 	/*cumulate thermal steric rate:*/
+ 	femmodel->parameters->FindParam(&cumgmtslc,CumGmtslcEnum); 
+ 	femmodel->parameters->FindParam(&cumbslc,CumBslcEnum); 
+ 
+-	gmtslc=steric_rate_g->Max()*dt;
++	gmtslc=deltastr->Norm(NORM_TWO);
+ 	cumgmtslc+=gmtslc;
+ 	cumgmslc=cumbslc+cumgmtslc;
+ 
+@@ -388,11 +354,31 @@
+ 
+ 	/*Free ressources:*/	
+ 	delete sealevel;
+-	delete steric_rate_g;
+-	delete dynamic_rate_g;
++	delete deltadsl;
++	delete deltastr;
+ }
+ /*}}}*/
++void coupleroutput_core(FemModel* femmodel){  /*{{{*/
++	
++	/*parameters:*/
++	int iscoupling;
++	int horiz=0;
+ 
++	/*retrieve more parameters:*/
++	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
++	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++		
++	if(iscoupling){
++		/*transfer sea level back to ice caps:*/
++		TransferSealevel(femmodel,SealevelEnum);
++		TransferSealevel(femmodel,BedEnum);
++		if(horiz){
++			TransferSealevel(femmodel,BedNorthEnum);
++			TransferSealevel(femmodel,BedEastEnum);
++		}
++	}
++}; /*}}}*/
++
+ //Geometry:
+ SealevelMasks* sealevel_masks(FemModel* femmodel) {  /*{{{*/
+ 
+@@ -491,6 +477,11 @@
+ 	int npartice;
+ 	IssmDouble* cumbslchydro_partition=NULL;
+ 	int nparthydro;
++	int computesealevel=0;
++
++	/*early return if we are not computing sea level, but rather deformation: */
++	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
++	if (!computesealevel)return NULL;
+ 	
+ 	if(VerboseSolution()) _printf0_("	  computing bslc components on ice\n");
+ 
+@@ -580,6 +571,11 @@
+ 	IssmDouble           eps_rel;
+ 	IssmDouble           eps_abs;
+ 	IssmDouble			Ixz, Iyz, Izz; 
++	int computesealevel=0;
++
++	/*early return if we are not computing sea level, but rather deformation: */
++	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
++	if (!computesealevel)return NULL;
+ 	
+ 	if(VerboseSolution()) _printf0_("	  converging on ocean components\n");
+ 
+@@ -676,6 +672,7 @@
+ void sealevelchange_core_deformation(Vector<IssmDouble>** pN_grd, Vector<IssmDouble>** pU_grd, Vector<IssmDouble>** pU_north_grd,Vector<IssmDouble>** pU_east_grd,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks){ /*{{{*/
+ 
+ 	Vector<IssmDouble> *U_grd  = NULL; 
++	Vector<IssmDouble> *dUdt_grd  = NULL; 
+ 	Vector<IssmDouble> *N_grd  = NULL; 
+ 	Vector<IssmDouble> *U_north_grd   = NULL; 
+ 	Vector<IssmDouble> *U_east_grd    = NULL; 
+@@ -691,11 +688,13 @@
+ 	IssmDouble          *yy     = NULL;
+ 	IssmDouble          *zz     = NULL;
+ 	int  horiz;
++	int  grdmodel; 
+ 	
+ 	if(VerboseSolution()) _printf0_("	  computing vertical and horizontal geodetic signatures\n");
+ 
+ 	/*retrieve some parameters:*/
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 
+ 	/*find size of vectors:*/
+ 	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
+@@ -702,6 +701,7 @@
+ 
+ 	/*intialize vectors:*/
+ 	U_grd = new Vector<IssmDouble>(gsize);
++	if(grdmodel==IvinsEnum) dUdt_grd = new Vector<IssmDouble>(gsize);
+ 	N_grd = new Vector<IssmDouble>(gsize);
+ 	if (horiz){
+ 		U_north_grd = new Vector<IssmDouble>(gsize);
+@@ -712,8 +712,20 @@
+ 	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
+ 	VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
+ 
+-	/*call the elastic main modlule:*/ 
+-	femmodel->SealevelchangeDeformation(N_grd, U_grd,U_north_grd,U_east_grd,RSLg, masks);
++	/*call the deformation module: */
++	switch(grdmodel){
++		case NoneEnum: 
++			//do nothing: 
++			break;
++		case IvinsEnum:
++			femmodel->IvinsDeformation(U_grd,dUdt_grd,xx,yy);
++			break;
++		case ElasticEnum:
++			femmodel->SealevelchangeDeformation(N_grd, U_grd,U_north_grd,U_east_grd,RSLg, masks);
++			break;
++		default:
++			_error_("Grd model " << EnumToStringx(grdmodel) << " not supported yet");
++	}
+ 
+ 	/*Assign output pointers:*/
+ 	*pU_grd=U_grd;
+@@ -730,130 +742,10 @@
+ 	xDelete<IssmDouble>(yy);
+ 	xDelete<IssmDouble>(zz);
+ 	xDelete<IssmDouble>(radius);
++	if(grdmodel==IvinsEnum)delete dUdt_grd;
+ }
+ /*}}}*/
+ 
+-//Ocean:
+-void GetDynamicRate(Vector<IssmDouble> ** pdynamic_rate_g, FemModel* femmodel){ /*{{{*/
+-
+-	int dslmodel=-1;
+-	IssmDouble time;
+-
+-	/*variables:*/
+-	Vector<IssmDouble> *dynamic_rate_g  = NULL; 
+-
+-	/*Update steric rates before retrieving them on Vertex SID set:*/
+-	femmodel->parameters->FindParam(&dslmodel,DslModelEnum);
+-	femmodel->parameters->FindParam(&time,TimeEnum);
+-	if(dslmodel==1){
+-		TransientInput* transient_input  = femmodel->inputs->GetTransientInput(DslSeaSurfaceHeightChangeAboveGeoidEnum);
+-		TriaInput* tria_input=transient_input->GetTriaInput(time);
+-		Input* tria_input_copy=tria_input->copy();
+-		tria_input_copy->ChangeEnum(DslDynamicRateEnum);
+-		femmodel->inputs->AddInput(tria_input_copy);
+-	}
+-	else if(dslmodel==2){
+-	
+-		IssmDouble modelid;
+-		
+-		/*Recover modelid:*/
+-		femmodel->parameters->FindParam(&modelid,DslModelidEnum);
+-		modelid--; //from matlab. 
+-		
+-		/*find the DslSeaSurfaceHeightChangeAboveGeoidEnum dataset of transient inputs:*/
+-		DatasetInput* dataset_input=femmodel->inputs->GetDatasetInput(DslSeaSurfaceHeightChangeAboveGeoidEnum);
+-		
+-		/*Go find the modelid'th transient input:*/
+-		TriaInput* tria_input=dataset_input->GetTriaInputByOffset(reCast<int, IssmDouble>(modelid));
+-		
+-		/*Plug into DslDynamicRate input: */
+-		Input* tria_input_copy=tria_input->copy();
+-		tria_input_copy->ChangeEnum(DslDynamicRateEnum);
+-		femmodel->inputs->AddInput(tria_input_copy);
+-	}
+-	else _error_("not implemented yet");
+-
+-	GetVectorFromInputsx(&dynamic_rate_g,femmodel,DslDynamicRateEnum,VertexSIdEnum);
+-	*pdynamic_rate_g=dynamic_rate_g;
+-}
+-/*}}}*/
+-void GetStericRate(Vector<IssmDouble> ** psteric_rate_g, FemModel* femmodel){ /*{{{*/
+-
+-	int dslmodel=-1;
+-	IssmDouble time;
+-
+-	/*variables:*/
+-	Vector<IssmDouble> *steric_rate_g  = NULL; 
+-
+-	/*Update steric rates before retrieving them on Vertex SID set:*/
+-	femmodel->parameters->FindParam(&dslmodel,DslModelEnum);
+-	femmodel->parameters->FindParam(&time,TimeEnum);
+-	if(dslmodel==1){
+-		TransientInput* transient_input  = femmodel->inputs->GetTransientInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
+-		TriaInput* tria_input=transient_input->GetTriaInput(time);
+-		Input* tria_input_copy=tria_input->copy();
+-		tria_input_copy->ChangeEnum(DslStericRateEnum);
+-		femmodel->inputs->AddInput(tria_input_copy);
+-	}
+-	else if (dslmodel==2){
+-		IssmDouble modelid;
+-		
+-		/*Recover modelid:*/
+-		femmodel->parameters->FindParam(&modelid,DslModelidEnum);
+-		
+-		modelid--; //from matlab. 
+-		
+-		/*find the DslGlobalAverageThermostericSeaLevelChangeEnum dataset of transient inputs:*/
+-		DatasetInput* dataset_input=femmodel->inputs->GetDatasetInput(DslGlobalAverageThermostericSeaLevelChangeEnum);
+-		
+-		/*Go find the modelid'th transient input:*/
+-		TriaInput* tria_input=dataset_input->GetTriaInputByOffset(reCast<int, IssmDouble>(modelid));
+-		
+-		/*Plug into DslStericRate input: */
+-		Input* tria_input_copy=tria_input->copy();
+-		tria_input_copy->ChangeEnum(DslStericRateEnum);
+-		femmodel->inputs->AddInput(tria_input_copy);
+-	}
+-	else _error_("not implemented yet");
+-
+-	GetVectorFromInputsx(&steric_rate_g,femmodel,DslStericRateEnum,VertexSIdEnum);
+-	*psteric_rate_g=steric_rate_g;
+-}
+-/*}}}*/
+-void SetBottomPressure(FemModel* femmodel){ /*{{{*/
+-
+-	int dslmodel=-1;
+-	int type;
+-
+-	/*If we are running a dsl mme model, we need to update the bottom pressure first: */
+-	femmodel->parameters->FindParam(&dslmodel,DslModelEnum);
+-	if(dslmodel==2){
+-	
+-		IssmDouble modelid;
+-		/*figure out the type of DslSeaWaterPressureChangeAtSeaFloor input:*/
+-		type=femmodel->inputs->GetInputObjectEnum(DslSeaWaterPressureChangeAtSeaFloorEnum);
+-
+-		if(type==DatasetInputEnum){
+-		
+-			/*find the DslSeaWaterPressureChangeAtSeaFloor dataset of transient inputs:*/
+-			DatasetInput* dataset_input=femmodel->inputs->GetDatasetInput(DslSeaWaterPressureChangeAtSeaFloorEnum);
+-		
+-			/*Recover modelid:*/
+-			femmodel->parameters->FindParam(&modelid,DslModelidEnum);
+-			modelid--; //from matlab. 
+-		
+-			/*Go find the modelid'th transient input:*/
+-			TransientInput* transient_input=dataset_input->GetTransientInputByOffset(reCast<int, IssmDouble>(modelid));
+-
+-			/*Plug into DslSeaWaterPressureChangeAtSeaFloor input: */
+-			Input* transient_input_copy=transient_input->copy();
+-			transient_input_copy->ChangeEnum(DslSeaWaterPressureChangeAtSeaFloorEnum);
+-			femmodel->inputs->AddInput(transient_input_copy);
+-		}
+-	}
+-}
+-/*}}}*/
+-
+ /*Support routines:*/
+ void TransferForcing(FemModel* femmodel,int forcingenum){ /*{{{*/
+ 
+@@ -869,6 +761,7 @@
+ 	int*         transitions_m=NULL;
+ 	int*         transitions_n=NULL;
+ 	int          nv;
++	int          existforcing=0;         
+ 
+ 	/*communicators:*/
+ 	ISSM_MPI_Comm tocomm;
+@@ -899,7 +792,8 @@
+ 	/*For each icecap, retrieve the forcing vector that will be sent to the earth model: */
+ 	if(modelid!=earthid){
+ 		nv=femmodel->vertices->NumberOfVertices();
+-		GetVectorFromInputsx(&forcing,femmodel,forcingenum,VertexSIdEnum);
++		existforcing=reCast<int>(femmodel->inputs->Exist(forcingenum));
++		if(existforcing)GetVectorFromInputsx(&forcing,femmodel,forcingenum,VertexSIdEnum);
+ 	}
+ 
+ 	/*Send the forcing to the earth model:{{{*/
+@@ -908,15 +802,24 @@
+ 			forcings=xNew<IssmDouble*>(nummodels-1);
+ 			nvs=xNew<int>(nummodels-1);
+ 			for(int i=0;i<earthid;i++){
+-				ISSM_MPI_Recv(nvs+i, 1, ISSM_MPI_INT, 0,i, fromcomms[i], &status);
+-				forcings[i]=xNew<IssmDouble>(nvs[i]);
+-				ISSM_MPI_Recv(forcings[i], nvs[i], ISSM_MPI_DOUBLE, 0,i, fromcomms[i], &status);
++				ISSM_MPI_Recv(&existforcing, 1, ISSM_MPI_INT, 0,i, fromcomms[i], &status);
++				if(existforcing){
++					ISSM_MPI_Recv(nvs+i, 1, ISSM_MPI_INT, 0,i, fromcomms[i], &status);
++					forcings[i]=xNew<IssmDouble>(nvs[i]);
++					ISSM_MPI_Recv(forcings[i], nvs[i], ISSM_MPI_DOUBLE, 0,i, fromcomms[i], &status);
++				}
++				else{
++					forcings[i]=NULL;
++				}
+ 			}
+ 
+ 		}
+ 		else{
+-			ISSM_MPI_Send(&nv, 1, ISSM_MPI_INT, 0, modelid, tocomm);
+-			ISSM_MPI_Send(forcing, nv, ISSM_MPI_DOUBLE, 0, modelid, tocomm);
++			ISSM_MPI_Send(&existforcing, 1, ISSM_MPI_INT, 0, modelid, tocomm);
++			if(existforcing){
++				ISSM_MPI_Send(&nv, 1, ISSM_MPI_INT, 0, modelid, tocomm);
++				ISSM_MPI_Send(forcing, nv, ISSM_MPI_DOUBLE, 0, modelid, tocomm);
++			}
+ 		}
+ 	}
+ 	/*}}}*/
+@@ -939,16 +842,18 @@
+ 			for(int i=0;i<earthid;i++){
+ 
+ 				IssmDouble* forcingfromcap= forcings[i]; //careful, this only exists on rank 0 of the earth model!
+-				IssmDouble* transition=transitions[i];
+-				int         M=transitions_m[i];
++				if(forcingfromcap){
++					IssmDouble* transition=transitions[i];
++					int         M=transitions_m[i];
+ 
+-				/*build index to plug values: */
+-				int*        index=xNew<int>(M); for(int i=0;i<M;i++)index[i]=reCast<int>(transition[i])-1; //matlab indexing!
++					/*build index to plug values: */
++					int*        index=xNew<int>(M); for(int i=0;i<M;i++)index[i]=reCast<int>(transition[i])-1; //matlab indexing!
+ 
+-				/*We are going to plug this vector into the earth model, at the right vertices corresponding to this particular 
+-				 * ice cap: */
+-				forcingglobal->SetValues(M,index,forcingfromcap,ADD_VAL);
+-				xDelete<int>(index);
++					/*We are going to plug this vector into the earth model, at the right vertices corresponding to this particular 
++					 * ice cap: */
++					forcingglobal->SetValues(M,index,forcingfromcap,ADD_VAL);
++					xDelete<int>(index);
++				}
+ 			}
+ 		}
+ 
+@@ -963,7 +868,8 @@
+ 	/*Free ressources:{{{*/
+ 	if(forcings){
+ 		for(int i=0;i<nummodels-1;i++){
+-			IssmDouble* temp=forcings[i]; xDelete<IssmDouble>(temp);
++			IssmDouble* temp=forcings[i]; 
++			if(temp)xDelete<IssmDouble>(temp);
+ 		}
+ 		xDelete<IssmDouble*>(forcings);
+ 	}
+@@ -1038,7 +944,7 @@
+ 			/*Retrieve transition vectors, used to figure out global forcing contribution to each ice cap's own elements: */
+ 			femmodel->parameters->FindParam(&transitions,&ntransitions,&transitions_m,&transitions_n,SealevelchangeTransitionsEnum);
+ 
+-			if(ntransitions!=earthid)_error_("TransferSeaLevel error message: number of transition vectors is not equal to the number of icecaps!");
++			if(ntransitions!=earthid)_error_("TransferSealevel error message: number of transition vectors is not equal to the number of icecaps!");
+ 
+ 			for(int i=0;i<earthid;i++){
+ 				nv=transitions_m[i];
+@@ -1086,54 +992,6 @@
+ 	/*}}}*/
+ 
+ } /*}}}*/
+-void EarthMassTransport(FemModel* femmodel){ /*{{{*/
+-
+-	IssmDouble time,dt;
+-	Vector<IssmDouble> *oldthickness    = NULL;
+-	Vector<IssmDouble> *newthickness    = NULL;
+-	Vector<IssmDouble> *deltathickness    = NULL;
+-	Vector<IssmDouble> *cumdeltathickness    = NULL;
+-	int nv;
+-
+-	if(VerboseSolution()) _printf0_("              computing earth mass transport\n");
+-
+-	/*This module has to be recoded! We do not grab spc thicknesses from an earth model 
+-	 * anymore! Thicknesses come from a mass transport module applied to each basin! 
+-	 * Commeting out for now:*/
+-	_error_("EarthMassTransport error message: not supported anymore!");
+-
+-	/*This mass transport module for the Earth is because we might have thickness variations as spcs 
+-	 * specified in the md.solidearth class, outside of what we will get from the icecaps. That's why we get t
+-	 * the thickness variations from SealevelchangeSpcthicknessEnum.*/
+-
+-	/*No mass transport module was called, so we are just going to retrieve the geometry thickness 
+-	 * at this time step, at prior time step, and plug the difference as deltathickness: */
+-	/*femmodel->parameters->FindParam(&time,TimeEnum);
+-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	nv=femmodel->vertices->NumberOfVertices();
+-
+-	GetVectorFromInputsx(&newthickness,femmodel,SealevelchangeSpcthicknessEnum,VertexSIdEnum);
+-	GetVectorFromInputsx(&oldthickness,femmodel,SealevelchangeSpcthicknessEnum,VertexSIdEnum,time-dt);*/
+-
+-	/*compute deltathickness: */
+-	/*deltathickness = new Vector<IssmDouble>(nv); 
+-	newthickness->Copy(deltathickness); deltathickness->AXPY(oldthickness,-1); */
+-
+-	/*plug into elements:*/
+-//	InputUpdateFromVectorx(femmodel,deltathickness,SurfaceloadIceThicknessChangeEnum,VertexSIdEnum);
+-
+-	/*add to cumulated delta thickness: */
+-	/*GetVectorFromInputsx(&cumdeltathickness,femmodel,SealevelchangeCumDeltathicknessEnum,VertexSIdEnum);
+-	cumdeltathickness->AXPY(deltathickness,1); 
+-	InputUpdateFromVectorx(femmodel,cumdeltathickness,SealevelchangeCumDeltathicknessEnum,VertexSIdEnum);*/
+-
+-	/*free ressources:*/
+-	/*delete oldthickness;
+-	delete newthickness;
+-	delete deltathickness;
+-	delete cumdeltathickness;*/
+-
+-} /*}}}*/
+ void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs){ /*{{{*/
+ 
+ 	bool converged=true;
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26047)
+@@ -37,7 +37,6 @@
+ 	femmodel->parameters->FindParam(&variable_partitions_npart,NULL,NULL,QmuVariablePartitionsNpartEnum);
+ 	femmodel->parameters->FindParam(&variable_partitions_nt,NULL,NULL,QmuVariablePartitionsNtEnum);
+ 
+-
+ 	/*Go through all dakota descriptors, ex: "rho_ice","thermal_conductivity","thickness1","thickness2", etc ..., and
+ 	 * for each descriptor, take the variable value and plug it into the inputs (more or less :)):
+ 	 * We also start with distributed and standard values , as they tend to be used to pluck data from a multi-modle ensemble (mme)
+@@ -168,8 +167,8 @@
+ 		}
+ 
+ 
+-		if (femmodel->inputs->GetInputObjectEnum(SurfaceloadIceThicknessRateEnum)==DatasetInputEnum)
+-			MmeToInput(femmodel,distributed_values,variable_partition,npart,SurfaceloadIceThicknessRateEnum, P0Enum);
++		if (femmodel->inputs->GetInputObjectEnum(MasstransportSpcthicknessEnum)==DatasetInputEnum)
++			MmeToInput(femmodel,distributed_values,variable_partition,npart,MasstransportSpcthicknessEnum, P0Enum);
+ 
+ 		if (femmodel->inputs->GetInputObjectEnum(MaskIceLevelsetEnum)==DatasetInputEnum)
+ 			MmeToInput(femmodel,distributed_values,variable_partition,npart,MaskIceLevelsetEnum, P1Enum);
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26047)
+@@ -62,6 +62,9 @@
+ 	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(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.grdmodel",GrdModelEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.runfrequency",SolidearthSettingsRunFrequencyEnum));
+ 	parameters->AddObject(new IntParam(SealevelchangeRunCountEnum,1));
+ 
+ 	  {/*This is specific to ice...*/
+@@ -73,16 +76,15 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.groundingline.melt_interpolation",GroundinglineMeltInterpolationEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isstressbalance",TransientIsstressbalanceEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ismasstransport",TransientIsmasstransportEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceantransport",TransientIsoceantransportEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.issmb",TransientIssmbEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isthermal",TransientIsthermalEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isgroundingline",TransientIsgroundinglineEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isgia",TransientIsgiaEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isesa",TransientIsesaEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isdamageevolution",TransientIsdamageevolutionEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ishydrology",TransientIshydrologyEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.ismovingfront",TransientIsmovingfrontEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isslc",TransientIsslcEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.transient.iscoupler",TransientIscouplerEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceancoupling",TransientIsoceancouplingEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.amr_frequency",TransientAmrFrequencyEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.issampling",TransientIssamplingEnum));
+@@ -355,18 +357,16 @@
+ 						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));
+-
+ 						/*slc:*/
+-						parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+ 						break;
+ 					case MathydroEnum:
+ 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
+ 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_water",MaterialsRhoSeawaterEnum));
+-						parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+ 						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_freshwater",MaterialsRhoFreshwaterEnum));
+ 						break;
+ 				}
+ 			}
++			parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+ 			/*Free rssources:*/
+ 			xDelete<int>(nature);
+ 			break;
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26047)
+@@ -143,8 +143,9 @@
+ 		case SolidearthExternalNatureEnum : return "SolidearthExternalNature";
+ 		case SolidearthExternalModelidEnum : return "SolidearthExternalModelid";
+ 		case SolidearthExternalNummodelsEnum : return "SolidearthExternalNummodels";
+-		case DslComputeFingerprintsEnum : return "DslComputeFingerprints";
++		case SolidearthSettingsComputeBpGrdEnum : return "SolidearthSettingsComputeBpGrd";
+ 		case EarthIdEnum : return "EarthId";
++		case ElasticEnum : return "Elastic";
+ 		case EplZigZagCounterEnum : return "EplZigZagCounter";
+ 		case EsaHElasticEnum : return "EsaHElastic";
+ 		case EsaHemisphereEnum : return "EsaHemisphere";
+@@ -174,10 +175,7 @@
+ 		case FrontalForcingsBasinIcefrontAreaEnum : return "FrontalForcingsBasinIcefrontArea";
+ 		case FrontalForcingsNumberofBasinsEnum : return "FrontalForcingsNumberofBasins";
+ 		case FrontalForcingsParamEnum : return "FrontalForcingsParam";
+-		case GiaModelEnum : return "GiaModel";
+-		case GiaModelidEnum : return "GiaModelid";
+-		case GiaNummodelsEnum : return "GiaNummodels";
+-		case GiaCrossSectionShapeEnum : return "GiaCrossSectionShape";
++		case GrdModelEnum : return "GrdModel";
+ 		case GroundinglineFrictionInterpolationEnum : return "GroundinglineFrictionInterpolation";
+ 		case GroundinglineMeltInterpolationEnum : return "GroundinglineMeltInterpolation";
+ 		case GroundinglineMigrationEnum : return "GroundinglineMigration";
+@@ -248,6 +246,8 @@
+ 		case InversionNumCostFunctionsEnum : return "InversionNumCostFunctions";
+ 		case InversionStepThresholdEnum : return "InversionStepThreshold";
+ 		case InversionTypeEnum : return "InversionType";
++		case IvinsEnum : return "Ivins";
++		case IsSlcCouplingEnum : return "IsSlcCoupling";
+ 		case LevelsetKillIcebergsEnum : return "LevelsetKillIcebergs";
+ 		case LevelsetReinitFrequencyEnum : return "LevelsetReinitFrequency";
+ 		case LevelsetStabilizationEnum : return "LevelsetStabilization";
+@@ -276,10 +276,6 @@
+ 		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";
+@@ -348,6 +344,7 @@
+ 		case SolidearthPlanetRadiusEnum : return "SolidearthPlanetRadius";
+ 		case SolidearthPlanetAreaEnum : return "SolidearthPlanetArea";
+ 		case SolidearthSettingsAbstolEnum : return "SolidearthSettingsAbstol";
++		case SolidearthSettingsCrossSectionShapeEnum : return "SolidearthSettingsCrossSectionShape";
+ 		case RotationalAngularVelocityEnum : return "RotationalAngularVelocity";
+ 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
+ 		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
+@@ -487,7 +484,6 @@
+ 		case ToolkitsOptionsStringsEnum : return "ToolkitsOptionsStrings";
+ 		case ToolkitsTypesEnum : return "ToolkitsTypes";
+ 		case TransientAmrFrequencyEnum : return "TransientAmrFrequency";
+-		case TransientIscouplerEnum : return "TransientIscoupler";
+ 		case TransientIsdamageevolutionEnum : return "TransientIsdamageevolution";
+ 		case TransientIsesaEnum : return "TransientIsesa";
+ 		case TransientIsgiaEnum : return "TransientIsgia";
+@@ -494,6 +490,7 @@
+ 		case TransientIsgroundinglineEnum : return "TransientIsgroundingline";
+ 		case TransientIshydrologyEnum : return "TransientIshydrology";
+ 		case TransientIsmasstransportEnum : return "TransientIsmasstransport";
++		case TransientIsoceantransportEnum : return "TransientIsoceantransport";
+ 		case TransientIsmovingfrontEnum : return "TransientIsmovingfront";
+ 		case TransientIsoceancouplingEnum : return "TransientIsoceancoupling";
+ 		case TransientIssamplingEnum : return "TransientIssampling";
+@@ -507,6 +504,9 @@
+ 		case WorldCommEnum : return "WorldComm";
+ 		case ParametersENDEnum : return "ParametersEND";
+ 		case InputsSTARTEnum : return "InputsSTART";
++		case AccumulatedDeltaBottomPressureEnum : return "AccumulatedDeltaBottomPressure";
++		case AccumulatedDeltaIceThicknessEnum : return "AccumulatedDeltaIceThickness";
++		case AccumulatedDeltaTwsEnum : return "AccumulatedDeltaTws";
+ 		case AdjointEnum : return "Adjoint";
+ 		case AdjointpEnum : return "Adjointp";
+ 		case AdjointxEnum : return "Adjointx";
+@@ -549,6 +549,8 @@
+ 		case BedNorthEnum : return "BedNorth";
+ 		case BedSlopeXEnum : return "BedSlopeX";
+ 		case BedSlopeYEnum : return "BedSlopeY";
++		case BottomPressureEnum : return "BottomPressure";
++		case BottomPressureOldEnum : return "BottomPressureOld";
+ 		case CalvingCalvingrateEnum : return "CalvingCalvingrate";
+ 		case CalvingHabFractionEnum : return "CalvingHabFraction";
+ 		case CalvingMeltingrateEnum : return "CalvingMeltingrate";
+@@ -570,6 +572,15 @@
+ 		case DamageFEnum : return "DamageF";
+ 		case DegreeOfChannelizationEnum : return "DegreeOfChannelization";
+ 		case DepthBelowSurfaceEnum : return "DepthBelowSurface";
++		case DeltaIceThicknessEnum : return "DeltaIceThickness";
++		case DeltaTwsEnum : return "DeltaTws";
++		case DeltaBottomPressureEnum : return "DeltaBottomPressure";
++		case DeltaDslEnum : return "DeltaDsl";
++		case DslOldEnum : return "DslOld";
++		case DslEnum : return "Dsl";
++		case DeltaStrEnum : return "DeltaStr";
++		case StrOldEnum : return "StrOld";
++		case StrEnum : return "Str";
+ 		case DeviatoricStresseffectiveEnum : return "DeviatoricStresseffective";
+ 		case DeviatoricStressxxEnum : return "DeviatoricStressxx";
+ 		case DeviatoricStressxyEnum : return "DeviatoricStressxy";
+@@ -587,13 +598,6 @@
+ 		case DragCoefficientAbsGradientEnum : return "DragCoefficientAbsGradient";
+ 		case DrivingStressXEnum : return "DrivingStressX";
+ 		case DrivingStressYEnum : return "DrivingStressY";
+-		case DslGlobalAverageThermostericSeaLevelChangeEnum : return "DslGlobalAverageThermostericSeaLevelChange";
+-		case DslSeaSurfaceHeightChangeAboveGeoidEnum : return "DslSeaSurfaceHeightChangeAboveGeoid";
+-		case DslSeaWaterPressureChangeAtSeaFloorEnum : return "DslSeaWaterPressureChangeAtSeaFloor";
+-		case DslStericRateEnum : return "DslStericRate";
+-		case DslDynamicRateEnum : return "DslDynamicRate";
+-		case GiaMmeNgiaEnum : return "GiaMmeNgia";
+-		case GiaMmeUgiaEnum : return "GiaMmeUgia";
+ 		case DummyEnum : return "Dummy";
+ 		case EffectivePressureEnum : return "EffectivePressure";
+ 		case EffectivePressureSubstepEnum : return "EffectivePressureSubstep";
+@@ -606,7 +610,6 @@
+ 		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";
+@@ -636,8 +639,6 @@
+ 		case FrontalForcingsSubglacialDischargeEnum : return "FrontalForcingsSubglacialDischarge";
+ 		case FrontalForcingsThermalForcingEnum : return "FrontalForcingsThermalForcing";
+ 		case GeometryHydrostaticRatioEnum : return "GeometryHydrostaticRatio";
+-		case GiaLithosphereThicknessEnum : return "GiaLithosphereThickness";
+-		case GiaMantleViscosityEnum : return "GiaMantleViscosity";
+ 		case NGiaEnum : return "NGia";
+ 		case NGiaRateEnum : return "NGiaRate";
+ 		case UGiaEnum : return "UGia";
+@@ -670,6 +671,9 @@
+ 		case HydrologySheetConductivityEnum : return "HydrologySheetConductivity";
+ 		case HydrologySheetThicknessEnum : return "HydrologySheetThickness";
+ 		case HydrologySheetThicknessOldEnum : return "HydrologySheetThicknessOld";
++		case HydrologyTwsEnum : return "HydrologyTws";
++		case HydrologyTwsSpcEnum : return "HydrologyTwsSpc";
++		case HydrologyTwsAnalysisEnum : return "HydrologyTwsAnalysis";
+ 		case HydrologyWatercolumnMaxEnum : return "HydrologyWatercolumnMax";
+ 		case HydrologyWaterVxEnum : return "HydrologyWaterVx";
+ 		case HydrologyWaterVyEnum : return "HydrologyWaterVy";
+@@ -710,6 +714,9 @@
+ 		case NewDamageEnum : return "NewDamage";
+ 		case NodeEnum : return "Node";
+ 		case OmegaAbsGradientEnum : return "OmegaAbsGradient";
++		case OceantransportSpcbottompressureEnum : return "OceantransportSpcbottompressure";
++		case OceantransportSpcstrEnum : return "OceantransportSpcstr";
++		case OceantransportSpcdslEnum : return "OceantransportSpcdsl";
+ 		case P0Enum : return "P0";
+ 		case P1Enum : return "P1";
+ 		case PartitioningEnum : return "Partitioning";
+@@ -740,16 +747,10 @@
+ 		case GmtslcEnum : return "Gmtslc";
+ 		case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic";
+ 		case SealevelRSLRateEnum : return "SealevelRSLRate";
++		case SealevelUGrdEnum : return "SealevelUGrd";
++		case SealevelNGrdEnum : return "SealevelNGrd";
+ 		case SealevelUEastEsaEnum : return "SealevelUEastEsa";
+-		case SealevelUEsaEnum : return "SealevelUEsa";
+-		case SealevelUEsaRateEnum : return "SealevelUEsaRate";
+ 		case SealevelUNorthEsaEnum : return "SealevelUNorthEsa";
+-		case SealevelchangeCumDeltathicknessEnum : return "SealevelchangeCumDeltathickness";
+-		case SealevelchangeCumDeltathicknessOldEnum : return "SealevelchangeCumDeltathicknessOld";
+-		case SurfaceloadRateEnum : return "SurfaceloadRate";
+-		case SurfaceloadIceThicknessRateEnum : return "SurfaceloadIceThicknessRate";
+-		case SurfaceloadWaterHeightRateEnum : return "SurfaceloadWaterHeightRate";
+-		case SurfaceloadOtherRateEnum : return "SurfaceloadOtherRate";
+ 		case SealevelchangeIndicesEnum : return "SealevelchangeIndices";
+ 		case SealevelchangeGEnum : return "SealevelchangeG";
+ 		case SealevelchangeGUEnum : return "SealevelchangeGU";
+@@ -918,6 +919,7 @@
+ 		case ThicknessOldEnum : return "ThicknessOld";
+ 		case ThicknessPositiveEnum : return "ThicknessPositive";
+ 		case ThicknessResidualEnum : return "ThicknessResidual";
++		case TransientAccumulatedDeltaIceThicknessEnum : return "TransientAccumulatedDeltaIceThickness";
+ 		case VelEnum : return "Vel";
+ 		case VxAverageEnum : return "VxAverage";
+ 		case VxEnum : return "Vx";
+@@ -939,6 +941,9 @@
+ 		case WaterfractionEnum : return "Waterfraction";
+ 		case WaterheightEnum : return "Waterheight";
+ 		case WeightsSurfaceObservationEnum : return "WeightsSurfaceObservation";
++		case OldAccumulatedDeltaBottomPressureEnum : return "OldAccumulatedDeltaBottomPressure";
++		case OldAccumulatedDeltaIceThicknessEnum : return "OldAccumulatedDeltaIceThickness";
++		case OldAccumulatedDeltaTwsEnum : return "OldAccumulatedDeltaTws";
+ 		case Outputdefinition1Enum : return "Outputdefinition1";
+ 		case Outputdefinition10Enum : return "Outputdefinition10";
+ 		case Outputdefinition11Enum : return "Outputdefinition11";
+@@ -1153,8 +1158,6 @@
+ 		case GenericOptionEnum : return "GenericOption";
+ 		case GenericParamEnum : return "GenericParam";
+ 		case GenericExternalResultEnum : return "GenericExternalResult";
+-		case GiaAnalysisEnum : return "GiaAnalysis";
+-		case GiaSolutionEnum : return "GiaSolution";
+ 		case Gradient1Enum : return "Gradient1";
+ 		case Gradient2Enum : return "Gradient2";
+ 		case Gradient3Enum : return "Gradient3";
+@@ -1274,6 +1277,8 @@
+ 		case NyeCO2Enum : return "NyeCO2";
+ 		case NyeH2OEnum : return "NyeH2O";
+ 		case NumericalfluxEnum : return "Numericalflux";
++		case OceantransportAnalysisEnum : return "OceantransportAnalysis";
++		case OceantransportSolutionEnum : return "OceantransportSolution";
+ 		case OldGradientEnum : return "OldGradient";
+ 		case OneLayerP4zEnum : return "OneLayerP4z";
+ 		case OpenEnum : return "Open";
+@@ -1336,7 +1341,6 @@
+ 		case SealevelNmotionEnum : return "SealevelNmotion";
+ 		case SealevelUmotionEnum : return "SealevelUmotion";
+ 		case SealevelchangeAnalysisEnum : return "SealevelchangeAnalysis";
+-		case SealevelchangeSolutionEnum : return "SealevelchangeSolution";
+ 		case SegEnum : return "Seg";
+ 		case SegInputEnum : return "SegInput";
+ 		case SegmentEnum : return "Segment";
+Index: ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 26046)
++++ ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 26047)
+@@ -32,6 +32,9 @@
+ md.smb = initialize(md.smb,md);
+ md.basalforcings   = initialize(md.basalforcings,md);
+ 
++%Initialize ocean forcings and sealevel
++md.dsl= initialize(md.dsl,md);
++
+ %Deal with other boundary conditions
+ if isnan(md.balancethickness.thickening_rate),
+ 	md.balancethickness.thickening_rate=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/src/m/classes/geometry.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/geometry.m	(revision 26047)
+@@ -52,12 +52,7 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+-			if (strcmp(solution,'TransientSolution') & md.transient.isgia) | strcmp(solution,'GiaSolution'),
+-				md = checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1);
+-			elseif strcmpi(solution,'SealevelchangeSolution'),
+-				md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+-				return;
+-			elseif strcmpi(solution,'LoveSolution'),
++			if strcmpi(solution,'LoveSolution'),
+ 				return; 
+ 			else
+ 				md = checkfield(md,'fieldname','geometry.surface' ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+@@ -89,8 +84,16 @@
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
++			
++			if (size(self.thickness==md.mesh.numberofvertices) | (self.thickness==md.mesh.numberofvertices+1)),
++				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			elseif (size(self.thickness==md.mesh.numberofelements) | (self.thickness==md.mesh.numberofelements+1)),
++				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			else
++				error('geometry thickness time series should be a vertex or element time series');
++			end
++
+ 			WriteData(fid,prefix,'object',self,'fieldname','surface','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','base','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','bed','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 26046)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 26047)
+@@ -34,6 +34,7 @@
+ void controladm1qn3_core(FemModel* femmodel);
+ void controlvalidation_core(FemModel* femmodel);
+ void masstransport_core(FemModel* femmodel);
++void oceantransport_core(FemModel* femmodel);
+ void depthaverage_core(FemModel* femmodel);
+ void extrudefrombase_core(FemModel* femmodel);
+ void extrudefromtop_core(FemModel* femmodel);
+@@ -65,10 +66,10 @@
+ Vector<IssmDouble>* sealevelchange_core_barystatic(FemModel* femmodel,SealevelMasks* mask, IssmDouble* poceanarea);
+ Vector<IssmDouble>* sealevelchange_core_sal(FemModel* femmodel,SealevelMasks* masks, Vector<IssmDouble>* RSLg_barystatic,IssmDouble oceanarea);
+ void sealevelchange_core_deformation(Vector<IssmDouble>** pN_radial, Vector<IssmDouble>** pU_radial, Vector<IssmDouble>** pU_north,Vector<IssmDouble>** pU_east,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks);
+-void GetStericRate(Vector<IssmDouble> ** psteric_rate_g, FemModel* femmodel);
+-void GetDynamicRate(Vector<IssmDouble> ** pdynamic_rate_g, FemModel* femmodel);
+-void SetBottomPressure(FemModel* femmodel);
++void couplerinput_core(FemModel* femmodel);
++void coupleroutput_core(FemModel* femmodel);
+ 
++
+ //optimization
+ int GradJSearch(IssmDouble* search_vector,FemModel* femmodel,int step);
+ IssmDouble objectivefunction(IssmDouble search_scalar,FemModel* femmodel);
+Index: ../trunk-jpl/src/c/cores/oceantransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26047)
+@@ -0,0 +1,52 @@
++/*!\file: oceantransport_core.cpp
++ * \brief: core of the oceantransport solution 
++ */ 
++
++#include "./cores.h"
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++#include "../solutionsequences/solutionsequences.h"
++
++void oceantransport_core(FemModel* femmodel){
++
++	/*Start profiler*/
++	femmodel->profiler->Start(OCEANTRANSPORTCORE);
++
++	/*parameters: */
++	int    numoutputs;
++	bool   save_results;
++	bool   dakota_analysis;
++	int    solution_type;
++
++	/*activate configuration*/
++	femmodel->SetCurrentConfiguration(OceantransportAnalysisEnum);
++
++	/*recover parameters: */
++	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
++	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++
++	if(VerboseSolution()) _printf0_("   computing ocean mass transport\n");
++
++	femmodel->SetCurrentConfiguration(OceantransportAnalysisEnum);
++
++	/*save current bottom pressures before updating:*/
++	InputDuplicatex(femmodel,BottomPressureEnum,BottomPressureOldEnum);
++	InputDuplicatex(femmodel,DslEnum,DslOldEnum);
++	InputDuplicatex(femmodel,StrEnum,StrOldEnum);
++
++	/*grab bottom pressures, dsl and str from OceantransportSpcbottompressure, OceantransportSpcdslEnum 
++	 * and OceantransportSpcstrEnum  inputs in each element, assemble into a vector and feed to 
++	 * InputUpdateFromSolutionx which will deal with accumulating such inputs:*/
++	Vector<IssmDouble>*  ug  = NULL;
++	GetSolutionFromInputsx(&ug,femmodel); 
++	InputUpdateFromSolutionx(femmodel,ug); 
++
++	delete ug;
++
++	if(solution_type==OceantransportSolutionEnum)femmodel->RequestedDependentsx();
++
++	/*profiler*/
++	femmodel->profiler->Stop(OCEANTRANSPORTCORE);
++}
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26047)
+@@ -178,39 +178,44 @@
+ 			}
+ 
+ 			//go through list of materials, and create them: 
+-			for(int i=0;i<nnat;i++){ 
+-				switch(IoCodeToEnumNature(nature[i])){ //{{{
+-					case MaticeEnum:
+-						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+-						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
+-						for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel));
+-						switch(iomodel->domaindim){
+-							case 2:
+-								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+-								break;
+-							case 3:
+-								break;
+-							default:
+-								_error_("Mesh not supported yet");
+-						}
++			for(int i=0;i<nnat;i++){
++				switch(IoCodeToEnumNature(nature[i])){ 
++					case MaticeEnum:{ /*{{{*/
++							iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
++							iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
++							for (int k=0;k<iomodel->numberofelements;k++) if(iomodel->my_elements[k]) materials->AddObject(new Matice(k+1,k,MaticeEnum));
++							switch(iomodel->domaindim){
++								case 2:
++									inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
++									break;
++								case 3:
++									break;
++								default:
++									_error_("Mesh not supported yet");
++							}
++							_printf_("Matice " << nnat << "\n");
++						} /*}}}*/
+ 						break;
+ 					case MatlithoEnum:
+-						iomodel->FetchData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
+-						materials->AddObject(new Matlitho(materials->Size()+1,iomodel));
+-						iomodel->DeleteData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
++						{ /*{{{*/
++							iomodel->FetchData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
++							materials->AddObject(new Matlitho(materials->Size()+1,iomodel));
++							iomodel->DeleteData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
++							_printf_("Matlitho " << nnat << "\n");
++						}
++						/*}}}*/
+ 						break;
+-
+-					case MathydroEnum:
+-						{
++					case MathydroEnum: /*{{{*/
++						{ 
+ 							/*If we don't have any materials pointed to by elements (meaning, if we are running only litho or hydro), 
+ 							 * then we need to zero out the hmaterial pointers inside the elements dataset so that it won't error out 
+ 							 * during configuration: */
+ 							bool isice=false;
+ 							for (int j=0;j<nnat;j++){
+-								if((IoCodeToEnumNature(nature[i])==MaticeEnum)||
+-										(IoCodeToEnumNature(nature[i])==MatenhancediceEnum)||
+-										(IoCodeToEnumNature(nature[i])==MatestarEnum)||
+-										(IoCodeToEnumNature(nature[i])==MatdamageiceEnum)){
++								if((IoCodeToEnumNature(nature[j])==MaticeEnum)||
++										(IoCodeToEnumNature(nature[j])==MatenhancediceEnum)||
++										(IoCodeToEnumNature(nature[j])==MatestarEnum)||
++										(IoCodeToEnumNature(nature[j])==MatdamageiceEnum)){
+ 									isice=true; break; }
+ 							}
+ 							if (!isice){
+@@ -229,14 +234,13 @@
+ 									}
+ 								}
+ 							}
+-						}
++						} /*}}}*/
+ 						break;
+-
+-					case MatenhancediceEnum:
++					case MatenhancediceEnum: /*{{{*/
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_E",MaterialsRheologyEEnum);
+-						for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel));
++						for (int i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,MatenhancediceEnum));
+ 						switch(iomodel->domaindim){
+ 							case 2:
+ 								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+@@ -247,12 +251,13 @@
+ 							default:
+ 								_error_("Mesh not supported yet");
+ 						}
++						/*}}}*/
+ 						break;
+-					case MatdamageiceEnum:
++					case MatdamageiceEnum: /*{{{*/
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.damage.D",DamageDEnum);
+-						for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel));
++						for (int i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,MatdamageiceEnum));
+ 						switch(iomodel->domaindim){
+ 							case 2:
+ 								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+@@ -263,12 +268,13 @@
+ 							default:
+ 								_error_("Mesh not supported yet");
+ 						}
++						/*}}}*/
+ 						break;
+-					case MatestarEnum:
++					case MatestarEnum: /*{{{*/
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum);
+-						for(i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matestar(i+1,i,iomodel));
++						for(int i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matestar(i+1,i,iomodel));
+ 						switch(iomodel->domaindim){
+ 							case 2:
+ 								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+@@ -279,13 +285,13 @@
+ 								break;
+ 							default:
+ 								_error_("Mesh not supported yet");
+-						}
+-						break;
+-
++						} 
++						/*}}}*/
++						break; 
+ 					default:
+ 						_error_("Materials nature type "<<EnumToStringx(IoCodeToEnumNature(nature[i]))<<" not supported");
+-
+-				} //}}}
++						break;
++				}
+ 			}
+ 			//Free ressources:
+ 			xDelete<int>(nature);
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26046)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26047)
+@@ -135,8 +135,9 @@
+ 	SolidearthExternalNatureEnum,
+ 	SolidearthExternalModelidEnum,
+ 	SolidearthExternalNummodelsEnum,
+-	DslComputeFingerprintsEnum,
++	SolidearthSettingsComputeBpGrdEnum,
+ 	EarthIdEnum,
++	ElasticEnum,
+ 	EplZigZagCounterEnum,
+ 	EsaHElasticEnum,
+ 	EsaHemisphereEnum,
+@@ -166,10 +167,7 @@
+ 	FrontalForcingsBasinIcefrontAreaEnum,
+ 	FrontalForcingsNumberofBasinsEnum,
+ 	FrontalForcingsParamEnum,
+-	GiaModelEnum,
+-	GiaModelidEnum,
+-	GiaNummodelsEnum,
+-	GiaCrossSectionShapeEnum,
++	GrdModelEnum,
+ 	GroundinglineFrictionInterpolationEnum,
+ 	GroundinglineMeltInterpolationEnum,
+ 	GroundinglineMigrationEnum,
+@@ -240,6 +238,8 @@
+ 	InversionNumCostFunctionsEnum,
+ 	InversionStepThresholdEnum,
+ 	InversionTypeEnum,
++	IvinsEnum,
++	IsSlcCouplingEnum,
+ 	LevelsetKillIcebergsEnum,
+ 	LevelsetReinitFrequencyEnum,
+ 	LevelsetStabilizationEnum,
+@@ -268,10 +268,6 @@
+ 	MaterialsEffectiveconductivityAveragingEnum,
+ 	MaterialsHeatcapacityEnum,
+ 	MaterialsLatentheatEnum,
+-	MaterialsLithosphereDensityEnum,
+-	MaterialsLithosphereShearModulusEnum,
+-	MaterialsMantleDensityEnum,
+-	MaterialsMantleShearModulusEnum,
+ 	MaterialsMeltingpointEnum,
+ 	MaterialsMixedLayerCapacityEnum,
+ 	MaterialsMuWaterEnum,
+@@ -340,6 +336,7 @@
+ 	SolidearthPlanetRadiusEnum,
+ 	SolidearthPlanetAreaEnum,
+ 	SolidearthSettingsAbstolEnum,
++	SolidearthSettingsCrossSectionShapeEnum,
+ 	RotationalAngularVelocityEnum,
+ 	SolidearthSettingsElasticEnum,
+ 	SealevelchangeGeometryDoneEnum,
+@@ -479,13 +476,13 @@
+ 	ToolkitsOptionsStringsEnum,
+ 	ToolkitsTypesEnum,
+ 	TransientAmrFrequencyEnum,
+-	TransientIscouplerEnum,
+ 	TransientIsdamageevolutionEnum,
+ 	TransientIsesaEnum,
+ 	TransientIsgiaEnum,
+ 	TransientIsgroundinglineEnum,
+ 	TransientIshydrologyEnum,
+-	TransientIsmasstransportEnum,
++	TransientIsmasstransportEnum, 
++	TransientIsoceantransportEnum,
+ 	TransientIsmovingfrontEnum,
+ 	TransientIsoceancouplingEnum,
+ 	TransientIssamplingEnum,
+@@ -501,6 +498,9 @@
+ 	ParametersENDEnum,
+ 	InputsSTARTEnum,
+ 	/*Inputs{{{*/
++	AccumulatedDeltaBottomPressureEnum,
++	AccumulatedDeltaIceThicknessEnum,
++	AccumulatedDeltaTwsEnum,
+ 	AdjointEnum,
+ 	AdjointpEnum,
+ 	AdjointxEnum,
+@@ -543,6 +543,8 @@
+ 	BedNorthEnum,
+ 	BedSlopeXEnum,
+ 	BedSlopeYEnum,
++	BottomPressureEnum,
++	BottomPressureOldEnum,
+ 	CalvingCalvingrateEnum,
+ 	CalvingHabFractionEnum,
+ 	CalvingMeltingrateEnum,
+@@ -564,6 +566,15 @@
+ 	DamageFEnum,
+ 	DegreeOfChannelizationEnum,
+ 	DepthBelowSurfaceEnum,
++	DeltaIceThicknessEnum,
++	DeltaTwsEnum,
++	DeltaBottomPressureEnum,
++	DeltaDslEnum,
++	DslOldEnum,
++	DslEnum,
++	DeltaStrEnum,
++	StrOldEnum,
++	StrEnum,
+ 	DeviatoricStresseffectiveEnum,
+ 	DeviatoricStressxxEnum,
+ 	DeviatoricStressxyEnum,
+@@ -581,13 +592,6 @@
+ 	DragCoefficientAbsGradientEnum,
+ 	DrivingStressXEnum,
+ 	DrivingStressYEnum,
+-	DslGlobalAverageThermostericSeaLevelChangeEnum,
+-	DslSeaSurfaceHeightChangeAboveGeoidEnum,
+-	DslSeaWaterPressureChangeAtSeaFloorEnum,
+-	DslStericRateEnum,
+-	DslDynamicRateEnum,
+-	GiaMmeNgiaEnum,
+-	GiaMmeUgiaEnum,
+ 	DummyEnum,
+    EffectivePressureEnum,
+ 	EffectivePressureSubstepEnum,
+@@ -600,7 +604,6 @@
+ 	EplHeadSlopeYEnum,
+ 	EplHeadSubstepEnum,
+    EplHeadTransientEnum,
+-	EsaDeltathicknessEnum,
+ 	EsaEmotionEnum,
+ 	EsaNmotionEnum,
+ 	EsaRotationrateEnum,
+@@ -630,8 +633,6 @@
+ 	FrontalForcingsSubglacialDischargeEnum,
+ 	FrontalForcingsThermalForcingEnum,
+ 	GeometryHydrostaticRatioEnum,
+-	GiaLithosphereThicknessEnum,
+-	GiaMantleViscosityEnum,
+ 	NGiaEnum,
+ 	NGiaRateEnum,
+ 	UGiaEnum,
+@@ -664,6 +665,9 @@
+ 	HydrologySheetConductivityEnum,
+ 	HydrologySheetThicknessEnum,
+ 	HydrologySheetThicknessOldEnum,
++	HydrologyTwsEnum,
++	HydrologyTwsSpcEnum,
++	HydrologyTwsAnalysisEnum,
+ 	HydrologyWatercolumnMaxEnum,
+ 	HydrologyWaterVxEnum,
+ 	HydrologyWaterVyEnum,
+@@ -704,6 +708,9 @@
+ 	NewDamageEnum,
+ 	NodeEnum,
+ 	OmegaAbsGradientEnum,
++	OceantransportSpcbottompressureEnum,
++	OceantransportSpcstrEnum,
++	OceantransportSpcdslEnum,
+ 	P0Enum,
+ 	P1Enum,
+ 	PartitioningEnum,
+@@ -734,16 +741,10 @@
+ 	GmtslcEnum,
+ 	SealevelRSLBarystaticEnum,
+ 	SealevelRSLRateEnum,
++	SealevelUGrdEnum,
++	SealevelNGrdEnum,
+ 	SealevelUEastEsaEnum,
+-	SealevelUEsaEnum,
+-	SealevelUEsaRateEnum,
+ 	SealevelUNorthEsaEnum,
+-	SealevelchangeCumDeltathicknessEnum,
+-	SealevelchangeCumDeltathicknessOldEnum,
+-	SurfaceloadRateEnum,
+-	SurfaceloadIceThicknessRateEnum,
+-	SurfaceloadWaterHeightRateEnum,
+-	SurfaceloadOtherRateEnum,
+ 	SealevelchangeIndicesEnum,
+ 	SealevelchangeGEnum,
+ 	SealevelchangeGUEnum,
+@@ -913,6 +914,7 @@
+ 	ThicknessOldEnum,
+ 	ThicknessPositiveEnum,
+ 	ThicknessResidualEnum,
++	TransientAccumulatedDeltaIceThicknessEnum,
+ 	VelEnum,
+ 	VxAverageEnum,
+ 	VxEnum,
+@@ -934,6 +936,9 @@
+ 	WaterfractionEnum,
+ 	WaterheightEnum,
+ 	WeightsSurfaceObservationEnum,
++	OldAccumulatedDeltaBottomPressureEnum,
++	OldAccumulatedDeltaIceThicknessEnum,
++	OldAccumulatedDeltaTwsEnum,
+ 	Outputdefinition1Enum,
+ 	Outputdefinition10Enum,
+ 	Outputdefinition11Enum,
+@@ -1150,8 +1155,6 @@
+ 	GenericOptionEnum,
+ 	GenericParamEnum,
+ 	GenericExternalResultEnum,
+-	GiaAnalysisEnum,
+-	GiaSolutionEnum,
+ 	Gradient1Enum,
+ 	Gradient2Enum,
+ 	Gradient3Enum,
+@@ -1271,6 +1274,8 @@
+ 	NyeCO2Enum,
+ 	NyeH2OEnum,
+ 	NumericalfluxEnum,
++	OceantransportAnalysisEnum,
++	OceantransportSolutionEnum,
+ 	OldGradientEnum,
+ 	OneLayerP4zEnum,
+ 	OpenEnum,
+@@ -1333,7 +1338,6 @@
+ 	SealevelNmotionEnum,
+ 	SealevelUmotionEnum,
+ 	SealevelchangeAnalysisEnum,
+-	SealevelchangeSolutionEnum,
+ 	SegEnum,
+ 	SegInputEnum,
+ 	SegmentEnum,
+Index: ../trunk-jpl/src/m/classes/fourierlove.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26047)
+@@ -62,6 +62,8 @@
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
++			if ~ismember('LoveAnalysis',analyses), return; end
++
+ 			md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
+ 			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);
+@@ -75,6 +77,16 @@
+ 			if md.love.sh_nmin<=1 & md.love.forcing_type==9
+ 				error('Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.')
+ 			end
++
++			%need 'litho' material: 
++			if ~isa(md.materials,'materials')
++				error('Need a ''litho'' material to run a Fourier Love number analysis');
++			else
++				if ~sum(strcmpi(md.materials.nature,'litho')),
++					error('Need a ''litho'' material to run a Fourier Love number analysis');
++				end
++			end
++
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 		
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26047)
+@@ -63,7 +63,6 @@
+ 		InputDuplicatex(femmodel,ThicknessEnum,ThicknessOldEnum);
+ 		InputDuplicatex(femmodel,BaseEnum,BaseOldEnum);
+ 		InputDuplicatex(femmodel,SurfaceEnum,SurfaceOldEnum);
+-		InputDuplicatex(femmodel,SealevelchangeCumDeltathicknessEnum,SealevelchangeCumDeltathicknessOldEnum);
+ 		if(stabilization==4){
+ 			solutionsequence_fct(femmodel);
+ 		}
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26046)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26047)
+@@ -141,8 +141,9 @@
+ syn keyword cConstant SolidearthExternalNatureEnum
+ syn keyword cConstant SolidearthExternalModelidEnum
+ syn keyword cConstant SolidearthExternalNummodelsEnum
+-syn keyword cConstant DslComputeFingerprintsEnum
++syn keyword cConstant SolidearthSettingsComputeBpGrdEnum
+ syn keyword cConstant EarthIdEnum
++syn keyword cConstant ElasticEnum
+ syn keyword cConstant EplZigZagCounterEnum
+ syn keyword cConstant EsaHElasticEnum
+ syn keyword cConstant EsaHemisphereEnum
+@@ -172,10 +173,7 @@
+ syn keyword cConstant FrontalForcingsBasinIcefrontAreaEnum
+ syn keyword cConstant FrontalForcingsNumberofBasinsEnum
+ syn keyword cConstant FrontalForcingsParamEnum
+-syn keyword cConstant GiaModelEnum
+-syn keyword cConstant GiaModelidEnum
+-syn keyword cConstant GiaNummodelsEnum
+-syn keyword cConstant GiaCrossSectionShapeEnum
++syn keyword cConstant GrdModelEnum
+ syn keyword cConstant GroundinglineFrictionInterpolationEnum
+ syn keyword cConstant GroundinglineMeltInterpolationEnum
+ syn keyword cConstant GroundinglineMigrationEnum
+@@ -246,6 +244,8 @@
+ syn keyword cConstant InversionNumCostFunctionsEnum
+ syn keyword cConstant InversionStepThresholdEnum
+ syn keyword cConstant InversionTypeEnum
++syn keyword cConstant IvinsEnum
++syn keyword cConstant IsSlcCouplingEnum
+ syn keyword cConstant LevelsetKillIcebergsEnum
+ syn keyword cConstant LevelsetReinitFrequencyEnum
+ syn keyword cConstant LevelsetStabilizationEnum
+@@ -274,10 +274,6 @@
+ 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
+@@ -346,6 +342,7 @@
+ syn keyword cConstant SolidearthPlanetRadiusEnum
+ syn keyword cConstant SolidearthPlanetAreaEnum
+ syn keyword cConstant SolidearthSettingsAbstolEnum
++syn keyword cConstant SolidearthSettingsCrossSectionShapeEnum
+ syn keyword cConstant RotationalAngularVelocityEnum
+ syn keyword cConstant SolidearthSettingsElasticEnum
+ syn keyword cConstant SealevelchangeGeometryDoneEnum
+@@ -485,7 +482,6 @@
+ 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
+@@ -492,6 +488,7 @@
+ syn keyword cConstant TransientIsgroundinglineEnum
+ syn keyword cConstant TransientIshydrologyEnum
+ syn keyword cConstant TransientIsmasstransportEnum
++syn keyword cConstant TransientIsoceantransportEnum
+ syn keyword cConstant TransientIsmovingfrontEnum
+ syn keyword cConstant TransientIsoceancouplingEnum
+ syn keyword cConstant TransientIssamplingEnum
+@@ -505,6 +502,9 @@
+ syn keyword cConstant WorldCommEnum
+ syn keyword cConstant ParametersENDEnum
+ syn keyword cConstant InputsSTARTEnum
++syn keyword cConstant AccumulatedDeltaBottomPressureEnum
++syn keyword cConstant AccumulatedDeltaIceThicknessEnum
++syn keyword cConstant AccumulatedDeltaTwsEnum
+ syn keyword cConstant AdjointEnum
+ syn keyword cConstant AdjointpEnum
+ syn keyword cConstant AdjointxEnum
+@@ -547,6 +547,8 @@
+ syn keyword cConstant BedNorthEnum
+ syn keyword cConstant BedSlopeXEnum
+ syn keyword cConstant BedSlopeYEnum
++syn keyword cConstant BottomPressureEnum
++syn keyword cConstant BottomPressureOldEnum
+ syn keyword cConstant CalvingCalvingrateEnum
+ syn keyword cConstant CalvingHabFractionEnum
+ syn keyword cConstant CalvingMeltingrateEnum
+@@ -568,6 +570,15 @@
+ syn keyword cConstant DamageFEnum
+ syn keyword cConstant DegreeOfChannelizationEnum
+ syn keyword cConstant DepthBelowSurfaceEnum
++syn keyword cConstant DeltaIceThicknessEnum
++syn keyword cConstant DeltaTwsEnum
++syn keyword cConstant DeltaBottomPressureEnum
++syn keyword cConstant DeltaDslEnum
++syn keyword cConstant DslOldEnum
++syn keyword cConstant DslEnum
++syn keyword cConstant DeltaStrEnum
++syn keyword cConstant StrOldEnum
++syn keyword cConstant StrEnum
+ syn keyword cConstant DeviatoricStresseffectiveEnum
+ syn keyword cConstant DeviatoricStressxxEnum
+ syn keyword cConstant DeviatoricStressxyEnum
+@@ -585,13 +596,6 @@
+ syn keyword cConstant DragCoefficientAbsGradientEnum
+ syn keyword cConstant DrivingStressXEnum
+ syn keyword cConstant DrivingStressYEnum
+-syn keyword cConstant DslGlobalAverageThermostericSeaLevelChangeEnum
+-syn keyword cConstant DslSeaSurfaceHeightChangeAboveGeoidEnum
+-syn keyword cConstant DslSeaWaterPressureChangeAtSeaFloorEnum
+-syn keyword cConstant DslStericRateEnum
+-syn keyword cConstant DslDynamicRateEnum
+-syn keyword cConstant GiaMmeNgiaEnum
+-syn keyword cConstant GiaMmeUgiaEnum
+ syn keyword cConstant DummyEnum
+ syn keyword cConstant EffectivePressureEnum
+ syn keyword cConstant EffectivePressureSubstepEnum
+@@ -604,7 +608,6 @@
+ 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
+@@ -634,8 +637,6 @@
+ syn keyword cConstant FrontalForcingsSubglacialDischargeEnum
+ syn keyword cConstant FrontalForcingsThermalForcingEnum
+ syn keyword cConstant GeometryHydrostaticRatioEnum
+-syn keyword cConstant GiaLithosphereThicknessEnum
+-syn keyword cConstant GiaMantleViscosityEnum
+ syn keyword cConstant NGiaEnum
+ syn keyword cConstant NGiaRateEnum
+ syn keyword cConstant UGiaEnum
+@@ -668,6 +669,9 @@
+ syn keyword cConstant HydrologySheetConductivityEnum
+ syn keyword cConstant HydrologySheetThicknessEnum
+ syn keyword cConstant HydrologySheetThicknessOldEnum
++syn keyword cConstant HydrologyTwsEnum
++syn keyword cConstant HydrologyTwsSpcEnum
++syn keyword cConstant HydrologyTwsAnalysisEnum
+ syn keyword cConstant HydrologyWatercolumnMaxEnum
+ syn keyword cConstant HydrologyWaterVxEnum
+ syn keyword cConstant HydrologyWaterVyEnum
+@@ -708,6 +712,9 @@
+ syn keyword cConstant NewDamageEnum
+ syn keyword cConstant NodeEnum
+ syn keyword cConstant OmegaAbsGradientEnum
++syn keyword cConstant OceantransportSpcbottompressureEnum
++syn keyword cConstant OceantransportSpcstrEnum
++syn keyword cConstant OceantransportSpcdslEnum
+ syn keyword cConstant P0Enum
+ syn keyword cConstant P1Enum
+ syn keyword cConstant PartitioningEnum
+@@ -738,16 +745,10 @@
+ syn keyword cConstant GmtslcEnum
+ syn keyword cConstant SealevelRSLBarystaticEnum
+ syn keyword cConstant SealevelRSLRateEnum
++syn keyword cConstant SealevelUGrdEnum
++syn keyword cConstant SealevelNGrdEnum
+ syn keyword cConstant SealevelUEastEsaEnum
+-syn keyword cConstant SealevelUEsaEnum
+-syn keyword cConstant SealevelUEsaRateEnum
+ syn keyword cConstant SealevelUNorthEsaEnum
+-syn keyword cConstant SealevelchangeCumDeltathicknessEnum
+-syn keyword cConstant SealevelchangeCumDeltathicknessOldEnum
+-syn keyword cConstant SurfaceloadRateEnum
+-syn keyword cConstant SurfaceloadIceThicknessRateEnum
+-syn keyword cConstant SurfaceloadWaterHeightRateEnum
+-syn keyword cConstant SurfaceloadOtherRateEnum
+ syn keyword cConstant SealevelchangeIndicesEnum
+ syn keyword cConstant SealevelchangeGEnum
+ syn keyword cConstant SealevelchangeGUEnum
+@@ -916,6 +917,7 @@
+ syn keyword cConstant ThicknessOldEnum
+ syn keyword cConstant ThicknessPositiveEnum
+ syn keyword cConstant ThicknessResidualEnum
++syn keyword cConstant TransientAccumulatedDeltaIceThicknessEnum
+ syn keyword cConstant VelEnum
+ syn keyword cConstant VxAverageEnum
+ syn keyword cConstant VxEnum
+@@ -937,6 +939,9 @@
+ syn keyword cConstant WaterfractionEnum
+ syn keyword cConstant WaterheightEnum
+ syn keyword cConstant WeightsSurfaceObservationEnum
++syn keyword cConstant OldAccumulatedDeltaBottomPressureEnum
++syn keyword cConstant OldAccumulatedDeltaIceThicknessEnum
++syn keyword cConstant OldAccumulatedDeltaTwsEnum
+ syn keyword cConstant Outputdefinition1Enum
+ syn keyword cConstant Outputdefinition10Enum
+ syn keyword cConstant Outputdefinition11Enum
+@@ -1151,8 +1156,6 @@
+ syn keyword cConstant GenericOptionEnum
+ syn keyword cConstant GenericParamEnum
+ syn keyword cConstant GenericExternalResultEnum
+-syn keyword cConstant GiaAnalysisEnum
+-syn keyword cConstant GiaSolutionEnum
+ syn keyword cConstant Gradient1Enum
+ syn keyword cConstant Gradient2Enum
+ syn keyword cConstant Gradient3Enum
+@@ -1272,6 +1275,8 @@
+ syn keyword cConstant NyeCO2Enum
+ syn keyword cConstant NyeH2OEnum
+ syn keyword cConstant NumericalfluxEnum
++syn keyword cConstant OceantransportAnalysisEnum
++syn keyword cConstant OceantransportSolutionEnum
+ syn keyword cConstant OldGradientEnum
+ syn keyword cConstant OneLayerP4zEnum
+ syn keyword cConstant OpenEnum
+@@ -1334,7 +1339,6 @@
+ syn keyword cConstant SealevelNmotionEnum
+ syn keyword cConstant SealevelUmotionEnum
+ syn keyword cConstant SealevelchangeAnalysisEnum
+-syn keyword cConstant SealevelchangeSolutionEnum
+ syn keyword cConstant SegEnum
+ syn keyword cConstant SegInputEnum
+ syn keyword cConstant SegmentEnum
+@@ -1561,7 +1565,6 @@
+ syn keyword cType FreeSurfaceBaseAnalysis
+ syn keyword cType FreeSurfaceTopAnalysis
+ syn keyword cType GLheightadvectionAnalysis
+-syn keyword cType GiaAnalysis
+ syn keyword cType HydrologyDCEfficientAnalysis
+ syn keyword cType HydrologyDCInefficientAnalysis
+ syn keyword cType HydrologyGlaDSAnalysis
+@@ -1568,6 +1571,7 @@
+ syn keyword cType HydrologyPismAnalysis
+ syn keyword cType HydrologyShaktiAnalysis
+ syn keyword cType HydrologyShreveAnalysis
++syn keyword cType HydrologyTwsAnalysis
+ syn keyword cType L2ProjectionBaseAnalysis
+ syn keyword cType L2ProjectionEPLAnalysis
+ syn keyword cType LevelsetAnalysis
+@@ -1574,6 +1578,7 @@
+ syn keyword cType LoveAnalysis
+ syn keyword cType MasstransportAnalysis
+ syn keyword cType MeltingAnalysis
++syn keyword cType OceantransportAnalysis
+ syn keyword cType SamplingAnalysis
+ syn keyword cType SealevelchangeAnalysis
+ syn keyword cType SmbAnalysis
+Index: ../trunk-jpl/src/m/classes/dslmme.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/dslmme.m	(revision 26047)
+@@ -7,10 +7,9 @@
+ 	properties (SetAccess=public) 
+ 
+ 		modelid; %index into the multi-model ensemble, determine which field will be used.
+-		global_average_thermosteric_sea_level_change; %corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.
+-		sea_surface_height_change_above_geoid; %corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble
+-		sea_water_pressure_change_at_sea_floor; %corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr equivalent, not in Pa/yr!) for each ensemble
+-		compute_fingerprints; %do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid
++		global_average_thermosteric_sea_level; %corresponds to zostoga fields in CMIP5 archives. Specified as a temporally quantity (in m) for each ensemble.
++		sea_surface_height_above_geoid; %corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m) for each ensemble
++		sea_water_pressure_at_sea_floor; %corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!)  for each ensemble
+ 
+ 	end
+ 	methods
+@@ -27,10 +26,9 @@
+ 		function self = setdefaultparameters(self) % {{{
+ 
+ 			self.modelid=0;
+-			self.global_average_thermosteric_sea_level_change={};
+-			self.sea_surface_height_change_above_geoid={};
+-			self.sea_water_pressure_change_at_sea_floor={};
+-			self.compute_fingerprints=0;
++			self.global_average_thermosteric_sea_level={};
++			self.sea_surface_height_above_geoid={};
++			self.sea_water_pressure_at_sea_floor={};
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -38,54 +36,49 @@
+ 			%Early return
+ 			if ~ismember('SealevelchangeAnalysis',analyses), return; end
+ 			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+-			for i=1:length(self.global_average_thermosteric_sea_level_change),
+-				md = checkfield(md,'field',self.global_average_thermosteric_sea_level_change{i},'NaN',1,'Inf',1);
+-				md = checkfield(md,'field',self.sea_surface_height_change_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+-				md = checkfield(md,'field',self.sea_water_pressure_change_at_sea_floor{i},'NaN',1,'Inf',1,'timeseries',1);
++			for i=1:length(self.global_average_thermosteric_sea_level),
++				md = checkfield(md,'field',self.global_average_thermosteric_sea_level{i},'NaN',1,'Inf',1);
++				md = checkfield(md,'field',self.sea_surface_height_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
++				md = checkfield(md,'field',self.sea_water_pressure_at_sea_floor{i},'NaN',1,'Inf',1,'timeseries',1);
+ 			end
+-			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.global_average_thermosteric_sea_level_change));
+-			if self.compute_fingerprints,
+-				%check geodetic flag of solidearth is on: 
+-				if md.solidearth.settings.isgrd==0,
+-					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, solidearth class should have geodetic flag on');
+-				end
++			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.global_average_thermosteric_sea_level));
++
++			if md.solidearth.settings.compute_bp_grd==1, 
++				md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','empty',1);
+ 			end
+ 
+-
+ 		end % }}}
+ 		function disp(self) % {{{
+ 
+ 			disp(sprintf('   dsl mme parameters:'));
+ 			fielddisplay(self,'modelid','index into the multi-model ensemble, determine which field will be used.');
+-			fielddisplay(self,'global_average_thermosteric_sea_level_change','corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.');
+-			fielddisplay(self,'sea_surface_height_change_above_geoid','corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble.');
+-			fielddisplay(self,'sea_water_pressure_change_at_sea_floor','corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr) for each ensemble.');
+-			fielddisplay(self,'compute_fingerprints','%do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid');
++			fielddisplay(self,'global_average_thermosteric_sea_level','corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.');
++			fielddisplay(self,'sea_surface_height_above_geoid','corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m) for each ensemble.');
++			fielddisplay(self,'sea_water_pressure_at_sea_floor','corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally quantity (in m) for each ensemble.');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			WriteData(fid,prefix,'name','md.dsl.model','data',2,'format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','compute_fingerprints','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+-			WriteData(fid,prefix,'name','md.dsl.nummodels','data',length(self.global_average_thermosteric_sea_level_change),'format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level_change','format','MatArray','timeseries',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_change_at_sea_floor','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3);
+-			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_change_above_geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
++			WriteData(fid,prefix,'name','md.dsl.nummodels','data',length(self.global_average_thermosteric_sea_level),'format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','MatArray','timeseries',1,'timeserieslength',2);
++			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','MatArray','timeserieslength',md.mesh.numberofvertices+1);
++			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1);
+ 
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+-			for i=1:length(self.global_average_thermosteric_sea_level_change),
+-				self.sea_surface_height_change_above_geoid{i}=project3d(md,'vector',self.sea_surface_height_change_above_geoid{i},'type','node','layer',1);
+-				self.sea_water_pressure_change_at_sea_floor{i}=project3d(md,'vector',self.sea_water_pressure_change_at_sea_floor{i},'type','node','layer',1);
++			for i=1:length(self.global_average_thermosteric_sea_level),
++				self.sea_surface_height_above_geoid{i}=project3d(md,'vector',self.sea_surface_height_above_geoid{i},'type','node','layer',1);
++				self.sea_water_pressure_at_sea_floor{i}=project3d(md,'vector',self.sea_water_pressure_at_sea_floor{i},'type','node','layer',1);
+ 			end
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 			
+ 			writejsdouble(fid,[modelname '.dsl.modelid'],self.modelid);
+-			writejscellarray(fid,[modelname '.dsl.global_average_thermosteric_sea_level_change'],self.global_average_thermosteric_sea_level_change);
+-			writejscellarray(fid,[modelname '.dsl.sea_surface_height_change_above_geoid'],self.sea_surface_height_change_above_geoid);
++			writejscellarray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
++			writejscellarray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
+ 			writejs1Darray(fid,[modelname '.dsl.compute_fingerprints'],self.compute_fingerprints);
+-			writejscellarray(fid,[modelname '.dsl.sea_water_pressure_change_at_sea_floor'],self.sea_water_pressure_change_at_sea_floor);
++			writejscellarray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
+ 
+ 		end % }}}
+ 	end
+Index: ../trunk-jpl/src/m/classes/lovenumbers.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26047)
+@@ -62,8 +62,8 @@
+ 			if (size(self.h,1)~=size(self.k,1) | size(self.h,1)~=size(self.l,1)),
+ 				error('lovenumbers error message: love numbers should be provided at the same level of accuracy');
+ 			end
++			
+ 
+-
+ 		end % }}}
+ 		function list=defaultoutputs(self,md) % {{{
+ 			list = {};
+Index: ../trunk-jpl/src/m/classes/matestar.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matestar.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/matestar.m	(revision 26047)
+@@ -23,12 +23,6 @@
+ 		rheology_Es   = NaN;
+ 		rheology_law = '';
+ 
+-		%giaivins: 
+-		lithosphere_shear_modulus  = 0.;
+-		lithosphere_density        = 0.;
+-		mantle_shear_modulus       = 0.;
+-		mantle_density             = 0.;
+-
+ 		%slc
+ 		earth_density              = 0;
+ 
+@@ -109,12 +103,6 @@
+ 			%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)
+ 
+@@ -130,12 +118,6 @@
+ 			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
+ 			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+             
+-			if ismember('GiaAnalysis',analyses),
+-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+-			end
+ 			if ismember('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+@@ -161,10 +143,6 @@
+ 			fielddisplay(self,'rheology_Ec','compressive enhancement factor');
+ 			fielddisplay(self,'rheology_Es','shear enhancement factor');
+ 			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
+-			fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
+-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
+-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
+-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
+ 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -187,10 +165,6 @@
+ 			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');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+@@ -213,10 +187,6 @@
+ 			writejs1Darray(fid,[modelname '.materials.rheology_Ec'],self.rheology_Ec);
+ 			writejs1Darray(fid,[modelname '.materials.rheology_Es'],self.rheology_Es);
+ 			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
+-			writejsdouble(fid,[modelname '.materials.lithosphere_shear_modulus'],self.lithosphere_shear_modulus);
+-			writejsdouble(fid,[modelname '.materials.lithosphere_density'],self.lithosphere_density);
+-			writejsdouble(fid,[modelname '.materials.mantle_shear_modulus'],self.mantle_shear_modulus);
+-			writejsdouble(fid,[modelname '.materials.mantle_density'],self.mantle_density);
+ 			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 26047)
+@@ -5,10 +5,8 @@
+ 
+ classdef solidearth
+ 	properties (SetAccess=public) 
+-		initialsealevel        = NaN;
+ 		settings               = solidearthsettings(); 
+ 		external               = [];
+-		surfaceload            = surfaceload();
+ 		lovenumbers            = lovenumbers();
+ 		rotational             = rotational();
+ 		planetradius           = planetradius('earth');
+@@ -70,11 +68,9 @@
+ 				return; 
+ 			end
+ 
+-			md = checkfield(md,'fieldname','solidearth.initialsealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 			md = checkfield(md,'fieldname','solidearth.requested_outputs','stringrow',1);
+ 
+ 			self.settings.checkconsistency(md,solution,analyses);
+-			self.surfaceload.checkconsistency(md,solution,analyses);
+ 			self.lovenumbers.checkconsistency(md,solution,analyses);
+ 			self.rotational.checkconsistency(md,solution,analyses);
+ 			if ~isempty(self.external),
+@@ -92,7 +88,6 @@
+ 		function disp(self) % {{{
+ 			disp(sprintf('   solidearth inputs, forcings and settings:'));
+ 
+-			fielddisplay(self,'initialsealevel','sea level at the start of computation [m]');
+ 			fielddisplay(self,'planetradius','planet radius [m]');
+ 			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
+ 			fielddisplay(self,'requested_outputs','additional outputs requested');
+@@ -100,7 +95,6 @@
+ 			fielddisplay(self,'partitionhydro','hydro partition vector for barystatic contribution');
+ 			if isempty(self.external), fielddisplay(self,'external','external solution, of the type solidearthsolution'); end
+ 			self.settings.disp();
+-			self.surfaceload.disp();
+ 			self.lovenumbers.disp();
+ 			self.rotational.disp();
+ 			if ~isempty(self.external),
+@@ -110,7 +104,6 @@
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			
+-			WriteData(fid,prefix,'object',self,'fieldname','initialsealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','planetradius','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
+ 		
+@@ -132,7 +125,6 @@
+ 			WriteData(fid,prefix,'data',nparthydro,'format','Integer','name','md.solidearth.nparthydro');
+ 			
+ 			self.settings.marshall(prefix,md,fid);
+-			self.surfaceload.marshall(prefix,md,fid);
+ 			self.lovenumbers.marshall(prefix,md,fid);
+ 			self.rotational.marshall(prefix,md,fid);
+ 			if ~isempty(self.external),
+@@ -154,9 +146,7 @@
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+-			writejs1Darray(fid,[modelname '.solidearth.initialsealevel'],self.initialsealevel);
+ 			self.settings.savemodeljs(fid,modelname);
+-			self.surfaceload.savemodeljs(fid,modelname);
+ 			self.lovenumbers.savemodeljs(fid,modelname);
+ 			self.rotational.savemodeljs(fid,modelname);
+ 			if ~isempty(self.external),
+@@ -167,7 +157,6 @@
+ 			writejscellarray(fid,[modelname '.solidearth.partition'],self.partition);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+-			self.initialsealevel=project3d(md,'vector',self.initialsealevel,'type','node');
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/dev/devpath.m
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.m	(revision 26046)
++++ ../trunk-jpl/src/m/dev/devpath.m	(revision 26047)
+@@ -27,7 +27,7 @@
+ addpath(recursivepath([ISSM_DIR '/externalpackages/googleearthtoolbox']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/howatmask']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/dem']));
+-addpath(recursivepath([ISSM_DIR '/externalpackages/mealpix']));
++addpath(recursivepath([ISSM_DIR '/externalpackages/pcatool']));
+ clear ISSM_DIR;
+ 
+ %Check on any warning messages that might indicate that the paths were not correct. 
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26046)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26047)
+@@ -4,36 +4,52 @@
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+ 
+-%GIA: 
+-md.gia=giaivins();
+-md.gia.lithosphere_thickness=100.*ones(md.mesh.numberofvertices,1); % in km
+-md.gia.mantle_viscosity=1.0*10^21*ones(md.mesh.numberofvertices,1); % in Pa.s
+-md.materials.lithosphere_shear_modulus=6.7*10^10;                   % in Pa
+-md.materials.lithosphere_density=3.32;                              % in g/cm^-3
+-md.materials.mantle_shear_modulus=1.45*10^11;                       % in Pa
+-md.materials.mantle_density=3.34;                                   % in g/cm^-3
++%GIA Ivins, 2 layer model.
++md.solidearth.settings.grdmodel=2;
+ 
+-%% indicate what you want to compute 
+-md.gia.cross_section_shape=1;    % for square-edged x-section 
++md.materials=materials('litho','ice');
++md.materials.numlayers=2;
++md.materials.radius =  [10 6271e3 6371e3];
++md.materials.density=  [3.34e3 3.32e3];
++md.materials.lame_mu=  [1.45e11         6.7e10];
++md.materials.viscosity=[1e21            0];
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.solidearth.settings.cross_section_shape=1;    % for square-edged x-section 
++md.solidearth.settings.computesealevelchange=0;  %do not compute sea level, only deformation
++md.solidearth.requested_outputs={'Sealevel','SealevelUGrd'};
+ 
+-%% define loading history 
+-md.timestepping.start_time=2400000; %2,400 kyr :: EVALUATION TIME
++%Loading history 
++md.timestepping.start_time=-2400000; %4,800 kyr :: EVALUATION TIME
++md.timestepping.time_step= 2400000; %2,400 kyr :: EVALUATION TIME
+ % to get rid of default final_time: make sure final_time>start_time
+-md.timestepping.final_time=2500000; %2,500 kyr
+-md.geometry.thickness=[...
+-	[md.geometry.thickness; 0.0],...
+-	[md.geometry.thickness; md.timestepping.start_time],...
++md.timestepping.final_time=2400000; %2,500 kyr
++md.masstransport.spcthickness=[...
++	[md.geometry.thickness; 0],...
++	[md.geometry.thickness; 2400000]...
+ 	];
+ 
+-%% solve for GIA deflection 
+-md.cluster=generic('name',oshostname(),'np',3);
+-md.verbose=verbose('1111111');
+-md=solve(md,'Gia');
++%geometry at 0 initially: 
++md.geometry.thickness=zeros(md.mesh.numberofvertices,1);
++md.geometry.surface=zeros(md.mesh.numberofvertices,1);
++md.geometry.base=zeros(md.mesh.numberofvertices,1);
+ 
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++
++% Solve for GIA deflection 
++md.cluster=generic('name',oshostname(),'np',1);
++%md.cluster=generic('name',oshostname(),'np',3);
++md.verbose=verbose('11111111111');
++md.verbose.solver=0;
++md=solve(md,'tr');
++
+ %Fields and tolerances to track changes
+-field_names     ={'UGia','UGiaRate'};
+-field_tolerances={1e-13,1e-13};
++field_names     ={'UGrd'};
++field_tolerances={1e-13};
+ field_values={...
+-	(md.results.GiaSolution.UGia),...
+-	(md.results.GiaSolution.UGiaRate),...
++	(md.results.TransientSolution(1).SealevelUGrd)
+ 	};
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26047)
+@@ -19,6 +19,8 @@
+ 		watercolumn         = NaN;
+ 		hydraulic_potential = NaN;
+ 		channelarea         = NaN;
++		sealevel            = NaN;
++		bottompressure      = NaN;
+         sample              = NaN;
+ 	end
+ 	methods
+@@ -34,6 +36,8 @@
+ 			self.sediment_head=project3d(md,'vector',self.sediment_head,'type','node','layer',1);
+ 			self.epl_head=project3d(md,'vector',self.epl_head,'type','node','layer',1);
+ 			self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1);
++			self.sealevel=project3d(md,'vector',self.sealevel,'type','node','layer',1);
++			self.bottompressure=project3d(md,'vector',self.bottompressure,'type','node','layer',1);
+ 
+ 			%Lithostatic pressure by default
+ 			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
+@@ -60,6 +64,11 @@
+ 				md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 			end
++			if ismember('OceantransportAnalysis',analyses) 
++				if strcmp(solution,'TransientSolution') & md.transient.isslc & md.transient.isoceantransport,
++					md = checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
++				end
++			end
+ 			if ismember('BalancethicknessAnalysis',analyses) & strcmp(solution,'BalancethicknessSolution'),
+ 				md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+@@ -88,9 +97,24 @@
+ 			end
+ 			if ismember('HydrologyShreveAnalysis',analyses),
+ 				if isa(md.hydrology,'hydrologyshreve'),
++					if strcmp(solution,'TransientSolution') & md.transient.ishydrology,
++						md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++					end
++					if strcmp(solution,'HydrologySolution'),
++						md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++					end
++				end
++			end
++			if ismember('HydrologyTwsAnalysis',analyses),
++				if isa(md.hydrology,'hydrologytws'),
+ 					md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 				end
+ 			end
++			if ismember('SealevelchangeAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isslc == 0),
++				if strcmp(solution,'TransientSolution') & md.transient.isslc,
++					md = checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++				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]);
+@@ -144,6 +168,8 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'fieldname','bottompressure','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);
+Index: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 26047)
+@@ -36,6 +36,7 @@
+ 					self.addprop('latentheat');
+ 					self.addprop('thermalconductivity');
+ 					self.addprop('temperateiceconductivity');
++					self.addprop('effectiveconductivity_averaging');
+ 					self.addprop('meltingpoint');
+ 					self.addprop('beta');
+ 					self.addprop('mixed_layer_capacity');
+@@ -58,11 +59,12 @@
+ 					self.addprop('rho_ice');
+ 					self.addprop('rho_water');
+ 					self.addprop('rho_freshwater');
+-					self.addprop('earth_density');
+ 				otherwise
+ 					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
+ 				end
+ 			end
++			self.addprop('earth_density');
++
+ 			%set default parameters:
+ 			self.setdefaultparameters();
+ 
+@@ -97,6 +99,9 @@
+ 					%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
+ 					self.meltingpoint=273.15;
+ 
+@@ -113,6 +118,11 @@
+ 					%available: none, paterson and arrhenius
+ 					self.rheology_law='Paterson';
+ 
++					%Rheology fields default: 
++					self.rheology_B   = 1*1e8; 
++					self.rheology_n   = 3;
++
++
+ 				case 'litho'
+ 					%we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
+ 					self.numlayers=2;
+@@ -136,9 +146,7 @@
+ 
+ 					%ocean water density (kg/m^3)
+ 					self.rho_water=1023.;
+-					% average density of the Earth (kg/m^3)
+-					self.earth_density=5512;
+-
++					
+ 					%fresh water density (kg/m^3)
+ 					self.rho_freshwater=1000.;
+ 
+@@ -145,6 +153,10 @@
+ 				otherwise
+ 					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
+ 				end
++
++				% average density of the Earth (kg/m^3)
++				self.earth_density=5512;
++
+ 			end
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -250,7 +262,6 @@
+ 			%1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+ 			WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(self.nature),'format','IntMat','mattype',3);
+ 			WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); %DANGER, this can evolve if you have classes.
+-
+ 			for i=1:length(self.nature),
+ 				nat=self.nature{i};
+ 				switch nat
+@@ -263,6 +274,7 @@
+ 					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');
+@@ -281,16 +293,22 @@
+ 					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);
++					%compute earth density compatible with our layer density distribution: 
++					earth_density=0;
++					for i=1:self.numlayers,
++						earth_density=earth_density+ (self.radius(i+1)^3-self.radius(i)^3)*self.density(i);
++					end
++					earth_density=earth_density/self.radius(self.numlayers+1)^3;
++					self.earth_density=earth_density;
+ 				case 'hydro'
+ 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
+ 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double');
+-					WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
+ 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double');
+-
+ 				otherwise
+ 					error('materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'' or ''hydro'')');
+ 				end
+ 			end
++			WriteData(fid,prefix,'data',self.earth_density,'name','md.materials.earth_density','format','Double');
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 			for i=1:length(self.nature),
+@@ -316,6 +334,7 @@
+ 					writejsdouble(fid,[modelname '.materials.latentheat'],self.latentheat);
+ 					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);
+ 					writejsdouble(fid,[modelname '.materials.mixed_layer_capacity'],self.mixed_layer_capacity);
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26047)
+@@ -79,6 +79,30 @@
+ 				end
+ 			end
+ 
++			%make sure grd is the same everywhere:
++			for i=1:length(slm.icecaps),
++				md= slm.icecaps{i}; 
++				if md.solidearthsettings.isgrd~=slm.earth.solidearthsettings.isgrd),
++					error(sprintf('isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
++				end
++			end
++			%make sure that there is no solid earth external forcing on the basins: 
++			for i=1:length(slm.icecaps),
++				md= slm.icecaps{i}; 
++				if ~isempty(md.solidearth.external),
++					error(sprintf('cannot run external forcings on an ice sheet when runing a coupling earth/ice sheet model');
++				end
++
++			end
++			%make sure that we have the rigth grd model for computing ouf sealevel patterns: 
++			for i=1:length(slm.icecaps),
++				md= slm.icecaps{i}; 
++				if md.solidearth.settings.grdmodel~=0
++					error(sprintf('sealevelmodel checkconsistenty error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
++				end
++			end
++
++
+ 		end
+ 		%}}}
+ 		function slm = setdefaultparameters(slm) % {{{
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 26046)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 26047)
+@@ -51,6 +51,8 @@
+ 		analyses={'EnthalpyAnalysis','ThermalAnalysis','MeltingAnalysis'};
+ 	elseif strcmp(solutiontype,'MasstransportSolution')
+ 		analyses={'MasstransportAnalysis'};
++	elseif strcmp(solutiontype,'OceantransportSolution')
++		analyses={'OceantransportAnalysis'};
+ 	elseif strcmp(solutiontype,'BalancethicknessSolution')
+ 		analyses={'BalancethicknessAnalysis'};
+ 	elseif strcmp(solutiontype,'Balancethickness2Solution')
+@@ -70,11 +72,11 @@
+ 	elseif strcmp(solutiontype,'EsaSolution')
+ 		analyses={'EsaAnalysis'};
+ 	elseif strcmp(solutiontype,'TransientSolution')
+-		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','SealevelchangeAnalysis'};
++		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','OceantransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyShreveAnalysis','HydrologyTwsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','SealevelchangeAnalysis'};
+ 	elseif strcmp(solutiontype,'SealevelchangeSolution')
+ 		analyses={'SealevelchangeAnalysis'};
+ 	elseif strcmp(solutiontype,'HydrologySolution')
+-		analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis'};
++		analyses={'L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis','HydrologyGladsAnalysis','HydrologyShaktiAnalysis','HydrologyTwsAnalysis'};
+ 	elseif strcmp(solutiontype,'DamageEvolutionSolution')
+ 		analyses={'DamageEvolutionAnalysis'};
+     elseif strcmp(solutiontype,'SamplingSolution')
+Index: ../trunk-jpl/src/m/solve/solveslm.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solveslm.m	(revision 26046)
++++ ../trunk-jpl/src/m/solve/solveslm.m	(revision 26047)
+@@ -6,7 +6,6 @@
+ %      where varargin is a lit of paired arguments of string OR enums
+ %
+ %   solution types available comprise:
+-%      - 'Sealevelchange'
+ %      - 'Transient'
+ %
+ %  extra options:
+@@ -17,8 +16,6 @@
+ %recover and process solve options
+ if strcmpi(solutionstringi,'tr') || strcmpi(solutionstringi,'Transient')
+ 	solutionstring = 'TransientSolution';
+-elseif strcmpi(solutionstringi,'slr') || strcmpi(solutionstringi,'Sealevelchange')
+-	solutionstring = 'SealevelchangeSolution';
+ else
+ 	error(['solutionstring ' solutionstringi ' not supported!']);
+ end
+Index: ../trunk-jpl/src/m/classes/hydrologytws.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologytws.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/hydrologytws.m	(revision 26047)
+@@ -0,0 +1,63 @@
++%HYDROLOGYTWS class definition
++%
++%   Usage:
++%      hydrologytws=hydrologytws();
++
++classdef hydrologytws
++	properties (SetAccess=public) 
++		spcwatercolumn     = NaN;
++		requested_outputs  = {};
++	end
++	methods
++		function self = extrude(self,md) % {{{
++		end % }}}
++		function self = hydrologytws(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				case 1
++					self=structtoobj(self,varargin{1});
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function list = defaultoutputs(self,md) % {{{
++			list = {''};
++		end % }}}    
++
++		function self = setdefaultparameters(self) % {{{
++			self.requested_outputs = {'default'};
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			%Early return
++			if ~ismember('HydrologyTwsAnalysis',analyses)
++				return;
++			end
++			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   hydrologytws solution parameters:'));
++			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
++			fielddisplay(self,'requested_outputs','additional outputs requested');
++
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++			WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++      outputs = self.requested_outputs;
++      pos  = find(ismember(outputs,'default'));
++      if ~isempty(pos),
++        outputs(pos) = [];  %remove 'default' from outputs
++        outputs      = [outputs defaultoutputs(self,md)]; %add defaults
++      end
++      WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
++		end % }}}
++		function savemodeljs(self,fid,modelname) % {{{
++		
++			writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn);
++
++		end % }}}
++	end
++end
++
+Index: ../trunk-jpl/src/m/classes/matenhancedice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 26047)
+@@ -23,12 +23,6 @@
+ 		rheology_n   = NaN;
+ 		rheology_law = '';
+ 
+-		%giaivins: 
+-		lithosphere_shear_modulus  = 0.;
+-		lithosphere_density        = 0.;
+-		mantle_shear_modulus       = 0.;
+-		mantle_density             = 0.;
+-
+ 		%slr
+ 		earth_density              = 0;
+ 
+@@ -102,12 +96,6 @@
+ 			%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)
+ 
+@@ -123,12 +111,6 @@
+ 			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
+ 			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+             
+-			if ismember('GiaAnalysis',analyses),
+-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+-			end
+ 			if ismember('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+@@ -154,10 +136,6 @@
+ 			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,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
+-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
+-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
+-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
+ 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -180,10 +158,6 @@
+ 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
+ 
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);
+ 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+@@ -206,10 +180,6 @@
+ 			writejs1Darray(fid,[modelname '.materials.rheology_B'],self.rheology_B);
+ 			writejs1Darray(fid,[modelname '.materials.rheology_n'],self.rheology_n);
+ 			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
+-			writejsdouble(fid,[modelname '.materials.lithosphere_shear_modulus'],self.lithosphere_shear_modulus);
+-			writejsdouble(fid,[modelname '.materials.lithosphere_density'],self.lithosphere_density);
+-			writejsdouble(fid,[modelname '.materials.mantle_shear_modulus'],self.mantle_shear_modulus);
+-			writejsdouble(fid,[modelname '.materials.mantle_density'],self.mantle_density);
+ 			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26047)
+@@ -42,7 +42,6 @@
+ 		calving          = 0;
+ 		frontalforcings  = 0;
+ 		love			 = 0;
+-		gia				 = 0;
+ 		esa              = 0;
+         sampling         = 0;
+ 
+@@ -240,7 +239,6 @@
+ 			md.levelset         = levelset();
+ 			md.calving          = calving();
+ 			md.frontalforcings  = frontalforcings();
+-			md.gia              = giamme();
+ 			md.love             = fourierlove();
+ 			md.esa              = esa();
+             md.sampling         = sampling();
+@@ -377,11 +375,6 @@
+ 				md.initialization.watercolumn=project2d(md,md.initialization.watercolumn,1);
+ 			end
+ 
+-			%giaivins
+-			if isa(md.gia,'giaivins'),
+-				if ~isnan(md.gia.mantle_viscosity), md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1); end
+-				if ~isnan(md.gia.lithosphere_thickness), md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1); end
+-			end
+ 
+ 			%elementstype
+ 			if ~isnan(md.flowequation.element_equation)
+@@ -1505,7 +1498,6 @@
+ 			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
+ 			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
+ 			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
+-			disp(sprintf('%19s: %-22s -- %s','gia'             ,['[1x1 ' class(self.gia) ']'],'parameters for gia solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
+             disp(sprintf('%19s: %-22s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
+Index: ../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/transient.m	(revision 26047)
+@@ -7,10 +7,10 @@
+ 	properties (SetAccess=public) 
+ 		issmb             = 0;
+ 		ismasstransport   = 0;
++		isoceantransport   = 0;
+ 		isstressbalance   = 0;
+ 		isthermal         = 0;
+ 		isgroundingline   = 0;
+-		isgia             = 0;
+ 		isesa             = 0;
+ 		isdamageevolution = 0;
+ 		ismovingfront     = 0;
+@@ -17,7 +17,6 @@
+ 		ishydrology       = 0;
+         issampling        = 0;
+ 		isslc             = 0;
+-		iscoupler         = 0;
+ 		amr_frequency     = 0;
+ 		isoceancoupling   = 0;
+ 		requested_outputs = {};
+@@ -36,10 +35,10 @@
+ 			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+ 			self.issmb           = 0;
+ 			self.ismasstransport = 0;
++			self.isoceantransport= 0;
+ 			self.isstressbalance = 0;
+ 			self.isthermal       = 0;
+ 			self.isgroundingline = 0;
+-			self.isgia           = 0;
+ 			self.isesa           = 0;
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   =0;
+@@ -47,7 +46,6 @@
+             self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+-			self.iscoupler       = 0;
+ 			self.amr_frequency	= 0;
+ 
+ 			%default output
+@@ -58,10 +56,10 @@
+ 			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+ 			self.issmb           = 1;
+ 			self.ismasstransport = 1;
++			self.isoceantransport = 0;
+ 			self.isstressbalance = 1;
+ 			self.isthermal       = 1;
+ 			self.isgroundingline = 0;
+-			self.isgia           = 0;
+ 			self.isesa           = 0;
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   = 0;
+@@ -69,7 +67,6 @@
+             self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+-			self.iscoupler       = 0;
+ 			self.amr_frequency	= 0;
+ 
+ 			%default output
+@@ -89,10 +86,10 @@
+ 
+ 			md = checkfield(md,'fieldname','transient.issmb','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.ismasstransport','numel',[1],'values',[0 1]);
++			md = checkfield(md,'fieldname','transient.isoceantransport','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isstressbalance','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isthermal','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0 1]);
+-			md = checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0 1]);
+@@ -100,7 +97,6 @@
+ 			md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
+ 			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]);
+-			md = checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0 1]);
+             md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
+ 			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 
+@@ -116,10 +112,10 @@
+ 
+ 			fielddisplay(self,'issmb','indicates whether a surface mass balance solution is used in the transient');
+ 			fielddisplay(self,'ismasstransport','indicates whether a masstransport solution is used in the transient');
++			fielddisplay(self,'isoceantransport','indicates whether an ocean masstransport solution is used in the transient');
+ 			fielddisplay(self,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
+ 			fielddisplay(self,'isthermal','indicates whether a thermal solution is used in the transient');
+ 			fielddisplay(self,'isgroundingline','indicates whether a groundingline migration is used in the transient');
+-			fielddisplay(self,'isgia','indicates whether a postglacial rebound model is used in the transient');
+ 			fielddisplay(self,'isesa','indicates whether an elastic adjustment model is used in the transient');
+ 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
+ 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
+@@ -127,7 +123,6 @@
+             fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
+ 			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
+ 			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+-			fielddisplay(self,'iscoupler','indicates whether different models are being run with need for coupling');
+ 			fielddisplay(self,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
+ 			fielddisplay(self,'requested_outputs','list of additional outputs requested');
+ 
+@@ -135,10 +130,10 @@
+ 		function 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','isoceantransport','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isstressbalance','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isthermal','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isgroundingline','format','Boolean');
+-			WriteData(fid,prefix,'object',self,'fieldname','isgia','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isesa','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean');
+@@ -146,7 +141,6 @@
+             WriteData(fid,prefix,'object',self,'fieldname','issampling','format','Boolean'); 
+ 			WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean');
+-			WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','amr_frequency','format','Integer');
+ 
+ 			%process requested outputs
+@@ -162,10 +156,10 @@
+ 		
+ 			writejsdouble(fid,[modelname '.trans.issmb'],self.issmb);
+ 			writejsdouble(fid,[modelname '.trans.ismasstransport'],self.ismasstransport);
++			writejsdouble(fid,[modelname '.trans.isoceantransport'],self.isoceantransport);
+ 			writejsdouble(fid,[modelname '.trans.isstressbalance'],self.isstressbalance);
+ 			writejsdouble(fid,[modelname '.trans.isthermal'],self.isthermal);
+ 			writejsdouble(fid,[modelname '.trans.isgroundingline'],self.isgroundingline);
+-			writejsdouble(fid,[modelname '.trans.isgia'],self.isgia);
+ 			writejsdouble(fid,[modelname '.trans.isesa'],self.isesa);
+ 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
+ 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
+@@ -173,7 +167,6 @@
+             writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
+ 			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
+ 			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
+-			writejsdouble(fid,[modelname '.trans.iscoupler'],self.iscoupler);
+ 			writejsdouble(fid,[modelname '.trans.amr_frequency'],self.amr_frequency);
+ 			writejscellstring(fid,[modelname '.trans.requested_outputs'],self.requested_outputs);
+ 
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 26046)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 26047)
+@@ -9,6 +9,7 @@
+ %   Solution types available comprise:
+ %   - 'Stressbalance'      or 'sb'
+ %   - 'Masstransport'      or 'mt'
++%   - 'Oceantransport' or 'oceant'
+ %   - 'Thermal'            or 'th'
+ %   - 'Steadystate'        or 'ss'
+ %   - 'Transient'          or 'tr'
+@@ -21,7 +22,6 @@
+ %   - 'Gia'                or 'gia'
+ %   - 'Love'               or 'lv'
+ %   - 'Esa'                or 'esa'
+-%   - 'Sealevelchange'     or 'slc'
+ %   - 'Sampling'           or 'smp'
+ %
+ %   Extra options:
+@@ -45,6 +45,8 @@
+ 	solutionstring = 'StressbalanceSolution';
+ elseif strcmpi(solutionstring,'mt') || strcmpi(solutionstring,'Masstransport')
+ 	solutionstring = 'MasstransportSolution';
++elseif strcmpi(solutionstring,'oceanmt') || strcmpi(solutionstring,'Oceantransport')
++	solutionstring = 'OceantransportSolution';
+ elseif strcmpi(solutionstring,'th') || strcmpi(solutionstring,'Thermal')
+ 	solutionstring = 'ThermalSolution';
+ elseif strcmpi(solutionstring,'ss') || strcmpi(solutionstring,'Steadystate') 
+@@ -73,8 +75,6 @@
+ 	solutionstring = 'LoveSolution';
+ elseif strcmpi(solutionstring,'esa') || strcmpi(solutionstring,'Esa')
+ 	solutionstring = 'EsaSolution';
+-elseif strcmpi(solutionstring,'slc') || strcmpi(solutionstring,'Sealevelchange')
+-	solutionstring = 'SealevelchangeSolution';
+ elseif strcmpi(solutionstring,'smp') || strcmpi(solutionstring,'Sampling')
+ 	solutionstring = 'SamplingSolution';    
+ else
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26047)
+@@ -44,6 +44,23 @@
+ 		InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
+ 
+ 	}
++	/*Using the Tws based Model*/
++	if (hydrology_model==HydrologyTwsEnum){
++		if(VerboseSolution()) _printf0_("   computing water column\n");
++	
++		femmodel->SetCurrentConfiguration(HydrologyTwsAnalysisEnum);
++		
++		/*save current tws  before updating:*/
++		InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
++	
++		/*grab tws from the hydrology.spcwatercolumn field input and update 
++		 * the solution with it:*/
++		Vector<IssmDouble>*  ug  = NULL;
++		GetVectorFromInputsx(&ug,femmodel,HydrologyTwsSpcEnum,VertexPIdEnum);
++		InputUpdateFromSolutionx(femmodel,ug); 
++		delete ug;
++	
++	}
+ 
+ 	/*Using the double continuum model*/
+ 	else if (hydrology_model==HydrologydcEnum){
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26047)
+@@ -61,8 +61,6 @@
+ 	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
+ 	#endif
+ 
+-	if(isslc) sealevelchange_geometry(femmodel);
+-
+ 	while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
+ 
+ 		/*Time Increment*/
+@@ -137,7 +135,7 @@
+ void transient_step(FemModel* femmodel){/*{{{*/
+ 
+ 	/*parameters: */
+-	bool isstressbalance,ismasstransport,issmb,isthermal,isgroundingline,isgia,isesa,issampling;;
++	bool isstressbalance,ismasstransport,isoceantransport,issmb,isthermal,isgroundingline,isesa,issampling;;
+ 	bool isslc,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,save_results;
+ 	int  step,sb_coupling_frequency;
+ 	int  domaintype,numoutputs;
+@@ -149,9 +147,9 @@
+ 	femmodel->parameters->FindParam(&sb_coupling_frequency,SettingsSbCouplingFrequencyEnum);
+ 	femmodel->parameters->FindParam(&isstressbalance,TransientIsstressbalanceEnum);
+ 	femmodel->parameters->FindParam(&ismasstransport,TransientIsmasstransportEnum);
++	femmodel->parameters->FindParam(&isoceantransport,TransientIsoceantransportEnum);
+ 	femmodel->parameters->FindParam(&issmb,TransientIssmbEnum);
+ 	femmodel->parameters->FindParam(&isthermal,TransientIsthermalEnum);
+-	femmodel->parameters->FindParam(&isgia,TransientIsgiaEnum);
+ 	femmodel->parameters->FindParam(&isesa,TransientIsesaEnum);
+ 	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
+@@ -220,26 +218,19 @@
+ 		femmodel->UpdateVertexPositionsx();
+ 	}
+ 
++	if(isoceantransport){
++		oceantransport_core(femmodel);
++	}
++
+ 	if(isgroundingline){
+ 		groundingline_core(femmodel);
+ 	}
+ 
+-	if(isgia){
+-		#ifdef _HAVE_GIA_
+-		gia_core(femmodel);
+-		#else
+-		_error_("ISSM was not compiled with gia capabilities. Exiting");
+-		#endif
+-	}
+-
+ 	/*esa: */
+ 	if(isesa) esa_core(femmodel);
+ 
+ 	/*Sea level change: */
+-	if(isslc){
+-		if(VerboseSolution()) _printf0_("   computing sea level change\n");
+-		sealevelchange_core(femmodel);
+-	}
++	if(isslc) sealevelchange_core(femmodel);
+ 
+ 	/*Sampling: */
+ 	if(issampling){
+Index: ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(revision 26047)
+@@ -0,0 +1,71 @@
++/*!\file MmeToInputFromId
++ * \brief: compute damage
++ */
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++
++#include "../../shared/shared.h"
++#include "../../toolkits/toolkits.h"
++#include "../../classes/classes.h"
++#include "../../classes/Inputs/DataSetInput.h"
++#include "../../classes/Inputs/TransientInput.h"
++#include "../../classes/Inputs/TriaInput.h"
++#include "./MmeToInputFromIdx.h"
++
++void MmeToInputFromIdx(Inputs* inputs, Elements* elements, int id, int rootenum, int interpolationenum){
++
++	TransientInput* transientinput  = NULL;
++	TransientInput* transientinput2 = NULL;
++	Tria* element                    = NULL;
++	IssmDouble value;
++	IssmDouble* values               = NULL;
++	IssmDouble* times                = NULL;
++	int N;
++
++	/*find thickness dataset: */
++	DatasetInput* datasetinput = inputs->GetDatasetInput(rootenum);
++
++	/*Initialize new transient input: */
++	transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);
++	transientinput->GetAllTimes(&times,&N);
++	inputs->SetTransientInput(DummyEnum,times,N);
++	transientinput2 = inputs->GetTransientInput(DummyEnum);
++
++	for(Object* & object : elements->objects){
++		Tria*   element=xDynamicCast<Tria*>(object);
++
++		/*recover the right field from the mme: */
++		transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);
++
++		/*copy values from the transientinput to the final transientinput2: */
++		for (int j=0;j<N;j++){
++			TriaInput* tria_input=transientinput->GetTriaInput(j);
++			element->InputServe(tria_input);
++			if(interpolationenum==P0Enum){
++				value=tria_input->element_values[0];
++				transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);
++			}
++			else if(interpolationenum==P1Enum){
++
++				/*Get values and lid list*/
++				const int   numvertices     = element->GetNumberOfVertices();
++				int        *vertexlids      = xNew<int>(numvertices);
++				int        *vertexsids      = xNew<int>(numvertices);
++
++				/*Recover vertices ids needed to initialize inputs*/
++				element->GetVerticesLidList(&vertexlids[0]);
++				element->GetVerticesSidList(&vertexsids[0]);
++				values=tria_input->element_values;
++				transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);
++			}
++		}
++	}
++
++	/*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/
++	inputs->ChangeEnum(DummyEnum,rootenum);
++
++}
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 26046)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 26047)
+@@ -71,6 +71,7 @@
+ #include "./SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h"
+ #include "./SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h"
+ #include "./ModelProcessorx/ModelProcessorx.h"
++#include "./MmeToInputFromIdx/MmeToInputFromIdx.h"
+ #include "./ParseToolkitsOptionsx/ParseToolkitsOptionsx.h"
+ #include "./NodalValuex/NodalValuex.h"
+ #include "./NodeConnectivityx/NodeConnectivityx.h"
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26046)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26047)
+@@ -146,8 +146,9 @@
+ 	      else if (strcmp(name,"SolidearthExternalNature")==0) return SolidearthExternalNatureEnum;
+ 	      else if (strcmp(name,"SolidearthExternalModelid")==0) return SolidearthExternalModelidEnum;
+ 	      else if (strcmp(name,"SolidearthExternalNummodels")==0) return SolidearthExternalNummodelsEnum;
+-	      else if (strcmp(name,"DslComputeFingerprints")==0) return DslComputeFingerprintsEnum;
++	      else if (strcmp(name,"SolidearthSettingsComputeBpGrd")==0) return SolidearthSettingsComputeBpGrdEnum;
+ 	      else if (strcmp(name,"EarthId")==0) return EarthIdEnum;
++	      else if (strcmp(name,"Elastic")==0) return ElasticEnum;
+ 	      else if (strcmp(name,"EplZigZagCounter")==0) return EplZigZagCounterEnum;
+ 	      else if (strcmp(name,"EsaHElastic")==0) return EsaHElasticEnum;
+ 	      else if (strcmp(name,"EsaHemisphere")==0) return EsaHemisphereEnum;
+@@ -177,10 +178,7 @@
+ 	      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,"GiaModel")==0) return GiaModelEnum;
+-	      else if (strcmp(name,"GiaModelid")==0) return GiaModelidEnum;
+-	      else if (strcmp(name,"GiaNummodels")==0) return GiaNummodelsEnum;
+-	      else if (strcmp(name,"GiaCrossSectionShape")==0) return GiaCrossSectionShapeEnum;
++	      else if (strcmp(name,"GrdModel")==0) return GrdModelEnum;
+ 	      else if (strcmp(name,"GroundinglineFrictionInterpolation")==0) return GroundinglineFrictionInterpolationEnum;
+ 	      else if (strcmp(name,"GroundinglineMeltInterpolation")==0) return GroundinglineMeltInterpolationEnum;
+ 	      else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum;
+@@ -251,6 +249,8 @@
+ 	      else if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
+ 	      else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
+ 	      else if (strcmp(name,"InversionType")==0) return InversionTypeEnum;
++	      else if (strcmp(name,"Ivins")==0) return IvinsEnum;
++	      else if (strcmp(name,"IsSlcCoupling")==0) return IsSlcCouplingEnum;
+ 	      else if (strcmp(name,"LevelsetKillIcebergs")==0) return LevelsetKillIcebergsEnum;
+ 	      else if (strcmp(name,"LevelsetReinitFrequency")==0) return LevelsetReinitFrequencyEnum;
+ 	      else if (strcmp(name,"LevelsetStabilization")==0) return LevelsetStabilizationEnum;
+@@ -282,10 +282,6 @@
+ 	      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 if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
+ 	      else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
+ 	      else if (strcmp(name,"MaterialsMuWater")==0) return MaterialsMuWaterEnum;
+@@ -354,6 +350,7 @@
+ 	      else if (strcmp(name,"SolidearthPlanetRadius")==0) return SolidearthPlanetRadiusEnum;
+ 	      else if (strcmp(name,"SolidearthPlanetArea")==0) return SolidearthPlanetAreaEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsAbstol")==0) return SolidearthSettingsAbstolEnum;
++	      else if (strcmp(name,"SolidearthSettingsCrossSectionShape")==0) return SolidearthSettingsCrossSectionShapeEnum;
+ 	      else if (strcmp(name,"RotationalAngularVelocity")==0) return RotationalAngularVelocityEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
+@@ -382,13 +379,13 @@
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
++	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
++	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
++	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+-	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+-	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
+-	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
++	      if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+ 	      else if (strcmp(name,"SettingsCheckpointFrequency")==0) return SettingsCheckpointFrequencyEnum;
+ 	      else if (strcmp(name,"SettingsResultsOnNodes")==0) return SettingsResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsSbCouplingFrequency")==0) return SettingsSbCouplingFrequencyEnum;
+@@ -496,7 +493,6 @@
+ 	      else if (strcmp(name,"ToolkitsOptionsStrings")==0) return ToolkitsOptionsStringsEnum;
+ 	      else if (strcmp(name,"ToolkitsTypes")==0) return ToolkitsTypesEnum;
+ 	      else if (strcmp(name,"TransientAmrFrequency")==0) return TransientAmrFrequencyEnum;
+-	      else if (strcmp(name,"TransientIscoupler")==0) return TransientIscouplerEnum;
+ 	      else if (strcmp(name,"TransientIsdamageevolution")==0) return TransientIsdamageevolutionEnum;
+ 	      else if (strcmp(name,"TransientIsesa")==0) return TransientIsesaEnum;
+ 	      else if (strcmp(name,"TransientIsgia")==0) return TransientIsgiaEnum;
+@@ -503,15 +499,16 @@
+ 	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+ 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+ 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
++	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
++	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
++	      else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum;
++	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+-	      else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum;
+-	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
+-	      else if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
++	      if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
+ 	      else if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum;
+ 	      else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
+@@ -519,6 +516,9 @@
+ 	      else if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
+ 	      else if (strcmp(name,"ParametersEND")==0) return ParametersENDEnum;
+ 	      else if (strcmp(name,"InputsSTART")==0) return InputsSTARTEnum;
++	      else if (strcmp(name,"AccumulatedDeltaBottomPressure")==0) return AccumulatedDeltaBottomPressureEnum;
++	      else if (strcmp(name,"AccumulatedDeltaIceThickness")==0) return AccumulatedDeltaIceThicknessEnum;
++	      else if (strcmp(name,"AccumulatedDeltaTws")==0) return AccumulatedDeltaTwsEnum;
+ 	      else if (strcmp(name,"Adjoint")==0) return AdjointEnum;
+ 	      else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
+ 	      else if (strcmp(name,"Adjointx")==0) return AdjointxEnum;
+@@ -561,6 +561,8 @@
+ 	      else if (strcmp(name,"BedNorth")==0) return BedNorthEnum;
+ 	      else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
+ 	      else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
++	      else if (strcmp(name,"BottomPressure")==0) return BottomPressureEnum;
++	      else if (strcmp(name,"BottomPressureOld")==0) return BottomPressureOldEnum;
+ 	      else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
+ 	      else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum;
+ 	      else if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
+@@ -582,6 +584,15 @@
+ 	      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,"DeltaIceThickness")==0) return DeltaIceThicknessEnum;
++	      else if (strcmp(name,"DeltaTws")==0) return DeltaTwsEnum;
++	      else if (strcmp(name,"DeltaBottomPressure")==0) return DeltaBottomPressureEnum;
++	      else if (strcmp(name,"DeltaDsl")==0) return DeltaDslEnum;
++	      else if (strcmp(name,"DslOld")==0) return DslOldEnum;
++	      else if (strcmp(name,"Dsl")==0) return DslEnum;
++	      else if (strcmp(name,"DeltaStr")==0) return DeltaStrEnum;
++	      else if (strcmp(name,"StrOld")==0) return StrOldEnum;
++	      else if (strcmp(name,"Str")==0) return StrEnum;
+ 	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
+ 	      else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
+ 	      else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
+@@ -599,13 +610,6 @@
+ 	      else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
+ 	      else if (strcmp(name,"DrivingStressX")==0) return DrivingStressXEnum;
+ 	      else if (strcmp(name,"DrivingStressY")==0) return DrivingStressYEnum;
+-	      else if (strcmp(name,"DslGlobalAverageThermostericSeaLevelChange")==0) return DslGlobalAverageThermostericSeaLevelChangeEnum;
+-	      else if (strcmp(name,"DslSeaSurfaceHeightChangeAboveGeoid")==0) return DslSeaSurfaceHeightChangeAboveGeoidEnum;
+-	      else if (strcmp(name,"DslSeaWaterPressureChangeAtSeaFloor")==0) return DslSeaWaterPressureChangeAtSeaFloorEnum;
+-	      else if (strcmp(name,"DslStericRate")==0) return DslStericRateEnum;
+-	      else if (strcmp(name,"DslDynamicRate")==0) return DslDynamicRateEnum;
+-	      else if (strcmp(name,"GiaMmeNgia")==0) return GiaMmeNgiaEnum;
+-	      else if (strcmp(name,"GiaMmeUgia")==0) return GiaMmeUgiaEnum;
+ 	      else if (strcmp(name,"Dummy")==0) return DummyEnum;
+ 	      else if (strcmp(name,"EffectivePressure")==0) return EffectivePressureEnum;
+ 	      else if (strcmp(name,"EffectivePressureSubstep")==0) return EffectivePressureSubstepEnum;
+@@ -618,7 +622,6 @@
+ 	      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;
+@@ -625,13 +628,13 @@
+ 	      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 stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"EtaDiff")==0) return EtaDiffEnum;
++	      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;
+@@ -651,8 +654,6 @@
+ 	      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,"NGia")==0) return NGiaEnum;
+ 	      else if (strcmp(name,"NGiaRate")==0) return NGiaRateEnum;
+ 	      else if (strcmp(name,"UGia")==0) return UGiaEnum;
+@@ -685,6 +686,9 @@
+ 	      else if (strcmp(name,"HydrologySheetConductivity")==0) return HydrologySheetConductivityEnum;
+ 	      else if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
+ 	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
++	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
++	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
++	      else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologyWatercolumnMax")==0) return HydrologyWatercolumnMaxEnum;
+ 	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
+ 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
+@@ -725,6 +729,9 @@
+ 	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
+ 	      else if (strcmp(name,"Node")==0) return NodeEnum;
+ 	      else if (strcmp(name,"OmegaAbsGradient")==0) return OmegaAbsGradientEnum;
++	      else if (strcmp(name,"OceantransportSpcbottompressure")==0) return OceantransportSpcbottompressureEnum;
++	      else if (strcmp(name,"OceantransportSpcstr")==0) return OceantransportSpcstrEnum;
++	      else if (strcmp(name,"OceantransportSpcdsl")==0) return OceantransportSpcdslEnum;
+ 	      else if (strcmp(name,"P0")==0) return P0Enum;
+ 	      else if (strcmp(name,"P1")==0) return P1Enum;
+ 	      else if (strcmp(name,"Partitioning")==0) return PartitioningEnum;
+@@ -744,7 +751,10 @@
+ 	      else if (strcmp(name,"SamplingKappa")==0) return SamplingKappaEnum;
+ 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticMask")==0) return SealevelBarystaticMaskEnum;
+-	      else if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
+ 	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
+ 	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
+ 	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
+@@ -751,23 +761,14 @@
+ 	      else if (strcmp(name,"Bslc")==0) return BslcEnum;
+ 	      else if (strcmp(name,"BslcIce")==0) return BslcIceEnum;
+ 	      else if (strcmp(name,"BslcHydro")==0) return BslcHydroEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
++	      else if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
+ 	      else if (strcmp(name,"Gmtslc")==0) return GmtslcEnum;
+ 	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
+ 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
++	      else if (strcmp(name,"SealevelUGrd")==0) return SealevelUGrdEnum;
++	      else if (strcmp(name,"SealevelNGrd")==0) return SealevelNGrdEnum;
+ 	      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,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+-	      else if (strcmp(name,"SealevelchangeCumDeltathickness")==0) return SealevelchangeCumDeltathicknessEnum;
+-	      else if (strcmp(name,"SealevelchangeCumDeltathicknessOld")==0) return SealevelchangeCumDeltathicknessOldEnum;
+-	      else if (strcmp(name,"SurfaceloadRate")==0) return SurfaceloadRateEnum;
+-	      else if (strcmp(name,"SurfaceloadIceThicknessRate")==0) return SurfaceloadIceThicknessRateEnum;
+-	      else if (strcmp(name,"SurfaceloadWaterHeightRate")==0) return SurfaceloadWaterHeightRateEnum;
+-	      else if (strcmp(name,"SurfaceloadOtherRate")==0) return SurfaceloadOtherRateEnum;
+ 	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+ 	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+ 	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+@@ -873,11 +874,11 @@
+ 	      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 stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbTini")==0) return SmbTiniEnum;
++	      if (strcmp(name,"SmbTemperaturesReconstructed")==0) return SmbTemperaturesReconstructedEnum;
++	      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;
+@@ -939,6 +940,7 @@
+ 	      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,"TransientAccumulatedDeltaIceThickness")==0) return TransientAccumulatedDeltaIceThicknessEnum;
+ 	      else if (strcmp(name,"Vel")==0) return VelEnum;
+ 	      else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
+ 	      else if (strcmp(name,"Vx")==0) return VxEnum;
+@@ -960,6 +962,9 @@
+ 	      else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
+ 	      else if (strcmp(name,"Waterheight")==0) return WaterheightEnum;
+ 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
++	      else if (strcmp(name,"OldAccumulatedDeltaBottomPressure")==0) return OldAccumulatedDeltaBottomPressureEnum;
++	      else if (strcmp(name,"OldAccumulatedDeltaIceThickness")==0) return OldAccumulatedDeltaIceThicknessEnum;
++	      else if (strcmp(name,"OldAccumulatedDeltaTws")==0) return OldAccumulatedDeltaTwsEnum;
+ 	      else if (strcmp(name,"Outputdefinition1")==0) return Outputdefinition1Enum;
+ 	      else if (strcmp(name,"Outputdefinition10")==0) return Outputdefinition10Enum;
+ 	      else if (strcmp(name,"Outputdefinition11")==0) return Outputdefinition11Enum;
+@@ -992,15 +997,15 @@
+ 	      else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
+ 	      else if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum;
+ 	      else if (strcmp(name,"Outputdefinition39")==0) return Outputdefinition39Enum;
+-	      else if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
+ 	      else if (strcmp(name,"Outputdefinition40")==0) return Outputdefinition40Enum;
+ 	      else if (strcmp(name,"Outputdefinition41")==0) return Outputdefinition41Enum;
+ 	      else if (strcmp(name,"Outputdefinition42")==0) return Outputdefinition42Enum;
+ 	      else if (strcmp(name,"Outputdefinition43")==0) return Outputdefinition43Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition44")==0) return Outputdefinition44Enum;
++	      else if (strcmp(name,"Outputdefinition44")==0) return Outputdefinition44Enum;
+ 	      else if (strcmp(name,"Outputdefinition45")==0) return Outputdefinition45Enum;
+ 	      else if (strcmp(name,"Outputdefinition46")==0) return Outputdefinition46Enum;
+ 	      else if (strcmp(name,"Outputdefinition47")==0) return Outputdefinition47Enum;
+@@ -1115,15 +1120,15 @@
+ 	      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 if (strcmp(name,"ControlInputMins")==0) return ControlInputMinsEnum;
++         else stage=10;
++   }
++   if(stage==10){
++	      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 stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"DamageEvolutionAnalysis")==0) return DamageEvolutionAnalysisEnum;
++	      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;
+@@ -1180,8 +1185,6 @@
+ 	      else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
+ 	      else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
+ 	      else if (strcmp(name,"GenericExternalResult")==0) return GenericExternalResultEnum;
+-	      else if (strcmp(name,"GiaAnalysis")==0) return GiaAnalysisEnum;
+-	      else if (strcmp(name,"GiaSolution")==0) return GiaSolutionEnum;
+ 	      else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
+ 	      else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
+ 	      else if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
+@@ -1240,13 +1243,13 @@
+ 	      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 if (strcmp(name,"LoveHr")==0) return LoveHrEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"LoveKernelsImag")==0) return LoveKernelsImagEnum;
++	      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;
+@@ -1304,6 +1307,8 @@
+ 	      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,"OceantransportAnalysis")==0) return OceantransportAnalysisEnum;
++	      else if (strcmp(name,"OceantransportSolution")==0) return OceantransportSolutionEnum;
+ 	      else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
+ 	      else if (strcmp(name,"OneLayerP4z")==0) return OneLayerP4zEnum;
+ 	      else if (strcmp(name,"Open")==0) return OpenEnum;
+@@ -1361,15 +1366,14 @@
+ 	      else if (strcmp(name,"SealevelAbsolute")==0) return SealevelAbsoluteEnum;
+ 	      else if (strcmp(name,"SealevelEmotion")==0) return SealevelEmotionEnum;
+ 	      else if (strcmp(name,"SealevelInertiaTensorXZ")==0) return SealevelInertiaTensorXZEnum;
+-	      else if (strcmp(name,"SealevelInertiaTensorYZ")==0) return SealevelInertiaTensorYZEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"SealevelInertiaTensorYZ")==0) return SealevelInertiaTensorYZEnum;
+ 	      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,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
+-         else stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"SealevelchangeSolution")==0) return SealevelchangeSolutionEnum;
+ 	      else if (strcmp(name,"Seg")==0) return SegEnum;
+ 	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
+ 	      else if (strcmp(name,"Segment")==0) return SegmentEnum;
+Index: ../trunk-jpl/src/m/classes/dsl.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/dsl.m	(revision 26047)
+@@ -6,16 +6,15 @@
+ classdef dsl
+ 	properties (SetAccess=public) 
+ 
+-		global_average_thermosteric_sea_level_change; %corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)
+-		sea_surface_height_change_above_geoid; %corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)
+-		sea_water_pressure_change_at_sea_floor; %corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr equivalent, not in Pa/yr!) for each ensemble
+-		compute_fingerprints; %do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid
++		global_average_thermosteric_sea_level; %corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)
++		sea_surface_height_above_geoid; %corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable (in m)
++		sea_water_pressure_at_sea_floor; %corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) 
+ 
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+-			self.sea_surface_height_change_above_geoid=project3d(md,'vector',self.sea_surface_height_change_above_geoid,'type','node','layer',1);
+-			self.sea_water_pressure_change_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_change_at_sea_floor,'type','node','layer',1);
++			self.sea_surface_height_above_geoid=project3d(md,'vector',self.sea_surface_height_above_geoid,'type','node','layer',1);
++			self.sea_water_pressure_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_at_sea_floor,'type','node','layer',1);
+ 		end % }}}
+ 		function self = dsl(varargin) % {{{
+ 			switch nargin
+@@ -29,10 +28,9 @@
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
+-			self.global_average_thermosteric_sea_level_change=0;
+-			self.sea_surface_height_change_above_geoid=NaN;
+-			self.sea_water_pressure_change_at_sea_floor=NaN;
+-			self.compute_fingerprints=0;
++			self.global_average_thermosteric_sea_level=NaN;
++			self.sea_surface_height_above_geoid=NaN;
++			self.sea_water_pressure_at_sea_floor=NaN;
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -40,43 +38,54 @@
+ 			%Early return
+ 			if ~ismember('SealevelchangeAnalysis',analyses), return; end
+ 			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+-			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level_change','NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','dsl.sea_surface_height_change_above_geoid','NaN',1,'Inf',1,'timeseries',1);
+-			md = checkfield(md,'fieldname','dsl.sea_water_pressure_change_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
+-			md = checkfield(md,'fieldname','dsl.compute_fingerprints','NaN',1,'Inf',1,'values',[0,1]);
+-			if self.compute_fingerprints,
+-				%check geodetic flag of is on: 
+-				if md.solidearth.settings.isgrd==0,
+-					error('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, solidearth class should have grd flag on');
+-				end
++			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level','NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','dsl.sea_surface_height_above_geoid','NaN',1,'Inf',1,'timeseries',1);
++			md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
++			
++			if md.solidearth.settings.compute_bp_grd==1, 
++				md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','empty',1);
+ 			end
+-
++			
+ 		end % }}}
+ 		function disp(self) % {{{
+ 
+ 			disp(sprintf('   dsl parameters:'));
+-			fielddisplay(self,'global_average_thermosteric_sea_level_change','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)');
+-			fielddisplay(self,'sea_surface_height_change_above_geoid','corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)');
+-			fielddisplay(self,'sea_water_pressure_change_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)');
+-			fielddisplay(self,'compute_fingerprints','%do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid');
++			fielddisplay(self,'global_average_thermosteric_sea_level','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)');
++			fielddisplay(self,'sea_surface_height_above_geoid','corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m)');
++			fielddisplay(self,'sea_water_pressure_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent)');
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','compute_fingerprints','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level_change','format','DoubleMat','mattype',1,'timeseries',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_change_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_change_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','DoubleMat','mattype',2,'timeseries',1,'timeserieslength',2,'yts',md.constants.yts); %mattype 2, because we are sending a GMSL value identical everywhere on each element. 
++			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); %mattype 1 because we specify DSL at vertex locations.
++			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); %mattype 1 because we specify bottom pressure at vertex locations.
+ 
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+-			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level_change'],self.global_average_thermosteric_sea_level_change);
+-			writejs1Darray(fid,[modelname '.dsl.compute_fingerprints'],self.compute_fingerprints);
+-			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_change_above_geoid'],self.sea_surface_height_change_above_geoid);
+-			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_change_at_sea_floor'],self.sea_water_pressure_change_at_sea_floor);
++			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
++			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
++			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
+ 
+ 		end % }}}
++		function self = initialize(self,md) % {{{
++
++			if isnan(self.global_average_thermosteric_sea_level)
++				self.global_average_thermosteric_sea_level=[0;0];
++				disp('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero');
++			end
++			if isnan(self.sea_surface_height_above_geoid)
++				self.sea_surface_height_above_geoid=[zeros(md.mesh.numberofvertices,1);0];
++				disp('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero');
++			end
++			if isnan(self.sea_water_pressure_at_sea_floor)
++				self.sea_water_pressure_at_sea_floor=[zeros(md.mesh.numberofvertices,1);0];
++				disp('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero');
++			end
++
++		end % }}}
++	
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/hydrologyshreve.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26047)
+@@ -33,11 +33,9 @@
+       self.requested_outputs = {'default'};
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+-
++			
+ 			%Early return
+-			if ~ismember('HydrologyShreveAnalysis',analyses)
+-				return;
+-			end
++			if ~ismember('HydrologyShreveAnalysis',analyses) |  (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
+ 
+ 			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','hydrology.stabilization','>=',0);
+Index: ../trunk-jpl/src/m/classes/matdamageice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26047)
+@@ -22,12 +22,6 @@
+ 		rheology_n   = NaN;
+ 		rheology_law = '';
+ 
+-		%giaivins: 
+-		lithosphere_shear_modulus  = 0.;
+-		lithosphere_density        = 0.;
+-		mantle_shear_modulus       = 0.;
+-		mantle_density             = 0.;
+-
+ 		%slc
+ 		earth_density              = 0;
+ 
+@@ -100,12 +94,6 @@
+ 			%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)
+ 
+@@ -120,12 +108,6 @@
+ 			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
+ 			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+ 			
+-			if ismember('GiaAnalysis',analyses),
+-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+-			end
+ 			if ismember('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+@@ -151,10 +133,6 @@
+ 			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,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
+-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
+-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
+-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
+ 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -176,10 +154,6 @@
+ 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
+ 
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);
+ 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/matice.m	(revision 26047)
+@@ -22,12 +22,6 @@
+ 		rheology_n   = NaN;
+ 		rheology_law = '';
+ 
+-		%giaivins: 
+-		lithosphere_shear_modulus  = 0.;
+-		lithosphere_density        = 0.;
+-		mantle_shear_modulus       = 0.;
+-		mantle_density             = 0.;
+-
+ 		%slc
+ 		earth_density              = 0;
+ 
+@@ -100,11 +94,9 @@
+ 			%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)
++			%Rheology for ice: 
++			self.rheology_B=2.1*1e8;
++			self.rheology_n=3;
+ 
+ 			%SLR
+ 			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
+@@ -111,27 +103,20 @@
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+-	
+-			if ~strcmpi(solution,'SealevelchangeSolution'),
+-				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,'universal',1,'NaN',1,'Inf',1);
+-				md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
+-				md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
+-				md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+-			end
+-
+-			if ismember('GiaAnalysis',analyses),
+-				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+-				md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
+-			end
+-			if ismember('SealevelchangeAnalysis',analyses),
++			
++			if strcmpi(solution,'TransientSolution') & md.transient.isslc,
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
++				return;
+ 			end
++	
++			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,'universal',1,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
++			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+ 
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -153,10 +138,6 @@
+ 			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'', ''LliboutryDuval'', ''NyeH2O'', or ''NyeCO2''']);
+-			fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
+-			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
+-			fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]');
+-			fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]');
+ 			fielddisplay(self,'earth_density','Mantle density [kg/m^-3]');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -182,10 +163,6 @@
+ 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String');
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
+-			WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);
+ 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+@@ -207,10 +184,6 @@
+ 			writejs1Darray(fid,[modelname '.materials.rheology_B'],self.rheology_B);
+ 			writejs1Darray(fid,[modelname '.materials.rheology_n'],self.rheology_n);
+ 			writejsstring(fid,[modelname '.materials.rheology_law'],self.rheology_law);
+-			writejsdouble(fid,[modelname '.materials.lithosphere_shear_modulus'],self.lithosphere_shear_modulus);
+-			writejsdouble(fid,[modelname '.materials.lithosphere_density'],self.lithosphere_density);
+-			writejsdouble(fid,[modelname '.materials.mantle_shear_modulus'],self.mantle_shear_modulus);
+-			writejsdouble(fid,[modelname '.materials.mantle_density'],self.mantle_density);
+ 			writejsdouble(fid,[modelname '.materials.earth_density'],self.earth_density);
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26046)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26047)
+@@ -15,9 +15,12 @@
+ 		runfrequency           = 1; %how many time steps we skip before we run grd_core
+ 		computesealevelchange  = 1; %will sea-level be coputed? 
+ 		isgrd                  = 1; %will GRD patterns be computed? 
++		compute_bp_grd         = 1; %will GRD patterns for bottomo pressures be computed? 
+ 		degacc                 = 0; %degree increment for resolution of Green tables
+ 		horiz                  = 0; %compute horizontal deformation
+ 		glfraction             = 1; %barystatic contribution full or fractional (default fractional)
++		grdmodel               = 0; %grd model (0 by default, 1 for elastic, 2 for Ivins)
++		cross_section_shape    = 0; %cross section only used when grd model is Ivins
+ 	end
+ 	methods
+ 		function self = solidearthsettings(varargin) % {{{
+@@ -42,7 +45,8 @@
+ 		self.elastic=1;
+ 		self.rotation=1;
+ 		self.ocean_area_scaling=0;
+-		self.isgrd=1;
++		self.compute_bp_grd=1;
++		self.isgrd=0;
+ 		self.computesealevelchange=1;
+ 
+ 		%numerical discretization accuracy
+@@ -56,6 +60,13 @@
+ 	
+ 		%horizontal displacement?  (not by default)
+ 		self.horiz=0;
++		
++		%cross section for Ivins model 
++		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
++
++		%no grd model by default: 
++		self.grdmodel=0; 
++
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+@@ -69,6 +80,8 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.degacc','size',[1 1],'>=',1e-10);
+ 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.glfraction','values',[0 1]);
++			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','values',[1 2]);
++			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
+ 
+ 			%checks on computational flags
+ 			if self.elastic==1 & self.rigid==0,
+@@ -75,19 +88,24 @@
+ 				error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
+ 			end
+ 
+-			%a coupler to a planet model is provided. 
++			%a GRD computation has been requested, makes somes checks on the nature of the meshes provided. 
+ 			if self.isgrd,
+-				if md.transient.iscoupler, 
+-					%we are good; 
++				if strcmpi(class(md.mesh),'mesh3dsurface'),
++					if self.grdmodel==2,
++						error('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)');
++					end
+ 				else
+-					if strcmpi(class(md.mesh),'mesh3dsurface'),
+-						%we are good
+-					else
+-						error('model is requesting sealevel computations without being a mesh3dsurface, or being coupled to one!');
++					if self.grdmodel==1,
++						error('model requires a 3D surface mesh to run GRD computations ( change mesh from mesh2d to mesh3dsurface)');
+ 					end
+ 				end
+ 			end
+ 
++			if self.compute_bp_grd==1 & md.solidearth.settings.isgrd==0,
++					error('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on');
++			end
++
++
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   solidearth settings:'));
+@@ -98,6 +116,7 @@
+ 			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
+ 			fielddisplay(self,'computesealevelchange','compute sealevel change (default 1)');
+ 			fielddisplay(self,'isgrd','compute GRD patterns (default 1)');
++			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default 1)');
+ 			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
+ 			fielddisplay(self,'rigid','rigid earth graviational potential perturbation');
+ 			fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
+@@ -104,6 +123,8 @@
+ 			fielddisplay(self,'rotation','earth rotational potential perturbation');
+ 			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+ 			fielddisplay(self,'glfraction','contribute fractionally (default, 1) to barystatic sea level');
++			fielddisplay(self,'grdmodel','type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins');
++			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'object',self,'fieldname','reltol','name','md.solidearth.settings.reltol','format','Double');
+@@ -118,7 +139,10 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','horiz','name','md.solidearth.settings.horiz','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','computesealevelchange','name','md.solidearth.settings.computesealevelchange','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isgrd','name','md.solidearth.settings.isgrd','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','compute_bp_grd','name','md.solidearth.settings.compute_bp_grd','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','glfraction','name','md.solidearth.settings.glfraction','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','name','md.solidearth.settings.cross_section_shape','format','Integer');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+@@ -132,6 +156,7 @@
+ 			writejsdouble(fid,[modelname '.solidearth.settings.run_frequency'],self.run_frequency);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.glfraction'],self.glfraction);
++			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
+Index: ../trunk-jpl/test/Par/SquareSheetConstrained.par
+===================================================================
+--- ../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 26046)
++++ ../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 26047)
+@@ -9,6 +9,7 @@
+ 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.bed=md.geometry.base;
+ md.geometry.surface=md.geometry.base+md.geometry.thickness;
+ 
+ %Initial velocity 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26047-26048.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26047-26048.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26047-26048.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(revision 26047)
++++ ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(revision 26048)
+@@ -11,7 +11,7 @@
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../classes/classes.h"
+-#include "../../classes/Inputs/DataSetInput.h"
++#include "../../classes/Inputs/DatasetInput.h"
+ #include "../../classes/Inputs/TransientInput.h"
+ #include "../../classes/Inputs/TriaInput.h"
+ #include "./MmeToInputFromIdx.h"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26048-26049.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26048-26049.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26048-26049.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 26048)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 26049)
+@@ -158,9 +158,6 @@
+ 		void ThicknessAverage();
+ 		void ThicknessAbsGradientx( IssmDouble* pJ);
+ 		void ThicknessPositivex(IssmDouble* pJ);
+-		#ifdef _HAVE_GIA_
+-		void IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y);
+-		#endif
+ 		#ifdef _HAVE_ESA_
+ 		void EsaGeodetic2D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY, IssmDouble* xx, IssmDouble* yy);
+ 		void EsaGeodetic3D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
+@@ -171,6 +168,7 @@
+ 		void SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
+ 		void SealevelchangeDeformation(Vector<IssmDouble>* pgeoid,Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
+ 		IssmDouble SealevelchangeOceanAverage(Vector<IssmDouble>* Sg,SealevelMasks* masks, IssmDouble oceanarea);
++		void IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y);
+ 		#endif
+ 		void HydrologyEPLupdateDomainx(IssmDouble* pEplcount);
+ 		void HydrologyIDSupdateDomainx(IssmDouble* pIDScount);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26049-26050.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26049-26050.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26049-26050.diff	(revision 26740)
@@ -0,0 +1,62 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26049)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26050)
+@@ -4666,29 +4666,6 @@
+ }
+ /*}}}*/
+ #endif
+-#ifdef _HAVE_GIA_
+-void FemModel::IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y){ /*{{{*/
+-
+-	/*Find the litho material to be used by all the elements:*/
+-	Matlitho* matlitho=NULL;
+-	for (Object* & object: this->materials->objects){
+-		Material* material=xDynamicCast<Material*>(object);
+-		if(material->ObjectEnum()==MatlithoEnum){
+-			matlitho=xDynamicCast<Matlitho*>(material);
+-			break;
+-		}
+-	}
+-	_assert_(matlitho);
+-
+-
+-	/*Go through elements, and add contribution from each element to the deflection vector wg:*/
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->GiaDeflection(wg,dwgdt, matlitho, x,y);
+-	}
+-}
+-/*}}}*/
+-#endif
+ #ifdef _HAVE_ESA_
+ void FemModel::EsaGeodetic2D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY, IssmDouble* xx, IssmDouble* yy){/*{{{*/
+ 
+@@ -5112,6 +5089,27 @@
+ 	return oceanvalue/oceanarea;
+ }
+ /*}}}*/
++void FemModel::IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y){ /*{{{*/
++
++	/*Find the litho material to be used by all the elements:*/
++	Matlitho* matlitho=NULL;
++	for (Object* & object: this->materials->objects){
++		Material* material=xDynamicCast<Material*>(object);
++		if(material->ObjectEnum()==MatlithoEnum){
++			matlitho=xDynamicCast<Matlitho*>(material);
++			break;
++		}
++	}
++	_assert_(matlitho);
++
++
++	/*Go through elements, and add contribution from each element to the deflection vector wg:*/
++	for(Object* & object : this->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->GiaDeflection(wg,dwgdt, matlitho, x,y);
++	}
++}
++/*}}}*/
+ #endif
+ void FemModel::HydrologyEPLupdateDomainx(IssmDouble* pEplcount){ /*{{{*/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26050-26051.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26050-26051.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26050-26051.diff	(revision 26740)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26050)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26051)
+@@ -564,7 +564,8 @@
+ 	./cores/sampling_core.cpp \
+ 	./analyses/SamplingAnalysis.cpp
+ endif
+-#Slr sources  {{{
++# }}}
++#Slc sources  {{{
+ if SEALEVELRISE
+ issm_sources += \
+ 	./cores/sealevelchange_core.cpp \
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26050)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26051)
+@@ -12,7 +12,6 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
+-
+ /*main cores:*/
+ void sealevelchange_core(FemModel* femmodel){ /*{{{*/
+ 
+@@ -63,7 +62,6 @@
+ 	femmodel->profiler->Stop(SLRCORE);
+ }
+ /*}}}*/
+-
+ void solidearthexternal_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*variables:*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26051-26052.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26051-26052.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26051-26052.diff	(revision 26740)
@@ -0,0 +1,396 @@
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 26051)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 26052)
+@@ -24,19 +24,18 @@
+ #define OCEANTRANSPORTCORE	11 /*Profiling OCEANTRANSPORT */
+ #define SMBCORE				12 /*Profiling SMB */
+ #define GROUNDINGLINECORE	13 /*Profiling GROUDINGLINE MIGRATION */
+-#define GIACORE				14 /*Profiling GIA */
+-#define ESACORE				15 /*Profiling ESA */
+-#define SLRCORE				16 /*Profiling SLR */
+-#define SAMPLINGCORE	17 /*Profiling SAMPLING */
+-#define MPISERIAL				18 /*Profiling MPISerial */
+-#define SEDLOOP				19 /*Profiling MPISerial */
+-#define SEDMatrix				20 /*Profiling MPISerial */
+-#define SEDUpdate				21 /*Profiling MPISerial */
+-#define EPLLOOP				22 /*Profiling MPISerial */
+-#define EPLMasking			23 /*Profiling MPISerial */
+-#define EPLMatrices			24 /*Profiling MPISerial */
+-#define EPLUpdate				25 /*Profiling MPISerial */
+-#define MAXPROFSIZE			26 /*Used to initialize static arrays*/
++#define ESACORE				14 /*Profiling ESA */
++#define SLRCORE				15 /*Profiling SLR */
++#define SAMPLINGCORE	16 /*Profiling SAMPLING */
++#define MPISERIAL				17 /*Profiling MPISerial */
++#define SEDLOOP				18 /*Profiling MPISerial */
++#define SEDMatrix				19 /*Profiling MPISerial */
++#define SEDUpdate				20 /*Profiling MPISerial */
++#define EPLLOOP				21 /*Profiling MPISerial */
++#define EPLMasking			22 /*Profiling MPISerial */
++#define EPLMatrices			23 /*Profiling MPISerial */
++#define EPLUpdate				24 /*Profiling MPISerial */
++#define MAXPROFSIZE			25 /*Used to initialize static arrays*/
+ 
+ 
+ class Profiler: public Object{
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26051)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26052)
+@@ -365,9 +365,6 @@
+ 		virtual void       ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not implemented yet");};
+ 		virtual void       WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue){_error_("not implemented yet");};
+ 
+-		#ifdef _HAVE_GIA_
+-		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+-		#endif
+ 		#ifdef _HAVE_ESA_
+ 		virtual void          EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy)=0;
+ 		virtual void          EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz)=0;
+@@ -384,6 +381,7 @@
+ 		virtual void          SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz)=0;
+ 		virtual void          SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0;
+ 		virtual void          DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
++		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26051)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26052)
+@@ -206,9 +206,6 @@
+ 
+ 		#endif
+ 
+-		#ifdef _HAVE_GIA_
+-		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		#endif
+ 		#ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+@@ -223,6 +220,7 @@
+ 		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
++		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 		#endif
+ 
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26051)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26052)
+@@ -162,9 +162,6 @@
+ 		IssmDouble     GetArea3D(void){_error_("not implemented yet!");};
+ 		IssmDouble     GetAreaSpherical(void){_error_("not implemented yet!");};
+ 
+-#ifdef _HAVE_GIA_
+-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-#endif
+ #ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+@@ -179,6 +176,7 @@
+ 		void    SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
++		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26051)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26052)
+@@ -168,9 +168,6 @@
+ 		void        VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");};
+ 		void        ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 
+-#ifdef _HAVE_GIA_
+-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-#endif
+ #ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+@@ -185,6 +182,7 @@
+ 		void    SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
++		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26051)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26052)
+@@ -5087,117 +5087,6 @@
+ }
+ /*}}}*/
+ 
+-#ifdef _HAVE_GIA_
+-void    Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
+-
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-
+-	/*gia solution parameters:*/
+-	IssmDouble ice_mask;
+-
+-	/*output: */
+-	IssmDouble  wi;
+-	IssmDouble  dwidt;
+-
+-	/*arguments to GiaDeflectionCorex: */
+-	GiaDeflectionCoreArgs arguments;
+-
+-	/*how many dofs are we working with here? */
+-	int gsize;
+-	IssmDouble yts;
+-	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+-	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-	
+-	/*recover gia solution parameters: */
+-	int cross_section_shape;
+-	this->parameters->FindParam(&cross_section_shape,SolidearthSettingsCrossSectionShapeEnum);
+-
+-	/*what time is it? :*/
+-	IssmDouble currenttime;
+-	this->parameters->FindParam(&currenttime,TimeEnum);
+-
+-	/*recover material parameters: */
+-	IssmDouble rho_ice                   = FindParam(MaterialsRhoIceEnum);
+-	
+-	/*recover mantle and lithosphere material properties:*/
+-	int numlayers=litho->numlayers;
+-
+-	/*lithosphere is the last layer, mantle is the penultimate layer. Watch out, radius represents the layers 
+-	 *from center to surface of the Earth:*/
+-	IssmDouble lithosphere_thickness = litho->radius[numlayers] - litho->radius[numlayers-1];
+-	IssmDouble lithosphere_shear_modulus = litho->lame_mu[numlayers-1];
+-	IssmDouble lithosphere_density = litho->density[numlayers-1];
+-	IssmDouble mantle_shear_modulus = litho->lame_mu[numlayers-2];
+-	IssmDouble mantle_density = litho->density[numlayers-2];
+-	IssmDouble mantle_viscosity = litho->viscosity[numlayers-2];
+-
+-	/*early return if we are NOT on an icy element:*/
+-	if(!IsIceInElement()) return;
+-
+-	/*pull thickness averages! */
+-	IssmDouble *hes      = NULL;
+-	IssmDouble *times    = NULL;
+-	int         numtimes;
+-	this->GetInputAveragesUpToCurrentTime(TransientAccumulatedDeltaIceThicknessEnum,&hes,&times,&numtimes,currenttime);
+-
+-	if(this->Id()==1){
+-		_printf_("numtimes: " << numtimes << "\n");
+-		for (int i=0;i<numtimes;i++)_printf_(times[i] << " " << hes[i] << "\n");
+-	}
+-
+-	/*pull area of this Tria: */
+-	IssmDouble area=this->GetArea();
+-
+-	/*element radius: */
+-	IssmDouble re=sqrt(area/PI);
+-
+-	/*figure out gravity center of our element: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	IssmDouble x0=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+-	IssmDouble y0=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+-
+-	/*start loading GiaDeflectionCore arguments: */
+-	arguments.re=re;
+-	arguments.hes=hes;
+-	arguments.times=times;
+-	arguments.numtimes=numtimes;
+-	arguments.currenttime=currenttime;
+-	arguments.lithosphere_shear_modulus=lithosphere_shear_modulus;
+-	arguments.lithosphere_density=lithosphere_density;
+-	arguments.mantle_shear_modulus=mantle_shear_modulus;
+-	arguments.mantle_viscosity=mantle_viscosity;
+-	arguments.mantle_density=mantle_density;
+-	arguments.lithosphere_thickness=lithosphere_thickness;
+-	arguments.rho_ice=rho_ice;
+-	arguments.idisk=this->id;
+-	arguments.iedge=cross_section_shape;
+-	arguments.yts=yts;
+-
+-	for(int i=0;i<gsize;i++){
+-		/*compute distance from the center of the tria to the vertex i: */
+-		IssmDouble xi=x[i];
+-		IssmDouble yi=y[i];
+-		IssmDouble ri=sqrt(pow(xi-x0,2)+pow(yi-y0,2));
+-
+-		/*load ri onto arguments for this vertex i: */
+-		arguments.ri=ri;
+-
+-		/*for this Tria, compute contribution to rebound at vertex i: */
+-		GiaDeflectionCorex(&wi,&dwidt,&arguments);
+-
+-		/*plug value into solution vector: */
+-		wg->SetValue(i,wi,ADD_VAL);
+-		dwgdt->SetValue(i,dwidt,ADD_VAL);
+-	}
+-
+-	/*Free ressources: */
+-	xDelete<IssmDouble>(hes);
+-	xDelete<IssmDouble>(times);
+-
+-	return;
+-}
+-/*}}}*/
+-#endif
+ #ifdef _HAVE_ESA_
+ void    Tria::EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){ /*{{{*/
+ 
+@@ -6194,6 +6083,115 @@
+ 	return;
+ }
+ /*}}}*/
++void    Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
++
++	IssmDouble xyz_list[NUMVERTICES][3];
++
++	/*gia solution parameters:*/
++	IssmDouble ice_mask;
++
++	/*output: */
++	IssmDouble  wi;
++	IssmDouble  dwidt;
++
++	/*arguments to GiaDeflectionCorex: */
++	GiaDeflectionCoreArgs arguments;
++
++	/*how many dofs are we working with here? */
++	int gsize;
++	IssmDouble yts;
++	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
++	this->parameters->FindParam(&yts,ConstantsYtsEnum);
++	
++	/*recover gia solution parameters: */
++	int cross_section_shape;
++	this->parameters->FindParam(&cross_section_shape,SolidearthSettingsCrossSectionShapeEnum);
++
++	/*what time is it? :*/
++	IssmDouble currenttime;
++	this->parameters->FindParam(&currenttime,TimeEnum);
++
++	/*recover material parameters: */
++	IssmDouble rho_ice                   = FindParam(MaterialsRhoIceEnum);
++	
++	/*recover mantle and lithosphere material properties:*/
++	int numlayers=litho->numlayers;
++
++	/*lithosphere is the last layer, mantle is the penultimate layer. Watch out, radius represents the layers 
++	 *from center to surface of the Earth:*/
++	IssmDouble lithosphere_thickness = litho->radius[numlayers] - litho->radius[numlayers-1];
++	IssmDouble lithosphere_shear_modulus = litho->lame_mu[numlayers-1];
++	IssmDouble lithosphere_density = litho->density[numlayers-1];
++	IssmDouble mantle_shear_modulus = litho->lame_mu[numlayers-2];
++	IssmDouble mantle_density = litho->density[numlayers-2];
++	IssmDouble mantle_viscosity = litho->viscosity[numlayers-2];
++
++	/*early return if we are NOT on an icy element:*/
++	if(!IsIceInElement()) return;
++
++	/*pull thickness averages! */
++	IssmDouble *hes      = NULL;
++	IssmDouble *times    = NULL;
++	int         numtimes;
++	this->GetInputAveragesUpToCurrentTime(TransientAccumulatedDeltaIceThicknessEnum,&hes,&times,&numtimes,currenttime);
++
++	if(this->Id()==1){
++		_printf_("numtimes: " << numtimes << "\n");
++		for (int i=0;i<numtimes;i++)_printf_(times[i] << " " << hes[i] << "\n");
++	}
++
++	/*pull area of this Tria: */
++	IssmDouble area=this->GetArea();
++
++	/*element radius: */
++	IssmDouble re=sqrt(area/PI);
++
++	/*figure out gravity center of our element: */
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++	IssmDouble x0=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
++	IssmDouble y0=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
++
++	/*start loading GiaDeflectionCore arguments: */
++	arguments.re=re;
++	arguments.hes=hes;
++	arguments.times=times;
++	arguments.numtimes=numtimes;
++	arguments.currenttime=currenttime;
++	arguments.lithosphere_shear_modulus=lithosphere_shear_modulus;
++	arguments.lithosphere_density=lithosphere_density;
++	arguments.mantle_shear_modulus=mantle_shear_modulus;
++	arguments.mantle_viscosity=mantle_viscosity;
++	arguments.mantle_density=mantle_density;
++	arguments.lithosphere_thickness=lithosphere_thickness;
++	arguments.rho_ice=rho_ice;
++	arguments.idisk=this->id;
++	arguments.iedge=cross_section_shape;
++	arguments.yts=yts;
++
++	for(int i=0;i<gsize;i++){
++		/*compute distance from the center of the tria to the vertex i: */
++		IssmDouble xi=x[i];
++		IssmDouble yi=y[i];
++		IssmDouble ri=sqrt(pow(xi-x0,2)+pow(yi-y0,2));
++
++		/*load ri onto arguments for this vertex i: */
++		arguments.ri=ri;
++
++		/*for this Tria, compute contribution to rebound at vertex i: */
++		GiaDeflectionCorex(&wi,&dwidt,&arguments);
++
++		/*plug value into solution vector: */
++		wg->SetValue(i,wi,ADD_VAL);
++		dwgdt->SetValue(i,dwidt,ADD_VAL);
++	}
++
++	/*Free ressources: */
++	xDelete<IssmDouble>(hes);
++	xDelete<IssmDouble>(times);
++
++	return;
++}
++/*}}}*/
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26051)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26052)
+@@ -153,9 +153,6 @@
+ 		void        VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");};
+ 		void			WriteFieldIsovalueSegment(DataSet* segments,int fieldenum,IssmDouble fieldvalue);
+ 
+-		#ifdef _HAVE_GIA_
+-		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+-		#endif
+ 		#ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,  Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy);
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz);
+@@ -170,6 +167,7 @@
+ 		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
+ 		void    SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
++		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26051)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26052)
+@@ -980,7 +980,6 @@
+ 		if(profiler->Used(MASSTRANSPORTCORE)) _printf0_("   "<<setw(40)<<left<<"Mass transport core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MASSTRANSPORTCORE) << " sec\n");
+ 		if(profiler->Used(SMBCORE)) _printf0_("   "<<setw(40)<<left<<"SMB core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(SMBCORE) << " sec\n");
+ 		if(profiler->Used(GROUNDINGLINECORE)) _printf0_("   "<<setw(40)<<left<<"Groundingline migration core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(GROUNDINGLINECORE) << " sec\n");
+-		if(profiler->Used(GIACORE)) _printf0_("   "<<setw(40)<<left<<"GIA core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(GIACORE) << " sec\n");
+ 		if(profiler->Used(ESACORE)) _printf0_("   "<<setw(40)<<left<<"ESA core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(ESACORE) << " sec\n");
+ 		if(profiler->Used(SLRCORE)) _printf0_("   "<<setw(40)<<left<<"SLR core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(SLRCORE) << " sec\n");
+ 		if(profiler->Used(MPISERIAL)) _printf0_("   "<<setw(40)<<left<<"MPISERIAL elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MPISERIAL) << " sec\n");
Index: /issm/oecreview/Archive/25834-26739/ISSM-26052-26053.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26052-26053.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26052-26053.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/test/Par/ValleyGlacierShelf.par
+===================================================================
+--- ../trunk-jpl/test/Par/ValleyGlacierShelf.par	(revision 26052)
++++ ../trunk-jpl/test/Par/ValleyGlacierShelf.par	(revision 26053)
+@@ -64,7 +64,6 @@
+ md.transient.ismasstransport = 0;
+ md.transient.isthermal = 0;
+ md.transient.isgroundingline = 1;
+-md.transient.isgia = 0;
+ 
+ %Stressbalance
+ md.stressbalance.maxiter = 100;
+Index: ../trunk-jpl/test/Par/ValleyGlacierShelf.py
+===================================================================
+--- ../trunk-jpl/test/Par/ValleyGlacierShelf.py	(revision 26052)
++++ ../trunk-jpl/test/Par/ValleyGlacierShelf.py	(revision 26053)
+@@ -69,7 +69,6 @@
+ md.transient.ismasstransport = False
+ md.transient.isthermal = False
+ md.transient.isgroundingline = True
+-md.transient.isgia = False
+ 
+ #Stressbalance
+ md.stressbalance.maxiter = 100
Index: /issm/oecreview/Archive/25834-26739/ISSM-26053-26054.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26053-26054.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26053-26054.diff	(revision 26740)
@@ -0,0 +1,264 @@
+Index: ../trunk-jpl/test/NightlyRun/test2005.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2005.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test2005.py	(revision 26054)
+@@ -85,7 +85,6 @@
+ md.timestepping.time_step = 1
+ md.transient.isslc = 1
+ md.transient.issmb = 0
+-md.transient.isgia = 1
+ md.transient.ismasstransport = 0
+ md.transient.isstressbalance = 0
+ md.transient.isthermal = 0
+Index: ../trunk-jpl/test/NightlyRun/test2006.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test2006.py	(revision 26054)
+@@ -88,7 +88,6 @@
+ md.timestepping.time_step = 1
+ md.transient.isslc = 1
+ md.transient.issmb = 0
+-md.transient.isgia = 1
+ md.transient.ismasstransport = 0
+ md.transient.isstressbalance = 0
+ md.transient.isthermal = 0
+Index: ../trunk-jpl/test/NightlyRun/test801.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test801.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test801.m	(revision 26054)
+@@ -13,7 +13,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=0;
+ md.transient.isgroundingline=1;
+-md.transient.isgia=0;
+ 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test801.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test801.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test801.py	(revision 26054)
+@@ -21,7 +21,6 @@
+ md.transient.issmb = True
+ md.transient.isthermal = False
+ md.transient.isgroundingline = True
+-md.transient.isgia = False
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test802.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test802.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test802.m	(revision 26054)
+@@ -17,7 +17,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=1;
+ md.transient.isgroundingline=1;
+-md.transient.isgia=0;
+ md.groundingline.melt_interpolation='SubelementMelt1';
+ 
+ md=solve(md,'Transient');
+Index: ../trunk-jpl/test/NightlyRun/test802.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test802.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test802.py	(revision 26054)
+@@ -26,7 +26,6 @@
+ 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')
+Index: ../trunk-jpl/test/NightlyRun/test803.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test803.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test803.m	(revision 26054)
+@@ -19,7 +19,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=1;
+ md.transient.isgroundingline=1;
+-md.transient.isgia=0;
+ md.groundingline.melt_interpolation='SubelementMelt1';
+ 
+ md=solve(md,'Transient');
+Index: ../trunk-jpl/test/NightlyRun/test803.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test803.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test803.py	(revision 26054)
+@@ -28,7 +28,6 @@
+ 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')
+Index: ../trunk-jpl/test/NightlyRun/test804.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test804.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test804.m	(revision 26054)
+@@ -11,7 +11,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=0;
+ md.transient.isgroundingline=1;
+-md.transient.isgia=0;
+ md.transient.ismovingfront=1;
+ 
+ md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test804.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test804.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test804.py	(revision 26054)
+@@ -21,7 +21,6 @@
+ 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))
+Index: ../trunk-jpl/test/NightlyRun/test805.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test805.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test805.m	(revision 26054)
+@@ -18,7 +18,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=1;
+ md.transient.isgroundingline=1;
+-md.transient.isgia=0;
+ md.transient.ismovingfront=1;
+ 
+ md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test805.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test805.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test805.py	(revision 26054)
+@@ -28,7 +28,6 @@
+ 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))
+Index: ../trunk-jpl/test/NightlyRun/test806.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test806.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test806.m	(revision 26054)
+@@ -24,7 +24,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=0;
+ md.transient.isgroundingline=0;
+-md.transient.isgia=0;
+ md.transient.ismovingfront=1;
+ 
+ md.calving=calvinglevermann();
+Index: ../trunk-jpl/test/NightlyRun/test806.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test806.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test806.py	(revision 26054)
+@@ -33,7 +33,6 @@
+ md.transient.issmb = True
+ md.transient.isthermal = False
+ md.transient.isgroundingline = False
+-md.transient.isgia = False
+ md.transient.ismovingfront = True
+ 
+ md.calving = calvinglevermann()
+Index: ../trunk-jpl/test/NightlyRun/test807.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test807.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test807.m	(revision 26054)
+@@ -24,7 +24,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=0;
+ md.transient.isgroundingline=0;
+-md.transient.isgia=0;
+ md.transient.ismovingfront=1;
+ 
+ md.calving.calvingrate=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test807.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test807.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test807.py	(revision 26054)
+@@ -34,7 +34,6 @@
+ 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))
+Index: ../trunk-jpl/test/NightlyRun/test808.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test808.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test808.m	(revision 26054)
+@@ -24,7 +24,6 @@
+ md.transient.issmb=1;
+ md.transient.isthermal=0;
+ md.transient.isgroundingline=0;
+-md.transient.isgia=0;
+ md.transient.ismovingfront=1;
+ 
+ md.calving=calvingminthickness();
+Index: ../trunk-jpl/test/NightlyRun/test808.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test808.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test808.py	(revision 26054)
+@@ -34,7 +34,6 @@
+ md.transient.issmb = 1
+ md.transient.isthermal = 0
+ md.transient.isgroundingline = 0
+-md.transient.isgia = 0
+ md.transient.ismovingfront = 1
+ 
+ md.calving = calvingminthickness()
+Index: ../trunk-jpl/test/NightlyRun/test809.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test809.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test809.m	(revision 26054)
+@@ -14,7 +14,6 @@
+ 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;
+Index: ../trunk-jpl/test/NightlyRun/test809.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test809.py	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test809.py	(revision 26054)
+@@ -24,7 +24,6 @@
+ 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
+Index: ../trunk-jpl/test/NightlyRun/test2005.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2005.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test2005.m	(revision 26054)
+@@ -73,7 +73,6 @@
+ md.timestepping.time_step=1;
+ md.transient.isslc=1;
+ md.transient.issmb=0;
+-md.transient.isgia=1;
+ md.transient.ismasstransport=0;
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+Index: ../trunk-jpl/test/NightlyRun/test2006.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.m	(revision 26053)
++++ ../trunk-jpl/test/NightlyRun/test2006.m	(revision 26054)
+@@ -74,7 +74,6 @@
+ md.timestepping.time_step=1;
+ md.transient.isslc=1;
+ md.transient.issmb=0;
+-md.transient.isgia=1;
+ md.transient.ismasstransport=0;
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26054-26055.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26054-26055.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26054-26055.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/cores/esa_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 26054)
++++ ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 26055)
+@@ -19,7 +19,8 @@
+ 	Vector<IssmDouble> *U_east    = NULL; 
+ 	Vector<IssmDouble> *U_x   = NULL; 
+ 	Vector<IssmDouble> *U_y    = NULL; 
+-	bool save_results,isesa,iscoupler;
++	bool save_results,isesa;
++	int iscoupler;
+ 	int domaintype;
+ 	int solution_type;
+ 	int        numoutputs        = 0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26055-26056.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26055-26056.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26055-26056.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26055)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26056)
+@@ -6178,7 +6178,11 @@
+ 		arguments.ri=ri;
+ 
+ 		/*for this Tria, compute contribution to rebound at vertex i: */
++		#ifdef _HAVE_GIA_
+ 		GiaDeflectionCorex(&wi,&dwidt,&arguments);
++		#else
++		_error_("ISSM compiled without GIA capabilities");
++		#endif
+ 
+ 		/*plug value into solution vector: */
+ 		wg->SetValue(i,wi,ADD_VAL);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26056-26057.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26056-26057.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26056-26057.diff	(revision 26740)
@@ -0,0 +1,283 @@
+Index: ../trunk-jpl/src/c/main/esmfbinders.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/esmfbinders.cpp	(revision 26056)
++++ ../trunk-jpl/src/c/main/esmfbinders.cpp	(revision 26057)
+@@ -152,6 +152,10 @@
+ 		delete femmodel; femmodel=NULL;
+ 	} /*}}}*/
+ 
++	/*TODO: we need 2 initialize routines, the second one will be empty for now
++	 * In: ESMF config, ESMF Field bundle
++	 */
++
+ 	/*FISOC*/
+ 	void InitializeISSM_FISOC(int argc, char** argv,ISSM_MPI_Comm comm_init){ /*{{{*/
+ 
+@@ -164,17 +168,15 @@
+ 
+ 		/*Initialize ESMC Mesh*/
+ 		int pdim;        /*parametric dimension is the same as the domain dimensions */
+-		int sdim = 3;    /*coordinates of each vertex is always 2  (just x,y for now) */
++		int sdim = 2;    /*coordinates of each vertex is always 2  (just x,y for now) */
+ 		ESMC_CoordSys_Flag coordsys = ESMC_COORDSYS_CART; /*Cartesian coordinate system by default */
+ 		femmodel->parameters->FindParam(&pdim,DomainDimensionEnum);
+ 		ESMC_Mesh mesh = ESMC_MeshCreate(pdim,sdim,&coordsys,&rc);
+ 		if(rc!=ESMF_SUCCESS) _error_("could not create EMSC_Mesh");
+ 
+-		/*How to install ESMG with lib/libesmf.so
+-		 * do indices need to be 1 based?
+-		 * ESMF installation, how can we get everything in /lib
++		/*
+ 		 * What do we do with vertices at the boundary, declare twice?
+-		 * Do we need a restart file or save femmodel somewhere?*/
++		 * */
+ 
+ 		/*Add nodes (which are ISSM Vertices)*/
+ 		int numnodes = femmodel->vertices->Size();
+@@ -181,7 +183,7 @@
+ 		int        *nodeId    = xNew<int>(numnodes);
+ 		int        *nodeOwner = xNew<int>(numnodes);
+ 		IssmDouble *nodeCoord = xNew<IssmDouble>(sdim*numnodes);
+-		for (int i=0;i<femmodel->elements->Size();i++){
++		for (int i=0;i<femmodel->vertices->Size();i++){
+ 			Vertex* vertex = xDynamicCast<Vertex*>(femmodel->vertices->GetObjectByOffset(i));
+ 			nodeId[i]           = vertex->Sid()+1;
+          nodeOwner[i]        = rank;
+@@ -212,13 +214,6 @@
+ 		xDelete<int>(elemType);
+ 		xDelete<int>(elemConn);
+ 
+-		/*DO we need to create fields here? https://earthsystemmodeling.org/docs/nightly/develop/ESMC_crefdoc/node5.html#SECTION05024400000000000000*/
+-		//ESMC_InterArrayInt *gridToFieldMap,       // in
+-		//ESMC_InterArrayInt *ungriddedLBound,      // in
+-		//ESMC_InterArrayInt *ungriddedUBound,      // in
+-		//ESMC_Field esmf_shelfbase = ESMC_FieldCreateMeshTypeKind(mesh,ESMC_TYPEKIND_R8,???,gridToFieldMap,ungriddedLBound,ungriddedUBound,"ShelfTopography",&rc);
+-		if(rc!=ESMF_SUCCESS) _error_("could not create EMSC_Field");
+-
+ 		/*Create restart file for later */
+ 		femmodel->Restart();
+ 	} /*}}}*/
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26056)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26057)
+@@ -971,6 +971,7 @@
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(newthickness);
+ 	xDelete<IssmDouble>(cumdeltathickness);
++	xDelete<IssmDouble>(deltathickness);
+ 	xDelete<IssmDouble>(newbase);
+ 	xDelete<IssmDouble>(newsurface);
+ 	xDelete<IssmDouble>(oldthickness);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26056)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26057)
+@@ -2309,7 +2309,7 @@
+ 			values[i]=0;
+ 		}
+ 		else{
+-			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness)*(upperdepthmelt-base[i]);
++			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness);//*(upperdepthmelt-base[i]);
+ 		}
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26056)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26057)
+@@ -2960,7 +2960,7 @@
+ 					}
+ 					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(M_PI*(groundedice-calvinghaf)/haf_eps)/(2.*M_PI);
+ 						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
+ 						meltingrate=heaviside*meltingrate+0.;
+ 					}
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26056)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26057)
+@@ -1511,14 +1511,14 @@
+ 
+ 	/*retrieve coordinates: lat,long,radius */
+ 	::GetVerticesCoordinates(&llr_list[0][0],vertices,NUMVERTICES,spherical);
+-	x1=llr_list[0][0]/180*PI; y1=llr_list[0][1]/180*PI; z1=llr_list[0][2];
+-	x2=llr_list[1][0]/180*PI; y2=llr_list[1][1]/180*PI; z2=llr_list[1][2];
+-	x3=llr_list[2][0]/180*PI; y3=llr_list[2][1]/180*PI; z3=llr_list[2][2];
++	x1=llr_list[0][0]/180.*M_PI; y1=llr_list[0][1]/180.*M_PI; z1=llr_list[0][2];
++	x2=llr_list[1][0]/180.*M_PI; y2=llr_list[1][1]/180.*M_PI; z2=llr_list[1][2];
++	x3=llr_list[2][0]/180.*M_PI; y3=llr_list[2][1]/180.*M_PI; z3=llr_list[2][2];
+ 
+ 	/*compute great circle distance between vertices */
+-	arc12=2.*asin(sqrt(pow(sin((x2-x1)/2),2.0)+cos(x1)*cos(x2)*pow(sin((y2-y1)/2),2)));
+-	arc23=2.*asin(sqrt(pow(sin((x3-x2)/2),2.0)+cos(x2)*cos(x3)*pow(sin((y3-y2)/2),2)));
+-	arc31=2.*asin(sqrt(pow(sin((x1-x3)/2),2.0)+cos(x3)*cos(x1)*pow(sin((y1-y3)/2),2)));
++	arc12=2.*asin(sqrt(pow(sin(0.5*(x2-x1)),2)+cos(x1)*cos(x2)*pow(sin(0.5*(y2-y1)),2)));
++	arc23=2.*asin(sqrt(pow(sin(0.5*(x3-x2)),2)+cos(x2)*cos(x3)*pow(sin(0.5*(y3-y2)),2)));
++	arc31=2.*asin(sqrt(pow(sin(0.5*(x1-x3)),2)+cos(x3)*cos(x1)*pow(sin(0.5*(y1-y3)),2)));
+ 
+ 	/*semi parameter */
+ 	semi_peri=(arc12+arc23+arc31)/2;
+@@ -2118,6 +2118,7 @@
+ 	}
+ 
+ 	/*Assign output pointers*/
++	xDelete<IssmDouble>(timesteps);
+ 	*pvalues=values;
+ 	*ptimes=times;
+ 	*pnumtimes=numtimesteps;
+@@ -3640,7 +3641,7 @@
+ 					}
+ 					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.*M_PI);
+ 						calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
+ 						meltingrate=heaviside*meltingrate+0.;
+ 					}
+@@ -5172,30 +5173,30 @@
+ 		/*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
++		alpha = dist*360.0/(2*M_PI*earth_radius) * M_PI/180.0;	// [in radians] 360 degree = 2*pi*earth_radius
+ 
+ 		/*Compute azimuths, both north and east components: */
+-		ang = PI/2 - atan2(dy,dx);		// this is bearing angle!
++		ang = M_PI/2 - atan2(dy,dx);		// this is bearing angle!
+ 		Y_azim = cos(ang);
+ 		X_azim = sin(ang);
+ 
+ 		/*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
+-		int index=reCast<int,IssmDouble>(alpha/PI*(M-1));
++		int index=reCast<int,IssmDouble>(alpha/M_PI*(M-1));
+ 		U_elastic[i] += U_elastic_precomputed[index];
+ 		Y_elastic[i] += H_elastic_precomputed[index]*Y_azim;
+ 		X_elastic[i] += H_elastic_precomputed[index]*X_azim;
+ 
+ 		/*Add all components to the pUp solution vectors:*/
+-		U_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*U_elastic[i];
+-		Y_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*Y_elastic[i];
+-		X_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*X_elastic[i];
++		U_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*U_elastic[i];
++		Y_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*Y_elastic[i];
++		X_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*X_elastic[i];
+ 
+ 		/*North-south, East-west components */
+ 		if (hemi == -1) {
+-			ang2 = PI/2 - atan2(yy[i],xx[i]);
++			ang2 = M_PI/2 - atan2(yy[i],xx[i]);
+ 		}
+ 		else if (hemi == 1) {
+-			ang2 = PI/2 - atan2(-yy[i],-xx[i]);
++			ang2 = M_PI/2 - atan2(-yy[i],-xx[i]);
+ 		}
+ 		if (hemi != 0){
+ 			N_azim = Y_azim*cos(ang2) + X_azim*sin(ang2);
+@@ -5202,8 +5203,8 @@
+ 			E_azim = X_azim*cos(ang2) - Y_azim*sin(ang2);
+ 			N_elastic[i] += H_elastic_precomputed[index]*N_azim;
+ 			E_elastic[i] += H_elastic_precomputed[index]*E_azim;
+-			N_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*N_elastic[i];
+-			E_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*E_elastic[i];
++			N_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*N_elastic[i];
++			E_values[i]+=3*rho_ice/rho_earth*area/(4*M_PI*pow(earth_radius,2))*I*E_elastic[i];
+ 		}
+ 	}
+ 
+@@ -5307,8 +5308,8 @@
+ 	late=90-late;
+ 	if(longe>180)longe=longe-360;
+ 
+-	late=late/180*PI;
+-	longe=longe/180*PI;
++	late=late/180.*M_PI;
++	longe=longe/180.*M_PI;
+ 	/*}}}*/
+ 
+ 	/*figure out gravity center of our element (Cartesian): */
+@@ -5343,7 +5344,7 @@
+ 		indices[i]=i;
+ 
+ 		/*Compute alpha angle between centroid and current vertex: */
+-		lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
++		lati=latitude[i]/180.*M_PI; longi=longitude[i]/180.*M_PI;
+ 
+ 		delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
+ 		alpha=2.*asin(sqrt(pow(sin(delPhi/2),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+@@ -5361,7 +5362,7 @@
+ 		E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+ 
+ 		/*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
+-		int index=reCast<int,IssmDouble>(alpha/PI*(M-1));
++		int index=reCast<int,IssmDouble>(alpha/M_PI*(M-1));
+ 		U_elastic[i] += U_elastic_precomputed[index];
+ 		N_elastic[i] += H_elastic_precomputed[index]*N_azim;
+ 		E_elastic[i] += H_elastic_precomputed[index]*E_azim;
+@@ -5454,11 +5455,11 @@
+ 	late=(llr_list[0][0]+llr_list[1][0]+llr_list[2][0])/3.0;
+ 	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
+ 
+-	late=90-late;
+-	if(longe>180)longe=(longe-180)-180;
++	late=90.-late;
++	if(longe>180.)longe=(longe-180.)-180.;
+ 
+-	late=late/180*PI;
+-	longe=longe/180*PI;
++	late=late/180.*M_PI;
++	longe=longe/180.*M_PI;
+ 	/*}}}*/
+ 	re=(llr_list[0][2]+llr_list[1][2]+llr_list[2][2])/3.0;
+ 
+@@ -5476,9 +5477,9 @@
+ 		 * also consistent with my GMD formulation!
+ 		 * ALL in geographic coordinates
+ 		 * */
+-		dI_list[0] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+-		dI_list[1] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+-		dI_list[2] = +4*PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
++		dI_list[0] = -4*M_PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
++		dI_list[1] = -4*M_PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
++		dI_list[2] = +4*M_PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	}
+ 	else if(masks->isiceonly[this->lid]){
+ 		IssmDouble rho_ice, I;
+@@ -5491,9 +5492,9 @@
+ 		if (!deltathickness_input)_error_("DeltaIceThicknessEnum delta ice thickness input needed to compute sea level change!");
+ 		deltathickness_input->GetInputAverage(&I);
+ 
+-		dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+-		dI_list[1] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+-		dI_list[2] = +4*PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
++		dI_list[0] = -4*M_PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
++		dI_list[1] = -4*M_PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
++		dI_list[2] = +4*M_PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	}
+ 
+ 	return;
+@@ -5620,10 +5621,10 @@
+ 		IssmDouble delPhi,delLambda;
+ 
+ 		/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+-		lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
+-		delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>PI)delLambda=2*PI-delLambda;
++		lati=latitude[i]/180.*M_PI; longi=longitude[i]/180.*M_PI;
++		delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+ 		alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+-		indices[i]=alpha/PI*reCast<IssmDouble,int>(M-1);
++		indices[i]=alpha/M_PI*reCast<IssmDouble,int>(M-1);
+ 		index=reCast<int,IssmDouble>(indices[i]);
+ 
+ 		/*Rigid earth gravitational perturbation: */
+@@ -6144,7 +6145,7 @@
+ 	IssmDouble area=this->GetArea();
+ 
+ 	/*element radius: */
+-	IssmDouble re=sqrt(area/PI);
++	IssmDouble re=sqrt(area/M_PI);
+ 
+ 	/*figure out gravity center of our element: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26057-26058.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26057-26058.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26057-26058.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26057)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26058)
+@@ -2309,7 +2309,7 @@
+ 			values[i]=0;
+ 		}
+ 		else{
+-			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness);//*(upperdepthmelt-base[i]);
++			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness)*(upperdepthmelt-base[i]);
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26058-26059.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26058-26059.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26058-26059.diff	(revision 26740)
@@ -0,0 +1,2304 @@
+Index: ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 26058)
++++ ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m	(revision 26059)
+@@ -30,10 +30,10 @@
+ 
+ %Initialize surface and basal forcings
+ md.smb = initialize(md.smb,md);
+-md.basalforcings   = initialize(md.basalforcings,md);
++md.basalforcings = initialize(md.basalforcings,md);
+ 
+ %Initialize ocean forcings and sealevel
+-md.dsl= initialize(md.dsl,md);
++md.dsl = initialize(md.dsl,md);
+ 
+ %Deal with other boundary conditions
+ if isnan(md.balancethickness.thickening_rate),
+Index: ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26058)
++++ ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26059)
+@@ -2,13 +2,12 @@
+ 
+ 
+ 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
+@@ -32,10 +31,13 @@
+ 
+     #No ice front -> do nothing
+ 
+-    #Create zeros basalforcings and smb
++    #Initialize surface and basal forcings
+     md.smb.initialize(md)
+     md.basalforcings.initialize(md)
+ 
++    #Initialize ocean forcings and sealevel
++    md.dsl.initialize(md)
++
+     #Deal with other boundary conditions
+     if np.all(np.isnan(md.balancethickness.thickening_rate)):
+         md.balancethickness.thickening_rate = np.zeros((md.mesh.numberofvertices))
+Index: ../trunk-jpl/src/m/classes/hydrologydc.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologydc.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/hydrologydc.py	(revision 26059)
+@@ -6,11 +6,10 @@
+ 
+ 
+ class hydrologydc(object):
+-    """
+-    Hydrologydc class definition
++    """HYDROLOGYDC class definition
+ 
+     Usage:
+-            hydrologydc = hydrologydc()
++        hydrologydc = hydrologydc()
+     """
+ 
+     def __init__(self):  # {{{
+@@ -48,11 +47,14 @@
+         self.epl_conductivity = 0
+         self.eplflip_lock = 0
+ 
+-    #set defaults
+         self.setdefaultparameters()
+     # }}}
+ 
+     def __repr__(self):  # {{{
++        # TODO:
++        # - Convert all formatting to calls to <string>.format (see any 
++        #   already converted <class>.__repr__ method for examples)
++        #
+         string = '   hydrology Dual Porous Continuum Equivalent parameters:'
+         string = ' - general parameters'
+         string = "%s\n%s" % (string, fielddisplay(self, 'water_compressibility', 'compressibility of water [Pa^ - 1]'))
+Index: ../trunk-jpl/src/m/classes/hydrologytws.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologytws.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/hydrologytws.m	(revision 26059)
+@@ -23,7 +23,7 @@
+ 		end % }}}
+ 		function list = defaultoutputs(self,md) % {{{
+ 			list = {''};
+-		end % }}}    
++		end % }}}
+ 
+ 		function self = setdefaultparameters(self) % {{{
+ 			self.requested_outputs = {'default'};
+@@ -45,16 +45,16 @@
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-      outputs = self.requested_outputs;
+-      pos  = find(ismember(outputs,'default'));
+-      if ~isempty(pos),
+-        outputs(pos) = [];  %remove 'default' from outputs
+-        outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+-      end
+-      WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
++			outputs = self.requested_outputs;
++			pos  = find(ismember(outputs,'default'));
++			if ~isempty(pos),
++				outputs(pos) = [];  %remove 'default' from outputs
++				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
++			end
++			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+-		
++
+ 			writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn);
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/hydrologytws.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologytws.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/hydrologytws.py	(revision 26059)
+@@ -0,0 +1,64 @@
++import numpy as np
++
++from structtoobj import structtoobj
++
++class hydrologytws(object):
++    """HYDROLOGYTWS class definition
++
++    Usage:
++        hydrologytws = hydrologytws()
++    """
++
++    def __init__(self):  # {{{
++        self.spcwatercolumn = np.nan
++        self.requested_outputs = np.nan
++
++        nargs = len(args)
++        if nargs == 0:
++            self.setdefaultparameters()
++        elif nargs == 1:
++            self = structtoobj(self, args[0])
++        else:
++            raise RuntimeError('constructor not supported')
++    #}}}
++
++    def __repr__(self):  # {{{
++        s = '   hydrologytws solution parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
++        return s
++    #}}}
++
++    def defaultoutputs(self, md): # {{{
++        return ['']
++    #}}}
++
++    def setdefaultparameters(self):  # {{{
++        self.requested_outputs = ['defualt']
++        return self
++    #}}}
++
++    def extrude(self, md):  # {{{
++        return self
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        # Early return
++        if 'HydrologyTwsAnalysis' not in analyses:
++            return
++        md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
++    #}}}
++
++    def marshall(self, prefix, md, fid):  # {{{
++        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++        outputs = self.requested_outputs
++        pos  = find(ismember(outputs,'default'))
++        if not len(pos),
++            outputs[pos] = [];  # remove 'default' from outputs
++            outputs.extend(defaultoutputs(self, md)) # add defaults
++        end
++        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
++    # }}}
++
++
+Index: ../trunk-jpl/src/m/classes/matenhancedice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 26059)
+@@ -5,26 +5,26 @@
+ 
+ classdef matenhancedice
+ 	properties (SetAccess=public) 
+-		rho_ice                    = 0.;
+-		rho_water                  = 0.;
+-		rho_freshwater             = 0.;
+-		mu_water                   = 0.;
+-		heatcapacity               = 0.;
+-		latentheat                 = 0.;
+-		thermalconductivity        = 0.;
+-		temperateiceconductivity   = 0.;
++		rho_ice                         = 0.;
++		rho_water                       = 0.;
++		rho_freshwater                  = 0.;
++		mu_water                        = 0.;
++		heatcapacity                    = 0.;
++		latentheat                      = 0.;
++		thermalconductivity             = 0.;
++		temperateiceconductivity        = 0.;
+ 		effectiveconductivity_averaging = 0.;
+-		meltingpoint               = 0.;
+-		beta                       = 0.;
+-		mixed_layer_capacity       = 0.;
+-		thermal_exchange_velocity  = 0.;
+-		rheology_E   = NaN;
+-		rheology_B   = NaN;
+-		rheology_n   = NaN;
+-		rheology_law = '';
++		meltingpoint                    = 0.;
++		beta                            = 0.;
++		mixed_layer_capacity            = 0.;
++		thermal_exchange_velocity       = 0.;
++		rheology_E                      = NaN;
++		rheology_B                      = NaN;
++		rheology_n                      = NaN;
++		rheology_law                    = '';
+ 
+-		%slr
+-		earth_density              = 0;
++		%SLC
++		earth_density                   = 0;
+ 
+ 	end
+ 	methods
+Index: ../trunk-jpl/src/m/classes/matestar.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matestar.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matestar.m	(revision 26059)
+@@ -5,26 +5,26 @@
+ 
+ classdef matestar
+ 	properties (SetAccess=public) 
+-		rho_ice                    = 0.;
+-		rho_water                  = 0.;
+-		rho_freshwater             = 0.;
+-		mu_water                   = 0.;
+-		heatcapacity               = 0.;
+-		latentheat                 = 0.;
+-		thermalconductivity        = 0.;
+-		temperateiceconductivity   = 0.;
++		rho_ice                         = 0.;
++		rho_water                       = 0.;
++		rho_freshwater                  = 0.;
++		mu_water                        = 0.;
++		heatcapacity                    = 0.;
++		latentheat                      = 0.;
++		thermalconductivity             = 0.;
++		temperateiceconductivity        = 0.;
+ 		effectiveconductivity_averaging = 0;
+-		meltingpoint               = 0.;
+-		beta                       = 0.;
+-		mixed_layer_capacity       = 0.;
+-		thermal_exchange_velocity  = 0.;
+-		rheology_B    = NaN;
+-		rheology_Ec   = NaN;
+-		rheology_Es   = NaN;
+-		rheology_law = '';
++		meltingpoint                    = 0.;
++		beta                            = 0.;
++		mixed_layer_capacity            = 0.;
++		thermal_exchange_velocity       = 0.;
++		rheology_B                      = NaN;
++		rheology_Ec                     = NaN;
++		rheology_Es                     = NaN;
++		rheology_law                    = '';
+ 
+ 		%slc
+-		earth_density              = 0;
++		earth_density                   = 0;
+ 
+ 	end
+ 	methods
+Index: ../trunk-jpl/src/m/classes/matice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matice.py	(revision 26059)
+@@ -7,12 +7,11 @@
+ 
+ 
+ class matice(object):
+-    '''
+-    MATICE class definition
++    """MATICE class definition
+ 
+     Usage:
+             matice = matice()
+-    '''
++    """
+ 
+     def __init__(self): #{{{
+         self.rho_ice = 0.
+@@ -32,13 +31,7 @@
+         self.rheology_n = np.nan
+         self.rheology_law = ''
+ 
+-        #giaivins
+-        self.lithosphere_shear_modulus = 0.
+-        self.lithosphere_density = 0.
+-        self.mantle_shear_modulus = 0.
+-        self.mantle_density = 0.
+-
+-        #slr
++        #slc
+         self.earth_density = 0
+         self.setdefaultparameters()
+     #}}}
+@@ -61,10 +54,6 @@
+         s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
+         s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+         s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_density", "Lithosphere density [g/cm^-3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_density", "Mantle density [g/cm^-3]"))
+         s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]"))
+ 
+         return s
+@@ -107,11 +96,9 @@
+         #available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+ 
+-        # GIA:
+-        self.lithosphere_shear_modulus = 6.7e10 # (Pa)
+-        self.lithosphere_density = 3.32  # (g/cm^-3)
+-        self.mantle_shear_modulus = 1.45e11  # (Pa)
+-        self.mantle_density = 3.34  # (g/cm^-3)
++        # Rheology for ice
++        self.rheology_B = 2.1 * 1e8
++        self.rheology_n = 3
+ 
+         # SLR
+         self.earth_density = 5512  # average density of the Earth, (kg/m^3)
+@@ -118,25 +105,18 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses): #{{{
+-        if solution != 'SealevelriseSolution':
++        if solution == 'TransientSolution' and md.transient.isslc:
++            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
++        else:
+             md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+             md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+             md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+             md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
+             md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'universal', 1, 'NaN', 1, 'Inf', 1)
+-            md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
++            md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'universal',1, 'NaN', 1, 'Inf', 1)
+             md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O'])
+-            md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
++            md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
+ 
+-        if 'GiaAnalysis' in analyses:
+-            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', [1])
+-            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', [1])
+-            md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', [1])
+-            md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])
+-
+-        if 'SealevelriseAnalysis' in analyses:
+-            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
+-
+         return md
+     #}}}
+ 
+@@ -158,9 +138,5 @@
+         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: ../trunk-jpl/src/m/classes/surfaceload.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/surfaceload.m	(revision 26059)
+@@ -19,13 +19,13 @@
+ 			end
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+-		
++
+ 			icethicknesschange=[];
+ 			waterheightchange=[];
+ 			otherchange=[];
+-		
++
+ 		end % }}}
+-			function md = checkconsistency(self,md,solution,analyses) % {{{
++		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
+ 				return; 
+Index: ../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/transient.m	(revision 26059)
+@@ -7,7 +7,7 @@
+ 	properties (SetAccess=public) 
+ 		issmb             = 0;
+ 		ismasstransport   = 0;
+-		isoceantransport   = 0;
++		isoceantransport  = 0;
+ 		isstressbalance   = 0;
+ 		isthermal         = 0;
+ 		isgroundingline   = 0;
+@@ -15,7 +15,7 @@
+ 		isdamageevolution = 0;
+ 		ismovingfront     = 0;
+ 		ishydrology       = 0;
+-        issampling        = 0;
++		issampling        = 0;
+ 		isslc             = 0;
+ 		amr_frequency     = 0;
+ 		isoceancoupling   = 0;
+@@ -43,7 +43,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   =0;
+ 			self.ishydrology     = 0;
+-            self.issampling      = 0;
++			self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.amr_frequency	= 0;
+@@ -64,7 +64,7 @@
+ 			self.isdamageevolution = 0;
+ 			self.ismovingfront   = 0;
+ 			self.ishydrology     = 0;
+-            self.issampling      = 0;
++			self.issampling      = 0;
+ 			self.isslc           = 0;
+ 			self.isoceancoupling = 0;
+ 			self.amr_frequency	= 0;
+@@ -97,7 +97,7 @@
+ 			md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
+ 			md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]);
+-            md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
++			md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]);  
+ 			md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 
+ 			if (~strcmp(solution,'TransientSolution') & md.transient.iscoupling==1), 
+@@ -120,7 +120,7 @@
+ 			fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient');
+ 			fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient');
+ 			fielddisplay(self,'ishydrology','indicates whether an hydrology model is used');
+-            fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
++			fielddisplay(self,'issampling','indicates whether sampling is used in the transient')
+ 			fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient');
+ 			fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+ 			fielddisplay(self,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
+@@ -138,7 +138,7 @@
+ 			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','issampling','format','Boolean'); 
++			WriteData(fid,prefix,'object',self,'fieldname','issampling','format','Boolean'); 
+ 			WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','amr_frequency','format','Integer');
+@@ -164,7 +164,7 @@
+ 			writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution);
+ 			writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront);
+ 			writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology);
+-            writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
++			writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 
+ 			writejsdouble(fid,[modelname '.trans.isslc'],self.isslc);
+ 			writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling);
+ 			writejsdouble(fid,[modelname '.trans.amr_frequency'],self.amr_frequency);
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 26058)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.m	(revision 26059)
+@@ -2,7 +2,7 @@
+ %ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+ %
+ %   Usage:
+-%      ismodelselfconsistent(md),
++%      ismodelselfconsistent(md);
+ 
+ %initialize consistency as true
+ md.private.isconsistent=true;
+Index: ../trunk-jpl/src/m/plot/radarpower.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/radarpower.py	(nonexistent)
++++ ../trunk-jpl/src/m/plot/radarpower.py	(revision 26059)
+@@ -0,0 +1,16 @@
++def solveslm(slm, solutionstringi, *args):
++    """RADARPOWER - overlay a power radar image on an existing mesh
++
++    This routine will overlay a power radar image on an existing mesh.
++    The power amplitude will be output to vel for now.
++    In the future, think about a field to hold this value.
++
++    Usage:
++        md=radarpower(md,options);
++        md=radarpower(md)
++
++    TODO:
++    - Translate from MATLAB API as we bring Python plotting capabilities online
++    """
++
++    return md
+Index: ../trunk-jpl/src/m/solve/solveslm.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solveslm.m	(revision 26058)
++++ ../trunk-jpl/src/m/solve/solveslm.m	(revision 26059)
+@@ -1,5 +1,5 @@
+ function slm=solveslm(slm,solutionstringi,varargin)
+-%SOLVESLR - apply solution sequence for this sealevel model
++%SOLVESLM - apply solution sequence for this sealevel model
+ %
+ %   Usage:
+ %      slm=solve(slm,solutionstring,varargin)
+@@ -42,7 +42,7 @@
+ slm.private.solution=solutionstring;
+ cluster=slm.cluster;
+ batch=0;
+-%now, go through icecaps, glacies and earth, and upload all the data independently: 
++%now, go through icecaps, glaciers and earth, and upload all the data independently: 
+ disp('solving ice caps first');
+ for i=1:length(slm.icecaps),
+ 	slm.icecaps{i}=solve(slm.icecaps{i},solutionstringi,'batch','yes');
+@@ -50,7 +50,7 @@
+ disp('solving earth now');
+ slm.earth=solve(slm.earth,solutionstringi,'batch','yes');
+ 
+-%Firs, build a runtime name that is unique
++%First, build a runtime name that is unique
+ c=clock;
+ slm.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',slm.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
+ 
+Index: ../trunk-jpl/src/m/solve/solveslm.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solveslm.py	(nonexistent)
++++ ../trunk-jpl/src/m/solve/solveslm.py	(revision 26059)
+@@ -0,0 +1,95 @@
++from datetime import datetime
++import os
++
++import numpy as np
++
++from loadresultsfromcluster import loadresultsfromcluster
++from pairoptions import pairoptions
++from waitonlock import waitonlock
++
++
++def solveslm(slm, solutionstringi, *args):
++    """SOLVESLM - apply solution sequence for this sealevel model
++
++    Usage:
++        slm=solve(slm,solutionstring,varargin)
++        where varargin is a lit of paired arguments of string OR enums
++
++    solution types available comprise:
++        - 'Transient'
++
++    extra options:
++
++    Examples:
++        slm=solve(slm,'Transient');
++    """
++
++    # Recover and process solve options
++    if solutionstringi.lower() == 'tr' or solutionstringi.lower() == 'transient':
++        solutionstring = 'TransientSolution'
++    else:
++        raise RuntimeError('solutionstring {} not supported!'.format(solutionstringi))
++
++    # Default settings for debugging
++    valgrind = 0
++    #slm.cluster.interactive = 0
++    #valgrind = 1
++
++    # Check consistency
++    slm.checkconsistency(solutionstring)
++
++    # Process options
++    options = pairoptions('solutionstring', solutionstring, *args)
++
++    # Make sure we request sum of cluster processors
++    totalnp = 0
++    for i in range(len(slm.icecaps)):
++        totalnp = totalnp + slm.icecaps[i].cluster.np
++    totalnp = totalnp + slm.earth.cluster.np
++    if totalnp != slm.cluster.np:
++        raise RuntimeError('sum of all icecaps and earch cluster processors requestes should be equal to slm.cluster.np')
++
++    # Recover some fields
++    slm.private.solution = solutionstring
++    cluster = slm.cluster
++    batch = 0
++    # Now, go through icecaps, glaciers and earth, and upload all the data independently
++    print('solving ice caps first')
++    for i in range(len(slm.icecaps)):
++        slm.icecaps[i] = solve(slm.icecaps[i], solutionastringi,'batch','yes')
++    print('solving earth now')
++    slm.earth = solve(slm.earth, solutionstringi, 'batch', 'yes')
++
++    # First, build a runtime name that is unique
++    c = datetime.now()
++    md.private.runtimename = "%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name, c.month, c.day, c.year, c.hour, c.minute, c.second, os.getpid())
++
++    # Write all input files
++    privateruntimenames = []
++    miscellaneousnames = []
++    nps = []
++    for i in range(len(slm.icecaps)):
++        privateruntimenames.append(slm.icecaps[i],private.runtimename)
++        miscellaneousnames.append(slm.earth.miscellaneous.name)
++        nps.append(slm.earth.cluster.np)
++
++    BuildQueueScriptMultipleModels(cluster, slm.private.runtimename, slm.miscellaneous.name, slm.private.solution, valgrind, privateruntimenames, miscellaneousnames, nps)
++
++    # Upload all required files, given that each individual solution for icecaps and earth model already did
++    filelist = [slm.miscellaneous.name + '.queue']
++    UploadQueueJob(cluster, slm.miscellaneous.name, slm.private.runtimename, filelist)
++
++    # Launch queue job
++    LaunchQueueJob(cluster, slm.miscellaneous.name, slm.private.runtimename, filelist, '', batch)
++
++    # Wait on lock
++    if slm.settings.waitonlock > 0:
++        islock = waitonlock(slm)
++        if islock == 0:  # no results to be loaded
++            print('The results must be loaded manually with md = loadresultsfromcluster(md).')
++        else: # load results
++            if slm.verbose.solution:
++                print('loading results from cluster')
++            slm = loadresultsfromcluster(slm)
++
++    return slm
+Index: ../trunk-jpl/src/m/classes/dsl.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/dsl.m	(revision 26059)
+@@ -6,9 +6,9 @@
+ classdef dsl
+ 	properties (SetAccess=public) 
+ 
+-		global_average_thermosteric_sea_level; %corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)
+-		sea_surface_height_above_geoid; %corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable (in m)
+-		sea_water_pressure_at_sea_floor; %corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) 
++		global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
++		sea_surface_height_above_geoid; %Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
++		sea_water_pressure_at_sea_floor; %Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
+ 
+ 	end
+ 	methods
+@@ -50,9 +50,9 @@
+ 		function disp(self) % {{{
+ 
+ 			disp(sprintf('   dsl parameters:'));
+-			fielddisplay(self,'global_average_thermosteric_sea_level','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)');
+-			fielddisplay(self,'sea_surface_height_above_geoid','corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m)');
+-			fielddisplay(self,'sea_water_pressure_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent)');
++			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).');
++			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).');
++			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).');
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+Index: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 26059)
+@@ -14,24 +14,22 @@
+     """
+ 
+     def __init__(self): #{{{
+-        self.global_average_thermosteric_sea_level_change = 0 #corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)
+-        self.sea_surface_height_change_above_geoid = float('NaN') #corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)
+-        self.sea_water_pressure_change_at_sea_floor = float('NaN') #corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)
+-        self.compute_fingerprints = 0; #do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid
++        self.global_average_thermosteric_sea_level = np.nan # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
++        self.sea_surface_height_above_geoid        = np.nan # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
++        self.sea_water_pressure_at_sea_floor       = np.nan # Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
+     #}}}
+ 
+     def __repr__(self): #{{{
+         s = '   dsl parameters:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level_change', 'corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)'))
+-        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_change_above_geoid', 'corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)'))
+-        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_change_at_sea_floor', 'corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)'))
+-        s += '{}\n'.format(fielddisplay(self, 'compute_fingerprints', 'do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid'))
++        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).'))
++        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_above_geoid', 'Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).'))
++        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_at_sea_floor', 'Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).'))
+         return s
+     #}}}
+ 
+     def extrude(self, md): #{{{
+-        self.sea_surface_height_change_above_geoid = project3d(md, 'vector', self.sea_surface_height_change_above_geoid, 'type', 'node')
+-        self.sea_water_pressure_change_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_change_at_sea_floor, 'type', 'node')
++        self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node')
++        self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node')
+         return self
+     #}}}
+ 
+@@ -41,18 +39,16 @@
+ 
+     def checkconsistency(self, md, solution, analyses): #{{{
+         # Early return
+-        if 'SealevelriseAnalysis' not in analyses:
++        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+-        if solution == 'TransientSolution' and md.transient.isslc == 0:
+-            return md
+-        md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level_change', 'NaN', 1, 'Inf', 1)
+-        md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_change_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+-        md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_change_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+-        md = checkfield(md, 'fieldname', 'dsl.compute_fingerprints', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
+-        if self.compute_fingerprints:
+-            # Check if geodetic flag of slr is on
+-            if not md.slr.geodetic:
+-                raise RuntimeError('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on')
++
++        md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1)
++        md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
++
++        if md.solidearth.settings.compute_bp_grd:
++            md = checkfield(md, 'fieldname', dsl.sea_water_pressure_at_sea_floor, 'empty', 1)
++
+         return md
+     # }}}
+ 
+@@ -59,8 +55,7 @@
+     def marshall(self, prefix, md, fid):   #{{{
+         yts = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'compute_fingerprints', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'global_average_thermosteric_sea_level_change', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 1+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_water_pressure_change_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_surface_height_change_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', 1+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.
++        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) # mattype 1 because we specify DSL at vertex locations.
++        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts) # mattype 1 because we specify bottom pressure at vertex locations.
+     # }}}
+Index: ../trunk-jpl/src/m/classes/dslmme.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/dslmme.m	(revision 26059)
+@@ -7,9 +7,9 @@
+ 	properties (SetAccess=public) 
+ 
+ 		modelid; %index into the multi-model ensemble, determine which field will be used.
+-		global_average_thermosteric_sea_level; %corresponds to zostoga fields in CMIP5 archives. Specified as a temporally quantity (in m) for each ensemble.
+-		sea_surface_height_above_geoid; %corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m) for each ensemble
+-		sea_water_pressure_at_sea_floor; %corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!)  for each ensemble
++		global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
++		sea_surface_height_above_geoid; %Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
++		sea_water_pressure_at_sea_floor; %Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
+ 
+ 	end
+ 	methods
+@@ -52,9 +52,9 @@
+ 
+ 			disp(sprintf('   dsl mme parameters:'));
+ 			fielddisplay(self,'modelid','index into the multi-model ensemble, determine which field will be used.');
+-			fielddisplay(self,'global_average_thermosteric_sea_level','corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.');
+-			fielddisplay(self,'sea_surface_height_above_geoid','corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m) for each ensemble.');
+-			fielddisplay(self,'sea_water_pressure_at_sea_floor','corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally quantity (in m) for each ensemble.');
++			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.');
++			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.');
++			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+Index: ../trunk-jpl/src/m/classes/dslmme.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/dslmme.py	(revision 26059)
+@@ -14,15 +14,14 @@
+     """
+ 
+     def __init__(self, *args): #{{{
+-        self.modelid                                        = 0 #index into the multi-model ensemble
+-        self.global_average_thermosteric_sea_level_change   = [] #corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.
+-        self.sea_surface_height_change_above_geoid          = [] #corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble
+-        self.sea_water_pressure_change_at_sea_floor         = [] #corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr equivalent, not in Pa/yr!) for each ensemble
+-        self.compute_fingerprints                           = 0 #corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble
+-        
+-        nargin = len(args)
++        self.modelid                               = 0 # Index into the multi-model ensemble
++        self.global_average_thermosteric_sea_level = [] # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
++        self.sea_surface_height_above_geoid        = [] # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
++        self.sea_water_pressure_at_sea_floor       = [] #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
+ 
+-        if nargin == 0:
++        nargs = len(args)
++
++        if nargs == 0:
+             self.setdefaultparameters()
+         else:
+             raise Exception('constructor not supported')
+@@ -31,10 +30,9 @@
+     def __repr__(self): # {{{
+         s = '   dsl mme parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'modelid', 'index into the multi-model ensemble, determines which field will be used.'))
+-        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level_change', 'corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.'))
+-        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_change_above_geoid', 'corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble.'))
+-        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_change_at_sea_floor', 'corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr) for each ensemble.'))
+-        s += '{}\n'.format(fielddisplay(self, 'compute_fingerprints', 'do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid'))
++        s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.'))
++        s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_above_geoid', 'Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.'))
++        s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_at_sea_floor', 'Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.'))
+         return s
+     #}}}
+ 
+@@ -43,34 +41,35 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses): # {{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
++        # Early return
++        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+-        for i in range(len(self.global_average_thermosteric_sea_level_change)):
+-            md = checkfield(md, 'field', self.global_average_thermosteric_sea_level_change[i], 'NaN', 1, 'Inf', 1)
+-            md = checkfield(md, 'field', self.sea_surface_height_change_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+-            md = checkfield(md, 'field', self.sea_water_pressure_change_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+-        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=',len(self.global_average_thermosteric_sea_level_change))
+-        if self.compute_fingerprints:
+-            #check geodetic flag of slr is on
+-            if not md.solidearth.settings.computesealevelchange:
+-                raise Exception('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on')
++
++        for i in range(len(self.global_average_thermosteric_sea_level)):
++            md = checkfield(md, 'field', self.global_average_thermosteric_sea_level[i], 'NaN', 1, 'Inf', 1)
++            md = checkfield(md, 'field', self.sea_surface_height_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
++            md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=',len(self.global_average_thermosteric_sea_level))
++
++        if self.solidearth.settings.compute_bp_grd:
++            md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor, 'empty', 1)
++
+         return md
+     #}}}
+ 
+     def marshall(self, prefix, md, fid): #{{{
+         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 2, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_fingerprints', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'modelid', 'format', 'Double')
+-        WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level_change), 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level_change', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_change_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_change_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
++        WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level), 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
+     #}}}
+ 
+     def extrude(self, md): #{{{
+-        for i in range(len(self.global_average_thermosteric_sea_level_change)):
+-            self.sea_surface_height_change_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_change_above_geoid[i], 'type', 'node', 'layer', 1)
+-            self.sea_water_pressure_change_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_change_at_sea_floor[i], 'type', 'node', 'layer', 1)
++        for i in range(len(self.global_average_thermosteric_sea_level)):
++            self.sea_surface_height_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_above_geoid[i], 'type', 'node', 'layer', 1)
++            self.sea_water_pressure_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor[i], 'type', 'node', 'layer', 1)
+ 
+         return self
+     #}}}
+Index: ../trunk-jpl/src/m/classes/fourierlove.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26059)
+@@ -79,12 +79,8 @@
+ 			end
+ 
+ 			%need 'litho' material: 
+-			if ~isa(md.materials,'materials')
++			if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
+ 				error('Need a ''litho'' material to run a Fourier Love number analysis');
+-			else
+-				if ~sum(strcmpi(md.materials.nature,'litho')),
+-					error('Need a ''litho'' material to run a Fourier Love number analysis');
+-				end
+ 			end
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/fourierlove.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/fourierlove.py	(revision 26059)
+@@ -4,11 +4,10 @@
+ 
+ 
+ class fourierlove(object):
+-    """
+-    Fourier Love Number class definition
++    """FOURIERLOVE - Fourier Love Number class definition
+ 
+-       Usage:
+-          fourierlove = fourierlove()
++    Usage:
++        fourierlove = fourierlove()
+     """
+     def __init__(self):  # {{{
+         self.nfreq = 0
+@@ -22,11 +21,14 @@
+         self.love_kernels = 0
+         self.forcing_type = 0
+ 
+-    #set defaults
+         self.setdefaultparameters()
+     #}}}
+ 
+     def __repr__(self):  # {{{
++        # TODO:
++        # - Convert all formatting to calls to <string>.format (see any 
++        #   already converted <class>.__repr__ method for examples)
++        #
+         string = '   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]'))
+@@ -75,6 +77,8 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
++        if 'LoveAnalysis' not in 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)
+@@ -88,6 +92,9 @@
+         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.")
+ 
++        # need 'litho' material
++        if not hasattr(md.materials, 'materials') or 'litho' not in md.materials.nature:
++            raise RuntimeError('Need a \'litho\' material to run a Fourier Love number analysis')
+         return md
+     # }}}
+ 
+Index: ../trunk-jpl/src/m/classes/geometry.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/geometry.m	(revision 26059)
+@@ -84,10 +84,10 @@
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-			
+-			if (size(self.thickness==md.mesh.numberofvertices) | (self.thickness==md.mesh.numberofvertices+1)),
++
++			if (size(self.thickness)==md.mesh.numberofvertices) | (size(self.thickness)==md.mesh.numberofvertices+1)),
+ 				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			elseif (size(self.thickness==md.mesh.numberofelements) | (self.thickness==md.mesh.numberofelements+1)),
++			elseif (size(self.thickness)==md.mesh.numberofelements) | (size(self.thickness)==md.mesh.numberofelements+1)),
+ 				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			else
+ 				error('geometry thickness time series should be a vertex or element time series');
+Index: ../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/geometry.py	(revision 26059)
+@@ -50,12 +50,8 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses): #{{{
+-        if (solution == 'TransientSolution' and md.transient.isgia) or (solution == 'GiaSolution'):
+-            md = checkfield(md, 'fieldname', 'geometry.thickness', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+-        elif solution == 'SealevelriseSolution':
+-            md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+-        elif solution == 'LoveSolution':
+-            return
++        if solution == 'LoveSolution':
++            return md
+         else:
+             md = checkfield(md, 'fieldname', 'geometry.surface', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+             md = checkfield(md, 'fieldname', 'geometry.base', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+@@ -70,13 +66,18 @@
+                 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): #{{{
++        if (len(self.thickness) == md.mesh.numberofvertices) or (len(self.thickness) == md.mesh.numberofvertices + 1):
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++        elif (len(self.thickness) == md.mesh.numberofelements) or (len(self.thickness) == md.mesh.numberofelements + 1):
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++        else:
++            raise RuntimeError('geometry thickness time series should be a vertex or element time series')
++
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'surface', 'format', 'DoubleMat', 'mattype', 1)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', '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: ../trunk-jpl/src/m/classes/hydrologyshreve.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26059)
+@@ -30,7 +30,7 @@
+ 
+ 			%Type of stabilization to use 0:nothing 1:artificial_diffusivity
+ 			self.stabilization     = 1;
+-      self.requested_outputs = {'default'};
++			self.requested_outputs = {'default'};
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 			
+Index: ../trunk-jpl/src/m/classes/hydrologyshreve.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologyshreve.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/hydrologyshreve.py	(revision 26059)
+@@ -4,11 +4,10 @@
+ 
+ 
+ class hydrologyshreve(object):
+-    """
+-    HYDROLOGYSHREVE class definition
++    """HYDROLOGYSHREVE class definition
+ 
+-       Usage:
+-          hydrologyshreve = hydrologyshreve()
++    Usage:
++        hydrologyshreve = hydrologyshreve()
+     """
+ 
+     def __init__(self):  # {{{
+@@ -15,13 +14,15 @@
+         self.spcwatercolumn = float('NaN')
+         self.stabilization = 0
+         self.requested_outputs = []
+-    #set defaults
++
+         self.setdefaultparameters()
+-
+     #}}}
+ 
+     def __repr__(self):  # {{{
+-
++        # TODO:
++        # - Convert all formatting to calls to <string>.format (see any 
++        #   already converted <class>.__repr__ method for examples)
++        #
+         string = '   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.'))
+@@ -47,7 +48,7 @@
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         #Early return
+-        if 'HydrologyShreveAnalysis' not in analyses:
++        if 'HydrologyShreveAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.ishydrology):
+             return md
+ 
+         md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
+@@ -60,7 +61,7 @@
+         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
++        #process requested outputs
+         outputs = self.requested_outputs
+         indices = [i for i, x in enumerate(outputs) if x == 'default']
+         if len(indices) > 0:
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26059)
+@@ -21,7 +21,7 @@
+ 		channelarea         = NaN;
+ 		sealevel            = NaN;
+ 		bottompressure      = NaN;
+-        sample              = NaN;
++		sample              = NaN;
+ 	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+@@ -51,7 +51,6 @@
+ 			end
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+-
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 			if ismember('StressbalanceAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isstressbalance == 0),
+@@ -97,12 +96,9 @@
+ 			end
+ 			if ismember('HydrologyShreveAnalysis',analyses),
+ 				if isa(md.hydrology,'hydrologyshreve'),
+-					if strcmp(solution,'TransientSolution') & md.transient.ishydrology,
++					if (strcmp(solution,'TransientSolution') & md.transient.ishydrology) | strcmp(solution,'HydrologySolution'),
+ 						md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 					end
+-					if strcmp(solution,'HydrologySolution'),
+-						md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+-					end
+ 				end
+ 			end
+ 			if ismember('HydrologyTwsAnalysis',analyses),
+@@ -110,7 +106,7 @@
+ 					md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 				end
+ 			end
+-			if ismember('SealevelchangeAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isslc == 0),
++			if ismember('SealevelchangeAnalysis',analyses),
+ 				if strcmp(solution,'TransientSolution') & md.transient.isslc,
+ 					md = checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 				end
+@@ -133,13 +129,13 @@
+ 						md = checkfield(md,'fieldname','initialization.epl_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 						md = checkfield(md,'fieldname','initialization.epl_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+ 					end
+-                end
+-            end
+-            if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
+-                if ~isnan(md.initialization.sample)
+-                    md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+-                end
++				end
+ 			end
++			if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0),
++				if ~isnan(md.initialization.sample)
++					md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++				end
++			end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   initial field values:'));
+@@ -158,7 +154,7 @@
+ 			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]');
+-            fielddisplay(self,'sample','Realization of a Gaussian random field');
++			fielddisplay(self,'sample','Realization of a Gaussian random field');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+@@ -178,8 +174,8 @@
+ 			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);
+-            WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
+-            
++			WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1);
++
+ 			if md.thermal.isenthalpy,
+ 				if numel(self.enthalpy) <= 1,
+ 					%reconstruct enthalpy
+@@ -194,7 +190,7 @@
+ 			end
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+-		
++
+ 			writejs1Darray(fid,[modelname '.initialization.vx'],self.vx);
+ 			writejs1Darray(fid,[modelname '.initialization.vy'],self.vy);
+ 			writejs1Darray(fid,[modelname '.initialization.vz'],self.vz);
+@@ -209,8 +205,8 @@
+ 			writejs1Darray(fid,[modelname '.initialization.watercolumn'],self.watercolumn);
+ 			writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential);
+ 			writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea);
+-            writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
+-            
++			writejs1Darray(fid,[modelname '.initialization.sample'],self.sample);
++
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/initialization.py	(revision 26059)
+@@ -28,6 +28,8 @@
+         self.epl_thickness = np.nan
+         self.hydraulic_potential = np.nan
+         self.channelarea = np.nan
++        self.sealevel = np.nan
++        self.bottompressure = np.nan
+         self.sample = np.nan
+ 
+         #set defaults
+@@ -66,6 +68,8 @@
+         self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1)
+         self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1)
+         self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
++        self.sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node', 'layer', 1)
++        self.bottompressure = project3d(md, 'vector', self.bottompressure, 'type', 'node', 'layer', 1)
+ 
+         #Lithostatic pressure by default
+         if np.ndim(md.geometry.surface) == 2:
+@@ -89,6 +93,9 @@
+         if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
+             md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+             md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
++        if 'OceantransportAnalysis' in analyses:
++            if solution == 'TransientSolution' and md.transient.isslc and md.transient.isoceantransport:
++                md = checkfield(md, 'fieldname', 'initialization.bottompressure', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+         if 'BalancethicknessAnalysis' in analyses and solution == 'BalancethicknessSolution':
+             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])
+@@ -111,15 +118,14 @@
+                 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'):
++                if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution':
++                    md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
++        if 'HydrologyTwsAnalysis' in analyses:
++            if hasattr(md.hydrology, 'hydrologytws'):
+                 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+-        if 'HydrologyDCInefficientAnalysis' in analyses:
+-            if hasattr(md.hydrology, 'hydrologydc'):
+-                md = checkfield(md, 'fieldname', 'initialization.sediment_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+-        if 'HydrologyDCEfficientAnalysis' in analyses:
+-            if hasattr(md.hydrology, 'hydrologydc'):
+-                if md.hydrology.isefficientlayer == 1:
+-                    md = checkfield(md, 'fieldname', 'initialization.epl_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+-                    md = checkfield(md, 'fieldname', 'initialization.epl_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
++        if 'SealevelchangeAnalysis' in analyses:
++            if solution == 'TransientSolution' and md.transient.isslc:
++                md = checkfield(md, 'fieldname', 'initialization.sealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+         if 'HydrologyGlaDSAnalysis' in analyses:
+             if hasattr(md.hydrology, 'hydrologyglads'):
+                 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+@@ -137,6 +143,8 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'bottompressure', '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)
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26058)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26059)
+@@ -1,10 +1,9 @@
+ 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
+@@ -52,6 +51,8 @@
+         analyses = ['EnthalpyAnalysis', 'ThermalAnalysis', 'MeltingAnalysis']
+     elif solutiontype == 'MasstransportSolution':
+         analyses = ['MasstransportAnalysis']
++    elif solutiontype == 'OceantransportSolution':
++        analyses = ['OceantransportAnalysis']
+     elif solutiontype == 'BalancethicknessSolution':
+         analyses = ['BalancethicknessAnalysis']
+     elif solutiontype == 'Balancethickness2Solution':
+@@ -71,11 +72,11 @@
+     elif solutiontype == 'EsaSolution':
+         analyses = ['EsaAnalysis']
+     elif solutiontype == 'TransientSolution':
+-        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelriseAnalysis']
++        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'OceantransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShreveAnalysis', 'HydrologyTwsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelriseAnalysis']
+     elif solutiontype == 'SealevelriseSolution':
+         analyses = ['SealevelriseAnalysis']
+     elif solutiontype == 'HydrologySolution':
+-        analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis']
++        analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyTwsAnalysis']
+     elif 'DamageEvolutionSolution':
+         analyses = ['DamageEvolutionAnalysis']
+     elif 'SamplingSolution':
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 26058)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 26059)
+@@ -9,7 +9,7 @@
+ %   Solution types available comprise:
+ %   - 'Stressbalance'      or 'sb'
+ %   - 'Masstransport'      or 'mt'
+-%   - 'Oceantransport' or 'oceant'
++%   - 'Oceantransport'     or 'oceant'
+ %   - 'Thermal'            or 'th'
+ %   - 'Steadystate'        or 'ss'
+ %   - 'Transient'          or 'tr'
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26058)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26059)
+@@ -21,8 +21,8 @@
+ %Loading history 
+ md.timestepping.start_time=-2400000; %4,800 kyr :: EVALUATION TIME
+ md.timestepping.time_step= 2400000; %2,400 kyr :: EVALUATION TIME
+-% to get rid of default final_time: make sure final_time>start_time
+-md.timestepping.final_time=2400000; %2,500 kyr
++% to get rid of default final_time, make sure final_time > start_time
++md.timestepping.final_time=2400000; %2,400 kyr
+ md.masstransport.spcthickness=[...
+ 	[md.geometry.thickness; 0],...
+ 	[md.geometry.thickness; 2400000]...
+@@ -45,7 +45,7 @@
+ %md.cluster=generic('name',oshostname(),'np',3);
+ md.verbose=verbose('11111111111');
+ md.verbose.solver=0;
+-md=solve(md,'tr');
++md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'UGrd'};
+Index: ../trunk-jpl/src/m/classes/matdamageice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26059)
+@@ -5,25 +5,25 @@
+ 
+ classdef matdamageice
+ 	properties (SetAccess=public) 
+-		rho_ice                    = 0.;
+-		rho_water                  = 0.;
+-		rho_freshwater             = 0.;
+-		mu_water                   = 0.;
+-		heatcapacity               = 0.;
+-		latentheat                 = 0.;
+-		thermalconductivity        = 0.;
+-		temperateiceconductivity   = 0.;
++		rho_ice                         = 0.;
++		rho_water                       = 0.;
++		rho_freshwater                  = 0.;
++		mu_water                        = 0.;
++		heatcapacity                    = 0.;
++		latentheat                      = 0.;
++		thermalconductivity             = 0.;
++		temperateiceconductivity        = 0.;
+ 		effectiveconductivity_averaging = 0.;
+-		meltingpoint               = 0.;
+-		beta                       = 0.;
+-		mixed_layer_capacity       = 0.;
+-		thermal_exchange_velocity  = 0.;
+-		rheology_B   = NaN;
+-		rheology_n   = NaN;
+-		rheology_law = '';
++		meltingpoint                    = 0.;
++		beta                            = 0.;
++		mixed_layer_capacity            = 0.;
++		thermal_exchange_velocity       = 0.;
++		rheology_B                      = NaN;
++		rheology_n                      = NaN;
++		rheology_law                    = '';
+ 
+ 		%slc
+-		earth_density              = 0;
++		earth_density                   = 0;
+ 
+ 	end
+ 	methods
+Index: ../trunk-jpl/src/m/classes/matdamageice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26059)
+@@ -30,18 +30,17 @@
+         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.
++        #SLC
++        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
+ 
+-    #SLR
+-        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
+         self.setdefaultparameters()
+     #}}}
+ 
+     def __repr__(self):  # {{{
++        # TODO:
++        # - Convert all formatting to calls to <string>.format (see any 
++        #   already converted <class>.__repr__ method for examples)
++        #
+         string = "   Materials:"
+         string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
+         string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]"))
+@@ -59,10 +58,6 @@
+         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
+     #}}}
+@@ -104,13 +99,7 @@
+         #available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+ 
+-        # GIA:
+-        self.lithosphere_shear_modulus = 6.7e10  # (Pa)
+-        self.lithosphere_density = 3.32  # (g / cm^ - 3)
+-        self.mantle_shear_modulus = 1.45e11  # (Pa)
+-        self.mantle_density = 3.34  # (g / cm^ - 3)
+-
+-        #SLR
++        #SLC
+         self.earth_density = 5512  #average density of the Earth, (kg / m^3)
+         return self
+     #}}}
+@@ -130,12 +119,6 @@
+         md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])
+         md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
+ 
+-        if 'GiaAnalysis' in analyses:
+-            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)
+-            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)
+-            md = checkfield(md,'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)
+-            md = checkfield(md,'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)
+-
+         if 'SealevelriseAnalysis' in analyses:
+                 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
+ 
+@@ -160,10 +143,6 @@
+         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: ../trunk-jpl/src/m/classes/matenhancedice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matenhancedice.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matenhancedice.py	(revision 26059)
+@@ -1,15 +1,14 @@
++from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from project3d import project3d
+-from checkfield import checkfield
+ from WriteData import WriteData
+ 
+ 
+ class matenhancedice(object):
+-    """
+-    MATICE class definition
++    """MATICE class definition
+ 
+-        Usage:
+-            matenhancedice = matenhancedice()
++    Usage:
++        matenhancedice = matenhancedice()
+     """
+ 
+     def __init__(self): #{{{
+@@ -31,18 +30,17 @@
+         self.rheology_n = float('NaN')
+         self.rheology_law = ''
+ 
+-        #GIA
+-        self.lithosphere_shear_modulus = 0.
+-        self.lithosphere_density = 0.
+-        self.mantle_shear_modulus = 0.
+-        self.mantle_density = 0.
++        #SLC
++        self.earth_density = 0  # average density of the Earth, (kg/m^3)
+ 
+-        #SLR
+-        self.earth_density = 0  # average density of the Earth, (kg/m^3)
+         self.setdefaultparameters()
+     #}}}
+ 
+     def __repr__(self): #{{{
++        # TODO:
++        # - Convert all formatting to calls to <string>.format (see any 
++        #   already converted <class>.__repr__ method for examples)
++        #
+         s = "   Materials:"
+         s = "%s\n%s" % (s, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
+         s = "%s\n%s" % (s, fielddisplay(self, "rho_water", "water density [kg/m^3]"))
+@@ -61,10 +59,6 @@
+         s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
+         s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+         s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_density", "Lithosphere density [g/cm^-3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mantle_density", "Mantle density [g/cm^-3]"))
+         s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]"))
+ 
+         return s
+@@ -108,13 +102,13 @@
+         #available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+ 
+-    # GIA:
++        #GIA
+         self.lithosphere_shear_modulus = 6.7 * 10**10  # (Pa)
+         self.lithosphere_density = 3.32  # (g / cm^ - 3)
+         self.mantle_shear_modulus = 1.45 * 10**11  # (Pa)
+         self.mantle_density = 3.34  # (g / cm^ - 3)
+ 
+-    #SLR
++        #SLC
+         self.earth_density = 5512  #average density of the Earth, (kg / m^3)
+ 
+         return self
+@@ -131,12 +125,6 @@
+         md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval'])
+         md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
+ 
+-        if '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
+@@ -161,9 +149,5 @@
+         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: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 26059)
+@@ -122,7 +122,6 @@
+ 					self.rheology_B   = 1*1e8; 
+ 					self.rheology_n   = 3;
+ 
+-
+ 				case 'litho'
+ 					%we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
+ 					self.numlayers=2;
+Index: ../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/materials.py	(revision 26059)
+@@ -7,12 +7,11 @@
+ 
+ 
+ class materials(object):
+-    '''
+-    MATERIALS class definition
++    """MATERIALS class definition
+ 
+-       Usage:
+-          materials = materials()
+-    '''
++    Usage:
++        materials = materials()
++    """
+ 
+     def __init__(self, *args): #{{{
+         self.nature = []
+@@ -37,6 +36,7 @@
+                 setattr(self, 'latentheat', 0)
+                 setattr(self, 'thermalconductivity', 0)
+                 setattr(self, 'temperateiceconductivity', 0)
++                setattr(self, 'effectiveconductivity_averaging', 0)
+                 setattr(self, 'meltingpoint', 0)
+                 setattr(self, 'beta', 0)
+                 setattr(self, 'mixed_layer_capacity', 0)
+@@ -59,9 +59,9 @@
+                 setattr(self, 'rho_ice', 0)
+                 setattr(self, 'rho_water', 0)
+                 setattr(self, 'rho_freshwater', 0)
+-                setattr(self, 'earth_density', 0)
+             else:
+                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
++        setattr(self, 'earth_density', 0)
+ 
+         #set default parameters:
+         self.setdefaultparameters()
+@@ -73,37 +73,58 @@
+             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.34e5
++
+                 #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.8e-8
++
+                 #mixed layer (ice-water interface) heat capacity (J/kg/K)
+                 self.mixed_layer_capacity = 3974.
++
+                 #thermal exchange velocity (ice-water interface) (m/s)
+                 self.thermal_exchange_velocity = 1.00e-4
++
+                 #Rheology law: what is the temperature dependence of B with T
+                 #available: none, paterson and arrhenius
+                 self.rheology_law = 'Paterson'
++
++                #Rheology fields default
++                self.rheology_B = 1e8
++                self.rheology_n = 3
+             elif nat == 'litho':
+-                #we default to a configuration that enables running GIA solutions using giacaron and / or giaivins.
++                #we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
+                 self.numlayers = 2
++
+                 #center of the earth (approximation, must not be 0), then the lab (lithosphere / asthenosphere boundary) then the surface
+                 #(with 1d3 to avoid numerical singularities)
+                 self.radius = [1e3, 6278e3, 6378e3]
++
+                 self.viscosity = [1e21, 1e40]  #mantle and lithosphere viscosity (respectively) [Pa.s]
+                 self.lame_mu = [1.45e11, 6.7e10]  # (Pa)  #lithosphere and mantle shear modulus (respectively) [Pa]
+                 self.lame_lambda = self.lame_mu  # (Pa)  #mantle and lithosphere lamba parameter (respectively) [Pa]
+@@ -115,14 +136,17 @@
+             elif nat == 'hydro':
+                 #ice density (kg/m^3)
+                 self.rho_ice = 917.
++
+                 #ocean water density (kg/m^3)
+                 self.rho_water = 1023.
+-                #average density of the Earth (kg/m^3)
+-                self.earth_density = 5512
++
+                 #fresh water density (kg/m^3)
+                 self.rho_freshwater = 1000.
+             else:
+                 raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
++
++            #average density of the Earth (kg/m^3)
++            self.earth_density = 5512
+     #}}}
+ 
+     def __repr__(self): #{{{
+@@ -222,7 +246,6 @@
+         #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+         WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(self.nature), 'format', 'IntMat', 'mattype', 3)
+         WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer') #DANGER, this can evolve if you have classes
+-
+         for i in range(len(self.nature)):
+             nat = self.nature[i]
+             if nat == 'ice':
+@@ -235,6 +258,7 @@
+                 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')
+@@ -253,13 +277,19 @@
+                 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)
++                # Compute earth density compatible with our layer density distribution
++                earth_density = 0
++                for i in range(len(self.numlayers)):
++                    earth_density = earth_density + (self.radius[i + 1] ** 3 - self.radius[i] ** 3) * self.density[i]
++                earth_density = earth_density / self.radius[self.numlayers + 1] ** 3
++                self.earth_density = earth_density
+             elif nat == 'hydro':
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+-                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
+             else:
+                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
++        WriteData(fid, prefix, 'data', self.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double')
+     #}}}
+ 
+     def extrude(self, md): #{{{
+Index: ../trunk-jpl/src/m/classes/matestar.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matestar.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matestar.py	(revision 26059)
+@@ -33,13 +33,7 @@
+         self.rheology_Es = np.nan
+         self.rheology_law = ''
+ 
+-        #GIA
+-        self.lithosphere_shear_modulus = 0.
+-        self.lithosphere_density = 0.
+-        self.mantle_shear_modulus = 0.
+-        self.mantle_density = 0.
+-
+-        #SLR
++        #slc
+         self.earth_density = 0
+ 
+         #set default parameters
+@@ -65,10 +59,6 @@
+         s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor'))
+         s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Es', 'shear enhancement factor'))
+         s = "%s\n%s" % (s, fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'lithosphere_shear_modulus', 'Lithosphere shear modulus [Pa]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'lithosphere_density', 'Lithosphere density [g/cm^-3]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mantle_shear_modulus', 'Mantle shear modulus [Pa]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mantle_density', 'Mantle density [g/cm^-3]'))
+         s = "%s\n%s" % (s, fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
+ 
+         return s
+@@ -112,12 +102,7 @@
+         #Rheology law: what is the temperature dependence of B with T
+         #available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+-        # GIA
+-        self.lithosphere_shear_modulus = 6.7e10  # (Pa)
+-        self.lithosphere_density = 3.32  # (g / cm^ - 3)
+-        self.mantle_shear_modulus = 1.45e11  # (Pa)
+-        self.mantle_density = 3.34  # (g / cm^ - 3)
+-        #SLR
++        #slc
+         self.earth_density = 5512  # average density of the Earth, (kg / m^3)
+ 
+         return self
+@@ -134,12 +119,6 @@
+         md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval'])
+         md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
+ 
+-        if '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)
+ 
+@@ -165,9 +144,5 @@
+         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: ../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/matice.m	(revision 26059)
+@@ -103,20 +103,18 @@
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+-			
++
+ 			if strcmpi(solution,'TransientSolution') & md.transient.isslc,
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+-				return;
+-			end
+-	
+-			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,'universal',1,'NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
+-			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
++			else
++				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,'universal',1,'NaN',1,'Inf',1);
++				md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
++				md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
++				md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+ 
+ 		end % }}}
+ 		function disp(self) % {{{
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26059)
+@@ -43,7 +43,7 @@
+ 		frontalforcings  = 0;
+ 		love			 = 0;
+ 		esa              = 0;
+-        sampling         = 0;
++		sampling         = 0;
+ 
+ 		autodiff         = 0;
+ 		inversion        = 0;
+@@ -155,7 +155,7 @@
+ 			%2019 Jan..
+ 			if isa(md.frontalforcings,'double');
+ 				if(isprop('meltingrate',md.calving) & ~isnan(md.calving.meltingrate))
+-					disp('Warning: md.calving.meltingrate is now in md.frontalforcings');
++		gia			disp('Warning: md.calving.meltingrate is now in md.frontalforcings');
+ 				end
+ 				md.frontalforcings=frontalforcings(md.calving); 
+ 			end
+@@ -186,8 +186,8 @@
+ 						md.smb.isconstrainsurfaceT = 0;
+ 					end
+ 				end
+-            end
+-            %2021 February 17
++			end
++			%2021 February 17
+ 			if isa(md.sampling,'double'); md.sampling=sampling(); end
+ 		end% }}}
+ 	end
+@@ -241,7 +241,7 @@
+ 			md.frontalforcings  = frontalforcings();
+ 			md.love             = fourierlove();
+ 			md.esa              = esa();
+-            md.sampling         = sampling();
++			md.sampling         = sampling();
+ 			md.autodiff         = autodiff();
+ 			md.inversion        = inversion();
+ 			md.qmu              = qmu();
+@@ -614,8 +614,8 @@
+ 						%size = number of elements * n
+ 						elseif fieldsize(1)==numberofelements1
+ 							md2.(model_fields{i}).(object_fields{j})=field(pos_elem,:);
+-                        elseif (fieldsize(1)==numberofelements1+1)
+-                            md2.(model_fields{i}).(object_fields{j})=[field(pos_elem,:); field(end,:)];
++						elseif (fieldsize(1)==numberofelements1+1)
++							md2.(model_fields{i}).(object_fields{j})=[field(pos_elem,:); field(end,:)];
+ 						end
+ 					end
+ 				else
+@@ -627,7 +627,7 @@
+ 					%size = number of elements * n
+ 					elseif fieldsize(1)==numberofelements1
+ 						md2.(model_fields{i})=field(pos_elem,:);
+-                    elseif (fieldsize(1)==numberofelements1+1)
++					elseif (fieldsize(1)==numberofelements1+1)
+ 						md2.(model_fields{i})=[field(pos_elem,:); field(end,:)];
+ 					end
+ 				end
+@@ -774,18 +774,18 @@
+ 						%get subfields
+ 						% loop over time steps
+ 						for p=1:length(md1.results.(solutionfields{i}))
+-						    current = md1.results.(solutionfields{i})(p);
+-						    solutionsubfields=fields(current);
+-						    for j=1:length(solutionsubfields),
++							current = md1.results.(solutionfields{i})(p);
++							solutionsubfields=fields(current);
++							for j=1:length(solutionsubfields),
+ 							field=md1.results.(solutionfields{i})(p).(solutionsubfields{j});
+ 							if length(field)==numberofvertices1,
+-							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_node);
++								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_node);
+ 							elseif length(field)==numberofelements1,
+-							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_elem);
++								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_elem);
+ 							else
+-							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field;
++								md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field;
+ 							end
+-						    end
++							end
+ 						end
+ 					else
+ 						field=md1.results.(solutionfields{i});
+@@ -1500,7 +1500,7 @@
+ 			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
+ 			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
+-            disp(sprintf('%19s: %-22s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
++			disp(sprintf('%19s: %-22s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
+ 			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
+ 			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
+ 			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'Dakota properties'));
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26059)
+@@ -54,8 +54,6 @@
+ from thermal import thermal
+ from steadystate import steadystate
+ from transient import transient
+-from giaivins import giaivins
+-from giamme import giamme
+ from esa import esa
+ from autodiff import autodiff
+ from inversion import inversion
+@@ -113,7 +111,6 @@
+         self.levelset = None
+         self.calving = None
+         self.frontalforcings = None
+-        self.gia = None
+         self.love = None
+         self.esa = None
+         self.sampling = None
+@@ -171,7 +168,6 @@
+                 'levelset',
+                 'calving',
+                 'frontalforcings',
+-                'gia',
+                 'love',
+                 'esa',
+                 'sampling',
+@@ -224,7 +220,6 @@
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("levelset", "[%s %s]" % ("1x1", obj.levelset.__class__.__name__), "parameters for moving boundaries (level - set method)"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("calving", "[%s %s]" % ("1x1", obj.calving.__class__.__name__), "parameters for calving"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("frontalforcings", "[%s %s]" % ("1x1", obj.frontalforcings.__class__.__name__), "parameters for frontalforcings"))
+-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("gia", "[%s %s]" % ("1x1", obj.gia.__class__.__name__), "parameters for gia solution"))
+         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("esa", "[%s %s]" % ("1x1", obj.esa.__class__.__name__), "parameters for elastic adjustment solution"))
+         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("sampling", "[%s %s]" % ("1x1", obj.sampling.__class__.__name__), "parameters for stochastic sampler"))
+         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("love", "[%s %s]" % ("1x1", obj.love.__class__.__name__), "parameters for love solution"))
+@@ -271,7 +266,6 @@
+         self.levelset = levelset()
+         self.calving = calving()
+         self.frontalforcings = frontalforcings()
+-        self.gia = giamme()
+         self.love = fourierlove()
+         self.esa = esa()
+         self.sampling = sampling()
+@@ -851,13 +845,6 @@
+         if not np.isnan(md.initialization.watercolumn).all():
+             md.initialization.watercolumn = project2d(md, md.initialization.watercolumn, 1)
+ 
+-        # giaivins
+-        if md.gia.__class__.__name__ == 'giaivins':
+-            if not np.isnan(md.gia.mantle_viscosity).all():
+-                md.gia.mantle_viscosity = project2d(md, md.gia.mantle_viscosity, 1)
+-            if not np.isnan(md.gia.lithosphere_thickness).all():
+-                md.gia.lithosphere_thickness = project2d(md, md.gia.lithosphere_thickness, 1)
+-
+         # elementstype
+         if not np.isnan(md.flowequation.element_equation).all():
+             md.flowequation.element_equation = project2d(md, md.flowequation.element_equation, 1)
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26058)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26059)
+@@ -90,15 +90,15 @@
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+ 				if ~isempty(md.solidearth.external),
+-					error(sprintf('cannot run external forcings on an ice sheet when runing a coupling earth/ice sheet model');
++					error('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
+ 				end
+ 
+ 			end
+-			%make sure that we have the rigth grd model for computing ouf sealevel patterns: 
++			%make sure that we have the right grd model for computing out sealevel patterns: 
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+ 				if md.solidearth.settings.grdmodel~=0
+-					error(sprintf('sealevelmodel checkconsistenty error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
++					error(sprintf('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
+ 				end
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26059)
+@@ -110,6 +110,22 @@
+             md = slm.icecaps[i]
+             if np.nonzero(md.slr.steric_rate - slm.earth.slr.steric_rate[slm.earth.slr.transitions[i]]) != []:
+                 raise Exception('steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))
++
++        # Make sure grd is the same everywhere
++        for i in range(len(slm.icecaps)):
++            md = slm.icecaps[i]
++            if md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd:
++                raise RuntimeError('isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name))
++        # Make sure that there is no solid earth external forcing on the basins
++        for i in range(len(slm.icecaps)):
++            md = slm.icecaps[i]
++            if md.solidearth.external:
++                raise RuntimeError('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model')
++        # Make sure that we have the right grd model for computing our sealevel patterns
++        for i in range(len(slm.icecaps)):
++            md = slm.icecaps[i]
++            if md.solidearth.settings.grdmodel != 0:
++                raise RuntimeError('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i))
+     #}}}
+ 
+     def mergeresults(self):  # {{{
+Index: ../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.py	(revision 26058)
++++ ../trunk-jpl/src/m/classes/transient.py	(revision 26059)
+@@ -13,10 +13,10 @@
+     def __init__(self):  # {{{
+         self.issmb = 0
+         self.ismasstransport = 0
++        self.isoceantransport = 0
+         self.isstressbalance = 0
+         self.isthermal = 0
+         self.isgroundingline = 0
+-        self.isgia = 0
+         self.isesa = 0
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+@@ -23,7 +23,6 @@
+         self.ishydrology = 0
+         self.issampling = 0
+         self.isslc = 0
+-        self.iscoupler = 0
+         self.amr_frequency = 0
+         self.isoceancoupling = 0
+         self.requested_outputs = []
+@@ -35,10 +34,10 @@
+         s = '   transient solution parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'issmb', 'indicates if a surface mass balance solution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'ismasstransport', 'indicates if a masstransport solution is used in the transient'))
++        s += '{}\n'.format(fielddisplay(self, 'isoceantransport', 'indicates whether an ocean masstransport solution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isstressbalance', 'indicates if a stressbalance solution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isthermal', 'indicates if a thermal solution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isgroundingline', 'indicates if a groundingline migration is used in the transient'))
+-        s += '{}\n'.format(fielddisplay(self, 'isgia', 'indicates if a postglacial rebound is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isesa', 'indicates whether an elastic adjustment model is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isdamageevolution', 'indicates whether damage evolution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'ismovingfront', 'indicates whether a moving front capability is used in the transient'))
+@@ -46,7 +45,6 @@
+         s += '{}\n'.format(fielddisplay(self, 'issampling', 'indicates whether sampling is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isslc', 'indicates if a sea level change solution is used in the transient'))
+         s += '{}\n'.format(fielddisplay(self, 'isoceancoupling', 'indicates whether coupling with an ocean model is used in the transient'))
+-        s += '{}\n'.format(fielddisplay(self, 'iscoupler', 'indicates whether different models are being run with need for coupling'))
+         s += '{}\n'.format(fielddisplay(self, 'amr_frequency', 'frequency at which mesh is refined in simulations with multiple time_steps'))
+         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'list of additional outputs requested'))
+         return s
+@@ -62,10 +60,10 @@
+     def deactivateall(self):  #{{{
+         self.issmb = 0
+         self.ismasstransport = 0
++        self.isoceantransport = 0
+         self.isstressbalance = 0
+         self.isthermal = 0
+         self.isgroundingline = 0
+-        self.isgia = 0
+         self.isesa = 0
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+@@ -73,7 +71,6 @@
+         self.issampling = 0
+         self.isslc = 0
+         self.isoceancoupling = 0
+-        self.iscoupler = 0
+         self.amr_frequency = 0
+ 
+         # Default output
+@@ -85,10 +82,10 @@
+         #full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+         self.issmb = 1
+         self.ismasstransport = 1
++        self.isoceantransport = 0
+         self.isstressbalance = 1
+         self.isthermal = 1
+         self.isgroundingline = 0
+-        self.isgia = 0
+         self.isesa = 0
+         self.isdamageevolution = 0
+         self.ismovingfront = 0
+@@ -96,7 +93,6 @@
+         self.issampling = 0
+         self.isslc = 0
+         self.isoceancoupling = 0
+-        self.iscoupler = 0
+         self.amr_frequency = 0
+ 
+         # Default output
+@@ -111,10 +107,10 @@
+ 
+         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.isocealtransport', '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])
+@@ -122,7 +118,6 @@
+         md = checkfield(md, 'fieldname', 'transient.ismovingfront', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isslc', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isoceancoupling', 'numel', [1], 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'transient.iscoupler', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.amr_frequency', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+ 
+         if solution != 'TransientSolution' and md.transient.iscoupling:
+@@ -135,10 +130,10 @@
+     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', 'isoceantransport', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isstressbalance', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isthermal', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isgroundingline', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgia', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isesa', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isdamageevolution', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'ishydrology', 'format', 'Boolean')
+@@ -146,7 +141,6 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'issampling', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isslc', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceancoupling', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'iscoupler', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'amr_frequency', 'format', 'Integer')
+ 
+         # Process requested outputs
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 26058)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 26059)
+@@ -1,6 +1,5 @@
+ from datetime import datetime
+ import os
+-import shutil
+ 
+ from ismodelselfconsistent import ismodelselfconsistent
+ from loadresultsfromcluster import loadresultsfromcluster
+@@ -21,6 +20,7 @@
+     Solution types available comprise:
+     - 'Stressbalance'      or 'sb'
+     - 'Masstransport'      or 'mt'
++    - 'Oceantransport'     or 'oceant'
+     - 'Thermal'            or 'th'
+     - 'Steadystate'        or 'ss'
+     - 'Transient'          or 'tr'
+@@ -31,9 +31,8 @@
+     - 'Hydrology'          or 'hy'
+     - 'DamageEvolution'    or 'da'
+     - 'Gia'                or 'gia'
++    - 'Love'               or 'lv'
+     - 'Esa'                or 'esa'
+-    - 'Sealevelchange'     or 'slc'
+-    - 'Love'               or 'lv'
+     - 'Sampling'           or 'smp'
+ 
+     Extra options:
+@@ -54,6 +53,8 @@
+         solutionstring = 'StressbalanceSolution'
+     elif solutionstring.lower() == 'mt' or solutionstring.lower() == 'masstransport':
+         solutionstring = 'MasstransportSolution'
++    elif solutionstring.lower() == 'oceant' or solutionstring.lower() == 'oceantransport':
++        solutionstring = 'OceantransportSolution'
+     elif solutionstring.lower() == 'th' or solutionstring.lower() == 'thermal':
+         solutionstring = 'ThermalSolution'
+     elif solutionstring.lower() == 'st' or solutionstring.lower() == 'steadystate':
+@@ -78,8 +79,6 @@
+         solutionstring = 'LoveSolution'
+     elif solutionstring.lower() == 'esa':
+         solutionstring = 'EsaSolution'
+-    elif solutionstring.lower() == 'slc' or solutionstring.lower() == 'sealevelchange':
+-        solutionstring = 'SealevelchangeSolution'
+     elif solutionstring.lower() == 'smp' or solutionstring.lower() == 'sampling':
+         solutionstring = 'SamplingSolution'
+     else:
+@@ -150,9 +149,9 @@
+     # Wait on lock
+     if md.settings.waitonlock > 0:
+         islock = waitonlock(md)
+-        if islock == 0:  # no results to be loaded
++        if islock == 0: # no results to be loaded
+             print('The results must be loaded manually with md = loadresultsfromcluster(md).')
+-        else:  # load results
++        else: # load results
+             if md.verbose.solution:
+                 print('loading results from cluster')
+             md = loadresultsfromcluster(md)
+Index: ../trunk-jpl/test/NightlyRun/test2001.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26058)
++++ ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26059)
+@@ -3,7 +3,7 @@
+ 
+ import numpy as np
+ 
+-from giaivins import giaivins
++from materials import *
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -16,35 +16,50 @@
+ md = setmask(md, '', '')
+ md = parameterize(md, '../Par/SquareSheetConstrained.py')
+ 
+-#GIA
+-md.gia = giaivins()
+-md.gia.lithosphere_thickness = 100. * np.ones(md.mesh.numberofvertices) # in km
+-md.gia.mantle_viscosity = 1.0e21 * np.ones(md.mesh.numberofvertices) # in Pa.s
+-md.materials.lithosphere_shear_modulus = 6.7e10 # in Pa
+-md.materials.lithosphere_density = 3.32 # in g/cm^3
+-md.materials.mantle_shear_modulus = 1.45e11 # in Pa
+-md.materials.mantle_density = 3.34 # in g/cm^3
++# GIA Ivins, 2 layer model
++md.solidearth.settings.grdmodel = 2
+ 
+-#Indicate what you want to compute
+-md.gia.cross_section_shape = 1 # for square-edged x-section
++md.materials = materials('litho','ice')
++md.materials.numlayers = 2;
++md.materials.radius = [10, 6271e3, 6371e3]
++md.materials.density = [3.34e3, 3.32e3]
++md.materials.lame_mu = [1.45e11, 6.7e10]
++md.materials.viscosity = [1e21, 0]
++md.initialization.sealevel = np.zeros(md.mesh.numberofvertices)
++md.solidearth.settings.cross_section_shape = 1 # for square-edged x-section 
++md.solidearth.settings.computesealevelchange = 0 # do not compute sea level, only deformation
++md.solidearth.requested_outputs = ['Sealevel', 'SealevelUGrd']
+ 
+-#Define loading history (see test2001.m for the description)
+-md.timestepping.start_time = 2400000  # 2, 400 kyr
+-md.timestepping.final_time = 2500000  # 2, 500 kyr
+-md.geometry.thickness = np.array([
+-    np.append(md.geometry.thickness * 0.0, 0.0),
+-    np.append(md.geometry.thickness / 2.0, 0.1),
+-    np.append(md.geometry.thickness, 0.2),
+-    np.append(md.geometry.thickness, 1.0),
+-    np.append(md.geometry.thickness, md.timestepping.start_time)
++# Loading history
++md.timestepping.start_time = -2400000  # 4,800 kyr :: EVALUATION TIME
++md.timestepping.time_step = 2400000  # 2,400 kyr :: EVALUATION TIME
++# To get rid of default final_time, make sure final_time > start_time
++md.timestepping.final_time = 2400000  # 2,400 kyr
++md.masstransport.spcthickness np.array([
++    np.append(md.geometry.thickness, 0),
++    np.append(md.geometry.thickness, 2400000)
+     ]).T
+ 
++# Geometry at 0 initially
++md.geometry.thickness = np.zeros(md.mesh.numberofvertices)
++md.geometry.surface = np.zeros(md.mesh.numberofvertices)
++md.geometry.base = np.zeros(md.mesh.numberofvertices)
++
++# Physics
++md.transient.issmb = 0
++md.transient.isstressbalance = 0
++md.transient.isthermal = 0
++md.transient.ismasstransport = 0
++md.transient.isslc = 0
++
+ #Solve for GIA deflection
++md.cluster = generic('name', gethostname(), 'np', 1)
+ md.cluster = generic('name', gethostname(), 'np', 3)
+-md.verbose = verbose('1111111')
+-md = solve(md, 'Gia')
++md.verbose = verbose('11111111111')
++md.verbose.solver = 0
++md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+-field_names = ['UGia', 'UGiaRate']
+-field_tolerances = [1e-13, 1e-13]
+-field_values = [md.results.GiaSolution.UGia, md.results.GiaSolution.UGiaRate]
++field_names = ['UGrd']
++field_tolerances = [1e-13]
++field_values = [md.results.TransientSolution[0].SealevelUGrd]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26059-26060.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26059-26060.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26059-26060.diff	(revision 26740)
@@ -0,0 +1,152 @@
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26059)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26060)
+@@ -15,7 +15,7 @@
+ 		runfrequency           = 1; %how many time steps we skip before we run grd_core
+ 		computesealevelchange  = 1; %will sea-level be coputed? 
+ 		isgrd                  = 1; %will GRD patterns be computed? 
+-		compute_bp_grd         = 1; %will GRD patterns for bottomo pressures be computed? 
++		compute_bp_grd         = 1; %will GRD patterns for bottom pressures be computed? 
+ 		degacc                 = 0; %degree increment for resolution of Green tables
+ 		horiz                  = 0; %compute horizontal deformation
+ 		glfraction             = 1; %barystatic contribution full or fractional (default fractional)
+@@ -34,8 +34,8 @@
+ 		function self = setdefaultparameters(self) % {{{
+ 		
+ 		%Convergence criterion: absolute, relative and residual
+-		self.reltol=0.01; % 1 per cent 
+-		self.abstol=NaN;  % default 
++		self.reltol=0.01; % 1 percent
++		self.abstol=NaN;  % default
+ 
+ 		%maximum of non-linear iterations.
+ 		self.maxiter=5;
+@@ -88,7 +88,7 @@
+ 				error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
+ 			end
+ 
+-			%a GRD computation has been requested, makes somes checks on the nature of the meshes provided. 
++			%a GRD computation has been requested, make some checks on the nature of the meshes provided. 
+ 			if self.isgrd,
+ 				if strcmpi(class(md.mesh),'mesh3dsurface'),
+ 					if self.grdmodel==2,
+@@ -96,7 +96,7 @@
+ 					end
+ 				else
+ 					if self.grdmodel==1,
+-						error('model requires a 3D surface mesh to run GRD computations ( change mesh from mesh2d to mesh3dsurface)');
++						error('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)');
+ 					end
+ 				end
+ 			end
+@@ -124,7 +124,7 @@
+ 			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+ 			fielddisplay(self,'glfraction','contribute fractionally (default, 1) to barystatic sea level');
+ 			fielddisplay(self,'grdmodel','type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins');
+-			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore');
++			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'object',self,'fieldname','reltol','name','md.solidearth.settings.reltol','format','Double');
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26059)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26060)
+@@ -23,9 +23,12 @@
+         self.runfrequency           = 1 # How many time steps we skip before we run grd_core
+         self.computesealevelchange  = 1 # Will grd_core compute sea level?
+         self.isgrd                  = 1 # Will GRD patterns be computed?
++        self.compute_bp_grd         = 1 # Will GRD patterns for bottom pressures be computed?
+         self.degacc                 = 0 # Degree increment for resolution of Green tables
+         self.horiz                  = 0 # Compute horizontal displacement?
+         self.glfraction             = 1 # Barystatic contribution: full or fractional (default: fractional)
++        self.grdmodel               = 0 # GRD model (0 by default, 1 for elastic, 2 for Ivins)
++        self.cross_section_shape    = 0 # Cross section only used when GRD model is Ivins
+ 
+         nargin = len(args)
+ 
+@@ -43,11 +46,14 @@
+         s += '{}\n'.format(fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area [default: No correction]'))
+         s += '{}\n'.format(fielddisplay(self, 'computesealevelchange', 'compute sealevel change from GRD in addition to steric?) default 0'))
+         s += '{}\n'.format(fielddisplay(self, 'isgrd', 'compute GRD patterns (default: 1'))
++        s += '{}\n'.format(fielddisplay(self, 'compute_bp_grd', 'compute GRD patterns for bottom pressure loads (default 1)'))
+         s += '{}\n'.format(fielddisplay(self, 'runfrequency', 'how many time steps we skip before we run solidearthsettings solver during transient (default: 1)'))
+         s += '{}\n'.format(fielddisplay(self, 'rigid', 'rigid earth graviational potential perturbation'))
+         s += '{}\n'.format(fielddisplay(self, 'elastic', 'elastic earth graviational potential perturbation'))
+         s += '{}\n'.format(fielddisplay(self, 'degacc', 'accuracy (default .01 deg) for numerical discretization of the Green\'s functions'))
+         s += '{}\n'.format(fielddisplay(self, 'glfraction', 'contribute fractionally (default, 1) to barystatic sea level'))
++        s += '{}\n'.format(fielddisplay(self, 'grdmodel', 'type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins'))
++        s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', '1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore'))
+         return s
+     #}}}
+ 
+@@ -64,7 +70,8 @@
+         self.elastic = 1
+         self.rotation = 1
+         self.ocean_area_scaling = 0
+-        self.isgrd = 1
++        self.compute_bp_grd = 1
++        self.isgrd = 0
+         self.computesealevelchange = 1
+ 
+         # Numerical discretization accuracy
+@@ -78,6 +85,12 @@
+ 
+         # Horizontal displacement? (not on by default)
+         self.horiz = 0
++
++        # Cross section for Ivins model
++        self.cross_section_shape = 1 # Square as default (see iedde in GiaDeflectionCorex)
++
++        # No GRD model by default
++        self.grdmodel = 0
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses): # {{{
+@@ -90,22 +103,25 @@
+         md = checkfield(md, 'fieldname', 'solidearth.settings.degacc', 'size', [1], '>=', 1e-10)
+         md = checkfield(md, 'fieldname', 'solidearth.settings.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'solidearth.settings.glfraction', 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', 'values', [1, 2])
++        md = checkfield(md, 'fieldname', 'solidearth.settings.cross_section_shape', 'numel', [1], 'values', [1, 2])
+ 
+         # Checks on computational flags
+         if self.elastic and not self.rigid:
+             raise Exception('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set')
+ 
+-        # A coupler to planet model is provided
++        # A GRD computation has been requested, make some checks on the nature of the meshes provided
+         if self.isgrd:
+-            if md.transient.iscoupler:
+-                # We are good
+-                pass
+-            else:
+-                if md.mesh.__class__.__name__ == 'mesh3dsurface':
+-                    # We are good
+-                    pass
++            if md.mesh.__class__.__name__ is 'mesh3dsurface':
++                if self.grdmodel == 2:
++                    raise RuntimeException('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)')
+                 else:
+-                    raise Exception('model is requesting sealevel computations without being a mesh3dsurface, or being coupled to one!')
++                    if self.grdmodel == 1:
++                        raise RuntimeException('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)')
++
++        if self.compute_bp_grd and not md.solidearth.settings.isgrd:
++            raise RuntimeException('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on')
++
+         return md
+     #}}}
+ 
+@@ -122,7 +138,10 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'computesealevelchange', 'name', 'md.solidearth.settings.computesealevelchange', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname','isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname','glfraction', 'name', 'md.solidearth.settings.glfraction', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer')
+     #}}}
+ 
+     def extrude(self, md): #{{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26060-26061.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26060-26061.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26060-26061.diff	(revision 26740)
@@ -0,0 +1,96 @@
+Index: ../trunk-jpl/src/m/solvers/mumpsnoneoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/solvers/mumpsnoneoptions.py	(revision 26060)
++++ ../trunk-jpl/src/m/solvers/mumpsnoneoptions.py	(revision 26061)
+@@ -1,5 +1,6 @@
+ from pairoptions import pairoptions
+ from collections import OrderedDict
++from IssmConfig import IssmConfig
+ 
+ 
+ def mumpsoptions(*args):
+@@ -13,28 +14,26 @@
+     mumps = OrderedDict()
+ 
+     #default mumps options
+-    PETSC_MAJOR = IssmConfig('_PETSC_MAJOR_')
+-    PETSC_MINOR = IssmConfig('_PETSC_MINOR_')
++    PETSC_MAJOR = IssmConfig('_PETSC_MAJOR_')[0]
++    PETSC_MINOR = IssmConfig('_PETSC_MINOR_')[0]
+     if PETSC_MAJOR == 2:
+-        mumps.toolkit = 'petsc'
+-        mumps.mat_type = getfieldvalue(options, 'mat_type', 'aijmumps')
+-        mumps.ksp_type = getfieldvalue(options, 'ksp_type', 'preonly')
+-        mumps.pc_type = getfieldvalue(options, 'pc_type', 'lu')
+-        mumps.mat_mumps_icntl_14 = getfieldvalue(options, 'mat_mumps_icntl_14', 120)
+-    end
++        mumps['toolkit'] = 'petsc'
++        mumps['mat_type'] = options.getfieldvalue(options, 'mat_type', 'aijmumps')
++        mumps['ksp_type'] = options.getfieldvalue(options, 'ksp_type', 'preonly')
++        mumps['pc_type'] = options.getfieldvalue(options, 'pc_type', 'lu')
++        mumps['mat_mumps_icntl_14'] = options.getfieldvalue(options, 'mat_mumps_icntl_14', 120)
+ 
+     if PETSC_MAJOR == 3:
+-        mumps.toolkit = 'petsc'
+-        mumps.mat_type = getfieldvalue(options, 'mat_type', 'mpiaij')
+-        mumps.ksp_type = getfieldvalue(options, 'ksp_type', 'preonly')
+-        mumps.pc_type = getfieldvalue(options, 'pc_type', 'lu')
++        mumps['toolkit'] = 'petsc'
++        mumps['mat_type'] = options.getfieldvalue(options, 'mat_type', 'mpiaij')
++        mumps['ksp_type'] = options.getfieldvalue(options, 'ksp_type', 'preonly')
++        mumps['pc_type'] = options.getfieldvalue(options, 'pc_type', 'lu')
+         if PETSC_MINOR > 8:
+-            mumps.pc_factor_mat_solver_type = getfieldvalue(options, 'pc_factor_mat_solver_type', 'mumps')
++            mumps['pc_factor_mat_solver_type'] = options.getfieldvalue(options, 'pc_factor_mat_solver_type', 'mumps')
+         else:
+-            mumps.pc_factor_mat_solver_package = getfieldvalue(options, 'pc_factor_mat_solver_package', 'mumps')
+-        end
+-        mumps.mat_mumps_icntl_14 = getfieldvalue(options, 'mat_mumps_icntl_14', 120)
+-        mumps.mat_mumps_icntl_28 = 2; #1 = serial, 2 = parallel
+-        mumps.mat_mumps_icntl_29 = 2; #parallel ordering 1 = ptscotch, 2 = parmetis
+-    end
+-    return solverOptions
++            mumps['pc_factor_mat_solver_package'] = options.getfieldvalue(options, 'pc_factor_mat_solver_package', 'mumps')
++        mumps['mat_mumps_icntl_14'] = options.getfieldvalue(options, 'mat_mumps_icntl_14', 120)
++        mumps['mat_mumps_icntl_28'] = 2  #1 = serial, 2 = parallel
++        mumps['mat_mumps_icntl_29'] = 2  #parallel ordering 1 = ptscotch, 2 = parmetis
++
++    return mumps
+Index: ../trunk-jpl/src/m/solvers/mumpsoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/solvers/mumpsoptions.py	(revision 26060)
++++ ../trunk-jpl/src/m/solvers/mumpsoptions.py	(revision 26061)
+@@ -1,5 +1,5 @@
+ from collections import OrderedDict
+-import pairoptions
++from pairoptions import pairoptions
+ from IssmConfig import IssmConfig
+ 
+ 
+@@ -12,7 +12,7 @@
+     """
+ 
+     #retrieve options provided in varargin
+-    options = pairoptions.pairoptions(*args)
++    options = pairoptions(*args)
+     mumps = OrderedDict()
+ 
+     #default mumps options
+@@ -23,7 +23,7 @@
+         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['mat_mumps_icntl_14'] = options.options.getfieldvalue('mat_mumps_icntl_14', 120)
+     if PETSC_MAJOR == 3.:
+         mumps['toolkit'] = 'petsc'
+         mumps['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
+@@ -35,4 +35,8 @@
+             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)
+ 
++        #These 2 lines make raijin break (ptwgts error during solver with PETSc 3.3)
++        mumps['mat_mumps_icntl_28'] = options.getfieldvalue('mat_mumps_icntl_28', 1)  #1=serial, 2=parallel
++        mumps['mat_mumps_icntl_29'] = options.getfieldvalue('mat_mumps_icntl_29', 2)  #parallel ordering 1 = ptscotch, 2 = parmetis
++
+     return mumps
Index: /issm/oecreview/Archive/25834-26739/ISSM-26061-26062.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26061-26062.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26061-26062.diff	(revision 26740)
@@ -0,0 +1,72 @@
+Index: ../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.m	(revision 26061)
++++ ../trunk-jpl/src/m/classes/matice.m	(revision 26062)
+@@ -5,25 +5,25 @@
+ 
+ classdef matice
+ 	properties (SetAccess=public) 
+-		rho_ice                    = 0.;
+-		rho_water                  = 0.;
+-		rho_freshwater             = 0.;
+-		mu_water                   = 0.;
+-		heatcapacity               = 0.;
+-		latentheat                 = 0.;
+-		thermalconductivity        = 0.;
+-		temperateiceconductivity   = 0.;
++		rho_ice                         = 0.;
++		rho_water                       = 0.;
++		rho_freshwater                  = 0.;
++		mu_water                        = 0.;
++		heatcapacity                    = 0.;
++		latentheat                      = 0.;
++		thermalconductivity             = 0.;
++		temperateiceconductivity        = 0.;
+ 		effectiveconductivity_averaging = 0.;
+-		meltingpoint               = 0.;
+-		beta                       = 0.;
+-		mixed_layer_capacity       = 0.;
+-		thermal_exchange_velocity  = 0.;
+-		rheology_B   = NaN;
+-		rheology_n   = NaN;
+-		rheology_law = '';
++		meltingpoint                    = 0.;
++		beta                            = 0.;
++		mixed_layer_capacity            = 0.;
++		thermal_exchange_velocity       = 0.;
++		rheology_B                      = NaN;
++		rheology_n                      = NaN;
++		rheology_law                    = '';
+ 
+ 		%slc
+-		earth_density              = 0;
++		earth_density                   = 0;
+ 
+ 	end
+ 	methods
+@@ -115,6 +115,7 @@
+ 				md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
+ 				md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
+ 				md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
++			end
+ 
+ 		end % }}}
+ 		function disp(self) % {{{
+Index: ../trunk-jpl/src/m/classes/geometry.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.m	(revision 26061)
++++ ../trunk-jpl/src/m/classes/geometry.m	(revision 26062)
+@@ -84,10 +84,10 @@
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-
+-			if (size(self.thickness)==md.mesh.numberofvertices) | (size(self.thickness)==md.mesh.numberofvertices+1)),
++			length_thickness=size(self.thickness,1);
++			if length_thickness==md.mesh.numberofvertices | length_thickness==md.mesh.numberofvertices+1,
+ 				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			elseif (size(self.thickness)==md.mesh.numberofelements) | (size(self.thickness)==md.mesh.numberofelements+1)),
++			elseif length_thickness==md.mesh.numberofelements | length_thickness==md.mesh.numberofelements+1,
+ 				WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			else
+ 				error('geometry thickness time series should be a vertex or element time series');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26062-26063.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26062-26063.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26062-26063.diff	(revision 26740)
@@ -0,0 +1,183 @@
+Index: ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py
+===================================================================
+--- ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26062)
++++ ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26063)
+@@ -2,7 +2,7 @@
+ import numpy as np
+ import time
+ import collections
+-from inspect import isclass, getmodule
++from inspect import isclass
+ from os import path, remove
+ 
+ 
+@@ -46,6 +46,8 @@
+         StepNum = len(md.results.TransientSolution)
+     except AttributeError:  #no transient so just one timestep
+         StepNum = 1
++    except TypeError:  #this isnot a result so no results in there
++        StepNum = 0
+     TimeDim = NCData.createDimension('Time', StepNum)  # time is first
+     DimDict = {len(TimeDim): 'Time'}
+     dimindex = 1
+@@ -79,7 +81,11 @@
+             continue
+         NCgroup = NCData.createGroup(str(group))
+         # In each group gather the fields of the class
+-        fields = dict.keys(md.__dict__[group].__dict__)
++        try:
++            fields = dict.keys(md.__dict__[group].__dict__)
++        except AttributeError:
++            print("WARNING: md.{} as no fields, we skip it.".format(group))
++            continue
+         # looping on fields in each group
+         for field in fields:
+             # Special treatment for list fields
+@@ -219,6 +225,18 @@
+                             #and fill it up
+                             if ncvar is not None:
+                                 FillVar(ncvar, StackedVar)
++                elif type(md.__dict__[group].__dict__[field]).__name__ == 'dict':
++                    # designed for a dict in dummy but might be used elsewhere
++                    # there is no subgroup
++                    klass = type(md.__dict__[group]).__module__ + '.' + type(md.__dict__[group]).__name__
++                    NCgroup.__setattr__('classtype', klass)
++                    Var = md.__dict__[group].__dict__[field]
++                    Var = SqueezeVar(Var)
++                    if verbose > 4:
++                        print("=WW=creating var for {}.{}".format(group, field))
++                    DimDict, ncvar = CreateVar(NCData, Var, field, NCgroup, DimDict)
++                    if ncvar is not None:
++                        FillVar(ncvar, Var)
+                 else:
+                     klass = type(md.__dict__[group]).__module__ + '.' + type(md.__dict__[group]).__name__
+                     NCgroup.__setattr__('classtype', klass)
+@@ -257,7 +275,7 @@
+ 
+     # grab dimension
+     if val_type in [collections.OrderedDict, dict]:
+-        val_shape = len(var)
++        val_shape = len(var.keys())
+         val_dim = 2
+     else:
+         val_shape = np.shape(var)
+@@ -303,13 +321,13 @@
+             dimensions, DimDict = GetDim(NCData, val_shape, val_type, DimDict, val_dim)
+             ncvar = Group.createVariable(str(field), nctype, dimensions=dimensions, zlib=True)
+     # treating bool tables and dict as string tables
+-    elif val_type in ['bool', collections.OrderedDict, dict]:
++    elif val_type in [collections.OrderedDict, dict, 'bool']:
+         if val_shape in [(), (0,), 0]:
+             ncvar = Group.createVariable(str(field), str, zlib=True)
+         else:
+             dimensions, DimDict = GetDim(NCData, val_shape, val_type, DimDict, val_dim)
+             ncvar = Group.createVariable(str(field), str, dimensions=dimensions, zlib=True)
+-        # Now dealing with numeric variables
++    # Now dealing with numeric variables
+     elif val_type in [float, 'float64', np.float64, int, 'int64']:
+         if val_shape in [(), (0,), 0] and not SupDim:
+             ncvar = Group.createVariable(str(field), TypeDict[val_type], zlib=True)
+Index: ../trunk-jpl/src/m/io/loadvars.py
+===================================================================
+--- ../trunk-jpl/src/m/io/loadvars.py	(revision 26062)
++++ ../trunk-jpl/src/m/io/loadvars.py	(revision 26063)
+@@ -87,12 +87,12 @@
+         for mod in dict.keys(classtype):
+             #==== First we create the model structure  {{{
+             if debug:
+-                print(' - Now treating classtype {}'.format(mod))
++                print(' ==== Now treating classtype {}'.format(mod))
+             if np.size(classtree[mod]) > 1:
+                 # this points to a subclass (results.TransientSolution for example)
+                 curclass = NCFile.groups[classtree[mod][0]].groups[classtree[mod][1]]
+                 if debug:
+-                    print("===> {} is of class {}".format(mod, classtype[mod]))
++                    print("    ==> {} is of class {}".format(mod, classtype[mod]))
+                 if classtype[mod][0] == 'results.solutionstep':  #Treating results {{{
+                     keylist = [key for key in curclass.groups]
+                     # this is related to the old structure of NC files where every steps of results had its own group
+@@ -99,7 +99,6 @@
+                     #that is the current treatment
+                     #here we have a more NC approach with time being a dimension
+                     listtype = split(r'\.', classtype[mod][0])[0]
+-                    print("listtype is {}".format(listtype))
+                     if len(NCFile.dimensions['Time']) == 1:
+                         nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1], listtype)()
+                         Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
+@@ -125,11 +124,11 @@
+                 #}}}
+                 else:
+                     if debug:
+-                        print("Using the default for md.{}.{}, is that right??".format(classtree[mod][0], classtree[mod][1]))
++                        print("    Using the default for md.{}.{}, is that right??".format(classtree[mod][0], classtree[mod][1]))
+                     try:
+                         modulename = split(r'\.', classtype[mod][0])[0]
+                         if debug:
+-                            print("trying to import {} from {}".format(classtype[mod][0], modulename))
++                            print("    trying to import {} from {}".format(classtype[mod][0], modulename))
+                         nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1], modulename)()
+                     except AttributeError:
+                         print("WARNING: md.{}.{} is not initialized, hopefully that was done in the main group:".format(classtree[mod][0], classtree[mod][1]))
+@@ -140,7 +139,7 @@
+                 nvdict['md'].__dict__[mod] = getattr(classtype[mod][1], modulename)()
+                 Tree = nvdict['md'].__dict__[classtree[mod][0]]
+             if debug:
+-                print("for {} Tree is a {}".format(mod, Tree.__class__.__name__))
++                print("    for {} Tree is a {}".format(mod, Tree.__class__.__name__))
+             # }}}
+             #==== Then we populate it {{{
+             for i in range(0, max(1, len(curclass.groups))):
+@@ -151,7 +150,7 @@
+                 #==== We deal with Variables {{{
+                 for var in listclass.variables:
+                     if debug:
+-                        print("treating var {}".format(var))
++                        print("    ==> treating var {}".format(var))
+                     if var not in ['errlog', 'outlog']:
+                         varval = listclass.variables[str(var)]
+                         vardim = varval.ndim
+@@ -233,12 +232,16 @@
+ 
+                             elif vardim == 2:
+                                 #dealling with dict
+-                                if varval.dtype == str:  #that is for toolkits wich needs to be ordered
++                                if varval.dtype == str:  #that is for dictionaries
+                                     if any(varval[:, 0] == 'toolkit'):  #toolkit definition have to be first
+                                         Tree.__dict__[str(var)] = OrderedDict([('toolkit', str(varval[np.where(varval[:, 0] == 'toolkit')[0][0], 1]))])
+                                         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:
++                                        strings1 = [str(arg[0]) for arg in varval]
++                                        strings2 = [str(arg[1]) for arg in varval]
++                                        Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2)))
+                                 else:
+                                     if type(Tree) == list:
+                                         t = indexlist[i]
+@@ -263,7 +266,7 @@
+                 #==== And with atribute {{{
+                 for attr in listclass.ncattrs():
+                     if debug:
+-                        print("treating attribute {}".format(attr))
++                        print("      ==> treating attribute {}".format(attr))
+                     if attr != 'classtype':  #classtype is for treatment, don't get it back
+                         attribute = str(attr).swapcase()  #there is a reason for swapcase, no sure what it isanymore
+                         if attr == 'VARNAME':
+@@ -270,7 +273,7 @@
+                             attribute = 'name'
+                         if type(Tree) == list and NewFormat:
+                             if debug:
+-                                print("printing with index 0")
++                                print("        printing with index 0")
+                             if listtype == 'dict':
+                                 Tree[0][attribute] = str(listclass.getncattr(attr))
+                             else:
+@@ -278,7 +281,7 @@
+                         elif type(Tree) == list:
+                             t = int(indexlist[i])
+                             if debug:
+-                                print("printing with index {]".format(t))
++                                print("        printing with index {}".format(t))
+                             if listtype == 'dict':
+                                 Tree[t][attribute] = str(listclass.getncattr(attr))
+                             else:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26063-26064.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26063-26064.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26063-26064.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.py	(revision 26063)
++++ ../trunk-jpl/src/m/classes/transient.py	(revision 26064)
+@@ -107,7 +107,7 @@
+ 
+         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.isocealtransport', 'numel', [1], 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'transient.isoceantransport', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isstressbalance', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isthermal', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'transient.isgroundingline', 'numel', [1], 'values', [0, 1])
Index: /issm/oecreview/Archive/25834-26739/ISSM-26064-26065.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26064-26065.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26064-26065.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/m/classes/matdamageice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26064)
++++ ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26065)
+@@ -71,13 +71,13 @@
+ 
+ 			%ice thermal conductivity (W/m/K)
+ 			self.thermalconductivity=2.4;
+-			
++
+ 			%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
+ 			self.meltingpoint=273.15;
+ 
+Index: ../trunk-jpl/src/m/classes/matdamageice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26064)
++++ ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26065)
+@@ -113,11 +113,6 @@
+         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])
+ 
+         if 'SealevelriseAnalysis' in analyses:
+                 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26065-26066.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26065-26066.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26065-26066.diff	(revision 26740)
@@ -0,0 +1,141 @@
+Index: ../trunk-jpl/src/m/parameterization/parameterize.py
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/parameterize.py	(revision 26065)
++++ ../trunk-jpl/src/m/parameterization/parameterize.py	(revision 26066)
+@@ -3,19 +3,18 @@
+ 
+ 
+ def parameterize(md, parametername):
+-    '''
+-    PARAMETERIZE - parameterize a model
++    """PARAMETERIZE - parameterize a model
+ 
+-        From a parameter Python file, start filling in all the model fields 
+-        that were not filled in by the mesh.py and mask.py model methods.
+-        Warning: the parameter file must be able to be run in Python
++    From a parameter Python file, start filling in all the model fields that 
++    were not filled in by the mesh.py and mask.py model methods. Warning: the 
++    parameter file must be able to be run in Python
+ 
+-        Usage:
+-            md = parameterize(md, parametername)
++    Usage:
++        md = parameterize(md, parametername)
+ 
+-        Example:
+-            md = parameterize(md, 'Square.par')
+-    '''
++    Example:
++        md = parameterize(md, 'Square.py')
++    """
+ 
+     #some checks
+     if not os.path.exists(parametername):
+Index: ../trunk-jpl/test/Par/SquareSheetConstrained.par
+===================================================================
+--- ../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 26065)
++++ ../trunk-jpl/test/Par/SquareSheetConstrained.par	(revision 26066)
+@@ -59,7 +59,6 @@
+ md.timestepping.final_time=3.;
+ md.groundingline.migration='None';
+ 
+-
+ %Boundary conditions:
+ md=SetIceSheetBC(md);
+ 
+Index: ../trunk-jpl/test/Par/SquareSheetConstrained.py
+===================================================================
+--- ../trunk-jpl/test/Par/SquareSheetConstrained.py	(revision 26065)
++++ ../trunk-jpl/test/Par/SquareSheetConstrained.py	(revision 26066)
+@@ -18,6 +18,7 @@
+ 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.bed = md.geometry.base
+ md.geometry.surface = md.geometry.base + md.geometry.thickness
+ 
+ #Initial velocity
+@@ -60,14 +61,6 @@
+ 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.e21 * np.ones((md.mesh.numberofvertices))  # in Pa.s
+-md.materials.lithosphere_shear_modulus = 6.7e10  # in Pa
+-md.materials.lithosphere_density = 3.32  # in g / cm^ - 3
+-md.materials.mantle_shear_modulus = 1.45e11  # in Pa
+-md.materials.mantle_density = 3.34  # in g / cm^ - 3
+-
+ #Boundary conditions:
+ md = SetIceSheetBC(md)
+ 
+Index: ../trunk-jpl/src/m/classes/dsl.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.m	(revision 26065)
++++ ../trunk-jpl/src/m/classes/dsl.m	(revision 26066)
+@@ -64,7 +64,7 @@
+ 
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+-		
++
+ 			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
+ 			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
+ 			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
+@@ -84,7 +84,6 @@
+ 				self.sea_water_pressure_at_sea_floor=[zeros(md.mesh.numberofvertices,1);0];
+ 				disp('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero');
+ 			end
+-
+ 		end % }}}
+ 	
+ 	end
+Index: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 26065)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 26066)
+@@ -27,16 +27,24 @@
+         return s
+     #}}}
+ 
+-    def extrude(self, md): #{{{
+-        self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node')
+-        self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node')
+-        return self
+-    #}}}
+-
+     def defaultoutputs(self, md): #{{{
+         return []
+     #}}}
+ 
++    def initialize(self, md): #{{{
++        if np.isnan(self.global_average_thermosteric_sea_level):
++            self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
++            print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
++
++        if np.isnan(self.sea_surface_height_above_geoid):
++            self.sea_surface_height_above_geoid = np.array(np.zeros(md.mesh.numberofvertices)).reshape(-1, 1)
++            print('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero')
++
++        if np.isnan(self.sea_water_pressure_at_sea_floor):
++            self.sea_water_pressure_at_sea_floor = np.array(np.zeros(md.mesh.numberofvertices)).reshape(-1, 1)
++            print('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero')
++    #}}}
++
+     def checkconsistency(self, md, solution, analyses): #{{{
+         # Early return
+         if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+@@ -52,6 +60,12 @@
+         return md
+     # }}}
+ 
++    def extrude(self, md): #{{{
++        self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node')
++        self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node')
++        return self
++    #}}}
++
+     def marshall(self, prefix, md, fid):   #{{{
+         yts = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26066-26067.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26066-26067.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26066-26067.diff	(revision 26740)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26066)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26067)
+@@ -6,19 +6,9 @@
+ 
+ %parameterize solidearth solution:
+ %solidearth loading:  {{{
+-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+-%antarctica
+-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+-pos=find(late < -80);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+-%greenland
+-pos=find(late>70 & late<80 & longe>-60 & longe<-30);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++md.dsl.global_average_thermosteric_sea_level=[0;0];
++md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+@@ -33,14 +23,6 @@
+ icemask(md.mesh.elements(pos,:))=-1;
+ md.mask.ice_levelset=icemask;
+ md.mask.ocean_levelset=-icemask;
+-
+-%make sure that the elements that have loads are fully grounded:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
+-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+-
+-%make sure wherever there is an ice load, that the mask is set to ice:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
+-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+ % }}}
+ 
+ md.solidearth.settings.ocean_area_scaling=0;
+@@ -51,7 +33,6 @@
+ %Materials: 
+ md.materials=materials('hydro');
+ 
+-
+ %Miscellaneous
+ md.miscellaneous.name='test2002';
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26067-26068.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26067-26068.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26067-26068.diff	(revision 26740)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26067)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26068)
+@@ -6,9 +6,19 @@
+ 
+ %parameterize solidearth solution:
+ %solidearth loading:  {{{
+-md.dsl.global_average_thermosteric_sea_level=[0;0];
+-md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
++md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
++md.dsl.global_average_thermosteric_sea_level_change=[0;0];
++md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++%antarctica
++late=sum(md.mesh.lat(md.mesh.elements),2)/3;
++longe=sum(md.mesh.long(md.mesh.elements),2)/3;
++pos=find(late < -80);
++md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++%greenland
++pos=find(late>70 & late<80 & longe>-60 & longe<-30);
++md.solidearth.surfaceload.icethicknesschange(pos)=-100;
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+@@ -23,6 +33,14 @@
+ icemask(md.mesh.elements(pos,:))=-1;
+ md.mask.ice_levelset=icemask;
+ md.mask.ocean_levelset=-icemask;
++
++%make sure that the elements that have loads are fully grounded:
++pos=find(md.solidearth.surfaceload.icethicknesschange);
++md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
++
++%make sure wherever there is an ice load, that the mask is set to ice:
++pos=find(md.solidearth.surfaceload.icethicknesschange);
++md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+ % }}}
+ 
+ md.solidearth.settings.ocean_area_scaling=0;
+@@ -33,6 +51,7 @@
+ %Materials: 
+ md.materials=materials('hydro');
+ 
++
+ %Miscellaneous
+ md.miscellaneous.name='test2002';
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26068-26069.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26068-26069.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26068-26069.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26068)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26069)
+@@ -6136,10 +6136,6 @@
+ 	int         numtimes;
+ 	this->GetInputAveragesUpToCurrentTime(TransientAccumulatedDeltaIceThicknessEnum,&hes,&times,&numtimes,currenttime);
+ 
+-	if(this->Id()==1){
+-		_printf_("numtimes: " << numtimes << "\n");
+-		for (int i=0;i<numtimes;i++)_printf_(times[i] << " " << hes[i] << "\n");
+-	}
+ 
+ 	/*pull area of this Tria: */
+ 	IssmDouble area=this->GetArea();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26069-26070.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26069-26070.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26069-26070.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26069)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26070)
+@@ -886,7 +886,7 @@
+ 	/*What is the delta thickness forcing the sea-level change core: cumulated over time, hence the +=:*/
+ 	if(isgrd){
+ 		for(int i=0;i<numvertices;i++){
+-			cumdeltathickness[i] += newthickness[i]-oldthickness[i];
++			cumdeltathickness[i] += (newthickness[i]-oldthickness[i]);
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26070-26071.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26070-26071.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26070-26071.diff	(revision 26740)
@@ -0,0 +1,29 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26070)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26071)
+@@ -78,6 +78,12 @@
+ 	return;
+ }
+ /*}}}*/
++void Inputs::DeepEcho(int enum_in){/*{{{*/
++	int index= EnumToIndex(enum_in);
++	if(this->inputs[index])this->inputs[index]->DeepEcho();
++	return;
++}
++/*}}}*/
+ void Inputs::Marshall(MarshallHandle* marshallhandle){/*{{{*/
+ 
+ 	int num_inputs=0;
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26070)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26071)
+@@ -47,6 +47,7 @@
+ 		void     DuplicateInput(int original_enum,int new_enum);
+ 		void     AXPY(IssmDouble alpha, int xenum, int yenum, int zenum);
+ 		void     DeepEcho(void);
++		void     DeepEcho(int enum_in);
+ 		void     Echo(void);
+ 		bool     Exist(int enum_type);
+ 		void     GetInputsInterpolations(int* pnuminputs,int** pinterpolations,int** penum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26071-26072.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26071-26072.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26071-26072.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26071)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26072)
+@@ -256,7 +256,7 @@
+ 	if(!this->inputs[index_y]) _error_("Input "<<EnumToStringx(yenum)<<" not found");
+ 
+ 	/*Make a copy*/
+-	Input* z=this->inputs[index_y]->copy();
++	this->inputs[index_z]=this->inputs[index_y]->copy();
+ 
+ 	/*AXPY: */
+ 	this->inputs[index_z]->AXPY(this->inputs[index_x],alpha);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26072-26073.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26072-26073.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26072-26073.diff	(revision 26740)
@@ -0,0 +1,488 @@
+Index: ../trunk-jpl/src/c/classes/IoModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.h	(revision 26072)
++++ ../trunk-jpl/src/c/classes/IoModel.h	(revision 26073)
+@@ -122,6 +122,7 @@
+ 		/*Input/Output*/
+ 		void        CheckFile(void);
+ 		Param      *CopyConstantObject(const char* constant_name,int param_enum);
++		void        ConstantToInput(Inputs* inputs,Elements* elements,IssmDouble value, int vector_enum,int type);
+ 		IssmDouble *Data(const char* data_name);
+ 		void        DeclareIndependents(bool trace,IssmPDouble* X);
+ 		void        DeleteData(int num,...);
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 26072)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 26073)
+@@ -26,6 +26,9 @@
+ 		element->InputUpdateFromConstant(constant,name);
+ 	}
+ }
++
++
++
+ void InputUpdateFromConstantx(FemModel* femmodel,IssmDouble constant, int name){
+ 
+ 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
+@@ -59,6 +62,29 @@
+ 		element->SetElementInput(inputs,name,constant);
+ 	}
+ }
++
++void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,IssmDouble constant, int name,int type){
++
++	if(type==P0Enum) InputUpdateFromConstantx(inputs, elements, constant,name);
++	else if(type==P1Enum){
++
++		if(VerboseModule()) _printf0_("   Input updates from constant (P1 version)\n");
++
++		/*Elements and loads drive the update: */
++		if(IsInputEnum(name)){
++			for(Object* & object : elements->objects){
++				Element* element = xDynamicCast<Element*>(object);
++				element->InputUpdateFromConstant(constant,name,P1Enum);
++			}
++		}
++		else{
++			_error_("not supported yet");
++		}
++	}
++	else _error_("InputUpdateFromConstantx error message: type not supported yet!");
++
++	
++}
+ void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,bool constant, int name){
+ 
+ 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h	(revision 26072)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h	(revision 26073)
+@@ -16,6 +16,7 @@
+ void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,IssmPDouble constant,int name);
+ #endif
+ void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,IssmDouble constant,int name);
++void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,IssmDouble constant,int name, int type);
+ void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,bool       constant,int name);
+ 
+ #endif  /* _UPDATEINPUTSFROMCONSTANTXX_H */
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26072)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26073)
+@@ -226,8 +226,8 @@
+ 	}
+ 
+ 	/*Initialize sea level cumulated sea level loads :*/
+-	InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaIceThicknessEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaIceThicknessEnum);
++	iomodel->ConstantToInput(inputs,elements,0,AccumulatedDeltaIceThicknessEnum,P1Enum);
++	iomodel->ConstantToInput(inputs,elements,0,OldAccumulatedDeltaIceThicknessEnum,P1Enum);
+ 
+ 	/*for Ivins deformation model, initialize history of ice thickness changes:*/
+ 	iomodel->FindConstant(&grdmodel,"md.solidearth.settings.grdmodel");
+@@ -859,8 +859,6 @@
+ 	/*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);
+@@ -876,7 +874,6 @@
+ 	basalelement->GetInputListOnVertices(&oldsurface[0],SurfaceOldEnum);
+ 	basalelement->GetInputListOnVertices(&phi[0],MaskOceanLevelsetEnum);
+ 	basalelement->GetInputListOnVertices(&sealevel[0],SealevelEnum);
+-	if(isgrd)basalelement->GetInputListOnVertices(&cumdeltathickness[0],AccumulatedDeltaIceThicknessEnum);
+ 
+ 	/*Do we do grounding line migration?*/
+ 	bool isgroundingline;
+@@ -883,13 +880,6 @@
+ 	element->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
+ 	if(isgroundingline) basalelement->GetInputListOnVertices(&bed[0],BedEnum);
+ 
+-	/*What is the delta thickness forcing the sea-level change core: cumulated over time, hence the +=:*/
+-	if(isgrd){
+-		for(int i=0;i<numvertices;i++){
+-			cumdeltathickness[i] += (newthickness[i]-oldthickness[i]);
+-		}
+-	}
+-
+ 	/*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/
+ 	int hydroadjustment;
+ 	basalelement->FindParam(&hydroadjustment,MasstransportHydrostaticAdjustmentEnum);
+@@ -923,55 +913,10 @@
+ 	/*Add input to the element: */
+ 	element->AddBasalInput(SurfaceEnum,newsurface,P1Enum);
+ 	element->AddBasalInput(BaseEnum,newbase,P1Enum);
+-	if(isgrd){
+-		int grdmodel;
++	
+ 
+-		/*accumulate ice thickness changes: */
+-		element->AddBasalInput(AccumulatedDeltaIceThicknessEnum,cumdeltathickness,P1Enum);
+-
+-		/*for Ivins deformation model, keep history of ice thickness changes:*/
+-		element->FindParam(&grdmodel,GrdModelEnum);
+-		if(grdmodel==IvinsEnum){
+-			int *vertexlids = NULL;
+-			int *vertexsids= NULL;
+-			IssmDouble time;
+-
+-			TransientInput* transientinput = basalelement->inputs->GetTransientInput(TransientAccumulatedDeltaIceThicknessEnum);
+-
+-			/*Get values and lid list and recover vertices ids needed to initialize inputs*/
+-			vertexlids      = xNew<int>(numvertices);
+-			vertexsids      = xNew<int>(numvertices);
+-			element->FindParam(&time,TimeEnum);
+-			element->GetVerticesLidList(&vertexlids[0]);
+-			element->GetVerticesSidList(&vertexsids[0]);
+-
+-			/*Add the current time cumdeltathickness to the existing time series: */
+-			switch(element->ObjectEnum()){
+-				case TriaEnum:  transientinput->AddTriaTimeInput( time,numvertices,vertexlids,cumdeltathickness,P1Enum); break;
+-				default: _error_("Not implemented yet");
+-			}
+-			xDelete<int>(vertexlids);
+-			xDelete<int>(vertexsids);
+-		}
+-			
+-		/*compute total ice thickness change between two sea-level solver time steps, ie. every frequency*dt:*/
+-		if(count==frequency){
+-			IssmDouble* oldcumdeltathickness = xNew<IssmDouble>(numvertices);
+-
+-			basalelement->GetInputListOnVertices(&oldcumdeltathickness[0],OldAccumulatedDeltaIceThicknessEnum);
+-			element->AddBasalInput(OldAccumulatedDeltaIceThicknessEnum,cumdeltathickness,P1Enum);
+-			for(int i=0;i<numvertices;i++)deltathickness[i]=cumdeltathickness[i]-oldcumdeltathickness[i];
+-			element->AddBasalInput(DeltaIceThicknessEnum,deltathickness,P1Enum);
+-
+-			xDelete<IssmDouble>(oldcumdeltathickness);
+-		}
+-
+-	}
+-
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(newthickness);
+-	xDelete<IssmDouble>(cumdeltathickness);
+-	xDelete<IssmDouble>(deltathickness);
+ 	xDelete<IssmDouble>(newbase);
+ 	xDelete<IssmDouble>(newsurface);
+ 	xDelete<IssmDouble>(oldthickness);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26072)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26073)
+@@ -1708,6 +1708,26 @@
+ 	else _error_("Cannot add input for vector type " << vector_type << " (not supported)");
+ }
+ /*}}}*/
++void       Element::InputCreateP1FromConstant(Inputs* inputs,IoModel* iomodel,IssmDouble value_in,int vector_enum){/*{{{*/
++
++	const int NUM_VERTICES = this->GetNumberOfVertices();
++
++	int        vertexids[MAXVERTICES];
++	int        vertexlids[MAXVERTICES];
++	IssmDouble values[MAXVERTICES];
++
++	/*Recover vertices ids needed to initialize inputs*/
++	_assert_(iomodel->elements);
++	for(int i=0;i<NUM_VERTICES;i++){
++		vertexids[i] =reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
++		vertexlids[i]=iomodel->my_vertices_lids[vertexids[i]-1];
++	}
++
++	for(int i=0;i<NUM_VERTICES;i++) values[i]=value_in;
++	this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
++
++}
++/*}}}*/
+ void       Element::ControlInputCreate(IssmDouble* vector,IssmDouble* min_vector,IssmDouble* max_vector,Inputs* inputs,IoModel* iomodel,int M,int N,IssmDouble scale,int input_enum,int id){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -1947,6 +1967,15 @@
+ 	this->SetElementInput(name,constant);
+ }
+ /*}}}*/
++void       Element::InputUpdateFromConstant(IssmDouble constant, int name, int type){/*{{{*/
++
++	/*Check that name is an element input*/
++	if(!IsInputEnum(name)) return;
++
++	/*update input*/
++	this->SetElementInput(name,constant,type);
++}
++/*}}}*/
+ void       Element::InputUpdateFromConstant(bool constant, int name){/*{{{*/
+ 
+ 	/*Check that name is an element input*/
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26072)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26073)
+@@ -129,11 +129,13 @@
+ 		IssmDouble         IceVolumeAboveFloatation(IssmDouble* mask, bool scaled);
+ 		int                Id();
+ 		void               InputCreate(IssmDouble* vector,Inputs* inputs,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
++		void               InputCreateP1FromConstant(Inputs* inputs,IoModel* iomodel,IssmDouble value,int vector_enum);
+ 		void               ControlInputCreate(IssmDouble* doublearray,IssmDouble* independents_min,IssmDouble* independents_max,Inputs*inputs,IoModel* iomodel,int M,int N,IssmDouble scale,int input_enum,int id);
+ 		void					 DatasetInputAdd(int enum_type,IssmDouble* vector,Inputs* inputs,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code,int input_enum);
+ 		void               InputUpdateFromConstant(IssmDouble constant, int name);
+ 		void               InputUpdateFromConstant(int constant, int name);
+ 		void               InputUpdateFromConstant(bool constant, int name);
++		void               InputUpdateFromConstant(IssmDouble constant, int name, int type);
+ 
+ 		bool               IsFloating();
+ 		bool               IsGrounded();
+@@ -330,7 +332,8 @@
+ 		virtual void       ResetFSBasalBoundaryCondition()=0;
+ 		virtual void       ResetHooks()=0;
+ 		virtual void       RignotMeltParameterization(void){_error_("not implemented yet");};
+-		virtual void       SetElementInput(int enum_in,IssmDouble values){_error_("not implemented yet");};
++		virtual void       SetElementInput(int enum_in,IssmDouble value){_error_("not implemented yet");};
++		virtual void       SetElementInput(int enum_in,IssmDouble value, int type)=0;
+ 		virtual void       SetElementInput(Inputs* inputs,int enum_in,IssmDouble values){_error_("not implemented yet");};
+ 		virtual void       SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in){_error_("not implemented yet");};
+ 		virtual void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M,int N)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26072)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26073)
+@@ -164,8 +164,10 @@
+ 		void           ResetFSBasalBoundaryCondition(void);
+ 		void           ResetHooks();
+ 		void				RignotMeltParameterization();
+-		void           SetElementInput(int enum_in,IssmDouble values);
+-		void           SetElementInput(Inputs* inputs,int enum_in,IssmDouble values);
++		void           SetElementInput(int enum_in,IssmDouble value);
++		void           SetElementInput(int enum_in,IssmDouble value,int type){_error_("not implemented yet");};
++		void           SetElementInput(Inputs* inputs,int enum_in,IssmDouble value);
++		void           SetElementInput(Inputs* inputs,int enum_in,IssmDouble value,int type){_error_("not implemented yet");};
+ 		void           SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in);
+ 		void           SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset, int M,int N);
+ 		void           SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26072)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26073)
+@@ -138,6 +138,7 @@
+ 		void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
+ 	   Element*    SpawnBasalElement(bool depthaverage_materials){_error_("not implemented yet");};
+ 		Element*    SpawnTopElement(void){_error_("not implemented yet");};
++		void       SetElementInput(int enum_in,IssmDouble value, int type){_error_("not implemented yet");};
+ 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+ 		void        StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy,  IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
+ 		void        StrainRateparallel(void){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26072)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26073)
+@@ -142,6 +142,8 @@
+ 		void        SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M, int N){_error_("not implemented yet");};
+ 		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
+ 		void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
++		void        SetElementInput(Inputs* inputs,int enum_in,IssmDouble value,int type){_error_("not implemented yet");};
++		void        SetElementInput(int enum_in, IssmDouble value, int type){_error_("not implemented yet");};
+ 	   Element*    SpawnBasalElement(bool depthaverage_materials);
+ 		Element*    SpawnTopElement(void);
+ 		Tria*       SpawnTria(int index1,int index2,int index3);
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26072)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26073)
+@@ -4178,6 +4178,21 @@
+ 
+ }
+ /*}}}*/
++void       Tria::SetElementInput(int enum_in,IssmDouble value,int type){/*{{{*/
++
++	if(type==P0Enum){
++		this->inputs->SetTriaInput(enum_in,P0Enum,this->lid,value);
++	}
++	else if(type==P1Enum){
++		IssmDouble values[3]; 
++		for(int i=0;i<3;i++)values[i]=value;
++		int lidlist[3];
++		this->GetVerticesLidList(&lidlist[0]);
++		this->inputs->SetTriaInput(enum_in,P1Enum,3,&lidlist[0],&values[0]);
++	}
++	else _error_("interpolation type not supported yet");
++}
++/*}}}*/
+ void       Tria::SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in){/*{{{*/
+ 
+ 	_assert_(inputs);
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26072)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26073)
+@@ -125,8 +125,9 @@
+ 		void        ResetHooks();
+ 		void        ResetLevelsetFromSegmentlist(IssmDouble* segments,int numsegments);
+ 		void        RignotMeltParameterization();
+-		void        SetElementInput(int enum_in,IssmDouble values);
+-		void        SetElementInput(Inputs* inputs,int enum_in,IssmDouble values);
++		void        SetElementInput(int enum_in,IssmDouble value);
++		void        SetElementInput(int enum_in,IssmDouble value,int type);
++		void        SetElementInput(Inputs* inputs,int enum_in,IssmDouble value);
+ 		void        SetElementInput(Inputs* inputs,int numindices,int* indices,IssmDouble* values,int enum_in);
+ 		void        SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M,int N);
+ 		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26072)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26073)
+@@ -448,6 +448,18 @@
+ 	return NULL;
+ }
+ /*}}}*/
++void  IoModel::ConstantToInput(Inputs* inputs,Elements* elements,IssmDouble value, int vector_enum,int type){/*{{{*/
++
++	if (type==P1Enum){
++		for(Object* & object : elements->objects){
++			Element* element=xDynamicCast<Element*>(object);
++			element->InputCreateP1FromConstant(inputs,this,value,vector_enum);
++		}
++	}
++	else _error_("not supported yet!");
++	return;
++}
++/*}}}*/
+ void  IoModel::DeclareIndependents(bool trace,IssmPDouble* X){/*{{{*/
+ 
+ 	bool autodiff,iscontrol;
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26072)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26073)
+@@ -8,8 +8,10 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
++#include "../classes/Inputs/TransientInput.h"
++void SolidEarthUpdates(FemModel* femmodel);
+ 
+-void masstransport_core(FemModel* femmodel){
++void masstransport_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*Start profiler*/
+ 	femmodel->profiler->Start(MASSTRANSPORTCORE);
+@@ -74,6 +76,8 @@
+ 			//	femmodel->ThicknessAverage();
+ 			//}
+ 		}
++		SolidEarthUpdates(femmodel);
++		
+ 		femmodel->parameters->SetParam(ThicknessEnum,InputToExtrudeEnum);
+ 		extrudefrombase_core(femmodel);
+ 		femmodel->parameters->SetParam(BaseEnum,InputToExtrudeEnum);
+@@ -80,6 +84,7 @@
+ 		extrudefrombase_core(femmodel);
+ 		femmodel->parameters->SetParam(SurfaceEnum,InputToExtrudeEnum);
+ 		extrudefrombase_core(femmodel);
++		
+ 	}
+ 
+ 	if(save_results){
+@@ -93,4 +98,64 @@
+ 
+ 	/*profiler*/
+ 	femmodel->profiler->Stop(MASSTRANSPORTCORE);
+-}
++} /*}}}*/
++void SolidEarthUpdates(FemModel* femmodel){ /*{{{*/
++
++	int isgrd;
++	int grdmodel;
++	IssmDouble time;
++	int frequency,count;
++
++	/*retrieve parameters:*/
++	femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum);
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	femmodel->parameters->FindParam(&time,TimeEnum);
++	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
++	
++	/*early return?:*/
++	if(!isgrd)return;
++
++	/*From old and new thickness, create delta thickness  and accumulate:*/
++	femmodel->inputs->AXPY(-1, ThicknessOldEnum,ThicknessEnum,DeltaIceThicknessEnum);
++	femmodel->inputs->AXPY(+1, DeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum,DummyEnum);
++	femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaIceThicknessEnum);
++
++	/*for Ivins deformation model, keep history of ice thickness changes inside TransientAccumulatedDeltaIceThicknessEnum:*/
++	if(grdmodel==IvinsEnum){
++
++		TransientInput* transientinput = femmodel->inputs->GetTransientInput(TransientAccumulatedDeltaIceThicknessEnum);
++
++		for(Object* & object : femmodel->elements->objects){
++			int *vertexlids = NULL;
++			int *vertexsids= NULL;
++			Element*   element=xDynamicCast<Element*>(object);
++			const int numvertices = element->GetNumberOfVertices();
++			IssmDouble* cumdeltathickness=NULL;
++
++			/*Get values and lid list and recover vertices ids needed to initialize inputs*/
++			vertexlids      = xNew<int>(numvertices);
++			vertexsids      = xNew<int>(numvertices);
++			cumdeltathickness=xNew<IssmDouble>(numvertices);
++			element->GetVerticesLidList(&vertexlids[0]);
++			element->GetVerticesSidList(&vertexsids[0]);
++			element->GetInputListOnVertices(&cumdeltathickness[0],AccumulatedDeltaIceThicknessEnum);
++
++			/*Add the current time cumdeltathickness to the existing time series: */
++			switch(element->ObjectEnum()){
++				case TriaEnum:  transientinput->AddTriaTimeInput( time,numvertices,vertexlids,cumdeltathickness,P1Enum); break;
++				default: _error_("Not implemented yet");
++			}
++			xDelete<int>(vertexlids);
++			xDelete<int>(vertexsids);
++			xDelete<IssmDouble>(cumdeltathickness);
++		}
++	}	
++
++	/*compute total ice thickness change between two sea-level solver time steps, ie. every frequency*dt:*/
++	if(count==frequency){
++		femmodel->inputs->AXPY(-1, OldAccumulatedDeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum,DeltaIceThicknessEnum);
++		femmodel->inputs->DuplicateInput(AccumulatedDeltaIceThicknessEnum,OldAccumulatedDeltaIceThicknessEnum);
++	}
++	return;
++}/*}}}*/
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26072)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26073)
+@@ -6,6 +6,7 @@
+ 
+ %GIA Ivins, 2 layer model.
+ md.solidearth.settings.grdmodel=2;
++md.solidearth.settings.isgrd=1;
+ 
+ md.materials=materials('litho','ice');
+ md.materials.numlayers=2;
+@@ -21,8 +22,8 @@
+ %Loading history 
+ md.timestepping.start_time=-2400000; %4,800 kyr :: EVALUATION TIME
+ md.timestepping.time_step= 2400000; %2,400 kyr :: EVALUATION TIME
+-% to get rid of default final_time, make sure final_time > start_time
+-md.timestepping.final_time=2400000; %2,400 kyr
++% to get rid of default final_time: make sure final_time>start_time
++md.timestepping.final_time=2400000; %2,500 kyr
+ md.masstransport.spcthickness=[...
+ 	[md.geometry.thickness; 0],...
+ 	[md.geometry.thickness; 2400000]...
+@@ -48,8 +49,9 @@
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'UGrd'};
+-field_tolerances={1e-13};
++field_names     ={'UGia','UGiaRate'};
++field_tolerances={1e-13,1e-13};
+ field_values={...
+-	(md.results.TransientSolution(1).SealevelUGrd)
++	(md.results.TransientSolution(2).SealevelUGrd),
++	(md.results.TransientSolution(2).SealevelUGrd)
+ 	};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26073-26074.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26073-26074.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26073-26074.diff	(revision 26740)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26073)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26074)
+@@ -193,7 +193,6 @@
+ 								default:
+ 									_error_("Mesh not supported yet");
+ 							}
+-							_printf_("Matice " << nnat << "\n");
+ 						} /*}}}*/
+ 						break;
+ 					case MatlithoEnum:
+@@ -201,7 +200,6 @@
+ 							iomodel->FetchData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
+ 							materials->AddObject(new Matlitho(materials->Size()+1,iomodel));
+ 							iomodel->DeleteData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
+-							_printf_("Matlitho " << nnat << "\n");
+ 						}
+ 						/*}}}*/
+ 						break;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26074-26075.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26074-26075.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26074-26075.diff	(revision 26740)
@@ -0,0 +1,204 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp	(revision 26074)
++++ ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp	(revision 26075)
+@@ -37,8 +37,8 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.hydrology.spcwatercolum", HydrologyTwsSpcEnum);
+ 
+ 	/*Initialize sea level cumulated sea level loads :*/
+-	InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaTwsEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaTwsEnum);
++	iomodel->ConstantToInput(inputs,elements,0.,AccumulatedDeltaTwsEnum,P1Enum);
++	iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaTwsEnum,P1Enum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum);
+ 
+ 
+@@ -78,14 +78,6 @@
+ 	/*Only update if on base*/
+ 	if(!element->IsOnBase()) return;
+ 
+-	/*deal with logic of accumulating thickness if we are coupled to a 
+-	 * sea level core:*/
+-	int frequency,count,isgrd;
+-	element->FindParam(&isgrd,SolidearthSettingsGRDEnum);
+-	if(isgrd){
+-		element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+-		element->FindParam(&count,SealevelchangeRunCountEnum);
+-	}	
+ 	/*Fetch dof list and allocate solution vector*/
+ 	int *doflist = NULL;
+ 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -105,52 +97,6 @@
+ 	xDelete<int>(doflist);
+ 	xDelete<IssmDouble>(watercolumn);
+ 
+-	/*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"*/
+-	watercolumn  = xNew<IssmDouble>(numvertices);
+-	IssmDouble* oldwatercolumn      = xNew<IssmDouble>(numvertices);
+-	IssmDouble* cumdeltawatercolumn = xNew<IssmDouble>(numvertices);
+-	IssmDouble* oldcumdeltawatercolumn = xNew<IssmDouble>(numvertices);
+-	IssmDouble* deltawatercolumn = xNew<IssmDouble>(numvertices);
+-
+-	/*Get previous base, tws, surfac and current sealevel and bed:*/
+-	basalelement->GetInputListOnVertices(&watercolumn[0],WatercolumnEnum);
+-	basalelement->GetInputListOnVertices(&oldwatercolumn[0],WaterColumnOldEnum);
+-	basalelement->GetInputListOnVertices(&cumdeltawatercolumn[0],AccumulatedDeltaTwsEnum);
+-
+-	/*What is the delta tws forcing the sea-level change core: cumulated over time, hence the +=:*/
+-	if(isgrd){
+-		for(int i=0;i<numvertices;i++){
+-			cumdeltawatercolumn[i] += watercolumn[i]-oldwatercolumn[i];
+-		}
+-	}
+-
+-	/*Add input to the element: */
+-	if(isgrd){
+-		element->AddBasalInput(AccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);
+-		if(count==frequency){
+-			basalelement->GetInputListOnVertices(&oldcumdeltawatercolumn[0],OldAccumulatedDeltaTwsEnum);
+-			element->AddBasalInput(OldAccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);
+-			for(int i=0;i<numvertices;i++)deltawatercolumn[i]=cumdeltawatercolumn[i]-oldcumdeltawatercolumn[i];
+-			element->AddBasalInput(DeltaTwsEnum,deltawatercolumn,P1Enum);
+-		}
+-	}
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(watercolumn);
+-	xDelete<IssmDouble>(deltawatercolumn);
+-	xDelete<IssmDouble>(cumdeltawatercolumn);
+-	xDelete<IssmDouble>(oldcumdeltawatercolumn);
+-	xDelete<IssmDouble>(oldwatercolumn);
+-	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           HydrologyTwsAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26074)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26075)
+@@ -8,8 +8,9 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
++void SolidEarthWaterUpdates(FemModel* femmodel);
+ 
+-void hydrology_core(FemModel* femmodel){
++void hydrology_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*Start profiler*/
+ 	femmodel->profiler->Start(HYDROLOGYCORE);
+@@ -42,7 +43,10 @@
+ 		solutionsequence_nonlinear(femmodel,modify_loads);
+ 		/*transfer water column thickness to old water column thickness: */
+ 		InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
++		/*solid earth considerations:*/
++		SolidEarthWaterUpdates(femmodel);
+ 
++
+ 	}
+ 	/*Using the Tws based Model*/
+ 	if (hydrology_model==HydrologyTwsEnum){
+@@ -58,6 +62,10 @@
+ 		Vector<IssmDouble>*  ug  = NULL;
+ 		GetVectorFromInputsx(&ug,femmodel,HydrologyTwsSpcEnum,VertexPIdEnum);
+ 		InputUpdateFromSolutionx(femmodel,ug); 
++
++		/*solid earth considerations:*/
++		SolidEarthWaterUpdates(femmodel);
++
+ 		delete ug;
+ 	
+ 	}
+@@ -218,4 +226,33 @@
+ 	}
+ 	/*End profiler*/
+ 	femmodel->profiler->Stop(HYDROLOGYCORE);
+-}
++} /*}}}*/
++void SolidEarthWaterUpdates(FemModel* femmodel){ /*{{{*/
++
++	int isgrd;
++	int grdmodel;
++	IssmDouble time;
++	int frequency,count;
++
++	/*retrieve parameters:*/
++	femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum);
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	femmodel->parameters->FindParam(&time,TimeEnum);
++	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
++	
++	/*early return?:*/
++	if(!isgrd)return;
++
++	/*From old and new thickness, create delta thickness  and accumulate:*/
++	femmodel->inputs->AXPY(-1, WaterColumnOldEnum,WatercolumnEnum,DeltaTwsEnum);
++	femmodel->inputs->AXPY(+1, DeltaTwsEnum,AccumulatedDeltaTwsEnum,DummyEnum);
++	femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaTwsEnum);
++
++	/*compute total water column change between two sea-level solver time steps, ie. every frequency*dt:*/
++	if(count==frequency){
++		femmodel->inputs->AXPY(-1, OldAccumulatedDeltaTwsEnum,AccumulatedDeltaTwsEnum,DeltaTwsEnum);
++		femmodel->inputs->DuplicateInput(AccumulatedDeltaTwsEnum,OldAccumulatedDeltaTwsEnum);
++	}
++	return;
++}/*}}}*/
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26074)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26075)
+@@ -9,8 +9,7 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ #include "../classes/Inputs/TransientInput.h"
+-void SolidEarthUpdates(FemModel* femmodel);
+-
++void SolidEarthIceUpdates(FemModel* femmodel);
+ void masstransport_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*Start profiler*/
+@@ -76,7 +75,7 @@
+ 			//	femmodel->ThicknessAverage();
+ 			//}
+ 		}
+-		SolidEarthUpdates(femmodel);
++		SolidEarthIceUpdates(femmodel);
+ 		
+ 		femmodel->parameters->SetParam(ThicknessEnum,InputToExtrudeEnum);
+ 		extrudefrombase_core(femmodel);
+@@ -99,7 +98,7 @@
+ 	/*profiler*/
+ 	femmodel->profiler->Stop(MASSTRANSPORTCORE);
+ } /*}}}*/
+-void SolidEarthUpdates(FemModel* femmodel){ /*{{{*/
++void SolidEarthIceUpdates(FemModel* femmodel){ /*{{{*/
+ 
+ 	int isgrd;
+ 	int grdmodel;
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26074)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26075)
+@@ -49,9 +49,6 @@
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'UGia','UGiaRate'};
+-field_tolerances={1e-13,1e-13};
+-field_values={...
+-	(md.results.TransientSolution(2).SealevelUGrd),
+-	(md.results.TransientSolution(2).SealevelUGrd)
+-	};
++field_names     ={'UGrd'};
++field_tolerances={1e-13};
++field_values={md.results.TransientSolution(2).SealevelUGrd};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26075-26076.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26075-26076.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26075-26076.diff	(revision 26740)
@@ -0,0 +1,137 @@
+Index: ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(revision 26075)
++++ ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(revision 26076)
+@@ -55,8 +55,8 @@
+ 	}
+ 
+ 	/*Initialize sea level cumulated sea level loads :*/
+-	InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaBottomPressureEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaBottomPressureEnum);
++	iomodel->ConstantToInput(inputs,elements,0.,AccumulatedDeltaBottomPressureEnum,P1Enum);
++	iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaBottomPressureEnum,P1Enum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.bottompressure",BottomPressureEnum);
+ 
+ 
+@@ -157,8 +157,6 @@
+ 
+ 	int         i,domaintype;
+ 	int*        doflist=NULL;
+-	int         isgrd=0;
+-	int         frequency,count;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+@@ -197,58 +195,10 @@
+ 	element->AddInput(DslEnum,dsl,P1Enum);
+ 	element->AddInput(StrEnum,&strmean,P0Enum); 
+ 
+-	/*Now, we need to do some "processing"*/
+-	IssmDouble* oldbp      = xNew<IssmDouble>(numnodes);
+-	IssmDouble* cumdeltabp = xNew<IssmDouble>(numnodes);
+-	IssmDouble* oldcumdeltabp = xNew<IssmDouble>(numnodes);
+-	IssmDouble* deltabp = xNew<IssmDouble>(numnodes);
+-	IssmDouble* olddsl      = xNew<IssmDouble>(numnodes);
+-	IssmDouble* deltadsl      = xNew<IssmDouble>(numnodes);
+-	IssmDouble  oldstr,deltastr;
+-
+-	/*Deal with bottom pressure first. First get previous bottom pressure:*/
+-	element->GetInputListOnVertices(&oldbp[0],BottomPressureOldEnum);
+-	element->FindParam(&isgrd,SolidearthSettingsGRDEnum);
+-	if(isgrd)element->GetInputListOnVertices(&cumdeltabp[0],AccumulatedDeltaBottomPressureEnum);
+-
+-	/*What is the delta bottompressure forcing the sea-level change core: cumulated over time, hence the +=:*/
+-	if(isgrd){
+-		for(int i=0;i<numnodes;i++){
+-			cumdeltabp[i] += bp[i]-oldbp[i];
+-		}
+-	}
+-
+-	/*Add input to the element: */
+-	if(isgrd){
+-		element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+-		element->FindParam(&count,SealevelchangeRunCountEnum);
+-		element->AddInput(AccumulatedDeltaBottomPressureEnum,cumdeltabp,P1Enum);
+-		if(count==frequency){
+-			element->GetInputListOnVertices(&oldcumdeltabp[0],OldAccumulatedDeltaBottomPressureEnum);
+-			element->AddInput(OldAccumulatedDeltaBottomPressureEnum,cumdeltabp,P1Enum);
+-			for(int i=0;i<numnodes;i++)deltabp[i]=cumdeltabp[i]-oldcumdeltabp[i];
+-			element->AddInput(DeltaBottomPressureEnum,deltabp,P1Enum);
+-
+-		}
+-	}
+-
+-	/*Deal with dsl and str:*/
+-	element->GetInputListOnVertices(&olddsl[0],DslOldEnum);
+-	element->GetInputValue(&oldstr,StrOldEnum);
+-	for (int i=0;i<numnodes;i++) deltadsl[i]=dsl[i]-olddsl[i];
+-	deltastr=strmean-oldstr;
+-	element->AddInput(DeltaDslEnum,deltadsl,P1Enum);
+-	element->AddInput(DeltaStrEnum,&deltastr,P0Enum);
+-
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(bp);
+-	xDelete<IssmDouble>(deltabp);
+-	xDelete<IssmDouble>(cumdeltabp);
+-	xDelete<IssmDouble>(oldcumdeltabp);
+-	xDelete<IssmDouble>(oldbp);
++	xDelete<IssmDouble>(str);
+ 	xDelete<IssmDouble>(dsl);
+-	xDelete<IssmDouble>(olddsl);
+-	xDelete<IssmDouble>(deltadsl);
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<int>(doflist);
+ 
+Index: ../trunk-jpl/src/c/cores/oceantransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26075)
++++ ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26076)
+@@ -9,7 +9,8 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
+-void oceantransport_core(FemModel* femmodel){
++void SolidEarthOceanUpdates(FemModel* femmodel);
++void oceantransport_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*Start profiler*/
+ 	femmodel->profiler->Start(OCEANTRANSPORTCORE);
+@@ -49,4 +50,37 @@
+ 
+ 	/*profiler*/
+ 	femmodel->profiler->Stop(OCEANTRANSPORTCORE);
+-}
++} /*}}}*/
++void SolidEarthOceanUpdates(FemModel* femmodel){ /*{{{*/
++
++	int isgrd;
++	int grdmodel;
++	IssmDouble time;
++	int frequency,count;
++
++	/*retrieve parameters:*/
++	femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum);
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	femmodel->parameters->FindParam(&time,TimeEnum);
++	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
++	
++	/*early return?:*/
++	if(!isgrd)return;
++
++	/* From old and new bottom pressures, create delta bottom pressure, delta dsl and delta str. 
++	 * Accumulate delta bottom pressure: */
++	femmodel->inputs->AXPY(-1, BottomPressureOldEnum,BottomPressureEnum,DeltaBottomPressureEnum);
++	femmodel->inputs->AXPY(+1, DeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum,DummyEnum);
++	femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaBottomPressureEnum);
++
++	femmodel->inputs->AXPY(-1, DslOldEnum,DslEnum,DeltaDslEnum);
++	femmodel->inputs->AXPY(-1, StrOldEnum,StrEnum,DeltaStrEnum);
++
++	/* Compute total bottom pressure change between two sea-level solver time steps, ie. every frequency*dt. */
++	if(count==frequency){
++		femmodel->inputs->AXPY(-1, OldAccumulatedDeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum,DeltaBottomPressureEnum);
++		femmodel->inputs->DuplicateInput(AccumulatedDeltaBottomPressureEnum,OldAccumulatedDeltaBottomPressureEnum);
++	}
++	return;
++}/*}}}*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26076-26077.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26076-26077.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26076-26077.diff	(revision 26740)
@@ -0,0 +1,378 @@
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26076)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26077)
+@@ -6,19 +6,19 @@
+ 
+ %parameterize solidearth solution:
+ %solidearth loading:  {{{
+-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.masstransport.spcthickness=zeros(md.mesh.numberofelements+1,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.dsl.global_average_thermosteric_sea_level=[0;0];
++md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ %antarctica
+ late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+ longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ pos=find(late < -80);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++md.masstransport.spcthickness(pos)=-100;
+ %greenland
+ pos=find(late>70 & late<80 & longe>-60 & longe<-30);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++md.masstransport.spcthickness(pos)=-100;
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+@@ -35,19 +35,26 @@
+ md.mask.ocean_levelset=-icemask;
+ 
+ %make sure that the elements that have loads are fully grounded:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
++pos=find(md.masstransport.spcthickness);
+ md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+ 
+ %make sure wherever there is an ice load, that the mask is set to ice:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
++pos=find(md.masstransport.spcthickness);
+ md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+ % }}}
+ 
+-md.solidearth.settings.ocean_area_scaling=0;
+-
+ %Geometry for the bed, arbitrary: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.thickness=zeros(md.mesh.numberofvertices,1);
++md.geometry.surface=zeros(md.mesh.numberofvertices,1);
++md.geometry.base=zeros(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.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++
+ %Materials: 
+ md.materials=materials('hydro');
+ 
+@@ -59,7 +66,18 @@
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+ md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
+ 
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++
++
+ % max number of iteration reverted back to 10 (i.e., the original default value)
+ md.solidearth.settings.maxiter=10;
+ 
+@@ -67,29 +85,29 @@
+ md.solidearth.settings.rigid=0;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelchange');
+-Seustatic=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'Transient');
++Seustatic=md.results.TransientSolution.Sealevel;
+ 
+ %eustatic + rigid run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelchange');
+-Srigid=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'tr');
++Srigid=md.results.TransientSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelchange');
+-Selastic=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'tr');
++Selastic=md.results.TransientSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
+-md=solve(md,'Sealevelchange');
+-Srotation=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'tr');
++Srotation=md.results.TransientSolution.Sealevel;
+ 
+ %Fields and tolerances to track changes
+ field_names={'Eustatic','Rigid','Elastic','Rotation'};
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26076)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26077)
+@@ -6,17 +6,17 @@
+ 
+ %parameterize slc solution:
+ %solidearth loading:  {{{
+-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.masstransport.spcthickness=zeros(md.mesh.numberofelements,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.dsl.global_average_thermosteric_sea_level=[0;0];
++md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ 
+ %antarctica
+ late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+ longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ pos=find(late <-75 & longe <0);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-1;
++md.masstransport.spcthickness(pos)=-1;
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+@@ -33,11 +33,11 @@
+ md.mask.ocean_levelset=-icemask;
+ 
+ %make sure that the elements that have loads are fully grounded:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
++pos=find(md.masstransport.spcthickness);
+ md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+ 
+ %make sure wherever there is an ice load, that the mask is set to ice:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
++pos=find(md.masstransport.spcthickness);
+ md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+ % }}}
+ 
+@@ -56,6 +56,11 @@
+ md.materials.rheology_B=paterson(md.initialization.temperature);
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+ 
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++
+ %Miscellaneous
+ md.miscellaneous.name='test2003';
+ 
+@@ -63,7 +68,18 @@
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+ md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
+ 
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++
++
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+@@ -70,8 +86,8 @@
+ md.solidearth.settings.rotation=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+ %md.verbose=verbose('111111111');
+-md=solve(md,'Sealevelchange');
+-SnoRotation=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'Transient');
++SnoRotation=md.results.TransientSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+@@ -79,8 +95,8 @@
+ md.solidearth.settings.rotation=1;
+ md.cluster=generic('name',oshostname(),'np',3);
+ %md.verbose=verbose('111111111');
+-md=solve(md,'Sealevelchange');
+-SRotation=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'Transient');
++SRotation=md.results.TransientSolution.Sealevel;
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'noRotation','Rotation'};
+Index: ../trunk-jpl/test/NightlyRun/test2004.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26076)
++++ ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26077)
+@@ -137,8 +137,8 @@
+ 	%Slc: {{{
+ 	if bas.iscontinentany('antarctica'),
+ 		if testagainst2002,
+-			% TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.solidearth.surfaceload.icethicknesschange(pos)'
+-			md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
++			% TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.masstransport.spcthickness(pos)'
++			md.masstransport.spcthickness=zeros(md.mesh.numberofelements,1);
+ 			%antarctica
+ 			late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+ 			longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+@@ -145,7 +145,7 @@
+ 			pos=find(late <-85);
+ 			ratio=0.225314032985172/0.193045366574523;
+ 			%ratio=   1.276564103522540/.869956;
+-			md.solidearth.surfaceload.icethicknesschange(pos)=-100*ratio;
++			md.masstransport.spcthickness(pos)=-100*ratio;
+ 		else
+ 			in_fileID=fopen('../Data/AIS_delH_trend.txt', 'r');
+ 			delH=textscan(in_fileID, '%f %f %f');
+@@ -163,7 +163,7 @@
+ 			delHAIS=InterpFromMesh2d(index,longAIS,latAIS,delHAIS,long,lat);
+ 			northpole=find_point(md.mesh.long,md.mesh.lat,0,90);
+ 			delHAIS(northpole)=0;
+-			md.solidearth.surfaceload.icethicknesschange=mean(delHAIS(md.mesh.elements),2)/100;
++			md.masstransport.spcthickness=mean(delHAIS(md.mesh.elements),2)/100;
+ 		end
+ 
+ 		md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+@@ -244,7 +244,7 @@
+ 	% }}}
+ 	%}}}
+ 	%slc loading/calibration:  {{{
+-	md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
++	md.masstransport.spcthickness=zeros(md.mesh.numberofelements,1);
+ 
+ 	if testagainst2002, 
+ 		% {{{
+@@ -253,7 +253,7 @@
+ 		longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ 		pos=find(late > 70 &  late < 80 & longe>-60 & longe<-30);
+ 		ratio=.3823/.262344;
+-		%md.solidearth.surfaceload.icethicknesschange(pos)=-100*ratio;
++		%md.masstransport.spcthickness(pos)=-100*ratio;
+ 
+ 		%correct mask: 
+ 		md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+@@ -288,12 +288,12 @@
+ 		delHGLAe=delHGLA(md.mesh.elements)*[1;1;1]/3;
+ 
+ 		pos=find(delHGISe);
+-		md.solidearth.surfaceload.icethicknesschange(pos)=delHGISe(pos)/100;
++		md.masstransport.spcthickness(pos)=delHGISe(pos)/100;
+ 		pos=find(delHGLAe);
+-		md.solidearth.surfaceload.icethicknesschange(pos)=delHGLAe(pos)/100;
++		md.masstransport.spcthickness(pos)=delHGLAe(pos)/100;
+ 
+ 		%adjust mask accordingly: 
+-		pos=find(md.solidearth.surfaceload.icethicknesschange); 
++		pos=find(md.masstransport.spcthickness); 
+ 		flags=zeros(md.mesh.numberofvertices,1); 
+ 		flags(md.mesh.elements(pos,:))=1;
+ 		pos=find(flags);
+@@ -301,12 +301,12 @@
+ 		md.mask.ocean_levelset(pos)=1;
+ 	end
+ 
+-	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
++	md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+ 
+-	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
++	md.dsl.global_average_thermosteric_sea_level=[0;0];
+ 	%md.dsl.steric_rate=(1.1+.38)*ones(md.mesh.numberofvertices,1); %steric + water storage.
+-	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++	md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++	md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ 
+ 	%}}}
+ 	%geometry:  {{{
+@@ -347,10 +347,10 @@
+ sl.transfer('geometry.bed');
+ sl.transfer('mesh.lat');
+ sl.transfer('mesh.long');
+-sl.transfer('solidearth.surfaceload.icethicknesschange');
+-sl.transfer('solidearth.initialsealevel');
+-sl.transfer('dsl.sea_surface_height_change_above_geoid');
+-sl.transfer('dsl.sea_water_pressure_change_at_sea_floor');
++sl.transfer('masstransport.spcthickness');
++sl.transfer('initialization.sealevel');
++sl.transfer('dsl.sea_surface_height_above_geoid');
++sl.transfer('dsl.sea_water_pressure_at_sea_floor');
+ 
+ %radius: 
+ sl.earth.mesh.r=sqrt(sl.earth.mesh.x.^2+sl.earth.mesh.y.^2+sl.earth.mesh.z.^2);
+@@ -381,14 +381,25 @@
+ md.miscellaneous.name='test2004';
+ 
+ %New stuff
+-md.dsl.global_average_thermosteric_sea_level_change=[1.1+.38;0]; %steric + water storage AR5.
++md.dsl.global_average_thermosteric_sea_level=[1.1+.38;0]; %steric + water storage AR5.
+ 
+ %Solution parameters
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+ md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
+ md.timestepping.time_step=1;
+ 
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++
++
+ %max number of iterations reverted back to 10 (i.e. the original default value)
+ md.solidearth.settings.maxiter=10;
+ 
+@@ -399,29 +410,29 @@
+ md.solidearth.requested_outputs= {'default',...
+ 	'SurfaceloadIceThicknessChange','Sealevel','SealevelRSLRate','SealevelchangeCumDeltathickness',...
+ 	'SealevelNEsaRate', 'SealevelUEsaRate','SealevelStaticBarystaticMask','SealevelBarystaticOceanMask'};
+-md=solve(md,'Sealevelchange');
+-Seustatic=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'Transient');
++Seustatic=md.results.TransientSolution.Sealevel;
+ 
+ %eustatic + rigid run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelchange');
+-Srigid=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'Transient');
++Srigid=md.results.TransientSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+-md=solve(md,'Sealevelchange');
+-Selastic=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'Transient');
++Selastic=md.results.TransientSolution.Sealevel;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
+-md=solve(md,'Sealevelchange');
+-Srotation=md.results.SealevelchangeSolution.Sealevel;
++md=solve(md,'Transient');
++Srotation=md.results.TransientSolution.Sealevel;
+ %}}}
+ 
+ %Fields and tolerances to track changes
Index: /issm/oecreview/Archive/25834-26739/ISSM-26077-26078.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26077-26078.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26077-26078.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26077)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26078)
+@@ -44,7 +44,6 @@
+ % Solve for GIA deflection 
+ md.cluster=generic('name',oshostname(),'np',1);
+ %md.cluster=generic('name',oshostname(),'np',3);
+-md.verbose=verbose('11111111111');
+ md.verbose.solver=0;
+ md=solve(md,'Transient');
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26078-26079.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26078-26079.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26078-26079.diff	(revision 26740)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26078)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26079)
+@@ -61,7 +61,7 @@
+ 	IssmDouble *vertex_pairing=NULL;
+ 	IssmDouble *nodeonbase=NULL;
+ 	iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing");
+-	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase");
++	if(iomodel->domaintype!=Domain2DhorizontalEnum && iomodel->domaintype!=Domain3DsurfaceEnum) iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase");
+ 
+ 	for(int i=0;i<numvertex_pairing;i++){
+ 
+@@ -99,7 +99,7 @@
+ 	if(stabilization==3 && iomodel->domaintype==Domain3DEnum) _error_("DG 3d not implemented yet");
+ 
+ 	/*Create Nodes either DG or CG depending on stabilization*/
+-	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
++	if(iomodel->domaintype!=Domain2DhorizontalEnum && iomodel->domaintype!=Domain3DsurfaceEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
+ 	if(stabilization!=3){
+ 		::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,FINITEELEMENT,isamr);
+ 	}
+@@ -220,7 +220,7 @@
+ 		iomodel->FetchDataToInput(inputs,elements,"md.masstransport.spcthickness",MasstransportSpcthicknessEnum); //for FCT, we need the spc in the element (penlaties)
+ 	}
+ 
+-	if(iomodel->domaintype!=Domain2DhorizontalEnum){
++	if(iomodel->domaintype!=Domain2DhorizontalEnum && iomodel->domaintype!=Domain3DsurfaceEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+ 	}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26079-26080.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26079-26080.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26079-26080.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26079)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26080)
+@@ -82,7 +82,7 @@
+ 			%make sure grd is the same everywhere:
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+-				if md.solidearthsettings.isgrd~=slm.earth.solidearthsettings.isgrd),
++				if md.solidearthsettings.isgrd~=slm.earth.solidearthsettings.isgrd
+ 					error(sprintf('isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+ 				end
+ 			end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26080-26081.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26080-26081.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26080-26081.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/dev/issmversion.m
+===================================================================
+--- ../trunk-jpl/src/m/dev/issmversion.m	(revision 26080)
++++ ../trunk-jpl/src/m/dev/issmversion.m	(revision 26081)
+@@ -16,7 +16,7 @@
+ disp(['Build date: ' IssmConfig('PACKAGE_BUILD_DATE')]);
+ disp(['Compiled on ' IssmConfig('HOST_VENDOR') ' ' IssmConfig('HOST_OS') ' ' IssmConfig('HOST_ARCH') ' by ' IssmConfig('USER_NAME')]);
+ disp([' ']);
+-disp(['Copyright (c) 2009-2020 California Institute of Technology']);
++disp(['Copyright (c) 2009-2021 California Institute of Technology']);
+ disp([' ']);
+ disp(['    to get started type: issmdoc']);
+ disp([' ']);
+Index: ../trunk-jpl/src/m/dev/issmversion.py
+===================================================================
+--- ../trunk-jpl/src/m/dev/issmversion.py	(revision 26080)
++++ ../trunk-jpl/src/m/dev/issmversion.py	(revision 26081)
+@@ -15,7 +15,7 @@
+ print(('(website: ' + IssmConfig('PACKAGE_URL')[0] + ' contact: ' + IssmConfig('PACKAGE_BUGREPORT')[0] + ')'))
+ print(' ')
+ print(('Build date: ' + IssmConfig('PACKAGE_BUILD_DATE')[0]))
+-print('Copyright (c) 2009 - 2020 California Institute of Technology')
++print('Copyright (c) 2009-2021 California Institute of Technology')
+ print(' ')
+ print('    to get started type: issmdoc')
+ print(' ')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26081-26082.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26081-26082.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26081-26082.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26081)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26082)
+@@ -1971,7 +1971,7 @@
+ 				MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lcmumps -lmumps_common -lpord -lparmetis -lzmumps -lmetis"
+ 			fi
+ 		else
+-			MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lmumps_common -lpord"
++			MUMPSLIB="-L${MUMPS_ROOT}/lib -ldmumps -lmumps_common -lpord -lparmetis"
+ 		fi
+ 		AC_DEFINE([_HAVE_MUMPS_], [1], [with MUMPS in ISSM src])
+ 		AC_SUBST([MUMPSINCL])
Index: /issm/oecreview/Archive/25834-26739/ISSM-26082-26083.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26082-26083.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26082-26083.diff	(revision 26740)
@@ -0,0 +1,44 @@
+Index: ../trunk-jpl/src/m/classes/frictioncoulomb2.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(revision 26082)
++++ ../trunk-jpl/src/m/classes/frictioncoulomb2.m	(revision 26083)
+@@ -11,6 +11,17 @@
+ 		effective_pressure       = NaN;
+ 		effective_pressure_limit = 0;
+ 	end
++	methods (Static)
++		function self = loadobj(self) % {{{
++			if isstruct(self)
++				disp('Recovering frictioncoulomb2 from older version');
++				if isfield(self,'coefficient')
++					self.C = self.coefficient;
++				end
++				self = structtoobj(frictioncoulomb2(),self);
++			end
++		end% }}}
++	end
+ 	methods
+ 		function self = extrude(self,md) % {{{
+ 			self.C=project3d(md,'vector',self.C,'type','node','layer',1);
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26082)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26083)
+@@ -132,8 +132,6 @@
+ 					md.settings.solver_residue_threshold = 1e-6;
+ 				end
+ 			end
+-			%2017 April 10th
+-			if isa(md.gia,'gia'), md.gia=giamme(); end
+ 			%2017 May 4th
+ 			if isa(md.amr,'double'); md.amr=amr(); end
+ 			%2017 Aug 29th
+@@ -176,7 +174,7 @@
+ 				end
+ 			end
+ 			%2019 Dec 16
+-			if isa(md.dsl,'double') | isempty(md.dsl.compute_fingerprints)
++			if isa(md.dsl,'double') 
+ 				md.dsl=dsl();
+ 			end
+ 			%2020 April 24
Index: /issm/oecreview/Archive/25834-26739/ISSM-26083-26084.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26083-26084.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26083-26084.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/cores/depthaverage_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/depthaverage_core.cpp	(revision 26083)
++++ ../trunk-jpl/src/c/cores/depthaverage_core.cpp	(revision 26084)
+@@ -22,7 +22,7 @@
+ 	femmodel->parameters->FindParam(&input_average_enum,InputToDepthaverageOutEnum);
+ 
+ 	/*If this is a 2D horizontal domain: no need to do anything, just copy input*/
+-	if(domaintype==Domain2DhorizontalEnum){
++	if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DsurfaceEnum){
+ 		InputDuplicatex(femmodel,inputenum,input_average_enum);
+ 		return;
+ 	}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26084-26085.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26084-26085.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26084-26085.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/cores/extrudefrombase_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/extrudefrombase_core.cpp	(revision 26084)
++++ ../trunk-jpl/src/c/cores/extrudefrombase_core.cpp	(revision 26085)
+@@ -20,6 +20,7 @@
+ 
+ 	/*If this is a 2D horizontal domain, return (no need to extrude)*/
+ 	if(domaintype==Domain2DhorizontalEnum) return;
++	if(domaintype==Domain3DsurfaceEnum) return;
+ 
+ 	int inputenum;
+ 	femmodel->parameters->FindParam(&inputenum,InputToExtrudeEnum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26085-26086.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26085-26086.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26085-26086.diff	(revision 26740)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26085)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26086)
+@@ -173,6 +173,7 @@
+ 	parameters->FindParam(&domaintype,DomainTypeEnum);
+ 	switch(domaintype){
+ 		case Domain2DhorizontalEnum:
++		case Domain3DsurfaceEnum:
+ 			this->AddInput(input_enum,values,interpolation_enum);
+ 			break;
+ 		case Domain2DverticalEnum:{
+@@ -1832,6 +1833,8 @@
+ 	*pxyz_front=xyz_front;
+ }/*}}}*/
+ Input*    Tria::GetInput(int inputenum){/*{{{*/
++		
++	_printf_("GetInput 0\n");
+ 
+ 	/*Get Input from dataset*/
+ 	if(this->iscollapsed){
+@@ -1842,9 +1845,12 @@
+ 		return input;
+ 	}
+ 	else{
++		_printf_("GetInput 1\n");
+ 		TriaInput* input = this->inputs->GetTriaInput(inputenum);
++		_printf_("GetInput 2\n");
+ 		if(!input) return input;
+ 
++		_printf_("GetInput 3\n");
+ 		this->InputServe(input);
+ 		return input;
+ 	}
+@@ -4208,6 +4214,7 @@
+ 	this->parameters->FindParam(&domaintype,DomainTypeEnum);
+ 	switch(domaintype){
+ 		case Domain2DhorizontalEnum:
++		case Domain3DsurfaceEnum:
+ 			return this;
+ 		case Domain2DverticalEnum:
+ 			_assert_(HasEdgeOnBase());
Index: /issm/oecreview/Archive/25834-26739/ISSM-26086-26087.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26086-26087.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26086-26087.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26086)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26087)
+@@ -42,8 +42,7 @@
+ md.transient.isslc=1;
+ 
+ % Solve for GIA deflection 
+-md.cluster=generic('name',oshostname(),'np',1);
+-%md.cluster=generic('name',oshostname(),'np',3);
++md.cluster=generic('name',oshostname(),'np',3);
+ md.verbose.solver=0;
+ md=solve(md,'Transient');
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26087-26088.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26087-26088.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26087-26088.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26087)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26088)
+@@ -1834,8 +1834,6 @@
+ }/*}}}*/
+ Input*    Tria::GetInput(int inputenum){/*{{{*/
+ 		
+-	_printf_("GetInput 0\n");
+-
+ 	/*Get Input from dataset*/
+ 	if(this->iscollapsed){
+ 		PentaInput* input = this->inputs->GetPentaInput(inputenum);
+@@ -1845,12 +1843,8 @@
+ 		return input;
+ 	}
+ 	else{
+-		_printf_("GetInput 1\n");
+ 		TriaInput* input = this->inputs->GetTriaInput(inputenum);
+-		_printf_("GetInput 2\n");
+ 		if(!input) return input;
+-
+-		_printf_("GetInput 3\n");
+ 		this->InputServe(input);
+ 		return input;
+ 	}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26088-26089.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26088-26089.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26088-26089.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/cores/extrudefromtop_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/extrudefromtop_core.cpp	(revision 26088)
++++ ../trunk-jpl/src/c/cores/extrudefromtop_core.cpp	(revision 26089)
+@@ -22,6 +22,7 @@
+ 
+ 	/*If this is a 2D horizontal domain, return (no need to extrude)*/
+ 	if(domaintype==Domain2DhorizontalEnum) return;
++	if(domaintype==Domain3DsurfaceEnum) return;
+ 
+ 	/*Special method for Penta, otherwise call solution sequence*/
+ 	if(elementtype==PentaEnum){
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26088)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26089)
+@@ -926,7 +926,7 @@
+ 	xDelete<IssmDouble>(sealevel);
+ 	xDelete<IssmDouble>(bed);
+ 	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(domaintype!=Domain2DhorizontalEnum && domaintype!=Domain3DsurfaceEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           MasstransportAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	SetActiveNodesLSMx(femmodel);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26089-26090.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26089-26090.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26089-26090.diff	(revision 26740)
@@ -0,0 +1,972 @@
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 26090)
+@@ -148,7 +148,7 @@
+ 
+ 	int domaintype;
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* BalancethicknessAnalysis::CreateKMatrixCG(Element* element){/*{{{*/
+@@ -336,7 +336,7 @@
+ 
+ 	int domaintype;
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ }/*}}}*/
+ ElementVector* BalancethicknessAnalysis::CreatePVectorCG(Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 26090)
+@@ -233,7 +233,7 @@
+ 	xDelete<IssmDouble>(Nx);
+ 	xDelete<IssmDouble>(Ny);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ }/*}}}*/
+ void           BalancevelocityAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26090)
+@@ -269,7 +269,7 @@
+ 	xDelete<IssmDouble>(dbasis);
+ 	xDelete<IssmDouble>(D);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* FreeSurfaceBaseAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -343,7 +343,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ 
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 26090)
+@@ -246,7 +246,7 @@
+ 	xDelete<IssmDouble>(dbasis);
+ 	xDelete<IssmDouble>(D);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* FreeSurfaceTopAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -315,7 +315,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	return pe;
+ 
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26090)
+@@ -177,7 +177,7 @@
+ 	xDelete<IssmDouble>(basis);
+ 	xDelete<IssmDouble>(dbasis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ 
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26090)
+@@ -188,10 +188,7 @@
+ 	basalelement->GetInputValue(&active_element,HydrologydcMaskEplactiveEltEnum);
+ 	/*Check that all nodes are active, else return empty matrix*/
+ 	if(!active_element) {
+-		if(domaintype!=Domain2DhorizontalEnum){
+-			basalelement->DeleteMaterials();
+-			delete basalelement;
+-		}
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		return NULL;
+ 	}
+ 
+@@ -249,7 +246,7 @@
+ 	xDelete<IssmDouble>(basis);
+ 	xDelete<IssmDouble>(dbasis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* HydrologyDCEfficientAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -276,10 +273,7 @@
+ 
+ 	/*Check that all nodes are active, else return empty matrix*/
+ 	if(!active_element) {
+-		if(domaintype!=Domain2DhorizontalEnum){
+-			basalelement->DeleteMaterials();
+-			delete basalelement;
+-		}
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		return NULL;
+ 	}
+ 	/*Intermediaries */
+@@ -378,7 +372,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ }/*}}}*/
+ void HydrologyDCEfficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+@@ -427,7 +421,7 @@
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(eplHeads);
+ 	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ } /*}}}*/
+ void HydrologyDCEfficientAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+@@ -735,10 +729,7 @@
+ 	}
+ 	element->AddBasalInput(HydrologydcEplThicknessSubstepEnum,epl_thickness,basalelement->GetElementType());
+ 
+-	if(domaintype!=Domain2DhorizontalEnum){
+-		basalelement->DeleteMaterials();
+-		delete basalelement;
+-	}
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(epl_thickness);
+ 	xDelete<IssmDouble>(old_active);
+ 	xDelete<IssmDouble>(sedhead);
+@@ -790,7 +781,7 @@
+ 	else{
+ 		/*Do not do anything: at least one node is active for this element but this element is not solved for*/
+ 	}
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(active);
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 26090)
+@@ -211,10 +211,7 @@
+ 
+ 	/*Check that all nodes are active, else return empty matrix*/
+ 	if(!thawed_element) {
+-		if(domaintype!=Domain2DhorizontalEnum){
+-			basalelement->DeleteMaterials();
+-			delete basalelement;
+-		}
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		return NULL;
+ 	}
+ 
+@@ -282,10 +279,7 @@
+ 	xDelete<IssmDouble>(basis);
+ 	xDelete<IssmDouble>(dbasis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){
+-		basalelement->DeleteMaterials();
+-		delete basalelement;
+-	}
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* HydrologyDCInefficientAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -312,10 +306,7 @@
+ 
+ 	/*Check that all nodes are active, else return empty matrix*/
+ 	if(!thawed_element) {
+-	if(domaintype!=Domain2DhorizontalEnum){
+-			basalelement->DeleteMaterials();
+-			delete basalelement;
+-		}
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		return NULL;
+ 	}
+ 
+@@ -439,10 +430,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){
+-		basalelement->DeleteMaterials();
+-		delete basalelement;
+-	}
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ }/*}}}*/
+ void HydrologyDCInefficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+@@ -534,10 +522,7 @@
+ 	xDelete<IssmDouble>(residual);
+ 	xDelete<IssmDouble>(pressure);
+ 	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum){
+-		basalelement->DeleteMaterials();
+-		delete basalelement;
+-	}
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void HydrologyDCInefficientAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+@@ -737,10 +722,7 @@
+ 		}
+ 	}
+ 
+-	if(domaintype!=Domain2DhorizontalEnum){
+-		basalelement->DeleteMaterials();
+-		delete basalelement;
+-	}
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(meltingrate);
+ 	xDelete<IssmDouble>(groundedice);
+ }/*}}}*/
+@@ -806,7 +788,7 @@
+ 	else{
+ 		/*Do not do anything: at least one node is active for this element but this element is not solved for*/
+ 	}
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(active);
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26090)
+@@ -116,7 +116,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* L2ProjectionBaseAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -192,7 +192,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ }/*}}}*/
+ void           L2ProjectionBaseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 26090)
+@@ -111,10 +111,7 @@
+ 
+ 	/* Check that all nodes are active, else return empty matrix */
+ 	if(!active_element){
+-		if(domaintype!=Domain2DhorizontalEnum){
+-			basalelement->DeleteMaterials();
+-			delete basalelement;
+-		}
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		return NULL;
+ 	}
+ 
+@@ -146,7 +143,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* L2ProjectionEPLAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -173,10 +170,7 @@
+ 
+ 	/*Check that all nodes are active, else return empty matrix*/
+ 	if(!active_element) {
+-		if(domaintype!=Domain2DhorizontalEnum){
+-			basalelement->DeleteMaterials();
+-			delete basalelement;
+-		}
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		return NULL;
+ 	}
+ 
+@@ -217,7 +211,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ }/*}}}*/
+ void           L2ProjectionEPLAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26090)
+@@ -291,7 +291,7 @@
+ 
+ 	int domaintype;
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* MasstransportAnalysis::CreateKMatrixCG(Element* element){/*{{{*/
+@@ -583,9 +583,7 @@
+ 			_error_("Element type " << EnumToStringx(element->FiniteElement()) << " not supported yet");
+ 	}
+ 
+-	int domaintype;
+-	element->FindParam(&domaintype,DomainTypeEnum);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return pe;
+ }/*}}}*/
+ ElementVector* MasstransportAnalysis::CreatePVectorCG(Element* element){/*{{{*/
+@@ -926,7 +924,7 @@
+ 	xDelete<IssmDouble>(sealevel);
+ 	xDelete<IssmDouble>(bed);
+ 	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum && domaintype!=Domain3DsurfaceEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           MasstransportAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	SetActiveNodesLSMx(femmodel);
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 26090)
+@@ -117,7 +117,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	delete gauss;
+-	basalelement->DeleteMaterials(); delete basalelement;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* MeltingAnalysis::CreatePVector(Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp	(revision 26090)
+@@ -160,7 +160,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp	(revision 26090)
+@@ -197,7 +197,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/classes/Cfsurfacesquare.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfsurfacesquare.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Cfsurfacesquare.cpp	(revision 26090)
+@@ -186,7 +186,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 26090)
+@@ -361,6 +361,15 @@
+ 	}
+ 	return isicefront;
+ }/*}}}*/
++bool       Seg::IsSpawnedElement(void){/*{{{*/
++
++	if(this->iscollapsed!=0){
++		return true;
++	}
++
++	return false;
++
++}/*}}}*/
+ void       Seg::JacobianDeterminant(IssmDouble* pJdet,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussSegEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 26090)
+@@ -786,6 +786,12 @@
+ 	this->FaceOnSurfaceIndices(&index1,&index2,&index3);
+ 	return SpawnTria(index1,index2,index3);
+ }/*}}}*/
++bool       Tetra::IsSpawnedElement(void){/*{{{*/
++
++   /*Tetras cannot be collapsed elements*/
++   return false;
++
++}/*}}}*/
+ Tria*    Tetra::SpawnTria(int index1,int index2,int index3){/*{{{*/
+ 
+ 	int analysis_counter;
+Index: ../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp	(revision 26090)
+@@ -92,7 +92,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp	(revision 26090)
+@@ -78,7 +78,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 26090)
+@@ -100,7 +100,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 26090)
+@@ -112,7 +112,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 26090)
+@@ -109,7 +109,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 26090)
+@@ -109,7 +109,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 26090)
+@@ -110,7 +110,7 @@
+ 	}
+ 
+ 	/*clean up and Return: */
+-	if(domaintype!=Domain2DhorizontalEnum){topelement->DeleteMaterials(); delete topelement;};
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	delete gauss;
+ 	return Jelem;
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26090)
+@@ -150,7 +150,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	xDelete<IssmDouble>(dbasis);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete gauss;
+ 	return pe;
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26090)
+@@ -270,7 +270,7 @@
+ 	ElementMatrix* Ke=analysis->CreateKMatrix(element);
+ 	delete analysis;
+ 	if(incomplete_adjoint){
+-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		return Ke;
+ 	}
+ 
+@@ -318,7 +318,7 @@
+ 	delete gauss;
+ 	xDelete<IssmDouble>(dbasis);
+ 	xDelete<IssmDouble>(xyz_list);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* AdjointHorizAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -1067,7 +1067,7 @@
+ 	xDelete<int>(responses);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete gauss;
+ 	return pe;
+ }/*}}}*/
+@@ -1252,7 +1252,7 @@
+ 	xDelete<IssmDouble>(ge);
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           AdjointHorizAnalysis::GradientJBbarL1L2(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+@@ -1364,7 +1364,7 @@
+ 	xDelete<IssmDouble>(ge);
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           AdjointHorizAnalysis::GradientJBFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 	/*WARNING: We use HO as an estimate for now*/
+@@ -1654,7 +1654,7 @@
+ 	xDelete<IssmDouble>(ge);
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           AdjointHorizAnalysis::GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+@@ -1746,7 +1746,7 @@
+ 	xDelete<IssmDouble>(ge);
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 
+ }/*}}}*/
+ void           AdjointHorizAnalysis::GradientJDragFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+@@ -2065,7 +2065,7 @@
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+ 	delete friction;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           AdjointHorizAnalysis::GradientJDragHydroFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+@@ -2358,7 +2358,7 @@
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+ 	delete friction;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           AdjointHorizAnalysis::GradientJDSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+@@ -2440,7 +2440,7 @@
+ 	xDelete<IssmDouble>(ge);
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void           AdjointHorizAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	int approximation;
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26090)
+@@ -330,7 +330,7 @@
+ 	xDelete<IssmDouble>(dbasis);
+ 	xDelete<IssmDouble>(Bprime);
+ 	delete gauss;
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* LevelsetAnalysis::CreatePVector(Element* element){/*{{{*/
+@@ -374,7 +374,7 @@
+ 		xDelete<IssmDouble>(xyz_list);
+ 		xDelete<IssmDouble>(basis);
+ 		basalelement->FindParam(&domaintype,DomainTypeEnum);
+-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		delete gauss;
+ 	}
+ 
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26090)
+@@ -1391,7 +1391,7 @@
+ 	xDelete<IssmDouble>(dbasis);
+ 
+ 	/*clean-up and return*/
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ 
+ }/*}}}*/
+@@ -1429,7 +1429,7 @@
+ 	#endif
+ 
+ 	/*clean-up and return*/
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete Ke1;
+ 	delete Ke2;
+ 	return Ke;
+@@ -1706,7 +1706,7 @@
+ 	ElementVector* pe =new ElementVector(pe1,pe2);
+ 
+ 	/*clean-up and return*/
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete pe1;
+ 	delete pe2;
+ 	return pe;
+@@ -2101,7 +2101,7 @@
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ #ifdef DISCSLOPE
+ void StressbalanceAnalysis::ComputeSurfaceSlope(IssmDouble* slope,Gauss* gauss_DG,Gauss* gauss_CG,int point1,IssmDouble fraction1,IssmDouble fraction2,int ig,int dim,Element* element){/*{{{*/
+@@ -2407,7 +2407,7 @@
+ 	ElementMatrix* Ke = CreateKMatrixSSAFriction(basalelement);
+ 
+ 	/*clean-up and return*/
+-	basalelement->DeleteMaterials(); delete basalelement;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixL1L2Viscous(Element* element){/*{{{*/
+@@ -2467,7 +2467,7 @@
+ 	/*Clean up and return*/
+ 	delete gauss;
+ 	delete gauss_base;
+-	basalelement->DeleteMaterials(); delete basalelement;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(dbasis);
+ 	return Ke;
+@@ -2500,7 +2500,7 @@
+ 	ElementVector* pe =new ElementVector(pe1,pe2);
+ 
+ 	/*clean-up and return*/
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete pe1;
+ 	delete pe2;
+ 	return pe;
+@@ -2701,7 +2701,7 @@
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ 
+ /*MLHO*/
+@@ -2729,7 +2729,7 @@
+ 	ElementMatrix* Ke = CreateKMatrixSSAFriction(basalelement);
+ 
+ 	/*clean-up and return*/
+-	basalelement->DeleteMaterials(); delete basalelement;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOViscous(Element* element){/*{{{*/
+@@ -2790,7 +2790,7 @@
+ 	/*Clean up and return*/
+ 	delete gauss;
+ 	delete gauss_base;
+-	basalelement->DeleteMaterials(); delete basalelement;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(dbasis);
+ 	return Ke;
+@@ -2824,7 +2824,7 @@
+ 	ElementVector* pe =new ElementVector(pe1,pe2);
+ 
+ 	/*clean-up and return*/
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete pe1;
+ 	delete pe2;
+ 	return pe;
+@@ -3029,7 +3029,7 @@
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<int>(doflist);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ 
+ /*HO*/
+@@ -7274,7 +7274,7 @@
+ 	 * nodes: */
+ 	Element* basalelement = element->SpawnBasalElement();
+ 	ElementMatrix* Ke=CreateKMatrixSSAFriction(basalelement);
+-	basalelement->DeleteMaterials(); delete basalelement;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 
+ 	/*clean-up and return*/
+ 	return Ke;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26090)
+@@ -341,6 +341,7 @@
+ 		virtual void       SetTemporaryElementType(int element_type_in)=0;
+ 	   virtual Element*   SpawnBasalElement(bool depthaverage_materials=false)=0;
+ 		virtual Element*   SpawnTopElement(void)=0;
++		virtual bool       IsSpawnedElement(void)=0;
+ 		virtual IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa)=0;
+ 		virtual void       StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa)=0;
+ 		virtual void	    StrainRateparallel(void)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26090)
+@@ -3622,6 +3622,12 @@
+ 	return tria;
+ }
+ /*}}}*/
++bool       Penta::IsSpawnedElement(void){/*{{{*/
++
++	/*Penta cannot be collapsed elements*/
++	return false;
++
++}/*}}}*/
+ IssmDouble Penta::StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){/*{{{*/
+ 	/*Compute stabilization parameter*/
+ 	/*kappa=thermalconductivity/(rho_ice*heatcapacity) for thermal model*/
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26090)
+@@ -174,6 +174,7 @@
+ 		void           SetTemporaryElementType(int element_type_in);
+ 	   Element*       SpawnBasalElement(bool depthaverage_materials);
+ 		Element*       SpawnTopElement(void);
++		bool           IsSpawnedElement(void);
+ 		Tria*	         SpawnTria(int index1,int index2,int index3);
+ 		IssmDouble     StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
+ 		void           StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26090)
+@@ -138,6 +138,7 @@
+ 		void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
+ 	   Element*    SpawnBasalElement(bool depthaverage_materials){_error_("not implemented yet");};
+ 		Element*    SpawnTopElement(void){_error_("not implemented yet");};
++		bool        IsSpawnedElement(void);
+ 		void       SetElementInput(int enum_in,IssmDouble value, int type){_error_("not implemented yet");};
+ 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+ 		void        StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy,  IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26090)
+@@ -146,6 +146,7 @@
+ 		void        SetElementInput(int enum_in, IssmDouble value, int type){_error_("not implemented yet");};
+ 	   Element*    SpawnBasalElement(bool depthaverage_materials);
+ 		Element*    SpawnTopElement(void);
++		bool        IsSpawnedElement(void);
+ 		Tria*       SpawnTria(int index1,int index2,int index3);
+ 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+ 		void        StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26090)
+@@ -4269,6 +4269,15 @@
+ 	}
+ }
+ /*}}}*/
++bool       Tria::IsSpawnedElement(void){/*{{{*/
++
++	if(this->iscollapsed!=0){
++		return true;
++	}
++
++	return false;
++
++}/*}}}*/
+ void       Tria::StrainRateparallel(){/*{{{*/
+ 
+ 	IssmDouble  epsilon[3];
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26089)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26090)
+@@ -133,6 +133,7 @@
+ 		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
+ 	   Element*    SpawnBasalElement(bool depthaverage_materials);
+ 		Element*    SpawnTopElement(void);
++		bool        IsSpawnedElement(void);
+ 		void			StrainRateparallel();
+ 		void			StrainRateperpendicular();
+ 		void        StressIntensityFactor(void){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26090)
+@@ -1170,7 +1170,7 @@
+ 		if(!element->IsOnBase()) continue;
+ 		Element* basalelement = element->SpawnBasalElement();
+ 		basalelement->WriteFieldIsovalueSegment(segments,fieldenum,fieldvalue);
+-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	}
+ 
+ 	/*2: now get the segments from all partitions*/
+@@ -5210,10 +5210,7 @@
+ 			}
+ 		}
+ 		xDelete<IssmDouble>(base);
+-		if(domaintype!=Domain2DhorizontalEnum){
+-			basalelement->DeleteMaterials();
+-			delete basalelement;
+-		}
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	}
+ 	xDelete<IssmDouble>(serial_active);
+ 	delete effanalysis;
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26090)
+@@ -115,12 +115,14 @@
+ 		Element* element=xDynamicCast<Element*>(object);
+ 		if(!element->IsOnBase()) continue;
+ 		Element* basalelement = element->SpawnBasalElement();
+-		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
++		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()){
++			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++			continue;
++		}
+ 		basalelement->GetInputValue(&boxid,BasalforcingsPicoBoxIdEnum);
+ 		basalelement->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
+ 		boxareas[basinid*maxbox+boxid]+=basalelement->GetHorizontalSurfaceArea();
+-		basalelement->FindParam(&domaintype,DomainTypeEnum);
+-		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	}
+ 
+ 	/*Synchronize across cpus*/
+@@ -163,7 +165,10 @@
+ 		Element* element=xDynamicCast<Element*>(object);
+ 		if(!element->IsOnBase()) continue;
+ 		Element* basalelement = element->SpawnBasalElement();
+-		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
++		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()){
++			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++			continue;
++		}
+ 		int el_boxid;
+ 		basalelement->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+ 		if(el_boxid!=boxid) continue;
+@@ -179,8 +184,7 @@
+ 		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;};
++		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	}
+ 
+ 	/*Syncronize across cpus*/
+@@ -218,7 +222,7 @@
+ 			area=basalelement->GetHorizontalSurfaceArea();
+ 			overturning_weighted_avg[basinid]+=overturning*area;
+ 			basalelement->FindParam(&domaintype,DomainTypeEnum);
+-			if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		}
+ 
+ 		/*Syncronize across cpus*/
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 26089)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 26090)
+@@ -171,7 +171,7 @@
+ 			areas_summed[basinid]   +=area;
+ 			/*Delete spawned element if we are in 3D*/
+ 			basalelement->FindParam(&domaintype,DomainTypeEnum);
+-			if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		}
+ 
+ 		/*Syncronize across cpus*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26090-26091.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26090-26091.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26090-26091.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/classes/Vertex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Vertex.cpp	(revision 26090)
++++ ../trunk-jpl/src/c/classes/Vertex.cpp	(revision 26091)
+@@ -181,6 +181,7 @@
+ 	/*sigma remains constant. z=bed+sigma*thickness*/
+ 	switch(this->domaintype){
+ 		case Domain2DhorizontalEnum:
++		case Domain3DsurfaceEnum:
+ 			/*Nothing*/
+ 			return;
+ 		case Domain2DverticalEnum:
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26090)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26091)
+@@ -4765,7 +4765,7 @@
+ 	IssmDouble* bslchydro_partition_serial=NULL;
+ 	IssmDouble* partitionhydro=NULL;
+ 	int nparthydro;
+-	int istws=0;
++	bool istws;
+ 
+ 
+    /*Initialize temporary vector that will be used to sum barystatic components
Index: /issm/oecreview/Archive/25834-26739/ISSM-26091-26092.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26091-26092.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26091-26092.diff	(revision 26740)
@@ -0,0 +1,165 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 26091)
++++ ../trunk-jpl/etc/environment.sh	(revision 26092)
+@@ -1,4 +1,4 @@
+-# Modifies path-related envrionment variables based on which external packages
++# Modifies path-related environment variables based on which external packages
+ # have been installed.
+ #
+ # ISSM_DIR and ISSM_ARCH should have been defined already in your shell
+@@ -183,13 +183,12 @@
+ # OS-specific handling
+ #######################
+ 
+-OS=$(uname -s)
+-
+-if [[ "${OS}" == MINGW* ]]; then
++MINGW=0
++if [[ $(uname -s) == MINGW* ]]; then
++	MINGW=1
+ 	MSMPI_ROOT="${ISSM_EXT_DIR}/msmpi/install"
+ 	if [ -d "${MSMPI_ROOT}" ]; then
+ 		export MSMPI_ROOT # Used in installation of ParMETIS, ScaLAPACK
+-		path_prepend "${ISSM_DIR}/bin" # Allows dynamic loaded to find DLLs
+ 		cpath_prepend "${MSMPI_ROOT}/include"
+ 		library_path_prepend "${MSMPI_ROOT}/lib"
+ 	fi
+@@ -292,7 +291,7 @@
+ 	library_path_append "${BLAS_ROOT}/lib"
+ 	ld_library_path_append "${BLAS_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${BLAS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ fi
+@@ -303,7 +302,7 @@
+ 	library_path_append "${LAPACK_ROOT}/lib"
+ 	ld_library_path_append "${LAPACK_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${LAPACK_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ fi
+@@ -314,7 +313,7 @@
+ 	library_path_prepend "${METIS_ROOT}/lib"
+ 	ld_library_path_prepend "${METIS_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${METIS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ fi
+@@ -324,7 +323,7 @@
+ 	export MUMPS_ROOT # Used in installation of PETSc
+ 	library_path_append "${MUMPS_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${MUMPS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ fi
+@@ -335,7 +334,7 @@
+ 	library_path_prepend "${PARMETIS_ROOT}/lib"
+ 	ld_library_path_prepend "${PARMETIS_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${PARMETIS_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ fi
+@@ -345,7 +344,7 @@
+ 	export SCALAPACK_ROOT # Used in installation of MUMPS, PETSc
+ 	library_path_append "${SCALAPACK_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${SCALAPACK_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ fi
+@@ -362,7 +361,7 @@
+ 	library_path_prepend "${PETSC_ROOT}/lib"
+ 	ld_library_path_prepend "${PETSC_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${PETSC_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ 
+@@ -540,7 +539,7 @@
+ 	ld_library_path_append "${TRIANGLE_ROOT}/lib"
+ 	dyld_library_path_append "${TRIANGLE_ROOT}/lib"
+ 
+-	if [[ "${OS}" == MINGW* ]]; then
++	if [[ ${MINGW} -eq 1 ]]; then
+ 		path_append "${TRIANGLE_ROOT}/lib" # Allows dynamic loaded to find DLLs
+ 	fi
+ fi
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 26091)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 26092)
+@@ -218,7 +218,7 @@
+ 	exit 1;
+ fi
+ 
+-# Source here to include any newly installed externalpackages on the path.
++# Source here to include any newly-installed external packages on the path
+ source ${ISSM_DIR}/etc/environment.sh
+ 
+ if [ "${OS}" == CYGWIN* ]; then
+@@ -226,7 +226,8 @@
+ 	source ${ISSM_DIR}/externalpackages/windows/windows_environment.sh
+ fi
+ 
+-# Set CXX/CC flags for JS runs after exnteralpackages to avoid conflicts during their compilation
++# Set CXX/CC flags for JS runs after external packages to avoid conflicts 
++# during their compilation
+ #
+ # TODO:
+ # - Check a different boolean variable as compiling for JavaScript should be
+@@ -234,6 +235,7 @@
+ #	former without having to do the latter).
+ # - Revisit enviroment variables (especially EMCC_CFLAGS) once support for
+ #	Fortran has been accomplished.
++#
+ CXX_PREVIOUS=$CXX
+ CC_PREVIOUS=$CC
+ if [ $JAVASCRIPT_TEST -eq 1 ]; then
+@@ -310,6 +312,14 @@
+ #matlab tests
+ # {{{
+ if [ $MATLAB_TEST -eq 1 ]; then
++	MINGW=0
++	if [[ $(uname -s) == MINGW* ]]; then
++		MINGW=1
++		if [ -z "${ISSM_DIR_WIN}+x" ]; then
++			export ISSM_DIR_WIN=$(cygpath -w "${ISSM_DIR}")
++		fi
++	fi
++
+ 	#Launch all tests on different cpus
+ 	for (( i=1;i<=$NUMCPUS_RUN;i++ )); do
+ 		#Launch matlab and the nightly run script
+@@ -334,7 +344,7 @@
+ 		exit
+ EOF
+ 		cd $ISSM_DIR/test/NightlyRun
+-		if [[ "${OS}" == CYGWIN* || "${OS}" == MINGW* ]]; then
++		if [[ "${OS}" == CYGWIN* || ${MINGW} -eq 1 ]]; then
+ 			$MATLAB_PATH/bin/matlab -nodesktop -nosplash -nojvm -r "addpath ${ISSM_DIR_WIN}/src/m/dev; devpath; addpath ${ISSM_DIR_WIN}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR_WIN}/nightlylog/matlab_log$i.log &
+ 		else
+ 			$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "addpath ${ISSM_DIR}/src/m/dev; devpath; addpath ${ISSM_DIR}/nightlylog; matlab_run$i" -logfile ${ISSM_DIR}/nightlylog/matlab_log$i.log &
+@@ -342,6 +352,10 @@
+ 	done
+ 
+ 	# Wait for MATLAB to exit
++	#
++	# TODO:
++	# - Replace by adding -wait option to above calls to matlab?
++	#
+ 	if [[ "${OS}" == CYGWIN* ]]; then
+ 		sleep 5;
+ 		echo "Waiting for MATLAB to exit"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26092-26093.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26092-26093.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26092-26093.diff	(revision 26740)
@@ -0,0 +1,598 @@
+Index: ../trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py	(revision 26093)
+@@ -0,0 +1,558 @@
++#!/usr/bin/python3
++from __future__ import print_function
++import os, sys
++
++extraLogs = []
++petsc_arch = ''
++
++# Use en_US as language so that BuildSystem parses compiler messages in english
++def fixLang(lang):
++  if lang in os.environ and os.environ[lang] != '':
++    lv = os.environ[lang]
++    enc = ''
++    try: lv,enc = lv.split('.')
++    except: pass
++    if lv not in ['en_US','C']: lv = 'en_US'
++    if enc: lv = lv+'.'+enc
++    os.environ[lang] = lv
++
++fixLang('LC_LOCAL')
++fixLang('LANG')
++
++
++def check_for_option_mistakes(opts):
++  for opt in opts[1:]:
++    name = opt.split('=')[0]
++    if name.find(' ') >= 0:
++      raise ValueError('The option "'+name+'" has a space character in the name - this is likely incorrect usage.');
++    if name.find('_') >= 0:
++      exception = False
++      for exc in ['mkl_sparse', 'mkl_sparse_optimize', 'mkl_cpardiso', 'mkl_pardiso', 'superlu_dist', 'PETSC_ARCH', 'PETSC_DIR', 'CXX_CXXFLAGS', 'LD_SHARED', 'CC_LINKER_FLAGS', 'CXX_LINKER_FLAGS', 'FC_LINKER_FLAGS', 'AR_FLAGS', 'C_VERSION', 'CXX_VERSION', 'FC_VERSION', 'size_t', 'MPI_Comm','MPI_Fint','int64_t']:
++        if name.find(exc) >= 0:
++          exception = True
++      if not exception:
++        raise ValueError('The option '+name+' should probably be '+name.replace('_', '-'));
++    if opt.find('=') >=0:
++      optval = opt.split('=')[1]
++      if optval == 'ifneeded':
++        raise ValueError('The option '+opt+' should probably be '+opt.replace('ifneeded', '1'));
++    for exc in ['mkl_sparse', 'mkl_sparse_optimize', 'mkl_cpardiso', 'mkl_pardiso', 'superlu_dist']:
++      if name.find(exc.replace('_','-')) > -1:
++        raise ValueError('The option '+opt+' should be '+opt.replace(exc.replace('_','-'),exc));
++  return
++
++def check_for_unsupported_combinations(opts):
++  if '--with-precision=single' in opts and '--with-clanguage=cxx' in opts and '--with-scalar-type=complex' in opts:
++    sys.exit(ValueError('PETSc does not support single precision complex with C++ clanguage, run with --with-clanguage=c'))
++
++def check_for_option_changed(opts):
++# Document changes in command line options here.
++  optMap = [('with-64bit-indices','with-64-bit-indices'),
++            ('with-mpi-exec','with-mpiexec'),
++            ('c-blas-lapack','f2cblaslapack'),
++            ('cholmod','suitesparse'),
++            ('umfpack','suitesparse'),
++            ('matlabengine','matlab-engine'),            
++            ('f-blas-lapack','fblaslapack'),
++            ('with-cuda-arch',
++             'CUDAFLAGS=-arch'),
++            ('with-packages-dir','with-packages-download-dir'),
++            ('with-external-packages-dir','with-packages-build-dir'),
++            ('package-dirs','with-packages-search-path'),
++            ('download-petsc4py-python','with-python-exec'),
++            ('search-dirs','with-executables-search-path')]
++  for opt in opts[1:]:
++    optname = opt.split('=')[0].strip('-')
++    for oldname,newname in optMap:
++      if optname.find(oldname) >=0:
++        raise ValueError('The option '+opt+' should probably be '+opt.replace(oldname,newname))
++  return
++
++def check_petsc_arch(opts):
++  # If PETSC_ARCH not specified - use script name (if not configure.py)
++  global petsc_arch
++  found = 0
++  for name in opts:
++    if name.find('PETSC_ARCH=') >= 0:
++      petsc_arch=name.split('=')[1]
++      found = 1
++      break
++  # If not yet specified - use the filename of script
++  if not found:
++      filename = os.path.basename(sys.argv[0])
++      if not filename.startswith('configure') and not filename.startswith('reconfigure') and not filename.startswith('setup'):
++        petsc_arch=os.path.splitext(os.path.basename(sys.argv[0]))[0]
++        useName = 'PETSC_ARCH='+petsc_arch
++        opts.append(useName)
++  return 0
++
++def chkenable():
++  #Replace all 'enable-'/'disable-' with 'with-'=0/1/tail
++  #enable-fortran is a special case, the resulting --with-fortran is ambiguous.
++  #Would it mean --with-fc=
++  en_dash = u'\N{EN DASH}'
++  if sys.version_info < (3, 0):
++    en_dash = en_dash.encode('utf-8')
++  for l in range(0,len(sys.argv)):
++    name = sys.argv[l]
++
++    if name.find(en_dash)  >= 0:
++      sys.argv[l] = name.replace(en_dash,'-')
++    if name.find('enable-cxx') >= 0:
++      if name.find('=') == -1:
++        sys.argv[l] = name.replace('enable-cxx','with-clanguage=C++')
++      else:
++        head, tail = name.split('=', 1)
++        if tail=='0':
++          sys.argv[l] = head.replace('enable-cxx','with-clanguage=C')
++        else:
++          sys.argv[l] = head.replace('enable-cxx','with-clanguage=C++')
++      continue
++    if name.find('disable-cxx') >= 0:
++      if name.find('=') == -1:
++        sys.argv[l] = name.replace('disable-cxx','with-clanguage=C')
++      else:
++        head, tail = name.split('=', 1)
++        if tail == '0':
++          sys.argv[l] = head.replace('disable-cxx','with-clanguage=C++')
++        else:
++          sys.argv[l] = head.replace('disable-cxx','with-clanguage=C')
++      continue
++
++
++    if name.find('enable-') >= 0:
++      if name.find('=') == -1:
++        sys.argv[l] = name.replace('enable-','with-')+'=1'
++      else:
++        head, tail = name.split('=', 1)
++        sys.argv[l] = head.replace('enable-','with-')+'='+tail
++    if name.find('disable-') >= 0:
++      if name.find('=') == -1:
++        sys.argv[l] = name.replace('disable-','with-')+'=0'
++      else:
++        head, tail = name.split('=', 1)
++        if tail == '1': tail = '0'
++        sys.argv[l] = head.replace('disable-','with-')+'='+tail
++    if name.find('without-') >= 0:
++      if name.find('=') == -1:
++        sys.argv[l] = name.replace('without-','with-')+'=0'
++      else:
++        head, tail = name.split('=', 1)
++        if tail == '1': tail = '0'
++        sys.argv[l] = head.replace('without-','with-')+'='+tail
++
++def chksynonyms():
++  #replace common configure options with ones that PETSc BuildSystem recognizes
++  simplereplacements = {'F77' : 'FC', 'F90' : 'FC'}
++  for l in range(0,len(sys.argv)):
++    name = sys.argv[l]
++
++    name = name.replace('with-openmpi','with-mpi')
++    name = name.replace('with-mpich','with-mpi')
++    name = name.replace('with-blas-lapack','with-blaslapack')
++
++    if name.find('with-debug=') >= 0 or name.endswith('with-debug'):
++      if name.find('=') == -1:
++        name = name.replace('with-debug','with-debugging')+'=1'
++      else:
++        head, tail = name.split('=', 1)
++        name = head.replace('with-debug','with-debugging')+'='+tail
++
++    if name.find('with-shared=') >= 0 or name.endswith('with-shared'):
++      if name.find('=') == -1:
++        name = name.replace('with-shared','with-shared-libraries')+'=1'
++      else:
++        head, tail = name.split('=', 1)
++        name = head.replace('with-shared','with-shared-libraries')+'='+tail
++
++    if name.find('with-index-size=') >=0:
++      head,tail = name.split('=',1)
++      if int(tail)==32:
++        name = '--with-64-bit-indices=0'
++      elif int(tail)==64:
++        name = '--with-64-bit-indices=1'
++      else:
++        raise RuntimeError('--with-index-size= must be 32 or 64')
++
++    if name.find('with-precision=') >=0:
++      head,tail = name.split('=',1)
++      if tail.find('quad')>=0:
++        name='--with-precision=__float128'
++
++    for i,j in simplereplacements.items():
++      if name.find(i+'=') >= 0:
++        name = name.replace(i+'=',j+'=')
++      elif name.find('with-'+i.lower()+'=') >= 0:
++        name = name.replace(i.lower()+'=',j.lower()+'=')
++
++    # restore 'sys.argv[l]' from the intermediate var 'name'
++    sys.argv[l] = name
++
++def chkwincompilerusinglink():
++  for arg in sys.argv:
++    if (arg.find('win32fe') >= 0 and (arg.find('f90') >=0 or arg.find('ifort') >=0 or arg.find('icl') >=0)):
++      return 1
++  return 0
++
++def chkdosfiles():
++  # cygwin - but not a hg clone - so check one of files in bin dir
++  if b"\r\n" in open(os.path.join('lib','petsc','bin','petscmpiexec'),"rb").read():
++    print('===============================================================================')
++    print(' *** Scripts are in DOS mode. Was winzip used to extract petsc sources?    ****')
++    print(' *** Please restart with a fresh tarball and use "tar -xzf petsc.tar.gz"   ****')
++    print('===============================================================================')
++    sys.exit(3)
++  return
++
++def chkcygwinlink():
++  if os.path.exists('/usr/bin/cygcheck.exe') and os.path.exists('/usr/bin/link.exe') and chkwincompilerusinglink():
++      if '--ignore-cygwin-link' in sys.argv: return 0
++      print('===============================================================================')
++      print(' *** Cygwin /usr/bin/link detected! Compiles with Intel icl/ifort can break!  **')
++      print(' *** To workarround do: "mv /usr/bin/link.exe /usr/bin/link-cygwin.exe"     **')
++      print(' *** Or to ignore this check, use configure option: --ignore-cygwin-link. But compiles can fail. **')
++      print('===============================================================================')
++      sys.exit(3)
++  return 0
++
++def chkbrokencygwin():
++  if os.path.exists('/usr/bin/cygcheck.exe'):
++    buf = os.popen('/usr/bin/cygcheck.exe -c cygwin').read()
++    if buf.find('1.5.11-1') > -1:
++      print('===============================================================================')
++      print(' *** cygwin-1.5.11-1 detected. ./configure fails with this version ***')
++      print(' *** Please upgrade to cygwin-1.5.12-1 or newer version. This can  ***')
++      print(' *** be done by running cygwin-setup, selecting "next" all the way.***')
++      print('===============================================================================')
++      sys.exit(3)
++  return 0
++
++def chkusingwindowspython():
++  if sys.platform == 'win32':
++    print('===============================================================================')
++    print(' *** Windows python detected. Please rerun ./configure with cygwin-python. ***')
++    print('===============================================================================')
++    sys.exit(3)
++  return 0
++
++def chkcygwinpython():
++  if sys.platform == 'cygwin' :
++    import platform
++    import re
++    r=re.compile("([0-9]+).([0-9]+).([0-9]+)")
++    m=r.match(platform.release())
++    major=int(m.group(1))
++    minor=int(m.group(2))
++    subminor=int(m.group(3))
++    if ((major < 1) or (major == 1 and minor < 7) or (major == 1 and minor == 7 and subminor < 34)):
++      sys.argv.append('--useThreads=0')
++      extraLogs.append('''\
++===============================================================================
++** Cygwin version is older than 1.7.34. Python threads do not work correctly. ***
++** Disabling thread usage for this run of ./configure *******
++===============================================================================''')
++  return 0
++
++def chkcygwinwindowscompilers():
++  '''Adds win32fe for Microsoft/Intel compilers'''
++  if os.path.exists('/usr/bin/cygcheck.exe'):
++    for l in range(1,len(sys.argv)):
++      option = sys.argv[l]
++      for i in ['cl','icl','ifort']:
++        if option.startswith(i):
++          sys.argv[l] = 'win32fe '+option
++          break
++  return 0
++
++def chkrhl9():
++  if os.path.exists('/etc/redhat-release'):
++    try:
++      file = open('/etc/redhat-release','r')
++      buf = file.read()
++      file.close()
++    except:
++      # can't read file - assume dangerous RHL9
++      buf = 'Shrike'
++    if buf.find('Shrike') > -1:
++      sys.argv.append('--useThreads=0')
++      extraLogs.append('''\
++==============================================================================
++   *** RHL9 detected. Threads do not work correctly with this distribution ***
++   ****** Disabling thread usage for this run of ./configure *********
++===============================================================================''')
++  return 0
++
++def chktmpnoexec():
++  if not hasattr(os,'ST_NOEXEC'): return # novermin
++  if 'TMPDIR' in os.environ: tmpDir = os.environ['TMPDIR']
++  else: tmpDir = '/tmp'
++  if os.statvfs(tmpDir).f_flag & os.ST_NOEXEC: # novermin
++    if os.statvfs(os.path.abspath('.')).f_flag & os.ST_NOEXEC: # novermin
++      print('************************************************************************')
++      print('* TMPDIR '+tmpDir+' has noexec attribute. Same with '+os.path.abspath('.')+' where petsc is built.')
++      print('* Suggest building PETSc in a location without this restriction!')
++      print('* Alternatively, set env variable TMPDIR to a location that is not restricted to run binaries.')
++      print('************************************************************************')
++      sys.exit(4)
++    else:
++      newTmp = os.path.abspath('tmp-petsc')
++      print('************************************************************************')
++      print('* TMPDIR '+tmpDir+' has noexec attribute. Using '+newTmp+' instead.')
++      print('************************************************************************')
++      if not os.path.isdir(newTmp): os.mkdir(os.path.abspath(newTmp))
++      os.environ['TMPDIR'] = newTmp
++  return
++
++def check_cray_modules():
++  import script
++  '''For Cray systems check if the cc, CC, ftn compiler suite modules have been set'''
++  cray = os.getenv('CRAY_SITE_LIST_DIR')
++  if not cray: return
++  cray = os.getenv('CRAYPE_DIR')
++  if not cray:
++   print('************************************************************************')
++   print('* You are on a Cray system but no programming environments have been loaded')
++   print('* Perhaps you need:')
++   print('*       module load intel ; module load PrgEnv-intel')
++   print('*   or  module load PrgEnv-cray')
++   print('*   or  module load PrgEnv-gnu')
++   print('* See https://www.mcs.anl.gov/petsc/documentation/installation.html#doemachines')
++   print('************************************************************************')
++   sys.exit(4)
++
++def check_broken_configure_log_links():
++  '''Sometime symlinks can get broken if the original files are deleted. Delete such broken links'''
++  import os
++  for logfile in ['configure.log','configure.log.bkp']:
++    if os.path.islink(logfile) and not os.path.isfile(logfile): os.remove(logfile)
++  return
++
++def move_configure_log(framework):
++  '''Move configure.log to PETSC_ARCH/lib/petsc/conf - and update configure.log.bkp in both locations appropriately'''
++  global petsc_arch
++
++  if hasattr(framework,'arch'): petsc_arch = framework.arch
++  if hasattr(framework,'logName'): curr_file = framework.logName
++  else: curr_file = 'configure.log'
++
++  if petsc_arch:
++    import shutil
++    import os
++
++    # Just in case - confdir is not created
++    lib_dir = os.path.join(petsc_arch,'lib')
++    petsc_dir = os.path.join(petsc_arch,'lib','petsc')
++    conf_dir = os.path.join(petsc_arch,'lib','petsc','conf')
++    if not os.path.isdir(petsc_arch): os.mkdir(petsc_arch)
++    if not os.path.isdir(lib_dir): os.mkdir(lib_dir)
++    if not os.path.isdir(petsc_dir): os.mkdir(petsc_dir)
++    if not os.path.isdir(conf_dir): os.mkdir(conf_dir)
++
++    curr_bkp  = curr_file + '.bkp'
++    new_file  = os.path.join(conf_dir,curr_file)
++    new_bkp   = new_file + '.bkp'
++
++    # Keep backup in $PETSC_ARCH/lib/petsc/conf location
++    if os.path.isfile(new_bkp): os.remove(new_bkp)
++    if os.path.isfile(new_file): os.rename(new_file,new_bkp)
++    if os.path.isfile(curr_file):
++      shutil.copyfile(curr_file,new_file)
++      os.remove(curr_file)
++    if os.path.isfile(new_file): os.symlink(new_file,curr_file)
++    # If the old bkp is using the same PETSC_ARCH/lib/petsc/conf - then update bkp link
++    if os.path.realpath(curr_bkp) == os.path.realpath(new_file):
++      if os.path.isfile(curr_bkp): os.remove(curr_bkp)
++      if os.path.isfile(new_bkp): os.symlink(new_bkp,curr_bkp)
++  return
++
++def print_final_timestamp(framework):
++  import time
++  framework.log.write(('='*80)+'\n')
++  framework.log.write('Finishing configure run at '+time.strftime('%a, %d %b %Y %H:%M:%S %z')+'\n')
++  framework.log.write(('='*80)+'\n')
++  return
++
++def petsc_configure(configure_options):
++  if 'PETSC_DIR' in os.environ:
++    petscdir = os.environ['PETSC_DIR']
++    if petscdir.find(' ') > -1:
++      raise RuntimeError('Your PETSC_DIR '+petscdir+' has spaces in it; this is not allowed.\n Change the directory with PETSc to not have spaces in it')
++    try:
++      sys.path.append(os.path.join(petscdir,'lib','petsc','bin'))
++      import petscnagupgrade
++      file     = os.path.join(petscdir,'.nagged')
++      if not petscnagupgrade.naggedtoday(file):
++        petscnagupgrade.currentversion(petscdir)
++    except:
++      pass
++  print('===============================================================================')
++  print('             Configuring PETSc to compile on your system                       ')
++  print('===============================================================================')
++
++  try:
++    # Command line arguments take precedence (but don't destroy argv[0])
++    sys.argv = sys.argv[:1] + configure_options + sys.argv[1:]
++    check_for_option_mistakes(sys.argv)
++    check_for_option_changed(sys.argv)
++  except (TypeError, ValueError) as e:
++    emsg = str(e)
++    if not emsg.endswith('\n'): emsg = emsg+'\n'
++    msg ='*******************************************************************************\n'\
++    +'                ERROR in COMMAND LINE ARGUMENT to ./configure \n' \
++    +'-------------------------------------------------------------------------------\n'  \
++    +emsg+'*******************************************************************************\n'
++    sys.exit(msg)
++  # check PETSC_ARCH
++  check_for_unsupported_combinations(sys.argv)
++  check_petsc_arch(sys.argv)
++  check_broken_configure_log_links()
++
++  #rename '--enable-' to '--with-'
++  chkenable()
++  # support a few standard configure option types
++  chksynonyms()
++  # Check for broken cygwin
++  chkbrokencygwin()
++  # Disable threads on RHL9
++  chkrhl9()
++  # Make sure cygwin-python is used on windows
++  chkusingwindowspython()
++  # Threads don't work for cygwin & python...
++  chkcygwinpython()
++  chkcygwinlink()
++  chkdosfiles()
++  chkcygwinwindowscompilers()
++  chktmpnoexec()
++
++  for l in range(1,len(sys.argv)):
++    if sys.argv[l].startswith('--with-fc=') and sys.argv[l].endswith('nagfor'):
++      # need a way to save this value and later CC so that petscnagfor may use them
++      name = sys.argv[l].split('=')[1]
++      sys.argv[l] = '--with-fc='+os.path.join(os.path.abspath('.'),'lib','petsc','bin','petscnagfor')
++      break
++
++
++  # Should be run from the toplevel
++  configDir = os.path.abspath('config')
++  bsDir     = os.path.join(configDir, 'BuildSystem')
++  if not os.path.isdir(configDir):
++    raise RuntimeError('Run configure from $PETSC_DIR, not '+os.path.abspath('.'))
++  sys.path.insert(0, bsDir)
++  sys.path.insert(0, configDir)
++  import config.base
++  import config.framework
++  import pickle
++  import traceback
++
++  # Check Cray without modules
++  check_cray_modules()
++
++  tbo = None
++  framework = None
++  try:
++    framework = config.framework.Framework(['--configModules=PETSc.Configure','--optionsModule=config.compilerOptions']+sys.argv[1:], loadArgDB = 0)
++    framework.setup()
++    framework.logPrint('\n'.join(extraLogs))
++    framework.configure(out = sys.stdout)
++    framework.storeSubstitutions(framework.argDB)
++    framework.argDB['configureCache'] = pickle.dumps(framework)
++    framework.printSummary()
++    framework.argDB.save(force = True)
++    framework.logClear()
++    print_final_timestamp(framework)
++    framework.closeLog()
++    try:
++      move_configure_log(framework)
++    except:
++      # perhaps print an error about unable to shuffle logs?
++      pass
++    return 0
++  except (RuntimeError, config.base.ConfigureSetupError) as e:
++    tbo = sys.exc_info()[2]
++    emsg = str(e)
++    if not emsg.endswith('\n'): emsg = emsg+'\n'
++    msg ='*******************************************************************************\n'\
++    +'         UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for details):\n' \
++    +'-------------------------------------------------------------------------------\n'  \
++    +emsg+'*******************************************************************************\n'
++    se = ''
++  except (TypeError, ValueError) as e:
++    # this exception is automatically deleted by Python so we need to save it to print below
++    tbo = sys.exc_info()[2]
++    emsg = str(e)
++    if not emsg.endswith('\n'): emsg = emsg+'\n'
++    msg ='*******************************************************************************\n'\
++    +'    TypeError or ValueError possibly related to ERROR in COMMAND LINE ARGUMENT while running ./configure \n' \
++    +'-------------------------------------------------------------------------------\n'  \
++    +emsg+'*******************************************************************************\n'
++    se = ''
++  except ImportError as e :
++    # this exception is automatically deleted by Python so we need to save it to print below
++    tbo = sys.exc_info()[2]
++    emsg = str(e)
++    if not emsg.endswith('\n'): emsg = emsg+'\n'
++    msg ='*******************************************************************************\n'\
++    +'                     ImportError while runing ./configure \n' \
++    +'-------------------------------------------------------------------------------\n'  \
++    +emsg+'*******************************************************************************\n'
++    se = ''
++  except OSError as e :
++    tbo = sys.exc_info()[2]
++    emsg = str(e)
++    if not emsg.endswith('\n'): emsg = emsg+'\n'
++    msg ='*******************************************************************************\n'\
++    +'                    OSError while running ./configure \n' \
++    +'-------------------------------------------------------------------------------\n'  \
++    +emsg+'*******************************************************************************\n'
++    se = ''
++  except SystemExit as e:
++    tbo = sys.exc_info()[2]
++    if e.code is None or e.code == 0:
++      return
++    if e.code == 10:
++      sys.exit(10)
++    msg ='*******************************************************************************\n'\
++    +'         CONFIGURATION FAILURE  (Please send configure.log to petsc-maint@mcs.anl.gov)\n' \
++    +'*******************************************************************************\n'
++    se  = str(e)
++  except Exception as e:
++    tbo = sys.exc_info()[2]
++    msg ='*******************************************************************************\n'\
++    +'        CONFIGURATION CRASH  (Please send configure.log to petsc-maint@mcs.anl.gov)\n' \
++    +'*******************************************************************************\n'
++    se  = str(e)
++
++  print(msg)
++  if not framework is None:
++    framework.logClear()
++    if hasattr(framework, 'log'):
++      try:
++        if hasattr(framework,'compilerDefines'):
++          framework.log.write('**** Configure header '+framework.compilerDefines+' ****\n')
++          framework.outputHeader(framework.log)
++        if hasattr(framework,'compilerFixes'):
++          framework.log.write('**** C specific Configure header '+framework.compilerFixes+' ****\n')
++          framework.outputCHeader(framework.log)
++      except Exception as e:
++        framework.log.write('Problem writing headers to log: '+str(e))
++      try:
++        framework.log.write(msg+se)
++        traceback.print_tb(tbo, file = framework.log)
++        print_final_timestamp(framework)
++        if hasattr(framework,'log'): framework.log.close()
++        move_configure_log(framework)
++      except Exception as e:
++        print('Error printing error message from exception or printing the traceback:'+str(e))
++        traceback.print_tb(sys.exc_info()[2])
++      sys.exit(1)
++    else:
++      print(se)
++      traceback.print_tb(tbo)
++  else:
++    print(se)
++    traceback.print_tb(tbo)
++  if hasattr(framework,'log'): framework.log.close()
++
++if __name__ == '__main__':
++  petsc_configure([])
++
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26092)
++++ ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26093)
+@@ -4,12 +4,8 @@
+ # NOTE:
+ # - You must install various needed packages with,
+ #
+-#		pacman -S git mingw-w64-x86_64-freeglut mingw-w64-x86_64-toolchain python pkg-config mingw-w64-x86_64-libmicroutils
++#		pacman -S mingw-w64-x86_64-toolchain python
+ #
+-# then remove the MinGW 64-bit version of Python (and dependent packages) with,
+-#
+-#		pacman -R mingw-w64-x86_64-gdb-multiarch mingw-w64-x86_64-gdb mingw-w64-x86_64-python
+-#
+ # - You must use MSYS2 MinGW 64-bit version of cmake to be able to install 
+ #	external packages correctly,
+ #
+@@ -41,6 +37,9 @@
+ mv petsc-${VER}/* ${PETSC_DIR}
+ rm -rf petsc-${VER}
+ 
++# Copy customized source files to $PETSC_DIR
++cp configs/3.14/win/msys2/mingw64/config/configure.py ${PETSC_DIR}/config
++
+ # Configure
+ # - Cannot use --with-fpic option when compiling static libs,
+ #
Index: /issm/oecreview/Archive/25834-26739/ISSM-26093-26094.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26093-26094.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26093-26094.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26093)
++++ ../trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 26094)
+@@ -82,12 +82,3 @@
+ # Compile and install
+ make
+ make install
+-
+-# # NOTE:
+-# # - Hack to recover from failed installation (appears to happen only on Windows 
+-# #	when reproducing symbolic links in destination directory) rather than 
+-# #	trying to patch src/config/install.py
+-# #
+-# if [ $? -ne 0 ]; then
+-# 	make install
+-# fi
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 26093)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 26094)
+@@ -368,7 +368,7 @@
+ 			sleep 1;
+ 		done
+ 		echo "DONE!"
+-	elif [[ "${OS}" == MINGW* ]]; then
++	elif [[ ${MINGW} -eq 1 ]]; then
+ 		# NOTE: The PID query used here may work as well on Cygwin. If so, combine the two conditional blocks.
+ 		sleep 5;
+ 		echo "Waiting for MATLAB to exit"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26094-26095.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26094-26095.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26094-26095.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/jenkins.sh
+===================================================================
+--- ../trunk-jpl/jenkins/jenkins.sh	(revision 26094)
++++ ../trunk-jpl/jenkins/jenkins.sh	(revision 26095)
+@@ -315,7 +315,7 @@
+ 	MINGW=0
+ 	if [[ $(uname -s) == MINGW* ]]; then
+ 		MINGW=1
+-		if [ -z "${ISSM_DIR_WIN}+x" ]; then
++		if [ -z "${ISSM_DIR_WIN+x}" ]; then
+ 			export ISSM_DIR_WIN=$(cygpath -w "${ISSM_DIR}")
+ 		fi
+ 	fi
Index: /issm/oecreview/Archive/25834-26739/ISSM-26095-26096.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26095-26096.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26095-26096.diff	(revision 26740)
@@ -0,0 +1,54 @@
+Index: ../trunk-jpl/src/m/io/loadvars.py
+===================================================================
+--- ../trunk-jpl/src/m/io/loadvars.py	(revision 26095)
++++ ../trunk-jpl/src/m/io/loadvars.py	(revision 26096)
+@@ -51,7 +51,7 @@
+     else:
+         raise TypeError("Unrecognized input arguments.")
+ 
+-    onlylast = True
++    onlylast = False
+ 
+     for key, value in kwargs.items():
+         if key == 'onlylast':
+@@ -88,7 +88,9 @@
+             #==== First we create the model structure  {{{
+             if debug:
+                 print(' ==== Now treating classtype {}'.format(mod))
+-            if np.size(classtree[mod]) > 1:
++            if mod not in classtree.keys():
++                print("WARNING: {} classe is not in the model anymore and will be omited.".format(mod))
++            elif np.size(classtree[mod]) > 1:
+                 # this points to a subclass (results.TransientSolution for example)
+                 curclass = NCFile.groups[classtree[mod][0]].groups[classtree[mod][1]]
+                 if debug:
+@@ -114,7 +116,6 @@
+                             for i in range(max(1, len(NCFile.dimensions['Time']))):
+                                 nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]].steps.append(getattr(classtype[mod][1], 'solutionstep')())
+                             Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+-                            print(nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]].steps[0])
+                 # }}}
+                 elif classtype[mod][0] == 'massfluxatgate':  #this is for output definitions {{{
+                     defname = split('Output|[0-9]+', classtree[mod][1])[1] + 's'
+@@ -176,6 +177,7 @@
+                                 else:
+                                     timelist = np.arange(0, len(NCFile.dimensions['Time']))
+                                 for t in timelist:
++                                    print("filing step {} for {}".format(t, var))
+                                     if vardim == 0:
+                                         Tree[t].__dict__[str(var)] = varval[:].data
+                                     if vardim == 1:
+@@ -336,8 +338,11 @@
+                 class_dict[classe] = [str(getattr(NCData.groups[group], 'classtype')), ]
+                 if class_dict[classe][0] not in ['dict', 'list', 'cell']:
+                     modulename = split(r'\.', class_dict[classe][0])[0]
+-                    class_dict[classe].append(__import__(modulename))
+-                    class_tree[classe] = [group, ]
++                    if modulename == "giaivins":
++                        print("WARNING: module {} does not exist anymore and is skipped".format(modulename))
++                    else:
++                        class_dict[classe].append(__import__(modulename))
++                        class_tree[classe] = [group, ]
+             except AttributeError:
+                 print(('group {} is empty'.format(group)))
+     NCData.close()
Index: /issm/oecreview/Archive/25834-26739/ISSM-26096-26097.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26096-26097.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26096-26097.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26096)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26097)
+@@ -198,7 +198,7 @@
+ 					case MatlithoEnum:
+ 						{ /*{{{*/
+ 							iomodel->FetchData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
+-							materials->AddObject(new Matlitho(materials->Size()+1,iomodel));
++							materials->AddObject(new Matlitho(iomodel->numberofelements+1,iomodel));
+ 							iomodel->DeleteData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
+ 						}
+ 						/*}}}*/
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26096)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26097)
+@@ -54,6 +54,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.mesh.average_vertex_connectivity",MeshAverageVertexConnectivityEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.waitonlock",SettingsWaitonlockEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberofvertices",MeshNumberofverticesEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberofelements",MeshNumberofelementsEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.io_gather",SettingsIoGatherEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.solver_residue_threshold",SettingsSolverResidueThresholdEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.isautodiff",AutodiffIsautodiffEnum));
Index: /issm/oecreview/Archive/25834-26739/ISSM-26097-26098.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26097-26098.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26097-26098.diff	(revision 26740)
@@ -0,0 +1,148 @@
+Index: ../trunk-jpl/test/SandBox/test2002.m
+===================================================================
+--- ../trunk-jpl/test/SandBox/test2002.m	(nonexistent)
++++ ../trunk-jpl/test/SandBox/test2002.m	(revision 26098)
+@@ -0,0 +1,143 @@
++%Test Name: EarthSlc
++
++%mesh earth:
++md=model;
++%md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++load test2002_mesh 
++md.mesh=mesh;
++
++%Geometry for the bed, arbitrary thickness of 1000: 
++md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++
++%parameterize solidearth solution:
++%solidearth loading:  {{{
++md.masstransport.spcthickness=[md.geometry.thickness;0];
++md.dsl.global_average_thermosteric_sea_level=[0;0];
++md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
++%antarctica
++late=sum(md.mesh.lat(md.mesh.elements),2)/3;
++longe=sum(md.mesh.long(md.mesh.elements),2)/3;
++%pos=find(late < -86);
++pos=1136;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++
++vertices=md.mesh.elements(pos,:); 
++pos1=find( md.mesh.elements(:,1)==vertices(1) | md.mesh.elements(:,2)==vertices(1) | md.mesh.elements(:,3)==vertices(1) );
++pos2=find( md.mesh.elements(:,1)==vertices(2) | md.mesh.elements(:,2)==vertices(2) | md.mesh.elements(:,3)==vertices(2) );
++pos3=find( md.mesh.elements(:,1)==vertices(3) | md.mesh.elements(:,2)==vertices(3) | md.mesh.elements(:,3)==vertices(3) );
++polarelements=unique([pos1;pos2;pos3]);
++
++
++%greenland
++%pos=find(late>70 & late<80 & longe>-60 & longe<-30);
++%md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++
++%elastic loading from love numbers:
++md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
++
++%}}}
++%mask:  {{{
++md.mask.ice_levelset=ones(md.mesh.numberofvertices,1);
++md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1);
++pos=find(md.mesh.lat<0);
++md.mask.ice_levelset(pos)=-1;
++md.mask.ocean_levelset(pos)=1;
++
++md.mask.ocean_levelset(md.mesh.elements(polarelements,:))=-1;
++md.mask.ocean_levelset(md.mesh.elements(1136,:))=1;
++
++md.mask.ice_levelset(md.mesh.elements(polarelements,:))=1;
++md.mask.ice_levelset(md.mesh.elements(1136,:))=-1;
++
++
++% }}}
++
++%time stepping: 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=1;
++
++
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
++md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
++
++%Materials: 
++md.materials=materials('hydro');
++
++
++%Miscellaneous
++md.miscellaneous.name='test2002';
++
++%Solution parameters
++md.solidearth.settings.reltol=NaN;
++md.solidearth.settings.abstol=1e-3;
++md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
++
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isoceantransport=1;
++md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticMask','DeltaDsl','DeltaBottomPressure','DeltaStr','DeltaIceThickness'};
++
++
++% max number of iteration reverted back to 10 (i.e., the original default value)
++md.solidearth.settings.maxiter=10;
++
++%eustatic run:
++md.solidearth.settings.rigid=0;
++md.solidearth.settings.elastic=0;
++md.solidearth.settings.rotation=0;
++md=solve(md,'Transient');
++Seustatic=md.results.TransientSolution.Sealevel;
++
++%eustatic + rigid run:
++md.solidearth.settings.rigid=1;
++md.solidearth.settings.elastic=0;
++md.solidearth.settings.rotation=0;
++md=solve(md,'tr');
++Srigid=md.results.TransientSolution.Sealevel;
++
++%eustatic + rigid + elastic run:
++md.solidearth.settings.rigid=1;
++md.solidearth.settings.elastic=1;
++md.solidearth.settings.rotation=0;
++
++md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticMask','DeltaDsl','DeltaBottomPressure','DeltaStr','DeltaIceThickness','SealevelchangeG','SealevelBarystaticOceanMask'};
++md=solve(md,'tr');
++Selastic=md.results.TransientSolution.Sealevel;
++
++Seustatic_new=Seustatic;
++Srigid_new=Srigid;
++Selastic_new=Selastic;
++save ../../../trunk-clean/test/NightlyRun/test2002_results Seustatic_new Srigid_new Selastic_new
++
++%eustatic + rigid + elastic + rotation run:
++md.solidearth.settings.rigid=1;
++md.solidearth.settings.elastic=1;
++md.solidearth.settings.rotation=1;
++md=solve(md,'tr');
++Srotation=md.results.TransientSolution.Sealevel;
++error;
++
++%Fields and tolerances to track changes
++field_names={'Eustatic','Rigid','Elastic','Rotation'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={Seustatic,Srigid,Selastic,Srotation};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26098-26099.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26098-26099.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26098-26099.diff	(revision 26740)
@@ -0,0 +1,2855 @@
+Index: ../trunk-jpl/m4/analyses.m4
+===================================================================
+--- ../trunk-jpl/m4/analyses.m4	(revision 26098)
++++ ../trunk-jpl/m4/analyses.m4	(revision 26099)
+@@ -9,454 +9,838 @@
+ AC_DEFUN([AX_ANALYSES_SELECTION],
+ [
+ 
++dnl with-HydrologyTws{{{
++
++AC_ARG_WITH([HydrologyTws],
++
++	AS_HELP_STRING([--with-HydrologyTws = YES], [compile with HydrologyTws capabilities (default is yes)]),
++
++	[HYDROLOGYTWS=$withval],[HYDROLOGYTWS=yes])
++
++AC_MSG_CHECKING(for HydrologyTws capability compilation)
++
++
++HAVE_HYDROLOGYTWS=no 
++
++if test "x$HYDROLOGYTWS" = "xyes"; then
++
++	HAVE_HYDROLOGYTWS=yes
++
++	AC_DEFINE([_HAVE_HYDROLOGYTWS_],[1],[with HydrologyTws capability])
++
++fi
++
++AM_CONDITIONAL([HYDROLOGYTWS], [test x$HAVE_HYDROLOGYTWS = xyes])
++
++AC_MSG_RESULT($HAVE_HYDROLOGYTWS)
++
++dnl }}}
+ dnl with-AdjointBalancethickness2{{{
++
+ AC_ARG_WITH([AdjointBalancethickness2],
++
+ 	AS_HELP_STRING([--with-AdjointBalancethickness2 = YES], [compile with AdjointBalancethickness2 capabilities (default is yes)]),
++
+ 	[ADJOINTBALANCETHICKNESS2=$withval],[ADJOINTBALANCETHICKNESS2=yes])
++
+ AC_MSG_CHECKING(for AdjointBalancethickness2 capability compilation)
+ 
++
+ HAVE_ADJOINTBALANCETHICKNESS2=no 
++
+ if test "x$ADJOINTBALANCETHICKNESS2" = "xyes"; then
++
+ 	HAVE_ADJOINTBALANCETHICKNESS2=yes
++
+ 	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS2_],[1],[with AdjointBalancethickness2 capability])
++
+ fi
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ AM_CONDITIONAL([GLHEIGHTADVECTION], [test x$HAVE_GLHEIGHTADVECTION = xyes])
++
+ AC_MSG_RESULT($HAVE_GLHEIGHTADVECTION)
+-dnl }}}
+-dnl with-Gia{{{
+-AC_ARG_WITH([Gia],
+-	AS_HELP_STRING([--with-Gia= YES], [compile with Gia capabilities (default is yes)]),
+-	[GIA=$withval],[GIA=yes])
+-AC_MSG_CHECKING(for Gia capability compilation)
+ 
+-HAVE_GIA=no 
+-if test "x$GIA" = "xyes"; then
+-	HAVE_GIA=yes
+-	AC_DEFINE([_HAVE_GIA_],[1],[with Giacapability])
+-fi
+-AM_CONDITIONAL([GIA], [test x$HAVE_GIA = xyes])
+-AC_MSG_RESULT($HAVE_GIA)
+ dnl }}}
+ dnl with-HydrologyDCEfficient{{{
++
+ AC_ARG_WITH([HydrologyDCEfficient],
++
+ 	AS_HELP_STRING([--with-HydrologyDCEfficient = YES], [compile with HydrologyDCEfficient capabilities (default is yes)]),
++
+ 	[HYDROLOGYDCEFFICIENT=$withval],[HYDROLOGYDCEFFICIENT=yes])
++
+ AC_MSG_CHECKING(for HydrologyDCEfficient capability compilation)
+ 
++
+ HAVE_HYDROLOGYDCEFFICIENT=no 
++
+ if test "x$HYDROLOGYDCEFFICIENT" = "xyes"; then
++
+ 	HAVE_HYDROLOGYDCEFFICIENT=yes
++
+ 	AC_DEFINE([_HAVE_HYDROLOGYDCEFFICIENT_],[1],[with HydrologyDCEfficient capability])
++
+ fi
++
+ 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
++
+ 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
+-AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
+-AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
+ dnl }}}
+-dnl with-HydrologyTws{{{
+-AC_ARG_WITH([HydrologyTws],
+-	AS_HELP_STRING([--with-HydrologyTws = YES], [compile with HydrologyTws capabilities (default is yes)]),
+-	[HYDROLOGYTWS=$withval],[HYDROLOGYTWS=yes])
+-AC_MSG_CHECKING(for HydrologyTws capability compilation)
++dnl with-HydrologyGlaDS{{{
+ 
+-HAVE_HYDROLOGYTWS=no 
+-if test "x$HYDROLOGYTWS" = "xyes"; then
+-	HAVE_HYDROLOGYTWS=yes
+-	AC_DEFINE([_HAVE_HYDROLOGYTWS_],[1],[with HydrologyTws capability])
+-fi
+-AM_CONDITIONAL([HYDROLOGYTWS], [test x$HAVE_HYDROLOGYTWS = xyes])
+-AC_MSG_RESULT($HAVE_HYDROLOGYTWS)
+-dnl }}}
+-dnl with-HydrologyGlaDS{{{
+ AC_ARG_WITH([HydrologyGlaDS],
++
+ 	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
++
+ 	[HYDROLOGYGLADS=$withval],[HYDROLOGYGLADS=yes])
++
+ AC_MSG_CHECKING(for HydrologyGlaDS capability compilation)
+ 
++
+ HAVE_HYDROLOGYGLADS=no 
++
+ if test "x$HYDROLOGYGLADS" = "xyes"; then
++
+ 	HAVE_HYDROLOGYGLADS=yes
++
+ 	AC_DEFINE([_HAVE_HYDROLOGYGLADS_],[1],[with HydrologyGlaDS capability])
++
+ fi
++
+ AM_CONDITIONAL([HYDROLOGYGLADS], [test x$HAVE_HYDROLOGYGLADS = xyes])
++
+ AC_MSG_RESULT($HAVE_HYDROLOGYGLADS)
++
+ dnl }}}
++dnl with-HydrologyPism{{{
++
++AC_ARG_WITH([HydrologyPism],
++
++	AS_HELP_STRING([--with-HydrologyPism = YES], [compile with HydrologyPism capabilities (default is yes)]),
++
++	[HYDROLOGYPISM=$withval],[HYDROLOGYPISM=yes])
++
++AC_MSG_CHECKING(for HydrologyPism capability compilation)
++
++
++HAVE_HYDROLOGYPISM=no 
++
++if test "x$HYDROLOGYPISM" = "xyes"; then
++
++	HAVE_HYDROLOGYPISM=yes
++
++	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
++
++fi
++
++AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
++
++AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
++
++dnl }}}
+ dnl with-HydrologyShakti{{{
++
+ AC_ARG_WITH([HydrologyShakti],
++
+ 	AS_HELP_STRING([--with-HydrologyShakti = YES], [compile with HydrologyShakti capabilities (default is yes)]),
++
+ 	[HYDROLOGYSHAKTI=$withval],[HYDROLOGYSHAKTI=yes])
++
+ AC_MSG_CHECKING(for HydrologyShakti capability compilation)
+ 
++
+ HAVE_HYDROLOGYSHAKTI=no 
++
+ if test "x$HYDROLOGYSHAKTI" = "xyes"; then
++
+ 	HAVE_HYDROLOGYSHAKTI=yes
++
+ 	AC_DEFINE([_HAVE_HYDROLOGYSHAKTI_],[1],[with HydrologyShakti capability])
++
+ fi
++
+ AM_CONDITIONAL([HYDROLOGYSHAKTI], [test x$HAVE_HYDROLOGYSHAKTI = xyes])
++
+ AC_MSG_RESULT($HAVE_HYDROLOGYSHAKTI)
++
+ dnl }}}
+-dnl with-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)
++dnl with-HydrologyShreve{{{
+ 
+-HAVE_HYDROLOGYPISM=no 
+-if test "x$HYDROLOGYPISM" = "xyes"; then
+-	HAVE_HYDROLOGYPISM=yes
+-	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
++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
+-AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
+-AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
++
++AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
++
++AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
++
+ AC_MSG_RESULT($HAVE_MASSTRANSPORT)
+-dnl }}}
+-dnl with-Oceanmasstransport{{{
+-AC_ARG_WITH([Oceanmasstransport],
+-	AS_HELP_STRING([--with-Oceanmasstransport = YES], [compile with Oceanmasstransport capabilities (default is yes)]),
+-	[OCEANMASSTRANSPORT=$withval],[OCEANMASSTRANSPORT=yes])
+-AC_MSG_CHECKING(for Oceanmasstransport capability compilation)
+ 
+-HAVE_OCEANMASSTRANSPORT=no 
+-if test "x$OCEANMASSTRANSPORT" = "xyes"; then
+-	HAVE_OCEANMASSTRANSPORT=yes
+-	AC_DEFINE([_HAVE_OCEANMASSTRANSPORT_],[1],[with Oceanmasstransport capability])
+-fi
+-AM_CONDITIONAL([OCEANMASSTRANSPORT], [test x$HAVE_OCEANMASSTRANSPORT = xyes])
+-AC_MSG_RESULT($HAVE_OCEANMASSTRANSPORT)
+ 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
++
+ AM_CONDITIONAL([MELTING], [test x$HAVE_MELTING = xyes])
++
+ AC_MSG_RESULT($HAVE_MELTING)
++
+ dnl }}}
++dnl with-Oceantransport{{{
++
++AC_ARG_WITH([Oceantransport],
++
++	AS_HELP_STRING([--with-Oceantransport = YES], [compile with Oceantransport capabilities (default is yes)]),
++
++	[OCEANTRANSPORT=$withval],[OCEANTRANSPORT=yes])
++
++AC_MSG_CHECKING(for Oceantransport capability compilation)
++
++
++HAVE_OCEANTRANSPORT=no 
++
++if test "x$OCEANTRANSPORT" = "xyes"; then
++
++	HAVE_OCEANTRANSPORT=yes
++
++	AC_DEFINE([_HAVE_OCEANTRANSPORT_],[1],[with Oceantransport capability])
++
++fi
++
++AM_CONDITIONAL([OCEANTRANSPORT], [test x$HAVE_OCEANTRANSPORT = xyes])
++
++AC_MSG_RESULT($HAVE_OCEANTRANSPORT)
++
++dnl }}}
++dnl with-Recovery{{{
++
++AC_ARG_WITH([Recovery],
++
++	AS_HELP_STRING([--with-Recovery = YES], [compile with Recovery capabilities (default is yes)]),
++
++	[RECOVERY=$withval],[RECOVERY=yes])
++
++AC_MSG_CHECKING(for Recovery capability compilation)
++
++
++HAVE_RECOVERY=no 
++
++if test "x$RECOVERY" = "xyes"; then
++
++	HAVE_RECOVERY=yes
++
++	AC_DEFINE([_HAVE_RECOVERY_],[1],[with Recovery capability])
++
++fi
++
++AM_CONDITIONAL([RECOVERY], [test x$HAVE_RECOVERY = xyes])
++
++AC_MSG_RESULT($HAVE_RECOVERY)
++
++dnl }}}
+ dnl with-Sampling{{{
+ 
+ AC_ARG_WITH([Sampling],
+@@ -483,117 +867,213 @@
+ AC_MSG_RESULT($HAVE_SAMPLING)
+ 
+ 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)
++dnl with-Sealevelchange{{{
+ 
+-HAVE_SEALEVELRISE=no 
+-if test "x$SEALEVELRISE" = "xyes"; then
+-	HAVE_SEALEVELRISE=yes
+-	AC_DEFINE([_HAVE_SEALEVELRISE_],[1],[with Sealevelrise capability])
++AC_ARG_WITH([Sealevelchange],
++
++	AS_HELP_STRING([--with-Sealevelchange = YES], [compile with Sealevelchange capabilities (default is yes)]),
++
++	[SEALEVELCHANGE=$withval],[SEALEVELCHANGE=yes])
++
++AC_MSG_CHECKING(for Sealevelchange capability compilation)
++
++
++HAVE_SEALEVELCHANGE=no 
++
++if test "x$SEALEVELCHANGE" = "xyes"; then
++
++	HAVE_SEALEVELCHANGE=yes
++
++	AC_DEFINE([_HAVE_SEALEVELCHANGE_],[1],[with Sealevelchange capability])
++
+ fi
+-AM_CONDITIONAL([SEALEVELRISE], [test x$HAVE_SEALEVELRISE = xyes])
+-AC_MSG_RESULT($HAVE_SEALEVELRISE)
++
++AM_CONDITIONAL([SEALEVELCHANGE], [test x$HAVE_SEALEVELCHANGE = xyes])
++
++AC_MSG_RESULT($HAVE_SEALEVELCHANGE)
++
+ dnl }}}
+ dnl with-Smb{{{
++
+ AC_ARG_WITH([Smb],
++
+ 	AS_HELP_STRING([--with-Smb = YES], [compile with Smb capabilities (default is yes)]),
++
+ 	[SMB=$withval],[SMB=yes])
++
+ AC_MSG_CHECKING(for Smb capability compilation)
+ 
++
+ HAVE_SMB=no 
++
+ if test "x$SMB" = "xyes"; then
++
+ 	HAVE_SMB=yes
++
+ 	AC_DEFINE([_HAVE_SMB_],[1],[with Smb capability])
++
+ fi
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ 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
++
+ AM_CONDITIONAL([UZAWAPRESSURE], [test x$HAVE_UZAWAPRESSURE = xyes])
++
+ AC_MSG_RESULT($HAVE_UZAWAPRESSURE)
++
+ dnl }}}
+ 
+ ])
+Index: ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/analyses/EnumToAnalysis.cpp	(revision 26099)
+@@ -13,6 +13,9 @@
+ Analysis* EnumToAnalysis(int analysis_enum){
+ 
+ 	switch(analysis_enum){
++		#ifdef _HAVE_HYDROLOGYTWS_
++		case HydrologyTwsAnalysisEnum : return new HydrologyTwsAnalysis();
++		#endif
+ 		#ifdef _HAVE_ADJOINTBALANCETHICKNESS2_
+ 		case AdjointBalancethickness2AnalysisEnum : return new AdjointBalancethickness2Analysis();
+ 		#endif
+@@ -70,17 +73,17 @@
+ 		#ifdef _HAVE_HYDROLOGYDCINEFFICIENT_
+ 		case HydrologyDCInefficientAnalysisEnum : return new HydrologyDCInefficientAnalysis();
+ 		#endif
+-		#ifdef _HAVE_HYDROLOGYSHREVE_
+-		case HydrologyShreveAnalysisEnum : return new HydrologyShreveAnalysis();
+-		#endif
+ 		#ifdef _HAVE_HYDROLOGYGLADS_
+ 		case HydrologyGlaDSAnalysisEnum : return new HydrologyGlaDSAnalysis();
+ 		#endif
++		#ifdef _HAVE_HYDROLOGYPISM_
++		case HydrologyPismAnalysisEnum : return new HydrologyPismAnalysis();
++		#endif
+ 		#ifdef _HAVE_HYDROLOGYSHAKTI_
+ 		case HydrologyShaktiAnalysisEnum : return new HydrologyShaktiAnalysis();
+ 		#endif
+-		#ifdef _HAVE_HYDROLOGYPISM_
+-		case HydrologyPismAnalysisEnum : return new HydrologyPismAnalysis();
++		#ifdef _HAVE_HYDROLOGYSHREVE_
++		case HydrologyShreveAnalysisEnum : return new HydrologyShreveAnalysis();
+ 		#endif
+ 		#ifdef _HAVE_L2PROJECTIONBASE_
+ 		case L2ProjectionBaseAnalysisEnum : return new L2ProjectionBaseAnalysis();
+@@ -100,10 +103,13 @@
+ 		#ifdef _HAVE_MELTING_
+ 		case MeltingAnalysisEnum : return new MeltingAnalysis();
+ 		#endif
++		#ifdef _HAVE_OCEANTRANSPORT_
++		case OceantransportAnalysisEnum : return new OceantransportAnalysis();
++		#endif
+ 		#ifdef _HAVE_SAMPLING_
+ 		case SamplingAnalysisEnum : return new SamplingAnalysis();
+ 		#endif
+-		#ifdef _HAVE_SEALEVELRISE_
++		#ifdef _HAVE_SEALEVELCHANGE_
+ 		case SealevelchangeAnalysisEnum : return new SealevelchangeAnalysis();
+ 		#endif
+ 		#ifdef _HAVE_SMB_
+Index: ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(revision 26099)
+@@ -17,7 +17,7 @@
+ 	::CreateNodes(nodes,iomodel,OceantransportAnalysisEnum,P1Enum);
+ }/*}}}*/
+ int  OceantransportAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+-	return 1;
++	return 3;
+ }/*}}}*/
+ void OceantransportAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+@@ -58,6 +58,8 @@
+ 	iomodel->ConstantToInput(inputs,elements,0.,AccumulatedDeltaBottomPressureEnum,P1Enum);
+ 	iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaBottomPressureEnum,P1Enum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.bottompressure",BottomPressureEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.dsl",DslEnum);
++	iomodel->FetchDataToInput(inputs,elements,"md.initialization.str",StrEnum);
+ 
+ 
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 26098)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 26099)
+@@ -102,6 +102,7 @@
+ #include "./ThicknessAcrossGradientx/ThicknessAcrossGradientx.h"
+ #include "./UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h"
+ #include "./VertexCoordinatesx/VertexCoordinatesx.h"
++#include "./ElementCoordinatesx/ElementCoordinatesx.h"
+ 
+ #ifdef _HAVE_OCEAN_
+ #include "./OceanExchangeDatax/OceanExchangeDatax.h"
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26098)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26099)
+@@ -211,6 +211,7 @@
+ 	./modules/NodesDofx/NodesDofx.cpp \
+ 	./modules/NodalValuex/NodalValuex.cpp \
+ 	./modules/VertexCoordinatesx/VertexCoordinatesx.cpp \
++	./modules/ElementCoordinatesx/ElementCoordinatesx.cpp \
+ 	./modules/OutputResultsx/OutputResultsx.cpp \
+ 	./modules/InputDepthAverageAtBasex/InputDepthAverageAtBasex.cpp \
+ 	./modules/InputDuplicatex/InputDuplicatex.cpp \
+@@ -479,7 +480,7 @@
+ if MASSTRANSPORT
+ issm_sources += ./analyses/MasstransportAnalysis.cpp
+ endif
+-if OCEANMASSTRANSPORT
++if OCEANTRANSPORT
+ issm_sources += ./analyses/OceantransportAnalysis.cpp
+ endif
+ if SMB
+@@ -516,21 +517,6 @@
+ issm_sources += ./analyses/ExtrapolationAnalysis.cpp
+ endif
+ #}}}
+-#Gia sources (only if have fortran){{{
+-if GIA
+-if FORTRAN
+-issm_sources += \
+-	./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp \
+-	./modules/GiaDeflectionCorex/distme.f \
+-	./modules/GiaDeflectionCorex/freed.f \
+-	./modules/GiaDeflectionCorex/ojrule.f \
+-	./modules/GiaDeflectionCorex/pwise.f \
+-	./modules/GiaDeflectionCorex/qwise.f \
+-	./modules/GiaDeflectionCorex/stot.f \
+-	./modules/GiaDeflectionCorex/what0.f
+-endif
+-endif
+-#}}}
+ #Love sources (only if have fortran){{{
+ if LOVE
+ if FORTRAN
+@@ -566,11 +552,25 @@
+ endif
+ # }}}
+ #Slc sources  {{{
+-if SEALEVELRISE
++if SEALEVELCHANGE
+ issm_sources += \
+ 	./cores/sealevelchange_core.cpp \
+ 	./analyses/SealevelchangeAnalysis.cpp
++
++#gia ivins physics (only if have fortran)
++if FORTRAN
++issm_sources += \
++	./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp \
++	./modules/GiaDeflectionCorex/distme.f \
++	./modules/GiaDeflectionCorex/freed.f \
++	./modules/GiaDeflectionCorex/ojrule.f \
++	./modules/GiaDeflectionCorex/pwise.f \
++	./modules/GiaDeflectionCorex/qwise.f \
++	./modules/GiaDeflectionCorex/stot.f \
++	./modules/GiaDeflectionCorex/what0.f
+ endif
++
++endif
+ #}}}
+ #Metis sources  {{{
+ if METIS
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26099)
+@@ -109,9 +109,11 @@
+ 	int          ntransitions;
+ 	IssmDouble*  partitionice=NULL;
+ 	IssmDouble*  partitionhydro=NULL;
++	IssmDouble*  partitionocean=NULL;
+ 	IssmDouble*  bslcice_partition=NULL;
+ 	IssmDouble*  bslchydro_partition=NULL;
+-	int          npartice,nparthydro,nel;
++	IssmDouble*  bslcocean_partition=NULL;
++	int          npartice,nparthydro,npartocean,nel;
+ 
+ 
+ 	/*some constant parameters: */
+@@ -158,6 +160,7 @@
+ 		parameters->AddObject(new DoubleMatParam(CumBslcIcePartitionEnum,bslcice_partition,npartice,1));
+ 		xDelete<IssmDouble>(partitionice);
+ 	}
++	
+ 	iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro");
+ 	parameters->AddObject(new IntParam(SolidearthNpartHydroEnum,nparthydro));
+ 	if(nparthydro){
+@@ -169,6 +172,17 @@
+ 		xDelete<IssmDouble>(partitionhydro);
+ 	}
+ 
++	iomodel->FetchData(&npartocean,"md.solidearth.npartocean");
++	parameters->AddObject(new IntParam(SolidearthNpartOceanEnum,npartocean));
++	if(npartocean){
++		iomodel->FetchData(&partitionocean,&nel,NULL,"md.solidearth.partitionocean");
++		parameters->AddObject(new DoubleMatParam(SolidearthPartitionOceanEnum,partitionocean,nel,1));
++		parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.npartocean",SolidearthNpartOceanEnum));
++		bslcocean_partition=xNewZeroInit<IssmDouble>(npartocean);
++		parameters->AddObject(new DoubleMatParam(CumBslcOceanPartitionEnum,bslcocean_partition,npartocean,1));
++		xDelete<IssmDouble>(partitionocean);
++	}
++
+ 	
+ 	/*Deal with external multi-model ensembles: {{{*/
+ 	if(isexternal){
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26099)
+@@ -237,6 +237,7 @@
+ 		virtual void       CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble init_time,IssmDouble end_time,int averaging_method){_error_("not implemented yet "<<this->ObjectEnum());};
+ 		virtual void       ElementResponse(IssmDouble* presponse,int response_enum)=0;
+ 		virtual void       ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
++		virtual void       ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false)=0;
+ 		virtual int        FiniteElement(void)=0;
+ 		virtual IssmDouble FloatingArea(bool scaled)=0;
+ 		virtual void       FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure)=0;
+@@ -373,7 +374,7 @@
+ 		virtual void          EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy)=0;
+ 		virtual void          EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz)=0;
+ 		#endif
+-		#ifdef _HAVE_SEALEVELRISE_
++		#ifdef _HAVE_SEALEVELCHANGE_
+ 		virtual void          SetSealevelMasks(SealevelMasks* masks)=0;
+ 		virtual IssmDouble    GetArea3D(void)=0;
+ 		virtual IssmDouble    GetAreaSpherical(void)=0;
+@@ -382,7 +383,8 @@
+ 		virtual IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution,IssmDouble* partition,IssmDouble oceanarea)=0;
+ 		virtual IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea)=0;
+ 		virtual void          SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi, SealevelMasks* masks)=0;
+-		virtual void          SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz)=0;
++		virtual void          SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
++				IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze)=0;
+ 		virtual void          SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0;
+ 		virtual void          DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
+ 		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26099)
+@@ -69,6 +69,7 @@
+ 		ElementMatrix* CreateBasalMassMatrix(void);
+ 		void           CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble start_time,IssmDouble end_time,int averaging_method);
+ 		void           ElementResponse(IssmDouble* presponse,int response_enum);
++		void           ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false){_error_("not implemented yet");};
+ 		void           ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		int            FiniteElement(void);
+ 		IssmDouble     FloatingArea(bool scaled);
+@@ -213,11 +214,12 @@
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ 		#endif
+-		#ifdef _HAVE_SEALEVELRISE_
++		#ifdef _HAVE_SEALEVELCHANGE_
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
++					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+ 		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26099)
+@@ -53,6 +53,7 @@
+ 		void        ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int M,int N,int interp){_error_("not implemented yet");};
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp){_error_("not implemented yet");};
+ 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
++		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
+ 		int         FiniteElement(void);
+ 		IssmDouble  FloatingArea(bool scaled){_error_("not implemented yet");};
+@@ -168,10 +169,11 @@
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ #endif
+-#ifdef _HAVE_SEALEVELRISE_
++#ifdef _HAVE_SEALEVELCHANGE_
+ 		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
++					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+ 		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26099)
+@@ -52,6 +52,7 @@
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp){_error_("not implemented yet");};
+ 		IssmDouble  DragCoefficientAbsGradient(void){_error_("not implemented yet");};
+ 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
++		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		void        FaceOnBaseIndices(int* pindex1,int* pindex2,int* pindex3);
+ 		void        FaceOnFrontIndices(int* pindex1,int* pindex2,int* pindex3);
+@@ -175,10 +176,11 @@
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ #endif
+-#ifdef _HAVE_SEALEVELRISE_
++#ifdef _HAVE_SEALEVELCHANGE_
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){_error_("not implemented yet!");};
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
++					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+ 		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26099)
+@@ -5410,7 +5410,7 @@
+ }
+ /*}}}*/
+ #endif
+-#ifdef _HAVE_SEALEVELRISE_
++#ifdef _HAVE_SEALEVELCHANGE_
+ IssmDouble Tria::OceanAverage(IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+ 
+ 	if(masks->isoceanin[this->lid]){
+@@ -5540,7 +5540,8 @@
+ 
+ }
+ /*}}}*/
+-void    Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){ /*{{{*/
++void    Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
++
+ 	/*diverse:*/
+ 	int gsize;
+ 	bool spherical=true;
+@@ -5683,7 +5684,6 @@
+ 	}
+ 
+ 	/*Add in inputs:*/
+-	this->inputs->SetArrayInput(SealevelchangeIndicesEnum,this->lid,indices,gsize);
+ 	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,gsize);
+ 	if(computeelastic){
+ 		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,gsize);
+@@ -6218,8 +6218,450 @@
+ 	return;
+ }
+ /*}}}*/
++void    Tria::ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, bool spherical){/*{{{*/
++
++	/*Look for x,y,z coordinates:*/
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble xe,ye,ze;
++
++	/*Element XYZ list*/
++	::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
++
++	/*Find centroid:*/
++	xe=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
++	ye=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
++	ze=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
++
++	if(!spherical){
++		vxe->SetValue(this->sid,xe,INS_VAL);
++		vye->SetValue(this->sid,ye,INS_VAL);
++		vze->SetValue(this->sid,ze,INS_VAL);
++	}
++	else _error_("spherical coordinates not supported yet!");
++	return;
++}
++/*}}}*/
++
++//new logic 
++void    Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
++
++	/*diverse:*/
++	int nel;
++	bool spherical=true;
++	IssmDouble llr_list[NUMVERTICES][3];
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble area,planetarea,planetradius;
++	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
++	IssmDouble rho_earth;
++	IssmDouble lati,longi;
++	IssmDouble constant;
++	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
++	int sidlist[NUMVERTICES];
++
++	#ifdef _HAVE_RESTRICT_
++	IssmDouble* __restrict__ G=NULL;
++	IssmDouble* __restrict__ GU=NULL;
++	IssmDouble* __restrict__ GN=NULL;
++	IssmDouble* __restrict__ GE=NULL;
++	IssmDouble* __restrict__ G_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
++	IssmDouble* __restrict__ U_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ H_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ lates=NULL;
++	IssmDouble* __restrict__ longes=NULL;
++	#else
++	IssmDouble* G=NULL;
++	IssmDouble* GU=NULL;
++	IssmDouble* GN=NULL;
++	IssmDouble* GE=NULL;
++	IssmDouble* G_elastic_precomputed=NULL;
++	IssmDouble* G_rigid_precomputed=NULL;
++	IssmDouble* U_elastic_precomputed=NULL;
++	IssmDouble* H_elastic_precomputed=NULL;
++	IssmDouble* lates=NULL;
++	IssmDouble* longes=NULL;
++	#endif
++
++	/*elastic green function:*/
++	int index;
++	int         M;
++
++	/*Computational flags:*/
++	bool computerigid = false;
++	bool computeelastic = false;
++	int  horiz;
++
++	/*recover parameters: */
++	rho_earth=FindParam(MaterialsEarthDensityEnum);
++	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
++	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
++	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
++	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++
++	/*compute area and add to inputs:*/
++	area=GetAreaSpherical();
++	this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
++	this->AddInput(SealevelAreaEnum,&area,P0Enum);
++	if(!computerigid)return;
++
++	/*recover precomputed green function kernels:*/
++	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
++	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
++
++	/*allocate arrays:*/
++	G=xNewZeroInit<IssmDouble>(3*nel);
++	longes=xNewZeroInit<IssmDouble>(nel);
++	lates=xNewZeroInit<IssmDouble>(nel);
++
++	if(computeelastic){
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
++
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&M);
++
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
++
++		GU=xNewZeroInit<IssmDouble>(3*nel);
++		if(horiz){
++			GN=xNewZeroInit<IssmDouble>(3*nel);
++			GE=xNewZeroInit<IssmDouble>(3*nel);
++		}
++	}
++
++	/*retrieve coordinates: */
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++
++	/*compute centroids of all elements:*/
++	for(int i=0;i<nel;i++){
++		lates[i]= asin(zze[i]/planetradius);
++		longes[i]= atan2(yye[i],xxe[i]);
++	}
++	
++	constant=3/rho_earth*area/planetarea;
++
++	/*Recover vertex absolute id: */
++	this->GetVerticesSidList(&sidlist[0]);
++
++	for(int e=0;e<nel;e++){
++		for (int i=0;i<3;i++){
++			IssmDouble alpha;
++			IssmDouble delPhi,delLambda;
++			/*recover info for this element and vertex:*/
++			IssmDouble late=lates[e];
++			IssmDouble longe=longes[e];
++			int sid=sidlist[i];
++
++			/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
++			lati=latitude[sid]/180.*M_PI; longi=longitude[sid]/180.*M_PI;
++			delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
++			alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
++			index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
++
++			/*Rigid earth gravitational perturbation: */
++			G[i*nel+e]+=G_rigid_precomputed[index];
++			
++			if(computeelastic){
++				G[i*nel+e]+=G_elastic_precomputed[index];
++			}
++			G[i*nel+e]=G[i*nel+e]*constant;
++
++			/*Elastic components:*/
++			if(computeelastic){
++				GU[i*nel+e] =  constant * U_elastic_precomputed[index];
++				if(horiz){
++					/*Compute azimuths, both north and east components: */
++					x = xx[sid]; y = yy[sid]; z = zz[sid];
++					if(latitude[sid]==90){
++						x=1e-12; y=1e-12;
++					}
++					if(latitude[sid]==-90){
++						x=1e-12; y=1e-12;
++					}
++					dx = xxe[e]-x; dy = yye[e]-y; dz = zze[e]-z;
++					N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++					E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++
++					GN[i*nel+e] = constant*H_elastic_precomputed[index]*N_azim;
++					GE[i*nel+e] = constant*H_elastic_precomputed[index]*E_azim;
++				}
++			}
++		}
++	}
++
++	/*Add in inputs:*/
++	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,nel*3);
++	if(computeelastic){
++		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,nel*3);
++		if(horiz){
++			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,nel*3);
++			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,nel*3);
++		}
++	}
++	this->inputs->SetDoubleInput(AreaEnum,this->lid,area); 
++	this->AddInput(SealevelAreaEnum,&area,P0Enum);
++
++	/*Free allocations:*/
++	#ifdef _HAVE_RESTRICT_
++	delete G;
++	if(computeelastic){
++		delete GU;
++		if(horiz){
++			delete GN;
++			delete GE;
++		}
++	}
++	delete lates;
++	delete longes;
++	#else
++	xDelete(G);
++	if(computeelastic){
++		xDelete(GU);
++		if(horiz){
++			xDelete(GN);
++			xDelete(GE);
++		}
++	}
++	delete lates;
++	delete longes;
++	#endif
++
++	return;
++}
++/*}}}*/
++void    Tria::SealevelchangeBarystaticLoads(IssmDouble* barystatic_contribution,IssmDouble* localloads, SealevelMasks* masks, Matrix<IssmDouble>* barystatic_contribution_onpartition, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
++
++	/*diverse:*/
++	IssmDouble area;
++	IssmDouble phi_ice=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
++	IssmDouble phi_water=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
++	IssmDouble I,W,BP;  //change in ice thickness, water column or bottom pressure (Farrel and Clarke, Equ. 4)
++	bool notfullygrounded=false;
++	bool scaleoceanarea= false;
++	bool computerigid= false;
++	int  glfraction=1;
++	int  npartice,nparthydro,npartocean;
++
++	/*flags:*/
++	bool isocean=false;
++	bool ishydro=false;
++	bool isice=false;
++
++	/*output: */
++	IssmDouble bslcice=0;
++	IssmDouble bslchydro=0;
++	IssmDouble bslcbp=0;
++
++	/*ice properties: */
++	IssmDouble rho_ice,rho_water,rho_freshwater;
++
++	/*constants:*/
++	IssmDouble constant=0;
++	
++	/*recover parameters:*/
++	this->parameters->FindParam(&isice,TransientIsmasstransportEnum);
++	this->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
++	this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
++
++	/*early return if we are not on an ice cap, and we are not requesting 
++	 *hydrology or bottom pressure loads :*/
++	if(!isocean && !ishydro){
++		if(!masks->isiceonly[this->lid]){
++		#ifdef _ISSM_DEBUG_
++			constant=0; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++		#endif
++		/*barystatic_contribution[0]+=0;
++		barystatic_contribution[1]+=0;
++		barystatic_contribution[2]+=0;*/
++		return;
++		}
++	}
++
++	/*early return if we are fully floating and we are not doing bottom pressure loads:*/
++	if(!isocean){
++		if (masks->isfullyfloating[this->lid]){
++			constant=0;
++			#ifdef _ISSM_DEBUG_
++			this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++			#endif
++			/*barystatic_contribution[0]+=0;
++			barystatic_contribution[1]+=0;
++			barystatic_contribution[2]+=0;*/
++			return;
++		}
++	}
++
++	/*early return if we are not on the ocean and we are not doing ice mass transport of 
++	 * hydrology:*/
++	if(!isice  && !ishydro){
++		if(!masks->isoceanin[this->lid]){
++			/*barystatic_contribution[0]+=0;
++			barystatic_contribution[1]+=0;
++			barystatic_contribution[2]+=0;*/
++			return;
++		}
++
++	}
++	
++	/*if we are an ice shelf, are we fully grounded or not? (used later):*/
++	if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
++
++	/*recover some parameters:*/
++	rho_ice=FindParam(MaterialsRhoIceEnum);
++	rho_water=FindParam(MaterialsRhoSeawaterEnum);
++	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
++	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
++	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
++	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
++
++	/*Get area of element: precomputed in the sealevelchange_geometry:*/
++	this->Element::GetInputValue(&area,AreaEnum);
++
++	/*Deal with ice loads if we are on grounded ice:*/
++	if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid]){ /*{{{*/
++
++		/*Compute fraction of the element that is grounded: */
++		if(notfullygrounded){
++			IssmDouble xyz_list[NUMVERTICES][3];
++			::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++
++			phi_ice=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
++			if(glfraction==0)phi_ice=1;
++#ifdef _ISSM_DEBUG_
++			this->AddInput(SealevelBarystaticMaskEnum,&phi_ice,P0Enum);
+ #endif
++		}
++		else phi_ice=1.0;
+ 
++		/*Inform mask: */
++		constant+=100; //1 for ice.
++		#ifdef _ISSM_DEBUG_
++		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++		#endif
++
++		/*Retrieve surface load for ice: */
++		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
++		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
++
++		/*/Average ice thickness over grounded area of the element only: {{{*/
++		if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
++		else{
++			IssmDouble total_weight=0;
++			bool mainlyfloating = true;
++			int         point1;
++			IssmDouble  fraction1,fraction2;
++
++			/*Recover portion of element that is grounded*/
++			this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
++			Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
++
++			/* Start  looping on the number of gaussian points and average over these gaussian points: */
++			total_weight=0;
++			I=0;
++			while(gauss->next()){
++				IssmDouble Ig=0;
++				deltathickness_input->GetInputValue(&Ig,gauss);
++				I+=Ig*gauss->weight;
++				total_weight+=gauss->weight;
++			}
++			I=I/total_weight;
++			delete gauss;
++		}
++		/*}}}*/
++
++		/*Compute barystatic contribution:*/
++		_assert_(oceanarea>0.);
++		if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
++		bslcice = rho_ice*area*I/(oceanarea*rho_water);
++		_assert_(!xIsNan<IssmDouble>(bslcice));
++
++		/*Transfer thickness change into kg/m^2:*/
++		I=I*rho_ice*phi_ice; 
++	} /*}}}*/
++
++	/*Deal with water loads if we are on ground:*/
++	if(!masks->isfullyfloating[this->lid]){
++
++		/*Retrieve water height at vertices: */
++		Input* deltathickness_input=this->GetInput(DeltaTwsEnum);
++		if (!deltathickness_input)_error_("DeltaTwsEnum input needed to compute sea level change!");
++		deltathickness_input->GetInputAverage(&W);
++
++		/*Compute barystatic component:*/
++		_assert_(oceanarea>0.);
++		if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
++		bslchydro = rho_freshwater*area*phi_water*W/(oceanarea*rho_water);
++		_assert_(!xIsNan<IssmDouble>(bslchydro));
++
++		/*convert from m to kg/m^2:*/
++		W=W*rho_freshwater*phi_water;
++	}
++
++	/*Deal with ocean bottom pressures:*/
++	if(masks->isoceanin[this->lid]){
++
++		/*Retrieve bottom pressure change and average over the element: */
++		Input* bottompressure_change_input=this->GetInput(DeltaBottomPressureEnum);
++		if (!bottompressure_change_input)_error_("DeltaBottomPressureEnum pressure input needed to compute sea level change fingerprint!");
++		bottompressure_change_input->GetInputAverage(&BP);
++		
++		/*Compute barystatic component:*/
++		bslcbp = rho_water*area*BP/(oceanarea*rho_water);
++
++		/*convert from m to kg/m^2:*/
++		BP=BP*rho_water;
++	}
++
++	/*Plug all loads into total load vector:*/
++	localloads[this->lid]+=I+W+BP;
++	
++	/*Plug bslcice into barystatic contribution vector:*/
++	if(barystatic_contribution_onpartition){
++		int idi=reCast<int>(partition[this->Sid()])+1;
++		int idj=0;
++		idj=0;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslcice,ADD_VAL);
++		idj=1;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslchydro,ADD_VAL);
++		idj=2;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslcbp,ADD_VAL);
++	}
++
++	barystatic_contribution[0]+=bslcice;
++	barystatic_contribution[1]+=bslchydro;
++	barystatic_contribution[2]+=bslcbp;
++
++}
++/*}}}*/
++IssmDouble Tria::SealevelchangeConvolution(IssmDouble* loads){ /*{{{*/
++
++	/*sal green function:*/
++	IssmDouble* G=NULL;
++	IssmDouble Sealevel[NUMVERTICES]={0,0,0};
++
++	bool sal = false;
++	int  size;
++	int  nel;
++	
++	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++	if(sal){
++		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
++		
++		for(int i=0;i<NUMVERTICES;i++) {
++			for (int e=0;e<nel;e++){
++				Sealevel[i]+=G[i*nel+e]*loads[e]; 
++			}
++		}
++
++		this->AddInput(SealevelRSLEnum,Sealevel,P1Enum);
++	}
++
++} /*}}}*/
++
++#endif
++
+ #ifdef _HAVE_DAKOTA_
+ void       Tria::InputScaleFromDakota(IssmDouble* distributed_values, IssmDouble* partition, int npart, int nt, int name){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26099)
+@@ -69,6 +69,7 @@
+ 		void        ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int M,int N,int interp);
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp);
+ 		void        CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
++		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false);
+ 		int         EdgeOnBaseIndex();
+ 		void        EdgeOnBaseIndices(int* pindex1,int* pindex);
+ 		int         EdgeOnSurfaceIndex();
+@@ -159,17 +160,21 @@
+ 		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_
++		#ifdef _HAVE_SEALEVELCHANGE_
+ 		IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks);
+ 		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
+ 		void    SetSealevelMasks(SealevelMasks* masks);
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
++		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
++		void    SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
++
+ 		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
+ 		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
+ 		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
+ 		void    SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
+-		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
++		void    GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
++		void    SealevelchangeBarystaticLoads(IssmDouble* barystatic_contribution,IssmDouble* localloads, SealevelMasks* masks, Matrix<IssmDouble>* barystatic_contribution_onpartition, IssmDouble* partition, IssmDouble oceanarea);
++		IssmDouble SealevelchangeConvolution(IssmDouble* loads);
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26099)
+@@ -843,10 +843,11 @@
+ 
+ 		case TransientSolutionEnum:{
+ 			/*We have multiple analyses here, process one by one*/
+-			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,issampling;
++			bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isoceantransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslc,isesa,issampling;
+ 			iomodel->FindConstant(&isthermal,"md.transient.isthermal");
+ 			iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront");
+ 			iomodel->FindConstant(&ismasstransport,"md.transient.ismasstransport");
++			iomodel->FindConstant(&isoceantransport,"md.transient.isoceantransport");
+ 			iomodel->FindConstant(&isstressbalance,"md.transient.isstressbalance");
+ 			iomodel->FindConstant(&isgroundingline,"md.transient.isgroundingline");
+ 			iomodel->FindConstant(&isdamage,"md.transient.isdamageevolution");
+@@ -892,6 +893,9 @@
+ 			if(isdamage){
+ 				analyses_temp[numanalyses++]=DamageEvolutionAnalysisEnum;
+ 			}
++			if(isoceantransport){
++				analyses_temp[numanalyses++]=OceantransportAnalysisEnum;
++			}
+ 			if(isslc){
+ 				analyses_temp[numanalyses++]=SealevelchangeAnalysisEnum;
+ 			}
+@@ -4743,7 +4747,7 @@
+ }
+ /*}}}*/
+ #endif
+-#ifdef _HAVE_SEALEVELRISE_
++#ifdef _HAVE_SEALEVELCHANGE_
+ void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition,SealevelMasks* masks) { /*{{{*/
+ 
+ 	/*serialized vectors:*/
+@@ -4755,6 +4759,7 @@
+ 	IssmDouble  oceanarea      = 0.;
+ 	IssmDouble  oceanarea_cpu  = 0.;
+ 	int bp_compute_fingerprints= 0;
++	bool isoceantransport=false;
+ 
+ 	Vector<IssmDouble>* bslcice_partition=NULL;
+ 	IssmDouble* bslcice_partition_serial=NULL;
+@@ -4764,10 +4769,14 @@
+ 	Vector<IssmDouble>* bslchydro_partition=NULL;
+ 	IssmDouble* bslchydro_partition_serial=NULL;
+ 	IssmDouble* partitionhydro=NULL;
++	bool istws=0;
+ 	int nparthydro;
+-	bool istws;
++		
++	int npartocean;
++	Vector<IssmDouble>* bslcocean_partition=NULL;
++	IssmDouble* bslcocean_partition_serial=NULL;
++	IssmDouble* partitionocean=NULL;
+ 
+-
+    /*Initialize temporary vector that will be used to sum barystatic components
+     * on all local elements, prior to assembly:*/
+ 	int gsize = this->nodes->NumberOfDofs(GsetEnum);
+@@ -4800,7 +4809,34 @@
+ 		bslchydro_partition= new Vector<IssmDouble>(nparthydro);
+ 	}
+ 
++	this->parameters->FindParam(&npartocean,SolidearthNpartOceanEnum);
++	if(npartocean){
++		this->parameters->FindParam(&partitionocean,&nel,NULL,SolidearthPartitionOceanEnum);
++		bslchydro_partition= new Vector<IssmDouble>(npartocean);
++	}
++	/*For later:
++	npartbarystatic=npartice;
++	if(nparthydro>npartbarystatic)npartbarystatic=nparthydro;
++	if(npartocean>npartbarystatic)npartbarystatic=npartocean;
++	bslc_partition=new Matrix(IssmDouble>(npartbarystatic,3);
+ 
++	bslc_cpu[0]=0; bslc_cpu[1]=0; bslc_cpu[2]=0;
++	for(Object* & object : this->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeBarystaticLoads(&bslc_cpu[0], localloads,masks, bslcice_partition,partitionice,oceanarea);
++	}
++	MPI Bcast localloads -> loads
++
++	for(Object* & object : this->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeConvolution(loads);
++	}
++	*/
++
++
++
++
++
+ 	/*Call the barystatic sea level change core for ice : */
+ 	bslcice_cpu=0;
+ 	for(Object* & object : this->elements->objects){
+@@ -4820,7 +4856,8 @@
+ 
+ 	/*Call the barystatic sea level change core for bottom pressures: */
+ 	this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);
+-	if(bp_compute_fingerprints){
++	this->parameters->FindParam(&isoceantransport,TransientIsoceantransportEnum);
++	if(bp_compute_fingerprints && isoceantransport){
+ 		for(int i=0;i<elements->Size();i++){
+ 			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+ 			element->SealevelchangeBarystaticBottomPressure(RSLgi,masks);
+@@ -5107,6 +5144,10 @@
+ 		Element* element = xDynamicCast<Element*>(object);
+ 		element->GiaDeflection(wg,dwgdt, matlitho, x,y);
+ 	}
++
++	/*Assemble parallel vector:*/
++	dwgdt->Assemble();
++	wg->Assemble();
+ }
+ /*}}}*/
+ #endif
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 26098)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 26099)
+@@ -162,7 +162,7 @@
+ 		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_
++		#ifdef _HAVE_SEALEVELCHANGE_
+ 		void SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition, SealevelMasks* masks); 
+ 		void SealevelchangeSal(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
+ 		void SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26099)
+@@ -84,6 +84,13 @@
+ 	return;
+ }
+ /*}}}*/
++void Inputs::Echo(int enum_in){/*{{{*/
++	_printf_("Inputs Echo:\n");
++	int index= EnumToIndex(enum_in);
++	if(this->inputs[index])this->inputs[index]->Echo();
++	return;
++}
++/*}}}*/
+ void Inputs::Marshall(MarshallHandle* marshallhandle){/*{{{*/
+ 
+ 	int num_inputs=0;
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26098)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26099)
+@@ -49,6 +49,7 @@
+ 		void     DeepEcho(void);
+ 		void     DeepEcho(int enum_in);
+ 		void     Echo(void);
++		void     Echo(int enum_in);
+ 		bool     Exist(int enum_type);
+ 		void     GetInputsInterpolations(int* pnuminputs,int** pinterpolations,int** penum);
+ 		void             GetArray(int enum_in,int row,IssmDouble** pvalues,int* pN);
+Index: ../trunk-jpl/src/c/cores/oceantransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26099)
+@@ -20,6 +20,7 @@
+ 	bool   save_results;
+ 	bool   dakota_analysis;
+ 	int    solution_type;
++	Vector<IssmDouble>*  ug  = NULL;
+ 
+ 	/*activate configuration*/
+ 	femmodel->SetCurrentConfiguration(OceantransportAnalysisEnum);
+@@ -40,16 +41,19 @@
+ 	/*grab bottom pressures, dsl and str from OceantransportSpcbottompressure, OceantransportSpcdslEnum 
+ 	 * and OceantransportSpcstrEnum  inputs in each element, assemble into a vector and feed to 
+ 	 * InputUpdateFromSolutionx which will deal with accumulating such inputs:*/
+-	Vector<IssmDouble>*  ug  = NULL;
+ 	GetSolutionFromInputsx(&ug,femmodel); 
+ 	InputUpdateFromSolutionx(femmodel,ug); 
+ 
+-	delete ug;
++	SolidEarthOceanUpdates(femmodel);
+ 
+ 	if(solution_type==OceantransportSolutionEnum)femmodel->RequestedDependentsx();
+ 
+ 	/*profiler*/
+ 	femmodel->profiler->Stop(OCEANTRANSPORTCORE);
++	
++	/*free ressources:*/
++	delete ug;
++
+ } /*}}}*/
+ void SolidEarthOceanUpdates(FemModel* femmodel){ /*{{{*/
+ 
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26099)
+@@ -266,6 +266,7 @@
+ 
+ 	/*get some of the updates into elements:*/
+ 	InputUpdateFromVectorx(femmodel,U_grd,SealevelUGrdEnum,VertexSIdEnum); 
++	InputUpdateFromVectorx(femmodel,N_grd,SealevelEnum,VertexSIdEnum); 
+ 	InputUpdateFromVectorx(femmodel,N_grd,SealevelNGrdEnum,VertexSIdEnum); 
+ 	if(RSLg)InputUpdateFromVectorx(femmodel,RSLg,SealevelRSLEnum,VertexSIdEnum); 
+ 	if(RSLg_barystatic)InputUpdateFromVectorx(femmodel,RSLg_barystatic,SealevelRSLBarystaticEnum,VertexSIdEnum); 
+@@ -305,6 +306,7 @@
+ 	/*parameters: */
+ 	int  step;
+ 	int computesealevel=0;
++	bool isocean=false;
+ 	IssmDouble time;
+ 
+ 	IssmDouble cumgmtslc=0;
+@@ -315,6 +317,10 @@
+ 	/*early return if we are not computing sea level, but rather deformation: */
+ 	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+ 	if (!computesealevel)return;
++
++	/*early return if we have no ocean transport:*/
++	femmodel->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
++	if(!isocean)return;
+ 	
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing steric and dynamic sea level change\n");
+@@ -405,8 +411,13 @@
+ 	IssmDouble *xx    = NULL;
+ 	IssmDouble *yy    = NULL;
+ 	IssmDouble *zz    = NULL;
++	IssmDouble *xxe    = NULL;
++	IssmDouble *yye    = NULL;
++	IssmDouble *zze    = NULL;
++
+ 	int  horiz;
+ 	bool geometrydone = false;
++	bool optim=false;
+ 
+ 		
+ 	/*retrieve parameters:*/
+@@ -423,6 +434,7 @@
+ 
+ 	/*first, recover lat,long and radius vectors from vertices: */
+ 	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
++	ElementCoordinatesx(&xxe,&yye,&zze,femmodel->elements);
+ 	if(horiz) VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
+ 
+ 
+@@ -429,7 +441,8 @@
+ 	/*Run sealevel geometry routine in elements:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz);
++		element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
++		//if(optim) element->SealevelchangeGeometryOptim(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
+ 	}
+ 
+ 	/*Free ressources:*/
+Index: ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(revision 26099)
+@@ -0,0 +1,48 @@
++/*!\file ElementCoordinatesx
++ * \brief: compute a vector xe,ye and ze of element centroid coordinates by
++ * marching through all our elements.
++ */
++
++#include "./ElementCoordinatesx.h"
++
++#include "../../shared/shared.h"
++#include "../../toolkits/toolkits.h"
++
++void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze,Elements* elements,bool spherical) {
++
++	/*figure out how many vertices we have: */
++	int numberofelements=elements->NumberOfElements();
++
++	Vector<IssmDouble>* vxe=new Vector<IssmDouble>(numberofelements);
++	Vector<IssmDouble>* vye=new Vector<IssmDouble>(numberofelements);
++	Vector<IssmDouble>* vze=new Vector<IssmDouble>(numberofelements);
++
++	/*march through our elements: */
++	for(Object* & object : elements->objects){
++		Element* element=(Element*)object;
++		element->ElementCoordinates(vxe,vye,vze,spherical);
++	}
++
++	/*Assemble*/
++	vxe->Assemble();
++	vye->Assemble();
++	vze->Assemble();
++
++	/*serialize: */
++	IssmDouble* xe=vxe->ToMPISerial();
++	IssmDouble* ye=vye->ToMPISerial();
++	IssmDouble* ze=vze->ToMPISerial();
++
++	/*Free ressources: */
++	delete vxe;
++	delete vye;
++	delete vze;
++
++	/*output: */
++	if(pxe) *pxe=xe;
++	else xDelete<IssmDouble>(xe);
++	if(pye) *pye=ye;
++	else xDelete<IssmDouble>(ye);
++	if(pze) *pze=ze;
++	else xDelete<IssmDouble>(ze);
++}
+Index: ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(nonexistent)
++++ ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(revision 26099)
+@@ -0,0 +1,12 @@
++/*!\file:  ElementCoordinatesx.h
++ */ 
++
++#ifndef _ELEMENT_COORDINATESX_H
++#define _ELEMENT_COORDINATESX_H
++
++#include "../../classes/classes.h"
++
++/* local prototypes: */
++void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze,Elements* elements,bool spherical=false);
++
++#endif  /* _ELEMENT_COORDINATESX_H */
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26098)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26099)
+@@ -112,8 +112,10 @@
+ syn keyword cConstant CumBslcEnum
+ syn keyword cConstant CumBslcIceEnum
+ syn keyword cConstant CumBslcHydroEnum
++syn keyword cConstant CumBslcOceanEnum
+ syn keyword cConstant CumBslcIcePartitionEnum
+ syn keyword cConstant CumBslcHydroPartitionEnum
++syn keyword cConstant CumBslcOceanPartitionEnum
+ syn keyword cConstant CumGmtslcEnum
+ syn keyword cConstant CumGmslcEnum
+ syn keyword cConstant DamageC1Enum
+@@ -289,6 +291,7 @@
+ syn keyword cConstant MeshElementtypeEnum
+ syn keyword cConstant MeshNumberoflayersEnum
+ syn keyword cConstant MeshNumberofverticesEnum
++syn keyword cConstant MeshNumberofelementsEnum
+ syn keyword cConstant MigrationMaxEnum
+ syn keyword cConstant ModelIdEnum
+ syn keyword cConstant NbinsEnum
+@@ -337,7 +340,9 @@
+ syn keyword cConstant SaveResultsEnum
+ syn keyword cConstant SolidearthPartitionIceEnum
+ syn keyword cConstant SolidearthPartitionHydroEnum
++syn keyword cConstant SolidearthPartitionOceanEnum
+ syn keyword cConstant SolidearthNpartIceEnum
++syn keyword cConstant SolidearthNpartOceanEnum
+ syn keyword cConstant SolidearthNpartHydroEnum
+ syn keyword cConstant SolidearthPlanetRadiusEnum
+ syn keyword cConstant SolidearthPlanetAreaEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26098)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26099)
+@@ -106,8 +106,10 @@
+ 	CumBslcEnum,
+ 	CumBslcIceEnum,
+ 	CumBslcHydroEnum,
++	CumBslcOceanEnum,
+ 	CumBslcIcePartitionEnum,
+ 	CumBslcHydroPartitionEnum,
++	CumBslcOceanPartitionEnum,
+ 	CumGmtslcEnum,
+ 	CumGmslcEnum,
+ 	DamageC1Enum,
+@@ -283,6 +285,7 @@
+ 	MeshElementtypeEnum,
+ 	MeshNumberoflayersEnum,
+ 	MeshNumberofverticesEnum,
++	MeshNumberofelementsEnum,
+ 	MigrationMaxEnum,
+ 	ModelIdEnum,
+ 	NbinsEnum,
+@@ -331,7 +334,9 @@
+ 	SaveResultsEnum,
+ 	SolidearthPartitionIceEnum,
+ 	SolidearthPartitionHydroEnum,
++	SolidearthPartitionOceanEnum,
+ 	SolidearthNpartIceEnum,
++	SolidearthNpartOceanEnum,
+ 	SolidearthNpartHydroEnum,
+ 	SolidearthPlanetRadiusEnum,
+ 	SolidearthPlanetAreaEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26099)
+@@ -114,8 +114,10 @@
+ 		case CumBslcEnum : return "CumBslc";
+ 		case CumBslcIceEnum : return "CumBslcIce";
+ 		case CumBslcHydroEnum : return "CumBslcHydro";
++		case CumBslcOceanEnum : return "CumBslcOcean";
+ 		case CumBslcIcePartitionEnum : return "CumBslcIcePartition";
+ 		case CumBslcHydroPartitionEnum : return "CumBslcHydroPartition";
++		case CumBslcOceanPartitionEnum : return "CumBslcOceanPartition";
+ 		case CumGmtslcEnum : return "CumGmtslc";
+ 		case CumGmslcEnum : return "CumGmslc";
+ 		case DamageC1Enum : return "DamageC1";
+@@ -291,6 +293,7 @@
+ 		case MeshElementtypeEnum : return "MeshElementtype";
+ 		case MeshNumberoflayersEnum : return "MeshNumberoflayers";
+ 		case MeshNumberofverticesEnum : return "MeshNumberofvertices";
++		case MeshNumberofelementsEnum : return "MeshNumberofelements";
+ 		case MigrationMaxEnum : return "MigrationMax";
+ 		case ModelIdEnum : return "ModelId";
+ 		case NbinsEnum : return "Nbins";
+@@ -339,7 +342,9 @@
+ 		case SaveResultsEnum : return "SaveResults";
+ 		case SolidearthPartitionIceEnum : return "SolidearthPartitionIce";
+ 		case SolidearthPartitionHydroEnum : return "SolidearthPartitionHydro";
++		case SolidearthPartitionOceanEnum : return "SolidearthPartitionOcean";
+ 		case SolidearthNpartIceEnum : return "SolidearthNpartIce";
++		case SolidearthNpartOceanEnum : return "SolidearthNpartOcean";
+ 		case SolidearthNpartHydroEnum : return "SolidearthNpartHydro";
+ 		case SolidearthPlanetRadiusEnum : return "SolidearthPlanetRadius";
+ 		case SolidearthPlanetAreaEnum : return "SolidearthPlanetArea";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26098)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26099)
+@@ -114,8 +114,10 @@
+ 	      else if (strcmp(name,"CumBslc")==0) return CumBslcEnum;
+ 	      else if (strcmp(name,"CumBslcIce")==0) return CumBslcIceEnum;
+ 	      else if (strcmp(name,"CumBslcHydro")==0) return CumBslcHydroEnum;
++	      else if (strcmp(name,"CumBslcOcean")==0) return CumBslcOceanEnum;
+ 	      else if (strcmp(name,"CumBslcIcePartition")==0) return CumBslcIcePartitionEnum;
+ 	      else if (strcmp(name,"CumBslcHydroPartition")==0) return CumBslcHydroPartitionEnum;
++	      else if (strcmp(name,"CumBslcOceanPartition")==0) return CumBslcOceanPartitionEnum;
+ 	      else if (strcmp(name,"CumGmtslc")==0) return CumGmtslcEnum;
+ 	      else if (strcmp(name,"CumGmslc")==0) return CumGmslcEnum;
+ 	      else if (strcmp(name,"DamageC1")==0) return DamageC1Enum;
+@@ -134,12 +136,12 @@
+ 	      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;
+-	      else if (strcmp(name,"DomainType")==0) return DomainTypeEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"DslModel")==0) return DslModelEnum;
++	      if (strcmp(name,"DomainDimension")==0) return DomainDimensionEnum;
++	      else if (strcmp(name,"DomainType")==0) return DomainTypeEnum;
++	      else if (strcmp(name,"DslModel")==0) return DslModelEnum;
+ 	      else if (strcmp(name,"DslModelid")==0) return DslModelidEnum;
+ 	      else if (strcmp(name,"DslNummodels")==0) return DslNummodelsEnum;
+ 	      else if (strcmp(name,"SolidearthIsExternal")==0) return SolidearthIsExternalEnum;
+@@ -257,12 +259,12 @@
+ 	      else if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
+ 	      else if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
+ 	      else if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
+-	      else if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
+-	      else if (strcmp(name,"LoveG0")==0) return LoveG0Enum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
++	      if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
++	      else if (strcmp(name,"LoveG0")==0) return LoveG0Enum;
++	      else if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
+ 	      else if (strcmp(name,"LoveMu0")==0) return LoveMu0Enum;
+ 	      else if (strcmp(name,"LoveNfreq")==0) return LoveNfreqEnum;
+ 	      else if (strcmp(name,"LoveR0")==0) return LoveR0Enum;
+@@ -297,6 +299,7 @@
+ 	      else if (strcmp(name,"MeshElementtype")==0) return MeshElementtypeEnum;
+ 	      else if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum;
+ 	      else if (strcmp(name,"MeshNumberofvertices")==0) return MeshNumberofverticesEnum;
++	      else if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum;
+ 	      else if (strcmp(name,"MigrationMax")==0) return MigrationMaxEnum;
+ 	      else if (strcmp(name,"ModelId")==0) return ModelIdEnum;
+ 	      else if (strcmp(name,"Nbins")==0) return NbinsEnum;
+@@ -345,7 +348,9 @@
+ 	      else if (strcmp(name,"SaveResults")==0) return SaveResultsEnum;
+ 	      else if (strcmp(name,"SolidearthPartitionIce")==0) return SolidearthPartitionIceEnum;
+ 	      else if (strcmp(name,"SolidearthPartitionHydro")==0) return SolidearthPartitionHydroEnum;
++	      else if (strcmp(name,"SolidearthPartitionOcean")==0) return SolidearthPartitionOceanEnum;
+ 	      else if (strcmp(name,"SolidearthNpartIce")==0) return SolidearthNpartIceEnum;
++	      else if (strcmp(name,"SolidearthNpartOcean")==0) return SolidearthNpartOceanEnum;
+ 	      else if (strcmp(name,"SolidearthNpartHydro")==0) return SolidearthNpartHydroEnum;
+ 	      else if (strcmp(name,"SolidearthPlanetRadius")==0) return SolidearthPlanetRadiusEnum;
+ 	      else if (strcmp(name,"SolidearthPlanetArea")==0) return SolidearthPlanetAreaEnum;
+@@ -377,15 +382,15 @@
+ 	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+-	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+ 	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+ 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+ 	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
++	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+ 	      else if (strcmp(name,"SettingsCheckpointFrequency")==0) return SettingsCheckpointFrequencyEnum;
+ 	      else if (strcmp(name,"SettingsResultsOnNodes")==0) return SettingsResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsSbCouplingFrequency")==0) return SettingsSbCouplingFrequencyEnum;
+@@ -500,15 +505,15 @@
+ 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+ 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+ 	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+-	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+ 	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+ 	      else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum;
+ 	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
++	      else if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
+ 	      else if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum;
+ 	      else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
+@@ -623,15 +628,15 @@
+ 	      else if (strcmp(name,"EplHeadSubstep")==0) return EplHeadSubstepEnum;
+ 	      else if (strcmp(name,"EplHeadTransient")==0) return EplHeadTransientEnum;
+ 	      else if (strcmp(name,"EsaEmotion")==0) return EsaEmotionEnum;
+-	      else if (strcmp(name,"EsaNmotion")==0) return EsaNmotionEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      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 stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"EsaUmotion")==0) return EsaUmotionEnum;
++	      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;
+@@ -746,15 +751,15 @@
+ 	      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,"Sample")==0) return SampleEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"Sample")==0) return SampleEnum;
+ 	      else if (strcmp(name,"SamplingBeta")==0) return SamplingBetaEnum;
+ 	      else if (strcmp(name,"SamplingKappa")==0) return SamplingKappaEnum;
+ 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticMask")==0) return SealevelBarystaticMaskEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
++	      else if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
+ 	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
+ 	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
+ 	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
+@@ -869,15 +874,15 @@
+ 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+ 	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
+ 	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
+-	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      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 stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbTemperaturesReconstructed")==0) return SmbTemperaturesReconstructedEnum;
++	      else if (strcmp(name,"SmbTemperaturesReconstructed")==0) return SmbTemperaturesReconstructedEnum;
+ 	      else if (strcmp(name,"SmbTini")==0) return SmbTiniEnum;
+ 	      else if (strcmp(name,"SmbTmean")==0) return SmbTmeanEnum;
+ 	      else if (strcmp(name,"SmbTz")==0) return SmbTzEnum;
+@@ -992,15 +997,15 @@
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+ 	      else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
+ 	      else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
+-	      else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
+ 	      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 if (strcmp(name,"Outputdefinition39")==0) return Outputdefinition39Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
++	      else if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
+ 	      else if (strcmp(name,"Outputdefinition40")==0) return Outputdefinition40Enum;
+ 	      else if (strcmp(name,"Outputdefinition41")==0) return Outputdefinition41Enum;
+ 	      else if (strcmp(name,"Outputdefinition42")==0) return Outputdefinition42Enum;
+@@ -1115,15 +1120,15 @@
+ 	      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 stage=10;
++   }
++   if(stage==10){
++	      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=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"ControlInputMins")==0) return ControlInputMinsEnum;
++	      else 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;
+@@ -1238,15 +1243,15 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"LoveAnalysis")==0) return LoveAnalysisEnum;
++	      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;
+@@ -1361,15 +1366,15 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"SSAHOApproximation")==0) return SSAHOApproximationEnum;
+ 	      else if (strcmp(name,"Scaled")==0) return ScaledEnum;
+ 	      else if (strcmp(name,"SealevelAbsolute")==0) return SealevelAbsoluteEnum;
+ 	      else if (strcmp(name,"SealevelEmotion")==0) return SealevelEmotionEnum;
+ 	      else if (strcmp(name,"SealevelInertiaTensorXZ")==0) return SealevelInertiaTensorXZEnum;
+-         else stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"SealevelInertiaTensorYZ")==0) return SealevelInertiaTensorYZEnum;
++	      else if (strcmp(name,"SealevelInertiaTensorYZ")==0) return SealevelInertiaTensorYZEnum;
+ 	      else if (strcmp(name,"SealevelInertiaTensorZZ")==0) return SealevelInertiaTensorZZEnum;
+ 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
+ 	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
+Index: ../trunk-jpl/src/c/shared/Enum/Synchronize.sh
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 26098)
++++ ../trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 26099)
+@@ -16,7 +16,7 @@
+ NUMENUMS=$(wc -l temp | awk '{printf("%s",$1);}');
+ 
+ #Deal with Analyses
+-if false ; then
++if true ; then
+ #Build EnumToAnalysis.cpp {{{
+ #Header
+ cat <<END > $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
+@@ -38,7 +38,7 @@
+ END
+ #core
+ cat temp | grep [a-zA-Z0-9]Analysis | \
+-	grep -v DefaultAnalysis | grep -v FlaimAnalysis | grep -v SurfaceSlopeAnalysis | grep -v BedSlopeAnalysis | \
++	grep -v DefaultAnalysis | grep -v RecoveryAnalysis | grep -v FlaimAnalysis | grep -v SurfaceSlopeAnalysis | grep -v BedSlopeAnalysis | \
+ 	awk '{print "\t\t#ifdef _HAVE_"toupper(substr($1,1,length($1)-12))"_\n\t\t" "case " $1" : return new " substr($1,1,length($1)-4) "();\n\t\t#endif"}' \
+ 		>> $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
+ 
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26098)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26099)
+@@ -21,6 +21,8 @@
+ 		channelarea         = NaN;
+ 		sealevel            = NaN;
+ 		bottompressure      = NaN;
++		dsl                 = NaN;
++		str                 = NaN;
+ 		sample              = NaN;
+ 	end
+ 	methods
+@@ -38,6 +40,8 @@
+ 			self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1);
+ 			self.sealevel=project3d(md,'vector',self.sealevel,'type','node','layer',1);
+ 			self.bottompressure=project3d(md,'vector',self.bottompressure,'type','node','layer',1);
++			self.dsl=project3d(md,'vector',self.dsl,'type','node','layer',1);
++			self.str=project3d(md,'vector',self.str,'type','node','layer',1);
+ 
+ 			%Lithostatic pressure by default
+ 			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
+@@ -65,7 +69,9 @@
+ 			end
+ 			if ismember('OceantransportAnalysis',analyses) 
+ 				if strcmp(solution,'TransientSolution') & md.transient.isslc & md.transient.isoceantransport,
+-					md = checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
++					md = checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++					md = checkfield(md,'fieldname','initialization.dsl','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
++					md = checkfield(md,'fieldname','initialization.str','NaN',1,'Inf',1,'size',[1 1]);
+ 				end
+ 			end
+ 			if ismember('BalancethicknessAnalysis',analyses) & strcmp(solution,'BalancethicknessSolution'),
+@@ -155,6 +161,9 @@
+ 			fielddisplay(self,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]');
+ 			fielddisplay(self,'channelarea','subglacial water channel area (for GlaDS) [m2]');
+ 			fielddisplay(self,'sample','Realization of a Gaussian random field');
++			fielddisplay(self,'bottompressure','Bottom pressures');
++			fielddisplay(self,'dsl','Dynamic sea level.');
++			fielddisplay(self,'str','Steric sea level.');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+@@ -166,6 +175,8 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','bottompressure','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'fieldname','str','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'fieldname','dsl','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','temperature','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','waterfraction','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','sediment_head','format','DoubleMat','mattype',1);
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 26098)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 26099)
+@@ -14,6 +14,7 @@
+ 		transitions            = {};
+ 		partitionice           = [];
+ 		partitionhydro         = [];
++		partitionocean         = [];
+ 	end
+ 	methods (Static)
+ 		function self = loadobj(self) % {{{
+@@ -54,6 +55,7 @@
+ 			%no partitions requested for barystatic contribution: 
+ 			self.partitionice=[];
+ 			self.partitionhydro=[];
++			self.partitionocean=[];
+ 
+ 			%no external solutions by default: 
+ 			self.external=[];
+@@ -93,6 +95,7 @@
+ 			fielddisplay(self,'requested_outputs','additional outputs requested');
+ 			fielddisplay(self,'partitionice','ice partition vector for barystatic contribution');
+ 			fielddisplay(self,'partitionhydro','hydro partition vector for barystatic contribution');
++			fielddisplay(self,'partitionocean','ocean partition vector for barystatic contribution');
+ 			if isempty(self.external), fielddisplay(self,'external','external solution, of the type solidearthsolution'); end
+ 			self.settings.disp();
+ 			self.lovenumbers.disp();
+@@ -117,12 +120,20 @@
+ 			else
+ 				nparthydro=0;
+ 			end
++			if ~isempty(self.partitionocean),
++				npartocean=max(self.partitionocean)+2;
++			else
++				npartocean=0;
++			end
+ 
++
+ 			
+ 			WriteData(fid,prefix,'object',self,'fieldname','partitionice','mattype',1,'format','DoubleMat');
+ 			WriteData(fid,prefix,'data',npartice,'format','Integer','name','md.solidearth.npartice');
+ 			WriteData(fid,prefix,'object',self,'fieldname','partitionhydro','mattype',1,'format','DoubleMat');
+ 			WriteData(fid,prefix,'data',nparthydro,'format','Integer','name','md.solidearth.nparthydro');
++			WriteData(fid,prefix,'object',self,'fieldname','partitionocean','mattype',1,'format','DoubleMat');
++			WriteData(fid,prefix,'data',npartocean,'format','Integer','name','md.solidearth.npartocean');
+ 			
+ 			self.settings.marshall(prefix,md,fid);
+ 			self.lovenumbers.marshall(prefix,md,fid);
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26098)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26099)
+@@ -4,21 +4,28 @@
+ md=model;
+ md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
+ 
++%Geometry for the bed, arbitrary thickness of 1000: 
++md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++
+ %parameterize solidearth solution:
+ %solidearth loading:  {{{
+-md.masstransport.spcthickness=zeros(md.mesh.numberofelements+1,1);
+-md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.masstransport.spcthickness=[md.geometry.thickness;0];
+ md.dsl.global_average_thermosteric_sea_level=[0;0];
+ md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+ md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ %antarctica
+ late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+ longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ pos=find(late < -80);
+-md.masstransport.spcthickness(pos)=-100;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+ %greenland
+ pos=find(late>70 & late<80 & longe>-60 & longe<-30);
+-md.masstransport.spcthickness(pos)=-100;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+@@ -34,20 +41,16 @@
+ md.mask.ice_levelset=icemask;
+ md.mask.ocean_levelset=-icemask;
+ 
+-%make sure that the elements that have loads are fully grounded:
+-pos=find(md.masstransport.spcthickness);
+-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+ 
+ %make sure wherever there is an ice load, that the mask is set to ice:
+-pos=find(md.masstransport.spcthickness);
++pos=find(md.masstransport.spcthickness(1:end-1));
+ md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+ % }}}
+ 
+-%Geometry for the bed, arbitrary: 
+-md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+-md.geometry.thickness=zeros(md.mesh.numberofvertices,1);
+-md.geometry.surface=zeros(md.mesh.numberofvertices,1);
+-md.geometry.base=zeros(md.mesh.numberofvertices,1);
++%time stepping: 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=1;
+ 
+ 
+ md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+@@ -54,6 +57,10 @@
+ md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+ md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
++md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
+ 
+ %Materials: 
+ md.materials=materials('hydro');
+@@ -75,7 +82,9 @@
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
++md.transient.isoceantransport=1;
+ md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel'};
+ 
+ 
+ % max number of iteration reverted back to 10 (i.e., the original default value)
+@@ -99,6 +108,7 @@
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
++md.solidearth.requested_outputs={'Sealevel'};
+ md=solve(md,'tr');
+ Selastic=md.results.TransientSolution.Sealevel;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26099-26100.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26099-26100.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26099-26100.diff	(revision 26740)
@@ -0,0 +1,72 @@
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26099)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26100)
+@@ -4,19 +4,27 @@
+ md=model;
+ md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',1000.); %1000 km resolution mesh
+ 
++%Geometry for the bed, arbitrary thickness of 1000: 
++md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++
+ %parameterize slc solution:
+ %solidearth loading:  {{{
+-md.masstransport.spcthickness=zeros(md.mesh.numberofelements,1);
++md.masstransport.spcthickness=[md.geometry.thickness;0];
+ md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+ md.dsl.global_average_thermosteric_sea_level=[0;0];
+ md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+ md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 
+ %antarctica
+ late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+ longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ pos=find(late <-75 & longe <0);
+-md.masstransport.spcthickness(pos)=-1;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-1;
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+@@ -44,17 +52,12 @@
+ % use model representation of ocen area (not the true area)
+ md.solidearth.settings.ocean_area_scaling = 0;
+ 
+-%geometry
+-di=md.materials.rho_ice/md.materials.rho_water;
+-md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+-md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+-md.geometry.base=md.geometry.surface-md.geometry.thickness;
+-md.geometry.bed=md.geometry.base;
+-
+ %materials
+ md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+-md.materials.rheology_B=paterson(md.initialization.temperature);
+-md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
++md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
+ 
+ md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+@@ -77,9 +80,15 @@
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
++md.transient.isoceantransport=1;
+ md.transient.isslc=1;
+ 
++ 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=1;
+ 
++
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26100-26101.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26100-26101.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26100-26101.diff	(revision 26740)
@@ -0,0 +1,176 @@
+Index: ../trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp	(revision 26100)
++++ ../trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp	(revision 26101)
+@@ -43,113 +43,58 @@
+ 
+ void GiaDeflectionCorex( IssmDouble* pwi, IssmDouble* pdwidt, GiaDeflectionCoreArgs* arguments){
+ 
+-	/*intermediary: */
+-	int i;
+-
+-	/*output: */
+-	IssmDouble wi=0;
+-	IssmDouble dwidt=0;
+-
+-	/*inputs: {{{*/
+-	/*constant: */
+-	int idisk=1; // disk #
+-	IssmDouble yts;
+-
+-	/*coming from the model structure, runtime configurable:*/
+-	/*gia solution parameters: */
+-	int iedge=0; 
+-
+-	/*gia inputs: */
+-	IssmDouble ri; //radial distance from center of disk to vertex  i
+-	IssmDouble re; //radius of disk
+-	IssmDouble* hes; //loading history (in ice thickness)
+-	IssmDouble* times; //loading history times
+-	int numtimes; //loading history length
+-	IssmDouble currenttime;
+-	int Ntime; // number of times with load history 
+-	int Ntimm; // Ntime-1 : for slope/y-cept of load segments 
+-	int Ntimp; // Ntime+1 : for evaluation time  
+-	IssmDouble* blockt_time=NULL;
+-	IssmDouble* blockt_bi=NULL;
+-	IssmDouble* blockt_dmi=NULL;
+-	IssmDouble* blocky_zhload=NULL;
+-
+-	/*gia material parameters: */
+-	IssmDouble lithosphere_shear_modulus;
+-	IssmDouble lithosphere_density;
+-	IssmDouble mantle_shear_modulus;
+-	IssmDouble mantle_viscosity;
+-	IssmDouble mantle_density;
+-	IssmDouble lithosphere_thickness;
+-
+-	/*ice properties: */
+-	IssmDouble rho_ice;
+-
+-	/*some debug info: */
+-	int disk_id;
+-
+-/*}}}*/
+-
+ 	/*Recover material parameters and loading history: see GiaDeflectionCoreArgs for more details {{{*/
+-	ri                        = arguments->ri;
+-	re                        = arguments->re;
+-	hes                       = arguments->hes;
+-	times                     = arguments->times;
+-	numtimes                  = arguments->numtimes;
+-	currenttime               = arguments->currenttime;
+-	lithosphere_shear_modulus = arguments->lithosphere_shear_modulus;
+-	lithosphere_density       = arguments->lithosphere_density;
+-	mantle_shear_modulus      = arguments->mantle_shear_modulus;
+-	mantle_viscosity          = arguments->mantle_viscosity;
+-	mantle_density            = arguments->mantle_density;
+-	lithosphere_thickness     = arguments->lithosphere_thickness;
+-	rho_ice                   = arguments->rho_ice;
+-	disk_id                   = arguments->idisk;
+-	iedge                     = arguments->iedge;
+-	yts                       = arguments->yts;
++	IssmDouble  ri                        = arguments->ri;                        //radial distance from center of disk to vertex i
++	IssmDouble  re                        = arguments->re;                        //radius of disk
++	IssmDouble *hes                       = arguments->hes;                       //loading history (in ice thickness)
++	IssmDouble *times                     = arguments->times;                     //loading history times
++	int         numtimes                  = arguments->numtimes;                  //loading history length
++	IssmDouble  currenttime               = arguments->currenttime;
++	IssmDouble  lithosphere_shear_modulus = arguments->lithosphere_shear_modulus;
++	IssmDouble  lithosphere_density       = arguments->lithosphere_density;
++	IssmDouble  mantle_shear_modulus      = arguments->mantle_shear_modulus;
++	IssmDouble  mantle_viscosity          = arguments->mantle_viscosity;
++	IssmDouble  mantle_density            = arguments->mantle_density;
++	IssmDouble  lithosphere_thickness     = arguments->lithosphere_thickness;
++	IssmDouble  rho_ice                   = arguments->rho_ice;
++	int         disk_id                   = arguments->idisk;
++	int         iedge                     = arguments->iedge;
++	IssmDouble  yts                       = arguments->yts;
+ 
+ 	/*}}}*/
+ 
+ 	/*Modify inputs to match naruse code: */
+-	Ntime=numtimes;
+-	Ntimm=Ntime-1;
+-	Ntimp=Ntime+1;
++	int Ntime=numtimes; // number of times with load history
++	int Ntimm=Ntime-1; // Ntime-1 : for slope/y-cept of load segments
++	int Ntimp=Ntime+1; // Ntime+1 : for evaluation time
+ 
+ 	/*Prepare block inputs for fortran distme and what0 routines of the naruse code: {{{*/
+ 	/*Now, let's set pset from the data that we got in input to GiaDeflectionCorex: */
+-	blockp_.pset[0]=lithosphere_thickness;
+-	blockp_.pset[1]=mantle_viscosity;
+-	blockp_.pset[2]=lithosphere_shear_modulus;
+-	blockp_.pset[3]=mantle_shear_modulus;
+-	blockp_.pset[4]=lithosphere_density;
+-	blockp_.pset[5]=mantle_density;
+-	blockp_.pset[6]=re;
+-	blocko_.rhoi=rho_ice; 
++	blockp_.pset[0]=reCast<IssmPDouble>(lithosphere_thickness);
++	blockp_.pset[1]=reCast<IssmPDouble>(mantle_viscosity);
++	blockp_.pset[2]=reCast<IssmPDouble>(lithosphere_shear_modulus);
++	blockp_.pset[3]=reCast<IssmPDouble>(mantle_shear_modulus);
++	blockp_.pset[4]=reCast<IssmPDouble>(lithosphere_density);
++	blockp_.pset[5]=reCast<IssmPDouble>(mantle_density);
++	blockp_.pset[6]=reCast<IssmPDouble>(re);
++	blocko_.rhoi=reCast<IssmPDouble>(rho_ice); 
++   blockrad_.distrad=reCast<IssmPDouble>(ri)/1000.0; // in km
+ 
+ 	/*loading history: */
+-	blocky_zhload=xNew<IssmDouble>(Ntime);
+-	for(i=0;i<Ntime;i++){
+-	blocky_zhload[i]=hes[i];
+-	}
++	IssmPDouble* blocky_zhload=xNew<IssmPDouble>(Ntime);
++	for(int i=0;i<Ntime;i++) blocky_zhload[i]=reCast<IssmPDouble>(hes[i]);
+ 
+ 	/*times in kyr: */
+-	blockt_time=xNew<IssmDouble>(Ntimp);
+-	for (i=0;i<Ntimp;i++){
++	IssmPDouble* blockt_time=xNew<IssmPDouble>(Ntimp);
++	for(int i=0;i<Ntimp;i++){
+ 		blockt_time[i]=times[i]/1000.0/yts; 
+-		if(i==numtimes-1)blockt_time[i]=times[numtimes-1]/1000.0/yts; // final loading time, same as evaluation time
+-		if(i==numtimes)blockt_time[i]=times[numtimes-1]/1000.0/yts;   // evaluation time
++		if(i==numtimes-1) blockt_time[i]=reCast<IssmPDouble>(times[numtimes-1])/1000.0/yts; // final loading time, same as evaluation time
++		if(i==numtimes)   blockt_time[i]=reCast<IssmPDouble>(times[numtimes-1])/1000.0/yts;   // evaluation time
+ 	}
+ 
+-	/*bi: */
+-	blockt_bi=xNew<IssmDouble>(Ntimm);
++	IssmPDouble* blockt_bi=xNew<IssmPDouble>(Ntimm);
++	IssmPDouble* blockt_dmi=xNew<IssmPDouble>(Ntimm);
+ 
+-	/*dmi: */
+-	blockt_dmi=xNew<IssmDouble>(Ntimm);
+-
+-	/*radial distance of i-th element: */
+-	blockrad_.distrad=ri/1000.0; // in km
+-	/*}}}*/
+-
+ 	/*Call distme driver: */
+ 	distme_(&Ntime,&Ntimp,&Ntimm,blockt_time,blockt_bi,blockt_dmi,blocky_zhload); 
+ 
+@@ -157,15 +102,13 @@
+ 	what0_(&iedge,&Ntimp,&Ntimm,blockt_time,blockt_bi,blockt_dmi); 
+ 
+ 	/*output solution: */
+-	wi = blocks_.aswokm_w;
+-	dwidt = blocks_.aswokm_dwdt;
+-	*pwi=wi;
+-	*pdwidt=dwidt;
++	*pwi=reCast<IssmDouble>(blocks_.aswokm_w);
++	*pdwidt=reCast<IssmDouble>(blocks_.aswokm_dwdt);
+ 
+ 	/*Free ressources: */
+-	xDelete<IssmDouble>(blockt_time);
+-	xDelete<IssmDouble>(blockt_bi);
+-	xDelete<IssmDouble>(blockt_dmi);
+-	xDelete<IssmDouble>(blocky_zhload);
++	xDelete<IssmPDouble>(blockt_time);
++	xDelete<IssmPDouble>(blockt_bi);
++	xDelete<IssmPDouble>(blockt_dmi);
++	xDelete<IssmPDouble>(blocky_zhload);
+ 
+ }
Index: /issm/oecreview/Archive/25834-26739/ISSM-26101-26102.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26101-26102.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26101-26102.diff	(revision 26740)
@@ -0,0 +1,130 @@
+Index: ../trunk-jpl/jenkins/linux64_caladan_ad
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan_ad	(revision 26101)
++++ ../trunk-jpl/jenkins/linux64_caladan_ad	(revision 26102)
+@@ -13,7 +13,7 @@
+ 	--prefix=$ISSM_DIR \
+ 	--without-kriging \
+ 	--without-kml \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+ 	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
+ 	--with-matlab-dir=$MATLAB_PATH \
+Index: ../trunk-jpl/jenkins/linux64_caladan_ampi
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 26101)
++++ ../trunk-jpl/jenkins/linux64_caladan_ampi	(revision 26102)
+@@ -12,7 +12,7 @@
+ 	--disable-static \
+ 	--without-kriging \
+ 	--without-kml \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+ 	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
+ 	--with-ampi-dir=$ISSM_DIR/externalpackages/adjoinablempi/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26101)
++++ ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26102)
+@@ -12,7 +12,7 @@
+ 	--with-numthreads=4 \
+ 	--without-kriging \
+ 	--without-kml \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-Love \
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff	(revision 26101)
++++ ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampioff	(revision 26102)
+@@ -11,7 +11,7 @@
+ 	--with-numthreads=4 \
+ 	--without-kriging \
+ 	--without-kml \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-Love \
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/usr \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion	(revision 26101)
++++ ../trunk-jpl/jenkins/ross-debian_linux-adolc-ampion	(revision 26102)
+@@ -11,7 +11,7 @@
+ 	--with-numthreads=4 \
+ 	--without-kriging \
+ 	--without-kml \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-Love \
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/usr \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-codipack
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 26101)
++++ ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 26102)
+@@ -11,7 +11,7 @@
+ 	--with-numthreads=4 \
+ 	--without-kriging \
+ 	--without-kml \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-Love \
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-fortran-lib="-L/usr/lib/x86_64-linux-gnu -lgfortran" \
+Index: ../trunk-jpl/jenkins/ross-debian_linux-javascript
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-javascript	(revision 26101)
++++ ../trunk-jpl/jenkins/ross-debian_linux-javascript	(revision 26102)
+@@ -9,7 +9,7 @@
+ 	--enable-debugging \
+ 	--with-javascript \
+ 	--without-fortran \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-Love \
+ 	--without-kml \
+ 	--without-kriging \
+Index: ../trunk-jpl/jenkins/windows
+===================================================================
+--- ../trunk-jpl/jenkins/windows	(revision 26101)
++++ ../trunk-jpl/jenkins/windows	(revision 26102)
+@@ -13,7 +13,7 @@
+ 	--disable-static \
+ 	--enable-standalone-libraries \
+ 	--with-fortran=no  \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-Love \
+ 	--without-kriging \
+ 	--without-kml \
+Index: ../trunk-jpl/jenkins/windows-par
+===================================================================
+--- ../trunk-jpl/jenkins/windows-par	(revision 26101)
++++ ../trunk-jpl/jenkins/windows-par	(revision 26102)
+@@ -12,7 +12,7 @@
+    --disable-static \
+ 	--enable-standalone-libraries \
+ 	--with-fortran=no  \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-kriging \
+ 	--without-kml \
+ 	--with-matlab-dir=$MATLAB_PATH \
+Index: ../trunk-jpl/jenkins/windows_static
+===================================================================
+--- ../trunk-jpl/jenkins/windows_static	(revision 26101)
++++ ../trunk-jpl/jenkins/windows_static	(revision 26102)
+@@ -14,7 +14,7 @@
+ 	--with-matlab-dir=$MATLAB_PATH \
+ 	--with-vendor=MSVC-Win64 \
+ 	--with-fortran=no \
+-	--without-Gia \
++	--without-Sealevelchange \
+ 	--without-Love \
+ 	--without-kriging \
+ 	--without-kml \
Index: /issm/oecreview/Archive/25834-26739/ISSM-26102-26103.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26102-26103.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26102-26103.diff	(revision 26740)
@@ -0,0 +1,62 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26102)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26103)
+@@ -1285,6 +1285,26 @@
+ 	_error_("Could not find 2 vertices on surface");
+ }
+ /*}}}*/
++void       Tria::ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, bool spherical){/*{{{*/
++
++	/*Look for x,y,z coordinates:*/
++	IssmDouble xyz_list[NUMVERTICES][3];
++	::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
++
++	/*Find centroid:*/
++	IssmDouble xe=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
++	IssmDouble ye=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
++	IssmDouble ze=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
++
++	if(!spherical){
++		vxe->SetValue(this->sid,xe,INS_VAL);
++		vye->SetValue(this->sid,ye,INS_VAL);
++		vze->SetValue(this->sid,ze,INS_VAL);
++	}
++	else _error_("spherical coordinates not supported yet!");
++	return;
++}
++/*}}}*/
+ void       Tria::ElementResponse(IssmDouble* presponse,int response_enum){/*{{{*/
+ 
+ 	switch(response_enum){
+@@ -6218,30 +6238,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void    Tria::ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, bool spherical){/*{{{*/
+ 
+-	/*Look for x,y,z coordinates:*/
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble xe,ye,ze;
+-
+-	/*Element XYZ list*/
+-	::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
+-
+-	/*Find centroid:*/
+-	xe=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+-	ye=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+-	ze=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
+-
+-	if(!spherical){
+-		vxe->SetValue(this->sid,xe,INS_VAL);
+-		vye->SetValue(this->sid,ye,INS_VAL);
+-		vze->SetValue(this->sid,ze,INS_VAL);
+-	}
+-	else _error_("spherical coordinates not supported yet!");
+-	return;
+-}
+-/*}}}*/
+-
+ //new logic 
+ void    Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26103-26104.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26103-26104.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26103-26104.diff	(revision 26740)
@@ -0,0 +1,82 @@
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 26103)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 26104)
+@@ -57,11 +57,13 @@
+ void sampling_core(FemModel* femmodel);
+ 
+ /*sealevel change cores:*/
++#ifdef _HAVE_SEALEVELCHANGE_
+ void sealevelchange_core(FemModel* femmodel);
++void sealevelchange_geometry(FemModel* femmodel);
++#endif
+ void grd_core(FemModel* femmodel);
+ void solidearthexternal_core(FemModel* femmodel);
+ void dynstr_core(FemModel* femmodel);
+-void sealevelchange_geometry(FemModel* femmodel);
+ SealevelMasks* sealevel_masks(FemModel* femmodel);
+ Vector<IssmDouble>* sealevelchange_core_barystatic(FemModel* femmodel,SealevelMasks* mask, IssmDouble* poceanarea);
+ Vector<IssmDouble>* sealevelchange_core_sal(FemModel* femmodel,SealevelMasks* masks, Vector<IssmDouble>* RSLg_barystatic,IssmDouble oceanarea);
+@@ -69,7 +71,6 @@
+ void couplerinput_core(FemModel* femmodel);
+ void coupleroutput_core(FemModel* femmodel);
+ 
+-
+ //optimization
+ int GradJSearch(IssmDouble* search_vector,FemModel* femmodel,int step);
+ IssmDouble objectivefunction(IssmDouble search_scalar,FemModel* femmodel);
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26103)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26104)
+@@ -23,7 +23,7 @@
+ 
+ 	/*parameters: */
+ 	IssmDouble finaltime,dt,yts;
+-	bool       isoceancoupling,iscontrol,isautodiff,isslc;
++	bool       isoceancoupling,iscontrol,isautodiff;
+ 	int        timestepping;
+ 	int        output_frequency,checkpoint_frequency;
+ 	int        amr_frequency,amr_restart;
+@@ -44,7 +44,6 @@
+ 	femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	femmodel->parameters->FindParam(&output_frequency,SettingsOutputFrequencyEnum);
+ 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
+-	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
+ 	femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
+ 	femmodel->parameters->FindParam(&iscontrol,InversionIscontrolEnum);
+@@ -230,7 +229,13 @@
+ 	if(isesa) esa_core(femmodel);
+ 
+ 	/*Sea level change: */
+-	if(isslc) sealevelchange_core(femmodel);
++	if(isslc){
++		#ifdef _HAVE_SEALEVELCHANGE_
++		sealevelchange_core(femmodel);
++		#else
++		_error_("Compiled with SeaLevelChange capability");
++		#endif
++	}
+ 
+ 	/*Sampling: */
+ 	if(issampling){
+@@ -257,7 +262,7 @@
+ 	/*parameters: */
+ 	IssmDouble output_value;
+ 	IssmDouble finaltime,dt,yts,time;
+-	bool       isoceancoupling,isslc;
++	bool       isoceancoupling;
+ 	int        step,timestepping;
+ 	int        checkpoint_frequency;
+ 
+@@ -270,9 +275,7 @@
+ 	femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+ 	femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
+-	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
+ 	femmodel->parameters->FindParam(&checkpoint_frequency,SettingsCheckpointFrequencyEnum); _assert_(checkpoint_frequency>0);
+-	if(isslc) sealevelchange_geometry(femmodel);
+ 
+ 	std::vector<IssmDouble> time_all;
+ 	std::vector<IssmDouble> dt_all;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26104-26105.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26104-26105.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26104-26105.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26104)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26105)
+@@ -20,7 +20,7 @@
+ #include "../Inputs/DatasetInput.h"
+ #include "../Inputs/TransientInput.h"
+ #include "../../shared/shared.h"
+-#ifdef _HAVE_GIA_
++#ifdef _HAVE_SEALEVELCHANGE_
+ #include "../../modules/GiaDeflectionCorex/GiaDeflectionCorex.h"
+ #endif
+ /*}}}*/
+@@ -6220,11 +6220,7 @@
+ 		arguments.ri=ri;
+ 
+ 		/*for this Tria, compute contribution to rebound at vertex i: */
+-		#ifdef _HAVE_GIA_
+ 		GiaDeflectionCorex(&wi,&dwidt,&arguments);
+-		#else
+-		_error_("ISSM compiled without GIA capabilities");
+-		#endif
+ 
+ 		/*plug value into solution vector: */
+ 		wg->SetValue(i,wi,ADD_VAL);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26105-26106.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26105-26106.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26105-26106.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26105)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26106)
+@@ -451,6 +451,9 @@
+ 		xDelete<IssmDouble>(yy);
+ 		xDelete<IssmDouble>(zz);
+ 	}
++	xDelete<IssmDouble>(xxe);
++	xDelete<IssmDouble>(yye);
++	xDelete<IssmDouble>(zze);
+ 	xDelete<IssmDouble>(latitude);
+ 	xDelete<IssmDouble>(longitude);
+ 	xDelete<IssmDouble>(radius);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26106-26107.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26106-26107.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26106-26107.diff	(revision 26740)
@@ -0,0 +1,46 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26106)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26107)
+@@ -5599,7 +5599,7 @@
+ 
+ 	/*elastic green function:*/
+ 	int index;
+-	int         M;
++	int M,Mtest;
+ 
+ 	/*Computational flags:*/
+ 	bool computerigid = false;
+@@ -5624,6 +5624,7 @@
+ 	/*recover precomputed green function kernels:*/
+ 	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
+ 	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
++	_assert_(M>0);
+ 
+ 	/*allocate indices:*/
+ 	indices=xNew<IssmDouble>(gsize);
+@@ -5631,13 +5632,13 @@
+ 
+ 	if(computeelastic){
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
++		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&Mtest); _assert_(Mtest==M);
+ 
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&M);
++		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&Mtest); _assert_(Mtest==M);
+ 
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
++		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&Mtest); _assert_(Mtest==M);
+ 
+ 		GU=xNewZeroInit<IssmDouble>(gsize);
+ 		if(horiz){
+@@ -5672,6 +5673,7 @@
+ 		alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+ 		indices[i]=alpha/M_PI*reCast<IssmDouble,int>(M-1);
+ 		index=reCast<int,IssmDouble>(indices[i]);
++		_assert_(index>=0); _assert_(index<M);
+ 
+ 		/*Rigid earth gravitational perturbation: */
+ 		G[i]+=G_rigid_precomputed[index];
Index: /issm/oecreview/Archive/25834-26739/ISSM-26107-26108.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26107-26108.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26107-26108.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26107)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26108)
+@@ -91,5 +91,5 @@
+ # generated on macOS).
+ # - Excluding 2006 until it can be debugged (PETSc crash)
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2005 2006 2010 2021 2101]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2005 2006 2010 2021 2101"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2005 2006 2010 2021 2101]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2005 2006 2010 2021 2101"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26108-26109.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26108-26109.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26108-26109.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26108)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26109)
+@@ -219,7 +219,7 @@
+ 	int  grd=0;
+ 
+ 	/*Verbose: */
+-	if(VerboseSolution()) _printf0_("	  computing GRD sea level patterns\n");
++	if(VerboseSolution()) _printf0_("	  computing GRD patterns\n");
+ 	
+ 	/*retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+@@ -386,6 +386,12 @@
+ //Geometry:
+ SealevelMasks* sealevel_masks(FemModel* femmodel) {  /*{{{*/
+ 
++	int grdmodel=0; 
++
++	/*early return?:*/
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	if(grdmodel==IvinsEnum) return NULL;
++
+ 	if(VerboseSolution()) _printf0_("	  computing sea level masks\n");
+ 	
+ 	/*initialize SealevelMasks structure: */
+@@ -418,11 +424,16 @@
+ 	int  horiz;
+ 	bool geometrydone = false;
+ 	bool optim=false;
++	int  grdmodel=0;
+ 
+ 		
+ 	/*retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	femmodel->parameters->FindParam(&geometrydone,SealevelchangeGeometryDoneEnum);
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	
++	/*early return?:*/
++	if(grdmodel==IvinsEnum) return;
+ 
+ 	if(geometrydone){
+ 		if(VerboseSolution()) _printf0_("	  geometrical offsets have already been computed, skipping \n");
Index: /issm/oecreview/Archive/25834-26739/ISSM-26109-26110.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26109-26110.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26109-26110.diff	(revision 26740)
@@ -0,0 +1,1438 @@
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h	(revision 26110)
+@@ -51,6 +51,7 @@
+ 		virtual void PointwiseDivide(IssmAbsVec* x,IssmAbsVec* y)=0;
+ 		virtual void PointwiseMult(IssmAbsVec* x,IssmAbsVec* y)=0;
+ 		virtual void Pow(doubletype scale_factor)=0;
++		virtual void Sum(doubletype* pvalue)=0;
+ };
+ 
+ #endif //#ifndef _ISSM_ABS_VEC_H_
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 26110)
+@@ -593,6 +593,10 @@
+ 
+ 		}
+ 		/*}}}*/
++		void Sum(doubletype* pvalue){/*{{{*/
++			_error_("not support yet!");
++		}
++		/*}}}*/
+ 		void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){/*{{{*/
+ 
+ 			/*intermediary: */
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmVec.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmVec.h	(revision 26110)
+@@ -219,6 +219,10 @@
+ 			vector->Pow(scale_factor);
+ 		}
+ 		/*}}}*/
++		void Sum(doubletype*  pvalue){/*{{{*/
++			vector->Sum(pvalue);
++		}
++		/*}}}*/
+ };
+ 
+ #endif //#ifndef _ISSMVEC_H_
+Index: ../trunk-jpl/src/c/toolkits/objects/Vector.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 26110)
+@@ -405,5 +405,16 @@
+ 			else this->ivector->Pow(scale_factor);
+ 		}
+ 		/*}}}*/
+-};
++void Sum(doubletype* pvalue){ /*{{{*/
++	_assert_(this);/*{{{*/
++
++	if(type==PetscVecType){
++		#ifdef _HAVE_PETSC_
++		this->pvector->Sum(pvalue);
++		#endif
++	}
++	else this->ivector->Sum(pvalue);
++}
++/*}}}*/
++}; /*}}}*/
+ #endif //#ifndef _VECTOR_H_
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h	(revision 26110)
+@@ -57,6 +57,7 @@
+ 		IssmDouble  Max(void);
+ 		void        Scale(IssmDouble scale_factor);
+ 		void        Pow(IssmDouble scale_factor);
++		void        Sum(IssmDouble* pvalue);
+ 		void        PointwiseDivide(PetscVec* x,PetscVec* y);
+ 		void        PointwiseMult(PetscVec* x,PetscVec* y);
+ 		IssmDouble  Dot(PetscVec* vector);
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26109)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26110)
+@@ -96,6 +96,7 @@
+ 	./classes/Vertex.cpp \
+ 	./classes/Hook.cpp \
+ 	./classes/Radar.cpp \
++	./classes/BarystaticContributions.cpp \
+ 	./classes/ExternalResults/Results.cpp \
+ 	./classes/Elements/Element.cpp \
+ 	./classes/Elements/Elements.cpp \
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26109)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26110)
+@@ -182,7 +182,9 @@
+ 		parameters->AddObject(new DoubleMatParam(CumBslcOceanPartitionEnum,bslcocean_partition,npartocean,1));
+ 		xDelete<IssmDouble>(partitionocean);
+ 	}
+-
++	/*New optimized code:*/
++	BarystaticContributions* barystaticcontributions=new BarystaticContributions(iomodel);
++	parameters->AddObject(new GenericParam<BarystaticContributions*>(barystaticcontributions,BarystaticContributionsEnum));
+ 	
+ 	/*Deal with external multi-model ensembles: {{{*/
+ 	if(isexternal){
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26110)
+@@ -0,0 +1,149 @@
++/*!\file BarystaticContributions.c
++ * \brief: implementation of the BarystaticContributions object
++ */
++
++/*Include files: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./BarystaticContributions.h" 
++#include "../toolkits/toolkits.h"
++#include "./classes.h"
++/*}}}*/
++
++/*Constructors and destructors:*/
++BarystaticContributions::BarystaticContributions(IoModel* iomodel ){ /*{{{*/
++
++	int nel;
++
++	iomodel->FetchData(&nice,"md.solidearth.npartice");
++	if(nice){
++		iomodel->FetchData(&pice,&nel,NULL,"md.solidearth.partitionice");
++		ice=new Vector<IssmDouble>(nice);
++		cumice=new Vector<IssmDouble>(nice); cumice->Set(0); cumice->Assemble();
++	}
++
++	iomodel->FetchData(&nhydro,"md.solidearth.nparthydro");
++	if(nhydro){
++		iomodel->FetchData(&phydro,&nel,NULL,"md.solidearth.partitionhydro");
++		hydro=new Vector<IssmDouble>(nhydro);
++		cumhydro=new Vector<IssmDouble>(nhydro); cumhydro->Set(0); cumhydro->Assemble();
++	}
++	iomodel->FetchData(&nocean,"md.solidearth.npartocean");
++	if(nocean){
++		iomodel->FetchData(&pocean,&nel,NULL,"md.solidearth.partitionocean");
++		ocean=new Vector<IssmDouble>(nocean);
++		cumocean=new Vector<IssmDouble>(nocean); cumocean->Set(0); cumocean->Assemble();
++	}
++
++} /*}}}*/
++BarystaticContributions::~BarystaticContributions(){ /*{{{*/
++	delete ice;   delete cumice;
++	delete hydro; delete cumhydro;
++	delete ocean; delete cumocean;
++	if(nice)xDelete<IssmDouble>(pice);
++	if(nhydro)xDelete<IssmDouble>(phydro);
++	if(nocean)xDelete<IssmDouble>(pocean);
++}; /*}}}*/
++
++/*Support routines:*/
++IssmDouble BarystaticContributions::Total(){ /*{{{*/
++
++	IssmDouble  sumice,sumhydro,sumocean;
++	
++	ice->Assemble();
++	hydro->Assemble();
++	ocean->Assemble();
++
++	ice->Sum(&sumice);
++	hydro->Sum(&sumhydro);
++	ocean->Sum(&sumocean);
++
++	return sumice+sumhydro+sumocean;
++
++} /*}}}*/
++IssmDouble BarystaticContributions::CumTotal(){ /*{{{*/
++
++	IssmDouble sumice,sumhydro,sumocean;
++
++	cumice->Assemble();
++	cumhydro->Assemble();
++	cumocean->Assemble();
++
++	cumice->Sum(&sumice);
++	cumhydro->Sum(&sumhydro);
++	cumocean->Sum(&sumocean);
++
++
++	return sumice+sumhydro+sumocean;
++
++} /*}}}*/
++void BarystaticContributions::Cumulate(Parameters* parameters){ /*{{{*/
++
++	cumice->AXPY(ice,1);
++	cumocean->AXPY(ocean,1);
++	cumhydro->AXPY(hydro,1);
++
++
++} /*}}}*/
++void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/
++
++	int        step;
++	IssmDouble time;
++	IssmDouble rho_water;
++
++	IssmDouble* cumice_serial=NULL;
++	IssmDouble* cumhydro_serial=NULL;
++	IssmDouble* cumocean_serial=NULL;
++
++	IssmDouble sumice,sumhydro,sumocean;
++
++	parameters->FindParam(&step,StepEnum);
++	parameters->FindParam(&time,TimeEnum);
++	parameters->FindParam(&rho_water,TimeEnum);
++
++	ice->Sum(&sumice); hydro->Sum(&sumhydro); ocean->Sum(&sumocean);
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcEnum,-this->Total()/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcIceEnum,-sumice/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcHydroEnum,-sumice/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcOceanEnum,-sumocean/oceanarea/rho_water,step,time));
++
++	cumice->Sum(&sumice); cumhydro->Sum(&sumhydro); cumocean->Sum(&sumocean);
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcEnum,this->CumTotal()/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcIceEnum,sumice/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcHydroEnum,sumhydro/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcOceanEnum,sumocean/oceanarea/rho_water,step,time));
++
++	cumice_serial=this->cumice->ToMPISerial0(); for (int i=0;i<nice;i++)cumice_serial[i]=cumice_serial[i]/oceanarea/rho_water;
++	cumhydro_serial=this->cumhydro->ToMPISerial0(); for (int i=0;i<nhydro;i++)cumhydro_serial[i]=cumhydro_serial[i]/oceanarea/rho_water;
++	cumocean_serial=this->cumocean->ToMPISerial0(); for (int i=0;i<nocean;i++)cumocean_serial[i]=cumocean_serial[i]/oceanarea/rho_water;
++	
++	results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcIcePartitionEnum,cumice_serial,nice,1,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcHydroPartitionEnum,cumhydro_serial,nhydro,1,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcOceanPartitionEnum,cumocean_serial,nocean,1,step,time));
++
++	if(IssmComm::GetRank()==0){
++		xDelete<IssmDouble>(cumice_serial);
++		xDelete<IssmDouble>(cumhydro_serial);
++		xDelete<IssmDouble>(cumocean_serial);
++	}
++	return;
++
++} /*}}}*/
++void BarystaticContributions::Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue){ /*{{{*/
++	
++	int id;
++		
++	id=reCast<int>(pice[eid]);
++	ice->SetValue(id,icevalue,ADD_VAL);
++
++	id=reCast<int>(phydro[eid]);
++	hydro->SetValue(id,hydrovalue,ADD_VAL);
++
++	id=reCast<int>(pocean[eid]);
++	ocean->SetValue(id,oceanvalue,ADD_VAL);
++
++} /*}}}*/
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.h	(nonexistent)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26110)
+@@ -0,0 +1,46 @@
++/*!\file BarystaticContributions.h
++ * \brief: header file for barystatic contribution object
++ */
++
++#ifndef _BARYSTATICCONTRIBUTIONS_H_
++#define _BARYSTATICCONTRIBUTIONS_H_
++
++/*Headers:*/
++class IoModel;
++class Parameters;
++class Results;
++template <class doubletype> class Vector;
++#include "../shared/shared.h"
++
++class BarystaticContributions {
++
++	public: 
++
++		Vector<IssmDouble>* ice;  //contributions to every ice partition
++		Vector<IssmDouble>* cumice;  //cumulated contributions to every ice partition
++		int                 nice; //number of ice partitions 
++		IssmDouble*         pice; //ice partition
++
++		Vector<IssmDouble>* hydro;  //contributions to every hydro partition
++		Vector<IssmDouble>* cumhydro;  //cumulated contributions to every hydro partition
++		int                 nhydro; //number of hydro partitions 
++		IssmDouble*         phydro; //hydro partition
++
++		Vector<IssmDouble>* ocean;  //contributions to every ocean partition
++		Vector<IssmDouble>* cumocean;  //cumulated contributions to every ocean partition
++		int                 nocean; //number of ocean partitions 
++		IssmDouble*         pocean; //ocean partition
++
++		/*BarystaticContributions constructors, destructors :*/
++		BarystaticContributions(IoModel* iomodel );
++		~BarystaticContributions();
++
++		/*routines:*/
++		IssmDouble Total();
++		IssmDouble CumTotal();
++		void Cumulate(Parameters* parameters);
++		void Save(Results* results, Parameters* parameters, IssmDouble oceanarea);
++		void Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue);
++
++};
++#endif  /* _BARYSTATICCONTRIBUTIONS_H_ */
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26109)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26110)
+@@ -37,6 +37,7 @@
+ template <class doubletype> class Vector;
+ class ElementMatrix;
+ class ElementVector;
++class BarystaticContributions;
+ /*}}}*/
+ 
+ class Element: public Object{
+@@ -388,6 +389,12 @@
+ 		virtual void          SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0;
+ 		virtual void          DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
+ 		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
++
++		virtual void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze)=0;
++		virtual void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks)=0;
++		virtual void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks)=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26109)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26110)
+@@ -226,6 +226,12 @@
+ 		void    SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
+ 		#endif
+ 
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26109)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26110)
+@@ -181,6 +181,13 @@
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26109)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26110)
+@@ -188,6 +188,12 @@
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26109)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26110)
+@@ -5431,6 +5431,7 @@
+ /*}}}*/
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
++//old code
+ IssmDouble Tria::OceanAverage(IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+ 
+ 	if(masks->isoceanin[this->lid]){
+@@ -5450,7 +5451,7 @@
+ 
+ }
+ /*}}}*/
+-void	Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
++void	      Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
+ 	/*early return if we are not on an ice cap OR ocean:*/
+ 	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){
+ 		dI_list[0] = 0.0; // this is important!!!
+@@ -5544,7 +5545,7 @@
+ 
+ 	return;
+ }/*}}}*/
+-void    Tria::SetSealevelMasks(SealevelMasks* masks){ /*{{{*/
++void       Tria::SetSealevelMasks(SealevelMasks* masks){ /*{{{*/
+ 
+ 	masks->isiceonly[this->lid]=this->IsIceOnlyInElement();
+ 	masks->isoceanin[this->lid]=this->IsOceanInElement();
+@@ -5557,10 +5558,9 @@
+ 	/*are we not fully grounded: */
+ 	if ((gr_input->GetInputMin())<0) masks->notfullygrounded[this->lid]=true;
+ 	else masks->notfullygrounded[this->lid]=false;
+-
+ }
+ /*}}}*/
+-void    Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
++void       Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize;
+@@ -5950,7 +5950,7 @@
+ 	return bslchydro;
+ }
+ /*}}}*/
+-void    Tria::SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize;
+@@ -6000,7 +6000,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void    Tria::SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize,dummy;
+@@ -6042,7 +6042,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void    Tria::DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
++void       Tria::DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int gsize;
+@@ -6131,7 +6131,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void    Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
++void       Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
+ 
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+@@ -6237,8 +6237,8 @@
+ }
+ /*}}}*/
+ 
+-//new logic 
+-void    Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
++//new code 
++void       Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int nel;
+@@ -6427,7 +6427,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void    Tria::SealevelchangeBarystaticLoads(IssmDouble* barystatic_contribution,IssmDouble* localloads, SealevelMasks* masks, Matrix<IssmDouble>* barystatic_contribution_onpartition, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
++void       Tria::SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	IssmDouble area;
+@@ -6435,7 +6435,6 @@
+ 	IssmDouble phi_water=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+ 	IssmDouble I,W,BP;  //change in ice thickness, water column or bottom pressure (Farrel and Clarke, Equ. 4)
+ 	bool notfullygrounded=false;
+-	bool scaleoceanarea= false;
+ 	bool computerigid= false;
+ 	int  glfraction=1;
+ 	int  npartice,nparthydro,npartocean;
+@@ -6468,9 +6467,6 @@
+ 		#ifdef _ISSM_DEBUG_
+ 			constant=0; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 		#endif
+-		/*barystatic_contribution[0]+=0;
+-		barystatic_contribution[1]+=0;
+-		barystatic_contribution[2]+=0;*/
+ 		return;
+ 		}
+ 	}
+@@ -6482,9 +6478,6 @@
+ 			#ifdef _ISSM_DEBUG_
+ 			this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+ 			#endif
+-			/*barystatic_contribution[0]+=0;
+-			barystatic_contribution[1]+=0;
+-			barystatic_contribution[2]+=0;*/
+ 			return;
+ 		}
+ 	}
+@@ -6493,9 +6486,6 @@
+ 	 * hydrology:*/
+ 	if(!isice  && !ishydro){
+ 		if(!masks->isoceanin[this->lid]){
+-			/*barystatic_contribution[0]+=0;
+-			barystatic_contribution[1]+=0;
+-			barystatic_contribution[2]+=0;*/
+ 			return;
+ 		}
+ 
+@@ -6508,7 +6498,6 @@
+ 	rho_ice=FindParam(MaterialsRhoIceEnum);
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+-	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+ 	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+ 	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
+@@ -6517,9 +6506,9 @@
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Deal with ice loads if we are on grounded ice:*/
+-	if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid]){ /*{{{*/
++	if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid]){ 
+ 
+-		/*Compute fraction of the element that is grounded: */
++		/*Compute fraction of the element that is grounded: {{{*/
+ 		if(notfullygrounded){
+ 			IssmDouble xyz_list[NUMVERTICES][3];
+ 			::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+@@ -6531,6 +6520,7 @@
+ #endif
+ 		}
+ 		else phi_ice=1.0;
++		/*}}}*/
+ 
+ 		/*Inform mask: */
+ 		constant+=100; //1 for ice.
+@@ -6568,15 +6558,13 @@
+ 		}
+ 		/*}}}*/
+ 
+-		/*Compute barystatic contribution:*/
+-		_assert_(oceanarea>0.);
+-		if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-		bslcice = rho_ice*area*I/(oceanarea*rho_water);
++		/*Compute barystatic contribution in kg:*/
++		bslcice = rho_ice*area*I;
+ 		_assert_(!xIsNan<IssmDouble>(bslcice));
+ 
+ 		/*Transfer thickness change into kg/m^2:*/
+ 		I=I*rho_ice*phi_ice; 
+-	} /*}}}*/
++	} 
+ 
+ 	/*Deal with water loads if we are on ground:*/
+ 	if(!masks->isfullyfloating[this->lid]){
+@@ -6586,10 +6574,8 @@
+ 		if (!deltathickness_input)_error_("DeltaTwsEnum input needed to compute sea level change!");
+ 		deltathickness_input->GetInputAverage(&W);
+ 
+-		/*Compute barystatic component:*/
+-		_assert_(oceanarea>0.);
+-		if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-		bslchydro = rho_freshwater*area*phi_water*W/(oceanarea*rho_water);
++		/*Compute barystatic component in kg:*/
++		bslchydro = rho_freshwater*area*phi_water*W;
+ 		_assert_(!xIsNan<IssmDouble>(bslchydro));
+ 
+ 		/*convert from m to kg/m^2:*/
+@@ -6604,8 +6590,8 @@
+ 		if (!bottompressure_change_input)_error_("DeltaBottomPressureEnum pressure input needed to compute sea level change fingerprint!");
+ 		bottompressure_change_input->GetInputAverage(&BP);
+ 		
+-		/*Compute barystatic component:*/
+-		bslcbp = rho_water*area*BP/(oceanarea*rho_water);
++		/*Compute barystatic component in kg:*/
++		bslcbp = rho_water*area*BP;
+ 
+ 		/*convert from m to kg/m^2:*/
+ 		BP=BP*rho_water;
+@@ -6612,28 +6598,19 @@
+ 	}
+ 
+ 	/*Plug all loads into total load vector:*/
+-	localloads[this->lid]+=I+W+BP;
++	loads->SetValue(this->sid,I+W+BP,INS_VAL);
+ 	
+-	/*Plug bslcice into barystatic contribution vector:*/
+-	if(barystatic_contribution_onpartition){
+-		int idi=reCast<int>(partition[this->Sid()])+1;
+-		int idj=0;
+-		idj=0;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslcice,ADD_VAL);
+-		idj=1;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslchydro,ADD_VAL);
+-		idj=2;barystatic_contribution_onpartition->SetValues(1,&idi,1,&idj,&bslcbp,ADD_VAL);
+-	}
++	/*Keep track of barystatic contributions:*/
++	barycontrib->Set(this->Sid(),bslcice,bslchydro,bslcbp);
+ 
+-	barystatic_contribution[0]+=bslcice;
+-	barystatic_contribution[1]+=bslchydro;
+-	barystatic_contribution[2]+=bslcbp;
+-
+ }
+ /*}}}*/
+-IssmDouble Tria::SealevelchangeConvolution(IssmDouble* loads){ /*{{{*/
++void       Tria::SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*sal green function:*/
+ 	IssmDouble* G=NULL;
+-	IssmDouble Sealevel[NUMVERTICES]={0,0,0};
++	IssmDouble SealevelGRD[NUMVERTICES]={0,0,0};
++	IssmDouble oceanaverage,oceanarea=0;
+ 
+ 	bool sal = false;
+ 	int  size;
+@@ -6646,15 +6623,115 @@
+ 		
+ 		for(int i=0;i<NUMVERTICES;i++) {
+ 			for (int e=0;e<nel;e++){
+-				Sealevel[i]+=G[i*nel+e]*loads[e]; 
++				SealevelGRD[i]+=G[i*nel+e]*loads[e]; 
+ 			}
+ 		}
++	}
+ 
+-		this->AddInput(SealevelRSLEnum,Sealevel,P1Enum);
++	/*compute ocean average over element:*/
++	OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks);
++	
++	/*add ocean average in the global sealevelloads vector:*/
++	sealevelloads->SetValue(this->sid,oceanaverage,INS_VAL);
++	oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
++	
++	return;
++} /*}}}*/
++void       Tria::SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){ /*{{{*/
++
++	bool converged=false;
++	IssmDouble SealevelGRD[3]={0,0,0};
++	IssmDouble oceanaverage,oceanarea=0;
++	int nel;
++	bool sal = false;
++	IssmDouble* G=NULL;
++	int size;
++	
++	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++		
++	if(sal){
++		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
++
++		for(int i=0;i<NUMVERTICES;i++) {
++			for (int e=0;e<nel;e++){
++				SealevelGRD[i]+=G[i*nel+e]*(sealevelloads[e]+loads[e]);
++			}
++		}
+ 	}
++	OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks);
++	newsealevelloads->SetValue(this->sid,oceanaverage,INS_VAL);
+ 
+ } /*}}}*/
++void       Tria::OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+ 
++	IssmDouble phi=1.0;
++	bool iscoastline=false;
++	IssmDouble area;
++	IssmDouble Sg_avg=0; //output
++	
++	/*Do we have an ocean?:*/
++	if(!masks->isoceanin[this->lid]){
++		*poceanarea=0;
++		*poceanaverage=0;
++	}
++
++	/*Do we have a coastline?:*/
++	if(!masks->isfullyfloating[this->lid])iscoastline=true;
++
++	if(iscoastline){
++		IssmDouble xyz_list[NUMVERTICES][3];
++		::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++		phi=1.0-this->GetGroundedPortion(&xyz_list[0][0]); 
++	}
++
++	/*Get area of element:*/
++	this->Element::GetInputValue(&area,AreaEnum);
++
++	/*Average over ocean if there is no coastline, area of the ocean 
++	 *is the areaa of the element:*/
++	if(!iscoastline){
++
++		/*Average Sg over vertices:*/
++		for(int i=0;i<NUMVERTICES;i++) Sg_avg+=Sg[i]/NUMVERTICES;
++
++		*poceanaverage=Sg_avg;
++		*poceanarea=area;
++		return;
++	}
++
++	/*Average over  the ocean only if there is a coastline. Area of the 
++	 * ocean will be the fraction times the area of the element:*/
++	area=phi*area;
++   
++	IssmDouble total_weight=0;
++	bool mainlyfloating = true;
++	int         point1;
++	IssmDouble  fraction1,fraction2;
++
++	/*Recover portion of element that is grounded*/
++	this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
++	//!mainlyfloating so that the integration is done on the ocean (and not the grounded) part
++	Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,!mainlyfloating,2); 
++
++	/* Start  looping on the number of gaussian points and average over these gaussian points: */
++	total_weight=0;
++	Sg_avg=0;
++	while(gauss->next()){
++		IssmDouble Sg_gauss=0;
++		TriaRef::GetInputValue(&Sg_gauss, Sg, gauss,P1Enum);
++		Sg_avg+=Sg_gauss*gauss->weight;
++		total_weight+=gauss->weight;
++	}
++	Sg_avg=Sg_avg/total_weight;
++	delete gauss;
++
++	*poceanaverage=Sg_avg;
++	*poceanarea=area;
++	return;
++
++}
++/*}}}*/
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26109)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26110)
+@@ -161,20 +161,22 @@
+ 		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_SEALEVELCHANGE_
++		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
++		void       SealevelchangeGeometry(IssmDouble* lat, IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
++		IssmDouble SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
++		IssmDouble SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
++		void       SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
++		void       SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
++		void       DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
++		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+ 		IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks);
+-		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
+-		void    SetSealevelMasks(SealevelMasks* masks);
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
+-		void    SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
+-
+-		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
+-		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
+-		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
+-		void    SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
+-		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
+-		void    GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+-		void    SealevelchangeBarystaticLoads(IssmDouble* barystatic_contribution,IssmDouble* localloads, SealevelMasks* masks, Matrix<IssmDouble>* barystatic_contribution_onpartition, IssmDouble* partition, IssmDouble oceanarea);
+-		IssmDouble SealevelchangeConvolution(IssmDouble* loads);
++		void       SetSealevelMasks(SealevelMasks* masks);
++		
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks);
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks);
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks);
++		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks);
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26109)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26110)
+@@ -4748,164 +4748,6 @@
+ /*}}}*/
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+-void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition,SealevelMasks* masks) { /*{{{*/
+-
+-	/*serialized vectors:*/
+-	IssmDouble  bslcice       = 0.;
+-	IssmDouble  bslcice_cpu   = 0.;
+-	IssmDouble  bslchydro       = 0.;
+-	IssmDouble  bslchydro_cpu   = 0.;
+-	IssmDouble  area      = 0.;
+-	IssmDouble  oceanarea      = 0.;
+-	IssmDouble  oceanarea_cpu  = 0.;
+-	int bp_compute_fingerprints= 0;
+-	bool isoceantransport=false;
+-
+-	Vector<IssmDouble>* bslcice_partition=NULL;
+-	IssmDouble* bslcice_partition_serial=NULL;
+-	IssmDouble* partitionice=NULL;
+-	int npartice,nel;
+-
+-	Vector<IssmDouble>* bslchydro_partition=NULL;
+-	IssmDouble* bslchydro_partition_serial=NULL;
+-	IssmDouble* partitionhydro=NULL;
+-	bool istws=0;
+-	int nparthydro;
+-		
+-	int npartocean;
+-	Vector<IssmDouble>* bslcocean_partition=NULL;
+-	IssmDouble* bslcocean_partition_serial=NULL;
+-	IssmDouble* partitionocean=NULL;
+-
+-   /*Initialize temporary vector that will be used to sum barystatic components
+-    * on all local elements, prior to assembly:*/
+-	int gsize = this->nodes->NumberOfDofs(GsetEnum);
+-	IssmDouble* RSLgi=xNewZeroInit<IssmDouble>(gsize);
+-	int* indices=xNew<int>(gsize);
+-   for(int i=0;i<gsize;i++) indices[i]=i;
+-
+-	/*First, figure out the area of the ocean, which is needed to compute the barystatic component: */
+-	int i = -1;
+-	for(Object* & object : this->elements->objects){
+-		i +=1;
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->GetInputValue(&area,AreaEnum);
+-		if (masks->isoceanin[i]) oceanarea_cpu += area;
+-	}
+-	ISSM_MPI_Reduce (&oceanarea_cpu,&oceanarea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&oceanarea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(oceanarea>0.);
+-
+-	/*Initialize partition vectors to retrieve barystatic contributions: */
+-	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+-	if(npartice){
+-		this->parameters->FindParam(&partitionice,&nel,NULL,SolidearthPartitionIceEnum);
+-		bslcice_partition= new Vector<IssmDouble>(npartice);
+-	}
+-
+-	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
+-	if(nparthydro){
+-		this->parameters->FindParam(&partitionhydro,&nel,NULL,SolidearthPartitionHydroEnum);
+-		bslchydro_partition= new Vector<IssmDouble>(nparthydro);
+-	}
+-
+-	this->parameters->FindParam(&npartocean,SolidearthNpartOceanEnum);
+-	if(npartocean){
+-		this->parameters->FindParam(&partitionocean,&nel,NULL,SolidearthPartitionOceanEnum);
+-		bslchydro_partition= new Vector<IssmDouble>(npartocean);
+-	}
+-	/*For later:
+-	npartbarystatic=npartice;
+-	if(nparthydro>npartbarystatic)npartbarystatic=nparthydro;
+-	if(npartocean>npartbarystatic)npartbarystatic=npartocean;
+-	bslc_partition=new Matrix(IssmDouble>(npartbarystatic,3);
+-
+-	bslc_cpu[0]=0; bslc_cpu[1]=0; bslc_cpu[2]=0;
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeBarystaticLoads(&bslc_cpu[0], localloads,masks, bslcice_partition,partitionice,oceanarea);
+-	}
+-	MPI Bcast localloads -> loads
+-
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeConvolution(loads);
+-	}
+-	*/
+-
+-
+-
+-
+-
+-	/*Call the barystatic sea level change core for ice : */
+-	bslcice_cpu=0;
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		bslcice_cpu+=element->SealevelchangeBarystaticIce(RSLgi,masks, bslcice_partition,partitionice,oceanarea);
+-	}
+-
+-	/*Call the barystatic sea level change core for hydro: */
+-	bslchydro_cpu=0; //make sure to initialize this, so we have a total barystatic contribution computed at 0.
+-	this->parameters->FindParam(&istws,TransientIshydrologyEnum);
+-	if(istws){
+-		for(int i=0;i<elements->Size();i++){
+-			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-			bslchydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslchydro_partition,partitionhydro,oceanarea);
+-		}
+-	}
+-
+-	/*Call the barystatic sea level change core for bottom pressures: */
+-	this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);
+-	this->parameters->FindParam(&isoceantransport,TransientIsoceantransportEnum);
+-	if(bp_compute_fingerprints && isoceantransport){
+-		for(int i=0;i<elements->Size();i++){
+-			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-			element->SealevelchangeBarystaticBottomPressure(RSLgi,masks);
+-		}
+-	}
+-
+-	/*Plug values once and assemble: */
+-	pRSLgi->SetValues(gsize,indices,RSLgi,ADD_VAL);
+-	pRSLgi->Assemble();
+-
+-	/*Sum all barystatic components from all cpus:*/
+-	ISSM_MPI_Reduce (&bslcice_cpu,&bslcice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&bslcice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(!xIsNan<IssmDouble>(bslcice));
+-
+-	ISSM_MPI_Reduce (&bslchydro_cpu,&bslchydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&bslchydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(!xIsNan<IssmDouble>(bslchydro));
+-
+-	/*Take care of partition vectors:*/
+-	if(bslcice_partition){
+-		bslcice_partition->Assemble();
+-		bslcice_partition_serial=bslcice_partition->ToMPISerial();
+-	}
+-	if(bslchydro_partition){
+-		bslchydro_partition->Assemble();
+-		bslchydro_partition_serial=bslchydro_partition->ToMPISerial();
+-	}
+-
+-
+-	/*Free ressources:*/
+-	xDelete<int>(indices);
+-	xDelete<IssmDouble>(RSLgi);
+-	if(bslchydro_partition)delete bslchydro_partition;
+-	if(bslcice_partition)delete bslcice_partition;
+-	if(partitionhydro)xDelete<IssmDouble>(partitionhydro);
+-	if(partitionice)xDelete<IssmDouble>(partitionice);
+-
+-	/*Assign output pointers:*/
+-	*poceanarea = oceanarea;
+-	*pbslcice  = bslcice;
+-	*pbslchydro  = bslchydro;
+-	*pbslc=bslchydro+bslcice;
+-	*pbslcice_partition=bslcice_partition_serial;
+-	*pbslchydro_partition=bslchydro_partition_serial;
+-
+-}
+-/*}}}*/
+ void FemModel::SealevelchangeSal(Vector<IssmDouble>* pRSLgo, Vector<IssmDouble>* pRSLg_old,  SealevelMasks* masks, bool verboseconvolution){/*{{{*/
+ 
+ 	/*serialized vectors:*/
+Index: ../trunk-jpl/src/c/classes/classes.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/classes.h	(revision 26109)
++++ ../trunk-jpl/src/c/classes/classes.h	(revision 26110)
+@@ -18,6 +18,7 @@
+ #include "./Massfluxatgate.h"
+ #include "./Misfit.h"
+ #include "./SealevelMasks.h"
++#include "./BarystaticContributions.h"
+ #include "./Nodalvalue.h"
+ #include "./Numberedcostfunction.h"
+ #include "./Cfsurfacesquare.h"
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 26109)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 26110)
+@@ -80,10 +80,7 @@
+ void WriteLockFile(char* filename);
+ void ResetBoundaryConditions(FemModel* femmodel, int analysis_type);
+ void PrintBanner(void);
+-void TransferForcing(FemModel* femmodel,int forcingenum);
+-void TransferSealevel(FemModel* femmodel,int forcingenum);
+ void EarthMassTransport(FemModel* femmodel);
+-void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+ 
+ //solution configuration
+ void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype);
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26109)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26110)
+@@ -11,6 +11,12 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
++/*support routines local definitions:{{{*/
++void TransferForcing(FemModel* femmodel,int forcingenum);
++void TransferSealevel(FemModel* femmodel,int forcingenum);
++void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
++IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea);
++/*}}}*/
+ 
+ /*main cores:*/
+ void sealevelchange_core(FemModel* femmodel){ /*{{{*/
+@@ -383,6 +389,107 @@
+ 	}
+ }; /*}}}*/
+ 
++void grd_core_optim(FemModel* femmodel,SealevelMasks* masks) { /*{{{*/
++
++	/*variables:{{{*/
++	int nel;
++	BarystaticContributions* barycontrib=NULL;
++	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
++	IssmDouble               barystatic;
++	
++	Vector<IssmDouble>*    loads=NULL;
++	IssmDouble*            allloads=NULL; 
++	Vector<IssmDouble>*    sealevelloads=NULL;
++	Vector<IssmDouble>*    oldsealevelloads=NULL;
++	IssmDouble             sealevelloadsaverage;
++	IssmDouble*            allsealevelloads=NULL;
++	Vector<IssmDouble>*    oceanareas=NULL;
++	IssmDouble             oceanarea;
++	bool                   scaleoceanarea=false;
++	IssmDouble             rho_water;
++
++	IssmDouble           eps_rel;
++	IssmDouble           eps_abs;
++	int                  step;
++	IssmDouble           time; 
++	
++	IssmDouble cumbslc;
++	IssmDouble cumbslcice;
++	IssmDouble cumbslchydro;
++	/*}}}*/
++
++	/*retrieve parameters: */
++	femmodel->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
++	barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum));
++	barycontrib=barycontribparam->GetParameterValue();
++	femmodel->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
++	femmodel->parameters->FindParam(&eps_rel,SolidearthSettingsReltolEnum);
++	femmodel->parameters->FindParam(&eps_abs,SolidearthSettingsAbstolEnum);
++	
++	/*initialize matrices and vectors:*/
++	femmodel->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++	loads=new Vector<IssmDouble>(nel);
++	sealevelloads=new Vector<IssmDouble>(nel);
++	oceanareas=new Vector<IssmDouble>(nel);
++	
++	/*buildup loads: */
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeBarystaticLoads(loads, barycontrib,masks); 
++	}
++
++	//Communicate loads from local to global: 
++	loads->Assemble(); allloads=loads->ToMPISerial();
++
++	/*convolve loads:*/
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeInitialConvolution(sealevelloads,oceanareas,allloads,masks);
++	}
++
++	//Get ocean area: 
++	oceanareas->Assemble(); oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
++	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
++
++	//Get sea level loads ocean average: 
++	sealevelloadsaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
++	
++	//substract ocean average and barystatic contributionfrom sea level loads: 
++	barystatic=barycontrib->Total()/oceanarea/rho_water;
++	sealevelloads->Shift(-sealevelloadsaverage+barystatic);
++	allsealevelloads=sealevelloads->ToMPISerial();
++
++	bool converged=false;
++	for(;;){
++			
++		oldsealevelloads=sealevelloads->Duplicate();
++
++		/*convolve load and sealevel loads on oceans:*/
++		for(Object* & object : femmodel->elements->objects){
++			Element* element = xDynamicCast<Element*>(object);
++			element->SealevelchangeOceanConvolution(sealevelloads, allsealevelloads, allloads,masks);
++		}
++		sealevelloads->Assemble();
++		
++		//substract ocean average and barystatic contribution
++		sealevelloadsaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
++		sealevelloads->Shift(-sealevelloadsaverage+barystatic);
++
++		//broadcast loads 
++		allsealevelloads=sealevelloads->ToMPISerial();
++
++		//convergence?
++		slcconvergence(&converged,sealevelloads,oldsealevelloads,eps_rel,eps_abs);
++		if (converged)break;
++	}
++
++	/*cumulate barystatic contributions and save to results: */
++	barycontrib->Cumulate(femmodel->parameters);
++	barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
++
++}
++/*}}}*/
++
+ //Geometry:
+ SealevelMasks* sealevel_masks(FemModel* femmodel) {  /*{{{*/
+ 
+@@ -1061,3 +1168,11 @@
+ 	*pconverged=converged;
+ 
+ } /*}}}*/
++IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea){ /*{{{*/
++	IssmDouble sealevelloadsaverage;	
++	Vector<IssmDouble>* sealevelloadsvolume=sealevelloads->Duplicate();
++	sealevelloadsvolume->PointwiseMult(sealevelloads,oceanareas);
++	sealevelloadsvolume->Sum(&sealevelloadsaverage);
++	delete sealevelloadsvolume; 
++	return sealevelloadsaverage/oceanarea;
++} /*}}}*/
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26109)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26110)
+@@ -746,6 +746,7 @@
+ syn keyword cConstant BslcEnum
+ syn keyword cConstant BslcIceEnum
+ syn keyword cConstant BslcHydroEnum
++syn keyword cConstant BslcOceanEnum
+ syn keyword cConstant BslcRateEnum
+ syn keyword cConstant GmtslcEnum
+ syn keyword cConstant SealevelRSLBarystaticEnum
+@@ -1070,6 +1071,7 @@
+ syn keyword cConstant BalancevelocitySolutionEnum
+ syn keyword cConstant BasalforcingsIsmip6Enum
+ syn keyword cConstant BasalforcingsPicoEnum
++syn keyword cConstant BarystaticContributionsEnum
+ syn keyword cConstant BeckmannGoosseFloatingMeltRateEnum
+ syn keyword cConstant BedSlopeSolutionEnum
+ syn keyword cConstant BoolExternalResultEnum
+@@ -1432,6 +1434,7 @@
+ syn keyword cType AmrBamg
+ syn keyword cType AmrNeopz
+ syn keyword cType ArrayInput
++syn keyword cType BarystaticContributions
+ syn keyword cType BoolInput
+ syn keyword cType BoolParam
+ syn keyword cType Cfdragcoeffabsgrad
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26109)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26110)
+@@ -742,6 +742,7 @@
+ 	BslcEnum,
+ 	BslcIceEnum,
+ 	BslcHydroEnum,
++	BslcOceanEnum,
+ 	BslcRateEnum,
+ 	GmtslcEnum,
+ 	SealevelRSLBarystaticEnum,
+@@ -1069,6 +1070,7 @@
+ 	BalancevelocitySolutionEnum,
+ 	BasalforcingsIsmip6Enum,
+ 	BasalforcingsPicoEnum,
++	BarystaticContributionsEnum,
+ 	BeckmannGoosseFloatingMeltRateEnum,
+ 	BedSlopeSolutionEnum,
+ 	BoolExternalResultEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26109)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26110)
+@@ -748,6 +748,7 @@
+ 		case BslcEnum : return "Bslc";
+ 		case BslcIceEnum : return "BslcIce";
+ 		case BslcHydroEnum : return "BslcHydro";
++		case BslcOceanEnum : return "BslcOcean";
+ 		case BslcRateEnum : return "BslcRate";
+ 		case GmtslcEnum : return "Gmtslc";
+ 		case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic";
+@@ -1072,6 +1073,7 @@
+ 		case BalancevelocitySolutionEnum : return "BalancevelocitySolution";
+ 		case BasalforcingsIsmip6Enum : return "BasalforcingsIsmip6";
+ 		case BasalforcingsPicoEnum : return "BasalforcingsPico";
++		case BarystaticContributionsEnum : return "BarystaticContributions";
+ 		case BeckmannGoosseFloatingMeltRateEnum : return "BeckmannGoosseFloatingMeltRate";
+ 		case BedSlopeSolutionEnum : return "BedSlopeSolution";
+ 		case BoolExternalResultEnum : return "BoolExternalResult";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26109)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26110)
+@@ -766,6 +766,7 @@
+ 	      else if (strcmp(name,"Bslc")==0) return BslcEnum;
+ 	      else if (strcmp(name,"BslcIce")==0) return BslcIceEnum;
+ 	      else if (strcmp(name,"BslcHydro")==0) return BslcHydroEnum;
++	      else if (strcmp(name,"BslcOcean")==0) return BslcOceanEnum;
+ 	      else if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
+ 	      else if (strcmp(name,"Gmtslc")==0) return GmtslcEnum;
+ 	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
+@@ -873,11 +874,11 @@
+ 	      else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum;
+ 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+ 	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
+-	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
++	      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;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+ 	      else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
+-	      else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
++	      if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
++	      else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
+ 	      else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum;
+ 	      else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
+ 	      else if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum;
+@@ -1096,6 +1097,7 @@
+ 	      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,"BarystaticContributions")==0) return BarystaticContributionsEnum;
+ 	      else if (strcmp(name,"BeckmannGoosseFloatingMeltRate")==0) return BeckmannGoosseFloatingMeltRateEnum;
+ 	      else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
+ 	      else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
+@@ -1118,12 +1120,12 @@
+ 	      else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum;
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Contour")==0) return ContourEnum;
++	      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;
+@@ -1241,12 +1243,12 @@
+ 	      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 stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
++	      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;
+@@ -1364,12 +1366,12 @@
+ 	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SSAHOApproximation")==0) return SSAHOApproximationEnum;
++	      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;
+ 	      else if (strcmp(name,"SealevelEmotion")==0) return SealevelEmotionEnum;
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26110)
+@@ -323,6 +323,14 @@
+ 
+ 		}
+ 		/*}}}*/
++		void Sum(doubletype* pvalue){/*{{{*/
++
++			doubletype value=0;
++			int i;
++			for(i=0;i<this->M;i++)value+=this->vector[i];
++			*pvalue=value;
++		}
++		/*}}}*/
+ 		
+ };
+ #endif //#ifndef _ISSM_SEQ_VEC_H_
+Index: ../trunk-jpl/src/c/toolkits/objects/Matrix.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 26110)
+@@ -281,6 +281,22 @@
+ 			return output;
+ 		}
+ 		/*}}}*/
++		doubletype* ToMPISerial(void){/*{{{*/
++
++			doubletype* output=NULL;
++
++			if(type==PetscMatType){
++				#ifdef _HAVE_PETSC_
++				output=this->pmatrix->ToMPISerial();
++				#endif
++			}
++			else{
++				_error_("not implemented yet!");
++			}
++
++			return output;
++		}
++		/*}}}*/
+ 		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+@@ -306,10 +322,8 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*
+-		* sets all values to 0 but keeps the structure of a sparse matrix
+-		*/
+ 		void SetZero(void) {/*{{{*/
++			// sets all values to 0 but keeps the structure of a sparse matrix
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+ 				this->pmatrix->SetZero();
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 26110)
+@@ -248,6 +248,13 @@
+ 
+ }
+ /*}}}*/
++void PetscVec::Sum(IssmDouble* pvalue){/*{{{*/
++
++	_assert_(this->vector);
++	VecSum(this->vector,pvalue);
++
++}
++/*}}}*/
+ IssmDouble PetscVec::Dot(PetscVec* input){/*{{{*/
+ 
+ 	IssmDouble dot;
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h	(revision 26109)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h	(revision 26110)
+@@ -31,6 +31,7 @@
+ void PetscOptionsDetermineSolverType(int* psolver_type);
+ void MatMultPatch(Mat A,Vec X, Vec AX,ISSM_MPI_Comm comm);
+ void MatToSerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm);
++void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm);
+ Vec  SerialToVec(double* vector,int vector_size);
+ InsertMode ISSMToPetscInsertMode(InsMode mode);
+ NormType ISSMToPetscNormMode(NormMode mode);
+Index: ../trunk-jpl/test/NightlyRun/test2004.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26109)
++++ ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26110)
+@@ -133,6 +133,10 @@
+ 
+ 		disp('      reading bedrock');
+ 		md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++		md.geometry.base=md.geometry.bed;
++		md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++		md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
+ 	end % }}}
+ 	%Slc: {{{
+ 	if bas.iscontinentany('antarctica'),
+@@ -166,11 +170,11 @@
+ 			md.masstransport.spcthickness=mean(delHAIS(md.mesh.elements),2)/100;
+ 		end
+ 
+-		md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
++		md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+ 
+-		md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+-		md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-		md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++		md.dsl.global_average_thermosteric_sea_level=[0;0];
++		md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++		md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ 
+ 	end %}}}
+ 	% material properties: {{{
+@@ -312,6 +316,9 @@
+ 	%geometry:  {{{
+ 	di=md.materials.rho_ice/md.materials.rho_water;
+ 	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++	md.geometry.base=md.geometry.bed;
++	md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++	md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 	% }}}
+ 	%materials:  {{{
+ 	md.materials=materials('hydro');
+@@ -345,6 +352,9 @@
+ sl.transfer('mask.ice_levelset');
+ sl.transfer('mask.ocean_levelset');
+ sl.transfer('geometry.bed');
++sl.transfer('geometry.surface');
++sl.transfer('geometry.thickness');
++sl.transfer('geometry.base');
+ sl.transfer('mesh.lat');
+ sl.transfer('mesh.long');
+ sl.transfer('masstransport.spcthickness');
+@@ -399,6 +409,16 @@
+ md.transient.ismasstransport=1;
+ md.transient.isslc=1;
+ 
++%Initializations: 
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
++md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 
+ %max number of iterations reverted back to 10 (i.e. the original default value)
+ md.solidearth.settings.maxiter=10;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26110-26111.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26110-26111.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26110-26111.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp	(revision 26111)
+@@ -0,0 +1,32 @@
++/*!\file MatToMPISerial.cpp
++ * \brief gather a Petsc Mat matrix onto all cpus
++ */
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "../petscincludes.h"
++#include "../../../shared/shared.h"
++
++void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm){
++
++	double* outmatrix=NULL;
++
++	/*Call MatToSerial:*/
++	MatToSerial(&outmatrix,matrix,comm);
++
++	/*get matrix size: */
++	MatGetSize(matrix,&M,&N);
++
++	/*Allocate on cpus:*/
++	if (my_rank!=0)outmatrix=xNew<double>(M*N);
++
++	/*Broadcast:*/
++	ISSM_MPI_Bcast(outmatrix,M*N,ISSM_MPI_PDOUBLE,0,comm);
++
++	/*Assign output pointer:*/
++	*poutmatrix=outmatrix;
++}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26111-26112.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26111-26112.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26111-26112.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/toolkits/objects/Matrix.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 26111)
++++ ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 26112)
+@@ -287,7 +287,7 @@
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+-				output=this->pmatrix->ToMPISerial();
++				output=this->pmatrix->ToSerial();
+ 				#endif
+ 			}
+ 			else{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26112-26113.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26112-26113.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26112-26113.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 26112)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 26113)
+@@ -163,7 +163,6 @@
+ 		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_SEALEVELCHANGE_
+-		void SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition, SealevelMasks* masks); 
+ 		void SealevelchangeSal(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
+ 		void SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
+ 		void SealevelchangeDeformation(Vector<IssmDouble>* pgeoid,Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26113-26114.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26113-26114.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26113-26114.diff	(revision 26740)
@@ -0,0 +1,181 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26113)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26114)
+@@ -4748,6 +4748,164 @@
+ /*}}}*/
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
++void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition,SealevelMasks* masks) { /*{{{*/
++
++	/*serialized vectors:*/
++	IssmDouble  bslcice       = 0.;
++	IssmDouble  bslcice_cpu   = 0.;
++	IssmDouble  bslchydro       = 0.;
++	IssmDouble  bslchydro_cpu   = 0.;
++	IssmDouble  area      = 0.;
++	IssmDouble  oceanarea      = 0.;
++	IssmDouble  oceanarea_cpu  = 0.;
++	int bp_compute_fingerprints= 0;
++	bool isoceantransport=false;
++
++	Vector<IssmDouble>* bslcice_partition=NULL;
++	IssmDouble* bslcice_partition_serial=NULL;
++	IssmDouble* partitionice=NULL;
++	int npartice,nel;
++
++	Vector<IssmDouble>* bslchydro_partition=NULL;
++	IssmDouble* bslchydro_partition_serial=NULL;
++	IssmDouble* partitionhydro=NULL;
++	bool istws=0;
++	int nparthydro;
++		
++	int npartocean;
++	Vector<IssmDouble>* bslcocean_partition=NULL;
++	IssmDouble* bslcocean_partition_serial=NULL;
++	IssmDouble* partitionocean=NULL;
++
++   /*Initialize temporary vector that will be used to sum barystatic components
++    * on all local elements, prior to assembly:*/
++	int gsize = this->nodes->NumberOfDofs(GsetEnum);
++	IssmDouble* RSLgi=xNewZeroInit<IssmDouble>(gsize);
++	int* indices=xNew<int>(gsize);
++   for(int i=0;i<gsize;i++) indices[i]=i;
++
++	/*First, figure out the area of the ocean, which is needed to compute the barystatic component: */
++	int i = -1;
++	for(Object* & object : this->elements->objects){
++		i +=1;
++		Element* element = xDynamicCast<Element*>(object);
++		element->GetInputValue(&area,AreaEnum);
++		if (masks->isoceanin[i]) oceanarea_cpu += area;
++	}
++	ISSM_MPI_Reduce (&oceanarea_cpu,&oceanarea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&oceanarea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	_assert_(oceanarea>0.);
++
++	/*Initialize partition vectors to retrieve barystatic contributions: */
++	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
++	if(npartice){
++		this->parameters->FindParam(&partitionice,&nel,NULL,SolidearthPartitionIceEnum);
++		bslcice_partition= new Vector<IssmDouble>(npartice);
++	}
++
++	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
++	if(nparthydro){
++		this->parameters->FindParam(&partitionhydro,&nel,NULL,SolidearthPartitionHydroEnum);
++		bslchydro_partition= new Vector<IssmDouble>(nparthydro);
++	}
++
++	this->parameters->FindParam(&npartocean,SolidearthNpartOceanEnum);
++	if(npartocean){
++		this->parameters->FindParam(&partitionocean,&nel,NULL,SolidearthPartitionOceanEnum);
++		bslchydro_partition= new Vector<IssmDouble>(npartocean);
++	}
++	/*For later:
++	npartbarystatic=npartice;
++	if(nparthydro>npartbarystatic)npartbarystatic=nparthydro;
++	if(npartocean>npartbarystatic)npartbarystatic=npartocean;
++	bslc_partition=new Matrix(IssmDouble>(npartbarystatic,3);
++
++	bslc_cpu[0]=0; bslc_cpu[1]=0; bslc_cpu[2]=0;
++	for(Object* & object : this->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeBarystaticLoads(&bslc_cpu[0], localloads,masks, bslcice_partition,partitionice,oceanarea);
++	}
++	MPI Bcast localloads -> loads
++
++	for(Object* & object : this->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeConvolution(loads);
++	}
++	*/
++
++
++
++
++
++	/*Call the barystatic sea level change core for ice : */
++	bslcice_cpu=0;
++	for(Object* & object : this->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		bslcice_cpu+=element->SealevelchangeBarystaticIce(RSLgi,masks, bslcice_partition,partitionice,oceanarea);
++	}
++
++	/*Call the barystatic sea level change core for hydro: */
++	bslchydro_cpu=0; //make sure to initialize this, so we have a total barystatic contribution computed at 0.
++	this->parameters->FindParam(&istws,TransientIshydrologyEnum);
++	if(istws){
++		for(int i=0;i<elements->Size();i++){
++			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
++			bslchydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslchydro_partition,partitionhydro,oceanarea);
++		}
++	}
++
++	/*Call the barystatic sea level change core for bottom pressures: */
++	this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);
++	this->parameters->FindParam(&isoceantransport,TransientIsoceantransportEnum);
++	if(bp_compute_fingerprints && isoceantransport){
++		for(int i=0;i<elements->Size();i++){
++			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
++			element->SealevelchangeBarystaticBottomPressure(RSLgi,masks);
++		}
++	}
++
++	/*Plug values once and assemble: */
++	pRSLgi->SetValues(gsize,indices,RSLgi,ADD_VAL);
++	pRSLgi->Assemble();
++
++	/*Sum all barystatic components from all cpus:*/
++	ISSM_MPI_Reduce (&bslcice_cpu,&bslcice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&bslcice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	_assert_(!xIsNan<IssmDouble>(bslcice));
++
++	ISSM_MPI_Reduce (&bslchydro_cpu,&bslchydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&bslchydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	_assert_(!xIsNan<IssmDouble>(bslchydro));
++
++	/*Take care of partition vectors:*/
++	if(bslcice_partition){
++		bslcice_partition->Assemble();
++		bslcice_partition_serial=bslcice_partition->ToMPISerial();
++	}
++	if(bslchydro_partition){
++		bslchydro_partition->Assemble();
++		bslchydro_partition_serial=bslchydro_partition->ToMPISerial();
++	}
++
++
++	/*Free ressources:*/
++	xDelete<int>(indices);
++	xDelete<IssmDouble>(RSLgi);
++	if(bslchydro_partition)delete bslchydro_partition;
++	if(bslcice_partition)delete bslcice_partition;
++	if(partitionhydro)xDelete<IssmDouble>(partitionhydro);
++	if(partitionice)xDelete<IssmDouble>(partitionice);
++
++	/*Assign output pointers:*/
++	*poceanarea = oceanarea;
++	*pbslcice  = bslcice;
++	*pbslchydro  = bslchydro;
++	*pbslc=bslchydro+bslcice;
++	*pbslcice_partition=bslcice_partition_serial;
++	*pbslchydro_partition=bslchydro_partition_serial;
++
++}
++/*}}}*/
+ void FemModel::SealevelchangeSal(Vector<IssmDouble>* pRSLgo, Vector<IssmDouble>* pRSLg_old,  SealevelMasks* masks, bool verboseconvolution){/*{{{*/
+ 
+ 	/*serialized vectors:*/
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 26113)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 26114)
+@@ -163,6 +163,7 @@
+ 		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_SEALEVELCHANGE_
++		void SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition, SealevelMasks* masks); 
+ 		void SealevelchangeSal(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
+ 		void SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
+ 		void SealevelchangeDeformation(Vector<IssmDouble>* pgeoid,Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26114-26115.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26114-26115.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26114-26115.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26114)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26115)
+@@ -179,6 +179,15 @@
+ 
+ }
+ /*}}}*/
++IssmDouble* PetscMat::ToMPISerial(void){/*{{{*/
++
++	 IssmDouble* output=NULL;
++sa
++	 MatToMPISerial(&output,this->matrix,IssmComm::GetComm());
++	 return output;
++
++}
++/*}}}*/
+ void PetscMat::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/
+ 
+ 	PetscErrorCode ierr = MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 26114)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 26115)
+@@ -49,6 +49,7 @@
+ 		void MatMult(PetscVec* X,PetscVec* AX);
+ 		PetscMat* Duplicate(void);
+ 		IssmDouble* ToSerial(void);
++		IssmDouble* ToMPISerial(void);
+ 		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
+ 		void Convert(MatrixType type);
+ 		void SetZero(void);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26115-26116.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26115-26116.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26115-26116.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26115)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26116)
+@@ -182,7 +182,7 @@
+ IssmDouble* PetscMat::ToMPISerial(void){/*{{{*/
+ 
+ 	 IssmDouble* output=NULL;
+-sa
++	 
+ 	 MatToMPISerial(&output,this->matrix,IssmComm::GetComm());
+ 	 return output;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26116-26117.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26116-26117.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26116-26117.diff	(revision 26740)
@@ -0,0 +1,316 @@
+Index: ../trunk-jpl/src/c/toolkits/objects/Matrix.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 26116)
++++ ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 26117)
+@@ -265,17 +265,17 @@
+ 			return output;
+ 		}
+ 		/*}}}*/
+-		doubletype* ToSerial(void){/*{{{*/
++		doubletype* ToMPISerial0(void){/*{{{*/
+ 
+ 			doubletype* output=NULL;
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+-				output=this->pmatrix->ToSerial();
++				output=this->pmatrix->ToMPISerial0();
+ 				#endif
+ 			}
+ 			else{
+-				output=this->imatrix->ToSerial();
++				output=this->imatrix->ToMPISerial0();
+ 			}
+ 
+ 			return output;
+@@ -287,7 +287,7 @@
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+-				output=this->pmatrix->ToSerial();
++				output=this->pmatrix->ToMPISerial();
+ 				#endif
+ 			}
+ 			else{
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26116)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 26117)
+@@ -170,20 +170,18 @@
+ 
+ }
+ /*}}}*/
+-IssmDouble* PetscMat::ToSerial(void){/*{{{*/
++IssmDouble* PetscMat::ToMPISerial(void){/*{{{*/
+ 
+ 	 IssmDouble* output=NULL;
+-
+-	 MatToSerial(&output,this->matrix,IssmComm::GetComm());
++	 MatToMPISerial(&output,this->matrix,IssmComm::GetComm(),true);
+ 	 return output;
+ 
+ }
+ /*}}}*/
+-IssmDouble* PetscMat::ToMPISerial(void){/*{{{*/
++IssmDouble* PetscMat::ToMPISerial0(void){/*{{{*/
+ 
+ 	 IssmDouble* output=NULL;
+-	 
+-	 MatToMPISerial(&output,this->matrix,IssmComm::GetComm());
++	 MatToMPISerial(&output,this->matrix,IssmComm::GetComm(),false);
+ 	 return output;
+ 
+ }
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 26116)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h	(revision 26117)
+@@ -48,8 +48,8 @@
+ 		void GetLocalSize(int* pM,int* pN);
+ 		void MatMult(PetscVec* X,PetscVec* AX);
+ 		PetscMat* Duplicate(void);
+-		IssmDouble* ToSerial(void);
+ 		IssmDouble* ToMPISerial(void);
++		IssmDouble* ToMPISerial0(void);
+ 		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
+ 		void Convert(MatrixType type);
+ 		void SetZero(void);
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/MatToSerial.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/MatToSerial.cpp	(revision 26116)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/MatToSerial.cpp	(nonexistent)
+@@ -1,89 +0,0 @@
+-/*!\file MatToSerial.cpp
+- * \brief gather a Petsc Mat matrix onto cpu 0
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "../petscincludes.h"
+-#include "../../../shared/shared.h"
+-
+-void MatToSerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm){
+-
+-	int i;
+-	int my_rank;
+-	int num_procs;
+-
+-	/*Petsc variables*/
+-	PetscInt lower_row,upper_row; 
+-	int range;
+-	int M,N; //size of matrix
+-	ISSM_MPI_Status status;
+-	int* idxm=NULL;
+-	int* idxn=NULL; 
+-	double* local_matrix=NULL; /*matrix local to each node used for temporary holding matrix values*/
+-	int buffer[3];
+-
+-	/*recover my_rank and num_procs:*/
+-	ISSM_MPI_Comm_size(comm,&num_procs);
+-	ISSM_MPI_Comm_rank(comm,&my_rank);
+-
+-	/*Output*/
+-	double* outmatrix=NULL;
+-
+-	/*get matrix size: */
+-	MatGetSize(matrix,&M,&N);
+-
+-	/*partition: */
+-	MatGetOwnershipRange(matrix,&lower_row,&upper_row);    
+-	upper_row--; 
+-	range=upper_row-lower_row+1;
+-
+-	/*Local and global allocation*/
+-	if (my_rank==0)outmatrix=xNew<double>(M*N);
+-
+-	if (range){
+-		local_matrix=xNew<double>(N*range);
+-		idxm=xNew<int>(range);  
+-		idxn=xNew<int>(N);  
+-
+-		for (i=0;i<N;i++){
+-			*(idxn+i)=i;
+-		}
+-		for (i=0;i<range;i++){
+-			*(idxm+i)=lower_row+i;
+-		}
+-
+-		MatGetValues(matrix,range,idxm,N,idxn,local_matrix);     
+-	}
+-
+-	/*Now each node holds its local_matrix containing range rows. 
+-	 * We send these rows to the matrix on node 0*/
+-
+-	for (i=1;i<num_procs;i++){
+-		if (my_rank==i){ 
+-			buffer[0]=my_rank;
+-			buffer[1]=lower_row;
+-			buffer[2]=range;
+-			ISSM_MPI_Send(buffer,3,ISSM_MPI_INT,0,1,comm);   
+-			if (range)ISSM_MPI_Send(local_matrix,N*range,ISSM_MPI_PDOUBLE,0,1,comm); 
+-		}
+-		if (my_rank==0){
+-			ISSM_MPI_Recv(buffer,3,ISSM_MPI_INT,i,1,comm,&status); 
+-			if (buffer[2])ISSM_MPI_Recv(outmatrix+(buffer[1]*N),N*buffer[2],ISSM_MPI_PDOUBLE,i,1,comm,&status);
+-		}
+-	} 
+-	if (my_rank==0){ 
+-		//Still have the local_matrix on node 0 to take care of.
+-		memcpy(outmatrix,local_matrix,N*range*sizeof(double));
+-	} 
+-
+-	/*Assign output pointer: */
+-	*poutmatrix=outmatrix;
+-	xDelete<int>(idxm);
+-	xDelete<int>(idxn);
+-	xDelete<double>(local_matrix);
+-}
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp	(revision 26116)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp	(revision 26117)
+@@ -11,22 +11,86 @@
+ #include "../petscincludes.h"
+ #include "../../../shared/shared.h"
+ 
+-void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm){
++void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm,bool broadcast){
+ 
++	int i;
++	int my_rank;
++	int num_procs;
++
++	/*Petsc variables*/
++	PetscInt lower_row,upper_row; 
++	int range;
++	int M,N; //size of matrix
++	ISSM_MPI_Status status;
++	int* idxm=NULL;
++	int* idxn=NULL; 
++	double* local_matrix=NULL; /*matrix local to each node used for temporary holding matrix values*/
++	int buffer[3];
++
++	/*recover my_rank and num_procs:*/
++	ISSM_MPI_Comm_size(comm,&num_procs);
++	ISSM_MPI_Comm_rank(comm,&my_rank);
++
++	/*Output*/
+ 	double* outmatrix=NULL;
+ 
+-	/*Call MatToSerial:*/
+-	MatToSerial(&outmatrix,matrix,comm);
+-
+ 	/*get matrix size: */
+ 	MatGetSize(matrix,&M,&N);
+ 
+-	/*Allocate on cpus:*/
+-	if (my_rank!=0)outmatrix=xNew<double>(M*N);
++	/*partition: */
++	MatGetOwnershipRange(matrix,&lower_row,&upper_row);    
++	upper_row--; 
++	range=upper_row-lower_row+1;
+ 
+-	/*Broadcast:*/
+-	ISSM_MPI_Bcast(outmatrix,M*N,ISSM_MPI_PDOUBLE,0,comm);
++	/*Local and global allocation*/
++	if(broadcast || my_rank==0){ 
++		outmatrix=xNew<double>(M*N);
++	}
+ 
+-	/*Assign output pointer:*/
++	if (range){
++		local_matrix=xNew<double>(N*range);
++		idxm=xNew<int>(range);  
++		idxn=xNew<int>(N);  
++
++		for (i=0;i<N;i++){
++			*(idxn+i)=i;
++		}
++		for (i=0;i<range;i++){
++			*(idxm+i)=lower_row+i;
++		}
++
++		MatGetValues(matrix,range,idxm,N,idxn,local_matrix);     
++	}
++
++	/*Now each node holds its local_matrix containing range rows. 
++	 * We send these rows to the matrix on node 0*/
++
++	for (i=1;i<num_procs;i++){
++		if (my_rank==i){ 
++			buffer[0]=my_rank;
++			buffer[1]=lower_row;
++			buffer[2]=range;
++			ISSM_MPI_Send(buffer,3,ISSM_MPI_INT,0,1,comm);   
++			if (range)ISSM_MPI_Send(local_matrix,N*range,ISSM_MPI_PDOUBLE,0,1,comm); 
++		}
++		if (my_rank==0){
++			ISSM_MPI_Recv(buffer,3,ISSM_MPI_INT,i,1,comm,&status); 
++			if (buffer[2])ISSM_MPI_Recv(outmatrix+(buffer[1]*N),N*buffer[2],ISSM_MPI_PDOUBLE,i,1,comm,&status);
++		}
++	} 
++	if (my_rank==0){ 
++		//Still have the local_matrix on node 0 to take care of.
++		if (range) memcpy(outmatrix,local_matrix,N*range*sizeof(double));
++	} 
++
++	if(broadcast){
++		/*Broadcast:*/
++		ISSM_MPI_Bcast(outmatrix,M*N,ISSM_MPI_PDOUBLE,0,comm);
++	}
++
++	/*Assign output pointer: */
++	xDelete<int>(idxm);
++	xDelete<int>(idxn);
++	xDelete<double>(local_matrix);
+ 	*poutmatrix=outmatrix;
+ }
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 26116)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 26117)
+@@ -81,7 +81,7 @@
+ 
+ 	if (my_rank==0){ 
+ 		//Still have the local_vector on node 0 to take care of.
+-		if (range)memcpy(gathered_vector+lower_row,local_vector,range*sizeof(double));
++		if (range) memcpy(gathered_vector+lower_row,local_vector,range*sizeof(double));
+ 	}
+ 
+ 	if(broadcast){
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h	(revision 26116)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h	(revision 26117)
+@@ -26,12 +26,10 @@
+ void ISFree(IS* pis);
+ void VecFree(Vec* pvec);
+ void KSPFree(KSP* pksp);
+-int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size ,
+-		double* col_partition_vector,int col_partition_vector_size);
++int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size, double* col_partition_vector,int col_partition_vector_size);
+ void PetscOptionsDetermineSolverType(int* psolver_type);
+ void MatMultPatch(Mat A,Vec X, Vec AX,ISSM_MPI_Comm comm);
+-void MatToSerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm);
+-void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm);
++void MatToMPISerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm,bool broadcast=true);
+ Vec  SerialToVec(double* vector,int vector_size);
+ InsertMode ISSMToPetscInsertMode(InsMode mode);
+ NormType ISSMToPetscNormMode(NormMode mode);
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26116)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26117)
+@@ -372,7 +372,7 @@
+ 	./toolkits/petsc \
+ 	./toolkits/petsc/patches \
+ 	./toolkits/petsc/patches/VecToMPISerial.cpp \
+-	./toolkits/petsc/patches/MatToSerial.cpp \
++	./toolkits/petsc/patches/MatToMPISerial.cpp \
+ 	./toolkits/petsc/patches/NewVec.cpp \
+ 	./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp \
+ 	./toolkits/petsc/patches/NewMat.cpp \
Index: /issm/oecreview/Archive/25834-26739/ISSM-26117-26118.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26117-26118.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26117-26118.diff	(revision 26740)
@@ -0,0 +1,192 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26117)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26118)
+@@ -62,6 +62,7 @@
+ syn keyword cConstant AutodiffTbufsizeEnum
+ syn keyword cConstant AutodiffXpEnum
+ syn keyword cConstant BalancethicknessStabilizationEnum
++syn keyword cConstant BarystaticContributionsEnum
+ syn keyword cConstant BasalforcingsBottomplumedepthEnum
+ syn keyword cConstant BasalforcingsCrustthicknessEnum
+ syn keyword cConstant BasalforcingsDeepwaterElevationEnum
+@@ -1071,7 +1072,6 @@
+ syn keyword cConstant BalancevelocitySolutionEnum
+ syn keyword cConstant BasalforcingsIsmip6Enum
+ syn keyword cConstant BasalforcingsPicoEnum
+-syn keyword cConstant BarystaticContributionsEnum
+ syn keyword cConstant BeckmannGoosseFloatingMeltRateEnum
+ syn keyword cConstant BedSlopeSolutionEnum
+ syn keyword cConstant BoolExternalResultEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26117)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26118)
+@@ -56,6 +56,7 @@
+ 	AutodiffTbufsizeEnum,
+ 	AutodiffXpEnum,
+ 	BalancethicknessStabilizationEnum,
++	BarystaticContributionsEnum,
+ 	BasalforcingsBottomplumedepthEnum,
+ 	BasalforcingsCrustthicknessEnum,
+ 	BasalforcingsDeepwaterElevationEnum,
+@@ -1070,7 +1071,6 @@
+ 	BalancevelocitySolutionEnum,
+ 	BasalforcingsIsmip6Enum,
+ 	BasalforcingsPicoEnum,
+-	BarystaticContributionsEnum,
+ 	BeckmannGoosseFloatingMeltRateEnum,
+ 	BedSlopeSolutionEnum,
+ 	BoolExternalResultEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26117)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26118)
+@@ -64,6 +64,7 @@
+ 		case AutodiffTbufsizeEnum : return "AutodiffTbufsize";
+ 		case AutodiffXpEnum : return "AutodiffXp";
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
++		case BarystaticContributionsEnum : return "BarystaticContributions";
+ 		case BasalforcingsBottomplumedepthEnum : return "BasalforcingsBottomplumedepth";
+ 		case BasalforcingsCrustthicknessEnum : return "BasalforcingsCrustthickness";
+ 		case BasalforcingsDeepwaterElevationEnum : return "BasalforcingsDeepwaterElevation";
+@@ -1073,7 +1074,6 @@
+ 		case BalancevelocitySolutionEnum : return "BalancevelocitySolution";
+ 		case BasalforcingsIsmip6Enum : return "BasalforcingsIsmip6";
+ 		case BasalforcingsPicoEnum : return "BasalforcingsPico";
+-		case BarystaticContributionsEnum : return "BarystaticContributions";
+ 		case BeckmannGoosseFloatingMeltRateEnum : return "BeckmannGoosseFloatingMeltRate";
+ 		case BedSlopeSolutionEnum : return "BedSlopeSolution";
+ 		case BoolExternalResultEnum : return "BoolExternalResult";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26117)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26118)
+@@ -64,6 +64,7 @@
+ 	      else if (strcmp(name,"AutodiffTbufsize")==0) return AutodiffTbufsizeEnum;
+ 	      else if (strcmp(name,"AutodiffXp")==0) return AutodiffXpEnum;
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
++	      else if (strcmp(name,"BarystaticContributions")==0) return BarystaticContributionsEnum;
+ 	      else if (strcmp(name,"BasalforcingsBottomplumedepth")==0) return BasalforcingsBottomplumedepthEnum;
+ 	      else if (strcmp(name,"BasalforcingsCrustthickness")==0) return BasalforcingsCrustthicknessEnum;
+ 	      else if (strcmp(name,"BasalforcingsDeepwaterElevation")==0) return BasalforcingsDeepwaterElevationEnum;
+@@ -135,11 +136,11 @@
+ 	      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 stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"DomainDimension")==0) return DomainDimensionEnum;
++	      if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
++	      else if (strcmp(name,"DomainDimension")==0) return DomainDimensionEnum;
+ 	      else if (strcmp(name,"DomainType")==0) return DomainTypeEnum;
+ 	      else if (strcmp(name,"DslModel")==0) return DslModelEnum;
+ 	      else if (strcmp(name,"DslModelid")==0) return DslModelidEnum;
+@@ -258,11 +259,11 @@
+ 	      else if (strcmp(name,"LevelsetStabilization")==0) return LevelsetStabilizationEnum;
+ 	      else if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
+ 	      else if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
+-	      else if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
++	      if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
++	      else if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
+ 	      else if (strcmp(name,"LoveG0")==0) return LoveG0Enum;
+ 	      else if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
+ 	      else if (strcmp(name,"LoveMu0")==0) return LoveMu0Enum;
+@@ -381,11 +382,11 @@
+ 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+ 	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+-	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
++	      if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
++	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+ 	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+ 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+@@ -504,11 +505,11 @@
+ 	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+ 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+ 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+-	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
++	      if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
++	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+ 	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+ 	      else if (strcmp(name,"TransientIsslc")==0) return TransientIsslcEnum;
+@@ -627,11 +628,11 @@
+ 	      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,"EsaEmotion")==0) return EsaEmotionEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"EsaNmotion")==0) return EsaNmotionEnum;
++	      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;
+@@ -750,11 +751,11 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"Sample")==0) return SampleEnum;
++	      if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
++	      else if (strcmp(name,"Sample")==0) return SampleEnum;
+ 	      else if (strcmp(name,"SamplingBeta")==0) return SamplingBetaEnum;
+ 	      else if (strcmp(name,"SamplingKappa")==0) return SamplingKappaEnum;
+ 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
+@@ -873,11 +874,11 @@
+ 	      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,"SmbSzaValue")==0) return SmbSzaValueEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbT")==0) return SmbTEnum;
++	      if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
++	      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;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum;
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+-	      else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
++	      if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
++	      else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
+ 	      else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
+ 	      else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum;
+ 	      else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
+@@ -1097,7 +1098,6 @@
+ 	      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,"BarystaticContributions")==0) return BarystaticContributionsEnum;
+ 	      else if (strcmp(name,"BeckmannGoosseFloatingMeltRate")==0) return BeckmannGoosseFloatingMeltRateEnum;
+ 	      else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
+ 	      else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26118-26119.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26118-26119.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26118-26119.diff	(revision 26740)
@@ -0,0 +1,182 @@
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 26118)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 26119)
+@@ -62,9 +62,9 @@
+ void sealevelchange_geometry(FemModel* femmodel);
+ #endif
+ void grd_core(FemModel* femmodel);
++void grd_core_optim(FemModel* femmodel);
+ void solidearthexternal_core(FemModel* femmodel);
+ void dynstr_core(FemModel* femmodel);
+-SealevelMasks* sealevel_masks(FemModel* femmodel);
+ Vector<IssmDouble>* sealevelchange_core_barystatic(FemModel* femmodel,SealevelMasks* mask, IssmDouble* poceanarea);
+ Vector<IssmDouble>* sealevelchange_core_sal(FemModel* femmodel,SealevelMasks* masks, Vector<IssmDouble>* RSLg_barystatic,IssmDouble oceanarea);
+ void sealevelchange_core_deformation(Vector<IssmDouble>** pN_radial, Vector<IssmDouble>** pU_radial, Vector<IssmDouble>** pU_north,Vector<IssmDouble>** pU_east,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks);
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26118)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26119)
+@@ -16,6 +16,7 @@
+ void TransferSealevel(FemModel* femmodel,int forcingenum);
+ void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+ IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea);
++SealevelMasks* sealevel_masks(FemModel* femmodel);
+ /*}}}*/
+ 
+ /*main cores:*/
+@@ -389,19 +390,18 @@
+ 	}
+ }; /*}}}*/
+ 
+-void grd_core_optim(FemModel* femmodel,SealevelMasks* masks) { /*{{{*/
++void grd_core_optim(FemModel* femmodel) { /*{{{*/
+ 
+ 	/*variables:{{{*/
+ 	int nel;
+ 	BarystaticContributions* barycontrib=NULL;
++	SealevelMasks* masks=NULL;
+ 	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
+-	IssmDouble               barystatic;
+ 	
+ 	Vector<IssmDouble>*    loads=NULL;
+ 	IssmDouble*            allloads=NULL; 
+ 	Vector<IssmDouble>*    sealevelloads=NULL;
+ 	Vector<IssmDouble>*    oldsealevelloads=NULL;
+-	IssmDouble             sealevelloadsaverage;
+ 	IssmDouble*            allsealevelloads=NULL;
+ 	Vector<IssmDouble>*    oceanareas=NULL;
+ 	IssmDouble             oceanarea;
+@@ -412,13 +412,33 @@
+ 	IssmDouble           eps_abs;
+ 	int                  step;
+ 	IssmDouble           time; 
+-	
+-	IssmDouble cumbslc;
+-	IssmDouble cumbslcice;
+-	IssmDouble cumbslchydro;
++
++	int  modelid,earthid;
++	int  horiz;
++	int  count,frequency,iscoupling;
++	int  grd=0;
+ 	/*}}}*/
+ 
+-	/*retrieve parameters: */
++	/*Verbose: */
++	if(VerboseSolution()) _printf0_("	  computing GRD patterns\n");
++
++	/*retrieve parameters:{{{*/
++	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
++	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
++	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
++	/*}}}*/
++
++	/*only run if grd was requested, if we are the earth, and we have reached
++	 * the necessary number of time steps dictated by :*/
++	if(!grd)            return;
++	if(count!=frequency)return;
++	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
++	if(iscoupling){
++		femmodel->parameters->FindParam(&modelid,ModelIdEnum);
++		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
++		if(modelid!=earthid)return;
++	}
++	/*retrieve parameters: {{{*/ 
+ 	femmodel->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 	barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum));
+ 	barycontrib=barycontribparam->GetParameterValue();
+@@ -425,12 +445,17 @@
+ 	femmodel->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+ 	femmodel->parameters->FindParam(&eps_rel,SolidearthSettingsReltolEnum);
+ 	femmodel->parameters->FindParam(&eps_abs,SolidearthSettingsAbstolEnum);
+-	
++	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++	/*}}}*/
++
+ 	/*initialize matrices and vectors:*/
+ 	femmodel->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	loads=new Vector<IssmDouble>(nel);
+ 	sealevelloads=new Vector<IssmDouble>(nel);
+ 	oceanareas=new Vector<IssmDouble>(nel);
++
++	/*call masks core: */
++	masks=sealevel_masks(femmodel);
+ 	
+ 	/*buildup loads: */
+ 	for(Object* & object : femmodel->elements->objects){
+@@ -438,7 +463,7 @@
+ 		element->SealevelchangeBarystaticLoads(loads, barycontrib,masks); 
+ 	}
+ 
+-	//Communicate loads from local to global: 
++	//broadcast loads 
+ 	loads->Assemble(); allloads=loads->ToMPISerial();
+ 
+ 	/*convolve loads:*/
+@@ -446,17 +471,16 @@
+ 		Element* element = xDynamicCast<Element*>(object);
+ 		element->SealevelchangeInitialConvolution(sealevelloads,oceanareas,allloads,masks);
+ 	}
+-
++	sealevelloads->Assemble();
++	
+ 	//Get ocean area: 
+ 	oceanareas->Assemble(); oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+ 
+-	//Get sea level loads ocean average: 
+-	sealevelloadsaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
++	//substract ocean average and barystatic contributionfrom sea level loads: 
++	sealevelloads->Shift(barycontrib->Total()/oceanarea/rho_water - SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
+ 	
+-	//substract ocean average and barystatic contributionfrom sea level loads: 
+-	barystatic=barycontrib->Total()/oceanarea/rho_water;
+-	sealevelloads->Shift(-sealevelloadsaverage+barystatic);
++	//broadcast sea level loads 
+ 	allsealevelloads=sealevelloads->ToMPISerial();
+ 
+ 	bool converged=false;
+@@ -470,12 +494,12 @@
+ 			element->SealevelchangeOceanConvolution(sealevelloads, allsealevelloads, allloads,masks);
+ 		}
+ 		sealevelloads->Assemble();
++	
+ 		
+ 		//substract ocean average and barystatic contribution
+-		sealevelloadsaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
+-		sealevelloads->Shift(-sealevelloadsaverage+barystatic);
+-
+-		//broadcast loads 
++		sealevelloads->Shift(barycontrib->Total()/oceanarea/rho_water - SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
++		
++		//broadcast sea level loads 
+ 		allsealevelloads=sealevelloads->ToMPISerial();
+ 
+ 		//convergence?
+@@ -483,10 +507,25 @@
+ 		if (converged)break;
+ 	}
+ 
++	/*convolve loads and sea level loads to get the deformation:*/
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		//element->SealevelchangeDeformationConvolution(allsealevelloads, allloads,masks);
++	}
++
++	/*Update bedrock motion and geoid:*/
++	/*inputs->AXPY(SealevelEnum,SealevelGRD,1);
++	inputs->AXPY(BedEnum,BedGRD,1);
++	if(horiz){
++		inputs->AXPY(BedrockeastEnum,BedEastGRD,1);
++		inputs->AXPY(BedrocknorthEnum,BedNorthGRD,1);
++	}*/
++
+ 	/*cumulate barystatic contributions and save to results: */
+ 	barycontrib->Cumulate(femmodel->parameters);
+ 	barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
+ 
++
+ }
+ /*}}}*/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26119-26120.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26119-26120.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26119-26120.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Synchronize.sh
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 26119)
++++ ../trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 26120)
+@@ -16,7 +16,7 @@
+ NUMENUMS=$(wc -l temp | awk '{printf("%s",$1);}');
+ 
+ #Deal with Analyses
+-if true ; then
++if false ; then
+ #Build EnumToAnalysis.cpp {{{
+ #Header
+ cat <<END > $ISSM_DIR/src/c/analyses/EnumToAnalysis.cpp
Index: /issm/oecreview/Archive/25834-26739/ISSM-26120-26121.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26120-26121.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26120-26121.diff	(revision 26740)
@@ -0,0 +1,1430 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/Input.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Input.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Inputs/Input.h	(revision 26121)
+@@ -43,6 +43,7 @@
+ 		//virtual void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("Not implemented yet");};
+ 
+ 		virtual void   AXPY(Input* xinput,IssmDouble scalar){_error_("Not implemented yet");};
++		virtual void   Shift(IssmDouble scalar){_error_("Not implemented yet");};
+ 		virtual void   PointWiseMult(Input* xinput){_error_("Not implemented yet");};
+ 		virtual void   Pow(IssmDouble scale_factor){_error_("Not implemented yet");};
+ 		virtual void   Scale(IssmDouble scale_factor){_error_("Not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.h	(revision 26121)
+@@ -45,7 +45,9 @@
+ 		Inputs* Copy(void);
+ 		int      DeleteInput(int enum_type);
+ 		void     DuplicateInput(int original_enum,int new_enum);
+-		void     AXPY(IssmDouble alpha, int xenum, int yenum, int zenum);
++		void     ZAXPY(IssmDouble alpha, int xenum, int yenum, int zenum);
++		void     AXPY(IssmDouble alpha, int xenum, int yenum);
++		void     Shift(int inputenum, IssmDouble alpha);
+ 		void     DeepEcho(void);
+ 		void     DeepEcho(int enum_in);
+ 		void     Echo(void);
+Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 26121)
+@@ -383,6 +383,13 @@
+ 	for(int i=0;i<TriaRef::NumberofNodes(this->interpolation);i++) this->element_values[i] = alpha*xtriainput->element_values[i] + this->element_values[i];
+ }
+ /*}}}*/
++void TriaInput::Shift(IssmDouble alpha){/*{{{*/
++
++	/*Carry out the shift operation:*/
++	for(int i=0;i<this->M*this->N;i++) this->values[i] +=alpha;
++	for(int i=0;i<TriaRef::NumberofNodes(this->interpolation);i++) this->element_values[i] += alpha;
++}
++/*}}}*/
+ void TriaInput::PointWiseMult(Input* xinput){/*{{{*/
+ 
+ 	/*xinput is of the same type, so cast it: */
+Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TriaInput.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.h	(revision 26121)
+@@ -39,6 +39,7 @@
+ 		void Scale(IssmDouble scalar);
+ 		void Pow(IssmDouble scalar);
+ 		void AXPY(Input* xinput,IssmDouble scalar);
++		void Shift(IssmDouble scalar);
+ 		void PointWiseMult(Input* xinput);
+ 		void Serve(int numindices,int* indices);
+ 		void Serve(int row,int numindices);
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26121)
+@@ -245,13 +245,12 @@
+ 	if(!isgrd)return;
+ 
+ 	/*From old and new thickness, create delta thickness  and accumulate:*/
+-	femmodel->inputs->AXPY(-1, WaterColumnOldEnum,WatercolumnEnum,DeltaTwsEnum);
+-	femmodel->inputs->AXPY(+1, DeltaTwsEnum,AccumulatedDeltaTwsEnum,DummyEnum);
+-	femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaTwsEnum);
++	femmodel->inputs->ZAXPY(-1, WaterColumnOldEnum,WatercolumnEnum,DeltaTwsEnum);
++	femmodel->inputs->AXPY(+1, DeltaTwsEnum,AccumulatedDeltaTwsEnum);
+ 
+ 	/*compute total water column change between two sea-level solver time steps, ie. every frequency*dt:*/
+ 	if(count==frequency){
+-		femmodel->inputs->AXPY(-1, OldAccumulatedDeltaTwsEnum,AccumulatedDeltaTwsEnum,DeltaTwsEnum);
++		femmodel->inputs->ZAXPY(-1, OldAccumulatedDeltaTwsEnum,AccumulatedDeltaTwsEnum,DeltaTwsEnum);
+ 		femmodel->inputs->DuplicateInput(AccumulatedDeltaTwsEnum,OldAccumulatedDeltaTwsEnum);
+ 	}
+ 	return;
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26121)
+@@ -116,9 +116,8 @@
+ 	if(!isgrd)return;
+ 
+ 	/*From old and new thickness, create delta thickness  and accumulate:*/
+-	femmodel->inputs->AXPY(-1, ThicknessOldEnum,ThicknessEnum,DeltaIceThicknessEnum);
+-	femmodel->inputs->AXPY(+1, DeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum,DummyEnum);
+-	femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaIceThicknessEnum);
++	femmodel->inputs->ZAXPY(-1, ThicknessOldEnum,ThicknessEnum,DeltaIceThicknessEnum);
++	femmodel->inputs->AXPY(+1, DeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum);
+ 
+ 	/*for Ivins deformation model, keep history of ice thickness changes inside TransientAccumulatedDeltaIceThicknessEnum:*/
+ 	if(grdmodel==IvinsEnum){
+@@ -153,7 +152,7 @@
+ 
+ 	/*compute total ice thickness change between two sea-level solver time steps, ie. every frequency*dt:*/
+ 	if(count==frequency){
+-		femmodel->inputs->AXPY(-1, OldAccumulatedDeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum,DeltaIceThicknessEnum);
++		femmodel->inputs->ZAXPY(-1, OldAccumulatedDeltaIceThicknessEnum,AccumulatedDeltaIceThicknessEnum,DeltaIceThicknessEnum);
+ 		femmodel->inputs->DuplicateInput(AccumulatedDeltaIceThicknessEnum,OldAccumulatedDeltaIceThicknessEnum);
+ 	}
+ 	return;
+Index: ../trunk-jpl/src/c/cores/oceantransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26121)
+@@ -74,16 +74,15 @@
+ 
+ 	/* From old and new bottom pressures, create delta bottom pressure, delta dsl and delta str. 
+ 	 * Accumulate delta bottom pressure: */
+-	femmodel->inputs->AXPY(-1, BottomPressureOldEnum,BottomPressureEnum,DeltaBottomPressureEnum);
+-	femmodel->inputs->AXPY(+1, DeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum,DummyEnum);
+-	femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaBottomPressureEnum);
++	femmodel->inputs->ZAXPY(-1, BottomPressureOldEnum,BottomPressureEnum,DeltaBottomPressureEnum);
++	femmodel->inputs->AXPY(+1, DeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum);
+ 
+-	femmodel->inputs->AXPY(-1, DslOldEnum,DslEnum,DeltaDslEnum);
+-	femmodel->inputs->AXPY(-1, StrOldEnum,StrEnum,DeltaStrEnum);
++	femmodel->inputs->ZAXPY(-1, DslOldEnum,DslEnum,DeltaDslEnum);
++	femmodel->inputs->ZAXPY(-1, StrOldEnum,StrEnum,DeltaStrEnum);
+ 
+ 	/* Compute total bottom pressure change between two sea-level solver time steps, ie. every frequency*dt. */
+ 	if(count==frequency){
+-		femmodel->inputs->AXPY(-1, OldAccumulatedDeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum,DeltaBottomPressureEnum);
++		femmodel->inputs->ZAXPY(-1, OldAccumulatedDeltaBottomPressureEnum,AccumulatedDeltaBottomPressureEnum,DeltaBottomPressureEnum);
+ 		femmodel->inputs->DuplicateInput(AccumulatedDeltaBottomPressureEnum,OldAccumulatedDeltaBottomPressureEnum);
+ 	}
+ 	return;
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26121)
+@@ -183,6 +183,7 @@
+ 		xDelete<IssmDouble>(partitionocean);
+ 	}
+ 	/*New optimized code:*/
++	ToolkitsOptionsFromAnalysis(parameters,SealevelchangeAnalysisEnum); //this is requested by the BarystaticContributions class inner vectors.
+ 	BarystaticContributions* barystaticcontributions=new BarystaticContributions(iomodel);
+ 	parameters->AddObject(new GenericParam<BarystaticContributions*>(barystaticcontributions,BarystaticContributionsEnum));
+ 	
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26121)
+@@ -25,6 +25,10 @@
+ 		ice=new Vector<IssmDouble>(nice);
+ 		cumice=new Vector<IssmDouble>(nice); cumice->Set(0); cumice->Assemble();
+ 	}
++	else{
++		ice=new Vector<IssmDouble>(1);
++		cumice=new Vector<IssmDouble>(1);
++	}
+ 
+ 	iomodel->FetchData(&nhydro,"md.solidearth.nparthydro");
+ 	if(nhydro){
+@@ -32,6 +36,10 @@
+ 		hydro=new Vector<IssmDouble>(nhydro);
+ 		cumhydro=new Vector<IssmDouble>(nhydro); cumhydro->Set(0); cumhydro->Assemble();
+ 	}
++	else{
++		hydro=new Vector<IssmDouble>(1);
++		cumhydro=new Vector<IssmDouble>(1);
++	}
+ 	iomodel->FetchData(&nocean,"md.solidearth.npartocean");
+ 	if(nocean){
+ 		iomodel->FetchData(&pocean,&nel,NULL,"md.solidearth.partitionocean");
+@@ -38,6 +46,10 @@
+ 		ocean=new Vector<IssmDouble>(nocean);
+ 		cumocean=new Vector<IssmDouble>(nocean); cumocean->Set(0); cumocean->Assemble();
+ 	}
++	else{
++		ocean=new Vector<IssmDouble>(1);
++		cumocean=new Vector<IssmDouble>(1);
++	}
+ 
+ } /*}}}*/
+ BarystaticContributions::~BarystaticContributions(){ /*{{{*/
+@@ -89,6 +101,35 @@
+ 
+ 
+ } /*}}}*/
++void BarystaticContributions::Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue){ /*{{{*/
++	
++	int id;
++	if(nice){
++		id=reCast<int>(pice[eid]);
++		ice->SetValue(id,icevalue,ADD_VAL);
++	}
++	else{
++		ice->SetValue(0,icevalue,ADD_VAL);
++	}
++
++	if(nhydro){
++		id=reCast<int>(phydro[eid]);
++		hydro->SetValue(id,hydrovalue,ADD_VAL);
++	}
++	else{
++		hydro->SetValue(0,hydrovalue,ADD_VAL);
++	}
++
++	if(nocean){
++		id=reCast<int>(pocean[eid]);
++		ocean->SetValue(id,oceanvalue,ADD_VAL);
++	}
++	else{
++		ocean->SetValue(0,oceanvalue,ADD_VAL);
++	}
++		
++
++} /*}}}*/
+ void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/
+ 
+ 	int        step;
+@@ -117,33 +158,24 @@
+ 	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcHydroEnum,sumhydro/oceanarea/rho_water,step,time));
+ 	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcOceanEnum,sumocean/oceanarea/rho_water,step,time));
+ 
+-	cumice_serial=this->cumice->ToMPISerial0(); for (int i=0;i<nice;i++)cumice_serial[i]=cumice_serial[i]/oceanarea/rho_water;
+-	cumhydro_serial=this->cumhydro->ToMPISerial0(); for (int i=0;i<nhydro;i++)cumhydro_serial[i]=cumhydro_serial[i]/oceanarea/rho_water;
+-	cumocean_serial=this->cumocean->ToMPISerial0(); for (int i=0;i<nocean;i++)cumocean_serial[i]=cumocean_serial[i]/oceanarea/rho_water;
+-	
+-	results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcIcePartitionEnum,cumice_serial,nice,1,step,time));
+-	results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcHydroPartitionEnum,cumhydro_serial,nhydro,1,step,time));
+-	results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcOceanPartitionEnum,cumocean_serial,nocean,1,step,time));
++	if(nice){
++		cumice_serial=this->cumice->ToMPISerial0(); for (int i=0;i<nice;i++)cumice_serial[i]=cumice_serial[i]/oceanarea/rho_water;
++		results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcIcePartitionEnum,cumice_serial,nice,1,step,time));
++	}
++	if(nhydro){
++		cumhydro_serial=this->cumhydro->ToMPISerial0(); for (int i=0;i<nhydro;i++)cumhydro_serial[i]=cumhydro_serial[i]/oceanarea/rho_water;
++		results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcHydroPartitionEnum,cumhydro_serial,nhydro,1,step,time));
++	}
++	if(nocean){
++		cumocean_serial=this->cumocean->ToMPISerial0(); for (int i=0;i<nocean;i++)cumocean_serial[i]=cumocean_serial[i]/oceanarea/rho_water;
++		results->AddResult(new GenericExternalResult<IssmDouble*>(results->Size()+1,CumBslcOceanPartitionEnum,cumocean_serial,nocean,1,step,time));
++	}
+ 
+ 	if(IssmComm::GetRank()==0){
+-		xDelete<IssmDouble>(cumice_serial);
+-		xDelete<IssmDouble>(cumhydro_serial);
+-		xDelete<IssmDouble>(cumocean_serial);
++		if(nice)xDelete<IssmDouble>(cumice_serial);
++		if(nhydro)xDelete<IssmDouble>(cumhydro_serial);
++		if(nocean)xDelete<IssmDouble>(cumocean_serial);
+ 	}
+ 	return;
+ 
+ } /*}}}*/
+-void BarystaticContributions::Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue){ /*{{{*/
+-	
+-	int id;
+-		
+-	id=reCast<int>(pice[eid]);
+-	ice->SetValue(id,icevalue,ADD_VAL);
+-
+-	id=reCast<int>(phydro[eid]);
+-	hydro->SetValue(id,hydrovalue,ADD_VAL);
+-
+-	id=reCast<int>(pocean[eid]);
+-	ocean->SetValue(id,oceanvalue,ADD_VAL);
+-
+-} /*}}}*/
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26121)
+@@ -16,21 +16,21 @@
+ 
+ 	public: 
+ 
+-		Vector<IssmDouble>* ice;  //contributions to every ice partition
++		Vector<IssmDouble>* ice;  //contributions to every ice partition (size nice x 1)
+ 		Vector<IssmDouble>* cumice;  //cumulated contributions to every ice partition
+ 		int                 nice; //number of ice partitions 
+-		IssmDouble*         pice; //ice partition
++		IssmDouble*         pice; //ice partition (nel)
+ 
+-		Vector<IssmDouble>* hydro;  //contributions to every hydro partition
++		Vector<IssmDouble>* hydro;  //contributions to every hydro partition (size nhydro x 1)
+ 		Vector<IssmDouble>* cumhydro;  //cumulated contributions to every hydro partition
+ 		int                 nhydro; //number of hydro partitions 
+-		IssmDouble*         phydro; //hydro partition
++		IssmDouble*         phydro; //hydro partition (nel)
+ 
+-		Vector<IssmDouble>* ocean;  //contributions to every ocean partition
++		Vector<IssmDouble>* ocean;  //contributions to every ocean partition (size nocean x 1)
+ 		Vector<IssmDouble>* cumocean;  //cumulated contributions to every ocean partition
+ 		int                 nocean; //number of ocean partitions 
+-		IssmDouble*         pocean; //ocean partition
+-
++		IssmDouble*         pocean; //ocean partition (nel)
++ 
+ 		/*BarystaticContributions constructors, destructors :*/
+ 		BarystaticContributions(IoModel* iomodel );
+ 		~BarystaticContributions();
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26121)
+@@ -381,6 +381,7 @@
+ 		virtual IssmDouble    GetAreaSpherical(void)=0;
+ 		virtual IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks)=0;
+ 		virtual void          SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks)=0;
++		virtual void          SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads)=0;
+ 		virtual IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution,IssmDouble* partition,IssmDouble oceanarea)=0;
+ 		virtual IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea)=0;
+ 		virtual void          SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi, SealevelMasks* masks)=0;
+@@ -392,8 +393,9 @@
+ 
+ 		virtual void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze)=0;
+ 		virtual void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0;
+-		virtual void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks)=0;
+-		virtual void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector,  SealevelMasks* masks)=0;
+ 		virtual void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks)=0;
+ 		#endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26121)
+@@ -218,6 +218,7 @@
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+ 		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
+ 					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+@@ -229,8 +230,9 @@
+ 
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector,SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
+ 		#endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26121)
+@@ -171,6 +171,7 @@
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+ 		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
+ 					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+@@ -184,8 +185,9 @@
+ 
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
+ 
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26121)
+@@ -179,6 +179,7 @@
+ #ifdef _HAVE_SEALEVELCHANGE_
+ 		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
++		void    SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+ 		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
+ 					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+ 		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+@@ -190,8 +191,9 @@
+ 		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
+ 
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26121)
+@@ -6251,7 +6251,8 @@
+ 	IssmDouble lati,longi;
+ 	IssmDouble constant;
+ 	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
+-	int sidlist[NUMVERTICES];
++	int sidlist[NUMVERTICES]; 
++	int sid;
+ 
+ 	#ifdef _HAVE_RESTRICT_
+ 	IssmDouble* __restrict__ G=NULL;
+@@ -6276,7 +6277,7 @@
+ 	IssmDouble* lates=NULL;
+ 	IssmDouble* longes=NULL;
+ 	#endif
+-
++	
+ 	/*elastic green function:*/
+ 	int index;
+ 	int         M;
+@@ -6284,17 +6285,41 @@
+ 	/*Computational flags:*/
+ 	bool computerigid = false;
+ 	bool computeelastic = false;
++	bool computerotation = false;
+ 	int  horiz;
+ 
++	/*Rotational:*/
++	IssmDouble* tide_love_h  = NULL;
++	IssmDouble* tide_love_k  = NULL;
++	IssmDouble* load_love_k  = NULL;
++	IssmDouble  tide_love_k2secular;
++	IssmDouble  moi_e, moi_p, omega, g;
++	IssmDouble Grotm1[3];
++	IssmDouble Grotm2[3];
++	IssmDouble Grotm3[3];
++	IssmDouble pre;
++
++
+ 	/*recover parameters: */
+ 	rho_earth=FindParam(MaterialsEarthDensityEnum);
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
++	this->parameters->FindParam(&computerotation,SolidearthSettingsRotationEnum);
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 
++	if(computerotation){
++		parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
++		parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
++		parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
++		parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
++		parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
++		parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
++		parameters->FindParam(&omega,RotationalAngularVelocityEnum);
++	}
++
+ 	/*compute area and add to inputs:*/
+ 	area=GetAreaSpherical();
+ 	this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
+@@ -6348,7 +6373,7 @@
+ 			/*recover info for this element and vertex:*/
+ 			IssmDouble late=lates[e];
+ 			IssmDouble longe=longes[e];
+-			int sid=sidlist[i];
++			sid=sidlist[i];
+ 
+ 			/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+ 			lati=latitude[sid]/180.*M_PI; longi=longitude[sid]/180.*M_PI;
+@@ -6386,7 +6411,24 @@
+ 			}
+ 		}
+ 	}
++	if(computerotation){
+ 
++		for(int i=0;i<3;i++){
++			sid=sidlist[i];
++			lati=latitude[sid]/180.*M_PI; 
++			longi=longitude[sid]/180.*M_PI; 
++
++			pre=((1.0+tide_love_k[2]-tide_love_h[2])/9.81)*pow(omega*planetradius,2.0);
++			Grotm1[i]= - pre* 0.5*sin(2.*lati)*cos(longi);
++			Grotm2[i]= - pre* 0.5*sin(2.*lati)*sin(longi);
++			Grotm3[i]= - pre* (1/6.0 - 0.5*cos(2.0*lati));
++		}
++		this->AddInput(SealevelGrotm1Enum,&Grotm1[0],P1Enum);
++		this->AddInput(SealevelGrotm2Enum,&Grotm2[0],P1Enum);
++		this->AddInput(SealevelGrotm3Enum,&Grotm3[0],P1Enum);
++	}
++
++
+ 	/*Add in inputs:*/
+ 	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,nel*3);
+ 	if(computeelastic){
+@@ -6490,9 +6532,9 @@
+ 		}
+ 
+ 	}
+-	
+ 	/*if we are an ice shelf, are we fully grounded or not? (used later):*/
+ 	if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
++	
+ 
+ 	/*recover some parameters:*/
+ 	rho_ice=FindParam(MaterialsRhoIceEnum);
+@@ -6605,19 +6647,35 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){ /*{{{*/
+ 
+ 	/*sal green function:*/
+ 	IssmDouble* G=NULL;
+ 	IssmDouble SealevelGRD[NUMVERTICES]={0,0,0};
+ 	IssmDouble oceanaverage,oceanarea=0;
+-
++	IssmDouble rho_water;
++	
+ 	bool sal = false;
++	bool rotation= false;
+ 	int  size;
+ 	int  nel;
++	IssmDouble Grotm1[3];
++	IssmDouble Grotm2[3];
++	IssmDouble Grotm3[3];
+ 	
+ 	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
++
++	if(rotation){
++		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
++		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
++		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
++		
++		for(int i=0;i<NUMVERTICES;i++) SealevelGRD[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++	}
++
+ 	if(sal){
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+ 		
+@@ -6632,24 +6690,38 @@
+ 	OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks);
+ 	
+ 	/*add ocean average in the global sealevelloads vector:*/
+-	sealevelloads->SetValue(this->sid,oceanaverage,INS_VAL);
++	sealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+ 	oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
+ 	
+ 	return;
+ } /*}}}*/
+-void       Tria::SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){ /*{{{*/
+ 
+-	bool converged=false;
+ 	IssmDouble SealevelGRD[3]={0,0,0};
+ 	IssmDouble oceanaverage,oceanarea=0;
++	IssmDouble rho_water;
+ 	int nel;
+ 	bool sal = false;
+ 	IssmDouble* G=NULL;
+ 	int size;
+-	
++	IssmDouble Grotm1[3];
++	IssmDouble Grotm2[3];
++	IssmDouble Grotm3[3];
++	bool rotation= false;
++
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
++	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
++	
++	if(rotation){
++		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
++		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
++		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
+ 		
++		for(int i=0;i<NUMVERTICES;i++) SealevelGRD[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++	}	
++
+ 	if(sal){
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+ 
+@@ -6660,9 +6732,83 @@
+ 		}
+ 	}
+ 	OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks);
+-	newsealevelloads->SetValue(this->sid,oceanaverage,INS_VAL);
++	newsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+ 
+ } /*}}}*/
++void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){ /*{{{*/
++
++	IssmDouble Sealevel[3]={0,0,0};
++	IssmDouble SealevelRSL[3]={0,0,0};
++	IssmDouble SealevelU[3]={0,0,0};
++	IssmDouble SealevelN[3]={0,0,0};
++	IssmDouble SealevelE[3]={0,0,0};
++	int nel;
++	bool sal = false;
++	IssmDouble* G=NULL;
++	IssmDouble* GU=NULL;
++	IssmDouble* GE=NULL;
++	IssmDouble* GN=NULL;
++	int horiz;
++	int size;
++	IssmDouble Grotm1[3];
++	IssmDouble Grotm2[3];
++	IssmDouble Grotm3[3];
++	bool rotation= false;
++	bool elastic=false;
++
++	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
++	this->parameters->FindParam(&elastic,SolidearthSettingsElasticEnum);
++	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++
++	if(rotation){
++		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
++		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
++		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
++		
++		for(int i=0;i<NUMVERTICES;i++) SealevelRSL[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++	}
++		
++	if(sal){
++		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
++		if(elastic) this->inputs->GetArrayPtr(SealevelchangeGUEnum,this->lid,&GU,&size);
++		if(horiz && elastic){
++			this->inputs->GetArrayPtr(SealevelchangeGEEnum,this->lid,&GE,&size);
++			this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&size);
++		}
++
++		for(int i=0;i<NUMVERTICES;i++) {
++			for (int e=0;e<nel;e++){
++				SealevelRSL[i]+=G[i*nel+e]*(sealevelloads[e]+loads[e]);
++			}
++			if(elastic){
++				for (int e=0;e<nel;e++){
++					SealevelU[i]+=GU[i*nel+e]*(sealevelloads[e]+loads[e]);
++				}
++			}
++			if(horiz && elastic){
++				for (int e=0;e<nel;e++){
++					SealevelN[i]+=GN[i*nel+e]*(sealevelloads[e]+loads[e]);
++					SealevelE[i]+=GE[i*nel+e]*(sealevelloads[e]+loads[e]);
++				}
++			}
++		}
++	}
++
++	/*Create geoid: */
++	for(int i=0;i<NUMVERTICES;i++)Sealevel[i]=SealevelU[i]+SealevelRSL[i];
++	
++	/*Create inputs*/
++	this->AddInput(SealevelGRDEnum,Sealevel,P1Enum);
++	this->AddInput(BedGRDEnum,SealevelU,P1Enum);
++	if(horiz){
++		this->AddInput(BedEastGRDEnum,SealevelE,P1Enum);
++		this->AddInput(BedNorthGRDEnum,SealevelN,P1Enum);
++	}
++
++
++} /*}}}*/
+ void       Tria::OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+ 
+ 	IssmDouble phi=1.0;
+@@ -6732,6 +6878,73 @@
+ 
+ }
+ /*}}}*/
++void       Tria::SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){/*{{{*/
++		
++	IssmDouble S;
++
++	/*Compute area of element:*/
++	IssmDouble area,planetarea;
++	this->Element::GetInputValue(&area,AreaEnum);
++
++	/*recover earth area: */
++	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
++
++	/*Compute lat,long,radius of elemental centroid: */
++	bool spherical=true;
++	IssmDouble llr_list[NUMVERTICES][3];
++	IssmDouble late,longe,re;
++	/* Where is the centroid of this element?:{{{*/
++	::GetVerticesCoordinates(&llr_list[0][0],this->vertices,NUMVERTICES,spherical);
++
++	IssmDouble minlong=400;
++	IssmDouble maxlong=-20;
++	for (int i=0;i<NUMVERTICES;i++){
++		llr_list[i][0]=(90-llr_list[i][0]);
++		if(llr_list[i][1]<0)llr_list[i][1]=180+(180+llr_list[i][1]);
++		if(llr_list[i][1]>maxlong)maxlong=llr_list[i][1];
++		if(llr_list[i][1]<minlong)minlong=llr_list[i][1];
++	}
++	if(minlong==0 && maxlong>180){
++		if (llr_list[0][1]==0)llr_list[0][1]=360;
++		if (llr_list[1][1]==0)llr_list[1][1]=360;
++		if (llr_list[2][1]==0)llr_list[2][1]=360;
++	}
++
++	// correction at the north pole
++	if(llr_list[0][0]==0)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
++	if(llr_list[1][0]==0)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
++	if(llr_list[2][0]==0)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
++
++	//correction at the south pole
++	if(llr_list[0][0]==180)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
++	if(llr_list[1][0]==180)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
++	if(llr_list[2][0]==180)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
++
++	late=(llr_list[0][0]+llr_list[1][0]+llr_list[2][0])/3.0;
++	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
++
++	late=90.-late;
++	if(longe>180.)longe=(longe-180.)-180.;
++
++	late=late/180.*M_PI;
++	longe=longe/180.*M_PI;
++	/*}}}*/
++	re=(llr_list[0][2]+llr_list[1][2]+llr_list[2][2])/3.0;
++
++
++	/*recover total load: */
++	S=sealevelloads[this->Sid()]+loads[this->Sid()];
++
++	/* Perturbation terms for moment of inertia (moi_list):
++	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
++	 * also consistent with my GMD formulation!
++	 * ALL in geographic coordinates
++	 * */
++	dI_list[0] = -4*M_PI*(S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
++	dI_list[1] = -4*M_PI*(S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
++	dI_list[2] = +4*M_PI*(S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
++	return;
++}/*}}}*/
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26121)
+@@ -162,6 +162,7 @@
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELCHANGE_
+ 		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
++		void       SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads);
+ 		void       SealevelchangeGeometry(IssmDouble* lat, IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
+ 		IssmDouble SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
+ 		IssmDouble SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
+@@ -174,8 +175,9 @@
+ 		
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks);
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, SealevelMasks* masks);
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, SealevelMasks* masks);
++		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
++		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks);
+ 		#endif
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26121)
+@@ -246,7 +246,7 @@
+ 	this->inputs[index_new] = copy;
+ }
+ /*}}}*/
+-void Inputs::AXPY(IssmDouble alpha, int xenum, int yenum, int zenum){/*{{{*/
++void Inputs::ZAXPY(IssmDouble alpha, int xenum, int yenum, int zenum){/*{{{*/
+ 
+ 	_assert_(this);
+ 
+@@ -269,6 +269,36 @@
+ 	this->inputs[index_z]->AXPY(this->inputs[index_x],alpha);
+ }
+ /*}}}*/
++void Inputs::AXPY(IssmDouble alpha, int xenum, int yenum ){/*{{{*/
++
++	_assert_(this);
++
++	/*Get indices from enums*/
++	int index_x = EnumToIndex(xenum);
++	int index_y = EnumToIndex(yenum);
++
++	/*Make sure that old one exists*/
++	if(!this->inputs[index_x]) _error_("Input "<<EnumToStringx(xenum)<<" not found");
++	if(!this->inputs[index_y]) _error_("Input "<<EnumToStringx(yenum)<<" not found");
++
++	/*AXPY: */
++	this->inputs[index_y]->AXPY(this->inputs[index_x],alpha);
++}
++/*}}}*/
++void     Inputs::Shift(int xenum, IssmDouble alpha){/*{{{*/
++
++	_assert_(this);
++
++	/*Get indices from enums*/
++	int index_x = EnumToIndex(xenum);
++
++	/*Make sure that x exists*/
++	if(!this->inputs[index_x]) _error_("Input "<<EnumToStringx(xenum)<<" not found");
++
++	/*Shift: */
++	this->inputs[index_x]->Shift(alpha);
++}
++/*}}}*/
+ int  Inputs::EnumToIndex(int enum_in){/*{{{*/
+ 
+ 	_assert_(this);
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26121)
+@@ -17,6 +17,7 @@
+ void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+ IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea);
+ SealevelMasks* sealevel_masks(FemModel* femmodel);
++void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealeveloads);
+ /*}}}*/
+ 
+ /*main cores:*/
+@@ -397,6 +398,7 @@
+ 	BarystaticContributions* barycontrib=NULL;
+ 	SealevelMasks* masks=NULL;
+ 	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
++	IssmDouble rotationaxismotionvector[3];
+ 	
+ 	Vector<IssmDouble>*    loads=NULL;
+ 	IssmDouble*            allloads=NULL; 
+@@ -412,11 +414,13 @@
+ 	IssmDouble           eps_abs;
+ 	int                  step;
+ 	IssmDouble           time; 
++	bool converged=false;
+ 
+ 	int  modelid,earthid;
+ 	int  horiz;
+ 	int  count,frequency,iscoupling;
+ 	int  grd=0;
++	int computesealevel=0;
+ 	/*}}}*/
+ 
+ 	/*Verbose: */
+@@ -426,6 +430,7 @@
+ 	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
++	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+ 	/*}}}*/
+ 
+ 	/*only run if grd was requested, if we are the earth, and we have reached
+@@ -462,28 +467,40 @@
+ 		Element* element = xDynamicCast<Element*>(object);
+ 		element->SealevelchangeBarystaticLoads(loads, barycontrib,masks); 
+ 	}
++	loads->Assemble(); 
+ 
+ 	//broadcast loads 
+-	loads->Assemble(); allloads=loads->ToMPISerial();
++	allloads=loads->ToMPISerial();
+ 
++	//compute rotation axis motion:
++	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,NULL);
++
++	/*skip computation of sea level if requested, which means sea level loads should be zeroed */
++	if(!computesealevel){
++		allsealevelloads=xNewZeroInit<IssmDouble>(nel);
++		goto deformation;
++	}
++
+ 	/*convolve loads:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeInitialConvolution(sealevelloads,oceanareas,allloads,masks);
++		element->SealevelchangeInitialConvolution(sealevelloads,oceanareas,allloads,rotationaxismotionvector,masks);
+ 	}
+ 	sealevelloads->Assemble();
+-	
++
+ 	//Get ocean area: 
+ 	oceanareas->Assemble(); oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+ 
+ 	//substract ocean average and barystatic contributionfrom sea level loads: 
+-	sealevelloads->Shift(barycontrib->Total()/oceanarea/rho_water - SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
++	sealevelloads->Shift(barycontrib->Total()/oceanarea - SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
+ 	
+ 	//broadcast sea level loads 
+ 	allsealevelloads=sealevelloads->ToMPISerial();
+ 
+-	bool converged=false;
++	//compute rotation axis motion:
++	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsealevelloads);
++
+ 	for(;;){
+ 			
+ 		oldsealevelloads=sealevelloads->Duplicate();
+@@ -491,41 +508,48 @@
+ 		/*convolve load and sealevel loads on oceans:*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelchangeOceanConvolution(sealevelloads, allsealevelloads, allloads,masks);
++			element->SealevelchangeOceanConvolution(sealevelloads, allsealevelloads, allloads,rotationaxismotionvector,masks);
+ 		}
+ 		sealevelloads->Assemble();
+ 	
+-		
+ 		//substract ocean average and barystatic contribution
+-		sealevelloads->Shift(barycontrib->Total()/oceanarea/rho_water - SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
++		sealevelloads->Shift(barycontrib->Total()/oceanarea- SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
+ 		
+ 		//broadcast sea level loads 
+ 		allsealevelloads=sealevelloads->ToMPISerial();
+ 
++		//compute rotation axis motion:
++		RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsealevelloads);
++
+ 		//convergence?
+ 		slcconvergence(&converged,sealevelloads,oldsealevelloads,eps_rel,eps_abs);
+ 		if (converged)break;
+ 	}
+ 
++	deformation:
++
+ 	/*convolve loads and sea level loads to get the deformation:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		//element->SealevelchangeDeformationConvolution(allsealevelloads, allloads,masks);
++		element->SealevelchangeDeformationConvolution(allsealevelloads, allloads, rotationaxismotionvector,masks);
+ 	}
+ 
+ 	/*Update bedrock motion and geoid:*/
+-	/*inputs->AXPY(SealevelEnum,SealevelGRD,1);
+-	inputs->AXPY(BedEnum,BedGRD,1);
++	if(computesealevel){
++		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/oceanarea- SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
++
++		/*cumulate barystatic contributions and save to results: */
++		barycontrib->Cumulate(femmodel->parameters);
++		barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
++	}
++		
++	femmodel->inputs->AXPY(SealevelEnum,SealevelGRDEnum,1);
++	femmodel->inputs->AXPY(BedEnum,BedGRDEnum,1);
+ 	if(horiz){
+-		inputs->AXPY(BedrockeastEnum,BedEastGRD,1);
+-		inputs->AXPY(BedrocknorthEnum,BedNorthGRD,1);
+-	}*/
++		femmodel->inputs->AXPY(BedEastEnum,BedEastGRDEnum,1);
++		femmodel->inputs->AXPY(BedNorthEnum,BedNorthGRDEnum,1);
++	}
+ 
+-	/*cumulate barystatic contributions and save to results: */
+-	barycontrib->Cumulate(femmodel->parameters);
+-	barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
+-
+-
+ }
+ /*}}}*/
+ 
+@@ -1215,3 +1239,49 @@
+ 	delete sealevelloadsvolume; 
+ 	return sealevelloadsaverage/oceanarea;
+ } /*}}}*/
++void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealeveloads){ /*{{{*/
++
++	IssmDouble  moi_list[3]={0,0,0};
++	IssmDouble  moi_list_cpu[3]={0,0,0};
++	IssmDouble*	tide_love_h  = NULL;
++	IssmDouble*	tide_love_k  = NULL;
++	IssmDouble*	load_love_k  = NULL;
++	IssmDouble  tide_love_k2secular;
++	IssmDouble  moi_e, moi_p;
++	IssmDouble	m1, m2, m3;
++
++	/*retrieve parameters: */
++	femmodel->parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
++	femmodel->parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
++	femmodel->parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
++	femmodel->parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
++	femmodel->parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
++	femmodel->parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
++
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeMomentOfInertiaElement(&moi_list[0],loads,sealeveloads);
++		moi_list_cpu[0] += moi_list[0];
++		moi_list_cpu[1] += moi_list[1];
++		moi_list_cpu[2] += moi_list[2];
++	}
++
++	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	
++	ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	
++	ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++
++	/*compute perturbation terms for angular velocity vector: */
++	m1 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[0];
++	m2 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[1];
++	m3 = -(1+load_love_k[2])/moi_p * moi_list[2];	// term associated with fluid number (3-order-of-magnitude smaller) is negelected
++
++	/*Assign output pointers:*/
++	m[0]=m1;
++	m[1]=m2;
++	m[2]=m3;
++} /*}}}*/
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26120)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26121)
+@@ -352,6 +352,9 @@
+ syn keyword cConstant RotationalAngularVelocityEnum
+ syn keyword cConstant SolidearthSettingsElasticEnum
+ syn keyword cConstant SealevelchangeGeometryDoneEnum
++syn keyword cConstant SealevelGrotm1Enum
++syn keyword cConstant SealevelGrotm2Enum
++syn keyword cConstant SealevelGrotm3Enum
+ syn keyword cConstant RotationalEquatorialMoiEnum
+ syn keyword cConstant TidalLoveHEnum
+ syn keyword cConstant TidalLoveKEnum
+@@ -549,8 +552,11 @@
+ syn keyword cConstant BaseSlopeXEnum
+ syn keyword cConstant BaseSlopeYEnum
+ syn keyword cConstant BedEnum
++syn keyword cConstant BedGRDEnum
+ syn keyword cConstant BedEastEnum
++syn keyword cConstant BedEastGRDEnum
+ syn keyword cConstant BedNorthEnum
++syn keyword cConstant BedNorthGRDEnum
+ syn keyword cConstant BedSlopeXEnum
+ syn keyword cConstant BedSlopeYEnum
+ syn keyword cConstant BottomPressureEnum
+@@ -739,6 +745,7 @@
+ syn keyword cConstant SamplingBetaEnum
+ syn keyword cConstant SamplingKappaEnum
+ syn keyword cConstant SealevelEnum
++syn keyword cConstant SealevelGRDEnum
+ syn keyword cConstant SealevelBarystaticMaskEnum
+ syn keyword cConstant SealevelBarystaticOceanMaskEnum
+ syn keyword cConstant SealevelNEsaEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26120)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26121)
+@@ -346,6 +346,9 @@
+ 	RotationalAngularVelocityEnum,
+ 	SolidearthSettingsElasticEnum,
+ 	SealevelchangeGeometryDoneEnum,
++	SealevelGrotm1Enum,
++	SealevelGrotm2Enum,
++	SealevelGrotm3Enum,
+ 	RotationalEquatorialMoiEnum,
+ 	TidalLoveHEnum,
+ 	TidalLoveKEnum,
+@@ -545,8 +548,11 @@
+ 	BaseSlopeXEnum,
+ 	BaseSlopeYEnum,
+ 	BedEnum,
++	BedGRDEnum,
+ 	BedEastEnum,
++	BedEastGRDEnum,
+ 	BedNorthEnum,
++	BedNorthGRDEnum,
+ 	BedSlopeXEnum,
+ 	BedSlopeYEnum,
+ 	BottomPressureEnum,
+@@ -735,6 +741,7 @@
+ 	SamplingBetaEnum,
+ 	SamplingKappaEnum,
+ 	SealevelEnum,
++	SealevelGRDEnum,
+ 	SealevelBarystaticMaskEnum,
+ 	SealevelBarystaticOceanMaskEnum,
+ 	SealevelNEsaEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26121)
+@@ -354,6 +354,9 @@
+ 		case RotationalAngularVelocityEnum : return "RotationalAngularVelocity";
+ 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
+ 		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
++		case SealevelGrotm1Enum : return "SealevelGrotm1";
++		case SealevelGrotm2Enum : return "SealevelGrotm2";
++		case SealevelGrotm3Enum : return "SealevelGrotm3";
+ 		case RotationalEquatorialMoiEnum : return "RotationalEquatorialMoi";
+ 		case TidalLoveHEnum : return "TidalLoveH";
+ 		case TidalLoveKEnum : return "TidalLoveK";
+@@ -551,8 +554,11 @@
+ 		case BaseSlopeXEnum : return "BaseSlopeX";
+ 		case BaseSlopeYEnum : return "BaseSlopeY";
+ 		case BedEnum : return "Bed";
++		case BedGRDEnum : return "BedGRD";
+ 		case BedEastEnum : return "BedEast";
++		case BedEastGRDEnum : return "BedEastGRD";
+ 		case BedNorthEnum : return "BedNorth";
++		case BedNorthGRDEnum : return "BedNorthGRD";
+ 		case BedSlopeXEnum : return "BedSlopeX";
+ 		case BedSlopeYEnum : return "BedSlopeY";
+ 		case BottomPressureEnum : return "BottomPressure";
+@@ -741,6 +747,7 @@
+ 		case SamplingBetaEnum : return "SamplingBeta";
+ 		case SamplingKappaEnum : return "SamplingKappa";
+ 		case SealevelEnum : return "Sealevel";
++		case SealevelGRDEnum : return "SealevelGRD";
+ 		case SealevelBarystaticMaskEnum : return "SealevelBarystaticMask";
+ 		case SealevelBarystaticOceanMaskEnum : return "SealevelBarystaticOceanMask";
+ 		case SealevelNEsaEnum : return "SealevelNEsa";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26120)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26121)
+@@ -360,6 +360,9 @@
+ 	      else if (strcmp(name,"RotationalAngularVelocity")==0) return RotationalAngularVelocityEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
++	      else if (strcmp(name,"SealevelGrotm1")==0) return SealevelGrotm1Enum;
++	      else if (strcmp(name,"SealevelGrotm2")==0) return SealevelGrotm2Enum;
++	      else if (strcmp(name,"SealevelGrotm3")==0) return SealevelGrotm3Enum;
+ 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
+ 	      else if (strcmp(name,"TidalLoveH")==0) return TidalLoveHEnum;
+ 	      else if (strcmp(name,"TidalLoveK")==0) return TidalLoveKEnum;
+@@ -379,13 +382,13 @@
+ 	      else if (strcmp(name,"SolidearthSettingsMaxiter")==0) return SolidearthSettingsMaxiterEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
+-	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+-	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+-	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
++	      if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
++	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
++	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
++	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+ 	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+@@ -502,13 +505,13 @@
+ 	      else if (strcmp(name,"TransientIsdamageevolution")==0) return TransientIsdamageevolutionEnum;
+ 	      else if (strcmp(name,"TransientIsesa")==0) return TransientIsesaEnum;
+ 	      else if (strcmp(name,"TransientIsgia")==0) return TransientIsgiaEnum;
+-	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+-	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+-	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
++	      if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
++	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
++	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
++	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+ 	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+@@ -563,8 +566,11 @@
+ 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
+ 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
+ 	      else if (strcmp(name,"Bed")==0) return BedEnum;
++	      else if (strcmp(name,"BedGRD")==0) return BedGRDEnum;
+ 	      else if (strcmp(name,"BedEast")==0) return BedEastEnum;
++	      else if (strcmp(name,"BedEastGRD")==0) return BedEastGRDEnum;
+ 	      else if (strcmp(name,"BedNorth")==0) return BedNorthEnum;
++	      else if (strcmp(name,"BedNorthGRD")==0) return BedNorthGRDEnum;
+ 	      else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
+ 	      else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
+ 	      else if (strcmp(name,"BottomPressure")==0) return BottomPressureEnum;
+@@ -622,16 +628,16 @@
+ 	      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,"EplHead")==0) return EplHeadEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      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 stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"EsaEmotion")==0) return EsaEmotionEnum;
++	      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;
+@@ -745,20 +751,21 @@
+ 	      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 stage=7;
++   }
++   if(stage==7){
++	      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 stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
++	      else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
+ 	      else if (strcmp(name,"Sample")==0) return SampleEnum;
+ 	      else if (strcmp(name,"SamplingBeta")==0) return SamplingBetaEnum;
+ 	      else if (strcmp(name,"SamplingKappa")==0) return SamplingKappaEnum;
+ 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
++	      else if (strcmp(name,"SealevelGRD")==0) return SealevelGRDEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticMask")==0) return SealevelBarystaticMaskEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
+ 	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
+@@ -867,7 +874,10 @@
+ 	      else if (strcmp(name,"SmbReini")==0) return SmbReiniEnum;
+ 	      else if (strcmp(name,"SmbRunoff")==0) return SmbRunoffEnum;
+ 	      else if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+-	      else if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      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;
+@@ -874,10 +884,7 @@
+ 	      else if (strcmp(name,"SmbSizeini")==0) return SmbSizeiniEnum;
+ 	      else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum;
+ 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
++	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
+ 	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
+ 	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
+ 	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
+@@ -990,7 +997,10 @@
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+ 	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+-	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+ 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+ 	      else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
+@@ -997,10 +1007,7 @@
+ 	      else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum;
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
++	      else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
+ 	      else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
+ 	      else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
+ 	      else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum;
+@@ -1113,7 +1120,10 @@
+ 	      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 stage=10;
++   }
++   if(stage==10){
++	      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;
+@@ -1120,10 +1130,7 @@
+ 	      else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum;
+ 	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+ 	      else if (strcmp(name,"Colinear")==0) return ColinearEnum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
++	      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;
+@@ -1236,7 +1243,10 @@
+ 	      else if (strcmp(name,"Inputs")==0) return InputsEnum;
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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,"MLHOApproximation")==0) return MLHOApproximationEnum;
+@@ -1243,10 +1253,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"LATaylorHood")==0) return LATaylorHoodEnum;
++	      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;
+@@ -1359,7 +1366,10 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      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;
+@@ -1366,10 +1376,7 @@
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"SSAApproximation")==0) return SSAApproximationEnum;
++	      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;
+Index: ../trunk-jpl/test/NightlyRun/test2004.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26120)
++++ ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26121)
+@@ -142,7 +142,7 @@
+ 	if bas.iscontinentany('antarctica'),
+ 		if testagainst2002,
+ 			% TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.masstransport.spcthickness(pos)'
+-			md.masstransport.spcthickness=zeros(md.mesh.numberofelements,1);
++			md.masstransport.spcthickness=zeros(md.mesh.numberofvertices,1);
+ 			%antarctica
+ 			late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+ 			longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+@@ -149,7 +149,7 @@
+ 			pos=find(late <-85);
+ 			ratio=0.225314032985172/0.193045366574523;
+ 			%ratio=   1.276564103522540/.869956;
+-			md.masstransport.spcthickness(pos)=-100*ratio;
++			md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100*ratio;
+ 		else
+ 			in_fileID=fopen('../Data/AIS_delH_trend.txt', 'r');
+ 			delH=textscan(in_fileID, '%f %f %f');
+@@ -167,7 +167,7 @@
+ 			delHAIS=InterpFromMesh2d(index,longAIS,latAIS,delHAIS,long,lat);
+ 			northpole=find_point(md.mesh.long,md.mesh.lat,0,90);
+ 			delHAIS(northpole)=0;
+-			md.masstransport.spcthickness=mean(delHAIS(md.mesh.elements),2)/100;
++			md.masstransport.spcthickness=delHAIS/100;
+ 		end
+ 
+ 		md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+@@ -248,7 +248,7 @@
+ 	% }}}
+ 	%}}}
+ 	%slc loading/calibration:  {{{
+-	md.masstransport.spcthickness=zeros(md.mesh.numberofelements,1);
++	md.masstransport.spcthickness=zeros(md.mesh.numberofvertices,1);
+ 
+ 	if testagainst2002, 
+ 		% {{{
+@@ -257,6 +257,7 @@
+ 		longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ 		pos=find(late > 70 &  late < 80 & longe>-60 & longe<-30);
+ 		ratio=.3823/.262344;
++		md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100*ratio;
+ 		%md.masstransport.spcthickness(pos)=-100*ratio;
+ 
+ 		%correct mask: 
+@@ -291,16 +292,13 @@
+ 		delHGLA=InterpFromMeshToMesh2d(index,longGLA,latGLA,delHGLA,long,lat);
+ 		delHGLAe=delHGLA(md.mesh.elements)*[1;1;1]/3;
+ 
+-		pos=find(delHGISe);
+-		md.masstransport.spcthickness(pos)=delHGISe(pos)/100;
+-		pos=find(delHGLAe);
+-		md.masstransport.spcthickness(pos)=delHGLAe(pos)/100;
++		pos=find(delHGIS);
++		md.masstransport.spcthickness(pos)= md.masstransport.spcthickness(pos)-delHGIS(pos)/100;
++		pos=find(delHGLA);
++		md.masstransport.spcthickness(pos)= md.masstransport.spcthickness(pos)-delHGLA(pos)/100;
+ 
+ 		%adjust mask accordingly: 
+ 		pos=find(md.masstransport.spcthickness); 
+-		flags=zeros(md.mesh.numberofvertices,1); 
+-		flags(md.mesh.elements(pos,:))=1;
+-		pos=find(flags);
+ 		md.mask.ice_levelset(pos)=-1;
+ 		md.mask.ocean_levelset(pos)=1;
+ 	end
+@@ -428,8 +426,8 @@
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.requested_outputs= {'default',...
+-	'SurfaceloadIceThicknessChange','Sealevel','SealevelRSLRate','SealevelchangeCumDeltathickness',...
+-	'SealevelNEsaRate', 'SealevelUEsaRate','SealevelStaticBarystaticMask','SealevelBarystaticOceanMask'};
++	'DeltaIceThickness','Sealevel','SealevelUGrd',...
++	'SealevelchangeBarystaticMask','SealevelchangeBarystaticOceanMask'};
+ md=solve(md,'Transient');
+ Seustatic=md.results.TransientSolution.Sealevel;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26121-26122.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26121-26122.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26121-26122.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/c
+===================================================================
+--- ../trunk-jpl/src/c	(revision 26121)
++++ ../trunk-jpl/src/c	(revision 26122)
+
+Property changes on: ../trunk-jpl/src/c
+___________________________________________________________________
+Modified: svn:ignore
+## -19,6 +19,7 ##
+ .libs
+ issm
+ kriging
++issm_slc
+ issm_slr
+ issm_ocean
+ issm_dakota
Index: /issm/oecreview/Archive/25834-26739/ISSM-26122-26123.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26122-26123.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26122-26123.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 26122)
++++ ../trunk-jpl/etc/environment.sh	(revision 26123)
+@@ -9,8 +9,10 @@
+ #	directory
+ #
+ 
+-# Silence `zsh: no matches found: <file>`
+-setopt +o nomatch 1> /dev/null 2>&1
++if [[ -n "$ZSH_VERSION" ]]; then
++	# Silence `zsh: no matches found: <file>`
++	setopt +o nomatch 1> /dev/null 2>&1
++fi
+ 
+ ## Functions
+ #
Index: /issm/oecreview/Archive/25834-26739/ISSM-26123-26124.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26123-26124.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26123-26124.diff	(revision 26740)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/configure.ac
+===================================================================
+--- ../trunk-jpl/configure.ac	(revision 26123)
++++ ../trunk-jpl/configure.ac	(revision 26124)
+@@ -15,11 +15,11 @@
+ AC_CANONICAL_TARGET
+ 
+ #Compilers
+-AC_PROG_CC([gcc icc cl icl])
++AC_PROG_CC([icc cl icl gcc])
+ AC_PROG_CPP
+-AC_PROG_CXX([g++ icpc cl icl])
+-AC_PROG_F77([g77 gfortran ifort])
+-AC_PROG_FC([gfortran ifort])
++AC_PROG_CXX([icpc cl icl g++])
++AC_PROG_F77([ifort g77 gfortran])
++AC_PROG_FC([ifort gfortran])
+ 
+ #AUTOMAKE
+ #Initialize automake and declare foreign so that we don't need a ChangeLog, INSTALL, etc
Index: /issm/oecreview/Archive/25834-26739/ISSM-26124-26125.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26124-26125.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26124-26125.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/dev/devpath.m
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.m	(revision 26124)
++++ ../trunk-jpl/src/m/dev/devpath.m	(revision 26125)
+@@ -27,6 +27,7 @@
+ addpath(recursivepath([ISSM_DIR '/externalpackages/googleearthtoolbox']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/howatmask']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/dem']));
++addpath(recursivepath([ISSM_DIR '/externalpackages/mealpix']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/pcatool']));
+ clear ISSM_DIR;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26125-26126.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26125-26126.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26125-26126.diff	(revision 26740)
@@ -0,0 +1,538 @@
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26125)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26126)
+@@ -69,7 +69,12 @@
+ 	InputUpdateFromConstantx(inputs,elements,0.,BedNorthEnum);
+     iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum);
+ 
++	/*Initialize loads:*/
++	iomodel->ConstantToInput(inputs,elements,0.,DeltaTwsEnum,P1Enum);
++	iomodel->ConstantToInput(inputs,elements,0.,DeltaIceThicknessEnum,P1Enum);
++	iomodel->ConstantToInput(inputs,elements,0.,DeltaBottomPressureEnum,P1Enum);
+ 
++
+ }/*}}}*/
+ void SealevelchangeAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+@@ -139,6 +144,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.cross_section_shape",SolidearthSettingsCrossSectionShapeEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.optim",SolidearthSettingsOptimEnum));
+ 	parameters->AddObject(new DoubleParam(CumBslcEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcIceEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcHydroEnum,0.0));
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26125)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26126)
+@@ -6537,8 +6537,9 @@
+ 	
+ 
+ 	/*recover some parameters:*/
+-	rho_ice=FindParam(MaterialsRhoIceEnum);
+-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
++	this->parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
++	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
++	this->parameters->FindParam(&rho_freshwater,MaterialsRhoFreshwaterEnum);
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+ 	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+@@ -6687,7 +6688,7 @@
+ 	}
+ 
+ 	/*compute ocean average over element:*/
+-	OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks);
++	OceanAverageOptim(&oceanaverage,&oceanarea,&SealevelGRD[0],masks);
+ 	
+ 	/*add ocean average in the global sealevelloads vector:*/
+ 	sealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+@@ -6869,7 +6870,7 @@
+ 		Sg_avg+=Sg_gauss*gauss->weight;
+ 		total_weight+=gauss->weight;
+ 	}
+-	Sg_avg=Sg_avg/total_weight;
++	if(total_weight) Sg_avg=Sg_avg/total_weight;
+ 	delete gauss;
+ 
+ 	*poceanaverage=Sg_avg;
+@@ -6880,7 +6881,7 @@
+ /*}}}*/
+ void       Tria::SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){/*{{{*/
+ 		
+-	IssmDouble S;
++	IssmDouble S=0;
+ 
+ 	/*Compute area of element:*/
+ 	IssmDouble area,planetarea;
+@@ -6933,7 +6934,8 @@
+ 
+ 
+ 	/*recover total load: */
+-	S=sealevelloads[this->Sid()]+loads[this->Sid()];
++	if(loads) S+=loads[this->Sid()];
++	if(sealevelloads) S+=sealevelloads[this->Sid()];
+ 
+ 	/* Perturbation terms for moment of inertia (moi_list):
+ 	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26125)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26126)
+@@ -28,9 +28,11 @@
+ 
+ 	/*Parameters, variables:*/
+ 	bool save_results;
++	int  optim=0; 
+ 
+ 	/*Retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
++	femmodel->parameters->FindParam(&optim,SolidearthSettingsOptimEnum);
+ 	
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("   computing sea level change\n");
+@@ -48,7 +50,8 @@
+ 	couplerinput_core(femmodel);
+ 
+ 	/*Run geodetic:*/
+-	grd_core(femmodel);
++	if(!optim) grd_core(femmodel);
++	else grd_core_optim(femmodel);
+ 
+ 	/*Run steric core for sure:*/
+ 	dynstr_core(femmodel);
+@@ -412,6 +415,8 @@
+ 
+ 	IssmDouble           eps_rel;
+ 	IssmDouble           eps_abs;
++	int                  max_nonlinear_iterations;
++	int                  iterations=0;
+ 	int                  step;
+ 	IssmDouble           time; 
+ 	bool converged=false;
+@@ -420,7 +425,8 @@
+ 	int  horiz;
+ 	int  count,frequency,iscoupling;
+ 	int  grd=0;
+-	int computesealevel=0;
++	int  computesealevel=0;
++
+ 	/*}}}*/
+ 
+ 	/*Verbose: */
+@@ -431,6 +437,7 @@
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+ 	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
++	femmodel->parameters->FindParam(&max_nonlinear_iterations,SolidearthSettingsMaxiterEnum);
+ 	/*}}}*/
+ 
+ 	/*only run if grd was requested, if we are the earth, and we have reached
+@@ -461,6 +468,7 @@
+ 
+ 	/*call masks core: */
+ 	masks=sealevel_masks(femmodel);
++	if(VerboseSolution()) _printf0_("	  starting  GRD convolutions\n");
+ 	
+ 	/*buildup loads: */
+ 	for(Object* & object : femmodel->elements->objects){
+@@ -500,7 +508,8 @@
+ 
+ 	//compute rotation axis motion:
+ 	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsealevelloads);
+-
++	
++	if(VerboseSolution()) _printf0_("	  converging ocean GRD convolutions\n");
+ 	for(;;){
+ 			
+ 		oldsealevelloads=sealevelloads->Duplicate();
+@@ -524,9 +533,15 @@
+ 		//convergence?
+ 		slcconvergence(&converged,sealevelloads,oldsealevelloads,eps_rel,eps_abs);
+ 		if (converged)break;
++
++		//early return?
++		if(iterations>max_nonlinear_iterations)break;
++		else iterations++;
+ 	}
+ 
+ 	deformation:
++	
++	if(VerboseSolution()) _printf0_("	  deformation GRD convolutions\n");
+ 
+ 	/*convolve loads and sea level loads to get the deformation:*/
+ 	for(Object* & object : femmodel->elements->objects){
+@@ -533,6 +548,8 @@
+ 		Element* element = xDynamicCast<Element*>(object);
+ 		element->SealevelchangeDeformationConvolution(allsealevelloads, allloads, rotationaxismotionvector,masks);
+ 	}
++	
++	if(VerboseSolution()) _printf0_("	  updating GRD fields\n");
+ 
+ 	/*Update bedrock motion and geoid:*/
+ 	if(computesealevel){
+@@ -542,12 +559,12 @@
+ 		barycontrib->Cumulate(femmodel->parameters);
+ 		barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
+ 	}
+-		
+-	femmodel->inputs->AXPY(SealevelEnum,SealevelGRDEnum,1);
+-	femmodel->inputs->AXPY(BedEnum,BedGRDEnum,1);
++
++	femmodel->inputs->AXPY(1,SealevelEnum,SealevelGRDEnum);
++	femmodel->inputs->AXPY(1,BedEnum,BedGRDEnum);
+ 	if(horiz){
+-		femmodel->inputs->AXPY(BedEastEnum,BedEastGRDEnum,1);
+-		femmodel->inputs->AXPY(BedNorthEnum,BedNorthGRDEnum,1);
++		femmodel->inputs->AXPY(1,BedEastEnum,BedEastGRDEnum);
++		femmodel->inputs->AXPY(1,BedNorthEnum,BedNorthGRDEnum);
+ 	}
+ 
+ }
+@@ -593,7 +610,7 @@
+ 
+ 	int  horiz;
+ 	bool geometrydone = false;
+-	bool optim=false;
++	int  optim;
+ 	int  grdmodel=0;
+ 
+ 		
+@@ -601,6 +618,7 @@
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	femmodel->parameters->FindParam(&geometrydone,SealevelchangeGeometryDoneEnum);
+ 	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	femmodel->parameters->FindParam(&optim,SolidearthSettingsOptimEnum);
+ 	
+ 	/*early return?:*/
+ 	if(grdmodel==IvinsEnum) return;
+@@ -622,8 +640,8 @@
+ 	/*Run sealevel geometry routine in elements:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
+-		//if(optim) element->SealevelchangeGeometryOptim(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
++		if(optim) element->SealevelchangeGeometryOptim(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
++		else      element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
+ 	}
+ 
+ 	/*Free ressources:*/
+@@ -1239,7 +1257,7 @@
+ 	delete sealevelloadsvolume; 
+ 	return sealevelloadsaverage/oceanarea;
+ } /*}}}*/
+-void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealeveloads){ /*{{{*/
++void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealevelloads){ /*{{{*/
+ 
+ 	IssmDouble  moi_list[3]={0,0,0};
+ 	IssmDouble  moi_list_cpu[3]={0,0,0};
+@@ -1260,7 +1278,7 @@
+ 
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeMomentOfInertiaElement(&moi_list[0],loads,sealeveloads);
++		element->SealevelchangeMomentOfInertiaElement(&moi_list[0],loads,sealevelloads);
+ 		moi_list_cpu[0] += moi_list[0];
+ 		moi_list_cpu[1] += moi_list[1];
+ 		moi_list_cpu[2] += moi_list[2];
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26125)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26126)
+@@ -349,12 +349,10 @@
+ syn keyword cConstant SolidearthPlanetAreaEnum
+ syn keyword cConstant SolidearthSettingsAbstolEnum
+ syn keyword cConstant SolidearthSettingsCrossSectionShapeEnum
++syn keyword cConstant SolidearthSettingsOptimEnum
+ syn keyword cConstant RotationalAngularVelocityEnum
+ syn keyword cConstant SolidearthSettingsElasticEnum
+ syn keyword cConstant SealevelchangeGeometryDoneEnum
+-syn keyword cConstant SealevelGrotm1Enum
+-syn keyword cConstant SealevelGrotm2Enum
+-syn keyword cConstant SealevelGrotm3Enum
+ syn keyword cConstant RotationalEquatorialMoiEnum
+ syn keyword cConstant TidalLoveHEnum
+ syn keyword cConstant TidalLoveKEnum
+@@ -757,6 +755,9 @@
+ syn keyword cConstant BslcOceanEnum
+ syn keyword cConstant BslcRateEnum
+ syn keyword cConstant GmtslcEnum
++syn keyword cConstant SealevelGrotm1Enum
++syn keyword cConstant SealevelGrotm2Enum
++syn keyword cConstant SealevelGrotm3Enum
+ syn keyword cConstant SealevelRSLBarystaticEnum
+ syn keyword cConstant SealevelRSLRateEnum
+ syn keyword cConstant SealevelUGrdEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26125)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26126)
+@@ -343,12 +343,10 @@
+ 	SolidearthPlanetAreaEnum,
+ 	SolidearthSettingsAbstolEnum,
+ 	SolidearthSettingsCrossSectionShapeEnum,
++	SolidearthSettingsOptimEnum,
+ 	RotationalAngularVelocityEnum,
+ 	SolidearthSettingsElasticEnum,
+ 	SealevelchangeGeometryDoneEnum,
+-	SealevelGrotm1Enum,
+-	SealevelGrotm2Enum,
+-	SealevelGrotm3Enum,
+ 	RotationalEquatorialMoiEnum,
+ 	TidalLoveHEnum,
+ 	TidalLoveKEnum,
+@@ -753,6 +751,9 @@
+ 	BslcOceanEnum,
+ 	BslcRateEnum,
+ 	GmtslcEnum,
++	SealevelGrotm1Enum,
++	SealevelGrotm2Enum,
++	SealevelGrotm3Enum,
+ 	SealevelRSLBarystaticEnum,
+ 	SealevelRSLRateEnum,
+ 	SealevelUGrdEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26125)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26126)
+@@ -351,12 +351,10 @@
+ 		case SolidearthPlanetAreaEnum : return "SolidearthPlanetArea";
+ 		case SolidearthSettingsAbstolEnum : return "SolidearthSettingsAbstol";
+ 		case SolidearthSettingsCrossSectionShapeEnum : return "SolidearthSettingsCrossSectionShape";
++		case SolidearthSettingsOptimEnum : return "SolidearthSettingsOptim";
+ 		case RotationalAngularVelocityEnum : return "RotationalAngularVelocity";
+ 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
+ 		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
+-		case SealevelGrotm1Enum : return "SealevelGrotm1";
+-		case SealevelGrotm2Enum : return "SealevelGrotm2";
+-		case SealevelGrotm3Enum : return "SealevelGrotm3";
+ 		case RotationalEquatorialMoiEnum : return "RotationalEquatorialMoi";
+ 		case TidalLoveHEnum : return "TidalLoveH";
+ 		case TidalLoveKEnum : return "TidalLoveK";
+@@ -759,6 +757,9 @@
+ 		case BslcOceanEnum : return "BslcOcean";
+ 		case BslcRateEnum : return "BslcRate";
+ 		case GmtslcEnum : return "Gmtslc";
++		case SealevelGrotm1Enum : return "SealevelGrotm1";
++		case SealevelGrotm2Enum : return "SealevelGrotm2";
++		case SealevelGrotm3Enum : return "SealevelGrotm3";
+ 		case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic";
+ 		case SealevelRSLRateEnum : return "SealevelRSLRate";
+ 		case SealevelUGrdEnum : return "SealevelUGrd";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26125)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26126)
+@@ -357,12 +357,10 @@
+ 	      else if (strcmp(name,"SolidearthPlanetArea")==0) return SolidearthPlanetAreaEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsAbstol")==0) return SolidearthSettingsAbstolEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsCrossSectionShape")==0) return SolidearthSettingsCrossSectionShapeEnum;
++	      else if (strcmp(name,"SolidearthSettingsOptim")==0) return SolidearthSettingsOptimEnum;
+ 	      else if (strcmp(name,"RotationalAngularVelocity")==0) return RotationalAngularVelocityEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
+-	      else if (strcmp(name,"SealevelGrotm1")==0) return SealevelGrotm1Enum;
+-	      else if (strcmp(name,"SealevelGrotm2")==0) return SealevelGrotm2Enum;
+-	      else if (strcmp(name,"SealevelGrotm3")==0) return SealevelGrotm3Enum;
+ 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
+ 	      else if (strcmp(name,"TidalLoveH")==0) return TidalLoveHEnum;
+ 	      else if (strcmp(name,"TidalLoveK")==0) return TidalLoveKEnum;
+@@ -382,12 +380,12 @@
+ 	      else if (strcmp(name,"SolidearthSettingsMaxiter")==0) return SolidearthSettingsMaxiterEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
++	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
++	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+-	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+-	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
++	      if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+@@ -505,12 +503,12 @@
+ 	      else if (strcmp(name,"TransientIsdamageevolution")==0) return TransientIsdamageevolutionEnum;
+ 	      else if (strcmp(name,"TransientIsesa")==0) return TransientIsesaEnum;
+ 	      else if (strcmp(name,"TransientIsgia")==0) return TransientIsgiaEnum;
++	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
++	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+-	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+-	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
++	      if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+ 	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+@@ -628,12 +626,12 @@
+ 	      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,"EplHead")==0) return EplHeadEnum;
++	      else if (strcmp(name,"EplHeadOld")==0) return EplHeadOldEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"EplHead")==0) return EplHeadEnum;
+-	      else if (strcmp(name,"EplHeadOld")==0) return EplHeadOldEnum;
+-	      else if (strcmp(name,"EplHeadSlopeX")==0) return EplHeadSlopeXEnum;
++	      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;
+@@ -751,12 +749,12 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"RadarIcePeriod")==0) return RadarIcePeriodEnum;
+-	      else if (strcmp(name,"RadarPowerMacGregor")==0) return RadarPowerMacGregorEnum;
+-	      else if (strcmp(name,"RadarPowerWolff")==0) return RadarPowerWolffEnum;
++	      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;
+@@ -777,6 +775,9 @@
+ 	      else if (strcmp(name,"BslcOcean")==0) return BslcOceanEnum;
+ 	      else if (strcmp(name,"BslcRate")==0) return BslcRateEnum;
+ 	      else if (strcmp(name,"Gmtslc")==0) return GmtslcEnum;
++	      else if (strcmp(name,"SealevelGrotm1")==0) return SealevelGrotm1Enum;
++	      else if (strcmp(name,"SealevelGrotm2")==0) return SealevelGrotm2Enum;
++	      else if (strcmp(name,"SealevelGrotm3")==0) return SealevelGrotm3Enum;
+ 	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
+ 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
+ 	      else if (strcmp(name,"SealevelUGrd")==0) return SealevelUGrdEnum;
+@@ -873,11 +874,11 @@
+ 	      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 if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
++	      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;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+-	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
++	      if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
++	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+ 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+ 	      else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
+@@ -1119,11 +1120,11 @@
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
++	      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;
+@@ -1242,11 +1243,11 @@
+ 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+ 	      else if (strcmp(name,"Inputs")==0) return InputsEnum;
+ 	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+-	      else if (strcmp(name,"Intersect")==0) return IntersectEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
++	      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,"MLHOApproximation")==0) return MLHOApproximationEnum;
+@@ -1365,11 +1366,11 @@
+ 	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum;
++	      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;
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26125)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26126)
+@@ -21,6 +21,7 @@
+ 		glfraction             = 1; %barystatic contribution full or fractional (default fractional)
+ 		grdmodel               = 0; %grd model (0 by default, 1 for elastic, 2 for Ivins)
+ 		cross_section_shape    = 0; %cross section only used when grd model is Ivins
++		optim                  = 0; %new optimized version of the GRD code.
+ 	end
+ 	methods
+ 		function self = solidearthsettings(varargin) % {{{
+@@ -64,6 +65,9 @@
+ 		%cross section for Ivins model 
+ 		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
+ 
++		%optim? 
++		self.optim=0;
++
+ 		%no grd model by default: 
+ 		self.grdmodel=0; 
+ 
+@@ -82,6 +86,7 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.glfraction','values',[0 1]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','values',[1 2]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
++			md = checkfield(md,'fieldname','solidearth.settings.optim','values',[0,1]);
+ 
+ 			%checks on computational flags
+ 			if self.elastic==1 & self.rigid==0,
+@@ -125,6 +130,7 @@
+ 			fielddisplay(self,'glfraction','contribute fractionally (default, 1) to barystatic sea level');
+ 			fielddisplay(self,'grdmodel','type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins');
+ 			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
++			fielddisplay(self,'optim','use optimized version of the GRD code? (default 0)');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'object',self,'fieldname','reltol','name','md.solidearth.settings.reltol','format','Double');
+@@ -143,6 +149,7 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','glfraction','name','md.solidearth.settings.glfraction','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','name','md.solidearth.settings.cross_section_shape','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','optim','name','md.solidearth.settings.optim','format','Integer');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+@@ -157,6 +164,7 @@
+ 			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.glfraction'],self.glfraction);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
++			writejsdouble(fid,[modelname '.solidearth.settings.optim'],self.optim);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26126-26127.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26126-26127.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26126-26127.diff	(revision 26740)
@@ -0,0 +1,327 @@
+Index: ../trunk-jpl/src/m/io/loadvars.py
+===================================================================
+--- ../trunk-jpl/src/m/io/loadvars.py	(revision 26126)
++++ ../trunk-jpl/src/m/io/loadvars.py	(revision 26127)
+@@ -97,7 +97,6 @@
+                     print("    ==> {} is of class {}".format(mod, classtype[mod]))
+                 if classtype[mod][0] == 'results.solutionstep':  #Treating results {{{
+                     keylist = [key for key in curclass.groups]
+-                    # this is related to the old structure of NC files where every steps of results had its own group
+                     #that is the current treatment
+                     #here we have a more NC approach with time being a dimension
+                     listtype = split(r'\.', classtype[mod][0])[0]
+@@ -110,13 +109,33 @@
+                             nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(classtype[mod][1], listtype)()]
+                             Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
+                         else:
++                            setattr(nvdict['md'].__dict__[classtree[mod][0]], classtree[mod][1], getattr(classtype[mod][1], 'solution')([]))
++                            for i in range(max(1, len(NCFile.dimensions['Time']))):
++                                nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]].steps.append(getattr(classtype[mod][1], 'solutionstep')())
++                            Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
++                # }}}
++                elif "results" in mod and classtype[mod][0] == 'list':  #this is the old style of results where every step has a group{{{
++                    keylist = [key for key in curclass.groups]
++                    #one group per step so use that in place of time
++                    stepnum = len(NCFile.groups[classtree[mod][0]].groups[classtree[mod][1]].groups)
++                    #we need to redefine classtype from list to result
++                    listtype = 'results'
++                    classtype[mod].append(__import__(listtype))
++                    if stepnum == 1:
++                        nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1], listtype)()
++                        Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
++                    else:
++                        if onlylast:   #we load only the last result to save on time and memory
++                            nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(classtype[mod][1], listtype)()]
++                            Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
++                        else:
+                             #nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(classtype[mod][1], listtype)() for i in range(max(1, len(NCFile.dimensions['Time'])))]
+                             #Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+                             setattr(nvdict['md'].__dict__[classtree[mod][0]], classtree[mod][1], getattr(classtype[mod][1], 'solution')([]))
+-                            for i in range(max(1, len(NCFile.dimensions['Time']))):
++                            for i in range(max(1, stepnum)):
+                                 nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]].steps.append(getattr(classtype[mod][1], 'solutionstep')())
+                             Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+-                # }}}
++                    #}}}
+                 elif classtype[mod][0] == 'massfluxatgate':  #this is for output definitions {{{
+                     defname = split('Output|[0-9]+', classtree[mod][1])[1] + 's'
+                     defindex = int(findall('[0-9]+', classtree[mod][1])[0])
+@@ -140,26 +159,30 @@
+                 nvdict['md'].__dict__[mod] = getattr(classtype[mod][1], modulename)()
+                 Tree = nvdict['md'].__dict__[classtree[mod][0]]
+             if debug:
+-                print("    for {} Tree is a {}".format(mod, Tree.__class__.__name__))
++                print("    for {} Tree is a {} with len {}".format(mod, Tree.__class__.__name__, len(curclass.groups)))
+             # }}}
+             #==== Then we populate it {{{
+-            for i in range(0, max(1, len(curclass.groups))):
+-                if len(curclass.groups) > 0:
+-                    listclass = curclass.groups[keylist[i]]
++            #for i in range(0, max(1, len(curclass.groups))):
++            if len(curclass.groups) > 0:  #that is presumably only for old style NC where each result step had its own group
++                if onlylast:
++                    listclass = curclass.groups[keylist[len(curclass.groups) - 1]]
+                 else:
+-                    listclass = curclass
+-                #==== We deal with Variables {{{
+-                for var in listclass.variables:
+-                    if debug:
+-                        print("    ==> treating var {}".format(var))
+-                    if var not in ['errlog', 'outlog']:
+-                        varval = listclass.variables[str(var)]
+-                        vardim = varval.ndim
+-                        #There is a special treatment for results to account for its specific structure
+-                        #that is the new export version where time is a named dimension
+-                        NewFormat = 'Time' in NCFile.dimensions
+-                        if type(Tree) == list and NewFormat:
+-                            if onlylast:
++                    listclass = curclass.groups[keylist[0]]
++            else:
++                listclass = curclass
++            #==== We deal with Variables {{{
++            for var in listclass.variables:
++                if debug:
++                    print("    ==> treating var {}".format(var))
++                if var not in ['errlog', 'outlog']:
++                    varval = listclass.variables[str(var)]
++                    vardim = varval.ndim
++                    #There is a special treatment for results to account for its specific structure
++                    #that is the new export version where time is a named dimension
++                    NewFormat = 'Time' in NCFile.dimensions
++                    if type(Tree) == list:  # and NewFormat:
++                        if onlylast:
++                            if NewFormat:
+                                 if vardim == 1:
+                                     Tree[0].__dict__[str(var)] = varval[-1].data
+                                 elif vardim == 2:
+@@ -168,133 +191,99 @@
+                                     Tree[0].__dict__[str(var)] = varval[-1, :, :].data
+                                 else:
+                                     print('table dimension greater than 3 not implemented yet')
++                            else:  #old format had step sorted in difeerent group so last group is last time
++                                Tree[0].__dict__[str(var)] = varval[:].data
++                        else:
++                            incomplete = 'Time' not in varval.dimensions and NewFormat
++                            if incomplete:
++                                chosendim = varval.dimensions[0]
++                                timelist = np.arange(0, len(NCFile.dimensions[chosendim]))
++                                print('WARNING, {} is not present on every times, we chose {}({}) as the dimension to write it with'.format(var, chosendim, len(NCFile.dimensions[chosendim])))
++                            elif not NewFormat:
++                                timelist = len(curclass.groups)
+                             else:
+-                                incomplete = 'Time' not in varval.dimensions
+-                                if incomplete:
+-                                    chosendim = varval.dimensions[0]
+-                                    timelist = np.arange(0, len(NCFile.dimensions[chosendim]))
+-                                    print('WARNING, {} is not present on every times, we chose {}({}) as the dimension to write it with'.format(var, chosendim, len(NCFile.dimensions[chosendim])))
++                                timelist = np.arange(0, len(NCFile.dimensions['Time']))
++                            for t in timelist:
++                                print("filing step {} for {}".format(t, var))
++                                if vardim == 0:
++                                    Tree[t].__dict__[str(var)] = varval[:].data
++                                if vardim == 1:
++                                    Tree[t].__dict__[str(var)] = varval[t].data
++                                elif vardim == 2:
++                                    Tree[t].__dict__[str(var)] = varval[t, :].data
++                                elif vardim == 3:
++                                    Tree[t].__dict__[str(var)] = varval[t, :, :].data
+                                 else:
+-                                    timelist = np.arange(0, len(NCFile.dimensions['Time']))
+-                                for t in timelist:
+-                                    print("filing step {} for {}".format(t, var))
+-                                    if vardim == 0:
+-                                        Tree[t].__dict__[str(var)] = varval[:].data
+-                                    if vardim == 1:
+-                                        Tree[t].__dict__[str(var)] = varval[t].data
+-                                    elif vardim == 2:
+-                                        Tree[t].__dict__[str(var)] = varval[t, :].data
+-                                    elif vardim == 3:
+-                                        Tree[t].__dict__[str(var)] = varval[t, :, :].data
+-                                    else:
+-                                        print('table dimension greater than 3 not implemented yet')
+-                        else:
+-                            if vardim == 0:  #that is a scalar
+-                                if type(Tree) == list:
+-                                    t = indexlist[i]
+-                                    if listtype == 'dict':
+-                                        Tree[t][str(var)] = varval[0].data
+-                                    else:
+-                                        Tree[t].__dict__[str(var)] = varval[0].data
+-                                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()
++                                    print('table dimension greater than 3 not implemented yet')
++                    else:
++                        if vardim == 0:  #that is a scalar
++                            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:  #that is a vector
+-                                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[:]]
++                        elif vardim == 1:  #that is a vector
++                            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:
+-                                    if type(Tree) == list:
+-                                        t = indexlist[i]
+-                                        if listtype == 'dict':
+-                                            Tree[t][str(var)] = varval[:].data
+-                                        else:
+-                                            Tree[t].__dict__[str(var)] = varval[:].data
+-                                    else:
+-                                        try:
+-                                            #some thing specifically require a list
+-                                            mdtype = type(Tree.__dict__[str(var)])
+-                                        except KeyError:
+-                                            mdtype = float
+-                                        if mdtype == list:
+-                                            Tree.__dict__[str(var)] = [mdval for mdval in varval[:]]
+-                                        else:
+-                                            Tree.__dict__[str(var)] = varval[:].data
++                                    Tree.__dict__[str(var)] = [str(vallue) for vallue in 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 dictionaries
+-                                    if any(varval[:, 0] == 'toolkit'):  #toolkit definition have to be first
+-                                        Tree.__dict__[str(var)] = OrderedDict([('toolkit', str(varval[np.where(varval[:, 0] == 'toolkit')[0][0], 1]))])
+-                                        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:
+-                                        strings1 = [str(arg[0]) for arg in varval]
+-                                        strings2 = [str(arg[1]) for arg in varval]
+-                                        Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2)))
++                        elif vardim == 2:
++                            #dealling with dict
++                            if varval.dtype == str:  #that is for dictionaries
++                                if any(varval[:, 0] == 'toolkit'):  #toolkit definition have to be first
++                                    Tree.__dict__[str(var)] = OrderedDict([('toolkit', str(varval[np.where(varval[:, 0] == 'toolkit')[0][0], 1]))])
++                                    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 = indexlist[i]
+-                                        if listtype == 'dict':
+-                                            Tree[t][str(var)] = varval[:, :].data
+-                                        else:
+-                                            Tree[t].__dict__[str(var)] = varval[:, :].data
+-                                    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[:, :, :].data
+-                                    else:
+-                                        Tree[t].__dict__[str(var)] = varval[:, :, :]
+-                                else:
+-                                    Tree.__dict__[str(var)] = varval[:, :, :].data
+-                            else:
+-                                print('table dimension greater than 3 not implemented yet')
+-                    # }}}
+-                #==== And with atribute {{{
+-                for attr in listclass.ncattrs():
+-                    if debug:
+-                        print("      ==> treating attribute {}".format(attr))
+-                    if attr != 'classtype':  #classtype is for treatment, don't get it back
+-                        attribute = str(attr).swapcase()  #there is a reason for swapcase, no sure what it isanymore
+-                        if attr == 'VARNAME':
+-                            attribute = 'name'
+-                        if type(Tree) == list and NewFormat:
+-                            if debug:
+-                                print("        printing with index 0")
+-                            if listtype == 'dict':
+-                                Tree[0][attribute] = str(listclass.getncattr(attr))
+-                            else:
+-                                Tree[0].__dict__[attribute] = str(listclass.getncattr(attr))
+-                        elif type(Tree) == list:
+-                            t = int(indexlist[i])
+-                            if debug:
+-                                print("        printing with index {}".format(t))
+-                            if listtype == 'dict':
+-                                Tree[t][attribute] = str(listclass.getncattr(attr))
+-                            else:
+-                                Tree[t].__dict__[attribute] = str(listclass.getncattr(attr))
++                                    strings1 = [str(arg[0]) for arg in varval]
++                                    strings2 = [str(arg[1]) for arg in varval]
++                                    Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2)))
++                        elif vardim == 3:
++                            Tree.__dict__[str(var)] = varval[:, :, :].data
+                         else:
+-                            Tree.__dict__[attribute] = str(listclass.getncattr(attr))
+-                            if listclass.getncattr(attr) == 'True':
+-                                Tree.__dict__[attribute] = True
+-                            elif listclass.getncattr(attr) == 'False':
+-                                Tree.__dict__[attribute] = False
++                            print('table dimension greater than 3 not implemented yet')
+                 # }}}
++            #==== And with atribute {{{
++            for attr in listclass.ncattrs():
++                if debug:
++                    print("      ==> treating attribute {}".format(attr))
++                if attr != 'classtype':  #classtype is for treatment, don't get it back
++                    attribute = str(attr).swapcase()  #there is a reason for swapcase, no sure what it isanymore
++                    if attr == 'VARNAME':
++                        attribute = 'name'
++                    if type(Tree) == list:
++                        if debug:
++                            print("        printing with index 0")
++                        if listtype == 'dict':
++                            Tree[0][attribute] = str(listclass.getncattr(attr))
++                        else:
++                            Tree[0].__dict__[attribute] = str(listclass.getncattr(attr))
++                    else:
++                        Tree.__dict__[attribute] = str(listclass.getncattr(attr))
++                        if listclass.getncattr(attr) == 'True':
++                            Tree.__dict__[attribute] = True
++                        elif listclass.getncattr(attr) == 'False':
++                            Tree.__dict__[attribute] = False
++                # }}}
+             # }}}
+         NCFile.close()
+     if len(args) >= 2 and isinstance(args[1], str):  # (value)
+@@ -321,10 +310,10 @@
+                 classe = str(group) + '.' + str(subgroup)
+                 grpclass = str(getattr(NCData.groups[group].groups[subgroup], 'classtype'))
+                 class_dict[classe] = [grpclass, ]
++                print(class_dict[classe][0])
+                 if class_dict[classe][0] not in ['dict', 'list', 'cell']:
+                     try:
+                         modulename = split(r'\.', class_dict[classe][0])[0]
+-                        #class_dict[classe].append(__import__(class_dict[classe][0]))
+                         class_dict[classe].append(__import__(modulename))
+                     except ModuleNotFoundError:
+                         #submodule probably has a different name
Index: /issm/oecreview/Archive/25834-26739/ISSM-26127-26128.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26127-26128.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26127-26128.diff	(revision 26740)
@@ -0,0 +1,241 @@
+Index: ../trunk-jpl/src/m/io/loadvars.py
+===================================================================
+--- ../trunk-jpl/src/m/io/loadvars.py	(revision 26127)
++++ ../trunk-jpl/src/m/io/loadvars.py	(revision 26128)
+@@ -165,124 +165,129 @@
+             #for i in range(0, max(1, len(curclass.groups))):
+             if len(curclass.groups) > 0:  #that is presumably only for old style NC where each result step had its own group
+                 if onlylast:
+-                    listclass = curclass.groups[keylist[len(curclass.groups) - 1]]
++                    groupclass = [curclass.groups[keylist[len(curclass.groups) - 1]]]
+                 else:
+-                    listclass = curclass.groups[keylist[0]]
++                    groupclass = [curclass.groups[key] for key in keylist]
+             else:
+-                listclass = curclass
++                groupclass = [curclass]
+             #==== We deal with Variables {{{
+-            for var in listclass.variables:
+-                if debug:
+-                    print("    ==> treating var {}".format(var))
+-                if var not in ['errlog', 'outlog']:
+-                    varval = listclass.variables[str(var)]
+-                    vardim = varval.ndim
+-                    #There is a special treatment for results to account for its specific structure
+-                    #that is the new export version where time is a named dimension
+-                    NewFormat = 'Time' in NCFile.dimensions
+-                    if type(Tree) == list:  # and NewFormat:
+-                        if onlylast:
+-                            if NewFormat:
+-                                if vardim == 1:
+-                                    Tree[0].__dict__[str(var)] = varval[-1].data
+-                                elif vardim == 2:
+-                                    Tree[0].__dict__[str(var)] = varval[-1, :].data
+-                                elif vardim == 3:
+-                                    Tree[0].__dict__[str(var)] = varval[-1, :, :].data
++            for groupindex, listclass in enumerate(groupclass):
++                for var in listclass.variables:
++                    if debug:
++                        print("    ==> treating var {}".format(var))
++                    if var not in ['errlog', 'outlog']:
++                        varval = listclass.variables[str(var)]
++                        vardim = varval.ndim
++                        #There is a special treatment for results to account for its specific structure
++                        #that is the new export version where time is a named dimension
++                        NewFormat = 'Time' in NCFile.dimensions
++                        if type(Tree) == list:  # and NewFormat:
++                            if onlylast:
++                                if NewFormat:
++                                    if vardim == 1:
++                                        Tree[0].__dict__[str(var)] = varval[-1].data
++                                    elif vardim == 2:
++                                        Tree[0].__dict__[str(var)] = varval[-1, :].data
++                                    elif vardim == 3:
++                                        Tree[0].__dict__[str(var)] = varval[-1, :, :].data
++                                    else:
++                                        print('table dimension greater than 3 not implemented yet')
++                                else:  #old format had step sorted in difeerent group so last group is last time
++                                    Tree[0].__dict__[str(var)] = varval[:].data
++                            else:
++                                if NewFormat:
++                                    incomplete = 'Time' not in varval.dimensions and NewFormat
++                                    if incomplete:
++                                        chosendim = varval.dimensions[0]
++                                        timelist = np.arange(0, len(NCFile.dimensions[chosendim]))
++                                        print('WARNING, {} is not present on every times, we chose {}({}) as the dimension to write it with'.format(var, chosendim, len(NCFile.dimensions[chosendim])))
++                                    else:
++                                        timelist = np.arange(0, len(NCFile.dimensions['Time']))
++                                    for t in timelist:
++                                        if debug:
++                                            print("filing step {} for {}".format(t, var))
++                                        if vardim == 0:
++                                            Tree[t].__dict__[str(var)] = varval[:].data
++                                        elif vardim == 1:
++                                            Tree[t].__dict__[str(var)] = varval[t].data
++                                        elif vardim == 2:
++                                            Tree[t].__dict__[str(var)] = varval[t, :].data
++                                        elif vardim == 3:
++                                            Tree[t].__dict__[str(var)] = varval[t, :, :].data
++                                        else:
++                                            print('table dimension greater than 3 not implemented yet')
+                                 else:
+-                                    print('table dimension greater than 3 not implemented yet')
+-                            else:  #old format had step sorted in difeerent group so last group is last time
+-                                Tree[0].__dict__[str(var)] = varval[:].data
++                                    if debug:
++                                        print("filing step {} for {}".format(groupindex, var))
++                                    Tree[groupindex].__dict__[str(var)] = varval[:].data
+                         else:
+-                            incomplete = 'Time' not in varval.dimensions and NewFormat
+-                            if incomplete:
+-                                chosendim = varval.dimensions[0]
+-                                timelist = np.arange(0, len(NCFile.dimensions[chosendim]))
+-                                print('WARNING, {} is not present on every times, we chose {}({}) as the dimension to write it with'.format(var, chosendim, len(NCFile.dimensions[chosendim])))
+-                            elif not NewFormat:
+-                                timelist = len(curclass.groups)
+-                            else:
+-                                timelist = np.arange(0, len(NCFile.dimensions['Time']))
+-                            for t in timelist:
+-                                print("filing step {} for {}".format(t, var))
+-                                if vardim == 0:
+-                                    Tree[t].__dict__[str(var)] = varval[:].data
+-                                if vardim == 1:
+-                                    Tree[t].__dict__[str(var)] = varval[t].data
+-                                elif vardim == 2:
+-                                    Tree[t].__dict__[str(var)] = varval[t, :].data
+-                                elif vardim == 3:
+-                                    Tree[t].__dict__[str(var)] = varval[t, :, :].data
++                            if vardim == 0:  #that is a scalar
++                                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:
+-                                    print('table dimension greater than 3 not implemented yet')
+-                    else:
+-                        if vardim == 0:  #that is a scalar
+-                            if str(varval[0]) == '':  #no value
+-                                Tree.__dict__[str(var)] = []
+-                            elif varval[0] == 'True':  #treatin bool
+-                                Tree.__dict__[str(var)] = True
+-                            elif varval[0] == 'False':  #treatin bool
+-                                Tree.__dict__[str(var)] = False
+-                            else:
+-                                Tree.__dict__[str(var)] = varval[0].item()
++                                    Tree.__dict__[str(var)] = varval[0].item()
+ 
+-                        elif vardim == 1:  #that is a vector
+-                            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)
++                            elif vardim == 1:  #that is a vector
++                                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:
+-                                    Tree.__dict__[str(var)] = [str(vallue) for vallue in varval[:]]
++                                    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 dictionaries
++                                    if any(varval[:, 0] == 'toolkit'):  #toolkit definition have to be first
++                                        Tree.__dict__[str(var)] = OrderedDict([('toolkit', str(varval[np.where(varval[:, 0] == 'toolkit')[0][0], 1]))])
++                                        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:
++                                        strings1 = [str(arg[0]) for arg in varval]
++                                        strings2 = [str(arg[1]) for arg in varval]
++                                        Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2)))
++                            elif vardim == 3:
++                                Tree.__dict__[str(var)] = varval[:, :, :].data
+                             else:
+-                                try:
+-                                    #some thing specifically require a list
+-                                    mdtype = type(Tree.__dict__[str(var)])
+-                                except KeyError:
+-                                    mdtype = float
+-                                if mdtype == list:
+-                                    Tree.__dict__[str(var)] = [mdval for mdval in varval[:]]
+-                                else:
+-                                    Tree.__dict__[str(var)] = varval[:].data
+-
+-                        elif vardim == 2:
+-                            #dealling with dict
+-                            if varval.dtype == str:  #that is for dictionaries
+-                                if any(varval[:, 0] == 'toolkit'):  #toolkit definition have to be first
+-                                    Tree.__dict__[str(var)] = OrderedDict([('toolkit', str(varval[np.where(varval[:, 0] == 'toolkit')[0][0], 1]))])
+-                                    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:
+-                                    strings1 = [str(arg[0]) for arg in varval]
+-                                    strings2 = [str(arg[1]) for arg in varval]
+-                                    Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2)))
+-                        elif vardim == 3:
+-                            Tree.__dict__[str(var)] = varval[:, :, :].data
+-                        else:
+-                            print('table dimension greater than 3 not implemented yet')
++                                print('table dimension greater than 3 not implemented yet')
+                 # }}}
+-            #==== And with atribute {{{
+-            for attr in listclass.ncattrs():
+-                if debug:
+-                    print("      ==> treating attribute {}".format(attr))
+-                if attr != 'classtype':  #classtype is for treatment, don't get it back
+-                    attribute = str(attr).swapcase()  #there is a reason for swapcase, no sure what it isanymore
+-                    if attr == 'VARNAME':
+-                        attribute = 'name'
+-                    if type(Tree) == list:
+-                        if debug:
+-                            print("        printing with index 0")
+-                        if listtype == 'dict':
+-                            Tree[0][attribute] = str(listclass.getncattr(attr))
++                #==== And with atribute {{{
++                for attr in listclass.ncattrs():
++                    if debug:
++                        print("      ==> treating attribute {}".format(attr))
++                    if attr != 'classtype':  #classtype is for treatment, don't get it back
++                        attribute = str(attr).swapcase()  #there is a reason for swapcase, no sure what it isanymore
++                        if attr == 'VARNAME':
++                            attribute = 'name'
++                        if type(Tree) == list:
++                            if debug:
++                                print("        printing with index 0")
++                            if listtype == 'dict':
++                                Tree[0][attribute] = str(listclass.getncattr(attr))
++                            else:
++                                Tree[0].__dict__[attribute] = str(listclass.getncattr(attr))
+                         else:
+-                            Tree[0].__dict__[attribute] = str(listclass.getncattr(attr))
+-                    else:
+-                        Tree.__dict__[attribute] = str(listclass.getncattr(attr))
+-                        if listclass.getncattr(attr) == 'True':
+-                            Tree.__dict__[attribute] = True
+-                        elif listclass.getncattr(attr) == 'False':
+-                            Tree.__dict__[attribute] = False
++                            Tree.__dict__[attribute] = str(listclass.getncattr(attr))
++                            if listclass.getncattr(attr) == 'True':
++                                Tree.__dict__[attribute] = True
++                            elif listclass.getncattr(attr) == 'False':
++                                Tree.__dict__[attribute] = False
+                 # }}}
+             # }}}
+         NCFile.close()
Index: /issm/oecreview/Archive/25834-26739/ISSM-26128-26129.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26128-26129.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26128-26129.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/m/io/loadvars.py
+===================================================================
+--- ../trunk-jpl/src/m/io/loadvars.py	(revision 26128)
++++ ../trunk-jpl/src/m/io/loadvars.py	(revision 26129)
+@@ -29,7 +29,7 @@
+ 
+     filename = ''
+     nvdict = {}
+-    debug = False  #print messages if true
++    debug = True  #print messages if true
+ 
+     if len(args) >= 1 and isinstance(args[0], str):
+         filename = args[0]
+@@ -173,11 +173,11 @@
+             #==== We deal with Variables {{{
+             for groupindex, listclass in enumerate(groupclass):
+                 for var in listclass.variables:
+-                    if debug:
+-                        print("    ==> treating var {}".format(var))
+                     if var not in ['errlog', 'outlog']:
+                         varval = listclass.variables[str(var)]
+                         vardim = varval.ndim
++                        if debug:
++                            print("    ==> treating var {} of dimension {}".format(var, vardim))
+                         #There is a special treatment for results to account for its specific structure
+                         #that is the new export version where time is a named dimension
+                         NewFormat = 'Time' in NCFile.dimensions
+@@ -262,6 +262,15 @@
+                                         strings1 = [str(arg[0]) for arg in varval]
+                                         strings2 = [str(arg[1]) for arg in varval]
+                                         Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2)))
++                                else:
++                                    if type(Tree) == list:
++                                        t = indexlist[i]
++                                        if listtype == 'dict':
++                                            Tree[t][str(var)] = varval[:, :].data
++                                        else:
++                                            Tree[t].__dict__[str(var)] = varval[:, :].data
++                                    else:
++                                        Tree.__dict__[str(var)] = varval[:, :].data
+                             elif vardim == 3:
+                                 Tree.__dict__[str(var)] = varval[:, :, :].data
+                             else:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26129-26130.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26129-26130.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26129-26130.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/io/loadvars.py
+===================================================================
+--- ../trunk-jpl/src/m/io/loadvars.py	(revision 26129)
++++ ../trunk-jpl/src/m/io/loadvars.py	(revision 26130)
+@@ -29,7 +29,7 @@
+ 
+     filename = ''
+     nvdict = {}
+-    debug = True  #print messages if true
++    debug = False  #print messages if true
+ 
+     if len(args) >= 1 and isinstance(args[0], str):
+         filename = args[0]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26130-26131.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26130-26131.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26130-26131.diff	(revision 26740)
@@ -0,0 +1,1857 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 26131)
+@@ -226,11 +226,11 @@
+ 
+ 	/*Transpose and return Ke*/
+ 	Ke->Transpose();
+-	_assert_(Ke->nrows == numvertices && Ke->ncols == numvertices);
++	_assert_(Ke->nrows == numvertices);
+ 
+ 	for(int i=0;i<numvertices;i++){
+ 		for(int j=0;j<numvertices;j++){
+-			ge[i] += Ke->values[i*Ke->ncols + j] * lambda[j];
++			ge[i] += Ke->values[i*Ke->nrows + j] * lambda[j];
+ 		}
+ 		//ge[i]=-lambda[i];
+ 		_assert_(!xIsNan<IssmDouble>(ge[i]));
+Index: ../trunk-jpl/src/c/toolkits/issm/Bucket.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/Bucket.h	(revision 26130)
++++ ../trunk-jpl/src/c/toolkits/issm/Bucket.h	(revision 26131)
+@@ -33,39 +33,80 @@
+ 		Bucket(){ /*{{{*/
+ 			this->Initialize();
+ 		} /*}}}*/
+-		Bucket(int min,int* idxmin,int nin,int* idxnin,doubletype* valuesin,InsMode modein){ /*{{{*/
++		Bucket(int m_in,int* idxm_in,int n_in,int* idxn_in,doubletype* values_in,InsMode mode_in){ /*{{{*/
+ 
+ 			this->Initialize();
+ 
++			/*Check whether we have negative indices?*/
++			int m_numneg = 0;
++			int n_numneg = 0;
++			for(int i=0;i<m_in;i++) if(idxm_in[i]<0) m_numneg++;
++			for(int i=0;i<n_in;i++) if(idxn_in[i]<0) n_numneg++;
++
+ 			this->type=MATRIX_BUCKET;
+-			this->m=min;
+-			this->n=nin;
+-			this->mode=modein;
+-			if(this->m){
++			this->m=m_in-m_numneg;
++			this->n=n_in-n_numneg;
++			this->mode=mode_in;
++			if(this->m*this->n){
+ 				this->idxm=xNew<int>(this->m); 
+-				xMemCpy(this->idxm,idxmin,this->m);
+-			}
+-			if(this->n){
+ 				this->idxn=xNew<int>(this->n); 
+-				xMemCpy(this->idxn,idxnin,this->n);
+-			}
+-			if(this->m*this->n){
+ 				this->values=xNew<doubletype>(this->n*this->m);
+-				xMemCpy(this->values,valuesin,this->n*this->m);
++
++				if(m_numneg==0 && n_numneg==0){
++					xMemCpy(this->values,values_in,this->n*this->m);
++					xMemCpy(this->idxm,idxm_in,this->m);
++					xMemCpy(this->idxn,idxn_in,this->n);
++				}
++				else{
++					int count;
++					count =0; for(int i=0;i<m_in;i++) if(idxm_in[i]>=0) this->idxm[count++] = idxm_in[i];
++					count =0; for(int i=0;i<n_in;i++) if(idxn_in[i]>=0) this->idxn[count++] = idxn_in[i];
++					count = 0;
++					for(int i=0;i<m_in;i++){
++						if(idxm_in[i]>=0){
++							for(int j=0;j<n_in;j++){
++								if(idxn_in[j]>=0){
++									this->values[count++] = values_in[i*n_in+j];
++								}
++							}
++						}
++					}
++				}
+ 			}
++			else{
++				/*Set both as 0 to save time*/
++				this->m = 0;
++				this->n = 0;
++			}
+ 		} /*}}}*/
+-		Bucket(int min,int* idxmin,doubletype* valuesin,InsMode modein){ /*{{{*/ 
++		Bucket(int m_in,int* idxm_in,doubletype* values_in,InsMode mode_in){ /*{{{*/ 
+ 			this->Initialize();
+ 
++			/*Check whether we have negative indices?*/
++			int numneg = 0;
++			for(int i=0;i<m_in;i++) if(idxm_in[i]<0) numneg++;
++
+ 			this->type=VECTOR_BUCKET; 
+-			this->m=min;
+-			this->mode=modein;
++			this->m=m_in-numneg;
++			this->mode=mode_in;
+ 			if(this->m){
+-				this->idxm=xNew<int>(this->m); 
+-				xMemCpy(this->idxm,idxmin,this->m);
++				this->idxm=xNew<int>(this->m);
++				this->values=xNew<doubletype>(this->m);
+ 
+-				this->values=xNew<doubletype>(this->m);
+-				xMemCpy(this->values,valuesin,this->m);
++				if(numneg==0){
++					xMemCpy(this->idxm,idxm_in,this->m);
++					xMemCpy(this->values,values_in,this->m);
++				}
++				else{
++					int count = 0;
++					for(int i=0;i<m_in;i++){
++						if(idxm_in[i]>=0){
++							this->idxm[count]   = idxm_in[i];
++							this->values[count] = values_in[i];
++							count++;
++						}
++					}
++				}
+ 			}
+ 		} /*}}}*/
+ 		~Bucket(){ /*{{{*/
+@@ -87,7 +128,7 @@
+ 
+ 		/*object virtual functions definitions:*/
+ 		void    Echo(){ /*{{{*/
+-			_printf_("Bucket echo (cpu #: "<<IssmComm::GetRank()<<")\n");
++			_printf_("Bucket echo (cpu #"<<IssmComm::GetRank()<<")\n");
+ 			_printf_("bucket type: " << type << "\n");
+ 			_printf_("num rows: "<<this->m<<" num cols: "<<this->n << "\n");
+ 		} /*}}}*/
+@@ -94,7 +135,7 @@
+ 		void    DeepEcho(){ /*{{{*/
+ 			int i,j;
+ 
+-			_printf_("Bucket echo (cpu #: "<<IssmComm::GetRank()<<")\n");
++			_printf_("Bucket echo (cpu #"<<IssmComm::GetRank()<<")\n");
+ 			_printf_("bucket type: " << type << "\n");
+ 			_printf_("num rows: "<<this->m<<" num cols: "<<this->n << "\n");
+ 			if(type==MATRIX_BUCKET){
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 26131)
+@@ -36,6 +36,7 @@
+ 	VecCreate(IssmComm::GetComm(),&this->vector);
+ 	VecSetSizes(this->vector,m,M);
+ 	VecSetFromOptions(this->vector);
++	VecSetOption(this->vector,VEC_IGNORE_NEGATIVE_INDICES,PETSC_TRUE);
+ 	VecSet(this->vector,0.0);
+ 
+ }
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp	(revision 26131)
+@@ -110,6 +110,7 @@
+ 	MatCreate(comm,&outmatrix);
+ 	MatSetSizes(outmatrix,m,n,M,N);
+ 	MatSetFromOptions(outmatrix);
++	MatSetOption(outmatrix,MAT_IGNORE_ZERO_ENTRIES,PETSC_TRUE);
+ 
+ 	/*preallocation  according to type: */
+ 	MatGetType(outmatrix,&type);
+Index: ../trunk-jpl/src/c/toolkits/petsc/patches/NewVec.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/patches/NewVec.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/toolkits/petsc/patches/NewVec.cpp	(revision 26131)
+@@ -34,6 +34,7 @@
+ 	VecCreate(comm,&vector); 
+ 	VecSetSizes(vector,local_size,PETSC_DECIDE); 
+ 	VecSetFromOptions(vector); 
++	VecSetOption(vector,VEC_IGNORE_NEGATIVE_INDICES,PETSC_TRUE);
+ 
+ 	return vector;
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26131)
+@@ -946,7 +946,7 @@
+ 
+ 	/*First, figure out size of doflist and create it: */
+ 	int numberofdofs=0;
+-	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
+ 
+ 	/*Allocate output*/
+ 	int* doflist=xNew<int>(numberofdofs);
+@@ -954,8 +954,8 @@
+ 	/*Populate: */
+ 	int count=0;
+ 	for(int i=0;i<numnodes;i++){
+-		nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
+-		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++		nodes[i]->GetDofList(&doflist[count],approximation_enum,setenum);
++		count+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -969,7 +969,7 @@
+ 
+ 	/*First, figure out size of doflist and create it: */
+ 	int numberofdofs=0;
+-	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
+ 
+ 	/*Allocate output*/
+ 	int* doflist=xNew<int>(numberofdofs);
+@@ -977,8 +977,9 @@
+ 	/*Populate: */
+ 	int count=0;
+ 	for(int i=0;i<numnodes;i++){
++		_assert_(count<numberofdofs);
+ 		nodes[i]->GetDofListLocal(doflist+count,approximation_enum,setenum);
+-		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
++		count+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
+ 	}
+ 
+ 	/*Assign output pointers:*/
+@@ -4372,8 +4373,8 @@
+ 	}
+ 
+ 	/*Copy current stiffness matrix*/
+-	values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
+-	for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->ncols;j++) values[i*Ke->ncols+j]=Ke->values[i*Ke->ncols+j];
++	values=xNew<IssmDouble>(Ke->nrows*Ke->nrows);
++	for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->nrows;j++) values[i*Ke->nrows+j]=Ke->values[i*Ke->nrows+j];
+ 
+ 	/*Get Coordinate Systems transform matrix*/
+ 	CoordinateSystemTransform(&transform,nodes_list,numnodes,cs_array);
+@@ -4380,7 +4381,7 @@
+ 
+ 	/*Transform matrix: R*Ke*R^T */
+ 	TripleMultiply(transform,numdofs,numdofs,0,
+-				values,Ke->nrows,Ke->ncols,0,
++				values,Ke->nrows,Ke->nrows,0,
+ 				transform,numdofs,numdofs,1,
+ 				&Ke->values[0],0);
+ 
+@@ -4548,8 +4549,8 @@
+ 	}
+ 
+ 	/*Copy current stiffness matrix*/
+-	values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
+-	for(int i=0;i<Ke->nrows*Ke->ncols;i++) values[i]=Ke->values[i];
++	values=xNew<IssmDouble>(Ke->nrows*Ke->nrows);
++	for(int i=0;i<Ke->nrows*Ke->nrows;i++) values[i]=Ke->values[i];
+ 
+ 	/*Get Coordinate Systems transform matrix*/
+ 	CoordinateSystemTransform(&transform,nodes_list,numnodes,cs_array);
+@@ -4556,7 +4557,7 @@
+ 
+ 	/*Transform matrix: R^T*Ke*R */
+ 	TripleMultiply(transform,numdofs,numdofs,1,
+-				values,Ke->nrows,Ke->ncols,0,
++				values,Ke->nrows,Ke->nrows,0,
+ 				transform,numdofs,numdofs,0,
+ 				&Ke->values[0],0);
+ 
+Index: ../trunk-jpl/src/c/classes/Node.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/classes/Node.cpp	(revision 26131)
+@@ -67,13 +67,13 @@
+ 		this->s_set          = xNew<bool>(this->gsize);
+ 		this->svalues        = xNew<IssmDouble>(this->gsize);
+ 		this->gdoflist       = xNew<int>(this->gsize);
+-		this->gdoflist_local = xNewZeroInit<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;
++		this->fdoflist       = xNew<int>(this->gsize);
++		this->sdoflist       = xNew<int>(this->gsize);
++		this->fdoflist_local = xNew<int>(this->gsize);
++		this->sdoflist_local = xNew<int>(this->gsize);
+ 	}
+ 	else{
+ 		this->f_set          = NULL;
+@@ -95,6 +95,11 @@
+ 		this->s_set[i]    = false;
+ 		this->svalues[i]  = 0.;
+ 		this->gdoflist[i] = -1;
++		this->fdoflist[i] = -1;
++		this->sdoflist[i] = -1;
++		this->gdoflist_local[i] = -1;
++		this->fdoflist_local[i] = -1;
++		this->sdoflist_local[i] = -1;
+ 	}
+ 
+ 	/*Stop here if AMR*/
+@@ -223,12 +228,12 @@
+ 		output->gdoflist_local=xNew<int>(output->gsize);
+ 	}
+ 	if(output->fsize>0){
+-		output->fdoflist=xNew<int>(output->fsize);
+-		output->fdoflist_local=xNew<int>(output->fsize);
++		output->fdoflist=xNew<int>(output->gsize);
++		output->fdoflist_local=xNew<int>(output->gsize);
+ 	}
+ 	if(output->ssize>0){
+-		output->sdoflist=xNew<int>(output->ssize);
+-		output->sdoflist_local=xNew<int>(output->ssize);
++		output->sdoflist=xNew<int>(output->gsize);
++		output->sdoflist_local=xNew<int>(output->gsize);
+ 	}
+ 
+ 	if(output->gsize>0){
+@@ -238,15 +243,11 @@
+ 		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));
++		memcpy(output->fdoflist,this->fdoflist,output->gsize*sizeof(int));
++		memcpy(output->fdoflist_local,this->fdoflist_local,output->gsize*sizeof(int));
++		memcpy(output->sdoflist,this->sdoflist,output->gsize*sizeof(int));
++		memcpy(output->sdoflist_local,this->sdoflist_local,output->gsize*sizeof(int));
+ 	}
+-	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; 
+ }
+@@ -276,11 +277,11 @@
+ 	marshallhandle->call(this->svalues,gsize);
+ 	marshallhandle->call(this->doftype,gsize);
+ 	marshallhandle->call(this->gdoflist,gsize);
+-	marshallhandle->call(this->fdoflist,fsize);
+-	marshallhandle->call(this->sdoflist,ssize);
++	marshallhandle->call(this->fdoflist,gsize);
++	marshallhandle->call(this->sdoflist,gsize);
+ 	marshallhandle->call(this->gdoflist_local,gsize);
+-	marshallhandle->call(this->fdoflist_local,fsize);
+-	marshallhandle->call(this->sdoflist_local,ssize);
++	marshallhandle->call(this->fdoflist_local,gsize);
++	marshallhandle->call(this->sdoflist_local,gsize);
+ } /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+@@ -326,18 +327,18 @@
+ 	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_("   f_doflist (" << this->gsize << "): |");
++	for(i=0;i<this->gsize;i++) _printf_(" " << fdoflist[i] << " |");
+ 	_printf_("\n");
+-	_printf_("   f_doflist_local (" << this->fsize << "): |");
+-	for(i=0;i<this->fsize;i++) _printf_(" " << fdoflist_local[i] << " |");
++	_printf_("   f_doflist_local (" << this->gsize << "): |");
++	for(i=0;i<this->gsize;i++) _printf_(" " << fdoflist_local[i] << " |");
+ 	_printf_("\n");
+ 
+-	_printf_("   s_doflist (" << this->ssize << "): |");
+-	for(i=0;i<this->ssize;i++) _printf_(" " << sdoflist[i] << " |");
++	_printf_("   s_doflist (" << this->gsize << "): |");
++	for(i=0;i<this->gsize;i++) _printf_(" " << sdoflist[i] << " |");
+ 	_printf_("\n");
+-	_printf_("   s_doflist_local (" << this->ssize << "): |");
+-	for(i=0;i<this->ssize;i++) _printf_(" " << sdoflist_local[i] << " |");
++	_printf_("   s_doflist_local (" << this->gsize << "): |");
++	for(i=0;i<this->gsize;i++) _printf_(" " << sdoflist_local[i] << " |");
+ 	_printf_("\n");
+ 
+ }
+@@ -385,11 +386,11 @@
+ 		return gdoflist[dofindex];
+ 	}
+ 	else if(setenum==FsetEnum){
+-		_assert_(dofindex>=0 && dofindex<fsize);
++		_assert_(dofindex>=0 && dofindex<gsize);
+ 		return fdoflist[dofindex];
+ 	}
+ 	else if(setenum==SsetEnum){
+-		_assert_(dofindex>=0 && dofindex<ssize);
++		_assert_(dofindex>=0 && dofindex<gsize);
+ 		return sdoflist[dofindex];
+ 	}
+ 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+@@ -396,228 +397,50 @@
+ 
+ } /*}}}*/
+ void Node::GetDofList(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
++	_assert_(!this->indexingupdate);
+ 	int i;
+-	int count=0;
+-	int count2=0;
+ 
+-	_assert_(!this->indexingupdate);
++	int* doflistpointer = NULL;
++	if(setenum==GsetEnum) doflistpointer = gdoflist;
++	else if(setenum==FsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = fdoflist;
++	else if(setenum==SsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = sdoflist;
++	else _error_("not supported");
+ 
+ 	if(approximation_enum==NoneApproximationEnum){
+-		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
+-		if(setenum==FsetEnum)for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
+-		if(setenum==SsetEnum)for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
++		for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
+ 	}
+ 	else{
+-
+-		if(setenum==GsetEnum){
+-			if(doftype){
+-				count=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(doftype[i]==approximation_enum){
+-						outdoflist[count]=gdoflist[i];
+-						count++;
+-					}
+-				}
+-				_assert_(count); //at least one dof should be the approximation requested
++		if(doftype){
++			int count = 0;
++			for(i=0;i<this->gsize;i++){
++				if(doftype[i]==approximation_enum) outdoflist[count++]=doflistpointer[i];
+ 			}
+-			else for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
+ 		}
+-		else if(setenum==FsetEnum){
+-			if(doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(f_set[i]){
+-						if(doftype[i]==approximation_enum){
+-							outdoflist[count]=fdoflist[count2];
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-			}
+-			else for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
+-		}
+-		else if(setenum==SsetEnum){
+-			if(doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(s_set[i]){
+-						if(doftype[i]==approximation_enum){
+-							outdoflist[count]=sdoflist[count2];
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-			}
+-			else for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
+-		}
+-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		else for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
+ 	}
+-}
+-/*}}}*/
++}/*}}}*/
+ void Node::GetDofListLocal(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
+-	int i;
+-	int count=0;
+-	int count2=0;
+ 
+ 	_assert_(!this->indexingupdate);
+-
+-	if(approximation_enum==NoneApproximationEnum){
+-		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist_local[i];
+-		if(setenum==FsetEnum)for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist_local[i];
+-		if(setenum==SsetEnum)for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist_local[i];
+-	}
+-	else{
+-
+-		if(setenum==GsetEnum){
+-			if(doftype){
+-				count=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(doftype[i]==approximation_enum){
+-						outdoflist[count]=gdoflist_local[i];
+-						count++;
+-					}
+-				}
+-				_assert_(count); //at least one dof should be the approximation requested
+-			}
+-			else for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist_local[i];
+-		}
+-		else if(setenum==FsetEnum){
+-			if(doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(f_set[i]){
+-						if(doftype[i]==approximation_enum){
+-							outdoflist[count]=fdoflist_local[count2];
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-			}
+-			else for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist_local[i];
+-		}
+-		else if(setenum==SsetEnum){
+-			if(doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(s_set[i]){
+-						if(doftype[i]==approximation_enum){
+-							outdoflist[count]=sdoflist_local[count2];
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-			}
+-			else for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist_local[i];
+-		}
+-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+-	}
+-}
+-/*}}}*/
+-void Node::GetLocalDofList(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
+ 	int i;
+-	int count=0;
+-	int count2=0;
+ 
+-	_assert_(!this->indexingupdate);
++	int* doflistpointer = NULL;
++	if(setenum==GsetEnum) doflistpointer = gdoflist_local;
++	else if(setenum==FsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = fdoflist_local;
++	else if(setenum==SsetEnum)for(i=0;i<this->gsize;i++) doflistpointer = sdoflist_local;
++	else _error_("not supported");
+ 
+ 	if(approximation_enum==NoneApproximationEnum){
+-		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=i;
+-		else if(setenum==FsetEnum){
+-			count=0;
+-			for(i=0;i<this->gsize;i++){
+-				if(f_set[i]){
+-					outdoflist[count]=i;
+-					count++;
+-				}
+-			}
+-		}
+-		else if(setenum==SsetEnum){
+-			count=0;
+-			for(i=0;i<this->gsize;i++){
+-				if(s_set[i]){
+-					outdoflist[count]=i;
+-					count++;
+-				}
+-			}
+-		}
+-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
+ 	}
+ 	else{
+-
+-		if(setenum==GsetEnum){
+-			if(doftype){
+-				count=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(doftype[i]==approximation_enum){
+-						outdoflist[count]=count;
+-						count++;
+-					}
+-				}
+-				_assert_(count);
++		if(doftype){
++			int count =0;
++			for(i=0;i<this->gsize;i++){
++				if(doftype[i]==approximation_enum) outdoflist[count++]=doflistpointer[i];
+ 			}
+-			else for(i=0;i<this->gsize;i++) outdoflist[i]=i;
+ 		}
+-		else if(setenum==FsetEnum){
+-
+-			if(doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(doftype[i]==approximation_enum){
+-						if(f_set[i]){
+-							outdoflist[count]=count2;
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-				_assert_(count2);
+-			}
+-			else{
+-
+-				count=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(f_set[i]){
+-						outdoflist[count]=i;
+-						count++;
+-					}
+-				}
+-			}
+-		}
+-		else if(setenum==SsetEnum){
+-			if(doftype){
+-				count=0;
+-				count2=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(doftype[i]==approximation_enum){
+-						if(s_set[i]){
+-							outdoflist[count]=count2;
+-							count++;
+-						}
+-						count2++;
+-					}
+-				}
+-				_assert_(count2);
+-			}
+-			else{
+-				count=0;
+-				for(i=0;i<this->gsize;i++){
+-					if(s_set[i]){
+-						outdoflist[count]=i;
+-						count++;
+-					}
+-				}
+-			}
+-		}
+-		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
++		else for(i=0;i<this->gsize;i++) outdoflist[i]=doflistpointer[i];
+ 	}
+ }
+ /*}}}*/
+@@ -659,31 +482,12 @@
+ /*}}}*/
+ void Node::CreateNodalConstraints(Vector<IssmDouble>* ys){/*{{{*/
+ 
+-	int i;
+-	IssmDouble* values=NULL;
+-	int count;
+-
+-	/*Recover values for s set and plug them in constraints vector: */
+ 	if(this->ssize){
+-		values=xNew<IssmDouble>(this->ssize);
+-		count=0;
+-		for(i=0;i<this->gsize;i++){
+-			if(this->s_set[i]){
+-				values[count]=this->svalues[i];
+-				_assert_(!xIsNan<IssmDouble>(values[count]));
+-				count++;
+-			}
+-		}
+-
+ 		/*Add values into constraint vector: */
+-		ys->SetValues(this->ssize,this->sdoflist,values,INS_VAL);
++		ys->SetValues(this->gsize,this->sdoflist,this->svalues,INS_VAL);
+ 	}
+ 
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(values);
+-
+-}
+-/*}}}*/
++}/*}}}*/
+ void Node::Deactivate(void){/*{{{*/
+ 
+ 	if(IsActive() && !this->freeze){
+@@ -704,11 +508,11 @@
+ 	_assert_(dof<this->gsize);
+ 	_assert_(this->active);
+ 
+-	if(this->f_set[dof] == 0){
++	if(!this->f_set[dof]){
+ 		if(this->freeze) _error_("Cannot change dof of frozen node");
+ 		this->indexingupdate = true;
+-		this->f_set[dof]=1; 
+-		this->s_set[dof]=0;
++		this->f_set[dof]=true; 
++		this->s_set[dof]=false;
+ 	}
+ }
+ /*}}}*/
+@@ -718,11 +522,11 @@
+ 	 * to a fixed value during computations. */
+ 	_assert_(dof<this->gsize);
+ 
+-	if(this->f_set[dof] == 1){
++	if(this->f_set[dof]){
+ 		//if(this->freeze) _error_("Cannot change dof of frozen node");
+ 		this->indexingupdate = true;
+-		this->f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
+-		this->s_set[dof]=1;
++		this->f_set[dof]=false; //n splits into f (for which we solve) and s (single point constraints)
++		this->s_set[dof]=true;
+ 	}
+ }
+ /*}}}*/
+@@ -799,23 +603,14 @@
+ }
+ /*}}}*/
+ bool Node::IsActive(void){/*{{{*/
+-
+ 	return active;
+-
+-}
+-/*}}}*/
++}/*}}}*/
+ int  Node::IsClone(){/*{{{*/
+-
+ 	return clone;
+-
+-}
+-/*}}}*/
++}/*}}}*/
+ void Node::ReindexingDone(void){/*{{{*/
+-
+ 	this->indexingupdate = false;
+-
+-}
+-/*}}}*/
++}/*}}}*/
+ void Node::RelaxConstraint(int dof){/*{{{*/
+ 
+ 	/*Dof should be added to the f-set, and taken out of the s-set:*/
+@@ -844,9 +639,9 @@
+ 		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]]);
++				_assert_(this->fdoflist[i]==indices_uf[this->fdoflist_local[i]]);
+ 
+-				values[count] =local_uf[this->fdoflist_local[count]];
++				values[count] =local_uf[this->fdoflist_local[i]];
+ 				indices[count]=this->gdoflist[i];
+ 				count++;
+ 			}
+@@ -864,9 +659,9 @@
+ 		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]]);
++				_assert_(this->sdoflist[i]==indices_ys[this->sdoflist_local[i]]);
+ 
+-				values[count] =local_ys[this->sdoflist_local[count]];
++				values[count] =local_ys[this->sdoflist_local[i]];
+ 				indices[count]=this->gdoflist[i];
+ 				count++;
+ 			}
+@@ -893,12 +688,14 @@
+ 			if(this->f_set[i]){
+ 				_assert_(local_ug);
+ 				_assert_(this->gdoflist[i]==indices_ug[this->gdoflist_local[i]]);
++				_assert_(this->fdoflist[i]>=0);
+ 
+ 				values[count] =local_ug[this->gdoflist_local[i]];
+-				indices[count]=this->fdoflist[count];
++				indices[count]=this->fdoflist[i];
+ 				count++;
+ 			}
+ 		}
++		_assert_(count==this->fsize);
+ 		uf->SetValues(this->fsize,indices,values,INS_VAL);
+ 
+ 		xDelete<IssmDouble>(values);
+@@ -916,32 +713,10 @@
+ 	if(setenum==FsetEnum){
+ 		for(int i=0;i<this->gsize;i++) if(f_set[i])size++;
+ 		this->fsize=size;
+-		xDelete<int>(this->fdoflist);
+-		xDelete<int>(this->fdoflist_local);
+-
+-		if(this->fsize){
+-			this->fdoflist=xNew<int>(size);
+-			this->fdoflist_local=xNew<int>(size);
+-		}
+-		else{
+-			this->fdoflist=NULL;
+-			this->fdoflist_local=NULL;
+-		}
+ 	}
+ 	else if(setenum==SsetEnum){
+ 		for(int i=0;i<this->gsize;i++) if(s_set[i])size++;
+ 		this->ssize=size;
+-		xDelete<int>(this->sdoflist);
+-		xDelete<int>(this->sdoflist_local);
+-
+-		if(this->ssize){
+-			this->sdoflist=xNew<int>(size);
+-			this->sdoflist_local=xNew<int>(size);
+-		}
+-		else{
+-			this->sdoflist=NULL;
+-			this->sdoflist_local=NULL;
+-		}
+ 	}
+ 	/*TODO, we should never be here for GSET! add an assert and track down whether this happens*/
+ }
+@@ -954,25 +729,27 @@
+ 	/*This node should distribute dofs for setenum set (eg, f_set or s_set), go ahead: */
+ 	if(setenum==GsetEnum){
+ 		_assert_(this->gsize==0 || this->gdoflist_local);
+-		for(int i=0;i<this->gsize;i++) gdoflist_local[i]=dofcount+i;
+-		dofcount+=this->gsize;
++		for(int i=0;i<this->gsize;i++) gdoflist_local[i]=dofcount++;
+ 	}
+ 	else if(setenum==FsetEnum){
+ 		_assert_(this->fsize==0 || this->fdoflist_local);
+-		for(int i=0;i<this->fsize;i++) fdoflist_local[i]=dofcount+i;
+-		dofcount+=this->fsize;
++		for(int i=0;i<this->gsize;i++){
++			if(this->f_set[i]) fdoflist_local[i]=dofcount++;
++			else               fdoflist_local[i]=-1;
++		}
+ 	}
+ 	else if(setenum==SsetEnum){
+ 		_assert_(this->ssize==0 || this->sdoflist_local);
+-		for(int i=0;i<this->ssize;i++) sdoflist_local[i]=dofcount+i;
+-		dofcount+=this->ssize;
++		for(int i=0;i<this->gsize;i++){
++			if(this->s_set[i]) sdoflist_local[i]=dofcount++;
++			else               sdoflist_local[i]=-1;
++		}
+ 	}
+ 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 
+ 	/*Assign output pointers: */
+ 	*pdofcount=dofcount;
+-}
+-/*}}}*/
++}/*}}}*/
+ void Node::DistributeGlobalDofsMasters(int dofcount,int setenum){/*{{{*/
+ 
+ 	/*This node is a clone, don't offset the dofs!: */
+@@ -985,11 +762,17 @@
+ 	}
+ 	else if(setenum==FsetEnum){
+ 		_assert_(this->fsize==0 || this->fdoflist);
+-		for(int i=0;i<this->fsize;i++) this->fdoflist[i]=this->fdoflist_local[i]+dofcount;
++		for(int i=0;i<this->gsize;i++){
++			if(this->f_set[i]) fdoflist[i]=this->fdoflist_local[i]+dofcount;
++			else               fdoflist[i]=-1;
++		}
+ 	}
+ 	else if(setenum==SsetEnum){
+ 		_assert_(this->ssize==0 || this->sdoflist);
+-		for(int i=0;i<this->ssize;i++) this->sdoflist[i]=this->sdoflist_local[i]+dofcount;
++		for(int i=0;i<this->gsize;i++){
++			if(this->s_set[i]) sdoflist[i]=this->sdoflist_local[i]+dofcount;
++			else               sdoflist[i]=-1;
++		}
+ 	}
+ 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ }
+@@ -1004,10 +787,10 @@
+ 			for(int j=0;j<this->gsize;j++) truedofs[j]=gdoflist[j];
+ 			break;
+ 		case FsetEnum:
+-			for(int j=0;j<this->fsize;j++) truedofs[j]=fdoflist[j];
++			for(int j=0;j<this->gsize;j++) truedofs[j]=fdoflist[j];
+ 			break;
+ 		case SsetEnum:
+-			for(int j=0;j<this->ssize;j++) truedofs[j]=sdoflist[j];
++			for(int j=0;j<this->gsize;j++) truedofs[j]=sdoflist[j];
+ 			break;
+ 		default:
+ 			_error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+@@ -1026,10 +809,10 @@
+ 			for(int j=0;j<this->gsize;j++) gdoflist[j]=alltruedofs[j];
+ 			break;
+ 		case FsetEnum:
+-			for(int j=0;j<this->fsize;j++) fdoflist[j]=alltruedofs[j];
++			for(int j=0;j<this->gsize;j++) fdoflist[j]=alltruedofs[j];
+ 			break;
+ 		case SsetEnum:
+-			for(int j=0;j<this->ssize;j++) sdoflist[j]=alltruedofs[j];
++			for(int j=0;j<this->gsize;j++) sdoflist[j]=alltruedofs[j];
+ 			break;
+ 		default:
+ 			_error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+@@ -1040,19 +823,18 @@
+ /*Methods inherent to Node: */
+ int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation){/*{{{*/
+ 
+-	int  i,numdof,count;
+-	int* ndof_list=NULL;
++	/*output*/
+ 	int *doflist = NULL;
+ 
+ 	if(numnodes){
+ 
+ 		/*Allocate:*/
+-		ndof_list=xNew<int>(numnodes);
++		int* ndof_list=xNew<int>(numnodes);
+ 
+ 		/*First, figure out size of doflist: */
+-		numdof=0;
+-		for(i=0;i<numnodes;i++){
+-			ndof_list[i]=nodes[i]->GetNumberOfDofs(approximation,setenum);
++		int numdof=0;
++		for(int i=0;i<numnodes;i++){
++			ndof_list[i]=nodes[i]->GetNumberOfDofs(approximation,GsetEnum);
+ 			numdof+=ndof_list[i];
+ 		}
+ 
+@@ -1061,74 +843,18 @@
+ 			doflist=xNew<int>(numdof);
+ 
+ 			/*Populate: */
+-			count=0;
+-			for(i=0;i<numnodes;i++){
++			int count=0;
++			for(int i=0;i<numnodes;i++){
+ 				nodes[i]->GetDofList(&doflist[count],approximation,setenum);
+ 				count+=ndof_list[i];
+ 			}
+ 		}
+ 		else doflist=NULL;
+-	}
+-	/*Free ressources:*/
+-	xDelete<int>(ndof_list);
+ 
+-	return doflist;
+-}
+-/*}}}*/
+-int* GetLocalDofList(Node** nodes,int numnodes,int setenum,int approximation){ /*{{{*/
+-
+-	int  i,j,count,numdof,numgdof;
+-	int* ndof_list=NULL;
+-	int* ngdof_list_cumulative=NULL;
+-	int *doflist = NULL;
+-
+-	if(numnodes){
+-		/*allocate: */
+-		ndof_list=xNew<int>(numnodes);
+-		ngdof_list_cumulative=xNew<int>(numnodes);
+-
+-		/*Get number of dofs per node, and total for this given set*/
+-		numdof=0;
+-		numgdof=0;
+-		for(i=0;i<numnodes;i++){
+-
+-			/*Cumulative list= number of dofs before node i*/
+-			ngdof_list_cumulative[i]=numgdof;
+-
+-			/*Number of dofs for node i for given set and for the g set*/
+-			ndof_list[i]=nodes[i]->GetNumberOfDofs(approximation,setenum);
+-			numgdof    +=nodes[i]->GetNumberOfDofs(approximation,GsetEnum);
+-			numdof     +=ndof_list[i];
+-		}
+-
+-		if(numdof){
+-			/*Allocate: */
+-			doflist=xNew<int>(numdof);
+-
+-			/*Populate: */
+-			count=0;
+-			for(i=0;i<numnodes;i++){
+-				nodes[i]->GetLocalDofList(&doflist[count],approximation,setenum);
+-				count+=ndof_list[i];
+-			}
+-
+-			/*We now have something like: [0 1 0 2 1 2]. Offset by gsize, to get something like: [0 1 2 4 6 7]:*/
+-			count=0;
+-			for(i=0;i<numnodes;i++){
+-				for(j=0;j<ndof_list[i];j++){
+-					doflist[count+j]+=ngdof_list_cumulative[i];
+-				}
+-				count+=ndof_list[i];
+-			}
+-		}
+-		else doflist=NULL;
++		/*Free ressources:*/
++		xDelete<int>(ndof_list);
+ 	}
+ 
+-	/*Free ressources:*/
+-	xDelete<int>(ndof_list);
+-	xDelete<int>(ngdof_list_cumulative);
+-
+-	/*CLean-up and return*/
+ 	return doflist;
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Node.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.h	(revision 26130)
++++ ../trunk-jpl/src/c/classes/Node.h	(revision 26131)
+@@ -93,7 +93,6 @@
+ 		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  IsActive(void);
+@@ -117,7 +116,6 @@
+ 
+ /*Methods inherent to Node: */
+ int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation);
+-int* GetLocalDofList(Node** nodes,int numnodes,int setenum,int approximation);
+ int  GetNumberOfDofs(Node** nodes,int numnodes,int setenum,int approximation);
+ 
+ #endif  /* _NODE_H_ */
+Index: ../trunk-jpl/src/c/classes/Nodes.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Nodes.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/classes/Nodes.cpp	(revision 26131)
+@@ -186,7 +186,7 @@
+ 	/* 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 dofs, so that later on, they can get picked
+ 	 * up by their clones: */
+-	int  maxdofspernode = this->MaxNumDofs(setenum);
++	int  maxdofspernode = this->MaxNumDofs(GsetEnum);
+ 	int* truedofs       = xNewZeroInit<int>(this->Size()*maxdofspernode); //only one alloc
+ 	for(int rank=0;rank<num_procs;rank++){
+ 		if(this->common_send[rank]){
+Index: ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 26131)
+@@ -20,24 +20,12 @@
+ ElementMatrix::ElementMatrix(){/*{{{*/
+ 
+ 	this->nrows=0;
+-	this->ncols=0;
+ 	this->values=NULL;
+-	this->dofsymmetrical=false;
+ 
+-	this->row_fsize=0;
+-	this->row_flocaldoflist=NULL;
+-	this->row_fglobaldoflist=NULL;
+-	this->row_ssize=0;
+-	this->row_slocaldoflist=NULL;
+-	this->row_sglobaldoflist=NULL;
+-
+-	this->col_fsize=0;
+-	this->col_flocaldoflist=NULL;
+-	this->col_fglobaldoflist=NULL;
+-	this->col_ssize=0;
+-	this->col_slocaldoflist=NULL;
+-	this->col_sglobaldoflist=NULL;
+-
++	this->fsize=0;
++	this->fglobaldoflist=NULL;
++	this->ssize=0;
++	this->sglobaldoflist=NULL;
+ }
+ /*}}}*/
+ ElementMatrix::ElementMatrix(ElementMatrix* Ke){/*{{{*/
+@@ -52,8 +40,6 @@
+ 	/*intermediaries*/
+ 	int i,j,counter;
+ 	int gsize,fsize,ssize;
+-	int* P=NULL;
+-	bool found;
+ 
+ 	/*If one of the two matrix is NULL, we copy the other one*/
+ 	if(!Ke1 && !Ke2){
+@@ -69,15 +55,14 @@
+ 	}
+ 
+ 	/*General Case: Ke1 and Ke2 are not empty*/
+-	if(!Ke1->dofsymmetrical || !Ke2->dofsymmetrical) _error_("merging 2 non dofsymmetrical matrices not implemented yet");
+ 
+ 	/*Initialize itransformation matrix Ke[P[i]] = Ke2[i]*/
+-	P=xNew<int>(Ke2->nrows);
++	int* P=xNew<int>(Ke2->nrows);
+ 
+ 	/*1: Get the new numbering of Ke2 and get size of the new matrix*/
+ 	gsize=Ke1->nrows;
+ 	for(i=0;i<Ke2->nrows;i++){
+-		found=false;
++		bool found=false;
+ 		for(j=0;j<Ke1->nrows;j++){
+ 			if(Ke2->gglobaldoflist[i]==Ke1->gglobaldoflist[j]){
+ 				found=true; P[i]=j; break;
+@@ -90,87 +75,37 @@
+ 
+ 	/*2: Initialize static fields*/
+ 	this->nrows=gsize;
+-	this->ncols=gsize;
+-	this->dofsymmetrical=true;
+ 
+ 	/*Gset and values*/
+ 	this->gglobaldoflist=xNew<int>(this->nrows);
+-	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
++	this->fglobaldoflist=xNew<int>(this->nrows);
++	this->sglobaldoflist=xNew<int>(this->nrows);
++	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->nrows);
+ 	for(i=0;i<Ke1->nrows;i++){
+-		for(j=0;j<Ke1->ncols;j++){
+-			this->values[i*this->ncols+j] += Ke1->values[i*Ke1->ncols+j];
++		for(j=0;j<Ke1->nrows;j++){
++			this->values[i*this->nrows+j] += Ke1->values[i*Ke1->nrows+j];
+ 		}
+ 		this->gglobaldoflist[i]=Ke1->gglobaldoflist[i];
++		this->fglobaldoflist[i]=Ke1->fglobaldoflist[i];
++		this->sglobaldoflist[i]=Ke1->sglobaldoflist[i];
+ 	}
+ 	for(i=0;i<Ke2->nrows;i++){
+-		for(j=0;j<Ke2->ncols;j++){
+-			this->values[P[i]*this->ncols+P[j]] += Ke2->values[i*Ke2->ncols+j];
++		for(j=0;j<Ke2->nrows;j++){
++			this->values[P[i]*this->nrows+P[j]] += Ke2->values[i*Ke2->nrows+j];
+ 		}
+ 		this->gglobaldoflist[P[i]]=Ke2->gglobaldoflist[i];
++		this->fglobaldoflist[P[i]]=Ke2->fglobaldoflist[i];
++		this->sglobaldoflist[P[i]]=Ke2->sglobaldoflist[i];
+ 	}
+ 
+ 	/*Fset*/
+-	fsize=Ke1->row_fsize;
+-	for(i=0;i<Ke2->row_fsize;i++){
+-		if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows) fsize++;
+-	}
+-	this->row_fsize=fsize;
+-	if(fsize){
+-		this->row_flocaldoflist =xNew<int>(fsize);
+-		this->row_fglobaldoflist=xNew<int>(fsize);
+-		for(i=0;i<Ke1->row_fsize;i++){
+-			this->row_flocaldoflist[i] =Ke1->row_flocaldoflist[i];
+-			this->row_fglobaldoflist[i]=Ke1->row_fglobaldoflist[i];
+-		}
+-		counter=Ke1->row_fsize;
+-		for(i=0;i<Ke2->row_fsize;i++){
+-			if(P[Ke2->row_flocaldoflist[i]] >= Ke1->nrows){
+-				this->row_flocaldoflist[counter] =P[Ke2->row_flocaldoflist[i]];
+-				this->row_fglobaldoflist[counter]=Ke2->row_fglobaldoflist[i];
+-				counter++;
+-			}
+-		}
+-	}
+-	else{
+-		this->row_flocaldoflist=NULL;
+-		this->row_fglobaldoflist=NULL;
+-	}
++	this->fsize=0;
++	for(i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) this->fsize++;
+ 
+ 	/*Sset*/
+-	ssize=Ke1->row_ssize;
+-	for(i=0;i<Ke2->row_ssize;i++){
+-		if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows) ssize++;
+-	}
+-	this->row_ssize=ssize;
+-	if(ssize){
+-		this->row_slocaldoflist =xNew<int>(ssize);
+-		this->row_sglobaldoflist=xNew<int>(ssize);
+-		for(i=0;i<Ke1->row_ssize;i++){
+-			this->row_slocaldoflist[i] =Ke1->row_slocaldoflist[i];
+-			this->row_sglobaldoflist[i]=Ke1->row_sglobaldoflist[i];
+-		}
+-		counter=Ke1->row_ssize;
+-		for(i=0;i<Ke2->row_ssize;i++){
+-			if(P[Ke2->row_slocaldoflist[i]] >= Ke1->nrows){
+-				this->row_slocaldoflist[counter] =P[Ke2->row_slocaldoflist[i]];
+-				this->row_sglobaldoflist[counter]=Ke2->row_sglobaldoflist[i];
+-				counter++;
+-			}
+-		}
+-	}
+-	else{
+-		this->row_slocaldoflist=NULL;
+-		this->row_sglobaldoflist=NULL;
+-	}
++	this->ssize=0;
++	for(i=0;i<this->nrows;i++) if(this->sglobaldoflist[i]>=0) this->ssize++;
+ 
+-	/*don't do cols, we can pick them up from the rows: */
+-	this->col_fsize=0;
+-	this->col_flocaldoflist=NULL;
+-	this->col_fglobaldoflist=NULL;
+-	this->col_ssize=0;
+-	this->col_slocaldoflist=NULL;
+-	this->col_sglobaldoflist=NULL;
+-
+ 	/*clean-up*/
+ 	xDelete<int>(P);
+ }
+@@ -192,31 +127,19 @@
+ ElementMatrix::ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation){/*{{{*/
+ 
+ 	/*get Matrix size and properties*/
+-	this->dofsymmetrical=true;
+ 	this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
+-	this->ncols=this->nrows;
+ 
+ 	/*fill values with 0: */
+-	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->ncols);
++	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->nrows);
+ 
+ 	/*g list*/
+ 	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
+ 
+ 	/*get dof lists for f and s set: */
+-	this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+-	this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
+-	this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+-	this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
+-	this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation);
+-	this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
+-
+-	/*Because this matrix is "dofsymmetrical" don't do cols, we can pick them up from the rows: */
+-	this->col_fsize=0;
+-	this->col_flocaldoflist=NULL;
+-	this->col_fglobaldoflist=NULL;
+-	this->col_ssize=0;
+-	this->col_slocaldoflist=NULL;
+-	this->col_sglobaldoflist=NULL;
++	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
++	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
++	this->ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
++	this->sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
+ }
+ /*}}}*/
+ ElementMatrix::~ElementMatrix(){/*{{{*/
+@@ -223,14 +146,8 @@
+ 
+ 	xDelete<IssmDouble>(this->values);
+ 	xDelete<int>(this->gglobaldoflist);
+-	xDelete<int>(this->row_flocaldoflist);
+-	xDelete<int>(this->row_fglobaldoflist);
+-	xDelete<int>(this->row_slocaldoflist);
+-	xDelete<int>(this->row_sglobaldoflist);
+-	xDelete<int>(this->col_flocaldoflist);
+-	xDelete<int>(this->col_fglobaldoflist);
+-	xDelete<int>(this->col_slocaldoflist);
+-	xDelete<int>(this->col_sglobaldoflist);
++	xDelete<int>(this->fglobaldoflist);
++	xDelete<int>(this->sglobaldoflist);
+ }
+ /*}}}*/
+ 
+@@ -245,26 +162,19 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+-	if(this->dofsymmetrical){
+-		/*only use row dofs to add values into global matrices: */
++	if(this->fsize){
++		/*first, retrieve values that are in the f-set from the g-set values matrix: */
++		localvalues=xNew<IssmDouble>(this->nrows);
++		for(int i=0;i<this->nrows;i++){
++			localvalues[i] = this->values[this->nrows*i + i];
++		}
+ 
+-		if(this->row_fsize){
+-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+-			localvalues=xNew<IssmDouble>(this->row_fsize);
+-			for(int i=0;i<this->row_fsize;i++){
+-				localvalues[i] = this->values[this->ncols*this->row_flocaldoflist[i]+ this->row_flocaldoflist[i]];
+-			}
++		/*add local values into global  matrix, using the fglobaldoflist: */
++		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,ADD_VAL);
+ 
+-			/*add local values into global  matrix, using the fglobaldoflist: */
+-			pf->SetValues(this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
+-
+-			/*Free ressources:*/
+-			xDelete<IssmDouble>(localvalues);
+-		}
++		/*Free ressources:*/
++		xDelete<IssmDouble>(localvalues);
+ 	}
+-	else{
+-		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+-	}
+ 
+ }
+ /*}}}*/
+@@ -282,44 +192,15 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+-	if(this->dofsymmetrical){
+-		/*only use row dofs to add values into global matrices: */
++	/*only use row dofs to add values into global matrices: */
++	if(this->fsize){
++		/*add local values into global  matrix, using the fglobaldoflist: */
++		Kff->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
++	}
+ 
+-		if(this->row_fsize){
+-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+-			IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
+-			for(int i=0;i<this->row_fsize;i++){
+-				for(int j=0;j<this->row_fsize;j++){
+-					localvalues[this->row_fsize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]];
+-				}
+-			}
+-
+-			/*add local values into global  matrix, using the fglobaldoflist: */
+-			Kff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
+-
+-			/*Free ressources:*/
+-			xDelete<IssmDouble>(localvalues);
+-		}
+-
+-		if((this->row_ssize!=0) && (this->row_fsize!=0)){
+-			/*first, retrieve values that are in the f and s-set from the g-set values matrix: */
+-			IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize);
+-			for(int i=0;i<this->row_fsize;i++){
+-				for(int j=0;j<this->row_ssize;j++){
+-					localvalues[this->row_ssize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]];
+-				}
+-			}
+-			/*add local values into global  matrix, using the fglobaldoflist: */
+-			Kfs->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,localvalues,ADD_VAL);
+-
+-			/*Free ressources:*/
+-			xDelete<IssmDouble>(localvalues);
+-		}
++	if((this->ssize!=0) && (this->fsize!=0)){
++		Kfs->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->sglobaldoflist,this->values,ADD_VAL);
+ 	}
+-	else{
+-		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+-	}
+-
+ }
+ /*}}}*/
+ void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){/*{{{*/
+@@ -330,29 +211,9 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+-	if(this->dofsymmetrical){
+-		/*only use row dofs to add values into global matrices: */
+-
+-		if(this->row_fsize){
+-			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+-			IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);
+-			for(int i=0;i<this->row_fsize;i++){
+-				for(int j=0;j<this->row_fsize;j++){
+-					localvalues[this->row_fsize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]];
+-				}
+-			}
+-			/*add local values into global  matrix, using the fglobaldoflist: */
+-			Jff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
+-
+-			/*Free ressources:*/
+-			xDelete<IssmDouble>(localvalues);
+-		}
+-
++	if(this->fsize){
++		Jff->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+ 	}
+-	else{
+-		_error_("non dofsymmetrical matrix AddToGlobal routine not support yet!");
+-	}
+-
+ }
+ /*}}}*/
+ void ElementMatrix::CheckConsistency(void){/*{{{*/
+@@ -359,10 +220,10 @@
+ 	/*Check element matrix values, only in debugging mode*/
+ 	#ifdef _ISSM_DEBUG_ 
+ 	for (int i=0;i<this->nrows;i++){
+-		for(int j=0;j<this->ncols;j++){
+-			if (xIsNan<IssmDouble>(this->values[i*this->ncols+j])) _error_("NaN found in Element Matrix");
+-			if (xIsInf<IssmDouble>(this->values[i*this->ncols+j])) _error_("Inf found in Element Matrix");
+-			if (fabs(this->values[i*this->ncols+j])>1.e+50) _error_("Element Matrix values exceeds 1.e+50");
++		for(int j=0;j<this->nrows;j++){
++			if (xIsNan<IssmDouble>(this->values[i*this->nrows+j])) _error_("NaN found in Element Matrix");
++			if (xIsInf<IssmDouble>(this->values[i*this->nrows+j])) _error_("Inf found in Element Matrix");
++			if (fabs(this->values[i*this->nrows+j])>1.e+50) _error_("Element Matrix values exceeds 1.e+50");
+ 		}
+ 	}
+ 	#endif
+@@ -373,13 +234,11 @@
+ 	int i,j;
+ 	_printf_("Element Matrix echo:\n");
+ 	_printf_("   nrows: " << this->nrows << "\n");
+-	_printf_("   ncols: " << this->ncols << "\n");
+-	_printf_("   dofsymmetrical: " << (dofsymmetrical?"true":"false") << "\n");
+ 
+ 	_printf_("   values:\n");
+ 	for(i=0;i<nrows;i++){
+ 		_printf_(setw(4) << right << i << ": ");
+-		for(j=0;j<ncols;j++) _printf_( " " << setw(11) << setprecision (5) << right << values[i*ncols+j]);
++		for(j=0;j<nrows;j++) _printf_( " " << setw(11) << setprecision (5) << right << values[i*nrows+j]);
+ 		_printf_("\n");
+ 	}
+ 
+@@ -386,31 +245,13 @@
+ 	_printf_("   gglobaldoflist (" << gglobaldoflist << "): ");
+ 	if(gglobaldoflist) for(i=0;i<nrows;i++) _printf_(" " << gglobaldoflist[i]); _printf_("\n");
+ 
+-	_printf_("   row_fsize: " << row_fsize << "\n");
+-	_printf_("   row_flocaldoflist  (" << row_flocaldoflist << "): ");
+-	if(row_flocaldoflist) for(i=0;i<row_fsize;i++) _printf_(" " << row_flocaldoflist[i] ); _printf_(" \n");
+-	_printf_("   row_fglobaldoflist  (" << row_fglobaldoflist << "): ");
+-	if(row_fglobaldoflist) for(i=0;i<row_fsize;i++)_printf_(" " << row_fglobaldoflist[i]); _printf_(" \n");
++	_printf_("   fsize: " << fsize << "\n");
++	_printf_("   fglobaldoflist  (" << fglobaldoflist << "): ");
++	for(i=0;i<nrows;i++)_printf_(" " << fglobaldoflist[i]); _printf_(" \n");
+ 
+-	_printf_("   row_ssize: " << row_ssize << "\n");
+-	_printf_("   row_slocaldoflist  (" << row_slocaldoflist << "): ");
+-	if(row_slocaldoflist) for(i=0;i<row_ssize;i++) _printf_(" " << row_slocaldoflist[i] ); _printf_(" \n");
+-	_printf_("   row_sglobaldoflist  (" << row_sglobaldoflist << "): ");
+-	if(row_sglobaldoflist) for(i=0;i<row_ssize;i++)_printf_(" " << row_sglobaldoflist[i]); _printf_(" \n");
+-
+-	if(!dofsymmetrical){
+-		_printf_("   col_fsize: " << col_fsize << "\n");
+-		_printf_("   col_flocaldoflist  (" << col_flocaldoflist << "): ");
+-		if(col_flocaldoflist) for(i=0;i<col_fsize;i++) _printf_(" " << col_flocaldoflist[i] ); _printf_(" \n");
+-		_printf_("   col_fglobaldoflist  (" << col_fglobaldoflist << "): ");
+-		if(col_fglobaldoflist) for(i=0;i<col_fsize;i++)_printf_(" " << col_fglobaldoflist[i]); _printf_(" \n");
+-
+-		_printf_("   col_ssize: " << col_ssize << "\n");
+-		_printf_("   col_slocaldoflist  (" << col_slocaldoflist << "): ");
+-		if(col_slocaldoflist) for(i=0;i<col_ssize;i++) _printf_(" " << col_slocaldoflist[i] ); _printf_(" \n");
+-		_printf_("   col_sglobaldoflist  (" << col_sglobaldoflist << "): ");
+-		if(col_sglobaldoflist) for(i=0;i<col_ssize;i++)_printf_(" " << col_sglobaldoflist[i]); _printf_(" \n");
+-	}
++	_printf_("   ssize: " << ssize << "\n");
++	_printf_("   sglobaldoflist  (" << sglobaldoflist << "): ");
++	for(i=0;i<nrows;i++)_printf_(" " << sglobaldoflist[i]); _printf_(" \n");
+ }
+ /*}}}*/
+ void ElementMatrix::Init(ElementMatrix* Ke){/*{{{*/
+@@ -419,73 +260,29 @@
+ 	_assert_(this);
+ 
+ 	this->nrows =Ke->nrows;
+-	this->ncols =Ke->ncols;
+-	this->dofsymmetrical=Ke->dofsymmetrical;
+ 
+-	this->values=xNew<IssmDouble>(this->nrows*this->ncols);
+-	xMemCpy<IssmDouble>(this->values,Ke->values,this->nrows*this->ncols);
++	this->values=xNew<IssmDouble>(this->nrows*this->nrows);
++	xMemCpy<IssmDouble>(this->values,Ke->values,this->nrows*this->nrows);
+ 
+ 	this->gglobaldoflist=xNew<int>(this->nrows);
+ 	xMemCpy<int>(this->gglobaldoflist,Ke->gglobaldoflist,this->nrows);
+ 
+-	this->row_fsize=Ke->row_fsize;
+-	if(this->row_fsize){
+-		this->row_flocaldoflist=xNew<int>(this->row_fsize);
+-		xMemCpy<int>(this->row_flocaldoflist,Ke->row_flocaldoflist,this->row_fsize);
+-		this->row_fglobaldoflist=xNew<int>(this->row_fsize);
+-		xMemCpy<int>(this->row_fglobaldoflist,Ke->row_fglobaldoflist,this->row_fsize);
+-	}
+-	else{
+-		this->row_flocaldoflist=NULL;
+-		this->row_fglobaldoflist=NULL;
+-	}
++	this->fsize=Ke->fsize;
++	this->fglobaldoflist=xNew<int>(this->nrows);
++	xMemCpy<int>(this->fglobaldoflist,Ke->fglobaldoflist,this->nrows);
+ 
+-	this->row_ssize=Ke->row_ssize;
+-	if(this->row_ssize){
+-		this->row_slocaldoflist=xNew<int>(this->row_ssize);
+-		xMemCpy<int>(this->row_slocaldoflist,Ke->row_slocaldoflist,this->row_ssize);
+-		this->row_sglobaldoflist=xNew<int>(this->row_ssize);
+-		xMemCpy<int>(this->row_sglobaldoflist,Ke->row_sglobaldoflist,this->row_ssize);
+-	}
+-	else{
+-		this->row_slocaldoflist=NULL;
+-		this->row_sglobaldoflist=NULL;
+-	}
+-
+-	this->col_fsize=Ke->col_fsize;
+-	if(this->col_fsize){
+-		this->col_flocaldoflist=xNew<int>(this->col_fsize);
+-		xMemCpy<int>(this->col_flocaldoflist,Ke->col_flocaldoflist,this->col_fsize);
+-		this->col_fglobaldoflist=xNew<int>(this->col_fsize);
+-		xMemCpy<int>(this->col_fglobaldoflist,Ke->col_fglobaldoflist,this->col_fsize);
+-	}
+-	else{
+-		this->col_flocaldoflist=NULL;
+-		this->col_fglobaldoflist=NULL;
+-	}
+-
+-	this->col_ssize=Ke->col_ssize;
+-	if(this->col_ssize){
+-		this->col_slocaldoflist=xNew<int>(this->col_ssize);
+-		xMemCpy<int>(this->col_slocaldoflist,Ke->col_slocaldoflist,this->col_ssize);
+-		this->col_sglobaldoflist=xNew<int>(this->col_ssize);
+-		xMemCpy<int>(this->col_sglobaldoflist,Ke->col_sglobaldoflist,this->col_ssize);
+-	}
+-	else{
+-		this->col_slocaldoflist=NULL;
+-		this->col_sglobaldoflist=NULL;
+-	}
++	this->ssize=Ke->ssize;
++	this->sglobaldoflist=xNew<int>(this->nrows);
++	xMemCpy<int>(this->sglobaldoflist,Ke->sglobaldoflist,this->nrows);
+ }
+ /*}}}*/
+ void ElementMatrix::Lump(void){/*{{{*/
+ 
+-	if(!dofsymmetrical) _error_("not supported yet");
+-
+ 	for(int i=0;i<this->nrows;i++){
+-		for(int j=0;j<this->ncols;j++){
++		for(int j=0;j<this->nrows;j++){
+ 			if(i!=j){
+-				this->values[i*this->ncols+i] += this->values[i*this->ncols+j];
+-				this->values[i*this->ncols+j]  = 0.;
++				this->values[i*this->nrows+i] += this->values[i*this->nrows+j];
++				this->values[i*this->nrows+j]  = 0.;
+ 			}
+ 		}
+ 	}
+@@ -498,18 +295,9 @@
+ 	/*Intermediaries*/
+ 	ElementMatrix* Ke_copy=new ElementMatrix(this);
+ 
+-	/*Update sizes*/
+-	this->nrows=Ke_copy->ncols;
+-	this->ncols=Ke_copy->nrows;
+-
+ 	/*Transpose values*/
+-	for (int i=0;i<this->nrows;i++) for(int j=0;j<this->ncols;j++) this->values[i*this->ncols+j]=Ke_copy->values[j*Ke_copy->ncols+i];
++	for (int i=0;i<this->nrows;i++) for(int j=0;j<this->nrows;j++) this->values[i*this->nrows+j]=Ke_copy->values[j*Ke_copy->nrows+i];
+ 
+-	/*Transpose indices*/
+-	if(!dofsymmetrical){
+-		_error_("not supported yet");
+-	}
+-
+ 	/*Clean up and return*/
+ 	delete Ke_copy;
+ 	return;
+@@ -533,7 +321,7 @@
+ 	 */
+ 
+ 	/*Checks in debugging mode*/
+-	_assert_(this->nrows==this->ncols && bsize>0 && bsize<this->ncols && this->values); 
++	_assert_(bsize>0 && bsize<this->nrows && this->values); 
+ 
+ 	/*Intermediaries*/
+ 	int         counter,i,j,isize;
+@@ -570,10 +358,10 @@
+ 	Kib = xNew<IssmDouble>(isize*bsize);
+ 	Kbi = xNew<IssmDouble>(bsize*isize);
+ 	Kbb = xNew<IssmDouble>(bsize*bsize);
+-	for(i=0;i<isize;i++) for(j=0;j<isize;j++) Kii[i*isize+j] = this->values[iindices[i]*this->ncols + iindices[j]];
+-	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = this->values[iindices[i]*this->ncols + bindices[j]];
+-	for(i=0;i<bsize;i++) for(j=0;j<isize;j++) Kbi[i*isize+j] = this->values[bindices[i]*this->ncols + iindices[j]];
+-	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = this->values[bindices[i]*this->ncols + bindices[j]];
++	for(i=0;i<isize;i++) for(j=0;j<isize;j++) Kii[i*isize+j] = this->values[iindices[i]*this->nrows + iindices[j]];
++	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = this->values[iindices[i]*this->nrows + bindices[j]];
++	for(i=0;i<bsize;i++) for(j=0;j<isize;j++) Kbi[i*isize+j] = this->values[bindices[i]*this->nrows + iindices[j]];
++	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = this->values[bindices[i]*this->nrows + bindices[j]];
+ 
+ 	/*Invert Kbb*/
+ 	Kbbinv = xNew<IssmDouble>(bsize*bsize);
+@@ -600,10 +388,10 @@
+ 	for(i=0;i<isize*isize;i++) Ktemp[i] = Kii[i] - Ktemp[i];
+ 
+ 	/*Update matrix values*/
+-	for(i=0;i<this->nrows*this->ncols;i++) this->values[i]=0.;
++	for(i=0;i<this->nrows*this->nrows;i++) this->values[i]=0.;
+ 	for(i=0;i<isize;i++){
+ 		for(j=0;j<isize;j++){
+-			this->values[iindices[i]*this->ncols + iindices[j]] = Ktemp[i*isize+j];
++			this->values[iindices[i]*this->nrows + iindices[j]] = Ktemp[i*isize+j];
+ 		}
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26130)
++++ ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26131)
+@@ -21,33 +21,14 @@
+ 	public:
+ 
+ 		int      nrows;
+-		int      ncols;
+-		bool     dofsymmetrical;
++		int      fsize;
++		int      ssize;
+ 		IssmDouble*  values;
+ 
+-		//gset
+ 		int*     gglobaldoflist;
++		int*     fglobaldoflist;
++		int*     sglobaldoflist;
+ 
+-		/*row wise: */
+-		//fset
+-		int      row_fsize;
+-		int*     row_flocaldoflist;
+-		int*     row_fglobaldoflist;
+-		//sset
+-		int      row_ssize;
+-		int*     row_slocaldoflist;
+-		int*     row_sglobaldoflist;
+-
+-		/*column wise: */
+-		//fset
+-		int      col_fsize;
+-		int*     col_flocaldoflist;
+-		int*     col_fglobaldoflist;
+-		//sset
+-		int      col_ssize;
+-		int*     col_slocaldoflist;
+-		int*     col_sglobaldoflist;
+-
+ 		/*ElementMatrix constructors, destructors*/
+ 		ElementMatrix();
+ 		ElementMatrix(ElementMatrix* Ke);
+Index: ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26130)
++++ ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26131)
+@@ -20,9 +20,8 @@
+ ElementVector::ElementVector(){/*{{{*/
+ 
+ 	this->nrows=0;
++	this->fsize=0;
+ 	this->values=NULL;
+-	this->fsize=0;
+-	this->flocaldoflist=NULL;
+ 	this->fglobaldoflist=NULL;
+ 
+ }
+@@ -30,10 +29,8 @@
+ ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){/*{{{*/
+ 
+ 	/*intermediaries*/
+-	int i,j,counter;
++	int i,j;
+ 	int gsize,fsize;
+-	int* P=NULL;
+-	bool found;
+ 
+ 	/*If one of the two matrix is NULL, we copy the other one*/
+ 	if(!pe1 && !pe2){
+@@ -49,12 +46,12 @@
+ 	}
+ 
+ 	/*Initialize itransformation matrix pe[P[i]] = pe2[i]*/
+-	P=xNew<int>(pe2->nrows);
++	int* P=xNew<int>(pe2->nrows);
+ 
+ 	/*1: Get the new numbering of pe2 and get size of the new matrix*/
+ 	gsize=pe1->nrows;
+ 	for(i=0;i<pe2->nrows;i++){
+-		found=false;
++		bool found=false;
+ 		for(j=0;j<pe1->nrows;j++){
+ 			if(pe2->gglobaldoflist[i]==pe1->gglobaldoflist[j]){
+ 				found=true; P[i]=j; break;
+@@ -70,42 +67,22 @@
+ 
+ 	/*Gset and values*/
+ 	this->gglobaldoflist=xNew<int>(this->nrows);
++	this->fglobaldoflist=xNew<int>(this->nrows);
+ 	this->values=xNewZeroInit<IssmDouble>(this->nrows);
+ 	for(i=0;i<pe1->nrows;i++){
+ 		this->values[i] += pe1->values[i];
+ 		this->gglobaldoflist[i]=pe1->gglobaldoflist[i];
++		this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
+ 	}
+ 	for(i=0;i<pe2->nrows;i++){
+ 		this->values[P[i]] += pe2->values[i];
+ 		this->gglobaldoflist[P[i]]=pe2->gglobaldoflist[i];
++		this->fglobaldoflist[P[i]]=pe2->fglobaldoflist[i];
+ 	}
+ 
+ 	/*Fset*/
+-	fsize=pe1->fsize;
+-	for(i=0;i<pe2->fsize;i++){
+-		if(P[pe2->flocaldoflist[i]] >= pe1->nrows) fsize++;
+-	}
+-	this->fsize=fsize;
+-	if(fsize){
+-		this->flocaldoflist =xNew<int>(fsize);
+-		this->fglobaldoflist=xNew<int>(fsize);
+-		for(i=0;i<pe1->fsize;i++){
+-			this->flocaldoflist[i] =pe1->flocaldoflist[i];
+-			this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
+-		}
+-		counter=pe1->fsize;
+-		for(i=0;i<pe2->fsize;i++){
+-			if(P[pe2->flocaldoflist[i]] >= pe1->nrows){
+-				this->flocaldoflist[counter] =P[pe2->flocaldoflist[i]];
+-				this->fglobaldoflist[counter]=pe2->fglobaldoflist[i];
+-				counter++;
+-			}
+-		}
+-	}
+-	else{
+-		this->flocaldoflist=NULL;
+-		this->fglobaldoflist=NULL;
+-	}
++	this->fsize=0;
++	for(i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) this->fsize++;
+ 
+ 	/*clean-up*/
+ 	xDelete<int>(P);
+@@ -138,15 +115,12 @@
+ 
+ 	/*Get fsize*/
+ 	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+-	this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
+ 	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+ }
+ /*}}}*/
+ ElementVector::~ElementVector(){/*{{{*/
+-
+ 	xDelete<IssmDouble>(this->values);
+ 	xDelete<int>(this->gglobaldoflist);
+-	xDelete<int>(this->flocaldoflist);
+ 	xDelete<int>(this->fglobaldoflist);
+ }
+ /*}}}*/
+@@ -154,23 +128,11 @@
+ /*ElementVector specific routines: */
+ void ElementVector::AddToGlobal(Vector<IssmDouble>* pf){/*{{{*/
+ 
+-	int i;
+-	IssmDouble* localvalues=NULL;
+-
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+ 	if(this->fsize){
+-		/*first, retrieve values that are in the f-set from the g-set values vector: */
+-		localvalues=xNew<IssmDouble>(this->fsize);
+-		for(i=0;i<this->fsize;i++){
+-			localvalues[i]=this->values[this->flocaldoflist[i]];
+-		}
+-		/*add local values into global  vector, using the fglobaldoflist: */
+-		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,ADD_VAL);
+-
+-		/*Free ressources:*/
+-		xDelete<IssmDouble>(localvalues);
++		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+ 	}
+ 
+ }
+@@ -192,19 +154,14 @@
+ 
+ 	_printf_("Element Vector echo:\n");
+ 	_printf_("   nrows: " << nrows << "\n");
++	_printf_("   fsize: " << fsize << "\n");
+ 	_printf_("   values:\n");
+-	for(i=0;i<nrows;i++){
+-		_printf_(setw(4) << right << i << ": " << setw(10) << values[i] << "\n");
+-	}
++	for(i=0;i<nrows;i++) _printf_(setw(4) << right << i << ": " << setw(10) << values[i] << "\n");
+ 
+ 	_printf_("   gglobaldoflist (" << gglobaldoflist << "): ");
+ 	if(gglobaldoflist) for(i=0;i<nrows;i++) _printf_(" " << gglobaldoflist[i] );
+ 	_printf_(" \n");
+ 
+-	_printf_("   fsize: " << fsize << "\n");
+-	_printf_("   flocaldoflist  (" << flocaldoflist << "): ");
+-	if(flocaldoflist) for(i=0;i<fsize;i++) _printf_(" " << flocaldoflist[i] );
+-	_printf_(" \n");
+ 	_printf_("   fglobaldoflist (" << fglobaldoflist << "): ");
+ 	if(fglobaldoflist) for(i=0;i<fsize;i++) _printf_(" " << fglobaldoflist[i] );
+ 	_printf_(" \n");
+@@ -215,6 +172,7 @@
+ 	_assert_(pe);
+ 
+ 	this->nrows =pe->nrows;
++	this->fsize =pe->fsize;
+ 
+ 	this->values=xNew<IssmDouble>(this->nrows);
+ 	xMemCpy<IssmDouble>(this->values,pe->values,this->nrows);
+@@ -222,32 +180,15 @@
+ 	this->gglobaldoflist=xNew<int>(this->nrows);
+ 	xMemCpy<int>(this->gglobaldoflist,pe->gglobaldoflist,this->nrows);
+ 
+-	this->fsize=pe->fsize;
+-	if(this->fsize){
+-		this->flocaldoflist=xNew<int>(this->fsize);
+-		xMemCpy<int>(this->flocaldoflist,pe->flocaldoflist,this->fsize);
+-		this->fglobaldoflist=xNew<int>(this->fsize);
+-		xMemCpy<int>(this->fglobaldoflist,pe->fglobaldoflist,this->fsize);
+-	}
+-	else{
+-		this->flocaldoflist=NULL;
+-		this->fglobaldoflist=NULL;
+-	}
++	this->fglobaldoflist=xNew<int>(this->nrows);
++	xMemCpy<int>(this->fglobaldoflist,pe->fglobaldoflist,this->nrows);
+ }
+ /*}}}*/
+ void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/
+ 
+ 	if(this->fsize){
+-		/*first, retrieve values that are in the f-set from the g-set values vector: */
+-		IssmDouble* localvalues=xNew<IssmDouble>(this->fsize);
+-		for(int i=0;i<this->fsize;i++){
+-			localvalues[i]=this->values[this->flocaldoflist[i]];
+-		}
+ 		/*add local values into global  vector, using the fglobaldoflist: */
+-		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,INS_VAL);
+-
+-		/*Free ressources:*/
+-		xDelete<IssmDouble>(localvalues);
++		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,INS_VAL);
+ 	}
+ 
+ }
+@@ -279,7 +220,7 @@
+ 
+ 	/*Checks in debugging mode*/
+ 	_assert_(bsize>0 && bsize<this->nrows && this->values && Ke); 
+-	_assert_(Ke->nrows==Ke->ncols && this->nrows==Ke->nrows);
++	_assert_(this->nrows==Ke->nrows);
+ 
+ 	/*Intermediaries*/
+ 	int         counter,i,j,isize;
+@@ -316,8 +257,8 @@
+ 	Kbb = xNew<IssmDouble>(bsize*bsize);
+ 	Fb  = xNew<IssmDouble>(bsize);
+ 	Fi  = xNew<IssmDouble>(isize);
+-	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = Ke->values[iindices[i]*Ke->ncols + bindices[j]];
+-	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = Ke->values[bindices[i]*Ke->ncols + bindices[j]];
++	for(i=0;i<isize;i++) for(j=0;j<bsize;j++) Kib[i*bsize+j] = Ke->values[iindices[i]*Ke->nrows + bindices[j]];
++	for(i=0;i<bsize;i++) for(j=0;j<bsize;j++) Kbb[i*bsize+j] = Ke->values[bindices[i]*Ke->nrows + bindices[j]];
+ 	for(i=0;i<bsize;i++) Fb[i] = this->values[bindices[i]];
+ 	for(i=0;i<isize;i++) Fi[i] = this->values[iindices[i]];
+ 
+Index: ../trunk-jpl/src/c/classes/matrix/ElementVector.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 26130)
++++ ../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 26131)
+@@ -21,16 +21,11 @@
+ 
+ 	public:
+ 		int         nrows;
+-		IssmDouble* values;
++		int         fsize;
++		IssmDouble *values;
++		int        *gglobaldoflist;
++		int        *fglobaldoflist;
+ 
+-		//gset
+-		int* gglobaldoflist;
+-
+-		//fset
+-		int  fsize;
+-		int* flocaldoflist;
+-		int* fglobaldoflist;
+-
+ 		/*ElementVector constructors, destructors*/
+ 		ElementVector();
+ 		ElementVector(ElementVector* pe1,ElementVector* pe2);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26131-26132.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26131-26132.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26131-26132.diff	(revision 26740)
@@ -0,0 +1,125 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26131)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26132)
+@@ -2736,7 +2736,7 @@
+ 	_error_("not implemented yet");
+ 
+ 	/*Intermediaries*/
+-	IssmDouble  viscosity,Jdet;
++	IssmDouble  viscosity,Jdet,thickness,n;
+ 	IssmDouble *xyz_list = NULL;
+ 
+ 	/*Get element on base*/
+@@ -2747,13 +2747,16 @@
+ 
+ 	/*Initialize Element matrix and vectors*/
+ 	ElementMatrix* Ke     = basalelement->NewElementMatrix(MLHOApproximationEnum);
+-	IssmDouble*    dbasis = xNew<IssmDouble>(3*numnodes);
++	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes); // like SSA
++	IssmDouble*    basis  = xNew<IssmDouble>(numnodes); // like SSA
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+-	Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input);
+-	Input* vx_input      = element->GetInput(VxEnum);      _assert_(vx_input);
+-	Input* vy_input      = element->GetInput(VyEnum);      _assert_(vy_input);
++	Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
++	Input* surface_input  = element->GetInput(SurfaceEnum);   _assert_(surface_input);
++	Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input);
++	Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input);
++	Input* n_input			 = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss      = element->NewGauss(5);
+@@ -2763,23 +2766,71 @@
+ 
+ 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+ 		basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
++		element->NodalFunctions(basis, gauss);
+ 
++		thickness_input->GetInputValue(&thickness, gauss);
++		n_input->GetInputValue(&n,gauss);
+ 		element->material->ViscosityL1L2(&viscosity,xyz_list,gauss,vx_input,vy_input,surface_input);
+-
+-		for(int i=0;i<numnodes;i++){
++		
++		for(int i=0;i<numnodes;i++){//shape functions on tria element
+ 			for(int j=0;j<numnodes;j++){
+-				Ke->values[2*i*2*numnodes+2*j] += gauss->weight*Jdet*viscosity*(
++				Ke->values[(i+0)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+-							);
+-				Ke->values[2*i*2*numnodes+2*j+1] += gauss->weight*Jdet*viscosity*(
++							);//K11
++				Ke->values[(i+0)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
++							)*(n+1)/(n+2);//K12
++				Ke->values[(i+0)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+-							);
+-				Ke->values[(2*i+1)*2*numnodes+2*j] += gauss->weight*Jdet*viscosity*(
++							);//K13
++				Ke->values[(i+0)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++                     2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
++                     )*(n+1)/(n+2);//K14
++				
++				Ke->values[(i+3)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
++							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
++							)*(n+1)/(n+2);//K21
++				Ke->values[(i+3)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
++							)*2*pow(n+1,2)/((2*n+3)*(n+2)) 
++							+ 
++							gauss->weight*Jdet*viscosity*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
++							;//K22
++				Ke->values[(i+3)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
++							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
++							)*(n+1)/(n+2);//K23
++				Ke->values[(i+3)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
++							)*2*pow(n+1,2)/((2*n+3)*(n+2));//K24
++				
++				Ke->values[(i+6)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+-							);
+-				Ke->values[(2*i+1)*2*numnodes+2*j+1] += gauss->weight*Jdet*viscosity*(
+-							dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + 4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+-							);
++							);//K31
++				Ke->values[(i+6)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
++							)*(n+1)/(n+2);//K32
++				Ke->values[(i+6)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
++							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
++							);//K33
++				Ke->values[(i+6)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
++							)*(n+1)/(n+2);//K34
++
++				Ke->values[(i+9)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
++                     2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
++                     )*(n+1)/(n+2);//K41
++				Ke->values[(i+9)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++                     2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
++                     )*2*pow(n+1,2)/((2*n+3)*(n+2));//K42
++				Ke->values[(i+9)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
++							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
++							)*(n+1)/(n+2);//K43
++				Ke->values[(i+9)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
++							)*2*pow(n+1,2)/((2*n+3)*(n+2))
++							+ 
++							gauss->weight*Jdet*viscosity*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
++							;//K44
+ 			}
+ 		}
+ 	}
+@@ -2793,6 +2844,7 @@
+ 	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(dbasis);
++	xDelete<IssmDouble>(basis);
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* StressbalanceAnalysis::CreatePVectorMLHO(Element* element){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26132-26133.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26132-26133.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26132-26133.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26132)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26133)
+@@ -2885,7 +2885,7 @@
+ 	_error_("not implemented yet");
+ 
+ 	/*Intermediaries */
+-	IssmDouble  thickness,Jdet,slope[2];
++	IssmDouble  thickness,Jdet,slope[2],n;
+ 	IssmDouble* xyz_list = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+@@ -2899,6 +2899,7 @@
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	Input*     thickness_input=element->GetInput(ThicknessEnum); _assert_(thickness_input);
+ 	Input*     surface_input  =element->GetInput(SurfaceEnum);   _assert_(surface_input);
++	Input*     n_input        =element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+ 	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+@@ -2909,10 +2910,13 @@
+ 
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
++		n_input->GetInputValue(&n,gauss);
+ 
+ 		for(int i=0;i<numnodes;i++){
+-			pe->values[i*2+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i];
+-			pe->values[i*2+1]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i];
++			pe->values[i+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
++			pe->values[i+3]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
++			pe->values[i+6]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]; //F3
++			pe->values[i+9]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F4
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26133-26134.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26133-26134.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26133-26134.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26133)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26134)
+@@ -2726,10 +2726,22 @@
+ 
+ 	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+ 	Element* basalelement = element->SpawnBasalElement();
+-	ElementMatrix* Ke = CreateKMatrixSSAFriction(basalelement);
++	ElementMatrix* Ke    = basalelement->NewElementMatrix(MLHOApproximationEnum);
++	ElementMatrix* KeSSA = CreateKMatrixSSAFriction(basalelement); //only to get K11 and K33
++	
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = basalelement->GetNumberOfNodes();
+ 
++	for(int i=0;i<numnodes;i++){
++      for(int j=0;j<numnodes;j++){
++         Ke->values[(i+0)*2*2*numnodes+j+0] = KeSSA->values[2*i*2*numnodes+2*j]; //K11
++         Ke->values[(i+6)*2*2*numnodes+j+6] = KeSSA->values[(2*i+1)*2*numnodes+2*j+1]; //K33
++      }  
++   }
++
+ 	/*clean-up and return*/
+ 	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++	delete KeSSA;
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOViscous(Element* element){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26134-26135.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26134-26135.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26134-26135.diff	(revision 26740)
@@ -0,0 +1,71 @@
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h	(revision 26134)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h	(revision 26135)
+@@ -229,10 +229,22 @@
+ 			int i,j;
+ 			switch(mode){
+ 				case ADD_VAL:
+-					for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]+=values[n*i+j];
++					for(i=0;i<m;i++){
++						if(idxm[i]<0) continue;
++						for(j=0;j<n;j++){
++							if(idxn[j]<0) continue;
++							this->matrix[N*idxm[i]+idxn[j]]+=values[n*i+j];
++						}
++					}
+ 					break;
+ 				case INS_VAL:
+-					for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
++					for(i=0;i<m;i++){
++						if(idxm[i]<0) continue;
++						for(j=0;j<n;j++){
++							if(idxn[j]<0) continue;
++							this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
++						}
++					}
+ 					break;
+ 				default:
+ 					_error_("unknown insert mode!");
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26134)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26135)
+@@ -100,10 +100,10 @@
+ 			int i;
+ 			switch(mode){
+ 				case ADD_VAL:
+-					for(i=0;i<ssize;i++) this->vector[list[i]]+=values[i];
++					for(i=0;i<ssize;i++) if(list[i]>=0) this->vector[list[i]]+=values[i];
+ 					break;
+ 				case INS_VAL:
+-					for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
++					for(i=0;i<ssize;i++) if(list[i]>=0) this->vector[list[i]]=values[i];
+ 					break;
+ 				default:
+ 					_error_("unknown insert mode!");
+@@ -112,8 +112,10 @@
+ 
+ 		}
+ 		/*}}}*/
+-		void SetValue(int dof, doubletype value, InsMode mode){/*{{{*/
++		void SetValue(int dof, doubletype value,InsMode mode){/*{{{*/
+ 
++			_assert_(dof>=0);
++
+ 			switch(mode){
+ 				case ADD_VAL:
+ 					this->vector[dof]+=value;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26134)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26135)
+@@ -2339,7 +2339,7 @@
+ 			values[i]=0;
+ 		}
+ 		else{
+-			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness)*(upperdepthmelt-base[i]);
++			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness);//*(upperdepthmelt-base[i]);
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26135-26136.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26135-26136.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26135-26136.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/c/classes/Node.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.cpp	(revision 26135)
++++ ../trunk-jpl/src/c/classes/Node.cpp	(revision 26136)
+@@ -226,12 +226,8 @@
+ 		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->gsize);
+ 		output->fdoflist_local=xNew<int>(output->gsize);
+-	}
+-	if(output->ssize>0){
+ 		output->sdoflist=xNew<int>(output->gsize);
+ 		output->sdoflist_local=xNew<int>(output->gsize);
+ 	}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26136-26137.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26136-26137.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26136-26137.diff	(revision 26740)
@@ -0,0 +1,88 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26136)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26137)
+@@ -2554,7 +2554,7 @@
+ 	if(!element->IsIcefront()) return NULL;
+ 
+ 	/*Intermediaries*/
+-	IssmDouble  Jdet,thickness,bed,sealevel,water_pressure,ice_pressure;
++	IssmDouble  Jdet,thickness,base,sealevel,water_pressure,ice_pressure;
+ 	IssmDouble  surface_under_water,base_under_water,pressure;
+ 	IssmDouble *xyz_list = NULL;
+ 	IssmDouble *xyz_list_front = NULL;
+@@ -2582,13 +2582,13 @@
+ 	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_front,3);
+ 	while(gauss->next()){
+ 		thickness_input->GetInputValue(&thickness,gauss);
+-		base_input->GetInputValue(&bed,gauss);
++		base_input->GetInputValue(&base,gauss);
+ 		sealevel_input->GetInputValue(&sealevel,gauss);
+ 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
+ 		element->NodalFunctions(basis,gauss);
+ 
+-		surface_under_water = min(0.,thickness+bed-sealevel); // 0 if the top of the glacier is above water level
+-		base_under_water    = min(0.,bed-sealevel);           // 0 if the bottom of the glacier is above water level
++		surface_under_water = min(0.,thickness+base-sealevel); // 0 if the top of the glacier is above water level
++		base_under_water    = min(0.,base-sealevel);           // 0 if the bottom of the glacier is above water level
+ 		water_pressure = 1.0/2.0*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
+ 		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
+ 		pressure = ice_pressure + water_pressure;
+@@ -2948,7 +2948,8 @@
+ 	if(!element->IsIcefront()) return NULL;
+ 
+ 	/*Intermediaries*/
+-	IssmDouble  Jdet,thickness,bed,sealevel,water_pressure,ice_pressure;
++	IssmDouble  Jdet,thickness,base,sealevel,water_pressure,ice_pressure;
++	IssmDouble  water_pressure_sh,ice_pressure_sh,pressure_sh,n,s,b;
+ 	IssmDouble  surface_under_water,base_under_water,pressure;
+ 	IssmDouble *xyz_list = NULL;
+ 	IssmDouble *xyz_list_front = NULL;
+@@ -2963,8 +2964,9 @@
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+-	Input* base_input       = element->GetInput(BaseEnum);       _assert_(base_input);
+-	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
++	Input* base_input      = element->GetInput(BaseEnum);       _assert_(base_input);
++	Input* sealevel_input  = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
++	Input* n_input         = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+ 	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+ 	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+ 	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
+@@ -2976,20 +2978,30 @@
+ 	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_front,3);
+ 	while(gauss->next()){
+ 		thickness_input->GetInputValue(&thickness,gauss);
+-		base_input->GetInputValue(&bed,gauss);
++		base_input->GetInputValue(&base,gauss);
++		n_input->GetInputValue(&n,gauss);
+ 		sealevel_input->GetInputValue(&sealevel,gauss);
+ 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
+ 		element->NodalFunctions(basis,gauss);
+ 
+-		surface_under_water = min(0.,thickness+bed-sealevel); // 0 if the top of the glacier is above water level
+-		base_under_water    = min(0.,bed-sealevel);           // 0 if the bottom of the glacier is above water level
++		surface_under_water = min(0.,thickness+base-sealevel); // 0 if the top of the glacier is above water level
++		base_under_water    = min(0.,base-sealevel);           // 0 if the bottom of the glacier is above water level
++		/*Vertically integrated pressure - SSA type*/
+ 		water_pressure = 1.0/2.0*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
+ 		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
+ 		pressure = ice_pressure + water_pressure;
++		/*Vertically integrated pressure - HO type*/
++		s=max(0.,thickness+base-sealevel);
++		b=min(0.,base-sealevel); 
++		water_pressure_sh = gravity*rho_water*(-b*b/2 + pow(-b,n+2)*( -s/(n+2) -b/(n+3) )/pow(thickness,n+1));
++		ice_pressure_sh   = gravity*rho_ice*thickness*thickness*(n+1)/(2*(n+3));
++		pressure_sh = ice_pressure_sh + water_pressure_sh;
+ 
+ 		for (int i=0;i<numnodes;i++){
+-			pe->values[2*i+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i];
+-			pe->values[2*i+1]+= pressure*Jdet*gauss->weight*normal[1]*basis[i];
++			pe->values[i+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i]; // F1
++			pe->values[i+3]+= pressure_sh*Jdet*gauss->weight*normal[0]*basis[i]; // F2
++			pe->values[i+6]+= pressure*Jdet*gauss->weight*normal[1]*basis[i]; // F3
++			pe->values[i+9]+= pressure_sh*Jdet*gauss->weight*normal[1]*basis[i]; // F4
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26137-26138.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26137-26138.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26137-26138.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26137)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26138)
+@@ -2339,7 +2339,7 @@
+ 			values[i]=0;
+ 		}
+ 		else{
+-			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness);//*(upperdepthmelt-base[i]);
++			values[i]=meltratefactor[i]*tanh((base[i]-bed[i])/thresholdthickness)*(upperdepthmelt-base[i]);
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26138-26139.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26138-26139.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26138-26139.diff	(revision 26740)
@@ -0,0 +1,479 @@
+Index: ../trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw/CMakeLists.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw/CMakeLists.txt	(revision 26138)
++++ ../trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw/CMakeLists.txt	(nonexistent)
+@@ -1,450 +0,0 @@
+-cmake_minimum_required(VERSION 2.8.12)
+-
+-project(LAPACK Fortran C)
+-
+-set(LAPACK_MAJOR_VERSION 3)
+-set(LAPACK_MINOR_VERSION 9)
+-set(LAPACK_PATCH_VERSION 0)
+-set(
+-  LAPACK_VERSION
+-  ${LAPACK_MAJOR_VERSION}.${LAPACK_MINOR_VERSION}.${LAPACK_PATCH_VERSION}
+-  )
+-
+-# Add the CMake directory for custon CMake modules
+-set(CMAKE_MODULE_PATH "${LAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
+-
+-# Export all symbols on Windows when building shared libraries
+-SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+-
+-# Set a default build type if none was specified
+-if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+-  message(STATUS "Setting build type to 'Release' as none was specified.")
+-  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
+-  # Set the possible values of build type for cmake-gui
+-  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "Coverage")
+-endif()
+-
+-# Coverage
+-set(_is_coverage_build 0)
+-set(_msg "Checking if build type is 'Coverage'")
+-message(STATUS "${_msg}")
+-if(NOT CMAKE_CONFIGURATION_TYPES)
+-  string(TOLOWER ${CMAKE_BUILD_TYPE} _build_type_lc)
+-  if(${_build_type_lc} STREQUAL "coverage")
+-    set(_is_coverage_build 1)
+-  endif()
+-endif()
+-message(STATUS "${_msg}: ${_is_coverage_build}")
+-
+-if(_is_coverage_build)
+-  message(STATUS "Adding coverage")
+-  find_package(codecov)
+-endif()
+-
+-# By default static library
+-option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
+-
+-include(GNUInstallDirs)
+-
+-# Updated OSX RPATH settings
+-# In response to CMake 3.0 generating warnings regarding policy CMP0042,
+-# the OSX RPATH settings have been updated per recommendations found
+-# in the CMake Wiki:
+-#  http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH
+-set(CMAKE_MACOSX_RPATH ON)
+-set(CMAKE_SKIP_BUILD_RPATH FALSE)
+-set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+-list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${CMAKE_INSTALL_FULL_LIBDIR} isSystemDir)
+-if("${isSystemDir}" STREQUAL "-1")
+-  set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
+-  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+-endif()
+-
+-
+-# Configure the warning and code coverage suppression file
+-configure_file(
+-  "${LAPACK_SOURCE_DIR}/CTestCustom.cmake.in"
+-  "${LAPACK_BINARY_DIR}/CTestCustom.cmake"
+-  @ONLY
+-)
+-
+-include(PreventInSourceBuilds)
+-include(PreventInBuildInstalls)
+-
+-if(UNIX)
+-  if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
+-    list(APPEND CMAKE_Fortran_FLAGS -fp-model strict)
+-  endif()
+-  if(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
+-    list(APPEND CMAKE_Fortran_FLAGS -qnosave -qstrict=none)
+-  endif()
+-# Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler.
+-# This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin
+-  string(REPLACE \;mtsk\; \; CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}")
+-endif()
+-
+-if(CMAKE_Fortran_COMPILER_ID STREQUAL Compaq)
+-  if(WIN32)
+-    if(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
+-      get_filename_component(CMAKE_Fortran_COMPILER_CMDNAM ${CMAKE_Fortran_COMPILER} NAME_WE)
+-      message(STATUS "Using Compaq Fortran compiler with command name ${CMAKE_Fortran_COMPILER_CMDNAM}")
+-      set(cmd ${CMAKE_Fortran_COMPILER_CMDNAM})
+-      string(TOLOWER "${cmd}" cmdlc)
+-      if(cmdlc STREQUAL "df")
+-        message(STATUS "Assume the Compaq Visual Fortran Compiler is being used")
+-        set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+-        set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+-        #This is a workaround that is needed to avoid forward-slashes in the
+-        #filenames listed in response files from incorrectly being interpreted as
+-        #introducing compiler command options
+-        if(${BUILD_SHARED_LIBS})
+-          message(FATAL_ERROR "Making of shared libraries with CVF has not been tested.")
+-        endif()
+-        set(str "NMake version 9 or later should be used. NMake version 6.0 which is\n")
+-        set(str "${str}   included with the CVF distribution fails to build Lapack because\n")
+-        set(str "${str}   the number of source files exceeds the limit for NMake v6.0\n")
+-        message(STATUS ${str})
+-        set(CMAKE_Fortran_LINK_EXECUTABLE "LINK /out:<TARGET> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS>")
+-      endif()
+-    endif()
+-  endif()
+-endif()
+-
+-
+-# --------------------------------------------------
+-set(LAPACK_INSTALL_EXPORT_NAME lapack-targets)
+-
+-macro(lapack_install_library lib)
+-  install(TARGETS ${lib}
+-    EXPORT ${LAPACK_INSTALL_EXPORT_NAME}
+-    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
+-    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
+-    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries
+-  )
+-endmacro()
+-
+-set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+-
+-# --------------------------------------------------
+-# Testing
+-option(BUILD_TESTING "Build tests" ${_is_coverage_build})
+-include(CTest)
+-message(STATUS "Build tests: ${BUILD_TESTING}")
+-
+-# lapack_testing.py uses features from python 2.7 and greater
+-if(BUILD_TESTING)
+-  set(_msg "Looking for Python >= 2.7 needed for summary tests")
+-  message(STATUS "${_msg}")
+-  find_package(PythonInterp 2.7 QUIET)
+-  if(PYTHONINTERP_FOUND)
+-    message(STATUS "${_msg} - found (${PYTHON_VERSION_STRING})")
+-  else()
+-    message(STATUS "${_msg} - not found (skipping summary tests)")
+-  endif()
+-endif()
+-
+-# --------------------------------------------------
+-# Organize output files.  On Windows this also keeps .dll files next
+-# to the .exe files that need them, making tests easy to run.
+-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/bin)
+-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/lib)
+-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LAPACK_BINARY_DIR}/lib)
+-
+-# --------------------------------------------------
+-# Check for any necessary platform specific compiler flags
+-include(CheckLAPACKCompilerFlags)
+-CheckLAPACKCompilerFlags()
+-
+-# --------------------------------------------------
+-# Check second function
+-
+-include(CheckTimeFunction)
+-set(TIME_FUNC NONE ${TIME_FUNC})
+-CHECK_TIME_FUNCTION(NONE TIME_FUNC)
+-CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
+-CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
+-CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
+-CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
+-message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
+-
+-set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
+-set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
+-
+-# deprecated LAPACK and LAPACKE routines
+-option(BUILD_DEPRECATED "Build deprecated routines" OFF)
+-message(STATUS "Build deprecated routines: ${BUILD_DEPRECATED}")
+-
+-# --------------------------------------------------
+-# Precision to build
+-# By default all precisions are generated
+-option(BUILD_SINGLE "Build single precision real" ON)
+-option(BUILD_DOUBLE "Build double precision real" ON)
+-option(BUILD_COMPLEX "Build single precision complex" ON)
+-option(BUILD_COMPLEX16 "Build double precision complex" ON)
+-message(STATUS "Build single precision real: ${BUILD_SINGLE}")
+-message(STATUS "Build double precision real: ${BUILD_DOUBLE}")
+-message(STATUS "Build single precision complex: ${BUILD_COMPLEX}")
+-message(STATUS "Build double precision complex: ${BUILD_COMPLEX16}")
+-
+-if(NOT (BUILD_SINGLE OR BUILD_DOUBLE OR BUILD_COMPLEX OR BUILD_COMPLEX16))
+-  message(FATAL_ERROR "Nothing to build, no precision selected.
+-  Please enable at least one of these:
+-  BUILD_SINGLE, BUILD_DOUBLE, BUILD_COMPLEX, BUILD_COMPLEX16.")
+-endif()
+-
+-# --------------------------------------------------
+-# Subdirectories that need to be processed
+-option(USE_OPTIMIZED_BLAS "Whether or not to use an optimized BLAS library instead of included netlib BLAS" OFF)
+-
+-# Check the usage of the user provided BLAS libraries
+-if(BLAS_ROOT)
+-  include(CheckFortranFunctionExists)
+-  set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "msys-" "")
+-  set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
+-  find_library(BLAS blas PATHS ${BLAS_ROOT}/lib)
+-  set(CMAKE_REQUIRED_LIBRARIES ${BLAS})
+-  CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND)
+-  unset(CMAKE_REQUIRED_LIBRARIES)
+-  if(BLAS_FOUND)
+-    message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS}.")
+-    set(BLAS_LIBRARIES blas)
+-  else()
+-    message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS}.")
+-    message(ERROR "-->     Will use REFERENCE BLAS (by default)")
+-    message(ERROR "-->     Or Correct your BLAS_LIBRARIES entry ")
+-    message(ERROR "-->     Or Consider checking USE_OPTIMIZED_BLAS")
+-  endif()
+-
+-# User did not provide a BLAS Library but specified to search for one
+-elseif(USE_OPTIMIZED_BLAS)
+-  find_package(BLAS)
+-endif()
+-
+-# Neither user specified or optimized BLAS libraries can be used
+-if(NOT BLAS_FOUND)
+-  message(STATUS "Using supplied NETLIB BLAS implementation")
+-  add_subdirectory(BLAS)
+-  set(BLAS_LIBRARIES blas)
+-else()
+-  set(CMAKE_EXE_LINKER_FLAGS
+-    "${CMAKE_EXE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
+-    CACHE STRING "Linker flags for executables" FORCE)
+-  set(CMAKE_MODULE_LINKER_FLAGS
+-    "${CMAKE_MODULE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
+-    CACHE STRING "Linker flags for modules" FORCE)
+-  set(CMAKE_SHARED_LINKER_FLAGS
+-    "${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
+-    CACHE STRING "Linker flags for shared libs" FORCE)
+-endif()
+-
+-
+-# --------------------------------------------------
+-# CBLAS
+-option(CBLAS "Build CBLAS" OFF)
+-
+-if(CBLAS)
+-  add_subdirectory(CBLAS)
+-endif()
+-
+-# --------------------------------------------------
+-# XBLAS
+-
+-option(USE_XBLAS "Build extended precision (needs XBLAS)" OFF)
+-if(USE_XBLAS)
+-  find_library(XBLAS_LIBRARY NAMES xblas)
+-endif()
+-
+-option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF)
+-
+-# --------------------------------------------------
+-# LAPACK
+-# User did not provide a LAPACK Library but specified to search for one
+-if(USE_OPTIMIZED_LAPACK)
+-  find_package(LAPACK)
+-endif()
+-
+-# Check the usage of the user provided or automatically found LAPACK libraries
+-if(LAPACK_LIBRARIES)
+-  include(CheckFortranFunctionExists)
+-  set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
+-  # Check if new routine of 3.4.0 is in LAPACK_LIBRARIES
+-  CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LATESTLAPACK_FOUND)
+-  unset(CMAKE_REQUIRED_LIBRARIES)
+-  if(LATESTLAPACK_FOUND)
+-    message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
+-  else()
+-    message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0, CANNOT USE ${LAPACK_LIBRARIES}.")
+-    message(ERROR "-->     Will use REFERENCE LAPACK (by default)")
+-    message(ERROR "-->     Or Correct your LAPACK_LIBRARIES entry ")
+-    message(ERROR "-->     Or Consider checking USE_OPTIMIZED_LAPACK")
+-  endif()
+-endif()
+-
+-# Neither user specified or optimized LAPACK libraries can be used
+-if(NOT LATESTLAPACK_FOUND)
+-  message(STATUS "Using supplied NETLIB LAPACK implementation")
+-  set(LAPACK_LIBRARIES lapack)
+-  add_subdirectory(SRC)
+-else()
+-  set(CMAKE_EXE_LINKER_FLAGS
+-    "${CMAKE_EXE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
+-    CACHE STRING "Linker flags for executables" FORCE)
+-  set(CMAKE_MODULE_LINKER_FLAGS
+-    "${CMAKE_MODULE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
+-    CACHE STRING "Linker flags for modules" FORCE)
+-  set(CMAKE_SHARED_LINKER_FLAGS
+-    "${CMAKE_SHARED_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
+-    CACHE STRING "Linker flags for shared libs" FORCE)
+-endif()
+-
+-if(BUILD_TESTING)
+-  add_subdirectory(TESTING)
+-endif()
+-
+-# --------------------------------------------------
+-# LAPACKE
+-option(LAPACKE "Build LAPACKE" OFF)
+-
+-# LAPACKE has also the interface to some routines from tmglib,
+-# if LAPACKE_WITH_TMG is selected, we need to add those routines to LAPACKE
+-option(LAPACKE_WITH_TMG "Build LAPACKE with tmglib routines" OFF)
+-if(LAPACKE_WITH_TMG)
+-  set(LAPACKE ON)
+-endif()
+-if(BUILD_TESTING OR LAPACKE_WITH_TMG) #already included, avoid double inclusion
+-  add_subdirectory(TESTING/MATGEN)
+-endif()
+-
+-if(LAPACKE)
+-  add_subdirectory(LAPACKE)
+-endif()
+-
+-#-------------------------------------
+-# BLAS++ / LAPACK++
+-option(BLAS++ "Build BLAS++" OFF)
+-option(LAPACK++ "Build LAPACK++" OFF)
+- 
+- 
+-function(_display_cpp_implementation_msg name)
+-  string(TOLOWER ${name} name_lc)
+-  message(STATUS "${name}++ enable")
+-  message(STATUS "----------------")
+-  message(STATUS "Thank you for your interest in ${name}++, a newly developed C++ API for ${name} library")
+-  message(STATUS "The objective of ${name}++ is to provide a convenient, performance oriented API for development in the C++ language, that, for the most part, preserves established conventions, while, at the same time, takes advantages of modern C++ features, such as: namespaces, templates, exceptions, etc.")
+-  message(STATUS "We are still working on integrating ${name}++ in our library. For the moment, you can download directly ${name_lc}++ from https://bitbucket.org/icl/${name_lc}pp")
+-  message(STATUS "For support ${name}++ related question, please email: slate-user@icl.utk.edu")
+-  message(STATUS "----------------")
+-endfunction()
+-if(BLAS++)
+-  _display_cpp_implementation_msg("BLAS")
+-endif()
+-if(LAPACK++)
+-  _display_cpp_implementation_msg("LAPACK")
+-endif()
+-
+-# --------------------------------------------------
+-# CPACK Packaging
+-
+-set(CPACK_PACKAGE_NAME "LAPACK")
+-set(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
+-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LAPACK- Linear Algebra Package")
+-set(CPACK_PACKAGE_VERSION_MAJOR ${LAPACK_MAJOR_VERSION})
+-set(CPACK_PACKAGE_VERSION_MINOR ${LAPACK_MINOR_VERSION})
+-set(CPACK_PACKAGE_VERSION_PATCH ${LAPACK_PATCH_VERSION})
+-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
+-set(CPACK_MONOLITHIC_INSTALL ON)
+-set(CPACK_PACKAGE_INSTALL_DIRECTORY "LAPACK")
+-if(WIN32 AND NOT UNIX)
+-  # There is a bug in NSI that does not handle full unix paths properly. Make
+-  # sure there is at least one set of four (4) backlasshes.
+-  set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
+-  set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/lapack")
+-  set(CPACK_NSIS_CONTACT "lapack@eecs.utk.edu")
+-  set(CPACK_NSIS_MODIFY_PATH ON)
+-  set(CPACK_NSIS_DISPLAY_NAME "LAPACK-${LAPACK_VERSION}")
+-  set(CPACK_PACKAGE_RELOCATABLE "true")
+-else()
+-  set(CPACK_GENERATOR "TGZ")
+-  set(CPACK_SOURCE_GENERATOR TGZ)
+-  set(CPACK_SOURCE_PACKAGE_FILE_NAME "lapack-${LAPACK_VERSION}")
+-  set(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES})
+-endif()
+-include(CPack)
+-
+-
+-# --------------------------------------------------
+-
+-if(NOT BLAS_FOUND)
+-  set(ALL_TARGETS ${ALL_TARGETS} blas)
+-endif()
+-
+-if(NOT LATESTLAPACK_FOUND)
+-  set(ALL_TARGETS ${ALL_TARGETS} lapack)
+-endif()
+-
+-if(BUILD_TESTING OR LAPACKE_WITH_TMG)
+-  set(ALL_TARGETS ${ALL_TARGETS} tmglib)
+-endif()
+-
+-# Export lapack targets, not including lapacke, from the
+-# install tree, if any.
+-set(_lapack_config_install_guard_target "")
+-if(ALL_TARGETS)
+-  install(EXPORT lapack-targets
+-    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION}
+-    COMPONENT Development
+-    )
+-
+-  # Choose one of the lapack targets to use as a guard for
+-  # lapack-config.cmake to load targets from the install tree.
+-  list(GET ALL_TARGETS 0 _lapack_config_install_guard_target)
+-endif()
+-
+-# Include cblas in targets exported from the build tree.
+-if(CBLAS)
+-  set(ALL_TARGETS ${ALL_TARGETS} cblas)
+-endif()
+-
+-# Include lapacke in targets exported from the build tree.
+-if(LAPACKE)
+-  set(ALL_TARGETS ${ALL_TARGETS} lapacke)
+-endif()
+-
+-# Export lapack and lapacke targets from the build tree, if any.
+-set(_lapack_config_build_guard_target "")
+-if(ALL_TARGETS)
+-  export(TARGETS ${ALL_TARGETS} FILE lapack-targets.cmake)
+-
+-  # Choose one of the lapack or lapacke targets to use as a guard
+-  # for lapack-config.cmake to load targets from the build tree.
+-  list(GET ALL_TARGETS 0 _lapack_config_build_guard_target)
+-endif()
+-
+-configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-build.cmake.in
+-  ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)
+-
+-
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc @ONLY)
+-  install(FILES
+-  ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc
+-  DESTINATION ${PKG_CONFIG_DIR}
+-  COMPONENT Development
+-  )
+-
+-configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
+-  ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
+-
+-include(CMakePackageConfigHelpers)
+-write_basic_package_version_file(
+-  ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
+-  VERSION ${LAPACK_VERSION}
+-  COMPATIBILITY SameMajorVersion
+-  )
+-
+-install(FILES
+-  ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake
+-  ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
+-  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION}
+-  COMPONENT Development
+-  )
+-  
+Index: ../trunk-jpl/jenkins/ross-debian_linux-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 26138)
++++ ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 26139)
+@@ -45,7 +45,6 @@
+ 	gsl				install.sh
+ 	boost			install-1.7-linux.sh
+ 	dakota			install-6.2-linux.sh
+-	boost			install-1.7-linux.sh
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+ 	proj			install-6.2.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26138)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26139)
+@@ -43,7 +43,6 @@
+ 	gsl				install.sh
+ 	boost			install-1.7-linux.sh
+ 	dakota			install-6.2-linux.sh
+-	boost			install-1.7-linux.sh
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+ 	proj			install-6.2.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26139-26140.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26139-26140.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26139-26140.diff	(revision 26740)
@@ -0,0 +1,195 @@
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26139)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26140)
+@@ -90,18 +90,17 @@
+ deps = $(MATHLIB)
+ 
+ #Triangle library
+-TRI_CXXFLAGS = -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
++CXXFLAGS_FOR_TRI = -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER
+ 
+ #Matlab part
+-MEX_CXXFLAGS = -D_HAVE_MATLAB_MODULES_ $(MEXOPTFLAGS) $(MEXCXXFLAGS)
+-MEX_CPPFLAGS = $(MATLABINCL)
+-MEX_LDFLAGS = -module -shrext $(MEXEXT) -no-undefined
+-MEX_LIBADD = $(MEXLINKFLAGS) $(MEXLIB)
++CXXFLAGS_FOR_MEX = -D_HAVE_MATLAB_MODULES_ $(MEXOPTFLAGS) $(MEXCXXFLAGS)
++CPPFLAGS_FOR_MEX = $(MATLABINCL)
++LDFLAGS_FOR_MEX = -module -shrext $(MEXEXT) -no-undefined
++LIBADD_FOR_MEX = $(MEXLINKFLAGS) $(MEXLIB)
+ 
+-AM_CPPFLAGS += ${MEX_CPPFLAGS}
+-AM_CXXFLAGS = ${TRI_CXXFLAGS} ${MEX_CXXFLAGS}
+-AM_LDFLAGS = ${MEX_LDFLAGS}
+-AM_LIBADD = ${MEX_LIBADD}
++AM_CPPFLAGS += ${CXXFLAGS_FOR_MEX}
++AM_CXXFLAGS = ${CXXFLAGS_FOR_TRI} ${CPPFLAGS_FOR_MEX}
++AM_LDFLAGS = ${LDFLAGS_FOR_MEX}
+ 
+ if !MSYS2
+ AM_LDFLAGS += --export-dynamic -rdynamic
+@@ -146,8 +145,7 @@
+ deps += $(FLIBS) $(FORTRANLIB)
+ endif
+ 
+-# #MEXLIB needs to be the last (undefined references on larsen)
+-# deps += ${MEXLIB}
++deps += ${LIBADD_FOR_MEX}
+ 
+ #Optimization flags:
+ AM_CXXFLAGS += $(CXXOPTFLAGS)
+@@ -168,7 +166,7 @@
+ if STANDALONE_LIBRARIES
+ libISSMMatlab_la_LDFLAGS += -static
+ libISSMApi_la_LDFLAGS += -static
+-deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(NEOPZLIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
++deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(NEOPZLIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS) ${LIBADD_FOR_MEX}
+ endif
+ 
+ if !WINDOWS
+@@ -176,116 +174,88 @@
+ endif
+ 
+ BamgConvertMesh_matlab_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp
+-BamgConvertMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgConvertMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++BamgConvertMesh_matlab_la_LIBADD = ${deps}
+ 
+ BamgMesher_matlab_la_SOURCES = ../BamgMesher/BamgMesher.cpp
+-BamgMesher_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgMesher_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++BamgMesher_matlab_la_LIBADD = ${deps}
+ 
+ BamgTriangulate_matlab_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp
+-BamgTriangulate_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgTriangulate_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++BamgTriangulate_matlab_la_LIBADD = ${deps}
+ 
+ if CHACO
+ Chaco_matlab_la_SOURCES = ../Chaco/Chaco.cpp
+-Chaco_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Chaco_matlab_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++Chaco_matlab_la_LIBADD = ${deps} $(CHACOLIB)
+ endif
+ 
+ ContourToMesh_matlab_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp
+-ContourToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ContourToMesh_matlab_la_LIBADD = ${deps}
+ 
+ ContourToNodes_matlab_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp
+-ContourToNodes_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToNodes_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ContourToNodes_matlab_la_LIBADD = ${deps}
+ 
+ CoordTransform_matlab_la_SOURCES = ../CoordTransform/CoordTransform.cpp
+-CoordTransform_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-CoordTransform_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++CoordTransform_matlab_la_LIBADD = ${deps}
+ 
+ DistanceToMaskBoundary_matlab_la_SOURCES = ../DistanceToMaskBoundary/DistanceToMaskBoundary.cpp
+-DistanceToMaskBoundary_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-DistanceToMaskBoundary_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++DistanceToMaskBoundary_matlab_la_LIBADD = ${deps}
+ 
+ ElementConnectivity_matlab_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp
+-ElementConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ElementConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ElementConnectivity_matlab_la_LIBADD = ${deps}
+ 
+ ExpToLevelSet_matlab_la_SOURCES = ../ExpToLevelSet/ExpToLevelSet.cpp
+-ExpToLevelSet_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ExpToLevelSet_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ExpToLevelSet_matlab_la_LIBADD = ${deps}
+ 
+ ExpSimplify_matlab_la_SOURCES = ../ExpSimplify/ExpSimplify.cpp
+-ExpSimplify_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ExpSimplify_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(NEOPZLIB)
++ExpSimplify_matlab_la_LIBADD = ${deps}
+ 
+ InterpFromGridToMesh_matlab_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp
+-InterpFromGridToMesh_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromGridToMesh_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromGridToMesh_matlab_la_LIBADD = ${deps}
+ 
+ InterpFromMesh2d_matlab_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp
+-InterpFromMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMesh2d_matlab_la_LIBADD = ${deps}
+ 
+ InterpFromMeshToGrid_matlab_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
+-InterpFromMeshToGrid_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToGrid_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMeshToGrid_matlab_la_LIBADD = ${deps}
+ 
+ InterpFromMeshToMesh2d_matlab_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
+-InterpFromMeshToMesh2d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMeshToMesh2d_matlab_la_LIBADD = ${deps}
+ 
+ InterpFromMeshToMesh3d_matlab_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+-InterpFromMeshToMesh3d_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++InterpFromMeshToMesh3d_matlab_la_LIBADD = ${deps}
+ 
+ IssmConfig_matlab_la_SOURCES = ../IssmConfig/IssmConfig.cpp
+-IssmConfig_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-IssmConfig_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB)
++IssmConfig_matlab_la_LIBADD = ${deps}
+ 
+ Kriging_matlab_la_SOURCES = ../Kriging/Kriging.cpp
+-Kriging_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Kriging_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJLIB)
++Kriging_matlab_la_LIBADD = ${deps}
+ 
+ M1qn3_matlab_la_SOURCES = ../M1qn3/M1qn3.cpp
+-M1qn3_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-M1qn3_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(M1QN3LIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++M1qn3_matlab_la_LIBADD = ${deps}
+ 
+ MeshPartition_matlab_la_SOURCES = ../MeshPartition/MeshPartition.cpp
+-MeshPartition_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshPartition_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(METISLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++MeshPartition_matlab_la_LIBADD = ${deps}
+ 
+ MeshProfileIntersection_matlab_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp
+-MeshProfileIntersection_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshProfileIntersection_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++MeshProfileIntersection_matlab_la_LIBADD = ${deps}
+ 
+ NodeConnectivity_matlab_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp
+-NodeConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-NodeConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++NodeConnectivity_matlab_la_LIBADD = ${deps}
+ 
+ PointCloudFindNeighbors_matlab_la_SOURCES = ../PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
+-PointCloudFindNeighbors_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-PointCloudFindNeighbors_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++PointCloudFindNeighbors_matlab_la_LIBADD = ${deps}
+ 
+ PropagateFlagsFromConnectivity_matlab_la_SOURCES = ../PropagateFlagsFromConnectivity/PropagateFlagsFromConnectivity.cpp
+-PropagateFlagsFromConnectivity_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++PropagateFlagsFromConnectivity_matlab_la_LIBADD = ${deps}
+ 
+ Scotch_matlab_la_SOURCES = ../Scotch/Scotch.cpp
+-Scotch_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Scotch_matlab_la_LIBADD = ${deps}  $(PETSCLIB) $(HDF5LIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(BLASLAPACKLIB)
++Scotch_matlab_la_LIBADD = ${deps}
+ 
+ ShpRead_matlab_la_SOURCES = ../ShpRead/ShpRead.cpp
+-ShpRead_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ShpRead_matlab_la_LIBADD = ${deps} $(SHAPELIBLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ShpRead_matlab_la_LIBADD = ${deps} $(SHAPELIBLIB)
+ 
+ Triangle_matlab_la_SOURCES = ../Triangle/Triangle.cpp
+-Triangle_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++Triangle_matlab_la_LIBADD = ${deps} $(TRIANGLELIB)
+ 
+ ProcessRifts_matlab_la_SOURCES = ../ProcessRifts/ProcessRifts.cpp
+-ProcessRifts_matlab_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ProcessRifts_matlab_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJLIB)
++ProcessRifts_matlab_la_LIBADD = ${deps}
+ #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26140-26141.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26140-26141.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26140-26141.diff	(revision 26740)
@@ -0,0 +1,120 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26140)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26141)
+@@ -2734,8 +2734,8 @@
+ 
+ 	for(int i=0;i<numnodes;i++){
+       for(int j=0;j<numnodes;j++){
+-         Ke->values[(i+0)*2*2*numnodes+j+0] = KeSSA->values[2*i*2*numnodes+2*j]; //K11
+-         Ke->values[(i+6)*2*2*numnodes+j+6] = KeSSA->values[(2*i+1)*2*numnodes+2*j+1]; //K33
++         Ke->values[(i+0*numnodes)*2*2*numnodes+j+0*numnodes] = KeSSA->values[2*i*2*numnodes+2*j]; //K11
++         Ke->values[(i+2*numnodes)*2*2*numnodes+j+2*numnodes] = KeSSA->values[(2*i+1)*2*numnodes+2*j+1]; //K33
+       }  
+    }
+ 
+@@ -2786,58 +2786,58 @@
+ 		
+ 		for(int i=0;i<numnodes;i++){//shape functions on tria element
+ 			for(int j=0;j<numnodes;j++){
+-				Ke->values[(i+0)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+0*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							);//K11
+-				Ke->values[(i+0)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+0*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K12
+-				Ke->values[(i+0)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+0*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							);//K13
+-				Ke->values[(i+0)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+0*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+                      2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+                      )*(n+1)/(n+2);//K14
+ 				
+-				Ke->values[(i+3)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+1*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K21
+-				Ke->values[(i+3)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+1*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2)) 
+ 							+ 
+ 							gauss->weight*Jdet*viscosity*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
+ 							;//K22
+-				Ke->values[(i+3)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+1*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K23
+-				Ke->values[(i+3)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+1*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2));//K24
+ 				
+-				Ke->values[(i+6)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+2*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+ 							);//K31
+-				Ke->values[(i+6)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+2*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K32
+-				Ke->values[(i+6)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+2*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							);//K33
+-				Ke->values[(i+6)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+2*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K34
+ 
+-				Ke->values[(i+9)*2*2*numnodes+j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+3*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+                      2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                      )*(n+1)/(n+2);//K41
+-				Ke->values[(i+9)*2*2*numnodes+j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+3*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+                      2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                      )*2*pow(n+1,2)/((2*n+3)*(n+2));//K42
+-				Ke->values[(i+9)*2*2*numnodes+j+6] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+3*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K43
+-				Ke->values[(i+9)*2*2*numnodes+j+9] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(i+3*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2))
+ 							+ 
+@@ -2925,10 +2925,10 @@
+ 		n_input->GetInputValue(&n,gauss);
+ 
+ 		for(int i=0;i<numnodes;i++){
+-			pe->values[i+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
+-			pe->values[i+3]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
+-			pe->values[i+6]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]; //F3
+-			pe->values[i+9]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F4
++			pe->values[i+0*numnodes]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
++			pe->values[i+1*numnodes]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
++			pe->values[i+2*numnodes]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]; //F3
++			pe->values[i+3*numnodes]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F4
+ 		}
+ 	}
+ 
+@@ -2998,10 +2998,10 @@
+ 		pressure_sh = ice_pressure_sh + water_pressure_sh;
+ 
+ 		for (int i=0;i<numnodes;i++){
+-			pe->values[i+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i]; // F1
+-			pe->values[i+3]+= pressure_sh*Jdet*gauss->weight*normal[0]*basis[i]; // F2
+-			pe->values[i+6]+= pressure*Jdet*gauss->weight*normal[1]*basis[i]; // F3
+-			pe->values[i+9]+= pressure_sh*Jdet*gauss->weight*normal[1]*basis[i]; // F4
++			pe->values[i+0*numnodes]+= pressure*Jdet*gauss->weight*normal[0]*basis[i]; // F1
++			pe->values[i+1*numnodes]+= pressure_sh*Jdet*gauss->weight*normal[0]*basis[i]; // F2
++			pe->values[i+2*numnodes]+= pressure*Jdet*gauss->weight*normal[1]*basis[i]; // F3
++			pe->values[i+3*numnodes]+= pressure_sh*Jdet*gauss->weight*normal[1]*basis[i]; // F4
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26141-26142.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26141-26142.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26141-26142.diff	(revision 26740)
@@ -0,0 +1,255 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26141)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26142)
+@@ -3,11 +3,11 @@
+ 
+ steps=[7];
+ 
+-if any(steps==1) 
++if any(steps==1)
+ 	disp('   Step 1: Global mesh creation');
+ 
+-	numrefine=1;
+-	resolution=300*1e3;			% inital resolution [m]
++	numrefine=5;
++	resolution=150*1e3;			% inital resolution [m]
+ 	radius = 6.371012*10^6;		% mean radius of Earth, m
+ 	mindistance_coast=150*1e3;	% coastal resolution [m]
+ 	mindistance_land=300*1e3;	% resolution on the continents [m]
+@@ -22,9 +22,7 @@
+ 
+ 		distance=zeros(md.mesh.numberofvertices,1);
+ 
+-		pos=find(~ocean_mask);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
+-		pos=find(ocean_mask);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
+-
++		pos=find(~ocean_mask);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);		pos=find(ocean_mask);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);
+ 		for j=1:md.mesh.numberofvertices
+ 			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+ 			if ocean_mask(j),
+@@ -39,7 +37,7 @@
+ 			distance(j)=min(d);
+ 		end
+ 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+-		
++
+ 		pos2=find(ocean_mask~=1 & distance>mindistance_land);
+ 		distance(pos2)=mindistance_land;
+ 
+@@ -48,16 +46,12 @@
+ 	end
+ 
+ 	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+-	pos = find(ocean_mask==0); 
+-	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
+-	md.mask.ocean_levelset(pos)=1; 
+-
++	pos = find(ocean_mask==0);	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1);	md.mask.ocean_levelset(pos)=1;
+ 	save ./Models/SlrGRACE_Mesh md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end 
+-
+-if any(steps==2) 
++end
++if any(steps==2)
+ 	disp('   Step 2: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/SlrGRACE_Mesh');
+ 
+@@ -71,16 +65,14 @@
+ 	save ./Models/SlrGRACE_Loads md;
+ 
+ 	plotmodel (md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');
+-end 
+-
+-if any(steps==3) 
++end
++if any(steps==3)
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/SlrGRACE_Loads');
+ 
+ 	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+ 
+-	md.mask.ice_levelset=-md.mask.ocean_levelset; 
+-
++	md.mask.ice_levelset=-md.mask.ocean_levelset;
+ 	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+ 	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+ 	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+@@ -88,12 +80,9 @@
+ 
+ 	md.solidearth.settings.ocean_area_scaling=1;
+ 
+-	% arbitary to pass consistency check. 
+-	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++	% arbitary to pass consistency check.	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+ 	md.geometry.surface=ones(md.mesh.numberofvertices,1);
+-	md.geometry.base=md.geometry.bed; 
+-	md.geometry.thickness=md.geometry.surface-md.geometry.base; 
+-
++	md.geometry.base=md.geometry.bed;	md.geometry.thickness=md.geometry.surface-md.geometry.base;
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+ 	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+@@ -101,9 +90,8 @@
+ 	md.miscellaneous.name='SlrGRACE';
+ 
+ 	save ./Models/SlrGRACE_Parameterization md;
+-end 
+-
+-if any(steps==4) 
++end
++if any(steps==4)
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -119,13 +107,12 @@
+ 	md=solve(md,'Slr');
+ 
+ 	save ./Models/SlrGRACE_Solution md;
+-end 
+-
+-if any(steps==5) 
++end
++if any(steps==5)
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+-	sol1 = md.solidearth.surfaceload.icethicknesschange*100;						% [cm]
++	sol1 = md.solidearth.surfaceload.icethicknesschange*100; % [cm]
+ 	sol2 = md.results.SealevelriseSolution.SealevelRSL*1000;	% [mm]
+ 
+ 	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
+@@ -154,7 +141,7 @@
+ 		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
+ 		F.Method = 'linear';
+ 		F.ExtrapolationMethod = 'linear';
+-		
++
+ 		sol_grid = F(lat_grid, lon_grid);
+ 		sol_grid(isnan(sol_grid))=0;
+ 		sol_grid(lat_grid>85 & sol_grid==0) = NaN;
+@@ -161,14 +148,14 @@
+ 
+ 		set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+ 		figure1=figure('Position', [100, 100, 1000, 500]);
+-		gcf; load coast; cla;
++		gcf; load coastlines; cla;
+ 		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+ 		if (kk==1)
+-			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
++			geoshow(flipud(coastlat),flipud(coastlon),'DisplayType','polygon','FaceColor','white');
+ 		else
+-			geoshow(lat,long,'DisplayType','polygon','FaceColor','white');
++			geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor',[.5 1 .5]);
+ 		end
+-		plot(long,lat,'k'); hold off;
++		plot(coastlon, coastlat,'k'); hold off;
+ 		c1=colorbar;
+ 		colormap('haxby');
+ 		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]);
+@@ -179,9 +166,8 @@
+ 		set(gcf,'color','w');
+ 		%export_fig(fig_name{kk});
+ 	end
+-end 
+-
+-if any(steps==6) 
++end
++if any(steps==6)
+ 	disp('   Step 6: Transient run');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -198,8 +184,7 @@
+ 	md.transient.ismasstransport=0;
+ 	md.transient.isstressbalance=0;
+ 	md.transient.isthermal=0;
+-	md.transient.isgia=1; 
+-	md.transient.isslr=1;
++	md.transient.isgia=1;	md.transient.isslr=1;
+ 
+ 	md.timestepping.start_time=-1;
+ 	md.timestepping.final_time=nt;
+@@ -211,13 +196,12 @@
+ 	md.verbose=verbose('111111111');
+ 
+ 	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
+-	
++
+ 	md=solve(md,'tr');
+ 
+ 	save ./Models/SlrGRACE_Transient md;
+-end 
+-
+-if any(steps==7) 
++end
++if any(steps==7)
+ 	disp('   Step 7: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+@@ -229,7 +213,7 @@
+ 		sol2(:,tt) = md.results.TransientSolution(tt+1).SealevelRSL*1000;	% mm/yr
+ 	end
+ 	sol_name = {'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
+-	movie_name = {'Movie_dH.avi','Movie_slr.avi'};
++	movie_name = {'Movie_dH.mp4','Movie_slr.mp4'};
+ 
+ 	res = 1.0;
+ 
+@@ -253,13 +237,15 @@
+ 
+ 		vidObj = VideoWriter(movie_name{kk});
+ 		vidObj.FrameRate=2; % frames per second
++		vifObj.FileFormat='mp4';
+ 		open(vidObj);
+ 
+ 		for jj=1:length(time)
++			fprintf('creating frame %d...', jj);
+ 			F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol(:,jj));
+ 			F.Method = 'linear';
+ 			F.ExtrapolationMethod = 'linear';
+-			
++
+ 			sol_grid = F(lat_grid, lon_grid);
+ 			sol_grid(isnan(sol_grid))=0;
+ 			sol_grid(lat_grid>85 & sol_grid==0) = NaN;
+@@ -266,14 +252,14 @@
+ 
+ 			set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+ 			figure1=figure('Position', [100, 100, 1000, 500]);
+-			gcf; load coast; cla;
++			gcf; load coastlines; cla;
+ 			pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+ 			if (kk==1)
+-				geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
++				geoshow(flipud(coastlat),flipud(coastlon),'DisplayType','polygon','FaceColor','white');
+ 			else
+-				geoshow(lat,long,'DisplayType','polygon','FaceColor','white');
++				geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor','white');
+ 			end
+-			plot(long,lat,'k'); hold off;
++			plot(coastlon,coastlat,'k'); hold off;
+ 			c1=colorbar;
+ 			colormap('haxby');
+ 			caxis([-floor(min(abs(min(min(sol))),abs(max(max(sol))))) floor(min(abs(min(min(sol))),abs(max(max(sol)))))]);
+@@ -284,10 +270,12 @@
+ 			set(gcf,'color','w');
+ 			writeVideo(vidObj,getframe(gcf));
+ 			close
++			fprintf('done\n');
+ 		end
++		disp('closing vidObj...');
+ 		close(vidObj);
+ 	end
+-	!open *.avi;
++	!open *.mp4;
+ 
+ 	% plot GMSL time series
+ 	plot(time,gmsl,'-*','linewidth',3); grid on;
+@@ -295,4 +283,4 @@
+ 	ylabel('GMSL [mm/yr]');
+ 	set(gcf,'color','w');
+ 	%export_fig('Fig7.pdf');
+-end 
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26142-26143.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26142-26143.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26142-26143.diff	(revision 26740)
@@ -0,0 +1,187 @@
+Index: ../trunk-jpl/src/c/classes/matrix/ElementVector.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 26142)
++++ ../trunk-jpl/src/c/classes/matrix/ElementVector.h	(revision 26143)
+@@ -19,12 +19,13 @@
+ 
+ class ElementVector{
+ 
++	private:
++		int *gglobaldoflist;
++		int *fglobaldoflist;
++
+ 	public:
+ 		int         nrows;
+-		int         fsize;
+ 		IssmDouble *values;
+-		int        *gglobaldoflist;
+-		int        *fglobaldoflist;
+ 
+ 		/*ElementVector constructors, destructors*/
+ 		ElementVector();
+Index: ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26142)
++++ ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26143)
+@@ -18,17 +18,17 @@
+ 
+ class ElementMatrix{
+ 
++	private:
++		int *gglobaldoflist;
++		int *fglobaldoflist;
++		int *sglobaldoflist;
++		int  fsize;
++		int  ssize;
++
+ 	public:
++		int         nrows;
++		IssmDouble *values;
+ 
+-		int      nrows;
+-		int      fsize;
+-		int      ssize;
+-		IssmDouble*  values;
+-
+-		int*     gglobaldoflist;
+-		int*     fglobaldoflist;
+-		int*     sglobaldoflist;
+-
+ 		/*ElementMatrix constructors, destructors*/
+ 		ElementMatrix();
+ 		ElementMatrix(ElementMatrix* Ke);
+Index: ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26142)
++++ ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26143)
+@@ -20,7 +20,6 @@
+ ElementVector::ElementVector(){/*{{{*/
+ 
+ 	this->nrows=0;
+-	this->fsize=0;
+ 	this->values=NULL;
+ 	this->fglobaldoflist=NULL;
+ 
+@@ -28,10 +27,6 @@
+ /*}}}*/
+ ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){/*{{{*/
+ 
+-	/*intermediaries*/
+-	int i,j;
+-	int gsize,fsize;
+-
+ 	/*If one of the two matrix is NULL, we copy the other one*/
+ 	if(!pe1 && !pe2){
+ 		_error_("Two input element matrices are NULL");
+@@ -49,10 +44,10 @@
+ 	int* P=xNew<int>(pe2->nrows);
+ 
+ 	/*1: Get the new numbering of pe2 and get size of the new matrix*/
+-	gsize=pe1->nrows;
+-	for(i=0;i<pe2->nrows;i++){
++	int gsize=pe1->nrows;
++	for(int i=0;i<pe2->nrows;i++){
+ 		bool found=false;
+-		for(j=0;j<pe1->nrows;j++){
++		for(int j=0;j<pe1->nrows;j++){
+ 			if(pe2->gglobaldoflist[i]==pe1->gglobaldoflist[j]){
+ 				found=true; P[i]=j; break;
+ 			}
+@@ -69,21 +64,17 @@
+ 	this->gglobaldoflist=xNew<int>(this->nrows);
+ 	this->fglobaldoflist=xNew<int>(this->nrows);
+ 	this->values=xNewZeroInit<IssmDouble>(this->nrows);
+-	for(i=0;i<pe1->nrows;i++){
++	for(int i=0;i<pe1->nrows;i++){
+ 		this->values[i] += pe1->values[i];
+ 		this->gglobaldoflist[i]=pe1->gglobaldoflist[i];
+ 		this->fglobaldoflist[i]=pe1->fglobaldoflist[i];
+ 	}
+-	for(i=0;i<pe2->nrows;i++){
++	for(int i=0;i<pe2->nrows;i++){
+ 		this->values[P[i]] += pe2->values[i];
+ 		this->gglobaldoflist[P[i]]=pe2->gglobaldoflist[i];
+ 		this->fglobaldoflist[P[i]]=pe2->fglobaldoflist[i];
+ 	}
+ 
+-	/*Fset*/
+-	this->fsize=0;
+-	for(i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) this->fsize++;
+-
+ 	/*clean-up*/
+ 	xDelete<int>(P);
+ }
+@@ -110,11 +101,8 @@
+ 	/*fill values with 0: */
+ 	this->values=xNewZeroInit<IssmDouble>(this->nrows);
+ 
+-	/*g list*/
++	/*dof list*/
+ 	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
+-
+-	/*Get fsize*/
+-	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+ 	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+ }
+ /*}}}*/
+@@ -131,7 +119,10 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+-	if(this->fsize){
++	/*Get size of Fset*/
++   int fsize = 0; for(int i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) fsize++;
++
++	if(fsize){
+ 		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+ 	}
+ 
+@@ -154,7 +145,6 @@
+ 
+ 	_printf_("Element Vector echo:\n");
+ 	_printf_("   nrows: " << nrows << "\n");
+-	_printf_("   fsize: " << fsize << "\n");
+ 	_printf_("   values:\n");
+ 	for(i=0;i<nrows;i++) _printf_(setw(4) << right << i << ": " << setw(10) << values[i] << "\n");
+ 
+@@ -163,7 +153,7 @@
+ 	_printf_(" \n");
+ 
+ 	_printf_("   fglobaldoflist (" << fglobaldoflist << "): ");
+-	if(fglobaldoflist) for(i=0;i<fsize;i++) _printf_(" " << fglobaldoflist[i] );
++	if(fglobaldoflist) for(i=0;i<nrows;i++) _printf_(" " << fglobaldoflist[i] );
+ 	_printf_(" \n");
+ }
+ /*}}}*/
+@@ -172,7 +162,6 @@
+ 	_assert_(pe);
+ 
+ 	this->nrows =pe->nrows;
+-	this->fsize =pe->fsize;
+ 
+ 	this->values=xNew<IssmDouble>(this->nrows);
+ 	xMemCpy<IssmDouble>(this->values,pe->values,this->nrows);
+@@ -186,7 +175,10 @@
+ /*}}}*/
+ void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/
+ 
+-	if(this->fsize){
++	/*Get size of Fset*/
++	int fsize = 0; for(int i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) fsize++;
++
++	if(fsize){
+ 		/*add local values into global  vector, using the fglobaldoflist: */
+ 		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,INS_VAL);
+ 	}
+@@ -195,10 +187,8 @@
+ /*}}}*/
+ void ElementVector::SetValue(IssmDouble scalar){/*{{{*/
+ 
+-	int i;
++	for(int i=0;i<this->nrows;i++)this->values[i]=scalar;
+ 
+-	for(i=0;i<this->nrows;i++)this->values[i]=scalar;
+-
+ }
+ /*}}}*/
+ void ElementVector::StaticCondensation(ElementMatrix* Ke,int bsize,int* bindices){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26143-26144.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26143-26144.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26143-26144.diff	(revision 26740)
@@ -0,0 +1,738 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Channel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Channel.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Loads/Channel.cpp	(revision 26144)
+@@ -319,7 +319,7 @@
+ 			/*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(nodes[i]->FSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+@@ -335,7 +335,7 @@
+ 					}
+ 					break;
+ 				case SsetEnum:
+-					if(nodes[i]->ssize){
++					if(nodes[i]->SSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+Index: ../trunk-jpl/src/c/classes/Loads/Moulin.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Moulin.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Loads/Moulin.cpp	(revision 26144)
+@@ -290,7 +290,7 @@
+ 		/*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/
+ 		switch(set2_enum){
+ 			case FsetEnum:
+-				if(node->fsize){
++				if(node->FSize()){
+ 					if(this->node->IsClone())
+ 					 o_nz += 1;
+ 					else
+@@ -306,7 +306,7 @@
+ 				}
+ 				break;
+ 			case SsetEnum:
+-				if(node->ssize){
++				if(node->SSize()){
+ 					if(this->node->IsClone())
+ 					 o_nz += 1;
+ 					else
+Index: ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 26144)
+@@ -429,7 +429,7 @@
+ 			/*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(nodes[i]->FSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+@@ -445,7 +445,7 @@
+ 					}
+ 					break;
+ 				case SsetEnum:
+-					if(nodes[i]->ssize){
++					if(nodes[i]->SSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+Index: ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 26144)
+@@ -293,7 +293,7 @@
+ 		/*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/
+ 		switch(set2_enum){
+ 			case FsetEnum:
+-				if(node->fsize){
++				if(node->FSize()){
+ 					if(this->node->IsClone())
+ 					 o_nz += 1;
+ 					else
+@@ -309,7 +309,7 @@
+ 				}
+ 				break;
+ 			case SsetEnum:
+-				if(node->ssize){
++				if(node->SSize()){
+ 					if(this->node->IsClone())
+ 					 o_nz += 1;
+ 					else
+Index: ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 26144)
+@@ -391,7 +391,7 @@
+ 			/*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(nodes[i]->FSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+@@ -407,7 +407,7 @@
+ 					}
+ 					break;
+ 				case SsetEnum:
+-					if(nodes[i]->ssize){
++					if(nodes[i]->SSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+Index: ../trunk-jpl/src/c/classes/Nodes.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Nodes.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Nodes.cpp	(revision 26144)
+@@ -146,12 +146,6 @@
+ 	int my_rank   = IssmComm::GetRank();
+ 	int num_procs = IssmComm::GetSize();
+ 
+-	/*First, allocate dof lists based on fset and sset*/
+-	for(Object* & object : this->objects){
+-      Node* node = xDynamicCast<Node*>(object);
+-		node->AllocateDofLists(setenum);
+-	}
+-
+ 	/*Now, Build local dofs for masters first*/
+ 	int  dofcount=0;
+ 	for(Object* & object : this->objects){
+Index: ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 26144)
+@@ -21,10 +21,7 @@
+ 
+ 	this->nrows=0;
+ 	this->values=NULL;
+-
+-	this->fsize=0;
+ 	this->fglobaldoflist=NULL;
+-	this->ssize=0;
+ 	this->sglobaldoflist=NULL;
+ }
+ /*}}}*/
+@@ -39,7 +36,6 @@
+ 
+ 	/*intermediaries*/
+ 	int i,j,counter;
+-	int gsize,fsize,ssize;
+ 
+ 	/*If one of the two matrix is NULL, we copy the other one*/
+ 	if(!Ke1 && !Ke2){
+@@ -60,7 +56,7 @@
+ 	int* P=xNew<int>(Ke2->nrows);
+ 
+ 	/*1: Get the new numbering of Ke2 and get size of the new matrix*/
+-	gsize=Ke1->nrows;
++	int gsize=Ke1->nrows;
+ 	for(i=0;i<Ke2->nrows;i++){
+ 		bool found=false;
+ 		for(j=0;j<Ke1->nrows;j++){
+@@ -98,14 +94,6 @@
+ 		this->sglobaldoflist[P[i]]=Ke2->sglobaldoflist[i];
+ 	}
+ 
+-	/*Fset*/
+-	this->fsize=0;
+-	for(i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) this->fsize++;
+-
+-	/*Sset*/
+-	this->ssize=0;
+-	for(i=0;i<this->nrows;i++) if(this->sglobaldoflist[i]>=0) this->ssize++;
+-
+ 	/*clean-up*/
+ 	xDelete<int>(P);
+ }
+@@ -132,13 +120,8 @@
+ 	/*fill values with 0: */
+ 	this->values=xNewZeroInit<IssmDouble>(this->nrows*this->nrows);
+ 
+-	/*g list*/
+ 	this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
+-
+-	/*get dof lists for f and s set: */
+-	this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
+ 	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+-	this->ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation);
+ 	this->sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation);
+ }
+ /*}}}*/
+@@ -162,7 +145,13 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+-	if(this->fsize){
++	/*do we have any component in the F set?*/
++	int fsize = 0;
++	for(int i=0;i<this->nrows;i++){
++		if(this->fglobaldoflist[i]>=0) fsize++;
++	}
++
++	if(fsize){
+ 		/*first, retrieve values that are in the f-set from the g-set values matrix: */
+ 		localvalues=xNew<IssmDouble>(this->nrows);
+ 		for(int i=0;i<this->nrows;i++){
+@@ -170,7 +159,7 @@
+ 		}
+ 
+ 		/*add local values into global  matrix, using the fglobaldoflist: */
+-		pf->SetValues(this->fsize,this->fglobaldoflist,localvalues,ADD_VAL);
++		pf->SetValues(fsize,this->fglobaldoflist,localvalues,ADD_VAL);
+ 
+ 		/*Free ressources:*/
+ 		xDelete<IssmDouble>(localvalues);
+@@ -192,13 +181,24 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
++	/*do we have any component in the F or S set?*/
++   bool is_fset= false;
++	bool is_sset= false;
++   for(int i=0;i<this->nrows;i++){
++      if(this->fglobaldoflist[i]>=0){
++         is_fset = true;
++      }
++		else{
++			_assert_(this->sglobaldoflist[i]>=0);
++			is_sset = true;
++		}
++   }
++
+ 	/*only use row dofs to add values into global matrices: */
+-	if(this->fsize){
+-		/*add local values into global  matrix, using the fglobaldoflist: */
++	if(is_fset){
+ 		Kff->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+ 	}
+-
+-	if((this->ssize!=0) && (this->fsize!=0)){
++	if(is_fset && is_sset){
+ 		Kfs->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->sglobaldoflist,this->values,ADD_VAL);
+ 	}
+ }
+@@ -211,7 +211,16 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+-	if(this->fsize){
++	/*do we have any component in the F set?*/
++	bool isfset= false;
++	for(int i=0;i<this->nrows;i++){
++		if(this->fglobaldoflist[i]>=0){
++			isfset = true;
++			break;
++		}
++   }
++
++	if(isfset){
+ 		Jff->SetValues(this->nrows,this->fglobaldoflist,this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+ 	}
+ }
+@@ -245,11 +254,9 @@
+ 	_printf_("   gglobaldoflist (" << gglobaldoflist << "): ");
+ 	if(gglobaldoflist) for(i=0;i<nrows;i++) _printf_(" " << gglobaldoflist[i]); _printf_("\n");
+ 
+-	_printf_("   fsize: " << fsize << "\n");
+ 	_printf_("   fglobaldoflist  (" << fglobaldoflist << "): ");
+ 	for(i=0;i<nrows;i++)_printf_(" " << fglobaldoflist[i]); _printf_(" \n");
+ 
+-	_printf_("   ssize: " << ssize << "\n");
+ 	_printf_("   sglobaldoflist  (" << sglobaldoflist << "): ");
+ 	for(i=0;i<nrows;i++)_printf_(" " << sglobaldoflist[i]); _printf_(" \n");
+ }
+@@ -266,12 +273,8 @@
+ 
+ 	this->gglobaldoflist=xNew<int>(this->nrows);
+ 	xMemCpy<int>(this->gglobaldoflist,Ke->gglobaldoflist,this->nrows);
+-
+-	this->fsize=Ke->fsize;
+ 	this->fglobaldoflist=xNew<int>(this->nrows);
+ 	xMemCpy<int>(this->fglobaldoflist,Ke->fglobaldoflist,this->nrows);
+-
+-	this->ssize=Ke->ssize;
+ 	this->sglobaldoflist=xNew<int>(this->nrows);
+ 	xMemCpy<int>(this->sglobaldoflist,Ke->sglobaldoflist,this->nrows);
+ }
+Index: ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26143)
++++ ../trunk-jpl/src/c/classes/matrix/ElementMatrix.h	(revision 26144)
+@@ -22,8 +22,6 @@
+ 		int *gglobaldoflist;
+ 		int *fglobaldoflist;
+ 		int *sglobaldoflist;
+-		int  fsize;
+-		int  ssize;
+ 
+ 	public:
+ 		int         nrows;
+Index: ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 26144)
+@@ -119,10 +119,16 @@
+ 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+ 	this->CheckConsistency();
+ 
+-	/*Get size of Fset*/
+-   int fsize = 0; for(int i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) fsize++;
++	/*do we have any component in the F set?*/
++	bool isfset= false;
++	for(int i=0;i<this->nrows;i++){
++		if(this->fglobaldoflist[i]>=0){
++			isfset = true;
++			break;
++		}
++	}
+ 
+-	if(fsize){
++	if(isfset){
+ 		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,ADD_VAL);
+ 	}
+ 
+@@ -175,10 +181,16 @@
+ /*}}}*/
+ void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/
+ 
+-	/*Get size of Fset*/
+-	int fsize = 0; for(int i=0;i<this->nrows;i++) if(this->fglobaldoflist[i]>=0) fsize++;
++	/*do we have any component in the F set?*/
++	bool isfset= false;
++	for(int i=0;i<this->nrows;i++){
++		if(this->fglobaldoflist[i]>=0){
++			isfset = true;
++			break;
++		}
++	}
+ 
+-	if(fsize){
++	if(isfset){
+ 		/*add local values into global  vector, using the fglobaldoflist: */
+ 		pf->SetValues(this->nrows,this->fglobaldoflist,this->values,INS_VAL);
+ 	}
+Index: ../trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 26144)
+@@ -255,7 +255,8 @@
+ 			Node* node = xDynamicCast<Node*>(object);
+ 			int   lid = node->Lid();
+ 			if(!node->IsClone()){
+-				for(j=0;j<node->fsize;j++){
++				int node_fsize = node->FSize();
++				for(j=0;j<node_fsize;j++){
+ 					_assert_(count<m);
+ 					d_nnz[count]=numberofdofspernode*(d_connectivity[lid] + reCast<int>(serial_connectivity_clone[lid]));
+ 					o_nnz[count]=numberofdofspernode*(o_connectivity[lid] + reCast<int>(serial_connectivity_clone[lid]));
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26144)
+@@ -55,7 +55,7 @@
+ 	int numnodes = this->GetNumberOfNodes();
+ 
+ 	for(int i=0;i<numnodes;i++){
+-		if(nodes[i]->fsize) return true;
++		if(nodes[i]->FSize()) return true;
+ 	}
+ 	return false;
+ }/*}}}*/
+@@ -3382,7 +3382,7 @@
+ 			/*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(nodes[i]->FSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+@@ -3398,7 +3398,7 @@
+ 					}
+ 					break;
+ 				case SsetEnum:
+-					if(nodes[i]->ssize){
++					if(nodes[i]->SSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+Index: ../trunk-jpl/src/c/classes/Loads/Neumannflux.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Neumannflux.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Loads/Neumannflux.cpp	(revision 26144)
+@@ -305,7 +305,7 @@
+ 			/*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(nodes[i]->FSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+@@ -321,7 +321,7 @@
+ 					}
+ 					break;
+ 				case SsetEnum:
+-					if(nodes[i]->ssize){
++					if(nodes[i]->SSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+Index: ../trunk-jpl/src/c/classes/Loads/Penpair.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 26144)
+@@ -234,7 +234,7 @@
+ 			/*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(nodes[i]->FSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+@@ -250,7 +250,7 @@
+ 					}
+ 					break;
+ 				case SsetEnum:
+-					if(nodes[i]->ssize){
++					if(nodes[i]->SSize()){
+ 						if(this->nodes[i]->IsClone())
+ 						 o_nz += 1;
+ 						else
+Index: ../trunk-jpl/src/c/classes/Node.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.cpp	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Node.cpp	(revision 26144)
+@@ -19,8 +19,6 @@
+ Node::Node(){/*{{{*/
+ 	this->approximation  = 0;
+ 	this->gsize          = -1;
+-	this->fsize          = -1;
+-	this->ssize          = -1;
+ 	this->clone          = false;
+ 	this->active         = true;
+ 	this->freeze         = false;
+@@ -68,8 +66,6 @@
+ 		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       = xNew<int>(this->gsize);
+ 		this->sdoflist       = xNew<int>(this->gsize);
+ 		this->fdoflist_local = xNew<int>(this->gsize);
+@@ -81,8 +77,6 @@
+ 		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;
+@@ -214,8 +208,6 @@
+ 	/*indexing:*/
+ 	output->indexingupdate = this->indexingupdate;
+ 	output->gsize  = this->gsize;
+-	output->fsize  = this->fsize;
+-	output->ssize  = this->ssize;
+ 	output->clone  = this->clone;
+ 	output->active = this->active;
+ 	output->freeze = this->freeze;
+@@ -263,8 +255,6 @@
+ 	for(int k=0;k<3;k++) for(int l=0;l<3;l++) marshallhandle->call(this->coord_system[k][l]);
+ 
+ 	marshallhandle->call(this->gsize);
+-	marshallhandle->call(this->fsize);
+-	marshallhandle->call(this->ssize);
+ 	marshallhandle->call(this->clone);
+ 	marshallhandle->call(this->active);
+ 	marshallhandle->call(this->freeze);
+@@ -291,8 +281,6 @@
+ 	_printf_("   approximation: " << EnumToStringx(approximation) << "\n");
+ 	_printf_("   indexingupdate: " << indexingupdate << "\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");
+@@ -302,7 +290,7 @@
+ 	_printf_("   s_set = [ ");
+ 	for(i=0;i<gsize;i++) _printf_((s_set[i]?1:0)<< " ");
+ 	_printf_("]\n");
+-	_printf_("   svalues (" << this->ssize << "): |");
++	_printf_("   svalues: |");
+ 	for(i=0;i<this->gsize;i++){
+ 		if(this->s_set[i])_printf_(" " << svalues[i] << " |");
+ 	}
+@@ -350,8 +338,6 @@
+ 	_printf_("   approximation: " << EnumToStringx(approximation) << "\n");
+ 	_printf_("   indexingupdate: " << indexingupdate << "\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");
+@@ -478,7 +464,7 @@
+ /*}}}*/
+ void Node::CreateNodalConstraints(Vector<IssmDouble>* ys){/*{{{*/
+ 
+-	if(this->ssize){
++	if(this->SSize()){
+ 		/*Add values into constraint vector: */
+ 		ys->SetValues(this->gsize,this->sdoflist,this->svalues,INS_VAL);
+ 	}
+@@ -554,8 +540,8 @@
+ 
+ 	if(approximation_enum==NoneApproximationEnum){
+ 		if      (setenum==GsetEnum) numdofs=this->gsize;
+-		else if (setenum==FsetEnum) numdofs=this->fsize;
+-		else if (setenum==SsetEnum) numdofs=this->ssize;
++		else if (setenum==FsetEnum) numdofs=this->FSize();
++		else if (setenum==SsetEnum) numdofs=this->SSize();
+ 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 	}
+ 	else{
+@@ -575,7 +561,7 @@
+ 					if((this->doftype[i]==approximation_enum) && (this->f_set[i])) numdofs++;
+ 				}
+ 			}
+-			else numdofs=this->fsize;
++			else numdofs=this->FSize();
+ 		}
+ 		else if (setenum==SsetEnum){
+ 			if(this->doftype){
+@@ -584,7 +570,7 @@
+ 					if((this->doftype[i]==approximation_enum) && (this->s_set[i])) numdofs++;
+ 				}
+ 			}
+-			else numdofs=this->ssize;
++			else numdofs=this->SSize();
+ 		}
+ 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 	}
+@@ -627,10 +613,14 @@
+ 	/*Only perform operation if not clone*/
+ 	if(this->IsClone()) return;
+ 
+-	if(this->fsize){
+-		int*        indices = xNew<int>(this->fsize);
+-		IssmDouble* values  = xNew<IssmDouble>(this->fsize);
++	/*Get F size and S size*/
++	int fsize = this->FSize();
++	int ssize = this->SSize();
+ 
++	if(fsize){
++		int*        indices = xNew<int>(fsize);
++		IssmDouble* values  = xNew<IssmDouble>(fsize);
++
+ 		int count = 0;
+ 		for(int i=0;i<this->gsize;i++){
+ 			if(this->f_set[i]){
+@@ -642,14 +632,14 @@
+ 				count++;
+ 			}
+ 		}
+-		ug->SetValues(this->fsize,indices,values,INS_VAL);
++		ug->SetValues(fsize,indices,values,INS_VAL);
+ 
+ 		xDelete<IssmDouble>(values);
+ 		xDelete<int>(indices);
+ 	}
+-	if(this->ssize){
+-		int*        indices = xNew<int>(this->ssize);
+-		IssmDouble* values  = xNew<IssmDouble>(this->ssize);
++	if(ssize){
++		int*        indices = xNew<int>(ssize);
++		IssmDouble* values  = xNew<IssmDouble>(ssize);
+ 
+ 		int count = 0;
+ 		for(int i=0;i<this->gsize;i++){
+@@ -662,7 +652,7 @@
+ 				count++;
+ 			}
+ 		}
+-		ug->SetValues(this->ssize,indices,values,INS_VAL);
++		ug->SetValues(ssize,indices,values,INS_VAL);
+ 		
+ 		xDelete<IssmDouble>(values);
+ 		xDelete<int>(indices);
+@@ -675,10 +665,13 @@
+ 	/*Only perform operation if not clone*/
+ 	if(this->IsClone()) return;
+ 
+-	if(this->fsize){
+-		int*        indices = xNew<int>(this->fsize);
+-		IssmDouble* values  = xNew<IssmDouble>(this->fsize);
++	/*Get F size*/
++	int fsize = this->FSize();
+ 
++	if(fsize){
++		int*        indices = xNew<int>(fsize);
++		IssmDouble* values  = xNew<IssmDouble>(fsize);
++
+ 		int count = 0;
+ 		for(int i=0;i<this->gsize;i++){
+ 			if(this->f_set[i]){
+@@ -691,8 +684,8 @@
+ 				count++;
+ 			}
+ 		}
+-		_assert_(count==this->fsize);
+-		uf->SetValues(this->fsize,indices,values,INS_VAL);
++		_assert_(count==fsize);
++		uf->SetValues(fsize,indices,values,INS_VAL);
+ 
+ 		xDelete<IssmDouble>(values);
+ 		xDelete<int>(indices);
+@@ -701,22 +694,6 @@
+ /*}}}*/
+ 
+ /* indexing routines:*/
+-void Node::AllocateDofLists(int setenum){/*{{{*/
+-
+-	/*Initialize: */
+-	int size=0;
+-
+-	if(setenum==FsetEnum){
+-		for(int i=0;i<this->gsize;i++) if(f_set[i])size++;
+-		this->fsize=size;
+-	}
+-	else if(setenum==SsetEnum){
+-		for(int i=0;i<this->gsize;i++) if(s_set[i])size++;
+-		this->ssize=size;
+-	}
+-	/*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*/
+@@ -728,7 +705,6 @@
+ 		for(int i=0;i<this->gsize;i++) gdoflist_local[i]=dofcount++;
+ 	}
+ 	else if(setenum==FsetEnum){
+-		_assert_(this->fsize==0 || this->fdoflist_local);
+ 		for(int i=0;i<this->gsize;i++){
+ 			if(this->f_set[i]) fdoflist_local[i]=dofcount++;
+ 			else               fdoflist_local[i]=-1;
+@@ -735,7 +711,6 @@
+ 		}
+ 	}
+ 	else if(setenum==SsetEnum){
+-		_assert_(this->ssize==0 || this->sdoflist_local);
+ 		for(int i=0;i<this->gsize;i++){
+ 			if(this->s_set[i]) sdoflist_local[i]=dofcount++;
+ 			else               sdoflist_local[i]=-1;
+@@ -757,7 +732,6 @@
+ 		for(int i=0;i<this->gsize;i++) this->gdoflist[i]=this->gdoflist_local[i]+dofcount;
+ 	}
+ 	else if(setenum==FsetEnum){
+-		_assert_(this->fsize==0 || this->fdoflist);
+ 		for(int i=0;i<this->gsize;i++){
+ 			if(this->f_set[i]) fdoflist[i]=this->fdoflist_local[i]+dofcount;
+ 			else               fdoflist[i]=-1;
+@@ -764,7 +738,6 @@
+ 		}
+ 	}
+ 	else if(setenum==SsetEnum){
+-		_assert_(this->ssize==0 || this->sdoflist);
+ 		for(int i=0;i<this->gsize;i++){
+ 			if(this->s_set[i]) sdoflist[i]=this->sdoflist_local[i]+dofcount;
+ 			else               sdoflist[i]=-1;
+@@ -815,7 +788,25 @@
+ 	}
+ }
+ /*}}}*/
++int  Node::FSize(void){/*{{{*/
+ 
++	_assert_(this && this->gdoflist);
++
++	int fsize = 0;
++	for(int i=0;i<this->gsize;i++) if(this->f_set[i]) fsize++;
++	return fsize;
++}
++/*}}}*/
++int  Node::SSize(void){/*{{{*/
++
++	_assert_(this && this->s_set);
++
++	int ssize = 0;
++	for(int i=0;i<this->gsize;i++) if(this->s_set[i]) ssize++;
++	return ssize;
++}
++/*}}}*/
++
+ /*Methods inherent to Node: */
+ int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Node.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.h	(revision 26143)
++++ ../trunk-jpl/src/c/classes/Node.h	(revision 26144)
+@@ -42,8 +42,6 @@
+ 
+ 		/*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)
+@@ -55,7 +53,7 @@
+ 		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
++		int  *doftype;   //approximation type of the dofs (used only for coupling), size g_size
+ 
+ 		/*list of degrees of freedom: */
+ 		int *gdoflist;
+@@ -79,7 +77,6 @@
+ 		int     ObjectEnum();
+ 
+ 		/*Node numerical routines*/
+-		void  AllocateDofLists(int setenum);
+ 		void  Activate(void);
+ 		void  ApplyConstraint(int dof,IssmDouble value);
+ 		void  CreateNodalConstraints(Vector<IssmDouble>* ys);
+@@ -112,6 +109,8 @@
+ 		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);
++		int   SSize();
++		int   FSize();
+ };
+ 
+ /*Methods inherent to Node: */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26144-26145.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26144-26145.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26144-26145.diff	(revision 26740)
@@ -0,0 +1,205 @@
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch	(revision 26144)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch	(nonexistent)
+@@ -1,11 +0,0 @@
+---- ./src/code/Makefile	2016-02-16 19:39:30.000000000 -0800
+-+++ ./Makefile	2016-02-16 19:37:49.000000000 -0800
+-@@ -6,7 +6,7 @@
+- #CFLAGS =	-O2
+- #OFLAGS =	-O2
+- #CFLAGS =	-fPIC -fno-omit-frame-pointer -D_GNU_SOURCE -pthread -fexceptions
+--CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g
+-+CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/mingw64/x86_64-w64-mingw32/include -I/usr/include -Wno-implicit-function-declaration
+- #CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -DMATLAB
+- OFLAGS =	-O2 
+- #AR =             /usr/ccs/bin/ar rcv   # for solaris 2
+Index: ../trunk-jpl/externalpackages/chaco/install-win-msys2-mingw.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/install-win-msys2-mingw.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/install-win-msys2-mingw.sh	(revision 26145)
+@@ -0,0 +1,62 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++VER=2.2
++
++PREFIX="${ISSM_DIR}/externalpackages/chaco/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/Chaco-${VER}.tar.gz" "Chaco-${VER}.tar.gz"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf" "chaco_guide.pdf"
++
++# Unpack source
++tar -xvzf Chaco-${VER}.tar.gz
++
++# Move source to 'src' directory
++mv Chaco-${VER}/* src
++rm -rf Chaco-${VER}
++
++# Apply patches (all at once)
++# (written by diff -rc src ~/Libs/Chaco-${VER} > chaco.patch)
++patch -R -p0 < chaco.patch
++
++# Copy customized source and configuration files to 'src' directory
++cp configs/win/msys2/mingw64/src/code/Makefile src/code
++cp configs/win/msys2/mingw64/src/code/main/interface.c src/code/main
++cp configs/win/msys2/mingw64/src/code/util/bail.c src/code/util
++cp configs/win/msys2/mingw64/src/code/util/seconds.c src/code/util
++
++# Compile
++cd src/code
++if [ $# -eq 0 ]; then
++	make
++else
++	make -j $1
++fi
++make chacominusblas.a
++
++# Clean up objects (but not library or executable)
++make clean
++cd ../..
++
++# Install
++cp -p src/exec/README ${PREFIX}
++cp -p src/exec/User_Params ${PREFIX}
++cp -p src/exec/*.coords ${PREFIX}
++cp -p src/exec/*.graph ${PREFIX}
++mkdir ${PREFIX}/include
++cp -p src/code/main/defs.h ${PREFIX}/include/defs.h
++cp -p src/code/main/params.h ${PREFIX}/include/params.h
++cp -p chaco.h ${PREFIX}/include/chaco.h
++mkdir ${PREFIX}/lib
++mv src/code/chaco.a ${PREFIX}/lib/libchaco.a
++mv src/code/chacominusblas.a ${PREFIX}/lib/libchacominusblas.a
++mkdir ${PREFIX}/exec
++mv src/exec/chaco ${PREFIX}/exec
+
+Property changes on: ../trunk-jpl/externalpackages/chaco/install-win-msys2-mingw.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(revision 26144)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(revision 26145)
+@@ -1,8 +1,16 @@
++ifeq "$(origin AR)" "undefined"
++	AR = ar
++endif
++
++ifeq "$(origin RANLIB)" "undefined"
++	RANLIB = ranlib
++endif
++
+ DEST_DIR = 	../exec
+ DEST=		${DEST_DIR}/chaco
+ CC = 		gcc
+ IFLAG =		-Imain
+-CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -I/mingw64/x86_64-w64-mingw32/include -I/usr/include -Wno-implicit-function-declaration
++CFLAGS =	-fpic -fno-omit-frame-pointer -pthread -fexceptions -g -I/mingw64/x86_64-w64-mingw32/include -Wno-implicit-function-declaration
+ OFLAGS =	-O2
+ 
+ FILES.c=	main/user_params.c main/interface.c main/main.c \
+@@ -90,9 +98,15 @@
+ FILES.o=	$(FILES.c:.c=.o) 
+ 
+ 
+-${DEST}:	${FILES.o} Makefile
+-		${CC} ${OFLAGS} ${FILES.o} -lm -L/lib/w32api -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -o ${DEST}
++${DEST}:	${FILES.c} chaco.a Makefile
++		${CC} ${OFLAGS} chaco.a -lm -o ${DEST}
+ 
++chaco.a:	${FILES.o}
++		${AR} cr $@ ${FILES.o} ; ${RANLIB} $@
++
++chacominusblas.a:	${FILESMINUSBLAS.o}
++		${AR} cr $@ ${FILESMINUSBLAS.o} ; ${RANLIB} $@
++
+ lint:
+ 		lint ${IFLAG} ${FILES.c} -lm
+ 
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c	(nonexistent)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c	(revision 26145)
+@@ -0,0 +1,46 @@
++/* This software was developed by Bruce Hendrickson and Robert Leland   *
++ * at Sandia National Laboratories under US Department of Energy        *
++ * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
++
++/**
++ * NOTE: Under MSYS2 MinGW, we do not want to have to depend on the MSYS2 
++ *		 runtime for our distributable packages. Unfortunately, sys/resource.h 
++ *		 is not currently available for MinGW (standalone) targets under MSYS2. 
++ *		 this further means that,
++ *
++ *			-I/mingw64/x86_64-w64-mingw32/include
++ *
++ *		 should be included in CFLAGS, and that,
++ *
++ *			-I/usr/include
++ *
++ *		 should be avoided.
++ */
++//#include   <sys/time.h>
++//#include   <sys/resource.h>
++#include   <time.h>
++
++double    seconds()
++{
++    double    curtime;
++
++// #ifdef RUSAGE_SELF
++
++// /* This timer is faster and more robust (if it exists). */
++//     struct rusage rusage;
++//     int getrusage();
++ 
++//     getrusage(RUSAGE_SELF, &rusage);
++//     curtime = ((rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec) +
++// 	    1.0e-6 * (rusage.ru_utime.tv_usec + rusage.ru_stime.tv_usec));
++
++// #else
++
++/* ANSI timer, but lower resolution & wraps around after ~36 minutes. */
++
++    curtime = clock()/((double) CLOCKS_PER_SEC);
++
++// #endif
++
++    return (curtime);
++}
+Index: ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26144)
++++ ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26145)
+@@ -18,6 +18,9 @@
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
+ 	--with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install" \
++	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
++	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
++	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+ '
+ 
+ #-------------------#
+@@ -29,6 +32,9 @@
+ 	msmpi		install.sh
+ 	petsc		install-3.14-win-msys2-mingw-msmpi.sh
+ 	triangle	install-win-msys2-mingw.sh
++	chaco		install-win-msys2-mingw.sh
++	m1qn3		install.sh
++	semic		install.sh
+ 	shell2junit	install.sh
+ "
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26145-26146.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26145-26146.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26145-26146.diff	(revision 26740)
@@ -0,0 +1,41 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26145)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26146)
+@@ -512,7 +512,7 @@
+ 	if(VerboseSolution()) _printf0_("	  converging ocean GRD convolutions\n");
+ 	for(;;){
+ 			
+-		oldsealevelloads=sealevelloads->Duplicate();
++		oldsealevelloads=sealevelloads->Duplicate(); sealevelloads->Copy(oldsealevelloads);
+ 
+ 		/*convolve load and sealevel loads on oceans:*/
+ 		for(Object* & object : femmodel->elements->objects){
+@@ -560,11 +560,11 @@
+ 		barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
+ 	}
+ 
+-	femmodel->inputs->AXPY(1,SealevelEnum,SealevelGRDEnum);
+-	femmodel->inputs->AXPY(1,BedEnum,BedGRDEnum);
++	femmodel->inputs->AXPY(1,SealevelGRDEnum,SealevelEnum);
++	femmodel->inputs->AXPY(1,BedGRDEnum,BedEnum);
+ 	if(horiz){
+-		femmodel->inputs->AXPY(1,BedEastEnum,BedEastGRDEnum);
+-		femmodel->inputs->AXPY(1,BedNorthEnum,BedNorthGRDEnum);
++		femmodel->inputs->AXPY(1,BedEastGRDEnum,BedEastEnum);
++		femmodel->inputs->AXPY(1,BedNorthGRDEnum, BedNorthEnum);
+ 	}
+ 
+ }
+@@ -1267,6 +1267,11 @@
+ 	IssmDouble  tide_love_k2secular;
+ 	IssmDouble  moi_e, moi_p;
+ 	IssmDouble	m1, m2, m3;
++	bool rotation=false;
++	
++	/*early return?:*/
++	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
++	if(!rotation)return;
+ 
+ 	/*retrieve parameters: */
+ 	femmodel->parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26146-26147.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26146-26147.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26146-26147.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26146)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26147)
+@@ -144,7 +144,7 @@
+ 
+ 	parameters->FindParam(&step,StepEnum);
+ 	parameters->FindParam(&time,TimeEnum);
+-	parameters->FindParam(&rho_water,TimeEnum);
++	parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+ 
+ 	ice->Sum(&sumice); hydro->Sum(&sumhydro); ocean->Sum(&sumocean);
+ 	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcEnum,-this->Total()/oceanarea/rho_water,step,time));
Index: /issm/oecreview/Archive/25834-26739/ISSM-26147-26148.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26147-26148.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26147-26148.diff	(revision 26740)
@@ -0,0 +1,163 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26147)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26148)
+@@ -2706,8 +2706,7 @@
+ 
+ /*MLHO*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+-
++_error_("not implemented yet");
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+@@ -2722,7 +2721,6 @@
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOFriction(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+ 
+ 	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+ 	Element* basalelement = element->SpawnBasalElement();
+@@ -2745,7 +2743,6 @@
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOViscous(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble  viscosity,Jdet,thickness,n;
+@@ -2860,7 +2857,6 @@
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* StressbalanceAnalysis::CreatePVectorMLHO(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+ 
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+@@ -2894,7 +2890,6 @@
+ 	return pe;
+ }/*}}}*/
+ ElementVector* StressbalanceAnalysis::CreatePVectorMLHODrivingStress(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+ 
+ 	/*Intermediaries */
+ 	IssmDouble  thickness,Jdet,slope[2],n;
+@@ -2942,7 +2937,6 @@
+ 	return pe;
+ }/*}}}*/
+ ElementVector* StressbalanceAnalysis::CreatePVectorMLHOFront(Element* element){/*{{{*/
+-	_error_("not implemented yet");
+ 
+ 	/*If no front, return NULL*/
+ 	if(!element->IsIcefront()) return NULL;
+@@ -2991,8 +2985,8 @@
+ 		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
+ 		pressure = ice_pressure + water_pressure;
+ 		/*Vertically integrated pressure - HO type*/
+-		s=max(0.,thickness+base-sealevel);
+-		b=min(0.,base-sealevel); 
++		b=min(0.,base-sealevel); // 0 if the bottom of the glacier is above water level
++		s=thickness+b; // ice surface regardless of whether the top of the glacier is above water level or not
+ 		water_pressure_sh = gravity*rho_water*(-b*b/2 + pow(-b,n+2)*( -s/(n+2) -b/(n+3) )/pow(thickness,n+1));
+ 		ice_pressure_sh   = gravity*rho_ice*thickness*thickness*(n+1)/(2*(n+3));
+ 		pressure_sh = ice_pressure_sh + water_pressure_sh;
+@@ -3017,8 +3011,6 @@
+ }/*}}}*/
+ void           StressbalanceAnalysis::InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element){/*{{{*/
+ 
+-	_error_("not implemented yet");
+-
+ 	int         i,dim,domaintype;
+ 	IssmDouble  rho_ice,g;
+ 	int*        doflist=NULL;
+@@ -3055,46 +3047,62 @@
+ 			basalelement = element;
+ 			break;
+ 		case Domain3DEnum:
+-			if(!element->IsOnBase()){xDelete<IssmDouble>(xyz_list); return;}
+-			basalelement=element->SpawnBasalElement();
+-			break;
++			_error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++			//if(!element->IsOnBase()){xDelete<IssmDouble>(xyz_list); return;}
++			//basalelement=element->SpawnBasalElement();
++			//break;
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+-	int numdof   = numnodes*2;
++	int numdof   = numnodes*2*2; //4 DOFs per node
+ 
+ 	/*Fetch dof list and allocate solution vectors*/
+-	basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
++	basalelement->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum); //itapopo check this
++	//basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+ 	IssmDouble* values    = xNew<IssmDouble>(numdof);
+ 	IssmDouble* vx        = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vy        = xNew<IssmDouble>(numnodes);
++   IssmDouble* vshx      = xNew<IssmDouble>(numnodes); 
++   IssmDouble* vshy      = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vz        = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vel       = xNew<IssmDouble>(numnodes);
+-
++	
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+ 
+ 	/*Transform solution in Cartesian Space*/
+ 	basalelement->TransformSolutionCoord(&values[0],XYEnum);
+-	basalelement->FindParam(&domaintype,DomainTypeEnum);
++	//basalelement->FindParam(&domaintype,DomainTypeEnum);
+ 
+-	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+-	for(i=0;i<numnodes;i++){
+-		vx[i]=values[i*2+0];
+-		vy[i]=values[i*2+1];
++   /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++   for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
++      vx[i]  =values[i+0*numnodes]; //basal vx
++      vshx[i]=values[i+1*numnodes];
++		if(xIsNan<IssmDouble>(vx[i]))		_error_("NaN found in solution vector");
++      if(xIsInf<IssmDouble>(vx[i]))		_error_("Inf found in solution vector");
++		if(xIsNan<IssmDouble>(vshx[i]))	_error_("NaN found in solution vector");
++      if(xIsInf<IssmDouble>(vshx[i]))	_error_("Inf found in solution vector");
++      //if(dim==3){
++         vy[i] =values[i+2*numnodes];
++         vshy[i]=values[i+3*numnodes];
++         if(xIsNan<IssmDouble>(vy[i]))		_error_("NaN found in solution vector");
++         if(xIsInf<IssmDouble>(vy[i]))		_error_("Inf found in solution vector");
++         if(xIsNan<IssmDouble>(vshy[i]))	_error_("NaN found in solution vector");
++         if(xIsInf<IssmDouble>(vshy[i]))	_error_("Inf found in solution vector");
++      //}
++   }
+ 
+-		/*Check solution*/
+-		if(xIsNan<IssmDouble>(vx[i])) _error_("NaN found in solution vector");
+-		if(xIsInf<IssmDouble>(vx[i])) _error_("Inf found in solution vector");
+-		if(xIsNan<IssmDouble>(vy[i])) _error_("NaN found in solution vector");
+-		if(xIsInf<IssmDouble>(vy[i])) _error_("Inf found in solution vector");
++	/*Compute suface velocities vx and vy*/
++	if(domaintype==Domain2DhorizontalEnum) {
++		for(i=0;i<numnodes;i++) vx[i]=vx[i]+vshx[i];
++		for(i=0;i<numnodes;i++) vy[i]=vy[i]+vshy[i];
+ 	}
+ 
+ 	/*Get Vz and compute vel*/
+ 	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.);
+-	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]);
++	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 
+ 
+ 	/*Add vx and vy as inputs to the tria element: */
+ 	element->AddBasalInput(VxEnum,vx,element->GetElementType());
+@@ -3106,6 +3114,8 @@
+ 	xDelete<IssmDouble>(vz);
+ 	xDelete<IssmDouble>(vy);
+ 	xDelete<IssmDouble>(vx);
++	xDelete<IssmDouble>(vshy);
++	xDelete<IssmDouble>(vshx);
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<int>(doflist);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26148-26149.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26148-26149.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26148-26149.diff	(revision 26740)
@@ -0,0 +1,461 @@
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26148)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26149)
+@@ -147,10 +147,10 @@
+ 	parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+ 
+ 	ice->Sum(&sumice); hydro->Sum(&sumhydro); ocean->Sum(&sumocean);
+-	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcEnum,-this->Total()/oceanarea/rho_water,step,time));
+-	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcIceEnum,-sumice/oceanarea/rho_water,step,time));
+-	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcHydroEnum,-sumice/oceanarea/rho_water,step,time));
+-	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcOceanEnum,-sumocean/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcEnum,this->Total()/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcIceEnum,sumice/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcHydroEnum,sumice/oceanarea/rho_water,step,time));
++	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,BslcOceanEnum,sumocean/oceanarea/rho_water,step,time));
+ 
+ 	cumice->Sum(&sumice); cumhydro->Sum(&sumhydro); cumocean->Sum(&sumocean);
+ 	results->AddResult(new GenericExternalResult<IssmDouble>(results->Size()+1,CumBslcEnum,this->CumTotal()/oceanarea/rho_water,step,time));
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26148)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26149)
+@@ -238,7 +238,7 @@
+ 		virtual void       CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble init_time,IssmDouble end_time,int averaging_method){_error_("not implemented yet "<<this->ObjectEnum());};
+ 		virtual void       ElementResponse(IssmDouble* presponse,int response_enum)=0;
+ 		virtual void       ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
+-		virtual void       ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false)=0;
++		virtual void       ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical=false)=0;
+ 		virtual int        FiniteElement(void)=0;
+ 		virtual IssmDouble FloatingArea(bool scaled)=0;
+ 		virtual void       FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure)=0;
+@@ -391,7 +391,7 @@
+ 		virtual void          DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
+ 		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+ 
+-		virtual void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze)=0;
++		virtual void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+ 		virtual void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0;
+ 		virtual void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks)=0;
+ 		virtual void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26148)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26149)
+@@ -69,7 +69,7 @@
+ 		ElementMatrix* CreateBasalMassMatrix(void);
+ 		void           CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble start_time,IssmDouble end_time,int averaging_method);
+ 		void           ElementResponse(IssmDouble* presponse,int response_enum);
+-		void           ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false){_error_("not implemented yet");};
++		void           ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
+ 		void           ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		int            FiniteElement(void);
+ 		IssmDouble     FloatingArea(bool scaled);
+@@ -228,7 +228,7 @@
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector,SealevelMasks* masks){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26148)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26149)
+@@ -53,7 +53,7 @@
+ 		void        ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int M,int N,int interp){_error_("not implemented yet");};
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp){_error_("not implemented yet");};
+ 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+-		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false){_error_("not implemented yet");};
++		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
+ 		int         FiniteElement(void);
+ 		IssmDouble  FloatingArea(bool scaled){_error_("not implemented yet");};
+@@ -183,7 +183,7 @@
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26148)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26149)
+@@ -52,7 +52,7 @@
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp){_error_("not implemented yet");};
+ 		IssmDouble  DragCoefficientAbsGradient(void){_error_("not implemented yet");};
+ 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+-		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false){_error_("not implemented yet");};
++		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		void        FaceOnBaseIndices(int* pindex1,int* pindex2,int* pindex3);
+ 		void        FaceOnFrontIndices(int* pindex1,int* pindex2,int* pindex3);
+@@ -189,7 +189,7 @@
+ 		void    DeformationFromSurfaceLoads(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet");};
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26148)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26149)
+@@ -1285,7 +1285,7 @@
+ 	_error_("Could not find 2 vertices on surface");
+ }
+ /*}}}*/
+-void       Tria::ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, bool spherical){/*{{{*/
++void       Tria::ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical){/*{{{*/
+ 
+ 	/*Look for x,y,z coordinates:*/
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+@@ -1297,9 +1297,15 @@
+ 	IssmDouble ze=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
+ 
+ 	if(!spherical){
++		IssmDouble area;
+ 		vxe->SetValue(this->sid,xe,INS_VAL);
+ 		vye->SetValue(this->sid,ye,INS_VAL);
+ 		vze->SetValue(this->sid,ze,INS_VAL);
++		area=this->GetAreaSpherical();
++		vareae->SetValue(this->sid,area,INS_VAL);
++		
++		/*in addition, put in in the inputs:*/
++		this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
+ 	}
+ 	else _error_("spherical coordinates not supported yet!");
+ 	return;
+@@ -6238,18 +6244,15 @@
+ /*}}}*/
+ 
+ //new code 
+-void       Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
++void       Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
+ 
+ 	/*diverse:*/
+ 	int nel;
+-	bool spherical=true;
+-	IssmDouble llr_list[NUMVERTICES][3];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+ 	IssmDouble area,planetarea,planetradius;
++	IssmDouble constant,ratioe;
+ 	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
+ 	IssmDouble rho_earth;
+ 	IssmDouble lati,longi;
+-	IssmDouble constant;
+ 	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
+ 	int sidlist[NUMVERTICES]; 
+ 	int sid;
+@@ -6320,10 +6323,7 @@
+ 		parameters->FindParam(&omega,RotationalAngularVelocityEnum);
+ 	}
+ 
+-	/*compute area and add to inputs:*/
+-	area=GetAreaSpherical();
+-	this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
+-	this->AddInput(SealevelAreaEnum,&area,P0Enum);
++	/*early return:*/
+ 	if(!computerigid)return;
+ 
+ 	/*recover precomputed green function kernels:*/
+@@ -6352,9 +6352,6 @@
+ 		}
+ 	}
+ 
+-	/*retrieve coordinates: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-
+ 	/*compute centroids of all elements:*/
+ 	for(int i=0;i<nel;i++){
+ 		lates[i]= asin(zze[i]/planetradius);
+@@ -6361,12 +6358,14 @@
+ 		longes[i]= atan2(yye[i],xxe[i]);
+ 	}
+ 	
+-	constant=3/rho_earth*area/planetarea;
++	
++	constant=3/rho_earth/planetarea;
+ 
+ 	/*Recover vertex absolute id: */
+ 	this->GetVerticesSidList(&sidlist[0]);
+ 
+ 	for(int e=0;e<nel;e++){
++		ratioe=constant*areae[e];
+ 		for (int i=0;i<3;i++){
+ 			IssmDouble alpha;
+ 			IssmDouble delPhi,delLambda;
+@@ -6387,11 +6386,11 @@
+ 			if(computeelastic){
+ 				G[i*nel+e]+=G_elastic_precomputed[index];
+ 			}
+-			G[i*nel+e]=G[i*nel+e]*constant;
++			G[i*nel+e]=G[i*nel+e]*ratioe;
+ 
+ 			/*Elastic components:*/
+ 			if(computeelastic){
+-				GU[i*nel+e] =  constant * U_elastic_precomputed[index];
++				GU[i*nel+e] =  ratioe * U_elastic_precomputed[index];
+ 				if(horiz){
+ 					/*Compute azimuths, both north and east components: */
+ 					x = xx[sid]; y = yy[sid]; z = zz[sid];
+@@ -6405,8 +6404,8 @@
+ 					N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+ 					E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+ 
+-					GN[i*nel+e] = constant*H_elastic_precomputed[index]*N_azim;
+-					GE[i*nel+e] = constant*H_elastic_precomputed[index]*E_azim;
++					GN[i*nel+e] = ratioe*H_elastic_precomputed[index]*N_azim;
++					GE[i*nel+e] = ratioe*H_elastic_precomputed[index]*E_azim;
+ 				}
+ 			}
+ 		}
+@@ -6438,8 +6437,6 @@
+ 			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,nel*3);
+ 		}
+ 	}
+-	this->inputs->SetDoubleInput(AreaEnum,this->lid,area); 
+-	this->AddInput(SealevelAreaEnum,&area,P0Enum);
+ 
+ 	/*Free allocations:*/
+ 	#ifdef _HAVE_RESTRICT_
+@@ -6471,12 +6468,18 @@
+ /*}}}*/
+ void       Tria::SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){ /*{{{*/
+ 
++	//Compute sea level barystatic loads (ice, water column or bottom pressure, see Farrel and Clarke, Equ. 4)
++
+ 	/*diverse:*/
+ 	IssmDouble area;
+ 	IssmDouble phi_ice=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+ 	IssmDouble phi_water=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble I,W,BP;  //change in ice thickness, water column or bottom pressure (Farrel and Clarke, Equ. 4)
+-	bool notfullygrounded=false;
++	IssmDouble phi_bp=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
++	IssmDouble I=0; //Do not change this!
++	IssmDouble W=0; //Do not change this!
++	IssmDouble BP=0; //Do not change this!
++
++		bool notfullygrounded=false;
+ 	bool computerigid= false;
+ 	int  glfraction=1;
+ 	int  npartice,nparthydro,npartocean;
+@@ -6528,6 +6531,10 @@
+ 	 * hydrology:*/
+ 	if(!isice  && !ishydro){
+ 		if(!masks->isoceanin[this->lid]){
++			constant=0;
++			#ifdef _ISSM_DEBUG_
++			this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++			#endif
+ 			return;
+ 		}
+ 
+@@ -6602,7 +6609,7 @@
+ 		/*}}}*/
+ 
+ 		/*Compute barystatic contribution in kg:*/
+-		bslcice = rho_ice*area*I;
++		bslcice = -rho_ice*phi_ice*area*I;
+ 		_assert_(!xIsNan<IssmDouble>(bslcice));
+ 
+ 		/*Transfer thickness change into kg/m^2:*/
+@@ -6612,6 +6619,11 @@
+ 	/*Deal with water loads if we are on ground:*/
+ 	if(!masks->isfullyfloating[this->lid]){
+ 
++		constant+=10; //1 for water.
++		#ifdef _ISSM_DEBUG_
++		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++		#endif
++
+ 		/*Retrieve water height at vertices: */
+ 		Input* deltathickness_input=this->GetInput(DeltaTwsEnum);
+ 		if (!deltathickness_input)_error_("DeltaTwsEnum input needed to compute sea level change!");
+@@ -6618,7 +6630,7 @@
+ 		deltathickness_input->GetInputAverage(&W);
+ 
+ 		/*Compute barystatic component in kg:*/
+-		bslchydro = rho_freshwater*area*phi_water*W;
++		bslchydro = -rho_freshwater*area*phi_water*W;
+ 		_assert_(!xIsNan<IssmDouble>(bslchydro));
+ 
+ 		/*convert from m to kg/m^2:*/
+@@ -6628,6 +6640,11 @@
+ 	/*Deal with ocean bottom pressures:*/
+ 	if(masks->isoceanin[this->lid]){
+ 
++		constant+=1; //1 for bottom pressure.
++		#ifdef _ISSM_DEBUG_
++		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++		#endif
++
+ 		/*Retrieve bottom pressure change and average over the element: */
+ 		Input* bottompressure_change_input=this->GetInput(DeltaBottomPressureEnum);
+ 		if (!bottompressure_change_input)_error_("DeltaBottomPressureEnum pressure input needed to compute sea level change fingerprint!");
+@@ -6634,10 +6651,10 @@
+ 		bottompressure_change_input->GetInputAverage(&BP);
+ 		
+ 		/*Compute barystatic component in kg:*/
+-		bslcbp = rho_water*area*BP;
++		bslcbp = -rho_water*area*phi_bp*BP;
+ 
+ 		/*convert from m to kg/m^2:*/
+-		BP=BP*rho_water;
++		BP=BP*rho_water*phi_bp;
+ 	}
+ 
+ 	/*Plug all loads into total load vector:*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26148)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26149)
+@@ -69,7 +69,7 @@
+ 		void        ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int M,int N,int interp);
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp);
+ 		void        CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
+-		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,bool spherical=false);
++		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical=false);
+ 		int         EdgeOnBaseIndex();
+ 		void        EdgeOnBaseIndices(int* pindex1,int* pindex);
+ 		int         EdgeOnSurfaceIndex();
+@@ -173,7 +173,7 @@
+ 		IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks);
+ 		void       SetSealevelMasks(SealevelMasks* masks);
+ 		
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
++		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks);
+ 		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26148)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26149)
+@@ -607,6 +607,7 @@
+ 	IssmDouble *xxe    = NULL;
+ 	IssmDouble *yye    = NULL;
+ 	IssmDouble *zze    = NULL;
++	IssmDouble* areae  = NULL;
+ 
+ 	int  horiz;
+ 	bool geometrydone = false;
+@@ -633,14 +634,15 @@
+ 
+ 	/*first, recover lat,long and radius vectors from vertices: */
+ 	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
+-	ElementCoordinatesx(&xxe,&yye,&zze,femmodel->elements);
+ 	if(horiz) VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
++	
++	/*first, recover x,y,z and areas from elements: */
++	ElementCoordinatesx(&xxe,&yye,&zze,&areae,femmodel->elements);
+ 
+-
+ 	/*Run sealevel geometry routine in elements:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		if(optim) element->SealevelchangeGeometryOptim(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
++		if(optim) element->SealevelchangeGeometryOptim(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze,areae);
+ 		else      element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
+ 	}
+ 
+@@ -653,6 +655,7 @@
+ 	xDelete<IssmDouble>(xxe);
+ 	xDelete<IssmDouble>(yye);
+ 	xDelete<IssmDouble>(zze);
++	xDelete<IssmDouble>(areae);
+ 	xDelete<IssmDouble>(latitude);
+ 	xDelete<IssmDouble>(longitude);
+ 	xDelete<IssmDouble>(radius);
+@@ -1250,12 +1253,15 @@
+ 
+ } /*}}}*/
+ IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea){ /*{{{*/
++
+ 	IssmDouble sealevelloadsaverage;	
++
+ 	Vector<IssmDouble>* sealevelloadsvolume=sealevelloads->Duplicate();
+ 	sealevelloadsvolume->PointwiseMult(sealevelloads,oceanareas);
+ 	sealevelloadsvolume->Sum(&sealevelloadsaverage);
+ 	delete sealevelloadsvolume; 
+-	return sealevelloadsaverage/oceanarea;
++	
++	return sealevelloadsaverage/oceanarea;-
+ } /*}}}*/
+ void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealevelloads){ /*{{{*/
+ 
+Index: ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(revision 26148)
++++ ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(revision 26149)
+@@ -8,7 +8,7 @@
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+ 
+-void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze,Elements* elements,bool spherical) {
++void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze, IssmDouble** pareae, Elements* elements,bool spherical) {
+ 
+ 	/*figure out how many vertices we have: */
+ 	int numberofelements=elements->NumberOfElements();
+@@ -16,11 +16,12 @@
+ 	Vector<IssmDouble>* vxe=new Vector<IssmDouble>(numberofelements);
+ 	Vector<IssmDouble>* vye=new Vector<IssmDouble>(numberofelements);
+ 	Vector<IssmDouble>* vze=new Vector<IssmDouble>(numberofelements);
++	Vector<IssmDouble>* vareae=new Vector<IssmDouble>(numberofelements);
+ 
+ 	/*march through our elements: */
+ 	for(Object* & object : elements->objects){
+ 		Element* element=(Element*)object;
+-		element->ElementCoordinates(vxe,vye,vze,spherical);
++		element->ElementCoordinates(vxe,vye,vze,vareae,spherical);
+ 	}
+ 
+ 	/*Assemble*/
+@@ -27,16 +28,19 @@
+ 	vxe->Assemble();
+ 	vye->Assemble();
+ 	vze->Assemble();
++	vareae->Assemble();
+ 
+ 	/*serialize: */
+ 	IssmDouble* xe=vxe->ToMPISerial();
+ 	IssmDouble* ye=vye->ToMPISerial();
+ 	IssmDouble* ze=vze->ToMPISerial();
++	IssmDouble* areae=vareae->ToMPISerial();
+ 
+ 	/*Free ressources: */
+ 	delete vxe;
+ 	delete vye;
+ 	delete vze;
++	delete vareae;
+ 
+ 	/*output: */
+ 	if(pxe) *pxe=xe;
+@@ -45,4 +49,7 @@
+ 	else xDelete<IssmDouble>(ye);
+ 	if(pze) *pze=ze;
+ 	else xDelete<IssmDouble>(ze);
++	if(pareae) *pareae=areae;
++	else xDelete<IssmDouble>(areae);
++
+ }
+Index: ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(revision 26148)
++++ ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(revision 26149)
+@@ -7,6 +7,6 @@
+ #include "../../classes/classes.h"
+ 
+ /* local prototypes: */
+-void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze,Elements* elements,bool spherical=false);
++void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze,IssmDouble** pareae, Elements* elements,bool spherical=false);
+ 
+ #endif  /* _ELEMENT_COORDINATESX_H */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26149-26150.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26149-26150.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26149-26150.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26149)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26150)
+@@ -1261,7 +1261,7 @@
+ 	sealevelloadsvolume->Sum(&sealevelloadsaverage);
+ 	delete sealevelloadsvolume; 
+ 	
+-	return sealevelloadsaverage/oceanarea;-
++	return sealevelloadsaverage/oceanarea;
+ } /*}}}*/
+ void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealevelloads){ /*{{{*/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26150-26151.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26150-26151.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26150-26151.diff	(revision 26740)
@@ -0,0 +1,44 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26150)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26151)
+@@ -410,6 +410,7 @@
+ 	IssmDouble*            allsealevelloads=NULL;
+ 	Vector<IssmDouble>*    oceanareas=NULL;
+ 	IssmDouble             oceanarea;
++	IssmDouble             oceanaverage;
+ 	bool                   scaleoceanarea=false;
+ 	IssmDouble             rho_water;
+ 
+@@ -495,9 +496,10 @@
+ 		element->SealevelchangeInitialConvolution(sealevelloads,oceanareas,allloads,rotationaxismotionvector,masks);
+ 	}
+ 	sealevelloads->Assemble();
+-
++	oceanareas->Assemble();
++	
+ 	//Get ocean area: 
+-	oceanareas->Assemble(); oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
++	oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+ 
+ 	//substract ocean average and barystatic contributionfrom sea level loads: 
+@@ -522,7 +524,8 @@
+ 		sealevelloads->Assemble();
+ 	
+ 		//substract ocean average and barystatic contribution
+-		sealevelloads->Shift(barycontrib->Total()/oceanarea- SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
++		oceanaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
++		sealevelloads->Shift(barycontrib->Total()/oceanarea- oceanaverage);
+ 		
+ 		//broadcast sea level loads 
+ 		allsealevelloads=sealevelloads->ToMPISerial();
+@@ -553,7 +556,7 @@
+ 
+ 	/*Update bedrock motion and geoid:*/
+ 	if(computesealevel){
+-		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/oceanarea- SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
++		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/rho_water/oceanarea- oceanaverage/rho_water);
+ 
+ 		/*cumulate barystatic contributions and save to results: */
+ 		barycontrib->Cumulate(femmodel->parameters);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26151-26152.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26151-26152.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26151-26152.diff	(revision 26740)
@@ -0,0 +1,169 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26151)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26152)
+@@ -397,6 +397,7 @@
+ 		virtual void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks)=0;
+ 		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector,  SealevelMasks* masks)=0;
+ 		virtual void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks)=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26151)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26152)
+@@ -234,6 +234,7 @@
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector,SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+ 		#endif
+ 
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26151)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26152)
+@@ -189,6 +189,7 @@
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+ 
+ #endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26151)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26152)
+@@ -195,6 +195,7 @@
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+ 
+ #endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26151)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26152)
+@@ -6964,6 +6964,13 @@
+ 	dI_list[2] = +4*M_PI*(S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	return;
+ }/*}}}*/
++void       Tria::SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){ /*{{{*/
++	
++	if(masks->isoceanin[this->lid]){
++		loads->SetValue(this->sid,offset,ADD_VAL);
++	}
++
++} /*}}}*/
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26151)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26152)
+@@ -179,6 +179,7 @@
+ 		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+ 		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks);
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks);
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+Index: ../trunk-jpl/src/c/classes/SealevelMasks.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelMasks.h	(revision 26151)
++++ ../trunk-jpl/src/c/classes/SealevelMasks.h	(revision 26152)
+@@ -17,12 +17,12 @@
+ 		bool*       isoceanin; 
+ 		
+ 		/*SealevelMasks constructors, destructors :*/
+-		SealevelMasks(int nel){
++		SealevelMasks(int localnel){
+ 			/*allocate fields:*/
+-			this->isiceonly=xNew<bool>(nel);
+-			this->isfullyfloating=xNew<bool>(nel);
+-			this->notfullygrounded=xNew<bool>(nel);
+-			this->isoceanin=xNew<bool>(nel);
++			this->isiceonly=xNew<bool>(localnel);
++			this->isfullyfloating=xNew<bool>(localnel);
++			this->notfullygrounded=xNew<bool>(localnel);
++			this->isoceanin=xNew<bool>(localnel);
+ 		};
+ 		~SealevelMasks(){
+ 			xDelete<bool>(this->isiceonly);
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26151)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26152)
+@@ -11,6 +11,7 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
++
+ /*support routines local definitions:{{{*/
+ void TransferForcing(FemModel* femmodel,int forcingenum);
+ void TransferSealevel(FemModel* femmodel,int forcingenum);
+@@ -18,6 +19,7 @@
+ IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea);
+ SealevelMasks* sealevel_masks(FemModel* femmodel);
+ void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealeveloads);
++void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, IssmDouble offset, SealevelMasks* masks);
+ /*}}}*/
+ 
+ /*main cores:*/
+@@ -502,12 +504,15 @@
+ 	oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+ 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+ 
+-	//substract ocean average and barystatic contributionfrom sea level loads: 
+-	sealevelloads->Shift(barycontrib->Total()/oceanarea - SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea));
+-	
++	//conserve ocean mass: 
++	oceanaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
++	ConserveOceanMass(femmodel,sealevelloads,barycontrib->Total()/oceanarea - oceanaverage,masks);
++
+ 	//broadcast sea level loads 
+ 	allsealevelloads=sealevelloads->ToMPISerial();
+ 
++	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,DummyEnum,allsealevelloads,nel,1,1,1));
++
+ 	//compute rotation axis motion:
+ 	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsealevelloads);
+ 	
+@@ -522,11 +527,11 @@
+ 			element->SealevelchangeOceanConvolution(sealevelloads, allsealevelloads, allloads,rotationaxismotionvector,masks);
+ 		}
+ 		sealevelloads->Assemble();
+-	
+-		//substract ocean average and barystatic contribution
++			
++		//Conserve ocean mass: 
+ 		oceanaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
+-		sealevelloads->Shift(barycontrib->Total()/oceanarea- oceanaverage);
+-		
++		ConserveOceanMass(femmodel,sealevelloads,barycontrib->Total()/oceanarea - oceanaverage,masks);
++
+ 		//broadcast sea level loads 
+ 		allsealevelloads=sealevelloads->ToMPISerial();
+ 
+@@ -1317,3 +1322,13 @@
+ 	m[1]=m2;
+ 	m[2]=m3;
+ } /*}}}*/
++void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, IssmDouble offset, SealevelMasks* masks){ /*{{{*/
++
++	/*Shift sealevel loads by ocean average, only on ocean! :*/
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeShift(sealevelloads,offset,masks);
++	}
++	sealevelloads->Assemble();
++
++} /*}}}*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26152-26153.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26152-26153.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26152-26153.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26152)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26153)
+@@ -511,8 +511,7 @@
+ 	//broadcast sea level loads 
+ 	allsealevelloads=sealevelloads->ToMPISerial();
+ 
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,DummyEnum,allsealevelloads,nel,1,1,1));
+-
++	
+ 	//compute rotation axis motion:
+ 	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsealevelloads);
+ 	
Index: /issm/oecreview/Archive/25834-26739/ISSM-26153-26154.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26153-26154.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26153-26154.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test339.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test339.m	(revision 26153)
++++ ../trunk-jpl/test/NightlyRun/test339.m	(revision 26154)
+@@ -31,7 +31,7 @@
+ field_tolerances={...
+ 	2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+ 	2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+ 	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test339.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test339.py	(revision 26153)
++++ ../trunk-jpl/test/NightlyRun/test339.py	(revision 26154)
+@@ -40,7 +40,7 @@
+                '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,
++                    2e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                     1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+ field_values = [md.results.TransientSolution[0].Vx,
+                 md.results.TransientSolution[0].Vy,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26154-26155.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26154-26155.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26154-26155.diff	(revision 26740)
@@ -0,0 +1,710 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 26154)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 26155)
+@@ -64,6 +64,7 @@
+ 		ElementVector* CreatePVectorMLHOFront(Element* element);
+ 		ElementVector* CreatePVectorMLHODrivingStress(Element* element);
+ 		void           InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element);
++		void           GetSolutionFromInputsMLHO(Vector<IssmDouble>* solution,Element* element);
+ 		/*HO*/
+ 		ElementMatrix* CreateJacobianMatrixHO(Element* element);
+ 		ElementMatrix* CreateKMatrixHO(Element* element);
+Index: ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 26154)
++++ ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 26155)
+@@ -635,7 +635,14 @@
+ 	this->ig=-1;
+ } /*}}}*/
+ void GaussTria::SynchronizeGaussBase(Gauss* gauss){/*{{{*/
++	//itapopo check this
++	_assert_(gauss->Enum()==GaussTriaEnum);
++   GaussTria* gauss_tria = xDynamicCast<GaussTria*>(gauss);
+ 
+-	_error_("not supported");
++   gauss_tria->coord1=this->coord1;
++   gauss_tria->coord2=this->coord2;
++   gauss_tria->coord3=this->coord3;
++   gauss_tria->weight=UNDEF;
++	//_error_("not supported");
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/cores/stressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 26154)
++++ ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 26155)
+@@ -18,7 +18,7 @@
+ 	/*parameters: */
+ 	bool       dakota_analysis,control_analysis;
+ 	int        domaintype;
+-	bool       isSIA,isSSA,isL1L2,isHO,isFS,isNitsche;
++	bool       isSIA,isSSA,isL1L2,isMLHO,isHO,isFS,isNitsche;
+ 	bool       save_results;
+ 	int        solution_type;
+ 	int        numoutputs        = 0;
+@@ -30,6 +30,7 @@
+ 	femmodel->parameters->FindParam(&isSIA,FlowequationIsSIAEnum);
+ 	femmodel->parameters->FindParam(&isSSA,FlowequationIsSSAEnum);
+ 	femmodel->parameters->FindParam(&isL1L2,FlowequationIsL1L2Enum);
++	femmodel->parameters->FindParam(&isMLHO,FlowequationIsMLHOEnum);
+ 	femmodel->parameters->FindParam(&isHO,FlowequationIsHOEnum);
+ 	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
+ 	femmodel->parameters->FindParam(&isNitsche,FlowequationIsNitscheEnum);
+@@ -73,7 +74,7 @@
+ 	}
+ 
+ 	/*Compute stressbalance for SSA L1L2 HO and FS*/
+-	if(isSSA || isL1L2 || isHO || isFS){
++	if(isSSA || isL1L2 || isMLHO || isHO || isFS){
+ 		analysis = new StressbalanceAnalysis();
+ 		analysis->Core(femmodel);
+ 		delete analysis;
+@@ -80,7 +81,7 @@
+ 	}
+ 
+ 	/*Compute vertical velocities*/
+-	if (domaintype==Domain3DEnum && (isSIA || isSSA || isL1L2 || isHO)){
++	if (domaintype==Domain3DEnum && (isSIA || isSSA || isL1L2 || isMLHO || isHO)){
+ 
+ 		/*We need basal melt rates for vertical velocity*/
+ 		bmb_core(femmodel);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26154)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26155)
+@@ -187,10 +187,20 @@
+ 			iomodel->DeleteData(z,"md.mesh.z");
+ 		}
+ 		else{
+-			IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
+-			if(iomodel->domaintype!=Domain2DverticalEnum){
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1);
++			if(!isMLHO){
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
++				if(iomodel->domaintype!=Domain2DverticalEnum){
++					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1);
++				}
+ 			}
++			else{//itapopo testing here
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,1);
++				if(iomodel->domaintype!=Domain2DverticalEnum){
++					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
++					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,3);
++				}
++			}
+ 		}
+ 
+ 		return;
+@@ -772,6 +782,10 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum,0.);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum,0.);
++	if(isMLHO){//itapopo
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum,0.);
++	}
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcex",LoadingforceXEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcey",LoadingforceYEnum);
+ 	#ifdef LATERALFRICTION
+@@ -1210,9 +1224,12 @@
+ 		case FSApproximationEnum: case NoneApproximationEnum:
+ 			GetSolutionFromInputsFS(solution,element);
+ 			return;
+-		case SSAApproximationEnum: case HOApproximationEnum: case L1L2ApproximationEnum: case MLHOApproximationEnum: case SIAApproximationEnum:
++		case SSAApproximationEnum: case HOApproximationEnum: case L1L2ApproximationEnum: case SIAApproximationEnum:
+ 			GetSolutionFromInputsHoriz(solution,element);
+ 			return;
++		case MLHOApproximationEnum:
++			GetSolutionFromInputsMLHO(solution,element);
++			return;
+ 		case SSAHOApproximationEnum: case HOFSApproximationEnum: case SSAFSApproximationEnum:
+ 			/*the elements around will create the solution*/
+ 			return;
+@@ -2706,10 +2723,9 @@
+ 
+ /*MLHO*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+-_error_("not implemented yet");
++
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+-
+ 	/*compute all stiffness matrices for this element*/
+ 	ElementMatrix* Ke1=CreateKMatrixMLHOViscous(element);
+ 	ElementMatrix* Ke2=CreateKMatrixMLHOFriction(element);
+@@ -2723,7 +2739,25 @@
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOFriction(Element* element){/*{{{*/
+ 
+ 	if(!element->IsOnBase() || element->IsFloating()) return NULL;
+-	Element* basalelement = element->SpawnBasalElement();
++	
++	/*Intermediaries*/
++	int      domaintype;
++   Element* basalelement;
++
++   /*Get basal element*/
++   element->FindParam(&domaintype,DomainTypeEnum);
++   switch(domaintype){
++      case Domain2DhorizontalEnum:
++         basalelement = element;
++         break;
++      case Domain3DEnum: case Domain2DverticalEnum:
++          _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++			//basalelement = element->SpawnBasalElement();
++         break;
++      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++   }
++
++	//Element* basalelement = element->SpawnBasalElement();
+ 	ElementMatrix* Ke    = basalelement->NewElementMatrix(MLHOApproximationEnum);
+ 	ElementMatrix* KeSSA = CreateKMatrixSSAFriction(basalelement); //only to get K11 and K33
+ 	
+@@ -2732,10 +2766,13 @@
+ 
+ 	for(int i=0;i<numnodes;i++){
+       for(int j=0;j<numnodes;j++){
+-         Ke->values[(i+0*numnodes)*2*2*numnodes+j+0*numnodes] = KeSSA->values[2*i*2*numnodes+2*j]; //K11
+-         Ke->values[(i+2*numnodes)*2*2*numnodes+j+2*numnodes] = KeSSA->values[(2*i+1)*2*numnodes+2*j+1]; //K33
++         Ke->values[(4*i+0)*2*2*numnodes+4*j+0] = KeSSA->values[2*i*2*numnodes+2*j]; //K11
++         Ke->values[(4*i+2)*2*2*numnodes+4*j+2] = KeSSA->values[(2*i+1)*2*numnodes+2*j+1]; //K33
+       }  
+    }
++	
++	/*Transform Coordinate System*/
++	//basalelement->TransformStiffnessMatrixCoord(Ke,XYMLHOEnum);
+ 
+ 	/*clean-up and return*/
+ 	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+@@ -2747,9 +2784,24 @@
+ 	/*Intermediaries*/
+ 	IssmDouble  viscosity,Jdet,thickness,n;
+ 	IssmDouble *xyz_list = NULL;
++	int      domaintype;
++	Element* basalelement;
+ 
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			break;
++		case Domain3DEnum: case Domain2DverticalEnum:
++			_error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++			//basalelement = element->GetBasalElement()->SpawnBasalElement(true);
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
+ 	/*Get element on base*/
+-	Element* basalelement = element->GetBasalElement()->SpawnBasalElement(true);
++	//Element* basalelement = element->GetBasalElement()->SpawnBasalElement(true);
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+@@ -2780,61 +2832,62 @@
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		n_input->GetInputValue(&n,gauss);
+ 		element->material->ViscosityL1L2(&viscosity,xyz_list,gauss,vx_input,vy_input,surface_input);
+-		
++		//viscosity=10e10;//itapopo
++
+ 		for(int i=0;i<numnodes;i++){//shape functions on tria element
+ 			for(int j=0;j<numnodes;j++){
+-				Ke->values[(i+0*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+0)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							);//K11
+-				Ke->values[(i+0*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+0)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K12
+-				Ke->values[(i+0*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+0)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							);//K13
+-				Ke->values[(i+0*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[ (4*i+0)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
+                      2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+                      )*(n+1)/(n+2);//K14
+ 				
+-				Ke->values[(i+1*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K21
+-				Ke->values[(i+1*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2)) 
+ 							+ 
+ 							gauss->weight*Jdet*viscosity*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
+ 							;//K22
+-				Ke->values[(i+1*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K23
+-				Ke->values[(i+1*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2));//K24
+ 				
+-				Ke->values[(i+2*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+ 							);//K31
+-				Ke->values[(i+2*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K32
+-				Ke->values[(i+2*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							);//K33
+-				Ke->values[(i+2*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K34
+ 
+-				Ke->values[(i+3*numnodes)*2*2*numnodes+j+0*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
+                      2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                      )*(n+1)/(n+2);//K41
+-				Ke->values[(i+3*numnodes)*2*2*numnodes+j+1*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
+                      2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                      )*2*pow(n+1,2)/((2*n+3)*(n+2));//K42
+-				Ke->values[(i+3*numnodes)*2*2*numnodes+j+2*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K43
+-				Ke->values[(i+3*numnodes)*2*2*numnodes+j+3*numnodes] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2))
+ 							+ 
+@@ -2843,9 +2896,9 @@
+ 			}
+ 		}
+ 	}
+-
++ 
+ 	/*Transform Coordinate System*/
+-	basalelement->TransformStiffnessMatrixCoord(Ke,XYEnum);
++	//basalelement->TransformStiffnessMatrixCoord(Ke,XYMLHOEnum);
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
+@@ -2877,7 +2930,7 @@
+ 			break;
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+-
++	
+ 	/*compute all load vectors for this element*/
+ 	ElementVector* pe1=CreatePVectorMLHODrivingStress(basalelement);
+ 	ElementVector* pe2=CreatePVectorMLHOFront(basalelement);
+@@ -2919,16 +2972,16 @@
+ 		surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+ 		n_input->GetInputValue(&n,gauss);
+ 
+-		for(int i=0;i<numnodes;i++){
+-			pe->values[i+0*numnodes]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
+-			pe->values[i+1*numnodes]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
+-			pe->values[i+2*numnodes]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]; //F3
+-			pe->values[i+3*numnodes]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F4
++		for(int i=0;i<numnodes;i++){// per node: vx (basal vx), vshx, vy (basal vy), vshy
++			pe->values[i*4+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
++			pe->values[i*4+1]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
++			pe->values[i*4+2]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]; //F3
++			pe->values[i*4+3]+=-rhog*thickness*slope[1]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F4
+ 		}
+ 	}
+ 
+ 	/*Transform coordinate system*/
+-	element->TransformLoadVectorCoord(pe,XYEnum);
++	//element->TransformLoadVectorCoord(pe,XYMLHOEnum);
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list);
+@@ -2992,15 +3045,15 @@
+ 		pressure_sh = ice_pressure_sh + water_pressure_sh;
+ 
+ 		for (int i=0;i<numnodes;i++){
+-			pe->values[i+0*numnodes]+= pressure*Jdet*gauss->weight*normal[0]*basis[i]; // F1
+-			pe->values[i+1*numnodes]+= pressure_sh*Jdet*gauss->weight*normal[0]*basis[i]; // F2
+-			pe->values[i+2*numnodes]+= pressure*Jdet*gauss->weight*normal[1]*basis[i]; // F3
+-			pe->values[i+3*numnodes]+= pressure_sh*Jdet*gauss->weight*normal[1]*basis[i]; // F4
++			pe->values[i*4+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i]; // F1
++			pe->values[i*4+1]+= pressure_sh*Jdet*gauss->weight*normal[0]*basis[i]; // F2
++			pe->values[i*4+2]+= pressure*Jdet*gauss->weight*normal[1]*basis[i]; // F3
++			pe->values[i*4+3]+= pressure_sh*Jdet*gauss->weight*normal[1]*basis[i]; // F4
+ 		}
+ 	}
+ 
+ 	/*Transform coordinate system*/
+-	element->TransformLoadVectorCoord(pe,XYEnum);
++	//element->TransformLoadVectorCoord(pe,XYMLHOEnum);
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list);
+@@ -3059,7 +3112,7 @@
+ 	int numdof   = numnodes*2*2; //4 DOFs per node
+ 
+ 	/*Fetch dof list and allocate solution vectors*/
+-	basalelement->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum); //itapopo check this
++	basalelement->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum); 
+ 	//basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+ 	IssmDouble* values    = xNew<IssmDouble>(numdof);
+ 	IssmDouble* vx        = xNew<IssmDouble>(numnodes);
+@@ -3072,6 +3125,11 @@
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+ 
++	std::cout<<"********  Element ID="<<element->Id()<<"\n";
++	for(i=0;i<numdof;i++){
++		std::cout<<values[i]<<"\n";
++	}
++
+ 	/*Transform solution in Cartesian Space*/
+ 	basalelement->TransformSolutionCoord(&values[0],XYEnum);
+ 	//basalelement->FindParam(&domaintype,DomainTypeEnum);
+@@ -3078,15 +3136,15 @@
+ 
+    /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+    for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+-      vx[i]  =values[i+0*numnodes]; //basal vx
+-      vshx[i]=values[i+1*numnodes];
++      vx[i]  =values[i*4+0]; //basal vx
++      vshx[i]=values[i*4+1];
+ 		if(xIsNan<IssmDouble>(vx[i]))		_error_("NaN found in solution vector");
+       if(xIsInf<IssmDouble>(vx[i]))		_error_("Inf found in solution vector");
+ 		if(xIsNan<IssmDouble>(vshx[i]))	_error_("NaN found in solution vector");
+       if(xIsInf<IssmDouble>(vshx[i]))	_error_("Inf found in solution vector");
+       //if(dim==3){
+-         vy[i] =values[i+2*numnodes];
+-         vshy[i]=values[i+3*numnodes];
++         vy[i] =values[i*4+2]; //basal vy
++         vshy[i]=values[i*4+3];
+          if(xIsNan<IssmDouble>(vy[i]))		_error_("NaN found in solution vector");
+          if(xIsInf<IssmDouble>(vy[i]))		_error_("Inf found in solution vector");
+          if(xIsNan<IssmDouble>(vshy[i]))	_error_("NaN found in solution vector");
+@@ -3094,6 +3152,10 @@
+       //}
+    }
+ 
++	/*Add vx and vy as inputs to the tria element (basal velocities): */
++	element->AddBasalInput(VxBaseEnum,vx,element->GetElementType());
++	element->AddBasalInput(VyBaseEnum,vy,element->GetElementType());
++
+ 	/*Compute suface velocities vx and vy*/
+ 	if(domaintype==Domain2DhorizontalEnum) {
+ 		for(i=0;i<numnodes;i++) vx[i]=vx[i]+vshx[i];
+@@ -3100,11 +3162,11 @@
+ 		for(i=0;i<numnodes;i++) vy[i]=vy[i]+vshy[i];
+ 	}
+ 
+-	/*Get Vz and compute vel*/
++	/*Get Vz and compute vel (surface)*/
+ 	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.);
+ 	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 
+ 
+-	/*Add vx and vy as inputs to the tria element: */
++	/*Add vx and vy as inputs to the tria element surface velocities): */
+ 	element->AddBasalInput(VxEnum,vx,element->GetElementType());
+ 	element->AddBasalInput(VyEnum,vy,element->GetElementType());
+ 	element->AddBasalInput(VelEnum,vel,element->GetElementType());
+@@ -3121,7 +3183,66 @@
+ 	xDelete<int>(doflist);
+ 	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
++void           StressbalanceAnalysis::GetSolutionFromInputsMLHO(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 
++	IssmDouble   vx,vy,vbx,vby;
++	int          domaintype,dim,approximation,dofpernode;
++	int*         doflist = NULL;
++
++	/*Get some parameters*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum: dim = 2; dofpernode = 4; break;
++		case Domain2DverticalEnum: case Domain3DEnum: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = element->GetNumberOfNodes();
++	int numdof   = numnodes*dofpernode;
++	element->GetInputValue(&approximation,ApproximationEnum);
++	if(approximation!=MLHOApproximationEnum) _error_("mesh "<<EnumToStringx(approximation)<<" not supported here");
++
++	/*Fetch dof list and allocate solution vector*/
++	element->GetDofList(&doflist,approximation,GsetEnum); 
++	IssmDouble* values = xNew<IssmDouble>(numdof);
++
++	/*Get inputs*/
++	Input* vx_input		=element->GetInput(VxEnum);		_assert_(vx_input);
++	Input* vxbase_input	=element->GetInput(VxBaseEnum);	_assert_(vxbase_input);
++	Input* vy_input		=NULL;
++	Input* vybase_input	=NULL;
++	if(domaintype!=Domain2DverticalEnum){
++		vy_input		=element->GetInput(VyEnum);		_assert_(vy_input);
++		vybase_input=element->GetInput(VyBaseEnum);	_assert_(vybase_input);
++	}
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	Gauss* gauss=element->NewGauss();
++	for(int i=0;i<numnodes;i++){
++		gauss->GaussNode(element->FiniteElement(),i);
++
++		/*Recover vx and vy*/
++		vx_input->GetInputValue(&vx,gauss);
++		vxbase_input->GetInputValue(&vbx,gauss);
++		values[i*4+0]=vbx; //basal vx
++		values[i*4+1]=vx-vbx; //shear vx
++		//if(dofpernode==2){
++			vy_input->GetInputValue(&vy,gauss);
++			vybase_input->GetInputValue(&vby,gauss);
++			values[i*4+2]=vby; //basal vy
++			values[i*4+3]=vy-vby; //shear vy  
++		//}
++	}
++
++	solution->SetValues(numdof,doflist,values,INS_VAL);
++	
++	/*Free ressources:*/
++	delete gauss;
++	xDelete<IssmDouble>(values);
++	xDelete<int>(doflist);
++}/*}}}*/
++
+ /*HO*/
+ ElementMatrix* StressbalanceAnalysis::CreateJacobianMatrixHO(Element* element){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26154)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26155)
+@@ -935,10 +935,12 @@
+ syn keyword cConstant TransientAccumulatedDeltaIceThicknessEnum
+ syn keyword cConstant VelEnum
+ syn keyword cConstant VxAverageEnum
++syn keyword cConstant VxBaseEnum
+ syn keyword cConstant VxEnum
+ syn keyword cConstant VxMeshEnum
+ syn keyword cConstant VxObsEnum
+ syn keyword cConstant VyAverageEnum
++syn keyword cConstant VyBaseEnum
+ syn keyword cConstant VyEnum
+ syn keyword cConstant VyMeshEnum
+ syn keyword cConstant VyObsEnum
+@@ -1449,6 +1451,7 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
++syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1455,8 +1458,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DatasetInput
+ syn keyword cType DataSetParam
+-syn keyword cType DatasetInput
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1469,8 +1472,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType Elements
+ syn keyword cType ElementVector
+-syn keyword cType Elements
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1477,11 +1480,12 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1496,6 +1500,7 @@
+ 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
+@@ -1506,6 +1511,7 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
++syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1518,8 +1524,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType Options
+ syn keyword cType OptionUtilities
+-syn keyword cType Options
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1533,13 +1539,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType Riftfront
+ syn keyword cType RiftStruct
+-syn keyword cType Riftfront
+ syn keyword cType SealevelMasks
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType Segment
+ syn keyword cType SegRef
+-syn keyword cType Segment
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1558,10 +1564,6 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26154)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26155)
+@@ -932,10 +932,12 @@
+ 	TransientAccumulatedDeltaIceThicknessEnum,
+ 	VelEnum,
+ 	VxAverageEnum,
++	VxBaseEnum,
+ 	VxEnum,
+ 	VxMeshEnum,
+ 	VxObsEnum,
+ 	VyAverageEnum,
++	VyBaseEnum,
+ 	VyEnum,
+ 	VyMeshEnum,
+ 	VyObsEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26154)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26155)
+@@ -937,10 +937,12 @@
+ 		case TransientAccumulatedDeltaIceThicknessEnum : return "TransientAccumulatedDeltaIceThickness";
+ 		case VelEnum : return "Vel";
+ 		case VxAverageEnum : return "VxAverage";
++		case VxBaseEnum : return "VxBase";
+ 		case VxEnum : return "Vx";
+ 		case VxMeshEnum : return "VxMesh";
+ 		case VxObsEnum : return "VxObs";
+ 		case VyAverageEnum : return "VyAverage";
++		case VyBaseEnum : return "VyBase";
+ 		case VyEnum : return "Vy";
+ 		case VyMeshEnum : return "VyMesh";
+ 		case VyObsEnum : return "VyObs";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26154)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26155)
+@@ -958,10 +958,12 @@
+ 	      else if (strcmp(name,"TransientAccumulatedDeltaIceThickness")==0) return TransientAccumulatedDeltaIceThicknessEnum;
+ 	      else if (strcmp(name,"Vel")==0) return VelEnum;
+ 	      else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
++	      else if (strcmp(name,"VxBase")==0) return VxBaseEnum;
+ 	      else if (strcmp(name,"Vx")==0) return VxEnum;
+ 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VxObs")==0) return VxObsEnum;
+ 	      else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
++	      else if (strcmp(name,"VyBase")==0) return VyBaseEnum;
+ 	      else if (strcmp(name,"Vy")==0) return VyEnum;
+ 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+ 	      else if (strcmp(name,"VyObs")==0) return VyObsEnum;
+@@ -995,12 +997,12 @@
+ 	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+ 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+-	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+-	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
++	      if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
++	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
++	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+ 	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+ 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+@@ -1118,12 +1120,12 @@
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
++	      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;
+@@ -1241,12 +1243,12 @@
+ 	      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,"Inputs")==0) return InputsEnum;
+-	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"Intersect")==0) return IntersectEnum;
++	      if (strcmp(name,"Inputs")==0) return InputsEnum;
++	      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;
+@@ -1364,12 +1366,12 @@
+ 	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SMBgradients")==0) return SMBgradientsEnum;
++	      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;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26155-26156.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26155-26156.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26155-26156.diff	(revision 26740)
@@ -0,0 +1,364 @@
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(revision 26155)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile	(revision 26156)
+@@ -1,17 +1,15 @@
+-ifeq "$(origin AR)" "undefined"
+-	AR = ar
+-endif
+-
+-ifeq "$(origin RANLIB)" "undefined"
+-	RANLIB = ranlib
+-endif
+-
+ DEST_DIR = 	../exec
+ DEST=		${DEST_DIR}/chaco
+ CC = 		gcc
+-IFLAG =		-Imain
+-CFLAGS =	-fpic -fno-omit-frame-pointer -pthread -fexceptions -g -I/mingw64/x86_64-w64-mingw32/include -Wno-implicit-function-declaration
++IFLAG =		-Imain -I/mingw64/x86_64-w64-mingw32/include
++CFLAGS =	-fPIC -fno-omit-frame-pointer -pthread -fexceptions -g -Wno-implicit-function-declaration -D_MSYS2_
+ OFLAGS =	-O2
++#AR =             /usr/ccs/bin/ar rcv   # for solaris 2
++#AR =             /usr/bin/ar rcv
++AR =             ar cr
++#RANLIB =         /usr/ccs/bin/ranlib   # for solaris 2
++#RANLIB =         /usr/bin/ranlib
++RANLIB =         ranlib
+ 
+ FILES.c=	main/user_params.c main/interface.c main/main.c \
+ 		submain/balance.c submain/divide.c submain/submain.c \
+@@ -95,7 +93,91 @@
+ 		util/update.c  util/vecout.c util/vecran.c \
+                 util/vecscale.c 
+ 
++
++FILESMINUSBLAS.c=	main/user_params.c main/interface.c main/main.c \
++		submain/balance.c submain/divide.c submain/submain.c \
++		input/input_assign.c \
++		input/check_input.c input/input.c input/input_geom.c \
++		input/input_graph.c input/read_params.c input/reflect_input.c \
++		input/read_val.c \
++		graph/check_graph.c graph/free_graph.c \
++		graph/reformat.c graph/subgraph.c graph/graph_out.c \
++		inertial/eigenvec2.c inertial/eigenvec3.c inertial/inertial.c \
++		inertial/inertial1d.c inertial/inertial2d.c \
++		inertial/inertial3d.c inertial/make_subgeom.c \
++		klspiff/buckets.c klspiff/buckets_bi.c klspiff/buckets1.c \
++		klspiff/bilistops.c klspiff/coarsen_kl.c klspiff/count_weights.c \
++		klspiff/compress_ewgts.c klspiff/kl_init.c klspiff/kl_output.c \
++		klspiff/klspiff.c klspiff/make_bndy_list.c \
++		klspiff/make_kl_list.c klspiff/nway_kl.c \
++		klvspiff/bpm_improve.c klvspiff/bucketsv.c \
++		klvspiff/clear_dvals.c klvspiff/coarsen_klv.c \
++		klvspiff/countup_vtx_sep.c klvspiff/find_bndy.c klvspiff/flow.c \
++		klvspiff/klv_init.c klvspiff/klvspiff.c klvspiff/make_bpgraph.c \
++		klvspiff/make_sep_list.c klvspiff/matching.c klvspiff/nway_klv.c \
++		klvspiff/flatten.c \
++		coarsen/coarsen.c coarsen/interpolate.c coarsen/makefgraph.c \
++		coarsen/makeccoords.c \
++		coarsen/coarsen1.c coarsen/makev2cv.c \
++		coarsen/maxmatch.c coarsen/maxmatch1.c coarsen/maxmatch2.c \
++		coarsen/maxmatch3.c coarsen/maxmatch4.c coarsen/maxmatch5.c \
++		connect/add_edges.c connect/connected.c connect/find_edges.c \
++		eigen/bidir.c eigen/bisect.c eigen/checkeig.c \
++		eigen/checkeig_ext.c \
++		eigen/checkorth.c eigen/cksturmcnt.c eigen/mkeigvecs.c\
++		eigen/eigensolve.c eigen/get_extval.c eigen/get_ritzvals.c \
++		eigen/lanczos_FO.c eigen/lanczos_SO.c eigen/lanczos_SO_float.c \
++		eigen/lanczos_ext.c eigen/lanczos_ext_float.c eigen/lanc_seconds.c\
++		eigen/lanpause.c eigen/makeorthlnk.c eigen/mkscanlist.c \
++		eigen/orthog1.c eigen/orthogonalize.c eigen/orthogvec.c \
++		eigen/ql.c eigen/rqi.c eigen/rqi_ext.c eigen/scale_diag.c \
++		eigen/scanmax.c eigen/scanmin.c eigen/solistout.c \
++                eigen/sorthog.c eigen/splarax.c eigen/sturmcnt.c \
++		eigen/Tevec.c eigen/tri_solve.c eigen/warnings.c \
++		symmlq/aprod.c symmlq/msolve.c symmlq/pow_dd.c \
++		symmlq/symmlq.c  \
++		tinvit/tinvit.c tinvit/pythag.c tinvit/epslon.c \
++		optimize/determinant.c optimize/func2d.c \
++		optimize/func3d.c optimize/opt2d.c optimize/opt3d.c \
++		assign/assign.c assign/assign_out.c assign/mapper.c \
++		assign/median.c assign/merge_assign.c \
++		assign/rec_median.c assign/rotate.c assign/y2x.c \
++		bpmatch/checkbp.c bpmatch/inits2d.c bpmatch/inits3d.c \
++		bpmatch/genvals2d.c bpmatch/genvals3d.c bpmatch/map2d.c \
++		bpmatch/map3d.c bpmatch/movevtxs.c \
++		bpmatch/sorts2d.c bpmatch/sorts3d.c \
++		refine_map/compute_cube_edata.c refine_map/compute_cube_vdata.c \
++		refine_map/refine_cube.c refine_map/update_cube_edata.c \
++		refine_map/update_cube_vdata.c refine_map/find_edge_cube.c \
++		refine_map/init_cube_edata.c refine_map/compute_mesh_edata.c \
++		refine_map/compute_mesh_vdata.c refine_map/find_edge_mesh.c \
++		refine_map/init_mesh_edata.c refine_map/refine_mesh.c \
++		refine_map/update_mesh_edata.c refine_map/update_mesh_vdata.c \
++		refine_map/refine_map.c refine_map/make_comm_graph.c \
++		refine_part/refine_part.c refine_part/kl_refine.c \
++		refine_part/make_maps_ref.c refine_part/make_terms_ref.c \
++		internal/force_internal.c internal/improve_internal.c \
++		internal/check_internal.c \
++		misc/define_subcubes.c misc/define_submeshes.c \
++		misc/divide_procs.c misc/merge_goals.c misc/make_term_props.c \
++		misc/count.c misc/countup.c misc/countup_cube.c \
++		misc/countup_mesh.c misc/make_subgoal.c \
++		misc/find_maxdeg.c misc/make_maps.c misc/make_setlists.c \
++		misc/sequence.c misc/perturb.c misc/simple_part.c \
++		misc/time_kernels.c misc/timing.c \
++		util/affirm.c util/array_alloc_2D.c util/bit_reverse.c \
++		util/checkpnt.c util/cpvec.c util/dot.c \
++		util/doubleout.c util/input_int.c util/gray.c \
++		util/machine_params.c util/makevwsqrt.c util/mkvec.c util/norm.c \
++                util/normalize.c util/mergesort.c \
++                util/randomize.c util/smalloc.c util/bail.c \
++		util/scadd.c util/seconds.c util/setvec.c util/shell_sort.c \
++		util/strout.c util/tri_prod.c util/true_or_false.c \
++		util/update.c  util/vecout.c util/vecran.c \
++                util/vecscale.c 
++
+ FILES.o=	$(FILES.c:.c=.o) 
++FILESMINUSBLAS.o=	$(FILESMINUSBLAS.c:.c=.o) 
+ 
+ 
+ ${DEST}:	${FILES.c} chaco.a Makefile
+@@ -102,10 +184,10 @@
+ 		${CC} ${OFLAGS} chaco.a -lm -o ${DEST}
+ 
+ chaco.a:	${FILES.o}
+-		${AR} cr $@ ${FILES.o} ; ${RANLIB} $@
++		${AR} $@ ${FILES.o} ; ${RANLIB} $@
+ 
+ chacominusblas.a:	${FILESMINUSBLAS.o}
+-		${AR} cr $@ ${FILESMINUSBLAS.o} ; ${RANLIB} $@
++		${AR} $@ ${FILESMINUSBLAS.o} ; ${RANLIB} $@
+ 
+ lint:
+ 		lint ${IFLAG} ${FILES.c} -lm
+Index: ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c
+===================================================================
+--- ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c	(revision 26155)
++++ ../trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c	(revision 26156)
+@@ -2,45 +2,34 @@
+  * at Sandia National Laboratories under US Department of Energy        *
+  * contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
+ 
+-/**
+- * NOTE: Under MSYS2 MinGW, we do not want to have to depend on the MSYS2 
+- *		 runtime for our distributable packages. Unfortunately, sys/resource.h 
+- *		 is not currently available for MinGW (standalone) targets under MSYS2. 
+- *		 this further means that,
+- *
+- *			-I/mingw64/x86_64-w64-mingw32/include
+- *
+- *		 should be included in CFLAGS, and that,
+- *
+- *			-I/usr/include
+- *
+- *		 should be avoided.
+- */
+-//#include   <sys/time.h>
+-//#include   <sys/resource.h>
++#if defined(_INTEL_WIN_) || defined(_MSYS2_)
+ #include   <time.h>
++#else
++#include   <sys/time.h>
++#include   <sys/resource.h>
++#endif
+ 
+ double    seconds()
+ {
+     double    curtime;
+ 
+-// #ifdef RUSAGE_SELF
++#ifdef RUSAGE_SELF
+ 
+-// /* This timer is faster and more robust (if it exists). */
+-//     struct rusage rusage;
+-//     int getrusage();
++/* This timer is faster and more robust (if it exists). */
++    struct rusage rusage;
++    int getrusage();
+  
+-//     getrusage(RUSAGE_SELF, &rusage);
+-//     curtime = ((rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec) +
+-// 	    1.0e-6 * (rusage.ru_utime.tv_usec + rusage.ru_stime.tv_usec));
++    getrusage(RUSAGE_SELF, &rusage);
++    curtime = ((rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec) +
++	    1.0e-6 * (rusage.ru_utime.tv_usec + rusage.ru_stime.tv_usec));
+ 
+-// #else
++#else
+ 
+ /* ANSI timer, but lower resolution & wraps around after ~36 minutes. */
+ 
+     curtime = clock()/((double) CLOCKS_PER_SEC);
+ 
+-// #endif
++#endif
+ 
+     return (curtime);
+ }
+Index: ../trunk-jpl/externalpackages/semic/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/semic/install.sh	(revision 26155)
++++ ../trunk-jpl/externalpackages/semic/install.sh	(revision 26156)
+@@ -8,7 +8,7 @@
+ 
+ # Cleanup
+ rm -rf ${PREFIX} src
+-mkdir -p ${PREFIX}
++mkdir -p ${PREFIX}/lib
+ 
+ # Download source
+ git clone https://github.com/mkrapp/semic.git src
+@@ -34,7 +34,7 @@
+ FC=$FC
+ FFLAGS=$FFLAGS
+ install: libutils.\$(LIB_EXT)
+-	cp libutils.\$(LIB_EXT) ${PREFIX}
++	cp libutils.\$(LIB_EXT) ${PREFIX}/lib
+ 	cp utils.mod ${PREFIX}
+ OBJECTS= utils.o
+ libutils.\$(LIB_EXT): \$(OBJECTS)
+@@ -58,7 +58,7 @@
+ FC=$FC
+ FFLAGS=$FFLAGS
+ install: libsurface_physics.\$(LIB_EXT)
+-	cp libsurface_physics.\$(LIB_EXT) ${PREFIX}
++	cp libsurface_physics.\$(LIB_EXT) ${PREFIX}/lib
+ 	cp surface_physics.mod ${PREFIX}
+ OBJECTS= surface_physics.o
+ libsurface_physics.\$(LIB_EXT): \$(OBJECTS)
+Index: ../trunk-jpl/src/c/modules/Chacox/chaco_seconds.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Chacox/chaco_seconds.cpp	(revision 26155)
++++ ../trunk-jpl/src/c/modules/Chacox/chaco_seconds.cpp	(revision 26156)
+@@ -1,6 +1,6 @@
+ /*This is needed, because the chaco library defines a "C" function seconds that conflicts with the Metis version.: */
+ 
+-#ifdef _INTEL_WIN_
++#if defined(_INTEL_WIN_) || defined(_MSYS2_)
+ #include   <time.h>
+ #else
+ #include   <sys/time.h>
+Index: ../trunk-jpl/test/NightlyRun/IdFromString.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/IdFromString.m	(revision 26155)
++++ ../trunk-jpl/test/NightlyRun/IdFromString.m	(revision 26156)
+@@ -19,11 +19,16 @@
+ 
+ %Grep string
+ if strcmp(string,'*'),
+-	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | sed -e "s/test/ /g" -e "s/\.m:/ /g" | awk {''print $2''}']);
++	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | sed -e "s/test/ /g" -e "s/\.m:/ /g" | cut -d" " -f 2']);
+ else
+-	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | grep ' string ' | sed -e "s/test/ /g" -e "s/\.m:/ /g" | awk {''print $2''}']);
++	[dummy ids_raw]=system(['find ./ -name "test[0-9]*.m" | xargs grep "%Test Name:" | grep ' string ' | sed -e "s/test/ /g" -e "s/\.m:/ /g" | cut -d" " -f 2']);
+ end
+ 
++%Check for error
++if dummy~=0,
++	error(['system call failed:' newline ids_raw]);
++end
++
+ %return if no test found
+ if isempty(ids_raw),
+ 	disp(['No test matches ''' string '''' ]);
+Index: ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26155)
++++ ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26156)
+@@ -62,5 +62,8 @@
+ #
+ # See documentation in test/NightlyRun/runme.* for more information
+ #
+-MATLAB_NROPTIONS="'id',[101,102,201,202]"
++# NOTE:
++# - test701 is skipped because it uses full Stokes equations
++#
++MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),435,701,702,703]"
+ PYTHON_NROPTIONS=""
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26155)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26156)
+@@ -319,6 +319,7 @@
+ 			export CFLAGS="-g -O3 -ipo -axAVX -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile -restrict"
+ 			AC_DEFINE([_HAVE_RESTRICT_], [1], [with restrict buffers])
+ 		elif test "${VENDOR}" == "win-msys2"; then
++			export CXXFLAGS="-D_MSYS2_"
+ 			export LDFLAGS="${LDFLAGS} -no-undefined"
+ 			export OSLIBS="-Wl,-L/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0 -Wl,-L/mingw64/x86_64-w64-mingw32/lib -Wl,-lstdc++ -Wl,-lgfortran -Wl,-lmingw32 -Wl,-lgcc_s -Wl,-lmoldname -Wl,-lmingwex -Wl,-lmsvcrt -Wl,-lm -Wl,-lpthread -Wl,-lshell32 -Wl,-luser32 -Wl,-lgdi32 -Wl,-luser32 -Wl,-ladvapi32 -Wl,-lkernel32 -Wl,-lquadmath -Wl,-lstdc++ -Wl,-lgcc"
+ 			IS_MSYS2=yes
+@@ -900,8 +901,12 @@
+ 
+ 	dnl Chaco libraries and header files
+ 	if test "x${HAVE_CHACO}" == "xyes"; then
+-		CHACOINCL=-I${CHACO_ROOT}/include
+-		CHACOLIB="-L${CHACO_ROOT}/lib -lchacominusblas"
++		CHACOINCL="-I${CHACO_ROOT}/include"
++		if test "${IS_MSYS2}" == "yes"; then
++			CHACOLIB="-Wl,-L${CHACO_ROOT}/lib -Wl,-lchacominusblas"
++		else
++			CHACOLIB="-L${CHACO_ROOT}/lib -lchacominusblas"
++		fi
+ 		AC_DEFINE([_HAVE_CHACO_], [1], [with Chaco in ISSM src])
+ 		AC_SUBST([CHACOINCL])
+ 		AC_SUBST([CHACOLIB])
+@@ -1662,7 +1667,11 @@
+ 
+ 	dnl M1QN3 libraries and header files
+ 	if test "x${HAVE_M1QN3}" == "xyes"; then
+-		M1QN3LIB="${M1QN3_ROOT}/libm1qn3.a ${M1QN3_ROOT}/libddot.a"
++		if test "${IS_MSYS2}" == "yes"; then
++			M1QN3LIB="-Wl,${M1QN3_ROOT}/libm1qn3.a -Wl,${M1QN3_ROOT}/libddot.a"
++		else
++			M1QN3LIB="${M1QN3_ROOT}/libm1qn3.a ${M1QN3_ROOT}/libddot.a"
++		fi
+ 		AC_DEFINE([_HAVE_M1QN3_], [1], [with M1QN3 in ISSM src])
+ 		AC_SUBST([M1QN3LIB])
+ 	fi
+@@ -2116,8 +2125,12 @@
+ 	dnl SEMIC libraries and header files
+ 	if test "x${HAVE_SEMIC}" == "xyes"; then
+ 		SEMICINCL="-I${SEMIC_ROOT}"
++		if test "${IS_MSYS2}" == "yes"; then
++			SEMICLIB="-Wl,-L${SEMIC_ROOT}/lib -Wl,-lsurface_physics -Wl,-lutils"
++		else
++			SEMICLIB="-L${SEMIC_ROOT}/lib -lsurface_physics -lutils"
++		fi
+ 		AC_DEFINE([_HAVE_SEMIC_], [1], [with SEMIC in ISSM src])
+-		SEMICLIB="-L${SEMIC_ROOT} -lsurface_physics -lutils"
+ 		AC_SUBST([SEMICLIB])
+ 		AC_SUBST([SEMICINCL])
+ 	fi
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26155)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26156)
+@@ -706,7 +706,7 @@
+ 
+ if !WINDOWS
+ if !STANDALONE_LIBRARIES
+-libISSMCore_la_LIBADD = $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
++libISSMCore_la_LIBADD = $(CHACOLIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
+ if FORTRAN
+ libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
+ endif
+@@ -732,7 +732,7 @@
+ if STANDALONE_LIBRARIES
+ libISSMModules_la_LIBADD = ./libISSMCore.la
+ else
+-libISSMModules_la_LIBADD = ./libISSMCore.la $(TRIANGLELIB) $(CHACOLIB)
++libISSMModules_la_LIBADD = ./libISSMCore.la $(TRIANGLELIB) $(CHACOLIB) $(BLASLAPACKLIB) $(OSLIBS)
+ endif
+ endif
+ endif
+@@ -822,7 +822,7 @@
+ endif
+ 
+ #External packages
+-LDADD += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
++LDADD += $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
+ 
+ if FORTRAN
+ LDADD += $(FLIBS) $(FORTRANLIB)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26156-26157.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26156-26157.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26156-26157.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26156)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26157)
+@@ -281,6 +281,7 @@
+ 	InputUpdateFromVectorx(femmodel,U_grd,SealevelUGrdEnum,VertexSIdEnum); 
+ 	InputUpdateFromVectorx(femmodel,N_grd,SealevelEnum,VertexSIdEnum); 
+ 	InputUpdateFromVectorx(femmodel,N_grd,SealevelNGrdEnum,VertexSIdEnum); 
++	InputUpdateFromVectorx(femmodel,bedrock,BedEnum,VertexSIdEnum); 
+ 	if(RSLg)InputUpdateFromVectorx(femmodel,RSLg,SealevelRSLEnum,VertexSIdEnum); 
+ 	if(RSLg_barystatic)InputUpdateFromVectorx(femmodel,RSLg_barystatic,SealevelRSLBarystaticEnum,VertexSIdEnum); 
+ 	if (horiz){
Index: /issm/oecreview/Archive/25834-26739/ISSM-26157-26158.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26157-26158.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26157-26158.diff	(revision 26740)
@@ -0,0 +1,197 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26157)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26158)
+@@ -5533,17 +5533,86 @@
+ 		dI_list[1] = -4*M_PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+ 		dI_list[2] = +4*M_PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	}
+-	else if(masks->isiceonly[this->lid]){
+-		IssmDouble rho_ice, I;
++	if(masks->isiceonly[this->lid]){
++		
++		IssmDouble rho_ice,I;
++		bool computerigid= false;
++	
++		bool notfullygrounded=false;
++	
++		bool scaleoceanarea= false;
++		int  glfraction=1;
++		IssmDouble phi=1.0;
++		/*{{{*/
++	
++		
+ 
+-		/*recover material parameters: */
++		if (masks->isfullyfloating[this->lid]){
++			I=0;
++			this->AddInput(EffectivePressureEnum,&I,P0Enum);
++			return;
++		}
++			
++
++	
++		if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
++
++		/*recover some parameters:*/
+ 		rho_ice=FindParam(MaterialsRhoIceEnum);
++		this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
++		this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
++		this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+ 
+-		/*Compute ice thickness change: */
++		/*Get area of element: precomputed in the sealevelchange_geometry:*/
++		this->Element::GetInputValue(&area,AreaEnum);
++
++		/*Compute fraction of the element that is grounded: */
++		if(notfullygrounded){
++			IssmDouble xyz_list[NUMVERTICES][3];
++			::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++
++			phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
++			if(glfraction==0)phi=1;
++			#ifdef _ISSM_DEBUG_
++			this->AddInput(SealevelBarystaticMaskEnum,&phi,P0Enum);
++			#endif
++		}
++		else phi=1.0;
++
++		/*Retrieve surface load for ice: */
+ 		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+-		if (!deltathickness_input)_error_("DeltaIceThicknessEnum delta ice thickness input needed to compute sea level change!");
+-		deltathickness_input->GetInputAverage(&I);
++		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+ 
++		/*/Average ice thickness over grounded area of the element only: {{{*/
++		if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
++		else{
++			IssmDouble total_weight=0;
++			bool mainlyfloating = true;
++			int         point1;
++			IssmDouble  fraction1,fraction2;
++
++			/*Recover portion of element that is grounded*/
++			this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
++			Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
++
++			/* Start  looping on the number of gaussian points and average over these gaussian points: */
++			total_weight=0;
++			I=0;
++			while(gauss->next()){
++				IssmDouble Ig=0;
++				deltathickness_input->GetInputValue(&Ig,gauss);
++				I+=Ig*gauss->weight;
++				total_weight+=gauss->weight;
++			}
++			I=I/total_weight;
++			delete gauss;
++		}
++		/*}}}*/
++
++		/*}}}*/
++		/*convert to kg/m^2*/
++		I=I*phi;
++
+ 		dI_list[0] = -4*M_PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+ 		dI_list[1] = -4*M_PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+ 		dI_list[2] = +4*M_PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+@@ -6052,7 +6121,9 @@
+ 
+ 	/*diverse:*/
+ 	int gsize;
+-	IssmDouble I, S, BP;		//change in relative ice thickness and sea level
++	IssmDouble I=0;
++	IssmDouble S=0;
++	IssmDouble BP=0;
+ 	IssmDouble rho_ice,rho_water;
+ 	int horiz;
+ 	int  bp_compute_fingerprints= 0;
+@@ -6064,6 +6135,12 @@
+ 
+ 	/*computational flags:*/
+ 	bool computeelastic= false;
++	bool computerigid= false;
++	bool notfullygrounded=false;
++	bool scaleoceanarea= false;
++	int  glfraction=1;
++	IssmDouble area;
++	IssmDouble phi=1.0;
+ 
+ 	/*early return if we are not on the ocean or on an ice cap:*/
+ 	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]) return;
+@@ -6115,16 +6192,69 @@
+ 			}
+ 		}
+ 	}
+-	else if (masks->isiceonly[this->lid]){
++	if (masks->isiceonly[this->lid]){
+ 
+-		/*Compute ice thickness change: */
++		if (masks->isfullyfloating[this->lid]) return;
++
++	
++		if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
++
++		/*recover some parameters:*/
++		rho_ice=FindParam(MaterialsRhoIceEnum);
++		rho_water=FindParam(MaterialsRhoSeawaterEnum);
++		this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
++		this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
++		this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
++
++		/*Get area of element: precomputed in the sealevelchange_geometry:*/
++		this->Element::GetInputValue(&area,AreaEnum);
++
++		/*Compute fraction of the element that is grounded: */
++		if(notfullygrounded){
++			IssmDouble xyz_list[NUMVERTICES][3];
++			::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++
++			phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
++			if(glfraction==0)phi=1;
++			#ifdef _ISSM_DEBUG_
++			this->AddInput(SealevelBarystaticMaskEnum,&phi,P0Enum);
++			#endif
++		}
++		else phi=1.0;
++
++		/*Retrieve surface load for ice: */
+ 		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+-		if (!deltathickness_input)_error_("DeltaIceThicknessEnum delta thickness input needed to compute sea level change!");
+-		deltathickness_input->GetInputAverage(&I);
++		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+ 
++		/*/Average ice thickness over grounded area of the element only: {{{*/
++		if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
++		else{
++			IssmDouble total_weight=0;
++			bool mainlyfloating = true;
++			int         point1;
++			IssmDouble  fraction1,fraction2;
++
++			/*Recover portion of element that is grounded*/
++			this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
++			Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
++
++			/* Start  looping on the number of gaussian points and average over these gaussian points: */
++			total_weight=0;
++			I=0;
++			while(gauss->next()){
++				IssmDouble Ig=0;
++				deltathickness_input->GetInputValue(&Ig,gauss);
++				I+=Ig*gauss->weight;
++				total_weight+=gauss->weight;
++			}
++			I=I/total_weight;
++			delete gauss;
++		}
++		/*}}}*/
++
+ 		/*convert to kg/m^2*/
+-		I=I*rho_ice;
+-
++		I=I*rho_ice*phi;
++		
+ 		for(int i=0;i<gsize;i++){
+ 			Up[i]+=I*GU[i];
+ 			if(horiz){
Index: /issm/oecreview/Archive/25834-26739/ISSM-26158-26159.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26158-26159.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26158-26159.diff	(revision 26740)
@@ -0,0 +1,1032 @@
+Index: ../trunk-jpl/test/Archives/Archive131.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive131.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive132.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive132.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive133.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive133.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive491.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive491.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive492.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive492.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive493.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive493.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive494.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive494.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive495.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive495.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test131.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test131.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test131.m	(revision 26159)
+@@ -0,0 +1,15 @@
++%Test Name: SquareShelfConstrainedMasstransp2dStreamline
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.masstransport.stabilization=2;
++md=solve(md,'Masstransport');
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.MasstransportSolution.Thickness),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test131.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test131.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test131.py	(revision 26159)
+@@ -0,0 +1,24 @@
++#Test Name: SquareShelfConstrainedMasstransp2dStreamline 
++from model import *
++from socket import gethostname
++from triangle import *
++from meshconvert import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 150000)
++md = meshconvert(md)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelfConstrained.py')
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.masstransport.stabilization = 2
++md = solve(md, 'Masstransport')
++
++#Fields and tolerances to track changes
++field_names = ['Thickness']
++field_tolerances = [1e-13]
++field_values = [md.results.MasstransportSolution.Thickness]
+Index: ../trunk-jpl/test/NightlyRun/test132.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test132.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test132.m	(revision 26159)
+@@ -0,0 +1,15 @@
++%Test Name: SquareShelfConstrainedMasstransp2dFCT
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.masstransport.stabilization=4;
++md=solve(md,'Masstransport');
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.MasstransportSolution.Thickness),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test132.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test132.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test132.py	(revision 26159)
+@@ -0,0 +1,24 @@
++#Test Name: SquareShelfConstrainedMasstransp2dFCT 
++from model import *
++from socket import gethostname
++from triangle import *
++from meshconvert import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 150000)
++md = meshconvert(md)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelfConstrained.py')
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.masstransport.stabilization = 4
++md = solve(md, 'Masstransport')
++
++#Fields and tolerances to track changes
++field_names = ['Thickness']
++field_tolerances = [1e-13]
++field_values = [md.results.MasstransportSolution.Thickness]
+Index: ../trunk-jpl/test/NightlyRun/test133.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test133.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test133.m	(revision 26159)
+@@ -0,0 +1,15 @@
++%Test Name: SquareShelfConstrainedMasstransp2dSUPG
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.masstransport.stabilization=5;
++md=solve(md,'Masstransport');
++
++%Fields and tolerances to track changes
++field_names     ={'Thickness'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.MasstransportSolution.Thickness),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test133.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test133.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test133.py	(revision 26159)
+@@ -0,0 +1,24 @@
++#Test Name: SquareShelfConstrainedMasstransp2dSUPG
++from model import *
++from socket import gethostname
++from triangle import *
++from meshconvert import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 150000)
++md = meshconvert(md)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelfConstrained.py')
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.masstransport.stabilization = 5
++md = solve(md, 'Masstransport')
++
++#Fields and tolerances to track changes
++field_names = ['Thickness']
++field_tolerances = [1e-13]
++field_values = [md.results.MasstransportSolution.Thickness]
+Index: ../trunk-jpl/test/NightlyRun/test491.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test491.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test491.m	(revision 26159)
+@@ -0,0 +1,69 @@
++%Test Name: SquareSheetShelfTranMeltArtDiff
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.geometry.bed=md.geometry.base;
++pos=find(md.mask.ocean_levelset<0);
++md.geometry.bed(pos)=md.geometry.base(pos)-10;
++md.friction=frictioncoulomb();
++md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
++md.masstransport.stabilization=1;
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names={...
++	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
++};
++field_tolerances={...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).GroundedArea),...
++	(md.results.TransientSolution(1).FloatingArea),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).GroundedArea),...
++	(md.results.TransientSolution(2).FloatingArea),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).GroundedArea),...
++	(md.results.TransientSolution(3).FloatingArea),...
++	(md.results.TransientSolution(3).TotalFloatingBmb),...
++	(md.results.TransientSolution(3).TotalGroundedBmb),...
++	(md.results.TransientSolution(3).TotalSmb),...
++};
+Index: ../trunk-jpl/test/NightlyRun/test491.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test491.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test491.py	(revision 26159)
+@@ -0,0 +1,80 @@
++#Test Name: SquareSheetShelfTranMeltArtDiff 
++import numpy as np
++from model import *
++from socket import gethostname
++
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from frictioncoulomb import frictioncoulomb
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md.geometry.bed = copy.deepcopy(md.geometry.base)
++pos = np.nonzero(md.mask.ocean_levelset < 0.)
++md.geometry.bed[pos] = md.geometry.bed[pos] - 10
++md.friction = frictioncoulomb()
++md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
++md.friction.p = 1 * np.ones(md.mesh.numberofelements)
++md.friction.q = 1 * np.ones(md.mesh.numberofelements)
++md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
++md.masstransport.stabilization = 1
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
++    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
++]
++field_tolerances = [
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++]
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Pressure,
++    md.results.TransientSolution[0].Base,
++    md.results.TransientSolution[0].Surface,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].GroundedArea,
++    md.results.TransientSolution[0].FloatingArea,
++    md.results.TransientSolution[0].TotalFloatingBmb,
++    md.results.TransientSolution[0].TotalGroundedBmb,
++    md.results.TransientSolution[0].TotalSmb,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Pressure,
++    md.results.TransientSolution[1].Base,
++    md.results.TransientSolution[1].Surface,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].GroundedArea,
++    md.results.TransientSolution[1].FloatingArea,
++    md.results.TransientSolution[1].TotalFloatingBmb,
++    md.results.TransientSolution[1].TotalGroundedBmb,
++    md.results.TransientSolution[1].TotalSmb,
++    md.results.TransientSolution[2].Vx,
++    md.results.TransientSolution[2].Vy,
++    md.results.TransientSolution[2].Vel,
++    md.results.TransientSolution[2].Pressure,
++    md.results.TransientSolution[2].Base,
++    md.results.TransientSolution[2].Surface,
++    md.results.TransientSolution[2].Thickness,
++    md.results.TransientSolution[2].GroundedArea,
++    md.results.TransientSolution[2].FloatingArea,
++    md.results.TransientSolution[2].TotalFloatingBmb,
++    md.results.TransientSolution[2].TotalGroundedBmb,
++    md.results.TransientSolution[2].TotalSmb
++]
+Index: ../trunk-jpl/test/NightlyRun/test492.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test492.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test492.m	(revision 26159)
+@@ -0,0 +1,69 @@
++%Test Name: SquareSheetShelfTranMeltStreamlineUpwind
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.geometry.bed=md.geometry.base;
++pos=find(md.mask.ocean_levelset<0);
++md.geometry.bed(pos)=md.geometry.base(pos)-10;
++md.friction=frictioncoulomb();
++md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
++md.masstransport.stabilization=2;
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names={...
++	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
++};
++field_tolerances={...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).GroundedArea),...
++	(md.results.TransientSolution(1).FloatingArea),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).GroundedArea),...
++	(md.results.TransientSolution(2).FloatingArea),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).GroundedArea),...
++	(md.results.TransientSolution(3).FloatingArea),...
++	(md.results.TransientSolution(3).TotalFloatingBmb),...
++	(md.results.TransientSolution(3).TotalGroundedBmb),...
++	(md.results.TransientSolution(3).TotalSmb),...
++};
+Index: ../trunk-jpl/test/NightlyRun/test492.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test492.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test492.py	(revision 26159)
+@@ -0,0 +1,80 @@
++#Test Name: SquareSheetShelfTranMeltStreamlineUpwind 
++import numpy as np
++from model import *
++from socket import gethostname
++
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from frictioncoulomb import frictioncoulomb
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md.geometry.bed = copy.deepcopy(md.geometry.base)
++pos = np.nonzero(md.mask.ocean_levelset < 0.)
++md.geometry.bed[pos] = md.geometry.bed[pos] - 10
++md.friction = frictioncoulomb()
++md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
++md.friction.p = 1 * np.ones(md.mesh.numberofelements)
++md.friction.q = 1 * np.ones(md.mesh.numberofelements)
++md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
++md.masstransport.stabilization = 2
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
++    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
++]
++field_tolerances = [
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++]
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Pressure,
++    md.results.TransientSolution[0].Base,
++    md.results.TransientSolution[0].Surface,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].GroundedArea,
++    md.results.TransientSolution[0].FloatingArea,
++    md.results.TransientSolution[0].TotalFloatingBmb,
++    md.results.TransientSolution[0].TotalGroundedBmb,
++    md.results.TransientSolution[0].TotalSmb,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Pressure,
++    md.results.TransientSolution[1].Base,
++    md.results.TransientSolution[1].Surface,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].GroundedArea,
++    md.results.TransientSolution[1].FloatingArea,
++    md.results.TransientSolution[1].TotalFloatingBmb,
++    md.results.TransientSolution[1].TotalGroundedBmb,
++    md.results.TransientSolution[1].TotalSmb,
++    md.results.TransientSolution[2].Vx,
++    md.results.TransientSolution[2].Vy,
++    md.results.TransientSolution[2].Vel,
++    md.results.TransientSolution[2].Pressure,
++    md.results.TransientSolution[2].Base,
++    md.results.TransientSolution[2].Surface,
++    md.results.TransientSolution[2].Thickness,
++    md.results.TransientSolution[2].GroundedArea,
++    md.results.TransientSolution[2].FloatingArea,
++    md.results.TransientSolution[2].TotalFloatingBmb,
++    md.results.TransientSolution[2].TotalGroundedBmb,
++    md.results.TransientSolution[2].TotalSmb
++]
+Index: ../trunk-jpl/test/NightlyRun/test495.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test495.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test495.m	(revision 26159)
+@@ -0,0 +1,69 @@
++%Test Name: SquareSheetShelfTranMeltSUPG
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.geometry.bed=md.geometry.base;
++pos=find(md.mask.ocean_levelset<0);
++md.geometry.bed(pos)=md.geometry.base(pos)-10;
++md.friction=frictioncoulomb();
++md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
++md.masstransport.stabilization=5;
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names={...
++	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
++};
++field_tolerances={...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).GroundedArea),...
++	(md.results.TransientSolution(1).FloatingArea),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).GroundedArea),...
++	(md.results.TransientSolution(2).FloatingArea),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).GroundedArea),...
++	(md.results.TransientSolution(3).FloatingArea),...
++	(md.results.TransientSolution(3).TotalFloatingBmb),...
++	(md.results.TransientSolution(3).TotalGroundedBmb),...
++	(md.results.TransientSolution(3).TotalSmb),...
++};
+Index: ../trunk-jpl/test/NightlyRun/test495.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test495.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test495.py	(revision 26159)
+@@ -0,0 +1,80 @@
++#Test Name: SquareSheetShelfTranMeltSUPG 
++import numpy as np
++from model import *
++from socket import gethostname
++
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from frictioncoulomb import frictioncoulomb
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md.geometry.bed = copy.deepcopy(md.geometry.base)
++pos = np.nonzero(md.mask.ocean_levelset < 0.)
++md.geometry.bed[pos] = md.geometry.bed[pos] - 10
++md.friction = frictioncoulomb()
++md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
++md.friction.p = 1 * np.ones(md.mesh.numberofelements)
++md.friction.q = 1 * np.ones(md.mesh.numberofelements)
++md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
++md.masstransport.stabilization = 5
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
++    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
++]
++field_tolerances = [
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++]
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Pressure,
++    md.results.TransientSolution[0].Base,
++    md.results.TransientSolution[0].Surface,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].GroundedArea,
++    md.results.TransientSolution[0].FloatingArea,
++    md.results.TransientSolution[0].TotalFloatingBmb,
++    md.results.TransientSolution[0].TotalGroundedBmb,
++    md.results.TransientSolution[0].TotalSmb,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Pressure,
++    md.results.TransientSolution[1].Base,
++    md.results.TransientSolution[1].Surface,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].GroundedArea,
++    md.results.TransientSolution[1].FloatingArea,
++    md.results.TransientSolution[1].TotalFloatingBmb,
++    md.results.TransientSolution[1].TotalGroundedBmb,
++    md.results.TransientSolution[1].TotalSmb,
++    md.results.TransientSolution[2].Vx,
++    md.results.TransientSolution[2].Vy,
++    md.results.TransientSolution[2].Vel,
++    md.results.TransientSolution[2].Pressure,
++    md.results.TransientSolution[2].Base,
++    md.results.TransientSolution[2].Surface,
++    md.results.TransientSolution[2].Thickness,
++    md.results.TransientSolution[2].GroundedArea,
++    md.results.TransientSolution[2].FloatingArea,
++    md.results.TransientSolution[2].TotalFloatingBmb,
++    md.results.TransientSolution[2].TotalGroundedBmb,
++    md.results.TransientSolution[2].TotalSmb
++]
+Index: ../trunk-jpl/test/NightlyRun/test493.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test493.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test493.m	(revision 26159)
+@@ -0,0 +1,70 @@
++%Test Name: SquareSheetShelfTranMeltDG
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.geometry.bed=md.geometry.base;
++pos=find(md.mask.ocean_levelset<0);
++md.geometry.bed(pos)=md.geometry.base(pos)-10;
++md.friction=frictioncoulomb();
++md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
++md.masstransport.stabilization=3;
++md.masstransport.spcthickness=md.geometry.thickness;
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names={...
++	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
++};
++field_tolerances={...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).GroundedArea),...
++	(md.results.TransientSolution(1).FloatingArea),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).GroundedArea),...
++	(md.results.TransientSolution(2).FloatingArea),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).GroundedArea),...
++	(md.results.TransientSolution(3).FloatingArea),...
++	(md.results.TransientSolution(3).TotalFloatingBmb),...
++	(md.results.TransientSolution(3).TotalGroundedBmb),...
++	(md.results.TransientSolution(3).TotalSmb),...
++};
+Index: ../trunk-jpl/test/NightlyRun/test493.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test493.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test493.py	(revision 26159)
+@@ -0,0 +1,81 @@
++#Test Name: SquareSheetShelfTranMeltDG 
++import numpy as np
++from model import *
++from socket import gethostname
++
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from frictioncoulomb import frictioncoulomb
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md.geometry.bed = copy.deepcopy(md.geometry.base)
++pos = np.nonzero(md.mask.ocean_levelset < 0.)
++md.geometry.bed[pos] = md.geometry.bed[pos] - 10
++md.friction = frictioncoulomb()
++md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
++md.friction.p = 1 * np.ones(md.mesh.numberofelements)
++md.friction.q = 1 * np.ones(md.mesh.numberofelements)
++md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
++md.masstransport.stabilization = 3
++md.masstransport.spcthickness = md.geometry.thickness
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
++    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
++]
++field_tolerances = [
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 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: ../trunk-jpl/test/NightlyRun/test494.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test494.m	(revision 26159)
+@@ -0,0 +1,69 @@
++%Test Name: SquareSheetShelfTranMeltFCT
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.geometry.bed=md.geometry.base;
++pos=find(md.mask.ocean_levelset<0);
++md.geometry.bed(pos)=md.geometry.base(pos)-10;
++md.friction=frictioncoulomb();
++md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
++md.masstransport.stabilization=4;
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names={...
++	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
++};
++field_tolerances={...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,2e-13,4e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).GroundedArea),...
++	(md.results.TransientSolution(1).FloatingArea),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).GroundedArea),...
++	(md.results.TransientSolution(2).FloatingArea),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).GroundedArea),...
++	(md.results.TransientSolution(3).FloatingArea),...
++	(md.results.TransientSolution(3).TotalFloatingBmb),...
++	(md.results.TransientSolution(3).TotalGroundedBmb),...
++	(md.results.TransientSolution(3).TotalSmb),...
++};
+Index: ../trunk-jpl/test/NightlyRun/test494.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test494.py	(revision 26159)
+@@ -0,0 +1,80 @@
++#Test Name: SquareSheetShelfTranMeltFCT 
++import numpy as np
++from model import *
++from socket import gethostname
++
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from frictioncoulomb import frictioncoulomb
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md.geometry.bed = copy.deepcopy(md.geometry.base)
++pos = np.nonzero(md.mask.ocean_levelset < 0.)
++md.geometry.bed[pos] = md.geometry.bed[pos] - 10
++md.friction = frictioncoulomb()
++md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
++md.friction.p = 1 * np.ones(md.mesh.numberofelements)
++md.friction.q = 1 * np.ones(md.mesh.numberofelements)
++md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
++md.masstransport.stabilization = 4
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
++    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
++]
++field_tolerances = [
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 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/oecreview/Archive/25834-26739/ISSM-26159-26160.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26159-26160.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26159-26160.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 26159)
++++ ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 26160)
+@@ -281,7 +281,7 @@
+ 	}
+ 	else{
+ 		int* temp = xNew<int>(3);
+-		_error_("not supported");
++		_error_("Gradient is of type "<<EnumToStringx(this->gradient->ObjectEnum()) <<", which is not supported yet");
+ 	}
+ 
+ }
Index: /issm/oecreview/Archive/25834-26739/ISSM-26160-26161.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26160-26161.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26160-26161.diff	(revision 26740)
@@ -0,0 +1,126 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26160)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26161)
+@@ -818,6 +818,121 @@
+ 			md2.mesh.extractedvertices=pos_node;
+ 			md2.mesh.extractedelements=pos_elem;
+ 		end % }}}
++		function md2 = refine(md) % {{{
++			%refine - split all triangles into 3 to refine the mesh everywhere
++			%
++			%   This function only works for 2d triangle meshes
++			%
++			%   Usage:
++			%      md2=refine(md);
++			%
++			%   See also: EXTRUDE, COLLAPSE, EXTRACT
++
++			%Check incoming 
++			if ~strcmp(elementtype(md.mesh),'Tria')
++				error('not supported for 3d meshes');
++			end
++
++			%copy model
++			md2=md;
++
++			disp('Getting edges');
++			%initialization of some variables
++			nbe   = md.mesh.numberofelements;
++			nbv   = md.mesh.numberofvertices;
++			index = md.mesh.elements;
++			elementslist=1:nbe;
++			%1: list of edges
++			edges=[index(:,[1,2]); index(:,[2,3]); index(:,[3,1])];
++			%2: find unique edges
++			[edges,I,J]=unique(sort(edges,2),'rows');
++			%3: unique edge numbers
++			vec=J;
++			%4: unique edges numbers in each triangle (2 triangles sharing the same edge will have the same edge number)
++			edges_tria=[vec(elementslist+nbe) vec(elementslist+2*nbe) vec(elementslist)];
++
++			% We divide each element as follows
++			%
++			%                   e2
++			%    n1 ------------+------------ n3
++			%       \          / \          /
++			%        \    1   /   \   3    /
++			%         \      /     \      /
++			%          \    /   2   \    /
++			%           \  /         \  /
++			%         e3 +____________\/ e1
++			%             \           /
++			%              \         /
++			%               \   4   /
++			%                \     /
++			%                 \   /
++			%                   n2
++
++			%Create new coordinates
++			disp('Remeshing...');
++			x_edges = 0.5*(md.mesh.x(edges(:,1)) + md.mesh.x(edges(:,2)));
++			y_edges = 0.5*(md.mesh.y(edges(:,1)) + md.mesh.y(edges(:,2)));
++			md2.mesh.x = [md2.mesh.x;x_edges];
++			md2.mesh.y = [md2.mesh.y;y_edges];
++			md2.mesh.elements = [...
++				index(:,1)          nbv+edges_tria(:,3) nbv+edges_tria(:,2);...
++				nbv+edges_tria(:,2) nbv+edges_tria(:,3) nbv+edges_tria(:,1);...
++				nbv+edges_tria(:,2) nbv+edges_tria(:,1) index(:,3);...
++				nbv+edges_tria(:,3) index(:,2)          nbv+edges_tria(:,1)];
++			md2.mesh.numberofelements = 4*nbe;
++			md2.mesh.numberofvertices = nbv + size(edges,1);
++			disp(['   Old number of elements: ' num2str(nbe)]);
++			disp(['   New number of elements: ' num2str(4*nbe)]);
++
++			disp('Interpolate all fields');
++			numberofvertices1 = md.mesh.numberofvertices;
++			numberofelements1 = md.mesh.numberofelements;
++			nbv2 = md2.mesh.numberofvertices;
++			%Create transformation vectors
++			nbedges = size(edges,1);
++			Pelem = sparse(1:4*nbe,repmat([1:nbe],1,4),ones(4*nbe,1),4*nbe,nbe);
++			Pnode = sparse([1:nbv,repmat([nbv+1:nbv+nbedges],1,2)],[1:nbv edges(:)'],[ones(nbv,1);1/2*ones(2*nbedges,1)],md2.mesh.numberofvertices,nbv);
++			%loop over model fields
++			model_fields=setxor(fields(md),{'mesh'});
++			%remove mesh from this field
++			for i=1:length(model_fields),
++				%get field
++				field=md.(model_fields{i});
++				fieldsize=size(field);
++				if isobject(field), %recursive call
++					object_fields=fields(md.(model_fields{i}));
++					for j=1:length(object_fields),
++						%get field
++						field=md.(model_fields{i}).(object_fields{j});
++						fieldsize=size(field);
++						%size = number of nodes * n
++						if fieldsize(1)==numberofvertices1
++							md2.(model_fields{i}).(object_fields{j})=Pnode*field;
++						elseif (fieldsize(1)==numberofvertices1+1)
++							md2.(model_fields{i}).(object_fields{j})=[Pnode*field(1:end-1,:); field(end,:)];
++							%size = number of elements * n
++						elseif fieldsize(1)==numberofelements1
++							md2.(model_fields{i}).(object_fields{j})=Pelem*field;
++						elseif (fieldsize(1)==numberofelements1+1)
++							md2.(model_fields{i}).(object_fields{j})=[Pelem*field(1:end-1,:); field(end,:)];
++						end
++					end
++				else
++					%size = number of nodes * n
++					if fieldsize(1)==numberofvertices1
++						md2.(model_fields{i})=Pnode*field;
++					elseif (fieldsize(1)==numberofvertices1+1)
++						md2.(model_fields{i})=[Pnode*field(1:end-1,:); field(end,:)];
++						%size = number of elements * n
++					elseif fieldsize(1)==numberofelements1
++						md2.(model_fields{i})=Pelem*field;
++					elseif (fieldsize(1)==numberofelements1+1)
++						md2.(model_fields{i})=[Pelem*field(1:end-1,:); field(end,:)];
++					end
++				end
++			end
++
++		end % }}}
+ 		function md = extrude(md,varargin) % {{{
+ 			%EXTRUDE - vertically extrude a 2d mesh
+ 			%
Index: /issm/oecreview/Archive/25834-26739/ISSM-26161-26162.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26161-26162.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26161-26162.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 26161)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 26162)
+@@ -48,7 +48,7 @@
+ 	%Go solve!
+ 	md.verbose=verbose(0);
+ 	md=solve(md,'Stressbalance');
+-	plotmodel(md,'axis#all','tight','data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'title','inferred B',...
++	plotmodel(md,'axis#all','tight','data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[1.3 1.9]*10^8,'title','inferred B',...
+ 		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
+ end 
+ 
+Index: ../trunk-jpl/jenkins/examples_tests.sh
+===================================================================
+--- ../trunk-jpl/jenkins/examples_tests.sh	(revision 26161)
++++ ../trunk-jpl/jenkins/examples_tests.sh	(revision 26162)
+@@ -10,8 +10,8 @@
+ #
+ # NOTE:
+ # - Indentation of replacement string literals (e.g. 'STEP_EIGHT') is set to 
+-# 	nest cleanly in this file, but will result in unclean nesting runme file 
+-# 	(which should not be an issue)
++#	nest cleanly in this file, but will result in unclean nesting in the runme 
++#	files (which should not be an issue)
+ # - Single-line string replacements in runme.m can effectively be performed 
+ #	using sed. When performing multi-line replacements, perl is a better 
+ #	option.
Index: /issm/oecreview/Archive/25834-26739/ISSM-26162-26163.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26162-26163.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26162-26163.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test494.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.py	(revision 26162)
++++ ../trunk-jpl/test/NightlyRun/test494.py	(revision 26163)
+@@ -38,7 +38,7 @@
+ field_tolerances = [
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 2e-13, 4e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26163-26164.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26163-26164.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26163-26164.diff	(revision 26740)
@@ -0,0 +1,701 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26163)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26164)
+@@ -247,6 +247,8 @@
+ 		virtual IssmDouble GetHorizontalSurfaceArea(void){_error_("not implemented");};
+ 		virtual void       GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0;
+ 		virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0;
++		virtual void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl)=0;
++		virtual IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl)=0;
+ 		virtual IssmDouble GetIcefrontArea(){_error_("not implemented");};
+ 		virtual void       GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum)=0;
+ 		virtual DatasetInput* GetDatasetInput(int inputenum){_error_("not implemented");};
+@@ -294,6 +296,7 @@
+ 		virtual void       JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
+ 		virtual void       JacobianDeterminantSurface(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
+ 		virtual void       JacobianDeterminantTop(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0;
++		virtual void       LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum)=0;
+ 		virtual void       Marshall(MarshallHandle* marshallhandle)=0;
+ 		virtual IssmDouble Masscon(IssmDouble* levelset)=0;
+ 		virtual IssmDouble MassFlux(IssmDouble* segment)=0;
+@@ -393,10 +396,8 @@
+ 
+ 		virtual void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+ 		virtual void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0;
+-		virtual void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks)=0;
+-		virtual void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks)=0;
+-		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector,  SealevelMasks* masks)=0;
+-		virtual void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector)=0;
++		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector)=0;
+ 		virtual void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks)=0;
+ 		#endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26163)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26164)
+@@ -82,6 +82,8 @@
+ 		int            GetElementType(void);
+ 		void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
+ 		IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
++		void           GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){_error_("not implemented yet");};
++		IssmDouble     GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){_error_("not implemented yet");};
+ 		IssmDouble		GetIcefrontArea();
+ 		void           GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+ 		Input*        GetInput(int enumtype);
+@@ -124,6 +126,7 @@
+ 		void           JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void           JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void           JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
++		void           LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented yet");};
+ 		IssmDouble     Masscon(IssmDouble* levelset){_error_("not implemented yet");};
+ 		IssmDouble     MassFlux(IssmDouble* segment);
+ 		IssmDouble     MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
+@@ -230,10 +233,8 @@
+ 
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector,SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+ 		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+ 		#endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26163)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26164)
+@@ -62,6 +62,8 @@
+ 		int         GetElementType(void){_error_("not implemented yet");};
+ 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
+ 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
++		void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){_error_("not implemented yet");};
++		IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){_error_("not implemented yet");};
+ 		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+ 		Input*     GetInput(int enumtype);
+ 		Input*     GetInput(int enumtype,IssmDouble time);
+@@ -96,6 +98,7 @@
+ 		void        JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+ 		void        JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void        JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss){_error_("not implemented yet");};
++		void        LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented yet");};
+ 		IssmDouble  Masscon(IssmDouble* levelset){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble* segment){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");}
+@@ -185,10 +188,8 @@
+ 
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+ 		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+ 
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26163)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26164)
+@@ -66,6 +66,8 @@
+ 		int         GetElementType(void);
+ 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
+ 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
++		void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){_error_("not implemented yet");};
++		IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){_error_("not implemented yet");};
+ 		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented yet");};
+ 		Input*     GetInput(int enumtype);
+ 		Input*     GetInput(int enumtype,IssmDouble time);
+@@ -102,6 +104,7 @@
+ 		void        JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+ 		void        JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void        JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
++		void        LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented yet");};
+ 		IssmDouble  Masscon(IssmDouble* levelset){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble* segment){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");}
+@@ -191,10 +194,8 @@
+ 		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+ 		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+ 
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26163)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26164)
+@@ -1599,7 +1599,7 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){/*{{{*/
++void       Tria::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlyfloating){/*{{{*/
+ 	/*Computeportion of the element that is grounded*/
+ 
+ 	bool               floating=true;
+@@ -1650,7 +1650,7 @@
+ 	*point1=point;
+ 	*fraction1=f1;
+ 	*fraction2=f2;
+-	*mainlyfloating=floating;
++	*pmainlyfloating=floating;
+ }
+ /*}}}*/
+ IssmDouble Tria::GetGroundedPortion(IssmDouble* xyz_list){/*{{{*/
+@@ -1722,6 +1722,123 @@
+ 	return phi;
+ }
+ /*}}}*/
++IssmDouble Tria::GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){/*{{{*/
++	
++	/*Computeportion of the element that is on a levelset: */
++	bool              mainlyfloating = true;
++	int               domaintype,index1,index2;
++	const IssmPDouble epsilon        = 1.e-15;
++	IssmDouble        phi,s1,s2;
++
++	/*Recover parameters and values*/
++	parameters->FindParam(&domaintype,DomainTypeEnum);
++
++	/*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){
++		this->EdgeOnBaseIndices(&index1,&index2);
++		if(gl[index1]>0 && gl[index2]>0) phi=1; // All grounded
++		else if(gl[index1]<0 && gl[index2]<0) phi=0; // All floating
++		else if(gl[index1]<0 && gl[index2]>0){ //index2 grounded
++			phi=1./(1.-gl[index1]/gl[index2]);
++		}
++		else if(gl[index2]<0 && gl[index1]>0){ //index1 grounded
++			phi=1./(1.-gl[index2]/gl[index1]);
++		}
++
++	}
++	else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
++		/*Check that not all nodes are grounded or floating*/
++		if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded
++			phi=1;
++		}
++		else if(gl[0]<0 && gl[1]<0 && gl[2]<0){ //All floating
++			phi=0;
++		}
++		else{
++			/*Figure out if two nodes are floating or grounded*/
++			if(gl[0]*gl[1]*gl[2]>0) mainlyfloating=false;
++
++			if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
++				s1=gl[2]/(gl[2]-gl[1]);
++				s2=gl[2]/(gl[2]-gl[0]);
++			}
++			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
++				s1=gl[0]/(gl[0]-gl[1]);
++				s2=gl[0]/(gl[0]-gl[2]);
++			}
++			else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
++				s1=gl[1]/(gl[1]-gl[0]);
++				s2=gl[1]/(gl[1]-gl[2]);
++			}
++			else _error_("case not possible");
++			if(mainlyfloating){
++				phi = (1-s1*s2);
++			}
++			else{
++				phi = s1*s2;
++			}
++		}
++	}
++	else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
++
++	_assert_(phi<=1. && phi>=0.);
++	return 1-phi;
++}
++/*}}}*/
++void       Tria::GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){/*{{{*/
++	
++	/*Computeportion of the element that is grounded*/
++	bool               negative=false;
++	int                point;
++	const IssmPDouble  epsilon= 1.e-15;
++	IssmDouble         f1,f2;
++
++	/*Be sure that values are not zero*/
++	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
++	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
++	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
++
++	/*Check that not all nodes are positive or negative: */
++	if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All positive
++		point=0;
++		f1=1.;
++		f2=1.;
++	}
++	else if(gl[0]<0 && gl[1]<0 && gl[2]<0){ //All negative
++		point=0;
++		f1=0.;
++		f2=0.;
++	}
++	else{
++		if(gl[0]*gl[1]*gl[2]<0) negative=true;
++
++		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
++			point=2;
++			f1=gl[2]/(gl[2]-gl[0]);
++			f2=gl[2]/(gl[2]-gl[1]);
++		}
++		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
++			point=0;
++			f1=gl[0]/(gl[0]-gl[1]);
++			f2=gl[0]/(gl[0]-gl[2]);
++		}
++		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
++			point=1;
++			f1=gl[1]/(gl[1]-gl[2]);
++			f2=gl[1]/(gl[1]-gl[0]);
++		}
++		else _error_("case not possible");
++	}
++	*point1=point;
++	*fraction1=f1;
++	*fraction2=f2;
++	*pmainlynegative=negative;
++}
++/*}}}*/
+ IssmDouble Tria::GetIcefrontArea(){/*{{{*/
+ 
+ 	IssmDouble  bed[NUMVERTICES]; //basinId[NUMVERTICES];
+@@ -5544,17 +5661,6 @@
+ 		int  glfraction=1;
+ 		IssmDouble phi=1.0;
+ 		/*{{{*/
+-	
+-		
+-
+-		if (masks->isfullyfloating[this->lid]){
+-			I=0;
+-			this->AddInput(EffectivePressureEnum,&I,P0Enum);
+-			return;
+-		}
+-			
+-
+-	
+ 		if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
+ 
+ 		/*recover some parameters:*/
+@@ -5604,7 +5710,7 @@
+ 				I+=Ig*gauss->weight;
+ 				total_weight+=gauss->weight;
+ 			}
+-			I=I/total_weight;
++			if(total_weight) I=I/total_weight;
+ 			delete gauss;
+ 		}
+ 		/*}}}*/
+@@ -6550,7 +6656,7 @@
+ 			pre=((1.0+tide_love_k[2]-tide_love_h[2])/9.81)*pow(omega*planetradius,2.0);
+ 			Grotm1[i]= - pre* 0.5*sin(2.*lati)*cos(longi);
+ 			Grotm2[i]= - pre* 0.5*sin(2.*lati)*sin(longi);
+-			Grotm3[i]= - pre* (1/6.0 - 0.5*cos(2.0*lati));
++			Grotm3[i]= - pre* (1.0/6.0 - 0.5*cos(2.0*lati));
+ 		}
+ 		this->AddInput(SealevelGrotm1Enum,&Grotm1[0],P1Enum);
+ 		this->AddInput(SealevelGrotm2Enum,&Grotm2[0],P1Enum);
+@@ -6686,7 +6792,7 @@
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+ 	/*Deal with ice loads if we are on grounded ice:*/
+-	if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid]){ 
++	if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid] && isice){ 
+ 
+ 		/*Compute fraction of the element that is grounded: {{{*/
+ 		if(notfullygrounded){
+@@ -6733,7 +6839,7 @@
+ 				I+=Ig*gauss->weight;
+ 				total_weight+=gauss->weight;
+ 			}
+-			I=I/total_weight;
++			if(total_weight) I=I/total_weight;
+ 			delete gauss;
+ 		}
+ 		/*}}}*/
+@@ -6747,7 +6853,7 @@
+ 	} 
+ 
+ 	/*Deal with water loads if we are on ground:*/
+-	if(!masks->isfullyfloating[this->lid]){
++	if(!masks->isfullyfloating[this->lid] && ishydro){
+ 
+ 		constant+=10; //1 for water.
+ 		#ifdef _ISSM_DEBUG_
+@@ -6768,7 +6874,7 @@
+ 	}
+ 
+ 	/*Deal with ocean bottom pressures:*/
+-	if(masks->isoceanin[this->lid]){
++	if(masks->isoceanin[this->lid] && isocean){
+ 
+ 		constant+=1; //1 for bottom pressure.
+ 		#ifdef _ISSM_DEBUG_
+@@ -6795,11 +6901,11 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationvector){ /*{{{*/
+ 
+ 	/*sal green function:*/
+ 	IssmDouble* G=NULL;
+-	IssmDouble SealevelGRD[NUMVERTICES]={0,0,0};
++	IssmDouble SealevelGRD[NUMVERTICES]={0};
+ 	IssmDouble oceanaverage,oceanarea=0;
+ 	IssmDouble rho_water;
+ 	
+@@ -6827,64 +6933,33 @@
+ 	if(sal){
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+ 		
+-		for(int i=0;i<NUMVERTICES;i++) {
+-			for (int e=0;e<nel;e++){
+-				SealevelGRD[i]+=G[i*nel+e]*loads[e]; 
++		if(allsealevelloads){
++			for(int i=0;i<NUMVERTICES;i++) {
++				for (int e=0;e<nel;e++){
++					SealevelGRD[i]+=G[i*nel+e]*(allsealevelloads[e]+allloads[e]);
++				}
+ 			}
+ 		}
++		else{  //this is the initial convolution where only loads are provided
++			for(int i=0;i<NUMVERTICES;i++) {
++				for (int e=0;e<nel;e++){
++					SealevelGRD[i]+=G[i*nel+e]*(allloads[e]);
++				}
++			}
++		}
+ 	}
+ 
+ 	/*compute ocean average over element:*/
+-	OceanAverageOptim(&oceanaverage,&oceanarea,&SealevelGRD[0],masks);
++	LevelsetAverage(&oceanaverage,&oceanarea,&SealevelGRD[0],MaskOceanLevelsetEnum);
+ 	
+ 	/*add ocean average in the global sealevelloads vector:*/
+ 	sealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+-	oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
++	if(!allsealevelloads)oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
+ 	
+ 	return;
+ } /*}}}*/
+-void       Tria::SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){ /*{{{*/
+ 
+-	IssmDouble SealevelGRD[3]={0,0,0};
+-	IssmDouble oceanaverage,oceanarea=0;
+-	IssmDouble rho_water;
+-	int nel;
+-	bool sal = false;
+-	IssmDouble* G=NULL;
+-	int size;
+-	IssmDouble Grotm1[3];
+-	IssmDouble Grotm2[3];
+-	IssmDouble Grotm3[3];
+-	bool rotation= false;
+-
+-	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+-	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
+-	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+-	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+-	
+-	if(rotation){
+-		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
+-		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
+-		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
+-		
+-		for(int i=0;i<NUMVERTICES;i++) SealevelGRD[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
+-	}	
+-
+-	if(sal){
+-		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+-
+-		for(int i=0;i<NUMVERTICES;i++) {
+-			for (int e=0;e<nel;e++){
+-				SealevelGRD[i]+=G[i*nel+e]*(sealevelloads[e]+loads[e]);
+-			}
+-		}
+-	}
+-	OceanAverageOptim(&oceanaverage,&oceanarea,SealevelGRD,masks);
+-	newsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+-
+-} /*}}}*/
+-void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks){ /*{{{*/
+-
+ 	IssmDouble Sealevel[3]={0,0,0};
+ 	IssmDouble SealevelRSL[3]={0,0,0};
+ 	IssmDouble SealevelU[3]={0,0,0};
+@@ -6957,71 +7032,67 @@
+ 
+ 
+ } /*}}}*/
+-void       Tria::OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
++void       Tria::LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){ /*{{{*/
+ 
+ 	IssmDouble phi=1.0;
+-	bool iscoastline=false;
+ 	IssmDouble area;
+-	IssmDouble Sg_avg=0; //output
++	IssmDouble average = 0;
++	IssmDouble total_weight=0;
++	int        point1;
++	IssmDouble fraction1,fraction2;
++	IssmDouble levelsetvalues[NUMVERTICES];
++	bool       fractiongeometryflag=true;
+ 	
+-	/*Do we have an ocean?:*/
+-	if(!masks->isoceanin[this->lid]){
+-		*poceanarea=0;
+-		*poceanaverage=0;
+-	}
+ 
+-	/*Do we have a coastline?:*/
+-	if(!masks->isfullyfloating[this->lid])iscoastline=true;
+ 
+-	if(iscoastline){
+-		IssmDouble xyz_list[NUMVERTICES][3];
+-		::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-		phi=1.0-this->GetGroundedPortion(&xyz_list[0][0]); 
++	/*retrieve value of levelset:*/
++	Input *levelset= this->GetInput(levelsetenum);
++	this->Element::GetInputListOnVertices(&levelsetvalues[0],levelsetenum);
++	
++	/*Early return if no vertices are inside the desired area:*/
++	if(levelset->GetInputMin()>=0){
++		*paverage=0;
++		*parea=0;
++		return;
+ 	}
+ 
+ 	/*Get area of element:*/
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+-	/*Average over ocean if there is no coastline, area of the ocean 
+-	 *is the areaa of the element:*/
+-	if(!iscoastline){
+-
+-		/*Average Sg over vertices:*/
+-		for(int i=0;i<NUMVERTICES;i++) Sg_avg+=Sg[i]/NUMVERTICES;
+-
+-		*poceanaverage=Sg_avg;
+-		*poceanarea=area;
++	/*Are we fully in the desired area, in which case average over the entire area?:*/
++	if(levelset->GetInputMax()<=0){
++		for(int i=0;i<NUMVERTICES;i++) average+=field_on_localvertices[i]/NUMVERTICES;
++		
++		*parea=area;
++		*paverage=average;
+ 		return;
+ 	}
+ 
+-	/*Average over  the ocean only if there is a coastline. Area of the 
+-	 * ocean will be the fraction times the area of the element:*/
++	/*What fraction of the triangle is in the desired area?:*/
++	IssmDouble xyz_list[NUMVERTICES][3];
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++	phi=this->GetFractionArea(&xyz_list[0][0],levelsetvalues); 
+ 	area=phi*area;
+-   
+-	IssmDouble total_weight=0;
+-	bool mainlyfloating = true;
+-	int         point1;
+-	IssmDouble  fraction1,fraction2;
+ 
+-	/*Recover portion of element that is grounded*/
+-	this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
+-	//!mainlyfloating so that the integration is done on the ocean (and not the grounded) part
+-	Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,!mainlyfloating,2); 
++	/*Average over  the fraction area only, using the right gaussian points: */
++	this->GetFractionGeometry(&point1,&fraction1,&fraction2,&fractiongeometryflag,levelsetvalues);
++	Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,fractiongeometryflag,2); 
+ 
+-	/* Start  looping on the number of gaussian points and average over these gaussian points: */
+ 	total_weight=0;
+-	Sg_avg=0;
++	average=0;
+ 	while(gauss->next()){
+-		IssmDouble Sg_gauss=0;
+-		TriaRef::GetInputValue(&Sg_gauss, Sg, gauss,P1Enum);
+-		Sg_avg+=Sg_gauss*gauss->weight;
++		IssmDouble field_gauss=0;
++		TriaRef::GetInputValue(&field_gauss, field_on_localvertices, gauss,P1Enum);
++		average+=field_gauss*gauss->weight;
+ 		total_weight+=gauss->weight;
+ 	}
+-	if(total_weight) Sg_avg=Sg_avg/total_weight;
++	if(total_weight) average=average/total_weight;
++	
++	/*free ressources:*/
+ 	delete gauss;
+ 
+-	*poceanaverage=Sg_avg;
+-	*poceanarea=area;
++	*paverage=average;
++	*parea=area;
+ 	return;
+ 
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26163)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26164)
+@@ -83,6 +83,8 @@
+ 		void        GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues);
+ 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
+ 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
++		void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl);
++		IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl);
+ 		IssmDouble  GetIcefrontArea();
+ 		void	      GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+ 		void        GetInputListOnVertices(IssmDouble* pvalue,Input* input,IssmDouble default_value);
+@@ -110,6 +112,7 @@
+ 		bool	   	IsIcefront(void);
+ 		bool        IsNodeOnShelfFromFlags(IssmDouble* flags);
+ 		bool        IsZeroLevelset(int levelset_enum);
++		void        LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum);
+ 		IssmDouble  Masscon(IssmDouble* levelset);
+ 		IssmDouble  MassFlux(IssmDouble* segment);
+ 		IssmDouble  MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
+@@ -175,10 +178,8 @@
+ 		
+ 		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks);
+-		void       SealevelchangeInitialConvolution(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas,IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+-		void       SealevelchangeOceanConvolution(Vector<IssmDouble>* newsealevelloads, IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector, SealevelMasks* masks);
+-		void       OceanAverageOptim(IssmDouble* poceanaverage, IssmDouble* poceanarea, IssmDouble* Sg, SealevelMasks* masks);
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector);
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector);
+ 		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks);
+ 		#endif
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26163)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26164)
+@@ -404,7 +404,7 @@
+ 	BarystaticContributions* barycontrib=NULL;
+ 	SealevelMasks* masks=NULL;
+ 	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
+-	IssmDouble rotationaxismotionvector[3];
++	IssmDouble rotationaxismotionvector[3]={0};
+ 	
+ 	Vector<IssmDouble>*    loads=NULL;
+ 	IssmDouble*            allloads=NULL; 
+@@ -467,8 +467,9 @@
+ 	/*initialize matrices and vectors:*/
+ 	femmodel->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	loads=new Vector<IssmDouble>(nel);
++	oceanareas=new Vector<IssmDouble>(nel);
+ 	sealevelloads=new Vector<IssmDouble>(nel);
+-	oceanareas=new Vector<IssmDouble>(nel);
++	sealevelloads->Set(0);sealevelloads->Assemble();
+ 
+ 	/*call masks core: */
+ 	masks=sealevel_masks(femmodel);
+@@ -493,30 +494,7 @@
+ 		goto deformation;
+ 	}
+ 
+-	/*convolve loads:*/
+-	for(Object* & object : femmodel->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeInitialConvolution(sealevelloads,oceanareas,allloads,rotationaxismotionvector,masks);
+-	}
+-	sealevelloads->Assemble();
+-	oceanareas->Assemble();
+-	
+-	//Get ocean area: 
+-	oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+-	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-
+-	//conserve ocean mass: 
+-	oceanaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
+-	ConserveOceanMass(femmodel,sealevelloads,barycontrib->Total()/oceanarea - oceanaverage,masks);
+-
+-	//broadcast sea level loads 
+-	allsealevelloads=sealevelloads->ToMPISerial();
+-
+-	
+-	//compute rotation axis motion:
+-	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsealevelloads);
+-	
+-	if(VerboseSolution()) _printf0_("	  converging ocean GRD convolutions\n");
++	if(VerboseSolution()) _printf0_("	  converging GRD convolutions\n");
+ 	for(;;){
+ 			
+ 		oldsealevelloads=sealevelloads->Duplicate(); sealevelloads->Copy(oldsealevelloads);
+@@ -524,10 +502,16 @@
+ 		/*convolve load and sealevel loads on oceans:*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelchangeOceanConvolution(sealevelloads, allsealevelloads, allloads,rotationaxismotionvector,masks);
++			element->SealevelchangeConvolution(sealevelloads, oceanareas, allsealevelloads, allloads,rotationaxismotionvector);
+ 		}
+ 		sealevelloads->Assemble();
+-			
++
++		/*compute ocean areas:*/
++		if(!allsealevelloads){ //first time in the loop
++			oceanareas->Assemble(); oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
++			if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
++		}
++		
+ 		//Conserve ocean mass: 
+ 		oceanaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
+ 		ConserveOceanMass(femmodel,sealevelloads,barycontrib->Total()/oceanarea - oceanaverage,masks);
+@@ -543,7 +527,7 @@
+ 		if (converged)break;
+ 
+ 		//early return?
+-		if(iterations>max_nonlinear_iterations)break;
++		if(iterations>=max_nonlinear_iterations)break;
+ 		else iterations++;
+ 	}
+ 
+@@ -554,7 +538,7 @@
+ 	/*convolve loads and sea level loads to get the deformation:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeDeformationConvolution(allsealevelloads, allloads, rotationaxismotionvector,masks);
++		element->SealevelchangeDeformationConvolution(allsealevelloads, allloads, rotationaxismotionvector);
+ 	}
+ 	
+ 	if(VerboseSolution()) _printf0_("	  updating GRD fields\n");
+@@ -1226,11 +1210,13 @@
+ 	dRSLg=RSLg_old->Duplicate(); RSLg_old->Copy(dRSLg); dRSLg->AYPX(RSLg,-1.0);
+ 	ndS=dRSLg->Norm(NORM_TWO); 
+ 
+-	if (xIsNan<IssmDouble>(ndS)) _error_("convergence criterion is NaN!");
++	if (xIsNan<IssmDouble>(ndS)){
++		_error_("convergence criterion is NaN (RSL_old=" << RSLg_old->Norm(NORM_TWO) << " RSL=" << RSLg->Norm(NORM_TWO) << ")");
++	}
+ 
+ 	if(!xIsNan<IssmDouble>(eps_rel)){
+ 		nS=RSLg_old->Norm(NORM_TWO);
+-		if (xIsNan<IssmDouble>(nS)) _error_("convergence criterion is NaN!");
++		if (xIsNan<IssmDouble>(nS)) _error_("convergence criterion is NaN! (check the initial RSL)");
+ 	}
+ 
+ 	//clean up
Index: /issm/oecreview/Archive/25834-26739/ISSM-26164-26165.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26164-26165.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26164-26165.diff	(revision 26740)
@@ -0,0 +1,2605 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26164)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26165)
+@@ -4747,410 +4747,6 @@
+ }
+ /*}}}*/
+ #endif
+-#ifdef _HAVE_SEALEVELCHANGE_
+-void FemModel::SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition,SealevelMasks* masks) { /*{{{*/
+-
+-	/*serialized vectors:*/
+-	IssmDouble  bslcice       = 0.;
+-	IssmDouble  bslcice_cpu   = 0.;
+-	IssmDouble  bslchydro       = 0.;
+-	IssmDouble  bslchydro_cpu   = 0.;
+-	IssmDouble  area      = 0.;
+-	IssmDouble  oceanarea      = 0.;
+-	IssmDouble  oceanarea_cpu  = 0.;
+-	int bp_compute_fingerprints= 0;
+-	bool isoceantransport=false;
+-
+-	Vector<IssmDouble>* bslcice_partition=NULL;
+-	IssmDouble* bslcice_partition_serial=NULL;
+-	IssmDouble* partitionice=NULL;
+-	int npartice,nel;
+-
+-	Vector<IssmDouble>* bslchydro_partition=NULL;
+-	IssmDouble* bslchydro_partition_serial=NULL;
+-	IssmDouble* partitionhydro=NULL;
+-	bool istws=0;
+-	int nparthydro;
+-		
+-	int npartocean;
+-	Vector<IssmDouble>* bslcocean_partition=NULL;
+-	IssmDouble* bslcocean_partition_serial=NULL;
+-	IssmDouble* partitionocean=NULL;
+-
+-   /*Initialize temporary vector that will be used to sum barystatic components
+-    * on all local elements, prior to assembly:*/
+-	int gsize = this->nodes->NumberOfDofs(GsetEnum);
+-	IssmDouble* RSLgi=xNewZeroInit<IssmDouble>(gsize);
+-	int* indices=xNew<int>(gsize);
+-   for(int i=0;i<gsize;i++) indices[i]=i;
+-
+-	/*First, figure out the area of the ocean, which is needed to compute the barystatic component: */
+-	int i = -1;
+-	for(Object* & object : this->elements->objects){
+-		i +=1;
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->GetInputValue(&area,AreaEnum);
+-		if (masks->isoceanin[i]) oceanarea_cpu += area;
+-	}
+-	ISSM_MPI_Reduce (&oceanarea_cpu,&oceanarea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&oceanarea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(oceanarea>0.);
+-
+-	/*Initialize partition vectors to retrieve barystatic contributions: */
+-	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+-	if(npartice){
+-		this->parameters->FindParam(&partitionice,&nel,NULL,SolidearthPartitionIceEnum);
+-		bslcice_partition= new Vector<IssmDouble>(npartice);
+-	}
+-
+-	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
+-	if(nparthydro){
+-		this->parameters->FindParam(&partitionhydro,&nel,NULL,SolidearthPartitionHydroEnum);
+-		bslchydro_partition= new Vector<IssmDouble>(nparthydro);
+-	}
+-
+-	this->parameters->FindParam(&npartocean,SolidearthNpartOceanEnum);
+-	if(npartocean){
+-		this->parameters->FindParam(&partitionocean,&nel,NULL,SolidearthPartitionOceanEnum);
+-		bslchydro_partition= new Vector<IssmDouble>(npartocean);
+-	}
+-	/*For later:
+-	npartbarystatic=npartice;
+-	if(nparthydro>npartbarystatic)npartbarystatic=nparthydro;
+-	if(npartocean>npartbarystatic)npartbarystatic=npartocean;
+-	bslc_partition=new Matrix(IssmDouble>(npartbarystatic,3);
+-
+-	bslc_cpu[0]=0; bslc_cpu[1]=0; bslc_cpu[2]=0;
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeBarystaticLoads(&bslc_cpu[0], localloads,masks, bslcice_partition,partitionice,oceanarea);
+-	}
+-	MPI Bcast localloads -> loads
+-
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeConvolution(loads);
+-	}
+-	*/
+-
+-
+-
+-
+-
+-	/*Call the barystatic sea level change core for ice : */
+-	bslcice_cpu=0;
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		bslcice_cpu+=element->SealevelchangeBarystaticIce(RSLgi,masks, bslcice_partition,partitionice,oceanarea);
+-	}
+-
+-	/*Call the barystatic sea level change core for hydro: */
+-	bslchydro_cpu=0; //make sure to initialize this, so we have a total barystatic contribution computed at 0.
+-	this->parameters->FindParam(&istws,TransientIshydrologyEnum);
+-	if(istws){
+-		for(int i=0;i<elements->Size();i++){
+-			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-			bslchydro_cpu+=element->SealevelchangeBarystaticHydro(RSLgi,masks, bslchydro_partition,partitionhydro,oceanarea);
+-		}
+-	}
+-
+-	/*Call the barystatic sea level change core for bottom pressures: */
+-	this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);
+-	this->parameters->FindParam(&isoceantransport,TransientIsoceantransportEnum);
+-	if(bp_compute_fingerprints && isoceantransport){
+-		for(int i=0;i<elements->Size();i++){
+-			Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+-			element->SealevelchangeBarystaticBottomPressure(RSLgi,masks);
+-		}
+-	}
+-
+-	/*Plug values once and assemble: */
+-	pRSLgi->SetValues(gsize,indices,RSLgi,ADD_VAL);
+-	pRSLgi->Assemble();
+-
+-	/*Sum all barystatic components from all cpus:*/
+-	ISSM_MPI_Reduce (&bslcice_cpu,&bslcice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&bslcice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(!xIsNan<IssmDouble>(bslcice));
+-
+-	ISSM_MPI_Reduce (&bslchydro_cpu,&bslchydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&bslchydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	_assert_(!xIsNan<IssmDouble>(bslchydro));
+-
+-	/*Take care of partition vectors:*/
+-	if(bslcice_partition){
+-		bslcice_partition->Assemble();
+-		bslcice_partition_serial=bslcice_partition->ToMPISerial();
+-	}
+-	if(bslchydro_partition){
+-		bslchydro_partition->Assemble();
+-		bslchydro_partition_serial=bslchydro_partition->ToMPISerial();
+-	}
+-
+-
+-	/*Free ressources:*/
+-	xDelete<int>(indices);
+-	xDelete<IssmDouble>(RSLgi);
+-	if(bslchydro_partition)delete bslchydro_partition;
+-	if(bslcice_partition)delete bslcice_partition;
+-	if(partitionhydro)xDelete<IssmDouble>(partitionhydro);
+-	if(partitionice)xDelete<IssmDouble>(partitionice);
+-
+-	/*Assign output pointers:*/
+-	*poceanarea = oceanarea;
+-	*pbslcice  = bslcice;
+-	*pbslchydro  = bslchydro;
+-	*pbslc=bslchydro+bslcice;
+-	*pbslcice_partition=bslcice_partition_serial;
+-	*pbslchydro_partition=bslchydro_partition_serial;
+-
+-}
+-/*}}}*/
+-void FemModel::SealevelchangeSal(Vector<IssmDouble>* pRSLgo, Vector<IssmDouble>* pRSLg_old,  SealevelMasks* masks, bool verboseconvolution){/*{{{*/
+-
+-	/*serialized vectors:*/
+-	IssmDouble* RSLg_old=NULL;
+-
+-	IssmDouble* RSLgo  = NULL;
+-	int* indices = NULL;
+-	int         gsize;
+-
+-	bool computerigid = true;
+-	bool computeelastic= true;
+-
+-	/*recover computational flags: */
+-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+-
+-	/*Initialize temporary vector that will be used to sum barystatic components on all local elements, prior
+-	 * to assembly:*/
+-	gsize = this->nodes->NumberOfDofs(GsetEnum);
+-	RSLgo=xNewZeroInit<IssmDouble>(gsize);
+-	indices=xNew<int>(gsize); for (int i=0;i<gsize;i++)indices[i]=i;
+-
+-	/*Serialize vectors from previous iteration:*/
+-	RSLg_old=pRSLg_old->ToMPISerial();
+-
+-	/*Call the sal sea level change core only if required: */
+-	if(computerigid){
+-		for(Object* & object : this->elements->objects){
+-			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelchangeSal(RSLgo,RSLg_old,masks);
+-		}
+-	}
+-	pRSLgo->SetValues(gsize,indices,RSLgo,ADD_VAL);
+-	pRSLgo->Assemble();
+-
+-	/*Free ressources:*/
+-	xDelete<int>(indices);
+-	xDelete<IssmDouble>(RSLgo);
+-	xDelete<IssmDouble>(RSLg_old);
+-
+-}
+-/*}}}*/
+-void FemModel::SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz,  SealevelMasks* masks){/*{{{*/
+-
+-	/*serialized vectors:*/
+-	bool spherical=true;
+-	IssmDouble* RSLg_old=NULL;
+-	IssmDouble*	tide_love_h  = NULL;
+-	IssmDouble*	tide_love_k  = NULL;
+-	IssmDouble*	load_love_k  = NULL;
+-	IssmDouble  tide_love_k2secular;
+-	IssmDouble  moi_e, moi_p, omega, g;
+-	IssmDouble	m1, m2, m3;
+-	IssmDouble	lati, longi, radi, value;
+-	IssmDouble          *latitude    = NULL;
+-	IssmDouble          *longitude    = NULL;
+-	IssmDouble          *radius    = NULL;
+-
+-	/*Serialize vectors from previous iteration:*/
+-	RSLg_old=pRSLg_old->ToMPISerial();
+-
+-	IssmDouble moi_list[3]={0,0,0};
+-	IssmDouble moi_list_cpu[3]={0,0,0};
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeMomentOfInertia(&moi_list[0],RSLg_old,masks );
+-		moi_list_cpu[0] += moi_list[0];
+-		moi_list_cpu[1] += moi_list[1];
+-		moi_list_cpu[2] += moi_list[2];
+-	}
+-	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	//
+-	ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	//
+-	ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-
+-	/*pull out some useful parameters: */
+-	parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
+-	parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
+-	parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
+-	parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
+-	parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
+-	parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
+-	parameters->FindParam(&omega,RotationalAngularVelocityEnum);
+-
+-	/*compute perturbation terms for angular velocity vector: */
+-	m1 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[0];
+-	m2 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[1];
+-	m3 = -(1+load_love_k[2])/moi_p * moi_list[2];	// term associated with fluid number (3-order-of-magnitude smaller) is negelected
+-
+-	/*recover lat,long and radius vectors from vertices: */
+-	VertexCoordinatesx(&latitude,&longitude,&radius,this->vertices,spherical);
+-
+-	/* Green's function (1+k_2-h_2/g): checked against Glenn Milne's thesis Chapter 3 (eqs: 3.3-4, 3.10-11)
+-	 * Perturbation terms for angular velocity vector (m1, m2, m3): checked against Mitrovica (2005 Appendix) & Jensen et al (2013 Appendix A3)
+-	 * Sea level rotational feedback: checked against GMD eqs 8-9 (only first order terms, i.e., degree 2 order 0 & 1 considered)
+-	 * all DONE in Geographic coordinates: theta \in [-90,90], lambda \in [-180 180]
+-	 */
+-	for(Object* & object : vertices->objects){
+-		Vertex* vertex=xDynamicCast<Vertex*>(object);
+-		int sid=vertex->Sid();
+-
+-		lati=latitude[sid]/180*PI;
+-		longi=longitude[sid]/180*PI;
+-		radi=radius[sid];
+-
+-		/*only first order terms are considered now: */
+-		value=((1.0+tide_love_k[2]-tide_love_h[2])/9.81)*pow(omega*radi,2.0)*
+-						(-m3/6.0 + 0.5*m3*cos(2.0*lati) - 0.5*sin(2.*lati)*(m1*cos(longi)+m2*sin(longi)));
+-
+-		pRSLgo_rot->SetValue(sid,value,INS_VAL); //INS_VAL ensures that you don't add several times
+-	}
+-
+-	/*Assemble mesh velocity*/
+-	pRSLgo_rot->Assemble();
+-
+-	/*Assign output pointers:*/
+-	if(pIxz)*pIxz=moi_list[0];
+-	if(pIyz)*pIyz=moi_list[1];
+-	if(pIzz)*pIzz=moi_list[2];
+-	xDelete<IssmDouble>(latitude);
+-	xDelete<IssmDouble>(longitude);
+-	xDelete<IssmDouble>(tide_love_h);
+-	xDelete<IssmDouble>(tide_love_k);
+-	xDelete<IssmDouble>(load_love_k);
+-
+-	xDelete<IssmDouble>(radius);
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(RSLg_old);
+-
+-}
+-/*}}}*/
+-void FemModel::SealevelchangeDeformation(Vector<IssmDouble>* pgeoid, Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pRSLg, SealevelMasks* masks){/*{{{*/
+-
+-	/*serialized vectors:*/
+-	IssmDouble* RSLg=NULL;
+-
+-	IssmDouble* Up  = NULL;
+-	IssmDouble* North  = NULL;
+-	IssmDouble* East  = NULL;
+-	int* indices = NULL;
+-	int  gsize;
+-	int  horiz;
+-
+-	/*retrieve parameters:*/
+-	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-
+-	/*Serialize vectors from previous iteration:*/
+-	RSLg=pRSLg->ToMPISerial();
+-
+-	/*Initialize temporary vector that will be used to sum barystatic components on all local elements, prior
+-	 * to assembly:*/
+-	gsize = this->nodes->NumberOfDofs(GsetEnum);
+-	Up=xNewZeroInit<IssmDouble>(gsize);
+-	if(horiz){
+-		North=xNewZeroInit<IssmDouble>(gsize);
+-		East=xNewZeroInit<IssmDouble>(gsize);
+-	}
+-	indices=xNew<int>(gsize); for (int i=0;i<gsize;i++)indices[i]=i;
+-
+-	/*Call the deformation from loading routines:*/
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->DeformationFromSurfaceLoads(Up,North,East,RSLg,masks);
+-	}
+-
+-	pUp->SetValues(gsize,indices,Up,ADD_VAL);
+-	pUp->Assemble();
+-
+-
+-	/*Add RSL to Up to find the geoid: */
+-	pUp->Copy(pgeoid); pgeoid->AXPY(pRSLg,1);
+-
+-	if (horiz){
+-		pNorth->SetValues(gsize,indices,North,ADD_VAL);
+-		pNorth->Assemble();
+-		pEast->SetValues(gsize,indices,East,ADD_VAL);
+-		pEast->Assemble();
+-	}
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(Up);
+-	if(horiz){
+-		xDelete<IssmDouble>(North);
+-		xDelete<IssmDouble>(East);
+-	}
+-	xDelete<int>(indices);
+-	xDelete<IssmDouble>(RSLg);
+-}
+-/*}}}*/
+-IssmDouble FemModel::SealevelchangeOceanAverage(Vector<IssmDouble>* RSLg,SealevelMasks* masks, IssmDouble oceanarea) { /*{{{*/
+-
+-	IssmDouble* RSLg_serial=NULL;
+-	IssmDouble  oceanvalue,oceanvalue_cpu;
+-
+-	/*Serialize vectors from previous iteration:*/
+-	RSLg_serial=RSLg->ToMPISerial();
+-
+-	/*Initialize:*/
+-	oceanvalue_cpu=0;
+-
+-	/*Go through elements, and add contribution from each element and divide by overall ocean area:*/
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		oceanvalue_cpu += element->OceanAverage(RSLg_serial,masks);
+-	}
+-
+-	ISSM_MPI_Reduce (&oceanvalue_cpu,&oceanvalue,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&oceanvalue,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-
+-	/*Free ressources:*/
+-	xDelete<IssmDouble>(RSLg_serial);
+-
+-	return oceanvalue/oceanarea;
+-}
+-/*}}}*/
+-void FemModel::IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y){ /*{{{*/
+-
+-	/*Find the litho material to be used by all the elements:*/
+-	Matlitho* matlitho=NULL;
+-	for (Object* & object: this->materials->objects){
+-		Material* material=xDynamicCast<Material*>(object);
+-		if(material->ObjectEnum()==MatlithoEnum){
+-			matlitho=xDynamicCast<Matlitho*>(material);
+-			break;
+-		}
+-	}
+-	_assert_(matlitho);
+-
+-
+-	/*Go through elements, and add contribution from each element to the deflection vector wg:*/
+-	for(Object* & object : this->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->GiaDeflection(wg,dwgdt, matlitho, x,y);
+-	}
+-
+-	/*Assemble parallel vector:*/
+-	dwgdt->Assemble();
+-	wg->Assemble();
+-}
+-/*}}}*/
+-#endif
+ void FemModel::HydrologyEPLupdateDomainx(IssmDouble* pEplcount){ /*{{{*/
+ 
+ 	Vector<IssmDouble> *mask = NULL;
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 26164)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 26165)
+@@ -162,14 +162,6 @@
+ 		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_SEALEVELCHANGE_
+-		void SealevelchangeBarystatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslc,IssmDouble* pbslcice, IssmDouble* pbslchydro, IssmDouble** pbslcice_partition,IssmDouble** pbslchydro_partition, SealevelMasks* masks); 
+-		void SealevelchangeSal(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old,  SealevelMasks* masks,bool verboseconvolution);
+-		void SealevelchangeRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, SealevelMasks* masks);
+-		void SealevelchangeDeformation(Vector<IssmDouble>* pgeoid,Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, SealevelMasks* masks);
+-		IssmDouble SealevelchangeOceanAverage(Vector<IssmDouble>* Sg,SealevelMasks* masks, IssmDouble oceanarea);
+-		void IvinsDeformation(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, IssmDouble* x, IssmDouble* y);
+-		#endif
+ 		void HydrologyEPLupdateDomainx(IssmDouble* pEplcount);
+ 		void HydrologyIDSupdateDomainx(IssmDouble* pIDScount);
+ 		void TimeAdaptx(IssmDouble* pdt);
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26164)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26165)
+@@ -144,7 +144,6 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.cross_section_shape",SolidearthSettingsCrossSectionShapeEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.optim",SolidearthSettingsOptimEnum));
+ 	parameters->AddObject(new DoubleParam(CumBslcEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcIceEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcHydroEnum,0.0));
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26164)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26165)
+@@ -382,23 +382,14 @@
+ 		virtual void          SetSealevelMasks(SealevelMasks* masks)=0;
+ 		virtual IssmDouble    GetArea3D(void)=0;
+ 		virtual IssmDouble    GetAreaSpherical(void)=0;
+-		virtual IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks)=0;
+-		virtual void          SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks)=0;
+-		virtual void          SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads)=0;
+-		virtual IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution,IssmDouble* partition,IssmDouble oceanarea)=0;
+-		virtual IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks,Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea)=0;
+-		virtual void          SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi, SealevelMasks* masks)=0;
+-		virtual void          SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
+-				IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze)=0;
+-		virtual void          SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old,SealevelMasks* mask)=0;
+-		virtual void          DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks)=0;
+-		virtual void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
++		virtual void          SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads)=0;
++		virtual void          GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+ 
+-		virtual void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+-		virtual void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0;
+-		virtual void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector)=0;
+-		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector)=0;
+-		virtual void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks)=0;
++		virtual void          SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
++		virtual void          SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0;
++		virtual void          SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector)=0;
++		virtual void          SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector)=0;
++		virtual void          SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks)=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26164)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26165)
+@@ -218,20 +218,11 @@
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELCHANGE_
+-		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
+-					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+-		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+-		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+-		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void           GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++		void       SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
++		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
++		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26164)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26165)
+@@ -173,20 +173,10 @@
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+-		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+-		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
+-					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+-		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+-		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+-		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+-		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
++		void       SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
++		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26164)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26165)
+@@ -180,19 +180,10 @@
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+-		void    SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+-		void    SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,
+-					IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){_error_("not implemented yet!");};
+-		IssmDouble    SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){_error_("not implemented yet!");};
+-		IssmDouble    SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea){_error_("not implemented yet!");};
+-		void    SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    SealevelchangeSal(IssmDouble* Sgo, IssmDouble* Sg_old, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void    DeformationFromSurfaceLoads(IssmDouble* Up ,IssmDouble* North, IssmDouble* East, IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+-		IssmDouble    OceanAverage(IssmDouble* Sg, SealevelMasks* masks){_error_("not implemented yet!");};
+-		void        GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
++		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
++		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
++		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+ 		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26164)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26165)
+@@ -5555,177 +5555,6 @@
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+ //old code
+-IssmDouble Tria::OceanAverage(IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+-
+-	if(masks->isoceanin[this->lid]){
+-
+-		IssmDouble area;
+-
+-		/*Get area of element:*/
+-		this->Element::GetInputValue(&area,AreaEnum);
+-
+-		/*Average Sg over vertices:*/
+-		IssmDouble Sg_avg=0; for(int i=0;i<NUMVERTICES;i++) Sg_avg+=Sg[this->vertices[i]->Sid()]/NUMVERTICES;
+-
+-		/*return: */
+-		return area*Sg_avg;
+-	}
+-	else return 0;
+-
+-}
+-/*}}}*/
+-void	      Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
+-	/*early return if we are not on an ice cap OR ocean:*/
+-	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){
+-		dI_list[0] = 0.0; // this is important!!!
+-		dI_list[1] = 0.0; // this is important!!!
+-		dI_list[2] = 0.0; // this is important!!!
+-		return;
+-	}
+-
+-	/*Compute area of element:*/
+-	IssmDouble area,planetarea;
+-	this->Element::GetInputValue(&area,AreaEnum);
+-
+-	/*recover earth area: */
+-	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+-
+-	/*Compute lat,long,radius of elemental centroid: */
+-	bool spherical=true;
+-	IssmDouble llr_list[NUMVERTICES][3];
+-	IssmDouble late,longe,re;
+-	/* Where is the centroid of this element?:{{{*/
+-	::GetVerticesCoordinates(&llr_list[0][0],this->vertices,NUMVERTICES,spherical);
+-
+-	IssmDouble minlong=400;
+-	IssmDouble maxlong=-20;
+-	for (int i=0;i<NUMVERTICES;i++){
+-		llr_list[i][0]=(90-llr_list[i][0]);
+-		if(llr_list[i][1]<0)llr_list[i][1]=180+(180+llr_list[i][1]);
+-		if(llr_list[i][1]>maxlong)maxlong=llr_list[i][1];
+-		if(llr_list[i][1]<minlong)minlong=llr_list[i][1];
+-	}
+-	if(minlong==0 && maxlong>180){
+-		if (llr_list[0][1]==0)llr_list[0][1]=360;
+-		if (llr_list[1][1]==0)llr_list[1][1]=360;
+-		if (llr_list[2][1]==0)llr_list[2][1]=360;
+-	}
+-
+-	// correction at the north pole
+-	if(llr_list[0][0]==0)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
+-	if(llr_list[1][0]==0)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
+-	if(llr_list[2][0]==0)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
+-
+-	//correction at the south pole
+-	if(llr_list[0][0]==180)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
+-	if(llr_list[1][0]==180)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
+-	if(llr_list[2][0]==180)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
+-
+-	late=(llr_list[0][0]+llr_list[1][0]+llr_list[2][0])/3.0;
+-	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
+-
+-	late=90.-late;
+-	if(longe>180.)longe=(longe-180.)-180.;
+-
+-	late=late/180.*M_PI;
+-	longe=longe/180.*M_PI;
+-	/*}}}*/
+-	re=(llr_list[0][2]+llr_list[1][2]+llr_list[2][2])/3.0;
+-
+-	if(masks->isoceanin[this->lid]){
+-		IssmDouble rho_water, S;
+-
+-		/*recover material parameters: */
+-		rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-
+-		/*From Sg_old, recover water sea level change:*/
+-		S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
+-
+-		/* Perturbation terms for moment of inertia (moi_list):
+-		 * computed analytically (see Wu & Peltier, eqs 10 & 32)
+-		 * also consistent with my GMD formulation!
+-		 * ALL in geographic coordinates
+-		 * */
+-		dI_list[0] = -4*M_PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+-		dI_list[1] = -4*M_PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+-		dI_list[2] = +4*M_PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+-	}
+-	if(masks->isiceonly[this->lid]){
+-		
+-		IssmDouble rho_ice,I;
+-		bool computerigid= false;
+-	
+-		bool notfullygrounded=false;
+-	
+-		bool scaleoceanarea= false;
+-		int  glfraction=1;
+-		IssmDouble phi=1.0;
+-		/*{{{*/
+-		if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
+-
+-		/*recover some parameters:*/
+-		rho_ice=FindParam(MaterialsRhoIceEnum);
+-		this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+-		this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+-		this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+-
+-		/*Get area of element: precomputed in the sealevelchange_geometry:*/
+-		this->Element::GetInputValue(&area,AreaEnum);
+-
+-		/*Compute fraction of the element that is grounded: */
+-		if(notfullygrounded){
+-			IssmDouble xyz_list[NUMVERTICES][3];
+-			::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-
+-			phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
+-			if(glfraction==0)phi=1;
+-			#ifdef _ISSM_DEBUG_
+-			this->AddInput(SealevelBarystaticMaskEnum,&phi,P0Enum);
+-			#endif
+-		}
+-		else phi=1.0;
+-
+-		/*Retrieve surface load for ice: */
+-		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+-
+-		/*/Average ice thickness over grounded area of the element only: {{{*/
+-		if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
+-		else{
+-			IssmDouble total_weight=0;
+-			bool mainlyfloating = true;
+-			int         point1;
+-			IssmDouble  fraction1,fraction2;
+-
+-			/*Recover portion of element that is grounded*/
+-			this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
+-			Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
+-
+-			/* Start  looping on the number of gaussian points and average over these gaussian points: */
+-			total_weight=0;
+-			I=0;
+-			while(gauss->next()){
+-				IssmDouble Ig=0;
+-				deltathickness_input->GetInputValue(&Ig,gauss);
+-				I+=Ig*gauss->weight;
+-				total_weight+=gauss->weight;
+-			}
+-			if(total_weight) I=I/total_weight;
+-			delete gauss;
+-		}
+-		/*}}}*/
+-
+-		/*}}}*/
+-		/*convert to kg/m^2*/
+-		I=I*phi;
+-
+-		dI_list[0] = -4*M_PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
+-		dI_list[1] = -4*M_PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
+-		dI_list[2] = +4*M_PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+-	}
+-
+-	return;
+-}/*}}}*/
+ void       Tria::SetSealevelMasks(SealevelMasks* masks){ /*{{{*/
+ 
+ 	masks->isiceonly[this->lid]=this->IsIceOnlyInElement();
+@@ -5741,638 +5570,6 @@
+ 	else masks->notfullygrounded[this->lid]=false;
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze){ /*{{{*/
+-
+-	/*diverse:*/
+-	int gsize;
+-	bool spherical=true;
+-	IssmDouble llr_list[NUMVERTICES][3];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble area,planetarea,planetradius;
+-	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
+-	IssmDouble rho_earth;
+-	IssmDouble late,longe,re;
+-	IssmDouble lati,longi,ri;
+-	IssmDouble constant;
+-	IssmDouble x_element,y_element,z_element,x,y,z,dx,dy,dz,N_azim,E_azim;
+-
+-	#ifdef _HAVE_RESTRICT_
+-	IssmDouble* __restrict__ G=NULL;
+-	IssmDouble* __restrict__ GU=NULL;
+-	IssmDouble* __restrict__ GN=NULL;
+-	IssmDouble* __restrict__ GE=NULL;
+-	IssmDouble* __restrict__ G_elastic_precomputed=NULL;
+-	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
+-	IssmDouble* __restrict__ U_elastic_precomputed=NULL;
+-	IssmDouble* __restrict__ H_elastic_precomputed=NULL;
+-	IssmDouble* __restrict__ indices=NULL;
+-	#else
+-	IssmDouble* G=NULL;
+-	IssmDouble* GU=NULL;
+-	IssmDouble* GN=NULL;
+-	IssmDouble* GE=NULL;
+-	IssmDouble* G_elastic_precomputed=NULL;
+-	IssmDouble* G_rigid_precomputed=NULL;
+-	IssmDouble* U_elastic_precomputed=NULL;
+-	IssmDouble* H_elastic_precomputed=NULL;
+-	IssmDouble* indices=NULL;
+-	#endif
+-
+-	/*elastic green function:*/
+-	int index;
+-	int M,Mtest;
+-
+-	/*Computational flags:*/
+-	bool computerigid = false;
+-	bool computeelastic = false;
+-	int  horiz;
+-
+-	/*recover parameters: */
+-	rho_earth=FindParam(MaterialsEarthDensityEnum);
+-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+-	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+-	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+-	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+-	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+-	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-
+-	/*compute area and add to inputs:*/
+-	area=GetAreaSpherical();
+-	this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
+-	this->AddInput(SealevelAreaEnum,&area,P0Enum);
+-	if(!computerigid)return;
+-
+-	/*recover precomputed green function kernels:*/
+-	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
+-	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
+-	_assert_(M>0);
+-
+-	/*allocate indices:*/
+-	indices=xNew<IssmDouble>(gsize);
+-	G=xNewZeroInit<IssmDouble>(gsize);
+-
+-	if(computeelastic){
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&Mtest); _assert_(Mtest==M);
+-
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&Mtest); _assert_(Mtest==M);
+-
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&Mtest); _assert_(Mtest==M);
+-
+-		GU=xNewZeroInit<IssmDouble>(gsize);
+-		if(horiz){
+-			GN=xNewZeroInit<IssmDouble>(gsize);
+-			GE=xNewZeroInit<IssmDouble>(gsize);
+-		}
+-	}
+-
+-	/* Where is the centroid of this element:*/
+-
+-	/*retrieve coordinates: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-
+-	/*figure out gravity center of our element (Cartesian): */
+-	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
+-	y_element=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
+-	z_element=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
+-
+-	/*compute gravity center in lat,long: */
+-	late= asin(z_element/planetradius);
+-	longe = atan2(y_element,x_element);
+-
+-	constant=3/rho_earth*area/planetarea;
+-
+-	for(int i=0;i<gsize;i++){
+-		IssmDouble alpha;
+-		IssmDouble delPhi,delLambda;
+-
+-		/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+-		lati=latitude[i]/180.*M_PI; longi=longitude[i]/180.*M_PI;
+-		delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+-		alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+-		indices[i]=alpha/M_PI*reCast<IssmDouble,int>(M-1);
+-		index=reCast<int,IssmDouble>(indices[i]);
+-		_assert_(index>=0); _assert_(index<M);
+-
+-		/*Rigid earth gravitational perturbation: */
+-		G[i]+=G_rigid_precomputed[index];
+-		
+-		if(computeelastic){
+-			G[i]+=G_elastic_precomputed[index];
+-		}
+-		G[i]=G[i]*constant;
+-
+-		/*Elastic components:*/
+-		if(computeelastic){
+-			GU[i] =  constant * U_elastic_precomputed[index];
+-			if(horiz){
+-				/*Compute azimuths, both north and east components: */
+-				x = xx[i]; y = yy[i]; z = zz[i];
+-				if(latitude[i]==90){
+-					x=1e-12; y=1e-12;
+-				}
+-				if(latitude[i]==-90){
+-					x=1e-12; y=1e-12;
+-				}
+-				dx = x_element-x; dy = y_element-y; dz = z_element-z;
+-				N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+-				E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+-
+-				GN[i] = constant*H_elastic_precomputed[index]*N_azim;
+-				GE[i] = constant*H_elastic_precomputed[index]*E_azim;
+-			}
+-		}
+-	}
+-
+-	/*Add in inputs:*/
+-	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,gsize);
+-	if(computeelastic){
+-		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,gsize);
+-		if(horiz){
+-			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,gsize);
+-			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,gsize);
+-		}
+-	}
+-	this->inputs->SetDoubleInput(AreaEnum,this->lid,area); 
+-	this->AddInput(SealevelAreaEnum,&area,P0Enum);
+-
+-	/*Free allocations:*/
+-	#ifdef _HAVE_RESTRICT_
+-	delete indices;
+-	delete G;
+-	if(computeelastic){
+-		delete GU;
+-		if(horiz){
+-			delete GN;
+-			delete GE;
+-		}
+-	}
+-	#else
+-	xDelete(indices);
+-	xDelete(G);
+-	if(computeelastic){
+-		xDelete(GU);
+-		if(horiz){
+-			xDelete(GN);
+-			xDelete(GE);
+-		}
+-	}
+-	#endif
+-
+-	return;
+-}
+-/*}}}*/
+-IssmDouble Tria::SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
+-
+-	/*diverse:*/
+-	int gsize;
+-	IssmDouble area;
+-	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
+-	bool notfullygrounded=false;
+-	bool scaleoceanarea= false;
+-	bool computerigid= false;
+-	int  glfraction=1;
+-
+-	/*output: */
+-	IssmDouble bslcice=0;
+-
+-	/*elastic green function:*/
+-	IssmDouble* G=NULL;
+-
+-	/*ice properties: */
+-	IssmDouble rho_ice,rho_water;
+-
+-	/*constants:*/
+-	IssmDouble constant=0;
+-
+-	/*early return if we are not on an ice cap:*/
+-	if(!masks->isiceonly[this->lid]){
+-		#ifdef _ISSM_DEBUG_
+-		constant=0; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+-		#endif
+-		bslcice=0;
+-		return bslcice;
+-	}
+-
+-	/*early return if we are fully floating:*/
+-	if (masks->isfullyfloating[this->lid]){
+-		constant=0;
+-		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+-		#endif
+-		bslcice=0;
+-		return bslcice;
+-	}
+-
+-	/*If we are here, we are on ice that is fully grounded or half-way to floating:*/
+-	if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
+-
+-	/*Inform mask: */
+-	constant=1;
+-	#ifdef _ISSM_DEBUG_
+-	this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+-	#endif
+-
+-	/*recover some parameters:*/
+-	rho_ice=FindParam(MaterialsRhoIceEnum);
+-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+-	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+-	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+-
+-	/*retrieve precomputed G:*/
+-	if(computerigid)this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&gsize);
+-
+-	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+-	this->Element::GetInputValue(&area,AreaEnum);
+-
+-	/*Compute fraction of the element that is grounded: */
+-	if(notfullygrounded){
+-		IssmDouble xyz_list[NUMVERTICES][3];
+-		::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-
+-		phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
+-		if(glfraction==0)phi=1;
+-		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelBarystaticMaskEnum,&phi,P0Enum);
+-		#endif
+-	}
+-	else phi=1.0;
+-
+-	/*Retrieve surface load for ice: */
+-	Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+-	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+-
+-	/*/Average ice thickness over grounded area of the element only: {{{*/
+-	if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
+-	else{
+-		IssmDouble total_weight=0;
+-		bool mainlyfloating = true;
+-		int         point1;
+-		IssmDouble  fraction1,fraction2;
+-
+-		/*Recover portion of element that is grounded*/
+-		this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
+-		Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
+-
+-		/* Start  looping on the number of gaussian points and average over these gaussian points: */
+-		total_weight=0;
+-		I=0;
+-		while(gauss->next()){
+-			IssmDouble Ig=0;
+-			deltathickness_input->GetInputValue(&Ig,gauss);
+-			I+=Ig*gauss->weight;
+-			total_weight+=gauss->weight;
+-		}
+-		I=I/total_weight;
+-		delete gauss;
+-	}
+-	/*}}}*/
+-
+-	/*Compute barystatic contribution:*/
+-	_assert_(oceanarea>0.);
+-	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslcice = rho_ice*area*phi*I/(oceanarea*rho_water);
+-	_assert_(!xIsNan<IssmDouble>(bslcice));
+-
+-	if(computerigid){
+-		/*convert from m to kg/m^2:*/
+-		I=I*rho_ice*phi;
+-
+-		/*convolve:*/
+-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*I;
+-	}
+-
+-	/*Plug bslcice into barystatic contribution vector:*/
+-	if(barystatic_contribution){
+-		id=reCast<int>(partition[this->Sid()])+1;
+-		barystatic_contribution->SetValue(id,bslcice,ADD_VAL);
+-	}
+-	/*return :*/
+-	return bslcice;
+-}
+-/*}}}*/
+-IssmDouble Tria::SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea){ /*{{{*/
+-
+-	/*diverse:*/
+-	int gsize;
+-	IssmDouble area;
+-	IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble W;  //change in water height thickness (Farrel and Clarke, Equ. 4)
+-	bool notfullygrounded=false;
+-	bool scaleoceanarea= false;
+-	bool computeelastic= false;
+-
+-	/*elastic green function:*/
+-	IssmDouble* G=NULL;
+-
+-	/*ice properties: */
+-	IssmDouble rho_water;
+-	IssmDouble rho_freshwater;
+-
+-	/*output:*/
+-	IssmDouble bslchydro = 0;
+-
+-	/*early return if we are on an ice cap. Nop, we may have hydro
+-	 * and ice on the same masscon:*/
+-	/*if(masks->isiceonly[this->lid]){ 
+-		bslchydro=0;
+-		return bslchydro; 
+-	}*/
+-
+-	/*early return if we are fully floating:*/
+-	if (masks->isfullyfloating[this->lid]){ 
+-		bslchydro=0;
+-		return bslchydro; 
+-	}
+-
+-	/*If we are here, we are on earth, not on ice: */
+-
+-	/*recover parameters: */
+-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-	rho_freshwater=FindParam(MaterialsRhoFreshwaterEnum);
+-	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+-	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+-
+-	/*retrieve precomputed G:*/
+-	if(computeelastic)this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&gsize);
+-
+-	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+-	this->Element::GetInputValue(&area,AreaEnum);
+-
+-	/*Retrieve water height at vertices: */
+-	Input* deltathickness_input=this->GetInput(DeltaTwsEnum);
+-	if (!deltathickness_input)_error_("DeltaTwsEnum input needed to compute sea level change!");
+-	deltathickness_input->GetInputAverage(&W);
+-
+-	/*Compute barystatic component:*/
+-	_assert_(oceanarea>0.);
+-	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+-	bslchydro = rho_freshwater*area*phi*W/(oceanarea*rho_water);
+-	_assert_(!xIsNan<IssmDouble>(bslchydro));
+-
+-	if(computeelastic){
+-		/*convert from m to kg/m^2:*/
+-		W=W*rho_freshwater*phi;
+-
+-		/*convolve:*/
+-		for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*W;
+-	}
+-
+-	/*Plug bslcice into barystatic contribution vector:*/
+-	if(barystatic_contribution){
+-		id=reCast<int>(partition[this->Sid()])+1;
+-		barystatic_contribution->SetValue(id,bslchydro,ADD_VAL);
+-	}
+-	/*output:*/
+-	return bslchydro;
+-}
+-/*}}}*/
+-void       Tria::SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks){ /*{{{*/
+-
+-	/*diverse:*/
+-	int gsize;
+-	IssmDouble area;
+-	IssmDouble BP;  //change in bottom pressure (Farrel and Clarke, Equ. 4)
+-	IssmDouble constant;
+-	bool computeelastic= false;
+-
+-	/*elastic green function:*/
+-	IssmDouble* G=NULL;
+-
+-	/*water properties: */
+-	IssmDouble rho_water;
+-
+-	/*exit now?:*/
+-	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+-	if(!computeelastic)return;
+-
+-	/*we are here to compute fingerprints originating fromn bottom pressure changes:*/
+-	if(!masks->isoceanin[this->lid])return;
+-
+-	/*Inform mask: */
+-	#ifdef _ISSM_DEBUG_
+-	constant=1; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+-	#endif
+-
+-	/*recover material parameters: */
+-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-
+-	/*retrieve precomputed G:*/
+-	this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&gsize);
+-
+-	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+-	this->Element::GetInputValue(&area,AreaEnum);
+-
+-	/*Retrieve bottom pressure change and average over the element: */
+-	Input* bottompressure_change_input=this->GetInput(DeltaBottomPressureEnum);
+-	if (!bottompressure_change_input)_error_("DeltaBottomPressureEnum pressure input needed to compute sea level change fingerprint!");
+-	bottompressure_change_input->GetInputAverage(&BP);
+-
+-	/*convert from m to kg/m^2:*/
+-	BP=BP*rho_water;
+-
+-	/*convolve:*/
+-	for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*BP;
+-
+-	return;
+-}
+-/*}}}*/
+-void       Tria::SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old, SealevelMasks* masks){ /*{{{*/
+-
+-	/*diverse:*/
+-	int gsize,dummy;
+-	IssmDouble S;  //change in water water level(Farrel and Clarke, Equ. 4)
+-	IssmDouble constant=0;
+-	IssmDouble rho_water;
+-	IssmDouble* G=NULL;
+-
+-	/*retrieve parameters:*/
+-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-
+-	/*early return if we are not on the ocean:*/
+-	if (!masks->isoceanin[this->lid]){
+-		constant=0;
+-		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum);
+-		#endif
+-		return;
+-	}
+-	constant=1;
+-	#ifdef _ISSM_DEBUG_
+-	this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum);
+-	#endif
+-
+-	/*how many dofs are we working with here? */
+-	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+-
+-	/*retrieve precomputed G:*/
+-	this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&dummy); _assert_(dummy==gsize);
+-
+-	/*From Sg_old, recover water sea level change:*/
+-	S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
+-
+-	/*convert to kg/m^2: */
+-	S=S*rho_water;
+-
+-	for(int i=0;i<gsize;i++) Sgo[i]+=G[i]*S;
+-
+-	return;
+-}
+-/*}}}*/
+-void       Tria::DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North ,IssmDouble* East,IssmDouble* Sg, SealevelMasks* masks){ /*{{{*/
+-
+-	/*diverse:*/
+-	int gsize;
+-	IssmDouble I=0;
+-	IssmDouble S=0;
+-	IssmDouble BP=0;
+-	IssmDouble rho_ice,rho_water;
+-	int horiz;
+-	int  bp_compute_fingerprints= 0;
+-
+-	/*precomputed elastic green functions:*/
+-	IssmDouble* GU=NULL;
+-	IssmDouble* GN=NULL;
+-	IssmDouble* GE=NULL;
+-
+-	/*computational flags:*/
+-	bool computeelastic= false;
+-	bool computerigid= false;
+-	bool notfullygrounded=false;
+-	bool scaleoceanarea= false;
+-	int  glfraction=1;
+-	IssmDouble area;
+-	IssmDouble phi=1.0;
+-
+-	/*early return if we are not on the ocean or on an ice cap:*/
+-	if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]) return;
+-
+-	/*recover parameters:*/
+-	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+-	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-	this->parameters->FindParam(&bp_compute_fingerprints,SolidearthSettingsComputeBpGrdEnum);
+-
+-	/*early return if elastic not requested:*/
+-	if(!computeelastic) return;
+-
+-	/*recover material parameters: */
+-	rho_ice=FindParam(MaterialsRhoIceEnum);
+-	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-
+-	/*recover elastic Green's functions for displacement:*/
+-	this->inputs->GetArrayPtr(SealevelchangeGUEnum,this->lid,&GU,&gsize);
+-	if(horiz){
+-		this->inputs->GetArrayPtr(SealevelchangeGEEnum,this->lid,&GE,&gsize);
+-		this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&gsize);
+-	}
+-
+-
+-	if(masks->isoceanin[this->lid]){
+-		/*From Sg, recover water sea level change:*/
+-		S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg[this->vertices[i]->Sid()]/NUMVERTICES;
+-
+-		/*convert to kg/m^2:*/
+-		S=rho_water*S;
+-		
+-		/*If bottom pressures are available, retrieve them to load the bedrock:*/
+-		if(bp_compute_fingerprints){
+-			Input* bottompressure_change_input=this->GetInput(DeltaBottomPressureEnum);
+-			if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level change fingerprint!");
+-			bottompressure_change_input->GetInputAverage(&BP);
+-
+-			/*convert from m to kg/m^2:*/
+-			BP=BP*rho_water;
+-
+-			S+=BP;
+-		}
+-
+-		for(int i=0;i<gsize;i++){
+-			Up[i]+=S*GU[i];
+-			if(horiz){
+-				North[i]+=S*GN[i];
+-				East[i]+=S*GE[i];
+-			}
+-		}
+-	}
+-	if (masks->isiceonly[this->lid]){
+-
+-		if (masks->isfullyfloating[this->lid]) return;
+-
+-	
+-		if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
+-
+-		/*recover some parameters:*/
+-		rho_ice=FindParam(MaterialsRhoIceEnum);
+-		rho_water=FindParam(MaterialsRhoSeawaterEnum);
+-		this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+-		this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+-		this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+-
+-		/*Get area of element: precomputed in the sealevelchange_geometry:*/
+-		this->Element::GetInputValue(&area,AreaEnum);
+-
+-		/*Compute fraction of the element that is grounded: */
+-		if(notfullygrounded){
+-			IssmDouble xyz_list[NUMVERTICES][3];
+-			::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-
+-			phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
+-			if(glfraction==0)phi=1;
+-			#ifdef _ISSM_DEBUG_
+-			this->AddInput(SealevelBarystaticMaskEnum,&phi,P0Enum);
+-			#endif
+-		}
+-		else phi=1.0;
+-
+-		/*Retrieve surface load for ice: */
+-		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
+-
+-		/*/Average ice thickness over grounded area of the element only: {{{*/
+-		if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
+-		else{
+-			IssmDouble total_weight=0;
+-			bool mainlyfloating = true;
+-			int         point1;
+-			IssmDouble  fraction1,fraction2;
+-
+-			/*Recover portion of element that is grounded*/
+-			this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
+-			Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
+-
+-			/* Start  looping on the number of gaussian points and average over these gaussian points: */
+-			total_weight=0;
+-			I=0;
+-			while(gauss->next()){
+-				IssmDouble Ig=0;
+-				deltathickness_input->GetInputValue(&Ig,gauss);
+-				I+=Ig*gauss->weight;
+-				total_weight+=gauss->weight;
+-			}
+-			I=I/total_weight;
+-			delete gauss;
+-		}
+-		/*}}}*/
+-
+-		/*convert to kg/m^2*/
+-		I=I*rho_ice*phi;
+-		
+-		for(int i=0;i<gsize;i++){
+-			Up[i]+=I*GU[i];
+-			if(horiz){
+-				North[i]+=I*GN[i];
+-				East[i]+=I*GE[i];
+-			}
+-		}
+-	}
+-
+-	return;
+-}
+-/*}}}*/
+ void       Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
+ 
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+@@ -6478,10 +5675,8 @@
+ 	return;
+ }
+ /*}}}*/
++void       Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
+ 
+-//new code 
+-void       Tria::SealevelchangeGeometryOptim(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
+-
+ 	/*diverse:*/
+ 	int nel;
+ 	IssmDouble area,planetarea,planetradius;
+@@ -7097,7 +6292,7 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){/*{{{*/
++void       Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){/*{{{*/
+ 		
+ 	IssmDouble S=0;
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26164)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26165)
+@@ -164,19 +164,11 @@
+ 		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_SEALEVELCHANGE_
+-		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old,SealevelMasks* masks);
+-		void       SealevelchangeMomentOfInertiaElement(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads);
++		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads);
+ 		void       SealevelchangeGeometry(IssmDouble* lat, IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
+-		IssmDouble SealevelchangeBarystaticIce(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition, IssmDouble oceanarea);
+-		IssmDouble SealevelchangeBarystaticHydro(IssmDouble* Sgi, SealevelMasks* masks, Vector<IssmDouble>* barystatic_contribution, IssmDouble* partition,IssmDouble oceanarea);
+-		void       SealevelchangeBarystaticBottomPressure(IssmDouble* Sgi,SealevelMasks* masks);
+-		void       SealevelchangeSal(IssmDouble* Sgo,IssmDouble* Sg_old,SealevelMasks* masks);
+-		void       DeformationFromSurfaceLoads(IssmDouble* Up, IssmDouble* North, IssmDouble* East, IssmDouble* Sg,SealevelMasks* masks);
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+-		IssmDouble OceanAverage(IssmDouble* Sg, SealevelMasks* masks);
+ 		void       SetSealevelMasks(SealevelMasks* masks);
+-		
+-		void       SealevelchangeGeometryOptim(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
++		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+ 		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks);
+ 		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector);
+ 		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector);
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 26164)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 26165)
+@@ -62,12 +62,8 @@
+ void sealevelchange_geometry(FemModel* femmodel);
+ #endif
+ void grd_core(FemModel* femmodel);
+-void grd_core_optim(FemModel* femmodel);
+ void solidearthexternal_core(FemModel* femmodel);
+ void dynstr_core(FemModel* femmodel);
+-Vector<IssmDouble>* sealevelchange_core_barystatic(FemModel* femmodel,SealevelMasks* mask, IssmDouble* poceanarea);
+-Vector<IssmDouble>* sealevelchange_core_sal(FemModel* femmodel,SealevelMasks* masks, Vector<IssmDouble>* RSLg_barystatic,IssmDouble oceanarea);
+-void sealevelchange_core_deformation(Vector<IssmDouble>** pN_radial, Vector<IssmDouble>** pU_radial, Vector<IssmDouble>** pU_north,Vector<IssmDouble>** pU_east,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks);
+ void couplerinput_core(FemModel* femmodel);
+ void coupleroutput_core(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26164)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26165)
+@@ -20,6 +20,7 @@
+ SealevelMasks* sealevel_masks(FemModel* femmodel);
+ void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealeveloads);
+ void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, IssmDouble offset, SealevelMasks* masks);
++void ivins_deformation_core(FemModel* femmodel);
+ /*}}}*/
+ 
+ /*main cores:*/
+@@ -30,11 +31,9 @@
+ 
+ 	/*Parameters, variables:*/
+ 	bool save_results;
+-	int  optim=0; 
+ 
+ 	/*Retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-	femmodel->parameters->FindParam(&optim,SolidearthSettingsOptimEnum);
+ 	
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("   computing sea level change\n");
+@@ -52,8 +51,7 @@
+ 	couplerinput_core(femmodel);
+ 
+ 	/*Run geodetic:*/
+-	if(!optim) grd_core(femmodel);
+-	else grd_core_optim(femmodel);
++	grd_core(femmodel);
+ 
+ 	/*Run steric core for sure:*/
+ 	dynstr_core(femmodel);
+@@ -207,198 +205,8 @@
+ 	}
+ 	
+ }; /*}}}*/
+-void grd_core(FemModel* femmodel){ /*{{{*/
++void grd_core(FemModel* femmodel) { /*{{{*/
+ 
+-	/*Gravity rotation deformation core GRD: */
+-
+-	/*variables:*/
+-	Vector<IssmDouble> *RSLg    = NULL;
+-	Vector<IssmDouble> *RSLg_barystatic  = NULL; 
+-	Vector<IssmDouble> *U_grd  = NULL; 
+-	Vector<IssmDouble> *N_grd  = NULL; 
+-	Vector<IssmDouble> *U_north_grd   = NULL; 
+-	Vector<IssmDouble> *U_east_grd    = NULL; 
+-	Vector<IssmDouble> *bedrock  = NULL; 
+-	Vector<IssmDouble> *bedrockeast  = NULL; 
+-	Vector<IssmDouble> *bedrocknorth  = NULL; 
+-	Vector<IssmDouble> *geoid= NULL; 
+-	SealevelMasks* masks=NULL;
+-
+-	/*parameters:*/
+-	int  modelid,earthid;
+-	int  horiz;
+-	IssmDouble oceanarea;
+-	int  count,frequency,iscoupling;
+-	int  grd=0;
+-
+-	/*Verbose: */
+-	if(VerboseSolution()) _printf0_("	  computing GRD patterns\n");
+-	
+-	/*retrieve parameters:*/
+-	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
+-	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+-	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+-
+-	/*only run if grd was requested, if we are the earth, and we have reached
+-	 * the necessary number of time steps dictated by :*/
+-	if(!grd)            return;
+-	if(count!=frequency)return;
+-	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
+-	if(iscoupling){
+-		femmodel->parameters->FindParam(&modelid,ModelIdEnum);
+-		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
+-		if(modelid!=earthid)return;
+-	}
+-
+-	/*call masks core: */
+-	masks=sealevel_masks(femmodel);
+-
+-	/*call barystatic core  (generalized eustatic - Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS) */
+-	RSLg_barystatic=sealevelchange_core_barystatic(femmodel,masks,&oceanarea); 
+-
+-	/*call self attraction and loading module (ocean loading tems  - 2nd and 5th terms on the RHS of Farrel and Clark) */
+-	RSLg=sealevelchange_core_sal(femmodel,masks,RSLg_barystatic,oceanarea); 
+-
+-	/*compute bedrock motion and derive geoid: */
+-	sealevelchange_core_deformation(&N_grd,&U_grd,&U_north_grd,&U_east_grd,femmodel,RSLg,masks);
+-
+-	/*Update bedrock motion and geoid:*/
+-	GetVectorFromInputsx(&geoid,femmodel,SealevelEnum,VertexSIdEnum);
+-	GetVectorFromInputsx(&bedrock,femmodel,BedEnum,VertexSIdEnum);
+-	if(horiz){
+-		GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
+-		GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
+-	}
+-
+-	geoid->AXPY(N_grd,1);
+-	bedrock->AXPY(U_grd,1);
+-	if(horiz){
+-		bedrockeast->AXPY(U_east_grd,1);
+-		bedrocknorth->AXPY(U_north_grd,1);
+-	}
+-
+-	/*get some of the updates into elements:*/
+-	InputUpdateFromVectorx(femmodel,U_grd,SealevelUGrdEnum,VertexSIdEnum); 
+-	InputUpdateFromVectorx(femmodel,N_grd,SealevelEnum,VertexSIdEnum); 
+-	InputUpdateFromVectorx(femmodel,N_grd,SealevelNGrdEnum,VertexSIdEnum); 
+-	InputUpdateFromVectorx(femmodel,bedrock,BedEnum,VertexSIdEnum); 
+-	if(RSLg)InputUpdateFromVectorx(femmodel,RSLg,SealevelRSLEnum,VertexSIdEnum); 
+-	if(RSLg_barystatic)InputUpdateFromVectorx(femmodel,RSLg_barystatic,SealevelRSLBarystaticEnum,VertexSIdEnum); 
+-	if (horiz){
+-		InputUpdateFromVectorx(femmodel,U_north_grd,SealevelUNorthEsaEnum,VertexSIdEnum);	
+-		InputUpdateFromVectorx(femmodel,U_east_grd,SealevelUEastEsaEnum,VertexSIdEnum);	
+-	} 
+-
+-	/*reset counter to 1:*/
+-	femmodel->parameters->SetParam(1,SealevelchangeRunCountEnum); //reset counter.
+-
+-	/*free ressources:{{{*/
+-	delete RSLg;
+-	delete RSLg_barystatic;
+-	delete U_grd;
+-	delete N_grd;
+-	delete bedrock; 
+-	delete geoid; 
+-	if(horiz){
+-		delete U_north_grd;
+-		delete U_east_grd;
+-		delete bedrockeast; 
+-		delete bedrocknorth; 
+-	}
+-	delete masks;
+-	/*}}}*/
+-
+-} 
+-/*}}}*/
+-void dynstr_core(FemModel* femmodel){ /*{{{*/
+-
+-	/*variables:*/
+-	Vector<IssmDouble> *sealevel  = NULL; 
+-	Vector<IssmDouble> *deltadsl  = NULL; 
+-	Vector<IssmDouble> *deltastr = NULL;
+-
+-	/*parameters: */
+-	int  step;
+-	int computesealevel=0;
+-	bool isocean=false;
+-	IssmDouble time;
+-
+-	IssmDouble cumgmtslc=0;
+-	IssmDouble cumbslc=0;
+-	IssmDouble cumgmslc=0;
+-	IssmDouble gmtslc=0;
+-
+-	/*early return if we are not computing sea level, but rather deformation: */
+-	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+-	if (!computesealevel)return;
+-
+-	/*early return if we have no ocean transport:*/
+-	femmodel->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
+-	if(!isocean)return;
+-	
+-	/*Verbose: */
+-	if(VerboseSolution()) _printf0_("	  computing steric and dynamic sea level change\n");
+-
+-	/*Retrieve sealevel and add steric + dynamic rates:*/
+-	GetVectorFromInputsx(&sealevel,femmodel,SealevelEnum,VertexSIdEnum);
+-	GetVectorFromInputsx(&deltadsl,femmodel,DeltaDslEnum,VertexSIdEnum);
+-	GetVectorFromInputsx(&deltastr,femmodel,DeltaStrEnum,VertexSIdEnum);
+-
+-	/*compute: sea level change = initial sea level + steric + dynamic*/
+-	sealevel->AXPY(deltadsl,1);
+-	sealevel->AXPY(deltastr,1);
+-
+-	/*cumulate thermal steric rate:*/
+-	femmodel->parameters->FindParam(&cumgmtslc,CumGmtslcEnum); 
+-	femmodel->parameters->FindParam(&cumbslc,CumBslcEnum); 
+-
+-	gmtslc=deltastr->Norm(NORM_TWO);
+-	cumgmtslc+=gmtslc;
+-	cumgmslc=cumbslc+cumgmtslc;
+-
+-	femmodel->parameters->SetParam(cumgmtslc,CumGmtslcEnum);
+-	femmodel->parameters->SetParam(cumgmslc,CumGmslcEnum);
+-	
+-	/*Outputs some metrics:*/
+-	femmodel->parameters->FindParam(&step,StepEnum);
+-	femmodel->parameters->FindParam(&time,TimeEnum);
+-
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,GmtslcEnum,gmtslc,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmtslcEnum,cumgmtslc,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmslcEnum,cumgmslc,step,time));
+-
+-	/*update element inputs:*/
+-	InputUpdateFromVectorx(femmodel,sealevel,SealevelEnum,VertexSIdEnum);	
+-
+-	/*Free ressources:*/	
+-	delete sealevel;
+-	delete deltadsl;
+-	delete deltastr;
+-}
+-/*}}}*/
+-void coupleroutput_core(FemModel* femmodel){  /*{{{*/
+-	
+-	/*parameters:*/
+-	int iscoupling;
+-	int horiz=0;
+-
+-	/*retrieve more parameters:*/
+-	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
+-	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-		
+-	if(iscoupling){
+-		/*transfer sea level back to ice caps:*/
+-		TransferSealevel(femmodel,SealevelEnum);
+-		TransferSealevel(femmodel,BedEnum);
+-		if(horiz){
+-			TransferSealevel(femmodel,BedNorthEnum);
+-			TransferSealevel(femmodel,BedEastEnum);
+-		}
+-	}
+-}; /*}}}*/
+-
+-void grd_core_optim(FemModel* femmodel) { /*{{{*/
+-
+ 	/*variables:{{{*/
+ 	int nel;
+ 	BarystaticContributions* barycontrib=NULL;
+@@ -429,6 +237,7 @@
+ 	int  horiz;
+ 	int  count,frequency,iscoupling;
+ 	int  grd=0;
++	int  grdmodel; 
+ 	int  computesealevel=0;
+ 
+ 	/*}}}*/
+@@ -442,6 +251,7 @@
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+ 	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+ 	femmodel->parameters->FindParam(&max_nonlinear_iterations,SolidearthSettingsMaxiterEnum);
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 	/*}}}*/
+ 
+ 	/*only run if grd was requested, if we are the earth, and we have reached
+@@ -454,6 +264,13 @@
+ 		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
+ 		if(modelid!=earthid)return;
+ 	}
++
++	/*branch directly to Ivins deformation core if requested:*/
++	if(grdmodel==IvinsEnum){
++		ivins_deformation_core(femmodel);
++		return;
++	}
++
+ 	/*retrieve parameters: {{{*/ 
+ 	femmodel->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+ 	barycontribparam = xDynamicCast<GenericParam<BarystaticContributions*>*>(femmodel->parameters->FindParamObject(BarystaticContributionsEnum));
+@@ -561,7 +378,144 @@
+ 
+ }
+ /*}}}*/
++void dynstr_core(FemModel* femmodel){ /*{{{*/
+ 
++	/*variables:*/
++	Vector<IssmDouble> *sealevel  = NULL; 
++	Vector<IssmDouble> *deltadsl  = NULL; 
++	Vector<IssmDouble> *deltastr = NULL;
++
++	/*parameters: */
++	int  step;
++	int computesealevel=0;
++	bool isocean=false;
++	IssmDouble time;
++
++	IssmDouble cumgmtslc=0;
++	IssmDouble cumbslc=0;
++	IssmDouble cumgmslc=0;
++	IssmDouble gmtslc=0;
++
++	/*early return if we are not computing sea level, but rather deformation: */
++	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
++	if (!computesealevel)return;
++
++	/*early return if we have no ocean transport:*/
++	femmodel->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
++	if(!isocean)return;
++	
++	/*Verbose: */
++	if(VerboseSolution()) _printf0_("	  computing steric and dynamic sea level change\n");
++
++	/*Retrieve sealevel and add steric + dynamic rates:*/
++	GetVectorFromInputsx(&sealevel,femmodel,SealevelEnum,VertexSIdEnum);
++	GetVectorFromInputsx(&deltadsl,femmodel,DeltaDslEnum,VertexSIdEnum);
++	GetVectorFromInputsx(&deltastr,femmodel,DeltaStrEnum,VertexSIdEnum);
++
++	/*compute: sea level change = initial sea level + steric + dynamic*/
++	sealevel->AXPY(deltadsl,1);
++	sealevel->AXPY(deltastr,1);
++
++	/*cumulate thermal steric rate:*/
++	femmodel->parameters->FindParam(&cumgmtslc,CumGmtslcEnum); 
++	femmodel->parameters->FindParam(&cumbslc,CumBslcEnum); 
++
++	gmtslc=deltastr->Norm(NORM_TWO);
++	cumgmtslc+=gmtslc;
++	cumgmslc=cumbslc+cumgmtslc;
++
++	femmodel->parameters->SetParam(cumgmtslc,CumGmtslcEnum);
++	femmodel->parameters->SetParam(cumgmslc,CumGmslcEnum);
++	
++	/*Outputs some metrics:*/
++	femmodel->parameters->FindParam(&step,StepEnum);
++	femmodel->parameters->FindParam(&time,TimeEnum);
++
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,GmtslcEnum,gmtslc,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmtslcEnum,cumgmtslc,step,time));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumGmslcEnum,cumgmslc,step,time));
++
++	/*update element inputs:*/
++	InputUpdateFromVectorx(femmodel,sealevel,SealevelEnum,VertexSIdEnum);	
++
++	/*Free ressources:*/	
++	delete sealevel;
++	delete deltadsl;
++	delete deltastr;
++}
++/*}}}*/
++void coupleroutput_core(FemModel* femmodel){  /*{{{*/
++	
++	/*parameters:*/
++	int iscoupling;
++	int horiz=0;
++
++	/*retrieve more parameters:*/
++	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
++	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++		
++	if(iscoupling){
++		/*transfer sea level back to ice caps:*/
++		TransferSealevel(femmodel,SealevelEnum);
++		TransferSealevel(femmodel,BedEnum);
++		if(horiz){
++			TransferSealevel(femmodel,BedNorthEnum);
++			TransferSealevel(femmodel,BedEastEnum);
++		}
++	}
++}; /*}}}*/
++void ivins_deformation_core(FemModel* femmodel){ /*{{{*/
++
++	int  gsize;
++	Vector<IssmDouble> *bedup  = NULL; 
++	Vector<IssmDouble> *beduprate= NULL; 
++	IssmDouble          *xx     = NULL;
++	IssmDouble          *yy     = NULL;
++	
++	if(VerboseSolution()) _printf0_("	  computing vertical deformation using Ivins model. \n");
++
++	/*find size of vectors:*/
++	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
++
++	/*Find the litho material to be used by all the elements:*/
++	Matlitho* matlitho=NULL;
++	for (Object* & object: femmodel->materials->objects){
++		Material* material=xDynamicCast<Material*>(object);
++		if(material->ObjectEnum()==MatlithoEnum){
++			matlitho=xDynamicCast<Matlitho*>(material);
++			break;
++		}
++	}
++
++	/*initialize vectors:*/
++	bedup = new Vector<IssmDouble>(gsize);
++	beduprate = new Vector<IssmDouble>(gsize);
++	
++	/*retrieve geometric information: */
++	VertexCoordinatesx(&xx,&yy,NULL,femmodel->vertices); 
++
++	/*Go through elements, and add contribution from each element to the deflection vector wg:*/
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->GiaDeflection(bedup,beduprate, matlitho, xx,yy);
++	}
++
++	/*Assemble parallel vector:*/
++	beduprate->Assemble();
++	bedup->Assemble();
++
++	/*Save results:*/
++	InputUpdateFromVectorx(femmodel,bedup,BedGRDEnum,VertexSIdEnum);
++	femmodel->inputs->AXPY(1,BedGRDEnum,BedEnum);
++
++	/*Free ressources: */
++	xDelete<IssmDouble>(xx);
++	xDelete<IssmDouble>(yy);
++	delete beduprate;
++	delete bedup;
++}
++/*}}}*/
++
+ //Geometry:
+ SealevelMasks* sealevel_masks(FemModel* femmodel) {  /*{{{*/
+ 
+@@ -611,7 +565,6 @@
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	femmodel->parameters->FindParam(&geometrydone,SealevelchangeGeometryDoneEnum);
+ 	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+-	femmodel->parameters->FindParam(&optim,SolidearthSettingsOptimEnum);
+ 	
+ 	/*early return?:*/
+ 	if(grdmodel==IvinsEnum) return;
+@@ -634,8 +587,7 @@
+ 	/*Run sealevel geometry routine in elements:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		if(optim) element->SealevelchangeGeometryOptim(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze,areae);
+-		else      element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze);
++		element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze,areae);
+ 	}
+ 
+ 	/*Free ressources:*/
+@@ -658,302 +610,6 @@
+ 
+ }/*}}}*/
+ 
+-//GRD: 
+-Vector<IssmDouble>* sealevelchange_core_barystatic(FemModel* femmodel,SealevelMasks* masks, IssmDouble* poceanarea){ /*{{{*/
+-
+-	/*Barystatic core of the SLR solution (terms that are constant with respect to sea-level)*/
+-
+-	Vector<IssmDouble> *RSLgi    = NULL;
+-	IssmDouble          RSLgi_oceanaverage   = 0;
+-
+-	/*parameters: */
+-	int  gsize;
+-	IssmDouble oceanarea;
+-	int        step;
+-	IssmDouble time;
+-
+-	/*barystatic contribution:*/
+-	IssmDouble bslc;
+-	IssmDouble bslcice;
+-	IssmDouble* bslcice_partition=NULL;
+-	IssmDouble bslchydro;
+-	IssmDouble* bslchydro_partition=NULL;
+-	IssmDouble cumbslc;
+-	IssmDouble cumbslcice;
+-	IssmDouble cumbslchydro;
+-	IssmDouble* cumbslcice_partition=NULL;
+-	int npartice;
+-	IssmDouble* cumbslchydro_partition=NULL;
+-	int nparthydro;
+-	int computesealevel=0;
+-
+-	/*early return if we are not computing sea level, but rather deformation: */
+-	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+-	if (!computesealevel)return NULL;
+-	
+-	if(VerboseSolution()) _printf0_("	  computing bslc components on ice\n");
+-
+-	/*Figure out size of g-set deflection vector and allocate solution vector: */
+-	gsize = femmodel->nodes->NumberOfDofs(GsetEnum);
+-
+-	/*some parameters:*/
+-	femmodel->parameters->FindParam(&step,StepEnum);
+-	femmodel->parameters->FindParam(&time,TimeEnum);
+-	femmodel->parameters->FindParam(&cumbslc,CumBslcEnum);
+-	femmodel->parameters->FindParam(&cumbslcice,CumBslcIceEnum);
+-	femmodel->parameters->FindParam(&cumbslchydro,CumBslcHydroEnum);
+-	femmodel->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+-	femmodel->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
+-	if(npartice) femmodel->parameters->FindParam(&cumbslcice_partition,&npartice,NULL,CumBslcIcePartitionEnum);
+-	if(nparthydro) femmodel->parameters->FindParam(&cumbslchydro_partition,&nparthydro,NULL,CumBslcHydroPartitionEnum);
+-
+-	/*Initialize:*/
+-	RSLgi = new Vector<IssmDouble>(gsize);
+-
+-	/*call the bslc main module: */
+-	femmodel->SealevelchangeBarystatic(RSLgi,&oceanarea,&bslc, &bslcice, &bslchydro, &bslcice_partition, &bslchydro_partition,masks); //this computes 
+-
+-	/*we need to average RSLgi over the ocean: RHS term  4 in Eq.4 of Farrel and clarke. Only the elements can do that: */
+-	RSLgi_oceanaverage=femmodel->SealevelchangeOceanAverage(RSLgi,masks, oceanarea);
+-
+-	/*RSLg is the sum of the pure bslc component (term 3) and the contribution from the perturbation to the graviation potential due to the 
+-	 * presence of ice (terms 1 and 4 in Eq.4 of Farrel and Clarke):*/
+-	RSLgi->Shift(-bslc-RSLgi_oceanaverage);
+-
+-	/*save bslc and cumulated bslc value for results:{{{ */
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslcEnum,-bslc,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslcIceEnum,-bslcice,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,BslcHydroEnum,-bslchydro,step,time));
+-
+-	//cumulative barystatic contribution: 
+-	cumbslc=cumbslc-bslc;
+-	cumbslcice=cumbslcice-bslcice;
+-	cumbslchydro=cumbslchydro-bslchydro;
+-
+-	femmodel->parameters->SetParam(cumbslc,CumBslcEnum);
+-	femmodel->parameters->SetParam(cumbslcice,CumBslcIceEnum);
+-	femmodel->parameters->SetParam(cumbslchydro,CumBslcHydroEnum);
+-
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslcEnum,cumbslc,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslcIceEnum,cumbslcice,step,time));
+-	femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,CumBslcHydroEnum,cumbslchydro,step,time));
+-
+-	//cumulative barystatic contributions by partition:
+-	if(npartice){
+-		for(int i=0;i<npartice;i++) cumbslcice_partition[i] -= bslcice_partition[i];
+-		femmodel->parameters->SetParam(cumbslcice_partition,npartice,1,CumBslcIcePartitionEnum);
+-		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslcIcePartitionEnum,cumbslcice_partition,npartice,1,step,time));
+-	}
+-
+-	if(nparthydro){
+-		for(int i=0;i<nparthydro;i++) cumbslchydro_partition[i] -= bslchydro_partition[i];
+-		femmodel->parameters->SetParam(cumbslchydro_partition,nparthydro,1,CumBslcHydroPartitionEnum);
+-		femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,CumBslcHydroPartitionEnum,cumbslchydro_partition,nparthydro,1,step,time));
+-	}
+-	/*}}}*/
+-	
+-	/*Assign output pointers and return: */
+-	*poceanarea=oceanarea;
+-	return RSLgi;
+-}/*}}}*/
+-Vector<IssmDouble>* sealevelchange_core_sal(FemModel* femmodel, SealevelMasks* masks, Vector<IssmDouble>* RSLg_barystatic,IssmDouble oceanarea){ /*{{{*/
+-
+-	/*this core computes the contributions from Eq.4 of Farrel and Clarke, rhs terms 2 and 5.
+-	  sal core of the SLR solution */
+-
+-	Vector<IssmDouble> *RSLg    = NULL;
+-	Vector<IssmDouble> *RSLg_old    = NULL;
+-
+-	Vector<IssmDouble> *RSLgo    = NULL; //ocean convolution of the perturbation to gravity potential.
+-	Vector<IssmDouble> *RSLgo_rot= NULL; // rotational feedback 
+-	IssmDouble          RSLgo_oceanaverage = 0;  //average of RSLgo over the ocean.
+-
+-	/*parameters: */
+-	int count;
+-	bool save_results;
+-	int  gsize;
+-	bool converged=true;
+-	bool rotation=true;
+-	bool verboseconvolution=true;
+-	int max_nonlinear_iterations;
+-	IssmDouble           eps_rel;
+-	IssmDouble           eps_abs;
+-	IssmDouble			Ixz, Iyz, Izz; 
+-	int computesealevel=0;
+-
+-	/*early return if we are not computing sea level, but rather deformation: */
+-	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+-	if (!computesealevel)return NULL;
+-	
+-	if(VerboseSolution()) _printf0_("	  converging on ocean components\n");
+-
+-	/*Recover some parameters: */
+-	femmodel->parameters->FindParam(&max_nonlinear_iterations,SolidearthSettingsMaxiterEnum);
+-	femmodel->parameters->FindParam(&eps_rel,SolidearthSettingsReltolEnum);
+-	femmodel->parameters->FindParam(&eps_abs,SolidearthSettingsAbstolEnum);
+-
+-	/*computational flag: */
+-	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+-
+-	/*Figure out size of g-set deflection vector and allocate solution vector: */
+-	gsize = femmodel->nodes->NumberOfDofs(GsetEnum);
+-
+-	/*Initialize:*/
+-	RSLg = new Vector<IssmDouble>(gsize);
+-	RSLg->Assemble();
+-	RSLg_barystatic->Copy(RSLg);  //first initialize RSLg with the barystatic component computed in sealevelchange_core_barystatic.
+-
+-	RSLg_old = new Vector<IssmDouble>(gsize);
+-	RSLg_old->Assemble();
+-
+-	count=1;
+-	converged=false;
+-
+-	/*Start loop: */
+-	for(;;){
+-
+-		//save pointer to old sea level
+-		delete RSLg_old; RSLg_old=RSLg; 
+-
+-		/*Initialize solution vector: */
+-		RSLg  = new Vector<IssmDouble>(gsize); RSLg->Assemble();
+-		RSLgo = new Vector<IssmDouble>(gsize); RSLgo->Assemble();
+-
+-		/*call the sal module: */
+-		femmodel->SealevelchangeSal(RSLgo, RSLg_old,  masks, verboseconvolution);
+-
+-		/*assemble solution vector: */
+-		RSLgo->Assemble(); 
+-
+-		if(rotation){
+-
+-			/*call rotational feedback  module: */
+-			RSLgo_rot = new Vector<IssmDouble>(gsize); RSLgo_rot->Assemble();
+-			femmodel->SealevelchangeRotationalFeedback(RSLgo_rot,RSLg_old,&Ixz,&Iyz,&Izz, masks); 
+-			RSLgo_rot->Assemble(); 
+-
+-			/*save changes in inertia tensor as results: */
+-			femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorXZEnum,Ixz));
+-			femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorYZEnum,Iyz));
+-			femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorZZEnum,Izz));
+-
+-			RSLgo->AXPY(RSLgo_rot,1); 
+-		}
+-
+-		/*we need to average RSLgo over the ocean: RHS term  5 in Eq.4 of Farrel and clarke. Only the elements can do that: */
+-		RSLgo_oceanaverage=femmodel->SealevelchangeOceanAverage(RSLgo,masks, oceanarea);
+-
+-		/*RSLg is the sum of the barystatic term, and the ocean terms: */
+-		RSLg_barystatic->Copy(RSLg); RSLg->AXPY(RSLgo,1); 
+-		RSLg->Shift(-RSLgo_oceanaverage);
+-
+-		/*convergence criterion:*/
+-		slcconvergence(&converged,RSLg,RSLg_old,eps_rel,eps_abs);
+-		
+-	
+-		/*free ressources: */
+-		delete RSLgo;
+-		delete RSLgo_rot;
+-
+-		/*Increase count: */
+-		count++;
+-		if(converged==true){
+-			break;
+-		}
+-		if(count>=max_nonlinear_iterations){
+-			_printf0_("   maximum number of nonlinear iterations (" << max_nonlinear_iterations << ") exceeded\n"); 
+-			converged=true;
+-			break;
+-		}	
+-
+-		/*some minor verbosing adjustment:*/
+-		if(count>1)verboseconvolution=false;
+-
+-	}
+-	if(VerboseConvergence()) _printf0_("\n              total number of iterations: " << count-1 << "\n");
+-	
+-	
+-	delete RSLg_old;
+-
+-	return RSLg;
+-} /*}}}*/
+-void sealevelchange_core_deformation(Vector<IssmDouble>** pN_grd, Vector<IssmDouble>** pU_grd, Vector<IssmDouble>** pU_north_grd,Vector<IssmDouble>** pU_east_grd,FemModel* femmodel,Vector<IssmDouble>* RSLg, SealevelMasks* masks){ /*{{{*/
+-
+-	Vector<IssmDouble> *U_grd  = NULL; 
+-	Vector<IssmDouble> *dUdt_grd  = NULL; 
+-	Vector<IssmDouble> *N_grd  = NULL; 
+-	Vector<IssmDouble> *U_north_grd   = NULL; 
+-	Vector<IssmDouble> *U_east_grd    = NULL; 
+-
+-	/*parameters: */
+-	int  gsize;
+-	bool spherical=true;
+-
+-	IssmDouble          *latitude   = NULL;
+-	IssmDouble          *longitude  = NULL;
+-	IssmDouble          *radius     = NULL;
+-	IssmDouble          *xx     = NULL;
+-	IssmDouble          *yy     = NULL;
+-	IssmDouble          *zz     = NULL;
+-	int  horiz;
+-	int  grdmodel; 
+-	
+-	if(VerboseSolution()) _printf0_("	  computing vertical and horizontal geodetic signatures\n");
+-
+-	/*retrieve some parameters:*/
+-	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+-
+-	/*find size of vectors:*/
+-	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
+-
+-	/*intialize vectors:*/
+-	U_grd = new Vector<IssmDouble>(gsize);
+-	if(grdmodel==IvinsEnum) dUdt_grd = new Vector<IssmDouble>(gsize);
+-	N_grd = new Vector<IssmDouble>(gsize);
+-	if (horiz){
+-		U_north_grd = new Vector<IssmDouble>(gsize);
+-		U_east_grd = new Vector<IssmDouble>(gsize);
+-	}
+-	
+-	/*retrieve geometric information: */
+-	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
+-	VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
+-
+-	/*call the deformation module: */
+-	switch(grdmodel){
+-		case NoneEnum: 
+-			//do nothing: 
+-			break;
+-		case IvinsEnum:
+-			femmodel->IvinsDeformation(U_grd,dUdt_grd,xx,yy);
+-			break;
+-		case ElasticEnum:
+-			femmodel->SealevelchangeDeformation(N_grd, U_grd,U_north_grd,U_east_grd,RSLg, masks);
+-			break;
+-		default:
+-			_error_("Grd model " << EnumToStringx(grdmodel) << " not supported yet");
+-	}
+-
+-	/*Assign output pointers:*/
+-	*pU_grd=U_grd;
+-	*pN_grd=N_grd;
+-	if(horiz){
+-		*pU_east_grd=U_east_grd;
+-		*pU_north_grd=U_north_grd;
+-	}
+-
+-	/*Free ressources: */
+-	xDelete<IssmDouble>(longitude);
+-	xDelete<IssmDouble>(latitude);
+-	xDelete<IssmDouble>(xx);
+-	xDelete<IssmDouble>(yy);
+-	xDelete<IssmDouble>(zz);
+-	xDelete<IssmDouble>(radius);
+-	if(grdmodel==IvinsEnum)delete dUdt_grd;
+-}
+-/*}}}*/
+-
+ /*Support routines:*/
+ void TransferForcing(FemModel* femmodel,int forcingenum){ /*{{{*/
+ 
+@@ -1283,7 +939,7 @@
+ 
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeMomentOfInertiaElement(&moi_list[0],loads,sealevelloads);
++		element->SealevelchangeMomentOfInertia(&moi_list[0],loads,sealevelloads);
+ 		moi_list_cpu[0] += moi_list[0];
+ 		moi_list_cpu[1] += moi_list[1];
+ 		moi_list_cpu[2] += moi_list[2];
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26164)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26165)
+@@ -349,7 +349,6 @@
+ syn keyword cConstant SolidearthPlanetAreaEnum
+ syn keyword cConstant SolidearthSettingsAbstolEnum
+ syn keyword cConstant SolidearthSettingsCrossSectionShapeEnum
+-syn keyword cConstant SolidearthSettingsOptimEnum
+ syn keyword cConstant RotationalAngularVelocityEnum
+ syn keyword cConstant SolidearthSettingsElasticEnum
+ syn keyword cConstant SealevelchangeGeometryDoneEnum
+@@ -1451,7 +1450,6 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
+-syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1458,8 +1456,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DataSetParam
+ syn keyword cType DatasetInput
+-syn keyword cType DataSetParam
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1472,8 +1470,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType ElementVector
+ syn keyword cType Elements
+-syn keyword cType ElementVector
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1480,12 +1478,11 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1500,7 +1497,6 @@
+ 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
+@@ -1511,7 +1507,6 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
+-syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1524,8 +1519,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType OptionUtilities
+ syn keyword cType Options
+-syn keyword cType OptionUtilities
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1539,13 +1534,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType RiftStruct
+ syn keyword cType Riftfront
+-syn keyword cType RiftStruct
+ syn keyword cType SealevelMasks
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType SegRef
+ syn keyword cType Segment
+-syn keyword cType SegRef
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1564,6 +1559,10 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26164)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26165)
+@@ -343,7 +343,6 @@
+ 	SolidearthPlanetAreaEnum,
+ 	SolidearthSettingsAbstolEnum,
+ 	SolidearthSettingsCrossSectionShapeEnum,
+-	SolidearthSettingsOptimEnum,
+ 	RotationalAngularVelocityEnum,
+ 	SolidearthSettingsElasticEnum,
+ 	SealevelchangeGeometryDoneEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26164)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26165)
+@@ -351,7 +351,6 @@
+ 		case SolidearthPlanetAreaEnum : return "SolidearthPlanetArea";
+ 		case SolidearthSettingsAbstolEnum : return "SolidearthSettingsAbstol";
+ 		case SolidearthSettingsCrossSectionShapeEnum : return "SolidearthSettingsCrossSectionShape";
+-		case SolidearthSettingsOptimEnum : return "SolidearthSettingsOptim";
+ 		case RotationalAngularVelocityEnum : return "RotationalAngularVelocity";
+ 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
+ 		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26164)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26165)
+@@ -357,7 +357,6 @@
+ 	      else if (strcmp(name,"SolidearthPlanetArea")==0) return SolidearthPlanetAreaEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsAbstol")==0) return SolidearthSettingsAbstolEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsCrossSectionShape")==0) return SolidearthSettingsCrossSectionShapeEnum;
+-	      else if (strcmp(name,"SolidearthSettingsOptim")==0) return SolidearthSettingsOptimEnum;
+ 	      else if (strcmp(name,"RotationalAngularVelocity")==0) return RotationalAngularVelocityEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
+@@ -382,11 +381,11 @@
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+ 	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
++	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+-	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
++	      if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+ 	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+@@ -505,11 +504,11 @@
+ 	      else if (strcmp(name,"TransientIsgia")==0) return TransientIsgiaEnum;
+ 	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+ 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
++	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+-	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
++	      if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+ 	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+@@ -628,11 +627,11 @@
+ 	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+ 	      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 stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"EplHeadSlopeX")==0) return EplHeadSlopeXEnum;
+-	      else if (strcmp(name,"EplHeadSlopeY")==0) return EplHeadSlopeYEnum;
++	      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,"EsaEmotion")==0) return EsaEmotionEnum;
+@@ -751,11 +750,11 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"RadarPowerWolff")==0) return RadarPowerWolffEnum;
+-	      else if (strcmp(name,"RheologyBAbsGradient")==0) return RheologyBAbsGradientEnum;
++	      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;
+@@ -874,11 +873,11 @@
+ 	      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 if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+-	      else if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
++	      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;
+@@ -997,11 +996,11 @@
+ 	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+ 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
++	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+-	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
++	      if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+ 	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+ 	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+@@ -1120,11 +1119,11 @@
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"CalvingVonmises")==0) return CalvingVonmisesEnum;
+-	      else if (strcmp(name,"Cfdragcoeffabsgrad")==0) return CfdragcoeffabsgradEnum;
++	      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;
+@@ -1243,11 +1242,11 @@
+ 	      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,"Inputs")==0) return InputsEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"Inputs")==0) return InputsEnum;
+-	      else if (strcmp(name,"Internal")==0) return InternalEnum;
++	      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;
+@@ -1366,11 +1365,11 @@
+ 	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SMBgcm")==0) return SMBgcmEnum;
+-	      else if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
++	      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;
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26164)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26165)
+@@ -21,7 +21,6 @@
+ 		glfraction             = 1; %barystatic contribution full or fractional (default fractional)
+ 		grdmodel               = 0; %grd model (0 by default, 1 for elastic, 2 for Ivins)
+ 		cross_section_shape    = 0; %cross section only used when grd model is Ivins
+-		optim                  = 0; %new optimized version of the GRD code.
+ 	end
+ 	methods
+ 		function self = solidearthsettings(varargin) % {{{
+@@ -65,9 +64,6 @@
+ 		%cross section for Ivins model 
+ 		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
+ 
+-		%optim? 
+-		self.optim=0;
+-
+ 		%no grd model by default: 
+ 		self.grdmodel=0; 
+ 
+@@ -86,7 +82,6 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.glfraction','values',[0 1]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','values',[1 2]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
+-			md = checkfield(md,'fieldname','solidearth.settings.optim','values',[0,1]);
+ 
+ 			%checks on computational flags
+ 			if self.elastic==1 & self.rigid==0,
+@@ -130,7 +125,6 @@
+ 			fielddisplay(self,'glfraction','contribute fractionally (default, 1) to barystatic sea level');
+ 			fielddisplay(self,'grdmodel','type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins');
+ 			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
+-			fielddisplay(self,'optim','use optimized version of the GRD code? (default 0)');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'object',self,'fieldname','reltol','name','md.solidearth.settings.reltol','format','Double');
+@@ -149,7 +143,6 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','glfraction','name','md.solidearth.settings.glfraction','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','name','md.solidearth.settings.cross_section_shape','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','optim','name','md.solidearth.settings.optim','format','Integer');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+@@ -164,7 +157,6 @@
+ 			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.glfraction'],self.glfraction);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
+-			writejsdouble(fid,[modelname '.solidearth.settings.optim'],self.optim);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26164)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26165)
+@@ -17,7 +17,7 @@
+ md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+ md.solidearth.settings.cross_section_shape=1;    % for square-edged x-section 
+ md.solidearth.settings.computesealevelchange=0;  %do not compute sea level, only deformation
+-md.solidearth.requested_outputs={'Sealevel','SealevelUGrd'};
++md.solidearth.requested_outputs={'Sealevel','BedGRD'};
+ 
+ %Loading history 
+ md.timestepping.start_time=-2400000; %4,800 kyr :: EVALUATION TIME
+@@ -49,4 +49,4 @@
+ %Fields and tolerances to track changes
+ field_names     ={'UGrd'};
+ field_tolerances={1e-13};
+-field_values={md.results.TransientSolution(2).SealevelUGrd};
++field_values={md.results.TransientSolution(2).BedGRD};
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26164)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26165)
+@@ -2,7 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500.); %700 km resolution mesh
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+@@ -23,9 +23,11 @@
+ longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+ pos=find(late < -80);
+ md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posant=pos;
+ %greenland
+ pos=find(late>70 & late<80 & longe>-60 & longe<-30);
+ md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posgre=pos;
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+@@ -33,18 +35,15 @@
+ %}}}
+ %mask:  {{{
+ mask=gmtmask(md.mesh.lat,md.mesh.long);
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1;
++
+ icemask=ones(md.mesh.numberofvertices,1);
+-pos=find(mask==0);
+-icemask(pos)=-1;
+-pos=find(sum(mask(md.mesh.elements),2)<3);
+-icemask(md.mesh.elements(pos,:))=-1;
++icemask(md.mesh.elements(posant))=-1;
++icemask(md.mesh.elements(posgre))=-1;
++
+ md.mask.ice_levelset=icemask;
+-md.mask.ocean_levelset=-icemask;
+-
+-
+-%make sure wherever there is an ice load, that the mask is set to ice:
+-pos=find(md.masstransport.spcthickness(1:end-1));
+-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
++md.mask.ocean_levelset=oceanmask;
+ % }}}
+ 
+ %time stepping: 
+@@ -65,11 +64,11 @@
+ %Materials: 
+ md.materials=materials('hydro');
+ 
+-
+ %Miscellaneous
+ md.miscellaneous.name='test2002';
+ 
+ %Solution parameters
++md.cluster.np=3;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+ md.solidearth.settings.computesealevelchange=1;
+@@ -82,7 +81,6 @@
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
+-md.transient.isoceantransport=1;
+ md.transient.isslc=1;
+ md.solidearth.requested_outputs={'Sealevel'};
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26165-26166.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26165-26166.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26165-26166.diff	(revision 26740)
@@ -0,0 +1,84 @@
+Index: ../trunk-jpl/src/m/contrib/dlcheng/zoneaverage.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/dlcheng/zoneaverage.m	(nonexistent)
++++ ../trunk-jpl/src/m/contrib/dlcheng/zoneaverage.m	(revision 26166)
+@@ -0,0 +1,79 @@
++function avg=zoneaverage(md,field,parameter,width,distweight,areaweight,iter)
++%ZONEAVERAGE - averages the field over the elements within the distance specified by parameter .* width. 
++%               Average is weighted by the element area using model's triangulation.
++%               Width determines distance multiplier of parameter when calculating a node's distance for inclusion in an average.
++%               Distweight and Areaweight control how the node distance and area affect the weighted average.
++%               Iteration is the number of iterations to run the zone averaging.
++%
++%   Usage:
++%      avg=zone_average(md,field,parameter,width,distweight,areaweight)
++
++%TODO: HANDLE NARGINS/PAIROPTION STYLE ARGS FOR WIDTH, DISTWEIGHT, AREAWEIGHT, ITER
++
++if (dimension(md.mesh)==2),
++	numberofelements=md.mesh.numberofelements;
++	numberofnodes=md.mesh.numberofvertices;
++	index=md.mesh.elements;
++	x=md.mesh.x; y=md.mesh.y;
++else
++	numberofelements=md.mesh.numberofelements2d;
++	numberofnodes=md.mesh.numberofvertices2d;
++	index=md.mesh.elements2d;
++	x=md.mesh.x2d; y=md.mesh.y2d;
++end
++
++%node
++if numel(field)==numberofnodes,
++    areas=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
++
++    %calculate distances between nodes and reshape into addressable matrix
++    nodes=[md.mesh.x, md.mesh.y];
++    dist=pdist([nodes;nodes]);
++    dist=squareform(dist);
++    dist=dist(1:numberofnodes,numberofnodes+1:end);
++
++    %calculate max distance to average each vertex using parameter * width and mask distances
++    maxdist = parameter * width;
++    flags=dist<=maxdist;
++    
++    %calculate average area per node
++    nodeareas=zeros(numberofnodes,1);
++    elementspernode=zeros(numberofnodes,1);
++    for i=1:numberofelements,
++        for j=1:3,
++            node=index(i,j);
++            nodeareas(node)=nodeareas(node)+areas(i);
++            elementspernode(node)=elementspernode(node)+1;
++        end
++    end
++    nodeareas=nodeareas./elementspernode;
++    
++    %get distance/area weighted average of field within specified parameter width
++    avg=zeros(numberofnodes,1);
++    totalweight=distweight+areaweight;
++    distweight=distweight/totalweight;
++    areaweight=areaweight/totalweight;
++    for iter=1:iter,
++%     for iter=1:1,
++        for i=1:numberofnodes,
++            %distance weighting
++            distsum = sum(dist(i,flags(i,:))) + eps;
++            distmax = max(dist(i,flags(i,:)));
++            distweights = ones(sum(flags(i,:)),1);
++            distweights = distweights + 1 - distweight*(dist(i,(flags(i,:)))'/distsum); %inverse linear distance weight
++            distweights = distweights / sum(distweights);
++
++            %area weighting
++            areasum = sum(nodeareas(flags(i,:))) + eps;
++            areaweights = areaweight*nodeareas(flags(i,:))/areasum;
++            weights=distweights+areaweights;
++            avg(i)=nansum(weights.*field(flags(i,:)));
++            %avg(i)=nanmean(field(flags(i,:)),1);
++
++    %         areasum = sum(nodeareas(flags));
++    %         weights = nodeareas(flags)/areasum;
++    %         avg=nanmean(weights.*field(flags),2);
++        end
++        field=avg;
++    end
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26166-26167.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26166-26167.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26166-26167.diff	(revision 26740)
@@ -0,0 +1,76 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26166)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26167)
+@@ -296,7 +296,6 @@
+ 		virtual void       JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
+ 		virtual void       JacobianDeterminantSurface(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
+ 		virtual void       JacobianDeterminantTop(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0;
+-		virtual void       LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum)=0;
+ 		virtual void       Marshall(MarshallHandle* marshallhandle)=0;
+ 		virtual IssmDouble Masscon(IssmDouble* levelset)=0;
+ 		virtual IssmDouble MassFlux(IssmDouble* segment)=0;
+@@ -379,6 +378,7 @@
+ 		virtual void          EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz)=0;
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELCHANGE_
++		virtual void          LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented");};
+ 		virtual void          SetSealevelMasks(SealevelMasks* masks)=0;
+ 		virtual IssmDouble    GetArea3D(void)=0;
+ 		virtual IssmDouble    GetAreaSpherical(void)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26166)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26167)
+@@ -126,7 +126,6 @@
+ 		void           JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void           JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void           JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
+-		void           LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented yet");};
+ 		IssmDouble     Masscon(IssmDouble* levelset){_error_("not implemented yet");};
+ 		IssmDouble     MassFlux(IssmDouble* segment);
+ 		IssmDouble     MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26166)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26167)
+@@ -98,7 +98,6 @@
+ 		void        JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+ 		void        JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void        JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss){_error_("not implemented yet");};
+-		void        LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented yet");};
+ 		IssmDouble  Masscon(IssmDouble* levelset){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble* segment){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");}
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26166)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26167)
+@@ -104,7 +104,6 @@
+ 		void        JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+ 		void        JacobianDeterminantSurface(IssmDouble*  pJdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void        JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
+-		void        LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented yet");};
+ 		IssmDouble  Masscon(IssmDouble* levelset){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble* segment){_error_("not implemented yet");};
+ 		IssmDouble  MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");}
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26166)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26167)
+@@ -112,7 +112,6 @@
+ 		bool	   	IsIcefront(void);
+ 		bool        IsNodeOnShelfFromFlags(IssmDouble* flags);
+ 		bool        IsZeroLevelset(int levelset_enum);
+-		void        LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum);
+ 		IssmDouble  Masscon(IssmDouble* levelset);
+ 		IssmDouble  MassFlux(IssmDouble* segment);
+ 		IssmDouble  MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
+@@ -164,6 +163,7 @@
+ 		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_SEALEVELCHANGE_
++		void       LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum);
+ 		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads);
+ 		void       SealevelchangeGeometry(IssmDouble* lat, IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26167-26168.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26167-26168.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26167-26168.diff	(revision 26740)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26167)
++++ ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26168)
+@@ -63,7 +63,9 @@
+ # See documentation in test/NightlyRun/runme.* for more information
+ #
+ # NOTE:
++# - test125 and test126 are skipped because restart is not yet implemented for 
++#   Windows (under MSYS2)
+ # - test701 is skipped because it uses full Stokes equations
+ #
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),435,701,702,703]"
++MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126,435,701,702,703]"
+ PYTHON_NROPTIONS=""
+Index: ../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26167)
++++ ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26168)
+@@ -3,6 +3,11 @@
+ %   Usage:
+ %      cluster=generic('name','astrid','np',3);
+ %      cluster=generic('name',oshostname(),'np',3,'login','username');
++%
++%   TODO:
++%   - Add support for restart to Windows (under MSYS2), then activate tests 125 
++%   and 126 in test suite
++%
+ 
+ classdef generic
+ 	properties (SetAccess=public)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26168-26169.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26168-26169.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26168-26169.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test494.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.m	(revision 26168)
++++ ../trunk-jpl/test/NightlyRun/test494.m	(revision 26169)
+@@ -27,7 +27,7 @@
+ field_tolerances={...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+-	2e-13,2e-13,2e-13,1e-13,1e-13,2e-13,4e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++	2e-13,2e-13,2e-13,1e-13,1e-13,3e-13,5e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+ };
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test494.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.py	(revision 26168)
++++ ../trunk-jpl/test/NightlyRun/test494.py	(revision 26169)
+@@ -38,7 +38,7 @@
+ field_tolerances = [
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 2e-13, 4e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 3e-13, 5e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26169-26170.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26169-26170.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26169-26170.diff	(revision 26740)
@@ -0,0 +1,84 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26169)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26170)
+@@ -156,6 +156,11 @@
+ 				input->Marshall(marshallhandle);
+ 				this->inputs[index]=input;
+ 			}
++			else if(object_enum==TransientInputEnum){
++				TransientInput* input=new TransientInput();
++				input->Marshall(marshallhandle);
++				this->inputs[index]=input;
++			}
+ 			else{
+ 				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
+ 			}
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26169)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26170)
+@@ -118,19 +118,56 @@
+ /*}}}*/
+ void TransientInput::Marshall(MarshallHandle* marshallhandle){ /*{{{*/
+ 
+-	if (marshallhandle->OperationNumber() == MARSHALLING_LOAD){
+-		_error_("not implmented");
+-		//inputs = new Inputs();
+-	}
+-
+ 	int object_enum = TransientInputEnum;
+    marshallhandle->call(object_enum);
+ 
++	marshallhandle->call(this->numberofelements_local);
++	marshallhandle->call(this->numberofvertices_local);
+ 	marshallhandle->call(this->enum_type);
+ 	marshallhandle->call(this->numtimesteps);
+ 	marshallhandle->call(this->timesteps,numtimesteps);
+-	//inputs->Marshall(marshallhandle);
+-	_error_("not implemented");
++
++	/*Allocate memory if need be*/
++	if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
++		int N = this->numtimesteps; _assert_(N>=0 && N<1e6);
++		if(N){
++			this->inputs = xNew<Input*>(N);
++			for(int i=0;i<N;i++) this->inputs[i] = NULL;
++		}
++		else{
++			this->inputs = NULL;
++		}
++	}
++
++	/*Marshall!*/
++	if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD){
++		for(int i=0;i<this->numtimesteps;i++){
++			_assert_(this->inputs[i]);
++			object_enum = this->inputs[i]->ObjectEnum();
++			marshallhandle->call(object_enum);
++			this->inputs[i]->Marshall(marshallhandle);
++		}
++	}
++	else{
++		for(int i=0;i<this->numtimesteps;i++){
++			marshallhandle->call(object_enum);
++
++			if(object_enum==TriaInputEnum){
++				TriaInput* triainput2=new TriaInput();
++				triainput2->Marshall(marshallhandle);
++				this->inputs[i]=triainput2;
++			}
++			else if(object_enum==PentaInputEnum){
++				PentaInput* pentainput2=new PentaInput();
++				pentainput2->Marshall(marshallhandle);
++				this->inputs[i]=pentainput2;
++			}
++			else{
++				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
++			}
++		}
++	}
++
+ }
+ /*}}}*/
+ int  TransientInput::ObjectEnum(void){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26170-26171.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26170-26171.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26170-26171.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26170)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26171)
+@@ -814,7 +814,7 @@
+ 			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
+ 		fi
+ 		AC_MSG_RESULT([found])
+-		if test "x${PYTHON_MAJOR}" == "x3"; then
++		if ls ${PYTHON_ROOT}/lib/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
+ 			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}m"
+ 		else
+ 			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26171-26172.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26171-26172.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26171-26172.diff	(revision 26740)
@@ -0,0 +1,56 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 26171)
++++ ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 26172)
+@@ -89,10 +89,48 @@
+ 	marshallhandle->call(this->numberofelements_local);
+ 	marshallhandle->call(this->numberofvertices_local);
+ 	marshallhandle->call(this->ids,numids);
+-	//if (marshallhandle->OperationNumber() == MARSHALLING_LOAD) inputs = new Inputs();
+-	//inputs->Marshall(marshallhandle);
+-	_error_("not implemented");
+ 
++	/*Allocate memory if need be*/
++	int N = this->numids; _assert_(N>=0 && N<1e6);
++	if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
++		if(N){
++			this->inputs = xNew<Input*>(N);
++			for(int i=0;i<N;i++) this->inputs[i] = NULL;
++		}
++		else{
++			this->inputs = NULL;
++		}
++	}
++
++	/*Marshall!*/
++	if(marshallhandle->OperationNumber()!=MARSHALLING_LOAD){
++		for(int i=0;i<N;i++){
++			_assert_(this->inputs[i]);
++			object_enum = this->inputs[i]->ObjectEnum();
++			marshallhandle->call(object_enum);
++			this->inputs[i]->Marshall(marshallhandle);
++		}
++	}
++	else{
++		for(int i=0;i<N;i++){
++			marshallhandle->call(object_enum);
++
++			if(object_enum==TriaInputEnum){
++				TriaInput* triainput2=new TriaInput();
++				triainput2->Marshall(marshallhandle);
++				this->inputs[i]=triainput2;
++			}
++			else if(object_enum==PentaInputEnum){
++				PentaInput* pentainput2=new PentaInput();
++				pentainput2->Marshall(marshallhandle);
++				this->inputs[i]=pentainput2;
++			}
++			else{
++				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
++			}
++		}
++	}
++
+ }
+ /*}}}*/
+ int  DatasetInput::ObjectEnum(void){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26172-26173.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26172-26173.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26172-26173.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test494.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.m	(revision 26172)
++++ ../trunk-jpl/test/NightlyRun/test494.m	(revision 26173)
+@@ -27,7 +27,7 @@
+ field_tolerances={...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+-	2e-13,2e-13,2e-13,1e-13,1e-13,3e-13,5e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++	2e-13,2e-13,2e-13,1e-13,1e-13,3e-13,6e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+ };
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test494.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.py	(revision 26172)
++++ ../trunk-jpl/test/NightlyRun/test494.py	(revision 26173)
+@@ -38,7 +38,7 @@
+ field_tolerances = [
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 3e-13, 5e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 3e-13, 6e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26173-26174.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26173-26174.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26173-26174.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 26173)
++++ ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 26174)
+@@ -125,6 +125,11 @@
+ 				pentainput2->Marshall(marshallhandle);
+ 				this->inputs[i]=pentainput2;
+ 			}
++			else if(object_enum==TransientInputEnum){
++				TransientInput* transinput2=new TransientInput();
++				transinput2->Marshall(marshallhandle);
++				this->inputs[i]=transinput2;
++			}
+ 			else{
+ 				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
+ 			}
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26173)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 26174)
+@@ -161,6 +161,11 @@
+ 				input->Marshall(marshallhandle);
+ 				this->inputs[index]=input;
+ 			}
++			else if(object_enum==DatasetInputEnum){
++				DatasetInput* input=new DatasetInput();
++				input->Marshall(marshallhandle);
++				this->inputs[index]=input;
++			}
+ 			else{
+ 				_error_("input "<<EnumToStringx(object_enum)<<" not supported");
+ 			}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26174-26175.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26174-26175.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26174-26175.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26174)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26175)
+@@ -697,7 +697,7 @@
+ 	IssmDouble ub = VelMag(gauss);
+ 
+ 	/*Compute alpha^2*/
+-	if(ub<1e-10){
++	if((ub<1e-10) ||(N==0.0)){
+ 		alpha2 = 0.;
+ 	}
+ 	else{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26175-26176.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26175-26176.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26175-26176.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test494.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.m	(revision 26175)
++++ ../trunk-jpl/test/NightlyRun/test494.m	(revision 26176)
+@@ -27,7 +27,7 @@
+ field_tolerances={...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+-	2e-13,2e-13,2e-13,1e-13,1e-13,3e-13,6e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++	2e-13,2e-13,2e-13,1e-13,2e-13,3e-13,6e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+ };
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test494.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.py	(revision 26175)
++++ ../trunk-jpl/test/NightlyRun/test494.py	(revision 26176)
+@@ -38,7 +38,7 @@
+ field_tolerances = [
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 3e-13, 6e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 2e-13, 3e-13, 6e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26176-26177.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26176-26177.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26176-26177.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26176)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26177)
+@@ -191,10 +191,7 @@
+ 	}
+ 
+ 	if(ishydrology){
+-		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) ) {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26177-26178.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26177-26178.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26177-26178.diff	(revision 26740)
@@ -0,0 +1,552 @@
+Index: ../trunk-jpl/src/m/consistency/checkfield.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/checkfield.py	(revision 26177)
++++ ../trunk-jpl/src/m/consistency/checkfield.py	(revision 26178)
+@@ -10,16 +10,15 @@
+     """CHECKFIELD - check field consistency
+ 
+     Used to check model consistency
+-        
+     Requires:
+-        'field' or 'fieldname' option. If 'fieldname' is provided, it will 
++        'field' or 'fieldname' option. If 'fieldname' is provided, it will
+         retrieve it from the model md. (md.(fieldname))
+-        If 'field' is provided, it will assume the argument following 'field' 
++        If 'field' is provided, it will assume the argument following 'field'
+         is a numeric array.
+ 
+     Available options:
+         - NaN: 1 if check that there is no NaN
+-        - size: [lines cols], NaN for non checked dimensions, or 'universal' 
++        - size: [lines cols], NaN for non checked dimensions, or 'universal'
+         for any input type (nodal, element, time series, etc)
+         - > :  greater than provided value
+         - >= : greater or equal to provided value
+@@ -71,8 +70,7 @@
+     if options.exist('size'):
+         fieldsize = options.getfieldvalue('size')
+         if type(fieldsize) == str:
+-            if m.strcmp(fieldsize, 'universal'):
+-
++            if fieldsize == 'universal':
+                 #Check that vector size will not be confusing for ModelProcessorx
+                 if (md.mesh.numberofvertices == md.mesh.numberofelements):
+                     raise Exception('number of vertices is the same as number of elements')
+Index: ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py
+===================================================================
+--- ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26177)
++++ ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26178)
+@@ -65,7 +65,7 @@
+             NewDim = NCData.createDimension(dimnames[i], newdim)
+             DimDict[len(NewDim)] = dimnames[i]
+ 
+-    typelist = [bool, str, str, int, float, complex,
++    typelist = [bool, str, int, float, complex,
+                 collections.OrderedDict,
+                 np.int64, np.ndarray, np.float64]
+ 
+Index: ../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26177)
++++ ../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26178)
+@@ -1,6 +1,5 @@
+ import os
+ import socket
+-
+ from helpers import *
+ from loadresultsfromdisk import loadresultsfromdisk
+ from MatlabFuncs import ispc
+@@ -7,14 +6,15 @@
+ from pairoptions import pairoptions
+ 
+ 
+-def remove(filename):
++def remove(filename):  #{{{
+     try:
+         os.remove(filename)
+     except OSError:
+         print(('WARNING: ' + filename + ' does not exist'))
++# }}}
+ 
+ 
+-def loadresultsfromcluster(md, *args):
++def loadresultsfromcluster(md, *args):  #{{{
+     """LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
+ 
+     Usage:
+@@ -74,3 +74,4 @@
+             remove(md.miscellaneous.name + '.bat')
+ 
+     return md
++# }}}
+Index: ../trunk-jpl/src/m/classes/dslmme.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.py	(revision 26177)
++++ ../trunk-jpl/src/m/classes/dslmme.py	(revision 26178)
+@@ -1,5 +1,3 @@
+-import numpy as np
+-
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from project3d import project3d
+@@ -13,11 +11,11 @@
+         dsl = dslmme() #dynamic sea level class based on a multi-model ensemble of CMIP5 outputs
+     """
+ 
+-    def __init__(self, *args): #{{{
+-        self.modelid                               = 0 # Index into the multi-model ensemble
+-        self.global_average_thermosteric_sea_level = [] # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
+-        self.sea_surface_height_above_geoid        = [] # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
+-        self.sea_water_pressure_at_sea_floor       = [] #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
++    def __init__(self, *args):  #{{{
++        self.modelid = 0  # Index into the multi-model ensemble
++        self.global_average_thermosteric_sea_level = []  # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
++        self.sea_surface_height_above_geoid = []  # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
++        self.sea_water_pressure_at_sea_floor = []  #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
+ 
+         nargs = len(args)
+ 
+@@ -27,7 +25,7 @@
+             raise Exception('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self): # {{{
++    def __repr__(self):  # {{{
+         s = '   dsl mme parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'modelid', 'index into the multi-model ensemble, determines which field will be used.'))
+         s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.'))
+@@ -36,11 +34,11 @@
+         return s
+     #}}}
+ 
+-    def setdefaultparameters(self): #{{{
++    def setdefaultparameters(self):  #{{{
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses): # {{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         # Early return
+         if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+@@ -49,7 +47,7 @@
+             md = checkfield(md, 'field', self.global_average_thermosteric_sea_level[i], 'NaN', 1, 'Inf', 1)
+             md = checkfield(md, 'field', self.sea_surface_height_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+             md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+-        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=',len(self.global_average_thermosteric_sea_level))
++        md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=', len(self.global_average_thermosteric_sea_level))
+ 
+         if self.solidearth.settings.compute_bp_grd:
+             md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor, 'empty', 1)
+@@ -57,7 +55,7 @@
+         return md
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  #{{{
+         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 2, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'modelid', 'format', 'Double')
+         WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level), 'format', 'Integer')
+@@ -66,7 +64,7 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
+     #}}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  #{{{
+         for i in range(len(self.global_average_thermosteric_sea_level)):
+             self.sea_surface_height_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_above_geoid[i], 'type', 'node', 'layer', 1)
+             self.sea_water_pressure_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor[i], 'type', 'node', 'layer', 1)
+Index: ../trunk-jpl/src/m/classes/lovenumbers.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26177)
++++ ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26178)
+@@ -1,5 +1,3 @@
+-import numpy as np
+-
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from getlovenumbers import getlovenumbers
+@@ -7,25 +5,25 @@
+ from WriteData import WriteData
+ 
+ 
+-class lovenumbers(object): #{{{
++class lovenumbers(object):  #{{{
+     """LOVENUMBERS class definition
+ 
+     Usage:
+-        lovenumbers = lovenumbers() #will setup love numbers deg 1001 by default
+-        lovenumbers = lovenumbers('maxdeg', 10001);  #supply numbers of degrees required (here, 10001)
++        lovenumbers = lovenumbers()  #will setup love numbers deg 1001 by default
++        lovenumbers = lovenumbers('maxdeg', 10001);   #supply numbers of degrees required (here, 10001)
+     """
+ 
+-    def __init__(self, *args): #{{{
++    def __init__(self, *args):  #{{{
+         # Regular love numbers
+-        self.h = []  # Provided by PREM model
+-        self.k = []  # idem
+-        self.l = []  # idem
++        self.h = []   # Provided by PREM model
++        self.k = []   # idem
++        self.l = []   # idem
+ 
+         # Tidal love numbers for computing rotational feedback
+         self.th = []
+         self.tk = []
+         self.tl = []
+-        self.tk2secular = 0 # deg 2 secular number
++        self.tk2secular = 0  # deg 2 secular number
+ 
+         options = pairoptions(*args)
+         maxdeg = options.getfieldvalue('maxdeg', 1000)
+@@ -33,7 +31,7 @@
+         self.setdefaultparameters(maxdeg, referenceframe)
+     #}}}
+ 
+-    def setdefaultparameters(self, maxdeg, referenceframe): #{{{
++    def setdefaultparameters(self, maxdeg, referenceframe):  #{{{
+         # Initialize love numbers
+         self.h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+         self.k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+@@ -47,8 +45,8 @@
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
++    def checkconsistency(self, md, solution, analyses):  #{{{
++        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.h', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.k', 'NaN', 1, 'Inf', 1)
+@@ -63,11 +61,11 @@
+         return md
+     #}}}
+ 
+-    def defaultoutputs(self, md): #{{{
++    def defaultoutputs(self, md):  #{{{
+         return[]
+     #}}}
+ 
+-    def __repr__(self): #{{{
++    def __repr__(self):  #{{{
+         s = '   lovenumbers parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'h', 'load Love number for radial displacement'))
+         s += '{}\n'.format(fielddisplay(self, 'k', 'load Love number for gravitational potential perturbation'))
+@@ -78,7 +76,7 @@
+         return s
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'h', 'name', 'md.solidearth.lovenumbers.h', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'k', 'name', 'md.solidearth.lovenumbers.k', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'l', 'name', 'md.solidearth.lovenumbers.l', 'format', 'DoubleMat', 'mattype', 1)
+@@ -89,6 +87,6 @@
+         WriteData(fid, prefix, 'object', self, 'data', self.tk2secular, 'fieldname', 'lovenumbers.tk2secular', 'format', 'Double')
+     #}}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  #{{{
+         return
+ #}}}
+Index: ../trunk-jpl/src/m/classes/nodalvalue.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/nodalvalue.py	(revision 26177)
++++ ../trunk-jpl/src/m/classes/nodalvalue.py	(revision 26178)
+@@ -1,5 +1,4 @@
+ import numpy as np
+-
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from pairoptions import pairoptions
+@@ -19,23 +18,23 @@
+         )
+     """
+ 
+-    def __init__(self, *args): #{{{
+-        self.name               = ''
+-        self.definitionstring   = '' # string that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
+-        self.model_string       = '' # string for field that is being retrieved
+-        self.node               = np.nan #for which node are we retrieving the value?
+-        
++    def __init__(self, *args):  #{{{
++        self.name = ''
++        self.definitionstring = ''  # string that identifies this output definition uniquely, from 'Outputdefinition[1-10]'
++        self.model_string = ''  # string for field that is being retrieved
++        self.node = np.nan  #for which node are we retrieving the value?
++
+         #use provided options to change fields
+         options = pairoptions(*args)
+ 
+         # Get name
+-        self.name               = options.getfieldvalue('name', '')
+-        self.definitionstring   = options.getfieldvalue('definitionstring', '')
+-        self.model_string       = options.getfieldvalue('model_string', '')
+-        self.node               = options.getfieldvalue('node', '')
++        self.name = options.getfieldvalue('name', '')
++        self.definitionstring = options.getfieldvalue('definitionstring', '')
++        self.model_string = options.getfieldvalue('model_string', '')
++        self.node = options.getfieldvalue('node', '')
+     #}}}
+ 
+-    def __repr__(self): # {{{
++    def __repr__(self):  # {{{
+         s = '   Nodalvalue:\n'
+         s += '{}\n'.format(fielddisplay(self, 'name', 'identifier for this nodalvalue response'))
+         s += '{}\n'.format(fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from \'Outputdefinition[1-10]\''))
+@@ -44,12 +43,12 @@
+         return s
+     #}}}
+ 
+-    def setdefaultparameters(self): # {{{
++    def setdefaultparameters(self):  # {{{
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses): # {{{
+-        if not isinstance(self.name, basestring):
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        if not isinstance(self.name, str):
+             raise Exception('nodalvalue error message: \'name\' field should be a string!')
+         OutputdefinitionStringArray = []
+         for i in range(100):
+@@ -59,7 +58,7 @@
+         return md
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  #{{{
+         WriteData(fid, prefix, 'data', self.name, 'name', 'md.nodalvalue.name', 'format', 'String')
+         WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.nodalvalue.definitionenum', 'format', 'String')
+         WriteData(fid, prefix, 'data', self.model_string, 'name', 'md.nodalvalue.model_enum', 'format', 'String')
+Index: ../trunk-jpl/src/m/classes/rotational.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/rotational.py	(revision 26177)
++++ ../trunk-jpl/src/m/classes/rotational.py	(revision 26178)
+@@ -1,5 +1,3 @@
+-import numpy as np
+-
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from WriteData import WriteData
+@@ -12,10 +10,10 @@
+         rotational = rotational()
+     """
+ 
+-    def __init__(self, *args): #{{{
+-        self.equatorialmoi      = 0
+-        self.polarmoi           = 0
+-        self.langularvelocity   = 0
++    def __init__(self, *args):  #{{{
++        self.equatorialmoi = 0
++        self.polarmoi = 0
++        self.langularvelocity = 0
+ 
+         nargin = len(args)
+         if nargin == 0:
+@@ -24,7 +22,7 @@
+             raise Exception('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self): # {{{
++    def __repr__(self):  # {{{
+         s = '   rotational parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'equatorialmoi', 'mean equatorial moment of inertia [kg m^2]'))
+         s += '{}\n'.format(fielddisplay(self, 'polarmoi', 'polar moment of inertia [kg m^2]'))
+@@ -32,18 +30,18 @@
+         return s
+     #}}}
+ 
+-    def setdefaultparameters(self): # {{{
++    def setdefaultparameters(self):  # {{{
+         # Moment of inertia
+-        self.equatorialmoi  = 8.0077e37 # [kg m^2]
+-        self.polarmoi       = 8.0345e37 # [kg m^2]
++        self.equatorialmoi = 8.0077e37  # [kg m^2]
++        self.polarmoi = 8.0345e37  # [kg m^2]
+ 
+         # Mean rotational velocity of earth
+-        self.angularvelocity = 7.2921e-5 # [s^-1]
++        self.angularvelocity = 7.2921e-5  # [s^-1]
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses): # {{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+         md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.rotational.polarmoi', 'NaN', 1, 'Inf', 1)
+@@ -51,16 +49,16 @@
+         return md
+     #}}}
+ 
+-    def defaultoutputs(self, md): #{{{
++    def defaultoutputs(self, md):  #{{{
+         return []
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'equatorialmoi', 'name', 'md.solidearth.rotational.equatorialmoi', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'polarmoi', 'name', 'md.solidearth.rotational.polarmoi', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'angularvelocity', 'name', 'md.solidearth.rotational.angularvelocity', 'format', 'Double')
+     #}}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  #{{{
+         return self
+     #}}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26177)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26178)
+@@ -38,7 +38,7 @@
+             raise Exception('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self): # {{{
++    def __repr__(self):  # {{{
+         s = '   solidearth settings:\n'
+         s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level rise relative convergence criterion, (default, NaN: not applied)'))
+         s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level rise absolute convergence criterion, NaN: not applied'))
+@@ -57,10 +57,10 @@
+         return s
+     #}}}
+ 
+-    def setdefaultparameters(self): # {{{
++    def setdefaultparameters(self):  # {{{
+         # Convergence criterion: absolute, relative, and residual
+-        self.reltol = 0.01 # 1 percent
+-        self.abstol = np.nan # default
++        self.reltol = 0.01  # 1 percent
++        self.abstol = np.nan  # default
+ 
+         # Maximum of non-linear iterations
+         self.maxiter = 5
+@@ -93,8 +93,8 @@
+         self.grdmodel = 0
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses): # {{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+         md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1])
+         md = checkfield(md, 'fieldname', 'solidearth.settings.abstol', 'size', [1])
+@@ -125,7 +125,7 @@
+         return md
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer')
+@@ -144,6 +144,6 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer')
+     #}}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  #{{{
+         return self
+     #}}}
+Index: ../trunk-jpl/src/m/classes/surfaceload.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.py	(revision 26177)
++++ ../trunk-jpl/src/m/classes/surfaceload.py	(revision 26178)
+@@ -12,11 +12,11 @@
+         surfaceload = surfaceload()
+     """
+ 
+-    def __init__(self, *args): #{{{
+-        self.icethicknesschange = []
+-        self.waterheightchange  = []
+-        self.other              = []
+-        
++    def __init__(self, *args):  #{{{
++        self.icethicknesschange = np.nan
++        self.waterheightchange = np.nan
++        self.other = np.nan
++
+         nargin = len(args)
+ 
+         if nargin == 0:
+@@ -25,7 +25,7 @@
+             raise Exception('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self): # {{{
++    def __repr__(self):  #{{{
+         s = '   surfaceload:\n'
+         s += '{}\n'.format(fielddisplay(self, 'icethicknesschange', 'thickness change: ice height equivalent [mIce/yr]'))
+         s += '{}\n'.format(fielddisplay(self, 'waterheightchange', 'water height change: water height equivalent [mWater/yr]'))
+@@ -33,34 +33,34 @@
+         return s
+     #}}}
+ 
+-    def setdefaultparameters(self): # {{{
++    def setdefaultparameters(self):  # {{{
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses): # {{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+-        if len(self.icethicknesschange):
+-            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.icethicknesschange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+-        if len(self.waterheightchange):
+-            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.waterheightchange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+-        if len(self.other):
+-            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.other', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
++        if type(self.icethicknesschange) == np.ndarray:
++            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.icethicknesschange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
++        if type(self.waterheightchange) == np.ndarray:
++            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.waterheightchange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
++        if type(self.other) == np.ndarray:
++            md = checkfield(md, 'fieldname', 'solidearth.surfaceload.other', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+         return md
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
+-        if len(self.icethicknesschange) == 0:
+-            self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1, ))
+-        if len(self.waterheightchange) == 0:
+-            self.waterheightchange = np.zeros((md.mesh.numberofelements + 1, ))
+-        if len(self.other) == 0:
+-            self.other = np.zeros((md.mesh.numberofelements + 1, ))
++    def marshall(self, prefix, md, fid):  #{{{
++        if np.isnan(self.icethicknesschange).all():
++            self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1))
++        if np.isnan(self.waterheightchange).all():
++            self.waterheightchange = np.zeros((md.mesh.numberofelements + 1))
++        if np.isnan(self.other).all():
++            self.other = np.zeros((md.mesh.numberofelements + 1))
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'icethicknesschange', 'name', 'md.solidearth.surfaceload.icethicknesschange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'waterheightchange', 'name', 'md.solidearth.surfaceload.waterheightchange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'other', 'name', 'md.solidearth.surfaceload.other', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+     #}}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  #{{{
+         return self
+     #}}}
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26177)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26178)
+@@ -80,7 +80,7 @@
+     elif 'DamageEvolutionSolution':
+         analyses = ['DamageEvolutionAnalysis']
+     elif 'SamplingSolution':
+-		analyses=['SamplingAnalysis']
++        analyses = ['SamplingAnalysis']
+     else:
+         raise TypeError('solution type: {} not supported yet!'.format(solutiontype))
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26178-26179.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26178-26179.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26178-26179.diff	(revision 26740)
@@ -0,0 +1,405 @@
+Index: ../trunk-jpl/src/m/classes/clusters/stallo.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/stallo.py	(revision 26178)
++++ ../trunk-jpl/src/m/classes/clusters/stallo.py	(nonexistent)
+@@ -1,179 +0,0 @@
+-import subprocess
+-import numpy as np
+-from fielddisplay import fielddisplay
+-from pairoptions import pairoptions
+-from issmssh import issmssh
+-from issmscpin import issmscpin
+-from issmscpout import issmscpout
+-from QueueRequirements import QueueRequirements
+-from IssmConfig import IssmConfig
+-import datetime
+-try:
+-    from stallo_settings import stallo_settings
+-except ImportError:
+-    print('You need stallo_settings.py to proceed, check presence and sys.path')
+-
+-
+-class stallo(object):
+-    """
+-    Stallo cluster class definition
+-    This is a SLURM queue
+-    The priorities are given to:
+- - Large jobs
+- - Short jobs
+- - small number of job per user
+-
+-    There are some 20cpu nodes and 16cpu nodes, with 32GB (a few with 128GB) mem per node, you can ask for part of a node if you need more memory.(1 node, 2 CPUS and 10GB per cpu for example)
+-
+-
+-       Usage:
+-          cluster = stallo()
+-    """
+-
+-    def __init__(self, *args):  # {{{
+-        self.name = 'stallo'
+-        self.login = ''
+-        self.numnodes = 2
+-        self.cpuspernode = 20
+-        self.mem = 1.6
+-        self.queue = 'normal'
+-        self.time = 2 * 60
+-        self.codepath = ''
+-        self.executionpath = ''
+-        self.interactive = 0
+-        self.port = []
+-        self.accountname = ''
+-        self.profiling = 0
+-        self.exclusive = False
+-    #use provided options to change fields
+-        options = pairoptions(*args)
+-    #initialize cluster using user settings if provided
+-        self = stallo_settings(self)
+-    #OK get other fields
+-        self = options.AssignObjectFields(self)
+-        self.np = self.numnodes * self.cpuspernode
+-    # }}}
+-
+-    def __repr__(self):  # {{{
+-        #  display the object
+-        s = "class vilje object:"
+-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of CPUs per nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'memory per CPU'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (normal (D), short, singlenode, multinode, devel)'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'profiling', 'enable profiling if 1 default is 0'))
+-        return s
+-    # }}}
+-
+-    def checkconsistency(self, md, solution, analyses):  # {{{
+-        #Queue dictionarry  gives queue name as key and max walltime and cpus as var
+-        queuedict = {'short': [2 * 24 * 60, 2048],
+-                     'normal': [5 * 24 * 60, 2048],
+-                     'singlenode': [28 * 24 * 60, 20],
+-                     'multinode': [28 * 24 * 60, 2048],
+-                     'devel': [4 * 60, 2048]}
+-        QueueRequirements(queuedict, self.queue, self.np, self.time)
+-
+-    #Miscelaneous
+-        if not self.login:
+-            md = md.checkmessage('login empty')
+-        if not self.codepath:
+-            md = md.checkmessage('codepath empty')
+-        if not self.executionpath:
+-            md = md.checkmessage('executionpath empty')
+-        if self.interactive == 1:
+-            md = md.checkmessage('interactive mode not implemented')
+-        return self
+-    # }}}
+-
+-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
+-
+-        executable = 'issm.exe'
+-        if isdakota:
+-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+-            version = float(version)
+-            if version >= 6:
+-                executable = 'issm_dakota.exe'
+-        if isoceancoupling:
+-            executable = 'issm_ocean.exe'
+-    #write queuing script
+-        shortname = modelname[0:min(12, len(modelname))]
+-        timeobj = datetime.timedelta(minutes=self.time)
+-        m, s = divmod(timeobj.total_seconds(), 60)
+-        h, m = divmod(m, 60)
+-        d, h = divmod(h, 24)
+-        timestring = "%02d-%02d:%02d:%02d" % (d, h, m, s)
+-        print('timestring')
+-        fid = open(modelname + '.queue', 'w')
+-        fid.write('#!/bin/bash -l\n')
+-        fid.write('#SBATCH --job-name=%s \n' % shortname)
+-        if self.queue in ['devel', 'short']:
+-            fid.write('#SBATCH --qos=%s \n' % self.queue)
+-        else:
+-            fid.write('#SBATCH --partition=%s \n' % self.queue)
+-            if self.time < 2 * 24 * 60:
+-                fid.write('#SBATCH --qos=short \n')
+-        fid.write('#SBATCH --nodes=%i \n' % self.numnodes)
+-        fid.write('#SBATCH --ntasks-per-node=%i \n' % self.cpuspernode)
+-        fid.write('#SBATCH --time={}\n'.format(timestring))  #walltime is minutes
+-        fid.write('#SBATCH --mem-per-cpu={}MB\n'.format(int(1000 * self.mem)))  # mem is in MB
+-        if (np.mod(self.np, 16) + np.mod(self.np, 20)) == 0:
+-            fid.write('  #SBATCH --ntask=%i\n' % self.np)
+-        fid.write('#SBATCH --account=%s\n' % self.accountname)
+-        fid.write('#SBATCH --output %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+-        fid.write('#SBATCH --error %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+-        if self.exclusive:
+-            fid.write('#SBATCH --exclusive \n')
+-
+-        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
+-        fid.write('module purge\n')
+-        fid.write('module load CMake/3.8.0-GCCcore-6.3.0\n')
+-        fid.write('module load Automake/1.15.1-GCCcore-6.3.0\n')
+-        fid.write('module load libtool/2.4.6\n')
+-        fid.write('module load OpenSSL/1.1.0e-intel-2017a\n')
+-        fid.write('module load PETSc/3.7.5-intel-2017a-downloaded-deps\n')
+-
+-        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
+-        if self.profiling == 1:
+-            fid.write('module load perf-report\n')
+-            fid.write('perf-report mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+-        else:
+-            fid.write('mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+-        fid.close()
+-
+-    # }}}
+-    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+-        #compress the files into one zip.
+-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+-        for file in filelist:
+-            compressstring += ' %s' % file
+-        subprocess.call(compressstring, shell=True)
+-
+-        print('uploading input file and queueing script')
+-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+-
+-    # }}}
+-
+-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+-
+-        print('launching solution sequence on remote cluster')
+-        if restart:
+-            launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
+-        else:
+-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+-        issmssh(self.name, self.login, self.port, launchcommand)
+-
+-    # }}}
+-
+-    def Download(self, dirname, filelist):  # {{{
+-        #copy files from cluster to current directory
+-        directory = '%s/%s/' % (self.executionpath, dirname)
+-        issmscpin(self.name, self.login, self.port, directory, filelist)
+-    # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/stallo.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/stallo.m	(revision 26178)
++++ ../trunk-jpl/src/m/classes/clusters/stallo.m	(nonexistent)
+@@ -1,216 +0,0 @@
+-%        Stallo cluster class definition
+-%	        This is a SLURM queue
+-%	        The priorities are given to:
+-%	           - Large jobs
+-%	           - Short jobs
+-%	           - small number of job per user
+-%
+-%	        There are some 20cpu nodes and 16cpu nodes, with 32GB (a few with 128GB) mem per node, you can ask for part of a node if you need more memory.(1 node, 2 CPUS and 10GB per cpu for example)
+-
+-%   Usage:
+-%      cluster=stallo();
+-%      cluster=stallo('np',3);
+-%      cluster=stallo('np',3,'login','username');
+-
+-%node task and cpu must be defined, ask andreas for his stallo.py?
+-
+-classdef stallo
+-    properties (SetAccess=public)
+-		 % {{{
+-		 name           = 'stallo';
+-		 login          = '';
+-		 numnodes       = 2;
+-		 cpuspernode    = 10;
+-		 mem            = 1.5;
+-		 queue          = 'normal';
+-		 time           = 2*60;
+-		 codepath       = '';
+-		 executionpath  = '';
+-		 interactive    = 0;
+-		 port           = [];
+-		 accountname    = '';
+-		 profiling	= 0;
+-		 bbftp          = 0;
+-		 % }}}
+-	 end
+-	 methods
+-		 function cluster=stallo(varargin) % {{{
+-
+-			 %initialize cluster using default settings if provided
+-			 if (exist('stallo_settings')==2), stallo_settings; end
+-
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    accountname: %s',cluster.accountname));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i, cpu per nodes',cluster.cpuspernode));
+-			 disp(sprintf('    queue: %s, name of the queue (normal (D), short,singlenode,multinode,devel)',cluster.queue));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-			 disp(sprintf('    time: %i, walltime requested in minutes',cluster.time));
+-			 disp(sprintf('    memory: %i, memory per CPU',cluster.mem));
+-			 disp(sprintf('    profiling: %i, enable profiling if 1 default is 0',cluster.profiling));
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+-
+-			 available_queues={'short','normal','singlenode','multinode','devel'};
+-			 queue_requirements_time=[60 2*24*60 28*24*60 28*24*60 4*60];
+-			 queue_requirements_np=[2048 2048 20 2048 2048];
+-
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+-
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+-
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+-
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+-
+-			 executable='issm.exe';
+-			 if isdakota,
+-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+-				 if (version>=6),
+-					 executable='issm_dakota.exe';
+-				 end
+-			 end
+-			 if isoceancoupling,
+-				 executable='issm_ocean.exe';
+-			 end
+-
+-			 days=floor(cluster.time/(60*24));
+-			 hours=floor((cluster.time-(days*60*24))/60);
+-			 minutes=floor(mod((cluster.time-(days*60*24)-(hours*60)),60));
+-
+-			 %write queuing script
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash -l\n');
+-			 fprintf(fid,'#SBATCH --job-name=%s \n',modelname);
+-			 fprintf(fid,'#SBATCH --qos=%s \n',cluster.queue);
+-			 fprintf(fid,'#SBATCH --nodes=%i \n',cluster.numnodes);
+-			 fprintf(fid,'#SBATCH --ntasks-per-node=%i \n',cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH --time=%02i-%02i:%02i:00 \n',days,hours,minutes);
+-			 fprintf(fid,'#SBATCH --mem-per-cpu=%iMB\n',1000*cluster.mem); % mem in MB
+-			 if (mod(cluster.np,16)+mod(cluster.np,20))==0,
+-			 	fprintf(fid,'#SBATCH --ntask=%i\n',cluster.np);
+-			 end
+-			 fprintf(fid,'#SBATCH --account=%s\n',cluster.accountname);
+- 			 fprintf(fid,'#SBATCH -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+- 			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
+-
+- 			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);%FIXME
+- 			 fprintf(fid,'module purge\n');
+- 			 fprintf(fid,'module load CMake/3.8.0-GCCcore-6.3.0\n');
+- 			 fprintf(fid,'module load Automake/1.15.1-GCCcore-6.3.0\n');
+- 			 fprintf(fid,'module load libtool/2.4.6\n');
+- 			 fprintf(fid,'module load OpenSSL/1.1.0e-intel-2017a\n');
+- 			 fprintf(fid,'module load PETSc/3.7.5-intel-2017a-downloaded-deps\n');
+-
+- 			 fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
+-			 if cluster.profiling==1,
+-			 	fprintf(fid,'module load perf-report\n');
+-			 	fprintf(fid,'perf-report mpirun -np %i %s/%s %s %s/%s %s\n',cluster.np,cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
+-			 else
+-			 	fprintf(fid,'mpirun -np %i %s/%s %s %s/%s %s\n',cluster.np,cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
+-			 end
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
+-
+-			 %in interactive mode, create a run file, and errlog and outlog file
+-			 if cluster.interactive,
+-			 	 fid=fopen([modelname '.run'],'w');
+-			 	 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-		 	 	 if ~io_gather, %concatenate the output files:
+-			 		 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 	 end
+-			 	 fclose(fid);
+-			 	 fid=fopen([modelname '.errlog'],'w');
+-			 	 fclose(fid);
+-			 	 fid=fopen([modelname '.outlog'],'w');
+-			 	 fclose(fid);
+-			 end
+-		 end
+-		 %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+-
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.run '  modelname '.errlog ' modelname '.outlog '];
+-			 end
+-			 system(compressstring);
+-			 disp('uploading input file and queueing script');
+-			 if cluster.interactive==10,
+-				 directory=[pwd() '/run/'];
+-			 elseif cluster.interactive,
+-				 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+-			 else
+-				 directory=cluster.executionpath;
+-			 end
+-
+-			 if ~cluster.bbftp,
+-				 issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+-			 else
+-				 issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
+-
+-			 end
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+-
+-			 %lauch command, to be executed via ssh
+-			 if ~cluster.interactive,
+-				 if ~isempty(restart)
+-					 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
+-				 else
+-					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
+-				 end
+-			 else
+-				 if ~isempty(restart)
+-					 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+-				 else
+-					 if cluster.interactive==10,
+-						 launchcommand=['cd ' pwd() '/run && tar -zxf ' dirname '.tar.gz'];
+-					 else
+-						 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive) ' && tar -zxf ' dirname '.tar.gz'];
+-					 end
+-				 end
+-			 end
+-
+-			 disp('launching solution sequence on remote cluster');
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end
+-		 %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
+-
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+-
+-		 end %}}}
+-	end
+-end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26179-26180.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26179-26180.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26179-26180.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26179)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26180)
+@@ -57,20 +57,21 @@
+ def ismember(a, s):
+     import numpy as np
+ 
+-    if not isinstance(s, (tuple, list, dict, np.ndarray)):
++    if not isinstance(s, (range, tuple, list, dict, np.ndarray)):
+         s = [s]
+ 
+-    if not isinstance(a, (tuple, list, dict, np.ndarray)):
++    if not isinstance(a, (range, tuple, list, dict, np.ndarray)):
+         a = [a]
+ 
+-    if not isinstance(a, np.ndarray):
++    if not isinstance(a, (range, np.ndarray)):
+         b = [item in s for item in a]
+ 
+     else:
+-        if not isinstance(s, np.ndarray):
++        if not isinstance(s, (range, 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)
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26180-26181.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26180-26181.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26180-26181.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/m/miscellaneous/prctile_issm.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/prctile_issm.py	(revision 26180)
++++ ../trunk-jpl/src/m/miscellaneous/prctile_issm.py	(revision 26181)
+@@ -40,7 +40,10 @@
+ 
+         #  if one value, just copy it
+         elif n == 1:
+-            y = np.tile(x[0, :], (len(p), 1))
++            if isinstance(p, int):
++                y = x[0, :]
++            else:
++                y = np.tile(x[0, :], (len(p), 1))
+ 
+         #  if no values, use NaN
+         else:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26181-26182.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26181-26182.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26181-26182.diff	(revision 26740)
@@ -0,0 +1,106 @@
+Index: ../trunk-jpl/src/m/plot/plotmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotmodel.py	(revision 26181)
++++ ../trunk-jpl/src/m/plot/plotmodel.py	(revision 26182)
+@@ -13,7 +13,7 @@
+ 
+ def plotmodel(md, *args):
+     '''
+-    PLOTMODEL - At command prompt, type 'plotdoc()' for additional 
++    PLOTMODEL - At command prompt, type 'plotdoc()' for additional
+     documentation.
+ 
+     TODO:
+@@ -30,7 +30,7 @@
+     #get number of subplots
+     subplotwidth = ceil(sqrt(numberofplots))
+ 
+-    # TODO: Check that commenting this out is correct; we do not need a hold 
++    # TODO: Check that commenting this out is correct; we do not need a hold
+     # under matplotlib, right?
+     #
+     # #get hold
+@@ -39,27 +39,24 @@
+     #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')
++            nrows = np.ceil(numberofplots / ncols)
++        else:
++            nrows = np.ceil(numberofplots / subplotwidth)
+ 
+     if options.list[0].exist('ncols'):
+         ncols = options.list[0].getfieldvalue('ncols')
+-        nc = True
++        nrows = np.ceil(numberofplots / ncols)
+     else:
+         ncols = int(subplotwidth)
+-        nc = False
+     ncols = int(ncols)
+     nrows = int(nrows)
+ 
+-    #check that nrows and ncols were given at the same time!
+-    if nr != nc:
+-        raise Exception('plotmodel error message: nrows and ncols need to be specified together, or not at all')
+-
+     # Go through plots
+     #
+-    # NOTE: The following is where Python + matplolib differs substantially in 
++    # NOTE: The following is where Python + matplolib differs substantially in
+     #       implementation and inteface from MATLAB.
+     #
+     # Sources:
+@@ -82,19 +79,19 @@
+         if plotnum == 1:
+             plotnum = None
+ 
+-        # NOTE: The inline comments for each of the following parameters are 
++        # NOTE: The inline comments for each of the following parameters are
+         #       taken from https://matplotlib.org/api/_as_gen/mpl_toolkits.axes_grid1.axes_grid.ImageGrid.html
+         #
+-        direction = options.list[0].getfieldvalue('direction', 'row') # {"row", "column"}, default: "row"
+-        axes_pad = options.list[0].getfieldvalue('axes_pad', 0.25) # float or (float, float), default : 0.02; Padding or (horizonal padding, vertical padding) between axes, in inches
+-        add_all = options.list[0].getfieldvalue('add_all', True) # bool, default: True
+-        share_all = options.list[0].getfieldvalue('share_all', True) # bool, default: False
+-        label_mode = options.list[0].getfieldvalue('label_mode', 'L') # {"L", "1", "all"}, default: "L"; Determines which axes will get tick labels: "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels;. "1": Only the bottom left axes is labelled. "all": all axes are labelled.
++        direction = options.list[0].getfieldvalue('direction', 'row')  # {"row", "column"}, default: "row"
++        axes_pad = options.list[0].getfieldvalue('axes_pad', 0.25)  # float or (float, float), default : 0.02; Padding or (horizonal padding, vertical padding) between axes, in inches
++        add_all = options.list[0].getfieldvalue('add_all', True)  # bool, default: True
++        share_all = options.list[0].getfieldvalue('share_all', True)  # bool, default: False
++        label_mode = options.list[0].getfieldvalue('label_mode', 'L')  # {"L", "1", "all"}, default: "L"; Determines which axes will get tick labels: "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels;. "1": Only the bottom left axes is labelled. "all": all axes are labelled.
+ 
+         # Translate MATLAB colorbar mode to matplotlib
+         #
+         # TODO:
+-        # - Add 'edge' option (research if there is a corresponding option in 
++        # - Add 'edge' option (research if there is a corresponding option in
+         #   MATLAB)?
+         #
+         colorbar = options.list[0].getfieldvalue('colorbar', 'on')  # on, off (single)
+@@ -108,16 +105,16 @@
+         else:
+             raise RuntimeError('plotmodel error: colorbar mode \'{}\' is not a valid option'.format(colorbar))
+ 
+-        cbar_mode = colorbar # {"each", "single", "edge", None }, default: None
+-        cbar_location = options.list[0].getfieldvalue('colorbarpos', 'right') # {"left", "right", "bottom", "top"}, default: "right"
+-        cbar_pad = options.list[0].getfieldvalue('colorbarpad', 0.025) # float, default: None
+-        cbar_size = options.list[0].getfieldvalue('colorbarsize', '5%') # size specification (see Size.from_any), default: "5%"
++        cbar_mode = colorbar   # {"each", "single", "edge", None }, default: None
++        cbar_location = options.list[0].getfieldvalue('colorbarpos', 'right')   # {"left", "right", "bottom", "top"}, default: "right"
++        cbar_pad = options.list[0].getfieldvalue('colorbarpad', 0.025)  # float, default: None
++        cbar_size = options.list[0].getfieldvalue('colorbarsize', '5%')  # size specification (see Size.from_any), default: "5%"
+ 
+         # NOTE: Second parameter is:
+         #
+         #   rect(float, float, float, float) or int
+         #
+-        # The axes position, as a (left, bottom, width, height) tuple or as a 
++        # The axes position, as a (left, bottom, width, height) tuple or as a
+         # three-digit subplot position code (e.g., "121").
+         #
+         axgrid = ImageGrid(
Index: /issm/oecreview/Archive/25834-26739/ISSM-26182-26183.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26182-26183.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26182-26183.diff	(revision 26740)
@@ -0,0 +1,1419 @@
+Index: ../trunk-jpl/src/m/classes/clusters/vilje.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/vilje.py	(revision 26182)
++++ ../trunk-jpl/src/m/classes/clusters/vilje.py	(nonexistent)
+@@ -1,145 +0,0 @@
+-import subprocess
+-from fielddisplay import fielddisplay
+-from pairoptions import pairoptions
+-from issmssh import issmssh
+-from issmscpin import issmscpin
+-from issmscpout import issmscpout
+-from QueueRequirements import QueueRequirements
+-from IssmConfig import IssmConfig
+-import datetime
+-try:
+-    from vilje_settings import vilje_settings
+-except ImportError:
+-    print('You need vilje_settings.py to proceed, check presence and sys.path')
+-
+-
+-class vilje(object):
+-    """
+-    Vilje cluster class definition
+-
+-       Usage:
+-          cluster = vilje()
+-    """
+-
+-    def __init__(self, *args):    # {{{
+-        self.name = 'vilje'
+-        self.login = ''
+-        self.numnodes = 2
+-        self.cpuspernode = 32
+-        self.procspernodes = 16
+-        self.mem = 28
+-        self.queue = 'workq'
+-        self.time = 2 * 60
+-        self.codepath = ''
+-        self.executionpath = ''
+-        self.interactive = 0
+-        self.port = []
+-        self.accountname = ''
+-
+-    #use provided options to change fields
+-        options = pairoptions(*args)
+-
+-    #initialize cluster using user settings if provided
+-        self = vilje_settings(self)
+-    #OK get other fields
+-        self = options.AssignObjectFields(self)
+-        self.np = self.numnodes * self.procspernodes
+-    # }}}
+-
+-    def __repr__(self):    # {{{
+-        #  display the object
+-        s = "class vilje object:"
+-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs (32)'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'node memory'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (test is an option, workq the default)'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+-        return s
+-    # }}}
+-
+-    def checkconsistency(self, md, solution, analyses):    # {{{
+-        #Queue dictionarry  gives queu name as key and max walltime and cpus as var
+-        queuedict = {'workq': [5 * 24 * 60, 30],
+-                     'test': [30, 4]}
+-        QueueRequirements(queuedict, self.queue, self.np, self.time)
+-
+-    #Miscelaneous
+-        if not self.login:
+-            md = md.checkmessage('login empty')
+-        if not self.codepath:
+-            md = md.checkmessage('codepath empty')
+-        if not self.executionpath:
+-            md = md.checkmessage('executionpath empty')
+-        if self.interactive == 1:
+-            md = md.checkmessage('interactive mode not implemented')
+-        return self
+-    # }}}
+-
+-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+-        executable = 'issm.exe'
+-        if isdakota:
+-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+-            version = float(version)
+-            if version >= 6:
+-                executable = 'issm_dakota.exe'
+-        if isoceancoupling:
+-            executable = 'issm_ocean.exe'
+-
+-    #write queuing script
+-        shortname = modelname[0:min(12, len(modelname))]
+-        fid = open(modelname + '.queue', 'w')
+-        fid.write('#PBS -S / bin / bash\n')
+-        fid.write('#PBS -N %s \n' % shortname)
+-        fid.write('#PBS -q %s \n' % self.queue)
+-        fid.write('#PBS -l select=%i:ncpus=%i:mpiprocs=%s\n' % (self.numnodes, self.cpuspernode, self.procspernodes))
+-        timeobj = datetime.timedelta(minutes=self.time)
+-        m, s = divmod(timeobj.total_seconds(), 60)
+-        h, m = divmod(m, 60)
+-        timestring = "%02d:%02d:%02d" % (h, m, s)
+-        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
+-        fid.write('#PBS -A %s\n' % self.accountname)
+-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+-        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
+-        fid.write('module load intelcomp/17.0.0\n')
+-        fid.write('module load mpt/2.14\n')
+-        fid.write('module load petsc/3.7.4d\n')
+-        fid.write('module load parmetis/4.0.3\n')
+-        fid.write('module load mumps/5.0.2\n')
+-        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
+-        fid.write('mpiexec_mpt -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+-        fid.close()
+-    # }}}
+-
+-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+-        #compress the files into one zip.
+-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+-        for file in filelist:
+-            compressstring += ' %s' % file
+-        subprocess.call(compressstring, shell=True)
+-
+-        print('uploading input file and queueing script')
+-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+-    # }}}
+-
+-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+-        print('launching solution sequence on remote cluster')
+-        if restart:
+-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+-        else:
+-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+-        issmssh(self.name, self.login, self.port, launchcommand)
+-    # }}}
+-
+-    def Download(self, dirname, filelist):    # {{{
+-        #copy files from cluster to current directory
+-        directory = '%s/%s/' % (self.executionpath, dirname)
+-        issmscpin(self.name, self.login, self.port, directory, filelist)
+-    # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/hexagon.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/hexagon.py	(revision 26182)
++++ ../trunk-jpl/src/m/classes/clusters/hexagon.py	(nonexistent)
+@@ -1,145 +0,0 @@
+-import subprocess
+-from fielddisplay import fielddisplay
+-from pairoptions import pairoptions
+-from issmssh import issmssh
+-from issmscpin import issmscpin
+-from issmscpout import issmscpout
+-from IssmConfig import IssmConfig
+-import datetime
+-try:
+-    from hexagon_settings import hexagon_settings
+-except ImportError:
+-    print('You need hexagon_settings.py to proceed, check presence and sys.path')
+-
+-
+-class hexagon(object):
+-    """
+-    Hexagon cluster class definition
+-    Hexagon have nodes built of 2 * 16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway.
+-    You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
+-       Usage:
+-          cluster = hexagon()
+-    """
+-
+-    def __init__(self, *args):  # {{{
+-        self.name = 'hexagon'
+-        self.login = ''
+-        self.numnodes = 2
+-        self.procspernodes = 32
+-        self.mem = 32000
+-        self.queue = 'batch'
+-        self.time = 2 * 60
+-        self.codepath = ''
+-        self.executionpath = ''
+-        self.interactive = 0
+-        self.port = []
+-        self.accountname = ''
+-
+-    #use provided options to change fields
+-        options = pairoptions(*args)
+-
+-    #initialize cluster using user settings if provided
+-        self = hexagon_settings(self)
+-
+-    #OK get other fields
+-        self = options.AssignObjectFields(self)
+-        self.np = self.numnodes * self.procspernodes
+-    # }}}
+-
+-    def __repr__(self):      # {{{
+-        #  display the object
+-        s = "class hexagon object:"
+-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes  default and optimal is 32'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'Total node memory'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+-        return s
+-    # }}}
+-
+-    def checkconsistency(self, md, solution, analyses):      # {{{
+-        #mem should not be over 32000mb
+-        #numprocs should not be over 4096
+-        #we have cpupernodes * numberofcpus = mppwidth and mppnppn = cpupernodes,
+-        #Miscelaneous
+-        if not self.login:
+-            md = md.checkmessage('login empty')
+-        if not self.codepath:
+-            md = md.checkmessage('codepath empty')
+-        if not self.executionpath:
+-            md = md.checkmessage('executionpath empty')
+-        if self.interactive == 1:
+-            md = md.checkmessage('interactive mode not implemented')
+-        if self.mem > 32000:
+-            md = md.checkmessage('asking too much memory max is 32000 per node')
+-        return self
+-    # }}}
+-
+-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+-        executable = 'issm.exe'
+-        if isdakota:
+-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+-            version = float(version)
+-            if version >= 6:
+-                executable = 'issm_dakota.exe'
+-        if isoceancoupling:
+-            executable = 'issm_ocean.exe'
+-
+-    #write queuing script
+-        shortname = modelname[0:min(12, len(modelname))]
+-        fid = open(modelname + '.queue', 'w')
+-        fid.write('  #!/bin/bash\n')
+-        fid.write('  #PBS - N %s \n' % shortname)
+-        fid.write('  #PBS - l mppwidth=%i, mppnppn=%i\n' % (self.np, self.procspernodes))
+-        timeobj = datetime.timedelta(minutes=self.time)
+-        m, s = divmod(timeobj.total_seconds(), 60)
+-        h, m = divmod(m, 60)
+-        timestring = "%02d:%02d:%02d" % (h, m, s)
+-        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
+-        fid.write('#PBS -l mppmem=%imb\n' % int(self.mem / self.procspernodes))
+-        fid.write('#PBS -A %s\n' % self.accountname)
+-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+-        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
+-        fid.write('export CRAY_ROOTFS=DSL\n')
+-        fid.write('module swap PrgEnv-cray / 5.2.40 PrgEnv - gnu\n')
+-        fid.write('module load cray-petsc\n')
+-        fid.write('module load cray-tpsl\n')
+-        fid.write('module load cray-mpich\n')
+-        fid.write('module load gsl\n')
+-        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
+-        fid.write('aprun -B %s/%s %s %s/%s %s\n' % (self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+-        fid.close()
+-    # }}}
+-
+-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+-        #compress the files into one zip.
+-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+-        for file in filelist:
+-            compressstring += ' %s' % file
+-        subprocess.call(compressstring, shell=True)
+-
+-        print('uploading input file and queueing script')
+-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+-    # }}}
+-
+-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+-        print('launching solution sequence on remote cluster')
+-        if restart:
+-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+-        else:
+-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+-        issmssh(self.name, self.login, self.port, launchcommand)
+-    # }}}
+-
+-    def Download(self, dirname, filelist):    # {{{
+-        #copy files from cluster to current directory
+-        directory = '%s/%s/' % (self.executionpath, dirname)
+-        issmscpin(self.name, self.login, self.port, directory, filelist)
+-    # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/vilje.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/vilje.m	(revision 26182)
++++ ../trunk-jpl/src/m/classes/clusters/vilje.m	(nonexistent)
+@@ -1,209 +0,0 @@
+-%vilje class definition
+-%
+-%   Usage:
+-%      cluster=greenplanet();
+-%      cluster=greenplanet('np',3);
+-%      cluster=greenplanet('np',3,'login','username');
+-
+-classdef vilje
+-	properties (SetAccess=public)  
+-		% {{{
+-		name           = 'vilje';
+-		login          = '';
+-		numnodes       = 2;
+-		cpuspernode    = 32;
+-		procspernodes  = 16;
+-		mem            = 28;
+-		numstreams		= 8; %Henning added
+-		queue          = 'workq';
+-		time           = 2*60;
+-		codepath       = '';
+-		executionpath  = '';
+-		interactive    = 0;
+-		port           = [];
+-		accountname    = '';
+-		% }}}
+-	end
+-	methods
+-		function cluster=vilje(varargin) % {{{
+-
+-			%initialize cluster using default settings if provided
+-			if (exist('vilje_settings')==2), vilje_settings; end
+-
+-			%use provided options to change fields
+-			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		end
+-		%}}}
+-		function disp(cluster) % {{{
+-			%  display the object
+-			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			disp(sprintf('    name: %s',cluster.name));
+-			disp(sprintf('    login: %s',cluster.login));
+-			disp(sprintf('    accountname: %s',cluster.accountname));
+-			disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			disp(sprintf('    np: %i', cluster.cpuspernode*cluster.numnodes));
+-			disp(sprintf('    procspernodes: %i',cluster.procspernodes));
+-			disp(sprintf('    queue: %s',cluster.queue));
+-			disp(sprintf('    codepath: %s',cluster.codepath));
+-			disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			disp(sprintf('    interactive: %i',cluster.interactive));
+-			disp(sprintf('    time: %i',cluster.time));
+-			disp(sprintf('    memory: %i',cluster.mem));
+-		end
+-		%}}}
+-		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+-
+-			available_queues={'workq'};
+-			queue_requirements_time=[5*24*60];
+-			queue_requirements_np=[30];
+-
+-			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+-
+-			%Miscelaneous
+-			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
+-			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+-
+-		end
+-		%}}}
+-		function numprocs=np(self) % {{{
+-			%compute number of processors
+-			numprocs=self.numnodes*self.procspernodes;
+-		end
+-		%}}}
+-		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+-
+-			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+-
+-			%compute number of processors
+-% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;
+-
+-			%write queuing script 
+-			fid=fopen([modelname '.queue'],'w');
+-			fprintf(fid,'#PBS -S /bin/bash\n');
+-			fprintf(fid,'#PBS -N %s\n',modelname);
+-			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,16);
+-			
+-			%calculate walltime in hh:mm:ss format
+-			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
+-			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
+-			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
+-			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+-			fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+-			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			fprintf(fid,'module load intelcomp/17.0.0\n') 
+-			fprintf(fid,'module load mpt/2.14\n')
+-			fprintf(fid,'module load petsc/3.7.4d\n')
+-			fprintf(fid,'module load parmetis/4.0.3\n') 
+-			fprintf(fid,'module load mumps/5.0.2\n')
+-			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+-			fprintf(fid,'mpiexec_mpt -n %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+-			if ~io_gather, %concatenate the output files:
+-				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			end
+-			fclose(fid);
+-		end
+-		%}}}
+-		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+-
+-			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+-
+-			executable='issm.exe';
+-			if isdakota,
+-				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+-				if (version>=6),
+-					executable='issm_dakota.exe';
+-				end
+-			end
+-			if isoceancoupling,
+-				executable='issm_ocean.exe';
+-			end
+-
+-			%compute number of processors
+-% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;                     
+-% 			shortname = substring(modelname,1,min(12,length(modelname)));
+-
+-			%write queuing script 
+-			fid=fopen([modelname '.queue'],'w');
+-			fprintf(fid,'#PBS -S /bin/bash\n');
+-% 			fprintf(fid,'#PBS -N %s\n',shortname);
+-			fprintf(fid,'#PBS -N %s\n',modelname);
+-			fprintf(fid,'#PBS -q %s \n',cluster.queue);
+-			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,cluster.procspernodes);
+-
+-			%calculate walltime in hh:mm:ss format
+-			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
+-% 			fprintf(fid,'#PBS -l walltime=%s\n',duration(0,cluster.time,0)); %walltime is in minutes.
+-% 			fprintf(fid,'#PBS -l walltime=%s\n',10); %walltime is in minutes.
+-			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
+-% 			fprintf(fid,'#PBS -l walltime=%i\n',walltime); %walltime is in hh:mm:ss
+-			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
+-			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+-			fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
+-			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			fprintf(fid,'module load intelcomp/17.0.0\n') 
+-			fprintf(fid,'module load mpt/2.14\n')
+-			fprintf(fid,'module load petsc/3.7.4d\n')
+-			fprintf(fid,'module load parmetis/4.0.3\n') 
+-			fprintf(fid,'module load mumps/5.0.2\n')
+-			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-
+-			if ~io_gather, %concatenate the output files:
+-				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			end
+-			fclose(fid);
+-
+-			%in interactive mode, create a run file, and errlog and outlog file
+-			if cluster.interactive,
+-				fid=fopen([modelname '.run'],'w');
+-				fprintf(fid,'mpiexec_mpt -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-				if ~io_gather, %concatenate the output files:
+-					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-				end
+-				fclose(fid);
+-				fid=fopen([modelname '.errlog'],'w');
+-				fclose(fid);
+-				fid=fopen([modelname '.outlog'],'w');
+-				fclose(fid);
+-			end
+-		end %}}}
+-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+-
+-			%compress the files into one zip.
+-			compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			for i=1:numel(filelist),
+-				compressstring = [compressstring ' ' filelist{i}];
+-			end
+-			system(compressstring);
+-			disp('uploading input file and queueing script');
+-			directory=cluster.executionpath;
+-% 			issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
+-			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+-
+-		end
+-		%}}}
+-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+-
+-			disp('launching solution sequence on remote cluster');
+-			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+-			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		end %}}}
+-		function Download(cluster,dirname,filelist)% {{{
+-
+-			%copy files from cluster to current directory
+-			directory=[cluster.executionpath '/' dirname '/'];
+-			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+-
+-		end %}}}
+-	end
+-end
+
+Property changes on: ../trunk-jpl/src/m/classes/clusters/vilje.m
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26182)
++++ ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26183)
+@@ -120,8 +120,8 @@
+                     supstring += ' --suppressions=' + supfile
+ 
+                 if IssmConfig('_HAVE_MPI_')[0]:
+-                    fid.write('mpiexec -np {} {} --leak-check=full {} {}/{} {} {}/{} {} 2> {}.errlog > {}.outlog '.
+-                              format(self.np, self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
++                    fid.write('mpiexec -np {} {} --leak-check=full {} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.format(self.np, self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
++                    #fid.write('mpiexec -np {} {} --tool=callgrind {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.format(self.np, self.valgrind, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+                 else:
+                     fid.write('{} --leak-check=full {} {}/{} {} {}/{} {} 2> {}.errlog > {}.outlog '.
+                               format(self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26182)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26183)
+@@ -37,10 +37,7 @@
+ from toolkits import toolkits
+ from generic import generic
+ from pfe import pfe
+-from vilje import vilje
+-from hexagon import hexagon
+ from cyclone import cyclone
+-from stallo import stallo
+ from saga import saga
+ from balancethickness import balancethickness
+ from stressbalance import stressbalance
+@@ -184,7 +181,7 @@
+ 
+     def __repr__(obj):  #{{{
+         # TODO:
+-        # - Convert all formatting to calls to <string>.format (see any 
++        # - Convert all formatting to calls to <string>.format (see any
+         #   already converted <class>.__repr__ method for examples)
+         #
+ 
+@@ -892,7 +889,6 @@
+                 if isvector:
+                     md.hydrology.__dict__[field] = project2d(md, md.hydrology.__dict__[field], 1)
+ 
+-        # Materials
+         md.materials.rheology_B = DepthAverage(md, md.materials.rheology_B)
+         md.materials.rheology_n = project2d(md, md.materials.rheology_n, 1)
+ 
+Index: ../trunk-jpl/src/m/coordsystems/gmtmask.m
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 26182)
++++ ../trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 26183)
+@@ -5,18 +5,18 @@
+ %      mask.ocean = gmtmask(md.mesh.lat,md.mesh.long);
+ %
+ 
+-	%are we doing a recursive call? 
++	%are we doing a recursive call?
+ 	if nargin==3,
+ 		recursive=1;
+-	else 
++	else
+ 		recursive=0;
+ 	end
+-	
++
+ 	if(recursive)disp(sprintf('             recursing: num vertices %i',length(lat)));
+ 	else disp(sprintf('gmtmask: num vertices %i',length(lat)));
+ 	end
+-	
+-	%Check lat and long size is not more than 50,000; If so, recursively call gmtmask: 
++
++	%Check lat and long size is not more than 50,000; If so, recursively call gmtmask:
+ 	if length(lat)>50000,
+ 		for i=1:50000:length(lat),
+ 			j=i+50000-1;
+@@ -27,13 +27,35 @@
+ 		end
+ 		return
+ 	end
+-	
++
+ 	%First, write our lat,long file for gmt:
+ 	nv=length(lat);
+-	filename_all = ['all_vertices-' num2str(feature('GetPid')) '.txt']; 
+-	filename_oce = ['oce_vertices-' num2str(feature('GetPid')) '.txt']; 
++	filename_all = ['all_vertices-' num2str(feature('GetPid')) '.txt'];
++	filename_oce = ['oce_vertices-' num2str(feature('GetPid')) '.txt'];
+ 	dlmwrite(filename_all,[long lat (1:nv)'],'delimiter','\t','precision',10);
+ 
++	%Avoid bypassing of the ld library path by Matlab (:()
++	%
++	% TODO: Do we really need this (we can/already set it in etc/environment.sh)?
++	if ismac,
++		dyld_library_path_old=getenv('DYLD_LIBRARY_PATH');
++		setenv('DYLD_LIBRARY_PATH',[ issmdir '/externalpackages/curl/install/lib:' issmdir '/externalpackages/hdf5/install/lib:' issmdir '/externalpackages/netcdf/install/lib' ]);
++	end
++
++	%Find path to gmt, list all possible known paths to gmt (you may need to add yours to the list)
++	gmtpaths = {[issmdir '/bin/gmt'],[issmdir '/externalpackages/gmt/install/bin/gmt'],'/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt', '/usr/bin/gmt'};
++	gmtpath = '';
++	for i=gmtpaths
++		if exist(i{1},'file'),
++			gmtpath = i{1};
++			break;
++		end
++	end
++	if isempty(gmtpath),
++		error('gmt not found! Make sure it is properly installed, or add its path to this file.');
++	end
++
++
+ 	%figure out which vertices are on the ocean, which one on the continent:
+ 	[status,result] = system(['gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
+ 	if status~=0,
+@@ -40,10 +62,14 @@
+ 		error(result);
+ 	end
+ 
++	%reset DYLD_LIBRARY_PATH to what it was:
++	if ismac,
++		setenv('DYLD_LIBRARY_PATH',dyld_library_path_old);
++	end
+ 	%read the con_vertices.txt file and flag our mesh vertices on the continent
+ 	fid=fopen(['./' filename_oce],'r');
+-	line=fgets(fid); 
+ 	line=fgets(fid);
++	line=fgets(fid);
+ 	oce_vertices=[];
+ 	while line~=-1,
+ 		ind=str2num(line); ind=ind(3);
+@@ -54,6 +80,8 @@
+ 
+ 	mask=zeros(nv,1);
+ 	mask(oce_vertices)=1;
+-	
++
+ 	system(['rm -rf ./' filename_all ' ./' filename_oce ' ./gmt.history']);
+-	if ~recursive, disp(sprintf('gmtmask: done')); end;
++	if ~recursive,
++		disp(sprintf('gmtmask: done'));
++	end
+Index: ../trunk-jpl/src/m/coordsystems/gmtmask.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 26182)
++++ ../trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 26183)
+@@ -43,6 +43,36 @@
+     #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 (:()
++    issm_dir = issmdir()
++
++    try:
++        ismac
++    except NameError:
++        ismac = False
++
++    # TODO: Do we really need this (we can/already set it in etc/environment.sh)?
++    if ismac:
++        dyld_library_path_old = os.getenv('DYLD_LIBRARY_PATH')
++        os.putenv('DYLD_LIBRARY_PATH', issm_dir + '/externalpackages/curl/install/lib:' + issm_dir + '/externalpackages/hdf5/install/lib:' + issm_dir + '/externalpackages/netcdf/install/lib')
++
++    #Find path to gmt (you may need to add yours to the list).
++    #
++    # NOTE: Assumes gmtselect is also in this directory.
++    #
++    gmtpaths = ['/usr/bin/gmt',
++                issm_dir + '/bin/gmt',
++                issm_dir + '/externalpackages/gmt/install/bin/gmt',
++                '/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt']
++    gmtpath = ''
++    for i in range(len(gmtpaths)):
++        if os.path.isfile(gmtpaths[i]):
++            gmtpath = gmtpaths[i]
++            break
++
++    if gmtpath == '':
++        raise Exception('gmt not found! Make sure it is properly installed, or add its path to this file.')
++
+     #figure out which vertices are on the ocean, which one on the continent:
+     subprocess.call('gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True)
+ 
+Index: ../trunk-jpl/src/m/dev/devpath.m
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.m	(revision 26182)
++++ ../trunk-jpl/src/m/dev/devpath.m	(revision 26183)
+@@ -1,5 +1,5 @@
+ % clear the last warning to focus on the warnings of the ISSM path
+-lastwarn(''); 
++lastwarn('');
+ 
+ %Recover ISSM_DIR , or if on a Windows machine, ISSM_DIR_WIN
+ if ispc,
+@@ -6,6 +6,7 @@
+ 	ISSM_DIR=getenv('ISSM_DIR_WIN');
+ else
+ 	ISSM_DIR=getenv('ISSM_DIR');
++	ISSM_DEV_DIR=getenv('ISSM_DEV_DIR');
+ end
+ 
+ if (isempty(ISSM_DIR)),
+@@ -12,14 +13,14 @@
+ 	error('''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+ end
+ 
+-%Now add all issm code paths necessary to run issm smoothly. 
+-%We capture the error output, so that we can warn the user to update 
+-%the variable ISSM_DIR in this file, in case it is not correctly setup. 
++%Now add all issm code paths necessary to run issm smoothly.
++%We capture the error output, so that we can warn the user to update
++%the variable ISSM_DIR in this file, in case it is not correctly setup.
+ 
+ %ISSM path
+-addpath([ISSM_DIR '/src/m/os/']); %load recursivepath
+-addpath([ISSM_DIR '/lib']);       %load MEX files
+-addpath(recursivepath([ISSM_DIR '/src/m']));
++addpath([ISSM_DEV_DIR '/src/m/os/']); %load recursivepath
++addpath([ISSM_DEV_DIR '/lib']);       %load mex
++addpath(recursivepath([ISSM_DEV_DIR '/src/m']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/canos']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/kml']));
+@@ -31,7 +32,7 @@
+ addpath(recursivepath([ISSM_DIR '/externalpackages/pcatool']));
+ clear ISSM_DIR;
+ 
+-%Check on any warning messages that might indicate that the paths were not correct. 
++%Check on any warning messages that might indicate that the paths were not correct.
+ if ~isempty(lastwarn),
+ 	fprintf('\n  Error trying to setup ''ISSM'' code paths. Try and update the ISSM_DIR variable in your .cshrc or .bashrc!\n');
+ 	fprintf('  ''ISSM'' will not  work at all until this is resolved\n\n');
+Index: ../trunk-jpl/src/m/dev/devpath.py
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.py	(revision 26182)
++++ ../trunk-jpl/src/m/dev/devpath.py	(revision 26183)
+@@ -5,6 +5,7 @@
+ 
+ #Recover ISSM_DIR and USERNAME
+ ISSM_DIR = os.getenv('ISSM_DIR')
++ISSM_DEV_DIR = os.getenv('ISSM_DEV_DIR')
+ USERNAME = os.getenv('USER')
+ JPL_SVN = os.getenv('JPL_SVN')
+ if ISSM_DIR is None:
+@@ -11,7 +12,7 @@
+     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'):
++for root, dirs, files in os.walk(ISSM_DEV_DIR + '/src/m'):
+     if '.svn' in dirs:
+         dirs.remove('.svn')
+     for file in files:
+@@ -21,12 +22,12 @@
+                     sys.path.append(root)
+ 
+ #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 ISSM_DEV_DIR + '/test/NightlyRun' not in sys.path:
++    sys.path.append(ISSM_DEV_DIR + '/test/NightlyRun')
++if ISSM_DEV_DIR + '/lib' not in sys.path:
++    sys.path.append(ISSM_DEV_DIR + '/lib')
++if ISSM_DEV_DIR + '/src/wrappers/python/.libs' not in sys.path:
++    sys.path.append(ISSM_DEV_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:
+@@ -47,4 +48,4 @@
+ #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
+ 
+ print("\n  ISSM development path correctly loaded")
+-print("Current path is {}\n\n".format(ISSM_DIR))
++print("Current path is {}\n\n".format(ISSM_DEV_DIR))
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26182)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26183)
+@@ -14,6 +14,23 @@
+ %      md.mesh=gmshplanet('radius',6000,'resolution',100);
+ %      md.mesh=gmshplanet('radius',6000,'resolution',100);
+ 
++	%Find path to gmsh
++	paths = {[issmdir() 'bin/gmsh'],...
++		 [issmdir() 'externalpackages/gmsh/install/gmsh'],...
++		 ['/usr/bin/gmsh']...
++		};
++	disp(paths{1})
++	gmshpath = '';
++	for i=paths
++		if exist(i{1},'file'),
++			gmshpath = i{1};
++			break;
++		end
++	end
++	if isempty(gmshpath),
++		error('gmsh not found, make sure it is properly installed');
++	end
++
+ 	% Get Gmsh version
+ 	[s,r]=system(['gmsh -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
+ 	if s~=0,
+@@ -120,8 +137,8 @@
+ 
+ 	% Call gmsh
+ 	%
+-	% NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
+-	%		modifying our parsing scheme for Gmsh 4, for now, we simply set the 
++	% NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally
++	%		modifying our parsing scheme for Gmsh 4, for now, we simply set the
+ 	%		"-format" option.
+ 	%
+ 	if  exist(options,'refine'),
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26182)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26183)
+@@ -28,7 +28,7 @@
+     subproc_args = "gmsh -info 2>&1 | command grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"
+     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     outs, errs = subproc.communicate()
+-    if errs != '':
++    if errs.decode('UTF-8') != '':
+         raise Exception("gmshplanet: call to gmsh failed: {}".format(errs))
+     gmshmajorversion = int(outs)
+     if gmshmajorversion not in [3, 4]:
+@@ -123,8 +123,8 @@
+ 
+     # Call gmsh
+     #
+-    # NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
+-    #       modifying our parsing scheme for Gmsh 4, for now, we simply set the 
++    # NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally
++    #       modifying our parsing scheme for Gmsh 4, for now, we simply set the
+     #       "-format" option.
+     #
+     if options.exist('refine'):
+Index: ../trunk-jpl/src/m/miscellaneous/normfit_issm.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/normfit_issm.py	(revision 26182)
++++ ../trunk-jpl/src/m/miscellaneous/normfit_issm.py	(revision 26183)
+@@ -9,12 +9,14 @@
+ 
+     #  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)
+-
++        # numpy defaults to 0 delta degrees of freedom; matlab uses 1
++        # just check on lenght to avoid dividing by 0
++        if len(x) <= 1:
++            sigmahat = np.std(x, 0, ddof=0)
++        else:
++            sigmahat = np.std(x, 0, ddof=1)
+     # no way to ask this in python, assume 4 outputs
+     #if (nargout > 2):
+         prob = 1. - alpha / 2.
+@@ -38,6 +40,7 @@
+             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)))
+@@ -47,6 +50,8 @@
+ 
+     #  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)
++            #[muhat[j], sigmahat[j], muci[:, j], sigmaci[:, j]] = normfit_issm(x[not np.isnan(x[:, j]), j], alpha)
++            muhat[j], sigmahat[j], muci[:, j], sigmaci[:, j] = normfit_issm(x[not np.isnan(x[:, j]), j], alpha)
+ 
+-    return [muhat, sigmahat, muci, sigmaci]
++    return muhat, sigmahat, np.squeeze(muci), np.squeeze(sigmaci)
++    #return [muhat, sigmahat, muci, sigmaci]
+Index: ../trunk-jpl/src/m/partition/partitioner.py
+===================================================================
+--- ../trunk-jpl/src/m/partition/partitioner.py	(revision 26182)
++++ ../trunk-jpl/src/m/partition/partitioner.py	(revision 26183)
+@@ -45,7 +45,7 @@
+     if md.mesh.dimension() == 3:
+         #partitioning essentially happens in 2D. So partition in 2D, then
+         #extrude the partition vector vertically.
+-        md3d = copy.deepcopy(md) # save for later
++        md3d = copy.deepcopy(md)  # save for later
+         md.mesh.elements = md.mesh.elements2d
+         md.mesh.x = md.mesh.x2d
+         md.mesh.y = md.mesh.y2d
+@@ -57,6 +57,7 @@
+ 
+     #adjacency matrix if needed:
+     if recomputeadjacency == 'on':
++        print("adj calll")
+         md = adjacency(md)
+     else:
+         print('skipping adjacency matrix computation as requested in the options')
+@@ -66,7 +67,7 @@
+             raise RuntimeError('partitioner error message: package {} does not allow element partitions.'.format(package))
+         else:
+             # default method (from chaco.m)
+-            method = np.array([1, 1, 0, 0, 1, 1, 50, 0, 0.001, 7654321]).conj().transpose()
++            method = np.array([1, 1, 0, 0, 1, 1, 50, 0, 0.001, 7654321])  #.conj().transpose()
+             method[0] = 3  #  global method (3 = inertial (geometric))
+             method[2] = 0  #  vertex weights (0 = off, 1 = on)
+ 
+@@ -83,22 +84,27 @@
+             #method = method.reshape(-1, 1)  # transpose to 1x10 instead of 10
+ 
+             #  partition into nparts
++            print("ChacoCall")
+             if isinstance(md.mesh, mesh2d):
+-                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, np.zeros((md.mesh.numberofvertices, 1)), method, npart, np.array([]))[0].conj().transpose() + 1 #index partitions from 1 up. like metis.
++                print("caseA")
++                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, np.zeros((md.mesh.numberofvertices)), method, npart, np.array([]))[0].conj().transpose() + 1   #index partitions from 1 up. like metis.
+             else:
+-                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, md.mesh.z, method, npart, np.array([]))[0].conj().transpose() + 1 #index partitions from 1 up. like metis.
++                print("caseB")
++                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, md.mesh.z, method, npart, np.array([]))[0].conj().transpose() + 1  #index partitions from 1 up. like metis.
++            print("Done")
++
+     elif package == 'scotch':
+         if vectortype == 'element':
+             raise RuntimeError('partitioner error message: package %s does not allow element partitions.' % package)
+         else:
+             #are we using weights?
+-            if m.strcmpi(options.getfieldvalue('weighting'), 'on'):
++            if 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.
++            part = maptab[:, 1] + 1  #index partitions from 1 up. like metis.
+ 
+     elif package == 'linear':
+         if vectortype == 'element':
+@@ -115,7 +121,7 @@
+ 
+     else:
+         raise RuntimeError('partitioner error message: could not find {} partitioner'.format(package))
+-
++    print("extrude")
+     #extrude if we are in 3D:
+     if md.mesh.dimension() == 3:
+         md3d.qmu.vertex_weight = md.qmu.vertex_weight
+Index: ../trunk-jpl/src/m/qmu/dakota_out_parse.py
+===================================================================
+--- ../trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 26182)
++++ ../trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 26183)
+@@ -7,9 +7,9 @@
+ #move this later
+ from helpers import *
+ 
+-# NOTE: May be rewritten 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.
++#  NOTE: May be rewritten 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):  # {{{
+@@ -31,33 +31,33 @@
+         srcm          (double array, simple rank correlation matrix)
+         prcm          (double array, partial rank correlation matrix)
+ 
+-    The filei will be prompted for if empty. The fields of dresp are particular 
+-    to the data contained within the file. The scm, pcm, srcm, and prcm are 
++    The filei will be prompted for if empty. The fields of dresp are particular
++    to the data contained within the file. The scm, pcm, srcm, and prcm are
+     output by Dakota only for the sampling methods.
+ 
+-    This function reads a Dakota .out output file and parses it into the Python 
+-    runtime. 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 exists in the file, rather than searching for data based 
+-    on the particular method (this makes it independent of method). It also can 
++    This function reads a Dakota .out output file and parses it into the Python
++    runtime. 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 exists in the file, rather than searching for data based
++    on the particular method (this makes it independent of method). It also can
+     read and parse the .dat tabular_output file.
+ 
+-    This data would typically be used for plotting and other postprocessing 
++    This data would typically be used for plotting and other postprocessing
+     within MATLAB or Excel.
+ 
+     TODO:
+-    - Figure out why output from Dakota is different under MATLAB and Python 
++    - Figure out why output from Dakota is different under MATLAB and Python
+     (is it the input file that we write?)
+ 
+-    "Copyright 2009, by the California Institute of Technology. ALL RIGHTS 
+-    RESERVED. United States Government Sponsorship acknowledged. Any commercial 
+-    use must be negotiated with the Office of Technology Transfer at the 
++    "Copyright 2009, by the California Institute of Technology. ALL RIGHTS
++    RESERVED. United States Government Sponsorship acknowledged. Any commercial
++    use must be negotiated with the Office of Technology Transfer at the
+     California Institute of Technology. (NTR 47078)
+ 
+-    This software may be subject to U.S. export control laws. By accepting this 
+-    software, the user agrees to comply with all applicable U.S. export laws 
+-    and regulations. User has the responsibility to obtain export licenses, or 
+-    other export authority as may be required before exporting such information 
++    This software may be subject to U.S. export control laws. By accepting this
++    software, the user agrees to comply with all applicable U.S. export laws
++    and regulations. User has the responsibility to obtain export licenses, or
++    other export authority as may be required before exporting such information
+     to foreign countries or providing access to foreign persons."
+     """
+ 
+@@ -77,7 +77,7 @@
+         if getsize(filei) == 0 or fline == '':
+             raise RuntimeError('File ' + filei + ' is empty')
+ 
+-        dresp = [] # of struct()
++        dresp = []  # of struct()
+         scm = struct()
+         pcm = struct()
+         srcm = struct()
+@@ -188,7 +188,7 @@
+     # Process column headings of matrix (skipping eval_id)
+     [ntokens, tokens] = fltokens(fline)
+ 
+-    if strncmpi(fline, '%eval_id interface', 18): # Dakota versions >= 6
++    if fline.startswith('%eval_id interface'):  # Dakota versions >= 6
+         offset = 2
+     else:  # Dakota versions < 6
+         offset = 1
+@@ -222,18 +222,18 @@
+ 
+     print('Number of rows (Dakota func evals) = ' + str(nrow))
+ 
+-    # Calculate statistics
++    # Calculate statistic
+     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)))
++        dmean = np.zeros((np.size(data, 1)))
++        dstddev = np.zeros((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)
++            dmean[i], dstddev[i], dmeanci[:, i], dstddevci[:, i] = normfit_issm(data[:, i], 0.05)
+ 
+     dmin = data.min(axis=0)
+     dquart1 = prctile_issm(data, 25, 0)
+@@ -243,8 +243,8 @@
+     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 
++    # 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:
+@@ -486,7 +486,7 @@
+             #  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):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('Cumulative Distribution Function'):
+                 [ntokens, tokens] = fltokens(fline)
+                 icdf = icdf + 1
+                 dresp[idresp].cdf = np.zeros((icdf, 4))
+@@ -545,7 +545,7 @@
+             #  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):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('PDF for'):
+                 [ntokens, tokens] = fltokens(fline)
+                 ipdf = ipdf + 1
+                 dresp[idresp].pdf = np.zeros((ipdf, 4))
+@@ -623,7 +623,7 @@
+ 
+     ndresp = 0
+ 
+-    while (fline != '' and not fline.isspace()) and strncmpi(fline, 'MV Statistics for ', 18):
++    while fline.startswith('MV Statistics for '):
+ 
+         #  add new response function and moments
+         [ntokens, tokens] = fltokens(fline)
+@@ -648,7 +648,7 @@
+         dresp[-1].impfac = []
+         dresp[-1].sens = []
+ 
+-        while (fline != '' and not fline.isspace()) and strncmpi(fline, '  Importance Factor for variable ', 33):
++        while 'Importance Factor for variable' in fline:
+             [ntokens, tokens] = fltokens(fline)
+             idvar = idvar + 1
+             dresp[-1].var.append(str(tokens[4]))
+@@ -666,7 +666,7 @@
+             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):
++            while type(fline) == str and (fline != '' and not fline.isspace()) and 'Cumulative Distribution Function' not in fline and 'MV Statistics for ' not in fline and '---' not in fline:
+                 fline = fidi.readline()
+ 
+         #  process header line of cdf
+@@ -681,7 +681,7 @@
+                 if fline == '' or fline.isspace():
+                     fline = fidi.readline()
+ 
+-        while (fline != '' and not fline.isspace()) and strncmpi(fline, 'Cumulative Distribution Function', 32):
++        while fline.startswith('Cumulative Distribution Function'):
+             [ntokens, tokens] = fltokens(fline)
+ 
+             #  find response function associated with cdf
+@@ -704,7 +704,7 @@
+ 
+             #  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):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('MV Statistics for ') and '---' not in fline:
+                 [ntokens, tokens] = fltokens(fline)
+                 icdf = icdf + 1
+                 dresp[idresp].cdf = np.zeros((icdf, 4))
+@@ -723,7 +723,7 @@
+         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):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('MV Statistics for ') and '---' not in fline:
+                 fline = fidi.readline()
+ 
+     print('  Number of Dakota response functions = ' + str(len(dresp)))
+@@ -736,7 +736,7 @@
+     #  function to find and read the best evaluation
+ 
+     if fline is None or fline == '' or fline.isspace():
+-        fline = findline(fidi, ' < < < < < Best ')
++        fline = findline(fidi, '<<<<< Best ')
+         if fline is None:
+             return
+ 
+@@ -746,12 +746,12 @@
+ 
+     print('Reading values for best function evaluation:')
+ 
+-    while (fline != '' and not fline.isspace()) and strncmpi(fline, ' < < < < < Best ', 11):
++    while fline.startswith('<<<<< Best '):
+         [ntokens, tokens] = fltokens(fline)
+ 
+     #  read and add best parameter(s)
+ 
+-        if strncmpi(str(tokens[2]), 'parameter', 9):
++        if str(tokens[2]).startswith('parameter'):
+             print('  ' + fline)
+ 
+             fline = fidi.readline()
+@@ -758,7 +758,7 @@
+             dresp.best.param = []
+             dresp.best.descriptor = ''
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
+                 [ntokens, tokens] = fltokens(fline)
+                 dresp.best.param.append([0])
+                 dresp.best.param[-1] = tokens[0]
+@@ -766,13 +766,13 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best objective function(s)
+-        elif strncmpi(str(tokens[2]), 'objective', 9) and strncmpi(str(tokens[3]), 'function', 8):
++        elif str(tokens[2]).startswith('objective') and str(tokens[3]).startswith('function'):
+             print('  ' + fline)
+ 
+             fline = fidi.readline()
+             dresp.best.of = []
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
+                 [ntokens, tokens] = fltokens(fline)
+                 dresp.best.of.append(0)
+                 dresp.best.of[-1] = tokens[0]
+@@ -779,7 +779,7 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best residual norms
+-        elif strncmpi(str(tokens[2]), 'residual', 8) and strncmpi(str(tokens[3]), 'norm', 4):
++        elif str(tokens[2]).startswith('residual') and str(tokens[3]).startswith('norm'):
+             print('  ' + fline)
+             dresp.best.norm = tokens[5]
+             dresp.best.hnormsq = tokens[10]
+@@ -786,17 +786,17 @@
+ 
+             fline = fidi.readline()
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
++            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):
++        elif str(tokens[2]).startswith('residual') and str(tokens[3]).startswith('term'):
+             print('  ' + fline)
+ 
+             fline = fidi.readline()
+             dresp.best.res = []
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, '<<<<<Best ', 11):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
+                 [ntokens, tokens] = fltokens(fline)
+                 dresp.best.res.append(0)
+                 dresp.best.res[-1] = tokens[0]
+@@ -803,13 +803,13 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best constraint value(s)
+-        elif strncmpi(str(tokens[2]), 'constraint', 10) and strncmpi(str(tokens[3]), 'value', 5):
++        elif str(tokens[2]).startswith('constraint') and str(tokens[3]).startswith('value'):
+             print('  ' + fline)
+ 
+             fline = fidi.readline()
+             dresp.best.nc = []
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, '<<<<<Best ', 11):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
+                 [ntokens, tokens] = fltokens(fline)
+                 dresp.best.nc.append(0)
+                 dresp.best.nc[-1] = tokens[0]
+@@ -816,13 +816,13 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best data captured
+-        elif strncmpi(str(tokens[2]), 'data', 4) and strncmpi(str(tokens[3]), 'captured', 8):
++        elif str(tokens[2]).startswith('data') and str(tokens[3]).startswith('captured'):
+             print('  ' + fline)
+             dresp.best.eval = tokens[7]
+ 
+             fline = fidi.readline()
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
+                 fline = fidi.readline()
+ 
+         #  read until next best or blank or end
+@@ -831,7 +831,7 @@
+ 
+             fline = fidi.readline()
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
++            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
+                 fline = fidi.readline()
+ 
+     return dresp
+@@ -902,7 +902,7 @@
+     npos = 0
+     for fline in fidi:
+         npos += len(fline)
+-        if (strncmpi(fline, string, len(string))):
++        if fline.startswith(string):
+             if goto_line:
+                 fidi.seek(npos, 0)
+             else:
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26182)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26183)
+@@ -2,6 +2,7 @@
+ import struct
+ import numpy as np
+ from results import solution
++from netCDF4 import Dataset
+ 
+ 
+ def parseresultsfromdisk(md, filename, iosplit):  #{{{
+@@ -74,24 +75,94 @@
+     return saveres
+ # }}}
+ 
++
+ def parseresultsfromdiskioserial(md, filename):  # {{{
+     # Open file
+     try:
+         fid = open(filename, 'rb')
+-    except IOError as e:
++    except IOError:
+         raise IOError("parseresultsfromdisk error message: could not open {} for binary reading".format(filename))
++    print(md.results)
++    # Collect all results in a list
++    allresults = []
++    while True:
++        # Read next result
++        result = ReadData(fid, md)
++        if result is None:
++            if allresults == []:
++                raise Exception('no results found in binary file ' + filename)
++            else:
++                break
++        # print("now got {} for time {}".format(result['fieldname'], result['time']))
++        # print("with keys {}".format(result.keys()))
++        # print("==============================")
+ 
++        allresults.append(result)
++    fid.close()
++
++    # Now, process all results and find out how many steps we have
++    numresults = len(allresults)
++    allsteps = np.zeros((numresults, 1))
++    for i in range(numresults):
++        allsteps[i] = allresults[i]['step']
++    pos = np.where(allsteps != -9999)
++    allsteps = np.sort(np.unique(allsteps[pos]))
++
++    # Ok, now construct structure
++    results = solution()
++
++    for i in range(numresults):
++        result = allresults[i]
++        index = 0
++        if result['step'] != -9999:
++            index = np.where(result['step'] == allsteps)[0][0]
++            setattr(results[index], 'step', result['step'])
++        if result['time'] != -9999:
++            setattr(results[index], 'time', result['time'])
++        setattr(results[index], result['fieldname'], result['field'])
++    return results
++# }}}
++
++
++def parseresultsfromdisktonc(md, filin, filout):  # {{{
++    verbose = 0
++    # Open file
++    try:
++        fid = open(filin, 'rb')
++    except IOError:
++        raise IOError("parseresultsfromdisk error message: could not open {} for binary reading".format(filin))
++
++    NCData = Dataset(filout, 'w', format='NETCDF4')
++    UnlimDim = NCData.createDimension('Unlim', None)
++    DimDict = {len(UnlimDim): 'Inf'}
++    dimindex = 2
++    dimlist = [2, md.mesh.numberofelements, md.mesh.numberofvertices, np.shape(md.mesh.elements)[1]]
++    dimnames = ['DictDummy', 'EltNum', 'VertNum', 'VertPerElt']
++    if verbose > 0:
++        print('===Creating dimensions ===')
++    for i, newdim in enumerate(dimlist):
++        if newdim not in list(DimDict.keys()):
++            dimindex += 1
++            NewDim = NCData.createDimension(dimnames[i], newdim)
++            DimDict[len(NewDim)] = dimnames[i]
++
++    typelist = [bool, str, int, float, complex,
++                collections.OrderedDict,
++                np.int64, np.ndarray, np.float64]
++
+     # Collect all results in a list
+     allresults = []
+     while True:
+         # Read next result
+         result = ReadData(fid, md)
+-
+         if result is None:
+             if allresults == []:
+                 raise Exception('no results found in binary file ' + filename)
+             else:
+                 break
++        print("now got {} for time {}".format(result['fieldname'], result['time']))
++        print("with keys {}".format(result.keys()))
++        print("==============================")
+ 
+         allresults.append(result)
+     fid.close()
+@@ -119,6 +190,7 @@
+     return results
+ # }}}
+ 
++
+ def ReadData(fid, md):  # {{{
+     """READDATA
+ 
+@@ -320,6 +392,7 @@
+     return saveres
+ # }}}
+ 
++
+ def addfieldtorecord(a, descr): #{{{
+     if a.dtype.fields is None:
+         raise ValueError('\'a\' must be a structured numpy array')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26183-26184.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26183-26184.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26183-26184.diff	(revision 26740)
@@ -0,0 +1,1525 @@
+Index: ../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26183)
++++ ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26184)
+@@ -120,8 +120,8 @@
+                     supstring += ' --suppressions=' + supfile
+ 
+                 if IssmConfig('_HAVE_MPI_')[0]:
+-                    fid.write('mpiexec -np {} {} --leak-check=full {} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.format(self.np, self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+-                    #fid.write('mpiexec -np {} {} --tool=callgrind {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.format(self.np, self.valgrind, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
++                    fid.write('mpiexec -np {} {} --leak-check=full {} {}/{} {} {}/{} {} 2> {}.errlog > {}.outlog '.
++                              format(self.np, self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+                 else:
+                     fid.write('{} --leak-check=full {} {}/{} {} {}/{} {} 2> {}.errlog > {}.outlog '.
+                               format(self.valgrind, supstring, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+Index: ../trunk-jpl/src/m/classes/clusters/hexagon.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/hexagon.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/hexagon.py	(revision 26184)
+@@ -0,0 +1,145 @@
++import subprocess
++from fielddisplay import fielddisplay
++from pairoptions import pairoptions
++from issmssh import issmssh
++from issmscpin import issmscpin
++from issmscpout import issmscpout
++from IssmConfig import IssmConfig
++import datetime
++try:
++    from hexagon_settings import hexagon_settings
++except ImportError:
++    print('You need hexagon_settings.py to proceed, check presence and sys.path')
++
++
++class hexagon(object):
++    """
++    Hexagon cluster class definition
++    Hexagon have nodes built of 2 * 16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway.
++    You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
++       Usage:
++          cluster = hexagon()
++    """
++
++    def __init__(self, *args):  # {{{
++        self.name = 'hexagon'
++        self.login = ''
++        self.numnodes = 2
++        self.procspernodes = 32
++        self.mem = 32000
++        self.queue = 'batch'
++        self.time = 2 * 60
++        self.codepath = ''
++        self.executionpath = ''
++        self.interactive = 0
++        self.port = []
++        self.accountname = ''
++
++    #use provided options to change fields
++        options = pairoptions(*args)
++
++    #initialize cluster using user settings if provided
++        self = hexagon_settings(self)
++
++    #OK get other fields
++        self = options.AssignObjectFields(self)
++        self.np = self.numnodes * self.procspernodes
++    # }}}
++
++    def __repr__(self):      # {{{
++        #  display the object
++        s = "class hexagon object:"
++        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes  default and optimal is 32'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'Total node memory'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
++        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
++        return s
++    # }}}
++
++    def checkconsistency(self, md, solution, analyses):      # {{{
++        #mem should not be over 32000mb
++        #numprocs should not be over 4096
++        #we have cpupernodes * numberofcpus = mppwidth and mppnppn = cpupernodes,
++        #Miscelaneous
++        if not self.login:
++            md = md.checkmessage('login empty')
++        if not self.codepath:
++            md = md.checkmessage('codepath empty')
++        if not self.executionpath:
++            md = md.checkmessage('executionpath empty')
++        if self.interactive == 1:
++            md = md.checkmessage('interactive mode not implemented')
++        if self.mem > 32000:
++            md = md.checkmessage('asking too much memory max is 32000 per node')
++        return self
++    # }}}
++
++    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
++        executable = 'issm.exe'
++        if isdakota:
++            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
++            version = float(version)
++            if version >= 6:
++                executable = 'issm_dakota.exe'
++        if isoceancoupling:
++            executable = 'issm_ocean.exe'
++
++    #write queuing script
++        shortname = modelname[0:min(12, len(modelname))]
++        fid = open(modelname + '.queue', 'w')
++        fid.write('  #!/bin/bash\n')
++        fid.write('  #PBS - N %s \n' % shortname)
++        fid.write('  #PBS - l mppwidth=%i, mppnppn=%i\n' % (self.np, self.procspernodes))
++        timeobj = datetime.timedelta(minutes=self.time)
++        m, s = divmod(timeobj.total_seconds(), 60)
++        h, m = divmod(m, 60)
++        timestring = "%02d:%02d:%02d" % (h, m, s)
++        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
++        fid.write('#PBS -l mppmem=%imb\n' % int(self.mem / self.procspernodes))
++        fid.write('#PBS -A %s\n' % self.accountname)
++        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
++        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
++        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
++        fid.write('export CRAY_ROOTFS=DSL\n')
++        fid.write('module swap PrgEnv-cray / 5.2.40 PrgEnv - gnu\n')
++        fid.write('module load cray-petsc\n')
++        fid.write('module load cray-tpsl\n')
++        fid.write('module load cray-mpich\n')
++        fid.write('module load gsl\n')
++        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
++        fid.write('aprun -B %s/%s %s %s/%s %s\n' % (self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
++        fid.close()
++    # }}}
++
++    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
++        #compress the files into one zip.
++        compressstring = 'tar -zcf %s.tar.gz ' % dirname
++        for file in filelist:
++            compressstring += ' %s' % file
++        subprocess.call(compressstring, shell=True)
++
++        print('uploading input file and queueing script')
++        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
++    # }}}
++
++    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
++        print('launching solution sequence on remote cluster')
++        if restart:
++            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
++        else:
++            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
++        issmssh(self.name, self.login, self.port, launchcommand)
++    # }}}
++
++    def Download(self, dirname, filelist):    # {{{
++        #copy files from cluster to current directory
++        directory = '%s/%s/' % (self.executionpath, dirname)
++        issmscpin(self.name, self.login, self.port, directory, filelist)
++    # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/vilje.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/vilje.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/vilje.m	(revision 26184)
+@@ -0,0 +1,209 @@
++%vilje class definition
++%
++%   Usage:
++%      cluster=greenplanet();
++%      cluster=greenplanet('np',3);
++%      cluster=greenplanet('np',3,'login','username');
++
++classdef vilje
++	properties (SetAccess=public)  
++		% {{{
++		name           = 'vilje';
++		login          = '';
++		numnodes       = 2;
++		cpuspernode    = 32;
++		procspernodes  = 16;
++		mem            = 28;
++		numstreams		= 8; %Henning added
++		queue          = 'workq';
++		time           = 2*60;
++		codepath       = '';
++		executionpath  = '';
++		interactive    = 0;
++		port           = [];
++		accountname    = '';
++		% }}}
++	end
++	methods
++		function cluster=vilje(varargin) % {{{
++
++			%initialize cluster using default settings if provided
++			if (exist('vilje_settings')==2), vilje_settings; end
++
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    accountname: %s',cluster.accountname));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i', cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    procspernodes: %i',cluster.procspernodes));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    memory: %i',cluster.mem));
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
++
++			available_queues={'workq'};
++			queue_requirements_time=[5*24*60];
++			queue_requirements_np=[30];
++
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
++
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++
++		end
++		%}}}
++		function numprocs=np(self) % {{{
++			%compute number of processors
++			numprocs=self.numnodes*self.procspernodes;
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++
++			%compute number of processors
++% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
++			np(cluster);%=cluster.numnodes*cluster.cpuspernode;
++
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#PBS -S /bin/bash\n');
++			fprintf(fid,'#PBS -N %s\n',modelname);
++			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,16);
++			
++			%calculate walltime in hh:mm:ss format
++			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
++			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
++			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
++			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
++			fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'module load intelcomp/17.0.0\n') 
++			fprintf(fid,'module load mpt/2.14\n')
++			fprintf(fid,'module load petsc/3.7.4d\n')
++			fprintf(fid,'module load parmetis/4.0.3\n') 
++			fprintf(fid,'module load mumps/5.0.2\n')
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
++			fprintf(fid,'mpiexec_mpt -n %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++
++			executable='issm.exe';
++			if isdakota,
++				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
++				if (version>=6),
++					executable='issm_dakota.exe';
++				end
++			end
++			if isoceancoupling,
++				executable='issm_ocean.exe';
++			end
++
++			%compute number of processors
++% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
++			np(cluster);%=cluster.numnodes*cluster.cpuspernode;                     
++% 			shortname = substring(modelname,1,min(12,length(modelname)));
++
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#PBS -S /bin/bash\n');
++% 			fprintf(fid,'#PBS -N %s\n',shortname);
++			fprintf(fid,'#PBS -N %s\n',modelname);
++			fprintf(fid,'#PBS -q %s \n',cluster.queue);
++			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,cluster.procspernodes);
++
++			%calculate walltime in hh:mm:ss format
++			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
++% 			fprintf(fid,'#PBS -l walltime=%s\n',duration(0,cluster.time,0)); %walltime is in minutes.
++% 			fprintf(fid,'#PBS -l walltime=%s\n',10); %walltime is in minutes.
++			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
++% 			fprintf(fid,'#PBS -l walltime=%i\n',walltime); %walltime is in hh:mm:ss
++			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
++			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
++			fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'module load intelcomp/17.0.0\n') 
++			fprintf(fid,'module load mpt/2.14\n')
++			fprintf(fid,'module load petsc/3.7.4d\n')
++			fprintf(fid,'module load parmetis/4.0.3\n') 
++			fprintf(fid,'module load mumps/5.0.2\n')
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.run'],'w');
++				fprintf(fid,'mpiexec_mpt -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
++				fid=fopen([modelname '.errlog'],'w');
++				fclose(fid);
++				fid=fopen([modelname '.outlog'],'w');
++				fclose(fid);
++			end
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			system(compressstring);
++			disp('uploading input file and queueing script');
++			directory=cluster.executionpath;
++% 			issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
++			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
++
++		end
++		%}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++
++			disp('launching solution sequence on remote cluster');
++			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist)% {{{
++
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++
++		end %}}}
++	end
++end
+
+Property changes on: ../trunk-jpl/src/m/classes/clusters/vilje.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/m/classes/clusters/vilje.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/vilje.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/vilje.py	(revision 26184)
+@@ -0,0 +1,145 @@
++import subprocess
++from fielddisplay import fielddisplay
++from pairoptions import pairoptions
++from issmssh import issmssh
++from issmscpin import issmscpin
++from issmscpout import issmscpout
++from QueueRequirements import QueueRequirements
++from IssmConfig import IssmConfig
++import datetime
++try:
++    from vilje_settings import vilje_settings
++except ImportError:
++    print('You need vilje_settings.py to proceed, check presence and sys.path')
++
++
++class vilje(object):
++    """
++    Vilje cluster class definition
++
++       Usage:
++          cluster = vilje()
++    """
++
++    def __init__(self, *args):    # {{{
++        self.name = 'vilje'
++        self.login = ''
++        self.numnodes = 2
++        self.cpuspernode = 32
++        self.procspernodes = 16
++        self.mem = 28
++        self.queue = 'workq'
++        self.time = 2 * 60
++        self.codepath = ''
++        self.executionpath = ''
++        self.interactive = 0
++        self.port = []
++        self.accountname = ''
++
++    #use provided options to change fields
++        options = pairoptions(*args)
++
++    #initialize cluster using user settings if provided
++        self = vilje_settings(self)
++    #OK get other fields
++        self = options.AssignObjectFields(self)
++        self.np = self.numnodes * self.procspernodes
++    # }}}
++
++    def __repr__(self):    # {{{
++        #  display the object
++        s = "class vilje object:"
++        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs (32)'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'node memory'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (test is an option, workq the default)'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
++        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
++        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
++        return s
++    # }}}
++
++    def checkconsistency(self, md, solution, analyses):    # {{{
++        #Queue dictionarry  gives queu name as key and max walltime and cpus as var
++        queuedict = {'workq': [5 * 24 * 60, 30],
++                     'test': [30, 4]}
++        QueueRequirements(queuedict, self.queue, self.np, self.time)
++
++    #Miscelaneous
++        if not self.login:
++            md = md.checkmessage('login empty')
++        if not self.codepath:
++            md = md.checkmessage('codepath empty')
++        if not self.executionpath:
++            md = md.checkmessage('executionpath empty')
++        if self.interactive == 1:
++            md = md.checkmessage('interactive mode not implemented')
++        return self
++    # }}}
++
++    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
++        executable = 'issm.exe'
++        if isdakota:
++            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
++            version = float(version)
++            if version >= 6:
++                executable = 'issm_dakota.exe'
++        if isoceancoupling:
++            executable = 'issm_ocean.exe'
++
++    #write queuing script
++        shortname = modelname[0:min(12, len(modelname))]
++        fid = open(modelname + '.queue', 'w')
++        fid.write('#PBS -S / bin / bash\n')
++        fid.write('#PBS -N %s \n' % shortname)
++        fid.write('#PBS -q %s \n' % self.queue)
++        fid.write('#PBS -l select=%i:ncpus=%i:mpiprocs=%s\n' % (self.numnodes, self.cpuspernode, self.procspernodes))
++        timeobj = datetime.timedelta(minutes=self.time)
++        m, s = divmod(timeobj.total_seconds(), 60)
++        h, m = divmod(m, 60)
++        timestring = "%02d:%02d:%02d" % (h, m, s)
++        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
++        fid.write('#PBS -A %s\n' % self.accountname)
++        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
++        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
++        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
++        fid.write('module load intelcomp/17.0.0\n')
++        fid.write('module load mpt/2.14\n')
++        fid.write('module load petsc/3.7.4d\n')
++        fid.write('module load parmetis/4.0.3\n')
++        fid.write('module load mumps/5.0.2\n')
++        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
++        fid.write('mpiexec_mpt -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
++        fid.close()
++    # }}}
++
++    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
++        #compress the files into one zip.
++        compressstring = 'tar -zcf %s.tar.gz ' % dirname
++        for file in filelist:
++            compressstring += ' %s' % file
++        subprocess.call(compressstring, shell=True)
++
++        print('uploading input file and queueing script')
++        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
++    # }}}
++
++    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
++        print('launching solution sequence on remote cluster')
++        if restart:
++            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
++        else:
++            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
++        issmssh(self.name, self.login, self.port, launchcommand)
++    # }}}
++
++    def Download(self, dirname, filelist):    # {{{
++        #copy files from cluster to current directory
++        directory = '%s/%s/' % (self.executionpath, dirname)
++        issmscpin(self.name, self.login, self.port, directory, filelist)
++    # }}}
+Index: ../trunk-jpl/src/m/coordsystems/gmtmask.m
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 26183)
++++ ../trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 26184)
+@@ -5,18 +5,18 @@
+ %      mask.ocean = gmtmask(md.mesh.lat,md.mesh.long);
+ %
+ 
+-	%are we doing a recursive call?
++	%are we doing a recursive call? 
+ 	if nargin==3,
+ 		recursive=1;
+-	else
++	else 
+ 		recursive=0;
+ 	end
+-
++	
+ 	if(recursive)disp(sprintf('             recursing: num vertices %i',length(lat)));
+ 	else disp(sprintf('gmtmask: num vertices %i',length(lat)));
+ 	end
+-
+-	%Check lat and long size is not more than 50,000; If so, recursively call gmtmask:
++	
++	%Check lat and long size is not more than 50,000; If so, recursively call gmtmask: 
+ 	if length(lat)>50000,
+ 		for i=1:50000:length(lat),
+ 			j=i+50000-1;
+@@ -27,35 +27,13 @@
+ 		end
+ 		return
+ 	end
+-
++	
+ 	%First, write our lat,long file for gmt:
+ 	nv=length(lat);
+-	filename_all = ['all_vertices-' num2str(feature('GetPid')) '.txt'];
+-	filename_oce = ['oce_vertices-' num2str(feature('GetPid')) '.txt'];
++	filename_all = ['all_vertices-' num2str(feature('GetPid')) '.txt']; 
++	filename_oce = ['oce_vertices-' num2str(feature('GetPid')) '.txt']; 
+ 	dlmwrite(filename_all,[long lat (1:nv)'],'delimiter','\t','precision',10);
+ 
+-	%Avoid bypassing of the ld library path by Matlab (:()
+-	%
+-	% TODO: Do we really need this (we can/already set it in etc/environment.sh)?
+-	if ismac,
+-		dyld_library_path_old=getenv('DYLD_LIBRARY_PATH');
+-		setenv('DYLD_LIBRARY_PATH',[ issmdir '/externalpackages/curl/install/lib:' issmdir '/externalpackages/hdf5/install/lib:' issmdir '/externalpackages/netcdf/install/lib' ]);
+-	end
+-
+-	%Find path to gmt, list all possible known paths to gmt (you may need to add yours to the list)
+-	gmtpaths = {[issmdir '/bin/gmt'],[issmdir '/externalpackages/gmt/install/bin/gmt'],'/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt', '/usr/bin/gmt'};
+-	gmtpath = '';
+-	for i=gmtpaths
+-		if exist(i{1},'file'),
+-			gmtpath = i{1};
+-			break;
+-		end
+-	end
+-	if isempty(gmtpath),
+-		error('gmt not found! Make sure it is properly installed, or add its path to this file.');
+-	end
+-
+-
+ 	%figure out which vertices are on the ocean, which one on the continent:
+ 	[status,result] = system(['gmtselect ./' filename_all ' -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./' filename_oce]);
+ 	if status~=0,
+@@ -62,14 +40,10 @@
+ 		error(result);
+ 	end
+ 
+-	%reset DYLD_LIBRARY_PATH to what it was:
+-	if ismac,
+-		setenv('DYLD_LIBRARY_PATH',dyld_library_path_old);
+-	end
+ 	%read the con_vertices.txt file and flag our mesh vertices on the continent
+ 	fid=fopen(['./' filename_oce],'r');
++	line=fgets(fid); 
+ 	line=fgets(fid);
+-	line=fgets(fid);
+ 	oce_vertices=[];
+ 	while line~=-1,
+ 		ind=str2num(line); ind=ind(3);
+@@ -80,8 +54,6 @@
+ 
+ 	mask=zeros(nv,1);
+ 	mask(oce_vertices)=1;
+-
++	
+ 	system(['rm -rf ./' filename_all ' ./' filename_oce ' ./gmt.history']);
+-	if ~recursive,
+-		disp(sprintf('gmtmask: done'));
+-	end
++	if ~recursive, disp(sprintf('gmtmask: done')); end;
+Index: ../trunk-jpl/src/m/coordsystems/gmtmask.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 26183)
++++ ../trunk-jpl/src/m/coordsystems/gmtmask.py	(revision 26184)
+@@ -43,36 +43,6 @@
+     #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 (:()
+-    issm_dir = issmdir()
+-
+-    try:
+-        ismac
+-    except NameError:
+-        ismac = False
+-
+-    # TODO: Do we really need this (we can/already set it in etc/environment.sh)?
+-    if ismac:
+-        dyld_library_path_old = os.getenv('DYLD_LIBRARY_PATH')
+-        os.putenv('DYLD_LIBRARY_PATH', issm_dir + '/externalpackages/curl/install/lib:' + issm_dir + '/externalpackages/hdf5/install/lib:' + issm_dir + '/externalpackages/netcdf/install/lib')
+-
+-    #Find path to gmt (you may need to add yours to the list).
+-    #
+-    # NOTE: Assumes gmtselect is also in this directory.
+-    #
+-    gmtpaths = ['/usr/bin/gmt',
+-                issm_dir + '/bin/gmt',
+-                issm_dir + '/externalpackages/gmt/install/bin/gmt',
+-                '/Applications/GMT-5.4.3.app/Contents/Resources/bin/gmt']
+-    gmtpath = ''
+-    for i in range(len(gmtpaths)):
+-        if os.path.isfile(gmtpaths[i]):
+-            gmtpath = gmtpaths[i]
+-            break
+-
+-    if gmtpath == '':
+-        raise Exception('gmt not found! Make sure it is properly installed, or add its path to this file.')
+-
+     #figure out which vertices are on the ocean, which one on the continent:
+     subprocess.call('gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True)
+ 
+Index: ../trunk-jpl/src/m/dev/devpath.m
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.m	(revision 26183)
++++ ../trunk-jpl/src/m/dev/devpath.m	(revision 26184)
+@@ -1,5 +1,5 @@
+ % clear the last warning to focus on the warnings of the ISSM path
+-lastwarn('');
++lastwarn(''); 
+ 
+ %Recover ISSM_DIR , or if on a Windows machine, ISSM_DIR_WIN
+ if ispc,
+@@ -6,7 +6,6 @@
+ 	ISSM_DIR=getenv('ISSM_DIR_WIN');
+ else
+ 	ISSM_DIR=getenv('ISSM_DIR');
+-	ISSM_DEV_DIR=getenv('ISSM_DEV_DIR');
+ end
+ 
+ if (isempty(ISSM_DIR)),
+@@ -13,14 +12,14 @@
+ 	error('''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
+ end
+ 
+-%Now add all issm code paths necessary to run issm smoothly.
+-%We capture the error output, so that we can warn the user to update
+-%the variable ISSM_DIR in this file, in case it is not correctly setup.
++%Now add all issm code paths necessary to run issm smoothly. 
++%We capture the error output, so that we can warn the user to update 
++%the variable ISSM_DIR in this file, in case it is not correctly setup. 
+ 
+ %ISSM path
+-addpath([ISSM_DEV_DIR '/src/m/os/']); %load recursivepath
+-addpath([ISSM_DEV_DIR '/lib']);       %load mex
+-addpath(recursivepath([ISSM_DEV_DIR '/src/m']));
++addpath([ISSM_DIR '/src/m/os/']); %load recursivepath
++addpath([ISSM_DIR '/lib']);       %load MEX files
++addpath(recursivepath([ISSM_DIR '/src/m']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/scotch']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/canos']));
+ addpath(recursivepath([ISSM_DIR '/externalpackages/kml']));
+@@ -32,7 +31,7 @@
+ addpath(recursivepath([ISSM_DIR '/externalpackages/pcatool']));
+ clear ISSM_DIR;
+ 
+-%Check on any warning messages that might indicate that the paths were not correct.
++%Check on any warning messages that might indicate that the paths were not correct. 
+ if ~isempty(lastwarn),
+ 	fprintf('\n  Error trying to setup ''ISSM'' code paths. Try and update the ISSM_DIR variable in your .cshrc or .bashrc!\n');
+ 	fprintf('  ''ISSM'' will not  work at all until this is resolved\n\n');
+Index: ../trunk-jpl/src/m/dev/devpath.py
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.py	(revision 26183)
++++ ../trunk-jpl/src/m/dev/devpath.py	(revision 26184)
+@@ -5,7 +5,6 @@
+ 
+ #Recover ISSM_DIR and USERNAME
+ ISSM_DIR = os.getenv('ISSM_DIR')
+-ISSM_DEV_DIR = os.getenv('ISSM_DEV_DIR')
+ USERNAME = os.getenv('USER')
+ JPL_SVN = os.getenv('JPL_SVN')
+ if ISSM_DIR is None:
+@@ -12,7 +11,7 @@
+     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_DEV_DIR + '/src/m'):
++for root, dirs, files in os.walk(ISSM_DIR + '/src/m'):
+     if '.svn' in dirs:
+         dirs.remove('.svn')
+     for file in files:
+@@ -22,12 +21,12 @@
+                     sys.path.append(root)
+ 
+ #Also add the Nightly run directory
+-if ISSM_DEV_DIR + '/test/NightlyRun' not in sys.path:
+-    sys.path.append(ISSM_DEV_DIR + '/test/NightlyRun')
+-if ISSM_DEV_DIR + '/lib' not in sys.path:
+-    sys.path.append(ISSM_DEV_DIR + '/lib')
+-if ISSM_DEV_DIR + '/src/wrappers/python/.libs' not in sys.path:
+-    sys.path.append(ISSM_DEV_DIR + '/src/wrappers/python/.libs')
++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:
+@@ -48,4 +47,4 @@
+ #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
+ 
+ print("\n  ISSM development path correctly loaded")
+-print("Current path is {}\n\n".format(ISSM_DEV_DIR))
++print("Current path is {}\n\n".format(ISSM_DIR))
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26183)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26184)
+@@ -28,7 +28,7 @@
+     subproc_args = "gmsh -info 2>&1 | command grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"
+     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     outs, errs = subproc.communicate()
+-    if errs.decode('UTF-8') != '':
++    if errs != '':
+         raise Exception("gmshplanet: call to gmsh failed: {}".format(errs))
+     gmshmajorversion = int(outs)
+     if gmshmajorversion not in [3, 4]:
+@@ -123,8 +123,8 @@
+ 
+     # Call gmsh
+     #
+-    # NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally
+-    #       modifying our parsing scheme for Gmsh 4, for now, we simply set the
++    # NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
++    #       modifying our parsing scheme for Gmsh 4, for now, we simply set the 
+     #       "-format" option.
+     #
+     if options.exist('refine'):
+Index: ../trunk-jpl/src/m/miscellaneous/normfit_issm.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/normfit_issm.py	(revision 26183)
++++ ../trunk-jpl/src/m/miscellaneous/normfit_issm.py	(revision 26184)
+@@ -9,14 +9,12 @@
+ 
+     #  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
+-        # just check on lenght to avoid dividing by 0
+-        if len(x) <= 1:
+-            sigmahat = np.std(x, 0, ddof=0)
+-        else:
+-            sigmahat = np.std(x, 0, ddof=1)
++    # 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.
+@@ -40,7 +38,6 @@
+             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)))
+@@ -50,8 +47,6 @@
+ 
+     #  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)
+-            muhat[j], sigmahat[j], muci[:, j], sigmaci[:, j] = normfit_issm(x[not np.isnan(x[:, j]), j], alpha)
++            [muhat[j], sigmahat[j], muci[:, j], sigmaci[:, j]] = normfit_issm(x[not np.isnan(x[:, j]), j], alpha)
+ 
+-    return muhat, sigmahat, np.squeeze(muci), np.squeeze(sigmaci)
+-    #return [muhat, sigmahat, muci, sigmaci]
++    return [muhat, sigmahat, muci, sigmaci]
+Index: ../trunk-jpl/src/m/partition/partitioner.py
+===================================================================
+--- ../trunk-jpl/src/m/partition/partitioner.py	(revision 26183)
++++ ../trunk-jpl/src/m/partition/partitioner.py	(revision 26184)
+@@ -45,7 +45,7 @@
+     if md.mesh.dimension() == 3:
+         #partitioning essentially happens in 2D. So partition in 2D, then
+         #extrude the partition vector vertically.
+-        md3d = copy.deepcopy(md)  # save for later
++        md3d = copy.deepcopy(md) # save for later
+         md.mesh.elements = md.mesh.elements2d
+         md.mesh.x = md.mesh.x2d
+         md.mesh.y = md.mesh.y2d
+@@ -57,7 +57,6 @@
+ 
+     #adjacency matrix if needed:
+     if recomputeadjacency == 'on':
+-        print("adj calll")
+         md = adjacency(md)
+     else:
+         print('skipping adjacency matrix computation as requested in the options')
+@@ -67,7 +66,7 @@
+             raise RuntimeError('partitioner error message: package {} does not allow element partitions.'.format(package))
+         else:
+             # default method (from chaco.m)
+-            method = np.array([1, 1, 0, 0, 1, 1, 50, 0, 0.001, 7654321])  #.conj().transpose()
++            method = np.array([1, 1, 0, 0, 1, 1, 50, 0, 0.001, 7654321]).conj().transpose()
+             method[0] = 3  #  global method (3 = inertial (geometric))
+             method[2] = 0  #  vertex weights (0 = off, 1 = on)
+ 
+@@ -84,27 +83,22 @@
+             #method = method.reshape(-1, 1)  # transpose to 1x10 instead of 10
+ 
+             #  partition into nparts
+-            print("ChacoCall")
+             if isinstance(md.mesh, mesh2d):
+-                print("caseA")
+-                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, np.zeros((md.mesh.numberofvertices)), method, npart, np.array([]))[0].conj().transpose() + 1   #index partitions from 1 up. like metis.
++                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, np.zeros((md.mesh.numberofvertices, 1)), method, npart, np.array([]))[0].conj().transpose() + 1 #index partitions from 1 up. like metis.
+             else:
+-                print("caseB")
+-                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, md.mesh.z, method, npart, np.array([]))[0].conj().transpose() + 1  #index partitions from 1 up. like metis.
+-            print("Done")
+-
++                part = Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, md.mesh.z, method, npart, np.array([]))[0].conj().transpose() + 1 #index partitions from 1 up. like metis.
+     elif package == 'scotch':
+         if vectortype == 'element':
+             raise RuntimeError('partitioner error message: package %s does not allow element partitions.' % package)
+         else:
+             #are we using weights?
+-            if options.getfieldvalue('weighting') == 'on':
++            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.
++            part = maptab[:, 1] + 1 #index partitions from 1 up. like metis.
+ 
+     elif package == 'linear':
+         if vectortype == 'element':
+@@ -121,7 +115,7 @@
+ 
+     else:
+         raise RuntimeError('partitioner error message: could not find {} partitioner'.format(package))
+-    print("extrude")
++
+     #extrude if we are in 3D:
+     if md.mesh.dimension() == 3:
+         md3d.qmu.vertex_weight = md.qmu.vertex_weight
+Index: ../trunk-jpl/src/m/plot/plotmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotmodel.py	(revision 26183)
++++ ../trunk-jpl/src/m/plot/plotmodel.py	(revision 26184)
+@@ -13,7 +13,7 @@
+ 
+ def plotmodel(md, *args):
+     '''
+-    PLOTMODEL - At command prompt, type 'plotdoc()' for additional
++    PLOTMODEL - At command prompt, type 'plotdoc()' for additional 
+     documentation.
+ 
+     TODO:
+@@ -30,7 +30,7 @@
+     #get number of subplots
+     subplotwidth = ceil(sqrt(numberofplots))
+ 
+-    # TODO: Check that commenting this out is correct; we do not need a hold
++    # TODO: Check that commenting this out is correct; we do not need a hold 
+     # under matplotlib, right?
+     #
+     # #get hold
+@@ -39,24 +39,27 @@
+     #if nrows and ncols specified, then bypass
+     if options.list[0].exist('nrows'):
+         nrows = options.list[0].getfieldvalue('nrows')
++        nr = True
+     else:
+-        if options.list[0].exist('ncols'):
+-            ncols = options.list[0].getfieldvalue('ncols')
+-            nrows = np.ceil(numberofplots / ncols)
+-        else:
+-            nrows = np.ceil(numberofplots / subplotwidth)
++        nrows = np.ceil(numberofplots / subplotwidth)
++        nr = False
+ 
+     if options.list[0].exist('ncols'):
+         ncols = options.list[0].getfieldvalue('ncols')
+-        nrows = np.ceil(numberofplots / 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 nr != nc:
++        raise Exception('plotmodel error message: nrows and ncols need to be specified together, or not at all')
++
+     # Go through plots
+     #
+-    # NOTE: The following is where Python + matplolib differs substantially in
++    # NOTE: The following is where Python + matplolib differs substantially in 
+     #       implementation and inteface from MATLAB.
+     #
+     # Sources:
+@@ -79,19 +82,19 @@
+         if plotnum == 1:
+             plotnum = None
+ 
+-        # NOTE: The inline comments for each of the following parameters are
++        # NOTE: The inline comments for each of the following parameters are 
+         #       taken from https://matplotlib.org/api/_as_gen/mpl_toolkits.axes_grid1.axes_grid.ImageGrid.html
+         #
+-        direction = options.list[0].getfieldvalue('direction', 'row')  # {"row", "column"}, default: "row"
+-        axes_pad = options.list[0].getfieldvalue('axes_pad', 0.25)  # float or (float, float), default : 0.02; Padding or (horizonal padding, vertical padding) between axes, in inches
+-        add_all = options.list[0].getfieldvalue('add_all', True)  # bool, default: True
+-        share_all = options.list[0].getfieldvalue('share_all', True)  # bool, default: False
+-        label_mode = options.list[0].getfieldvalue('label_mode', 'L')  # {"L", "1", "all"}, default: "L"; Determines which axes will get tick labels: "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels;. "1": Only the bottom left axes is labelled. "all": all axes are labelled.
++        direction = options.list[0].getfieldvalue('direction', 'row') # {"row", "column"}, default: "row"
++        axes_pad = options.list[0].getfieldvalue('axes_pad', 0.25) # float or (float, float), default : 0.02; Padding or (horizonal padding, vertical padding) between axes, in inches
++        add_all = options.list[0].getfieldvalue('add_all', True) # bool, default: True
++        share_all = options.list[0].getfieldvalue('share_all', True) # bool, default: False
++        label_mode = options.list[0].getfieldvalue('label_mode', 'L') # {"L", "1", "all"}, default: "L"; Determines which axes will get tick labels: "L": All axes on the left column get vertical tick labels; all axes on the bottom row get horizontal tick labels;. "1": Only the bottom left axes is labelled. "all": all axes are labelled.
+ 
+         # Translate MATLAB colorbar mode to matplotlib
+         #
+         # TODO:
+-        # - Add 'edge' option (research if there is a corresponding option in
++        # - Add 'edge' option (research if there is a corresponding option in 
+         #   MATLAB)?
+         #
+         colorbar = options.list[0].getfieldvalue('colorbar', 'on')  # on, off (single)
+@@ -105,16 +108,16 @@
+         else:
+             raise RuntimeError('plotmodel error: colorbar mode \'{}\' is not a valid option'.format(colorbar))
+ 
+-        cbar_mode = colorbar   # {"each", "single", "edge", None }, default: None
+-        cbar_location = options.list[0].getfieldvalue('colorbarpos', 'right')   # {"left", "right", "bottom", "top"}, default: "right"
+-        cbar_pad = options.list[0].getfieldvalue('colorbarpad', 0.025)  # float, default: None
+-        cbar_size = options.list[0].getfieldvalue('colorbarsize', '5%')  # size specification (see Size.from_any), default: "5%"
++        cbar_mode = colorbar # {"each", "single", "edge", None }, default: None
++        cbar_location = options.list[0].getfieldvalue('colorbarpos', 'right') # {"left", "right", "bottom", "top"}, default: "right"
++        cbar_pad = options.list[0].getfieldvalue('colorbarpad', 0.025) # float, default: None
++        cbar_size = options.list[0].getfieldvalue('colorbarsize', '5%') # size specification (see Size.from_any), default: "5%"
+ 
+         # NOTE: Second parameter is:
+         #
+         #   rect(float, float, float, float) or int
+         #
+-        # The axes position, as a (left, bottom, width, height) tuple or as a
++        # The axes position, as a (left, bottom, width, height) tuple or as a 
+         # three-digit subplot position code (e.g., "121").
+         #
+         axgrid = ImageGrid(
+Index: ../trunk-jpl/src/m/qmu/dakota_out_parse.py
+===================================================================
+--- ../trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 26183)
++++ ../trunk-jpl/src/m/qmu/dakota_out_parse.py	(revision 26184)
+@@ -7,9 +7,9 @@
+ #move this later
+ from helpers import *
+ 
+-#  NOTE: May be rewritten 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.
++# NOTE: May be rewritten 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):  # {{{
+@@ -31,33 +31,33 @@
+         srcm          (double array, simple rank correlation matrix)
+         prcm          (double array, partial rank correlation matrix)
+ 
+-    The filei will be prompted for if empty. The fields of dresp are particular
+-    to the data contained within the file. The scm, pcm, srcm, and prcm are
++    The filei will be prompted for if empty. The fields of dresp are particular 
++    to the data contained within the file. The scm, pcm, srcm, and prcm are 
+     output by Dakota only for the sampling methods.
+ 
+-    This function reads a Dakota .out output file and parses it into the Python
+-    runtime. 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 exists in the file, rather than searching for data based
+-    on the particular method (this makes it independent of method). It also can
++    This function reads a Dakota .out output file and parses it into the Python 
++    runtime. 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 exists in the file, rather than searching for data based 
++    on the particular method (this makes it independent of method). It also can 
+     read and parse the .dat tabular_output file.
+ 
+-    This data would typically be used for plotting and other postprocessing
++    This data would typically be used for plotting and other postprocessing 
+     within MATLAB or Excel.
+ 
+     TODO:
+-    - Figure out why output from Dakota is different under MATLAB and Python
++    - Figure out why output from Dakota is different under MATLAB and Python 
+     (is it the input file that we write?)
+ 
+-    "Copyright 2009, by the California Institute of Technology. ALL RIGHTS
+-    RESERVED. United States Government Sponsorship acknowledged. Any commercial
+-    use must be negotiated with the Office of Technology Transfer at the
++    "Copyright 2009, by the California Institute of Technology. ALL RIGHTS 
++    RESERVED. United States Government Sponsorship acknowledged. Any commercial 
++    use must be negotiated with the Office of Technology Transfer at the 
+     California Institute of Technology. (NTR 47078)
+ 
+-    This software may be subject to U.S. export control laws. By accepting this
+-    software, the user agrees to comply with all applicable U.S. export laws
+-    and regulations. User has the responsibility to obtain export licenses, or
+-    other export authority as may be required before exporting such information
++    This software may be subject to U.S. export control laws. By accepting this 
++    software, the user agrees to comply with all applicable U.S. export laws 
++    and regulations. User has the responsibility to obtain export licenses, or 
++    other export authority as may be required before exporting such information 
+     to foreign countries or providing access to foreign persons."
+     """
+ 
+@@ -77,7 +77,7 @@
+         if getsize(filei) == 0 or fline == '':
+             raise RuntimeError('File ' + filei + ' is empty')
+ 
+-        dresp = []  # of struct()
++        dresp = [] # of struct()
+         scm = struct()
+         pcm = struct()
+         srcm = struct()
+@@ -188,7 +188,7 @@
+     # Process column headings of matrix (skipping eval_id)
+     [ntokens, tokens] = fltokens(fline)
+ 
+-    if fline.startswith('%eval_id interface'):  # Dakota versions >= 6
++    if strncmpi(fline, '%eval_id interface', 18): # Dakota versions >= 6
+         offset = 2
+     else:  # Dakota versions < 6
+         offset = 1
+@@ -222,18 +222,18 @@
+ 
+     print('Number of rows (Dakota func evals) = ' + str(nrow))
+ 
+-    # Calculate statistic
++    # Calculate statistics
+     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((np.size(data, 1)))
+-        dstddev = np.zeros((np.size(data, 1)))
++        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[i], dstddev[i], dmeanci[:, i], dstddevci[:, i] = normfit_issm(data[:, i], 0.05)
++            [dmean[0, i], dstddev[0, i], dmeanci[:, i], dstddevci[:, i]] = normfit_issm(data[:, i], 0.05)
+ 
+     dmin = data.min(axis=0)
+     dquart1 = prctile_issm(data, 25, 0)
+@@ -243,8 +243,8 @@
+     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
++    # 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:
+@@ -486,7 +486,7 @@
+             #  read and add cdf table to response function
+             fline = fidi.readline()
+             icdf = 0
+-            while (fline != '' and not fline.isspace()) and not fline.startswith('Cumulative Distribution Function'):
++            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))
+@@ -545,7 +545,7 @@
+             #  read and add pdf table to response function
+             fline = fidi.readline()
+             ipdf = 0
+-            while (fline != '' and not fline.isspace()) and not fline.startswith('PDF for'):
++            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))
+@@ -623,7 +623,7 @@
+ 
+     ndresp = 0
+ 
+-    while fline.startswith('MV Statistics for '):
++    while (fline != '' and not fline.isspace()) and strncmpi(fline, 'MV Statistics for ', 18):
+ 
+         #  add new response function and moments
+         [ntokens, tokens] = fltokens(fline)
+@@ -648,7 +648,7 @@
+         dresp[-1].impfac = []
+         dresp[-1].sens = []
+ 
+-        while 'Importance Factor for variable' in fline:
++        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]))
+@@ -666,7 +666,7 @@
+             dresp[-1].var = []
+             dresp[-1].impfac = []
+             dresp[-1].sens = []
+-            while type(fline) == str and (fline != '' and not fline.isspace()) and 'Cumulative Distribution Function' not in fline and 'MV Statistics for ' not in fline and '---' not in fline:
++            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
+@@ -681,7 +681,7 @@
+                 if fline == '' or fline.isspace():
+                     fline = fidi.readline()
+ 
+-        while fline.startswith('Cumulative Distribution Function'):
++        while (fline != '' and not fline.isspace()) and strncmpi(fline, 'Cumulative Distribution Function', 32):
+             [ntokens, tokens] = fltokens(fline)
+ 
+             #  find response function associated with cdf
+@@ -704,7 +704,7 @@
+ 
+             #  read and add cdf table to response function
+             fline = fidi.readline()
+-            while (fline != '' and not fline.isspace()) and not fline.startswith('MV Statistics for ') and '---' not in fline:
++            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))
+@@ -723,7 +723,7 @@
+         if not icdf:
+             print('    Cumulative Distribution Function not available')
+             dresp[ndresp].cdf = []
+-            while (fline != '' and not fline.isspace()) and not fline.startswith('MV Statistics for ') and '---' not in fline:
++            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)))
+@@ -736,7 +736,7 @@
+     #  function to find and read the best evaluation
+ 
+     if fline is None or fline == '' or fline.isspace():
+-        fline = findline(fidi, '<<<<< Best ')
++        fline = findline(fidi, ' < < < < < Best ')
+         if fline is None:
+             return
+ 
+@@ -746,12 +746,12 @@
+ 
+     print('Reading values for best function evaluation:')
+ 
+-    while fline.startswith('<<<<< Best '):
++    while (fline != '' and not fline.isspace()) and strncmpi(fline, ' < < < < < Best ', 11):
+         [ntokens, tokens] = fltokens(fline)
+ 
+     #  read and add best parameter(s)
+ 
+-        if str(tokens[2]).startswith('parameter'):
++        if strncmpi(str(tokens[2]), 'parameter', 9):
+             print('  ' + fline)
+ 
+             fline = fidi.readline()
+@@ -758,7 +758,7 @@
+             dresp.best.param = []
+             dresp.best.descriptor = ''
+ 
+-            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
++            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]
+@@ -766,13 +766,13 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best objective function(s)
+-        elif str(tokens[2]).startswith('objective') and str(tokens[3]).startswith('function'):
++        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 fline.startswith('<<<<< Best '):
++            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]
+@@ -779,7 +779,7 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best residual norms
+-        elif str(tokens[2]).startswith('residual') and str(tokens[3]).startswith('norm'):
++        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]
+@@ -786,17 +786,17 @@
+ 
+             fline = fidi.readline()
+ 
+-            while (fline != '' and not fline.isspace()) and not strncmpi(fline, '<<<<< Best ', 11):
++            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                 fline = fidi.readline()
+ 
+         #  read and add best residual term(s)
+-        elif str(tokens[2]).startswith('residual') and str(tokens[3]).startswith('term'):
++        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 fline.startswith('<<<<< Best '):
++            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]
+@@ -803,13 +803,13 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best constraint value(s)
+-        elif str(tokens[2]).startswith('constraint') and str(tokens[3]).startswith('value'):
++        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 fline.startswith('<<<<< Best '):
++            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]
+@@ -816,13 +816,13 @@
+                 fline = fidi.readline()
+ 
+         #  read and add best data captured
+-        elif str(tokens[2]).startswith('data') and str(tokens[3]).startswith('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 fline.startswith('<<<<< Best '):
++            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                 fline = fidi.readline()
+ 
+         #  read until next best or blank or end
+@@ -831,7 +831,7 @@
+ 
+             fline = fidi.readline()
+ 
+-            while (fline != '' and not fline.isspace()) and not fline.startswith('<<<<< Best '):
++            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                 fline = fidi.readline()
+ 
+     return dresp
+@@ -902,7 +902,7 @@
+     npos = 0
+     for fline in fidi:
+         npos += len(fline)
+-        if fline.startswith(string):
++        if (strncmpi(fline, string, len(string))):
+             if goto_line:
+                 fidi.seek(npos, 0)
+             else:
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26183)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26184)
+@@ -2,7 +2,6 @@
+ import struct
+ import numpy as np
+ from results import solution
+-from netCDF4 import Dataset
+ 
+ 
+ def parseresultsfromdisk(md, filename, iosplit):  #{{{
+@@ -75,94 +74,24 @@
+     return saveres
+ # }}}
+ 
+-
+ def parseresultsfromdiskioserial(md, filename):  # {{{
+     # Open file
+     try:
+         fid = open(filename, 'rb')
+-    except IOError:
++    except IOError as e:
+         raise IOError("parseresultsfromdisk error message: could not open {} for binary reading".format(filename))
+-    print(md.results)
++
+     # Collect all results in a list
+     allresults = []
+     while True:
+         # Read next result
+         result = ReadData(fid, md)
+-        if result is None:
+-            if allresults == []:
+-                raise Exception('no results found in binary file ' + filename)
+-            else:
+-                break
+-        # print("now got {} for time {}".format(result['fieldname'], result['time']))
+-        # print("with keys {}".format(result.keys()))
+-        # print("==============================")
+ 
+-        allresults.append(result)
+-    fid.close()
+-
+-    # Now, process all results and find out how many steps we have
+-    numresults = len(allresults)
+-    allsteps = np.zeros((numresults, 1))
+-    for i in range(numresults):
+-        allsteps[i] = allresults[i]['step']
+-    pos = np.where(allsteps != -9999)
+-    allsteps = np.sort(np.unique(allsteps[pos]))
+-
+-    # Ok, now construct structure
+-    results = solution()
+-
+-    for i in range(numresults):
+-        result = allresults[i]
+-        index = 0
+-        if result['step'] != -9999:
+-            index = np.where(result['step'] == allsteps)[0][0]
+-            setattr(results[index], 'step', result['step'])
+-        if result['time'] != -9999:
+-            setattr(results[index], 'time', result['time'])
+-        setattr(results[index], result['fieldname'], result['field'])
+-    return results
+-# }}}
+-
+-
+-def parseresultsfromdisktonc(md, filin, filout):  # {{{
+-    verbose = 0
+-    # Open file
+-    try:
+-        fid = open(filin, 'rb')
+-    except IOError:
+-        raise IOError("parseresultsfromdisk error message: could not open {} for binary reading".format(filin))
+-
+-    NCData = Dataset(filout, 'w', format='NETCDF4')
+-    UnlimDim = NCData.createDimension('Unlim', None)
+-    DimDict = {len(UnlimDim): 'Inf'}
+-    dimindex = 2
+-    dimlist = [2, md.mesh.numberofelements, md.mesh.numberofvertices, np.shape(md.mesh.elements)[1]]
+-    dimnames = ['DictDummy', 'EltNum', 'VertNum', 'VertPerElt']
+-    if verbose > 0:
+-        print('===Creating dimensions ===')
+-    for i, newdim in enumerate(dimlist):
+-        if newdim not in list(DimDict.keys()):
+-            dimindex += 1
+-            NewDim = NCData.createDimension(dimnames[i], newdim)
+-            DimDict[len(NewDim)] = dimnames[i]
+-
+-    typelist = [bool, str, int, float, complex,
+-                collections.OrderedDict,
+-                np.int64, np.ndarray, np.float64]
+-
+-    # Collect all results in a list
+-    allresults = []
+-    while True:
+-        # Read next result
+-        result = ReadData(fid, md)
+         if result is None:
+             if allresults == []:
+                 raise Exception('no results found in binary file ' + filename)
+             else:
+                 break
+-        print("now got {} for time {}".format(result['fieldname'], result['time']))
+-        print("with keys {}".format(result.keys()))
+-        print("==============================")
+ 
+         allresults.append(result)
+     fid.close()
+@@ -190,7 +119,6 @@
+     return results
+ # }}}
+ 
+-
+ def ReadData(fid, md):  # {{{
+     """READDATA
+ 
+@@ -392,7 +320,6 @@
+     return saveres
+ # }}}
+ 
+-
+ def addfieldtorecord(a, descr): #{{{
+     if a.dtype.fields is None:
+         raise ValueError('\'a\' must be a structured numpy array')
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26183)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26184)
+@@ -37,7 +37,10 @@
+ from toolkits import toolkits
+ from generic import generic
+ from pfe import pfe
++from vilje import vilje
++from hexagon import hexagon
+ from cyclone import cyclone
++from stallo import stallo
+ from saga import saga
+ from balancethickness import balancethickness
+ from stressbalance import stressbalance
+@@ -181,7 +184,7 @@
+ 
+     def __repr__(obj):  #{{{
+         # TODO:
+-        # - Convert all formatting to calls to <string>.format (see any
++        # - Convert all formatting to calls to <string>.format (see any 
+         #   already converted <class>.__repr__ method for examples)
+         #
+ 
+@@ -889,6 +892,7 @@
+                 if isvector:
+                     md.hydrology.__dict__[field] = project2d(md, md.hydrology.__dict__[field], 1)
+ 
++        # Materials
+         md.materials.rheology_B = DepthAverage(md, md.materials.rheology_B)
+         md.materials.rheology_n = project2d(md, md.materials.rheology_n, 1)
+ 
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26183)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26184)
+@@ -14,23 +14,6 @@
+ %      md.mesh=gmshplanet('radius',6000,'resolution',100);
+ %      md.mesh=gmshplanet('radius',6000,'resolution',100);
+ 
+-	%Find path to gmsh
+-	paths = {[issmdir() 'bin/gmsh'],...
+-		 [issmdir() 'externalpackages/gmsh/install/gmsh'],...
+-		 ['/usr/bin/gmsh']...
+-		};
+-	disp(paths{1})
+-	gmshpath = '';
+-	for i=paths
+-		if exist(i{1},'file'),
+-			gmshpath = i{1};
+-			break;
+-		end
+-	end
+-	if isempty(gmshpath),
+-		error('gmsh not found, make sure it is properly installed');
+-	end
+-
+ 	% Get Gmsh version
+ 	[s,r]=system(['gmsh -info 2>&1 | command grep ''Version'' | sed -e ''s/Version[[:blank:]]*:[[:blank:]]//'' | cut -d ''.'' -f1']);
+ 	if s~=0,
+@@ -137,8 +120,8 @@
+ 
+ 	% Call gmsh
+ 	%
+-	% NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally
+-	%		modifying our parsing scheme for Gmsh 4, for now, we simply set the
++	% NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
++	%		modifying our parsing scheme for Gmsh 4, for now, we simply set the 
+ 	%		"-format" option.
+ 	%
+ 	if  exist(options,'refine'),
Index: /issm/oecreview/Archive/25834-26739/ISSM-26184-26185.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26184-26185.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26184-26185.diff	(revision 26740)
@@ -0,0 +1,545 @@
+Index: ../trunk-jpl/src/m/classes/clusters/vilje.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/vilje.py	(revision 26184)
++++ ../trunk-jpl/src/m/classes/clusters/vilje.py	(nonexistent)
+@@ -1,145 +0,0 @@
+-import subprocess
+-from fielddisplay import fielddisplay
+-from pairoptions import pairoptions
+-from issmssh import issmssh
+-from issmscpin import issmscpin
+-from issmscpout import issmscpout
+-from QueueRequirements import QueueRequirements
+-from IssmConfig import IssmConfig
+-import datetime
+-try:
+-    from vilje_settings import vilje_settings
+-except ImportError:
+-    print('You need vilje_settings.py to proceed, check presence and sys.path')
+-
+-
+-class vilje(object):
+-    """
+-    Vilje cluster class definition
+-
+-       Usage:
+-          cluster = vilje()
+-    """
+-
+-    def __init__(self, *args):    # {{{
+-        self.name = 'vilje'
+-        self.login = ''
+-        self.numnodes = 2
+-        self.cpuspernode = 32
+-        self.procspernodes = 16
+-        self.mem = 28
+-        self.queue = 'workq'
+-        self.time = 2 * 60
+-        self.codepath = ''
+-        self.executionpath = ''
+-        self.interactive = 0
+-        self.port = []
+-        self.accountname = ''
+-
+-    #use provided options to change fields
+-        options = pairoptions(*args)
+-
+-    #initialize cluster using user settings if provided
+-        self = vilje_settings(self)
+-    #OK get other fields
+-        self = options.AssignObjectFields(self)
+-        self.np = self.numnodes * self.procspernodes
+-    # }}}
+-
+-    def __repr__(self):    # {{{
+-        #  display the object
+-        s = "class vilje object:"
+-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs (32)'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'node memory'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (test is an option, workq the default)'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+-        return s
+-    # }}}
+-
+-    def checkconsistency(self, md, solution, analyses):    # {{{
+-        #Queue dictionarry  gives queu name as key and max walltime and cpus as var
+-        queuedict = {'workq': [5 * 24 * 60, 30],
+-                     'test': [30, 4]}
+-        QueueRequirements(queuedict, self.queue, self.np, self.time)
+-
+-    #Miscelaneous
+-        if not self.login:
+-            md = md.checkmessage('login empty')
+-        if not self.codepath:
+-            md = md.checkmessage('codepath empty')
+-        if not self.executionpath:
+-            md = md.checkmessage('executionpath empty')
+-        if self.interactive == 1:
+-            md = md.checkmessage('interactive mode not implemented')
+-        return self
+-    # }}}
+-
+-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+-        executable = 'issm.exe'
+-        if isdakota:
+-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+-            version = float(version)
+-            if version >= 6:
+-                executable = 'issm_dakota.exe'
+-        if isoceancoupling:
+-            executable = 'issm_ocean.exe'
+-
+-    #write queuing script
+-        shortname = modelname[0:min(12, len(modelname))]
+-        fid = open(modelname + '.queue', 'w')
+-        fid.write('#PBS -S / bin / bash\n')
+-        fid.write('#PBS -N %s \n' % shortname)
+-        fid.write('#PBS -q %s \n' % self.queue)
+-        fid.write('#PBS -l select=%i:ncpus=%i:mpiprocs=%s\n' % (self.numnodes, self.cpuspernode, self.procspernodes))
+-        timeobj = datetime.timedelta(minutes=self.time)
+-        m, s = divmod(timeobj.total_seconds(), 60)
+-        h, m = divmod(m, 60)
+-        timestring = "%02d:%02d:%02d" % (h, m, s)
+-        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
+-        fid.write('#PBS -A %s\n' % self.accountname)
+-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+-        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
+-        fid.write('module load intelcomp/17.0.0\n')
+-        fid.write('module load mpt/2.14\n')
+-        fid.write('module load petsc/3.7.4d\n')
+-        fid.write('module load parmetis/4.0.3\n')
+-        fid.write('module load mumps/5.0.2\n')
+-        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
+-        fid.write('mpiexec_mpt -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+-        fid.close()
+-    # }}}
+-
+-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+-        #compress the files into one zip.
+-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+-        for file in filelist:
+-            compressstring += ' %s' % file
+-        subprocess.call(compressstring, shell=True)
+-
+-        print('uploading input file and queueing script')
+-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+-    # }}}
+-
+-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+-        print('launching solution sequence on remote cluster')
+-        if restart:
+-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+-        else:
+-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+-        issmssh(self.name, self.login, self.port, launchcommand)
+-    # }}}
+-
+-    def Download(self, dirname, filelist):    # {{{
+-        #copy files from cluster to current directory
+-        directory = '%s/%s/' % (self.executionpath, dirname)
+-        issmscpin(self.name, self.login, self.port, directory, filelist)
+-    # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/hexagon.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/hexagon.py	(revision 26184)
++++ ../trunk-jpl/src/m/classes/clusters/hexagon.py	(nonexistent)
+@@ -1,145 +0,0 @@
+-import subprocess
+-from fielddisplay import fielddisplay
+-from pairoptions import pairoptions
+-from issmssh import issmssh
+-from issmscpin import issmscpin
+-from issmscpout import issmscpout
+-from IssmConfig import IssmConfig
+-import datetime
+-try:
+-    from hexagon_settings import hexagon_settings
+-except ImportError:
+-    print('You need hexagon_settings.py to proceed, check presence and sys.path')
+-
+-
+-class hexagon(object):
+-    """
+-    Hexagon cluster class definition
+-    Hexagon have nodes built of 2 * 16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway.
+-    You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
+-       Usage:
+-          cluster = hexagon()
+-    """
+-
+-    def __init__(self, *args):  # {{{
+-        self.name = 'hexagon'
+-        self.login = ''
+-        self.numnodes = 2
+-        self.procspernodes = 32
+-        self.mem = 32000
+-        self.queue = 'batch'
+-        self.time = 2 * 60
+-        self.codepath = ''
+-        self.executionpath = ''
+-        self.interactive = 0
+-        self.port = []
+-        self.accountname = ''
+-
+-    #use provided options to change fields
+-        options = pairoptions(*args)
+-
+-    #initialize cluster using user settings if provided
+-        self = hexagon_settings(self)
+-
+-    #OK get other fields
+-        self = options.AssignObjectFields(self)
+-        self.np = self.numnodes * self.procspernodes
+-    # }}}
+-
+-    def __repr__(self):      # {{{
+-        #  display the object
+-        s = "class hexagon object:"
+-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes  default and optimal is 32'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'Total node memory'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+-        return s
+-    # }}}
+-
+-    def checkconsistency(self, md, solution, analyses):      # {{{
+-        #mem should not be over 32000mb
+-        #numprocs should not be over 4096
+-        #we have cpupernodes * numberofcpus = mppwidth and mppnppn = cpupernodes,
+-        #Miscelaneous
+-        if not self.login:
+-            md = md.checkmessage('login empty')
+-        if not self.codepath:
+-            md = md.checkmessage('codepath empty')
+-        if not self.executionpath:
+-            md = md.checkmessage('executionpath empty')
+-        if self.interactive == 1:
+-            md = md.checkmessage('interactive mode not implemented')
+-        if self.mem > 32000:
+-            md = md.checkmessage('asking too much memory max is 32000 per node')
+-        return self
+-    # }}}
+-
+-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+-        executable = 'issm.exe'
+-        if isdakota:
+-            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+-            version = float(version)
+-            if version >= 6:
+-                executable = 'issm_dakota.exe'
+-        if isoceancoupling:
+-            executable = 'issm_ocean.exe'
+-
+-    #write queuing script
+-        shortname = modelname[0:min(12, len(modelname))]
+-        fid = open(modelname + '.queue', 'w')
+-        fid.write('  #!/bin/bash\n')
+-        fid.write('  #PBS - N %s \n' % shortname)
+-        fid.write('  #PBS - l mppwidth=%i, mppnppn=%i\n' % (self.np, self.procspernodes))
+-        timeobj = datetime.timedelta(minutes=self.time)
+-        m, s = divmod(timeobj.total_seconds(), 60)
+-        h, m = divmod(m, 60)
+-        timestring = "%02d:%02d:%02d" % (h, m, s)
+-        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
+-        fid.write('#PBS -l mppmem=%imb\n' % int(self.mem / self.procspernodes))
+-        fid.write('#PBS -A %s\n' % self.accountname)
+-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+-        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
+-        fid.write('export CRAY_ROOTFS=DSL\n')
+-        fid.write('module swap PrgEnv-cray / 5.2.40 PrgEnv - gnu\n')
+-        fid.write('module load cray-petsc\n')
+-        fid.write('module load cray-tpsl\n')
+-        fid.write('module load cray-mpich\n')
+-        fid.write('module load gsl\n')
+-        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
+-        fid.write('aprun -B %s/%s %s %s/%s %s\n' % (self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+-        fid.close()
+-    # }}}
+-
+-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+-        #compress the files into one zip.
+-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+-        for file in filelist:
+-            compressstring += ' %s' % file
+-        subprocess.call(compressstring, shell=True)
+-
+-        print('uploading input file and queueing script')
+-        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+-    # }}}
+-
+-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+-        print('launching solution sequence on remote cluster')
+-        if restart:
+-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+-        else:
+-            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+-        issmssh(self.name, self.login, self.port, launchcommand)
+-    # }}}
+-
+-    def Download(self, dirname, filelist):    # {{{
+-        #copy files from cluster to current directory
+-        directory = '%s/%s/' % (self.executionpath, dirname)
+-        issmscpin(self.name, self.login, self.port, directory, filelist)
+-    # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/vilje.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/vilje.m	(revision 26184)
++++ ../trunk-jpl/src/m/classes/clusters/vilje.m	(nonexistent)
+@@ -1,209 +0,0 @@
+-%vilje class definition
+-%
+-%   Usage:
+-%      cluster=greenplanet();
+-%      cluster=greenplanet('np',3);
+-%      cluster=greenplanet('np',3,'login','username');
+-
+-classdef vilje
+-	properties (SetAccess=public)  
+-		% {{{
+-		name           = 'vilje';
+-		login          = '';
+-		numnodes       = 2;
+-		cpuspernode    = 32;
+-		procspernodes  = 16;
+-		mem            = 28;
+-		numstreams		= 8; %Henning added
+-		queue          = 'workq';
+-		time           = 2*60;
+-		codepath       = '';
+-		executionpath  = '';
+-		interactive    = 0;
+-		port           = [];
+-		accountname    = '';
+-		% }}}
+-	end
+-	methods
+-		function cluster=vilje(varargin) % {{{
+-
+-			%initialize cluster using default settings if provided
+-			if (exist('vilje_settings')==2), vilje_settings; end
+-
+-			%use provided options to change fields
+-			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		end
+-		%}}}
+-		function disp(cluster) % {{{
+-			%  display the object
+-			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			disp(sprintf('    name: %s',cluster.name));
+-			disp(sprintf('    login: %s',cluster.login));
+-			disp(sprintf('    accountname: %s',cluster.accountname));
+-			disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			disp(sprintf('    np: %i', cluster.cpuspernode*cluster.numnodes));
+-			disp(sprintf('    procspernodes: %i',cluster.procspernodes));
+-			disp(sprintf('    queue: %s',cluster.queue));
+-			disp(sprintf('    codepath: %s',cluster.codepath));
+-			disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			disp(sprintf('    interactive: %i',cluster.interactive));
+-			disp(sprintf('    time: %i',cluster.time));
+-			disp(sprintf('    memory: %i',cluster.mem));
+-		end
+-		%}}}
+-		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+-
+-			available_queues={'workq'};
+-			queue_requirements_time=[5*24*60];
+-			queue_requirements_np=[30];
+-
+-			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+-
+-			%Miscelaneous
+-			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
+-			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+-
+-		end
+-		%}}}
+-		function numprocs=np(self) % {{{
+-			%compute number of processors
+-			numprocs=self.numnodes*self.procspernodes;
+-		end
+-		%}}}
+-		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+-
+-			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+-
+-			%compute number of processors
+-% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;
+-
+-			%write queuing script 
+-			fid=fopen([modelname '.queue'],'w');
+-			fprintf(fid,'#PBS -S /bin/bash\n');
+-			fprintf(fid,'#PBS -N %s\n',modelname);
+-			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,16);
+-			
+-			%calculate walltime in hh:mm:ss format
+-			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
+-			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
+-			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
+-			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+-			fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+-			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			fprintf(fid,'module load intelcomp/17.0.0\n') 
+-			fprintf(fid,'module load mpt/2.14\n')
+-			fprintf(fid,'module load petsc/3.7.4d\n')
+-			fprintf(fid,'module load parmetis/4.0.3\n') 
+-			fprintf(fid,'module load mumps/5.0.2\n')
+-			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+-			fprintf(fid,'mpiexec_mpt -n %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+-			if ~io_gather, %concatenate the output files:
+-				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			end
+-			fclose(fid);
+-		end
+-		%}}}
+-		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+-
+-			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+-
+-			executable='issm.exe';
+-			if isdakota,
+-				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+-				if (version>=6),
+-					executable='issm_dakota.exe';
+-				end
+-			end
+-			if isoceancoupling,
+-				executable='issm_ocean.exe';
+-			end
+-
+-			%compute number of processors
+-% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;                     
+-% 			shortname = substring(modelname,1,min(12,length(modelname)));
+-
+-			%write queuing script 
+-			fid=fopen([modelname '.queue'],'w');
+-			fprintf(fid,'#PBS -S /bin/bash\n');
+-% 			fprintf(fid,'#PBS -N %s\n',shortname);
+-			fprintf(fid,'#PBS -N %s\n',modelname);
+-			fprintf(fid,'#PBS -q %s \n',cluster.queue);
+-			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,cluster.procspernodes);
+-
+-			%calculate walltime in hh:mm:ss format
+-			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
+-% 			fprintf(fid,'#PBS -l walltime=%s\n',duration(0,cluster.time,0)); %walltime is in minutes.
+-% 			fprintf(fid,'#PBS -l walltime=%s\n',10); %walltime is in minutes.
+-			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
+-% 			fprintf(fid,'#PBS -l walltime=%i\n',walltime); %walltime is in hh:mm:ss
+-			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
+-			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+-			fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
+-			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			fprintf(fid,'module load intelcomp/17.0.0\n') 
+-			fprintf(fid,'module load mpt/2.14\n')
+-			fprintf(fid,'module load petsc/3.7.4d\n')
+-			fprintf(fid,'module load parmetis/4.0.3\n') 
+-			fprintf(fid,'module load mumps/5.0.2\n')
+-			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-
+-			if ~io_gather, %concatenate the output files:
+-				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			end
+-			fclose(fid);
+-
+-			%in interactive mode, create a run file, and errlog and outlog file
+-			if cluster.interactive,
+-				fid=fopen([modelname '.run'],'w');
+-				fprintf(fid,'mpiexec_mpt -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-				if ~io_gather, %concatenate the output files:
+-					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-				end
+-				fclose(fid);
+-				fid=fopen([modelname '.errlog'],'w');
+-				fclose(fid);
+-				fid=fopen([modelname '.outlog'],'w');
+-				fclose(fid);
+-			end
+-		end %}}}
+-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+-
+-			%compress the files into one zip.
+-			compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			for i=1:numel(filelist),
+-				compressstring = [compressstring ' ' filelist{i}];
+-			end
+-			system(compressstring);
+-			disp('uploading input file and queueing script');
+-			directory=cluster.executionpath;
+-% 			issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
+-			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+-
+-		end
+-		%}}}
+-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+-
+-			disp('launching solution sequence on remote cluster');
+-			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+-			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		end %}}}
+-		function Download(cluster,dirname,filelist)% {{{
+-
+-			%copy files from cluster to current directory
+-			directory=[cluster.executionpath '/' dirname '/'];
+-			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+-
+-		end %}}}
+-	end
+-end
+
+Property changes on: ../trunk-jpl/src/m/classes/clusters/vilje.m
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26184)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26185)
+@@ -37,10 +37,7 @@
+ from toolkits import toolkits
+ from generic import generic
+ from pfe import pfe
+-from vilje import vilje
+-from hexagon import hexagon
+ from cyclone import cyclone
+-from stallo import stallo
+ from saga import saga
+ from balancethickness import balancethickness
+ from stressbalance import stressbalance
+@@ -184,7 +181,7 @@
+ 
+     def __repr__(obj):  #{{{
+         # TODO:
+-        # - Convert all formatting to calls to <string>.format (see any 
++        # - Convert all formatting to calls to <string>.format (see any
+         #   already converted <class>.__repr__ method for examples)
+         #
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26185-26186.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26185-26186.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26185-26186.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26185)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26186)
+@@ -57,17 +57,17 @@
+ def ismember(a, s):
+     import numpy as np
+ 
+-    if not isinstance(s, (range, tuple, list, dict, np.ndarray)):
++    if not isinstance(s, (tuple, list, dict, np.ndarray)):
+         s = [s]
+ 
+-    if not isinstance(a, (range, tuple, list, dict, np.ndarray)):
++    if not isinstance(a, (tuple, list, dict, np.ndarray)):
+         a = [a]
+ 
+-    if not isinstance(a, (range, np.ndarray)):
++    if not isinstance(a, np.ndarray):
+         b = [item in s for item in a]
+ 
+     else:
+-        if not isinstance(s, (range, np.ndarray)):
++        if not isinstance(s, np.ndarray):
+             b = np.empty_like(a)
+             for i, item in enumerate(a.flat):
+                 b.flat[i] = item in s
Index: /issm/oecreview/Archive/25834-26739/ISSM-26186-26187.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26186-26187.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26186-26187.diff	(revision 26740)
@@ -0,0 +1,342 @@
+Index: ../trunk-jpl/src/m/classes/friction.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/friction.m	(revision 26186)
++++ ../trunk-jpl/src/m/classes/friction.m	(revision 26187)
+@@ -5,11 +5,11 @@
+ 
+ classdef friction
+ 	properties (SetAccess=public) 
+-		coefficient = NaN;
+-		p           = NaN;
+-		q           = NaN;
+-		coupling    = 0;
+-		effective_pressure = NaN;
++		coefficient              = NaN;
++		p                        = NaN;
++		q                        = NaN;
++		coupling                 = 0;
++		effective_pressure       = NaN;
+ 		effective_pressure_limit = 0;
+ 	end
+ 	methods
+@@ -17,16 +17,8 @@
+ 			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');
+-			switch self.coupling
+-				case 0
+-				case 1
+-				case 2
+-				case 3
+-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
+-				case 4
+-					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
+-				otherwise
+-					error('not supported yet');		
++			if self.coupling==3 || self.coupling==4
++				self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
+ 			end
+ 		end % }}}
+ 		function self = friction(varargin) % {{{
+@@ -56,16 +48,8 @@
+ 			md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
+ 			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0:4]);
+ 			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
+-			switch self.coupling
+-				case 0
+-				case 1
+-				case 2
+-				case 3
+-					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
+-				case 4
+-				
+-				otherwise
+-					error('not supported yet');
++         if self.coupling==3
++            md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
+ 			end
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -91,16 +75,8 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
+-			switch self.coupling
+-				case 0
+-				case 1
+-				case 2
+-				case 3
+-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-				case 4
+-					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-				otherwise
+-					error('not supported yet');		
++			if self.coupling==3 || self.coupling==4
++				WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			end
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+Index: ../trunk-jpl/src/m/classes/friction.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/friction.py	(revision 26186)
++++ ../trunk-jpl/src/m/classes/friction.py	(revision 26187)
+@@ -22,7 +22,6 @@
+         self.effective_pressure_limit = 0
+         self.setdefaultparameters()
+     #}}}
+-
+     def __repr__(self):  # {{{
+         s = 'Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b,\n'
+         s += '(effective stress Neff = rho_ice * g * thickness + rho_water * g * base, r = q / p and s = 1 / p)\n'
+@@ -34,29 +33,22 @@
+         s += '{}\n'.format(fielddisplay(self, 'effective_pressure_limit', 'Neff do not allow to fall below a certain limit: effective_pressure_limit * rho_ice * g * thickness (default 0)'))
+         return s
+     #}}}
+-
+     def setdefaultparameters(self):  # {{{
+         self.effective_pressure_limit = 0
+         return self
+     #}}}
+-
+     def extrude(self, md):  # {{{
+         self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
+         self.p = project3d(md, 'vector', self.p, 'type', 'element')
+         self.q = project3d(md, 'vector', self.q, 'type', 'element')
+-        # If self.coupling == 0:  #doesnt work with empty loop, so just skip it?
+         if self.coupling in[3, 4]:
+             self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
+-        elif self.coupling > 4:
+-            raise ValueError('md.friction.coupling larger than 4, not supported yet')
+         return self
+     #}}}
+-
+     def defaultoutputs(self, md):  # {{{
+         list = []
+         return list
+     #}}}
+-
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         # Early return
+         if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+@@ -70,11 +62,8 @@
+         md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
+         if self.coupling == 3:
+             md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+-        elif self.coupling > 4:
+-            raise ValueError('not supported yet')
+         return md
+     # }}}
+-
+     def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 1, 'format', 'Integer')
+         if type(self.coefficient) in [np.ndarray] and (self.coefficient.shape[0] == md.mesh.numberofvertices or self.coefficient.shape[0] == (md.mesh.numberofvertices + 1)):
+@@ -88,10 +77,6 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
+         WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
+-        if self.coupling == 3:
++        if self.coupling == 3 or self.coupling == 4:
+             WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+-        elif self.coupling == 4:
+-            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+-        elif self.coupling > 4:
+-            raise ValueError('not supported yet')
+     # }}}
+Index: ../trunk-jpl/src/m/classes/frictionschoof.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frictionschoof.m	(revision 26186)
++++ ../trunk-jpl/src/m/classes/frictionschoof.m	(revision 26187)
+@@ -5,9 +5,11 @@
+ 
+ classdef frictionschoof
+ 	properties (SetAccess=public) 
+-		C    = NaN;
+-		Cmax = NaN;
+-		m    = NaN;
++		C                        = NaN;
++		Cmax                     = NaN;
++		m                        = NaN;
++		coupling                 = 0;
++		effective_pressure       = NaN;
+ 		effective_pressure_limit = 0;
+ 	end
+ 	methods
+@@ -25,9 +27,13 @@
+ 			self.C    = project3d(md,'vector',self.C,'type','node');
+ 			self.Cmax = project3d(md,'vector',self.Cmax,'type','node');
+ 			self.m    = project3d(md,'vector',self.m,'type','element');
++			if self.coupling==3 || self.coupling==4
++				self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
++			end
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
++         self.coupling = 0;
+ 			self.effective_pressure_limit = 0;
+ 
+ 		end % }}}
+@@ -35,10 +41,14 @@
+ 
+ 			%Early return
+ 			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
+-			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>',0.);
++			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>=',0.);
+ 			md = checkfield(md,'fieldname','friction.Cmax','timeseries',1,'NaN',1,'Inf',1,'>',0.);
+ 			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
+ 			md = checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
++         md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0:4]);
++         if self.coupling==3
++            md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
++         end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			%See Brondex et al. 2019 https://www.the-cryosphere.net/13/177/2019/
+@@ -51,6 +61,8 @@
+ 			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)');
++			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
++         fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: use coupled model (not implemented yet)');
+ 			fielddisplay(self,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -61,6 +73,10 @@
+ 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','Cmax','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'object',self,'class','friction','fieldname','effective_pressure_limit','format','Double');
++         WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
++         if self.coupling==3 || self.coupling==4
++            WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++         end
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/frictionschoof.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/frictionschoof.py	(revision 26186)
++++ ../trunk-jpl/src/m/classes/frictionschoof.py	(revision 26187)
+@@ -15,10 +15,12 @@
+     """
+ 
+     def __init__(self, *args):  # {{{
+-        self.C                          = np.nan
+-        self.Cmax                       = np.nan
+-        self.m                          = np.nan
+-        self.effective_pressure_limit   = 0
++        self.C                        = np.nan
++        self.Cmax                     = np.nan
++        self.m                        = np.nan
++        self.coupling                 = 0
++        self.effective_pressure       = np.nan
++        self.effective_pressure_limit = 0
+         
+         nargs = len(args)
+         if nargs == 0:
+@@ -28,7 +30,6 @@
+         else:
+             raise Exception('constructor not supported')
+     #}}}
+-
+     def __repr__(self):  # {{{
+         # See Brondex et al. 2019 https://www.the-cryosphere.net/13/177/2019/
+         s = 'Schoof sliding law parameters:\n'
+@@ -40,22 +41,23 @@
+         s += "{}\n".format(fielddisplay(self, 'C', 'friction coefficient [SI]'))
+         s += "{}\n".format(fielddisplay(self, 'Cmax', 'Iken\'s bound (typically between 0.17 and 0.84) [SI]'))
+         s += "{}\n".format(fielddisplay(self, 'm', 'm exponent (generally taken as m = 1/n = 1/3)'))
++        s += '{}\n'.format(fielddisplay(self, 'coupling', 'Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
++        s += '{}\n'.format(fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
+         s += "{}\n".format(fielddisplay(self, 'effective_pressure_limit', 'fNeff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)'))
+         return s
+     #}}}
+-
+     def setdefaultparameters(self):  # {{{
+         self.effective_pressure_limit = 0
+         return self
+     #}}}
+-
+     def extrude(self, md):  # {{{
+         self.C = project3d(md, 'vector', self.C, 'type', 'node')
+         self.Cmax = project3d(md, 'vector', self.Cmax, 'type', 'node')
+         self.m = project3d(md, 'vector', self.m, 'type', 'element')
++        if self.coupling in[3, 4]:
++            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
+         return self
+     #}}}
+-
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         # Early return
+         if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+@@ -64,9 +66,11 @@
+         md = checkfield(md, 'fieldname', 'friction.Cmax', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>', 0.)
+         md = checkfield(md, 'fieldname', 'friction.m', 'NaN', 1, 'Inf', 1, '>', 0., 'size', [md.mesh.numberofelements, 1])
+         md = checkfield(md, 'fieldname', 'friction.effective_pressure_limit', 'numel', [1], '>=', 0)
++        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
++        if self.coupling == 3:
++            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+         return md
+     # }}}
+-
+     def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+ 
+@@ -74,6 +78,8 @@
+         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)
++        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'friction', 'fieldname', 'effective_pressure_limit', 'format', 'Double')
++        if self.coupling == 3 or self.coupling == 4:
++            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+     # }}}
+-
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26186)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26187)
+@@ -920,9 +920,15 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum,0.);
+ 			break;
+ 		case 11:
++			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
+ 			iomodel->FetchDataToInput(inputs,elements,"md.friction.m",FrictionMEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.friction.C",FrictionCEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.friction.Cmax",FrictionCmaxEnum);
++			if(FrictionCoupling==3){
++				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
++			else if(FrictionCoupling==4){
++				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",EffectivePressureEnum);
++			}
+ 			break;
+ 		case 12:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.friction.m",FrictionMEnum);
+@@ -937,7 +943,6 @@
+ 				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
+ 			else if(FrictionCoupling==4){
+ 				iomodel->FetchDataToInput(inputs,elements,"md.friction.effective_pressure",EffectivePressureEnum);
+-
+ 			}
+ 			break;
+ 		default:
+@@ -1046,7 +1051,7 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.void_ratio",FrictionVoidRatioEnum));
+ 			break;
+ 		case 11:
+-			parameters->AddObject(new IntParam(FrictionCouplingEnum,2));
++			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
+ 			break;
+ 		case 12:
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26186)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26187)
+@@ -615,7 +615,7 @@
+ 				/*Read record_name: */
+ 				if(fread(record_name,record_name_size*sizeof(char),1,fid)!=0){};
+ 				
+-				_error_("error while looking in binary file. String " << record_name << " a string of size "<<record_name_size);
++				_error_("error while looking in binary file. String \"" << record_name << "\" is a string of size "<<record_name_size);
+ 			}
+ 
+ 			/*Allocate string of correct size: */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26187-26188.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26187-26188.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26187-26188.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26187)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26188)
+@@ -36,7 +36,7 @@
+ 	%List of common paths to try
+ 	paths = {...
+ 		['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+-		['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
++		['/home/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'],...
+ 		['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+ 		['./' basename '-' ncdate '.nc'],...
+ 		};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26188-26189.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26188-26189.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26188-26189.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test494.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.m	(revision 26188)
++++ ../trunk-jpl/test/NightlyRun/test494.m	(revision 26189)
+@@ -27,7 +27,7 @@
+ field_tolerances={...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+-	2e-13,2e-13,2e-13,1e-13,2e-13,3e-13,6e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++	2e-13,2e-13,2e-13,1e-13,2e-13,4e-13,9e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+ };
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test494.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.py	(revision 26188)
++++ ../trunk-jpl/test/NightlyRun/test494.py	(revision 26189)
+@@ -38,7 +38,7 @@
+ field_tolerances = [
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 2e-13, 3e-13, 6e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 2e-13, 4e-13, 9e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26189-26190.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26189-26190.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26189-26190.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/scripts/DownloadExamplesDatasets.sh
+===================================================================
+--- ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(revision 26189)
++++ ../trunk-jpl/scripts/DownloadExamplesDatasets.sh	(revision 26190)
+@@ -20,8 +20,7 @@
+ 	DIRECTORY_PREFIX=$1
+ 
+ 	if [ ! -d "${DIRECTORY_PREFIX}" ]; then
+-		echo "Error: output directory ${DIRECTORY_PREFIX} does not exist"
+-		exit 1
++		mkdir -p "${DIRECTORY_PREFIX}"
+ 	fi
+ fi
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26190-26191.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26190-26191.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26190-26191.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/frictionweertman.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frictionweertman.m	(revision 26190)
++++ ../trunk-jpl/src/m/classes/frictionweertman.m	(revision 26191)
+@@ -36,7 +36,7 @@
+ 			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements 1]);
+ 		end % }}}
+-		function disp(self) % {{{z
++		function disp(self) % {{{
+ 			disp('Weertman sliding law parameters:');
+ 			disp('   Weertman''s sliding law reads:');
+ 			disp('      v_b = C_w * Sigma_b^m');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26191-26192.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26191-26192.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26191-26192.diff	(revision 26740)
@@ -0,0 +1,538 @@
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 26191)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 26192)
+@@ -121,8 +121,8 @@
+ 			md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 			if strcmp(domaintype(md.mesh),'2Dhorizontal')
+-				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
+-				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
++				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1,2,4]);
++				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1,2,4]);
+ 			elseif strcmp(domaintype(md.mesh),'3Dsurface')
+ 				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
+ 				md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26191)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26192)
+@@ -193,12 +193,12 @@
+ 					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1);
+ 				}
+ 			}
+-			else{//itapopo testing here
++			else{//itapopo FIXME only base velocities are constrained here
+ 				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,1);
++				//IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,1);
+ 				if(iomodel->domaintype!=Domain2DverticalEnum){
+ 					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
+-					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,3);
++					//IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,3);
+ 				}
+ 			}
+ 		}
+@@ -782,9 +782,9 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum,0.);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum,0.);
+-	if(isMLHO){//itapopo
+-		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
+-		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum,0.);
++	if(isMLHO){//itapopo FIXME the shear velocities should be initialized correctly
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxShearEnum,0.);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyShearEnum,0.);
+ 	}
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcex",LoadingforceXEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcey",LoadingforceYEnum);
+@@ -2083,7 +2083,7 @@
+ 
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-
++	
+ 	/*Transform solution in Cartesian Space*/
+ 	if(dim==2) basalelement->TransformSolutionCoord(&values[0],XYEnum);
+ 
+@@ -2728,7 +2728,9 @@
+ 
+ /*MLHO*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+-
++	
++	_error_("Mono Layer Higher-Order called, not fully tested. If you are sure in using it, comment this line.");
++	
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+ 	/*compute all stiffness matrices for this element*/
+@@ -2744,9 +2746,89 @@
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOFriction(Element* element){/*{{{*/
+ 
+ 	if(!element->IsOnBase() || element->IsFloating()) return NULL;
++
++	/*Intermediaries*/
++	int         dim,domaintype;
++	bool        mainlyfloating;
++	int         friction_style,point1;
++	IssmDouble  alpha2,Jdet,fraction1,fraction2;
++	IssmDouble  gllevelset,phi=1.;
++	IssmDouble *xyz_list  = NULL;
++	Gauss*      gauss     = NULL;
++
++	/*Get problem dimension*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DverticalEnum:   dim = 1;break;
++		case Domain2DhorizontalEnum: dim = 2;break;
++		case Domain3DEnum:           dim = 2;break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = element->GetNumberOfNodes();
++	int numdof   = numnodes*dim;
++
++	/*Initialize Element matrix and vectors*/
++	ElementMatrix* Ke = element->NewElementMatrix(MLHOApproximationEnum);
++	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
++	element->FindParam(&friction_style,GroundinglineFrictionInterpolationEnum);
++	Input* surface_input    = element->GetInput(SurfaceEnum); _assert_(surface_input);
++	Input* gllevelset_input = NULL;
++
++	/*build friction object, used later on: */
++	Friction* friction=new Friction(element,dim);
++
++	/*Recover portion of element that is grounded*/
++	if(!(friction_style==SubelementFriction2Enum)) phi=element->GetGroundedPortion(xyz_list);
++	if(friction_style==SubelementFriction2Enum){
++		gllevelset_input=element->GetInput(MaskOceanLevelsetEnum); _assert_(gllevelset_input);
++		element->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
++	   gauss = element->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
++	}
++	else{
++		gauss = element->NewGauss(2);
++	}
+ 	
++	/* Start  looping on the number of gaussian points: */
++	while(gauss->next()){
++
++		friction->GetAlpha2(&alpha2,gauss);
++		if(friction_style==SubelementFriction1Enum) alpha2=phi*alpha2;
++		else if(friction_style==SubelementFriction2Enum){
++			gllevelset_input->GetInputValue(&gllevelset, gauss);
++			if(gllevelset<0.) alpha2=0.;
++		}
++		else if(friction_style==NoFrictionOnPartiallyFloatingEnum){
++			if (phi<0.99999999) alpha2=0.;
++		}
++		else  _error_("friction interpolation "<<EnumToStringx(friction_style)<<" not implemented yet");
++
++		element->NodalFunctions(basis,gauss);
++		element->JacobianDeterminant(&Jdet, xyz_list,gauss);
++
++		for(int i=0;i<numnodes;i++){
++			for(int j=0;j<numnodes;j++){
++				Ke->values[(4*i+0)*2*2*numnodes+4*j+0] += alpha2*gauss->weight*Jdet*basis[i]*basis[j];
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+2] += alpha2*gauss->weight*Jdet*basis[i]*basis[j];
++			}
++		}
++	}
++
++	/*Clean up and return*/
++	delete gauss;
++	delete friction;
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	return Ke;
++
++
++	//itapopo OLD - testing above
+ 	/*Intermediaries*/
+-	int      domaintype;
++	//int      domaintype;
+    Element* basalelement;
+ 
+    /*Get basal element*/
+@@ -2763,11 +2845,11 @@
+    }
+ 
+ 	//Element* basalelement = element->SpawnBasalElement();
+-	ElementMatrix* Ke    = basalelement->NewElementMatrix(MLHOApproximationEnum);
++	//ElementMatrix* Ke    = basalelement->NewElementMatrix(MLHOApproximationEnum);
+ 	ElementMatrix* KeSSA = CreateKMatrixSSAFriction(basalelement); //only to get K11 and K33
+ 	
+ 	/*Fetch number of nodes and dof for this finite element*/
+-	int numnodes = basalelement->GetNumberOfNodes();
++	//int numnodes = basalelement->GetNumberOfNodes();
+ 
+ 	for(int i=0;i<numnodes;i++){
+       for(int j=0;j<numnodes;j++){
+@@ -2775,7 +2857,11 @@
+          Ke->values[(4*i+2)*2*2*numnodes+4*j+2] = KeSSA->values[(2*i+1)*2*numnodes+2*j+1]; //K33
+       }  
+    }
+-	
++
++	KeSSA->Echo();
++	Ke->Echo();
++	_error_("mesh ");
++
+ 	/*Transform Coordinate System*/
+ 	//basalelement->TransformStiffnessMatrixCoord(Ke,XYMLHOEnum);
+ 
+@@ -2830,14 +2916,15 @@
+ 	while(gauss->next()){
+ 		gauss->SynchronizeGaussBase(gauss_base);
+ 
+-		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss_base);
+ 		basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
+-		element->NodalFunctions(basis, gauss);
++		basalelement->NodalFunctions(basis, gauss_base);
+ 
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		n_input->GetInputValue(&n,gauss);
++		//FIXME testing with L1L2-type viscosity
+ 		element->material->ViscosityL1L2(&viscosity,xyz_list,gauss,vx_input,vy_input,surface_input);
+-		//viscosity=10e10;//itapopo
++		//viscosity=10e13;//itapopo
+ 
+ 		for(int i=0;i<numnodes;i++){//shape functions on tria element
+ 			for(int j=0;j<numnodes;j++){
+@@ -3039,13 +3126,13 @@
+ 		surface_under_water = min(0.,thickness+base-sealevel); // 0 if the top of the glacier is above water level
+ 		base_under_water    = min(0.,base-sealevel);           // 0 if the bottom of the glacier is above water level
+ 		/*Vertically integrated pressure - SSA type*/
+-		water_pressure = 1.0/2.0*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
+-		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
++		water_pressure = (1.0/2.0)*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
++		ice_pressure   = (1.0/2.0)*gravity*rho_ice*thickness*thickness;
+ 		pressure = ice_pressure + water_pressure;
+ 		/*Vertically integrated pressure - HO type*/
+ 		b=min(0.,base-sealevel); // 0 if the bottom of the glacier is above water level
+ 		s=thickness+b; // ice surface regardless of whether the top of the glacier is above water level or not
+-		water_pressure_sh = gravity*rho_water*(-b*b/2 + pow(-b,n+2)*( -s/(n+2) -b/(n+3) )/pow(thickness,n+1));
++		water_pressure_sh = gravity*rho_water*( -b*b/2 + (pow(-b,n+2)/pow(thickness,n+1))*(-s/(n+2)-b/(n+3)) );
+ 		ice_pressure_sh   = gravity*rho_ice*thickness*thickness*(n+1)/(2*(n+3));
+ 		pressure_sh = ice_pressure_sh + water_pressure_sh;
+ 
+@@ -3130,10 +3217,10 @@
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+ 
+-	std::cout<<"********  Element ID="<<element->Id()<<"\n";
+-	for(i=0;i<numdof;i++){
+-		std::cout<<values[i]<<"\n";
+-	}
++	//std::cout<<"MLHO  ********  Element ID="<<element->Id()<<"\n";
++	//for(i=0;i<numdof;i++){
++	//	std::cout<<values[i]*31536000<<"\n";
++	//}
+ 
+ 	/*Transform solution in Cartesian Space*/
+ 	basalelement->TransformSolutionCoord(&values[0],XYEnum);
+@@ -3141,37 +3228,29 @@
+ 
+    /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+    for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+-      vx[i]  =values[i*4+0]; //basal vx
+-      vshx[i]=values[i*4+1];
++      vx[i]  =values[i*4+0]; //base vx
++      vshx[i]=values[i*4+1]; //shear vx
+ 		if(xIsNan<IssmDouble>(vx[i]))		_error_("NaN found in solution vector");
+       if(xIsInf<IssmDouble>(vx[i]))		_error_("Inf found in solution vector");
+ 		if(xIsNan<IssmDouble>(vshx[i]))	_error_("NaN found in solution vector");
+       if(xIsInf<IssmDouble>(vshx[i]))	_error_("Inf found in solution vector");
+-      //if(dim==3){
+-         vy[i] =values[i*4+2]; //basal vy
+-         vshy[i]=values[i*4+3];
+-         if(xIsNan<IssmDouble>(vy[i]))		_error_("NaN found in solution vector");
+-         if(xIsInf<IssmDouble>(vy[i]))		_error_("Inf found in solution vector");
+-         if(xIsNan<IssmDouble>(vshy[i]))	_error_("NaN found in solution vector");
+-         if(xIsInf<IssmDouble>(vshy[i]))	_error_("Inf found in solution vector");
+-      //}
+-   }
++		vy[i]  =values[i*4+2]; //base vy
++		vshy[i]=values[i*4+3]; //shear vy
++		if(xIsNan<IssmDouble>(vy[i]))		_error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(vy[i]))		_error_("Inf found in solution vector");
++		if(xIsNan<IssmDouble>(vshy[i]))	_error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(vshy[i]))	_error_("Inf found in solution vector");
++	}
+ 
+-	/*Add vx and vy as inputs to the tria element (basal velocities): */
+-	element->AddBasalInput(VxBaseEnum,vx,element->GetElementType());
+-	element->AddBasalInput(VyBaseEnum,vy,element->GetElementType());
++	/*Add vx and vy as inputs to the tria element (shear velocities): */
++	element->AddBasalInput(VxShearEnum,vshx,element->GetElementType());
++	element->AddBasalInput(VyShearEnum,vshy,element->GetElementType());
+ 
+-	/*Compute suface velocities vx and vy*/
+-	if(domaintype==Domain2DhorizontalEnum) {
+-		for(i=0;i<numnodes;i++) vx[i]=vx[i]+vshx[i];
+-		for(i=0;i<numnodes;i++) vy[i]=vy[i]+vshy[i];
+-	}
+-
+-	/*Get Vz and compute vel (surface)*/
++	/*Get Vz and compute vel (base)*/
+ 	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.);
+ 	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 
+ 
+-	/*Add vx and vy as inputs to the tria element surface velocities): */
++	/*Add vx and vy as inputs to the tria element (base velocities): */
+ 	element->AddBasalInput(VxEnum,vx,element->GetElementType());
+ 	element->AddBasalInput(VyEnum,vy,element->GetElementType());
+ 	element->AddBasalInput(VelEnum,vel,element->GetElementType());
+@@ -3190,7 +3269,7 @@
+ }/*}}}*/
+ void           StressbalanceAnalysis::GetSolutionFromInputsMLHO(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 
+-	IssmDouble   vx,vy,vbx,vby;
++	IssmDouble   vx,vy,vshx,vshy;
+ 	int          domaintype,dim,approximation,dofpernode;
+ 	int*         doflist = NULL;
+ 
+@@ -3214,13 +3293,9 @@
+ 
+ 	/*Get inputs*/
+ 	Input* vx_input		=element->GetInput(VxEnum);		_assert_(vx_input);
+-	Input* vxbase_input	=element->GetInput(VxBaseEnum);	_assert_(vxbase_input);
+-	Input* vy_input		=NULL;
+-	Input* vybase_input	=NULL;
+-	if(domaintype!=Domain2DverticalEnum){
+-		vy_input		=element->GetInput(VyEnum);		_assert_(vy_input);
+-		vybase_input=element->GetInput(VyBaseEnum);	_assert_(vybase_input);
+-	}
++	Input* vxshear_input	=element->GetInput(VxShearEnum);	_assert_(vxshear_input);
++	Input* vy_input		=element->GetInput(VyEnum);		_assert_(vy_input);
++	Input* vyshear_input	=element->GetInput(VyShearEnum);	_assert_(vyshear_input);
+ 
+ 	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+ 	Gauss* gauss=element->NewGauss();
+@@ -3228,16 +3303,14 @@
+ 		gauss->GaussNode(element->FiniteElement(),i);
+ 
+ 		/*Recover vx and vy*/
+-		vx_input->GetInputValue(&vx,gauss);
+-		vxbase_input->GetInputValue(&vbx,gauss);
+-		values[i*4+0]=vbx; //basal vx
+-		values[i*4+1]=vx-vbx; //shear vx
+-		//if(dofpernode==2){
+-			vy_input->GetInputValue(&vy,gauss);
+-			vybase_input->GetInputValue(&vby,gauss);
+-			values[i*4+2]=vby; //basal vy
+-			values[i*4+3]=vy-vby; //shear vy  
+-		//}
++		vx_input->GetInputValue(&vx,gauss);			//base vx
++		vxshear_input->GetInputValue(&vshx,gauss);//shear vx
++		values[i*4+0]=vx;   //base vx
++		values[i*4+1]=vshx; //shear vx
++		vy_input->GetInputValue(&vy,gauss);			//base vy
++		vyshear_input->GetInputValue(&vshy,gauss);//shear vy
++		values[i*4+2]=vy;		//base vy
++		values[i*4+3]=vshy;//shear vy  
+ 	}
+ 
+ 	solution->SetValues(numdof,doflist,values,INS_VAL);
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26191)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26192)
+@@ -934,15 +934,15 @@
+ syn keyword cConstant TransientAccumulatedDeltaIceThicknessEnum
+ syn keyword cConstant VelEnum
+ syn keyword cConstant VxAverageEnum
+-syn keyword cConstant VxBaseEnum
+ syn keyword cConstant VxEnum
+ syn keyword cConstant VxMeshEnum
+ syn keyword cConstant VxObsEnum
++syn keyword cConstant VxShearEnum
+ syn keyword cConstant VyAverageEnum
+-syn keyword cConstant VyBaseEnum
+ syn keyword cConstant VyEnum
+ syn keyword cConstant VyMeshEnum
+ syn keyword cConstant VyObsEnum
++syn keyword cConstant VyShearEnum
+ syn keyword cConstant VzEnum
+ syn keyword cConstant VzFSEnum
+ syn keyword cConstant VzHOEnum
+@@ -1450,6 +1450,7 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
++syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1456,8 +1457,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DatasetInput
+ syn keyword cType DataSetParam
+-syn keyword cType DatasetInput
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1470,8 +1471,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType Elements
+ syn keyword cType ElementVector
+-syn keyword cType Elements
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1478,11 +1479,12 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1497,6 +1499,7 @@
+ 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
+@@ -1507,6 +1510,7 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
++syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1519,8 +1523,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType Options
+ syn keyword cType OptionUtilities
+-syn keyword cType Options
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1534,13 +1538,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType Riftfront
+ syn keyword cType RiftStruct
+-syn keyword cType Riftfront
+ syn keyword cType SealevelMasks
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType Segment
+ syn keyword cType SegRef
+-syn keyword cType Segment
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1559,10 +1563,6 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26191)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26192)
+@@ -931,15 +931,15 @@
+ 	TransientAccumulatedDeltaIceThicknessEnum,
+ 	VelEnum,
+ 	VxAverageEnum,
+-	VxBaseEnum,
+ 	VxEnum,
+ 	VxMeshEnum,
+ 	VxObsEnum,
++	VxShearEnum,
+ 	VyAverageEnum,
+-	VyBaseEnum,
+ 	VyEnum,
+ 	VyMeshEnum,
+ 	VyObsEnum,
++	VyShearEnum,
+ 	VzEnum,
+ 	VzFSEnum,
+ 	VzHOEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26191)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26192)
+@@ -936,15 +936,15 @@
+ 		case TransientAccumulatedDeltaIceThicknessEnum : return "TransientAccumulatedDeltaIceThickness";
+ 		case VelEnum : return "Vel";
+ 		case VxAverageEnum : return "VxAverage";
+-		case VxBaseEnum : return "VxBase";
+ 		case VxEnum : return "Vx";
+ 		case VxMeshEnum : return "VxMesh";
+ 		case VxObsEnum : return "VxObs";
++		case VxShearEnum : return "VxShear";
+ 		case VyAverageEnum : return "VyAverage";
+-		case VyBaseEnum : return "VyBase";
+ 		case VyEnum : return "Vy";
+ 		case VyMeshEnum : return "VyMesh";
+ 		case VyObsEnum : return "VyObs";
++		case VyShearEnum : return "VyShear";
+ 		case VzEnum : return "Vz";
+ 		case VzFSEnum : return "VzFS";
+ 		case VzHOEnum : return "VzHO";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26191)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26192)
+@@ -957,15 +957,15 @@
+ 	      else if (strcmp(name,"TransientAccumulatedDeltaIceThickness")==0) return TransientAccumulatedDeltaIceThicknessEnum;
+ 	      else if (strcmp(name,"Vel")==0) return VelEnum;
+ 	      else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
+-	      else if (strcmp(name,"VxBase")==0) return VxBaseEnum;
+ 	      else if (strcmp(name,"Vx")==0) return VxEnum;
+ 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VxObs")==0) return VxObsEnum;
++	      else if (strcmp(name,"VxShear")==0) return VxShearEnum;
+ 	      else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
+-	      else if (strcmp(name,"VyBase")==0) return VyBaseEnum;
+ 	      else if (strcmp(name,"Vy")==0) return VyEnum;
+ 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+ 	      else if (strcmp(name,"VyObs")==0) return VyObsEnum;
++	      else if (strcmp(name,"VyShear")==0) return VyShearEnum;
+ 	      else if (strcmp(name,"Vz")==0) return VzEnum;
+ 	      else if (strcmp(name,"VzFS")==0) return VzFSEnum;
+ 	      else if (strcmp(name,"VzHO")==0) return VzHOEnum;
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26191)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26192)
+@@ -224,6 +224,10 @@
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'Vel'),
+ 		field = field*yts;
++	elseif strcmp(fieldname,'VxShear'),
++		field = field*yts;
++	elseif strcmp(fieldname,'VyShear'),
++		field = field*yts;
+ 	elseif strcmp(fieldname,'BasalforcingsGroundediceMeltingRate'),
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'BasalforcingsFloatingiceMeltingRate'),
Index: /issm/oecreview/Archive/25834-26739/ISSM-26192-26193.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26192-26193.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26192-26193.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26192)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26193)
+@@ -175,6 +175,10 @@
+             field = field * yts
+         elif fieldname == 'Vel':
+             field = field * yts
++        elif fieldname == 'VxShear':
++            field = field * yts
++        elif fieldname == 'VyShear':
++            field = field * yts
+         elif fieldname == 'BasalforcingsGroundediceMeltingRate':
+             field = field * yts
+         elif fieldname == 'BasalforcingsFloatingiceMeltingRate':
Index: /issm/oecreview/Archive/25834-26739/ISSM-26193-26194.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26193-26194.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26193-26194.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26193)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26194)
+@@ -3630,7 +3630,6 @@
+ 	IssmDouble accsumEC=0.0;
+ 	IssmDouble accsumP=0.0;
+ 	bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux;
+-	bool isclimatology=false;
+ 	bool isconstrainsurfaceT=false;
+ 	IssmDouble init_scaling=0.0;
+ 	IssmDouble thermo_scaling=1.0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26194-26195.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26194-26195.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26194-26195.diff	(revision 26740)
@@ -0,0 +1,286 @@
+Index: ../trunk-jpl/src/m/classes/timesteppingadaptive.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/timesteppingadaptive.js	(revision 26194)
++++ ../trunk-jpl/src/m/classes/timesteppingadaptive.js	(revision 26195)
+@@ -18,6 +18,7 @@
+ 
+ 		//should we interpolate forcings between timesteps?
+ 		this.interp_forcings=1;
++		this.cycle_forcing=0;
+ 	}// }}}
+ 	this.disp= function(){// {{{
+ 
+@@ -30,6 +31,7 @@
+ 		fielddisplay(this,'time_step_max','maximum length of time steps [' +unit+ ']');
+ 		fielddisplay(this,'cfl_coefficient','coefficient applied to cfl condition');
+ 		fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
++		fielddisplay(this,'cycle_forcing','cycle through forcing ? (0 or 1)');
+ 		fielddisplay(this,'coupling_time','coupling time steps with ocean model [' +unit+ ']');
+ 
+ 	}// }}}
+@@ -45,6 +47,7 @@
+ 		checkfield(md,'fieldname','timestepping.time_step_max','numel',[1],'>=',md.timestepping.time_step_max,'NaN',1,'Inf',1);
+ 		checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
+ 		checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]);
++		checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0,1]);
+ 		if (this.final_time-this.start_time<0){
+ 			md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
+ 		}
+@@ -62,6 +65,7 @@
+ 		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','time_step_max','format','Double','scale',scale);
+ 		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cfl_coefficient','format','Double');
+ 		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','interp_forcings','format','Boolean');
++		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','cycle_forcing','format','Boolean');
+ 		WriteData(fid,prefix,'object',this,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale);
+ 
+ 	}//}}}
+@@ -75,6 +79,7 @@
+ 	this.time_step_max   = 0.;
+ 	this.cfl_coefficient = 0.;
+ 	this.interp_forcings = 1;
++	this.cycle_forcing   = 0;
+ 	this.coupling_time   = 0.;
+ 
+ 	this.setdefaultparameters();
+Index: ../trunk-jpl/src/m/classes/timestepping.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.js	(revision 26194)
++++ ../trunk-jpl/src/m/classes/timestepping.js	(revision 26195)
+@@ -14,6 +14,7 @@
+ 
+ 		//should we interpolate forcings between timesteps?
+ 		this.interp_forcings=1;
++		this.cycle_forcing=0;
+ 	}// }}}
+ 	this.disp= function(){// {{{
+ 
+@@ -24,6 +25,7 @@
+ 		fielddisplay(this,'final_time','final time to stop the simulation ['+ unit + ']');
+ 		fielddisplay(this,'time_step','length of time steps [' +unit+ ']');
+ 		fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
++		fielddisplay(this,'cycle_forcing','cycle through forcing ? (0 or 1)');
+ 		fielddisplay(this,'coupling_time','length of coupling time steps with ocean model [' +unit+ ']');
+ 
+ 	}// }}}
+@@ -37,6 +39,7 @@
+ 		checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
+ 		checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 		checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]);
++		checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0,1]);
+ 		checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 		if (this.final_time-this.start_time<0){
+ 			md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
+@@ -52,6 +55,7 @@
+ 		WriteData(fid,prefix,'object',this,'fieldname','final_time','format','Double','scale',scale);
+ 		WriteData(fid,prefix,'object',this,'fieldname','time_step','format','Double','scale',scale);
+ 		WriteData(fid,prefix,'object',this,'fieldname','interp_forcings','format','Boolean');
++		WriteData(fid,prefix,'object',this,'fieldname','cycle_forcing','format','Boolean');
+ 		WriteData(fid,prefix,'object',this,'fieldname','coupling_time','format','Double','scale',scale);
+ 
+ 	}//}}}
+@@ -63,6 +67,7 @@
+ 	this.final_time      = 0.;
+ 	this.time_step       = 0.;
+ 	this.interp_forcings = 1;
++	this.cycle_forcing   = 0;
+ 	this.coupling_time   = 0.;
+ 
+ 	this.setdefaultparameters();
+Index: ../trunk-jpl/src/m/classes/timestepping.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.m	(revision 26194)
++++ ../trunk-jpl/src/m/classes/timestepping.m	(revision 26195)
+@@ -9,6 +9,7 @@
+ 		final_time      = 0.;
+ 		time_step       = 0.;
+ 		interp_forcings = 1;
++		cycle_forcing   = 0;
+ 		coupling_time   = 0.;
+ 	end
+ 	methods
+@@ -32,6 +33,7 @@
+ 
+ 			%should we interpolate forcings between timesteps?
+ 			self.interp_forcings=1;
++			self.cycle_forcing=0;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+@@ -39,6 +41,7 @@
+ 			md = checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]);
++			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
+ 			if self.final_time-self.start_time<0,
+ 				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
+ 			end 
+@@ -55,6 +58,7 @@
+ 			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
+ 			fielddisplay(self,'time_step',['length of time steps [' unit ']']);
+ 			fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
++			fielddisplay(self,'cycle_forcing','cycle through forcing ? (0 or 1)');
+ 			fielddisplay(self,'coupling_time',['length of coupling time step with ocean model  [' unit ']']);
+ 
+ 		end % }}}
+@@ -66,6 +70,7 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','final_time','format','Double','scale',scale);
+ 			WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',scale);
+ 			WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','cycle_forcing','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',scale);
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+@@ -74,6 +79,7 @@
+ 			writejsdouble(fid,[modelname '.timestepping.final_time'],self.final_time);
+ 			writejsdouble(fid,[modelname '.timestepping.time_step'],self.time_step);
+ 			writejsdouble(fid,[modelname '.timestepping.interp_forcings'],self.interp_forcings);
++			writejsdouble(fid,[modelname '.timestepping.cycle_forcing'],self.cycle_forcing);
+ 
+ 		end % }}}
+ 	end
+Index: ../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.py	(revision 26194)
++++ ../trunk-jpl/src/m/classes/timestepping.py	(revision 26195)
+@@ -16,6 +16,7 @@
+         self.final_time = 0.
+         self.time_step = 0.
+         self.interp_forcings = 1
++        self.cycle_forcing = 0
+         self.coupling_time = 0.
+ 
+     #set defaults
+@@ -29,6 +30,7 @@
+         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, "cycle_forcing", "cycle through forcing ? (0 or 1)"))
+         string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "length of coupling time steps with ocean model [yr]"))
+         return string
+     #}}}
+@@ -40,6 +42,7 @@
+         self.final_time = 10. * self.time_step
+         #should we interpolate forcings between timesteps?
+         self.interp_forcings = 1
++        self.cycle_forcing = 0
+ 
+         return self
+     #}}}
+@@ -53,6 +56,7 @@
+             md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
+             md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'timestepping.interp_forcings', 'numel', [1], 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
+ 
+         return md
+     # }}}
+@@ -65,5 +69,6 @@
+         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', 'cycle_forcing', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
+     # }}}
+Index: ../trunk-jpl/src/m/classes/timesteppingadaptive.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/timesteppingadaptive.m	(revision 26194)
++++ ../trunk-jpl/src/m/classes/timesteppingadaptive.m	(revision 26195)
+@@ -11,6 +11,7 @@
+ 		time_step_max   = 0.;
+ 		cfl_coefficient = 0.;
+ 		interp_forcings = 1;
++		cycle_forcing = 1;
+ 		coupling_time   = 0.;
+ 	end
+ 	methods
+@@ -38,6 +39,7 @@
+ 
+ 			%should we interpolate forcings between timesteps?
+ 			self.interp_forcings=1;
++			self.cycle_forcing=0;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+@@ -47,6 +49,7 @@
+ 			md = checkfield(md,'fieldname','timestepping.time_step_max','numel',[1],'>=',md.timestepping.time_step_min,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
+ 			md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]);
++			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',md.timestepping.coupling_time,'NaN',1,'Inf',1);
+ 			if self.final_time-self.start_time<0,
+ 				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
+@@ -62,6 +65,7 @@
+ 			fielddisplay(self,'time_step_max',['maximum length of time step [' unit ']']);
+ 			fielddisplay(self,'cfl_coefficient','coefficient applied to cfl condition');
+ 			fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
++			fielddisplay(self,'cycle_forcing','cycle through forcing ? (0 or 1)');
+ 			fielddisplay(self,'coupling_time',['coupling time step with ocean model [' unit ']']);
+ 
+ 		end % }}}
+@@ -75,6 +79,7 @@
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_max','format','Double','scale',scale);
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double');
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcings','format','Boolean');
++			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cycle_forcing','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale);
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+@@ -85,6 +90,7 @@
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.time_step_max'],self.time_step_max);
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.cfl_coefficient'],self.cfl_coefficient);
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcings'],self.interp_forcings);
++			writejsdouble(fid,[modelname '.timesteppingadaptive.cycle_forcing'],self.cycle_forcing);
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.coupling_time'],self.time_step_max);
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/timesteppingadaptive.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/timesteppingadaptive.py	(revision 26194)
++++ ../trunk-jpl/src/m/classes/timesteppingadaptive.py	(revision 26195)
+@@ -19,6 +19,7 @@
+             self.time_step_max = 0.
+             self.cfl_coefficient = 0.
+             self.interp_forcings = 1
++            self.cycle_forcing = 0
+             self.coupling_time = 0.
+ 
+             #set defaults
+@@ -31,6 +32,7 @@
+             self.start_time = old.start_time
+             self.final_time = old.final_time
+             self.interp_forcings = old.interp_forcings
++            self.cycle_forcing = old.cycle_forcing
+             self.coupling_time = old.coupling_time
+ 
+         else:
+@@ -45,6 +47,7 @@
+         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, "cycle_forcing", "cycle through forcing ? (0 or 1)"))
+         string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "coupling time steps with ocean model [yr]"))
+         return string
+     # }}}
+@@ -59,6 +62,7 @@
+         self.cfl_coefficient = 0.5
+         #should we interpolate forcings between timesteps?
+         self.interp_forcings = 1
++        self.cycle_forcing   = 0
+         return self
+     #}}}
+ 
+@@ -71,6 +75,7 @@
+         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.cycle_forcing', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+ 
+         return md
+@@ -85,5 +90,6 @@
+         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'time_step_max', 'format', 'Double', 'scale', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cfl_coefficient', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'interp_forcings', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cycle_forcing', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
+     # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26195-26196.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26195-26196.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26195-26196.diff	(revision 26740)
@@ -0,0 +1,555 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.h	(revision 26195)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.h	(revision 26196)
+@@ -17,14 +17,14 @@
+ 		int     numberofvertices_local;
+ 
+ 	public:
+-		int         enum_type;
+-		int         numtimesteps;
+-		Input**    inputs;
+-		IssmDouble *timesteps;
+-		Parameters *parameters;     //to find current time.
++		int          enum_type;
++		int          numtimesteps;
++		Input      **inputs;
++		IssmDouble  *timesteps;
++		Parameters  *parameters;      //to find current time.
+ 
+-		IssmDouble  current_step;
+-		Input*     current_input;
++		IssmDouble   current_step;
++		Input       *current_input;
+ 
+ 		/*TransientInput constructors, destructors: {{{*/
+ 		TransientInput();
+Index: ../trunk-jpl/src/c/classes/Params/TransientArrayParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/TransientArrayParam.cpp	(revision 26195)
++++ ../trunk-jpl/src/c/classes/Params/TransientArrayParam.cpp	(revision 26196)
+@@ -19,7 +19,7 @@
+ 	return;
+ }
+ /*}}}*/
+-TransientArrayParam::TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N,int in_M){/*{{{*/
++TransientArrayParam::TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,bool cycle_in,int in_N,int in_M){/*{{{*/
+ 
+ 	_assert_(in_values && in_time);
+ 
+@@ -27,12 +27,13 @@
+ 	this->M=in_M; //Number of rows
+ 	this->N=in_N; //Number of timesteps
+ 	this->interpolation=interpolation_on;
++	this->cycle=cycle_in;
+ 
+ 	this->values=xNew<IssmDouble>(M*N);
+-	xMemCpy<IssmDouble>(values,in_values,M*N);
++	xMemCpy<IssmDouble>(this->values,in_values,M*N);
+ 
+ 	this->timesteps=xNew<IssmDouble>(N);
+-	xMemCpy<IssmDouble>(timesteps,in_time,N);
++	xMemCpy<IssmDouble>(this->timesteps,in_time,N);
+ }
+ /*}}}*/
+ TransientArrayParam::~TransientArrayParam(){/*{{{*/
+@@ -43,7 +44,7 @@
+ /*Object virtual functions definitions:*/
+ Param* TransientArrayParam::copy() {/*{{{*/
+ 
+-	return new TransientArrayParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->M,this->N);
++	return new TransientArrayParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->cycle,this->M,this->N);
+ 
+ }
+ /*}}}*/
+@@ -79,6 +80,7 @@
+ 
+ 	marshallhandle->call(this->enum_type);
+ 	marshallhandle->call(this->interpolation);
++	marshallhandle->call(this->cycle);
+ 	marshallhandle->call(this->M);
+ 	marshallhandle->call(this->N);
+ 	if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
+@@ -102,6 +104,8 @@
+ 	bool       found;
+ 	_assert_(row>=0 && row<this->M); 
+ 
++	if(this->cycle) _error_("not implemented yet");
++
+ 	/*Ok, we have the time and row, go through the timesteps, and figure out which interval we 
+ 	 *fall within. Then interpolate the values on this interval: */
+ 	if(time<this->timesteps[0]){
+@@ -128,7 +132,7 @@
+ 					/*ok, we have the interval [i:i+1]. Interpolate linearly for now: */
+ 					IssmDouble deltat = this->timesteps[i+1]-this->timesteps[i];
+ 					IssmDouble alpha  = (time-this->timesteps[i])/deltat;
+-					if(interpolation==true) output=(1.0-alpha)*this->values[row*this->N+i] + alpha*this->values[row*this->N+i+1];
++					if(this->interpolation==true) output=(1.0-alpha)*this->values[row*this->N+i] + alpha*this->values[row*this->N+i+1];
+ 					else output=this->values[row*this->N+i];
+ 					found=true;
+ 					break;
+Index: ../trunk-jpl/src/c/classes/Params/TransientArrayParam.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/TransientArrayParam.h	(revision 26195)
++++ ../trunk-jpl/src/c/classes/Params/TransientArrayParam.h	(revision 26196)
+@@ -24,6 +24,7 @@
+ 		int         N;
+ 		int         M;
+ 		bool        interpolation;
++		bool        cycle;
+ 		IssmDouble *values;
+ 		IssmDouble *timesteps;
+ 
+@@ -30,7 +31,7 @@
+ 	public:
+ 		/*TransientArrayParam constructors, destructors: {{{*/
+ 		TransientArrayParam();
+-		TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N,int in_M);
++		TransientArrayParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,bool cycle_in,int in_N,int in_M);
+ 		~TransientArrayParam();
+ 		/*}}}*/
+ 		/*Object virtual functions definitions:{{{ */
+Index: ../trunk-jpl/src/c/classes/Params/TransientParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/TransientParam.cpp	(revision 26195)
++++ ../trunk-jpl/src/c/classes/Params/TransientParam.cpp	(revision 26196)
+@@ -19,19 +19,20 @@
+ 	return;
+ }
+ /*}}}*/
+-TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N){/*{{{*/
++TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,bool cycle_in,int in_N){/*{{{*/
+ 
+ 	_assert_(in_values && in_time);
+ 
+-	enum_type=in_enum_type;
+-	N=in_N;
+-	interpolation=interpolation_on;
++	this->enum_type=in_enum_type;
++	this->N=in_N;
++	this->interpolation=interpolation_on;
++	this->cycle=cycle_in;
+ 
+-	values=xNew<IssmDouble>(N);
+-	xMemCpy<IssmDouble>(values,in_values,N);
++	this->values=xNew<IssmDouble>(N);
++	xMemCpy<IssmDouble>(this->values,in_values,N);
+ 
+-	timesteps=xNew<IssmDouble>(N);
+-	xMemCpy<IssmDouble>(timesteps,in_time,N);
++	this->timesteps=xNew<IssmDouble>(N);
++	xMemCpy<IssmDouble>(this->timesteps,in_time,N);
+ }
+ /*}}}*/
+ TransientParam::~TransientParam(){/*{{{*/
+@@ -43,7 +44,7 @@
+ /*Object virtual functions definitions:*/
+ Param* TransientParam::copy() {/*{{{*/
+ 
+-	return new TransientParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->N);
++	return new TransientParam(this->enum_type,this->values,this->timesteps,this->interpolation,this->cycle,this->N);
+ 
+ }
+ /*}}}*/
+@@ -74,6 +75,7 @@
+ 
+ 	marshallhandle->call(this->enum_type);
+ 	marshallhandle->call(this->interpolation);
++	marshallhandle->call(this->cycle);
+ 	marshallhandle->call(this->N);
+ 	if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
+ 		values=xNew<IssmDouble>(N);
+@@ -97,6 +99,8 @@
+ 	IssmDouble output;
+ 	bool   found;
+ 
++	if(this->cycle) _error_("not implemented yet!");
++
+ 	/*Ok, we have the time, go through the timesteps, and figure out which interval we 
+ 	 *fall within. Then interpolate the values on this interval: */
+ 	if(time<this->timesteps[0]){
+@@ -123,7 +127,7 @@
+ 					/*ok, we have the interval ]i:i+1[. Interpolate linearly for now: */
+ 					IssmDouble deltat=this->timesteps[i+1]-this->timesteps[i];
+ 					IssmDouble alpha=(time-this->timesteps[i])/deltat;
+-					if(interpolation==true) output=(1.0-alpha)*this->values[i] + alpha*this->values[i+1];
++					if(this->interpolation==true) output=(1.0-alpha)*this->values[i] + alpha*this->values[i+1];
+ 					else output=this->values[i];
+ 					found=true;
+ 					break;
+Index: ../trunk-jpl/src/c/classes/Params/TransientParam.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/TransientParam.h	(revision 26195)
++++ ../trunk-jpl/src/c/classes/Params/TransientParam.h	(revision 26196)
+@@ -23,6 +23,7 @@
+ 		int         enum_type;
+ 		int         N;
+ 		bool        interpolation;
++		bool        cycle;
+ 		IssmDouble *values;
+ 		IssmDouble *timesteps;
+ 
+@@ -29,7 +30,7 @@
+ 	public:
+ 		/*TransientParam constructors, destructors: {{{*/
+ 		TransientParam();
+-		TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_on,int in_N);
++		TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,bool interpolation_in,bool cycle_in,int in_N);
+ 		~TransientParam();
+ 		/*}}}*/
+ 		/*Object virtual functions definitions:{{{ */
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26195)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26196)
+@@ -217,7 +217,7 @@
+ 
+ 	int     numoutputs;
+ 	char**  requestedoutputs = NULL;
+-	bool    isdelta18o,ismungsm,isd18opd,issetpddfac,interp,isfirnwarming;
++	bool    isdelta18o,ismungsm,isd18opd,issetpddfac,interp,cycle,isfirnwarming;
+ 	int     smb_model, smbslices, averaging;
+ 	IssmDouble *temp = NULL;
+ 	int         N,M;
+@@ -226,6 +226,7 @@
+ 
+ 	iomodel->FindConstant(&smb_model,"md.smb.model");
+ 	iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
++	iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
+ 
+ 	iomodel->FindConstant(&smbslices,"md.smb.steps_per_step");
+ 	parameters->AddObject(new IntParam(SmbStepsPerStepEnum,smbslices));
+@@ -272,24 +273,24 @@
+ 
+ 			if(ismungsm){
+ 			  iomodel->FetchData(&temp,&N,&M,"md.smb.Pfac"); _assert_(N==2);
+-			  parameters->AddObject(new TransientParam(SmbPfacEnum,&temp[0],&temp[M],interp,M));
++			  parameters->AddObject(new TransientParam(SmbPfacEnum,&temp[0],&temp[M],interp,cycle,M));
+ 			  iomodel->DeleteData(temp,"md.smb.Pfac");
+ 
+ 			  iomodel->FetchData(&temp,&N,&M,"md.smb.Tdiff"); _assert_(N==2);
+-			  parameters->AddObject(new TransientParam(SmbTdiffEnum,&temp[0],&temp[M],interp,M));
++			  parameters->AddObject(new TransientParam(SmbTdiffEnum,&temp[0],&temp[M],interp,cycle,M));
+ 			  iomodel->DeleteData(temp,"md.smb.Tdiff");
+ 
+ 			  iomodel->FetchData(&temp,&N,&M,"md.smb.sealev"); _assert_(N==2);
+-			  parameters->AddObject(new TransientParam(SmbSealevEnum,&temp[0],&temp[M],interp,M));
++			  parameters->AddObject(new TransientParam(SmbSealevEnum,&temp[0],&temp[M],interp,cycle,M));
+ 			  iomodel->DeleteData(temp,"md.smb.sealev");
+ 			}
+ 			if(isdelta18o){
+ 				iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o"); _assert_(N==2);
+-				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,M));
++				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,cycle,M));
+ 				iomodel->DeleteData(temp,"md.smb.delta18o");
+ 
+ 				iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o_surface"); _assert_(N==2);
+-				parameters->AddObject(new TransientParam(SmbDelta18oSurfaceEnum,&temp[0],&temp[M],interp,M));
++				parameters->AddObject(new TransientParam(SmbDelta18oSurfaceEnum,&temp[0],&temp[M],interp,cycle,M));
+ 				iomodel->DeleteData(temp,"md.smb.delta18o_surface");
+ 			}
+ 
+@@ -309,7 +310,7 @@
+ 				parameters->AddObject(iomodel->CopyConstantObject("md.smb.istemperaturescaled",SmbIstemperaturescaledEnum));
+ 				parameters->AddObject(iomodel->CopyConstantObject("md.smb.isprecipscaled",SmbIsprecipscaledEnum));
+ 				iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o"); _assert_(N==2);
+-				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,M));
++				parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,cycle,M));
+ 				iomodel->DeleteData(temp,"md.smb.delta18o");
+ 
+ 				IssmDouble yts;
+@@ -390,17 +391,17 @@
+ 				parameters->AddObject(iomodel->CopyConstantObject("md.smb.runoffalti",SmbRunoffaltiEnum));
+ 
+ 				iomodel->FetchData(&temp,&N,&M,"md.smb.accugrad"); _assert_(N==2);
+-				parameters->AddObject(new TransientParam(SmbAccugradEnum,&temp[0],&temp[M],interp,M));
++				parameters->AddObject(new TransientParam(SmbAccugradEnum,&temp[0],&temp[M],interp,cycle,M));
+ 				iomodel->DeleteData(temp,"md.smb.accugrad");
+ 				iomodel->FetchData(&temp,&N,&M,"md.smb.runoffgrad"); _assert_(N==2);
+-				parameters->AddObject(new TransientParam(SmbRunoffgradEnum,&temp[0],&temp[M],interp,M));
++				parameters->AddObject(new TransientParam(SmbRunoffgradEnum,&temp[0],&temp[M],interp,cycle,M));
+ 				iomodel->DeleteData(temp,"md.smb.runoffgrad");
+ 
+ 				iomodel->FetchData(&temp,&N,&M,"md.smb.accuref"); _assert_(N==2);
+-				parameters->AddObject(new TransientParam(SmbAccurefEnum,&temp[0],&temp[M],interp,M));
++				parameters->AddObject(new TransientParam(SmbAccurefEnum,&temp[0],&temp[M],interp,cycle,M));
+ 				iomodel->DeleteData(temp,"md.smb.accuref");
+ 				iomodel->FetchData(&temp,&N,&M,"md.smb.runoffref"); _assert_(N==2);
+-				parameters->AddObject(new TransientParam(SmbRunoffrefEnum,&temp[0],&temp[M],interp,M));
++				parameters->AddObject(new TransientParam(SmbRunoffrefEnum,&temp[0],&temp[M],interp,cycle,M));
+ 				iomodel->DeleteData(temp,"md.smb.runoffref");
+ 			break;
+ 		case SMBsemicEnum:
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26195)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26196)
+@@ -415,9 +415,12 @@
+ void TransientInput::SetCurrentTimeInput(IssmDouble time){/*{{{*/
+ 
+ 	/*First, recover current time from parameters: */
+-	bool linear_interp;
++	bool linear_interp,cycle;
+ 	this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum);
++	this->parameters->FindParam(&cycle,TimesteppingCycleForcingEnum);
+ 
++	if(cycle) _error_("not implemented yet");
++
+ 	/*Figure step out*/
+ 	int offset;
+ 	if(!binary_search(&offset,time,this->timesteps,this->numtimesteps)){
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26195)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26196)
+@@ -29,7 +29,7 @@
+ 	bool         qmu_mass_flux_present      = false;
+ 	bool         autodiff_mass_flux_present = false;
+ 	bool         mass_flux_present          = false;
+-	bool         interp;
++	bool         interp,cycle;
+ 	IssmDouble **array                      = NULL;
+ 	int         *mdims_array                = NULL;
+ 	int         *ndims_array                = NULL;
+@@ -159,6 +159,7 @@
+ 			break;
+ 		case LinearFloatingMeltRateEnum:
+ 			iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
++			iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
+ 			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.deepwater_melting_rate");
+ 			if(N==1){
+ 				_assert_(M==1);
+@@ -166,7 +167,7 @@
+ 			}
+ 			else{
+ 				_assert_(N==2);
+-				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,M));
++				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,cycle,M));
+ 			}
+ 			xDelete<IssmDouble>(transparam);
+ 			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.upperwater_melting_rate");
+@@ -176,7 +177,7 @@
+ 			}
+ 			else{
+ 				_assert_(N==2);
+-				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,M));
++				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,cycle,M));
+ 			}
+ 			xDelete<IssmDouble>(transparam);
+ 			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.deepwater_elevation");
+@@ -186,7 +187,7 @@
+ 			}
+ 			else{
+ 				_assert_(N==2);
+-				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterElevationEnum,&transparam[0],&transparam[M],interp,M));
++				parameters->AddObject(new TransientParam(BasalforcingsDeepwaterElevationEnum,&transparam[0],&transparam[M],interp,cycle,M));
+ 			}
+ 			xDelete<IssmDouble>(transparam);
+ 			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.upperwater_elevation");
+@@ -196,7 +197,7 @@
+ 			}
+ 			else{
+ 				_assert_(N==2);
+-				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterElevationEnum,&transparam[0],&transparam[M],interp,M));
++				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterElevationEnum,&transparam[0],&transparam[M],interp,cycle,M));
+ 			}
+ 			xDelete<IssmDouble>(transparam);
+ 			break;
+@@ -223,6 +224,7 @@
+ 			break;
+ 		case BasalforcingsPicoEnum:
+ 			iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
++			iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsPicoNumBasinsEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.maxboxcount",BasalforcingsPicoMaxboxcountEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.gamma_T",BasalforcingsPicoGammaTEnum));
+@@ -229,11 +231,11 @@
+ 			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));
++			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceantemperatureEnum,transparam,&transparam[N*(M-1)],interp,cycle,N,M));
+ 			xDelete<IssmDouble>(transparam);
+ 			iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.farocean_salinity");
+ 			_assert_(M>=1 && N>=1);
+-			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceansalinityEnum,transparam,&transparam[N*(M-1)],interp,N,M));
++			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceansalinityEnum,transparam,&transparam[N*(M-1)],interp,cycle,N,M));
+ 			xDelete<IssmDouble>(transparam);
+ 			break;
+ 		case BasalforcingsIsmip6Enum:
+@@ -265,6 +267,7 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.final_time",TimesteppingFinalTimeEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step",TimesteppingTimeStepEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcings",TimesteppingInterpForcingsEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cycle_forcing",TimesteppingCycleForcingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.coupling_time",TimesteppingCouplingTimeEnum));
+ 			break;
+ 		case AdaptiveTimesteppingEnum:
+@@ -274,6 +277,7 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step_max",TimesteppingTimeStepMaxEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cfl_coefficient",TimesteppingCflCoefficientEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcings",TimesteppingInterpForcingsEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cycle_forcing",TimesteppingCycleForcingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.coupling_time",TimesteppingCouplingTimeEnum));
+ 			break;
+ 		default:
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26195)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26196)
+@@ -477,6 +477,7 @@
+ syn keyword cConstant TimesteppingCouplingTimeEnum
+ syn keyword cConstant TimesteppingFinalTimeEnum
+ syn keyword cConstant TimesteppingInterpForcingsEnum
++syn keyword cConstant TimesteppingCycleForcingEnum
+ syn keyword cConstant TimesteppingStartTimeEnum
+ syn keyword cConstant TimesteppingTimeStepEnum
+ syn keyword cConstant TimesteppingTimeStepMaxEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26195)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26196)
+@@ -471,6 +471,7 @@
+ 	TimesteppingCouplingTimeEnum,
+ 	TimesteppingFinalTimeEnum,
+ 	TimesteppingInterpForcingsEnum,
++	TimesteppingCycleForcingEnum,
+ 	TimesteppingStartTimeEnum,
+ 	TimesteppingTimeStepEnum,
+ 	TimesteppingTimeStepMaxEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26195)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26196)
+@@ -479,6 +479,7 @@
+ 		case TimesteppingCouplingTimeEnum : return "TimesteppingCouplingTime";
+ 		case TimesteppingFinalTimeEnum : return "TimesteppingFinalTime";
+ 		case TimesteppingInterpForcingsEnum : return "TimesteppingInterpForcings";
++		case TimesteppingCycleForcingEnum : return "TimesteppingCycleForcing";
+ 		case TimesteppingStartTimeEnum : return "TimesteppingStartTime";
+ 		case TimesteppingTimeStepEnum : return "TimesteppingTimeStep";
+ 		case TimesteppingTimeStepMaxEnum : return "TimesteppingTimeStepMax";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26195)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26196)
+@@ -488,6 +488,7 @@
+ 	      else if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingInterpForcings")==0) return TimesteppingInterpForcingsEnum;
++	      else if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
+ 	      else if (strcmp(name,"TimesteppingStartTime")==0) return TimesteppingStartTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
+ 	      else if (strcmp(name,"TimesteppingTimeStepMax")==0) return TimesteppingTimeStepMaxEnum;
+@@ -504,11 +505,11 @@
+ 	      else if (strcmp(name,"TransientIsgia")==0) return TransientIsgiaEnum;
+ 	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+ 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+-	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
++	      if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
++	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+ 	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+@@ -627,11 +628,11 @@
+ 	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+ 	      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 stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"EplHeadSlopeY")==0) return EplHeadSlopeYEnum;
++	      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,"EsaEmotion")==0) return EsaEmotionEnum;
+@@ -750,11 +751,11 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"RheologyBAbsGradient")==0) return RheologyBAbsGradientEnum;
++	      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;
+@@ -873,11 +874,11 @@
+ 	      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 if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
++	      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;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+ 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+-	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
++	      if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
++	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+ 	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+ 	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+@@ -1119,11 +1120,11 @@
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Cfdragcoeffabsgrad")==0) return CfdragcoeffabsgradEnum;
++	      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;
+@@ -1242,11 +1243,11 @@
+ 	      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,"Inputs")==0) return InputsEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"Internal")==0) return InternalEnum;
++	      if (strcmp(name,"Inputs")==0) return InputsEnum;
++	      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;
+@@ -1365,11 +1366,11 @@
+ 	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
++	      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;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26196-26197.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26196-26197.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26196-26197.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26196)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26197)
+@@ -419,8 +419,22 @@
+ 	this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum);
+ 	this->parameters->FindParam(&cycle,TimesteppingCycleForcingEnum);
+ 
+-	if(cycle) _error_("not implemented yet");
++	/*Change input time if we cycle through the forcing*/
++	IssmDouble time0 = this->timesteps[0];
++	IssmDouble time1 = this->timesteps[this->numtimesteps - 1];
++	if(cycle && (time<time0 || time>time1)){
+ 
++		/*See by how many intervals we have to offset time*/
++		IssmDouble deltat = time1-time0;
++
++		//int num_intervals = floor((time-time0)/deltat); //Cannot do that because of AD!
++		int num_intervals = reCast<int,IssmDouble>(fabs(time-time0)/deltat);
++		if(time<time0) num_intervals = -num_intervals-1;
++
++		/*Now offset time so that we do the right interpolation below*/
++		time = time - num_intervals*deltat;
++	}
++
+ 	/*Figure step out*/
+ 	int offset;
+ 	if(!binary_search(&offset,time,this->timesteps,this->numtimesteps)){
+@@ -479,7 +493,6 @@
+ 		this->current_input->Scale(alpha1);
+ 		this->current_input->AXPY(input2,alpha2);
+ 	}
+-
+ }/*}}}*/
+ void TransientInput::SetAverageAsCurrentTimeInput(IssmDouble start_time,IssmDouble end_time, int averaging_method){/*{{{*/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26197-26198.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26197-26198.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26197-26198.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test493.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test493.m	(revision 26197)
++++ ../trunk-jpl/test/NightlyRun/test493.m	(revision 26198)
+@@ -28,7 +28,7 @@
+ field_tolerances={...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+-	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++	2e-13,2e-13,2e-13,1e-13,1e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
+ };
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test493.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test493.py	(revision 26197)
++++ ../trunk-jpl/test/NightlyRun/test493.py	(revision 26198)
+@@ -39,7 +39,7 @@
+ field_tolerances = [
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26198-26199.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26198-26199.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26198-26199.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26198)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26199)
+@@ -429,10 +429,16 @@
+ 
+ 		//int num_intervals = floor((time-time0)/deltat); //Cannot do that because of AD!
+ 		int num_intervals = reCast<int,IssmDouble>(fabs(time-time0)/deltat);
+-		if(time<time0) num_intervals = -num_intervals-1;
+-
+-		/*Now offset time so that we do the right interpolation below*/
+-		time = time - num_intervals*deltat;
++		//if(time<time0) num_intervals = -num_intervals-1;
++		
++		if(fabs(time-time0)/deltat == reCast<IssmDouble>(num_intervals)){
++			/*Hack to make sure we always cover the last value of the series (discussion with Nicole)*/
++			time = time1;
++		}
++		else{
++			/*Now offset time so that we do the right interpolation below*/
++			time = time - num_intervals*deltat;
++		}
+ 	}
+ 
+ 	/*Figure step out*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26199-26200.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26199-26200.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26199-26200.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26199)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26200)
+@@ -429,6 +429,8 @@
+ 
+ 		//int num_intervals = floor((time-time0)/deltat); //Cannot do that because of AD!
+ 		int num_intervals = reCast<int,IssmDouble>(fabs(time-time0)/deltat);
++
++		/*Uncomment following line if you would like to apply a cycle BEFORE the time series starts*/
+ 		//if(time<time0) num_intervals = -num_intervals-1;
+ 		
+ 		if(fabs(time-time0)/deltat == reCast<IssmDouble>(num_intervals)){
Index: /issm/oecreview/Archive/25834-26739/ISSM-26200-26201.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26200-26201.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26200-26201.diff	(revision 26740)
@@ -0,0 +1,253 @@
+Index: ../trunk-jpl/src/mobile/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/mobile/Makefile.am	(revision 26200)
++++ ../trunk-jpl/src/mobile/Makefile.am	(nonexistent)
+@@ -1,3 +0,0 @@
+-if ANDROID
+-SUBDIRS = native
+-endif
+Index: ../trunk-jpl/src/mobile/native/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/mobile/native/Makefile.am	(revision 26200)
++++ ../trunk-jpl/src/mobile/native/Makefile.am	(nonexistent)
+@@ -1,7 +0,0 @@
+-#Generate JNI library
+-lib_LTLIBRARIES = libIssmJni.la
+-
+-libIssmJni_la_SOURCES = Main.cpp
+-libIssmJni_la_LIBADD = $(ISSM_DIR)/src/c/libISSMCore.a $(ISSM_DIR)/externalpackages/gsl/install/lib/libgsl.a $(ISSM_DIR)/externalpackages/gsl/install/lib/libgslcblas.a
+-
+-AM_LDFLAGS = -llog
+Index: ../trunk-jpl/src/mobile/native/Main.cpp
+===================================================================
+--- ../trunk-jpl/src/mobile/native/Main.cpp	(revision 26200)
++++ ../trunk-jpl/src/mobile/native/Main.cpp	(nonexistent)
+@@ -1,197 +0,0 @@
+-#include "../../c/main/issm.h"
+-#include <cstddef>
+-#include <stdio.h>
+-
+-//Android specific header includes: 
+-#include <jni.h>
+-#include <android/log.h>
+-#include <android/log.h>
+-
+-//iOS specific header includes: 
+-
+-namespace gov_nasa_jpl_issm
+-{
+-	/*Global variables{{{*/
+-	FemModel *fm;
+-	double* xyz; /*keep vertices information here*/
+-	/*}}}*/
+-	jint Initialize(JNIEnv *env, jclass clazz, jstring jsolution_type, jstring jabsfile, jstring jrelfile) /*{{{*/
+-	{
+-		
+-		/*arguments to constructor: */
+-		int argc; //arguments to constructor.
+-		char** argv = NULL;
+-		const char* issmname = "issm.exe";
+-		char *solution_type = NULL;
+-		char *absfile = NULL;
+-		char *relfile = NULL;
+-		ISSM_MPI_Comm    comm=1;
+-
+-		/*log:*/
+-		__android_log_print(ANDROID_LOG_INFO, "Native","Initializing FemModel");
+-
+-		/*retrieve from java machine: */
+-		solution_type = (char*)env->GetStringUTFChars(jsolution_type,0);
+-		absfile = (char*)env->GetStringUTFChars(jabsfile,0);
+-		relfile = (char*)env->GetStringUTFChars(jrelfile,0);
+-
+-		/*creat arguments to call constructor for FemModel: */
+-		argc=4; 
+-		argv=(char**)malloc(argc*sizeof(char*));
+-		argv[0]=(char*)issmname;
+-		argv[1]=solution_type;
+-		argv[2]=absfile;
+-		argv[3]=relfile;
+-		
+-		/*call Model constructor passing in infile as File Descriptor parameter.*/
+-		fm  = new FemModel(argc,argv,comm);
+-
+-		/*we'll need the toolkits activated right away to use matrices: */
+-		ToolkitsOptionsFromAnalysis(fm->parameters,NoneAnalysisEnum);
+-
+-		/*release strings: */
+-		env->ReleaseStringUTFChars(jsolution_type, solution_type); //must realease the char*
+-		env->ReleaseStringUTFChars(jabsfile, absfile); //must realease the char*
+-		env->ReleaseStringUTFChars(jrelfile, relfile); //must realease the char*
+-
+-		/*figure out size of solution: */
+-		__android_log_print(ANDROID_LOG_INFO, "Native","Number of elements");
+-		jint size = (jint) fm->elements->NumberOfElements();
+-
+-		/*retrieve vertices x,y and z coordinates: */
+-		__android_log_print(ANDROID_LOG_INFO, "Native","Retrieving vertices");
+-		xyz=fm->vertices->ToXYZ();
+-		
+-		/*log: */
+-		__android_log_print(ANDROID_LOG_INFO, "Native","Done Initializing FemModel");
+-
+-		return size;
+-
+-	}
+-	/*}}}*/
+-	void Solve(JNIEnv *env, jclass clazz , jdouble alpha, jobject buf){ /*{{{*/
+-
+-		int i,count;
+-		double x1,y1,z1,vel1;
+-		double x2,y2,z2,vel2;
+-		double x3,y3,z3,vel3;
+-		int    v1,v2,v3,eid;
+-		Patch* patch=NULL;
+-		
+-		/*log:*/
+-		__android_log_print(ANDROID_LOG_INFO, "Native","Solving ");
+-
+-		/*retrieve buffer: */
+-		jdouble *dBuf = (jdouble *)env->GetDirectBufferAddress(buf);
+-
+-		/*reset basal friction to what it was before: */
+-		__android_log_print(ANDROID_LOG_INFO, "Native","alpha %g ",alpha);
+-		
+-		__android_log_print(ANDROID_LOG_INFO, "Native","ok-1");
+-
+-		InputDuplicatex(fm->elements,fm->nodes,fm->vertices,fm->loads,fm->materials,fm->parameters,AndroidFrictionCoefficientEnum,FrictionCoefficientEnum);
+-		__android_log_print(ANDROID_LOG_INFO, "Native","ok0");
+-
+-		/*now scale friction by alpha: */
+-		InputScalex(fm->elements,fm->nodes,fm->vertices,fm->loads,fm->materials,fm->parameters,FrictionCoefficientEnum,alpha/100);
+-		__android_log_print(ANDROID_LOG_INFO, "Native","ok1");
+-
+-		/*solve: */
+-		fm -> Solve();
+-		__android_log_print(ANDROID_LOG_INFO, "Native","ok2");
+-
+-		/*retrieve results: */
+-		__android_log_print(ANDROID_LOG_INFO, "Native","Retrieving results ");
+-		//fm->elements->ProcessResultsUnits(); we are now in SI units
+-		patch=fm->elements->ResultsToPatch();
+-
+-		/*sort out the velocities: */
+-		for(i=0;i<patch->numrows;i++){
+-			if ((patch->values[i*patch->numcols+0])==VelEnum){
+-
+-				/*Each row of the Patch object is made of the following information: 
+-				  - the result enum_type, 
+-				  - the step and time, 
+-				  - the id of the element, 
+-				  - the interpolation type, 
+-				  - the vertices ids, 
+-				  - and the values at the nodes (could be different from the vertices)
+-				*/
+-				eid=(int)patch->values[i*patch->numcols+3]-1;
+-				v1=(int)patch->values[i*patch->numcols+5]; 
+-				x1=xyz[3*(v1-1)+0]; y1=xyz[3*(v1-1)+1]; z1=xyz[3*(v1-1)+2];
+-				
+-				v2=(int)patch->values[i*patch->numcols+6];
+-				x2=xyz[3*(v2-1)+0]; y2=xyz[3*(v2-1)+1]; z2=xyz[3*(v2-1)+2];
+-				
+-				v3=(int)patch->values[i*patch->numcols+7];
+-				x3=xyz[3*(v3-1)+0]; y3=xyz[3*(v3-1)+1]; z3=xyz[3*(v3-1)+2];
+-
+-				vel1=patch->values[i*patch->numcols+8]; 
+-				vel2=patch->values[i*patch->numcols+9]; 
+-				vel3=patch->values[i*patch->numcols+10]; 
+-
+-				/*plug into dBuf: */
+-				/*vertex 1: */
+-				dBuf[12*eid+0]=x1;
+-				dBuf[12*eid+1]=y1;
+-				dBuf[12*eid+2]=z1;
+-
+-				/*vertex 2: */
+-				dBuf[12*eid+3]=x2;
+-				dBuf[12*eid+4]=y2;
+-				dBuf[12*eid+5]=z2;
+-			
+-				/*vertex 3: */
+-				dBuf[12*eid+6]=x3;
+-				dBuf[12*eid+7]=y3;
+-				dBuf[12*eid+8]=z3;
+-				
+-				/*values at 3 vertices: */
+-				dBuf[12*eid+9]=vel1;
+-				dBuf[12*eid+10]=vel2;
+-				dBuf[12*eid+11]=vel3;
+-
+-			}
+-		}
+-
+-		/*for(i=0;i<148;i++){
+-		__android_log_print(ANDROID_LOG_INFO, "Native","%g %g %g | %g %g %g | %g %g %g | %g %g %g\n",
+-				dBuf[12*i+0],dBuf[12*i+1],dBuf[12*i+2],
+-				dBuf[12*i+3],dBuf[12*i+4],dBuf[12*i+5],
+-				dBuf[12*i+6],dBuf[12*i+7],dBuf[12*i+8],
+-				dBuf[12*i+9],dBuf[12*i+10],dBuf[12*i+11]);
+-		}*/
+-
+-		/*delete temporary data:*/
+-		delete patch;
+-
+-	}/*}}}*/
+-	static JNINativeMethod method_table[] = /*{{{*/
+-	{
+-			{"createISSMModel"   ,"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I"  , (void *) Initialize},
+-			{"solveISSMModel", "(DLjava/nio/DoubleBuffer;)V", (void *) Solve}
+-	};
+-	/*}}}*/
+-}
+-
+-using namespace gov_nasa_jpl_issm;
+-extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) /*{{{*/
+-{
+-    JNIEnv* env;
+-    if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
+-        return -1;
+-    }
+-    else
+-    {
+-    	jclass clazz = env->FindClass("gov/nasa/jpl/issm/IssmJni");
+-    	if(clazz)
+-    	{
+-    		env->RegisterNatives(clazz, method_table, 3);
+-    		env->DeleteLocalRef(clazz);
+-    		return JNI_VERSION_1_6;
+-    	}
+-    	else return -1;
+-    }
+-}
+-/*}}}*/
+Index: ../trunk-jpl/src/mobile/native
+===================================================================
+--- ../trunk-jpl/src/mobile/native	(revision 26200)
++++ ../trunk-jpl/src/mobile/native	(nonexistent)
+
+Property changes on: ../trunk-jpl/src/mobile/native
+___________________________________________________________________
+Deleted: svn:ignore
+## -1,3 +0,0 ##
+-Makefile.in
+-.deps
+-Makefile
+Index: ../trunk-jpl/src/mobile
+===================================================================
+--- ../trunk-jpl/src/mobile	(revision 26200)
++++ ../trunk-jpl/src/mobile	(nonexistent)
+
+Property changes on: ../trunk-jpl/src/mobile
+___________________________________________________________________
+Deleted: svn:ignore
+## -1,2 +0,0 ##
+-Makefile.in
+-Makefile
+Index: ../trunk-jpl/src/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/Makefile.am	(revision 26200)
++++ ../trunk-jpl/src/Makefile.am	(revision 26201)
+@@ -1,2 +1,2 @@
+ EXTRA_DIST =  perl
+-SUBDIRS = c m wrappers mobile
++SUBDIRS = c m wrappers
Index: /issm/oecreview/Archive/25834-26739/ISSM-26201-26202.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26201-26202.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26201-26202.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/m/exp/expcontourlevelzero.m
+===================================================================
+--- ../trunk-jpl/src/m/exp/expcontourlevelzero.m	(revision 26201)
++++ ../trunk-jpl/src/m/exp/expcontourlevelzero.m	(revision 26202)
+@@ -5,7 +5,8 @@
+ %      expcontourlevelzero(md,mask,level,filename)
+ % 
+ %   Example:
+-%      expcontourlevelzero(md,md.geometry.thickness,0, 'Level0.exp');
++%      expcontourlevelzero(md,md.geometry.thickness,10, 'Level0.exp');
++%      expcontourlevelzero(md,md.mask.ocean_levelset,0, 'Level0.exp');
+ %
+ %   See also CONTOURLEVELZERO, EXPWRITE
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26202-26203.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26202-26203.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26202-26203.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/configure.ac
+===================================================================
+--- ../trunk-jpl/configure.ac	(revision 26202)
++++ ../trunk-jpl/configure.ac	(revision 26203)
+@@ -43,8 +43,6 @@
+ 	src/wrappers/python/Makefile
+ 	src/wrappers/matlab/Makefile
+ 	src/wrappers/javascript/Makefile
+-	src/mobile/Makefile
+-	src/mobile/native/Makefile
+ 	src/m/Makefile
+ ])
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26203-26204.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26203-26204.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26203-26204.diff	(revision 26740)
@@ -0,0 +1,386 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26203)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26204)
+@@ -782,9 +782,11 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum,0.);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum,0.);
+-	if(isMLHO){//itapopo FIXME the shear velocities should be initialized correctly
++	if(isMLHO){//itapopo FIXME shear and base velocities should be initialized correctly
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxShearEnum,0.);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyShearEnum,0.);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum,0.);
+ 	}
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcex",LoadingforceXEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcey",LoadingforceYEnum);
+@@ -3201,16 +3203,18 @@
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+-	int numdof   = numnodes*2*2; //4 DOFs per node
++	int numdof   = numnodes*4; //4 DOFs per node
+ 
+ 	/*Fetch dof list and allocate solution vectors*/
+ 	basalelement->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum); 
+ 	//basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+ 	IssmDouble* values    = xNew<IssmDouble>(numdof);
+-	IssmDouble* vx        = xNew<IssmDouble>(numnodes);
+-	IssmDouble* vy        = xNew<IssmDouble>(numnodes);
++	IssmDouble* vbx       = xNew<IssmDouble>(numnodes);
++	IssmDouble* vby       = xNew<IssmDouble>(numnodes);
+    IssmDouble* vshx      = xNew<IssmDouble>(numnodes); 
+    IssmDouble* vshy      = xNew<IssmDouble>(numnodes);
++	IssmDouble* vsx       = xNew<IssmDouble>(numnodes);
++	IssmDouble* vsy       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vz        = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vel       = xNew<IssmDouble>(numnodes);
+ 	
+@@ -3228,16 +3232,18 @@
+ 
+    /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+    for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+-      vx[i]  =values[i*4+0]; //base vx
++      vbx[i] =values[i*4+0]; //base vx
+       vshx[i]=values[i*4+1]; //shear vx
+-		if(xIsNan<IssmDouble>(vx[i]))		_error_("NaN found in solution vector");
+-      if(xIsInf<IssmDouble>(vx[i]))		_error_("Inf found in solution vector");
++		vsx[i] =vbx[i]+vshx[i]; //surface vx
++		if(xIsNan<IssmDouble>(vbx[i]))	_error_("NaN found in solution vector");
++      if(xIsInf<IssmDouble>(vbx[i]))	_error_("Inf found in solution vector");
+ 		if(xIsNan<IssmDouble>(vshx[i]))	_error_("NaN found in solution vector");
+       if(xIsInf<IssmDouble>(vshx[i]))	_error_("Inf found in solution vector");
+-		vy[i]  =values[i*4+2]; //base vy
++		vby[i] =values[i*4+2]; //base vy
+ 		vshy[i]=values[i*4+3]; //shear vy
+-		if(xIsNan<IssmDouble>(vy[i]))		_error_("NaN found in solution vector");
+-		if(xIsInf<IssmDouble>(vy[i]))		_error_("Inf found in solution vector");
++		vsy[i] =vby[i]+vshy[i]; //surface vy
++		if(xIsNan<IssmDouble>(vby[i]))	_error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(vby[i]))	_error_("Inf found in solution vector");
+ 		if(xIsNan<IssmDouble>(vshy[i]))	_error_("NaN found in solution vector");
+ 		if(xIsInf<IssmDouble>(vshy[i]))	_error_("Inf found in solution vector");
+ 	}
+@@ -3248,18 +3254,24 @@
+ 
+ 	/*Get Vz and compute vel (base)*/
+ 	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.);
+-	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 
++	for(i=0;i<numnodes;i++) vel[i]=sqrt(vbx[i]*vbx[i] + vby[i]*vby[i] + vz[i]*vz[i]); 
+ 
+ 	/*Add vx and vy as inputs to the tria element (base velocities): */
+-	element->AddBasalInput(VxEnum,vx,element->GetElementType());
+-	element->AddBasalInput(VyEnum,vy,element->GetElementType());
+-	element->AddBasalInput(VelEnum,vel,element->GetElementType());
++	element->AddBasalInput(VxBaseEnum,vbx,element->GetElementType());
++	element->AddBasalInput(VyBaseEnum,vby,element->GetElementType());
++	element->AddBasalInput(VelEnum,vel,element->GetElementType()); //itapopo check this
++	
++	/*Add vx and vy as inputs to the tria element (surface velocities): */
++	element->AddBasalInput(VxSurfaceEnum,vsx,element->GetElementType());
++	element->AddBasalInput(VySurfaceEnum,vsy,element->GetElementType());
+ 
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(vel);
+ 	xDelete<IssmDouble>(vz);
+-	xDelete<IssmDouble>(vy);
+-	xDelete<IssmDouble>(vx);
++	xDelete<IssmDouble>(vby);
++	xDelete<IssmDouble>(vbx);
++	xDelete<IssmDouble>(vsy);
++	xDelete<IssmDouble>(vsx);
+ 	xDelete<IssmDouble>(vshy);
+ 	xDelete<IssmDouble>(vshx);
+ 	xDelete<IssmDouble>(values);
+@@ -3269,7 +3281,7 @@
+ }/*}}}*/
+ void           StressbalanceAnalysis::GetSolutionFromInputsMLHO(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 
+-	IssmDouble   vx,vy,vshx,vshy;
++	IssmDouble   vbx,vby,vshx,vshy;
+ 	int          domaintype,dim,approximation,dofpernode;
+ 	int*         doflist = NULL;
+ 
+@@ -3292,9 +3304,9 @@
+ 	IssmDouble* values = xNew<IssmDouble>(numdof);
+ 
+ 	/*Get inputs*/
+-	Input* vx_input		=element->GetInput(VxEnum);		_assert_(vx_input);
++	Input* vxbase_input	=element->GetInput(VxBaseEnum);	_assert_(vxbase_input);
+ 	Input* vxshear_input	=element->GetInput(VxShearEnum);	_assert_(vxshear_input);
+-	Input* vy_input		=element->GetInput(VyEnum);		_assert_(vy_input);
++	Input* vybase_input	=element->GetInput(VyBaseEnum);	_assert_(vybase_input);
+ 	Input* vyshear_input	=element->GetInput(VyShearEnum);	_assert_(vyshear_input);
+ 
+ 	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+@@ -3303,13 +3315,13 @@
+ 		gauss->GaussNode(element->FiniteElement(),i);
+ 
+ 		/*Recover vx and vy*/
+-		vx_input->GetInputValue(&vx,gauss);			//base vx
++		vxbase_input->GetInputValue(&vbx,gauss);	//base vx
+ 		vxshear_input->GetInputValue(&vshx,gauss);//shear vx
+-		values[i*4+0]=vx;   //base vx
++		values[i*4+0]=vbx;  //base vx
+ 		values[i*4+1]=vshx; //shear vx
+-		vy_input->GetInputValue(&vy,gauss);			//base vy
++		vybase_input->GetInputValue(&vby,gauss);	//base vy
+ 		vyshear_input->GetInputValue(&vshy,gauss);//shear vy
+-		values[i*4+2]=vy;		//base vy
++		values[i*4+2]=vby; //base vy
+ 		values[i*4+3]=vshy;//shear vy  
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26203)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26204)
+@@ -851,11 +851,14 @@
+ 
+ }/*}}}*/
+ IssmDouble Friction::VelMag(Gauss* gauss){/*{{{*/
+-	/*Get effective pressure as a function of  flag */
++	/*Get the velocity magnitude as a function of flag */
+ 
+-
+ 	/*diverse*/
++	bool isMLHO=false; //employing mono layer higher order model? Default is no 
+ 	IssmDouble vx,vy,vz,vmag;
++	
++	element->parameters->FindParam(&isMLHO,FlowequationIsMLHOEnum);
++	if(isMLHO) _assert_(dim==2);
+ 
+ 	switch(dim){
+ 		case 1:
+@@ -863,8 +866,14 @@
+ 			vmag=sqrt(vx*vx);
+ 			break;
+ 		case 2:
+-			element->GetInputValue(&vx,gauss,VxEnum);
+-			element->GetInputValue(&vy,gauss,VyEnum);
++			if(isMLHO){
++				element->GetInputValue(&vx,gauss,VxBaseEnum);
++				element->GetInputValue(&vy,gauss,VyBaseEnum);
++			}
++			else{
++				element->GetInputValue(&vx,gauss,VxEnum);
++				element->GetInputValue(&vy,gauss,VyEnum);
++			}		
+ 			vmag=sqrt(vx*vx+vy*vy);
+ 			break;
+ 		case 3:
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26203)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26204)
+@@ -935,15 +935,19 @@
+ syn keyword cConstant TransientAccumulatedDeltaIceThicknessEnum
+ syn keyword cConstant VelEnum
+ syn keyword cConstant VxAverageEnum
++syn keyword cConstant VxBaseEnum
+ syn keyword cConstant VxEnum
+ syn keyword cConstant VxMeshEnum
+ syn keyword cConstant VxObsEnum
+ syn keyword cConstant VxShearEnum
++syn keyword cConstant VxSurfaceEnum
+ syn keyword cConstant VyAverageEnum
++syn keyword cConstant VyBaseEnum
+ syn keyword cConstant VyEnum
+ syn keyword cConstant VyMeshEnum
+ syn keyword cConstant VyObsEnum
+ syn keyword cConstant VyShearEnum
++syn keyword cConstant VySurfaceEnum
+ syn keyword cConstant VzEnum
+ syn keyword cConstant VzFSEnum
+ syn keyword cConstant VzHOEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26203)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26204)
+@@ -932,15 +932,19 @@
+ 	TransientAccumulatedDeltaIceThicknessEnum,
+ 	VelEnum,
+ 	VxAverageEnum,
++	VxBaseEnum,
+ 	VxEnum,
+ 	VxMeshEnum,
+ 	VxObsEnum,
+ 	VxShearEnum,
++	VxSurfaceEnum,
+ 	VyAverageEnum,
++	VyBaseEnum,
+ 	VyEnum,
+ 	VyMeshEnum,
+ 	VyObsEnum,
+ 	VyShearEnum,
++	VySurfaceEnum,
+ 	VzEnum,
+ 	VzFSEnum,
+ 	VzHOEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26203)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26204)
+@@ -937,15 +937,19 @@
+ 		case TransientAccumulatedDeltaIceThicknessEnum : return "TransientAccumulatedDeltaIceThickness";
+ 		case VelEnum : return "Vel";
+ 		case VxAverageEnum : return "VxAverage";
++		case VxBaseEnum : return "VxBase";
+ 		case VxEnum : return "Vx";
+ 		case VxMeshEnum : return "VxMesh";
+ 		case VxObsEnum : return "VxObs";
+ 		case VxShearEnum : return "VxShear";
++		case VxSurfaceEnum : return "VxSurface";
+ 		case VyAverageEnum : return "VyAverage";
++		case VyBaseEnum : return "VyBase";
+ 		case VyEnum : return "Vy";
+ 		case VyMeshEnum : return "VyMesh";
+ 		case VyObsEnum : return "VyObs";
+ 		case VyShearEnum : return "VyShear";
++		case VySurfaceEnum : return "VySurface";
+ 		case VzEnum : return "Vz";
+ 		case VzFSEnum : return "VzFS";
+ 		case VzHOEnum : return "VzHO";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26203)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26204)
+@@ -958,15 +958,19 @@
+ 	      else if (strcmp(name,"TransientAccumulatedDeltaIceThickness")==0) return TransientAccumulatedDeltaIceThicknessEnum;
+ 	      else if (strcmp(name,"Vel")==0) return VelEnum;
+ 	      else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
++	      else if (strcmp(name,"VxBase")==0) return VxBaseEnum;
+ 	      else if (strcmp(name,"Vx")==0) return VxEnum;
+ 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VxObs")==0) return VxObsEnum;
+ 	      else if (strcmp(name,"VxShear")==0) return VxShearEnum;
++	      else if (strcmp(name,"VxSurface")==0) return VxSurfaceEnum;
+ 	      else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
++	      else if (strcmp(name,"VyBase")==0) return VyBaseEnum;
+ 	      else if (strcmp(name,"Vy")==0) return VyEnum;
+ 	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+ 	      else if (strcmp(name,"VyObs")==0) return VyObsEnum;
+ 	      else if (strcmp(name,"VyShear")==0) return VyShearEnum;
++	      else if (strcmp(name,"VySurface")==0) return VySurfaceEnum;
+ 	      else if (strcmp(name,"Vz")==0) return VzEnum;
+ 	      else if (strcmp(name,"VzFS")==0) return VzFSEnum;
+ 	      else if (strcmp(name,"VzHO")==0) return VzHOEnum;
+@@ -993,14 +997,14 @@
+ 	      else if (strcmp(name,"Outputdefinition17")==0) return Outputdefinition17Enum;
+ 	      else if (strcmp(name,"Outputdefinition18")==0) return Outputdefinition18Enum;
+ 	      else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum;
+-	      else if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
+ 	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+ 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
++	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+ 	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+ 	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+@@ -1116,14 +1120,14 @@
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+ 	      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 stage=10;
++   }
++   if(stage==10){
++	      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 stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"CalvingVonmises")==0) return CalvingVonmisesEnum;
++	      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;
+@@ -1239,14 +1243,14 @@
+ 	      else if (strcmp(name,"Indexed")==0) return IndexedEnum;
+ 	      else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
+ 	      else if (strcmp(name,"ElementInput")==0) return ElementInputEnum;
+-	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
++         else stage=11;
++   }
++   if(stage==11){
++	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"Inputs")==0) return InputsEnum;
++	      else if (strcmp(name,"Inputs")==0) return InputsEnum;
+ 	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+ 	      else if (strcmp(name,"Intersect")==0) return IntersectEnum;
+ 	      else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
+@@ -1362,14 +1366,14 @@
+ 	      else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
+ 	      else if (strcmp(name,"SamplingAnalysis")==0) return SamplingAnalysisEnum;
+ 	      else if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
+-	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"SMBgcm")==0) return SMBgcmEnum;
++	      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;
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26203)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26204)
+@@ -228,6 +228,14 @@
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'VyShear'),
+ 		field = field*yts;
++	elseif strcmp(fieldname,'VxBase'),
++		field = field*yts;
++	elseif strcmp(fieldname,'VyBase'),
++		field = field*yts;
++	elseif strcmp(fieldname,'VxSurface'),
++		field = field*yts;
++	elseif strcmp(fieldname,'VySurface'),
++		field = field*yts;
+ 	elseif strcmp(fieldname,'BasalforcingsGroundediceMeltingRate'),
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'BasalforcingsFloatingiceMeltingRate'),
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26203)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26204)
+@@ -179,6 +179,14 @@
+             field = field * yts
+         elif fieldname == 'VyShear':
+             field = field * yts
++        elif fieldname == 'VxBase':
++            field = field * yts
++        elif fieldname == 'VyBase':
++            field = field * yts
++        elif fieldname == 'VxSurface':
++            field = field * yts
++        elif fieldname == 'VySurface':
++            field = field * yts
+         elif fieldname == 'BasalforcingsGroundediceMeltingRate':
+             field = field * yts
+         elif fieldname == 'BasalforcingsFloatingiceMeltingRate':
Index: /issm/oecreview/Archive/25834-26739/ISSM-26204-26205.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26204-26205.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26204-26205.diff	(revision 26740)
@@ -0,0 +1,92 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26204)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26205)
+@@ -2731,7 +2731,7 @@
+ /*MLHO*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+ 	
+-	_error_("Mono Layer Higher-Order called, not fully tested. If you are sure in using it, comment this line.");
++	_error_("Mono Layer Higher-Order called, not fully tested. If you are sure of using it, comment this line.");
+ 	
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+@@ -2913,7 +2913,7 @@
+ 	Input* n_input			 = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+-	Gauss* gauss      = element->NewGauss(5);
++	Gauss* gauss      = element->NewGauss(2);
+ 	Gauss* gauss_base = basalelement->NewGauss();
+ 	while(gauss->next()){
+ 		gauss->SynchronizeGaussBase(gauss_base);
+@@ -3191,6 +3191,7 @@
+ 	/*Get basal element*/
+ 	switch(domaintype){
+ 		case Domain2DhorizontalEnum:
++			// itapopo FIXME use basalelement or element only here
+ 			basalelement = element;
+ 			break;
+ 		case Domain3DEnum:
+@@ -3215,8 +3216,11 @@
+    IssmDouble* vshy      = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vsx       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vsy       = xNew<IssmDouble>(numnodes);
++	IssmDouble* vx        = xNew<IssmDouble>(numnodes);
++	IssmDouble* vy        = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vz        = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vel       = xNew<IssmDouble>(numnodes);
++	IssmDouble* n			 = xNew<IssmDouble>(numnodes);
+ 	
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+@@ -3251,22 +3255,35 @@
+ 	/*Add vx and vy as inputs to the tria element (shear velocities): */
+ 	element->AddBasalInput(VxShearEnum,vshx,element->GetElementType());
+ 	element->AddBasalInput(VyShearEnum,vshy,element->GetElementType());
+-
+-	/*Get Vz and compute vel (base)*/
+-	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.);
+-	for(i=0;i<numnodes;i++) vel[i]=sqrt(vbx[i]*vbx[i] + vby[i]*vby[i] + vz[i]*vz[i]); 
+-
++	
+ 	/*Add vx and vy as inputs to the tria element (base velocities): */
+ 	element->AddBasalInput(VxBaseEnum,vbx,element->GetElementType());
+ 	element->AddBasalInput(VyBaseEnum,vby,element->GetElementType());
+-	element->AddBasalInput(VelEnum,vel,element->GetElementType()); //itapopo check this
+ 	
+ 	/*Add vx and vy as inputs to the tria element (surface velocities): */
+ 	element->AddBasalInput(VxSurfaceEnum,vsx,element->GetElementType());
+ 	element->AddBasalInput(VySurfaceEnum,vsy,element->GetElementType());
+ 
++	/*Compute the vertically averaged velocities on each node*/
++	basalelement->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum,0.); 
++   for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
++		vx[i]=vbx[i]+vshx[i]*(n[i]+1)/(n[i]+2);
++		vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2);
++	}
++		
++	/*Get Vz and compute vel (vertically averaged vel)*/
++	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.); 
++	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 
++
++	/*Add vx and vy as inputs to the tria element (vertically averaged velocities): */
++	element->AddBasalInput(VxEnum,vx,element->GetElementType());
++	element->AddBasalInput(VyEnum,vy,element->GetElementType());
++	element->AddBasalInput(VelEnum,vel,element->GetElementType()); 
++
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(vel);
++	xDelete<IssmDouble>(vx);
++	xDelete<IssmDouble>(vy);
+ 	xDelete<IssmDouble>(vz);
+ 	xDelete<IssmDouble>(vby);
+ 	xDelete<IssmDouble>(vbx);
+@@ -3276,6 +3293,7 @@
+ 	xDelete<IssmDouble>(vshx);
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(n);
+ 	xDelete<int>(doflist);
+ 	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26205-26206.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26205-26206.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26205-26206.diff	(revision 26740)
@@ -0,0 +1,82 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26205)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26206)
+@@ -19,13 +19,15 @@
+ 	this->element=NULL;
+ 	this->dim=0;
+ 	this->law=0;
++	this->isMLHO=false;
+ 
+ }
+ /*}}}*/
+-Friction::Friction(Element* element_in,int dim_in){/*{{{*/
++Friction::Friction(Element* element_in,int dim_in,bool isMLHO_in){/*{{{*/
+ 
+ 	this->element=element_in;
+ 	this->dim=dim_in;
++	this->isMLHO=isMLHO_in;
+ 	element_in->FindParam(&this->law,FrictionLawEnum);
+ }
+ /*}}}*/
+@@ -854,11 +856,9 @@
+ 	/*Get the velocity magnitude as a function of flag */
+ 
+ 	/*diverse*/
+-	bool isMLHO=false; //employing mono layer higher order model? Default is no 
+ 	IssmDouble vx,vy,vz,vmag;
+ 	
+-	element->parameters->FindParam(&isMLHO,FlowequationIsMLHOEnum);
+-	if(isMLHO) _assert_(dim==2);
++	if(this->isMLHO) _assert_(dim==2);
+ 
+ 	switch(dim){
+ 		case 1:
+@@ -866,7 +866,7 @@
+ 			vmag=sqrt(vx*vx);
+ 			break;
+ 		case 2:
+-			if(isMLHO){
++			if(this->isMLHO){
+ 				element->GetInputValue(&vx,gauss,VxBaseEnum);
+ 				element->GetInputValue(&vy,gauss,VyBaseEnum);
+ 			}
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26205)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26206)
+@@ -16,10 +16,11 @@
+ 		Element* element;
+ 		int      dim;
+ 		int      law;
++		bool		isMLHO=false;
+ 
+ 		/*methods: */
+ 		Friction();
+-		Friction(Element* element_in,int dim_in);
++		Friction(Element* element_in,int dim_in,bool isMLHO=0);
+ 		~Friction();
+ 
+ 		void  Echo(void);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26205)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26206)
+@@ -2731,7 +2731,7 @@
+ /*MLHO*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+ 	
+-	_error_("Mono Layer Higher-Order called, not fully tested. If you are sure of using it, comment this line.");
++	//_error_("Mono Layer Higher-Order called, not fully tested. If you are sure of using it, comment this line.");
+ 	
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+@@ -2782,7 +2782,7 @@
+ 	Input* gllevelset_input = NULL;
+ 
+ 	/*build friction object, used later on: */
+-	Friction* friction=new Friction(element,dim);
++	Friction* friction=new Friction(element,dim,true);
+ 
+ 	/*Recover portion of element that is grounded*/
+ 	if(!(friction_style==SubelementFriction2Enum)) phi=element->GetGroundedPortion(xyz_list);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26206-26207.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26206-26207.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26206-26207.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26206)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26207)
+@@ -73,7 +73,7 @@
+   {
+     femmodel->parameters->FindParam(&step,StepEnum);
+     femmodel->parameters->FindParam(&phi,SamplingPhiEnum);
+-    seed = seed + 13923272*step; // change default seed for transient simulations (by considering an arbitrary shif based on the step number)
++		if(seed>=0) seed = seed + 13923272*step; // change default seed for transient simulations (by considering an arbitrary shif based on the step number)
+ 
+     GetSolutionFromInputsx(&ug,femmodel);
+     Reducevectorgtofx(&uf, ug, femmodel->nodes,femmodel->parameters);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26207-26208.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26207-26208.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26207-26208.diff	(revision 26740)
@@ -0,0 +1,1868 @@
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26207)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26208)
+@@ -225,7 +225,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.smb.model",SmbEnum));
+ 
+ 	iomodel->FindConstant(&smb_model,"md.smb.model");
+-	iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
++	iomodel->FindConstant(&interp,"md.timestepping.interp_forcing");
+ 	iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
+ 
+ 	iomodel->FindConstant(&smbslices,"md.smb.steps_per_step");
+@@ -236,7 +236,6 @@
+ 
+ 	switch(smb_model){
+ 		case SMBforcingEnum:
+-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
+ 			break;
+ 		case SMBgembEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIdx",SmbAIdxEnum));
+@@ -258,7 +257,6 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.ismelt",SmbIsmeltEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdensification",SmbIsdensificationEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isturbulentflux",SmbIsturbulentfluxEnum));
+-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isconstrainsurfaceT",SmbIsconstrainsurfaceTEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.InitDensityScaling",SmbInitDensityScalingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.ThermoDeltaTScaling",SmbThermoDeltaTScalingEnum));
+@@ -381,10 +379,8 @@
+ 			/*Nothing to add to parameters*/
+ 			break;
+ 		case SMBcomponentsEnum:
+-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
+ 			break;
+ 		case SMBmeltcomponentsEnum:
+-			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
+ 			break;
+ 		case SMBgradientscomponentsEnum:
+ 				parameters->AddObject(iomodel->CopyConstantObject("md.smb.accualti",SmbAccualtiEnum));
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26207)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26208)
+@@ -13,59 +13,7 @@
+ 	// void SmbForcingx(smb,ni){
+ 	//    INPUT parameters: ni: working size of arrays
+ 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
+-	bool isclimatology;
+-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
+ 
+-	if (isclimatology){
+-
+-		/*Get time parameters*/
+-		IssmDouble time,dt,starttime,finaltime;
+-		femmodel->parameters->FindParam(&time,TimeEnum);
+-		femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-		femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+-		femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+-
+-		if(time<=starttime+dt){
+-			/*FIXME: this is wrong, should be done at the ElementUpdate step of analysis, not here!*/
+-			InputDuplicatex(femmodel,SmbMassBalanceEnum,SmbMassBalanceClimateEnum);
+-			femmodel->inputs->DeleteInput(SmbMassBalanceEnum);
+-		}
+-
+-		/*If this is a climatology, we need to repeat the forcing after the final time*/
+-		TransientInput* smb_input=femmodel->inputs->GetTransientInput(SmbMassBalanceClimateEnum); _assert_(smb_input);
+-
+-		/*Get accumulation climatology value*/
+-		int offsetend = smb_input->GetTimeInputOffset(finaltime);
+-		IssmDouble time0     = smb_input->GetTimeByOffset(-1);
+-		IssmDouble timeend   = smb_input->GetTimeByOffset(offsetend);
+-
+-		_assert_(timeend>time0);
+-		IssmDouble timeclim  = time;
+-
+-		if(time>time0 && timeend>time0){
+-			IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-			if(delta==0.){
+-				timeclim=timeend;
+-			}
+-			else{
+-				timeclim=time0+delta;
+-			}
+-		}
+-
+-		/*Loop over all the elements of this partition*/
+-		for(Object* & object : femmodel->elements->objects){
+-			Element* element=xDynamicCast<Element*>(object);
+-
+-			int         numvertices = element->GetNumberOfVertices();
+-			IssmDouble* smb         = xNew<IssmDouble>(numvertices);
+-			element->GetInputListOnVerticesAtTime(smb,SmbMassBalanceClimateEnum,timeclim);
+-
+-			/*Add input to element and Free memory*/
+-			element->AddInput(SmbMassBalanceEnum,smb,P1Enum);
+-			xDelete<IssmDouble>(smb);
+-		}
+-	}
+-
+ }/*}}}*/
+ void SmbGradientsx(FemModel* femmodel){/*{{{*/
+ 
+@@ -409,8 +357,6 @@
+ 	//    surface evaporation (m/yr water equivalent): evap
+ 	//    surface runoff (m/yr water equivalent): runoff
+ 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
+-	bool isclimatology;
+-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
+ 
+ 	/*Loop over all the elements of this partition*/
+ 	for(Object* & object : femmodel->elements->objects){
+@@ -424,70 +370,10 @@
+ 		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
+ 
+ 		/*Recover Smb Components*/
+-		if(isclimatology){
++		element->GetInputListOnVertices(acc,SmbAccumulationEnum);
++		element->GetInputListOnVertices(evap,SmbEvaporationEnum);
++		element->GetInputListOnVertices(runoff,SmbRunoffEnum);
+ 
+-			int offsetend;
+-			IssmDouble time0,timeend,timeclim;
+-			IssmDouble time,starttime,finaltime;
+-
+-			/*Get time parameters*/
+-			femmodel->parameters->FindParam(&time,TimeEnum);
+-			femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+-			femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+-
+-			//If this is a climatology, we need to repeat the forcing after the final time
+-			TransientInput* acc_input    = element->inputs->GetTransientInput(SmbAccumulationEnum); _assert_(acc_input);
+-			TransientInput* evap_input   = element->inputs->GetTransientInput(SmbEvaporationEnum);  _assert_(evap_input);
+-			TransientInput* runoff_input = element->inputs->GetTransientInput(SmbRunoffEnum);       _assert_(runoff_input);
+-
+-			//Get accumulation climatology value
+-			offsetend = acc_input->GetTimeInputOffset(finaltime);
+-			time0     = acc_input->GetTimeByOffset(-1);
+-			timeend   = acc_input->GetTimeByOffset(offsetend);
+-			timeclim  = time;
+-			if(time>time0 & timeend>time0){
+-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-				if(delta==0.)
+-				 timeclim=timeend;
+-				else
+-				 timeclim=time0+delta;
+-			}
+-			element->GetInputListOnVerticesAtTime(acc,SmbAccumulationEnum,timeclim);
+-
+-			//Get evaporation climatology value
+-			offsetend = evap_input->GetTimeInputOffset(finaltime);
+-			time0     = evap_input->GetTimeByOffset(-1);
+-			timeend   = evap_input->GetTimeByOffset(offsetend);
+-			timeclim  = time;
+-			if(time>time0 & timeend>time0){
+-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-				if(delta==0.)
+-				 timeclim=timeend;
+-				else
+-				 timeclim=time0+delta;
+-			}
+-			element->GetInputListOnVerticesAtTime(evap,SmbEvaporationEnum,timeclim);
+-
+-			//Get runoff climatology value
+-			offsetend = runoff_input->GetTimeInputOffset(finaltime);
+-			time0     = runoff_input->GetTimeByOffset(-1);
+-			timeend   = runoff_input->GetTimeByOffset(offsetend);
+-			timeclim  = time;
+-			if(time>time0 & timeend>time0){
+-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-				if(delta==0.)
+-				 timeclim=timeend;
+-				else
+-				 timeclim=time0+delta;
+-			}
+-			element->GetInputListOnVerticesAtTime(runoff,SmbRunoffEnum,timeclim);
+-		}
+-		else{
+-			element->GetInputListOnVertices(acc,SmbAccumulationEnum);
+-			element->GetInputListOnVertices(evap,SmbEvaporationEnum);
+-			element->GetInputListOnVertices(runoff,SmbRunoffEnum);
+-		}
+-
+ 		// loop over all vertices
+ 		for(int v=0;v<numvertices;v++) smb[v]=acc[v]-evap[v]-runoff[v];
+ 
+@@ -509,8 +395,6 @@
+ 	//    surface melt (m/yr water equivalent): melt
+ 	//    refreeze of surface melt (m/yr water equivalent): refreeze
+ 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
+-	bool isclimatology;
+-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
+ 
+ 	/*Loop over all the elements of this partition*/
+ 	for(Object* & object : femmodel->elements->objects){
+@@ -525,85 +409,11 @@
+ 		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
+ 
+ 		/*Recover Smb Components*/
+-		if (isclimatology){
++		element->GetInputListOnVertices(acc,SmbAccumulationEnum);
++		element->GetInputListOnVertices(evap,SmbEvaporationEnum);
++		element->GetInputListOnVertices(melt,SmbMeltEnum);
++		element->GetInputListOnVertices(refreeze,SmbRefreezeEnum);
+ 
+-			int offsetend;
+-			IssmDouble time0,timeend,timeclim;
+-			IssmDouble time,starttime,finaltime;
+-			femmodel->parameters->FindParam(&time,TimeEnum);
+-			femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+-			femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+-
+-
+-			//If this is a climatology, we need to repeat the forcing after the final time
+-			TransientInput* acc_input      = element->inputs->GetTransientInput(SmbAccumulationEnum); _assert_(acc_input);
+-			TransientInput* evap_input     = element->inputs->GetTransientInput(SmbEvaporationEnum);  _assert_(evap_input);
+-			TransientInput* melt_input     = element->inputs->GetTransientInput(SmbMeltEnum);         _assert_(melt_input);
+-			TransientInput* refreeze_input = element->inputs->GetTransientInput(SmbRefreezeEnum);     _assert_(refreeze_input);
+-
+-			//Get accumulation climatology value
+-			offsetend = acc_input->GetTimeInputOffset(finaltime);
+-			time0     = acc_input->GetTimeByOffset(-1);
+-			timeend   = acc_input->GetTimeByOffset(offsetend);
+-			timeclim  = time;
+-			if(time>time0 & timeend>time0){
+-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-				if(delta==0.)
+-				 timeclim=timeend;
+-				else
+-				 timeclim=time0+delta;
+-			}
+-			element->GetInputListOnVerticesAtTime(acc,SmbAccumulationEnum,timeclim);
+-
+-			//Get evaporation climatology value
+-			offsetend = evap_input->GetTimeInputOffset(finaltime);
+-			time0     = evap_input->GetTimeByOffset(-1);
+-			timeend   = evap_input->GetTimeByOffset(offsetend);
+-			timeclim  = time;
+-			if(time>time0 & timeend>time0){
+-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-				if(delta==0.)
+-				 timeclim=timeend;
+-				else
+-				 timeclim=time0+delta;
+-			}
+-			element->GetInputListOnVerticesAtTime(evap,SmbEvaporationEnum,timeclim);
+-
+-			//Get melt climatology value
+-			offsetend = melt_input->GetTimeInputOffset(finaltime);
+-			time0     = melt_input->GetTimeByOffset(-1);
+-			timeend   = melt_input->GetTimeByOffset(offsetend);
+-			timeclim  = time;
+-			if(time>time0 & timeend>time0){
+-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-				if(delta==0.)
+-				 timeclim=timeend;
+-				else
+-				 timeclim=time0+delta;
+-			}
+-			element->GetInputListOnVerticesAtTime(melt,SmbMeltEnum,timeclim);
+-
+-			//Get refreeze climatology value
+-			offsetend = refreeze_input->GetTimeInputOffset(finaltime);
+-			time0     = refreeze_input->GetTimeByOffset(-1);
+-			timeend   = refreeze_input->GetTimeByOffset(offsetend);
+-			timeclim  = time;
+-			if(time>time0 & timeend>time0){
+-				IssmDouble delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-				if(delta==0.)
+-				 timeclim=timeend;
+-				else
+-				 timeclim=time0+delta;
+-			}
+-			element->GetInputListOnVerticesAtTime(refreeze,SmbRefreezeEnum,timeclim);
+-		}
+-		else{
+-			element->GetInputListOnVertices(acc,SmbAccumulationEnum);
+-			element->GetInputListOnVertices(evap,SmbEvaporationEnum);
+-			element->GetInputListOnVertices(melt,SmbMeltEnum);
+-			element->GetInputListOnVertices(refreeze,SmbRefreezeEnum);
+-		}
+-
+ 		// loop over all vertices
+ 		for(int v=0;v<numvertices;v++) smb[v]=acc[v]-evap[v]-melt[v]+refreeze[v];
+ 
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26208)
+@@ -14,7 +14,6 @@
+     """
+ 
+     def __init__(self, *args):  # {{{
+-        self.isclimatology = 0
+         self.accumulation = np.nan
+         self.runoff = np.nan
+         self.evaporation = np.nan
+@@ -34,7 +33,6 @@
+         s += '{}\n'.format(fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
+         s += '{}\n'.format(fielddisplay(self, 'runoff', 'amount of ice melt lost from the ice column [m/yr ice eq]'))
+         s += '{}\n'.format(fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
+-        s += '{}\n'.format(fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+         s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+         s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+         s += '\t\t{}\n'.format('0: Arithmetic (default)')
+@@ -81,12 +79,6 @@
+         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
+         md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+-        if self.isclimatology:
+-            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices + 1],
+-                'message', 'accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
+-            md = checkfield(md, 'fieldname', 'smb.runoff', 'size', [md.mesh.numberofvertices + 1], 'message', 'runoff must have md.mesh.numberofvertices+1 rows in order to force a climatology')
+-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices + 1], 'message', 'evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
+         return md
+     # }}}
+ 
+@@ -106,10 +98,5 @@
+             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')
+ 
+     # }}}
+Index: ../trunk-jpl/src/m/classes/SMBforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBforcing.py	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBforcing.py	(revision 26208)
+@@ -14,7 +14,6 @@
+     """
+ 
+     def __init__(self, *args):  # {{{
+-        self.isclimatology = 0
+         self.mass_balance = np.nan
+         self.steps_per_step = 1
+         self.requested_outputs = []
+@@ -30,7 +29,6 @@
+     def __repr__(self):  # {{{
+         s = '   surface forcings parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
+-        s += '{}\n'.format(fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+         s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+         s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+         s += '\t\t{}\n'.format('0: Arithmetic (default)')
+@@ -66,9 +64,6 @@
+         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
+         md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+-        if self.isclimatology:
+-            md = checkfield(md, 'fieldname', 'smb.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
+     # }}}
+ 
+@@ -86,5 +81,4 @@
+             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: ../trunk-jpl/src/m/classes/SMBgemb.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26208)
+@@ -70,7 +70,7 @@
+             # 3: density and cloud amount [Greuell & Konzelmann, 1994]
+             # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+ 
+-        self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, with snow density (taken from Bassford, 2004))
++        self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)) 
+         self.denIdx                 = np.nan    # densification model to use (default is 2):
+             # 1 = emperical model of Herron and Langway (1980)
+             # 2 = semi-emperical model of Anthern et al. (2010)
+@@ -83,7 +83,7 @@
+         self.dsnowIdx               = np.nan    # model for fresh snow accumulation density (default is 1):
+             # 0 = Original GEMB value, 150 kg/m^3
+             # 1 = Antarctica value of fresh snow density, 350 kg/m^3
+-            # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)
++            # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
+             # 3 = Antarctica model of Kaspers et al. (2004)
+             # 4 = Greenland model of Kuipers Munneke et al. (2015)
+ 
+@@ -155,7 +155,6 @@
+         string = "%s\n%s" % (string, fielddisplay(self, 'isdensification', 'run densification module (default true)'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'isturbulentflux', 'run turbulant heat fluxes module (default true)'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'V', 'wind speed (m s-1)'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
+@@ -217,7 +216,7 @@
+             string = "%s\n%s" % (string, fielddisplay(self, 't0dry', 'warm snow timescale (30) [d]'))
+             string = "%s\n%s" % (string, fielddisplay(self, 'K', 'time scale temperature coef. (7) [d]'))
+ 
+-        string = "%s\n%s" % (string, fielddisplay(self, 'swIdx', 'apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, with snow density (taken from Bassford, 2004)]'))
++        string = "%s\n%s" % (string, fielddisplay(self, 'swIdx', 'apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'denIdx', ['densification model to use (default is 2):',
+                                                                    '1 = emperical model of Herron and Langway (1980)',
+                                                                    '2 = semi-emperical model of Anthern et al. (2010)',
+@@ -229,7 +228,7 @@
+         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)',
++                                                                     '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',
+                                                                      '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
+                                                                      '4 = Greenland model of Kuipers Munneke et al. (2015)']))
+         string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+@@ -303,7 +302,6 @@
+         self.ismelt = 1
+         self.isdensification = 1
+         self.isturbulentflux = 1
+-        self.isclimatology = 0
+         self.isconstrainsurfaceT = 0
+ 
+         self.aIdx = 1
+@@ -367,7 +365,6 @@
+         md = checkfield(md, 'fieldname', 'smb.ismelt', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.isdensification', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.isturbulentflux', 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.isconstrainsurfaceT', 'values', [0, 1])
+ 
+         md = checkfield(md, 'fieldname', 'smb.Ta', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
+@@ -378,14 +375,6 @@
+         md = checkfield(md, 'fieldname', 'smb.P', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 200, 'size', np.shape(self.Ta))
+         md = checkfield(md, 'fieldname', 'smb.eAir', 'timeseries', 1, 'NaN', 1, 'Inf', 1, 'size', np.shape(self.Ta))
+ 
+-        if (self.isclimatology > 0):
+-            md = checkfield(md, 'fieldname', 'smb.Ta', 'size', [md.mesh.numberofelements + 1], 'message', 'Ta must have md.mesh.numberofelements+1 rows in order to force a climatology')
+-            md = checkfield(md, 'fieldname', 'smb.V', 'size', [md.mesh.numberofelements + 1], 'message', 'V must have md.mesh.numberofelements+1 rows in order to force a climatology')
+-            md = checkfield(md, 'fieldname', 'smb.dswrf', 'size', [md.mesh.numberofelements + 1], 'message', 'dswrf must have md.mesh.numberofelements+1 rows in order to force a climatology')
+-            md = checkfield(md, 'fieldname', 'smb.dlwrf', 'size', [md.mesh.numberofelements + 1], 'message', 'dlwrf must have md.mesh.numberofelements+1 rows in order to force a climatology')
+-            md = checkfield(md, 'fieldname', 'smb.P', 'size', [md.mesh.numberofelements + 1], 'message', 'P must have md.mesh.numberofelements+1 rows in order to force a climatology')
+-            md = checkfield(md, 'fieldname', 'smb.eAir', 'size', [md.mesh.numberofelements + 1], 'message', 'eAir must have md.mesh.numberofelements+1 rows in order to force a climatology')
+-
+         md = checkfield(md, 'fieldname', 'smb.Tmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
+         md = checkfield(md, 'fieldname', 'smb.C', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> ', 0)
+         md = checkfield(md, 'fieldname', 'smb.Vmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
+@@ -450,7 +439,6 @@
+         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', 'isconstrainsurfaceT', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26208)
+@@ -16,7 +16,6 @@
+         self.accumulation = float('NaN')
+         self.runoff = float('NaN')
+         self.evaporation = float('NaN')
+-        self.isclimatology = 0
+         self.steps_per_step = 1
+         self.averaging = 0
+         self.requested_outputs = []
+@@ -28,7 +27,6 @@
+         string = "%s\n%s" % (string, fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'melt', 'amount of ice melt in the ice column [m/yr ice eq]'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'refreeze', 'amount of ice melt refrozen in the ice column [m/yr ice eq]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+         string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+         string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
+@@ -86,7 +84,6 @@
+         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
+         md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+-        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+         return md
+     # }}}
+     def marshall(self, prefix, md, fid):    # {{{
+@@ -108,11 +105,5 @@
+             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')
+ 
+     # }}}
+Index: ../trunk-jpl/src/m/classes/timesteppingadaptive.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/timesteppingadaptive.m	(revision 26207)
++++ ../trunk-jpl/src/m/classes/timesteppingadaptive.m	(revision 26208)
+@@ -10,7 +10,7 @@
+ 		time_step_min   = 0.;
+ 		time_step_max   = 0.;
+ 		cfl_coefficient = 0.;
+-		interp_forcings = 1;
++		interp_forcing = 1;
+ 		cycle_forcing = 1;
+ 		coupling_time   = 0.;
+ 	end
+@@ -37,8 +37,8 @@
+ 			%default CFL coefficient
+ 			self.cfl_coefficient=0.5;
+ 
+-			%should we interpolate forcings between timesteps?
+-			self.interp_forcings=1;
++			%should we interpolate forcing between timesteps?
++			self.interp_forcing=1;
+ 			self.cycle_forcing=0;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -48,7 +48,7 @@
+ 			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);
+-			md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]);
++			md = checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',md.timestepping.coupling_time,'NaN',1,'Inf',1);
+ 			if self.final_time-self.start_time<0,
+@@ -64,7 +64,7 @@
+ 			fielddisplay(self,'time_step_min',['minimum length of time step [' unit ']']);
+ 			fielddisplay(self,'time_step_max',['maximum length of time step [' unit ']']);
+ 			fielddisplay(self,'cfl_coefficient','coefficient applied to cfl condition');
+-			fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
++			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
+ 			fielddisplay(self,'cycle_forcing','cycle through forcing ? (0 or 1)');
+ 			fielddisplay(self,'coupling_time',['coupling time step with ocean model [' unit ']']);
+ 
+@@ -78,7 +78,7 @@
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_min','format','Double','scale',scale);
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_max','format','Double','scale',scale);
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double');
+-			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcings','format','Boolean');
++			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcing','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cycle_forcing','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','coupling_time','format','Double','scale',scale);
+ 		end % }}}
+@@ -89,7 +89,7 @@
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.time_step_min'],self.time_step_min);
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.time_step_max'],self.time_step_max);
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.cfl_coefficient'],self.cfl_coefficient);
+-			writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcings'],self.interp_forcings);
++			writejsdouble(fid,[modelname '.timesteppingadaptive.interp_forcing'],self.interp_forcing);
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.cycle_forcing'],self.cycle_forcing);
+ 			writejsdouble(fid,[modelname '.timesteppingadaptive.coupling_time'],self.time_step_max);
+ 
+Index: ../trunk-jpl/src/m/classes/timesteppingadaptive.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/timesteppingadaptive.py	(revision 26207)
++++ ../trunk-jpl/src/m/classes/timesteppingadaptive.py	(revision 26208)
+@@ -18,7 +18,7 @@
+             self.time_step_min = 0.
+             self.time_step_max = 0.
+             self.cfl_coefficient = 0.
+-            self.interp_forcings = 1
++            self.interp_forcing = 1
+             self.cycle_forcing = 0
+             self.coupling_time = 0.
+ 
+@@ -31,7 +31,7 @@
+             self.setdefaultparameters()
+             self.start_time = old.start_time
+             self.final_time = old.final_time
+-            self.interp_forcings = old.interp_forcings
++            self.interp_forcing = old.interp_forcing
+             self.cycle_forcing = old.cycle_forcing
+             self.coupling_time = old.coupling_time
+ 
+@@ -46,7 +46,7 @@
+         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, "interp_forcing", "interpolate in time between requested forcing values ? (0 or 1)"))
+         string = "%s\n%s" % (string, fielddisplay(self, "cycle_forcing", "cycle through forcing ? (0 or 1)"))
+         string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "coupling time steps with ocean model [yr]"))
+         return string
+@@ -60,8 +60,8 @@
+         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
++        #should we interpolate forcing between timesteps?
++        self.interp_forcing = 1
+         self.cycle_forcing   = 0
+         return self
+     #}}}
+@@ -74,7 +74,7 @@
+         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.interp_forcing', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+ 
+@@ -89,7 +89,7 @@
+         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', 'interp_forcing', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cycle_forcing', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
+     # }}}
+Index: ../trunk-jpl/test/NightlyRun/test240.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test240.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test240.m	(revision 26208)
+@@ -38,7 +38,7 @@
+ md.timestepping.time_step=0.5;
+ md.settings.output_frequency=1;
+ md.timestepping.final_time=2;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ md=setflowequation(md,'SSA','all');
+ md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
+Index: ../trunk-jpl/test/NightlyRun/test240.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test240.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test240.py	(revision 26208)
+@@ -44,7 +44,7 @@
+ md.timestepping.time_step = 0.5
+ md.settings.output_frequency = 1
+ md.timestepping.final_time = 2
+-md.timestepping.interp_forcings = 0
++md.timestepping.interp_forcing = 0
+ 
+ md = setflowequation(md, 'SSA', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+Index: ../trunk-jpl/test/NightlyRun/test241.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test241.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test241.m	(revision 26208)
+@@ -8,7 +8,7 @@
+ md.timestepping.time_step=1.;
+ md.settings.output_frequency=1;
+ md.timestepping.final_time=4.;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ %Set up transient
+ smb=ones(md.mesh.numberofvertices,1)*3.6;
+Index: ../trunk-jpl/test/NightlyRun/test241.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test241.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test241.py	(revision 26208)
+@@ -18,7 +18,7 @@
+ md.timestepping.time_step = 1.
+ md.settings.output_frequency = 1
+ md.timestepping.final_time = 4.
+-md.timestepping.interp_forcings = False
++md.timestepping.interp_forcing = False
+ 
+ #Set up transient
+ smb = np.ones((md.mesh.numberofvertices)) * 3.6
+Index: ../trunk-jpl/test/NightlyRun/test242.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test242.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test242.m	(revision 26208)
+@@ -9,7 +9,7 @@
+ md.timestepping.time_step=1;
+ md.settings.output_frequency=1;
+ md.timestepping.final_time=4;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ %Set up transient
+ smb=ones(md.mesh.numberofvertices,1)*3.6;
+Index: ../trunk-jpl/test/NightlyRun/test242.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test242.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test242.py	(revision 26208)
+@@ -19,7 +19,7 @@
+ md.timestepping.time_step = 1.
+ md.settings.output_frequency = 1
+ md.timestepping.final_time = 4.
+-md.timestepping.interp_forcings = False
++md.timestepping.interp_forcing = False
+ 
+ #Set up transient
+ smb = np.ones((md.mesh.numberofvertices)) * 3.6
+Index: ../trunk-jpl/test/NightlyRun/test244.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test244.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test244.m	(revision 26208)
+@@ -39,7 +39,7 @@
+ md.timestepping.start_time=1965;
+ md.timestepping.final_time=1965.75;
+ md.timestepping.time_step=1/365.0;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ %dakota version
+ version=IssmConfig('_DAKOTA_VERSION_'); version=version(1:3); version=str2num(version);
+Index: ../trunk-jpl/test/NightlyRun/test244.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test244.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test244.py	(revision 26208)
+@@ -59,7 +59,7 @@
+ md.timestepping.start_time = 1965.
+ md.timestepping.final_time = 1965.75
+ md.timestepping.time_step = 1. / 365.0
+-md.timestepping.interp_forcings = 0.
++md.timestepping.interp_forcing = 0.
+ 
+ #dakota version
+ version = IssmConfig('_DAKOTA_VERSION_')
+Index: ../trunk-jpl/test/NightlyRun/test247.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test247.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test247.m	(revision 26208)
+@@ -98,7 +98,7 @@
+ md.timestepping.time_step=0.5;
+ md.settings.output_frequency=1;
+ md.timestepping.final_time=2;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ %md.transient.requested_outputs={'default','IceVolumeAboveFloatation','IceVolume','TemperaturePDD','SmbMonthlytemperatures','SmbPrecipitation'};
+ md.transient.requested_outputs={'default','IceVolumeAboveFloatation','IceVolume','TemperaturePDD'};
+Index: ../trunk-jpl/test/NightlyRun/test247.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test247.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test247.py	(revision 26208)
+@@ -112,7 +112,7 @@
+ md.timestepping.time_step = 0.5
+ md.settings.output_frequency = 1
+ md.timestepping.final_time = 2
+-md.timestepping.interp_forcings = 0
++md.timestepping.interp_forcing = 0
+ 
+ md.transient.requested_outputs = ['default', 'IceVolumeAboveFloatation','IceVolume','TemperaturePDD']
+ md=setflowequation(md,'SSA','all')
+Index: ../trunk-jpl/test/NightlyRun/test252.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test252.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test252.m	(revision 26208)
+@@ -34,7 +34,7 @@
+ md.smb.eAir=md.smb.eAir(:,1:365*8);
+ md.smb.pAir=md.smb.pAir(:,1:365*8);
+ 
+-md.smb.isclimatology=1;
++md.timestepping.cycle_forcing=1;
+ 
+ %smb settings
+ md.smb.requested_outputs={'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC','SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC'};
+@@ -48,7 +48,7 @@
+ md.timestepping.start_time=1965.6;
+ md.timestepping.final_time=1966.6;
+ md.timestepping.time_step=1/365.0;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ %Run transient
+ md=solve(md,'Transient');
+Index: ../trunk-jpl/test/NightlyRun/test252.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test252.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test252.py	(revision 26208)
+@@ -50,7 +50,7 @@
+ md.smb.eAir = md.smb.eAir[:, 0:365 * 8]
+ md.smb.pAir = md.smb.pAir[:, 0:365 * 8]
+ 
+-md.smb.isclimatology = 1
++md.timestepping.cycle_forcing = 1
+ 
+ #smb settings
+ md.smb.requested_outputs = ['SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbEC', 'SmbA', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC']
+@@ -64,7 +64,7 @@
+ md.timestepping.start_time = 1965.6
+ md.timestepping.final_time = 1966.6
+ md.timestepping.time_step = 1. / 365.0
+-md.timestepping.interp_forcings = 0.
++md.timestepping.interp_forcing = 0.
+ 
+ #Run transient
+ md = solve(md, 'Transient')
+Index: ../trunk-jpl/test/NightlyRun/test253.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test253.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test253.m	(revision 26208)
+@@ -36,7 +36,7 @@
+ md.smb.eAir=md.smb.eAir(:,1:365*8);
+ md.smb.pAir=md.smb.pAir(:,1:365*8);
+ 
+-md.smb.isclimatology=1;
++md.timestepping.cycle_forcing=1;
+ md.smb.isconstrainsurfaceT=1;
+ 
+ %smb settings
+@@ -51,7 +51,7 @@
+ md.timestepping.start_time=1965.6;
+ md.timestepping.final_time=1966.6;
+ md.timestepping.time_step=1/365.0;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ %Run transient
+ md=solve(md,'Transient');
+Index: ../trunk-jpl/test/NightlyRun/test253.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test253.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test253.py	(revision 26208)
+@@ -50,7 +50,7 @@
+ md.smb.eAir = md.smb.eAir[:, 0:365 * 8]
+ md.smb.pAir = md.smb.pAir[:, 0:365 * 8]
+ 
+-md.smb.isclimatology = 1
++md.timestepping.cycle_forcing = 1
+ md.smb.isconstrainsurfaceT = 1
+ 
+ #smb settings
+@@ -65,7 +65,7 @@
+ md.timestepping.start_time = 1965.6
+ md.timestepping.final_time = 1966.6
+ md.timestepping.time_step = 1. / 365.0
+-md.timestepping.interp_forcings = 0.
++md.timestepping.interp_forcing = 0.
+ 
+ #Run transient
+ md = solve(md, 'Transient')
+Index: ../trunk-jpl/test/NightlyRun/test292.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test292.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test292.m	(revision 26208)
+@@ -6,7 +6,7 @@
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.basalforcings=linearbasalforcings(md.basalforcings);
+ md.basalforcings.deepwater_melting_rate=[50 100;0 5];
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test292.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test292.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test292.py	(revision 26208)
+@@ -18,7 +18,7 @@
+ 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.timestepping.interp_forcing = 0
+ md = solve(md, 'Transient')
+ 
+ # Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test3201.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3201.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test3201.m	(revision 26208)
+@@ -9,7 +9,7 @@
+ md.cluster = generic('np',2);
+ 
+ %Create real time series for B
+-md.timestepping.interp_forcings = 0;
++md.timestepping.interp_forcing = 0;
+ md.timestepping.final_time = 2*md.timestepping.time_step;
+ md.materials.rheology_B = 1.8e8*ones(md.mesh.numberofelements,2);
+ md.materials.rheology_B(find(mean(md.mesh.x(md.mesh.elements),2)<mean(md.mesh.y(md.mesh.elements),2)),2)=1.4e8;
+Index: ../trunk-jpl/test/NightlyRun/test3202.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3202.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test3202.m	(revision 26208)
+@@ -9,7 +9,7 @@
+ md.cluster = generic('np',2);
+ 
+ %Create real time series for B
+-md.timestepping.interp_forcings = 0;
++md.timestepping.interp_forcing = 0;
+ md.timestepping.final_time = 2*md.timestepping.time_step;
+ md.materials.rheology_B = 1.8e8*ones(md.mesh.numberofvertices,2);
+ md.materials.rheology_B(find(md.mesh.x<md.mesh.y),2)=1.4e8;
+Index: ../trunk-jpl/test/NightlyRun/test3480.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3480.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test3480.m	(revision 26208)
+@@ -37,7 +37,7 @@
+ 	'weights_string','WeightsSurfaceObservation',...
+ 	'datatime',0.75);
+ 
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ md.timestepping.time_step=0.5;
+ md.timestepping.final_time=1.5;
+ 
+Index: ../trunk-jpl/test/NightlyRun/test3481.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3481.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test3481.m	(revision 26208)
+@@ -44,7 +44,7 @@
+ 	'weights_string','WeightsSurfaceObservation',...
+ 	'datatime',0.75);
+ 
+-md.timestepping.interp_forcings=1;
++md.timestepping.interp_forcing=1;
+ md.timestepping.time_step=0.5;
+ md.timestepping.final_time=1.5;
+ 
+Index: ../trunk-jpl/test/NightlyRun/test352.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test352.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test352.m	(revision 26208)
+@@ -15,7 +15,7 @@
+ md.smb.mass_balance=[smb; [1.5 3.]];
+ md.transient.isthermal=0;
+ 
+-md.smb.isclimatology=1;
++md.timestepping.cycle_forcing=1;
+ 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test352.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test352.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test352.py	(revision 26208)
+@@ -25,7 +25,7 @@
+ md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+ md.transient.isthermal = False
+ 
+-md.smb.isclimatology = 1
++md.timestepping.cycle_forcing = 1
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test353.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test353.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test353.m	(revision 26208)
+@@ -19,7 +19,7 @@
+ md.smb.evaporation=[smb/2; [1.5 3.]];
+ md.transient.isthermal=0;
+ 
+-md.smb.isclimatology=1;
++md.timestepping.cycle_forcing=1;
+ 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test353.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test353.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test353.py	(revision 26208)
+@@ -29,7 +29,7 @@
+ md.smb.evaporation = np.vstack((smb / 2, [1.5, 3.]))
+ md.transient.isthermal = False
+ 
+-md.smb.isclimatology = 1
++md.timestepping.cycle_forcing = 1
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test354.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test354.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test354.m	(revision 26208)
+@@ -20,7 +20,7 @@
+ md.smb.evaporation=[smb/2; [1.5 3.]];
+ md.transient.isthermal=0;
+ 
+-md.smb.isclimatology=1;
++md.timestepping.cycle_forcing=1;
+ 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test354.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test354.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test354.py	(revision 26208)
+@@ -30,7 +30,7 @@
+ md.smb.refreeze = np.vstack((smb, [1.5, 3.]))
+ md.transient.isthermal = False
+ 
+-md.smb.isclimatology = 1
++md.timestepping.cycle_forcing = 1
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26207)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26208)
+@@ -189,7 +189,7 @@
+ 	md.timestepping.start_time=-1;
+ 	md.timestepping.final_time=nt;
+ 	md.timestepping.time_step=1;
+-	md.timestepping.interp_forcings=0;
++	md.timestepping.interp_forcing=0;
+ 	md.settings.output_frequency=1;
+ 
+ 	md.cluster=generic('name',oshostname(),'np',3);
+Index: ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 26207)
++++ ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 26208)
+@@ -268,7 +268,7 @@
+ 	md.timestepping.start_time=-1;
+ 	md.timestepping.final_time=nt;
+ 	md.timestepping.time_step=1;
+-	md.timestepping.interp_forcings=0;
++	md.timestepping.interp_forcing=0;
+ 	md.settings.output_frequency=1;
+ 
+ 	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26207)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26208)
+@@ -416,12 +416,21 @@
+ 
+ 	/*First, recover current time from parameters: */
+ 	bool linear_interp,cycle;
+-	this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum);
++	IssmDouble dt;
++	this->parameters->FindParam(&linear_interp,TimesteppingInterpForcingEnum);
+ 	this->parameters->FindParam(&cycle,TimesteppingCycleForcingEnum);
++	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);          /*transient core time step*/
+ 
+ 	/*Change input time if we cycle through the forcing*/
+ 	IssmDouble time0 = this->timesteps[0];
+ 	IssmDouble time1 = this->timesteps[this->numtimesteps - 1];
++
++	/*We need the end time to be the last timestep that would be taken*/
++	/* i.e., the case where GEMB has time stamps (finer timestep) after the last timestep */
++	IssmDouble nsteps = reCast<int,IssmDouble>(time1/dt);
++	if (reCast<IssmDouble>(nsteps)<time1/dt) nsteps=nsteps+1;
++	time1 = nsteps*dt;
++
+ 	if(cycle && (time<time0 || time>time1)){
+ 
+ 		/*See by how many intervals we have to offset time*/
+@@ -432,7 +441,7 @@
+ 
+ 		/*Uncomment following line if you would like to apply a cycle BEFORE the time series starts*/
+ 		//if(time<time0) num_intervals = -num_intervals-1;
+-		
++
+ 		if(fabs(time-time0)/deltat == reCast<IssmDouble>(num_intervals)){
+ 			/*Hack to make sure we always cover the last value of the series (discussion with Nicole)*/
+ 			time = time1;
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26207)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26208)
+@@ -158,7 +158,7 @@
+ 			/*Nothing to add to parameters*/
+ 			break;
+ 		case LinearFloatingMeltRateEnum:
+-			iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
++			iomodel->FindConstant(&interp,"md.timestepping.interp_forcing");
+ 			iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
+ 			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.deepwater_melting_rate");
+ 			if(N==1){
+@@ -223,7 +223,7 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.lowercrustheat",BasalforcingsLowercrustheatEnum));
+ 			break;
+ 		case BasalforcingsPicoEnum:
+-			iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
++			iomodel->FindConstant(&interp,"md.timestepping.interp_forcing");
+ 			iomodel->FindConstant(&cycle,"md.timestepping.cycle_forcing");
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsPicoNumBasinsEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.maxboxcount",BasalforcingsPicoMaxboxcountEnum));
+@@ -266,7 +266,7 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.start_time",TimesteppingStartTimeEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.final_time",TimesteppingFinalTimeEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step",TimesteppingTimeStepEnum));
+-			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcings",TimesteppingInterpForcingsEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcing",TimesteppingInterpForcingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cycle_forcing",TimesteppingCycleForcingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.coupling_time",TimesteppingCouplingTimeEnum));
+ 			break;
+@@ -276,7 +276,7 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step_min",TimesteppingTimeStepMinEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step_max",TimesteppingTimeStepMaxEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cfl_coefficient",TimesteppingCflCoefficientEnum));
+-			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcings",TimesteppingInterpForcingsEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcing",TimesteppingInterpForcingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cycle_forcing",TimesteppingCycleForcingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.coupling_time",TimesteppingCouplingTimeEnum));
+ 			break;
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26207)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26208)
+@@ -38,15 +38,13 @@
+ 	IssmDouble timeclim=0.0;
+ 	IssmDouble t,smb_dt;
+    IssmDouble delta;
+-	bool       isclimatology=false;
+ 	bool       linear_interp=true;
+ 
+-	femmodel->parameters->FindParam(&linear_interp,TimesteppingInterpForcingsEnum); /*is interpolation requested*/
++	femmodel->parameters->FindParam(&linear_interp,TimesteppingInterpForcingEnum); /*is interpolation requested*/
+ 	femmodel->parameters->FindParam(&time,TimeEnum);                        /*transient core time at which we run the smb core*/
+    femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);          /*transient core time step*/
+ 	femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+    femmodel->parameters->FindParam(&smb_dt,SmbDtEnum);                     /*time period for the smb solution,  usually smaller than the glaciological dt*/
+-	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
+ 
+ 	//before starting loop, realize that the transient core runs this smb_core at time = time +deltaT.
+ 	//go back to time - deltaT:
+@@ -62,20 +60,6 @@
+ 			Element* element=xDynamicCast<Element*>(object);
+ 
+ 			timeclim=time;
+-			if (isclimatology){
+-				//If this is a climatology, we need to repeat the forcing after the final time
+-				TransientInput* Ta_input_tr  = element->inputs->GetTransientInput(SmbTaEnum);    _assert_(Ta_input_tr);
+-
+-				/*Get temperature climatology value*/
+-				int offsetend = Ta_input_tr->GetTimeInputOffset(finaltime);
+-				IssmDouble time0     = Ta_input_tr->GetTimeByOffset(-1);
+-				IssmDouble timeend   = Ta_input_tr->GetTimeByOffset(offsetend);
+-				timeend   = ceil(timeend/dt)*dt;
+-				if (time>time0 & timeend>time0){
+-					delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+-					timeclim=time0+delta;
+-				}
+-			}
+ 			if (linear_interp) timeinputs = t-time+timeclim;
+ 			else timeinputs = t-time+timeclim+smb_dt/2;
+ 			element->SmbGemb(timeinputs,count);
+@@ -514,13 +498,13 @@
+ 	//  For TWO LAYER
+ 	//  clabIce  = concentration of light absorbing carbon of first ice layer [ppm1], default 0
+ 
+-	// Methods 3
++	// Method 3
+ 	//   d       = snow surface density [kg m-3]
+ 	//   n       = cloud amount
+ 	//   aIce    = albedo of ice
+ 	//   aSnow   = albedo of fresh snow
+ 
+-	// Methods 4
++	// Method 4
+ 	//   aIce    = albedo of ice
+ 	//   aSnow   = albedo of fresh snow
+ 	//   a       = grid cell albedo from prevous time step;
+@@ -660,7 +644,7 @@
+ 
+ 		//If we do not have fresh snow
+ 		if (aIdx<3 && aIdx>0 && (adThresh - d[0])>=Dtol){
+-			// In a layer < 10cm, account for mix of ice and snow,
++			// In a snow layer < 10cm, account for mix of ice and snow,
+ 			// after P. Alexander et al., 2014
+ 			IssmDouble depthsnow=0.0;
+ 			IssmDouble aice=0.0;
+@@ -1094,7 +1078,7 @@
+ 	// swIdx = 0 : all absorbed SW energy is assigned to the top grid cell
+ 
+ 	// swIdx = 1 : absorbed SW is distributed with depth as a function of:
+-	//   default   : snow density (taken from Bassford, 2004)
++	//   default   : snow density (taken from Bassford, 2002)
+ 	//   if aIdx=2 : grain size in 3 spectral bands (Brun et al., 1992)
+ 
+ 	// Inputs
+@@ -1176,7 +1160,7 @@
+ 			swfS[1] = (sF[1] * dsw) * (1.0 - a1);
+ 			swfS[2] = (sF[2] * dsw) * (1.0 - a2);
+ 
+-			// absorption coeficient for spectral range:
++			// absorption coefficient for spectral range:
+ 			h =xNew<IssmDouble>(m);
+ 			B1 =xNew<IssmDouble>(m);
+ 			B2 =xNew<IssmDouble>(m);
+@@ -1364,7 +1348,7 @@
+ 			//dSnow = 360; //FirnMICE Lundin et al., 2017
+ 			break;
+ 
+-		case 2: // Density of Greenland snow, Fausto et al., 2008
++		case 2: // Density of Greenland snow, Fausto et al., 2018
+ 			dSnow = 315;
+ 			break;
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26207)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26208)
+@@ -407,7 +407,6 @@
+ syn keyword cConstant SmbInitDensityScalingEnum
+ syn keyword cConstant SmbIsaccumulationEnum
+ syn keyword cConstant SmbIsalbedoEnum
+-syn keyword cConstant SmbIsclimatologyEnum
+ syn keyword cConstant SmbIsconstrainsurfaceTEnum
+ syn keyword cConstant SmbIsd18opdEnum
+ syn keyword cConstant SmbIsdelta18oEnum
+@@ -476,7 +475,7 @@
+ syn keyword cConstant TimesteppingCflCoefficientEnum
+ syn keyword cConstant TimesteppingCouplingTimeEnum
+ syn keyword cConstant TimesteppingFinalTimeEnum
+-syn keyword cConstant TimesteppingInterpForcingsEnum
++syn keyword cConstant TimesteppingInterpForcingEnum
+ syn keyword cConstant TimesteppingCycleForcingEnum
+ syn keyword cConstant TimesteppingStartTimeEnum
+ syn keyword cConstant TimesteppingTimeStepEnum
+@@ -1455,7 +1454,6 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
+-syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1462,8 +1460,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DataSetParam
+ syn keyword cType DatasetInput
+-syn keyword cType DataSetParam
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1476,8 +1474,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType ElementVector
+ syn keyword cType Elements
+-syn keyword cType ElementVector
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1484,12 +1482,11 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1504,7 +1501,6 @@
+ 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
+@@ -1515,7 +1511,6 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
+-syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1528,8 +1523,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType OptionUtilities
+ syn keyword cType Options
+-syn keyword cType OptionUtilities
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1543,13 +1538,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType RiftStruct
+ syn keyword cType Riftfront
+-syn keyword cType RiftStruct
+ syn keyword cType SealevelMasks
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType SegRef
+ syn keyword cType Segment
+-syn keyword cType SegRef
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1568,6 +1563,10 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26207)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26208)
+@@ -401,7 +401,6 @@
+ 	SmbInitDensityScalingEnum,
+ 	SmbIsaccumulationEnum,
+ 	SmbIsalbedoEnum,
+-	SmbIsclimatologyEnum,
+ 	SmbIsconstrainsurfaceTEnum,
+ 	SmbIsd18opdEnum,
+ 	SmbIsdelta18oEnum,
+@@ -470,7 +469,7 @@
+ 	TimesteppingCflCoefficientEnum,
+ 	TimesteppingCouplingTimeEnum,
+ 	TimesteppingFinalTimeEnum,
+-	TimesteppingInterpForcingsEnum,
++	TimesteppingInterpForcingEnum,
+ 	TimesteppingCycleForcingEnum,
+ 	TimesteppingStartTimeEnum,
+ 	TimesteppingTimeStepEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26207)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26208)
+@@ -409,7 +409,6 @@
+ 		case SmbInitDensityScalingEnum : return "SmbInitDensityScaling";
+ 		case SmbIsaccumulationEnum : return "SmbIsaccumulation";
+ 		case SmbIsalbedoEnum : return "SmbIsalbedo";
+-		case SmbIsclimatologyEnum : return "SmbIsclimatology";
+ 		case SmbIsconstrainsurfaceTEnum : return "SmbIsconstrainsurfaceT";
+ 		case SmbIsd18opdEnum : return "SmbIsd18opd";
+ 		case SmbIsdelta18oEnum : return "SmbIsdelta18o";
+@@ -478,7 +477,7 @@
+ 		case TimesteppingCflCoefficientEnum : return "TimesteppingCflCoefficient";
+ 		case TimesteppingCouplingTimeEnum : return "TimesteppingCouplingTime";
+ 		case TimesteppingFinalTimeEnum : return "TimesteppingFinalTime";
+-		case TimesteppingInterpForcingsEnum : return "TimesteppingInterpForcings";
++		case TimesteppingInterpForcingEnum : return "TimesteppingInterpForcing";
+ 		case TimesteppingCycleForcingEnum : return "TimesteppingCycleForcing";
+ 		case TimesteppingStartTimeEnum : return "TimesteppingStartTime";
+ 		case TimesteppingTimeStepEnum : return "TimesteppingTimeStep";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26207)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26208)
+@@ -418,7 +418,6 @@
+ 	      else if (strcmp(name,"SmbInitDensityScaling")==0) return SmbInitDensityScalingEnum;
+ 	      else if (strcmp(name,"SmbIsaccumulation")==0) return SmbIsaccumulationEnum;
+ 	      else if (strcmp(name,"SmbIsalbedo")==0) return SmbIsalbedoEnum;
+-	      else if (strcmp(name,"SmbIsclimatology")==0) return SmbIsclimatologyEnum;
+ 	      else if (strcmp(name,"SmbIsconstrainsurfaceT")==0) return SmbIsconstrainsurfaceTEnum;
+ 	      else if (strcmp(name,"SmbIsd18opd")==0) return SmbIsd18opdEnum;
+ 	      else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum;
+@@ -487,7 +486,7 @@
+ 	      else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum;
+ 	      else if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
+-	      else if (strcmp(name,"TimesteppingInterpForcings")==0) return TimesteppingInterpForcingsEnum;
++	      else if (strcmp(name,"TimesteppingInterpForcing")==0) return TimesteppingInterpForcingEnum;
+ 	      else if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
+ 	      else if (strcmp(name,"TimesteppingStartTime")==0) return TimesteppingStartTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
+@@ -505,11 +504,11 @@
+ 	      else if (strcmp(name,"TransientIsgia")==0) return TransientIsgiaEnum;
+ 	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+ 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
++	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+-	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
++	      if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+ 	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+@@ -628,11 +627,11 @@
+ 	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+ 	      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 stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"EplHeadSlopeX")==0) return EplHeadSlopeXEnum;
+-	      else if (strcmp(name,"EplHeadSlopeY")==0) return EplHeadSlopeYEnum;
++	      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,"EsaEmotion")==0) return EsaEmotionEnum;
+@@ -751,11 +750,11 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"RadarPowerWolff")==0) return RadarPowerWolffEnum;
+-	      else if (strcmp(name,"RheologyBAbsGradient")==0) return RheologyBAbsGradientEnum;
++	      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;
+@@ -874,11 +873,11 @@
+ 	      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 if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+-	      else if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
++	      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;
+@@ -997,11 +996,11 @@
+ 	      else if (strcmp(name,"Outputdefinition17")==0) return Outputdefinition17Enum;
+ 	      else if (strcmp(name,"Outputdefinition18")==0) return Outputdefinition18Enum;
+ 	      else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum;
++	      else if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
+-	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
++	      if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+ 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+@@ -1120,11 +1119,11 @@
+ 	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"BuddJacka")==0) return BuddJackaEnum;
+-	      else if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
++	      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;
+@@ -1243,11 +1242,11 @@
+ 	      else if (strcmp(name,"Indexed")==0) return IndexedEnum;
+ 	      else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
+ 	      else if (strcmp(name,"ElementInput")==0) return ElementInputEnum;
++	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
+-	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
++	      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,"Inputs")==0) return InputsEnum;
+@@ -1366,11 +1365,11 @@
+ 	      else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
+ 	      else if (strcmp(name,"SamplingAnalysis")==0) return SamplingAnalysisEnum;
+ 	      else if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
++	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
+          else stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
+-	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
++	      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;
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26208)
+@@ -5,7 +5,6 @@
+ 
+ classdef SMBcomponents
+ 	properties (SetAccess=public)
+-		isclimatology = 0;
+ 		accumulation = NaN;
+ 		runoff = NaN;
+ 		evaporation = NaN;
+@@ -64,15 +63,6 @@
+ 			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+ 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+ 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+-			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) :'));
+@@ -79,7 +69,6 @@
+ 			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
+ 			fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
+ 			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
+-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+ 			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+ 			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+ 			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+@@ -105,7 +94,6 @@
+ 				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 % }}}
+ 	end
+Index: ../trunk-jpl/src/m/classes/SMBforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBforcing.m	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBforcing.m	(revision 26208)
+@@ -5,7 +5,6 @@
+ 
+ classdef SMBforcing
+ 	properties (SetAccess=public)
+-		isclimatology     = 0;
+ 		mass_balance      = NaN;
+ 		steps_per_step    = 1;
+ 		requested_outputs = {};
+@@ -54,17 +53,11 @@
+ 			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]);
+ 			md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2]);
+-			if (self.isclimatology)
+-				md = checkfield(md,'fieldname', 'smb.mass_balance', 'size',[md.mesh.numberofvertices+1],...
+-						'message',['mass_balance must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+-			end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   surface forcings parameters:'));
+ 			fielddisplay(self,'mass_balance','surface mass balance [m/yr ice eq]');
+-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+ 			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+ 			fielddisplay(self,'requested_outputs','additional outputs requested');
+ 			fielddisplay(self,'averaging','averaging methods from short to long steps');
+@@ -89,7 +82,6 @@
+ 				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 % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+@@ -96,7 +88,6 @@
+ 
+ 			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 % }}}
+ 	end
+Index: ../trunk-jpl/src/m/classes/SMBgemb.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26208)
+@@ -21,7 +21,6 @@
+ 		ismelt;
+ 		isdensification;
+ 		isturbulentflux;
+-		isclimatology;
+ 		isconstrainsurfaceT;
+ 
+ 		%inputs:
+@@ -64,7 +63,7 @@
+ 		% 3: density and cloud amount [Greuell & Konzelmann, 1994]
+ 		% 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+ 
+-		swIdx  = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, with snow density (taken from Bassford, 2004))
++		swIdx  = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002))
+ 
+ 		denIdx = NaN; %densification model to use (default is 2):
+ 		% 1 = emperical model of Herron and Langway (1980)
+@@ -78,7 +77,7 @@
+ 		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)
++		% 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
+ 		% 3 = Antarctica model of Kaspers et al. (2004)
+ 		% 4 = Greenland model of Kuipers Munneke et al. (2015)
+ 
+@@ -216,7 +215,6 @@
+ 			self.ismelt=1;
+ 			self.isdensification=1;
+ 			self.isturbulentflux=1;
+-			self.isclimatology=0;
+ 			self.isconstrainsurfaceT=0;
+ 
+ 			self.aIdx = 1;
+@@ -279,7 +277,6 @@
+ 			md = checkfield(md,'fieldname','smb.ismelt','values',[0 1]);
+ 			md = checkfield(md,'fieldname','smb.isdensification','values',[0 1]);
+ 			md = checkfield(md,'fieldname','smb.isturbulentflux','values',[0 1]);
+-			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
+ 			md = checkfield(md,'fieldname','smb.isconstrainsurfaceT','values',[0 1]);
+ 
+ 			md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
+@@ -290,21 +287,6 @@
+ 			md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',200,'size',size(self.Ta));
+ 			md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1,'size',size(self.Ta));
+ 
+-			if (self.isclimatology)
+-				md = checkfield(md,'fieldname', 'smb.Ta', 'size',[md.mesh.numberofelements+1],...
+-					'message',['Ta must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.V', 'size',[md.mesh.numberofelements+1],...
+-					'message',['V must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.dswrf', 'size',[md.mesh.numberofelements+1],...
+-					'message',['dswrf must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.dlwrf', 'size',[md.mesh.numberofelements+1],...
+-					'message',['dlwrf must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.P', 'size',[md.mesh.numberofelements+1],...
+-					'message',['P must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.eAir', 'size',[md.mesh.numberofelements+1],...
+-					'message',['eAir must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+-			end
+-
+ 			md = checkfield(md,'fieldname','smb.Tmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
+ 			md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',0);
+ 			md = checkfield(md,'fieldname','smb.Vmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0);
+@@ -370,7 +352,6 @@
+ 			fielddisplay(self,'isdensification','run densification module (default true)');
+ 			fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)');
+ 			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change');
+-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+ 			fielddisplay(self,'Ta','2 m air temperature, in Kelvin');
+ 			fielddisplay(self,'V','wind speed (m s-1)');
+ 			fielddisplay(self,'dswrf','downward shortwave radiation flux [W/m^2]');
+@@ -436,7 +417,7 @@
+ 					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, with snow density (taken from Bassford, 2004)]');
++			fielddisplay(self,'swIdx','apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]');
+ 			fielddisplay(self,'denIdx',{'densification model to use (default is 2):',...
+ 				'1 = emperical model of Herron and Langway (1980)',...
+ 				'2 = semi-emperical model of Anthern et al. (2010)',...
+@@ -448,7 +429,7 @@
+ 			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)',...
++				'2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',...
+ 				'3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
+ 				'4 = Greenland model of Kuipers Munneke et al. (2015)'});
+ 
+@@ -475,7 +456,6 @@
+ 			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','isconstrainsurfaceT','format','Boolean');
+ 
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26207)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26208)
+@@ -5,7 +5,6 @@
+ 
+ classdef SMBmeltcomponents
+ 	properties (SetAccess=public)
+-		isclimatology = 0;
+ 		accumulation = NaN;
+ 		evaporation = NaN;
+ 		melt = NaN;
+@@ -70,17 +69,6 @@
+ 			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+ 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+ 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+-			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
+-			if (self.isclimatology)
+-				md = checkfield(md,'fieldname', 'smb.accumulation', 'size',[md.mesh.numberofvertices+1],...
+-						'message',['accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.melt', 'size',[md.mesh.numberofvertices+1],...
+-						'message',['melt must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.refreeze', 'size',[md.mesh.numberofvertices+1],...
+-						'message',['refreeze must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+-				md = checkfield(md,'fieldname', 'smb.evaporation', 'size',[md.mesh.numberofvertices+1],...
+-						'message',['evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+-			end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :'));
+@@ -88,7 +76,6 @@
+ 			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
+ 			fielddisplay(self,'melt','amount of ice melt in ice column [m/yr ice eq]');
+ 			fielddisplay(self,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
+-			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+ 			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+ 			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+ 			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+@@ -116,7 +103,6 @@
+ 				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 % }}}
+ 	end
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26207)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26208)
+@@ -165,12 +165,13 @@
+ 					md.settings.results_on_nodes = {'all'};
+ 				end
+ 			end
+-			%2019 Mar 28
++			%2019 Mar 28, updated 2021 April 23
+ 			if isa(md.smb,'SMBcomponents') | isa(md.smb,'SMBmeltcomponents') | isa(md.smb,'SMBforcing') | isa(md.smb,'SMBgemb') 
+ 				if isa(md.smb.isclimatology,'double')
+ 					if prod(size(md.smb.isclimatology)) ~= 1
+ 						md.smb.isclimatology = 0;
+ 					end
++					md.timestepping.cycle_forcing=md.smb.isclimatology;
+ 				end
+ 			end
+ 			%2019 Dec 16
+Index: ../trunk-jpl/src/m/classes/timestepping.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.m	(revision 26207)
++++ ../trunk-jpl/src/m/classes/timestepping.m	(revision 26208)
+@@ -8,7 +8,7 @@
+ 		start_time      = 0.;
+ 		final_time      = 0.;
+ 		time_step       = 0.;
+-		interp_forcings = 1;
++		interp_forcing  = 1;
+ 		cycle_forcing   = 0;
+ 		coupling_time   = 0.;
+ 	end
+@@ -31,8 +31,8 @@
+ 			%final time
+ 			self.final_time=10.*self.time_step;
+ 
+-			%should we interpolate forcings between timesteps?
+-			self.interp_forcings=1;
++			%should we interpolate forcing between timesteps?
++			self.interp_forcing=1;
+ 			self.cycle_forcing=0;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -40,7 +40,7 @@
+ 			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);
+-			md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]);
++			md = checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0 1]);
+ 			if self.final_time-self.start_time<0,
+ 				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
+@@ -57,7 +57,7 @@
+ 			fielddisplay(self,'start_time',['simulation starting time [' unit ']']);
+ 			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
+ 			fielddisplay(self,'time_step',['length of time steps [' unit ']']);
+-			fielddisplay(self,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
++			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
+ 			fielddisplay(self,'cycle_forcing','cycle through forcing ? (0 or 1)');
+ 			fielddisplay(self,'coupling_time',['length of coupling time step with ocean model  [' unit ']']);
+ 
+@@ -69,7 +69,7 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','start_time','format','Double','scale',scale);
+ 			WriteData(fid,prefix,'object',self,'fieldname','final_time','format','Double','scale',scale);
+ 			WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',scale);
+-			WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','interp_forcing','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','cycle_forcing','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',scale);
+ 		end % }}}
+@@ -78,7 +78,7 @@
+ 			writejsdouble(fid,[modelname '.timestepping.start_time'],self.start_time);
+ 			writejsdouble(fid,[modelname '.timestepping.final_time'],self.final_time);
+ 			writejsdouble(fid,[modelname '.timestepping.time_step'],self.time_step);
+-			writejsdouble(fid,[modelname '.timestepping.interp_forcings'],self.interp_forcings);
++			writejsdouble(fid,[modelname '.timestepping.interp_forcing'],self.interp_forcing);
+ 			writejsdouble(fid,[modelname '.timestepping.cycle_forcing'],self.cycle_forcing);
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.py	(revision 26207)
++++ ../trunk-jpl/src/m/classes/timestepping.py	(revision 26208)
+@@ -15,7 +15,7 @@
+         self.start_time = 0.
+         self.final_time = 0.
+         self.time_step = 0.
+-        self.interp_forcings = 1
++        self.interp_forcing = 1
+         self.cycle_forcing = 0
+         self.coupling_time = 0.
+ 
+@@ -29,7 +29,7 @@
+         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, "interp_forcing", "interpolate in time between requested forcing values ? (0 or 1)"))
+         string = "%s\n%s" % (string, fielddisplay(self, "cycle_forcing", "cycle through forcing ? (0 or 1)"))
+         string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "length of coupling time steps with ocean model [yr]"))
+         return string
+@@ -40,8 +40,8 @@
+         self.time_step = 1. / 2.
+         #final time
+         self.final_time = 10. * self.time_step
+-        #should we interpolate forcings between timesteps?
+-        self.interp_forcings = 1
++        #should we interpolate forcing between timesteps?
++        self.interp_forcing = 1
+         self.cycle_forcing = 0
+ 
+         return self
+@@ -55,7 +55,7 @@
+         if self.final_time - self.start_time < 0:
+             md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
+             md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+-        md = checkfield(md, 'fieldname', 'timestepping.interp_forcings', 'numel', [1], 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'timestepping.interp_forcing', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
+ 
+         return md
+@@ -68,7 +68,7 @@
+         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', 'interp_forcing', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'cycle_forcing', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
+     # }}}
+Index: ../trunk-jpl/test/NightlyRun/test243.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test243.m	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test243.m	(revision 26208)
+@@ -41,7 +41,7 @@
+ md.timestepping.start_time=1965;
+ md.timestepping.final_time=1966;
+ md.timestepping.time_step=1/365.0;
+-md.timestepping.interp_forcings=0;
++md.timestepping.interp_forcing=0;
+ 
+ %Run transient
+ md=solve(md,'Transient');
+Index: ../trunk-jpl/test/NightlyRun/test243.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test243.py	(revision 26207)
++++ ../trunk-jpl/test/NightlyRun/test243.py	(revision 26208)
+@@ -59,7 +59,7 @@
+ md.timestepping.start_time = 1965.
+ md.timestepping.final_time = 1966.
+ md.timestepping.time_step = 1.0 / 365
+-md.timestepping.interp_forcings = 0.
++md.timestepping.interp_forcing = 0.
+ 
+ #Run transient
+ md = solve(md, 'Transient')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26208-26209.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26208-26209.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26208-26209.diff	(revision 26740)
@@ -0,0 +1,70 @@
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26208)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26209)
+@@ -11,6 +11,7 @@
+ 		steps_per_step = 1;
+ 		averaging = 0;
+ 		requested_outputs     = {};
++		isclimatology;
+ 	end
+ 	methods
+ 		function self = SMBcomponents(varargin) % {{{
+Index: ../trunk-jpl/src/m/classes/SMBforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBforcing.m	(revision 26208)
++++ ../trunk-jpl/src/m/classes/SMBforcing.m	(revision 26209)
+@@ -9,6 +9,7 @@
+ 		steps_per_step    = 1;
+ 		requested_outputs = {};
+ 		averaging         = 0;
++		isclimatology;
+ 	end
+ 	methods
+ 		function self = SMBforcing(varargin) % {{{
+Index: ../trunk-jpl/src/m/classes/SMBgemb.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26208)
++++ ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26209)
+@@ -22,6 +22,7 @@
+ 		isdensification;
+ 		isturbulentflux;
+ 		isconstrainsurfaceT;
++		isclimatology;
+ 
+ 		%inputs:
+ 		Ta    = NaN; %2 m air temperature, in Kelvin
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26208)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26209)
+@@ -12,6 +12,7 @@
+ 		steps_per_step=1;
+ 		averaging = 0;
+ 		requested_outputs      = {};
++		isclimatology;
+ 	end
+ 	methods
+ 		function self = SMBmeltcomponents(varargin) % {{{
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26208)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26209)
+@@ -167,11 +167,13 @@
+ 			end
+ 			%2019 Mar 28, updated 2021 April 23
+ 			if isa(md.smb,'SMBcomponents') | isa(md.smb,'SMBmeltcomponents') | isa(md.smb,'SMBforcing') | isa(md.smb,'SMBgemb') 
+-				if isa(md.smb.isclimatology,'double')
+-					if prod(size(md.smb.isclimatology)) ~= 1
+-						md.smb.isclimatology = 0;
++				if any(strcmp(fieldnames(md.smb),'isclimatology'))
++					if isa(md.smb.isclimatology,'double')
++						if prod(size(md.smb.isclimatology)) ~= 1
++							md.smb.isclimatology = 0;
++						end
++						md.timestepping.cycle_forcing=md.smb.isclimatology;
+ 					end
+-					md.timestepping.cycle_forcing=md.smb.isclimatology;
+ 				end
+ 			end
+ 			%2019 Dec 16
Index: /issm/oecreview/Archive/25834-26739/ISSM-26209-26210.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26209-26210.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26209-26210.diff	(revision 26740)
@@ -0,0 +1,118 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26209)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26210)
+@@ -828,7 +828,6 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26209)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26210)
+@@ -824,7 +824,6 @@
+ 	SmbHrefEnum,
+ 	SmbIsInitializedEnum,
+ 	SmbMAddEnum,
+-	SmbMassBalanceClimateEnum,
+ 	SmbMassBalanceEnum,
+    SmbMassBalanceSubstepEnum,
+    SmbMassBalanceTransientEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26209)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26210)
+@@ -830,7 +830,6 @@
+ 		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";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26209)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26210)
+@@ -848,7 +848,6 @@
+ 	      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;
+@@ -874,11 +873,11 @@
+ 	      else if (strcmp(name,"SmbReini")==0) return SmbReiniEnum;
+ 	      else if (strcmp(name,"SmbRunoff")==0) return SmbRunoffEnum;
+ 	      else if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
++	      else if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
+-	      else if (strcmp(name,"SmbS0gcm")==0) return SmbS0gcmEnum;
++	      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;
+@@ -997,11 +996,11 @@
+ 	      else if (strcmp(name,"Outputdefinition18")==0) return Outputdefinition18Enum;
+ 	      else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum;
+ 	      else if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
++	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+-	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
++	      if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+@@ -1120,11 +1119,11 @@
+ 	      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 stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
+-	      else if (strcmp(name,"CalvingHab")==0) return CalvingHabEnum;
++	      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;
+@@ -1243,11 +1242,11 @@
+ 	      else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
+ 	      else if (strcmp(name,"ElementInput")==0) return ElementInputEnum;
+ 	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
++	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+-	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
++	      if (strcmp(name,"IntParam")==0) return IntParamEnum;
+ 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+ 	      else if (strcmp(name,"Inputs")==0) return InputsEnum;
+ 	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+@@ -1366,11 +1365,11 @@
+ 	      else if (strcmp(name,"SamplingAnalysis")==0) return SamplingAnalysisEnum;
+ 	      else if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
+ 	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
++	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+          else stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+-	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
++	      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;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26210-26211.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26210-26211.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26210-26211.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/test/MITgcm/install.sh
+===================================================================
+--- ../trunk-jpl/test/MITgcm/install.sh	(revision 26210)
++++ ../trunk-jpl/test/MITgcm/install.sh	(revision 26211)
+@@ -1,10 +1,26 @@
+ #!/bin/bash
+ 
+-#Some cleanup
++
++# Cleanup
+ rm -rf install
+ 
+-#Download code from server
+-git clone --depth=1 https://github.com/MITgcm/MITgcm.git
++# # Download source
++# git clone --depth=1 https://github.com/MITgcm/MITgcm.git
+ 
+-#Move
+-mv MITgcm install
++# # Move source to 'install' directory
++# mv MITgcm install
++
++# Temporary freeze of source to tagged release ( remove the following and 
++# uncomment the above once issue is resolved)
++#
++
++# Download source
++wget https://github.com/MITgcm/MITgcm/archive/refs/tags/checkpoint67x.tar.gz
++
++# Uncompress source
++tar -xvzf checkpoint67x.tar.gz
++
++# Move source to 'install' directory
++mv MITgcm-checkpoint67x install
++
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26211-26212.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26211-26212.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26211-26212.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/externalpackages/cmake/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/cmake/install.sh	(revision 26211)
++++ ../trunk-jpl/externalpackages/cmake/install.sh	(revision 26212)
+@@ -6,7 +6,7 @@
+ #
+ VER="3.19.3"
+ 
+-PREFIX="${ISSM_DIR}/cmake/install" # Set to location where external package should be installed
++PREFIX="${ISSM_DIR}/externalpackages/cmake/install" # Set to location where external package should be installed
+ 
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/cmake-${VER}.tar.gz" "cmake-${VER}.tar.gz"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26212-26213.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26212-26213.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26212-26213.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26212)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26213)
+@@ -1415,7 +1415,8 @@
+ 				disp('Recovering old SMBhenning class');
+ 				md.smb=SMBhenning(structmd.surfaceforcings);
+ 			end
+-			if isfield(structmd,'slr'),
++			if isfield(structmd,'slr') && ~isempty(structmd.slr)
++				md.solidearth       = solidearth('Earth');
+ 				disp('Recovering old slr class');
+ 				if isfield(structmd.slr,'sealevel'),
+ 					md.solidearth.sealevel=structmd.slr.sealevel;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26213-26214.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26213-26214.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26213-26214.diff	(revision 26740)
@@ -0,0 +1,245 @@
+Index: ../trunk-jpl/etc/environment.csh
+===================================================================
+--- ../trunk-jpl/etc/environment.csh	(revision 26213)
++++ ../trunk-jpl/etc/environment.csh	(revision 26214)
+@@ -59,7 +59,7 @@
+ set PETSC_ROOT="{$ISSM_EXT_DIR}/petsc/install"
+ if ( -d {$PETSC_ROOT} ) then
+ 	setenv PETSC_ROOT {$PETSC_ROOT}
+-	setenv LD_LIBRARY_PATH "{$PETSC_ROOT}/lib:{$LD_LIBRARY_PATH}"
++	setenv LD_LIBRARY_PATH {$PETSC_ROOT}/lib:{$LD_LIBRARY_PATH}
+ 
+ 	# In case we have installed certain external packages via PETSc
+ 	#
+@@ -72,10 +72,10 @@
+ 	# HDF5
+ 	if ( `find {$PETSC_ROOT}/lib -name libhdf5.*` != "" ) then
+ 		setenv HDF5_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+-		setenv CPATH "{$CPATH}:{$PETSC_ROOT}/include"
+-		setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$PETSC_ROOT}/lib"
+-		setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$PETSC_ROOT}/lib"
+-		setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib"
++		setenv CPATH {$CPATH}:{$PETSC_ROOT}/include
++		setenv LIBRARY_PATH {$LIBRARY_PATH}:{$PETSC_ROOT}/lib
++		setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
++		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
+ 	endif
+ 
+ 	# LAPACK
+@@ -93,45 +93,45 @@
+ 		set MPI_ROOT={$PETSC_ROOT}
+ 		setenv MPI_DIR {$MPI_ROOT}
+ 		setenv MPI_HOME {$MPI_ROOT} # Used in installation of Dakota
+-		setenv MPI_INC_DIR "{$MPI_ROOT}/include"
+-		setenv PATH "{$MPI_ROOT}/bin:{$PATH}"
+-		setenv CPATH "{$MPI_ROOT}/include:{$CPATH}"
+-		setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib"
++		setenv MPI_INC_DIR {$MPI_ROOT}/include
++		setenv PATH {$MPI_ROOT}/bin:{$PATH}
++		setenv CPATH {$MPI_ROOT}/include:{$CPATH}
++		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$MPI_ROOT}/lib
+ 	endif
+ 
+ 	# ZLIB
+ 	if ( `find {$PETSC_ROOT}/lib -name libz.*` != "" ) then
+ 		setenv ZLIB_ROOT "{$PETSC_ROOT}" # Used in installation of NetCDF, GDAL
+-		setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib"
++		setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PETSC_ROOT}/lib
+ 	endif
+ endif
+ 
+ set SCOTCH_ROOT="{$ISSM_EXT_DIR}/scotch/install"
+-if ( -d "{$SCOTCH_ROOT}" ) then
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$SCOTCH_ROOT}/lib"
++if ( -d {$SCOTCH_ROOT} ) then
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SCOTCH_ROOT}/lib
+ endif
+ 
+ set SLEPC_ROOT="{$ISSM_EXT_DIR}/slepc/install"
+-if ( -d "{$SLEPC_ROOT}" ) then
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$SLEPC_ROOT}/lib"
++if ( -d {$SLEPC_ROOT} ) then
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SLEPC_ROOT}/lib
+ endif
+ 
+ set TAO_ROOT="{$ISSM_EXT_DIR}/tao/install"
+-if ( -d "{$TAO_ROOT}" ) then
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$TAO_ROOT}/lib"
++if ( -d {$TAO_ROOT} ) then
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$TAO_ROOT}/lib
+ endif
+ 
+ set DAKOTA_ROOT="{$ISSM_EXT_DIR}/dakota/install"
+-if ( -d "{$DAKOTA_ROOT}" ) then
+-	setenv PATH "{$PATH}:{$DAKOTA_ROOT}/bin"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$DAKOTA_ROOT}/lib"
+-	setenv DYLD_LIBRARY_PATH "{$DAKOTA_ROOT}/lib:{$DYLD_LIBRARY_PATH}"
++if ( -d {$DAKOTA_ROOT} ) then
++	setenv PATH {$PATH}:{$DAKOTA_ROOT}/bin
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$DAKOTA_ROOT}/lib
++	setenv DYLD_LIBRARY_PATH {$DAKOTA_ROOT}/lib:{$DYLD_LIBRARY_PATH}
+ endif
+ 
+ set MERCURIAL_ROOT="{$ISSM_EXT_DIR}/mercurial/install"
+ if ( -d {$MERCURIAL_ROOT} ) then
+-	setenv PYTHONPATH "{$PYTHONPATH}:{$MERCURIAL_ROOT}/mercurial/pure"
+-	setenv PATH "{$PATH}:{$MERCURIAL_ROOT}"
++	setenv PYTHONPATH {$PYTHONPATH}:{$MERCURIAL_ROOT}/mercurial/pure
++	setenv PATH {$PATH}:{$MERCURIAL_ROOT}
+ endif
+ 
+ set BOOST_ROOT="{$ISSM_EXT_DIR}/boost/install"
+@@ -139,107 +139,107 @@
+ 	setenv BOOST_ROOT {$BOOST_ROOT} # Used in installation of Dakota
+ 	setenv BOOST_DIR {$BOOST_ROOT}
+ 	setenv BOOSTROOT {$BOOST_ROOT}
+-	setenv LIBRARY_PATH "{$BOOST_ROOT}/lib:{$LIBRARY_PATH}"
+-	setenv LD_LIBRARY_PATH "{$BOOST_ROOT}/lib:{$LD_LIBRARY_PATH}"
+-	setenv DYLD_LIBRARY_PATH "{$BOOST_ROOT}/lib:{$DYLD_LIBRARY_PATH}"
+-	setenv PATH "{$BOOST_ROOT}/bin:{$PATH}"
++	setenv LIBRARY_PATH {$BOOST_ROOT}/lib:{$LIBRARY_PATH}
++	setenv LD_LIBRARY_PATH {$BOOST_ROOT}/lib:{$LD_LIBRARY_PATH}
++	setenv DYLD_LIBRARY_PATH {$BOOST_ROOT}/lib:{$DYLD_LIBRARY_PATH}
++	setenv PATH {$BOOST_ROOT}/bin:{$PATH}
+ endif
+ 
+ set GSL_ROOT="{$ISSM_EXT_DIR}/gsl/install"
+ if ( -d {$GSL_ROOT} ) then
+ 	setenv GSL_HOME "{$GSL_ROOT}" # Used in installation of Dakota
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GSL_ROOT}/lib"
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_ROOT}/lib
+ endif
+ 
+ set NETCDF_ROOT="{$ISSM_EXT_DIR}/netcdf/install"
+-if ( -d "{$NETCDF_ROOT}" ) then
++if ( -d {$NETCDF_ROOT} ) then
+ 	setenv NETCDF_ROOT "{$NETCDF_ROOT}" # Used in installation of GDAL, GMT
+-	setenv PATH "{$PATH}:{$NETCDF_ROOT}/bin"
+-	setenv CPATH "{$CPATH}:{$NETCDF_ROOT}/include"
+-	setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$NETCDF_ROOT}/lib"
+-	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib"
++	setenv PATH {$PATH}:{$NETCDF_ROOT}/bin
++	setenv CPATH {$CPATH}:{$NETCDF_ROOT}/include
++	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$NETCDF_ROOT}/lib
++	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$NETCDF_ROOT}/lib
+ endif
+ 
+ set CURL_ROOT="{$ISSM_EXT_DIR}/curl/install"
+-if ( -d "{$CURL_ROOT}" ) then
++if ( -d {$CURL_ROOT} ) then
+ 	setenv CURL_ROOT "{$CURL_ROOT}" # Used in installation of NetCDF, GDAL, GMT
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$CURL_ROOT}/lib"
+-	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$CURL_ROOT}/lib"
+-	setenv PATH "{$PATH}:{$CURL_ROOT}/bin"
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$CURL_ROOT}/lib
++	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$CURL_ROOT}/lib
++	setenv PATH {$PATH}:{$CURL_ROOT}/bin
+ endif
+ 
+ set HDF5_ROOT="{$ISSM_EXT_DIR}/hdf5/install"
+-if ( -d "{$HDF5_ROOT}" ) then
++if ( -d {$HDF5_ROOT} ) then
+ 	setenv HDF5_ROOT "{$HDF5_ROOT}" # Used in installation of NetCDF, GDAL
+-	setenv CPATH "{$CPATH}:{$HDF5_ROOT}/include"
+-	setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$HDF5_ROOT}/lib"
+-	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$HDF5_ROOT}/lib"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$HDF5_ROOT}/lib"
++	setenv CPATH {$CPATH}:{$HDF5_ROOT}/include
++	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$HDF5_ROOT}/lib
++	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$HDF5_ROOT}/lib
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$HDF5_ROOT}/lib
+ endif
+ 
+ set SQLITE_ROOT="{$ISSM_EXT_DIR}/sqlite/install"
+-if ( -d "{$SQLITE_ROOT}" ) then
+-	setenv PATH "{$PATH}:{$SQLITE_ROOT}/bin"
+-	setenv LIBRARY_PATH "{$LIBRARY_PATH}:{$SQLITE_ROOT}/lib"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$SQLITE_ROOT}/lib"
++if ( -d {$SQLITE_ROOT} ) then
++	setenv PATH {$PATH}:{$SQLITE_ROOT}/bin
++	setenv LIBRARY_PATH {$LIBRARY_PATH}:{$SQLITE_ROOT}/lib
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$SQLITE_ROOT}/lib
+ endif
+ 
+ set PROJ_ROOT="{$ISSM_EXT_DIR}/proj/install"
+-if ( -d "{$PROJ_ROOT}" ) then
++if ( -d {$PROJ_ROOT} ) then
+ 	setenv PROJ_ROOT "${PROJ_ROOT}" # Used in installation of GDAL
+-	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$PROJ_ROOT}/lib"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$PROJ_ROOT}/lib"
++	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$PROJ_ROOT}/lib
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$PROJ_ROOT}/lib
+ endif
+ 
+ set GDAL_ROOT="{$ISSM_EXT_DIR}/gdal/install"
+-if ( -d "{$GDAL_ROOT}" ) then
++if ( -d {$GDAL_ROOT} ) then
+ 	setenv GDAL_ROOT "{$GDAL_ROOT}" # Used in installation of GMT
+-	setenv PATH "{$GDAL_ROOT}/bin:{$PATH}"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GDAL_ROOT}/lib"
++	setenv PATH {$GDAL_ROOT}/bin:{$PATH}
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GDAL_ROOT}/lib
+ endif
+ 
+ set GSHHG_ROOT="{$ISSM_EXT_DIR}/gshhg/install"
+-if ( -d "{$GSHHG_ROOT}" ) then
++if ( -d {$GSHHG_ROOT} ) then
+ 	setenv GSHHG_ROOT "{$GSHHG_ROOT}" # Used in installation of GMT
+ endif
+ 
+ set GMT_ROOT="{$ISSM_EXT_DIR}/gmt/install"
+-if ( -d "{$GMT_ROOT}" ) then
+-	setenv PATH "{$GMT_ROOT}/bin:{$PATH}"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GMT_ROOT}/lib"
+-	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$GMT_ROOT}/lib"
++if ( -d {$GMT_ROOT} ) then
++	setenv PATH {$GMT_ROOT}/bin:{$PATH}
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GMT_ROOT}/lib
++	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$GMT_ROOT}/lib
+ endif
+ 
+ set GMSH_ROOT="{$ISSM_EXT_DIR}/gmsh/install"
+-if ( -d "{$GMSH_ROOT}" ) then
+-	setenv PATH "{$GMSH_ROOT}/bin:{$PATH}"
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$GMSH_ROOT}/lib"
+-	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$GMSH_ROOT}/lib"
++if ( -d {$GMSH_ROOT} ) then
++	setenv PATH {$GMSH_ROOT}/bin:{$PATH}
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GMSH_ROOT}/lib
++	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$GMSH_ROOT}/lib
+ endif
+ 
+ set TRIANGLE_ROOT="{$ISSM_EXT_DIR}/triangle/install"
+-if ( -d "{$TRIANGLE_ROOT}" ) then
+-	setenv LD_LIBRARY_PATH "{$LD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib"
+-	setenv DYLD_LIBRARY_PATH "{$DYLD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib"
++if ( -d {$TRIANGLE_ROOT} ) then
++	setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib
++	setenv DYLD_LIBRARY_PATH {$DYLD_LIBRARY_PATH}:{$TRIANGLE_ROOT}/lib
+ endif
+ 
+ set YAMS_ROOT="{$ISSM_EXT_DIR}/yams/install"
+ if ( -d {$YAMS_ROOT} ) then
+-	setenv PATH "{$PATH}:{$YAMS_ROOT}"
++	setenv PATH {$PATH}:{$YAMS_ROOT}
+ endif
+ 
+ set VALGRIND_ROOT="{$ISSM_EXT_DIR}/valgrind/install"
+ if ( -d {$VALGRIND_ROOT} ) then
+-	setenv PATH "{$VALGRIND_ROOT}/bin:{$PATH}"
++	setenv PATH {$VALGRIND_ROOT}/bin:{$PATH}
+ endif
+ 
+ set DOXYGEN_ROOT="{$ISSM_EXT_DIR}/doxygen/install"
+ if ( -d {$DOXYGEN_ROOT} ) then
+-	setenv PATH "{$DOXYGEN_ROOT}/bin:{$PATH}"
++	setenv PATH {$DOXYGEN_ROOT}/bin:{$PATH}
+ endif
+ 
+ set SHELL2JUNIT_ROOT="{$ISSM_EXT_DIR}/shell2junit/install"
+ if ( -d {$SHELL2JUNIT_ROOT} ) then
+-	setenv PATH "{$PATH}:{$SHELL2JUNIT_ROOT}/install"
++	setenv PATH {$PATH}:{$SHELL2JUNIT_ROOT}/install
+ endif
Index: /issm/oecreview/Archive/25834-26739/ISSM-26214-26215.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26214-26215.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26214-26215.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch	(revision 26214)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch	(revision 26215)
+@@ -2,10 +2,10 @@
+ > set( DAKOTA_HAVE_MPI ON
+ >  CACHE BOOL "Always build with MPI enabled" FORCE)
+ > set( MPI_INCLUDE_PATH
+->  "$ENV{ISSM_DIR}/externalpackages/mpich/install/include"
++>  "/nasa/hpe/mpt/2.17r13/include"
+ >  CACHE FILEPATH "Use installed MPI headers" FORCE)
+ > set( MPI_LIBRARY
+->  "$ENV{ISSM_DIR}/externalpackages/mpich/install/lib/libmpich.so"
++>  "/nasa/hpe/mpt/2.17r13/lib/libmpi.so"
+ >  CACHE FILEPATH "Use installed MPI library" FORCE)
+ 73,77c73,77
+ < #set(BOOST_ROOT
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh	(revision 26214)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh	(revision 26215)
+@@ -35,8 +35,8 @@
+ cd $DAK_BUILD
+ 
+ cmake \
+-	-DBUILD_SHARED_LIBS=OFF \
+-	-DBUILD_STATIC_LIBS=ON \
++	-DBUILD_SHARED_LIBS=ON \
++	-DBUILD_STATIC_LIBS=OFF \
+ 	-DCMAKE_C_COMPILER=mpicc \
+ 	-DCMAKE_CXX_COMPILER=mpicxx \
+ 	-DCMAKE_Fortran_COMPILER=mpif77 \
Index: /issm/oecreview/Archive/25834-26739/ISSM-26215-26216.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26215-26216.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26215-26216.diff	(revision 26740)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/test/MITgcm/install.sh
+===================================================================
+--- ../trunk-jpl/test/MITgcm/install.sh	(revision 26215)
++++ ../trunk-jpl/test/MITgcm/install.sh	(revision 26216)
+@@ -4,23 +4,24 @@
+ # Cleanup
+ rm -rf install
+ 
+-# # Download source
+-# git clone --depth=1 https://github.com/MITgcm/MITgcm.git
++################################################################################
+ 
+-# # Move source to 'install' directory
+-# mv MITgcm install
++# Download source
++git clone --depth=1 https://github.com/MITgcm/MITgcm.git
+ 
+-# Temporary freeze of source to tagged release ( remove the following and 
+-# uncomment the above once issue is resolved)
+-#
++# Move source to 'install' directory
++mv MITgcm install
+ 
+-# Download source
+-wget https://github.com/MITgcm/MITgcm/archive/refs/tags/checkpoint67x.tar.gz
++################################################################################
+ 
+-# Uncompress source
+-tar -xvzf checkpoint67x.tar.gz
++# Comment out the above, uncomment the following and set to a specific tagged release if the MITgcm repo head is buggy
++#
+ 
+-# Move source to 'install' directory
+-mv MITgcm-checkpoint67x install
++# # Download source
++# wget https://github.com/MITgcm/MITgcm/archive/refs/tags/checkpoint67x.tar.gz
+ 
++# # Uncompress source
++# tar -xvzf checkpoint67x.tar.gz
+ 
++# # Move source to 'install' directory
++# mv MITgcm-checkpoint67x install
Index: /issm/oecreview/Archive/25834-26739/ISSM-26216-26217.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26216-26217.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26216-26217.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive4001.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26217-26218.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26217-26218.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26217-26218.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive4002.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26218-26219.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26218-26219.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26218-26219.diff	(revision 26740)
@@ -0,0 +1,49 @@
+Index: ../trunk-jpl/src/m/plot/applyoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/applyoptions.m	(revision 26218)
++++ ../trunk-jpl/src/m/plot/applyoptions.m	(revision 26219)
+@@ -289,7 +289,44 @@
+ 		shpdisp(filenamei,1,stylei,linewidthi,getfieldvalue(options,'unit',1));
+ 	end
+ end
++if exist(options,'contours'),
+ 
++	hold on;
++	contours=getfieldvalue(options,'contours');
++	style=getfieldvalue(options,'contourstyle',{'-'});
++	linewidth=getfieldvalue(options,'linewidth',{1});
++	color=getfieldvalue(options,'contourcolor',{'r'});
++	contourheight=getfieldvalue(options,'contourheight',1); 
++
++	radius=md.solidearth.planetradius;
++	ratio=1+(contourheight*1000/radius);
++
++	
++	if ~isa(contours,'cell'),
++		contours={contours};
++	end
++	nc=length(contours);
++	if ~isa(style,'cell'), error('contour style should be a cell array'); end
++	if ~isa(linewidth,'cell'), error('contour line width should be a cell array'); end
++	if ~isa(color,'cell'), error('contour color should be a cell array'); end
++
++	for i=1:length(contours),
++		ci=contours{i};
++		if length(style)==1, sti=style{1}; else sti=style{i}; end
++		if length(color)==1, coli=color{1}; else coli=color{i}; end
++		if length(linewidth)==1, li=linewidth{1}; else li=linewidth{i}; end
++
++		for j=1:length(ci),
++			cijx=ci(j).x*ratio;
++			cijy=ci(j).y*ratio;
++			cijz=ci(j).z*ratio;
++
++			plot3(cijx,cijy,cijz,'LineWidth',li,'LineStyle',sti,'Color',coli);
++		end
++	end
++
++end
++
+ %shpdisp3d
+ if exist(options,'shpdisp3d'),
+ 	filename=(getfieldvalue(options,'shpdisp3d'));
Index: /issm/oecreview/Archive/25834-26739/ISSM-26219-26220.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26219-26220.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26219-26220.diff	(revision 26740)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26219)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26220)
+@@ -177,11 +177,23 @@
+ 	fclose(fid);
+ 	%}}}
+ 
+-	%figure out other fields in mesh3dsurface:
++	%a little technicality here. the mesh generate is not exactly on the 
++	%sphere. we create lat,long coordinates, and reproject on an exact sphere. 
+ 	mesh.r=sqrt(mesh.x.^2+mesh.y.^2+mesh.z.^2);
+-	mesh.lat = asin(mesh.z./mesh.r)/pi*180;
+-	mesh.long = atan2(mesh.y,mesh.x)/pi*180;
+ 
++	%make sure we don't have south and north pole: 
++	pos=find(mesh.x==0 & mesh.y==0);
++	mesh.lat = asind(mesh.z./mesh.r);
++	mesh.long = atan2d(mesh.y,mesh.x);
++	pos=find(mesh.lat==90); mesh.lat(pos)=90-.01;
++	pos=find(mesh.lat==-90); mesh.lat(pos)=-90+.01;
++
++	mesh.r=radius*ones(mesh.numberofvertices,1);
++	mesh.x=radius*cosd(mesh.lat).*cosd(mesh.long);
++	mesh.y=radius*cosd(mesh.lat).*sind(mesh.long);
++	mesh.z=radius*sind(mesh.lat);
++
++
+ 	%erase files:
+ 	system('rm -rf sphere.geo sphere.msh sphere.pos');
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26220-26221.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26220-26221.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26220-26221.diff	(revision 26740)
@@ -0,0 +1,47 @@
+Index: ../trunk-jpl/src/m/exp/contourlevelzero.m
+===================================================================
+--- ../trunk-jpl/src/m/exp/contourlevelzero.m	(revision 26220)
++++ ../trunk-jpl/src/m/exp/contourlevelzero.m	(revision 26221)
+@@ -1,7 +1,7 @@
+ function contours=contourlevelzero(md,mask,level)
+-%CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by 
+-%the level value) of a vectorial mask, and vectorialize it into an exp or shp 
+-%compatible structure.
++%CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by the level value) 
++%                   of a vectorial mask, and vectorialize it into an exp or shp compatible 
++%structure.
+ %
+ %   Usage:
+ %      contours=contourlevelzero(md,mask,level)
+@@ -8,12 +8,9 @@
+ %
+ %   See also: PLOT_CONTOUR
+ 
+-if isempty(mask)
+-	error('mask provided is empty');
+-end
+-
+ %process data 
+ if dimension(md.mesh)==3,
++% 	error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
+ 	x = md.mesh.x2d;
+ 	y = md.mesh.y2d;
+ 	index=md.mesh.elements2d;
+@@ -23,14 +20,15 @@
+ 	index=md.mesh.elements;
+ end
+ 
+-if isfield(md.mesh,'z'),
++if isprop(md.mesh,'z'),
+ 	z=md.mesh.z;
+ else
+ 	z=zeros(md.mesh.numberofvertices,1);
+ end
+ 
++if isempty(mask), error('mask provided is empty'); end
+ if dimension(md.mesh)==3,
+-	if length(mask)~=md.mesh.numberofvertices2d, error('Since this is a 3d model, you need to project the mask on a layer (e.g. project2d(md,mask,0))'); end
++	if length(mask)~=md.mesh.numberofvertices2d, error('mask provided should be specified at the vertices of the mesh'); end
+ else
+ 	if length(mask)~=md.mesh.numberofvertices, error('mask provided should be specified at the vertices of the mesh'); end
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26221-26222.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26221-26222.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26221-26222.diff	(revision 26740)
@@ -0,0 +1,4223 @@
+Index: ../trunk-jpl/src/c/classes/SealevelMasks.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelMasks.h	(revision 26221)
++++ ../trunk-jpl/src/c/classes/SealevelMasks.h	(nonexistent)
+@@ -1,34 +0,0 @@
+-/*!\file SealevelMasks.h
+- * \brief: header file for SealevelMask object
+- */
+-
+-#ifndef _SEALEVELMASKS_H_
+-#define _SEALEVELMASKS_H_
+-
+-/*Headers:*/
+-
+-class SealevelMasks {
+-
+-	public: 
+-
+-		bool*       isiceonly;
+-		bool*       isfullyfloating;
+-		bool*       notfullygrounded;
+-		bool*       isoceanin; 
+-		
+-		/*SealevelMasks constructors, destructors :*/
+-		SealevelMasks(int localnel){
+-			/*allocate fields:*/
+-			this->isiceonly=xNew<bool>(localnel);
+-			this->isfullyfloating=xNew<bool>(localnel);
+-			this->notfullygrounded=xNew<bool>(localnel);
+-			this->isoceanin=xNew<bool>(localnel);
+-		};
+-		~SealevelMasks(){
+-			xDelete<bool>(this->isiceonly);
+-			xDelete<bool>(this->isfullyfloating);
+-			xDelete<bool>(this->notfullygrounded);
+-			xDelete<bool>(this->isoceanin);
+-		};
+-};
+-#endif  /* _SEALEVELMASKS_H_ */
+Index: ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 26222)
+@@ -54,6 +54,7 @@
+ 		int        solution_type;
+ 		bool       control_analysis         = false;
+ 		void     (*solutioncore)(FemModel*) = NULL;
++		void     (*solutionprecore)(FemModel*) = NULL;
+ 		bool       nodakotacore             = true;
+ 
+ 		int world_rank;
+@@ -93,8 +94,9 @@
+ 		/*Initialize responses: */
+ 		responses=xNewZeroInit<IssmDouble>(numFns);
+ 
+-		/*Hack:*/
+-		for(int i=0;i<femmodel_init->nummodels;i++) if(femmodel_init->analysis_type_list[i]==SealevelchangeAnalysisEnum) sealevelchange_geometry(femmodel_init);
++		/*Launch cores that are not used during the uncertainty quantification: */
++		WrapperPreCorePointerFromSolutionEnum(&solutionprecore,femmodel_init->parameters,solution_type);
++		if(solutionprecore)solutionprecore(femmodel_init);
+ 
+ 		/*Make a copy of femmodel, so we start this new evaluation run for this specific sample with a brand 
+ 		 * new copy of the model, which has not been tempered with by previous evaluation runs: */
+Index: ../trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp	(revision 26222)
+@@ -0,0 +1,34 @@
++/*!\file:  WrapperPreCorePointerFromSolutionEnum.cpp
++ * \brief: return solution core that is carried out once only for Dakota runs.
++ */ 
++
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++#include "./cores.h"
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++#include "../solutionsequences/solutionsequences.h"
++
++void WrapperPreCorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype){
++
++	/*output: */
++	void (*solutioncore)(FemModel*)=NULL;
++
++	switch(solutiontype){
++
++		case TransientSolutionEnum:
++			solutioncore=&transient_precore;
++			break;
++		default:
++			break;
++	}
++	
++	/*Assign output pointer:*/
++	*psolutioncore=solutioncore;
++
++}
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 26221)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 26222)
+@@ -8,7 +8,7 @@
+ /*forward declarations: */
+ class FemModel;
+ class Parameters;
+-class SealevelMasks;
++class SealevelGeometry;
+ template <class doubletype> class Matrix;
+ template <class doubletype> class Vector;
+ 
+@@ -44,6 +44,7 @@
+ void slopecompute_core(FemModel* femmodel);
+ void steadystate_core(FemModel* femmodel);
+ void transient_core(FemModel* femmodel);
++void transient_precore(FemModel* femmodel);
+ void dakota_core(FemModel* femmodel);
+ void ad_core(FemModel* femmodel);
+ void adgradient_core(FemModel* femmodel);
+@@ -59,9 +60,10 @@
+ /*sealevel change cores:*/
+ #ifdef _HAVE_SEALEVELCHANGE_
+ void sealevelchange_core(FemModel* femmodel);
+-void sealevelchange_geometry(FemModel* femmodel);
++void sealevelchange_initialgeometry(FemModel* femmodel);
++SealevelGeometry* sealevelchange_geometry(FemModel* femmodel);
+ #endif
+-void grd_core(FemModel* femmodel);
++void grd_core(FemModel* femmodel,SealevelGeometry* slgeom);
+ void solidearthexternal_core(FemModel* femmodel);
+ void dynstr_core(FemModel* femmodel);
+ void couplerinput_core(FemModel* femmodel);
+@@ -81,6 +83,7 @@
+ //solution configuration
+ void CorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype);
+ void WrapperCorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype,bool nodakotacore=false);
++void WrapperPreCorePointerFromSolutionEnum(void (**psolutioncore)(FemModel*),Parameters* parameters,int solutiontype);
+ void AdjointCorePointerFromSolutionEnum(void (**padjointcore)(FemModel*),int solutiontype);
+ 
+ #endif
+Index: ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp	(revision 26222)
+@@ -8,7 +8,7 @@
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+ 
+-void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze, IssmDouble** pareae, Elements* elements,bool spherical) {
++void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze, IssmDouble** pareae, Elements* elements,bool spherical) { /*{{{*/
+ 
+ 	/*figure out how many vertices we have: */
+ 	int numberofelements=elements->NumberOfElements();
+@@ -52,4 +52,43 @@
+ 	if(pareae) *pareae=areae;
+ 	else xDelete<IssmDouble>(areae);
+ 
+-}
++} /*}}}*/
++void ElementCoordinatesx( IssmDouble** plonge, IssmDouble** plate, IssmDouble** pareae, Elements* elements) { /*{{{*/
++
++	/*figure out how many vertices we have: */
++	int numberofelements=elements->NumberOfElements();
++
++	Vector<IssmDouble>* vlonge=new Vector<IssmDouble>(numberofelements);
++	Vector<IssmDouble>* vlate=new Vector<IssmDouble>(numberofelements);
++	Vector<IssmDouble>* vareae=new Vector<IssmDouble>(numberofelements);
++
++	/*march through our elements: */
++	for(Object* & object : elements->objects){
++		Element* element=(Element*)object;
++		element->ElementCoordinates(vlonge,vlate,vareae);
++	}
++
++	/*Assemble*/
++	vlonge->Assemble();
++	vlate->Assemble();
++	vareae->Assemble();
++
++	/*serialize: */
++	IssmDouble* longe=vlonge->ToMPISerial();
++	IssmDouble* late=vlate->ToMPISerial();
++	IssmDouble* areae=vareae->ToMPISerial();
++
++	/*Free ressources: */
++	delete vlonge;
++	delete vlate;
++	delete vareae;
++
++	/*output: */
++	if(plonge) *plonge=longe;
++	else xDelete<IssmDouble>(longe);
++	if(plate) *plate=late;
++	else xDelete<IssmDouble>(late);
++	if(pareae) *pareae=areae;
++	else xDelete<IssmDouble>(areae);
++
++} /*}}}*/
+Index: ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(revision 26221)
++++ ../trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h	(revision 26222)
+@@ -8,5 +8,6 @@
+ 
+ /* local prototypes: */
+ void ElementCoordinatesx( IssmDouble** pxe, IssmDouble** pye, IssmDouble** pze,IssmDouble** pareae, Elements* elements,bool spherical=false);
++void ElementCoordinatesx( IssmDouble** plonge, IssmDouble** plate, IssmDouble** pareae, Elements* elements);
+ 
+ #endif  /* _ELEMENT_COORDINATESX_H */
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26222)
+@@ -330,6 +330,7 @@
+ 			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.constants.gravitational_constant",ConstantsNewtonGravityEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+ 
+@@ -372,6 +373,7 @@
+ 				}
+ 			}
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.constants.gravitational_constant",ConstantsNewtonGravityEnum));
+ 			/*Free rssources:*/
+ 			xDelete<int>(nature);
+ 			break;
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26221)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26222)
+@@ -248,6 +248,7 @@
+ 	./cores/ProcessArguments.cpp \
+ 	./cores/ResetBoundaryConditions.cpp \
+ 	./cores/WrapperCorePointerFromSolutionEnum.cpp \
++	./cores/WrapperPreCorePointerFromSolutionEnum.cpp \
+ 	./cores/CorePointerFromSolutionEnum.cpp \
+ 	./cores/ad_core.cpp \
+ 	./cores/adgradient_core.cpp \
+@@ -556,7 +557,8 @@
+ if SEALEVELCHANGE
+ issm_sources += \
+ 	./cores/sealevelchange_core.cpp \
+-	./analyses/SealevelchangeAnalysis.cpp
++	./analyses/SealevelchangeAnalysis.cpp\
++	./classes/SealevelGeometry.cpp
+ 
+ #gia ivins physics (only if have fortran)
+ if FORTRAN
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26222)
+@@ -142,7 +142,6 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.compute_bp_grd",SolidearthSettingsComputeBpGrdEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.cross_section_shape",SolidearthSettingsCrossSectionShapeEnum));
+ 	parameters->AddObject(new DoubleParam(CumBslcEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcIceEnum,0.0));
+@@ -428,7 +427,7 @@
+ void           SealevelchangeAnalysis::PreCore(FemModel* femmodel){/*{{{*/
+ 
+ 	/*run sea level change core geometry only once, after the Model Processor is done:*/
+-	sealevelchange_geometry(femmodel);
++	sealevelchange_initialgeometry(femmodel);
+ 
+ }/*}}}*/
+ ElementVector* SealevelchangeAnalysis::CreateDVector(Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26222)
+@@ -2033,7 +2033,7 @@
+ /*}}}*/
+ bool       Element::IsIceOnlyInElement(){/*{{{*/
+ 	Input* input=this->GetInput(MaskIceLevelsetEnum); _assert_(input);
+-	return (input->GetInputMax()<0.);
++	return (input->GetInputMax()<=0.);
+ }
+ /*}}}*/
+ bool       Element::IsLandInElement(){/*{{{*/
+@@ -2046,6 +2046,11 @@
+ 	return (input->GetInputMin()<0.);
+ }
+ /*}}}*/
++bool       Element::IsOceanOnlyInElement(){/*{{{*/
++	Input* input=this->GetInput(MaskOceanLevelsetEnum); _assert_(input);
++	return (input->GetInputMax()<=0.);
++}
++/*}}}*/
+ void       Element::Ismip6FloatingiceMeltingRate(){/*{{{*/
+ 
+ 	if(!this->IsIceInElement() || !this->IsFloating() || !this->IsOnBase()) return;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26222)
+@@ -31,6 +31,7 @@
+ class DatasetInput;
+ class IoModel;
+ class SealevelMasks;
++class SealevelGeometry;
+ class Gauss;
+ class ElementVector;
+ template <class doublematrix> class Matrix;
+@@ -145,6 +146,7 @@
+ 		bool               IsIceInElement();
+ 		bool               IsIceOnlyInElement();
+ 		bool               IsOceanInElement();
++		bool               IsOceanOnlyInElement();
+ 		bool               IsLandInElement();
+ 		void               Ismip6FloatingiceMeltingRate();
+ 		void               LinearFloatingiceMeltingRate();
+@@ -239,6 +241,7 @@
+ 		virtual void       ElementResponse(IssmDouble* presponse,int response_enum)=0;
+ 		virtual void       ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
+ 		virtual void       ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical=false)=0;
++		virtual void       ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae)=0;
+ 		virtual int        FiniteElement(void)=0;
+ 		virtual IssmDouble FloatingArea(bool scaled)=0;
+ 		virtual void       FSContactMigration(Vector<IssmDouble>* vertex_sigmann,Vector<IssmDouble>* vertex_waterpressure)=0;
+@@ -247,8 +250,11 @@
+ 		virtual IssmDouble GetHorizontalSurfaceArea(void){_error_("not implemented");};
+ 		virtual void       GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0;
+ 		virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0;
+-		virtual void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl)=0;
+-		virtual IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl)=0;
++		virtual void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl)=0;
++		virtual void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum)=0;
++		virtual void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum)=0;
++		virtual void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius)=0;
++
+ 		virtual IssmDouble GetIcefrontArea(){_error_("not implemented");};
+ 		virtual void       GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum)=0;
+ 		virtual DatasetInput* GetDatasetInput(int inputenum){_error_("not implemented");};
+@@ -378,18 +384,21 @@
+ 		virtual void          EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz)=0;
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELCHANGE_
+-		virtual void          LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){_error_("not implemented");};
+-		virtual void          SetSealevelMasks(SealevelMasks* masks)=0;
+ 		virtual IssmDouble    GetArea3D(void)=0;
+ 		virtual IssmDouble    GetAreaSpherical(void)=0;
+-		virtual void          SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads)=0;
++		virtual IssmDouble    GetTriangleAreaSpherical(IssmDouble xyz_list[3][3])=0;
+ 		virtual void          GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+ 
+-		virtual void          SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+-		virtual void          SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks)=0;
+-		virtual void          SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector)=0;
+-		virtual void          SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector)=0;
+-		virtual void          SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks)=0;
++		virtual void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
++		virtual void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
++		virtual void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae)=0;
++		virtual void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom)=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26222)
+@@ -70,6 +70,7 @@
+ 		void           CreateInputTimeAverage(int transientinput_enum,int averagedinput_enum,IssmDouble start_time,IssmDouble end_time,int averaging_method);
+ 		void           ElementResponse(IssmDouble* presponse,int response_enum);
+ 		void           ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
++		void           ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){_error_("not implemented yet");};
+ 		void           ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		int            FiniteElement(void);
+ 		IssmDouble     FloatingArea(bool scaled);
+@@ -77,13 +78,16 @@
+ 		IssmDouble     GetArea3D(void){_error_("not implemented yet!");};
+ 		IssmDouble     GetAreaSpherical(void){_error_("not implemented yet!");};
+ 		void           GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints);
++		IssmDouble     GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){_error_("not implemented yet");};
+ 		Element*       GetBasalElement(void);
+ 		Penta*         GetBasalPenta(void);
+ 		int            GetElementType(void);
+ 		void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
+ 		IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
+-		void           GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){_error_("not implemented yet");};
+-		IssmDouble     GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){_error_("not implemented yet");};
++		void           GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){_error_("not implemented yet");};
++		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){_error_("not implemented yet");};
++		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum){_error_("not implemented yet");};
++		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){_error_("not implemented yet");};
+ 		IssmDouble		GetIcefrontArea();
+ 		void           GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+ 		Input*        GetInput(int enumtype);
+@@ -217,15 +221,17 @@
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELCHANGE_
+-		void       SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-
+-		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
++		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		#endif
+ 
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26222)
+@@ -54,6 +54,7 @@
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp){_error_("not implemented yet");};
+ 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+ 		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
++		void        ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
+ 		int         FiniteElement(void);
+ 		IssmDouble  FloatingArea(bool scaled){_error_("not implemented yet");};
+@@ -62,9 +63,11 @@
+ 		int         GetElementType(void){_error_("not implemented yet");};
+ 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
+ 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
+-		void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){_error_("not implemented yet");};
+-		IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){_error_("not implemented yet");};
+-		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
++		void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){_error_("not implemented yet");};
++		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){_error_("not implemented yet");};
++		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelset1enum, int levelset2enum){_error_("not implemented yet");};
++		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){_error_("not implemented yet");};
++		void		GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+ 		Input*     GetInput(int enumtype);
+ 		Input*     GetInput(int enumtype,IssmDouble time);
+ 		Input*     GetInput(int inputenum,IssmDouble start_time,IssmDouble end_time,int averaging_method){_error_("not implemented yet!");};
+@@ -166,6 +169,7 @@
+ 		void        VerticalSegmentIndicesBase(int** pindices,int* pnumseg){_error_("not implemented yet");};
+ 		IssmDouble     GetArea3D(void){_error_("not implemented yet!");};
+ 		IssmDouble     GetAreaSpherical(void){_error_("not implemented yet!");};
++		IssmDouble GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){_error_("not implemented yet");};
+ 
+ #ifdef _HAVE_ESA_
+ 		void    EsaGeodetic2D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,Vector<IssmDouble>* pX,Vector<IssmDouble>* pY,IssmDouble* xx,IssmDouble* yy){_error_("not implemented yet!");};
+@@ -172,15 +176,17 @@
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+-		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+-		void       SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+-
++		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26222)
+@@ -53,6 +53,7 @@
+ 		IssmDouble  DragCoefficientAbsGradient(void){_error_("not implemented yet");};
+ 		void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+ 		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze,Vector<IssmDouble>* vareae,bool spherical=false){_error_("not implemented yet");};
++		void        ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		void        FaceOnBaseIndices(int* pindex1,int* pindex2,int* pindex3);
+ 		void        FaceOnFrontIndices(int* pindex1,int* pindex2,int* pindex3);
+@@ -62,12 +63,15 @@
+ 		void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
+ 		IssmDouble  GetArea3D(void){_error_("not implemented yet!");};
+ 		IssmDouble  GetAreaSpherical(void){_error_("not implemented yet!");};
++		IssmDouble  GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){_error_("not implemented yet");};
+ 		Element*    GetBasalElement(void){_error_("not implemented yet");};
+ 		int         GetElementType(void);
+ 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
+ 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
+-		void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){_error_("not implemented yet");};
+-		IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){_error_("not implemented yet");};
++		void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){_error_("not implemented yet");};
++		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){_error_("not implemented yet");};
++		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelset1enum, int levelset2enum){_error_("not implemented yet");};
++		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){_error_("not implemented yet");};
+ 		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum){_error_("not implemented yet");};
+ 		Input*     GetInput(int enumtype);
+ 		Input*     GetInput(int enumtype,IssmDouble time);
+@@ -179,15 +183,17 @@
+ 		void    EsaGeodetic3D(Vector<IssmDouble>* pUp,Vector<IssmDouble>* pNorth,Vector<IssmDouble>* pEast,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble* xx,IssmDouble* yy,IssmDouble* zz){_error_("not implemented yet!");};
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+-		void       SetSealevelMasks(SealevelMasks* masks){_error_("not implemented yet!");};
+-		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){_error_("not implemented yet!");};
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){_error_("not implemented yet");};
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){_error_("not implemented yet");};
+-
++		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26222)
+@@ -1311,6 +1311,31 @@
+ 	return;
+ }
+ /*}}}*/
++void       Tria::ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae){ /*{{{*/
++
++	IssmDouble planetradius;
++
++	/*Look for x,y,z coordinates:*/
++	IssmDouble xyz_list[NUMVERTICES][3];
++	::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
++	IssmDouble area,xe,ye,ze,late,longe;
++
++	/*Find centroid:*/
++	xe=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
++	ye=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
++	ze=(xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2])/3.0;
++
++	late= asin(ze/sqrt(pow(xe,2.0)+pow(ye,2.0)+pow(ze,2.0)));
++	longe= atan2(ye,xe);
++	area=this->GetAreaSpherical();
++
++	vlonge->SetValue(this->sid,longe,INS_VAL);
++	vlate->SetValue(this->sid,late,INS_VAL);
++	vareae->SetValue(this->sid,area,INS_VAL);
++		
++	return;
++}
++/*}}}*/
+ void       Tria::ElementResponse(IssmDouble* presponse,int response_enum){/*{{{*/
+ 
+ 	switch(response_enum){
+@@ -1722,81 +1747,23 @@
+ 	return phi;
+ }
+ /*}}}*/
+-IssmDouble Tria::GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl){/*{{{*/
++void       Tria::GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){/*{{{*/
+ 	
+-	/*Computeportion of the element that is on a levelset: */
+-	bool              mainlyfloating = true;
+-	int               domaintype,index1,index2;
+-	const IssmPDouble epsilon        = 1.e-15;
+-	IssmDouble        phi,s1,s2;
+-
+-	/*Recover parameters and values*/
+-	parameters->FindParam(&domaintype,DomainTypeEnum);
+-
+-	/*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){
+-		this->EdgeOnBaseIndices(&index1,&index2);
+-		if(gl[index1]>0 && gl[index2]>0) phi=1; // All grounded
+-		else if(gl[index1]<0 && gl[index2]<0) phi=0; // All floating
+-		else if(gl[index1]<0 && gl[index2]>0){ //index2 grounded
+-			phi=1./(1.-gl[index1]/gl[index2]);
+-		}
+-		else if(gl[index2]<0 && gl[index1]>0){ //index1 grounded
+-			phi=1./(1.-gl[index2]/gl[index1]);
+-		}
+-
+-	}
+-	else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
+-		/*Check that not all nodes are grounded or floating*/
+-		if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded
+-			phi=1;
+-		}
+-		else if(gl[0]<0 && gl[1]<0 && gl[2]<0){ //All floating
+-			phi=0;
+-		}
+-		else{
+-			/*Figure out if two nodes are floating or grounded*/
+-			if(gl[0]*gl[1]*gl[2]>0) mainlyfloating=false;
+-
+-			if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+-				s1=gl[2]/(gl[2]-gl[1]);
+-				s2=gl[2]/(gl[2]-gl[0]);
+-			}
+-			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
+-				s1=gl[0]/(gl[0]-gl[1]);
+-				s2=gl[0]/(gl[0]-gl[2]);
+-			}
+-			else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+-				s1=gl[1]/(gl[1]-gl[0]);
+-				s2=gl[1]/(gl[1]-gl[2]);
+-			}
+-			else _error_("case not possible");
+-			if(mainlyfloating){
+-				phi = (1-s1*s2);
+-			}
+-			else{
+-				phi = s1*s2;
+-			}
+-		}
+-	}
+-	else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
+-
+-	_assert_(phi<=1. && phi>=0.);
+-	return 1-phi;
+-}
+-/*}}}*/
+-void       Tria::GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl){/*{{{*/
+-	
+ 	/*Computeportion of the element that is grounded*/
+-	bool               negative=false;
++	bool               trapezeisnegative=true; //default value
+ 	int                point;
+ 	const IssmPDouble  epsilon= 1.e-15;
+-	IssmDouble         f1,f2;
++	IssmDouble         f1,f2,phi;
+ 
++	/*Weights: */
++	Gauss* gauss=NULL;
++	IssmDouble loadweights_g[NUMVERTICES];
++	IssmDouble total_weight=0;
++	
++	_assert_(!xIsNan<IssmDouble>(gl[0]));
++	_assert_(!xIsNan<IssmDouble>(gl[1]));
++	_assert_(!xIsNan<IssmDouble>(gl[2]));
++
+ 	/*Be sure that values are not zero*/
+ 	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+ 	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+@@ -1814,7 +1781,7 @@
+ 		f2=0.;
+ 	}
+ 	else{
+-		if(gl[0]*gl[1]*gl[2]<0) negative=true;
++		if(gl[0]*gl[1]*gl[2]<0) trapezeisnegative=false; //no matter what configuration, there has to be two positive vertices, which means the trapeze is positive.
+ 
+ 		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+ 			point=2;
+@@ -1833,12 +1800,469 @@
+ 		}
+ 		else _error_("case not possible");
+ 	}
+-	*point1=point;
+-	*fraction1=f1;
+-	*fraction2=f2;
+-	*pmainlynegative=negative;
++	if(trapezeisnegative) phi=1-f1*f2;
++	else phi=f1*f2;
++	
++
++	/*Compute weights:*/
++	gauss = this->NewGauss(point,f1,f2,trapezeisnegative,2); 
++	
++	total_weight=0;
++	for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
++	while(gauss->next()){
++		TriaRef::GetNodalFunctions(&loadweights_g[0], gauss,P1Enum);
++		for(int i=0;i<NUMVERTICES;i++)weights[i]+=loadweights_g[i]*gauss->weight;
++		total_weight+=gauss->weight;
++	}
++	//normalize to phi. 
++	if(total_weight)for(int i=0;i<NUMVERTICES;i++)weights[i]/=total_weight/phi; 
++	else for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
++
++	/*free ressources:*/
++	delete gauss;
++
++	/*Assign output pointers:*/
++	*pphi=phi;
++	*ppoint1=point;
++	*pfraction1=f1;
++	*pfraction2=f2;
++	*ptrapezeisnegative=trapezeisnegative;
+ }
+ /*}}}*/
++IssmDouble Tria::GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){/*{{{*/
++	
++	IssmDouble x1,y1,z1,x2,y2,z2,x3,y3,z3;
++	IssmDouble arc12,arc23,arc31,semi_peri,excess;
++	IssmDouble lat1,lat2,lat3;
++	IssmDouble long1,long2,long3;
++	IssmDouble r1,r2,r3;
++
++	/*retrieve x,y,z coordinates: */
++	x1=xyz_list[0][0]; y1=xyz_list[0][1]; z1=xyz_list[0][2];
++	x2=xyz_list[1][0]; y2=xyz_list[1][1]; z2=xyz_list[1][2];
++	x3=xyz_list[2][0]; y3=xyz_list[2][1]; z3=xyz_list[2][2];
++
++	/*Build lat,long, r:*/
++	r1=sqrt(pow(x1,2.0)+pow(y1,2.0)+pow(z1,2.0));
++	r2=sqrt(pow(x2,2.0)+pow(y2,2.0)+pow(z2,2.0));
++	r3=sqrt(pow(x3,2.0)+pow(y3,2.0)+pow(z3,2.0));
++
++	lat1=asin(z1/r1); long1=atan2(y1,x1);
++	lat2=asin(z2/r2); long2=atan2(y2,x2);
++	lat3=asin(z3/r3); long3=atan2(y3,x3);
++
++	/*compute great circle distance between vertices */
++	arc12=2.*asin(sqrt(pow(sin(0.5*(lat2-lat1)),2)+cos(lat1)*cos(lat2)*pow(sin(0.5*(long2-long1)),2)));
++	arc23=2.*asin(sqrt(pow(sin(0.5*(lat3-lat2)),2)+cos(lat2)*cos(lat3)*pow(sin(0.5*(long3-long2)),2)));
++	arc31=2.*asin(sqrt(pow(sin(0.5*(lat1-lat3)),2)+cos(lat3)*cos(lat1)*pow(sin(0.5*(long1-long3)),2)));
++
++	/*semi parameter */
++	semi_peri=(arc12+arc23+arc31)/2;
++
++	/*spherical excess */
++	excess=4.*atan(sqrt(tan(semi_peri/2)*tan((semi_peri-arc12)/2)*tan((semi_peri-arc23)/2)*tan((semi_peri-arc31)/2)));
++
++	/*area = excess*radius^2 */
++	return excess*pow((r1+r2+r3)/3,2);
++}
++/*}}}*/
++void       Tria:: GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){ /*{{{*/
++
++	int i0,i1,i2;
++
++	IssmDouble xyz0[3][3];
++	IssmDouble barycenter[3]={0};
++	IssmDouble centroid[3]={0};
++
++	::GetVerticesCoordinates(&xyz0[0][0],vertices,NUMVERTICES); // initial triangle
++
++	i0=point1;
++	i1=(point1+1)%3;
++	i2=(point1+2)%3;
++
++	//Barycenter of the subelement triangle:
++	for (int i=0;i<3;i++) barycenter[i]=xyz0[i0][i]*(3.0-fraction1-fraction2)/3.0 + fraction1/3.0*xyz0[i1][i] + fraction2/3.0*xyz0[i2][i];
++
++	if (istrapeze1){
++		centroid[0]=planetradius*cos(late*M_PI/180.0) * cos(longe*M_PI/180.0); //x
++		centroid[1]=planetradius*cos(late*M_PI/180.0) * sin(longe*M_PI/180.0);  //y
++		centroid[2]=planetradius*sin(late*M_PI/180.0);					//z
++
++		// centroid_el *area_el= barycenter_triangle * area_triangle + barycenter_trapeze * area_trapeze
++		// and phi_trapeze = area_trapeze/area_el = (1 - area_triangle/area_el)
++		// => barycenter_trapeze = (centroid_el - barycenter_triangle * (1-phi_trapeze) )/phi_trapeze
++		for (int i=0;i<3;i++) barycenter[i] =(centroid[i] -barycenter[i]*(1.0-phi))/phi;
++
++	}
++
++	//recompute planetradius from the barycenter onwards:
++	planetradius=sqrt( pow(barycenter[0],2.0)+ pow(barycenter[1],2.0)+ pow(barycenter[2],2.0));
++
++	*platbar=asin(barycenter[2]/planetradius)*180.0/M_PI;
++	*plongbar=atan2(barycenter[1],barycenter[0])*180.0/M_PI;
++
++} /*}}}*/
++void       Tria::GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){ /*{{{*/
++
++	IssmDouble phi;
++	IssmDouble fraction1,fraction2;
++	bool istrapeze1;  
++	bool flip1=false;
++	int  point1;
++	IssmDouble levelset[NUMVERTICES];
++	IssmDouble planetradius;
++	
++	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
++
++	//figure out if we are flipping the levelsets: 
++	if(levelsetenum<0){
++		levelsetenum=-levelsetenum;
++		flip1=true;
++	}
++	//figure out area where we have loads
++	Element::GetInputListOnVertices(&levelset[0],levelsetenum);
++	if(flip1)for(int i=0;i<NUMVERTICES;i++)levelset[i]=-levelset[i];
++	
++	//compute sea level load weights
++	this->GetFractionGeometry(loadweights,&phi,&point1,&fraction1,&fraction2,&istrapeze1,levelset);
++
++	this->GetBarycenterFromLevelset(platbar,plongbar, phi, fraction1, fraction2, late, longe, point1,istrapeze1,planetradius);
++
++	/*assign output pointers:*/
++	*ploadarea=phi*area;
++
++} /*}}}*/
++void       Tria::GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelset1enum, int levelset2enum){ /*{{{*/
++
++
++	bool istrapeze1, istrapeze2;
++	IssmDouble phi1,phi2, f11,f12,f21,f22;
++	int point1, point2,  i0,i1,i2,j0,j1,j2;
++	IssmDouble weights1[3],weights2[3];
++	IssmDouble levelset1[3];
++	IssmDouble levelset2[3];
++
++	bool flip1=false;
++	bool flip2=false;
++
++	IssmDouble xyz0[3][3];
++	IssmDouble xyz1[3][3]={0};
++	IssmDouble xyz2[3][3]={0};
++	IssmDouble xyz3[3][3]={0};
++	IssmDouble xyz[8][3]={0};
++	IssmDouble f1o;
++	IssmDouble w[8][NUMVERTICES]={0};
++	IssmDouble areasub=0;
++	IssmDouble area1=0;
++	IssmDouble area2=0;
++	IssmDouble area3=0;
++
++	int tria0[3]={0,1,2};
++	int tria1[3]={-1};
++	int tria2[3]={-1};
++	int tria3[3]={-1};
++
++	IssmDouble w1[3][3]={0};
++	IssmDouble w2[3][3]={0};
++	IssmDouble w3[3][3]={0};
++
++	IssmDouble barycenter[3]={0};
++	IssmDouble planetradius;
++
++	//figure out if we are flipping the levelsets: 
++	if(levelset1enum<0){
++		levelset1enum=-levelset1enum;
++		flip1=true;
++	}
++	if(levelset2enum<0){
++		levelset2enum=-levelset2enum;
++		flip2=true;
++	}
++
++	//recover levelsets: 
++	Element::GetInputListOnVertices(&levelset1[0],levelset1enum);
++	if(flip1)for(int i=0;i<NUMVERTICES;i++)levelset1[i]=-levelset1[i];
++	Element::GetInputListOnVertices(&levelset2[0],levelset2enum);
++	if(flip2)for(int i=0;i<NUMVERTICES;i++)levelset2[i]=-levelset2[i];
++
++	//We want the fraction of the element where both levelsets are negative.
++	//Early return if either of them is >=0 on all vertices
++	if (levelset1[0]>=0 && levelset1[1]>=0 && levelset1[2]>=0) {
++		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=0.0;
++		*ploadarea= 0.0;
++		*platbar=late; //just default to centroid of triangle
++		*plongbar=longe; 
++		return;
++	}
++	if (levelset2[0]>=0 && levelset2[1]>=0 && levelset2[2]>=0) {
++		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=0.0;
++		*ploadarea= 0.0;
++		*platbar=late; //just default to centroid of triangle
++		*plongbar=longe; 
++		return;
++	}
++
++
++	//If everyone is negative, no need to calculate any fraction
++	if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0 && levelset2[0]<=0 && levelset2[1]<=0 && levelset2[2]<=0) {
++		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=1.0/NUMVERTICES;
++		*ploadarea= area;
++		*platbar=late;
++		*plongbar=longe;
++		return;
++	}
++	
++	/*recover planet radius:*/
++	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
++
++
++	//If just one levelset is all negative, just take the partitioning of the other, no interaction between them
++	if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0) {
++		this->GetFractionGeometry(loadweights,&phi2,&point2,&f21,&f22,&istrapeze2,levelset2);
++		this->GetBarycenterFromLevelset(platbar,plongbar, phi2, f21, f22, late, longe, point2,istrapeze2,planetradius);
++		*ploadarea=area*phi2;
++		return;
++	}
++	if (levelset2[0]<=0 && levelset2[1]<=0 && levelset2[2]<=0) {
++		this->GetFractionGeometry(loadweights,&phi1,&point1,&f11,&f12,&istrapeze1,levelset1);
++		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, f11, f12, late, longe, point1,istrapeze1,planetradius);
++		*ploadarea=area*phi1;
++		return;
++	}
++
++
++	this->GetFractionGeometry(&weights1[0],&phi1,&point1,&f11,&f12,&istrapeze1,levelset1);
++	this->GetFractionGeometry(&weights2[0],&phi2,&point2,&f21,&f22,&istrapeze2,levelset2);
++
++
++	//Early return if levelsets are not independent
++	if (istrapeze1==istrapeze2 && point1==point2 && phi1==phi2){
++		//the two levelsets are redundant: levelset1 = positivescalar * levelset2
++		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, f11, f12, late, longe, point1,istrapeze1,planetradius);
++		*ploadarea=area*phi1;
++		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=weights1[i];
++		return;
++	}
++	if (istrapeze1!=istrapeze2 && point1==point2 && phi1==(1.0-phi2)){
++		//the two levelsets are incompatible: levelset1 = negativescalar * levelset2
++		*plongbar=longe;
++		*platbar=late;
++		*ploadarea=0.0;
++		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=0.0;
++		return;
++	}
++
++	
++	::GetVerticesCoordinates(&xyz0[0][0],vertices,NUMVERTICES); // initial triangle
++
++	i0=point1;
++	i1=(point1+1)%3;
++	i2=(point1+2)%3;
++
++	j0=point2;
++	j1=(point2+1)%3;
++	j2=(point2+2)%3;
++
++	//f1o: fraction of segment {point_f11 -> point_f12} where the levelsets intersect (only used when f1o>=0 and f1o<=1)
++	if(point2==i0) f1o= f22*(f11-f21)/(f11*f22-f12*f21);
++	else if(point2==i1) f1o=f21*(1.0-f22-f11)/(f21*(f12-f11)-f12*f22);
++	else f1o= (f22*(1.0-f21-f11)+f21*f11)/(f22*(f12-f11) +f21*f11);
++
++
++	//interpolant weights of each point. Any field F[0,1,2] provided at the original vertices [0,1,2] will be equal on point k to sum_i (F[i] * w[k][i])
++	w[0][0]=1;
++	w[1][1]=1;
++	w[2][2]=1;
++	w[3][i0]=1.0-f11; w[3][i1]=f11;
++	w[4][i0]=1.0-f12; w[4][i2]=f12;
++	w[5][j0]=1.0-f21; w[5][j1]=f21;
++	w[6][j0]=1.0-f22; w[6][j2]=f22;
++	for (int j=0;j<3;j++) w[7][j]=w[3][j]*(1.0-f1o) + w[4][j]*f1o; //we interpolate the intersection point between point_f11 and point_f12 at fraction f1o
++
++	for (int k=0;k<8;k++){
++		for (int i=0;i<NUMVERTICES;i++) {
++			for (int j=0;j<3;j++) xyz[k][j]+=xyz0[i][j]*w[k][i];
++		}
++	}
++
++		//point2 can be either i0,i1 or i2. We start the search with i1 and i2 as they have less computational cost in ifs
++		if(point2==i2){ /*{{{*/
++			if (f12>1.0-f21){ /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++					tria1[0]=5; tria1[1]= 7; tria1[2]= 4;
++				}
++				else if (!istrapeze1 && istrapeze2){
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 7;
++					tria2[0]=i0; tria2[1]= 7; tria2[2]= 5;
++				}
++				else if (istrapeze1 && !istrapeze2){
++					tria1[0]=7; tria1[1]= 6; tria1[2]= 4;
++					tria2[0]=4; tria2[1]= 6; tria2[2]= i2;
++				}
++				else { //istrapeze1 && istrapeze2
++					tria1[0]=3; tria1[1]= i1; tria1[2]= 7;
++					tria2[0]=7; tria2[1]= i1; tria2[2]= 6;
++				}  /*}}}*/
++			}
++			else if (f12<=1.0-f21){ /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++				}
++				else if (!istrapeze1 && istrapeze2){
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;
++				}
++				else if (istrapeze1 && !istrapeze2){
++					tria1[0]=5; tria1[1]= 6; tria1[2]= i2;
++				}
++				else { //istrapeze1 && istrapeze2
++					tria1[0]=3; tria1[1]= i1; tria1[2]= 4;
++					tria2[0]=4; tria2[1]= i1; tria2[2]= 5;
++					tria3[0]=5; tria3[1]= i1; tria3[2]= 6;
++				} /*}}}*/
++			} 
++		}/*}}}*/    
++		else if(point2==i1){ /*{{{*/
++			if (f11>1.0-f22){ /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++					tria1[0]=6; tria1[1]= 3; tria1[2]= 7;
++				}
++				else if (!istrapeze1 && istrapeze2){
++					tria1[0]=i0; tria1[1]= 6; tria1[2]= 7;
++					tria2[0]=i0; tria2[1]= 7; tria2[2]= 4;
++				}
++				else if (istrapeze1 && !istrapeze2){
++					tria1[0]=3; tria1[1]= i1; tria1[2]= 7;
++					tria2[0]=7; tria2[1]= i1; tria2[2]= 5;
++				}
++				else { //istrapeze1 && istrapeze2
++					tria1[0]=7; tria1[1]= 5; tria1[2]= 4;
++					tria2[0]=4; tria2[1]= 5; tria2[2]= i2;
++				}  /*}}}*/
++			}
++			else if (f11<=1.0-f22){ /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++				}
++				else if (!istrapeze1 && istrapeze2){
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;
++				}
++				else if (istrapeze1 && !istrapeze2){
++					tria1[0]=6; tria1[1]= i1; tria1[2]= 5;
++				}
++				else { //istrapeze1 && istrapeze2
++					tria1[0]=3; tria1[1]= 6; tria1[2]= 4;
++					tria2[0]=4; tria2[1]= 6; tria2[2]= 5;
++					tria3[0]=4; tria3[1]= 5; tria3[2]= i2;
++				} /*}}}*/
++			}
++			
++		}/*}}}*/
++		else{ /*{{{*/
++			if (f11<=f21 && f12>=f22){  /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 7;
++					tria2[0]=i0; tria2[1]= 7; tria2[2]= 6;
++				}
++				else if (!istrapeze1 && istrapeze2){
++					tria1[0]=6; tria1[1]= 7; tria1[2]= 4;
++				}
++				else if (istrapeze1 && !istrapeze2){
++					tria1[0]=3; tria1[1]= 5; tria1[2]= 7;
++				}
++				else { //istrapeze1 && istrapeze2
++					tria1[0]=7; tria1[1]= 5; tria1[2]= i1;
++					tria2[0]=7; tria2[1]= i1; tria2[2]= 4;
++					tria3[0]=4; tria3[1]= i1; tria3[2]= i2;
++				} /*}}}*/
++			}
++			else if (f11>=f21 && f12<=f22){ /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++					tria1[0]=i0; tria1[1]= 5; tria1[2]= 7;
++					tria2[0]=i0; tria2[1]= 4; tria2[2]= 7;
++				}else if (!istrapeze1 && istrapeze2){
++					tria1[0]=5; tria1[1]= 3; tria1[2]= 7;
++				}else if (istrapeze1 && !istrapeze2){
++					tria1[0]=4; tria1[1]= 7; tria1[2]= 6;
++				}else { //istrapeze1 && istrapeze2
++					tria1[0]=3; tria1[1]= i1; tria1[2]= 7;
++					tria2[0]=7; tria2[1]= i1; tria2[2]= 6;
++					tria3[0]=6; tria3[1]= i1; tria3[2]= i2;
++				}  /*}}}*/
++			}
++			else if (f11<=f21 && f12<=f22){ /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;
++				}else if (!istrapeze1 && istrapeze2){
++				}else if (istrapeze1 && !istrapeze2){
++					tria1[0]=3; tria1[1]= 5; tria1[2]= 4;
++					tria2[0]=4; tria2[1]= 5; tria2[2]= 6;
++				}else { //istrapeze1 && istrapeze2
++					tria1[0]=6; tria1[1]= 5; tria1[2]= i1;
++					tria2[0]=6; tria2[1]= i1; tria2[2]= i2;
++				}  /*}}}*/
++			}
++			else if (f11>=f21 && f12>=f22){ /*{{{*/
++				if (!istrapeze1 && !istrapeze2){
++					tria1[0]=i0; tria1[1]= 5; tria1[2]= 6;
++				}else if (!istrapeze1 && istrapeze2){
++					tria1[0]=5; tria1[1]= 3; tria1[2]= 6;
++					tria2[0]=6; tria2[1]= 3; tria2[2]= 4;
++				}else if (istrapeze1 && !istrapeze2){
++				}else { //istrapeze1 && istrapeze2
++					tria1[0]=4; tria1[1]= 3; tria1[2]= i1;
++					tria2[0]=i1; tria2[1]= i2; tria2[2]= 4;
++				}  /*}}}*/
++			} 
++		} /*}}}*/
++
++	if(tria1[0]>-1){ 
++		for (int i=0;i<NUMVERTICES;i++){
++			for (int j=0;j<3;j++) {
++				xyz1[i][j]=xyz[tria1[i]][j];
++				w1[i][j]=w[tria1[i]][j];
++			}
++		}
++		area1= GetTriangleAreaSpherical(xyz1);
++	}
++	if(tria2[0]>-1){ 
++		for (int i=0;i<NUMVERTICES;i++){
++			for (int j=0;j<3;j++) {
++				xyz2[i][j]=xyz[tria2[i]][j];
++				w2[i][j]=w[tria2[i]][j];
++			}
++		}
++		area2= GetTriangleAreaSpherical(xyz2);
++	}
++	if(tria3[0]>-1){ 
++		for (int i=0;i<NUMVERTICES;i++){
++			for (int j=0;j<3;j++) {
++				xyz3[i][j]=xyz[tria3[i]][j];
++				w3[i][j]=w[tria3[i]][j];
++			}
++		}
++		area3= GetTriangleAreaSpherical(xyz3);
++	}
++
++	areasub=area1+area2+area3;
++
++	if (areasub>0){
++		for (int j=0;j<3;j++){
++			for (int i=0;i<NUMVERTICES;i++) {
++				loadweights[j]=w1[i][j]*area1 + w2[i][j]*area2 + w3[i][j]*area3;
++				barycenter[j]+=xyz1[i][j]*area1+xyz2[i][j]*area2+xyz3[i][j]*area3;
++			}
++			loadweights[j]/=area;
++			barycenter[j]/=areasub *3.0;
++		}
++		*platbar=asin(barycenter[2]/sqrt(pow(barycenter[0],2.0)+pow(barycenter[1],2.0)+pow(barycenter[2],2.0)))*180.0/M_PI;
++		*plongbar=atan2(barycenter[1],barycenter[0])*180.0/M_PI;
++	} 
++	else {
++		for(int j=0;j<3;j++)loadweights[j]=0.0;
++		*platbar=late;
++		*plongbar=longe;
++	}
++	*ploadarea=areasub;
++
++} /*}}}*/
+ IssmDouble Tria::GetIcefrontArea(){/*{{{*/
+ 
+ 	IssmDouble  bed[NUMVERTICES]; //basinId[NUMVERTICES];
+@@ -5554,22 +5978,6 @@
+ /*}}}*/
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+-//old code
+-void       Tria::SetSealevelMasks(SealevelMasks* masks){ /*{{{*/
+-
+-	masks->isiceonly[this->lid]=this->IsIceOnlyInElement();
+-	masks->isoceanin[this->lid]=this->IsOceanInElement();
+-
+-	/*are we fully floating:*/
+-	Input* gr_input=this->GetInput(MaskOceanLevelsetEnum); _assert_(gr_input);
+-	if (gr_input->GetInputMax()<=0)masks->isfullyfloating[this->lid]=true;
+-	else masks->isfullyfloating[this->lid]=false;
+-
+-	/*are we not fully grounded: */
+-	if ((gr_input->GetInputMin())<0) masks->notfullygrounded[this->lid]=true;
+-	else masks->notfullygrounded[this->lid]=false;
+-}
+-/*}}}*/
+ void       Tria::GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x, IssmDouble* y){/*{{{*/
+ 
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+@@ -5675,18 +6083,21 @@
+ 	return;
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeGeometry(IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
++void       Tria::SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
+ 
+-	/*diverse:*/
++	/*Declarations:{{{*/
+ 	int nel;
+ 	IssmDouble area,planetarea,planetradius;
+ 	IssmDouble constant,ratioe;
+ 	IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
+ 	IssmDouble rho_earth;
++	IssmDouble NewtonG;
++	IssmDouble g;
+ 	IssmDouble lati,longi;
++	IssmDouble latitude[NUMVERTICES];
++	IssmDouble longitude[NUMVERTICES];
+ 	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
+-	int sidlist[NUMVERTICES]; 
+-	int sid;
++	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+ 	#ifdef _HAVE_RESTRICT_
+ 	IssmDouble* __restrict__ G=NULL;
+@@ -5697,8 +6108,6 @@
+ 	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
+ 	IssmDouble* __restrict__ U_elastic_precomputed=NULL;
+ 	IssmDouble* __restrict__ H_elastic_precomputed=NULL;
+-	IssmDouble* __restrict__ lates=NULL;
+-	IssmDouble* __restrict__ longes=NULL;
+ 	#else
+ 	IssmDouble* G=NULL;
+ 	IssmDouble* GU=NULL;
+@@ -5708,8 +6117,6 @@
+ 	IssmDouble* G_rigid_precomputed=NULL;
+ 	IssmDouble* U_elastic_precomputed=NULL;
+ 	IssmDouble* H_elastic_precomputed=NULL;
+-	IssmDouble* lates=NULL;
+-	IssmDouble* longes=NULL;
+ 	#endif
+ 	
+ 	/*elastic green function:*/
+@@ -5727,14 +6134,13 @@
+ 	IssmDouble* tide_love_k  = NULL;
+ 	IssmDouble* load_love_k  = NULL;
+ 	IssmDouble  tide_love_k2secular;
+-	IssmDouble  moi_e, moi_p, omega, g;
++	IssmDouble  moi_e, moi_p, omega;
+ 	IssmDouble Grotm1[3];
+ 	IssmDouble Grotm2[3];
+ 	IssmDouble Grotm3[3];
+ 	IssmDouble pre;
+-
+-
+-	/*recover parameters: */
++	/*}}}*/
++	/*Recover parameters:{{{ */
+ 	rho_earth=FindParam(MaterialsEarthDensityEnum);
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+@@ -5742,6 +6148,7 @@
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
++	this->parameters->FindParam(&NewtonG,ConstantsNewtonGravityEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 
+ 	if(computerotation){
+@@ -5753,19 +6160,15 @@
+ 		parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
+ 		parameters->FindParam(&omega,RotationalAngularVelocityEnum);
+ 	}
++	/*}}}*/
+ 
+ 	/*early return:*/
+ 	if(!computerigid)return;
+ 
+-	/*recover precomputed green function kernels:*/
++	/*Recover precomputed green function kernels:{{{*/
+ 	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
+ 	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
+ 
+-	/*allocate arrays:*/
+-	G=xNewZeroInit<IssmDouble>(3*nel);
+-	longes=xNewZeroInit<IssmDouble>(nel);
+-	lates=xNewZeroInit<IssmDouble>(nel);
+-
+ 	if(computeelastic){
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
+ 		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
+@@ -5776,6 +6179,23 @@
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
+ 		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
+ 
++		
++	}
++	/*}}}*/
++	/*Compute lat long of all vertices in the element:{{{*/
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++	for(int i=0;i<NUMVERTICES;i++){
++		latitude[i]= asin(xyz_list[i][2]/planetradius);
++		if((xyz_list[i][2]/planetradius)==1.0)latitude[i]=M_PI/2;
++		longitude[i]= atan2(xyz_list[i][1],xyz_list[i][0]);
++	}
++	/*}}}*/
++	/*Compute green functions:{{{ */
++	constant=3/rho_earth/planetarea;
++	
++	//Allocate: 
++	G=xNewZeroInit<IssmDouble>(3*nel);
++	if(computeelastic){
+ 		GU=xNewZeroInit<IssmDouble>(3*nel);
+ 		if(horiz){
+ 			GN=xNewZeroInit<IssmDouble>(3*nel);
+@@ -5783,18 +6203,6 @@
+ 		}
+ 	}
+ 
+-	/*compute centroids of all elements:*/
+-	for(int i=0;i<nel;i++){
+-		lates[i]= asin(zze[i]/planetradius);
+-		longes[i]= atan2(yye[i],xxe[i]);
+-	}
+-	
+-	
+-	constant=3/rho_earth/planetarea;
+-
+-	/*Recover vertex absolute id: */
+-	this->GetVerticesSidList(&sidlist[0]);
+-
+ 	for(int e=0;e<nel;e++){
+ 		ratioe=constant*areae[e];
+ 		for (int i=0;i<3;i++){
+@@ -5801,15 +6209,17 @@
+ 			IssmDouble alpha;
+ 			IssmDouble delPhi,delLambda;
+ 			/*recover info for this element and vertex:*/
+-			IssmDouble late=lates[e];
+-			IssmDouble longe=longes[e];
+-			sid=sidlist[i];
++			IssmDouble late= asin(zze[e]/sqrt( pow(xxe[e],2.0)+ pow(yye[e],2.0)+ pow(zze[e],2.0)));
++			IssmDouble longe= atan2(yye[e],xxe[e]);
++			
++			lati=latitude[i];
++			longi=longitude[i];
+ 
+ 			/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+-			lati=latitude[sid]/180.*M_PI; longi=longitude[sid]/180.*M_PI;
+ 			delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+ 			alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+ 			index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
++			_assert_(index>0 && index<M);
+ 
+ 			/*Rigid earth gravitational perturbation: */
+ 			G[i*nel+e]+=G_rigid_precomputed[index];
+@@ -5824,11 +6234,11 @@
+ 				GU[i*nel+e] =  ratioe * U_elastic_precomputed[index];
+ 				if(horiz){
+ 					/*Compute azimuths, both north and east components: */
+-					x = xx[sid]; y = yy[sid]; z = zz[sid];
+-					if(latitude[sid]==90){
++					x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
++					if(lati==M_PI/2){
+ 						x=1e-12; y=1e-12;
+ 					}
+-					if(latitude[sid]==-90){
++					if(lati==-M_PI/2){
+ 						x=1e-12; y=1e-12;
+ 					}
+ 					dx = xxe[e]-x; dy = yye[e]-y; dz = zze[e]-z;
+@@ -5841,14 +6251,29 @@
+ 			}
+ 		}
+ 	}
++
++
++	/*Add in inputs:*/
++	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,nel*3);
++	if(computeelastic){
++		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,nel*3);
++		if(horiz){
++			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,nel*3);
++			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,nel*3);
++		}
++	}
++	/*}}}*/
++	/*Compute rotation kernel:{{{*/
+ 	if(computerotation){
+ 
++		/*What is the gravity at planet's surface: */
++		g=4.0/3.0*M_PI*rho_earth*NewtonG*planetradius;
++
+ 		for(int i=0;i<3;i++){
+-			sid=sidlist[i];
+-			lati=latitude[sid]/180.*M_PI; 
+-			longi=longitude[sid]/180.*M_PI; 
++			lati=latitude[i];
++			longi=longitude[i];
+ 
+-			pre=((1.0+tide_love_k[2]-tide_love_h[2])/9.81)*pow(omega*planetradius,2.0);
++			pre=((1.0+tide_love_k[2]-tide_love_h[2])/g)*pow(omega*planetradius,2.0);
+ 			Grotm1[i]= - pre* 0.5*sin(2.*lati)*cos(longi);
+ 			Grotm2[i]= - pre* 0.5*sin(2.*lati)*sin(longi);
+ 			Grotm3[i]= - pre* (1.0/6.0 - 0.5*cos(2.0*lati));
+@@ -5857,19 +6282,8 @@
+ 		this->AddInput(SealevelGrotm2Enum,&Grotm2[0],P1Enum);
+ 		this->AddInput(SealevelGrotm3Enum,&Grotm3[0],P1Enum);
+ 	}
+-
+-
+-	/*Add in inputs:*/
+-	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,nel*3);
+-	if(computeelastic){
+-		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,nel*3);
+-		if(horiz){
+-			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,nel*3);
+-			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,nel*3);
+-		}
+-	}
+-
+-	/*Free allocations:*/
++	/*}}}*/
++	/*Free allocations:{{{*/
+ 	#ifdef _HAVE_RESTRICT_
+ 	delete G;
+ 	if(computeelastic){
+@@ -5879,8 +6293,6 @@
+ 			delete GE;
+ 		}
+ 	}
+-	delete lates;
+-	delete longes;
+ 	#else
+ 	xDelete(G);
+ 	if(computeelastic){
+@@ -5890,70 +6302,140 @@
+ 			xDelete(GE);
+ 		}
+ 	}
+-	delete lates;
+-	delete longes;
+ 	#endif
++	/*}}}*/
+ 
++	
+ 	return;
++
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){ /*{{{*/
+ 
+-	//Compute sea level barystatic loads (ice, water column or bottom pressure, see Farrel and Clarke, Equ. 4)
+-
+-	/*diverse:*/
++	/* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 
++	 * At the same time, we'll tag the elements that are fractionally only inside a mask*/
++	
++	IssmDouble loadweights[3]={0};
+ 	IssmDouble area;
+-	IssmDouble phi_ice=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble phi_water=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble phi_bp=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
+-	IssmDouble I=0; //Do not change this!
+-	IssmDouble W=0; //Do not change this!
+-	IssmDouble BP=0; //Do not change this!
++	IssmDouble loadweightsocean[3]; //to keep memory of these loads, no need to recompute for bottom pressure.
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble planetradius;
++	IssmDouble late,longe;
+ 
+-		bool notfullygrounded=false;
+-	bool computerigid= false;
+-	int  glfraction=1;
+-	int  npartice,nparthydro,npartocean;
+-
+ 	/*flags:*/
+ 	bool isocean=false;
+-	bool ishydro=false;
++	bool isoceanonly=false;
+ 	bool isice=false;
++	bool isiceonly=false;
++	bool  computeice=false;
++	bool  computebp=false;
++	bool  computehydro=false;
+ 
+-	/*output: */
+-	IssmDouble bslcice=0;
+-	IssmDouble bslchydro=0;
+-	IssmDouble bslcbp=0;
+-
+-	/*ice properties: */
+-	IssmDouble rho_ice,rho_water,rho_freshwater;
+-
+ 	/*constants:*/
+ 	IssmDouble constant=0;
+ 	
+ 	/*recover parameters:*/
+-	this->parameters->FindParam(&isice,TransientIsmasstransportEnum);
+-	this->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
+-	this->parameters->FindParam(&ishydro,TransientIshydrologyEnum);
++	this->parameters->FindParam(&computeice,TransientIsmasstransportEnum);
++	this->parameters->FindParam(&computebp,TransientIsoceantransportEnum);
++	this->parameters->FindParam(&computehydro,TransientIshydrologyEnum);
++	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+ 
+-	/*early return if we are not on an ice cap, and we are not requesting 
++	/*get vertex information:*/
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++
++	/*answer mask questions:*/
++	isiceonly=this->IsIceOnlyInElement();
++	isice=this->IsIceInElement();
++	isoceanonly=this->IsOceanOnlyInElement();
++	isocean=this->IsOceanInElement();
++	slgeom->isoceanin[this->lid]=isocean; //keep track for later.
++	area=areae[this->sid];
++
++	/*set barycentre for all elements, to be updated for fractional loads in the next routine: */
++	//late= asin(zze[this->sid]/planetradius)*180.0/M_PI;
++	late= asin(zze[this->sid]/sqrt( pow(xxe[this->sid],2.0)+ pow(yye[this->sid],2.0)+ pow(zze[this->sid],2.0)))*180.0/M_PI;
++	longe= atan2(yye[this->sid],xxe[this->sid])*180.0/M_PI;
++	slgeom->longe[this->lid]=longe;
++	slgeom->late[this->lid]=late;
++
++	/*compute fractional areas and load weights for ocean:*/
++	if(isoceanonly){ 
++		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=area;
++		for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid]=1.0/3.0;
++
++		#ifdef _ISSM_DEBUG_ /*{{{*/
++		/*Inform mask: */
++		constant=1.0;
++		for(int i=0;i<NUMVERTICES;i++) loadweightsocean[i]=1.0/3.0;
++		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum); 
++		this->AddInput(SealevelBarystaticOceanWeightsEnum,loadweightsocean,P1DGEnum);
++		this->AddInput(SealevelBarystaticOceanAreaEnum,&area,P0Enum);
++		#endif /*}}}*/
++	}
++	else if(!isocean){
++		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=0;
++		for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid]=0.0;
++		#ifdef _ISSM_DEBUG_ /*{{{*/
++		/*Inform mask: */
++		constant=0.0;
++		for(int i=0;i<NUMVERTICES;i++) loadweightsocean[i]=0.0;
++		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum); 
++		this->AddInput(SealevelBarystaticOceanWeightsEnum,loadweightsocean,P1DGEnum);
++		this->AddInput(SealevelBarystaticOceanAreaEnum,&constant,P0Enum);
++		#endif /*}}}*/
++	}
++	else{
++		slgeom->issubelement[SLGEOM_OCEAN][this->lid]=true;
++		slgeom->nsubel[SLGEOM_OCEAN]++;
++	}
++		
++	/*early return if we are not on an ice sheet , and we are not requesting 
+ 	 *hydrology or bottom pressure loads :*/
+-	if(!isocean && !ishydro){
+-		if(!masks->isiceonly[this->lid]){
+-		#ifdef _ISSM_DEBUG_
+-			constant=0; this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+-		#endif
+-		return;
++	if(!computebp && !computehydro){
++		if(!isice  || isoceanonly) {
++			#ifdef _ISSM_DEBUG_
++			constant=0; 
++			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticIceAreaEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticHydroAreaEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticBpMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticBpWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticBpAreaEnum,&constant,P0Enum);
++			#endif
++			for(int i=0;i<NUMVERTICES;i++){
++				slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=0;
++				slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=0;
++			}
++			slgeom->LoadArea[SLGEOM_ICE][this->lid]=0;
++			slgeom->LoadArea[SLGEOM_WATER][this->lid]=0;
++			return;
+ 		}
+ 	}
+ 
+ 	/*early return if we are fully floating and we are not doing bottom pressure loads:*/
+-	if(!isocean){
+-		if (masks->isfullyfloating[this->lid]){
++	if(!computebp){
++		if (isoceanonly){
++			#ifdef _ISSM_DEBUG_
+ 			constant=0;
+-			#ifdef _ISSM_DEBUG_
+-			this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticIceAreaEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticHydroAreaEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticBpMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticBpWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticBpAreaEnum,&constant,P0Enum);
+ 			#endif
++			for(int i=0;i<NUMVERTICES;i++){
++				slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=0;
++				slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=0;
++			}
++			slgeom->LoadArea[SLGEOM_ICE][this->lid]=0;
++			slgeom->LoadArea[SLGEOM_WATER][this->lid]=0;
+ 			return;
+ 		}
+ 	}
+@@ -5960,154 +6442,463 @@
+ 
+ 	/*early return if we are not on the ocean and we are not doing ice mass transport of 
+ 	 * hydrology:*/
+-	if(!isice  && !ishydro){
+-		if(!masks->isoceanin[this->lid]){
++	if(!computeice  && !computehydro){
++		if(!isocean){
++			#ifdef _ISSM_DEBUG_
+ 			constant=0;
+-			#ifdef _ISSM_DEBUG_
+-			this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticIceAreaEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticHydroAreaEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticBpMaskEnum,&constant,P0Enum);
++			this->AddInput(SealevelBarystaticBpWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticBpAreaEnum,&constant,P0Enum);
+ 			#endif
++			for(int i=0;i<NUMVERTICES;i++){
++				slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=0;
++				slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=0;
++			}
++			slgeom->LoadArea[SLGEOM_ICE][this->lid]=0;
++			slgeom->LoadArea[SLGEOM_WATER][this->lid]=0;
+ 			return;
+ 		}
++	}
++	
++	/*Deal with ice loads if we are on grounded ice:*/
++	if(isice && !isoceanonly && computeice){
++		if(isiceonly){
++			slgeom->LoadArea[SLGEOM_ICE][this->lid]=area;
++			for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=1.0/3.0;
+ 
++			#ifdef _ISSM_DEBUG_ /*{{{*/
++			/*Inform mask: */
++			constant=1.0;
++			for(int i=0;i<NUMVERTICES;i++) loadweights[i]=1.0/3.0;
++			this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum); 
++			this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticIceAreaEnum,&area,P0Enum);
++			#endif /*}}}*/
++		}
++		else{
++			slgeom->issubelement[SLGEOM_ICE][this->lid]=true;
++			slgeom->nsubel[SLGEOM_ICE]++;
++		}
++	} 
++
++	/*Deal with water loads if we are on ground:*/
++	if(!isoceanonly && computehydro){
++
++		if(!isocean){
++			slgeom->LoadArea[SLGEOM_WATER][this->lid]=area;
++			for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=1.0/3.0;
++
++			#ifdef _ISSM_DEBUG_ /*{{{*/
++			/*Inform mask: */
++			constant=1.0;
++			for(int i=0;i<NUMVERTICES;i++) loadweights[i]=1.0/3.0;
++			this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum); 
++			this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
++			this->AddInput(SealevelBarystaticHydroAreaEnum,&area,P0Enum);
++			#endif /*}}}*/
++		}
++		else{
++			slgeom->issubelement[SLGEOM_WATER][this->lid]=true;
++			slgeom->nsubel[SLGEOM_WATER]++;
++		}
+ 	}
+-	/*if we are an ice shelf, are we fully grounded or not? (used later):*/
+-	if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
+ 	
++}
++/*}}}*/
++void       Tria::SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){ /*{{{*/
+ 
+-	/*recover some parameters:*/
+-	this->parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
+-	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+-	this->parameters->FindParam(&rho_freshwater,MaterialsRhoFreshwaterEnum);
+-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+-	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
+-	this->parameters->FindParam(&npartice,SolidearthNpartIceEnum);
+-	this->parameters->FindParam(&nparthydro,SolidearthNpartHydroEnum);
++	/* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 
++	 * At the same time, we'll tag the elements that are fractionally only inside a mask*/
++	
++	IssmDouble loadweights[3]={0};
++	IssmDouble area,loadarea;
++	IssmDouble loadareaocean;
++	IssmDouble loadweightsocean[3]; //to keep memory of these loads, no need to recompute for bottom pressure.
++	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble latbar=0;
++	IssmDouble longbar=0;
++	IssmDouble constant;
++	IssmDouble nanconstant=NAN;
++	
++	/*get vertex and area information:*/
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++	area=areae[this->sid];
+ 
+-	/*Get area of element: precomputed in the sealevelchange_geometry:*/
+-	this->Element::GetInputValue(&area,AreaEnum);
++	#ifdef _ISSM_DEBUG_
++	this->AddInput(SealevelBarystaticIceLatbarEnum,&nanconstant,P0Enum); 
++	this->AddInput(SealevelBarystaticIceLongbarEnum,&nanconstant,P0Enum); 
++	this->AddInput(SealevelBarystaticHydroLatbarEnum,&nanconstant,P0Enum); 
++	this->AddInput(SealevelBarystaticHydroLongbarEnum,&nanconstant,P0Enum); 
++	this->AddInput(SealevelBarystaticOceanLatbarEnum,&nanconstant,P0Enum); 
++	this->AddInput(SealevelBarystaticOceanLongbarEnum,&nanconstant,P0Enum); 
++	#endif
++	
++	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
++		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
++		
++		this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweightsocean[0],&loadareaocean,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, MaskOceanLevelsetEnum);
++		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=loadareaocean;
++		slgeom->vareae_subel[SLGEOM_OCEAN]->SetValue(intj,loadareaocean,INS_VAL);
++		slgeom->vlatbarycentre[SLGEOM_OCEAN]->SetValue(intj,latbar,INS_VAL);
++		slgeom->vlongbarycentre[SLGEOM_OCEAN]->SetValue(intj,longbar,INS_VAL);
+ 
+-	/*Deal with ice loads if we are on grounded ice:*/
+-	if(masks->isiceonly[this->lid] && !masks->isfullyfloating[this->lid] && isice){ 
++		for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid]=loadweightsocean[i];
++		#ifdef _ISSM_DEBUG_ /*{{{*/
++		/*Inform mask: */
++		constant=loadareaocean/area;
++		this->AddInput(SealevelBarystaticOceanMaskEnum,&constant,P0Enum); 
++		this->AddInput(SealevelBarystaticOceanWeightsEnum,loadweightsocean,P1DGEnum);
++		this->AddInput(SealevelBarystaticOceanAreaEnum,&loadareaocean,P0Enum);
+ 
+-		/*Compute fraction of the element that is grounded: {{{*/
+-		if(notfullygrounded){
+-			IssmDouble xyz_list[NUMVERTICES][3];
+-			::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++		this->AddInput(SealevelBarystaticOceanLatbarEnum,&latbar,P0Enum); 
++		this->AddInput(SealevelBarystaticOceanLongbarEnum,&longbar,P0Enum); 
++		#endif /*}}}*/
++	}
++	if(slgeom->issubelement[SLGEOM_ICE][this->lid]){
++		int intj=slgeom->subelementmapping[SLGEOM_ICE][this->lid];
+ 
+-			phi_ice=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
+-			if(glfraction==0)phi_ice=1;
+-#ifdef _ISSM_DEBUG_
+-			this->AddInput(SealevelBarystaticMaskEnum,&phi_ice,P0Enum);
+-#endif
+-		}
+-		else phi_ice=1.0;
+-		/*}}}*/
++		this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweights[0],&loadarea,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, -MaskOceanLevelsetEnum,MaskIceLevelsetEnum);
+ 
++		slgeom->LoadArea[SLGEOM_ICE][this->lid]=loadarea;
++		slgeom->vareae_subel[SLGEOM_ICE]->SetValue(intj,loadarea,INS_VAL);
++		slgeom->vlatbarycentre[SLGEOM_ICE]->SetValue(intj,latbar,INS_VAL);
++		slgeom->vlongbarycentre[SLGEOM_ICE]->SetValue(intj,longbar,INS_VAL);
++
++		for(int i=0;i<NUMVERTICES;i++)slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=loadweights[i];
++
++		#ifdef _ISSM_DEBUG_
+ 		/*Inform mask: */
+-		constant+=100; //1 for ice.
++		constant=loadarea/area; 
++		this->AddInput(SealevelBarystaticIceMaskEnum,&constant,P0Enum);
++		this->AddInput(SealevelBarystaticIceWeightsEnum,loadweights,P1DGEnum);
++		this->AddInput(SealevelBarystaticIceAreaEnum,&loadarea,P0Enum);
++
++		this->AddInput(SealevelBarystaticIceLatbarEnum,&latbar,P0Enum); 
++		this->AddInput(SealevelBarystaticIceLongbarEnum,&longbar,P0Enum); 
++
++		#endif
++	}
++	if(slgeom->issubelement[SLGEOM_WATER][this->lid]){
++		int intj=slgeom->subelementmapping[SLGEOM_WATER][this->lid];
++
++		this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweights[0],&loadarea,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, -MaskOceanLevelsetEnum);
++
++		slgeom->LoadArea[SLGEOM_WATER][this->lid]=loadarea;
++		slgeom->vareae_subel[SLGEOM_WATER]->SetValue(intj,loadarea,INS_VAL);
++		slgeom->vlatbarycentre[SLGEOM_WATER]->SetValue(intj,latbar,INS_VAL);
++		slgeom->vlongbarycentre[SLGEOM_WATER]->SetValue(intj,longbar,INS_VAL);
++
++		for(int i=0;i<NUMVERTICES;i++)slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid]=loadweights[i];
++
+ 		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
++		/*Inform mask: */
++		constant=loadarea/area; 
++		this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
++		this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
++		this->AddInput(SealevelBarystaticHydroAreaEnum,&loadarea,P0Enum);
++		
++		this->AddInput(SealevelBarystaticHydroLatbarEnum,&latbar,P0Enum); 
++		this->AddInput(SealevelBarystaticHydroLongbarEnum,&longbar,P0Enum); 
++
+ 		#endif
++	}
++	
++}
++/*}}}*/
++void       Tria::SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){ /*{{{*/
+ 
+-		/*Retrieve surface load for ice: */
+-		Input* deltathickness_input=this->GetInput(DeltaIceThicknessEnum);
+-		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
++	/*Declarations:{{{*/
++	int nel;
++	IssmDouble planetarea,planetradius;
++	IssmDouble constant,ratioe;
++	IssmDouble rho_earth;
++	IssmDouble lati,longi;
++	IssmDouble latitude[NUMVERTICES];
++	IssmDouble longitude[NUMVERTICES];
++	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
++	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+-		/*/Average ice thickness over grounded area of the element only: {{{*/
+-		if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
+-		else{
+-			IssmDouble total_weight=0;
+-			bool mainlyfloating = true;
+-			int         point1;
+-			IssmDouble  fraction1,fraction2;
++	#ifdef _HAVE_RESTRICT_
++	IssmDouble* __restrict__ G_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
++	IssmDouble* __restrict__ U_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ H_elastic_precomputed=NULL;
++	IssmDouble** __restrict__ Gsubel=NULL;
++	IssmDouble** __restrict__ GUsubel=NULL;
++	IssmDouble** __restrict__ GNsubel=NULL;
++	IssmDouble** __restrict__ GEsubel=NULL;
+ 
+-			/*Recover portion of element that is grounded*/
+-			this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
+-			Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,mainlyfloating,2);
++	#else
++	IssmDouble* G_elastic_precomputed=NULL;
++	IssmDouble* G_rigid_precomputed=NULL;
++	IssmDouble* U_elastic_precomputed=NULL;
++	IssmDouble* H_elastic_precomputed=NULL;
++	IssmDouble** Gsubel=NULL;
++	IssmDouble** GUsubel=NULL;
++	IssmDouble** GNsubel=NULL;
++	IssmDouble** GEsubel=NULL;
++	#endif
++	
++	/*elastic green function:*/
++	int index;
++	int         M;
+ 
+-			/* Start  looping on the number of gaussian points and average over these gaussian points: */
+-			total_weight=0;
+-			I=0;
+-			while(gauss->next()){
+-				IssmDouble Ig=0;
+-				deltathickness_input->GetInputValue(&Ig,gauss);
+-				I+=Ig*gauss->weight;
+-				total_weight+=gauss->weight;
++	/*Computational flags:*/
++	bool computerigid = false;
++	bool computeelastic = false;
++	int  horiz;
++
++	/*}}}*/
++	/*Recover parameters:{{{ */
++	rho_earth=FindParam(MaterialsEarthDensityEnum);
++	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
++	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
++	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
++	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++	/*}}}*/
++
++	/*early return:*/
++	if(!computerigid)return;
++
++	/*Recover precomputed green function kernels:{{{*/
++	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
++	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
++
++	if(computeelastic){
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
++
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&M);
++
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
++	}
++	/*}}}*/
++	/*Compute lat long of all vertices in the element:{{{*/
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
++	for(int i=0;i<NUMVERTICES;i++){
++		latitude[i]= asin(xyz_list[i][2]/planetradius);
++		longitude[i]= atan2(xyz_list[i][1],xyz_list[i][0]);
++	}
++	/*}}}*/
++	/*Compute green functions:{{{ */
++	constant=3/rho_earth/planetarea;
++
++	Gsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
++	if(computeelastic){
++		GUsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
++		if(horiz){
++			GNsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
++			GEsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
++		}
++	}
++	
++	//Allocate: 
++	for(int l=0;l<SLGEOM_NUMLOADS;l++){
++		int nbar=slgeom->nbar[l];
++		Gsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
++		if(computeelastic){
++			GUsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
++			if(horiz){
++				GNsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
++				GEsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
+ 			}
+-			if(total_weight) I=I/total_weight;
+-			delete gauss;
+ 		}
+-		/*}}}*/
+ 
+-		/*Compute barystatic contribution in kg:*/
+-		bslcice = -rho_ice*phi_ice*area*I;
+-		_assert_(!xIsNan<IssmDouble>(bslcice));
++		for(int e=0;e<nbar;e++){
++			ratioe=constant*slgeom->area_subel[l][e];
++			for (int i=0;i<3;i++){
++				IssmDouble alpha;
++				IssmDouble delPhi,delLambda;
++				/*recover info for this element and vertex:*/
++				IssmDouble late= slgeom->latbarycentre[l][e]; 
++				IssmDouble longe= slgeom->longbarycentre[l][e]; 
++				late=late/180*M_PI;
++				longe=longe/180*M_PI;
+ 
+-		/*Transfer thickness change into kg/m^2:*/
+-		I=I*rho_ice*phi_ice; 
+-	} 
++				lati=latitude[i];
++				longi=longitude[i];
+ 
+-	/*Deal with water loads if we are on ground:*/
+-	if(!masks->isfullyfloating[this->lid] && ishydro){
++				/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
++				delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
++				alpha=2.*asin(sqrt(pow(sin(delPhi/2.0),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2.0),2.0)));
++				index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
+ 
+-		constant+=10; //1 for water.
+-		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+-		#endif
++				/*Rigid earth gravitational perturbation: */
++				Gsubel[l][i*nbar+e]+=G_rigid_precomputed[index];
+ 
+-		/*Retrieve water height at vertices: */
+-		Input* deltathickness_input=this->GetInput(DeltaTwsEnum);
+-		if (!deltathickness_input)_error_("DeltaTwsEnum input needed to compute sea level change!");
+-		deltathickness_input->GetInputAverage(&W);
++				if(computeelastic){
++					Gsubel[l][i*nbar+e]+=G_elastic_precomputed[index];
++				}
++				Gsubel[l][i*nbar+e]*=ratioe;
+ 
+-		/*Compute barystatic component in kg:*/
+-		bslchydro = -rho_freshwater*area*phi_water*W;
+-		_assert_(!xIsNan<IssmDouble>(bslchydro));
++				/*Elastic components:*/
++				if(computeelastic){
++					GUsubel[l][i*nbar+e] =  ratioe * U_elastic_precomputed[index];
++					if(horiz){
++						/*Compute azimuths, both north and east components: */
++						x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
++						if(lati==90){
++							x=1e-12; y=1e-12;
++						}
++						if(lati==-90){
++							x=1e-12; y=1e-12;
++						}
++						IssmDouble xbar=planetradius*cos(late)*cos(longe);
++						IssmDouble ybar=planetradius*cos(late)*sin(longe);
++						IssmDouble zbar=planetradius*sin(late);
+ 
+-		/*convert from m to kg/m^2:*/
+-		W=W*rho_freshwater*phi_water;
++						dx = xbar-x; dy = ybar-y; dz = zbar-z;
++						N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++						E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++
++						GNsubel[l][i*nbar+e] = ratioe*H_elastic_precomputed[index]*N_azim;
++						GEsubel[l][i*nbar+e] = ratioe*H_elastic_precomputed[index]*E_azim;
++					}
++				}
++			}
++		}
+ 	}
+ 
+-	/*Deal with ocean bottom pressures:*/
+-	if(masks->isoceanin[this->lid] && isocean){
++	/*Save all these arrayins for each element:*/
++	for (int l=0;l<SLGEOM_NUMLOADS;l++){
++		this->inputs->SetArrayInput(slgeom->GEnum(l),this->lid,Gsubel[l],slgeom->nbar[l]*3);
++		if(computeelastic){
++			this->inputs->SetArrayInput(slgeom->GUEnum(l),this->lid,GUsubel[l],slgeom->nbar[l]*3);
++			if(horiz){
++				this->inputs->SetArrayInput(slgeom->GNEnum(l),this->lid,GNsubel[l],slgeom->nbar[l]*3);
++				this->inputs->SetArrayInput(slgeom->GEEnum(l),this->lid,GEsubel[l],slgeom->nbar[l]*3);
++			}
++		}
++	}
++	/*}}}*/
++	/*Free memory:{{{*/
++	for (int l=0;l<SLGEOM_NUMLOADS;l++){
++		xDelete<IssmDouble>(Gsubel[l]);
++		if(computeelastic){
++			xDelete<IssmDouble>(GUsubel[l]);
++			if(horiz){
++				xDelete<IssmDouble>(GNsubel[l]);
++				xDelete<IssmDouble>(GEsubel[l]);
++			}
++		}
++	}
++	xDelete<IssmDouble*>(Gsubel);
++	if(computeelastic){
++		xDelete<IssmDouble*>(GUsubel);
++		if(horiz){
++			xDelete<IssmDouble*>(GNsubel); 
++			xDelete<IssmDouble*>(GEsubel);
++		}
++	}
++	/*}}}*/
++	return;
+ 
+-		constant+=1; //1 for bottom pressure.
+-		#ifdef _ISSM_DEBUG_
+-		this->AddInput(SealevelBarystaticMaskEnum,&constant,P0Enum);
+-		#endif
++}
++/*}}}*/
++void       Tria::SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){ /*{{{*/
+ 
+-		/*Retrieve bottom pressure change and average over the element: */
+-		Input* bottompressure_change_input=this->GetInput(DeltaBottomPressureEnum);
+-		if (!bottompressure_change_input)_error_("DeltaBottomPressureEnum pressure input needed to compute sea level change fingerprint!");
+-		bottompressure_change_input->GetInputAverage(&BP);
+-		
+-		/*Compute barystatic component in kg:*/
+-		bslcbp = -rho_water*area*phi_bp*BP;
++	/*Inputs:*/
++	IssmDouble I[NUMVERTICES]; 
++	IssmDouble W[NUMVERTICES];
++	IssmDouble BP[NUMVERTICES];
+ 
+-		/*convert from m to kg/m^2:*/
+-		BP=BP*rho_water*phi_bp;
++	/*output: */
++	IssmDouble bslcice=0;
++	IssmDouble bslchydro=0;
++	IssmDouble bslcbp=0;
++	IssmDouble BPavg=0;
++	IssmDouble Iavg=0;
++	IssmDouble Wavg=0;
++
++	/*ice properties: */
++	IssmDouble rho_ice,rho_water,rho_freshwater;
++
++	/*recover some parameters:*/
++	this->parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
++	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
++	this->parameters->FindParam(&rho_freshwater,MaterialsRhoFreshwaterEnum);
++
++	/*Retrieve inputs:*/
++	Element::GetInputListOnVertices(&I[0],DeltaIceThicknessEnum);
++	Element::GetInputListOnVertices(&W[0],DeltaTwsEnum);
++	Element::GetInputListOnVertices(&BP[0],DeltaBottomPressureEnum);
++
++	for(int i=0;i<NUMVERTICES;i++){
++		Iavg+=I[i]*slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid];
++		Wavg+=W[i]*slgeom->LoadWeigths[SLGEOM_WATER][i][this->lid];
++		BPavg+=BP[i]*slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid];
+ 	}
+ 
+-	/*Plug all loads into total load vector:*/
+-	loads->SetValue(this->sid,I+W+BP,INS_VAL);
++	/*convert from m to kg/m^2:*/
++	Iavg*=rho_ice;
++	Wavg*=rho_freshwater;
++	BPavg*=rho_water;
++
++	#ifdef _ISSM_DEBUG_ 
++	this->AddInput(SealevelBarystaticIceLoadEnum,&Iavg,P0Enum);
++	this->AddInput(SealevelBarystaticHydroLoadEnum,&Wavg,P0Enum);
++	this->AddInput(SealevelBarystaticBpLoadEnum,&BPavg,P0Enum);
++	#endif
++
++	/*Compute barystatic component in kg:*/
++	bslcice =   -slgeom->LoadArea[SLGEOM_ICE][this->lid]*Iavg;
++	bslchydro = -slgeom->LoadArea[SLGEOM_WATER][this->lid]*Wavg;
++	bslcbp =    -slgeom->LoadArea[SLGEOM_OCEAN][this->lid]*BPavg;
+ 	
++	_assert_(!xIsNan<IssmDouble>(bslcice));
++	_assert_(!xIsNan<IssmDouble>(bslchydro));
++	_assert_(!xIsNan<IssmDouble>(bslcbp));
++	
++	/*Plug values into subelement load vector:*/
++	if(slgeom->issubelement[SLGEOM_ICE][this->lid]){
++		int intj=slgeom->subelementmapping[SLGEOM_ICE][this->lid];
++		subelementiceloads->SetValue(intj,Iavg,INS_VAL);
++		Iavg=0; //avoid double counting centroid loads and subelement loads!
++	}
++	if(slgeom->issubelement[SLGEOM_WATER][this->lid]){
++		int intj=slgeom->subelementmapping[SLGEOM_WATER][this->lid];
++		subelementhydroloads->SetValue(intj,Wavg,INS_VAL);
++		Wavg=0;
++	}
++	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
++		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
++		subelementbploads->SetValue(intj,BPavg,INS_VAL); 
++		BPavg=0;
++	}
++	/*Plug remaining values into centroi load vector:*/
++	loads->SetValue(this->sid,Iavg+Wavg+BPavg,INS_VAL);
++
+ 	/*Keep track of barystatic contributions:*/
+ 	barycontrib->Set(this->Sid(),bslcice,bslchydro,bslcbp);
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationvector){ /*{{{*/
++void       Tria::SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*sal green function:*/
+ 	IssmDouble* G=NULL;
++	IssmDouble* GsubelIce=NULL;
++	IssmDouble* GsubelHydro=NULL;
++	IssmDouble* GsubelOcean=NULL;
+ 	IssmDouble SealevelGRD[NUMVERTICES]={0};
+-	IssmDouble oceanaverage,oceanarea=0;
++	IssmDouble oceanaverage=0;
++	IssmDouble oceanarea=0;
+ 	IssmDouble rho_water;
+ 	
+ 	bool sal = false;
+ 	bool rotation= false;
+ 	int  size;
+-	int  nel;
++	int  nel,nbar;
+ 	IssmDouble Grotm1[3];
+ 	IssmDouble Grotm2[3];
+ 	IssmDouble Grotm3[3];
+@@ -6127,6 +6918,9 @@
+ 
+ 	if(sal){
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&GsubelIce,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&GsubelHydro,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&GsubelOcean,&size);
+ 		
+ 		if(allsealevelloads){
+ 			for(int i=0;i<NUMVERTICES;i++) {
+@@ -6133,6 +6927,18 @@
+ 				for (int e=0;e<nel;e++){
+ 					SealevelGRD[i]+=G[i*nel+e]*(allsealevelloads[e]+allloads[e]);
+ 				}
++				nbar=slgeom->nbar[SLGEOM_ICE];
++				for (int e=0;e<nbar;e++){
++					SealevelGRD[i]+=GsubelIce[i*nbar+e]*(allsubelementiceloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_WATER];
++				for (int e=0;e<nbar;e++){
++					SealevelGRD[i]+=GsubelHydro[i*nbar+e]*(allsubelementhydroloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_OCEAN];
++				for (int e=0;e<nbar;e++){
++					SealevelGRD[i]+=GsubelOcean[i*nbar+e]*(allsubelementbploads[e]+allsubelementsealevelloads[e]);
++				}
+ 			}
+ 		}
+ 		else{  //this is the initial convolution where only loads are provided
+@@ -6140,20 +6946,50 @@
+ 				for (int e=0;e<nel;e++){
+ 					SealevelGRD[i]+=G[i*nel+e]*(allloads[e]);
+ 				}
++				nbar=slgeom->nbar[SLGEOM_ICE];
++				for (int e=0;e<nbar;e++){
++					SealevelGRD[i]+=GsubelIce[i*nbar+e]*(allsubelementiceloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_WATER];
++				for (int e=0;e<nbar;e++){
++					SealevelGRD[i]+=GsubelHydro[i*nbar+e]*(allsubelementhydroloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_OCEAN];
++				for (int e=0;e<nbar;e++){
++					SealevelGRD[i]+=GsubelOcean[i*nbar+e]*(allsubelementbploads[e]);
++				}
+ 			}
+ 		}
+ 	}
+ 
+-	/*compute ocean average over element:*/
+-	LevelsetAverage(&oceanaverage,&oceanarea,&SealevelGRD[0],MaskOceanLevelsetEnum);
+-	
++	/*retrieve ocean average and area:*/
++	for(int i=0;i<NUMVERTICES;i++){
++		oceanaverage+=SealevelGRD[i]*slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid];
++	}
++	#ifdef _ISSM_DEBUG_ 
++	this->AddInput(SealevelBarystaticOceanLoadEnum,&oceanaverage,P0Enum);
++	#endif
++	oceanarea=slgeom->LoadArea[SLGEOM_OCEAN][this->lid];
++
+ 	/*add ocean average in the global sealevelloads vector:*/
+-	sealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+-	if(!allsealevelloads)oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
++	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
++		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
++		subelementsealevelloads->SetValue(intj,oceanaverage*rho_water,INS_VAL);
++	}
++	else sealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
++
++	if(!allsealevelloads){
++		oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
++		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
++			int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
++			subelementoceanareas->SetValue(intj,oceanarea,INS_VAL);
++		}
++	}
++
+ 	
+ 	return;
+ } /*}}}*/
+-void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector){ /*{{{*/
++void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	IssmDouble Sealevel[3]={0,0,0};
+ 	IssmDouble SealevelRSL[3]={0,0,0};
+@@ -6160,12 +6996,25 @@
+ 	IssmDouble SealevelU[3]={0,0,0};
+ 	IssmDouble SealevelN[3]={0,0,0};
+ 	IssmDouble SealevelE[3]={0,0,0};
+-	int nel;
++	int nel,nbar;
+ 	bool sal = false;
+ 	IssmDouble* G=NULL;
+ 	IssmDouble* GU=NULL;
+ 	IssmDouble* GE=NULL;
+ 	IssmDouble* GN=NULL;
++	IssmDouble* GsubelIce=NULL;
++	IssmDouble* GsubelHydro=NULL;
++	IssmDouble* GsubelOcean=NULL;
++	IssmDouble* GUsubelIce=NULL;
++	IssmDouble* GUsubelHydro=NULL;
++	IssmDouble* GUsubelOcean=NULL;
++	IssmDouble* GNsubelIce=NULL;
++	IssmDouble* GNsubelHydro=NULL;
++	IssmDouble* GNsubelOcean=NULL;
++	IssmDouble* GEsubelIce=NULL;
++	IssmDouble* GEsubelHydro=NULL;
++	IssmDouble* GEsubelOcean=NULL;
++
+ 	int horiz;
+ 	int size;
+ 	IssmDouble Grotm1[3];
+@@ -6190,10 +7039,24 @@
+ 		
+ 	if(sal){
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+-		if(elastic) this->inputs->GetArrayPtr(SealevelchangeGUEnum,this->lid,&GU,&size);
+-		if(horiz && elastic){
+-			this->inputs->GetArrayPtr(SealevelchangeGEEnum,this->lid,&GE,&size);
+-			this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&GsubelIce,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&GsubelHydro,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&GsubelOcean,&size);
++		if(elastic){
++			this->inputs->GetArrayPtr(SealevelchangeGUEnum,this->lid,&GU,&size);
++			this->inputs->GetArrayPtr(SealevelchangeGUsubelIceEnum,this->lid,&GUsubelIce,&size);
++			this->inputs->GetArrayPtr(SealevelchangeGUsubelHydroEnum,this->lid,&GUsubelHydro,&size);
++			this->inputs->GetArrayPtr(SealevelchangeGUsubelOceanEnum,this->lid,&GUsubelOcean,&size);
++			if(horiz){
++				this->inputs->GetArrayPtr(SealevelchangeGEEnum,this->lid,&GE,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGEsubelIceEnum,this->lid,&GEsubelIce,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGEsubelOceanEnum,this->lid,&GEsubelOcean,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGEsubelHydroEnum,this->lid,&GEsubelHydro,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGNsubelIceEnum,this->lid,&GNsubelIce,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGNsubelHydroEnum,this->lid,&GNsubelHydro,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGNsubelOceanEnum,this->lid,&GNsubelOcean,&size);
++			}
+ 		}
+ 
+ 		for(int i=0;i<NUMVERTICES;i++) {
+@@ -6200,10 +7063,35 @@
+ 			for (int e=0;e<nel;e++){
+ 				SealevelRSL[i]+=G[i*nel+e]*(sealevelloads[e]+loads[e]);
+ 			}
++			nbar=slgeom->nbar[SLGEOM_ICE];
++			for (int e=0;e<nbar;e++){
++				SealevelRSL[i]+=GsubelIce[i*nbar+e]*(subelementiceloads[e]);
++			}
++			nbar=slgeom->nbar[SLGEOM_WATER];
++			for (int e=0;e<nbar;e++){
++				SealevelRSL[i]+=GsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
++			}
++			nbar=slgeom->nbar[SLGEOM_OCEAN];
++			for (int e=0;e<nbar;e++){
++				SealevelRSL[i]+=GsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
++			}
++
+ 			if(elastic){
+ 				for (int e=0;e<nel;e++){
+ 					SealevelU[i]+=GU[i*nel+e]*(sealevelloads[e]+loads[e]);
+ 				}
++				nbar=slgeom->nbar[SLGEOM_ICE];
++				for (int e=0;e<nbar;e++){
++					SealevelU[i]+=GUsubelIce[i*nbar+e]*(subelementiceloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_WATER];
++				for (int e=0;e<nbar;e++){
++					SealevelU[i]+=GUsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_OCEAN];
++				for (int e=0;e<nbar;e++){
++					SealevelU[i]+=GUsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
++				}
+ 			}
+ 			if(horiz && elastic){
+ 				for (int e=0;e<nel;e++){
+@@ -6210,6 +7098,21 @@
+ 					SealevelN[i]+=GN[i*nel+e]*(sealevelloads[e]+loads[e]);
+ 					SealevelE[i]+=GE[i*nel+e]*(sealevelloads[e]+loads[e]);
+ 				}
++				nbar=slgeom->nbar[SLGEOM_ICE];
++				for (int e=0;e<nbar;e++){
++					SealevelN[i]+=GNsubelIce[i*nbar+e]*(subelementiceloads[e]);
++					SealevelE[i]+=GEsubelIce[i*nbar+e]*(subelementiceloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_WATER];
++				for (int e=0;e<nbar;e++){
++					SealevelN[i]+=GNsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
++					SealevelE[i]+=GEsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
++				}
++				nbar=slgeom->nbar[SLGEOM_OCEAN];
++				for (int e=0;e<nbar;e++){
++					SealevelN[i]+=GNsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
++					SealevelE[i]+=GEsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
++				}
+ 			}
+ 		}
+ 	}
+@@ -6227,129 +7130,26 @@
+ 
+ 
+ } /*}}}*/
+-void       Tria::LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum){ /*{{{*/
+-
+-	IssmDouble phi=1.0;
+-	IssmDouble area;
+-	IssmDouble average = 0;
+-	IssmDouble total_weight=0;
+-	int        point1;
+-	IssmDouble fraction1,fraction2;
+-	IssmDouble levelsetvalues[NUMVERTICES];
+-	bool       fractiongeometryflag=true;
+-	
+-
+-
+-	/*retrieve value of levelset:*/
+-	Input *levelset= this->GetInput(levelsetenum);
+-	this->Element::GetInputListOnVertices(&levelsetvalues[0],levelsetenum);
+-	
+-	/*Early return if no vertices are inside the desired area:*/
+-	if(levelset->GetInputMin()>=0){
+-		*paverage=0;
+-		*parea=0;
+-		return;
+-	}
+-
+-	/*Get area of element:*/
+-	this->Element::GetInputValue(&area,AreaEnum);
+-
+-	/*Are we fully in the desired area, in which case average over the entire area?:*/
+-	if(levelset->GetInputMax()<=0){
+-		for(int i=0;i<NUMVERTICES;i++) average+=field_on_localvertices[i]/NUMVERTICES;
++void       Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){/*{{{*/
+ 		
+-		*parea=area;
+-		*paverage=average;
+-		return;
+-	}
+-
+-	/*What fraction of the triangle is in the desired area?:*/
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	phi=this->GetFractionArea(&xyz_list[0][0],levelsetvalues); 
+-	area=phi*area;
+-
+-	/*Average over  the fraction area only, using the right gaussian points: */
+-	this->GetFractionGeometry(&point1,&fraction1,&fraction2,&fractiongeometryflag,levelsetvalues);
+-	Gauss* gauss = this->NewGauss(point1,fraction1,fraction2,fractiongeometryflag,2); 
+-
+-	total_weight=0;
+-	average=0;
+-	while(gauss->next()){
+-		IssmDouble field_gauss=0;
+-		TriaRef::GetInputValue(&field_gauss, field_on_localvertices, gauss,P1Enum);
+-		average+=field_gauss*gauss->weight;
+-		total_weight+=gauss->weight;
+-	}
+-	if(total_weight) average=average/total_weight;
+-	
+-	/*free ressources:*/
+-	delete gauss;
+-
+-	*paverage=average;
+-	*parea=area;
+-	return;
+-
+-}
+-/*}}}*/
+-void       Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads){/*{{{*/
+-		
+ 	IssmDouble S=0;
+ 
+ 	/*Compute area of element:*/
+-	IssmDouble area,planetarea;
++	IssmDouble area,planetarea,re;
++	IssmDouble late,longe;
+ 	this->Element::GetInputValue(&area,AreaEnum);
+ 
+-	/*recover earth area: */
++	/*recover parameters: */
+ 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
++	this->parameters->FindParam(&re,SolidearthPlanetRadiusEnum);
++	late=slgeom->late[this->lid]/180*M_PI;
++	longe=slgeom->longe[this->lid]/180*M_PI;
+ 
+-	/*Compute lat,long,radius of elemental centroid: */
+-	bool spherical=true;
+-	IssmDouble llr_list[NUMVERTICES][3];
+-	IssmDouble late,longe,re;
+-	/* Where is the centroid of this element?:{{{*/
+-	::GetVerticesCoordinates(&llr_list[0][0],this->vertices,NUMVERTICES,spherical);
+ 
+-	IssmDouble minlong=400;
+-	IssmDouble maxlong=-20;
+-	for (int i=0;i<NUMVERTICES;i++){
+-		llr_list[i][0]=(90-llr_list[i][0]);
+-		if(llr_list[i][1]<0)llr_list[i][1]=180+(180+llr_list[i][1]);
+-		if(llr_list[i][1]>maxlong)maxlong=llr_list[i][1];
+-		if(llr_list[i][1]<minlong)minlong=llr_list[i][1];
+-	}
+-	if(minlong==0 && maxlong>180){
+-		if (llr_list[0][1]==0)llr_list[0][1]=360;
+-		if (llr_list[1][1]==0)llr_list[1][1]=360;
+-		if (llr_list[2][1]==0)llr_list[2][1]=360;
+-	}
+-
+-	// correction at the north pole
+-	if(llr_list[0][0]==0)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
+-	if(llr_list[1][0]==0)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
+-	if(llr_list[2][0]==0)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
+-
+-	//correction at the south pole
+-	if(llr_list[0][0]==180)llr_list[0][1]=(llr_list[1][1]+llr_list[2][1])/2.0;
+-	if(llr_list[1][0]==180)llr_list[1][1]=(llr_list[0][1]+llr_list[2][1])/2.0;
+-	if(llr_list[2][0]==180)llr_list[2][1]=(llr_list[0][1]+llr_list[1][1])/2.0;
+-
+-	late=(llr_list[0][0]+llr_list[1][0]+llr_list[2][0])/3.0;
+-	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
+-
+-	late=90.-late;
+-	if(longe>180.)longe=(longe-180.)-180.;
+-
+-	late=late/180.*M_PI;
+-	longe=longe/180.*M_PI;
+-	/*}}}*/
+-	re=(llr_list[0][2]+llr_list[1][2]+llr_list[2][2])/3.0;
+-
+-
+ 	/*recover total load: */
+ 	if(loads) S+=loads[this->Sid()];
+ 	if(sealevelloads) S+=sealevelloads[this->Sid()];
+-
++	
+ 	/* Perturbation terms for moment of inertia (moi_list):
+ 	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
+ 	 * also consistent with my GMD formulation!
+@@ -6360,12 +7160,71 @@
+ 	dI_list[2] = +4*M_PI*(S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	return;
+ }/*}}}*/
+-void       Tria::SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks){ /*{{{*/
++void       Tria::SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){/*{{{*/
++		
++	IssmDouble  SA=0;
++	IssmDouble* loads=NULL;
++	IssmDouble* sealevelloads=NULL;
++	IssmDouble  late,longe,re;
++	int         intj;
++	IssmDouble  area;
++	IssmDouble  planetarea;
++
++	/*recover parameters: */
++	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
++	this->parameters->FindParam(&re,SolidearthPlanetRadiusEnum);
+ 	
+-	if(masks->isoceanin[this->lid]){
+-		loads->SetValue(this->sid,offset,ADD_VAL);
++	/*Initalize:*/
++	for(int i=0;i<3;i++)dI_list[i]=0;
++
++	/*Go through our loads:*/
++	for(int i=0;i<SLGEOM_NUMLOADS;i++){
++		if(slgeom->issubelement[i][this->lid]){
++			switch(i){
++				case SLGEOM_ICE: 
++					loads=subelementiceloads;
++					break;
++				case SLGEOM_WATER: 
++					loads=subelementhydroloads;
++					break;
++				case SLGEOM_OCEAN: 
++					loads=subelementbploads;
++					sealevelloads=subelementsealevelloads;
++					break;
++			}
++			intj=slgeom->subelementmapping[i][this->lid];
++			late=slgeom->latbarycentre[i][intj]/180*M_PI;
++			longe=slgeom->longbarycentre[i][intj]/180*M_PI;
++			area=slgeom->area_subel[i][intj];
++
++			/*recover total load: */
++			if(loads) SA+=loads[intj]*area;
++			if(sealevelloads) SA+=sealevelloads[intj]*area;
++		}
+ 	}
+ 
++	/* Perturbation terms for moment of inertia (moi_list):
++	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
++	 * also consistent with my GMD formulation!
++	 * ALL in geographic coordinates
++	 * */
++	dI_list[0] += -4*M_PI*(SA)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
++	dI_list[1] += -4*M_PI*(SA)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
++	dI_list[2] += +4*M_PI*(SA)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
++
++	return;
++}/*}}}*/
++void       Tria::SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
++	
++	if(slgeom->isoceanin[this->lid]){
++		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
++			int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
++			subelementloads->SetValue(intj,offset,ADD_VAL);
++		}
++		else loads->SetValue(this->sid,offset,ADD_VAL);
++	}
++
++
+ } /*}}}*/
+ #endif
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26221)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26222)
+@@ -70,6 +70,7 @@
+ 		void        ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum,int control_interp);
+ 		void        CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
+ 		void        ElementCoordinates(Vector<IssmDouble>* vxe,Vector<IssmDouble>* vye,Vector<IssmDouble>* vze, Vector<IssmDouble>* vareae, bool spherical=false);
++		void        ElementCoordinates(Vector<IssmDouble>* vlonge,Vector<IssmDouble>* vlate,Vector<IssmDouble>* vareae);
+ 		int         EdgeOnBaseIndex();
+ 		void        EdgeOnBaseIndices(int* pindex1,int* pindex);
+ 		int         EdgeOnSurfaceIndex();
+@@ -83,8 +84,11 @@
+ 		void        GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues);
+ 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
+ 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
+-		void        GetFractionGeometry(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* pmainlynegative, IssmDouble* gl);
+-		IssmDouble  GetFractionArea(IssmDouble* xyz_list, IssmDouble* gl);
++		void        GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl);
++		void        GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum);
++		void        GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum);
++		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius);
++		IssmDouble  GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]);
+ 		IssmDouble  GetIcefrontArea();
+ 		void	      GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+ 		void        GetInputListOnVertices(IssmDouble* pvalue,Input* input,IssmDouble default_value);
+@@ -163,16 +167,17 @@
+ 		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_SEALEVELCHANGE_
+-		void       LevelsetAverage(IssmDouble* paverage, IssmDouble* parea, IssmDouble* field_on_localvertices, int levelsetenum);
+-		void       SealevelchangeMomentOfInertia(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads);
+-		void       SealevelchangeGeometry(IssmDouble* lat, IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze);
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+-		void       SetSealevelMasks(SealevelMasks* masks);
+-		void       SealevelchangeGeometry(IssmDouble* lat,IssmDouble* longi,IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, BarystaticContributions* barycontrib, SealevelMasks* masks);
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* oceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* rotationaxismotionvector);
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* loads, IssmDouble* rotationvector);
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, IssmDouble offset, SealevelMasks* masks);
++		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
++		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom);
++		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae);
++		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
++		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom);
++		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
++		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom);
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom);
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom);
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26222)
+@@ -0,0 +1,136 @@
++/*
++ * \file SealevelGeometry.cpp
++ * \brief: Implementation of SealevelGeometry class
++ */
++
++/*Headers: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./SealevelGeometry.h"
++
++using namespace std;
++/*}}}*/
++
++/*Object constructors and destructor*/
++SealevelGeometry::SealevelGeometry(int localnelin){ /*{{{*/
++	localnel=localnelin;
++	for(int i=0;i<SLGEOM_NUMLOADS;i++){
++		for (int j=0;j<MAXVERTICES;j++){
++			LoadWeigths[i][j]=xNewZeroInit<IssmDouble>(localnel);
++		}
++		vlatbarycentre[i]=NULL; //we don't know yet 
++		vlongbarycentre[i]=NULL;
++		vareae_subel[i]=NULL;
++		latbarycentre[i]=NULL; //we don't know yet 
++		longbarycentre[i]=NULL;
++		area_subel[i]=NULL;
++
++		LoadArea[i]=xNewZeroInit<IssmDouble>(localnel);
++		issubelement[i]=xNewZeroInit<bool>(localnel);
++		subelementmapping[i]=NULL;
++		nsubel[i]=0;
++		nbar[i]=0;
++	}
++	late=xNew<IssmDouble>(localnel);
++	longe=xNew<IssmDouble>(localnel);
++	isoceanin=xNew<bool>(localnel);
++
++}; /*}}}*/
++SealevelGeometry::~SealevelGeometry(){ /*{{{*/
++	for(int i=0;i<SLGEOM_NUMLOADS;i++){
++		for (int j=0;j<MAXVERTICES;j++){
++			xDelete<IssmDouble>(LoadWeigths[i][j]);
++		}
++		xDelete<IssmDouble>(LoadArea[i]);
++		xDelete<bool>(issubelement[i]);
++		xDelete<int>(subelementmapping[i]);
++		delete  vlatbarycentre[i];
++		delete  vlongbarycentre[i];
++		delete  vareae_subel[i];
++		xDelete<IssmDouble>(latbarycentre[i]);
++		xDelete<IssmDouble>(longbarycentre[i]);
++		xDelete<IssmDouble>(area_subel[i]);
++	}
++	xDelete<IssmDouble>(late);
++	xDelete<IssmDouble>(longe);
++	xDelete<bool>(isoceanin);
++}; /*}}}*/
++
++void SealevelGeometry::InitializeMappingsAndBarycentres(void){ /*{{{*/
++
++	int dummy;
++	bool fromlocalsize=true;
++	int lower_row;
++
++
++	for (int i=0;i<SLGEOM_NUMLOADS;i++){
++		subelementmapping[i]=xNew<int>(localnel);
++		GetOwnershipBoundariesFromRange(&lower_row,&dummy,nsubel[i],IssmComm::GetComm());
++
++		int count=0;
++		for (int j=0;j<localnel;j++){
++			if(issubelement[i][j]){
++				subelementmapping[i][j]=lower_row+count;
++				count++;
++			}
++		}
++	}
++
++	/*Initialize barycentre vectors, now that we know their size: */
++	for (int i=0;i<SLGEOM_NUMLOADS;i++){
++		vlatbarycentre[i]=new Vector<IssmDouble>(nsubel[i],fromlocalsize);
++		vlongbarycentre[i]=new Vector<IssmDouble>(nsubel[i],fromlocalsize);
++		vareae_subel[i]=new Vector<IssmDouble>(nsubel[i],fromlocalsize);
++		vlatbarycentre[i]->GetSize(&nbar[i]);
++	}
++
++} /*}}}*/
++void SealevelGeometry::Assemble(void){ /*{{{*/
++
++	/*Initialize barycentre vectors, now that we know their size: */
++	for (int i=0;i<SLGEOM_NUMLOADS;i++){
++		vlatbarycentre[i]->Assemble();
++		vlongbarycentre[i]->Assemble();
++		vareae_subel[i]->Assemble();
++
++		latbarycentre[i]=vlatbarycentre[i]->ToMPISerial();
++		longbarycentre[i]=vlongbarycentre[i]->ToMPISerial();
++		area_subel[i]=vareae_subel[i]->ToMPISerial();
++	}
++
++	/*Also, we'll need the barycentre associated areas:*/
++
++
++} /*}}}*/
++int SealevelGeometry::GEnum(int l){ /*{{{*/
++	
++	if(l==SLGEOM_OCEAN) return SealevelchangeGsubelOceanEnum; 
++	if(l==SLGEOM_ICE) return SealevelchangeGsubelIceEnum; 
++	if(l==SLGEOM_WATER) return SealevelchangeGsubelHydroEnum; 
++
++} /*}}}*/
++int SealevelGeometry::GUEnum(int l){ /*{{{*/
++	
++	if(l==SLGEOM_OCEAN) return SealevelchangeGUsubelOceanEnum; 
++	if(l==SLGEOM_ICE) return SealevelchangeGUsubelIceEnum; 
++	if(l==SLGEOM_WATER) return SealevelchangeGUsubelHydroEnum; 
++
++} /*}}}*/
++int SealevelGeometry::GNEnum(int l){ /*{{{*/
++	
++	if(l==SLGEOM_OCEAN) return SealevelchangeGNsubelOceanEnum; 
++	if(l==SLGEOM_ICE) return SealevelchangeGNsubelIceEnum; 
++	if(l==SLGEOM_WATER) return SealevelchangeGNsubelHydroEnum; 
++
++} /*}}}*/
++int SealevelGeometry::GEEnum(int l){ /*{{{*/
++	
++	if(l==SLGEOM_OCEAN) return SealevelchangeGEsubelOceanEnum; 
++	if(l==SLGEOM_ICE) return SealevelchangeGEsubelIceEnum; 
++	if(l==SLGEOM_WATER) return SealevelchangeGEsubelHydroEnum; 
++
++} /*}}}*/
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.h	(nonexistent)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.h	(revision 26222)
+@@ -0,0 +1,47 @@
++/*!\file SealevelGeometry.h
++ * \brief: header file for SealevelMask geometry
++ */
++
++#ifndef _SEALEVELGEOMETRY_H_
++#define _SEALEVELGEOMETRY_H_
++
++/*Headers:*/
++#define SLGEOM_NUMLOADS 3
++#define SLGEOM_OCEAN 0 
++#define SLGEOM_ICE 1 
++#define SLGEOM_WATER 2
++#define MAXVERTICES 3
++
++#include "../toolkits/toolkits.h"
++
++class SealevelGeometry{ 
++
++	public: 
++
++		int         localnel;
++		IssmDouble* LoadWeigths[SLGEOM_NUMLOADS][MAXVERTICES];
++		IssmDouble* LoadArea[SLGEOM_NUMLOADS];
++		Vector<IssmDouble>* vlatbarycentre[SLGEOM_NUMLOADS];
++		Vector<IssmDouble>* vlongbarycentre[SLGEOM_NUMLOADS];
++		Vector<IssmDouble>* vareae_subel[SLGEOM_NUMLOADS];
++		IssmDouble* latbarycentre[SLGEOM_NUMLOADS];
++		IssmDouble* longbarycentre[SLGEOM_NUMLOADS];
++		IssmDouble* area_subel[SLGEOM_NUMLOADS];
++		IssmDouble* late;
++		IssmDouble* longe;
++		bool* isoceanin;
++		bool*       issubelement[SLGEOM_NUMLOADS]; 
++		int*        subelementmapping[SLGEOM_NUMLOADS];
++		int         nsubel[SLGEOM_NUMLOADS];
++		int         nbar[SLGEOM_NUMLOADS];
++		
++		SealevelGeometry(int localnel);
++		~SealevelGeometry();
++		void InitializeMappingsAndBarycentres(void);
++		void Assemble(void);
++		int GEnum(int l);
++		int GUEnum(int l);
++		int GNEnum(int l);
++		int GEEnum(int l);
++};
++#endif  /* _SEALEVELGEOMETRY_H_ */
+Index: ../trunk-jpl/src/c/classes/classes.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/classes.h	(revision 26221)
++++ ../trunk-jpl/src/c/classes/classes.h	(revision 26222)
+@@ -17,7 +17,7 @@
+ #include "./Segment.h"
+ #include "./Massfluxatgate.h"
+ #include "./Misfit.h"
+-#include "./SealevelMasks.h"
++#include "./SealevelGeometry.h"
+ #include "./BarystaticContributions.h"
+ #include "./Nodalvalue.h"
+ #include "./Numberedcostfunction.h"
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26222)
+@@ -2,6 +2,13 @@
+  * \brief: core of the sea-level change solution 
+  */ 
+ 
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++
+ #include "./cores.h"
+ #include "../toolkits/toolkits.h"
+ #include "../classes/classes.h"
+@@ -16,16 +23,18 @@
+ void TransferForcing(FemModel* femmodel,int forcingenum);
+ void TransferSealevel(FemModel* femmodel,int forcingenum);
+ void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+-IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea);
+-SealevelMasks* sealevel_masks(FemModel* femmodel);
+-void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealeveloads);
+-void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, IssmDouble offset, SealevelMasks* masks);
++IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble oceanarea);
++void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom);
++void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, IssmDouble offset, SealevelGeometry* slgeom);
+ void ivins_deformation_core(FemModel* femmodel);
++IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel);
+ /*}}}*/
+ 
+ /*main cores:*/
+ void sealevelchange_core(FemModel* femmodel){ /*{{{*/
+ 
++	SealevelGeometry* slgeom=NULL;
++
+ 	/*Start profiler*/
+ 	femmodel->profiler->Start(SLRCORE);
+ 
+@@ -42,7 +51,7 @@
+ 	femmodel->SetCurrentConfiguration(SealevelchangeAnalysisEnum);
+ 
+ 	/*run geometry core: */
+-	sealevelchange_geometry(femmodel);
++	slgeom=sealevelchange_geometry(femmodel);
+ 	
+ 	/*any external forcings?:*/
+ 	solidearthexternal_core(femmodel);
+@@ -51,7 +60,7 @@
+ 	couplerinput_core(femmodel);
+ 
+ 	/*Run geodetic:*/
+-	grd_core(femmodel);
++	grd_core(femmodel,slgeom);
+ 
+ 	/*Run steric core for sure:*/
+ 	dynstr_core(femmodel);
+@@ -205,22 +214,30 @@
+ 	}
+ 	
+ }; /*}}}*/
+-void grd_core(FemModel* femmodel) { /*{{{*/
++void grd_core(FemModel* femmodel, SealevelGeometry* slgeom) { /*{{{*/
+ 
+ 	/*variables:{{{*/
+ 	int nel;
+ 	BarystaticContributions* barycontrib=NULL;
+-	SealevelMasks* masks=NULL;
+ 	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
+ 	IssmDouble rotationaxismotionvector[3]={0};
+ 	
+ 	Vector<IssmDouble>*    loads=NULL;
+ 	IssmDouble*            allloads=NULL; 
++	Vector<IssmDouble>*    subelementiceloads=NULL;
++	IssmDouble*            allsubelementiceloads=NULL;
++	Vector<IssmDouble>*    subelementhydroloads=NULL;
++	IssmDouble*            allsubelementhydroloads=NULL;
++	Vector<IssmDouble>*    subelementbploads=NULL;
++	IssmDouble*            allsubelementbploads=NULL;
+ 	Vector<IssmDouble>*    sealevelloads=NULL;
++	IssmDouble*            allsealevelloads=NULL;
++	Vector<IssmDouble>*    subelementsealevelloads=NULL;
++	IssmDouble*            allsubelementsealevelloads=NULL;
+ 	Vector<IssmDouble>*    oldsealevelloads=NULL;
+-	IssmDouble*            allsealevelloads=NULL;
+ 	Vector<IssmDouble>*    oceanareas=NULL;
+ 	IssmDouble             oceanarea;
++	Vector<IssmDouble>*    subelementoceanareas=NULL;
+ 	IssmDouble             oceanaverage;
+ 	bool                   scaleoceanarea=false;
+ 	IssmDouble             rho_water;
+@@ -264,7 +281,6 @@
+ 		femmodel->parameters->FindParam(&earthid,EarthIdEnum);
+ 		if(modelid!=earthid)return;
+ 	}
+-
+ 	/*branch directly to Ivins deformation core if requested:*/
+ 	if(grdmodel==IvinsEnum){
+ 		ivins_deformation_core(femmodel);
+@@ -281,63 +297,82 @@
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	/*}}}*/
+ 
+-	/*initialize matrices and vectors:*/
++	/*initialize loads and sea level loads:*/
+ 	femmodel->parameters->FindParam(&nel,MeshNumberofelementsEnum);
++
+ 	loads=new Vector<IssmDouble>(nel);
+-	oceanareas=new Vector<IssmDouble>(nel);
++	subelementiceloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_ICE]);
++	subelementhydroloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_WATER]);
++	subelementbploads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
++
+ 	sealevelloads=new Vector<IssmDouble>(nel);
+ 	sealevelloads->Set(0);sealevelloads->Assemble();
++	subelementsealevelloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
++	subelementoceanareas=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
++	oceanareas=new Vector<IssmDouble>(nel);
+ 
+-	/*call masks core: */
+-	masks=sealevel_masks(femmodel);
+ 	if(VerboseSolution()) _printf0_("	  starting  GRD convolutions\n");
+-	
++
+ 	/*buildup loads: */
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeBarystaticLoads(loads, barycontrib,masks); 
++		element->SealevelchangeBarystaticLoads(loads, subelementiceloads, subelementhydroloads, subelementbploads, barycontrib,slgeom); 
+ 	}
+ 	loads->Assemble(); 
++	subelementiceloads->Assemble();
++	subelementhydroloads->Assemble();
++	subelementbploads->Assemble();
++	
+ 
+ 	//broadcast loads 
+ 	allloads=loads->ToMPISerial();
++	allsubelementiceloads=subelementiceloads->ToMPISerial();
++	allsubelementhydroloads=subelementhydroloads->ToMPISerial();
++	allsubelementbploads=subelementbploads->ToMPISerial();
+ 
+ 	//compute rotation axis motion:
+-	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,NULL);
++	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsubelementiceloads,allsubelementhydroloads,allsubelementbploads, NULL, NULL,slgeom);
+ 
+ 	/*skip computation of sea level if requested, which means sea level loads should be zeroed */
+ 	if(!computesealevel){
+ 		allsealevelloads=xNewZeroInit<IssmDouble>(nel);
++		allsubelementsealevelloads=xNewZeroInit<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+ 		goto deformation;
+ 	}
+ 
+ 	if(VerboseSolution()) _printf0_("	  converging GRD convolutions\n");
+ 	for(;;){
+-			
++
+ 		oldsealevelloads=sealevelloads->Duplicate(); sealevelloads->Copy(oldsealevelloads);
+ 
+ 		/*convolve load and sealevel loads on oceans:*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelchangeConvolution(sealevelloads, oceanareas, allsealevelloads, allloads,rotationaxismotionvector);
++			element->SealevelchangeConvolution(sealevelloads, subelementsealevelloads, oceanareas, subelementoceanareas, allsealevelloads, allloads,allsubelementiceloads, allsubelementhydroloads, allsubelementbploads, allsubelementsealevelloads, rotationaxismotionvector,slgeom);
+ 		}
++
+ 		sealevelloads->Assemble();
++		subelementsealevelloads->Assemble();
+ 
+ 		/*compute ocean areas:*/
+ 		if(!allsealevelloads){ //first time in the loop
+-			oceanareas->Assemble(); oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
++			oceanareas->Assemble(); 
++			subelementoceanareas->Assemble();
++			oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+ 			if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+ 		}
++	
++		//Conserve ocean mass: 
++		oceanaverage=SealevelloadsOceanAverage(sealevelloads,subelementsealevelloads, oceanareas,subelementoceanareas, oceanarea);
+ 		
+-		//Conserve ocean mass: 
+-		oceanaverage=SealevelloadsOceanAverage(sealevelloads,oceanareas,oceanarea);
+-		ConserveOceanMass(femmodel,sealevelloads,barycontrib->Total()/oceanarea - oceanaverage,masks);
++		ConserveOceanMass(femmodel,sealevelloads,subelementsealevelloads,barycontrib->Total()/oceanarea - oceanaverage,slgeom);
+ 
+ 		//broadcast sea level loads 
+ 		allsealevelloads=sealevelloads->ToMPISerial();
++		allsubelementsealevelloads=subelementsealevelloads->ToMPISerial();
+ 
+ 		//compute rotation axis motion:
+-		RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsealevelloads);
++		RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsubelementiceloads,allsubelementhydroloads,allsubelementbploads, allsealevelloads,allsubelementsealevelloads,slgeom);
+ 
+ 		//convergence?
+ 		slcconvergence(&converged,sealevelloads,oldsealevelloads,eps_rel,eps_abs);
+@@ -355,16 +390,16 @@
+ 	/*convolve loads and sea level loads to get the deformation:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeDeformationConvolution(allsealevelloads, allloads, rotationaxismotionvector);
++		element->SealevelchangeDeformationConvolution(allsealevelloads, allsubelementsealevelloads,allloads, allsubelementiceloads, allsubelementhydroloads, allsubelementbploads,rotationaxismotionvector,slgeom);
+ 	}
+-	
++
+ 	if(VerboseSolution()) _printf0_("	  updating GRD fields\n");
+ 
+ 	/*Update bedrock motion and geoid:*/
+ 	if(computesealevel){
+-		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/rho_water/oceanarea- oceanaverage/rho_water);
++		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/rho_water/oceanarea- oceanaverage/rho_water); //given that we converged, no need to recompute ocean average
+ 
+-		/*cumulate barystatic contributions and save to results: */
++		//cumulate barystatic contributions and save to results: 
+ 		barycontrib->Cumulate(femmodel->parameters);
+ 		barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
+ 	}
+@@ -517,97 +552,119 @@
+ /*}}}*/
+ 
+ //Geometry:
+-SealevelMasks* sealevel_masks(FemModel* femmodel) {  /*{{{*/
++void sealevelchange_initialgeometry(FemModel* femmodel) {  /*{{{*/
+ 
+-	int grdmodel=0; 
++	/*Geometry core where we compute geometrical kernels and weights:*/
+ 
+-	/*early return?:*/
++	/*parameters: */
++	IssmDouble *xxe    = NULL;
++	IssmDouble *yye    = NULL;
++	IssmDouble *zze    = NULL;
++	IssmDouble* areae  = NULL;
++	int  nel;
++	int  grdmodel=0;
++
++	/*retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+-	if(grdmodel==IvinsEnum) return NULL;
+-
+-	if(VerboseSolution()) _printf0_("	  computing sea level masks\n");
++	nel=femmodel->elements->NumberOfElements();
+ 	
+-	/*initialize SealevelMasks structure: */
+-	SealevelMasks* masks=new SealevelMasks(femmodel->elements->Size());
++	/*early return?:*/
++	if(grdmodel==IvinsEnum) return;
+ 
+-	/*go through elements and fill the masks: */
++	/*Verbose: */
++	if(VerboseSolution()) _printf0_("	  computing initial sea level geometrical kernels and weights.\n");
++
++	/*recover x,y,z and areas from elements: */
++	ElementCoordinatesx(&xxe,&yye,&zze,&areae,femmodel->elements);
++
++	/*Run sealevel geometry routine in elements:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		element->SetSealevelMasks(masks);
++		element->SealevelchangeGeometryInitial(xxe,yye,zze,areae);
+ 	}
+ 
+-	return masks;
++	femmodel->parameters->AddObject(new DoubleVecParam(XxeEnum,xxe,nel));
++	femmodel->parameters->AddObject(new DoubleVecParam(YyeEnum,yye,nel));
++	femmodel->parameters->AddObject(new DoubleVecParam(ZzeEnum,zze,nel));
++	femmodel->parameters->AddObject(new DoubleVecParam(AreaeEnum,areae,nel));
++
++
++	#ifdef _ISSM_DEBUG_
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,XxeEnum,xxe,nel,1,1,1));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,YyeEnum,yye,nel,1,1,1));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,ZzeEnum,zze,nel,1,1,1));
++	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,AreaeEnum,areae,nel,1,1,1));
++	#endif
++
++	return;
++
++
+ }/*}}}*/
+-void sealevelchange_geometry(FemModel* femmodel) {  /*{{{*/
++SealevelGeometry* sealevelchange_geometry(FemModel* femmodel) {  /*{{{*/
+ 
+-	/*Geometry core where we compute indices into tables pre computed in the SealevelRiseAnalysis: */
++	/*Geometry core where we compute updates to the Green function kernels and weights, dependent 
++	 * on the evolution of levelsets: */
+ 
+ 	/*parameters: */
+-	bool spherical=true;
+-	IssmDouble *latitude  = NULL;
+-	IssmDouble *longitude = NULL;
+-	IssmDouble *radius    = NULL;
+-	IssmDouble *xx    = NULL;
+-	IssmDouble *yy    = NULL;
+-	IssmDouble *zz    = NULL;
+ 	IssmDouble *xxe    = NULL;
+ 	IssmDouble *yye    = NULL;
+ 	IssmDouble *zze    = NULL;
+ 	IssmDouble* areae  = NULL;
+ 
+-	int  horiz;
+-	bool geometrydone = false;
+-	int  optim;
++	int nel;
+ 	int  grdmodel=0;
++	SealevelGeometry* slgeom=NULL;
+ 
+-		
++	/*early return?:*/
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	if(grdmodel==IvinsEnum) return NULL;
++
+ 	/*retrieve parameters:*/
+-	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-	femmodel->parameters->FindParam(&geometrydone,SealevelchangeGeometryDoneEnum);
+-	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	femmodel->parameters->FindParam(&xxe,&nel,XxeEnum);
++	femmodel->parameters->FindParam(&yye,&nel,YyeEnum);
++	femmodel->parameters->FindParam(&zze,&nel,ZzeEnum);
++	femmodel->parameters->FindParam(&areae,&nel,AreaeEnum);
+ 	
+-	/*early return?:*/
+-	if(grdmodel==IvinsEnum) return;
+-
+-	if(geometrydone){
+-		if(VerboseSolution()) _printf0_("	  geometrical offsets have already been computed, skipping \n");
+-		return; //don't need to run this again.
++	/*initialize SealevelMasks structure: */
++	slgeom=new SealevelGeometry(femmodel->elements->Size());
++	
++	/*Verbose: */
++	if(VerboseSolution()) _printf0_("	  computing sea level geometrical kernel and weight updates.\n");
++	
++	
++	/*Run sealevel geometry routine for elements with full loading:*/
++	for(Object* & object : femmodel->elements->objects){
++		Element*   element=xDynamicCast<Element*>(object);
++		element->SealevelchangeGeometryCentroidLoads(slgeom,xxe,yye,zze,areae);
+ 	}
++	
++	/*Initialize fractional loading mapping: */
++	slgeom->InitializeMappingsAndBarycentres();
+ 
+-	/*Verbose: */
+-	if(VerboseSolution()) _printf0_("	  computing geometrical offsets into precomputed Green tables \n");
+-
+-	/*first, recover lat,long and radius vectors from vertices: */
+-	VertexCoordinatesx(&latitude,&longitude,&radius,femmodel->vertices,spherical); 
+-	if(horiz) VertexCoordinatesx(&xx,&yy,&zz,femmodel->vertices); 
+ 	
+-	/*first, recover x,y,z and areas from elements: */
+-	ElementCoordinatesx(&xxe,&yye,&zze,&areae,femmodel->elements);
+-
+-	/*Run sealevel geometry routine in elements:*/
++	/*Run sealevel geometry routine for elements with fractional loading:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		element->SealevelchangeGeometry(latitude,longitude,radius,xx,yy,zz,xxe,yye,zze,areae);
++		element->SealevelchangeGeometrySubElementLoads(slgeom,areae);
+ 	}
+ 
+-	/*Free ressources:*/
+-	if(horiz){
+-		xDelete<IssmDouble>(xx);
+-		xDelete<IssmDouble>(yy);
+-		xDelete<IssmDouble>(zz);
++	/*Assemble barycentres of fraction loading elements:*/
++	slgeom->Assemble();
++
++	/*Create fractional green function kernels: */
++	for(Object* & object : femmodel->elements->objects){
++		Element*   element=xDynamicCast<Element*>(object);
++		element->SealevelchangeGeometryFractionKernel(slgeom);
+ 	}
+-	xDelete<IssmDouble>(xxe);
+-	xDelete<IssmDouble>(yye);
+-	xDelete<IssmDouble>(zze);
+-	xDelete<IssmDouble>(areae);
+-	xDelete<IssmDouble>(latitude);
+-	xDelete<IssmDouble>(longitude);
+-	xDelete<IssmDouble>(radius);
+ 
+-	/*Record the fact that we ran this module already: */
+-	femmodel->parameters->SetParam(true,SealevelchangeGeometryDoneEnum); 
+ 
++	femmodel->parameters->AddObject(new DoubleVecParam(XxeEnum,xxe,nel));
++	femmodel->parameters->AddObject(new DoubleVecParam(YyeEnum,yye,nel));
++	femmodel->parameters->AddObject(new DoubleVecParam(ZzeEnum,zze,nel));
++	femmodel->parameters->AddObject(new DoubleVecParam(AreaeEnum,areae,nel));
+ 
++	return slgeom;
++
+ }/*}}}*/
+ 
+ /*Support routines:*/
+@@ -902,20 +959,29 @@
+ 	*pconverged=converged;
+ 
+ } /*}}}*/
+-IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* oceanareas, IssmDouble oceanarea){ /*{{{*/
++IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble oceanarea){ /*{{{*/
+ 
+ 	IssmDouble sealevelloadsaverage;	
++	IssmDouble subelementsealevelloadsaverage;	
+ 
+ 	Vector<IssmDouble>* sealevelloadsvolume=sealevelloads->Duplicate();
++	Vector<IssmDouble>* subelementsealevelloadsvolume=subelementsealevelloads->Duplicate();
++
+ 	sealevelloadsvolume->PointwiseMult(sealevelloads,oceanareas);
++	subelementsealevelloadsvolume->PointwiseMult(subelementsealevelloads,subelementoceanareas);
++	
+ 	sealevelloadsvolume->Sum(&sealevelloadsaverage);
++	subelementsealevelloadsvolume->Sum(&subelementsealevelloadsaverage);
+ 	delete sealevelloadsvolume; 
++	delete subelementsealevelloadsvolume; 
+ 	
+-	return sealevelloadsaverage/oceanarea;
++	//return (sealevelloadsaverage+subelementsealevelloadsaverage)/oceanarea;
++	return (sealevelloadsaverage)/oceanarea;
+ } /*}}}*/
+-void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* sealevelloads){ /*{{{*/
++void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	IssmDouble  moi_list[3]={0,0,0};
++	IssmDouble  moi_list_sub[3]={0,0,0};
+ 	IssmDouble  moi_list_cpu[3]={0,0,0};
+ 	IssmDouble*	tide_love_h  = NULL;
+ 	IssmDouble*	tide_love_k  = NULL;
+@@ -939,12 +1005,17 @@
+ 
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeMomentOfInertia(&moi_list[0],loads,sealevelloads);
+-		moi_list_cpu[0] += moi_list[0];
+-		moi_list_cpu[1] += moi_list[1];
+-		moi_list_cpu[2] += moi_list[2];
++
++		element->SealevelchangeMomentOfInertiaCentroid(&moi_list[0],loads,sealevelloads,slgeom);
++
++		element->SealevelchangeMomentOfInertiaSubElement(&moi_list_sub[0],subelementiceloads, subelementhydroloads, subelementbploads, subelementsealevelloads,slgeom);
++
++		moi_list_cpu[0] += moi_list[0]+moi_list_sub[0];
++		moi_list_cpu[1] += moi_list[1]+moi_list_sub[1];
++		moi_list_cpu[2] += moi_list[2]+moi_list_sub[2];
+ 	}
+ 
++
+ 	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+ 	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 	
+@@ -964,13 +1035,43 @@
+ 	m[1]=m2;
+ 	m[2]=m3;
+ } /*}}}*/
+-void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, IssmDouble offset, SealevelMasks* masks){ /*{{{*/
++void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*Shift sealevel loads by ocean average, only on ocean! :*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeShift(sealevelloads,offset,masks);
++		element->SealevelchangeShift(sealevelloads,subelementsealevelloads,offset,slgeom);
+ 	}
+ 	sealevelloads->Assemble();
++	subelementsealevelloads->Assemble();
+ 
+ } /*}}}*/
++IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel){ /*{{{*/
++
++	int* indices=xNew<int>(nel);
++	for(int i=0;i<nel;i++)indices[i]=i;
++	
++	Vector<IssmDouble>* vloadcopy=new Vector<IssmDouble>(nel);
++	IssmDouble* loadcopy=xNew<IssmDouble>(nel);
++	
++	vloadcopy->SetValues(nel,indices,load,INS_VAL);
++	vloadcopy->Assemble();
++
++
++	if(subload){
++		for (int i=0;i<femmodel->elements->Size();i++){
++			if (slgeom->issubelement[loadtype][i]){
++				int se= slgeom->subelementmapping[loadtype][i];
++				IssmDouble subloadi=subload[se];
++				Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
++				vloadcopy->SetValue(element->Sid(),subloadi,ADD_VAL);
++			}
++		}
++	}
++	vloadcopy->Assemble();
++	loadcopy=vloadcopy->ToMPISerial();
++
++	return loadcopy;
++
++} /*}}}*/
++
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26222)
+@@ -23,10 +23,10 @@
+ 
+ 	/*parameters: */
+ 	IssmDouble finaltime,dt,yts;
+-	bool       isoceancoupling,iscontrol,isautodiff;
++	bool       iscontrol,isautodiff;
+ 	int        timestepping;
+ 	int        output_frequency,checkpoint_frequency;
+-	int        amr_frequency,amr_restart;
++	int        amr_frequency;
+ 	char     **requested_outputs = NULL;
+ 
+ 	/*intermediary: */
+@@ -44,22 +44,13 @@
+ 	femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	femmodel->parameters->FindParam(&output_frequency,SettingsOutputFrequencyEnum);
+ 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
+-	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
+ 	femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
+ 	femmodel->parameters->FindParam(&iscontrol,InversionIscontrolEnum);
+ 	femmodel->parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
+ 
+-	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
+-	if(amr_frequency){
+-		femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum);
+-		if(amr_restart) femmodel->ReMesh();
+-	}
+-	#endif
++	/*call modules that are not dependent on time stepping:*/
++	transient_precore(femmodel);
+ 
+-	#if defined(_HAVE_OCEAN_ )
+-	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
+-	#endif
+-
+ 	while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
+ 
+ 		/*Time Increment*/
+@@ -252,7 +243,29 @@
+ 		for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);
+ 	}
+ }/*}}}*/
++void transient_precore(FemModel* femmodel){/*{{{*/
+ 
++	bool       isoceancoupling,isslc;
++	int        amr_frequency,amr_restart;
++
++	femmodel->parameters->FindParam(&isoceancoupling,TransientIsoceancouplingEnum);
++	femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
++	femmodel->parameters->FindParam(&isslc,TransientIsslcEnum);
++
++	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
++	if(amr_frequency){
++		femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum);
++		if(amr_restart) femmodel->ReMesh();
++	}
++	#endif
++
++	#if defined(_HAVE_OCEAN_ )
++	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
++	#endif
++
++	if(isslc) sealevelchange_initialgeometry(femmodel);
++}/*}}}*/
++
+ #ifdef _HAVE_CODIPACK_
+ void transient_ad(FemModel* femmodel){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26221)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26222)
+@@ -105,6 +105,7 @@
+ syn keyword cConstant CalvingMinthicknessEnum
+ syn keyword cConstant ConfigurationTypeEnum
+ syn keyword cConstant ConstantsGEnum
++syn keyword cConstant ConstantsNewtonGravityEnum
+ syn keyword cConstant ConstantsReferencetemperatureEnum
+ syn keyword cConstant ConstantsYtsEnum
+ syn keyword cConstant ControlInputSizeMEnum
+@@ -364,7 +365,6 @@
+ syn keyword cConstant SealevelchangeGElasticEnum
+ syn keyword cConstant SolidearthSettingsComputesealevelchangeEnum
+ syn keyword cConstant SolidearthSettingsGRDEnum
+-syn keyword cConstant SolidearthSettingsGlfractionEnum
+ syn keyword cConstant SolidearthSettingsRunFrequencyEnum
+ syn keyword cConstant SealevelchangeHElasticEnum
+ syn keyword cConstant SolidearthSettingsHorizEnum
+@@ -505,6 +505,10 @@
+ syn keyword cConstant TransientNumRequestedOutputsEnum
+ syn keyword cConstant TransientRequestedOutputsEnum
+ syn keyword cConstant VelocityEnum
++syn keyword cConstant XxeEnum
++syn keyword cConstant YyeEnum
++syn keyword cConstant ZzeEnum
++syn keyword cConstant AreaeEnum
+ syn keyword cConstant WorldCommEnum
+ syn keyword cConstant ParametersENDEnum
+ syn keyword cConstant InputsSTARTEnum
+@@ -744,7 +748,28 @@
+ syn keyword cConstant SealevelEnum
+ syn keyword cConstant SealevelGRDEnum
+ syn keyword cConstant SealevelBarystaticMaskEnum
++syn keyword cConstant SealevelBarystaticIceMaskEnum
++syn keyword cConstant SealevelBarystaticIceWeightsEnum
++syn keyword cConstant SealevelBarystaticIceAreaEnum
++syn keyword cConstant SealevelBarystaticIceLatbarEnum
++syn keyword cConstant SealevelBarystaticIceLongbarEnum
++syn keyword cConstant SealevelBarystaticIceLoadEnum
++syn keyword cConstant SealevelBarystaticHydroMaskEnum
++syn keyword cConstant SealevelBarystaticHydroWeightsEnum
++syn keyword cConstant SealevelBarystaticHydroAreaEnum
++syn keyword cConstant SealevelBarystaticHydroLatbarEnum
++syn keyword cConstant SealevelBarystaticHydroLongbarEnum
++syn keyword cConstant SealevelBarystaticHydroLoadEnum
++syn keyword cConstant SealevelBarystaticBpMaskEnum
++syn keyword cConstant SealevelBarystaticBpWeightsEnum
++syn keyword cConstant SealevelBarystaticBpAreaEnum
++syn keyword cConstant SealevelBarystaticBpLoadEnum
+ syn keyword cConstant SealevelBarystaticOceanMaskEnum
++syn keyword cConstant SealevelBarystaticOceanWeightsEnum
++syn keyword cConstant SealevelBarystaticOceanAreaEnum
++syn keyword cConstant SealevelBarystaticOceanLatbarEnum
++syn keyword cConstant SealevelBarystaticOceanLongbarEnum
++syn keyword cConstant SealevelBarystaticOceanLoadEnum
+ syn keyword cConstant SealevelNEsaEnum
+ syn keyword cConstant SealevelNEsaRateEnum
+ syn keyword cConstant SealevelRSLEnum
+@@ -768,6 +793,18 @@
+ syn keyword cConstant SealevelchangeGUEnum
+ syn keyword cConstant SealevelchangeGEEnum
+ syn keyword cConstant SealevelchangeGNEnum
++syn keyword cConstant SealevelchangeGsubelOceanEnum
++syn keyword cConstant SealevelchangeGUsubelOceanEnum
++syn keyword cConstant SealevelchangeGEsubelOceanEnum
++syn keyword cConstant SealevelchangeGNsubelOceanEnum
++syn keyword cConstant SealevelchangeGsubelIceEnum
++syn keyword cConstant SealevelchangeGUsubelIceEnum
++syn keyword cConstant SealevelchangeGEsubelIceEnum
++syn keyword cConstant SealevelchangeGNsubelIceEnum
++syn keyword cConstant SealevelchangeGsubelHydroEnum
++syn keyword cConstant SealevelchangeGUsubelHydroEnum
++syn keyword cConstant SealevelchangeGEsubelHydroEnum
++syn keyword cConstant SealevelchangeGNsubelHydroEnum
+ syn keyword cConstant SedimentHeadEnum
+ syn keyword cConstant SedimentHeadOldEnum
+ syn keyword cConstant SedimentHeadSubstepEnum
+@@ -1539,7 +1576,7 @@
+ syn keyword cType Results
+ syn keyword cType RiftStruct
+ syn keyword cType Riftfront
+-syn keyword cType SealevelMasks
++syn keyword cType SealevelGeometry
+ syn keyword cType Seg
+ syn keyword cType SegInput
+ syn keyword cType SegRef
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26221)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26222)
+@@ -99,6 +99,7 @@
+ 	CalvingMinthicknessEnum,
+ 	ConfigurationTypeEnum,
+ 	ConstantsGEnum,
++	ConstantsNewtonGravityEnum,
+ 	ConstantsReferencetemperatureEnum,
+ 	ConstantsYtsEnum,
+ 	ControlInputSizeMEnum,
+@@ -358,7 +359,6 @@
+ 	SealevelchangeGElasticEnum,
+ 	SolidearthSettingsComputesealevelchangeEnum,
+ 	SolidearthSettingsGRDEnum,
+-	SolidearthSettingsGlfractionEnum,
+ 	SolidearthSettingsRunFrequencyEnum,
+ 	SealevelchangeHElasticEnum,
+ 	SolidearthSettingsHorizEnum,
+@@ -499,6 +499,10 @@
+ 	TransientNumRequestedOutputsEnum,
+ 	TransientRequestedOutputsEnum,
+ 	VelocityEnum,
++	XxeEnum,
++	YyeEnum,
++	ZzeEnum,
++	AreaeEnum,
+ 	WorldCommEnum,
+ 	/*}}}*/
+ 	ParametersENDEnum,
+@@ -740,7 +744,28 @@
+ 	SealevelEnum,
+ 	SealevelGRDEnum,
+ 	SealevelBarystaticMaskEnum,
++	SealevelBarystaticIceMaskEnum,
++	SealevelBarystaticIceWeightsEnum,
++	SealevelBarystaticIceAreaEnum,
++	SealevelBarystaticIceLatbarEnum,
++	SealevelBarystaticIceLongbarEnum,
++	SealevelBarystaticIceLoadEnum,
++	SealevelBarystaticHydroMaskEnum,
++	SealevelBarystaticHydroWeightsEnum,
++	SealevelBarystaticHydroAreaEnum,
++	SealevelBarystaticHydroLatbarEnum,
++	SealevelBarystaticHydroLongbarEnum,
++	SealevelBarystaticHydroLoadEnum,
++	SealevelBarystaticBpMaskEnum,
++	SealevelBarystaticBpWeightsEnum,
++	SealevelBarystaticBpAreaEnum,
++	SealevelBarystaticBpLoadEnum,
+ 	SealevelBarystaticOceanMaskEnum,
++	SealevelBarystaticOceanWeightsEnum,
++	SealevelBarystaticOceanAreaEnum,
++	SealevelBarystaticOceanLatbarEnum,
++	SealevelBarystaticOceanLongbarEnum,
++	SealevelBarystaticOceanLoadEnum,
+ 	SealevelNEsaEnum,
+ 	SealevelNEsaRateEnum,
+ 	SealevelRSLEnum,
+@@ -764,6 +789,18 @@
+ 	SealevelchangeGUEnum,
+ 	SealevelchangeGEEnum,
+ 	SealevelchangeGNEnum,
++	SealevelchangeGsubelOceanEnum,
++	SealevelchangeGUsubelOceanEnum,
++	SealevelchangeGEsubelOceanEnum,
++	SealevelchangeGNsubelOceanEnum,
++	SealevelchangeGsubelIceEnum,
++	SealevelchangeGUsubelIceEnum,
++	SealevelchangeGEsubelIceEnum,
++	SealevelchangeGNsubelIceEnum,
++	SealevelchangeGsubelHydroEnum,
++	SealevelchangeGUsubelHydroEnum,
++	SealevelchangeGEsubelHydroEnum,
++	SealevelchangeGNsubelHydroEnum,
+ 	SedimentHeadEnum,
+ 	SedimentHeadOldEnum,
+ 	SedimentHeadSubstepEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26222)
+@@ -107,6 +107,7 @@
+ 		case CalvingMinthicknessEnum : return "CalvingMinthickness";
+ 		case ConfigurationTypeEnum : return "ConfigurationType";
+ 		case ConstantsGEnum : return "ConstantsG";
++		case ConstantsNewtonGravityEnum : return "ConstantsNewtonGravity";
+ 		case ConstantsReferencetemperatureEnum : return "ConstantsReferencetemperature";
+ 		case ConstantsYtsEnum : return "ConstantsYts";
+ 		case ControlInputSizeMEnum : return "ControlInputSizeM";
+@@ -366,7 +367,6 @@
+ 		case SealevelchangeGElasticEnum : return "SealevelchangeGElastic";
+ 		case SolidearthSettingsComputesealevelchangeEnum : return "SolidearthSettingsComputesealevelchange";
+ 		case SolidearthSettingsGRDEnum : return "SolidearthSettingsGRD";
+-		case SolidearthSettingsGlfractionEnum : return "SolidearthSettingsGlfraction";
+ 		case SolidearthSettingsRunFrequencyEnum : return "SolidearthSettingsRunFrequency";
+ 		case SealevelchangeHElasticEnum : return "SealevelchangeHElastic";
+ 		case SolidearthSettingsHorizEnum : return "SolidearthSettingsHoriz";
+@@ -507,6 +507,10 @@
+ 		case TransientNumRequestedOutputsEnum : return "TransientNumRequestedOutputs";
+ 		case TransientRequestedOutputsEnum : return "TransientRequestedOutputs";
+ 		case VelocityEnum : return "Velocity";
++		case XxeEnum : return "Xxe";
++		case YyeEnum : return "Yye";
++		case ZzeEnum : return "Zze";
++		case AreaeEnum : return "Areae";
+ 		case WorldCommEnum : return "WorldComm";
+ 		case ParametersENDEnum : return "ParametersEND";
+ 		case InputsSTARTEnum : return "InputsSTART";
+@@ -746,7 +750,28 @@
+ 		case SealevelEnum : return "Sealevel";
+ 		case SealevelGRDEnum : return "SealevelGRD";
+ 		case SealevelBarystaticMaskEnum : return "SealevelBarystaticMask";
++		case SealevelBarystaticIceMaskEnum : return "SealevelBarystaticIceMask";
++		case SealevelBarystaticIceWeightsEnum : return "SealevelBarystaticIceWeights";
++		case SealevelBarystaticIceAreaEnum : return "SealevelBarystaticIceArea";
++		case SealevelBarystaticIceLatbarEnum : return "SealevelBarystaticIceLatbar";
++		case SealevelBarystaticIceLongbarEnum : return "SealevelBarystaticIceLongbar";
++		case SealevelBarystaticIceLoadEnum : return "SealevelBarystaticIceLoad";
++		case SealevelBarystaticHydroMaskEnum : return "SealevelBarystaticHydroMask";
++		case SealevelBarystaticHydroWeightsEnum : return "SealevelBarystaticHydroWeights";
++		case SealevelBarystaticHydroAreaEnum : return "SealevelBarystaticHydroArea";
++		case SealevelBarystaticHydroLatbarEnum : return "SealevelBarystaticHydroLatbar";
++		case SealevelBarystaticHydroLongbarEnum : return "SealevelBarystaticHydroLongbar";
++		case SealevelBarystaticHydroLoadEnum : return "SealevelBarystaticHydroLoad";
++		case SealevelBarystaticBpMaskEnum : return "SealevelBarystaticBpMask";
++		case SealevelBarystaticBpWeightsEnum : return "SealevelBarystaticBpWeights";
++		case SealevelBarystaticBpAreaEnum : return "SealevelBarystaticBpArea";
++		case SealevelBarystaticBpLoadEnum : return "SealevelBarystaticBpLoad";
+ 		case SealevelBarystaticOceanMaskEnum : return "SealevelBarystaticOceanMask";
++		case SealevelBarystaticOceanWeightsEnum : return "SealevelBarystaticOceanWeights";
++		case SealevelBarystaticOceanAreaEnum : return "SealevelBarystaticOceanArea";
++		case SealevelBarystaticOceanLatbarEnum : return "SealevelBarystaticOceanLatbar";
++		case SealevelBarystaticOceanLongbarEnum : return "SealevelBarystaticOceanLongbar";
++		case SealevelBarystaticOceanLoadEnum : return "SealevelBarystaticOceanLoad";
+ 		case SealevelNEsaEnum : return "SealevelNEsa";
+ 		case SealevelNEsaRateEnum : return "SealevelNEsaRate";
+ 		case SealevelRSLEnum : return "SealevelRSL";
+@@ -770,6 +795,18 @@
+ 		case SealevelchangeGUEnum : return "SealevelchangeGU";
+ 		case SealevelchangeGEEnum : return "SealevelchangeGE";
+ 		case SealevelchangeGNEnum : return "SealevelchangeGN";
++		case SealevelchangeGsubelOceanEnum : return "SealevelchangeGsubelOcean";
++		case SealevelchangeGUsubelOceanEnum : return "SealevelchangeGUsubelOcean";
++		case SealevelchangeGEsubelOceanEnum : return "SealevelchangeGEsubelOcean";
++		case SealevelchangeGNsubelOceanEnum : return "SealevelchangeGNsubelOcean";
++		case SealevelchangeGsubelIceEnum : return "SealevelchangeGsubelIce";
++		case SealevelchangeGUsubelIceEnum : return "SealevelchangeGUsubelIce";
++		case SealevelchangeGEsubelIceEnum : return "SealevelchangeGEsubelIce";
++		case SealevelchangeGNsubelIceEnum : return "SealevelchangeGNsubelIce";
++		case SealevelchangeGsubelHydroEnum : return "SealevelchangeGsubelHydro";
++		case SealevelchangeGUsubelHydroEnum : return "SealevelchangeGUsubelHydro";
++		case SealevelchangeGEsubelHydroEnum : return "SealevelchangeGEsubelHydro";
++		case SealevelchangeGNsubelHydroEnum : return "SealevelchangeGNsubelHydro";
+ 		case SedimentHeadEnum : return "SedimentHead";
+ 		case SedimentHeadOldEnum : return "SedimentHeadOld";
+ 		case SedimentHeadSubstepEnum : return "SedimentHeadSubstep";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26221)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26222)
+@@ -107,6 +107,7 @@
+ 	      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,"ConstantsNewtonGravity")==0) return ConstantsNewtonGravityEnum;
+ 	      else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
+ 	      else if (strcmp(name,"ConstantsYts")==0) return ConstantsYtsEnum;
+ 	      else if (strcmp(name,"ControlInputSizeM")==0) return ControlInputSizeMEnum;
+@@ -135,11 +136,11 @@
+ 	      else if (strcmp(name,"DamageMaxDamage")==0) return DamageMaxDamageEnum;
+ 	      else if (strcmp(name,"DamageStabilization")==0) return DamageStabilizationEnum;
+ 	      else if (strcmp(name,"DamageStressThreshold")==0) return DamageStressThresholdEnum;
+-	      else if (strcmp(name,"DamageStressUBound")==0) return DamageStressUBoundEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
++	      if (strcmp(name,"DamageStressUBound")==0) return DamageStressUBoundEnum;
++	      else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
+ 	      else if (strcmp(name,"DomainDimension")==0) return DomainDimensionEnum;
+ 	      else if (strcmp(name,"DomainType")==0) return DomainTypeEnum;
+ 	      else if (strcmp(name,"DslModel")==0) return DslModelEnum;
+@@ -258,11 +259,11 @@
+ 	      else if (strcmp(name,"LevelsetReinitFrequency")==0) return LevelsetReinitFrequencyEnum;
+ 	      else if (strcmp(name,"LevelsetStabilization")==0) return LevelsetStabilizationEnum;
+ 	      else if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
+-	      else if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
++	      if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
++	      else if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
+ 	      else if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
+ 	      else if (strcmp(name,"LoveG0")==0) return LoveG0Enum;
+ 	      else if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
+@@ -372,7 +373,6 @@
+ 	      else if (strcmp(name,"SealevelchangeGElastic")==0) return SealevelchangeGElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsGRD")==0) return SolidearthSettingsGRDEnum;
+-	      else if (strcmp(name,"SolidearthSettingsGlfraction")==0) return SolidearthSettingsGlfractionEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRunFrequency")==0) return SolidearthSettingsRunFrequencyEnum;
+ 	      else if (strcmp(name,"SealevelchangeHElastic")==0) return SealevelchangeHElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsHoriz")==0) return SolidearthSettingsHorizEnum;
+@@ -519,6 +519,10 @@
+ 	      else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
+ 	      else if (strcmp(name,"Velocity")==0) return VelocityEnum;
++	      else if (strcmp(name,"Xxe")==0) return XxeEnum;
++	      else if (strcmp(name,"Yye")==0) return YyeEnum;
++	      else if (strcmp(name,"Zze")==0) return ZzeEnum;
++	      else if (strcmp(name,"Areae")==0) return AreaeEnum;
+ 	      else if (strcmp(name,"WorldComm")==0) return WorldCommEnum;
+ 	      else if (strcmp(name,"ParametersEND")==0) return ParametersENDEnum;
+ 	      else if (strcmp(name,"InputsSTART")==0) return InputsSTARTEnum;
+@@ -624,14 +628,14 @@
+ 	      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 stage=6;
++   }
++   if(stage==6){
++	      if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+ 	      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 stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"EplHeadSlopeY")==0) return EplHeadSlopeYEnum;
++	      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,"EsaEmotion")==0) return EsaEmotionEnum;
+@@ -747,14 +751,14 @@
+ 	      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 stage=7;
++   }
++   if(stage==7){
++	      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 stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"RheologyBAbsGradient")==0) return RheologyBAbsGradientEnum;
++	      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;
+@@ -764,7 +768,28 @@
+ 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
+ 	      else if (strcmp(name,"SealevelGRD")==0) return SealevelGRDEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticMask")==0) return SealevelBarystaticMaskEnum;
++	      else if (strcmp(name,"SealevelBarystaticIceMask")==0) return SealevelBarystaticIceMaskEnum;
++	      else if (strcmp(name,"SealevelBarystaticIceWeights")==0) return SealevelBarystaticIceWeightsEnum;
++	      else if (strcmp(name,"SealevelBarystaticIceArea")==0) return SealevelBarystaticIceAreaEnum;
++	      else if (strcmp(name,"SealevelBarystaticIceLatbar")==0) return SealevelBarystaticIceLatbarEnum;
++	      else if (strcmp(name,"SealevelBarystaticIceLongbar")==0) return SealevelBarystaticIceLongbarEnum;
++	      else if (strcmp(name,"SealevelBarystaticIceLoad")==0) return SealevelBarystaticIceLoadEnum;
++	      else if (strcmp(name,"SealevelBarystaticHydroMask")==0) return SealevelBarystaticHydroMaskEnum;
++	      else if (strcmp(name,"SealevelBarystaticHydroWeights")==0) return SealevelBarystaticHydroWeightsEnum;
++	      else if (strcmp(name,"SealevelBarystaticHydroArea")==0) return SealevelBarystaticHydroAreaEnum;
++	      else if (strcmp(name,"SealevelBarystaticHydroLatbar")==0) return SealevelBarystaticHydroLatbarEnum;
++	      else if (strcmp(name,"SealevelBarystaticHydroLongbar")==0) return SealevelBarystaticHydroLongbarEnum;
++	      else if (strcmp(name,"SealevelBarystaticHydroLoad")==0) return SealevelBarystaticHydroLoadEnum;
++	      else if (strcmp(name,"SealevelBarystaticBpMask")==0) return SealevelBarystaticBpMaskEnum;
++	      else if (strcmp(name,"SealevelBarystaticBpWeights")==0) return SealevelBarystaticBpWeightsEnum;
++	      else if (strcmp(name,"SealevelBarystaticBpArea")==0) return SealevelBarystaticBpAreaEnum;
++	      else if (strcmp(name,"SealevelBarystaticBpLoad")==0) return SealevelBarystaticBpLoadEnum;
+ 	      else if (strcmp(name,"SealevelBarystaticOceanMask")==0) return SealevelBarystaticOceanMaskEnum;
++	      else if (strcmp(name,"SealevelBarystaticOceanWeights")==0) return SealevelBarystaticOceanWeightsEnum;
++	      else if (strcmp(name,"SealevelBarystaticOceanArea")==0) return SealevelBarystaticOceanAreaEnum;
++	      else if (strcmp(name,"SealevelBarystaticOceanLatbar")==0) return SealevelBarystaticOceanLatbarEnum;
++	      else if (strcmp(name,"SealevelBarystaticOceanLongbar")==0) return SealevelBarystaticOceanLongbarEnum;
++	      else if (strcmp(name,"SealevelBarystaticOceanLoad")==0) return SealevelBarystaticOceanLoadEnum;
+ 	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
+ 	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
+ 	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
+@@ -788,6 +813,18 @@
+ 	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+ 	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+ 	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
++	      else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
++	      else if (strcmp(name,"SealevelchangeGUsubelOcean")==0) return SealevelchangeGUsubelOceanEnum;
++	      else if (strcmp(name,"SealevelchangeGEsubelOcean")==0) return SealevelchangeGEsubelOceanEnum;
++	      else if (strcmp(name,"SealevelchangeGNsubelOcean")==0) return SealevelchangeGNsubelOceanEnum;
++	      else if (strcmp(name,"SealevelchangeGsubelIce")==0) return SealevelchangeGsubelIceEnum;
++	      else if (strcmp(name,"SealevelchangeGUsubelIce")==0) return SealevelchangeGUsubelIceEnum;
++	      else if (strcmp(name,"SealevelchangeGEsubelIce")==0) return SealevelchangeGEsubelIceEnum;
++	      else if (strcmp(name,"SealevelchangeGNsubelIce")==0) return SealevelchangeGNsubelIceEnum;
++	      else if (strcmp(name,"SealevelchangeGsubelHydro")==0) return SealevelchangeGsubelHydroEnum;
++	      else if (strcmp(name,"SealevelchangeGUsubelHydro")==0) return SealevelchangeGUsubelHydroEnum;
++	      else if (strcmp(name,"SealevelchangeGEsubelHydro")==0) return SealevelchangeGEsubelHydroEnum;
++	      else if (strcmp(name,"SealevelchangeGNsubelHydro")==0) return SealevelchangeGNsubelHydroEnum;
+ 	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
+ 	      else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
+ 	      else if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum;
+@@ -837,7 +874,10 @@
+ 	      else if (strcmp(name,"SmbEAir")==0) return SmbEAirEnum;
+ 	      else if (strcmp(name,"SmbEC")==0) return SmbECEnum;
+ 	      else if (strcmp(name,"SmbECDt")==0) return SmbECDtEnum;
+-	      else if (strcmp(name,"SmbECini")==0) return SmbECiniEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SmbECini")==0) return SmbECiniEnum;
+ 	      else if (strcmp(name,"SmbEla")==0) return SmbElaEnum;
+ 	      else if (strcmp(name,"SmbEvaporation")==0) return SmbEvaporationEnum;
+ 	      else if (strcmp(name,"SmbFAC")==0) return SmbFACEnum;
+@@ -874,10 +914,7 @@
+ 	      else if (strcmp(name,"SmbRunoff")==0) return SmbRunoffEnum;
+ 	      else if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+ 	      else if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbS0gcm")==0) return SmbS0gcmEnum;
++	      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;
+@@ -960,7 +997,10 @@
+ 	      else if (strcmp(name,"Vx")==0) return VxEnum;
+ 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VxObs")==0) return VxObsEnum;
+-	      else if (strcmp(name,"VxShear")==0) return VxShearEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"VxShear")==0) return VxShearEnum;
+ 	      else if (strcmp(name,"VxSurface")==0) return VxSurfaceEnum;
+ 	      else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
+ 	      else if (strcmp(name,"VyBase")==0) return VyBaseEnum;
+@@ -997,10 +1037,7 @@
+ 	      else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum;
+ 	      else if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
+ 	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
++	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+@@ -1083,7 +1120,10 @@
+ 	      else if (strcmp(name,"Outputdefinition95")==0) return Outputdefinition95Enum;
+ 	      else if (strcmp(name,"Outputdefinition96")==0) return Outputdefinition96Enum;
+ 	      else if (strcmp(name,"Outputdefinition97")==0) return Outputdefinition97Enum;
+-	      else if (strcmp(name,"Outputdefinition98")==0) return Outputdefinition98Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition98")==0) return Outputdefinition98Enum;
+ 	      else if (strcmp(name,"Outputdefinition99")==0) return Outputdefinition99Enum;
+ 	      else if (strcmp(name,"Outputdefinition9")==0) return Outputdefinition9Enum;
+ 	      else if (strcmp(name,"Outputdefinition100")==0) return Outputdefinition100Enum;
+@@ -1120,10 +1160,7 @@
+ 	      else if (strcmp(name,"Boundary")==0) return BoundaryEnum;
+ 	      else if (strcmp(name,"BuddJacka")==0) return BuddJackaEnum;
+ 	      else if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"CalvingHab")==0) return CalvingHabEnum;
++	      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;
+@@ -1206,7 +1243,10 @@
+ 	      else if (strcmp(name,"GenericExternalResult")==0) return GenericExternalResultEnum;
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
+ 	      else if (strcmp(name,"Gradient4")==0) return Gradient4Enum;
+ 	      else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum;
+ 	      else if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum;
+@@ -1243,10 +1283,7 @@
+ 	      else if (strcmp(name,"ElementInput")==0) return ElementInputEnum;
+ 	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
+ 	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+-         else stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"IntParam")==0) return IntParamEnum;
++	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
+ 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+ 	      else if (strcmp(name,"Inputs")==0) return InputsEnum;
+ 	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+@@ -1329,7 +1366,10 @@
+ 	      else if (strcmp(name,"OceantransportAnalysis")==0) return OceantransportAnalysisEnum;
+ 	      else if (strcmp(name,"OceantransportSolution")==0) return OceantransportSolutionEnum;
+ 	      else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
+-	      else if (strcmp(name,"OneLayerP4z")==0) return OneLayerP4zEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      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,"Param")==0) return ParamEnum;
+@@ -1366,10 +1406,7 @@
+ 	      else if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
+ 	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
+ 	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+-         else stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
++	      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;
+@@ -1452,7 +1489,10 @@
+ 	      else if (strcmp(name,"VertexPId")==0) return VertexPIdEnum;
+ 	      else if (strcmp(name,"VertexSId")==0) return VertexSIdEnum;
+ 	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+-	      else if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
++         else stage=13;
++   }
++   if(stage==13){
++	      if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
+ 	      else if (strcmp(name,"Water")==0) return WaterEnum;
+ 	      else if (strcmp(name,"XTaylorHood")==0) return XTaylorHoodEnum;
+ 	      else if (strcmp(name,"XY")==0) return XYEnum;
+@@ -1475,7 +1515,7 @@
+ 	      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=13;
++         else stage=14;
+    }
+ 	/*If we reach this point, the string provided has not been found*/
+ 	if(notfounderror)
+Index: ../trunk-jpl/src/m/classes/constants.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/constants.m	(revision 26221)
++++ ../trunk-jpl/src/m/classes/constants.m	(revision 26222)
+@@ -9,6 +9,7 @@
+ 		omega                = 0.;
+ 		yts                  = 0.;
+ 		referencetemperature = 0.;
++		gravitational_constant = 0.;
+ 	end
+ 	methods
+ 		function self = constants(varargin) % {{{
+@@ -32,6 +33,9 @@
+ 
+ 			%the reference temperature for enthalpy model (cf Aschwanden)
+ 			self.referencetemperature=223.15;
++		
++			%gravity: 
++			self.gravitational_constant = 6.67259e-11;
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -40,6 +44,7 @@
+ 			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]);
++			md = checkfield(md,'fieldname','constants.gravitational_constant','size',[1 1]);
+ 
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -49,6 +54,7 @@
+ 			fielddisplay(self,'omega','angular velocity of Earth [rad/s]');
+ 			fielddisplay(self,'yts','number of seconds in a year [s/yr]');
+ 			fielddisplay(self,'referencetemperature','reference temperature used in the enthalpy model [K]');
++			fielddisplay(self,'gravitational_constant','Newtonian constant of gravitation [m^3/kg/s^2]');
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -55,6 +61,7 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','g','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','yts','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','referencetemperature','format','Double');
++			WriteData(fid,prefix,'object',self,'fieldname','gravitational_constant','format','Double');
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+@@ -62,6 +69,7 @@
+ 			writejsdouble(fid,[modelname '.constants.omega'],self.omega);
+ 			writejsdouble(fid,[modelname '.constants.yts'],self.yts);
+ 			writejsdouble(fid,[modelname '.constants.referencetemperature'],self.referencetemperature);
++			writejsdouble(fid,[modelname '.constants.gravitational_constant'],self.gravitational_constant);
+ 
+ 		end % }}}
+ 	end
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26221)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26222)
+@@ -18,7 +18,6 @@
+ 		compute_bp_grd         = 1; %will GRD patterns for bottom pressures be computed? 
+ 		degacc                 = 0; %degree increment for resolution of Green tables
+ 		horiz                  = 0; %compute horizontal deformation
+-		glfraction             = 1; %barystatic contribution full or fractional (default fractional)
+ 		grdmodel               = 0; %grd model (0 by default, 1 for elastic, 2 for Ivins)
+ 		cross_section_shape    = 0; %cross section only used when grd model is Ivins
+ 	end
+@@ -55,9 +54,6 @@
+ 		%how many time steps we skip before we run solidearthsettings solver during transient
+ 		self.runfrequency=1;
+ 		
+-		%fractional contribution: 
+-		self.glfraction=1;
+-	
+ 		%horizontal displacement?  (not by default)
+ 		self.horiz=0;
+ 		
+@@ -79,7 +75,6 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.runfrequency','size',[1 1],'>=',1);
+ 			md = checkfield(md,'fieldname','solidearth.settings.degacc','size',[1 1],'>=',1e-10);
+ 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
+-			md = checkfield(md,'fieldname','solidearth.settings.glfraction','values',[0 1]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','values',[1 2]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
+ 
+@@ -122,7 +117,6 @@
+ 			fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
+ 			fielddisplay(self,'rotation','earth rotational potential perturbation');
+ 			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+-			fielddisplay(self,'glfraction','contribute fractionally (default, 1) to barystatic sea level');
+ 			fielddisplay(self,'grdmodel','type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins');
+ 			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
+ 		end % }}}
+@@ -140,7 +134,6 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','computesealevelchange','name','md.solidearth.settings.computesealevelchange','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isgrd','name','md.solidearth.settings.isgrd','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','compute_bp_grd','name','md.solidearth.settings.compute_bp_grd','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','glfraction','name','md.solidearth.settings.glfraction','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','name','md.solidearth.settings.cross_section_shape','format','Integer');
+ 		end % }}}
+@@ -155,7 +148,6 @@
+ 			writejsdouble(fid,[modelname '.solidearth.settings.ocean_area_scaling'],self.ocean_area_scaling);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.run_frequency'],self.run_frequency);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
+-			writejsdouble(fid,[modelname '.solidearth.settings.glfraction'],self.glfraction);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+Index: ../trunk-jpl/test/Archives/Archive2002.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2011.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive2011.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26221)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26222)
+@@ -19,13 +19,18 @@
+ md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ %antarctica
+-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
++
++late=asind(ze./re);
++longe=atan2d(ye,xe);
+ pos=find(late < -80);
+ md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+ posant=pos;
+ %greenland
+-pos=find(late>70 & late<80 & longe>-60 & longe<-30);
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+ md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+ posgre=pos;
+ 
+@@ -51,7 +56,6 @@
+ md.timestepping.time_step=1;
+ md.timestepping.final_time=1;
+ 
+-
+ md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+@@ -92,6 +96,7 @@
+ md.solidearth.settings.rigid=0;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
++
+ md=solve(md,'Transient');
+ Seustatic=md.results.TransientSolution.Sealevel;
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2011.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2011.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test2011.m	(revision 26222)
+@@ -0,0 +1,115 @@
++%Test Name: EarthSlc
++
++%mesh earth:
++md=model;
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500.); %700 km resolution mesh
++
++%Geometry for the bed, arbitrary thickness of 1000: 
++md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++
++%parameterize solidearth solution:
++%solidearth loading:  {{{
++md.masstransport.spcthickness=[md.geometry.thickness;0];
++md.dsl.global_average_thermosteric_sea_level=[0;0];
++md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
++%antarctica
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
++
++late=asind(ze./re);
++longe=atan2d(ye,xe);
++pos=find(late < -80);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posant=pos;
++%greenland
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posgre=pos;
++
++%elastic loading from love numbers:
++md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
++
++%}}}
++%mask:  {{{
++mask=gmtmask(md.mesh.lat,md.mesh.long);
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1;
++
++icemask=ones(md.mesh.numberofvertices,1);
++icemask(md.mesh.elements(posant))=-1;
++icemask(md.mesh.elements(posgre))=-1;
++
++md.mask.ice_levelset=icemask;
++md.mask.ocean_levelset=oceanmask;
++% }}}
++
++%time stepping: 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=1;
++
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
++md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
++
++%Materials: 
++md.materials=materials('hydro');
++
++%Miscellaneous
++md.miscellaneous.name='test2002';
++
++%Solution parameters
++md.cluster.np=3;
++md.solidearth.settings.reltol=NaN;
++md.solidearth.settings.abstol=1e-3;
++md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
++
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel','DeltaIceThickness','SealevelBarystaticIceMask','SealevelBarystaticHydroMask','SealevelBarystaticBpMask','Bed','SealevelBarystaticIceWeights','SealevelBarystaticOceanWeights','SealevelBarystaticIceArea','SealevelBarystaticOceanArea','SealevelBarystaticOceanMask','SealevelGRD','SealevelBarystaticOceanLongbar'};
++md.settings.results_on_nodes={'SealevelBarystaticIceWeights','SealevelBarystaticOceanWeights'};
++
++% max number of iteration reverted back to 10 (i.e., the original default value)
++md.solidearth.settings.maxiter=10;
++
++%eustatic + rigid + elastic + rotation run:
++md.solidearth.settings.rigid=1;
++md.solidearth.settings.elastic=1;
++md.solidearth.settings.rotation=1;
++md=solve(md,'tr');
++
++%recover barystatic: 
++bslc=md.results.TransientSolution(1).BslcIce; 
++
++%alternative way of computing barystatic: 
++area=md.results.TransientSolution(1).SealevelBarystaticIceArea;
++weights=md.results.TransientSolution(1).SealevelBarystaticIceWeights; 
++dH=md.results.TransientSolution(1).DeltaIceThickness(md.mesh.elements); 
++dHavg=sum(dH.*weights);
++oceanarea=sum(md.results.TransientSolution(1).SealevelBarystaticOceanArea);
++bslc2=-sum(dHavg.*area)*md.materials.rho_ice/md.materials.rho_water/oceanarea;
++
++%Fields and tolerances to track changes
++field_names={'BarystaticIce','BarystaticIce2','BarystaticIceDiff'};
++field_tolerances={1e-13,1e-13,1e-13};
++field_values={bslc,bslc2,bslc2-bslc2};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26222-26223.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26222-26223.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26222-26223.diff	(revision 26740)
@@ -0,0 +1,126 @@
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26222)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26223)
+@@ -808,6 +808,11 @@
+ 	delete gauss;
+ 	return Me;
+ }/*}}}*/
++ElementVector* DamageEvolutionAnalysis::CreateFctPVector(Element* element){/*{{{*/
++
++	return this->CreatePVector(element);
++
++}/*}}}*/
+ void           DamageEvolutionAnalysis::FctKMatrix(Matrix<IssmDouble>** pKff,Matrix<IssmDouble>** pKfs,FemModel* femmodel){/*{{{*/
+ 
+ 	/*Output*/
+@@ -836,6 +841,26 @@
+ 		delete Kfs;
+ 	}
+ }/*}}}*/
++void           DamageEvolutionAnalysis::FctPVector(Vector<IssmDouble>** ppf,FemModel* femmodel){/*{{{*/
++
++	/*Output*/
++	Vector<IssmDouble>* pf = NULL;
++
++	/*Initialize P vector*/
++	AllocateSystemMatricesx(NULL,NULL,NULL,&pf,femmodel);
++
++	/*Create and assemble matrix*/
++	for(Object* & object : femmodel->elements->objects){
++		Element*       element = xDynamicCast<Element*>(object);
++		ElementVector* pe      = this->CreateFctPVector(element);
++		if(pe) pe->AddToGlobal(pf);
++		delete pe;
++	}
++	pf->Assemble();
++
++	/*Assign output pointer*/
++	*ppf=pf;
++}/*}}}*/
+ void           DamageEvolutionAnalysis::MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel){/*{{{*/
+ 
+ 	/*Initialize Mass matrix*/
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 26222)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 26223)
+@@ -38,7 +38,9 @@
+ 		/*FCT*/
+ 		ElementMatrix* CreateFctKMatrix(Element* element);
+ 		ElementMatrix* CreateMassMatrix(Element* element);
++		ElementVector* CreateFctPVector(Element* element);
+ 		void           FctKMatrix(Matrix<IssmDouble>** pKff,Matrix<IssmDouble>** pKfs,FemModel* femmodel);
+ 		void           MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel);
++		void				FctPVector(Vector<IssmDouble>** ppf,FemModel* femmodel);
+ };
+ #endif
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp	(revision 26222)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp	(revision 26223)
+@@ -417,6 +417,7 @@
+ 			danalysis = new DamageEvolutionAnalysis();
+ 			danalysis->MassMatrix(&Mc,femmodel);
+ 			danalysis->FctKMatrix(&K,NULL,femmodel);
++			danalysis->FctPVector(&p,femmodel);
+ 			break;
+ 		default: _error_("analysis type " << EnumToStringx(analysis_type) << " not supported for FCT\n");
+ 	}
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26222)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26223)
+@@ -1815,7 +1815,7 @@
+ 		total_weight+=gauss->weight;
+ 	}
+ 	//normalize to phi. 
+-	if(total_weight)for(int i=0;i<NUMVERTICES;i++)weights[i]/=total_weight/phi; 
++	if(total_weight>0.) for(int i=0;i<NUMVERTICES;i++)weights[i]/=total_weight/phi; 
+ 	else for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
+ 
+ 	/*free ressources:*/
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26222)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26223)
+@@ -19,7 +19,7 @@
+ SealevelGeometry::SealevelGeometry(int localnelin){ /*{{{*/
+ 	localnel=localnelin;
+ 	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+-		for (int j=0;j<MAXVERTICES;j++){
++		for (int j=0;j<SLMAXVERTICES;j++){
+ 			LoadWeigths[i][j]=xNewZeroInit<IssmDouble>(localnel);
+ 		}
+ 		vlatbarycentre[i]=NULL; //we don't know yet 
+@@ -42,7 +42,7 @@
+ }; /*}}}*/
+ SealevelGeometry::~SealevelGeometry(){ /*{{{*/
+ 	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+-		for (int j=0;j<MAXVERTICES;j++){
++		for (int j=0;j<SLMAXVERTICES;j++){
+ 			xDelete<IssmDouble>(LoadWeigths[i][j]);
+ 		}
+ 		xDelete<IssmDouble>(LoadArea[i]);
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.h	(revision 26222)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.h	(revision 26223)
+@@ -10,7 +10,7 @@
+ #define SLGEOM_OCEAN 0 
+ #define SLGEOM_ICE 1 
+ #define SLGEOM_WATER 2
+-#define MAXVERTICES 3
++#define SLMAXVERTICES 3
+ 
+ #include "../toolkits/toolkits.h"
+ 
+@@ -19,7 +19,7 @@
+ 	public: 
+ 
+ 		int         localnel;
+-		IssmDouble* LoadWeigths[SLGEOM_NUMLOADS][MAXVERTICES];
++		IssmDouble* LoadWeigths[SLGEOM_NUMLOADS][SLMAXVERTICES];
+ 		IssmDouble* LoadArea[SLGEOM_NUMLOADS];
+ 		Vector<IssmDouble>* vlatbarycentre[SLGEOM_NUMLOADS];
+ 		Vector<IssmDouble>* vlongbarycentre[SLGEOM_NUMLOADS];
Index: /issm/oecreview/Archive/25834-26739/ISSM-26223-26224.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26223-26224.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26223-26224.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26223)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26224)
+@@ -263,7 +263,9 @@
+ 	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
+ 	#endif
+ 
++	#if defined(_HAVE_SEALEVELCHANGE_)
+ 	if(isslc) sealevelchange_initialgeometry(femmodel);
++	#endif
+ }/*}}}*/
+ 
+ #ifdef _HAVE_CODIPACK_
Index: /issm/oecreview/Archive/25834-26739/ISSM-26224-26225.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26224-26225.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26224-26225.diff	(revision 26740)
@@ -0,0 +1,91 @@
+Index: ../trunk-jpl/src/m/classes/constants.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/constants.m	(revision 26224)
++++ ../trunk-jpl/src/m/classes/constants.m	(revision 26225)
+@@ -5,10 +5,10 @@
+ 
+ classdef constants
+ 	properties (SetAccess=public) 
+-		g                    = 0.;
+-		omega                = 0.;
+-		yts                  = 0.;
+-		referencetemperature = 0.;
++		g                      = 0.;
++		omega                  = 0.;
++		yts                    = 0.;
++		referencetemperature   = 0.;
+ 		gravitational_constant = 0.;
+ 	end
+ 	methods
+@@ -34,7 +34,7 @@
+ 			%the reference temperature for enthalpy model (cf Aschwanden)
+ 			self.referencetemperature=223.15;
+ 		
+-			%gravity: 
++			%gravitational constant: 
+ 			self.gravitational_constant = 6.67259e-11;
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/constants.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/constants.py	(revision 26224)
++++ ../trunk-jpl/src/m/classes/constants.py	(revision 26225)
+@@ -12,14 +12,14 @@
+     """
+ 
+     def __init__(self):  # {{{
+-        self.g = 0.
+-        self.omega = 0.
+-        self.yts = 0.
+-        self.referencetemperature = 0.
++        self.g                      = 0.
++        self.omega                  = 0.
++        self.yts                    = 0.
++        self.referencetemperature   = 0.
++        self.gravitational_constant = 0.;
+ 
+-    #set defaults
++        #set defaults
+         self.setdefaultparameters()
+-
+     #}}}
+     def __repr__(self):  # {{{
+         string = "   constants parameters:"
+@@ -28,10 +28,10 @@
+         string = "%s\n%s" % (string, fielddisplay(self, "omega", "angular velocity of Earth [rad / s]"))
+         string = "%s\n%s" % (string, fielddisplay(self, "yts", "number of seconds in a year [s / yr]"))
+         string = "%s\n%s" % (string, fielddisplay(self, "referencetemperature", "reference temperature used in the enthalpy model [K]"))
++        string = "%s\n%s" % (string, fielddisplay(self, "gravitational_constant", "Newtonian constant of gravitation [m^3/kg/s^2]"))
+ 
+         return string
+     #}}}
+-
+     def setdefaultparameters(self):  # {{{
+         #acceleration due to gravity (m / s^2)
+         self.g = 9.81
+@@ -45,20 +45,23 @@
+         #the reference temperature for enthalpy model (cf Aschwanden)
+         self.referencetemperature = 223.15
+ 
++        #gravitational constant:
++        self.gravitational_constant = 6.67259e-11
++
+         return self
+     #}}}
+-
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         md = checkfield(md, 'fieldname', 'constants.g', '>=', 0, 'size', [1])
+         md = checkfield(md, 'fieldname', 'constants.omega', '>=', 0, 'size', [1])
+         md = checkfield(md, 'fieldname', 'constants.yts', '>', 0, 'size', [1])
+         md = checkfield(md, 'fieldname', 'constants.referencetemperature', 'size', [1])
++        md = checkfield(md, 'fieldname', 'constants.gravitational_constant','size',[1]);
+ 
+         return md
+     # }}}
+-
+     def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'g', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'yts', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'referencetemperature', 'format', 'Double')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'gravitational_constant', 'format', 'Double');
+     # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26225-26226.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26225-26226.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26225-26226.diff	(revision 26740)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/test/Archives/Archive352.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive353.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive354.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26225)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26226)
+@@ -431,7 +431,7 @@
+ 	if (reCast<IssmDouble>(nsteps)<time1/dt) nsteps=nsteps+1;
+ 	time1 = nsteps*dt;
+ 
+-	if(cycle && (time<time0 || time>time1)){
++	if(cycle){
+ 
+ 		/*See by how many intervals we have to offset time*/
+ 		IssmDouble deltat = time1-time0;
+@@ -440,7 +440,7 @@
+ 		int num_intervals = reCast<int,IssmDouble>(fabs(time-time0)/deltat);
+ 
+ 		/*Uncomment following line if you would like to apply a cycle BEFORE the time series starts*/
+-		//if(time<time0) num_intervals = -num_intervals-1;
++		if(time<time0) num_intervals = -num_intervals-1;
+ 
+ 		if(fabs(time-time0)/deltat == reCast<IssmDouble>(num_intervals)){
+ 			/*Hack to make sure we always cover the last value of the series (discussion with Nicole)*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26226-26227.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26226-26227.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26226-26227.diff	(revision 26740)
@@ -0,0 +1,1241 @@
+Index: ../trunk-jpl/src/c/classes/GrdLoads.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/GrdLoads.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/classes/GrdLoads.cpp	(revision 26227)
+@@ -0,0 +1,71 @@
++/*
++ * \file GrdLoads.cpp
++ * \brief: Implementation of GrdLoads class
++ */
++
++/*Headers: {{{*/
++#ifdef HAVE_CONFIG_H
++	#include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./GrdLoads.h"
++#include "./SealevelGeometry.h"
++using namespace std;
++/*}}}*/
++
++/*Object constructors and destructor*/
++GrdLoads::GrdLoads(int nel,SealevelGeometry* slgeom){ /*{{{*/
++
++
++	vloads=new Vector<IssmDouble>(nel);
++	for (int i=0;i<SLGEOM_NUMLOADS;i++) vsubloads[i]=new Vector<IssmDouble>(slgeom->nbar[i]);
++
++	vsealevelloads=new Vector<IssmDouble>(nel);
++	vsealevelloads->Set(0);vsealevelloads->Assemble();
++
++	vsubsealevelloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
++
++
++}; /*}}}*/
++GrdLoads::~GrdLoads(){ /*{{{*/
++
++	delete vloads;
++	xDelete<IssmDouble>(loads);
++	for(int i=0;i<SLGEOM_NUMLOADS;i++){
++		delete vsubloads[i];
++		xDelete<IssmDouble>(subloads[i]);
++	}
++	delete vsealevelloads;
++	xDelete<IssmDouble>(sealevelloads);
++	delete vsubsealevelloads;
++	xDelete<IssmDouble>(subsealevelloads);
++}; /*}}}*/
++
++void GrdLoads::BroadcastLoads(void){ /*{{{*/
++
++	/*Initialize barycentre vectors, now that we know their size: */
++	vloads->Assemble();
++	for (int i=0;i<SLGEOM_NUMLOADS;i++){
++		vsubloads[i]->Assemble();
++	}
++	
++	loads=vloads->ToMPISerial();
++	for (int i=0;i<SLGEOM_NUMLOADS;i++){
++		subloads[i]=vsubloads[i]->ToMPISerial();
++	}
++
++} /*}}}*/
++void GrdLoads::AssembleSealevelLoads(void){ /*{{{*/
++
++	vsealevelloads->Assemble();
++	vsubsealevelloads->Assemble();
++
++} /*}}}*/
++void GrdLoads::BroadcastSealevelLoads(void){ /*{{{*/
++	
++	sealevelloads=vsealevelloads->ToMPISerial();
++	subsealevelloads=vsubsealevelloads->ToMPISerial();
++
++} /*}}}*/
+Index: ../trunk-jpl/src/c/classes/GrdLoads.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/GrdLoads.h	(nonexistent)
++++ ../trunk-jpl/src/c/classes/GrdLoads.h	(revision 26227)
+@@ -0,0 +1,32 @@
++/*!\file GrdLoads.h
++ * \brief: header file for GrdLoads
++ */
++
++#ifndef _SEALEVELGRDLOADS_H_
++#define _SEALEVELGRDLOADS_H_
++
++/*Headers:*/
++#include "./SealevelGeometry.h"
++#include "../toolkits/toolkits.h"
++
++class GrdLoads{ 
++
++	public: 
++
++		Vector<IssmDouble>* vloads=NULL;
++		IssmDouble*         loads=NULL;
++		Vector<IssmDouble>* vsubloads[SLGEOM_NUMLOADS];
++		IssmDouble*         subloads[SLGEOM_NUMLOADS];
++		Vector<IssmDouble>* vsealevelloads=NULL;
++		IssmDouble*         sealevelloads=NULL;
++		Vector<IssmDouble>* vsubsealevelloads=NULL;
++		IssmDouble*         subsealevelloads=NULL;
++
++		GrdLoads(int nel, SealevelGeometry* slgeom);
++		~GrdLoads();
++
++		void AssembleSealevelLoads(void);
++		void BroadcastLoads(void);
++		void BroadcastSealevelLoads(void);
++};
++#endif  /* _SEALEVELGRDLOADS_H_ */
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26226)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26227)
+@@ -558,6 +558,7 @@
+ issm_sources += \
+ 	./cores/sealevelchange_core.cpp \
+ 	./analyses/SealevelchangeAnalysis.cpp\
++	./classes/GrdLoads.cpp\
+ 	./classes/SealevelGeometry.cpp
+ 
+ #gia ivins physics (only if have fortran)
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26226)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26227)
+@@ -30,9 +30,9 @@
+ class ElementInput;
+ class DatasetInput;
+ class IoModel;
+-class SealevelMasks;
+ class SealevelGeometry;
+ class Gauss;
++class GrdLoads;
+ class ElementVector;
+ template <class doublematrix> class Matrix;
+ template <class doubletype> class Vector;
+@@ -390,15 +390,15 @@
+ 		virtual void          GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+ 
+ 		virtual void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom)=0;
+-		virtual void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom)=0;
+-		virtual void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+ 		virtual void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+ 		virtual void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae)=0;
+-		virtual void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom)=0;
+-		virtual void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+-		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+-		virtual void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26226)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26227)
+@@ -223,15 +223,15 @@
+ 		#ifdef _HAVE_SEALEVELCHANGE_
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(GrdLoads* loads,  Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		#endif
+ 
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26226)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26227)
+@@ -178,15 +178,15 @@
+ #ifdef _HAVE_SEALEVELCHANGE_
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(GrdLoads* loads,  Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26226)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26227)
+@@ -185,15 +185,15 @@
+ #ifdef _HAVE_SEALEVELCHANGE_
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26226)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26227)
+@@ -6805,7 +6805,7 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*Inputs:*/
+ 	IssmDouble I[NUMVERTICES]; 
+@@ -6862,21 +6862,21 @@
+ 	/*Plug values into subelement load vector:*/
+ 	if(slgeom->issubelement[SLGEOM_ICE][this->lid]){
+ 		int intj=slgeom->subelementmapping[SLGEOM_ICE][this->lid];
+-		subelementiceloads->SetValue(intj,Iavg,INS_VAL);
++		loads->vsubloads[SLGEOM_ICE]->SetValue(intj,Iavg,INS_VAL);
+ 		Iavg=0; //avoid double counting centroid loads and subelement loads!
+ 	}
+ 	if(slgeom->issubelement[SLGEOM_WATER][this->lid]){
+ 		int intj=slgeom->subelementmapping[SLGEOM_WATER][this->lid];
+-		subelementhydroloads->SetValue(intj,Wavg,INS_VAL);
++		loads->vsubloads[SLGEOM_WATER]->SetValue(intj,Wavg,INS_VAL);
+ 		Wavg=0;
+ 	}
+ 	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+ 		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+-		subelementbploads->SetValue(intj,BPavg,INS_VAL); 
++		loads->vsubloads[SLGEOM_OCEAN]->SetValue(intj,BPavg,INS_VAL); 
+ 		BPavg=0;
+ 	}
+ 	/*Plug remaining values into centroi load vector:*/
+-	loads->SetValue(this->sid,Iavg+Wavg+BPavg,INS_VAL);
++	loads->vloads->SetValue(this->sid,Iavg+Wavg+BPavg,INS_VAL);
+ 
+ 	/*Keep track of barystatic contributions:*/
+ 	barycontrib->Set(this->Sid(),bslcice,bslchydro,bslcbp);
+@@ -6883,13 +6883,11 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*sal green function:*/
+ 	IssmDouble* G=NULL;
+-	IssmDouble* GsubelIce=NULL;
+-	IssmDouble* GsubelHydro=NULL;
+-	IssmDouble* GsubelOcean=NULL;
++	IssmDouble* Gsub[SLGEOM_NUMLOADS];
+ 	IssmDouble SealevelGRD[NUMVERTICES]={0};
+ 	IssmDouble oceanaverage=0;
+ 	IssmDouble oceanarea=0;
+@@ -6918,48 +6916,11 @@
+ 
+ 	if(sal){
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&GsubelIce,&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&GsubelHydro,&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&GsubelOcean,&size);
+-		
+-		if(allsealevelloads){
+-			for(int i=0;i<NUMVERTICES;i++) {
+-				for (int e=0;e<nel;e++){
+-					SealevelGRD[i]+=G[i*nel+e]*(allsealevelloads[e]+allloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_ICE];
+-				for (int e=0;e<nbar;e++){
+-					SealevelGRD[i]+=GsubelIce[i*nbar+e]*(allsubelementiceloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_WATER];
+-				for (int e=0;e<nbar;e++){
+-					SealevelGRD[i]+=GsubelHydro[i*nbar+e]*(allsubelementhydroloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_OCEAN];
+-				for (int e=0;e<nbar;e++){
+-					SealevelGRD[i]+=GsubelOcean[i*nbar+e]*(allsubelementbploads[e]+allsubelementsealevelloads[e]);
+-				}
+-			}
+-		}
+-		else{  //this is the initial convolution where only loads are provided
+-			for(int i=0;i<NUMVERTICES;i++) {
+-				for (int e=0;e<nel;e++){
+-					SealevelGRD[i]+=G[i*nel+e]*(allloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_ICE];
+-				for (int e=0;e<nbar;e++){
+-					SealevelGRD[i]+=GsubelIce[i*nbar+e]*(allsubelementiceloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_WATER];
+-				for (int e=0;e<nbar;e++){
+-					SealevelGRD[i]+=GsubelHydro[i*nbar+e]*(allsubelementhydroloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_OCEAN];
+-				for (int e=0;e<nbar;e++){
+-					SealevelGRD[i]+=GsubelOcean[i*nbar+e]*(allsubelementbploads[e]);
+-				}
+-			}
+-		}
++		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&Gsub[SLGEOM_ICE],&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
++
++		this->SealevelchangeGxL(&SealevelGRD[0],G, Gsub, loads, slgeom, nel);
+ 	}
+ 
+ 	/*retrieve ocean average and area:*/
+@@ -6974,11 +6935,11 @@
+ 	/*add ocean average in the global sealevelloads vector:*/
+ 	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+ 		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+-		subelementsealevelloads->SetValue(intj,oceanaverage*rho_water,INS_VAL);
++		loads->vsubsealevelloads->SetValue(intj,oceanaverage*rho_water,INS_VAL);
+ 	}
+-	else sealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
++	else loads->vsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+ 
+-	if(!allsealevelloads){
++	if(!loads->sealevelloads){
+ 		oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
+ 		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+ 			int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+@@ -6989,7 +6950,7 @@
+ 	
+ 	return;
+ } /*}}}*/
+-void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	IssmDouble Sealevel[3]={0,0,0};
+ 	IssmDouble SealevelRSL[3]={0,0,0};
+@@ -7002,18 +6963,10 @@
+ 	IssmDouble* GU=NULL;
+ 	IssmDouble* GE=NULL;
+ 	IssmDouble* GN=NULL;
+-	IssmDouble* GsubelIce=NULL;
+-	IssmDouble* GsubelHydro=NULL;
+-	IssmDouble* GsubelOcean=NULL;
+-	IssmDouble* GUsubelIce=NULL;
+-	IssmDouble* GUsubelHydro=NULL;
+-	IssmDouble* GUsubelOcean=NULL;
+-	IssmDouble* GNsubelIce=NULL;
+-	IssmDouble* GNsubelHydro=NULL;
+-	IssmDouble* GNsubelOcean=NULL;
+-	IssmDouble* GEsubelIce=NULL;
+-	IssmDouble* GEsubelHydro=NULL;
+-	IssmDouble* GEsubelOcean=NULL;
++	IssmDouble* Gsub[SLGEOM_NUMLOADS];
++	IssmDouble* GUsub[SLGEOM_NUMLOADS];
++	IssmDouble* GNsub[SLGEOM_NUMLOADS];
++	IssmDouble* GEsub[SLGEOM_NUMLOADS];
+ 
+ 	int horiz;
+ 	int size;
+@@ -7038,82 +6991,38 @@
+ 	}
+ 		
+ 	if(sal){
++
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&GsubelIce,&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&GsubelHydro,&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&GsubelOcean,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&Gsub[SLGEOM_ICE],&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
++
+ 		if(elastic){
+ 			this->inputs->GetArrayPtr(SealevelchangeGUEnum,this->lid,&GU,&size);
+-			this->inputs->GetArrayPtr(SealevelchangeGUsubelIceEnum,this->lid,&GUsubelIce,&size);
+-			this->inputs->GetArrayPtr(SealevelchangeGUsubelHydroEnum,this->lid,&GUsubelHydro,&size);
+-			this->inputs->GetArrayPtr(SealevelchangeGUsubelOceanEnum,this->lid,&GUsubelOcean,&size);
++			this->inputs->GetArrayPtr(SealevelchangeGUsubelIceEnum,this->lid,&GUsub[SLGEOM_ICE],&size);
++			this->inputs->GetArrayPtr(SealevelchangeGUsubelHydroEnum,this->lid,&GUsub[SLGEOM_WATER],&size);
++			this->inputs->GetArrayPtr(SealevelchangeGUsubelOceanEnum,this->lid,&GUsub[SLGEOM_OCEAN],&size);
+ 			if(horiz){
++				this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGNsubelIceEnum,this->lid,&GNsub[SLGEOM_ICE],&size);
++				this->inputs->GetArrayPtr(SealevelchangeGNsubelHydroEnum,this->lid,&GNsub[SLGEOM_WATER],&size);
++				this->inputs->GetArrayPtr(SealevelchangeGNsubelOceanEnum,this->lid,&GNsub[SLGEOM_OCEAN],&size);
++
+ 				this->inputs->GetArrayPtr(SealevelchangeGEEnum,this->lid,&GE,&size);
+-				this->inputs->GetArrayPtr(SealevelchangeGEsubelIceEnum,this->lid,&GEsubelIce,&size);
+-				this->inputs->GetArrayPtr(SealevelchangeGEsubelOceanEnum,this->lid,&GEsubelOcean,&size);
+-				this->inputs->GetArrayPtr(SealevelchangeGEsubelHydroEnum,this->lid,&GEsubelHydro,&size);
+-				this->inputs->GetArrayPtr(SealevelchangeGNEnum,this->lid,&GN,&size);
+-				this->inputs->GetArrayPtr(SealevelchangeGNsubelIceEnum,this->lid,&GNsubelIce,&size);
+-				this->inputs->GetArrayPtr(SealevelchangeGNsubelHydroEnum,this->lid,&GNsubelHydro,&size);
+-				this->inputs->GetArrayPtr(SealevelchangeGNsubelOceanEnum,this->lid,&GNsubelOcean,&size);
++				this->inputs->GetArrayPtr(SealevelchangeGEsubelIceEnum,this->lid,&GEsub[SLGEOM_ICE],&size);
++				this->inputs->GetArrayPtr(SealevelchangeGEsubelHydroEnum,this->lid,&GEsub[SLGEOM_WATER],&size);
++				this->inputs->GetArrayPtr(SealevelchangeGEsubelOceanEnum,this->lid,&GEsub[SLGEOM_OCEAN],&size);
+ 			}
+ 		}
+ 
+-		for(int i=0;i<NUMVERTICES;i++) {
+-			for (int e=0;e<nel;e++){
+-				SealevelRSL[i]+=G[i*nel+e]*(sealevelloads[e]+loads[e]);
+-			}
+-			nbar=slgeom->nbar[SLGEOM_ICE];
+-			for (int e=0;e<nbar;e++){
+-				SealevelRSL[i]+=GsubelIce[i*nbar+e]*(subelementiceloads[e]);
+-			}
+-			nbar=slgeom->nbar[SLGEOM_WATER];
+-			for (int e=0;e<nbar;e++){
+-				SealevelRSL[i]+=GsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
+-			}
+-			nbar=slgeom->nbar[SLGEOM_OCEAN];
+-			for (int e=0;e<nbar;e++){
+-				SealevelRSL[i]+=GsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
+-			}
++		this->SealevelchangeGxL(&SealevelRSL[0],G, Gsub, loads, slgeom, nel);
+ 
+-			if(elastic){
+-				for (int e=0;e<nel;e++){
+-					SealevelU[i]+=GU[i*nel+e]*(sealevelloads[e]+loads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_ICE];
+-				for (int e=0;e<nbar;e++){
+-					SealevelU[i]+=GUsubelIce[i*nbar+e]*(subelementiceloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_WATER];
+-				for (int e=0;e<nbar;e++){
+-					SealevelU[i]+=GUsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_OCEAN];
+-				for (int e=0;e<nbar;e++){
+-					SealevelU[i]+=GUsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
+-				}
++		if(elastic){
++			this->SealevelchangeGxL(&SealevelU[0],GU, GUsub, loads, slgeom, nel);
++			if(horiz ){
++				this->SealevelchangeGxL(&SealevelN[0],GN, GNsub, loads, slgeom, nel);
++				this->SealevelchangeGxL(&SealevelE[0],GE, GEsub, loads, slgeom, nel);
+ 			}
+-			if(horiz && elastic){
+-				for (int e=0;e<nel;e++){
+-					SealevelN[i]+=GN[i*nel+e]*(sealevelloads[e]+loads[e]);
+-					SealevelE[i]+=GE[i*nel+e]*(sealevelloads[e]+loads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_ICE];
+-				for (int e=0;e<nbar;e++){
+-					SealevelN[i]+=GNsubelIce[i*nbar+e]*(subelementiceloads[e]);
+-					SealevelE[i]+=GEsubelIce[i*nbar+e]*(subelementiceloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_WATER];
+-				for (int e=0;e<nbar;e++){
+-					SealevelN[i]+=GNsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
+-					SealevelE[i]+=GEsubelHydro[i*nbar+e]*(subelementhydroloads[e]);
+-				}
+-				nbar=slgeom->nbar[SLGEOM_OCEAN];
+-				for (int e=0;e<nbar;e++){
+-					SealevelN[i]+=GNsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
+-					SealevelE[i]+=GEsubelOcean[i*nbar+e]*(subelementbploads[e]+subelementsealevelloads[e]);
+-				}
+-			}
+ 		}
+ 	}
+ 
+@@ -7130,7 +7039,42 @@
+ 
+ 
+ } /*}}}*/
+-void       Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom){/*{{{*/
++void       Tria::SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel) { /*{{{*/
++
++	if(loads->sealevelloads){
++		for(int i=0;i<NUMVERTICES;i++) {
++			for (int e=0;e<nel;e++){
++				sealevel[i]+=G[i*nel+e]*(loads->sealevelloads[e]+loads->loads[e]);
++			}
++			for(int l=0;l<SLGEOM_NUMLOADS;l++){
++				int nbar=slgeom->nbar[l];
++				for (int e=0;e<nbar;e++){
++					sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subloads[l][e]);
++				}
++				if(l==SLGEOM_OCEAN){
++					for (int e=0;e<nbar;e++){
++						sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subsealevelloads[e]);
++					}
++				}
++			}
++		}
++	}
++	else{  //this is the initial convolution where only loads are provided
++		for(int i=0;i<NUMVERTICES;i++) {
++			for (int e=0;e<nel;e++){
++				sealevel[i]+=G[i*nel+e]*(loads->loads[e]);
++			}
++			for(int l=0;l<SLGEOM_NUMLOADS;l++){
++				int nbar=slgeom->nbar[l];
++				for (int e=0;e<nbar;e++){
++					sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subloads[l][e]);
++				}
++			}
++		}
++	}
++
++} /*}}}*/
++void       Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){/*{{{*/
+ 		
+ 	IssmDouble S=0;
+ 
+@@ -7147,8 +7091,8 @@
+ 
+ 
+ 	/*recover total load: */
+-	if(loads) S+=loads[this->Sid()];
+-	if(sealevelloads) S+=sealevelloads[this->Sid()];
++	if(loads->loads) S+=loads->loads[this->Sid()];
++	if(loads->sealevelloads) S+=loads->sealevelloads[this->Sid()];
+ 	
+ 	/* Perturbation terms for moment of inertia (moi_list):
+ 	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
+@@ -7160,7 +7104,7 @@
+ 	dI_list[2] = +4*M_PI*(S*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
+ 	return;
+ }/*}}}*/
+-void       Tria::SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){/*{{{*/
++void       Tria::SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* grdloads,  SealevelGeometry* slgeom){/*{{{*/
+ 		
+ 	IssmDouble  SA=0;
+ 	IssmDouble* loads=NULL;
+@@ -7180,18 +7124,8 @@
+ 	/*Go through our loads:*/
+ 	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+ 		if(slgeom->issubelement[i][this->lid]){
+-			switch(i){
+-				case SLGEOM_ICE: 
+-					loads=subelementiceloads;
+-					break;
+-				case SLGEOM_WATER: 
+-					loads=subelementhydroloads;
+-					break;
+-				case SLGEOM_OCEAN: 
+-					loads=subelementbploads;
+-					sealevelloads=subelementsealevelloads;
+-					break;
+-			}
++			loads=grdloads->subloads[i];
++			if(i==SLGEOM_OCEAN) sealevelloads=grdloads->subsealevelloads;
+ 			intj=slgeom->subelementmapping[i][this->lid];
+ 			late=slgeom->latbarycentre[i][intj]/180*M_PI;
+ 			longe=slgeom->longbarycentre[i][intj]/180*M_PI;
+@@ -7214,14 +7148,14 @@
+ 
+ 	return;
+ }/*}}}*/
+-void       Tria::SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
+ 	
+ 	if(slgeom->isoceanin[this->lid]){
+ 		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+ 			int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+-			subelementloads->SetValue(intj,offset,ADD_VAL);
++			loads->vsubsealevelloads->SetValue(intj,offset,ADD_VAL);
+ 		}
+-		else loads->SetValue(this->sid,offset,ADD_VAL);
++		else loads->vsealevelloads->SetValue(this->sid,offset,ADD_VAL);
+ 	}
+ 
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26226)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26227)
+@@ -172,12 +172,12 @@
+ 		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom);
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae);
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+-		void       SealevelchangeBarystaticLoads(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementiceloads, Vector<IssmDouble>* subelementhydroloads, Vector<IssmDouble>* subelementbploads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom);
+-		void       SealevelchangeConvolution(Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* allsealevelloads, IssmDouble* allloads,IssmDouble* allsubelementiceloads, IssmDouble* allsubelementhydroloads, IssmDouble* allsubelementbploads, IssmDouble* allsubelementsealevelloads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
+-		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
+-		void       SealevelchangeShift(Vector<IssmDouble>* loads, Vector<IssmDouble>* subelementloads, IssmDouble offset, SealevelGeometry* slgeom);
+-		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, IssmDouble* loads, IssmDouble* sealevelloads, SealevelGeometry* slgeom);
+-		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom);
++		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom);
++		void       SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom);
++		void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
++		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom);
++		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom);
++		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom);
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+@@ -213,11 +213,11 @@
+ 		void	       MovingFrontalVelocity(void);
+ 		Gauss*         NewGauss(void);
+ 		Gauss*         NewGauss(int order);
+-      Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
+-      Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
+-      Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,int order);
+-      Gauss*         NewGauss(IssmDouble fraction1,IssmDouble fraction2,int order);
+-      Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
++        Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order);
++        Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
++        Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,int order);
++        Gauss*         NewGauss(IssmDouble fraction1,IssmDouble fraction2,int order);
++        Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
+ 		Gauss*         NewGaussBase(int order);
+ 		Gauss*         NewGaussLine(int vertex1,int vertex2,int order){_error_("not implemented yet");};
+ 		Gauss*         NewGaussTop(int order);
+@@ -236,11 +236,12 @@
+ 		void           NormalTop(IssmDouble* normal,IssmDouble* xyz_list);
+ 		void           SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
+ 		void           InputServe(Input* input_in);
+-		Seg*	         SpawnSeg(int index1,int index2);
++		Seg*	       SpawnSeg(int index1,int index2);
+ 		IssmDouble     StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+ 		void           StabilizationParameterAnisotropic(IssmDouble* tau_parameter_ansiotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
+ 		void           UpdateConstraintsExtrudeFromBase(void);
+ 		void           UpdateConstraintsExtrudeFromTop(void);
++		void           SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel);
+ 		/*}}}*/
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/classes.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/classes.h	(revision 26226)
++++ ../trunk-jpl/src/c/classes/classes.h	(revision 26227)
+@@ -18,6 +18,7 @@
+ #include "./Massfluxatgate.h"
+ #include "./Misfit.h"
+ #include "./SealevelGeometry.h"
++#include "./GrdLoads.h"
+ #include "./BarystaticContributions.h"
+ #include "./Nodalvalue.h"
+ #include "./Numberedcostfunction.h"
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26226)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26227)
+@@ -22,16 +22,16 @@
+ /*support routines local definitions:{{{*/
+ void TransferForcing(FemModel* femmodel,int forcingenum);
+ void TransferSealevel(FemModel* femmodel,int forcingenum);
+-void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+-IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble oceanarea);
+-void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom);
+-void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, IssmDouble offset, SealevelGeometry* slgeom);
++bool slcconvergence(Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
++IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble oceanarea);
++void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom);
++void ConserveOceanMass(FemModel* femmodel,GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom);
+ void ivins_deformation_core(FemModel* femmodel);
+ IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel);
+ /*}}}*/
+ 
+ /*main cores:*/
+-void sealevelchange_core(FemModel* femmodel){ /*{{{*/
++void              sealevelchange_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	SealevelGeometry* slgeom=NULL;
+ 
+@@ -82,7 +82,7 @@
+ 	femmodel->profiler->Stop(SLRCORE);
+ }
+ /*}}}*/
+-void solidearthexternal_core(FemModel* femmodel){ /*{{{*/
++void              solidearthexternal_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*variables:*/
+ 	Vector<IssmDouble> *bedrock  = NULL; 
+@@ -151,7 +151,7 @@
+ 	}
+ }
+ /*}}}*/
+-void couplerinput_core(FemModel* femmodel){  /*{{{*/
++void              couplerinput_core(FemModel* femmodel){  /*{{{*/
+ 
+ 	/*Be very careful here, everything is well thought through, do not remove 
+ 	 * without taking big risks:*/
+@@ -214,7 +214,7 @@
+ 	}
+ 	
+ }; /*}}}*/
+-void grd_core(FemModel* femmodel, SealevelGeometry* slgeom) { /*{{{*/
++void              grd_core(FemModel* femmodel, SealevelGeometry* slgeom) { /*{{{*/
+ 
+ 	/*variables:{{{*/
+ 	int nel;
+@@ -222,18 +222,7 @@
+ 	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
+ 	IssmDouble rotationaxismotionvector[3]={0};
+ 	
+-	Vector<IssmDouble>*    loads=NULL;
+-	IssmDouble*            allloads=NULL; 
+-	Vector<IssmDouble>*    subelementiceloads=NULL;
+-	IssmDouble*            allsubelementiceloads=NULL;
+-	Vector<IssmDouble>*    subelementhydroloads=NULL;
+-	IssmDouble*            allsubelementhydroloads=NULL;
+-	Vector<IssmDouble>*    subelementbploads=NULL;
+-	IssmDouble*            allsubelementbploads=NULL;
+-	Vector<IssmDouble>*    sealevelloads=NULL;
+-	IssmDouble*            allsealevelloads=NULL;
+-	Vector<IssmDouble>*    subelementsealevelloads=NULL;
+-	IssmDouble*            allsubelementsealevelloads=NULL;
++	GrdLoads*              loads=NULL;
+ 	Vector<IssmDouble>*    oldsealevelloads=NULL;
+ 	Vector<IssmDouble>*    oceanareas=NULL;
+ 	IssmDouble             oceanarea;
+@@ -248,7 +237,6 @@
+ 	int                  iterations=0;
+ 	int                  step;
+ 	IssmDouble           time; 
+-	bool converged=false;
+ 
+ 	int  modelid,earthid;
+ 	int  horiz;
+@@ -300,14 +288,7 @@
+ 	/*initialize loads and sea level loads:*/
+ 	femmodel->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 
+-	loads=new Vector<IssmDouble>(nel);
+-	subelementiceloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_ICE]);
+-	subelementhydroloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_WATER]);
+-	subelementbploads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+-
+-	sealevelloads=new Vector<IssmDouble>(nel);
+-	sealevelloads->Set(0);sealevelloads->Assemble();
+-	subelementsealevelloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
++	loads=new GrdLoads(nel,slgeom);
+ 	subelementoceanareas=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+ 	oceanareas=new Vector<IssmDouble>(nel);
+ 
+@@ -316,27 +297,19 @@
+ 	/*buildup loads: */
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeBarystaticLoads(loads, subelementiceloads, subelementhydroloads, subelementbploads, barycontrib,slgeom); 
++		element->SealevelchangeBarystaticLoads(loads, barycontrib,slgeom); 
+ 	}
+-	loads->Assemble(); 
+-	subelementiceloads->Assemble();
+-	subelementhydroloads->Assemble();
+-	subelementbploads->Assemble();
+-	
+ 
+ 	//broadcast loads 
+-	allloads=loads->ToMPISerial();
+-	allsubelementiceloads=subelementiceloads->ToMPISerial();
+-	allsubelementhydroloads=subelementhydroloads->ToMPISerial();
+-	allsubelementbploads=subelementbploads->ToMPISerial();
++	loads->BroadcastLoads();
+ 
+ 	//compute rotation axis motion:
+-	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsubelementiceloads,allsubelementhydroloads,allsubelementbploads, NULL, NULL,slgeom);
++	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,loads,slgeom);
+ 
+ 	/*skip computation of sea level if requested, which means sea level loads should be zeroed */
+ 	if(!computesealevel){
+-		allsealevelloads=xNewZeroInit<IssmDouble>(nel);
+-		allsubelementsealevelloads=xNewZeroInit<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
++		loads->sealevelloads=xNewZeroInit<IssmDouble>(nel);
++		loads->subsealevelloads=xNewZeroInit<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+ 		goto deformation;
+ 	}
+ 
+@@ -343,19 +316,18 @@
+ 	if(VerboseSolution()) _printf0_("	  converging GRD convolutions\n");
+ 	for(;;){
+ 
+-		oldsealevelloads=sealevelloads->Duplicate(); sealevelloads->Copy(oldsealevelloads);
++		oldsealevelloads=loads->vsealevelloads->Duplicate(); loads->vsealevelloads->Copy(oldsealevelloads);
+ 
+ 		/*convolve load and sealevel loads on oceans:*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelchangeConvolution(sealevelloads, subelementsealevelloads, oceanareas, subelementoceanareas, allsealevelloads, allloads,allsubelementiceloads, allsubelementhydroloads, allsubelementbploads, allsubelementsealevelloads, rotationaxismotionvector,slgeom);
++			element->SealevelchangeConvolution(loads, oceanareas, subelementoceanareas, rotationaxismotionvector,slgeom);
+ 		}
+ 
+-		sealevelloads->Assemble();
+-		subelementsealevelloads->Assemble();
+-
++		loads->AssembleSealevelLoads();
++	
+ 		/*compute ocean areas:*/
+-		if(!allsealevelloads){ //first time in the loop
++		if(!loads->sealevelloads){ //first time in the loop
+ 			oceanareas->Assemble(); 
+ 			subelementoceanareas->Assemble();
+ 			oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+@@ -363,24 +335,21 @@
+ 		}
+ 	
+ 		//Conserve ocean mass: 
+-		oceanaverage=SealevelloadsOceanAverage(sealevelloads,subelementsealevelloads, oceanareas,subelementoceanareas, oceanarea);
+-		
+-		ConserveOceanMass(femmodel,sealevelloads,subelementsealevelloads,barycontrib->Total()/oceanarea - oceanaverage,slgeom);
++		oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, oceanarea);
++		ConserveOceanMass(femmodel,loads,barycontrib->Total()/oceanarea - oceanaverage,slgeom);
+ 
+ 		//broadcast sea level loads 
+-		allsealevelloads=sealevelloads->ToMPISerial();
+-		allsubelementsealevelloads=subelementsealevelloads->ToMPISerial();
++		loads->BroadcastSealevelLoads();
+ 
+ 		//compute rotation axis motion:
+-		RotationAxisMotion(&rotationaxismotionvector[0],femmodel,allloads,allsubelementiceloads,allsubelementhydroloads,allsubelementbploads, allsealevelloads,allsubelementsealevelloads,slgeom);
++		RotationAxisMotion(&rotationaxismotionvector[0],femmodel,loads, slgeom);
+ 
+ 		//convergence?
+-		slcconvergence(&converged,sealevelloads,oldsealevelloads,eps_rel,eps_abs);
+-		if (converged)break;
++		if(slcconvergence(loads->vsealevelloads,oldsealevelloads,eps_rel,eps_abs))break;
+ 
+ 		//early return?
+ 		if(iterations>=max_nonlinear_iterations)break;
+-		else iterations++;
++		iterations++;
+ 	}
+ 
+ 	deformation:
+@@ -390,7 +359,7 @@
+ 	/*convolve loads and sea level loads to get the deformation:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeDeformationConvolution(allsealevelloads, allsubelementsealevelloads,allloads, allsubelementiceloads, allsubelementhydroloads, allsubelementbploads,rotationaxismotionvector,slgeom);
++		element->SealevelchangeDeformationConvolution(loads, rotationaxismotionvector,slgeom);
+ 	}
+ 
+ 	if(VerboseSolution()) _printf0_("	  updating GRD fields\n");
+@@ -413,7 +382,7 @@
+ 
+ }
+ /*}}}*/
+-void dynstr_core(FemModel* femmodel){ /*{{{*/
++void              dynstr_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*variables:*/
+ 	Vector<IssmDouble> *sealevel  = NULL; 
+@@ -479,7 +448,7 @@
+ 	delete deltastr;
+ }
+ /*}}}*/
+-void coupleroutput_core(FemModel* femmodel){  /*{{{*/
++void              coupleroutput_core(FemModel* femmodel){  /*{{{*/
+ 	
+ 	/*parameters:*/
+ 	int iscoupling;
+@@ -499,7 +468,7 @@
+ 		}
+ 	}
+ }; /*}}}*/
+-void ivins_deformation_core(FemModel* femmodel){ /*{{{*/
++void              ivins_deformation_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	int  gsize;
+ 	Vector<IssmDouble> *bedup  = NULL; 
+@@ -550,10 +519,8 @@
+ 	delete bedup;
+ }
+ /*}}}*/
++void              sealevelchange_initialgeometry(FemModel* femmodel) {  /*{{{*/
+ 
+-//Geometry:
+-void sealevelchange_initialgeometry(FemModel* femmodel) {  /*{{{*/
+-
+ 	/*Geometry core where we compute geometrical kernels and weights:*/
+ 
+ 	/*parameters: */
+@@ -667,7 +634,169 @@
+ 
+ }/*}}}*/
+ 
+-/*Support routines:*/
++/*subroutines:*/
++bool slcconvergence(Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs){ /*{{{*/
++
++	bool converged=true;
++	IssmDouble ndS,nS; 
++	Vector<IssmDouble> *dRSLg    = NULL;
++
++	//compute norm(du) and norm(u) if requested
++	dRSLg=RSLg_old->Duplicate(); RSLg_old->Copy(dRSLg); dRSLg->AYPX(RSLg,-1.0);
++	ndS=dRSLg->Norm(NORM_TWO); 
++
++	if (xIsNan<IssmDouble>(ndS)){
++		_error_("convergence criterion is NaN (RSL_old=" << RSLg_old->Norm(NORM_TWO) << " RSL=" << RSLg->Norm(NORM_TWO) << ")");
++	}
++
++	if(!xIsNan<IssmDouble>(eps_rel)){
++		nS=RSLg_old->Norm(NORM_TWO);
++		if (xIsNan<IssmDouble>(nS)) _error_("convergence criterion is NaN! (check the initial RSL)");
++	}
++
++	//clean up
++	delete dRSLg;
++
++	//print
++	if(!xIsNan<IssmDouble>(eps_rel)){
++		if((ndS/nS)<eps_rel){
++			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " < " << eps_rel*100 << " %\n");
++		}
++		else{ 
++			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " > " << eps_rel*100 << " %\n");
++			converged=false;
++		}
++	}
++	if(!xIsNan<IssmDouble>(eps_abs)){
++		if(ndS<eps_abs){
++			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " < " << eps_abs << " \n");
++		}
++		else{ 
++			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " > " << eps_abs << " \n");
++			converged=false;
++		}
++	}
++
++	/*assign output*/
++	return converged;
++
++} /*}}}*/
++IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* suboceanareas, IssmDouble oceanarea){ /*{{{*/
++
++	IssmDouble sealevelloadsaverage;	
++	IssmDouble subsealevelloadsaverage;	
++
++	Vector<IssmDouble>* vsealevelloadsvolume=loads->vsealevelloads->Duplicate();
++	Vector<IssmDouble>* vsubsealevelloadsvolume=loads->vsubsealevelloads->Duplicate();
++
++	vsealevelloadsvolume->PointwiseMult(loads->vsealevelloads,oceanareas);
++	vsubsealevelloadsvolume->PointwiseMult(loads->vsubsealevelloads,suboceanareas);
++	
++	vsealevelloadsvolume->Sum(&sealevelloadsaverage);
++	vsubsealevelloadsvolume->Sum(&subsealevelloadsaverage);
++	delete vsealevelloadsvolume; 
++	delete vsubsealevelloadsvolume; 
++	
++	//return (sealevelloadsaverage+subsealevelloadsaverage)/oceanarea;
++	return (sealevelloadsaverage)/oceanarea;
++} /*}}}*/
++void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom){ /*{{{*/
++
++	IssmDouble  moi_list[3]={0,0,0};
++	IssmDouble  moi_list_sub[3]={0,0,0};
++	IssmDouble  moi_list_cpu[3]={0,0,0};
++	IssmDouble*	tide_love_h  = NULL;
++	IssmDouble*	tide_love_k  = NULL;
++	IssmDouble*	load_love_k  = NULL;
++	IssmDouble  tide_love_k2secular;
++	IssmDouble  moi_e, moi_p;
++	IssmDouble	m1, m2, m3;
++	bool rotation=false;
++	
++	/*early return?:*/
++	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
++	if(!rotation)return;
++
++	/*retrieve parameters: */
++	femmodel->parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
++	femmodel->parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
++	femmodel->parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
++	femmodel->parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
++	femmodel->parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
++	femmodel->parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
++
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++
++		element->SealevelchangeMomentOfInertiaCentroid(&moi_list[0],loads,slgeom);
++
++		element->SealevelchangeMomentOfInertiaSubElement(&moi_list_sub[0],loads, slgeom);
++
++		moi_list_cpu[0] += moi_list[0]+moi_list_sub[0];
++		moi_list_cpu[1] += moi_list[1]+moi_list_sub[1];
++		moi_list_cpu[2] += moi_list[2]+moi_list_sub[2];
++	}
++
++
++	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	
++	ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	
++	ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++
++	/*compute perturbation terms for angular velocity vector: */
++	m1 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[0];
++	m2 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[1];
++	m3 = -(1+load_love_k[2])/moi_p * moi_list[2];	// term associated with fluid number (3-order-of-magnitude smaller) is negelected
++
++	/*Assign output pointers:*/
++	m[0]=m1;
++	m[1]=m2;
++	m[2]=m3;
++} /*}}}*/
++void        ConserveOceanMass(FemModel* femmodel,GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
++
++	/*Shift sealevel loads by ocean average, only on ocean! :*/
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeShift(loads, offset,slgeom);
++	}
++	loads->AssembleSealevelLoads();
++
++} /*}}}*/
++IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel){ /*{{{*/
++
++	int* indices=xNew<int>(nel);
++	for(int i=0;i<nel;i++)indices[i]=i;
++	
++	Vector<IssmDouble>* vloadcopy=new Vector<IssmDouble>(nel);
++	IssmDouble* loadcopy=xNew<IssmDouble>(nel);
++	
++	vloadcopy->SetValues(nel,indices,load,INS_VAL);
++	vloadcopy->Assemble();
++
++
++	if(subload){
++		for (int i=0;i<femmodel->elements->Size();i++){
++			if (slgeom->issubelement[loadtype][i]){
++				int se= slgeom->subelementmapping[loadtype][i];
++				IssmDouble subloadi=subload[se];
++				Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
++				vloadcopy->SetValue(element->Sid(),subloadi,ADD_VAL);
++			}
++		}
++	}
++	vloadcopy->Assemble();
++	loadcopy=vloadcopy->ToMPISerial();
++
++	return loadcopy;
++
++} /*}}}*/
++
++/*Coupling routines:*/
+ void TransferForcing(FemModel* femmodel,int forcingenum){ /*{{{*/
+ 
+ 	/*forcing being transferred from models to earth: */
+@@ -913,165 +1042,3 @@
+ 	/*}}}*/
+ 
+ } /*}}}*/
+-void slcconvergence(bool* pconverged, Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs){ /*{{{*/
+-
+-	bool converged=true;
+-	IssmDouble ndS,nS; 
+-	Vector<IssmDouble> *dRSLg    = NULL;
+-
+-	//compute norm(du) and norm(u) if requested
+-	dRSLg=RSLg_old->Duplicate(); RSLg_old->Copy(dRSLg); dRSLg->AYPX(RSLg,-1.0);
+-	ndS=dRSLg->Norm(NORM_TWO); 
+-
+-	if (xIsNan<IssmDouble>(ndS)){
+-		_error_("convergence criterion is NaN (RSL_old=" << RSLg_old->Norm(NORM_TWO) << " RSL=" << RSLg->Norm(NORM_TWO) << ")");
+-	}
+-
+-	if(!xIsNan<IssmDouble>(eps_rel)){
+-		nS=RSLg_old->Norm(NORM_TWO);
+-		if (xIsNan<IssmDouble>(nS)) _error_("convergence criterion is NaN! (check the initial RSL)");
+-	}
+-
+-	//clean up
+-	delete dRSLg;
+-
+-	//print
+-	if(!xIsNan<IssmDouble>(eps_rel)){
+-		if((ndS/nS)<eps_rel){
+-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " < " << eps_rel*100 << " %\n");
+-		}
+-		else{ 
+-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)/norm(S)" << ndS/nS*100 << " > " << eps_rel*100 << " %\n");
+-			converged=false;
+-		}
+-	}
+-	if(!xIsNan<IssmDouble>(eps_abs)){
+-		if(ndS<eps_abs){
+-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " < " << eps_abs << " \n");
+-		}
+-		else{ 
+-			if(VerboseConvergence()) _printf0_(setw(50) << left << "              convergence criterion: norm(dS)" << ndS << " > " << eps_abs << " \n");
+-			converged=false;
+-		}
+-	}
+-
+-	/*assign output*/
+-	*pconverged=converged;
+-
+-} /*}}}*/
+-IssmDouble SealevelloadsOceanAverage(Vector<IssmDouble>* sealevelloads,Vector<IssmDouble>* subelementsealevelloads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble oceanarea){ /*{{{*/
+-
+-	IssmDouble sealevelloadsaverage;	
+-	IssmDouble subelementsealevelloadsaverage;	
+-
+-	Vector<IssmDouble>* sealevelloadsvolume=sealevelloads->Duplicate();
+-	Vector<IssmDouble>* subelementsealevelloadsvolume=subelementsealevelloads->Duplicate();
+-
+-	sealevelloadsvolume->PointwiseMult(sealevelloads,oceanareas);
+-	subelementsealevelloadsvolume->PointwiseMult(subelementsealevelloads,subelementoceanareas);
+-	
+-	sealevelloadsvolume->Sum(&sealevelloadsaverage);
+-	subelementsealevelloadsvolume->Sum(&subelementsealevelloadsaverage);
+-	delete sealevelloadsvolume; 
+-	delete subelementsealevelloadsvolume; 
+-	
+-	//return (sealevelloadsaverage+subelementsealevelloadsaverage)/oceanarea;
+-	return (sealevelloadsaverage)/oceanarea;
+-} /*}}}*/
+-void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,IssmDouble* loads, IssmDouble* subelementiceloads, IssmDouble* subelementhydroloads, IssmDouble* subelementbploads, IssmDouble* sealevelloads, IssmDouble* subelementsealevelloads, SealevelGeometry* slgeom){ /*{{{*/
+-
+-	IssmDouble  moi_list[3]={0,0,0};
+-	IssmDouble  moi_list_sub[3]={0,0,0};
+-	IssmDouble  moi_list_cpu[3]={0,0,0};
+-	IssmDouble*	tide_love_h  = NULL;
+-	IssmDouble*	tide_love_k  = NULL;
+-	IssmDouble*	load_love_k  = NULL;
+-	IssmDouble  tide_love_k2secular;
+-	IssmDouble  moi_e, moi_p;
+-	IssmDouble	m1, m2, m3;
+-	bool rotation=false;
+-	
+-	/*early return?:*/
+-	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+-	if(!rotation)return;
+-
+-	/*retrieve parameters: */
+-	femmodel->parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
+-	femmodel->parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
+-	femmodel->parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
+-	femmodel->parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
+-	femmodel->parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
+-	femmodel->parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
+-
+-	for(Object* & object : femmodel->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-
+-		element->SealevelchangeMomentOfInertiaCentroid(&moi_list[0],loads,sealevelloads,slgeom);
+-
+-		element->SealevelchangeMomentOfInertiaSubElement(&moi_list_sub[0],subelementiceloads, subelementhydroloads, subelementbploads, subelementsealevelloads,slgeom);
+-
+-		moi_list_cpu[0] += moi_list[0]+moi_list_sub[0];
+-		moi_list_cpu[1] += moi_list[1]+moi_list_sub[1];
+-		moi_list_cpu[2] += moi_list[2]+moi_list_sub[2];
+-	}
+-
+-
+-	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	
+-	ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	
+-	ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+-	ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-
+-	/*compute perturbation terms for angular velocity vector: */
+-	m1 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[0];
+-	m2 = 1/(1-tide_love_k[2]/tide_love_k2secular) * (1+load_love_k[2])/(moi_p-moi_e) * moi_list[1];
+-	m3 = -(1+load_love_k[2])/moi_p * moi_list[2];	// term associated with fluid number (3-order-of-magnitude smaller) is negelected
+-
+-	/*Assign output pointers:*/
+-	m[0]=m1;
+-	m[1]=m2;
+-	m[2]=m3;
+-} /*}}}*/
+-void ConserveOceanMass(FemModel* femmodel,Vector<IssmDouble>* sealevelloads, Vector<IssmDouble>* subelementsealevelloads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
+-
+-	/*Shift sealevel loads by ocean average, only on ocean! :*/
+-	for(Object* & object : femmodel->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeShift(sealevelloads,subelementsealevelloads,offset,slgeom);
+-	}
+-	sealevelloads->Assemble();
+-	subelementsealevelloads->Assemble();
+-
+-} /*}}}*/
+-IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel){ /*{{{*/
+-
+-	int* indices=xNew<int>(nel);
+-	for(int i=0;i<nel;i++)indices[i]=i;
+-	
+-	Vector<IssmDouble>* vloadcopy=new Vector<IssmDouble>(nel);
+-	IssmDouble* loadcopy=xNew<IssmDouble>(nel);
+-	
+-	vloadcopy->SetValues(nel,indices,load,INS_VAL);
+-	vloadcopy->Assemble();
+-
+-
+-	if(subload){
+-		for (int i=0;i<femmodel->elements->Size();i++){
+-			if (slgeom->issubelement[loadtype][i]){
+-				int se= slgeom->subelementmapping[loadtype][i];
+-				IssmDouble subloadi=subload[se];
+-				Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
+-				vloadcopy->SetValue(element->Sid(),subloadi,ADD_VAL);
+-			}
+-		}
+-	}
+-	vloadcopy->Assemble();
+-	loadcopy=vloadcopy->ToMPISerial();
+-
+-	return loadcopy;
+-
+-} /*}}}*/
+-
Index: /issm/oecreview/Archive/25834-26739/ISSM-26227-26228.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26227-26228.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26227-26228.diff	(revision 26740)
@@ -0,0 +1,27 @@
+Index: ../trunk-jpl/src/m/contrib/tsantos/integrate_field.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/tsantos/integrate_field.m	(nonexistent)
++++ ../trunk-jpl/src/m/contrib/tsantos/integrate_field.m	(revision 26228)
+@@ -0,0 +1,22 @@
++function total=integrate_field(index,x,y,field)
++%INTEGRATE_FIELD: integrate a field over a 2D mesh
++%
++%   Usage:
++%      total=integrate_field(index,x,y,field);
++%
++%   Examples:
++%      volume=integrate_field(md.mesh.elements,md.mesh.x,md.mesh.y,md.geometry.thickness);
++
++% areas of each element
++x1=x(index(:,1)); x2=x(index(:,2)); x3=x(index(:,3));
++y1=y(index(:,1)); y2=y(index(:,2)); y3=y(index(:,3));
++areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)));
++
++% element-wise integration
++v1=index(:,1);	v2=index(:,2);	v3=index(:,3);
++elem_int=areas.*mean(field([v1 v2 v3]),2);
++
++% compute integration
++total=sum(elem_int);
++
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26228-26229.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26228-26229.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26228-26229.diff	(revision 26740)
@@ -0,0 +1,98 @@
+Index: ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 26228)
++++ ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 26229)
+@@ -32,7 +32,7 @@
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			disp(sprintf('   external (offlinesolidearthsolution) solution:'));
+-			WriteData(fid,prefix,'object',self,'data',2,'name','md.solidearth.external.nature','format','Integer'); %code 1 for offlinesolidearthsolution  class
++			WriteData(fid,prefix,'data',2,'name','md.solidearth.external.nature','format','Integer'); %code 1 for offlinesolidearthsolution  class
+ 			self.marshall@solidearthsolution(prefix,md,fid);
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26228)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26229)
+@@ -14,8 +14,8 @@
+ 		ocean_area_scaling     = 0;
+ 		runfrequency           = 1; %how many time steps we skip before we run grd_core
+ 		computesealevelchange  = 1; %will sea-level be coputed? 
+-		isgrd                  = 1; %will GRD patterns be computed? 
+-		compute_bp_grd         = 1; %will GRD patterns for bottom pressures be computed? 
++		isgrd                  = 0; %will GRD patterns be computed? 
++		compute_bp_grd         = 0; %will GRD patterns for bottom pressures be computed? 
+ 		degacc                 = 0; %degree increment for resolution of Green tables
+ 		horiz                  = 0; %compute horizontal deformation
+ 		grdmodel               = 0; %grd model (0 by default, 1 for elastic, 2 for Ivins)
+@@ -44,7 +44,7 @@
+ 		self.elastic=1;
+ 		self.rotation=1;
+ 		self.ocean_area_scaling=0;
+-		self.compute_bp_grd=1;
++		self.compute_bp_grd=0;
+ 		self.isgrd=0;
+ 		self.computesealevelchange=1;
+ 
+@@ -75,7 +75,7 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.runfrequency','size',[1 1],'>=',1);
+ 			md = checkfield(md,'fieldname','solidearth.settings.degacc','size',[1 1],'>=',1e-10);
+ 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
+-			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','values',[1 2]);
++			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','>=',0,'<=',2);
+ 			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
+ 
+ 			%checks on computational flags
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26228)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26229)
+@@ -51,21 +51,33 @@
+ 			yts=md.constants.yts;
+ 
+ 			%transform our time series into time series rates 
+-			time=self.displacementeast(end,:);
+-			dt=diff(time,1,2);
++			if size(self.displacementeast,2)==1
++				disp('External solidearthsolution warning: only one time step provided, assuming the values are rates per year');
++				displacementeast_rate=[self.displacementeast;0];
++				displacementnorth_rate=[self.displacementnorth;0];
++				displacementup_rate=[self.displacementup;0];
++				geoid_rate=[self.geoid;0];
++				barystaticsealevel_rate=[self.barystaticsealevel;0];
++			else
++				time=self.displacementeast(end,:);
++				dt=diff(time,1,2);
++				displacementeast_rate=diff(self.displacementeast(1:end-1,:),1,2)./dt;
++				displacementeast_rate(end+1,:)=time(1:end-1);
++				displacementnorth_rate=diff(self.displacementnorth(1:end-1,:),1,2)./dt;
++				displacementnorth_rate(end+1,:)=time(1:end-1);
++				displacementup_rate=diff(self.displacementup(1:end-1,:),1,2)./dt;
++				displacementup_rate(end+1,:)=time(1:end-1);
++				geoid_rate=diff(self.geoid(1:end-1,:),1,2)./dt;
++				geoid_rate(end+1,:)=time(1:end-1);
++				barystaticsealevel_rate=diff(self.barystaticsealevel(1:end-1,:),1,2)./dt;
++				barystaticsealevel_rate(end+1,:)=time(1:end-1);
++			end
++			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','data',barystaticsealevel_rate,'format','DoubleMat','name', 'md.solidearth.external.barystaticsealevel','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			
+-			displacementeast_rate=diff(displacementeast(1:end-1,:),1,2)./dt;
+-			displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
+-			displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
+-			geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
+-			barystaticsealevel_rate=diff(barystaticsealevel(1:end-1,:),1,2)./dt;
+-
+-			WriteData(fid,prefix,'name','md.solidearth.external.displacementeast','data',displacementeast_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'name','md.solidearth.external.displacementup','data',displacementup_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'name','md.solidearth.external.displacementnorth','data',displacementnorth_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'name','md.solidearth.external.geoid','data',geoid_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'name','md.solidearth.external.barystaticsealevel','data',barystaticsealevel_rate,'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-	
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 			writejs1Darray(fid,[modelname '.solidearth.external.displacementeast'],self.displacementeast);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26229-26230.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26229-26230.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26229-26230.diff	(revision 26740)
@@ -0,0 +1,387 @@
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.h	(revision 26229)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.h	(revision 26230)
+@@ -34,8 +34,9 @@
+ 		int*        subelementmapping[SLGEOM_NUMLOADS];
+ 		int         nsubel[SLGEOM_NUMLOADS];
+ 		int         nbar[SLGEOM_NUMLOADS];
++		int*        lids; 
+ 		
+-		SealevelGeometry(int localnel);
++		SealevelGeometry(int localnel,int localnods);
+ 		~SealevelGeometry();
+ 		void InitializeMappingsAndBarycentres(void);
+ 		void Assemble(void);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26229)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26230)
+@@ -396,7 +396,8 @@
+ 		virtual void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+ 		virtual void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae)=0;
+ 		virtual void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom)=0;
+-		virtual void       SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
+ 		#endif
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26229)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26230)
+@@ -229,7 +229,8 @@
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(GrdLoads* loads,  Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		#endif
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26229)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26230)
+@@ -184,7 +184,8 @@
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(GrdLoads* loads,  Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26229)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26230)
+@@ -191,7 +191,8 @@
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){_error_("not implemented yet");};
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26229)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26230)
+@@ -6304,8 +6304,6 @@
+ 	}
+ 	#endif
+ 	/*}}}*/
+-
+-	
+ 	return;
+ 
+ }
+@@ -6351,6 +6349,12 @@
+ 	slgeom->isoceanin[this->lid]=isocean; //keep track for later.
+ 	area=areae[this->sid];
+ 
++	/*Compute element ids, used to speed up computations in convolution phase:{{{*/
++	for(int i=0;i<NUMVERTICES;i++){
++		slgeom->lids[this->vertices[i]->lid]=this->lid;
++	}
++	/*}}}*/
++
+ 	/*set barycentre for all elements, to be updated for fractional loads in the next routine: */
+ 	//late= asin(zze[this->sid]/planetradius)*180.0/M_PI;
+ 	late= asin(zze[this->sid]/sqrt( pow(xxe[this->sid],2.0)+ pow(yye[this->sid],2.0)+ pow(zze[this->sid],2.0)))*180.0/M_PI;
+@@ -6883,7 +6887,7 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*sal green function:*/
+ 	IssmDouble* G=NULL;
+@@ -6895,6 +6899,7 @@
+ 	
+ 	bool sal = false;
+ 	bool rotation= false;
++	bool percpu= false;
+ 	int  size;
+ 	int  nel,nbar;
+ 	IssmDouble Grotm1[3];
+@@ -6906,26 +6911,42 @@
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+ 
++	if(sal){
++		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&Gsub[SLGEOM_ICE],&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
++		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
++
++		this->SealevelchangeGxL(sealevelpercpu, G, Gsub, loads, slgeom, nel,percpu=true);
++	}
++
+ 	if(rotation){
+ 		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
+ 		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
+ 		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
+ 		
+-		for(int i=0;i<NUMVERTICES;i++) SealevelGRD[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++		for(int i=0;i<NUMVERTICES;i++){
++			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
++				sealevelpercpu[this->vertices[i]->lid]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++			}
++		}
+ 	}
++	return;
++} /*}}}*/
++void       Tria::SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){ /*{{{*/
+ 
+-	if(sal){
+-		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelIceEnum,this->lid,&Gsub[SLGEOM_ICE],&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
+-		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
++	/*sal green function:*/
++	IssmDouble* G=NULL;
++	IssmDouble* Gsub[SLGEOM_NUMLOADS];
++	IssmDouble oceanaverage=0;
++	IssmDouble oceanarea=0;
++	IssmDouble rho_water;
++	
++	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+ 
+-		this->SealevelchangeGxL(&SealevelGRD[0],G, Gsub, loads, slgeom, nel);
+-	}
+-
+ 	/*retrieve ocean average and area:*/
+ 	for(int i=0;i<NUMVERTICES;i++){
+-		oceanaverage+=SealevelGRD[i]*slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid];
++		oceanaverage+=sealevelpercpu[this->vertices[i]->lid]*slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid];
+ 	}
+ 	#ifdef _ISSM_DEBUG_ 
+ 	this->AddInput(SealevelBarystaticOceanLoadEnum,&oceanaverage,P0Enum);
+@@ -6939,6 +6960,7 @@
+ 	}
+ 	else loads->vsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+ 
++	/*add ocean area into a global oceanareas vector:*/
+ 	if(!loads->sealevelloads){
+ 		oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
+ 		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+@@ -6946,7 +6968,6 @@
+ 			subelementoceanareas->SetValue(intj,oceanarea,INS_VAL);
+ 		}
+ 	}
+-
+ 	
+ 	return;
+ } /*}}}*/
+@@ -6975,6 +6996,7 @@
+ 	IssmDouble Grotm3[3];
+ 	bool rotation= false;
+ 	bool elastic=false;
++	bool percpu=false;
+ 
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
+@@ -6982,14 +7004,8 @@
+ 	this->parameters->FindParam(&elastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 
+-	if(rotation){
+-		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
+-		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
+-		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
++	
+ 		
+-		for(int i=0;i<NUMVERTICES;i++) SealevelRSL[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
+-	}
+-		
+ 	if(sal){
+ 
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+@@ -7015,17 +7031,29 @@
+ 			}
+ 		}
+ 
+-		this->SealevelchangeGxL(&SealevelRSL[0],G, Gsub, loads, slgeom, nel);
++		this->SealevelchangeGxL(&SealevelRSL[0],G, Gsub, loads, slgeom, nel,percpu=false);
+ 
+ 		if(elastic){
+-			this->SealevelchangeGxL(&SealevelU[0],GU, GUsub, loads, slgeom, nel);
++			this->SealevelchangeGxL(&SealevelU[0],GU, GUsub, loads, slgeom, nel,percpu=false);
+ 			if(horiz ){
+-				this->SealevelchangeGxL(&SealevelN[0],GN, GNsub, loads, slgeom, nel);
+-				this->SealevelchangeGxL(&SealevelE[0],GE, GEsub, loads, slgeom, nel);
++				this->SealevelchangeGxL(&SealevelN[0],GN, GNsub, loads, slgeom, nel,percpu=false);
++				this->SealevelchangeGxL(&SealevelE[0],GE, GEsub, loads, slgeom, nel,percpu=false);
+ 			}
+ 		}
+ 	}
+ 
++	if(rotation){
++		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
++		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
++		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
++		
++		for(int i=0;i<NUMVERTICES;i++){
++			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
++				SealevelRSL[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++			}
++		}
++	}
++
+ 	/*Create geoid: */
+ 	for(int i=0;i<NUMVERTICES;i++)Sealevel[i]=SealevelU[i]+SealevelRSL[i];
+ 	
+@@ -7039,10 +7067,13 @@
+ 
+ 
+ } /*}}}*/
+-void       Tria::SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel) { /*{{{*/
++void       Tria::SealevelchangeGxL(IssmDouble* sealevelout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu) { /*{{{*/
+ 
++	IssmDouble sealevel[3]={0};
++
+ 	if(loads->sealevelloads){
+ 		for(int i=0;i<NUMVERTICES;i++) {
++			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 			for (int e=0;e<nel;e++){
+ 				sealevel[i]+=G[i*nel+e]*(loads->sealevelloads[e]+loads->loads[e]);
+ 			}
+@@ -7061,6 +7092,7 @@
+ 	}
+ 	else{  //this is the initial convolution where only loads are provided
+ 		for(int i=0;i<NUMVERTICES;i++) {
++			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 			for (int e=0;e<nel;e++){
+ 				sealevel[i]+=G[i*nel+e]*(loads->loads[e]);
+ 			}
+@@ -7073,6 +7105,16 @@
+ 		}
+ 	}
+ 
++	/*store values computed on vertices, but don't repeat the computation if another element already computed it!:*/
++	if(percpu){
++		for(int i=0;i<NUMVERTICES;i++){
++			if(slgeom->lids[this->vertices[i]->lid]==this->lid)sealevelout[this->vertices[i]->lid]=sealevel[i];
++		}
++	}
++	else{
++		for(int i=0;i<NUMVERTICES;i++) sealevelout[i]=sealevel[i];
++	}
++
+ } /*}}}*/
+ void       Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){/*{{{*/
+ 		
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26229)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26230)
+@@ -173,7 +173,8 @@
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae);
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom);
+-		void       SealevelchangeConvolution(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* rotationvector,SealevelGeometry* slgeom);
++		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
++		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom);
+ 		void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
+ 		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom);
+ 		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom);
+@@ -241,7 +242,7 @@
+ 		void           StabilizationParameterAnisotropic(IssmDouble* tau_parameter_ansiotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
+ 		void           UpdateConstraintsExtrudeFromBase(void);
+ 		void           UpdateConstraintsExtrudeFromTop(void);
+-		void           SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel);
++		void           SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool optimize);
+ 		/*}}}*/
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26229)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26230)
+@@ -16,7 +16,7 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-SealevelGeometry::SealevelGeometry(int localnelin){ /*{{{*/
++SealevelGeometry::SealevelGeometry(int localnelin,int localnodsin){ /*{{{*/
+ 	localnel=localnelin;
+ 	for(int i=0;i<SLGEOM_NUMLOADS;i++){
+ 		for (int j=0;j<SLMAXVERTICES;j++){
+@@ -38,6 +38,7 @@
+ 	late=xNew<IssmDouble>(localnel);
+ 	longe=xNew<IssmDouble>(localnel);
+ 	isoceanin=xNew<bool>(localnel);
++	lids=xNew<int>(localnodsin);
+ 
+ }; /*}}}*/
+ SealevelGeometry::~SealevelGeometry(){ /*{{{*/
+@@ -58,6 +59,7 @@
+ 	xDelete<IssmDouble>(late);
+ 	xDelete<IssmDouble>(longe);
+ 	xDelete<bool>(isoceanin);
++	xDelete<int>(lids);
+ }; /*}}}*/
+ 
+ void SealevelGeometry::InitializeMappingsAndBarycentres(void){ /*{{{*/
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26229)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26230)
+@@ -244,6 +244,7 @@
+ 	int  grd=0;
+ 	int  grdmodel; 
+ 	int  computesealevel=0;
++	IssmDouble*           sealevelpercpu=NULL;
+ 
+ 	/*}}}*/
+ 
+@@ -291,6 +292,7 @@
+ 	loads=new GrdLoads(nel,slgeom);
+ 	subelementoceanareas=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+ 	oceanareas=new Vector<IssmDouble>(nel);
++	sealevelpercpu=xNewZeroInit<IssmDouble>(femmodel->vertices->Size());
+ 
+ 	if(VerboseSolution()) _printf0_("	  starting  GRD convolutions\n");
+ 
+@@ -321,8 +323,14 @@
+ 		/*convolve load and sealevel loads on oceans:*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelchangeConvolution(loads, oceanareas, subelementoceanareas, rotationaxismotionvector,slgeom);
++			element->SealevelchangeConvolution(sealevelpercpu, loads , rotationaxismotionvector,slgeom);
+ 		}
++		
++		/*retrieve sea level average  and ocean area:*/
++		for(Object* & object : femmodel->elements->objects){
++			Element* element = xDynamicCast<Element*>(object);
++			element->SealevelchangeOceanAverage(loads, oceanareas, subelementoceanareas, sealevelpercpu, slgeom);
++		}
+ 
+ 		loads->AssembleSealevelLoads();
+ 	
+@@ -534,7 +542,7 @@
+ 	/*retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 	nel=femmodel->elements->NumberOfElements();
+-	
++		
+ 	/*early return?:*/
+ 	if(grdmodel==IvinsEnum) return;
+ 
+@@ -593,7 +601,7 @@
+ 	femmodel->parameters->FindParam(&areae,&nel,AreaeEnum);
+ 	
+ 	/*initialize SealevelMasks structure: */
+-	slgeom=new SealevelGeometry(femmodel->elements->Size());
++	slgeom=new SealevelGeometry(femmodel->elements->Size(),femmodel->vertices->Size());
+ 	
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing sea level geometrical kernel and weight updates.\n");
Index: /issm/oecreview/Archive/25834-26739/ISSM-26230-26231.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26230-26231.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26230-26231.diff	(revision 26740)
@@ -0,0 +1,77 @@
+Index: ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m	(revision 26230)
++++ ../trunk-jpl/src/m/classes/additionalsolidearthsolution.m	(revision 26231)
+@@ -31,7 +31,7 @@
+ 			self.disp@solidearthsolution();
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-			WriteData(fid,prefix,'object',self,'data',1,'name','md.solidearth.external.nature','format','Integer'); %code 1 for additionalsolidearthsolution  class
++			WriteData(fid,prefix,'data',1,'name','md.solidearth.external.nature','format','Integer'); %code 1 for additionalsolidearthsolution class
+ 			self.marshall@solidearthsolution(prefix,md,fid);
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+Index: ../trunk-jpl/src/m/classes/dslmme.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.m	(revision 26230)
++++ ../trunk-jpl/src/m/classes/dslmme.m	(revision 26231)
+@@ -36,6 +36,7 @@
+ 			%Early return
+ 			if ~ismember('SealevelchangeAnalysis',analyses), return; end
+ 			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
++			if (md.transient.isoceantransport==0) return;end
+ 			for i=1:length(self.global_average_thermosteric_sea_level),
+ 				md = checkfield(md,'field',self.global_average_thermosteric_sea_level{i},'NaN',1,'Inf',1);
+ 				md = checkfield(md,'field',self.sea_surface_height_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+Index: ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 26230)
++++ ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 26231)
+@@ -32,7 +32,7 @@
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			disp(sprintf('   external (offlinesolidearthsolution) solution:'));
+-			WriteData(fid,prefix,'data',2,'name','md.solidearth.external.nature','format','Integer'); %code 1 for offlinesolidearthsolution  class
++			WriteData(fid,prefix,'data',2,'name','md.solidearth.external.nature','format','Integer'); %code 2 for offlinesolidearthsolution  class
+ 			self.marshall@solidearthsolution(prefix,md,fid);
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+Index: ../trunk-jpl/src/m/classes/dsl.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.m	(revision 26230)
++++ ../trunk-jpl/src/m/classes/dsl.m	(revision 26231)
+@@ -38,6 +38,7 @@
+ 			%Early return
+ 			if ~ismember('SealevelchangeAnalysis',analyses), return; end
+ 			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
++			if (md.transient.isoceantransport==0) return;end
+ 			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level','NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','dsl.sea_surface_height_above_geoid','NaN',1,'Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
+Index: ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 26230)
++++ ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 26231)
+@@ -67,7 +67,8 @@
+ 			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-			WriteData(fid,prefix,'object',self,'data',3,'name','md.solidearth.external.nature','format','Integer'); %code 3 for mmeadditionalsolidearthsolution  class
++			WriteData(fid,prefix,'data',3,'name','md.solidearth.external.nature','format','Integer'); %code 3 for mmeadditionalsolidearthsolution class
++
+ 			nummodels=length(self.displacementeast);
+ 			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+Index: ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 26230)
++++ ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 26231)
+@@ -67,7 +67,7 @@
+ 			fielddisplay(self,'modelid','index into the multi-model ensemble, determines which field will be used.');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-			WriteData(fid,prefix,'object',self,'data',4,'name','md.solidearth.external.nature','format','Integer'); %code 4 for mmeofflinesolidearthsolution  class
++			WriteData(fid,prefix,'data',4,'name','md.solidearth.external.nature','format','Integer'); %code 4 for mmeofflinesolidearthsolution class
+ 			WriteData(fid,prefix,'object',self,'fieldname','modelid','format','Double');
+ 			nummodels=length(self.displacementeast);
+ 			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26231-26232.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26231-26232.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26231-26232.diff	(revision 26740)
@@ -0,0 +1,166 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26231)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26232)
+@@ -6132,13 +6132,15 @@
+ 	/*Rotational:*/
+ 	IssmDouble* tide_love_h  = NULL;
+ 	IssmDouble* tide_love_k  = NULL;
+-	IssmDouble* load_love_k  = NULL;
+-	IssmDouble  tide_love_k2secular;
++	IssmDouble* tide_love_l  = NULL;
+ 	IssmDouble  moi_e, moi_p, omega;
+-	IssmDouble Grotm1[3];
+-	IssmDouble Grotm2[3];
+-	IssmDouble Grotm3[3];
+-	IssmDouble pre;
++	IssmDouble  Grotm1[3],GUrotm1[3],GNrotm1[3],GErotm1[3];
++	IssmDouble  Grotm2[3],GUrotm2[3],GNrotm2[3],GErotm2[3];
++	IssmDouble  Grotm3[3],GUrotm3[3],GNrotm3[3],GErotm3[3];
++	IssmDouble  Y21cos     , Y21sin     , Y20;
++	IssmDouble dY21cos_dlat,dY21sin_dlat,dY20_dlat;
++	IssmDouble dY21cos_dlon,dY21sin_dlon;
++	IssmDouble LoveRotRSL,LoveRotU,LoveRothoriz;
+ 	/*}}}*/
+ 	/*Recover parameters:{{{ */
+ 	rho_earth=FindParam(MaterialsEarthDensityEnum);
+@@ -6152,10 +6154,9 @@
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 
+ 	if(computerotation){
+-		parameters->FindParam(&load_love_k,NULL,NULL,LoadLoveKEnum);
+ 		parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
+ 		parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
+-		parameters->FindParam(&tide_love_k2secular,TidalLoveK2SecularEnum);
++		parameters->FindParam(&tide_love_l,NULL,NULL,TidalLoveLEnum);
+ 		parameters->FindParam(&moi_e,RotationalEquatorialMoiEnum);
+ 		parameters->FindParam(&moi_p,RotationalPolarMoiEnum);
+ 		parameters->FindParam(&omega,RotationalAngularVelocityEnum);
+@@ -6269,18 +6270,63 @@
+ 		/*What is the gravity at planet's surface: */
+ 		g=4.0/3.0*M_PI*rho_earth*NewtonG*planetradius;
+ 
++		//Amplitude of the rotational feedback
++		LoveRotRSL=((1.0+tide_love_k[2]-tide_love_h[2])/g)*pow(omega*planetradius,2.0);
++		LoveRotU=(tide_love_h[2]/g)*pow(omega*planetradius,2.0);
++		LoveRothoriz=(tide_love_l[2]/g)*pow(omega*planetradius,2.0);
++
+ 		for(int i=0;i<3;i++){
+ 			lati=latitude[i];
+ 			longi=longitude[i];
+ 
+-			pre=((1.0+tide_love_k[2]-tide_love_h[2])/g)*pow(omega*planetradius,2.0);
+-			Grotm1[i]= - pre* 0.5*sin(2.*lati)*cos(longi);
+-			Grotm2[i]= - pre* 0.5*sin(2.*lati)*sin(longi);
+-			Grotm3[i]= - pre* (1.0/6.0 - 0.5*cos(2.0*lati));
++			//Spherical harmonic functions of degree 2
++			Y21cos= -0.5*sin(2.*lati)*cos(longi);
++			Y21sin= -0.5*sin(2.*lati)*sin(longi);
++			Y20   = -(1.0/6.0 - 0.5*cos(2.0*lati));
++
++			Grotm1[i]=  LoveRotRSL*Y21cos;
++			Grotm2[i]=  LoveRotRSL*Y21sin;
++			Grotm3[i]=  LoveRotRSL*Y20;
++
++			if (computeelastic){
++				GUrotm1[i]=  LoveRotU*Y21cos;
++				GUrotm2[i]=  LoveRotU*Y21sin;
++				GUrotm3[i]=  LoveRotU*Y20;
++				if (horiz){
++				//bed_N = Love_l * d(Y)/dlat ;
++				dY21cos_dlat=-cos(2.*lati)*cos(longi);
++				dY21sin_dlat=-cos(2.*lati)*sin(longi);
++				dY20_dlat=-sin(2.0*lati);
++				GNrotm1[i]=  LoveRothoriz*dY21cos_dlat;
++				GNrotm2[i]=  LoveRothoriz*dY21sin_dlat;
++				GNrotm3[i]=  LoveRothoriz*dY20_dlat;
++
++				//bed_E = Love_l * 1/cos(lat) * d(Y)/dlon ;
++				dY21cos_dlon=-Y21sin;
++				dY21sin_dlon=Y21cos;
++				//dY20_dlon=0.;
++				GNrotm1[i]=  LoveRothoriz*dY21cos_dlon/cos(lati);
++				GNrotm2[i]=  LoveRothoriz*dY21sin_dlon/cos(lati);
++				GNrotm3[i]=  0.0;
++				}
++			}
+ 		}
+ 		this->AddInput(SealevelGrotm1Enum,&Grotm1[0],P1Enum);
+ 		this->AddInput(SealevelGrotm2Enum,&Grotm2[0],P1Enum);
+ 		this->AddInput(SealevelGrotm3Enum,&Grotm3[0],P1Enum);
++		if (computeelastic){
++			this->AddInput(SealevelGUrotm1Enum,&GUrotm1[0],P1Enum);
++			this->AddInput(SealevelGUrotm2Enum,&GUrotm2[0],P1Enum);
++			this->AddInput(SealevelGUrotm3Enum,&GUrotm3[0],P1Enum);
++			if(horiz){
++				this->AddInput(SealevelGNrotm1Enum,&GNrotm1[0],P1Enum);
++				this->AddInput(SealevelGNrotm2Enum,&GNrotm2[0],P1Enum);
++				this->AddInput(SealevelGNrotm3Enum,&GNrotm3[0],P1Enum);
++				this->AddInput(SealevelGErotm1Enum,&GErotm1[0],P1Enum);
++				this->AddInput(SealevelGErotm2Enum,&GErotm2[0],P1Enum);
++				this->AddInput(SealevelGErotm3Enum,&GErotm3[0],P1Enum);
++			}
++		}
+ 	}
+ 	/*}}}*/
+ 	/*Free allocations:{{{*/
+@@ -6994,6 +7040,15 @@
+ 	IssmDouble Grotm1[3];
+ 	IssmDouble Grotm2[3];
+ 	IssmDouble Grotm3[3];
++	IssmDouble GUrotm1[3];
++	IssmDouble GUrotm2[3];
++	IssmDouble GUrotm3[3];
++	IssmDouble GNrotm1[3];
++	IssmDouble GNrotm2[3];
++	IssmDouble GNrotm3[3];
++	IssmDouble GErotm1[3];
++	IssmDouble GErotm2[3];
++	IssmDouble GErotm3[3];
+ 	bool rotation= false;
+ 	bool elastic=false;
+ 	bool percpu=false;
+@@ -7052,6 +7107,33 @@
+ 				SealevelRSL[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
+ 			}
+ 		}
++
++		if (elastic){
++			Element::GetInputListOnVertices(&GUrotm1[0],SealevelGUrotm1Enum);
++			Element::GetInputListOnVertices(&GUrotm2[0],SealevelGUrotm2Enum);
++			Element::GetInputListOnVertices(&GUrotm3[0],SealevelGUrotm3Enum);
++		
++			for(int i=0;i<NUMVERTICES;i++){
++				if(slgeom->lids[this->vertices[i]->lid]==this->lid){
++					SealevelU[i]+=GUrotm1[i]*rotationvector[0]+GUrotm2[i]*rotationvector[1]+GUrotm3[i]*rotationvector[2];
++				}
++			}
++			if (horiz){
++				Element::GetInputListOnVertices(&GNrotm1[0],SealevelGNrotm1Enum);
++				Element::GetInputListOnVertices(&GNrotm2[0],SealevelGNrotm2Enum);
++				Element::GetInputListOnVertices(&GNrotm3[0],SealevelGNrotm3Enum);
++				Element::GetInputListOnVertices(&GErotm1[0],SealevelGErotm1Enum);
++				Element::GetInputListOnVertices(&GErotm2[0],SealevelGErotm2Enum);
++				Element::GetInputListOnVertices(&GErotm3[0],SealevelGErotm3Enum);
++		
++				for(int i=0;i<NUMVERTICES;i++){
++					if(slgeom->lids[this->vertices[i]->lid]==this->lid){
++						SealevelN[i]+=GNrotm1[i]*rotationvector[0]+GNrotm2[i]*rotationvector[1]+GNrotm3[i]*rotationvector[2];
++						SealevelE[i]+=GErotm1[i]*rotationvector[0]+GErotm2[i]*rotationvector[1]+GErotm3[i]*rotationvector[2];
++					}
++				}
++			}
++		}
+ 	}
+ 
+ 	/*Create geoid: */
+@@ -7061,8 +7143,8 @@
+ 	this->AddInput(SealevelGRDEnum,Sealevel,P1Enum);
+ 	this->AddInput(BedGRDEnum,SealevelU,P1Enum);
+ 	if(horiz){
++		this->AddInput(BedNorthGRDEnum,SealevelN,P1Enum);
+ 		this->AddInput(BedEastGRDEnum,SealevelE,P1Enum);
+-		this->AddInput(BedNorthGRDEnum,SealevelN,P1Enum);
+ 	}
+ 
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26232-26233.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26232-26233.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26232-26233.diff	(revision 26740)
@@ -0,0 +1,319 @@
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26232)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26233)
+@@ -249,15 +249,25 @@
+ 	LevelsetStabilizationEnum,
+ 	LockFileNameEnum,
+ 	LoveAllowLayerDeletionEnum,
++	LoveCoreMantleBoundaryEnum,
++	LoveEarthMassEnum,
+ 	LoveForcingTypeEnum,
+ 	LoveFrequenciesEnum,
++	LoveIsTemporalEnum,
+ 	LoveG0Enum,
++	LoveGravitationalConstantEnum,
++	LoveInnerCoreBoundaryEnum,
++	LoveIntStepsPerLayerEnum,
+ 	LoveKernelsEnum,
+ 	LoveMu0Enum,
+ 	LoveNfreqEnum,
++	LoveNTemporalIterationsEnum,
++	LoveNYiEquationsEnum,
+ 	LoveR0Enum,
+ 	LoveShNmaxEnum,
+ 	LoveShNminEnum,
++	LoveStartingLayerEnum,
++	LoveUnderflowTolEnum,
+ 	MassFluxSegmentsEnum,
+ 	MassFluxSegmentsPresentEnum,
+ 	MasstransportHydrostaticAdjustmentEnum,
+@@ -778,6 +788,15 @@
+ 	SealevelGrotm1Enum,
+ 	SealevelGrotm2Enum,
+ 	SealevelGrotm3Enum,
++	SealevelGUrotm1Enum,
++	SealevelGUrotm2Enum,
++	SealevelGUrotm3Enum,
++	SealevelGNrotm1Enum,
++	SealevelGNrotm2Enum,
++	SealevelGNrotm3Enum,
++	SealevelGErotm1Enum,
++	SealevelGErotm2Enum,
++	SealevelGErotm3Enum,
+ 	SealevelRSLBarystaticEnum,
+ 	SealevelRSLRateEnum,
+ 	SealevelUGrdEnum,
+Index: ../trunk-jpl/src/m/classes/fourierlove.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26232)
++++ ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26233)
+@@ -5,16 +5,24 @@
+ 
+ classdef fourierlove
+ 	properties (SetAccess=public) 
+-		nfreq                = 0;
+-		frequencies          = 0;
+-		sh_nmax              = 0;
+-		sh_nmin              = 0;
+-		g0                   = 0;
+-		r0                   = 0;
+-		mu0                  = 0;
+-		allow_layer_deletion = 0;
+-		love_kernels         = 0;
+-		forcing_type         = 0;
++		nfreq                      = 0;
++		frequencies                = 0;
++		sh_nmax                    = 0;
++		sh_nmin                    = 0;
++		g0                         = 0;
++		r0                         = 0;
++		mu0                        = 0;
++		Gravitational_Constant     = 0;
++		allow_layer_deletion       = 0;
++		underflow_tol              = 0;
++		integration_steps_per_layer= 0;
++		istemporal		   = 0;
++		n_temporal_iterations	   = 0;
++		time			   = 0;
++		love_kernels               = 0;
++		forcing_type               = 0;
++		inner_core_boundary	   = 0;
++		core_mantle_boundary	   = 0;
+ 	end
+ 	methods (Static)
+ 		function self = loadobj(self) % {{{
+@@ -43,9 +51,17 @@
+ 			self.g0=9.81; % m/s^2; 
+ 			self.r0=6371*1e3; %m;
+ 			self.mu0=10^11; % Pa
+-			self.allow_layer_deletion=1; 
++			self.Gravitational_Constant=6.67259e-11; % m^3 kg^-1 s^-2
++			self.allow_layer_deletion=1;
++			self.underflow_tol=1e-16; %threshold of deep to surface love number ratio to trigger the deletion of layer 
++			self.integration_steps_per_layer=100;
++			self.istemporal=0;
++			self.n_temporal_iterations=8;
++			self.time=[0]; %s
+ 			self.love_kernels=0; 
+-			self.forcing_type = 11; 
++			self.forcing_type = 11; % surface loading
++			self.inner_core_boundary=1;
++			self.core_mantle_boundary=2;
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]');
+@@ -53,11 +69,19 @@
+ 			fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)');
+ 			fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default 1)');
+ 			fielddisplay(self,'g0','adimensioning constant for gravity (default 10) [m/s^2]');
+-			fielddisplay(self,'r0','adimensioning constant for radius (default 6378*10^3) [m]');
++			fielddisplay(self,'r0','adimensioning constant for radius (default 6371*10^3) [m]');
+ 			fielddisplay(self,'mu0','adimensioning constant for stress (default 10^11) [Pa]');
++			fielddisplay(self,'Gravitational_Constant','Newtonian constant of gravitation (default 6.67259e-11 [m^3 kg^-1 s^-2])');
+ 			fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)');
++			fielddisplay(self,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default 2.2204460492503131E-016)');
++			fielddisplay(self,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default 100)');
++			fielddisplay(self,'istemporal',{'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency'});
++			fielddisplay(self,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default 8)');
++			fielddisplay(self,'time','time vector for deformation if istemporal (default 0) [s]');
+ 			fielddisplay(self,'love_kernels','compute love numbers at depth? (default 0)');
+-			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '}); 
++			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '});
++			fielddisplay(self,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default 1)');
++			fielddisplay(self,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default 2)'); 
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -71,10 +95,19 @@
+ 			md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
+ 			md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
+ 			md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
++			md = checkfield(md,'fieldname','love.Gravitational_Constant','NaN',1,'Inf',1,'numel',1,'>',0);
+ 			md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0 1]);
++			md = checkfield(md,'fieldname','love.underflow_tol','NaN',1,'Inf',1,'numel',1,'>',0);
++			md = checkfield(md,'fieldname','love.integration_steps_per_layer','NaN',1,'Inf',1,'numel',1,'>',0);
+ 			md = checkfield(md,'fieldname','love.love_kernels','values',[0 1]);
+ 			md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
+-			if md.love.sh_nmin<=1 & md.love.forcing_type==9
++
++			md = checkfield(md,'fieldname','love.istemporal','values',[0 1]);
++			if md.love.istemporal==1
++				md = checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
++				md = checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
++			end
++			if md.love.sh_nmin<=1 & (md.love.forcing_type==9 || md.love.forcing_type==5 || md.love.forcing_type==1)
+ 				error('Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.')
+ 			end
+ 
+@@ -83,6 +116,13 @@
+ 				error('Need a ''litho'' material to run a Fourier Love number analysis');
+ 			end
+ 
++			mat=find(strcmpi(md.materials.nature,'litho'));
++			if md.love.forcing_type<=4
++				md = checkfield(md,'fieldname','love.inner_core_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
++			elseif md.love.forcing_type<=8
++				md = checkfield(md,'fieldname','love.core_mantle_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
++			end
++
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 		
+@@ -93,13 +133,34 @@
+ 			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','Gravitational_Constant','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','underflow_tol','format','Double');
++			WriteData(fid,prefix,'object',self,'fieldname','integration_steps_per_layer','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','istemporal','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','n_temporal_iterations','format','Integer');
++			%note: no need to marshall the time vector, we have frequencies
+ 			WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','inner_core_boundary','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','core_mantle_boundary','format','Integer');
+ 
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 			error('not implemented yet!');
+ 		end % }}}
++		function self=build_frequencies_from_time(self) % {{{
++			if ~self.istemporal
++				error('cannot build frequencies for temporal love numbers if love.istemporal==0')
++			end
++			disp('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies');
++			self.nfreq=length(self.time)*2*self.n_temporal_iterations;
++			self.frequencies=zeros(self.nfreq,1);
++			for i=1:length(self.time)
++				for j=1:2*self.n_temporal_iterations
++					self.frequencies((i-1)*2*self.n_temporal_iterations +j) = j*log(2)/self.time(i)/2/pi;
++				end
++			end
++		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/lovenumbers.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26232)
++++ ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26233)
+@@ -56,6 +56,7 @@
+ 			
+ 			md = checkfield(md,'fieldname','solidearth.lovenumbers.th','NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk','NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','solidearth.lovenumbers.tl','NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk2secular','NaN',1,'Inf',1);
+ 
+ 			%check that love numbers are provided at the same level of accuracy: 
+@@ -77,6 +78,7 @@
+ 
+ 			fielddisplay(self,'th','tidal load Love number (deg 2)');
+ 			fielddisplay(self,'tk','tidal load Love number (deg 2)');
++			fielddisplay(self,'tl','tidal load Love number (deg 2)');
+ 			fielddisplay(self,'tk2secular','secular fluid Love number');
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 26232)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 26233)
+@@ -52,7 +52,11 @@
+ 					self.addprop('lame_mu');
+ 					self.addprop('burgers_viscosity');
+ 					self.addprop('burgers_mu');
+-					self.addprop('isburgers');
++					self.addprop('ebm_alpha');
++					self.addprop('ebm_delta');
++					self.addprop('ebm_taul');
++					self.addprop('ebm_tauh');
++					self.addprop('rheologymodel');
+ 					self.addprop('density');
+ 					self.addprop('issolid');
+ 				case 'hydro'
+@@ -135,7 +139,12 @@
+ 					self.lame_lambda=self.lame_mu;  % (Pa) %mantle and lithosphere lamba parameter (respectively) [Pa]
+ 					self.burgers_viscosity=[NaN;NaN];
+ 					self.burgers_mu=[NaN;NaN];
+-					self.isburgers=[0;0];
++
++					self.ebm_alpha=[NaN;NaN];
++					self.ebm_delta=[NaN;NaN];
++					self.ebm_taul=[NaN;NaN];
++					self.ebm_tauh=[NaN;NaN];
++					self.rheologymodel=[0;0];
+ 					self.density=[5.51*1e3;5.50*1e3];  % (Pa) %mantle and lithosphere density [kg/m^3]
+ 					self.issolid=[1;1]; % is layer solid or liquid.
+ 
+@@ -190,7 +199,14 @@
+ 					fielddisplay(self,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
+ 					fielddisplay(self,'burgers_viscosity','array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
+ 					fielddisplay(self,'burgers_mu','array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
+-					fielddisplay(self,'isburgers','array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)');
++
++					fielddisplay(self,'ebm_alpha','array describing each layer''s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
++					fielddisplay(self,'ebm_delta','array describing each layer''s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
++					fielddisplay(self,'ebm_taul','array describing each layer''s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
++					fielddisplay(self,'ebm_tauh','array describing each layer''s array describing each layer''s end period for transient relaxation, only for Burgers rheology  (numlayers) [s]');
++
++
++					fielddisplay(self,'rheologymodel','array describing whether we adopt a MaxWell (0), Burgers (1) or EBM (2) rheology (default 0)');
+ 					fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]');
+ 					fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
+ 				case 'hydro'
+@@ -227,14 +243,21 @@
+ 					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.rheologymodel','NaN',1,'Inf',1,'size',[md.materials.numlayers 1],'>=',0,'<=',2);
+ 					md = checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
+ 					md = checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
++					md = checkfield(md,'fieldname','materials.ebm_alpha','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
++					md = checkfield(md,'fieldname','materials.ebm_delta','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
++					md = checkfield(md,'fieldname','materials.ebm_taul','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
++					md = checkfield(md,'fieldname','materials.ebm_tauh','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
+ 
+ 					for i=1:md.materials.numlayers,
+-						if md.materials.isburgers(i) & (isnan(md.materials.burgers_viscosity(i) | isnan(md.materials.burgers_mu(i)))),
+-							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice');
++						if md.materials.rheologymodel(i)==1 & (isnan(md.materials.burgers_viscosity(i) | isnan(md.materials.burgers_mu(i)))),
++							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
+ 						end
++						if md.materials.rheologymodel(i)==2 & (isnan(md.materials.ebm_alpha(i)) | isnan(md.materials.ebm_delta(i)) | isnan(md.materials.ebm_taul(i)) | isnan(md.materials.ebm_tauh(i)) ),
++							error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
++						end
+ 					end
+ 					if md.materials.issolid(1)==0 | md.materials.lame_mu(1)==0
+ 							error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
+@@ -289,9 +312,13 @@
+ 					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','rheologymodel','format','DoubleMat','mattype',3);
+ 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3);
+ 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_alpha','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_delta','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_taul','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',self,'class','materials','fieldname','ebm_tauh','format','DoubleMat','mattype',3);
+ 					%compute earth density compatible with our layer density distribution: 
+ 					earth_density=0;
+ 					for i=1:self.numlayers,
+@@ -350,9 +377,13 @@
+ 					writejsdouble(fid,[modelname '.materials.issolid'],self.issolid);
+ 					writejsdouble(fid,[modelname '.materials.density'],self.density);
+ 					writejsdouble(fid,[modelname '.materials.viscosity'],self.viscosity);
+-					writejsdouble(fid,[modelname '.materials.isburgers'],self.isburgers);
++					writejsdouble(fid,[modelname '.materials.rheologymodel'],self.rheologymodel);
+ 					writejsdouble(fid,[modelname '.materials.burgers_viscosity'],self.burgers_viscosity);
+ 					writejsdouble(fid,[modelname '.materials.burgers_mu'],self.burgers_mu);
++					writejsdouble(fid,[modelname '.materials.ebm_alpha'],self.ebm_alpha);
++					writejsdouble(fid,[modelname '.materials.ebm_delta'],self.ebm_delta);
++					writejsdouble(fid,[modelname '.materials.ebm_taul'],self.ebm_taul);
++					writejsdouble(fid,[modelname '.materials.ebm_tauh'],self.ebm_tauh);
+ 
+ 				case 'hydro'
+ 					writejsdouble(fid,[modelname '.materials.rho_ice'],self.rho_ice);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26233-26234.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26233-26234.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26233-26234.diff	(revision 26740)
@@ -0,0 +1,208 @@
+Index: ../trunk-jpl/src/c/classes/Materials/Matlitho.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matlitho.cpp	(revision 26233)
++++ ../trunk-jpl/src/c/classes/Materials/Matlitho.cpp	(revision 26234)
+@@ -20,8 +20,12 @@
+ 	this->lame_mu=NULL;
+ 	this->burgers_viscosity=NULL;
+ 	this->burgers_mu=NULL;
++	this->ebm_alpha=NULL;
++	this->ebm_delta=NULL;	
++	this->ebm_taul=NULL;
++	this->ebm_tauh=NULL;
+ 	this->density=NULL;
+-	this->isburgers=NULL;
++	this->rheologymodel=NULL;
+ 	this->issolid=NULL;
+ 	return;
+ }
+@@ -28,7 +32,7 @@
+ /*}}}*/
+ Matlitho::Matlitho(int matlitho_mid, IoModel* iomodel){/*{{{*/
+ 
+-	IssmDouble* isburgersd=NULL;
++	IssmDouble* rheologymodeld=NULL;
+ 	IssmDouble* issolidd=NULL;
+ 
+ 	this->mid=matlitho_mid;
+@@ -52,19 +56,31 @@
+ 	this->burgers_mu=xNew<IssmDouble>(this->numlayers);
+ 	xMemCpy<IssmDouble>(this->burgers_mu, iomodel->Data("md.materials.burgers_mu"),this->numlayers);
+ 
++	this->ebm_alpha=xNew<IssmDouble>(this->numlayers);
++	xMemCpy<IssmDouble>(this->ebm_alpha, iomodel->Data("md.materials.ebm_alpha"),this->numlayers);
++
++	this->ebm_delta=xNew<IssmDouble>(this->numlayers);
++	xMemCpy<IssmDouble>(this->ebm_delta, iomodel->Data("md.materials.ebm_delta"),this->numlayers);
++
++	this->ebm_taul=xNew<IssmDouble>(this->numlayers);
++	xMemCpy<IssmDouble>(this->ebm_taul, iomodel->Data("md.materials.ebm_taul"),this->numlayers);
++
++	this->ebm_tauh=xNew<IssmDouble>(this->numlayers);
++	xMemCpy<IssmDouble>(this->ebm_tauh, iomodel->Data("md.materials.ebm_tauh"),this->numlayers);
++
+ 	this->density=xNew<IssmDouble>(this->numlayers);
+ 	xMemCpy<IssmDouble>(this->density, iomodel->Data("md.materials.density"),this->numlayers);
+ 
+-	this->isburgers=xNew<IssmDouble>(this->numlayers);
+-	xMemCpy<IssmDouble>(this->isburgers, iomodel->Data("md.materials.isburgers"),this->numlayers);
++	this->rheologymodel=xNew<IssmDouble>(this->numlayers);
++	xMemCpy<IssmDouble>(this->rheologymodel, iomodel->Data("md.materials.rheologymodel"),this->numlayers);
+ 
+ 	this->issolid=xNew<IssmDouble>(this->numlayers);
+ 	xMemCpy<IssmDouble>(this->issolid, iomodel->Data("md.materials.issolid"),this->numlayers);
+ 
+-	/*isburgersd= xNew<IssmDouble>(this->numlayers);
+-	this->isburgers=xNew<bool>(this->numlayers);
+-	xMemCpy<IssmDouble>(isburgersd, iomodel->Data("md.materials.isburgers"),this->numlayers);
+-	for (int i=0;i<this->numlayers;i++)this->isburgers[i]=reCast<bool,IssmDouble>(isburgersd[i]);
++	/*rheologymodeld= xNew<IssmDouble>(this->numlayers);
++	this->rheologymodel=xNew<bool>(this->numlayers);
++	xMemCpy<IssmDouble>(rheologymodeld, iomodel->Data("md.materials.rheologymodel"),this->numlayers);
++	for (int i=0;i<this->numlayers;i++)this->rheologymodel[i]=reCast<bool,IssmDouble>(rheologymodeld[i]);
+ 
+ 	issolidd= xNew<IssmDouble>(this->numlayers);
+ 	this->issolid=xNew<bool>(this->numlayers);
+@@ -72,7 +88,7 @@
+ 	for (int i=0;i<this->numlayers;i++)this->issolid[i]=reCast<bool,IssmDouble>(issolidd[i]);*/
+ 
+ 	/*free ressources: */
+-	xDelete<IssmDouble>(isburgersd);
++	xDelete<IssmDouble>(rheologymodeld);
+ 	xDelete<IssmDouble>(issolidd);
+ }
+ /*}}}*/
+@@ -84,8 +100,12 @@
+ 	xDelete<IssmDouble>(lame_mu);
+ 	xDelete<IssmDouble>(burgers_viscosity);
+ 	xDelete<IssmDouble>(burgers_mu);
++	xDelete<IssmDouble>(ebm_alpha);
++	xDelete<IssmDouble>(ebm_delta);
++	xDelete<IssmDouble>(ebm_taul);
++	xDelete<IssmDouble>(ebm_tauh);
+ 	xDelete<IssmDouble>(density);
+-	xDelete<IssmDouble>(isburgers);
++	xDelete<IssmDouble>(rheologymodel);
+ 	xDelete<IssmDouble>(issolid);
+ 
+ 	return;
+@@ -115,10 +135,14 @@
+ 		matlitho->lame_mu=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->lame_mu, this->lame_mu,this->numlayers);
+ 		matlitho->burgers_viscosity=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->burgers_viscosity, this->burgers_viscosity,this->numlayers);
+ 		matlitho->burgers_mu=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->burgers_mu, this->burgers_mu,this->numlayers);
++		matlitho->ebm_alpha=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_alpha, this->ebm_alpha,this->numlayers);
++		matlitho->ebm_delta=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_delta, this->ebm_delta,this->numlayers);
++		matlitho->ebm_taul=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_taul, this->ebm_taul,this->numlayers);
++		matlitho->ebm_tauh=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->ebm_tauh, this->ebm_tauh,this->numlayers);
+ 		matlitho->density=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->density, this->density,this->numlayers);
+-		matlitho->isburgers=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->isburgers, this->isburgers,this->numlayers);
++		matlitho->rheologymodel=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->rheologymodel, this->rheologymodel,this->numlayers);
+ 		matlitho->issolid=xNew<IssmDouble>(this->numlayers); xMemCpy<IssmDouble>(matlitho->issolid, this->issolid,this->numlayers);
+-		/*matlitho->isburgers=xNew<bool>(this->numlayers); for(int i=0;i<this->numlayers;i++)matlitho->isburgers[i]=this->isburgers[i]; 
++		/*matlitho->rheologymodel=xNew<bool>(this->numlayers); for(int i=0;i<this->numlayers;i++)matlitho->rheologymodel[i]=this->rheologymodel[i]; 
+ 		matlitho->issolid=xNew<bool>(this->numlayers); for(int i=0;i<this->numlayers;i++)matlitho->issolid[i]=this->issolid[i];*/ 
+ 	}
+ 
+@@ -135,9 +159,9 @@
+ 	_printf_("Matlitho:\n");
+ 	_printf_("   mid: " << mid << "\n");
+ 	_printf_("   numlayers: " << numlayers << "\n");
+-	_printf_("layer radius viscosity lame_lambda lame_mu burgers_viscosity burgers_mu density isburgers issolid\n");
++	_printf_("layer radius viscosity lame_lambda lame_mu burgers_viscosity burgers_mu ebm_alpha ebm_delta ebm_taul ebm_tauh density rheologymodel issolid\n");
+ 	for (int i=0;i<numlayers;i++){
+-		_printf_(i << " " << radius[i] << " " << viscosity[i] << " " << lame_lambda[i] << " " << lame_mu[i] << " " << burgers_viscosity[i] << " " << burgers_mu[i] << " " << density[i] << " " << isburgers[i] << " " << issolid[i]);
++		_printf_(i << " " << radius[i] << " " << viscosity[i] << " " << lame_lambda[i] << " " << lame_mu[i] << " " << burgers_viscosity[i] << " " << burgers_mu[i] << " " << ebm_alpha[i] << " " << ebm_delta[i] << " " << ebm_taul[i] << " " << ebm_tauh[i] << " " << density[i] << " " << rheologymodel[i] << " " << issolid[i]);
+ 	}
+ 	return;
+ }
+@@ -157,8 +181,12 @@
+ 		marshallhandle->call(this->lame_mu,numlayers);
+ 		marshallhandle->call(this->burgers_viscosity,numlayers);
+ 		marshallhandle->call(this->burgers_mu,numlayers);
++		marshallhandle->call(this->ebm_alpha,numlayers);
++		marshallhandle->call(this->ebm_delta,numlayers);
++		marshallhandle->call(this->ebm_taul,numlayers);
++		marshallhandle->call(this->ebm_tauh,numlayers);
+ 		marshallhandle->call(this->density,numlayers);
+-		marshallhandle->call(this->isburgers,numlayers);
++		marshallhandle->call(this->rheologymodel,numlayers);
+ 		marshallhandle->call(this->issolid,numlayers);
+ 	}
+ 	else{
+@@ -168,8 +196,12 @@
+ 		lame_mu           = NULL;
+ 		burgers_viscosity = NULL;
+ 		burgers_mu        = NULL;
++		ebm_alpha         = NULL;
++		ebm_delta         = NULL;
++		ebm_taul          = NULL;
++		ebm_tauh          = NULL;
+ 		density           = NULL;
+-		isburgers         = NULL;
++		rheologymodel     = NULL;
+ 		issolid           = NULL;
+ 	}
+ 
+Index: ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp	(revision 26233)
++++ ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp	(revision 26234)
+@@ -18,7 +18,6 @@
+ 
+ }/*}}}*/
+ void LoveAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+-
+ 	IssmDouble* frequencies = NULL;
+ 	int         nfreq;
+ 	iomodel->FetchData(&nfreq,"md.love.nfreq");
+@@ -32,9 +31,16 @@
+ 	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.Gravitational_Constant",LoveGravitationalConstantEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.love.allow_layer_deletion",LoveAllowLayerDeletionEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.love.underflow_tol",LoveUnderflowTolEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.love.integration_steps_per_layer",LoveIntStepsPerLayerEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.love.istemporal",LoveIsTemporalEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.love.n_temporal_iterations",LoveNTemporalIterationsEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.love.love_kernels",LoveKernelsEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.love.forcing_type",LoveForcingTypeEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.love.inner_core_boundary",LoveInnerCoreBoundaryEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.love.core_mantle_boundary",LoveCoreMantleBoundaryEnum));
+ }/*}}}*/
+ void LoveAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matlitho.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26233)
++++ ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26234)
+@@ -22,8 +22,12 @@
+ 		IssmDouble*  lame_mu;
+ 		IssmDouble*  burgers_viscosity;
+ 		IssmDouble*  burgers_mu;
++		IssmDouble*  ebm_alpha;
++		IssmDouble*  ebm_delta;
++		IssmDouble*  ebm_taul;
++		IssmDouble*  ebm_tauh;
+ 		IssmDouble*  density;
+-		IssmDouble*  isburgers;
++		IssmDouble*  rheologymodel;
+ 		IssmDouble*  issolid;
+ 
+ 		Matlitho();
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26233)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26234)
+@@ -197,9 +197,9 @@
+ 						break;
+ 					case MatlithoEnum:
+ 						{ /*{{{*/
+-							iomodel->FetchData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
++							iomodel->FetchData(13,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.ebm_alpha","md.materials.ebm_delta","md.materials.ebm_taul","md.materials.ebm_tauh","md.materials.rheologymodel","md.materials.issolid","md.materials.density");
+ 							materials->AddObject(new Matlitho(iomodel->numberofelements+1,iomodel));
+-							iomodel->DeleteData(9,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.isburgers","md.materials.issolid","md.materials.density");
++							iomodel->DeleteData(13,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.ebm_alpha","md.materials.ebm_delta","md.materials.ebm_taul","md.materials.ebm_tauh","md.materials.rheologymodel","md.materials.issolid","md.materials.density");
+ 						}
+ 						/*}}}*/
+ 						break;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26234-26235.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26234-26235.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26234-26235.diff	(revision 26740)
@@ -0,0 +1,84 @@
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 26234)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 26235)
+@@ -23,20 +23,49 @@
+ md.materials.density=  [1.0750e4 1.0750e+04   4.9780e+03   3.8710e+03   3.4380e+03   3.0370e+03]';
+ md.materials.lame_mu=  [1e-5         0   2.2834e+00   1.0549e+00   7.0363e-01   5.0605e-01]'*1e11;
+ md.materials.viscosity=[0            0   2.0000e+00   1.0000e+00   1.0000e+00   1.0000e+25]'*1e21;
+-md.materials.lame_lambda=md.materials.lame_mu*0+5e14;
++md.materials.lame_lambda=md.materials.lame_mu*0+5e17;
+ md.materials.issolid=[1 0 1 1 1 1]';
+-md.materials.isburgers=zeros(md.materials.numlayers,1);
++md.materials.rheologymodel=2*ones(md.materials.numlayers,1);
++md.materials.burgers_mu=md.materials.lame_mu/3;
++md.materials.burgers_viscosity=md.materials.viscosity/10;
++md.materials.ebm_alpha= ones(md.materials.numlayers,1)*.9;
++md.materials.ebm_delta= ones(md.materials.numlayers,1)*0.2;
++md.materials.ebm_taul= ones(md.materials.numlayers,1)*54*60; %54min
++md.materials.ebm_tauh= ones(md.materials.numlayers,1)*18.6*cst/1e3; %18.6yr
++%setlitho2prem(md.materials)
+ 
+ md.love.allow_layer_deletion=1;
+ md.love.frequencies=([0]*2*pi)'/cst;
+ md.love.nfreq=length(md.love.frequencies);
++md.love.sh_nmin=1;
+ md.love.sh_nmax=256;
++md.love.underflow_tol=1e-20;
++md.love.Gravitational_Constant=6.6732e-11;
++md.love.integration_steps_per_layer=200;
+ 
+-md.materials.burgers_mu=md.materials.lame_mu;
+-md.materials.burgers_viscosity=md.materials.viscosity;
+ 
++md.love.istemporal=1;
++md.love.n_temporal_iterations=8;
++%md.love.time=(logspace(-4,5, 2))'*cst;
++md.love.time=(logspace(-1,2, 50))'*cst;
++md.love.love_kernels=1;
++if md.love.istemporal
++md.love=md.love.build_frequencies_from_time;
++end
++
+ md=solve(md,'lv');
+ 
++ht2=md.results.LoveSolution.LoveHr;
++lt2=md.results.LoveSolution.LoveLr;
++kt2=md.results.LoveSolution.LoveKr;
++t=md.love.time/cst*1e3;
++
++%hs=reshape(md.results.LoveSolution.LoveHi(:,:), [ md.love.sh_nmax+1, 2*md.love.n_temporal_iterations, length(t)]);
++%hs=permute(hs,[3 2 1]);
++%[ht,h,hsig,hconv]=postwidder_love(md,md.love.n_temporal_iterations,t,hs,1e-5);
++
++
++
+ %Fields and tolerances to track changes
+ %loading love numbers
+ field_names     ={'LoveH_loading_elastic','LoveK_loading_elastic','LoveL_loading_elastic'};
+@@ -47,6 +76,7 @@
+ 	(md.results.LoveSolution.LoveLr(:,1)),...
+ 	};
+ 
++
+ % validate elastic loading solutions against the Spada benchmark. {{{ 
+ if validation 
+ 	spada_solutions = load('spada_elastic_loading_deg_h_l_k'); 
+@@ -168,7 +198,7 @@
+ %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.materials.rheologymodel=md.materials.issolid*0;
+ %md.love.forcing_type=11;
+ %md.materials.numlayers=length(md.materials.viscosity);
+ %md=solve(md,'lv');
+@@ -197,7 +227,7 @@
+ md.materials.numlayers=length(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.materials.rheologymodel=md.materials.issolid*0;
+ md.love.forcing_type=11;
+ md.love.sh_nmin=1;
+ md.love.sh_nmax=100;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26235-26236.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26235-26236.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26235-26236.diff	(revision 26740)
@@ -0,0 +1,1164 @@
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26235)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26236)
+@@ -8,22 +8,978 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+-void love_core(FemModel* femmodel){
++#include "petscblaslapack.h"
+ 
+-	Vector<IssmDouble> *wg    = NULL;
+-	Vector<IssmDouble> *dwdtg = NULL;
+-	IssmDouble          *x    = NULL;
+-	IssmDouble          *y    = NULL;
+ 
++void love_init(FemModel* femmodel, Matlitho* matlitho){/*{{{*/
++	// initialize Planet_Mass(r) for efficient computation of gravity, value of surface gravity and inital size of the yi equation system
++	bool        verbosemod = (int)VerboseModule();
++
++	int numlayers = matlitho->numlayers;
++	IssmDouble* r=matlitho->radius;
++	IssmDouble* EarthMass=xNewZeroInit<IssmDouble>(numlayers+1);
++	IssmDouble r1,r2,ro, GG;
++	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++
++	for (int i=0;i<numlayers;i++){
++		  r2 = r[i+1];
++		  ro = matlitho->density[i];
++		if (i==0){
++			EarthMass[i] = ro*pow(r2,3.0)*4.0*PI/3.0;
++		}else{
++			r1=r[i];
++			EarthMass[i] = EarthMass[i-1] + ro*(pow(r2,3.0)-pow(r1,3.0))*4.0*PI/3.0;;
++		}
++	}
++
++	IssmDouble g0=EarthMass[numlayers-1]*GG/pow(r[numlayers],2.0);
++	femmodel->parameters->SetParam(g0,LoveG0Enum);
++	femmodel->parameters->SetParam(EarthMass,numlayers,LoveEarthMassEnum);
++	xDelete<IssmDouble>(EarthMass);
++
++	int nyi=6*(numlayers+1);
++	int starting_layer=0;
++	femmodel->parameters->SetParam(nyi,LoveNYiEquationsEnum);
++	femmodel->parameters->SetParam(starting_layer,LoveStartingLayerEnum);
++}
++
++void GetEarthRheology(IssmDouble* pla, IssmDouble* pmu, int layer_index, IssmDouble omega,FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++
++	//returns lame parameters (material rigity) lambda and mu for the right frequency and layer
++ 	IssmDouble vi=matlitho->viscosity[layer_index];
++ 	IssmDouble mu=matlitho->lame_mu[layer_index];
++ 	IssmDouble la=matlitho->lame_lambda[layer_index];
++ 	int rheo=matlitho->rheologymodel[layer_index];
++
++	if (vi!=0 && omega!=0.0){ //take into account viscosity in the rigidity if the material isn't a perfect fluid
++				   //Otherwise return the elastic value
++		IssmDouble ka=la + 2.0/3.0*mu; //Bulk modulus
++		if (rheo==2){//EBM
++			IssmDouble alpha=matlitho->ebm_alpha[layer_index];
++			IssmDouble delta=matlitho->ebm_delta[layer_index];
++			IssmDouble taul=matlitho->ebm_taul[layer_index];
++			IssmDouble tauh=matlitho->ebm_tauh[layer_index];
++			IssmDouble hf1,hf2,U1,U2;
++			IssmDouble* a=xNew<IssmDouble>(2);
++			IssmDouble* b=xNew<IssmDouble>(1);
++
++			a[0]=1.0;a[1]=1.0+alpha/2.0;
++			b[0]=2.0+alpha/2.0;
++			//hf1=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*tauh,2.0), 0, 0, 15);
++			//hf2=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*taul,2.0), 0, 0, 15);
++			//hf1=hypergeometric_pFq({a[0], a[1]}, {b[0]},-pow(omega*tauh,2.0));
++			//hf2=hypergeometric_pFq_({a[0], a[1]}, {b[0]},-pow(omega*taul,2.0));
++			U1=(pow(tauh,alpha)-pow(taul,alpha))/alpha-pow(omega,2.0)/(2.0+alpha)*(pow(tauh,2.0+alpha)*hf1-pow(taul,2.0+alpha)*hf2);
++
++			a[0]=1.0;a[1]=.5+alpha/2.0;
++			b[0]=1.5+alpha/2.0;
++			//hf1=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*tauh,2.0), 0, 0, 15);
++			//hf2=HypergeometricFunctionx(a, b, 2, 1, -pow(omega*taul,2.0), 0, 0, 15);
++			//hf1=hypergeometric_pFq({a[0], a[1]}, {b[0]},-pow(omega*tauh,2.0));
++			//hf2=hypergeometric_pFq({a[0], a[1]}, {b[0]},-pow(omega*taul,2.0));
++			U2=(pow(tauh,1.0+alpha)*hf1-pow(taul,1.0+alpha)*hf2)/(1.0+alpha);
++
++			mu=mu/(1.0+ alpha*delta/(pow(tauh,alpha)-pow(taul,alpha))*(U1 + omega*U2) -mu/vi/omega);
++		   	la=ka-2.0/3.0*mu;
++
++			xDelete<IssmDouble>(a);
++			xDelete<IssmDouble>(b);
++		} 
++		else if (rheo==1){//Burgers
++			IssmDouble vi2=matlitho->burgers_viscosity[layer_index];
++			IssmDouble mu2=matlitho->burgers_mu[layer_index];
++
++		  	mu=mu*omega*(omega+mu2/vi2)/((omega+mu2/vi2)*(omega+mu/vi)+mu/vi2*omega);
++		   	la=ka-2.0/3.0*mu;
++	  	}
++		else{//Maxwell
++			la = (la + mu*ka/vi/omega)/(1.0 + mu/vi/omega);
++			mu = mu/(1.0+mu/vi/omega);
++		}
++	 }
++
++	 *pla=la;
++	 *pmu=mu;
++
++} /*}}}*/
++
++
++IssmDouble GetGravity(IssmDouble r2, int layer_index, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++	//computes gravity at radius r2
++	IssmDouble* EarthMass;
++	IssmDouble g, GG;
++
++	femmodel->parameters->FindParam(&EarthMass,&matlitho->numlayers,LoveEarthMassEnum);
++	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++	IssmDouble ro=matlitho->density[layer_index];
++	IssmDouble M=0;
++	IssmDouble r1=0;
++	if (layer_index==0){
++		M=4.0/3.0*PI*ro*pow(r2,3.0);
++	}
++	else{ 
++		r1=matlitho->radius[layer_index];
++		M=EarthMass[layer_index-1]+4.0/3.0*PI*ro*(pow(r2,3.0)-pow(r1,3.0));
++	}
++	return	g= GG*M/pow(r2,2.0);
++}/*}}}*/
++
++void fill_yi_prefactor(IssmDouble* yi_prefactor, int* pdeg, IssmDouble* pomega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++	//precalculates partial derivative factors for function yi_derivatives
++ IssmDouble ra=matlitho->radius[matlitho->numlayers];
++ IssmDouble  g0,r0,mu0, GG;
++ int nstep,nindex, starting_layer;
++ femmodel->parameters->FindParam(&g0,LoveG0Enum);
++ femmodel->parameters->FindParam(&r0,LoveR0Enum);
++ femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
++ femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++ femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
++ femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
++
++ IssmDouble frh,frhg0,fgr0,fgr,fn,rm0,rlm,flm;
++ IssmDouble xmin,xmax,x,dr;
++ IssmDouble g,ro, issolid;
++
++	if (pomega) { //frequency and degree dependent terms /*{{{*/
++		IssmDouble la,mu;
++		IssmDouble* f=xNewZeroInit<IssmDouble>(12);
++		int deg=*pdeg;
++		IssmDouble omega=*pomega;	
++		fn=deg*(deg+1.0);
++
++		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
++
++				ro=matlitho->density[layer_index];
++				issolid=matlitho->issolid[layer_index];
++				if(issolid==1){
++		 		GetEarthRheology(&la, &mu,layer_index,omega,femmodel,matlitho);   
++	
++				/*_______Expressions*/
++				flm=(la+2.0*mu);
++				rlm=(3.0*la+2.0*mu)/(la+2.0*mu);
++				rm0=mu/mu0;
++				frh=ro*ra/mu0;
++
++				f[0]=(-2.0*la/flm);
++				f[1]=mu0/flm;
++				f[2]=(la*fn/flm);
++				f[3]=rm0*rlm;
++				f[4]=ro*pow(omega,2.0)*ra/mu0;
++				f[5]=(-4.0*mu/flm);
++				f[6]=fn*frh;
++				f[7]=-(2.0*rm0*rlm)*fn;
++				f[8]=1.0/rm0;
++				f[9]=-2.0*rm0*rlm;
++				f[10]=-la/flm;
++				f[11]=2.0*rm0*(la*(2.0*fn-1.0)+2.0*mu*(fn-1.0))/flm;
++
++				xmin=matlitho->radius[layer_index]/ra;
++				xmax=(matlitho->radius[layer_index+1])/ra;
++				dr = (xmax -xmin)/nstep;
++			     	x=xmin;
++				for (int n=0;n<nstep;n++){
++					g=GetGravity(x*ra,layer_index,femmodel,matlitho);
++
++					nindex=layer_index*nstep*36+n*36;
++					yi_prefactor[nindex+ 0*6+0]= f[0]/x;                      // in dy[0*6+0]
++					yi_prefactor[nindex+ 0*6+1]= f[1];                        // in dy[0*6+1]
++					yi_prefactor[nindex+ 0*6+2]= f[2]/x;                      // in dy[0*6+2]
++					yi_prefactor[nindex+ 1*6+0]= 4.0*(-frh*g+f[3]/x)/x + f[4];// in dy[1*6+0]
++					yi_prefactor[nindex+ 1*6+1]= f[5]/x;                      // in dy[1*6+1]
++					yi_prefactor[nindex+ 1*6+2]= (f[6]*g+f[7]/x)/x;           // in dy[1*6+2]
++					yi_prefactor[nindex+ 2*6+3]= f[8];                        // in dy[2*6+3]
++					yi_prefactor[nindex+ 3*6+0]= (frh*g+f[9]/x)/x;            // in dy[3*6+0]
++					yi_prefactor[nindex+ 3*6+1]= f[10]/x;                     // in dy[3*6+1]
++					yi_prefactor[nindex+ 3*6+2]= f[11]/(x*x) + f[4];          // in dy[3*6+2]
++					x=x+dr;
++				}
++			}
++		}
++
++		xDelete<IssmDouble>(f);
++	/*}}}*/
++	} else if (pdeg) { // degree dependent terms /*{{{*/
++	 	int deg=*pdeg;
++	 	fn=(deg*(deg+1.0));
++
++		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
++			ro=matlitho->density[layer_index];
++			issolid=matlitho->issolid[layer_index];
++	
++			/*_______Expressions*/
++			fgr=4.0*PI*GG*ro*ra;
++	 
++			xmin=matlitho->radius[layer_index]/ra;
++			xmax=(matlitho->radius[layer_index+1])/ra;
++			dr = (xmax -xmin)/nstep;
++		     	x=xmin;
++			for (int n=0;n<nstep;n++){
++				 nindex=layer_index*nstep*36+n*36;
++				 g=GetGravity(x*ra,layer_index,femmodel,matlitho);
++	
++				 if(issolid==1){
++			 	 yi_prefactor[nindex+ 1*6+3]= fn/x;                  // in dy[1*6+3]
++				 yi_prefactor[nindex+ 5*6+2]= -(fgr/g0*fn)/x;        // in dy[5*6+2]
++				 yi_prefactor[nindex+ 5*6+4]= fn/(x*x);		     // in dy[5*6+4]
++				 } else {
++				 yi_prefactor[nindex+ 1*6+0]= (-4.0*(fgr/g)+fn/x)/x; // in dy[1*6+0] liquid layer
++				 }
++				x=x+dr;
++			}
++		}
++	/*}}}*/
++	} else { // static terms /*{{{*/
++		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
++			ro=matlitho->density[layer_index];
++			issolid=matlitho->issolid[layer_index];
++	
++			/*_______Expressions*/
++			frhg0=ro*g0*ra/mu0;
++			fgr=4.0*PI*GG*ro*ra;
++
++			xmin=matlitho->radius[layer_index]/ra;
++			xmax=(matlitho->radius[layer_index+1])/ra;
++			dr = (xmax -xmin)/nstep;
++		     	x=xmin;
++	  	 	for (int n=0;n<nstep;n++){
++				 g=GetGravity(x*ra,layer_index,femmodel,matlitho);
++				 nindex=layer_index*nstep*36+n*36;
++				 if(issolid==1){
++					 yi_prefactor[nindex+ 1*6+5]= -frhg0;       // in dy[1*6+5]
++					 yi_prefactor[nindex+ 2*6+0]= -1.0/x;       // in dy[2*6+0]
++					 yi_prefactor[nindex+ 2*6+2]= 1.0/x;        // in dy[2*6+2]
++					 yi_prefactor[nindex+ 3*6+3]= -3.0/x;       // in dy[3*6+3]
++					 yi_prefactor[nindex+ 3*6+4]= -frhg0/x;     // in dy[3*6+4]
++					 yi_prefactor[nindex+ 4*6+0]= fgr/g0;       // in dy[4*6+0]
++					 yi_prefactor[nindex+ 4*6+5]= 1.0;          // in dy[4*6+5]
++					 yi_prefactor[nindex+ 5*6+5]= -2.0/x;       // in dy[5*6+5]
++				 } else {
++					 yi_prefactor[nindex+ 0*6+0]= fgr/g;        // in dy[0*6+0] liquid layer
++					 yi_prefactor[nindex+ 0*6+1]= 1.0;          // in dy[0*6+1] liquid layer
++					 yi_prefactor[nindex+ 1*6+1]= -2.0/x-fgr/g; // in dy[1*6+1] liquid layer
++				 }
++				x=x+dr;
++			}
++		}
++	/*}}}*/
++	}
++}/*}}}*/
++
++IssmDouble* yi_derivatives(IssmDouble* y, int layer_index, int n, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++	//computes yi derivatives at r=radius[layer_index]+ n/nstep*(radius[layer_index+1]-radius[layer_index])
++
++	IssmDouble issolid=matlitho->issolid[layer_index];
++	int iy,id,ny, nindex, nstep;
++ 	IssmDouble* dydx=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* dy=xNewZeroInit<IssmDouble>(36);
++	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
++
++	/*{{{*/ /* For reference:
++	 flm=(la+2.0*mu);
++	 rlm=(3.0*la+2.0*mu)/(la+2.0*mu);
++	 rm0=mu/mu0;
++	 rg0=g/g0;
++	 frh=ro*g*ra/mu0;
++	 fgr=4.0*PI*GG*ro*ra/g0;
++	 fn=(deg*(deg+1.0));
++	 
++
++	 if(issolid==1){
++	 ny = 6;
++
++	 dy[0*6+0]= (-2.0*la/flm)/x;
++	 dy[0*6+1]= mu0/flm;
++	 dy[0*6+2]= (la*fn/flm)/x;
++	 dy[0*6+3]= 0.0;
++	 dy[0*6+4]= 0.0;
++	 dy[0*6+5]= 0.0;
++
++	 dy[1*6+0]=  4.0*(-frh+rm0*rlm/x)/x + ro*pow(omega,2.0)*ra/mu0;
++	 dy[1*6+1]=(-4.0*mu/flm)/x;
++	 dy[1*6+2]= fn*(frh-2.0*rm0*rlm/x)/x;
++	 dy[1*6+3]= fn/x;
++	 dy[1*6+4]= 0.0;
++	 dy[1*6+5]= -frh/rg0;
++
++	 dy[2*6+0]= -1.0/x;
++	 dy[2*6+1]= 0.0;
++	 dy[2*6+2]= 1.0/x;
++	 dy[2*6+3]= 1/rm0;
++	 dy[2*6+4]= 0.0;
++	 dy[2*6+5]= 0.0;
++
++	 dy[3*6+0]= (frh-2.0*rm0*rlm/x)/x;
++	 dy[3*6+1]= ( -la/flm)/x;
++	 dy[3*6+2]= (2.0*rm0*(la*(2.0*fn-1.0)+2.0*mu*(fn-1.0))/flm)/(x*x) + ro*pow(omega,2.0)*ra/mu0;
++	 dy[3*6+3]= -3.0/x;
++	 dy[3*6+4]= -(frh/rg0)/x;
++	 dy[3*6+5]= 0.0;
++
++	 dy[4*6+0]= fgr;
++	 dy[4*6+1]= 0.0;
++	 dy[4*6+2]= 0.0;
++	 dy[4*6+3]= 0.0;
++	 dy[4*6+4]= 0.0;
++	 dy[4*6+5]= 1.0;
++
++	 dy[5*6+0]= 0.0;
++	 dy[5*6+1]= 0.0;
++	 dy[5*6+2]= -(fgr*fn)/x;
++	 dy[5*6+3]= 0.0;
++	 dy[5*6+4]= fn/(x*x);
++	 dy[5*6+5]= -2.0/x;
++	  
++	 } else {
++	 ny = 2;
++
++	 dy[0*6+0]= fgr/rg0;
++	 dy[0*6+1]= 1.0;
++	 dy[1*6+0]= (-4.0*(fgr/rg0)+fn/x)/x;
++	 dy[1*6+1]= -2.0/x-fgr/rg0;
++	}
++	*/ /*}}}*/
++
++	 if(issolid==1){
++		 ny = 6;
++	 } else {
++		 ny = 2;
++	 }
++	 
++	 for (id=0;id<ny;id++){
++		for (iy=0;iy<ny;iy++){
++			nindex=layer_index*nstep*36+n*36;
++			dydx[id]=dydx[id]+yi_prefactor[nindex+id*6+iy]*y[iy];
++	 	}
++	 }
++	xDelete<IssmDouble>(dy);
++	return dydx;
++}/*}}}*/
++
++void propagate_yi_euler(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
++	//euler method
++	int nstep;
++	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
++
++ 	IssmDouble* dydx=xNewZeroInit<IssmDouble>(6);
++	IssmDouble dr = (xmax -xmin)/nstep;
++     	IssmDouble x=xmin;
++    for(int i = 0;i<nstep;i++){
++	dydx=yi_derivatives(y,layer_index, i,yi_prefactor,femmodel,matlitho);
++  	for (int j=0;j<6;j++){
++		y[j]+=dydx[j]*dr;
++	}
++  	x = x + dr;
++    }
++	xDelete<IssmDouble>(dydx);
++}/*}}}*/
++
++void propagate_yi_RK2(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
++	//Implements Runge-Kutta 2nd order (midpoint method)
++	int nstep;
++	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
++
++ 	IssmDouble* k1=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* k2=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* k3=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* k4=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* y1=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* y2=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* y3=xNewZeroInit<IssmDouble>(6);
++
++	IssmDouble dr = (xmax -xmin)/nstep;
++     	IssmDouble x=xmin;
++    for(int i = 0;i<nstep/2;i++){
++	k1=yi_derivatives(y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
++	for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
++	k2=yi_derivatives(y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
++	
++  	for (int j=0;j<6;j++){
++		  y[j]+=k2[j]*2.0*dr;
++	}
++  	x = x + 2.0*dr;
++    }
++	xDelete<IssmDouble>(k1);
++	xDelete<IssmDouble>(k2);
++	xDelete<IssmDouble>(k3);
++	xDelete<IssmDouble>(k4);
++	xDelete<IssmDouble>(y1);
++	xDelete<IssmDouble>(y2);
++	xDelete<IssmDouble>(y3);
++}/*}}}*/
++
++void propagate_yi_RK4(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
++	//Implements Runge-Kutta 4th order
++	int nstep;
++	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
++
++ 	IssmDouble* k1=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* k2=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* k3=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* k4=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* y1=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* y2=xNewZeroInit<IssmDouble>(6);
++ 	IssmDouble* y3=xNewZeroInit<IssmDouble>(6);
++
++	IssmDouble dr = (xmax -xmin)/nstep;
++     	IssmDouble x=xmin;
++    for(int i = 0;i<nstep/2-1;i++){
++	k1=yi_derivatives(y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
++	for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
++	k2=yi_derivatives(y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++	for (int j=0;j<6;j++) {y2[j]=y[j]+k2[j]*dr;}
++	k3=yi_derivatives(y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++	for (int j=0;j<6;j++) {y3[j]=y[j]+k3[j]*2.0*dr;}
++	k4=yi_derivatives(y3,layer_index, 2*i+2,yi_prefactor,femmodel,matlitho);		
++	
++  	for (int j=0;j<6;j++){
++		y[j]+=(k1[j]+2.0*k2[j]+2.0*k3[j]+k4[j])/3.0*dr;		
++	}
++  	x = x + 2.0*dr;
++    }
++
++	//Last step: we don't know the derivative at xmax, so we will assume the values at xmax-dr
++	int i=nstep/2;
++	k1=yi_derivatives(y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
++	for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
++	k2=yi_derivatives(y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++	for (int j=0;j<6;j++) {y2[j]=y[j]+k2[j]*dr;}
++	k3=yi_derivatives(y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++	for (int j=0;j<6;j++) {y3[j]=y[j]+k3[j]*2.0*dr;}
++	k4=yi_derivatives(y3,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
++	
++  	for (int j=0;j<6;j++){
++		y[j]+=(k1[j]+2.0*k2[j]+2.0*k3[j]+k4[j])/3.0*dr;		
++	}
++
++  	x = x + 2.0*dr;
++
++	xDelete<IssmDouble>(k1);
++	xDelete<IssmDouble>(k2);
++	xDelete<IssmDouble>(k3);
++	xDelete<IssmDouble>(k4);
++	xDelete<IssmDouble>(y1);
++	xDelete<IssmDouble>(y2);
++	xDelete<IssmDouble>(y3);
++}/*}}}*/
++
++void Innersphere_boundaryconditions(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++	//fills the boundary conditions at the bottom of layer[layer_index] in yi[0:2][0:5]
++
++	IssmDouble r = matlitho->radius[layer_index];
++	IssmDouble ra=matlitho->radius[matlitho->numlayers];
++	IssmDouble  g0,r0,mu0, GG;
++	int nyi;
++ 	femmodel->parameters->FindParam(&g0,LoveG0Enum);
++ 	femmodel->parameters->FindParam(&r0,LoveR0Enum);
++ 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
++ 	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
++	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++	IssmDouble ro=matlitho->density[layer_index];
++	IssmDouble issolid=matlitho->issolid[layer_index];
++	IssmDouble g=GetGravity(r,layer_index,femmodel,matlitho);
++	IssmDouble la,mu;
++
++	if (layer_index==0){
++		// radius[0] cannot be 0 for numerical reasons, but below our first interface at radius[0] would in reality be the same material as in the first layer
++		GetEarthRheology(&la, &mu,layer_index,omega,femmodel,matlitho);   
++	} else {
++		GetEarthRheology(&la, &mu,layer_index-1,omega,femmodel,matlitho);   
++	}    
++
++	IssmDouble cst = 4.0*PI*GG*ro;
++	IssmDouble r2=pow(r,2.0);
++
++	yi[0+nyi*0]=1.0*r/ra;
++	yi[0+nyi*1]=1.0/(r*ra);
++	yi[0+nyi*2]=0.0;
++
++	yi[1+nyi*0]=(2.0*mu*(deg-1.0-3.0/deg) + cst/3.0*ro*r2)/mu0;
++	yi[1+nyi*1]=(2.0*mu*(deg-1.0)/r2 + cst/3.0*ro)/mu0;
++	yi[1+nyi*2]=-ro/mu0;
++
++	yi[2+nyi*0]=(deg+3.0)/(deg*(deg+1.0))*r/ra;
++	yi[2+nyi*1]=1.0/(deg*r*ra);
++	yi[2+nyi*2]=0.0;
++
++	yi[3+nyi*0]=2.0*mu*(deg+2.0)/((deg+1.0)*mu0);
++	yi[3+nyi*1]=2.0*mu*(deg-1.0)/(deg*r2*mu0);
++	yi[3+nyi*2]=0.0;
++
++	yi[4+nyi*0]=0.0;
++	yi[4+nyi*1]=0.0;
++	yi[4+nyi*2]=1.0/(g0*ra);
++
++	yi[5+nyi*0]=-cst*r/g0;
++	yi[5+nyi*1]=-cst/(r*g0);
++	yi[5+nyi*2]=deg/(r*g0);
++}/*}}}*/
++
++void build_yi_system(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho) { /*{{{*/
++
++	IssmDouble  g0,r0,mu0,x,ro1, GG;
++	int nyi,starting_layer, nstep;
++	femmodel->parameters->FindParam(&g0,LoveG0Enum);
++	femmodel->parameters->FindParam(&r0,LoveR0Enum);
++	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
++	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
++	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++	femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
++	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
++
++	  IssmDouble xmin,xmax,one,ro,g;
++	  IssmDouble ra=matlitho->radius[matlitho->numlayers];
++
++	for (int i=0;i<6*(matlitho->numlayers+1);i++){
++		for(int j=0;j<6*(matlitho->numlayers+1);j++){
++			yi[i+6*(matlitho->numlayers+1)*j]=0.0;
++		}
++	}
++
++	int ny,is,ii,jj;
++	IssmDouble ystart[6];
++	for (int k=0;k<6;k++) ystart[k]=0.0;		
++  
++	int ici = 0;   // Index of current interface 
++	for (int i = starting_layer; i<matlitho->numlayers;i++){ 
++
++		xmin=matlitho->radius[i]/ra;
++		xmax=(matlitho->radius[i+1])/ra;
++
++		  
++		if (matlitho->issolid[i]){
++		   		ny = 6;
++		   		is = 0;
++		   		one= 1.0;
++		} else {	
++		   		ny = 2;
++		   		is = 4;
++		   		one= -1.0;
++		}
++	
++
++		for (int j = 0;j<ny;j++){
++			for (int k=0;k<6;k++){ystart[k]=0.0;}
++			ystart[j]= 1.0;
++			  		
++			// Numerical Integration 
++			//propagate_yi_euler(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
++			propagate_yi_RK2(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
++			//propagate_yi_RK4(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
++			// Boundary Condition matrix - propagation part 
++			ii = 6*(ici+1)+is;
++			jj = 6*(ici+1)+j+is-3;
++			for (int kk=0;kk<ny;kk++){
++		  		yi[(ii+kk)+nyi*jj] = ystart[kk]*one;
++			}
++		}
++		  
++		  
++		// Boundary Condition matrix - solid regions
++		if (matlitho->issolid[i]){
++			one = -1.0;
++			if (i>0 & !matlitho->issolid[i-1]) one = 1.0;
++			for (int j=0;j<6;j++){
++				yi[(j+6*ici)+ nyi*(j+6*ici+3)] = one;
++			}
++		} else { // Boundary Condition matrix - liquid regions
++			ro1=matlitho->density[i];
++			g=GetGravity(matlitho->radius[i], i, femmodel,matlitho);
++			ii = 6*ici;
++			yi[ii+nyi*(ii+3)] = -1.0;
++			yi[ii+nyi*(ii+4+3)] = -g0/g;
++			yi[(ii+1)+nyi*(ii+3)]=-ro1*g*ra/mu0;
++			yi[(ii+2)+nyi*(ii+1+3)]=-1.0;
++			yi[(ii+5)+nyi*(ii+3)]= 4.0*PI*GG*ro1*ra/g0;
++			yi[(ii+4)+nyi*(ii+4+3)]=-1.0;
++			yi[(ii+5)+nyi*(ii+5+3)]=-1.0;
++			g=GetGravity(matlitho->radius[i+1], i,femmodel,matlitho);
++			ii = 6*(ici+1);
++			yi[ii+nyi*(ii-1)]=-1.0;
++			yi[ii+nyi*(ii+1)]=yi[(ii+4)+nyi*(ii+1)]*g0/g; // yi(17,14) solution integration 1 of z5 CMB
++			yi[ii+nyi*(ii+2)]=yi[(ii+4)+nyi*(ii+2)]*g0/g; // yi(17,15) solution integration 2 of z5 CMB
++			  // yi(13,..) y1 CMB
++			yi[(ii+1)+nyi*(ii-1)]=-ro1*g*ra/mu0;
++			yi[(ii+2)+nyi*(ii)]=-1.0;
++			yi[(ii+5)+nyi*(ii-1)]= 4.0*PI*GG*ro1*ra/g0;
++		}	
++		ici = ici+1;
++	}
++
++
++  	//-- Internal sphere: integration starts here rather than r=0 for numerical reasons
++	Innersphere_boundaryconditions(yi, starting_layer, deg, omega, femmodel, matlitho);
++
++  	//-- Surface conditions
++	yi[(nyi-6)+nyi*(nyi-3)]=-1.0;
++	yi[(nyi-4)+nyi*(nyi-2)]=-1.0;
++	yi[(nyi-2)+nyi*(nyi-1)]=-1.0;
++	yi[(nyi-1)+nyi*(nyi-1)]=deg+1.0;
++
++  	//-- Degree 1 special case
++	if(deg==1){
++		for (int i=0;i<nyi;i++){
++			yi[(nyi-1)+nyi*i]=0.0;
++		}
++		yi[(nyi-1)+nyi*(nyi-1)]=1.0;
++	}
++}/*}}}*/
++
++void yi_boundary_conditions(IssmDouble* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++
++	IssmDouble  g0,r0,mu0,ra,rb,rc;
++	int nyi, forcing_type,icb,cmb;
++	IssmDouble* EarthMass;
++	femmodel->parameters->FindParam(&g0,LoveG0Enum);
++	femmodel->parameters->FindParam(&r0,LoveR0Enum);
++	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
++	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
++	femmodel->parameters->FindParam(&forcing_type,LoveForcingTypeEnum);
++	femmodel->parameters->FindParam(&icb,LoveInnerCoreBoundaryEnum);
++	femmodel->parameters->FindParam(&cmb,LoveCoreMantleBoundaryEnum);
++	femmodel->parameters->FindParam(&EarthMass,&matlitho->numlayers,LoveEarthMassEnum);
++	  
++   	// In Case of a Inner Core - Outer Core - Mantle planet and Boundary conditions on these 3 interfaces
++	ra=matlitho->radius[matlitho->numlayers];	
++	rb=0;
++	rc=0;
++	if (forcing_type<=4){
++		rc=matlitho->radius[icb];
++	} 
++	else if (forcing_type<=8){
++		rb=matlitho->radius[cmb];
++	}
++
++	IssmDouble ro_mean=EarthMass[matlitho->numlayers-1]/(4.0/3.0*PI*pow(ra,3.0));
++	xDelete<IssmDouble>(EarthMass);
++
++	for (int i=0;i<(matlitho->numlayers+1)*6;i++) yi_righthandside[i]=0.0;
++
++	switch (forcing_type) {
++
++	//-- forcings at the Inner Core Boundary
++   	case 1:	//'ICB --Volumetric Potential'
++		yi_righthandside[6*icb+5]=(deg)/(rc*g0);
++		yi_righthandside[6*icb+4]=1.0/(ra*g0);
++		break;
++	case 2: //'ICB --Pressure'
++		yi_righthandside[6*icb+1]=-ro_mean/mu0;
++		break;
++	case 3://'ICB --Loading'
++		yi_righthandside[6*icb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rc;
++		yi_righthandside[6*icb+5]= (2.0*deg+1.0)/(rc*g0);
++		break;
++	case 4://'ICB --Tangential Traction'
++		yi_righthandside[6*icb+3]= ro_mean/mu0;
++		break;
++
++	//--forcings at the Core Mantle Boundary
++	case 5://'CMB --Volumetric Potential'
++		yi_righthandside[6*cmb+1]=-ro_mean/mu0*ra/rb;
++		yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
++		break;
++	case 6://'CMB --Pressure'
++		yi_righthandside[6*cmb+1]=-ro_mean/mu0;
++		break;
++	case 7://'CMB --Loading'
++		yi_righthandside[6*cmb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rb;
++		yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
++		break;
++	case 8://'CMB --Tangential Traction'
++		yi_righthandside[6*cmb+3]=-ro_mean/mu0;
++		break;
++
++	//--forcings at the surface
++	case 9://'SURF--Volumetric Potential'
++		if (deg>1) yi_righthandside[nyi-1]=(2.0*deg+1.0)/(ra*g0);
++		break;
++	case 10://'SURF--Pressure'
++		yi_righthandside[nyi-5]=-ro_mean/mu0;
++		break;
++	case 11://'SURF--Loading'
++		yi_righthandside[nyi-5]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0);
++		if (deg>1) yi_righthandside[nyi-1]= (2.0*deg+1.0)/(ra*g0);
++		break;
++	case 12://'SURF--Tangential Traction'
++		yi_righthandside[nyi-3]= ro_mean/mu0;
++		break;
++	default:
++		_error_("love core error: forcing_type not supported yet");
++	}
++}/*}}}*/
++
++
++void solve_yi_system(IssmDouble* loveh, IssmDouble* lovel, IssmDouble* lovek, int deg, IssmDouble omega, IssmDouble* yi, IssmDouble* rhs, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++
++	IssmDouble  g0,r0,mu0,loveratio,underflow_tol;
++	IssmDouble* frequencies;
++	int nyi,starting_layer, dummy;
++	bool allow_layer_deletion;
++	femmodel->parameters->FindParam(&g0,LoveG0Enum);
++	femmodel->parameters->FindParam(&r0,LoveR0Enum);
++	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
++	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
++	femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
++	femmodel->parameters->FindParam(&allow_layer_deletion,LoveAllowLayerDeletionEnum);
++	femmodel->parameters->FindParam(&underflow_tol,LoveUnderflowTolEnum);
++	femmodel->parameters->FindParam(&frequencies,&dummy,LoveFrequenciesEnum);
++ 	IssmDouble ra=matlitho->radius[matlitho->numlayers];
++	bool exit=false;
++	int lda,ldb;
++
++	for(;!exit;){ //cycles of: attempt to solve the yi system, then delete a layer if necessary
++		lda=nyi;
++		ldb=nyi;
++		IssmDouble*  yilocal=xNew<IssmDouble>(nyi*nyi); // we will need to redeclare these inside here as nyi changes
++		IssmDouble*  rhslocal=xNew<IssmDouble>(nyi);
++
++		//we need to do a local copy of yi,rhs to send them to LAPACK with the appropriate size and to keep the original matrices in case layers are deleted and we need to try again
++		for (int i=0;i<nyi;i++){ 
++			rhslocal[i]=rhs[i];
++			for (int j=0;j<nyi;j++){
++				yilocal[i+j*nyi]=yi[i+j*nyi];
++			}
++		}
++		//-- Resolution
++		int* ipiv=xNewZeroInit<int>(nyi); //pivot index vector
++		int info = 0;// error checker
++		int nrhs=1; // number of right hand size columns
++
++		dgesv_(&nyi, &nrhs, yilocal, &lda, ipiv, rhslocal, &ldb, &info);
++		xDelete<int>(ipiv);
++
++		if(VerboseSolution() && info!=0){ 
++			_printf0_("love core warning in DGESV : LAPACK linear equation solver couldn't resolve the system");
++			printf("%s %s %s %s\n", "i","j","yi[i+nyi*j]","rhs[i]");
++			for (int i=0;i<nyi;i++){
++				for (int j=0;j<nyi;j++){
++					printf("%i %i %e %e\n", i,j,yi[i+nyi*j],rhs[i]);
++				}
++			}
++		}
++
++		*loveh = rhslocal[nyi-3]*ra*g0;
++		*lovel = rhslocal[nyi-2]*ra*g0;
++		*lovek = rhslocal[nyi-1]*ra*g0;
++
++		IssmDouble loveh1 = rhslocal[3];
++		IssmDouble lovel1 = rhslocal[5];
++		IssmDouble lovek1 = rhslocal[7] - pow(matlitho->radius[starting_layer]/ra,deg)/(g0*ra);
++
++		IssmDouble loveh1s = rhslocal[nyi-3];
++		IssmDouble lovel1s = rhslocal[nyi-2];
++		IssmDouble lovek1s = rhslocal[nyi-1] - 1.0/(g0*ra);
++
++		loveratio = abs(loveh1/loveh1s); //ratio of center to surface love numbers, determines if we should remove layers
++		if (abs(lovel1/lovel1s) < loveratio) loveratio = abs(lovel1/lovel1s); 
++		if (abs(lovek1/lovek1s) < loveratio) loveratio = abs(lovek1/lovek1s);
++
++		if (!allow_layer_deletion || nyi<=12 || omega!=2.0*PI*frequencies[0]){ //We are not allowed to delete layers, or there is only one layer left. We also don't want to delete layers in the middle of a loop on frequencies, as that can lead to a jump that would compromise the inverse laplace transform.
++			goto save_results;
++		}
++
++		if (loveratio<=underflow_tol || xIsNan(loveratio) || xIsInf(loveratio)){//We need to delete a layer and try again if the ratio between deepest love number to surface love number is too low (risk of underflow) or garbage
++			if(VerboseSolution()){
++				printf("\n   Degree: %i, surface/Depth Love number ratio small: %e\n",deg, loveratio);
++				printf("    Changing the interface where the integration starts\n");
++				printf("    New start interface: r=%gm\n\n", matlitho->radius[starting_layer+1]);
++			}
++			nyi-=6;
++			starting_layer+=1;
++			femmodel->parameters->SetParam(nyi,LoveNYiEquationsEnum);
++			femmodel->parameters->SetParam(starting_layer,LoveStartingLayerEnum);
++
++
++			for (int i=0;i<nyi;i++){//shift everything down by 1 layer
++				rhs[i]=rhs[i+6];
++				for (int j=0;j<nyi;j++){
++					yi[j+i*nyi]=yi[j+6+(i+6)*(nyi+6)];
++				}
++			}
++
++			Innersphere_boundaryconditions(yi, starting_layer, deg, omega, femmodel, matlitho); //we move the first interface to the new starting layer. yi[0:2,0:5] will be different
++		} else { //we are ready to save the outputs and break the main loop
++
++		save_results:
++			for (int i=0;i<nyi;i++){
++				rhs[i]=rhslocal[i];
++				for (int j=0;j<nyi;j++){
++					yi[j+i*nyi]=yilocal[j+i*nyi];
++				}
++			}
++
++			//make sure we can't output numbers from deleted layers
++			for (int i=nyi;i<(matlitho->numlayers+1)*6;i++){ 
++				rhs[i]=0.0;
++				for (int j=0;j<(matlitho->numlayers+1)*6;j++){
++					yi[j+i*(matlitho->numlayers+1)*6]=0.0;
++				}
++			}
++			for (int i=0;i<nyi;i++){
++				for (int j=nyi;j<(matlitho->numlayers+1)*6;j++){
++					yi[j+i*(matlitho->numlayers+1)*6]=0.0;
++				}
++			}
++
++			exit = true;
++	  	}
++		xDelete<IssmDouble>(yilocal);
++		xDelete<IssmDouble>(rhslocal);
++  	}
++	xDelete<IssmDouble>(frequencies);	
++}/*}}}*/
++
++IssmDouble factorial(int n){ /*{{{*/
++	IssmDouble prod=1;
++	for (int i=2;i<n+1;i++) prod*=i;
++	return prod;
++}/*}}}*/
++
++IssmDouble n_C_r(int n, int r){ /*{{{*/ 
++	//n choose r
++        int primes[169] = 
++  {2,    3,    5,    7,   11,   13,   17,   19,   23,   29,  
++  31,   37,   41,   43,   47,   53,   59,   61,   67,   71,  
++  73,   79,   83,   89,   97,  101,  103,  107,  109,  113,  
++ 127,  131,  137,  139,  149,  151,  157,  163,  167,  173,  
++ 179,  181,  191,  193,  197,  199,  211,  223,  227,  229,  
++ 233,  239,  241,  251,  257,  263,  269,  271,  277,  281,  
++ 283,  293,  307,  311,  313,  317,  331,  337,  347,  349,  
++ 353,  359,  367,  373,  379,  383,  389,  397,  401,  409,  
++ 419,  421,  431,  433,  439,  443,  449,  457,  461,  463,  
++ 467,  479,  487,  491,  499,  503,  509,  521,  523,  541,  
++ 547,  557,  563,  569,  571,  577,  587,  593,  599,  601,  
++ 607,  613,  617,  619,  631,  641,  643,  647,  653,  659,  
++ 661,  673,  677,  683,  691,  701,  709,  719,  727,  733,  
++ 739,  743,  751,  757,  761,  769,  773,  787,  797,  809,  
++ 811,  821,  823,  827,  829,  839,  853,  857,  859,  863,  
++ 877,  881,  883,  887,  907,  911,  919,  929,  937,  941,  
++ 947,  953,  967,  971,  977,  983,  991,  997, 1009};
++	int num, den;
++        num = 1;
++        den = 1;
++
++	for (int i=0;i<r;i++){
++		num = num*(n-i);
++		den = den*(i+1);
++		if (i>0) {
++			// Divide out common prime factors
++			for (int k=0;k<169;k++){ //169 is the length of the prime vector here
++				if ( i % primes[k] == 0) { // modulo
++			                num = num/primes[k];
++			                den = den/primes[k];
++		        	}
++		        }
++		}
++	}
++
++	IssmDouble res;        
++	return res = num/den;
++}/*}}}*/
++
++
++IssmDouble* postwidder_coef(int NTit){ /*{{{*/
++	//Coefficients of the Post-Widder method through Saltzer summation for inverse Laplace transform:
++	//The Mth iteration estimate will be: f(t)_M = sum_{k=1:2*M}(xi_[M,k] * f(s_k))
++	//The method is based on equations (2), (6), (7) in: 
++	//Valko PP, Abate J. Comparison of sequence accelerators for the Gaver method of numerical Laplace transform inversion. Computational Mathematics and Applications. (2004)
++	//Note that the coefficients xi lack the factor s=k*log(2)/t. 
++	//That is because we are computing the heaviside response of the system rather than its impulse response, 
++	//and Laplace_Transform(Heaviside(t).*f(t)) = f(s)/s. So s cancels out in the sum for f(t)_M.
++
++	IssmDouble* xi=xNewZeroInit<IssmDouble>(2*NTit*NTit);
++	int indxi;
++	for (int M=1;M<NTit+1;M++){
++		for (int k=1;k<2*M+1;k++){
++		indxi=(M-1)*(2*NTit)+k-1;
++		    for (int j=floor((k+1)/2);j<min(k,M)+1;j++){
++			    xi[indxi]+=pow(j,M+1.0)/factorial(M)*n_C_r(M,j)*n_C_r(2*j,j)*n_C_r(j,k-j);
++		    }
++		    xi[indxi]*=pow(-1.0,k+M)/k;
++		}
++	}
++	return xi;
++}/*}}}*/
++
++void postwidder_transform(IssmDouble* Lovet, IssmDouble* Lovef,int d, int t, int NTit, IssmDouble* xi, FemModel* femmodel){ /*{{{*/
++	//Computes Lovet for time step t and degree d from the PW coefficients xi and the corresponding 2*NTit frequency samples in Lovef
++
++	int nfreq, indxi, indf;
++	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
++	int nt=nfreq/2/NTit;
++
++	indf=d*nfreq+t*2*NTit;
++	IssmDouble LoveM[NTit];
++
++	for (int M=1;M<NTit+1;M++){
++		LoveM[M-1]=0.0;
++		for (int k=1;k<2*M+1;k++){
++			indxi=(M-1)*(2*NTit)+k-1;
++			LoveM[M-1]+=xi[indxi]*Lovef[indf+k-1];
++		}
++		
++		//Make sure we are not getting into numerical instability
++		//Diverging once: ok, we'll give that the benefit of the doubt, it can be an inflexion point in the convergence series
++		//Diverging twice in a row: we are definitely propagating numerical error: revert to the last stable value and exit
++		if (M>3){ 
++			if ( abs(LoveM[M-1]-LoveM[M-2]) > abs(LoveM[M-2]-LoveM[M-3]) &&
++			     abs(LoveM[M-2]-LoveM[M-3]) > abs(LoveM[M-3]-LoveM[M-4]) ){
++				Lovet[d*nt+t]=LoveM[M-3];
++				return;
++			}
++		}
++	}
++	Lovet[d*nt+t]=LoveM[NTit-1];
++}/*}}}*/
++
++void love_freq_to_temporal(IssmDouble* LoveHt,IssmDouble* LoveLt,IssmDouble* LoveKt,IssmDouble* LoveHf,IssmDouble* LoveLf,IssmDouble* LoveKf, FemModel* femmodel){ /*{{{*/
++	//Transforms all frequency-dependent love numbers into time-dependent love numbers
++	int nfreq,sh_nmax,sh_nmin,indxi,indf, NTit;
++	IssmDouble meanh,meanl,meank,dh,dl,dk;
++
++	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
++	femmodel->parameters->FindParam(&sh_nmax,LoveShNmaxEnum);
++	femmodel->parameters->FindParam(&sh_nmin,LoveShNminEnum);
++	femmodel->parameters->FindParam(&NTit,LoveNTemporalIterationsEnum);
++	
++	int nt=nfreq/2/NTit;
++	IssmDouble* xi=postwidder_coef(NTit);
++
++	for (int d=sh_nmin;d<sh_nmax+1;d++){
++		for (int t=0;t<nt;t++){
++			postwidder_transform(LoveHt,LoveHf,d,t,NTit,xi,femmodel);
++			postwidder_transform(LoveLt,LoveLf,d,t,NTit,xi,femmodel);
++			postwidder_transform(LoveKt,LoveKf,d,t,NTit,xi,femmodel);
++		}
++	}
++	xDelete<IssmDouble>(xi);
++}/*}}}*/
++
++
++
++void love_core(FemModel* femmodel){ /*{{{*/
++
++	/*recover materials parameters: there is only one Matlitho, chase it down the hard way:*/
++	Matlitho* matlitho=NULL;
++	for (Object* & object: femmodel->materials->objects){
++		Material* material=xDynamicCast<Material*>(object);
++		if(material->ObjectEnum()==MatlithoEnum){
++			matlitho=xDynamicCast<Matlitho*>(material);
++			break;
++		}
++	}
++	_assert_(matlitho);
++
+ 	/*love parameters: */
++	int         nfreq,nyi,starting_layer,nstep,forcing_type,dummy;
++	int         sh_nmin,sh_nmax,kernel_index,deleted_layer_offset;
++	bool        allow_layer_deletion,love_kernels, istemporal;
++	bool        verbosemod = (int)VerboseModule();
++	IssmDouble lovek, loveh, lovel, loveratio;
++	IssmDouble  g0,r0,mu0, underflow_tol, omega;
+ 	IssmDouble *frequencies = NULL;
+-	int         nfreq,dummy;
+-	int         sh_nmin,sh_nmax;
+-	IssmDouble  g0,r0,mu0;
+-	bool        allow_layer_deletion;
+-	bool        love_kernels;
+-	int         forcing_type;
+-	bool        verbosemod = (int)VerboseModule();
+ 
+ 	/*parameters: */
+ 	bool save_results;
+@@ -34,6 +990,7 @@
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 
+ 	/*recover love number parameters: */
++
+ 	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
+ 	femmodel->parameters->FindParam(&frequencies,&dummy,LoveFrequenciesEnum); _assert_(nfreq==dummy);
+ 	femmodel->parameters->FindParam(&sh_nmax,LoveShNmaxEnum);
+@@ -44,58 +1001,122 @@
+ 	femmodel->parameters->FindParam(&allow_layer_deletion,LoveAllowLayerDeletionEnum);
+ 	femmodel->parameters->FindParam(&love_kernels,LoveKernelsEnum);
+ 	femmodel->parameters->FindParam(&forcing_type,LoveForcingTypeEnum);
++	femmodel->parameters->FindParam(&istemporal,LoveIsTemporalEnum);
++	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+ 
+-	/*recover materials parameters: there is only one Matlitho, chase it down the hard way:*/
+-	Matlitho* matlitho=NULL;
+-	for (Object* & object: femmodel->materials->objects){
+-		Material* material=xDynamicCast<Material*>(object);
+-		if(material->ObjectEnum()==MatlithoEnum){
+-			matlitho=xDynamicCast<Matlitho*>(material);
+-			break;
+-		}
+-	}
+-	_assert_(matlitho);
+-
+ 	/*Initialize three love matrices: geoid, vertical and horizontal displacement (real and imaginary parts) */
+-	IssmDouble*  LoveKr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+-	IssmDouble*  LoveHr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+-	IssmDouble*  LoveLr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+-	IssmDouble*  LoveKi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+-	IssmDouble*  LoveHi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+-	IssmDouble*  LoveLi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	IssmDouble*  LoveKf = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	IssmDouble*  LoveHf = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	IssmDouble*  LoveLf = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+ 
+ 	/*Initialize love kernels (real and imaginary parts): */
+ 	IssmDouble*  LoveKernelsReal = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
+ 	IssmDouble*  LoveKernelsImag = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
+ 
++	love_init(femmodel,matlitho);
++	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
++	femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
++	IssmDouble* yi_prefactor=xNewZeroInit<IssmDouble>(6*6*nstep*matlitho->numlayers);
++	IssmDouble* yi_righthandside=xNewZeroInit<IssmDouble>(nyi);
++	IssmDouble* yi=xNewZeroInit<IssmDouble>(nyi*nyi);
++
++	//precalculate yi coefficients that do not depend on degree or frequency
++	fill_yi_prefactor(yi_prefactor, NULL, NULL,femmodel, matlitho); 
++	for(int deg=sh_nmin;deg<sh_nmax+1;deg++){
++
++		//precalculate yi coefficients that depend on degree but not frequency
++		fill_yi_prefactor(yi_prefactor, &deg, NULL,femmodel, matlitho); 
++
++		for (int fr=0;fr<nfreq;fr++){
++			omega=2.0*PI*frequencies[fr]; //angular frequency
++
++			//precalculate yi coefficients that depend on degree and frequency
++			fill_yi_prefactor(yi_prefactor, &deg,&omega,femmodel, matlitho); 
++
++			yi_boundary_conditions(yi_righthandside,deg,femmodel,matlitho); 
++
++			build_yi_system(yi,deg,omega,yi_prefactor,femmodel,matlitho);
++
++			solve_yi_system(&loveh,&lovel,&lovek, deg, omega, yi, yi_righthandside,femmodel, matlitho);
++
++			LoveHf[deg*nfreq+fr]=loveh;
++			LoveKf[deg*nfreq+fr]=lovek-1.0;
++			LoveLf[deg*nfreq+fr]=lovel;
++
++			femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum); //synchronize nyi in case we deleted a layer
++			deleted_layer_offset=(matlitho->numlayers+1)*6-nyi;// =6 per deleted layer
++			kernel_index=deg*nfreq*(matlitho->numlayers+1)*6 +
++					    fr*(matlitho->numlayers+1)*6 +
++					        deleted_layer_offset;
++			for (int i=0;i<nyi;i++){
++				LoveKernelsReal[kernel_index+i]=yi_righthandside[i];
++			}
++		}
++	}
++
++
++	xDelete<IssmDouble>(yi);
++	xDelete<IssmDouble>(yi_righthandside);
++
++
++	//Temporal love numbers
++	if (istemporal){
++		int NTit;
++		femmodel->parameters->FindParam(&NTit,LoveNTemporalIterationsEnum);
++		int nt = nfreq/2/NTit;
++
++		IssmDouble* LoveHt=xNewZeroInit<IssmDouble>((sh_nmax+1)*nt);
++		IssmDouble* LoveLt=xNewZeroInit<IssmDouble>((sh_nmax+1)*nt);
++		IssmDouble* LoveKt=xNewZeroInit<IssmDouble>((sh_nmax+1)*nt);
++
++		love_freq_to_temporal(LoveHt,LoveLt,LoveKt,LoveHf,LoveLf,LoveKf,femmodel);
++
++		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKt,sh_nmax+1,nt,0,0));
++		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHt,sh_nmax+1,nt,0,0));
++		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLrEnum,LoveLt,sh_nmax+1,nt,0,0));
++
++		xDelete<IssmDouble>(LoveHt);
++		xDelete<IssmDouble>(LoveLt);
++		xDelete<IssmDouble>(LoveKt);
++	}
++
++	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKiEnum,LoveKf,sh_nmax+1,nfreq,0,0));
++	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHf,sh_nmax+1,nfreq,0,0));
++	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLf,sh_nmax+1,nfreq,0,0));
++
++
+ 	/*call the main module: */
+-	FourierLoveCorex(LoveKr,LoveKi,LoveHr,LoveHi,LoveLr,LoveLi,LoveKernelsReal,LoveKernelsImag,  //output
+-			nfreq,frequencies,sh_nmax,sh_nmin,g0,r0,mu0,allow_layer_deletion,forcing_type,verbosemod, //parameter inputs
+-			matlitho->numlayers, matlitho->radius, matlitho->viscosity, matlitho->lame_lambda, matlitho->lame_mu,
+-			matlitho->burgers_viscosity, matlitho->burgers_mu, matlitho->density, matlitho->isburgers, matlitho->issolid //matlitho inputs
+-			);
++	//if (false){
++	//FourierLoveCorex(LoveKr,LoveKi,LoveHr,LoveHi,LoveLr,LoveLi,LoveKernelsReal,LoveKernelsImag,  //output
++	//		nfreq,frequencies,sh_nmax,sh_nmin,g0,r0,mu0,allow_layer_deletion,forcing_type,verbosemod, //parameter inputs
++	//		matlitho->numlayers, matlitho->radius, matlitho->viscosity, matlitho->lame_lambda, matlitho->lame_mu,
++	//		matlitho->burgers_viscosity, matlitho->burgers_mu, matlitho->density, matlitho->rheologymodel, matlitho->issolid //matlitho inputs
++	//		);
++	//}
+ 
+ 	/*Add love matrices to results:*/
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKr,sh_nmax+1,nfreq,0,0));
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHr,sh_nmax+1,nfreq,0,0));
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLrEnum,LoveLr,sh_nmax+1,nfreq,0,0));
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKiEnum,LoveKi,sh_nmax+1,nfreq,0,0));
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHi,sh_nmax+1,nfreq,0,0));
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLi,sh_nmax+1,nfreq,0,0));
+-	/*Only when love_kernels is set unity*/
++	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKr,sh_nmax+1,nfreq,0,0));
++	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHr,sh_nmax+1,nfreq,0,0));
++	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLrEnum,LoveLr,sh_nmax+1,nfreq,0,0));
++	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKiEnum,LoveKi,sh_nmax+1,nfreq,0,0));
++	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHi,sh_nmax+1,nfreq,0,0));
++	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLi,sh_nmax+1,nfreq,0,0));
++
++	/*Only when love_kernels is on*/
+ 	if (love_kernels==1) {
+ 		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsRealEnum,LoveKernelsReal,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+-		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
++		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+ 	}
+ 
+-	/*Free ressources:*/
++	/*Free resources:*/
+ 	xDelete<IssmDouble>(frequencies);
+-	xDelete<IssmDouble>(LoveKr);
+-	xDelete<IssmDouble>(LoveHr);
+-	xDelete<IssmDouble>(LoveLr);
+-	xDelete<IssmDouble>(LoveKi);
+-	xDelete<IssmDouble>(LoveHi);
+-	xDelete<IssmDouble>(LoveLi);
++	xDelete<IssmDouble>(LoveKf);
++	xDelete<IssmDouble>(LoveHf);
++	xDelete<IssmDouble>(LoveLf);
++	//xDelete<IssmDouble>(LoveKi);
++	//xDelete<IssmDouble>(LoveHi);
++	//xDelete<IssmDouble>(LoveLi);
+ 	xDelete<IssmDouble>(LoveKernelsReal);
+ 	xDelete<IssmDouble>(LoveKernelsImag);
+-}
++} /*}}}*/
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26236-26237.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26236-26237.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26236-26237.diff	(revision 26740)
@@ -0,0 +1,170 @@
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26236)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26237)
+@@ -8,9 +8,8 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+-#include "petscblaslapack.h"
++#include <petscblaslapack.h>
+ 
+-
+ void love_init(FemModel* femmodel, Matlitho* matlitho){/*{{{*/
+ 	// initialize Planet_Mass(r) for efficient computation of gravity, value of surface gravity and inital size of the yi equation system
+ 	bool        verbosemod = (int)VerboseModule();
+@@ -41,8 +40,7 @@
+ 	int starting_layer=0;
+ 	femmodel->parameters->SetParam(nyi,LoveNYiEquationsEnum);
+ 	femmodel->parameters->SetParam(starting_layer,LoveStartingLayerEnum);
+-}
+-
++}/*}}}*/
+ void GetEarthRheology(IssmDouble* pla, IssmDouble* pmu, int layer_index, IssmDouble omega,FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 
+ 	//returns lame parameters (material rigity) lambda and mu for the right frequency and layer
+@@ -102,8 +100,6 @@
+ 	 *pmu=mu;
+ 
+ } /*}}}*/
+-
+-
+ IssmDouble GetGravity(IssmDouble r2, int layer_index, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//computes gravity at radius r2
+ 	IssmDouble* EarthMass;
+@@ -123,7 +119,6 @@
+ 	}
+ 	return	g= GG*M/pow(r2,2.0);
+ }/*}}}*/
+-
+ void fill_yi_prefactor(IssmDouble* yi_prefactor, int* pdeg, IssmDouble* pomega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//precalculates partial derivative factors for function yi_derivatives
+  IssmDouble ra=matlitho->radius[matlitho->numlayers];
+@@ -264,7 +259,6 @@
+ 	/*}}}*/
+ 	}
+ }/*}}}*/
+-
+ IssmDouble* yi_derivatives(IssmDouble* y, int layer_index, int n, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//computes yi derivatives at r=radius[layer_index]+ n/nstep*(radius[layer_index+1]-radius[layer_index])
+ 
+@@ -354,7 +348,6 @@
+ 	xDelete<IssmDouble>(dy);
+ 	return dydx;
+ }/*}}}*/
+-
+ void propagate_yi_euler(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+ 	//euler method
+@@ -373,7 +366,6 @@
+     }
+ 	xDelete<IssmDouble>(dydx);
+ }/*}}}*/
+-
+ void propagate_yi_RK2(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+ 	//Implements Runge-Kutta 2nd order (midpoint method)
+@@ -408,7 +400,6 @@
+ 	xDelete<IssmDouble>(y2);
+ 	xDelete<IssmDouble>(y3);
+ }/*}}}*/
+-
+ void propagate_yi_RK4(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+ 	//Implements Runge-Kutta 4th order
+@@ -464,7 +455,6 @@
+ 	xDelete<IssmDouble>(y2);
+ 	xDelete<IssmDouble>(y3);
+ }/*}}}*/
+-
+ void Innersphere_boundaryconditions(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//fills the boundary conditions at the bottom of layer[layer_index] in yi[0:2][0:5]
+ 
+@@ -516,7 +506,6 @@
+ 	yi[5+nyi*1]=-cst/(r*g0);
+ 	yi[5+nyi*2]=deg/(r*g0);
+ }/*}}}*/
+-
+ void build_yi_system(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho) { /*{{{*/
+ 
+ 	IssmDouble  g0,r0,mu0,x,ro1, GG;
+@@ -580,7 +569,7 @@
+ 		// Boundary Condition matrix - solid regions
+ 		if (matlitho->issolid[i]){
+ 			one = -1.0;
+-			if (i>0 & !matlitho->issolid[i-1]) one = 1.0;
++			if (i>0 && !matlitho->issolid[i-1]) one = 1.0;
+ 			for (int j=0;j<6;j++){
+ 				yi[(j+6*ici)+ nyi*(j+6*ici+3)] = one;
+ 			}
+@@ -626,7 +615,6 @@
+ 		yi[(nyi-1)+nyi*(nyi-1)]=1.0;
+ 	}
+ }/*}}}*/
+-
+ void yi_boundary_conditions(IssmDouble* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 
+ 	IssmDouble  g0,r0,mu0,ra,rb,rc;
+@@ -709,8 +697,6 @@
+ 		_error_("love core error: forcing_type not supported yet");
+ 	}
+ }/*}}}*/
+-
+-
+ void solve_yi_system(IssmDouble* loveh, IssmDouble* lovel, IssmDouble* lovek, int deg, IssmDouble omega, IssmDouble* yi, IssmDouble* rhs, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 
+ 	IssmDouble  g0,r0,mu0,loveratio,underflow_tol;
+@@ -830,13 +816,11 @@
+   	}
+ 	xDelete<IssmDouble>(frequencies);	
+ }/*}}}*/
+-
+ IssmDouble factorial(int n){ /*{{{*/
+ 	IssmDouble prod=1;
+ 	for (int i=2;i<n+1;i++) prod*=i;
+ 	return prod;
+ }/*}}}*/
+-
+ IssmDouble n_C_r(int n, int r){ /*{{{*/ 
+ 	//n choose r
+         int primes[169] = 
+@@ -878,8 +862,6 @@
+ 	IssmDouble res;        
+ 	return res = num/den;
+ }/*}}}*/
+-
+-
+ IssmDouble* postwidder_coef(int NTit){ /*{{{*/
+ 	//Coefficients of the Post-Widder method through Saltzer summation for inverse Laplace transform:
+ 	//The Mth iteration estimate will be: f(t)_M = sum_{k=1:2*M}(xi_[M,k] * f(s_k))
+@@ -902,7 +884,6 @@
+ 	}
+ 	return xi;
+ }/*}}}*/
+-
+ void postwidder_transform(IssmDouble* Lovet, IssmDouble* Lovef,int d, int t, int NTit, IssmDouble* xi, FemModel* femmodel){ /*{{{*/
+ 	//Computes Lovet for time step t and degree d from the PW coefficients xi and the corresponding 2*NTit frequency samples in Lovef
+ 
+@@ -933,7 +914,6 @@
+ 	}
+ 	Lovet[d*nt+t]=LoveM[NTit-1];
+ }/*}}}*/
+-
+ void love_freq_to_temporal(IssmDouble* LoveHt,IssmDouble* LoveLt,IssmDouble* LoveKt,IssmDouble* LoveHf,IssmDouble* LoveLf,IssmDouble* LoveKf, FemModel* femmodel){ /*{{{*/
+ 	//Transforms all frequency-dependent love numbers into time-dependent love numbers
+ 	int nfreq,sh_nmax,sh_nmin,indxi,indf, NTit;
+@@ -956,9 +936,6 @@
+ 	}
+ 	xDelete<IssmDouble>(xi);
+ }/*}}}*/
+-
+-
+-
+ void love_core(FemModel* femmodel){ /*{{{*/
+ 
+ 	/*recover materials parameters: there is only one Matlitho, chase it down the hard way:*/
+@@ -1119,4 +1096,3 @@
+ 	xDelete<IssmDouble>(LoveKernelsReal);
+ 	xDelete<IssmDouble>(LoveKernelsImag);
+ } /*}}}*/
+-
Index: /issm/oecreview/Archive/25834-26739/ISSM-26237-26238.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26237-26238.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26237-26238.diff	(revision 26740)
@@ -0,0 +1,82 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26237)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26238)
+@@ -6141,6 +6141,7 @@
+ 	IssmDouble dY21cos_dlat,dY21sin_dlat,dY20_dlat;
+ 	IssmDouble dY21cos_dlon,dY21sin_dlon;
+ 	IssmDouble LoveRotRSL,LoveRotU,LoveRothoriz;
++	IssmDouble polenudge;
+ 	/*}}}*/
+ 	/*Recover parameters:{{{ */
+ 	rho_earth=FindParam(MaterialsEarthDensityEnum);
+@@ -6276,7 +6277,21 @@
+ 		LoveRothoriz=(tide_love_l[2]/g)*pow(omega*planetradius,2.0);
+ 
+ 		for(int i=0;i<3;i++){
+-			lati=latitude[i];
++
++			//Avoid singularity of the poles
++			if (latitude[i]==M_PI/2.){
++				//North pole: nudge south
++				polenudge=-1.e12;
++			}
++			else if (latitude[i]==-M_PI/2.){
++				//South pole: nudge north
++				polenudge=1.e12;
++			}
++			else {
++				polenudge=0.0;
++			}
++
++			lati=latitude[i]+polenudge;
+ 			longi=longitude[i];
+ 
+ 			//Spherical harmonic functions of degree 2
+@@ -6284,30 +6299,31 @@
+ 			Y21sin= -0.5*sin(2.*lati)*sin(longi);
+ 			Y20   = -(1.0/6.0 - 0.5*cos(2.0*lati));
+ 
+-			Grotm1[i]=  LoveRotRSL*Y21cos;
+-			Grotm2[i]=  LoveRotRSL*Y21sin;
+-			Grotm3[i]=  LoveRotRSL*Y20;
++			Grotm1[i]= LoveRotRSL*Y21cos;
++			Grotm2[i]= LoveRotRSL*Y21sin;
++			Grotm3[i]= LoveRotRSL*Y20;
+ 
+ 			if (computeelastic){
+-				GUrotm1[i]=  LoveRotU*Y21cos;
+-				GUrotm2[i]=  LoveRotU*Y21sin;
+-				GUrotm3[i]=  LoveRotU*Y20;
++				GUrotm1[i]= LoveRotU*Y21cos;
++				GUrotm2[i]= LoveRotU*Y21sin;
++				GUrotm3[i]= LoveRotU*Y20;
+ 				if (horiz){
+ 				//bed_N = Love_l * d(Y)/dlat ;
+ 				dY21cos_dlat=-cos(2.*lati)*cos(longi);
+ 				dY21sin_dlat=-cos(2.*lati)*sin(longi);
+-				dY20_dlat=-sin(2.0*lati);
+-				GNrotm1[i]=  LoveRothoriz*dY21cos_dlat;
+-				GNrotm2[i]=  LoveRothoriz*dY21sin_dlat;
+-				GNrotm3[i]=  LoveRothoriz*dY20_dlat;
++				dY20_dlat=   -sin(2.*lati);
++				GNrotm1[i]= LoveRothoriz*dY21cos_dlat;
++				GNrotm2[i]= LoveRothoriz*dY21sin_dlat;
++				GNrotm3[i]= LoveRothoriz*dY20_dlat;
+ 
+ 				//bed_E = Love_l * 1/cos(lat) * d(Y)/dlon ;
+-				dY21cos_dlon=-Y21sin;
+-				dY21sin_dlon=Y21cos;
++				dY21cos_dlon=-Y21sin/cos(lati);
++				dY21sin_dlon=Y21cos/cos(lati);
+ 				//dY20_dlon=0.;
+-				GNrotm1[i]=  LoveRothoriz*dY21cos_dlon/cos(lati);
+-				GNrotm2[i]=  LoveRothoriz*dY21sin_dlon/cos(lati);
+-				GNrotm3[i]=  0.0;
++
++				GErotm1[i]= LoveRothoriz*dY21cos_dlon;
++				GErotm2[i]= LoveRothoriz*dY21sin_dlon;
++				GErotm3[i]= 0.0;
+ 				}
+ 			}
+ 		}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26238-26239.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26238-26239.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26238-26239.diff	(revision 26740)
@@ -0,0 +1,178 @@
+Index: ../trunk-jpl/externalpackages/emscripten/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/emscripten/install.sh	(revision 26238)
++++ ../trunk-jpl/externalpackages/emscripten/install.sh	(revision 26239)
+@@ -4,34 +4,44 @@
+ 
+ # TODO:
+ # - Introduce build step to $ISSM_DIR/jenkins/jenkins.sh to compile Fortran code in $ISSM_DIR/src/c/modules/GiaDefelectionCorex/ to C with f2c
+-#	- Then, revert $ISSM_DIR/externalpackages/emscripten/install.sh to r24306 and test clean build
+-#	- When builtin support for Fortran is available, remove build step
++#       - Then, revert $ISSM_DIR/externalpackages/emscripten/install.sh to r24306 and test clean build
++#       - When builtin support for Fortran is available, remove build step
+ #
+ 
++## Constants
++#
+ VER="latest" # Set this to "latest", or last tag that works in case of failure
+ 
++## Environment
++#
++PREFIX="${ISSM_DIR}/externalpackages/emscripten/install"
++
+ # Get Emscripten SDK (emsdk) driver if we have not previously installed
+ # Emscripten. Otherwise, just get the latest version.
+-if [[ ! -d ./install ]]; then
+-	# Get the emsdk repo
+-	git clone https://github.com/emscripten-core/emsdk.git
++if [[ ! -d ${PREFIX} ]]; then
++        # Get the emsdk repo
++        git clone https://github.com/emscripten-core/emsdk.git
+ 
+-	# Move source to 'install' directory
+-	mv ./emsdk ./install
++        # Create $PREFIX directory
++        mkdir -p ${PREFIX}
+ 
+-	cd ./install
++        # Move source to $PREFIX directory
++        mv emsdk/* ${PREFIX}
++        rm -rf emsdk
++
++        cd ${PREFIX}
+ else
+-	# Fetch the latest version of the emsdk
+-	cd ./install
+-	git pull
++        # Fetch the latest version of the emsdk
++        cd ${PREFIX}
++        git pull
+ fi
+ 
+ # Download and install the latest SDK tools.
+-./emsdk install $VER
++./emsdk install ${VER}
+ 
+ # Make the "latest" SDK "active" for the current user. (writes ~/.emscripten
+ # file)
+-./emsdk activate $VER
++./emsdk activate ${VER}
+ 
+ # Activate PATH and other environment variables in the current terminal
+ source ./emsdk_env.sh
+Index: ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 26238)
++++ ../trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 26239)
+@@ -42,7 +42,6 @@
+ 	--download-zlib=1 \
+ 	--download-hdf5=1
+ 
+-
+ # Compile and install
+ make
+ make install
+Index: ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26238)
++++ ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26239)
+@@ -1,24 +1,34 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Some cleanup
+-rm -rf install petsc-3.13.3 src
+-mkdir install src
+ 
+-#Download from ISSM server
+-#$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.13.3.tar.gz' 'petsc-3.13.3.tar.gz'
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.3.tar.gz' 'petsc-3.13.3.tar.gz'
++## Constants
++#
++VER="3.13.6"
+ 
+-#Untar and move petsc to install directory
+-tar -zxvf  petsc-3.13.3.tar.gz
+-mv petsc-3.13.3/* src/
+-rm -rf petsc-3.13.3
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz' 'petsc-${VER}.tar.gz'
+ 
+-#configure (based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables look for CONFIGURE_OPTIONS)
+-cd src
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir ${PETSC_DIR}
++
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
++rm -rf petsc-${VER}
++
++
++# Configure
++#
++# NOTE: Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables; look for CONFIGURE_OPTIONS
++#
++cd ${PETSC_DIR}
+ ./config/configure.py \
+-	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+-	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
+ 	--with-cc=icc --with-cxx=icpc --with-fc=ifort --with-f77=ifort\
+ 	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
+ 	--with-blas-lapack-dir="/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/" \
+Index: ../trunk-jpl/externalpackages/petsc/install-3.14-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.14-linux.sh	(revision 26238)
++++ ../trunk-jpl/externalpackages/petsc/install-3.14-linux.sh	(revision 26239)
+@@ -3,8 +3,12 @@
+ 
+ 
+ ## Constants
++#
+ VER="3.14.0"
+ 
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+ 
+@@ -12,18 +16,18 @@
+ tar -zxvf petsc-${VER}.tar.gz
+ 
+ # Cleanup
+-rm -rf install src
+-mkdir install src
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir ${PETSC_DIR}
+ 
+-# Move source to 'src' directory
+-mv petsc-${VER}/* src/
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
+ rm -rf petsc-${VER}
+ 
+ # Configure
+-cd src
++cd ${PETSC_DIR}
+ ./config/configure.py \
+-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
+-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
+ 	--with-debugging=0 \
+ 	--with-valgrind=0 \
+ 	--with-x=0 \
+@@ -38,7 +42,6 @@
+ 	--download-zlib=1 \
+ 	--download-hdf5=1
+ 
+-
+ # Compile and install
+ make
+ make install
Index: /issm/oecreview/Archive/25834-26739/ISSM-26239-26240.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26239-26240.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26239-26240.diff	(revision 26740)
@@ -0,0 +1,51552 @@
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/mac/packages/VPISparseGrid/src/sandia_rules.cpp
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/mac/packages/VPISparseGrid/src/sandia_rules.cpp	(revision 26239)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/mac/packages/VPISparseGrid/src/sandia_rules.cpp	(nonexistent)
+@@ -1,25739 +0,0 @@
+-# include "sandia_rules.hpp"
+-
+-# include <cstdlib>
+-# include <iomanip>
+-# include <iostream>
+-# include <cmath>
+-# include <ctime>
+-
+-namespace webbur
+-{
+-//****************************************************************************80
+-
+-void binary_vector_next ( int n, int bvec[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    BINARY_VECTOR_NEXT generates the next binary vector.
+-//
+-//  Discussion:
+-//
+-//    A binary vector is a vector whose entries are 0 or 1.
+-//
+-//    The user inputs an initial zero vector to start.  The program returns
+-//    the "next" vector.
+-//
+-//    The vectors are produced in the order:
+-//
+-//    ( 0, 0, 0, ..., 0 )
+-//    ( 1, 0, 0, ..., 0 )
+-//    ( 0, 1, 0, ..., 0 )
+-//    ( 1, 1, 0, ..., 0 )
+-//    ( 0, 0, 1, ..., 0 )
+-//    ( 1, 0, 1, ..., 0 )
+-//               ...
+-//    ( 1, 1, 1, ..., 1)
+-//
+-//    and the "next" vector after (1,1,...,1) is (0,0,...,0).  That is,
+-//    we allow wrap around.
+-//
+-//  Example:
+-//
+-//    N = 3
+-//
+-//    Input      Output
+-//    -----      ------
+-//    0 0 0  =>  1 0 0
+-//    1 0 0  =>  0 1 0
+-//    0 1 0  =>  1 1 0
+-//    1 1 0  =>  0 0 1
+-//    0 0 1  =>  1 0 1
+-//    1 0 1  =>  0 1 1
+-//    0 1 1  =>  1 1 1
+-//    1 1 1  =>  0 0 0
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 September 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the dimension of the vectors.
+-//
+-//    Input/output, int BVEC[N], on output, the successor
+-//    to the input vector.
+-//
+-{
+-  int i;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    if ( bvec[i] == 1 )
+-    {
+-      bvec[i] = 0;
+-    }
+-    else
+-    {
+-      bvec[i] = 1;
+-      break;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ccn_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CCN_COMPUTE computes a nested Clenshaw Curtis quadrature rule.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::ccn_compute_points ( n, x );
+-  webbur::ccn_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ccn_compute_np ( int n, int np, double p[], double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CCN_COMPUTE_NP computes a nested Clenshaw Curtis quadrature rule.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::ccn_compute_points ( n, x );
+-  webbur::ccn_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ccn_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CCN_COMPUTE_POINTS: compute nested Clenshaw Curtis points.
+-//
+-//  Discussion:
+-//
+-//    We want to compute the following sequence:
+-//
+-//    1/2,
+-//    0, 1
+-//    1/4, 3/4
+-//    1/8, 3/8, 5/8, 7/8,
+-//    1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16, and so on.
+-//
+-//    But we would prefer that the numbers in each row be regrouped in pairs
+-//    that are symmetric about 1/2, with the number above 1/2 coming first.
+-//    Thus, the last row might become:
+-//    (9/16, 7/16), (11/16, 5/16), ..., (15/16, 1/16).
+-//
+-//    Once we have our sequence, we apply the Chebyshev transformation
+-//    which maps [0,1] to [-1,+1].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    06 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of elements to compute.
+-//
+-//    Output, double X[N], the elements of the sequence.
+-//
+-{
+-  int d;
+-  int i;
+-  int k;
+-  int m;
+-  double pi = 3.141592653589793;
+-  int td;
+-  int tu;
+-//
+-//  Handle first three entries specially.
+-//
+-  if ( 1 <= n )
+-  {
+-    x[0] = 0.5;
+-  }
+-
+-  if ( 2 <= n )
+-  {
+-    x[1] = 1.0;
+-  }
+-
+-  if ( 3 <= n )
+-  {
+-    x[2] = 0.0;
+-  }
+-
+-  m = 3;
+-  d = 2;
+-
+-  while ( m < n )
+-  {
+-    tu = d + 1;
+-    td = d - 1;
+-
+-    k = webbur::i4_min ( d, n - m );
+-
+-    for ( i = 1; i <= k; i++ )
+-    {
+-      if ( ( i % 2 ) == 1 )
+-      {
+-        x[m+i-1] = tu / 2.0 / ( double ) ( k );
+-        tu = tu + 2;
+-      }
+-      else
+-      {
+-        x[m+i-1] = td / 2.0 / ( double ) ( k );
+-        td = td - 2;
+-      }
+-    }
+-    m = m + k;
+-    d = d * 2;
+-  }
+-//
+-//  Apply the Chebyshev transformation.
+-//
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = std::cos ( x[i] * pi );
+-  }
+-  x[0] = 0.0;
+-
+-  if ( 2 <= n )
+-  {
+-    x[1] = -1.0;
+-  }
+-
+-  if ( 3 <= n )
+-  {
+-    x[2] = +1.0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ccn_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CCN_COMPUTE_POINTS_NP: nested Clenshaw Curtis quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::ccn_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ccn_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CCN_COMPUTE_WEIGHTS: weights for nested Clenshaw Curtis rule.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order of the rule.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double *x;
+-  double x_max;
+-  double x_min;
+-
+-  x = new double[n];
+-
+-  webbur::ccn_compute_points ( n, x );
+-//
+-//  Get the weights.
+-//
+-  x_min = -1.0;
+-  x_max = +1.0;
+-
+-  webbur::nc_compute ( n, x_min, x_max, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ccn_compute_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CCN_COMPUTE_WEIGHTS_NP: nested Clenshaw Curtis quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::ccn_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev1_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV1_COMPUTE computes a Chebyshev type 1 quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) F(X) / sqrt ( 1 - x^2 ) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int i;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CHEBYSHEV1_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = pi / ( double ) ( n );
+-  }
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = std::cos ( pi * ( double ) ( 2 * n - 1 - 2 * i )
+-                         / ( double ) ( 2 * n ) );
+-  }
+-  if ( ( n % 2 ) == 1 )
+-  {
+-    x[(n-1)/2] = 0.0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev1_compute_np ( int n, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV1_COMPUTE_NP computes a Chebyshev type 1 quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) F(X) / sqrt ( 1 - x^2 ) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::chebyshev1_compute ( n, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev1_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV1_COMPUTE_POINTS computes Chebyshev type 1 quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int i;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CHEBYSHEV1_COMPUTE_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] =  std::cos ( pi * ( double ) ( 2 * n - 1 - 2 * i )
+-                          / ( double ) ( 2 * n ) );
+-  }
+-  if ( ( n % 2 ) == 1 )
+-  {
+-    x[(n-1)/2] = 0.0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev1_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV1_COMPUTE_POINTS_NP computes Chebyshev type 1 quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::chebyshev1_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev1_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV1_COMPUTE_WEIGHTS computes Chebyshev type 1 quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int i;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CHEBYSHEV1_COMPUTE_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = pi / ( double ) ( n );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev1_compute_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV1_COMPUTE_WEIGHTS_NP: Chebyshev type 1 quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::chebyshev1_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double chebyshev1_integral ( int expon )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV1_INTEGRAL evaluates a monomial Chebyshev type 1 integral.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -1 <= x <= +1 ) x^n / sqrt ( 1 - x^2 ) dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent.
+-//
+-//    Output, double CHEBYSHEV1_INTEGRAL, the value of the exact integral.
+-//
+-{
+-  double bot;
+-  double exact;
+-  int i;
+-  double pi = 3.141592653589793;
+-  double top;
+-//
+-//  Get the exact value of the integral.
+-//
+-  if ( ( expon % 2 ) == 0 )
+-  {
+-    top = 1;
+-    bot = 1;
+-    for ( i = 2; i <= expon; i = i + 2 )
+-    {
+-      top = top * ( i - 1 );
+-      bot = bot *   i;
+-    }
+-
+-    exact = pi * ( double ) ( top ) / ( double ) ( bot );
+-  }
+-  else
+-  {
+-    exact = 0.0;
+-  }
+-
+-  return exact;
+-}
+-//****************************************************************************80
+-
+-void chebyshev2_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV2_COMPUTE computes a Chebyshev type 2 quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -1 <= x <= 1 ) f(x)  sqrt ( 1 - x^2 )  dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double angle;
+-  int i;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CHEBYSHEV2_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
+-    w[i] = pi / ( double ) ( n + 1 ) * std::pow ( std::sin ( angle ), 2 );
+-    x[i] = std::cos ( angle );
+-  }
+-
+-  if ( ( n % 2 ) == 1 )
+-  {
+-    x[(n-1)/2] = 0.0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev2_compute_np ( int n, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV2_COMPUTE_NP computes a Chebyshev type 2 quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) F(X)  sqrt ( 1 - x^2 )  dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::chebyshev2_compute ( n, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev2_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV2_COMPUTE_POINTS computes Chebyshev type 2 quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  double angle;
+-  int i;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CHEBYSHEV2_COMPUTE_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
+-    x[i] =  std::cos ( angle );
+-  }
+-
+-  if ( ( n % 2 ) == 1 )
+-  {
+-    x[(n-1)/2] = 0.0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev2_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV2_COMPUTE_POINTS_NP computes Chebyshev type 2 quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    03 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::chebyshev2_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev2_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV2_COMPUTE_WEIGHTS computes Chebyshev type 2 quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double angle;
+-  int i;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CHEBYSHEV2_COMPUTE_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
+-    w[i] = pi / ( double ) ( n + 1 ) * std::pow ( std::sin ( angle ), 2 );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void chebyshev2_compute_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV2_COMPUTE_WEIGHTS_NP: Chebyshev type 2 quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::chebyshev2_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double chebyshev2_integral ( int expon )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CHEBYSHEV2_INTEGRAL evaluates a monomial Chebyshev type 2 integral.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -1 <= x <= +1 ) x^n * sqrt ( 1 - x^2 ) dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent.
+-//
+-//    Output, double CHEBYSHEV2_INTEGRAL, the value of the exact integral.
+-//
+-{
+-  double bot;
+-  double exact;
+-  int i;
+-  double pi = 3.141592653589793;
+-  double top;
+-//
+-//  Get the exact value of the integral.
+-//
+-  if ( ( expon % 2 ) == 0 )
+-  {
+-    top = 1;
+-    bot = 1;
+-    for ( i = 2; i <= expon; i = i + 2 )
+-    {
+-      top = top * ( i - 1 );
+-      bot = bot *   i;
+-    }
+-
+-	bot = bot * ( double ) ( expon + 2 );
+-
+-    exact = pi * ( double ) ( top ) / ( double ) ( bot );
+-  }
+-  else
+-  {
+-    exact = 0.0;
+-  }
+-  return exact;
+-}
+-//****************************************************************************80
+-
+-void clenshaw_curtis_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CLENSHAW_CURTIS_COMPUTE computes a Clenshaw Curtis quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 March 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double b;
+-  int i;
+-  int j;
+-  double pi = 3.141592653589793;
+-  double theta;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CLENSHAW_CURTIS_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-  else if ( n == 1 )
+-  {
+-    x[0] = 0.0;
+-    w[0] = 2.0;
+-  }
+-  else
+-  {
+-    for ( i = 0; i < n; i++ )
+-    {
+-      x[i] =  std::cos ( ( double ) ( n - 1 - i ) * pi
+-                       / ( double ) ( n - 1     ) );
+-    }
+-    x[0] = -1.0;
+-    if ( ( n % 2 ) == 1 )
+-    {
+-      x[(n-1)/2] = 0.0;
+-    }
+-    x[n-1] = +1.0;
+-
+-    for ( i = 0; i < n; i++ )
+-    {
+-      theta = ( double ) ( i ) * pi / ( double ) ( n - 1 );
+-
+-      w[i] = 1.0;
+-
+-      for ( j = 1; j <= ( n - 1 ) / 2; j++ )
+-      {
+-        if ( 2 * j == ( n - 1 ) )
+-        {
+-          b = 1.0;
+-        }
+-        else
+-        {
+-          b = 2.0;
+-        }
+-
+-        w[i] = w[i] - b *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+-          / ( double ) ( 4 * j * j - 1 );
+-      }
+-    }
+-
+-    w[0] = w[0] / ( double ) ( n - 1 );
+-    for ( i = 1; i < n - 1; i++ )
+-    {
+-      w[i] = 2.0 * w[i] / ( double ) ( n - 1 );
+-    }
+-    w[n-1] = w[n-1] / ( double ) ( n - 1 );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void clenshaw_curtis_compute_np ( int n, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CLENSHAW_CURTIS_COMPUTE_NP computes a Clenshaw Curtis quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::clenshaw_curtis_compute ( n, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void clenshaw_curtis_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CLENSHAW_CURTIS_COMPUTE_POINTS computes Clenshaw Curtis quadrature points.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    This rule is defined on [-1,1].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int index;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CLENSHAW_CURTIS_COMPUTE_POINTS - Fatal error!\n";
+-    std::cerr << "  N < 1.\n";
+-    std::exit ( 1 );
+-  }
+-  else if ( n == 1 )
+-  {
+-    x[0] = 0.0;
+-  }
+-  else
+-  {
+-    for ( index = 1; index <= n; index++ )
+-    {
+-      x[index-1] =  std::cos ( ( double ) ( n - index ) * pi
+-                             / ( double ) ( n - 1     ) );
+-    }
+-    x[0] = -1.0;
+-    if ( ( n % 2 ) == 1 )
+-    {
+-      x[(n-1)/2] = 0.0;
+-    }
+-    x[n-1] = +1.0;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void clenshaw_curtis_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CLENSHAW_CURTIS_COMPUTE_POINTS_NP: Clenshaw Curtis quadrature points.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    This rule is defined on [-1,1].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::clenshaw_curtis_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void clenshaw_curtis_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CLENSHAW_CURTIS_COMPUTE_WEIGHTS computes Clenshaw Curtis quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    The user must preallocate space for the output array W.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Charles Clenshaw, Alan Curtis,
+-//    A Method for Numerical Integration on an Automatic Computer,
+-//    Numerische Mathematik,
+-//    Volume 2, Number 1, December 1960, pages 197-205.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double b;
+-  int i;
+-  int j;
+-  double pi = 3.141592653589793;
+-  double theta;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "CLENSHAW_CURTIS_COMPUTE_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  N < 1.\n";
+-    std::exit ( 1 );
+-  }
+-  else if ( n == 1 )
+-  {
+-    w[0] = 2.0;
+-    return;
+-  }
+-
+-  for ( i = 1; i <= n; i++ )
+-  {
+-    theta = ( double ) ( i - 1 ) * pi / ( double ) ( n - 1 );
+-
+-    w[i-1] = 1.0;
+-
+-    for ( j = 1; j <= ( n - 1 ) / 2; j++ )
+-    {
+-      if ( 2 * j == ( n - 1 ) )
+-      {
+-        b = 1.0;
+-      }
+-      else
+-      {
+-        b = 2.0;
+-      }
+-
+-      w[i-1] = w[i-1] - b *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+-           / ( double ) ( 4 * j * j - 1 );
+-    }
+-  }
+-
+-  w[0] = w[0] / ( double ) ( n - 1 );
+-  for ( i = 1; i < n - 1; i++ )
+-  {
+-    w[i] = 2.0 * w[i] / ( double ) ( n - 1 );
+-  }
+-  w[n-1] = w[n-1] / ( double ) ( n - 1 );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void clenshaw_curtis_compute_weights_np ( int n, int np, double p[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CLENSHAW_CURTIS_COMPUTE_WEIGHTS_NP: Clenshaw Curtis quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    The user must preallocate space for the output array W.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Charles Clenshaw, Alan Curtis,
+-//    A Method for Numerical Integration on an Automatic Computer,
+-//    Numerische Mathematik,
+-//    Volume 2, Number 1, December 1960, pages 197-205.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::clenshaw_curtis_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void comp_next ( int n, int k, int a[], bool *more, int *h, int *t )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    COMP_NEXT computes the compositions of the integer N into K parts.
+-//
+-//  Discussion:
+-//
+-//    A composition of the integer N into K parts is an ordered sequence
+-//    of K nonnegative integers which sum to N.  The compositions (1,2,1)
+-//    and (1,1,2) are considered to be distinct.
+-//
+-//    The routine computes one composition on each call until there are no more.
+-//    For instance, one composition of 6 into 3 parts is
+-//    3+2+1, another would be 6+0+0.
+-//
+-//    On the first call to this routine, set MORE = FALSE.  The routine
+-//    will compute the first element in the sequence of compositions, and
+-//    return it, as well as setting MORE = TRUE.  If more compositions
+-//    are desired, call again, and again.  Each time, the routine will
+-//    return with a new composition.
+-//
+-//    However, when the LAST composition in the sequence is computed
+-//    and returned, the routine will reset MORE to FALSE, signaling that
+-//    the end of the sequence has been reached.
+-//
+-//    This routine originally used a SAVE statement to maintain the
+-//    variables H and T.  I have decided that it is safer
+-//    to pass these variables as arguments, even though the user should
+-//    never alter them.  This allows this routine to safely shuffle
+-//    between several ongoing calculations.
+-//
+-//
+-//    There are 28 compositions of 6 into three parts.  This routine will
+-//    produce those compositions in the following order:
+-//
+-//     I         A
+-//     -     ---------
+-//     1     6   0   0
+-//     2     5   1   0
+-//     3     4   2   0
+-//     4     3   3   0
+-//     5     2   4   0
+-//     6     1   5   0
+-//     7     0   6   0
+-//     8     5   0   1
+-//     9     4   1   1
+-//    10     3   2   1
+-//    11     2   3   1
+-//    12     1   4   1
+-//    13     0   5   1
+-//    14     4   0   2
+-//    15     3   1   2
+-//    16     2   2   2
+-//    17     1   3   2
+-//    18     0   4   2
+-//    19     3   0   3
+-//    20     2   1   3
+-//    21     1   2   3
+-//    22     0   3   3
+-//    23     2   0   4
+-//    24     1   1   4
+-//    25     0   2   4
+-//    26     1   0   5
+-//    27     0   1   5
+-//    28     0   0   6
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    02 July 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Albert Nijenhuis, Herbert Wilf.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Albert Nijenhuis, Herbert Wilf,
+-//    Combinatorial Algorithms for Computers and Calculators,
+-//    Second Edition,
+-//    Academic Press, 1978,
+-//    ISBN: 0-12-519260-6,
+-//    LC: QA164.N54.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the integer whose compositions are desired.
+-//
+-//    Input, int K, the number of parts in the composition.
+-//
+-//    Input/output, int A[K], the parts of the composition.
+-//
+-//    Input/output, bool *MORE.
+-//    Set MORE = FALSE on first call.  It will be reset to TRUE on return
+-//    with a new composition.  Each new call returns another composition until
+-//    MORE is set to FALSE when the last composition has been computed
+-//    and returned.
+-//
+-//    Input/output, int *H, *T, two internal parameters needed for the
+-//    computation.  The user should allocate space for these in the calling
+-//    program, include them in the calling sequence, but never alter them!
+-//
+-{
+-  int i;
+-
+-  if ( !( *more ) )
+-  {
+-    *t = n;
+-    *h = 0;
+-    a[0] = n;
+-    for ( i = 1; i < k; i++ )
+-    {
+-       a[i] = 0;
+-    }
+-  }
+-  else
+-  {
+-    if ( 1 < *t )
+-    {
+-      *h = 0;
+-    }
+-    *h = *h + 1;
+-    *t = a[*h-1];
+-    a[*h-1] = 0;
+-    a[0] = *t - 1;
+-    a[*h] = a[*h] + 1;
+-  }
+-
+-  *more = ( a[k-1] != n );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double cpu_time ( )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    CPU_TIME reports the elapsed CPU time.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 July 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Output, double CPU_TIME, the current total elapsed CPU time in second.
+-//
+-{
+-  double value;
+-
+-  value = ( double ) std::clock ( ) / ( double ) CLOCKS_PER_SEC;
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void dif_deriv ( int nd, double xd[], double yd[], int *ndp, double xdp[],
+-  double ydp[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    DIF_DERIV computes the derivative of a polynomial in divided difference form.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 June 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Carl deBoor,
+-//    A Practical Guide to Splines,
+-//    Springer, 2001,
+-//    ISBN: 0387953663,
+-//    LC: QA1.A647.v27.
+-//
+-//  Parameters:
+-//
+-//    Input, int ND, the size of the input table.
+-//
+-//    Input, double XD[ND], the abscissas for the divided
+-//    difference table.
+-//
+-//    Input, double YD[ND], the divided difference table.
+-//
+-//    Output, int *NDP, the size of the output table, which is ND-1.
+-//
+-//    Input, double XDP[NP], the abscissas for the divided
+-//    difference table for the derivative.
+-//
+-//    Output, double YDP[NDP], the divided difference
+-//    table for the derivative.
+-//
+-{
+-  int i;
+-  double *xd_temp;
+-  double *yd_temp;
+-//
+-//  Using a temporary copy of the difference table, shift the
+-//  abscissas to zero.
+-//
+-  xd_temp = new double[nd];
+-  yd_temp = new double[nd];
+-
+-  for ( i = 0; i < nd; i++ )
+-  {
+-    xd_temp[i] = xd[i];
+-  }
+-  for ( i = 0; i < nd; i++ )
+-  {
+-    yd_temp[i] = yd[i];
+-  }
+-
+-  webbur::dif_shift_zero ( nd, xd_temp, yd_temp );
+-//
+-//  Construct the derivative.
+-//
+-  *ndp = nd - 1;
+-
+-  for ( i = 0; i < *ndp; i++ )
+-  {
+-    xdp[i] = 0.0;
+-  }
+-
+-  for ( i = 0; i < *ndp; i++ )
+-  {
+-    ydp[i] = ( double ) ( i + 1 ) * yd_temp[i+1];
+-  }
+-
+-  delete [] xd_temp;
+-  delete [] yd_temp;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void dif_shift_x ( int nd, double xd[], double yd[], double xv )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    DIF_SHIFT_X replaces one abscissa of a divided difference table with a new one.
+-//
+-//  Discussion:
+-//
+-//    This routine shifts the representation of a divided difference polynomial by
+-//    dropping the last X value in XD, and adding a new X value to the
+-//    beginning of the Xd array, suitably modifying the coefficients stored
+-//    in YD.
+-//
+-//    The representation of the polynomial is changed, but the polynomial itself
+-//    should be identical.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 June 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Carl deBoor,
+-//    A Practical Guide to Splines,
+-//    Springer, 2001,
+-//    ISBN: 0387953663,
+-//    LC: QA1.A647.v27.
+-//
+-//  Parameters:
+-//
+-//    Input, int ND, the number of divided difference coefficients, and
+-//    the number of entries in XD.
+-//
+-//    Input/output, double XD[ND], the X values used in the representation of
+-//    the divided difference polynomial.  After a call to this routine, the
+-//    last entry of XD has been dropped, the other
+-//    entries have shifted up one index, and XV has been inserted at the
+-//    beginning of the array.
+-//
+-//    Input/output, double YD[ND], the divided difference coefficients
+-//    corresponding to the XD array.  On output, this array has been
+-//    adjusted.
+-//
+-//    Input, double XV, a new X value which is to be used in the representation
+-//    of the polynomial.  On output, XD[0] equals XV and the representation
+-//    of the polynomial has been suitably changed.
+-//    Note that XV does not have to be distinct from any of the original XD
+-//    values.
+-//
+-{
+-  int i;
+-//
+-//  Recompute the divided difference coefficients.
+-//
+-  for ( i = nd - 2; 0 <= i; i-- )
+-  {
+-    yd[i] = yd[i] + ( xv - xd[i] ) * yd[i+1];
+-  }
+-//
+-//  Shift the X values up one position and insert XV.
+-//
+-  for ( i = nd - 1; 0 < i; i-- )
+-  {
+-    xd[i] = xd[i-1];
+-  }
+-
+-  xd[0] = xv;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void dif_shift_zero ( int nd, double xd[], double yd[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    DIF_SHIFT_ZERO shifts a divided difference table so that all abscissas are zero.
+-//
+-//  Discussion:
+-//
+-//    When the abscissas are changed, the coefficients naturally
+-//    must also be changed.
+-//
+-//    The resulting pair (XD, YD) still represents the
+-//    same polynomial, but the entries in YD are now the
+-//    standard polynomial coefficients.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 June 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Carl deBoor,
+-//    A Practical Guide to Splines,
+-//    Springer, 2001,
+-//    ISBN: 0387953663,
+-//    LC: QA1.A647.v27.
+-//
+-//  Parameters:
+-//
+-//    Input, int ND, the length of the XD and YD arrays.
+-//
+-//    Input/output, double XD[ND], the X values that correspond to the
+-//    divided difference table.  On output, XD contains only zeroes.
+-//
+-//    Input/output, double YD[ND], the divided difference table
+-//    for the polynomial.  On output, YD is also
+-//    the coefficient array for the standard representation
+-//    of the polynomial.
+-//
+-{
+-  int i;
+-  double xv;
+-
+-  xv = 0.0;
+-
+-  for ( i = 1; i <= nd; i++ )
+-  {
+-    webbur::dif_shift_x ( nd, xd, yd, xv );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void dif_to_r8poly ( int nd, double xd[], double yd[], double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    DIF_TO_R8POLY converts a divided difference table to a standard polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    21 February 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Carl deBoor,
+-//    A Practical Guide to Splines,
+-//    Springer, 2001,
+-//    ISBN: 0387953663,
+-//    LC: QA1.A647.v27.
+-//
+-//  Parameters:
+-//
+-//    Input, int ND, the number of coefficients, and abscissas.
+-//
+-//    Input, double XD[ND], the X values used in the divided difference
+-//    representation of the polynomial.
+-//
+-//    Input, double YD[ND], the divided difference table.
+-//
+-//    Output, double C[ND], the standard form polyomial coefficients.
+-//    C[0] is the constant term, and C[ND-1] is the coefficient
+-//    of X^(ND-1).
+-//
+-{
+-  int i;
+-  int j;
+-
+-  for ( i = 0; i < nd; i++ )
+-  {
+-    c[i] = yd[i];
+-  }
+-//
+-//  Recompute the divided difference coefficients.
+-//
+-  for ( j = 1; j <= nd - 1; j++ )
+-  {
+-    for ( i = 1; i <= nd - j; i++ )
+-    {
+-      c[nd-i-1] = c[nd-i-1] - xd[nd-i-j] * c[nd-i];
+-    }
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void fejer2_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    FEJER2_COMPUTE computes a Fejer type 2 rule.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    The rule is defined on [-1,1].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int i;
+-  int j;
+-  double p;
+-  double pi = 3.141592653589793;
+-  double theta;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "FEJER2_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-  else if ( n == 1 )
+-  {
+-    x[0] = 0.0;
+-    w[0] = 2.0;
+-    return;
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] =  std::cos ( ( double ) ( n - i ) * pi
+-                     / ( double ) ( n + 1 ) );
+-  }
+-  if ( ( n % 2 ) == 1 )
+-  {
+-    x[(n-1)/2] = 0.0;
+-  }
+-
+-  if ( n == 2 )
+-  {
+-    w[0] = 1.0;
+-    w[1] = 1.0;
+-  }
+-  else
+-  {
+-    for ( i = 0; i < n; i++ )
+-    {
+-      theta = ( double ) ( n - i ) * pi
+-            / ( double ) ( n + 1 );
+-
+-      w[i] = 1.0;
+-
+-      for ( j = 1; j <= ( ( n - 1 ) / 2 ); j++ )
+-      {
+-        w[i] = w[i] - 2.0 *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+-          / ( double ) ( 4 * j * j - 1 );
+-      }
+-      p = 2.0 * ( double ) ( ( ( n + 1 ) / 2 ) ) - 1.0;
+-      w[i] = w[i] -  std::cos ( ( p + 1.0 ) * theta ) / p;
+-    }
+-    for ( i = 0; i < n; i++ )
+-    {
+-      w[i] = 2.0 * w[i] / ( double ) ( n + 1 );
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void fejer2_compute_np ( int n, int np, double p[], double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    FEJER2_COMPUTE_NP computes a Fejer type 2 rule.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    The rule is defined on [-1,1].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::fejer2_compute ( n, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void fejer2_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    FEJER2_COMPUTE_POINTS computes Fejer type 2 quadrature points.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    The rule is defined on [-1,1].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int i;
+-  double pi = 3.141592653589793;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "FEJER2_COMPUTE_POINTS - Fatal error!\n";
+-    std::cerr << "  N < 1.\n";
+-    std::exit ( 1 );
+-  }
+-  else if ( n == 1 )
+-  {
+-    x[0] = 0.0;
+-  }
+-  else
+-  {
+-    for ( i = 1; i <= n; i++ )
+-    {
+-      x[i-1] =  std::cos ( ( double ) ( n + 1 - i ) * pi
+-                         / ( double ) ( n + 1 ) );
+-    }
+-    if ( ( n % 2 ) == 1 )
+-    {
+-      x[(n-1)/2] = 0.0;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void fejer2_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    FEJER2_COMPUTE_POINTS_NP computes Fejer type 2 quadrature points.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    The rule is defined on [-1,1].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::fejer2_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void fejer2_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    FEJER2_COMPUTE_WEIGHTS computes Fejer type 2 quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    The user must preallocate space for the output array W.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//    Walter Gautschi,
+-//    Numerical Quadrature in the Presence of a Singularity,
+-//    SIAM Journal on Numerical Analysis,
+-//    Volume 4, Number 3, 1967, pages 357-362.
+-//
+-//    Joerg Waldvogel,
+-//    Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules,
+-//    BIT Numerical Mathematics,
+-//    Volume 43, Number 1, 2003, pages 1-18.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int i;
+-  int j;
+-  double p;
+-  double pi = 3.141592653589793;
+-  double theta;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "FEJER2_COMPUTE_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  N < 1.\n";
+-    std::exit ( 1 );
+-  }
+-  else if ( n == 1 )
+-  {
+-    w[0] = 2.0;
+-  }
+-  else if ( n == 2 )
+-  {
+-    w[0] = 1.0;
+-    w[1] = 1.0;
+-  }
+-  else
+-  {
+-    for ( i = 1; i <= n; i++ )
+-    {
+-      theta = ( double ) ( n + 1 - i ) * pi
+-            / ( double ) ( n + 1 );
+-
+-      w[i-1] = 1.0;
+-
+-      for ( j = 1; j <= ( ( n - 1 ) / 2 ); j++ )
+-      {
+-        w[i-1] = w[i-1] - 2.0 *  std::cos ( 2.0 * ( double ) ( j ) * theta )
+-          / ( double ) ( 4 * j * j - 1 );
+-      }
+-      p = 2.0 * ( double ) ( ( ( n + 1 ) / 2 ) ) - 1.0;
+-      w[i-1] = w[i-1] -  std::cos ( ( p + 1.0 ) * theta ) / p;
+-    }
+-    for ( i = 0; i < n; i++ )
+-    {
+-      w[i] = 2.0 * w[i] / ( double ) ( n + 1 );
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void fejer2_compute_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    FEJER2_COMPUTE_WEIGHTS_NP computes Fejer type 2 quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    The user must preallocate space for the output array W.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//    Walter Gautschi,
+-//    Numerical Quadrature in the Presence of a Singularity,
+-//    SIAM Journal on Numerical Analysis,
+-//    Volume 4, Number 3, 1967, pages 357-362.
+-//
+-//    Joerg Waldvogel,
+-//    Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules,
+-//    BIT Numerical Mathematics,
+-//    Volume 43, Number 1, 2003, pages 1-18.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::fejer2_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_compute ( int order, double alpha, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_COMPUTE computes a Gegenbauer quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) (1-X^2)^ALPHA * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//    Thanks to Janiki Raman for pointing out a problem in an earlier
+-//    version of the code that occurred when ALPHA was -0.5.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double an;
+-  double *c;
+-  double cc;
+-  double delta;
+-  double dp2;
+-  int i;
+-  double p1;
+-  double prod;
+-  double r1;
+-  double r2;
+-  double r3;
+-  double temp;
+-  double x0;
+-//
+-//  Check ORDER.
+-//
+-  if ( order < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "GEGENBAUER_COMPUTE - Fatal error!\n";
+-    std::cerr << "  1 <= ORDER is required.\n";
+-    std::exit ( 1 );
+-  }
+-  c = new double[order];
+-//
+-//  Check ALPHA.
+-//
+-  if ( alpha <= -1.0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "GEGENBAUER_COMPUTE - Fatal error!\n";
+-    std::cerr << "  -1.0 < ALPHA is required.\n";
+-    std::exit ( 1 );
+-  }
+-//
+-//  Set the recursion coefficients.
+-//
+-  c[0] = 0.0;
+-  if ( 2 <= order )
+-  {
+-    c[1] = 1.0 / ( 2.0 * alpha + 3.0 );
+-  }
+-
+-  for ( i = 3; i <= order; i++ )
+-  {
+-    c[i-1] = ( double ) ( i - 1 )
+-          * ( alpha + alpha + ( double ) ( i - 1 ) ) /
+-          ( ( alpha + alpha + ( double ) ( 2 * i - 1 ) )
+-          * ( alpha + alpha + ( double ) ( 2 * i - 3 ) ) );
+-  }
+-
+-  delta = webbur::r8_gamma ( alpha         + 1.0 )
+-        * webbur::r8_gamma (         alpha + 1.0 )
+-        / webbur::r8_gamma ( alpha + alpha + 2.0 );
+-
+-  prod = 1.0;
+-  for ( i = 2; i <= order; i++ )
+-  {
+-    prod = prod * c[i-1];
+-  }
+-  cc = delta * std::pow ( 2.0, alpha + alpha + 1.0 ) * prod;
+-
+-  for ( i = 1; i <= order; i++ )
+-  {
+-    if ( i == 1 )
+-    {
+-      an = alpha / ( double ) ( order );
+-
+-      r1 = ( 1.0 + alpha )
+-        * ( 2.78 / ( 4.0 + ( double ) ( order * order ) )
+-        + 0.768 * an / ( double ) ( order ) );
+-
+-      r2 = 1.0 + 2.44 * an + 1.282 * an * an;
+-
+-      x0 = ( r2 - r1 ) / r2;
+-    }
+-    else if ( i == 2 )
+-    {
+-      r1 = ( 4.1 + alpha ) /
+-        ( ( 1.0 + alpha ) * ( 1.0 + 0.156 * alpha ) );
+-
+-      r2 = 1.0 + 0.06 * ( ( double ) ( order ) - 8.0 ) *
+-        ( 1.0 + 0.12 * alpha ) / ( double ) ( order );
+-
+-      r3 = 1.0 + 0.012 * alpha *
+-        ( 1.0 + 0.25 * r8_abs ( alpha ) ) / ( double ) ( order );
+-
+-      x0 = x0 - r1 * r2 * r3 * ( 1.0 - x0 );
+-    }
+-    else if ( i == 3 )
+-    {
+-      r1 = ( 1.67 + 0.28 * alpha ) / ( 1.0 + 0.37 * alpha );
+-
+-      r2 = 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+-        / ( double ) ( order );
+-
+-      r3 = 1.0 + 8.0 * alpha /
+-        ( ( 6.28 + alpha ) * ( double ) ( order * order ) );
+-
+-      x0 = x0 - r1 * r2 * r3 * ( x[0] - x0 );
+-    }
+-    else if ( i < order - 1 )
+-    {
+-      x0 = 3.0 * x[i-2] - 3.0 * x[i-3] + x[i-4];
+-    }
+-    else if ( i == order - 1 )
+-    {
+-      r1 = ( 1.0 + 0.235 * alpha ) / ( 0.766 + 0.119 * alpha );
+-
+-      r2 = 1.0 / ( 1.0 + 0.639
+-        * ( ( double ) ( order ) - 4.0 )
+-        / ( 1.0 + 0.71 * ( ( double ) ( order ) - 4.0 ) ) );
+-
+-      r3 = 1.0 / ( 1.0 + 20.0 * alpha / ( ( 7.5 + alpha ) *
+-        ( double ) ( order * order ) ) );
+-
+-      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+-    }
+-    else if ( i == order )
+-    {
+-      r1 = ( 1.0 + 0.37 * alpha ) / ( 1.67 + 0.28 * alpha );
+-
+-      r2 = 1.0 /
+-        ( 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+-        / ( double ) ( order ) );
+-
+-      r3 = 1.0 / ( 1.0 + 8.0 * alpha /
+-        ( ( 6.28 + alpha ) * ( double ) ( order * order ) ) );
+-
+-      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+-    }
+-
+-    webbur::gegenbauer_root ( &x0, order, alpha, &dp2, &p1, c );
+-
+-    x[i-1] = x0;
+-    w[i-1] = cc / ( dp2 * p1 );
+-  }
+-//
+-//  Reverse the order of the values.
+-//
+-  for ( i = 1; i <= order/2; i++ )
+-  {
+-    temp       = x[i-1];
+-    x[i-1]     = x[order-i];
+-    x[order-i] = temp;
+-  }
+-
+-  for ( i = 1; i <=order/2; i++ )
+-  {
+-    temp       = w[i-1];
+-    w[i-1]     = w[order-i];
+-    w[order-i] = temp;
+-  }
+-
+-  delete [] c;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_compute_np ( int order, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_COMPUTE_NP computes a Gegenbauer quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) (1-X^2)^ALPHA * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//    Thanks to Janiki Raman for pointing out a problem in an earlier
+-//    version of the code that occurred when ALPHA was -0.5.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], contains parameters.
+-//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gegenbauer_compute ( order, alpha, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_compute_points ( int order, double alpha, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_COMPUTE_POINTS computes Gegenbauer quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double *w;
+-
+-  w = new double[order];
+-
+-  webbur::gegenbauer_compute ( order, alpha, x, w );
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_compute_points_np ( int order, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_COMPUTE_POINTS_NP computes Gegenbauer quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], contains parameters.
+-//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gegenbauer_compute_points ( order, alpha, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_compute_weights ( int order, double alpha, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_COMPUTE_WEIGHTS computes Gegenbauer quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *x;
+-
+-  x = new double[order];
+-
+-  webbur::gegenbauer_compute ( order, alpha, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_compute_weights_np ( int order, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_COMPUTE_WEIGHTS_NP computes Gegenbauer quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double P[1], contains parameters.
+-//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gegenbauer_compute_weights ( order, alpha, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double gegenbauer_integral ( int expon, double alpha )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_INTEGRAL integrates a monomial with Gegenbauer weight.
+-//
+-//  Discussion:
+-//
+-//    VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x^2)^ALPHA dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent.
+-//
+-//    Input, double ALPHA, the exponent of (1-X^2) in the weight factor.
+-//
+-//    Output, double GEGENBAUER_INTEGRAL, the value of the integral.
+-//
+-{
+-  double arg1;
+-  double arg2;
+-  double arg3;
+-  double arg4;
+-  double c;
+-  double value;
+-  double value1;
+-
+-  if ( ( expon % 2 ) == 1 )
+-  {
+-    value = 0.0;
+-    return value;
+-  }
+-
+-  c = ( double ) ( expon );
+-
+-  arg1 = - alpha;
+-  arg2 =   1.0 + c;
+-  arg3 =   2.0 + alpha + c;
+-  arg4 = - 1.0;
+-
+-  value1 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
+-
+-  value = webbur::r8_gamma ( 1.0 + c ) * 2.0
+-    * webbur::r8_gamma ( 1.0 + alpha  ) * value1
+-    / webbur::r8_gamma ( 2.0 + alpha  + c );
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_recur ( double *p2, double *dp2, double *p1, double x,
+-  int order, double alpha, double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_RECUR evaluates a Gegenbauer polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Output, double *P2, the value of J(ORDER)(X).
+-//
+-//    Output, double *DP2, the value of J'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of J(ORDER-1)(X).
+-//
+-//    Input, double X, the point at which polynomials are evaluated.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Input, double ALPHA, the exponents of (1-X^2).
+-//
+-//    Input, double C[ORDER], the recursion coefficients.
+-//
+-{
+-  double dp0;
+-  double dp1;
+-  int i;
+-  double p0;
+-
+-  *p1 = 1.0;
+-  dp1 = 0.0;
+-
+-  *p2 = x;
+-  *dp2 = 1.0;
+-
+-  for ( i = 2; i <= order; i++ )
+-  {
+-    p0 = *p1;
+-    dp0 = dp1;
+-
+-    *p1 = *p2;
+-    dp1 = *dp2;
+-
+-    *p2 = x *  ( *p1 ) - c[i-1] * p0;
+-    *dp2 = x * dp1 + ( *p1 ) - c[i-1] * dp0;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gegenbauer_root ( double *x, int order, double alpha, double *dp2,
+-  double *p1, double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEGENBAUER_ROOT improves an approximate root of a Gegenbauer polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input/output, double *X, the approximate root, which
+-//    should be improved on output.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Input, double ALPHA, the exponents of (1-X^2).
+-//
+-//    Output, double *DP2, the value of J'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of J(ORDER-1)(X).
+-//
+-//    Input, double C[ORDER], the recursion coefficients.
+-//
+-{
+-  double d;
+-  double eps;
+-  double p2;
+-  int step;
+-  int step_max = 10;
+-
+-  eps = webbur::r8_epsilon ( );
+-
+-  for ( step = 1; step <= step_max; step++ )
+-  {
+-    webbur::gegenbauer_recur ( &p2, dp2, p1, *x, order, alpha, c );
+-
+-    d = p2 / ( *dp2 );
+-    *x = *x - d;
+-
+-    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+-    {
+-      return;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_hermite_compute ( int n, double alpha, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_COMPUTE computes a generalized Gauss-Hermite quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The code uses an algorithm by Elhay and Kautsky.
+-//
+-//    The integral:
+-//
+-//      integral ( -oo < x < +oo ) |x|^alpha exp(-x^2) f(x) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    30 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Sylvan Elhay, Jaroslav Kautsky,
+-//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+-//    Interpolatory Quadrature,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 13, Number 4, December 1987, pages 399-415.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of abscissas.
+-//
+-//    Input, double ALPHA, the parameter.
+-//    -1.0 < ALPHA.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double *bj;
+-  int i;
+-  double i_r8;
+-  double zemu;
+-//
+-//  Define the zero-th moment.
+-//
+-  zemu = webbur::r8_gamma ( ( alpha + 1.0 ) / 2.0 );
+-//
+-//  Define the Jacobi matrix.
+-//
+-  bj = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    i_r8 = ( double ) ( i + 1 );
+-    if ( ( i % 2 ) == 0 )
+-    {
+-      bj[i] = ( i_r8 + alpha ) / 2.0;
+-    }
+-    else
+-    {
+-      bj[i] = i_r8 / 2.0;
+-    }
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    bj[i] = std::sqrt ( bj[i] );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = 0.0;
+-  }
+-
+-  w[0] = std::sqrt ( zemu );
+-  for ( i = 1; i < n; i++ )
+-  {
+-    w[i] = 0.0;
+-  }
+-//
+-//  Diagonalize the Jacobi matrix.
+-//
+-  webbur::imtqlx ( n, x, bj, w );
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = w[i] * w[i];
+-  }
+-
+-  delete [] bj;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_hermite_compute_np ( int order, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_COMPUTE_NP computes a Generalized Hermite quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -oo < x < +oo ) |x|^ALPHA exp(-x^2) f(x) dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], contains parameters.
+-//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gen_hermite_compute ( order, alpha, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_hermite_compute_points ( int order, double alpha, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_COMPUTE_POINTS computes Generalized Hermite quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//    -1.0 < ALPHA.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double *w;
+-
+-  w = new double[order];
+-
+-  webbur::gen_hermite_compute ( order, alpha, x, w );
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_hermite_compute_points_np ( int order, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_COMPUTE_POINTS_NP: Generalized Hermite quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], contains parameters.
+-//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gen_hermite_compute_points ( order, alpha, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_hermite_compute_weights ( int order, double alpha, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_COMPUTE_WEIGHTS computes Generalized Hermite quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//    -1.0 < ALPHA.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *x;
+-
+-  x = new double[order];
+-
+-  webbur::gen_hermite_compute ( order, alpha, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_hermite_compute_weights_np ( int order, int np, double p[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_COMPUTE_WEIGHTS_NP: Generalized Hermite quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], contains parameters.
+-//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gen_hermite_compute_weights ( order, alpha, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_hermite_dr_compute ( int order, double alpha, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_DR_COMPUTE computes a Generalized Hermite quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -oo < x < +oo ) |x|^ALPHA exp(-x^2) f(x) dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//    -1.0 < ALPHA.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha_laguerre;
+-  double arg;
+-  int i;
+-  int order_laguerre;
+-  double *w_laguerre;
+-  double *x_laguerre;
+-
+-  if ( order < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "GEN_HERMITE_DR_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  if ( order == 1 )
+-  {
+-    arg = ( alpha + 1.0 ) / 2.0;
+-    x[0] = 0.0;
+-    w[0] = webbur::r8_gamma ( arg );
+-    return;
+-  }
+-
+-  if ( ( order % 2 ) == 0 )
+-  {
+-    order_laguerre = order / 2;
+-    alpha_laguerre = ( alpha - 1.0 ) / 2.0;
+-  }
+-  else
+-  {
+-    order_laguerre = ( order - 1 ) / 2;
+-    alpha_laguerre = ( alpha + 1.0 ) / 2.0;
+-  }
+-
+-  w_laguerre = new double[order_laguerre];
+-  x_laguerre = new double[order_laguerre];
+-
+-  webbur::gen_laguerre_ss_compute ( order_laguerre, alpha_laguerre, x_laguerre,
+-    w_laguerre );
+-
+-  if ( ( order % 2 ) == 0 )
+-  {
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      x[i] = - std::sqrt ( x_laguerre[order_laguerre-1-i] );
+-    }
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      x[order_laguerre+i] = std::sqrt ( x_laguerre[i] );
+-	}
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      w[i] = 0.5 * w_laguerre[order_laguerre-1-i];
+-    }
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      w[order_laguerre+i] = 0.5 * w_laguerre[i];
+-    }
+-  }
+-  else if ( ( order % 2 ) == 1 )
+-  {
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      x[i] = - std::sqrt ( x_laguerre[order_laguerre-1-i] );
+-    }
+-    x[order_laguerre] = 0.0;
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      x[order_laguerre+1+i] = std::sqrt ( x_laguerre[i] );
+-	}
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      w[i] = 0.5 * w_laguerre[order_laguerre-1-i] / x_laguerre[order_laguerre-1-i];
+-    }
+-
+-    arg = ( alpha + 1.0 ) / 2.0;
+-    w[order_laguerre] = webbur::r8_gamma ( arg );
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      w[order_laguerre] = w[order_laguerre] - w_laguerre[i] / x_laguerre[i];
+-    }
+-
+-    for ( i = 0; i < order_laguerre; i++ )
+-    {
+-      w[order_laguerre+1+i] = 0.5 * w_laguerre[i] / x_laguerre[i];
+-    }
+-  }
+-  delete [] w_laguerre;
+-  delete [] x_laguerre;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double gen_hermite_integral ( int expon, double alpha )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_HERMITE_INTEGRAL evaluates a monomial Generalized Hermite integral.
+-//
+-//  Discussion:
+-//
+-//    H(n,alpha) = Integral ( -oo < x < +oo ) x^n |x|^alpha exp(-x^2) dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent of the monomial.
+-//    0 <= EXPON.
+-//
+-//    Input, double ALPHA, the exponent of |X| in the weight function.
+-//    -1.0 < ALPHA.
+-//
+-//    Output, double GEN_HERMITE_INTEGRAL, the value of the integral.
+-//
+-{
+-  double a;
+-  double arg;
+-  double value;
+-
+-  if ( ( expon % 2 ) == 1 )
+-  {
+-    value = 0.0;
+-  }
+-  else
+-  {
+-    a = alpha + ( double ) ( expon );
+-    if ( a <= - 1.0 )
+-    {
+-      value = - webbur::r8_huge ( );
+-    }
+-    else
+-    {
+-      arg = ( a + 1.0 ) / 2.0;
+-      value = webbur::r8_gamma ( arg );
+-    }
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_compute ( int n, double alpha, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_COMPUTE: generalized Gauss-Laguerre quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( 0 <= x < +oo ) exp ( - x ) * x^alpha * f(x) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    The integral:
+-//
+-//      integral ( 0 <= x < +oo ) x^alpha * f(x) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * exp ( x(i) ) * f ( x(i) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Sylvan Elhay, Jaroslav Kautsky,
+-//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+-//    Interpolatory Quadrature,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 13, Number 4, December 1987, pages 399-415.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//    ALPHA must be nonnegative.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double *bj;
+-  int i;
+-  double i_r8;
+-  double zemu;
+-//
+-//  Define the zero-th moment.
+-//
+-  zemu = webbur::r8_gamma ( alpha + 1.0 );
+-//
+-//  Define the Jacobi matrix.
+-//
+-  bj = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    i_r8 = ( double ) ( i + 1 );
+-    bj[i] = std::sqrt ( i_r8 * ( i_r8 + alpha ) );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    i_r8 = ( double ) ( i + 1 );
+-    x[i] = 2.0 * i_r8 - 1.0 + alpha;
+-  }
+-
+-  w[0] = std::sqrt ( zemu );
+-
+-  for ( i = 1; i < n; i++ )
+-  {
+-    w[i] = 0.0;
+-  }
+-//
+-//  Diagonalize the Jacobi matrix.
+-//
+-  imtqlx ( n, x, bj, w );
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = w[i] * w[i];
+-  }
+-
+-  delete [] bj;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_compute_np ( int order, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_COMPUTE_NP computes a Generalized Laguerre quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    In the simplest case, ALPHA is 0, and we are approximating the
+-//    integral from 0 to +oo of exp(-X) * F(X).  When this is so,
+-//    it is easy to modify the rule to approximate the integral from
+-//    A to +oo as well.
+-//
+-//    If ALPHA is nonzero, then there is no simple way to extend the
+-//    rule to approximate the integral from A to +oo.  The simplest
+-//    procedures would be to approximate the integral from 0 to A.
+-//
+-//    If the integral to approximate is:
+-//
+-//        Integral ( A <= X < +oo ) exp ( - X ) * F(X) dX
+-//      or
+-//        Integral ( 0 <= X < +oo ) exp ( - X ) * X^ALPHA * F(X) dX
+-//
+-//    then the quadrature rule is:
+-//
+-//      exp ( - A ) * Sum ( 1 <= I <= ORDER ) W(I) * F ( A+X(I) )
+-//    or
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//
+-//    If the integral to approximate is:
+-//
+-//        Integral ( A <= X < +oo ) F(X) dX
+-//      or
+-//        Integral ( 0 <= X < +oo ) X^ALPHA * F(X) dX
+-//
+-//    then the quadrature rule is:
+-//
+-//      exp ( - A ) * Sum ( 1 <= I <= ORDER )
+-//        W(I) * exp(A+X(I)) * F ( A+X(I) )
+-//    or
+-//      Sum ( 1 <= I <= ORDER ) W(I) * exp(X(I)) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double P[1], contains parameters.
+-//    P[0] = ALPHA, the exponent of the X factor.
+-//    Set ALPHA = 0.0 for the simplest rule.
+-//    ALPHA must be nonnegative.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gen_laguerre_compute ( order, alpha, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_compute_points ( int order, double alpha, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_COMPUTE_POINTS: Generalized Laguerre quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 March 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//    Set ALPHA = 0.0 for the simplest rule.
+-//    ALPHA must be nonnegative.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double *w;
+-
+-  w = new double[order];
+-
+-  webbur::gen_laguerre_compute ( order, alpha, x, w );
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_compute_points_np ( int order, int np, double p[],
+-  double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_COMPUTE_POINTS_NP: Generalized Laguerre quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], contains parameters.
+-//    P[0] = ALPHA, the exponent of the X factor.
+-//    Set ALPHA = 0.0 for the simplest rule.
+-//    ALPHA must be nonnegative.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gen_laguerre_compute_points ( order, alpha, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_compute_weights ( int order, double alpha, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_COMPUTE_WEIGHTS: Generalized Laguerre quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//    Set ALPHA = 0.0 for the simplest rule.
+-//    ALPHA must be nonnegative.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *x;
+-
+-  x = new double[order];
+-
+-  webbur::gen_laguerre_compute ( order, alpha, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_compute_weights_np ( int order, int np, double p[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_COMPUTE_WEIGHTS_NP: Generalized Laguerre quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], contains parameters.
+-//    P[0] = ALPHA, the exponent of the X factor.
+-//    Set ALPHA = 0.0 for the simplest rule.
+-//    ALPHA must be nonnegative.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-
+-  alpha = p[0];
+-
+-  webbur::gen_laguerre_compute_weights ( order, alpha, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double gen_laguerre_integral ( int expon, double alpha )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_INTEGRAL evaluates a monomial Generalized Laguerre integral.
+-//
+-//  Discussion:
+-//
+-//    L(n,alpha) = Integral ( 0 <= x < +oo ) x^n * x^alpha exp(-x) dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    20 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent of the monomial.
+-//    0 <= EXPON.
+-//
+-//    Input, double ALPHA, the exponent of X in the weight function.
+-//    -1.0 < ALPHA.
+-//
+-//    Output, double GEN_LAGUERRE_INTEGRAL, the value of the integral.
+-//
+-{
+-  double arg;
+-  double value;
+-
+-  arg = alpha + ( double ) ( expon + 1.0 );
+-  value = webbur::r8_gamma ( arg );
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_ss_compute ( int order, double alpha, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_SS_COMPUTE computes a Generalized Laguerre quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    In the simplest case, ALPHA is 0, and we are approximating the
+-//    integral from 0 to +oo of exp(-X) * F(X).  When this is so,
+-//    it is easy to modify the rule to approximate the integral from
+-//    A to +oo as well.
+-//
+-//    If ALPHA is nonzero, then there is no simple way to extend the
+-//    rule to approximate the integral from A to +oo.  The simplest
+-//    procedures would be to approximate the integral from 0 to A.
+-//
+-//    If the integral to approximate is:
+-//
+-//        Integral ( A <= X < +oo ) exp ( - X ) * F(X) dX
+-//      or
+-//        Integral ( 0 <= X < +oo ) exp ( - X ) * X^ALPHA * F(X) dX
+-//
+-//    then the quadrature rule is:
+-//
+-//      exp ( - A ) * Sum ( 1 <= I <= ORDER ) W(I) * F ( A+X(I) )
+-//    or
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//
+-//    If the integral to approximate is:
+-//
+-//        Integral ( A <= X < +oo ) F(X) dX
+-//      or
+-//        Integral ( 0 <= X < +oo ) X^ALPHA * F(X) dX
+-//
+-//    then the quadrature rule is:
+-//
+-//      exp ( - A ) * Sum ( 1 <= I <= ORDER )
+-//        W(I) * exp(A+X(I)) * F ( A+X(I) )
+-//    or
+-//      Sum ( 1 <= I <= ORDER ) W(I) * exp(X(I)) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//    Set ALPHA = 0.0 for the simplest rule.
+-//    ALPHA must be nonnegative.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *b;
+-  double *c;
+-  double cc;
+-  double dp2;
+-  int i;
+-  double p1;
+-  double prod;
+-  double r1;
+-  double r2;
+-  double ratio;
+-  double x0;
+-
+-  if ( order < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "GEN_LAGUERRE_SS_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  b = new double[order];
+-  c = new double[order];
+-//
+-//  Set the recursion coefficients.
+-//
+-  for ( i = 0; i < order; i++ )
+-  {
+-    b[i] = ( alpha + ( double ) ( 2 * i + 1 ) );
+-  }
+-
+-  for ( i = 0; i < order; i++ )
+-  {
+-    c[i] = ( double ) ( i ) * ( alpha + ( double ) ( i ) );
+-  }
+-  prod = 1.0;
+-  for ( i = 1; i < order; i++ )
+-  {
+-    prod = prod * c[i];
+-  }
+-  cc = webbur::r8_gamma ( alpha + 1.0 ) * prod;
+-
+-  for ( i = 0; i < order; i++ )
+-  {
+-//
+-//  Compute an estimate for the root.
+-//
+-    if ( i == 0 )
+-    {
+-      x0 = ( 1.0 + alpha ) * ( 3.0+ 0.92 * alpha ) /
+-        ( 1.0 + 2.4 * ( double ) ( order ) + 1.8 * alpha );
+-    }
+-    else if ( i == 1 )
+-    {
+-      x0 = x0 + ( 15.0 + 6.25 * alpha ) /
+-        ( 1.0 + 0.9 * alpha + 2.5 * ( double ) ( order ) );
+-    }
+-    else
+-    {
+-      r1 = ( 1.0 + 2.55 * ( double ) ( i - 1 ) )
+-        / ( 1.9 * ( double ) ( i - 1 ) );
+-
+-      r2 = 1.26 * ( double ) ( i - 1 ) * alpha /
+-        ( 1.0 + 3.5 * ( double ) ( i - 1 ) );
+-
+-      ratio = ( r1 + r2 ) / ( 1.0 + 0.3 * alpha );
+-
+-      x0 = x0 + ratio * ( x0 - x[i-2] );
+-    }
+-//
+-//  Use iteration to find the root.
+-//
+-    webbur::gen_laguerre_ss_root ( &x0, order, alpha, &dp2, &p1, b, c );
+-//
+-//  Set the abscissa and weight.
+-//
+-    x[i] = x0;
+-    w[i] = ( cc / dp2 ) / p1;
+-  }
+-
+-  delete [] b;
+-  delete [] c;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x,
+-  int order, double alpha, double b[], double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_SS_RECUR evaluates a Generalized Laguerre polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 February 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Output, double *P2, the value of L(ORDER)(X).
+-//
+-//    Output, double *DP2, the value of L'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of L(ORDER-1)(X).
+-//
+-//    Input, double X, the point at which polynomials are evaluated.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Input, double ALPHA, the exponent of the X factor in the
+-//    integrand.
+-//
+-//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+-//
+-{
+-  double dp0;
+-  double dp1;
+-  int i;
+-  double p0;
+-
+-  *p1 = 1.0;
+-  dp1 = 0.0;
+-
+-  *p2 = x - alpha - 1.0;
+-  *dp2 = 1.0;
+-
+-  for ( i = 1; i < order; i++ )
+-  {
+-    p0 = *p1;
+-    dp0 = dp1;
+-
+-    *p1 = *p2;
+-    dp1 = *dp2;
+-
+-    *p2  = ( x - b[i] ) * ( *p1 ) - c[i] * p0;
+-    *dp2 = ( x - b[i] ) * dp1 + ( *p1 ) - c[i] * dp0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void gen_laguerre_ss_root ( double *x, int order, double alpha, double *dp2,
+-  double *p1, double b[], double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    GEN_LAGUERRE_SS_ROOT improves a root of a Generalized Laguerre polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 February 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input/output, double *X, the approximate root, which
+-//    should be improved on output.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Input, double ALPHA, the exponent of the X factor.
+-//
+-//    Output, double *DP2, the value of L'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of L(ORDER-1)(X).
+-//
+-//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+-//
+-{
+-  double d;
+-  double eps;
+-  double p2;
+-  int step;
+-  int step_max = 10;
+-
+-  eps = webbur::r8_epsilon ( );
+-
+-  for ( step = 1; step <= step_max; step++ )
+-  {
+-    webbur::gen_laguerre_ss_recur ( &p2, dp2, p1, *x, order, alpha, b, c );
+-
+-    d = p2 / ( *dp2 );
+-    *x = *x - d;
+-
+-    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+-    {
+-      break;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hc_compute_weights_from_points ( int nhalf, double xhalf[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HC_COMPUTE_WEIGHTS_FROM_POINTS: Hermite-Cubic weights, user-supplied points.
+-//
+-//  Discussion:
+-//
+-//    An interval [A,B] has been divided by NHALF points X; at each
+-//    point both function and derivative information is available.
+-//
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//
+-//    A quadrature rule is determined for the interpolant.
+-//
+-//    There will be N=2*NHALF weights.  If the quadrature rule is to be written
+-//    out, one would normally list each point twice, so that the number of points
+-//    and weights are equal.  The listing of the same point value twice is an
+-//    implicit indication that both function and derivative values should be
+-//    used.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    28 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int NHALF, the number of points, not counting repetitions.
+-//
+-//    Input, double XHALF[NHALF], the points, without repetition.
+-//
+-//    Output, double W[2*NHALF], the weights.  The first two weights are
+-//    associated with the first point, and so on.
+-//
+-{
+-  int j;
+-
+-  w[0+0*2] =    0.5 * ( xhalf[1] - xhalf[0] );
+-  w[1+0*2] = std::pow ( xhalf[1] - xhalf[0], 2 ) / 12.0;
+-
+-  for ( j = 1; j < nhalf - 1; j++ )
+-  {
+-    w[0+j*2] = 0.5 * ( xhalf[j+1] - xhalf[j-1] );
+-    w[1+j*2] =       ( xhalf[j+1] - xhalf[j-1] )
+-                   * ( xhalf[j+1] - 2.0 * xhalf[j] + xhalf[j-1] ) / 12.0;
+-  }
+-
+-  w[0+(nhalf-1)*2] =      0.5 * ( xhalf[nhalf-1] - xhalf[nhalf-2]   );
+-  w[1+(nhalf-1)*2] = - std::pow ( xhalf[nhalf-2] - xhalf[nhalf-1], 2 ) / 12.0;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hcc_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCC_COMPUTE computes a Hermite-Cubic-Chebyshev-Spacing quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into Chebyshev-spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    24 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int nhalf;
+-  double *xhalf;
+-
+-  nhalf = n / 2;
+-  xhalf = new double[nhalf];
+-
+-  webbur::clenshaw_curtis_compute_points ( nhalf, xhalf );
+-  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
+-  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+-
+-  delete [] xhalf;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hcc_compute_np ( int n, int np, double p[], double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCC_COMPUTE_NP computes a Hermite-Cubic-Chebyshev-Spacing quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into Chebyshev-spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::hcc_compute ( n, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hcc_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCC_COMPUTE_POINTS computes Hermite-Cubic-Chebyshev-Spacing quadrature points.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into Chebyshev-spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    24 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int nhalf;
+-  double *xhalf;
+-
+-  if ( ( n % 2 ) != 0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HCC_COMPUTE_POINTS - Fatal error!\n";
+-    std::cerr << "  Order of rule N is not even.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  nhalf = n / 2;
+-  xhalf = new double[nhalf];
+-
+-  webbur::clenshaw_curtis_compute_points ( nhalf, xhalf );
+-  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
+-
+-  delete [] xhalf;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hcc_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCC_COMPUTE_POINTS_NP: Hermite-Cubic-Chebyshev-Spacing quadrature points.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into Chebyshev-spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::hcc_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hcc_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCC_COMPUTE_WEIGHTS: Hermite-Cubic-Chebyshev-Spacing quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into Chebyshev-spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    24 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int nhalf;
+-  double *xhalf;
+-
+-  if ( ( n % 2 ) != 0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HCC_COMPUTE_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Order of rule N is not even.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  nhalf = n / 2;
+-  xhalf = new double[nhalf];
+-
+-  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+-
+-  delete [] xhalf;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hcc_compute_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCC_COMPUTE_WEIGHTS_NP: Hermite-Cubic-Chebyshev-Spacing quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into Chebyshev-spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::hcc_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hce_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCE_COMPUTE computes a Hermite-Cubic-Equal-Spacing quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into equally spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    28 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double a_high = 1.0;
+-  double a_low = 0.0;
+-  int nhalf;
+-  double *xhalf;
+-
+-  a_low = 0.0;
+-  a_high = 1.0;
+-
+-  nhalf = n / 2;
+-
+-  xhalf = webbur::r8vec_linspace_new ( nhalf, a_low, a_high );
+-  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
+-  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+-
+-  delete [] xhalf;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hce_compute_np ( int n, int np, double p[], double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCE_COMPUTE_NP computes a Hermite-Cubic-Equal-Spacing quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into equally spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::hce_compute ( n, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hce_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCE_COMPUTE_POINTS computes Hermite-Cubic-Equal-Spacing quadrature points.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into equally spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int i;
+-  int j;
+-  int m;
+-  double x_value;
+-
+-  if ( ( n % 2 ) != 0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HCE_COMPUTE_POINTS - Fatal error!\n";
+-    std::cerr << "  Order of rule N is not even.\n";
+-    std::exit ( 1 );
+-  }
+-  m = n / 2;
+-
+-  for ( j = 0; j < m; j++ )
+-  {
+-    x_value = ( double ) ( 2 * j + 1 - m ) / ( double ) ( m - 1 );
+-    for ( i = 0; i < 2; i++ )
+-    {
+-      x[i+j*2] = x_value;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hce_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCE_COMPUTE_POINTS_NP: Hermite-Cubic-Equal-Spacing quadrature points.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into equally spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::hce_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hce_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCE_COMPUTE_WEIGHTS: Hermite-Cubic-Equal-Spacing quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into equally spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    24 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int nhalf;
+-  double *xhalf;
+-
+-  if ( ( n % 2 ) != 0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HCE_COMPUTE_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Order of rule N is not even.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  nhalf = n / 2;
+-  xhalf = new double[nhalf];
+-
+-  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
+-
+-  delete [] xhalf;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hce_compute_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HCE_COMPUTE_WEIGHTS_NP: Hermite-Cubic-Equal-Spacing quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    For the HCE rule, we assume that an interval has been divided by
+-//    M nodes X into equally spaced subintervals, and that at each
+-//    abscissa both function and derivative information is available.
+-//    The piecewise cubic Hermite interpolant is constructed for this data.
+-//    The quadrature rule uses N = 2 * M abscissas, where each node is
+-//    listed twice, and the weights occur in pairs, with the first multiplying
+-//    the function value and the second the derivative.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::hce_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_COMPUTE computes a Gauss-Hermite quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The code uses an algorithm by Elhay and Kautsky.
+-//
+-//    The abscissas are the zeros of the N-th order Hermite polynomial.
+-//
+-//    The integral:
+-//
+-//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Sylvan Elhay, Jaroslav Kautsky,
+-//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+-//    Interpolatory Quadrature,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 13, Number 4, December 1987, pages 399-415.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of abscissas.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double arg;
+-  double *bj;
+-  int i;
+-  double zemu;
+-//
+-//  Define the zero-th moment.
+-//
+-  arg = 0.5;
+-  zemu = webbur::r8_gamma ( arg );
+-//
+-//  Define the Jacobi matrix.
+-//
+-  bj = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    bj[i] = std::sqrt ( ( double ) ( i + 1 ) / 2.0 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = 0.0;
+-  }
+-
+-  w[0] = std::sqrt ( zemu );
+-  for ( i = 1; i < n; i++ )
+-  {
+-    w[i] = 0.0;
+-  }
+-//
+-//  Diagonalize the Jacobi matrix.
+-//
+-  webbur::imtqlx ( n, x, bj, w );
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = w[i] * w[i];
+-  }
+-
+-  delete [] bj;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_compute_np ( int order, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_COMPUTE_NP computes a Hermite quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The abscissas are the zeros of the N-th order Hermite polynomial.
+-//
+-//    The integral:
+-//
+-//      Integral ( -oo < X < +oo ) exp ( - X * X ) * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  webbur::hermite_compute ( order, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_compute_points ( int order, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_COMPUTE_POINTS computes Hermite quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double *w;
+-
+-  w = new double[order];
+-
+-  webbur::hermite_compute ( order, x, w );
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_compute_points_np ( int order, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_COMPUTE_POINTS_NP computes Hermite quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  webbur::hermite_compute_points ( order, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_compute_weights ( int order, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_COMPUTE_WEIGHTS computes Hermite quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *x;
+-
+-  x = new double[order];
+-
+-  webbur::hermite_compute ( order, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_compute_weights_np ( int order, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_COMPUTE_WEIGHTS_NP computes Hermite quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  webbur::hermite_compute_weights ( order, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_genz_keister_lookup ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GENZ_KEISTER_LOOKUP looks up a Genz-Keister Hermite rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+16, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and 35.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29, and 51.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 June 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Florian Heiss, Viktor Winschel,
+-//    Likelihood approximation by numerical integration on sparse grids,
+-//    Journal of Econometrics,
+-//    Volume 144, 2008, pages 62-80.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::hermite_genz_keister_lookup_points ( n, x );
+-  webbur::hermite_genz_keister_lookup_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_genz_keister_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GENZ_KEISTER_LOOKUP_POINTS looks up Genz-Keister Hermite abscissas.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+-//    35, 37, 41 or 43.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29,
+-//    with the final rule of precision 51, 55, 63 or 67.
+-//
+-//    Three related families begin the same way, but end with a different final
+-//    rule.  As a convenience, this function includes these final rules as well:
+-//
+-//    Designation  Orders       Precisions
+-//
+-//    1+2+6+10+16, 1,3,9,19,35  1,5,15,29,51
+-//    1+2+6+10+18  1,3,9,19,37  1,5,15,29,55
+-//    1+2+6+10+22  1,3,9,19,41  1,5,15,29,63
+-//    1+2+6+10+24  1,3,9,19,43  1,5,15,29,67
+-//
+-//    Some of the data in this function was kindly supplied directly by
+-//    Alan Genz on 24 April 2011.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Florian Heiss, Viktor Winschel,
+-//    Likelihood approximation by numerical integration on sparse grids,
+-//    Journal of Econometrics,
+-//    Volume 144, 2008, pages 62-80.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9, 19, 35, 37, 41, or 43.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    x[ 0] =   0.0000000000000000E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    x[ 0] =  -1.2247448713915889E+00;
+-    x[ 1] =   0.0000000000000000E+00;
+-    x[ 2] =   1.2247448713915889E+00;
+-  }
+-  else if ( n == 9 )
+-  {
+-    x[ 0] =  -2.9592107790638380E+00;
+-    x[ 1] =  -2.0232301911005157E+00;
+-    x[ 2] =  -1.2247448713915889E+00;
+-    x[ 3] =  -5.2403354748695763E-01;
+-    x[ 4] =   0.0000000000000000E+00;
+-    x[ 5] =   5.2403354748695763E-01;
+-    x[ 6] =   1.2247448713915889E+00;
+-    x[ 7] =   2.0232301911005157E+00;
+-    x[ 8] =   2.9592107790638380E+00;
+-  }
+-  else if ( n == 19 )
+-  {
+-    x[ 0] =  -4.4995993983103881E+00;
+-    x[ 1] =  -3.6677742159463378E+00;
+-    x[ 2] =  -2.9592107790638380E+00;
+-    x[ 3] =  -2.2665132620567876E+00;
+-    x[ 4] =  -2.0232301911005157E+00;
+-    x[ 5] =  -1.8357079751751868E+00;
+-    x[ 6] =  -1.2247448713915889E+00;
+-    x[ 7] =  -8.7004089535290285E-01;
+-    x[ 8] =  -5.2403354748695763E-01;
+-    x[ 9] =   0.0000000000000000E+00;
+-    x[10] =   5.2403354748695763E-01;
+-    x[11] =   8.7004089535290285E-01;
+-    x[12] =   1.2247448713915889E+00;
+-    x[13] =   1.8357079751751868E+00;
+-    x[14] =   2.0232301911005157E+00;
+-    x[15] =   2.2665132620567876E+00;
+-    x[16] =   2.9592107790638380E+00;
+-    x[17] =   3.6677742159463378E+00;
+-    x[18] =   4.4995993983103881E+00;
+-  }
+-  else if ( n == 35 )
+-  {
+-    x[ 0] =  -6.3759392709822356E+00;
+-    x[ 1] =  -5.6432578578857449E+00;
+-    x[ 2] =  -5.0360899444730940E+00;
+-    x[ 3] =  -4.4995993983103881E+00;
+-    x[ 4] =  -4.0292201405043713E+00;
+-    x[ 5] =  -3.6677742159463378E+00;
+-    x[ 6] =  -3.3491639537131945E+00;
+-    x[ 7] =  -2.9592107790638380E+00;
+-    x[ 8] =  -2.5705583765842968E+00;
+-    x[ 9] =  -2.2665132620567876E+00;
+-    x[10] =  -2.0232301911005157E+00;
+-    x[11] =  -1.8357079751751868E+00;
+-    x[12] =  -1.5794121348467671E+00;
+-    x[13] =  -1.2247448713915889E+00;
+-    x[14] =  -8.7004089535290285E-01;
+-    x[15] =  -5.2403354748695763E-01;
+-    x[16] =  -1.7606414208200893E-01;
+-    x[17] =   0.0000000000000000E+00;
+-    x[18] =   1.7606414208200893E-01;
+-    x[19] =   5.2403354748695763E-01;
+-    x[20] =   8.7004089535290285E-01;
+-    x[21] =   1.2247448713915889E+00;
+-    x[22] =   1.5794121348467671E+00;
+-    x[23] =   1.8357079751751868E+00;
+-    x[24] =   2.0232301911005157E+00;
+-    x[25] =   2.2665132620567876E+00;
+-    x[26] =   2.5705583765842968E+00;
+-    x[27] =   2.9592107790638380E+00;
+-    x[28] =   3.3491639537131945E+00;
+-    x[29] =   3.6677742159463378E+00;
+-    x[30] =   4.0292201405043713E+00;
+-    x[31] =   4.4995993983103881E+00;
+-    x[32] =   5.0360899444730940E+00;
+-    x[33] =   5.6432578578857449E+00;
+-    x[34] =   6.3759392709822356E+00;
+-  }
+-  else if ( n == 37 )
+-  {
+-    x[ 0] =  -6.853200069757519;
+-    x[ 1] =  -6.124527854622158;
+-    x[ 2] =  -5.521865209868350;
+-    x[ 3] =  -4.986551454150765;
+-    x[ 4] =  -4.499599398310388;
+-    x[ 5] =  -4.057956316089741;
+-    x[ 6] =  -3.667774215946338;
+-    x[ 7] =  -3.315584617593290;
+-    x[ 8] =  -2.959210779063838;
+-    x[ 9] =  -2.597288631188366;
+-    x[10] =  -2.266513262056788;
+-    x[11] =  -2.023230191100516;
+-    x[12] =  -1.835707975175187;
+-    x[13] =  -1.561553427651873;
+-    x[14] =  -1.224744871391589;
+-    x[15] =  -0.870040895352903;
+-    x[16] =  -0.524033547486958;
+-    x[17] =  -0.214618180588171;
+-    x[18] =   0.000000000000000;
+-    x[19] =   0.214618180588171;
+-    x[20] =   0.524033547486958;
+-    x[21] =   0.870040895352903;
+-    x[22] =   1.224744871391589;
+-    x[23] =   1.561553427651873;
+-    x[24] =   1.835707975175187;
+-    x[25] =   2.023230191100516;
+-    x[26] =   2.266513262056788;
+-    x[27] =   2.597288631188366;
+-    x[28] =   2.959210779063838;
+-    x[29] =   3.315584617593290;
+-    x[30] =   3.667774215946338;
+-    x[31] =   4.057956316089741;
+-    x[32] =   4.499599398310388;
+-    x[33] =   4.986551454150765;
+-    x[34] =   5.521865209868350;
+-    x[35] =   6.124527854622158;
+-    x[36] =   6.853200069757519;
+-  }
+-  else if ( n == 41 )
+-  {
+-    x[ 0] =  -7.251792998192644;
+-    x[ 1] =  -6.547083258397540;
+-    x[ 2] =  -5.961461043404500;
+-    x[ 3] =  -5.437443360177798;
+-    x[ 4] =  -4.953574342912980;
+-    x[ 5] =  -4.4995993983103881;
+-    x[ 6] =  -4.070919267883068;
+-    x[ 7] =  -3.6677742159463378;
+-    x[ 8] =  -3.296114596212218;
+-    x[ 9] =  -2.9592107790638380;
+-    x[10] =  -2.630415236459871;
+-    x[11] =  -2.2665132620567876;
+-    x[12] =  -2.043834754429505;
+-    x[13] =  -2.0232301911005157;
+-    x[14] =  -1.8357079751751868;
+-    x[15] =  -1.585873011819188;
+-    x[16] =  -1.2247448713915889;
+-    x[17] =  -0.87004089535290285;
+-    x[18] =  -0.52403354748695763;
+-    x[19] =  -0.195324784415805;
+-    x[20] =   0.0000000000000000;
+-    x[21] =   0.195324784415805;
+-    x[22] =   0.52403354748695763;
+-    x[23] =   0.87004089535290285;
+-    x[24] =   1.2247448713915889;
+-    x[25] =   1.585873011819188;
+-    x[26] =   1.8357079751751868;
+-    x[27] =   2.0232301911005157;
+-    x[28] =   2.043834754429505;
+-    x[29] =   2.2665132620567876;
+-    x[30] =   2.630415236459871;
+-    x[31] =   2.9592107790638380;
+-    x[32] =   3.296114596212218;
+-    x[33] =   3.6677742159463378;
+-    x[34] =   4.070919267883068;
+-    x[35] =   4.4995993983103881;
+-    x[36] =   4.953574342912980;
+-    x[37] =   5.437443360177798;
+-    x[38] =   5.961461043404500;
+-    x[39] =   6.547083258397540;
+-    x[40] =   7.251792998192644;
+-  }
+-  else if ( n == 43 )
+-  {
+-    x[ 0] = -10.167574994881873;
+-    x[ 1] =  -7.231746029072501;
+-    x[ 2] =  -6.535398426382995;
+-    x[ 3] =  -5.954781975039809;
+-    x[ 4] =  -5.434053000365068;
+-    x[ 5] =  -4.952329763008589;
+-    x[ 6] =  -4.4995993983103881;
+-    x[ 7] =  -4.071335874253583;
+-    x[ 8] =  -3.6677742159463378;
+-    x[ 9] =  -3.295265921534226;
+-    x[10] =  -2.9592107790638380;
+-    x[11] =  -2.633356763661946;
+-    x[12] =  -2.2665132620567876;
+-    x[13] =  -2.089340389294661;
+-    x[14] =  -2.0232301911005157;
+-    x[15] =  -1.8357079751751868;
+-    x[16] =  -1.583643465293944;
+-    x[17] =  -1.2247448713915889;
+-    x[18] =  -0.87004089535290285;
+-    x[19] =  -0.52403354748695763;
+-    x[20] =  -0.196029453662011;
+-    x[21] =   0.0000000000000000;
+-    x[22] =   0.196029453662011;
+-    x[23] =   0.52403354748695763;
+-    x[24] =   0.87004089535290285;
+-    x[25] =   1.2247448713915889;
+-    x[26] =   1.583643465293944;
+-    x[27] =   1.8357079751751868;
+-    x[28] =   2.0232301911005157;
+-    x[29] =   2.089340389294661;
+-    x[30] =   2.2665132620567876;
+-    x[31] =   2.633356763661946;
+-    x[32] =   2.9592107790638380;
+-    x[33] =   3.295265921534226;
+-    x[34] =   3.6677742159463378;
+-    x[35] =   4.071335874253583;
+-    x[36] =   4.4995993983103881;
+-    x[37] =   4.952329763008589;
+-    x[38] =   5.434053000365068;
+-    x[39] =   5.954781975039809;
+-    x[40] =   6.535398426382995;
+-    x[41] =   7.231746029072501;
+-    x[42] =  10.167574994881873;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_GENZ_KEISTER_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal input value of N.\n";
+-    std::cerr << "  N must be 1, 3, 9, 19, 35, 37, 41 or 43.\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_genz_keister_lookup_points_np ( int n, int np, double p[],
+-  double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GENZ_KEISTER_LOOKUP_POINTS_NP looks up Genz-Keister Hermite abscissas.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+-//    35, 37, 41 or 43.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29,
+-//    with the final rule of precision 51, 55, 63 or 67.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Florian Heiss, Viktor Winschel,
+-//    Likelihood approximation by numerical integration on sparse grids,
+-//    Journal of Econometrics,
+-//    Volume 144, 2008, pages 62-80.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::hermite_genz_keister_lookup_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_genz_keister_lookup_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS looks up Genz-Keister Hermite weights.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+-//    35, 37, 41 or 43.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29,
+-//    with the final rule of precision 51, 55, 63 or 67.
+-//
+-//    Three related families begin the same way, but end with a different final
+-//    rule.  As a convenience, this function includes these final rules as well:
+-//
+-//    Designation  Orders       Precisions
+-//
+-//    1+2+6+10+16, 1,3,9,19,35  1,5,15,29,51
+-//    1+2+6+10+18  1,3,9,19,37  1,5,15,29,55
+-//    1+2+6+10+22  1,3,9,19,41  1,5,15,29,63
+-//    1+2+6+10+24  1,3,9,19,43  1,5,15,29,67
+-//
+-//    Some of the data in this function was kindly supplied directly by
+-//    Alan Genz on 24 April 2011.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Florian Heiss, Viktor Winschel,
+-//    Likelihood approximation by numerical integration on sparse grids,
+-//    Journal of Econometrics,
+-//    Volume 144, 2008, pages 62-80.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9, 19, 35, 37, 41, or 43.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  static double sqrtpi = 1.7724538509055159;
+-
+-  if ( n == 1 )
+-  {
+-    w[ 0] =   1.7724538509055159E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    w[ 0] =   2.9540897515091930E-01;
+-    w[ 1] =   1.1816359006036772E+00;
+-    w[ 2] =   2.9540897515091930E-01;
+-  }
+-  else if ( n == 9 )
+-  {
+-    w[ 0] =   1.6708826306882348E-04;
+-    w[ 1] =   1.4173117873979098E-02;
+-    w[ 2] =   1.6811892894767771E-01;
+-    w[ 3] =   4.7869428549114124E-01;
+-    w[ 4] =   4.5014700975378197E-01;
+-    w[ 5] =   4.7869428549114124E-01;
+-    w[ 6] =   1.6811892894767771E-01;
+-    w[ 7] =   1.4173117873979098E-02;
+-    w[ 8] =   1.6708826306882348E-04;
+-  }
+-  else if ( n == 19 )
+-  {
+-    w[ 0] =   1.5295717705322357E-09;
+-    w[ 1] =   1.0802767206624762E-06;
+-    w[ 2] =   1.0656589772852267E-04;
+-    w[ 3] =   5.1133174390883855E-03;
+-    w[ 4] =  -1.1232438489069229E-02;
+-    w[ 5] =   3.2055243099445879E-02;
+-    w[ 6] =   1.1360729895748269E-01;
+-    w[ 7] =   1.0838861955003017E-01;
+-    w[ 8] =   3.6924643368920851E-01;
+-    w[ 9] =   5.3788160700510168E-01;
+-    w[10] =   3.6924643368920851E-01;
+-    w[11] =   1.0838861955003017E-01;
+-    w[12] =   1.1360729895748269E-01;
+-    w[13] =   3.2055243099445879E-02;
+-    w[14] =  -1.1232438489069229E-02;
+-    w[15] =   5.1133174390883855E-03;
+-    w[16] =   1.0656589772852267E-04;
+-    w[17] =   1.0802767206624762E-06;
+-    w[18] =   1.5295717705322357E-09;
+-  }
+-  else if ( n == 35 )
+-  {
+-    w[ 0] =   1.8684014894510604E-18;
+-    w[ 1] =   9.6599466278563243E-15;
+-    w[ 2] =   5.4896836948499462E-12;
+-    w[ 3] =   8.1553721816916897E-10;
+-    w[ 4] =   3.7920222392319532E-08;
+-    w[ 5] =   4.3737818040926989E-07;
+-    w[ 6] =   4.8462799737020461E-06;
+-    w[ 7] =   6.3328620805617891E-05;
+-    w[ 8] =   4.8785399304443770E-04;
+-    w[ 9] =   1.4515580425155904E-03;
+-    w[10] =   4.0967527720344047E-03;
+-    w[11] =   5.5928828911469180E-03;
+-    w[12] =   2.7780508908535097E-02;
+-    w[13] =   8.0245518147390893E-02;
+-    w[14] =   1.6371221555735804E-01;
+-    w[15] =   2.6244871488784277E-01;
+-    w[16] =   3.3988595585585218E-01;
+-    w[17] =   9.1262675363737921E-04;
+-    w[18] =   3.3988595585585218E-01;
+-    w[19] =   2.6244871488784277E-01;
+-    w[20] =   1.6371221555735804E-01;
+-    w[21] =   8.0245518147390893E-02;
+-    w[22] =   2.7780508908535097E-02;
+-    w[23] =   5.5928828911469180E-03;
+-    w[24] =   4.0967527720344047E-03;
+-    w[25] =   1.4515580425155904E-03;
+-    w[26] =   4.8785399304443770E-04;
+-    w[27] =   6.3328620805617891E-05;
+-    w[28] =   4.8462799737020461E-06;
+-    w[29] =   4.3737818040926989E-07;
+-    w[30] =   3.7920222392319532E-08;
+-    w[31] =   8.1553721816916897E-10;
+-    w[32] =   5.4896836948499462E-12;
+-    w[33] =   9.6599466278563243E-15;
+-    w[34] =   1.8684014894510604E-18;
+-  }
+-  else if ( n == 37 )
+-  {
+-    w[ 0] = 0.337304188079177058E-20;
+-    w[ 1] = 0.332834739632930463E-16;
+-    w[ 2] = 0.323016866782871498E-13;
+-    w[ 3] = 0.809333688669950037E-11;
+-    w[ 4] = 0.748907559239519284E-09;
+-    w[ 5] = 0.294146671497083432E-07;
+-    w[ 6] = 0.524482423744884136E-06;
+-    w[ 7] = 0.586639457073896277E-05;
+-    w[ 8] = 0.571885531470621903E-04;
+-    w[ 9] = 0.41642095727577091E-03;
+-    w[10] = 0.174733389581099482E-02;
+-    w[11] = 0.313373786000304381E-02;
+-    w[12] = 0.768092665770660459E-02;
+-    w[13] = 0.274962713372148476E-01;
+-    w[14] = 0.783630990508037449E-01;
+-    w[15] = 0.16611584261479281E+00;
+-    w[16] = 0.253636910481387185E+00;
+-    w[17] = 0.261712932511430884E+00;
+-    w[18] = 0.171719680968980257E+00;
+-    w[19] = 0.261712932511430884E+00;
+-    w[20] = 0.253636910481387185E+00;
+-    w[21] = 0.16611584261479281E+00;
+-    w[22] = 0.783630990508037449E-01;
+-    w[23] = 0.274962713372148476E-01;
+-    w[24] = 0.768092665770660459E-02;
+-    w[25] = 0.313373786000304381E-02;
+-    w[26] = 0.174733389581099482E-02;
+-    w[27] = 0.41642095727577091E-03;
+-    w[28] = 0.571885531470621903E-04;
+-    w[29] = 0.586639457073896277E-05;
+-    w[30] = 0.524482423744884136E-06;
+-    w[31] = 0.294146671497083432E-07;
+-    w[32] = 0.748907559239519284E-09;
+-    w[33] = 0.809333688669950037E-11;
+-    w[34] = 0.323016866782871498E-13;
+-    w[35] = 0.332834739632930463E-16;
+-    w[36] = 0.337304188079177058E-20;
+-  }
+-  else if ( n == 41 )
+-  {
+-    w[ 0] =   0.117725656974405367E-22;
+-    w[ 1] =   0.152506745534300636E-18;
+-    w[ 2] =   0.202183949965101288E-15;
+-    w[ 3] =   0.724614869051195508E-13;
+-    w[ 4] =   0.103121966469463034E-10;
+-    w[ 5] =   0.710371395169350952E-09;
+-    w[ 6] =   0.264376044449260516E-07;
+-    w[ 7] =   0.558982787078644997E-06;
+-    w[ 8] =   0.675628907134744976E-05;
+-    w[ 9] =   0.512198007019776873E-04;
+-    w[10] =   0.335013114947200879E-03;
+-    w[11] =   0.249379691096933139E-02;
+-    w[12] = - 0.25616995850607458E-01;
+-    w[13] =   0.317007878644325588E-01;
+-    w[14] =   0.125041498584003435E-02;
+-    w[15] =   0.293244560924894295E-01;
+-    w[16] =   0.799536390803302298E-01;
+-    w[17] =   0.164543666806555251E+00;
+-    w[18] =   0.258718519718241095E+00;
+-    w[19] =   0.293588795735908566E+00;
+-    w[20] =   0.997525375254611951E-01;
+-    w[21] =   0.293588795735908566E+00;
+-    w[22] =   0.258718519718241095E+00;
+-    w[23] =   0.164543666806555251E+00;
+-    w[24] =   0.799536390803302298E-01;
+-    w[25] =   0.293244560924894295E-01;
+-    w[26] =   0.125041498584003435E-02;
+-    w[27] =   0.317007878644325588E-01;
+-    w[28] = - 0.25616995850607458E-01;
+-    w[29] =   0.249379691096933139E-02;
+-    w[30] =   0.335013114947200879E-03;
+-    w[31] =   0.512198007019776873E-04;
+-    w[32] =   0.675628907134744976E-05;
+-    w[33] =   0.558982787078644997E-06;
+-    w[34] =   0.264376044449260516E-07;
+-    w[35] =   0.710371395169350952E-09;
+-    w[36] =   0.103121966469463034E-10;
+-    w[37] =   0.724614869051195508E-13;
+-    w[38] =   0.202183949965101288E-15;
+-    w[39] =   0.152506745534300636E-18;
+-    w[40] =   0.117725656974405367E-22;
+-  }
+-  else if ( n == 43 )
+-  {
+-    w[ 0] =   0.968100020641528185E-37;
+-    w[ 1] =   0.15516931262860431E-22;
+-    w[ 2] =   0.175937309107750992E-18;
+-    w[ 3] =   0.217337608710893738E-15;
+-    w[ 4] =   0.747837010380540069E-13;
+-    w[ 5] =   0.104028132097205732E-10;
+-    w[ 6] =   0.70903573389336778E-09;
+-    w[ 7] =   0.263481722999966618E-07;
+-    w[ 8] =   0.560127964848432175E-06;
+-    w[ 9] =   0.680410934802210232E-05;
+-    w[10] =   0.508343873102544037E-04;
+-    w[11] =   0.32753080006610181E-03;
+-    w[12] =   0.267479828788552937E-02;
+-    w[13] = - 0.687704270963253854E-02;
+-    w[14] =   0.119383201790913588E-01;
+-    w[15] =   0.248083722871002796E-02;
+-    w[16] =   0.29000335749726387E-01;
+-    w[17] =   0.798689557875757008E-01;
+-    w[18] =   0.164609842422580606E+00;
+-    w[19] =   0.258535954731607738E+00;
+-    w[20] =   0.292243810406117141E+00;
+-    w[21] =   0.102730713753441829E+00;
+-    w[22] =   0.292243810406117141E+00;
+-    w[23] =   0.258535954731607738E+00;
+-    w[24] =   0.164609842422580606E+00;
+-    w[25] =   0.798689557875757008E-01;
+-    w[26] =   0.29000335749726387E-01;
+-    w[27] =   0.248083722871002796E-02;
+-    w[28] =   0.119383201790913588E-01;
+-    w[29] = - 0.687704270963253854E-02;
+-    w[30] =   0.267479828788552937E-02;
+-    w[31] =   0.32753080006610181E-03;
+-    w[32] =   0.508343873102544037E-04;
+-    w[33] =   0.680410934802210232E-05;
+-    w[34] =   0.560127964848432175E-06;
+-    w[35] =   0.263481722999966618E-07;
+-    w[36] =   0.70903573389336778E-09;
+-    w[37] =   0.104028132097205732E-10;
+-    w[38] =   0.747837010380540069E-13;
+-    w[39] =   0.217337608710893738E-15;
+-    w[40] =   0.175937309107750992E-18;
+-    w[41] =   0.15516931262860431E-22;
+-    w[42] =   0.968100020641528185E-37;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Illegal input value of N.\n";
+-    std::cerr << "  N must be 1, 3, 9, 19, 35, 37, 41 or 43.\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_genz_keister_lookup_weights_np ( int n, int np, double p[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS_NP looks up Genz-Keister Hermite weights.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+?, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and a final rule of order
+-//    35, 37, 41 or 43.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29,
+-//    with the final rule of precision 51, 55, 63 or 67.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Florian Heiss, Viktor Winschel,
+-//    Likelihood approximation by numerical integration on sparse grids,
+-//    Journal of Econometrics,
+-//    Volume 144, 2008, pages 62-80.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::hermite_genz_keister_lookup_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_gk18_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GK18_LOOKUP_POINTS: abscissas of a Hermite Genz-Keister 18 rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+18, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and 37.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29, and 55.
+-//
+-//    Some of the data in this function was kindly supplied directly by
+-//    Alan Genz on 24 April 2011.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    30 April 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Florian Heiss, Viktor Winschel,
+-//    Likelihood approximation by numerical integration on sparse grids,
+-//    Journal of Econometrics,
+-//    Volume 144, 2008, pages 62-80.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9, 19, or 37.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    x[ 0] =   0.0000000000000000E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    x[ 0] =  -1.2247448713915889E+00;
+-    x[ 1] =   0.0000000000000000E+00;
+-    x[ 2] =   1.2247448713915889E+00;
+-  }
+-  else if ( n == 9 )
+-  {
+-    x[ 0] =  -2.9592107790638380E+00;
+-    x[ 1] =  -2.0232301911005157E+00;
+-    x[ 2] =  -1.2247448713915889E+00;
+-    x[ 3] =  -5.2403354748695763E-01;
+-    x[ 4] =   0.0000000000000000E+00;
+-    x[ 5] =   5.2403354748695763E-01;
+-    x[ 6] =   1.2247448713915889E+00;
+-    x[ 7] =   2.0232301911005157E+00;
+-    x[ 8] =   2.9592107790638380E+00;
+-  }
+-  else if ( n == 19 )
+-  {
+-    x[ 0] =  -4.4995993983103881E+00;
+-    x[ 1] =  -3.6677742159463378E+00;
+-    x[ 2] =  -2.9592107790638380E+00;
+-    x[ 3] =  -2.2665132620567876E+00;
+-    x[ 4] =  -2.0232301911005157E+00;
+-    x[ 5] =  -1.8357079751751868E+00;
+-    x[ 6] =  -1.2247448713915889E+00;
+-    x[ 7] =  -8.7004089535290285E-01;
+-    x[ 8] =  -5.2403354748695763E-01;
+-    x[ 9] =   0.0000000000000000E+00;
+-    x[10] =   5.2403354748695763E-01;
+-    x[11] =   8.7004089535290285E-01;
+-    x[12] =   1.2247448713915889E+00;
+-    x[13] =   1.8357079751751868E+00;
+-    x[14] =   2.0232301911005157E+00;
+-    x[15] =   2.2665132620567876E+00;
+-    x[16] =   2.9592107790638380E+00;
+-    x[17] =   3.6677742159463378E+00;
+-    x[18] =   4.4995993983103881E+00;
+-  }
+-  else if ( n == 35 )
+-  {
+-    x[ 0] =  -6.853200069757519;
+-    x[ 1] =  -6.124527854622158;
+-    x[ 2] =  -5.521865209868350;
+-    x[ 3] =  -4.986551454150765;
+-    x[ 4] =  -4.499599398310388;
+-    x[ 5] =  -4.057956316089741;
+-    x[ 6] =  -3.667774215946338;
+-    x[ 7] =  -3.315584617593290;
+-    x[ 8] =  -2.959210779063838;
+-    x[ 9] =  -2.597288631188366;
+-    x[10] =  -2.266513262056788;
+-    x[11] =  -2.023230191100516;
+-    x[12] =  -1.835707975175187;
+-    x[13] =  -1.561553427651873;
+-    x[14] =  -1.224744871391589;
+-    x[15] =  -0.870040895352903;
+-    x[16] =  -0.524033547486958;
+-    x[17] =  -0.214618180588171;
+-    x[18] =   0.000000000000000;
+-    x[19] =   0.214618180588171;
+-    x[20] =   0.524033547486958;
+-    x[21] =   0.870040895352903;
+-    x[22] =   1.224744871391589;
+-    x[23] =   1.561553427651873;
+-    x[24] =   1.835707975175187;
+-    x[25] =   2.023230191100516;
+-    x[26] =   2.266513262056788;
+-    x[27] =   2.597288631188366;
+-    x[28] =   2.959210779063838;
+-    x[29] =   3.315584617593290;
+-    x[30] =   3.667774215946338;
+-    x[31] =   4.057956316089741;
+-    x[32] =   4.499599398310388;
+-    x[33] =   4.986551454150765;
+-    x[34] =   5.521865209868350;
+-    x[35] =   6.124527854622158;
+-    x[36] =   6.853200069757519;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_GK18_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal input value of N.\n";
+-    std::cerr << "  N must be 1, 3, 9, 19, or 37.\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_gk22_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GK22_LOOKUP_POINTS looks up Hermite Genz-Keister 22 points.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+16, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and 41.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29, and 63.
+-//
+-//    Some of the data in this function was kindly supplied directly by
+-//    Alan Genz on 24 April 2011.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 April 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9, 19, or 41.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    x[ 0] =   0.0000000000000000E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    x[ 0] =  -1.2247448713915889E+00;
+-    x[ 1] =   0.0000000000000000E+00;
+-    x[ 2] =   1.2247448713915889E+00;
+-  }
+-  else if ( n == 9 )
+-  {
+-    x[ 0] =  -2.9592107790638380E+00;
+-    x[ 1] =  -2.0232301911005157E+00;
+-    x[ 2] =  -1.2247448713915889E+00;
+-    x[ 3] =  -5.2403354748695763E-01;
+-    x[ 4] =   0.0000000000000000E+00;
+-    x[ 5] =   5.2403354748695763E-01;
+-    x[ 6] =   1.2247448713915889E+00;
+-    x[ 7] =   2.0232301911005157E+00;
+-    x[ 8] =   2.9592107790638380E+00;
+-  }
+-  else if ( n == 19 )
+-  {
+-    x[ 0] =  -4.4995993983103881E+00;
+-    x[ 1] =  -3.6677742159463378E+00;
+-    x[ 2] =  -2.9592107790638380E+00;
+-    x[ 3] =  -2.2665132620567876E+00;
+-    x[ 4] =  -2.0232301911005157E+00;
+-    x[ 5] =  -1.8357079751751868E+00;
+-    x[ 6] =  -1.2247448713915889E+00;
+-    x[ 7] =  -8.7004089535290285E-01;
+-    x[ 8] =  -5.2403354748695763E-01;
+-    x[ 9] =   0.0000000000000000E+00;
+-    x[10] =   5.2403354748695763E-01;
+-    x[11] =   8.7004089535290285E-01;
+-    x[12] =   1.2247448713915889E+00;
+-    x[13] =   1.8357079751751868E+00;
+-    x[14] =   2.0232301911005157E+00;
+-    x[15] =   2.2665132620567876E+00;
+-    x[16] =   2.9592107790638380E+00;
+-    x[17] =   3.6677742159463378E+00;
+-    x[18] =   4.4995993983103881E+00;
+-  }
+-  else if ( n == 41 )
+-  {
+-    x[ 0] =  -7.251792998192644;
+-    x[ 1] =  -6.547083258397540;
+-    x[ 2] =  -5.961461043404500;
+-    x[ 3] =  -5.437443360177798;
+-    x[ 4] =  -4.953574342912980;
+-    x[ 5] =  -4.4995993983103881;
+-    x[ 6] =  -4.070919267883068;
+-    x[ 7] =  -3.6677742159463378;
+-    x[ 8] =  -3.296114596212218;
+-    x[ 9] =  -2.9592107790638380;
+-    x[10] =  -2.630415236459871;
+-    x[11] =  -2.2665132620567876;
+-    x[12] =  -2.043834754429505;
+-    x[13] =  -2.0232301911005157;
+-    x[14] =  -1.8357079751751868;
+-    x[15] =  -1.585873011819188;
+-    x[16] =  -1.2247448713915889;
+-    x[17] =  -0.87004089535290285;
+-    x[18] =  -0.52403354748695763;
+-    x[19] =  -0.195324784415805;
+-    x[20] =   0.0000000000000000;
+-    x[21] =   0.195324784415805;
+-    x[22] =   0.52403354748695763;
+-    x[23] =   0.87004089535290285;
+-    x[24] =   1.2247448713915889;
+-    x[25] =   1.585873011819188;
+-    x[26] =   1.8357079751751868;
+-    x[27] =   2.0232301911005157;
+-    x[28] =   2.043834754429505;
+-    x[29] =   2.2665132620567876;
+-    x[30] =   2.630415236459871;
+-    x[31] =   2.9592107790638380;
+-    x[32] =   3.296114596212218;
+-    x[33] =   3.6677742159463378;
+-    x[34] =   4.070919267883068;
+-    x[35] =   4.4995993983103881;
+-    x[36] =   4.953574342912980;
+-    x[37] =   5.437443360177798;
+-    x[38] =   5.961461043404500;
+-    x[39] =   6.547083258397540;
+-    x[40] =   7.251792998192644;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_GK22_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal input value of N.\n";
+-    std::cerr << "  N must be 1, 3, 9, 19, or 41.\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_gk24_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_GK24_LOOKUP_POINTS looks up Hermite Genz-Keister 24 points.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
+-//
+-//    A nested family of rules for the Hermite integration problem
+-//    was produced by Genz and Keister.  The structure of the nested
+-//    family was denoted by 1+2+6+10+16, that is, it comprised rules
+-//    of successive orders O = 1, 3, 9, 19, and 43.
+-//
+-//    The precisions of these rules are P = 1, 5, 15, 29, and 67.
+-//
+-//    Some of the data in this function was kindly supplied directly by
+-//    Alan Genz on 24 April 2011.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    26 April 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Alan Genz, Bradley Keister,
+-//    Fully symmetric interpolatory rules for multiple integrals
+-//    over infinite regions with Gaussian weight,
+-//    Journal of Computational and Applied Mathematics,
+-//    Volume 71, 1996, pages 299-309
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be 1, 3, 9 19, or 43.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    x[ 0] =   0.0000000000000000E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    x[ 0] =  -1.2247448713915889E+00;
+-    x[ 1] =   0.0000000000000000E+00;
+-    x[ 2] =   1.2247448713915889E+00;
+-  }
+-  else if ( n == 9 )
+-  {
+-    x[ 0] =  -2.9592107790638380E+00;
+-    x[ 1] =  -2.0232301911005157E+00;
+-    x[ 2] =  -1.2247448713915889E+00;
+-    x[ 3] =  -5.2403354748695763E-01;
+-    x[ 4] =   0.0000000000000000E+00;
+-    x[ 5] =   5.2403354748695763E-01;
+-    x[ 6] =   1.2247448713915889E+00;
+-    x[ 7] =   2.0232301911005157E+00;
+-    x[ 8] =   2.9592107790638380E+00;
+-  }
+-  else if ( n == 19 )
+-  {
+-    x[ 0] =  -4.4995993983103881E+00;
+-    x[ 1] =  -3.6677742159463378E+00;
+-    x[ 2] =  -2.9592107790638380E+00;
+-    x[ 3] =  -2.2665132620567876E+00;
+-    x[ 4] =  -2.0232301911005157E+00;
+-    x[ 5] =  -1.8357079751751868E+00;
+-    x[ 6] =  -1.2247448713915889E+00;
+-    x[ 7] =  -8.7004089535290285E-01;
+-    x[ 8] =  -5.2403354748695763E-01;
+-    x[ 9] =   0.0000000000000000E+00;
+-    x[10] =   5.2403354748695763E-01;
+-    x[11] =   8.7004089535290285E-01;
+-    x[12] =   1.2247448713915889E+00;
+-    x[13] =   1.8357079751751868E+00;
+-    x[14] =   2.0232301911005157E+00;
+-    x[15] =   2.2665132620567876E+00;
+-    x[16] =   2.9592107790638380E+00;
+-    x[17] =   3.6677742159463378E+00;
+-    x[18] =   4.4995993983103881E+00;
+-  }
+-  else if ( n == 43 )
+-  {
+-    x[ 0] = -10.167574994881873;
+-    x[ 1] =  -7.231746029072501;
+-    x[ 2] =  -6.535398426382995;
+-    x[ 3] =  -5.954781975039809;
+-    x[ 4] =  -5.434053000365068;
+-    x[ 5] =  -4.952329763008589;
+-    x[ 6] =  -4.4995993983103881;
+-    x[ 7] =  -4.071335874253583;
+-    x[ 8] =  -3.6677742159463378;
+-    x[ 9] =  -3.295265921534226;
+-    x[10] =  -2.9592107790638380;
+-    x[11] =  -2.633356763661946;
+-    x[12] =  -2.2665132620567876;
+-    x[13] =  -2.089340389294661;
+-    x[14] =  -2.0232301911005157;
+-    x[15] =  -1.8357079751751868;
+-    x[16] =  -1.583643465293944;
+-    x[17] =  -1.2247448713915889;
+-    x[18] =  -0.87004089535290285;
+-    x[19] =  -0.52403354748695763;
+-    x[20] =  -0.196029453662011;
+-    x[21] =   0.0000000000000000;
+-    x[22] =   0.196029453662011;
+-    x[23] =   0.52403354748695763;
+-    x[24] =   0.87004089535290285;
+-    x[25] =   1.2247448713915889;
+-    x[26] =   1.583643465293944;
+-    x[27] =   1.8357079751751868;
+-    x[28] =   2.0232301911005157;
+-    x[29] =   2.089340389294661;
+-    x[30] =   2.2665132620567876;
+-    x[31] =   2.633356763661946;
+-    x[32] =   2.9592107790638380;
+-    x[33] =   3.295265921534226;
+-    x[34] =   3.6677742159463378;
+-    x[35] =   4.071335874253583;
+-    x[36] =   4.4995993983103881;
+-    x[37] =   4.952329763008589;
+-    x[38] =   5.434053000365068;
+-    x[39] =   5.954781975039809;
+-    x[40] =   6.535398426382995;
+-    x[41] =   7.231746029072501;
+-    x[42] =  10.167574994881873;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_GK24_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal input value of N.\n";
+-    std::cerr << "  N must be 1, 3, 9, 19, or 43.\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-double hermite_integral ( int n )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_INTEGRAL evaluates a monomial Hermite integral.
+-//
+-//  Discussion:
+-//
+-//    H(n) = Integral ( -oo < x < +oo ) x^n exp(-x^2) dx
+-//
+-//    H(n) is 0 for n odd.
+-//
+-//    H(n) = (n-1)!! * sqrt(pi) / 2^(n/2) for n even.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order of the integral.
+-//    0 <= N.
+-//
+-//    Output, double VALUE, the value of the integral.
+-//
+-{
+-  double pi = 3.141592653589793;
+-  double value;
+-
+-  if ( n < 0 )
+-  {
+-    value = - webbur::r8_huge ( );
+-  }
+-  else if ( ( n % 2 ) == 1 )
+-  {
+-    value = 0.0;
+-  }
+-  else
+-  {
+-    value = webbur::r8_factorial2 ( n - 1 ) * std::sqrt ( pi )
+-      / std::pow ( 2.0, n / 2 );
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void hermite_interpolant ( int n, double x[], double y[], double yp[],
+-  double xd[], double yd[], double xdp[], double ydp[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_INTERPOLANT sets up a divided difference table from Hermite data.
+-//
+-//  Discussion:
+-//
+-//    The polynomial represented by the divided difference table can be
+-//    evaluated by calling DIF_VALS.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Carl deBoor,
+-//    A Practical Guide to Splines,
+-//    Springer, 2001,
+-//    ISBN: 0387953663,
+-//    LC: QA1.A647.v27.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, of items of data
+-//    ( X(I), Y(I), YP(I) ).
+-//
+-//    Input, double X[N], the abscissas.
+-//    These values must be distinct.
+-//
+-//    Input, double Y[N], YP[N], the function and derivative values.
+-//
+-//    Output, double XD[2*N], YD[2*N], the divided difference table
+-//    for the interpolant value.
+-//
+-//    Output, double XDP[2*N-1], YDP[2*N-1], the divided difference
+-//    table for the interpolant derivative.
+-//
+-{
+-  int i;
+-  int j;
+-  int nd;
+-  int ndp;
+-//
+-//  Copy the data.
+-//
+-  nd = 2 * n;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    xd[0+i*2] = x[i];
+-    xd[1+i*2] = x[i];
+-  }
+-//
+-//  Carry out the first step of differencing.
+-//
+-  yd[0] = y[0];
+-  for ( i = 1; i < n; i++ )
+-  {
+-    yd[0+2*i] = ( y[i] - y[i-1] ) / ( x[i] - x[i-1] );
+-  }
+-  for ( i = 0; i < n; i++ )
+-  {
+-    yd[1+2*i] = yp[i];
+-  }
+-//
+-//  Carry out the remaining steps in the usual way.
+-//
+-  for ( i = 2; i < nd; i++ )
+-  {
+-    for ( j = nd - 1; i <= j; j-- )
+-    {
+-      yd[j] = ( yd[j] - yd[j-1] ) / ( xd[j] - xd[j-i] );
+-    }
+-  }
+-//
+-//  Compute the difference table for the derivative.
+-//
+-  webbur::dif_deriv ( nd, xd, yd, &ndp, xdp, ydp );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_interpolant_rule ( int n, double a, double b, double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_INTERPOLANT_RULE: quadrature rule for a Hermite interpolant.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of abscissas.
+-//
+-//    Input, double A, B, the integration limits.
+-//
+-//    Input, double X[N], the abscissas.
+-//
+-//    Output, double W[2*N], the quadrature
+-//    coefficients, given as pairs for function and derivative values
+-//    at each abscissa.
+-//
+-{
+-  double a_value;
+-  double b_value;
+-  double *c;
+-  int i;
+-  int j;
+-  int k;
+-  int nd;
+-  int ndp;
+-  double *xd;
+-  double *xdp;
+-  double *y;
+-  double *yd;
+-  double *ydp;
+-  double *yp;
+-
+-  y = new double[n];
+-  yp = new double[n];
+-
+-  nd = 2 * n;
+-  c = new double[nd];
+-  xd = new double[nd];
+-  yd = new double[nd];
+-
+-  ndp = 2 * n - 1;
+-  xdp = new double[ndp];
+-  ydp = new double[ndp];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    y[i] = 0.0;
+-    yp[i] = 0.0;
+-  }
+-
+-  k = 0;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    y[i] = 1.0;
+-    webbur::hermite_interpolant ( n, x, y, yp, xd, yd, xdp, ydp );
+-    webbur::dif_to_r8poly ( nd, xd, yd, c );
+-    a_value = webbur::r8poly_ant_val ( n, c, a );
+-    b_value = webbur::r8poly_ant_val ( n, c, b );
+-    w[k] = b_value - a_value;
+-    y[i] = 0.0;
+-    k = k + 1;
+-
+-    yp[i] = 1.0;
+-    webbur::hermite_interpolant ( n, x, y, yp, xd, yd, xdp, ydp );
+-    webbur::dif_to_r8poly ( nd, xd, yd, c );
+-    a_value = webbur::r8poly_ant_val ( n, c, a );
+-    b_value = webbur::r8poly_ant_val ( n, c, b );
+-    w[k] = b_value - a_value;
+-    yp[i] = 0.0;
+-    k = k + 1;
+-  }
+-
+-  delete [] c;
+-  delete [] xd;
+-  delete [] xdp;
+-  delete [] y;
+-  delete [] yd;
+-  delete [] ydp;
+-  delete [] yp;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_interpolant_value ( int nd, double xd[], double yd[], double xdp[],
+-  double ydp[], int nv, double xv[], double yv[], double yvp[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_INTERPOLANT_VALUE evaluates the Hermite interpolant polynomial.
+-//
+-//  Discussion:
+-//
+-//    In fact, this function will evaluate an arbitrary polynomial that is
+-//    represented by a difference table.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Carl deBoor,
+-//    A Practical Guide to Splines,
+-//    Springer, 2001,
+-//    ISBN: 0387953663,
+-//    LC: QA1.A647.v27.
+-//
+-//  Parameters:
+-//
+-//    Input, int ND, the order of the difference table.
+-//
+-//    Input, double XD[ND], YD[ND], the difference table for the
+-//    interpolant value.
+-//
+-//    Input, double XDP[ND-1], YDP[ND-1], the difference table for
+-//    the interpolant derivative.
+-//
+-//    Input, int NV, the number of evaluation points.
+-//
+-//    Input, double XV[NV], the evaluation points.
+-//
+-//    Output, double YV[NV], YVP[NV], the value of the interpolant and
+-//    its derivative at the evaluation points.
+-//
+-{
+-  int i;
+-  int j;
+-  int ndp;
+-
+-  ndp = nd - 1;
+-
+-  for ( j = 0; j < nv; j++ )
+-  {
+-    yv[j] = yd[nd-1];
+-    for ( i = nd - 2; 0 <= i; i-- )
+-    {
+-      yv[j] = yd[i] + ( xv[j] - xd[i] ) * yv[j];
+-    }
+-
+-    yvp[j] = ydp[ndp-1];
+-    for ( i = ndp - 2; 0 <= i; i-- )
+-    {
+-      yvp[j] = ydp[i] + ( xv[j] - xdp[i] ) * yvp[j];
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_lookup ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_LOOKUP looks up abscissas and weights for Gauss-Hermite quadrature.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798.
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3,
+-//    LC: QA47.M315.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 20.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::hermite_lookup_points ( n, x );
+-
+-  webbur::hermite_lookup_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_LOOKUP_POINTS looks up abscissas for Hermite quadrature.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) ).
+-//
+-//    Mathematica can numerically estimate the abscissas
+-//    of order N to P digits by the command:
+-//
+-//      NSolve [ HermiteH [ n, x ] == 0, x, p ]
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798,
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3,
+-//    LC: QA47.M315.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 20.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    x[0] = 0.0;
+-  }
+-  else if ( n == 2 )
+-  {
+-    x[0] = - 0.707106781186547524400844362105E+00;
+-    x[1] =   0.707106781186547524400844362105E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    x[0] = - 0.122474487139158904909864203735E+01;
+-    x[1] =   0.0E+00;
+-    x[2] =   0.122474487139158904909864203735E+01;
+-  }
+-  else if ( n == 4 )
+-  {
+-    x[0] = - 0.165068012388578455588334111112E+01;
+-    x[1] = - 0.524647623275290317884060253835E+00;
+-    x[2] =   0.524647623275290317884060253835E+00;
+-    x[3] =   0.165068012388578455588334111112E+01;
+-  }
+-  else if ( n == 5 )
+-  {
+-    x[0] = - 0.202018287045608563292872408814E+01;
+-    x[1] = - 0.958572464613818507112770593893E+00;
+-    x[2] =   0.0E+00;
+-    x[3] =   0.958572464613818507112770593893E+00;
+-    x[4] =   0.202018287045608563292872408814E+01;
+-  }
+-  else if ( n == 6 )
+-  {
+-    x[0] = - 0.235060497367449222283392198706E+01;
+-    x[1] = - 0.133584907401369694971489528297E+01;
+-    x[2] = - 0.436077411927616508679215948251E+00;
+-    x[3] =   0.436077411927616508679215948251E+00;
+-    x[4] =   0.133584907401369694971489528297E+01;
+-    x[5] =   0.235060497367449222283392198706E+01;
+-  }
+-  else if ( n == 7 )
+-  {
+-    x[0] = - 0.265196135683523349244708200652E+01;
+-    x[1] = - 0.167355162876747144503180139830E+01;
+-    x[2] = - 0.816287882858964663038710959027E+00;
+-    x[3] =   0.0E+00;
+-    x[4] =   0.816287882858964663038710959027E+00;
+-    x[5] =   0.167355162876747144503180139830E+01;
+-    x[6] =   0.265196135683523349244708200652E+01;
+-  }
+-  else if ( n == 8 )
+-  {
+-    x[0] = - 0.293063742025724401922350270524E+01;
+-    x[1] = - 0.198165675669584292585463063977E+01;
+-    x[2] = - 0.115719371244678019472076577906E+01;
+-    x[3] = - 0.381186990207322116854718885584E+00;
+-    x[4] =   0.381186990207322116854718885584E+00;
+-    x[5] =   0.115719371244678019472076577906E+01;
+-    x[6] =   0.198165675669584292585463063977E+01;
+-    x[7] =   0.293063742025724401922350270524E+01;
+-  }
+-  else if ( n == 9 )
+-  {
+-    x[0] = - 0.319099320178152760723004779538E+01;
+-    x[1] = - 0.226658058453184311180209693284E+01;
+-    x[2] = - 0.146855328921666793166701573925E+01;
+-    x[3] = - 0.723551018752837573322639864579E+00;
+-    x[4] =   0.0E+00;
+-    x[5] =   0.723551018752837573322639864579E+00;
+-    x[6] =   0.146855328921666793166701573925E+01;
+-    x[7] =   0.226658058453184311180209693284E+01;
+-    x[8] =   0.319099320178152760723004779538E+01;
+-  }
+-  else if ( n == 10 )
+-  {
+-    x[0] =  - 0.343615911883773760332672549432E+01;
+-    x[1] =  - 0.253273167423278979640896079775E+01;
+-    x[2] =  - 0.175668364929988177345140122011E+01;
+-    x[3] =  - 0.103661082978951365417749191676E+01;
+-    x[4] =  - 0.342901327223704608789165025557E+00;
+-    x[5] =    0.342901327223704608789165025557E+00;
+-    x[6] =    0.103661082978951365417749191676E+01;
+-    x[7] =    0.175668364929988177345140122011E+01;
+-    x[8] =    0.253273167423278979640896079775E+01;
+-    x[9] =    0.343615911883773760332672549432E+01;
+-  }
+-  else if ( n == 11 )
+-  {
+-    x[0] =  - 0.366847084655958251845837146485E+01;
+-    x[1] =  - 0.278329009978165177083671870152E+01;
+-    x[2] =  - 0.202594801582575533516591283121E+01;
+-    x[3] =  - 0.132655708449493285594973473558E+01;
+-    x[4] =  - 0.656809566882099765024611575383E+00;
+-    x[5] =    0.0E+00;
+-    x[6] =    0.656809566882099765024611575383E+00;
+-    x[7] =    0.132655708449493285594973473558E+01;
+-    x[8] =    0.202594801582575533516591283121E+01;
+-    x[9] =    0.278329009978165177083671870152E+01;
+-    x[10] =   0.366847084655958251845837146485E+01;
+-  }
+-  else if ( n == 12 )
+-  {
+-    x[0] =  - 0.388972489786978191927164274724E+01;
+-    x[1] =  - 0.302063702512088977171067937518E+01;
+-    x[2] =  - 0.227950708050105990018772856942E+01;
+-    x[3] =  - 0.159768263515260479670966277090E+01;
+-    x[4] =  - 0.947788391240163743704578131060E+00;
+-    x[5] =  - 0.314240376254359111276611634095E+00;
+-    x[6] =    0.314240376254359111276611634095E+00;
+-    x[7] =    0.947788391240163743704578131060E+00;
+-    x[8] =    0.159768263515260479670966277090E+01;
+-    x[9] =    0.227950708050105990018772856942E+01;
+-    x[10] =   0.302063702512088977171067937518E+01;
+-    x[11] =   0.388972489786978191927164274724E+01;
+-  }
+-  else if ( n == 13 )
+-  {
+-    x[0] =  - 0.410133759617863964117891508007E+01;
+-    x[1] =  - 0.324660897837240998812205115236E+01;
+-    x[2] =  - 0.251973568567823788343040913628E+01;
+-    x[3] =  - 0.185310765160151214200350644316E+01;
+-    x[4] =  - 0.122005503659074842622205526637E+01;
+-    x[5] =  - 0.605763879171060113080537108602E+00;
+-    x[6] =    0.0E+00;
+-    x[7] =    0.605763879171060113080537108602E+00;
+-    x[8] =    0.122005503659074842622205526637E+01;
+-    x[9] =    0.185310765160151214200350644316E+01;
+-    x[10] =   0.251973568567823788343040913628E+01;
+-    x[11] =   0.324660897837240998812205115236E+01;
+-    x[12] =   0.410133759617863964117891508007E+01;
+-  }
+-  else if ( n == 14 )
+-  {
+-    x[0] =  - 0.430444857047363181262129810037E+01;
+-    x[1] =  - 0.346265693360227055020891736115E+01;
+-    x[2] =  - 0.274847072498540256862499852415E+01;
+-    x[3] =  - 0.209518325850771681573497272630E+01;
+-    x[4] =  - 0.147668273114114087058350654421E+01;
+-    x[5] =  - 0.878713787329399416114679311861E+00;
+-    x[6] =  - 0.291745510672562078446113075799E+00;
+-    x[7] =    0.291745510672562078446113075799E+00;
+-    x[8] =    0.878713787329399416114679311861E+00;
+-    x[9] =    0.147668273114114087058350654421E+01;
+-    x[10] =   0.209518325850771681573497272630E+01;
+-    x[11] =   0.274847072498540256862499852415E+01;
+-    x[12] =   0.346265693360227055020891736115E+01;
+-    x[13] =   0.430444857047363181262129810037E+01;
+-  }
+-  else if ( n == 15 )
+-  {
+-    x[0] =  - 0.449999070730939155366438053053E+01;
+-    x[1] =  - 0.366995037340445253472922383312E+01;
+-    x[2] =  - 0.296716692790560324848896036355E+01;
+-    x[3] =  - 0.232573248617385774545404479449E+01;
+-    x[4] =  - 0.171999257518648893241583152515E+01;
+-    x[5] =  - 0.113611558521092066631913490556E+01;
+-    x[6] =  - 0.565069583255575748526020337198E+00;
+-    x[7] =    0.0E+00;
+-    x[8] =    0.565069583255575748526020337198E+00;
+-    x[9] =    0.113611558521092066631913490556E+01;
+-    x[10] =   0.171999257518648893241583152515E+01;
+-    x[11] =   0.232573248617385774545404479449E+01;
+-    x[12] =   0.296716692790560324848896036355E+01;
+-    x[13] =   0.366995037340445253472922383312E+01;
+-    x[14] =   0.449999070730939155366438053053E+01;
+-  }
+-  else if ( n == 16 )
+-  {
+-    x[0] =  - 0.468873893930581836468849864875E+01;
+-    x[1] =  - 0.386944790486012269871942409801E+01;
+-    x[2] =  - 0.317699916197995602681399455926E+01;
+-    x[3] =  - 0.254620215784748136215932870545E+01;
+-    x[4] =  - 0.195178799091625397743465541496E+01;
+-    x[5] =  - 0.138025853919888079637208966969E+01;
+-    x[6] =  - 0.822951449144655892582454496734E+00;
+-    x[7] =  - 0.273481046138152452158280401965E+00;
+-    x[8] =    0.273481046138152452158280401965E+00;
+-    x[9] =    0.822951449144655892582454496734E+00;
+-    x[10] =   0.138025853919888079637208966969E+01;
+-    x[11] =   0.195178799091625397743465541496E+01;
+-    x[12] =   0.254620215784748136215932870545E+01;
+-    x[13] =   0.317699916197995602681399455926E+01;
+-    x[14] =   0.386944790486012269871942409801E+01;
+-    x[15] =   0.468873893930581836468849864875E+01;
+-  }
+-  else if ( n == 17 )
+-  {
+-    x[0] =  - 0.487134519367440308834927655662E+01;
+-    x[1] =  - 0.406194667587547430689245559698E+01;
+-    x[2] =  - 0.337893209114149408338327069289E+01;
+-    x[3] =  - 0.275776291570388873092640349574E+01;
+-    x[4] =  - 0.217350282666662081927537907149E+01;
+-    x[5] =  - 0.161292431422123133311288254454E+01;
+-    x[6] =  - 0.106764872574345055363045773799E+01;
+-    x[7] =  - 0.531633001342654731349086553718E+00;
+-    x[8] =    0.0E+00;
+-    x[9] =    0.531633001342654731349086553718E+00;
+-    x[10] =   0.106764872574345055363045773799E+01;
+-    x[11] =   0.161292431422123133311288254454E+01;
+-    x[12] =   0.217350282666662081927537907149E+01;
+-    x[13] =   0.275776291570388873092640349574E+01;
+-    x[14] =   0.337893209114149408338327069289E+01;
+-    x[15] =   0.406194667587547430689245559698E+01;
+-    x[16] =   0.487134519367440308834927655662E+01;
+-  }
+-  else if ( n == 18 )
+-  {
+-    x[0] =  - 0.504836400887446676837203757885E+01;
+-    x[1] =  - 0.424811787356812646302342016090E+01;
+-    x[2] =  - 0.357376906848626607950067599377E+01;
+-    x[3] =  - 0.296137750553160684477863254906E+01;
+-    x[4] =  - 0.238629908916668600026459301424E+01;
+-    x[5] =  - 0.183553160426162889225383944409E+01;
+-    x[6] =  - 0.130092085838961736566626555439E+01;
+-    x[7] =  - 0.776682919267411661316659462284E+00;
+-    x[8] =  - 0.258267750519096759258116098711E+00;
+-    x[9] =    0.258267750519096759258116098711E+00;
+-    x[10] =   0.776682919267411661316659462284E+00;
+-    x[11] =   0.130092085838961736566626555439E+01;
+-    x[12] =   0.183553160426162889225383944409E+01;
+-    x[13] =   0.238629908916668600026459301424E+01;
+-    x[14] =   0.296137750553160684477863254906E+01;
+-    x[15] =   0.357376906848626607950067599377E+01;
+-    x[16] =   0.424811787356812646302342016090E+01;
+-    x[17] =   0.504836400887446676837203757885E+01;
+-  }
+-  else if ( n == 19 )
+-  {
+-    x[0] =  - 0.522027169053748216460967142500E+01;
+-    x[1] =  - 0.442853280660377943723498532226E+01;
+-    x[2] =  - 0.376218735196402009751489394104E+01;
+-    x[3] =  - 0.315784881834760228184318034120E+01;
+-    x[4] =  - 0.259113378979454256492128084112E+01;
+-    x[5] =  - 0.204923170985061937575050838669E+01;
+-    x[6] =  - 0.152417061939353303183354859367E+01;
+-    x[7] =  - 0.101036838713431135136859873726E+01;
+-    x[8] =  - 0.503520163423888209373811765050E+00;
+-    x[9] =    0.0E+00;
+-    x[10] =   0.503520163423888209373811765050E+00;
+-    x[11] =   0.101036838713431135136859873726E+01;
+-    x[12] =   0.152417061939353303183354859367E+01;
+-    x[13] =   0.204923170985061937575050838669E+01;
+-    x[14] =   0.259113378979454256492128084112E+01;
+-    x[15] =   0.315784881834760228184318034120E+01;
+-    x[16] =   0.376218735196402009751489394104E+01;
+-    x[17] =   0.442853280660377943723498532226E+01;
+-    x[18] =   0.522027169053748216460967142500E+01;
+-  }
+-  else if ( n == 20 )
+-  {
+-    x[0] =  - 0.538748089001123286201690041068E+01;
+-    x[1] =  - 0.460368244955074427307767524898E+01;
+-    x[2] =  - 0.394476404011562521037562880052E+01;
+-    x[3] =  - 0.334785456738321632691492452300E+01;
+-    x[4] =  - 0.278880605842813048052503375640E+01;
+-    x[5] =  - 0.225497400208927552308233334473E+01;
+-    x[6] =  - 0.173853771211658620678086566214E+01;
+-    x[7] =  - 0.123407621539532300788581834696E+01;
+-    x[8] =  - 0.737473728545394358705605144252E+00;
+-    x[9] =  - 0.245340708300901249903836530634E+00;
+-    x[10] =   0.245340708300901249903836530634E+00;
+-    x[11] =   0.737473728545394358705605144252E+00;
+-    x[12] =   0.123407621539532300788581834696E+01;
+-    x[13] =   0.173853771211658620678086566214E+01;
+-    x[14] =   0.225497400208927552308233334473E+01;
+-    x[15] =   0.278880605842813048052503375640E+01;
+-    x[16] =   0.334785456738321632691492452300E+01;
+-    x[17] =   0.394476404011562521037562880052E+01;
+-    x[18] =   0.460368244955074427307767524898E+01;
+-    x[19] =   0.538748089001123286201690041068E+01;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::cerr << "  Legal values are 1 through 20.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_lookup_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_LOOKUP_WEIGHTS looks up weights for Hermite quadrature.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
+-//
+-//    The quadrature rule:
+-//
+-//      sum ( 1 <= i <= n ) w(i) * f ( x(i) ).
+-//
+-//    Mathematica can numerically estimate the abscissas
+-//    of order N to P digits by the command:
+-//
+-//      NSolve [ HermiteH [ n, x ] == 0, x, p ]
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798,
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3,
+-//    LC: QA47.M315.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 20.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    w[0] = 1.77245385090551602729816748334;
+-  }
+-  else if ( n == 2 )
+-  {
+-    w[0] = 0.886226925452758013649083741671E+00;
+-    w[1] = 0.886226925452758013649083741671E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    w[0] = 0.295408975150919337883027913890E+00;
+-    w[1] = 0.118163590060367735153211165556E+01;
+-    w[2] = 0.295408975150919337883027913890E+00;
+-  }
+-  else if ( n == 4 )
+-  {
+-    w[0] = 0.813128354472451771430345571899E-01;
+-    w[1] = 0.804914090005512836506049184481E+00;
+-    w[2] = 0.804914090005512836506049184481E+00;
+-    w[3] = 0.813128354472451771430345571899E-01;
+-  }
+-  else if ( n == 5 )
+-  {
+-    w[0] = 0.199532420590459132077434585942E-01;
+-    w[1] = 0.393619323152241159828495620852E+00;
+-    w[2] = 0.945308720482941881225689324449E+00;
+-    w[3] = 0.393619323152241159828495620852E+00;
+-    w[4] = 0.199532420590459132077434585942E-01;
+-  }
+-  else if ( n == 6 )
+-  {
+-    w[0] = 0.453000990550884564085747256463E-02;
+-    w[1] = 0.157067320322856643916311563508E+00;
+-    w[2] = 0.724629595224392524091914705598E+00;
+-    w[3] = 0.724629595224392524091914705598E+00;
+-    w[4] = 0.157067320322856643916311563508E+00;
+-    w[5] = 0.453000990550884564085747256463E-02;
+-  }
+-  else if ( n == 7 )
+-  {
+-    w[0] = 0.971781245099519154149424255939E-03;
+-    w[1] = 0.545155828191270305921785688417E-01;
+-    w[2] = 0.425607252610127800520317466666E+00;
+-    w[3] = 0.810264617556807326764876563813E+00;
+-    w[4] = 0.425607252610127800520317466666E+00;
+-    w[5] = 0.545155828191270305921785688417E-01;
+-    w[6] = 0.971781245099519154149424255939E-03;
+-  }
+-  else if ( n == 8 )
+-  {
+-    w[0] = 0.199604072211367619206090452544E-03;
+-    w[1] = 0.170779830074134754562030564364E-01;
+-    w[2] = 0.207802325814891879543258620286E+00;
+-    w[3] = 0.661147012558241291030415974496E+00;
+-    w[4] = 0.661147012558241291030415974496E+00;
+-    w[5] = 0.207802325814891879543258620286E+00;
+-    w[6] = 0.170779830074134754562030564364E-01;
+-    w[7] = 0.199604072211367619206090452544E-03;
+-  }
+-  else if ( n == 9 )
+-  {
+-    w[0] = 0.396069772632643819045862946425E-04;
+-    w[1] = 0.494362427553694721722456597763E-02;
+-    w[2] = 0.884745273943765732879751147476E-01;
+-    w[3] = 0.432651559002555750199812112956E+00;
+-    w[4] = 0.720235215606050957124334723389E+00;
+-    w[5] = 0.432651559002555750199812112956E+00;
+-    w[6] = 0.884745273943765732879751147476E-01;
+-    w[7] = 0.494362427553694721722456597763E-02;
+-    w[8] = 0.396069772632643819045862946425E-04;
+-  }
+-  else if ( n == 10 )
+-  {
+-    w[0] =  0.764043285523262062915936785960E-05;
+-    w[1] =  0.134364574678123269220156558585E-02;
+-    w[2] =  0.338743944554810631361647312776E-01;
+-    w[3] =  0.240138611082314686416523295006E+00;
+-    w[4] =  0.610862633735325798783564990433E+00;
+-    w[5] =  0.610862633735325798783564990433E+00;
+-    w[6] =  0.240138611082314686416523295006E+00;
+-    w[7] =  0.338743944554810631361647312776E-01;
+-    w[8] =  0.134364574678123269220156558585E-02;
+-    w[9] =  0.764043285523262062915936785960E-05;
+-  }
+-  else if ( n == 11 )
+-  {
+-    w[0] =  0.143956039371425822033088366032E-05;
+-    w[1] =  0.346819466323345510643413772940E-03;
+-    w[2] =  0.119113954449115324503874202916E-01;
+-    w[3] =  0.117227875167708503381788649308E+00;
+-    w[4] =  0.429359752356125028446073598601E+00;
+-    w[5] =  0.654759286914591779203940657627E+00;
+-    w[6] =  0.429359752356125028446073598601E+00;
+-    w[7] =  0.117227875167708503381788649308E+00;
+-    w[8] =  0.119113954449115324503874202916E-01;
+-    w[9] =  0.346819466323345510643413772940E-03;
+-    w[10] = 0.143956039371425822033088366032E-05;
+-  }
+-  else if ( n == 12 )
+-  {
+-    w[0] =  0.265855168435630160602311400877E-06;
+-    w[1] =  0.857368704358785865456906323153E-04;
+-    w[2] =  0.390539058462906185999438432620E-02;
+-    w[3] =  0.516079856158839299918734423606E-01;
+-    w[4] =  0.260492310264161129233396139765E+00;
+-    w[5] =  0.570135236262479578347113482275E+00;
+-    w[6] =  0.570135236262479578347113482275E+00;
+-    w[7] =  0.260492310264161129233396139765E+00;
+-    w[8] =  0.516079856158839299918734423606E-01;
+-    w[9] =  0.390539058462906185999438432620E-02;
+-    w[10] = 0.857368704358785865456906323153E-04;
+-    w[11] = 0.265855168435630160602311400877E-06;
+-  }
+-  else if ( n == 13 )
+-  {
+-    w[0] =  0.482573185007313108834997332342E-07;
+-    w[1] =  0.204303604027070731248669432937E-04;
+-    w[2] =  0.120745999271938594730924899224E-02;
+-    w[3] =  0.208627752961699392166033805050E-01;
+-    w[4] =  0.140323320687023437762792268873E+00;
+-    w[5] =  0.421616296898543221746893558568E+00;
+-    w[6] =  0.604393187921161642342099068579E+00;
+-    w[7] =  0.421616296898543221746893558568E+00;
+-    w[8] =  0.140323320687023437762792268873E+00;
+-    w[9] =  0.208627752961699392166033805050E-01;
+-    w[10] = 0.120745999271938594730924899224E-02;
+-    w[11] = 0.204303604027070731248669432937E-04;
+-    w[12] = 0.482573185007313108834997332342E-07;
+-  }
+-  else if ( n == 14 )
+-  {
+-    w[0] =  0.862859116812515794532041783429E-08;
+-    w[1] =  0.471648435501891674887688950105E-05;
+-    w[2] =  0.355092613551923610483661076691E-03;
+-    w[3] =  0.785005472645794431048644334608E-02;
+-    w[4] =  0.685055342234652055387163312367E-01;
+-    w[5] =  0.273105609064246603352569187026E+00;
+-    w[6] =  0.536405909712090149794921296776E+00;
+-    w[7] =  0.536405909712090149794921296776E+00;
+-    w[8] =  0.273105609064246603352569187026E+00;
+-    w[9] =  0.685055342234652055387163312367E-01;
+-    w[10] = 0.785005472645794431048644334608E-02;
+-    w[11] = 0.355092613551923610483661076691E-03;
+-    w[12] = 0.471648435501891674887688950105E-05;
+-    w[13] = 0.862859116812515794532041783429E-08;
+-  }
+-  else if ( n == 15 )
+-  {
+-    w[0] =  0.152247580425351702016062666965E-08;
+-    w[1] =  0.105911554771106663577520791055E-05;
+-    w[2] =  0.100004441232499868127296736177E-03;
+-    w[3] =  0.277806884291277589607887049229E-02;
+-    w[4] =  0.307800338725460822286814158758E-01;
+-    w[5] =  0.158488915795935746883839384960E+00;
+-    w[6] =  0.412028687498898627025891079568E+00;
+-    w[7] =  0.564100308726417532852625797340E+00;
+-    w[8] =  0.412028687498898627025891079568E+00;
+-    w[9] =  0.158488915795935746883839384960E+00;
+-    w[10] = 0.307800338725460822286814158758E-01;
+-    w[11] = 0.277806884291277589607887049229E-02;
+-    w[12] = 0.100004441232499868127296736177E-03;
+-    w[13] = 0.105911554771106663577520791055E-05;
+-    w[14] = 0.152247580425351702016062666965E-08;
+-  }
+-  else if ( n == 16 )
+-  {
+-    w[0] =  0.265480747401118224470926366050E-09;
+-    w[1] =  0.232098084486521065338749423185E-06;
+-    w[2] =  0.271186009253788151201891432244E-04;
+-    w[3] =  0.932284008624180529914277305537E-03;
+-    w[4] =  0.128803115355099736834642999312E-01;
+-    w[5] =  0.838100413989858294154207349001E-01;
+-    w[6] =  0.280647458528533675369463335380E+00;
+-    w[7] =  0.507929479016613741913517341791E+00;
+-    w[8] =  0.507929479016613741913517341791E+00;
+-    w[9] =  0.280647458528533675369463335380E+00;
+-    w[10] = 0.838100413989858294154207349001E-01;
+-    w[11] = 0.128803115355099736834642999312E-01;
+-    w[12] = 0.932284008624180529914277305537E-03;
+-    w[13] = 0.271186009253788151201891432244E-04;
+-    w[14] = 0.232098084486521065338749423185E-06;
+-    w[15] = 0.265480747401118224470926366050E-09;
+-  }
+-  else if ( n == 17 )
+-  {
+-    w[0] =  0.458057893079863330580889281222E-10;
+-    w[1] =  0.497707898163079405227863353715E-07;
+-    w[2] =  0.711228914002130958353327376218E-05;
+-    w[3] =  0.298643286697753041151336643059E-03;
+-    w[4] =  0.506734995762753791170069495879E-02;
+-    w[5] =  0.409200341495762798094994877854E-01;
+-    w[6] =  0.172648297670097079217645196219E+00;
+-    w[7] =  0.401826469470411956577635085257E+00;
+-    w[8] =  0.530917937624863560331883103379E+00;
+-    w[9] =  0.401826469470411956577635085257E+00;
+-    w[10] = 0.172648297670097079217645196219E+00;
+-    w[11] = 0.409200341495762798094994877854E-01;
+-    w[12] = 0.506734995762753791170069495879E-02;
+-    w[13] = 0.298643286697753041151336643059E-03;
+-    w[14] = 0.711228914002130958353327376218E-05;
+-    w[15] = 0.497707898163079405227863353715E-07;
+-    w[16] = 0.458057893079863330580889281222E-10;
+-  }
+-  else if ( n == 18 )
+-  {
+-    w[0] =  0.782819977211589102925147471012E-11;
+-    w[1] =  0.104672057957920824443559608435E-07;
+-    w[2] =  0.181065448109343040959702385911E-05;
+-    w[3] =  0.918112686792940352914675407371E-04;
+-    w[4] =  0.188852263026841789438175325426E-02;
+-    w[5] =  0.186400423875446519219315221973E-01;
+-    w[6] =  0.973017476413154293308537234155E-01;
+-    w[7] =  0.284807285669979578595606820713E+00;
+-    w[8] =  0.483495694725455552876410522141E+00;
+-    w[9] =  0.483495694725455552876410522141E+00;
+-    w[10] = 0.284807285669979578595606820713E+00;
+-    w[11] = 0.973017476413154293308537234155E-01;
+-    w[12] = 0.186400423875446519219315221973E-01;
+-    w[13] = 0.188852263026841789438175325426E-02;
+-    w[14] = 0.918112686792940352914675407371E-04;
+-    w[15] = 0.181065448109343040959702385911E-05;
+-    w[16] = 0.104672057957920824443559608435E-07;
+-    w[17] = 0.782819977211589102925147471012E-11;
+-  }
+-  else if ( n == 19 )
+-  {
+-    w[0] =  0.132629709449851575185289154385E-11;
+-    w[1] =  0.216305100986355475019693077221E-08;
+-    w[2] =  0.448824314722312295179447915594E-06;
+-    w[3] =  0.272091977631616257711941025214E-04;
+-    w[4] =  0.670877521407181106194696282100E-03;
+-    w[5] =  0.798886677772299020922211491861E-02;
+-    w[6] =  0.508103869090520673569908110358E-01;
+-    w[7] =  0.183632701306997074156148485766E+00;
+-    w[8] =  0.391608988613030244504042313621E+00;
+-    w[9] =  0.502974888276186530840731361096E+00;
+-    w[10] = 0.391608988613030244504042313621E+00;
+-    w[11] = 0.183632701306997074156148485766E+00;
+-    w[12] = 0.508103869090520673569908110358E-01;
+-    w[13] = 0.798886677772299020922211491861E-02;
+-    w[14] = 0.670877521407181106194696282100E-03;
+-    w[15] = 0.272091977631616257711941025214E-04;
+-    w[16] = 0.448824314722312295179447915594E-06;
+-    w[17] = 0.216305100986355475019693077221E-08;
+-    w[18] = 0.132629709449851575185289154385E-11;
+-  }
+-  else if ( n == 20 )
+-  {
+-    w[0] =  0.222939364553415129252250061603E-12;
+-    w[1] =  0.439934099227318055362885145547E-09;
+-    w[2] =  0.108606937076928169399952456345E-06;
+-    w[3] =  0.780255647853206369414599199965E-05;
+-    w[4] =  0.228338636016353967257145917963E-03;
+-    w[5] =  0.324377334223786183218324713235E-02;
+-    w[6] =  0.248105208874636108821649525589E-01;
+-    w[7] =  0.109017206020023320013755033535E+00;
+-    w[8] =  0.286675505362834129719659706228E+00;
+-    w[9] =  0.462243669600610089650328639861E+00;
+-    w[10] = 0.462243669600610089650328639861E+00;
+-    w[11] = 0.286675505362834129719659706228E+00;
+-    w[12] = 0.109017206020023320013755033535E+00;
+-    w[13] = 0.248105208874636108821649525589E-01;
+-    w[14] = 0.324377334223786183218324713235E-02;
+-    w[15] = 0.228338636016353967257145917963E-03;
+-    w[16] = 0.780255647853206369414599199965E-05;
+-    w[17] = 0.108606937076928169399952456345E-06;
+-    w[18] = 0.439934099227318055362885145547E-09;
+-    w[19] = 0.222939364553415129252250061603E-12;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_LOOKUP_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::cerr << "  Legal values are 1 through 20.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_ss_compute ( int order, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_SS_COMPUTE computes a Hermite quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The abscissas are the zeros of the N-th order Hermite polynomial.
+-//
+-//    The integral:
+-//
+-//      Integral ( -oo < X < +oo ) exp ( - X * X ) * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double cc;
+-  double dp2;
+-  int i;
+-  double p1;
+-  double s;
+-  double temp;
+-  double x0;
+-
+-  if ( order < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "HERMITE_SS_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  cc = 1.7724538509 * webbur::r8_gamma ( ( double ) ( order ) )
+-    / std::pow ( 2.0, order - 1 );
+-
+-  s = std::pow ( 2.0 * ( double ) ( order ) + 1.0, 1.0 / 6.0 );
+-
+-  for ( i = 0; i < ( order + 1 ) / 2; i++ )
+-  {
+-    if ( i == 0 )
+-    {
+-      x0 = s * s * s - 1.85575 / s;
+-    }
+-    else if ( i == 1 )
+-    {
+-      x0 = x0 - 1.14 * std::pow ( ( double ) ( order ), 0.426 ) / x0;
+-    }
+-    else if ( i == 2 )
+-    {
+-      x0 = 1.86 * x0 - 0.86 * x[0];
+-    }
+-    else if ( i == 3 )
+-    {
+-      x0 = 1.91 * x0 - 0.91 * x[1];
+-    }
+-    else
+-    {
+-      x0 = 2.0 * x0 - x[i-2];
+-    }
+-
+-    webbur::hermite_ss_root ( &x0, order, &dp2, &p1 );
+-
+-    x[i] = x0;
+-    w[i] = ( cc / dp2 ) / p1;
+-
+-    x[order-i-1] = -x0;
+-    w[order-i-1] = w[i];
+-  }
+-//
+-//  Reverse the order of the abscissas.
+-//
+-  for ( i = 1; i <= order/2; i++ )
+-  {
+-    temp       = x[i-1];
+-    x[i-1]     = x[order-i];
+-    x[order-i] = temp;
+-  }
+-
+-  if ( ( order % 2 ) == 1 )
+-  {
+-    x[(order-1)/2] = 0.0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_ss_recur ( double *p2, double *dp2, double *p1, double x, int order )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_SS_RECUR finds the value and derivative of a Hermite polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Output, double *P2, the value of H(ORDER)(X).
+-//
+-//    Output, double *DP2, the value of H'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of H(ORDER-1)(X).
+-//
+-//    Input, double X, the point at which polynomials are evaluated.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-{
+-  int i;
+-  double dq0;
+-  double dq1;
+-  double dq2;
+-  double q0;
+-  double q1;
+-  double q2;
+-
+-  q1 = 1.0;
+-  dq1 = 0.0;
+-
+-  q2 = x;
+-  dq2 = 1.0;
+-
+-  for ( i = 2; i <= order; i++ )
+-  {
+-    q0 = q1;
+-    dq0 = dq1;
+-
+-    q1 = q2;
+-    dq1 = dq2;
+-
+-    q2  = x * q1 - 0.5 * ( ( double ) ( i ) - 1.0 ) * q0;
+-    dq2 = x * dq1 + q1 - 0.5 * ( ( double ) ( i ) - 1.0 ) * dq0;
+-  }
+-
+-  *p2 = q2;
+-  *dp2 = dq2;
+-  *p1 = q1;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void hermite_ss_root ( double *x, int order, double *dp2, double *p1 )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    HERMITE_SS_ROOT improves an approximate root of a Hermite polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input/output, double *X, the approximate root, which
+-//    should be improved on output.
+-//
+-//    Input, int ORDER, the order of the Hermite polynomial.
+-//
+-//    Output, double *DP2, the value of H'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of H(ORDER-1)(X).
+-//
+-{
+-  double d;
+-  double eps;
+-  double p2;
+-  int step;
+-  int step_max = 10;
+-
+-  eps = webbur::r8_epsilon ( );
+-
+-  for ( step = 1; step <= step_max; step++ )
+-  {
+-    webbur::hermite_ss_recur ( &p2, dp2, p1, *x, order );
+-
+-    d = p2 / ( *dp2 );
+-    *x = *x - d;
+-
+-    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+-    {
+-      return;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-int i4_choose ( int n, int k )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4_CHOOSE computes the binomial coefficient C(N,K).
+-//
+-//  Discussion:
+-//
+-//    The value is calculated in such a way as to avoid overflow and
+-//    roundoff.  The calculation is done in integer arithmetic.
+-//
+-//    The formula used is:
+-//
+-//      C(N,K) = N! / ( K! * (N-K)! )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    09 November 2007
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    ML Wolfson, HV Wright,
+-//    Algorithm 160:
+-//    Combinatorial of M Things Taken N at a Time,
+-//    Communications of the ACM,
+-//    Volume 6, Number 4, April 1963, page 161.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, K, the values of N and K.
+-//
+-//    Output, int I4_CHOOSE, the number of combinations of N
+-//    things taken K at a time.
+-//
+-{
+-  int i;
+-  int mn;
+-  int mx;
+-  int value;
+-
+-  mn = i4_min ( k, n - k );
+-
+-  if ( mn < 0 )
+-  {
+-    value = 0;
+-  }
+-  else if ( mn == 0 )
+-  {
+-    value = 1;
+-  }
+-  else
+-  {
+-    mx = i4_max ( k, n - k );
+-    value = mx + 1;
+-
+-    for ( i = 2; i <= mn; i++ )
+-    {
+-      value = ( value * ( mx + i ) ) / i;
+-    }
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-int i4_log_2 ( int i )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4_LOG_2 returns the integer part of the logarithm base 2 of an I4.
+-//
+-//  Example:
+-//
+-//        I  I4_LOG_10
+-//    -----  --------
+-//        0    0
+-//        1    0
+-//        2    1
+-//        3    1
+-//        4    2
+-//        5    2
+-//        7    2
+-//        8    3
+-//        9    3
+-//     1000    9
+-//     1024   10
+-//
+-//  Discussion:
+-//
+-//    I4_LOG_2 ( I ) + 1 is the number of binary digits in I.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 January 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int I, the number whose logarithm base 2 is desired.
+-//
+-//    Output, int I4_LOG_2, the integer part of the logarithm base 2 of
+-//    the absolute value of X.
+-//
+-{
+-  int i_abs;
+-  int two_pow;
+-  int value;
+-
+-  if ( i == 0 )
+-  {
+-    value = 0;
+-  }
+-  else
+-  {
+-    value = 0;
+-    two_pow = 2;
+-
+-    i_abs = std::abs ( i );
+-
+-    while ( two_pow <= i_abs )
+-    {
+-      value = value + 1;
+-      two_pow = two_pow * 2;
+-    }
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-int i4_max ( int i1, int i2 )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4_MAX returns the maximum of two I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 October 1998
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int I1, I2, are two integers to be compared.
+-//
+-//    Output, int I4_MAX, the larger of I1 and I2.
+-//
+-{
+-  int value;
+-
+-  if ( i2 < i1 )
+-  {
+-    value = i1;
+-  }
+-  else
+-  {
+-    value = i2;
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-int i4_min ( int i1, int i2 )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4_MIN returns the minimum of two I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 October 1998
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int I1, I2, two integers to be compared.
+-//
+-//    Output, int I4_MIN, the smaller of I1 and I2.
+-//
+-{
+-  int value;
+-
+-  if ( i1 < i2 )
+-  {
+-    value = i1;
+-  }
+-  else
+-  {
+-    value = i2;
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-int i4_power ( int i, int j )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4_POWER returns the value of I^J.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 April 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int I, J, the base and the power.  J should be nonnegative.
+-//
+-//    Output, int I4_POWER, the value of I^J.
+-//
+-{
+-  int k;
+-  int value;
+-
+-  if ( j < 0 )
+-  {
+-    if ( i == 1 )
+-    {
+-      value = 1;
+-    }
+-    else if ( i == 0 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "I4_POWER - Fatal error!\n";
+-      std::cerr << "  I^J requested, with I = 0 and J negative.\n";
+-      std::exit ( 1 );
+-    }
+-    else
+-    {
+-      value = 0;
+-    }
+-  }
+-  else if ( j == 0 )
+-  {
+-    if ( i == 0 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "I4_POWER - Fatal error!\n";
+-      std::cerr << "  I^J requested, with I = 0 and J = 0.\n";
+-      std::exit ( 1 );
+-    }
+-    else
+-    {
+-      value = 1;
+-    }
+-  }
+-  else if ( j == 1 )
+-  {
+-    value = i;
+-  }
+-  else
+-  {
+-    value = 1;
+-    for ( k = 1; k <= j; k++ )
+-    {
+-      value = value * i;
+-    }
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void i4mat_copy ( int m, int n, int a1[], int a2[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4MAT_COPY copies one I4MAT to another.
+-//
+-//  Discussion:
+-//
+-//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 August 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input, int A1[M*N], the matrix to be copied.
+-//
+-//    Output, int A2[M*N], the copy of A1.
+-//
+-{
+-  int i;
+-  int j;
+-
+-  for ( j = 0; j < n; j++ )
+-  {
+-    for ( i = 0; i < m; i++ )
+-    {
+-      a2[i+j*m] = a1[i+j*m];
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-int *i4mat_copy_new ( int m, int n, int a1[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4MAT_COPY_NEW copies an I4MAT to a "new" I4MAT.
+-//
+-//  Discussion:
+-//
+-//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 August 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input, int A1[M*N], the matrix to be copied.
+-//
+-//    Output, int I4MAT_COPY_NEW[M*N], the copy of A1.
+-//
+-{
+-  int *a2;
+-  int i;
+-  int j;
+-
+-  a2 = new int[m*n];
+-
+-  for ( j = 0; j < n; j++ )
+-  {
+-    for ( i = 0; i < m; i++ )
+-    {
+-      a2[i+j*m] = a1[i+j*m];
+-    }
+-  }
+-  return a2;
+-}
+-//****************************************************************************80
+-
+-void i4mat_transpose_print ( int m, int n, int a[], std::string title )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
+-//
+-//  Discussion:
+-//
+-//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 January 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows in A.
+-//
+-//    Input, int N, the number of columns in A.
+-//
+-//    Input, int A[M*N], the M by N matrix.
+-//
+-//    Input, string TITLE, a title.
+-//
+-{
+-  i4mat_transpose_print_some ( m, n, a, 1, 1, m, n, title );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void i4mat_transpose_print_some ( int m, int n, int a[], int ilo, int jlo,
+-  int ihi, int jhi, std::string title )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.
+-//
+-//  Discussion:
+-//
+-//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    14 June 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows of the matrix.
+-//    M must be positive.
+-//
+-//    Input, int N, the number of columns of the matrix.
+-//    N must be positive.
+-//
+-//    Input, int A[M*N], the matrix.
+-//
+-//    Input, int ILO, JLO, IHI, JHI, designate the first row and
+-//    column, and the last row and column to be printed.
+-//
+-//    Input, string TITLE, a title.
+-//
+-{
+-# define INCX 10
+-
+-  int i;
+-  int i2hi;
+-  int i2lo;
+-  int j;
+-  int j2hi;
+-  int j2lo;
+-
+-  std::cout << "\n";
+-  std::cout << title << "\n";
+-//
+-//  Print the columns of the matrix, in strips of INCX.
+-//
+-  for ( i2lo = ilo; i2lo <= ihi; i2lo = i2lo + INCX )
+-  {
+-    i2hi = i2lo + INCX - 1;
+-    i2hi = webbur::i4_min ( i2hi, m );
+-    i2hi = webbur::i4_min ( i2hi, ihi );
+-
+-    std::cout << "\n";
+-//
+-//  For each row I in the current range...
+-//
+-//  Write the header.
+-//
+-    std::cout << "  Row: ";
+-    for ( i = i2lo; i <= i2hi; i++ )
+-    {
+-      std::cout << std::setw(6) << i - 1 << "  ";
+-    }
+-    std::cout << "\n";
+-    std::cout << "  Col\n";
+-    std::cout << "\n";
+-//
+-//  Determine the range of the rows in this strip.
+-//
+-    j2lo = webbur::i4_max ( jlo, 1 );
+-    j2hi = webbur::i4_min ( jhi, n );
+-
+-    for ( j = j2lo; j <= j2hi; j++ )
+-    {
+-//
+-//  Print out (up to INCX) entries in column J, that lie in the current strip.
+-//
+-      std::cout << std::setw(5) << j - 1 << ":";
+-      for ( i = i2lo; i <= i2hi; i++ )
+-      {
+-        std::cout << std::setw(6) << a[i-1+(j-1)*m] << "  ";
+-      }
+-      std::cout << "\n";
+-    }
+-  }
+-
+-  return;
+-# undef INCX
+-}
+-//****************************************************************************80
+-
+-void i4mat_write ( std::string output_filename, int m, int n, int table[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4MAT_WRITE writes an I4MAT file.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, string OUTPUT_FILENAME, the output filename.
+-//
+-//    Input, int M, the spatial dimension.
+-//
+-//    Input, int N, the number of points.
+-//
+-//    Input, int TABLE[M*N], the table data.
+-//
+-{
+-  int i;
+-  int j;
+-  std::ofstream output;
+-//
+-//  Open the file.
+-//
+-  output.open ( output_filename.c_str ( ) );
+-
+-  if ( !output )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "I4MAT_WRITE - Fatal error!\n";
+-    std::cerr << "  Could not open the output file.\n";
+-    return;
+-  }
+-//
+-//  Write the data.
+-//
+-  for ( j = 0; j < n; j++ )
+-  {
+-    for ( i = 0; i < m; i++ )
+-    {
+-      output << std::setw(10) << table[i+j*m] << "  ";
+-    }
+-    output << "\n";
+-  }
+-//
+-//  Close the file.
+-//
+-  output.close ( );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int *i4vec_add_new ( int n, int a[], int b[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_ADD_NEW computes C = A + B for I4VEC's.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    28 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries.
+-//
+-//    Input, int A[N], the first vector.
+-//
+-//    Input, int B[N], the second vector.
+-//
+-//    Output, int I4VEC_ADD_NEW[N], the sum of the vectors.
+-//
+-{
+-  int *c;
+-  int i;
+-
+-  c = new int[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    c[i] = a[i] + b[i];
+-  }
+-  return c;
+-}
+-//****************************************************************************80
+-
+-bool i4vec_any_lt ( int n, int a[], int b[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_ANY_LT: ( any ( A < B ) ) for I4VEC's.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    28 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries.
+-//
+-//    Input, int A[N], the first vector.
+-//
+-//    Input, int B[N], the second vector.
+-//
+-//    Output, bool I4VEC_ANY_LT is TRUE if any entry
+-//    of A is less than the corresponding entry of B.
+-//
+-{
+-  int i;
+-  bool value;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    if ( a[i] < b[i] )
+-    {
+-      value = true;
+-      return value;
+-    }
+-  }
+-  value = false;
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void i4vec_copy ( int n, int a1[], int a2[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_COPY copies an I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    25 April 2007
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input, int A1[N], the vector to be copied.
+-//
+-//    Output, int A2[N], the copy of A1.
+-//
+-{
+-  int i;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a2[i] = a1[i];
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-int *i4vec_copy_new ( int n, int a1[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_COPY_NEW copies an I4VEC to a "new" I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 July 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input, int A1[N], the vector to be copied.
+-//
+-//    Output, int I4VEC_COPY_NEW[N], the copy of A1.
+-//
+-{
+-  int *a2;
+-  int i;
+-
+-  a2 = new int[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a2[i] = a1[i];
+-  }
+-  return a2;
+-}
+-//****************************************************************************80
+-
+-void i4vec_min_mv ( int m, int n, int u[], int v[], int w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_MIN_MV determines U(1:N) /\ V for vectors U and a single vector V.
+-//
+-//  Discussion:
+-//
+-//    For two vectors U and V, each of length M, we define
+-//
+-//      ( U /\ V ) (I) = min ( U(I), V(I) ).
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    12 January 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the dimension of the vectors.
+-//
+-//    Input, int N, the number of vectors in U.
+-//
+-//    Input, int U[M*N], N vectors, each of length M.
+-//
+-//    Input, int V[M], a vector of length M.
+-//
+-//    Output, int W[M*N], the value of U /\ W.
+-//
+-{
+-  int i;
+-  int j;
+-
+-  for ( j = 0; j < n; j++ )
+-  {
+-    for ( i = 0; i < m; i++ )
+-    {
+-      w[i+j*m] = i4_min ( u[i+j*m], v[i] );
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void i4vec_print ( int n, int a[], std::string title )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_PRINT prints an I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    14 November 2003
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of components of the vector.
+-//
+-//    Input, int A[N], the vector to be printed.
+-//
+-//    Input, string TITLE, a title.
+-//
+-{
+-  int i;
+-
+-  std::cout << "\n";
+-  std::cout << title << "\n";
+-  std::cout << "\n";
+-  for ( i = 0; i < n; i++ )
+-  {
+-    std::cout << "  " << std::setw(8) << i
+-              << ": " << std::setw(8) << a[i]  << "\n";
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-int i4vec_product ( int n, int a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_PRODUCT multiplies the entries of an I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of integer values.
+-//
+-//  Example:
+-//
+-//    Input:
+-//
+-//      A = ( 1, 2, 3, 4 )
+-//
+-//    Output:
+-//
+-//      I4VEC_PRODUCT = 24
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 May 2003
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input, int A[N], the vector
+-//
+-//    Output, int I4VEC_PRODUCT, the product of the entries of A.
+-//
+-{
+-  int i;
+-  int product;
+-
+-  product = 1;
+-  for ( i = 0; i < n; i++ )
+-  {
+-    product = product * a[i];
+-  }
+-
+-  return product;
+-}
+-//****************************************************************************80
+-
+-int i4vec_sum ( int n, int a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_SUM sums the entries of an I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Example:
+-//
+-//    Input:
+-//
+-//      A = ( 1, 2, 3, 4 )
+-//
+-//    Output:
+-//
+-//      I4VEC_SUM = 10
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    04 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input, int A[N], the vector to be summed.
+-//
+-//    Output, int I4VEC_SUM, the sum of the entries of A.
+-//
+-{
+-  int i;
+-  int sum;
+-
+-  sum = 0;
+-  for ( i = 0; i < n; i++ )
+-  {
+-    sum = sum + a[i];
+-  }
+-
+-  return sum;
+-}
+-//****************************************************************************80
+-
+-void i4vec_zero ( int n, int a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_ZERO zeroes an I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 August 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Output, int A[N], a vector of zeroes.
+-//
+-{
+-  int i;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a[i] = 0;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-int *i4vec_zero_new ( int n )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    I4VEC_ZERO_NEW creates and zeroes an I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    11 July 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Output, int I4VEC_ZERO_NEW[N], a vector of zeroes.
+-//
+-{
+-  int *a;
+-  int i;
+-
+-  a = new int[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a[i] = 0;
+-  }
+-  return a;
+-}
+-//****************************************************************************80
+-
+-void imtqlx ( int n, double d[], double e[], double z[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    IMTQLX diagonalizes a symmetric tridiagonal matrix.
+-//
+-//  Discussion:
+-//
+-//    This routine is a slightly modified version of the EISPACK routine to
+-//    perform the implicit QL algorithm on a symmetric tridiagonal matrix.
+-//
+-//    The authors thank the authors of EISPACK for permission to use this
+-//    routine.
+-//
+-//    It has been modified to produce the product Q' * Z, where Z is an input
+-//    vector and Q is the orthogonal matrix diagonalizing the input matrix.
+-//    The changes consist (essentially) of applying the orthogonal transformations
+-//    directly to Z as they are generated.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    08 January 2010
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Sylvan Elhay, Jaroslav Kautsky,
+-//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+-//    Interpolatory Quadrature,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 13, Number 4, December 1987, pages 399-415.
+-//
+-//    Roger Martin, James Wilkinson,
+-//    The Implicit QL Algorithm,
+-//    Numerische Mathematik,
+-//    Volume 12, Number 5, December 1968, pages 377-383.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order of the matrix.
+-//
+-//    Input/output, double D(N), the diagonal entries of the matrix.
+-//    On output, the information in D has been overwritten.
+-//
+-//    Input/output, double E(N), the subdiagonal entries of the
+-//    matrix, in entries E(1) through E(N-1).  On output, the information in
+-//    E has been overwritten.
+-//
+-//    Input/output, double Z(N).  On input, a vector.  On output,
+-//    the value of Q' * Z, where Q is the matrix that diagonalizes the
+-//    input symmetric tridiagonal matrix.
+-//
+-{
+-  double b;
+-  double c;
+-  double f;
+-  double g;
+-  int i;
+-  int ii;
+-  int itn = 30;
+-  int j;
+-  int k;
+-  int l;
+-  int m;
+-  int mml;
+-  double p;
+-  double prec;
+-  double r;
+-  double s;
+-
+-  prec = webbur::r8_epsilon ( );
+-
+-  if ( n == 1 )
+-  {
+-    return;
+-  }
+-
+-  e[n-1] = 0.0;
+-
+-  for ( l = 1; l <= n; l++ )
+-  {
+-    j = 0;
+-    for ( ; ; )
+-    {
+-      for ( m = l; m <= n; m++ )
+-      {
+-        if ( m == n )
+-        {
+-          break;
+-        }
+-
+-        if ( webbur::r8_abs ( e[m-1] ) <=
+-          prec * ( webbur::r8_abs ( d[m-1] ) + webbur::r8_abs ( d[m] ) ) )
+-        {
+-          break;
+-        }
+-      }
+-      p = d[l-1];
+-      if ( m == l )
+-      {
+-        break;
+-      }
+-      if ( itn <= j )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "IMTQLX - Fatal error!\n";
+-        std::cerr << "  Iteration limit exceeded\n";
+-        std::exit ( 1 );
+-      }
+-      j = j + 1;
+-      g = ( d[l] - p ) / ( 2.0 * e[l-1] );
+-      r = std::sqrt ( g * g + 1.0 );
+-      g = d[m-1] - p + e[l-1] / ( g + webbur::r8_abs ( r ) * webbur::r8_sign ( g ) );
+-      s = 1.0;
+-      c = 1.0;
+-      p = 0.0;
+-      mml = m - l;
+-
+-      for ( ii = 1; ii <= mml; ii++ )
+-      {
+-        i = m - ii;
+-        f = s * e[i-1];
+-        b = c * e[i-1];
+-
+-        if ( webbur::r8_abs ( g ) <= webbur::r8_abs ( f ) )
+-        {
+-          c = g / f;
+-          r = std::sqrt ( c * c + 1.0 );
+-          e[i] = f * r;
+-          s = 1.0 / r;
+-          c = c * s;
+-        }
+-        else
+-        {
+-          s = f / g;
+-          r = std::sqrt ( s * s + 1.0 );
+-          e[i] = g * r;
+-          c = 1.0 / r;
+-          s = s * c;
+-        }
+-        g = d[i] - p;
+-        r = ( d[i-1] - g ) * s + 2.0 * c * b;
+-        p = s * r;
+-        d[i] = g + p;
+-        g = c * r - b;
+-        f = z[i];
+-        z[i] = s * z[i-1] + c * f;
+-        z[i-1] = c * z[i-1] - s * f;
+-      }
+-      d[l-1] = d[l-1] - p;
+-      e[l-1] = g;
+-      e[m-1] = 0.0;
+-    }
+-  }
+-//
+-//  Sorting.
+-//
+-  for ( ii = 2; ii <= m; ii++ )
+-  {
+-    i = ii - 1;
+-    k = i;
+-    p = d[i-1];
+-
+-    for ( j = ii; j <= n; j++ )
+-    {
+-      if ( d[j-1] < p )
+-      {
+-         k = j;
+-         p = d[j-1];
+-      }
+-    }
+-
+-    if ( k != i )
+-    {
+-      d[k-1] = d[i-1];
+-      d[i-1] = p;
+-      p = z[i-1];
+-      z[i-1] = z[k-1];
+-      z[k-1] = p;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_compute ( int n, double alpha, double beta, double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_COMPUTE: Elhay-Kautsky method for Gauss-Jacobi quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) (1-X)**ALPHA * (1+X)**BETA * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    30 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Sylvan Elhay, Jaroslav Kautsky,
+-//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+-//    Interpolatory Quadrature,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 13, Number 4, December 1987, pages 399-415.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, double ALPHA, BETA, the exponents of (1-X) and
+-//    (1+X) in the quadrature rule.  For simple Gauss-Legendre quadrature,
+-//    set ALPHA = BETA = 0.0.  -1.0 < ALPHA and -1.0 < BETA are required.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double abi;
+-  double *bj;
+-  int i;
+-  double i_r8;
+-  double zemu;
+-//
+-//  Define the zero-th moment.
+-//
+-  zemu = std::pow ( 2.0, alpha + beta + 1.0 )
+-    * webbur::r8_gamma ( alpha + 1.0 )
+-    * webbur::r8_gamma ( beta + 1.0 )
+-    / webbur::r8_gamma ( 2.0 + alpha + beta );
+-//
+-//  Define the Jacobi matrix.
+-//
+-  bj = new double[n];
+-
+-  x[0] = ( beta - alpha ) / ( 2.0 + alpha + beta );
+-
+-  bj[0] = 4.0 * ( 1.0 + alpha ) * ( 1.0 + beta )
+-    / ( ( 3.0 + alpha + beta )
+-      * ( 2.0 + alpha + beta ) * ( 2.0 + alpha + beta ) );
+-
+-  for ( i = 1; i < n; i++ )
+-  {
+-    i_r8 = ( double ) ( i + 1 );
+-    abi = 2.0 * i_r8 + alpha + beta;
+-    x[i] = ( beta + alpha ) * ( beta - alpha ) / ( ( abi - 2.0 ) * abi );
+-    bj[i] = 4.0 * i_r8 * ( i_r8 + alpha ) * ( i_r8 + beta )
+-      * ( i_r8 + alpha + beta )
+-      / ( ( abi - 1.0 ) * ( abi + 1.0 ) * abi * abi );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    bj[i] = std::sqrt ( bj[i] );
+-  }
+-
+-  w[0] = std::sqrt ( zemu );
+-
+-  for ( i = 1; i < n; i++ )
+-  {
+-    w[i] = 0.0;
+-  }
+-//
+-//  Diagonalize the Jacobi matrix.
+-//
+-  webbur::imtqlx ( n, x, bj, w );
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = w[i] * w[i];
+-  }
+-
+-  delete [] bj;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_compute_np ( int order, int np, double p[], double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_COMPUTE_NP computes a Jacobi quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) (1-X)^ALPHA * (1+X)^BETA * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//    Thanks to Xu Xiang of Fudan University for pointing out that
+-//    an earlier implementation of this routine was incorrect!
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameter values.
+-//    P[0] = ALPHA, the exponent of (1-X)
+-//    P[1] = BETA,  the exponent of (1+X).
+-//    -1.0 < ALPHA and -1.0 < BETA are required.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-  double beta;
+-
+-  alpha = p[0];
+-  beta = p[1];
+-
+-  webbur::jacobi_compute ( order, alpha, beta, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_compute_points ( int order, double alpha, double beta,
+-  double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_COMPUTE_POINTS computes Jacobi quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    14 October 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, double ALPHA, BETA, the exponents of the (1-X) and (1+X) factors.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double *w;
+-
+-  w = new double[order];
+-
+-  webbur::jacobi_compute ( order, alpha, beta, x, w );
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_compute_points_np ( int order, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_COMPUTE_POINTS_NP computes Jacobi quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameter values.
+-//    P[0] = ALPHA, the exponent of (1-X)
+-//    P[1] = BETA,  the exponent of (1+X).
+-//    -1.0 < ALPHA and -1.0 < BETA are required.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double alpha;
+-  double beta;
+-
+-  alpha = p[0];
+-  beta = p[1];
+-
+-  webbur::jacobi_compute_points ( order, alpha, beta, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_compute_weights ( int order, double alpha, double beta,
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_COMPUTE_WEIGHTS computes Jacobi quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    14 October 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, double ALPHA, BETA, the exponents of the (1-X) and (1+X) factors.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *x;
+-
+-  x = new double[order];
+-
+-  webbur::jacobi_compute ( order, alpha, beta, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_compute_weights_np ( int order, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_COMPUTE_WEIGHTS_NP computes Jacobi quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameter values.
+-//    P[0] = ALPHA, the exponent of (1-X)
+-//    P[1] = BETA,  the exponent of (1+X).
+-//    -1.0 < ALPHA and -1.0 < BETA are required.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double alpha;
+-  double beta;
+-
+-  alpha = p[0];
+-  beta = p[1];
+-
+-  webbur::jacobi_compute_weights ( order, alpha, beta, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double jacobi_integral ( int expon, double alpha, double beta )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_INTEGRAL integrates a monomial with Jacobi weight.
+-//
+-//  Discussion:
+-//
+-//    VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x)^ALPHA (1+x)^BETA dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    08 September 2007
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent.
+-//
+-//    Input, double ALPHA, the exponent of (1-X) in the weight factor.
+-//
+-//    Input, double BETA, the exponent of (1+X) in the weight factor.
+-//
+-//    Output, double JACOBI_INTEGRAL, the value of the integral.
+-//
+-{
+-  double arg1;
+-  double arg2;
+-  double arg3;
+-  double arg4;
+-  double c;
+-  double s;
+-  double value;
+-  double value1;
+-  double value2;
+-
+-  c = ( double ) ( expon );
+-
+-  if ( ( expon % 2 ) == 0 )
+-  {
+-    s = +1.0;
+-  }
+-  else
+-  {
+-    s = -1.0;
+-  }
+-
+-  arg1 = - alpha;
+-  arg2 =   1.0 + c;
+-  arg3 =   2.0 + beta + c;
+-  arg4 = - 1.0;
+-
+-  value1 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
+-
+-  arg1 = - beta;
+-  arg2 =   1.0 + c;
+-  arg3 =   2.0 + alpha + c;
+-  arg4 = - 1.0;
+-
+-  value2 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
+-
+-  value = webbur::r8_gamma ( 1.0 + c ) * (
+-      s * webbur::r8_gamma ( 1.0 + beta  ) * value1
+-    / webbur::r8_gamma ( 2.0 + beta  + c )
+-    +     webbur::r8_gamma ( 1.0 + alpha ) * value2
+-    / webbur::r8_gamma ( 2.0 + alpha + c ) );
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void jacobi_ss_compute ( int order, double alpha, double beta, double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_SS_COMPUTE computes a Jacobi quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) (1-X)^ALPHA * (1+X)^BETA * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//    Thanks to Xu Xiang of Fudan University for pointing out that
+-//    an earlier implementation of this routine was incorrect!
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 February 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, double ALPHA, BETA, the exponents of (1-X) and
+-//    (1+X) in the quadrature rule.  For simple Legendre quadrature,
+-//    set ALPHA = BETA = 0.0.  -1.0 < ALPHA and -1.0 < BETA are required.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double an;
+-  double *b;
+-  double bn;
+-  double *c;
+-  double cc;
+-  double delta;
+-  double dp2;
+-  int i;
+-  double p1;
+-  double prod;
+-  double r1;
+-  double r2;
+-  double r3;
+-  double temp;
+-  double x0;
+-
+-  if ( order < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  b = new double[order];
+-  c = new double[order];
+-//
+-//  Check ALPHA and BETA.
+-//
+-  if ( alpha <= -1.0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
+-    std::cerr << "  -1.0 < ALPHA is required.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  if ( beta <= -1.0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
+-    std::cerr << "  -1.0 < BETA is required.\n";
+-    std::exit ( 1 );
+-  }
+-//
+-//  Set the recursion coefficients.
+-//
+-  for ( i = 1; i <= order; i++ )
+-  {
+-    if ( alpha + beta == 0.0 || beta - alpha == 0.0 )
+-    {
+-      b[i-1] = 0.0;
+-    }
+-    else
+-    {
+-      b[i-1] = ( alpha + beta ) * ( beta - alpha ) /
+-             ( ( alpha + beta + ( double ) ( 2 * i ) )
+-             * ( alpha + beta + ( double ) ( 2 * i - 2 ) ) );
+-    }
+-
+-    if ( i == 1 )
+-    {
+-      c[i-1] = 0.0;
+-    }
+-    else
+-    {
+-      c[i-1] = 4.0 * ( double ) ( i - 1 )
+-         * ( alpha + ( double ) ( i - 1 ) )
+-          * ( beta + ( double ) ( i - 1 ) )
+-            * ( alpha + beta + ( double ) ( i - 1 ) ) /
+-            ( ( alpha + beta + ( double ) ( 2 * i - 1 ) )
+-            * std::pow ( alpha + beta + ( double ) ( 2 * i - 2 ), 2 )
+-            * ( alpha + beta + ( double ) ( 2 * i - 3 ) ) );
+-    }
+-  }
+-
+-  delta = webbur::r8_gamma ( alpha        + 1.0 )
+-        * webbur::r8_gamma (         beta + 1.0 )
+-        / webbur::r8_gamma ( alpha + beta + 2.0 );
+-
+-  prod = 1.0;
+-  for ( i = 2; i <= order; i++ )
+-  {
+-    prod = prod * c[i-1];
+-  }
+-  cc = delta * std::pow ( 2.0, alpha + beta + 1.0 ) * prod;
+-
+-  for ( i = 1; i <= order; i++ )
+-  {
+-    if ( i == 1 )
+-    {
+-      an = alpha / ( double ) ( order );
+-      bn = beta / ( double ) ( order );
+-
+-      r1 = ( 1.0 + alpha )
+-        * ( 2.78 / ( 4.0 + ( double ) ( order * order ) )
+-        + 0.768 * an / ( double ) ( order ) );
+-
+-      r2 = 1.0 + 1.48 * an + 0.96 * bn
+-        + 0.452 * an * an + 0.83 * an * bn;
+-
+-      x0 = ( r2 - r1 ) / r2;
+-    }
+-    else if ( i == 2 )
+-    {
+-      r1 = ( 4.1 + alpha ) /
+-        ( ( 1.0 + alpha ) * ( 1.0 + 0.156 * alpha ) );
+-
+-      r2 = 1.0 + 0.06 * ( ( double ) ( order ) - 8.0 ) *
+-        ( 1.0 + 0.12 * alpha ) / ( double ) ( order );
+-
+-      r3 = 1.0 + 0.012 * beta *
+-        ( 1.0 + 0.25 * r8_abs ( alpha ) ) / ( double ) ( order );
+-
+-      x0 = x0 - r1 * r2 * r3 * ( 1.0 - x0 );
+-    }
+-    else if ( i == 3 )
+-    {
+-      r1 = ( 1.67 + 0.28 * alpha ) / ( 1.0 + 0.37 * alpha );
+-
+-      r2 = 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+-        / ( double ) ( order );
+-
+-      r3 = 1.0 + 8.0 * beta /
+-        ( ( 6.28 + beta ) * ( double ) ( order * order ) );
+-
+-      x0 = x0 - r1 * r2 * r3 * ( x[0] - x0 );
+-    }
+-    else if ( i < order - 1 )
+-    {
+-      x0 = 3.0 * x[i-2] - 3.0 * x[i-3] + x[i-4];
+-    }
+-    else if ( i == order - 1 )
+-    {
+-      r1 = ( 1.0 + 0.235 * beta ) / ( 0.766 + 0.119 * beta );
+-
+-      r2 = 1.0 / ( 1.0 + 0.639
+-        * ( ( double ) ( order ) - 4.0 )
+-        / ( 1.0 + 0.71 * ( ( double ) ( order ) - 4.0 ) ) );
+-
+-      r3 = 1.0 / ( 1.0 + 20.0 * alpha / ( ( 7.5 + alpha ) *
+-        ( double ) ( order * order ) ) );
+-
+-      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+-    }
+-    else if ( i == order )
+-    {
+-      r1 = ( 1.0 + 0.37 * beta ) / ( 1.67 + 0.28 * beta );
+-
+-      r2 = 1.0 /
+-        ( 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
+-        / ( double ) ( order ) );
+-
+-      r3 = 1.0 / ( 1.0 + 8.0 * alpha /
+-        ( ( 6.28 + alpha ) * ( double ) ( order * order ) ) );
+-
+-      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
+-    }
+-
+-    webbur::jacobi_ss_root ( &x0, order, alpha, beta, &dp2, &p1, b, c );
+-
+-    x[i-1] = x0;
+-    w[i-1] = cc / ( dp2 * p1 );
+-  }
+-//
+-//  Reverse the order of the values.
+-//
+-  for ( i = 1; i <= order/2; i++ )
+-  {
+-    temp       = x[i-1];
+-    x[i-1]     = x[order-i];
+-    x[order-i] = temp;
+-  }
+-
+-  for ( i = 1; i <=order/2; i++ )
+-  {
+-    temp       = w[i-1];
+-    w[i-1]     = w[order-i];
+-    w[order-i] = temp;
+-  }
+-
+-  delete [] b;
+-  delete [] c;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_ss_recur ( double *p2, double *dp2, double *p1, double x, int order,
+-  double alpha, double beta, double b[], double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_SS_RECUR evaluates a Jacobi polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 February 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Output, double *P2, the value of J(ORDER)(X).
+-//
+-//    Output, double *DP2, the value of J'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of J(ORDER-1)(X).
+-//
+-//    Input, double X, the point at which polynomials are evaluated.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Input, double ALPHA, BETA, the exponents of (1-X) and
+-//    (1+X) in the quadrature rule.
+-//
+-//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+-//
+-{
+-  double dp0;
+-  double dp1;
+-  int i;
+-  double p0;
+-
+-  *p1 = 1.0;
+-  dp1 = 0.0;
+-
+-  *p2 = x + ( alpha - beta ) / ( alpha + beta + 2.0 );
+-  *dp2 = 1.0;
+-
+-  for ( i = 2; i <= order; i++ )
+-  {
+-    p0 = *p1;
+-    dp0 = dp1;
+-
+-    *p1 = *p2;
+-    dp1 = *dp2;
+-
+-    *p2 = ( x - b[i-1] ) *  ( *p1 ) - c[i-1] * p0;
+-    *dp2 = ( x - b[i-1] ) * dp1 + ( *p1 ) - c[i-1] * dp0;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void jacobi_ss_root ( double *x, int order, double alpha, double beta,
+-  double *dp2, double *p1, double b[], double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    JACOBI_SS_ROOT improves an approximate root of a Jacobi polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 February 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input/output, double *X, the approximate root, which
+-//    should be improved on output.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Input, double ALPHA, BETA, the exponents of (1-X) and
+-//    (1+X) in the quadrature rule.
+-//
+-//    Output, double *DP2, the value of J'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of J(ORDER-1)(X).
+-//
+-//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+-//
+-{
+-  double d;
+-  double eps;
+-  double p2;
+-  int step;
+-  int step_max = 10;
+-
+-  eps = webbur::r8_epsilon ( );
+-
+-  for ( step = 1; step <= step_max; step++ )
+-  {
+-    webbur::jacobi_ss_recur ( &p2, dp2, p1, *x, order, alpha, beta, b, c );
+-
+-    d = p2 / ( *dp2 );
+-    *x = *x - d;
+-
+-    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+-    {
+-      return;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_COMPUTE: Laguerre quadrature rule by the Elhay-Kautsky method.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Sylvan Elhay, Jaroslav Kautsky,
+-//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+-//    Interpolatory Quadrature,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 13, Number 4, December 1987, pages 399-415.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double *bj;
+-  int i;
+-  double zemu;
+-//
+-//  Define the zero-th moment.
+-//
+-  zemu = 1.0;
+-//
+-//  Define the Jacobi matrix.
+-//
+-  bj = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    bj[i] = ( double ) ( i + 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = ( double ) ( 2 * i + 1 );
+-  }
+-
+-  w[0] = std::sqrt ( zemu );
+-
+-  for ( i = 1; i < n; i++ )
+-  {
+-    w[i] = 0.0;
+-  }
+-//
+-//  Diagonalize the Jacobi matrix.
+-//
+-  webbur::imtqlx ( n, x, bj, w );
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = w[i] * w[i];
+-  }
+-
+-  delete [] bj;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_compute_np ( int order, int np, double p[], double x[],
+-  double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_COMPUTE_NP computes a Laguerre quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( 0 <= X < +oo ) exp ( - X ) * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//    The integral:
+-//
+-//      Integral ( A <= X < +oo ) F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * exp ( X(I) ) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  webbur::laguerre_compute ( order, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_compute_points ( int order, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_COMPUTE_POINTS computes Laguerre quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  double *w;
+-
+-  w = new double[order];
+-
+-  webbur::laguerre_compute ( order, x, w );
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_compute_points_np ( int order, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_COMPUTE_POINTS_NP computes Laguerre quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-{
+-  webbur::laguerre_compute_points ( order, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_compute_weights ( int order, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_COMPUTE_WEIGHTS computes Laguerre quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *x;
+-
+-  x = new double[order];
+-
+-  webbur::laguerre_compute ( order, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_compute_weights_np ( int order, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_COMPUTE_WEIGHTS_NP computes Laguerre quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  webbur::laguerre_compute_weights ( order, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double laguerre_integral ( int expon )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_INTEGRAL evaluates a monomial Laguerre integral.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( 0 <= x < +oo ) x^n * exp ( -x ) dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent.
+-//    0 <= EXPON.
+-//
+-//    Output, double EXACT, the value of the integral.
+-//
+-{
+-  double exact;
+-
+-  exact = webbur::r8_factorial ( expon );
+-
+-  return exact;
+-}
+-//****************************************************************************80
+-
+-void laguerre_lookup ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_LOOKUP looks up abscissas and weights for Laguerre quadrature.
+-//
+-//  Discussion:
+-//
+-//    The abscissas are the zeroes of the Laguerre polynomial L(N)(X).
+-//
+-//    The integral:
+-//
+-//      Integral ( 0 <= X < +oo ) exp ( -X ) * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * f ( X(I) )
+-//
+-//    The integral:
+-//
+-//      Integral ( 0 <= X < +oo ) F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * exp ( X(I) ) * f ( X(I) )
+-//
+-//    Mathematica can numerically estimate the abscissas for the
+-//    n-th order polynomial to p digits of precision by the command:
+-//
+-//      NSolve [ LaguerreL[n,x] == 0, x, p ]
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798,
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 20.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::laguerre_lookup_points ( n, x );
+-
+-  webbur::laguerre_lookup_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_LOOKUP_POINTS looks up abscissas for Laguerre quadrature.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798,
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 20.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    x[0] =  1.00000000000000000000000000000E+00;
+-  }
+-  else if ( n == 2 )
+-  {
+-    x[0] = 0.585786437626904951198311275790E+00;
+-    x[1] = 3.41421356237309504880168872421E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    x[0] = 0.415774556783479083311533873128E+00;
+-    x[1] = 2.29428036027904171982205036136E+00;
+-    x[2] = 6.28994508293747919686641576551E+00;
+-  }
+-  else if ( n == 4 )
+-  {
+-    x[0] = 0.322547689619392311800361459104E+00;
+-    x[1] = 1.74576110115834657568681671252E+00;
+-    x[2] = 4.53662029692112798327928538496E+00;
+-    x[3] = 9.39507091230113312923353644342E+00;
+-  }
+-  else if ( n == 5 )
+-  {
+-    x[0] = 0.263560319718140910203061943361E+00;
+-    x[1] = 1.41340305910651679221840798019E+00;
+-    x[2] = 3.59642577104072208122318658878E+00;
+-    x[3] = 7.08581000585883755692212418111E+00;
+-    x[4] = 12.6408008442757826594332193066E+00;
+-  }
+-  else if ( n == 6 )
+-  {
+-    x[0] = 0.222846604179260689464354826787E+00;
+-    x[1] = 1.18893210167262303074315092194E+00;
+-    x[2] = 2.99273632605931407769132528451E+00;
+-    x[3] = 5.77514356910451050183983036943E+00;
+-    x[4] = 9.83746741838258991771554702994E+00;
+-    x[5] = 15.9828739806017017825457915674E+00;
+-  }
+-  else if ( n == 7 )
+-  {
+-    x[0] = 0.193043676560362413838247885004E+00;
+-    x[1] = 1.02666489533919195034519944317E+00;
+-    x[2] = 2.56787674495074620690778622666E+00;
+-    x[3] = 4.90035308452648456810171437810E+00;
+-    x[4] = 8.18215344456286079108182755123E+00;
+-    x[5] = 12.7341802917978137580126424582E+00;
+-    x[6] = 19.3957278622625403117125820576E+00;
+-  }
+-  else if ( n == 8 )
+-  {
+-    x[0] = 0.170279632305100999788861856608E+00;
+-    x[1] = 0.903701776799379912186020223555E+00;
+-    x[2] = 2.25108662986613068930711836697E+00;
+-    x[3] = 4.26670017028765879364942182690E+00;
+-    x[4] = 7.04590540239346569727932548212E+00;
+-    x[5] = 10.7585160101809952240599567880E+00;
+-    x[6] = 15.7406786412780045780287611584E+00;
+-    x[7] = 22.8631317368892641057005342974E+00;
+-  }
+-  else if ( n == 9 )
+-  {
+-    x[0] = 0.152322227731808247428107073127E+00;
+-    x[1] = 0.807220022742255847741419210952E+00;
+-    x[2] = 2.00513515561934712298303324701E+00;
+-    x[3] = 3.78347397333123299167540609364E+00;
+-    x[4] = 6.20495677787661260697353521006E+00;
+-    x[5] = 9.37298525168757620180971073215E+00;
+-    x[6] = 13.4662369110920935710978818397E+00;
+-    x[7] = 18.8335977889916966141498992996E+00;
+-    x[8] = 26.3740718909273767961410072937E+00;
+-  }
+-  else if ( n == 10 )
+-  {
+-    x[0] = 0.137793470540492430830772505653E+00;
+-    x[1] = 0.729454549503170498160373121676E+00;
+-    x[2] = 1.80834290174031604823292007575E+00;
+-    x[3] = 3.40143369785489951448253222141E+00;
+-    x[4] = 5.55249614006380363241755848687E+00;
+-    x[5] = 8.33015274676449670023876719727E+00;
+-    x[6] = 11.8437858379000655649185389191E+00;
+-    x[7] = 16.2792578313781020995326539358E+00;
+-    x[8] = 21.9965858119807619512770901956E+00;
+-    x[9] = 29.9206970122738915599087933408E+00;
+-  }
+-  else if ( n == 11 )
+-  {
+-    x[0] = 0.125796442187967522675794577516E+00;
+-    x[1] = 0.665418255839227841678127839420E+00;
+-    x[2] = 1.64715054587216930958700321365E+00;
+-    x[3] = 3.09113814303525495330195934259E+00;
+-    x[4] = 5.02928440157983321236999508366E+00;
+-    x[5] = 7.50988786380661681941099714450E+00;
+-    x[6] = 10.6059509995469677805559216457E+00;
+-    x[7] = 14.4316137580641855353200450349E+00;
+-    x[8] = 19.1788574032146786478174853989E+00;
+-    x[9] = 25.2177093396775611040909447797E+00;
+-    x[10] = 33.4971928471755372731917259395E+00;
+-  }
+-  else if ( n == 12 )
+-  {
+-    x[0] = 0.115722117358020675267196428240E+00;
+-    x[1] = 0.611757484515130665391630053042E+00;
+-    x[2] = 1.51261026977641878678173792687E+00;
+-    x[3] = 2.83375133774350722862747177657E+00;
+-    x[4] = 4.59922763941834848460572922485E+00;
+-    x[5] = 6.84452545311517734775433041849E+00;
+-    x[6] = 9.62131684245686704391238234923E+00;
+-    x[7] = 13.0060549933063477203460524294E+00;
+-    x[8] = 17.1168551874622557281840528008E+00;
+-    x[9] = 22.1510903793970056699218950837E+00;
+-    x[10] = 28.4879672509840003125686072325E+00;
+-    x[11] = 37.0991210444669203366389142764E+00;
+-  }
+-  else if ( n == 13 )
+-  {
+-    x[0] = 0.107142388472252310648493376977E+00;
+-    x[1] = 0.566131899040401853406036347177E+00;
+-    x[2] = 1.39856433645101971792750259921E+00;
+-    x[3] = 2.61659710840641129808364008472E+00;
+-    x[4] = 4.23884592901703327937303389926E+00;
+-    x[5] = 6.29225627114007378039376523025E+00;
+-    x[6] = 8.81500194118697804733348868036E+00;
+-    x[7] = 11.8614035888112425762212021880E+00;
+-    x[8] = 15.5107620377037527818478532958E+00;
+-    x[9] = 19.8846356638802283332036594634E+00;
+-    x[10] = 25.1852638646777580842970297823E+00;
+-    x[11] = 31.8003863019472683713663283526E+00;
+-    x[12] = 40.7230086692655795658979667001E+00;
+-  }
+-  else if ( n == 14 )
+-  {
+-    x[0] = 0.0997475070325975745736829452514E+00;
+-    x[1] = 0.526857648851902896404583451502E+00;
+-    x[2] = 1.30062912125149648170842022116E+00;
+-    x[3] = 2.43080107873084463616999751038E+00;
+-    x[4] = 3.93210282229321888213134366778E+00;
+-    x[5] = 5.82553621830170841933899983898E+00;
+-    x[6] = 8.14024014156514503005978046052E+00;
+-    x[7] = 10.9164995073660188408130510904E+00;
+-    x[8] = 14.2108050111612886831059780825E+00;
+-    x[9] = 18.1048922202180984125546272083E+00;
+-    x[10] = 22.7233816282696248232280886985E+00;
+-    x[11] = 28.2729817232482056954158923218E+00;
+-    x[12] = 35.1494436605924265828643121364E+00;
+-    x[13] = 44.3660817111174230416312423666E+00;
+-  }
+-  else if ( n == 15 )
+-  {
+-    x[0] = 0.0933078120172818047629030383672E+00;
+-    x[1] = 0.492691740301883908960101791412E+00;
+-    x[2] = 1.21559541207094946372992716488E+00;
+-    x[3] = 2.26994952620374320247421741375E+00;
+-    x[4] = 3.66762272175143727724905959436E+00;
+-    x[5] = 5.42533662741355316534358132596E+00;
+-    x[6] = 7.56591622661306786049739555812E+00;
+-    x[7] = 10.1202285680191127347927394568E+00;
+-    x[8] = 13.1302824821757235640991204176E+00;
+-    x[9] = 16.6544077083299578225202408430E+00;
+-    x[10] = 20.7764788994487667729157175676E+00;
+-    x[11] = 25.6238942267287801445868285977E+00;
+-    x[12] = 31.4075191697539385152432196202E+00;
+-    x[13] = 38.5306833064860094162515167595E+00;
+-    x[14] = 48.0260855726857943465734308508E+00;
+-  }
+-  else if ( n == 16 )
+-  {
+-    x[0] = 0.0876494104789278403601980973401E+00;
+-    x[1] = 0.462696328915080831880838260664E+00;
+-    x[2] = 1.14105777483122685687794501811E+00;
+-    x[3] = 2.12928364509838061632615907066E+00;
+-    x[4] = 3.43708663389320664523510701675E+00;
+-    x[5] = 5.07801861454976791292305830814E+00;
+-    x[6] = 7.07033853504823413039598947080E+00;
+-    x[7] = 9.43831433639193878394724672911E+00;
+-    x[8] = 12.2142233688661587369391246088E+00;
+-    x[9] = 15.4415273687816170767647741622E+00;
+-    x[10] = 19.1801568567531348546631409497E+00;
+-    x[11] = 23.5159056939919085318231872752E+00;
+-    x[12] = 28.5787297428821403675206137099E+00;
+-    x[13] = 34.5833987022866258145276871778E+00;
+-    x[14] = 41.9404526476883326354722330252E+00;
+-    x[15] = 51.7011603395433183643426971197E+00;
+-  }
+-  else if ( n == 17 )
+-  {
+-    x[0] = 0.0826382147089476690543986151980E+00;
+-    x[1] = 0.436150323558710436375959029847E+00;
+-    x[2] = 1.07517657751142857732980316755E+00;
+-    x[3] = 2.00519353164923224070293371933E+00;
+-    x[4] = 3.23425612404744376157380120696E+00;
+-    x[5] = 4.77351351370019726480932076262E+00;
+-    x[6] = 6.63782920536495266541643929703E+00;
+-    x[7] = 8.84668551116980005369470571184E+00;
+-    x[8] = 11.4255293193733525869726151469E+00;
+-    x[9] = 14.4078230374813180021982874959E+00;
+-    x[10] = 17.8382847307011409290658752412E+00;
+-    x[11] = 21.7782682577222653261749080522E+00;
+-    x[12] = 26.3153178112487997766149598369E+00;
+-    x[13] = 31.5817716804567331343908517497E+00;
+-    x[14] = 37.7960938374771007286092846663E+00;
+-    x[15] = 45.3757165339889661829258363215E+00;
+-    x[16] = 55.3897517898396106640900199790E+00;
+-  }
+-  else if ( n == 18 )
+-  {
+-    x[0] = 0.0781691666697054712986747615334E+00;
+-    x[1] = 0.412490085259129291039101536536E+00;
+-    x[2] = 1.01652017962353968919093686187E+00;
+-    x[3] = 1.89488850996976091426727831954E+00;
+-    x[4] = 3.05435311320265975115241130719E+00;
+-    x[5] = 4.50420553888989282633795571455E+00;
+-    x[6] = 6.25672507394911145274209116326E+00;
+-    x[7] = 8.32782515660563002170470261564E+00;
+-    x[8] = 10.7379900477576093352179033397E+00;
+-    x[9] = 13.5136562075550898190863812108E+00;
+-    x[10] = 16.6893062819301059378183984163E+00;
+-    x[11] = 20.3107676262677428561313764553E+00;
+-    x[12] = 24.4406813592837027656442257980E+00;
+-    x[13] = 29.1682086625796161312980677805E+00;
+-    x[14] = 34.6279270656601721454012429438E+00;
+-    x[15] = 41.0418167728087581392948614284E+00;
+-    x[16] = 48.8339227160865227486586093290E+00;
+-    x[17] = 59.0905464359012507037157810181E+00;
+-  }
+-  else if ( n == 19 )
+-  {
+-    x[0] = 0.0741587837572050877131369916024E+00;
+-    x[1] = 0.391268613319994607337648350299E+00;
+-    x[2] = 0.963957343997958058624878377130E+00;
+-    x[3] = 1.79617558206832812557725825252E+00;
+-    x[4] = 2.89365138187378399116494713237E+00;
+-    x[5] = 4.26421553962776647436040018167E+00;
+-    x[6] = 5.91814156164404855815360191408E+00;
+-    x[7] = 7.86861891533473373105668358176E+00;
+-    x[8] = 10.1324237168152659251627415800E+00;
+-    x[9] = 12.7308814638423980045092979656E+00;
+-    x[10] = 15.6912783398358885454136069861E+00;
+-    x[11] = 19.0489932098235501532136429732E+00;
+-    x[12] = 22.8508497608294829323930586693E+00;
+-    x[13] = 27.1606693274114488789963947149E+00;
+-    x[14] = 32.0691222518622423224362865906E+00;
+-    x[15] = 37.7129058012196494770647508283E+00;
+-    x[16] = 44.3173627958314961196067736013E+00;
+-    x[17] = 52.3129024574043831658644222420E+00;
+-    x[18] = 62.8024231535003758413504690673E+00;
+-  }
+-  else if ( n == 20 )
+-  {
+-    x[0] = 0.0705398896919887533666890045842E+00;
+-    x[1] = 0.372126818001611443794241388761E+00;
+-    x[2] = 0.916582102483273564667716277074E+00;
+-    x[3] = 1.70730653102834388068768966741E+00;
+-    x[4] = 2.74919925530943212964503046049E+00;
+-    x[5] = 4.04892531385088692237495336913E+00;
+-    x[6] = 5.61517497086161651410453988565E+00;
+-    x[7] = 7.45901745367106330976886021837E+00;
+-    x[8] = 9.59439286958109677247367273428E+00;
+-    x[9] = 12.0388025469643163096234092989E+00;
+-    x[10] = 14.8142934426307399785126797100E+00;
+-    x[11] = 17.9488955205193760173657909926E+00;
+-    x[12] = 21.4787882402850109757351703696E+00;
+-    x[13] = 25.4517027931869055035186774846E+00;
+-    x[14] = 29.9325546317006120067136561352E+00;
+-    x[15] = 35.0134342404790000062849359067E+00;
+-    x[16] = 40.8330570567285710620295677078E+00;
+-    x[17] = 47.6199940473465021399416271529E+00;
+-    x[18] = 55.8107957500638988907507734445E+00;
+-    x[19] = 66.5244165256157538186403187915E+00;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LAGUERRE_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::cerr << "  Legal values are 1 through 20.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_lookup_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_LOOKUP_WEIGHTS looks up weights for Laguerre quadrature.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798,
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 20.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    w[0] =  1.00000000000000000000000000000E+00;
+-  }
+-  else if ( n == 2 )
+-  {
+-    w[0] = 0.85355339059327376220042218105E+00;
+-    w[1] = 0.146446609406726237799577818948E+00;
+-  }
+-  else if ( n == 3 )
+-  {
+-    w[0] = 0.71109300992917301544959019114E+00;
+-    w[1] = 0.27851773356924084880144488846E+00;
+-    w[2] = 0.010389256501586135748964920401E+00;
+-  }
+-  else if ( n == 4 )
+-  {
+-    w[0] = 0.60315410434163360163596602382E+00;
+-    w[1] = 0.35741869243779968664149201746E+00;
+-    w[2] = 0.03888790851500538427243816816E+00;
+-    w[3] = 0.0005392947055613274501037905676E+00;
+-  }
+-  else if ( n == 5 )
+-  {
+-    w[0] = 0.52175561058280865247586092879E+00;
+-    w[1] = 0.3986668110831759274541333481E+00;
+-    w[2] = 0.0759424496817075953876533114E+00;
+-    w[3] = 0.00361175867992204845446126257E+00;
+-    w[4] = 0.00002336997238577622789114908455E+00;
+-  }
+-  else if ( n == 6 )
+-  {
+-    w[0] = 0.45896467394996359356828487771E+00;
+-    w[1] = 0.4170008307721209941133775662E+00;
+-    w[2] = 0.1133733820740449757387061851E+00;
+-    w[3] = 0.01039919745314907489891330285E+00;
+-    w[4] = 0.000261017202814932059479242860E+00;
+-    w[5] = 8.98547906429621238825292053E-07;
+-  }
+-  else if ( n == 7 )
+-  {
+-    w[0] = 0.40931895170127390213043288002E+00;
+-    w[1] = 0.4218312778617197799292810054E+00;
+-    w[2] = 0.1471263486575052783953741846E+00;
+-    w[3] = 0.0206335144687169398657056150E+00;
+-    w[4] = 0.00107401014328074552213195963E+00;
+-    w[5] = 0.0000158654643485642012687326223E+00;
+-    w[6] = 3.17031547899558056227132215E-08;
+-  }
+-  else if ( n == 8 )
+-  {
+-    w[0] = 0.36918858934163752992058283938E+00;
+-    w[1] = 0.4187867808143429560769785813E+00;
+-    w[2] = 0.175794986637171805699659867E+00;
+-    w[3] = 0.033343492261215651522132535E+00;
+-    w[4] = 0.0027945362352256725249389241E+00;
+-    w[5] = 0.00009076508773358213104238501E+00;
+-    w[6] = 8.4857467162725315448680183E-07;
+-    w[7] = 1.04800117487151038161508854E-09;
+-  }
+-  else if ( n == 9 )
+-  {
+-    w[0] = 0.336126421797962519673467717606E+00;
+-    w[1] = 0.411213980423984387309146942793E+00;
+-    w[2] = 0.199287525370885580860575607212E+00;
+-    w[3] = 0.0474605627656515992621163600479E+00;
+-    w[4] = 0.00559962661079458317700419900556E+00;
+-    w[5] = 0.000305249767093210566305412824291E+00;
+-    w[6] = 6.59212302607535239225572284875E-06;
+-    w[7] = 4.1107693303495484429024104033E-08;
+-    w[8] = 3.29087403035070757646681380323E-11;
+-  }
+-  else if ( n == 10 )
+-  {
+-    w[0] = 0.30844111576502014154747083468E+00;
+-    w[1] = 0.4011199291552735515157803099E+00;
+-    w[2] = 0.218068287611809421588648523E+00;
+-    w[3] = 0.062087456098677747392902129E+00;
+-    w[4] = 0.009501516975181100553839072E+00;
+-    w[5] = 0.0007530083885875387754559644E+00;
+-    w[6] = 0.00002825923349599565567422564E+00;
+-    w[7] = 4.249313984962686372586577E-07;
+-    w[8] = 1.839564823979630780921535E-09;
+-    w[9] = 9.911827219609008558377547E-13;
+-  }
+-  else if ( n == 11 )
+-  {
+-    w[0] = 0.28493321289420060505605102472E+00;
+-    w[1] = 0.3897208895278493779375535080E+00;
+-    w[2] = 0.232781831848991333940223796E+00;
+-    w[3] = 0.076564453546196686400854179E+00;
+-    w[4] = 0.014393282767350695091863919E+00;
+-    w[5] = 0.001518880846484873069847776E+00;
+-    w[6] = 0.0000851312243547192259720424E+00;
+-    w[7] = 2.29240387957450407857683E-06;
+-    w[8] = 2.48635370276779587373391E-08;
+-    w[9] = 7.71262693369132047028153E-11;
+-    w[10] = 2.883775868323623861597778E-14;
+-  }
+-  else if ( n == 12 )
+-  {
+-    w[0] = 0.26473137105544319034973889206E+00;
+-    w[1] = 0.3777592758731379820244905567E+00;
+-    w[2] = 0.244082011319877564254870818E+00;
+-    w[3] = 0.09044922221168093072750549E+00;
+-    w[4] = 0.02010238115463409652266129E+00;
+-    w[5] = 0.002663973541865315881054158E+00;
+-    w[6] = 0.000203231592662999392121433E+00;
+-    w[7] = 8.3650558568197987453363E-06;
+-    w[8] = 1.66849387654091026116990E-07;
+-    w[9] = 1.34239103051500414552392E-09;
+-    w[10] = 3.06160163503502078142408E-12;
+-    w[11] = 8.148077467426241682473119E-16;
+-  }
+-  else if ( n == 13 )
+-  {
+-    w[0] = 0.24718870842996262134624918596E+00;
+-    w[1] = 0.3656888229005219453067175309E+00;
+-    w[2] = 0.252562420057658502356824289E+00;
+-    w[3] = 0.10347075802418370511421863E+00;
+-    w[4] = 0.02643275441556161577815877E+00;
+-    w[5] = 0.00422039604025475276555209E+00;
+-    w[6] = 0.000411881770472734774892473E+00;
+-    w[7] = 0.0000235154739815532386882897E+00;
+-    w[8] = 7.3173116202490991040105E-07;
+-    w[9] = 1.10884162570398067979151E-08;
+-    w[10] = 6.7708266922058988406462E-11;
+-    w[11] = 1.15997995990507606094507E-13;
+-    w[12] = 2.245093203892758415991872E-17;
+-  }
+-  else if ( n == 14 )
+-  {
+-    w[0] = 0.23181557714486497784077486110E+00;
+-    w[1] = 0.3537846915975431518023313013E+00;
+-    w[2] = 0.258734610245428085987320561E+00;
+-    w[3] = 0.11548289355692321008730499E+00;
+-    w[4] = 0.03319209215933736003874996E+00;
+-    w[5] = 0.00619286943700661021678786E+00;
+-    w[6] = 0.00073989037786738594242589E+00;
+-    w[7] = 0.000054907194668416983785733E+00;
+-    w[8] = 2.4095857640853774967578E-06;
+-    w[9] = 5.801543981676495180886E-08;
+-    w[10] = 6.819314692484974119616E-10;
+-    w[11] = 3.2212077518948479398089E-12;
+-    w[12] = 4.2213524405165873515980E-15;
+-    w[13] = 6.05237502228918880839871E-19;
+-  }
+-  else if ( n == 15 )
+-  {
+-    w[0] = 0.21823488594008688985641323645E+00;
+-    w[1] = 0.3422101779228833296389489568E+00;
+-    w[2] = 0.263027577941680097414812275E+00;
+-    w[3] = 0.12642581810593053584303055E+00;
+-    w[4] = 0.04020686492100091484158548E+00;
+-    w[5] = 0.00856387780361183836391576E+00;
+-    w[6] = 0.00121243614721425207621921E+00;
+-    w[7] = 0.00011167439234425194199258E+00;
+-    w[8] = 6.459926762022900924653E-06;
+-    w[9] = 2.226316907096272630332E-07;
+-    w[10] = 4.227430384979365007351E-09;
+-    w[11] = 3.921897267041089290385E-11;
+-    w[12] = 1.4565152640731264063327E-13;
+-    w[13] = 1.4830270511133013354616E-16;
+-    w[14] = 1.60059490621113323104998E-20;
+-  }
+-  else if ( n == 16 )
+-  {
+-    w[0] = 0.20615171495780099433427363674E+00;
+-    w[1] = 0.3310578549508841659929830987E+00;
+-    w[2] = 0.265795777644214152599502021E+00;
+-    w[3] = 0.13629693429637753997554751E+00;
+-    w[4] = 0.0473289286941252189780623E+00;
+-    w[5] = 0.0112999000803394532312490E+00;
+-    w[6] = 0.0018490709435263108642918E+00;
+-    w[7] = 0.00020427191530827846012602E+00;
+-    w[8] = 0.00001484458687398129877135E+00;
+-    w[9] = 6.828319330871199564396E-07;
+-    w[10] = 1.881024841079673213882E-08;
+-    w[11] = 2.862350242973881619631E-10;
+-    w[12] = 2.127079033224102967390E-12;
+-    w[13] = 6.297967002517867787174E-15;
+-    w[14] = 5.050473700035512820402E-18;
+-    w[15] = 4.1614623703728551904265E-22;
+-  }
+-  else if ( n == 17 )
+-  {
+-    w[0] = 0.19533220525177083214592729770E+00;
+-    w[1] = 0.3203753572745402813366256320E+00;
+-    w[2] = 0.267329726357171097238809604E+00;
+-    w[3] = 0.14512985435875862540742645E+00;
+-    w[4] = 0.0544369432453384577793806E+00;
+-    w[5] = 0.0143572977660618672917767E+00;
+-    w[6] = 0.0026628247355727725684324E+00;
+-    w[7] = 0.0003436797271562999206118E+00;
+-    w[8] = 0.00003027551783782870109437E+00;
+-    w[9] = 1.768515053231676895381E-06;
+-    w[10] = 6.57627288681043332199E-08;
+-    w[11] = 1.469730932159546790344E-09;
+-    w[12] = 1.81691036255544979555E-11;
+-    w[13] = 1.095401388928687402976E-13;
+-    w[14] = 2.617373882223370421551E-16;
+-    w[15] = 1.6729356931461546908502E-19;
+-    w[16] = 1.06562631627404278815253E-23;
+-  }
+-  else if ( n == 18 )
+-  {
+-    w[0] = 0.18558860314691880562333775228E+00;
+-    w[1] = 0.3101817663702252936495975957E+00;
+-    w[2] = 0.267866567148536354820854395E+00;
+-    w[3] = 0.15297974746807490655384308E+00;
+-    w[4] = 0.0614349178609616527076780E+00;
+-    w[5] = 0.0176872130807729312772600E+00;
+-    w[6] = 0.0036601797677599177980266E+00;
+-    w[7] = 0.0005406227870077353231284E+00;
+-    w[8] = 0.0000561696505121423113818E+00;
+-    w[9] = 4.01530788370115755859E-06;
+-    w[10] = 1.91466985667567497969E-07;
+-    w[11] = 5.8360952686315941292E-09;
+-    w[12] = 1.07171126695539012773E-10;
+-    w[13] = 1.08909871388883385562E-12;
+-    w[14] = 5.38666474837830887608E-15;
+-    w[15] = 1.049865978035703408779E-17;
+-    w[16] = 5.405398451631053643566E-21;
+-    w[17] = 2.6916532692010286270838E-25;
+-  }
+-  else if ( n == 19 )
+-  {
+-    w[0] = 0.17676847491591250225103547981E+00;
+-    w[1] = 0.3004781436072543794821568077E+00;
+-    w[2] = 0.267599547038175030772695441E+00;
+-    w[3] = 0.15991337213558021678551215E+00;
+-    w[4] = 0.0682493799761491134552355E+00;
+-    w[5] = 0.0212393076065443249244062E+00;
+-    w[6] = 0.0048416273511483959672501E+00;
+-    w[7] = 0.0008049127473813667665946E+00;
+-    w[8] = 0.0000965247209315350170843E+00;
+-    w[9] = 8.20730525805103054409E-06;
+-    w[10] = 4.8305667247307725394E-07;
+-    w[11] = 1.90499136112328569994E-08;
+-    w[12] = 4.8166846309280615577E-10;
+-    w[13] = 7.3482588395511443768E-12;
+-    w[14] = 6.2022753875726163989E-14;
+-    w[15] = 2.54143084301542272372E-16;
+-    w[16] = 4.07886129682571235007E-19;
+-    w[17] = 1.707750187593837061004E-22;
+-    w[18] = 6.715064649908189959990E-27;
+-  }
+-  else if ( n == 20 )
+-  {
+-    w[0] = 0.168746801851113862149223899689E+00;
+-    w[1] = 0.291254362006068281716795323812E+00;
+-    w[2] = 0.266686102867001288549520868998E+00;
+-    w[3] = 0.166002453269506840031469127816E+00;
+-    w[4] = 0.0748260646687923705400624639615E+00;
+-    w[5] = 0.0249644173092832210728227383234E+00;
+-    w[6] = 0.00620255084457223684744754785395E+00;
+-    w[7] = 0.00114496238647690824203955356969E+00;
+-    w[8] = 0.000155741773027811974779809513214E+00;
+-    w[9] = 0.0000154014408652249156893806714048E+00;
+-    w[10] = 1.08648636651798235147970004439E-06;
+-    w[11] = 5.33012090955671475092780244305E-08;
+-    w[12] = 1.7579811790505820035778763784E-09;
+-    w[13] = 3.72550240251232087262924585338E-11;
+-    w[14] = 4.76752925157819052449488071613E-13;
+-    w[15] = 3.37284424336243841236506064991E-15;
+-    w[16] = 1.15501433950039883096396247181E-17;
+-    w[17] = 1.53952214058234355346383319667E-20;
+-    w[18] = 5.28644272556915782880273587683E-24;
+-    w[19] = 1.65645661249902329590781908529E-28;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LAGUERRE_LOOKUP_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::cerr << "  Legal values are 1 through 20.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_ss_compute ( int order, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_SS_COMPUTE computes a Laguerre quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( 0 <= X < +oo ) exp ( - X ) * F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
+-//
+-//    The integral:
+-//
+-//        Integral ( A <= X < +oo ) F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= ORDER ) W(I) * exp ( X(I) ) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    1 <= ORDER.
+-//
+-//    Output, double X[ORDER], the abscissas.
+-//
+-//    Output, double W[ORDER], the weights.
+-//
+-{
+-  double *b;
+-  double *c;
+-  double cc;
+-  double dp2;
+-  int i;
+-  int j;
+-  double p1;
+-  double prod;
+-  double r1;
+-  double x0;
+-
+-  if ( order < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LAGUERRE_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of ORDER = " << order << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  b = new double[order];
+-  c = new double[order];
+-//
+-//  Set the recursion coefficients.
+-//
+-  for ( i = 0; i < order; i++ )
+-  {
+-    b[i] = ( double ) ( 2 * i + 1 );
+-  }
+-
+-  for ( i = 0; i < order; i++ )
+-  {
+-    c[i] = ( double ) ( i * i );
+-  }
+-  prod = 1.0;
+-  for ( i = 1; i < order; i++ )
+-  {
+-    prod = prod * c[i];
+-  }
+-  cc = prod;
+-
+-  for ( i = 0; i < order; i++ )
+-  {
+-//
+-//  Compute an estimate for the root.
+-//
+-    if ( i == 0 )
+-    {
+-      x0 =  3.0 / ( 1.0 + 2.4 * ( double ) ( order ) );
+-    }
+-    else if ( i == 1 )
+-    {
+-      x0 = x0 + 15.0 / ( 1.0 + 2.5 * ( double ) ( order ) );
+-    }
+-    else
+-    {
+-      r1 = ( 1.0 + 2.55 * ( double ) ( i - 1 ) )
+-        / ( 1.9 * ( double ) ( i - 1 ) );
+-
+-      x0 = x0 + r1 * ( x0 - x[i-2] );
+-    }
+-//
+-//  Use iteration to find the root.
+-//
+-    webbur::laguerre_ss_root ( &x0, order, &dp2, &p1, b, c );
+-//
+-//  Set the abscissa and weight.
+-//
+-    x[i] = x0;
+-//
+-//  Because of the huge values involved, this calculation breaks down
+-//  for ORDER = 127.
+-//
+-//  It was originally w[i] = ( cc / dp2 ) / p1, which breaks down sooner.
+-//
+-    w[i] = ( 1.0 / dp2 );
+-    for ( j = 2; j <= order; j++ )
+-    {
+-      w[i] = w[i] * ( double ) ( j - 1 );
+-    }
+-    w[i] = w[i] / p1;
+-    for ( j = 2; j <= order; j++ )
+-    {
+-      w[i] = w[i] * ( double ) ( j - 1 );
+-    }
+-
+-//  w[i] = ( cc / dp2 ) / p1;
+-  }
+-
+-  delete [] b;
+-  delete [] c;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x,
+-  int order, double b[], double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_SS_RECUR evaluates a Laguerre polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Output, double *P2, the value of L(ORDER)(X).
+-//
+-//    Output, double *DP2, the value of L'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of L(ORDER-1)(X).
+-//
+-//    Input, double X, the point at which polynomials are evaluated.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+-//
+-{
+-  double dp0;
+-  double dp1;
+-  int i;
+-  double p0;
+-
+-  *p1 = 1.0;
+-  dp1 = 0.0;
+-
+-  *p2 = x - 1.0;
+-  *dp2 = 1.0;
+-
+-  for ( i = 1; i < order; i++ )
+-  {
+-    p0 = *p1;
+-    dp0 = dp1;
+-
+-    *p1 = *p2;
+-    dp1 = *dp2;
+-
+-    *p2  = ( x - b[i] ) * ( *p1 ) - c[i] * p0;
+-    *dp2 = ( x - b[i] ) * dp1 + ( *p1 ) - c[i] * dp0;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void laguerre_ss_root ( double *x, int order, double *dp2, double *p1,
+-  double b[], double c[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LAGUERRE_SS_ROOT improves a root of a Laguerre polynomial.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input/output, double *X, the approximate root, which
+-//    should be improved on output.
+-//
+-//    Input, int ORDER, the order of the polynomial.
+-//
+-//    Output, double *DP2, the value of L'(ORDER)(X).
+-//
+-//    Output, double *P1, the value of L(ORDER-1)(X).
+-//
+-//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
+-//
+-{
+-  double d;
+-  double eps;
+-  double p2;
+-  int step;
+-  int step_max = 10;
+-
+-  eps = webbur::r8_epsilon ( );
+-
+-  for ( step = 1; step <= step_max; step++ )
+-  {
+-    webbur::laguerre_ss_recur ( &p2, dp2, p1, *x, order, b, c );
+-
+-    d = p2 / ( *dp2 );
+-    *x = *x - d;
+-
+-    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
+-    {
+-      break;
+-    }
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_COMPUTE: Legendre quadrature rule by the Elhay-Kautsky method.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 April 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Sylvan Elhay, Jaroslav Kautsky,
+-//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
+-//    Interpolatory Quadrature,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 13, Number 4, December 1987, pages 399-415.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double *bj;
+-  int i;
+-  double zemu;
+-//
+-//  Define the zero-th moment.
+-//
+-  zemu = 2.0;
+-//
+-//  Define the Jacobi matrix.
+-//
+-  bj = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    bj[i] = ( double ) ( ( i + 1 ) * ( i + 1 ) )
+-          / ( double ) ( 4 * ( i + 1 ) * ( i + 1 ) - 1 );
+-    bj[i] = std::sqrt ( bj[i] );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = 0.0;
+-  }
+-
+-  w[0] = std::sqrt ( zemu );
+-
+-  for ( i = 1; i < n; i++ )
+-  {
+-    w[i] = 0.0;
+-  }
+-//
+-//  Diagonalize the Jacobi matrix.
+-//
+-  webbur::imtqlx ( n, x, bj, w );
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    w[i] = w[i] * w[i];
+-  }
+-
+-  delete [] bj;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_compute_np ( int n, int np, double p[], double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_COMPUTE_NP computes a Legendre quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::legendre_compute ( n, x, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_COMPUTE_POINTS computes Legendre quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  double *w;
+-
+-  w= new double[n];
+-
+-  webbur::legendre_compute ( n, x, w );
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_compute_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_COMPUTE_POINTS_NP computes Legendre quadrature points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  webbur::legendre_compute_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_COMPUTE_WEIGHTS computes Legendre quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double *x;
+-
+-  x = new double[n];
+-
+-  webbur::legendre_compute ( n, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_compute_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_COMPUTE_WEIGHTS_NP computes Legendre quadrature weights.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  webbur::legendre_compute_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_dr_compute ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_DR_COMPUTE computes a Legendre quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      Integral ( -1 <= X <= 1 ) F(X) dX
+-//
+-//    The quadrature rule:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 June 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    1 <= N.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double d1;
+-  double d2pn;
+-  double d3pn;
+-  double d4pn;
+-  double dp;
+-  double dpn;
+-  double e1;
+-  double fx;
+-  double h;
+-  int i;
+-  int iback;
+-  int k;
+-  int m;
+-  int mp1mi;
+-  int ncopy;
+-  int nmove;
+-  double p;
+-  double pi = 3.141592653589793;
+-  double pk;
+-  double pkm1;
+-  double pkp1;
+-  double t;
+-  double u;
+-  double v;
+-  double x0;
+-  double xtemp;
+-
+-  if ( n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEGENDRE_DR_COMPUTE - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  e1 = ( double ) ( n * ( n + 1 ) );
+-
+-  m = ( n + 1 ) / 2;
+-
+-  for ( i = 1; i <= m; i++ )
+-  {
+-    mp1mi = m + 1 - i;
+-
+-    t = ( double ) ( 4 * i - 1 ) * pi / ( double ) ( 4 * n + 2 );
+-
+-    x0 =  std::cos ( t ) * ( 1.0 - ( 1.0 - 1.0 / ( double ) ( n ) )
+-      / ( double ) ( 8 * n * n ) );
+-
+-    pkm1 = 1.0;
+-    pk = x0;
+-
+-    for ( k = 2; k <= n; k++ )
+-    {
+-      pkp1 = 2.0 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) / ( double ) ( k );
+-      pkm1 = pk;
+-      pk = pkp1;
+-    }
+-
+-    d1 = ( double ) ( n ) * ( pkm1 - x0 * pk );
+-
+-    dpn = d1 / ( 1.0 - x0 * x0 );
+-
+-    d2pn = ( 2.0 * x0 * dpn - e1 * pk ) / ( 1.0 - x0 * x0 );
+-
+-    d3pn = ( 4.0 * x0 * d2pn + ( 2.0 - e1 ) * dpn ) / ( 1.0 - x0 * x0 );
+-
+-    d4pn = ( 6.0 * x0 * d3pn + ( 6.0 - e1 ) * d2pn ) / ( 1.0 - x0 * x0 );
+-
+-    u = pk / dpn;
+-    v = d2pn / dpn;
+-//
+-//  Initial approximation H:
+-//
+-    h = -u * ( 1.0 + 0.5 * u * ( v + u * ( v * v - d3pn / ( 3.0 * dpn ) ) ) );
+-//
+-//  Refine H using one step of Newton's method:
+-//
+-    p = pk + h * ( dpn + 0.5 * h * ( d2pn + h / 3.0
+-      * ( d3pn + 0.25 * h * d4pn ) ) );
+-
+-    dp = dpn + h * ( d2pn + 0.5 * h * ( d3pn + h * d4pn / 3.0 ) );
+-
+-    h = h - p / dp;
+-
+-    xtemp = x0 + h;
+-
+-    x[mp1mi-1] = xtemp;
+-
+-    fx = d1 - h * e1 * ( pk + 0.5 * h * ( dpn + h / 3.0
+-      * ( d2pn + 0.25 * h * ( d3pn + 0.2 * h * d4pn ) ) ) );
+-
+-    w[mp1mi-1] = 2.0 * ( 1.0 - xtemp * xtemp ) / ( fx * fx );
+-  }
+-
+-  if ( ( n % 2 ) == 1 )
+-  {
+-    x[0] = 0.0;
+-  }
+-//
+-//  Shift the data up.
+-//
+-  nmove = ( n + 1 ) / 2;
+-  ncopy = n - nmove;
+-
+-  for ( i = 1; i <= nmove; i++ )
+-  {
+-    iback = n + 1 - i;
+-    x[iback-1] = x[iback-ncopy-1];
+-    w[iback-1] = w[iback-ncopy-1];
+-  }
+-//
+-//  Reflect values for the negative abscissas.
+-//
+-  for ( i = 1; i <= n - nmove; i++ )
+-  {
+-    x[i-1] = - x[n-i];
+-    w[i-1] = w[n-i];
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double legendre_integral ( int expon )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_INTEGRAL evaluates a monomial Legendre integral.
+-//
+-//  Discussion:
+-//
+-//    The integral:
+-//
+-//      integral ( -1 <= x <= +1 ) x^n dx
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int EXPON, the exponent.
+-//
+-//    Output, double LEGENDRE_INTEGRAL, the value of the exact integral.
+-//
+-{
+-  double exact;
+-//
+-//  Get the exact value of the integral.
+-//
+-  if ( ( expon % 2 ) == 0 )
+-  {
+-    exact = 2.0 / ( double ) ( expon + 1 );
+-  }
+-  else
+-  {
+-    exact = 0.0;
+-  }
+-
+-  return exact;
+-}
+-//****************************************************************************80
+-
+-void legendre_lookup ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_LOOKUP looks up abscissas and weights for Gauss-Legendre quadrature.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798.
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3,
+-//    LC: QA47.M315.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 33.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the abscissas.
+-//
+-{
+-  webbur::legendre_lookup_points ( n, x );
+-
+-  webbur::legendre_lookup_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_LOOKUP_POINTS looks up abscissas for Gauss-Legendre quadrature.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798.
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3,
+-//    LC: QA47.M315.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 33.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    x[0] = 0.000000000000000000000000000000;
+-  }
+-  else if ( n == 2 )
+-  {
+-    x[0] = -0.577350269189625764509148780502;
+-    x[1] = 0.577350269189625764509148780502;
+-  }
+-  else if ( n == 3 )
+-  {
+-    x[0] = -0.774596669241483377035853079956;
+-    x[1] = 0.000000000000000000000000000000;
+-    x[2] = 0.774596669241483377035853079956;
+-  }
+-  else if ( n == 4 )
+-  {
+-    x[0] = -0.861136311594052575223946488893;
+-    x[1] = -0.339981043584856264802665759103;
+-    x[2] = 0.339981043584856264802665759103;
+-    x[3] = 0.861136311594052575223946488893;
+-  }
+-  else if ( n == 5 )
+-  {
+-    x[0] = -0.906179845938663992797626878299;
+-    x[1] = -0.538469310105683091036314420700;
+-    x[2] = 0.000000000000000000000000000000;
+-    x[3] = 0.538469310105683091036314420700;
+-    x[4] = 0.906179845938663992797626878299;
+-  }
+-  else if ( n == 6 )
+-  {
+-    x[0] = -0.932469514203152027812301554494;
+-    x[1] = -0.661209386466264513661399595020;
+-    x[2] = -0.238619186083196908630501721681;
+-    x[3] = 0.238619186083196908630501721681;
+-    x[4] = 0.661209386466264513661399595020;
+-    x[5] = 0.932469514203152027812301554494;
+-  }
+-  else if ( n == 7 )
+-  {
+-    x[0] = -0.949107912342758524526189684048;
+-    x[1] = -0.741531185599394439863864773281;
+-    x[2] = -0.405845151377397166906606412077;
+-    x[3] = 0.000000000000000000000000000000;
+-    x[4] = 0.405845151377397166906606412077;
+-    x[5] = 0.741531185599394439863864773281;
+-    x[6] = 0.949107912342758524526189684048;
+-  }
+-  else if ( n == 8 )
+-  {
+-    x[0] = -0.960289856497536231683560868569;
+-    x[1] = -0.796666477413626739591553936476;
+-    x[2] = -0.525532409916328985817739049189;
+-    x[3] = -0.183434642495649804939476142360;
+-    x[4] = 0.183434642495649804939476142360;
+-    x[5] = 0.525532409916328985817739049189;
+-    x[6] = 0.796666477413626739591553936476;
+-    x[7] = 0.960289856497536231683560868569;
+-  }
+-  else if ( n == 9 )
+-  {
+-    x[0] = -0.968160239507626089835576203;
+-    x[1] = -0.836031107326635794299429788;
+-    x[2] = -0.613371432700590397308702039;
+-    x[3] = -0.324253423403808929038538015;
+-    x[4] = 0.000000000000000000000000000;
+-    x[5] = 0.324253423403808929038538015;
+-    x[6] = 0.613371432700590397308702039;
+-    x[7] = 0.836031107326635794299429788;
+-    x[8] = 0.968160239507626089835576203;
+-  }
+-  else if ( n == 10 )
+-  {
+-    x[0] = -0.973906528517171720077964012;
+-    x[1] = -0.865063366688984510732096688;
+-    x[2] = -0.679409568299024406234327365;
+-    x[3] = -0.433395394129247190799265943;
+-    x[4] = -0.148874338981631210884826001;
+-    x[5] = 0.148874338981631210884826001;
+-    x[6] = 0.433395394129247190799265943;
+-    x[7] = 0.679409568299024406234327365;
+-    x[8] = 0.865063366688984510732096688;
+-    x[9] = 0.973906528517171720077964012;
+-  }
+-  else if ( n == 11 )
+-  {
+-    x[0] = -0.978228658146056992803938001;
+-    x[1] = -0.887062599768095299075157769;
+-    x[2] = -0.730152005574049324093416252;
+-    x[3] = -0.519096129206811815925725669;
+-    x[4] = -0.269543155952344972331531985;
+-    x[5] = 0.000000000000000000000000000;
+-    x[6] = 0.269543155952344972331531985;
+-    x[7] = 0.519096129206811815925725669;
+-    x[8] = 0.730152005574049324093416252;
+-    x[9] = 0.887062599768095299075157769;
+-    x[10] = 0.978228658146056992803938001;
+-  }
+-  else if ( n == 12 )
+-  {
+-    x[0] = -0.981560634246719250690549090;
+-    x[1] = -0.904117256370474856678465866;
+-    x[2] = -0.769902674194304687036893833;
+-    x[3] = -0.587317954286617447296702419;
+-    x[4] = -0.367831498998180193752691537;
+-    x[5] = -0.125233408511468915472441369;
+-    x[6] = 0.125233408511468915472441369;
+-    x[7] = 0.367831498998180193752691537;
+-    x[8] = 0.587317954286617447296702419;
+-    x[9] = 0.769902674194304687036893833;
+-    x[10] = 0.904117256370474856678465866;
+-    x[11] = 0.981560634246719250690549090;
+-  }
+-  else if ( n == 13 )
+-  {
+-    x[0] = -0.984183054718588149472829449;
+-    x[1] = -0.917598399222977965206547837;
+-    x[2] = -0.801578090733309912794206490;
+-    x[3] = -0.642349339440340220643984607;
+-    x[4] = -0.448492751036446852877912852;
+-    x[5] = -0.230458315955134794065528121;
+-    x[6] = 0.000000000000000000000000000;
+-    x[7] = 0.230458315955134794065528121;
+-    x[8] = 0.448492751036446852877912852;
+-    x[9] = 0.642349339440340220643984607;
+-    x[10] = 0.80157809073330991279420649;
+-    x[11] = 0.91759839922297796520654784;
+-    x[12] = 0.98418305471858814947282945;
+-  }
+-  else if ( n == 14 )
+-  {
+-    x[0] = -0.986283808696812338841597267;
+-    x[1] = -0.928434883663573517336391139;
+-    x[2] = -0.827201315069764993189794743;
+-    x[3] = -0.687292904811685470148019803;
+-    x[4] = -0.515248636358154091965290719;
+-    x[5] = -0.319112368927889760435671824;
+-    x[6] = -0.108054948707343662066244650;
+-    x[7] = 0.108054948707343662066244650;
+-    x[8] = 0.31911236892788976043567182;
+-    x[9] = 0.51524863635815409196529072;
+-    x[10] = 0.68729290481168547014801980;
+-    x[11] = 0.82720131506976499318979474;
+-    x[12] = 0.92843488366357351733639114;
+-    x[13] = 0.98628380869681233884159727;
+-  }
+-  else if ( n == 15 )
+-  {
+-    x[0] = -0.987992518020485428489565719;
+-    x[1] = -0.937273392400705904307758948;
+-    x[2] = -0.848206583410427216200648321;
+-    x[3] = -0.724417731360170047416186055;
+-    x[4] = -0.570972172608538847537226737;
+-    x[5] = -0.394151347077563369897207371;
+-    x[6] = -0.201194093997434522300628303;
+-    x[7] = 0.00000000000000000000000000;
+-    x[8] = 0.20119409399743452230062830;
+-    x[9] = 0.39415134707756336989720737;
+-    x[10] = 0.57097217260853884753722674;
+-    x[11] = 0.72441773136017004741618605;
+-    x[12] = 0.84820658341042721620064832;
+-    x[13] = 0.93727339240070590430775895;
+-    x[14] = 0.98799251802048542848956572;
+-  }
+-  else if ( n == 16 )
+-  {
+-    x[0] = -0.989400934991649932596154173;
+-    x[1] = -0.944575023073232576077988416;
+-    x[2] = -0.865631202387831743880467898;
+-    x[3] = -0.755404408355003033895101195;
+-    x[4] = -0.617876244402643748446671764;
+-    x[5] = -0.458016777657227386342419443;
+-    x[6] = -0.281603550779258913230460501;
+-    x[7] = -0.09501250983763744018531934;
+-    x[8] = 0.09501250983763744018531934;
+-    x[9] = 0.28160355077925891323046050;
+-    x[10] = 0.45801677765722738634241944;
+-    x[11] = 0.61787624440264374844667176;
+-    x[12] = 0.75540440835500303389510119;
+-    x[13] = 0.86563120238783174388046790;
+-    x[14] = 0.94457502307323257607798842;
+-    x[15] = 0.98940093499164993259615417;
+-  }
+-  else if ( n == 17 )
+-  {
+-    x[0] = -0.990575475314417335675434020;
+-    x[1] = -0.950675521768767761222716958;
+-    x[2] = -0.880239153726985902122955694;
+-    x[3] = -0.781514003896801406925230056;
+-    x[4] = -0.657671159216690765850302217;
+-    x[5] = -0.512690537086476967886246569;
+-    x[6] = -0.35123176345387631529718552;
+-    x[7] = -0.17848418149584785585067749;
+-    x[8] = 0.00000000000000000000000000;
+-    x[9] = 0.17848418149584785585067749;
+-    x[10] = 0.35123176345387631529718552;
+-    x[11] = 0.51269053708647696788624657;
+-    x[12] = 0.65767115921669076585030222;
+-    x[13] = 0.78151400389680140692523006;
+-    x[14] = 0.88023915372698590212295569;
+-    x[15] = 0.95067552176876776122271696;
+-    x[16] = 0.99057547531441733567543402;
+-  }
+-  else if ( n == 18 )
+-  {
+-    x[0] = -0.991565168420930946730016005;
+-    x[1] = -0.955823949571397755181195893;
+-    x[2] = -0.892602466497555739206060591;
+-    x[3] = -0.803704958972523115682417455;
+-    x[4] = -0.691687043060353207874891081;
+-    x[5] = -0.55977083107394753460787155;
+-    x[6] = -0.41175116146284264603593179;
+-    x[7] = -0.25188622569150550958897285;
+-    x[8] = -0.08477501304173530124226185;
+-    x[9] = 0.08477501304173530124226185;
+-    x[10] = 0.25188622569150550958897285;
+-    x[11] = 0.41175116146284264603593179;
+-    x[12] = 0.55977083107394753460787155;
+-    x[13] = 0.69168704306035320787489108;
+-    x[14] = 0.80370495897252311568241746;
+-    x[15] = 0.89260246649755573920606059;
+-    x[16] = 0.95582394957139775518119589;
+-    x[17] = 0.99156516842093094673001600;
+-  }
+-  else if ( n == 19 )
+-  {
+-    x[0] = -0.992406843843584403189017670;
+-    x[1] = -0.960208152134830030852778841;
+-    x[2] = -0.903155903614817901642660929;
+-    x[3] = -0.822714656537142824978922487;
+-    x[4] = -0.72096617733522937861709586;
+-    x[5] = -0.60054530466168102346963816;
+-    x[6] = -0.46457074137596094571726715;
+-    x[7] = -0.31656409996362983199011733;
+-    x[8] = -0.16035864564022537586809612;
+-    x[9] = 0.00000000000000000000000000;
+-    x[10] = 0.16035864564022537586809612;
+-    x[11] = 0.31656409996362983199011733;
+-    x[12] = 0.46457074137596094571726715;
+-    x[13] = 0.60054530466168102346963816;
+-    x[14] = 0.72096617733522937861709586;
+-    x[15] = 0.82271465653714282497892249;
+-    x[16] = 0.90315590361481790164266093;
+-    x[17] = 0.96020815213483003085277884;
+-    x[18] = 0.99240684384358440318901767;
+-  }
+-  else if ( n == 20 )
+-  {
+-    x[0] = -0.993128599185094924786122388;
+-    x[1] = -0.963971927277913791267666131;
+-    x[2] = -0.912234428251325905867752441;
+-    x[3] = -0.83911697182221882339452906;
+-    x[4] = -0.74633190646015079261430507;
+-    x[5] = -0.63605368072651502545283670;
+-    x[6] = -0.51086700195082709800436405;
+-    x[7] = -0.37370608871541956067254818;
+-    x[8] = -0.22778585114164507808049620;
+-    x[9] = -0.07652652113349733375464041;
+-    x[10] = 0.07652652113349733375464041;
+-    x[11] = 0.22778585114164507808049620;
+-    x[12] = 0.37370608871541956067254818;
+-    x[13] = 0.51086700195082709800436405;
+-    x[14] = 0.63605368072651502545283670;
+-    x[15] = 0.74633190646015079261430507;
+-    x[16] = 0.83911697182221882339452906;
+-    x[17] = 0.91223442825132590586775244;
+-    x[18] = 0.96397192727791379126766613;
+-    x[19] = 0.99312859918509492478612239;
+-  }
+-  else if ( n == 21 )
+-  {
+-    x[ 0] =  -0.99375217062038950026024204;
+-    x[ 1] =  -0.96722683856630629431662221;
+-    x[ 2] =  -0.92009933415040082879018713;
+-    x[ 3] =  -0.85336336458331728364725064;
+-    x[ 4] =  -0.76843996347567790861587785;
+-    x[ 5] =  -0.66713880419741231930596667;
+-    x[ 6] =  -0.55161883588721980705901880;
+-    x[ 7] =  -0.42434212020743878357366889;
+-    x[ 8] =  -0.28802131680240109660079252;
+-    x[9] =  -0.14556185416089509093703098;
+-    x[10] =   0.00000000000000000000000000;
+-    x[11] =  +0.14556185416089509093703098;
+-    x[12] =  +0.28802131680240109660079252;
+-    x[13] =  +0.42434212020743878357366889;
+-    x[14] =  +0.55161883588721980705901880;
+-    x[15] =  +0.66713880419741231930596667;
+-    x[16] =  +0.76843996347567790861587785;
+-    x[17] =  +0.85336336458331728364725064;
+-    x[18] =  +0.92009933415040082879018713;
+-    x[19] =  +0.96722683856630629431662221;
+-    x[20] =  +0.99375217062038950026024204;
+-  }
+-  else if ( n == 22 )
+-  {
+-    x[0] = -0.99429458548239929207303142;
+-    x[1] = -0.97006049783542872712395099;
+-    x[2] = -0.92695677218717400052069294;
+-    x[3] = -0.86581257772030013653642564;
+-    x[4] = -0.78781680597920816200427796;
+-    x[5] = -0.69448726318668278005068984;
+-    x[6] = -0.58764040350691159295887693;
+-    x[7] = -0.46935583798675702640633071;
+-    x[8] = -0.34193582089208422515814742;
+-    x[9] = -0.20786042668822128547884653;
+-    x[10] = -0.06973927331972222121384180;
+-    x[11] = 0.06973927331972222121384180;
+-    x[12] = 0.20786042668822128547884653;
+-    x[13] = 0.34193582089208422515814742;
+-    x[14] = 0.46935583798675702640633071;
+-    x[15] = 0.58764040350691159295887693;
+-    x[16] = 0.69448726318668278005068984;
+-    x[17] = 0.78781680597920816200427796;
+-    x[18] = 0.86581257772030013653642564;
+-    x[19] = 0.92695677218717400052069294;
+-    x[20] = 0.97006049783542872712395099;
+-    x[21] = 0.99429458548239929207303142;
+-  }
+-  else if ( n == 23 )
+-  {
+-    x[0] = -0.99476933499755212352392572;
+-    x[1] = -0.97254247121811523195602408;
+-    x[2] = -0.93297108682601610234919699;
+-    x[3] = -0.87675235827044166737815689;
+-    x[4] = -0.80488840161883989215111841;
+-    x[5] = -0.71866136313195019446162448;
+-    x[6] = -0.61960987576364615638509731;
+-    x[7] = -0.50950147784600754968979305;
+-    x[8] = -0.39030103803029083142148887;
+-    x[9] = -0.26413568097034493053386954;
+-    x[10] = -0.13325682429846611093174268;
+-    x[11] = 0.00000000000000000000000000;
+-    x[12] = 0.13325682429846611093174268;
+-    x[13] = 0.26413568097034493053386954;
+-    x[14] = 0.39030103803029083142148887;
+-    x[15] = 0.50950147784600754968979305;
+-    x[16] = 0.61960987576364615638509731;
+-    x[17] = 0.71866136313195019446162448;
+-    x[18] = 0.80488840161883989215111841;
+-    x[19] = 0.87675235827044166737815689;
+-    x[20] = 0.93297108682601610234919699;
+-    x[21] = 0.97254247121811523195602408;
+-    x[22] = 0.99476933499755212352392572;
+-  }
+-  else if ( n == 24 )
+-  {
+-    x[0] = -0.99518721999702136017999741;
+-    x[1] = -0.97472855597130949819839199;
+-    x[2] = -0.93827455200273275852364900;
+-    x[3] = -0.88641552700440103421315434;
+-    x[4] = -0.82000198597390292195394987;
+-    x[5] = -0.74012419157855436424382810;
+-    x[6] = -0.64809365193697556925249579;
+-    x[7] = -0.54542147138883953565837562;
+-    x[8] = -0.43379350762604513848708423;
+-    x[9] = -0.31504267969616337438679329;
+-    x[10] = -0.19111886747361630915863982;
+-    x[11] = -0.06405689286260562608504308;
+-    x[12] = 0.06405689286260562608504308;
+-    x[13] = 0.19111886747361630915863982;
+-    x[14] = 0.31504267969616337438679329;
+-    x[15] = 0.43379350762604513848708423;
+-    x[16] = 0.54542147138883953565837562;
+-    x[17] = 0.64809365193697556925249579;
+-    x[18] = 0.74012419157855436424382810;
+-    x[19] = 0.82000198597390292195394987;
+-    x[20] = 0.88641552700440103421315434;
+-    x[21] = 0.93827455200273275852364900;
+-    x[22] = 0.97472855597130949819839199;
+-    x[23] = 0.99518721999702136017999741;
+-  }
+-  else if ( n == 25 )
+-  {
+-    x[0] = -0.99555696979049809790878495;
+-    x[1] = -0.97666392145951751149831539;
+-    x[2] = -0.94297457122897433941401117;
+-    x[3] = -0.89499199787827536885104201;
+-    x[4] = -0.83344262876083400142102111;
+-    x[5] = -0.75925926303735763057728287;
+-    x[6] = -0.67356636847346836448512063;
+-    x[7] = -0.57766293024122296772368984;
+-    x[8] = -0.47300273144571496052218212;
+-    x[9] = -0.36117230580938783773582173;
+-    x[10] = -0.24386688372098843204519036;
+-    x[11] = -0.12286469261071039638735982;
+-    x[12] = 0.00000000000000000000000000;
+-    x[13] = 0.12286469261071039638735982;
+-    x[14] = 0.24386688372098843204519036;
+-    x[15] = 0.36117230580938783773582173;
+-    x[16] = 0.47300273144571496052218212;
+-    x[17] = 0.57766293024122296772368984;
+-    x[18] = 0.67356636847346836448512063;
+-    x[19] = 0.75925926303735763057728287;
+-    x[20] = 0.83344262876083400142102111;
+-    x[21] = 0.89499199787827536885104201;
+-    x[22] = 0.94297457122897433941401117;
+-    x[23] = 0.97666392145951751149831539;
+-    x[24] = 0.99555696979049809790878495;
+-  }
+-  else if ( n == 26 )
+-  {
+-    x[0] = -0.99588570114561692900321696;
+-    x[1] = -0.97838544595647099110058035;
+-    x[2] = -0.94715906666171425013591528;
+-    x[3] = -0.90263786198430707421766560;
+-    x[4] = -0.84544594278849801879750706;
+-    x[5] = -0.77638594882067885619296725;
+-    x[6] = -0.69642726041995726486381391;
+-    x[7] = -0.60669229301761806323197875;
+-    x[8] = -0.50844071482450571769570306;
+-    x[9] = -0.40305175512348630648107738;
+-    x[10] = -0.29200483948595689514283538;
+-    x[11] = -0.17685882035689018396905775;
+-    x[12] = -0.05923009342931320709371858;
+-    x[13] = 0.05923009342931320709371858;
+-    x[14] = 0.17685882035689018396905775;
+-    x[15] = 0.29200483948595689514283538;
+-    x[16] = 0.40305175512348630648107738;
+-    x[17] = 0.50844071482450571769570306;
+-    x[18] = 0.60669229301761806323197875;
+-    x[19] = 0.69642726041995726486381391;
+-    x[20] = 0.77638594882067885619296725;
+-    x[21] = 0.84544594278849801879750706;
+-    x[22] = 0.90263786198430707421766560;
+-    x[23] = 0.94715906666171425013591528;
+-    x[24] = 0.97838544595647099110058035;
+-    x[25] = 0.99588570114561692900321696;
+-  }
+-  else if ( n == 27 )
+-  {
+-    x[0] = -0.99617926288898856693888721;
+-    x[1] = -0.97992347596150122285587336;
+-    x[2] = -0.95090055781470500685190803;
+-    x[3] = -0.90948232067749110430064502;
+-    x[4] = -0.85620790801829449030273722;
+-    x[5] = -0.79177163907050822714439734;
+-    x[6] = -0.71701347373942369929481621;
+-    x[7] = -0.63290797194649514092773464;
+-    x[8] = -0.54055156457945689490030094;
+-    x[9] = -0.44114825175002688058597416;
+-    x[10] = -0.33599390363850889973031903;
+-    x[11] = -0.22645936543953685885723911;
+-    x[12] = -0.11397258560952996693289498;
+-    x[13] = 0.00000000000000000000000000;
+-    x[14] = 0.11397258560952996693289498;
+-    x[15] = 0.22645936543953685885723911;
+-    x[16] = 0.33599390363850889973031903;
+-    x[17] = 0.44114825175002688058597416;
+-    x[18] = 0.54055156457945689490030094;
+-    x[19] = 0.63290797194649514092773464;
+-    x[20] = 0.71701347373942369929481621;
+-    x[21] = 0.79177163907050822714439734;
+-    x[22] = 0.85620790801829449030273722;
+-    x[23] = 0.90948232067749110430064502;
+-    x[24] = 0.95090055781470500685190803;
+-    x[25] = 0.97992347596150122285587336;
+-    x[26] = 0.99617926288898856693888721;
+-  }
+-  else if ( n == 28 )
+-  {
+-    x[0] = -0.99644249757395444995043639;
+-    x[1] = -0.98130316537087275369455995;
+-    x[2] = -0.95425928062893819725410184;
+-    x[3] = -0.91563302639213207386968942;
+-    x[4] = -0.86589252257439504894225457;
+-    x[5] = -0.80564137091717917144788596;
+-    x[6] = -0.73561087801363177202814451;
+-    x[7] = -0.65665109403886496121989818;
+-    x[8] = -0.56972047181140171930800328;
+-    x[9] = -0.47587422495511826103441185;
+-    x[10] = -0.37625151608907871022135721;
+-    x[11] = -0.27206162763517807767682636;
+-    x[12] = -0.16456928213338077128147178;
+-    x[13] = -0.05507928988403427042651653;
+-    x[14] = 0.05507928988403427042651653;
+-    x[15] = 0.16456928213338077128147178;
+-    x[16] = 0.27206162763517807767682636;
+-    x[17] = 0.37625151608907871022135721;
+-    x[18] = 0.47587422495511826103441185;
+-    x[19] = 0.56972047181140171930800328;
+-    x[20] = 0.65665109403886496121989818;
+-    x[21] = 0.73561087801363177202814451;
+-    x[22] = 0.80564137091717917144788596;
+-    x[23] = 0.86589252257439504894225457;
+-    x[24] = 0.91563302639213207386968942;
+-    x[25] = 0.95425928062893819725410184;
+-    x[26] = 0.98130316537087275369455995;
+-    x[27] = 0.99644249757395444995043639;
+-  }
+-  else if ( n == 29 )
+-  {
+-    x[0] = -0.99667944226059658616319153;
+-    x[1] = -0.98254550526141317487092602;
+-    x[2] = -0.95728559577808772579820804;
+-    x[3] = -0.92118023295305878509375344;
+-    x[4] = -0.87463780492010279041779342;
+-    x[5] = -0.81818548761525244498957221;
+-    x[6] = -0.75246285173447713391261008;
+-    x[7] = -0.67821453760268651515618501;
+-    x[8] = -0.59628179713822782037958621;
+-    x[9] = -0.50759295512422764210262792;
+-    x[10] = -0.41315288817400866389070659;
+-    x[11] = -0.31403163786763993494819592;
+-    x[12] = -0.21135228616600107450637573;
+-    x[13] = -0.10627823013267923017098239;
+-    x[14] = 0.00000000000000000000000000;
+-    x[15] = 0.10627823013267923017098239;
+-    x[16] = 0.21135228616600107450637573;
+-    x[17] = 0.31403163786763993494819592;
+-    x[18] = 0.41315288817400866389070659;
+-    x[19] = 0.50759295512422764210262792;
+-    x[20] = 0.59628179713822782037958621;
+-    x[21] = 0.67821453760268651515618501;
+-    x[22] = 0.75246285173447713391261008;
+-    x[23] = 0.81818548761525244498957221;
+-    x[24] = 0.87463780492010279041779342;
+-    x[25] = 0.92118023295305878509375344;
+-    x[26] = 0.95728559577808772579820804;
+-    x[27] = 0.98254550526141317487092602;
+-    x[28] = 0.99667944226059658616319153;
+-  }
+-  else if ( n == 30 )
+-  {
+-    x[0] = -0.99689348407464954027163005;
+-    x[1] = -0.98366812327974720997003258;
+-    x[2] = -0.96002186496830751221687103;
+-    x[3] = -0.92620004742927432587932428;
+-    x[4] = -0.88256053579205268154311646;
+-    x[5] = -0.82956576238276839744289812;
+-    x[6] = -0.76777743210482619491797734;
+-    x[7] = -0.69785049479331579693229239;
+-    x[8] = -0.62052618298924286114047756;
+-    x[9] = -0.53662414814201989926416979;
+-    x[10] = -0.44703376953808917678060990;
+-    x[11] = -0.35270472553087811347103721;
+-    x[12] = -0.25463692616788984643980513;
+-    x[13] = -0.15386991360858354696379467;
+-    x[14] = -0.05147184255531769583302521;
+-    x[15] = 0.05147184255531769583302521;
+-    x[16] = 0.15386991360858354696379467;
+-    x[17] = 0.25463692616788984643980513;
+-    x[18] = 0.35270472553087811347103721;
+-    x[19] = 0.44703376953808917678060990;
+-    x[20] = 0.53662414814201989926416979;
+-    x[21] = 0.62052618298924286114047756;
+-    x[22] = 0.69785049479331579693229239;
+-    x[23] = 0.76777743210482619491797734;
+-    x[24] = 0.82956576238276839744289812;
+-    x[25] = 0.88256053579205268154311646;
+-    x[26] = 0.92620004742927432587932428;
+-    x[27] = 0.96002186496830751221687103;
+-    x[28] = 0.98366812327974720997003258;
+-    x[29] = 0.99689348407464954027163005;
+-  }
+-  else if ( n == 31 )
+-  {
+-    x[0] = -0.99708748181947707405562655;
+-    x[1] = -0.98468590966515248400246517;
+-    x[2] = -0.96250392509294966178905240;
+-    x[3] = -0.93075699789664816495694576;
+-    x[4] = -0.88976002994827104337419201;
+-    x[5] = -0.83992032014626734008690454;
+-    x[6] = -0.78173314841662494040636002;
+-    x[7] = -0.71577678458685328390597087;
+-    x[8] = -0.64270672292426034618441820;
+-    x[9] = -0.56324916140714926272094492;
+-    x[10] = -0.47819378204490248044059404;
+-    x[11] = -0.38838590160823294306135146;
+-    x[12] = -0.29471806998170161661790390;
+-    x[13] = -0.19812119933557062877241300;
+-    x[14] = -0.09955531215234152032517479;
+-    x[15] = 0.00000000000000000000000000;
+-    x[16] = 0.09955531215234152032517479;
+-    x[17] = 0.19812119933557062877241300;
+-    x[18] = 0.29471806998170161661790390;
+-    x[19] = 0.38838590160823294306135146;
+-    x[20] = 0.47819378204490248044059404;
+-    x[21] = 0.56324916140714926272094492;
+-    x[22] = 0.64270672292426034618441820;
+-    x[23] = 0.71577678458685328390597087;
+-    x[24] = 0.78173314841662494040636002;
+-    x[25] = 0.83992032014626734008690454;
+-    x[26] = 0.88976002994827104337419201;
+-    x[27] = 0.93075699789664816495694576;
+-    x[28] = 0.96250392509294966178905240;
+-    x[29] = 0.98468590966515248400246517;
+-    x[30] = 0.99708748181947707405562655;
+-  }
+-  else if ( n == 32 )
+-  {
+-    x[0] = -0.99726386184948156354498113;
+-    x[1] = -0.98561151154526833540017504;
+-    x[2] = -0.96476225558750643077381193;
+-    x[3] = -0.93490607593773968917091913;
+-    x[4] = -0.89632115576605212396530724;
+-    x[5] = -0.84936761373256997013369300;
+-    x[6] = -0.79448379596794240696309730;
+-    x[7] = -0.73218211874028968038742667;
+-    x[8] = -0.66304426693021520097511517;
+-    x[9] = -0.58771575724076232904074548;
+-    x[10] = -0.50689990893222939002374747;
+-    x[11] = -0.42135127613063534536411944;
+-    x[12] = -0.33186860228212764977991681;
+-    x[13] = -0.23928736225213707454460321;
+-    x[14] = -0.14447196158279649348518637;
+-    x[15] = -0.04830766568773831623481257;
+-    x[16] = 0.04830766568773831623481257;
+-    x[17] = 0.14447196158279649348518637;
+-    x[18] = 0.23928736225213707454460321;
+-    x[19] = 0.33186860228212764977991681;
+-    x[20] = 0.42135127613063534536411944;
+-    x[21] = 0.50689990893222939002374747;
+-    x[22] = 0.58771575724076232904074548;
+-    x[23] = 0.66304426693021520097511517;
+-    x[24] = 0.73218211874028968038742667;
+-    x[25] = 0.79448379596794240696309730;
+-    x[26] = 0.84936761373256997013369300;
+-    x[27] = 0.89632115576605212396530724;
+-    x[28] = 0.93490607593773968917091913;
+-    x[29] = 0.96476225558750643077381193;
+-    x[30] = 0.98561151154526833540017504;
+-    x[31] = 0.99726386184948156354498113;
+-  }
+-  else if ( n == 33 )
+-  {
+-    x[0] = -0.99742469424645521726616802;
+-    x[1] = -0.98645572623064248811037570;
+-    x[2] = -0.96682290968999276892837771;
+-    x[3] = -0.93869437261116835035583512;
+-    x[4] = -0.90231676774343358304053133;
+-    x[5] = -0.85800965267650406464306148;
+-    x[6] = -0.80616235627416658979620087;
+-    x[7] = -0.74723049644956215785905512;
+-    x[8] = -0.68173195996974278626821595;
+-    x[9] = -0.61024234583637902730728751;
+-    x[10] = -0.53338990478634764354889426;
+-    x[11] = -0.45185001727245069572599328;
+-    x[12] = -0.36633925774807334107022062;
+-    x[13] = -0.27760909715249702940324807;
+-    x[14] = -0.18643929882799157233579876;
+-    x[15] = -0.09363106585473338567074292;
+-    x[16] = 0.00000000000000000000000000;
+-    x[17] = 0.09363106585473338567074292;
+-    x[18] = 0.18643929882799157233579876;
+-    x[19] = 0.27760909715249702940324807;
+-    x[20] = 0.36633925774807334107022062;
+-    x[21] = 0.45185001727245069572599328;
+-    x[22] = 0.53338990478634764354889426;
+-    x[23] = 0.61024234583637902730728751;
+-    x[24] = 0.68173195996974278626821595;
+-    x[25] = 0.74723049644956215785905512;
+-    x[26] = 0.80616235627416658979620087;
+-    x[27] = 0.85800965267650406464306148;
+-    x[28] = 0.90231676774343358304053133;
+-    x[29] = 0.93869437261116835035583512;
+-    x[30] = 0.96682290968999276892837771;
+-    x[31] = 0.98645572623064248811037570;
+-    x[32] = 0.99742469424645521726616802;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEGENDRE_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::cerr << "  Legal values are 1 through 33.\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void legendre_lookup_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_LOOKUP_WEIGHTS looks up weights for Gauss-Legendre quadrature.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Vladimir Krylov,
+-//    Approximate Calculation of Integrals,
+-//    Dover, 2006,
+-//    ISBN: 0486445798.
+-//    LC: QA311.K713.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//    Stephen Wolfram,
+-//    The Mathematica Book,
+-//    Fourth Edition,
+-//    Cambridge University Press, 1999,
+-//    ISBN: 0-521-64314-7,
+-//    LC: QA76.95.W65.
+-//
+-//    Daniel Zwillinger, editor,
+-//    CRC Standard Mathematical Tables and Formulae,
+-//    30th Edition,
+-//    CRC Press, 1996,
+-//    ISBN: 0-8493-2479-3,
+-//    LC: QA47.M315.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    N must be between 1 and 33.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  if ( n == 1 )
+-  {
+-    w[0] = 2.000000000000000000000000000000;
+-  }
+-  else if ( n == 2 )
+-  {
+-    w[0] = 1.000000000000000000000000000000;
+-    w[1] = 1.000000000000000000000000000000;
+-  }
+-  else if ( n == 3 )
+-  {
+-    w[0] = 0.555555555555555555555555555556;
+-    w[1] = 0.888888888888888888888888888889;
+-    w[2] = 0.555555555555555555555555555556;
+-  }
+-  else if ( n == 4 )
+-  {
+-    w[0] = 0.347854845137453857373063949222;
+-    w[1] = 0.652145154862546142626936050778;
+-    w[2] = 0.652145154862546142626936050778;
+-    w[3] = 0.347854845137453857373063949222;
+-  }
+-  else if ( n == 5 )
+-  {
+-    w[0] = 0.236926885056189087514264040720;
+-    w[1] = 0.478628670499366468041291514836;
+-    w[2] = 0.568888888888888888888888888889;
+-    w[3] = 0.478628670499366468041291514836;
+-    w[4] = 0.236926885056189087514264040720;
+-  }
+-  else if ( n == 6 )
+-  {
+-    w[0] = 0.171324492379170345040296142173;
+-    w[1] = 0.360761573048138607569833513838;
+-    w[2] = 0.467913934572691047389870343990;
+-    w[3] = 0.467913934572691047389870343990;
+-    w[4] = 0.360761573048138607569833513838;
+-    w[5] = 0.171324492379170345040296142173;
+-  }
+-  else if ( n == 7 )
+-  {
+-    w[0] = 0.129484966168869693270611432679;
+-    w[1] = 0.279705391489276667901467771424;
+-    w[2] = 0.381830050505118944950369775489;
+-    w[3] = 0.417959183673469387755102040816;
+-    w[4] = 0.381830050505118944950369775489;
+-    w[5] = 0.279705391489276667901467771424;
+-    w[6] = 0.129484966168869693270611432679;
+-  }
+-  else if ( n == 8 )
+-  {
+-    w[0] = 0.101228536290376259152531354310;
+-    w[1] = 0.222381034453374470544355994426;
+-    w[2] = 0.313706645877887287337962201987;
+-    w[3] = 0.362683783378361982965150449277;
+-    w[4] = 0.362683783378361982965150449277;
+-    w[5] = 0.313706645877887287337962201987;
+-    w[6] = 0.222381034453374470544355994426;
+-    w[7] = 0.101228536290376259152531354310;
+-  }
+-  else if ( n == 9 )
+-  {
+-    w[0] = 0.081274388361574411971892158111;
+-    w[1] = 0.18064816069485740405847203124;
+-    w[2] = 0.26061069640293546231874286942;
+-    w[3] = 0.31234707704000284006863040658;
+-    w[4] = 0.33023935500125976316452506929;
+-    w[5] = 0.31234707704000284006863040658;
+-    w[6] = 0.26061069640293546231874286942;
+-    w[7] = 0.18064816069485740405847203124;
+-    w[8] = 0.081274388361574411971892158111;
+-  }
+-  else if ( n == 10 )
+-  {
+-    w[0] = 0.066671344308688137593568809893;
+-    w[1] = 0.14945134915058059314577633966;
+-    w[2] = 0.21908636251598204399553493423;
+-    w[3] = 0.26926671930999635509122692157;
+-    w[4] = 0.29552422471475287017389299465;
+-    w[5] = 0.29552422471475287017389299465;
+-    w[6] = 0.26926671930999635509122692157;
+-    w[7] = 0.21908636251598204399553493423;
+-    w[8] = 0.14945134915058059314577633966;
+-    w[9] = 0.066671344308688137593568809893;
+-  }
+-  else if ( n == 11 )
+-  {
+-    w[0] = 0.055668567116173666482753720443;
+-    w[1] = 0.12558036946490462463469429922;
+-    w[2] = 0.18629021092773425142609764143;
+-    w[3] = 0.23319376459199047991852370484;
+-    w[4] = 0.26280454451024666218068886989;
+-    w[5] = 0.27292508677790063071448352834;
+-    w[6] = 0.26280454451024666218068886989;
+-    w[7] = 0.23319376459199047991852370484;
+-    w[8] = 0.18629021092773425142609764143;
+-    w[9] = 0.12558036946490462463469429922;
+-    w[10] = 0.055668567116173666482753720443;
+-  }
+-  else if ( n == 12 )
+-  {
+-    w[0] = 0.047175336386511827194615961485;
+-    w[1] = 0.10693932599531843096025471819;
+-    w[2] = 0.16007832854334622633465252954;
+-    w[3] = 0.20316742672306592174906445581;
+-    w[4] = 0.23349253653835480876084989892;
+-    w[5] = 0.24914704581340278500056243604;
+-    w[6] = 0.24914704581340278500056243604;
+-    w[7] = 0.23349253653835480876084989892;
+-    w[8] = 0.20316742672306592174906445581;
+-    w[9] = 0.16007832854334622633465252954;
+-    w[10] = 0.10693932599531843096025471819;
+-    w[11] = 0.047175336386511827194615961485;
+-  }
+-  else if ( n == 13 )
+-  {
+-    w[0] = 0.040484004765315879520021592201;
+-    w[1] = 0.092121499837728447914421775954;
+-    w[2] = 0.13887351021978723846360177687;
+-    w[3] = 0.17814598076194573828004669200;
+-    w[4] = 0.20781604753688850231252321931;
+-    w[5] = 0.22628318026289723841209018604;
+-    w[6] = 0.23255155323087391019458951527;
+-    w[7] = 0.22628318026289723841209018604;
+-    w[8] = 0.20781604753688850231252321931;
+-    w[9] = 0.17814598076194573828004669200;
+-    w[10] = 0.13887351021978723846360177687;
+-    w[11] = 0.092121499837728447914421775954;
+-    w[12] = 0.040484004765315879520021592201;
+-  }
+-  else if ( n == 14 )
+-  {
+-    w[0] = 0.035119460331751863031832876138;
+-    w[1] = 0.08015808715976020980563327706;
+-    w[2] = 0.12151857068790318468941480907;
+-    w[3] = 0.15720316715819353456960193862;
+-    w[4] = 0.18553839747793781374171659013;
+-    w[5] = 0.20519846372129560396592406566;
+-    w[6] = 0.21526385346315779019587644332;
+-    w[7] = 0.21526385346315779019587644332;
+-    w[8] = 0.20519846372129560396592406566;
+-    w[9] = 0.18553839747793781374171659013;
+-    w[10] = 0.15720316715819353456960193862;
+-    w[11] = 0.12151857068790318468941480907;
+-    w[12] = 0.08015808715976020980563327706;
+-    w[13] = 0.035119460331751863031832876138;
+-  }
+-  else if ( n == 15 )
+-  {
+-    w[0] = 0.030753241996117268354628393577;
+-    w[1] = 0.070366047488108124709267416451;
+-    w[2] = 0.107159220467171935011869546686;
+-    w[3] = 0.13957067792615431444780479451;
+-    w[4] = 0.16626920581699393355320086048;
+-    w[5] = 0.18616100001556221102680056187;
+-    w[6] = 0.19843148532711157645611832644;
+-    w[7] = 0.20257824192556127288062019997;
+-    w[8] = 0.19843148532711157645611832644;
+-    w[9] = 0.18616100001556221102680056187;
+-    w[10] = 0.16626920581699393355320086048;
+-    w[11] = 0.13957067792615431444780479451;
+-    w[12] = 0.107159220467171935011869546686;
+-    w[13] = 0.070366047488108124709267416451;
+-    w[14] = 0.030753241996117268354628393577;
+-  }
+-  else if ( n == 16 )
+-  {
+-    w[0] = 0.027152459411754094851780572456;
+-    w[1] = 0.062253523938647892862843836994;
+-    w[2] = 0.09515851168249278480992510760;
+-    w[3] = 0.12462897125553387205247628219;
+-    w[4] = 0.14959598881657673208150173055;
+-    w[5] = 0.16915651939500253818931207903;
+-    w[6] = 0.18260341504492358886676366797;
+-    w[7] = 0.18945061045506849628539672321;
+-    w[8] = 0.18945061045506849628539672321;
+-    w[9] = 0.18260341504492358886676366797;
+-    w[10] = 0.16915651939500253818931207903;
+-    w[11] = 0.14959598881657673208150173055;
+-    w[12] = 0.12462897125553387205247628219;
+-    w[13] = 0.09515851168249278480992510760;
+-    w[14] = 0.062253523938647892862843836994;
+-    w[15] = 0.027152459411754094851780572456;
+-  }
+-  else if ( n == 17 )
+-  {
+-    w[0] = 0.024148302868547931960110026288;
+-    w[1] = 0.055459529373987201129440165359;
+-    w[2] = 0.085036148317179180883535370191;
+-    w[3] = 0.111883847193403971094788385626;
+-    w[4] = 0.13513636846852547328631998170;
+-    w[5] = 0.15404576107681028808143159480;
+-    w[6] = 0.16800410215645004450997066379;
+-    w[7] = 0.17656270536699264632527099011;
+-    w[8] = 0.17944647035620652545826564426;
+-    w[9] = 0.17656270536699264632527099011;
+-    w[10] = 0.16800410215645004450997066379;
+-    w[11] = 0.15404576107681028808143159480;
+-    w[12] = 0.13513636846852547328631998170;
+-    w[13] = 0.111883847193403971094788385626;
+-    w[14] = 0.085036148317179180883535370191;
+-    w[15] = 0.055459529373987201129440165359;
+-    w[16] = 0.024148302868547931960110026288;
+-  }
+-  else if ( n == 18 )
+-  {
+-    w[0] = 0.021616013526483310313342710266;
+-    w[1] = 0.049714548894969796453334946203;
+-    w[2] = 0.07642573025488905652912967762;
+-    w[3] = 0.10094204410628716556281398492;
+-    w[4] = 0.12255520671147846018451912680;
+-    w[5] = 0.14064291467065065120473130375;
+-    w[6] = 0.15468467512626524492541800384;
+-    w[7] = 0.16427648374583272298605377647;
+-    w[8] = 0.16914238296314359184065647013;
+-    w[9] = 0.16914238296314359184065647013;
+-    w[10] = 0.16427648374583272298605377647;
+-    w[11] = 0.15468467512626524492541800384;
+-    w[12] = 0.14064291467065065120473130375;
+-    w[13] = 0.12255520671147846018451912680;
+-    w[14] = 0.10094204410628716556281398492;
+-    w[15] = 0.07642573025488905652912967762;
+-    w[16] = 0.049714548894969796453334946203;
+-    w[17] = 0.021616013526483310313342710266;
+-  }
+-  else if ( n == 19 )
+-  {
+-    w[0] = 0.019461788229726477036312041464;
+-    w[1] = 0.044814226765699600332838157402;
+-    w[2] = 0.069044542737641226580708258006;
+-    w[3] = 0.091490021622449999464462094124;
+-    w[4] = 0.111566645547333994716023901682;
+-    w[5] = 0.12875396253933622767551578486;
+-    w[6] = 0.14260670217360661177574610944;
+-    w[7] = 0.15276604206585966677885540090;
+-    w[8] = 0.15896884339395434764995643946;
+-    w[9] = 0.16105444984878369597916362532;
+-    w[10] = 0.15896884339395434764995643946;
+-    w[11] = 0.15276604206585966677885540090;
+-    w[12] = 0.14260670217360661177574610944;
+-    w[13] = 0.12875396253933622767551578486;
+-    w[14] = 0.111566645547333994716023901682;
+-    w[15] = 0.091490021622449999464462094124;
+-    w[16] = 0.069044542737641226580708258006;
+-    w[17] = 0.044814226765699600332838157402;
+-    w[18] = 0.019461788229726477036312041464;
+-  }
+-  else if ( n == 20 )
+-  {
+-    w[0] = 0.017614007139152118311861962352;
+-    w[1] = 0.040601429800386941331039952275;
+-    w[2] = 0.062672048334109063569506535187;
+-    w[3] = 0.08327674157670474872475814322;
+-    w[4] = 0.10193011981724043503675013548;
+-    w[5] = 0.11819453196151841731237737771;
+-    w[6] = 0.13168863844917662689849449975;
+-    w[7] = 0.14209610931838205132929832507;
+-    w[8] = 0.14917298647260374678782873700;
+-    w[9] = 0.15275338713072585069808433195;
+-    w[10] = 0.15275338713072585069808433195;
+-    w[11] = 0.14917298647260374678782873700;
+-    w[12] = 0.14209610931838205132929832507;
+-    w[13] = 0.13168863844917662689849449975;
+-    w[14] = 0.11819453196151841731237737771;
+-    w[15] = 0.10193011981724043503675013548;
+-    w[16] = 0.08327674157670474872475814322;
+-    w[17] = 0.062672048334109063569506535187;
+-    w[18] = 0.040601429800386941331039952275;
+-    w[19] = 0.017614007139152118311861962352;
+-  }
+-  else if ( n == 21 )
+-  {
+-    w[ 0] =   0.016017228257774333324224616858;
+-    w[ 1] =   0.036953789770852493799950668299;
+-    w[ 2] =   0.057134425426857208283635826472;
+-    w[ 3] =   0.076100113628379302017051653300;
+-    w[ 4] =   0.093444423456033861553289741114;
+-    w[ 5] =   0.108797299167148377663474578070;
+-    w[ 6] =   0.12183141605372853419536717713;
+-    w[ 7] =   0.13226893863333746178105257450;
+-    w[ 8] =   0.13988739479107315472213342387;
+-    w[9] =   0.14452440398997005906382716655;
+-    w[10] =   0.14608113364969042719198514768;
+-    w[11] =   0.14452440398997005906382716655;
+-    w[12] =   0.13988739479107315472213342387;
+-    w[13] =   0.13226893863333746178105257450;
+-    w[14] =   0.12183141605372853419536717713;
+-    w[15] =   0.108797299167148377663474578070;
+-    w[16] =   0.093444423456033861553289741114;
+-    w[17] =   0.076100113628379302017051653300;
+-    w[18] =   0.057134425426857208283635826472;
+-    w[19] =   0.036953789770852493799950668299;
+-    w[20] =   0.016017228257774333324224616858;
+-  }
+-  else if ( n == 22 )
+-  {
+-    w[0] = 0.014627995298272200684991098047;
+-    w[1] = 0.033774901584814154793302246866;
+-    w[2] = 0.052293335152683285940312051273;
+-    w[3] = 0.06979646842452048809496141893;
+-    w[4] = 0.08594160621706772741444368137;
+-    w[5] = 0.10041414444288096493207883783;
+-    w[6] = 0.11293229608053921839340060742;
+-    w[7] = 0.12325237681051242428556098615;
+-    w[8] = 0.13117350478706237073296499253;
+-    w[9] = 0.13654149834601517135257383123;
+-    w[10] = 0.13925187285563199337541024834;
+-    w[11] = 0.13925187285563199337541024834;
+-    w[12] = 0.13654149834601517135257383123;
+-    w[13] = 0.13117350478706237073296499253;
+-    w[14] = 0.12325237681051242428556098615;
+-    w[15] = 0.11293229608053921839340060742;
+-    w[16] = 0.10041414444288096493207883783;
+-    w[17] = 0.08594160621706772741444368137;
+-    w[18] = 0.06979646842452048809496141893;
+-    w[19] = 0.052293335152683285940312051273;
+-    w[20] = 0.033774901584814154793302246866;
+-    w[21] = 0.014627995298272200684991098047;
+-  }
+-  else if ( n == 23 )
+-  {
+-    w[0] = 0.013411859487141772081309493459;
+-    w[1] = 0.030988005856979444310694219642;
+-    w[2] = 0.048037671731084668571641071632;
+-    w[3] = 0.064232421408525852127169615159;
+-    w[4] = 0.079281411776718954922892524742;
+-    w[5] = 0.092915766060035147477018617370;
+-    w[6] = 0.104892091464541410074086185015;
+-    w[7] = 0.11499664022241136494164351293;
+-    w[8] = 0.12304908430672953046757840067;
+-    w[9] = 0.12890572218808214997859533940;
+-    w[10] = 0.13246203940469661737164246470;
+-    w[11] = 0.13365457218610617535145711055;
+-    w[12] = 0.13246203940469661737164246470;
+-    w[13] = 0.12890572218808214997859533940;
+-    w[14] = 0.12304908430672953046757840067;
+-    w[15] = 0.11499664022241136494164351293;
+-    w[16] = 0.104892091464541410074086185015;
+-    w[17] = 0.092915766060035147477018617370;
+-    w[18] = 0.079281411776718954922892524742;
+-    w[19] = 0.064232421408525852127169615159;
+-    w[20] = 0.048037671731084668571641071632;
+-    w[21] = 0.030988005856979444310694219642;
+-    w[22] = 0.013411859487141772081309493459;
+-  }
+-  else if ( n == 24 )
+-  {
+-    w[0] = 0.012341229799987199546805667070;
+-    w[1] = 0.028531388628933663181307815952;
+-    w[2] = 0.044277438817419806168602748211;
+-    w[3] = 0.059298584915436780746367758500;
+-    w[4] = 0.07334648141108030573403361525;
+-    w[5] = 0.08619016153195327591718520298;
+-    w[6] = 0.09761865210411388826988066446;
+-    w[7] = 0.10744427011596563478257734245;
+-    w[8] = 0.11550566805372560135334448391;
+-    w[9] = 0.12167047292780339120446315348;
+-    w[10] = 0.12583745634682829612137538251;
+-    w[11] = 0.12793819534675215697405616522;
+-    w[12] = 0.12793819534675215697405616522;
+-    w[13] = 0.12583745634682829612137538251;
+-    w[14] = 0.12167047292780339120446315348;
+-    w[15] = 0.11550566805372560135334448391;
+-    w[16] = 0.10744427011596563478257734245;
+-    w[17] = 0.09761865210411388826988066446;
+-    w[18] = 0.08619016153195327591718520298;
+-    w[19] = 0.07334648141108030573403361525;
+-    w[20] = 0.059298584915436780746367758500;
+-    w[21] = 0.044277438817419806168602748211;
+-    w[22] = 0.028531388628933663181307815952;
+-    w[23] = 0.012341229799987199546805667070;
+-  }
+-  else if ( n == 25 )
+-  {
+-    w[0] = 0.0113937985010262879479029641132;
+-    w[1] = 0.026354986615032137261901815295;
+-    w[2] = 0.040939156701306312655623487712;
+-    w[3] = 0.054904695975835191925936891541;
+-    w[4] = 0.068038333812356917207187185657;
+-    w[5] = 0.080140700335001018013234959669;
+-    w[6] = 0.091028261982963649811497220703;
+-    w[7] = 0.100535949067050644202206890393;
+-    w[8] = 0.108519624474263653116093957050;
+-    w[9] = 0.11485825914571164833932554587;
+-    w[10] = 0.11945576353578477222817812651;
+-    w[11] = 0.12224244299031004168895951895;
+-    w[12] = 0.12317605372671545120390287308;
+-    w[13] = 0.12224244299031004168895951895;
+-    w[14] = 0.11945576353578477222817812651;
+-    w[15] = 0.11485825914571164833932554587;
+-    w[16] = 0.108519624474263653116093957050;
+-    w[17] = 0.100535949067050644202206890393;
+-    w[18] = 0.091028261982963649811497220703;
+-    w[19] = 0.080140700335001018013234959669;
+-    w[20] = 0.068038333812356917207187185657;
+-    w[21] = 0.054904695975835191925936891541;
+-    w[22] = 0.040939156701306312655623487712;
+-    w[23] = 0.026354986615032137261901815295;
+-    w[24] = 0.0113937985010262879479029641132;
+-  }
+-  else if ( n == 26 )
+-  {
+-    w[0] = 0.010551372617343007155651187685;
+-    w[1] = 0.024417851092631908789615827520;
+-    w[2] = 0.037962383294362763950303141249;
+-    w[3] = 0.050975825297147811998319900724;
+-    w[4] = 0.063274046329574835539453689907;
+-    w[5] = 0.07468414976565974588707579610;
+-    w[6] = 0.08504589431348523921044776508;
+-    w[7] = 0.09421380035591414846366488307;
+-    w[8] = 0.10205916109442542323841407025;
+-    w[9] = 0.10847184052857659065657942673;
+-    w[10] = 0.11336181654631966654944071844;
+-    w[11] = 0.11666044348529658204466250754;
+-    w[12] = 0.11832141527926227651637108570;
+-    w[13] = 0.11832141527926227651637108570;
+-    w[14] = 0.11666044348529658204466250754;
+-    w[15] = 0.11336181654631966654944071844;
+-    w[16] = 0.10847184052857659065657942673;
+-    w[17] = 0.10205916109442542323841407025;
+-    w[18] = 0.09421380035591414846366488307;
+-    w[19] = 0.08504589431348523921044776508;
+-    w[20] = 0.07468414976565974588707579610;
+-    w[21] = 0.063274046329574835539453689907;
+-    w[22] = 0.050975825297147811998319900724;
+-    w[23] = 0.037962383294362763950303141249;
+-    w[24] = 0.024417851092631908789615827520;
+-    w[25] = 0.010551372617343007155651187685;
+-  }
+-  else if ( n == 27 )
+-  {
+-    w[0] = 0.0097989960512943602611500550912;
+-    w[1] = 0.022686231596180623196034206447;
+-    w[2] = 0.035297053757419711022578289305;
+-    w[3] = 0.047449412520615062704096710114;
+-    w[4] = 0.058983536859833599110300833720;
+-    w[5] = 0.069748823766245592984322888357;
+-    w[6] = 0.079604867773057771263074959010;
+-    w[7] = 0.088423158543756950194322802854;
+-    w[8] = 0.096088727370028507565652646558;
+-    w[9] = 0.102501637817745798671247711533;
+-    w[10] = 0.107578285788533187212162984427;
+-    w[11] = 0.111252488356845192672163096043;
+-    w[12] = 0.113476346108965148620369948092;
+-    w[13] = 0.11422086737895698904504573690;
+-    w[14] = 0.113476346108965148620369948092;
+-    w[15] = 0.111252488356845192672163096043;
+-    w[16] = 0.107578285788533187212162984427;
+-    w[17] = 0.102501637817745798671247711533;
+-    w[18] = 0.096088727370028507565652646558;
+-    w[19] = 0.088423158543756950194322802854;
+-    w[20] = 0.079604867773057771263074959010;
+-    w[21] = 0.069748823766245592984322888357;
+-    w[22] = 0.058983536859833599110300833720;
+-    w[23] = 0.047449412520615062704096710114;
+-    w[24] = 0.035297053757419711022578289305;
+-    w[25] = 0.022686231596180623196034206447;
+-    w[26] = 0.0097989960512943602611500550912;
+-  }
+-  else if ( n == 28 )
+-  {
+-    w[0] = 0.009124282593094517738816153923;
+-    w[1] = 0.021132112592771259751500380993;
+-    w[2] = 0.032901427782304379977630819171;
+-    w[3] = 0.044272934759004227839587877653;
+-    w[4] = 0.055107345675716745431482918227;
+-    w[5] = 0.06527292396699959579339756678;
+-    w[6] = 0.07464621423456877902393188717;
+-    w[7] = 0.08311341722890121839039649824;
+-    w[8] = 0.09057174439303284094218603134;
+-    w[9] = 0.09693065799792991585048900610;
+-    w[10] = 0.10211296757806076981421663851;
+-    w[11] = 0.10605576592284641791041643700;
+-    w[12] = 0.10871119225829413525357151930;
+-    w[13] = 0.11004701301647519628237626560;
+-    w[14] = 0.11004701301647519628237626560;
+-    w[15] = 0.10871119225829413525357151930;
+-    w[16] = 0.10605576592284641791041643700;
+-    w[17] = 0.10211296757806076981421663851;
+-    w[18] = 0.09693065799792991585048900610;
+-    w[19] = 0.09057174439303284094218603134;
+-    w[20] = 0.08311341722890121839039649824;
+-    w[21] = 0.07464621423456877902393188717;
+-    w[22] = 0.06527292396699959579339756678;
+-    w[23] = 0.055107345675716745431482918227;
+-    w[24] = 0.044272934759004227839587877653;
+-    w[25] = 0.032901427782304379977630819171;
+-    w[26] = 0.021132112592771259751500380993;
+-    w[27] = 0.009124282593094517738816153923;
+-  }
+-  else if ( n == 29 )
+-  {
+-    w[0] = 0.0085169038787464096542638133022;
+-    w[1] = 0.019732085056122705983859801640;
+-    w[2] = 0.030740492202093622644408525375;
+-    w[3] = 0.041402062518682836104830010114;
+-    w[4] = 0.051594826902497923912594381180;
+-    w[5] = 0.061203090657079138542109848024;
+-    w[6] = 0.070117933255051278569581486949;
+-    w[7] = 0.078238327135763783828144888660;
+-    w[8] = 0.085472257366172527545344849297;
+-    w[9] = 0.091737757139258763347966411077;
+-    w[10] = 0.096963834094408606301900074883;
+-    w[11] = 0.101091273759914966121820546907;
+-    w[12] = 0.104073310077729373913328471285;
+-    w[13] = 0.105876155097320941406591327852;
+-    w[14] = 0.10647938171831424424651112691;
+-    w[15] = 0.105876155097320941406591327852;
+-    w[16] = 0.104073310077729373913328471285;
+-    w[17] = 0.101091273759914966121820546907;
+-    w[18] = 0.096963834094408606301900074883;
+-    w[19] = 0.091737757139258763347966411077;
+-    w[20] = 0.085472257366172527545344849297;
+-    w[21] = 0.078238327135763783828144888660;
+-    w[22] = 0.070117933255051278569581486949;
+-    w[23] = 0.061203090657079138542109848024;
+-    w[24] = 0.051594826902497923912594381180;
+-    w[25] = 0.041402062518682836104830010114;
+-    w[26] = 0.030740492202093622644408525375;
+-    w[27] = 0.019732085056122705983859801640;
+-    w[28] = 0.0085169038787464096542638133022;
+-  }
+-  else if ( n == 30 )
+-  {
+-    w[0] = 0.007968192496166605615465883475;
+-    w[1] = 0.018466468311090959142302131912;
+-    w[2] = 0.028784707883323369349719179611;
+-    w[3] = 0.038799192569627049596801936446;
+-    w[4] = 0.048402672830594052902938140423;
+-    w[5] = 0.057493156217619066481721689402;
+-    w[6] = 0.06597422988218049512812851512;
+-    w[7] = 0.07375597473770520626824385002;
+-    w[8] = 0.08075589522942021535469493846;
+-    w[9] = 0.08689978720108297980238753072;
+-    w[10] = 0.09212252223778612871763270709;
+-    w[11] = 0.09636873717464425963946862635;
+-    w[12] = 0.09959342058679526706278028210;
+-    w[13] = 0.10176238974840550459642895217;
+-    w[14] = 0.10285265289355884034128563671;
+-    w[15] = 0.10285265289355884034128563671;
+-    w[16] = 0.10176238974840550459642895217;
+-    w[17] = 0.09959342058679526706278028210;
+-    w[18] = 0.09636873717464425963946862635;
+-    w[19] = 0.09212252223778612871763270709;
+-    w[20] = 0.08689978720108297980238753072;
+-    w[21] = 0.08075589522942021535469493846;
+-    w[22] = 0.07375597473770520626824385002;
+-    w[23] = 0.06597422988218049512812851512;
+-    w[24] = 0.057493156217619066481721689402;
+-    w[25] = 0.048402672830594052902938140423;
+-    w[26] = 0.038799192569627049596801936446;
+-    w[27] = 0.028784707883323369349719179611;
+-    w[28] = 0.018466468311090959142302131912;
+-    w[29] = 0.007968192496166605615465883475;
+-  }
+-  else if ( n == 31 )
+-  {
+-    w[0] = 0.0074708315792487758586968750322;
+-    w[1] = 0.017318620790310582463157996087;
+-    w[2] = 0.027009019184979421800608708092;
+-    w[3] = 0.036432273912385464024392010468;
+-    w[4] = 0.045493707527201102902315857895;
+-    w[5] = 0.054103082424916853711666259087;
+-    w[6] = 0.062174786561028426910343543687;
+-    w[7] = 0.069628583235410366167756126255;
+-    w[8] = 0.076390386598776616426357674901;
+-    w[9] = 0.082392991761589263903823367432;
+-    w[10] = 0.087576740608477876126198069695;
+-    w[11] = 0.091890113893641478215362871607;
+-    w[12] = 0.095290242912319512807204197488;
+-    w[13] = 0.097743335386328725093474010979;
+-    w[14] = 0.099225011226672307874875514429;
+-    w[15] = 0.09972054479342645142753383373;
+-    w[16] = 0.099225011226672307874875514429;
+-    w[17] = 0.097743335386328725093474010979;
+-    w[18] = 0.095290242912319512807204197488;
+-    w[19] = 0.091890113893641478215362871607;
+-    w[20] = 0.087576740608477876126198069695;
+-    w[21] = 0.082392991761589263903823367432;
+-    w[22] = 0.076390386598776616426357674901;
+-    w[23] = 0.069628583235410366167756126255;
+-    w[24] = 0.062174786561028426910343543687;
+-    w[25] = 0.054103082424916853711666259087;
+-    w[26] = 0.045493707527201102902315857895;
+-    w[27] = 0.036432273912385464024392010468;
+-    w[28] = 0.027009019184979421800608708092;
+-    w[29] = 0.017318620790310582463157996087;
+-    w[30] = 0.0074708315792487758586968750322;
+-  }
+-  else if ( n == 32 )
+-  {
+-    w[0] = 0.007018610009470096600407063739;
+-    w[1] = 0.016274394730905670605170562206;
+-    w[2] = 0.025392065309262059455752589789;
+-    w[3] = 0.034273862913021433102687732252;
+-    w[4] = 0.042835898022226680656878646606;
+-    w[5] = 0.050998059262376176196163244690;
+-    w[6] = 0.058684093478535547145283637300;
+-    w[7] = 0.06582222277636184683765006371;
+-    w[8] = 0.07234579410884850622539935648;
+-    w[9] = 0.07819389578707030647174091883;
+-    w[10] = 0.08331192422694675522219907460;
+-    w[11] = 0.08765209300440381114277146275;
+-    w[12] = 0.09117387869576388471286857711;
+-    w[13] = 0.09384439908080456563918023767;
+-    w[14] = 0.09563872007927485941908200220;
+-    w[15] = 0.09654008851472780056676483006;
+-    w[16] = 0.09654008851472780056676483006;
+-    w[17] = 0.09563872007927485941908200220;
+-    w[18] = 0.09384439908080456563918023767;
+-    w[19] = 0.09117387869576388471286857711;
+-    w[20] = 0.08765209300440381114277146275;
+-    w[21] = 0.08331192422694675522219907460;
+-    w[22] = 0.07819389578707030647174091883;
+-    w[23] = 0.07234579410884850622539935648;
+-    w[24] = 0.06582222277636184683765006371;
+-    w[25] = 0.058684093478535547145283637300;
+-    w[26] = 0.050998059262376176196163244690;
+-    w[27] = 0.042835898022226680656878646606;
+-    w[28] = 0.034273862913021433102687732252;
+-    w[29] = 0.025392065309262059455752589789;
+-    w[30] = 0.016274394730905670605170562206;
+-    w[31] = 0.007018610009470096600407063739;
+-  }
+-  else if ( n == 33 )
+-  {
+-    w[0] = 0.0066062278475873780586492352085;
+-    w[1] = 0.015321701512934676127945768534;
+-    w[2] = 0.023915548101749480350533257529;
+-    w[3] = 0.032300358632328953281561447250;
+-    w[4] = 0.040401541331669591563409790527;
+-    w[5] = 0.048147742818711695670146880138;
+-    w[6] = 0.055470846631663561284944495439;
+-    w[7] = 0.062306482530317480031627725771;
+-    w[8] = 0.068594572818656712805955073015;
+-    w[9] = 0.074279854843954149342472175919;
+-    w[10] = 0.079312364794886738363908384942;
+-    w[11] = 0.083647876067038707613928014518;
+-    w[12] = 0.087248287618844337607281670945;
+-    w[13] = 0.090081958660638577239743705500;
+-    w[14] = 0.092123986643316846213240977717;
+-    w[15] = 0.093356426065596116160999126274;
+-    w[16] = 0.09376844616020999656730454155;
+-    w[17] = 0.093356426065596116160999126274;
+-    w[18] = 0.092123986643316846213240977717;
+-    w[19] = 0.090081958660638577239743705500;
+-    w[20] = 0.087248287618844337607281670945;
+-    w[21] = 0.083647876067038707613928014518;
+-    w[22] = 0.079312364794886738363908384942;
+-    w[23] = 0.074279854843954149342472175919;
+-    w[24] = 0.068594572818656712805955073015;
+-    w[25] = 0.062306482530317480031627725771;
+-    w[26] = 0.055470846631663561284944495439;
+-    w[27] = 0.048147742818711695670146880138;
+-    w[28] = 0.040401541331669591563409790527;
+-    w[29] = 0.032300358632328953281561447250;
+-    w[30] = 0.023915548101749480350533257529;
+-    w[31] = 0.015321701512934676127945768534;
+-    w[32] = 0.0066062278475873780586492352085;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEGENDRE_LOOKUP_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Illegal value of N = " << n << "\n";
+-    std::cerr << "  Legal values are 1 through 33.\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-double *legendre_zeros ( int order )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEGENDRE_ZEROS returns the zeros of the Legendre polynomial of degree N.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 June 2011
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Philip Davis, Philip Rabinowitz,
+-//    Methods of Numerical Integration,
+-//    Second Edition,
+-//    Dover, 2007,
+-//    ISBN: 0486453391,
+-//    LC: QA299.3.D28.
+-//
+-//  Parameters:
+-//
+-//    Input, int ORDER, the order.
+-//    ORDER must be greater than 0.
+-//
+-//    Output, double LEGENDRE_ZEROS[ORDER], the zeros.
+-//
+-{
+-  double d1;
+-  double d2pn;
+-  double d3pn;
+-  double d4pn;
+-  double dp;
+-  double dpn;
+-  double e1;
+-  double fx;
+-  double h;
+-  int i;
+-  int iback;
+-  int k;
+-  int m;
+-  int mp1mi;
+-  int ncopy;
+-  int nmove;
+-  double p;
+-  double pi = 3.141592653589793;
+-  double pk;
+-  double pkm1;
+-  double pkp1;
+-  double t;
+-  double u;
+-  double v;
+-  double x0;
+-  double *xtab;
+-  double xtemp;
+-
+-  xtab = new double[order];
+-
+-  e1 = ( double ) ( order * ( order + 1 ) );
+-
+-  m = ( order + 1 ) / 2;
+-
+-  for ( i = 1; i <= m; i++ )
+-  {
+-    mp1mi = m + 1 - i;
+-
+-    t = ( double ) ( 4 * i - 1 ) * pi / ( double ) ( 4 * order + 2 );
+-
+-    x0 = std::cos ( t ) * ( 1.0 - ( 1.0 - 1.0 / ( double ) ( order ) )
+-      / ( double ) ( 8 * order * order ) );
+-
+-    pkm1 = 1.0;
+-    pk = x0;
+-
+-    for ( k = 2; k <= order; k++ )
+-    {
+-      pkp1 = 2.0 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) / ( double ) ( k );
+-      pkm1 = pk;
+-      pk = pkp1;
+-    }
+-
+-    d1 = ( double ) ( order ) * ( pkm1 - x0 * pk );
+-
+-    dpn = d1 / ( 1.0 - x0 * x0 );
+-
+-    d2pn = ( 2.0 * x0 * dpn - e1 * pk ) / ( 1.0 - x0 * x0 );
+-
+-    d3pn = ( 4.0 * x0 * d2pn + ( 2.0 - e1 ) * dpn ) / ( 1.0 - x0 * x0 );
+-
+-    d4pn = ( 6.0 * x0 * d3pn + ( 6.0 - e1 ) * d2pn ) / ( 1.0 - x0 * x0 );
+-
+-    u = pk / dpn;
+-    v = d2pn / dpn;
+-//
+-//  Initial approximation H:
+-//
+-    h = - u * ( 1.0 + 0.5 * u * ( v + u * ( v * v - d3pn / ( 3.0 * dpn ) ) ) );
+-//
+-//  Refine H using one step of Newton's method:
+-//
+-    p = pk + h * ( dpn + 0.5 * h * ( d2pn + h / 3.0
+-      * ( d3pn + 0.25 * h * d4pn ) ) );
+-
+-    dp = dpn + h * ( d2pn + 0.5 * h * ( d3pn + h * d4pn / 3.0 ) );
+-
+-    h = h - p / dp;
+-
+-    xtemp = x0 + h;
+-
+-    xtab[mp1mi-1] = xtemp;
+-
+-    fx = d1 - h * e1 * ( pk + 0.5 * h * ( dpn + h / 3.0
+-      * ( d2pn + 0.25 * h * ( d3pn + 0.2 * h * d4pn ) ) ) );
+-  }
+-
+-  if ( ( order % 2 ) == 1 )
+-  {
+-    xtab[0] = 0.0;
+-  }
+-//
+-//  Shift the data up.
+-//
+-  nmove = ( order + 1 ) / 2;
+-  ncopy = order - nmove;
+-
+-  for ( i = 1; i <= nmove; i++ )
+-  {
+-    iback = order + 1 - i;
+-    xtab[iback-1] = xtab[iback-ncopy-1];
+-  }
+-//
+-//  Reflect values for the negative abscissas.
+-//
+-  for ( i = 1; i <= order - nmove; i++ )
+-  {
+-    xtab[i-1] = - xtab[order-i];
+-  }
+-
+-  return xtab;
+-}
+-//****************************************************************************80
+-
+-void level_growth_to_order ( int dim_num, int level[], int rule[],
+-  int growth[], int order[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_GROWTH_TO_ORDER: convert Level and Growth to Order.
+-//
+-//  Discussion:
+-//
+-//    This function is given level, rule, and growth information
+-//    for each dimension of a quadrature rule, and determines the
+-//    corresponding order of the rule in each dimension.
+-//
+-//    This is a revised version of LEVEL_GROWTH_TO_ORDER.
+-//
+-//    In particular, it revises the interpretation of the RULE vector as
+-//    far as the values 10, 11, and 12 are concerned.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    16 October 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int DIM_NUM, the spatial dimension.
+-//
+-//    Input, int LEVEL[DIM_NUM], the 1D levels.
+-//
+-//    Input, int RULE[DIM_NUM], the rule in each dimension.
+-//     1, "CC",  Clenshaw Curtis, Closed Fully Nested.
+-//     2, "F2",  Fejer Type 2, Open Fully Nested.
+-//     3, "GP",  Gauss Patterson, Open Fully Nested.
+-//     4, "GL",  Gauss Legendre, Open Weakly Nested.
+-//     5, "GH",  Gauss Hermite, Open Weakly Nested.
+-//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested.
+-//     7, "LG",  Gauss Laguerre, Open Non Nested.
+-//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested.
+-//     9, "GJ",  Gauss Jacobi, Open Non Nested.
+-//    10, "HGK", Hermite Genz-Keister, Open Fully Nested.
+-//    11, "UO",  User supplied Open, presumably Non Nested.
+-//    12, "UC",  User supplied Closed, presumably Non Nested.
+-//
+-//    Input, int GROWTH[DIM_NUM], the desired growth in each dimension.
+-//    0, "DF", default growth associated with this quadrature rule;
+-//    1, "SL", slow linear, L+1;
+-//    2  "SO", slow linear odd, O=1+2((L+1)/2)
+-//    3, "ML", moderate linear, 2L+1;
+-//    4, "SE", slow exponential;
+-//    5, "ME", moderate exponential;
+-//    6, "FE", full exponential.
+-//
+-//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+-//
+-{
+-  int dim;
+-  int l;
+-  int o;
+-  static int o_hgk[6] = { 1, 3, 9, 19, 35, 43 };
+-  int p;
+-  static int p_hgk[6] = { 1, 5, 15, 29, 51, 67 };
+-//
+-//  Check the input.
+-//
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    if ( level[dim] < 0 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+-      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+-      std::exit ( 1 );
+-    }
+-
+-    if ( rule[dim] < 1 || 12 < rule[dim] )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-      std::cerr << "  Illegal value of RULE[DIM]!\n";
+-      std::cerr << "  RULE[" << dim << "] = " << rule[dim] << "\n";
+-      std::exit ( 1 );
+-    }
+-
+-    if ( growth[dim] < 0 || 6 < growth[dim] )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-      std::cerr << "  Illegal value of GROWTH[DIM]!\n";
+-      std::cerr << "  GROWTH[" << dim << "] = " << growth[dim] << "\n";
+-      std::exit ( 1 );
+-    }
+-  }
+-//
+-//  Compute the order vector.
+-//
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-//
+-//  CC
+-//  Default is Moderate Exponential Growth.
+-//
+-    if ( rule[dim] == 1 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          o = 2;
+-          while ( o < 2 * level[dim] + 1 )
+-          {
+-            o = 2 * ( o - 1 ) + 1;
+-          }
+-        }
+-      }
+-      else if ( growth[dim] == 5 || growth[dim] == 0 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          o = 2;
+-          while ( o < 4 * level[dim] + 1 )
+-          {
+-            o = 2 * ( o - 1 ) + 1;
+-          }
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          o = webbur::i4_power ( 2, level[dim] ) + 1;
+-        }
+-      }
+-    }
+-//
+-//  F2
+-//  Default is Moderate Exponential Growth.
+-//
+-    else if ( rule[dim] == 2 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( o < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 || growth[dim] == 0 )
+-      {
+-        o = 1;
+-        while ( o < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  GP
+-//  Default is Moderate Exponential Growth.
+-//
+-    else if ( rule[dim] == 3 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-        std::cerr << "  Growth rate 1 for rule 3 not available!\n";
+-        std::exit ( 1 );
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-        std::cerr << "  Growth rate 2 for rule 3 not available!\n";
+-        std::exit ( 1 );
+-      }
+-      else if ( growth[dim] == 3 )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-        std::cerr << "  Growth rate 3 for rule 3 not available!\n";
+-        std::exit ( 1 );
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          p = 5;
+-          o = 3;
+-          while ( p < 2 * level[dim] + 1 )
+-          {
+-            p = 2 * p + 1;
+-            o = 2 * o + 1;
+-          }
+-        }
+-      }
+-      else if ( growth[dim] == 5 || growth[dim] == 0 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          p = 5;
+-          o = 3;
+-          while ( p < 4 * level[dim] + 1 )
+-          {
+-            p = 2 * p + 1;
+-            o = 2 * o + 1;
+-          }
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  GL
+-//  Default is Moderate Linear Growth.
+-//
+-    else if ( rule[dim] == 4 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  GH
+-//  Default is Moderate Linear Growth.
+-//
+-    else if ( rule[dim] == 5 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  GGH
+-//  Default is Moderate Linear Growth.
+-//
+-    else if ( rule[dim] == 6 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  LG
+-//  Default is Moderate Linear Growth.
+-//
+-    else if ( rule[dim] == 7 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  GLG
+-//  Default is Moderate Linear Growth.
+-//
+-    else if ( rule[dim] == 8 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  GJ
+-//  Default is Moderate Linear Growth.
+-//
+-    else if ( rule[dim] == 9 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  HGK
+-//  Default is Moderate Exponential Growth.
+-//  Exponential growth is interpreted to mean simply take successive rules.
+-//
+-    else if ( rule[dim] == 10 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-        std::cerr << "  Growth rate 1 for rule 10 not available!\n";
+-        std::exit ( 1 );
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-        std::cerr << "  Growth rate 2 for rule 10 not available!\n";
+-        std::exit ( 1 );
+-      }
+-      else if ( growth[dim] == 3 )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-        std::cerr << "  Growth rate 3 for rule 10 not available!\n";
+-        std::exit ( 1 );
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        l = 0;
+-        p = p_hgk[l];
+-        o = o_hgk[l];
+-        while ( p < 2 * level[dim] + 1 )
+-        {
+-          l = l + 1;
+-          if ( 5 < l )
+-          {
+-            std::cerr << "\n";
+-            std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-            std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+-            std::exit ( 1 );
+-          }
+-          p = p_hgk[l];
+-          o = o_hgk[l];
+-        }
+-      }
+-      else if ( growth[dim] == 5 || growth[dim] == 0 )
+-      {
+-        l = 0;
+-        p = p_hgk[l];
+-        o = o_hgk[l];
+-        while ( p < 4 * level[dim] + 1 )
+-        {
+-          l = l + 1;
+-          if ( 5 < l )
+-          {
+-            std::cerr << "\n";
+-            std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-            std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+-            std::exit ( 1 );
+-          }
+-          p = p_hgk[l];
+-          o = o_hgk[l];
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        l = level[dim];
+-        l = webbur::i4_max ( l, 0 );
+-        if ( 5 < l )
+-        {
+-          std::cerr << "\n";
+-          std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
+-          std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+-          std::exit ( 1 );
+-        }
+-        o = o_hgk[l];
+-      }
+-    }
+-//
+-//  UO
+-//  Default is Moderate Linear Growth.
+-//  We assume the rule is of OPEN type and that it
+-//  has a precision typical of Gauss rules.
+-//
+-    else if ( rule[dim] == 11 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        o = 1;
+-        while ( 2 * o - 1 < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * o + 1;
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-      }
+-    }
+-//
+-//  UC
+-//  Default is Moderate Linear Growth.
+-//  We assume the rule is of CLOSED type and that it
+-//  has a precision typical of Clenshaw-Curtis rules.
+-//
+-    else if ( rule[dim] == 12 )
+-    {
+-      if ( growth[dim] == 1 )
+-      {
+-        o = level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 2 )
+-      {
+-        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
+-      }
+-      else if ( growth[dim] == 3 || growth[dim] == 0 )
+-      {
+-        o = 2 * level[dim] + 1;
+-      }
+-      else if ( growth[dim] == 4 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          o = 2;
+-          while ( o < 2 * level[dim] + 1 )
+-          {
+-            o = 2 * ( o - 1 ) + 1;
+-          }
+-        }
+-      }
+-      else if ( growth[dim] == 5 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          o = 2;
+-          while ( o < 4 * level[dim] + 1 )
+-          {
+-            o = 2 * ( o - 1 ) + 1;
+-          }
+-        }
+-      }
+-      else if ( growth[dim] == 6 )
+-      {
+-        if ( level[dim] == 0 )
+-        {
+-          o = 1;
+-        }
+-        else
+-        {
+-          o = webbur::i4_power ( 2, level[dim] ) + 1;
+-        }
+-      }
+-    }
+-    order[dim] = o;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void level_to_order_default ( int dim_num, int level[], int rule[],
+-  int order[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_DEFAULT: default growth.
+-//
+-//  Discussion:
+-//
+-//    This function uses:
+-//
+-//    * exponential growth rates for fully nested quadrature rules,
+-//      ( "CC", "F2", "GP");
+-//
+-//    * linear growth rates for other rules.
+-//      ( "GL", "GH", "GGH", "LG", "GLG", "GJ", "GW" ).
+-//
+-//    * slow exponential growth alternative for fully nested rules:
+-//      ("CC_SE", "F2_SE", "GP_SE").
+-//
+-//    * moderate exponential growth alternative for fully nested rules:
+-//      ("CC_ME", "F2_ME", "GP_ME").
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int DIM_NUM, the spatial dimension.
+-//
+-//    Input, int LEVEL[DIM_NUM], the 1D levels.
+-//
+-//    Input, int RULE[DIM_NUM], the rule in each dimension.
+-//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+-//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+-//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+-//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+-//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+-//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+-//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+-//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+-//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+-//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+-//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+-//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+-//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+-//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+-//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+-//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+-//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+-//
+-//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+-//
+-{
+-  int dim;
+-  int o;
+-  int p;
+-
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    if ( level[dim] < 0 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_TO_ORDER_DEFAULT - Fatal error!\n";
+-      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+-      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+-      std::exit ( 1 );
+-    }
+-    else if ( rule[dim] == 1 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        order[dim] = 1;
+-      }
+-      else
+-      {
+-        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+-      }
+-    }
+-    else if ( rule[dim] == 2 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 3 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 4 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else if ( rule[dim] == 5 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else if ( rule[dim] == 6 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else if ( rule[dim] == 7 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else if ( rule[dim] == 8 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else if ( rule[dim] == 9 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else if ( rule[dim] == 10 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else if ( rule[dim] == 11 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        o = 1;
+-      }
+-      else
+-      {
+-        o = 2;
+-        while ( o < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * ( o - 1 ) + 1;
+-        }
+-      }
+-      order[dim] = o;
+-    }
+-    else if ( rule[dim] == 12 )
+-    {
+-      o = 1;
+-      while ( o < 2 * level[dim] + 1 )
+-      {
+-        o = 2 * o + 1;
+-      }
+-      order[dim] = o;
+-    }
+-    else if ( rule[dim] == 13 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        order[dim] = 1;
+-      }
+-      else
+-      {
+-        p = 5;
+-        o = 3;
+-        while ( p < 2 * level[dim] + 1 )
+-        {
+-          p = 2 * p + 1;
+-          o = 2 * o + 1;
+-        }
+-        order[dim] = o;
+-      }
+-    }
+-    else if ( rule[dim] == 14 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        o = 1;
+-      }
+-      else
+-      {
+-        o = 2;
+-        while ( o < 4 * level[dim] + 1 )
+-        {
+-          o = 2 * ( o - 1 ) + 1;
+-        }
+-      }
+-      order[dim] = o;
+-    }
+-    else if ( rule[dim] == 15 )
+-    {
+-      o = 1;
+-      while ( o < 4 * level[dim] + 1 )
+-      {
+-        o = 2 * o + 1;
+-      }
+-      order[dim] = o;
+-    }
+-    else if ( rule[dim] == 16 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        order[dim] = 1;
+-      }
+-      else
+-      {
+-        p = 5;
+-        o = 3;
+-        while ( p < 4 * level[dim] + 1 )
+-        {
+-          p = 2 * p + 1;
+-          o = 2 * o + 1;
+-        }
+-        order[dim] = o;
+-      }
+-    }
+-    else if ( rule[dim] == 17 )
+-    {
+-      order[dim] = 2 * level[dim] + 1;
+-    }
+-    else
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_TO_ORDER_DEFAULT - Fatal error!\n";
+-      std::cerr << "  Unexpected value of RULE["
+-           << dim << "] = " << rule[dim] << ".\n";
+-      std::exit ( 1 );
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void level_to_order_exponential ( int dim_num, int level[], int rule[],
+-  int order[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_EXPONENTIAL: exponential growth.
+-//
+-//  Discussion:
+-//
+-//    The user must preallocate space for the output array ORDER.
+-//
+-//    Closed rules:
+-//
+-//      O(0) = 1
+-//      O(L) = 2^L + 1;
+-//
+-//      O = 1, 3, 5, 9, 17, 33, ...
+-//
+-//    Open rules:
+-//
+-//      O(L) = 2^(L+1) - 1;
+-//
+-//      O = 1, 3, 7, 15, 31, 63, ...
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int DIM_NUM, the spatial dimension.
+-//
+-//    Input, int LEVEL[DIM_NUM], the 1D levels.
+-//
+-//    Input, int RULE[DIM_NUM], the rule in each dimension.
+-//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+-//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+-//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+-//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+-//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+-//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+-//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+-//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+-//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+-//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+-//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+-//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+-//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+-//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+-//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+-//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+-//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+-//
+-//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+-//
+-{
+-  int dim;
+-
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    if ( level[dim] < 0 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL - Fatal error!\n";
+-      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+-      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+-      std::exit ( 1 );
+-    }
+-    else if ( rule[dim] == 1 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        order[dim] = 1;
+-      }
+-      else
+-      {
+-        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+-      }
+-    }
+-    else if ( rule[dim] == 2 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 3 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 4 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 5 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 6 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 7 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 8 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 9 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 10 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 11 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        order[dim] = 1;
+-      }
+-      else
+-      {
+-        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+-      }
+-    }
+-    else if ( rule[dim] == 12 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 13 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 14 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        order[dim] = 1;
+-      }
+-      else
+-      {
+-        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
+-      }
+-    }
+-    else if ( rule[dim] == 15 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 16 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
+-    }
+-    else if ( rule[dim] == 17 )
+-    {
+-      order[dim] = webbur::i4_power ( 2, level[dim] + 1 );
+-    }
+-    else
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL - Fatal error!\n";
+-      std::cerr << "  Unexpected value of RULE["
+-           << dim << "] = " << rule[dim] << ".\n";
+-      std::exit ( 1 );
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void level_to_order_exponential_slow ( int dim_num, int level[], int rule[],
+-  int order[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_EXPONENTIAL_SLOW: slow exponential growth;
+-//
+-//  Discussion:
+-//
+-//    We seek a sequence of quadrature rules with two opposing constraints:
+-//    * a measured rise in polynomial precision with increasing level;
+-//    * a control on the increase in (new) points per level;
+-//
+-//    Essentially, we are trying to keep some of the advantages of nesting,
+-//    while moderating the cost of the explosive growth in order that occurs
+-//    due to the repeated order doubling of nesting.
+-//
+-//    We wish the number of points at a given level L to be "about" 2 * L + 1,
+-//    but we also wish the rules to be completely nested.
+-//
+-//    One way to do this is to start with a nested family of rules, whose
+-//    order will tend to grow exponentially (doubling from one to the next),
+-//    but simply to REPEAT each rule as many times as possible.  We move to
+-//    the next rule only when the desired precision 2 * L + 1 exceeds the
+-//    precision of the current rule.
+-//
+-//    For both the Clenshaw Curtis and Fejer Type 2 rules, the order and
+-//    precision are the same if the order is odd.   That is, an 11 point rule
+-//    will integrate exactly all polynomials up to and including degree 11.
+-//
+-//    For Gauss Patterson rules, the relationship between order and precision
+-//    is somewhat more complicated.  For that rule, we take the philosophy
+-//    that at each level L, we wish to choose the rule of smallest order
+-//    so that the precision of 2 * L + 1 is guaranteed.
+-//
+-//     L    2*L+1  CC Order    F2 Order    GP Order/Precision
+-//
+-//     0        1         1           1        1/1
+-//     1        3         3           3        3/5
+-//     2        5         5           7        3/5
+-//     3        7         9           7        7/11
+-//     4        9         9          15        7/11
+-//     5       11        17          15        7/11
+-//     6       13        17          15       15/23
+-//     7       15        17          15       15/23
+-//     8       17        17          31       15/23
+-//     9       19        33          31       15/23
+-//    10       21        33          31       15/23
+-//    11       23        33          31       15/23
+-//    12       25        33          31       31/47
+-//    13       27        33          31       31/47
+-//    14       29        33          31       31/47
+-//    15       31        33          31       31/47
+-//    16       33        33          63       31/47
+-//    17       35        65          63       31/47
+-//    18       37        65          63       31/47
+-//    19       39        65          63       31/47
+-//    20       41        65          63       31/47
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Knut Petras,
+-//    Smolyak Cubature of Given Polynomial Degree with Few Nodes
+-//    for Increasing Dimension,
+-//    Numerische Mathematik,
+-//    Volume 93, Number 4, February 2003, pages 729-753.
+-//
+-//  Parameters:
+-//
+-//    Input, int DIM_NUM, the spatial dimension.
+-//
+-//    Input, int LEVEL[DIM_NUM], the 1D levels.
+-//
+-//    Input, int RULE[DIM_NUM], the rule in each dimension.
+-//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+-//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+-//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+-//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+-//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+-//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+-//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+-//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+-//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+-//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+-//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+-//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+-//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+-//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+-//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+-//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+-//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+-//
+-//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+-//
+-{
+-  int dim;
+-  int o;
+-  int p;
+-
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    if ( level[dim] < 0 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL_SLOW - Fatal error!\n";
+-      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+-      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+-      std::exit ( 1 );
+-    }
+-  }
+-
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    if ( rule[dim] == 1 || rule[dim] == 11 || rule[dim] == 14 || rule[dim] == 17 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        o = 1;
+-      }
+-      else
+-      {
+-        o = 2;
+-        while ( o < 2 * level[dim] + 1 )
+-        {
+-          o = 2 * ( o - 1 ) + 1;
+-        }
+-      }
+-    }
+-    else if ( rule[dim] == 3 || rule[dim] == 13 || rule[dim] == 16 )
+-    {
+-      if ( level[dim] == 0 )
+-      {
+-        o = 1;
+-      }
+-      else
+-      {
+-        p = 5;
+-        o = 3;
+-        while ( p < 2 * level[dim] + 1 )
+-        {
+-          p = 2 * p + 1;
+-          o = 2 * o + 1;
+-        }
+-      }
+-    }
+-    else
+-    {
+-      o = 1;
+-      while ( o < 2 * level[dim] + 1 )
+-      {
+-        o = 2 * o + 1;
+-      }
+-    }
+-    order[dim] = o;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void level_to_order_linear ( int dim_num, int level[], int rule[],
+-  int order[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_LINEAR: linear growth.
+-//
+-//  Discussion:
+-//
+-//    The user must preallocate space for the output array ORDER.
+-//
+-//      O(L) = 2 * L + 1;
+-//
+-//      O = 1, 3, 5, 7, 9, ...
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    07 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int DIM_NUM, the spatial dimension.
+-//
+-//    Input, int LEVEL[DIM_NUM], the 1D levels.
+-//
+-//    Input, int RULE[DIM_NUM], the rule in each dimension.
+-//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+-//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+-//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+-//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+-//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+-//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+-//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+-//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+-//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+-//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+-//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+-//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+-//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+-//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+-//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+-//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+-//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+-//
+-//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
+-//
+-{
+-  int dim;
+-
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    if ( level[dim] < 0 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_TO_ORDER_LINEAR - Fatal error!\n";
+-      std::cerr << "  Negative value of LEVEL[DIM]!\n";
+-      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
+-      std::exit ( 1 );
+-    }
+-  }
+-
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    order[dim] = 2 * level[dim] + 1;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int level_to_order_exp_cc ( int level, int growth )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_EXP_CC is used for Clenshaw-Curtis type rules.
+-//
+-//  Discussion:
+-//
+-//    Rules of this type are assumed to be closed (including both endpoints
+-//    except for the level 0 rule) and having a precision
+-//    behavior typical of Clenshaw Curtis rules, namely, the ORDER-point
+-//    rule is exact for polynomials of degree less than ORDER, and if
+-//    ORDER is odd, then the exactness includes polynomials of degree ORDER
+-//    as well.
+-//
+-//    LEVEL  ORDER  ORDER  ORDER
+-//           G = 0  G = 1  G = 2
+-//    -----  -----  -----  -----
+-//        0      1      1      1
+-//        1      3      5      3
+-//        2      5      9      5
+-//        3      9     17      9
+-//        4      9     17     17
+-//        5     17     33     33
+-//        6     17     33     65
+-//        7     17     33    129
+-//        8     17     33    257
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 December 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int LEVEL, the level of the rule.
+-//
+-//    Input, int GROWTH, the growth policy:
+-//    0, slow growth;
+-//    1, moderate growth;
+-//    2, full growth.
+-//
+-//    Output, int LEVEL_TO_ORDER_EXP_CC, the order of the rule.
+-//
+-{
+-  int o;
+-//
+-//  Slow exponential growth.
+-//
+-  if ( growth == 0 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = 2;
+-      while ( o < 2 * level + 1 )
+-      {
+-        o = 2 * ( o - 1 ) + 1;
+-      }
+-    }
+-  }
+-//
+-//  Moderate Exponential Growth.
+-//
+-  else if ( growth == 1 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = 2;
+-      while ( o < 4 * level + 1 )
+-      {
+-        o = 2 * ( o - 1 ) + 1;
+-      }
+-    }
+-  }
+-//
+-//  Full Exponential Growth.
+-//
+-  else if ( growth == 2 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = webbur::i4_power ( 2, level ) + 1;
+-    }
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEVEL_TO_ORDER_EXP_CC - Fatal error!\n";
+-    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+-    std::exit ( 1 );
+-  }
+-  return o;
+-}
+-//****************************************************************************80
+-
+-int level_to_order_exp_f2 ( int level, int growth )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_EXP_F2 is used for Fejer 2 type rules.
+-//
+-//  Discussion:
+-//
+-//    Rules of this type are assumed to be open (not including either endpoint)
+-//    and having a precision behavior typical of Fejer Type 2
+-//    rules, namely, the ORDER-point rule is exact for polynomials of degree
+-//    less than ORDER, and if ORDER is odd, then the exactness includes
+-//    polynomials of degree ORDER as well.
+-//
+-//    LEVEL  ORDER  ORDER  ORDER
+-//           G = 0  G = 1  G = 2
+-//
+-//        0      1      1      1
+-//        1      3      7      3
+-//        2      7     15      7
+-//        3      7     15     15
+-//        4     15     31     31
+-//        5     15     31     63
+-//        6     15     31    127
+-//        7     15     31    255
+-//        8     31     63    511
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 December 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int LEVEL, the level of the rule.
+-//
+-//    Input, int GROWTH, the growth policy:
+-//    0, slow growth;
+-//    1, moderate growth;
+-//    2, full growth.
+-//
+-//    Output, int LEVEL_TO_ORDER_EXP_F2, the order of the rule.
+-//
+-{
+-  int o;
+-//
+-//  Slow exponential growth.
+-//
+-  if ( growth == 0 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = 1;
+-      while ( o < 2 * level + 1 )
+-      {
+-        o = 2 * o + 1;
+-      }
+-    }
+-  }
+-//
+-//  Moderate Exponential Growth.
+-//
+-  else if ( growth == 1 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = 1;
+-      while ( o < 4 * level + 1 )
+-      {
+-        o = 2 * o + 1;
+-      }
+-    }
+-  }
+-//
+-//  Full Exponential Growth.
+-//
+-  else if ( growth == 2 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = webbur::i4_power ( 2, level + 1 ) - 1;
+-    }
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEVEL_TO_ORDER_EXP_F2 - Fatal error!\n";
+-    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+-    std::exit ( 1 );
+-  }
+-  return o;
+-}
+-//****************************************************************************80
+-
+-int level_to_order_exp_gauss ( int level, int growth )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_EXP_GAUSS is used for Gauss type rules.
+-//
+-//  Discussion:
+-//
+-//    Rules of this type are assumed to be open (not including either endpoint),
+-//    and having a precision behavior typical of Gauss rules, namely, the
+-//    ORDER-point rule is exact for polynomials of degree less than 2 * ORDER.
+-//
+-//    LEVEL  ORDER  ORDER  ORDER
+-//           G = 0  G = 1  G = 2
+-//
+-//        0      1      1      1
+-//        1      3      3      3
+-//        2      3      7      7
+-//        3      7      7     15
+-//        4      7     15     31
+-//        5      7     15     63
+-//        6      7     15    127
+-//        7     15     15    255
+-//        8     15     31    511
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 December 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int LEVEL, the level of the rule.
+-//
+-//    Input, int GROWTH, the growth policy:
+-//    0, slow growth;
+-//    1, moderate growth;
+-//    2, full growth.
+-//
+-//    Output, int LEVEL_TO_ORDER_EXP_GAUSS, the order of the rule.
+-//
+-{
+-  int o;
+-//
+-//  Slow exponential growth.
+-//
+-  if ( growth == 0 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = 1;
+-      while ( 2 * o - 1 < 2 * level + 1 )
+-      {
+-        o = 2 * o + 1;
+-      }
+-    }
+-  }
+-//
+-//  Moderate Exponential Growth.
+-//
+-  else if ( growth == 1 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = 1;
+-      while ( 2 * o - 1 < 4 * level + 1 )
+-      {
+-        o = 2 * o + 1;
+-      }
+-    }
+-  }
+-//
+-//  Full Exponential Growth.
+-//
+-  else if ( growth == 2 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = webbur::i4_power ( 2, level + 1 ) - 1;
+-    }
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEVEL_TO_ORDER_EXP_GAUSS - Fatal error!\n";
+-    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  return o;
+-}
+-//****************************************************************************80
+-
+-int level_to_order_exp_gp ( int level, int growth )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_EXP_GP is used for Gauss-Patterson type rules.
+-//
+-//  Discussion:
+-//
+-//    Rules of this type are assumed to be open (not including either endpoint)
+-//    and having a precision behavior typical of Gauss Patterson rules.
+-//
+-//    Note that there are onlly 9 rules in the family, and so it is possible to
+-//    specify input for which the function will fail.
+-//
+-//    LEVEL  ORDER  ORDER  ORDER
+-//           G = 0  G = 1  G = 2
+-//
+-//        0      1      1      1
+-//        1      3      3      3
+-//        2      3      7      7
+-//        3      7     15     15
+-//        4      7     15     31
+-//        5      7     15     63
+-//        6     15     31    127
+-//        7     15     31    255
+-//        8     15     31    511
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 December 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int LEVEL, the level of the rule.
+-//
+-//    Input, int GROWTH, the growth policy:
+-//    0, slow growth;
+-//    1, moderate growth;
+-//    2, full growth.
+-//
+-//    Output, int LEVEL_TO_ORDER_EXP_GP, the order of the rule.
+-//
+-{
+-  int o;
+-  int p;
+-//
+-//  Slow exponential growth.
+-//
+-  if ( growth == 0 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      p = 5;
+-      o = 3;
+-      while ( p < 2 * level + 1 )
+-      {
+-        p = 2 * p + 1;
+-        o = 2 * o + 1;
+-        if ( 511 < o )
+-        {
+-          std::cerr << "\n";
+-          std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+-          std::cerr << "  Request for unavailable Patterson rule.\n";
+-          std::exit ( 1 );
+-        }
+-      }
+-    }
+-  }
+-//
+-//  Moderate Exponential Growth.
+-//
+-  else if ( growth == 1 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      p = 5;
+-      o = 3;
+-      while ( p < 4 * level + 1 )
+-      {
+-        p = 2 * p + 1;
+-        o = 2 * o + 1;
+-        if ( 511 < o )
+-        {
+-          std::cerr << "\n";
+-          std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+-          std::cerr << "  Request for unavailable Patterson rule.\n";
+-          std::exit ( 1 );
+-        }
+-      }
+-    }
+-  }
+-//
+-//  Full Exponential Growth.
+-//
+-  else if ( growth == 2 )
+-  {
+-    if ( level == 0 )
+-    {
+-      o = 1;
+-    }
+-    else
+-    {
+-      o = webbur::i4_power ( 2, level + 1 ) - 1;
+-      if ( 511 < o )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+-        std::cerr << "  Request for unavailable Patterson rule.\n";
+-        std::exit ( 1 );
+-      }
+-    }
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
+-    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  return o;
+-}
+-//****************************************************************************80
+-
+-int level_to_order_exp_hgk ( int level, int growth )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_EXP_HGK is used for Hermite Genz-Keister type rules.
+-//
+-//  Discussion:
+-//
+-//    Rules of this type are assumed to be open (not including either endpoint)
+-//    and having a precision behavior typical of Hermite Genz-Keister rules.
+-//
+-//    Note that there are only 6 rules in the family, and so it is possible to
+-//    specify input for which the function will fail.
+-//
+-//    LEVEL  ORDER  ORDER  ORDER
+-//           G = 0  G = 1  G = 2
+-//
+-//        0      1      1      1
+-//        1      3      3      3
+-//        2      3      9      9
+-//        3      9      9     19
+-//        4      9     19     35
+-//        5      9     19     43
+-//        6      9     19     --
+-//        7      9     19     --
+-//        8     19     35     --
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 December 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int LEVEL, the level of the rule.
+-//
+-//    Input, int GROWTH, the growth policy:
+-//    0, slow growth;
+-//    1, moderate growth;
+-//    2, full growth.
+-//
+-//    Output, int LEVEL_TO_ORDER_EXP_HGK, the order of the rule.
+-//
+-{
+-  int l;
+-  int o;
+-  static int o_hgk[6] = { 1, 3, 9, 19, 35, 43 };
+-  int p;
+-  static int p_hgk[6] = { 1, 5, 15, 29, 51, 67 };
+-//
+-//  Slow exponential growth.
+-//
+-  if ( growth == 0 )
+-  {
+-    l = 0;
+-    p = p_hgk[l];
+-    o = o_hgk[l];
+-    while ( p < 2 * level + 1 )
+-    {
+-      l = l + 1;
+-      if ( 5 < l )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+-        std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+-        std::exit ( 1 );
+-      }
+-      p = p_hgk[l];
+-      o = o_hgk[l];
+-    }
+-  }
+-  else if ( growth == 1 )
+-  {
+-    l = 0;
+-    p = p_hgk[l];
+-    o = o_hgk[l];
+-    while ( p < 4 * level + 1 )
+-    {
+-      l = l + 1;
+-      if ( 5 < l )
+-      {
+-        std::cerr << "\n";
+-        std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+-        std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+-        std::exit ( 1 );
+-      }
+-      p = p_hgk[l];
+-      o = o_hgk[l];
+-    }
+-  }
+-  else if ( growth == 2 )
+-  {
+-    l = level;
+-    l = webbur::i4_max ( l, 0 );
+-    if ( 5 < l )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+-      std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
+-      std::exit ( 1 );
+-    }
+-    o = o_hgk[l];
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
+-    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  return o;
+-}
+-//****************************************************************************80
+-
+-int level_to_order_linear_nn ( int level, int growth )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_LINEAR_NN is used for non-nested Gauss type rules.
+-//
+-//  Discussion:
+-//
+-//    Rules of this type are assumed to be open (not including either endpoint),
+-//    non-nested, and having a precision behavior typical of Gauss rules.
+-//
+-//    LEVEL  ORDER  ORDER
+-//           G = 0  G = 1
+-//
+-//        0      1      1
+-//        1      2      3
+-//        2      3      5
+-//        3      4      7
+-//        4      5      9
+-//        5      6     11
+-//        6      7     13
+-//        7      8     15
+-//        8      9     17
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 December 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int LEVEL, the level of the rule.
+-//
+-//    Input, int GROWTH, the growth policy:
+-//    0, slow growth;
+-//    1, moderate growth;
+-//
+-//    Output, int LEVEL_TO_ORDER_LINEAR_NN, the order of the rule.
+-//
+-{
+-  int o;
+-//
+-//  Slow linear growth.
+-//
+-  if ( growth == 0 )
+-  {
+-    o = level + 1;
+-  }
+-//
+-//  Moderate linear growth.
+-//
+-  else if ( growth == 1 )
+-  {
+-    o = 2 * level + 1;
+-  }
+-  else if ( growth == 2 )
+-  {
+-    o = 2 * level + 1;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEVEL_TO_ORDER_LINEAR_NN - Fatal error!\n";
+-    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+-    std::exit ( 1 );
+-  }
+-  return o;
+-}
+-//****************************************************************************80
+-
+-int level_to_order_linear_wn ( int level, int growth )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    LEVEL_TO_ORDER_LINEAR_WN is used for weakly-nested Gauss type rules.
+-//
+-//  Discussion:
+-//
+-//    Rules of this type are assumed to be open (not including either endpoint),
+-//    nested, and having a precision behavior typical of Gauss rules.
+-//
+-//    We assume the rules are to be generated with an odd number of points,
+-//    and that all the rules will share a single point, namely 0.
+-//
+-//    Note that the "moderate growth" option for this function results in the
+-//    same values as the moderate growth option for LEVEL_TO_ORDER_LINEAR_NN.
+-//
+-//    LEVEL  ORDER  ORDER
+-//           G = 0  G = 1
+-//
+-//        0      1      1
+-//        1      3      3
+-//        2      3      5
+-//        3      5      7
+-//        4      5      9
+-//        5      7     11
+-//        6      7     13
+-//        7      9     15
+-//        8      9     17
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 December 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int LEVEL, the level of the rule.
+-//
+-//    Input, int GROWTH, the growth policy:
+-//    0, slow growth;
+-//    1, moderate growth;
+-//
+-//    Output, int LEVEL_TO_ORDER_LINEAR_WN, the order of the rule.
+-//
+-{
+-  int o;
+-//
+-//  Slow growth.
+-//
+-  if ( growth == 0 )
+-  {
+-    o = 2 * ( ( level + 1 ) / 2 ) + 1;
+-  }
+-  else if ( growth == 1 )
+-  {
+-    o = 2 * level + 1;
+-  }
+-  else if ( growth == 2 )
+-  {
+-    o = 2 * level + 1;
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "LEVEL_TO_ORDER_LINEAR_WN - Fatal error!\n";
+-    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
+-    std::exit ( 1 );
+-  }
+-  return o;
+-}
+-//****************************************************************************80
+-
+-void nc_compute ( int n, double x_min, double x_max, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NC_COMPUTE computes a Newton-Cotes quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    For the interval [X_MIN,X_MAX], the Newton-Cotes quadrature rule
+-//    estimates
+-//
+-//      Integral ( X_MIN <= X <= X_MAX ) F(X) dX
+-//
+-//    using N abscissas X and weights W:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) ).
+-//
+-//    For the CLOSED rule, the abscissas include the end points.
+-//    For the OPEN rule, the abscissas do not include the end points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 November 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, double X_MIN, X_MAX, the endpoints of the interval.
+-//
+-//    Input, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  double *d;
+-  int i;
+-  int j;
+-  int k;
+-  double yvala;
+-  double yvalb;
+-
+-  d = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-//
+-//  Compute the Lagrange basis polynomial which is 1 at XTAB(I),
+-//  and zero at the other nodes.
+-//
+-    for ( j = 0; j < n; j++ )
+-    {
+-      d[j] = 0.0;
+-    }
+-    d[i] = 1.0;
+-
+-    for ( j = 2; j <= n; j++ )
+-    {
+-      for ( k = j; k <= n; k++ )
+-      {
+-        d[n+j-k-1] = ( d[n+j-k-1-1] - d[n+j-k-1] ) / ( x[n+1-k-1] - x[n+j-k-1] );
+-      }
+-    }
+-
+-    for ( j = 1; j <= n - 1; j++ )
+-    {
+-      for ( k = 1; k <= n - j; k++ )
+-      {
+-        d[n-k-1] = d[n-k-1] - x[n-k-j] * d[n-k];
+-      }
+-    }
+-//
+-//  Evaluate the antiderivative of the polynomial at the left and
+-//  right endpoints.
+-//
+-    yvala = d[n-1] / ( double ) ( n );
+-    for ( j = n - 2; 0 <= j; j-- )
+-    {
+-      yvala = yvala * x_min + d[j] / ( double ) ( j + 1 );
+-    }
+-    yvala = yvala * x_min;
+-
+-    yvalb = d[n-1] / ( double ) ( n );
+-    for ( j = n - 2; 0 <= j; j-- )
+-    {
+-      yvalb = yvalb * x_max + d[j] / ( double ) ( j + 1 );
+-    }
+-    yvalb = yvalb * x_max;
+-
+-    w[i] = yvalb - yvala;
+-  }
+-
+-  delete [] d;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double *nc_compute_new ( int n, double x_min, double x_max, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NC_COMPUTE_NEW computes a Newton-Cotes quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    For the interval [X_MIN,X_MAX], the Newton-Cotes quadrature rule
+-//    estimates
+-//
+-//      Integral ( X_MIN <= X <= X_MAX ) F(X) dX
+-//
+-//    using N abscissas X and weights W:
+-//
+-//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) ).
+-//
+-//    For the CLOSED rule, the abscissas include the end points.
+-//    For the OPEN rule, the abscissas do not include the end points.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 November 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Input, double X_MIN, X_MAX, the endpoints of the interval.
+-//
+-//    Input, double X[N], the abscissas.
+-//
+-//    Output, double NC_COMPUTE_NEW[N], the weights.
+-//
+-{
+-  double *d;
+-  int i;
+-  int j;
+-  int k;
+-  double *w;
+-  double yvala;
+-  double yvalb;
+-
+-  d = new double[n];
+-  w = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-//
+-//  Compute the Lagrange basis polynomial which is 1 at XTAB(I),
+-//  and zero at the other nodes.
+-//
+-    for ( j = 0; j < n; j++ )
+-    {
+-      d[j] = 0.0;
+-    }
+-    d[i] = 1.0;
+-
+-    for ( j = 2; j <= n; j++ )
+-    {
+-      for ( k = j; k <= n; k++ )
+-      {
+-        d[n+j-k-1] = ( d[n+j-k-1-1] - d[n+j-k-1] ) / ( x[n+1-k-1] - x[n+j-k-1] );
+-      }
+-    }
+-
+-    for ( j = 1; j <= n - 1; j++ )
+-    {
+-      for ( k = 1; k <= n - j; k++ )
+-      {
+-        d[n-k-1] = d[n-k-1] - x[n-k-j] * d[n-k];
+-      }
+-    }
+-//
+-//  Evaluate the antiderivative of the polynomial at the left and
+-//  right endpoints.
+-//
+-    yvala = d[n-1] / ( double ) ( n );
+-    for ( j = n - 2; 0 <= j; j-- )
+-    {
+-      yvala = yvala * x_min + d[j] / ( double ) ( j + 1 );
+-    }
+-    yvala = yvala * x_min;
+-
+-    yvalb = d[n-1] / ( double ) ( n );
+-    for ( j = n - 2; 0 <= j; j-- )
+-    {
+-      yvalb = yvalb * x_max + d[j] / ( double ) ( j + 1 );
+-    }
+-    yvalb = yvalb * x_max;
+-
+-    w[i] = yvalb - yvala;
+-  }
+-
+-  delete [] d;
+-
+-  return w;
+-}
+-//****************************************************************************80
+-
+-void ncc_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NCC_COMPUTE_POINTS: points of a Newton-Cotes Closed quadrature rule.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    16 November 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int i;
+-  double x_max = 1.0;
+-  double x_min = -1.0;
+-
+-  if ( n == 1 )
+-  {
+-    x[0] = ( x_max + x_min ) / 2.0;
+-  }
+-  else
+-  {
+-    for ( i = 0; i < n; i++ )
+-    {
+-      x[i] = ( ( double ) ( n - i - 1 ) * x_min
+-             + ( double ) (     i     ) * x_max )
+-             / ( double ) ( n     - 1 );
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ncc_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NCC_COMPUTE_WEIGHTS: weights of a Newton-Cotes Closed quadrature rule.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    16 November 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int i;
+-  double *x;
+-  double x_max = 1.0;
+-  double x_min = -1.0;
+-
+-  if ( n == 1 )
+-  {
+-    w[0] = x_max - x_min;
+-  }
+-  else
+-  {
+-    x = new double[n];
+-
+-    for ( i = 0; i < n; i++ )
+-    {
+-      x[i] = ( ( double ) ( n - i - 1 ) * x_min
+-             + ( double ) (     i     ) * x_max )
+-             / ( double ) ( n     - 1 );
+-    }
+-    webbur::nc_compute ( n, x_min, x_max, x, w );
+-
+-    delete [] x;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void nco_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NCO_COMPUTE_POINTS: points for a Newton-Cotes Open quadrature rule.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 November 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int i;
+-  double x_max = 1.0;
+-  double x_min = -1.0;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = ( ( double ) ( n - i     ) * x_min
+-           + ( double ) (   + i + 1 ) * x_max )
+-           / ( double ) ( n     + 1 );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void nco_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NCO_COMPUTE_WEIGHTS: weights for a Newton-Cotes Open quadrature rule.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 November 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int i;
+-  double *x;
+-  double x_max = 1.0;
+-  double x_min = -1.0;
+-
+-  x = new double[n];
+-
+-  webbur::nco_compute_points ( n, x );
+-
+-  webbur::nc_compute ( n, x_min, x_max, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ncoh_compute_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NCOH_COMPUTE_POINTS computes points for a Newton-Cotes "open half" quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The input value N is used to define N equal subintervals of [-1,+1].
+-//    The I-th abscissa is the center of the I-th subinterval.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    03 July 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  int i;
+-  const double x_max = 1.0;
+-  const double x_min = -1.0;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    x[i] = ( ( double ) ( 2 * n - 2 * i - 1 ) * x_min
+-           + ( double ) (         2 * i + 1 ) * x_max )
+-           / ( double ) ( 2 * n             );
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void ncoh_compute_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    NCOH_COMPUTE_WEIGHTS computes weights for a Newton-Cotes "open half" quadrature rule.
+-//
+-//  Discussion:
+-//
+-//    The input value N is used to define N equal subintervals of [-1,+1].
+-//    The I-th abscissa is the center of the I-th subinterval.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    03 July 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  int i;
+-  double *x;
+-  const double x_max = 1.0;
+-  const double x_min = -1.0;
+-
+-  x = new double[n];
+-
+-  webbur::ncoh_compute_points ( n, x );
+-
+-  webbur::nc_compute ( n, x_min, x_max, x, w );
+-
+-  delete [] x;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void patterson_lookup ( int n, double x[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    PATTERSON_LOOKUP looks up Patterson quadrature points and weights.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    The rule is defined on [-1,1],
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    11 February 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Prem Kythe, Michael Schaeferkotter,
+-//    Handbook of Computational Methods for Integration,
+-//    Chapman and Hall, 2004,
+-//    ISBN: 1-58488-428-2,
+-//    LC: QA299.3.K98.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  patterson_lookup_points ( n, x );
+-  patterson_lookup_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void patterson_lookup_points ( int n, double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    PATTERSON_LOOKUP_POINTS looks up Patterson quadrature points.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    The rule is defined on [-1,1],
+-//
+-//    These rules constitute a nested family.  The rules can integrate exactly
+-//    any polynomial of degree 1, 5, 11, 23, 47, 95, 191, 383 or 767,
+-//    respectively.
+-//
+-//    The data for N = 511 was supplied by Dirk Laurie, and is derived
+-//    from a NAG Library function d01arf.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    14 September 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Prem Kythe, Michael Schaeferkotter,
+-//    Handbook of Computational Methods for Integration,
+-//    Chapman and Hall, 2004,
+-//    ISBN: 1-58488-428-2,
+-//    LC: QA299.3.K98.
+-//
+-//    NAG Library Documentation,
+-//    D01ARF,
+-//    The Numerical Algorithms Group.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  static double x_001[1] =
+-  {
+-     0.0
+-  };
+-  static double x_003[3] =
+-  {
+-    -0.77459666924148337704,
+-     0.0,
+-     0.77459666924148337704
+-  };
+-  static double x_007[7] =
+-  {
+-    -0.96049126870802028342,
+-    -0.77459666924148337704,
+-    -0.43424374934680255800,
+-     0.0,
+-     0.43424374934680255800,
+-     0.77459666924148337704,
+-     0.96049126870802028342
+-  };
+-  static double x_015[15] =
+-  {
+-    -0.99383196321275502221,
+-    -0.96049126870802028342,
+-    -0.88845923287225699889,
+-    -0.77459666924148337704,
+-    -0.62110294673722640294,
+-    -0.43424374934680255800,
+-    -0.22338668642896688163,
+-     0.0,
+-     0.22338668642896688163,
+-     0.43424374934680255800,
+-     0.62110294673722640294,
+-     0.77459666924148337704,
+-     0.88845923287225699889,
+-     0.96049126870802028342,
+-     0.99383196321275502221
+-  };
+-  static double x_031[31] =
+-  {
+-    -0.99909812496766759766,
+-    -0.99383196321275502221,
+-    -0.98153114955374010687,
+-    -0.96049126870802028342,
+-    -0.92965485742974005667,
+-    -0.88845923287225699889,
+-    -0.83672593816886873550,
+-    -0.77459666924148337704,
+-    -0.70249620649152707861,
+-    -0.62110294673722640294,
+-    -0.53131974364437562397,
+-    -0.43424374934680255800,
+-    -0.33113539325797683309,
+-    -0.22338668642896688163,
+-    -0.11248894313318662575,
+-     0.0,
+-     0.11248894313318662575,
+-     0.22338668642896688163,
+-     0.33113539325797683309,
+-     0.43424374934680255800,
+-     0.53131974364437562397,
+-     0.62110294673722640294,
+-     0.70249620649152707861,
+-     0.77459666924148337704,
+-     0.83672593816886873550,
+-     0.88845923287225699889,
+-     0.92965485742974005667,
+-     0.96049126870802028342,
+-     0.98153114955374010687,
+-     0.99383196321275502221,
+-     0.99909812496766759766
+-  };
+-  static double x_063[63] =
+-  {
+-    -0.99987288812035761194,
+-    -0.99909812496766759766,
+-    -0.99720625937222195908,
+-    -0.99383196321275502221,
+-    -0.98868475754742947994,
+-    -0.98153114955374010687,
+-    -0.97218287474858179658,
+-    -0.96049126870802028342,
+-    -0.94634285837340290515,
+-    -0.92965485742974005667,
+-    -0.91037115695700429250,
+-    -0.88845923287225699889,
+-    -0.86390793819369047715,
+-    -0.83672593816886873550,
+-    -0.80694053195021761186,
+-    -0.77459666924148337704,
+-    -0.73975604435269475868,
+-    -0.70249620649152707861,
+-    -0.66290966002478059546,
+-    -0.62110294673722640294,
+-    -0.57719571005204581484,
+-    -0.53131974364437562397,
+-    -0.48361802694584102756,
+-    -0.43424374934680255800,
+-    -0.38335932419873034692,
+-    -0.33113539325797683309,
+-    -0.27774982202182431507,
+-    -0.22338668642896688163,
+-    -0.16823525155220746498,
+-    -0.11248894313318662575,
+-    -0.056344313046592789972,
+-     0.0,
+-     0.056344313046592789972,
+-     0.11248894313318662575,
+-     0.16823525155220746498,
+-     0.22338668642896688163,
+-     0.27774982202182431507,
+-     0.33113539325797683309,
+-     0.38335932419873034692,
+-     0.43424374934680255800,
+-     0.48361802694584102756,
+-     0.53131974364437562397,
+-     0.57719571005204581484,
+-     0.62110294673722640294,
+-     0.66290966002478059546,
+-     0.70249620649152707861,
+-     0.73975604435269475868,
+-     0.77459666924148337704,
+-     0.80694053195021761186,
+-     0.83672593816886873550,
+-     0.86390793819369047715,
+-     0.88845923287225699889,
+-     0.91037115695700429250,
+-     0.92965485742974005667,
+-     0.94634285837340290515,
+-     0.96049126870802028342,
+-     0.97218287474858179658,
+-     0.98153114955374010687,
+-     0.98868475754742947994,
+-     0.99383196321275502221,
+-     0.99720625937222195908,
+-     0.99909812496766759766,
+-     0.99987288812035761194
+-  };
+-  static double x_127[127] =
+-  {
+-    -0.99998243035489159858,
+-    -0.99987288812035761194,
+-    -0.99959879967191068325,
+-    -0.99909812496766759766,
+-    -0.99831663531840739253,
+-    -0.99720625937222195908,
+-    -0.99572410469840718851,
+-    -0.99383196321275502221,
+-    -0.99149572117810613240,
+-    -0.98868475754742947994,
+-    -0.98537149959852037111,
+-    -0.98153114955374010687,
+-    -0.97714151463970571416,
+-    -0.97218287474858179658,
+-    -0.96663785155841656709,
+-    -0.96049126870802028342,
+-    -0.95373000642576113641,
+-    -0.94634285837340290515,
+-    -0.93832039777959288365,
+-    -0.92965485742974005667,
+-    -0.92034002547001242073,
+-    -0.91037115695700429250,
+-    -0.89974489977694003664,
+-    -0.88845923287225699889,
+-    -0.87651341448470526974,
+-    -0.86390793819369047715,
+-    -0.85064449476835027976,
+-    -0.83672593816886873550,
+-    -0.82215625436498040737,
+-    -0.80694053195021761186,
+-    -0.79108493379984836143,
+-    -0.77459666924148337704,
+-    -0.75748396638051363793,
+-    -0.73975604435269475868,
+-    -0.72142308537009891548,
+-    -0.70249620649152707861,
+-    -0.68298743109107922809,
+-    -0.66290966002478059546,
+-    -0.64227664250975951377,
+-    -0.62110294673722640294,
+-    -0.59940393024224289297,
+-    -0.57719571005204581484,
+-    -0.55449513263193254887,
+-    -0.53131974364437562397,
+-    -0.50768775753371660215,
+-    -0.48361802694584102756,
+-    -0.45913001198983233287,
+-    -0.43424374934680255800,
+-    -0.40897982122988867241,
+-    -0.38335932419873034692,
+-    -0.35740383783153215238,
+-    -0.33113539325797683309,
+-    -0.30457644155671404334,
+-    -0.27774982202182431507,
+-    -0.25067873030348317661,
+-    -0.22338668642896688163,
+-    -0.19589750271110015392,
+-    -0.16823525155220746498,
+-    -0.14042423315256017459,
+-    -0.11248894313318662575,
+-    -0.084454040083710883710,
+-    -0.056344313046592789972,
+-    -0.028184648949745694339,
+-     0.0,
+-     0.028184648949745694339,
+-     0.056344313046592789972,
+-     0.084454040083710883710,
+-     0.11248894313318662575,
+-     0.14042423315256017459,
+-     0.16823525155220746498,
+-     0.19589750271110015392,
+-     0.22338668642896688163,
+-     0.25067873030348317661,
+-     0.27774982202182431507,
+-     0.30457644155671404334,
+-     0.33113539325797683309,
+-     0.35740383783153215238,
+-     0.38335932419873034692,
+-     0.40897982122988867241,
+-     0.43424374934680255800,
+-     0.45913001198983233287,
+-     0.48361802694584102756,
+-     0.50768775753371660215,
+-     0.53131974364437562397,
+-     0.55449513263193254887,
+-     0.57719571005204581484,
+-     0.59940393024224289297,
+-     0.62110294673722640294,
+-     0.64227664250975951377,
+-     0.66290966002478059546,
+-     0.68298743109107922809,
+-     0.70249620649152707861,
+-     0.72142308537009891548,
+-     0.73975604435269475868,
+-     0.75748396638051363793,
+-     0.77459666924148337704,
+-     0.79108493379984836143,
+-     0.80694053195021761186,
+-     0.82215625436498040737,
+-     0.83672593816886873550,
+-     0.85064449476835027976,
+-     0.86390793819369047715,
+-     0.87651341448470526974,
+-     0.88845923287225699889,
+-     0.89974489977694003664,
+-     0.91037115695700429250,
+-     0.92034002547001242073,
+-     0.92965485742974005667,
+-     0.93832039777959288365,
+-     0.94634285837340290515,
+-     0.95373000642576113641,
+-     0.96049126870802028342,
+-     0.96663785155841656709,
+-     0.97218287474858179658,
+-     0.97714151463970571416,
+-     0.98153114955374010687,
+-     0.98537149959852037111,
+-     0.98868475754742947994,
+-     0.99149572117810613240,
+-     0.99383196321275502221,
+-     0.99572410469840718851,
+-     0.99720625937222195908,
+-     0.99831663531840739253,
+-     0.99909812496766759766,
+-     0.99959879967191068325,
+-     0.99987288812035761194,
+-     0.99998243035489159858
+-  };
+-  static double x_255[255] =
+-  {
+-    -0.99999759637974846462,
+-    -0.99998243035489159858,
+-    -0.99994399620705437576,
+-    -0.99987288812035761194,
+-    -0.99976049092443204733,
+-    -0.99959879967191068325,
+-    -0.99938033802502358193,
+-    -0.99909812496766759766,
+-    -0.99874561446809511470,
+-    -0.99831663531840739253,
+-    -0.99780535449595727456,
+-    -0.99720625937222195908,
+-    -0.99651414591489027385,
+-    -0.99572410469840718851,
+-    -0.99483150280062100052,
+-    -0.99383196321275502221,
+-    -0.99272134428278861533,
+-    -0.99149572117810613240,
+-    -0.99015137040077015918,
+-    -0.98868475754742947994,
+-    -0.98709252795403406719,
+-    -0.98537149959852037111,
+-    -0.98351865757863272876,
+-    -0.98153114955374010687,
+-    -0.97940628167086268381,
+-    -0.97714151463970571416,
+-    -0.97473445975240266776,
+-    -0.97218287474858179658,
+-    -0.96948465950245923177,
+-    -0.96663785155841656709,
+-    -0.96364062156981213252,
+-    -0.96049126870802028342,
+-    -0.95718821610986096274,
+-    -0.95373000642576113641,
+-    -0.95011529752129487656,
+-    -0.94634285837340290515,
+-    -0.94241156519108305981,
+-    -0.93832039777959288365,
+-    -0.93406843615772578800,
+-    -0.92965485742974005667,
+-    -0.92507893290707565236,
+-    -0.92034002547001242073,
+-    -0.91543758715576504064,
+-    -0.91037115695700429250,
+-    -0.90514035881326159519,
+-    -0.89974489977694003664,
+-    -0.89418456833555902286,
+-    -0.88845923287225699889,
+-    -0.88256884024734190684,
+-    -0.87651341448470526974,
+-    -0.87029305554811390585,
+-    -0.86390793819369047715,
+-    -0.85735831088623215653,
+-    -0.85064449476835027976,
+-    -0.84376688267270860104,
+-    -0.83672593816886873550,
+-    -0.82952219463740140018,
+-    -0.82215625436498040737,
+-    -0.81462878765513741344,
+-    -0.80694053195021761186,
+-    -0.79909229096084140180,
+-    -0.79108493379984836143,
+-    -0.78291939411828301639,
+-    -0.77459666924148337704,
+-    -0.76611781930376009072,
+-    -0.75748396638051363793,
+-    -0.74869629361693660282,
+-    -0.73975604435269475868,
+-    -0.73066452124218126133,
+-    -0.72142308537009891548,
+-    -0.71203315536225203459,
+-    -0.70249620649152707861,
+-    -0.69281376977911470289,
+-    -0.68298743109107922809,
+-    -0.67301883023041847920,
+-    -0.66290966002478059546,
+-    -0.65266166541001749610,
+-    -0.64227664250975951377,
+-    -0.63175643771119423041,
+-    -0.62110294673722640294,
+-    -0.61031811371518640016,
+-    -0.59940393024224289297,
+-    -0.58836243444766254143,
+-    -0.57719571005204581484,
+-    -0.56590588542365442262,
+-    -0.55449513263193254887,
+-    -0.54296566649831149049,
+-    -0.53131974364437562397,
+-    -0.51955966153745702199,
+-    -0.50768775753371660215,
+-    -0.49570640791876146017,
+-    -0.48361802694584102756,
+-    -0.47142506587165887693,
+-    -0.45913001198983233287,
+-    -0.44673538766202847374,
+-    -0.43424374934680255800,
+-    -0.42165768662616330006,
+-    -0.40897982122988867241,
+-    -0.39621280605761593918,
+-    -0.38335932419873034692,
+-    -0.37042208795007823014,
+-    -0.35740383783153215238,
+-    -0.34430734159943802278,
+-    -0.33113539325797683309,
+-    -0.31789081206847668318,
+-    -0.30457644155671404334,
+-    -0.29119514851824668196,
+-    -0.27774982202182431507,
+-    -0.26424337241092676194,
+-    -0.25067873030348317661,
+-    -0.23705884558982972721,
+-    -0.22338668642896688163,
+-    -0.20966523824318119477,
+-    -0.19589750271110015392,
+-    -0.18208649675925219825,
+-    -0.16823525155220746498,
+-    -0.15434681148137810869,
+-    -0.14042423315256017459,
+-    -0.12647058437230196685,
+-    -0.11248894313318662575,
+-    -0.098482396598119202090,
+-    -0.084454040083710883710,
+-    -0.070406976042855179063,
+-    -0.056344313046592789972,
+-    -0.042269164765363603212,
+-    -0.028184648949745694339,
+-    -0.014093886410782462614,
+-    0.0,
+-    0.014093886410782462614,
+-    0.028184648949745694339,
+-    0.042269164765363603212,
+-    0.056344313046592789972,
+-    0.070406976042855179063,
+-    0.084454040083710883710,
+-    0.098482396598119202090,
+-    0.11248894313318662575,
+-    0.12647058437230196685,
+-    0.14042423315256017459,
+-    0.15434681148137810869,
+-    0.16823525155220746498,
+-    0.18208649675925219825,
+-    0.19589750271110015392,
+-    0.20966523824318119477,
+-    0.22338668642896688163,
+-    0.23705884558982972721,
+-    0.25067873030348317661,
+-    0.26424337241092676194,
+-    0.27774982202182431507,
+-    0.29119514851824668196,
+-    0.30457644155671404334,
+-    0.31789081206847668318,
+-    0.33113539325797683309,
+-    0.34430734159943802278,
+-    0.35740383783153215238,
+-    0.37042208795007823014,
+-    0.38335932419873034692,
+-    0.39621280605761593918,
+-    0.40897982122988867241,
+-    0.42165768662616330006,
+-    0.43424374934680255800,
+-    0.44673538766202847374,
+-    0.45913001198983233287,
+-    0.47142506587165887693,
+-    0.48361802694584102756,
+-    0.49570640791876146017,
+-    0.50768775753371660215,
+-    0.51955966153745702199,
+-    0.53131974364437562397,
+-    0.54296566649831149049,
+-    0.55449513263193254887,
+-    0.56590588542365442262,
+-    0.57719571005204581484,
+-    0.58836243444766254143,
+-    0.59940393024224289297,
+-    0.61031811371518640016,
+-    0.62110294673722640294,
+-    0.63175643771119423041,
+-    0.64227664250975951377,
+-    0.65266166541001749610,
+-    0.66290966002478059546,
+-    0.67301883023041847920,
+-    0.68298743109107922809,
+-    0.69281376977911470289,
+-    0.70249620649152707861,
+-    0.71203315536225203459,
+-    0.72142308537009891548,
+-    0.73066452124218126133,
+-    0.73975604435269475868,
+-    0.74869629361693660282,
+-    0.75748396638051363793,
+-    0.76611781930376009072,
+-    0.77459666924148337704,
+-    0.78291939411828301639,
+-    0.79108493379984836143,
+-    0.79909229096084140180,
+-    0.80694053195021761186,
+-    0.81462878765513741344,
+-    0.82215625436498040737,
+-    0.82952219463740140018,
+-    0.83672593816886873550,
+-    0.84376688267270860104,
+-    0.85064449476835027976,
+-    0.85735831088623215653,
+-    0.86390793819369047715,
+-    0.87029305554811390585,
+-    0.87651341448470526974,
+-    0.88256884024734190684,
+-    0.88845923287225699889,
+-    0.89418456833555902286,
+-    0.89974489977694003664,
+-    0.90514035881326159519,
+-    0.91037115695700429250,
+-    0.91543758715576504064,
+-    0.92034002547001242073,
+-    0.92507893290707565236,
+-    0.92965485742974005667,
+-    0.93406843615772578800,
+-    0.93832039777959288365,
+-    0.94241156519108305981,
+-    0.94634285837340290515,
+-    0.95011529752129487656,
+-    0.95373000642576113641,
+-    0.95718821610986096274,
+-    0.96049126870802028342,
+-    0.96364062156981213252,
+-    0.96663785155841656709,
+-    0.96948465950245923177,
+-    0.97218287474858179658,
+-    0.97473445975240266776,
+-    0.97714151463970571416,
+-    0.97940628167086268381,
+-    0.98153114955374010687,
+-    0.98351865757863272876,
+-    0.98537149959852037111,
+-    0.98709252795403406719,
+-    0.98868475754742947994,
+-    0.99015137040077015918,
+-    0.99149572117810613240,
+-    0.99272134428278861533,
+-    0.99383196321275502221,
+-    0.99483150280062100052,
+-    0.99572410469840718851,
+-    0.99651414591489027385,
+-    0.99720625937222195908,
+-    0.99780535449595727456,
+-    0.99831663531840739253,
+-    0.99874561446809511470,
+-    0.99909812496766759766,
+-    0.99938033802502358193,
+-    0.99959879967191068325,
+-    0.99976049092443204733,
+-    0.99987288812035761194,
+-    0.99994399620705437576,
+-    0.99998243035489159858,
+-    0.99999759637974846462
+-  };
+-  static double x_511[511] =
+-  {
+-    -0.999999672956734384381,
+-    -0.999997596379748464620,
+-    -0.999992298136257588028,
+-    -0.999982430354891598580,
+-    -0.999966730098486276883,
+-    -0.999943996207054375764,
+-    -0.999913081144678282800,
+-    -0.999872888120357611938,
+-    -0.999822363679787739196,
+-    -0.999760490924432047330,
+-    -0.999686286448317731776,
+-    -0.999598799671910683252,
+-    -0.999497112467187190535,
+-    -0.999380338025023581928,
+-    -0.999247618943342473599,
+-    -0.999098124967667597662,
+-    -0.998931050830810562236,
+-    -0.998745614468095114704,
+-    -0.998541055697167906027,
+-    -0.998316635318407392531,
+-    -0.998071634524930323302,
+-    -0.997805354495957274562,
+-    -0.997517116063472399965,
+-    -0.997206259372221959076,
+-    -0.996872143485260161299,
+-    -0.996514145914890273849,
+-    -0.996131662079315037786,
+-    -0.995724104698407188509,
+-    -0.995290903148810302261,
+-    -0.994831502800621000519,
+-    -0.994345364356723405931,
+-    -0.993831963212755022209,
+-    -0.993290788851684966211,
+-    -0.992721344282788615328,
+-    -0.992123145530863117683,
+-    -0.991495721178106132399,
+-    -0.990838611958294243677,
+-    -0.990151370400770159181,
+-    -0.989433560520240838716,
+-    -0.988684757547429479939,
+-    -0.987904547695124280467,
+-    -0.987092527954034067190,
+-    -0.986248305913007552681,
+-    -0.985371499598520371114,
+-    -0.984461737328814534596,
+-    -0.983518657578632728762,
+-    -0.982541908851080604251,
+-    -0.981531149553740106867,
+-    -0.980486047876721339416,
+-    -0.979406281670862683806,
+-    -0.978291538324758539526,
+-    -0.977141514639705714156,
+-    -0.975955916702011753129,
+-    -0.974734459752402667761,
+-    -0.973476868052506926773,
+-    -0.972182874748581796578,
+-    -0.970852221732792443256,
+-    -0.969484659502459231771,
+-    -0.968079947017759947964,
+-    -0.966637851558416567092,
+-    -0.965158148579915665979,
+-    -0.963640621569812132521,
+-    -0.962085061904651475741,
+-    -0.960491268708020283423,
+-    -0.958859048710200221356,
+-    -0.957188216109860962736,
+-    -0.955478592438183697574,
+-    -0.953730006425761136415,
+-    -0.951942293872573589498,
+-    -0.950115297521294876558,
+-    -0.948248866934137357063,
+-    -0.946342858373402905148,
+-    -0.944397134685866648591,
+-    -0.942411565191083059813,
+-    -0.940386025573669721370,
+-    -0.938320397779592883655,
+-    -0.936214569916450806625,
+-    -0.934068436157725787999,
+-    -0.931881896650953639345,
+-    -0.929654857429740056670,
+-    -0.927387230329536696843,
+-    -0.925078932907075652364,
+-    -0.922729888363349241523,
+-    -0.920340025470012420730,
+-    -0.917909278499077501636,
+-    -0.915437587155765040644,
+-    -0.912924896514370590080,
+-    -0.910371156957004292498,
+-    -0.907776324115058903624,
+-    -0.905140358813261595189,
+-    -0.902463227016165675048,
+-    -0.899744899776940036639,
+-    -0.896985353188316590376,
+-    -0.894184568335559022859,
+-    -0.891342531251319871666,
+-    -0.888459232872256998890,
+-    -0.885534668997285008926,
+-    -0.882568840247341906842,
+-    -0.879561752026556262568,
+-    -0.876513414484705269742,
+-    -0.873423842480859310192,
+-    -0.870293055548113905851,
+-    -0.867121077859315215614,
+-    -0.863907938193690477146,
+-    -0.860653669904299969802,
+-    -0.857358310886232156525,
+-    -0.854021903545468625813,
+-    -0.850644494768350279758,
+-    -0.847226135891580884381,
+-    -0.843766882672708601038,
+-    -0.840266795261030442350,
+-    -0.836725938168868735503,
+-    -0.833144380243172624728,
+-    -0.829522194637401400178,
+-    -0.825859458783650001088,
+-    -0.822156254364980407373,
+-    -0.818412667287925807395,
+-    -0.814628787655137413436,
+-    -0.810804709738146594361,
+-    -0.806940531950217611856,
+-    -0.803036356819268687782,
+-    -0.799092290960841401800,
+-    -0.795108445051100526780,
+-    -0.791084933799848361435,
+-    -0.787021875923539422170,
+-    -0.782919394118283016385,
+-    -0.778777615032822744702,
+-    -0.774596669241483377036,
+-    -0.770376691217076824278,
+-    -0.766117819303760090717,
+-    -0.761820195689839149173,
+-    -0.757483966380513637926,
+-    -0.753109281170558142523,
+-    -0.748696293616936602823,
+-    -0.744245161011347082309,
+-    -0.739756044352694758677,
+-    -0.735229108319491547663,
+-    -0.730664521242181261329,
+-    -0.726062455075389632685,
+-    -0.721423085370098915485,
+-    -0.716746591245747095767,
+-    -0.712033155362252034587,
+-    -0.707282963891961103412,
+-    -0.702496206491527078610,
+-    -0.697673076273711232906,
+-    -0.692813769779114702895,
+-    -0.687918486947839325756,
+-    -0.682987431091079228087,
+-    -0.678020808862644517838,
+-    -0.673018830230418479199,
+-    -0.667981708447749702165,
+-    -0.662909660024780595461,
+-    -0.657802904699713735422,
+-    -0.652661665410017496101,
+-    -0.647486168263572388782,
+-    -0.642276642509759513774,
+-    -0.637033320510492495071,
+-    -0.631756437711194230414,
+-    -0.626446232611719746542,
+-    -0.621102946737226402941,
+-    -0.615726824608992638014,
+-    -0.610318113715186400156,
+-    -0.604877064481584353319,
+-    -0.599403930242242892974,
+-    -0.593898967210121954393,
+-    -0.588362434447662541434,
+-    -0.582794593837318850840,
+-    -0.577195710052045814844,
+-    -0.571566050525742833992,
+-    -0.565905885423654422623,
+-    -0.560215487612728441818,
+-    -0.554495132631932548866,
+-    -0.548745098662529448608,
+-    -0.542965666498311490492,
+-    -0.537157119515795115982,
+-    -0.531319743644375623972,
+-    -0.525453827336442687395,
+-    -0.519559661537457021993,
+-    -0.513637539655988578507,
+-    -0.507687757533716602155,
+-    -0.501710613415391878251,
+-    -0.495706407918761460170,
+-    -0.489675444004456155436,
+-    -0.483618026945841027562,
+-    -0.477534464298829155284,
+-    -0.471425065871658876934,
+-    -0.465290143694634735858,
+-    -0.459130011989832332874,
+-    -0.452944987140767283784,
+-    -0.446735387662028473742,
+-    -0.440501534168875795783,
+-    -0.434243749346802558002,
+-    -0.427962357921062742583,
+-    -0.421657686626163300056,
+-    -0.415330064175321663764,
+-    -0.408979821229888672409,
+-    -0.402607290368737092671,
+-    -0.396212806057615939183,
+-    -0.389796704618470795479,
+-    -0.383359324198730346916,
+-    -0.376901004740559344802,
+-    -0.370422087950078230138,
+-    -0.363922917266549655269,
+-    -0.357403837831532152376,
+-    -0.350865196458001209011,
+-    -0.344307341599438022777,
+-    -0.337730623318886219621,
+-    -0.331135393257976833093,
+-    -0.324522004605921855207,
+-    -0.317890812068476683182,
+-    -0.311242171836871800300,
+-    -0.304576441556714043335,
+-    -0.297893980296857823437,
+-    -0.291195148518246681964,
+-    -0.284480308042725577496,
+-    -0.277749822021824315065,
+-    -0.271004054905512543536,
+-    -0.264243372410926761945,
+-    -0.257468141491069790481,
+-    -0.250678730303483176613,
+-    -0.243875508178893021593,
+-    -0.237058845589829727213,
+-    -0.230229114119222177156,
+-    -0.223386686428966881628,
+-    -0.216531936228472628081,
+-    -0.209665238243181194766,
+-    -0.202786968183064697557,
+-    -0.195897502711100153915,
+-    -0.188997219411721861059,
+-    -0.182086496759252198246,
+-    -0.175165714086311475707,
+-    -0.168235251552207464982,
+-    -0.161295490111305257361,
+-    -0.154346811481378108692,
+-    -0.147389598111939940054,
+-    -0.140424233152560174594,
+-    -0.133451100421161601344,
+-    -0.126470584372301966851,
+-    -0.119483070065440005133,
+-    -0.112488943133186625746,
+-    -0.105488589749541988533,
+-    -0.984823965981192020903E-01,
+-    -0.914707508403553909095E-01,
+-    -0.844540400837108837102E-01,
+-    -0.774326523498572825675E-01,
+-    -0.704069760428551790633E-01,
+-    -0.633773999173222898797E-01,
+-    -0.563443130465927899720E-01,
+-    -0.493081047908686267156E-01,
+-    -0.422691647653636032124E-01,
+-    -0.352278828084410232603E-01,
+-    -0.281846489497456943394E-01,
+-    -0.211398533783310883350E-01,
+-    -0.140938864107824626142E-01,
+-    -0.704713845933674648514E-02,
+-    +0.000000000000000000000,
+-    +0.704713845933674648514E-02,
+-    +0.140938864107824626142E-01,
+-    +0.211398533783310883350E-01,
+-    +0.281846489497456943394E-01,
+-    +0.352278828084410232603E-01,
+-    +0.422691647653636032124E-01,
+-    +0.493081047908686267156E-01,
+-    +0.563443130465927899720E-01,
+-    +0.633773999173222898797E-01,
+-    +0.704069760428551790633E-01,
+-    +0.774326523498572825675E-01,
+-    +0.844540400837108837102E-01,
+-    +0.914707508403553909095E-01,
+-    +0.984823965981192020903E-01,
+-    +0.105488589749541988533,
+-    +0.112488943133186625746,
+-    +0.119483070065440005133,
+-    +0.126470584372301966851,
+-    +0.133451100421161601344,
+-    +0.140424233152560174594,
+-    +0.147389598111939940054,
+-    +0.154346811481378108692,
+-    +0.161295490111305257361,
+-    +0.168235251552207464982,
+-    +0.175165714086311475707,
+-    +0.182086496759252198246,
+-    +0.188997219411721861059,
+-    +0.195897502711100153915,
+-    +0.202786968183064697557,
+-    +0.209665238243181194766,
+-    +0.216531936228472628081,
+-    +0.223386686428966881628,
+-    +0.230229114119222177156,
+-    +0.237058845589829727213,
+-    +0.243875508178893021593,
+-    +0.250678730303483176613,
+-    +0.257468141491069790481,
+-    +0.264243372410926761945,
+-    +0.271004054905512543536,
+-    +0.277749822021824315065,
+-    +0.284480308042725577496,
+-    +0.291195148518246681964,
+-    +0.297893980296857823437,
+-    +0.304576441556714043335,
+-    +0.311242171836871800300,
+-    +0.317890812068476683182,
+-    +0.324522004605921855207,
+-    +0.331135393257976833093,
+-    +0.337730623318886219621,
+-    +0.344307341599438022777,
+-    +0.350865196458001209011,
+-    +0.357403837831532152376,
+-    +0.363922917266549655269,
+-    +0.370422087950078230138,
+-    +0.376901004740559344802,
+-    +0.383359324198730346916,
+-    +0.389796704618470795479,
+-    +0.396212806057615939183,
+-    +0.402607290368737092671,
+-    +0.408979821229888672409,
+-    +0.415330064175321663764,
+-    +0.421657686626163300056,
+-    +0.427962357921062742583,
+-    +0.434243749346802558002,
+-    +0.440501534168875795783,
+-    +0.446735387662028473742,
+-    +0.452944987140767283784,
+-    +0.459130011989832332874,
+-    +0.465290143694634735858,
+-    +0.471425065871658876934,
+-    +0.477534464298829155284,
+-    +0.483618026945841027562,
+-    +0.489675444004456155436,
+-    +0.495706407918761460170,
+-    +0.501710613415391878251,
+-    +0.507687757533716602155,
+-    +0.513637539655988578507,
+-    +0.519559661537457021993,
+-    +0.525453827336442687395,
+-    +0.531319743644375623972,
+-    +0.537157119515795115982,
+-    +0.542965666498311490492,
+-    +0.548745098662529448608,
+-    +0.554495132631932548866,
+-    +0.560215487612728441818,
+-    +0.565905885423654422623,
+-    +0.571566050525742833992,
+-    +0.577195710052045814844,
+-    +0.582794593837318850840,
+-    +0.588362434447662541434,
+-    +0.593898967210121954393,
+-    +0.599403930242242892974,
+-    +0.604877064481584353319,
+-    +0.610318113715186400156,
+-    +0.615726824608992638014,
+-    +0.621102946737226402941,
+-    +0.626446232611719746542,
+-    +0.631756437711194230414,
+-    +0.637033320510492495071,
+-    +0.642276642509759513774,
+-    +0.647486168263572388782,
+-    +0.652661665410017496101,
+-    +0.657802904699713735422,
+-    +0.662909660024780595461,
+-    +0.667981708447749702165,
+-    +0.673018830230418479199,
+-    +0.678020808862644517838,
+-    +0.682987431091079228087,
+-    +0.687918486947839325756,
+-    +0.692813769779114702895,
+-    +0.697673076273711232906,
+-    +0.702496206491527078610,
+-    +0.707282963891961103412,
+-    +0.712033155362252034587,
+-    +0.716746591245747095767,
+-    +0.721423085370098915485,
+-    +0.726062455075389632685,
+-    +0.730664521242181261329,
+-    +0.735229108319491547663,
+-    +0.739756044352694758677,
+-    +0.744245161011347082309,
+-    +0.748696293616936602823,
+-    +0.753109281170558142523,
+-    +0.757483966380513637926,
+-    +0.761820195689839149173,
+-    +0.766117819303760090717,
+-    +0.770376691217076824278,
+-    +0.774596669241483377036,
+-    +0.778777615032822744702,
+-    +0.782919394118283016385,
+-    +0.787021875923539422170,
+-    +0.791084933799848361435,
+-    +0.795108445051100526780,
+-    +0.799092290960841401800,
+-    +0.803036356819268687782,
+-    +0.806940531950217611856,
+-    +0.810804709738146594361,
+-    +0.814628787655137413436,
+-    +0.818412667287925807395,
+-    +0.822156254364980407373,
+-    +0.825859458783650001088,
+-    +0.829522194637401400178,
+-    +0.833144380243172624728,
+-    +0.836725938168868735503,
+-    +0.840266795261030442350,
+-    +0.843766882672708601038,
+-    +0.847226135891580884381,
+-    +0.850644494768350279758,
+-    +0.854021903545468625813,
+-    +0.857358310886232156525,
+-    +0.860653669904299969802,
+-    +0.863907938193690477146,
+-    +0.867121077859315215614,
+-    +0.870293055548113905851,
+-    +0.873423842480859310192,
+-    +0.876513414484705269742,
+-    +0.879561752026556262568,
+-    +0.882568840247341906842,
+-    +0.885534668997285008926,
+-    +0.888459232872256998890,
+-    +0.891342531251319871666,
+-    +0.894184568335559022859,
+-    +0.896985353188316590376,
+-    +0.899744899776940036639,
+-    +0.902463227016165675048,
+-    +0.905140358813261595189,
+-    +0.907776324115058903624,
+-    +0.910371156957004292498,
+-    +0.912924896514370590080,
+-    +0.915437587155765040644,
+-    +0.917909278499077501636,
+-    +0.920340025470012420730,
+-    +0.922729888363349241523,
+-    +0.925078932907075652364,
+-    +0.927387230329536696843,
+-    +0.929654857429740056670,
+-    +0.931881896650953639345,
+-    +0.934068436157725787999,
+-    +0.936214569916450806625,
+-    +0.938320397779592883655,
+-    +0.940386025573669721370,
+-    +0.942411565191083059813,
+-    +0.944397134685866648591,
+-    +0.946342858373402905148,
+-    +0.948248866934137357063,
+-    +0.950115297521294876558,
+-    +0.951942293872573589498,
+-    +0.953730006425761136415,
+-    +0.955478592438183697574,
+-    +0.957188216109860962736,
+-    +0.958859048710200221356,
+-    +0.960491268708020283423,
+-    +0.962085061904651475741,
+-    +0.963640621569812132521,
+-    +0.965158148579915665979,
+-    +0.966637851558416567092,
+-    +0.968079947017759947964,
+-    +0.969484659502459231771,
+-    +0.970852221732792443256,
+-    +0.972182874748581796578,
+-    +0.973476868052506926773,
+-    +0.974734459752402667761,
+-    +0.975955916702011753129,
+-    +0.977141514639705714156,
+-    +0.978291538324758539526,
+-    +0.979406281670862683806,
+-    +0.980486047876721339416,
+-    +0.981531149553740106867,
+-    +0.982541908851080604251,
+-    +0.983518657578632728762,
+-    +0.984461737328814534596,
+-    +0.985371499598520371114,
+-    +0.986248305913007552681,
+-    +0.987092527954034067190,
+-    +0.987904547695124280467,
+-    +0.988684757547429479939,
+-    +0.989433560520240838716,
+-    +0.990151370400770159181,
+-    +0.990838611958294243677,
+-    +0.991495721178106132399,
+-    +0.992123145530863117683,
+-    +0.992721344282788615328,
+-    +0.993290788851684966211,
+-    +0.993831963212755022209,
+-    +0.994345364356723405931,
+-    +0.994831502800621000519,
+-    +0.995290903148810302261,
+-    +0.995724104698407188509,
+-    +0.996131662079315037786,
+-    +0.996514145914890273849,
+-    +0.996872143485260161299,
+-    +0.997206259372221959076,
+-    +0.997517116063472399965,
+-    +0.997805354495957274562,
+-    +0.998071634524930323302,
+-    +0.998316635318407392531,
+-    +0.998541055697167906027,
+-    +0.998745614468095114704,
+-    +0.998931050830810562236,
+-    +0.999098124967667597662,
+-    +0.999247618943342473599,
+-    +0.999380338025023581928,
+-    +0.999497112467187190535,
+-    +0.999598799671910683252,
+-    +0.999686286448317731776,
+-    +0.999760490924432047330,
+-    +0.999822363679787739196,
+-    +0.999872888120357611938,
+-    +0.999913081144678282800,
+-    +0.999943996207054375764,
+-    +0.999966730098486276883,
+-    +0.999982430354891598580,
+-    +0.999992298136257588028,
+-    +0.999997596379748464620,
+-    +0.999999672956734384381
+-  };
+-
+-  if ( n == 1 )
+-  {
+-    webbur::r8vec_copy ( n, x_001, x );
+-  }
+-  else if ( n == 3 )
+-  {
+-    webbur::r8vec_copy ( n, x_003, x );
+-  }
+-  else if ( n == 7 )
+-  {
+-    webbur::r8vec_copy ( n, x_007, x );
+-  }
+-  else if ( n == 15 )
+-  {
+-    webbur::r8vec_copy ( n, x_015, x );
+-  }
+-  else if ( n == 31 )
+-  {
+-    webbur::r8vec_copy ( n, x_031, x );
+-  }
+-  else if ( n == 63 )
+-  {
+-    webbur::r8vec_copy ( n, x_063, x );
+-  }
+-  else if ( n == 127 )
+-  {
+-    webbur::r8vec_copy ( n, x_127, x );
+-  }
+-  else if ( n == 255 )
+-  {
+-    webbur::r8vec_copy ( n, x_255, x );
+-  }
+-  else if ( n == 511 )
+-  {
+-    webbur::r8vec_copy ( n, x_511, x );
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "PATTERSON_LOOKUP_POINTS - Fatal error!\n";
+-    std::cerr << "  Unexpected value of N = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void patterson_lookup_points_np ( int n, int np, double p[], double x[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    PATTERSON_LOOKUP_POINTS_NP looks up Patterson quadrature points.
+-//
+-//  Discussion:
+-//
+-//    Our convention is that the abscissas are numbered from left to right.
+-//
+-//    The rule is defined on [-1,1],
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 December 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Prem Kythe, Michael Schaeferkotter,
+-//    Handbook of Computational Methods for Integration,
+-//    Chapman and Hall, 2004,
+-//    ISBN: 1-58488-428-2,
+-//    LC: QA299.3.K98.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double X[N], the abscissas.
+-//
+-{
+-  patterson_lookup_points ( n, x );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void patterson_lookup_weights ( int n, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    PATTERSON_LOOKUP_WEIGHTS looks up Patterson quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    The allowed orders are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+-//
+-//    The weights are positive, symmetric and should sum to 2.
+-//
+-//    The user must preallocate space for the output array W.
+-//
+-//    These rules constitute a nested family.  The rules can integrate exactly
+-//    any polynomial of degree 1, 5, 11, 23, 47, 95, 191, 383 or 767,
+-//    respectively.
+-//
+-//    The data for N = 511 was supplied by Dirk Laurie, and is derived
+-//    from a NAG Library function d01arf.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    14 September 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Prem Kythe, Michael Schaeferkotter,
+-//    Handbook of Computational Methods for Integration,
+-//    Chapman and Hall, 2004,
+-//    ISBN: 1-58488-428-2,
+-//    LC: QA299.3.K98.
+-//
+-//    NAG Library Documentation,
+-//    D01ARF,
+-//    The Numerical Algorithms Group.
+-//
+-//    Thomas Patterson,
+-//    The Optimal Addition of Points to Quadrature Formulae,
+-//    Mathematics of Computation,
+-//    Volume 22, Number 104, October 1968, pages 847-856.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 or 511.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  static double w_001[1] =
+-  {
+-    2.0
+-  };
+-  static double w_003[3] =
+-  {
+-    0.555555555555555555556,
+-    0.888888888888888888889,
+-    0.555555555555555555556
+-  };
+-  static double w_007[7] =
+-  {
+-    0.104656226026467265194,
+-    0.268488089868333440729,
+-    0.401397414775962222905,
+-    0.450916538658474142345,
+-    0.401397414775962222905,
+-    0.268488089868333440729,
+-    0.104656226026467265194
+-  };
+-  static double w_015[15] =
+-  {
+-    0.0170017196299402603390,
+-    0.0516032829970797396969,
+-    0.0929271953151245376859,
+-    0.134415255243784220360,
+-    0.171511909136391380787,
+-    0.200628529376989021034,
+-    0.219156858401587496404,
+-    0.225510499798206687386,
+-    0.219156858401587496404,
+-    0.200628529376989021034,
+-    0.171511909136391380787,
+-    0.134415255243784220360,
+-    0.0929271953151245376859,
+-    0.0516032829970797396969,
+-    0.0170017196299402603390
+-  };
+-  static double w_031[31] =
+-  {
+-    0.00254478079156187441540,
+-    0.00843456573932110624631,
+-    0.0164460498543878109338,
+-    0.0258075980961766535646,
+-    0.0359571033071293220968,
+-    0.0464628932617579865414,
+-    0.0569795094941233574122,
+-    0.0672077542959907035404,
+-    0.0768796204990035310427,
+-    0.0857559200499903511542,
+-    0.0936271099812644736167,
+-    0.100314278611795578771,
+-    0.105669893580234809744,
+-    0.109578421055924638237,
+-    0.111956873020953456880,
+-    0.112755256720768691607,
+-    0.111956873020953456880,
+-    0.109578421055924638237,
+-    0.105669893580234809744,
+-    0.100314278611795578771,
+-    0.0936271099812644736167,
+-    0.0857559200499903511542,
+-    0.0768796204990035310427,
+-    0.0672077542959907035404,
+-    0.0569795094941233574122,
+-    0.0464628932617579865414,
+-    0.0359571033071293220968,
+-    0.0258075980961766535646,
+-    0.0164460498543878109338,
+-    0.00843456573932110624631,
+-    0.00254478079156187441540
+-  };
+-  static double w_063[63] =
+-  {
+-    0.000363221481845530659694,
+-    0.00126515655623006801137,
+-    0.00257904979468568827243,
+-    0.00421763044155885483908,
+-    0.00611550682211724633968,
+-    0.00822300795723592966926,
+-    0.0104982469096213218983,
+-    0.0129038001003512656260,
+-    0.0154067504665594978021,
+-    0.0179785515681282703329,
+-    0.0205942339159127111492,
+-    0.0232314466399102694433,
+-    0.0258696793272147469108,
+-    0.0284897547458335486125,
+-    0.0310735511116879648799,
+-    0.0336038771482077305417,
+-    0.0360644327807825726401,
+-    0.0384398102494555320386,
+-    0.0407155101169443189339,
+-    0.0428779600250077344929,
+-    0.0449145316536321974143,
+-    0.0468135549906280124026,
+-    0.0485643304066731987159,
+-    0.0501571393058995374137,
+-    0.0515832539520484587768,
+-    0.0528349467901165198621,
+-    0.0539054993352660639269,
+-    0.0547892105279628650322,
+-    0.0554814043565593639878,
+-    0.0559784365104763194076,
+-    0.0562776998312543012726,
+-    0.0563776283603847173877,
+-    0.0562776998312543012726,
+-    0.0559784365104763194076,
+-    0.0554814043565593639878,
+-    0.0547892105279628650322,
+-    0.0539054993352660639269,
+-    0.0528349467901165198621,
+-    0.0515832539520484587768,
+-    0.0501571393058995374137,
+-    0.0485643304066731987159,
+-    0.0468135549906280124026,
+-    0.0449145316536321974143,
+-    0.0428779600250077344929,
+-    0.0407155101169443189339,
+-    0.0384398102494555320386,
+-    0.0360644327807825726401,
+-    0.0336038771482077305417,
+-    0.0310735511116879648799,
+-    0.0284897547458335486125,
+-    0.0258696793272147469108,
+-    0.0232314466399102694433,
+-    0.0205942339159127111492,
+-    0.0179785515681282703329,
+-    0.0154067504665594978021,
+-    0.0129038001003512656260,
+-    0.0104982469096213218983,
+-    0.00822300795723592966926,
+-    0.00611550682211724633968,
+-    0.00421763044155885483908,
+-    0.00257904979468568827243,
+-    0.00126515655623006801137,
+-    0.000363221481845530659694
+-  };
+-  static double w_127[127] =
+-  {
+-    0.0000505360952078625176247,
+-    0.000180739564445388357820,
+-    0.000377746646326984660274,
+-    0.000632607319362633544219,
+-    0.000938369848542381500794,
+-    0.00128952408261041739210,
+-    0.00168114286542146990631,
+-    0.00210881524572663287933,
+-    0.00256876494379402037313,
+-    0.00305775341017553113613,
+-    0.00357289278351729964938,
+-    0.00411150397865469304717,
+-    0.00467105037211432174741,
+-    0.00524912345480885912513,
+-    0.00584344987583563950756,
+-    0.00645190005017573692280,
+-    0.00707248999543355546805,
+-    0.00770337523327974184817,
+-    0.00834283875396815770558,
+-    0.00898927578406413572328,
+-    0.00964117772970253669530,
+-    0.0102971169579563555237,
+-    0.0109557333878379016480,
+-    0.0116157233199551347270,
+-    0.0122758305600827700870,
+-    0.0129348396636073734547,
+-    0.0135915710097655467896,
+-    0.0142448773729167743063,
+-    0.0148936416648151820348,
+-    0.0155367755558439824399,
+-    0.0161732187295777199419,
+-    0.0168019385741038652709,
+-    0.0174219301594641737472,
+-    0.0180322163903912863201,
+-    0.0186318482561387901863,
+-    0.0192199051247277660193,
+-    0.0197954950480974994880,
+-    0.0203577550584721594669,
+-    0.0209058514458120238522,
+-    0.0214389800125038672465,
+-    0.0219563663053178249393,
+-    0.0224572658268160987071,
+-    0.0229409642293877487608,
+-    0.0234067774953140062013,
+-    0.0238540521060385400804,
+-    0.0242821652033365993580,
+-    0.0246905247444876769091,
+-    0.0250785696529497687068,
+-    0.0254457699654647658126,
+-    0.0257916269760242293884,
+-    0.0261156733767060976805,
+-    0.0264174733950582599310,
+-    0.0266966229274503599062,
+-    0.0269527496676330319634,
+-    0.0271855132296247918192,
+-    0.0273946052639814325161,
+-    0.0275797495664818730349,
+-    0.0277407021782796819939,
+-    0.0278772514766137016085,
+-    0.0279892182552381597038,
+-    0.0280764557938172466068,
+-    0.0281388499156271506363,
+-    0.0281763190330166021307,
+-    0.0281888141801923586938,
+-    0.0281763190330166021307,
+-    0.0281388499156271506363,
+-    0.0280764557938172466068,
+-    0.0279892182552381597038,
+-    0.0278772514766137016085,
+-    0.0277407021782796819939,
+-    0.0275797495664818730349,
+-    0.0273946052639814325161,
+-    0.0271855132296247918192,
+-    0.0269527496676330319634,
+-    0.0266966229274503599062,
+-    0.0264174733950582599310,
+-    0.0261156733767060976805,
+-    0.0257916269760242293884,
+-    0.0254457699654647658126,
+-    0.0250785696529497687068,
+-    0.0246905247444876769091,
+-    0.0242821652033365993580,
+-    0.0238540521060385400804,
+-    0.0234067774953140062013,
+-    0.0229409642293877487608,
+-    0.0224572658268160987071,
+-    0.0219563663053178249393,
+-    0.0214389800125038672465,
+-    0.0209058514458120238522,
+-    0.0203577550584721594669,
+-    0.0197954950480974994880,
+-    0.0192199051247277660193,
+-    0.0186318482561387901863,
+-    0.0180322163903912863201,
+-    0.0174219301594641737472,
+-    0.0168019385741038652709,
+-    0.0161732187295777199419,
+-    0.0155367755558439824399,
+-    0.0148936416648151820348,
+-    0.0142448773729167743063,
+-    0.0135915710097655467896,
+-    0.0129348396636073734547,
+-    0.0122758305600827700870,
+-    0.0116157233199551347270,
+-    0.0109557333878379016480,
+-    0.0102971169579563555237,
+-    0.00964117772970253669530,
+-    0.00898927578406413572328,
+-    0.00834283875396815770558,
+-    0.00770337523327974184817,
+-    0.00707248999543355546805,
+-    0.00645190005017573692280,
+-    0.00584344987583563950756,
+-    0.00524912345480885912513,
+-    0.00467105037211432174741,
+-    0.00411150397865469304717,
+-    0.00357289278351729964938,
+-    0.00305775341017553113613,
+-    0.00256876494379402037313,
+-    0.00210881524572663287933,
+-    0.00168114286542146990631,
+-    0.00128952408261041739210,
+-    0.000938369848542381500794,
+-    0.000632607319362633544219,
+-    0.000377746646326984660274,
+-    0.000180739564445388357820,
+-    0.0000505360952078625176247
+-  };
+-  static double w_255[255] =
+-  {
+-    0.69379364324108267170E-05,
+-    0.25157870384280661489E-04,
+-    0.53275293669780613125E-04,
+-    0.90372734658751149261E-04,
+-    0.13575491094922871973E-03,
+-    0.18887326450650491366E-03,
+-    0.24921240048299729402E-03,
+-    0.31630366082226447689E-03,
+-    0.38974528447328229322E-03,
+-    0.46918492424785040975E-03,
+-    0.55429531493037471492E-03,
+-    0.64476204130572477933E-03,
+-    0.74028280424450333046E-03,
+-    0.84057143271072246365E-03,
+-    0.94536151685852538246E-03,
+-    0.10544076228633167722E-02,
+-    0.11674841174299594077E-02,
+-    0.12843824718970101768E-02,
+-    0.14049079956551446427E-02,
+-    0.15288767050877655684E-02,
+-    0.16561127281544526052E-02,
+-    0.17864463917586498247E-02,
+-    0.19197129710138724125E-02,
+-    0.20557519893273465236E-02,
+-    0.21944069253638388388E-02,
+-    0.23355251860571608737E-02,
+-    0.24789582266575679307E-02,
+-    0.26245617274044295626E-02,
+-    0.27721957645934509940E-02,
+-    0.29217249379178197538E-02,
+-    0.30730184347025783234E-02,
+-    0.32259500250878684614E-02,
+-    0.33803979910869203823E-02,
+-    0.35362449977167777340E-02,
+-    0.36933779170256508183E-02,
+-    0.38516876166398709241E-02,
+-    0.40110687240750233989E-02,
+-    0.41714193769840788528E-02,
+-    0.43326409680929828545E-02,
+-    0.44946378920320678616E-02,
+-    0.46573172997568547773E-02,
+-    0.48205888648512683476E-02,
+-    0.49843645647655386012E-02,
+-    0.51485584789781777618E-02,
+-    0.53130866051870565663E-02,
+-    0.54778666939189508240E-02,
+-    0.56428181013844441585E-02,
+-    0.58078616599775673635E-02,
+-    0.59729195655081658049E-02,
+-    0.61379152800413850435E-02,
+-    0.63027734490857587172E-02,
+-    0.64674198318036867274E-02,
+-    0.66317812429018878941E-02,
+-    0.67957855048827733948E-02,
+-    0.69593614093904229394E-02,
+-    0.71224386864583871532E-02,
+-    0.72849479805538070639E-02,
+-    0.74468208324075910174E-02,
+-    0.76079896657190565832E-02,
+-    0.77683877779219912200E-02,
+-    0.79279493342948491103E-02,
+-    0.80866093647888599710E-02,
+-    0.82443037630328680306E-02,
+-    0.84009692870519326354E-02,
+-    0.85565435613076896192E-02,
+-    0.87109650797320868736E-02,
+-    0.88641732094824942641E-02,
+-    0.90161081951956431600E-02,
+-    0.91667111635607884067E-02,
+-    0.93159241280693950932E-02,
+-    0.94636899938300652943E-02,
+-    0.96099525623638830097E-02,
+-    0.97546565363174114611E-02,
+-    0.98977475240487497440E-02,
+-    0.10039172044056840798E-01,
+-    0.10178877529236079733E-01,
+-    0.10316812330947621682E-01,
+-    0.10452925722906011926E-01,
+-    0.10587167904885197931E-01,
+-    0.10719490006251933623E-01,
+-    0.10849844089337314099E-01,
+-    0.10978183152658912470E-01,
+-    0.11104461134006926537E-01,
+-    0.11228632913408049354E-01,
+-    0.11350654315980596602E-01,
+-    0.11470482114693874380E-01,
+-    0.11588074033043952568E-01,
+-    0.11703388747657003101E-01,
+-    0.11816385890830235763E-01,
+-    0.11927026053019270040E-01,
+-    0.12035270785279562630E-01,
+-    0.12141082601668299679E-01,
+-    0.12244424981611985899E-01,
+-    0.12345262372243838455E-01,
+-    0.12443560190714035263E-01,
+-    0.12539284826474884353E-01,
+-    0.12632403643542078765E-01,
+-    0.12722884982732382906E-01,
+-    0.12810698163877361967E-01,
+-    0.12895813488012114694E-01,
+-    0.12978202239537399286E-01,
+-    0.13057836688353048840E-01,
+-    0.13134690091960152836E-01,
+-    0.13208736697529129966E-01,
+-    0.13279951743930530650E-01,
+-    0.13348311463725179953E-01,
+-    0.13413793085110098513E-01,
+-    0.13476374833816515982E-01,
+-    0.13536035934956213614E-01,
+-    0.13592756614812395910E-01,
+-    0.13646518102571291428E-01,
+-    0.13697302631990716258E-01,
+-    0.13745093443001896632E-01,
+-    0.13789874783240936517E-01,
+-    0.13831631909506428676E-01,
+-    0.13870351089139840997E-01,
+-    0.13906019601325461264E-01,
+-    0.13938625738306850804E-01,
+-    0.13968158806516938516E-01,
+-    0.13994609127619079852E-01,
+-    0.14017968039456608810E-01,
+-    0.14038227896908623303E-01,
+-    0.14055382072649964277E-01,
+-    0.14069424957813575318E-01,
+-    0.14080351962553661325E-01,
+-    0.14088159516508301065E-01,
+-    0.14092845069160408355E-01,
+-    0.14094407090096179347E-01,
+-    0.14092845069160408355E-01,
+-    0.14088159516508301065E-01,
+-    0.14080351962553661325E-01,
+-    0.14069424957813575318E-01,
+-    0.14055382072649964277E-01,
+-    0.14038227896908623303E-01,
+-    0.14017968039456608810E-01,
+-    0.13994609127619079852E-01,
+-    0.13968158806516938516E-01,
+-    0.13938625738306850804E-01,
+-    0.13906019601325461264E-01,
+-    0.13870351089139840997E-01,
+-    0.13831631909506428676E-01,
+-    0.13789874783240936517E-01,
+-    0.13745093443001896632E-01,
+-    0.13697302631990716258E-01,
+-    0.13646518102571291428E-01,
+-    0.13592756614812395910E-01,
+-    0.13536035934956213614E-01,
+-    0.13476374833816515982E-01,
+-    0.13413793085110098513E-01,
+-    0.13348311463725179953E-01,
+-    0.13279951743930530650E-01,
+-    0.13208736697529129966E-01,
+-    0.13134690091960152836E-01,
+-    0.13057836688353048840E-01,
+-    0.12978202239537399286E-01,
+-    0.12895813488012114694E-01,
+-    0.12810698163877361967E-01,
+-    0.12722884982732382906E-01,
+-    0.12632403643542078765E-01,
+-    0.12539284826474884353E-01,
+-    0.12443560190714035263E-01,
+-    0.12345262372243838455E-01,
+-    0.12244424981611985899E-01,
+-    0.12141082601668299679E-01,
+-    0.12035270785279562630E-01,
+-    0.11927026053019270040E-01,
+-    0.11816385890830235763E-01,
+-    0.11703388747657003101E-01,
+-    0.11588074033043952568E-01,
+-    0.11470482114693874380E-01,
+-    0.11350654315980596602E-01,
+-    0.11228632913408049354E-01,
+-    0.11104461134006926537E-01,
+-    0.10978183152658912470E-01,
+-    0.10849844089337314099E-01,
+-    0.10719490006251933623E-01,
+-    0.10587167904885197931E-01,
+-    0.10452925722906011926E-01,
+-    0.10316812330947621682E-01,
+-    0.10178877529236079733E-01,
+-    0.10039172044056840798E-01,
+-    0.98977475240487497440E-02,
+-    0.97546565363174114611E-02,
+-    0.96099525623638830097E-02,
+-    0.94636899938300652943E-02,
+-    0.93159241280693950932E-02,
+-    0.91667111635607884067E-02,
+-    0.90161081951956431600E-02,
+-    0.88641732094824942641E-02,
+-    0.87109650797320868736E-02,
+-    0.85565435613076896192E-02,
+-    0.84009692870519326354E-02,
+-    0.82443037630328680306E-02,
+-    0.80866093647888599710E-02,
+-    0.79279493342948491103E-02,
+-    0.77683877779219912200E-02,
+-    0.76079896657190565832E-02,
+-    0.74468208324075910174E-02,
+-    0.72849479805538070639E-02,
+-    0.71224386864583871532E-02,
+-    0.69593614093904229394E-02,
+-    0.67957855048827733948E-02,
+-    0.66317812429018878941E-02,
+-    0.64674198318036867274E-02,
+-    0.63027734490857587172E-02,
+-    0.61379152800413850435E-02,
+-    0.59729195655081658049E-02,
+-    0.58078616599775673635E-02,
+-    0.56428181013844441585E-02,
+-    0.54778666939189508240E-02,
+-    0.53130866051870565663E-02,
+-    0.51485584789781777618E-02,
+-    0.49843645647655386012E-02,
+-    0.48205888648512683476E-02,
+-    0.46573172997568547773E-02,
+-    0.44946378920320678616E-02,
+-    0.43326409680929828545E-02,
+-    0.41714193769840788528E-02,
+-    0.40110687240750233989E-02,
+-    0.38516876166398709241E-02,
+-    0.36933779170256508183E-02,
+-    0.35362449977167777340E-02,
+-    0.33803979910869203823E-02,
+-    0.32259500250878684614E-02,
+-    0.30730184347025783234E-02,
+-    0.29217249379178197538E-02,
+-    0.27721957645934509940E-02,
+-    0.26245617274044295626E-02,
+-    0.24789582266575679307E-02,
+-    0.23355251860571608737E-02,
+-    0.21944069253638388388E-02,
+-    0.20557519893273465236E-02,
+-    0.19197129710138724125E-02,
+-    0.17864463917586498247E-02,
+-    0.16561127281544526052E-02,
+-    0.15288767050877655684E-02,
+-    0.14049079956551446427E-02,
+-    0.12843824718970101768E-02,
+-    0.11674841174299594077E-02,
+-    0.10544076228633167722E-02,
+-    0.94536151685852538246E-03,
+-    0.84057143271072246365E-03,
+-    0.74028280424450333046E-03,
+-    0.64476204130572477933E-03,
+-    0.55429531493037471492E-03,
+-    0.46918492424785040975E-03,
+-    0.38974528447328229322E-03,
+-    0.31630366082226447689E-03,
+-    0.24921240048299729402E-03,
+-    0.18887326450650491366E-03,
+-    0.13575491094922871973E-03,
+-    0.90372734658751149261E-04,
+-    0.53275293669780613125E-04,
+-    0.25157870384280661489E-04,
+-    0.69379364324108267170E-05
+-  };
+-  static double w_511[511] =
+-  {
+-    0.945715933950007048827E-06,
+-    0.345456507169149134898E-05,
+-    0.736624069102321668857E-05,
+-    0.125792781889592743525E-04,
+-    0.190213681905875816679E-04,
+-    0.266376412339000901358E-04,
+-    0.353751372055189588628E-04,
+-    0.451863674126296143105E-04,
+-    0.560319507856164252140E-04,
+-    0.678774554733972416227E-04,
+-    0.806899228014035293851E-04,
+-    0.944366322532705527066E-04,
+-    0.109085545645741522051E-03,
+-    0.124606200241498368482E-03,
+-    0.140970302204104791413E-03,
+-    0.158151830411132242924E-03,
+-    0.176126765545083195474E-03,
+-    0.194872642236641146532E-03,
+-    0.214368090034216937149E-03,
+-    0.234592462123925204879E-03,
+-    0.255525589595236862014E-03,
+-    0.277147657465187357459E-03,
+-    0.299439176850911730874E-03,
+-    0.322381020652862389664E-03,
+-    0.345954492129903871350E-03,
+-    0.370141402122251665232E-03,
+-    0.394924138246873704434E-03,
+-    0.420285716355361231823E-03,
+-    0.446209810101403247488E-03,
+-    0.472680758429262691232E-03,
+-    0.499683553312800484519E-03,
+-    0.527203811431658386125E-03,
+-    0.555227733977307579715E-03,
+-    0.583742058714979703847E-03,
+-    0.612734008012225209294E-03,
+-    0.642191235948505088403E-03,
+-    0.672101776960108194646E-03,
+-    0.702453997827572321358E-03,
+-    0.733236554224767912055E-03,
+-    0.764438352543882784191E-03,
+-    0.796048517297550871506E-03,
+-    0.828056364077226302608E-03,
+-    0.860451377808527848128E-03,
+-    0.893223195879324912340E-03,
+-    0.926361595613111283368E-03,
+-    0.959856485506936206261E-03,
+-    0.993697899638760857945E-03,
+-    0.102787599466367326179E-02,
+-    0.106238104885340071375E-02,
+-    0.109720346268191941940E-02,
+-    0.113233376051597664917E-02,
+-    0.116776259302858043685E-02,
+-    0.120348074001265964881E-02,
+-    0.123947911332878396534E-02,
+-    0.127574875977346947345E-02,
+-    0.131228086370221478128E-02,
+-    0.134906674928353113127E-02,
+-    0.138609788229672549700E-02,
+-    0.142336587141720519900E-02,
+-    0.146086246895890987689E-02,
+-    0.149857957106456636214E-02,
+-    0.153650921735128916170E-02,
+-    0.157464359003212166189E-02,
+-    0.161297501254393423070E-02,
+-    0.165149594771914570655E-02,
+-    0.169019899554346019117E-02,
+-    0.172907689054461607168E-02,
+-    0.176812249885838886701E-02,
+-    0.180732881501808930079E-02,
+-    0.184668895851282540913E-02,
+-    0.188619617015808475394E-02,
+-    0.192584380831993546204E-02,
+-    0.196562534503150547732E-02,
+-    0.200553436203751169944E-02,
+-    0.204556454679958293446E-02,
+-    0.208570968849203942640E-02,
+-    0.212596367401472533045E-02,
+-    0.216632048404649142727E-02,
+-    0.220677418916003329194E-02,
+-    0.224731894601603393082E-02,
+-    0.228794899365195972378E-02,
+-    0.232865864987842738864E-02,
+-    0.236944230779380495146E-02,
+-    0.241029443242563417382E-02,
+-    0.245120955750556483923E-02,
+-    0.249218228238276930060E-02,
+-    0.253320726907925325750E-02,
+-    0.257427923948908888092E-02,
+-    0.261539297272236109225E-02,
+-    0.265654330259352828314E-02,
+-    0.269772511525294586667E-02,
+-    0.273893334695947541201E-02,
+-    0.278016298199139435045E-02,
+-    0.282140905069222207923E-02,
+-    0.286266662764757868253E-02,
+-    0.290393082998878368175E-02,
+-    0.294519681581857582284E-02,
+-    0.298645978275408290247E-02,
+-    0.302771496658198544480E-02,
+-    0.306895764002069252174E-02,
+-    0.311018311158427546158E-02,
+-    0.315138672454287935858E-02,
+-    0.319256385597434736790E-02,
+-    0.323370991590184336368E-02,
+-    0.327482034651233969564E-02,
+-    0.331589062145094394706E-02,
+-    0.335691624518616761342E-02,
+-    0.339789275244138669739E-02,
+-    0.343881570768790591876E-02,
+-    0.347968070469521146972E-02,
+-    0.352048336613417922682E-02,
+-    0.356121934322919357659E-02,
+-    0.360188431545532431869E-02,
+-    0.364247399027690353194E-02,
+-    0.368298410292403911967E-02,
+-    0.372341041620379550870E-02,
+-    0.376374872034296338241E-02,
+-    0.380399483285952829161E-02,
+-    0.384414459846013158917E-02,
+-    0.388419388896099560998E-02,
+-    0.392413860322995774660E-02,
+-    0.396397466714742455513E-02,
+-    0.400369803358421688562E-02,
+-    0.404330468239442998549E-02,
+-    0.408279062042157838350E-02,
+-    0.412215188151643401528E-02,
+-    0.416138452656509745764E-02,
+-    0.420048464352596631772E-02,
+-    0.423944834747438184434E-02,
+-    0.427827178065384480959E-02,
+-    0.431695111253279479928E-02,
+-    0.435548253986604343679E-02,
+-    0.439386228676004195260E-02,
+-    0.443208660474124713206E-02,
+-    0.447015177282692726900E-02,
+-    0.450805409759782158001E-02,
+-    0.454578991327213285488E-02,
+-    0.458335558178039420335E-02,
+-    0.462074749284080687482E-02,
+-    0.465796206403469754658E-02,
+-    0.469499574088179046532E-02,
+-    0.473184499691503264714E-02,
+-    0.476850633375474925263E-02,
+-    0.480497628118194150483E-02,
+-    0.484125139721057135214E-02,
+-    0.487732826815870573054E-02,
+-    0.491320350871841897367E-02,
+-    0.494887376202437487201E-02,
+-    0.498433569972103029914E-02,
+-    0.501958602202842039909E-02,
+-    0.505462145780650125058E-02,
+-    0.508943876461803986674E-02,
+-    0.512403472879005351831E-02,
+-    0.515840616547381084096E-02,
+-    0.519254991870341614863E-02,
+-    0.522646286145300596306E-02,
+-    0.526014189569259311205E-02,
+-    0.529358395244259896547E-02,
+-    0.532678599182711857974E-02,
+-    0.535974500312596681161E-02,
+-    0.539245800482555593606E-02,
+-    0.542492204466865704951E-02,
+-    0.545713419970309863995E-02,
+-    0.548909157632945623482E-02,
+-    0.552079131034778706457E-02,
+-    0.555223056700346326850E-02,
+-    0.558340654103215637610E-02,
+-    0.561431645670402467678E-02,
+-    0.564495756786715368885E-02,
+-    0.567532715799029830087E-02,
+-    0.570542254020497332312E-02,
+-    0.573524105734693719020E-02,
+-    0.576478008199711142954E-02,
+-    0.579403701652197628421E-02,
+-    0.582300929311348057702E-02,
+-    0.585169437382850155033E-02,
+-    0.588008975062788803205E-02,
+-    0.590819294541511788161E-02,
+-    0.593600151007459827614E-02,
+-    0.596351302650963502011E-02,
+-    0.599072510668009471472E-02,
+-    0.601763539263978131522E-02,
+-    0.604424155657354634589E-02,
+-    0.607054130083414983949E-02,
+-    0.609653235797888692923E-02,
+-    0.612221249080599294931E-02,
+-    0.614757949239083790214E-02,
+-    0.617263118612191922727E-02,
+-    0.619736542573665996342E-02,
+-    0.622178009535701763157E-02,
+-    0.624587310952490748541E-02,
+-    0.626964241323744217671E-02,
+-    0.629308598198198836688E-02,
+-    0.631620182177103938227E-02,
+-    0.633898796917690165912E-02,
+-    0.636144249136619145314E-02,
+-    0.638356348613413709795E-02,
+-    0.640534908193868098342E-02,
+-    0.642679743793437438922E-02,
+-    0.644790674400605734710E-02,
+-    0.646867522080231481688E-02,
+-    0.648910111976869964292E-02,
+-    0.650918272318071200827E-02,
+-    0.652891834417652442012E-02,
+-    0.654830632678944064054E-02,
+-    0.656734504598007641819E-02,
+-    0.658603290766824937794E-02,
+-    0.660436834876456498276E-02,
+-    0.662234983720168509457E-02,
+-    0.663997587196526532519E-02,
+-    0.665724498312454708217E-02,
+-    0.667415573186258997654E-02,
+-    0.669070671050613006584E-02,
+-    0.670689654255504925648E-02,
+-    0.672272388271144108036E-02,
+-    0.673818741690825799086E-02,
+-    0.675328586233752529078E-02,
+-    0.676801796747810680683E-02,
+-    0.678238251212300746082E-02,
+-    0.679637830740619795480E-02,
+-    0.681000419582894688374E-02,
+-    0.682325905128564571420E-02,
+-    0.683614177908911221841E-02,
+-    0.684865131599535812903E-02,
+-    0.686078663022780697951E-02,
+-    0.687254672150094831613E-02,
+-    0.688393062104341470995E-02,
+-    0.689493739162046825872E-02,
+-    0.690556612755588354803E-02,
+-    0.691581595475321433825E-02,
+-    0.692568603071643155621E-02,
+-    0.693517554456992049848E-02,
+-    0.694428371707782549438E-02,
+-    0.695300980066273063177E-02,
+-    0.696135307942366551493E-02,
+-    0.696931286915342540213E-02,
+-    0.697688851735519545845E-02,
+-    0.698407940325846925786E-02,
+-    0.699088493783425207545E-02,
+-    0.699730456380953992594E-02,
+-    0.700333775568106572820E-02,
+-    0.700898401972830440494E-02,
+-    0.701424289402572916425E-02,
+-    0.701911394845431165171E-02,
+-    0.702359678471225911031E-02,
+-    0.702769103632498213858E-02,
+-    0.703139636865428709508E-02,
+-    0.703471247890678765907E-02,
+-    0.703763909614153052319E-02,
+-    0.704017598127683066242E-02,
+-    0.704232292709631209597E-02,
+-    0.704407975825415053266E-02,
+-    0.704544633127951476780E-02,
+-    0.704642253458020417748E-02,
+-    0.704700828844548013730E-02,
+-    0.704720354504808967346E-02,
+-    0.704700828844548013730E-02,
+-    0.704642253458020417748E-02,
+-    0.704544633127951476780E-02,
+-    0.704407975825415053266E-02,
+-    0.704232292709631209597E-02,
+-    0.704017598127683066242E-02,
+-    0.703763909614153052319E-02,
+-    0.703471247890678765907E-02,
+-    0.703139636865428709508E-02,
+-    0.702769103632498213858E-02,
+-    0.702359678471225911031E-02,
+-    0.701911394845431165171E-02,
+-    0.701424289402572916425E-02,
+-    0.700898401972830440494E-02,
+-    0.700333775568106572820E-02,
+-    0.699730456380953992594E-02,
+-    0.699088493783425207545E-02,
+-    0.698407940325846925786E-02,
+-    0.697688851735519545845E-02,
+-    0.696931286915342540213E-02,
+-    0.696135307942366551493E-02,
+-    0.695300980066273063177E-02,
+-    0.694428371707782549438E-02,
+-    0.693517554456992049848E-02,
+-    0.692568603071643155621E-02,
+-    0.691581595475321433825E-02,
+-    0.690556612755588354803E-02,
+-    0.689493739162046825872E-02,
+-    0.688393062104341470995E-02,
+-    0.687254672150094831613E-02,
+-    0.686078663022780697951E-02,
+-    0.684865131599535812903E-02,
+-    0.683614177908911221841E-02,
+-    0.682325905128564571420E-02,
+-    0.681000419582894688374E-02,
+-    0.679637830740619795480E-02,
+-    0.678238251212300746082E-02,
+-    0.676801796747810680683E-02,
+-    0.675328586233752529078E-02,
+-    0.673818741690825799086E-02,
+-    0.672272388271144108036E-02,
+-    0.670689654255504925648E-02,
+-    0.669070671050613006584E-02,
+-    0.667415573186258997654E-02,
+-    0.665724498312454708217E-02,
+-    0.663997587196526532519E-02,
+-    0.662234983720168509457E-02,
+-    0.660436834876456498276E-02,
+-    0.658603290766824937794E-02,
+-    0.656734504598007641819E-02,
+-    0.654830632678944064054E-02,
+-    0.652891834417652442012E-02,
+-    0.650918272318071200827E-02,
+-    0.648910111976869964292E-02,
+-    0.646867522080231481688E-02,
+-    0.644790674400605734710E-02,
+-    0.642679743793437438922E-02,
+-    0.640534908193868098342E-02,
+-    0.638356348613413709795E-02,
+-    0.636144249136619145314E-02,
+-    0.633898796917690165912E-02,
+-    0.631620182177103938227E-02,
+-    0.629308598198198836688E-02,
+-    0.626964241323744217671E-02,
+-    0.624587310952490748541E-02,
+-    0.622178009535701763157E-02,
+-    0.619736542573665996342E-02,
+-    0.617263118612191922727E-02,
+-    0.614757949239083790214E-02,
+-    0.612221249080599294931E-02,
+-    0.609653235797888692923E-02,
+-    0.607054130083414983949E-02,
+-    0.604424155657354634589E-02,
+-    0.601763539263978131522E-02,
+-    0.599072510668009471472E-02,
+-    0.596351302650963502011E-02,
+-    0.593600151007459827614E-02,
+-    0.590819294541511788161E-02,
+-    0.588008975062788803205E-02,
+-    0.585169437382850155033E-02,
+-    0.582300929311348057702E-02,
+-    0.579403701652197628421E-02,
+-    0.576478008199711142954E-02,
+-    0.573524105734693719020E-02,
+-    0.570542254020497332312E-02,
+-    0.567532715799029830087E-02,
+-    0.564495756786715368885E-02,
+-    0.561431645670402467678E-02,
+-    0.558340654103215637610E-02,
+-    0.555223056700346326850E-02,
+-    0.552079131034778706457E-02,
+-    0.548909157632945623482E-02,
+-    0.545713419970309863995E-02,
+-    0.542492204466865704951E-02,
+-    0.539245800482555593606E-02,
+-    0.535974500312596681161E-02,
+-    0.532678599182711857974E-02,
+-    0.529358395244259896547E-02,
+-    0.526014189569259311205E-02,
+-    0.522646286145300596306E-02,
+-    0.519254991870341614863E-02,
+-    0.515840616547381084096E-02,
+-    0.512403472879005351831E-02,
+-    0.508943876461803986674E-02,
+-    0.505462145780650125058E-02,
+-    0.501958602202842039909E-02,
+-    0.498433569972103029914E-02,
+-    0.494887376202437487201E-02,
+-    0.491320350871841897367E-02,
+-    0.487732826815870573054E-02,
+-    0.484125139721057135214E-02,
+-    0.480497628118194150483E-02,
+-    0.476850633375474925263E-02,
+-    0.473184499691503264714E-02,
+-    0.469499574088179046532E-02,
+-    0.465796206403469754658E-02,
+-    0.462074749284080687482E-02,
+-    0.458335558178039420335E-02,
+-    0.454578991327213285488E-02,
+-    0.450805409759782158001E-02,
+-    0.447015177282692726900E-02,
+-    0.443208660474124713206E-02,
+-    0.439386228676004195260E-02,
+-    0.435548253986604343679E-02,
+-    0.431695111253279479928E-02,
+-    0.427827178065384480959E-02,
+-    0.423944834747438184434E-02,
+-    0.420048464352596631772E-02,
+-    0.416138452656509745764E-02,
+-    0.412215188151643401528E-02,
+-    0.408279062042157838350E-02,
+-    0.404330468239442998549E-02,
+-    0.400369803358421688562E-02,
+-    0.396397466714742455513E-02,
+-    0.392413860322995774660E-02,
+-    0.388419388896099560998E-02,
+-    0.384414459846013158917E-02,
+-    0.380399483285952829161E-02,
+-    0.376374872034296338241E-02,
+-    0.372341041620379550870E-02,
+-    0.368298410292403911967E-02,
+-    0.364247399027690353194E-02,
+-    0.360188431545532431869E-02,
+-    0.356121934322919357659E-02,
+-    0.352048336613417922682E-02,
+-    0.347968070469521146972E-02,
+-    0.343881570768790591876E-02,
+-    0.339789275244138669739E-02,
+-    0.335691624518616761342E-02,
+-    0.331589062145094394706E-02,
+-    0.327482034651233969564E-02,
+-    0.323370991590184336368E-02,
+-    0.319256385597434736790E-02,
+-    0.315138672454287935858E-02,
+-    0.311018311158427546158E-02,
+-    0.306895764002069252174E-02,
+-    0.302771496658198544480E-02,
+-    0.298645978275408290247E-02,
+-    0.294519681581857582284E-02,
+-    0.290393082998878368175E-02,
+-    0.286266662764757868253E-02,
+-    0.282140905069222207923E-02,
+-    0.278016298199139435045E-02,
+-    0.273893334695947541201E-02,
+-    0.269772511525294586667E-02,
+-    0.265654330259352828314E-02,
+-    0.261539297272236109225E-02,
+-    0.257427923948908888092E-02,
+-    0.253320726907925325750E-02,
+-    0.249218228238276930060E-02,
+-    0.245120955750556483923E-02,
+-    0.241029443242563417382E-02,
+-    0.236944230779380495146E-02,
+-    0.232865864987842738864E-02,
+-    0.228794899365195972378E-02,
+-    0.224731894601603393082E-02,
+-    0.220677418916003329194E-02,
+-    0.216632048404649142727E-02,
+-    0.212596367401472533045E-02,
+-    0.208570968849203942640E-02,
+-    0.204556454679958293446E-02,
+-    0.200553436203751169944E-02,
+-    0.196562534503150547732E-02,
+-    0.192584380831993546204E-02,
+-    0.188619617015808475394E-02,
+-    0.184668895851282540913E-02,
+-    0.180732881501808930079E-02,
+-    0.176812249885838886701E-02,
+-    0.172907689054461607168E-02,
+-    0.169019899554346019117E-02,
+-    0.165149594771914570655E-02,
+-    0.161297501254393423070E-02,
+-    0.157464359003212166189E-02,
+-    0.153650921735128916170E-02,
+-    0.149857957106456636214E-02,
+-    0.146086246895890987689E-02,
+-    0.142336587141720519900E-02,
+-    0.138609788229672549700E-02,
+-    0.134906674928353113127E-02,
+-    0.131228086370221478128E-02,
+-    0.127574875977346947345E-02,
+-    0.123947911332878396534E-02,
+-    0.120348074001265964881E-02,
+-    0.116776259302858043685E-02,
+-    0.113233376051597664917E-02,
+-    0.109720346268191941940E-02,
+-    0.106238104885340071375E-02,
+-    0.102787599466367326179E-02,
+-    0.993697899638760857945E-03,
+-    0.959856485506936206261E-03,
+-    0.926361595613111283368E-03,
+-    0.893223195879324912340E-03,
+-    0.860451377808527848128E-03,
+-    0.828056364077226302608E-03,
+-    0.796048517297550871506E-03,
+-    0.764438352543882784191E-03,
+-    0.733236554224767912055E-03,
+-    0.702453997827572321358E-03,
+-    0.672101776960108194646E-03,
+-    0.642191235948505088403E-03,
+-    0.612734008012225209294E-03,
+-    0.583742058714979703847E-03,
+-    0.555227733977307579715E-03,
+-    0.527203811431658386125E-03,
+-    0.499683553312800484519E-03,
+-    0.472680758429262691232E-03,
+-    0.446209810101403247488E-03,
+-    0.420285716355361231823E-03,
+-    0.394924138246873704434E-03,
+-    0.370141402122251665232E-03,
+-    0.345954492129903871350E-03,
+-    0.322381020652862389664E-03,
+-    0.299439176850911730874E-03,
+-    0.277147657465187357459E-03,
+-    0.255525589595236862014E-03,
+-    0.234592462123925204879E-03,
+-    0.214368090034216937149E-03,
+-    0.194872642236641146532E-03,
+-    0.176126765545083195474E-03,
+-    0.158151830411132242924E-03,
+-    0.140970302204104791413E-03,
+-    0.124606200241498368482E-03,
+-    0.109085545645741522051E-03,
+-    0.944366322532705527066E-04,
+-    0.806899228014035293851E-04,
+-    0.678774554733972416227E-04,
+-    0.560319507856164252140E-04,
+-    0.451863674126296143105E-04,
+-    0.353751372055189588628E-04,
+-    0.266376412339000901358E-04,
+-    0.190213681905875816679E-04,
+-    0.125792781889592743525E-04,
+-    0.736624069102321668857E-05,
+-    0.345456507169149134898E-05,
+-    0.945715933950007048827E-06,
+-  };
+-
+-  if ( n == 1 )
+-  {
+-    webbur::r8vec_copy ( n, w_001, w );
+-  }
+-  else if ( n == 3 )
+-  {
+-    webbur::r8vec_copy ( n, w_003, w );
+-  }
+-  else if ( n == 7 )
+-  {
+-    webbur::r8vec_copy ( n, w_007, w );
+-  }
+-  else if ( n == 15 )
+-  {
+-    webbur::r8vec_copy ( n, w_015, w );
+-  }
+-  else if ( n == 31 )
+-  {
+-    webbur::r8vec_copy ( n, w_031, w );
+-  }
+-  else if ( n == 63 )
+-  {
+-    webbur::r8vec_copy ( n, w_063, w );
+-  }
+-  else if ( n == 127 )
+-  {
+-    webbur::r8vec_copy ( n, w_127, w );
+-  }
+-  else if ( n == 255 )
+-  {
+-    webbur::r8vec_copy ( n, w_255, w );
+-  }
+-  else if ( n == 511 )
+-  {
+-    webbur::r8vec_copy ( n, w_511, w );
+-  }
+-  else
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "PATTERSON_LOOKUP_WEIGHTS - Fatal error!\n";
+-    std::cerr << "  Unexpected value of N = " << n << ".\n";
+-    std::exit ( 1 );
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void patterson_lookup_weights_np ( int n, int np, double p[], double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    PATTERSON_LOOKUP_WEIGHTS_NP looks up Patterson quadrature weights.
+-//
+-//  Discussion:
+-//
+-//    The allowed orders are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
+-//
+-//    The weights are positive, symmetric and should sum to 2.
+-//
+-//    The user must preallocate space for the output array W.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    25 April 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Milton Abramowitz, Irene Stegun,
+-//    Handbook of Mathematical Functions,
+-//    National Bureau of Standards, 1964,
+-//    ISBN: 0-486-61272-4,
+-//    LC: QA47.A34.
+-//
+-//    Arthur Stroud, Don Secrest,
+-//    Gaussian Quadrature Formulas,
+-//    Prentice Hall, 1966,
+-//    LC: QA299.4G3S7.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order.
+-//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 or 511.
+-//
+-//    Input, int NP, the number of parameters.
+-//
+-//    Input, double P[NP], parameters which are not needed by this function.
+-//
+-//    Output, double W[N], the weights.
+-//
+-{
+-  patterson_lookup_weights ( n, w );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int point_radial_tol_unique_count ( int m, int n, double a[], double tol,
+-  int *seed )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_RADIAL_TOL_UNIQUE_COUNT counts the tolerably unique points.
+-//
+-//  Discussion:
+-//
+-//    The input data is an M x N array A, representing the M-dimensional
+-//    coordinates of N points.
+-//
+-//    The output is the number of tolerably unique points in the list.
+-//
+-//    This program performs the same task as POINT_TOL_UNIQUE_COUNT.
+-//    But that program is guaranteed to use N^2 comparisons.
+-//
+-//    It is hoped that this function, on the other hand, will tend
+-//    to use O(N) comparisons after an O(NLog(N)) sort.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    24 July 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows.
+-//
+-//    Input, int N, the number of columns.
+-//
+-//    Input, double A[M*N], the array of N columns of data.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Input/output, int *SEED, a seed for the random
+-//    number generator.
+-//
+-//    Output, int POINT_RADIAL_TOL_UNIQUE_COUNT, the number of tolerably
+-//    unique points.
+-//
+-{
+-  double dist;
+-  int hi;
+-  int i;
+-  int *indx;
+-  int j;
+-  int k;
+-  double *r;
+-  bool *unique;
+-  int unique_num;
+-  double *w;
+-  double w_sum;
+-  double *z;
+-
+-  if ( n <= 0 )
+-  {
+-    unique_num = 0;
+-    return unique_num;
+-  }
+-//
+-//  Assign a base point Z randomly in the convex hull.
+-//
+-  w = webbur::r8vec_uniform_01_new ( n, seed );
+-  w_sum = webbur::r8vec_sum ( n, w );
+-  for ( j = 0; j < n; j++ )
+-  {
+-    w[j] = w[j] / w_sum;
+-  }
+-
+-  z = new double[m];
+-  for ( i = 0; i < m; i++ )
+-  {
+-    z[i] = 0.0;
+-    for ( j = 0; j < n; j++ )
+-    {
+-      z[i] = z[i] + a[i+j*m] * w[j];
+-    }
+-  }
+-//
+-//  Compute the radial distance R of each point to Z.
+-//
+-  r = new double[n];
+-
+-  for ( j = 0; j < n; j++ )
+-  {
+-    r[j] = 0.0;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      r[j] = r[j] + std::pow ( a[i+j*m] - z[i], 2 );
+-    }
+-    r[j] = std::sqrt ( r[j] );
+-  }
+-//
+-//  Implicitly sort the R array.
+-//
+-  indx = webbur::r8vec_sort_heap_index_a_new ( n, r );
+-//
+-//  To determine if a point I is tolerably unique, we only have to check
+-//  whether it is distinct from all points J such that R(I) <= R(J) <= R(J)+TOL.
+-//
+-  unique_num = 0;
+-
+-  unique = new bool[n];
+-  for ( i = 0; i < n; i++ )
+-  {
+-    unique[i] = true;
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    if ( unique[indx[i]] )
+-    {
+-//
+-//  Point INDX(I) is unique, in that no earlier point is near it.
+-//
+-      unique_num = unique_num + 1;
+-//
+-//  Look for later points which are close to point INDX(I)
+-//  in terms of R.
+-//
+-      hi = i;
+-
+-      while ( hi < n - 1 )
+-      {
+-        if ( r[indx[i]] + tol < r[indx[hi+1]] )
+-        {
+-          break;
+-        }
+-        hi = hi + 1;
+-      }
+-//
+-//  Points INDX(I+1) through INDX(HI) have an R value close to
+-//  point INDX(I).  Are they truly close to point INDEX(I)?
+-//
+-      for ( j = i + 1; j <= hi; j++ )
+-      {
+-        if ( unique[indx[j]] )
+-        {
+-          dist = 0.0;
+-          for ( k = 0; k < m; k++ )
+-          {
+-            dist = dist + std::pow ( a[k+indx[i]*m] - a[k+indx[j]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-
+-          if ( dist <= tol )
+-          {
+-            unique[indx[j]] = false;
+-          }
+-        }
+-      }
+-    }
+-  }
+-
+-  delete [] indx;
+-  delete [] r;
+-  delete [] unique;
+-  delete [] w;
+-  delete [] z;
+-
+-  return unique_num;
+-}
+-//****************************************************************************80
+-
+-void point_radial_tol_unique_count_inc1 ( int m, int n1, double a1[],
+-  double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[],
+-  int *unique_num1 )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_RADIAL_TOL_UNIQUE_COUNT_INC1 counts the tolerably unique points.
+-//
+-//  Discussion:
+-//
+-//    The input data includes an M x N1 array A1 of a set of N1
+-//    "permanent" points and N2 "temporary" points.
+-//
+-//    This is a two step version of POINT_RADIAL_TOL_UNIQUE_COUNT_INC.
+-//
+-//    This means that we want to identify the tolerably unique points
+-//    among the permanent points before processing the temporary points.
+-//
+-//    If many sets of temporary data are considered, this function will
+-//    do a lot of unnecessary work resorting the permanent data; it would
+-//    be possible to avoid repetitions of that work at the expense of saving
+-//    various work vectors.  This function accepts the overhead of the
+-//    repeated calculations for the benefit of only having to "remember"
+-//    the number of unique points discovered.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 October 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows.
+-//
+-//    Input, int N1, the number of permanent points.
+-//
+-//    Input, double A1[M*N1], the permanent points.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Input/output, int *SEED, a seed for the random
+-//    number generator.
+-//
+-//    Output, double Z[M], a random base vector used to
+-//    linearly sort the data.
+-//
+-//    Output, double R1[N1], the scalar values assigned to
+-//    the data for sorting.
+-//
+-//    Output, int INDX1[N1], the ascending sort index
+-//    for A1.
+-//
+-//    Output, bool UNIQUE1[N1], is TRUE for each unique permanent point.
+-//
+-//    Output, int *UNIQUE_NUM1, the number of tolerably
+-//    unique permanent points.
+-//
+-{
+-  double dist;
+-  int hi;
+-  int i;
+-  int j;
+-  int j1;
+-  int k1;
+-  double *w;
+-  double w_sum;
+-//
+-//  Assign a base point Z randomly in the convex hull of the permanent points.
+-//
+-  w = webbur::r8vec_uniform_01_new ( n1, seed );
+-  w_sum = webbur::r8vec_sum ( n1, w );
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    w[j1] = w[j1] / w_sum;
+-  }
+-  for ( i = 0; i < m; i++ )
+-  {
+-    z[i] = 0.0;
+-    for ( j1 = 0; j1 < n1; j1++ )
+-    {
+-      z[i] = z[i] + a1[i+j1*m] * w[j1];
+-    }
+-  }
+-//
+-//  Initialize the permanent point data.
+-//
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    r1[j1] = 0.0;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      r1[j1] = r1[j1] + std::pow ( a1[i+j1*m] - z[i], 2 );
+-    }
+-    r1[j1] = std::sqrt ( r1[j1] );
+-  }
+-  webbur::r8vec_sort_heap_index_a ( n1, r1, indx1 );
+-
+-  *unique_num1 = 0;
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    unique1[j1] = true;
+-  }
+-//
+-//  STEP 1:
+-//  Compare PERMANENT POINTS to PERMANENT POINTS.
+-//
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    if ( unique1[indx1[j1]] )
+-    {
+-      *unique_num1 = *unique_num1 + 1;
+-
+-      hi = j1;
+-
+-      while ( hi < n1 - 1 )
+-      {
+-        if ( r1[indx1[j1]] + tol < r1[indx1[hi+1]] )
+-        {
+-          break;
+-        }
+-        hi = hi + 1;
+-      }
+-
+-      for ( k1 = j1 + 1; k1 <= hi; k1++ )
+-      {
+-        if ( unique1[indx1[k1]] )
+-        {
+-          dist = 0.0;
+-          for ( i = 0; i < m; i++ )
+-          {
+-            dist = dist + std::pow ( a1[i+indx1[j1]*m] - a1[i+indx1[k1]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-
+-          if ( dist <= tol )
+-          {
+-            unique1[indx1[k1]] = false;
+-          }
+-        }
+-      }
+-    }
+-  }
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void point_radial_tol_unique_count_inc2 ( int m, int n1, double a1[], int n2,
+-  double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[],
+-  int *unique_num2 )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_RADIAL_TOL_UNIQUE_COUNT_INC2 counts the tolerably unique points.
+-//
+-//  Discussion:
+-//
+-//    The input data includes an M x N1 array A1 and an M x N2 array A2,
+-//    representing the M-dimensional coordinates of a set of N1
+-//    "permanent" points and N2 "temporary" points.
+-//
+-//    This is an "incremental" version of POINT_RADIAL_TOL_UNIQUE_COUNT.
+-//
+-//    This means that we want to identify the tolerably unique points
+-//    among the permanent points before processing the temporary points.
+-//
+-//    If many sets of temporary data are considered, this function will
+-//    do a lot of unnecessary work resorting the permanent data; it would
+-//    be possible to avoid repetitions of that work at the expense of saving
+-//    various work vectors.  This function accepts the overhead of the
+-//    repeated calculations for the benefit of only having to "remember"
+-//    the number of unique points discovered.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 October 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows.
+-//
+-//    Input, int N1, the number of permanent points.
+-//
+-//    Input, double A1[M*N1], the permanent points.
+-//
+-//    Input, int N2, the number of temporary points.
+-//
+-//    Input, double A2[M*N2], the temporary points.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Input, double Z[M], a random base vector used to
+-//    linearly sort the data.
+-//
+-//    Input, double R1[N1], the scalar values assigned to
+-//    the data for sorting.
+-//
+-//    Input, int INDX1[N1], the ascending sort index
+-//    for A1.
+-//
+-//    Input, bool UNIQUE1[N1], is TRUE for each unique permanent point.
+-//
+-//    Output, int *UNIQUE_NUM2, the number of additional
+-//    tolerably unique points if the temporary points are included.
+-//
+-{
+-  double dist;
+-  int hi;
+-  int i;
+-  int *indx2;
+-  int j;
+-  int j1;
+-  int j2;
+-  int j2_hi;
+-  int j2_lo;
+-  int k1;
+-  int k2;
+-  double r_hi;
+-  double r_lo;
+-  double *r2;
+-  bool *unique2;
+-//
+-//  Initialize the temporary point data.
+-//
+-  r2 = new double[n2];
+-  for ( j2 = 0; j2 < n2; j2++ )
+-  {
+-    r2[j2] = 0.0;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      r2[j2] = r2[j2] + std::pow ( a2[i+j2*m] - z[i], 2 );
+-    }
+-    r2[j2] = std::sqrt ( r2[j2] );
+-  }
+-
+-  indx2 = new int[n2];
+-  webbur::r8vec_sort_heap_index_a ( n2, r2, indx2 );
+-
+-  unique2 = new bool[n2];
+-  for ( j2 = 0; j2 < n2; j2++ )
+-  {
+-    unique2[j2] = true;
+-  }
+-
+-  *unique_num2 = 0;
+-//
+-//  STEP 2:
+-//  Use PERMANENT points to eliminate TEMPORARY points.
+-//
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    if ( unique1[indx1[j1]] )
+-    {
+-      r_lo = r1[indx1[j1]] - tol;
+-      r_hi = r1[indx1[j1]] + tol;
+-
+-      webbur::r8vec_index_sorted_range ( n2, r2, indx2, r_lo, r_hi,
+-        &j2_lo, &j2_hi );
+-
+-      for ( j2 = j2_lo; j2 <= j2_hi; j2++ )
+-      {
+-        if ( unique2[indx2[j2]] )
+-        {
+-          dist = 0.0;
+-          for ( i = 0; i < m; i++ )
+-          {
+-            dist = dist + std::pow ( a1[i+indx1[j1]*m]
+-                                   - a2[i+indx2[j2]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-          if ( dist <= tol )
+-          {
+-            unique2[indx2[j2]] = false;
+-          }
+-        }
+-      }
+-    }
+-  }
+-//
+-//  STEP 3:
+-//  Use TEMPORARY points to eliminate TEMPORARY points.
+-//
+-  for ( j2 = 0; j2 < n2; j2++ )
+-  {
+-    if ( unique2[indx2[j2]] )
+-    {
+-      *unique_num2 = *unique_num2 + 1;
+-
+-      hi = j2;
+-
+-      while ( hi < n2 - 1 )
+-      {
+-        if ( r2[indx2[j2]] + tol < r2[indx2[hi+1]] )
+-        {
+-          break;
+-        }
+-        hi = hi + 1;
+-      }
+-
+-      for ( k2 = j2 + 1; k2 <= hi; k2++ )
+-      {
+-        if ( unique2[indx2[k2]] )
+-        {
+-          dist = 0.0;
+-          for ( i = 0; i < m; i++ )
+-          {
+-            dist = dist + std::pow ( a2[i+indx2[j2]*m] - a2[i+indx2[k2]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-
+-          if ( dist <= tol )
+-          {
+-            unique2[indx2[k2]] = false;
+-          }
+-        }
+-      }
+-    }
+-  }
+-  delete [] indx2;
+-  delete [] r2;
+-  delete [] unique2;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int point_radial_tol_unique_index ( int m, int n, double a[], double tol,
+-  int *seed, int undx[], int xdnu[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_RADIAL_TOL_UNIQUE_INDEX indexes the tolerably unique points.
+-//
+-//  Discussion:
+-//
+-//    The input data is an M x N array A, representing the M-dimensional
+-//    coordinates of N points.
+-//
+-//    The output is:
+-//    * the number of tolerably unique points in the list;
+-//    * the index, in the list of unique items, of the representatives
+-//      of each point;
+-//    * the index, in A, of the tolerably unique representatives.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    28 July 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows.
+-//
+-//    Input, int N, the number of columns.
+-//
+-//    Input, double A[M*N], the array of N columns of data.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Input/output, int SEED, a seed for the random
+-//    number generator.
+-//
+-//    Output, int UNDX[UNIQUE_NUM], the index, in A, of the
+-//    tolerably unique points.
+-//
+-//    Output, int XDNU[N], the index, in UNDX, of the
+-//    tolerably unique point that "represents" this point.
+-//
+-//    Output, int POINT_RADIAL_TOL_UNIQUE_INDEX, the number of tolerably
+-//    unique points.
+-//
+-{
+-  double dist;
+-  int hi;
+-  int i;
+-  int *indx;
+-  int j;
+-  int k;
+-  double *r;
+-  bool *unique;
+-  int unique_num;
+-  double *w;
+-  double w_sum;
+-  double *z;
+-
+-  if ( n <= 0 )
+-  {
+-    unique_num = 0;
+-    return unique_num;
+-  }
+-//
+-//  Assign a base point Z randomly in the convex hull.
+-//
+-  w = webbur::r8vec_uniform_01_new ( n, seed );
+-  w_sum = webbur::r8vec_sum ( n, w );
+-  for ( j = 0; j < n; j++ )
+-  {
+-    w[j] = w[j] / w_sum;
+-  }
+-
+-  z = new double[m];
+-  for ( i = 0; i < m; i++ )
+-  {
+-    z[i] = 0.0;
+-    for ( j = 0; j < n; j++ )
+-    {
+-      z[i] = z[i] + a[i+j*m] * w[j];
+-    }
+-  }
+-//
+-//  Compute the radial distance R of each point to Z.
+-//
+-  r = new double[n];
+-
+-  for ( j = 0; j < n; j++ )
+-  {
+-    r[j] = 0.0;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      r[j] = r[j] + std::pow ( a[i+j*m] - z[i], 2 );
+-    }
+-    r[j] = std::sqrt ( r[j] );
+-  }
+-//
+-//  Implicitly sort the R array.
+-//
+-  indx = webbur::r8vec_sort_heap_index_a_new ( n, r );
+-//
+-//  To determine if a point I is tolerably unique, we only have to check
+-//  whether it is distinct from all points J such that R(I) <= R(J) <= R(J)+TOL.
+-//
+-  unique_num = 0;
+-
+-  unique = new bool[n];
+-  for ( i = 0; i < n; i++ )
+-  {
+-    unique[i] = true;
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    if ( unique[indx[i]] )
+-    {
+-//
+-//  Point INDX(I) is unique, in that no earlier point is near it.
+-//
+-      xdnu[indx[i]] = unique_num;
+-      undx[unique_num] = indx[i];
+-      unique_num = unique_num + 1;
+-//
+-//  Look for later points which are close to point INDX(I)
+-//  in terms of R.
+-//
+-      hi = i;
+-
+-      while ( hi < n - 1 )
+-      {
+-        if ( r[indx[i]] + tol < r[indx[hi+1]] )
+-        {
+-          break;
+-        }
+-        hi = hi + 1;
+-      }
+-//
+-//  Points INDX(I+1) through INDX(HI) have an R value close to
+-//  point INDX(I).  Are they truly close to point INDEX(I)?
+-//
+-      for ( j = i + 1; j <= hi; j++ )
+-      {
+-        if ( unique[indx[j]] )
+-        {
+-          dist = 0.0;
+-          for ( k = 0; k < m; k++ )
+-          {
+-            dist = dist + std::pow ( a[k+indx[i]*m] - a[k+indx[j]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-
+-          if ( dist <= tol )
+-          {
+-            unique[indx[j]] = false;
+-            xdnu[indx[j]] = xdnu[indx[i]];
+-          }
+-        }
+-      }
+-    }
+-  }
+-
+-  delete [] indx;
+-  delete [] r;
+-  delete [] unique;
+-  delete [] w;
+-  delete [] z;
+-
+-  return unique_num;
+-}
+-//****************************************************************************80
+-
+-void point_radial_tol_unique_index_inc1 ( int m, int n1, double a1[],
+-  double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[],
+-  int *unique_num1, int undx1[], int xdnu1[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC1 indexes the tolerably unique points.
+-//
+-//  Discussion:
+-//
+-//    The input data includes an M x N1 array A1 of
+-//    "permanent" points.
+-//
+-//    This is a two step version of POINT_RADIAL_TOL_UNIQUE_INDEX_INC.
+-//
+-//    The output is:
+-//    * the number of tolerably unique points in the list;
+-//    * the index, in the list of unique items, of the representatives
+-//      of each point;
+-//    * the index, in A1, of the tolerably unique representatives.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    02 October 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows.
+-//
+-//    Input, int N1, the number of permanent points.
+-//
+-//    Input, double A1[M*N1], the permanent points.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Input/output, int *SEED, a seed for the random
+-//    number generator.
+-//
+-//    Output, double Z[M], a random base vector used to
+-//    linearly sort the data.
+-//
+-//    Output, double R1[N1], the scalar values assigned to
+-//    the data for sorting.
+-//
+-//    Output, int INDX1[N1], the ascending sort index for A1.
+-//
+-//    Output, bool UNIQUE1[N1], is TRUE for unique permanent points.
+-//
+-//    Output, int *UNIQUE_NUM1, the number of tolerably unique points
+-//    with just the permanent points.
+-//
+-//    Output, int UNDX1[UNIQUE_NUM1], the index, in A1, of the tolerably
+-//    unique points.
+-//
+-//    Output, int XDNU1[N1], the index, in UNDX1, of the tolerably unique
+-//    point that "represents" this point.
+-//
+-{
+-  double dist;
+-  int hi;
+-  int i;
+-  int j;
+-  int j1;
+-  int k1;
+-  double *w;
+-  double w_sum;
+-//
+-//  Assign a base point Z randomly in the convex hull of the permanent points.
+-//
+-  w = webbur::r8vec_uniform_01_new ( n1, seed );
+-  w_sum = webbur::r8vec_sum ( n1, w );
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    w[j1] = w[j1] / w_sum;
+-  }
+-
+-  for ( i = 0; i < m; i++ )
+-  {
+-    z[i] = 0.0;
+-    for ( j1 = 0; j1 < n1; j1++ )
+-    {
+-      z[i] = z[i] + a1[i+j1*m] * w[j1];
+-    }
+-  }
+-//
+-//  Initialize the permanent point data.
+-//
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    r1[j1] = 0.0;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      r1[j1] = r1[j1] + std::pow ( a1[i+j1*m] - z[i], 2 );
+-    }
+-    r1[j1] = std::sqrt ( r1[j1] );
+-  }
+-  webbur::r8vec_sort_heap_index_a ( n1, r1, indx1 );
+-
+-  *unique_num1 = 0;
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    unique1[j1] = true;
+-  }
+-//
+-//  STEP 1:
+-//  Compare PERMANENT POINTS to PERMANENT POINTS.
+-//
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    if ( unique1[indx1[j1]] )
+-    {
+-      xdnu1[indx1[j1]] = *unique_num1;
+-      undx1[*unique_num1] = indx1[j1];
+-      *unique_num1 = *unique_num1 + 1;
+-
+-      hi = j1;
+-
+-      while ( hi < n1 - 1 )
+-      {
+-        if ( r1[indx1[j1]] + tol < r1[indx1[hi+1]] )
+-        {
+-          break;
+-        }
+-        hi = hi + 1;
+-      }
+-
+-      for ( k1 = j1 + 1; k1 <= hi; k1++ )
+-      {
+-        if ( unique1[indx1[k1]] )
+-        {
+-          dist = 0.0;
+-          for ( i = 0; i < m; i++ )
+-          {
+-            dist = dist + std::pow ( a1[i+indx1[j1]*m] - a1[i+indx1[k1]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-
+-          if ( dist <= tol )
+-          {
+-            unique1[indx1[k1]] = false;
+-            xdnu1[indx1[k1]] = xdnu1[indx1[j1]];
+-          }
+-        }
+-      }
+-    }
+-  }
+-
+-  delete [] w;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void point_radial_tol_unique_index_inc2 ( int m, int n1, double a1[], int n2,
+-  double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[],
+-  int unique_num1, int undx1[], int xdnu1[], double r2[],
+-  int indx2[], bool unique2[], int *unique_num2, int undx2[], int xdnu2[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC2 indexes unique temporary points.
+-//
+-//  Discussion:
+-//
+-//    The input data includes an M x N1 array A1 and an M x N2 array A2,
+-//    representing the M-dimensional coordinates of a set of N1
+-//    "permanent" points and N2 "temporary" points.
+-//
+-//    For notation, we use "A" to describe the M x (N1+N2) array that would be
+-//    formed by starting with A1 and appending A2.
+-//
+-//    The output is:
+-//    * the number of tolerably unique points in the list;
+-//    * the index, in the list of unique items, of the representatives
+-//      of each point;
+-//    * the index, in A, of the tolerably unique representatives.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    08 October 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows.
+-//
+-//    Input, int N1, the number of permanent points.
+-//
+-//    Input, double A1[M*N1], the permanent points.
+-//
+-//    Input, int N2, the number of temporary points.
+-//
+-//    Input, double A2[M*N2], the temporary points.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Input, double Z[M], a random base vector used to
+-//    linearly sort the data.
+-//
+-//    Input, double R1[N1], the scalar values assigned to
+-//    A1 for sorting.
+-//
+-//    Input, int INDX1[N1], the ascending sort index for A1.
+-//
+-//    Input, bool UNIQUE1[N1], is TRUE for unique permanent points.
+-//
+-//    Input, int UNIQUE_NUM1, the number of tolerably unique permanent points.
+-//
+-//    Input, int UNDX1[UNIQUE_NUM1],
+-//    the index in A1 of the tolerably unique permanent points.
+-//
+-//    Input, int XDNU1[N1], the index in UNDX1
+-//    of the tolerably unique permanent point that "represents" this point.
+-//
+-//    Output, double R2[N2], the scalar values assigned to
+-//    A2 for sorting.
+-//
+-//    Output, int INDX2[N2], the ascending sort index for A2.
+-//
+-//    Output, bool UNIQUE2[N2], is TRUE for unique temporary points.
+-//
+-//    Output, int *UNIQUE_NUM2, the number
+-//    of tolerably unique temporary points.
+-//
+-//    Output, int UNDX2[UNIQUE_NUM2],
+-//    the index in A2 of the tolerably unique points, incremented by N1.
+-//
+-//    Output, int XDNU2[N2], the index, in UNDX1
+-//    or UNDX2, of the tolerably unique point that "represents" this
+-//    temporary point.  If the value represents an index in UNDX2, this
+-//    can be inferred by the fact that its value is greater than or
+-//    equal to UNIQUE_NUM1.  To reference UNDX2, the value should then be
+-//    decremented by UNIQUE_NUM1.
+-//
+-{
+-  double dist;
+-  int hi;
+-  int i;
+-  int j;
+-  int j1;
+-  int j2;
+-  int j2_hi;
+-  int j2_lo;
+-  int k1;
+-  int k2;
+-  double r_hi;
+-  double r_lo;
+-//
+-//  Initialize the temporary point data.
+-//
+-  for ( j2 = 0; j2 < n2; j2++ )
+-  {
+-    r2[j2] = 0.0;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      r2[j2] = r2[j2] + std::pow ( a2[i+j2*m] - z[i], 2 );
+-    }
+-    r2[j2] = std::sqrt ( r2[j2] );
+-  }
+-
+-  webbur::r8vec_sort_heap_index_a ( n2, r2, indx2 );
+-
+-  for ( j2 = 0; j2 < n2; j2++ )
+-  {
+-    unique2[j2] = true;
+-  }
+-
+-  *unique_num2 = 0;
+-//
+-//  STEP 2:
+-//  Use PERMANENT points to eliminate TEMPORARY points.
+-//
+-  for ( j1 = 0; j1 < n1; j1++ )
+-  {
+-    if ( unique1[indx1[j1]] )
+-    {
+-      r_lo = r1[indx1[j1]] - tol;
+-      r_hi = r1[indx1[j1]] + tol;
+-
+-      webbur::r8vec_index_sorted_range ( n2, r2, indx2, r_lo, r_hi,
+-        &j2_lo, &j2_hi );
+-
+-      for ( j2 = j2_lo; j2 <= j2_hi; j2++ )
+-      {
+-        if ( unique2[indx2[j2]] )
+-        {
+-          dist = 0.0;
+-          for ( i = 0; i < m; i++ )
+-          {
+-            dist = dist + std::pow ( a1[i+indx1[j1]*m]
+-                                   - a2[i+indx2[j2]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-          if ( dist <= tol )
+-          {
+-            unique2[indx2[j2]] = false;
+-            xdnu2[indx2[j2]] = xdnu1[indx1[j1]];
+-          }
+-        }
+-      }
+-    }
+-  }
+-//
+-//  STEP 3:
+-//  Use TEMPORARY points to eliminate TEMPORARY points.
+-//
+-  for ( j2 = 0; j2 < n2; j2++ )
+-  {
+-    if ( unique2[indx2[j2]] )
+-    {
+-      xdnu2[indx2[j2]] = unique_num1 + *unique_num2;
+-      undx2[*unique_num2] = indx2[j2] + n1;
+-      *unique_num2 = *unique_num2 + 1;
+-
+-      hi = j2;
+-
+-      while ( hi < n2 - 1 )
+-      {
+-        if ( r2[indx2[j2]] + tol < r2[indx2[hi+1]] )
+-        {
+-          break;
+-        }
+-        hi = hi + 1;
+-      }
+-
+-      for ( k2 = j2 + 1; k2 <= hi; k2++ )
+-      {
+-        if ( unique2[indx2[k2]] )
+-        {
+-          dist = 0.0;
+-          for ( i = 0; i < m; i++ )
+-          {
+-            dist = dist + std::pow ( a2[i+indx2[j2]*m] - a2[i+indx2[k2]*m], 2 );
+-          }
+-          dist = std::sqrt ( dist );
+-
+-          if ( dist <= tol )
+-          {
+-            unique2[indx2[k2]] = false;
+-            xdnu2[indx2[k2]] = xdnu2[indx2[j2]];
+-          }
+-        }
+-      }
+-    }
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void point_radial_tol_unique_index_inc3 ( int m, int n1, double a1[],
+-  double r1[], int indx1[], bool unique1[], int unique_num1, int undx1[],
+-  int xdnu1[], int n2, double a2[], double r2[], int indx2[], bool unique2[],
+-  int unique_num2, int undx2[], int xdnu2[], int *n3, double a3[], double r3[],
+-  int indx3[], bool unique3[], int *unique_num3, int undx3[], int xdnu3[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC3 merges index data.
+-//
+-//  Discussion:
+-//
+-//    This function may be called after *INDEX_INC1 has created index
+-//    information for the permanent data, and *INDEX_INC2 has created
+-//    augmenting information for a set of temporary data which now is
+-//    to be merged with the permanent data.
+-//
+-//    The function merges the data and index information to create a
+-//    new "permanent" data set.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    08 October 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows.
+-//
+-//    Input, int N1, the number of permanent points.
+-//
+-//    Input, double A1[M*N1], the permanent points.
+-//
+-//    Input, double R1[N1], the scalar values assigned to
+-//    the data for sorting.
+-//
+-//    Input, int INDX1[N1], the ascending sort index
+-//    for A1.
+-//
+-//    Input, bool UNIQUE1[N1], is TRUE for each unique permanent point.
+-//
+-//    Input, int UNIQUE_NUM1, the number
+-//    of tolerably unique points with just the permanent points.
+-//
+-//    Input, int UNDX1[UNIQUE_NUM1],
+-//    the index in A1 of the tolerably unique points.
+-//
+-//    Input, int XDNU1[N1], the index in UNDX1
+-//    of the tolerably unique point that "represents" this point.
+-//
+-//    Input, int N2, the number of temporary points.
+-//
+-//    Input, double A2[M,N2], the temporary points.
+-//
+-//    Input, double R2[N2], the scalar values assigned to
+-//    the data for sorting.
+-//
+-//    Input, int INDX2[N2], the ascending sort index
+-//    for A2.
+-//
+-//    Input, bool UNIQUE2[N2], is TRUE for each unique temporary point.
+-//
+-//    Input, int UNIQUE_NUM2, the number
+-//    of tolerably unique temporary points.
+-//
+-//    Input, int UNDX2[UNIQUE_NUM2],
+-//    the index in A2 of the tolerably unique points, incremented by UNIQUE_NUM1.
+-//
+-//    Input, int XDNU2[N2], the index in UNDX1 or UNDX2
+-//    of the tolerably unique point that "represents" this point.
+-//
+-//    Output, int *N3, the number of permanent points.
+-//
+-//    Output, double A3[M,N3], the permanent points.
+-//
+-//    Output, double R3[N3], the scalar values assigned to
+-//    the data for sorting.
+-//
+-//    Output, int INDX3[N3], the ascending sort index
+-//    for A3.
+-//
+-//    Output, bool UNIQUE3[N3], is TRUE for each unique permanent point.
+-//
+-//    Output, int *UNIQUE_NUM3, the number
+-//    of tolerably unique points.
+-//
+-//    Output, int UNDX3[UNIQUE_NUM3],
+-//    the index in A3 of the tolerably unique points.
+-//
+-//    Output, int XDNU3[N3], the index in UNDX3
+-//    of the tolerably unique point that "represents" this point.
+-//
+-{
+-  int i;
+-  int i1;
+-  int i2;
+-  int i3;
+-  double v1;
+-  double v2;
+-
+-  *n3 = n1 + n2;
+-
+-  for ( i1 = 0; i1 < n1; i1++ )
+-  {
+-    for ( i = 0; i < m; i++ )
+-    {
+-      a3[i+i1*m] = a1[i+i1*m];
+-    }
+-  }
+-  for ( i2 = 0; i2 < n2; i2++ )
+-  {
+-    i3 = n1 + i2;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      a3[i+i3*m] = a2[i+i2*m];
+-    }
+-  }
+-  for ( i1 = 0; i1 < n1; i1++ )
+-  {
+-    r3[i1]= r1[i1];
+-  }
+-  for ( i2 = 0; i2 < n2; i2++ )
+-  {
+-    i3 = n1 + i2;
+-    r3[i3] = r2[i2];
+-  }
+-//
+-//  Interleave the two INDX arrays so that INDX3 presents the entries
+-//  of A3 in ascending R3 order.
+-//
+-  i1 = 0;
+-  i2 = 0;
+-
+-  for ( i3 = 0; i3 < *n3; i3++ )
+-  {
+-    if ( i1 < n1 )
+-    {
+-      v1 = r1[indx1[i1]];
+-    }
+-    else
+-    {
+-      v1 = r8_huge ( );
+-    }
+-
+-    if ( i2 < n2 )
+-    {
+-      v2 = r2[indx2[i2]];
+-    }
+-    else
+-    {
+-      v2 = r8_huge ( );
+-    }
+-
+-    if ( v1 <= v2 )
+-    {
+-      indx3[i3] = indx1[i1];
+-      i1 = i1 + 1;
+-    }
+-    else
+-    {
+-      indx3[i3] = indx2[i2] + n1;
+-      i2 = i2 + 1;
+-    }
+-  }
+-
+-  *unique_num3 = unique_num1 + unique_num2;
+-
+-  for ( i1 = 0; i1 < n1; i1++ )
+-  {
+-    unique3[i1] = unique1[i1];
+-  }
+-  for ( i2 = 0; i2 < n2; i2++ )
+-  {
+-    i3 = n1 + i2;
+-    unique3[i3] = unique2[i2];
+-  }
+-//
+-//  The entries in UNDX2 were already incremented by N2 if they pointed
+-//  to an entry of A2, so all entries in UNDX2 correctly index A3.
+-//
+-  for ( i1 = 0; i1 < unique_num1; i1++ )
+-  {
+-    undx3[i1] = undx1[i1];
+-  }
+-  for ( i2 = 0; i2 < unique_num2; i2++ )
+-  {
+-    i3 = unique_num1 + i2;
+-    undx3[i3] = undx2[i2];
+-  }
+-//
+-//  Note that the entries of XDNU2 were already incremented by N2
+-//  so that they correctly index A3, not A2.
+-//
+-  for ( i1 = 0; i1 < n1; i1++ )
+-  {
+-    xdnu3[i1] = xdnu1[i1];
+-  }
+-  for ( i2 = 0; i2 < n2; i2++ )
+-  {
+-    i3 = n1 + i2;
+-    xdnu3[i3] = xdnu2[i2];
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void point_unique_index ( int m, int n, double a[], int unique_num, int undx[],
+-  int xdnu[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    POINT_UNIQUE_INDEX indexes unique points.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//    The goal of this routine is to determine a vector UNDX,
+-//    which points to the unique elements of A, in sorted order,
+-//    and a vector XDNU, which identifies, for each entry of A, the index of
+-//    the unique sorted element of A.
+-//
+-//    This is all done with index vectors, so that the elements of
+-//    A are never moved.
+-//
+-//    The first step of the algorithm requires the indexed sorting
+-//    of A, which creates arrays INDX and XDNI.  (If all the entries
+-//    of A are unique, then these arrays are the same as UNDX and XDNU.)
+-//
+-//    We then use INDX to examine the entries of A in sorted order,
+-//    noting the unique entries, creating the entries of XDNU and
+-//    UNDX as we go.
+-//
+-//    Once this process has been completed, the vector A could be
+-//    replaced by a compressed vector XU, containing the unique entries
+-//    of A in sorted order, using the formula
+-//
+-//      XU(*) = A(UNDX(*)).
+-//
+-//    We could then, if we wished, reconstruct the entire vector A, or
+-//    any element of it, by index, as follows:
+-//
+-//      A(I) = XU(XDNU(I)).
+-//
+-//    We could then replace A by the combination of XU and XDNU.
+-//
+-//    Later, when we need the I-th entry of A, we can locate it as
+-//    the XDNU(I)-th entry of XU.
+-//
+-//    Here is an example of a vector A, the sort and inverse sort
+-//    index vectors, and the unique sort and inverse unique sort vectors
+-//    and the compressed unique sorted vector.
+-//
+-//      I     A  Indx  Xdni       XU  Undx  Xdnu
+-//    ----+-----+-----+-----+--------+-----+-----+
+-//      0 | 11.     0     0 |    11.     0     0
+-//      1 | 22.     2     4 |    22.     1     1
+-//      2 | 11.     5     1 |    33.     3     0
+-//      3 | 33.     8     7 |    55.     4     2
+-//      4 | 55.     1     8 |                  3
+-//      5 | 11.     6     2 |                  0
+-//      6 | 22.     7     5 |                  1
+-//      7 | 22.     3     6 |                  1
+-//      8 | 11.     4     3 |                  0
+-//
+-//    INDX(2) = 3 means that sorted item(2) is A(3).
+-//    XDNI(2) = 5 means that A(2) is sorted item(5).
+-//
+-//    UNDX(3) = 4 means that unique sorted item(3) is at A(4).
+-//    XDNU(8) = 2 means that A(8) is at unique sorted item(2).
+-//
+-//    XU(XDNU(I))) = A(I).
+-//    XU(I)        = A(UNDX(I)).
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 July 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the dimension of the data values.
+-//
+-//    Input, int N, the number of data values,
+-//
+-//    Input, double A[M*N], the data values.
+-//
+-//    Input, int UNIQUE_NUM, the number of unique values in A.
+-//    This value is only required for languages in which the size of
+-//    UNDX must be known in advance.
+-//
+-//    Output, int UNDX[UNIQUE_NUM], the UNDX vector.
+-//
+-//    Output, int XDNU[N], the XDNU vector.
+-//
+-{
+-  double diff;
+-  int i;
+-  int *indx;
+-  int j;
+-  int k;
+-//
+-//  Implicitly sort the array.
+-//
+-  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
+-//
+-//  Walk through the implicitly sorted array.
+-//
+-  i = 0;
+-
+-  j = 0;
+-  undx[j] = indx[i];
+-
+-  xdnu[indx[i]] = j;
+-
+-  for ( i = 1; i < n; i++ )
+-  {
+-    diff = 0.0;
+-    for ( k = 0; k < m; k++ )
+-    {
+-      diff = webbur::r8_max ( diff,
+-        webbur::r8_abs ( a[k+indx[i]*m] - a[k+undx[j]*m] ) );
+-    }
+-    if ( 0.0 < diff )
+-    {
+-      j = j + 1;
+-      undx[j] = indx[i];
+-    }
+-    xdnu[indx[i]] = j;
+-  }
+-  delete [] indx;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void product_mixed_weight ( int dim_num, int order_1d[], int order_nd,
+-  int rule[], double alpha[], double beta[], double weight_nd[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    PRODUCT_MIXED_WEIGHT computes the weights of a mixed product rule.
+-//
+-//  Discussion:
+-//
+-//    This routine computes the weights for a quadrature rule which is
+-//    a product of 1D rules of varying order and kind.
+-//
+-//    The user must preallocate space for the output array WEIGHT_ND.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    11 February 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int DIM_NUM, the spatial dimension.
+-//
+-//    Input, int ORDER_1D[DIM_NUM], the order of the 1D rules.
+-//
+-//    Input, int ORDER_ND, the order of the product rule.
+-//
+-//    Input, int RULE[DIM_NUM], the rule in each dimension.
+-//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
+-//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
+-//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
+-//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
+-//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
+-//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
+-//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
+-//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
+-//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
+-//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
+-//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
+-//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
+-//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
+-//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
+-//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
+-//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
+-//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
+-//
+-//    Input, double ALPHA[DIM_NUM], BETA[DIM_NUM], parameters used for
+-//    Generalized Gauss Hermite, Generalized Gauss Laguerre,
+-//    and Gauss Jacobi rules.
+-//
+-//    Output, double WEIGHT_ND[ORDER_ND], the product rule weights.
+-//
+-{
+-  int dim;
+-  int i;
+-  double *weight_1d;
+-
+-  for ( i = 0; i < order_nd; i++ )
+-  {
+-    weight_nd[i] = 1.0;
+-  }
+-
+-  for ( dim = 0; dim < dim_num; dim++ )
+-  {
+-    weight_1d = new double[order_1d[dim]];
+-
+-    if ( rule[dim] == 1 )
+-    {
+-      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 2 )
+-    {
+-      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 3 )
+-    {
+-      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 4 )
+-    {
+-      webbur::legendre_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 5 )
+-    {
+-      webbur::hermite_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 6 )
+-    {
+-      webbur::gen_hermite_compute_weights ( order_1d[dim], alpha[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 7 )
+-    {
+-      webbur::laguerre_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 8 )
+-    {
+-      webbur::gen_laguerre_compute_weights ( order_1d[dim], alpha[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 9 )
+-    {
+-      webbur::jacobi_compute_weights ( order_1d[dim], alpha[dim], beta[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 10 )
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "PRODUCT_MIXED_WEIGHT - Fatal error!\n";
+-      std::cerr << "  Do not know how to set weights for rule 10.\n";
+-      std::exit ( 1 );
+-    }
+-    else if ( rule[dim] == 11 )
+-    {
+-      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 12 )
+-    {
+-      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 13 )
+-    {
+-      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 14 )
+-    {
+-      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 15 )
+-    {
+-      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 16 )
+-    {
+-      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
+-    }
+-    else if ( rule[dim] == 17 )
+-    {
+-      webbur::ccn_compute_weights ( order_1d[dim], weight_1d );
+-    }
+-    else
+-    {
+-      std::cerr << "\n";
+-      std::cerr << "PRODUCT_MIXED_WEIGHT - Fatal error!\n";
+-      std::cerr << "  Unexpected value of RULE[" << dim << "] = "
+-           << rule[dim] << ".\n";
+-      std::exit ( 1 );
+-    }
+-
+-    webbur::r8vec_direct_product2 ( dim, order_1d[dim], weight_1d,
+-      dim_num, order_nd, weight_nd );
+-
+-    delete [] weight_1d;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-double r8_abs ( double x )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_ABS returns the absolute value of an R8.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, double X, the quantity whose absolute value is desired.
+-//
+-//    Output, double R8_ABS, the absolute value of X.
+-//
+-{
+-  double value;
+-
+-  if ( 0.0 <= x )
+-  {
+-    value = x;
+-  }
+-  else
+-  {
+-    value = -x;
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_ceiling ( double x )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_CEILING rounds an R8 "up" (towards +oo) to the next integer.
+-//
+-//  Example:
+-//
+-//    X        R8_CEILING(X)
+-//
+-//   -1.1      -1.0
+-//   -1.0      -1.0
+-//   -0.9       0.0
+-//   -0.1       0.0
+-//    0.0       0.0
+-//    0.1       1.0
+-//    0.9       1.0
+-//    1.0       1.0
+-//    1.1       2.0
+-//    2.9       3.0
+-//    3.0       3.0
+-//    3.14159   4.0
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 April 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, double X, the number whose ceiling is desired.
+-//
+-//    Output, double R8_CEILING, the ceiling of X.
+-//
+-{
+-  double value;
+-
+-  value = ( int ) x;
+-
+-  if ( value < x )
+-  {
+-    value = value + 1.0;
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_choose ( int n, int k )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_CHOOSE computes the binomial coefficient C(N,K) as an R8.
+-//
+-//  Discussion:
+-//
+-//    The value is calculated in such a way as to avoid overflow and
+-//    roundoff.  The calculation is done in R8 arithmetic.
+-//
+-//    The formula used is:
+-//
+-//      C(N,K) = N! / ( K! * (N-K)! )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    24 March 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    ML Wolfson, HV Wright,
+-//    Algorithm 160:
+-//    Combinatorial of M Things Taken N at a Time,
+-//    Communications of the ACM,
+-//    Volume 6, Number 4, April 1963, page 161.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, K, the values of N and K.
+-//
+-//    Output, double R8_CHOOSE, the number of combinations of N
+-//    things taken K at a time.
+-//
+-{
+-  int i;
+-  int mn;
+-  int mx;
+-  int value;
+-
+-  mn = webbur::i4_min ( k, n - k );
+-
+-  if ( mn < 0 )
+-  {
+-    value = 0.0;
+-  }
+-  else if ( mn == 0 )
+-  {
+-    value = 1.0;
+-  }
+-  else
+-  {
+-    mx = webbur::i4_max ( k, n - k );
+-    value = ( double ) ( mx + 1 );
+-
+-    for ( i = 2; i <= mn; i++ )
+-    {
+-      value = ( value * ( double ) ( mx + i ) ) / ( double ) i;
+-    }
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_epsilon ( )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_EPSILON returns the R8 roundoff unit.
+-//
+-//  Discussion:
+-//
+-//    The roundoff unit is a number R which is a power of 2 with the
+-//    property that, to the precision of the computer's arithmetic,
+-//      1 < 1 + R
+-//    but
+-//      1 = ( 1 + R / 2 )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 February 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Output, double R8_EPSILON, the R8 round-off unit.
+-//
+-{
+-  double value;
+-
+-  value = 1.0;
+-
+-  while ( 1.0 < ( double ) ( 1.0 + value )  )
+-  {
+-    value = value / 2.0;
+-  }
+-
+-  value = 2.0 * value;
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_factorial ( int n )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_FACTORIAL computes the factorial of N.
+-//
+-//  Discussion:
+-//
+-//    factorial ( N ) = product ( 1 <= I <= N ) I
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    16 January 1999
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the argument of the factorial function.
+-//    If N is less than 1, the function value is returned as 1.
+-//
+-//    Output, double R8_FACTORIAL, the factorial function.
+-//
+-{
+-  int i;
+-  double value;
+-
+-  value = 1.0;
+-
+-  for ( i = 1; i <= n; i++ )
+-  {
+-    value = value * ( double ) ( i );
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_factorial2 ( int n )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_FACTORIAL2 computes the double factorial function.
+-//
+-//  Discussion:
+-//
+-//    FACTORIAL2( N ) = Product ( N * (N-2) * (N-4) * ... * 2 )  (N even)
+-//                    = Product ( N * (N-2) * (N-4) * ... * 1 )  (N odd)
+-//
+-//  Example:
+-//
+-//     N    FACTORIAL2(N)
+-//
+-//     0     1
+-//     1     1
+-//     2     2
+-//     3     3
+-//     4     8
+-//     5    15
+-//     6    48
+-//     7   105
+-//     8   384
+-//     9   945
+-//    10  3840
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 January 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the argument of the double factorial
+-//    function.  If N is less than 1, R8_FACTORIAL2 is returned as 1.0.
+-//
+-//    Output, double R8_FACTORIAL2, the double factorial function.
+-//
+-{
+-  int n_copy;
+-  double value;
+-
+-  value = 1.0;
+-
+-  if ( n < 1 )
+-  {
+-    return value;
+-  }
+-
+-  n_copy = n;
+-
+-  while ( 1 < n_copy )
+-  {
+-    value = value * ( double ) n_copy;
+-    n_copy = n_copy - 2;
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_floor ( double x )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_FLOOR rounds an R8 "down" (towards -infinity) to the next integer.
+-//
+-//  Example:
+-//
+-//    X        R8_FLOOR(X)
+-//
+-//   -1.1      -2.0
+-//   -1.0      -1.0
+-//   -0.9      -1.0
+-//   -0.1      -1.0
+-//    0.0       0.0
+-//    0.1       0.0
+-//    0.9       0.0
+-//    1.0       1.0
+-//    1.1       1.0
+-//    2.9       2.0
+-//    3.0       3.0
+-//    3.14159   3.0
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    15 April 2007
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, double X, the number whose floor is desired.
+-//
+-//    Output, double R8_FLOOR, the floor of X.
+-//
+-{
+-  double value;
+-
+-  value = ( int ) x;
+-
+-  if ( x < value )
+-  {
+-    value = value - 1.0;
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_gamma ( double x )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_GAMMA evaluates Gamma(X) for a real argument.
+-//
+-//  Discussion:
+-//
+-//    This routine calculates the gamma function for a real argument X.
+-//
+-//    Computation is based on an algorithm outlined in reference 1.
+-//    The program uses rational functions that approximate the gamma
+-//    function to at least 20 significant decimal digits.  Coefficients
+-//    for the approximation over the interval (1,2) are unpublished.
+-//    Those for the approximation for 12 <= X are from reference 2.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 January 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by William Cody, Laura Stoltz.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    William Cody,
+-//    An Overview of Software Development for Special Functions,
+-//    in Numerical Analysis Dundee, 1975,
+-//    edited by GA Watson,
+-//    Lecture Notes in Mathematics 506,
+-//    Springer, 1976.
+-//
+-//    John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
+-//    Charles Mesztenyi, John Rice, Henry Thatcher,
+-//    Christoph Witzgall,
+-//    Computer Approximations,
+-//    Wiley, 1968,
+-//    LC: QA297.C64.
+-//
+-//  Parameters:
+-//
+-//    Input, double X, the argument of the function.
+-//
+-//    Output, double R8_GAMMA, the value of the function.
+-//
+-{
+-//
+-//  Coefficients for minimax approximation over (12, INF).
+-//
+-  double c[7] = {
+-   -1.910444077728E-03,
+-    8.4171387781295E-04,
+-   -5.952379913043012E-04,
+-    7.93650793500350248E-04,
+-   -2.777777777777681622553E-03,
+-    8.333333333333333331554247E-02,
+-    5.7083835261E-03 };
+-  double eps = 2.22E-16;
+-  double fact;
+-  int i;
+-  int n;
+-  double one = 1.0;
+-  double p[8] = {
+-  -1.71618513886549492533811E+00,
+-   2.47656508055759199108314E+01,
+-  -3.79804256470945635097577E+02,
+-   6.29331155312818442661052E+02,
+-   8.66966202790413211295064E+02,
+-  -3.14512729688483675254357E+04,
+-  -3.61444134186911729807069E+04,
+-   6.64561438202405440627855E+04 };
+-  bool parity;
+-  double pi = 3.1415926535897932384626434;
+-  double q[8] = {
+-  -3.08402300119738975254353E+01,
+-   3.15350626979604161529144E+02,
+-  -1.01515636749021914166146E+03,
+-  -3.10777167157231109440444E+03,
+-   2.25381184209801510330112E+04,
+-   4.75584627752788110767815E+03,
+-  -1.34659959864969306392456E+05,
+-  -1.15132259675553483497211E+05 };
+-  double res;
+-  double sqrtpi = 0.9189385332046727417803297;
+-  double sum;
+-  double twelve = 12.0;
+-  double two = 2.0;
+-  double value;
+-  double xbig = 171.624;
+-  double xden;
+-  double xinf = 1.79E+308;
+-  double xminin = 2.23E-308;
+-  double xnum;
+-  double y;
+-  double y1;
+-  double ysq;
+-  double z;
+-
+-  parity = false;
+-  fact = one;
+-  n = 0;
+-  y = x;
+-//
+-//  Argument is negative.
+-//
+-  if ( y <= 0.0 )
+-  {
+-    y = - x;
+-    y1 = ( double ) ( int ) ( y );
+-    res = y - y1;
+-
+-    if ( res != 0.0 )
+-    {
+-      if ( y1 != ( double ) ( int ) ( y1 * 0.5 ) * two )
+-      {
+-        parity = true;
+-      }
+-
+-      fact = - pi / std::sin ( pi * res );
+-      y = y + one;
+-    }
+-    else
+-    {
+-      res = xinf;
+-      value = res;
+-      return value;
+-    }
+-  }
+-//
+-//  Argument is positive.
+-//
+-  if ( y < eps )
+-  {
+-//
+-//  Argument < EPS.
+-//
+-    if ( xminin <= y )
+-    {
+-      res = one / y;
+-    }
+-    else
+-    {
+-      res = xinf;
+-      value = res;
+-      return value;
+-    }
+-  }
+-  else if ( y < twelve )
+-  {
+-    y1 = y;
+-//
+-//  0.0 < argument < 1.0.
+-//
+-    if ( y < one )
+-    {
+-      z = y;
+-      y = y + one;
+-    }
+-//
+-//  1.0 < argument < 12.0.
+-//  Reduce argument if necessary.
+-//
+-    else
+-    {
+-      n = ( int ) ( y ) - 1;
+-      y = y - ( double ) ( n );
+-      z = y - one;
+-    }
+-//
+-//  Evaluate approximation for 1.0 < argument < 2.0.
+-//
+-    xnum = 0.0;
+-    xden = one;
+-    for ( i = 0; i < 8; i++ )
+-    {
+-      xnum = ( xnum + p[i] ) * z;
+-      xden = xden * z + q[i];
+-    }
+-    res = xnum / xden + one;
+-//
+-//  Adjust result for case  0.0 < argument < 1.0.
+-//
+-    if ( y1 < y )
+-    {
+-      res = res / y1;
+-    }
+-//
+-//  Adjust result for case 2.0 < argument < 12.0.
+-//
+-    else if ( y < y1 )
+-    {
+-      for ( i = 1; i <= n; i++ )
+-      {
+-        res = res * y;
+-        y = y + one;
+-      }
+-    }
+-  }
+-  else
+-  {
+-//
+-//  Evaluate for 12.0 <= argument.
+-//
+-    if ( y <= xbig )
+-    {
+-      ysq = y * y;
+-      sum = c[6];
+-      for ( i = 0; i < 6; i++ )
+-      {
+-        sum = sum / ysq + c[i];
+-      }
+-      sum = sum / y - y + sqrtpi;
+-      sum = sum + ( y - 0.5 ) * std::log ( y );
+-      res = std::exp ( sum );
+-    }
+-    else
+-    {
+-      res = xinf;
+-      value = res;
+-      return value;
+-    }
+-  }
+-//
+-//  Final adjustments and return.
+-//
+-  if ( parity )
+-  {
+-    res = - res;
+-  }
+-
+-  if ( fact != one )
+-  {
+-    res = fact / res;
+-  }
+-
+-  value = res;
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_huge ( )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_HUGE returns a "huge" R8.
+-//
+-//  Discussion:
+-//
+-//    The value returned by this function is NOT required to be the
+-//    maximum representable R8.  This value varies from machine to machine,
+-//    from compiler to compiler, and may cause problems when being printed.
+-//    We simply want a "very large" but non-infinite number.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    06 October 2007
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Output, double R8_HUGE, a "huge" R8 value.
+-//
+-{
+-  double value;
+-
+-  value = 1.0E+30;
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_hyper_2f1 ( double a, double b, double c, double x )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_HYPER_2F1 evaluates the hypergeometric function 2F1(A,B,C,X).
+-//
+-//  Discussion:
+-//
+-//    A bug was corrected.  A line which read
+-//      c1 = - ( - 1.0, m ) * gc / ( gam * gbm * rm );
+-//    was corrected to read
+-//      c1 = - std::pow ( - 1.0, m ) * gc / ( gam * gbm * rm );
+-//    JVB, 05 July 2009.
+-//
+-//    A minor bug was corrected.  The HW variable, used in several places as
+-//    the "old" value of a quantity being iteratively improved, was not
+-//    being initialized.  JVB, 11 February 2008.
+-//
+-//    The FORTRAN77 original version of this routine is copyrighted by
+-//    Shanjie Zhang and Jianming Jin.  However, they give permission to
+-//    incorporate this routine into a user program provided that the copyright
+-//    is acknowledged.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    05 July 2009
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Shanjie Zhang, Jianming Jin.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    Shanjie Zhang, Jianming Jin,
+-//    Computation of Special Functions,
+-//    Wiley, 1996,
+-//    ISBN: 0-471-11963-6,
+-//    LC: QA351.C45
+-//
+-//  Parameters:
+-//
+-//    Input, double A, B, C, X, the arguments of the function.
+-//    C must not be equal to a nonpositive integer.
+-//    X < 1.
+-//
+-//    Output, double R8_HYPER_2F1, the value of the function.
+-//
+-{
+-  double a0;
+-  double aa;
+-  double bb;
+-  double c0;
+-  double c1;
+-  double el = 0.5772156649015329;
+-  double eps;
+-  double f0;
+-  double f1;
+-  double g0;
+-  double g1;
+-  double g2;
+-  double g3;
+-  double ga;
+-  double gabc;
+-  double gam;
+-  double gb;
+-  double gbm;
+-  double gc;
+-  double gca;
+-  double gcab;
+-  double gcb;
+-  double gm;
+-  double hf;
+-  double hw;
+-  int j;
+-  int k;
+-  bool l0;
+-  bool l1;
+-  bool l2;
+-  bool l3;
+-  bool l4;
+-  bool l5;
+-  int m;
+-  int nm;
+-  double pa;
+-  double pb;
+-  double pi = 3.141592653589793;
+-  double r;
+-  double r0;
+-  double r1;
+-  double rm;
+-  double rp;
+-  double sm;
+-  double sp;
+-  double sp0;
+-  double x1;
+-
+-  l0 = ( c == ( int ) ( c ) ) && ( c < 0.0 );
+-  l1 = ( 1.0 - x < 1.0E-15 ) && ( c - a - b <= 0.0 );
+-  l2 = ( a == ( int ) ( a ) ) && ( a < 0.0 );
+-  l3 = ( b == ( int ) ( b ) ) && ( b < 0.0 );
+-  l4 = ( c - a == ( int ) ( c - a ) ) && ( c - a <= 0.0 );
+-  l5 = ( c - b == ( int ) ( c - b ) ) && ( c - b <= 0.0 );
+-
+-  if ( l0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8_HYPER_2F1 - Fatal error!\n";
+-    std::cerr << "  The hypergeometric series is divergent.\n";
+-    std::cerr << "  C is integral and negative.\n";
+-    std::cerr << "  C = " << c << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  if ( l1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8_HYPER_2F1 - Fatal error!\n";
+-    std::cerr << "  The hypergeometric series is divergent.\n";
+-    std::cerr << "  1 - X < 0, C - A - B <= 0\n";
+-    std::cerr << "  A = " << a << "\n";
+-    std::cerr << "  B = " << b << "\n";
+-    std::cerr << "  C = " << c << "\n";
+-    std::cerr << "  X = " << x << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  if ( 0.95 < x )
+-  {
+-    eps = 1.0E-08;
+-  }
+-  else
+-  {
+-    eps = 1.0E-15;
+-  }
+-
+-  if ( x == 0.0 || a == 0.0 || b == 0.0 )
+-  {
+-    hf = 1.0;
+-    return hf;
+-  }
+-  else if ( 1.0 - x == eps && 0.0 < c - a - b )
+-  {
+-    gc = webbur::r8_gamma ( c );
+-    gcab = webbur::r8_gamma ( c - a - b );
+-    gca = webbur::r8_gamma ( c - a );
+-    gcb = webbur::r8_gamma ( c - b );
+-    hf = gc * gcab / ( gca * gcb );
+-    return hf;
+-  }
+-  else if ( 1.0 + x <= eps && r8_abs ( c - a + b - 1.0 ) <= eps )
+-  {
+-    g0 = std::sqrt ( pi ) * std::pow ( 2.0, - a );
+-    g1 = webbur::r8_gamma ( c );
+-    g2 = webbur::r8_gamma ( 1.0 + a / 2.0 - b );
+-    g3 = webbur::r8_gamma ( 0.5 + 0.5 * a );
+-    hf = g0 * g1 / ( g2 * g3 );
+-    return hf;
+-  }
+-  else if ( l2 || l3 )
+-  {
+-    if ( l2 )
+-    {
+-      nm = ( int ) ( webbur::r8_abs ( a ) );
+-    }
+-
+-    if ( l3 )
+-    {
+-      nm = ( int ) ( webbur::r8_abs ( b ) );
+-    }
+-
+-    hf = 1.0;
+-    r = 1.0;
+-
+-    for ( k = 1; k <= nm; k++ )
+-    {
+-      r = r * ( a + k - 1.0 ) * ( b + k - 1.0 )
+-        / ( k * ( c + k - 1.0 ) ) * x;
+-      hf = hf + r;
+-    }
+-
+-    return hf;
+-  }
+-  else if ( l4 || l5 )
+-  {
+-    if ( l4 )
+-    {
+-      nm = ( int ) ( webbur::r8_abs ( c - a ) );
+-    }
+-
+-    if ( l5 )
+-    {
+-      nm = ( int ) ( webbur::r8_abs ( c - b ) );
+-    }
+-
+-    hf = 1.0;
+-    r  = 1.0;
+-    for ( k = 1; k <= nm; k++ )
+-    {
+-      r = r * ( c - a + k - 1.0 ) * ( c - b + k - 1.0 )
+-        / ( k * ( c + k - 1.0 ) ) * x;
+-      hf = hf + r;
+-    }
+-    hf = std::pow ( 1.0 - x, c - a - b ) * hf;
+-    return hf;
+-  }
+-
+-  aa = a;
+-  bb = b;
+-  x1 = x;
+-
+-  if ( x < 0.0 )
+-  {
+-    x = x / ( x - 1.0 );
+-    if ( a < c && b < a && 0.0 < b )
+-    {
+-      a = bb;
+-      b = aa;
+-    }
+-    b = c - b;
+-  }
+-
+-  if ( 0.75 <= x )
+-  {
+-    gm = 0.0;
+-
+-    if ( webbur::r8_abs ( c - a - b - ( int ) ( c - a - b ) ) < 1.0E-15 )
+-    {
+-      m = ( int ) ( c - a - b );
+-      ga = webbur::r8_gamma ( a );
+-      gb = webbur::r8_gamma ( b );
+-      gc = webbur::r8_gamma ( c );
+-      gam = webbur::r8_gamma ( a + m );
+-      gbm = webbur::r8_gamma ( b + m );
+-
+-      pa = webbur::r8_psi ( a );
+-      pb = webbur::r8_psi ( b );
+-
+-      if ( m != 0 )
+-      {
+-        gm = 1.0;
+-      }
+-
+-      for ( j = 1; j <= std::abs ( m ) - 1; j++ )
+-      {
+-        gm = gm * j;
+-      }
+-
+-      rm = 1.0;
+-      for ( j = 1; j <= std::abs ( m ); j++ )
+-      {
+-        rm = rm * j;
+-      }
+-
+-      f0 = 1.0;
+-      r0 = 1.0;;
+-      r1 = 1.0;
+-      sp0 = 0.0;;
+-      sp = 0.0;
+-
+-      if ( 0 <= m )
+-      {
+-        c0 = gm * gc / ( gam * gbm );
+-        c1 = - gc * std::pow ( x - 1.0, m ) / ( ga * gb * rm );
+-
+-        for ( k = 1; k <= m - 1; k++ )
+-        {
+-          r0 = r0 * ( a + k - 1.0 ) * ( b + k - 1.0 )
+-            / ( k * ( k - m ) ) * ( 1.0 - x );
+-          f0 = f0 + r0;
+-        }
+-
+-        for ( k = 1; k <= m; k++ )
+-        {
+-          sp0 = sp0 + 1.0 / ( a + k - 1.0 ) + 1.0 / ( b + k - 1.0 )
+-          - 1.0 / ( double ) ( k );
+-        }
+-
+-        f1 = pa + pb + sp0 + 2.0 * el + std::log ( 1.0 - x );
+-        hw = f1;
+-
+-        for ( k = 1; k <= 250; k++ )
+-        {
+-          sp = sp + ( 1.0 - a ) / ( k * ( a + k - 1.0 ) )
+-            + ( 1.0 - b ) / ( k * ( b + k - 1.0 ) );
+-
+-          sm = 0.0;
+-          for ( j = 1; j <= m; j++ )
+-          {
+-            sm = sm + ( 1.0 - a )
+-              / ( ( j + k ) * ( a + j + k - 1.0 ) )
+-              + 1.0 / ( b + j + k - 1.0 );
+-          }
+-
+-          rp = pa + pb + 2.0 * el + sp + sm + std::log ( 1.0 - x );
+-
+-          r1 = r1 * ( a + m + k - 1.0 ) * ( b + m + k - 1.0 )
+-            / ( k * ( m + k ) ) * ( 1.0 - x );
+-
+-          f1 = f1 + r1 * rp;
+-
+-          if ( r8_abs ( f1 - hw ) < r8_abs ( f1 ) * eps )
+-          {
+-            break;
+-          }
+-          hw = f1;
+-        }
+-        hf = f0 * c0 + f1 * c1;
+-      }
+-      else if ( m < 0 )
+-      {
+-        m = - m;
+-        c0 = gm * gc / ( ga * gb * std::pow ( 1.0 - x, m ) );
+-        c1 = - std::pow ( - 1.0, m ) * gc / ( gam * gbm * rm );
+-
+-        for ( k = 1; k <= m - 1; k++ )
+-        {
+-          r0 = r0 * ( a - m + k - 1.0 ) * ( b - m + k - 1.0 )
+-            / ( k * ( k - m ) ) * ( 1.0 - x );
+-          f0 = f0 + r0;
+-        }
+-
+-        for ( k = 1; k <= m; k++ )
+-        {
+-          sp0 = sp0 + 1.0 / ( double ) ( k );
+-        }
+-
+-        f1 = pa + pb - sp0 + 2.0 * el + std::log ( 1.0 - x );
+-        hw = f1;
+-
+-        for ( k = 1; k <= 250; k++ )
+-        {
+-          sp = sp + ( 1.0 - a )
+-            / ( k * ( a + k - 1.0 ) )
+-            + ( 1.0 - b ) / ( k * ( b + k - 1.0 ) );
+-
+-          sm = 0.0;
+-          for ( j = 1; j <= m; j++ )
+-          {
+-            sm = sm + 1.0 / ( double ) ( j + k );
+-          }
+-
+-          rp = pa + pb + 2.0 * el + sp - sm + std::log ( 1.0 - x );
+-
+-          r1 = r1 * ( a + k - 1.0 ) * ( b + k - 1.0 )
+-            / ( k * ( m + k ) ) * ( 1.0 - x );
+-
+-          f1 = f1 + r1 * rp;
+-
+-          if ( webbur::r8_abs ( f1 - hw ) < webbur::r8_abs ( f1 ) * eps )
+-          {
+-            break;
+-          }
+-
+-          hw = f1;
+-        }
+-
+-        hf = f0 * c0 + f1 * c1;
+-      }
+-    }
+-    else
+-    {
+-      ga = webbur::r8_gamma ( a );
+-      gb = webbur::r8_gamma ( b );
+-      gc = webbur::r8_gamma ( c );
+-      gca = webbur::r8_gamma ( c - a );
+-      gcb = webbur::r8_gamma ( c - b );
+-      gcab = webbur::r8_gamma ( c - a - b );
+-      gabc = webbur::r8_gamma ( a + b - c );
+-      c0 = gc * gcab / ( gca * gcb );
+-      c1 = gc * gabc / ( ga * gb ) * std::pow ( 1.0 - x, c - a - b );
+-      hf = 0.0;
+-      hw = hf;
+-      r0 = c0;
+-      r1 = c1;
+-
+-      for ( k = 1; k <= 250; k++ )
+-      {
+-        r0 = r0 * ( a + k - 1.0 ) * ( b + k - 1.0 )
+-          / ( k * ( a + b - c + k ) ) * ( 1.0 - x );
+-
+-        r1 = r1 * ( c - a + k - 1.0 ) * ( c - b + k - 1.0 )
+-          / ( k * ( c - a - b + k ) ) * ( 1.0 - x );
+-
+-        hf = hf + r0 + r1;
+-
+-        if ( webbur::r8_abs ( hf - hw ) < webbur::r8_abs ( hf ) * eps )
+-        {
+-          break;
+-        }
+-        hw = hf;
+-      }
+-      hf = hf + c0 + c1;
+-    }
+-  }
+-  else
+-  {
+-    a0 = 1.0;
+-
+-    if ( a < c && c < 2.0 * a && b < c && c < 2.0 * b )
+-    {
+-      a0 = std::pow ( 1.0 - x, c - a - b );
+-      a = c - a;
+-      b = c - b;
+-    }
+-
+-    hf = 1.0;
+-    hw = hf;
+-    r = 1.0;
+-
+-    for ( k = 1; k <= 250; k++ )
+-    {
+-      r = r * ( a + k - 1.0 ) * ( b + k - 1.0 )
+-        / ( k * ( c + k - 1.0 ) ) * x;
+-
+-      hf = hf + r;
+-
+-      if ( webbur::r8_abs ( hf - hw ) <= webbur::r8_abs ( hf ) * eps )
+-      {
+-        break;
+-      }
+-
+-      hw = hf;
+-    }
+-    hf = a0 * hf;
+-  }
+-
+-  if ( x1 < 0.0 )
+-  {
+-    x = x1;
+-    c0 = 1.0 / std::pow ( 1.0 - x, aa );
+-    hf = c0 * hf;
+-  }
+-
+-  a = aa;
+-  b = bb;
+-
+-  if ( 120 < k )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8_HYPER_2F1 - Warning!\n";
+-    std::cerr << "  A large number of iterations were needed.\n";
+-    std::cerr << "  The accuracy of the results should be checked.\n";
+-  }
+-
+-  return hf;
+-}
+-//****************************************************************************80
+-
+-double r8_max ( double x, double y )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_MAX returns the maximum of two R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 August 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, double X, Y, the quantities to compare.
+-//
+-//    Output, double R8_MAX, the maximum of X and Y.
+-//
+-{
+-  double value;
+-
+-  if ( y < x )
+-  {
+-    value = x;
+-  }
+-  else
+-  {
+-    value = y;
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_min ( double x, double y )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_MIN returns the minimum of two R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    31 August 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, double X, Y, the quantities to compare.
+-//
+-//    Output, double R8_MIN, the minimum of X and Y.
+-//
+-{
+-  double value;
+-
+-  if ( y < x )
+-  {
+-    value = y;
+-  }
+-  else
+-  {
+-    value = x;
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_mop ( int i )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_MOP returns the I-th power of -1 as an R8 value.
+-//
+-//  Discussion:
+-//
+-//    An R8 is an double value.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    16 November 2007
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int I, the power of -1.
+-//
+-//    Output, double R8_MOP, the I-th power of -1.
+-//
+-{
+-  double value;
+-
+-  if ( ( i % 2 ) == 0 )
+-  {
+-    value = 1.0;
+-  }
+-  else
+-  {
+-    value = -1.0;
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_psi ( double xx )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_PSI evaluates the function Psi(X).
+-//
+-//  Discussion:
+-//
+-//    This routine evaluates the logarithmic derivative of the
+-//    Gamma function,
+-//
+-//      PSI(X) = d/dX ( GAMMA(X) ) / GAMMA(X)
+-//             = d/dX LN ( GAMMA(X) )
+-//
+-//    for real X, where either
+-//
+-//      - XMAX1 < X < - XMIN, and X is not a negative integer,
+-//
+-//    or
+-//
+-//      XMIN < X.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    09 February 2008
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by William Cody.
+-//    C++ version by John Burkardt.
+-//
+-//  Reference:
+-//
+-//    William Cody, Anthony Strecok, Henry Thacher,
+-//    Chebyshev Approximations for the Psi Function,
+-//    Mathematics of Computation,
+-//    Volume 27, Number 121, January 1973, pages 123-127.
+-//
+-//  Parameters:
+-//
+-//    Input, double XX, the argument of the function.
+-//
+-//    Output, double R8_PSI, the value of the function.
+-//
+-{
+-  double aug;
+-  double den;
+-  int i;
+-  int n;
+-  int nq;
+-  double one = 1.0;
+-  double p1[9] = {
+-   4.5104681245762934160E-03,
+-   5.4932855833000385356,
+-   3.7646693175929276856E+02,
+-   7.9525490849151998065E+03,
+-   7.1451595818951933210E+04,
+-   3.0655976301987365674E+05,
+-   6.3606997788964458797E+05,
+-   5.8041312783537569993E+05,
+-   1.6585695029761022321E+05 };
+-  double p2[7] = {
+-  -2.7103228277757834192,
+-  -1.5166271776896121383E+01,
+-  -1.9784554148719218667E+01,
+-  -8.8100958828312219821,
+-  -1.4479614616899842986,
+-  -7.3689600332394549911E-02,
+-  -6.5135387732718171306E-21 };
+-  double piov4 = 0.78539816339744830962;
+-  double q1[8] = {
+-   9.6141654774222358525E+01,
+-   2.6287715790581193330E+03,
+-   2.9862497022250277920E+04,
+-   1.6206566091533671639E+05,
+-   4.3487880712768329037E+05,
+-   5.4256384537269993733E+05,
+-   2.4242185002017985252E+05,
+-   6.4155223783576225996E-08 };
+-  double q2[6] = {
+-   4.4992760373789365846E+01,
+-   2.0240955312679931159E+02,
+-   2.4736979003315290057E+02,
+-   1.0742543875702278326E+02,
+-   1.7463965060678569906E+01,
+-   8.8427520398873480342E-01 };
+-  double sgn;
+-  double three = 3.0;
+-  double upper;
+-  double value;
+-  double w;
+-  double x;
+-  double x01 = 187.0;
+-  double x01d = 128.0;
+-  double x02 = 6.9464496836234126266E-04;
+-  double xinf = 1.70E+38;
+-  double xlarge = 2.04E+15;
+-  double xmax1 = 3.60E+16;
+-  double xmin1 = 5.89E-39;
+-  double xsmall = 2.05E-09;
+-  double z;
+-
+-  x = xx;
+-  w = webbur::r8_abs ( x );
+-  aug = 0.0;
+-//
+-//  Check for valid arguments, then branch to appropriate algorithm.
+-//
+-  if ( xmax1 <= - x || w < xmin1 )
+-  {
+-    if ( 0.0 < x )
+-    {
+-      value = - xinf;
+-    }
+-    else
+-    {
+-      value = xinf;
+-    }
+-    return value;
+-  }
+-
+-  if ( x < 0.5 )
+-  {
+-//
+-//  X < 0.5, use reflection formula: psi(1-x) = psi(x) + pi * cot(pi*x)
+-//  Use 1/X for PI*COTAN(PI*X)  when  XMIN1 < |X| <= XSMALL.
+-//
+-    if ( w <= xsmall )
+-    {
+-      aug = - one / x;
+-    }
+-//
+-//  Argument reduction for cotangent.
+-//
+-    else
+-    {
+-      if ( x < 0.0 )
+-      {
+-        sgn = piov4;
+-      }
+-      else
+-      {
+-        sgn = - piov4;
+-      }
+-
+-      w = w - ( double ) ( ( int ) ( w ) );
+-      nq = ( int ) ( w * 4.0 );
+-      w = 4.0 * ( w - ( double ) ( nq ) * 0.25 );
+-//
+-//  W is now related to the fractional part of 4.0 * X.
+-//  Adjust argument to correspond to values in the first
+-//  quadrant and determine the sign.
+-//
+-      n = nq / 2;
+-
+-      if ( n + n != nq )
+-      {
+-        w = one - w;
+-      }
+-
+-      z = piov4 * w;
+-
+-      if ( ( n % 2 ) != 0 )
+-      {
+-        sgn = - sgn;
+-      }
+-//
+-//  Determine the final value for  -pi * cotan(pi*x).
+-//
+-      n = ( nq + 1 ) / 2;
+-      if ( ( n % 2 ) == 0 )
+-      {
+-//
+-//  Check for singularity.
+-//
+-        if ( z == 0.0 )
+-        {
+-          if ( 0.0 < x )
+-          {
+-            value = -xinf;
+-          }
+-          else
+-          {
+-            value = xinf;
+-          }
+-          return value;
+-        }
+-        aug = sgn * ( 4.0 / std::tan ( z ) );
+-      }
+-      else
+-      {
+-        aug = sgn * ( 4.0 * std::tan ( z ) );
+-      }
+-    }
+-    x = one - x;
+-  }
+-//
+-//  0.5 <= X <= 3.0.
+-//
+-  if ( x <= three )
+-  {
+-    den = x;
+-    upper = p1[0] * x;
+-    for ( i = 1; i <= 7; i++ )
+-    {
+-      den = ( den + q1[i-1] ) * x;
+-      upper = ( upper + p1[i]) * x;
+-    }
+-    den = ( upper + p1[8] ) / ( den + q1[7] );
+-    x = ( x - x01 / x01d ) - x02;
+-    value = den * x + aug;
+-    return value;
+-  }
+-//
+-//  3.0 < X.
+-//
+-  if ( x < xlarge )
+-  {
+-    w = one / ( x * x );
+-    den = w;
+-    upper = p2[0] * w;
+-    for ( i = 1; i <= 5; i++ )
+-    {
+-      den = ( den + q2[i-1] ) * w;
+-      upper = ( upper + p2[i] ) * w;
+-    }
+-    aug = ( upper + p2[6] ) / ( den + q2[5] ) - 0.5 / x + aug;
+-  }
+-
+-  value = aug + std::log ( x );
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8_sign ( double x )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8_SIGN returns the sign of an R8.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 October 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, double X, the number whose sign is desired.
+-//
+-//    Output, double R8_SIGN, the sign of X.
+-//
+-{
+-  double value;
+-
+-  if ( x < 0.0 )
+-  {
+-    value = -1.0;
+-  }
+-  else
+-  {
+-    value = 1.0;
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-int r8col_compare ( int m, int n, double a[], int i, int j )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_COMPARE compares two columns in an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//  Example:
+-//
+-//    Input:
+-//
+-//      M = 3, N = 4, I = 2, J = 4
+-//
+-//      A = (
+-//        1.  2.  3.  4.
+-//        5.  6.  7.  8.
+-//        9. 10. 11. 12. )
+-//
+-//    Output:
+-//
+-//      R8COL_COMPARE = -1
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    13 September 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input, double A[M*N], the M by N array.
+-//
+-//    Input, int I, J, the columns to be compared.
+-//    I and J must be between 1 and N.
+-//
+-//    Output, int R8COL_COMPARE, the results of the comparison:
+-//    -1, column I < column J,
+-//     0, column I = column J,
+-//    +1, column J < column I.
+-//
+-{
+-  int k;
+-  int value;
+-//
+-//  Check.
+-//
+-  if ( i < 1 || n < i )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8COL_COMPARE - Fatal error!\n";
+-    std::cerr << "  Column index I is out of bounds.\n";
+-    std::cerr << "  I = " << i << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  if ( j < 1 || n < j )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8COL_COMPARE - Fatal error!\n";
+-    std::cerr << "  Column index J is out of bounds.\n";
+-    std::cerr << "  J = " << j << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  value = 0;
+-
+-  if ( i == j )
+-  {
+-    return value;
+-  }
+-
+-  k = 0;
+-
+-  while ( k < m )
+-  {
+-    if ( a[k+(i-1)*m] < a[k+(j-1)*m] )
+-    {
+-      value = -1;
+-      return value;
+-    }
+-    else if ( a[k+(j-1)*m] < a[k+(i-1)*m] )
+-    {
+-      value = +1;
+-      return value;
+-    }
+-    k = k + 1;
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void r8col_sort_heap_a ( int m, int n, double a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_SORT_HEAP_A ascending heapsorts an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//    In lexicographic order, the statement "X < Y", applied to two real
+-//    vectors X and Y of length M, means that there is some index I, with
+-//    1 <= I <= M, with the property that
+-//
+-//      X(J) = Y(J) for J < I,
+-//    and
+-//      X(I) < Y(I).
+-//
+-//    In other words, the first time they differ, X is smaller.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    15 September 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input/output, double A[M*N].
+-//    On input, the array of N columns of M-vectors.
+-//    On output, the columns of A have been sorted in lexicographic order.
+-//
+-{
+-  int i;
+-  int indx;
+-  int isgn;
+-  int j;
+-
+-  if ( m <= 0 )
+-  {
+-    return;
+-  }
+-
+-  if ( n <= 1 )
+-  {
+-    return;
+-  }
+-//
+-//  Initialize.
+-//
+-  i = 0;
+-  indx = 0;
+-  isgn = 0;
+-  j = 0;
+-//
+-//  Call the external heap sorter.
+-//
+-  for ( ; ; )
+-  {
+-    webbur::sort_heap_external ( n, &indx, &i, &j, isgn );
+-//
+-//  Interchange the I and J objects.
+-//
+-    if ( 0 < indx )
+-    {
+-      webbur::r8col_swap ( m, n, a, i, j );
+-    }
+-//
+-//  Compare the I and J objects.
+-//
+-    else if ( indx < 0 )
+-    {
+-      isgn = webbur::r8col_compare ( m, n, a, i, j );
+-    }
+-    else if ( indx == 0 )
+-    {
+-      break;
+-    }
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int *r8col_sort_heap_index_a ( int m, int n, double a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//    The sorting is not actually carried out.  Rather an index array is
+-//    created which defines the sorting.  This array may be used to sort
+-//    or index the array, or to sort or index related arrays keyed on the
+-//    original array.
+-//
+-//    A(*,J1) < A(*,J2) if the first nonzero entry of A(*,J1)-A(*,J2)
+-//    is negative.
+-//
+-//    Once the index array is computed, the sorting can be carried out
+-//    "implicitly:
+-//
+-//      A(*,INDX(*)) is sorted,
+-//
+-//    Note that the index vector is 0-based.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 November 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the number of rows in each column of A.
+-//
+-//    Input, int N, the number of columns in A.
+-//
+-//    Input, double A[M*N], the array.
+-//
+-//    Output, int R8COL_SORT_HEAP_INDEX_A[N], contains the sort index.  The
+-//    I-th column of the sorted array is A(*,INDX(I)).
+-//
+-{
+-  double *column;
+-  int i;
+-  int *indx;
+-  int indxt;
+-  int ir;
+-  int isgn;
+-  int j;
+-  int k;
+-  int l;
+-
+-  if ( n < 1 )
+-  {
+-    return NULL;
+-  }
+-
+-  indx = new int[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    indx[i] = i;
+-  }
+-
+-  if ( n == 1 )
+-  {
+-    return indx;
+-  }
+-
+-  column = new double[m];
+-
+-  l = n / 2 + 1;
+-  ir = n;
+-
+-  for ( ; ; )
+-  {
+-    if ( 1 < l )
+-    {
+-      l = l - 1;
+-      indxt = indx[l-1];
+-      for ( k = 0; k < m; k++ )
+-      {
+-        column[k] = a[k+indxt*m];
+-      }
+-    }
+-    else
+-    {
+-      indxt = indx[ir-1];
+-      for ( k = 0; k < m; k++ )
+-      {
+-        column[k] = a[k+indxt*m];
+-      }
+-      indx[ir-1] = indx[0];
+-      ir = ir - 1;
+-
+-      if ( ir == 1 )
+-      {
+-        indx[0] = indxt;
+-        break;
+-      }
+-    }
+-
+-    i = l;
+-    j = l + l;
+-
+-    while ( j <= ir )
+-    {
+-      if ( j < ir )
+-      {
+-        isgn = webbur::r8vec_compare ( m, a+indx[j-1]*m, a+indx[j]*m );
+-
+-        if ( isgn < 0 )
+-        {
+-          j = j + 1;
+-        }
+-      }
+-
+-      isgn = webbur::r8vec_compare ( m, column, a+indx[j-1]*m );
+-
+-      if ( isgn < 0 )
+-      {
+-        indx[i-1] = indx[j-1];
+-        i = j;
+-        j = j + j;
+-      }
+-      else
+-      {
+-        j = ir + 1;
+-      }
+-    }
+-    indx[i-1] = indxt;
+-  }
+-  delete [] column;
+-
+-  return indx;
+-}
+-//****************************************************************************80
+-
+-int r8col_sorted_unique_count ( int m, int n, double a[], double tol )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_SORTED_UNIQUE_COUNT counts unique elements in a sorted R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//    The columns of the array may be ascending or descending sorted.
+-//
+-//    If the tolerance is large enough, then the concept of uniqueness
+-//    can become ambiguous.  If we have a tolerance of 1.5, then in the
+-//    list ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) is it fair to say we have only
+-//    one unique entry?  That would be because 1 may be regarded as unique,
+-//    and then 2 is too close to 1 to be unique, and 3 is too close to 2 to
+-//    be unique and so on.
+-//
+-//    This seems wrongheaded.  So I prefer the idea that an item is not
+-//    unique under a tolerance only if it is close to something that IS unique.
+-//    Thus, the unique items are guaranteed to cover the space if we include
+-//    a disk of radius TOL around each one.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    01 November 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input, double A[M*N], a sorted array, containing
+-//    N columns of data.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Output, int R8COL_SORTED_UNIQUE_COUNT, the number of unique columns.
+-//
+-{
+-  double diff;
+-  int i;
+-  int j1;
+-  int j2;
+-  int unique_num;
+-
+-  unique_num = 0;
+-
+-  if ( n <= 0 )
+-  {
+-    return unique_num;
+-  }
+-
+-  unique_num = 1;
+-  j1 = 0;
+-
+-  for ( j2 = 1; j2 < n; j2++ )
+-  {
+-    diff = 0.0;
+-    for ( i = 0; i < m; i++ )
+-    {
+-      diff = webbur::r8_max ( diff, webbur::r8_abs ( a[i+j1*m] - a[i+j2*m] ) );
+-    }
+-    if ( tol < diff )
+-    {
+-      unique_num = unique_num + 1;
+-      j1 = j2;
+-    }
+-  }
+-
+-  return unique_num;
+-}
+-//****************************************************************************80
+-
+-void r8col_swap ( int m, int n, double a[], int j1, int j2 )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_SWAP swaps columns J1 and J2 of an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//  Example:
+-//
+-//    Input:
+-//
+-//      M = 3, N = 4, J1 = 2, J2 = 4
+-//
+-//      A = (
+-//        1.  2.  3.  4.
+-//        5.  6.  7.  8.
+-//        9. 10. 11. 12. )
+-//
+-//    Output:
+-//
+-//      A = (
+-//        1.  4.  3.  2.
+-//        5.  8.  7.  6.
+-//        9. 12. 11. 10. )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 October 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input/output, double A[M*N], the M by N array.
+-//
+-//    Input, int J1, J2, the columns to be swapped.
+-//    These columns are 1-based.
+-//
+-{
+-  int i;
+-  double temp;
+-
+-  if ( j1 < 1 || n < j1 || j2 < 1 || n < j2 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8COL_SWAP - Fatal error!\n";
+-    std::cerr << "  J1 or J2 is out of bounds.\n";
+-    std::cerr << "  J1 =   " << j1 << "\n";
+-    std::cerr << "  J2 =   " << j2 << "\n";
+-    std::cerr << "  NCOL = " << n << "\n";
+-    std::exit ( 1 );
+-  }
+-
+-  if ( j1 == j2 )
+-  {
+-    return;
+-  }
+-
+-  for ( i = 0; i < m; i++ )
+-  {
+-    temp          = a[i+(j1-1)*m];
+-    a[i+(j1-1)*m] = a[i+(j2-1)*m];
+-    a[i+(j2-1)*m] = temp;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void r8col_tol_undex ( int m, int n, double a[], int unique_num, double tol,
+-  int undx[], int xdnu[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_TOL_UNDEX indexes tolerably unique entries of an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//    The goal of this routine is to determine a vector UNDX,
+-//    which points to the unique elements of A, in sorted order,
+-//    and a vector XDNU, which identifies, for each entry of A, the index of
+-//    the unique sorted element of A.
+-//
+-//    This is all done with index vectors, so that the elements of
+-//    A are never moved.
+-//
+-//    The first step of the algorithm requires the indexed sorting
+-//    of A, which creates arrays INDX and XDNI.  (If all the entries
+-//    of A are unique, then these arrays are the same as UNDX and XDNU.)
+-//
+-//    We then use INDX to examine the entries of A in sorted order,
+-//    noting the unique entries, creating the entries of XDNU and
+-//    UNDX as we go.
+-//
+-//    Once this process has been completed, the vector A could be
+-//    replaced by a compressed vector XU, containing the unique entries
+-//    of A in sorted order, using the formula
+-//
+-//      XU(*) = A(UNDX(*)).
+-//
+-//    We could then, if we wished, reconstruct the entire vector A, or
+-//    any element of it, by index, as follows:
+-//
+-//      A(I) = XU(XDNU(I)).
+-//
+-//    We could then replace A by the combination of XU and XDNU.
+-//
+-//    Later, when we need the I-th entry of A, we can locate it as
+-//    the XDNU(I)-th entry of XU.
+-//
+-//    Here is an example of a vector A, the sort and inverse sort
+-//    index vectors, and the unique sort and inverse unique sort vectors
+-//    and the compressed unique sorted vector.
+-//
+-//      I     A  Indx  Xdni       XU  Undx  Xdnu
+-//    ----+-----+-----+-----+--------+-----+-----+
+-//      0 | 11.     0     0 |    11.     0     0
+-//      1 | 22.     2     4 |    22.     1     1
+-//      2 | 11.     5     1 |    33.     3     0
+-//      3 | 33.     8     7 |    55.     4     2
+-//      4 | 55.     1     8 |                  3
+-//      5 | 11.     6     2 |                  0
+-//      6 | 22.     7     5 |                  1
+-//      7 | 22.     3     6 |                  1
+-//      8 | 11.     4     3 |                  0
+-//
+-//    INDX(2) = 3 means that sorted item(2) is A(3).
+-//    XDNI(2) = 5 means that A(2) is sorted item(5).
+-//
+-//    UNDX(3) = 4 means that unique sorted item(3) is at A(4).
+-//    XDNU(8) = 2 means that A(8) is at unique sorted item(2).
+-//
+-//    XU(XDNU(I))) = X(I).
+-//    XU(I)        = X(UNDX(I)).
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 July 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, the dimension of the data values.
+-//
+-//    Input, int N, the number of data values,
+-//
+-//    Input, double A[M*N], the data values.
+-//
+-//    Input, int UNIQUE_NUM, the number of unique values in A.
+-//    This value is only required for languages in which the size of
+-//    UNDX must be known in advance.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Output, int UNDX[UNIQUE_NUM], the UNDX vector.
+-//
+-//    Output, int XDNU[N], the XDNU vector.
+-//
+-{
+-  double diff;
+-  int i;
+-  int i2;
+-  int *indx;
+-  int j;
+-  int k;
+-  bool unique;
+-//
+-//  Implicitly sort the array.
+-//
+-  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
+-//
+-//  Consider entry I = 0.
+-//  It is unique, so set the number of unique items to K.
+-//  Set the K-th unique item to I.
+-//  Set the representative of item I to the K-th unique item.
+-//
+-  i = 0;
+-  k = 0;
+-  undx[k] = indx[i];
+-  xdnu[indx[i]] = k;
+-//
+-//  Consider entry I.
+-//
+-//  If it is unique, increase the unique count K, set the
+-//  K-th unique item to I, and set the representative of I to K.
+-//
+-//  If it is not unique, set the representative of item I to a
+-//  previously determined unique item that is close to it.
+-//
+-  for ( i = 1; i < n; i++ )
+-  {
+-    unique = true;
+-    for ( j = 0; j <= k; j++ )
+-    {
+-      diff = 0.0;
+-      for ( i2 = 0; i2 < m; i2++ )
+-      {
+-        diff = webbur::r8_max ( diff,
+-          webbur::r8_abs ( a[i2+indx[i]*m] - a[i2+undx[j]*m] ) );
+-      }
+-      if ( diff <= tol )
+-      {
+-        unique = false;
+-        xdnu[indx[i]] = j;
+-        break;
+-      }
+-    }
+-    if ( unique )
+-    {
+-      k = k + 1;
+-      undx[k] = indx[i];
+-      xdnu[indx[i]] = k;
+-    }
+-  }
+-  delete [] indx;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int r8col_tol_unique_count ( int m, int n, double a[], double tol )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_TOL_UNIQUE_COUNT counts tolerably unique entries in an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//    The columns of the array may be ascending or descending sorted.
+-//
+-//    If the tolerance is large enough, then the concept of uniqueness
+-//    can become ambiguous.  If we have a tolerance of 1.5, then in the
+-//    list ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) is it fair to say we have only
+-//    one unique entry?  That would be because 1 may be regarded as unique,
+-//    and then 2 is too close to 1 to be unique, and 3 is too close to 2 to
+-//    be unique and so on.
+-//
+-//    This seems wrongheaded.  So I prefer the idea that an item is not
+-//    unique under a tolerance only if it is close to something that IS unique.
+-//    Thus, the unique items are guaranteed to cover the space if we include
+-//    a disk of radius TOL around each one.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 July 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input, double A[M*N], the array of N columns of data.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Output, int R8COL_TOL_UNIQUE_COUNT, the number of unique columns.
+-//
+-{
+-  double diff;
+-  int i;
+-  int i2;
+-  int *indx;
+-  int j;
+-  int k;
+-  bool unique;
+-  int *undx;
+-
+-  undx = new int[n];
+-//
+-//  Implicitly sort the array.
+-//
+-  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
+-//
+-//  Consider entry I = 0.
+-//  It is unique, so set the number of unique items to K.
+-//  Set the K-th unique item to I.
+-//  Set the representative of item I to the K-th unique item.
+-//
+-  i = 0;
+-  k = 0;
+-  undx[k] = indx[i];
+-//
+-//  Consider entry I.
+-//
+-//  If it is unique, increase the unique count K, set the
+-//  K-th unique item to I, and set the representative of I to K.
+-//
+-//  If it is not unique, set the representative of item I to a
+-//  previously determined unique item that is close to it.
+-//
+-  for ( i = 1; i < n; i++ )
+-  {
+-    unique = true;
+-    for ( j = 0; j <= k; j++ )
+-    {
+-      diff = 0.0;
+-      for ( i2 = 0; i2 < m; i2++ )
+-      {
+-        diff = webbur::r8_max ( diff,
+-          webbur::r8_abs ( a[i2+indx[i]*m] - a[i2+undx[j]*m] ) );
+-      }
+-      if ( diff <= tol )
+-      {
+-        unique = false;
+-        break;
+-      }
+-    }
+-    if ( unique )
+-    {
+-      k = k + 1;
+-      undx[k] = indx[i];
+-    }
+-  }
+-  delete [] indx;
+-  delete [] undx;
+-
+-  k = k + 1;
+-
+-  return k;
+-}
+-//****************************************************************************80
+-
+-void r8col_undex ( int x_dim, int x_num, double x_val[], int x_unique_num,
+-  double tol, int undx[], int xdnu[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_UNDEX returns unique sorted indexes for an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
+-//    each of length M.
+-//
+-//    The goal of this routine is to determine a vector UNDX,
+-//    which points to the unique elements of X, in sorted order,
+-//    and a vector XDNU, which identifies, for each entry of X, the index of
+-//    the unique sorted element of X.
+-//
+-//    This is all done with index vectors, so that the elements of
+-//    X are never moved.
+-//
+-//    The first step of the algorithm requires the indexed sorting
+-//    of X, which creates arrays INDX and XDNI.  (If all the entries
+-//    of X are unique, then these arrays are the same as UNDX and XDNU.)
+-//
+-//    We then use INDX to examine the entries of X in sorted order,
+-//    noting the unique entries, creating the entries of XDNU and
+-//    UNDX as we go.
+-//
+-//    Once this process has been completed, the vector X could be
+-//    replaced by a compressed vector XU, containing the unique entries
+-//    of X in sorted order, using the formula
+-//
+-//      XU(*) = X(UNDX(*)).
+-//
+-//    We could then, if we wished, reconstruct the entire vector X, or
+-//    any element of it, by index, as follows:
+-//
+-//      X(I) = XU(XDNU(I)).
+-//
+-//    We could then replace X by the combination of XU and XDNU.
+-//
+-//    Later, when we need the I-th entry of X, we can locate it as
+-//    the XDNU(I)-th entry of XU.
+-//
+-//    Here is an example of a vector X, the sort and inverse sort
+-//    index vectors, and the unique sort and inverse unique sort vectors
+-//    and the compressed unique sorted vector.
+-//
+-//      I     X  Indx  Xdni       XU  Undx  Xdnu
+-//    ----+-----+-----+-----+--------+-----+-----+
+-//      0 | 11.     0     0 |    11.     0     0
+-//      1 | 22.     2     4 |    22.     1     1
+-//      2 | 11.     5     1 |    33.     3     0
+-//      3 | 33.     8     7 |    55.     4     2
+-//      4 | 55.     1     8 |                  3
+-//      5 | 11.     6     2 |                  0
+-//      6 | 22.     7     5 |                  1
+-//      7 | 22.     3     6 |                  1
+-//      8 | 11.     4     3 |                  0
+-//
+-//    INDX(2) = 3 means that sorted item(2) is X(3).
+-//    XDNI(2) = 5 means that X(2) is sorted item(5).
+-//
+-//    UNDX(3) = 4 means that unique sorted item(3) is at X(4).
+-//    XDNU(8) = 2 means that X(8) is at unique sorted item(2).
+-//
+-//    XU(XDNU(I))) = X(I).
+-//    XU(I)        = X(UNDX(I)).
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    02 November 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int X_DIM, the dimension of the data values.
+-//    (the number of rows in the R8COL).
+-//
+-//    Input, int X_NUM, the number of data values,
+-//    (the number of columns in the R8COL).
+-//
+-//    Input, double X_VAL[X_DIM*X_NUM], the data values.
+-//
+-//    Input, int X_UNIQUE_NUM, the number of unique values in X_VAL.
+-//    This value is only required for languages in which the size of
+-//    UNDX must be known in advance.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Output, int UNDX[X_UNIQUE_NUM], the UNDX vector.
+-//
+-//    Output, int XDNU[X_NUM], the XDNU vector.
+-//
+-{
+-  double diff;
+-  int i;
+-  int *indx;
+-  int j;
+-  int k;
+-//
+-//  Implicitly sort the array.
+-//
+-  indx = webbur::r8col_sort_heap_index_a ( x_dim, x_num, x_val );
+-//
+-//  Walk through the implicitly sorted array X.
+-//
+-  i = 0;
+-
+-  j = 0;
+-  undx[j] = indx[i];
+-
+-  xdnu[indx[i]] = j;
+-
+-  for ( i = 1; i < x_num; i++ )
+-  {
+-    diff = 0.0;
+-    for ( k = 0; k < x_dim; k++ )
+-    {
+-      diff = r8_max ( diff,
+-        webbur::r8_abs ( x_val[k+indx[i]*x_dim] - x_val[k+undx[j]*x_dim] ) );
+-    }
+-    if ( tol < diff )
+-    {
+-      j = j + 1;
+-      undx[j] = indx[i];
+-    }
+-    xdnu[indx[i]] = j;
+-  }
+-  delete [] indx;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void r8col_unique_index ( int m, int n, double a[], double tol,
+-  int unique_index[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8COL_UNIQUE_INDEX indexes the first occurrence of values in an R8COL.
+-//
+-//  Discussion:
+-//
+-//    An R8COL is an M by N array of R8 values.
+-//    It is regarded as an array of N columns of length M.
+-//
+-//    For element A(1:M,J) of the matrix, UNIQUE_INDEX(J) is the uniqueness
+-//   index of A(1:M,J).  That is, if A_UNIQUE contains the unique elements
+-//    of A, gathered in order, then
+-//
+-//      A_UNIQUE ( 1:M, UNIQUE_INDEX(J) ) = A(1:M,J)
+-//
+-//    The user must preallocate space for the output array UNIQUE_INDEX.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    24 November 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns of A.
+-//    The length of an "element" of A, and the number of "elements".
+-//
+-//    Input, double A[M*N], the array.
+-//
+-//    Input, double TOL, a tolerance for equality.
+-//
+-//    Output, int UNIQUE_INDEX[N], the unique index.
+-//
+-{
+-  double diff;
+-  int i;
+-  int j1;
+-  int j2;
+-  int unique_num;
+-
+-  for ( j1 = 0; j1 < n; j1++ )
+-  {
+-    unique_index[j1] = -1;
+-  }
+-  unique_num = 0;
+-
+-  for ( j1 = 0; j1 < n; j1++ )
+-  {
+-    if ( unique_index[j1] == -1 )
+-    {
+-      unique_index[j1] = unique_num;
+-
+-      for ( j2 = j1 + 1; j2 < n; j2++ )
+-      {
+-        diff = 0.0;
+-        for ( i = 0; i < m; i++ )
+-        {
+-          diff = webbur::r8_max ( diff,
+-            webbur::r8_abs ( a[i+j1*m] - a[i+j2*m] ) );
+-        }
+-        if ( diff <= tol )
+-        {
+-          unique_index[j2] = unique_num;
+-        }
+-      }
+-      unique_num = unique_num + 1;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void r8mat_transpose_print ( int m, int n, double a[], std::string title )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
+-//
+-//  Discussion:
+-//
+-//    An R8MAT is a doubly dimensioned array of R8 values, stored as a vector
+-//    in column-major order.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    10 September 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input, double A[M*N], an M by N matrix to be printed.
+-//
+-//    Input, string TITLE, a title.
+-//
+-{
+-  r8mat_transpose_print_some ( m, n, a, 1, 1, m, n, title );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void r8mat_transpose_print_some ( int m, int n, double a[], int ilo, int jlo,
+-  int ihi, int jhi, std::string title )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
+-//
+-//  Discussion:
+-//
+-//    An R8MAT is a doubly dimensioned array of R8 values, stored as a vector
+-//    in column-major order.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    10 September 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int M, N, the number of rows and columns.
+-//
+-//    Input, double A[M*N], an M by N matrix to be printed.
+-//
+-//    Input, int ILO, JLO, the first row and column to print.
+-//
+-//    Input, int IHI, JHI, the last row and column to print.
+-//
+-//    Input, string TITLE, a title.
+-//
+-{
+-# define INCX 5
+-
+-  int i;
+-  int i2;
+-  int i2hi;
+-  int i2lo;
+-  int inc;
+-  int j;
+-  int j2hi;
+-  int j2lo;
+-
+-  std::cout << "\n";
+-  std::cout << title << "\n";
+-
+-  for ( i2lo = i4_max ( ilo, 1 ); i2lo <= i4_min ( ihi, m ); i2lo = i2lo + INCX )
+-  {
+-    i2hi = i2lo + INCX - 1;
+-    i2hi = i4_min ( i2hi, m );
+-    i2hi = i4_min ( i2hi, ihi );
+-
+-    inc = i2hi + 1 - i2lo;
+-
+-    std::cout << "\n";
+-    std::cout << "  Row: ";
+-    for ( i = i2lo; i <= i2hi; i++ )
+-    {
+-      std::cout << std::setw(7) << i - 1 << "       ";
+-    }
+-    std::cout << "\n";
+-    std::cout << "  Col\n";
+-    std::cout << "\n";
+-
+-    j2lo = i4_max ( jlo, 1 );
+-    j2hi = i4_min ( jhi, n );
+-
+-    for ( j = j2lo; j <= j2hi; j++ )
+-    {
+-      std::cout << std::setw(5) << j - 1 << ":";
+-      for ( i2 = 1; i2 <= inc; i2++ )
+-      {
+-        i = i2lo - 1 + i2;
+-        std::cout << std::setw(14) << a[(i-1)+(j-1)*m];
+-      }
+-      std::cout << "\n";
+-    }
+-  }
+-
+-  return;
+-# undef INCX
+-}
+-//****************************************************************************80
+-
+-void r8mat_write ( std::string output_filename, int m, int n, double table[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8MAT_WRITE writes an R8MAT file.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    11 August 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, string OUTPUT_FILENAME, the output filename.
+-//
+-//    Input, int M, the spatial dimension.
+-//
+-//    Input, int N, the number of points.
+-//
+-//    Input, double TABLE[M*N], the table data.
+-//
+-{
+-  int i;
+-  int j;
+-  std::ofstream output;
+-//
+-//  Open the file.
+-//
+-  output.open ( output_filename.c_str ( ) );
+-
+-  if ( !output )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8MAT_WRITE - Fatal error!\n";
+-    std::cerr << "  Could not open the output file.\n";
+-    return;
+-  }
+-//
+-//  Write the data.
+-//
+-  for ( j = 0; j < n; j++ )
+-  {
+-    for ( i = 0; i < m; i++ )
+-    {
+-      output << "  " << std::setw(24) << std::setprecision(16) << table[i+j*m];
+-    }
+-    output << "\n";
+-  }
+-//
+-//  Close the file.
+-//
+-  output.close ( );
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double r8poly_ant_val ( int n, double poly_cof[], double xval )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8POLY_ANT_VAL evaluates the antiderivative of an R8POLY in standard form.
+-//
+-//  Discussion:
+-//
+-//    The constant term of the antiderivative is taken to be zero.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 June 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the order of the polynomial.
+-//
+-//    Input, double POLY_COF[N], the polynomial coefficients.  POLY_COF[0]
+-//    is the constant term, and POLY_COF[N-1] is the coefficient of X**(N-1).
+-//
+-//    Input, double XVAL, the point where the antiderivative is to be
+-//    evaluated.
+-//
+-//    Output, double R8POLY_ANT_VAL, the value of the antiderivative of the polynomial
+-//    at XVAL.
+-//
+-{
+-  int i;
+-  double value;
+-
+-  value = 0.0;
+-
+-  for ( i = n - 1; 0 <= i; i-- )
+-  {
+-    value = ( value + poly_cof[i] / ( double ) ( i + 1 ) ) * xval;
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double *r8vec_chebyshev_new ( int n, double a_first, double a_last )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_CHEBYSHEV_NEW creates a vector of Chebyshev spaced values.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    08 June 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input, double A_FIRST, A_LAST, the first and last entries.
+-//
+-//    Output, double R8VEC_CHEBYSHEV_NEW[N], a vector of Chebyshev spaced data.
+-//
+-{
+-  double *a;
+-  double c;
+-  int i;
+-  double pi = 3.141592653589793;
+-  double theta;
+-
+-  a = new double[n];
+-
+-  if ( n == 1 )
+-  {
+-    a[0] = ( a_first + a_last ) / 2.0;
+-  }
+-  else
+-  {
+-    for ( i = 0; i < n; i++ )
+-    {
+-      theta = ( double ) ( n - i - 1 ) * pi / ( double ) ( n - 1 );
+-
+-      c = std::cos ( theta );
+-
+-      if ( ( n % 2 ) == 1 )
+-      {
+-        if ( 2 * i + 1 == n )
+-        {
+-          c = 0.0;
+-        }
+-      }
+-
+-      a[i] = ( ( 1.0 - c ) * a_first
+-             + ( 1.0 + c ) * a_last )
+-             /   2.0;
+-    }
+-  }
+-  return a;
+-}
+-//****************************************************************************80
+-
+-int r8vec_compare ( int n, double a[], double b[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_COMPARE compares two R8VEC's.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    The lexicographic ordering is used.
+-//
+-//  Example:
+-//
+-//    Input:
+-//
+-//      A1 = ( 2.0, 6.0, 2.0 )
+-//      A2 = ( 2.0, 8.0, 12.0 )
+-//
+-//    Output:
+-//
+-//      ISGN = -1
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    23 September 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input, double A[N], B[N], the vectors to be compared.
+-//
+-//    Output, int R8VEC_COMPARE, the results of the comparison:
+-//    -1, A is lexicographically less than B,
+-//     0, A is equal to B,
+-//    +1, A is lexicographically greater than B.
+-//
+-{
+-  int isgn;
+-  int k;
+-
+-  isgn = 0;
+-
+-  for ( k = 0; k < n; k++ )
+-  {
+-    if ( a[k] < b[k] )
+-    {
+-      isgn = -1;
+-      return isgn;
+-    }
+-    else if ( b[k] < a[k] )
+-    {
+-      isgn = +1;
+-      return isgn;
+-    }
+-  }
+-  return isgn;
+-}
+-//****************************************************************************80
+-
+-void r8vec_copy ( int n, double a1[], double a2[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_COPY copies an R8VEC.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    03 July 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input, double A1[N], the vector to be copied.
+-//
+-//    Output, double A2[N], the copy of A1.
+-//
+-{
+-  int i;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a2[i] = a1[i];
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-double *r8vec_copy_new ( int n, double a1[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_COPY_NEW copies an R8VEC to a "new" R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    03 July 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input, double A1[N], the vector to be copied.
+-//
+-//    Output, double R8VEC_COPY_NEW[N], the copy of A1.
+-//
+-{
+-  double *a2;
+-  int i;
+-
+-  a2 = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a2[i] = a1[i];
+-  }
+-  return a2;
+-}
+-//****************************************************************************80
+-
+-double r8vec_diff_norm_li ( int n, double a[], double b[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_DIFF_NORM_LI returns the L-oo norm of the difference of R8VEC's.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    The vector L-oo norm is defined as:
+-//
+-//      R8VEC_NORM_LI = max ( 1 <= I <= N ) abs ( A(I) ).
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    02 April 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in A.
+-//
+-//    Input, double A[N], B[N], the vectors.
+-//
+-//    Output, double R8VEC_DIFF_NORM_LI, the L-oo norm of A - B.
+-//
+-{
+-  int i;
+-  double value;
+-
+-  value = 0.0;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    value = webbur::r8_max ( value, webbur::r8_abs ( a[i] - b[i] ) );
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void r8vec_direct_product2 ( int factor_index, int factor_order,
+-  double factor_value[], int factor_num, int point_num, double w[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_DIRECT_PRODUCT2 creates a direct product of R8VEC's.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    To explain what is going on here, suppose we had to construct
+-//    a multidimensional quadrature rule as the product of K rules
+-//    for 1D quadrature.
+-//
+-//    The product rule will be represented as a list of points and weights.
+-//
+-//    The J-th item in the product rule will be associated with
+-//      item J1 of 1D rule 1,
+-//      item J2 of 1D rule 2,
+-//      ...,
+-//      item JK of 1D rule K.
+-//
+-//    In particular,
+-//      X(J) = ( X(1,J1), X(2,J2), ..., X(K,JK))
+-//    and
+-//      W(J) = W(1,J1) * W(2,J2) * ... * W(K,JK)
+-//
+-//    So we can construct the quadrature rule if we can properly
+-//    distribute the information in the 1D quadrature rules.
+-//
+-//    This routine carries out that task for the weights W.
+-//
+-//    Another way to do this would be to compute, one by one, the
+-//    set of all possible indices (J1,J2,...,JK), and then index
+-//    the appropriate information.  An advantage of the method shown
+-//    here is that you can process the K-th set of information and
+-//    then discard it.
+-//
+-//  Example:
+-//
+-//    Rule 1:
+-//      Order = 4
+-//      W(1:4) = ( 2, 3, 5, 7 )
+-//
+-//    Rule 2:
+-//      Order = 3
+-//      W(1:3) = ( 11, 13, 17 )
+-//
+-//    Rule 3:
+-//      Order = 2
+-//      W(1:2) = ( 19, 23 )
+-//
+-//    Product Rule:
+-//      Order = 24
+-//      W(1:24) =
+-//        ( 2 * 11 * 19 )
+-//        ( 3 * 11 * 19 )
+-//        ( 4 * 11 * 19 )
+-//        ( 7 * 11 * 19 )
+-//        ( 2 * 13 * 19 )
+-//        ( 3 * 13 * 19 )
+-//        ( 5 * 13 * 19 )
+-//        ( 7 * 13 * 19 )
+-//        ( 2 * 17 * 19 )
+-//        ( 3 * 17 * 19 )
+-//        ( 5 * 17 * 19 )
+-//        ( 7 * 17 * 19 )
+-//        ( 2 * 11 * 23 )
+-//        ( 3 * 11 * 23 )
+-//        ( 5 * 11 * 23 )
+-//        ( 7 * 11 * 23 )
+-//        ( 2 * 13 * 23 )
+-//        ( 3 * 13 * 23 )
+-//        ( 5 * 13 * 23 )
+-//        ( 7 * 13 * 23 )
+-//        ( 2 * 17 * 23 )
+-//        ( 3 * 17 * 23 )
+-//        ( 5 * 17 * 23 )
+-//        ( 7 * 17 * 23 )
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 April 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int FACTOR_INDEX, the index of the factor being processed.
+-//    The first factor processed must be factor 0.
+-//
+-//    Input, int FACTOR_ORDER, the order of the factor.
+-//
+-//    Input, double FACTOR_VALUE[FACTOR_ORDER], the factor values for
+-//    factor FACTOR_INDEX.
+-//
+-//    Input, int FACTOR_NUM, the number of factors.
+-//
+-//    Input, int POINT_NUM, the number of elements in the direct product.
+-//
+-//    Input/output, double W[POINT_NUM], the elements of the
+-//    direct product, which are built up gradually.
+-//
+-//  Local Parameters:
+-//
+-//    Local, integer START, the first location of a block of values to set.
+-//
+-//    Local, integer CONTIG, the number of consecutive values to set.
+-//
+-//    Local, integer SKIP, the distance from the current value of START
+-//    to the next location of a block of values to set.
+-//
+-//    Local, integer REP, the number of blocks of values to set.
+-//
+-{
+-  static int contig = 0;
+-  int i;
+-  int j;
+-  int k;
+-  static int rep = 0;
+-  static int skip = 0;
+-  int start;
+-
+-  if ( factor_index == 0 )
+-  {
+-    contig = 1;
+-    skip = 1;
+-    rep = point_num;
+-    for ( i = 0; i < point_num; i++ )
+-    {
+-      w[i] = 1.0;
+-    }
+-  }
+-
+-  rep = rep / factor_order;
+-  skip = skip * factor_order;
+-
+-  for ( j = 0; j < factor_order; j++ )
+-  {
+-    start = 0 + j * contig;
+-
+-    for ( k = 1; k <= rep; k++ )
+-    {
+-      for ( i = start; i < start + contig; i++ )
+-      {
+-        w[i] = w[i] * factor_value[j];
+-      }
+-      start = start + skip;
+-    }
+-  }
+-
+-  contig = contig * factor_order;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double r8vec_dot_product ( int n, double a1[], double a2[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_DOT_PRODUCT computes the dot product of a pair of R8VEC's.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    03 July 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input, double A1[N], A2[N], the two vectors to be considered.
+-//
+-//    Output, double R8VEC_DOT_PRODUCT, the dot product of the vectors.
+-//
+-{
+-  int i;
+-  double value;
+-
+-  value = 0.0;
+-  for ( i = 0; i < n; i++ )
+-  {
+-    value = value + a1[i] * a2[i];
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8vec_i4vec_dot_product ( int n, double r8vec[], int i4vec[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_I4VEC_DOT_PRODUCT computes the dot product of an R8VEC and an I4VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    An I4VEC is a vector of I4's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    30 June 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input, double R8VEC[N], the first vector.
+-//
+-//    Input, int I4VEC[N], the second vector.
+-//
+-//    Output, double R8VEC_I4VEC_DOT_PRODUCT, the dot product of the vectors.
+-//
+-{
+-  int i;
+-  double value;
+-
+-  value = 0.0;
+-  for ( i = 0; i < n; i++ )
+-  {
+-    value = value + r8vec[i] * ( double ) ( i4vec[i] );
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void r8vec_index_sorted_range ( int n, double r[], int indx[], double r_lo,
+-  double r_hi, int *i_lo, int *i_hi )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_INDEX_SORTED_RANGE: search index sorted vector for elements in a range.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    27 September 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of items in the vector.
+-//
+-//    Input, double R[N], the index sorted vector.
+-//
+-//    Input, int INDX[N], the vector used to sort R.
+-//    The vector R[INDX[*]] is sorted.
+-//
+-//    Input, double R_LO, R_HI, the limits of the range.
+-//
+-//    Output, int *I_LO, *I_HI, the range of indices
+-//    so that I_LO <= I <= I_HI => R_LO <= R[INDX[I]] <= R_HI.  If no
+-//    values in R lie in the range, then I_HI < I_LO will be returned.
+-//
+-{
+-  int i1;
+-  int i2;
+-  int j1;
+-  int j2;
+-//
+-//  Cases we can handle immediately.
+-//
+-  if ( r[indx[n-1]] < r_lo )
+-  {
+-    *i_lo = n;
+-    *i_hi = n - 1;
+-    return;
+-  }
+-
+-  if ( r_hi < r[indx[0]] )
+-  {
+-    *i_lo = 0;
+-    *i_hi = -1;
+-    return;
+-  }
+-//
+-//  Are there are least two intervals?
+-//
+-  if ( n == 1 )
+-  {
+-    if ( r_lo <= r[indx[0]] && r[indx[0]] <= r_hi )
+-    {
+-      *i_lo = 0;
+-      *i_hi = 0;
+-    }
+-    else
+-    {
+-      *i_lo = -1;
+-      *i_hi = -2;
+-    }
+-    return;
+-  }
+-//
+-//  Bracket R_LO.
+-//
+-  if ( r_lo <= r[indx[0]] )
+-  {
+-    *i_lo = 0;
+-  }
+-  else
+-  {
+-//
+-//  R_LO is in one of the intervals spanned by R(INDX(J1)) to R(INDX(J2)).
+-//  Examine the intermediate interval [R(INDX(I1)), R(INDX(I1+1))].
+-//  Does R_LO lie here, or below or above?
+-//
+-    j1 = 0;
+-    j2 = n - 1;
+-    i1 = ( j1 + j2 - 1 ) / 2;
+-    i2 = i1 + 1;
+-
+-    for ( ; ; )
+-    {
+-      if ( r_lo < r[indx[i1]] )
+-      {
+-        j2 = i1;
+-        i1 = ( j1 + j2 - 1 ) / 2;
+-        i2 = i1 + 1;
+-      }
+-      else if ( r[indx[i2]] < r_lo )
+-      {
+-        j1 = i2;
+-        i1 = ( j1 + j2 - 1 ) / 2;
+-        i2 = i1 + 1;
+-      }
+-      else
+-      {
+-        *i_lo = i1;
+-        break;
+-      }
+-    }
+-  }
+-//
+-//  Bracket R_HI.
+-//
+-  if ( r[indx[n-1]] <= r_hi )
+-  {
+-    *i_hi = n - 1;
+-  }
+-  else
+-  {
+-    j1 = *i_lo;
+-    j2 = n - 1;
+-    i1 = ( j1 + j2 - 1 ) / 2;
+-    i2 = i1 + 1;
+-
+-    for ( ; ; )
+-    {
+-      if ( r_hi < r[indx[i1]] )
+-      {
+-        j2 = i1;
+-        i1 = ( j1 + j2 - 1 ) / 2;
+-        i2 = i1 + 1;
+-      }
+-      else if ( r[indx[i2]] < r_hi )
+-      {
+-        j1 = i2;
+-        i1 = ( j1 + j2 - 1 ) / 2;
+-        i2 = i1 + 1;
+-      }
+-      else
+-      {
+-        *i_hi = i2;
+-        break;
+-      }
+-    }
+-  }
+-//
+-//  We expect to have computed the largest I_LO and smallest I_HI such that
+-//    R(INDX(I_LO)) <= R_LO <= R_HI <= R(INDX(I_HI))
+-//  but what we want is actually
+-//    R_LO <= R(INDX(I_LO)) <= R(INDX(I_HI)) <= R_HI
+-//  which we can usually get simply by incrementing I_LO and decrementing I_HI.
+-//
+-  if ( r[indx[*i_lo]] < r_lo )
+-  {
+-    *i_lo = *i_lo + 1;
+-    if ( n - 1 < *i_lo )
+-    {
+-      *i_hi = *i_lo - 1;
+-    }
+-  }
+-
+-  if ( r_hi < r[indx[*i_hi]] )
+-  {
+-    *i_hi = *i_hi - 1;
+-    if ( *i_hi < 0 )
+-    {
+-      *i_lo = *i_hi + 1;
+-    }
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void r8vec_indexed_heap_d ( int n, double a[], int indx[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_INDEXED_HEAP_D creates a descending heap from an indexed R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+-//    each referencing an entry of the data vector.
+-//
+-//    The function adjusts the index vector INDX so that, for 1 <= J <= N/2,
+-//    we have:
+-//      A[INDX[2*J+1]]   <= A[INDX[J]]
+-//    and
+-//      A[INDX[2*J+2]] <= A[INDX[J]]
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 August 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Albert Nijenhuis, Herbert Wilf,
+-//    Combinatorial Algorithms for Computers and Calculators,
+-//    Academic Press, 1978,
+-//    ISBN: 0-12-519260-6,
+-//    LC: QA164.N54.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the size of the index array.
+-//
+-//    Input, double A[*], the data vector.
+-//
+-//    Input/output, int INDX[N], the index array.
+-//    Each entry of INDX must be a valid index for the array A.
+-//    On output, the indices have been reordered into a descending heap.
+-//
+-{
+-  int i;
+-  int ifree;
+-  int key;
+-  int m;
+-//
+-//  Only nodes N/2 - 1 down to 0 can be "parent" nodes.
+-//
+-  for ( i = ( n / 2 ) - 1; 0 <= i; i-- )
+-  {
+-//
+-//  Copy the value out of the parent node.
+-//  Position IFREE is now "open".
+-//
+-    key = indx[i];
+-    ifree = i;
+-
+-    for ( ; ; )
+-    {
+-//
+-//  Positions 2*IFREE+1 and 2*IFREE+2 are the descendants of position
+-//  IFREE.  (One or both may not exist because they exceed N-1.)
+-//
+-      m = 2 * ifree + 1;
+-//
+-//  Does the first position exist?
+-//
+-      if ( n - 1 < m )
+-      {
+-        break;
+-      }
+-//
+-//  Does the second position exist?
+-//
+-      if ( m + 1 <= n - 1 )
+-      {
+-//
+-//  If both positions exist, take the larger of the two values,
+-//  and update M if necessary.
+-//
+-        if ( a[indx[m]] < a[indx[m+1]] )
+-        {
+-          m = m + 1;
+-        }
+-      }
+-//
+-//  If the large descendant is larger than KEY, move it up,
+-//  and update IFREE, the location of the free position, and
+-//  consider the descendants of THIS position.
+-//
+-      if ( a[indx[m]] <= a[key] )
+-      {
+-        break;
+-      }
+-
+-      indx[ifree] = indx[m];
+-      ifree = m;
+-    }
+-//
+-//  Once there is no more shifting to do, KEY moves into the free spot IFREE.
+-//
+-    indx[ifree] = key;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int r8vec_indexed_heap_d_extract ( int *n, double a[], int indx[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_INDEXED_HEAP_D_EXTRACT: extract from heap descending indexed R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+-//    each referencing an entry of the data vector.
+-//
+-//    The routine finds the maximum value in the heap, returns that value to the
+-//    user, deletes that value from the heap, and restores the heap to its
+-//    proper form.
+-//
+-//    Note that the argument N must be a variable, which will be decremented
+-//    before return, and that INDX will hold one less value on output than it
+-//    held on input.
+-//
+-//    This is one of three functions needed to model a priority queue.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 August 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
+-//    Introduction to Algorithms,
+-//    MIT Press, 2001,
+-//    ISBN: 0262032937,
+-//    LC: QA76.C662.
+-//
+-//  Parameters:
+-//
+-//    Input/output, int *N, the number of items in the index vector.
+-//
+-//    Input, double A[*], the data vector.
+-//
+-//    Input/output, int INDX[N], the index vector.
+-//
+-//    Output, int R8VEC_INDEXED_HEAP_D_EXTRACT, the index in A of the item of
+-//    maximum value, which has now been removed from the heap.
+-//
+-{
+-  int indx_extract;
+-
+-  if ( *n < 1 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8VEC_INDEXED_HEAP_D_EXTRACT - Fatal error!\n";
+-    std::cerr << "  The heap is empty.\n";
+-    std::exit ( 1 );
+-  }
+-//
+-//  Get the index of the maximum value.
+-//
+-  indx_extract = indx[0];
+-
+-  if ( *n == 1 )
+-  {
+-    *n = 0;
+-    return indx_extract;
+-  }
+-//
+-//  Shift the last index down.
+-//
+-  indx[0] = indx[*n-1];
+-//
+-//  Restore the heap structure.
+-//
+-  *n = *n - 1;
+-  webbur::r8vec_indexed_heap_d ( *n, a, indx );
+-
+-  return indx_extract;
+-}
+-//****************************************************************************80
+-
+-void r8vec_indexed_heap_d_insert ( int *n, double a[], int indx[],
+-  int indx_insert )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_INDEXED_HEAP_D_INSERT: insert value into heap descending indexed R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+-//    each referencing an entry of the data vector.
+-//
+-//    Note that the argument N must be a variable, and will be incremented before
+-//    return, and that INDX must be able to hold one more entry on output than
+-//    it held on input.
+-//
+-//    This is one of three functions needed to model a priority queue.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 August 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
+-//    Introduction to Algorithms,
+-//    MIT Press, 2001,
+-//    ISBN: 0262032937,
+-//    LC: QA76.C662.
+-//
+-//  Parameters:
+-//
+-//    Input/output, int *N, the number of items in the index vector.
+-//
+-//    Input, double A[*], the data vector.
+-//
+-//    Input/output, int INDX[N], the index vector.
+-//
+-//    Input, int INDX_INSERT, the index in A of the value
+-//    to be inserted into the heap.
+-//
+-{
+-  int i;
+-  int parent;
+-
+-  *n = *n + 1;
+-  i = *n - 1;
+-
+-  while ( 0 < i )
+-  {
+-    parent = ( i - 1 ) / 2;
+-
+-    if ( a[indx_insert] <= a[indx[parent]] )
+-    {
+-      break;
+-    }
+-
+-    indx[i] = indx[parent];
+-    i = parent;
+-  }
+-
+-  indx[i] = indx_insert;
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int r8vec_indexed_heap_d_max ( int n, double a[], int indx[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_INDEXED_HEAP_D_MAX: maximum value in heap descending indexed R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
+-//    each referencing an entry of the data vector.
+-//
+-//    This is one of three functions needed to model a priority queue.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    18 August 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
+-//    Introduction to Algorithms,
+-//    MIT Press, 2001,
+-//    ISBN: 0262032937,
+-//    LC: QA76.C662.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of items in the index vector.
+-//
+-//    Input, double A[*], the data vector.
+-//
+-//    Input, int INDX[N], the index vector.
+-//
+-//    Output, int R8VEC_INDEXED_HEAP_D_MAX, the index in A of the maximum value
+-//    in the heap.
+-//
+-{
+-  int indx_max;
+-
+-  indx_max = indx[0];
+-
+-  return indx_max;
+-}
+-//****************************************************************************80
+-
+-double *r8vec_legendre_new ( int n, double a_first, double a_last )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_LEGENDRE_NEW creates a vector of Chebyshev spaced values.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    17 June 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input, double A_FIRST, A_LAST, the first and last entries.
+-//
+-//    Output, double R8VEC_LEGENDRE_NEW[N], a vector of Legendre spaced data.
+-//
+-{
+-  double *a;
+-  int i;
+-
+-  a = webbur::legendre_zeros ( n );
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a[i] = ( ( 1.0 - a[i] ) * a_first
+-           + ( 1.0 + a[i] ) * a_last )
+-           /   2.0;
+-  }
+-  return a;
+-}
+-//****************************************************************************80
+-
+-double *r8vec_linspace_new ( int n, double a_first, double a_last )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_LINSPACE_NEW creates a vector of linearly spaced values.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    14 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input, double A_FIRST, A_LAST, the first and last entries.
+-//
+-//    Output, double R8VEC_LINSPACE_NEW[N], a vector of linearly spaced data.
+-//
+-{
+-  double *a;
+-  int i;
+-
+-  a = new double[n];
+-
+-  if ( n == 1 )
+-  {
+-    a[0] = ( a_first + a_last ) / 2.0;
+-  }
+-  else
+-  {
+-    for ( i = 0; i < n; i++ )
+-    {
+-      a[i] = ( ( double ) ( n - 1 - i ) * a_first
+-             + ( double ) (         i ) * a_last )
+-             / ( double ) ( n - 1     );
+-    }
+-  }
+-  return a;
+-}
+-//****************************************************************************80
+-
+-double r8vec_min ( int n, double r8vec[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_MIN returns the value of the minimum element in an R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    02 July 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the array.
+-//
+-//    Input, double R8VEC[N], the array to be checked.
+-//
+-//    Output, double R8VEC_MIN, the value of the minimum element.
+-//
+-{
+-  int i;
+-  double value;
+-
+-  value = r8vec[0];
+-
+-  for ( i = 1; i < n; i++ )
+-  {
+-    if ( r8vec[i] < value )
+-    {
+-      value = r8vec[i];
+-    }
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-double r8vec_min_pos ( int n, double a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_MIN_POS returns the minimum positive value of an R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    08 November 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries.
+-//
+-//    Input, double A[N], the array.
+-//
+-//    Output, double R8VEC_MIN_POS, the smallest positive entry,
+-//    or R8_HUGE if no entry is positive.
+-//
+-{
+-  int i;
+-  double r8_huge = 1.0E+30;
+-  double value;
+-
+-  value = r8_huge;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    if ( 0.0 < a[i] )
+-    {
+-      if ( a[i] < value )
+-      {
+-        value = a[i];
+-      }
+-    }
+-  }
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void r8vec_print ( int n, double a[], std::string title )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_PRINT prints an R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    16 August 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of components of the vector.
+-//
+-//    Input, double A[N], the vector to be printed.
+-//
+-//    Input, string TITLE, a title.
+-//
+-{
+-  int i;
+-
+-  std::cout << "\n";
+-  std::cout << title << "\n";
+-  std::cout << "\n";
+-  for ( i = 0; i < n; i++ )
+-  {
+-    std::cout << "  " << std::setw(8)  << i
+-              << ": " << std::setw(14) << a[i]  << "\n";
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void r8vec_scale ( double s, int n, double a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_SCALE multiples an R8VEC by a scale factor.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    22 September 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, double S, the scale factor.
+-//
+-//    Input, int N, the number of entries in the vectors.
+-//
+-//    Input/output, double A[N], the vector to be scaled.
+-//    On output, A[] = S * A[].
+-//
+-{
+-  int i;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a[i] = s * a[i];
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void r8vec_sort_heap_index_a ( int n, double a[], int indx[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R8VEC
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    The sorting is not actually carried out.  Rather an index array is
+-//    created which defines the sorting.  This array may be used to sort
+-//    or index the array, or to sort or index related arrays keyed on the
+-//    original array.
+-//
+-//    Once the index array is computed, the sorting can be carried out
+-//    "implicitly:
+-//
+-//      a(indx(*))
+-//
+-//    or explicitly, by the call
+-//
+-//      r8vec_permute ( n, indx, 0, a )
+-//
+-//    after which a(*) is sorted.
+-//
+-//    Note that the index vector is 0-based.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    02 October 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the array.
+-//
+-//    Input, double A[N], an array to be index-sorted.
+-//
+-//    Output, int INDX[N], contains the sort index.  The
+-//    I-th element of the sorted array is A(INDX(I)).
+-//
+-{
+-  double aval;
+-  int i;
+-  int indxt;
+-  int ir;
+-  int j;
+-  int l;
+-
+-  if ( n < 1 )
+-  {
+-    return;
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    indx[i] = i;
+-  }
+-
+-  if ( n == 1 )
+-  {
+-    return;
+-  }
+-
+-  l = n / 2 + 1;
+-  ir = n;
+-
+-  for ( ; ; )
+-  {
+-    if ( 1 < l )
+-    {
+-      l = l - 1;
+-      indxt = indx[l-1];
+-      aval = a[indxt];
+-    }
+-    else
+-    {
+-      indxt = indx[ir-1];
+-      aval = a[indxt];
+-      indx[ir-1] = indx[0];
+-      ir = ir - 1;
+-
+-      if ( ir == 1 )
+-      {
+-        indx[0] = indxt;
+-        break;
+-      }
+-    }
+-
+-    i = l;
+-    j = l + l;
+-
+-    while ( j <= ir )
+-    {
+-      if ( j < ir )
+-      {
+-        if ( a[indx[j-1]] < a[indx[j]] )
+-        {
+-          j = j + 1;
+-        }
+-      }
+-
+-      if ( aval < a[indx[j-1]] )
+-      {
+-        indx[i-1] = indx[j-1];
+-        i = j;
+-        j = j + j;
+-      }
+-      else
+-      {
+-        j = ir + 1;
+-      }
+-    }
+-    indx[i-1] = indxt;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-int *r8vec_sort_heap_index_a_new ( int n, double a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_SORT_HEAP_INDEX_A_NEW does an indexed heap ascending sort of an R8VEC
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    The sorting is not actually carried out.  Rather an index array is
+-//    created which defines the sorting.  This array may be used to sort
+-//    or index the array, or to sort or index related arrays keyed on the
+-//    original array.
+-//
+-//    Once the index array is computed, the sorting can be carried out
+-//    "implicitly:
+-//
+-//      a(indx(*))
+-//
+-//    or explicitly, by the call
+-//
+-//      r8vec_permute ( n, indx, 0, a )
+-//
+-//    after which a(*) is sorted.
+-//
+-//    Note that the index vector is 0-based.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    02 October 2010
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the array.
+-//
+-//    Input, double A[N], an array to be index-sorted.
+-//
+-//    Output, int R8VEC_SORT_HEAP_INDEX_A_NEW[N], contains the sort index.  The
+-//    I-th element of the sorted array is A(INDX(I)).
+-//
+-{
+-  double aval;
+-  int i;
+-  int *indx;
+-  int indxt;
+-  int ir;
+-  int j;
+-  int l;
+-
+-  if ( n < 1 )
+-  {
+-    return NULL;
+-  }
+-
+-  indx = new int[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    indx[i] = i;
+-  }
+-
+-  if ( n == 1 )
+-  {
+-    return indx;
+-  }
+-
+-  l = n / 2 + 1;
+-  ir = n;
+-
+-  for ( ; ; )
+-  {
+-    if ( 1 < l )
+-    {
+-      l = l - 1;
+-      indxt = indx[l-1];
+-      aval = a[indxt];
+-    }
+-    else
+-    {
+-      indxt = indx[ir-1];
+-      aval = a[indxt];
+-      indx[ir-1] = indx[0];
+-      ir = ir - 1;
+-
+-      if ( ir == 1 )
+-      {
+-        indx[0] = indxt;
+-        break;
+-      }
+-    }
+-
+-    i = l;
+-    j = l + l;
+-
+-    while ( j <= ir )
+-    {
+-      if ( j < ir )
+-      {
+-        if ( a[indx[j-1]] < a[indx[j]] )
+-        {
+-          j = j + 1;
+-        }
+-      }
+-
+-      if ( aval < a[indx[j-1]] )
+-      {
+-        indx[i-1] = indx[j-1];
+-        i = j;
+-        j = j + j;
+-      }
+-      else
+-      {
+-        j = ir + 1;
+-      }
+-    }
+-    indx[i-1] = indxt;
+-  }
+-
+-  return indx;
+-}
+-//****************************************************************************80
+-
+-void r8vec_stutter ( int n, double a[], int m, double am[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_STUTTER makes a "stuttering" copy of an R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//    Applying a stuttering factor M of 3, the vector A = ( 1, 5, 8 ) becomes
+-//    AM = ( 1, 1, 1, 5, 5, 5, 8, 8, 8 ).
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    28 March 2011
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the size of the input vector.
+-//
+-//    Input, double A[N], the vector.
+-//
+-//    Input, int M, the "stuttering factor".
+-//
+-//    Output, double AM[M*N], the stuttering vector.
+-//
+-{
+-  int i;
+-  int j;
+-  int k;
+-
+-  k = 0;
+-  for ( i = 0; i < n; i++ )
+-  {
+-    for ( j = 0; j < m; j++ )
+-    {
+-      am[k] = a[i];
+-      k = k + 1;
+-    }
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-double r8vec_sum ( int n, double a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_SUM returns the sum of an R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a double precision vector.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    15 October 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input, double A[N], the vector.
+-//
+-//    Output, double R8VEC_SUM, the sum of the vector.
+-//
+-{
+-  int i;
+-  double value;
+-
+-  value = 0.0;
+-  for ( i = 0; i < n; i++ )
+-  {
+-    value = value + a[i];
+-  }
+-
+-  return value;
+-}
+-//****************************************************************************80
+-
+-void r8vec_uniform_01 ( int n, int *seed, double r[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
+-//
+-//  Discussion:
+-//
+-//    This routine implements the recursion
+-//
+-//      seed = ( 16807 * seed ) mod ( 2^31 - 1 )
+-//      u = seed / ( 2^31 - 1 )
+-//
+-//    The integer arithmetic never requires more than 32 bits,
+-//    including a sign bit.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 August 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Paul Bratley, Bennett Fox, Linus Schrage,
+-//    A Guide to Simulation,
+-//    Second Edition,
+-//    Springer, 1987,
+-//    ISBN: 0387964673,
+-//    LC: QA76.9.C65.B73.
+-//
+-//    Bennett Fox,
+-//    Algorithm 647:
+-//    Implementation and Relative Efficiency of Quasirandom
+-//    Sequence Generators,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 12, Number 4, December 1986, pages 362-376.
+-//
+-//    Pierre L'Ecuyer,
+-//    Random Number Generation,
+-//    in Handbook of Simulation,
+-//    edited by Jerry Banks,
+-//    Wiley, 1998,
+-//    ISBN: 0471134031,
+-//    LC: T57.62.H37.
+-//
+-//    Peter Lewis, Allen Goodman, James Miller,
+-//    A Pseudo-Random Number Generator for the System/360,
+-//    IBM Systems Journal,
+-//    Volume 8, Number 2, 1969, pages 136-143.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input/output, int *SEED, a seed for the random number generator.
+-//
+-//    Output, double R[N], the vector of pseudorandom values.
+-//
+-{
+-  int i;
+-  int i4_huge = 2147483647;
+-  int k;
+-
+-  if ( *seed == 0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8VEC_UNIFORM_01 - Fatal error!\n";
+-    std::cerr << "  Input value of SEED = 0.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    k = *seed / 127773;
+-
+-    *seed = 16807 * ( *seed - k * 127773 ) - k * 2836;
+-
+-    if ( *seed < 0 )
+-    {
+-      *seed = *seed + i4_huge;
+-    }
+-
+-    r[i] = ( double ) ( *seed ) * 4.656612875E-10;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-double *r8vec_uniform_01_new ( int n, int *seed )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_UNIFORM_01_NEW returns a new unit pseudorandom R8VEC.
+-//
+-//  Discussion:
+-//
+-//    This routine implements the recursion
+-//
+-//      seed = ( 16807 * seed ) mod ( 2^31 - 1 )
+-//      u = seed / ( 2^31 - 1 )
+-//
+-//    The integer arithmetic never requires more than 32 bits,
+-//    including a sign bit.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 August 2004
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Reference:
+-//
+-//    Paul Bratley, Bennett Fox, Linus Schrage,
+-//    A Guide to Simulation,
+-//    Second Edition,
+-//    Springer, 1987,
+-//    ISBN: 0387964673,
+-//    LC: QA76.9.C65.B73.
+-//
+-//    Bennett Fox,
+-//    Algorithm 647:
+-//    Implementation and Relative Efficiency of Quasirandom
+-//    Sequence Generators,
+-//    ACM Transactions on Mathematical Software,
+-//    Volume 12, Number 4, December 1986, pages 362-376.
+-//
+-//    Pierre L'Ecuyer,
+-//    Random Number Generation,
+-//    in Handbook of Simulation,
+-//    edited by Jerry Banks,
+-//    Wiley, 1998,
+-//    ISBN: 0471134031,
+-//    LC: T57.62.H37.
+-//
+-//    Peter Lewis, Allen Goodman, James Miller,
+-//    A Pseudo-Random Number Generator for the System/360,
+-//    IBM Systems Journal,
+-//    Volume 8, Number 2, 1969, pages 136-143.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Input/output, int *SEED, a seed for the random number generator.
+-//
+-//    Output, double R8VEC_UNIFORM_01_NEW[N], the vector of pseudorandom values.
+-//
+-{
+-  int i;
+-  int i4_huge = 2147483647;
+-  int k;
+-  double *r;
+-
+-  if ( *seed == 0 )
+-  {
+-    std::cerr << "\n";
+-    std::cerr << "R8VEC_UNIFORM_01_NEW - Fatal error!\n";
+-    std::cerr << "  Input value of SEED = 0.\n";
+-    std::exit ( 1 );
+-  }
+-
+-  r = new double[n];
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    k = *seed / 127773;
+-
+-    *seed = 16807 * ( *seed - k * 127773 ) - k * 2836;
+-
+-    if ( *seed < 0 )
+-    {
+-      *seed = *seed + i4_huge;
+-    }
+-
+-    r[i] = ( double ) ( *seed ) * 4.656612875E-10;
+-  }
+-
+-  return r;
+-}
+-//****************************************************************************80
+-
+-void r8vec_zero ( int n, double a[] )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    R8VEC_ZERO zeroes an R8VEC.
+-//
+-//  Discussion:
+-//
+-//    An R8VEC is a vector of R8's.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    03 July 2005
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the number of entries in the vector.
+-//
+-//    Output, double A[N], a vector of zeroes.
+-//
+-{
+-  int i;
+-
+-  for ( i = 0; i < n; i++ )
+-  {
+-    a[i] = 0.0;
+-  }
+-  return;
+-}
+-//****************************************************************************80
+-
+-void sort_heap_external ( int n, int *indx, int *i, int *j, int isgn )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
+-//
+-//  Discussion:
+-//
+-//    The actual list is not passed to the routine.  Hence it may
+-//    consist of integers, reals, numbers, names, etc.  The user,
+-//    after each return from the routine, will be asked to compare or
+-//    interchange two items.
+-//
+-//    The current version of this code mimics the FORTRAN version,
+-//    so the values of I and J, in particular, are FORTRAN indices.
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    05 February 2004
+-//
+-//  Author:
+-//
+-//    Original FORTRAN77 version by Albert Nijenhuis, Herbert Wilf.
+-//    C++ version by John Burkardt
+-//
+-//  Reference:
+-//
+-//    Albert Nijenhuis, Herbert Wilf,
+-//    Combinatorial Algorithms,
+-//    Academic Press, 1978, second edition,
+-//    ISBN 0-12-519260-6.
+-//
+-//  Parameters:
+-//
+-//    Input, int N, the length of the input list.
+-//
+-//    Input/output, int *INDX.
+-//    The user must set INDX to 0 before the first call.
+-//    On return,
+-//      if INDX is greater than 0, the user must interchange
+-//      items I and J and recall the routine.
+-//      If INDX is less than 0, the user is to compare items I
+-//      and J and return in ISGN a negative value if I is to
+-//      precede J, and a positive value otherwise.
+-//      If INDX is 0, the sorting is done.
+-//
+-//    Output, int *I, *J.  On return with INDX positive,
+-//    elements I and J of the user's list should be
+-//    interchanged.  On return with INDX negative, elements I
+-//    and J are to be compared by the user.
+-//
+-//    Input, int ISGN. On return with INDX negative, the
+-//    user should compare elements I and J of the list.  If
+-//    item I is to precede item J, set ISGN negative,
+-//    otherwise set ISGN positive.
+-//
+-{
+-  static int i_save = 0;
+-  static int j_save = 0;
+-  static int k = 0;
+-  static int k1 = 0;
+-  static int n1 = 0;
+-//
+-//  INDX = 0: This is the first call.
+-//
+-  if ( *indx == 0 )
+-  {
+-
+-    i_save = 0;
+-    j_save = 0;
+-    k = n / 2;
+-    k1 = k;
+-    n1 = n;
+-  }
+-//
+-//  INDX < 0: The user is returning the results of a comparison.
+-//
+-  else if ( *indx < 0 )
+-  {
+-    if ( *indx == -2 )
+-    {
+-      if ( isgn < 0 )
+-      {
+-        i_save = i_save + 1;
+-      }
+-      j_save = k1;
+-      k1 = i_save;
+-      *indx = -1;
+-      *i = i_save;
+-      *j = j_save;
+-      return;
+-    }
+-
+-    if ( 0 < isgn )
+-    {
+-      *indx = 2;
+-      *i = i_save;
+-      *j = j_save;
+-      return;
+-    }
+-
+-    if ( k <= 1 )
+-    {
+-      if ( n1 == 1 )
+-      {
+-        i_save = 0;
+-        j_save = 0;
+-        *indx = 0;
+-      }
+-      else
+-      {
+-        i_save = n1;
+-        j_save = 1;
+-        n1 = n1 - 1;
+-        *indx = 1;
+-      }
+-      *i = i_save;
+-      *j = j_save;
+-      return;
+-    }
+-    k = k - 1;
+-    k1 = k;
+-  }
+-//
+-//  0 < INDX: the user was asked to make an interchange.
+-//
+-  else if ( *indx == 1 )
+-  {
+-    k1 = k;
+-  }
+-
+-  for ( ; ; )
+-  {
+-
+-    i_save = 2 * k1;
+-
+-    if ( i_save == n1 )
+-    {
+-      j_save = k1;
+-      k1 = i_save;
+-      *indx = -1;
+-      *i = i_save;
+-      *j = j_save;
+-      return;
+-    }
+-    else if ( i_save <= n1 )
+-    {
+-      j_save = i_save + 1;
+-      *indx = -2;
+-      *i = i_save;
+-      *j = j_save;
+-      return;
+-    }
+-
+-    if ( k <= 1 )
+-    {
+-      break;
+-    }
+-
+-    k = k - 1;
+-    k1 = k;
+-  }
+-
+-  if ( n1 == 1 )
+-  {
+-    i_save = 0;
+-    j_save = 0;
+-    *indx = 0;
+-    *i = i_save;
+-    *j = j_save;
+-  }
+-  else
+-  {
+-    i_save = n1;
+-    j_save = 1;
+-    n1 = n1 - 1;
+-    *indx = 1;
+-    *i = i_save;
+-    *j = j_save;
+-  }
+-
+-  return;
+-}
+-//****************************************************************************80
+-
+-void timestamp ( )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    TIMESTAMP prints the current YMDHMS date as a time stamp.
+-//
+-//  Example:
+-//
+-//    31 May 2001 09:45:54 AM
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    08 July 2009
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    None
+-//
+-{
+-# define TIME_SIZE 40
+-
+-  static char time_buffer[TIME_SIZE];
+-  const struct std::tm *tm_ptr;
+-  size_t len;
+-  std::time_t now;
+-
+-  now = std::time ( NULL );
+-  tm_ptr = std::localtime ( &now );
+-
+-  len = std::strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm_ptr );
+-
+-  std::cout << time_buffer << "\n";
+-
+-  return;
+-# undef TIME_SIZE
+-}
+-//****************************************************************************80
+-
+-void vec_colex_next3 ( int dim_num, int base[], int a[], bool *more )
+-
+-//****************************************************************************80
+-//
+-//  Purpose:
+-//
+-//    VEC_COLEX_NEXT3 generates vectors in colex order.
+-//
+-//  Discussion:
+-//
+-//    The vectors are produced in colexical order, starting with
+-//
+-//    (1,        1,        ...,1),
+-//    (2,        1,        ...,1),
+-//     ...
+-//    (BASE(1),  1,        ...,1)
+-//
+-//    (1,        2,        ...,1)
+-//    (2,        2,        ...,1)
+-//    ...
+-//    (BASE(1),  2,        ...,1)
+-//
+-//    (1,        3,        ...,1)
+-//    (2,        3,        ...,1)
+-//    ...
+-//    (BASE(1),  BASE(2), ...,BASE(DIM_NUM)).
+-//
+-//  Example:
+-//
+-//    DIM_NUM = 2,
+-//    BASE = { 3, 3 }
+-//
+-//    1   1
+-//    2   1
+-//    3   1
+-//    1   2
+-//    2   2
+-//    3   2
+-//    1   3
+-//    2   3
+-//    3   3
+-//
+-//  Licensing:
+-//
+-//    This code is distributed under the GNU LGPL license.
+-//
+-//  Modified:
+-//
+-//    19 August 2008
+-//
+-//  Author:
+-//
+-//    John Burkardt
+-//
+-//  Parameters:
+-//
+-//    Input, int DIM_NUM, the spatial dimension.
+-//
+-//    Input, int BASE[DIM_NUM], the bases to be used in each dimension.
+-//    In dimension I, entries will range from 1 to BASE[I].
+-//
+-//    Output, int A[DIM_NUM], the next vector.
+-//
+-//    Input/output, bool *MORE.  Set this variable false before
+-//    the first call.  On return, MORE is TRUE if another vector has
+-//    been computed.  If MORE is returned FALSE, ignore the output
+-//    vector and stop calling the routine.
+-//
+-{
+-  int i;
+-
+-  if ( !( *more ) )
+-  {
+-    for ( i = 0; i < dim_num; i++ )
+-    {
+-      a[i] = 1;
+-    }
+-    *more = true;
+-  }
+-  else
+-  {
+-    for ( i = 0; i < dim_num; i++ )
+-    {
+-      a[i] = a[i] + 1;
+-
+-      if ( a[i] <= base[i] )
+-      {
+-        return;
+-      }
+-      a[i] = 1;
+-    }
+-    *more = false;
+-  }
+-
+-  return;
+-}
+-
+-
+-}
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/packages/VPISparseGrid/src/sandia_rules.cpp
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/packages/VPISparseGrid/src/sandia_rules.cpp	(nonexistent)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/packages/VPISparseGrid/src/sandia_rules.cpp	(revision 26240)
+@@ -0,0 +1,25739 @@
++# include "sandia_rules.hpp"
++
++# include <cstdlib>
++# include <iomanip>
++# include <iostream>
++# include <cmath>
++# include <ctime>
++
++namespace webbur
++{
++//****************************************************************************80
++
++void binary_vector_next ( int n, int bvec[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    BINARY_VECTOR_NEXT generates the next binary vector.
++//
++//  Discussion:
++//
++//    A binary vector is a vector whose entries are 0 or 1.
++//
++//    The user inputs an initial zero vector to start.  The program returns
++//    the "next" vector.
++//
++//    The vectors are produced in the order:
++//
++//    ( 0, 0, 0, ..., 0 )
++//    ( 1, 0, 0, ..., 0 )
++//    ( 0, 1, 0, ..., 0 )
++//    ( 1, 1, 0, ..., 0 )
++//    ( 0, 0, 1, ..., 0 )
++//    ( 1, 0, 1, ..., 0 )
++//               ...
++//    ( 1, 1, 1, ..., 1)
++//
++//    and the "next" vector after (1,1,...,1) is (0,0,...,0).  That is,
++//    we allow wrap around.
++//
++//  Example:
++//
++//    N = 3
++//
++//    Input      Output
++//    -----      ------
++//    0 0 0  =>  1 0 0
++//    1 0 0  =>  0 1 0
++//    0 1 0  =>  1 1 0
++//    1 1 0  =>  0 0 1
++//    0 0 1  =>  1 0 1
++//    1 0 1  =>  0 1 1
++//    0 1 1  =>  1 1 1
++//    1 1 1  =>  0 0 0
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 September 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the dimension of the vectors.
++//
++//    Input/output, int BVEC[N], on output, the successor
++//    to the input vector.
++//
++{
++  int i;
++
++  for ( i = 0; i < n; i++ )
++  {
++    if ( bvec[i] == 1 )
++    {
++      bvec[i] = 0;
++    }
++    else
++    {
++      bvec[i] = 1;
++      break;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void ccn_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CCN_COMPUTE computes a nested Clenshaw Curtis quadrature rule.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::ccn_compute_points ( n, x );
++  webbur::ccn_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void ccn_compute_np ( int n, int np, double p[], double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CCN_COMPUTE_NP computes a nested Clenshaw Curtis quadrature rule.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::ccn_compute_points ( n, x );
++  webbur::ccn_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void ccn_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CCN_COMPUTE_POINTS: compute nested Clenshaw Curtis points.
++//
++//  Discussion:
++//
++//    We want to compute the following sequence:
++//
++//    1/2,
++//    0, 1
++//    1/4, 3/4
++//    1/8, 3/8, 5/8, 7/8,
++//    1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16, and so on.
++//
++//    But we would prefer that the numbers in each row be regrouped in pairs
++//    that are symmetric about 1/2, with the number above 1/2 coming first.
++//    Thus, the last row might become:
++//    (9/16, 7/16), (11/16, 5/16), ..., (15/16, 1/16).
++//
++//    Once we have our sequence, we apply the Chebyshev transformation
++//    which maps [0,1] to [-1,+1].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    06 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of elements to compute.
++//
++//    Output, double X[N], the elements of the sequence.
++//
++{
++  int d;
++  int i;
++  int k;
++  int m;
++  double pi = 3.141592653589793;
++  int td;
++  int tu;
++//
++//  Handle first three entries specially.
++//
++  if ( 1 <= n )
++  {
++    x[0] = 0.5;
++  }
++
++  if ( 2 <= n )
++  {
++    x[1] = 1.0;
++  }
++
++  if ( 3 <= n )
++  {
++    x[2] = 0.0;
++  }
++
++  m = 3;
++  d = 2;
++
++  while ( m < n )
++  {
++    tu = d + 1;
++    td = d - 1;
++
++    k = webbur::i4_min ( d, n - m );
++
++    for ( i = 1; i <= k; i++ )
++    {
++      if ( ( i % 2 ) == 1 )
++      {
++        x[m+i-1] = tu / 2.0 / ( double ) ( k );
++        tu = tu + 2;
++      }
++      else
++      {
++        x[m+i-1] = td / 2.0 / ( double ) ( k );
++        td = td - 2;
++      }
++    }
++    m = m + k;
++    d = d * 2;
++  }
++//
++//  Apply the Chebyshev transformation.
++//
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = std::cos ( x[i] * pi );
++  }
++  x[0] = 0.0;
++
++  if ( 2 <= n )
++  {
++    x[1] = -1.0;
++  }
++
++  if ( 3 <= n )
++  {
++    x[2] = +1.0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void ccn_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CCN_COMPUTE_POINTS_NP: nested Clenshaw Curtis quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::ccn_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void ccn_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CCN_COMPUTE_WEIGHTS: weights for nested Clenshaw Curtis rule.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order of the rule.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double *x;
++  double x_max;
++  double x_min;
++
++  x = new double[n];
++
++  webbur::ccn_compute_points ( n, x );
++//
++//  Get the weights.
++//
++  x_min = -1.0;
++  x_max = +1.0;
++
++  webbur::nc_compute ( n, x_min, x_max, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void ccn_compute_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CCN_COMPUTE_WEIGHTS_NP: nested Clenshaw Curtis quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::ccn_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev1_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV1_COMPUTE computes a Chebyshev type 1 quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) F(X) / sqrt ( 1 - x^2 ) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int i;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CHEBYSHEV1_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = pi / ( double ) ( n );
++  }
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = std::cos ( pi * ( double ) ( 2 * n - 1 - 2 * i )
++                         / ( double ) ( 2 * n ) );
++  }
++  if ( ( n % 2 ) == 1 )
++  {
++    x[(n-1)/2] = 0.0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev1_compute_np ( int n, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV1_COMPUTE_NP computes a Chebyshev type 1 quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) F(X) / sqrt ( 1 - x^2 ) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::chebyshev1_compute ( n, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev1_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV1_COMPUTE_POINTS computes Chebyshev type 1 quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int i;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CHEBYSHEV1_COMPUTE_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] =  std::cos ( pi * ( double ) ( 2 * n - 1 - 2 * i )
++                          / ( double ) ( 2 * n ) );
++  }
++  if ( ( n % 2 ) == 1 )
++  {
++    x[(n-1)/2] = 0.0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev1_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV1_COMPUTE_POINTS_NP computes Chebyshev type 1 quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::chebyshev1_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev1_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV1_COMPUTE_WEIGHTS computes Chebyshev type 1 quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int i;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CHEBYSHEV1_COMPUTE_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = pi / ( double ) ( n );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev1_compute_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV1_COMPUTE_WEIGHTS_NP: Chebyshev type 1 quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::chebyshev1_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++double chebyshev1_integral ( int expon )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV1_INTEGRAL evaluates a monomial Chebyshev type 1 integral.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -1 <= x <= +1 ) x^n / sqrt ( 1 - x^2 ) dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent.
++//
++//    Output, double CHEBYSHEV1_INTEGRAL, the value of the exact integral.
++//
++{
++  double bot;
++  double exact;
++  int i;
++  double pi = 3.141592653589793;
++  double top;
++//
++//  Get the exact value of the integral.
++//
++  if ( ( expon % 2 ) == 0 )
++  {
++    top = 1;
++    bot = 1;
++    for ( i = 2; i <= expon; i = i + 2 )
++    {
++      top = top * ( i - 1 );
++      bot = bot *   i;
++    }
++
++    exact = pi * ( double ) ( top ) / ( double ) ( bot );
++  }
++  else
++  {
++    exact = 0.0;
++  }
++
++  return exact;
++}
++//****************************************************************************80
++
++void chebyshev2_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV2_COMPUTE computes a Chebyshev type 2 quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -1 <= x <= 1 ) f(x)  sqrt ( 1 - x^2 )  dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double angle;
++  int i;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CHEBYSHEV2_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
++    w[i] = pi / ( double ) ( n + 1 ) * std::pow ( std::sin ( angle ), 2 );
++    x[i] = std::cos ( angle );
++  }
++
++  if ( ( n % 2 ) == 1 )
++  {
++    x[(n-1)/2] = 0.0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev2_compute_np ( int n, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV2_COMPUTE_NP computes a Chebyshev type 2 quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) F(X)  sqrt ( 1 - x^2 )  dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::chebyshev2_compute ( n, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev2_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV2_COMPUTE_POINTS computes Chebyshev type 2 quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  double angle;
++  int i;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CHEBYSHEV2_COMPUTE_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
++    x[i] =  std::cos ( angle );
++  }
++
++  if ( ( n % 2 ) == 1 )
++  {
++    x[(n-1)/2] = 0.0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev2_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV2_COMPUTE_POINTS_NP computes Chebyshev type 2 quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    03 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::chebyshev2_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev2_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV2_COMPUTE_WEIGHTS computes Chebyshev type 2 quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double angle;
++  int i;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CHEBYSHEV2_COMPUTE_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    angle = pi * ( double ) ( n - i ) / ( double ) ( n + 1 );
++    w[i] = pi / ( double ) ( n + 1 ) * std::pow ( std::sin ( angle ), 2 );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void chebyshev2_compute_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV2_COMPUTE_WEIGHTS_NP: Chebyshev type 2 quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::chebyshev2_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++double chebyshev2_integral ( int expon )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CHEBYSHEV2_INTEGRAL evaluates a monomial Chebyshev type 2 integral.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -1 <= x <= +1 ) x^n * sqrt ( 1 - x^2 ) dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent.
++//
++//    Output, double CHEBYSHEV2_INTEGRAL, the value of the exact integral.
++//
++{
++  double bot;
++  double exact;
++  int i;
++  double pi = 3.141592653589793;
++  double top;
++//
++//  Get the exact value of the integral.
++//
++  if ( ( expon % 2 ) == 0 )
++  {
++    top = 1;
++    bot = 1;
++    for ( i = 2; i <= expon; i = i + 2 )
++    {
++      top = top * ( i - 1 );
++      bot = bot *   i;
++    }
++
++	bot = bot * ( double ) ( expon + 2 );
++
++    exact = pi * ( double ) ( top ) / ( double ) ( bot );
++  }
++  else
++  {
++    exact = 0.0;
++  }
++  return exact;
++}
++//****************************************************************************80
++
++void clenshaw_curtis_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CLENSHAW_CURTIS_COMPUTE computes a Clenshaw Curtis quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 March 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double b;
++  int i;
++  int j;
++  double pi = 3.141592653589793;
++  double theta;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CLENSHAW_CURTIS_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++  else if ( n == 1 )
++  {
++    x[0] = 0.0;
++    w[0] = 2.0;
++  }
++  else
++  {
++    for ( i = 0; i < n; i++ )
++    {
++      x[i] =  std::cos ( ( double ) ( n - 1 - i ) * pi
++                       / ( double ) ( n - 1     ) );
++    }
++    x[0] = -1.0;
++    if ( ( n % 2 ) == 1 )
++    {
++      x[(n-1)/2] = 0.0;
++    }
++    x[n-1] = +1.0;
++
++    for ( i = 0; i < n; i++ )
++    {
++      theta = ( double ) ( i ) * pi / ( double ) ( n - 1 );
++
++      w[i] = 1.0;
++
++      for ( j = 1; j <= ( n - 1 ) / 2; j++ )
++      {
++        if ( 2 * j == ( n - 1 ) )
++        {
++          b = 1.0;
++        }
++        else
++        {
++          b = 2.0;
++        }
++
++        w[i] = w[i] - b *  std::cos ( 2.0 * ( double ) ( j ) * theta )
++          / ( double ) ( 4 * j * j - 1 );
++      }
++    }
++
++    w[0] = w[0] / ( double ) ( n - 1 );
++    for ( i = 1; i < n - 1; i++ )
++    {
++      w[i] = 2.0 * w[i] / ( double ) ( n - 1 );
++    }
++    w[n-1] = w[n-1] / ( double ) ( n - 1 );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void clenshaw_curtis_compute_np ( int n, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CLENSHAW_CURTIS_COMPUTE_NP computes a Clenshaw Curtis quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::clenshaw_curtis_compute ( n, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void clenshaw_curtis_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CLENSHAW_CURTIS_COMPUTE_POINTS computes Clenshaw Curtis quadrature points.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    This rule is defined on [-1,1].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int index;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CLENSHAW_CURTIS_COMPUTE_POINTS - Fatal error!\n";
++    std::cerr << "  N < 1.\n";
++    std::exit ( 1 );
++  }
++  else if ( n == 1 )
++  {
++    x[0] = 0.0;
++  }
++  else
++  {
++    for ( index = 1; index <= n; index++ )
++    {
++      x[index-1] =  std::cos ( ( double ) ( n - index ) * pi
++                             / ( double ) ( n - 1     ) );
++    }
++    x[0] = -1.0;
++    if ( ( n % 2 ) == 1 )
++    {
++      x[(n-1)/2] = 0.0;
++    }
++    x[n-1] = +1.0;
++  }
++  return;
++}
++//****************************************************************************80
++
++void clenshaw_curtis_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CLENSHAW_CURTIS_COMPUTE_POINTS_NP: Clenshaw Curtis quadrature points.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    This rule is defined on [-1,1].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::clenshaw_curtis_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void clenshaw_curtis_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CLENSHAW_CURTIS_COMPUTE_WEIGHTS computes Clenshaw Curtis quadrature weights.
++//
++//  Discussion:
++//
++//    The user must preallocate space for the output array W.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Charles Clenshaw, Alan Curtis,
++//    A Method for Numerical Integration on an Automatic Computer,
++//    Numerische Mathematik,
++//    Volume 2, Number 1, December 1960, pages 197-205.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double b;
++  int i;
++  int j;
++  double pi = 3.141592653589793;
++  double theta;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "CLENSHAW_CURTIS_COMPUTE_WEIGHTS - Fatal error!\n";
++    std::cerr << "  N < 1.\n";
++    std::exit ( 1 );
++  }
++  else if ( n == 1 )
++  {
++    w[0] = 2.0;
++    return;
++  }
++
++  for ( i = 1; i <= n; i++ )
++  {
++    theta = ( double ) ( i - 1 ) * pi / ( double ) ( n - 1 );
++
++    w[i-1] = 1.0;
++
++    for ( j = 1; j <= ( n - 1 ) / 2; j++ )
++    {
++      if ( 2 * j == ( n - 1 ) )
++      {
++        b = 1.0;
++      }
++      else
++      {
++        b = 2.0;
++      }
++
++      w[i-1] = w[i-1] - b *  std::cos ( 2.0 * ( double ) ( j ) * theta )
++           / ( double ) ( 4 * j * j - 1 );
++    }
++  }
++
++  w[0] = w[0] / ( double ) ( n - 1 );
++  for ( i = 1; i < n - 1; i++ )
++  {
++    w[i] = 2.0 * w[i] / ( double ) ( n - 1 );
++  }
++  w[n-1] = w[n-1] / ( double ) ( n - 1 );
++
++  return;
++}
++//****************************************************************************80
++
++void clenshaw_curtis_compute_weights_np ( int n, int np, double p[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CLENSHAW_CURTIS_COMPUTE_WEIGHTS_NP: Clenshaw Curtis quadrature weights.
++//
++//  Discussion:
++//
++//    The user must preallocate space for the output array W.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Charles Clenshaw, Alan Curtis,
++//    A Method for Numerical Integration on an Automatic Computer,
++//    Numerische Mathematik,
++//    Volume 2, Number 1, December 1960, pages 197-205.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::clenshaw_curtis_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void comp_next ( int n, int k, int a[], bool *more, int *h, int *t )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    COMP_NEXT computes the compositions of the integer N into K parts.
++//
++//  Discussion:
++//
++//    A composition of the integer N into K parts is an ordered sequence
++//    of K nonnegative integers which sum to N.  The compositions (1,2,1)
++//    and (1,1,2) are considered to be distinct.
++//
++//    The routine computes one composition on each call until there are no more.
++//    For instance, one composition of 6 into 3 parts is
++//    3+2+1, another would be 6+0+0.
++//
++//    On the first call to this routine, set MORE = FALSE.  The routine
++//    will compute the first element in the sequence of compositions, and
++//    return it, as well as setting MORE = TRUE.  If more compositions
++//    are desired, call again, and again.  Each time, the routine will
++//    return with a new composition.
++//
++//    However, when the LAST composition in the sequence is computed
++//    and returned, the routine will reset MORE to FALSE, signaling that
++//    the end of the sequence has been reached.
++//
++//    This routine originally used a SAVE statement to maintain the
++//    variables H and T.  I have decided that it is safer
++//    to pass these variables as arguments, even though the user should
++//    never alter them.  This allows this routine to safely shuffle
++//    between several ongoing calculations.
++//
++//
++//    There are 28 compositions of 6 into three parts.  This routine will
++//    produce those compositions in the following order:
++//
++//     I         A
++//     -     ---------
++//     1     6   0   0
++//     2     5   1   0
++//     3     4   2   0
++//     4     3   3   0
++//     5     2   4   0
++//     6     1   5   0
++//     7     0   6   0
++//     8     5   0   1
++//     9     4   1   1
++//    10     3   2   1
++//    11     2   3   1
++//    12     1   4   1
++//    13     0   5   1
++//    14     4   0   2
++//    15     3   1   2
++//    16     2   2   2
++//    17     1   3   2
++//    18     0   4   2
++//    19     3   0   3
++//    20     2   1   3
++//    21     1   2   3
++//    22     0   3   3
++//    23     2   0   4
++//    24     1   1   4
++//    25     0   2   4
++//    26     1   0   5
++//    27     0   1   5
++//    28     0   0   6
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    02 July 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Albert Nijenhuis, Herbert Wilf.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Albert Nijenhuis, Herbert Wilf,
++//    Combinatorial Algorithms for Computers and Calculators,
++//    Second Edition,
++//    Academic Press, 1978,
++//    ISBN: 0-12-519260-6,
++//    LC: QA164.N54.
++//
++//  Parameters:
++//
++//    Input, int N, the integer whose compositions are desired.
++//
++//    Input, int K, the number of parts in the composition.
++//
++//    Input/output, int A[K], the parts of the composition.
++//
++//    Input/output, bool *MORE.
++//    Set MORE = FALSE on first call.  It will be reset to TRUE on return
++//    with a new composition.  Each new call returns another composition until
++//    MORE is set to FALSE when the last composition has been computed
++//    and returned.
++//
++//    Input/output, int *H, *T, two internal parameters needed for the
++//    computation.  The user should allocate space for these in the calling
++//    program, include them in the calling sequence, but never alter them!
++//
++{
++  int i;
++
++  if ( !( *more ) )
++  {
++    *t = n;
++    *h = 0;
++    a[0] = n;
++    for ( i = 1; i < k; i++ )
++    {
++       a[i] = 0;
++    }
++  }
++  else
++  {
++    if ( 1 < *t )
++    {
++      *h = 0;
++    }
++    *h = *h + 1;
++    *t = a[*h-1];
++    a[*h-1] = 0;
++    a[0] = *t - 1;
++    a[*h] = a[*h] + 1;
++  }
++
++  *more = ( a[k-1] != n );
++
++  return;
++}
++//****************************************************************************80
++
++double cpu_time ( )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    CPU_TIME reports the elapsed CPU time.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 July 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Output, double CPU_TIME, the current total elapsed CPU time in second.
++//
++{
++  double value;
++
++  value = ( double ) std::clock ( ) / ( double ) CLOCKS_PER_SEC;
++
++  return value;
++}
++//****************************************************************************80
++
++void dif_deriv ( int nd, double xd[], double yd[], int *ndp, double xdp[],
++  double ydp[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    DIF_DERIV computes the derivative of a polynomial in divided difference form.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 June 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Carl deBoor,
++//    A Practical Guide to Splines,
++//    Springer, 2001,
++//    ISBN: 0387953663,
++//    LC: QA1.A647.v27.
++//
++//  Parameters:
++//
++//    Input, int ND, the size of the input table.
++//
++//    Input, double XD[ND], the abscissas for the divided
++//    difference table.
++//
++//    Input, double YD[ND], the divided difference table.
++//
++//    Output, int *NDP, the size of the output table, which is ND-1.
++//
++//    Input, double XDP[NP], the abscissas for the divided
++//    difference table for the derivative.
++//
++//    Output, double YDP[NDP], the divided difference
++//    table for the derivative.
++//
++{
++  int i;
++  double *xd_temp;
++  double *yd_temp;
++//
++//  Using a temporary copy of the difference table, shift the
++//  abscissas to zero.
++//
++  xd_temp = new double[nd];
++  yd_temp = new double[nd];
++
++  for ( i = 0; i < nd; i++ )
++  {
++    xd_temp[i] = xd[i];
++  }
++  for ( i = 0; i < nd; i++ )
++  {
++    yd_temp[i] = yd[i];
++  }
++
++  webbur::dif_shift_zero ( nd, xd_temp, yd_temp );
++//
++//  Construct the derivative.
++//
++  *ndp = nd - 1;
++
++  for ( i = 0; i < *ndp; i++ )
++  {
++    xdp[i] = 0.0;
++  }
++
++  for ( i = 0; i < *ndp; i++ )
++  {
++    ydp[i] = ( double ) ( i + 1 ) * yd_temp[i+1];
++  }
++
++  delete [] xd_temp;
++  delete [] yd_temp;
++
++  return;
++}
++//****************************************************************************80
++
++void dif_shift_x ( int nd, double xd[], double yd[], double xv )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    DIF_SHIFT_X replaces one abscissa of a divided difference table with a new one.
++//
++//  Discussion:
++//
++//    This routine shifts the representation of a divided difference polynomial by
++//    dropping the last X value in XD, and adding a new X value to the
++//    beginning of the Xd array, suitably modifying the coefficients stored
++//    in YD.
++//
++//    The representation of the polynomial is changed, but the polynomial itself
++//    should be identical.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 June 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Carl deBoor,
++//    A Practical Guide to Splines,
++//    Springer, 2001,
++//    ISBN: 0387953663,
++//    LC: QA1.A647.v27.
++//
++//  Parameters:
++//
++//    Input, int ND, the number of divided difference coefficients, and
++//    the number of entries in XD.
++//
++//    Input/output, double XD[ND], the X values used in the representation of
++//    the divided difference polynomial.  After a call to this routine, the
++//    last entry of XD has been dropped, the other
++//    entries have shifted up one index, and XV has been inserted at the
++//    beginning of the array.
++//
++//    Input/output, double YD[ND], the divided difference coefficients
++//    corresponding to the XD array.  On output, this array has been
++//    adjusted.
++//
++//    Input, double XV, a new X value which is to be used in the representation
++//    of the polynomial.  On output, XD[0] equals XV and the representation
++//    of the polynomial has been suitably changed.
++//    Note that XV does not have to be distinct from any of the original XD
++//    values.
++//
++{
++  int i;
++//
++//  Recompute the divided difference coefficients.
++//
++  for ( i = nd - 2; 0 <= i; i-- )
++  {
++    yd[i] = yd[i] + ( xv - xd[i] ) * yd[i+1];
++  }
++//
++//  Shift the X values up one position and insert XV.
++//
++  for ( i = nd - 1; 0 < i; i-- )
++  {
++    xd[i] = xd[i-1];
++  }
++
++  xd[0] = xv;
++
++  return;
++}
++//****************************************************************************80
++
++void dif_shift_zero ( int nd, double xd[], double yd[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    DIF_SHIFT_ZERO shifts a divided difference table so that all abscissas are zero.
++//
++//  Discussion:
++//
++//    When the abscissas are changed, the coefficients naturally
++//    must also be changed.
++//
++//    The resulting pair (XD, YD) still represents the
++//    same polynomial, but the entries in YD are now the
++//    standard polynomial coefficients.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 June 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Carl deBoor,
++//    A Practical Guide to Splines,
++//    Springer, 2001,
++//    ISBN: 0387953663,
++//    LC: QA1.A647.v27.
++//
++//  Parameters:
++//
++//    Input, int ND, the length of the XD and YD arrays.
++//
++//    Input/output, double XD[ND], the X values that correspond to the
++//    divided difference table.  On output, XD contains only zeroes.
++//
++//    Input/output, double YD[ND], the divided difference table
++//    for the polynomial.  On output, YD is also
++//    the coefficient array for the standard representation
++//    of the polynomial.
++//
++{
++  int i;
++  double xv;
++
++  xv = 0.0;
++
++  for ( i = 1; i <= nd; i++ )
++  {
++    webbur::dif_shift_x ( nd, xd, yd, xv );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void dif_to_r8poly ( int nd, double xd[], double yd[], double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    DIF_TO_R8POLY converts a divided difference table to a standard polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    21 February 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Carl deBoor,
++//    A Practical Guide to Splines,
++//    Springer, 2001,
++//    ISBN: 0387953663,
++//    LC: QA1.A647.v27.
++//
++//  Parameters:
++//
++//    Input, int ND, the number of coefficients, and abscissas.
++//
++//    Input, double XD[ND], the X values used in the divided difference
++//    representation of the polynomial.
++//
++//    Input, double YD[ND], the divided difference table.
++//
++//    Output, double C[ND], the standard form polyomial coefficients.
++//    C[0] is the constant term, and C[ND-1] is the coefficient
++//    of X^(ND-1).
++//
++{
++  int i;
++  int j;
++
++  for ( i = 0; i < nd; i++ )
++  {
++    c[i] = yd[i];
++  }
++//
++//  Recompute the divided difference coefficients.
++//
++  for ( j = 1; j <= nd - 1; j++ )
++  {
++    for ( i = 1; i <= nd - j; i++ )
++    {
++      c[nd-i-1] = c[nd-i-1] - xd[nd-i-j] * c[nd-i];
++    }
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void fejer2_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    FEJER2_COMPUTE computes a Fejer type 2 rule.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    The rule is defined on [-1,1].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int i;
++  int j;
++  double p;
++  double pi = 3.141592653589793;
++  double theta;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "FEJER2_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++  else if ( n == 1 )
++  {
++    x[0] = 0.0;
++    w[0] = 2.0;
++    return;
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] =  std::cos ( ( double ) ( n - i ) * pi
++                     / ( double ) ( n + 1 ) );
++  }
++  if ( ( n % 2 ) == 1 )
++  {
++    x[(n-1)/2] = 0.0;
++  }
++
++  if ( n == 2 )
++  {
++    w[0] = 1.0;
++    w[1] = 1.0;
++  }
++  else
++  {
++    for ( i = 0; i < n; i++ )
++    {
++      theta = ( double ) ( n - i ) * pi
++            / ( double ) ( n + 1 );
++
++      w[i] = 1.0;
++
++      for ( j = 1; j <= ( ( n - 1 ) / 2 ); j++ )
++      {
++        w[i] = w[i] - 2.0 *  std::cos ( 2.0 * ( double ) ( j ) * theta )
++          / ( double ) ( 4 * j * j - 1 );
++      }
++      p = 2.0 * ( double ) ( ( ( n + 1 ) / 2 ) ) - 1.0;
++      w[i] = w[i] -  std::cos ( ( p + 1.0 ) * theta ) / p;
++    }
++    for ( i = 0; i < n; i++ )
++    {
++      w[i] = 2.0 * w[i] / ( double ) ( n + 1 );
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void fejer2_compute_np ( int n, int np, double p[], double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    FEJER2_COMPUTE_NP computes a Fejer type 2 rule.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    The rule is defined on [-1,1].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::fejer2_compute ( n, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void fejer2_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    FEJER2_COMPUTE_POINTS computes Fejer type 2 quadrature points.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    The rule is defined on [-1,1].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int i;
++  double pi = 3.141592653589793;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "FEJER2_COMPUTE_POINTS - Fatal error!\n";
++    std::cerr << "  N < 1.\n";
++    std::exit ( 1 );
++  }
++  else if ( n == 1 )
++  {
++    x[0] = 0.0;
++  }
++  else
++  {
++    for ( i = 1; i <= n; i++ )
++    {
++      x[i-1] =  std::cos ( ( double ) ( n + 1 - i ) * pi
++                         / ( double ) ( n + 1 ) );
++    }
++    if ( ( n % 2 ) == 1 )
++    {
++      x[(n-1)/2] = 0.0;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void fejer2_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    FEJER2_COMPUTE_POINTS_NP computes Fejer type 2 quadrature points.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    The rule is defined on [-1,1].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::fejer2_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void fejer2_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    FEJER2_COMPUTE_WEIGHTS computes Fejer type 2 quadrature weights.
++//
++//  Discussion:
++//
++//    The user must preallocate space for the output array W.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//    Walter Gautschi,
++//    Numerical Quadrature in the Presence of a Singularity,
++//    SIAM Journal on Numerical Analysis,
++//    Volume 4, Number 3, 1967, pages 357-362.
++//
++//    Joerg Waldvogel,
++//    Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules,
++//    BIT Numerical Mathematics,
++//    Volume 43, Number 1, 2003, pages 1-18.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int i;
++  int j;
++  double p;
++  double pi = 3.141592653589793;
++  double theta;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "FEJER2_COMPUTE_WEIGHTS - Fatal error!\n";
++    std::cerr << "  N < 1.\n";
++    std::exit ( 1 );
++  }
++  else if ( n == 1 )
++  {
++    w[0] = 2.0;
++  }
++  else if ( n == 2 )
++  {
++    w[0] = 1.0;
++    w[1] = 1.0;
++  }
++  else
++  {
++    for ( i = 1; i <= n; i++ )
++    {
++      theta = ( double ) ( n + 1 - i ) * pi
++            / ( double ) ( n + 1 );
++
++      w[i-1] = 1.0;
++
++      for ( j = 1; j <= ( ( n - 1 ) / 2 ); j++ )
++      {
++        w[i-1] = w[i-1] - 2.0 *  std::cos ( 2.0 * ( double ) ( j ) * theta )
++          / ( double ) ( 4 * j * j - 1 );
++      }
++      p = 2.0 * ( double ) ( ( ( n + 1 ) / 2 ) ) - 1.0;
++      w[i-1] = w[i-1] -  std::cos ( ( p + 1.0 ) * theta ) / p;
++    }
++    for ( i = 0; i < n; i++ )
++    {
++      w[i] = 2.0 * w[i] / ( double ) ( n + 1 );
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void fejer2_compute_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    FEJER2_COMPUTE_WEIGHTS_NP computes Fejer type 2 quadrature weights.
++//
++//  Discussion:
++//
++//    The user must preallocate space for the output array W.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//    Walter Gautschi,
++//    Numerical Quadrature in the Presence of a Singularity,
++//    SIAM Journal on Numerical Analysis,
++//    Volume 4, Number 3, 1967, pages 357-362.
++//
++//    Joerg Waldvogel,
++//    Fast Construction of the Fejer and Clenshaw-Curtis Quadrature Rules,
++//    BIT Numerical Mathematics,
++//    Volume 43, Number 1, 2003, pages 1-18.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::fejer2_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void gegenbauer_compute ( int order, double alpha, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_COMPUTE computes a Gegenbauer quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) (1-X^2)^ALPHA * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//    Thanks to Janiki Raman for pointing out a problem in an earlier
++//    version of the code that occurred when ALPHA was -0.5.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double an;
++  double *c;
++  double cc;
++  double delta;
++  double dp2;
++  int i;
++  double p1;
++  double prod;
++  double r1;
++  double r2;
++  double r3;
++  double temp;
++  double x0;
++//
++//  Check ORDER.
++//
++  if ( order < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "GEGENBAUER_COMPUTE - Fatal error!\n";
++    std::cerr << "  1 <= ORDER is required.\n";
++    std::exit ( 1 );
++  }
++  c = new double[order];
++//
++//  Check ALPHA.
++//
++  if ( alpha <= -1.0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "GEGENBAUER_COMPUTE - Fatal error!\n";
++    std::cerr << "  -1.0 < ALPHA is required.\n";
++    std::exit ( 1 );
++  }
++//
++//  Set the recursion coefficients.
++//
++  c[0] = 0.0;
++  if ( 2 <= order )
++  {
++    c[1] = 1.0 / ( 2.0 * alpha + 3.0 );
++  }
++
++  for ( i = 3; i <= order; i++ )
++  {
++    c[i-1] = ( double ) ( i - 1 )
++          * ( alpha + alpha + ( double ) ( i - 1 ) ) /
++          ( ( alpha + alpha + ( double ) ( 2 * i - 1 ) )
++          * ( alpha + alpha + ( double ) ( 2 * i - 3 ) ) );
++  }
++
++  delta = webbur::r8_gamma ( alpha         + 1.0 )
++        * webbur::r8_gamma (         alpha + 1.0 )
++        / webbur::r8_gamma ( alpha + alpha + 2.0 );
++
++  prod = 1.0;
++  for ( i = 2; i <= order; i++ )
++  {
++    prod = prod * c[i-1];
++  }
++  cc = delta * std::pow ( 2.0, alpha + alpha + 1.0 ) * prod;
++
++  for ( i = 1; i <= order; i++ )
++  {
++    if ( i == 1 )
++    {
++      an = alpha / ( double ) ( order );
++
++      r1 = ( 1.0 + alpha )
++        * ( 2.78 / ( 4.0 + ( double ) ( order * order ) )
++        + 0.768 * an / ( double ) ( order ) );
++
++      r2 = 1.0 + 2.44 * an + 1.282 * an * an;
++
++      x0 = ( r2 - r1 ) / r2;
++    }
++    else if ( i == 2 )
++    {
++      r1 = ( 4.1 + alpha ) /
++        ( ( 1.0 + alpha ) * ( 1.0 + 0.156 * alpha ) );
++
++      r2 = 1.0 + 0.06 * ( ( double ) ( order ) - 8.0 ) *
++        ( 1.0 + 0.12 * alpha ) / ( double ) ( order );
++
++      r3 = 1.0 + 0.012 * alpha *
++        ( 1.0 + 0.25 * r8_abs ( alpha ) ) / ( double ) ( order );
++
++      x0 = x0 - r1 * r2 * r3 * ( 1.0 - x0 );
++    }
++    else if ( i == 3 )
++    {
++      r1 = ( 1.67 + 0.28 * alpha ) / ( 1.0 + 0.37 * alpha );
++
++      r2 = 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
++        / ( double ) ( order );
++
++      r3 = 1.0 + 8.0 * alpha /
++        ( ( 6.28 + alpha ) * ( double ) ( order * order ) );
++
++      x0 = x0 - r1 * r2 * r3 * ( x[0] - x0 );
++    }
++    else if ( i < order - 1 )
++    {
++      x0 = 3.0 * x[i-2] - 3.0 * x[i-3] + x[i-4];
++    }
++    else if ( i == order - 1 )
++    {
++      r1 = ( 1.0 + 0.235 * alpha ) / ( 0.766 + 0.119 * alpha );
++
++      r2 = 1.0 / ( 1.0 + 0.639
++        * ( ( double ) ( order ) - 4.0 )
++        / ( 1.0 + 0.71 * ( ( double ) ( order ) - 4.0 ) ) );
++
++      r3 = 1.0 / ( 1.0 + 20.0 * alpha / ( ( 7.5 + alpha ) *
++        ( double ) ( order * order ) ) );
++
++      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
++    }
++    else if ( i == order )
++    {
++      r1 = ( 1.0 + 0.37 * alpha ) / ( 1.67 + 0.28 * alpha );
++
++      r2 = 1.0 /
++        ( 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
++        / ( double ) ( order ) );
++
++      r3 = 1.0 / ( 1.0 + 8.0 * alpha /
++        ( ( 6.28 + alpha ) * ( double ) ( order * order ) ) );
++
++      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
++    }
++
++    webbur::gegenbauer_root ( &x0, order, alpha, &dp2, &p1, c );
++
++    x[i-1] = x0;
++    w[i-1] = cc / ( dp2 * p1 );
++  }
++//
++//  Reverse the order of the values.
++//
++  for ( i = 1; i <= order/2; i++ )
++  {
++    temp       = x[i-1];
++    x[i-1]     = x[order-i];
++    x[order-i] = temp;
++  }
++
++  for ( i = 1; i <=order/2; i++ )
++  {
++    temp       = w[i-1];
++    w[i-1]     = w[order-i];
++    w[order-i] = temp;
++  }
++
++  delete [] c;
++
++  return;
++}
++//****************************************************************************80
++
++void gegenbauer_compute_np ( int order, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_COMPUTE_NP computes a Gegenbauer quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) (1-X^2)^ALPHA * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//    Thanks to Janiki Raman for pointing out a problem in an earlier
++//    version of the code that occurred when ALPHA was -0.5.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], contains parameters.
++//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gegenbauer_compute ( order, alpha, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void gegenbauer_compute_points ( int order, double alpha, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_COMPUTE_POINTS computes Gegenbauer quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double *w;
++
++  w = new double[order];
++
++  webbur::gegenbauer_compute ( order, alpha, x, w );
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void gegenbauer_compute_points_np ( int order, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_COMPUTE_POINTS_NP computes Gegenbauer quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], contains parameters.
++//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gegenbauer_compute_points ( order, alpha, x );
++
++  return;
++}
++//****************************************************************************80
++
++void gegenbauer_compute_weights ( int order, double alpha, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_COMPUTE_WEIGHTS computes Gegenbauer quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double ALPHA, the exponent of (1-X^2).  -1.0 < ALPHA is required.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *x;
++
++  x = new double[order];
++
++  webbur::gegenbauer_compute ( order, alpha, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void gegenbauer_compute_weights_np ( int order, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_COMPUTE_WEIGHTS_NP computes Gegenbauer quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double P[1], contains parameters.
++//    P[0] = ALPHA = the exponent of (1-X^2).  -1.0 < ALPHA is required.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gegenbauer_compute_weights ( order, alpha, w );
++
++  return;
++}
++//****************************************************************************80
++
++double gegenbauer_integral ( int expon, double alpha )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_INTEGRAL integrates a monomial with Gegenbauer weight.
++//
++//  Discussion:
++//
++//    VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x^2)^ALPHA dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent.
++//
++//    Input, double ALPHA, the exponent of (1-X^2) in the weight factor.
++//
++//    Output, double GEGENBAUER_INTEGRAL, the value of the integral.
++//
++{
++  double arg1;
++  double arg2;
++  double arg3;
++  double arg4;
++  double c;
++  double value;
++  double value1;
++
++  if ( ( expon % 2 ) == 1 )
++  {
++    value = 0.0;
++    return value;
++  }
++
++  c = ( double ) ( expon );
++
++  arg1 = - alpha;
++  arg2 =   1.0 + c;
++  arg3 =   2.0 + alpha + c;
++  arg4 = - 1.0;
++
++  value1 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
++
++  value = webbur::r8_gamma ( 1.0 + c ) * 2.0
++    * webbur::r8_gamma ( 1.0 + alpha  ) * value1
++    / webbur::r8_gamma ( 2.0 + alpha  + c );
++
++  return value;
++}
++//****************************************************************************80
++
++void gegenbauer_recur ( double *p2, double *dp2, double *p1, double x,
++  int order, double alpha, double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_RECUR evaluates a Gegenbauer polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Output, double *P2, the value of J(ORDER)(X).
++//
++//    Output, double *DP2, the value of J'(ORDER)(X).
++//
++//    Output, double *P1, the value of J(ORDER-1)(X).
++//
++//    Input, double X, the point at which polynomials are evaluated.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Input, double ALPHA, the exponents of (1-X^2).
++//
++//    Input, double C[ORDER], the recursion coefficients.
++//
++{
++  double dp0;
++  double dp1;
++  int i;
++  double p0;
++
++  *p1 = 1.0;
++  dp1 = 0.0;
++
++  *p2 = x;
++  *dp2 = 1.0;
++
++  for ( i = 2; i <= order; i++ )
++  {
++    p0 = *p1;
++    dp0 = dp1;
++
++    *p1 = *p2;
++    dp1 = *dp2;
++
++    *p2 = x *  ( *p1 ) - c[i-1] * p0;
++    *dp2 = x * dp1 + ( *p1 ) - c[i-1] * dp0;
++  }
++  return;
++}
++//****************************************************************************80
++
++void gegenbauer_root ( double *x, int order, double alpha, double *dp2,
++  double *p1, double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEGENBAUER_ROOT improves an approximate root of a Gegenbauer polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input/output, double *X, the approximate root, which
++//    should be improved on output.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Input, double ALPHA, the exponents of (1-X^2).
++//
++//    Output, double *DP2, the value of J'(ORDER)(X).
++//
++//    Output, double *P1, the value of J(ORDER-1)(X).
++//
++//    Input, double C[ORDER], the recursion coefficients.
++//
++{
++  double d;
++  double eps;
++  double p2;
++  int step;
++  int step_max = 10;
++
++  eps = webbur::r8_epsilon ( );
++
++  for ( step = 1; step <= step_max; step++ )
++  {
++    webbur::gegenbauer_recur ( &p2, dp2, p1, *x, order, alpha, c );
++
++    d = p2 / ( *dp2 );
++    *x = *x - d;
++
++    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
++    {
++      return;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void gen_hermite_compute ( int n, double alpha, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_COMPUTE computes a generalized Gauss-Hermite quadrature rule.
++//
++//  Discussion:
++//
++//    The code uses an algorithm by Elhay and Kautsky.
++//
++//    The integral:
++//
++//      integral ( -oo < x < +oo ) |x|^alpha exp(-x^2) f(x) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    30 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Sylvan Elhay, Jaroslav Kautsky,
++//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
++//    Interpolatory Quadrature,
++//    ACM Transactions on Mathematical Software,
++//    Volume 13, Number 4, December 1987, pages 399-415.
++//
++//  Parameters:
++//
++//    Input, int N, the number of abscissas.
++//
++//    Input, double ALPHA, the parameter.
++//    -1.0 < ALPHA.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double *bj;
++  int i;
++  double i_r8;
++  double zemu;
++//
++//  Define the zero-th moment.
++//
++  zemu = webbur::r8_gamma ( ( alpha + 1.0 ) / 2.0 );
++//
++//  Define the Jacobi matrix.
++//
++  bj = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    i_r8 = ( double ) ( i + 1 );
++    if ( ( i % 2 ) == 0 )
++    {
++      bj[i] = ( i_r8 + alpha ) / 2.0;
++    }
++    else
++    {
++      bj[i] = i_r8 / 2.0;
++    }
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    bj[i] = std::sqrt ( bj[i] );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = 0.0;
++  }
++
++  w[0] = std::sqrt ( zemu );
++  for ( i = 1; i < n; i++ )
++  {
++    w[i] = 0.0;
++  }
++//
++//  Diagonalize the Jacobi matrix.
++//
++  webbur::imtqlx ( n, x, bj, w );
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = w[i] * w[i];
++  }
++
++  delete [] bj;
++
++  return;
++}
++//****************************************************************************80
++
++void gen_hermite_compute_np ( int order, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_COMPUTE_NP computes a Generalized Hermite quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -oo < x < +oo ) |x|^ALPHA exp(-x^2) f(x) dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], contains parameters.
++//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gen_hermite_compute ( order, alpha, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void gen_hermite_compute_points ( int order, double alpha, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_COMPUTE_POINTS computes Generalized Hermite quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//    -1.0 < ALPHA.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double *w;
++
++  w = new double[order];
++
++  webbur::gen_hermite_compute ( order, alpha, x, w );
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void gen_hermite_compute_points_np ( int order, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_COMPUTE_POINTS_NP: Generalized Hermite quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], contains parameters.
++//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gen_hermite_compute_points ( order, alpha, x );
++
++  return;
++}
++//****************************************************************************80
++
++void gen_hermite_compute_weights ( int order, double alpha, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_COMPUTE_WEIGHTS computes Generalized Hermite quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//    -1.0 < ALPHA.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *x;
++
++  x = new double[order];
++
++  webbur::gen_hermite_compute ( order, alpha, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void gen_hermite_compute_weights_np ( int order, int np, double p[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_COMPUTE_WEIGHTS_NP: Generalized Hermite quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], contains parameters.
++//    P[0] = ALPHA, the exponent of the X factor. -1.0 < ALPHA.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gen_hermite_compute_weights ( order, alpha, w );
++
++  return;
++}
++//****************************************************************************80
++
++void gen_hermite_dr_compute ( int order, double alpha, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_DR_COMPUTE computes a Generalized Hermite quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -oo < x < +oo ) |x|^ALPHA exp(-x^2) f(x) dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//    -1.0 < ALPHA.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha_laguerre;
++  double arg;
++  int i;
++  int order_laguerre;
++  double *w_laguerre;
++  double *x_laguerre;
++
++  if ( order < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "GEN_HERMITE_DR_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of ORDER = " << order << "\n";
++    std::exit ( 1 );
++  }
++
++  if ( order == 1 )
++  {
++    arg = ( alpha + 1.0 ) / 2.0;
++    x[0] = 0.0;
++    w[0] = webbur::r8_gamma ( arg );
++    return;
++  }
++
++  if ( ( order % 2 ) == 0 )
++  {
++    order_laguerre = order / 2;
++    alpha_laguerre = ( alpha - 1.0 ) / 2.0;
++  }
++  else
++  {
++    order_laguerre = ( order - 1 ) / 2;
++    alpha_laguerre = ( alpha + 1.0 ) / 2.0;
++  }
++
++  w_laguerre = new double[order_laguerre];
++  x_laguerre = new double[order_laguerre];
++
++  webbur::gen_laguerre_ss_compute ( order_laguerre, alpha_laguerre, x_laguerre,
++    w_laguerre );
++
++  if ( ( order % 2 ) == 0 )
++  {
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      x[i] = - std::sqrt ( x_laguerre[order_laguerre-1-i] );
++    }
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      x[order_laguerre+i] = std::sqrt ( x_laguerre[i] );
++	}
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      w[i] = 0.5 * w_laguerre[order_laguerre-1-i];
++    }
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      w[order_laguerre+i] = 0.5 * w_laguerre[i];
++    }
++  }
++  else if ( ( order % 2 ) == 1 )
++  {
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      x[i] = - std::sqrt ( x_laguerre[order_laguerre-1-i] );
++    }
++    x[order_laguerre] = 0.0;
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      x[order_laguerre+1+i] = std::sqrt ( x_laguerre[i] );
++	}
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      w[i] = 0.5 * w_laguerre[order_laguerre-1-i] / x_laguerre[order_laguerre-1-i];
++    }
++
++    arg = ( alpha + 1.0 ) / 2.0;
++    w[order_laguerre] = webbur::r8_gamma ( arg );
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      w[order_laguerre] = w[order_laguerre] - w_laguerre[i] / x_laguerre[i];
++    }
++
++    for ( i = 0; i < order_laguerre; i++ )
++    {
++      w[order_laguerre+1+i] = 0.5 * w_laguerre[i] / x_laguerre[i];
++    }
++  }
++  delete [] w_laguerre;
++  delete [] x_laguerre;
++
++  return;
++}
++//****************************************************************************80
++
++double gen_hermite_integral ( int expon, double alpha )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_HERMITE_INTEGRAL evaluates a monomial Generalized Hermite integral.
++//
++//  Discussion:
++//
++//    H(n,alpha) = Integral ( -oo < x < +oo ) x^n |x|^alpha exp(-x^2) dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent of the monomial.
++//    0 <= EXPON.
++//
++//    Input, double ALPHA, the exponent of |X| in the weight function.
++//    -1.0 < ALPHA.
++//
++//    Output, double GEN_HERMITE_INTEGRAL, the value of the integral.
++//
++{
++  double a;
++  double arg;
++  double value;
++
++  if ( ( expon % 2 ) == 1 )
++  {
++    value = 0.0;
++  }
++  else
++  {
++    a = alpha + ( double ) ( expon );
++    if ( a <= - 1.0 )
++    {
++      value = - webbur::r8_huge ( );
++    }
++    else
++    {
++      arg = ( a + 1.0 ) / 2.0;
++      value = webbur::r8_gamma ( arg );
++    }
++  }
++  return value;
++}
++//****************************************************************************80
++
++void gen_laguerre_compute ( int n, double alpha, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_COMPUTE: generalized Gauss-Laguerre quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( 0 <= x < +oo ) exp ( - x ) * x^alpha * f(x) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    The integral:
++//
++//      integral ( 0 <= x < +oo ) x^alpha * f(x) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * exp ( x(i) ) * f ( x(i) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Sylvan Elhay, Jaroslav Kautsky,
++//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
++//    Interpolatory Quadrature,
++//    ACM Transactions on Mathematical Software,
++//    Volume 13, Number 4, December 1987, pages 399-415.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//    ALPHA must be nonnegative.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double *bj;
++  int i;
++  double i_r8;
++  double zemu;
++//
++//  Define the zero-th moment.
++//
++  zemu = webbur::r8_gamma ( alpha + 1.0 );
++//
++//  Define the Jacobi matrix.
++//
++  bj = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    i_r8 = ( double ) ( i + 1 );
++    bj[i] = std::sqrt ( i_r8 * ( i_r8 + alpha ) );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    i_r8 = ( double ) ( i + 1 );
++    x[i] = 2.0 * i_r8 - 1.0 + alpha;
++  }
++
++  w[0] = std::sqrt ( zemu );
++
++  for ( i = 1; i < n; i++ )
++  {
++    w[i] = 0.0;
++  }
++//
++//  Diagonalize the Jacobi matrix.
++//
++  imtqlx ( n, x, bj, w );
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = w[i] * w[i];
++  }
++
++  delete [] bj;
++
++  return;
++}
++//****************************************************************************80
++
++void gen_laguerre_compute_np ( int order, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_COMPUTE_NP computes a Generalized Laguerre quadrature rule.
++//
++//  Discussion:
++//
++//    In the simplest case, ALPHA is 0, and we are approximating the
++//    integral from 0 to +oo of exp(-X) * F(X).  When this is so,
++//    it is easy to modify the rule to approximate the integral from
++//    A to +oo as well.
++//
++//    If ALPHA is nonzero, then there is no simple way to extend the
++//    rule to approximate the integral from A to +oo.  The simplest
++//    procedures would be to approximate the integral from 0 to A.
++//
++//    If the integral to approximate is:
++//
++//        Integral ( A <= X < +oo ) exp ( - X ) * F(X) dX
++//      or
++//        Integral ( 0 <= X < +oo ) exp ( - X ) * X^ALPHA * F(X) dX
++//
++//    then the quadrature rule is:
++//
++//      exp ( - A ) * Sum ( 1 <= I <= ORDER ) W(I) * F ( A+X(I) )
++//    or
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//
++//    If the integral to approximate is:
++//
++//        Integral ( A <= X < +oo ) F(X) dX
++//      or
++//        Integral ( 0 <= X < +oo ) X^ALPHA * F(X) dX
++//
++//    then the quadrature rule is:
++//
++//      exp ( - A ) * Sum ( 1 <= I <= ORDER )
++//        W(I) * exp(A+X(I)) * F ( A+X(I) )
++//    or
++//      Sum ( 1 <= I <= ORDER ) W(I) * exp(X(I)) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double P[1], contains parameters.
++//    P[0] = ALPHA, the exponent of the X factor.
++//    Set ALPHA = 0.0 for the simplest rule.
++//    ALPHA must be nonnegative.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gen_laguerre_compute ( order, alpha, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void gen_laguerre_compute_points ( int order, double alpha, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_COMPUTE_POINTS: Generalized Laguerre quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 March 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//    Set ALPHA = 0.0 for the simplest rule.
++//    ALPHA must be nonnegative.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double *w;
++
++  w = new double[order];
++
++  webbur::gen_laguerre_compute ( order, alpha, x, w );
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void gen_laguerre_compute_points_np ( int order, int np, double p[],
++  double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_COMPUTE_POINTS_NP: Generalized Laguerre quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], contains parameters.
++//    P[0] = ALPHA, the exponent of the X factor.
++//    Set ALPHA = 0.0 for the simplest rule.
++//    ALPHA must be nonnegative.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gen_laguerre_compute_points ( order, alpha, x );
++
++  return;
++}
++//****************************************************************************80
++
++void gen_laguerre_compute_weights ( int order, double alpha, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_COMPUTE_WEIGHTS: Generalized Laguerre quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//    Set ALPHA = 0.0 for the simplest rule.
++//    ALPHA must be nonnegative.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *x;
++
++  x = new double[order];
++
++  webbur::gen_laguerre_compute ( order, alpha, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void gen_laguerre_compute_weights_np ( int order, int np, double p[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_COMPUTE_WEIGHTS_NP: Generalized Laguerre quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], contains parameters.
++//    P[0] = ALPHA, the exponent of the X factor.
++//    Set ALPHA = 0.0 for the simplest rule.
++//    ALPHA must be nonnegative.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++
++  alpha = p[0];
++
++  webbur::gen_laguerre_compute_weights ( order, alpha, w );
++
++  return;
++}
++//****************************************************************************80
++
++double gen_laguerre_integral ( int expon, double alpha )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_INTEGRAL evaluates a monomial Generalized Laguerre integral.
++//
++//  Discussion:
++//
++//    L(n,alpha) = Integral ( 0 <= x < +oo ) x^n * x^alpha exp(-x) dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    20 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent of the monomial.
++//    0 <= EXPON.
++//
++//    Input, double ALPHA, the exponent of X in the weight function.
++//    -1.0 < ALPHA.
++//
++//    Output, double GEN_LAGUERRE_INTEGRAL, the value of the integral.
++//
++{
++  double arg;
++  double value;
++
++  arg = alpha + ( double ) ( expon + 1.0 );
++  value = webbur::r8_gamma ( arg );
++
++  return value;
++}
++//****************************************************************************80
++
++void gen_laguerre_ss_compute ( int order, double alpha, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_SS_COMPUTE computes a Generalized Laguerre quadrature rule.
++//
++//  Discussion:
++//
++//    In the simplest case, ALPHA is 0, and we are approximating the
++//    integral from 0 to +oo of exp(-X) * F(X).  When this is so,
++//    it is easy to modify the rule to approximate the integral from
++//    A to +oo as well.
++//
++//    If ALPHA is nonzero, then there is no simple way to extend the
++//    rule to approximate the integral from A to +oo.  The simplest
++//    procedures would be to approximate the integral from 0 to A.
++//
++//    If the integral to approximate is:
++//
++//        Integral ( A <= X < +oo ) exp ( - X ) * F(X) dX
++//      or
++//        Integral ( 0 <= X < +oo ) exp ( - X ) * X^ALPHA * F(X) dX
++//
++//    then the quadrature rule is:
++//
++//      exp ( - A ) * Sum ( 1 <= I <= ORDER ) W(I) * F ( A+X(I) )
++//    or
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//
++//    If the integral to approximate is:
++//
++//        Integral ( A <= X < +oo ) F(X) dX
++//      or
++//        Integral ( 0 <= X < +oo ) X^ALPHA * F(X) dX
++//
++//    then the quadrature rule is:
++//
++//      exp ( - A ) * Sum ( 1 <= I <= ORDER )
++//        W(I) * exp(A+X(I)) * F ( A+X(I) )
++//    or
++//      Sum ( 1 <= I <= ORDER ) W(I) * exp(X(I)) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//    Set ALPHA = 0.0 for the simplest rule.
++//    ALPHA must be nonnegative.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *b;
++  double *c;
++  double cc;
++  double dp2;
++  int i;
++  double p1;
++  double prod;
++  double r1;
++  double r2;
++  double ratio;
++  double x0;
++
++  if ( order < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "GEN_LAGUERRE_SS_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of ORDER = " << order << "\n";
++    std::exit ( 1 );
++  }
++
++  b = new double[order];
++  c = new double[order];
++//
++//  Set the recursion coefficients.
++//
++  for ( i = 0; i < order; i++ )
++  {
++    b[i] = ( alpha + ( double ) ( 2 * i + 1 ) );
++  }
++
++  for ( i = 0; i < order; i++ )
++  {
++    c[i] = ( double ) ( i ) * ( alpha + ( double ) ( i ) );
++  }
++  prod = 1.0;
++  for ( i = 1; i < order; i++ )
++  {
++    prod = prod * c[i];
++  }
++  cc = webbur::r8_gamma ( alpha + 1.0 ) * prod;
++
++  for ( i = 0; i < order; i++ )
++  {
++//
++//  Compute an estimate for the root.
++//
++    if ( i == 0 )
++    {
++      x0 = ( 1.0 + alpha ) * ( 3.0+ 0.92 * alpha ) /
++        ( 1.0 + 2.4 * ( double ) ( order ) + 1.8 * alpha );
++    }
++    else if ( i == 1 )
++    {
++      x0 = x0 + ( 15.0 + 6.25 * alpha ) /
++        ( 1.0 + 0.9 * alpha + 2.5 * ( double ) ( order ) );
++    }
++    else
++    {
++      r1 = ( 1.0 + 2.55 * ( double ) ( i - 1 ) )
++        / ( 1.9 * ( double ) ( i - 1 ) );
++
++      r2 = 1.26 * ( double ) ( i - 1 ) * alpha /
++        ( 1.0 + 3.5 * ( double ) ( i - 1 ) );
++
++      ratio = ( r1 + r2 ) / ( 1.0 + 0.3 * alpha );
++
++      x0 = x0 + ratio * ( x0 - x[i-2] );
++    }
++//
++//  Use iteration to find the root.
++//
++    webbur::gen_laguerre_ss_root ( &x0, order, alpha, &dp2, &p1, b, c );
++//
++//  Set the abscissa and weight.
++//
++    x[i] = x0;
++    w[i] = ( cc / dp2 ) / p1;
++  }
++
++  delete [] b;
++  delete [] c;
++
++  return;
++}
++//****************************************************************************80
++
++void gen_laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x,
++  int order, double alpha, double b[], double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_SS_RECUR evaluates a Generalized Laguerre polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 February 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Output, double *P2, the value of L(ORDER)(X).
++//
++//    Output, double *DP2, the value of L'(ORDER)(X).
++//
++//    Output, double *P1, the value of L(ORDER-1)(X).
++//
++//    Input, double X, the point at which polynomials are evaluated.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Input, double ALPHA, the exponent of the X factor in the
++//    integrand.
++//
++//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
++//
++{
++  double dp0;
++  double dp1;
++  int i;
++  double p0;
++
++  *p1 = 1.0;
++  dp1 = 0.0;
++
++  *p2 = x - alpha - 1.0;
++  *dp2 = 1.0;
++
++  for ( i = 1; i < order; i++ )
++  {
++    p0 = *p1;
++    dp0 = dp1;
++
++    *p1 = *p2;
++    dp1 = *dp2;
++
++    *p2  = ( x - b[i] ) * ( *p1 ) - c[i] * p0;
++    *dp2 = ( x - b[i] ) * dp1 + ( *p1 ) - c[i] * dp0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void gen_laguerre_ss_root ( double *x, int order, double alpha, double *dp2,
++  double *p1, double b[], double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    GEN_LAGUERRE_SS_ROOT improves a root of a Generalized Laguerre polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 February 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input/output, double *X, the approximate root, which
++//    should be improved on output.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Input, double ALPHA, the exponent of the X factor.
++//
++//    Output, double *DP2, the value of L'(ORDER)(X).
++//
++//    Output, double *P1, the value of L(ORDER-1)(X).
++//
++//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
++//
++{
++  double d;
++  double eps;
++  double p2;
++  int step;
++  int step_max = 10;
++
++  eps = webbur::r8_epsilon ( );
++
++  for ( step = 1; step <= step_max; step++ )
++  {
++    webbur::gen_laguerre_ss_recur ( &p2, dp2, p1, *x, order, alpha, b, c );
++
++    d = p2 / ( *dp2 );
++    *x = *x - d;
++
++    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
++    {
++      break;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void hc_compute_weights_from_points ( int nhalf, double xhalf[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HC_COMPUTE_WEIGHTS_FROM_POINTS: Hermite-Cubic weights, user-supplied points.
++//
++//  Discussion:
++//
++//    An interval [A,B] has been divided by NHALF points X; at each
++//    point both function and derivative information is available.
++//
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//
++//    A quadrature rule is determined for the interpolant.
++//
++//    There will be N=2*NHALF weights.  If the quadrature rule is to be written
++//    out, one would normally list each point twice, so that the number of points
++//    and weights are equal.  The listing of the same point value twice is an
++//    implicit indication that both function and derivative values should be
++//    used.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    28 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int NHALF, the number of points, not counting repetitions.
++//
++//    Input, double XHALF[NHALF], the points, without repetition.
++//
++//    Output, double W[2*NHALF], the weights.  The first two weights are
++//    associated with the first point, and so on.
++//
++{
++  int j;
++
++  w[0+0*2] =    0.5 * ( xhalf[1] - xhalf[0] );
++  w[1+0*2] = std::pow ( xhalf[1] - xhalf[0], 2 ) / 12.0;
++
++  for ( j = 1; j < nhalf - 1; j++ )
++  {
++    w[0+j*2] = 0.5 * ( xhalf[j+1] - xhalf[j-1] );
++    w[1+j*2] =       ( xhalf[j+1] - xhalf[j-1] )
++                   * ( xhalf[j+1] - 2.0 * xhalf[j] + xhalf[j-1] ) / 12.0;
++  }
++
++  w[0+(nhalf-1)*2] =      0.5 * ( xhalf[nhalf-1] - xhalf[nhalf-2]   );
++  w[1+(nhalf-1)*2] = - std::pow ( xhalf[nhalf-2] - xhalf[nhalf-1], 2 ) / 12.0;
++
++  return;
++}
++//****************************************************************************80
++
++void hcc_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCC_COMPUTE computes a Hermite-Cubic-Chebyshev-Spacing quadrature rule.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into Chebyshev-spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    24 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int nhalf;
++  double *xhalf;
++
++  nhalf = n / 2;
++  xhalf = new double[nhalf];
++
++  webbur::clenshaw_curtis_compute_points ( nhalf, xhalf );
++  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
++  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
++
++  delete [] xhalf;
++
++  return;
++}
++//****************************************************************************80
++
++void hcc_compute_np ( int n, int np, double p[], double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCC_COMPUTE_NP computes a Hermite-Cubic-Chebyshev-Spacing quadrature rule.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into Chebyshev-spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::hcc_compute ( n, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hcc_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCC_COMPUTE_POINTS computes Hermite-Cubic-Chebyshev-Spacing quadrature points.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into Chebyshev-spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    24 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int nhalf;
++  double *xhalf;
++
++  if ( ( n % 2 ) != 0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "HCC_COMPUTE_POINTS - Fatal error!\n";
++    std::cerr << "  Order of rule N is not even.\n";
++    std::exit ( 1 );
++  }
++
++  nhalf = n / 2;
++  xhalf = new double[nhalf];
++
++  webbur::clenshaw_curtis_compute_points ( nhalf, xhalf );
++  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
++
++  delete [] xhalf;
++
++  return;
++}
++//****************************************************************************80
++
++void hcc_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCC_COMPUTE_POINTS_NP: Hermite-Cubic-Chebyshev-Spacing quadrature points.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into Chebyshev-spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::hcc_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void hcc_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCC_COMPUTE_WEIGHTS: Hermite-Cubic-Chebyshev-Spacing quadrature weights.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into Chebyshev-spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    24 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int nhalf;
++  double *xhalf;
++
++  if ( ( n % 2 ) != 0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "HCC_COMPUTE_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Order of rule N is not even.\n";
++    std::exit ( 1 );
++  }
++
++  nhalf = n / 2;
++  xhalf = new double[nhalf];
++
++  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
++
++  delete [] xhalf;
++
++  return;
++}
++//****************************************************************************80
++
++void hcc_compute_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCC_COMPUTE_WEIGHTS_NP: Hermite-Cubic-Chebyshev-Spacing quadrature weights.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into Chebyshev-spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::hcc_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hce_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCE_COMPUTE computes a Hermite-Cubic-Equal-Spacing quadrature rule.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into equally spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    28 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double a_high = 1.0;
++  double a_low = 0.0;
++  int nhalf;
++  double *xhalf;
++
++  a_low = 0.0;
++  a_high = 1.0;
++
++  nhalf = n / 2;
++
++  xhalf = webbur::r8vec_linspace_new ( nhalf, a_low, a_high );
++  webbur::r8vec_stutter ( nhalf, xhalf, 2, x );
++  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
++
++  delete [] xhalf;
++
++  return;
++}
++//****************************************************************************80
++
++void hce_compute_np ( int n, int np, double p[], double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCE_COMPUTE_NP computes a Hermite-Cubic-Equal-Spacing quadrature rule.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into equally spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::hce_compute ( n, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hce_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCE_COMPUTE_POINTS computes Hermite-Cubic-Equal-Spacing quadrature points.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into equally spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int i;
++  int j;
++  int m;
++  double x_value;
++
++  if ( ( n % 2 ) != 0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "HCE_COMPUTE_POINTS - Fatal error!\n";
++    std::cerr << "  Order of rule N is not even.\n";
++    std::exit ( 1 );
++  }
++  m = n / 2;
++
++  for ( j = 0; j < m; j++ )
++  {
++    x_value = ( double ) ( 2 * j + 1 - m ) / ( double ) ( m - 1 );
++    for ( i = 0; i < 2; i++ )
++    {
++      x[i+j*2] = x_value;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void hce_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCE_COMPUTE_POINTS_NP: Hermite-Cubic-Equal-Spacing quadrature points.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into equally spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::hce_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void hce_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCE_COMPUTE_WEIGHTS: Hermite-Cubic-Equal-Spacing quadrature weights.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into equally spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    24 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int nhalf;
++  double *xhalf;
++
++  if ( ( n % 2 ) != 0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "HCE_COMPUTE_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Order of rule N is not even.\n";
++    std::exit ( 1 );
++  }
++
++  nhalf = n / 2;
++  xhalf = new double[nhalf];
++
++  webbur::hc_compute_weights_from_points ( nhalf, xhalf, w );
++
++  delete [] xhalf;
++
++  return;
++}
++//****************************************************************************80
++
++void hce_compute_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HCE_COMPUTE_WEIGHTS_NP: Hermite-Cubic-Equal-Spacing quadrature weights.
++//
++//  Discussion:
++//
++//    For the HCE rule, we assume that an interval has been divided by
++//    M nodes X into equally spaced subintervals, and that at each
++//    abscissa both function and derivative information is available.
++//    The piecewise cubic Hermite interpolant is constructed for this data.
++//    The quadrature rule uses N = 2 * M abscissas, where each node is
++//    listed twice, and the weights occur in pairs, with the first multiplying
++//    the function value and the second the derivative.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::hce_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_COMPUTE computes a Gauss-Hermite quadrature rule.
++//
++//  Discussion:
++//
++//    The code uses an algorithm by Elhay and Kautsky.
++//
++//    The abscissas are the zeros of the N-th order Hermite polynomial.
++//
++//    The integral:
++//
++//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Sylvan Elhay, Jaroslav Kautsky,
++//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
++//    Interpolatory Quadrature,
++//    ACM Transactions on Mathematical Software,
++//    Volume 13, Number 4, December 1987, pages 399-415.
++//
++//  Parameters:
++//
++//    Input, int N, the number of abscissas.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double arg;
++  double *bj;
++  int i;
++  double zemu;
++//
++//  Define the zero-th moment.
++//
++  arg = 0.5;
++  zemu = webbur::r8_gamma ( arg );
++//
++//  Define the Jacobi matrix.
++//
++  bj = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    bj[i] = std::sqrt ( ( double ) ( i + 1 ) / 2.0 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = 0.0;
++  }
++
++  w[0] = std::sqrt ( zemu );
++  for ( i = 1; i < n; i++ )
++  {
++    w[i] = 0.0;
++  }
++//
++//  Diagonalize the Jacobi matrix.
++//
++  webbur::imtqlx ( n, x, bj, w );
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = w[i] * w[i];
++  }
++
++  delete [] bj;
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_compute_np ( int order, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_COMPUTE_NP computes a Hermite quadrature rule.
++//
++//  Discussion:
++//
++//    The abscissas are the zeros of the N-th order Hermite polynomial.
++//
++//    The integral:
++//
++//      Integral ( -oo < X < +oo ) exp ( - X * X ) * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  webbur::hermite_compute ( order, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_compute_points ( int order, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_COMPUTE_POINTS computes Hermite quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double *w;
++
++  w = new double[order];
++
++  webbur::hermite_compute ( order, x, w );
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_compute_points_np ( int order, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_COMPUTE_POINTS_NP computes Hermite quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  webbur::hermite_compute_points ( order, x );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_compute_weights ( int order, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_COMPUTE_WEIGHTS computes Hermite quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *x;
++
++  x = new double[order];
++
++  webbur::hermite_compute ( order, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_compute_weights_np ( int order, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_COMPUTE_WEIGHTS_NP computes Hermite quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  webbur::hermite_compute_weights ( order, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_genz_keister_lookup ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GENZ_KEISTER_LOOKUP looks up a Genz-Keister Hermite rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+16, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and 35.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29, and 51.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 June 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Florian Heiss, Viktor Winschel,
++//    Likelihood approximation by numerical integration on sparse grids,
++//    Journal of Econometrics,
++//    Volume 144, 2008, pages 62-80.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::hermite_genz_keister_lookup_points ( n, x );
++  webbur::hermite_genz_keister_lookup_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_genz_keister_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GENZ_KEISTER_LOOKUP_POINTS looks up Genz-Keister Hermite abscissas.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+?, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and a final rule of order
++//    35, 37, 41 or 43.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29,
++//    with the final rule of precision 51, 55, 63 or 67.
++//
++//    Three related families begin the same way, but end with a different final
++//    rule.  As a convenience, this function includes these final rules as well:
++//
++//    Designation  Orders       Precisions
++//
++//    1+2+6+10+16, 1,3,9,19,35  1,5,15,29,51
++//    1+2+6+10+18  1,3,9,19,37  1,5,15,29,55
++//    1+2+6+10+22  1,3,9,19,41  1,5,15,29,63
++//    1+2+6+10+24  1,3,9,19,43  1,5,15,29,67
++//
++//    Some of the data in this function was kindly supplied directly by
++//    Alan Genz on 24 April 2011.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Florian Heiss, Viktor Winschel,
++//    Likelihood approximation by numerical integration on sparse grids,
++//    Journal of Econometrics,
++//    Volume 144, 2008, pages 62-80.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9, 19, 35, 37, 41, or 43.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  if ( n == 1 )
++  {
++    x[ 0] =   0.0000000000000000E+00;
++  }
++  else if ( n == 3 )
++  {
++    x[ 0] =  -1.2247448713915889E+00;
++    x[ 1] =   0.0000000000000000E+00;
++    x[ 2] =   1.2247448713915889E+00;
++  }
++  else if ( n == 9 )
++  {
++    x[ 0] =  -2.9592107790638380E+00;
++    x[ 1] =  -2.0232301911005157E+00;
++    x[ 2] =  -1.2247448713915889E+00;
++    x[ 3] =  -5.2403354748695763E-01;
++    x[ 4] =   0.0000000000000000E+00;
++    x[ 5] =   5.2403354748695763E-01;
++    x[ 6] =   1.2247448713915889E+00;
++    x[ 7] =   2.0232301911005157E+00;
++    x[ 8] =   2.9592107790638380E+00;
++  }
++  else if ( n == 19 )
++  {
++    x[ 0] =  -4.4995993983103881E+00;
++    x[ 1] =  -3.6677742159463378E+00;
++    x[ 2] =  -2.9592107790638380E+00;
++    x[ 3] =  -2.2665132620567876E+00;
++    x[ 4] =  -2.0232301911005157E+00;
++    x[ 5] =  -1.8357079751751868E+00;
++    x[ 6] =  -1.2247448713915889E+00;
++    x[ 7] =  -8.7004089535290285E-01;
++    x[ 8] =  -5.2403354748695763E-01;
++    x[ 9] =   0.0000000000000000E+00;
++    x[10] =   5.2403354748695763E-01;
++    x[11] =   8.7004089535290285E-01;
++    x[12] =   1.2247448713915889E+00;
++    x[13] =   1.8357079751751868E+00;
++    x[14] =   2.0232301911005157E+00;
++    x[15] =   2.2665132620567876E+00;
++    x[16] =   2.9592107790638380E+00;
++    x[17] =   3.6677742159463378E+00;
++    x[18] =   4.4995993983103881E+00;
++  }
++  else if ( n == 35 )
++  {
++    x[ 0] =  -6.3759392709822356E+00;
++    x[ 1] =  -5.6432578578857449E+00;
++    x[ 2] =  -5.0360899444730940E+00;
++    x[ 3] =  -4.4995993983103881E+00;
++    x[ 4] =  -4.0292201405043713E+00;
++    x[ 5] =  -3.6677742159463378E+00;
++    x[ 6] =  -3.3491639537131945E+00;
++    x[ 7] =  -2.9592107790638380E+00;
++    x[ 8] =  -2.5705583765842968E+00;
++    x[ 9] =  -2.2665132620567876E+00;
++    x[10] =  -2.0232301911005157E+00;
++    x[11] =  -1.8357079751751868E+00;
++    x[12] =  -1.5794121348467671E+00;
++    x[13] =  -1.2247448713915889E+00;
++    x[14] =  -8.7004089535290285E-01;
++    x[15] =  -5.2403354748695763E-01;
++    x[16] =  -1.7606414208200893E-01;
++    x[17] =   0.0000000000000000E+00;
++    x[18] =   1.7606414208200893E-01;
++    x[19] =   5.2403354748695763E-01;
++    x[20] =   8.7004089535290285E-01;
++    x[21] =   1.2247448713915889E+00;
++    x[22] =   1.5794121348467671E+00;
++    x[23] =   1.8357079751751868E+00;
++    x[24] =   2.0232301911005157E+00;
++    x[25] =   2.2665132620567876E+00;
++    x[26] =   2.5705583765842968E+00;
++    x[27] =   2.9592107790638380E+00;
++    x[28] =   3.3491639537131945E+00;
++    x[29] =   3.6677742159463378E+00;
++    x[30] =   4.0292201405043713E+00;
++    x[31] =   4.4995993983103881E+00;
++    x[32] =   5.0360899444730940E+00;
++    x[33] =   5.6432578578857449E+00;
++    x[34] =   6.3759392709822356E+00;
++  }
++  else if ( n == 37 )
++  {
++    x[ 0] =  -6.853200069757519;
++    x[ 1] =  -6.124527854622158;
++    x[ 2] =  -5.521865209868350;
++    x[ 3] =  -4.986551454150765;
++    x[ 4] =  -4.499599398310388;
++    x[ 5] =  -4.057956316089741;
++    x[ 6] =  -3.667774215946338;
++    x[ 7] =  -3.315584617593290;
++    x[ 8] =  -2.959210779063838;
++    x[ 9] =  -2.597288631188366;
++    x[10] =  -2.266513262056788;
++    x[11] =  -2.023230191100516;
++    x[12] =  -1.835707975175187;
++    x[13] =  -1.561553427651873;
++    x[14] =  -1.224744871391589;
++    x[15] =  -0.870040895352903;
++    x[16] =  -0.524033547486958;
++    x[17] =  -0.214618180588171;
++    x[18] =   0.000000000000000;
++    x[19] =   0.214618180588171;
++    x[20] =   0.524033547486958;
++    x[21] =   0.870040895352903;
++    x[22] =   1.224744871391589;
++    x[23] =   1.561553427651873;
++    x[24] =   1.835707975175187;
++    x[25] =   2.023230191100516;
++    x[26] =   2.266513262056788;
++    x[27] =   2.597288631188366;
++    x[28] =   2.959210779063838;
++    x[29] =   3.315584617593290;
++    x[30] =   3.667774215946338;
++    x[31] =   4.057956316089741;
++    x[32] =   4.499599398310388;
++    x[33] =   4.986551454150765;
++    x[34] =   5.521865209868350;
++    x[35] =   6.124527854622158;
++    x[36] =   6.853200069757519;
++  }
++  else if ( n == 41 )
++  {
++    x[ 0] =  -7.251792998192644;
++    x[ 1] =  -6.547083258397540;
++    x[ 2] =  -5.961461043404500;
++    x[ 3] =  -5.437443360177798;
++    x[ 4] =  -4.953574342912980;
++    x[ 5] =  -4.4995993983103881;
++    x[ 6] =  -4.070919267883068;
++    x[ 7] =  -3.6677742159463378;
++    x[ 8] =  -3.296114596212218;
++    x[ 9] =  -2.9592107790638380;
++    x[10] =  -2.630415236459871;
++    x[11] =  -2.2665132620567876;
++    x[12] =  -2.043834754429505;
++    x[13] =  -2.0232301911005157;
++    x[14] =  -1.8357079751751868;
++    x[15] =  -1.585873011819188;
++    x[16] =  -1.2247448713915889;
++    x[17] =  -0.87004089535290285;
++    x[18] =  -0.52403354748695763;
++    x[19] =  -0.195324784415805;
++    x[20] =   0.0000000000000000;
++    x[21] =   0.195324784415805;
++    x[22] =   0.52403354748695763;
++    x[23] =   0.87004089535290285;
++    x[24] =   1.2247448713915889;
++    x[25] =   1.585873011819188;
++    x[26] =   1.8357079751751868;
++    x[27] =   2.0232301911005157;
++    x[28] =   2.043834754429505;
++    x[29] =   2.2665132620567876;
++    x[30] =   2.630415236459871;
++    x[31] =   2.9592107790638380;
++    x[32] =   3.296114596212218;
++    x[33] =   3.6677742159463378;
++    x[34] =   4.070919267883068;
++    x[35] =   4.4995993983103881;
++    x[36] =   4.953574342912980;
++    x[37] =   5.437443360177798;
++    x[38] =   5.961461043404500;
++    x[39] =   6.547083258397540;
++    x[40] =   7.251792998192644;
++  }
++  else if ( n == 43 )
++  {
++    x[ 0] = -10.167574994881873;
++    x[ 1] =  -7.231746029072501;
++    x[ 2] =  -6.535398426382995;
++    x[ 3] =  -5.954781975039809;
++    x[ 4] =  -5.434053000365068;
++    x[ 5] =  -4.952329763008589;
++    x[ 6] =  -4.4995993983103881;
++    x[ 7] =  -4.071335874253583;
++    x[ 8] =  -3.6677742159463378;
++    x[ 9] =  -3.295265921534226;
++    x[10] =  -2.9592107790638380;
++    x[11] =  -2.633356763661946;
++    x[12] =  -2.2665132620567876;
++    x[13] =  -2.089340389294661;
++    x[14] =  -2.0232301911005157;
++    x[15] =  -1.8357079751751868;
++    x[16] =  -1.583643465293944;
++    x[17] =  -1.2247448713915889;
++    x[18] =  -0.87004089535290285;
++    x[19] =  -0.52403354748695763;
++    x[20] =  -0.196029453662011;
++    x[21] =   0.0000000000000000;
++    x[22] =   0.196029453662011;
++    x[23] =   0.52403354748695763;
++    x[24] =   0.87004089535290285;
++    x[25] =   1.2247448713915889;
++    x[26] =   1.583643465293944;
++    x[27] =   1.8357079751751868;
++    x[28] =   2.0232301911005157;
++    x[29] =   2.089340389294661;
++    x[30] =   2.2665132620567876;
++    x[31] =   2.633356763661946;
++    x[32] =   2.9592107790638380;
++    x[33] =   3.295265921534226;
++    x[34] =   3.6677742159463378;
++    x[35] =   4.071335874253583;
++    x[36] =   4.4995993983103881;
++    x[37] =   4.952329763008589;
++    x[38] =   5.434053000365068;
++    x[39] =   5.954781975039809;
++    x[40] =   6.535398426382995;
++    x[41] =   7.231746029072501;
++    x[42] =  10.167574994881873;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_GENZ_KEISTER_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal input value of N.\n";
++    std::cerr << "  N must be 1, 3, 9, 19, 35, 37, 41 or 43.\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++void hermite_genz_keister_lookup_points_np ( int n, int np, double p[],
++  double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GENZ_KEISTER_LOOKUP_POINTS_NP looks up Genz-Keister Hermite abscissas.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+?, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and a final rule of order
++//    35, 37, 41 or 43.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29,
++//    with the final rule of precision 51, 55, 63 or 67.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Florian Heiss, Viktor Winschel,
++//    Likelihood approximation by numerical integration on sparse grids,
++//    Journal of Econometrics,
++//    Volume 144, 2008, pages 62-80.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::hermite_genz_keister_lookup_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_genz_keister_lookup_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS looks up Genz-Keister Hermite weights.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+?, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and a final rule of order
++//    35, 37, 41 or 43.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29,
++//    with the final rule of precision 51, 55, 63 or 67.
++//
++//    Three related families begin the same way, but end with a different final
++//    rule.  As a convenience, this function includes these final rules as well:
++//
++//    Designation  Orders       Precisions
++//
++//    1+2+6+10+16, 1,3,9,19,35  1,5,15,29,51
++//    1+2+6+10+18  1,3,9,19,37  1,5,15,29,55
++//    1+2+6+10+22  1,3,9,19,41  1,5,15,29,63
++//    1+2+6+10+24  1,3,9,19,43  1,5,15,29,67
++//
++//    Some of the data in this function was kindly supplied directly by
++//    Alan Genz on 24 April 2011.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Florian Heiss, Viktor Winschel,
++//    Likelihood approximation by numerical integration on sparse grids,
++//    Journal of Econometrics,
++//    Volume 144, 2008, pages 62-80.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9, 19, 35, 37, 41, or 43.
++//
++//    Output, double W[N], the weights.
++//
++{
++  static double sqrtpi = 1.7724538509055159;
++
++  if ( n == 1 )
++  {
++    w[ 0] =   1.7724538509055159E+00;
++  }
++  else if ( n == 3 )
++  {
++    w[ 0] =   2.9540897515091930E-01;
++    w[ 1] =   1.1816359006036772E+00;
++    w[ 2] =   2.9540897515091930E-01;
++  }
++  else if ( n == 9 )
++  {
++    w[ 0] =   1.6708826306882348E-04;
++    w[ 1] =   1.4173117873979098E-02;
++    w[ 2] =   1.6811892894767771E-01;
++    w[ 3] =   4.7869428549114124E-01;
++    w[ 4] =   4.5014700975378197E-01;
++    w[ 5] =   4.7869428549114124E-01;
++    w[ 6] =   1.6811892894767771E-01;
++    w[ 7] =   1.4173117873979098E-02;
++    w[ 8] =   1.6708826306882348E-04;
++  }
++  else if ( n == 19 )
++  {
++    w[ 0] =   1.5295717705322357E-09;
++    w[ 1] =   1.0802767206624762E-06;
++    w[ 2] =   1.0656589772852267E-04;
++    w[ 3] =   5.1133174390883855E-03;
++    w[ 4] =  -1.1232438489069229E-02;
++    w[ 5] =   3.2055243099445879E-02;
++    w[ 6] =   1.1360729895748269E-01;
++    w[ 7] =   1.0838861955003017E-01;
++    w[ 8] =   3.6924643368920851E-01;
++    w[ 9] =   5.3788160700510168E-01;
++    w[10] =   3.6924643368920851E-01;
++    w[11] =   1.0838861955003017E-01;
++    w[12] =   1.1360729895748269E-01;
++    w[13] =   3.2055243099445879E-02;
++    w[14] =  -1.1232438489069229E-02;
++    w[15] =   5.1133174390883855E-03;
++    w[16] =   1.0656589772852267E-04;
++    w[17] =   1.0802767206624762E-06;
++    w[18] =   1.5295717705322357E-09;
++  }
++  else if ( n == 35 )
++  {
++    w[ 0] =   1.8684014894510604E-18;
++    w[ 1] =   9.6599466278563243E-15;
++    w[ 2] =   5.4896836948499462E-12;
++    w[ 3] =   8.1553721816916897E-10;
++    w[ 4] =   3.7920222392319532E-08;
++    w[ 5] =   4.3737818040926989E-07;
++    w[ 6] =   4.8462799737020461E-06;
++    w[ 7] =   6.3328620805617891E-05;
++    w[ 8] =   4.8785399304443770E-04;
++    w[ 9] =   1.4515580425155904E-03;
++    w[10] =   4.0967527720344047E-03;
++    w[11] =   5.5928828911469180E-03;
++    w[12] =   2.7780508908535097E-02;
++    w[13] =   8.0245518147390893E-02;
++    w[14] =   1.6371221555735804E-01;
++    w[15] =   2.6244871488784277E-01;
++    w[16] =   3.3988595585585218E-01;
++    w[17] =   9.1262675363737921E-04;
++    w[18] =   3.3988595585585218E-01;
++    w[19] =   2.6244871488784277E-01;
++    w[20] =   1.6371221555735804E-01;
++    w[21] =   8.0245518147390893E-02;
++    w[22] =   2.7780508908535097E-02;
++    w[23] =   5.5928828911469180E-03;
++    w[24] =   4.0967527720344047E-03;
++    w[25] =   1.4515580425155904E-03;
++    w[26] =   4.8785399304443770E-04;
++    w[27] =   6.3328620805617891E-05;
++    w[28] =   4.8462799737020461E-06;
++    w[29] =   4.3737818040926989E-07;
++    w[30] =   3.7920222392319532E-08;
++    w[31] =   8.1553721816916897E-10;
++    w[32] =   5.4896836948499462E-12;
++    w[33] =   9.6599466278563243E-15;
++    w[34] =   1.8684014894510604E-18;
++  }
++  else if ( n == 37 )
++  {
++    w[ 0] = 0.337304188079177058E-20;
++    w[ 1] = 0.332834739632930463E-16;
++    w[ 2] = 0.323016866782871498E-13;
++    w[ 3] = 0.809333688669950037E-11;
++    w[ 4] = 0.748907559239519284E-09;
++    w[ 5] = 0.294146671497083432E-07;
++    w[ 6] = 0.524482423744884136E-06;
++    w[ 7] = 0.586639457073896277E-05;
++    w[ 8] = 0.571885531470621903E-04;
++    w[ 9] = 0.41642095727577091E-03;
++    w[10] = 0.174733389581099482E-02;
++    w[11] = 0.313373786000304381E-02;
++    w[12] = 0.768092665770660459E-02;
++    w[13] = 0.274962713372148476E-01;
++    w[14] = 0.783630990508037449E-01;
++    w[15] = 0.16611584261479281E+00;
++    w[16] = 0.253636910481387185E+00;
++    w[17] = 0.261712932511430884E+00;
++    w[18] = 0.171719680968980257E+00;
++    w[19] = 0.261712932511430884E+00;
++    w[20] = 0.253636910481387185E+00;
++    w[21] = 0.16611584261479281E+00;
++    w[22] = 0.783630990508037449E-01;
++    w[23] = 0.274962713372148476E-01;
++    w[24] = 0.768092665770660459E-02;
++    w[25] = 0.313373786000304381E-02;
++    w[26] = 0.174733389581099482E-02;
++    w[27] = 0.41642095727577091E-03;
++    w[28] = 0.571885531470621903E-04;
++    w[29] = 0.586639457073896277E-05;
++    w[30] = 0.524482423744884136E-06;
++    w[31] = 0.294146671497083432E-07;
++    w[32] = 0.748907559239519284E-09;
++    w[33] = 0.809333688669950037E-11;
++    w[34] = 0.323016866782871498E-13;
++    w[35] = 0.332834739632930463E-16;
++    w[36] = 0.337304188079177058E-20;
++  }
++  else if ( n == 41 )
++  {
++    w[ 0] =   0.117725656974405367E-22;
++    w[ 1] =   0.152506745534300636E-18;
++    w[ 2] =   0.202183949965101288E-15;
++    w[ 3] =   0.724614869051195508E-13;
++    w[ 4] =   0.103121966469463034E-10;
++    w[ 5] =   0.710371395169350952E-09;
++    w[ 6] =   0.264376044449260516E-07;
++    w[ 7] =   0.558982787078644997E-06;
++    w[ 8] =   0.675628907134744976E-05;
++    w[ 9] =   0.512198007019776873E-04;
++    w[10] =   0.335013114947200879E-03;
++    w[11] =   0.249379691096933139E-02;
++    w[12] = - 0.25616995850607458E-01;
++    w[13] =   0.317007878644325588E-01;
++    w[14] =   0.125041498584003435E-02;
++    w[15] =   0.293244560924894295E-01;
++    w[16] =   0.799536390803302298E-01;
++    w[17] =   0.164543666806555251E+00;
++    w[18] =   0.258718519718241095E+00;
++    w[19] =   0.293588795735908566E+00;
++    w[20] =   0.997525375254611951E-01;
++    w[21] =   0.293588795735908566E+00;
++    w[22] =   0.258718519718241095E+00;
++    w[23] =   0.164543666806555251E+00;
++    w[24] =   0.799536390803302298E-01;
++    w[25] =   0.293244560924894295E-01;
++    w[26] =   0.125041498584003435E-02;
++    w[27] =   0.317007878644325588E-01;
++    w[28] = - 0.25616995850607458E-01;
++    w[29] =   0.249379691096933139E-02;
++    w[30] =   0.335013114947200879E-03;
++    w[31] =   0.512198007019776873E-04;
++    w[32] =   0.675628907134744976E-05;
++    w[33] =   0.558982787078644997E-06;
++    w[34] =   0.264376044449260516E-07;
++    w[35] =   0.710371395169350952E-09;
++    w[36] =   0.103121966469463034E-10;
++    w[37] =   0.724614869051195508E-13;
++    w[38] =   0.202183949965101288E-15;
++    w[39] =   0.152506745534300636E-18;
++    w[40] =   0.117725656974405367E-22;
++  }
++  else if ( n == 43 )
++  {
++    w[ 0] =   0.968100020641528185E-37;
++    w[ 1] =   0.15516931262860431E-22;
++    w[ 2] =   0.175937309107750992E-18;
++    w[ 3] =   0.217337608710893738E-15;
++    w[ 4] =   0.747837010380540069E-13;
++    w[ 5] =   0.104028132097205732E-10;
++    w[ 6] =   0.70903573389336778E-09;
++    w[ 7] =   0.263481722999966618E-07;
++    w[ 8] =   0.560127964848432175E-06;
++    w[ 9] =   0.680410934802210232E-05;
++    w[10] =   0.508343873102544037E-04;
++    w[11] =   0.32753080006610181E-03;
++    w[12] =   0.267479828788552937E-02;
++    w[13] = - 0.687704270963253854E-02;
++    w[14] =   0.119383201790913588E-01;
++    w[15] =   0.248083722871002796E-02;
++    w[16] =   0.29000335749726387E-01;
++    w[17] =   0.798689557875757008E-01;
++    w[18] =   0.164609842422580606E+00;
++    w[19] =   0.258535954731607738E+00;
++    w[20] =   0.292243810406117141E+00;
++    w[21] =   0.102730713753441829E+00;
++    w[22] =   0.292243810406117141E+00;
++    w[23] =   0.258535954731607738E+00;
++    w[24] =   0.164609842422580606E+00;
++    w[25] =   0.798689557875757008E-01;
++    w[26] =   0.29000335749726387E-01;
++    w[27] =   0.248083722871002796E-02;
++    w[28] =   0.119383201790913588E-01;
++    w[29] = - 0.687704270963253854E-02;
++    w[30] =   0.267479828788552937E-02;
++    w[31] =   0.32753080006610181E-03;
++    w[32] =   0.508343873102544037E-04;
++    w[33] =   0.680410934802210232E-05;
++    w[34] =   0.560127964848432175E-06;
++    w[35] =   0.263481722999966618E-07;
++    w[36] =   0.70903573389336778E-09;
++    w[37] =   0.104028132097205732E-10;
++    w[38] =   0.747837010380540069E-13;
++    w[39] =   0.217337608710893738E-15;
++    w[40] =   0.175937309107750992E-18;
++    w[41] =   0.15516931262860431E-22;
++    w[42] =   0.968100020641528185E-37;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Illegal input value of N.\n";
++    std::cerr << "  N must be 1, 3, 9, 19, 35, 37, 41 or 43.\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++void hermite_genz_keister_lookup_weights_np ( int n, int np, double p[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GENZ_KEISTER_LOOKUP_WEIGHTS_NP looks up Genz-Keister Hermite weights.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+?, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and a final rule of order
++//    35, 37, 41 or 43.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29,
++//    with the final rule of precision 51, 55, 63 or 67.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Florian Heiss, Viktor Winschel,
++//    Likelihood approximation by numerical integration on sparse grids,
++//    Journal of Econometrics,
++//    Volume 144, 2008, pages 62-80.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9, 19, 35, 37, 41 or 43.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::hermite_genz_keister_lookup_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_gk18_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GK18_LOOKUP_POINTS: abscissas of a Hermite Genz-Keister 18 rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+18, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and 37.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29, and 55.
++//
++//    Some of the data in this function was kindly supplied directly by
++//    Alan Genz on 24 April 2011.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    30 April 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Florian Heiss, Viktor Winschel,
++//    Likelihood approximation by numerical integration on sparse grids,
++//    Journal of Econometrics,
++//    Volume 144, 2008, pages 62-80.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9, 19, or 37.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  if ( n == 1 )
++  {
++    x[ 0] =   0.0000000000000000E+00;
++  }
++  else if ( n == 3 )
++  {
++    x[ 0] =  -1.2247448713915889E+00;
++    x[ 1] =   0.0000000000000000E+00;
++    x[ 2] =   1.2247448713915889E+00;
++  }
++  else if ( n == 9 )
++  {
++    x[ 0] =  -2.9592107790638380E+00;
++    x[ 1] =  -2.0232301911005157E+00;
++    x[ 2] =  -1.2247448713915889E+00;
++    x[ 3] =  -5.2403354748695763E-01;
++    x[ 4] =   0.0000000000000000E+00;
++    x[ 5] =   5.2403354748695763E-01;
++    x[ 6] =   1.2247448713915889E+00;
++    x[ 7] =   2.0232301911005157E+00;
++    x[ 8] =   2.9592107790638380E+00;
++  }
++  else if ( n == 19 )
++  {
++    x[ 0] =  -4.4995993983103881E+00;
++    x[ 1] =  -3.6677742159463378E+00;
++    x[ 2] =  -2.9592107790638380E+00;
++    x[ 3] =  -2.2665132620567876E+00;
++    x[ 4] =  -2.0232301911005157E+00;
++    x[ 5] =  -1.8357079751751868E+00;
++    x[ 6] =  -1.2247448713915889E+00;
++    x[ 7] =  -8.7004089535290285E-01;
++    x[ 8] =  -5.2403354748695763E-01;
++    x[ 9] =   0.0000000000000000E+00;
++    x[10] =   5.2403354748695763E-01;
++    x[11] =   8.7004089535290285E-01;
++    x[12] =   1.2247448713915889E+00;
++    x[13] =   1.8357079751751868E+00;
++    x[14] =   2.0232301911005157E+00;
++    x[15] =   2.2665132620567876E+00;
++    x[16] =   2.9592107790638380E+00;
++    x[17] =   3.6677742159463378E+00;
++    x[18] =   4.4995993983103881E+00;
++  }
++  else if ( n == 35 )
++  {
++    x[ 0] =  -6.853200069757519;
++    x[ 1] =  -6.124527854622158;
++    x[ 2] =  -5.521865209868350;
++    x[ 3] =  -4.986551454150765;
++    x[ 4] =  -4.499599398310388;
++    x[ 5] =  -4.057956316089741;
++    x[ 6] =  -3.667774215946338;
++    x[ 7] =  -3.315584617593290;
++    x[ 8] =  -2.959210779063838;
++    x[ 9] =  -2.597288631188366;
++    x[10] =  -2.266513262056788;
++    x[11] =  -2.023230191100516;
++    x[12] =  -1.835707975175187;
++    x[13] =  -1.561553427651873;
++    x[14] =  -1.224744871391589;
++    x[15] =  -0.870040895352903;
++    x[16] =  -0.524033547486958;
++    x[17] =  -0.214618180588171;
++    x[18] =   0.000000000000000;
++    x[19] =   0.214618180588171;
++    x[20] =   0.524033547486958;
++    x[21] =   0.870040895352903;
++    x[22] =   1.224744871391589;
++    x[23] =   1.561553427651873;
++    x[24] =   1.835707975175187;
++    x[25] =   2.023230191100516;
++    x[26] =   2.266513262056788;
++    x[27] =   2.597288631188366;
++    x[28] =   2.959210779063838;
++    x[29] =   3.315584617593290;
++    x[30] =   3.667774215946338;
++    x[31] =   4.057956316089741;
++    x[32] =   4.499599398310388;
++    x[33] =   4.986551454150765;
++    x[34] =   5.521865209868350;
++    x[35] =   6.124527854622158;
++    x[36] =   6.853200069757519;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_GK18_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal input value of N.\n";
++    std::cerr << "  N must be 1, 3, 9, 19, or 37.\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++void hermite_gk22_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GK22_LOOKUP_POINTS looks up Hermite Genz-Keister 22 points.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+16, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and 41.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29, and 63.
++//
++//    Some of the data in this function was kindly supplied directly by
++//    Alan Genz on 24 April 2011.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 April 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9, 19, or 41.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  if ( n == 1 )
++  {
++    x[ 0] =   0.0000000000000000E+00;
++  }
++  else if ( n == 3 )
++  {
++    x[ 0] =  -1.2247448713915889E+00;
++    x[ 1] =   0.0000000000000000E+00;
++    x[ 2] =   1.2247448713915889E+00;
++  }
++  else if ( n == 9 )
++  {
++    x[ 0] =  -2.9592107790638380E+00;
++    x[ 1] =  -2.0232301911005157E+00;
++    x[ 2] =  -1.2247448713915889E+00;
++    x[ 3] =  -5.2403354748695763E-01;
++    x[ 4] =   0.0000000000000000E+00;
++    x[ 5] =   5.2403354748695763E-01;
++    x[ 6] =   1.2247448713915889E+00;
++    x[ 7] =   2.0232301911005157E+00;
++    x[ 8] =   2.9592107790638380E+00;
++  }
++  else if ( n == 19 )
++  {
++    x[ 0] =  -4.4995993983103881E+00;
++    x[ 1] =  -3.6677742159463378E+00;
++    x[ 2] =  -2.9592107790638380E+00;
++    x[ 3] =  -2.2665132620567876E+00;
++    x[ 4] =  -2.0232301911005157E+00;
++    x[ 5] =  -1.8357079751751868E+00;
++    x[ 6] =  -1.2247448713915889E+00;
++    x[ 7] =  -8.7004089535290285E-01;
++    x[ 8] =  -5.2403354748695763E-01;
++    x[ 9] =   0.0000000000000000E+00;
++    x[10] =   5.2403354748695763E-01;
++    x[11] =   8.7004089535290285E-01;
++    x[12] =   1.2247448713915889E+00;
++    x[13] =   1.8357079751751868E+00;
++    x[14] =   2.0232301911005157E+00;
++    x[15] =   2.2665132620567876E+00;
++    x[16] =   2.9592107790638380E+00;
++    x[17] =   3.6677742159463378E+00;
++    x[18] =   4.4995993983103881E+00;
++  }
++  else if ( n == 41 )
++  {
++    x[ 0] =  -7.251792998192644;
++    x[ 1] =  -6.547083258397540;
++    x[ 2] =  -5.961461043404500;
++    x[ 3] =  -5.437443360177798;
++    x[ 4] =  -4.953574342912980;
++    x[ 5] =  -4.4995993983103881;
++    x[ 6] =  -4.070919267883068;
++    x[ 7] =  -3.6677742159463378;
++    x[ 8] =  -3.296114596212218;
++    x[ 9] =  -2.9592107790638380;
++    x[10] =  -2.630415236459871;
++    x[11] =  -2.2665132620567876;
++    x[12] =  -2.043834754429505;
++    x[13] =  -2.0232301911005157;
++    x[14] =  -1.8357079751751868;
++    x[15] =  -1.585873011819188;
++    x[16] =  -1.2247448713915889;
++    x[17] =  -0.87004089535290285;
++    x[18] =  -0.52403354748695763;
++    x[19] =  -0.195324784415805;
++    x[20] =   0.0000000000000000;
++    x[21] =   0.195324784415805;
++    x[22] =   0.52403354748695763;
++    x[23] =   0.87004089535290285;
++    x[24] =   1.2247448713915889;
++    x[25] =   1.585873011819188;
++    x[26] =   1.8357079751751868;
++    x[27] =   2.0232301911005157;
++    x[28] =   2.043834754429505;
++    x[29] =   2.2665132620567876;
++    x[30] =   2.630415236459871;
++    x[31] =   2.9592107790638380;
++    x[32] =   3.296114596212218;
++    x[33] =   3.6677742159463378;
++    x[34] =   4.070919267883068;
++    x[35] =   4.4995993983103881;
++    x[36] =   4.953574342912980;
++    x[37] =   5.437443360177798;
++    x[38] =   5.961461043404500;
++    x[39] =   6.547083258397540;
++    x[40] =   7.251792998192644;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_GK22_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal input value of N.\n";
++    std::cerr << "  N must be 1, 3, 9, 19, or 41.\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++void hermite_gk24_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_GK24_LOOKUP_POINTS looks up Hermite Genz-Keister 24 points.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo <= x <= +oo ) f(x) exp ( - x * x ) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) )
++//
++//    A nested family of rules for the Hermite integration problem
++//    was produced by Genz and Keister.  The structure of the nested
++//    family was denoted by 1+2+6+10+16, that is, it comprised rules
++//    of successive orders O = 1, 3, 9, 19, and 43.
++//
++//    The precisions of these rules are P = 1, 5, 15, 29, and 67.
++//
++//    Some of the data in this function was kindly supplied directly by
++//    Alan Genz on 24 April 2011.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    26 April 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Alan Genz, Bradley Keister,
++//    Fully symmetric interpolatory rules for multiple integrals
++//    over infinite regions with Gaussian weight,
++//    Journal of Computational and Applied Mathematics,
++//    Volume 71, 1996, pages 299-309
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be 1, 3, 9 19, or 43.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  if ( n == 1 )
++  {
++    x[ 0] =   0.0000000000000000E+00;
++  }
++  else if ( n == 3 )
++  {
++    x[ 0] =  -1.2247448713915889E+00;
++    x[ 1] =   0.0000000000000000E+00;
++    x[ 2] =   1.2247448713915889E+00;
++  }
++  else if ( n == 9 )
++  {
++    x[ 0] =  -2.9592107790638380E+00;
++    x[ 1] =  -2.0232301911005157E+00;
++    x[ 2] =  -1.2247448713915889E+00;
++    x[ 3] =  -5.2403354748695763E-01;
++    x[ 4] =   0.0000000000000000E+00;
++    x[ 5] =   5.2403354748695763E-01;
++    x[ 6] =   1.2247448713915889E+00;
++    x[ 7] =   2.0232301911005157E+00;
++    x[ 8] =   2.9592107790638380E+00;
++  }
++  else if ( n == 19 )
++  {
++    x[ 0] =  -4.4995993983103881E+00;
++    x[ 1] =  -3.6677742159463378E+00;
++    x[ 2] =  -2.9592107790638380E+00;
++    x[ 3] =  -2.2665132620567876E+00;
++    x[ 4] =  -2.0232301911005157E+00;
++    x[ 5] =  -1.8357079751751868E+00;
++    x[ 6] =  -1.2247448713915889E+00;
++    x[ 7] =  -8.7004089535290285E-01;
++    x[ 8] =  -5.2403354748695763E-01;
++    x[ 9] =   0.0000000000000000E+00;
++    x[10] =   5.2403354748695763E-01;
++    x[11] =   8.7004089535290285E-01;
++    x[12] =   1.2247448713915889E+00;
++    x[13] =   1.8357079751751868E+00;
++    x[14] =   2.0232301911005157E+00;
++    x[15] =   2.2665132620567876E+00;
++    x[16] =   2.9592107790638380E+00;
++    x[17] =   3.6677742159463378E+00;
++    x[18] =   4.4995993983103881E+00;
++  }
++  else if ( n == 43 )
++  {
++    x[ 0] = -10.167574994881873;
++    x[ 1] =  -7.231746029072501;
++    x[ 2] =  -6.535398426382995;
++    x[ 3] =  -5.954781975039809;
++    x[ 4] =  -5.434053000365068;
++    x[ 5] =  -4.952329763008589;
++    x[ 6] =  -4.4995993983103881;
++    x[ 7] =  -4.071335874253583;
++    x[ 8] =  -3.6677742159463378;
++    x[ 9] =  -3.295265921534226;
++    x[10] =  -2.9592107790638380;
++    x[11] =  -2.633356763661946;
++    x[12] =  -2.2665132620567876;
++    x[13] =  -2.089340389294661;
++    x[14] =  -2.0232301911005157;
++    x[15] =  -1.8357079751751868;
++    x[16] =  -1.583643465293944;
++    x[17] =  -1.2247448713915889;
++    x[18] =  -0.87004089535290285;
++    x[19] =  -0.52403354748695763;
++    x[20] =  -0.196029453662011;
++    x[21] =   0.0000000000000000;
++    x[22] =   0.196029453662011;
++    x[23] =   0.52403354748695763;
++    x[24] =   0.87004089535290285;
++    x[25] =   1.2247448713915889;
++    x[26] =   1.583643465293944;
++    x[27] =   1.8357079751751868;
++    x[28] =   2.0232301911005157;
++    x[29] =   2.089340389294661;
++    x[30] =   2.2665132620567876;
++    x[31] =   2.633356763661946;
++    x[32] =   2.9592107790638380;
++    x[33] =   3.295265921534226;
++    x[34] =   3.6677742159463378;
++    x[35] =   4.071335874253583;
++    x[36] =   4.4995993983103881;
++    x[37] =   4.952329763008589;
++    x[38] =   5.434053000365068;
++    x[39] =   5.954781975039809;
++    x[40] =   6.535398426382995;
++    x[41] =   7.231746029072501;
++    x[42] =  10.167574994881873;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_GK24_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal input value of N.\n";
++    std::cerr << "  N must be 1, 3, 9, 19, or 43.\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++double hermite_integral ( int n )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_INTEGRAL evaluates a monomial Hermite integral.
++//
++//  Discussion:
++//
++//    H(n) = Integral ( -oo < x < +oo ) x^n exp(-x^2) dx
++//
++//    H(n) is 0 for n odd.
++//
++//    H(n) = (n-1)!! * sqrt(pi) / 2^(n/2) for n even.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order of the integral.
++//    0 <= N.
++//
++//    Output, double VALUE, the value of the integral.
++//
++{
++  double pi = 3.141592653589793;
++  double value;
++
++  if ( n < 0 )
++  {
++    value = - webbur::r8_huge ( );
++  }
++  else if ( ( n % 2 ) == 1 )
++  {
++    value = 0.0;
++  }
++  else
++  {
++    value = webbur::r8_factorial2 ( n - 1 ) * std::sqrt ( pi )
++      / std::pow ( 2.0, n / 2 );
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++void hermite_interpolant ( int n, double x[], double y[], double yp[],
++  double xd[], double yd[], double xdp[], double ydp[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_INTERPOLANT sets up a divided difference table from Hermite data.
++//
++//  Discussion:
++//
++//    The polynomial represented by the divided difference table can be
++//    evaluated by calling DIF_VALS.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Carl deBoor,
++//    A Practical Guide to Splines,
++//    Springer, 2001,
++//    ISBN: 0387953663,
++//    LC: QA1.A647.v27.
++//
++//  Parameters:
++//
++//    Input, int N, of items of data
++//    ( X(I), Y(I), YP(I) ).
++//
++//    Input, double X[N], the abscissas.
++//    These values must be distinct.
++//
++//    Input, double Y[N], YP[N], the function and derivative values.
++//
++//    Output, double XD[2*N], YD[2*N], the divided difference table
++//    for the interpolant value.
++//
++//    Output, double XDP[2*N-1], YDP[2*N-1], the divided difference
++//    table for the interpolant derivative.
++//
++{
++  int i;
++  int j;
++  int nd;
++  int ndp;
++//
++//  Copy the data.
++//
++  nd = 2 * n;
++
++  for ( i = 0; i < n; i++ )
++  {
++    xd[0+i*2] = x[i];
++    xd[1+i*2] = x[i];
++  }
++//
++//  Carry out the first step of differencing.
++//
++  yd[0] = y[0];
++  for ( i = 1; i < n; i++ )
++  {
++    yd[0+2*i] = ( y[i] - y[i-1] ) / ( x[i] - x[i-1] );
++  }
++  for ( i = 0; i < n; i++ )
++  {
++    yd[1+2*i] = yp[i];
++  }
++//
++//  Carry out the remaining steps in the usual way.
++//
++  for ( i = 2; i < nd; i++ )
++  {
++    for ( j = nd - 1; i <= j; j-- )
++    {
++      yd[j] = ( yd[j] - yd[j-1] ) / ( xd[j] - xd[j-i] );
++    }
++  }
++//
++//  Compute the difference table for the derivative.
++//
++  webbur::dif_deriv ( nd, xd, yd, &ndp, xdp, ydp );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_interpolant_rule ( int n, double a, double b, double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_INTERPOLANT_RULE: quadrature rule for a Hermite interpolant.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of abscissas.
++//
++//    Input, double A, B, the integration limits.
++//
++//    Input, double X[N], the abscissas.
++//
++//    Output, double W[2*N], the quadrature
++//    coefficients, given as pairs for function and derivative values
++//    at each abscissa.
++//
++{
++  double a_value;
++  double b_value;
++  double *c;
++  int i;
++  int j;
++  int k;
++  int nd;
++  int ndp;
++  double *xd;
++  double *xdp;
++  double *y;
++  double *yd;
++  double *ydp;
++  double *yp;
++
++  y = new double[n];
++  yp = new double[n];
++
++  nd = 2 * n;
++  c = new double[nd];
++  xd = new double[nd];
++  yd = new double[nd];
++
++  ndp = 2 * n - 1;
++  xdp = new double[ndp];
++  ydp = new double[ndp];
++
++  for ( i = 0; i < n; i++ )
++  {
++    y[i] = 0.0;
++    yp[i] = 0.0;
++  }
++
++  k = 0;
++
++  for ( i = 0; i < n; i++ )
++  {
++    y[i] = 1.0;
++    webbur::hermite_interpolant ( n, x, y, yp, xd, yd, xdp, ydp );
++    webbur::dif_to_r8poly ( nd, xd, yd, c );
++    a_value = webbur::r8poly_ant_val ( n, c, a );
++    b_value = webbur::r8poly_ant_val ( n, c, b );
++    w[k] = b_value - a_value;
++    y[i] = 0.0;
++    k = k + 1;
++
++    yp[i] = 1.0;
++    webbur::hermite_interpolant ( n, x, y, yp, xd, yd, xdp, ydp );
++    webbur::dif_to_r8poly ( nd, xd, yd, c );
++    a_value = webbur::r8poly_ant_val ( n, c, a );
++    b_value = webbur::r8poly_ant_val ( n, c, b );
++    w[k] = b_value - a_value;
++    yp[i] = 0.0;
++    k = k + 1;
++  }
++
++  delete [] c;
++  delete [] xd;
++  delete [] xdp;
++  delete [] y;
++  delete [] yd;
++  delete [] ydp;
++  delete [] yp;
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_interpolant_value ( int nd, double xd[], double yd[], double xdp[],
++  double ydp[], int nv, double xv[], double yv[], double yvp[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_INTERPOLANT_VALUE evaluates the Hermite interpolant polynomial.
++//
++//  Discussion:
++//
++//    In fact, this function will evaluate an arbitrary polynomial that is
++//    represented by a difference table.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Carl deBoor,
++//    A Practical Guide to Splines,
++//    Springer, 2001,
++//    ISBN: 0387953663,
++//    LC: QA1.A647.v27.
++//
++//  Parameters:
++//
++//    Input, int ND, the order of the difference table.
++//
++//    Input, double XD[ND], YD[ND], the difference table for the
++//    interpolant value.
++//
++//    Input, double XDP[ND-1], YDP[ND-1], the difference table for
++//    the interpolant derivative.
++//
++//    Input, int NV, the number of evaluation points.
++//
++//    Input, double XV[NV], the evaluation points.
++//
++//    Output, double YV[NV], YVP[NV], the value of the interpolant and
++//    its derivative at the evaluation points.
++//
++{
++  int i;
++  int j;
++  int ndp;
++
++  ndp = nd - 1;
++
++  for ( j = 0; j < nv; j++ )
++  {
++    yv[j] = yd[nd-1];
++    for ( i = nd - 2; 0 <= i; i-- )
++    {
++      yv[j] = yd[i] + ( xv[j] - xd[i] ) * yv[j];
++    }
++
++    yvp[j] = ydp[ndp-1];
++    for ( i = ndp - 2; 0 <= i; i-- )
++    {
++      yvp[j] = ydp[i] + ( xv[j] - xdp[i] ) * yvp[j];
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void hermite_lookup ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_LOOKUP looks up abscissas and weights for Gauss-Hermite quadrature.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798.
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3,
++//    LC: QA47.M315.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 20.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::hermite_lookup_points ( n, x );
++
++  webbur::hermite_lookup_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_LOOKUP_POINTS looks up abscissas for Hermite quadrature.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) ).
++//
++//    Mathematica can numerically estimate the abscissas
++//    of order N to P digits by the command:
++//
++//      NSolve [ HermiteH [ n, x ] == 0, x, p ]
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798,
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3,
++//    LC: QA47.M315.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 20.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  if ( n == 1 )
++  {
++    x[0] = 0.0;
++  }
++  else if ( n == 2 )
++  {
++    x[0] = - 0.707106781186547524400844362105E+00;
++    x[1] =   0.707106781186547524400844362105E+00;
++  }
++  else if ( n == 3 )
++  {
++    x[0] = - 0.122474487139158904909864203735E+01;
++    x[1] =   0.0E+00;
++    x[2] =   0.122474487139158904909864203735E+01;
++  }
++  else if ( n == 4 )
++  {
++    x[0] = - 0.165068012388578455588334111112E+01;
++    x[1] = - 0.524647623275290317884060253835E+00;
++    x[2] =   0.524647623275290317884060253835E+00;
++    x[3] =   0.165068012388578455588334111112E+01;
++  }
++  else if ( n == 5 )
++  {
++    x[0] = - 0.202018287045608563292872408814E+01;
++    x[1] = - 0.958572464613818507112770593893E+00;
++    x[2] =   0.0E+00;
++    x[3] =   0.958572464613818507112770593893E+00;
++    x[4] =   0.202018287045608563292872408814E+01;
++  }
++  else if ( n == 6 )
++  {
++    x[0] = - 0.235060497367449222283392198706E+01;
++    x[1] = - 0.133584907401369694971489528297E+01;
++    x[2] = - 0.436077411927616508679215948251E+00;
++    x[3] =   0.436077411927616508679215948251E+00;
++    x[4] =   0.133584907401369694971489528297E+01;
++    x[5] =   0.235060497367449222283392198706E+01;
++  }
++  else if ( n == 7 )
++  {
++    x[0] = - 0.265196135683523349244708200652E+01;
++    x[1] = - 0.167355162876747144503180139830E+01;
++    x[2] = - 0.816287882858964663038710959027E+00;
++    x[3] =   0.0E+00;
++    x[4] =   0.816287882858964663038710959027E+00;
++    x[5] =   0.167355162876747144503180139830E+01;
++    x[6] =   0.265196135683523349244708200652E+01;
++  }
++  else if ( n == 8 )
++  {
++    x[0] = - 0.293063742025724401922350270524E+01;
++    x[1] = - 0.198165675669584292585463063977E+01;
++    x[2] = - 0.115719371244678019472076577906E+01;
++    x[3] = - 0.381186990207322116854718885584E+00;
++    x[4] =   0.381186990207322116854718885584E+00;
++    x[5] =   0.115719371244678019472076577906E+01;
++    x[6] =   0.198165675669584292585463063977E+01;
++    x[7] =   0.293063742025724401922350270524E+01;
++  }
++  else if ( n == 9 )
++  {
++    x[0] = - 0.319099320178152760723004779538E+01;
++    x[1] = - 0.226658058453184311180209693284E+01;
++    x[2] = - 0.146855328921666793166701573925E+01;
++    x[3] = - 0.723551018752837573322639864579E+00;
++    x[4] =   0.0E+00;
++    x[5] =   0.723551018752837573322639864579E+00;
++    x[6] =   0.146855328921666793166701573925E+01;
++    x[7] =   0.226658058453184311180209693284E+01;
++    x[8] =   0.319099320178152760723004779538E+01;
++  }
++  else if ( n == 10 )
++  {
++    x[0] =  - 0.343615911883773760332672549432E+01;
++    x[1] =  - 0.253273167423278979640896079775E+01;
++    x[2] =  - 0.175668364929988177345140122011E+01;
++    x[3] =  - 0.103661082978951365417749191676E+01;
++    x[4] =  - 0.342901327223704608789165025557E+00;
++    x[5] =    0.342901327223704608789165025557E+00;
++    x[6] =    0.103661082978951365417749191676E+01;
++    x[7] =    0.175668364929988177345140122011E+01;
++    x[8] =    0.253273167423278979640896079775E+01;
++    x[9] =    0.343615911883773760332672549432E+01;
++  }
++  else if ( n == 11 )
++  {
++    x[0] =  - 0.366847084655958251845837146485E+01;
++    x[1] =  - 0.278329009978165177083671870152E+01;
++    x[2] =  - 0.202594801582575533516591283121E+01;
++    x[3] =  - 0.132655708449493285594973473558E+01;
++    x[4] =  - 0.656809566882099765024611575383E+00;
++    x[5] =    0.0E+00;
++    x[6] =    0.656809566882099765024611575383E+00;
++    x[7] =    0.132655708449493285594973473558E+01;
++    x[8] =    0.202594801582575533516591283121E+01;
++    x[9] =    0.278329009978165177083671870152E+01;
++    x[10] =   0.366847084655958251845837146485E+01;
++  }
++  else if ( n == 12 )
++  {
++    x[0] =  - 0.388972489786978191927164274724E+01;
++    x[1] =  - 0.302063702512088977171067937518E+01;
++    x[2] =  - 0.227950708050105990018772856942E+01;
++    x[3] =  - 0.159768263515260479670966277090E+01;
++    x[4] =  - 0.947788391240163743704578131060E+00;
++    x[5] =  - 0.314240376254359111276611634095E+00;
++    x[6] =    0.314240376254359111276611634095E+00;
++    x[7] =    0.947788391240163743704578131060E+00;
++    x[8] =    0.159768263515260479670966277090E+01;
++    x[9] =    0.227950708050105990018772856942E+01;
++    x[10] =   0.302063702512088977171067937518E+01;
++    x[11] =   0.388972489786978191927164274724E+01;
++  }
++  else if ( n == 13 )
++  {
++    x[0] =  - 0.410133759617863964117891508007E+01;
++    x[1] =  - 0.324660897837240998812205115236E+01;
++    x[2] =  - 0.251973568567823788343040913628E+01;
++    x[3] =  - 0.185310765160151214200350644316E+01;
++    x[4] =  - 0.122005503659074842622205526637E+01;
++    x[5] =  - 0.605763879171060113080537108602E+00;
++    x[6] =    0.0E+00;
++    x[7] =    0.605763879171060113080537108602E+00;
++    x[8] =    0.122005503659074842622205526637E+01;
++    x[9] =    0.185310765160151214200350644316E+01;
++    x[10] =   0.251973568567823788343040913628E+01;
++    x[11] =   0.324660897837240998812205115236E+01;
++    x[12] =   0.410133759617863964117891508007E+01;
++  }
++  else if ( n == 14 )
++  {
++    x[0] =  - 0.430444857047363181262129810037E+01;
++    x[1] =  - 0.346265693360227055020891736115E+01;
++    x[2] =  - 0.274847072498540256862499852415E+01;
++    x[3] =  - 0.209518325850771681573497272630E+01;
++    x[4] =  - 0.147668273114114087058350654421E+01;
++    x[5] =  - 0.878713787329399416114679311861E+00;
++    x[6] =  - 0.291745510672562078446113075799E+00;
++    x[7] =    0.291745510672562078446113075799E+00;
++    x[8] =    0.878713787329399416114679311861E+00;
++    x[9] =    0.147668273114114087058350654421E+01;
++    x[10] =   0.209518325850771681573497272630E+01;
++    x[11] =   0.274847072498540256862499852415E+01;
++    x[12] =   0.346265693360227055020891736115E+01;
++    x[13] =   0.430444857047363181262129810037E+01;
++  }
++  else if ( n == 15 )
++  {
++    x[0] =  - 0.449999070730939155366438053053E+01;
++    x[1] =  - 0.366995037340445253472922383312E+01;
++    x[2] =  - 0.296716692790560324848896036355E+01;
++    x[3] =  - 0.232573248617385774545404479449E+01;
++    x[4] =  - 0.171999257518648893241583152515E+01;
++    x[5] =  - 0.113611558521092066631913490556E+01;
++    x[6] =  - 0.565069583255575748526020337198E+00;
++    x[7] =    0.0E+00;
++    x[8] =    0.565069583255575748526020337198E+00;
++    x[9] =    0.113611558521092066631913490556E+01;
++    x[10] =   0.171999257518648893241583152515E+01;
++    x[11] =   0.232573248617385774545404479449E+01;
++    x[12] =   0.296716692790560324848896036355E+01;
++    x[13] =   0.366995037340445253472922383312E+01;
++    x[14] =   0.449999070730939155366438053053E+01;
++  }
++  else if ( n == 16 )
++  {
++    x[0] =  - 0.468873893930581836468849864875E+01;
++    x[1] =  - 0.386944790486012269871942409801E+01;
++    x[2] =  - 0.317699916197995602681399455926E+01;
++    x[3] =  - 0.254620215784748136215932870545E+01;
++    x[4] =  - 0.195178799091625397743465541496E+01;
++    x[5] =  - 0.138025853919888079637208966969E+01;
++    x[6] =  - 0.822951449144655892582454496734E+00;
++    x[7] =  - 0.273481046138152452158280401965E+00;
++    x[8] =    0.273481046138152452158280401965E+00;
++    x[9] =    0.822951449144655892582454496734E+00;
++    x[10] =   0.138025853919888079637208966969E+01;
++    x[11] =   0.195178799091625397743465541496E+01;
++    x[12] =   0.254620215784748136215932870545E+01;
++    x[13] =   0.317699916197995602681399455926E+01;
++    x[14] =   0.386944790486012269871942409801E+01;
++    x[15] =   0.468873893930581836468849864875E+01;
++  }
++  else if ( n == 17 )
++  {
++    x[0] =  - 0.487134519367440308834927655662E+01;
++    x[1] =  - 0.406194667587547430689245559698E+01;
++    x[2] =  - 0.337893209114149408338327069289E+01;
++    x[3] =  - 0.275776291570388873092640349574E+01;
++    x[4] =  - 0.217350282666662081927537907149E+01;
++    x[5] =  - 0.161292431422123133311288254454E+01;
++    x[6] =  - 0.106764872574345055363045773799E+01;
++    x[7] =  - 0.531633001342654731349086553718E+00;
++    x[8] =    0.0E+00;
++    x[9] =    0.531633001342654731349086553718E+00;
++    x[10] =   0.106764872574345055363045773799E+01;
++    x[11] =   0.161292431422123133311288254454E+01;
++    x[12] =   0.217350282666662081927537907149E+01;
++    x[13] =   0.275776291570388873092640349574E+01;
++    x[14] =   0.337893209114149408338327069289E+01;
++    x[15] =   0.406194667587547430689245559698E+01;
++    x[16] =   0.487134519367440308834927655662E+01;
++  }
++  else if ( n == 18 )
++  {
++    x[0] =  - 0.504836400887446676837203757885E+01;
++    x[1] =  - 0.424811787356812646302342016090E+01;
++    x[2] =  - 0.357376906848626607950067599377E+01;
++    x[3] =  - 0.296137750553160684477863254906E+01;
++    x[4] =  - 0.238629908916668600026459301424E+01;
++    x[5] =  - 0.183553160426162889225383944409E+01;
++    x[6] =  - 0.130092085838961736566626555439E+01;
++    x[7] =  - 0.776682919267411661316659462284E+00;
++    x[8] =  - 0.258267750519096759258116098711E+00;
++    x[9] =    0.258267750519096759258116098711E+00;
++    x[10] =   0.776682919267411661316659462284E+00;
++    x[11] =   0.130092085838961736566626555439E+01;
++    x[12] =   0.183553160426162889225383944409E+01;
++    x[13] =   0.238629908916668600026459301424E+01;
++    x[14] =   0.296137750553160684477863254906E+01;
++    x[15] =   0.357376906848626607950067599377E+01;
++    x[16] =   0.424811787356812646302342016090E+01;
++    x[17] =   0.504836400887446676837203757885E+01;
++  }
++  else if ( n == 19 )
++  {
++    x[0] =  - 0.522027169053748216460967142500E+01;
++    x[1] =  - 0.442853280660377943723498532226E+01;
++    x[2] =  - 0.376218735196402009751489394104E+01;
++    x[3] =  - 0.315784881834760228184318034120E+01;
++    x[4] =  - 0.259113378979454256492128084112E+01;
++    x[5] =  - 0.204923170985061937575050838669E+01;
++    x[6] =  - 0.152417061939353303183354859367E+01;
++    x[7] =  - 0.101036838713431135136859873726E+01;
++    x[8] =  - 0.503520163423888209373811765050E+00;
++    x[9] =    0.0E+00;
++    x[10] =   0.503520163423888209373811765050E+00;
++    x[11] =   0.101036838713431135136859873726E+01;
++    x[12] =   0.152417061939353303183354859367E+01;
++    x[13] =   0.204923170985061937575050838669E+01;
++    x[14] =   0.259113378979454256492128084112E+01;
++    x[15] =   0.315784881834760228184318034120E+01;
++    x[16] =   0.376218735196402009751489394104E+01;
++    x[17] =   0.442853280660377943723498532226E+01;
++    x[18] =   0.522027169053748216460967142500E+01;
++  }
++  else if ( n == 20 )
++  {
++    x[0] =  - 0.538748089001123286201690041068E+01;
++    x[1] =  - 0.460368244955074427307767524898E+01;
++    x[2] =  - 0.394476404011562521037562880052E+01;
++    x[3] =  - 0.334785456738321632691492452300E+01;
++    x[4] =  - 0.278880605842813048052503375640E+01;
++    x[5] =  - 0.225497400208927552308233334473E+01;
++    x[6] =  - 0.173853771211658620678086566214E+01;
++    x[7] =  - 0.123407621539532300788581834696E+01;
++    x[8] =  - 0.737473728545394358705605144252E+00;
++    x[9] =  - 0.245340708300901249903836530634E+00;
++    x[10] =   0.245340708300901249903836530634E+00;
++    x[11] =   0.737473728545394358705605144252E+00;
++    x[12] =   0.123407621539532300788581834696E+01;
++    x[13] =   0.173853771211658620678086566214E+01;
++    x[14] =   0.225497400208927552308233334473E+01;
++    x[15] =   0.278880605842813048052503375640E+01;
++    x[16] =   0.334785456738321632691492452300E+01;
++    x[17] =   0.394476404011562521037562880052E+01;
++    x[18] =   0.460368244955074427307767524898E+01;
++    x[19] =   0.538748089001123286201690041068E+01;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::cerr << "  Legal values are 1 through 20.\n";
++    std::exit ( 1 );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_lookup_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_LOOKUP_WEIGHTS looks up weights for Hermite quadrature.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -oo < x < +oo ) exp ( - x * x ) * f(x) dx
++//
++//    The quadrature rule:
++//
++//      sum ( 1 <= i <= n ) w(i) * f ( x(i) ).
++//
++//    Mathematica can numerically estimate the abscissas
++//    of order N to P digits by the command:
++//
++//      NSolve [ HermiteH [ n, x ] == 0, x, p ]
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798,
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3,
++//    LC: QA47.M315.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 20.
++//
++//    Output, double W[N], the weights.
++//
++{
++  if ( n == 1 )
++  {
++    w[0] = 1.77245385090551602729816748334;
++  }
++  else if ( n == 2 )
++  {
++    w[0] = 0.886226925452758013649083741671E+00;
++    w[1] = 0.886226925452758013649083741671E+00;
++  }
++  else if ( n == 3 )
++  {
++    w[0] = 0.295408975150919337883027913890E+00;
++    w[1] = 0.118163590060367735153211165556E+01;
++    w[2] = 0.295408975150919337883027913890E+00;
++  }
++  else if ( n == 4 )
++  {
++    w[0] = 0.813128354472451771430345571899E-01;
++    w[1] = 0.804914090005512836506049184481E+00;
++    w[2] = 0.804914090005512836506049184481E+00;
++    w[3] = 0.813128354472451771430345571899E-01;
++  }
++  else if ( n == 5 )
++  {
++    w[0] = 0.199532420590459132077434585942E-01;
++    w[1] = 0.393619323152241159828495620852E+00;
++    w[2] = 0.945308720482941881225689324449E+00;
++    w[3] = 0.393619323152241159828495620852E+00;
++    w[4] = 0.199532420590459132077434585942E-01;
++  }
++  else if ( n == 6 )
++  {
++    w[0] = 0.453000990550884564085747256463E-02;
++    w[1] = 0.157067320322856643916311563508E+00;
++    w[2] = 0.724629595224392524091914705598E+00;
++    w[3] = 0.724629595224392524091914705598E+00;
++    w[4] = 0.157067320322856643916311563508E+00;
++    w[5] = 0.453000990550884564085747256463E-02;
++  }
++  else if ( n == 7 )
++  {
++    w[0] = 0.971781245099519154149424255939E-03;
++    w[1] = 0.545155828191270305921785688417E-01;
++    w[2] = 0.425607252610127800520317466666E+00;
++    w[3] = 0.810264617556807326764876563813E+00;
++    w[4] = 0.425607252610127800520317466666E+00;
++    w[5] = 0.545155828191270305921785688417E-01;
++    w[6] = 0.971781245099519154149424255939E-03;
++  }
++  else if ( n == 8 )
++  {
++    w[0] = 0.199604072211367619206090452544E-03;
++    w[1] = 0.170779830074134754562030564364E-01;
++    w[2] = 0.207802325814891879543258620286E+00;
++    w[3] = 0.661147012558241291030415974496E+00;
++    w[4] = 0.661147012558241291030415974496E+00;
++    w[5] = 0.207802325814891879543258620286E+00;
++    w[6] = 0.170779830074134754562030564364E-01;
++    w[7] = 0.199604072211367619206090452544E-03;
++  }
++  else if ( n == 9 )
++  {
++    w[0] = 0.396069772632643819045862946425E-04;
++    w[1] = 0.494362427553694721722456597763E-02;
++    w[2] = 0.884745273943765732879751147476E-01;
++    w[3] = 0.432651559002555750199812112956E+00;
++    w[4] = 0.720235215606050957124334723389E+00;
++    w[5] = 0.432651559002555750199812112956E+00;
++    w[6] = 0.884745273943765732879751147476E-01;
++    w[7] = 0.494362427553694721722456597763E-02;
++    w[8] = 0.396069772632643819045862946425E-04;
++  }
++  else if ( n == 10 )
++  {
++    w[0] =  0.764043285523262062915936785960E-05;
++    w[1] =  0.134364574678123269220156558585E-02;
++    w[2] =  0.338743944554810631361647312776E-01;
++    w[3] =  0.240138611082314686416523295006E+00;
++    w[4] =  0.610862633735325798783564990433E+00;
++    w[5] =  0.610862633735325798783564990433E+00;
++    w[6] =  0.240138611082314686416523295006E+00;
++    w[7] =  0.338743944554810631361647312776E-01;
++    w[8] =  0.134364574678123269220156558585E-02;
++    w[9] =  0.764043285523262062915936785960E-05;
++  }
++  else if ( n == 11 )
++  {
++    w[0] =  0.143956039371425822033088366032E-05;
++    w[1] =  0.346819466323345510643413772940E-03;
++    w[2] =  0.119113954449115324503874202916E-01;
++    w[3] =  0.117227875167708503381788649308E+00;
++    w[4] =  0.429359752356125028446073598601E+00;
++    w[5] =  0.654759286914591779203940657627E+00;
++    w[6] =  0.429359752356125028446073598601E+00;
++    w[7] =  0.117227875167708503381788649308E+00;
++    w[8] =  0.119113954449115324503874202916E-01;
++    w[9] =  0.346819466323345510643413772940E-03;
++    w[10] = 0.143956039371425822033088366032E-05;
++  }
++  else if ( n == 12 )
++  {
++    w[0] =  0.265855168435630160602311400877E-06;
++    w[1] =  0.857368704358785865456906323153E-04;
++    w[2] =  0.390539058462906185999438432620E-02;
++    w[3] =  0.516079856158839299918734423606E-01;
++    w[4] =  0.260492310264161129233396139765E+00;
++    w[5] =  0.570135236262479578347113482275E+00;
++    w[6] =  0.570135236262479578347113482275E+00;
++    w[7] =  0.260492310264161129233396139765E+00;
++    w[8] =  0.516079856158839299918734423606E-01;
++    w[9] =  0.390539058462906185999438432620E-02;
++    w[10] = 0.857368704358785865456906323153E-04;
++    w[11] = 0.265855168435630160602311400877E-06;
++  }
++  else if ( n == 13 )
++  {
++    w[0] =  0.482573185007313108834997332342E-07;
++    w[1] =  0.204303604027070731248669432937E-04;
++    w[2] =  0.120745999271938594730924899224E-02;
++    w[3] =  0.208627752961699392166033805050E-01;
++    w[4] =  0.140323320687023437762792268873E+00;
++    w[5] =  0.421616296898543221746893558568E+00;
++    w[6] =  0.604393187921161642342099068579E+00;
++    w[7] =  0.421616296898543221746893558568E+00;
++    w[8] =  0.140323320687023437762792268873E+00;
++    w[9] =  0.208627752961699392166033805050E-01;
++    w[10] = 0.120745999271938594730924899224E-02;
++    w[11] = 0.204303604027070731248669432937E-04;
++    w[12] = 0.482573185007313108834997332342E-07;
++  }
++  else if ( n == 14 )
++  {
++    w[0] =  0.862859116812515794532041783429E-08;
++    w[1] =  0.471648435501891674887688950105E-05;
++    w[2] =  0.355092613551923610483661076691E-03;
++    w[3] =  0.785005472645794431048644334608E-02;
++    w[4] =  0.685055342234652055387163312367E-01;
++    w[5] =  0.273105609064246603352569187026E+00;
++    w[6] =  0.536405909712090149794921296776E+00;
++    w[7] =  0.536405909712090149794921296776E+00;
++    w[8] =  0.273105609064246603352569187026E+00;
++    w[9] =  0.685055342234652055387163312367E-01;
++    w[10] = 0.785005472645794431048644334608E-02;
++    w[11] = 0.355092613551923610483661076691E-03;
++    w[12] = 0.471648435501891674887688950105E-05;
++    w[13] = 0.862859116812515794532041783429E-08;
++  }
++  else if ( n == 15 )
++  {
++    w[0] =  0.152247580425351702016062666965E-08;
++    w[1] =  0.105911554771106663577520791055E-05;
++    w[2] =  0.100004441232499868127296736177E-03;
++    w[3] =  0.277806884291277589607887049229E-02;
++    w[4] =  0.307800338725460822286814158758E-01;
++    w[5] =  0.158488915795935746883839384960E+00;
++    w[6] =  0.412028687498898627025891079568E+00;
++    w[7] =  0.564100308726417532852625797340E+00;
++    w[8] =  0.412028687498898627025891079568E+00;
++    w[9] =  0.158488915795935746883839384960E+00;
++    w[10] = 0.307800338725460822286814158758E-01;
++    w[11] = 0.277806884291277589607887049229E-02;
++    w[12] = 0.100004441232499868127296736177E-03;
++    w[13] = 0.105911554771106663577520791055E-05;
++    w[14] = 0.152247580425351702016062666965E-08;
++  }
++  else if ( n == 16 )
++  {
++    w[0] =  0.265480747401118224470926366050E-09;
++    w[1] =  0.232098084486521065338749423185E-06;
++    w[2] =  0.271186009253788151201891432244E-04;
++    w[3] =  0.932284008624180529914277305537E-03;
++    w[4] =  0.128803115355099736834642999312E-01;
++    w[5] =  0.838100413989858294154207349001E-01;
++    w[6] =  0.280647458528533675369463335380E+00;
++    w[7] =  0.507929479016613741913517341791E+00;
++    w[8] =  0.507929479016613741913517341791E+00;
++    w[9] =  0.280647458528533675369463335380E+00;
++    w[10] = 0.838100413989858294154207349001E-01;
++    w[11] = 0.128803115355099736834642999312E-01;
++    w[12] = 0.932284008624180529914277305537E-03;
++    w[13] = 0.271186009253788151201891432244E-04;
++    w[14] = 0.232098084486521065338749423185E-06;
++    w[15] = 0.265480747401118224470926366050E-09;
++  }
++  else if ( n == 17 )
++  {
++    w[0] =  0.458057893079863330580889281222E-10;
++    w[1] =  0.497707898163079405227863353715E-07;
++    w[2] =  0.711228914002130958353327376218E-05;
++    w[3] =  0.298643286697753041151336643059E-03;
++    w[4] =  0.506734995762753791170069495879E-02;
++    w[5] =  0.409200341495762798094994877854E-01;
++    w[6] =  0.172648297670097079217645196219E+00;
++    w[7] =  0.401826469470411956577635085257E+00;
++    w[8] =  0.530917937624863560331883103379E+00;
++    w[9] =  0.401826469470411956577635085257E+00;
++    w[10] = 0.172648297670097079217645196219E+00;
++    w[11] = 0.409200341495762798094994877854E-01;
++    w[12] = 0.506734995762753791170069495879E-02;
++    w[13] = 0.298643286697753041151336643059E-03;
++    w[14] = 0.711228914002130958353327376218E-05;
++    w[15] = 0.497707898163079405227863353715E-07;
++    w[16] = 0.458057893079863330580889281222E-10;
++  }
++  else if ( n == 18 )
++  {
++    w[0] =  0.782819977211589102925147471012E-11;
++    w[1] =  0.104672057957920824443559608435E-07;
++    w[2] =  0.181065448109343040959702385911E-05;
++    w[3] =  0.918112686792940352914675407371E-04;
++    w[4] =  0.188852263026841789438175325426E-02;
++    w[5] =  0.186400423875446519219315221973E-01;
++    w[6] =  0.973017476413154293308537234155E-01;
++    w[7] =  0.284807285669979578595606820713E+00;
++    w[8] =  0.483495694725455552876410522141E+00;
++    w[9] =  0.483495694725455552876410522141E+00;
++    w[10] = 0.284807285669979578595606820713E+00;
++    w[11] = 0.973017476413154293308537234155E-01;
++    w[12] = 0.186400423875446519219315221973E-01;
++    w[13] = 0.188852263026841789438175325426E-02;
++    w[14] = 0.918112686792940352914675407371E-04;
++    w[15] = 0.181065448109343040959702385911E-05;
++    w[16] = 0.104672057957920824443559608435E-07;
++    w[17] = 0.782819977211589102925147471012E-11;
++  }
++  else if ( n == 19 )
++  {
++    w[0] =  0.132629709449851575185289154385E-11;
++    w[1] =  0.216305100986355475019693077221E-08;
++    w[2] =  0.448824314722312295179447915594E-06;
++    w[3] =  0.272091977631616257711941025214E-04;
++    w[4] =  0.670877521407181106194696282100E-03;
++    w[5] =  0.798886677772299020922211491861E-02;
++    w[6] =  0.508103869090520673569908110358E-01;
++    w[7] =  0.183632701306997074156148485766E+00;
++    w[8] =  0.391608988613030244504042313621E+00;
++    w[9] =  0.502974888276186530840731361096E+00;
++    w[10] = 0.391608988613030244504042313621E+00;
++    w[11] = 0.183632701306997074156148485766E+00;
++    w[12] = 0.508103869090520673569908110358E-01;
++    w[13] = 0.798886677772299020922211491861E-02;
++    w[14] = 0.670877521407181106194696282100E-03;
++    w[15] = 0.272091977631616257711941025214E-04;
++    w[16] = 0.448824314722312295179447915594E-06;
++    w[17] = 0.216305100986355475019693077221E-08;
++    w[18] = 0.132629709449851575185289154385E-11;
++  }
++  else if ( n == 20 )
++  {
++    w[0] =  0.222939364553415129252250061603E-12;
++    w[1] =  0.439934099227318055362885145547E-09;
++    w[2] =  0.108606937076928169399952456345E-06;
++    w[3] =  0.780255647853206369414599199965E-05;
++    w[4] =  0.228338636016353967257145917963E-03;
++    w[5] =  0.324377334223786183218324713235E-02;
++    w[6] =  0.248105208874636108821649525589E-01;
++    w[7] =  0.109017206020023320013755033535E+00;
++    w[8] =  0.286675505362834129719659706228E+00;
++    w[9] =  0.462243669600610089650328639861E+00;
++    w[10] = 0.462243669600610089650328639861E+00;
++    w[11] = 0.286675505362834129719659706228E+00;
++    w[12] = 0.109017206020023320013755033535E+00;
++    w[13] = 0.248105208874636108821649525589E-01;
++    w[14] = 0.324377334223786183218324713235E-02;
++    w[15] = 0.228338636016353967257145917963E-03;
++    w[16] = 0.780255647853206369414599199965E-05;
++    w[17] = 0.108606937076928169399952456345E-06;
++    w[18] = 0.439934099227318055362885145547E-09;
++    w[19] = 0.222939364553415129252250061603E-12;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_LOOKUP_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::cerr << "  Legal values are 1 through 20.\n";
++    std::exit ( 1 );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_ss_compute ( int order, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_SS_COMPUTE computes a Hermite quadrature rule.
++//
++//  Discussion:
++//
++//    The abscissas are the zeros of the N-th order Hermite polynomial.
++//
++//    The integral:
++//
++//      Integral ( -oo < X < +oo ) exp ( - X * X ) * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double cc;
++  double dp2;
++  int i;
++  double p1;
++  double s;
++  double temp;
++  double x0;
++
++  if ( order < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "HERMITE_SS_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of ORDER = " << order << "\n";
++    std::exit ( 1 );
++  }
++
++  cc = 1.7724538509 * webbur::r8_gamma ( ( double ) ( order ) )
++    / std::pow ( 2.0, order - 1 );
++
++  s = std::pow ( 2.0 * ( double ) ( order ) + 1.0, 1.0 / 6.0 );
++
++  for ( i = 0; i < ( order + 1 ) / 2; i++ )
++  {
++    if ( i == 0 )
++    {
++      x0 = s * s * s - 1.85575 / s;
++    }
++    else if ( i == 1 )
++    {
++      x0 = x0 - 1.14 * std::pow ( ( double ) ( order ), 0.426 ) / x0;
++    }
++    else if ( i == 2 )
++    {
++      x0 = 1.86 * x0 - 0.86 * x[0];
++    }
++    else if ( i == 3 )
++    {
++      x0 = 1.91 * x0 - 0.91 * x[1];
++    }
++    else
++    {
++      x0 = 2.0 * x0 - x[i-2];
++    }
++
++    webbur::hermite_ss_root ( &x0, order, &dp2, &p1 );
++
++    x[i] = x0;
++    w[i] = ( cc / dp2 ) / p1;
++
++    x[order-i-1] = -x0;
++    w[order-i-1] = w[i];
++  }
++//
++//  Reverse the order of the abscissas.
++//
++  for ( i = 1; i <= order/2; i++ )
++  {
++    temp       = x[i-1];
++    x[i-1]     = x[order-i];
++    x[order-i] = temp;
++  }
++
++  if ( ( order % 2 ) == 1 )
++  {
++    x[(order-1)/2] = 0.0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_ss_recur ( double *p2, double *dp2, double *p1, double x, int order )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_SS_RECUR finds the value and derivative of a Hermite polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Output, double *P2, the value of H(ORDER)(X).
++//
++//    Output, double *DP2, the value of H'(ORDER)(X).
++//
++//    Output, double *P1, the value of H(ORDER-1)(X).
++//
++//    Input, double X, the point at which polynomials are evaluated.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++{
++  int i;
++  double dq0;
++  double dq1;
++  double dq2;
++  double q0;
++  double q1;
++  double q2;
++
++  q1 = 1.0;
++  dq1 = 0.0;
++
++  q2 = x;
++  dq2 = 1.0;
++
++  for ( i = 2; i <= order; i++ )
++  {
++    q0 = q1;
++    dq0 = dq1;
++
++    q1 = q2;
++    dq1 = dq2;
++
++    q2  = x * q1 - 0.5 * ( ( double ) ( i ) - 1.0 ) * q0;
++    dq2 = x * dq1 + q1 - 0.5 * ( ( double ) ( i ) - 1.0 ) * dq0;
++  }
++
++  *p2 = q2;
++  *dp2 = dq2;
++  *p1 = q1;
++
++  return;
++}
++//****************************************************************************80
++
++void hermite_ss_root ( double *x, int order, double *dp2, double *p1 )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    HERMITE_SS_ROOT improves an approximate root of a Hermite polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input/output, double *X, the approximate root, which
++//    should be improved on output.
++//
++//    Input, int ORDER, the order of the Hermite polynomial.
++//
++//    Output, double *DP2, the value of H'(ORDER)(X).
++//
++//    Output, double *P1, the value of H(ORDER-1)(X).
++//
++{
++  double d;
++  double eps;
++  double p2;
++  int step;
++  int step_max = 10;
++
++  eps = webbur::r8_epsilon ( );
++
++  for ( step = 1; step <= step_max; step++ )
++  {
++    webbur::hermite_ss_recur ( &p2, dp2, p1, *x, order );
++
++    d = p2 / ( *dp2 );
++    *x = *x - d;
++
++    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
++    {
++      return;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++int i4_choose ( int n, int k )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4_CHOOSE computes the binomial coefficient C(N,K).
++//
++//  Discussion:
++//
++//    The value is calculated in such a way as to avoid overflow and
++//    roundoff.  The calculation is done in integer arithmetic.
++//
++//    The formula used is:
++//
++//      C(N,K) = N! / ( K! * (N-K)! )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    09 November 2007
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    ML Wolfson, HV Wright,
++//    Algorithm 160:
++//    Combinatorial of M Things Taken N at a Time,
++//    Communications of the ACM,
++//    Volume 6, Number 4, April 1963, page 161.
++//
++//  Parameters:
++//
++//    Input, int N, K, the values of N and K.
++//
++//    Output, int I4_CHOOSE, the number of combinations of N
++//    things taken K at a time.
++//
++{
++  int i;
++  int mn;
++  int mx;
++  int value;
++
++  mn = i4_min ( k, n - k );
++
++  if ( mn < 0 )
++  {
++    value = 0;
++  }
++  else if ( mn == 0 )
++  {
++    value = 1;
++  }
++  else
++  {
++    mx = i4_max ( k, n - k );
++    value = mx + 1;
++
++    for ( i = 2; i <= mn; i++ )
++    {
++      value = ( value * ( mx + i ) ) / i;
++    }
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++int i4_log_2 ( int i )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4_LOG_2 returns the integer part of the logarithm base 2 of an I4.
++//
++//  Example:
++//
++//        I  I4_LOG_10
++//    -----  --------
++//        0    0
++//        1    0
++//        2    1
++//        3    1
++//        4    2
++//        5    2
++//        7    2
++//        8    3
++//        9    3
++//     1000    9
++//     1024   10
++//
++//  Discussion:
++//
++//    I4_LOG_2 ( I ) + 1 is the number of binary digits in I.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 January 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int I, the number whose logarithm base 2 is desired.
++//
++//    Output, int I4_LOG_2, the integer part of the logarithm base 2 of
++//    the absolute value of X.
++//
++{
++  int i_abs;
++  int two_pow;
++  int value;
++
++  if ( i == 0 )
++  {
++    value = 0;
++  }
++  else
++  {
++    value = 0;
++    two_pow = 2;
++
++    i_abs = std::abs ( i );
++
++    while ( two_pow <= i_abs )
++    {
++      value = value + 1;
++      two_pow = two_pow * 2;
++    }
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++int i4_max ( int i1, int i2 )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4_MAX returns the maximum of two I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 October 1998
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int I1, I2, are two integers to be compared.
++//
++//    Output, int I4_MAX, the larger of I1 and I2.
++//
++{
++  int value;
++
++  if ( i2 < i1 )
++  {
++    value = i1;
++  }
++  else
++  {
++    value = i2;
++  }
++  return value;
++}
++//****************************************************************************80
++
++int i4_min ( int i1, int i2 )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4_MIN returns the minimum of two I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 October 1998
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int I1, I2, two integers to be compared.
++//
++//    Output, int I4_MIN, the smaller of I1 and I2.
++//
++{
++  int value;
++
++  if ( i1 < i2 )
++  {
++    value = i1;
++  }
++  else
++  {
++    value = i2;
++  }
++  return value;
++}
++//****************************************************************************80
++
++int i4_power ( int i, int j )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4_POWER returns the value of I^J.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 April 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int I, J, the base and the power.  J should be nonnegative.
++//
++//    Output, int I4_POWER, the value of I^J.
++//
++{
++  int k;
++  int value;
++
++  if ( j < 0 )
++  {
++    if ( i == 1 )
++    {
++      value = 1;
++    }
++    else if ( i == 0 )
++    {
++      std::cerr << "\n";
++      std::cerr << "I4_POWER - Fatal error!\n";
++      std::cerr << "  I^J requested, with I = 0 and J negative.\n";
++      std::exit ( 1 );
++    }
++    else
++    {
++      value = 0;
++    }
++  }
++  else if ( j == 0 )
++  {
++    if ( i == 0 )
++    {
++      std::cerr << "\n";
++      std::cerr << "I4_POWER - Fatal error!\n";
++      std::cerr << "  I^J requested, with I = 0 and J = 0.\n";
++      std::exit ( 1 );
++    }
++    else
++    {
++      value = 1;
++    }
++  }
++  else if ( j == 1 )
++  {
++    value = i;
++  }
++  else
++  {
++    value = 1;
++    for ( k = 1; k <= j; k++ )
++    {
++      value = value * i;
++    }
++  }
++  return value;
++}
++//****************************************************************************80
++
++void i4mat_copy ( int m, int n, int a1[], int a2[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4MAT_COPY copies one I4MAT to another.
++//
++//  Discussion:
++//
++//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 August 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input, int A1[M*N], the matrix to be copied.
++//
++//    Output, int A2[M*N], the copy of A1.
++//
++{
++  int i;
++  int j;
++
++  for ( j = 0; j < n; j++ )
++  {
++    for ( i = 0; i < m; i++ )
++    {
++      a2[i+j*m] = a1[i+j*m];
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++int *i4mat_copy_new ( int m, int n, int a1[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4MAT_COPY_NEW copies an I4MAT to a "new" I4MAT.
++//
++//  Discussion:
++//
++//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 August 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input, int A1[M*N], the matrix to be copied.
++//
++//    Output, int I4MAT_COPY_NEW[M*N], the copy of A1.
++//
++{
++  int *a2;
++  int i;
++  int j;
++
++  a2 = new int[m*n];
++
++  for ( j = 0; j < n; j++ )
++  {
++    for ( i = 0; i < m; i++ )
++    {
++      a2[i+j*m] = a1[i+j*m];
++    }
++  }
++  return a2;
++}
++//****************************************************************************80
++
++void i4mat_transpose_print ( int m, int n, int a[], std::string title )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
++//
++//  Discussion:
++//
++//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 January 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows in A.
++//
++//    Input, int N, the number of columns in A.
++//
++//    Input, int A[M*N], the M by N matrix.
++//
++//    Input, string TITLE, a title.
++//
++{
++  i4mat_transpose_print_some ( m, n, a, 1, 1, m, n, title );
++
++  return;
++}
++//****************************************************************************80
++
++void i4mat_transpose_print_some ( int m, int n, int a[], int ilo, int jlo,
++  int ihi, int jhi, std::string title )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.
++//
++//  Discussion:
++//
++//    An I4MAT is an MxN array of I4's, stored by (I,J) -> [I+J*M].
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    14 June 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows of the matrix.
++//    M must be positive.
++//
++//    Input, int N, the number of columns of the matrix.
++//    N must be positive.
++//
++//    Input, int A[M*N], the matrix.
++//
++//    Input, int ILO, JLO, IHI, JHI, designate the first row and
++//    column, and the last row and column to be printed.
++//
++//    Input, string TITLE, a title.
++//
++{
++# define INCX 10
++
++  int i;
++  int i2hi;
++  int i2lo;
++  int j;
++  int j2hi;
++  int j2lo;
++
++  std::cout << "\n";
++  std::cout << title << "\n";
++//
++//  Print the columns of the matrix, in strips of INCX.
++//
++  for ( i2lo = ilo; i2lo <= ihi; i2lo = i2lo + INCX )
++  {
++    i2hi = i2lo + INCX - 1;
++    i2hi = webbur::i4_min ( i2hi, m );
++    i2hi = webbur::i4_min ( i2hi, ihi );
++
++    std::cout << "\n";
++//
++//  For each row I in the current range...
++//
++//  Write the header.
++//
++    std::cout << "  Row: ";
++    for ( i = i2lo; i <= i2hi; i++ )
++    {
++      std::cout << std::setw(6) << i - 1 << "  ";
++    }
++    std::cout << "\n";
++    std::cout << "  Col\n";
++    std::cout << "\n";
++//
++//  Determine the range of the rows in this strip.
++//
++    j2lo = webbur::i4_max ( jlo, 1 );
++    j2hi = webbur::i4_min ( jhi, n );
++
++    for ( j = j2lo; j <= j2hi; j++ )
++    {
++//
++//  Print out (up to INCX) entries in column J, that lie in the current strip.
++//
++      std::cout << std::setw(5) << j - 1 << ":";
++      for ( i = i2lo; i <= i2hi; i++ )
++      {
++        std::cout << std::setw(6) << a[i-1+(j-1)*m] << "  ";
++      }
++      std::cout << "\n";
++    }
++  }
++
++  return;
++# undef INCX
++}
++//****************************************************************************80
++
++void i4mat_write ( std::string output_filename, int m, int n, int table[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4MAT_WRITE writes an I4MAT file.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, string OUTPUT_FILENAME, the output filename.
++//
++//    Input, int M, the spatial dimension.
++//
++//    Input, int N, the number of points.
++//
++//    Input, int TABLE[M*N], the table data.
++//
++{
++  int i;
++  int j;
++  std::ofstream output;
++//
++//  Open the file.
++//
++  output.open ( output_filename.c_str ( ) );
++
++  if ( !output )
++  {
++    std::cerr << "\n";
++    std::cerr << "I4MAT_WRITE - Fatal error!\n";
++    std::cerr << "  Could not open the output file.\n";
++    return;
++  }
++//
++//  Write the data.
++//
++  for ( j = 0; j < n; j++ )
++  {
++    for ( i = 0; i < m; i++ )
++    {
++      output << std::setw(10) << table[i+j*m] << "  ";
++    }
++    output << "\n";
++  }
++//
++//  Close the file.
++//
++  output.close ( );
++
++  return;
++}
++//****************************************************************************80
++
++int *i4vec_add_new ( int n, int a[], int b[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_ADD_NEW computes C = A + B for I4VEC's.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    28 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries.
++//
++//    Input, int A[N], the first vector.
++//
++//    Input, int B[N], the second vector.
++//
++//    Output, int I4VEC_ADD_NEW[N], the sum of the vectors.
++//
++{
++  int *c;
++  int i;
++
++  c = new int[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    c[i] = a[i] + b[i];
++  }
++  return c;
++}
++//****************************************************************************80
++
++bool i4vec_any_lt ( int n, int a[], int b[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_ANY_LT: ( any ( A < B ) ) for I4VEC's.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    28 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries.
++//
++//    Input, int A[N], the first vector.
++//
++//    Input, int B[N], the second vector.
++//
++//    Output, bool I4VEC_ANY_LT is TRUE if any entry
++//    of A is less than the corresponding entry of B.
++//
++{
++  int i;
++  bool value;
++
++  for ( i = 0; i < n; i++ )
++  {
++    if ( a[i] < b[i] )
++    {
++      value = true;
++      return value;
++    }
++  }
++  value = false;
++
++  return value;
++}
++//****************************************************************************80
++
++void i4vec_copy ( int n, int a1[], int a2[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_COPY copies an I4VEC.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    25 April 2007
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input, int A1[N], the vector to be copied.
++//
++//    Output, int A2[N], the copy of A1.
++//
++{
++  int i;
++
++  for ( i = 0; i < n; i++ )
++  {
++    a2[i] = a1[i];
++  }
++  return;
++}
++//****************************************************************************80
++
++int *i4vec_copy_new ( int n, int a1[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_COPY_NEW copies an I4VEC to a "new" I4VEC.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 July 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input, int A1[N], the vector to be copied.
++//
++//    Output, int I4VEC_COPY_NEW[N], the copy of A1.
++//
++{
++  int *a2;
++  int i;
++
++  a2 = new int[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    a2[i] = a1[i];
++  }
++  return a2;
++}
++//****************************************************************************80
++
++void i4vec_min_mv ( int m, int n, int u[], int v[], int w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_MIN_MV determines U(1:N) /\ V for vectors U and a single vector V.
++//
++//  Discussion:
++//
++//    For two vectors U and V, each of length M, we define
++//
++//      ( U /\ V ) (I) = min ( U(I), V(I) ).
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    12 January 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the dimension of the vectors.
++//
++//    Input, int N, the number of vectors in U.
++//
++//    Input, int U[M*N], N vectors, each of length M.
++//
++//    Input, int V[M], a vector of length M.
++//
++//    Output, int W[M*N], the value of U /\ W.
++//
++{
++  int i;
++  int j;
++
++  for ( j = 0; j < n; j++ )
++  {
++    for ( i = 0; i < m; i++ )
++    {
++      w[i+j*m] = i4_min ( u[i+j*m], v[i] );
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void i4vec_print ( int n, int a[], std::string title )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_PRINT prints an I4VEC.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    14 November 2003
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of components of the vector.
++//
++//    Input, int A[N], the vector to be printed.
++//
++//    Input, string TITLE, a title.
++//
++{
++  int i;
++
++  std::cout << "\n";
++  std::cout << title << "\n";
++  std::cout << "\n";
++  for ( i = 0; i < n; i++ )
++  {
++    std::cout << "  " << std::setw(8) << i
++              << ": " << std::setw(8) << a[i]  << "\n";
++  }
++  return;
++}
++//****************************************************************************80
++
++int i4vec_product ( int n, int a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_PRODUCT multiplies the entries of an I4VEC.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of integer values.
++//
++//  Example:
++//
++//    Input:
++//
++//      A = ( 1, 2, 3, 4 )
++//
++//    Output:
++//
++//      I4VEC_PRODUCT = 24
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 May 2003
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input, int A[N], the vector
++//
++//    Output, int I4VEC_PRODUCT, the product of the entries of A.
++//
++{
++  int i;
++  int product;
++
++  product = 1;
++  for ( i = 0; i < n; i++ )
++  {
++    product = product * a[i];
++  }
++
++  return product;
++}
++//****************************************************************************80
++
++int i4vec_sum ( int n, int a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_SUM sums the entries of an I4VEC.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Example:
++//
++//    Input:
++//
++//      A = ( 1, 2, 3, 4 )
++//
++//    Output:
++//
++//      I4VEC_SUM = 10
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    04 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input, int A[N], the vector to be summed.
++//
++//    Output, int I4VEC_SUM, the sum of the entries of A.
++//
++{
++  int i;
++  int sum;
++
++  sum = 0;
++  for ( i = 0; i < n; i++ )
++  {
++    sum = sum + a[i];
++  }
++
++  return sum;
++}
++//****************************************************************************80
++
++void i4vec_zero ( int n, int a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_ZERO zeroes an I4VEC.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 August 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Output, int A[N], a vector of zeroes.
++//
++{
++  int i;
++
++  for ( i = 0; i < n; i++ )
++  {
++    a[i] = 0;
++  }
++  return;
++}
++//****************************************************************************80
++
++int *i4vec_zero_new ( int n )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    I4VEC_ZERO_NEW creates and zeroes an I4VEC.
++//
++//  Discussion:
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    11 July 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Output, int I4VEC_ZERO_NEW[N], a vector of zeroes.
++//
++{
++  int *a;
++  int i;
++
++  a = new int[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    a[i] = 0;
++  }
++  return a;
++}
++//****************************************************************************80
++
++void imtqlx ( int n, double d[], double e[], double z[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    IMTQLX diagonalizes a symmetric tridiagonal matrix.
++//
++//  Discussion:
++//
++//    This routine is a slightly modified version of the EISPACK routine to
++//    perform the implicit QL algorithm on a symmetric tridiagonal matrix.
++//
++//    The authors thank the authors of EISPACK for permission to use this
++//    routine.
++//
++//    It has been modified to produce the product Q' * Z, where Z is an input
++//    vector and Q is the orthogonal matrix diagonalizing the input matrix.
++//    The changes consist (essentially) of applying the orthogonal transformations
++//    directly to Z as they are generated.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    08 January 2010
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Sylvan Elhay, Jaroslav Kautsky,
++//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
++//    Interpolatory Quadrature,
++//    ACM Transactions on Mathematical Software,
++//    Volume 13, Number 4, December 1987, pages 399-415.
++//
++//    Roger Martin, James Wilkinson,
++//    The Implicit QL Algorithm,
++//    Numerische Mathematik,
++//    Volume 12, Number 5, December 1968, pages 377-383.
++//
++//  Parameters:
++//
++//    Input, int N, the order of the matrix.
++//
++//    Input/output, double D(N), the diagonal entries of the matrix.
++//    On output, the information in D has been overwritten.
++//
++//    Input/output, double E(N), the subdiagonal entries of the
++//    matrix, in entries E(1) through E(N-1).  On output, the information in
++//    E has been overwritten.
++//
++//    Input/output, double Z(N).  On input, a vector.  On output,
++//    the value of Q' * Z, where Q is the matrix that diagonalizes the
++//    input symmetric tridiagonal matrix.
++//
++{
++  double b;
++  double c;
++  double f;
++  double g;
++  int i;
++  int ii;
++  int itn = 30;
++  int j;
++  int k;
++  int l;
++  int m;
++  int mml;
++  double p;
++  double prec;
++  double r;
++  double s;
++
++  prec = webbur::r8_epsilon ( );
++
++  if ( n == 1 )
++  {
++    return;
++  }
++
++  e[n-1] = 0.0;
++
++  for ( l = 1; l <= n; l++ )
++  {
++    j = 0;
++    for ( ; ; )
++    {
++      for ( m = l; m <= n; m++ )
++      {
++        if ( m == n )
++        {
++          break;
++        }
++
++        if ( webbur::r8_abs ( e[m-1] ) <=
++          prec * ( webbur::r8_abs ( d[m-1] ) + webbur::r8_abs ( d[m] ) ) )
++        {
++          break;
++        }
++      }
++      p = d[l-1];
++      if ( m == l )
++      {
++        break;
++      }
++      if ( itn <= j )
++      {
++        std::cerr << "\n";
++        std::cerr << "IMTQLX - Fatal error!\n";
++        std::cerr << "  Iteration limit exceeded\n";
++        std::exit ( 1 );
++      }
++      j = j + 1;
++      g = ( d[l] - p ) / ( 2.0 * e[l-1] );
++      r = std::sqrt ( g * g + 1.0 );
++      g = d[m-1] - p + e[l-1] / ( g + webbur::r8_abs ( r ) * webbur::r8_sign ( g ) );
++      s = 1.0;
++      c = 1.0;
++      p = 0.0;
++      mml = m - l;
++
++      for ( ii = 1; ii <= mml; ii++ )
++      {
++        i = m - ii;
++        f = s * e[i-1];
++        b = c * e[i-1];
++
++        if ( webbur::r8_abs ( g ) <= webbur::r8_abs ( f ) )
++        {
++          c = g / f;
++          r = std::sqrt ( c * c + 1.0 );
++          e[i] = f * r;
++          s = 1.0 / r;
++          c = c * s;
++        }
++        else
++        {
++          s = f / g;
++          r = std::sqrt ( s * s + 1.0 );
++          e[i] = g * r;
++          c = 1.0 / r;
++          s = s * c;
++        }
++        g = d[i] - p;
++        r = ( d[i-1] - g ) * s + 2.0 * c * b;
++        p = s * r;
++        d[i] = g + p;
++        g = c * r - b;
++        f = z[i];
++        z[i] = s * z[i-1] + c * f;
++        z[i-1] = c * z[i-1] - s * f;
++      }
++      d[l-1] = d[l-1] - p;
++      e[l-1] = g;
++      e[m-1] = 0.0;
++    }
++  }
++//
++//  Sorting.
++//
++  for ( ii = 2; ii <= m; ii++ )
++  {
++    i = ii - 1;
++    k = i;
++    p = d[i-1];
++
++    for ( j = ii; j <= n; j++ )
++    {
++      if ( d[j-1] < p )
++      {
++         k = j;
++         p = d[j-1];
++      }
++    }
++
++    if ( k != i )
++    {
++      d[k-1] = d[i-1];
++      d[i-1] = p;
++      p = z[i-1];
++      z[i-1] = z[k-1];
++      z[k-1] = p;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void jacobi_compute ( int n, double alpha, double beta, double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_COMPUTE: Elhay-Kautsky method for Gauss-Jacobi quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) (1-X)**ALPHA * (1+X)**BETA * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) WEIGHT(I) * F ( XTAB(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    30 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Sylvan Elhay, Jaroslav Kautsky,
++//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
++//    Interpolatory Quadrature,
++//    ACM Transactions on Mathematical Software,
++//    Volume 13, Number 4, December 1987, pages 399-415.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, double ALPHA, BETA, the exponents of (1-X) and
++//    (1+X) in the quadrature rule.  For simple Gauss-Legendre quadrature,
++//    set ALPHA = BETA = 0.0.  -1.0 < ALPHA and -1.0 < BETA are required.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double abi;
++  double *bj;
++  int i;
++  double i_r8;
++  double zemu;
++//
++//  Define the zero-th moment.
++//
++  zemu = std::pow ( 2.0, alpha + beta + 1.0 )
++    * webbur::r8_gamma ( alpha + 1.0 )
++    * webbur::r8_gamma ( beta + 1.0 )
++    / webbur::r8_gamma ( 2.0 + alpha + beta );
++//
++//  Define the Jacobi matrix.
++//
++  bj = new double[n];
++
++  x[0] = ( beta - alpha ) / ( 2.0 + alpha + beta );
++
++  bj[0] = 4.0 * ( 1.0 + alpha ) * ( 1.0 + beta )
++    / ( ( 3.0 + alpha + beta )
++      * ( 2.0 + alpha + beta ) * ( 2.0 + alpha + beta ) );
++
++  for ( i = 1; i < n; i++ )
++  {
++    i_r8 = ( double ) ( i + 1 );
++    abi = 2.0 * i_r8 + alpha + beta;
++    x[i] = ( beta + alpha ) * ( beta - alpha ) / ( ( abi - 2.0 ) * abi );
++    bj[i] = 4.0 * i_r8 * ( i_r8 + alpha ) * ( i_r8 + beta )
++      * ( i_r8 + alpha + beta )
++      / ( ( abi - 1.0 ) * ( abi + 1.0 ) * abi * abi );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    bj[i] = std::sqrt ( bj[i] );
++  }
++
++  w[0] = std::sqrt ( zemu );
++
++  for ( i = 1; i < n; i++ )
++  {
++    w[i] = 0.0;
++  }
++//
++//  Diagonalize the Jacobi matrix.
++//
++  webbur::imtqlx ( n, x, bj, w );
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = w[i] * w[i];
++  }
++
++  delete [] bj;
++
++  return;
++}
++//****************************************************************************80
++
++void jacobi_compute_np ( int order, int np, double p[], double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_COMPUTE_NP computes a Jacobi quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) (1-X)^ALPHA * (1+X)^BETA * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//    Thanks to Xu Xiang of Fudan University for pointing out that
++//    an earlier implementation of this routine was incorrect!
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameter values.
++//    P[0] = ALPHA, the exponent of (1-X)
++//    P[1] = BETA,  the exponent of (1+X).
++//    -1.0 < ALPHA and -1.0 < BETA are required.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++  double beta;
++
++  alpha = p[0];
++  beta = p[1];
++
++  webbur::jacobi_compute ( order, alpha, beta, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void jacobi_compute_points ( int order, double alpha, double beta,
++  double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_COMPUTE_POINTS computes Jacobi quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    14 October 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, double ALPHA, BETA, the exponents of the (1-X) and (1+X) factors.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double *w;
++
++  w = new double[order];
++
++  webbur::jacobi_compute ( order, alpha, beta, x, w );
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void jacobi_compute_points_np ( int order, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_COMPUTE_POINTS_NP computes Jacobi quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameter values.
++//    P[0] = ALPHA, the exponent of (1-X)
++//    P[1] = BETA,  the exponent of (1+X).
++//    -1.0 < ALPHA and -1.0 < BETA are required.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double alpha;
++  double beta;
++
++  alpha = p[0];
++  beta = p[1];
++
++  webbur::jacobi_compute_points ( order, alpha, beta, x );
++
++  return;
++}
++//****************************************************************************80
++
++void jacobi_compute_weights ( int order, double alpha, double beta,
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_COMPUTE_WEIGHTS computes Jacobi quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    14 October 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, double ALPHA, BETA, the exponents of the (1-X) and (1+X) factors.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *x;
++
++  x = new double[order];
++
++  webbur::jacobi_compute ( order, alpha, beta, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void jacobi_compute_weights_np ( int order, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_COMPUTE_WEIGHTS_NP computes Jacobi quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameter values.
++//    P[0] = ALPHA, the exponent of (1-X)
++//    P[1] = BETA,  the exponent of (1+X).
++//    -1.0 < ALPHA and -1.0 < BETA are required.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double alpha;
++  double beta;
++
++  alpha = p[0];
++  beta = p[1];
++
++  webbur::jacobi_compute_weights ( order, alpha, beta, w );
++
++  return;
++}
++//****************************************************************************80
++
++double jacobi_integral ( int expon, double alpha, double beta )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_INTEGRAL integrates a monomial with Jacobi weight.
++//
++//  Discussion:
++//
++//    VALUE = Integral ( -1 <= X <= +1 ) x^EXPON (1-x)^ALPHA (1+x)^BETA dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    08 September 2007
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent.
++//
++//    Input, double ALPHA, the exponent of (1-X) in the weight factor.
++//
++//    Input, double BETA, the exponent of (1+X) in the weight factor.
++//
++//    Output, double JACOBI_INTEGRAL, the value of the integral.
++//
++{
++  double arg1;
++  double arg2;
++  double arg3;
++  double arg4;
++  double c;
++  double s;
++  double value;
++  double value1;
++  double value2;
++
++  c = ( double ) ( expon );
++
++  if ( ( expon % 2 ) == 0 )
++  {
++    s = +1.0;
++  }
++  else
++  {
++    s = -1.0;
++  }
++
++  arg1 = - alpha;
++  arg2 =   1.0 + c;
++  arg3 =   2.0 + beta + c;
++  arg4 = - 1.0;
++
++  value1 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
++
++  arg1 = - beta;
++  arg2 =   1.0 + c;
++  arg3 =   2.0 + alpha + c;
++  arg4 = - 1.0;
++
++  value2 = webbur::r8_hyper_2f1 ( arg1, arg2, arg3, arg4 );
++
++  value = webbur::r8_gamma ( 1.0 + c ) * (
++      s * webbur::r8_gamma ( 1.0 + beta  ) * value1
++    / webbur::r8_gamma ( 2.0 + beta  + c )
++    +     webbur::r8_gamma ( 1.0 + alpha ) * value2
++    / webbur::r8_gamma ( 2.0 + alpha + c ) );
++
++  return value;
++}
++//****************************************************************************80
++
++void jacobi_ss_compute ( int order, double alpha, double beta, double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_SS_COMPUTE computes a Jacobi quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) (1-X)^ALPHA * (1+X)^BETA * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//    Thanks to Xu Xiang of Fudan University for pointing out that
++//    an earlier implementation of this routine was incorrect!
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 February 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, double ALPHA, BETA, the exponents of (1-X) and
++//    (1+X) in the quadrature rule.  For simple Legendre quadrature,
++//    set ALPHA = BETA = 0.0.  -1.0 < ALPHA and -1.0 < BETA are required.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double an;
++  double *b;
++  double bn;
++  double *c;
++  double cc;
++  double delta;
++  double dp2;
++  int i;
++  double p1;
++  double prod;
++  double r1;
++  double r2;
++  double r3;
++  double temp;
++  double x0;
++
++  if ( order < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of ORDER = " << order << "\n";
++    std::exit ( 1 );
++  }
++
++  b = new double[order];
++  c = new double[order];
++//
++//  Check ALPHA and BETA.
++//
++  if ( alpha <= -1.0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
++    std::cerr << "  -1.0 < ALPHA is required.\n";
++    std::exit ( 1 );
++  }
++
++  if ( beta <= -1.0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "JACOBI_SS_COMPUTE - Fatal error!\n";
++    std::cerr << "  -1.0 < BETA is required.\n";
++    std::exit ( 1 );
++  }
++//
++//  Set the recursion coefficients.
++//
++  for ( i = 1; i <= order; i++ )
++  {
++    if ( alpha + beta == 0.0 || beta - alpha == 0.0 )
++    {
++      b[i-1] = 0.0;
++    }
++    else
++    {
++      b[i-1] = ( alpha + beta ) * ( beta - alpha ) /
++             ( ( alpha + beta + ( double ) ( 2 * i ) )
++             * ( alpha + beta + ( double ) ( 2 * i - 2 ) ) );
++    }
++
++    if ( i == 1 )
++    {
++      c[i-1] = 0.0;
++    }
++    else
++    {
++      c[i-1] = 4.0 * ( double ) ( i - 1 )
++         * ( alpha + ( double ) ( i - 1 ) )
++          * ( beta + ( double ) ( i - 1 ) )
++            * ( alpha + beta + ( double ) ( i - 1 ) ) /
++            ( ( alpha + beta + ( double ) ( 2 * i - 1 ) )
++            * std::pow ( alpha + beta + ( double ) ( 2 * i - 2 ), 2 )
++            * ( alpha + beta + ( double ) ( 2 * i - 3 ) ) );
++    }
++  }
++
++  delta = webbur::r8_gamma ( alpha        + 1.0 )
++        * webbur::r8_gamma (         beta + 1.0 )
++        / webbur::r8_gamma ( alpha + beta + 2.0 );
++
++  prod = 1.0;
++  for ( i = 2; i <= order; i++ )
++  {
++    prod = prod * c[i-1];
++  }
++  cc = delta * std::pow ( 2.0, alpha + beta + 1.0 ) * prod;
++
++  for ( i = 1; i <= order; i++ )
++  {
++    if ( i == 1 )
++    {
++      an = alpha / ( double ) ( order );
++      bn = beta / ( double ) ( order );
++
++      r1 = ( 1.0 + alpha )
++        * ( 2.78 / ( 4.0 + ( double ) ( order * order ) )
++        + 0.768 * an / ( double ) ( order ) );
++
++      r2 = 1.0 + 1.48 * an + 0.96 * bn
++        + 0.452 * an * an + 0.83 * an * bn;
++
++      x0 = ( r2 - r1 ) / r2;
++    }
++    else if ( i == 2 )
++    {
++      r1 = ( 4.1 + alpha ) /
++        ( ( 1.0 + alpha ) * ( 1.0 + 0.156 * alpha ) );
++
++      r2 = 1.0 + 0.06 * ( ( double ) ( order ) - 8.0 ) *
++        ( 1.0 + 0.12 * alpha ) / ( double ) ( order );
++
++      r3 = 1.0 + 0.012 * beta *
++        ( 1.0 + 0.25 * r8_abs ( alpha ) ) / ( double ) ( order );
++
++      x0 = x0 - r1 * r2 * r3 * ( 1.0 - x0 );
++    }
++    else if ( i == 3 )
++    {
++      r1 = ( 1.67 + 0.28 * alpha ) / ( 1.0 + 0.37 * alpha );
++
++      r2 = 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
++        / ( double ) ( order );
++
++      r3 = 1.0 + 8.0 * beta /
++        ( ( 6.28 + beta ) * ( double ) ( order * order ) );
++
++      x0 = x0 - r1 * r2 * r3 * ( x[0] - x0 );
++    }
++    else if ( i < order - 1 )
++    {
++      x0 = 3.0 * x[i-2] - 3.0 * x[i-3] + x[i-4];
++    }
++    else if ( i == order - 1 )
++    {
++      r1 = ( 1.0 + 0.235 * beta ) / ( 0.766 + 0.119 * beta );
++
++      r2 = 1.0 / ( 1.0 + 0.639
++        * ( ( double ) ( order ) - 4.0 )
++        / ( 1.0 + 0.71 * ( ( double ) ( order ) - 4.0 ) ) );
++
++      r3 = 1.0 / ( 1.0 + 20.0 * alpha / ( ( 7.5 + alpha ) *
++        ( double ) ( order * order ) ) );
++
++      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
++    }
++    else if ( i == order )
++    {
++      r1 = ( 1.0 + 0.37 * beta ) / ( 1.67 + 0.28 * beta );
++
++      r2 = 1.0 /
++        ( 1.0 + 0.22 * ( ( double ) ( order ) - 8.0 )
++        / ( double ) ( order ) );
++
++      r3 = 1.0 / ( 1.0 + 8.0 * alpha /
++        ( ( 6.28 + alpha ) * ( double ) ( order * order ) ) );
++
++      x0 = x0 + r1 * r2 * r3 * ( x0 - x[i-3] );
++    }
++
++    webbur::jacobi_ss_root ( &x0, order, alpha, beta, &dp2, &p1, b, c );
++
++    x[i-1] = x0;
++    w[i-1] = cc / ( dp2 * p1 );
++  }
++//
++//  Reverse the order of the values.
++//
++  for ( i = 1; i <= order/2; i++ )
++  {
++    temp       = x[i-1];
++    x[i-1]     = x[order-i];
++    x[order-i] = temp;
++  }
++
++  for ( i = 1; i <=order/2; i++ )
++  {
++    temp       = w[i-1];
++    w[i-1]     = w[order-i];
++    w[order-i] = temp;
++  }
++
++  delete [] b;
++  delete [] c;
++
++  return;
++}
++//****************************************************************************80
++
++void jacobi_ss_recur ( double *p2, double *dp2, double *p1, double x, int order,
++  double alpha, double beta, double b[], double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_SS_RECUR evaluates a Jacobi polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 February 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Output, double *P2, the value of J(ORDER)(X).
++//
++//    Output, double *DP2, the value of J'(ORDER)(X).
++//
++//    Output, double *P1, the value of J(ORDER-1)(X).
++//
++//    Input, double X, the point at which polynomials are evaluated.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Input, double ALPHA, BETA, the exponents of (1-X) and
++//    (1+X) in the quadrature rule.
++//
++//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
++//
++{
++  double dp0;
++  double dp1;
++  int i;
++  double p0;
++
++  *p1 = 1.0;
++  dp1 = 0.0;
++
++  *p2 = x + ( alpha - beta ) / ( alpha + beta + 2.0 );
++  *dp2 = 1.0;
++
++  for ( i = 2; i <= order; i++ )
++  {
++    p0 = *p1;
++    dp0 = dp1;
++
++    *p1 = *p2;
++    dp1 = *dp2;
++
++    *p2 = ( x - b[i-1] ) *  ( *p1 ) - c[i-1] * p0;
++    *dp2 = ( x - b[i-1] ) * dp1 + ( *p1 ) - c[i-1] * dp0;
++  }
++  return;
++}
++//****************************************************************************80
++
++void jacobi_ss_root ( double *x, int order, double alpha, double beta,
++  double *dp2, double *p1, double b[], double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    JACOBI_SS_ROOT improves an approximate root of a Jacobi polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 February 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input/output, double *X, the approximate root, which
++//    should be improved on output.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Input, double ALPHA, BETA, the exponents of (1-X) and
++//    (1+X) in the quadrature rule.
++//
++//    Output, double *DP2, the value of J'(ORDER)(X).
++//
++//    Output, double *P1, the value of J(ORDER-1)(X).
++//
++//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
++//
++{
++  double d;
++  double eps;
++  double p2;
++  int step;
++  int step_max = 10;
++
++  eps = webbur::r8_epsilon ( );
++
++  for ( step = 1; step <= step_max; step++ )
++  {
++    webbur::jacobi_ss_recur ( &p2, dp2, p1, *x, order, alpha, beta, b, c );
++
++    d = p2 / ( *dp2 );
++    *x = *x - d;
++
++    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
++    {
++      return;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void laguerre_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_COMPUTE: Laguerre quadrature rule by the Elhay-Kautsky method.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Sylvan Elhay, Jaroslav Kautsky,
++//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
++//    Interpolatory Quadrature,
++//    ACM Transactions on Mathematical Software,
++//    Volume 13, Number 4, December 1987, pages 399-415.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double *bj;
++  int i;
++  double zemu;
++//
++//  Define the zero-th moment.
++//
++  zemu = 1.0;
++//
++//  Define the Jacobi matrix.
++//
++  bj = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    bj[i] = ( double ) ( i + 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = ( double ) ( 2 * i + 1 );
++  }
++
++  w[0] = std::sqrt ( zemu );
++
++  for ( i = 1; i < n; i++ )
++  {
++    w[i] = 0.0;
++  }
++//
++//  Diagonalize the Jacobi matrix.
++//
++  webbur::imtqlx ( n, x, bj, w );
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = w[i] * w[i];
++  }
++
++  delete [] bj;
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_compute_np ( int order, int np, double p[], double x[],
++  double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_COMPUTE_NP computes a Laguerre quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( 0 <= X < +oo ) exp ( - X ) * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//    The integral:
++//
++//      Integral ( A <= X < +oo ) F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * exp ( X(I) ) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  webbur::laguerre_compute ( order, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_compute_points ( int order, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_COMPUTE_POINTS computes Laguerre quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  double *w;
++
++  w = new double[order];
++
++  webbur::laguerre_compute ( order, x, w );
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_compute_points_np ( int order, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_COMPUTE_POINTS_NP computes Laguerre quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++{
++  webbur::laguerre_compute_points ( order, x );
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_compute_weights ( int order, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_COMPUTE_WEIGHTS computes Laguerre quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *x;
++
++  x = new double[order];
++
++  webbur::laguerre_compute ( order, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_compute_weights_np ( int order, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_COMPUTE_WEIGHTS_NP computes Laguerre quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  webbur::laguerre_compute_weights ( order, w );
++
++  return;
++}
++//****************************************************************************80
++
++double laguerre_integral ( int expon )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_INTEGRAL evaluates a monomial Laguerre integral.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( 0 <= x < +oo ) x^n * exp ( -x ) dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent.
++//    0 <= EXPON.
++//
++//    Output, double EXACT, the value of the integral.
++//
++{
++  double exact;
++
++  exact = webbur::r8_factorial ( expon );
++
++  return exact;
++}
++//****************************************************************************80
++
++void laguerre_lookup ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_LOOKUP looks up abscissas and weights for Laguerre quadrature.
++//
++//  Discussion:
++//
++//    The abscissas are the zeroes of the Laguerre polynomial L(N)(X).
++//
++//    The integral:
++//
++//      Integral ( 0 <= X < +oo ) exp ( -X ) * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * f ( X(I) )
++//
++//    The integral:
++//
++//      Integral ( 0 <= X < +oo ) F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * exp ( X(I) ) * f ( X(I) )
++//
++//    Mathematica can numerically estimate the abscissas for the
++//    n-th order polynomial to p digits of precision by the command:
++//
++//      NSolve [ LaguerreL[n,x] == 0, x, p ]
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798,
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 20.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::laguerre_lookup_points ( n, x );
++
++  webbur::laguerre_lookup_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_LOOKUP_POINTS looks up abscissas for Laguerre quadrature.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798,
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 20.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  if ( n == 1 )
++  {
++    x[0] =  1.00000000000000000000000000000E+00;
++  }
++  else if ( n == 2 )
++  {
++    x[0] = 0.585786437626904951198311275790E+00;
++    x[1] = 3.41421356237309504880168872421E+00;
++  }
++  else if ( n == 3 )
++  {
++    x[0] = 0.415774556783479083311533873128E+00;
++    x[1] = 2.29428036027904171982205036136E+00;
++    x[2] = 6.28994508293747919686641576551E+00;
++  }
++  else if ( n == 4 )
++  {
++    x[0] = 0.322547689619392311800361459104E+00;
++    x[1] = 1.74576110115834657568681671252E+00;
++    x[2] = 4.53662029692112798327928538496E+00;
++    x[3] = 9.39507091230113312923353644342E+00;
++  }
++  else if ( n == 5 )
++  {
++    x[0] = 0.263560319718140910203061943361E+00;
++    x[1] = 1.41340305910651679221840798019E+00;
++    x[2] = 3.59642577104072208122318658878E+00;
++    x[3] = 7.08581000585883755692212418111E+00;
++    x[4] = 12.6408008442757826594332193066E+00;
++  }
++  else if ( n == 6 )
++  {
++    x[0] = 0.222846604179260689464354826787E+00;
++    x[1] = 1.18893210167262303074315092194E+00;
++    x[2] = 2.99273632605931407769132528451E+00;
++    x[3] = 5.77514356910451050183983036943E+00;
++    x[4] = 9.83746741838258991771554702994E+00;
++    x[5] = 15.9828739806017017825457915674E+00;
++  }
++  else if ( n == 7 )
++  {
++    x[0] = 0.193043676560362413838247885004E+00;
++    x[1] = 1.02666489533919195034519944317E+00;
++    x[2] = 2.56787674495074620690778622666E+00;
++    x[3] = 4.90035308452648456810171437810E+00;
++    x[4] = 8.18215344456286079108182755123E+00;
++    x[5] = 12.7341802917978137580126424582E+00;
++    x[6] = 19.3957278622625403117125820576E+00;
++  }
++  else if ( n == 8 )
++  {
++    x[0] = 0.170279632305100999788861856608E+00;
++    x[1] = 0.903701776799379912186020223555E+00;
++    x[2] = 2.25108662986613068930711836697E+00;
++    x[3] = 4.26670017028765879364942182690E+00;
++    x[4] = 7.04590540239346569727932548212E+00;
++    x[5] = 10.7585160101809952240599567880E+00;
++    x[6] = 15.7406786412780045780287611584E+00;
++    x[7] = 22.8631317368892641057005342974E+00;
++  }
++  else if ( n == 9 )
++  {
++    x[0] = 0.152322227731808247428107073127E+00;
++    x[1] = 0.807220022742255847741419210952E+00;
++    x[2] = 2.00513515561934712298303324701E+00;
++    x[3] = 3.78347397333123299167540609364E+00;
++    x[4] = 6.20495677787661260697353521006E+00;
++    x[5] = 9.37298525168757620180971073215E+00;
++    x[6] = 13.4662369110920935710978818397E+00;
++    x[7] = 18.8335977889916966141498992996E+00;
++    x[8] = 26.3740718909273767961410072937E+00;
++  }
++  else if ( n == 10 )
++  {
++    x[0] = 0.137793470540492430830772505653E+00;
++    x[1] = 0.729454549503170498160373121676E+00;
++    x[2] = 1.80834290174031604823292007575E+00;
++    x[3] = 3.40143369785489951448253222141E+00;
++    x[4] = 5.55249614006380363241755848687E+00;
++    x[5] = 8.33015274676449670023876719727E+00;
++    x[6] = 11.8437858379000655649185389191E+00;
++    x[7] = 16.2792578313781020995326539358E+00;
++    x[8] = 21.9965858119807619512770901956E+00;
++    x[9] = 29.9206970122738915599087933408E+00;
++  }
++  else if ( n == 11 )
++  {
++    x[0] = 0.125796442187967522675794577516E+00;
++    x[1] = 0.665418255839227841678127839420E+00;
++    x[2] = 1.64715054587216930958700321365E+00;
++    x[3] = 3.09113814303525495330195934259E+00;
++    x[4] = 5.02928440157983321236999508366E+00;
++    x[5] = 7.50988786380661681941099714450E+00;
++    x[6] = 10.6059509995469677805559216457E+00;
++    x[7] = 14.4316137580641855353200450349E+00;
++    x[8] = 19.1788574032146786478174853989E+00;
++    x[9] = 25.2177093396775611040909447797E+00;
++    x[10] = 33.4971928471755372731917259395E+00;
++  }
++  else if ( n == 12 )
++  {
++    x[0] = 0.115722117358020675267196428240E+00;
++    x[1] = 0.611757484515130665391630053042E+00;
++    x[2] = 1.51261026977641878678173792687E+00;
++    x[3] = 2.83375133774350722862747177657E+00;
++    x[4] = 4.59922763941834848460572922485E+00;
++    x[5] = 6.84452545311517734775433041849E+00;
++    x[6] = 9.62131684245686704391238234923E+00;
++    x[7] = 13.0060549933063477203460524294E+00;
++    x[8] = 17.1168551874622557281840528008E+00;
++    x[9] = 22.1510903793970056699218950837E+00;
++    x[10] = 28.4879672509840003125686072325E+00;
++    x[11] = 37.0991210444669203366389142764E+00;
++  }
++  else if ( n == 13 )
++  {
++    x[0] = 0.107142388472252310648493376977E+00;
++    x[1] = 0.566131899040401853406036347177E+00;
++    x[2] = 1.39856433645101971792750259921E+00;
++    x[3] = 2.61659710840641129808364008472E+00;
++    x[4] = 4.23884592901703327937303389926E+00;
++    x[5] = 6.29225627114007378039376523025E+00;
++    x[6] = 8.81500194118697804733348868036E+00;
++    x[7] = 11.8614035888112425762212021880E+00;
++    x[8] = 15.5107620377037527818478532958E+00;
++    x[9] = 19.8846356638802283332036594634E+00;
++    x[10] = 25.1852638646777580842970297823E+00;
++    x[11] = 31.8003863019472683713663283526E+00;
++    x[12] = 40.7230086692655795658979667001E+00;
++  }
++  else if ( n == 14 )
++  {
++    x[0] = 0.0997475070325975745736829452514E+00;
++    x[1] = 0.526857648851902896404583451502E+00;
++    x[2] = 1.30062912125149648170842022116E+00;
++    x[3] = 2.43080107873084463616999751038E+00;
++    x[4] = 3.93210282229321888213134366778E+00;
++    x[5] = 5.82553621830170841933899983898E+00;
++    x[6] = 8.14024014156514503005978046052E+00;
++    x[7] = 10.9164995073660188408130510904E+00;
++    x[8] = 14.2108050111612886831059780825E+00;
++    x[9] = 18.1048922202180984125546272083E+00;
++    x[10] = 22.7233816282696248232280886985E+00;
++    x[11] = 28.2729817232482056954158923218E+00;
++    x[12] = 35.1494436605924265828643121364E+00;
++    x[13] = 44.3660817111174230416312423666E+00;
++  }
++  else if ( n == 15 )
++  {
++    x[0] = 0.0933078120172818047629030383672E+00;
++    x[1] = 0.492691740301883908960101791412E+00;
++    x[2] = 1.21559541207094946372992716488E+00;
++    x[3] = 2.26994952620374320247421741375E+00;
++    x[4] = 3.66762272175143727724905959436E+00;
++    x[5] = 5.42533662741355316534358132596E+00;
++    x[6] = 7.56591622661306786049739555812E+00;
++    x[7] = 10.1202285680191127347927394568E+00;
++    x[8] = 13.1302824821757235640991204176E+00;
++    x[9] = 16.6544077083299578225202408430E+00;
++    x[10] = 20.7764788994487667729157175676E+00;
++    x[11] = 25.6238942267287801445868285977E+00;
++    x[12] = 31.4075191697539385152432196202E+00;
++    x[13] = 38.5306833064860094162515167595E+00;
++    x[14] = 48.0260855726857943465734308508E+00;
++  }
++  else if ( n == 16 )
++  {
++    x[0] = 0.0876494104789278403601980973401E+00;
++    x[1] = 0.462696328915080831880838260664E+00;
++    x[2] = 1.14105777483122685687794501811E+00;
++    x[3] = 2.12928364509838061632615907066E+00;
++    x[4] = 3.43708663389320664523510701675E+00;
++    x[5] = 5.07801861454976791292305830814E+00;
++    x[6] = 7.07033853504823413039598947080E+00;
++    x[7] = 9.43831433639193878394724672911E+00;
++    x[8] = 12.2142233688661587369391246088E+00;
++    x[9] = 15.4415273687816170767647741622E+00;
++    x[10] = 19.1801568567531348546631409497E+00;
++    x[11] = 23.5159056939919085318231872752E+00;
++    x[12] = 28.5787297428821403675206137099E+00;
++    x[13] = 34.5833987022866258145276871778E+00;
++    x[14] = 41.9404526476883326354722330252E+00;
++    x[15] = 51.7011603395433183643426971197E+00;
++  }
++  else if ( n == 17 )
++  {
++    x[0] = 0.0826382147089476690543986151980E+00;
++    x[1] = 0.436150323558710436375959029847E+00;
++    x[2] = 1.07517657751142857732980316755E+00;
++    x[3] = 2.00519353164923224070293371933E+00;
++    x[4] = 3.23425612404744376157380120696E+00;
++    x[5] = 4.77351351370019726480932076262E+00;
++    x[6] = 6.63782920536495266541643929703E+00;
++    x[7] = 8.84668551116980005369470571184E+00;
++    x[8] = 11.4255293193733525869726151469E+00;
++    x[9] = 14.4078230374813180021982874959E+00;
++    x[10] = 17.8382847307011409290658752412E+00;
++    x[11] = 21.7782682577222653261749080522E+00;
++    x[12] = 26.3153178112487997766149598369E+00;
++    x[13] = 31.5817716804567331343908517497E+00;
++    x[14] = 37.7960938374771007286092846663E+00;
++    x[15] = 45.3757165339889661829258363215E+00;
++    x[16] = 55.3897517898396106640900199790E+00;
++  }
++  else if ( n == 18 )
++  {
++    x[0] = 0.0781691666697054712986747615334E+00;
++    x[1] = 0.412490085259129291039101536536E+00;
++    x[2] = 1.01652017962353968919093686187E+00;
++    x[3] = 1.89488850996976091426727831954E+00;
++    x[4] = 3.05435311320265975115241130719E+00;
++    x[5] = 4.50420553888989282633795571455E+00;
++    x[6] = 6.25672507394911145274209116326E+00;
++    x[7] = 8.32782515660563002170470261564E+00;
++    x[8] = 10.7379900477576093352179033397E+00;
++    x[9] = 13.5136562075550898190863812108E+00;
++    x[10] = 16.6893062819301059378183984163E+00;
++    x[11] = 20.3107676262677428561313764553E+00;
++    x[12] = 24.4406813592837027656442257980E+00;
++    x[13] = 29.1682086625796161312980677805E+00;
++    x[14] = 34.6279270656601721454012429438E+00;
++    x[15] = 41.0418167728087581392948614284E+00;
++    x[16] = 48.8339227160865227486586093290E+00;
++    x[17] = 59.0905464359012507037157810181E+00;
++  }
++  else if ( n == 19 )
++  {
++    x[0] = 0.0741587837572050877131369916024E+00;
++    x[1] = 0.391268613319994607337648350299E+00;
++    x[2] = 0.963957343997958058624878377130E+00;
++    x[3] = 1.79617558206832812557725825252E+00;
++    x[4] = 2.89365138187378399116494713237E+00;
++    x[5] = 4.26421553962776647436040018167E+00;
++    x[6] = 5.91814156164404855815360191408E+00;
++    x[7] = 7.86861891533473373105668358176E+00;
++    x[8] = 10.1324237168152659251627415800E+00;
++    x[9] = 12.7308814638423980045092979656E+00;
++    x[10] = 15.6912783398358885454136069861E+00;
++    x[11] = 19.0489932098235501532136429732E+00;
++    x[12] = 22.8508497608294829323930586693E+00;
++    x[13] = 27.1606693274114488789963947149E+00;
++    x[14] = 32.0691222518622423224362865906E+00;
++    x[15] = 37.7129058012196494770647508283E+00;
++    x[16] = 44.3173627958314961196067736013E+00;
++    x[17] = 52.3129024574043831658644222420E+00;
++    x[18] = 62.8024231535003758413504690673E+00;
++  }
++  else if ( n == 20 )
++  {
++    x[0] = 0.0705398896919887533666890045842E+00;
++    x[1] = 0.372126818001611443794241388761E+00;
++    x[2] = 0.916582102483273564667716277074E+00;
++    x[3] = 1.70730653102834388068768966741E+00;
++    x[4] = 2.74919925530943212964503046049E+00;
++    x[5] = 4.04892531385088692237495336913E+00;
++    x[6] = 5.61517497086161651410453988565E+00;
++    x[7] = 7.45901745367106330976886021837E+00;
++    x[8] = 9.59439286958109677247367273428E+00;
++    x[9] = 12.0388025469643163096234092989E+00;
++    x[10] = 14.8142934426307399785126797100E+00;
++    x[11] = 17.9488955205193760173657909926E+00;
++    x[12] = 21.4787882402850109757351703696E+00;
++    x[13] = 25.4517027931869055035186774846E+00;
++    x[14] = 29.9325546317006120067136561352E+00;
++    x[15] = 35.0134342404790000062849359067E+00;
++    x[16] = 40.8330570567285710620295677078E+00;
++    x[17] = 47.6199940473465021399416271529E+00;
++    x[18] = 55.8107957500638988907507734445E+00;
++    x[19] = 66.5244165256157538186403187915E+00;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LAGUERRE_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::cerr << "  Legal values are 1 through 20.\n";
++    std::exit ( 1 );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_lookup_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_LOOKUP_WEIGHTS looks up weights for Laguerre quadrature.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798,
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 20.
++//
++//    Output, double W[N], the weights.
++//
++{
++  if ( n == 1 )
++  {
++    w[0] =  1.00000000000000000000000000000E+00;
++  }
++  else if ( n == 2 )
++  {
++    w[0] = 0.85355339059327376220042218105E+00;
++    w[1] = 0.146446609406726237799577818948E+00;
++  }
++  else if ( n == 3 )
++  {
++    w[0] = 0.71109300992917301544959019114E+00;
++    w[1] = 0.27851773356924084880144488846E+00;
++    w[2] = 0.010389256501586135748964920401E+00;
++  }
++  else if ( n == 4 )
++  {
++    w[0] = 0.60315410434163360163596602382E+00;
++    w[1] = 0.35741869243779968664149201746E+00;
++    w[2] = 0.03888790851500538427243816816E+00;
++    w[3] = 0.0005392947055613274501037905676E+00;
++  }
++  else if ( n == 5 )
++  {
++    w[0] = 0.52175561058280865247586092879E+00;
++    w[1] = 0.3986668110831759274541333481E+00;
++    w[2] = 0.0759424496817075953876533114E+00;
++    w[3] = 0.00361175867992204845446126257E+00;
++    w[4] = 0.00002336997238577622789114908455E+00;
++  }
++  else if ( n == 6 )
++  {
++    w[0] = 0.45896467394996359356828487771E+00;
++    w[1] = 0.4170008307721209941133775662E+00;
++    w[2] = 0.1133733820740449757387061851E+00;
++    w[3] = 0.01039919745314907489891330285E+00;
++    w[4] = 0.000261017202814932059479242860E+00;
++    w[5] = 8.98547906429621238825292053E-07;
++  }
++  else if ( n == 7 )
++  {
++    w[0] = 0.40931895170127390213043288002E+00;
++    w[1] = 0.4218312778617197799292810054E+00;
++    w[2] = 0.1471263486575052783953741846E+00;
++    w[3] = 0.0206335144687169398657056150E+00;
++    w[4] = 0.00107401014328074552213195963E+00;
++    w[5] = 0.0000158654643485642012687326223E+00;
++    w[6] = 3.17031547899558056227132215E-08;
++  }
++  else if ( n == 8 )
++  {
++    w[0] = 0.36918858934163752992058283938E+00;
++    w[1] = 0.4187867808143429560769785813E+00;
++    w[2] = 0.175794986637171805699659867E+00;
++    w[3] = 0.033343492261215651522132535E+00;
++    w[4] = 0.0027945362352256725249389241E+00;
++    w[5] = 0.00009076508773358213104238501E+00;
++    w[6] = 8.4857467162725315448680183E-07;
++    w[7] = 1.04800117487151038161508854E-09;
++  }
++  else if ( n == 9 )
++  {
++    w[0] = 0.336126421797962519673467717606E+00;
++    w[1] = 0.411213980423984387309146942793E+00;
++    w[2] = 0.199287525370885580860575607212E+00;
++    w[3] = 0.0474605627656515992621163600479E+00;
++    w[4] = 0.00559962661079458317700419900556E+00;
++    w[5] = 0.000305249767093210566305412824291E+00;
++    w[6] = 6.59212302607535239225572284875E-06;
++    w[7] = 4.1107693303495484429024104033E-08;
++    w[8] = 3.29087403035070757646681380323E-11;
++  }
++  else if ( n == 10 )
++  {
++    w[0] = 0.30844111576502014154747083468E+00;
++    w[1] = 0.4011199291552735515157803099E+00;
++    w[2] = 0.218068287611809421588648523E+00;
++    w[3] = 0.062087456098677747392902129E+00;
++    w[4] = 0.009501516975181100553839072E+00;
++    w[5] = 0.0007530083885875387754559644E+00;
++    w[6] = 0.00002825923349599565567422564E+00;
++    w[7] = 4.249313984962686372586577E-07;
++    w[8] = 1.839564823979630780921535E-09;
++    w[9] = 9.911827219609008558377547E-13;
++  }
++  else if ( n == 11 )
++  {
++    w[0] = 0.28493321289420060505605102472E+00;
++    w[1] = 0.3897208895278493779375535080E+00;
++    w[2] = 0.232781831848991333940223796E+00;
++    w[3] = 0.076564453546196686400854179E+00;
++    w[4] = 0.014393282767350695091863919E+00;
++    w[5] = 0.001518880846484873069847776E+00;
++    w[6] = 0.0000851312243547192259720424E+00;
++    w[7] = 2.29240387957450407857683E-06;
++    w[8] = 2.48635370276779587373391E-08;
++    w[9] = 7.71262693369132047028153E-11;
++    w[10] = 2.883775868323623861597778E-14;
++  }
++  else if ( n == 12 )
++  {
++    w[0] = 0.26473137105544319034973889206E+00;
++    w[1] = 0.3777592758731379820244905567E+00;
++    w[2] = 0.244082011319877564254870818E+00;
++    w[3] = 0.09044922221168093072750549E+00;
++    w[4] = 0.02010238115463409652266129E+00;
++    w[5] = 0.002663973541865315881054158E+00;
++    w[6] = 0.000203231592662999392121433E+00;
++    w[7] = 8.3650558568197987453363E-06;
++    w[8] = 1.66849387654091026116990E-07;
++    w[9] = 1.34239103051500414552392E-09;
++    w[10] = 3.06160163503502078142408E-12;
++    w[11] = 8.148077467426241682473119E-16;
++  }
++  else if ( n == 13 )
++  {
++    w[0] = 0.24718870842996262134624918596E+00;
++    w[1] = 0.3656888229005219453067175309E+00;
++    w[2] = 0.252562420057658502356824289E+00;
++    w[3] = 0.10347075802418370511421863E+00;
++    w[4] = 0.02643275441556161577815877E+00;
++    w[5] = 0.00422039604025475276555209E+00;
++    w[6] = 0.000411881770472734774892473E+00;
++    w[7] = 0.0000235154739815532386882897E+00;
++    w[8] = 7.3173116202490991040105E-07;
++    w[9] = 1.10884162570398067979151E-08;
++    w[10] = 6.7708266922058988406462E-11;
++    w[11] = 1.15997995990507606094507E-13;
++    w[12] = 2.245093203892758415991872E-17;
++  }
++  else if ( n == 14 )
++  {
++    w[0] = 0.23181557714486497784077486110E+00;
++    w[1] = 0.3537846915975431518023313013E+00;
++    w[2] = 0.258734610245428085987320561E+00;
++    w[3] = 0.11548289355692321008730499E+00;
++    w[4] = 0.03319209215933736003874996E+00;
++    w[5] = 0.00619286943700661021678786E+00;
++    w[6] = 0.00073989037786738594242589E+00;
++    w[7] = 0.000054907194668416983785733E+00;
++    w[8] = 2.4095857640853774967578E-06;
++    w[9] = 5.801543981676495180886E-08;
++    w[10] = 6.819314692484974119616E-10;
++    w[11] = 3.2212077518948479398089E-12;
++    w[12] = 4.2213524405165873515980E-15;
++    w[13] = 6.05237502228918880839871E-19;
++  }
++  else if ( n == 15 )
++  {
++    w[0] = 0.21823488594008688985641323645E+00;
++    w[1] = 0.3422101779228833296389489568E+00;
++    w[2] = 0.263027577941680097414812275E+00;
++    w[3] = 0.12642581810593053584303055E+00;
++    w[4] = 0.04020686492100091484158548E+00;
++    w[5] = 0.00856387780361183836391576E+00;
++    w[6] = 0.00121243614721425207621921E+00;
++    w[7] = 0.00011167439234425194199258E+00;
++    w[8] = 6.459926762022900924653E-06;
++    w[9] = 2.226316907096272630332E-07;
++    w[10] = 4.227430384979365007351E-09;
++    w[11] = 3.921897267041089290385E-11;
++    w[12] = 1.4565152640731264063327E-13;
++    w[13] = 1.4830270511133013354616E-16;
++    w[14] = 1.60059490621113323104998E-20;
++  }
++  else if ( n == 16 )
++  {
++    w[0] = 0.20615171495780099433427363674E+00;
++    w[1] = 0.3310578549508841659929830987E+00;
++    w[2] = 0.265795777644214152599502021E+00;
++    w[3] = 0.13629693429637753997554751E+00;
++    w[4] = 0.0473289286941252189780623E+00;
++    w[5] = 0.0112999000803394532312490E+00;
++    w[6] = 0.0018490709435263108642918E+00;
++    w[7] = 0.00020427191530827846012602E+00;
++    w[8] = 0.00001484458687398129877135E+00;
++    w[9] = 6.828319330871199564396E-07;
++    w[10] = 1.881024841079673213882E-08;
++    w[11] = 2.862350242973881619631E-10;
++    w[12] = 2.127079033224102967390E-12;
++    w[13] = 6.297967002517867787174E-15;
++    w[14] = 5.050473700035512820402E-18;
++    w[15] = 4.1614623703728551904265E-22;
++  }
++  else if ( n == 17 )
++  {
++    w[0] = 0.19533220525177083214592729770E+00;
++    w[1] = 0.3203753572745402813366256320E+00;
++    w[2] = 0.267329726357171097238809604E+00;
++    w[3] = 0.14512985435875862540742645E+00;
++    w[4] = 0.0544369432453384577793806E+00;
++    w[5] = 0.0143572977660618672917767E+00;
++    w[6] = 0.0026628247355727725684324E+00;
++    w[7] = 0.0003436797271562999206118E+00;
++    w[8] = 0.00003027551783782870109437E+00;
++    w[9] = 1.768515053231676895381E-06;
++    w[10] = 6.57627288681043332199E-08;
++    w[11] = 1.469730932159546790344E-09;
++    w[12] = 1.81691036255544979555E-11;
++    w[13] = 1.095401388928687402976E-13;
++    w[14] = 2.617373882223370421551E-16;
++    w[15] = 1.6729356931461546908502E-19;
++    w[16] = 1.06562631627404278815253E-23;
++  }
++  else if ( n == 18 )
++  {
++    w[0] = 0.18558860314691880562333775228E+00;
++    w[1] = 0.3101817663702252936495975957E+00;
++    w[2] = 0.267866567148536354820854395E+00;
++    w[3] = 0.15297974746807490655384308E+00;
++    w[4] = 0.0614349178609616527076780E+00;
++    w[5] = 0.0176872130807729312772600E+00;
++    w[6] = 0.0036601797677599177980266E+00;
++    w[7] = 0.0005406227870077353231284E+00;
++    w[8] = 0.0000561696505121423113818E+00;
++    w[9] = 4.01530788370115755859E-06;
++    w[10] = 1.91466985667567497969E-07;
++    w[11] = 5.8360952686315941292E-09;
++    w[12] = 1.07171126695539012773E-10;
++    w[13] = 1.08909871388883385562E-12;
++    w[14] = 5.38666474837830887608E-15;
++    w[15] = 1.049865978035703408779E-17;
++    w[16] = 5.405398451631053643566E-21;
++    w[17] = 2.6916532692010286270838E-25;
++  }
++  else if ( n == 19 )
++  {
++    w[0] = 0.17676847491591250225103547981E+00;
++    w[1] = 0.3004781436072543794821568077E+00;
++    w[2] = 0.267599547038175030772695441E+00;
++    w[3] = 0.15991337213558021678551215E+00;
++    w[4] = 0.0682493799761491134552355E+00;
++    w[5] = 0.0212393076065443249244062E+00;
++    w[6] = 0.0048416273511483959672501E+00;
++    w[7] = 0.0008049127473813667665946E+00;
++    w[8] = 0.0000965247209315350170843E+00;
++    w[9] = 8.20730525805103054409E-06;
++    w[10] = 4.8305667247307725394E-07;
++    w[11] = 1.90499136112328569994E-08;
++    w[12] = 4.8166846309280615577E-10;
++    w[13] = 7.3482588395511443768E-12;
++    w[14] = 6.2022753875726163989E-14;
++    w[15] = 2.54143084301542272372E-16;
++    w[16] = 4.07886129682571235007E-19;
++    w[17] = 1.707750187593837061004E-22;
++    w[18] = 6.715064649908189959990E-27;
++  }
++  else if ( n == 20 )
++  {
++    w[0] = 0.168746801851113862149223899689E+00;
++    w[1] = 0.291254362006068281716795323812E+00;
++    w[2] = 0.266686102867001288549520868998E+00;
++    w[3] = 0.166002453269506840031469127816E+00;
++    w[4] = 0.0748260646687923705400624639615E+00;
++    w[5] = 0.0249644173092832210728227383234E+00;
++    w[6] = 0.00620255084457223684744754785395E+00;
++    w[7] = 0.00114496238647690824203955356969E+00;
++    w[8] = 0.000155741773027811974779809513214E+00;
++    w[9] = 0.0000154014408652249156893806714048E+00;
++    w[10] = 1.08648636651798235147970004439E-06;
++    w[11] = 5.33012090955671475092780244305E-08;
++    w[12] = 1.7579811790505820035778763784E-09;
++    w[13] = 3.72550240251232087262924585338E-11;
++    w[14] = 4.76752925157819052449488071613E-13;
++    w[15] = 3.37284424336243841236506064991E-15;
++    w[16] = 1.15501433950039883096396247181E-17;
++    w[17] = 1.53952214058234355346383319667E-20;
++    w[18] = 5.28644272556915782880273587683E-24;
++    w[19] = 1.65645661249902329590781908529E-28;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LAGUERRE_LOOKUP_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::cerr << "  Legal values are 1 through 20.\n";
++    std::exit ( 1 );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_ss_compute ( int order, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_SS_COMPUTE computes a Laguerre quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( 0 <= X < +oo ) exp ( - X ) * F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * F ( X(I) )
++//
++//    The integral:
++//
++//        Integral ( A <= X < +oo ) F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= ORDER ) W(I) * exp ( X(I) ) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    1 <= ORDER.
++//
++//    Output, double X[ORDER], the abscissas.
++//
++//    Output, double W[ORDER], the weights.
++//
++{
++  double *b;
++  double *c;
++  double cc;
++  double dp2;
++  int i;
++  int j;
++  double p1;
++  double prod;
++  double r1;
++  double x0;
++
++  if ( order < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "LAGUERRE_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of ORDER = " << order << "\n";
++    std::exit ( 1 );
++  }
++
++  b = new double[order];
++  c = new double[order];
++//
++//  Set the recursion coefficients.
++//
++  for ( i = 0; i < order; i++ )
++  {
++    b[i] = ( double ) ( 2 * i + 1 );
++  }
++
++  for ( i = 0; i < order; i++ )
++  {
++    c[i] = ( double ) ( i * i );
++  }
++  prod = 1.0;
++  for ( i = 1; i < order; i++ )
++  {
++    prod = prod * c[i];
++  }
++  cc = prod;
++
++  for ( i = 0; i < order; i++ )
++  {
++//
++//  Compute an estimate for the root.
++//
++    if ( i == 0 )
++    {
++      x0 =  3.0 / ( 1.0 + 2.4 * ( double ) ( order ) );
++    }
++    else if ( i == 1 )
++    {
++      x0 = x0 + 15.0 / ( 1.0 + 2.5 * ( double ) ( order ) );
++    }
++    else
++    {
++      r1 = ( 1.0 + 2.55 * ( double ) ( i - 1 ) )
++        / ( 1.9 * ( double ) ( i - 1 ) );
++
++      x0 = x0 + r1 * ( x0 - x[i-2] );
++    }
++//
++//  Use iteration to find the root.
++//
++    webbur::laguerre_ss_root ( &x0, order, &dp2, &p1, b, c );
++//
++//  Set the abscissa and weight.
++//
++    x[i] = x0;
++//
++//  Because of the huge values involved, this calculation breaks down
++//  for ORDER = 127.
++//
++//  It was originally w[i] = ( cc / dp2 ) / p1, which breaks down sooner.
++//
++    w[i] = ( 1.0 / dp2 );
++    for ( j = 2; j <= order; j++ )
++    {
++      w[i] = w[i] * ( double ) ( j - 1 );
++    }
++    w[i] = w[i] / p1;
++    for ( j = 2; j <= order; j++ )
++    {
++      w[i] = w[i] * ( double ) ( j - 1 );
++    }
++
++//  w[i] = ( cc / dp2 ) / p1;
++  }
++
++  delete [] b;
++  delete [] c;
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_ss_recur ( double *p2, double *dp2, double *p1, double x,
++  int order, double b[], double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_SS_RECUR evaluates a Laguerre polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Output, double *P2, the value of L(ORDER)(X).
++//
++//    Output, double *DP2, the value of L'(ORDER)(X).
++//
++//    Output, double *P1, the value of L(ORDER-1)(X).
++//
++//    Input, double X, the point at which polynomials are evaluated.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
++//
++{
++  double dp0;
++  double dp1;
++  int i;
++  double p0;
++
++  *p1 = 1.0;
++  dp1 = 0.0;
++
++  *p2 = x - 1.0;
++  *dp2 = 1.0;
++
++  for ( i = 1; i < order; i++ )
++  {
++    p0 = *p1;
++    dp0 = dp1;
++
++    *p1 = *p2;
++    dp1 = *dp2;
++
++    *p2  = ( x - b[i] ) * ( *p1 ) - c[i] * p0;
++    *dp2 = ( x - b[i] ) * dp1 + ( *p1 ) - c[i] * dp0;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void laguerre_ss_root ( double *x, int order, double *dp2, double *p1,
++  double b[], double c[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LAGUERRE_SS_ROOT improves a root of a Laguerre polynomial.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Arthur Stroud, Don Secrest.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input/output, double *X, the approximate root, which
++//    should be improved on output.
++//
++//    Input, int ORDER, the order of the polynomial.
++//
++//    Output, double *DP2, the value of L'(ORDER)(X).
++//
++//    Output, double *P1, the value of L(ORDER-1)(X).
++//
++//    Input, double B[ORDER], C[ORDER], the recursion coefficients.
++//
++{
++  double d;
++  double eps;
++  double p2;
++  int step;
++  int step_max = 10;
++
++  eps = webbur::r8_epsilon ( );
++
++  for ( step = 1; step <= step_max; step++ )
++  {
++    webbur::laguerre_ss_recur ( &p2, dp2, p1, *x, order, b, c );
++
++    d = p2 / ( *dp2 );
++    *x = *x - d;
++
++    if ( webbur::r8_abs ( d ) <= eps * ( webbur::r8_abs ( *x ) + 1.0 ) )
++    {
++      break;
++    }
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_COMPUTE: Legendre quadrature rule by the Elhay-Kautsky method.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 April 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Sylvan Elhay, Jaroslav Kautsky.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Sylvan Elhay, Jaroslav Kautsky,
++//    Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of
++//    Interpolatory Quadrature,
++//    ACM Transactions on Mathematical Software,
++//    Volume 13, Number 4, December 1987, pages 399-415.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double *bj;
++  int i;
++  double zemu;
++//
++//  Define the zero-th moment.
++//
++  zemu = 2.0;
++//
++//  Define the Jacobi matrix.
++//
++  bj = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    bj[i] = ( double ) ( ( i + 1 ) * ( i + 1 ) )
++          / ( double ) ( 4 * ( i + 1 ) * ( i + 1 ) - 1 );
++    bj[i] = std::sqrt ( bj[i] );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = 0.0;
++  }
++
++  w[0] = std::sqrt ( zemu );
++
++  for ( i = 1; i < n; i++ )
++  {
++    w[i] = 0.0;
++  }
++//
++//  Diagonalize the Jacobi matrix.
++//
++  webbur::imtqlx ( n, x, bj, w );
++
++  for ( i = 0; i < n; i++ )
++  {
++    w[i] = w[i] * w[i];
++  }
++
++  delete [] bj;
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_compute_np ( int n, int np, double p[], double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_COMPUTE_NP computes a Legendre quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::legendre_compute ( n, x, w );
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_COMPUTE_POINTS computes Legendre quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  double *w;
++
++  w= new double[n];
++
++  webbur::legendre_compute ( n, x, w );
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_compute_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_COMPUTE_POINTS_NP computes Legendre quadrature points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  webbur::legendre_compute_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_COMPUTE_WEIGHTS computes Legendre quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double *x;
++
++  x = new double[n];
++
++  webbur::legendre_compute ( n, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_compute_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_COMPUTE_WEIGHTS_NP computes Legendre quadrature weights.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  webbur::legendre_compute_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_dr_compute ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_DR_COMPUTE computes a Legendre quadrature rule.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      Integral ( -1 <= X <= 1 ) F(X) dX
++//
++//    The quadrature rule:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 June 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    1 <= N.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double d1;
++  double d2pn;
++  double d3pn;
++  double d4pn;
++  double dp;
++  double dpn;
++  double e1;
++  double fx;
++  double h;
++  int i;
++  int iback;
++  int k;
++  int m;
++  int mp1mi;
++  int ncopy;
++  int nmove;
++  double p;
++  double pi = 3.141592653589793;
++  double pk;
++  double pkm1;
++  double pkp1;
++  double t;
++  double u;
++  double v;
++  double x0;
++  double xtemp;
++
++  if ( n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "LEGENDRE_DR_COMPUTE - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  e1 = ( double ) ( n * ( n + 1 ) );
++
++  m = ( n + 1 ) / 2;
++
++  for ( i = 1; i <= m; i++ )
++  {
++    mp1mi = m + 1 - i;
++
++    t = ( double ) ( 4 * i - 1 ) * pi / ( double ) ( 4 * n + 2 );
++
++    x0 =  std::cos ( t ) * ( 1.0 - ( 1.0 - 1.0 / ( double ) ( n ) )
++      / ( double ) ( 8 * n * n ) );
++
++    pkm1 = 1.0;
++    pk = x0;
++
++    for ( k = 2; k <= n; k++ )
++    {
++      pkp1 = 2.0 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) / ( double ) ( k );
++      pkm1 = pk;
++      pk = pkp1;
++    }
++
++    d1 = ( double ) ( n ) * ( pkm1 - x0 * pk );
++
++    dpn = d1 / ( 1.0 - x0 * x0 );
++
++    d2pn = ( 2.0 * x0 * dpn - e1 * pk ) / ( 1.0 - x0 * x0 );
++
++    d3pn = ( 4.0 * x0 * d2pn + ( 2.0 - e1 ) * dpn ) / ( 1.0 - x0 * x0 );
++
++    d4pn = ( 6.0 * x0 * d3pn + ( 6.0 - e1 ) * d2pn ) / ( 1.0 - x0 * x0 );
++
++    u = pk / dpn;
++    v = d2pn / dpn;
++//
++//  Initial approximation H:
++//
++    h = -u * ( 1.0 + 0.5 * u * ( v + u * ( v * v - d3pn / ( 3.0 * dpn ) ) ) );
++//
++//  Refine H using one step of Newton's method:
++//
++    p = pk + h * ( dpn + 0.5 * h * ( d2pn + h / 3.0
++      * ( d3pn + 0.25 * h * d4pn ) ) );
++
++    dp = dpn + h * ( d2pn + 0.5 * h * ( d3pn + h * d4pn / 3.0 ) );
++
++    h = h - p / dp;
++
++    xtemp = x0 + h;
++
++    x[mp1mi-1] = xtemp;
++
++    fx = d1 - h * e1 * ( pk + 0.5 * h * ( dpn + h / 3.0
++      * ( d2pn + 0.25 * h * ( d3pn + 0.2 * h * d4pn ) ) ) );
++
++    w[mp1mi-1] = 2.0 * ( 1.0 - xtemp * xtemp ) / ( fx * fx );
++  }
++
++  if ( ( n % 2 ) == 1 )
++  {
++    x[0] = 0.0;
++  }
++//
++//  Shift the data up.
++//
++  nmove = ( n + 1 ) / 2;
++  ncopy = n - nmove;
++
++  for ( i = 1; i <= nmove; i++ )
++  {
++    iback = n + 1 - i;
++    x[iback-1] = x[iback-ncopy-1];
++    w[iback-1] = w[iback-ncopy-1];
++  }
++//
++//  Reflect values for the negative abscissas.
++//
++  for ( i = 1; i <= n - nmove; i++ )
++  {
++    x[i-1] = - x[n-i];
++    w[i-1] = w[n-i];
++  }
++
++  return;
++}
++//****************************************************************************80
++
++double legendre_integral ( int expon )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_INTEGRAL evaluates a monomial Legendre integral.
++//
++//  Discussion:
++//
++//    The integral:
++//
++//      integral ( -1 <= x <= +1 ) x^n dx
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int EXPON, the exponent.
++//
++//    Output, double LEGENDRE_INTEGRAL, the value of the exact integral.
++//
++{
++  double exact;
++//
++//  Get the exact value of the integral.
++//
++  if ( ( expon % 2 ) == 0 )
++  {
++    exact = 2.0 / ( double ) ( expon + 1 );
++  }
++  else
++  {
++    exact = 0.0;
++  }
++
++  return exact;
++}
++//****************************************************************************80
++
++void legendre_lookup ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_LOOKUP looks up abscissas and weights for Gauss-Legendre quadrature.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798.
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3,
++//    LC: QA47.M315.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 33.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the abscissas.
++//
++{
++  webbur::legendre_lookup_points ( n, x );
++
++  webbur::legendre_lookup_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void legendre_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_LOOKUP_POINTS looks up abscissas for Gauss-Legendre quadrature.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798.
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3,
++//    LC: QA47.M315.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 33.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  if ( n == 1 )
++  {
++    x[0] = 0.000000000000000000000000000000;
++  }
++  else if ( n == 2 )
++  {
++    x[0] = -0.577350269189625764509148780502;
++    x[1] = 0.577350269189625764509148780502;
++  }
++  else if ( n == 3 )
++  {
++    x[0] = -0.774596669241483377035853079956;
++    x[1] = 0.000000000000000000000000000000;
++    x[2] = 0.774596669241483377035853079956;
++  }
++  else if ( n == 4 )
++  {
++    x[0] = -0.861136311594052575223946488893;
++    x[1] = -0.339981043584856264802665759103;
++    x[2] = 0.339981043584856264802665759103;
++    x[3] = 0.861136311594052575223946488893;
++  }
++  else if ( n == 5 )
++  {
++    x[0] = -0.906179845938663992797626878299;
++    x[1] = -0.538469310105683091036314420700;
++    x[2] = 0.000000000000000000000000000000;
++    x[3] = 0.538469310105683091036314420700;
++    x[4] = 0.906179845938663992797626878299;
++  }
++  else if ( n == 6 )
++  {
++    x[0] = -0.932469514203152027812301554494;
++    x[1] = -0.661209386466264513661399595020;
++    x[2] = -0.238619186083196908630501721681;
++    x[3] = 0.238619186083196908630501721681;
++    x[4] = 0.661209386466264513661399595020;
++    x[5] = 0.932469514203152027812301554494;
++  }
++  else if ( n == 7 )
++  {
++    x[0] = -0.949107912342758524526189684048;
++    x[1] = -0.741531185599394439863864773281;
++    x[2] = -0.405845151377397166906606412077;
++    x[3] = 0.000000000000000000000000000000;
++    x[4] = 0.405845151377397166906606412077;
++    x[5] = 0.741531185599394439863864773281;
++    x[6] = 0.949107912342758524526189684048;
++  }
++  else if ( n == 8 )
++  {
++    x[0] = -0.960289856497536231683560868569;
++    x[1] = -0.796666477413626739591553936476;
++    x[2] = -0.525532409916328985817739049189;
++    x[3] = -0.183434642495649804939476142360;
++    x[4] = 0.183434642495649804939476142360;
++    x[5] = 0.525532409916328985817739049189;
++    x[6] = 0.796666477413626739591553936476;
++    x[7] = 0.960289856497536231683560868569;
++  }
++  else if ( n == 9 )
++  {
++    x[0] = -0.968160239507626089835576203;
++    x[1] = -0.836031107326635794299429788;
++    x[2] = -0.613371432700590397308702039;
++    x[3] = -0.324253423403808929038538015;
++    x[4] = 0.000000000000000000000000000;
++    x[5] = 0.324253423403808929038538015;
++    x[6] = 0.613371432700590397308702039;
++    x[7] = 0.836031107326635794299429788;
++    x[8] = 0.968160239507626089835576203;
++  }
++  else if ( n == 10 )
++  {
++    x[0] = -0.973906528517171720077964012;
++    x[1] = -0.865063366688984510732096688;
++    x[2] = -0.679409568299024406234327365;
++    x[3] = -0.433395394129247190799265943;
++    x[4] = -0.148874338981631210884826001;
++    x[5] = 0.148874338981631210884826001;
++    x[6] = 0.433395394129247190799265943;
++    x[7] = 0.679409568299024406234327365;
++    x[8] = 0.865063366688984510732096688;
++    x[9] = 0.973906528517171720077964012;
++  }
++  else if ( n == 11 )
++  {
++    x[0] = -0.978228658146056992803938001;
++    x[1] = -0.887062599768095299075157769;
++    x[2] = -0.730152005574049324093416252;
++    x[3] = -0.519096129206811815925725669;
++    x[4] = -0.269543155952344972331531985;
++    x[5] = 0.000000000000000000000000000;
++    x[6] = 0.269543155952344972331531985;
++    x[7] = 0.519096129206811815925725669;
++    x[8] = 0.730152005574049324093416252;
++    x[9] = 0.887062599768095299075157769;
++    x[10] = 0.978228658146056992803938001;
++  }
++  else if ( n == 12 )
++  {
++    x[0] = -0.981560634246719250690549090;
++    x[1] = -0.904117256370474856678465866;
++    x[2] = -0.769902674194304687036893833;
++    x[3] = -0.587317954286617447296702419;
++    x[4] = -0.367831498998180193752691537;
++    x[5] = -0.125233408511468915472441369;
++    x[6] = 0.125233408511468915472441369;
++    x[7] = 0.367831498998180193752691537;
++    x[8] = 0.587317954286617447296702419;
++    x[9] = 0.769902674194304687036893833;
++    x[10] = 0.904117256370474856678465866;
++    x[11] = 0.981560634246719250690549090;
++  }
++  else if ( n == 13 )
++  {
++    x[0] = -0.984183054718588149472829449;
++    x[1] = -0.917598399222977965206547837;
++    x[2] = -0.801578090733309912794206490;
++    x[3] = -0.642349339440340220643984607;
++    x[4] = -0.448492751036446852877912852;
++    x[5] = -0.230458315955134794065528121;
++    x[6] = 0.000000000000000000000000000;
++    x[7] = 0.230458315955134794065528121;
++    x[8] = 0.448492751036446852877912852;
++    x[9] = 0.642349339440340220643984607;
++    x[10] = 0.80157809073330991279420649;
++    x[11] = 0.91759839922297796520654784;
++    x[12] = 0.98418305471858814947282945;
++  }
++  else if ( n == 14 )
++  {
++    x[0] = -0.986283808696812338841597267;
++    x[1] = -0.928434883663573517336391139;
++    x[2] = -0.827201315069764993189794743;
++    x[3] = -0.687292904811685470148019803;
++    x[4] = -0.515248636358154091965290719;
++    x[5] = -0.319112368927889760435671824;
++    x[6] = -0.108054948707343662066244650;
++    x[7] = 0.108054948707343662066244650;
++    x[8] = 0.31911236892788976043567182;
++    x[9] = 0.51524863635815409196529072;
++    x[10] = 0.68729290481168547014801980;
++    x[11] = 0.82720131506976499318979474;
++    x[12] = 0.92843488366357351733639114;
++    x[13] = 0.98628380869681233884159727;
++  }
++  else if ( n == 15 )
++  {
++    x[0] = -0.987992518020485428489565719;
++    x[1] = -0.937273392400705904307758948;
++    x[2] = -0.848206583410427216200648321;
++    x[3] = -0.724417731360170047416186055;
++    x[4] = -0.570972172608538847537226737;
++    x[5] = -0.394151347077563369897207371;
++    x[6] = -0.201194093997434522300628303;
++    x[7] = 0.00000000000000000000000000;
++    x[8] = 0.20119409399743452230062830;
++    x[9] = 0.39415134707756336989720737;
++    x[10] = 0.57097217260853884753722674;
++    x[11] = 0.72441773136017004741618605;
++    x[12] = 0.84820658341042721620064832;
++    x[13] = 0.93727339240070590430775895;
++    x[14] = 0.98799251802048542848956572;
++  }
++  else if ( n == 16 )
++  {
++    x[0] = -0.989400934991649932596154173;
++    x[1] = -0.944575023073232576077988416;
++    x[2] = -0.865631202387831743880467898;
++    x[3] = -0.755404408355003033895101195;
++    x[4] = -0.617876244402643748446671764;
++    x[5] = -0.458016777657227386342419443;
++    x[6] = -0.281603550779258913230460501;
++    x[7] = -0.09501250983763744018531934;
++    x[8] = 0.09501250983763744018531934;
++    x[9] = 0.28160355077925891323046050;
++    x[10] = 0.45801677765722738634241944;
++    x[11] = 0.61787624440264374844667176;
++    x[12] = 0.75540440835500303389510119;
++    x[13] = 0.86563120238783174388046790;
++    x[14] = 0.94457502307323257607798842;
++    x[15] = 0.98940093499164993259615417;
++  }
++  else if ( n == 17 )
++  {
++    x[0] = -0.990575475314417335675434020;
++    x[1] = -0.950675521768767761222716958;
++    x[2] = -0.880239153726985902122955694;
++    x[3] = -0.781514003896801406925230056;
++    x[4] = -0.657671159216690765850302217;
++    x[5] = -0.512690537086476967886246569;
++    x[6] = -0.35123176345387631529718552;
++    x[7] = -0.17848418149584785585067749;
++    x[8] = 0.00000000000000000000000000;
++    x[9] = 0.17848418149584785585067749;
++    x[10] = 0.35123176345387631529718552;
++    x[11] = 0.51269053708647696788624657;
++    x[12] = 0.65767115921669076585030222;
++    x[13] = 0.78151400389680140692523006;
++    x[14] = 0.88023915372698590212295569;
++    x[15] = 0.95067552176876776122271696;
++    x[16] = 0.99057547531441733567543402;
++  }
++  else if ( n == 18 )
++  {
++    x[0] = -0.991565168420930946730016005;
++    x[1] = -0.955823949571397755181195893;
++    x[2] = -0.892602466497555739206060591;
++    x[3] = -0.803704958972523115682417455;
++    x[4] = -0.691687043060353207874891081;
++    x[5] = -0.55977083107394753460787155;
++    x[6] = -0.41175116146284264603593179;
++    x[7] = -0.25188622569150550958897285;
++    x[8] = -0.08477501304173530124226185;
++    x[9] = 0.08477501304173530124226185;
++    x[10] = 0.25188622569150550958897285;
++    x[11] = 0.41175116146284264603593179;
++    x[12] = 0.55977083107394753460787155;
++    x[13] = 0.69168704306035320787489108;
++    x[14] = 0.80370495897252311568241746;
++    x[15] = 0.89260246649755573920606059;
++    x[16] = 0.95582394957139775518119589;
++    x[17] = 0.99156516842093094673001600;
++  }
++  else if ( n == 19 )
++  {
++    x[0] = -0.992406843843584403189017670;
++    x[1] = -0.960208152134830030852778841;
++    x[2] = -0.903155903614817901642660929;
++    x[3] = -0.822714656537142824978922487;
++    x[4] = -0.72096617733522937861709586;
++    x[5] = -0.60054530466168102346963816;
++    x[6] = -0.46457074137596094571726715;
++    x[7] = -0.31656409996362983199011733;
++    x[8] = -0.16035864564022537586809612;
++    x[9] = 0.00000000000000000000000000;
++    x[10] = 0.16035864564022537586809612;
++    x[11] = 0.31656409996362983199011733;
++    x[12] = 0.46457074137596094571726715;
++    x[13] = 0.60054530466168102346963816;
++    x[14] = 0.72096617733522937861709586;
++    x[15] = 0.82271465653714282497892249;
++    x[16] = 0.90315590361481790164266093;
++    x[17] = 0.96020815213483003085277884;
++    x[18] = 0.99240684384358440318901767;
++  }
++  else if ( n == 20 )
++  {
++    x[0] = -0.993128599185094924786122388;
++    x[1] = -0.963971927277913791267666131;
++    x[2] = -0.912234428251325905867752441;
++    x[3] = -0.83911697182221882339452906;
++    x[4] = -0.74633190646015079261430507;
++    x[5] = -0.63605368072651502545283670;
++    x[6] = -0.51086700195082709800436405;
++    x[7] = -0.37370608871541956067254818;
++    x[8] = -0.22778585114164507808049620;
++    x[9] = -0.07652652113349733375464041;
++    x[10] = 0.07652652113349733375464041;
++    x[11] = 0.22778585114164507808049620;
++    x[12] = 0.37370608871541956067254818;
++    x[13] = 0.51086700195082709800436405;
++    x[14] = 0.63605368072651502545283670;
++    x[15] = 0.74633190646015079261430507;
++    x[16] = 0.83911697182221882339452906;
++    x[17] = 0.91223442825132590586775244;
++    x[18] = 0.96397192727791379126766613;
++    x[19] = 0.99312859918509492478612239;
++  }
++  else if ( n == 21 )
++  {
++    x[ 0] =  -0.99375217062038950026024204;
++    x[ 1] =  -0.96722683856630629431662221;
++    x[ 2] =  -0.92009933415040082879018713;
++    x[ 3] =  -0.85336336458331728364725064;
++    x[ 4] =  -0.76843996347567790861587785;
++    x[ 5] =  -0.66713880419741231930596667;
++    x[ 6] =  -0.55161883588721980705901880;
++    x[ 7] =  -0.42434212020743878357366889;
++    x[ 8] =  -0.28802131680240109660079252;
++    x[9] =  -0.14556185416089509093703098;
++    x[10] =   0.00000000000000000000000000;
++    x[11] =  +0.14556185416089509093703098;
++    x[12] =  +0.28802131680240109660079252;
++    x[13] =  +0.42434212020743878357366889;
++    x[14] =  +0.55161883588721980705901880;
++    x[15] =  +0.66713880419741231930596667;
++    x[16] =  +0.76843996347567790861587785;
++    x[17] =  +0.85336336458331728364725064;
++    x[18] =  +0.92009933415040082879018713;
++    x[19] =  +0.96722683856630629431662221;
++    x[20] =  +0.99375217062038950026024204;
++  }
++  else if ( n == 22 )
++  {
++    x[0] = -0.99429458548239929207303142;
++    x[1] = -0.97006049783542872712395099;
++    x[2] = -0.92695677218717400052069294;
++    x[3] = -0.86581257772030013653642564;
++    x[4] = -0.78781680597920816200427796;
++    x[5] = -0.69448726318668278005068984;
++    x[6] = -0.58764040350691159295887693;
++    x[7] = -0.46935583798675702640633071;
++    x[8] = -0.34193582089208422515814742;
++    x[9] = -0.20786042668822128547884653;
++    x[10] = -0.06973927331972222121384180;
++    x[11] = 0.06973927331972222121384180;
++    x[12] = 0.20786042668822128547884653;
++    x[13] = 0.34193582089208422515814742;
++    x[14] = 0.46935583798675702640633071;
++    x[15] = 0.58764040350691159295887693;
++    x[16] = 0.69448726318668278005068984;
++    x[17] = 0.78781680597920816200427796;
++    x[18] = 0.86581257772030013653642564;
++    x[19] = 0.92695677218717400052069294;
++    x[20] = 0.97006049783542872712395099;
++    x[21] = 0.99429458548239929207303142;
++  }
++  else if ( n == 23 )
++  {
++    x[0] = -0.99476933499755212352392572;
++    x[1] = -0.97254247121811523195602408;
++    x[2] = -0.93297108682601610234919699;
++    x[3] = -0.87675235827044166737815689;
++    x[4] = -0.80488840161883989215111841;
++    x[5] = -0.71866136313195019446162448;
++    x[6] = -0.61960987576364615638509731;
++    x[7] = -0.50950147784600754968979305;
++    x[8] = -0.39030103803029083142148887;
++    x[9] = -0.26413568097034493053386954;
++    x[10] = -0.13325682429846611093174268;
++    x[11] = 0.00000000000000000000000000;
++    x[12] = 0.13325682429846611093174268;
++    x[13] = 0.26413568097034493053386954;
++    x[14] = 0.39030103803029083142148887;
++    x[15] = 0.50950147784600754968979305;
++    x[16] = 0.61960987576364615638509731;
++    x[17] = 0.71866136313195019446162448;
++    x[18] = 0.80488840161883989215111841;
++    x[19] = 0.87675235827044166737815689;
++    x[20] = 0.93297108682601610234919699;
++    x[21] = 0.97254247121811523195602408;
++    x[22] = 0.99476933499755212352392572;
++  }
++  else if ( n == 24 )
++  {
++    x[0] = -0.99518721999702136017999741;
++    x[1] = -0.97472855597130949819839199;
++    x[2] = -0.93827455200273275852364900;
++    x[3] = -0.88641552700440103421315434;
++    x[4] = -0.82000198597390292195394987;
++    x[5] = -0.74012419157855436424382810;
++    x[6] = -0.64809365193697556925249579;
++    x[7] = -0.54542147138883953565837562;
++    x[8] = -0.43379350762604513848708423;
++    x[9] = -0.31504267969616337438679329;
++    x[10] = -0.19111886747361630915863982;
++    x[11] = -0.06405689286260562608504308;
++    x[12] = 0.06405689286260562608504308;
++    x[13] = 0.19111886747361630915863982;
++    x[14] = 0.31504267969616337438679329;
++    x[15] = 0.43379350762604513848708423;
++    x[16] = 0.54542147138883953565837562;
++    x[17] = 0.64809365193697556925249579;
++    x[18] = 0.74012419157855436424382810;
++    x[19] = 0.82000198597390292195394987;
++    x[20] = 0.88641552700440103421315434;
++    x[21] = 0.93827455200273275852364900;
++    x[22] = 0.97472855597130949819839199;
++    x[23] = 0.99518721999702136017999741;
++  }
++  else if ( n == 25 )
++  {
++    x[0] = -0.99555696979049809790878495;
++    x[1] = -0.97666392145951751149831539;
++    x[2] = -0.94297457122897433941401117;
++    x[3] = -0.89499199787827536885104201;
++    x[4] = -0.83344262876083400142102111;
++    x[5] = -0.75925926303735763057728287;
++    x[6] = -0.67356636847346836448512063;
++    x[7] = -0.57766293024122296772368984;
++    x[8] = -0.47300273144571496052218212;
++    x[9] = -0.36117230580938783773582173;
++    x[10] = -0.24386688372098843204519036;
++    x[11] = -0.12286469261071039638735982;
++    x[12] = 0.00000000000000000000000000;
++    x[13] = 0.12286469261071039638735982;
++    x[14] = 0.24386688372098843204519036;
++    x[15] = 0.36117230580938783773582173;
++    x[16] = 0.47300273144571496052218212;
++    x[17] = 0.57766293024122296772368984;
++    x[18] = 0.67356636847346836448512063;
++    x[19] = 0.75925926303735763057728287;
++    x[20] = 0.83344262876083400142102111;
++    x[21] = 0.89499199787827536885104201;
++    x[22] = 0.94297457122897433941401117;
++    x[23] = 0.97666392145951751149831539;
++    x[24] = 0.99555696979049809790878495;
++  }
++  else if ( n == 26 )
++  {
++    x[0] = -0.99588570114561692900321696;
++    x[1] = -0.97838544595647099110058035;
++    x[2] = -0.94715906666171425013591528;
++    x[3] = -0.90263786198430707421766560;
++    x[4] = -0.84544594278849801879750706;
++    x[5] = -0.77638594882067885619296725;
++    x[6] = -0.69642726041995726486381391;
++    x[7] = -0.60669229301761806323197875;
++    x[8] = -0.50844071482450571769570306;
++    x[9] = -0.40305175512348630648107738;
++    x[10] = -0.29200483948595689514283538;
++    x[11] = -0.17685882035689018396905775;
++    x[12] = -0.05923009342931320709371858;
++    x[13] = 0.05923009342931320709371858;
++    x[14] = 0.17685882035689018396905775;
++    x[15] = 0.29200483948595689514283538;
++    x[16] = 0.40305175512348630648107738;
++    x[17] = 0.50844071482450571769570306;
++    x[18] = 0.60669229301761806323197875;
++    x[19] = 0.69642726041995726486381391;
++    x[20] = 0.77638594882067885619296725;
++    x[21] = 0.84544594278849801879750706;
++    x[22] = 0.90263786198430707421766560;
++    x[23] = 0.94715906666171425013591528;
++    x[24] = 0.97838544595647099110058035;
++    x[25] = 0.99588570114561692900321696;
++  }
++  else if ( n == 27 )
++  {
++    x[0] = -0.99617926288898856693888721;
++    x[1] = -0.97992347596150122285587336;
++    x[2] = -0.95090055781470500685190803;
++    x[3] = -0.90948232067749110430064502;
++    x[4] = -0.85620790801829449030273722;
++    x[5] = -0.79177163907050822714439734;
++    x[6] = -0.71701347373942369929481621;
++    x[7] = -0.63290797194649514092773464;
++    x[8] = -0.54055156457945689490030094;
++    x[9] = -0.44114825175002688058597416;
++    x[10] = -0.33599390363850889973031903;
++    x[11] = -0.22645936543953685885723911;
++    x[12] = -0.11397258560952996693289498;
++    x[13] = 0.00000000000000000000000000;
++    x[14] = 0.11397258560952996693289498;
++    x[15] = 0.22645936543953685885723911;
++    x[16] = 0.33599390363850889973031903;
++    x[17] = 0.44114825175002688058597416;
++    x[18] = 0.54055156457945689490030094;
++    x[19] = 0.63290797194649514092773464;
++    x[20] = 0.71701347373942369929481621;
++    x[21] = 0.79177163907050822714439734;
++    x[22] = 0.85620790801829449030273722;
++    x[23] = 0.90948232067749110430064502;
++    x[24] = 0.95090055781470500685190803;
++    x[25] = 0.97992347596150122285587336;
++    x[26] = 0.99617926288898856693888721;
++  }
++  else if ( n == 28 )
++  {
++    x[0] = -0.99644249757395444995043639;
++    x[1] = -0.98130316537087275369455995;
++    x[2] = -0.95425928062893819725410184;
++    x[3] = -0.91563302639213207386968942;
++    x[4] = -0.86589252257439504894225457;
++    x[5] = -0.80564137091717917144788596;
++    x[6] = -0.73561087801363177202814451;
++    x[7] = -0.65665109403886496121989818;
++    x[8] = -0.56972047181140171930800328;
++    x[9] = -0.47587422495511826103441185;
++    x[10] = -0.37625151608907871022135721;
++    x[11] = -0.27206162763517807767682636;
++    x[12] = -0.16456928213338077128147178;
++    x[13] = -0.05507928988403427042651653;
++    x[14] = 0.05507928988403427042651653;
++    x[15] = 0.16456928213338077128147178;
++    x[16] = 0.27206162763517807767682636;
++    x[17] = 0.37625151608907871022135721;
++    x[18] = 0.47587422495511826103441185;
++    x[19] = 0.56972047181140171930800328;
++    x[20] = 0.65665109403886496121989818;
++    x[21] = 0.73561087801363177202814451;
++    x[22] = 0.80564137091717917144788596;
++    x[23] = 0.86589252257439504894225457;
++    x[24] = 0.91563302639213207386968942;
++    x[25] = 0.95425928062893819725410184;
++    x[26] = 0.98130316537087275369455995;
++    x[27] = 0.99644249757395444995043639;
++  }
++  else if ( n == 29 )
++  {
++    x[0] = -0.99667944226059658616319153;
++    x[1] = -0.98254550526141317487092602;
++    x[2] = -0.95728559577808772579820804;
++    x[3] = -0.92118023295305878509375344;
++    x[4] = -0.87463780492010279041779342;
++    x[5] = -0.81818548761525244498957221;
++    x[6] = -0.75246285173447713391261008;
++    x[7] = -0.67821453760268651515618501;
++    x[8] = -0.59628179713822782037958621;
++    x[9] = -0.50759295512422764210262792;
++    x[10] = -0.41315288817400866389070659;
++    x[11] = -0.31403163786763993494819592;
++    x[12] = -0.21135228616600107450637573;
++    x[13] = -0.10627823013267923017098239;
++    x[14] = 0.00000000000000000000000000;
++    x[15] = 0.10627823013267923017098239;
++    x[16] = 0.21135228616600107450637573;
++    x[17] = 0.31403163786763993494819592;
++    x[18] = 0.41315288817400866389070659;
++    x[19] = 0.50759295512422764210262792;
++    x[20] = 0.59628179713822782037958621;
++    x[21] = 0.67821453760268651515618501;
++    x[22] = 0.75246285173447713391261008;
++    x[23] = 0.81818548761525244498957221;
++    x[24] = 0.87463780492010279041779342;
++    x[25] = 0.92118023295305878509375344;
++    x[26] = 0.95728559577808772579820804;
++    x[27] = 0.98254550526141317487092602;
++    x[28] = 0.99667944226059658616319153;
++  }
++  else if ( n == 30 )
++  {
++    x[0] = -0.99689348407464954027163005;
++    x[1] = -0.98366812327974720997003258;
++    x[2] = -0.96002186496830751221687103;
++    x[3] = -0.92620004742927432587932428;
++    x[4] = -0.88256053579205268154311646;
++    x[5] = -0.82956576238276839744289812;
++    x[6] = -0.76777743210482619491797734;
++    x[7] = -0.69785049479331579693229239;
++    x[8] = -0.62052618298924286114047756;
++    x[9] = -0.53662414814201989926416979;
++    x[10] = -0.44703376953808917678060990;
++    x[11] = -0.35270472553087811347103721;
++    x[12] = -0.25463692616788984643980513;
++    x[13] = -0.15386991360858354696379467;
++    x[14] = -0.05147184255531769583302521;
++    x[15] = 0.05147184255531769583302521;
++    x[16] = 0.15386991360858354696379467;
++    x[17] = 0.25463692616788984643980513;
++    x[18] = 0.35270472553087811347103721;
++    x[19] = 0.44703376953808917678060990;
++    x[20] = 0.53662414814201989926416979;
++    x[21] = 0.62052618298924286114047756;
++    x[22] = 0.69785049479331579693229239;
++    x[23] = 0.76777743210482619491797734;
++    x[24] = 0.82956576238276839744289812;
++    x[25] = 0.88256053579205268154311646;
++    x[26] = 0.92620004742927432587932428;
++    x[27] = 0.96002186496830751221687103;
++    x[28] = 0.98366812327974720997003258;
++    x[29] = 0.99689348407464954027163005;
++  }
++  else if ( n == 31 )
++  {
++    x[0] = -0.99708748181947707405562655;
++    x[1] = -0.98468590966515248400246517;
++    x[2] = -0.96250392509294966178905240;
++    x[3] = -0.93075699789664816495694576;
++    x[4] = -0.88976002994827104337419201;
++    x[5] = -0.83992032014626734008690454;
++    x[6] = -0.78173314841662494040636002;
++    x[7] = -0.71577678458685328390597087;
++    x[8] = -0.64270672292426034618441820;
++    x[9] = -0.56324916140714926272094492;
++    x[10] = -0.47819378204490248044059404;
++    x[11] = -0.38838590160823294306135146;
++    x[12] = -0.29471806998170161661790390;
++    x[13] = -0.19812119933557062877241300;
++    x[14] = -0.09955531215234152032517479;
++    x[15] = 0.00000000000000000000000000;
++    x[16] = 0.09955531215234152032517479;
++    x[17] = 0.19812119933557062877241300;
++    x[18] = 0.29471806998170161661790390;
++    x[19] = 0.38838590160823294306135146;
++    x[20] = 0.47819378204490248044059404;
++    x[21] = 0.56324916140714926272094492;
++    x[22] = 0.64270672292426034618441820;
++    x[23] = 0.71577678458685328390597087;
++    x[24] = 0.78173314841662494040636002;
++    x[25] = 0.83992032014626734008690454;
++    x[26] = 0.88976002994827104337419201;
++    x[27] = 0.93075699789664816495694576;
++    x[28] = 0.96250392509294966178905240;
++    x[29] = 0.98468590966515248400246517;
++    x[30] = 0.99708748181947707405562655;
++  }
++  else if ( n == 32 )
++  {
++    x[0] = -0.99726386184948156354498113;
++    x[1] = -0.98561151154526833540017504;
++    x[2] = -0.96476225558750643077381193;
++    x[3] = -0.93490607593773968917091913;
++    x[4] = -0.89632115576605212396530724;
++    x[5] = -0.84936761373256997013369300;
++    x[6] = -0.79448379596794240696309730;
++    x[7] = -0.73218211874028968038742667;
++    x[8] = -0.66304426693021520097511517;
++    x[9] = -0.58771575724076232904074548;
++    x[10] = -0.50689990893222939002374747;
++    x[11] = -0.42135127613063534536411944;
++    x[12] = -0.33186860228212764977991681;
++    x[13] = -0.23928736225213707454460321;
++    x[14] = -0.14447196158279649348518637;
++    x[15] = -0.04830766568773831623481257;
++    x[16] = 0.04830766568773831623481257;
++    x[17] = 0.14447196158279649348518637;
++    x[18] = 0.23928736225213707454460321;
++    x[19] = 0.33186860228212764977991681;
++    x[20] = 0.42135127613063534536411944;
++    x[21] = 0.50689990893222939002374747;
++    x[22] = 0.58771575724076232904074548;
++    x[23] = 0.66304426693021520097511517;
++    x[24] = 0.73218211874028968038742667;
++    x[25] = 0.79448379596794240696309730;
++    x[26] = 0.84936761373256997013369300;
++    x[27] = 0.89632115576605212396530724;
++    x[28] = 0.93490607593773968917091913;
++    x[29] = 0.96476225558750643077381193;
++    x[30] = 0.98561151154526833540017504;
++    x[31] = 0.99726386184948156354498113;
++  }
++  else if ( n == 33 )
++  {
++    x[0] = -0.99742469424645521726616802;
++    x[1] = -0.98645572623064248811037570;
++    x[2] = -0.96682290968999276892837771;
++    x[3] = -0.93869437261116835035583512;
++    x[4] = -0.90231676774343358304053133;
++    x[5] = -0.85800965267650406464306148;
++    x[6] = -0.80616235627416658979620087;
++    x[7] = -0.74723049644956215785905512;
++    x[8] = -0.68173195996974278626821595;
++    x[9] = -0.61024234583637902730728751;
++    x[10] = -0.53338990478634764354889426;
++    x[11] = -0.45185001727245069572599328;
++    x[12] = -0.36633925774807334107022062;
++    x[13] = -0.27760909715249702940324807;
++    x[14] = -0.18643929882799157233579876;
++    x[15] = -0.09363106585473338567074292;
++    x[16] = 0.00000000000000000000000000;
++    x[17] = 0.09363106585473338567074292;
++    x[18] = 0.18643929882799157233579876;
++    x[19] = 0.27760909715249702940324807;
++    x[20] = 0.36633925774807334107022062;
++    x[21] = 0.45185001727245069572599328;
++    x[22] = 0.53338990478634764354889426;
++    x[23] = 0.61024234583637902730728751;
++    x[24] = 0.68173195996974278626821595;
++    x[25] = 0.74723049644956215785905512;
++    x[26] = 0.80616235627416658979620087;
++    x[27] = 0.85800965267650406464306148;
++    x[28] = 0.90231676774343358304053133;
++    x[29] = 0.93869437261116835035583512;
++    x[30] = 0.96682290968999276892837771;
++    x[31] = 0.98645572623064248811037570;
++    x[32] = 0.99742469424645521726616802;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEGENDRE_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::cerr << "  Legal values are 1 through 33.\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++void legendre_lookup_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_LOOKUP_WEIGHTS looks up weights for Gauss-Legendre quadrature.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Vladimir Krylov,
++//    Approximate Calculation of Integrals,
++//    Dover, 2006,
++//    ISBN: 0486445798.
++//    LC: QA311.K713.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//    Stephen Wolfram,
++//    The Mathematica Book,
++//    Fourth Edition,
++//    Cambridge University Press, 1999,
++//    ISBN: 0-521-64314-7,
++//    LC: QA76.95.W65.
++//
++//    Daniel Zwillinger, editor,
++//    CRC Standard Mathematical Tables and Formulae,
++//    30th Edition,
++//    CRC Press, 1996,
++//    ISBN: 0-8493-2479-3,
++//    LC: QA47.M315.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    N must be between 1 and 33.
++//
++//    Output, double W[N], the weights.
++//
++{
++  if ( n == 1 )
++  {
++    w[0] = 2.000000000000000000000000000000;
++  }
++  else if ( n == 2 )
++  {
++    w[0] = 1.000000000000000000000000000000;
++    w[1] = 1.000000000000000000000000000000;
++  }
++  else if ( n == 3 )
++  {
++    w[0] = 0.555555555555555555555555555556;
++    w[1] = 0.888888888888888888888888888889;
++    w[2] = 0.555555555555555555555555555556;
++  }
++  else if ( n == 4 )
++  {
++    w[0] = 0.347854845137453857373063949222;
++    w[1] = 0.652145154862546142626936050778;
++    w[2] = 0.652145154862546142626936050778;
++    w[3] = 0.347854845137453857373063949222;
++  }
++  else if ( n == 5 )
++  {
++    w[0] = 0.236926885056189087514264040720;
++    w[1] = 0.478628670499366468041291514836;
++    w[2] = 0.568888888888888888888888888889;
++    w[3] = 0.478628670499366468041291514836;
++    w[4] = 0.236926885056189087514264040720;
++  }
++  else if ( n == 6 )
++  {
++    w[0] = 0.171324492379170345040296142173;
++    w[1] = 0.360761573048138607569833513838;
++    w[2] = 0.467913934572691047389870343990;
++    w[3] = 0.467913934572691047389870343990;
++    w[4] = 0.360761573048138607569833513838;
++    w[5] = 0.171324492379170345040296142173;
++  }
++  else if ( n == 7 )
++  {
++    w[0] = 0.129484966168869693270611432679;
++    w[1] = 0.279705391489276667901467771424;
++    w[2] = 0.381830050505118944950369775489;
++    w[3] = 0.417959183673469387755102040816;
++    w[4] = 0.381830050505118944950369775489;
++    w[5] = 0.279705391489276667901467771424;
++    w[6] = 0.129484966168869693270611432679;
++  }
++  else if ( n == 8 )
++  {
++    w[0] = 0.101228536290376259152531354310;
++    w[1] = 0.222381034453374470544355994426;
++    w[2] = 0.313706645877887287337962201987;
++    w[3] = 0.362683783378361982965150449277;
++    w[4] = 0.362683783378361982965150449277;
++    w[5] = 0.313706645877887287337962201987;
++    w[6] = 0.222381034453374470544355994426;
++    w[7] = 0.101228536290376259152531354310;
++  }
++  else if ( n == 9 )
++  {
++    w[0] = 0.081274388361574411971892158111;
++    w[1] = 0.18064816069485740405847203124;
++    w[2] = 0.26061069640293546231874286942;
++    w[3] = 0.31234707704000284006863040658;
++    w[4] = 0.33023935500125976316452506929;
++    w[5] = 0.31234707704000284006863040658;
++    w[6] = 0.26061069640293546231874286942;
++    w[7] = 0.18064816069485740405847203124;
++    w[8] = 0.081274388361574411971892158111;
++  }
++  else if ( n == 10 )
++  {
++    w[0] = 0.066671344308688137593568809893;
++    w[1] = 0.14945134915058059314577633966;
++    w[2] = 0.21908636251598204399553493423;
++    w[3] = 0.26926671930999635509122692157;
++    w[4] = 0.29552422471475287017389299465;
++    w[5] = 0.29552422471475287017389299465;
++    w[6] = 0.26926671930999635509122692157;
++    w[7] = 0.21908636251598204399553493423;
++    w[8] = 0.14945134915058059314577633966;
++    w[9] = 0.066671344308688137593568809893;
++  }
++  else if ( n == 11 )
++  {
++    w[0] = 0.055668567116173666482753720443;
++    w[1] = 0.12558036946490462463469429922;
++    w[2] = 0.18629021092773425142609764143;
++    w[3] = 0.23319376459199047991852370484;
++    w[4] = 0.26280454451024666218068886989;
++    w[5] = 0.27292508677790063071448352834;
++    w[6] = 0.26280454451024666218068886989;
++    w[7] = 0.23319376459199047991852370484;
++    w[8] = 0.18629021092773425142609764143;
++    w[9] = 0.12558036946490462463469429922;
++    w[10] = 0.055668567116173666482753720443;
++  }
++  else if ( n == 12 )
++  {
++    w[0] = 0.047175336386511827194615961485;
++    w[1] = 0.10693932599531843096025471819;
++    w[2] = 0.16007832854334622633465252954;
++    w[3] = 0.20316742672306592174906445581;
++    w[4] = 0.23349253653835480876084989892;
++    w[5] = 0.24914704581340278500056243604;
++    w[6] = 0.24914704581340278500056243604;
++    w[7] = 0.23349253653835480876084989892;
++    w[8] = 0.20316742672306592174906445581;
++    w[9] = 0.16007832854334622633465252954;
++    w[10] = 0.10693932599531843096025471819;
++    w[11] = 0.047175336386511827194615961485;
++  }
++  else if ( n == 13 )
++  {
++    w[0] = 0.040484004765315879520021592201;
++    w[1] = 0.092121499837728447914421775954;
++    w[2] = 0.13887351021978723846360177687;
++    w[3] = 0.17814598076194573828004669200;
++    w[4] = 0.20781604753688850231252321931;
++    w[5] = 0.22628318026289723841209018604;
++    w[6] = 0.23255155323087391019458951527;
++    w[7] = 0.22628318026289723841209018604;
++    w[8] = 0.20781604753688850231252321931;
++    w[9] = 0.17814598076194573828004669200;
++    w[10] = 0.13887351021978723846360177687;
++    w[11] = 0.092121499837728447914421775954;
++    w[12] = 0.040484004765315879520021592201;
++  }
++  else if ( n == 14 )
++  {
++    w[0] = 0.035119460331751863031832876138;
++    w[1] = 0.08015808715976020980563327706;
++    w[2] = 0.12151857068790318468941480907;
++    w[3] = 0.15720316715819353456960193862;
++    w[4] = 0.18553839747793781374171659013;
++    w[5] = 0.20519846372129560396592406566;
++    w[6] = 0.21526385346315779019587644332;
++    w[7] = 0.21526385346315779019587644332;
++    w[8] = 0.20519846372129560396592406566;
++    w[9] = 0.18553839747793781374171659013;
++    w[10] = 0.15720316715819353456960193862;
++    w[11] = 0.12151857068790318468941480907;
++    w[12] = 0.08015808715976020980563327706;
++    w[13] = 0.035119460331751863031832876138;
++  }
++  else if ( n == 15 )
++  {
++    w[0] = 0.030753241996117268354628393577;
++    w[1] = 0.070366047488108124709267416451;
++    w[2] = 0.107159220467171935011869546686;
++    w[3] = 0.13957067792615431444780479451;
++    w[4] = 0.16626920581699393355320086048;
++    w[5] = 0.18616100001556221102680056187;
++    w[6] = 0.19843148532711157645611832644;
++    w[7] = 0.20257824192556127288062019997;
++    w[8] = 0.19843148532711157645611832644;
++    w[9] = 0.18616100001556221102680056187;
++    w[10] = 0.16626920581699393355320086048;
++    w[11] = 0.13957067792615431444780479451;
++    w[12] = 0.107159220467171935011869546686;
++    w[13] = 0.070366047488108124709267416451;
++    w[14] = 0.030753241996117268354628393577;
++  }
++  else if ( n == 16 )
++  {
++    w[0] = 0.027152459411754094851780572456;
++    w[1] = 0.062253523938647892862843836994;
++    w[2] = 0.09515851168249278480992510760;
++    w[3] = 0.12462897125553387205247628219;
++    w[4] = 0.14959598881657673208150173055;
++    w[5] = 0.16915651939500253818931207903;
++    w[6] = 0.18260341504492358886676366797;
++    w[7] = 0.18945061045506849628539672321;
++    w[8] = 0.18945061045506849628539672321;
++    w[9] = 0.18260341504492358886676366797;
++    w[10] = 0.16915651939500253818931207903;
++    w[11] = 0.14959598881657673208150173055;
++    w[12] = 0.12462897125553387205247628219;
++    w[13] = 0.09515851168249278480992510760;
++    w[14] = 0.062253523938647892862843836994;
++    w[15] = 0.027152459411754094851780572456;
++  }
++  else if ( n == 17 )
++  {
++    w[0] = 0.024148302868547931960110026288;
++    w[1] = 0.055459529373987201129440165359;
++    w[2] = 0.085036148317179180883535370191;
++    w[3] = 0.111883847193403971094788385626;
++    w[4] = 0.13513636846852547328631998170;
++    w[5] = 0.15404576107681028808143159480;
++    w[6] = 0.16800410215645004450997066379;
++    w[7] = 0.17656270536699264632527099011;
++    w[8] = 0.17944647035620652545826564426;
++    w[9] = 0.17656270536699264632527099011;
++    w[10] = 0.16800410215645004450997066379;
++    w[11] = 0.15404576107681028808143159480;
++    w[12] = 0.13513636846852547328631998170;
++    w[13] = 0.111883847193403971094788385626;
++    w[14] = 0.085036148317179180883535370191;
++    w[15] = 0.055459529373987201129440165359;
++    w[16] = 0.024148302868547931960110026288;
++  }
++  else if ( n == 18 )
++  {
++    w[0] = 0.021616013526483310313342710266;
++    w[1] = 0.049714548894969796453334946203;
++    w[2] = 0.07642573025488905652912967762;
++    w[3] = 0.10094204410628716556281398492;
++    w[4] = 0.12255520671147846018451912680;
++    w[5] = 0.14064291467065065120473130375;
++    w[6] = 0.15468467512626524492541800384;
++    w[7] = 0.16427648374583272298605377647;
++    w[8] = 0.16914238296314359184065647013;
++    w[9] = 0.16914238296314359184065647013;
++    w[10] = 0.16427648374583272298605377647;
++    w[11] = 0.15468467512626524492541800384;
++    w[12] = 0.14064291467065065120473130375;
++    w[13] = 0.12255520671147846018451912680;
++    w[14] = 0.10094204410628716556281398492;
++    w[15] = 0.07642573025488905652912967762;
++    w[16] = 0.049714548894969796453334946203;
++    w[17] = 0.021616013526483310313342710266;
++  }
++  else if ( n == 19 )
++  {
++    w[0] = 0.019461788229726477036312041464;
++    w[1] = 0.044814226765699600332838157402;
++    w[2] = 0.069044542737641226580708258006;
++    w[3] = 0.091490021622449999464462094124;
++    w[4] = 0.111566645547333994716023901682;
++    w[5] = 0.12875396253933622767551578486;
++    w[6] = 0.14260670217360661177574610944;
++    w[7] = 0.15276604206585966677885540090;
++    w[8] = 0.15896884339395434764995643946;
++    w[9] = 0.16105444984878369597916362532;
++    w[10] = 0.15896884339395434764995643946;
++    w[11] = 0.15276604206585966677885540090;
++    w[12] = 0.14260670217360661177574610944;
++    w[13] = 0.12875396253933622767551578486;
++    w[14] = 0.111566645547333994716023901682;
++    w[15] = 0.091490021622449999464462094124;
++    w[16] = 0.069044542737641226580708258006;
++    w[17] = 0.044814226765699600332838157402;
++    w[18] = 0.019461788229726477036312041464;
++  }
++  else if ( n == 20 )
++  {
++    w[0] = 0.017614007139152118311861962352;
++    w[1] = 0.040601429800386941331039952275;
++    w[2] = 0.062672048334109063569506535187;
++    w[3] = 0.08327674157670474872475814322;
++    w[4] = 0.10193011981724043503675013548;
++    w[5] = 0.11819453196151841731237737771;
++    w[6] = 0.13168863844917662689849449975;
++    w[7] = 0.14209610931838205132929832507;
++    w[8] = 0.14917298647260374678782873700;
++    w[9] = 0.15275338713072585069808433195;
++    w[10] = 0.15275338713072585069808433195;
++    w[11] = 0.14917298647260374678782873700;
++    w[12] = 0.14209610931838205132929832507;
++    w[13] = 0.13168863844917662689849449975;
++    w[14] = 0.11819453196151841731237737771;
++    w[15] = 0.10193011981724043503675013548;
++    w[16] = 0.08327674157670474872475814322;
++    w[17] = 0.062672048334109063569506535187;
++    w[18] = 0.040601429800386941331039952275;
++    w[19] = 0.017614007139152118311861962352;
++  }
++  else if ( n == 21 )
++  {
++    w[ 0] =   0.016017228257774333324224616858;
++    w[ 1] =   0.036953789770852493799950668299;
++    w[ 2] =   0.057134425426857208283635826472;
++    w[ 3] =   0.076100113628379302017051653300;
++    w[ 4] =   0.093444423456033861553289741114;
++    w[ 5] =   0.108797299167148377663474578070;
++    w[ 6] =   0.12183141605372853419536717713;
++    w[ 7] =   0.13226893863333746178105257450;
++    w[ 8] =   0.13988739479107315472213342387;
++    w[9] =   0.14452440398997005906382716655;
++    w[10] =   0.14608113364969042719198514768;
++    w[11] =   0.14452440398997005906382716655;
++    w[12] =   0.13988739479107315472213342387;
++    w[13] =   0.13226893863333746178105257450;
++    w[14] =   0.12183141605372853419536717713;
++    w[15] =   0.108797299167148377663474578070;
++    w[16] =   0.093444423456033861553289741114;
++    w[17] =   0.076100113628379302017051653300;
++    w[18] =   0.057134425426857208283635826472;
++    w[19] =   0.036953789770852493799950668299;
++    w[20] =   0.016017228257774333324224616858;
++  }
++  else if ( n == 22 )
++  {
++    w[0] = 0.014627995298272200684991098047;
++    w[1] = 0.033774901584814154793302246866;
++    w[2] = 0.052293335152683285940312051273;
++    w[3] = 0.06979646842452048809496141893;
++    w[4] = 0.08594160621706772741444368137;
++    w[5] = 0.10041414444288096493207883783;
++    w[6] = 0.11293229608053921839340060742;
++    w[7] = 0.12325237681051242428556098615;
++    w[8] = 0.13117350478706237073296499253;
++    w[9] = 0.13654149834601517135257383123;
++    w[10] = 0.13925187285563199337541024834;
++    w[11] = 0.13925187285563199337541024834;
++    w[12] = 0.13654149834601517135257383123;
++    w[13] = 0.13117350478706237073296499253;
++    w[14] = 0.12325237681051242428556098615;
++    w[15] = 0.11293229608053921839340060742;
++    w[16] = 0.10041414444288096493207883783;
++    w[17] = 0.08594160621706772741444368137;
++    w[18] = 0.06979646842452048809496141893;
++    w[19] = 0.052293335152683285940312051273;
++    w[20] = 0.033774901584814154793302246866;
++    w[21] = 0.014627995298272200684991098047;
++  }
++  else if ( n == 23 )
++  {
++    w[0] = 0.013411859487141772081309493459;
++    w[1] = 0.030988005856979444310694219642;
++    w[2] = 0.048037671731084668571641071632;
++    w[3] = 0.064232421408525852127169615159;
++    w[4] = 0.079281411776718954922892524742;
++    w[5] = 0.092915766060035147477018617370;
++    w[6] = 0.104892091464541410074086185015;
++    w[7] = 0.11499664022241136494164351293;
++    w[8] = 0.12304908430672953046757840067;
++    w[9] = 0.12890572218808214997859533940;
++    w[10] = 0.13246203940469661737164246470;
++    w[11] = 0.13365457218610617535145711055;
++    w[12] = 0.13246203940469661737164246470;
++    w[13] = 0.12890572218808214997859533940;
++    w[14] = 0.12304908430672953046757840067;
++    w[15] = 0.11499664022241136494164351293;
++    w[16] = 0.104892091464541410074086185015;
++    w[17] = 0.092915766060035147477018617370;
++    w[18] = 0.079281411776718954922892524742;
++    w[19] = 0.064232421408525852127169615159;
++    w[20] = 0.048037671731084668571641071632;
++    w[21] = 0.030988005856979444310694219642;
++    w[22] = 0.013411859487141772081309493459;
++  }
++  else if ( n == 24 )
++  {
++    w[0] = 0.012341229799987199546805667070;
++    w[1] = 0.028531388628933663181307815952;
++    w[2] = 0.044277438817419806168602748211;
++    w[3] = 0.059298584915436780746367758500;
++    w[4] = 0.07334648141108030573403361525;
++    w[5] = 0.08619016153195327591718520298;
++    w[6] = 0.09761865210411388826988066446;
++    w[7] = 0.10744427011596563478257734245;
++    w[8] = 0.11550566805372560135334448391;
++    w[9] = 0.12167047292780339120446315348;
++    w[10] = 0.12583745634682829612137538251;
++    w[11] = 0.12793819534675215697405616522;
++    w[12] = 0.12793819534675215697405616522;
++    w[13] = 0.12583745634682829612137538251;
++    w[14] = 0.12167047292780339120446315348;
++    w[15] = 0.11550566805372560135334448391;
++    w[16] = 0.10744427011596563478257734245;
++    w[17] = 0.09761865210411388826988066446;
++    w[18] = 0.08619016153195327591718520298;
++    w[19] = 0.07334648141108030573403361525;
++    w[20] = 0.059298584915436780746367758500;
++    w[21] = 0.044277438817419806168602748211;
++    w[22] = 0.028531388628933663181307815952;
++    w[23] = 0.012341229799987199546805667070;
++  }
++  else if ( n == 25 )
++  {
++    w[0] = 0.0113937985010262879479029641132;
++    w[1] = 0.026354986615032137261901815295;
++    w[2] = 0.040939156701306312655623487712;
++    w[3] = 0.054904695975835191925936891541;
++    w[4] = 0.068038333812356917207187185657;
++    w[5] = 0.080140700335001018013234959669;
++    w[6] = 0.091028261982963649811497220703;
++    w[7] = 0.100535949067050644202206890393;
++    w[8] = 0.108519624474263653116093957050;
++    w[9] = 0.11485825914571164833932554587;
++    w[10] = 0.11945576353578477222817812651;
++    w[11] = 0.12224244299031004168895951895;
++    w[12] = 0.12317605372671545120390287308;
++    w[13] = 0.12224244299031004168895951895;
++    w[14] = 0.11945576353578477222817812651;
++    w[15] = 0.11485825914571164833932554587;
++    w[16] = 0.108519624474263653116093957050;
++    w[17] = 0.100535949067050644202206890393;
++    w[18] = 0.091028261982963649811497220703;
++    w[19] = 0.080140700335001018013234959669;
++    w[20] = 0.068038333812356917207187185657;
++    w[21] = 0.054904695975835191925936891541;
++    w[22] = 0.040939156701306312655623487712;
++    w[23] = 0.026354986615032137261901815295;
++    w[24] = 0.0113937985010262879479029641132;
++  }
++  else if ( n == 26 )
++  {
++    w[0] = 0.010551372617343007155651187685;
++    w[1] = 0.024417851092631908789615827520;
++    w[2] = 0.037962383294362763950303141249;
++    w[3] = 0.050975825297147811998319900724;
++    w[4] = 0.063274046329574835539453689907;
++    w[5] = 0.07468414976565974588707579610;
++    w[6] = 0.08504589431348523921044776508;
++    w[7] = 0.09421380035591414846366488307;
++    w[8] = 0.10205916109442542323841407025;
++    w[9] = 0.10847184052857659065657942673;
++    w[10] = 0.11336181654631966654944071844;
++    w[11] = 0.11666044348529658204466250754;
++    w[12] = 0.11832141527926227651637108570;
++    w[13] = 0.11832141527926227651637108570;
++    w[14] = 0.11666044348529658204466250754;
++    w[15] = 0.11336181654631966654944071844;
++    w[16] = 0.10847184052857659065657942673;
++    w[17] = 0.10205916109442542323841407025;
++    w[18] = 0.09421380035591414846366488307;
++    w[19] = 0.08504589431348523921044776508;
++    w[20] = 0.07468414976565974588707579610;
++    w[21] = 0.063274046329574835539453689907;
++    w[22] = 0.050975825297147811998319900724;
++    w[23] = 0.037962383294362763950303141249;
++    w[24] = 0.024417851092631908789615827520;
++    w[25] = 0.010551372617343007155651187685;
++  }
++  else if ( n == 27 )
++  {
++    w[0] = 0.0097989960512943602611500550912;
++    w[1] = 0.022686231596180623196034206447;
++    w[2] = 0.035297053757419711022578289305;
++    w[3] = 0.047449412520615062704096710114;
++    w[4] = 0.058983536859833599110300833720;
++    w[5] = 0.069748823766245592984322888357;
++    w[6] = 0.079604867773057771263074959010;
++    w[7] = 0.088423158543756950194322802854;
++    w[8] = 0.096088727370028507565652646558;
++    w[9] = 0.102501637817745798671247711533;
++    w[10] = 0.107578285788533187212162984427;
++    w[11] = 0.111252488356845192672163096043;
++    w[12] = 0.113476346108965148620369948092;
++    w[13] = 0.11422086737895698904504573690;
++    w[14] = 0.113476346108965148620369948092;
++    w[15] = 0.111252488356845192672163096043;
++    w[16] = 0.107578285788533187212162984427;
++    w[17] = 0.102501637817745798671247711533;
++    w[18] = 0.096088727370028507565652646558;
++    w[19] = 0.088423158543756950194322802854;
++    w[20] = 0.079604867773057771263074959010;
++    w[21] = 0.069748823766245592984322888357;
++    w[22] = 0.058983536859833599110300833720;
++    w[23] = 0.047449412520615062704096710114;
++    w[24] = 0.035297053757419711022578289305;
++    w[25] = 0.022686231596180623196034206447;
++    w[26] = 0.0097989960512943602611500550912;
++  }
++  else if ( n == 28 )
++  {
++    w[0] = 0.009124282593094517738816153923;
++    w[1] = 0.021132112592771259751500380993;
++    w[2] = 0.032901427782304379977630819171;
++    w[3] = 0.044272934759004227839587877653;
++    w[4] = 0.055107345675716745431482918227;
++    w[5] = 0.06527292396699959579339756678;
++    w[6] = 0.07464621423456877902393188717;
++    w[7] = 0.08311341722890121839039649824;
++    w[8] = 0.09057174439303284094218603134;
++    w[9] = 0.09693065799792991585048900610;
++    w[10] = 0.10211296757806076981421663851;
++    w[11] = 0.10605576592284641791041643700;
++    w[12] = 0.10871119225829413525357151930;
++    w[13] = 0.11004701301647519628237626560;
++    w[14] = 0.11004701301647519628237626560;
++    w[15] = 0.10871119225829413525357151930;
++    w[16] = 0.10605576592284641791041643700;
++    w[17] = 0.10211296757806076981421663851;
++    w[18] = 0.09693065799792991585048900610;
++    w[19] = 0.09057174439303284094218603134;
++    w[20] = 0.08311341722890121839039649824;
++    w[21] = 0.07464621423456877902393188717;
++    w[22] = 0.06527292396699959579339756678;
++    w[23] = 0.055107345675716745431482918227;
++    w[24] = 0.044272934759004227839587877653;
++    w[25] = 0.032901427782304379977630819171;
++    w[26] = 0.021132112592771259751500380993;
++    w[27] = 0.009124282593094517738816153923;
++  }
++  else if ( n == 29 )
++  {
++    w[0] = 0.0085169038787464096542638133022;
++    w[1] = 0.019732085056122705983859801640;
++    w[2] = 0.030740492202093622644408525375;
++    w[3] = 0.041402062518682836104830010114;
++    w[4] = 0.051594826902497923912594381180;
++    w[5] = 0.061203090657079138542109848024;
++    w[6] = 0.070117933255051278569581486949;
++    w[7] = 0.078238327135763783828144888660;
++    w[8] = 0.085472257366172527545344849297;
++    w[9] = 0.091737757139258763347966411077;
++    w[10] = 0.096963834094408606301900074883;
++    w[11] = 0.101091273759914966121820546907;
++    w[12] = 0.104073310077729373913328471285;
++    w[13] = 0.105876155097320941406591327852;
++    w[14] = 0.10647938171831424424651112691;
++    w[15] = 0.105876155097320941406591327852;
++    w[16] = 0.104073310077729373913328471285;
++    w[17] = 0.101091273759914966121820546907;
++    w[18] = 0.096963834094408606301900074883;
++    w[19] = 0.091737757139258763347966411077;
++    w[20] = 0.085472257366172527545344849297;
++    w[21] = 0.078238327135763783828144888660;
++    w[22] = 0.070117933255051278569581486949;
++    w[23] = 0.061203090657079138542109848024;
++    w[24] = 0.051594826902497923912594381180;
++    w[25] = 0.041402062518682836104830010114;
++    w[26] = 0.030740492202093622644408525375;
++    w[27] = 0.019732085056122705983859801640;
++    w[28] = 0.0085169038787464096542638133022;
++  }
++  else if ( n == 30 )
++  {
++    w[0] = 0.007968192496166605615465883475;
++    w[1] = 0.018466468311090959142302131912;
++    w[2] = 0.028784707883323369349719179611;
++    w[3] = 0.038799192569627049596801936446;
++    w[4] = 0.048402672830594052902938140423;
++    w[5] = 0.057493156217619066481721689402;
++    w[6] = 0.06597422988218049512812851512;
++    w[7] = 0.07375597473770520626824385002;
++    w[8] = 0.08075589522942021535469493846;
++    w[9] = 0.08689978720108297980238753072;
++    w[10] = 0.09212252223778612871763270709;
++    w[11] = 0.09636873717464425963946862635;
++    w[12] = 0.09959342058679526706278028210;
++    w[13] = 0.10176238974840550459642895217;
++    w[14] = 0.10285265289355884034128563671;
++    w[15] = 0.10285265289355884034128563671;
++    w[16] = 0.10176238974840550459642895217;
++    w[17] = 0.09959342058679526706278028210;
++    w[18] = 0.09636873717464425963946862635;
++    w[19] = 0.09212252223778612871763270709;
++    w[20] = 0.08689978720108297980238753072;
++    w[21] = 0.08075589522942021535469493846;
++    w[22] = 0.07375597473770520626824385002;
++    w[23] = 0.06597422988218049512812851512;
++    w[24] = 0.057493156217619066481721689402;
++    w[25] = 0.048402672830594052902938140423;
++    w[26] = 0.038799192569627049596801936446;
++    w[27] = 0.028784707883323369349719179611;
++    w[28] = 0.018466468311090959142302131912;
++    w[29] = 0.007968192496166605615465883475;
++  }
++  else if ( n == 31 )
++  {
++    w[0] = 0.0074708315792487758586968750322;
++    w[1] = 0.017318620790310582463157996087;
++    w[2] = 0.027009019184979421800608708092;
++    w[3] = 0.036432273912385464024392010468;
++    w[4] = 0.045493707527201102902315857895;
++    w[5] = 0.054103082424916853711666259087;
++    w[6] = 0.062174786561028426910343543687;
++    w[7] = 0.069628583235410366167756126255;
++    w[8] = 0.076390386598776616426357674901;
++    w[9] = 0.082392991761589263903823367432;
++    w[10] = 0.087576740608477876126198069695;
++    w[11] = 0.091890113893641478215362871607;
++    w[12] = 0.095290242912319512807204197488;
++    w[13] = 0.097743335386328725093474010979;
++    w[14] = 0.099225011226672307874875514429;
++    w[15] = 0.09972054479342645142753383373;
++    w[16] = 0.099225011226672307874875514429;
++    w[17] = 0.097743335386328725093474010979;
++    w[18] = 0.095290242912319512807204197488;
++    w[19] = 0.091890113893641478215362871607;
++    w[20] = 0.087576740608477876126198069695;
++    w[21] = 0.082392991761589263903823367432;
++    w[22] = 0.076390386598776616426357674901;
++    w[23] = 0.069628583235410366167756126255;
++    w[24] = 0.062174786561028426910343543687;
++    w[25] = 0.054103082424916853711666259087;
++    w[26] = 0.045493707527201102902315857895;
++    w[27] = 0.036432273912385464024392010468;
++    w[28] = 0.027009019184979421800608708092;
++    w[29] = 0.017318620790310582463157996087;
++    w[30] = 0.0074708315792487758586968750322;
++  }
++  else if ( n == 32 )
++  {
++    w[0] = 0.007018610009470096600407063739;
++    w[1] = 0.016274394730905670605170562206;
++    w[2] = 0.025392065309262059455752589789;
++    w[3] = 0.034273862913021433102687732252;
++    w[4] = 0.042835898022226680656878646606;
++    w[5] = 0.050998059262376176196163244690;
++    w[6] = 0.058684093478535547145283637300;
++    w[7] = 0.06582222277636184683765006371;
++    w[8] = 0.07234579410884850622539935648;
++    w[9] = 0.07819389578707030647174091883;
++    w[10] = 0.08331192422694675522219907460;
++    w[11] = 0.08765209300440381114277146275;
++    w[12] = 0.09117387869576388471286857711;
++    w[13] = 0.09384439908080456563918023767;
++    w[14] = 0.09563872007927485941908200220;
++    w[15] = 0.09654008851472780056676483006;
++    w[16] = 0.09654008851472780056676483006;
++    w[17] = 0.09563872007927485941908200220;
++    w[18] = 0.09384439908080456563918023767;
++    w[19] = 0.09117387869576388471286857711;
++    w[20] = 0.08765209300440381114277146275;
++    w[21] = 0.08331192422694675522219907460;
++    w[22] = 0.07819389578707030647174091883;
++    w[23] = 0.07234579410884850622539935648;
++    w[24] = 0.06582222277636184683765006371;
++    w[25] = 0.058684093478535547145283637300;
++    w[26] = 0.050998059262376176196163244690;
++    w[27] = 0.042835898022226680656878646606;
++    w[28] = 0.034273862913021433102687732252;
++    w[29] = 0.025392065309262059455752589789;
++    w[30] = 0.016274394730905670605170562206;
++    w[31] = 0.007018610009470096600407063739;
++  }
++  else if ( n == 33 )
++  {
++    w[0] = 0.0066062278475873780586492352085;
++    w[1] = 0.015321701512934676127945768534;
++    w[2] = 0.023915548101749480350533257529;
++    w[3] = 0.032300358632328953281561447250;
++    w[4] = 0.040401541331669591563409790527;
++    w[5] = 0.048147742818711695670146880138;
++    w[6] = 0.055470846631663561284944495439;
++    w[7] = 0.062306482530317480031627725771;
++    w[8] = 0.068594572818656712805955073015;
++    w[9] = 0.074279854843954149342472175919;
++    w[10] = 0.079312364794886738363908384942;
++    w[11] = 0.083647876067038707613928014518;
++    w[12] = 0.087248287618844337607281670945;
++    w[13] = 0.090081958660638577239743705500;
++    w[14] = 0.092123986643316846213240977717;
++    w[15] = 0.093356426065596116160999126274;
++    w[16] = 0.09376844616020999656730454155;
++    w[17] = 0.093356426065596116160999126274;
++    w[18] = 0.092123986643316846213240977717;
++    w[19] = 0.090081958660638577239743705500;
++    w[20] = 0.087248287618844337607281670945;
++    w[21] = 0.083647876067038707613928014518;
++    w[22] = 0.079312364794886738363908384942;
++    w[23] = 0.074279854843954149342472175919;
++    w[24] = 0.068594572818656712805955073015;
++    w[25] = 0.062306482530317480031627725771;
++    w[26] = 0.055470846631663561284944495439;
++    w[27] = 0.048147742818711695670146880138;
++    w[28] = 0.040401541331669591563409790527;
++    w[29] = 0.032300358632328953281561447250;
++    w[30] = 0.023915548101749480350533257529;
++    w[31] = 0.015321701512934676127945768534;
++    w[32] = 0.0066062278475873780586492352085;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEGENDRE_LOOKUP_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Illegal value of N = " << n << "\n";
++    std::cerr << "  Legal values are 1 through 33.\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++double *legendre_zeros ( int order )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEGENDRE_ZEROS returns the zeros of the Legendre polynomial of degree N.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 June 2011
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Philip Davis, Philip Rabinowitz.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Philip Davis, Philip Rabinowitz,
++//    Methods of Numerical Integration,
++//    Second Edition,
++//    Dover, 2007,
++//    ISBN: 0486453391,
++//    LC: QA299.3.D28.
++//
++//  Parameters:
++//
++//    Input, int ORDER, the order.
++//    ORDER must be greater than 0.
++//
++//    Output, double LEGENDRE_ZEROS[ORDER], the zeros.
++//
++{
++  double d1;
++  double d2pn;
++  double d3pn;
++  double d4pn;
++  double dp;
++  double dpn;
++  double e1;
++  double fx;
++  double h;
++  int i;
++  int iback;
++  int k;
++  int m;
++  int mp1mi;
++  int ncopy;
++  int nmove;
++  double p;
++  double pi = 3.141592653589793;
++  double pk;
++  double pkm1;
++  double pkp1;
++  double t;
++  double u;
++  double v;
++  double x0;
++  double *xtab;
++  double xtemp;
++
++  xtab = new double[order];
++
++  e1 = ( double ) ( order * ( order + 1 ) );
++
++  m = ( order + 1 ) / 2;
++
++  for ( i = 1; i <= m; i++ )
++  {
++    mp1mi = m + 1 - i;
++
++    t = ( double ) ( 4 * i - 1 ) * pi / ( double ) ( 4 * order + 2 );
++
++    x0 = std::cos ( t ) * ( 1.0 - ( 1.0 - 1.0 / ( double ) ( order ) )
++      / ( double ) ( 8 * order * order ) );
++
++    pkm1 = 1.0;
++    pk = x0;
++
++    for ( k = 2; k <= order; k++ )
++    {
++      pkp1 = 2.0 * x0 * pk - pkm1 - ( x0 * pk - pkm1 ) / ( double ) ( k );
++      pkm1 = pk;
++      pk = pkp1;
++    }
++
++    d1 = ( double ) ( order ) * ( pkm1 - x0 * pk );
++
++    dpn = d1 / ( 1.0 - x0 * x0 );
++
++    d2pn = ( 2.0 * x0 * dpn - e1 * pk ) / ( 1.0 - x0 * x0 );
++
++    d3pn = ( 4.0 * x0 * d2pn + ( 2.0 - e1 ) * dpn ) / ( 1.0 - x0 * x0 );
++
++    d4pn = ( 6.0 * x0 * d3pn + ( 6.0 - e1 ) * d2pn ) / ( 1.0 - x0 * x0 );
++
++    u = pk / dpn;
++    v = d2pn / dpn;
++//
++//  Initial approximation H:
++//
++    h = - u * ( 1.0 + 0.5 * u * ( v + u * ( v * v - d3pn / ( 3.0 * dpn ) ) ) );
++//
++//  Refine H using one step of Newton's method:
++//
++    p = pk + h * ( dpn + 0.5 * h * ( d2pn + h / 3.0
++      * ( d3pn + 0.25 * h * d4pn ) ) );
++
++    dp = dpn + h * ( d2pn + 0.5 * h * ( d3pn + h * d4pn / 3.0 ) );
++
++    h = h - p / dp;
++
++    xtemp = x0 + h;
++
++    xtab[mp1mi-1] = xtemp;
++
++    fx = d1 - h * e1 * ( pk + 0.5 * h * ( dpn + h / 3.0
++      * ( d2pn + 0.25 * h * ( d3pn + 0.2 * h * d4pn ) ) ) );
++  }
++
++  if ( ( order % 2 ) == 1 )
++  {
++    xtab[0] = 0.0;
++  }
++//
++//  Shift the data up.
++//
++  nmove = ( order + 1 ) / 2;
++  ncopy = order - nmove;
++
++  for ( i = 1; i <= nmove; i++ )
++  {
++    iback = order + 1 - i;
++    xtab[iback-1] = xtab[iback-ncopy-1];
++  }
++//
++//  Reflect values for the negative abscissas.
++//
++  for ( i = 1; i <= order - nmove; i++ )
++  {
++    xtab[i-1] = - xtab[order-i];
++  }
++
++  return xtab;
++}
++//****************************************************************************80
++
++void level_growth_to_order ( int dim_num, int level[], int rule[],
++  int growth[], int order[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_GROWTH_TO_ORDER: convert Level and Growth to Order.
++//
++//  Discussion:
++//
++//    This function is given level, rule, and growth information
++//    for each dimension of a quadrature rule, and determines the
++//    corresponding order of the rule in each dimension.
++//
++//    This is a revised version of LEVEL_GROWTH_TO_ORDER.
++//
++//    In particular, it revises the interpretation of the RULE vector as
++//    far as the values 10, 11, and 12 are concerned.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    16 October 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int DIM_NUM, the spatial dimension.
++//
++//    Input, int LEVEL[DIM_NUM], the 1D levels.
++//
++//    Input, int RULE[DIM_NUM], the rule in each dimension.
++//     1, "CC",  Clenshaw Curtis, Closed Fully Nested.
++//     2, "F2",  Fejer Type 2, Open Fully Nested.
++//     3, "GP",  Gauss Patterson, Open Fully Nested.
++//     4, "GL",  Gauss Legendre, Open Weakly Nested.
++//     5, "GH",  Gauss Hermite, Open Weakly Nested.
++//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested.
++//     7, "LG",  Gauss Laguerre, Open Non Nested.
++//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested.
++//     9, "GJ",  Gauss Jacobi, Open Non Nested.
++//    10, "HGK", Hermite Genz-Keister, Open Fully Nested.
++//    11, "UO",  User supplied Open, presumably Non Nested.
++//    12, "UC",  User supplied Closed, presumably Non Nested.
++//
++//    Input, int GROWTH[DIM_NUM], the desired growth in each dimension.
++//    0, "DF", default growth associated with this quadrature rule;
++//    1, "SL", slow linear, L+1;
++//    2  "SO", slow linear odd, O=1+2((L+1)/2)
++//    3, "ML", moderate linear, 2L+1;
++//    4, "SE", slow exponential;
++//    5, "ME", moderate exponential;
++//    6, "FE", full exponential.
++//
++//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
++//
++{
++  int dim;
++  int l;
++  int o;
++  static int o_hgk[6] = { 1, 3, 9, 19, 35, 43 };
++  int p;
++  static int p_hgk[6] = { 1, 5, 15, 29, 51, 67 };
++//
++//  Check the input.
++//
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    if ( level[dim] < 0 )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++      std::cerr << "  Negative value of LEVEL[DIM]!\n";
++      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
++      std::exit ( 1 );
++    }
++
++    if ( rule[dim] < 1 || 12 < rule[dim] )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++      std::cerr << "  Illegal value of RULE[DIM]!\n";
++      std::cerr << "  RULE[" << dim << "] = " << rule[dim] << "\n";
++      std::exit ( 1 );
++    }
++
++    if ( growth[dim] < 0 || 6 < growth[dim] )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++      std::cerr << "  Illegal value of GROWTH[DIM]!\n";
++      std::cerr << "  GROWTH[" << dim << "] = " << growth[dim] << "\n";
++      std::exit ( 1 );
++    }
++  }
++//
++//  Compute the order vector.
++//
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++//
++//  CC
++//  Default is Moderate Exponential Growth.
++//
++    if ( rule[dim] == 1 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          o = 2;
++          while ( o < 2 * level[dim] + 1 )
++          {
++            o = 2 * ( o - 1 ) + 1;
++          }
++        }
++      }
++      else if ( growth[dim] == 5 || growth[dim] == 0 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          o = 2;
++          while ( o < 4 * level[dim] + 1 )
++          {
++            o = 2 * ( o - 1 ) + 1;
++          }
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          o = webbur::i4_power ( 2, level[dim] ) + 1;
++        }
++      }
++    }
++//
++//  F2
++//  Default is Moderate Exponential Growth.
++//
++    else if ( rule[dim] == 2 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( o < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 || growth[dim] == 0 )
++      {
++        o = 1;
++        while ( o < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  GP
++//  Default is Moderate Exponential Growth.
++//
++    else if ( rule[dim] == 3 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++        std::cerr << "  Growth rate 1 for rule 3 not available!\n";
++        std::exit ( 1 );
++      }
++      else if ( growth[dim] == 2 )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++        std::cerr << "  Growth rate 2 for rule 3 not available!\n";
++        std::exit ( 1 );
++      }
++      else if ( growth[dim] == 3 )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++        std::cerr << "  Growth rate 3 for rule 3 not available!\n";
++        std::exit ( 1 );
++      }
++      else if ( growth[dim] == 4 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          p = 5;
++          o = 3;
++          while ( p < 2 * level[dim] + 1 )
++          {
++            p = 2 * p + 1;
++            o = 2 * o + 1;
++          }
++        }
++      }
++      else if ( growth[dim] == 5 || growth[dim] == 0 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          p = 5;
++          o = 3;
++          while ( p < 4 * level[dim] + 1 )
++          {
++            p = 2 * p + 1;
++            o = 2 * o + 1;
++          }
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  GL
++//  Default is Moderate Linear Growth.
++//
++    else if ( rule[dim] == 4 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  GH
++//  Default is Moderate Linear Growth.
++//
++    else if ( rule[dim] == 5 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  GGH
++//  Default is Moderate Linear Growth.
++//
++    else if ( rule[dim] == 6 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  LG
++//  Default is Moderate Linear Growth.
++//
++    else if ( rule[dim] == 7 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  GLG
++//  Default is Moderate Linear Growth.
++//
++    else if ( rule[dim] == 8 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  GJ
++//  Default is Moderate Linear Growth.
++//
++    else if ( rule[dim] == 9 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  HGK
++//  Default is Moderate Exponential Growth.
++//  Exponential growth is interpreted to mean simply take successive rules.
++//
++    else if ( rule[dim] == 10 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++        std::cerr << "  Growth rate 1 for rule 10 not available!\n";
++        std::exit ( 1 );
++      }
++      else if ( growth[dim] == 2 )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++        std::cerr << "  Growth rate 2 for rule 10 not available!\n";
++        std::exit ( 1 );
++      }
++      else if ( growth[dim] == 3 )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++        std::cerr << "  Growth rate 3 for rule 10 not available!\n";
++        std::exit ( 1 );
++      }
++      else if ( growth[dim] == 4 )
++      {
++        l = 0;
++        p = p_hgk[l];
++        o = o_hgk[l];
++        while ( p < 2 * level[dim] + 1 )
++        {
++          l = l + 1;
++          if ( 5 < l )
++          {
++            std::cerr << "\n";
++            std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++            std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
++            std::exit ( 1 );
++          }
++          p = p_hgk[l];
++          o = o_hgk[l];
++        }
++      }
++      else if ( growth[dim] == 5 || growth[dim] == 0 )
++      {
++        l = 0;
++        p = p_hgk[l];
++        o = o_hgk[l];
++        while ( p < 4 * level[dim] + 1 )
++        {
++          l = l + 1;
++          if ( 5 < l )
++          {
++            std::cerr << "\n";
++            std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++            std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
++            std::exit ( 1 );
++          }
++          p = p_hgk[l];
++          o = o_hgk[l];
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        l = level[dim];
++        l = webbur::i4_max ( l, 0 );
++        if ( 5 < l )
++        {
++          std::cerr << "\n";
++          std::cerr << "LEVEL_GROWTH_TO_ORDER - Fatal error!\n";
++          std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
++          std::exit ( 1 );
++        }
++        o = o_hgk[l];
++      }
++    }
++//
++//  UO
++//  Default is Moderate Linear Growth.
++//  We assume the rule is of OPEN type and that it
++//  has a precision typical of Gauss rules.
++//
++    else if ( rule[dim] == 11 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 2 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        o = 1;
++        while ( 2 * o - 1 < 4 * level[dim] + 1 )
++        {
++          o = 2 * o + 1;
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        o = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++      }
++    }
++//
++//  UC
++//  Default is Moderate Linear Growth.
++//  We assume the rule is of CLOSED type and that it
++//  has a precision typical of Clenshaw-Curtis rules.
++//
++    else if ( rule[dim] == 12 )
++    {
++      if ( growth[dim] == 1 )
++      {
++        o = level[dim] + 1;
++      }
++      else if ( growth[dim] == 2 )
++      {
++        o = 2 * ( ( level[dim] + 1 ) / 2 ) + 1;
++      }
++      else if ( growth[dim] == 3 || growth[dim] == 0 )
++      {
++        o = 2 * level[dim] + 1;
++      }
++      else if ( growth[dim] == 4 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          o = 2;
++          while ( o < 2 * level[dim] + 1 )
++          {
++            o = 2 * ( o - 1 ) + 1;
++          }
++        }
++      }
++      else if ( growth[dim] == 5 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          o = 2;
++          while ( o < 4 * level[dim] + 1 )
++          {
++            o = 2 * ( o - 1 ) + 1;
++          }
++        }
++      }
++      else if ( growth[dim] == 6 )
++      {
++        if ( level[dim] == 0 )
++        {
++          o = 1;
++        }
++        else
++        {
++          o = webbur::i4_power ( 2, level[dim] ) + 1;
++        }
++      }
++    }
++    order[dim] = o;
++  }
++  return;
++}
++//****************************************************************************80
++
++void level_to_order_default ( int dim_num, int level[], int rule[],
++  int order[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_DEFAULT: default growth.
++//
++//  Discussion:
++//
++//    This function uses:
++//
++//    * exponential growth rates for fully nested quadrature rules,
++//      ( "CC", "F2", "GP");
++//
++//    * linear growth rates for other rules.
++//      ( "GL", "GH", "GGH", "LG", "GLG", "GJ", "GW" ).
++//
++//    * slow exponential growth alternative for fully nested rules:
++//      ("CC_SE", "F2_SE", "GP_SE").
++//
++//    * moderate exponential growth alternative for fully nested rules:
++//      ("CC_ME", "F2_ME", "GP_ME").
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int DIM_NUM, the spatial dimension.
++//
++//    Input, int LEVEL[DIM_NUM], the 1D levels.
++//
++//    Input, int RULE[DIM_NUM], the rule in each dimension.
++//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
++//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
++//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
++//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
++//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
++//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
++//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
++//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
++//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
++//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
++//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
++//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
++//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
++//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
++//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
++//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
++//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
++//
++//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
++//
++{
++  int dim;
++  int o;
++  int p;
++
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    if ( level[dim] < 0 )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_TO_ORDER_DEFAULT - Fatal error!\n";
++      std::cerr << "  Negative value of LEVEL[DIM]!\n";
++      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
++      std::exit ( 1 );
++    }
++    else if ( rule[dim] == 1 )
++    {
++      if ( level[dim] == 0 )
++      {
++        order[dim] = 1;
++      }
++      else
++      {
++        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
++      }
++    }
++    else if ( rule[dim] == 2 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 3 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 4 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else if ( rule[dim] == 5 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else if ( rule[dim] == 6 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else if ( rule[dim] == 7 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else if ( rule[dim] == 8 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else if ( rule[dim] == 9 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else if ( rule[dim] == 10 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else if ( rule[dim] == 11 )
++    {
++      if ( level[dim] == 0 )
++      {
++        o = 1;
++      }
++      else
++      {
++        o = 2;
++        while ( o < 2 * level[dim] + 1 )
++        {
++          o = 2 * ( o - 1 ) + 1;
++        }
++      }
++      order[dim] = o;
++    }
++    else if ( rule[dim] == 12 )
++    {
++      o = 1;
++      while ( o < 2 * level[dim] + 1 )
++      {
++        o = 2 * o + 1;
++      }
++      order[dim] = o;
++    }
++    else if ( rule[dim] == 13 )
++    {
++      if ( level[dim] == 0 )
++      {
++        order[dim] = 1;
++      }
++      else
++      {
++        p = 5;
++        o = 3;
++        while ( p < 2 * level[dim] + 1 )
++        {
++          p = 2 * p + 1;
++          o = 2 * o + 1;
++        }
++        order[dim] = o;
++      }
++    }
++    else if ( rule[dim] == 14 )
++    {
++      if ( level[dim] == 0 )
++      {
++        o = 1;
++      }
++      else
++      {
++        o = 2;
++        while ( o < 4 * level[dim] + 1 )
++        {
++          o = 2 * ( o - 1 ) + 1;
++        }
++      }
++      order[dim] = o;
++    }
++    else if ( rule[dim] == 15 )
++    {
++      o = 1;
++      while ( o < 4 * level[dim] + 1 )
++      {
++        o = 2 * o + 1;
++      }
++      order[dim] = o;
++    }
++    else if ( rule[dim] == 16 )
++    {
++      if ( level[dim] == 0 )
++      {
++        order[dim] = 1;
++      }
++      else
++      {
++        p = 5;
++        o = 3;
++        while ( p < 4 * level[dim] + 1 )
++        {
++          p = 2 * p + 1;
++          o = 2 * o + 1;
++        }
++        order[dim] = o;
++      }
++    }
++    else if ( rule[dim] == 17 )
++    {
++      order[dim] = 2 * level[dim] + 1;
++    }
++    else
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_TO_ORDER_DEFAULT - Fatal error!\n";
++      std::cerr << "  Unexpected value of RULE["
++           << dim << "] = " << rule[dim] << ".\n";
++      std::exit ( 1 );
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void level_to_order_exponential ( int dim_num, int level[], int rule[],
++  int order[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_EXPONENTIAL: exponential growth.
++//
++//  Discussion:
++//
++//    The user must preallocate space for the output array ORDER.
++//
++//    Closed rules:
++//
++//      O(0) = 1
++//      O(L) = 2^L + 1;
++//
++//      O = 1, 3, 5, 9, 17, 33, ...
++//
++//    Open rules:
++//
++//      O(L) = 2^(L+1) - 1;
++//
++//      O = 1, 3, 7, 15, 31, 63, ...
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int DIM_NUM, the spatial dimension.
++//
++//    Input, int LEVEL[DIM_NUM], the 1D levels.
++//
++//    Input, int RULE[DIM_NUM], the rule in each dimension.
++//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
++//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
++//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
++//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
++//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
++//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
++//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
++//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
++//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
++//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
++//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
++//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
++//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
++//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
++//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
++//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
++//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
++//
++//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
++//
++{
++  int dim;
++
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    if ( level[dim] < 0 )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL - Fatal error!\n";
++      std::cerr << "  Negative value of LEVEL[DIM]!\n";
++      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
++      std::exit ( 1 );
++    }
++    else if ( rule[dim] == 1 )
++    {
++      if ( level[dim] == 0 )
++      {
++        order[dim] = 1;
++      }
++      else
++      {
++        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
++      }
++    }
++    else if ( rule[dim] == 2 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 3 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 4 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 5 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 6 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 7 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 8 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 9 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 10 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 11 )
++    {
++      if ( level[dim] == 0 )
++      {
++        order[dim] = 1;
++      }
++      else
++      {
++        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
++      }
++    }
++    else if ( rule[dim] == 12 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 13 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 14 )
++    {
++      if ( level[dim] == 0 )
++      {
++        order[dim] = 1;
++      }
++      else
++      {
++        order[dim] = webbur::i4_power ( 2, level[dim] ) + 1;
++      }
++    }
++    else if ( rule[dim] == 15 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 16 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 ) - 1;
++    }
++    else if ( rule[dim] == 17 )
++    {
++      order[dim] = webbur::i4_power ( 2, level[dim] + 1 );
++    }
++    else
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL - Fatal error!\n";
++      std::cerr << "  Unexpected value of RULE["
++           << dim << "] = " << rule[dim] << ".\n";
++      std::exit ( 1 );
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void level_to_order_exponential_slow ( int dim_num, int level[], int rule[],
++  int order[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_EXPONENTIAL_SLOW: slow exponential growth;
++//
++//  Discussion:
++//
++//    We seek a sequence of quadrature rules with two opposing constraints:
++//    * a measured rise in polynomial precision with increasing level;
++//    * a control on the increase in (new) points per level;
++//
++//    Essentially, we are trying to keep some of the advantages of nesting,
++//    while moderating the cost of the explosive growth in order that occurs
++//    due to the repeated order doubling of nesting.
++//
++//    We wish the number of points at a given level L to be "about" 2 * L + 1,
++//    but we also wish the rules to be completely nested.
++//
++//    One way to do this is to start with a nested family of rules, whose
++//    order will tend to grow exponentially (doubling from one to the next),
++//    but simply to REPEAT each rule as many times as possible.  We move to
++//    the next rule only when the desired precision 2 * L + 1 exceeds the
++//    precision of the current rule.
++//
++//    For both the Clenshaw Curtis and Fejer Type 2 rules, the order and
++//    precision are the same if the order is odd.   That is, an 11 point rule
++//    will integrate exactly all polynomials up to and including degree 11.
++//
++//    For Gauss Patterson rules, the relationship between order and precision
++//    is somewhat more complicated.  For that rule, we take the philosophy
++//    that at each level L, we wish to choose the rule of smallest order
++//    so that the precision of 2 * L + 1 is guaranteed.
++//
++//     L    2*L+1  CC Order    F2 Order    GP Order/Precision
++//
++//     0        1         1           1        1/1
++//     1        3         3           3        3/5
++//     2        5         5           7        3/5
++//     3        7         9           7        7/11
++//     4        9         9          15        7/11
++//     5       11        17          15        7/11
++//     6       13        17          15       15/23
++//     7       15        17          15       15/23
++//     8       17        17          31       15/23
++//     9       19        33          31       15/23
++//    10       21        33          31       15/23
++//    11       23        33          31       15/23
++//    12       25        33          31       31/47
++//    13       27        33          31       31/47
++//    14       29        33          31       31/47
++//    15       31        33          31       31/47
++//    16       33        33          63       31/47
++//    17       35        65          63       31/47
++//    18       37        65          63       31/47
++//    19       39        65          63       31/47
++//    20       41        65          63       31/47
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Knut Petras,
++//    Smolyak Cubature of Given Polynomial Degree with Few Nodes
++//    for Increasing Dimension,
++//    Numerische Mathematik,
++//    Volume 93, Number 4, February 2003, pages 729-753.
++//
++//  Parameters:
++//
++//    Input, int DIM_NUM, the spatial dimension.
++//
++//    Input, int LEVEL[DIM_NUM], the 1D levels.
++//
++//    Input, int RULE[DIM_NUM], the rule in each dimension.
++//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
++//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
++//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
++//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
++//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
++//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
++//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
++//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
++//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
++//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
++//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
++//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
++//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
++//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
++//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
++//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
++//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
++//
++//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
++//
++{
++  int dim;
++  int o;
++  int p;
++
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    if ( level[dim] < 0 )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_TO_ORDER_EXPONENTIAL_SLOW - Fatal error!\n";
++      std::cerr << "  Negative value of LEVEL[DIM]!\n";
++      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
++      std::exit ( 1 );
++    }
++  }
++
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    if ( rule[dim] == 1 || rule[dim] == 11 || rule[dim] == 14 || rule[dim] == 17 )
++    {
++      if ( level[dim] == 0 )
++      {
++        o = 1;
++      }
++      else
++      {
++        o = 2;
++        while ( o < 2 * level[dim] + 1 )
++        {
++          o = 2 * ( o - 1 ) + 1;
++        }
++      }
++    }
++    else if ( rule[dim] == 3 || rule[dim] == 13 || rule[dim] == 16 )
++    {
++      if ( level[dim] == 0 )
++      {
++        o = 1;
++      }
++      else
++      {
++        p = 5;
++        o = 3;
++        while ( p < 2 * level[dim] + 1 )
++        {
++          p = 2 * p + 1;
++          o = 2 * o + 1;
++        }
++      }
++    }
++    else
++    {
++      o = 1;
++      while ( o < 2 * level[dim] + 1 )
++      {
++        o = 2 * o + 1;
++      }
++    }
++    order[dim] = o;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void level_to_order_linear ( int dim_num, int level[], int rule[],
++  int order[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_LINEAR: linear growth.
++//
++//  Discussion:
++//
++//    The user must preallocate space for the output array ORDER.
++//
++//      O(L) = 2 * L + 1;
++//
++//      O = 1, 3, 5, 7, 9, ...
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    07 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int DIM_NUM, the spatial dimension.
++//
++//    Input, int LEVEL[DIM_NUM], the 1D levels.
++//
++//    Input, int RULE[DIM_NUM], the rule in each dimension.
++//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
++//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
++//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
++//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
++//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
++//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
++//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
++//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
++//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
++//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
++//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
++//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
++//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
++//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
++//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
++//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
++//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
++//
++//    Output, int ORDER[DIM_NUM], the 1D orders (number of points).
++//
++{
++  int dim;
++
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    if ( level[dim] < 0 )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_TO_ORDER_LINEAR - Fatal error!\n";
++      std::cerr << "  Negative value of LEVEL[DIM]!\n";
++      std::cerr << "  LEVEL[" << dim << "] = " << level[dim] << "\n";
++      std::exit ( 1 );
++    }
++  }
++
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    order[dim] = 2 * level[dim] + 1;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++int level_to_order_exp_cc ( int level, int growth )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_EXP_CC is used for Clenshaw-Curtis type rules.
++//
++//  Discussion:
++//
++//    Rules of this type are assumed to be closed (including both endpoints
++//    except for the level 0 rule) and having a precision
++//    behavior typical of Clenshaw Curtis rules, namely, the ORDER-point
++//    rule is exact for polynomials of degree less than ORDER, and if
++//    ORDER is odd, then the exactness includes polynomials of degree ORDER
++//    as well.
++//
++//    LEVEL  ORDER  ORDER  ORDER
++//           G = 0  G = 1  G = 2
++//    -----  -----  -----  -----
++//        0      1      1      1
++//        1      3      5      3
++//        2      5      9      5
++//        3      9     17      9
++//        4      9     17     17
++//        5     17     33     33
++//        6     17     33     65
++//        7     17     33    129
++//        8     17     33    257
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 December 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int LEVEL, the level of the rule.
++//
++//    Input, int GROWTH, the growth policy:
++//    0, slow growth;
++//    1, moderate growth;
++//    2, full growth.
++//
++//    Output, int LEVEL_TO_ORDER_EXP_CC, the order of the rule.
++//
++{
++  int o;
++//
++//  Slow exponential growth.
++//
++  if ( growth == 0 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = 2;
++      while ( o < 2 * level + 1 )
++      {
++        o = 2 * ( o - 1 ) + 1;
++      }
++    }
++  }
++//
++//  Moderate Exponential Growth.
++//
++  else if ( growth == 1 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = 2;
++      while ( o < 4 * level + 1 )
++      {
++        o = 2 * ( o - 1 ) + 1;
++      }
++    }
++  }
++//
++//  Full Exponential Growth.
++//
++  else if ( growth == 2 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = webbur::i4_power ( 2, level ) + 1;
++    }
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEVEL_TO_ORDER_EXP_CC - Fatal error!\n";
++    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
++    std::exit ( 1 );
++  }
++  return o;
++}
++//****************************************************************************80
++
++int level_to_order_exp_f2 ( int level, int growth )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_EXP_F2 is used for Fejer 2 type rules.
++//
++//  Discussion:
++//
++//    Rules of this type are assumed to be open (not including either endpoint)
++//    and having a precision behavior typical of Fejer Type 2
++//    rules, namely, the ORDER-point rule is exact for polynomials of degree
++//    less than ORDER, and if ORDER is odd, then the exactness includes
++//    polynomials of degree ORDER as well.
++//
++//    LEVEL  ORDER  ORDER  ORDER
++//           G = 0  G = 1  G = 2
++//
++//        0      1      1      1
++//        1      3      7      3
++//        2      7     15      7
++//        3      7     15     15
++//        4     15     31     31
++//        5     15     31     63
++//        6     15     31    127
++//        7     15     31    255
++//        8     31     63    511
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 December 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int LEVEL, the level of the rule.
++//
++//    Input, int GROWTH, the growth policy:
++//    0, slow growth;
++//    1, moderate growth;
++//    2, full growth.
++//
++//    Output, int LEVEL_TO_ORDER_EXP_F2, the order of the rule.
++//
++{
++  int o;
++//
++//  Slow exponential growth.
++//
++  if ( growth == 0 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = 1;
++      while ( o < 2 * level + 1 )
++      {
++        o = 2 * o + 1;
++      }
++    }
++  }
++//
++//  Moderate Exponential Growth.
++//
++  else if ( growth == 1 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = 1;
++      while ( o < 4 * level + 1 )
++      {
++        o = 2 * o + 1;
++      }
++    }
++  }
++//
++//  Full Exponential Growth.
++//
++  else if ( growth == 2 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = webbur::i4_power ( 2, level + 1 ) - 1;
++    }
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEVEL_TO_ORDER_EXP_F2 - Fatal error!\n";
++    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
++    std::exit ( 1 );
++  }
++  return o;
++}
++//****************************************************************************80
++
++int level_to_order_exp_gauss ( int level, int growth )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_EXP_GAUSS is used for Gauss type rules.
++//
++//  Discussion:
++//
++//    Rules of this type are assumed to be open (not including either endpoint),
++//    and having a precision behavior typical of Gauss rules, namely, the
++//    ORDER-point rule is exact for polynomials of degree less than 2 * ORDER.
++//
++//    LEVEL  ORDER  ORDER  ORDER
++//           G = 0  G = 1  G = 2
++//
++//        0      1      1      1
++//        1      3      3      3
++//        2      3      7      7
++//        3      7      7     15
++//        4      7     15     31
++//        5      7     15     63
++//        6      7     15    127
++//        7     15     15    255
++//        8     15     31    511
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 December 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int LEVEL, the level of the rule.
++//
++//    Input, int GROWTH, the growth policy:
++//    0, slow growth;
++//    1, moderate growth;
++//    2, full growth.
++//
++//    Output, int LEVEL_TO_ORDER_EXP_GAUSS, the order of the rule.
++//
++{
++  int o;
++//
++//  Slow exponential growth.
++//
++  if ( growth == 0 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = 1;
++      while ( 2 * o - 1 < 2 * level + 1 )
++      {
++        o = 2 * o + 1;
++      }
++    }
++  }
++//
++//  Moderate Exponential Growth.
++//
++  else if ( growth == 1 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = 1;
++      while ( 2 * o - 1 < 4 * level + 1 )
++      {
++        o = 2 * o + 1;
++      }
++    }
++  }
++//
++//  Full Exponential Growth.
++//
++  else if ( growth == 2 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = webbur::i4_power ( 2, level + 1 ) - 1;
++    }
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEVEL_TO_ORDER_EXP_GAUSS - Fatal error!\n";
++    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
++    std::exit ( 1 );
++  }
++
++  return o;
++}
++//****************************************************************************80
++
++int level_to_order_exp_gp ( int level, int growth )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_EXP_GP is used for Gauss-Patterson type rules.
++//
++//  Discussion:
++//
++//    Rules of this type are assumed to be open (not including either endpoint)
++//    and having a precision behavior typical of Gauss Patterson rules.
++//
++//    Note that there are onlly 9 rules in the family, and so it is possible to
++//    specify input for which the function will fail.
++//
++//    LEVEL  ORDER  ORDER  ORDER
++//           G = 0  G = 1  G = 2
++//
++//        0      1      1      1
++//        1      3      3      3
++//        2      3      7      7
++//        3      7     15     15
++//        4      7     15     31
++//        5      7     15     63
++//        6     15     31    127
++//        7     15     31    255
++//        8     15     31    511
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 December 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int LEVEL, the level of the rule.
++//
++//    Input, int GROWTH, the growth policy:
++//    0, slow growth;
++//    1, moderate growth;
++//    2, full growth.
++//
++//    Output, int LEVEL_TO_ORDER_EXP_GP, the order of the rule.
++//
++{
++  int o;
++  int p;
++//
++//  Slow exponential growth.
++//
++  if ( growth == 0 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      p = 5;
++      o = 3;
++      while ( p < 2 * level + 1 )
++      {
++        p = 2 * p + 1;
++        o = 2 * o + 1;
++        if ( 511 < o )
++        {
++          std::cerr << "\n";
++          std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
++          std::cerr << "  Request for unavailable Patterson rule.\n";
++          std::exit ( 1 );
++        }
++      }
++    }
++  }
++//
++//  Moderate Exponential Growth.
++//
++  else if ( growth == 1 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      p = 5;
++      o = 3;
++      while ( p < 4 * level + 1 )
++      {
++        p = 2 * p + 1;
++        o = 2 * o + 1;
++        if ( 511 < o )
++        {
++          std::cerr << "\n";
++          std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
++          std::cerr << "  Request for unavailable Patterson rule.\n";
++          std::exit ( 1 );
++        }
++      }
++    }
++  }
++//
++//  Full Exponential Growth.
++//
++  else if ( growth == 2 )
++  {
++    if ( level == 0 )
++    {
++      o = 1;
++    }
++    else
++    {
++      o = webbur::i4_power ( 2, level + 1 ) - 1;
++      if ( 511 < o )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
++        std::cerr << "  Request for unavailable Patterson rule.\n";
++        std::exit ( 1 );
++      }
++    }
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEVEL_TO_ORDER_EXP_GP - Fatal error!\n";
++    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
++    std::exit ( 1 );
++  }
++
++  return o;
++}
++//****************************************************************************80
++
++int level_to_order_exp_hgk ( int level, int growth )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_EXP_HGK is used for Hermite Genz-Keister type rules.
++//
++//  Discussion:
++//
++//    Rules of this type are assumed to be open (not including either endpoint)
++//    and having a precision behavior typical of Hermite Genz-Keister rules.
++//
++//    Note that there are only 6 rules in the family, and so it is possible to
++//    specify input for which the function will fail.
++//
++//    LEVEL  ORDER  ORDER  ORDER
++//           G = 0  G = 1  G = 2
++//
++//        0      1      1      1
++//        1      3      3      3
++//        2      3      9      9
++//        3      9      9     19
++//        4      9     19     35
++//        5      9     19     43
++//        6      9     19     --
++//        7      9     19     --
++//        8     19     35     --
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 December 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int LEVEL, the level of the rule.
++//
++//    Input, int GROWTH, the growth policy:
++//    0, slow growth;
++//    1, moderate growth;
++//    2, full growth.
++//
++//    Output, int LEVEL_TO_ORDER_EXP_HGK, the order of the rule.
++//
++{
++  int l;
++  int o;
++  static int o_hgk[6] = { 1, 3, 9, 19, 35, 43 };
++  int p;
++  static int p_hgk[6] = { 1, 5, 15, 29, 51, 67 };
++//
++//  Slow exponential growth.
++//
++  if ( growth == 0 )
++  {
++    l = 0;
++    p = p_hgk[l];
++    o = o_hgk[l];
++    while ( p < 2 * level + 1 )
++    {
++      l = l + 1;
++      if ( 5 < l )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
++        std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
++        std::exit ( 1 );
++      }
++      p = p_hgk[l];
++      o = o_hgk[l];
++    }
++  }
++  else if ( growth == 1 )
++  {
++    l = 0;
++    p = p_hgk[l];
++    o = o_hgk[l];
++    while ( p < 4 * level + 1 )
++    {
++      l = l + 1;
++      if ( 5 < l )
++      {
++        std::cerr << "\n";
++        std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
++        std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
++        std::exit ( 1 );
++      }
++      p = p_hgk[l];
++      o = o_hgk[l];
++    }
++  }
++  else if ( growth == 2 )
++  {
++    l = level;
++    l = webbur::i4_max ( l, 0 );
++    if ( 5 < l )
++    {
++      std::cerr << "\n";
++      std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
++      std::cerr << "  Hermite Genz-Keister maximum level exceeded.\n";
++      std::exit ( 1 );
++    }
++    o = o_hgk[l];
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEVEL_TO_ORDER_EXP_HGK - Fatal error!\n";
++    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
++    std::exit ( 1 );
++  }
++
++  return o;
++}
++//****************************************************************************80
++
++int level_to_order_linear_nn ( int level, int growth )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_LINEAR_NN is used for non-nested Gauss type rules.
++//
++//  Discussion:
++//
++//    Rules of this type are assumed to be open (not including either endpoint),
++//    non-nested, and having a precision behavior typical of Gauss rules.
++//
++//    LEVEL  ORDER  ORDER
++//           G = 0  G = 1
++//
++//        0      1      1
++//        1      2      3
++//        2      3      5
++//        3      4      7
++//        4      5      9
++//        5      6     11
++//        6      7     13
++//        7      8     15
++//        8      9     17
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 December 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int LEVEL, the level of the rule.
++//
++//    Input, int GROWTH, the growth policy:
++//    0, slow growth;
++//    1, moderate growth;
++//
++//    Output, int LEVEL_TO_ORDER_LINEAR_NN, the order of the rule.
++//
++{
++  int o;
++//
++//  Slow linear growth.
++//
++  if ( growth == 0 )
++  {
++    o = level + 1;
++  }
++//
++//  Moderate linear growth.
++//
++  else if ( growth == 1 )
++  {
++    o = 2 * level + 1;
++  }
++  else if ( growth == 2 )
++  {
++    o = 2 * level + 1;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEVEL_TO_ORDER_LINEAR_NN - Fatal error!\n";
++    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
++    std::exit ( 1 );
++  }
++  return o;
++}
++//****************************************************************************80
++
++int level_to_order_linear_wn ( int level, int growth )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    LEVEL_TO_ORDER_LINEAR_WN is used for weakly-nested Gauss type rules.
++//
++//  Discussion:
++//
++//    Rules of this type are assumed to be open (not including either endpoint),
++//    nested, and having a precision behavior typical of Gauss rules.
++//
++//    We assume the rules are to be generated with an odd number of points,
++//    and that all the rules will share a single point, namely 0.
++//
++//    Note that the "moderate growth" option for this function results in the
++//    same values as the moderate growth option for LEVEL_TO_ORDER_LINEAR_NN.
++//
++//    LEVEL  ORDER  ORDER
++//           G = 0  G = 1
++//
++//        0      1      1
++//        1      3      3
++//        2      3      5
++//        3      5      7
++//        4      5      9
++//        5      7     11
++//        6      7     13
++//        7      9     15
++//        8      9     17
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 December 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int LEVEL, the level of the rule.
++//
++//    Input, int GROWTH, the growth policy:
++//    0, slow growth;
++//    1, moderate growth;
++//
++//    Output, int LEVEL_TO_ORDER_LINEAR_WN, the order of the rule.
++//
++{
++  int o;
++//
++//  Slow growth.
++//
++  if ( growth == 0 )
++  {
++    o = 2 * ( ( level + 1 ) / 2 ) + 1;
++  }
++  else if ( growth == 1 )
++  {
++    o = 2 * level + 1;
++  }
++  else if ( growth == 2 )
++  {
++    o = 2 * level + 1;
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "LEVEL_TO_ORDER_LINEAR_WN - Fatal error!\n";
++    std::cerr << "  Illegal value of GROWTH = " << growth << "\n";
++    std::exit ( 1 );
++  }
++  return o;
++}
++//****************************************************************************80
++
++void nc_compute ( int n, double x_min, double x_max, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NC_COMPUTE computes a Newton-Cotes quadrature rule.
++//
++//  Discussion:
++//
++//    For the interval [X_MIN,X_MAX], the Newton-Cotes quadrature rule
++//    estimates
++//
++//      Integral ( X_MIN <= X <= X_MAX ) F(X) dX
++//
++//    using N abscissas X and weights W:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) ).
++//
++//    For the CLOSED rule, the abscissas include the end points.
++//    For the OPEN rule, the abscissas do not include the end points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 November 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, double X_MIN, X_MAX, the endpoints of the interval.
++//
++//    Input, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  double *d;
++  int i;
++  int j;
++  int k;
++  double yvala;
++  double yvalb;
++
++  d = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++//
++//  Compute the Lagrange basis polynomial which is 1 at XTAB(I),
++//  and zero at the other nodes.
++//
++    for ( j = 0; j < n; j++ )
++    {
++      d[j] = 0.0;
++    }
++    d[i] = 1.0;
++
++    for ( j = 2; j <= n; j++ )
++    {
++      for ( k = j; k <= n; k++ )
++      {
++        d[n+j-k-1] = ( d[n+j-k-1-1] - d[n+j-k-1] ) / ( x[n+1-k-1] - x[n+j-k-1] );
++      }
++    }
++
++    for ( j = 1; j <= n - 1; j++ )
++    {
++      for ( k = 1; k <= n - j; k++ )
++      {
++        d[n-k-1] = d[n-k-1] - x[n-k-j] * d[n-k];
++      }
++    }
++//
++//  Evaluate the antiderivative of the polynomial at the left and
++//  right endpoints.
++//
++    yvala = d[n-1] / ( double ) ( n );
++    for ( j = n - 2; 0 <= j; j-- )
++    {
++      yvala = yvala * x_min + d[j] / ( double ) ( j + 1 );
++    }
++    yvala = yvala * x_min;
++
++    yvalb = d[n-1] / ( double ) ( n );
++    for ( j = n - 2; 0 <= j; j-- )
++    {
++      yvalb = yvalb * x_max + d[j] / ( double ) ( j + 1 );
++    }
++    yvalb = yvalb * x_max;
++
++    w[i] = yvalb - yvala;
++  }
++
++  delete [] d;
++
++  return;
++}
++//****************************************************************************80
++
++double *nc_compute_new ( int n, double x_min, double x_max, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NC_COMPUTE_NEW computes a Newton-Cotes quadrature rule.
++//
++//  Discussion:
++//
++//    For the interval [X_MIN,X_MAX], the Newton-Cotes quadrature rule
++//    estimates
++//
++//      Integral ( X_MIN <= X <= X_MAX ) F(X) dX
++//
++//    using N abscissas X and weights W:
++//
++//      Sum ( 1 <= I <= N ) W(I) * F ( X(I) ).
++//
++//    For the CLOSED rule, the abscissas include the end points.
++//    For the OPEN rule, the abscissas do not include the end points.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 November 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Input, double X_MIN, X_MAX, the endpoints of the interval.
++//
++//    Input, double X[N], the abscissas.
++//
++//    Output, double NC_COMPUTE_NEW[N], the weights.
++//
++{
++  double *d;
++  int i;
++  int j;
++  int k;
++  double *w;
++  double yvala;
++  double yvalb;
++
++  d = new double[n];
++  w = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++//
++//  Compute the Lagrange basis polynomial which is 1 at XTAB(I),
++//  and zero at the other nodes.
++//
++    for ( j = 0; j < n; j++ )
++    {
++      d[j] = 0.0;
++    }
++    d[i] = 1.0;
++
++    for ( j = 2; j <= n; j++ )
++    {
++      for ( k = j; k <= n; k++ )
++      {
++        d[n+j-k-1] = ( d[n+j-k-1-1] - d[n+j-k-1] ) / ( x[n+1-k-1] - x[n+j-k-1] );
++      }
++    }
++
++    for ( j = 1; j <= n - 1; j++ )
++    {
++      for ( k = 1; k <= n - j; k++ )
++      {
++        d[n-k-1] = d[n-k-1] - x[n-k-j] * d[n-k];
++      }
++    }
++//
++//  Evaluate the antiderivative of the polynomial at the left and
++//  right endpoints.
++//
++    yvala = d[n-1] / ( double ) ( n );
++    for ( j = n - 2; 0 <= j; j-- )
++    {
++      yvala = yvala * x_min + d[j] / ( double ) ( j + 1 );
++    }
++    yvala = yvala * x_min;
++
++    yvalb = d[n-1] / ( double ) ( n );
++    for ( j = n - 2; 0 <= j; j-- )
++    {
++      yvalb = yvalb * x_max + d[j] / ( double ) ( j + 1 );
++    }
++    yvalb = yvalb * x_max;
++
++    w[i] = yvalb - yvala;
++  }
++
++  delete [] d;
++
++  return w;
++}
++//****************************************************************************80
++
++void ncc_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NCC_COMPUTE_POINTS: points of a Newton-Cotes Closed quadrature rule.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    16 November 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int i;
++  double x_max = 1.0;
++  double x_min = -1.0;
++
++  if ( n == 1 )
++  {
++    x[0] = ( x_max + x_min ) / 2.0;
++  }
++  else
++  {
++    for ( i = 0; i < n; i++ )
++    {
++      x[i] = ( ( double ) ( n - i - 1 ) * x_min
++             + ( double ) (     i     ) * x_max )
++             / ( double ) ( n     - 1 );
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void ncc_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NCC_COMPUTE_WEIGHTS: weights of a Newton-Cotes Closed quadrature rule.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    16 November 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int i;
++  double *x;
++  double x_max = 1.0;
++  double x_min = -1.0;
++
++  if ( n == 1 )
++  {
++    w[0] = x_max - x_min;
++  }
++  else
++  {
++    x = new double[n];
++
++    for ( i = 0; i < n; i++ )
++    {
++      x[i] = ( ( double ) ( n - i - 1 ) * x_min
++             + ( double ) (     i     ) * x_max )
++             / ( double ) ( n     - 1 );
++    }
++    webbur::nc_compute ( n, x_min, x_max, x, w );
++
++    delete [] x;
++  }
++  return;
++}
++//****************************************************************************80
++
++void nco_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NCO_COMPUTE_POINTS: points for a Newton-Cotes Open quadrature rule.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 November 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int i;
++  double x_max = 1.0;
++  double x_min = -1.0;
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = ( ( double ) ( n - i     ) * x_min
++           + ( double ) (   + i + 1 ) * x_max )
++           / ( double ) ( n     + 1 );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void nco_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NCO_COMPUTE_WEIGHTS: weights for a Newton-Cotes Open quadrature rule.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 November 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int i;
++  double *x;
++  double x_max = 1.0;
++  double x_min = -1.0;
++
++  x = new double[n];
++
++  webbur::nco_compute_points ( n, x );
++
++  webbur::nc_compute ( n, x_min, x_max, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void ncoh_compute_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NCOH_COMPUTE_POINTS computes points for a Newton-Cotes "open half" quadrature rule.
++//
++//  Discussion:
++//
++//    The input value N is used to define N equal subintervals of [-1,+1].
++//    The I-th abscissa is the center of the I-th subinterval.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    03 July 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  int i;
++  const double x_max = 1.0;
++  const double x_min = -1.0;
++
++  for ( i = 0; i < n; i++ )
++  {
++    x[i] = ( ( double ) ( 2 * n - 2 * i - 1 ) * x_min
++           + ( double ) (         2 * i + 1 ) * x_max )
++           / ( double ) ( 2 * n             );
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void ncoh_compute_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    NCOH_COMPUTE_WEIGHTS computes weights for a Newton-Cotes "open half" quadrature rule.
++//
++//  Discussion:
++//
++//    The input value N is used to define N equal subintervals of [-1,+1].
++//    The I-th abscissa is the center of the I-th subinterval.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    03 July 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//
++//    Output, double W[N], the weights.
++//
++{
++  int i;
++  double *x;
++  const double x_max = 1.0;
++  const double x_min = -1.0;
++
++  x = new double[n];
++
++  webbur::ncoh_compute_points ( n, x );
++
++  webbur::nc_compute ( n, x_min, x_max, x, w );
++
++  delete [] x;
++
++  return;
++}
++//****************************************************************************80
++
++void patterson_lookup ( int n, double x[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    PATTERSON_LOOKUP looks up Patterson quadrature points and weights.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    The rule is defined on [-1,1],
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    11 February 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Prem Kythe, Michael Schaeferkotter,
++//    Handbook of Computational Methods for Integration,
++//    Chapman and Hall, 2004,
++//    ISBN: 1-58488-428-2,
++//    LC: QA299.3.K98.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
++//
++//    Output, double X[N], the abscissas.
++//
++//    Output, double W[N], the weights.
++//
++{
++  patterson_lookup_points ( n, x );
++  patterson_lookup_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++void patterson_lookup_points ( int n, double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    PATTERSON_LOOKUP_POINTS looks up Patterson quadrature points.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    The rule is defined on [-1,1],
++//
++//    These rules constitute a nested family.  The rules can integrate exactly
++//    any polynomial of degree 1, 5, 11, 23, 47, 95, 191, 383 or 767,
++//    respectively.
++//
++//    The data for N = 511 was supplied by Dirk Laurie, and is derived
++//    from a NAG Library function d01arf.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    14 September 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Prem Kythe, Michael Schaeferkotter,
++//    Handbook of Computational Methods for Integration,
++//    Chapman and Hall, 2004,
++//    ISBN: 1-58488-428-2,
++//    LC: QA299.3.K98.
++//
++//    NAG Library Documentation,
++//    D01ARF,
++//    The Numerical Algorithms Group.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  static double x_001[1] =
++  {
++     0.0
++  };
++  static double x_003[3] =
++  {
++    -0.77459666924148337704,
++     0.0,
++     0.77459666924148337704
++  };
++  static double x_007[7] =
++  {
++    -0.96049126870802028342,
++    -0.77459666924148337704,
++    -0.43424374934680255800,
++     0.0,
++     0.43424374934680255800,
++     0.77459666924148337704,
++     0.96049126870802028342
++  };
++  static double x_015[15] =
++  {
++    -0.99383196321275502221,
++    -0.96049126870802028342,
++    -0.88845923287225699889,
++    -0.77459666924148337704,
++    -0.62110294673722640294,
++    -0.43424374934680255800,
++    -0.22338668642896688163,
++     0.0,
++     0.22338668642896688163,
++     0.43424374934680255800,
++     0.62110294673722640294,
++     0.77459666924148337704,
++     0.88845923287225699889,
++     0.96049126870802028342,
++     0.99383196321275502221
++  };
++  static double x_031[31] =
++  {
++    -0.99909812496766759766,
++    -0.99383196321275502221,
++    -0.98153114955374010687,
++    -0.96049126870802028342,
++    -0.92965485742974005667,
++    -0.88845923287225699889,
++    -0.83672593816886873550,
++    -0.77459666924148337704,
++    -0.70249620649152707861,
++    -0.62110294673722640294,
++    -0.53131974364437562397,
++    -0.43424374934680255800,
++    -0.33113539325797683309,
++    -0.22338668642896688163,
++    -0.11248894313318662575,
++     0.0,
++     0.11248894313318662575,
++     0.22338668642896688163,
++     0.33113539325797683309,
++     0.43424374934680255800,
++     0.53131974364437562397,
++     0.62110294673722640294,
++     0.70249620649152707861,
++     0.77459666924148337704,
++     0.83672593816886873550,
++     0.88845923287225699889,
++     0.92965485742974005667,
++     0.96049126870802028342,
++     0.98153114955374010687,
++     0.99383196321275502221,
++     0.99909812496766759766
++  };
++  static double x_063[63] =
++  {
++    -0.99987288812035761194,
++    -0.99909812496766759766,
++    -0.99720625937222195908,
++    -0.99383196321275502221,
++    -0.98868475754742947994,
++    -0.98153114955374010687,
++    -0.97218287474858179658,
++    -0.96049126870802028342,
++    -0.94634285837340290515,
++    -0.92965485742974005667,
++    -0.91037115695700429250,
++    -0.88845923287225699889,
++    -0.86390793819369047715,
++    -0.83672593816886873550,
++    -0.80694053195021761186,
++    -0.77459666924148337704,
++    -0.73975604435269475868,
++    -0.70249620649152707861,
++    -0.66290966002478059546,
++    -0.62110294673722640294,
++    -0.57719571005204581484,
++    -0.53131974364437562397,
++    -0.48361802694584102756,
++    -0.43424374934680255800,
++    -0.38335932419873034692,
++    -0.33113539325797683309,
++    -0.27774982202182431507,
++    -0.22338668642896688163,
++    -0.16823525155220746498,
++    -0.11248894313318662575,
++    -0.056344313046592789972,
++     0.0,
++     0.056344313046592789972,
++     0.11248894313318662575,
++     0.16823525155220746498,
++     0.22338668642896688163,
++     0.27774982202182431507,
++     0.33113539325797683309,
++     0.38335932419873034692,
++     0.43424374934680255800,
++     0.48361802694584102756,
++     0.53131974364437562397,
++     0.57719571005204581484,
++     0.62110294673722640294,
++     0.66290966002478059546,
++     0.70249620649152707861,
++     0.73975604435269475868,
++     0.77459666924148337704,
++     0.80694053195021761186,
++     0.83672593816886873550,
++     0.86390793819369047715,
++     0.88845923287225699889,
++     0.91037115695700429250,
++     0.92965485742974005667,
++     0.94634285837340290515,
++     0.96049126870802028342,
++     0.97218287474858179658,
++     0.98153114955374010687,
++     0.98868475754742947994,
++     0.99383196321275502221,
++     0.99720625937222195908,
++     0.99909812496766759766,
++     0.99987288812035761194
++  };
++  static double x_127[127] =
++  {
++    -0.99998243035489159858,
++    -0.99987288812035761194,
++    -0.99959879967191068325,
++    -0.99909812496766759766,
++    -0.99831663531840739253,
++    -0.99720625937222195908,
++    -0.99572410469840718851,
++    -0.99383196321275502221,
++    -0.99149572117810613240,
++    -0.98868475754742947994,
++    -0.98537149959852037111,
++    -0.98153114955374010687,
++    -0.97714151463970571416,
++    -0.97218287474858179658,
++    -0.96663785155841656709,
++    -0.96049126870802028342,
++    -0.95373000642576113641,
++    -0.94634285837340290515,
++    -0.93832039777959288365,
++    -0.92965485742974005667,
++    -0.92034002547001242073,
++    -0.91037115695700429250,
++    -0.89974489977694003664,
++    -0.88845923287225699889,
++    -0.87651341448470526974,
++    -0.86390793819369047715,
++    -0.85064449476835027976,
++    -0.83672593816886873550,
++    -0.82215625436498040737,
++    -0.80694053195021761186,
++    -0.79108493379984836143,
++    -0.77459666924148337704,
++    -0.75748396638051363793,
++    -0.73975604435269475868,
++    -0.72142308537009891548,
++    -0.70249620649152707861,
++    -0.68298743109107922809,
++    -0.66290966002478059546,
++    -0.64227664250975951377,
++    -0.62110294673722640294,
++    -0.59940393024224289297,
++    -0.57719571005204581484,
++    -0.55449513263193254887,
++    -0.53131974364437562397,
++    -0.50768775753371660215,
++    -0.48361802694584102756,
++    -0.45913001198983233287,
++    -0.43424374934680255800,
++    -0.40897982122988867241,
++    -0.38335932419873034692,
++    -0.35740383783153215238,
++    -0.33113539325797683309,
++    -0.30457644155671404334,
++    -0.27774982202182431507,
++    -0.25067873030348317661,
++    -0.22338668642896688163,
++    -0.19589750271110015392,
++    -0.16823525155220746498,
++    -0.14042423315256017459,
++    -0.11248894313318662575,
++    -0.084454040083710883710,
++    -0.056344313046592789972,
++    -0.028184648949745694339,
++     0.0,
++     0.028184648949745694339,
++     0.056344313046592789972,
++     0.084454040083710883710,
++     0.11248894313318662575,
++     0.14042423315256017459,
++     0.16823525155220746498,
++     0.19589750271110015392,
++     0.22338668642896688163,
++     0.25067873030348317661,
++     0.27774982202182431507,
++     0.30457644155671404334,
++     0.33113539325797683309,
++     0.35740383783153215238,
++     0.38335932419873034692,
++     0.40897982122988867241,
++     0.43424374934680255800,
++     0.45913001198983233287,
++     0.48361802694584102756,
++     0.50768775753371660215,
++     0.53131974364437562397,
++     0.55449513263193254887,
++     0.57719571005204581484,
++     0.59940393024224289297,
++     0.62110294673722640294,
++     0.64227664250975951377,
++     0.66290966002478059546,
++     0.68298743109107922809,
++     0.70249620649152707861,
++     0.72142308537009891548,
++     0.73975604435269475868,
++     0.75748396638051363793,
++     0.77459666924148337704,
++     0.79108493379984836143,
++     0.80694053195021761186,
++     0.82215625436498040737,
++     0.83672593816886873550,
++     0.85064449476835027976,
++     0.86390793819369047715,
++     0.87651341448470526974,
++     0.88845923287225699889,
++     0.89974489977694003664,
++     0.91037115695700429250,
++     0.92034002547001242073,
++     0.92965485742974005667,
++     0.93832039777959288365,
++     0.94634285837340290515,
++     0.95373000642576113641,
++     0.96049126870802028342,
++     0.96663785155841656709,
++     0.97218287474858179658,
++     0.97714151463970571416,
++     0.98153114955374010687,
++     0.98537149959852037111,
++     0.98868475754742947994,
++     0.99149572117810613240,
++     0.99383196321275502221,
++     0.99572410469840718851,
++     0.99720625937222195908,
++     0.99831663531840739253,
++     0.99909812496766759766,
++     0.99959879967191068325,
++     0.99987288812035761194,
++     0.99998243035489159858
++  };
++  static double x_255[255] =
++  {
++    -0.99999759637974846462,
++    -0.99998243035489159858,
++    -0.99994399620705437576,
++    -0.99987288812035761194,
++    -0.99976049092443204733,
++    -0.99959879967191068325,
++    -0.99938033802502358193,
++    -0.99909812496766759766,
++    -0.99874561446809511470,
++    -0.99831663531840739253,
++    -0.99780535449595727456,
++    -0.99720625937222195908,
++    -0.99651414591489027385,
++    -0.99572410469840718851,
++    -0.99483150280062100052,
++    -0.99383196321275502221,
++    -0.99272134428278861533,
++    -0.99149572117810613240,
++    -0.99015137040077015918,
++    -0.98868475754742947994,
++    -0.98709252795403406719,
++    -0.98537149959852037111,
++    -0.98351865757863272876,
++    -0.98153114955374010687,
++    -0.97940628167086268381,
++    -0.97714151463970571416,
++    -0.97473445975240266776,
++    -0.97218287474858179658,
++    -0.96948465950245923177,
++    -0.96663785155841656709,
++    -0.96364062156981213252,
++    -0.96049126870802028342,
++    -0.95718821610986096274,
++    -0.95373000642576113641,
++    -0.95011529752129487656,
++    -0.94634285837340290515,
++    -0.94241156519108305981,
++    -0.93832039777959288365,
++    -0.93406843615772578800,
++    -0.92965485742974005667,
++    -0.92507893290707565236,
++    -0.92034002547001242073,
++    -0.91543758715576504064,
++    -0.91037115695700429250,
++    -0.90514035881326159519,
++    -0.89974489977694003664,
++    -0.89418456833555902286,
++    -0.88845923287225699889,
++    -0.88256884024734190684,
++    -0.87651341448470526974,
++    -0.87029305554811390585,
++    -0.86390793819369047715,
++    -0.85735831088623215653,
++    -0.85064449476835027976,
++    -0.84376688267270860104,
++    -0.83672593816886873550,
++    -0.82952219463740140018,
++    -0.82215625436498040737,
++    -0.81462878765513741344,
++    -0.80694053195021761186,
++    -0.79909229096084140180,
++    -0.79108493379984836143,
++    -0.78291939411828301639,
++    -0.77459666924148337704,
++    -0.76611781930376009072,
++    -0.75748396638051363793,
++    -0.74869629361693660282,
++    -0.73975604435269475868,
++    -0.73066452124218126133,
++    -0.72142308537009891548,
++    -0.71203315536225203459,
++    -0.70249620649152707861,
++    -0.69281376977911470289,
++    -0.68298743109107922809,
++    -0.67301883023041847920,
++    -0.66290966002478059546,
++    -0.65266166541001749610,
++    -0.64227664250975951377,
++    -0.63175643771119423041,
++    -0.62110294673722640294,
++    -0.61031811371518640016,
++    -0.59940393024224289297,
++    -0.58836243444766254143,
++    -0.57719571005204581484,
++    -0.56590588542365442262,
++    -0.55449513263193254887,
++    -0.54296566649831149049,
++    -0.53131974364437562397,
++    -0.51955966153745702199,
++    -0.50768775753371660215,
++    -0.49570640791876146017,
++    -0.48361802694584102756,
++    -0.47142506587165887693,
++    -0.45913001198983233287,
++    -0.44673538766202847374,
++    -0.43424374934680255800,
++    -0.42165768662616330006,
++    -0.40897982122988867241,
++    -0.39621280605761593918,
++    -0.38335932419873034692,
++    -0.37042208795007823014,
++    -0.35740383783153215238,
++    -0.34430734159943802278,
++    -0.33113539325797683309,
++    -0.31789081206847668318,
++    -0.30457644155671404334,
++    -0.29119514851824668196,
++    -0.27774982202182431507,
++    -0.26424337241092676194,
++    -0.25067873030348317661,
++    -0.23705884558982972721,
++    -0.22338668642896688163,
++    -0.20966523824318119477,
++    -0.19589750271110015392,
++    -0.18208649675925219825,
++    -0.16823525155220746498,
++    -0.15434681148137810869,
++    -0.14042423315256017459,
++    -0.12647058437230196685,
++    -0.11248894313318662575,
++    -0.098482396598119202090,
++    -0.084454040083710883710,
++    -0.070406976042855179063,
++    -0.056344313046592789972,
++    -0.042269164765363603212,
++    -0.028184648949745694339,
++    -0.014093886410782462614,
++    0.0,
++    0.014093886410782462614,
++    0.028184648949745694339,
++    0.042269164765363603212,
++    0.056344313046592789972,
++    0.070406976042855179063,
++    0.084454040083710883710,
++    0.098482396598119202090,
++    0.11248894313318662575,
++    0.12647058437230196685,
++    0.14042423315256017459,
++    0.15434681148137810869,
++    0.16823525155220746498,
++    0.18208649675925219825,
++    0.19589750271110015392,
++    0.20966523824318119477,
++    0.22338668642896688163,
++    0.23705884558982972721,
++    0.25067873030348317661,
++    0.26424337241092676194,
++    0.27774982202182431507,
++    0.29119514851824668196,
++    0.30457644155671404334,
++    0.31789081206847668318,
++    0.33113539325797683309,
++    0.34430734159943802278,
++    0.35740383783153215238,
++    0.37042208795007823014,
++    0.38335932419873034692,
++    0.39621280605761593918,
++    0.40897982122988867241,
++    0.42165768662616330006,
++    0.43424374934680255800,
++    0.44673538766202847374,
++    0.45913001198983233287,
++    0.47142506587165887693,
++    0.48361802694584102756,
++    0.49570640791876146017,
++    0.50768775753371660215,
++    0.51955966153745702199,
++    0.53131974364437562397,
++    0.54296566649831149049,
++    0.55449513263193254887,
++    0.56590588542365442262,
++    0.57719571005204581484,
++    0.58836243444766254143,
++    0.59940393024224289297,
++    0.61031811371518640016,
++    0.62110294673722640294,
++    0.63175643771119423041,
++    0.64227664250975951377,
++    0.65266166541001749610,
++    0.66290966002478059546,
++    0.67301883023041847920,
++    0.68298743109107922809,
++    0.69281376977911470289,
++    0.70249620649152707861,
++    0.71203315536225203459,
++    0.72142308537009891548,
++    0.73066452124218126133,
++    0.73975604435269475868,
++    0.74869629361693660282,
++    0.75748396638051363793,
++    0.76611781930376009072,
++    0.77459666924148337704,
++    0.78291939411828301639,
++    0.79108493379984836143,
++    0.79909229096084140180,
++    0.80694053195021761186,
++    0.81462878765513741344,
++    0.82215625436498040737,
++    0.82952219463740140018,
++    0.83672593816886873550,
++    0.84376688267270860104,
++    0.85064449476835027976,
++    0.85735831088623215653,
++    0.86390793819369047715,
++    0.87029305554811390585,
++    0.87651341448470526974,
++    0.88256884024734190684,
++    0.88845923287225699889,
++    0.89418456833555902286,
++    0.89974489977694003664,
++    0.90514035881326159519,
++    0.91037115695700429250,
++    0.91543758715576504064,
++    0.92034002547001242073,
++    0.92507893290707565236,
++    0.92965485742974005667,
++    0.93406843615772578800,
++    0.93832039777959288365,
++    0.94241156519108305981,
++    0.94634285837340290515,
++    0.95011529752129487656,
++    0.95373000642576113641,
++    0.95718821610986096274,
++    0.96049126870802028342,
++    0.96364062156981213252,
++    0.96663785155841656709,
++    0.96948465950245923177,
++    0.97218287474858179658,
++    0.97473445975240266776,
++    0.97714151463970571416,
++    0.97940628167086268381,
++    0.98153114955374010687,
++    0.98351865757863272876,
++    0.98537149959852037111,
++    0.98709252795403406719,
++    0.98868475754742947994,
++    0.99015137040077015918,
++    0.99149572117810613240,
++    0.99272134428278861533,
++    0.99383196321275502221,
++    0.99483150280062100052,
++    0.99572410469840718851,
++    0.99651414591489027385,
++    0.99720625937222195908,
++    0.99780535449595727456,
++    0.99831663531840739253,
++    0.99874561446809511470,
++    0.99909812496766759766,
++    0.99938033802502358193,
++    0.99959879967191068325,
++    0.99976049092443204733,
++    0.99987288812035761194,
++    0.99994399620705437576,
++    0.99998243035489159858,
++    0.99999759637974846462
++  };
++  static double x_511[511] =
++  {
++    -0.999999672956734384381,
++    -0.999997596379748464620,
++    -0.999992298136257588028,
++    -0.999982430354891598580,
++    -0.999966730098486276883,
++    -0.999943996207054375764,
++    -0.999913081144678282800,
++    -0.999872888120357611938,
++    -0.999822363679787739196,
++    -0.999760490924432047330,
++    -0.999686286448317731776,
++    -0.999598799671910683252,
++    -0.999497112467187190535,
++    -0.999380338025023581928,
++    -0.999247618943342473599,
++    -0.999098124967667597662,
++    -0.998931050830810562236,
++    -0.998745614468095114704,
++    -0.998541055697167906027,
++    -0.998316635318407392531,
++    -0.998071634524930323302,
++    -0.997805354495957274562,
++    -0.997517116063472399965,
++    -0.997206259372221959076,
++    -0.996872143485260161299,
++    -0.996514145914890273849,
++    -0.996131662079315037786,
++    -0.995724104698407188509,
++    -0.995290903148810302261,
++    -0.994831502800621000519,
++    -0.994345364356723405931,
++    -0.993831963212755022209,
++    -0.993290788851684966211,
++    -0.992721344282788615328,
++    -0.992123145530863117683,
++    -0.991495721178106132399,
++    -0.990838611958294243677,
++    -0.990151370400770159181,
++    -0.989433560520240838716,
++    -0.988684757547429479939,
++    -0.987904547695124280467,
++    -0.987092527954034067190,
++    -0.986248305913007552681,
++    -0.985371499598520371114,
++    -0.984461737328814534596,
++    -0.983518657578632728762,
++    -0.982541908851080604251,
++    -0.981531149553740106867,
++    -0.980486047876721339416,
++    -0.979406281670862683806,
++    -0.978291538324758539526,
++    -0.977141514639705714156,
++    -0.975955916702011753129,
++    -0.974734459752402667761,
++    -0.973476868052506926773,
++    -0.972182874748581796578,
++    -0.970852221732792443256,
++    -0.969484659502459231771,
++    -0.968079947017759947964,
++    -0.966637851558416567092,
++    -0.965158148579915665979,
++    -0.963640621569812132521,
++    -0.962085061904651475741,
++    -0.960491268708020283423,
++    -0.958859048710200221356,
++    -0.957188216109860962736,
++    -0.955478592438183697574,
++    -0.953730006425761136415,
++    -0.951942293872573589498,
++    -0.950115297521294876558,
++    -0.948248866934137357063,
++    -0.946342858373402905148,
++    -0.944397134685866648591,
++    -0.942411565191083059813,
++    -0.940386025573669721370,
++    -0.938320397779592883655,
++    -0.936214569916450806625,
++    -0.934068436157725787999,
++    -0.931881896650953639345,
++    -0.929654857429740056670,
++    -0.927387230329536696843,
++    -0.925078932907075652364,
++    -0.922729888363349241523,
++    -0.920340025470012420730,
++    -0.917909278499077501636,
++    -0.915437587155765040644,
++    -0.912924896514370590080,
++    -0.910371156957004292498,
++    -0.907776324115058903624,
++    -0.905140358813261595189,
++    -0.902463227016165675048,
++    -0.899744899776940036639,
++    -0.896985353188316590376,
++    -0.894184568335559022859,
++    -0.891342531251319871666,
++    -0.888459232872256998890,
++    -0.885534668997285008926,
++    -0.882568840247341906842,
++    -0.879561752026556262568,
++    -0.876513414484705269742,
++    -0.873423842480859310192,
++    -0.870293055548113905851,
++    -0.867121077859315215614,
++    -0.863907938193690477146,
++    -0.860653669904299969802,
++    -0.857358310886232156525,
++    -0.854021903545468625813,
++    -0.850644494768350279758,
++    -0.847226135891580884381,
++    -0.843766882672708601038,
++    -0.840266795261030442350,
++    -0.836725938168868735503,
++    -0.833144380243172624728,
++    -0.829522194637401400178,
++    -0.825859458783650001088,
++    -0.822156254364980407373,
++    -0.818412667287925807395,
++    -0.814628787655137413436,
++    -0.810804709738146594361,
++    -0.806940531950217611856,
++    -0.803036356819268687782,
++    -0.799092290960841401800,
++    -0.795108445051100526780,
++    -0.791084933799848361435,
++    -0.787021875923539422170,
++    -0.782919394118283016385,
++    -0.778777615032822744702,
++    -0.774596669241483377036,
++    -0.770376691217076824278,
++    -0.766117819303760090717,
++    -0.761820195689839149173,
++    -0.757483966380513637926,
++    -0.753109281170558142523,
++    -0.748696293616936602823,
++    -0.744245161011347082309,
++    -0.739756044352694758677,
++    -0.735229108319491547663,
++    -0.730664521242181261329,
++    -0.726062455075389632685,
++    -0.721423085370098915485,
++    -0.716746591245747095767,
++    -0.712033155362252034587,
++    -0.707282963891961103412,
++    -0.702496206491527078610,
++    -0.697673076273711232906,
++    -0.692813769779114702895,
++    -0.687918486947839325756,
++    -0.682987431091079228087,
++    -0.678020808862644517838,
++    -0.673018830230418479199,
++    -0.667981708447749702165,
++    -0.662909660024780595461,
++    -0.657802904699713735422,
++    -0.652661665410017496101,
++    -0.647486168263572388782,
++    -0.642276642509759513774,
++    -0.637033320510492495071,
++    -0.631756437711194230414,
++    -0.626446232611719746542,
++    -0.621102946737226402941,
++    -0.615726824608992638014,
++    -0.610318113715186400156,
++    -0.604877064481584353319,
++    -0.599403930242242892974,
++    -0.593898967210121954393,
++    -0.588362434447662541434,
++    -0.582794593837318850840,
++    -0.577195710052045814844,
++    -0.571566050525742833992,
++    -0.565905885423654422623,
++    -0.560215487612728441818,
++    -0.554495132631932548866,
++    -0.548745098662529448608,
++    -0.542965666498311490492,
++    -0.537157119515795115982,
++    -0.531319743644375623972,
++    -0.525453827336442687395,
++    -0.519559661537457021993,
++    -0.513637539655988578507,
++    -0.507687757533716602155,
++    -0.501710613415391878251,
++    -0.495706407918761460170,
++    -0.489675444004456155436,
++    -0.483618026945841027562,
++    -0.477534464298829155284,
++    -0.471425065871658876934,
++    -0.465290143694634735858,
++    -0.459130011989832332874,
++    -0.452944987140767283784,
++    -0.446735387662028473742,
++    -0.440501534168875795783,
++    -0.434243749346802558002,
++    -0.427962357921062742583,
++    -0.421657686626163300056,
++    -0.415330064175321663764,
++    -0.408979821229888672409,
++    -0.402607290368737092671,
++    -0.396212806057615939183,
++    -0.389796704618470795479,
++    -0.383359324198730346916,
++    -0.376901004740559344802,
++    -0.370422087950078230138,
++    -0.363922917266549655269,
++    -0.357403837831532152376,
++    -0.350865196458001209011,
++    -0.344307341599438022777,
++    -0.337730623318886219621,
++    -0.331135393257976833093,
++    -0.324522004605921855207,
++    -0.317890812068476683182,
++    -0.311242171836871800300,
++    -0.304576441556714043335,
++    -0.297893980296857823437,
++    -0.291195148518246681964,
++    -0.284480308042725577496,
++    -0.277749822021824315065,
++    -0.271004054905512543536,
++    -0.264243372410926761945,
++    -0.257468141491069790481,
++    -0.250678730303483176613,
++    -0.243875508178893021593,
++    -0.237058845589829727213,
++    -0.230229114119222177156,
++    -0.223386686428966881628,
++    -0.216531936228472628081,
++    -0.209665238243181194766,
++    -0.202786968183064697557,
++    -0.195897502711100153915,
++    -0.188997219411721861059,
++    -0.182086496759252198246,
++    -0.175165714086311475707,
++    -0.168235251552207464982,
++    -0.161295490111305257361,
++    -0.154346811481378108692,
++    -0.147389598111939940054,
++    -0.140424233152560174594,
++    -0.133451100421161601344,
++    -0.126470584372301966851,
++    -0.119483070065440005133,
++    -0.112488943133186625746,
++    -0.105488589749541988533,
++    -0.984823965981192020903E-01,
++    -0.914707508403553909095E-01,
++    -0.844540400837108837102E-01,
++    -0.774326523498572825675E-01,
++    -0.704069760428551790633E-01,
++    -0.633773999173222898797E-01,
++    -0.563443130465927899720E-01,
++    -0.493081047908686267156E-01,
++    -0.422691647653636032124E-01,
++    -0.352278828084410232603E-01,
++    -0.281846489497456943394E-01,
++    -0.211398533783310883350E-01,
++    -0.140938864107824626142E-01,
++    -0.704713845933674648514E-02,
++    +0.000000000000000000000,
++    +0.704713845933674648514E-02,
++    +0.140938864107824626142E-01,
++    +0.211398533783310883350E-01,
++    +0.281846489497456943394E-01,
++    +0.352278828084410232603E-01,
++    +0.422691647653636032124E-01,
++    +0.493081047908686267156E-01,
++    +0.563443130465927899720E-01,
++    +0.633773999173222898797E-01,
++    +0.704069760428551790633E-01,
++    +0.774326523498572825675E-01,
++    +0.844540400837108837102E-01,
++    +0.914707508403553909095E-01,
++    +0.984823965981192020903E-01,
++    +0.105488589749541988533,
++    +0.112488943133186625746,
++    +0.119483070065440005133,
++    +0.126470584372301966851,
++    +0.133451100421161601344,
++    +0.140424233152560174594,
++    +0.147389598111939940054,
++    +0.154346811481378108692,
++    +0.161295490111305257361,
++    +0.168235251552207464982,
++    +0.175165714086311475707,
++    +0.182086496759252198246,
++    +0.188997219411721861059,
++    +0.195897502711100153915,
++    +0.202786968183064697557,
++    +0.209665238243181194766,
++    +0.216531936228472628081,
++    +0.223386686428966881628,
++    +0.230229114119222177156,
++    +0.237058845589829727213,
++    +0.243875508178893021593,
++    +0.250678730303483176613,
++    +0.257468141491069790481,
++    +0.264243372410926761945,
++    +0.271004054905512543536,
++    +0.277749822021824315065,
++    +0.284480308042725577496,
++    +0.291195148518246681964,
++    +0.297893980296857823437,
++    +0.304576441556714043335,
++    +0.311242171836871800300,
++    +0.317890812068476683182,
++    +0.324522004605921855207,
++    +0.331135393257976833093,
++    +0.337730623318886219621,
++    +0.344307341599438022777,
++    +0.350865196458001209011,
++    +0.357403837831532152376,
++    +0.363922917266549655269,
++    +0.370422087950078230138,
++    +0.376901004740559344802,
++    +0.383359324198730346916,
++    +0.389796704618470795479,
++    +0.396212806057615939183,
++    +0.402607290368737092671,
++    +0.408979821229888672409,
++    +0.415330064175321663764,
++    +0.421657686626163300056,
++    +0.427962357921062742583,
++    +0.434243749346802558002,
++    +0.440501534168875795783,
++    +0.446735387662028473742,
++    +0.452944987140767283784,
++    +0.459130011989832332874,
++    +0.465290143694634735858,
++    +0.471425065871658876934,
++    +0.477534464298829155284,
++    +0.483618026945841027562,
++    +0.489675444004456155436,
++    +0.495706407918761460170,
++    +0.501710613415391878251,
++    +0.507687757533716602155,
++    +0.513637539655988578507,
++    +0.519559661537457021993,
++    +0.525453827336442687395,
++    +0.531319743644375623972,
++    +0.537157119515795115982,
++    +0.542965666498311490492,
++    +0.548745098662529448608,
++    +0.554495132631932548866,
++    +0.560215487612728441818,
++    +0.565905885423654422623,
++    +0.571566050525742833992,
++    +0.577195710052045814844,
++    +0.582794593837318850840,
++    +0.588362434447662541434,
++    +0.593898967210121954393,
++    +0.599403930242242892974,
++    +0.604877064481584353319,
++    +0.610318113715186400156,
++    +0.615726824608992638014,
++    +0.621102946737226402941,
++    +0.626446232611719746542,
++    +0.631756437711194230414,
++    +0.637033320510492495071,
++    +0.642276642509759513774,
++    +0.647486168263572388782,
++    +0.652661665410017496101,
++    +0.657802904699713735422,
++    +0.662909660024780595461,
++    +0.667981708447749702165,
++    +0.673018830230418479199,
++    +0.678020808862644517838,
++    +0.682987431091079228087,
++    +0.687918486947839325756,
++    +0.692813769779114702895,
++    +0.697673076273711232906,
++    +0.702496206491527078610,
++    +0.707282963891961103412,
++    +0.712033155362252034587,
++    +0.716746591245747095767,
++    +0.721423085370098915485,
++    +0.726062455075389632685,
++    +0.730664521242181261329,
++    +0.735229108319491547663,
++    +0.739756044352694758677,
++    +0.744245161011347082309,
++    +0.748696293616936602823,
++    +0.753109281170558142523,
++    +0.757483966380513637926,
++    +0.761820195689839149173,
++    +0.766117819303760090717,
++    +0.770376691217076824278,
++    +0.774596669241483377036,
++    +0.778777615032822744702,
++    +0.782919394118283016385,
++    +0.787021875923539422170,
++    +0.791084933799848361435,
++    +0.795108445051100526780,
++    +0.799092290960841401800,
++    +0.803036356819268687782,
++    +0.806940531950217611856,
++    +0.810804709738146594361,
++    +0.814628787655137413436,
++    +0.818412667287925807395,
++    +0.822156254364980407373,
++    +0.825859458783650001088,
++    +0.829522194637401400178,
++    +0.833144380243172624728,
++    +0.836725938168868735503,
++    +0.840266795261030442350,
++    +0.843766882672708601038,
++    +0.847226135891580884381,
++    +0.850644494768350279758,
++    +0.854021903545468625813,
++    +0.857358310886232156525,
++    +0.860653669904299969802,
++    +0.863907938193690477146,
++    +0.867121077859315215614,
++    +0.870293055548113905851,
++    +0.873423842480859310192,
++    +0.876513414484705269742,
++    +0.879561752026556262568,
++    +0.882568840247341906842,
++    +0.885534668997285008926,
++    +0.888459232872256998890,
++    +0.891342531251319871666,
++    +0.894184568335559022859,
++    +0.896985353188316590376,
++    +0.899744899776940036639,
++    +0.902463227016165675048,
++    +0.905140358813261595189,
++    +0.907776324115058903624,
++    +0.910371156957004292498,
++    +0.912924896514370590080,
++    +0.915437587155765040644,
++    +0.917909278499077501636,
++    +0.920340025470012420730,
++    +0.922729888363349241523,
++    +0.925078932907075652364,
++    +0.927387230329536696843,
++    +0.929654857429740056670,
++    +0.931881896650953639345,
++    +0.934068436157725787999,
++    +0.936214569916450806625,
++    +0.938320397779592883655,
++    +0.940386025573669721370,
++    +0.942411565191083059813,
++    +0.944397134685866648591,
++    +0.946342858373402905148,
++    +0.948248866934137357063,
++    +0.950115297521294876558,
++    +0.951942293872573589498,
++    +0.953730006425761136415,
++    +0.955478592438183697574,
++    +0.957188216109860962736,
++    +0.958859048710200221356,
++    +0.960491268708020283423,
++    +0.962085061904651475741,
++    +0.963640621569812132521,
++    +0.965158148579915665979,
++    +0.966637851558416567092,
++    +0.968079947017759947964,
++    +0.969484659502459231771,
++    +0.970852221732792443256,
++    +0.972182874748581796578,
++    +0.973476868052506926773,
++    +0.974734459752402667761,
++    +0.975955916702011753129,
++    +0.977141514639705714156,
++    +0.978291538324758539526,
++    +0.979406281670862683806,
++    +0.980486047876721339416,
++    +0.981531149553740106867,
++    +0.982541908851080604251,
++    +0.983518657578632728762,
++    +0.984461737328814534596,
++    +0.985371499598520371114,
++    +0.986248305913007552681,
++    +0.987092527954034067190,
++    +0.987904547695124280467,
++    +0.988684757547429479939,
++    +0.989433560520240838716,
++    +0.990151370400770159181,
++    +0.990838611958294243677,
++    +0.991495721178106132399,
++    +0.992123145530863117683,
++    +0.992721344282788615328,
++    +0.993290788851684966211,
++    +0.993831963212755022209,
++    +0.994345364356723405931,
++    +0.994831502800621000519,
++    +0.995290903148810302261,
++    +0.995724104698407188509,
++    +0.996131662079315037786,
++    +0.996514145914890273849,
++    +0.996872143485260161299,
++    +0.997206259372221959076,
++    +0.997517116063472399965,
++    +0.997805354495957274562,
++    +0.998071634524930323302,
++    +0.998316635318407392531,
++    +0.998541055697167906027,
++    +0.998745614468095114704,
++    +0.998931050830810562236,
++    +0.999098124967667597662,
++    +0.999247618943342473599,
++    +0.999380338025023581928,
++    +0.999497112467187190535,
++    +0.999598799671910683252,
++    +0.999686286448317731776,
++    +0.999760490924432047330,
++    +0.999822363679787739196,
++    +0.999872888120357611938,
++    +0.999913081144678282800,
++    +0.999943996207054375764,
++    +0.999966730098486276883,
++    +0.999982430354891598580,
++    +0.999992298136257588028,
++    +0.999997596379748464620,
++    +0.999999672956734384381
++  };
++
++  if ( n == 1 )
++  {
++    webbur::r8vec_copy ( n, x_001, x );
++  }
++  else if ( n == 3 )
++  {
++    webbur::r8vec_copy ( n, x_003, x );
++  }
++  else if ( n == 7 )
++  {
++    webbur::r8vec_copy ( n, x_007, x );
++  }
++  else if ( n == 15 )
++  {
++    webbur::r8vec_copy ( n, x_015, x );
++  }
++  else if ( n == 31 )
++  {
++    webbur::r8vec_copy ( n, x_031, x );
++  }
++  else if ( n == 63 )
++  {
++    webbur::r8vec_copy ( n, x_063, x );
++  }
++  else if ( n == 127 )
++  {
++    webbur::r8vec_copy ( n, x_127, x );
++  }
++  else if ( n == 255 )
++  {
++    webbur::r8vec_copy ( n, x_255, x );
++  }
++  else if ( n == 511 )
++  {
++    webbur::r8vec_copy ( n, x_511, x );
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "PATTERSON_LOOKUP_POINTS - Fatal error!\n";
++    std::cerr << "  Unexpected value of N = " << n << "\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++void patterson_lookup_points_np ( int n, int np, double p[], double x[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    PATTERSON_LOOKUP_POINTS_NP looks up Patterson quadrature points.
++//
++//  Discussion:
++//
++//    Our convention is that the abscissas are numbered from left to right.
++//
++//    The rule is defined on [-1,1],
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 December 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Prem Kythe, Michael Schaeferkotter,
++//    Handbook of Computational Methods for Integration,
++//    Chapman and Hall, 2004,
++//    ISBN: 1-58488-428-2,
++//    LC: QA299.3.K98.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double X[N], the abscissas.
++//
++{
++  patterson_lookup_points ( n, x );
++
++  return;
++}
++//****************************************************************************80
++
++void patterson_lookup_weights ( int n, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    PATTERSON_LOOKUP_WEIGHTS looks up Patterson quadrature weights.
++//
++//  Discussion:
++//
++//    The allowed orders are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
++//
++//    The weights are positive, symmetric and should sum to 2.
++//
++//    The user must preallocate space for the output array W.
++//
++//    These rules constitute a nested family.  The rules can integrate exactly
++//    any polynomial of degree 1, 5, 11, 23, 47, 95, 191, 383 or 767,
++//    respectively.
++//
++//    The data for N = 511 was supplied by Dirk Laurie, and is derived
++//    from a NAG Library function d01arf.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    14 September 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Prem Kythe, Michael Schaeferkotter,
++//    Handbook of Computational Methods for Integration,
++//    Chapman and Hall, 2004,
++//    ISBN: 1-58488-428-2,
++//    LC: QA299.3.K98.
++//
++//    NAG Library Documentation,
++//    D01ARF,
++//    The Numerical Algorithms Group.
++//
++//    Thomas Patterson,
++//    The Optimal Addition of Points to Quadrature Formulae,
++//    Mathematics of Computation,
++//    Volume 22, Number 104, October 1968, pages 847-856.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 or 511.
++//
++//    Output, double W[N], the weights.
++//
++{
++  static double w_001[1] =
++  {
++    2.0
++  };
++  static double w_003[3] =
++  {
++    0.555555555555555555556,
++    0.888888888888888888889,
++    0.555555555555555555556
++  };
++  static double w_007[7] =
++  {
++    0.104656226026467265194,
++    0.268488089868333440729,
++    0.401397414775962222905,
++    0.450916538658474142345,
++    0.401397414775962222905,
++    0.268488089868333440729,
++    0.104656226026467265194
++  };
++  static double w_015[15] =
++  {
++    0.0170017196299402603390,
++    0.0516032829970797396969,
++    0.0929271953151245376859,
++    0.134415255243784220360,
++    0.171511909136391380787,
++    0.200628529376989021034,
++    0.219156858401587496404,
++    0.225510499798206687386,
++    0.219156858401587496404,
++    0.200628529376989021034,
++    0.171511909136391380787,
++    0.134415255243784220360,
++    0.0929271953151245376859,
++    0.0516032829970797396969,
++    0.0170017196299402603390
++  };
++  static double w_031[31] =
++  {
++    0.00254478079156187441540,
++    0.00843456573932110624631,
++    0.0164460498543878109338,
++    0.0258075980961766535646,
++    0.0359571033071293220968,
++    0.0464628932617579865414,
++    0.0569795094941233574122,
++    0.0672077542959907035404,
++    0.0768796204990035310427,
++    0.0857559200499903511542,
++    0.0936271099812644736167,
++    0.100314278611795578771,
++    0.105669893580234809744,
++    0.109578421055924638237,
++    0.111956873020953456880,
++    0.112755256720768691607,
++    0.111956873020953456880,
++    0.109578421055924638237,
++    0.105669893580234809744,
++    0.100314278611795578771,
++    0.0936271099812644736167,
++    0.0857559200499903511542,
++    0.0768796204990035310427,
++    0.0672077542959907035404,
++    0.0569795094941233574122,
++    0.0464628932617579865414,
++    0.0359571033071293220968,
++    0.0258075980961766535646,
++    0.0164460498543878109338,
++    0.00843456573932110624631,
++    0.00254478079156187441540
++  };
++  static double w_063[63] =
++  {
++    0.000363221481845530659694,
++    0.00126515655623006801137,
++    0.00257904979468568827243,
++    0.00421763044155885483908,
++    0.00611550682211724633968,
++    0.00822300795723592966926,
++    0.0104982469096213218983,
++    0.0129038001003512656260,
++    0.0154067504665594978021,
++    0.0179785515681282703329,
++    0.0205942339159127111492,
++    0.0232314466399102694433,
++    0.0258696793272147469108,
++    0.0284897547458335486125,
++    0.0310735511116879648799,
++    0.0336038771482077305417,
++    0.0360644327807825726401,
++    0.0384398102494555320386,
++    0.0407155101169443189339,
++    0.0428779600250077344929,
++    0.0449145316536321974143,
++    0.0468135549906280124026,
++    0.0485643304066731987159,
++    0.0501571393058995374137,
++    0.0515832539520484587768,
++    0.0528349467901165198621,
++    0.0539054993352660639269,
++    0.0547892105279628650322,
++    0.0554814043565593639878,
++    0.0559784365104763194076,
++    0.0562776998312543012726,
++    0.0563776283603847173877,
++    0.0562776998312543012726,
++    0.0559784365104763194076,
++    0.0554814043565593639878,
++    0.0547892105279628650322,
++    0.0539054993352660639269,
++    0.0528349467901165198621,
++    0.0515832539520484587768,
++    0.0501571393058995374137,
++    0.0485643304066731987159,
++    0.0468135549906280124026,
++    0.0449145316536321974143,
++    0.0428779600250077344929,
++    0.0407155101169443189339,
++    0.0384398102494555320386,
++    0.0360644327807825726401,
++    0.0336038771482077305417,
++    0.0310735511116879648799,
++    0.0284897547458335486125,
++    0.0258696793272147469108,
++    0.0232314466399102694433,
++    0.0205942339159127111492,
++    0.0179785515681282703329,
++    0.0154067504665594978021,
++    0.0129038001003512656260,
++    0.0104982469096213218983,
++    0.00822300795723592966926,
++    0.00611550682211724633968,
++    0.00421763044155885483908,
++    0.00257904979468568827243,
++    0.00126515655623006801137,
++    0.000363221481845530659694
++  };
++  static double w_127[127] =
++  {
++    0.0000505360952078625176247,
++    0.000180739564445388357820,
++    0.000377746646326984660274,
++    0.000632607319362633544219,
++    0.000938369848542381500794,
++    0.00128952408261041739210,
++    0.00168114286542146990631,
++    0.00210881524572663287933,
++    0.00256876494379402037313,
++    0.00305775341017553113613,
++    0.00357289278351729964938,
++    0.00411150397865469304717,
++    0.00467105037211432174741,
++    0.00524912345480885912513,
++    0.00584344987583563950756,
++    0.00645190005017573692280,
++    0.00707248999543355546805,
++    0.00770337523327974184817,
++    0.00834283875396815770558,
++    0.00898927578406413572328,
++    0.00964117772970253669530,
++    0.0102971169579563555237,
++    0.0109557333878379016480,
++    0.0116157233199551347270,
++    0.0122758305600827700870,
++    0.0129348396636073734547,
++    0.0135915710097655467896,
++    0.0142448773729167743063,
++    0.0148936416648151820348,
++    0.0155367755558439824399,
++    0.0161732187295777199419,
++    0.0168019385741038652709,
++    0.0174219301594641737472,
++    0.0180322163903912863201,
++    0.0186318482561387901863,
++    0.0192199051247277660193,
++    0.0197954950480974994880,
++    0.0203577550584721594669,
++    0.0209058514458120238522,
++    0.0214389800125038672465,
++    0.0219563663053178249393,
++    0.0224572658268160987071,
++    0.0229409642293877487608,
++    0.0234067774953140062013,
++    0.0238540521060385400804,
++    0.0242821652033365993580,
++    0.0246905247444876769091,
++    0.0250785696529497687068,
++    0.0254457699654647658126,
++    0.0257916269760242293884,
++    0.0261156733767060976805,
++    0.0264174733950582599310,
++    0.0266966229274503599062,
++    0.0269527496676330319634,
++    0.0271855132296247918192,
++    0.0273946052639814325161,
++    0.0275797495664818730349,
++    0.0277407021782796819939,
++    0.0278772514766137016085,
++    0.0279892182552381597038,
++    0.0280764557938172466068,
++    0.0281388499156271506363,
++    0.0281763190330166021307,
++    0.0281888141801923586938,
++    0.0281763190330166021307,
++    0.0281388499156271506363,
++    0.0280764557938172466068,
++    0.0279892182552381597038,
++    0.0278772514766137016085,
++    0.0277407021782796819939,
++    0.0275797495664818730349,
++    0.0273946052639814325161,
++    0.0271855132296247918192,
++    0.0269527496676330319634,
++    0.0266966229274503599062,
++    0.0264174733950582599310,
++    0.0261156733767060976805,
++    0.0257916269760242293884,
++    0.0254457699654647658126,
++    0.0250785696529497687068,
++    0.0246905247444876769091,
++    0.0242821652033365993580,
++    0.0238540521060385400804,
++    0.0234067774953140062013,
++    0.0229409642293877487608,
++    0.0224572658268160987071,
++    0.0219563663053178249393,
++    0.0214389800125038672465,
++    0.0209058514458120238522,
++    0.0203577550584721594669,
++    0.0197954950480974994880,
++    0.0192199051247277660193,
++    0.0186318482561387901863,
++    0.0180322163903912863201,
++    0.0174219301594641737472,
++    0.0168019385741038652709,
++    0.0161732187295777199419,
++    0.0155367755558439824399,
++    0.0148936416648151820348,
++    0.0142448773729167743063,
++    0.0135915710097655467896,
++    0.0129348396636073734547,
++    0.0122758305600827700870,
++    0.0116157233199551347270,
++    0.0109557333878379016480,
++    0.0102971169579563555237,
++    0.00964117772970253669530,
++    0.00898927578406413572328,
++    0.00834283875396815770558,
++    0.00770337523327974184817,
++    0.00707248999543355546805,
++    0.00645190005017573692280,
++    0.00584344987583563950756,
++    0.00524912345480885912513,
++    0.00467105037211432174741,
++    0.00411150397865469304717,
++    0.00357289278351729964938,
++    0.00305775341017553113613,
++    0.00256876494379402037313,
++    0.00210881524572663287933,
++    0.00168114286542146990631,
++    0.00128952408261041739210,
++    0.000938369848542381500794,
++    0.000632607319362633544219,
++    0.000377746646326984660274,
++    0.000180739564445388357820,
++    0.0000505360952078625176247
++  };
++  static double w_255[255] =
++  {
++    0.69379364324108267170E-05,
++    0.25157870384280661489E-04,
++    0.53275293669780613125E-04,
++    0.90372734658751149261E-04,
++    0.13575491094922871973E-03,
++    0.18887326450650491366E-03,
++    0.24921240048299729402E-03,
++    0.31630366082226447689E-03,
++    0.38974528447328229322E-03,
++    0.46918492424785040975E-03,
++    0.55429531493037471492E-03,
++    0.64476204130572477933E-03,
++    0.74028280424450333046E-03,
++    0.84057143271072246365E-03,
++    0.94536151685852538246E-03,
++    0.10544076228633167722E-02,
++    0.11674841174299594077E-02,
++    0.12843824718970101768E-02,
++    0.14049079956551446427E-02,
++    0.15288767050877655684E-02,
++    0.16561127281544526052E-02,
++    0.17864463917586498247E-02,
++    0.19197129710138724125E-02,
++    0.20557519893273465236E-02,
++    0.21944069253638388388E-02,
++    0.23355251860571608737E-02,
++    0.24789582266575679307E-02,
++    0.26245617274044295626E-02,
++    0.27721957645934509940E-02,
++    0.29217249379178197538E-02,
++    0.30730184347025783234E-02,
++    0.32259500250878684614E-02,
++    0.33803979910869203823E-02,
++    0.35362449977167777340E-02,
++    0.36933779170256508183E-02,
++    0.38516876166398709241E-02,
++    0.40110687240750233989E-02,
++    0.41714193769840788528E-02,
++    0.43326409680929828545E-02,
++    0.44946378920320678616E-02,
++    0.46573172997568547773E-02,
++    0.48205888648512683476E-02,
++    0.49843645647655386012E-02,
++    0.51485584789781777618E-02,
++    0.53130866051870565663E-02,
++    0.54778666939189508240E-02,
++    0.56428181013844441585E-02,
++    0.58078616599775673635E-02,
++    0.59729195655081658049E-02,
++    0.61379152800413850435E-02,
++    0.63027734490857587172E-02,
++    0.64674198318036867274E-02,
++    0.66317812429018878941E-02,
++    0.67957855048827733948E-02,
++    0.69593614093904229394E-02,
++    0.71224386864583871532E-02,
++    0.72849479805538070639E-02,
++    0.74468208324075910174E-02,
++    0.76079896657190565832E-02,
++    0.77683877779219912200E-02,
++    0.79279493342948491103E-02,
++    0.80866093647888599710E-02,
++    0.82443037630328680306E-02,
++    0.84009692870519326354E-02,
++    0.85565435613076896192E-02,
++    0.87109650797320868736E-02,
++    0.88641732094824942641E-02,
++    0.90161081951956431600E-02,
++    0.91667111635607884067E-02,
++    0.93159241280693950932E-02,
++    0.94636899938300652943E-02,
++    0.96099525623638830097E-02,
++    0.97546565363174114611E-02,
++    0.98977475240487497440E-02,
++    0.10039172044056840798E-01,
++    0.10178877529236079733E-01,
++    0.10316812330947621682E-01,
++    0.10452925722906011926E-01,
++    0.10587167904885197931E-01,
++    0.10719490006251933623E-01,
++    0.10849844089337314099E-01,
++    0.10978183152658912470E-01,
++    0.11104461134006926537E-01,
++    0.11228632913408049354E-01,
++    0.11350654315980596602E-01,
++    0.11470482114693874380E-01,
++    0.11588074033043952568E-01,
++    0.11703388747657003101E-01,
++    0.11816385890830235763E-01,
++    0.11927026053019270040E-01,
++    0.12035270785279562630E-01,
++    0.12141082601668299679E-01,
++    0.12244424981611985899E-01,
++    0.12345262372243838455E-01,
++    0.12443560190714035263E-01,
++    0.12539284826474884353E-01,
++    0.12632403643542078765E-01,
++    0.12722884982732382906E-01,
++    0.12810698163877361967E-01,
++    0.12895813488012114694E-01,
++    0.12978202239537399286E-01,
++    0.13057836688353048840E-01,
++    0.13134690091960152836E-01,
++    0.13208736697529129966E-01,
++    0.13279951743930530650E-01,
++    0.13348311463725179953E-01,
++    0.13413793085110098513E-01,
++    0.13476374833816515982E-01,
++    0.13536035934956213614E-01,
++    0.13592756614812395910E-01,
++    0.13646518102571291428E-01,
++    0.13697302631990716258E-01,
++    0.13745093443001896632E-01,
++    0.13789874783240936517E-01,
++    0.13831631909506428676E-01,
++    0.13870351089139840997E-01,
++    0.13906019601325461264E-01,
++    0.13938625738306850804E-01,
++    0.13968158806516938516E-01,
++    0.13994609127619079852E-01,
++    0.14017968039456608810E-01,
++    0.14038227896908623303E-01,
++    0.14055382072649964277E-01,
++    0.14069424957813575318E-01,
++    0.14080351962553661325E-01,
++    0.14088159516508301065E-01,
++    0.14092845069160408355E-01,
++    0.14094407090096179347E-01,
++    0.14092845069160408355E-01,
++    0.14088159516508301065E-01,
++    0.14080351962553661325E-01,
++    0.14069424957813575318E-01,
++    0.14055382072649964277E-01,
++    0.14038227896908623303E-01,
++    0.14017968039456608810E-01,
++    0.13994609127619079852E-01,
++    0.13968158806516938516E-01,
++    0.13938625738306850804E-01,
++    0.13906019601325461264E-01,
++    0.13870351089139840997E-01,
++    0.13831631909506428676E-01,
++    0.13789874783240936517E-01,
++    0.13745093443001896632E-01,
++    0.13697302631990716258E-01,
++    0.13646518102571291428E-01,
++    0.13592756614812395910E-01,
++    0.13536035934956213614E-01,
++    0.13476374833816515982E-01,
++    0.13413793085110098513E-01,
++    0.13348311463725179953E-01,
++    0.13279951743930530650E-01,
++    0.13208736697529129966E-01,
++    0.13134690091960152836E-01,
++    0.13057836688353048840E-01,
++    0.12978202239537399286E-01,
++    0.12895813488012114694E-01,
++    0.12810698163877361967E-01,
++    0.12722884982732382906E-01,
++    0.12632403643542078765E-01,
++    0.12539284826474884353E-01,
++    0.12443560190714035263E-01,
++    0.12345262372243838455E-01,
++    0.12244424981611985899E-01,
++    0.12141082601668299679E-01,
++    0.12035270785279562630E-01,
++    0.11927026053019270040E-01,
++    0.11816385890830235763E-01,
++    0.11703388747657003101E-01,
++    0.11588074033043952568E-01,
++    0.11470482114693874380E-01,
++    0.11350654315980596602E-01,
++    0.11228632913408049354E-01,
++    0.11104461134006926537E-01,
++    0.10978183152658912470E-01,
++    0.10849844089337314099E-01,
++    0.10719490006251933623E-01,
++    0.10587167904885197931E-01,
++    0.10452925722906011926E-01,
++    0.10316812330947621682E-01,
++    0.10178877529236079733E-01,
++    0.10039172044056840798E-01,
++    0.98977475240487497440E-02,
++    0.97546565363174114611E-02,
++    0.96099525623638830097E-02,
++    0.94636899938300652943E-02,
++    0.93159241280693950932E-02,
++    0.91667111635607884067E-02,
++    0.90161081951956431600E-02,
++    0.88641732094824942641E-02,
++    0.87109650797320868736E-02,
++    0.85565435613076896192E-02,
++    0.84009692870519326354E-02,
++    0.82443037630328680306E-02,
++    0.80866093647888599710E-02,
++    0.79279493342948491103E-02,
++    0.77683877779219912200E-02,
++    0.76079896657190565832E-02,
++    0.74468208324075910174E-02,
++    0.72849479805538070639E-02,
++    0.71224386864583871532E-02,
++    0.69593614093904229394E-02,
++    0.67957855048827733948E-02,
++    0.66317812429018878941E-02,
++    0.64674198318036867274E-02,
++    0.63027734490857587172E-02,
++    0.61379152800413850435E-02,
++    0.59729195655081658049E-02,
++    0.58078616599775673635E-02,
++    0.56428181013844441585E-02,
++    0.54778666939189508240E-02,
++    0.53130866051870565663E-02,
++    0.51485584789781777618E-02,
++    0.49843645647655386012E-02,
++    0.48205888648512683476E-02,
++    0.46573172997568547773E-02,
++    0.44946378920320678616E-02,
++    0.43326409680929828545E-02,
++    0.41714193769840788528E-02,
++    0.40110687240750233989E-02,
++    0.38516876166398709241E-02,
++    0.36933779170256508183E-02,
++    0.35362449977167777340E-02,
++    0.33803979910869203823E-02,
++    0.32259500250878684614E-02,
++    0.30730184347025783234E-02,
++    0.29217249379178197538E-02,
++    0.27721957645934509940E-02,
++    0.26245617274044295626E-02,
++    0.24789582266575679307E-02,
++    0.23355251860571608737E-02,
++    0.21944069253638388388E-02,
++    0.20557519893273465236E-02,
++    0.19197129710138724125E-02,
++    0.17864463917586498247E-02,
++    0.16561127281544526052E-02,
++    0.15288767050877655684E-02,
++    0.14049079956551446427E-02,
++    0.12843824718970101768E-02,
++    0.11674841174299594077E-02,
++    0.10544076228633167722E-02,
++    0.94536151685852538246E-03,
++    0.84057143271072246365E-03,
++    0.74028280424450333046E-03,
++    0.64476204130572477933E-03,
++    0.55429531493037471492E-03,
++    0.46918492424785040975E-03,
++    0.38974528447328229322E-03,
++    0.31630366082226447689E-03,
++    0.24921240048299729402E-03,
++    0.18887326450650491366E-03,
++    0.13575491094922871973E-03,
++    0.90372734658751149261E-04,
++    0.53275293669780613125E-04,
++    0.25157870384280661489E-04,
++    0.69379364324108267170E-05
++  };
++  static double w_511[511] =
++  {
++    0.945715933950007048827E-06,
++    0.345456507169149134898E-05,
++    0.736624069102321668857E-05,
++    0.125792781889592743525E-04,
++    0.190213681905875816679E-04,
++    0.266376412339000901358E-04,
++    0.353751372055189588628E-04,
++    0.451863674126296143105E-04,
++    0.560319507856164252140E-04,
++    0.678774554733972416227E-04,
++    0.806899228014035293851E-04,
++    0.944366322532705527066E-04,
++    0.109085545645741522051E-03,
++    0.124606200241498368482E-03,
++    0.140970302204104791413E-03,
++    0.158151830411132242924E-03,
++    0.176126765545083195474E-03,
++    0.194872642236641146532E-03,
++    0.214368090034216937149E-03,
++    0.234592462123925204879E-03,
++    0.255525589595236862014E-03,
++    0.277147657465187357459E-03,
++    0.299439176850911730874E-03,
++    0.322381020652862389664E-03,
++    0.345954492129903871350E-03,
++    0.370141402122251665232E-03,
++    0.394924138246873704434E-03,
++    0.420285716355361231823E-03,
++    0.446209810101403247488E-03,
++    0.472680758429262691232E-03,
++    0.499683553312800484519E-03,
++    0.527203811431658386125E-03,
++    0.555227733977307579715E-03,
++    0.583742058714979703847E-03,
++    0.612734008012225209294E-03,
++    0.642191235948505088403E-03,
++    0.672101776960108194646E-03,
++    0.702453997827572321358E-03,
++    0.733236554224767912055E-03,
++    0.764438352543882784191E-03,
++    0.796048517297550871506E-03,
++    0.828056364077226302608E-03,
++    0.860451377808527848128E-03,
++    0.893223195879324912340E-03,
++    0.926361595613111283368E-03,
++    0.959856485506936206261E-03,
++    0.993697899638760857945E-03,
++    0.102787599466367326179E-02,
++    0.106238104885340071375E-02,
++    0.109720346268191941940E-02,
++    0.113233376051597664917E-02,
++    0.116776259302858043685E-02,
++    0.120348074001265964881E-02,
++    0.123947911332878396534E-02,
++    0.127574875977346947345E-02,
++    0.131228086370221478128E-02,
++    0.134906674928353113127E-02,
++    0.138609788229672549700E-02,
++    0.142336587141720519900E-02,
++    0.146086246895890987689E-02,
++    0.149857957106456636214E-02,
++    0.153650921735128916170E-02,
++    0.157464359003212166189E-02,
++    0.161297501254393423070E-02,
++    0.165149594771914570655E-02,
++    0.169019899554346019117E-02,
++    0.172907689054461607168E-02,
++    0.176812249885838886701E-02,
++    0.180732881501808930079E-02,
++    0.184668895851282540913E-02,
++    0.188619617015808475394E-02,
++    0.192584380831993546204E-02,
++    0.196562534503150547732E-02,
++    0.200553436203751169944E-02,
++    0.204556454679958293446E-02,
++    0.208570968849203942640E-02,
++    0.212596367401472533045E-02,
++    0.216632048404649142727E-02,
++    0.220677418916003329194E-02,
++    0.224731894601603393082E-02,
++    0.228794899365195972378E-02,
++    0.232865864987842738864E-02,
++    0.236944230779380495146E-02,
++    0.241029443242563417382E-02,
++    0.245120955750556483923E-02,
++    0.249218228238276930060E-02,
++    0.253320726907925325750E-02,
++    0.257427923948908888092E-02,
++    0.261539297272236109225E-02,
++    0.265654330259352828314E-02,
++    0.269772511525294586667E-02,
++    0.273893334695947541201E-02,
++    0.278016298199139435045E-02,
++    0.282140905069222207923E-02,
++    0.286266662764757868253E-02,
++    0.290393082998878368175E-02,
++    0.294519681581857582284E-02,
++    0.298645978275408290247E-02,
++    0.302771496658198544480E-02,
++    0.306895764002069252174E-02,
++    0.311018311158427546158E-02,
++    0.315138672454287935858E-02,
++    0.319256385597434736790E-02,
++    0.323370991590184336368E-02,
++    0.327482034651233969564E-02,
++    0.331589062145094394706E-02,
++    0.335691624518616761342E-02,
++    0.339789275244138669739E-02,
++    0.343881570768790591876E-02,
++    0.347968070469521146972E-02,
++    0.352048336613417922682E-02,
++    0.356121934322919357659E-02,
++    0.360188431545532431869E-02,
++    0.364247399027690353194E-02,
++    0.368298410292403911967E-02,
++    0.372341041620379550870E-02,
++    0.376374872034296338241E-02,
++    0.380399483285952829161E-02,
++    0.384414459846013158917E-02,
++    0.388419388896099560998E-02,
++    0.392413860322995774660E-02,
++    0.396397466714742455513E-02,
++    0.400369803358421688562E-02,
++    0.404330468239442998549E-02,
++    0.408279062042157838350E-02,
++    0.412215188151643401528E-02,
++    0.416138452656509745764E-02,
++    0.420048464352596631772E-02,
++    0.423944834747438184434E-02,
++    0.427827178065384480959E-02,
++    0.431695111253279479928E-02,
++    0.435548253986604343679E-02,
++    0.439386228676004195260E-02,
++    0.443208660474124713206E-02,
++    0.447015177282692726900E-02,
++    0.450805409759782158001E-02,
++    0.454578991327213285488E-02,
++    0.458335558178039420335E-02,
++    0.462074749284080687482E-02,
++    0.465796206403469754658E-02,
++    0.469499574088179046532E-02,
++    0.473184499691503264714E-02,
++    0.476850633375474925263E-02,
++    0.480497628118194150483E-02,
++    0.484125139721057135214E-02,
++    0.487732826815870573054E-02,
++    0.491320350871841897367E-02,
++    0.494887376202437487201E-02,
++    0.498433569972103029914E-02,
++    0.501958602202842039909E-02,
++    0.505462145780650125058E-02,
++    0.508943876461803986674E-02,
++    0.512403472879005351831E-02,
++    0.515840616547381084096E-02,
++    0.519254991870341614863E-02,
++    0.522646286145300596306E-02,
++    0.526014189569259311205E-02,
++    0.529358395244259896547E-02,
++    0.532678599182711857974E-02,
++    0.535974500312596681161E-02,
++    0.539245800482555593606E-02,
++    0.542492204466865704951E-02,
++    0.545713419970309863995E-02,
++    0.548909157632945623482E-02,
++    0.552079131034778706457E-02,
++    0.555223056700346326850E-02,
++    0.558340654103215637610E-02,
++    0.561431645670402467678E-02,
++    0.564495756786715368885E-02,
++    0.567532715799029830087E-02,
++    0.570542254020497332312E-02,
++    0.573524105734693719020E-02,
++    0.576478008199711142954E-02,
++    0.579403701652197628421E-02,
++    0.582300929311348057702E-02,
++    0.585169437382850155033E-02,
++    0.588008975062788803205E-02,
++    0.590819294541511788161E-02,
++    0.593600151007459827614E-02,
++    0.596351302650963502011E-02,
++    0.599072510668009471472E-02,
++    0.601763539263978131522E-02,
++    0.604424155657354634589E-02,
++    0.607054130083414983949E-02,
++    0.609653235797888692923E-02,
++    0.612221249080599294931E-02,
++    0.614757949239083790214E-02,
++    0.617263118612191922727E-02,
++    0.619736542573665996342E-02,
++    0.622178009535701763157E-02,
++    0.624587310952490748541E-02,
++    0.626964241323744217671E-02,
++    0.629308598198198836688E-02,
++    0.631620182177103938227E-02,
++    0.633898796917690165912E-02,
++    0.636144249136619145314E-02,
++    0.638356348613413709795E-02,
++    0.640534908193868098342E-02,
++    0.642679743793437438922E-02,
++    0.644790674400605734710E-02,
++    0.646867522080231481688E-02,
++    0.648910111976869964292E-02,
++    0.650918272318071200827E-02,
++    0.652891834417652442012E-02,
++    0.654830632678944064054E-02,
++    0.656734504598007641819E-02,
++    0.658603290766824937794E-02,
++    0.660436834876456498276E-02,
++    0.662234983720168509457E-02,
++    0.663997587196526532519E-02,
++    0.665724498312454708217E-02,
++    0.667415573186258997654E-02,
++    0.669070671050613006584E-02,
++    0.670689654255504925648E-02,
++    0.672272388271144108036E-02,
++    0.673818741690825799086E-02,
++    0.675328586233752529078E-02,
++    0.676801796747810680683E-02,
++    0.678238251212300746082E-02,
++    0.679637830740619795480E-02,
++    0.681000419582894688374E-02,
++    0.682325905128564571420E-02,
++    0.683614177908911221841E-02,
++    0.684865131599535812903E-02,
++    0.686078663022780697951E-02,
++    0.687254672150094831613E-02,
++    0.688393062104341470995E-02,
++    0.689493739162046825872E-02,
++    0.690556612755588354803E-02,
++    0.691581595475321433825E-02,
++    0.692568603071643155621E-02,
++    0.693517554456992049848E-02,
++    0.694428371707782549438E-02,
++    0.695300980066273063177E-02,
++    0.696135307942366551493E-02,
++    0.696931286915342540213E-02,
++    0.697688851735519545845E-02,
++    0.698407940325846925786E-02,
++    0.699088493783425207545E-02,
++    0.699730456380953992594E-02,
++    0.700333775568106572820E-02,
++    0.700898401972830440494E-02,
++    0.701424289402572916425E-02,
++    0.701911394845431165171E-02,
++    0.702359678471225911031E-02,
++    0.702769103632498213858E-02,
++    0.703139636865428709508E-02,
++    0.703471247890678765907E-02,
++    0.703763909614153052319E-02,
++    0.704017598127683066242E-02,
++    0.704232292709631209597E-02,
++    0.704407975825415053266E-02,
++    0.704544633127951476780E-02,
++    0.704642253458020417748E-02,
++    0.704700828844548013730E-02,
++    0.704720354504808967346E-02,
++    0.704700828844548013730E-02,
++    0.704642253458020417748E-02,
++    0.704544633127951476780E-02,
++    0.704407975825415053266E-02,
++    0.704232292709631209597E-02,
++    0.704017598127683066242E-02,
++    0.703763909614153052319E-02,
++    0.703471247890678765907E-02,
++    0.703139636865428709508E-02,
++    0.702769103632498213858E-02,
++    0.702359678471225911031E-02,
++    0.701911394845431165171E-02,
++    0.701424289402572916425E-02,
++    0.700898401972830440494E-02,
++    0.700333775568106572820E-02,
++    0.699730456380953992594E-02,
++    0.699088493783425207545E-02,
++    0.698407940325846925786E-02,
++    0.697688851735519545845E-02,
++    0.696931286915342540213E-02,
++    0.696135307942366551493E-02,
++    0.695300980066273063177E-02,
++    0.694428371707782549438E-02,
++    0.693517554456992049848E-02,
++    0.692568603071643155621E-02,
++    0.691581595475321433825E-02,
++    0.690556612755588354803E-02,
++    0.689493739162046825872E-02,
++    0.688393062104341470995E-02,
++    0.687254672150094831613E-02,
++    0.686078663022780697951E-02,
++    0.684865131599535812903E-02,
++    0.683614177908911221841E-02,
++    0.682325905128564571420E-02,
++    0.681000419582894688374E-02,
++    0.679637830740619795480E-02,
++    0.678238251212300746082E-02,
++    0.676801796747810680683E-02,
++    0.675328586233752529078E-02,
++    0.673818741690825799086E-02,
++    0.672272388271144108036E-02,
++    0.670689654255504925648E-02,
++    0.669070671050613006584E-02,
++    0.667415573186258997654E-02,
++    0.665724498312454708217E-02,
++    0.663997587196526532519E-02,
++    0.662234983720168509457E-02,
++    0.660436834876456498276E-02,
++    0.658603290766824937794E-02,
++    0.656734504598007641819E-02,
++    0.654830632678944064054E-02,
++    0.652891834417652442012E-02,
++    0.650918272318071200827E-02,
++    0.648910111976869964292E-02,
++    0.646867522080231481688E-02,
++    0.644790674400605734710E-02,
++    0.642679743793437438922E-02,
++    0.640534908193868098342E-02,
++    0.638356348613413709795E-02,
++    0.636144249136619145314E-02,
++    0.633898796917690165912E-02,
++    0.631620182177103938227E-02,
++    0.629308598198198836688E-02,
++    0.626964241323744217671E-02,
++    0.624587310952490748541E-02,
++    0.622178009535701763157E-02,
++    0.619736542573665996342E-02,
++    0.617263118612191922727E-02,
++    0.614757949239083790214E-02,
++    0.612221249080599294931E-02,
++    0.609653235797888692923E-02,
++    0.607054130083414983949E-02,
++    0.604424155657354634589E-02,
++    0.601763539263978131522E-02,
++    0.599072510668009471472E-02,
++    0.596351302650963502011E-02,
++    0.593600151007459827614E-02,
++    0.590819294541511788161E-02,
++    0.588008975062788803205E-02,
++    0.585169437382850155033E-02,
++    0.582300929311348057702E-02,
++    0.579403701652197628421E-02,
++    0.576478008199711142954E-02,
++    0.573524105734693719020E-02,
++    0.570542254020497332312E-02,
++    0.567532715799029830087E-02,
++    0.564495756786715368885E-02,
++    0.561431645670402467678E-02,
++    0.558340654103215637610E-02,
++    0.555223056700346326850E-02,
++    0.552079131034778706457E-02,
++    0.548909157632945623482E-02,
++    0.545713419970309863995E-02,
++    0.542492204466865704951E-02,
++    0.539245800482555593606E-02,
++    0.535974500312596681161E-02,
++    0.532678599182711857974E-02,
++    0.529358395244259896547E-02,
++    0.526014189569259311205E-02,
++    0.522646286145300596306E-02,
++    0.519254991870341614863E-02,
++    0.515840616547381084096E-02,
++    0.512403472879005351831E-02,
++    0.508943876461803986674E-02,
++    0.505462145780650125058E-02,
++    0.501958602202842039909E-02,
++    0.498433569972103029914E-02,
++    0.494887376202437487201E-02,
++    0.491320350871841897367E-02,
++    0.487732826815870573054E-02,
++    0.484125139721057135214E-02,
++    0.480497628118194150483E-02,
++    0.476850633375474925263E-02,
++    0.473184499691503264714E-02,
++    0.469499574088179046532E-02,
++    0.465796206403469754658E-02,
++    0.462074749284080687482E-02,
++    0.458335558178039420335E-02,
++    0.454578991327213285488E-02,
++    0.450805409759782158001E-02,
++    0.447015177282692726900E-02,
++    0.443208660474124713206E-02,
++    0.439386228676004195260E-02,
++    0.435548253986604343679E-02,
++    0.431695111253279479928E-02,
++    0.427827178065384480959E-02,
++    0.423944834747438184434E-02,
++    0.420048464352596631772E-02,
++    0.416138452656509745764E-02,
++    0.412215188151643401528E-02,
++    0.408279062042157838350E-02,
++    0.404330468239442998549E-02,
++    0.400369803358421688562E-02,
++    0.396397466714742455513E-02,
++    0.392413860322995774660E-02,
++    0.388419388896099560998E-02,
++    0.384414459846013158917E-02,
++    0.380399483285952829161E-02,
++    0.376374872034296338241E-02,
++    0.372341041620379550870E-02,
++    0.368298410292403911967E-02,
++    0.364247399027690353194E-02,
++    0.360188431545532431869E-02,
++    0.356121934322919357659E-02,
++    0.352048336613417922682E-02,
++    0.347968070469521146972E-02,
++    0.343881570768790591876E-02,
++    0.339789275244138669739E-02,
++    0.335691624518616761342E-02,
++    0.331589062145094394706E-02,
++    0.327482034651233969564E-02,
++    0.323370991590184336368E-02,
++    0.319256385597434736790E-02,
++    0.315138672454287935858E-02,
++    0.311018311158427546158E-02,
++    0.306895764002069252174E-02,
++    0.302771496658198544480E-02,
++    0.298645978275408290247E-02,
++    0.294519681581857582284E-02,
++    0.290393082998878368175E-02,
++    0.286266662764757868253E-02,
++    0.282140905069222207923E-02,
++    0.278016298199139435045E-02,
++    0.273893334695947541201E-02,
++    0.269772511525294586667E-02,
++    0.265654330259352828314E-02,
++    0.261539297272236109225E-02,
++    0.257427923948908888092E-02,
++    0.253320726907925325750E-02,
++    0.249218228238276930060E-02,
++    0.245120955750556483923E-02,
++    0.241029443242563417382E-02,
++    0.236944230779380495146E-02,
++    0.232865864987842738864E-02,
++    0.228794899365195972378E-02,
++    0.224731894601603393082E-02,
++    0.220677418916003329194E-02,
++    0.216632048404649142727E-02,
++    0.212596367401472533045E-02,
++    0.208570968849203942640E-02,
++    0.204556454679958293446E-02,
++    0.200553436203751169944E-02,
++    0.196562534503150547732E-02,
++    0.192584380831993546204E-02,
++    0.188619617015808475394E-02,
++    0.184668895851282540913E-02,
++    0.180732881501808930079E-02,
++    0.176812249885838886701E-02,
++    0.172907689054461607168E-02,
++    0.169019899554346019117E-02,
++    0.165149594771914570655E-02,
++    0.161297501254393423070E-02,
++    0.157464359003212166189E-02,
++    0.153650921735128916170E-02,
++    0.149857957106456636214E-02,
++    0.146086246895890987689E-02,
++    0.142336587141720519900E-02,
++    0.138609788229672549700E-02,
++    0.134906674928353113127E-02,
++    0.131228086370221478128E-02,
++    0.127574875977346947345E-02,
++    0.123947911332878396534E-02,
++    0.120348074001265964881E-02,
++    0.116776259302858043685E-02,
++    0.113233376051597664917E-02,
++    0.109720346268191941940E-02,
++    0.106238104885340071375E-02,
++    0.102787599466367326179E-02,
++    0.993697899638760857945E-03,
++    0.959856485506936206261E-03,
++    0.926361595613111283368E-03,
++    0.893223195879324912340E-03,
++    0.860451377808527848128E-03,
++    0.828056364077226302608E-03,
++    0.796048517297550871506E-03,
++    0.764438352543882784191E-03,
++    0.733236554224767912055E-03,
++    0.702453997827572321358E-03,
++    0.672101776960108194646E-03,
++    0.642191235948505088403E-03,
++    0.612734008012225209294E-03,
++    0.583742058714979703847E-03,
++    0.555227733977307579715E-03,
++    0.527203811431658386125E-03,
++    0.499683553312800484519E-03,
++    0.472680758429262691232E-03,
++    0.446209810101403247488E-03,
++    0.420285716355361231823E-03,
++    0.394924138246873704434E-03,
++    0.370141402122251665232E-03,
++    0.345954492129903871350E-03,
++    0.322381020652862389664E-03,
++    0.299439176850911730874E-03,
++    0.277147657465187357459E-03,
++    0.255525589595236862014E-03,
++    0.234592462123925204879E-03,
++    0.214368090034216937149E-03,
++    0.194872642236641146532E-03,
++    0.176126765545083195474E-03,
++    0.158151830411132242924E-03,
++    0.140970302204104791413E-03,
++    0.124606200241498368482E-03,
++    0.109085545645741522051E-03,
++    0.944366322532705527066E-04,
++    0.806899228014035293851E-04,
++    0.678774554733972416227E-04,
++    0.560319507856164252140E-04,
++    0.451863674126296143105E-04,
++    0.353751372055189588628E-04,
++    0.266376412339000901358E-04,
++    0.190213681905875816679E-04,
++    0.125792781889592743525E-04,
++    0.736624069102321668857E-05,
++    0.345456507169149134898E-05,
++    0.945715933950007048827E-06,
++  };
++
++  if ( n == 1 )
++  {
++    webbur::r8vec_copy ( n, w_001, w );
++  }
++  else if ( n == 3 )
++  {
++    webbur::r8vec_copy ( n, w_003, w );
++  }
++  else if ( n == 7 )
++  {
++    webbur::r8vec_copy ( n, w_007, w );
++  }
++  else if ( n == 15 )
++  {
++    webbur::r8vec_copy ( n, w_015, w );
++  }
++  else if ( n == 31 )
++  {
++    webbur::r8vec_copy ( n, w_031, w );
++  }
++  else if ( n == 63 )
++  {
++    webbur::r8vec_copy ( n, w_063, w );
++  }
++  else if ( n == 127 )
++  {
++    webbur::r8vec_copy ( n, w_127, w );
++  }
++  else if ( n == 255 )
++  {
++    webbur::r8vec_copy ( n, w_255, w );
++  }
++  else if ( n == 511 )
++  {
++    webbur::r8vec_copy ( n, w_511, w );
++  }
++  else
++  {
++    std::cerr << "\n";
++    std::cerr << "PATTERSON_LOOKUP_WEIGHTS - Fatal error!\n";
++    std::cerr << "  Unexpected value of N = " << n << ".\n";
++    std::exit ( 1 );
++  }
++  return;
++}
++//****************************************************************************80
++
++void patterson_lookup_weights_np ( int n, int np, double p[], double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    PATTERSON_LOOKUP_WEIGHTS_NP looks up Patterson quadrature weights.
++//
++//  Discussion:
++//
++//    The allowed orders are 1, 3, 7, 15, 31, 63, 127, 255 and 511.
++//
++//    The weights are positive, symmetric and should sum to 2.
++//
++//    The user must preallocate space for the output array W.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    25 April 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Milton Abramowitz, Irene Stegun,
++//    Handbook of Mathematical Functions,
++//    National Bureau of Standards, 1964,
++//    ISBN: 0-486-61272-4,
++//    LC: QA47.A34.
++//
++//    Arthur Stroud, Don Secrest,
++//    Gaussian Quadrature Formulas,
++//    Prentice Hall, 1966,
++//    LC: QA299.4G3S7.
++//
++//  Parameters:
++//
++//    Input, int N, the order.
++//    Legal values are 1, 3, 7, 15, 31, 63, 127, 255 or 511.
++//
++//    Input, int NP, the number of parameters.
++//
++//    Input, double P[NP], parameters which are not needed by this function.
++//
++//    Output, double W[N], the weights.
++//
++{
++  patterson_lookup_weights ( n, w );
++
++  return;
++}
++//****************************************************************************80
++
++int point_radial_tol_unique_count ( int m, int n, double a[], double tol,
++  int *seed )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_RADIAL_TOL_UNIQUE_COUNT counts the tolerably unique points.
++//
++//  Discussion:
++//
++//    The input data is an M x N array A, representing the M-dimensional
++//    coordinates of N points.
++//
++//    The output is the number of tolerably unique points in the list.
++//
++//    This program performs the same task as POINT_TOL_UNIQUE_COUNT.
++//    But that program is guaranteed to use N^2 comparisons.
++//
++//    It is hoped that this function, on the other hand, will tend
++//    to use O(N) comparisons after an O(NLog(N)) sort.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    24 July 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows.
++//
++//    Input, int N, the number of columns.
++//
++//    Input, double A[M*N], the array of N columns of data.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Input/output, int *SEED, a seed for the random
++//    number generator.
++//
++//    Output, int POINT_RADIAL_TOL_UNIQUE_COUNT, the number of tolerably
++//    unique points.
++//
++{
++  double dist;
++  int hi;
++  int i;
++  int *indx;
++  int j;
++  int k;
++  double *r;
++  bool *unique;
++  int unique_num;
++  double *w;
++  double w_sum;
++  double *z;
++
++  if ( n <= 0 )
++  {
++    unique_num = 0;
++    return unique_num;
++  }
++//
++//  Assign a base point Z randomly in the convex hull.
++//
++  w = webbur::r8vec_uniform_01_new ( n, seed );
++  w_sum = webbur::r8vec_sum ( n, w );
++  for ( j = 0; j < n; j++ )
++  {
++    w[j] = w[j] / w_sum;
++  }
++
++  z = new double[m];
++  for ( i = 0; i < m; i++ )
++  {
++    z[i] = 0.0;
++    for ( j = 0; j < n; j++ )
++    {
++      z[i] = z[i] + a[i+j*m] * w[j];
++    }
++  }
++//
++//  Compute the radial distance R of each point to Z.
++//
++  r = new double[n];
++
++  for ( j = 0; j < n; j++ )
++  {
++    r[j] = 0.0;
++    for ( i = 0; i < m; i++ )
++    {
++      r[j] = r[j] + std::pow ( a[i+j*m] - z[i], 2 );
++    }
++    r[j] = std::sqrt ( r[j] );
++  }
++//
++//  Implicitly sort the R array.
++//
++  indx = webbur::r8vec_sort_heap_index_a_new ( n, r );
++//
++//  To determine if a point I is tolerably unique, we only have to check
++//  whether it is distinct from all points J such that R(I) <= R(J) <= R(J)+TOL.
++//
++  unique_num = 0;
++
++  unique = new bool[n];
++  for ( i = 0; i < n; i++ )
++  {
++    unique[i] = true;
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    if ( unique[indx[i]] )
++    {
++//
++//  Point INDX(I) is unique, in that no earlier point is near it.
++//
++      unique_num = unique_num + 1;
++//
++//  Look for later points which are close to point INDX(I)
++//  in terms of R.
++//
++      hi = i;
++
++      while ( hi < n - 1 )
++      {
++        if ( r[indx[i]] + tol < r[indx[hi+1]] )
++        {
++          break;
++        }
++        hi = hi + 1;
++      }
++//
++//  Points INDX(I+1) through INDX(HI) have an R value close to
++//  point INDX(I).  Are they truly close to point INDEX(I)?
++//
++      for ( j = i + 1; j <= hi; j++ )
++      {
++        if ( unique[indx[j]] )
++        {
++          dist = 0.0;
++          for ( k = 0; k < m; k++ )
++          {
++            dist = dist + std::pow ( a[k+indx[i]*m] - a[k+indx[j]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++
++          if ( dist <= tol )
++          {
++            unique[indx[j]] = false;
++          }
++        }
++      }
++    }
++  }
++
++  delete [] indx;
++  delete [] r;
++  delete [] unique;
++  delete [] w;
++  delete [] z;
++
++  return unique_num;
++}
++//****************************************************************************80
++
++void point_radial_tol_unique_count_inc1 ( int m, int n1, double a1[],
++  double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[],
++  int *unique_num1 )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_RADIAL_TOL_UNIQUE_COUNT_INC1 counts the tolerably unique points.
++//
++//  Discussion:
++//
++//    The input data includes an M x N1 array A1 of a set of N1
++//    "permanent" points and N2 "temporary" points.
++//
++//    This is a two step version of POINT_RADIAL_TOL_UNIQUE_COUNT_INC.
++//
++//    This means that we want to identify the tolerably unique points
++//    among the permanent points before processing the temporary points.
++//
++//    If many sets of temporary data are considered, this function will
++//    do a lot of unnecessary work resorting the permanent data; it would
++//    be possible to avoid repetitions of that work at the expense of saving
++//    various work vectors.  This function accepts the overhead of the
++//    repeated calculations for the benefit of only having to "remember"
++//    the number of unique points discovered.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 October 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows.
++//
++//    Input, int N1, the number of permanent points.
++//
++//    Input, double A1[M*N1], the permanent points.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Input/output, int *SEED, a seed for the random
++//    number generator.
++//
++//    Output, double Z[M], a random base vector used to
++//    linearly sort the data.
++//
++//    Output, double R1[N1], the scalar values assigned to
++//    the data for sorting.
++//
++//    Output, int INDX1[N1], the ascending sort index
++//    for A1.
++//
++//    Output, bool UNIQUE1[N1], is TRUE for each unique permanent point.
++//
++//    Output, int *UNIQUE_NUM1, the number of tolerably
++//    unique permanent points.
++//
++{
++  double dist;
++  int hi;
++  int i;
++  int j;
++  int j1;
++  int k1;
++  double *w;
++  double w_sum;
++//
++//  Assign a base point Z randomly in the convex hull of the permanent points.
++//
++  w = webbur::r8vec_uniform_01_new ( n1, seed );
++  w_sum = webbur::r8vec_sum ( n1, w );
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    w[j1] = w[j1] / w_sum;
++  }
++  for ( i = 0; i < m; i++ )
++  {
++    z[i] = 0.0;
++    for ( j1 = 0; j1 < n1; j1++ )
++    {
++      z[i] = z[i] + a1[i+j1*m] * w[j1];
++    }
++  }
++//
++//  Initialize the permanent point data.
++//
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    r1[j1] = 0.0;
++    for ( i = 0; i < m; i++ )
++    {
++      r1[j1] = r1[j1] + std::pow ( a1[i+j1*m] - z[i], 2 );
++    }
++    r1[j1] = std::sqrt ( r1[j1] );
++  }
++  webbur::r8vec_sort_heap_index_a ( n1, r1, indx1 );
++
++  *unique_num1 = 0;
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    unique1[j1] = true;
++  }
++//
++//  STEP 1:
++//  Compare PERMANENT POINTS to PERMANENT POINTS.
++//
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    if ( unique1[indx1[j1]] )
++    {
++      *unique_num1 = *unique_num1 + 1;
++
++      hi = j1;
++
++      while ( hi < n1 - 1 )
++      {
++        if ( r1[indx1[j1]] + tol < r1[indx1[hi+1]] )
++        {
++          break;
++        }
++        hi = hi + 1;
++      }
++
++      for ( k1 = j1 + 1; k1 <= hi; k1++ )
++      {
++        if ( unique1[indx1[k1]] )
++        {
++          dist = 0.0;
++          for ( i = 0; i < m; i++ )
++          {
++            dist = dist + std::pow ( a1[i+indx1[j1]*m] - a1[i+indx1[k1]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++
++          if ( dist <= tol )
++          {
++            unique1[indx1[k1]] = false;
++          }
++        }
++      }
++    }
++  }
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void point_radial_tol_unique_count_inc2 ( int m, int n1, double a1[], int n2,
++  double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[],
++  int *unique_num2 )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_RADIAL_TOL_UNIQUE_COUNT_INC2 counts the tolerably unique points.
++//
++//  Discussion:
++//
++//    The input data includes an M x N1 array A1 and an M x N2 array A2,
++//    representing the M-dimensional coordinates of a set of N1
++//    "permanent" points and N2 "temporary" points.
++//
++//    This is an "incremental" version of POINT_RADIAL_TOL_UNIQUE_COUNT.
++//
++//    This means that we want to identify the tolerably unique points
++//    among the permanent points before processing the temporary points.
++//
++//    If many sets of temporary data are considered, this function will
++//    do a lot of unnecessary work resorting the permanent data; it would
++//    be possible to avoid repetitions of that work at the expense of saving
++//    various work vectors.  This function accepts the overhead of the
++//    repeated calculations for the benefit of only having to "remember"
++//    the number of unique points discovered.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 October 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows.
++//
++//    Input, int N1, the number of permanent points.
++//
++//    Input, double A1[M*N1], the permanent points.
++//
++//    Input, int N2, the number of temporary points.
++//
++//    Input, double A2[M*N2], the temporary points.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Input, double Z[M], a random base vector used to
++//    linearly sort the data.
++//
++//    Input, double R1[N1], the scalar values assigned to
++//    the data for sorting.
++//
++//    Input, int INDX1[N1], the ascending sort index
++//    for A1.
++//
++//    Input, bool UNIQUE1[N1], is TRUE for each unique permanent point.
++//
++//    Output, int *UNIQUE_NUM2, the number of additional
++//    tolerably unique points if the temporary points are included.
++//
++{
++  double dist;
++  int hi;
++  int i;
++  int *indx2;
++  int j;
++  int j1;
++  int j2;
++  int j2_hi;
++  int j2_lo;
++  int k1;
++  int k2;
++  double r_hi;
++  double r_lo;
++  double *r2;
++  bool *unique2;
++//
++//  Initialize the temporary point data.
++//
++  r2 = new double[n2];
++  for ( j2 = 0; j2 < n2; j2++ )
++  {
++    r2[j2] = 0.0;
++    for ( i = 0; i < m; i++ )
++    {
++      r2[j2] = r2[j2] + std::pow ( a2[i+j2*m] - z[i], 2 );
++    }
++    r2[j2] = std::sqrt ( r2[j2] );
++  }
++
++  indx2 = new int[n2];
++  webbur::r8vec_sort_heap_index_a ( n2, r2, indx2 );
++
++  unique2 = new bool[n2];
++  for ( j2 = 0; j2 < n2; j2++ )
++  {
++    unique2[j2] = true;
++  }
++
++  *unique_num2 = 0;
++//
++//  STEP 2:
++//  Use PERMANENT points to eliminate TEMPORARY points.
++//
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    if ( unique1[indx1[j1]] )
++    {
++      r_lo = r1[indx1[j1]] - tol;
++      r_hi = r1[indx1[j1]] + tol;
++
++      webbur::r8vec_index_sorted_range ( n2, r2, indx2, r_lo, r_hi,
++        &j2_lo, &j2_hi );
++
++      for ( j2 = j2_lo; j2 <= j2_hi; j2++ )
++      {
++        if ( unique2[indx2[j2]] )
++        {
++          dist = 0.0;
++          for ( i = 0; i < m; i++ )
++          {
++            dist = dist + std::pow ( a1[i+indx1[j1]*m]
++                                   - a2[i+indx2[j2]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++          if ( dist <= tol )
++          {
++            unique2[indx2[j2]] = false;
++          }
++        }
++      }
++    }
++  }
++//
++//  STEP 3:
++//  Use TEMPORARY points to eliminate TEMPORARY points.
++//
++  for ( j2 = 0; j2 < n2; j2++ )
++  {
++    if ( unique2[indx2[j2]] )
++    {
++      *unique_num2 = *unique_num2 + 1;
++
++      hi = j2;
++
++      while ( hi < n2 - 1 )
++      {
++        if ( r2[indx2[j2]] + tol < r2[indx2[hi+1]] )
++        {
++          break;
++        }
++        hi = hi + 1;
++      }
++
++      for ( k2 = j2 + 1; k2 <= hi; k2++ )
++      {
++        if ( unique2[indx2[k2]] )
++        {
++          dist = 0.0;
++          for ( i = 0; i < m; i++ )
++          {
++            dist = dist + std::pow ( a2[i+indx2[j2]*m] - a2[i+indx2[k2]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++
++          if ( dist <= tol )
++          {
++            unique2[indx2[k2]] = false;
++          }
++        }
++      }
++    }
++  }
++  delete [] indx2;
++  delete [] r2;
++  delete [] unique2;
++
++  return;
++}
++//****************************************************************************80
++
++int point_radial_tol_unique_index ( int m, int n, double a[], double tol,
++  int *seed, int undx[], int xdnu[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_RADIAL_TOL_UNIQUE_INDEX indexes the tolerably unique points.
++//
++//  Discussion:
++//
++//    The input data is an M x N array A, representing the M-dimensional
++//    coordinates of N points.
++//
++//    The output is:
++//    * the number of tolerably unique points in the list;
++//    * the index, in the list of unique items, of the representatives
++//      of each point;
++//    * the index, in A, of the tolerably unique representatives.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    28 July 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows.
++//
++//    Input, int N, the number of columns.
++//
++//    Input, double A[M*N], the array of N columns of data.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Input/output, int SEED, a seed for the random
++//    number generator.
++//
++//    Output, int UNDX[UNIQUE_NUM], the index, in A, of the
++//    tolerably unique points.
++//
++//    Output, int XDNU[N], the index, in UNDX, of the
++//    tolerably unique point that "represents" this point.
++//
++//    Output, int POINT_RADIAL_TOL_UNIQUE_INDEX, the number of tolerably
++//    unique points.
++//
++{
++  double dist;
++  int hi;
++  int i;
++  int *indx;
++  int j;
++  int k;
++  double *r;
++  bool *unique;
++  int unique_num;
++  double *w;
++  double w_sum;
++  double *z;
++
++  if ( n <= 0 )
++  {
++    unique_num = 0;
++    return unique_num;
++  }
++//
++//  Assign a base point Z randomly in the convex hull.
++//
++  w = webbur::r8vec_uniform_01_new ( n, seed );
++  w_sum = webbur::r8vec_sum ( n, w );
++  for ( j = 0; j < n; j++ )
++  {
++    w[j] = w[j] / w_sum;
++  }
++
++  z = new double[m];
++  for ( i = 0; i < m; i++ )
++  {
++    z[i] = 0.0;
++    for ( j = 0; j < n; j++ )
++    {
++      z[i] = z[i] + a[i+j*m] * w[j];
++    }
++  }
++//
++//  Compute the radial distance R of each point to Z.
++//
++  r = new double[n];
++
++  for ( j = 0; j < n; j++ )
++  {
++    r[j] = 0.0;
++    for ( i = 0; i < m; i++ )
++    {
++      r[j] = r[j] + std::pow ( a[i+j*m] - z[i], 2 );
++    }
++    r[j] = std::sqrt ( r[j] );
++  }
++//
++//  Implicitly sort the R array.
++//
++  indx = webbur::r8vec_sort_heap_index_a_new ( n, r );
++//
++//  To determine if a point I is tolerably unique, we only have to check
++//  whether it is distinct from all points J such that R(I) <= R(J) <= R(J)+TOL.
++//
++  unique_num = 0;
++
++  unique = new bool[n];
++  for ( i = 0; i < n; i++ )
++  {
++    unique[i] = true;
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    if ( unique[indx[i]] )
++    {
++//
++//  Point INDX(I) is unique, in that no earlier point is near it.
++//
++      xdnu[indx[i]] = unique_num;
++      undx[unique_num] = indx[i];
++      unique_num = unique_num + 1;
++//
++//  Look for later points which are close to point INDX(I)
++//  in terms of R.
++//
++      hi = i;
++
++      while ( hi < n - 1 )
++      {
++        if ( r[indx[i]] + tol < r[indx[hi+1]] )
++        {
++          break;
++        }
++        hi = hi + 1;
++      }
++//
++//  Points INDX(I+1) through INDX(HI) have an R value close to
++//  point INDX(I).  Are they truly close to point INDEX(I)?
++//
++      for ( j = i + 1; j <= hi; j++ )
++      {
++        if ( unique[indx[j]] )
++        {
++          dist = 0.0;
++          for ( k = 0; k < m; k++ )
++          {
++            dist = dist + std::pow ( a[k+indx[i]*m] - a[k+indx[j]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++
++          if ( dist <= tol )
++          {
++            unique[indx[j]] = false;
++            xdnu[indx[j]] = xdnu[indx[i]];
++          }
++        }
++      }
++    }
++  }
++
++  delete [] indx;
++  delete [] r;
++  delete [] unique;
++  delete [] w;
++  delete [] z;
++
++  return unique_num;
++}
++//****************************************************************************80
++
++void point_radial_tol_unique_index_inc1 ( int m, int n1, double a1[],
++  double tol, int *seed, double z[], double r1[], int indx1[], bool unique1[],
++  int *unique_num1, int undx1[], int xdnu1[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC1 indexes the tolerably unique points.
++//
++//  Discussion:
++//
++//    The input data includes an M x N1 array A1 of
++//    "permanent" points.
++//
++//    This is a two step version of POINT_RADIAL_TOL_UNIQUE_INDEX_INC.
++//
++//    The output is:
++//    * the number of tolerably unique points in the list;
++//    * the index, in the list of unique items, of the representatives
++//      of each point;
++//    * the index, in A1, of the tolerably unique representatives.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    02 October 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows.
++//
++//    Input, int N1, the number of permanent points.
++//
++//    Input, double A1[M*N1], the permanent points.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Input/output, int *SEED, a seed for the random
++//    number generator.
++//
++//    Output, double Z[M], a random base vector used to
++//    linearly sort the data.
++//
++//    Output, double R1[N1], the scalar values assigned to
++//    the data for sorting.
++//
++//    Output, int INDX1[N1], the ascending sort index for A1.
++//
++//    Output, bool UNIQUE1[N1], is TRUE for unique permanent points.
++//
++//    Output, int *UNIQUE_NUM1, the number of tolerably unique points
++//    with just the permanent points.
++//
++//    Output, int UNDX1[UNIQUE_NUM1], the index, in A1, of the tolerably
++//    unique points.
++//
++//    Output, int XDNU1[N1], the index, in UNDX1, of the tolerably unique
++//    point that "represents" this point.
++//
++{
++  double dist;
++  int hi;
++  int i;
++  int j;
++  int j1;
++  int k1;
++  double *w;
++  double w_sum;
++//
++//  Assign a base point Z randomly in the convex hull of the permanent points.
++//
++  w = webbur::r8vec_uniform_01_new ( n1, seed );
++  w_sum = webbur::r8vec_sum ( n1, w );
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    w[j1] = w[j1] / w_sum;
++  }
++
++  for ( i = 0; i < m; i++ )
++  {
++    z[i] = 0.0;
++    for ( j1 = 0; j1 < n1; j1++ )
++    {
++      z[i] = z[i] + a1[i+j1*m] * w[j1];
++    }
++  }
++//
++//  Initialize the permanent point data.
++//
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    r1[j1] = 0.0;
++    for ( i = 0; i < m; i++ )
++    {
++      r1[j1] = r1[j1] + std::pow ( a1[i+j1*m] - z[i], 2 );
++    }
++    r1[j1] = std::sqrt ( r1[j1] );
++  }
++  webbur::r8vec_sort_heap_index_a ( n1, r1, indx1 );
++
++  *unique_num1 = 0;
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    unique1[j1] = true;
++  }
++//
++//  STEP 1:
++//  Compare PERMANENT POINTS to PERMANENT POINTS.
++//
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    if ( unique1[indx1[j1]] )
++    {
++      xdnu1[indx1[j1]] = *unique_num1;
++      undx1[*unique_num1] = indx1[j1];
++      *unique_num1 = *unique_num1 + 1;
++
++      hi = j1;
++
++      while ( hi < n1 - 1 )
++      {
++        if ( r1[indx1[j1]] + tol < r1[indx1[hi+1]] )
++        {
++          break;
++        }
++        hi = hi + 1;
++      }
++
++      for ( k1 = j1 + 1; k1 <= hi; k1++ )
++      {
++        if ( unique1[indx1[k1]] )
++        {
++          dist = 0.0;
++          for ( i = 0; i < m; i++ )
++          {
++            dist = dist + std::pow ( a1[i+indx1[j1]*m] - a1[i+indx1[k1]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++
++          if ( dist <= tol )
++          {
++            unique1[indx1[k1]] = false;
++            xdnu1[indx1[k1]] = xdnu1[indx1[j1]];
++          }
++        }
++      }
++    }
++  }
++
++  delete [] w;
++
++  return;
++}
++//****************************************************************************80
++
++void point_radial_tol_unique_index_inc2 ( int m, int n1, double a1[], int n2,
++  double a2[], double tol, double z[], double r1[], int indx1[], bool unique1[],
++  int unique_num1, int undx1[], int xdnu1[], double r2[],
++  int indx2[], bool unique2[], int *unique_num2, int undx2[], int xdnu2[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC2 indexes unique temporary points.
++//
++//  Discussion:
++//
++//    The input data includes an M x N1 array A1 and an M x N2 array A2,
++//    representing the M-dimensional coordinates of a set of N1
++//    "permanent" points and N2 "temporary" points.
++//
++//    For notation, we use "A" to describe the M x (N1+N2) array that would be
++//    formed by starting with A1 and appending A2.
++//
++//    The output is:
++//    * the number of tolerably unique points in the list;
++//    * the index, in the list of unique items, of the representatives
++//      of each point;
++//    * the index, in A, of the tolerably unique representatives.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    08 October 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows.
++//
++//    Input, int N1, the number of permanent points.
++//
++//    Input, double A1[M*N1], the permanent points.
++//
++//    Input, int N2, the number of temporary points.
++//
++//    Input, double A2[M*N2], the temporary points.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Input, double Z[M], a random base vector used to
++//    linearly sort the data.
++//
++//    Input, double R1[N1], the scalar values assigned to
++//    A1 for sorting.
++//
++//    Input, int INDX1[N1], the ascending sort index for A1.
++//
++//    Input, bool UNIQUE1[N1], is TRUE for unique permanent points.
++//
++//    Input, int UNIQUE_NUM1, the number of tolerably unique permanent points.
++//
++//    Input, int UNDX1[UNIQUE_NUM1],
++//    the index in A1 of the tolerably unique permanent points.
++//
++//    Input, int XDNU1[N1], the index in UNDX1
++//    of the tolerably unique permanent point that "represents" this point.
++//
++//    Output, double R2[N2], the scalar values assigned to
++//    A2 for sorting.
++//
++//    Output, int INDX2[N2], the ascending sort index for A2.
++//
++//    Output, bool UNIQUE2[N2], is TRUE for unique temporary points.
++//
++//    Output, int *UNIQUE_NUM2, the number
++//    of tolerably unique temporary points.
++//
++//    Output, int UNDX2[UNIQUE_NUM2],
++//    the index in A2 of the tolerably unique points, incremented by N1.
++//
++//    Output, int XDNU2[N2], the index, in UNDX1
++//    or UNDX2, of the tolerably unique point that "represents" this
++//    temporary point.  If the value represents an index in UNDX2, this
++//    can be inferred by the fact that its value is greater than or
++//    equal to UNIQUE_NUM1.  To reference UNDX2, the value should then be
++//    decremented by UNIQUE_NUM1.
++//
++{
++  double dist;
++  int hi;
++  int i;
++  int j;
++  int j1;
++  int j2;
++  int j2_hi;
++  int j2_lo;
++  int k1;
++  int k2;
++  double r_hi;
++  double r_lo;
++//
++//  Initialize the temporary point data.
++//
++  for ( j2 = 0; j2 < n2; j2++ )
++  {
++    r2[j2] = 0.0;
++    for ( i = 0; i < m; i++ )
++    {
++      r2[j2] = r2[j2] + std::pow ( a2[i+j2*m] - z[i], 2 );
++    }
++    r2[j2] = std::sqrt ( r2[j2] );
++  }
++
++  webbur::r8vec_sort_heap_index_a ( n2, r2, indx2 );
++
++  for ( j2 = 0; j2 < n2; j2++ )
++  {
++    unique2[j2] = true;
++  }
++
++  *unique_num2 = 0;
++//
++//  STEP 2:
++//  Use PERMANENT points to eliminate TEMPORARY points.
++//
++  for ( j1 = 0; j1 < n1; j1++ )
++  {
++    if ( unique1[indx1[j1]] )
++    {
++      r_lo = r1[indx1[j1]] - tol;
++      r_hi = r1[indx1[j1]] + tol;
++
++      webbur::r8vec_index_sorted_range ( n2, r2, indx2, r_lo, r_hi,
++        &j2_lo, &j2_hi );
++
++      for ( j2 = j2_lo; j2 <= j2_hi; j2++ )
++      {
++        if ( unique2[indx2[j2]] )
++        {
++          dist = 0.0;
++          for ( i = 0; i < m; i++ )
++          {
++            dist = dist + std::pow ( a1[i+indx1[j1]*m]
++                                   - a2[i+indx2[j2]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++          if ( dist <= tol )
++          {
++            unique2[indx2[j2]] = false;
++            xdnu2[indx2[j2]] = xdnu1[indx1[j1]];
++          }
++        }
++      }
++    }
++  }
++//
++//  STEP 3:
++//  Use TEMPORARY points to eliminate TEMPORARY points.
++//
++  for ( j2 = 0; j2 < n2; j2++ )
++  {
++    if ( unique2[indx2[j2]] )
++    {
++      xdnu2[indx2[j2]] = unique_num1 + *unique_num2;
++      undx2[*unique_num2] = indx2[j2] + n1;
++      *unique_num2 = *unique_num2 + 1;
++
++      hi = j2;
++
++      while ( hi < n2 - 1 )
++      {
++        if ( r2[indx2[j2]] + tol < r2[indx2[hi+1]] )
++        {
++          break;
++        }
++        hi = hi + 1;
++      }
++
++      for ( k2 = j2 + 1; k2 <= hi; k2++ )
++      {
++        if ( unique2[indx2[k2]] )
++        {
++          dist = 0.0;
++          for ( i = 0; i < m; i++ )
++          {
++            dist = dist + std::pow ( a2[i+indx2[j2]*m] - a2[i+indx2[k2]*m], 2 );
++          }
++          dist = std::sqrt ( dist );
++
++          if ( dist <= tol )
++          {
++            unique2[indx2[k2]] = false;
++            xdnu2[indx2[k2]] = xdnu2[indx2[j2]];
++          }
++        }
++      }
++    }
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void point_radial_tol_unique_index_inc3 ( int m, int n1, double a1[],
++  double r1[], int indx1[], bool unique1[], int unique_num1, int undx1[],
++  int xdnu1[], int n2, double a2[], double r2[], int indx2[], bool unique2[],
++  int unique_num2, int undx2[], int xdnu2[], int *n3, double a3[], double r3[],
++  int indx3[], bool unique3[], int *unique_num3, int undx3[], int xdnu3[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_RADIAL_TOL_UNIQUE_INDEX_INC3 merges index data.
++//
++//  Discussion:
++//
++//    This function may be called after *INDEX_INC1 has created index
++//    information for the permanent data, and *INDEX_INC2 has created
++//    augmenting information for a set of temporary data which now is
++//    to be merged with the permanent data.
++//
++//    The function merges the data and index information to create a
++//    new "permanent" data set.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    08 October 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows.
++//
++//    Input, int N1, the number of permanent points.
++//
++//    Input, double A1[M*N1], the permanent points.
++//
++//    Input, double R1[N1], the scalar values assigned to
++//    the data for sorting.
++//
++//    Input, int INDX1[N1], the ascending sort index
++//    for A1.
++//
++//    Input, bool UNIQUE1[N1], is TRUE for each unique permanent point.
++//
++//    Input, int UNIQUE_NUM1, the number
++//    of tolerably unique points with just the permanent points.
++//
++//    Input, int UNDX1[UNIQUE_NUM1],
++//    the index in A1 of the tolerably unique points.
++//
++//    Input, int XDNU1[N1], the index in UNDX1
++//    of the tolerably unique point that "represents" this point.
++//
++//    Input, int N2, the number of temporary points.
++//
++//    Input, double A2[M,N2], the temporary points.
++//
++//    Input, double R2[N2], the scalar values assigned to
++//    the data for sorting.
++//
++//    Input, int INDX2[N2], the ascending sort index
++//    for A2.
++//
++//    Input, bool UNIQUE2[N2], is TRUE for each unique temporary point.
++//
++//    Input, int UNIQUE_NUM2, the number
++//    of tolerably unique temporary points.
++//
++//    Input, int UNDX2[UNIQUE_NUM2],
++//    the index in A2 of the tolerably unique points, incremented by UNIQUE_NUM1.
++//
++//    Input, int XDNU2[N2], the index in UNDX1 or UNDX2
++//    of the tolerably unique point that "represents" this point.
++//
++//    Output, int *N3, the number of permanent points.
++//
++//    Output, double A3[M,N3], the permanent points.
++//
++//    Output, double R3[N3], the scalar values assigned to
++//    the data for sorting.
++//
++//    Output, int INDX3[N3], the ascending sort index
++//    for A3.
++//
++//    Output, bool UNIQUE3[N3], is TRUE for each unique permanent point.
++//
++//    Output, int *UNIQUE_NUM3, the number
++//    of tolerably unique points.
++//
++//    Output, int UNDX3[UNIQUE_NUM3],
++//    the index in A3 of the tolerably unique points.
++//
++//    Output, int XDNU3[N3], the index in UNDX3
++//    of the tolerably unique point that "represents" this point.
++//
++{
++  int i;
++  int i1;
++  int i2;
++  int i3;
++  double v1;
++  double v2;
++
++  *n3 = n1 + n2;
++
++  for ( i1 = 0; i1 < n1; i1++ )
++  {
++    for ( i = 0; i < m; i++ )
++    {
++      a3[i+i1*m] = a1[i+i1*m];
++    }
++  }
++  for ( i2 = 0; i2 < n2; i2++ )
++  {
++    i3 = n1 + i2;
++    for ( i = 0; i < m; i++ )
++    {
++      a3[i+i3*m] = a2[i+i2*m];
++    }
++  }
++  for ( i1 = 0; i1 < n1; i1++ )
++  {
++    r3[i1]= r1[i1];
++  }
++  for ( i2 = 0; i2 < n2; i2++ )
++  {
++    i3 = n1 + i2;
++    r3[i3] = r2[i2];
++  }
++//
++//  Interleave the two INDX arrays so that INDX3 presents the entries
++//  of A3 in ascending R3 order.
++//
++  i1 = 0;
++  i2 = 0;
++
++  for ( i3 = 0; i3 < *n3; i3++ )
++  {
++    if ( i1 < n1 )
++    {
++      v1 = r1[indx1[i1]];
++    }
++    else
++    {
++      v1 = r8_huge ( );
++    }
++
++    if ( i2 < n2 )
++    {
++      v2 = r2[indx2[i2]];
++    }
++    else
++    {
++      v2 = r8_huge ( );
++    }
++
++    if ( v1 <= v2 )
++    {
++      indx3[i3] = indx1[i1];
++      i1 = i1 + 1;
++    }
++    else
++    {
++      indx3[i3] = indx2[i2] + n1;
++      i2 = i2 + 1;
++    }
++  }
++
++  *unique_num3 = unique_num1 + unique_num2;
++
++  for ( i1 = 0; i1 < n1; i1++ )
++  {
++    unique3[i1] = unique1[i1];
++  }
++  for ( i2 = 0; i2 < n2; i2++ )
++  {
++    i3 = n1 + i2;
++    unique3[i3] = unique2[i2];
++  }
++//
++//  The entries in UNDX2 were already incremented by N2 if they pointed
++//  to an entry of A2, so all entries in UNDX2 correctly index A3.
++//
++  for ( i1 = 0; i1 < unique_num1; i1++ )
++  {
++    undx3[i1] = undx1[i1];
++  }
++  for ( i2 = 0; i2 < unique_num2; i2++ )
++  {
++    i3 = unique_num1 + i2;
++    undx3[i3] = undx2[i2];
++  }
++//
++//  Note that the entries of XDNU2 were already incremented by N2
++//  so that they correctly index A3, not A2.
++//
++  for ( i1 = 0; i1 < n1; i1++ )
++  {
++    xdnu3[i1] = xdnu1[i1];
++  }
++  for ( i2 = 0; i2 < n2; i2++ )
++  {
++    i3 = n1 + i2;
++    xdnu3[i3] = xdnu2[i2];
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void point_unique_index ( int m, int n, double a[], int unique_num, int undx[],
++  int xdnu[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    POINT_UNIQUE_INDEX indexes unique points.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//    The goal of this routine is to determine a vector UNDX,
++//    which points to the unique elements of A, in sorted order,
++//    and a vector XDNU, which identifies, for each entry of A, the index of
++//    the unique sorted element of A.
++//
++//    This is all done with index vectors, so that the elements of
++//    A are never moved.
++//
++//    The first step of the algorithm requires the indexed sorting
++//    of A, which creates arrays INDX and XDNI.  (If all the entries
++//    of A are unique, then these arrays are the same as UNDX and XDNU.)
++//
++//    We then use INDX to examine the entries of A in sorted order,
++//    noting the unique entries, creating the entries of XDNU and
++//    UNDX as we go.
++//
++//    Once this process has been completed, the vector A could be
++//    replaced by a compressed vector XU, containing the unique entries
++//    of A in sorted order, using the formula
++//
++//      XU(*) = A(UNDX(*)).
++//
++//    We could then, if we wished, reconstruct the entire vector A, or
++//    any element of it, by index, as follows:
++//
++//      A(I) = XU(XDNU(I)).
++//
++//    We could then replace A by the combination of XU and XDNU.
++//
++//    Later, when we need the I-th entry of A, we can locate it as
++//    the XDNU(I)-th entry of XU.
++//
++//    Here is an example of a vector A, the sort and inverse sort
++//    index vectors, and the unique sort and inverse unique sort vectors
++//    and the compressed unique sorted vector.
++//
++//      I     A  Indx  Xdni       XU  Undx  Xdnu
++//    ----+-----+-----+-----+--------+-----+-----+
++//      0 | 11.     0     0 |    11.     0     0
++//      1 | 22.     2     4 |    22.     1     1
++//      2 | 11.     5     1 |    33.     3     0
++//      3 | 33.     8     7 |    55.     4     2
++//      4 | 55.     1     8 |                  3
++//      5 | 11.     6     2 |                  0
++//      6 | 22.     7     5 |                  1
++//      7 | 22.     3     6 |                  1
++//      8 | 11.     4     3 |                  0
++//
++//    INDX(2) = 3 means that sorted item(2) is A(3).
++//    XDNI(2) = 5 means that A(2) is sorted item(5).
++//
++//    UNDX(3) = 4 means that unique sorted item(3) is at A(4).
++//    XDNU(8) = 2 means that A(8) is at unique sorted item(2).
++//
++//    XU(XDNU(I))) = A(I).
++//    XU(I)        = A(UNDX(I)).
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 July 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the dimension of the data values.
++//
++//    Input, int N, the number of data values,
++//
++//    Input, double A[M*N], the data values.
++//
++//    Input, int UNIQUE_NUM, the number of unique values in A.
++//    This value is only required for languages in which the size of
++//    UNDX must be known in advance.
++//
++//    Output, int UNDX[UNIQUE_NUM], the UNDX vector.
++//
++//    Output, int XDNU[N], the XDNU vector.
++//
++{
++  double diff;
++  int i;
++  int *indx;
++  int j;
++  int k;
++//
++//  Implicitly sort the array.
++//
++  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
++//
++//  Walk through the implicitly sorted array.
++//
++  i = 0;
++
++  j = 0;
++  undx[j] = indx[i];
++
++  xdnu[indx[i]] = j;
++
++  for ( i = 1; i < n; i++ )
++  {
++    diff = 0.0;
++    for ( k = 0; k < m; k++ )
++    {
++      diff = webbur::r8_max ( diff,
++        webbur::r8_abs ( a[k+indx[i]*m] - a[k+undx[j]*m] ) );
++    }
++    if ( 0.0 < diff )
++    {
++      j = j + 1;
++      undx[j] = indx[i];
++    }
++    xdnu[indx[i]] = j;
++  }
++  delete [] indx;
++
++  return;
++}
++//****************************************************************************80
++
++void product_mixed_weight ( int dim_num, int order_1d[], int order_nd,
++  int rule[], double alpha[], double beta[], double weight_nd[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    PRODUCT_MIXED_WEIGHT computes the weights of a mixed product rule.
++//
++//  Discussion:
++//
++//    This routine computes the weights for a quadrature rule which is
++//    a product of 1D rules of varying order and kind.
++//
++//    The user must preallocate space for the output array WEIGHT_ND.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    11 February 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int DIM_NUM, the spatial dimension.
++//
++//    Input, int ORDER_1D[DIM_NUM], the order of the 1D rules.
++//
++//    Input, int ORDER_ND, the order of the product rule.
++//
++//    Input, int RULE[DIM_NUM], the rule in each dimension.
++//     1, "CC",  Clenshaw Curtis, Closed Fully Nested rule.
++//     2, "F2",  Fejer Type 2, Open Fully Nested rule.
++//     3, "GP",  Gauss Patterson, Open Fully Nested rule.
++//     4, "GL",  Gauss Legendre, Open Weakly Nested rule.
++//     5, "GH",  Gauss Hermite, Open Weakly Nested rule.
++//     6, "GGH", Generalized Gauss Hermite, Open Weakly Nested rule.
++//     7, "LG",  Gauss Laguerre, Open Non Nested rule.
++//     8, "GLG", Generalized Gauss Laguerre, Open Non Nested rule.
++//     9, "GJ",  Gauss Jacobi, Open Non Nested rule.
++//    10, "GW",  Golub Welsch, (presumed) Open Non Nested rule.
++//    11, "CC_SE", Clenshaw Curtis Slow Exponential, Closed Fully Nested rule.
++//    12, "F2_SE", Fejer Type 2 Slow Exponential, Open Fully Nested rule.
++//    13, "GP_SE", Gauss Patterson Slow Exponential, Open Fully Nested rule.
++//    14, "CC_ME", Clenshaw Curtis Moderate Exponential, Closed Fully Nested rule.
++//    15, "F2_ME", Fejer Type 2 Moderate Exponential, Open Fully Nested rule.
++//    16, "GP_ME", Gauss Patterson Moderate Exponential, Open Fully Nested rule.
++//    17, "CCN", Clenshaw Curtis Nested, Linear, Closed Fully Nested rule.
++//
++//    Input, double ALPHA[DIM_NUM], BETA[DIM_NUM], parameters used for
++//    Generalized Gauss Hermite, Generalized Gauss Laguerre,
++//    and Gauss Jacobi rules.
++//
++//    Output, double WEIGHT_ND[ORDER_ND], the product rule weights.
++//
++{
++  int dim;
++  int i;
++  double *weight_1d;
++
++  for ( i = 0; i < order_nd; i++ )
++  {
++    weight_nd[i] = 1.0;
++  }
++
++  for ( dim = 0; dim < dim_num; dim++ )
++  {
++    weight_1d = new double[order_1d[dim]];
++
++    if ( rule[dim] == 1 )
++    {
++      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 2 )
++    {
++      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 3 )
++    {
++      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 4 )
++    {
++      webbur::legendre_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 5 )
++    {
++      webbur::hermite_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 6 )
++    {
++      webbur::gen_hermite_compute_weights ( order_1d[dim], alpha[dim], weight_1d );
++    }
++    else if ( rule[dim] == 7 )
++    {
++      webbur::laguerre_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 8 )
++    {
++      webbur::gen_laguerre_compute_weights ( order_1d[dim], alpha[dim], weight_1d );
++    }
++    else if ( rule[dim] == 9 )
++    {
++      webbur::jacobi_compute_weights ( order_1d[dim], alpha[dim], beta[dim], weight_1d );
++    }
++    else if ( rule[dim] == 10 )
++    {
++      std::cerr << "\n";
++      std::cerr << "PRODUCT_MIXED_WEIGHT - Fatal error!\n";
++      std::cerr << "  Do not know how to set weights for rule 10.\n";
++      std::exit ( 1 );
++    }
++    else if ( rule[dim] == 11 )
++    {
++      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 12 )
++    {
++      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 13 )
++    {
++      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 14 )
++    {
++      webbur::clenshaw_curtis_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 15 )
++    {
++      webbur::fejer2_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 16 )
++    {
++      webbur::patterson_lookup_weights ( order_1d[dim], weight_1d );
++    }
++    else if ( rule[dim] == 17 )
++    {
++      webbur::ccn_compute_weights ( order_1d[dim], weight_1d );
++    }
++    else
++    {
++      std::cerr << "\n";
++      std::cerr << "PRODUCT_MIXED_WEIGHT - Fatal error!\n";
++      std::cerr << "  Unexpected value of RULE[" << dim << "] = "
++           << rule[dim] << ".\n";
++      std::exit ( 1 );
++    }
++
++    webbur::r8vec_direct_product2 ( dim, order_1d[dim], weight_1d,
++      dim_num, order_nd, weight_nd );
++
++    delete [] weight_1d;
++  }
++  return;
++}
++//****************************************************************************80
++
++double r8_abs ( double x )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_ABS returns the absolute value of an R8.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, double X, the quantity whose absolute value is desired.
++//
++//    Output, double R8_ABS, the absolute value of X.
++//
++{
++  double value;
++
++  if ( 0.0 <= x )
++  {
++    value = x;
++  }
++  else
++  {
++    value = -x;
++  }
++  return value;
++}
++//****************************************************************************80
++
++double r8_ceiling ( double x )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_CEILING rounds an R8 "up" (towards +oo) to the next integer.
++//
++//  Example:
++//
++//    X        R8_CEILING(X)
++//
++//   -1.1      -1.0
++//   -1.0      -1.0
++//   -0.9       0.0
++//   -0.1       0.0
++//    0.0       0.0
++//    0.1       1.0
++//    0.9       1.0
++//    1.0       1.0
++//    1.1       2.0
++//    2.9       3.0
++//    3.0       3.0
++//    3.14159   4.0
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 April 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, double X, the number whose ceiling is desired.
++//
++//    Output, double R8_CEILING, the ceiling of X.
++//
++{
++  double value;
++
++  value = ( int ) x;
++
++  if ( value < x )
++  {
++    value = value + 1.0;
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_choose ( int n, int k )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_CHOOSE computes the binomial coefficient C(N,K) as an R8.
++//
++//  Discussion:
++//
++//    The value is calculated in such a way as to avoid overflow and
++//    roundoff.  The calculation is done in R8 arithmetic.
++//
++//    The formula used is:
++//
++//      C(N,K) = N! / ( K! * (N-K)! )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    24 March 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    ML Wolfson, HV Wright,
++//    Algorithm 160:
++//    Combinatorial of M Things Taken N at a Time,
++//    Communications of the ACM,
++//    Volume 6, Number 4, April 1963, page 161.
++//
++//  Parameters:
++//
++//    Input, int N, K, the values of N and K.
++//
++//    Output, double R8_CHOOSE, the number of combinations of N
++//    things taken K at a time.
++//
++{
++  int i;
++  int mn;
++  int mx;
++  int value;
++
++  mn = webbur::i4_min ( k, n - k );
++
++  if ( mn < 0 )
++  {
++    value = 0.0;
++  }
++  else if ( mn == 0 )
++  {
++    value = 1.0;
++  }
++  else
++  {
++    mx = webbur::i4_max ( k, n - k );
++    value = ( double ) ( mx + 1 );
++
++    for ( i = 2; i <= mn; i++ )
++    {
++      value = ( value * ( double ) ( mx + i ) ) / ( double ) i;
++    }
++  }
++  return value;
++}
++//****************************************************************************80
++
++double r8_epsilon ( )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_EPSILON returns the R8 roundoff unit.
++//
++//  Discussion:
++//
++//    The roundoff unit is a number R which is a power of 2 with the
++//    property that, to the precision of the computer's arithmetic,
++//      1 < 1 + R
++//    but
++//      1 = ( 1 + R / 2 )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 February 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Output, double R8_EPSILON, the R8 round-off unit.
++//
++{
++  double value;
++
++  value = 1.0;
++
++  while ( 1.0 < ( double ) ( 1.0 + value )  )
++  {
++    value = value / 2.0;
++  }
++
++  value = 2.0 * value;
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_factorial ( int n )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_FACTORIAL computes the factorial of N.
++//
++//  Discussion:
++//
++//    factorial ( N ) = product ( 1 <= I <= N ) I
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    16 January 1999
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the argument of the factorial function.
++//    If N is less than 1, the function value is returned as 1.
++//
++//    Output, double R8_FACTORIAL, the factorial function.
++//
++{
++  int i;
++  double value;
++
++  value = 1.0;
++
++  for ( i = 1; i <= n; i++ )
++  {
++    value = value * ( double ) ( i );
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_factorial2 ( int n )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_FACTORIAL2 computes the double factorial function.
++//
++//  Discussion:
++//
++//    FACTORIAL2( N ) = Product ( N * (N-2) * (N-4) * ... * 2 )  (N even)
++//                    = Product ( N * (N-2) * (N-4) * ... * 1 )  (N odd)
++//
++//  Example:
++//
++//     N    FACTORIAL2(N)
++//
++//     0     1
++//     1     1
++//     2     2
++//     3     3
++//     4     8
++//     5    15
++//     6    48
++//     7   105
++//     8   384
++//     9   945
++//    10  3840
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 January 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the argument of the double factorial
++//    function.  If N is less than 1, R8_FACTORIAL2 is returned as 1.0.
++//
++//    Output, double R8_FACTORIAL2, the double factorial function.
++//
++{
++  int n_copy;
++  double value;
++
++  value = 1.0;
++
++  if ( n < 1 )
++  {
++    return value;
++  }
++
++  n_copy = n;
++
++  while ( 1 < n_copy )
++  {
++    value = value * ( double ) n_copy;
++    n_copy = n_copy - 2;
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_floor ( double x )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_FLOOR rounds an R8 "down" (towards -infinity) to the next integer.
++//
++//  Example:
++//
++//    X        R8_FLOOR(X)
++//
++//   -1.1      -2.0
++//   -1.0      -1.0
++//   -0.9      -1.0
++//   -0.1      -1.0
++//    0.0       0.0
++//    0.1       0.0
++//    0.9       0.0
++//    1.0       1.0
++//    1.1       1.0
++//    2.9       2.0
++//    3.0       3.0
++//    3.14159   3.0
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    15 April 2007
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, double X, the number whose floor is desired.
++//
++//    Output, double R8_FLOOR, the floor of X.
++//
++{
++  double value;
++
++  value = ( int ) x;
++
++  if ( x < value )
++  {
++    value = value - 1.0;
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_gamma ( double x )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_GAMMA evaluates Gamma(X) for a real argument.
++//
++//  Discussion:
++//
++//    This routine calculates the gamma function for a real argument X.
++//
++//    Computation is based on an algorithm outlined in reference 1.
++//    The program uses rational functions that approximate the gamma
++//    function to at least 20 significant decimal digits.  Coefficients
++//    for the approximation over the interval (1,2) are unpublished.
++//    Those for the approximation for 12 <= X are from reference 2.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 January 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by William Cody, Laura Stoltz.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    William Cody,
++//    An Overview of Software Development for Special Functions,
++//    in Numerical Analysis Dundee, 1975,
++//    edited by GA Watson,
++//    Lecture Notes in Mathematics 506,
++//    Springer, 1976.
++//
++//    John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
++//    Charles Mesztenyi, John Rice, Henry Thatcher,
++//    Christoph Witzgall,
++//    Computer Approximations,
++//    Wiley, 1968,
++//    LC: QA297.C64.
++//
++//  Parameters:
++//
++//    Input, double X, the argument of the function.
++//
++//    Output, double R8_GAMMA, the value of the function.
++//
++{
++//
++//  Coefficients for minimax approximation over (12, INF).
++//
++  double c[7] = {
++   -1.910444077728E-03,
++    8.4171387781295E-04,
++   -5.952379913043012E-04,
++    7.93650793500350248E-04,
++   -2.777777777777681622553E-03,
++    8.333333333333333331554247E-02,
++    5.7083835261E-03 };
++  double eps = 2.22E-16;
++  double fact;
++  int i;
++  int n;
++  double one = 1.0;
++  double p[8] = {
++  -1.71618513886549492533811E+00,
++   2.47656508055759199108314E+01,
++  -3.79804256470945635097577E+02,
++   6.29331155312818442661052E+02,
++   8.66966202790413211295064E+02,
++  -3.14512729688483675254357E+04,
++  -3.61444134186911729807069E+04,
++   6.64561438202405440627855E+04 };
++  bool parity;
++  double pi = 3.1415926535897932384626434;
++  double q[8] = {
++  -3.08402300119738975254353E+01,
++   3.15350626979604161529144E+02,
++  -1.01515636749021914166146E+03,
++  -3.10777167157231109440444E+03,
++   2.25381184209801510330112E+04,
++   4.75584627752788110767815E+03,
++  -1.34659959864969306392456E+05,
++  -1.15132259675553483497211E+05 };
++  double res;
++  double sqrtpi = 0.9189385332046727417803297;
++  double sum;
++  double twelve = 12.0;
++  double two = 2.0;
++  double value;
++  double xbig = 171.624;
++  double xden;
++  double xinf = 1.79E+308;
++  double xminin = 2.23E-308;
++  double xnum;
++  double y;
++  double y1;
++  double ysq;
++  double z;
++
++  parity = false;
++  fact = one;
++  n = 0;
++  y = x;
++//
++//  Argument is negative.
++//
++  if ( y <= 0.0 )
++  {
++    y = - x;
++    y1 = ( double ) ( int ) ( y );
++    res = y - y1;
++
++    if ( res != 0.0 )
++    {
++      if ( y1 != ( double ) ( int ) ( y1 * 0.5 ) * two )
++      {
++        parity = true;
++      }
++
++      fact = - pi / std::sin ( pi * res );
++      y = y + one;
++    }
++    else
++    {
++      res = xinf;
++      value = res;
++      return value;
++    }
++  }
++//
++//  Argument is positive.
++//
++  if ( y < eps )
++  {
++//
++//  Argument < EPS.
++//
++    if ( xminin <= y )
++    {
++      res = one / y;
++    }
++    else
++    {
++      res = xinf;
++      value = res;
++      return value;
++    }
++  }
++  else if ( y < twelve )
++  {
++    y1 = y;
++//
++//  0.0 < argument < 1.0.
++//
++    if ( y < one )
++    {
++      z = y;
++      y = y + one;
++    }
++//
++//  1.0 < argument < 12.0.
++//  Reduce argument if necessary.
++//
++    else
++    {
++      n = ( int ) ( y ) - 1;
++      y = y - ( double ) ( n );
++      z = y - one;
++    }
++//
++//  Evaluate approximation for 1.0 < argument < 2.0.
++//
++    xnum = 0.0;
++    xden = one;
++    for ( i = 0; i < 8; i++ )
++    {
++      xnum = ( xnum + p[i] ) * z;
++      xden = xden * z + q[i];
++    }
++    res = xnum / xden + one;
++//
++//  Adjust result for case  0.0 < argument < 1.0.
++//
++    if ( y1 < y )
++    {
++      res = res / y1;
++    }
++//
++//  Adjust result for case 2.0 < argument < 12.0.
++//
++    else if ( y < y1 )
++    {
++      for ( i = 1; i <= n; i++ )
++      {
++        res = res * y;
++        y = y + one;
++      }
++    }
++  }
++  else
++  {
++//
++//  Evaluate for 12.0 <= argument.
++//
++    if ( y <= xbig )
++    {
++      ysq = y * y;
++      sum = c[6];
++      for ( i = 0; i < 6; i++ )
++      {
++        sum = sum / ysq + c[i];
++      }
++      sum = sum / y - y + sqrtpi;
++      sum = sum + ( y - 0.5 ) * std::log ( y );
++      res = std::exp ( sum );
++    }
++    else
++    {
++      res = xinf;
++      value = res;
++      return value;
++    }
++  }
++//
++//  Final adjustments and return.
++//
++  if ( parity )
++  {
++    res = - res;
++  }
++
++  if ( fact != one )
++  {
++    res = fact / res;
++  }
++
++  value = res;
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_huge ( )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_HUGE returns a "huge" R8.
++//
++//  Discussion:
++//
++//    The value returned by this function is NOT required to be the
++//    maximum representable R8.  This value varies from machine to machine,
++//    from compiler to compiler, and may cause problems when being printed.
++//    We simply want a "very large" but non-infinite number.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    06 October 2007
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Output, double R8_HUGE, a "huge" R8 value.
++//
++{
++  double value;
++
++  value = 1.0E+30;
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_hyper_2f1 ( double a, double b, double c, double x )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_HYPER_2F1 evaluates the hypergeometric function 2F1(A,B,C,X).
++//
++//  Discussion:
++//
++//    A bug was corrected.  A line which read
++//      c1 = - ( - 1.0, m ) * gc / ( gam * gbm * rm );
++//    was corrected to read
++//      c1 = - std::pow ( - 1.0, m ) * gc / ( gam * gbm * rm );
++//    JVB, 05 July 2009.
++//
++//    A minor bug was corrected.  The HW variable, used in several places as
++//    the "old" value of a quantity being iteratively improved, was not
++//    being initialized.  JVB, 11 February 2008.
++//
++//    The FORTRAN77 original version of this routine is copyrighted by
++//    Shanjie Zhang and Jianming Jin.  However, they give permission to
++//    incorporate this routine into a user program provided that the copyright
++//    is acknowledged.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    05 July 2009
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Shanjie Zhang, Jianming Jin.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    Shanjie Zhang, Jianming Jin,
++//    Computation of Special Functions,
++//    Wiley, 1996,
++//    ISBN: 0-471-11963-6,
++//    LC: QA351.C45
++//
++//  Parameters:
++//
++//    Input, double A, B, C, X, the arguments of the function.
++//    C must not be equal to a nonpositive integer.
++//    X < 1.
++//
++//    Output, double R8_HYPER_2F1, the value of the function.
++//
++{
++  double a0;
++  double aa;
++  double bb;
++  double c0;
++  double c1;
++  double el = 0.5772156649015329;
++  double eps;
++  double f0;
++  double f1;
++  double g0;
++  double g1;
++  double g2;
++  double g3;
++  double ga;
++  double gabc;
++  double gam;
++  double gb;
++  double gbm;
++  double gc;
++  double gca;
++  double gcab;
++  double gcb;
++  double gm;
++  double hf;
++  double hw;
++  int j;
++  int k;
++  bool l0;
++  bool l1;
++  bool l2;
++  bool l3;
++  bool l4;
++  bool l5;
++  int m;
++  int nm;
++  double pa;
++  double pb;
++  double pi = 3.141592653589793;
++  double r;
++  double r0;
++  double r1;
++  double rm;
++  double rp;
++  double sm;
++  double sp;
++  double sp0;
++  double x1;
++
++  l0 = ( c == ( int ) ( c ) ) && ( c < 0.0 );
++  l1 = ( 1.0 - x < 1.0E-15 ) && ( c - a - b <= 0.0 );
++  l2 = ( a == ( int ) ( a ) ) && ( a < 0.0 );
++  l3 = ( b == ( int ) ( b ) ) && ( b < 0.0 );
++  l4 = ( c - a == ( int ) ( c - a ) ) && ( c - a <= 0.0 );
++  l5 = ( c - b == ( int ) ( c - b ) ) && ( c - b <= 0.0 );
++
++  if ( l0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8_HYPER_2F1 - Fatal error!\n";
++    std::cerr << "  The hypergeometric series is divergent.\n";
++    std::cerr << "  C is integral and negative.\n";
++    std::cerr << "  C = " << c << "\n";
++    std::exit ( 1 );
++  }
++
++  if ( l1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8_HYPER_2F1 - Fatal error!\n";
++    std::cerr << "  The hypergeometric series is divergent.\n";
++    std::cerr << "  1 - X < 0, C - A - B <= 0\n";
++    std::cerr << "  A = " << a << "\n";
++    std::cerr << "  B = " << b << "\n";
++    std::cerr << "  C = " << c << "\n";
++    std::cerr << "  X = " << x << "\n";
++    std::exit ( 1 );
++  }
++
++  if ( 0.95 < x )
++  {
++    eps = 1.0E-08;
++  }
++  else
++  {
++    eps = 1.0E-15;
++  }
++
++  if ( x == 0.0 || a == 0.0 || b == 0.0 )
++  {
++    hf = 1.0;
++    return hf;
++  }
++  else if ( 1.0 - x == eps && 0.0 < c - a - b )
++  {
++    gc = webbur::r8_gamma ( c );
++    gcab = webbur::r8_gamma ( c - a - b );
++    gca = webbur::r8_gamma ( c - a );
++    gcb = webbur::r8_gamma ( c - b );
++    hf = gc * gcab / ( gca * gcb );
++    return hf;
++  }
++  else if ( 1.0 + x <= eps && r8_abs ( c - a + b - 1.0 ) <= eps )
++  {
++    g0 = std::sqrt ( pi ) * std::pow ( 2.0, - a );
++    g1 = webbur::r8_gamma ( c );
++    g2 = webbur::r8_gamma ( 1.0 + a / 2.0 - b );
++    g3 = webbur::r8_gamma ( 0.5 + 0.5 * a );
++    hf = g0 * g1 / ( g2 * g3 );
++    return hf;
++  }
++  else if ( l2 || l3 )
++  {
++    if ( l2 )
++    {
++      nm = ( int ) ( webbur::r8_abs ( a ) );
++    }
++
++    if ( l3 )
++    {
++      nm = ( int ) ( webbur::r8_abs ( b ) );
++    }
++
++    hf = 1.0;
++    r = 1.0;
++
++    for ( k = 1; k <= nm; k++ )
++    {
++      r = r * ( a + k - 1.0 ) * ( b + k - 1.0 )
++        / ( k * ( c + k - 1.0 ) ) * x;
++      hf = hf + r;
++    }
++
++    return hf;
++  }
++  else if ( l4 || l5 )
++  {
++    if ( l4 )
++    {
++      nm = ( int ) ( webbur::r8_abs ( c - a ) );
++    }
++
++    if ( l5 )
++    {
++      nm = ( int ) ( webbur::r8_abs ( c - b ) );
++    }
++
++    hf = 1.0;
++    r  = 1.0;
++    for ( k = 1; k <= nm; k++ )
++    {
++      r = r * ( c - a + k - 1.0 ) * ( c - b + k - 1.0 )
++        / ( k * ( c + k - 1.0 ) ) * x;
++      hf = hf + r;
++    }
++    hf = std::pow ( 1.0 - x, c - a - b ) * hf;
++    return hf;
++  }
++
++  aa = a;
++  bb = b;
++  x1 = x;
++
++  if ( x < 0.0 )
++  {
++    x = x / ( x - 1.0 );
++    if ( a < c && b < a && 0.0 < b )
++    {
++      a = bb;
++      b = aa;
++    }
++    b = c - b;
++  }
++
++  if ( 0.75 <= x )
++  {
++    gm = 0.0;
++
++    if ( webbur::r8_abs ( c - a - b - ( int ) ( c - a - b ) ) < 1.0E-15 )
++    {
++      m = ( int ) ( c - a - b );
++      ga = webbur::r8_gamma ( a );
++      gb = webbur::r8_gamma ( b );
++      gc = webbur::r8_gamma ( c );
++      gam = webbur::r8_gamma ( a + m );
++      gbm = webbur::r8_gamma ( b + m );
++
++      pa = webbur::r8_psi ( a );
++      pb = webbur::r8_psi ( b );
++
++      if ( m != 0 )
++      {
++        gm = 1.0;
++      }
++
++      for ( j = 1; j <= std::abs ( m ) - 1; j++ )
++      {
++        gm = gm * j;
++      }
++
++      rm = 1.0;
++      for ( j = 1; j <= std::abs ( m ); j++ )
++      {
++        rm = rm * j;
++      }
++
++      f0 = 1.0;
++      r0 = 1.0;;
++      r1 = 1.0;
++      sp0 = 0.0;;
++      sp = 0.0;
++
++      if ( 0 <= m )
++      {
++        c0 = gm * gc / ( gam * gbm );
++        c1 = - gc * std::pow ( x - 1.0, m ) / ( ga * gb * rm );
++
++        for ( k = 1; k <= m - 1; k++ )
++        {
++          r0 = r0 * ( a + k - 1.0 ) * ( b + k - 1.0 )
++            / ( k * ( k - m ) ) * ( 1.0 - x );
++          f0 = f0 + r0;
++        }
++
++        for ( k = 1; k <= m; k++ )
++        {
++          sp0 = sp0 + 1.0 / ( a + k - 1.0 ) + 1.0 / ( b + k - 1.0 )
++          - 1.0 / ( double ) ( k );
++        }
++
++        f1 = pa + pb + sp0 + 2.0 * el + std::log ( 1.0 - x );
++        hw = f1;
++
++        for ( k = 1; k <= 250; k++ )
++        {
++          sp = sp + ( 1.0 - a ) / ( k * ( a + k - 1.0 ) )
++            + ( 1.0 - b ) / ( k * ( b + k - 1.0 ) );
++
++          sm = 0.0;
++          for ( j = 1; j <= m; j++ )
++          {
++            sm = sm + ( 1.0 - a )
++              / ( ( j + k ) * ( a + j + k - 1.0 ) )
++              + 1.0 / ( b + j + k - 1.0 );
++          }
++
++          rp = pa + pb + 2.0 * el + sp + sm + std::log ( 1.0 - x );
++
++          r1 = r1 * ( a + m + k - 1.0 ) * ( b + m + k - 1.0 )
++            / ( k * ( m + k ) ) * ( 1.0 - x );
++
++          f1 = f1 + r1 * rp;
++
++          if ( r8_abs ( f1 - hw ) < r8_abs ( f1 ) * eps )
++          {
++            break;
++          }
++          hw = f1;
++        }
++        hf = f0 * c0 + f1 * c1;
++      }
++      else if ( m < 0 )
++      {
++        m = - m;
++        c0 = gm * gc / ( ga * gb * std::pow ( 1.0 - x, m ) );
++        c1 = - std::pow ( - 1.0, m ) * gc / ( gam * gbm * rm );
++
++        for ( k = 1; k <= m - 1; k++ )
++        {
++          r0 = r0 * ( a - m + k - 1.0 ) * ( b - m + k - 1.0 )
++            / ( k * ( k - m ) ) * ( 1.0 - x );
++          f0 = f0 + r0;
++        }
++
++        for ( k = 1; k <= m; k++ )
++        {
++          sp0 = sp0 + 1.0 / ( double ) ( k );
++        }
++
++        f1 = pa + pb - sp0 + 2.0 * el + std::log ( 1.0 - x );
++        hw = f1;
++
++        for ( k = 1; k <= 250; k++ )
++        {
++          sp = sp + ( 1.0 - a )
++            / ( k * ( a + k - 1.0 ) )
++            + ( 1.0 - b ) / ( k * ( b + k - 1.0 ) );
++
++          sm = 0.0;
++          for ( j = 1; j <= m; j++ )
++          {
++            sm = sm + 1.0 / ( double ) ( j + k );
++          }
++
++          rp = pa + pb + 2.0 * el + sp - sm + std::log ( 1.0 - x );
++
++          r1 = r1 * ( a + k - 1.0 ) * ( b + k - 1.0 )
++            / ( k * ( m + k ) ) * ( 1.0 - x );
++
++          f1 = f1 + r1 * rp;
++
++          if ( webbur::r8_abs ( f1 - hw ) < webbur::r8_abs ( f1 ) * eps )
++          {
++            break;
++          }
++
++          hw = f1;
++        }
++
++        hf = f0 * c0 + f1 * c1;
++      }
++    }
++    else
++    {
++      ga = webbur::r8_gamma ( a );
++      gb = webbur::r8_gamma ( b );
++      gc = webbur::r8_gamma ( c );
++      gca = webbur::r8_gamma ( c - a );
++      gcb = webbur::r8_gamma ( c - b );
++      gcab = webbur::r8_gamma ( c - a - b );
++      gabc = webbur::r8_gamma ( a + b - c );
++      c0 = gc * gcab / ( gca * gcb );
++      c1 = gc * gabc / ( ga * gb ) * std::pow ( 1.0 - x, c - a - b );
++      hf = 0.0;
++      hw = hf;
++      r0 = c0;
++      r1 = c1;
++
++      for ( k = 1; k <= 250; k++ )
++      {
++        r0 = r0 * ( a + k - 1.0 ) * ( b + k - 1.0 )
++          / ( k * ( a + b - c + k ) ) * ( 1.0 - x );
++
++        r1 = r1 * ( c - a + k - 1.0 ) * ( c - b + k - 1.0 )
++          / ( k * ( c - a - b + k ) ) * ( 1.0 - x );
++
++        hf = hf + r0 + r1;
++
++        if ( webbur::r8_abs ( hf - hw ) < webbur::r8_abs ( hf ) * eps )
++        {
++          break;
++        }
++        hw = hf;
++      }
++      hf = hf + c0 + c1;
++    }
++  }
++  else
++  {
++    a0 = 1.0;
++
++    if ( a < c && c < 2.0 * a && b < c && c < 2.0 * b )
++    {
++      a0 = std::pow ( 1.0 - x, c - a - b );
++      a = c - a;
++      b = c - b;
++    }
++
++    hf = 1.0;
++    hw = hf;
++    r = 1.0;
++
++    for ( k = 1; k <= 250; k++ )
++    {
++      r = r * ( a + k - 1.0 ) * ( b + k - 1.0 )
++        / ( k * ( c + k - 1.0 ) ) * x;
++
++      hf = hf + r;
++
++      if ( webbur::r8_abs ( hf - hw ) <= webbur::r8_abs ( hf ) * eps )
++      {
++        break;
++      }
++
++      hw = hf;
++    }
++    hf = a0 * hf;
++  }
++
++  if ( x1 < 0.0 )
++  {
++    x = x1;
++    c0 = 1.0 / std::pow ( 1.0 - x, aa );
++    hf = c0 * hf;
++  }
++
++  a = aa;
++  b = bb;
++
++  if ( 120 < k )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8_HYPER_2F1 - Warning!\n";
++    std::cerr << "  A large number of iterations were needed.\n";
++    std::cerr << "  The accuracy of the results should be checked.\n";
++  }
++
++  return hf;
++}
++//****************************************************************************80
++
++double r8_max ( double x, double y )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_MAX returns the maximum of two R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 August 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, double X, Y, the quantities to compare.
++//
++//    Output, double R8_MAX, the maximum of X and Y.
++//
++{
++  double value;
++
++  if ( y < x )
++  {
++    value = x;
++  }
++  else
++  {
++    value = y;
++  }
++  return value;
++}
++//****************************************************************************80
++
++double r8_min ( double x, double y )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_MIN returns the minimum of two R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    31 August 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, double X, Y, the quantities to compare.
++//
++//    Output, double R8_MIN, the minimum of X and Y.
++//
++{
++  double value;
++
++  if ( y < x )
++  {
++    value = y;
++  }
++  else
++  {
++    value = x;
++  }
++  return value;
++}
++//****************************************************************************80
++
++double r8_mop ( int i )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_MOP returns the I-th power of -1 as an R8 value.
++//
++//  Discussion:
++//
++//    An R8 is an double value.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    16 November 2007
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int I, the power of -1.
++//
++//    Output, double R8_MOP, the I-th power of -1.
++//
++{
++  double value;
++
++  if ( ( i % 2 ) == 0 )
++  {
++    value = 1.0;
++  }
++  else
++  {
++    value = -1.0;
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_psi ( double xx )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_PSI evaluates the function Psi(X).
++//
++//  Discussion:
++//
++//    This routine evaluates the logarithmic derivative of the
++//    Gamma function,
++//
++//      PSI(X) = d/dX ( GAMMA(X) ) / GAMMA(X)
++//             = d/dX LN ( GAMMA(X) )
++//
++//    for real X, where either
++//
++//      - XMAX1 < X < - XMIN, and X is not a negative integer,
++//
++//    or
++//
++//      XMIN < X.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    09 February 2008
++//
++//  Author:
++//
++//    Original FORTRAN77 version by William Cody.
++//    C++ version by John Burkardt.
++//
++//  Reference:
++//
++//    William Cody, Anthony Strecok, Henry Thacher,
++//    Chebyshev Approximations for the Psi Function,
++//    Mathematics of Computation,
++//    Volume 27, Number 121, January 1973, pages 123-127.
++//
++//  Parameters:
++//
++//    Input, double XX, the argument of the function.
++//
++//    Output, double R8_PSI, the value of the function.
++//
++{
++  double aug;
++  double den;
++  int i;
++  int n;
++  int nq;
++  double one = 1.0;
++  double p1[9] = {
++   4.5104681245762934160E-03,
++   5.4932855833000385356,
++   3.7646693175929276856E+02,
++   7.9525490849151998065E+03,
++   7.1451595818951933210E+04,
++   3.0655976301987365674E+05,
++   6.3606997788964458797E+05,
++   5.8041312783537569993E+05,
++   1.6585695029761022321E+05 };
++  double p2[7] = {
++  -2.7103228277757834192,
++  -1.5166271776896121383E+01,
++  -1.9784554148719218667E+01,
++  -8.8100958828312219821,
++  -1.4479614616899842986,
++  -7.3689600332394549911E-02,
++  -6.5135387732718171306E-21 };
++  double piov4 = 0.78539816339744830962;
++  double q1[8] = {
++   9.6141654774222358525E+01,
++   2.6287715790581193330E+03,
++   2.9862497022250277920E+04,
++   1.6206566091533671639E+05,
++   4.3487880712768329037E+05,
++   5.4256384537269993733E+05,
++   2.4242185002017985252E+05,
++   6.4155223783576225996E-08 };
++  double q2[6] = {
++   4.4992760373789365846E+01,
++   2.0240955312679931159E+02,
++   2.4736979003315290057E+02,
++   1.0742543875702278326E+02,
++   1.7463965060678569906E+01,
++   8.8427520398873480342E-01 };
++  double sgn;
++  double three = 3.0;
++  double upper;
++  double value;
++  double w;
++  double x;
++  double x01 = 187.0;
++  double x01d = 128.0;
++  double x02 = 6.9464496836234126266E-04;
++  double xinf = 1.70E+38;
++  double xlarge = 2.04E+15;
++  double xmax1 = 3.60E+16;
++  double xmin1 = 5.89E-39;
++  double xsmall = 2.05E-09;
++  double z;
++
++  x = xx;
++  w = webbur::r8_abs ( x );
++  aug = 0.0;
++//
++//  Check for valid arguments, then branch to appropriate algorithm.
++//
++  if ( xmax1 <= - x || w < xmin1 )
++  {
++    if ( 0.0 < x )
++    {
++      value = - xinf;
++    }
++    else
++    {
++      value = xinf;
++    }
++    return value;
++  }
++
++  if ( x < 0.5 )
++  {
++//
++//  X < 0.5, use reflection formula: psi(1-x) = psi(x) + pi * cot(pi*x)
++//  Use 1/X for PI*COTAN(PI*X)  when  XMIN1 < |X| <= XSMALL.
++//
++    if ( w <= xsmall )
++    {
++      aug = - one / x;
++    }
++//
++//  Argument reduction for cotangent.
++//
++    else
++    {
++      if ( x < 0.0 )
++      {
++        sgn = piov4;
++      }
++      else
++      {
++        sgn = - piov4;
++      }
++
++      w = w - ( double ) ( ( int ) ( w ) );
++      nq = ( int ) ( w * 4.0 );
++      w = 4.0 * ( w - ( double ) ( nq ) * 0.25 );
++//
++//  W is now related to the fractional part of 4.0 * X.
++//  Adjust argument to correspond to values in the first
++//  quadrant and determine the sign.
++//
++      n = nq / 2;
++
++      if ( n + n != nq )
++      {
++        w = one - w;
++      }
++
++      z = piov4 * w;
++
++      if ( ( n % 2 ) != 0 )
++      {
++        sgn = - sgn;
++      }
++//
++//  Determine the final value for  -pi * cotan(pi*x).
++//
++      n = ( nq + 1 ) / 2;
++      if ( ( n % 2 ) == 0 )
++      {
++//
++//  Check for singularity.
++//
++        if ( z == 0.0 )
++        {
++          if ( 0.0 < x )
++          {
++            value = -xinf;
++          }
++          else
++          {
++            value = xinf;
++          }
++          return value;
++        }
++        aug = sgn * ( 4.0 / std::tan ( z ) );
++      }
++      else
++      {
++        aug = sgn * ( 4.0 * std::tan ( z ) );
++      }
++    }
++    x = one - x;
++  }
++//
++//  0.5 <= X <= 3.0.
++//
++  if ( x <= three )
++  {
++    den = x;
++    upper = p1[0] * x;
++    for ( i = 1; i <= 7; i++ )
++    {
++      den = ( den + q1[i-1] ) * x;
++      upper = ( upper + p1[i]) * x;
++    }
++    den = ( upper + p1[8] ) / ( den + q1[7] );
++    x = ( x - x01 / x01d ) - x02;
++    value = den * x + aug;
++    return value;
++  }
++//
++//  3.0 < X.
++//
++  if ( x < xlarge )
++  {
++    w = one / ( x * x );
++    den = w;
++    upper = p2[0] * w;
++    for ( i = 1; i <= 5; i++ )
++    {
++      den = ( den + q2[i-1] ) * w;
++      upper = ( upper + p2[i] ) * w;
++    }
++    aug = ( upper + p2[6] ) / ( den + q2[5] ) - 0.5 / x + aug;
++  }
++
++  value = aug + std::log ( x );
++
++  return value;
++}
++//****************************************************************************80
++
++double r8_sign ( double x )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8_SIGN returns the sign of an R8.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 October 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, double X, the number whose sign is desired.
++//
++//    Output, double R8_SIGN, the sign of X.
++//
++{
++  double value;
++
++  if ( x < 0.0 )
++  {
++    value = -1.0;
++  }
++  else
++  {
++    value = 1.0;
++  }
++  return value;
++}
++//****************************************************************************80
++
++int r8col_compare ( int m, int n, double a[], int i, int j )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_COMPARE compares two columns in an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//  Example:
++//
++//    Input:
++//
++//      M = 3, N = 4, I = 2, J = 4
++//
++//      A = (
++//        1.  2.  3.  4.
++//        5.  6.  7.  8.
++//        9. 10. 11. 12. )
++//
++//    Output:
++//
++//      R8COL_COMPARE = -1
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    13 September 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input, double A[M*N], the M by N array.
++//
++//    Input, int I, J, the columns to be compared.
++//    I and J must be between 1 and N.
++//
++//    Output, int R8COL_COMPARE, the results of the comparison:
++//    -1, column I < column J,
++//     0, column I = column J,
++//    +1, column J < column I.
++//
++{
++  int k;
++  int value;
++//
++//  Check.
++//
++  if ( i < 1 || n < i )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8COL_COMPARE - Fatal error!\n";
++    std::cerr << "  Column index I is out of bounds.\n";
++    std::cerr << "  I = " << i << "\n";
++    std::exit ( 1 );
++  }
++
++  if ( j < 1 || n < j )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8COL_COMPARE - Fatal error!\n";
++    std::cerr << "  Column index J is out of bounds.\n";
++    std::cerr << "  J = " << j << "\n";
++    std::exit ( 1 );
++  }
++
++  value = 0;
++
++  if ( i == j )
++  {
++    return value;
++  }
++
++  k = 0;
++
++  while ( k < m )
++  {
++    if ( a[k+(i-1)*m] < a[k+(j-1)*m] )
++    {
++      value = -1;
++      return value;
++    }
++    else if ( a[k+(j-1)*m] < a[k+(i-1)*m] )
++    {
++      value = +1;
++      return value;
++    }
++    k = k + 1;
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++void r8col_sort_heap_a ( int m, int n, double a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_SORT_HEAP_A ascending heapsorts an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//    In lexicographic order, the statement "X < Y", applied to two real
++//    vectors X and Y of length M, means that there is some index I, with
++//    1 <= I <= M, with the property that
++//
++//      X(J) = Y(J) for J < I,
++//    and
++//      X(I) < Y(I).
++//
++//    In other words, the first time they differ, X is smaller.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    15 September 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input/output, double A[M*N].
++//    On input, the array of N columns of M-vectors.
++//    On output, the columns of A have been sorted in lexicographic order.
++//
++{
++  int i;
++  int indx;
++  int isgn;
++  int j;
++
++  if ( m <= 0 )
++  {
++    return;
++  }
++
++  if ( n <= 1 )
++  {
++    return;
++  }
++//
++//  Initialize.
++//
++  i = 0;
++  indx = 0;
++  isgn = 0;
++  j = 0;
++//
++//  Call the external heap sorter.
++//
++  for ( ; ; )
++  {
++    webbur::sort_heap_external ( n, &indx, &i, &j, isgn );
++//
++//  Interchange the I and J objects.
++//
++    if ( 0 < indx )
++    {
++      webbur::r8col_swap ( m, n, a, i, j );
++    }
++//
++//  Compare the I and J objects.
++//
++    else if ( indx < 0 )
++    {
++      isgn = webbur::r8col_compare ( m, n, a, i, j );
++    }
++    else if ( indx == 0 )
++    {
++      break;
++    }
++  }
++
++  return;
++}
++//****************************************************************************80
++
++int *r8col_sort_heap_index_a ( int m, int n, double a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//    The sorting is not actually carried out.  Rather an index array is
++//    created which defines the sorting.  This array may be used to sort
++//    or index the array, or to sort or index related arrays keyed on the
++//    original array.
++//
++//    A(*,J1) < A(*,J2) if the first nonzero entry of A(*,J1)-A(*,J2)
++//    is negative.
++//
++//    Once the index array is computed, the sorting can be carried out
++//    "implicitly:
++//
++//      A(*,INDX(*)) is sorted,
++//
++//    Note that the index vector is 0-based.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 November 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the number of rows in each column of A.
++//
++//    Input, int N, the number of columns in A.
++//
++//    Input, double A[M*N], the array.
++//
++//    Output, int R8COL_SORT_HEAP_INDEX_A[N], contains the sort index.  The
++//    I-th column of the sorted array is A(*,INDX(I)).
++//
++{
++  double *column;
++  int i;
++  int *indx;
++  int indxt;
++  int ir;
++  int isgn;
++  int j;
++  int k;
++  int l;
++
++  if ( n < 1 )
++  {
++    return NULL;
++  }
++
++  indx = new int[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    indx[i] = i;
++  }
++
++  if ( n == 1 )
++  {
++    return indx;
++  }
++
++  column = new double[m];
++
++  l = n / 2 + 1;
++  ir = n;
++
++  for ( ; ; )
++  {
++    if ( 1 < l )
++    {
++      l = l - 1;
++      indxt = indx[l-1];
++      for ( k = 0; k < m; k++ )
++      {
++        column[k] = a[k+indxt*m];
++      }
++    }
++    else
++    {
++      indxt = indx[ir-1];
++      for ( k = 0; k < m; k++ )
++      {
++        column[k] = a[k+indxt*m];
++      }
++      indx[ir-1] = indx[0];
++      ir = ir - 1;
++
++      if ( ir == 1 )
++      {
++        indx[0] = indxt;
++        break;
++      }
++    }
++
++    i = l;
++    j = l + l;
++
++    while ( j <= ir )
++    {
++      if ( j < ir )
++      {
++        isgn = webbur::r8vec_compare ( m, a+indx[j-1]*m, a+indx[j]*m );
++
++        if ( isgn < 0 )
++        {
++          j = j + 1;
++        }
++      }
++
++      isgn = webbur::r8vec_compare ( m, column, a+indx[j-1]*m );
++
++      if ( isgn < 0 )
++      {
++        indx[i-1] = indx[j-1];
++        i = j;
++        j = j + j;
++      }
++      else
++      {
++        j = ir + 1;
++      }
++    }
++    indx[i-1] = indxt;
++  }
++  delete [] column;
++
++  return indx;
++}
++//****************************************************************************80
++
++int r8col_sorted_unique_count ( int m, int n, double a[], double tol )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_SORTED_UNIQUE_COUNT counts unique elements in a sorted R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//    The columns of the array may be ascending or descending sorted.
++//
++//    If the tolerance is large enough, then the concept of uniqueness
++//    can become ambiguous.  If we have a tolerance of 1.5, then in the
++//    list ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) is it fair to say we have only
++//    one unique entry?  That would be because 1 may be regarded as unique,
++//    and then 2 is too close to 1 to be unique, and 3 is too close to 2 to
++//    be unique and so on.
++//
++//    This seems wrongheaded.  So I prefer the idea that an item is not
++//    unique under a tolerance only if it is close to something that IS unique.
++//    Thus, the unique items are guaranteed to cover the space if we include
++//    a disk of radius TOL around each one.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    01 November 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input, double A[M*N], a sorted array, containing
++//    N columns of data.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Output, int R8COL_SORTED_UNIQUE_COUNT, the number of unique columns.
++//
++{
++  double diff;
++  int i;
++  int j1;
++  int j2;
++  int unique_num;
++
++  unique_num = 0;
++
++  if ( n <= 0 )
++  {
++    return unique_num;
++  }
++
++  unique_num = 1;
++  j1 = 0;
++
++  for ( j2 = 1; j2 < n; j2++ )
++  {
++    diff = 0.0;
++    for ( i = 0; i < m; i++ )
++    {
++      diff = webbur::r8_max ( diff, webbur::r8_abs ( a[i+j1*m] - a[i+j2*m] ) );
++    }
++    if ( tol < diff )
++    {
++      unique_num = unique_num + 1;
++      j1 = j2;
++    }
++  }
++
++  return unique_num;
++}
++//****************************************************************************80
++
++void r8col_swap ( int m, int n, double a[], int j1, int j2 )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_SWAP swaps columns J1 and J2 of an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//  Example:
++//
++//    Input:
++//
++//      M = 3, N = 4, J1 = 2, J2 = 4
++//
++//      A = (
++//        1.  2.  3.  4.
++//        5.  6.  7.  8.
++//        9. 10. 11. 12. )
++//
++//    Output:
++//
++//      A = (
++//        1.  4.  3.  2.
++//        5.  8.  7.  6.
++//        9. 12. 11. 10. )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 October 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input/output, double A[M*N], the M by N array.
++//
++//    Input, int J1, J2, the columns to be swapped.
++//    These columns are 1-based.
++//
++{
++  int i;
++  double temp;
++
++  if ( j1 < 1 || n < j1 || j2 < 1 || n < j2 )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8COL_SWAP - Fatal error!\n";
++    std::cerr << "  J1 or J2 is out of bounds.\n";
++    std::cerr << "  J1 =   " << j1 << "\n";
++    std::cerr << "  J2 =   " << j2 << "\n";
++    std::cerr << "  NCOL = " << n << "\n";
++    std::exit ( 1 );
++  }
++
++  if ( j1 == j2 )
++  {
++    return;
++  }
++
++  for ( i = 0; i < m; i++ )
++  {
++    temp          = a[i+(j1-1)*m];
++    a[i+(j1-1)*m] = a[i+(j2-1)*m];
++    a[i+(j2-1)*m] = temp;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void r8col_tol_undex ( int m, int n, double a[], int unique_num, double tol,
++  int undx[], int xdnu[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_TOL_UNDEX indexes tolerably unique entries of an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//    The goal of this routine is to determine a vector UNDX,
++//    which points to the unique elements of A, in sorted order,
++//    and a vector XDNU, which identifies, for each entry of A, the index of
++//    the unique sorted element of A.
++//
++//    This is all done with index vectors, so that the elements of
++//    A are never moved.
++//
++//    The first step of the algorithm requires the indexed sorting
++//    of A, which creates arrays INDX and XDNI.  (If all the entries
++//    of A are unique, then these arrays are the same as UNDX and XDNU.)
++//
++//    We then use INDX to examine the entries of A in sorted order,
++//    noting the unique entries, creating the entries of XDNU and
++//    UNDX as we go.
++//
++//    Once this process has been completed, the vector A could be
++//    replaced by a compressed vector XU, containing the unique entries
++//    of A in sorted order, using the formula
++//
++//      XU(*) = A(UNDX(*)).
++//
++//    We could then, if we wished, reconstruct the entire vector A, or
++//    any element of it, by index, as follows:
++//
++//      A(I) = XU(XDNU(I)).
++//
++//    We could then replace A by the combination of XU and XDNU.
++//
++//    Later, when we need the I-th entry of A, we can locate it as
++//    the XDNU(I)-th entry of XU.
++//
++//    Here is an example of a vector A, the sort and inverse sort
++//    index vectors, and the unique sort and inverse unique sort vectors
++//    and the compressed unique sorted vector.
++//
++//      I     A  Indx  Xdni       XU  Undx  Xdnu
++//    ----+-----+-----+-----+--------+-----+-----+
++//      0 | 11.     0     0 |    11.     0     0
++//      1 | 22.     2     4 |    22.     1     1
++//      2 | 11.     5     1 |    33.     3     0
++//      3 | 33.     8     7 |    55.     4     2
++//      4 | 55.     1     8 |                  3
++//      5 | 11.     6     2 |                  0
++//      6 | 22.     7     5 |                  1
++//      7 | 22.     3     6 |                  1
++//      8 | 11.     4     3 |                  0
++//
++//    INDX(2) = 3 means that sorted item(2) is A(3).
++//    XDNI(2) = 5 means that A(2) is sorted item(5).
++//
++//    UNDX(3) = 4 means that unique sorted item(3) is at A(4).
++//    XDNU(8) = 2 means that A(8) is at unique sorted item(2).
++//
++//    XU(XDNU(I))) = X(I).
++//    XU(I)        = X(UNDX(I)).
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 July 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, the dimension of the data values.
++//
++//    Input, int N, the number of data values,
++//
++//    Input, double A[M*N], the data values.
++//
++//    Input, int UNIQUE_NUM, the number of unique values in A.
++//    This value is only required for languages in which the size of
++//    UNDX must be known in advance.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Output, int UNDX[UNIQUE_NUM], the UNDX vector.
++//
++//    Output, int XDNU[N], the XDNU vector.
++//
++{
++  double diff;
++  int i;
++  int i2;
++  int *indx;
++  int j;
++  int k;
++  bool unique;
++//
++//  Implicitly sort the array.
++//
++  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
++//
++//  Consider entry I = 0.
++//  It is unique, so set the number of unique items to K.
++//  Set the K-th unique item to I.
++//  Set the representative of item I to the K-th unique item.
++//
++  i = 0;
++  k = 0;
++  undx[k] = indx[i];
++  xdnu[indx[i]] = k;
++//
++//  Consider entry I.
++//
++//  If it is unique, increase the unique count K, set the
++//  K-th unique item to I, and set the representative of I to K.
++//
++//  If it is not unique, set the representative of item I to a
++//  previously determined unique item that is close to it.
++//
++  for ( i = 1; i < n; i++ )
++  {
++    unique = true;
++    for ( j = 0; j <= k; j++ )
++    {
++      diff = 0.0;
++      for ( i2 = 0; i2 < m; i2++ )
++      {
++        diff = webbur::r8_max ( diff,
++          webbur::r8_abs ( a[i2+indx[i]*m] - a[i2+undx[j]*m] ) );
++      }
++      if ( diff <= tol )
++      {
++        unique = false;
++        xdnu[indx[i]] = j;
++        break;
++      }
++    }
++    if ( unique )
++    {
++      k = k + 1;
++      undx[k] = indx[i];
++      xdnu[indx[i]] = k;
++    }
++  }
++  delete [] indx;
++
++  return;
++}
++//****************************************************************************80
++
++int r8col_tol_unique_count ( int m, int n, double a[], double tol )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_TOL_UNIQUE_COUNT counts tolerably unique entries in an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//    The columns of the array may be ascending or descending sorted.
++//
++//    If the tolerance is large enough, then the concept of uniqueness
++//    can become ambiguous.  If we have a tolerance of 1.5, then in the
++//    list ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ) is it fair to say we have only
++//    one unique entry?  That would be because 1 may be regarded as unique,
++//    and then 2 is too close to 1 to be unique, and 3 is too close to 2 to
++//    be unique and so on.
++//
++//    This seems wrongheaded.  So I prefer the idea that an item is not
++//    unique under a tolerance only if it is close to something that IS unique.
++//    Thus, the unique items are guaranteed to cover the space if we include
++//    a disk of radius TOL around each one.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 July 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input, double A[M*N], the array of N columns of data.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Output, int R8COL_TOL_UNIQUE_COUNT, the number of unique columns.
++//
++{
++  double diff;
++  int i;
++  int i2;
++  int *indx;
++  int j;
++  int k;
++  bool unique;
++  int *undx;
++
++  undx = new int[n];
++//
++//  Implicitly sort the array.
++//
++  indx = webbur::r8col_sort_heap_index_a ( m, n, a );
++//
++//  Consider entry I = 0.
++//  It is unique, so set the number of unique items to K.
++//  Set the K-th unique item to I.
++//  Set the representative of item I to the K-th unique item.
++//
++  i = 0;
++  k = 0;
++  undx[k] = indx[i];
++//
++//  Consider entry I.
++//
++//  If it is unique, increase the unique count K, set the
++//  K-th unique item to I, and set the representative of I to K.
++//
++//  If it is not unique, set the representative of item I to a
++//  previously determined unique item that is close to it.
++//
++  for ( i = 1; i < n; i++ )
++  {
++    unique = true;
++    for ( j = 0; j <= k; j++ )
++    {
++      diff = 0.0;
++      for ( i2 = 0; i2 < m; i2++ )
++      {
++        diff = webbur::r8_max ( diff,
++          webbur::r8_abs ( a[i2+indx[i]*m] - a[i2+undx[j]*m] ) );
++      }
++      if ( diff <= tol )
++      {
++        unique = false;
++        break;
++      }
++    }
++    if ( unique )
++    {
++      k = k + 1;
++      undx[k] = indx[i];
++    }
++  }
++  delete [] indx;
++  delete [] undx;
++
++  k = k + 1;
++
++  return k;
++}
++//****************************************************************************80
++
++void r8col_undex ( int x_dim, int x_num, double x_val[], int x_unique_num,
++  double tol, int undx[], int xdnu[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_UNDEX returns unique sorted indexes for an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8's, regarded as an array of N columns,
++//    each of length M.
++//
++//    The goal of this routine is to determine a vector UNDX,
++//    which points to the unique elements of X, in sorted order,
++//    and a vector XDNU, which identifies, for each entry of X, the index of
++//    the unique sorted element of X.
++//
++//    This is all done with index vectors, so that the elements of
++//    X are never moved.
++//
++//    The first step of the algorithm requires the indexed sorting
++//    of X, which creates arrays INDX and XDNI.  (If all the entries
++//    of X are unique, then these arrays are the same as UNDX and XDNU.)
++//
++//    We then use INDX to examine the entries of X in sorted order,
++//    noting the unique entries, creating the entries of XDNU and
++//    UNDX as we go.
++//
++//    Once this process has been completed, the vector X could be
++//    replaced by a compressed vector XU, containing the unique entries
++//    of X in sorted order, using the formula
++//
++//      XU(*) = X(UNDX(*)).
++//
++//    We could then, if we wished, reconstruct the entire vector X, or
++//    any element of it, by index, as follows:
++//
++//      X(I) = XU(XDNU(I)).
++//
++//    We could then replace X by the combination of XU and XDNU.
++//
++//    Later, when we need the I-th entry of X, we can locate it as
++//    the XDNU(I)-th entry of XU.
++//
++//    Here is an example of a vector X, the sort and inverse sort
++//    index vectors, and the unique sort and inverse unique sort vectors
++//    and the compressed unique sorted vector.
++//
++//      I     X  Indx  Xdni       XU  Undx  Xdnu
++//    ----+-----+-----+-----+--------+-----+-----+
++//      0 | 11.     0     0 |    11.     0     0
++//      1 | 22.     2     4 |    22.     1     1
++//      2 | 11.     5     1 |    33.     3     0
++//      3 | 33.     8     7 |    55.     4     2
++//      4 | 55.     1     8 |                  3
++//      5 | 11.     6     2 |                  0
++//      6 | 22.     7     5 |                  1
++//      7 | 22.     3     6 |                  1
++//      8 | 11.     4     3 |                  0
++//
++//    INDX(2) = 3 means that sorted item(2) is X(3).
++//    XDNI(2) = 5 means that X(2) is sorted item(5).
++//
++//    UNDX(3) = 4 means that unique sorted item(3) is at X(4).
++//    XDNU(8) = 2 means that X(8) is at unique sorted item(2).
++//
++//    XU(XDNU(I))) = X(I).
++//    XU(I)        = X(UNDX(I)).
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    02 November 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int X_DIM, the dimension of the data values.
++//    (the number of rows in the R8COL).
++//
++//    Input, int X_NUM, the number of data values,
++//    (the number of columns in the R8COL).
++//
++//    Input, double X_VAL[X_DIM*X_NUM], the data values.
++//
++//    Input, int X_UNIQUE_NUM, the number of unique values in X_VAL.
++//    This value is only required for languages in which the size of
++//    UNDX must be known in advance.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Output, int UNDX[X_UNIQUE_NUM], the UNDX vector.
++//
++//    Output, int XDNU[X_NUM], the XDNU vector.
++//
++{
++  double diff;
++  int i;
++  int *indx;
++  int j;
++  int k;
++//
++//  Implicitly sort the array.
++//
++  indx = webbur::r8col_sort_heap_index_a ( x_dim, x_num, x_val );
++//
++//  Walk through the implicitly sorted array X.
++//
++  i = 0;
++
++  j = 0;
++  undx[j] = indx[i];
++
++  xdnu[indx[i]] = j;
++
++  for ( i = 1; i < x_num; i++ )
++  {
++    diff = 0.0;
++    for ( k = 0; k < x_dim; k++ )
++    {
++      diff = r8_max ( diff,
++        webbur::r8_abs ( x_val[k+indx[i]*x_dim] - x_val[k+undx[j]*x_dim] ) );
++    }
++    if ( tol < diff )
++    {
++      j = j + 1;
++      undx[j] = indx[i];
++    }
++    xdnu[indx[i]] = j;
++  }
++  delete [] indx;
++
++  return;
++}
++//****************************************************************************80
++
++void r8col_unique_index ( int m, int n, double a[], double tol,
++  int unique_index[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8COL_UNIQUE_INDEX indexes the first occurrence of values in an R8COL.
++//
++//  Discussion:
++//
++//    An R8COL is an M by N array of R8 values.
++//    It is regarded as an array of N columns of length M.
++//
++//    For element A(1:M,J) of the matrix, UNIQUE_INDEX(J) is the uniqueness
++//   index of A(1:M,J).  That is, if A_UNIQUE contains the unique elements
++//    of A, gathered in order, then
++//
++//      A_UNIQUE ( 1:M, UNIQUE_INDEX(J) ) = A(1:M,J)
++//
++//    The user must preallocate space for the output array UNIQUE_INDEX.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    24 November 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns of A.
++//    The length of an "element" of A, and the number of "elements".
++//
++//    Input, double A[M*N], the array.
++//
++//    Input, double TOL, a tolerance for equality.
++//
++//    Output, int UNIQUE_INDEX[N], the unique index.
++//
++{
++  double diff;
++  int i;
++  int j1;
++  int j2;
++  int unique_num;
++
++  for ( j1 = 0; j1 < n; j1++ )
++  {
++    unique_index[j1] = -1;
++  }
++  unique_num = 0;
++
++  for ( j1 = 0; j1 < n; j1++ )
++  {
++    if ( unique_index[j1] == -1 )
++    {
++      unique_index[j1] = unique_num;
++
++      for ( j2 = j1 + 1; j2 < n; j2++ )
++      {
++        diff = 0.0;
++        for ( i = 0; i < m; i++ )
++        {
++          diff = webbur::r8_max ( diff,
++            webbur::r8_abs ( a[i+j1*m] - a[i+j2*m] ) );
++        }
++        if ( diff <= tol )
++        {
++          unique_index[j2] = unique_num;
++        }
++      }
++      unique_num = unique_num + 1;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++void r8mat_transpose_print ( int m, int n, double a[], std::string title )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
++//
++//  Discussion:
++//
++//    An R8MAT is a doubly dimensioned array of R8 values, stored as a vector
++//    in column-major order.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    10 September 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input, double A[M*N], an M by N matrix to be printed.
++//
++//    Input, string TITLE, a title.
++//
++{
++  r8mat_transpose_print_some ( m, n, a, 1, 1, m, n, title );
++
++  return;
++}
++//****************************************************************************80
++
++void r8mat_transpose_print_some ( int m, int n, double a[], int ilo, int jlo,
++  int ihi, int jhi, std::string title )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
++//
++//  Discussion:
++//
++//    An R8MAT is a doubly dimensioned array of R8 values, stored as a vector
++//    in column-major order.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    10 September 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int M, N, the number of rows and columns.
++//
++//    Input, double A[M*N], an M by N matrix to be printed.
++//
++//    Input, int ILO, JLO, the first row and column to print.
++//
++//    Input, int IHI, JHI, the last row and column to print.
++//
++//    Input, string TITLE, a title.
++//
++{
++# define INCX 5
++
++  int i;
++  int i2;
++  int i2hi;
++  int i2lo;
++  int inc;
++  int j;
++  int j2hi;
++  int j2lo;
++
++  std::cout << "\n";
++  std::cout << title << "\n";
++
++  for ( i2lo = i4_max ( ilo, 1 ); i2lo <= i4_min ( ihi, m ); i2lo = i2lo + INCX )
++  {
++    i2hi = i2lo + INCX - 1;
++    i2hi = i4_min ( i2hi, m );
++    i2hi = i4_min ( i2hi, ihi );
++
++    inc = i2hi + 1 - i2lo;
++
++    std::cout << "\n";
++    std::cout << "  Row: ";
++    for ( i = i2lo; i <= i2hi; i++ )
++    {
++      std::cout << std::setw(7) << i - 1 << "       ";
++    }
++    std::cout << "\n";
++    std::cout << "  Col\n";
++    std::cout << "\n";
++
++    j2lo = i4_max ( jlo, 1 );
++    j2hi = i4_min ( jhi, n );
++
++    for ( j = j2lo; j <= j2hi; j++ )
++    {
++      std::cout << std::setw(5) << j - 1 << ":";
++      for ( i2 = 1; i2 <= inc; i2++ )
++      {
++        i = i2lo - 1 + i2;
++        std::cout << std::setw(14) << a[(i-1)+(j-1)*m];
++      }
++      std::cout << "\n";
++    }
++  }
++
++  return;
++# undef INCX
++}
++//****************************************************************************80
++
++void r8mat_write ( std::string output_filename, int m, int n, double table[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8MAT_WRITE writes an R8MAT file.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    11 August 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, string OUTPUT_FILENAME, the output filename.
++//
++//    Input, int M, the spatial dimension.
++//
++//    Input, int N, the number of points.
++//
++//    Input, double TABLE[M*N], the table data.
++//
++{
++  int i;
++  int j;
++  std::ofstream output;
++//
++//  Open the file.
++//
++  output.open ( output_filename.c_str ( ) );
++
++  if ( !output )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8MAT_WRITE - Fatal error!\n";
++    std::cerr << "  Could not open the output file.\n";
++    return;
++  }
++//
++//  Write the data.
++//
++  for ( j = 0; j < n; j++ )
++  {
++    for ( i = 0; i < m; i++ )
++    {
++      output << "  " << std::setw(24) << std::setprecision(16) << table[i+j*m];
++    }
++    output << "\n";
++  }
++//
++//  Close the file.
++//
++  output.close ( );
++
++  return;
++}
++//****************************************************************************80
++
++double r8poly_ant_val ( int n, double poly_cof[], double xval )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8POLY_ANT_VAL evaluates the antiderivative of an R8POLY in standard form.
++//
++//  Discussion:
++//
++//    The constant term of the antiderivative is taken to be zero.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 June 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the order of the polynomial.
++//
++//    Input, double POLY_COF[N], the polynomial coefficients.  POLY_COF[0]
++//    is the constant term, and POLY_COF[N-1] is the coefficient of X**(N-1).
++//
++//    Input, double XVAL, the point where the antiderivative is to be
++//    evaluated.
++//
++//    Output, double R8POLY_ANT_VAL, the value of the antiderivative of the polynomial
++//    at XVAL.
++//
++{
++  int i;
++  double value;
++
++  value = 0.0;
++
++  for ( i = n - 1; 0 <= i; i-- )
++  {
++    value = ( value + poly_cof[i] / ( double ) ( i + 1 ) ) * xval;
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++double *r8vec_chebyshev_new ( int n, double a_first, double a_last )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_CHEBYSHEV_NEW creates a vector of Chebyshev spaced values.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    08 June 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input, double A_FIRST, A_LAST, the first and last entries.
++//
++//    Output, double R8VEC_CHEBYSHEV_NEW[N], a vector of Chebyshev spaced data.
++//
++{
++  double *a;
++  double c;
++  int i;
++  double pi = 3.141592653589793;
++  double theta;
++
++  a = new double[n];
++
++  if ( n == 1 )
++  {
++    a[0] = ( a_first + a_last ) / 2.0;
++  }
++  else
++  {
++    for ( i = 0; i < n; i++ )
++    {
++      theta = ( double ) ( n - i - 1 ) * pi / ( double ) ( n - 1 );
++
++      c = std::cos ( theta );
++
++      if ( ( n % 2 ) == 1 )
++      {
++        if ( 2 * i + 1 == n )
++        {
++          c = 0.0;
++        }
++      }
++
++      a[i] = ( ( 1.0 - c ) * a_first
++             + ( 1.0 + c ) * a_last )
++             /   2.0;
++    }
++  }
++  return a;
++}
++//****************************************************************************80
++
++int r8vec_compare ( int n, double a[], double b[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_COMPARE compares two R8VEC's.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    The lexicographic ordering is used.
++//
++//  Example:
++//
++//    Input:
++//
++//      A1 = ( 2.0, 6.0, 2.0 )
++//      A2 = ( 2.0, 8.0, 12.0 )
++//
++//    Output:
++//
++//      ISGN = -1
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    23 September 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input, double A[N], B[N], the vectors to be compared.
++//
++//    Output, int R8VEC_COMPARE, the results of the comparison:
++//    -1, A is lexicographically less than B,
++//     0, A is equal to B,
++//    +1, A is lexicographically greater than B.
++//
++{
++  int isgn;
++  int k;
++
++  isgn = 0;
++
++  for ( k = 0; k < n; k++ )
++  {
++    if ( a[k] < b[k] )
++    {
++      isgn = -1;
++      return isgn;
++    }
++    else if ( b[k] < a[k] )
++    {
++      isgn = +1;
++      return isgn;
++    }
++  }
++  return isgn;
++}
++//****************************************************************************80
++
++void r8vec_copy ( int n, double a1[], double a2[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_COPY copies an R8VEC.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    03 July 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input, double A1[N], the vector to be copied.
++//
++//    Output, double A2[N], the copy of A1.
++//
++{
++  int i;
++
++  for ( i = 0; i < n; i++ )
++  {
++    a2[i] = a1[i];
++  }
++  return;
++}
++//****************************************************************************80
++
++double *r8vec_copy_new ( int n, double a1[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_COPY_NEW copies an R8VEC to a "new" R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    03 July 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input, double A1[N], the vector to be copied.
++//
++//    Output, double R8VEC_COPY_NEW[N], the copy of A1.
++//
++{
++  double *a2;
++  int i;
++
++  a2 = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    a2[i] = a1[i];
++  }
++  return a2;
++}
++//****************************************************************************80
++
++double r8vec_diff_norm_li ( int n, double a[], double b[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_DIFF_NORM_LI returns the L-oo norm of the difference of R8VEC's.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    The vector L-oo norm is defined as:
++//
++//      R8VEC_NORM_LI = max ( 1 <= I <= N ) abs ( A(I) ).
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    02 April 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in A.
++//
++//    Input, double A[N], B[N], the vectors.
++//
++//    Output, double R8VEC_DIFF_NORM_LI, the L-oo norm of A - B.
++//
++{
++  int i;
++  double value;
++
++  value = 0.0;
++
++  for ( i = 0; i < n; i++ )
++  {
++    value = webbur::r8_max ( value, webbur::r8_abs ( a[i] - b[i] ) );
++  }
++  return value;
++}
++//****************************************************************************80
++
++void r8vec_direct_product2 ( int factor_index, int factor_order,
++  double factor_value[], int factor_num, int point_num, double w[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_DIRECT_PRODUCT2 creates a direct product of R8VEC's.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    To explain what is going on here, suppose we had to construct
++//    a multidimensional quadrature rule as the product of K rules
++//    for 1D quadrature.
++//
++//    The product rule will be represented as a list of points and weights.
++//
++//    The J-th item in the product rule will be associated with
++//      item J1 of 1D rule 1,
++//      item J2 of 1D rule 2,
++//      ...,
++//      item JK of 1D rule K.
++//
++//    In particular,
++//      X(J) = ( X(1,J1), X(2,J2), ..., X(K,JK))
++//    and
++//      W(J) = W(1,J1) * W(2,J2) * ... * W(K,JK)
++//
++//    So we can construct the quadrature rule if we can properly
++//    distribute the information in the 1D quadrature rules.
++//
++//    This routine carries out that task for the weights W.
++//
++//    Another way to do this would be to compute, one by one, the
++//    set of all possible indices (J1,J2,...,JK), and then index
++//    the appropriate information.  An advantage of the method shown
++//    here is that you can process the K-th set of information and
++//    then discard it.
++//
++//  Example:
++//
++//    Rule 1:
++//      Order = 4
++//      W(1:4) = ( 2, 3, 5, 7 )
++//
++//    Rule 2:
++//      Order = 3
++//      W(1:3) = ( 11, 13, 17 )
++//
++//    Rule 3:
++//      Order = 2
++//      W(1:2) = ( 19, 23 )
++//
++//    Product Rule:
++//      Order = 24
++//      W(1:24) =
++//        ( 2 * 11 * 19 )
++//        ( 3 * 11 * 19 )
++//        ( 4 * 11 * 19 )
++//        ( 7 * 11 * 19 )
++//        ( 2 * 13 * 19 )
++//        ( 3 * 13 * 19 )
++//        ( 5 * 13 * 19 )
++//        ( 7 * 13 * 19 )
++//        ( 2 * 17 * 19 )
++//        ( 3 * 17 * 19 )
++//        ( 5 * 17 * 19 )
++//        ( 7 * 17 * 19 )
++//        ( 2 * 11 * 23 )
++//        ( 3 * 11 * 23 )
++//        ( 5 * 11 * 23 )
++//        ( 7 * 11 * 23 )
++//        ( 2 * 13 * 23 )
++//        ( 3 * 13 * 23 )
++//        ( 5 * 13 * 23 )
++//        ( 7 * 13 * 23 )
++//        ( 2 * 17 * 23 )
++//        ( 3 * 17 * 23 )
++//        ( 5 * 17 * 23 )
++//        ( 7 * 17 * 23 )
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 April 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int FACTOR_INDEX, the index of the factor being processed.
++//    The first factor processed must be factor 0.
++//
++//    Input, int FACTOR_ORDER, the order of the factor.
++//
++//    Input, double FACTOR_VALUE[FACTOR_ORDER], the factor values for
++//    factor FACTOR_INDEX.
++//
++//    Input, int FACTOR_NUM, the number of factors.
++//
++//    Input, int POINT_NUM, the number of elements in the direct product.
++//
++//    Input/output, double W[POINT_NUM], the elements of the
++//    direct product, which are built up gradually.
++//
++//  Local Parameters:
++//
++//    Local, integer START, the first location of a block of values to set.
++//
++//    Local, integer CONTIG, the number of consecutive values to set.
++//
++//    Local, integer SKIP, the distance from the current value of START
++//    to the next location of a block of values to set.
++//
++//    Local, integer REP, the number of blocks of values to set.
++//
++{
++  static int contig = 0;
++  int i;
++  int j;
++  int k;
++  static int rep = 0;
++  static int skip = 0;
++  int start;
++
++  if ( factor_index == 0 )
++  {
++    contig = 1;
++    skip = 1;
++    rep = point_num;
++    for ( i = 0; i < point_num; i++ )
++    {
++      w[i] = 1.0;
++    }
++  }
++
++  rep = rep / factor_order;
++  skip = skip * factor_order;
++
++  for ( j = 0; j < factor_order; j++ )
++  {
++    start = 0 + j * contig;
++
++    for ( k = 1; k <= rep; k++ )
++    {
++      for ( i = start; i < start + contig; i++ )
++      {
++        w[i] = w[i] * factor_value[j];
++      }
++      start = start + skip;
++    }
++  }
++
++  contig = contig * factor_order;
++
++  return;
++}
++//****************************************************************************80
++
++double r8vec_dot_product ( int n, double a1[], double a2[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_DOT_PRODUCT computes the dot product of a pair of R8VEC's.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    03 July 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input, double A1[N], A2[N], the two vectors to be considered.
++//
++//    Output, double R8VEC_DOT_PRODUCT, the dot product of the vectors.
++//
++{
++  int i;
++  double value;
++
++  value = 0.0;
++  for ( i = 0; i < n; i++ )
++  {
++    value = value + a1[i] * a2[i];
++  }
++  return value;
++}
++//****************************************************************************80
++
++double r8vec_i4vec_dot_product ( int n, double r8vec[], int i4vec[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_I4VEC_DOT_PRODUCT computes the dot product of an R8VEC and an I4VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    An I4VEC is a vector of I4's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    30 June 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input, double R8VEC[N], the first vector.
++//
++//    Input, int I4VEC[N], the second vector.
++//
++//    Output, double R8VEC_I4VEC_DOT_PRODUCT, the dot product of the vectors.
++//
++{
++  int i;
++  double value;
++
++  value = 0.0;
++  for ( i = 0; i < n; i++ )
++  {
++    value = value + r8vec[i] * ( double ) ( i4vec[i] );
++  }
++  return value;
++}
++//****************************************************************************80
++
++void r8vec_index_sorted_range ( int n, double r[], int indx[], double r_lo,
++  double r_hi, int *i_lo, int *i_hi )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_INDEX_SORTED_RANGE: search index sorted vector for elements in a range.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    27 September 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of items in the vector.
++//
++//    Input, double R[N], the index sorted vector.
++//
++//    Input, int INDX[N], the vector used to sort R.
++//    The vector R[INDX[*]] is sorted.
++//
++//    Input, double R_LO, R_HI, the limits of the range.
++//
++//    Output, int *I_LO, *I_HI, the range of indices
++//    so that I_LO <= I <= I_HI => R_LO <= R[INDX[I]] <= R_HI.  If no
++//    values in R lie in the range, then I_HI < I_LO will be returned.
++//
++{
++  int i1;
++  int i2;
++  int j1;
++  int j2;
++//
++//  Cases we can handle immediately.
++//
++  if ( r[indx[n-1]] < r_lo )
++  {
++    *i_lo = n;
++    *i_hi = n - 1;
++    return;
++  }
++
++  if ( r_hi < r[indx[0]] )
++  {
++    *i_lo = 0;
++    *i_hi = -1;
++    return;
++  }
++//
++//  Are there are least two intervals?
++//
++  if ( n == 1 )
++  {
++    if ( r_lo <= r[indx[0]] && r[indx[0]] <= r_hi )
++    {
++      *i_lo = 0;
++      *i_hi = 0;
++    }
++    else
++    {
++      *i_lo = -1;
++      *i_hi = -2;
++    }
++    return;
++  }
++//
++//  Bracket R_LO.
++//
++  if ( r_lo <= r[indx[0]] )
++  {
++    *i_lo = 0;
++  }
++  else
++  {
++//
++//  R_LO is in one of the intervals spanned by R(INDX(J1)) to R(INDX(J2)).
++//  Examine the intermediate interval [R(INDX(I1)), R(INDX(I1+1))].
++//  Does R_LO lie here, or below or above?
++//
++    j1 = 0;
++    j2 = n - 1;
++    i1 = ( j1 + j2 - 1 ) / 2;
++    i2 = i1 + 1;
++
++    for ( ; ; )
++    {
++      if ( r_lo < r[indx[i1]] )
++      {
++        j2 = i1;
++        i1 = ( j1 + j2 - 1 ) / 2;
++        i2 = i1 + 1;
++      }
++      else if ( r[indx[i2]] < r_lo )
++      {
++        j1 = i2;
++        i1 = ( j1 + j2 - 1 ) / 2;
++        i2 = i1 + 1;
++      }
++      else
++      {
++        *i_lo = i1;
++        break;
++      }
++    }
++  }
++//
++//  Bracket R_HI.
++//
++  if ( r[indx[n-1]] <= r_hi )
++  {
++    *i_hi = n - 1;
++  }
++  else
++  {
++    j1 = *i_lo;
++    j2 = n - 1;
++    i1 = ( j1 + j2 - 1 ) / 2;
++    i2 = i1 + 1;
++
++    for ( ; ; )
++    {
++      if ( r_hi < r[indx[i1]] )
++      {
++        j2 = i1;
++        i1 = ( j1 + j2 - 1 ) / 2;
++        i2 = i1 + 1;
++      }
++      else if ( r[indx[i2]] < r_hi )
++      {
++        j1 = i2;
++        i1 = ( j1 + j2 - 1 ) / 2;
++        i2 = i1 + 1;
++      }
++      else
++      {
++        *i_hi = i2;
++        break;
++      }
++    }
++  }
++//
++//  We expect to have computed the largest I_LO and smallest I_HI such that
++//    R(INDX(I_LO)) <= R_LO <= R_HI <= R(INDX(I_HI))
++//  but what we want is actually
++//    R_LO <= R(INDX(I_LO)) <= R(INDX(I_HI)) <= R_HI
++//  which we can usually get simply by incrementing I_LO and decrementing I_HI.
++//
++  if ( r[indx[*i_lo]] < r_lo )
++  {
++    *i_lo = *i_lo + 1;
++    if ( n - 1 < *i_lo )
++    {
++      *i_hi = *i_lo - 1;
++    }
++  }
++
++  if ( r_hi < r[indx[*i_hi]] )
++  {
++    *i_hi = *i_hi - 1;
++    if ( *i_hi < 0 )
++    {
++      *i_lo = *i_hi + 1;
++    }
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void r8vec_indexed_heap_d ( int n, double a[], int indx[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_INDEXED_HEAP_D creates a descending heap from an indexed R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
++//    each referencing an entry of the data vector.
++//
++//    The function adjusts the index vector INDX so that, for 1 <= J <= N/2,
++//    we have:
++//      A[INDX[2*J+1]]   <= A[INDX[J]]
++//    and
++//      A[INDX[2*J+2]] <= A[INDX[J]]
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 August 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Albert Nijenhuis, Herbert Wilf,
++//    Combinatorial Algorithms for Computers and Calculators,
++//    Academic Press, 1978,
++//    ISBN: 0-12-519260-6,
++//    LC: QA164.N54.
++//
++//  Parameters:
++//
++//    Input, int N, the size of the index array.
++//
++//    Input, double A[*], the data vector.
++//
++//    Input/output, int INDX[N], the index array.
++//    Each entry of INDX must be a valid index for the array A.
++//    On output, the indices have been reordered into a descending heap.
++//
++{
++  int i;
++  int ifree;
++  int key;
++  int m;
++//
++//  Only nodes N/2 - 1 down to 0 can be "parent" nodes.
++//
++  for ( i = ( n / 2 ) - 1; 0 <= i; i-- )
++  {
++//
++//  Copy the value out of the parent node.
++//  Position IFREE is now "open".
++//
++    key = indx[i];
++    ifree = i;
++
++    for ( ; ; )
++    {
++//
++//  Positions 2*IFREE+1 and 2*IFREE+2 are the descendants of position
++//  IFREE.  (One or both may not exist because they exceed N-1.)
++//
++      m = 2 * ifree + 1;
++//
++//  Does the first position exist?
++//
++      if ( n - 1 < m )
++      {
++        break;
++      }
++//
++//  Does the second position exist?
++//
++      if ( m + 1 <= n - 1 )
++      {
++//
++//  If both positions exist, take the larger of the two values,
++//  and update M if necessary.
++//
++        if ( a[indx[m]] < a[indx[m+1]] )
++        {
++          m = m + 1;
++        }
++      }
++//
++//  If the large descendant is larger than KEY, move it up,
++//  and update IFREE, the location of the free position, and
++//  consider the descendants of THIS position.
++//
++      if ( a[indx[m]] <= a[key] )
++      {
++        break;
++      }
++
++      indx[ifree] = indx[m];
++      ifree = m;
++    }
++//
++//  Once there is no more shifting to do, KEY moves into the free spot IFREE.
++//
++    indx[ifree] = key;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++int r8vec_indexed_heap_d_extract ( int *n, double a[], int indx[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_INDEXED_HEAP_D_EXTRACT: extract from heap descending indexed R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
++//    each referencing an entry of the data vector.
++//
++//    The routine finds the maximum value in the heap, returns that value to the
++//    user, deletes that value from the heap, and restores the heap to its
++//    proper form.
++//
++//    Note that the argument N must be a variable, which will be decremented
++//    before return, and that INDX will hold one less value on output than it
++//    held on input.
++//
++//    This is one of three functions needed to model a priority queue.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 August 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
++//    Introduction to Algorithms,
++//    MIT Press, 2001,
++//    ISBN: 0262032937,
++//    LC: QA76.C662.
++//
++//  Parameters:
++//
++//    Input/output, int *N, the number of items in the index vector.
++//
++//    Input, double A[*], the data vector.
++//
++//    Input/output, int INDX[N], the index vector.
++//
++//    Output, int R8VEC_INDEXED_HEAP_D_EXTRACT, the index in A of the item of
++//    maximum value, which has now been removed from the heap.
++//
++{
++  int indx_extract;
++
++  if ( *n < 1 )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8VEC_INDEXED_HEAP_D_EXTRACT - Fatal error!\n";
++    std::cerr << "  The heap is empty.\n";
++    std::exit ( 1 );
++  }
++//
++//  Get the index of the maximum value.
++//
++  indx_extract = indx[0];
++
++  if ( *n == 1 )
++  {
++    *n = 0;
++    return indx_extract;
++  }
++//
++//  Shift the last index down.
++//
++  indx[0] = indx[*n-1];
++//
++//  Restore the heap structure.
++//
++  *n = *n - 1;
++  webbur::r8vec_indexed_heap_d ( *n, a, indx );
++
++  return indx_extract;
++}
++//****************************************************************************80
++
++void r8vec_indexed_heap_d_insert ( int *n, double a[], int indx[],
++  int indx_insert )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_INDEXED_HEAP_D_INSERT: insert value into heap descending indexed R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
++//    each referencing an entry of the data vector.
++//
++//    Note that the argument N must be a variable, and will be incremented before
++//    return, and that INDX must be able to hold one more entry on output than
++//    it held on input.
++//
++//    This is one of three functions needed to model a priority queue.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 August 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
++//    Introduction to Algorithms,
++//    MIT Press, 2001,
++//    ISBN: 0262032937,
++//    LC: QA76.C662.
++//
++//  Parameters:
++//
++//    Input/output, int *N, the number of items in the index vector.
++//
++//    Input, double A[*], the data vector.
++//
++//    Input/output, int INDX[N], the index vector.
++//
++//    Input, int INDX_INSERT, the index in A of the value
++//    to be inserted into the heap.
++//
++{
++  int i;
++  int parent;
++
++  *n = *n + 1;
++  i = *n - 1;
++
++  while ( 0 < i )
++  {
++    parent = ( i - 1 ) / 2;
++
++    if ( a[indx_insert] <= a[indx[parent]] )
++    {
++      break;
++    }
++
++    indx[i] = indx[parent];
++    i = parent;
++  }
++
++  indx[i] = indx_insert;
++
++  return;
++}
++//****************************************************************************80
++
++int r8vec_indexed_heap_d_max ( int n, double a[], int indx[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_INDEXED_HEAP_D_MAX: maximum value in heap descending indexed R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    An indexed R8VEC is an R8VEC of data values, and an R8VEC of N indices,
++//    each referencing an entry of the data vector.
++//
++//    This is one of three functions needed to model a priority queue.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    18 August 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Thomas Cormen, Charles Leiserson, Ronald Rivest,
++//    Introduction to Algorithms,
++//    MIT Press, 2001,
++//    ISBN: 0262032937,
++//    LC: QA76.C662.
++//
++//  Parameters:
++//
++//    Input, int N, the number of items in the index vector.
++//
++//    Input, double A[*], the data vector.
++//
++//    Input, int INDX[N], the index vector.
++//
++//    Output, int R8VEC_INDEXED_HEAP_D_MAX, the index in A of the maximum value
++//    in the heap.
++//
++{
++  int indx_max;
++
++  indx_max = indx[0];
++
++  return indx_max;
++}
++//****************************************************************************80
++
++double *r8vec_legendre_new ( int n, double a_first, double a_last )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_LEGENDRE_NEW creates a vector of Chebyshev spaced values.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    17 June 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input, double A_FIRST, A_LAST, the first and last entries.
++//
++//    Output, double R8VEC_LEGENDRE_NEW[N], a vector of Legendre spaced data.
++//
++{
++  double *a;
++  int i;
++
++  a = webbur::legendre_zeros ( n );
++
++  for ( i = 0; i < n; i++ )
++  {
++    a[i] = ( ( 1.0 - a[i] ) * a_first
++           + ( 1.0 + a[i] ) * a_last )
++           /   2.0;
++  }
++  return a;
++}
++//****************************************************************************80
++
++double *r8vec_linspace_new ( int n, double a_first, double a_last )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_LINSPACE_NEW creates a vector of linearly spaced values.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    14 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input, double A_FIRST, A_LAST, the first and last entries.
++//
++//    Output, double R8VEC_LINSPACE_NEW[N], a vector of linearly spaced data.
++//
++{
++  double *a;
++  int i;
++
++  a = new double[n];
++
++  if ( n == 1 )
++  {
++    a[0] = ( a_first + a_last ) / 2.0;
++  }
++  else
++  {
++    for ( i = 0; i < n; i++ )
++    {
++      a[i] = ( ( double ) ( n - 1 - i ) * a_first
++             + ( double ) (         i ) * a_last )
++             / ( double ) ( n - 1     );
++    }
++  }
++  return a;
++}
++//****************************************************************************80
++
++double r8vec_min ( int n, double r8vec[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_MIN returns the value of the minimum element in an R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    02 July 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the array.
++//
++//    Input, double R8VEC[N], the array to be checked.
++//
++//    Output, double R8VEC_MIN, the value of the minimum element.
++//
++{
++  int i;
++  double value;
++
++  value = r8vec[0];
++
++  for ( i = 1; i < n; i++ )
++  {
++    if ( r8vec[i] < value )
++    {
++      value = r8vec[i];
++    }
++  }
++  return value;
++}
++//****************************************************************************80
++
++double r8vec_min_pos ( int n, double a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_MIN_POS returns the minimum positive value of an R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    08 November 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries.
++//
++//    Input, double A[N], the array.
++//
++//    Output, double R8VEC_MIN_POS, the smallest positive entry,
++//    or R8_HUGE if no entry is positive.
++//
++{
++  int i;
++  double r8_huge = 1.0E+30;
++  double value;
++
++  value = r8_huge;
++
++  for ( i = 0; i < n; i++ )
++  {
++    if ( 0.0 < a[i] )
++    {
++      if ( a[i] < value )
++      {
++        value = a[i];
++      }
++    }
++  }
++  return value;
++}
++//****************************************************************************80
++
++void r8vec_print ( int n, double a[], std::string title )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_PRINT prints an R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    16 August 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of components of the vector.
++//
++//    Input, double A[N], the vector to be printed.
++//
++//    Input, string TITLE, a title.
++//
++{
++  int i;
++
++  std::cout << "\n";
++  std::cout << title << "\n";
++  std::cout << "\n";
++  for ( i = 0; i < n; i++ )
++  {
++    std::cout << "  " << std::setw(8)  << i
++              << ": " << std::setw(14) << a[i]  << "\n";
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void r8vec_scale ( double s, int n, double a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_SCALE multiples an R8VEC by a scale factor.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    22 September 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, double S, the scale factor.
++//
++//    Input, int N, the number of entries in the vectors.
++//
++//    Input/output, double A[N], the vector to be scaled.
++//    On output, A[] = S * A[].
++//
++{
++  int i;
++
++  for ( i = 0; i < n; i++ )
++  {
++    a[i] = s * a[i];
++  }
++  return;
++}
++//****************************************************************************80
++
++void r8vec_sort_heap_index_a ( int n, double a[], int indx[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R8VEC
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    The sorting is not actually carried out.  Rather an index array is
++//    created which defines the sorting.  This array may be used to sort
++//    or index the array, or to sort or index related arrays keyed on the
++//    original array.
++//
++//    Once the index array is computed, the sorting can be carried out
++//    "implicitly:
++//
++//      a(indx(*))
++//
++//    or explicitly, by the call
++//
++//      r8vec_permute ( n, indx, 0, a )
++//
++//    after which a(*) is sorted.
++//
++//    Note that the index vector is 0-based.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    02 October 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the array.
++//
++//    Input, double A[N], an array to be index-sorted.
++//
++//    Output, int INDX[N], contains the sort index.  The
++//    I-th element of the sorted array is A(INDX(I)).
++//
++{
++  double aval;
++  int i;
++  int indxt;
++  int ir;
++  int j;
++  int l;
++
++  if ( n < 1 )
++  {
++    return;
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    indx[i] = i;
++  }
++
++  if ( n == 1 )
++  {
++    return;
++  }
++
++  l = n / 2 + 1;
++  ir = n;
++
++  for ( ; ; )
++  {
++    if ( 1 < l )
++    {
++      l = l - 1;
++      indxt = indx[l-1];
++      aval = a[indxt];
++    }
++    else
++    {
++      indxt = indx[ir-1];
++      aval = a[indxt];
++      indx[ir-1] = indx[0];
++      ir = ir - 1;
++
++      if ( ir == 1 )
++      {
++        indx[0] = indxt;
++        break;
++      }
++    }
++
++    i = l;
++    j = l + l;
++
++    while ( j <= ir )
++    {
++      if ( j < ir )
++      {
++        if ( a[indx[j-1]] < a[indx[j]] )
++        {
++          j = j + 1;
++        }
++      }
++
++      if ( aval < a[indx[j-1]] )
++      {
++        indx[i-1] = indx[j-1];
++        i = j;
++        j = j + j;
++      }
++      else
++      {
++        j = ir + 1;
++      }
++    }
++    indx[i-1] = indxt;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++int *r8vec_sort_heap_index_a_new ( int n, double a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_SORT_HEAP_INDEX_A_NEW does an indexed heap ascending sort of an R8VEC
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    The sorting is not actually carried out.  Rather an index array is
++//    created which defines the sorting.  This array may be used to sort
++//    or index the array, or to sort or index related arrays keyed on the
++//    original array.
++//
++//    Once the index array is computed, the sorting can be carried out
++//    "implicitly:
++//
++//      a(indx(*))
++//
++//    or explicitly, by the call
++//
++//      r8vec_permute ( n, indx, 0, a )
++//
++//    after which a(*) is sorted.
++//
++//    Note that the index vector is 0-based.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    02 October 2010
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the array.
++//
++//    Input, double A[N], an array to be index-sorted.
++//
++//    Output, int R8VEC_SORT_HEAP_INDEX_A_NEW[N], contains the sort index.  The
++//    I-th element of the sorted array is A(INDX(I)).
++//
++{
++  double aval;
++  int i;
++  int *indx;
++  int indxt;
++  int ir;
++  int j;
++  int l;
++
++  if ( n < 1 )
++  {
++    return NULL;
++  }
++
++  indx = new int[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    indx[i] = i;
++  }
++
++  if ( n == 1 )
++  {
++    return indx;
++  }
++
++  l = n / 2 + 1;
++  ir = n;
++
++  for ( ; ; )
++  {
++    if ( 1 < l )
++    {
++      l = l - 1;
++      indxt = indx[l-1];
++      aval = a[indxt];
++    }
++    else
++    {
++      indxt = indx[ir-1];
++      aval = a[indxt];
++      indx[ir-1] = indx[0];
++      ir = ir - 1;
++
++      if ( ir == 1 )
++      {
++        indx[0] = indxt;
++        break;
++      }
++    }
++
++    i = l;
++    j = l + l;
++
++    while ( j <= ir )
++    {
++      if ( j < ir )
++      {
++        if ( a[indx[j-1]] < a[indx[j]] )
++        {
++          j = j + 1;
++        }
++      }
++
++      if ( aval < a[indx[j-1]] )
++      {
++        indx[i-1] = indx[j-1];
++        i = j;
++        j = j + j;
++      }
++      else
++      {
++        j = ir + 1;
++      }
++    }
++    indx[i-1] = indxt;
++  }
++
++  return indx;
++}
++//****************************************************************************80
++
++void r8vec_stutter ( int n, double a[], int m, double am[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_STUTTER makes a "stuttering" copy of an R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//    Applying a stuttering factor M of 3, the vector A = ( 1, 5, 8 ) becomes
++//    AM = ( 1, 1, 1, 5, 5, 5, 8, 8, 8 ).
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    28 March 2011
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the size of the input vector.
++//
++//    Input, double A[N], the vector.
++//
++//    Input, int M, the "stuttering factor".
++//
++//    Output, double AM[M*N], the stuttering vector.
++//
++{
++  int i;
++  int j;
++  int k;
++
++  k = 0;
++  for ( i = 0; i < n; i++ )
++  {
++    for ( j = 0; j < m; j++ )
++    {
++      am[k] = a[i];
++      k = k + 1;
++    }
++  }
++  return;
++}
++//****************************************************************************80
++
++double r8vec_sum ( int n, double a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_SUM returns the sum of an R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a double precision vector.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    15 October 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input, double A[N], the vector.
++//
++//    Output, double R8VEC_SUM, the sum of the vector.
++//
++{
++  int i;
++  double value;
++
++  value = 0.0;
++  for ( i = 0; i < n; i++ )
++  {
++    value = value + a[i];
++  }
++
++  return value;
++}
++//****************************************************************************80
++
++void r8vec_uniform_01 ( int n, int *seed, double r[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
++//
++//  Discussion:
++//
++//    This routine implements the recursion
++//
++//      seed = ( 16807 * seed ) mod ( 2^31 - 1 )
++//      u = seed / ( 2^31 - 1 )
++//
++//    The integer arithmetic never requires more than 32 bits,
++//    including a sign bit.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 August 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Paul Bratley, Bennett Fox, Linus Schrage,
++//    A Guide to Simulation,
++//    Second Edition,
++//    Springer, 1987,
++//    ISBN: 0387964673,
++//    LC: QA76.9.C65.B73.
++//
++//    Bennett Fox,
++//    Algorithm 647:
++//    Implementation and Relative Efficiency of Quasirandom
++//    Sequence Generators,
++//    ACM Transactions on Mathematical Software,
++//    Volume 12, Number 4, December 1986, pages 362-376.
++//
++//    Pierre L'Ecuyer,
++//    Random Number Generation,
++//    in Handbook of Simulation,
++//    edited by Jerry Banks,
++//    Wiley, 1998,
++//    ISBN: 0471134031,
++//    LC: T57.62.H37.
++//
++//    Peter Lewis, Allen Goodman, James Miller,
++//    A Pseudo-Random Number Generator for the System/360,
++//    IBM Systems Journal,
++//    Volume 8, Number 2, 1969, pages 136-143.
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input/output, int *SEED, a seed for the random number generator.
++//
++//    Output, double R[N], the vector of pseudorandom values.
++//
++{
++  int i;
++  int i4_huge = 2147483647;
++  int k;
++
++  if ( *seed == 0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8VEC_UNIFORM_01 - Fatal error!\n";
++    std::cerr << "  Input value of SEED = 0.\n";
++    std::exit ( 1 );
++  }
++
++  for ( i = 0; i < n; i++ )
++  {
++    k = *seed / 127773;
++
++    *seed = 16807 * ( *seed - k * 127773 ) - k * 2836;
++
++    if ( *seed < 0 )
++    {
++      *seed = *seed + i4_huge;
++    }
++
++    r[i] = ( double ) ( *seed ) * 4.656612875E-10;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++double *r8vec_uniform_01_new ( int n, int *seed )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_UNIFORM_01_NEW returns a new unit pseudorandom R8VEC.
++//
++//  Discussion:
++//
++//    This routine implements the recursion
++//
++//      seed = ( 16807 * seed ) mod ( 2^31 - 1 )
++//      u = seed / ( 2^31 - 1 )
++//
++//    The integer arithmetic never requires more than 32 bits,
++//    including a sign bit.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 August 2004
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Reference:
++//
++//    Paul Bratley, Bennett Fox, Linus Schrage,
++//    A Guide to Simulation,
++//    Second Edition,
++//    Springer, 1987,
++//    ISBN: 0387964673,
++//    LC: QA76.9.C65.B73.
++//
++//    Bennett Fox,
++//    Algorithm 647:
++//    Implementation and Relative Efficiency of Quasirandom
++//    Sequence Generators,
++//    ACM Transactions on Mathematical Software,
++//    Volume 12, Number 4, December 1986, pages 362-376.
++//
++//    Pierre L'Ecuyer,
++//    Random Number Generation,
++//    in Handbook of Simulation,
++//    edited by Jerry Banks,
++//    Wiley, 1998,
++//    ISBN: 0471134031,
++//    LC: T57.62.H37.
++//
++//    Peter Lewis, Allen Goodman, James Miller,
++//    A Pseudo-Random Number Generator for the System/360,
++//    IBM Systems Journal,
++//    Volume 8, Number 2, 1969, pages 136-143.
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Input/output, int *SEED, a seed for the random number generator.
++//
++//    Output, double R8VEC_UNIFORM_01_NEW[N], the vector of pseudorandom values.
++//
++{
++  int i;
++  int i4_huge = 2147483647;
++  int k;
++  double *r;
++
++  if ( *seed == 0 )
++  {
++    std::cerr << "\n";
++    std::cerr << "R8VEC_UNIFORM_01_NEW - Fatal error!\n";
++    std::cerr << "  Input value of SEED = 0.\n";
++    std::exit ( 1 );
++  }
++
++  r = new double[n];
++
++  for ( i = 0; i < n; i++ )
++  {
++    k = *seed / 127773;
++
++    *seed = 16807 * ( *seed - k * 127773 ) - k * 2836;
++
++    if ( *seed < 0 )
++    {
++      *seed = *seed + i4_huge;
++    }
++
++    r[i] = ( double ) ( *seed ) * 4.656612875E-10;
++  }
++
++  return r;
++}
++//****************************************************************************80
++
++void r8vec_zero ( int n, double a[] )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    R8VEC_ZERO zeroes an R8VEC.
++//
++//  Discussion:
++//
++//    An R8VEC is a vector of R8's.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    03 July 2005
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int N, the number of entries in the vector.
++//
++//    Output, double A[N], a vector of zeroes.
++//
++{
++  int i;
++
++  for ( i = 0; i < n; i++ )
++  {
++    a[i] = 0.0;
++  }
++  return;
++}
++//****************************************************************************80
++
++void sort_heap_external ( int n, int *indx, int *i, int *j, int isgn )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
++//
++//  Discussion:
++//
++//    The actual list is not passed to the routine.  Hence it may
++//    consist of integers, reals, numbers, names, etc.  The user,
++//    after each return from the routine, will be asked to compare or
++//    interchange two items.
++//
++//    The current version of this code mimics the FORTRAN version,
++//    so the values of I and J, in particular, are FORTRAN indices.
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    05 February 2004
++//
++//  Author:
++//
++//    Original FORTRAN77 version by Albert Nijenhuis, Herbert Wilf.
++//    C++ version by John Burkardt
++//
++//  Reference:
++//
++//    Albert Nijenhuis, Herbert Wilf,
++//    Combinatorial Algorithms,
++//    Academic Press, 1978, second edition,
++//    ISBN 0-12-519260-6.
++//
++//  Parameters:
++//
++//    Input, int N, the length of the input list.
++//
++//    Input/output, int *INDX.
++//    The user must set INDX to 0 before the first call.
++//    On return,
++//      if INDX is greater than 0, the user must interchange
++//      items I and J and recall the routine.
++//      If INDX is less than 0, the user is to compare items I
++//      and J and return in ISGN a negative value if I is to
++//      precede J, and a positive value otherwise.
++//      If INDX is 0, the sorting is done.
++//
++//    Output, int *I, *J.  On return with INDX positive,
++//    elements I and J of the user's list should be
++//    interchanged.  On return with INDX negative, elements I
++//    and J are to be compared by the user.
++//
++//    Input, int ISGN. On return with INDX negative, the
++//    user should compare elements I and J of the list.  If
++//    item I is to precede item J, set ISGN negative,
++//    otherwise set ISGN positive.
++//
++{
++  static int i_save = 0;
++  static int j_save = 0;
++  static int k = 0;
++  static int k1 = 0;
++  static int n1 = 0;
++//
++//  INDX = 0: This is the first call.
++//
++  if ( *indx == 0 )
++  {
++
++    i_save = 0;
++    j_save = 0;
++    k = n / 2;
++    k1 = k;
++    n1 = n;
++  }
++//
++//  INDX < 0: The user is returning the results of a comparison.
++//
++  else if ( *indx < 0 )
++  {
++    if ( *indx == -2 )
++    {
++      if ( isgn < 0 )
++      {
++        i_save = i_save + 1;
++      }
++      j_save = k1;
++      k1 = i_save;
++      *indx = -1;
++      *i = i_save;
++      *j = j_save;
++      return;
++    }
++
++    if ( 0 < isgn )
++    {
++      *indx = 2;
++      *i = i_save;
++      *j = j_save;
++      return;
++    }
++
++    if ( k <= 1 )
++    {
++      if ( n1 == 1 )
++      {
++        i_save = 0;
++        j_save = 0;
++        *indx = 0;
++      }
++      else
++      {
++        i_save = n1;
++        j_save = 1;
++        n1 = n1 - 1;
++        *indx = 1;
++      }
++      *i = i_save;
++      *j = j_save;
++      return;
++    }
++    k = k - 1;
++    k1 = k;
++  }
++//
++//  0 < INDX: the user was asked to make an interchange.
++//
++  else if ( *indx == 1 )
++  {
++    k1 = k;
++  }
++
++  for ( ; ; )
++  {
++
++    i_save = 2 * k1;
++
++    if ( i_save == n1 )
++    {
++      j_save = k1;
++      k1 = i_save;
++      *indx = -1;
++      *i = i_save;
++      *j = j_save;
++      return;
++    }
++    else if ( i_save <= n1 )
++    {
++      j_save = i_save + 1;
++      *indx = -2;
++      *i = i_save;
++      *j = j_save;
++      return;
++    }
++
++    if ( k <= 1 )
++    {
++      break;
++    }
++
++    k = k - 1;
++    k1 = k;
++  }
++
++  if ( n1 == 1 )
++  {
++    i_save = 0;
++    j_save = 0;
++    *indx = 0;
++    *i = i_save;
++    *j = j_save;
++  }
++  else
++  {
++    i_save = n1;
++    j_save = 1;
++    n1 = n1 - 1;
++    *indx = 1;
++    *i = i_save;
++    *j = j_save;
++  }
++
++  return;
++}
++//****************************************************************************80
++
++void timestamp ( )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    TIMESTAMP prints the current YMDHMS date as a time stamp.
++//
++//  Example:
++//
++//    31 May 2001 09:45:54 AM
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    08 July 2009
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    None
++//
++{
++# define TIME_SIZE 40
++
++  static char time_buffer[TIME_SIZE];
++  const struct std::tm *tm_ptr;
++  size_t len;
++  std::time_t now;
++
++  now = std::time ( NULL );
++  tm_ptr = std::localtime ( &now );
++
++  len = std::strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm_ptr );
++
++  std::cout << time_buffer << "\n";
++
++  return;
++# undef TIME_SIZE
++}
++//****************************************************************************80
++
++void vec_colex_next3 ( int dim_num, int base[], int a[], bool *more )
++
++//****************************************************************************80
++//
++//  Purpose:
++//
++//    VEC_COLEX_NEXT3 generates vectors in colex order.
++//
++//  Discussion:
++//
++//    The vectors are produced in colexical order, starting with
++//
++//    (1,        1,        ...,1),
++//    (2,        1,        ...,1),
++//     ...
++//    (BASE(1),  1,        ...,1)
++//
++//    (1,        2,        ...,1)
++//    (2,        2,        ...,1)
++//    ...
++//    (BASE(1),  2,        ...,1)
++//
++//    (1,        3,        ...,1)
++//    (2,        3,        ...,1)
++//    ...
++//    (BASE(1),  BASE(2), ...,BASE(DIM_NUM)).
++//
++//  Example:
++//
++//    DIM_NUM = 2,
++//    BASE = { 3, 3 }
++//
++//    1   1
++//    2   1
++//    3   1
++//    1   2
++//    2   2
++//    3   2
++//    1   3
++//    2   3
++//    3   3
++//
++//  Licensing:
++//
++//    This code is distributed under the GNU LGPL license.
++//
++//  Modified:
++//
++//    19 August 2008
++//
++//  Author:
++//
++//    John Burkardt
++//
++//  Parameters:
++//
++//    Input, int DIM_NUM, the spatial dimension.
++//
++//    Input, int BASE[DIM_NUM], the bases to be used in each dimension.
++//    In dimension I, entries will range from 1 to BASE[I].
++//
++//    Output, int A[DIM_NUM], the next vector.
++//
++//    Input/output, bool *MORE.  Set this variable false before
++//    the first call.  On return, MORE is TRUE if another vector has
++//    been computed.  If MORE is returned FALSE, ignore the output
++//    vector and stop calling the routine.
++//
++{
++  int i;
++
++  if ( !( *more ) )
++  {
++    for ( i = 0; i < dim_num; i++ )
++    {
++      a[i] = 1;
++    }
++    *more = true;
++  }
++  else
++  {
++    for ( i = 0; i < dim_num; i++ )
++    {
++      a[i] = a[i] + 1;
++
++      if ( a[i] <= base[i] )
++      {
++        return;
++      }
++      a[i] = 1;
++    }
++    *more = false;
++  }
++
++  return;
++}
++
++
++}
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26239)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26240)
+@@ -34,6 +34,7 @@
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
++cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 26239)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 26240)
+@@ -35,6 +35,7 @@
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
++cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 26239)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 26240)
+@@ -48,6 +48,7 @@
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
++cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
+@@ -56,7 +57,6 @@
+ cp configs/${VER}/mac/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
+ cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
+ cp configs/${VER}/mac/cmake/InstallDarwinDylibs.cmake ${DAK_SRC}/cmake
+-cp configs/${VER}/mac/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ 
+ # Uncomment to copy the following customized source files if using C99 or later 
+ # standard. If uncommented, adding -Wno-error=implicit-function-declaration 
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 26239)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 26240)
+@@ -45,6 +45,7 @@
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
++cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
+ cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
+@@ -53,7 +54,6 @@
+ cp configs/${VER}/mac/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
+ cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
+ cp configs/${VER}/mac/cmake/InstallDarwinDylibs.cmake ${DAK_SRC}/cmake
+-cp configs/${VER}/mac/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ 
+ # Configure
+ cd ${DAK_BUILD}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26240-26241.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26240-26241.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26240-26241.diff	(revision 26740)
@@ -0,0 +1,110 @@
+Index: ../trunk-jpl/src/m/classes/basalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcings.py	(revision 26240)
++++ ../trunk-jpl/src/m/classes/basalforcings.py	(revision 26241)
+@@ -20,7 +20,6 @@
+ 
+         self.setdefaultparameters()
+     #}}}
+-
+     def __repr__(self):  # {{{
+         s = '   basal forcings parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
+@@ -28,7 +27,6 @@
+         s += '{}\n'.format(fielddisplay(self, "geothermalflux", "geothermal heat flux [W / m^2]"))
+         return s
+     #}}}
+-
+     def extrude(self, md):  # {{{
+         self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1)
+         self.floatingice_melting_rate = project3d(md, 'vector', self.floatingice_melting_rate, 'type', 'node', 'layer', 1)
+@@ -35,7 +33,6 @@
+         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, ))
+@@ -45,11 +42,9 @@
+             print("      no basalforcings.floatingice_melting_rate specified: values set as zero")
+         return self
+     #}}}
+-
+     def setdefaultparameters(self):  # {{{
+         return self
+     #}}}
+-
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport:
+             md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+@@ -63,7 +58,6 @@
+             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')
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26240)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26241)
+@@ -173,7 +173,7 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','bottompressure','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','str','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','dsl','format','DoubleMat','mattype',1);
+Index: ../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.py	(revision 26240)
++++ ../trunk-jpl/src/m/classes/initialization.py	(revision 26241)
+@@ -35,7 +35,6 @@
+         #set defaults
+         self.setdefaultparameters()
+     #}}}
+-
+     def __repr__(self):  # {{{
+         s = '   initial field values:\n'
+         s += '{}\n'.format(fielddisplay(self, 'vx', 'x component of velocity [m / yr]'))
+@@ -55,7 +54,6 @@
+         s += '{}\n'.format(fielddisplay(self,'sample','Realization of a Gaussian random field'))
+         return s
+     #}}}
+-
+     def extrude(self, md):  # {{{
+         self.vx = project3d(md, 'vector', self.vx, 'type', 'node')
+         self.vy = project3d(md, 'vector', self.vy, 'type', 'node')
+@@ -80,11 +78,9 @@
+ 
+         return self
+     #}}}
+-
+     def setdefaultparameters(self):  # {{{
+         return self
+     #}}}
+-
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         if 'StressbalanceAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isstressbalance:
+             if not np.any(np.logical_or(np.isnan(md.initialization.vx), np.isnan(md.initialization.vy))):
+@@ -136,7 +132,6 @@
+                 md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+         return md
+     # }}}
+-
+     def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+@@ -143,7 +138,7 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'bottompressure', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'temperature', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'waterfraction', 'format', 'DoubleMat', 'mattype', 1)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26241-26242.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26241-26242.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26241-26242.diff	(revision 26740)
@@ -0,0 +1,2294 @@
+Index: ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp	(revision 26241)
++++ ../trunk-jpl/src/c/analyses/LoveAnalysis.cpp	(revision 26242)
+@@ -41,6 +41,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.love.forcing_type",LoveForcingTypeEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.love.inner_core_boundary",LoveInnerCoreBoundaryEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.love.core_mantle_boundary",LoveCoreMantleBoundaryEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.love.complex_computation",LoveComplexComputationEnum));
+ }/*}}}*/
+ void LoveAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+Index: ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 26241)
++++ ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 26242)
+@@ -678,6 +678,75 @@
+ 	/*}}}*/
+ #endif
+ 
++	/*Specific instantiations for IssmComplex*: */
++template <> inline GenericExternalResult<IssmComplex*>::GenericExternalResult(int in_id, int in_enum_type,IssmComplex* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
++
++	id = in_id;
++	M  = in_M;
++	N  = in_N;
++
++	EnumToStringx(&this->result_name,in_enum_type);
++
++	step = in_step;
++	time = in_time;
++
++	/*Copy result in values*/
++	if(M*N){
++		value=xNew<IssmComplex>(M*N);
++		xMemCpy<IssmComplex>(value,in_values,M*N);
++	}
++	else value=NULL;
++}
++/*}}}*/
++template <> inline void GenericExternalResult<IssmComplex*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/
++
++	int     my_rank;
++	int     type;
++	int     rows,cols;
++	char   *name    = NULL;
++	IssmPDouble passiveDouble;
++	IssmDouble* reals=NULL;
++	IssmDouble* imags=NULL;
++
++	/*recover my_rank:*/
++	my_rank=IssmComm::GetRank();
++
++	if(io_gather){
++		/*we are gathering the data on cpu 0, don't write on other cpus: */
++		if(my_rank) return;
++	}
++
++	/*First write enum: */
++	int length=(strlen(this->result_name)+1)*sizeof(char);
++	fwrite(&length,sizeof(int),1,fid);
++	fwrite(this->result_name,length,1,fid);
++
++	/*Now write time and step: */
++	passiveDouble=reCast<IssmPDouble>(time);
++	fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid);
++	fwrite(&step,sizeof(int),1,fid);
++
++	/*writing a IssmComplex array, type is 3:*/
++	type=5;
++	fwrite(&type,sizeof(int),1,fid);
++	rows=this->M;
++	fwrite(&rows,sizeof(int),1,fid);
++	cols=this->N;
++	fwrite(&cols,sizeof(int),1,fid);
++
++	/*write complex array into two real arrays:*/
++	reals=xNew<IssmDouble>(cols*rows);
++	imags=xNew<IssmDouble>(cols*rows);
++	for(int i=0;i<cols*rows;i++){
++		reals[i]=value[i].real();
++		imags[i]=value[i].imag();
++	}
++	fwrite(reals,cols*rows*sizeof(IssmComplex),1,fid);
++	fwrite(imags,cols*rows*sizeof(IssmComplex),1,fid);
++
++}
++/*}}}*/
++
+ 	/*Specifics instantiations for Vector*/
+ 	template <> inline GenericExternalResult<Vector<IssmPDouble>*>::GenericExternalResult(int in_id, int in_enum_type,Vector<IssmPDouble>* in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
+ 		_error_("instanciation not correct");
+Index: ../trunk-jpl/src/m/solve/loadresultfromdisk.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultfromdisk.m	(revision 26241)
++++ ../trunk-jpl/src/m/solve/loadresultfromdisk.m	(revision 26242)
+@@ -48,6 +48,11 @@
+ 				elseif type==4,
+ 					N=fread(fid,1,'int');
+ 					field=fread(fid,[N M],'int')';
++				elseif type==5,
++					N=fread(fid,1,'int');
++					fieldr=fread(fid,[N M],'double')';
++					fieldi=fread(fid,[N M],'double')';
++					field=complex(fieldr,fieldi);
+ 				else
+ 					error(['cannot read data of type ' num2str(type) ]);
+ 				end
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 26241)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 26242)
+@@ -25,7 +25,7 @@
+ md.materials.viscosity=[0            0   2.0000e+00   1.0000e+00   1.0000e+00   1.0000e+25]'*1e21;
+ md.materials.lame_lambda=md.materials.lame_mu*0+5e17;
+ md.materials.issolid=[1 0 1 1 1 1]';
+-md.materials.rheologymodel=2*ones(md.materials.numlayers,1);
++md.materials.rheologymodel=0*ones(md.materials.numlayers,1);
+ md.materials.burgers_mu=md.materials.lame_mu/3;
+ md.materials.burgers_viscosity=md.materials.viscosity/10;
+ md.materials.ebm_alpha= ones(md.materials.numlayers,1)*.9;
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26241)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26242)
+@@ -65,8 +65,8 @@
+ 	}
+ 
+ 	/*Initialize solid earth motion and sea level: */
+-	InputUpdateFromConstantx(inputs,elements,0.,BedEastEnum);
+-	InputUpdateFromConstantx(inputs,elements,0.,BedNorthEnum);
++	iomodel->ConstantToInput(inputs,elements,0.,BedEastEnum,P1Enum);
++	iomodel->ConstantToInput(inputs,elements,0.,BedNorthEnum,P1Enum);
+     iomodel->FetchDataToInput(inputs,elements,"md.initialization.sealevel",SealevelEnum);
+ 
+ 	/*Initialize loads:*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26241)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26242)
+@@ -7168,20 +7168,21 @@
+ void       Tria::SealevelchangeGxL(IssmDouble* sealevelout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu) { /*{{{*/
+ 
+ 	IssmDouble sealevel[3]={0};
++	int i,e,l,nbar;
+ 
+ 	if(loads->sealevelloads){
+-		for(int i=0;i<NUMVERTICES;i++) {
++		for(i=0;i<NUMVERTICES;i++) {
+ 			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+-			for (int e=0;e<nel;e++){
++			for (e=0;e<nel;e++){
+ 				sealevel[i]+=G[i*nel+e]*(loads->sealevelloads[e]+loads->loads[e]);
+ 			}
+-			for(int l=0;l<SLGEOM_NUMLOADS;l++){
+-				int nbar=slgeom->nbar[l];
+-				for (int e=0;e<nbar;e++){
++			for(l=0;l<SLGEOM_NUMLOADS;l++){
++				nbar=slgeom->nbar[l];
++				for (e=0;e<nbar;e++){
+ 					sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subloads[l][e]);
+ 				}
+ 				if(l==SLGEOM_OCEAN){
+-					for (int e=0;e<nbar;e++){
++					for (e=0;e<nbar;e++){
+ 						sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subsealevelloads[e]);
+ 					}
+ 				}
+@@ -7189,14 +7190,14 @@
+ 		}
+ 	}
+ 	else{  //this is the initial convolution where only loads are provided
+-		for(int i=0;i<NUMVERTICES;i++) {
++		for(i=0;i<NUMVERTICES;i++) {
+ 			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+-			for (int e=0;e<nel;e++){
++			for (e=0;e<nel;e++){
+ 				sealevel[i]+=G[i*nel+e]*(loads->loads[e]);
+ 			}
+-			for(int l=0;l<SLGEOM_NUMLOADS;l++){
+-				int nbar=slgeom->nbar[l];
+-				for (int e=0;e<nbar;e++){
++			for(l=0;l<SLGEOM_NUMLOADS;l++){
++				nbar=slgeom->nbar[l];
++				for (e=0;e<nbar;e++){
+ 					sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subloads[l][e]);
+ 				}
+ 			}
+@@ -7205,12 +7206,12 @@
+ 
+ 	/*store values computed on vertices, but don't repeat the computation if another element already computed it!:*/
+ 	if(percpu){
+-		for(int i=0;i<NUMVERTICES;i++){
++		for(i=0;i<NUMVERTICES;i++){
+ 			if(slgeom->lids[this->vertices[i]->lid]==this->lid)sealevelout[this->vertices[i]->lid]=sealevel[i];
+ 		}
+ 	}
+ 	else{
+-		for(int i=0;i<NUMVERTICES;i++) sealevelout[i]=sealevel[i];
++		for(i=0;i<NUMVERTICES;i++) sealevelout[i]=sealevel[i];
+ 	}
+ 
+ } /*}}}*/
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26241)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26242)
+@@ -8,56 +8,170 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+-#include <petscblaslapack.h>
++#include "petscblaslapack.h"
+ 
+-void love_init(FemModel* femmodel, Matlitho* matlitho){/*{{{*/
+-	// initialize Planet_Mass(r) for efficient computation of gravity, value of surface gravity and inital size of the yi equation system
+-	bool        verbosemod = (int)VerboseModule();
++/*local definitions:*/
++class LoveVariables{  /*{{{*/
+ 
+-	int numlayers = matlitho->numlayers;
+-	IssmDouble* r=matlitho->radius;
+-	IssmDouble* EarthMass=xNewZeroInit<IssmDouble>(numlayers+1);
+-	IssmDouble r1,r2,ro, GG;
+-	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++	public: 
++		IssmDouble g0; 
++		IssmDouble r0;
++		IssmDouble* EarthMass; 
++		int nyi; 
++		int starting_layer;
++		
++		LoveVariables(){  /*{{{*/
++			g0=0;
++			r0=0;
++			EarthMass=NULL;
++			nyi=0;
++			starting_layer=0;
++		} /*}}}*/
++		LoveVariables(IssmDouble* EarthMassin,IssmDouble g0in,IssmDouble r0in,int nyiin,int starting_layerin){  /*{{{*/
++			EarthMass=EarthMassin;
++			g0=g0in;
++			r0=r0in;
++			nyi=nyiin;
++			starting_layer=starting_layerin;
++		} /*}}}*/
++		~LoveVariables(){};
++}; /*}}}*/
+ 
+-	for (int i=0;i<numlayers;i++){
+-		  r2 = r[i+1];
+-		  ro = matlitho->density[i];
+-		if (i==0){
+-			EarthMass[i] = ro*pow(r2,3.0)*4.0*PI/3.0;
+-		}else{
+-			r1=r[i];
+-			EarthMass[i] = EarthMass[i-1] + ro*(pow(r2,3.0)-pow(r1,3.0))*4.0*PI/3.0;;
++/*self contained support routines used by cores below:*/
++template<typename doubletype> doubletype                 angular_frequency(IssmDouble frequency); //pure declaration
++template <> IssmDouble                     angular_frequency<IssmDouble>(IssmDouble frequency){ /*{{{*/
++	return 2.0*PI*frequency;
++} /*}}}*/
++template <> IssmComplex                    angular_frequency<IssmComplex>(IssmDouble frequency){ /*{{{*/
++	IssmComplex value=reCast<IssmComplex>(complex<double>(0,1))*2.0*PI*reCast<IssmComplex>(frequency);
++	return value;
++} /*}}}*/
++template<typename doubletype> void                       allgesv(int* pnyi, int* pnrhs, doubletype* yilocal, int* plda, int* ipiv, doubletype* rhslocal, int* pldb, int* pinfo);
++template <> void                           allgesv<IssmDouble>(int* pnyi, int* pnrhs, IssmDouble* yilocal, int* plda, int* ipiv, IssmDouble* rhslocal, int* pldb, int* pinfo){ /*{{{*/
++	dgesv_(pnyi, pnrhs, yilocal, plda, ipiv, rhslocal, pldb, pinfo);
++} /*}}}*/
++template <> void                           allgesv<IssmComplex>(int* pnyi, int* pnrhs, IssmComplex* yilocal, int* plda, int* ipiv, IssmComplex* rhslocal, int* pldb, int* pinfo){ /*{{{*/
++	_error_("zgesv_ not linked correctly yet! ");
++	//zgesv_(pnyi, pnrhs, yilocal, plda, ipiv, rhslocal, pldb, pinfo);
++} /*}}}*/
++template<typename doubletype> doubletype   factorial(int n){ /*{{{*/
++	doubletype prod=1;
++	for (int i=2;i<n+1;i++) prod*=i;
++	return prod;
++}/*}}}*/
++template<typename doubletype> doubletype   n_C_r(int n, int r){ /*{{{*/ 
++	//n choose r
++	int primes[169] = 
++	{2,    3,    5,    7,   11,   13,   17,   19,   23,   29,  
++		31,   37,   41,   43,   47,   53,   59,   61,   67,   71,  
++		73,   79,   83,   89,   97,  101,  103,  107,  109,  113,  
++		127,  131,  137,  139,  149,  151,  157,  163,  167,  173,  
++		179,  181,  191,  193,  197,  199,  211,  223,  227,  229,  
++		233,  239,  241,  251,  257,  263,  269,  271,  277,  281,  
++		283,  293,  307,  311,  313,  317,  331,  337,  347,  349,  
++		353,  359,  367,  373,  379,  383,  389,  397,  401,  409,  
++		419,  421,  431,  433,  439,  443,  449,  457,  461,  463,  
++		467,  479,  487,  491,  499,  503,  509,  521,  523,  541,  
++		547,  557,  563,  569,  571,  577,  587,  593,  599,  601,  
++		607,  613,  617,  619,  631,  641,  643,  647,  653,  659,  
++		661,  673,  677,  683,  691,  701,  709,  719,  727,  733,  
++		739,  743,  751,  757,  761,  769,  773,  787,  797,  809,  
++		811,  821,  823,  827,  829,  839,  853,  857,  859,  863,  
++		877,  881,  883,  887,  907,  911,  919,  929,  937,  941,  
++		947,  953,  967,  971,  977,  983,  991,  997, 1009};
++	int num, den;
++	num = 1;
++	den = 1;
++
++	for (int i=0;i<r;i++){
++		num = num*(n-i);
++		den = den*(i+1);
++		if (i>0) {
++			// Divide out common prime factors
++			for (int k=0;k<169;k++){ //169 is the length of the prime vector here
++				if ( i % primes[k] == 0) { // modulo
++					num = num/primes[k];
++					den = den/primes[k];
++				}
++			}
+ 		}
+ 	}
+ 
+-	IssmDouble g0=EarthMass[numlayers-1]*GG/pow(r[numlayers],2.0);
+-	femmodel->parameters->SetParam(g0,LoveG0Enum);
+-	femmodel->parameters->SetParam(EarthMass,numlayers,LoveEarthMassEnum);
+-	xDelete<IssmDouble>(EarthMass);
++	doubletype res;        
++	return res = num/den;
++}/*}}}*/
++template<typename doubletype> doubletype*  postwidder_coef(int NTit){ /*{{{*/
++	//Coefficients of the Post-Widder method through Saltzer summation for inverse Laplace transform:
++	//The Mth iteration estimate will be: f(t)_M = sum_{k=1:2*M}(xi_[M,k] * f(s_k))
++	//The method is based on equations (2), (6), (7) in: 
++	//Valko PP, Abate J. Comparison of sequence accelerators for the Gaver method of numerical Laplace transform inversion. Computational Mathematics and Applications. (2004)
++	//Note that the coefficients xi lack the factor s=k*log(2)/t. 
++	//That is because we are computing the heaviside response of the system rather than its impulse response, 
++	//and Laplace_Transform(Heaviside(t).*f(t)) = f(s)/s. So s cancels out in the sum for f(t)_M.
+ 
+-	int nyi=6*(numlayers+1);
+-	int starting_layer=0;
+-	femmodel->parameters->SetParam(nyi,LoveNYiEquationsEnum);
+-	femmodel->parameters->SetParam(starting_layer,LoveStartingLayerEnum);
++	doubletype* xi=xNewZeroInit<doubletype>(2*NTit*NTit);
++	int indxi;
++	for (int M=1;M<NTit+1;M++){
++		for (int k=1;k<2*M+1;k++){
++			indxi=(M-1)*(2*NTit)+k-1;
++			for (int j=floor((k+1)/2);j<min(k,M)+1;j++){
++				xi[indxi]+=pow(j,M+1.0)/factorial<doubletype>(M)*n_C_r<doubletype>(M,j)*n_C_r<doubletype>(2*j,j)*n_C_r<doubletype>(j,k-j);
++			}
++			xi[indxi]*=pow(-1.0,k+M)/k;
++		}
++	}
++	return xi;
+ }/*}}}*/
+-void GetEarthRheology(IssmDouble* pla, IssmDouble* pmu, int layer_index, IssmDouble omega,FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template<typename doubletype> void         postwidder_transform(doubletype* Lovet, doubletype* Lovef,int d, int t, int NTit, doubletype* xi, FemModel* femmodel){ /*{{{*/
++	//Computes Lovet for time step t and degree d from the PW coefficients xi and the corresponding 2*NTit frequency samples in Lovef
+ 
++	int nfreq, indxi, indf;
++	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
++	int nt=nfreq/2/NTit;
++
++	indf=d*nfreq+t*2*NTit;
++	doubletype LoveM[NTit];
++
++	for (int M=1;M<NTit+1;M++){
++		LoveM[M-1]=0.0;
++		for (int k=1;k<2*M+1;k++){
++			indxi=(M-1)*(2*NTit)+k-1;
++			LoveM[M-1]+=xi[indxi]*Lovef[indf+k-1];
++		}
++
++		//Make sure we are not getting into numerical instability
++		//Diverging once: ok, we'll give that the benefit of the doubt, it can be an inflexion point in the convergence series
++		//Diverging twice in a row: we are definitely propagating numerical error: revert to the last stable value and exit
++		if (M>3){ 
++			if ( abs(LoveM[M-1]-LoveM[M-2]) > abs(LoveM[M-2]-LoveM[M-3]) &&
++					abs(LoveM[M-2]-LoveM[M-3]) > abs(LoveM[M-3]-LoveM[M-4]) ){
++				Lovet[d*nt+t]=LoveM[M-3];
++				return;
++			}
++		}
++	}
++	Lovet[d*nt+t]=LoveM[NTit-1];
++}/*}}}*/
++template <typename doubletype> void        GetEarthRheology(doubletype* pla, doubletype* pmu, int layer_index, doubletype omega,  Matlitho* matlitho){ /*{{{*/
++
+ 	//returns lame parameters (material rigity) lambda and mu for the right frequency and layer
+- 	IssmDouble vi=matlitho->viscosity[layer_index];
+- 	IssmDouble mu=matlitho->lame_mu[layer_index];
+- 	IssmDouble la=matlitho->lame_lambda[layer_index];
+- 	int rheo=matlitho->rheologymodel[layer_index];
++	doubletype mu,la;
+ 
++	IssmDouble vi=matlitho->viscosity[layer_index];
++	IssmDouble mu0=matlitho->lame_mu[layer_index];
++	IssmDouble la0=matlitho->lame_lambda[layer_index];
++	int rheo=matlitho->rheologymodel[layer_index];
++
+ 	if (vi!=0 && omega!=0.0){ //take into account viscosity in the rigidity if the material isn't a perfect fluid
+-				   //Otherwise return the elastic value
+-		IssmDouble ka=la + 2.0/3.0*mu; //Bulk modulus
++		//Otherwise return the elastic value
++		IssmDouble ka=la0 + 2.0/3.0*mu0; //Bulk modulus
+ 		if (rheo==2){//EBM
+ 			IssmDouble alpha=matlitho->ebm_alpha[layer_index];
+ 			IssmDouble delta=matlitho->ebm_delta[layer_index];
+ 			IssmDouble taul=matlitho->ebm_taul[layer_index];
+ 			IssmDouble tauh=matlitho->ebm_tauh[layer_index];
+-			IssmDouble hf1,hf2,U1,U2;
++			IssmDouble hf1,hf2;
++			doubletype U1,U2;
+ 			IssmDouble* a=xNew<IssmDouble>(2);
+ 			IssmDouble* b=xNew<IssmDouble>(1);
+ 
+@@ -78,7 +192,7 @@
+ 			U2=(pow(tauh,1.0+alpha)*hf1-pow(taul,1.0+alpha)*hf2)/(1.0+alpha);
+ 
+ 			mu=mu/(1.0+ alpha*delta/(pow(tauh,alpha)-pow(taul,alpha))*(U1 + omega*U2) -mu/vi/omega);
+-		   	la=ka-2.0/3.0*mu;
++			la=ka-2.0/3.0*mu;
+ 
+ 			xDelete<IssmDouble>(a);
+ 			xDelete<IssmDouble>(b);
+@@ -87,25 +201,25 @@
+ 			IssmDouble vi2=matlitho->burgers_viscosity[layer_index];
+ 			IssmDouble mu2=matlitho->burgers_mu[layer_index];
+ 
+-		  	mu=mu*omega*(omega+mu2/vi2)/((omega+mu2/vi2)*(omega+mu/vi)+mu/vi2*omega);
+-		   	la=ka-2.0/3.0*mu;
+-	  	}
++			mu=mu0*omega*(omega+mu2/vi2)/((omega+mu2/vi2)*(omega+mu0/vi)+mu0/vi2*omega);
++			la=ka-2.0/3.0*mu0;
++		}
+ 		else{//Maxwell
+-			la = (la + mu*ka/vi/omega)/(1.0 + mu/vi/omega);
+-			mu = mu/(1.0+mu/vi/omega);
++			la = (la0 + mu0*ka/vi/omega)/(1.0 + mu0/vi/omega);
++			mu = mu0/(1.0+mu0/vi/omega);
+ 		}
+-	 }
++	}
+ 
+-	 *pla=la;
+-	 *pmu=mu;
++	*pla=la;
++	*pmu=mu;
+ 
+ } /*}}}*/
+-IssmDouble GetGravity(IssmDouble r2, int layer_index, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++IssmDouble                                 GetGravity(IssmDouble r2, int layer_index, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars){ /*{{{*/
+ 	//computes gravity at radius r2
+ 	IssmDouble* EarthMass;
+ 	IssmDouble g, GG;
+ 
+-	femmodel->parameters->FindParam(&EarthMass,&matlitho->numlayers,LoveEarthMassEnum);
++	EarthMass=vars->EarthMass;
+ 	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+ 	IssmDouble ro=matlitho->density[layer_index];
+ 	IssmDouble M=0;
+@@ -119,36 +233,38 @@
+ 	}
+ 	return	g= GG*M/pow(r2,2.0);
+ }/*}}}*/
+-void fill_yi_prefactor(IssmDouble* yi_prefactor, int* pdeg, IssmDouble* pomega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        fill_yi_prefactor(doubletype* yi_prefactor, int* pdeg, doubletype* pomega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars){ /*{{{*/
+ 	//precalculates partial derivative factors for function yi_derivatives
+- IssmDouble ra=matlitho->radius[matlitho->numlayers];
+- IssmDouble  g0,r0,mu0, GG;
+- int nstep,nindex, starting_layer;
+- femmodel->parameters->FindParam(&g0,LoveG0Enum);
+- femmodel->parameters->FindParam(&r0,LoveR0Enum);
+- femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+- femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+- femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+- femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
++	IssmDouble ra=matlitho->radius[matlitho->numlayers];
++	IssmDouble  g0,r0,mu0, GG;
++	int nstep,nindex, starting_layer;
+ 
+- IssmDouble frh,frhg0,fgr0,fgr,fn,rm0,rlm,flm;
+- IssmDouble xmin,xmax,x,dr;
+- IssmDouble g,ro, issolid;
++	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
++	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
++	
++	g0=vars->g0;
++	r0=vars->r0;
++	starting_layer=vars->starting_layer;
+ 
++	doubletype frh,frhg0,fgr0,fgr,fn,rm0,rlm,flm;
++	IssmDouble xmin,xmax,x,dr;
++	IssmDouble g,ro, issolid;
++
+ 	if (pomega) { //frequency and degree dependent terms /*{{{*/
+-		IssmDouble la,mu;
+-		IssmDouble* f=xNewZeroInit<IssmDouble>(12);
++		doubletype la,mu;
++		doubletype f[12];
+ 		int deg=*pdeg;
+-		IssmDouble omega=*pomega;	
++		doubletype omega=*pomega;	
+ 		fn=deg*(deg+1.0);
+ 
+ 		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
+ 
+-				ro=matlitho->density[layer_index];
+-				issolid=matlitho->issolid[layer_index];
+-				if(issolid==1){
+-		 		GetEarthRheology(&la, &mu,layer_index,omega,femmodel,matlitho);   
+-	
++			ro=matlitho->density[layer_index];
++			issolid=matlitho->issolid[layer_index];
++			if(issolid==1){
++				GetEarthRheology<doubletype>(&la, &mu,layer_index,omega,matlitho);   
++
+ 				/*_______Expressions*/
+ 				flm=(la+2.0*mu);
+ 				rlm=(3.0*la+2.0*mu)/(la+2.0*mu);
+@@ -171,9 +287,9 @@
+ 				xmin=matlitho->radius[layer_index]/ra;
+ 				xmax=(matlitho->radius[layer_index+1])/ra;
+ 				dr = (xmax -xmin)/nstep;
+-			     	x=xmin;
++				x=xmin;
+ 				for (int n=0;n<nstep;n++){
+-					g=GetGravity(x*ra,layer_index,femmodel,matlitho);
++					g=GetGravity(x*ra,layer_index,femmodel,matlitho,vars);
+ 
+ 					nindex=layer_index*nstep*36+n*36;
+ 					yi_prefactor[nindex+ 0*6+0]= f[0]/x;                      // in dy[0*6+0]
+@@ -190,44 +306,42 @@
+ 				}
+ 			}
+ 		}
+-
+-		xDelete<IssmDouble>(f);
+-	/*}}}*/
++		/*}}}*/
+ 	} else if (pdeg) { // degree dependent terms /*{{{*/
+-	 	int deg=*pdeg;
+-	 	fn=(deg*(deg+1.0));
++		int deg=*pdeg;
++		fn=(deg*(deg+1.0));
+ 
+ 		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
+ 			ro=matlitho->density[layer_index];
+ 			issolid=matlitho->issolid[layer_index];
+-	
++
+ 			/*_______Expressions*/
+ 			fgr=4.0*PI*GG*ro*ra;
+-	 
++
+ 			xmin=matlitho->radius[layer_index]/ra;
+ 			xmax=(matlitho->radius[layer_index+1])/ra;
+ 			dr = (xmax -xmin)/nstep;
+-		     	x=xmin;
++			x=xmin;
+ 			for (int n=0;n<nstep;n++){
+-				 nindex=layer_index*nstep*36+n*36;
+-				 g=GetGravity(x*ra,layer_index,femmodel,matlitho);
+-	
+-				 if(issolid==1){
+-			 	 yi_prefactor[nindex+ 1*6+3]= fn/x;                  // in dy[1*6+3]
+-				 yi_prefactor[nindex+ 5*6+2]= -(fgr/g0*fn)/x;        // in dy[5*6+2]
+-				 yi_prefactor[nindex+ 5*6+4]= fn/(x*x);		     // in dy[5*6+4]
+-				 } else {
+-				 yi_prefactor[nindex+ 1*6+0]= (-4.0*(fgr/g)+fn/x)/x; // in dy[1*6+0] liquid layer
+-				 }
++				nindex=layer_index*nstep*36+n*36;
++				g=GetGravity(x*ra,layer_index,femmodel,matlitho,vars);
++
++				if(issolid==1){
++					yi_prefactor[nindex+ 1*6+3]= fn/x;                  // in dy[1*6+3]
++					yi_prefactor[nindex+ 5*6+2]= -(fgr/g0*fn)/x;        // in dy[5*6+2]
++					yi_prefactor[nindex+ 5*6+4]= fn/(x*x);		     // in dy[5*6+4]
++				} else {
++					yi_prefactor[nindex+ 1*6+0]= (-4.0*(fgr/g)+fn/x)/x; // in dy[1*6+0] liquid layer
++				}
+ 				x=x+dr;
+ 			}
+ 		}
+-	/*}}}*/
++		/*}}}*/
+ 	} else { // static terms /*{{{*/
+ 		for (int layer_index=starting_layer;layer_index<matlitho->numlayers;layer_index++){
+ 			ro=matlitho->density[layer_index];
+ 			issolid=matlitho->issolid[layer_index];
+-	
++
+ 			/*_______Expressions*/
+ 			frhg0=ro*g0*ra/mu0;
+ 			fgr=4.0*PI*GG*ro*ra;
+@@ -235,217 +349,208 @@
+ 			xmin=matlitho->radius[layer_index]/ra;
+ 			xmax=(matlitho->radius[layer_index+1])/ra;
+ 			dr = (xmax -xmin)/nstep;
+-		     	x=xmin;
+-	  	 	for (int n=0;n<nstep;n++){
+-				 g=GetGravity(x*ra,layer_index,femmodel,matlitho);
+-				 nindex=layer_index*nstep*36+n*36;
+-				 if(issolid==1){
+-					 yi_prefactor[nindex+ 1*6+5]= -frhg0;       // in dy[1*6+5]
+-					 yi_prefactor[nindex+ 2*6+0]= -1.0/x;       // in dy[2*6+0]
+-					 yi_prefactor[nindex+ 2*6+2]= 1.0/x;        // in dy[2*6+2]
+-					 yi_prefactor[nindex+ 3*6+3]= -3.0/x;       // in dy[3*6+3]
+-					 yi_prefactor[nindex+ 3*6+4]= -frhg0/x;     // in dy[3*6+4]
+-					 yi_prefactor[nindex+ 4*6+0]= fgr/g0;       // in dy[4*6+0]
+-					 yi_prefactor[nindex+ 4*6+5]= 1.0;          // in dy[4*6+5]
+-					 yi_prefactor[nindex+ 5*6+5]= -2.0/x;       // in dy[5*6+5]
+-				 } else {
+-					 yi_prefactor[nindex+ 0*6+0]= fgr/g;        // in dy[0*6+0] liquid layer
+-					 yi_prefactor[nindex+ 0*6+1]= 1.0;          // in dy[0*6+1] liquid layer
+-					 yi_prefactor[nindex+ 1*6+1]= -2.0/x-fgr/g; // in dy[1*6+1] liquid layer
+-				 }
++			x=xmin;
++			for (int n=0;n<nstep;n++){
++				g=GetGravity(x*ra,layer_index,femmodel,matlitho,vars);
++				nindex=layer_index*nstep*36+n*36;
++				if(issolid==1){
++					yi_prefactor[nindex+ 1*6+5]= -frhg0;       // in dy[1*6+5]
++					yi_prefactor[nindex+ 2*6+0]= -1.0/x;       // in dy[2*6+0]
++					yi_prefactor[nindex+ 2*6+2]= 1.0/x;        // in dy[2*6+2]
++					yi_prefactor[nindex+ 3*6+3]= -3.0/x;       // in dy[3*6+3]
++					yi_prefactor[nindex+ 3*6+4]= -frhg0/x;     // in dy[3*6+4]
++					yi_prefactor[nindex+ 4*6+0]= fgr/g0;       // in dy[4*6+0]
++					yi_prefactor[nindex+ 4*6+5]= 1.0;          // in dy[4*6+5]
++					yi_prefactor[nindex+ 5*6+5]= -2.0/x;       // in dy[5*6+5]
++				} else {
++					yi_prefactor[nindex+ 0*6+0]= fgr/g;        // in dy[0*6+0] liquid layer
++					yi_prefactor[nindex+ 0*6+1]= 1.0;          // in dy[0*6+1] liquid layer
++					yi_prefactor[nindex+ 1*6+1]= -2.0/x-fgr/g; // in dy[1*6+1] liquid layer
++				}
+ 				x=x+dr;
+ 			}
+ 		}
+-	/*}}}*/
++		/*}}}*/
+ 	}
+ }/*}}}*/
+-IssmDouble* yi_derivatives(IssmDouble* y, int layer_index, int n, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        yi_derivatives(doubletype* dydx, doubletype* y, int layer_index, int n, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//computes yi derivatives at r=radius[layer_index]+ n/nstep*(radius[layer_index+1]-radius[layer_index])
+ 
+ 	IssmDouble issolid=matlitho->issolid[layer_index];
+ 	int iy,id,ny, nindex, nstep;
+- 	IssmDouble* dydx=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* dy=xNewZeroInit<IssmDouble>(36);
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+ 
+ 	/*{{{*/ /* For reference:
+-	 flm=(la+2.0*mu);
+-	 rlm=(3.0*la+2.0*mu)/(la+2.0*mu);
+-	 rm0=mu/mu0;
+-	 rg0=g/g0;
+-	 frh=ro*g*ra/mu0;
+-	 fgr=4.0*PI*GG*ro*ra/g0;
+-	 fn=(deg*(deg+1.0));
+-	 
++			   flm=(la+2.0*mu);
++			   rlm=(3.0*la+2.0*mu)/(la+2.0*mu);
++			   rm0=mu/mu0;
++			   rg0=g/g0;
++			   frh=ro*g*ra/mu0;
++			   fgr=4.0*PI*GG*ro*ra/g0;
++			   fn=(deg*(deg+1.0));
+ 
+-	 if(issolid==1){
+-	 ny = 6;
+ 
+-	 dy[0*6+0]= (-2.0*la/flm)/x;
+-	 dy[0*6+1]= mu0/flm;
+-	 dy[0*6+2]= (la*fn/flm)/x;
+-	 dy[0*6+3]= 0.0;
+-	 dy[0*6+4]= 0.0;
+-	 dy[0*6+5]= 0.0;
++			   if(issolid==1){
++			   ny = 6;
+ 
+-	 dy[1*6+0]=  4.0*(-frh+rm0*rlm/x)/x + ro*pow(omega,2.0)*ra/mu0;
+-	 dy[1*6+1]=(-4.0*mu/flm)/x;
+-	 dy[1*6+2]= fn*(frh-2.0*rm0*rlm/x)/x;
+-	 dy[1*6+3]= fn/x;
+-	 dy[1*6+4]= 0.0;
+-	 dy[1*6+5]= -frh/rg0;
++			   dy[0*6+0]= (-2.0*la/flm)/x;
++			   dy[0*6+1]= mu0/flm;
++			   dy[0*6+2]= (la*fn/flm)/x;
++			   dy[0*6+3]= 0.0;
++			   dy[0*6+4]= 0.0;
++			   dy[0*6+5]= 0.0;
+ 
+-	 dy[2*6+0]= -1.0/x;
+-	 dy[2*6+1]= 0.0;
+-	 dy[2*6+2]= 1.0/x;
+-	 dy[2*6+3]= 1/rm0;
+-	 dy[2*6+4]= 0.0;
+-	 dy[2*6+5]= 0.0;
++			   dy[1*6+0]=  4.0*(-frh+rm0*rlm/x)/x + ro*pow(omega,2.0)*ra/mu0;
++			   dy[1*6+1]=(-4.0*mu/flm)/x;
++			   dy[1*6+2]= fn*(frh-2.0*rm0*rlm/x)/x;
++			   dy[1*6+3]= fn/x;
++			   dy[1*6+4]= 0.0;
++			   dy[1*6+5]= -frh/rg0;
+ 
+-	 dy[3*6+0]= (frh-2.0*rm0*rlm/x)/x;
+-	 dy[3*6+1]= ( -la/flm)/x;
+-	 dy[3*6+2]= (2.0*rm0*(la*(2.0*fn-1.0)+2.0*mu*(fn-1.0))/flm)/(x*x) + ro*pow(omega,2.0)*ra/mu0;
+-	 dy[3*6+3]= -3.0/x;
+-	 dy[3*6+4]= -(frh/rg0)/x;
+-	 dy[3*6+5]= 0.0;
++			   dy[2*6+0]= -1.0/x;
++			   dy[2*6+1]= 0.0;
++			   dy[2*6+2]= 1.0/x;
++			   dy[2*6+3]= 1/rm0;
++			   dy[2*6+4]= 0.0;
++			   dy[2*6+5]= 0.0;
+ 
+-	 dy[4*6+0]= fgr;
+-	 dy[4*6+1]= 0.0;
+-	 dy[4*6+2]= 0.0;
+-	 dy[4*6+3]= 0.0;
+-	 dy[4*6+4]= 0.0;
+-	 dy[4*6+5]= 1.0;
++			   dy[3*6+0]= (frh-2.0*rm0*rlm/x)/x;
++			   dy[3*6+1]= ( -la/flm)/x;
++			   dy[3*6+2]= (2.0*rm0*(la*(2.0*fn-1.0)+2.0*mu*(fn-1.0))/flm)/(x*x) + ro*pow(omega,2.0)*ra/mu0;
++			   dy[3*6+3]= -3.0/x;
++			   dy[3*6+4]= -(frh/rg0)/x;
++			   dy[3*6+5]= 0.0;
+ 
+-	 dy[5*6+0]= 0.0;
+-	 dy[5*6+1]= 0.0;
+-	 dy[5*6+2]= -(fgr*fn)/x;
+-	 dy[5*6+3]= 0.0;
+-	 dy[5*6+4]= fn/(x*x);
+-	 dy[5*6+5]= -2.0/x;
+-	  
+-	 } else {
+-	 ny = 2;
++			   dy[4*6+0]= fgr;
++			   dy[4*6+1]= 0.0;
++			   dy[4*6+2]= 0.0;
++			   dy[4*6+3]= 0.0;
++			   dy[4*6+4]= 0.0;
++			   dy[4*6+5]= 1.0;
+ 
+-	 dy[0*6+0]= fgr/rg0;
+-	 dy[0*6+1]= 1.0;
+-	 dy[1*6+0]= (-4.0*(fgr/rg0)+fn/x)/x;
+-	 dy[1*6+1]= -2.0/x-fgr/rg0;
++			   dy[5*6+0]= 0.0;
++			   dy[5*6+1]= 0.0;
++			   dy[5*6+2]= -(fgr*fn)/x;
++			   dy[5*6+3]= 0.0;
++			   dy[5*6+4]= fn/(x*x);
++			   dy[5*6+5]= -2.0/x;
++
++			   } else {
++			   ny = 2;
++
++			   dy[0*6+0]= fgr/rg0;
++			   dy[0*6+1]= 1.0;
++			   dy[1*6+0]= (-4.0*(fgr/rg0)+fn/x)/x;
++			   dy[1*6+1]= -2.0/x-fgr/rg0;
++			   }
++			   */ /*}}}*/
++
++	if(issolid==1){
++		ny = 6;
++	} else {
++		ny = 2;
+ 	}
+-	*/ /*}}}*/
+ 
+-	 if(issolid==1){
+-		 ny = 6;
+-	 } else {
+-		 ny = 2;
+-	 }
+-	 
+-	 for (id=0;id<ny;id++){
++	for (id=0;id<ny;id++){
+ 		for (iy=0;iy<ny;iy++){
+ 			nindex=layer_index*nstep*36+n*36;
+ 			dydx[id]=dydx[id]+yi_prefactor[nindex+id*6+iy]*y[iy];
+-	 	}
+-	 }
+-	xDelete<IssmDouble>(dy);
+-	return dydx;
++		}
++	}
++	return;
+ }/*}}}*/
+-void propagate_yi_euler(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        propagate_yi_euler(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+ 	//euler method
+ 	int nstep;
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
+ 
+- 	IssmDouble* dydx=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* dydx=xNewZeroInit<IssmDouble>(6);
+ 	IssmDouble dr = (xmax -xmin)/nstep;
+-     	IssmDouble x=xmin;
+-    for(int i = 0;i<nstep;i++){
+-	dydx=yi_derivatives(y,layer_index, i,yi_prefactor,femmodel,matlitho);
+-  	for (int j=0;j<6;j++){
+-		y[j]+=dydx[j]*dr;
++	IssmDouble x=xmin;
++	for(int i = 0;i<nstep;i++){
++		yi_derivatives<doubletype>(dydx,y,layer_index, i,yi_prefactor,femmodel,matlitho);
++		for (int j=0;j<6;j++){
++			y[j]+=dydx[j]*dr;
++		}
++		x = x + dr;
+ 	}
+-  	x = x + dr;
+-    }
+ 	xDelete<IssmDouble>(dydx);
+ }/*}}}*/
+-void propagate_yi_RK2(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        propagate_yi_RK2(doubletype* y, IssmDouble xmin, IssmDouble xmax, int layer_index, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+ 	//Implements Runge-Kutta 2nd order (midpoint method)
+ 	int nstep;
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
+ 
+- 	IssmDouble* k1=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* k2=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* k3=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* k4=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* y1=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* y2=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* y3=xNewZeroInit<IssmDouble>(6);
++	doubletype k1[6]={0};
++	doubletype k2[6]={0};
++	doubletype k3[6]={0};
++	doubletype k4[6]={0};
++	doubletype y1[6]={0};
++	doubletype y2[6]={0};
++	doubletype y3[6]={0};
+ 
+ 	IssmDouble dr = (xmax -xmin)/nstep;
+-     	IssmDouble x=xmin;
+-    for(int i = 0;i<nstep/2;i++){
+-	k1=yi_derivatives(y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
+-	for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
+-	k2=yi_derivatives(y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
+-	
+-  	for (int j=0;j<6;j++){
+-		  y[j]+=k2[j]*2.0*dr;
++	IssmDouble x=xmin;
++
++	for(int i = 0;i<nstep/2;i++){
++		yi_derivatives<doubletype>(k1,y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
++		for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
++		yi_derivatives<doubletype>(k2,y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
++
++		for (int j=0;j<6;j++){
++			y[j]+=k2[j]*2.0*dr;
++		}
++		x = x + 2.0*dr;
+ 	}
+-  	x = x + 2.0*dr;
+-    }
+-	xDelete<IssmDouble>(k1);
+-	xDelete<IssmDouble>(k2);
+-	xDelete<IssmDouble>(k3);
+-	xDelete<IssmDouble>(k4);
+-	xDelete<IssmDouble>(y1);
+-	xDelete<IssmDouble>(y2);
+-	xDelete<IssmDouble>(y3);
+ }/*}}}*/
+-void propagate_yi_RK4(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        propagate_yi_RK4(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+ 	//Implements Runge-Kutta 4th order
+ 	int nstep;
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
+ 
+- 	IssmDouble* k1=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* k2=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* k3=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* k4=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* y1=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* y2=xNewZeroInit<IssmDouble>(6);
+- 	IssmDouble* y3=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* k1=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* k2=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* k3=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* k4=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* y1=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* y2=xNewZeroInit<IssmDouble>(6);
++	IssmDouble* y3=xNewZeroInit<IssmDouble>(6);
+ 
+ 	IssmDouble dr = (xmax -xmin)/nstep;
+-     	IssmDouble x=xmin;
+-    for(int i = 0;i<nstep/2-1;i++){
+-	k1=yi_derivatives(y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
+-	for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
+-	k2=yi_derivatives(y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+-	for (int j=0;j<6;j++) {y2[j]=y[j]+k2[j]*dr;}
+-	k3=yi_derivatives(y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+-	for (int j=0;j<6;j++) {y3[j]=y[j]+k3[j]*2.0*dr;}
+-	k4=yi_derivatives(y3,layer_index, 2*i+2,yi_prefactor,femmodel,matlitho);		
+-	
+-  	for (int j=0;j<6;j++){
+-		y[j]+=(k1[j]+2.0*k2[j]+2.0*k3[j]+k4[j])/3.0*dr;		
++	IssmDouble x=xmin;
++	for(int i = 0;i<nstep/2-1;i++){
++		yi_derivatives<doubletype>(k1,y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
++		for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
++		yi_derivatives<doubletype>(k2,y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++		for (int j=0;j<6;j++) {y2[j]=y[j]+k2[j]*dr;}
++		yi_derivatives<doubletype>(k3,y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++		for (int j=0;j<6;j++) {y3[j]=y[j]+k3[j]*2.0*dr;}
++		yi_derivatives<doubletype>(k4,y3,layer_index, 2*i+2,yi_prefactor,femmodel,matlitho);		
++
++		for (int j=0;j<6;j++){
++			y[j]+=(k1[j]+2.0*k2[j]+2.0*k3[j]+k4[j])/3.0*dr;		
++		}
++		x = x + 2.0*dr;
+ 	}
+-  	x = x + 2.0*dr;
+-    }
+ 
+ 	//Last step: we don't know the derivative at xmax, so we will assume the values at xmax-dr
+ 	int i=nstep/2;
+-	k1=yi_derivatives(y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
++	yi_derivatives<doubletype>(k1,y,layer_index, 2*i,yi_prefactor,femmodel,matlitho);
+ 	for (int j=0;j<6;j++) {y1[j]=y[j]+k1[j]*dr;}
+-	k2=yi_derivatives(y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++	yi_derivatives<doubletype>(k2,y1,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+ 	for (int j=0;j<6;j++) {y2[j]=y[j]+k2[j]*dr;}
+-	k3=yi_derivatives(y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
++	yi_derivatives<doubletype>(k3,y2,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);
+ 	for (int j=0;j<6;j++) {y3[j]=y[j]+k3[j]*2.0*dr;}
+-	k4=yi_derivatives(y3,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
+-	
+-  	for (int j=0;j<6;j++){
++	yi_derivatives<doubletype>(k4,y3,layer_index, 2*i+1,yi_prefactor,femmodel,matlitho);		
++
++	for (int j=0;j<6;j++){
+ 		y[j]+=(k1[j]+2.0*k2[j]+2.0*k3[j]+k4[j])/3.0*dr;		
+ 	}
+ 
+-  	x = x + 2.0*dr;
++	x = x + 2.0*dr;
+ 
+ 	xDelete<IssmDouble>(k1);
+ 	xDelete<IssmDouble>(k2);
+@@ -455,7 +560,7 @@
+ 	xDelete<IssmDouble>(y2);
+ 	xDelete<IssmDouble>(y3);
+ }/*}}}*/
+-void Innersphere_boundaryconditions(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        Innersphere_boundaryconditions(doubletype* yi, int layer_index, int deg, doubletype omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars){ /*{{{*/
+ 	//fills the boundary conditions at the bottom of layer[layer_index] in yi[0:2][0:5]
+ 
+ 	IssmDouble r = matlitho->radius[layer_index];
+@@ -462,21 +567,24 @@
+ 	IssmDouble ra=matlitho->radius[matlitho->numlayers];
+ 	IssmDouble  g0,r0,mu0, GG;
+ 	int nyi;
+- 	femmodel->parameters->FindParam(&g0,LoveG0Enum);
+- 	femmodel->parameters->FindParam(&r0,LoveR0Enum);
+- 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+- 	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
++
++	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+ 	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++
++	g0=vars->g0;
++	r0=vars->r0;
++	nyi=vars->nyi;
++
+ 	IssmDouble ro=matlitho->density[layer_index];
+ 	IssmDouble issolid=matlitho->issolid[layer_index];
+-	IssmDouble g=GetGravity(r,layer_index,femmodel,matlitho);
+-	IssmDouble la,mu;
++	IssmDouble g=GetGravity(r,layer_index,femmodel,matlitho,vars);
++	doubletype la,mu;
+ 
+ 	if (layer_index==0){
+ 		// radius[0] cannot be 0 for numerical reasons, but below our first interface at radius[0] would in reality be the same material as in the first layer
+-		GetEarthRheology(&la, &mu,layer_index,omega,femmodel,matlitho);   
++		GetEarthRheology<doubletype>(&la, &mu,layer_index,omega,matlitho);   
+ 	} else {
+-		GetEarthRheology(&la, &mu,layer_index-1,omega,femmodel,matlitho);   
++		GetEarthRheology<doubletype>(&la, &mu,layer_index-1,omega,matlitho);   
+ 	}    
+ 
+ 	IssmDouble cst = 4.0*PI*GG*ro;
+@@ -505,21 +613,24 @@
+ 	yi[5+nyi*0]=-cst*r/g0;
+ 	yi[5+nyi*1]=-cst/(r*g0);
+ 	yi[5+nyi*2]=deg/(r*g0);
++
+ }/*}}}*/
+-void build_yi_system(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho) { /*{{{*/
++template <typename doubletype> void        build_yi_system(doubletype* yi, int deg, doubletype omega, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars) { /*{{{*/
+ 
+ 	IssmDouble  g0,r0,mu0,x,ro1, GG;
+ 	int nyi,starting_layer, nstep;
+-	femmodel->parameters->FindParam(&g0,LoveG0Enum);
+-	femmodel->parameters->FindParam(&r0,LoveR0Enum);
++
++	g0=vars->g0;
++	r0=vars->r0;
++	nyi=vars->nyi;
++	starting_layer=vars->starting_layer;
++
+ 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+-	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
+ 	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+-	femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+ 
+-	  IssmDouble xmin,xmax,one,ro,g;
+-	  IssmDouble ra=matlitho->radius[matlitho->numlayers];
++	IssmDouble xmin,xmax,one,ro,g;
++	IssmDouble ra=matlitho->radius[matlitho->numlayers];
+ 
+ 	for (int i=0;i<6*(matlitho->numlayers+1);i++){
+ 		for(int j=0;j<6*(matlitho->numlayers+1);j++){
+@@ -528,9 +639,9 @@
+ 	}
+ 
+ 	int ny,is,ii,jj;
+-	IssmDouble ystart[6];
++	doubletype ystart[6];
+ 	for (int k=0;k<6;k++) ystart[k]=0.0;		
+-  
++
+ 	int ici = 0;   // Index of current interface 
+ 	for (int i = starting_layer; i<matlitho->numlayers;i++){ 
+ 
+@@ -537,35 +648,35 @@
+ 		xmin=matlitho->radius[i]/ra;
+ 		xmax=(matlitho->radius[i+1])/ra;
+ 
+-		  
++
+ 		if (matlitho->issolid[i]){
+-		   		ny = 6;
+-		   		is = 0;
+-		   		one= 1.0;
++			ny = 6;
++			is = 0;
++			one= 1.0;
+ 		} else {	
+-		   		ny = 2;
+-		   		is = 4;
+-		   		one= -1.0;
++			ny = 2;
++			is = 4;
++			one= -1.0;
+ 		}
+-	
+ 
++
+ 		for (int j = 0;j<ny;j++){
+ 			for (int k=0;k<6;k++){ystart[k]=0.0;}
+ 			ystart[j]= 1.0;
+-			  		
++
+ 			// Numerical Integration 
+ 			//propagate_yi_euler(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
+-			propagate_yi_RK2(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
++			propagate_yi_RK2<doubletype>(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
+ 			//propagate_yi_RK4(&ystart[0], xmin, xmax, i, yi_prefactor,femmodel, matlitho);
+ 			// Boundary Condition matrix - propagation part 
+ 			ii = 6*(ici+1)+is;
+ 			jj = 6*(ici+1)+j+is-3;
+ 			for (int kk=0;kk<ny;kk++){
+-		  		yi[(ii+kk)+nyi*jj] = ystart[kk]*one;
++				yi[(ii+kk)+nyi*jj] = ystart[kk]*one;
+ 			}
+ 		}
+-		  
+-		  
++
++
+ 		// Boundary Condition matrix - solid regions
+ 		if (matlitho->issolid[i]){
+ 			one = -1.0;
+@@ -575,7 +686,7 @@
+ 			}
+ 		} else { // Boundary Condition matrix - liquid regions
+ 			ro1=matlitho->density[i];
+-			g=GetGravity(matlitho->radius[i], i, femmodel,matlitho);
++			g=GetGravity(matlitho->radius[i], i, femmodel,matlitho,vars);
+ 			ii = 6*ici;
+ 			yi[ii+nyi*(ii+3)] = -1.0;
+ 			yi[ii+nyi*(ii+4+3)] = -g0/g;
+@@ -584,12 +695,12 @@
+ 			yi[(ii+5)+nyi*(ii+3)]= 4.0*PI*GG*ro1*ra/g0;
+ 			yi[(ii+4)+nyi*(ii+4+3)]=-1.0;
+ 			yi[(ii+5)+nyi*(ii+5+3)]=-1.0;
+-			g=GetGravity(matlitho->radius[i+1], i,femmodel,matlitho);
++			g=GetGravity(matlitho->radius[i+1], i,femmodel,matlitho,vars);
+ 			ii = 6*(ici+1);
+ 			yi[ii+nyi*(ii-1)]=-1.0;
+ 			yi[ii+nyi*(ii+1)]=yi[(ii+4)+nyi*(ii+1)]*g0/g; // yi(17,14) solution integration 1 of z5 CMB
+ 			yi[ii+nyi*(ii+2)]=yi[(ii+4)+nyi*(ii+2)]*g0/g; // yi(17,15) solution integration 2 of z5 CMB
+-			  // yi(13,..) y1 CMB
++			// yi(13,..) y1 CMB
+ 			yi[(ii+1)+nyi*(ii-1)]=-ro1*g*ra/mu0;
+ 			yi[(ii+2)+nyi*(ii)]=-1.0;
+ 			yi[(ii+5)+nyi*(ii-1)]= 4.0*PI*GG*ro1*ra/g0;
+@@ -598,16 +709,16 @@
+ 	}
+ 
+ 
+-  	//-- Internal sphere: integration starts here rather than r=0 for numerical reasons
+-	Innersphere_boundaryconditions(yi, starting_layer, deg, omega, femmodel, matlitho);
++	//-- Internal sphere: integration starts here rather than r=0 for numerical reasons
++	Innersphere_boundaryconditions<doubletype>(yi, starting_layer, deg, omega, femmodel, matlitho,vars);
+ 
+-  	//-- Surface conditions
++	//-- Surface conditions
+ 	yi[(nyi-6)+nyi*(nyi-3)]=-1.0;
+ 	yi[(nyi-4)+nyi*(nyi-2)]=-1.0;
+ 	yi[(nyi-2)+nyi*(nyi-1)]=-1.0;
+ 	yi[(nyi-1)+nyi*(nyi-1)]=deg+1.0;
+ 
+-  	//-- Degree 1 special case
++	//-- Degree 1 special case
+ 	if(deg==1){
+ 		for (int i=0;i<nyi;i++){
+ 			yi[(nyi-1)+nyi*i]=0.0;
+@@ -614,22 +725,26 @@
+ 		}
+ 		yi[(nyi-1)+nyi*(nyi-1)]=1.0;
+ 	}
++
+ }/*}}}*/
+-void yi_boundary_conditions(IssmDouble* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        yi_boundary_conditions(doubletype* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars){ /*{{{*/
+ 
+ 	IssmDouble  g0,r0,mu0,ra,rb,rc;
+-	int nyi, forcing_type,icb,cmb;
++	int nyi, forcing_type,icb,cmb,starting_layer;
+ 	IssmDouble* EarthMass;
+-	femmodel->parameters->FindParam(&g0,LoveG0Enum);
+-	femmodel->parameters->FindParam(&r0,LoveR0Enum);
++
++	g0=vars->g0;
++	r0=vars->r0;
++	nyi=vars->nyi;
++	starting_layer=vars->starting_layer;
++	EarthMass=vars->EarthMass;
++
+ 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+-	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
+ 	femmodel->parameters->FindParam(&forcing_type,LoveForcingTypeEnum);
+ 	femmodel->parameters->FindParam(&icb,LoveInnerCoreBoundaryEnum);
+ 	femmodel->parameters->FindParam(&cmb,LoveCoreMantleBoundaryEnum);
+-	femmodel->parameters->FindParam(&EarthMass,&matlitho->numlayers,LoveEarthMassEnum);
+-	  
+-   	// In Case of a Inner Core - Outer Core - Mantle planet and Boundary conditions on these 3 interfaces
++
++	// In Case of a Inner Core - Outer Core - Mantle planet and Boundary conditions on these 3 interfaces
+ 	ra=matlitho->radius[matlitho->numlayers];	
+ 	rb=0;
+ 	rc=0;
+@@ -641,77 +756,80 @@
+ 	}
+ 
+ 	IssmDouble ro_mean=EarthMass[matlitho->numlayers-1]/(4.0/3.0*PI*pow(ra,3.0));
+-	xDelete<IssmDouble>(EarthMass);
+ 
+ 	for (int i=0;i<(matlitho->numlayers+1)*6;i++) yi_righthandside[i]=0.0;
+ 
+ 	switch (forcing_type) {
+ 
+-	//-- forcings at the Inner Core Boundary
+-   	case 1:	//'ICB --Volumetric Potential'
+-		yi_righthandside[6*icb+5]=(deg)/(rc*g0);
+-		yi_righthandside[6*icb+4]=1.0/(ra*g0);
+-		break;
+-	case 2: //'ICB --Pressure'
+-		yi_righthandside[6*icb+1]=-ro_mean/mu0;
+-		break;
+-	case 3://'ICB --Loading'
+-		yi_righthandside[6*icb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rc;
+-		yi_righthandside[6*icb+5]= (2.0*deg+1.0)/(rc*g0);
+-		break;
+-	case 4://'ICB --Tangential Traction'
+-		yi_righthandside[6*icb+3]= ro_mean/mu0;
+-		break;
++		//-- forcings at the Inner Core Boundary
++		case 1:	//'ICB --Volumetric Potential'
++			yi_righthandside[6*icb+5]=(deg)/(rc*g0);
++			yi_righthandside[6*icb+4]=1.0/(ra*g0);
++			break;
++		case 2: //'ICB --Pressure'
++			yi_righthandside[6*icb+1]=-ro_mean/mu0;
++			break;
++		case 3://'ICB --Loading'
++			yi_righthandside[6*icb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rc;
++			yi_righthandside[6*icb+5]= (2.0*deg+1.0)/(rc*g0);
++			break;
++		case 4://'ICB --Tangential Traction'
++			yi_righthandside[6*icb+3]= ro_mean/mu0;
++			break;
+ 
+-	//--forcings at the Core Mantle Boundary
+-	case 5://'CMB --Volumetric Potential'
+-		yi_righthandside[6*cmb+1]=-ro_mean/mu0*ra/rb;
+-		yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
+-		break;
+-	case 6://'CMB --Pressure'
+-		yi_righthandside[6*cmb+1]=-ro_mean/mu0;
+-		break;
+-	case 7://'CMB --Loading'
+-		yi_righthandside[6*cmb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rb;
+-		yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
+-		break;
+-	case 8://'CMB --Tangential Traction'
+-		yi_righthandside[6*cmb+3]=-ro_mean/mu0;
+-		break;
++			//--forcings at the Core Mantle Boundary
++		case 5://'CMB --Volumetric Potential'
++			yi_righthandside[6*cmb+1]=-ro_mean/mu0*ra/rb;
++			yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
++			break;
++		case 6://'CMB --Pressure'
++			yi_righthandside[6*cmb+1]=-ro_mean/mu0;
++			break;
++		case 7://'CMB --Loading'
++			yi_righthandside[6*cmb+1]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0)*ra/rb;
++			yi_righthandside[6*cmb+5]= (2.0*deg+1.0)/(rb*g0);
++			break;
++		case 8://'CMB --Tangential Traction'
++			yi_righthandside[6*cmb+3]=-ro_mean/mu0;
++			break;
+ 
+-	//--forcings at the surface
+-	case 9://'SURF--Volumetric Potential'
+-		if (deg>1) yi_righthandside[nyi-1]=(2.0*deg+1.0)/(ra*g0);
+-		break;
+-	case 10://'SURF--Pressure'
+-		yi_righthandside[nyi-5]=-ro_mean/mu0;
+-		break;
+-	case 11://'SURF--Loading'
+-		yi_righthandside[nyi-5]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0);
+-		if (deg>1) yi_righthandside[nyi-1]= (2.0*deg+1.0)/(ra*g0);
+-		break;
+-	case 12://'SURF--Tangential Traction'
+-		yi_righthandside[nyi-3]= ro_mean/mu0;
+-		break;
+-	default:
+-		_error_("love core error: forcing_type not supported yet");
++			//--forcings at the surface
++		case 9://'SURF--Volumetric Potential'
++			if (deg>1) yi_righthandside[nyi-1]=(2.0*deg+1.0)/(ra*g0);
++			break;
++		case 10://'SURF--Pressure'
++			yi_righthandside[nyi-5]=-ro_mean/mu0;
++			break;
++		case 11://'SURF--Loading'
++			yi_righthandside[nyi-5]=-ro_mean*(2.0*deg+1.0)/(3.0*mu0);
++			if (deg>1) yi_righthandside[nyi-1]= (2.0*deg+1.0)/(ra*g0);
++			break;
++		case 12://'SURF--Tangential Traction'
++			yi_righthandside[nyi-3]= ro_mean/mu0;
++			break;
++		default:
++			_error_("love core error: forcing_type not supported yet");
+ 	}
+ }/*}}}*/
+-void solve_yi_system(IssmDouble* loveh, IssmDouble* lovel, IssmDouble* lovek, int deg, IssmDouble omega, IssmDouble* yi, IssmDouble* rhs, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        solve_yi_system(doubletype* loveh, doubletype* lovel, doubletype* lovek, int deg, doubletype omega, doubletype* yi, doubletype* rhs, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars){ /*{{{*/
+ 
+ 	IssmDouble  g0,r0,mu0,loveratio,underflow_tol;
+ 	IssmDouble* frequencies;
+ 	int nyi,starting_layer, dummy;
+ 	bool allow_layer_deletion;
+-	femmodel->parameters->FindParam(&g0,LoveG0Enum);
+-	femmodel->parameters->FindParam(&r0,LoveR0Enum);
++	IssmDouble* EarthMass=NULL;
++
++	g0=vars->g0;
++	r0=vars->r0;
++	nyi=vars->nyi;
++	starting_layer=vars->starting_layer;
++	EarthMass=vars->EarthMass;
++
+ 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+-	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
+-	femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
+ 	femmodel->parameters->FindParam(&allow_layer_deletion,LoveAllowLayerDeletionEnum);
+ 	femmodel->parameters->FindParam(&underflow_tol,LoveUnderflowTolEnum);
+ 	femmodel->parameters->FindParam(&frequencies,&dummy,LoveFrequenciesEnum);
+- 	IssmDouble ra=matlitho->radius[matlitho->numlayers];
++	IssmDouble ra=matlitho->radius[matlitho->numlayers];
+ 	bool exit=false;
+ 	int lda,ldb;
+ 
+@@ -718,8 +836,8 @@
+ 	for(;!exit;){ //cycles of: attempt to solve the yi system, then delete a layer if necessary
+ 		lda=nyi;
+ 		ldb=nyi;
+-		IssmDouble*  yilocal=xNew<IssmDouble>(nyi*nyi); // we will need to redeclare these inside here as nyi changes
+-		IssmDouble*  rhslocal=xNew<IssmDouble>(nyi);
++		doubletype*  yilocal=xNew<doubletype>(nyi*nyi); // we will need to redeclare these inside here as nyi changes
++		doubletype*  rhslocal=xNew<doubletype>(nyi);
+ 
+ 		//we need to do a local copy of yi,rhs to send them to LAPACK with the appropriate size and to keep the original matrices in case layers are deleted and we need to try again
+ 		for (int i=0;i<nyi;i++){ 
+@@ -733,10 +851,11 @@
+ 		int info = 0;// error checker
+ 		int nrhs=1; // number of right hand size columns
+ 
+-		dgesv_(&nyi, &nrhs, yilocal, &lda, ipiv, rhslocal, &ldb, &info);
++		allgesv<doubletype>(&nyi, &nrhs, yilocal, &lda, ipiv, rhslocal, &ldb, &info);
++		
+ 		xDelete<int>(ipiv);
+-
+-		if(VerboseSolution() && info!=0){ 
++		
++		if(VerboseModule() && info!=0){ 
+ 			_printf0_("love core warning in DGESV : LAPACK linear equation solver couldn't resolve the system");
+ 			printf("%s %s %s %s\n", "i","j","yi[i+nyi*j]","rhs[i]");
+ 			for (int i=0;i<nyi;i++){
+@@ -750,20 +869,23 @@
+ 		*lovel = rhslocal[nyi-2]*ra*g0;
+ 		*lovek = rhslocal[nyi-1]*ra*g0;
+ 
+-		IssmDouble loveh1 = rhslocal[3];
+-		IssmDouble lovel1 = rhslocal[5];
+-		IssmDouble lovek1 = rhslocal[7] - pow(matlitho->radius[starting_layer]/ra,deg)/(g0*ra);
++		doubletype loveh1 = rhslocal[3];
++		doubletype lovel1 = rhslocal[5];
++		doubletype lovek1 = rhslocal[7] - pow(matlitho->radius[starting_layer]/ra,deg)/(g0*ra);
+ 
+-		IssmDouble loveh1s = rhslocal[nyi-3];
+-		IssmDouble lovel1s = rhslocal[nyi-2];
+-		IssmDouble lovek1s = rhslocal[nyi-1] - 1.0/(g0*ra);
++		doubletype loveh1s = rhslocal[nyi-3];
++		doubletype lovel1s = rhslocal[nyi-2];
++		doubletype lovek1s = rhslocal[nyi-1] - 1.0/(g0*ra);
+ 
+ 		loveratio = abs(loveh1/loveh1s); //ratio of center to surface love numbers, determines if we should remove layers
+ 		if (abs(lovel1/lovel1s) < loveratio) loveratio = abs(lovel1/lovel1s); 
+ 		if (abs(lovek1/lovek1s) < loveratio) loveratio = abs(lovek1/lovek1s);
+ 
+-		if (!allow_layer_deletion || nyi<=12 || omega!=2.0*PI*frequencies[0]){ //We are not allowed to delete layers, or there is only one layer left. We also don't want to delete layers in the middle of a loop on frequencies, as that can lead to a jump that would compromise the inverse laplace transform.
++		if (!allow_layer_deletion || nyi<=12 || omega!=angular_frequency<doubletype>(frequencies[0])){ 
+ 			goto save_results;
++			/*We are not allowed to delete layers, or there is only one layer left. We also don't want to delete 
++			  layers in the middle of a loop on frequencies, as that can lead to a jump that would compromise the 
++			  inverse laplace transform.*/
+ 		}
+ 
+ 		if (loveratio<=underflow_tol || xIsNan(loveratio) || xIsInf(loveratio)){//We need to delete a layer and try again if the ratio between deepest love number to surface love number is too low (risk of underflow) or garbage
+@@ -774,10 +896,9 @@
+ 			}
+ 			nyi-=6;
+ 			starting_layer+=1;
+-			femmodel->parameters->SetParam(nyi,LoveNYiEquationsEnum);
+-			femmodel->parameters->SetParam(starting_layer,LoveStartingLayerEnum);
++			vars->nyi=nyi;
++			vars->starting_layer=starting_layer;
+ 
+-
+ 			for (int i=0;i<nyi;i++){//shift everything down by 1 layer
+ 				rhs[i]=rhs[i+6];
+ 				for (int j=0;j<nyi;j++){
+@@ -785,10 +906,10 @@
+ 				}
+ 			}
+ 
+-			Innersphere_boundaryconditions(yi, starting_layer, deg, omega, femmodel, matlitho); //we move the first interface to the new starting layer. yi[0:2,0:5] will be different
++			Innersphere_boundaryconditions<doubletype>(yi, starting_layer, deg, omega, femmodel, matlitho,vars); //we move the first interface to the new starting layer. yi[0:2,0:5] will be different
+ 		} else { //we are ready to save the outputs and break the main loop
+ 
+-		save_results:
++save_results:
+ 			for (int i=0;i<nyi;i++){
+ 				rhs[i]=rhslocal[i];
+ 				for (int j=0;j<nyi;j++){
+@@ -810,164 +931,110 @@
+ 			}
+ 
+ 			exit = true;
+-	  	}
+-		xDelete<IssmDouble>(yilocal);
+-		xDelete<IssmDouble>(rhslocal);
+-  	}
+-	xDelete<IssmDouble>(frequencies);	
+-}/*}}}*/
+-IssmDouble factorial(int n){ /*{{{*/
+-	IssmDouble prod=1;
+-	for (int i=2;i<n+1;i++) prod*=i;
+-	return prod;
+-}/*}}}*/
+-IssmDouble n_C_r(int n, int r){ /*{{{*/ 
+-	//n choose r
+-        int primes[169] = 
+-  {2,    3,    5,    7,   11,   13,   17,   19,   23,   29,  
+-  31,   37,   41,   43,   47,   53,   59,   61,   67,   71,  
+-  73,   79,   83,   89,   97,  101,  103,  107,  109,  113,  
+- 127,  131,  137,  139,  149,  151,  157,  163,  167,  173,  
+- 179,  181,  191,  193,  197,  199,  211,  223,  227,  229,  
+- 233,  239,  241,  251,  257,  263,  269,  271,  277,  281,  
+- 283,  293,  307,  311,  313,  317,  331,  337,  347,  349,  
+- 353,  359,  367,  373,  379,  383,  389,  397,  401,  409,  
+- 419,  421,  431,  433,  439,  443,  449,  457,  461,  463,  
+- 467,  479,  487,  491,  499,  503,  509,  521,  523,  541,  
+- 547,  557,  563,  569,  571,  577,  587,  593,  599,  601,  
+- 607,  613,  617,  619,  631,  641,  643,  647,  653,  659,  
+- 661,  673,  677,  683,  691,  701,  709,  719,  727,  733,  
+- 739,  743,  751,  757,  761,  769,  773,  787,  797,  809,  
+- 811,  821,  823,  827,  829,  839,  853,  857,  859,  863,  
+- 877,  881,  883,  887,  907,  911,  919,  929,  937,  941,  
+- 947,  953,  967,  971,  977,  983,  991,  997, 1009};
+-	int num, den;
+-        num = 1;
+-        den = 1;
+-
+-	for (int i=0;i<r;i++){
+-		num = num*(n-i);
+-		den = den*(i+1);
+-		if (i>0) {
+-			// Divide out common prime factors
+-			for (int k=0;k<169;k++){ //169 is the length of the prime vector here
+-				if ( i % primes[k] == 0) { // modulo
+-			                num = num/primes[k];
+-			                den = den/primes[k];
+-		        	}
+-		        }
+ 		}
++		xDelete<doubletype>(yilocal);
++		xDelete<doubletype>(rhslocal);
+ 	}
++	xDelete<IssmDouble>(frequencies);	
+ 
+-	IssmDouble res;        
+-	return res = num/den;
+ }/*}}}*/
+-IssmDouble* postwidder_coef(int NTit){ /*{{{*/
+-	//Coefficients of the Post-Widder method through Saltzer summation for inverse Laplace transform:
+-	//The Mth iteration estimate will be: f(t)_M = sum_{k=1:2*M}(xi_[M,k] * f(s_k))
+-	//The method is based on equations (2), (6), (7) in: 
+-	//Valko PP, Abate J. Comparison of sequence accelerators for the Gaver method of numerical Laplace transform inversion. Computational Mathematics and Applications. (2004)
+-	//Note that the coefficients xi lack the factor s=k*log(2)/t. 
+-	//That is because we are computing the heaviside response of the system rather than its impulse response, 
+-	//and Laplace_Transform(Heaviside(t).*f(t)) = f(s)/s. So s cancels out in the sum for f(t)_M.
+-
+-	IssmDouble* xi=xNewZeroInit<IssmDouble>(2*NTit*NTit);
+-	int indxi;
+-	for (int M=1;M<NTit+1;M++){
+-		for (int k=1;k<2*M+1;k++){
+-		indxi=(M-1)*(2*NTit)+k-1;
+-		    for (int j=floor((k+1)/2);j<min(k,M)+1;j++){
+-			    xi[indxi]+=pow(j,M+1.0)/factorial(M)*n_C_r(M,j)*n_C_r(2*j,j)*n_C_r(j,k-j);
+-		    }
+-		    xi[indxi]*=pow(-1.0,k+M)/k;
+-		}
+-	}
+-	return xi;
+-}/*}}}*/
+-void postwidder_transform(IssmDouble* Lovet, IssmDouble* Lovef,int d, int t, int NTit, IssmDouble* xi, FemModel* femmodel){ /*{{{*/
+-	//Computes Lovet for time step t and degree d from the PW coefficients xi and the corresponding 2*NTit frequency samples in Lovef
+-
+-	int nfreq, indxi, indf;
+-	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
+-	int nt=nfreq/2/NTit;
+-
+-	indf=d*nfreq+t*2*NTit;
+-	IssmDouble LoveM[NTit];
+-
+-	for (int M=1;M<NTit+1;M++){
+-		LoveM[M-1]=0.0;
+-		for (int k=1;k<2*M+1;k++){
+-			indxi=(M-1)*(2*NTit)+k-1;
+-			LoveM[M-1]+=xi[indxi]*Lovef[indf+k-1];
+-		}
+-		
+-		//Make sure we are not getting into numerical instability
+-		//Diverging once: ok, we'll give that the benefit of the doubt, it can be an inflexion point in the convergence series
+-		//Diverging twice in a row: we are definitely propagating numerical error: revert to the last stable value and exit
+-		if (M>3){ 
+-			if ( abs(LoveM[M-1]-LoveM[M-2]) > abs(LoveM[M-2]-LoveM[M-3]) &&
+-			     abs(LoveM[M-2]-LoveM[M-3]) > abs(LoveM[M-3]-LoveM[M-4]) ){
+-				Lovet[d*nt+t]=LoveM[M-3];
+-				return;
+-			}
+-		}
+-	}
+-	Lovet[d*nt+t]=LoveM[NTit-1];
+-}/*}}}*/
+-void love_freq_to_temporal(IssmDouble* LoveHt,IssmDouble* LoveLt,IssmDouble* LoveKt,IssmDouble* LoveHf,IssmDouble* LoveLf,IssmDouble* LoveKf, FemModel* femmodel){ /*{{{*/
++template <typename doubletype> void        love_freq_to_temporal(doubletype* LoveHt,doubletype* LoveLt,doubletype* LoveKt,doubletype* LoveHf,doubletype* LoveLf,doubletype* LoveKf, FemModel* femmodel){ /*{{{*/
+ 	//Transforms all frequency-dependent love numbers into time-dependent love numbers
+ 	int nfreq,sh_nmax,sh_nmin,indxi,indf, NTit;
+-	IssmDouble meanh,meanl,meank,dh,dl,dk;
+ 
+ 	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
+ 	femmodel->parameters->FindParam(&sh_nmax,LoveShNmaxEnum);
+ 	femmodel->parameters->FindParam(&sh_nmin,LoveShNminEnum);
+ 	femmodel->parameters->FindParam(&NTit,LoveNTemporalIterationsEnum);
+-	
++
+ 	int nt=nfreq/2/NTit;
+-	IssmDouble* xi=postwidder_coef(NTit);
++	doubletype* xi=postwidder_coef<doubletype>(NTit);
+ 
+ 	for (int d=sh_nmin;d<sh_nmax+1;d++){
+ 		for (int t=0;t<nt;t++){
+-			postwidder_transform(LoveHt,LoveHf,d,t,NTit,xi,femmodel);
+-			postwidder_transform(LoveLt,LoveLf,d,t,NTit,xi,femmodel);
+-			postwidder_transform(LoveKt,LoveKf,d,t,NTit,xi,femmodel);
++			postwidder_transform<doubletype>(LoveHt,LoveHf,d,t,NTit,xi,femmodel);
++			postwidder_transform<doubletype>(LoveLt,LoveLf,d,t,NTit,xi,femmodel);
++			postwidder_transform<doubletype>(LoveKt,LoveKf,d,t,NTit,xi,femmodel);
+ 		}
+ 	}
+-	xDelete<IssmDouble>(xi);
++	xDelete<doubletype>(xi);
+ }/*}}}*/
+-void love_core(FemModel* femmodel){ /*{{{*/
+ 
+-	/*recover materials parameters: there is only one Matlitho, chase it down the hard way:*/
+-	Matlitho* matlitho=NULL;
+-	for (Object* & object: femmodel->materials->objects){
+-		Material* material=xDynamicCast<Material*>(object);
+-		if(material->ObjectEnum()==MatlithoEnum){
+-			matlitho=xDynamicCast<Matlitho*>(material);
+-			break;
++/*templated cores:*/
++LoveVariables*                             love_init(FemModel* femmodel, Matlitho* matlitho){/*{{{*/
++
++	/*initialize Planet_Mass(r) for efficient computation of gravity, value of surface gravity and inital size of the yi equation system*/
++
++	bool        verbosemod = (int)VerboseModule();
++	int         numlayers  = matlitho->numlayers;
++	IssmDouble* r          = matlitho->radius;
++	IssmDouble  r1,r2,ro, GG;
++	
++	/*outputs:*/
++	IssmDouble* EarthMass=NULL;
++	IssmDouble  g0,r0;
++	int         nyi,starting_layer;
++
++	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
++	EarthMass=xNewZeroInit<IssmDouble>(numlayers+1);
++
++	for (int i=0;i<numlayers;i++){
++		r2 = r[i+1];
++		ro = matlitho->density[i];
++		if (i==0){
++			EarthMass[i] = ro*pow(r2,3.0)*4.0*PI/3.0;
++		}else{
++			r1=r[i];
++			EarthMass[i] = EarthMass[i-1] + ro*(pow(r2,3.0)-pow(r1,3.0))*4.0*PI/3.0;;
+ 		}
+ 	}
+-	_assert_(matlitho);
+ 
+-	/*love parameters: */
++	g0=EarthMass[numlayers-1]*GG/pow(r[numlayers],2.0);
++	r0=r[numlayers];
++	nyi=6*(numlayers+1);
++	starting_layer=0;
++	
++	return new LoveVariables(EarthMass,g0,r0,nyi,starting_layer);
++
++} /*}}}*/
++template <typename doubletype> void        love_core_template(FemModel* femmodel){ /*{{{*/
++
++	Matlitho*   matlitho=NULL;
+ 	int         nfreq,nyi,starting_layer,nstep,forcing_type,dummy;
+ 	int         sh_nmin,sh_nmax,kernel_index,deleted_layer_offset;
+ 	bool        allow_layer_deletion,love_kernels, istemporal;
+ 	bool        verbosemod = (int)VerboseModule();
+-	IssmDouble lovek, loveh, lovel, loveratio;
+-	IssmDouble  g0,r0,mu0, underflow_tol, omega;
++	IssmDouble  g0,r0,mu0, underflow_tol;
+ 	IssmDouble *frequencies = NULL;
++	bool        save_results;
++	bool        complex_computation;
+ 
+-	/*parameters: */
+-	bool save_results;
++	doubletype  omega;
++	doubletype  lovek, loveh, lovel, loveratio;
+ 
++	doubletype*  LoveKf = NULL;
++	doubletype*  LoveHf = NULL;
++	doubletype*  LoveLf = NULL;
++	doubletype*  LoveKernels= NULL;
++	LoveVariables* vars=NULL;
++	doubletype* yi_prefactor=NULL;
++	doubletype* yi_righthandside=NULL;
++	doubletype* yi=NULL;
++
+ 	if(VerboseSolution()) _printf0_("   computing LOVE numbers\n");
+ 
+-	/*Recover some parameters: */
++	/*recover materials parameters: there is only one Matlitho, chase it down the hard way:*/
++	for (Object* & object: femmodel->materials->objects){
++		Material* material=xDynamicCast<Material*>(object);
++		if(material->ObjectEnum()==MatlithoEnum){
++			matlitho=xDynamicCast<Matlitho*>(material);
++			break;
++		}
++	}
++	_assert_(matlitho);
++
++	/*recover parameters: */
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-
+-	/*recover love number parameters: */
+-
+ 	femmodel->parameters->FindParam(&nfreq,LoveNfreqEnum);
+ 	femmodel->parameters->FindParam(&frequencies,&dummy,LoveFrequenciesEnum); _assert_(nfreq==dummy);
+ 	femmodel->parameters->FindParam(&sh_nmax,LoveShNmaxEnum);
+@@ -980,86 +1047,83 @@
+ 	femmodel->parameters->FindParam(&forcing_type,LoveForcingTypeEnum);
+ 	femmodel->parameters->FindParam(&istemporal,LoveIsTemporalEnum);
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
++	femmodel->parameters->FindParam(&complex_computation,LoveComplexComputationEnum);
+ 
++
+ 	/*Initialize three love matrices: geoid, vertical and horizontal displacement (real and imaginary parts) */
+-	IssmDouble*  LoveKf = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+-	IssmDouble*  LoveHf = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
+-	IssmDouble*  LoveLf = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	LoveKf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
++	LoveHf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
++	LoveLf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
+ 
+ 	/*Initialize love kernels (real and imaginary parts): */
+-	IssmDouble*  LoveKernelsReal = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
+-	IssmDouble*  LoveKernelsImag = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
++	LoveKernels= xNewZeroInit<doubletype>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
+ 
+-	love_init(femmodel,matlitho);
+-	femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum);
+-	femmodel->parameters->FindParam(&starting_layer,LoveStartingLayerEnum);
+-	IssmDouble* yi_prefactor=xNewZeroInit<IssmDouble>(6*6*nstep*matlitho->numlayers);
+-	IssmDouble* yi_righthandside=xNewZeroInit<IssmDouble>(nyi);
+-	IssmDouble* yi=xNewZeroInit<IssmDouble>(nyi*nyi);
++	vars=love_init(femmodel,matlitho);
+ 
++	yi_prefactor=xNewZeroInit<doubletype>(6*6*nstep*matlitho->numlayers);
++	yi_righthandside=xNewZeroInit<doubletype>(vars->nyi);
++	yi=xNewZeroInit<doubletype>(vars->nyi*vars->nyi);
++
+ 	//precalculate yi coefficients that do not depend on degree or frequency
+-	fill_yi_prefactor(yi_prefactor, NULL, NULL,femmodel, matlitho); 
++	fill_yi_prefactor<doubletype>(yi_prefactor, NULL, NULL,femmodel, matlitho,vars); 
+ 	for(int deg=sh_nmin;deg<sh_nmax+1;deg++){
+ 
+ 		//precalculate yi coefficients that depend on degree but not frequency
+-		fill_yi_prefactor(yi_prefactor, &deg, NULL,femmodel, matlitho); 
++		fill_yi_prefactor<doubletype>(yi_prefactor, &deg, NULL,femmodel, matlitho,vars); 
+ 
+ 		for (int fr=0;fr<nfreq;fr++){
+-			omega=2.0*PI*frequencies[fr]; //angular frequency
++			omega=angular_frequency<doubletype>(frequencies[fr]);
+ 
+ 			//precalculate yi coefficients that depend on degree and frequency
+-			fill_yi_prefactor(yi_prefactor, &deg,&omega,femmodel, matlitho); 
++			fill_yi_prefactor<doubletype>(yi_prefactor, &deg,&omega,femmodel, matlitho,vars); 
+ 
+-			yi_boundary_conditions(yi_righthandside,deg,femmodel,matlitho); 
++			yi_boundary_conditions<doubletype>(yi_righthandside,deg,femmodel,matlitho,vars); 
+ 
+-			build_yi_system(yi,deg,omega,yi_prefactor,femmodel,matlitho);
++			build_yi_system<doubletype>(yi,deg,omega,yi_prefactor,femmodel,matlitho,vars);
+ 
+-			solve_yi_system(&loveh,&lovel,&lovek, deg, omega, yi, yi_righthandside,femmodel, matlitho);
++			solve_yi_system<doubletype>(&loveh,&lovel,&lovek, deg, omega, yi, yi_righthandside,femmodel, matlitho,vars);
+ 
+ 			LoveHf[deg*nfreq+fr]=loveh;
+ 			LoveKf[deg*nfreq+fr]=lovek-1.0;
+ 			LoveLf[deg*nfreq+fr]=lovel;
+ 
+-			femmodel->parameters->FindParam(&nyi,LoveNYiEquationsEnum); //synchronize nyi in case we deleted a layer
+-			deleted_layer_offset=(matlitho->numlayers+1)*6-nyi;// =6 per deleted layer
+-			kernel_index=deg*nfreq*(matlitho->numlayers+1)*6 +
+-					    fr*(matlitho->numlayers+1)*6 +
+-					        deleted_layer_offset;
+-			for (int i=0;i<nyi;i++){
+-				LoveKernelsReal[kernel_index+i]=yi_righthandside[i];
++			deleted_layer_offset=(matlitho->numlayers+1)*6-vars->nyi;// =6 per deleted layer
++			kernel_index=deg*nfreq*(matlitho->numlayers+1)*6 + fr*(matlitho->numlayers+1)*6 + deleted_layer_offset;
++			for (int i=0;i<vars->nyi;i++){
++				LoveKernels[kernel_index+i]=yi_righthandside[i];
+ 			}
+ 		}
+ 	}
+ 
+ 
+-	xDelete<IssmDouble>(yi);
+-	xDelete<IssmDouble>(yi_righthandside);
++	xDelete<doubletype>(yi);
++	xDelete<doubletype>(yi_righthandside);
+ 
+ 
+ 	//Temporal love numbers
+-	if (istemporal){
++	if (istemporal && !complex_computation){
+ 		int NTit;
+ 		femmodel->parameters->FindParam(&NTit,LoveNTemporalIterationsEnum);
+ 		int nt = nfreq/2/NTit;
+ 
+-		IssmDouble* LoveHt=xNewZeroInit<IssmDouble>((sh_nmax+1)*nt);
+-		IssmDouble* LoveLt=xNewZeroInit<IssmDouble>((sh_nmax+1)*nt);
+-		IssmDouble* LoveKt=xNewZeroInit<IssmDouble>((sh_nmax+1)*nt);
++		doubletype* LoveHt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
++		doubletype* LoveLt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
++		doubletype* LoveKt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
+ 
+-		love_freq_to_temporal(LoveHt,LoveLt,LoveKt,LoveHf,LoveLf,LoveKf,femmodel);
++		love_freq_to_temporal<doubletype>(LoveHt,LoveLt,LoveKt,LoveHf,LoveLf,LoveKf,femmodel);
+ 
+-		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKt,sh_nmax+1,nt,0,0));
+-		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHt,sh_nmax+1,nt,0,0));
+-		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLrEnum,LoveLt,sh_nmax+1,nt,0,0));
++		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKrEnum,LoveKt,sh_nmax+1,nt,0,0));
++		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHrEnum,LoveHt,sh_nmax+1,nt,0,0));
++		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveLrEnum,LoveLt,sh_nmax+1,nt,0,0));
+ 
+-		xDelete<IssmDouble>(LoveHt);
+-		xDelete<IssmDouble>(LoveLt);
+-		xDelete<IssmDouble>(LoveKt);
++		xDelete<doubletype>(LoveHt);
++		xDelete<doubletype>(LoveLt);
++		xDelete<doubletype>(LoveKt);
+ 	}
+ 
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKiEnum,LoveKf,sh_nmax+1,nfreq,0,0));
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHf,sh_nmax+1,nfreq,0,0));
+-	femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLf,sh_nmax+1,nfreq,0,0));
++	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKiEnum,LoveKf,sh_nmax+1,nfreq,0,0));
++	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHiEnum,LoveHf,sh_nmax+1,nfreq,0,0));
++	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveLiEnum,LoveLf,sh_nmax+1,nfreq,0,0));
+ 
+ 
+ 	/*call the main module: */
+@@ -1081,18 +1145,52 @@
+ 
+ 	/*Only when love_kernels is on*/
+ 	if (love_kernels==1) {
+-		femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsRealEnum,LoveKernelsReal,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
++		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKernelsEnum,LoveKernels,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+ 		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+ 	}
+ 
+ 	/*Free resources:*/
+ 	xDelete<IssmDouble>(frequencies);
+-	xDelete<IssmDouble>(LoveKf);
+-	xDelete<IssmDouble>(LoveHf);
+-	xDelete<IssmDouble>(LoveLf);
+-	//xDelete<IssmDouble>(LoveKi);
+-	//xDelete<IssmDouble>(LoveHi);
++	xDelete<doubletype>(LoveKf);
++	xDelete<doubletype>(LoveHf);
++	xDelete<doubletype>(LoveLf);
+ 	//xDelete<IssmDouble>(LoveLi);
+-	xDelete<IssmDouble>(LoveKernelsReal);
+-	xDelete<IssmDouble>(LoveKernelsImag);
++	xDelete<doubletype>(LoveKernels);
+ } /*}}}*/
++
++/*cores and template instantiations:*/
++/*template instantiations :{{{*/
++template void love_core_template<IssmDouble>(FemModel* femmodel);
++template void love_core_template<IssmComplex>(FemModel* femmodel);
++template void        fill_yi_prefactor<IssmDouble>(IssmDouble* yi_prefactor, int* pdeg, IssmDouble* pomega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
++template void        fill_yi_prefactor<IssmComplex>(IssmComplex* yi_prefactor, int* pdeg, IssmComplex* pomega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
++template void        GetEarthRheology<IssmDouble>(IssmDouble* pla, IssmDouble* pmu, int layer_index, IssmDouble omega,  Matlitho* matlitho);
++template void        GetEarthRheology<IssmComplex>(IssmComplex* pla, IssmComplex* pmu, int layer_index, IssmComplex omega,  Matlitho* matlitho);
++template void        yi_boundary_conditions<IssmDouble>(IssmDouble* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
++template void        yi_boundary_conditions<IssmComplex>(IssmComplex* yi_righthandside, int deg, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
++template void        yi_derivatives<IssmDouble>(IssmDouble* dydx, IssmDouble* y, int layer_index, int n, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
++template void        yi_derivatives<IssmComplex>(IssmComplex* dydx, IssmComplex* y, int layer_index, int n, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
++template void        propagate_yi_RK2<IssmDouble>(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
++template void        propagate_yi_RK2<IssmComplex>(IssmComplex* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
++template void        Innersphere_boundaryconditions<IssmDouble>(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
++template void        Innersphere_boundaryconditions<IssmComplex>(IssmComplex* yi, int layer_index, int deg, IssmComplex omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
++template void        build_yi_system<IssmDouble>(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
++template void        build_yi_system<IssmComplex>(IssmComplex* yi, int deg, IssmComplex omega, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
++template void        solve_yi_system<IssmDouble>(IssmDouble* loveh, IssmDouble* lovel, IssmDouble* lovek, int deg, IssmDouble omega, IssmDouble* yi, IssmDouble* rhs, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
++template void        solve_yi_system<IssmComplex>(IssmComplex* loveh, IssmComplex* lovel, IssmComplex* lovek, int deg, IssmComplex omega, IssmComplex* yi, IssmComplex* rhs, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
++template IssmDouble  factorial<IssmDouble>(int n);
++template IssmDouble* postwidder_coef<IssmDouble>(int NTit);
++template IssmDouble  n_C_r<IssmDouble>(int n, int r);
++template void         postwidder_transform<IssmDouble>(IssmDouble* Lovet, IssmDouble* Lovef,int d, int t, int NTit, IssmDouble* xi, FemModel* femmodel);
++
++/*}}}*/
++void           love_core(FemModel* femmodel){ /*{{{*/
++
++	bool        complex_computation;
++
++	femmodel->parameters->FindParam(&complex_computation,LoveComplexComputationEnum);
++
++	if(complex_computation) love_core_template<IssmComplex>(femmodel);
++	else                    love_core_template<IssmDouble>(femmodel);
++
++} /*}}}*/
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26241)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26242)
+@@ -255,15 +255,26 @@
+ syn keyword cConstant LevelsetStabilizationEnum
+ syn keyword cConstant LockFileNameEnum
+ syn keyword cConstant LoveAllowLayerDeletionEnum
++syn keyword cConstant LoveCoreMantleBoundaryEnum
++syn keyword cConstant LoveEarthMassEnum
+ syn keyword cConstant LoveForcingTypeEnum
+ syn keyword cConstant LoveFrequenciesEnum
++syn keyword cConstant LoveIsTemporalEnum
+ syn keyword cConstant LoveG0Enum
++syn keyword cConstant LoveGravitationalConstantEnum
++syn keyword cConstant LoveInnerCoreBoundaryEnum
++syn keyword cConstant LoveComplexComputationEnum
++syn keyword cConstant LoveIntStepsPerLayerEnum
+ syn keyword cConstant LoveKernelsEnum
+ syn keyword cConstant LoveMu0Enum
+ syn keyword cConstant LoveNfreqEnum
++syn keyword cConstant LoveNTemporalIterationsEnum
++syn keyword cConstant LoveNYiEquationsEnum
+ syn keyword cConstant LoveR0Enum
+ syn keyword cConstant LoveShNmaxEnum
+ syn keyword cConstant LoveShNminEnum
++syn keyword cConstant LoveStartingLayerEnum
++syn keyword cConstant LoveUnderflowTolEnum
+ syn keyword cConstant MassFluxSegmentsEnum
+ syn keyword cConstant MassFluxSegmentsPresentEnum
+ syn keyword cConstant MasstransportHydrostaticAdjustmentEnum
+@@ -782,6 +793,15 @@
+ syn keyword cConstant SealevelGrotm1Enum
+ syn keyword cConstant SealevelGrotm2Enum
+ syn keyword cConstant SealevelGrotm3Enum
++syn keyword cConstant SealevelGUrotm1Enum
++syn keyword cConstant SealevelGUrotm2Enum
++syn keyword cConstant SealevelGUrotm3Enum
++syn keyword cConstant SealevelGNrotm1Enum
++syn keyword cConstant SealevelGNrotm2Enum
++syn keyword cConstant SealevelGNrotm3Enum
++syn keyword cConstant SealevelGErotm1Enum
++syn keyword cConstant SealevelGErotm2Enum
++syn keyword cConstant SealevelGErotm3Enum
+ syn keyword cConstant SealevelRSLBarystaticEnum
+ syn keyword cConstant SealevelRSLRateEnum
+ syn keyword cConstant SealevelUGrdEnum
+@@ -1527,6 +1547,7 @@
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+ syn keyword cType GiaDeflectionCoreArgs
++syn keyword cType GrdLoads
+ syn keyword cType Hook
+ syn keyword cType Input
+ syn keyword cType Inputs
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26241)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26242)
+@@ -257,6 +257,7 @@
+ 	LoveG0Enum,
+ 	LoveGravitationalConstantEnum,
+ 	LoveInnerCoreBoundaryEnum,
++	LoveComplexComputationEnum,
+ 	LoveIntStepsPerLayerEnum,
+ 	LoveKernelsEnum,
+ 	LoveMu0Enum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26241)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26242)
+@@ -257,15 +257,26 @@
+ 		case LevelsetStabilizationEnum : return "LevelsetStabilization";
+ 		case LockFileNameEnum : return "LockFileName";
+ 		case LoveAllowLayerDeletionEnum : return "LoveAllowLayerDeletion";
++		case LoveCoreMantleBoundaryEnum : return "LoveCoreMantleBoundary";
++		case LoveEarthMassEnum : return "LoveEarthMass";
+ 		case LoveForcingTypeEnum : return "LoveForcingType";
+ 		case LoveFrequenciesEnum : return "LoveFrequencies";
++		case LoveIsTemporalEnum : return "LoveIsTemporal";
+ 		case LoveG0Enum : return "LoveG0";
++		case LoveGravitationalConstantEnum : return "LoveGravitationalConstant";
++		case LoveInnerCoreBoundaryEnum : return "LoveInnerCoreBoundary";
++		case LoveComplexComputationEnum : return "LoveComplexComputation";
++		case LoveIntStepsPerLayerEnum : return "LoveIntStepsPerLayer";
+ 		case LoveKernelsEnum : return "LoveKernels";
+ 		case LoveMu0Enum : return "LoveMu0";
+ 		case LoveNfreqEnum : return "LoveNfreq";
++		case LoveNTemporalIterationsEnum : return "LoveNTemporalIterations";
++		case LoveNYiEquationsEnum : return "LoveNYiEquations";
+ 		case LoveR0Enum : return "LoveR0";
+ 		case LoveShNmaxEnum : return "LoveShNmax";
+ 		case LoveShNminEnum : return "LoveShNmin";
++		case LoveStartingLayerEnum : return "LoveStartingLayer";
++		case LoveUnderflowTolEnum : return "LoveUnderflowTol";
+ 		case MassFluxSegmentsEnum : return "MassFluxSegments";
+ 		case MassFluxSegmentsPresentEnum : return "MassFluxSegmentsPresent";
+ 		case MasstransportHydrostaticAdjustmentEnum : return "MasstransportHydrostaticAdjustment";
+@@ -784,6 +795,15 @@
+ 		case SealevelGrotm1Enum : return "SealevelGrotm1";
+ 		case SealevelGrotm2Enum : return "SealevelGrotm2";
+ 		case SealevelGrotm3Enum : return "SealevelGrotm3";
++		case SealevelGUrotm1Enum : return "SealevelGUrotm1";
++		case SealevelGUrotm2Enum : return "SealevelGUrotm2";
++		case SealevelGUrotm3Enum : return "SealevelGUrotm3";
++		case SealevelGNrotm1Enum : return "SealevelGNrotm1";
++		case SealevelGNrotm2Enum : return "SealevelGNrotm2";
++		case SealevelGNrotm3Enum : return "SealevelGNrotm3";
++		case SealevelGErotm1Enum : return "SealevelGErotm1";
++		case SealevelGErotm2Enum : return "SealevelGErotm2";
++		case SealevelGErotm3Enum : return "SealevelGErotm3";
+ 		case SealevelRSLBarystaticEnum : return "SealevelRSLBarystatic";
+ 		case SealevelRSLRateEnum : return "SealevelRSLRate";
+ 		case SealevelUGrdEnum : return "SealevelUGrd";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26241)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26242)
+@@ -263,15 +263,26 @@
+    }
+    if(stage==3){
+ 	      if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
++	      else if (strcmp(name,"LoveCoreMantleBoundary")==0) return LoveCoreMantleBoundaryEnum;
++	      else if (strcmp(name,"LoveEarthMass")==0) return LoveEarthMassEnum;
+ 	      else if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
+ 	      else if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;
++	      else if (strcmp(name,"LoveIsTemporal")==0) return LoveIsTemporalEnum;
+ 	      else if (strcmp(name,"LoveG0")==0) return LoveG0Enum;
++	      else if (strcmp(name,"LoveGravitationalConstant")==0) return LoveGravitationalConstantEnum;
++	      else if (strcmp(name,"LoveInnerCoreBoundary")==0) return LoveInnerCoreBoundaryEnum;
++	      else if (strcmp(name,"LoveComplexComputation")==0) return LoveComplexComputationEnum;
++	      else if (strcmp(name,"LoveIntStepsPerLayer")==0) return LoveIntStepsPerLayerEnum;
+ 	      else if (strcmp(name,"LoveKernels")==0) return LoveKernelsEnum;
+ 	      else if (strcmp(name,"LoveMu0")==0) return LoveMu0Enum;
+ 	      else if (strcmp(name,"LoveNfreq")==0) return LoveNfreqEnum;
++	      else if (strcmp(name,"LoveNTemporalIterations")==0) return LoveNTemporalIterationsEnum;
++	      else if (strcmp(name,"LoveNYiEquations")==0) return LoveNYiEquationsEnum;
+ 	      else if (strcmp(name,"LoveR0")==0) return LoveR0Enum;
+ 	      else if (strcmp(name,"LoveShNmax")==0) return LoveShNmaxEnum;
+ 	      else if (strcmp(name,"LoveShNmin")==0) return LoveShNminEnum;
++	      else if (strcmp(name,"LoveStartingLayer")==0) return LoveStartingLayerEnum;
++	      else if (strcmp(name,"LoveUnderflowTol")==0) return LoveUnderflowTolEnum;
+ 	      else if (strcmp(name,"MassFluxSegments")==0) return MassFluxSegmentsEnum;
+ 	      else if (strcmp(name,"MassFluxSegmentsPresent")==0) return MassFluxSegmentsPresentEnum;
+ 	      else if (strcmp(name,"MasstransportHydrostaticAdjustment")==0) return MasstransportHydrostaticAdjustmentEnum;
+@@ -371,7 +382,10 @@
+ 	      else if (strcmp(name,"LoadLoveL")==0) return LoadLoveLEnum;
+ 	      else if (strcmp(name,"SealevelchangeGRigid")==0) return SealevelchangeGRigidEnum;
+ 	      else if (strcmp(name,"SealevelchangeGElastic")==0) return SealevelchangeGElasticEnum;
+-	      else if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsGRD")==0) return SolidearthSettingsGRDEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRunFrequency")==0) return SolidearthSettingsRunFrequencyEnum;
+ 	      else if (strcmp(name,"SealevelchangeHElastic")==0) return SealevelchangeHElasticEnum;
+@@ -382,10 +396,7 @@
+ 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+ 	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
++	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+ 	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
+@@ -494,7 +505,10 @@
+ 	      else if (strcmp(name,"TimesteppingTimeStepMin")==0) return TimesteppingTimeStepMinEnum;
+ 	      else if (strcmp(name,"TimesteppingType")==0) return TimesteppingTypeEnum;
+ 	      else if (strcmp(name,"ToMITgcmComm")==0) return ToMITgcmCommEnum;
+-	      else if (strcmp(name,"ToolkitsFileName")==0) return ToolkitsFileNameEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"ToolkitsFileName")==0) return ToolkitsFileNameEnum;
+ 	      else if (strcmp(name,"ToolkitsOptionsAnalyses")==0) return ToolkitsOptionsAnalysesEnum;
+ 	      else if (strcmp(name,"ToolkitsOptionsStrings")==0) return ToolkitsOptionsStringsEnum;
+ 	      else if (strcmp(name,"ToolkitsTypes")==0) return ToolkitsTypesEnum;
+@@ -505,10 +519,7 @@
+ 	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+ 	      else if (strcmp(name,"TransientIshydrology")==0) return TransientIshydrologyEnum;
+ 	      else if (strcmp(name,"TransientIsmasstransport")==0) return TransientIsmasstransportEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
++	      else if (strcmp(name,"TransientIsoceantransport")==0) return TransientIsoceantransportEnum;
+ 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
+ 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
+ 	      else if (strcmp(name,"TransientIssampling")==0) return TransientIssamplingEnum;
+@@ -617,7 +628,10 @@
+ 	      else if (strcmp(name,"DeviatoricStress2")==0) return DeviatoricStress2Enum;
+ 	      else if (strcmp(name,"DistanceToCalvingfront")==0) return DistanceToCalvingfrontEnum;
+ 	      else if (strcmp(name,"DistanceToGroundingline")==0) return DistanceToGroundinglineEnum;
+-	      else if (strcmp(name,"Domain2Dhorizontal")==0) return Domain2DhorizontalEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      if (strcmp(name,"Domain2Dhorizontal")==0) return Domain2DhorizontalEnum;
+ 	      else if (strcmp(name,"Domain2Dvertical")==0) return Domain2DverticalEnum;
+ 	      else if (strcmp(name,"Domain3D")==0) return Domain3DEnum;
+ 	      else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
+@@ -628,10 +642,7 @@
+ 	      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 stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
++	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+ 	      else if (strcmp(name,"EplHead")==0) return EplHeadEnum;
+ 	      else if (strcmp(name,"EplHeadOld")==0) return EplHeadOldEnum;
+ 	      else if (strcmp(name,"EplHeadSlopeX")==0) return EplHeadSlopeXEnum;
+@@ -740,7 +751,10 @@
+ 	      else if (strcmp(name,"MovingFrontalVy")==0) return MovingFrontalVyEnum;
+ 	      else if (strcmp(name,"Neumannflux")==0) return NeumannfluxEnum;
+ 	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
+-	      else if (strcmp(name,"Node")==0) return NodeEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"Node")==0) return NodeEnum;
+ 	      else if (strcmp(name,"OmegaAbsGradient")==0) return OmegaAbsGradientEnum;
+ 	      else if (strcmp(name,"OceantransportSpcbottompressure")==0) return OceantransportSpcbottompressureEnum;
+ 	      else if (strcmp(name,"OceantransportSpcstr")==0) return OceantransportSpcstrEnum;
+@@ -751,10 +765,7 @@
+ 	      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 stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"RadarAttenuationWolff")==0) return RadarAttenuationWolffEnum;
++	      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;
+@@ -802,6 +813,15 @@
+ 	      else if (strcmp(name,"SealevelGrotm1")==0) return SealevelGrotm1Enum;
+ 	      else if (strcmp(name,"SealevelGrotm2")==0) return SealevelGrotm2Enum;
+ 	      else if (strcmp(name,"SealevelGrotm3")==0) return SealevelGrotm3Enum;
++	      else if (strcmp(name,"SealevelGUrotm1")==0) return SealevelGUrotm1Enum;
++	      else if (strcmp(name,"SealevelGUrotm2")==0) return SealevelGUrotm2Enum;
++	      else if (strcmp(name,"SealevelGUrotm3")==0) return SealevelGUrotm3Enum;
++	      else if (strcmp(name,"SealevelGNrotm1")==0) return SealevelGNrotm1Enum;
++	      else if (strcmp(name,"SealevelGNrotm2")==0) return SealevelGNrotm2Enum;
++	      else if (strcmp(name,"SealevelGNrotm3")==0) return SealevelGNrotm3Enum;
++	      else if (strcmp(name,"SealevelGErotm1")==0) return SealevelGErotm1Enum;
++	      else if (strcmp(name,"SealevelGErotm2")==0) return SealevelGErotm2Enum;
++	      else if (strcmp(name,"SealevelGErotm3")==0) return SealevelGErotm3Enum;
+ 	      else if (strcmp(name,"SealevelRSLBarystatic")==0) return SealevelRSLBarystaticEnum;
+ 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
+ 	      else if (strcmp(name,"SealevelUGrd")==0) return SealevelUGrdEnum;
+@@ -854,7 +874,10 @@
+ 	      else if (strcmp(name,"SmbCotValue")==0) return SmbCotValueEnum;
+ 	      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 stage=8;
++   }
++   if(stage==8){
++	      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;
+@@ -874,10 +897,7 @@
+ 	      else if (strcmp(name,"SmbEAir")==0) return SmbEAirEnum;
+ 	      else if (strcmp(name,"SmbEC")==0) return SmbECEnum;
+ 	      else if (strcmp(name,"SmbECDt")==0) return SmbECDtEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbECini")==0) return SmbECiniEnum;
++	      else if (strcmp(name,"SmbECini")==0) return SmbECiniEnum;
+ 	      else if (strcmp(name,"SmbEla")==0) return SmbElaEnum;
+ 	      else if (strcmp(name,"SmbEvaporation")==0) return SmbEvaporationEnum;
+ 	      else if (strcmp(name,"SmbFAC")==0) return SmbFACEnum;
+@@ -977,7 +997,10 @@
+ 	      else if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum;
+ 	      else if (strcmp(name,"SurfaceSlopeX")==0) return SurfaceSlopeXEnum;
+ 	      else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
+-	      else if (strcmp(name,"Temperature")==0) return TemperatureEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      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;
+@@ -997,10 +1020,7 @@
+ 	      else if (strcmp(name,"Vx")==0) return VxEnum;
+ 	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+ 	      else if (strcmp(name,"VxObs")==0) return VxObsEnum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"VxShear")==0) return VxShearEnum;
++	      else if (strcmp(name,"VxShear")==0) return VxShearEnum;
+ 	      else if (strcmp(name,"VxSurface")==0) return VxSurfaceEnum;
+ 	      else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
+ 	      else if (strcmp(name,"VyBase")==0) return VyBaseEnum;
+@@ -1100,7 +1120,10 @@
+ 	      else if (strcmp(name,"Outputdefinition77")==0) return Outputdefinition77Enum;
+ 	      else if (strcmp(name,"Outputdefinition78")==0) return Outputdefinition78Enum;
+ 	      else if (strcmp(name,"Outputdefinition79")==0) return Outputdefinition79Enum;
+-	      else if (strcmp(name,"Outputdefinition7")==0) return Outputdefinition7Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition7")==0) return Outputdefinition7Enum;
+ 	      else if (strcmp(name,"Outputdefinition80")==0) return Outputdefinition80Enum;
+ 	      else if (strcmp(name,"Outputdefinition81")==0) return Outputdefinition81Enum;
+ 	      else if (strcmp(name,"Outputdefinition82")==0) return Outputdefinition82Enum;
+@@ -1120,10 +1143,7 @@
+ 	      else if (strcmp(name,"Outputdefinition95")==0) return Outputdefinition95Enum;
+ 	      else if (strcmp(name,"Outputdefinition96")==0) return Outputdefinition96Enum;
+ 	      else if (strcmp(name,"Outputdefinition97")==0) return Outputdefinition97Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition98")==0) return Outputdefinition98Enum;
++	      else if (strcmp(name,"Outputdefinition98")==0) return Outputdefinition98Enum;
+ 	      else if (strcmp(name,"Outputdefinition99")==0) return Outputdefinition99Enum;
+ 	      else if (strcmp(name,"Outputdefinition9")==0) return Outputdefinition9Enum;
+ 	      else if (strcmp(name,"Outputdefinition100")==0) return Outputdefinition100Enum;
+@@ -1223,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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;
+@@ -1243,10 +1266,7 @@
+ 	      else if (strcmp(name,"GenericExternalResult")==0) return GenericExternalResultEnum;
+ 	      else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
+ 	      else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
+-         else stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
++	      else if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
+ 	      else if (strcmp(name,"Gradient4")==0) return Gradient4Enum;
+ 	      else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum;
+ 	      else if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum;
+@@ -1346,7 +1366,10 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      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;
+@@ -1366,10 +1389,7 @@
+ 	      else if (strcmp(name,"OceantransportAnalysis")==0) return OceantransportAnalysisEnum;
+ 	      else if (strcmp(name,"OceantransportSolution")==0) return OceantransportSolutionEnum;
+ 	      else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
+-         else stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"OneLayerP4z")==0) return OneLayerP4zEnum;
++	      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,"Param")==0) return ParamEnum;
+@@ -1469,7 +1489,10 @@
+ 	      else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
+ 	      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 stage=13;
++   }
++   if(stage==13){
++	      if (strcmp(name,"TotalCalvingMeltingFluxLevelset")==0) return TotalCalvingMeltingFluxLevelsetEnum;
+ 	      else if (strcmp(name,"TotalFloatingBmb")==0) return TotalFloatingBmbEnum;
+ 	      else if (strcmp(name,"TotalFloatingBmbScaled")==0) return TotalFloatingBmbScaledEnum;
+ 	      else if (strcmp(name,"TotalGroundedBmb")==0) return TotalGroundedBmbEnum;
+@@ -1489,10 +1512,7 @@
+ 	      else if (strcmp(name,"VertexPId")==0) return VertexPIdEnum;
+ 	      else if (strcmp(name,"VertexSId")==0) return VertexSIdEnum;
+ 	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+-         else stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
++	      else if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
+ 	      else if (strcmp(name,"Water")==0) return WaterEnum;
+ 	      else if (strcmp(name,"XTaylorHood")==0) return XTaylorHoodEnum;
+ 	      else if (strcmp(name,"XY")==0) return XYEnum;
+Index: ../trunk-jpl/src/c/shared/Numerics/types.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26241)
++++ ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26242)
+@@ -12,6 +12,7 @@
+ #endif
+ 
+ #include <stdio.h>
++#include <complex>
+ 
+ /*here are our abstracted types: inspired on petsc */
+ #if ISSM_USE_64BIT_INDICES == 1
+@@ -23,19 +24,25 @@
+ #if defined(_HAVE_ADOLC_) &&  !defined(_WRAPPERS_)
+ /*ADOLC typedefs*/
+ #include "adolc/adolc.h"
+-typedef adouble IssmDouble; /*for active variables*/
+-typedef double  IssmPDouble; /*for passive variables*/
++typedef adouble  IssmDouble; /*for active variables*/
++typedef acomplex IssmComplex; /*for active variables*/
++typedef double   IssmPDouble; /*for passive variables*/
++typedef std::complex<double> IssmPComplex; /*for passive variables*/
+ 
+ #elif defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
+ /*CoDiPack typedefs*/
+ #include <codi.hpp>
+-typedef codi::RealReverse IssmDouble;
+-typedef double            IssmPDouble;
++typedef codi::RealReverse    IssmDouble;
++//typedef codi::ComplexReverse IssmComplex; //not defined so far
++typedef double               IssmPDouble;
++typedef std::complex<double>  IssmPComplex;
+ 
+ /*Non-AD typedefs*/
+ #else 
+-typedef double     IssmDouble; 
+-typedef IssmDouble IssmPDouble;
++typedef double              IssmDouble; 
++typedef std::complex<double> IssmComplex; 
++typedef IssmDouble          IssmPDouble;
++typedef IssmComplex         IssmPComplex;
+ #endif
+ 
+ #endif //ifndef _TYPES_H_
+Index: ../trunk-jpl/src/m/classes/fourierlove.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26241)
++++ ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26242)
+@@ -18,11 +18,13 @@
+ 		integration_steps_per_layer= 0;
+ 		istemporal		   = 0;
+ 		n_temporal_iterations	   = 0;
+-		time			   = 0;
++		time			           = 0;
+ 		love_kernels               = 0;
+ 		forcing_type               = 0;
+-		inner_core_boundary	   = 0;
++		inner_core_boundary	       = 0;
+ 		core_mantle_boundary	   = 0;
++		complex_computation        = 0;
++
+ 	end
+ 	methods (Static)
+ 		function self = loadobj(self) % {{{
+@@ -62,6 +64,7 @@
+ 			self.forcing_type = 11; % surface loading
+ 			self.inner_core_boundary=1;
+ 			self.core_mantle_boundary=2;
++			self.complex_computation=0;
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]');
+@@ -101,6 +104,7 @@
+ 			md = checkfield(md,'fieldname','love.integration_steps_per_layer','NaN',1,'Inf',1,'numel',1,'>',0);
+ 			md = checkfield(md,'fieldname','love.love_kernels','values',[0 1]);
+ 			md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
++			md = checkfield(md,'fieldname','love.complex_computation','NaN',1,'Inf',1,'numel',1,'values',[0 1]);
+ 
+ 			md = checkfield(md,'fieldname','love.istemporal','values',[0 1]);
+ 			if md.love.istemporal==1
+@@ -139,6 +143,7 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','integration_steps_per_layer','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','istemporal','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','n_temporal_iterations','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','complex_computation','format','Boolean');
+ 			%note: no need to marshall the time vector, we have frequencies
+ 			WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26242-26243.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26242-26243.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26242-26243.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/types.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26242)
++++ ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26243)
+@@ -34,6 +34,7 @@
+ #include <codi.hpp>
+ typedef codi::RealReverse    IssmDouble;
+ //typedef codi::ComplexReverse IssmComplex; //not defined so far
++typedef std::complex<double>  IssmComplex; /*FIXME: this line is not correct*/
+ typedef double               IssmPDouble;
+ typedef std::complex<double>  IssmPComplex;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26243-26244.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26243-26244.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26243-26244.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/types.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26243)
++++ ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26244)
+@@ -24,26 +24,25 @@
+ #if defined(_HAVE_ADOLC_) &&  !defined(_WRAPPERS_)
+ /*ADOLC typedefs*/
+ #include "adolc/adolc.h"
+-typedef adouble  IssmDouble; /*for active variables*/
+-typedef acomplex IssmComplex; /*for active variables*/
+-typedef double   IssmPDouble; /*for passive variables*/
+-typedef std::complex<double> IssmPComplex; /*for passive variables*/
++typedef adouble              IssmDouble;  /*for active variables*/
++typedef acomplex             IssmComplex; /*for active variables*/
++typedef double               IssmPDouble; /*for passive variables*/
++typedef std::complex<double> IssmPComplex;/*for passive variables*/
+ 
+ #elif defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
+ /*CoDiPack typedefs*/
+ #include <codi.hpp>
+-typedef codi::RealReverse    IssmDouble;
+-//typedef codi::ComplexReverse IssmComplex; //not defined so far
+-typedef std::complex<double>  IssmComplex; /*FIXME: this line is not correct*/
+-typedef double               IssmPDouble;
+-typedef std::complex<double>  IssmPComplex;
++typedef codi::RealReverse               IssmDouble;
++typedef std::complex<codi::RealReverse> IssmComplex;
++typedef double                          IssmPDouble;
++typedef IssmComplex                     IssmPComplex;
+ 
++#else 
+ /*Non-AD typedefs*/
+-#else 
+-typedef double              IssmDouble; 
++typedef double               IssmDouble; 
+ typedef std::complex<double> IssmComplex; 
+-typedef IssmDouble          IssmPDouble;
+-typedef IssmComplex         IssmPComplex;
++typedef IssmDouble           IssmPDouble;
++typedef IssmComplex          IssmPComplex;
+ #endif
+ 
+ #endif //ifndef _TYPES_H_
Index: /issm/oecreview/Archive/25834-26739/ISSM-26244-26245.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26244-26245.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26244-26245.diff	(revision 26740)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/src/c/classes/Node.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.cpp	(revision 26244)
++++ ../trunk-jpl/src/c/classes/Node.cpp	(revision 26245)
+@@ -790,7 +790,7 @@
+ /*}}}*/
+ int  Node::FSize(void){/*{{{*/
+ 
+-	_assert_(this && this->gdoflist);
++	_assert_(this!=NULL && this->gdoflist);
+ 
+ 	int fsize = 0;
+ 	for(int i=0;i<this->gsize;i++) if(this->f_set[i]) fsize++;
+@@ -799,7 +799,7 @@
+ /*}}}*/
+ int  Node::SSize(void){/*{{{*/
+ 
+-	_assert_(this && this->s_set);
++	_assert_(this!=NULL && this->s_set);
+ 
+ 	int ssize = 0;
+ 	for(int i=0;i<this->gsize;i++) if(this->s_set[i]) ssize++;
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26244)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26245)
+@@ -130,7 +130,7 @@
+ 	int nt=nfreq/2/NTit;
+ 
+ 	indf=d*nfreq+t*2*NTit;
+-	doubletype LoveM[NTit];
++	doubletype* LoveM = xNew<doubletype>(NTit);
+ 
+ 	for (int M=1;M<NTit+1;M++){
+ 		LoveM[M-1]=0.0;
+@@ -857,10 +857,10 @@
+ 		
+ 		if(VerboseModule() && info!=0){ 
+ 			_printf0_("love core warning in DGESV : LAPACK linear equation solver couldn't resolve the system");
+-			printf("%s %s %s %s\n", "i","j","yi[i+nyi*j]","rhs[i]");
++			_printf_("i j yi[i+nyi*j] rhs[i]");
+ 			for (int i=0;i<nyi;i++){
+ 				for (int j=0;j<nyi;j++){
+-					printf("%i %i %e %e\n", i,j,yi[i+nyi*j],rhs[i]);
++					_printf_(i<<" "<<j<<" "<<yi[i+nyi*j]<<" "<<rhs[i]<<"\n");
+ 				}
+ 			}
+ 		}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26245-26246.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26245-26246.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26245-26246.diff	(revision 26740)
@@ -0,0 +1,2790 @@
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src/1DQuadrature.C
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src/1DQuadrature.C	(nonexistent)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src/1DQuadrature.C	(revision 26246)
+@@ -0,0 +1,755 @@
++//-----------------------------------------------------------------------bl-
++//--------------------------------------------------------------------------
++//
++// QUESO - a library to support the Quantification of Uncertainty
++// for Estimation, Simulation and Optimization
++//
++// Copyright (C) 2008-2015 The PECOS Development Team
++//
++// This library is free software; you can redistribute it and/or
++// modify it under the terms of the Version 2.1 GNU Lesser General
++// Public License as published by the Free Software Foundation.
++//
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++// Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public
++// License along with this library; if not, write to the Free Software
++// Foundation, Inc. 51 Franklin Street, Fifth Floor,
++// Boston, MA  02110-1301  USA
++//
++//-----------------------------------------------------------------------el-
++
++#include <queso/1DQuadrature.h>
++
++namespace QUESO {
++
++//*****************************************************
++// Base 1D quadrature class
++//*****************************************************
++Base1DQuadrature::Base1DQuadrature(
++  double minDomainValue,
++  double maxDomainValue,
++  unsigned int order)
++  :
++  m_minDomainValue(minDomainValue),
++  m_maxDomainValue(maxDomainValue),
++  m_order         (order),
++  m_positions     (0),
++  m_weights       (0)
++{
++  UQ_FATAL_TEST_MACRO(m_minDomainValue >= m_maxDomainValue,
++                      UQ_UNAVAILABLE_RANK,
++                      "Base1DQuadrature::constructor()",
++                      "min >= max");
++  //UQ_FATAL_TEST_MACRO(order == 0, // eep2011
++  //                    UQ_UNAVAILABLE_RANK,
++  //                    "Base1DQuadrature::constructor()",
++  //                    "order = 0");
++}
++
++Base1DQuadrature::~Base1DQuadrature()
++{
++}
++
++double
++Base1DQuadrature::minDomainValue() const
++{
++  return m_minDomainValue;
++}
++
++double
++Base1DQuadrature::maxDomainValue() const
++{
++  return m_maxDomainValue;
++}
++
++unsigned int
++Base1DQuadrature::order() const
++{
++  return m_order;
++}
++
++const std::vector<double>&
++Base1DQuadrature::positions() const
++{
++  UQ_FATAL_TEST_MACRO(m_positions.size() == 0,
++                      UQ_UNAVAILABLE_RANK,
++                      "Base1DQuadrature::positions()",
++                      "size = 0");
++  return m_positions;
++}
++
++const std::vector<double>&
++Base1DQuadrature::weights() const
++{
++  UQ_FATAL_TEST_MACRO(m_weights.size() == 0,
++                      UQ_UNAVAILABLE_RANK,
++                      "Base1DQuadrature::weights()",
++                      "size = 0");
++  return m_weights;
++}
++
++//*****************************************************
++// Generic 1D quadrature class
++//*****************************************************
++Generic1DQuadrature::Generic1DQuadrature(
++  double minDomainValue,
++  double maxDomainValue,
++  const std::vector<double>& positions,
++  const std::vector<double>& weights)
++  :
++  Base1DQuadrature(minDomainValue,maxDomainValue,positions.size()-1)
++{
++  m_positions = positions;
++  m_weights   = weights;
++
++  UQ_FATAL_TEST_MACRO(m_positions.size() == 0,
++                      UQ_UNAVAILABLE_RANK,
++                      "Generic1DQuadrature::constructor()",
++                      "invalid positions");
++
++  UQ_FATAL_TEST_MACRO(m_positions.size() != m_weights.size(),
++                      UQ_UNAVAILABLE_RANK,
++                      "Generic1DQuadrature::constructor()",
++                      "inconsistent positions and weight");
++}
++
++Generic1DQuadrature::~Generic1DQuadrature()
++{
++}
++
++void
++Generic1DQuadrature::dumbRoutine() const
++{
++  return;
++}
++
++//*****************************************************
++// UniformLegendre 1D quadrature class
++//*****************************************************
++UniformLegendre1DQuadrature::UniformLegendre1DQuadrature(
++  double       minDomainValue,
++  double       maxDomainValue,
++  unsigned int order,
++  bool         densityIsNormalized)
++  :
++  Base1DQuadrature(minDomainValue,maxDomainValue,order)
++{
++  m_positions.resize(m_order+1,0.); // Yes, '+1'
++  m_weights.resize  (m_order+1,0.); // Yes, '+1'
++
++  // http://www.holoborodko.com/pavel/?page_id=679
++  switch (m_order) { // eep2011
++    case 1:
++      m_weights  [0] =  1.;
++      m_weights  [1] =  1.;
++
++      m_positions[0] = -1./sqrt(3.);
++      m_positions[1] =  1./sqrt(3.);
++    break;
++
++    case 2:
++      m_weights  [0] =  5./9.;
++      m_weights  [1] =  8./9.;
++      m_weights  [2] =  5./9.;
++
++      m_positions[0] = -sqrt(.6);
++      m_positions[1] =  0.;
++      m_positions[2] =  sqrt(.6);
++    break;
++
++    case 3:
++      m_weights  [0] =  0.5 - sqrt(30.)/36.;
++      m_weights  [1] =  0.5 + sqrt(30.)/36.;
++      m_weights  [2] =  0.5 + sqrt(30.)/36.;
++      m_weights  [3] =  0.5 - sqrt(30.)/36.;
++
++      m_positions[0] = -sqrt(3.+2.*sqrt(1.2))/sqrt(7.);
++      m_positions[1] = -sqrt(3.-2.*sqrt(1.2))/sqrt(7.);
++      m_positions[2] =  sqrt(3.-2.*sqrt(1.2))/sqrt(7.);
++      m_positions[3] =  sqrt(3.+2.*sqrt(1.2))/sqrt(7.);
++    break;
++
++    case 4:
++      m_weights  [0] =  (322.-13.*sqrt(70.))/900.; // 0.236926885
++      m_weights  [1] =  (322.+13.*sqrt(70.))/900.; // 0.478628670
++      m_weights  [2] =  128./225.;                 // 0.568888889
++      m_weights  [3] =  (322.+13.*sqrt(70.))/900.;
++      m_weights  [4] =  (322.-13.*sqrt(70.))/900.;
++
++      m_positions[0] = -sqrt(5.+2.*sqrt(10./7.))/3.;
++      m_positions[1] = -sqrt(5.-2.*sqrt(10./7.))/3.;
++      m_positions[2] =  0.;
++      m_positions[3] =  sqrt(5.-2.*sqrt(10./7.))/3.;
++      m_positions[4] =  sqrt(5.+2.*sqrt(10./7.))/3.;
++    break;
++
++    case 5:
++      m_weights  [0] =  0.1713244923791703450402961;
++      m_weights  [1] =  0.3607615730481386075698335;
++      m_weights  [2] =  0.4679139345726910473898703;
++      m_weights  [3] =  0.4679139345726910473898703;
++      m_weights  [4] =  0.3607615730481386075698335;
++      m_weights  [5] =  0.1713244923791703450402961;
++
++      m_positions[0] = -0.9324695142031520278123016;
++      m_positions[1] = -0.6612093864662645136613996;
++      m_positions[2] = -0.2386191860831969086305017;
++      m_positions[3] =  0.2386191860831969086305017;
++      m_positions[4] =  0.6612093864662645136613996;
++      m_positions[5] =  0.9324695142031520278123016;
++    break;
++
++    case 6:
++      m_weights  [0] =  0.1294849661688696932706114;
++      m_weights  [1] =  0.2797053914892766679014678;
++      m_weights  [2] =  0.3818300505051189449503698;
++      m_weights  [3] =  0.4179591836734693877551020;
++      m_weights  [4] =  0.3818300505051189449503698;
++      m_weights  [5] =  0.2797053914892766679014678;
++      m_weights  [6] =  0.1294849661688696932706114;
++
++      m_positions[0] = -0.9491079123427585245261897;
++      m_positions[1] = -0.7415311855993944398638648;
++      m_positions[2] = -0.4058451513773971669066064;
++      m_positions[3] =  0.;
++      m_positions[4] =  0.4058451513773971669066064;
++      m_positions[5] =  0.7415311855993944398638648;
++      m_positions[6] =  0.9491079123427585245261897;
++    break;
++
++    case 7:
++      m_weights  [0] =  0.10122854;
++      m_weights  [1] =  0.22238103;
++      m_weights  [2] =  0.31370665;
++      m_weights  [3] =  0.36268378;
++      m_weights  [4] =  0.36268378;
++      m_weights  [5] =  0.31370665;
++      m_weights  [6] =  0.22238103;
++      m_weights  [7] =  0.10122854;
++
++      m_positions[0] = -0.96028986;
++      m_positions[1] = -0.79666648;
++      m_positions[2] = -0.52553241;
++      m_positions[3] = -0.18343464;
++      m_positions[4] =  0.18343464;
++      m_positions[5] =  0.52553241;
++      m_positions[6] =  0.79666648;
++      m_positions[7] =  0.96028986;
++    break;
++
++    case 10:
++      m_weights  [ 0] =  0.0556685671161736664827537;
++      m_weights  [ 1] =  0.1255803694649046246346943;
++      m_weights  [ 2] =  0.1862902109277342514260976;
++      m_weights  [ 3] =  0.2331937645919904799185237;
++      m_weights  [ 4] =  0.2628045445102466621806889;
++      m_weights  [ 5] =  0.2729250867779006307144835;
++      m_weights  [ 6] =  0.2628045445102466621806889;
++      m_weights  [ 7] =  0.2331937645919904799185237;
++      m_weights  [ 8] =  0.1862902109277342514260976;
++      m_weights  [ 9] =  0.1255803694649046246346943;
++      m_weights  [10] =  0.0556685671161736664827537;
++
++      m_positions[ 0] = -0.9782286581460569928039380;
++      m_positions[ 1] = -0.8870625997680952990751578;
++      m_positions[ 2] = -0.7301520055740493240934163;
++      m_positions[ 3] = -0.5190961292068118159257257;
++      m_positions[ 4] = -0.2695431559523449723315320;
++      m_positions[ 5] =  0.;
++      m_positions[ 6] =  0.2695431559523449723315320;
++      m_positions[ 7] =  0.5190961292068118159257257;
++      m_positions[ 8] =  0.7301520055740493240934163;
++      m_positions[ 9] =  0.8870625997680952990751578;
++      m_positions[10] =  0.9782286581460569928039380;
++    break;
++
++    case 11:
++      m_weights  [ 0] =  0.0471753363865118271946160;
++      m_weights  [ 1] =  0.1069393259953184309602547;
++      m_weights  [ 2] =  0.1600783285433462263346525;
++      m_weights  [ 3] =  0.2031674267230659217490645;
++      m_weights  [ 4] =  0.2334925365383548087608499;
++      m_weights  [ 5] =  0.2491470458134027850005624;
++      m_weights  [ 6] =  0.2491470458134027850005624;
++      m_weights  [ 7] =  0.2334925365383548087608499;
++      m_weights  [ 8] =  0.2031674267230659217490645;
++      m_weights  [ 9] =  0.1600783285433462263346525;
++      m_weights  [10] =  0.1069393259953184309602547;
++      m_weights  [11] =  0.0471753363865118271946160;
++
++      m_positions[ 0] = -0.9815606342467192506905491;
++      m_positions[ 1] = -0.9041172563704748566784659;
++      m_positions[ 2] = -0.7699026741943046870368938;
++      m_positions[ 3] = -0.5873179542866174472967024;
++      m_positions[ 4] = -0.3678314989981801937526915;
++      m_positions[ 5] = -0.1252334085114689154724414;
++      m_positions[ 6] =  0.1252334085114689154724414;
++      m_positions[ 7] =  0.3678314989981801937526915;
++      m_positions[ 8] =  0.5873179542866174472967024;
++      m_positions[ 9] =  0.7699026741943046870368938;
++      m_positions[10] =  0.9041172563704748566784659;
++      m_positions[11] =  0.9815606342467192506905491;
++    break;
++
++    case 12:
++      m_weights  [ 0] =  0.0404840047653158795200216;
++      m_weights  [ 1] =  0.0921214998377284479144218;
++      m_weights  [ 2] =  0.1388735102197872384636018;
++      m_weights  [ 3] =  0.1781459807619457382800467;
++      m_weights  [ 4] =  0.2078160475368885023125232;
++      m_weights  [ 5] =  0.2262831802628972384120902;
++      m_weights  [ 6] =  0.2325515532308739101945895;
++      m_weights  [ 7] =  0.2262831802628972384120902;
++      m_weights  [ 8] =  0.2078160475368885023125232;
++      m_weights  [ 9] =  0.1781459807619457382800467;
++      m_weights  [10] =  0.1388735102197872384636018;
++      m_weights  [11] =  0.0921214998377284479144218;
++      m_weights  [12] =  0.0404840047653158795200216;
++
++      m_positions[ 0] = -0.9841830547185881494728294;
++      m_positions[ 1] = -0.9175983992229779652065478;
++      m_positions[ 2] = -0.8015780907333099127942065;
++      m_positions[ 3] = -0.6423493394403402206439846;
++      m_positions[ 4] = -0.4484927510364468528779129;
++      m_positions[ 5] = -0.2304583159551347940655281;
++      m_positions[ 6] =  0.;
++      m_positions[ 7] =  0.2304583159551347940655281;
++      m_positions[ 8] =  0.4484927510364468528779129;
++      m_positions[ 9] =  0.6423493394403402206439846;
++      m_positions[10] =  0.8015780907333099127942065;
++      m_positions[11] =  0.9175983992229779652065478;
++      m_positions[12] =  0.9841830547185881494728294;
++    break;
++#if 0
++    case 13:
++      m_weights  [ 0] =  ;
++      m_weights  [ 1] =  ;
++      m_weights  [ 2] =  ;
++      m_weights  [ 3] =  ;
++      m_weights  [ 4] =  ;
++      m_weights  [ 5] =  ;
++      m_weights  [ 6] =  ;
++      m_weights  [ 7] =  ;
++      m_weights  [ 8] =  ;
++      m_weights  [ 9] =  ;
++      m_weights  [10] =  ;
++      m_weights  [11] =  ;
++      m_weights  [12] =  ;
++      m_weights  [13] =  ;
++
++      m_positions[ 0] = -;
++      m_positions[ 1] = -;
++      m_positions[ 2] = -;
++      m_positions[ 3] = -;
++      m_positions[ 4] = -;
++      m_positions[ 5] = -;
++      m_positions[ 6] = -;
++      m_positions[ 7] =  ;
++      m_positions[ 8] =  ;
++      m_positions[ 9] =  ;
++      m_positions[10] =  ;
++      m_positions[11] =  ;
++      m_positions[12] =  ;
++      m_positions[13] =  ;
++    break;
++#endif
++/*
++    14 ±0.1080549487073436620662447 0.2152638534631577901958764
++    ±0.3191123689278897604356718 0.2051984637212956039659241
++    ±0.5152486363581540919652907 0.1855383974779378137417166
++    ±0.6872929048116854701480198 0.1572031671581935345696019
++    ±0.8272013150697649931897947 0.1215185706879031846894148
++    ±0.9284348836635735173363911 0.0801580871597602098056333
++    ±0.9862838086968123388415973 0.0351194603317518630318329
++*/
++
++    case 16:
++      m_weights  [ 0] =  0.0241483028685479319601100;
++      m_weights  [ 1] =  0.0554595293739872011294402;
++      m_weights  [ 2] =  0.0850361483171791808835354;
++      m_weights  [ 3] =  0.1118838471934039710947884;
++      m_weights  [ 4] =  0.1351363684685254732863200;
++      m_weights  [ 5] =  0.1540457610768102880814316;
++      m_weights  [ 6] =  0.1680041021564500445099707;
++      m_weights  [ 7] =  0.1765627053669926463252710;
++      m_weights  [ 8] =  0.1794464703562065254582656;
++      m_weights  [ 9] =  0.1765627053669926463252710;
++      m_weights  [10] =  0.1680041021564500445099707;
++      m_weights  [11] =  0.1540457610768102880814316;
++      m_weights  [12] =  0.1351363684685254732863200;
++      m_weights  [13] =  0.1118838471934039710947884;
++      m_weights  [14] =  0.0850361483171791808835354;
++      m_weights  [15] =  0.0554595293739872011294402;
++      m_weights  [16] =  0.0241483028685479319601100;
++
++      m_positions[ 0] = -0.9905754753144173356754340;
++      m_positions[ 1] = -0.9506755217687677612227170;
++      m_positions[ 2] = -0.8802391537269859021229557;
++      m_positions[ 3] = -0.7815140038968014069252301;
++      m_positions[ 4] = -0.6576711592166907658503022;
++      m_positions[ 5] = -0.5126905370864769678862466;
++      m_positions[ 6] = -0.3512317634538763152971855;
++      m_positions[ 7] = -0.1784841814958478558506775;
++      m_positions[ 8] =  0.;
++      m_positions[ 9] =  0.1784841814958478558506775;
++      m_positions[10] =  0.3512317634538763152971855;
++      m_positions[11] =  0.5126905370864769678862466;
++      m_positions[12] =  0.6576711592166907658503022;
++      m_positions[13] =  0.7815140038968014069252301;
++      m_positions[14] =  0.8802391537269859021229557;
++      m_positions[15] =  0.9506755217687677612227170;
++      m_positions[16] =  0.9905754753144173356754340;
++    break;
++
++    default:
++      std::cerr << "In UniformLegendre1DQuadrature::constructor()"
++                << ": m_order = " << m_order
++                << std::endl;
++      UQ_FATAL_TEST_MACRO(true,
++                          UQ_UNAVAILABLE_RANK,
++                          "UniformLegendre1DQuadrature::constructor()",
++                          "order not supported");
++    break;
++  }
++
++  // Scale positions from the interval [-1, 1] to the interval [min,max]
++  for (unsigned int j = 0; j < m_positions.size(); ++j) {
++    m_positions[j] = .5*(m_maxDomainValue - m_minDomainValue)*m_positions[j] + .5*(m_maxDomainValue + m_minDomainValue);
++    if (densityIsNormalized) {
++      // Since \rho is "1/\Delta", we just multiply by ".5"
++      m_weights[j] *= .5;
++    }
++    else {
++      // Since \rho is "1", we multiply by ".5 * \Delta"
++      m_weights[j] *= .5*(m_maxDomainValue - m_minDomainValue);
++    }
++  }
++}
++
++UniformLegendre1DQuadrature::~UniformLegendre1DQuadrature()
++{
++}
++
++void
++UniformLegendre1DQuadrature::dumbRoutine() const
++{
++  return;
++}
++
++//*****************************************************
++// GaussianHermite 1D quadrature class
++//*****************************************************
++GaussianHermite1DQuadrature::GaussianHermite1DQuadrature(
++  double mean,
++  double stddev,
++  unsigned int order)
++  :
++  Base1DQuadrature(-INFINITY,INFINITY,order),
++  m_mean  (mean),
++  m_stddev(stddev)
++{
++  // FIX ME: prepare code for mean != 0 and stddev != 1
++  m_positions.resize(m_order+1,0.); // Yes, '+1'
++  m_weights.resize  (m_order+1,0.); // Yes, '+1'
++
++  // http://www.efunda.com/math/num_integration/findgausshermite.cfm
++  switch (m_order) { // eep2011
++    case 1:
++      m_weights  [0] =  sqrt(M_PI)/2.;
++      m_weights  [1] =  sqrt(M_PI)/2.;
++
++      m_positions[0] = -1./sqrt(2.);
++      m_positions[1] =  1./sqrt(2.);
++    break;
++
++    case 2:
++      m_weights  [0] =  sqrt(M_PI)/6.;
++      m_weights  [1] =  2.*sqrt(M_PI)/3.;
++      m_weights  [2] =  sqrt(M_PI)/6.;
++
++      m_positions[0] = -sqrt(1.5);
++      m_positions[1] =  0.;
++      m_positions[2] =  sqrt(1.5);
++    break;
++
++    case 3:
++      m_weights  [0] =  sqrt(M_PI)/4./(3.-sqrt(6.));
++      m_weights  [1] =  sqrt(M_PI)/4./(3.+sqrt(6.));
++      m_weights  [2] =  sqrt(M_PI)/4./(3.+sqrt(6.));
++      m_weights  [3] =  sqrt(M_PI)/4./(3.-sqrt(6.));
++
++      m_positions[0] = -sqrt(1.5+sqrt(1.5));
++      m_positions[1] = -sqrt(1.5-sqrt(1.5));
++      m_positions[2] =  sqrt(1.5-sqrt(1.5));
++      m_positions[3] =  sqrt(1.5+sqrt(1.5));
++    break;
++
++    case 4:
++      m_weights  [0] =  0.019953242049;
++      m_weights  [1] =  0.393619323152;
++      m_weights  [2] =  0.945308720483;
++      m_weights  [3] =  0.393619323152;
++      m_weights  [4] =  0.019953242059;
++
++      m_positions[0] = -sqrt(2.5+sqrt(2.5));
++      m_positions[1] = -sqrt(2.5-sqrt(2.5));
++      m_positions[2] =  0.;
++      m_positions[3] =  sqrt(2.5-sqrt(2.5));
++      m_positions[4] =  sqrt(2.5+sqrt(2.5));
++    break;
++
++    case 5:
++      m_weights   [0] = 0.00453000990551;
++      m_weights   [1] = 0.157067320323;
++      m_weights   [2] = 0.724629595224;
++      m_weights   [3] = 0.724629595224;
++      m_weights   [4] = 0.157067320323;
++      m_weights   [5] = 0.00453000990551;
++
++      m_positions [0] = -2.35060497367;
++      m_positions [1] = -1.33584907401;
++      m_positions [2] = -0.436077411928;
++      m_positions [3] =  0.436077411928;
++      m_positions [4] =  1.33584907401;
++      m_positions [5] =  2.35060497367;
++    break;
++
++    case 6:
++      m_weights   [0] = 0.0009717812451;
++      m_weights   [1] = 0.0545155828191;
++      m_weights   [2] = 0.42560725261;
++      m_weights   [3] = 0.810264617557;
++      m_weights   [4] = 0.42560725261;
++      m_weights   [5] = 0.0545155828191;
++      m_weights   [6] = 0.0009717812451;
++
++      m_positions [0] = -2.65196135684;
++      m_positions [1] = -1.67355162877;
++      m_positions [2] = -0.816287882859;
++      m_positions [3] =  0.;
++      m_positions [4] =  0.816287882859;
++      m_positions [5] =  1.67355162877;
++      m_positions [6] =  2.65196135684;
++    break;
++
++    case 7:
++      m_weights   [0] = 0.000199604072211;
++      m_weights   [1] = 0.0170779830074;
++      m_weights   [2] = 0.207802325815;
++      m_weights   [3] = 0.661147012558;
++      m_weights   [4] = 0.661147012558;
++      m_weights   [5] = 0.207802325815;
++      m_weights   [6] = 0.0170779830074;
++      m_weights   [7] = 0.000199604072211;
++
++      m_positions [0] = -2.93063742026;
++      m_positions [1] = -1.9816567567;
++      m_positions [2] = -1.15719371245;
++      m_positions [3] = -0.381186990207;
++      m_positions [4] =  0.381186990207;
++      m_positions [5] =  1.15719371245;
++      m_positions [6] =  1.9816567567;
++      m_positions [7] =  2.93063742026;
++    break;
++
++    case 8:
++      m_weights   [0] = 3.96069772633e-5;
++      m_weights   [1] = 0.00494362427554;
++      m_weights   [2] = 0.0884745273944;
++      m_weights   [3] = 0.432651559003;
++      m_weights   [4] = 0.720235215606;
++      m_weights   [5] = 0.432651559003;
++      m_weights   [6] = 0.0884745273944;
++      m_weights   [7] = 0.00494362427554;
++      m_weights   [8] = 3.96069772633e-5;
++
++      m_positions [0] = -3.19099320178;
++      m_positions [1] = -2.26658058453;
++      m_positions [2] = -1.46855328922;
++      m_positions [3] = -0.723551018753;
++      m_positions [4] =  0.;
++      m_positions [5] =  0.723551018753;
++      m_positions [6] =  1.46855328922;
++      m_positions [7] =  2.26658058453;
++      m_positions [8] =  3.19099320178;
++    break;
++
++    case 9:
++      m_weights   [0] = 7.64043285523e-6;
++      m_weights   [1] = 0.00134364574678;
++      m_weights   [2] = 0.0338743944555;
++      m_weights   [3] = 0.240138611082;
++      m_weights   [4] = 0.610862633735;
++      m_weights   [5] = 0.610862633735;
++      m_weights   [6] = 0.240138611082;
++      m_weights   [7] = 0.0338743944555;
++      m_weights   [8] = 0.00134364574678;
++      m_weights   [9] = 7.64043285523e-6;
++
++      m_positions [0] = -3.43615911884;
++      m_positions [1] = -2.53273167423;
++      m_positions [2] = -1.7566836493;
++      m_positions [3] = -1.03661082979;
++      m_positions [4] = -0.342901327224;
++      m_positions [5] =  0.342901327224;
++      m_positions [6] =  1.03661082979;
++      m_positions [7] =  1.7566836493;
++      m_positions [8] =  2.53273167423;
++      m_positions [9] =  3.43615911884;
++    break;
++
++    case 19:
++      m_weights   [0] =  2.22939364554e-13;
++      m_weights   [1] =  4.39934099226e-10;
++      m_weights   [2] =  1.08606937077e-7;
++      m_weights   [3] =  7.8025564785e-6;
++      m_weights   [4] =  0.000228338636017;
++      m_weights   [5] =  0.00324377334224;
++      m_weights   [6] =  0.0248105208875;
++      m_weights   [7] =  0.10901720602;
++      m_weights   [8] =  0.286675505363;
++      m_weights   [9] =  0.462243669601;
++      m_weights  [10] =  0.462243669601;
++      m_weights  [11] =  0.286675505363;
++      m_weights  [12] =  0.10901720602;
++      m_weights  [13] =  0.0248105208875;
++      m_weights  [14] =  0.00324377334224;
++      m_weights  [15] =  0.000228338636017;
++      m_weights  [16] =  7.8025564785e-6;
++      m_weights  [17] =  1.08606937077e-7;
++      m_weights  [18] =  4.39934099226e-10;
++      m_weights  [19] =  2.22939364554e-13;
++
++      m_positions [0] = -5.38748089001;
++      m_positions [1] = -4.60368244955;
++      m_positions [2] = -3.94476404012;
++      m_positions [3] = -3.34785456738;
++      m_positions [4] = -2.78880605843;
++      m_positions [5] = -2.25497400209;
++      m_positions [6] = -1.73853771212;
++      m_positions [7] = -1.2340762154;
++      m_positions [8] = -0.737473728545;
++      m_positions [9] = -0.245340708301;
++      m_positions[10] =  0.245340708301;
++      m_positions[11] =  0.737473728545;
++      m_positions[12] =  1.2340762154;
++      m_positions[13] =  1.73853771212;
++      m_positions[14] =  2.25497400209;
++      m_positions[15] =  2.78880605843;
++      m_positions[16] =  3.34785456738;
++      m_positions[17] =  3.94476404012;
++      m_positions[18] =  4.60368244955;
++      m_positions[19] =  5.38748089001;
++    break;
++
++    default:
++      std::cerr << "In GaussianHermite1DQuadrature::constructor()"
++                << ": m_order = " << m_order
++                << std::endl;
++      UQ_FATAL_TEST_MACRO(true,
++                          UQ_UNAVAILABLE_RANK,
++                          "GaussianHermite1DQuadrature::constructor()",
++                          "order not supported");
++    break;
++  }
++  for (unsigned int j = 0; j < (m_order+1); ++j) {
++    m_weights  [j] *= sqrt(2.);
++    m_positions[j] *= sqrt(2.);
++  }
++}
++
++GaussianHermite1DQuadrature::~GaussianHermite1DQuadrature()
++{
++}
++
++void
++GaussianHermite1DQuadrature::dumbRoutine() const
++{
++  return;
++}
++
++//*****************************************************
++// WignerInverseChebyshev1st 1D quadrature class
++//*****************************************************
++WignerInverseChebyshev1st1DQuadrature::WignerInverseChebyshev1st1DQuadrature(
++  double       minDomainValue,
++  double       maxDomainValue,
++  unsigned int order)
++  :
++  Base1DQuadrature(minDomainValue,maxDomainValue,order)
++{
++  m_positions.resize(m_order+1,0.); // Yes, '+1'
++  m_weights.resize  (m_order+1,0.); // Yes, '+1'
++
++  // http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature
++  switch (m_order) {
++    default:
++      UQ_FATAL_TEST_MACRO(true,
++                          UQ_UNAVAILABLE_RANK,
++                          "WignerInverseChebyshev1st1DQuadrature::constructor()",
++                          "order not supported");
++    break;
++  }
++
++  // Scale positions from the interval [-1, 1] to the interval [min,max]
++  for (unsigned int j = 0; j < m_positions.size(); ++j) {
++    m_positions[j] = .5*(m_maxDomainValue - m_minDomainValue)*m_positions[j] + .5*(m_maxDomainValue + m_minDomainValue);
++    m_weights[j] *= .5*(m_maxDomainValue - m_minDomainValue);
++  }
++}
++
++WignerInverseChebyshev1st1DQuadrature::~WignerInverseChebyshev1st1DQuadrature()
++{
++}
++
++void
++WignerInverseChebyshev1st1DQuadrature::dumbRoutine() const
++{
++  return;
++}
++
++//*****************************************************
++// WignerChebyshev2nd 1D quadrature class
++//*****************************************************
++WignerChebyshev2nd1DQuadrature::WignerChebyshev2nd1DQuadrature(
++  double       minDomainValue,
++  double       maxDomainValue,
++  unsigned int order)
++  :
++  Base1DQuadrature(minDomainValue,maxDomainValue,order)
++{
++  m_positions.resize(m_order+1,0.); // Yes, '+1'
++  m_weights.resize  (m_order+1,0.); // Yes, '+1'
++
++  // http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature
++  unsigned int n = m_order+1;
++  for (unsigned int i = 0; i < n; ++i) {
++    double angle = M_PI*((double)(i+1))/((double)(n+1));
++    double cosValue = cos(angle);
++    double sinValue = sin(angle);
++    m_positions[i] = cosValue;
++    m_weights[i] = ( M_PI/((double)(n+1)) )*sinValue*sinValue;
++  }
++
++  // Scale positions from the interval [-1, 1] to the interval [min,max]
++  for (unsigned int j = 0; j < m_positions.size(); ++j) {
++    m_positions[j] = .5*(m_maxDomainValue - m_minDomainValue)*m_positions[j] + .5*(m_maxDomainValue + m_minDomainValue);
++    m_weights[j] *= .5*(m_maxDomainValue - m_minDomainValue);
++  }
++}
++
++WignerChebyshev2nd1DQuadrature::~WignerChebyshev2nd1DQuadrature()
++{
++}
++
++void
++WignerChebyshev2nd1DQuadrature::dumbRoutine() const
++{
++  return;
++}
++
++}  // End namespace QUESO
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh	(revision 26246)
+@@ -47,6 +47,7 @@
+ 
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
++cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+ cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+@@ -76,11 +77,11 @@
+ 	-DBUILD_SHARED_LIBS=OFF \
+ 	-DBUILD_STATIC_LIBS=ON \
+ 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
++	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration" \
+ 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
++	-DCMAKE_CXX_FLAGS="-fPIC -fdelayed-template-parsing" \
+ 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
+-	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration" \
+-	-DCMAKE_CXX_FLAGS="-fPIC -fdelayed-template-parsing" \
+-	-DCMAKE_Fortran_FLAGS="-fPIC" \
++	-DCMAKE_Fortran_FLAGS="-fPIC -fallow-argument-mismatch" \
+ 	-DBoost_NO_BOOST_CMAKE=TRUE \
+ 	-DHAVE_ACRO=OFF \
+ 	-DHAVE_JEGA=OFF \
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-mac.sh	(revision 26246)
+@@ -44,6 +44,7 @@
+ 
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
++cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+ cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+@@ -62,8 +63,9 @@
+ 	-DBUILD_STATIC_LIBS=OFF \
+ 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
+ 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
++	-DCMAKE_CXX_FLAGS="-fdelayed-template-parsing" \
+ 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
+-	-DCMAKE_CXX_FLAGS="-fdelayed-template-parsing" \
++	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch" \
+ 	-DBoost_NO_BOOST_CMAKE=TRUE \
+ 	-DHAVE_ACRO=OFF \
+ 	-DHAVE_JEGA=OFF \
+Index: ../trunk-jpl/externalpackages/gmt/configs/6/cmake/ConfigUser.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/configs/6/cmake/ConfigUser.cmake	(revision 26245)
++++ ../trunk-jpl/externalpackages/gmt/configs/6/cmake/ConfigUser.cmake	(nonexistent)
+@@ -1,308 +0,0 @@
+-#
+-#
+-# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
+-# See LICENSE.TXT file for copying and redistribution conditions.
+-#
+-# This program is free software; you can redistribute it and/or modify it
+-# under the terms of the GNU Lesser General Public License as published by the
+-# Free Software Foundation; version 3 or any later version.
+-#
+-# This program is distributed in the hope that it will be useful, but WITHOUT
+-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+-# for more details.
+-#
+-# Contact info: www.generic-mapping-tools.org
+-# ----------------------------------------------------------------------------
+-
+-# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
+-# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
+-# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
+-# (currently listed in .gitignore).
+-#
+-# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
+-# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
+-# "False", "off", "no", and "something-NotFound" are all false).  Other values
+-# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+-# OFF, or YES and NO for your booleans.
+-
+-##
+-## Section 1: Installation paths
+-##
+-
+-# ============================================================================
+-# Basic setup begins here.  All settings are optional.  In most cases, setting
+-# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+-# reasonable defaults enabled.  Note: If you need to specify directory names
+-# with spaces (e.g., on Windows) then you must put them in quotes.
+-# ============================================================================
+-
+-# Installation path (usually defaults to /usr/local) [auto]:
+-set (CMAKE_INSTALL_PREFIX "$ENV{PREFIX}")
+-
+-# Set install name suffix used for directories and gmt executables
+-# [undefined]:
+-#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+-
+-# Install into traditional directory structure. Disable to install a
+-# distribution type directory structure (doc and share separated) [on]:
+-#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+-
+-# Install convenience links for GMT modules. Disable to install only the main
+-# gmt program and access modules as "gmt modulename options" [TRUE]:
+-#set (GMT_INSTALL_MODULE_LINKS FALSE)
+-
+-# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+-set (GMT_INSTALL_RELOCATABLE TRUE)
+-
+-# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
+-#set (GMT_EXCLUDE_GDAL TRUE)
+-#set (GMT_EXCLUDE_PCRE TRUE)
+-#set (GMT_EXCLUDE_PCRE2 TRUE)
+-#set (GMT_EXCLUDE_FFTW3 TRUE)
+-#set (GMT_EXCLUDE_LAPACK TRUE)
+-#set (GMT_EXCLUDE_BLAS TRUE)
+-#set (GMT_EXCLUDE_ZLIB TRUE)
+-
+-# ============================================================================
+-# Advanced configuration begins here.  Usually it is not necessary to edit any
+-# settings below.  You should know what you are doing if you do though.  Note:
+-# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+-# path is given.
+-# ============================================================================
+-
+-# Set binary installation path [bin]:
+-#set (GMT_BINDIR "bin")
+-
+-# Set library installation path [lib or lib64]:
+-#set (GMT_LIBDIR "lib")
+-
+-# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+-#set (GMT_INCLUDEDIR "include/gmt")
+-
+-# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+-#set (GMT_DATADIR "share/gmt")
+-
+-# Set doc installation path [share/doc or
+-# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+-#set (GMT_DOCDIR "share/doc/gmt")
+-
+-# Set manpage installation path [share/man or
+-# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+-#set (GMT_MANDIR "share/doc/gmt/man")
+-
+-# Install documentation files from this external location instead of creating
+-# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
+-#set (GMT_INSTALL_EXTERNAL_DOC OFF)
+-
+-# Install manual pages from this external location instead of creating the
+-# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+-#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+-
+-##
+-## Section 2: Build dependencies (should only be needed if CMake cannot
+-## automatically detect the rights version or path.)
+-##
+-
+-# Set URL to GMT Data server [auto]:
+-#set (GMT_DATA_SERVER "data_server_url")
+-
+-# Set path to GSHHG Shoreline Database [auto]:
+-set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
+-
+-# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
+-#set (COPY_GSHHG TRUE)
+-
+-# Set path to DCW Digital Chart of the World for GMT [auto]:
+-#set (DCW_ROOT "dcw-gmt_path")
+-
+-# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
+-#set (COPY_DCW TRUE)
+-
+-# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+-#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
+-
+-# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+-#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
+-
+-# FOR WINDOWS ONLY
+-# Set path to location of Ghostscript binaries (optional install)
+-#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
+-
+-# FOR WINDOWS ONLY
+-# Set path to location where the gmtmex is located.
+-#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
+-
+-# Set location of NetCDF (can be root directory, path to header file or path
+-# to nc-config) [auto]:
+-set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
+-
+-# Set location of GDAL (can be root directory, path to header file or path to
+-# gdal-config) [auto]:
+-set (GDAL_ROOT "$ENV{GDAL_ROOT}")
+-
+-# Set location of PCRE (can be root directory, path to header file or path to
+-# pcre-config) [auto]:
+-#set (PCRE_ROOT "pcre_install_prefix")
+-# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+-# pcre2-config) [auto]:
+-#set (PCRE2_ROOT "pcre2_install_prefix")
+-
+-# Set location of single precision FFTW (can be root directory or path to
+-# header file) [auto]:
+-#set (FFTW3_ROOT "fftw_install_prefix")
+-
+-# Set location of ZLIB (can be root directory or path to header file) [auto]:
+-set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
+-
+-# Set location of CURL (can be root directory or path to header file) [auto]:
+-#set (CURL_ROOT "curl_install_prefix")
+-
+-# Set location of GLIB component gthread [auto].  This is an optional (and
+-# experimental) option which you need to enable:
+-#set (GMT_USE_THREADS TRUE)
+-# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+-#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
+-#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
+-
+-# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+-set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack")
+-set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas")
+-
+-##
+-## Section 3: GMT features
+-##
+-
+-# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+-# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+-# triangulation (valid values are GPL, LGPL and off) [off]:
+-#set (LICENSE_RESTRICTED GPL)
+-
+-# Allow building of OpenMP if compiler supports it
+-# set (GMT_ENABLE_OPENMP TRUE)
+-
+-# Configure default units (possible values are SI and US) [SI]:
+-#set (UNITS "US")
+-
+-# Enable building of shared libraries [TRUE] (disable to use static libraries;
+-# not recommended; on non-x86 architectures uncomment the next option as well):
+-#set (BUILD_SHARED_LIBS FALSE)
+-
+-# Create position independent code on all targets [auto] (needed for static
+-# build on non-x86):
+-#set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+-
+-# Build GMT shared lib with supplemental modules [TRUE]:
+-#set (BUILD_SUPPLEMENTS FALSE)
+-
+-# Build/Install GMT Developer include files [TRUE]:
+-# This installs the extra include files and configured files needed by 3rd-party
+-# developers.  Until we build a separate gmt-devel we include them in the main
+-# Distribution.
+-#set (BUILD_DEVELOPER FALSE)
+-
+-##
+-## Section 4: Advanced tweaking
+-##
+-
+-#
+-# Testing and development
+-#
+-
+-# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+-# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+-# line.
+-#enable_testing()
+-#set (DO_EXAMPLES TRUE)
+-#set (DO_TESTS TRUE)
+-#set (DO_ANIMATIONS TRUE)
+-# Number of parallel test jobs with "make check":
+-#set (N_TEST_JOBS 4)
+-
+-# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
+-# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
+-# for testing [OFF]:
+-#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+-
+-# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+-# that link against the full gmt libs (not just the API; for building codes
+-# that only need the GMT API, see the gmt-custom project).
+-#set (EXTRA_BUILD_DIRS apidemo)
+-# Uncomment the following line to enable running low-level C tests of the API
+-#set (DO_API_TESTS ON)
+-
+-# Directory in which to install the release sources per default
+-# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+-#set (GMT_RELEASE_PREFIX "release-src-prefix")
+-
+-# If set to false, image conversion from PS images to PNG and PDF does
+-# not depend on the gmt binary target. Note: "make gmt" is then required
+-# before docs_depends [TRUE].
+-#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+-
+-#
+-# Debugging
+-#
+-
+-# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+-# [Release]:
+-#set (CMAKE_BUILD_TYPE Debug)
+-
+-# Extra debugging for developers:
+-#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
+-##	So Xcode can find the supplemental plug-ins during debug sessions
+-#	add_definitions(-DXCODER)
+-#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
+-#	message("Add Xcode definition for GMT")
+-#endif()
+-#add_definitions(-DDEBUG)
+-#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+-#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
+-#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
+-#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
+-#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
+-if (HAVE_OPENMP)
+-	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
+-else (HAVE_OPENMP)
+-	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
+-endif (HAVE_OPENMP)
+-
+-#
+-# System specific tweaks
+-#
+-
+-# This is for GCC on Solaris to avoid "relocations remain against allocatable
+-# but non-writable sections" problems:
+-#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+-
+-# This may be needed to enable strdup and extended math functions with GCC and
+-# Suncc on Solaris:
+-#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+-
+-# Do not warn when building with Windows SDK or Visual Studio Express:
+-#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+-
+-# Manually select runtime library when compiling with Windows SDK or Visual
+-# Studio Express:
+-#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+-
+-# If your NetCDF library is static (not recommended, applies to Windows only)
+-#set (NETCDF_STATIC TRUE)
+-
+-# If want to rename the DLLs to something else than the default (e.g. to
+-# append the bitness - Windows only)
+-# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+-#if (WIN32)
+-# set (BITAGE 32)
+-# # Detect if we are building a 32 or 64 bits version
+-# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+-#   set (BITAGE 64)
+-# endif ()
+-# set (GMT_DLL_RENAME gmt_w${BITAGE})
+-# set (PSL_DLL_RENAME psl_w${BITAGE})
+-#endif(WIN32)
+-
+-# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+-#if(MSVC11)
+-#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+-#endif(MSVC11)
+Index: ../trunk-jpl/externalpackages/gmt/configs/6/linux/cmake/ConfigUser.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/configs/6/linux/cmake/ConfigUser.cmake	(nonexistent)
++++ ../trunk-jpl/externalpackages/gmt/configs/6/linux/cmake/ConfigUser.cmake	(revision 26246)
+@@ -0,0 +1,308 @@
++#
++#
++# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
++# See LICENSE.TXT file for copying and redistribution conditions.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published by the
++# Free Software Foundation; version 3 or any later version.
++#
++# This program is distributed in the hope that it will be useful, but WITHOUT
++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
++# for more details.
++#
++# Contact info: www.generic-mapping-tools.org
++# ----------------------------------------------------------------------------
++
++# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
++# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
++# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
++# (currently listed in .gitignore).
++#
++# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
++# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
++# "False", "off", "no", and "something-NotFound" are all false).  Other values
++# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
++# OFF, or YES and NO for your booleans.
++
++##
++## Section 1: Installation paths
++##
++
++# ============================================================================
++# Basic setup begins here.  All settings are optional.  In most cases, setting
++# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
++# reasonable defaults enabled.  Note: If you need to specify directory names
++# with spaces (e.g., on Windows) then you must put them in quotes.
++# ============================================================================
++
++# Installation path (usually defaults to /usr/local) [auto]:
++set (CMAKE_INSTALL_PREFIX "$ENV{PREFIX}")
++
++# Set install name suffix used for directories and gmt executables
++# [undefined]:
++#set (GMT_INSTALL_NAME_SUFFIX "suffix")
++
++# Install into traditional directory structure. Disable to install a
++# distribution type directory structure (doc and share separated) [on]:
++#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
++
++# Install convenience links for GMT modules. Disable to install only the main
++# gmt program and access modules as "gmt modulename options" [TRUE]:
++#set (GMT_INSTALL_MODULE_LINKS FALSE)
++
++# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
++set (GMT_INSTALL_RELOCATABLE TRUE)
++
++# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
++#set (GMT_EXCLUDE_GDAL TRUE)
++#set (GMT_EXCLUDE_PCRE TRUE)
++#set (GMT_EXCLUDE_PCRE2 TRUE)
++#set (GMT_EXCLUDE_FFTW3 TRUE)
++#set (GMT_EXCLUDE_LAPACK TRUE)
++#set (GMT_EXCLUDE_BLAS TRUE)
++#set (GMT_EXCLUDE_ZLIB TRUE)
++
++# ============================================================================
++# Advanced configuration begins here.  Usually it is not necessary to edit any
++# settings below.  You should know what you are doing if you do though.  Note:
++# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
++# path is given.
++# ============================================================================
++
++# Set binary installation path [bin]:
++#set (GMT_BINDIR "bin")
++
++# Set library installation path [lib or lib64]:
++#set (GMT_LIBDIR "lib")
++
++# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_INCLUDEDIR "include/gmt")
++
++# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DATADIR "share/gmt")
++
++# Set doc installation path [share/doc or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DOCDIR "share/doc/gmt")
++
++# Set manpage installation path [share/man or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
++#set (GMT_MANDIR "share/doc/gmt/man")
++
++# Install documentation files from this external location instead of creating
++# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
++#set (GMT_INSTALL_EXTERNAL_DOC OFF)
++
++# Install manual pages from this external location instead of creating the
++# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
++#set (GMT_INSTALL_EXTERNAL_MAN OFF)
++
++##
++## Section 2: Build dependencies (should only be needed if CMake cannot
++## automatically detect the rights version or path.)
++##
++
++# Set URL to GMT Data server [auto]:
++#set (GMT_DATA_SERVER "data_server_url")
++
++# Set path to GSHHG Shoreline Database [auto]:
++set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
++
++# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
++#set (COPY_GSHHG TRUE)
++
++# Set path to DCW Digital Chart of the World for GMT [auto]:
++#set (DCW_ROOT "dcw-gmt_path")
++
++# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
++#set (COPY_DCW TRUE)
++
++# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
++
++# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
++
++# FOR WINDOWS ONLY
++# Set path to location of Ghostscript binaries (optional install)
++#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
++
++# FOR WINDOWS ONLY
++# Set path to location where the gmtmex is located.
++#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
++
++# Set location of NetCDF (can be root directory, path to header file or path
++# to nc-config) [auto]:
++set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
++
++# Set location of GDAL (can be root directory, path to header file or path to
++# gdal-config) [auto]:
++set (GDAL_ROOT "$ENV{GDAL_ROOT}")
++
++# Set location of PCRE (can be root directory, path to header file or path to
++# pcre-config) [auto]:
++#set (PCRE_ROOT "pcre_install_prefix")
++# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
++# pcre2-config) [auto]:
++#set (PCRE2_ROOT "pcre2_install_prefix")
++
++# Set location of single precision FFTW (can be root directory or path to
++# header file) [auto]:
++#set (FFTW3_ROOT "fftw_install_prefix")
++
++# Set location of ZLIB (can be root directory or path to header file) [auto]:
++set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
++
++# Set location of CURL (can be root directory or path to header file) [auto]:
++#set (CURL_ROOT "curl_install_prefix")
++
++# Set location of GLIB component gthread [auto].  This is an optional (and
++# experimental) option which you need to enable:
++#set (GMT_USE_THREADS TRUE)
++# If pkg-config is not installed (e.g. on Windows) you need to specify these:
++#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
++#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
++
++# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
++set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran")
++set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran")
++
++##
++## Section 3: GMT features
++##
++
++# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
++# redistributed under the terms of the GPL or LGPL such as Shewchuk's
++# triangulation (valid values are GPL, LGPL and off) [off]:
++#set (LICENSE_RESTRICTED GPL)
++
++# Allow building of OpenMP if compiler supports it
++# set (GMT_ENABLE_OPENMP TRUE)
++
++# Configure default units (possible values are SI and US) [SI]:
++#set (UNITS "US")
++
++# Enable building of shared libraries [TRUE] (disable to use static libraries;
++# not recommended; on non-x86 architectures uncomment the next option as well):
++#set (BUILD_SHARED_LIBS FALSE)
++
++# Create position independent code on all targets [auto] (needed for static
++# build on non-x86):
++#set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
++
++# Build GMT shared lib with supplemental modules [TRUE]:
++#set (BUILD_SUPPLEMENTS FALSE)
++
++# Build/Install GMT Developer include files [TRUE]:
++# This installs the extra include files and configured files needed by 3rd-party
++# developers.  Until we build a separate gmt-devel we include them in the main
++# Distribution.
++#set (BUILD_DEVELOPER FALSE)
++
++##
++## Section 4: Advanced tweaking
++##
++
++#
++# Testing and development
++#
++
++# Enable running examples/tests with "ctest" or "make check" (out-of-source).
++# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
++# line.
++#enable_testing()
++#set (DO_EXAMPLES TRUE)
++#set (DO_TESTS TRUE)
++#set (DO_ANIMATIONS TRUE)
++# Number of parallel test jobs with "make check":
++#set (N_TEST_JOBS 4)
++
++# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
++# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
++# for testing [OFF]:
++#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
++
++# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
++# that link against the full gmt libs (not just the API; for building codes
++# that only need the GMT API, see the gmt-custom project).
++#set (EXTRA_BUILD_DIRS apidemo)
++# Uncomment the following line to enable running low-level C tests of the API
++#set (DO_API_TESTS ON)
++
++# Directory in which to install the release sources per default
++# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
++#set (GMT_RELEASE_PREFIX "release-src-prefix")
++
++# If set to false, image conversion from PS images to PNG and PDF does
++# not depend on the gmt binary target. Note: "make gmt" is then required
++# before docs_depends [TRUE].
++#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
++
++#
++# Debugging
++#
++
++# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
++# [Release]:
++#set (CMAKE_BUILD_TYPE Debug)
++
++# Extra debugging for developers:
++#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
++##	So Xcode can find the supplemental plug-ins during debug sessions
++#	add_definitions(-DXCODER)
++#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
++#	message("Add Xcode definition for GMT")
++#endif()
++#add_definitions(-DDEBUG)
++#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
++#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
++#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
++#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
++#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
++if (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
++else (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
++endif (HAVE_OPENMP)
++
++#
++# System specific tweaks
++#
++
++# This is for GCC on Solaris to avoid "relocations remain against allocatable
++# but non-writable sections" problems:
++#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
++
++# This may be needed to enable strdup and extended math functions with GCC and
++# Suncc on Solaris:
++#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
++
++# Do not warn when building with Windows SDK or Visual Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
++
++# Manually select runtime library when compiling with Windows SDK or Visual
++# Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
++
++# If your NetCDF library is static (not recommended, applies to Windows only)
++#set (NETCDF_STATIC TRUE)
++
++# If want to rename the DLLs to something else than the default (e.g. to
++# append the bitness - Windows only)
++# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
++#if (WIN32)
++# set (BITAGE 32)
++# # Detect if we are building a 32 or 64 bits version
++# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
++#   set (BITAGE 64)
++# endif ()
++# set (GMT_DLL_RENAME gmt_w${BITAGE})
++# set (PSL_DLL_RENAME psl_w${BITAGE})
++#endif(WIN32)
++
++# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
++#if(MSVC11)
++#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
++#endif(MSVC11)
+Index: ../trunk-jpl/externalpackages/gmt/configs/6/mac/cmake/ConfigUser.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/configs/6/mac/cmake/ConfigUser.cmake	(nonexistent)
++++ ../trunk-jpl/externalpackages/gmt/configs/6/mac/cmake/ConfigUser.cmake	(revision 26246)
+@@ -0,0 +1,308 @@
++#
++#
++# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
++# See LICENSE.TXT file for copying and redistribution conditions.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published by the
++# Free Software Foundation; version 3 or any later version.
++#
++# This program is distributed in the hope that it will be useful, but WITHOUT
++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
++# for more details.
++#
++# Contact info: www.generic-mapping-tools.org
++# ----------------------------------------------------------------------------
++
++# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
++# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
++# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
++# (currently listed in .gitignore).
++#
++# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
++# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
++# "False", "off", "no", and "something-NotFound" are all false).  Other values
++# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
++# OFF, or YES and NO for your booleans.
++
++##
++## Section 1: Installation paths
++##
++
++# ============================================================================
++# Basic setup begins here.  All settings are optional.  In most cases, setting
++# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
++# reasonable defaults enabled.  Note: If you need to specify directory names
++# with spaces (e.g., on Windows) then you must put them in quotes.
++# ============================================================================
++
++# Installation path (usually defaults to /usr/local) [auto]:
++set (CMAKE_INSTALL_PREFIX "$ENV{PREFIX}")
++
++# Set install name suffix used for directories and gmt executables
++# [undefined]:
++#set (GMT_INSTALL_NAME_SUFFIX "suffix")
++
++# Install into traditional directory structure. Disable to install a
++# distribution type directory structure (doc and share separated) [on]:
++#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
++
++# Install convenience links for GMT modules. Disable to install only the main
++# gmt program and access modules as "gmt modulename options" [TRUE]:
++#set (GMT_INSTALL_MODULE_LINKS FALSE)
++
++# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
++set (GMT_INSTALL_RELOCATABLE TRUE)
++
++# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
++#set (GMT_EXCLUDE_GDAL TRUE)
++#set (GMT_EXCLUDE_PCRE TRUE)
++#set (GMT_EXCLUDE_PCRE2 TRUE)
++#set (GMT_EXCLUDE_FFTW3 TRUE)
++#set (GMT_EXCLUDE_LAPACK TRUE)
++#set (GMT_EXCLUDE_BLAS TRUE)
++#set (GMT_EXCLUDE_ZLIB TRUE)
++
++# ============================================================================
++# Advanced configuration begins here.  Usually it is not necessary to edit any
++# settings below.  You should know what you are doing if you do though.  Note:
++# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
++# path is given.
++# ============================================================================
++
++# Set binary installation path [bin]:
++#set (GMT_BINDIR "bin")
++
++# Set library installation path [lib or lib64]:
++#set (GMT_LIBDIR "lib")
++
++# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_INCLUDEDIR "include/gmt")
++
++# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DATADIR "share/gmt")
++
++# Set doc installation path [share/doc or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DOCDIR "share/doc/gmt")
++
++# Set manpage installation path [share/man or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
++#set (GMT_MANDIR "share/doc/gmt/man")
++
++# Install documentation files from this external location instead of creating
++# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
++#set (GMT_INSTALL_EXTERNAL_DOC OFF)
++
++# Install manual pages from this external location instead of creating the
++# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
++#set (GMT_INSTALL_EXTERNAL_MAN OFF)
++
++##
++## Section 2: Build dependencies (should only be needed if CMake cannot
++## automatically detect the rights version or path.)
++##
++
++# Set URL to GMT Data server [auto]:
++#set (GMT_DATA_SERVER "data_server_url")
++
++# Set path to GSHHG Shoreline Database [auto]:
++set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
++
++# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
++#set (COPY_GSHHG TRUE)
++
++# Set path to DCW Digital Chart of the World for GMT [auto]:
++#set (DCW_ROOT "dcw-gmt_path")
++
++# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
++#set (COPY_DCW TRUE)
++
++# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
++
++# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
++
++# FOR WINDOWS ONLY
++# Set path to location of Ghostscript binaries (optional install)
++#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
++
++# FOR WINDOWS ONLY
++# Set path to location where the gmtmex is located.
++#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
++
++# Set location of NetCDF (can be root directory, path to header file or path
++# to nc-config) [auto]:
++set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
++
++# Set location of GDAL (can be root directory, path to header file or path to
++# gdal-config) [auto]:
++set (GDAL_ROOT "$ENV{GDAL_ROOT}")
++
++# Set location of PCRE (can be root directory, path to header file or path to
++# pcre-config) [auto]:
++#set (PCRE_ROOT "pcre_install_prefix")
++# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
++# pcre2-config) [auto]:
++#set (PCRE2_ROOT "pcre2_install_prefix")
++
++# Set location of single precision FFTW (can be root directory or path to
++# header file) [auto]:
++#set (FFTW3_ROOT "fftw_install_prefix")
++
++# Set location of ZLIB (can be root directory or path to header file) [auto]:
++set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
++
++# Set location of CURL (can be root directory or path to header file) [auto]:
++#set (CURL_ROOT "curl_install_prefix")
++
++# Set location of GLIB component gthread [auto].  This is an optional (and
++# experimental) option which you need to enable:
++#set (GMT_USE_THREADS TRUE)
++# If pkg-config is not installed (e.g. on Windows) you need to specify these:
++#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
++#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
++
++# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
++set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack")
++set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas")
++
++##
++## Section 3: GMT features
++##
++
++# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
++# redistributed under the terms of the GPL or LGPL such as Shewchuk's
++# triangulation (valid values are GPL, LGPL and off) [off]:
++#set (LICENSE_RESTRICTED GPL)
++
++# Allow building of OpenMP if compiler supports it
++# set (GMT_ENABLE_OPENMP TRUE)
++
++# Configure default units (possible values are SI and US) [SI]:
++#set (UNITS "US")
++
++# Enable building of shared libraries [TRUE] (disable to use static libraries;
++# not recommended; on non-x86 architectures uncomment the next option as well):
++#set (BUILD_SHARED_LIBS FALSE)
++
++# Create position independent code on all targets [auto] (needed for static
++# build on non-x86):
++#set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
++
++# Build GMT shared lib with supplemental modules [TRUE]:
++#set (BUILD_SUPPLEMENTS FALSE)
++
++# Build/Install GMT Developer include files [TRUE]:
++# This installs the extra include files and configured files needed by 3rd-party
++# developers.  Until we build a separate gmt-devel we include them in the main
++# Distribution.
++#set (BUILD_DEVELOPER FALSE)
++
++##
++## Section 4: Advanced tweaking
++##
++
++#
++# Testing and development
++#
++
++# Enable running examples/tests with "ctest" or "make check" (out-of-source).
++# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
++# line.
++#enable_testing()
++#set (DO_EXAMPLES TRUE)
++#set (DO_TESTS TRUE)
++#set (DO_ANIMATIONS TRUE)
++# Number of parallel test jobs with "make check":
++#set (N_TEST_JOBS 4)
++
++# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
++# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
++# for testing [OFF]:
++#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
++
++# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
++# that link against the full gmt libs (not just the API; for building codes
++# that only need the GMT API, see the gmt-custom project).
++#set (EXTRA_BUILD_DIRS apidemo)
++# Uncomment the following line to enable running low-level C tests of the API
++#set (DO_API_TESTS ON)
++
++# Directory in which to install the release sources per default
++# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
++#set (GMT_RELEASE_PREFIX "release-src-prefix")
++
++# If set to false, image conversion from PS images to PNG and PDF does
++# not depend on the gmt binary target. Note: "make gmt" is then required
++# before docs_depends [TRUE].
++#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
++
++#
++# Debugging
++#
++
++# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
++# [Release]:
++#set (CMAKE_BUILD_TYPE Debug)
++
++# Extra debugging for developers:
++#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
++##	So Xcode can find the supplemental plug-ins during debug sessions
++#	add_definitions(-DXCODER)
++#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
++#	message("Add Xcode definition for GMT")
++#endif()
++#add_definitions(-DDEBUG)
++#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
++#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
++#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
++#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
++#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
++if (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
++else (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
++endif (HAVE_OPENMP)
++
++#
++# System specific tweaks
++#
++
++# This is for GCC on Solaris to avoid "relocations remain against allocatable
++# but non-writable sections" problems:
++#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
++
++# This may be needed to enable strdup and extended math functions with GCC and
++# Suncc on Solaris:
++#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
++
++# Do not warn when building with Windows SDK or Visual Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
++
++# Manually select runtime library when compiling with Windows SDK or Visual
++# Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
++
++# If your NetCDF library is static (not recommended, applies to Windows only)
++#set (NETCDF_STATIC TRUE)
++
++# If want to rename the DLLs to something else than the default (e.g. to
++# append the bitness - Windows only)
++# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
++#if (WIN32)
++# set (BITAGE 32)
++# # Detect if we are building a 32 or 64 bits version
++# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
++#   set (BITAGE 64)
++# endif ()
++# set (GMT_DLL_RENAME gmt_w${BITAGE})
++# set (PSL_DLL_RENAME psl_w${BITAGE})
++#endif(WIN32)
++
++# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
++#if(MSVC11)
++#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
++#endif(MSVC11)
+Index: ../trunk-jpl/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake	(revision 26245)
++++ ../trunk-jpl/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake	(nonexistent)
+@@ -1,308 +0,0 @@
+-#
+-#
+-# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
+-# See LICENSE.TXT file for copying and redistribution conditions.
+-#
+-# This program is free software; you can redistribute it and/or modify it
+-# under the terms of the GNU Lesser General Public License as published by the
+-# Free Software Foundation; version 3 or any later version.
+-#
+-# This program is distributed in the hope that it will be useful, but WITHOUT
+-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+-# for more details.
+-#
+-# Contact info: www.generic-mapping-tools.org
+-# ----------------------------------------------------------------------------
+-
+-# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
+-# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
+-# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
+-# (currently listed in .gitignore).
+-#
+-# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
+-# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
+-# "False", "off", "no", and "something-NotFound" are all false).  Other values
+-# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
+-# OFF, or YES and NO for your booleans.
+-
+-##
+-## Section 1: Installation paths
+-##
+-
+-# ============================================================================
+-# Basic setup begins here.  All settings are optional.  In most cases, setting
+-# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
+-# reasonable defaults enabled.  Note: If you need to specify directory names
+-# with spaces (e.g., on Windows) then you must put them in quotes.
+-# ============================================================================
+-
+-# Installation path (usually defaults to /usr/local) [auto]:
+-set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
+-
+-# Set install name suffix used for directories and gmt executables
+-# [undefined]:
+-#set (GMT_INSTALL_NAME_SUFFIX "suffix")
+-
+-# Install into traditional directory structure. Disable to install a
+-# distribution type directory structure (doc and share separated) [on]:
+-#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
+-
+-# Install convenience links for GMT modules. Disable to install only the main
+-# gmt program and access modules as "gmt modulename options" [TRUE]:
+-#set (GMT_INSTALL_MODULE_LINKS FALSE)
+-
+-# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
+-set (GMT_INSTALL_RELOCATABLE TRUE)
+-
+-# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
+-#set (GMT_EXCLUDE_GDAL TRUE)
+-#set (GMT_EXCLUDE_PCRE TRUE)
+-#set (GMT_EXCLUDE_PCRE2 TRUE)
+-#set (GMT_EXCLUDE_FFTW3 TRUE)
+-#set (GMT_EXCLUDE_LAPACK TRUE)
+-#set (GMT_EXCLUDE_BLAS TRUE)
+-#set (GMT_EXCLUDE_ZLIB TRUE)
+-
+-# ============================================================================
+-# Advanced configuration begins here.  Usually it is not necessary to edit any
+-# settings below.  You should know what you are doing if you do though.  Note:
+-# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
+-# path is given.
+-# ============================================================================
+-
+-# Set binary installation path [bin]:
+-#set (GMT_BINDIR "bin")
+-
+-# Set library installation path [lib or lib64]:
+-#set (GMT_LIBDIR "lib")
+-
+-# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+-#set (GMT_INCLUDEDIR "include/gmt")
+-
+-# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+-#set (GMT_DATADIR "share/gmt")
+-
+-# Set doc installation path [share/doc or
+-# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
+-#set (GMT_DOCDIR "share/doc/gmt")
+-
+-# Set manpage installation path [share/man or
+-# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
+-#set (GMT_MANDIR "share/doc/gmt/man")
+-
+-# Install documentation files from this external location instead of creating
+-# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
+-#set (GMT_INSTALL_EXTERNAL_DOC OFF)
+-
+-# Install manual pages from this external location instead of creating the
+-# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
+-#set (GMT_INSTALL_EXTERNAL_MAN OFF)
+-
+-##
+-## Section 2: Build dependencies (should only be needed if CMake cannot
+-## automatically detect the rights version or path.)
+-##
+-
+-# Set URL to GMT Data server [auto]:
+-#set (GMT_DATA_SERVER "data_server_url")
+-
+-# Set path to GSHHG Shoreline Database [auto]:
+-set (GSHHG_ROOT "$ENV{ISSM_DIR}/externalpackages/gshhg/install")
+-
+-# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
+-#set (COPY_GSHHG TRUE)
+-
+-# Set path to DCW Digital Chart of the World for GMT [auto]:
+-#set (DCW_ROOT "dcw-gmt_path")
+-
+-# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
+-#set (COPY_DCW TRUE)
+-
+-# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+-#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
+-
+-# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
+-#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
+-
+-# FOR WINDOWS ONLY
+-# Set path to location of Ghostscript binaries (optional install)
+-#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
+-
+-# FOR WINDOWS ONLY
+-# Set path to location where the gmtmex is located.
+-#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
+-
+-# Set location of NetCDF (can be root directory, path to header file or path
+-# to nc-config) [auto]:
+-set (NETCDF_ROOT "$ENV{ISSM_DIR}/externalpackages/netcdf/install")
+-
+-# Set location of GDAL (can be root directory, path to header file or path to
+-# gdal-config) [auto]:
+-set (GDAL_ROOT "$ENV{ISSM_DIR}/externalpackages/gdal/install")
+-
+-# Set location of PCRE (can be root directory, path to header file or path to
+-# pcre-config) [auto]:
+-#set (PCRE_ROOT "pcre_install_prefix")
+-# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
+-# pcre2-config) [auto]:
+-#set (PCRE2_ROOT "pcre2_install_prefix")
+-
+-# Set location of single precision FFTW (can be root directory or path to
+-# header file) [auto]:
+-#set (FFTW3_ROOT "fftw_install_prefix")
+-
+-# Set location of ZLIB (can be root directory or path to header file) [auto]:
+-set (ZLIB_ROOT "$ENV{ISSM_DIR}/externalpackages/petsc/install")
+-
+-# Set location of CURL (can be root directory or path to header file) [auto]:
+-#set (CURL_ROOT "curl_install_prefix")
+-
+-# Set location of GLIB component gthread [auto].  This is an optional (and
+-# experimental) option which you need to enable:
+-#set (GMT_USE_THREADS TRUE)
+-# If pkg-config is not installed (e.g. on Windows) you need to specify these:
+-#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
+-#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
+-
+-# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
+-#set (LAPACK_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lflapack")
+-#set (BLAS_LIBRARY "-L$ENV{ISSM_DIR}/externalpackages/petsc/install/lib -lfblas")
+-
+-##
+-## Section 3: GMT features
+-##
+-
+-# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
+-# redistributed under the terms of the GPL or LGPL such as Shewchuk's
+-# triangulation (valid values are GPL, LGPL and off) [off]:
+-#set (LICENSE_RESTRICTED GPL)
+-
+-# Allow building of OpenMP if compiler supports it
+-# set (GMT_ENABLE_OPENMP TRUE)
+-
+-# Configure default units (possible values are SI and US) [SI]:
+-#set (UNITS "US")
+-
+-# Enable building of shared libraries [TRUE] (disable to use static libraries;
+-# not recommended; on non-x86 architectures uncomment the next option as well):
+-set (BUILD_SHARED_LIBS FALSE)
+-
+-# Create position independent code on all targets [auto] (needed for static
+-# build on non-x86):
+-set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+-
+-# Build GMT shared lib with supplemental modules [TRUE]:
+-set (BUILD_SUPPLEMENTS FALSE)
+-
+-# Build/Install GMT Developer include files [TRUE]:
+-# This installs the extra include files and configured files needed by 3rd-party
+-# developers.  Until we build a separate gmt-devel we include them in the main
+-# Distribution.
+-#set (BUILD_DEVELOPER FALSE)
+-
+-##
+-## Section 4: Advanced tweaking
+-##
+-
+-#
+-# Testing and development
+-#
+-
+-# Enable running examples/tests with "ctest" or "make check" (out-of-source).
+-# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
+-# line.
+-#enable_testing()
+-#set (DO_EXAMPLES TRUE)
+-#set (DO_TESTS TRUE)
+-#set (DO_ANIMATIONS TRUE)
+-# Number of parallel test jobs with "make check":
+-#set (N_TEST_JOBS 4)
+-
+-# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
+-# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
+-# for testing [OFF]:
+-#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
+-
+-# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
+-# that link against the full gmt libs (not just the API; for building codes
+-# that only need the GMT API, see the gmt-custom project).
+-#set (EXTRA_BUILD_DIRS apidemo)
+-# Uncomment the following line to enable running low-level C tests of the API
+-#set (DO_API_TESTS ON)
+-
+-# Directory in which to install the release sources per default
+-# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
+-#set (GMT_RELEASE_PREFIX "release-src-prefix")
+-
+-# If set to false, image conversion from PS images to PNG and PDF does
+-# not depend on the gmt binary target. Note: "make gmt" is then required
+-# before docs_depends [TRUE].
+-#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
+-
+-#
+-# Debugging
+-#
+-
+-# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
+-# [Release]:
+-#set (CMAKE_BUILD_TYPE Debug)
+-
+-# Extra debugging for developers:
+-#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
+-##	So Xcode can find the supplemental plug-ins during debug sessions
+-#	add_definitions(-DXCODER)
+-#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
+-#	message("Add Xcode definition for GMT")
+-#endif()
+-#add_definitions(-DDEBUG)
+-#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
+-#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
+-#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
+-#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
+-#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
+-if (HAVE_OPENMP)
+-	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
+-else (HAVE_OPENMP)
+-	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
+-endif (HAVE_OPENMP)
+-
+-#
+-# System specific tweaks
+-#
+-
+-# This is for GCC on Solaris to avoid "relocations remain against allocatable
+-# but non-writable sections" problems:
+-#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
+-
+-# This may be needed to enable strdup and extended math functions with GCC and
+-# Suncc on Solaris:
+-#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
+-
+-# Do not warn when building with Windows SDK or Visual Studio Express:
+-#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+-
+-# Manually select runtime library when compiling with Windows SDK or Visual
+-# Studio Express:
+-#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
+-
+-# If your NetCDF library is static (not recommended, applies to Windows only)
+-set (NETCDF_STATIC TRUE)
+-
+-# If want to rename the DLLs to something else than the default (e.g. to
+-# append the bitness - Windows only)
+-# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
+-#if (WIN32)
+-# set (BITAGE 32)
+-# # Detect if we are building a 32 or 64 bits version
+-# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+-#   set (BITAGE 64)
+-# endif ()
+-# set (GMT_DLL_RENAME gmt_w${BITAGE})
+-# set (PSL_DLL_RENAME psl_w${BITAGE})
+-#endif(WIN32)
+-
+-# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
+-#if(MSVC11)
+-#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
+-#endif(MSVC11)
+Index: ../trunk-jpl/externalpackages/gmt/configs/6/static/linux/cmake/ConfigUser.static.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/configs/6/static/linux/cmake/ConfigUser.static.cmake	(nonexistent)
++++ ../trunk-jpl/externalpackages/gmt/configs/6/static/linux/cmake/ConfigUser.static.cmake	(revision 26246)
+@@ -0,0 +1,308 @@
++#
++#
++# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
++# See LICENSE.TXT file for copying and redistribution conditions.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published by the
++# Free Software Foundation; version 3 or any later version.
++#
++# This program is distributed in the hope that it will be useful, but WITHOUT
++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
++# for more details.
++#
++# Contact info: www.generic-mapping-tools.org
++# ----------------------------------------------------------------------------
++
++# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
++# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
++# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
++# (currently listed in .gitignore).
++#
++# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
++# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
++# "False", "off", "no", and "something-NotFound" are all false).  Other values
++# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
++# OFF, or YES and NO for your booleans.
++
++##
++## Section 1: Installation paths
++##
++
++# ============================================================================
++# Basic setup begins here.  All settings are optional.  In most cases, setting
++# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
++# reasonable defaults enabled.  Note: If you need to specify directory names
++# with spaces (e.g., on Windows) then you must put them in quotes.
++# ============================================================================
++
++# Installation path (usually defaults to /usr/local) [auto]:
++set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
++
++# Set install name suffix used for directories and gmt executables
++# [undefined]:
++#set (GMT_INSTALL_NAME_SUFFIX "suffix")
++
++# Install into traditional directory structure. Disable to install a
++# distribution type directory structure (doc and share separated) [on]:
++#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
++
++# Install convenience links for GMT modules. Disable to install only the main
++# gmt program and access modules as "gmt modulename options" [TRUE]:
++#set (GMT_INSTALL_MODULE_LINKS FALSE)
++
++# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
++set (GMT_INSTALL_RELOCATABLE TRUE)
++
++# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
++#set (GMT_EXCLUDE_GDAL TRUE)
++#set (GMT_EXCLUDE_PCRE TRUE)
++#set (GMT_EXCLUDE_PCRE2 TRUE)
++#set (GMT_EXCLUDE_FFTW3 TRUE)
++#set (GMT_EXCLUDE_LAPACK TRUE)
++#set (GMT_EXCLUDE_BLAS TRUE)
++#set (GMT_EXCLUDE_ZLIB TRUE)
++
++# ============================================================================
++# Advanced configuration begins here.  Usually it is not necessary to edit any
++# settings below.  You should know what you are doing if you do though.  Note:
++# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
++# path is given.
++# ============================================================================
++
++# Set binary installation path [bin]:
++#set (GMT_BINDIR "bin")
++
++# Set library installation path [lib or lib64]:
++#set (GMT_LIBDIR "lib")
++
++# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_INCLUDEDIR "include/gmt")
++
++# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DATADIR "share/gmt")
++
++# Set doc installation path [share/doc or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DOCDIR "share/doc/gmt")
++
++# Set manpage installation path [share/man or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
++#set (GMT_MANDIR "share/doc/gmt/man")
++
++# Install documentation files from this external location instead of creating
++# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
++#set (GMT_INSTALL_EXTERNAL_DOC OFF)
++
++# Install manual pages from this external location instead of creating the
++# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
++#set (GMT_INSTALL_EXTERNAL_MAN OFF)
++
++##
++## Section 2: Build dependencies (should only be needed if CMake cannot
++## automatically detect the rights version or path.)
++##
++
++# Set URL to GMT Data server [auto]:
++#set (GMT_DATA_SERVER "data_server_url")
++
++# Set path to GSHHG Shoreline Database [auto]:
++set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
++
++# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
++#set (COPY_GSHHG TRUE)
++
++# Set path to DCW Digital Chart of the World for GMT [auto]:
++#set (DCW_ROOT "dcw-gmt_path")
++
++# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
++#set (COPY_DCW TRUE)
++
++# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
++
++# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
++
++# FOR WINDOWS ONLY
++# Set path to location of Ghostscript binaries (optional install)
++#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
++
++# FOR WINDOWS ONLY
++# Set path to location where the gmtmex is located.
++#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
++
++# Set location of NetCDF (can be root directory, path to header file or path
++# to nc-config) [auto]:
++set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
++
++# Set location of GDAL (can be root directory, path to header file or path to
++# gdal-config) [auto]:
++set (GDAL_ROOT "$ENV{GDAL_ROOT}")
++
++# Set location of PCRE (can be root directory, path to header file or path to
++# pcre-config) [auto]:
++#set (PCRE_ROOT "pcre_install_prefix")
++# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
++# pcre2-config) [auto]:
++#set (PCRE2_ROOT "pcre2_install_prefix")
++
++# Set location of single precision FFTW (can be root directory or path to
++# header file) [auto]:
++#set (FFTW3_ROOT "fftw_install_prefix")
++
++# Set location of ZLIB (can be root directory or path to header file) [auto]:
++set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
++
++# Set location of CURL (can be root directory or path to header file) [auto]:
++#set (CURL_ROOT "curl_install_prefix")
++
++# Set location of GLIB component gthread [auto].  This is an optional (and
++# experimental) option which you need to enable:
++#set (GMT_USE_THREADS TRUE)
++# If pkg-config is not installed (e.g. on Windows) you need to specify these:
++#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
++#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
++
++# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
++set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack -L/usr/lib/x86_64-linux-gnu -lgfortran")
++set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas -L/usr/lib/x86_64-linux-gnu -lgfortran")
++
++##
++## Section 3: GMT features
++##
++
++# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
++# redistributed under the terms of the GPL or LGPL such as Shewchuk's
++# triangulation (valid values are GPL, LGPL and off) [off]:
++#set (LICENSE_RESTRICTED GPL)
++
++# Allow building of OpenMP if compiler supports it
++# set (GMT_ENABLE_OPENMP TRUE)
++
++# Configure default units (possible values are SI and US) [SI]:
++#set (UNITS "US")
++
++# Enable building of shared libraries [TRUE] (disable to use static libraries;
++# not recommended; on non-x86 architectures uncomment the next option as well):
++set (BUILD_SHARED_LIBS FALSE)
++
++# Create position independent code on all targets [auto] (needed for static
++# build on non-x86):
++set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
++
++# Build GMT shared lib with supplemental modules [TRUE]:
++set (BUILD_SUPPLEMENTS FALSE)
++
++# Build/Install GMT Developer include files [TRUE]:
++# This installs the extra include files and configured files needed by 3rd-party
++# developers.  Until we build a separate gmt-devel we include them in the main
++# Distribution.
++#set (BUILD_DEVELOPER FALSE)
++
++##
++## Section 4: Advanced tweaking
++##
++
++#
++# Testing and development
++#
++
++# Enable running examples/tests with "ctest" or "make check" (out-of-source).
++# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
++# line.
++#enable_testing()
++#set (DO_EXAMPLES TRUE)
++#set (DO_TESTS TRUE)
++#set (DO_ANIMATIONS TRUE)
++# Number of parallel test jobs with "make check":
++#set (N_TEST_JOBS 4)
++
++# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
++# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
++# for testing [OFF]:
++#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
++
++# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
++# that link against the full gmt libs (not just the API; for building codes
++# that only need the GMT API, see the gmt-custom project).
++#set (EXTRA_BUILD_DIRS apidemo)
++# Uncomment the following line to enable running low-level C tests of the API
++#set (DO_API_TESTS ON)
++
++# Directory in which to install the release sources per default
++# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
++#set (GMT_RELEASE_PREFIX "release-src-prefix")
++
++# If set to false, image conversion from PS images to PNG and PDF does
++# not depend on the gmt binary target. Note: "make gmt" is then required
++# before docs_depends [TRUE].
++#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
++
++#
++# Debugging
++#
++
++# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
++# [Release]:
++#set (CMAKE_BUILD_TYPE Debug)
++
++# Extra debugging for developers:
++#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
++##	So Xcode can find the supplemental plug-ins during debug sessions
++#	add_definitions(-DXCODER)
++#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
++#	message("Add Xcode definition for GMT")
++#endif()
++#add_definitions(-DDEBUG)
++#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
++#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
++#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
++#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
++#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
++if (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
++else (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
++endif (HAVE_OPENMP)
++
++#
++# System specific tweaks
++#
++
++# This is for GCC on Solaris to avoid "relocations remain against allocatable
++# but non-writable sections" problems:
++#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
++
++# This may be needed to enable strdup and extended math functions with GCC and
++# Suncc on Solaris:
++#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
++
++# Do not warn when building with Windows SDK or Visual Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
++
++# Manually select runtime library when compiling with Windows SDK or Visual
++# Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
++
++# If your NetCDF library is static (not recommended, applies to Windows only)
++set (NETCDF_STATIC TRUE)
++
++# If want to rename the DLLs to something else than the default (e.g. to
++# append the bitness - Windows only)
++# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
++#if (WIN32)
++# set (BITAGE 32)
++# # Detect if we are building a 32 or 64 bits version
++# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
++#   set (BITAGE 64)
++# endif ()
++# set (GMT_DLL_RENAME gmt_w${BITAGE})
++# set (PSL_DLL_RENAME psl_w${BITAGE})
++#endif(WIN32)
++
++# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
++#if(MSVC11)
++#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
++#endif(MSVC11)
+Index: ../trunk-jpl/externalpackages/gmt/configs/6/static/mac/cmake/ConfigUser.static.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/configs/6/static/mac/cmake/ConfigUser.static.cmake	(nonexistent)
++++ ../trunk-jpl/externalpackages/gmt/configs/6/static/mac/cmake/ConfigUser.static.cmake	(revision 26246)
+@@ -0,0 +1,308 @@
++#
++#
++# Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
++# See LICENSE.TXT file for copying and redistribution conditions.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Lesser General Public License as published by the
++# Free Software Foundation; version 3 or any later version.
++#
++# This program is distributed in the hope that it will be useful, but WITHOUT
++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
++# for more details.
++#
++# Contact info: www.generic-mapping-tools.org
++# ----------------------------------------------------------------------------
++
++# Use this file to override variables in 'ConfigDefault.cmake' on a per-user
++# basis.  First copy 'ConfigUserTemplate.cmake' to 'ConfigUser.cmake', then
++# edit 'ConfigUser.cmake'.  'ConfigUser.cmake' is not version controlled
++# (currently listed in .gitignore).
++#
++# Note: CMake considers an empty string, "FALSE", "OFF", "NO", or any string
++# ending in "-NOTFOUND" to be false (this happens to be case-insensitive, so
++# "False", "off", "no", and "something-NotFound" are all false).  Other values
++# are true.  Thus it does not matter whether you use TRUE and FALSE, ON and
++# OFF, or YES and NO for your booleans.
++
++##
++## Section 1: Installation paths
++##
++
++# ============================================================================
++# Basic setup begins here.  All settings are optional.  In most cases, setting
++# CMAKE_INSTALL_PREFIX should be all you need to do in order to build GMT with
++# reasonable defaults enabled.  Note: If you need to specify directory names
++# with spaces (e.g., on Windows) then you must put them in quotes.
++# ============================================================================
++
++# Installation path (usually defaults to /usr/local) [auto]:
++set (CMAKE_INSTALL_PREFIX "$ENV{ISSM_DIR}/externalpackages/gmt/install")
++
++# Set install name suffix used for directories and gmt executables
++# [undefined]:
++#set (GMT_INSTALL_NAME_SUFFIX "suffix")
++
++# Install into traditional directory structure. Disable to install a
++# distribution type directory structure (doc and share separated) [on]:
++#set (GMT_INSTALL_TRADITIONAL_FOLDERNAMES OFF)
++
++# Install convenience links for GMT modules. Disable to install only the main
++# gmt program and access modules as "gmt modulename options" [TRUE]:
++#set (GMT_INSTALL_MODULE_LINKS FALSE)
++
++# Make executables relocatable on supported platforms (relative RPATH) [FALSE]:
++set (GMT_INSTALL_RELOCATABLE TRUE)
++
++# Exclude optional GDAL, PCRE, PCRE2, FFTW3, LAPACK, BLAS, ZLIB dependencies even if you have them installed [FALSE]
++#set (GMT_EXCLUDE_GDAL TRUE)
++#set (GMT_EXCLUDE_PCRE TRUE)
++#set (GMT_EXCLUDE_PCRE2 TRUE)
++#set (GMT_EXCLUDE_FFTW3 TRUE)
++#set (GMT_EXCLUDE_LAPACK TRUE)
++#set (GMT_EXCLUDE_BLAS TRUE)
++#set (GMT_EXCLUDE_ZLIB TRUE)
++
++# ============================================================================
++# Advanced configuration begins here.  Usually it is not necessary to edit any
++# settings below.  You should know what you are doing if you do though.  Note:
++# installation paths are relative to ${CMAKE_INSTALL_PREFIX} unless absolute
++# path is given.
++# ============================================================================
++
++# Set binary installation path [bin]:
++#set (GMT_BINDIR "bin")
++
++# Set library installation path [lib or lib64]:
++#set (GMT_LIBDIR "lib")
++
++# Set include installation path [include/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_INCLUDEDIR "include/gmt")
++
++# Set share installation path [share or share/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DATADIR "share/gmt")
++
++# Set doc installation path [share/doc or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}]:
++#set (GMT_DOCDIR "share/doc/gmt")
++
++# Set manpage installation path [share/man or
++# share/doc/gmt${GMT_INSTALL_NAME_SUFFIX}/man]:
++#set (GMT_MANDIR "share/doc/gmt/man")
++
++# Install documentation files from this external location instead of creating
++# new HTML documents from scratch [${GMT_SOURCE_DIR}/doc_release]:
++#set (GMT_INSTALL_EXTERNAL_DOC OFF)
++
++# Install manual pages from this external location instead of creating the
++# manpages from scratch [${GMT_SOURCE_DIR}/man_release]:
++#set (GMT_INSTALL_EXTERNAL_MAN OFF)
++
++##
++## Section 2: Build dependencies (should only be needed if CMake cannot
++## automatically detect the rights version or path.)
++##
++
++# Set URL to GMT Data server [auto]:
++#set (GMT_DATA_SERVER "data_server_url")
++
++# Set path to GSHHG Shoreline Database [auto]:
++set (GSHHG_ROOT "$ENV{GSHHG_ROOT}")
++
++# Copy GSHHG files to ${GMT_DATADIR}/coast [FALSE]:
++#set (COPY_GSHHG TRUE)
++
++# Set path to DCW Digital Chart of the World for GMT [auto]:
++#set (DCW_ROOT "dcw-gmt_path")
++
++# Copy DCW files to ${GMT_DATADIR}/dcw [FALSE]:
++#set (COPY_DCW TRUE)
++
++# Copy GDAL's 'data' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (GDAL_DATA_PATH C:/programs/compa_libs/gdal_GIT/compileds/VC14_64/data)
++
++# Copy PROJ4's 'share' directory to ${GMT_DATADIR}/GDAL_DATA [FALSE]:
++#set (PROJ_DATA_PATH C:/programs/compa_libs/proj5_GIT/compileds/VC14_64/share/proj)
++
++# FOR WINDOWS ONLY
++# Set path to location of Ghostscript binaries (optional install)
++#set (GHOST_DATA_PATH C:/programs/compa_libs/ghostscript/bin)
++
++# FOR WINDOWS ONLY
++# Set path to location where the gmtmex is located.
++#set (GMTMEX_PATH "C:/progs_cygw/GMTdev/gmtmex/${GMTver}")
++
++# Set location of NetCDF (can be root directory, path to header file or path
++# to nc-config) [auto]:
++set (NETCDF_ROOT "$ENV{NETCDF_ROOT}")
++
++# Set location of GDAL (can be root directory, path to header file or path to
++# gdal-config) [auto]:
++set (GDAL_ROOT "$ENV{GDAL_ROOT}")
++
++# Set location of PCRE (can be root directory, path to header file or path to
++# pcre-config) [auto]:
++#set (PCRE_ROOT "pcre_install_prefix")
++# Alternatively, set location of PCRE2 (can be root directory, path to header file or path to
++# pcre2-config) [auto]:
++#set (PCRE2_ROOT "pcre2_install_prefix")
++
++# Set location of single precision FFTW (can be root directory or path to
++# header file) [auto]:
++#set (FFTW3_ROOT "fftw_install_prefix")
++
++# Set location of ZLIB (can be root directory or path to header file) [auto]:
++set (ZLIB_ROOT "$ENV{ZLIB_ROOT}")
++
++# Set location of CURL (can be root directory or path to header file) [auto]:
++#set (CURL_ROOT "curl_install_prefix")
++
++# Set location of GLIB component gthread [auto].  This is an optional (and
++# experimental) option which you need to enable:
++#set (GMT_USE_THREADS TRUE)
++# If pkg-config is not installed (e.g. on Windows) you need to specify these:
++#set (GLIB_INCLUDE_DIR c:/path/to/glib-dev/include/glib-2.0)
++#set (GLIB_LIBRARIES c:/path/to/glib-dev/lib/glib-2.0.lib)
++
++# Set LAPACK location. Use this when want to link with LAPACK and it's not found automatically
++#set (LAPACK_LIBRARY "-L$ENV{LAPACK_ROOT} -lflapack")
++#set (BLAS_LIBRARY "-L$ENV{BLAS_ROOT} -lfblas")
++
++##
++## Section 3: GMT features
++##
++
++# Enforce GPL or LGPL conformity. Use this to disable routines that cannot be
++# redistributed under the terms of the GPL or LGPL such as Shewchuk's
++# triangulation (valid values are GPL, LGPL and off) [off]:
++#set (LICENSE_RESTRICTED GPL)
++
++# Allow building of OpenMP if compiler supports it
++# set (GMT_ENABLE_OPENMP TRUE)
++
++# Configure default units (possible values are SI and US) [SI]:
++#set (UNITS "US")
++
++# Enable building of shared libraries [TRUE] (disable to use static libraries;
++# not recommended; on non-x86 architectures uncomment the next option as well):
++set (BUILD_SHARED_LIBS FALSE)
++
++# Create position independent code on all targets [auto] (needed for static
++# build on non-x86):
++set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
++
++# Build GMT shared lib with supplemental modules [TRUE]:
++set (BUILD_SUPPLEMENTS FALSE)
++
++# Build/Install GMT Developer include files [TRUE]:
++# This installs the extra include files and configured files needed by 3rd-party
++# developers.  Until we build a separate gmt-devel we include them in the main
++# Distribution.
++#set (BUILD_DEVELOPER FALSE)
++
++##
++## Section 4: Advanced tweaking
++##
++
++#
++# Testing and development
++#
++
++# Enable running examples/tests with "ctest" or "make check" (out-of-source).
++# Need to set either DO_EXAMPLES, DO_TESTS or both and uncomment the following
++# line.
++#enable_testing()
++#set (DO_EXAMPLES TRUE)
++#set (DO_TESTS TRUE)
++#set (DO_ANIMATIONS TRUE)
++# Number of parallel test jobs with "make check":
++#set (N_TEST_JOBS 4)
++
++# Enable this option to run GMT programs from within ${GMT_BINARY_DIR} without
++# installing or setting GMT_SHAREDIR and GMT_USERDIR first. This is required
++# for testing [OFF]:
++#set (SUPPORT_EXEC_IN_BINARY_DIR ON)
++
++# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
++# that link against the full gmt libs (not just the API; for building codes
++# that only need the GMT API, see the gmt-custom project).
++#set (EXTRA_BUILD_DIRS apidemo)
++# Uncomment the following line to enable running low-level C tests of the API
++#set (DO_API_TESTS ON)
++
++# Directory in which to install the release sources per default
++# [${GMT_BINARY_DIR}/gmt-${GMT_PACKAGE_VERSION}]:
++#set (GMT_RELEASE_PREFIX "release-src-prefix")
++
++# If set to false, image conversion from PS images to PNG and PDF does
++# not depend on the gmt binary target. Note: "make gmt" is then required
++# before docs_depends [TRUE].
++#set (GMT_DOCS_DEPEND_ON_GMT FALSE)
++
++#
++# Debugging
++#
++
++# Set build type can be: empty, Debug, Release, RelWithDebInfo or MinSizeRel
++# [Release]:
++#set (CMAKE_BUILD_TYPE Debug)
++
++# Extra debugging for developers:
++#if ( CMAKE_GENERATOR STREQUAL "Xcode" )
++##	So Xcode can find the supplemental plug-ins during debug sessions
++#	add_definitions(-DXCODER)
++#   add_definitions(-DDEBUG_MODERN)			# To set PPID == 0 during Xcode test
++#	message("Add Xcode definition for GMT")
++#endif()
++#add_definitions(-DDEBUG)
++#add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info
++#set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build
++#set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")            # extra warnings
++#set (CMAKE_C_FLAGS_DEBUG -ggdb3)                          # gdb debugging symbols
++#set (CMAKE_LINK_DEPENDS_DEBUG_MODE TRUE)                  # debug link dependencies
++if (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized -flax-vector-conversions")  # check uninitialized variables
++else (HAVE_OPENMP)
++	set (CMAKE_C_FLAGS_RELEASE "-ggdb3 -O2 -Wuninitialized")  # check uninitialized variables
++endif (HAVE_OPENMP)
++
++#
++# System specific tweaks
++#
++
++# This is for GCC on Solaris to avoid "relocations remain against allocatable
++# but non-writable sections" problems:
++#set (USER_GMTLIB_LINK_FLAGS -mimpure-text)
++
++# This may be needed to enable strdup and extended math functions with GCC and
++# Suncc on Solaris:
++#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
++
++# Do not warn when building with Windows SDK or Visual Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
++
++# Manually select runtime library when compiling with Windows SDK or Visual
++# Studio Express:
++#set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS c:/Windows/System32/msvcr100.dll)
++
++# If your NetCDF library is static (not recommended, applies to Windows only)
++set (NETCDF_STATIC TRUE)
++
++# If want to rename the DLLs to something else than the default (e.g. to
++# append the bitness - Windows only)
++# WARNING: if using this option it is mandatory that the suffix starts with an underscore.
++#if (WIN32)
++# set (BITAGE 32)
++# # Detect if we are building a 32 or 64 bits version
++# if (CMAKE_SIZEOF_VOID_P EQUAL 8)
++#   set (BITAGE 64)
++# endif ()
++# set (GMT_DLL_RENAME gmt_w${BITAGE})
++# set (PSL_DLL_RENAME psl_w${BITAGE})
++#endif(WIN32)
++
++# On Windows Visual C 2012 needs _ALLOW_KEYWORD_MACROS to build
++#if(MSVC11)
++#  add_definitions(/D_ALLOW_KEYWORD_MACROS)
++#endif(MSVC11)
+Index: ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/gmt/install-6-linux-static.sh	(revision 26246)
+@@ -44,7 +44,7 @@
+ rm -rf gmt-${VER}
+ 
+ # Copy custom configuration files
+-cp ./configs/6/static/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
++cp ./configs/6/static/linux/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
+ cp ./configs/6/static/cmake/modules/FindGDAL.cmake ./src/cmake/modules
+ cp ./configs/6/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules
+ cp ./configs/6/static/cmake/modules/FindNETCDF.cmake ./src/cmake/modules
+Index: ../trunk-jpl/externalpackages/gmt/install-6-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-linux.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/gmt/install-6-linux.sh	(revision 26246)
+@@ -26,7 +26,7 @@
+ rm -rf gmt-${VER}
+ 
+ # Copy custom configuration files
+-cp ./configs/6/cmake/ConfigUser.cmake ./src/cmake
++cp ./configs/6/linux/cmake/ConfigUser.cmake ./src/cmake
+ 
+ # Configure
+ cd src
+Index: ../trunk-jpl/externalpackages/gmt/install-6-mac-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-mac-static.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/gmt/install-6-mac-static.sh	(revision 26246)
+@@ -45,7 +45,7 @@
+ rm -rf gmt-${VER}
+ 
+ # Copy custom configuration files
+-cp ./configs/6/static/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
++cp ./configs/6/static/mac/cmake/ConfigUser.static.cmake ./src/cmake/ConfigUser.cmake
+ cp ./configs/6/static/cmake/modules/FindGDAL.cmake ./src/cmake/modules
+ cp ./configs/6/static/cmake/modules/FindGSHHG.cmake ./src/cmake/modules
+ cp ./configs/6/static/cmake/modules/FindNETCDF.cmake ./src/cmake/modules
+Index: ../trunk-jpl/externalpackages/gmt/install-6-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/gmt/install-6-mac.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/gmt/install-6-mac.sh	(revision 26246)
+@@ -26,7 +26,7 @@
+ rm -rf gmt-${VER}
+ 
+ # Copy custom configuration files
+-cp ./configs/6/cmake/ConfigUser.cmake ./src/cmake
++cp ./configs/6/mac/cmake/ConfigUser.cmake ./src/cmake
+ 
+ # Configure
+ cd src
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26246)
+@@ -33,6 +33,7 @@
+ 
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
++cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+ cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+@@ -49,11 +50,11 @@
+ 	-DBUILD_SHARED_LIBS=OFF \
+ 	-DBUILD_STATIC_LIBS=ON \
+ 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
++	-DCMAKE_C_FLAGS="-fPIC -Wno-error=implicit-function-declaration" \
+ 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
++	-DCMAKE_CXX_FLAGS="-fPIC" \
+ 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
+-	-DCMAKE_C_FLAGS="-fPIC" \
+-	-DCMAKE_CXX_FLAGS="-fPIC" \
+-	-DCMAKE_Fortran_FLAGS="-fPIC" \
++	-DCMAKE_Fortran_FLAGS="-fPIC -fallow-argument-mismatch" \
+ 	-DBoost_NO_BOOST_CMAKE=TRUE \
+ 	-DHAVE_ACRO=OFF \
+ 	-DHAVE_JEGA=OFF \
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 26245)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 26246)
+@@ -34,6 +34,7 @@
+ 
+ # Copy customized source and configuration files to 'src' directory
+ cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
++cp configs/${VER}/packages/queso/src/misc/src/1DQuadrature.C ${DAK_SRC}/packages/queso/src/misc/src
+ cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
+ cp configs/${VER}/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
+ cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
+@@ -50,8 +51,10 @@
+ 	-DBUILD_SHARED_LIBS=ON \
+ 	-DBUILD_STATIC_LIBS=OFF \
+ 	-DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
++	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
+ 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
+ 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
++	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch" \
+ 	-DBoost_NO_BOOST_CMAKE=TRUE \
+ 	-DHAVE_ACRO=OFF \
+ 	-DHAVE_JEGA=OFF \
Index: /issm/oecreview/Archive/25834-26739/ISSM-26246-26247.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26246-26247.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26246-26247.diff	(revision 26740)
@@ -0,0 +1,66 @@
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26246)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26247)
+@@ -110,29 +110,49 @@
+ } /*}}}*/
+ int SealevelGeometry::GEnum(int l){ /*{{{*/
+ 	
+-	if(l==SLGEOM_OCEAN) return SealevelchangeGsubelOceanEnum; 
+-	if(l==SLGEOM_ICE) return SealevelchangeGsubelIceEnum; 
+-	if(l==SLGEOM_WATER) return SealevelchangeGsubelHydroEnum; 
++	int output = -1;
++	switch(l){
++		case SLGEOM_OCEAN: output=SealevelchangeGsubelOceanEnum; break;
++		case SLGEOM_ICE:   output=SealevelchangeGsubelIceEnum;   break;
++		case SLGEOM_WATER: output=SealevelchangeGsubelHydroEnum; break;
++		default: _error_("not supported");
++	}
++	return output;
+ 
+ } /*}}}*/
+ int SealevelGeometry::GUEnum(int l){ /*{{{*/
+ 	
+-	if(l==SLGEOM_OCEAN) return SealevelchangeGUsubelOceanEnum; 
+-	if(l==SLGEOM_ICE) return SealevelchangeGUsubelIceEnum; 
+-	if(l==SLGEOM_WATER) return SealevelchangeGUsubelHydroEnum; 
++	int output = -1;
++	switch(l){
++		case SLGEOM_OCEAN: output=SealevelchangeGUsubelOceanEnum; break;
++		case SLGEOM_ICE:   output=SealevelchangeGUsubelIceEnum;   break;
++		case SLGEOM_WATER: output=SealevelchangeGUsubelHydroEnum; break;
++		default: _error_("not supported");
++	}
++	return output;
+ 
+ } /*}}}*/
+ int SealevelGeometry::GNEnum(int l){ /*{{{*/
+ 	
+-	if(l==SLGEOM_OCEAN) return SealevelchangeGNsubelOceanEnum; 
+-	if(l==SLGEOM_ICE) return SealevelchangeGNsubelIceEnum; 
+-	if(l==SLGEOM_WATER) return SealevelchangeGNsubelHydroEnum; 
++	int output = -1;
++	switch(l){
++		case SLGEOM_OCEAN: output=SealevelchangeGNsubelOceanEnum; break;
++		case SLGEOM_ICE:   output=SealevelchangeGNsubelIceEnum;   break;
++		case SLGEOM_WATER: output=SealevelchangeGNsubelHydroEnum; break;
++		default: _error_("not supported");
++	}
+ 
++	return output;
+ } /*}}}*/
+ int SealevelGeometry::GEEnum(int l){ /*{{{*/
+ 	
+-	if(l==SLGEOM_OCEAN) return SealevelchangeGEsubelOceanEnum; 
+-	if(l==SLGEOM_ICE) return SealevelchangeGEsubelIceEnum; 
+-	if(l==SLGEOM_WATER) return SealevelchangeGEsubelHydroEnum; 
++	int output = -1;
++	switch(l){
++		case SLGEOM_OCEAN: output=SealevelchangeGEsubelOceanEnum; break;
++		case SLGEOM_ICE:   output=SealevelchangeGEsubelIceEnum;   break;
++		case SLGEOM_WATER: output=SealevelchangeGEsubelHydroEnum; break;
++		default: _error_("not supported");
++	}
++	return output;
+ 
+ } /*}}}*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26247-26248.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26247-26248.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26247-26248.diff	(revision 26740)
@@ -0,0 +1,303 @@
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26247)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26248)
+@@ -5,18 +5,13 @@
+ md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500.); %700 km resolution mesh
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+-md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+ md.geometry.base=md.geometry.bed;
+-md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+-
+-%parameterize solidearth solution:
+ %solidearth loading:  {{{
+ md.masstransport.spcthickness=[md.geometry.thickness;0];
+-md.dsl.global_average_thermosteric_sea_level=[0;0];
+-md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ %antarctica
+ xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+@@ -35,7 +30,7 @@
+ posgre=pos;
+ 
+ %elastic loading from love numbers:
+-md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
++md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+ 
+ %}}}
+ %mask:  {{{
+@@ -56,13 +51,12 @@
+ md.timestepping.time_step=1;
+ md.timestepping.final_time=1;
+ 
++%masstransport:
+ md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+ md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+ md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+-md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
+-md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
+ md.initialization.str=0;
+ 
+ %Materials: 
+@@ -86,9 +80,8 @@
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
+ md.transient.isslc=1;
+-md.solidearth.requested_outputs={'Sealevel'};
++md.solidearth.requested_outputs={'Sealevel','Bed'};
+ 
+-
+ % max number of iteration reverted back to 10 (i.e., the original default value)
+ md.solidearth.settings.maxiter=10;
+ 
+@@ -99,6 +92,7 @@
+ 
+ md=solve(md,'Transient');
+ Seustatic=md.results.TransientSolution.Sealevel;
++Beustatic=md.results.TransientSolution.Bed;
+ 
+ %eustatic + rigid run:
+ md.solidearth.settings.rigid=1;
+@@ -106,14 +100,15 @@
+ md.solidearth.settings.rotation=0;
+ md=solve(md,'tr');
+ Srigid=md.results.TransientSolution.Sealevel;
++Brigid=md.results.TransientSolution.Bed;
+ 
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+-md.solidearth.requested_outputs={'Sealevel'};
+ md=solve(md,'tr');
+ Selastic=md.results.TransientSolution.Sealevel;
++Belastic=md.results.TransientSolution.Bed;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+@@ -121,8 +116,9 @@
+ md.solidearth.settings.rotation=1;
+ md=solve(md,'tr');
+ Srotation=md.results.TransientSolution.Sealevel;
++Brotation=md.results.TransientSolution.Bed;
+ 
+ %Fields and tolerances to track changes
+-field_names={'Eustatic','Rigid','Elastic','Rotation'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
+-field_values={Seustatic,Srigid,Selastic,Srotation};
++field_names={'Seustatic','Srigid','Selastic','Srotation','Beustatic','Brigid','Belastic','Brotation'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={Seustatic,Srigid,Selastic,Srotation,Beustatic,Brigid,Belastic,Brotation};
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26247)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26248)
+@@ -14,41 +14,34 @@
+ %parameterize slc solution:
+ %solidearth loading:  {{{
+ md.masstransport.spcthickness=[md.geometry.thickness;0];
+-md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+-md.dsl.global_average_thermosteric_sea_level=[0;0];
+-md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+ md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 
+-%antarctica
+-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
+-pos=find(late <-75 & longe <0);
+-md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-1;
+ 
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
++
++late=asind(ze./re);
++longe=atan2d(ye,xe);
++%greenland
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-1000;
++posice=pos;
++
+ %elastic loading from love numbers:
+-md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
++md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+ 
+ %}}}
+ %mask:  {{{
+ mask=gmtmask(md.mesh.lat,md.mesh.long);
+ icemask=ones(md.mesh.numberofvertices,1);
+-pos=find(mask==0);
+-icemask(pos)=-1;
+-pos=find(sum(mask(md.mesh.elements),2)<3);
+-icemask(md.mesh.elements(pos,:))=-1;
++icemask(md.mesh.elements(posice,:))=-1;
+ md.mask.ice_levelset=icemask;
+-md.mask.ocean_levelset=-icemask;
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1;
++md.mask.ocean_levelset=oceanmask;
+ 
+-%make sure that the elements that have loads are fully grounded:
+-pos=find(md.masstransport.spcthickness);
+-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+-
+-%make sure wherever there is an ice load, that the mask is set to ice:
+-pos=find(md.masstransport.spcthickness);
+-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+-% }}}
+-
+ % use model representation of ocen area (not the true area)
+ md.solidearth.settings.ocean_area_scaling = 0;
+ 
+@@ -55,8 +48,6 @@
+ %materials
+ md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+-md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
+-md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
+ md.initialization.str=0;
+ 
+ md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+@@ -70,25 +61,25 @@
+ %Solution parameters
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.computesealevelchange=0;
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
++md.solidearth.settings.horiz=1;
++md.solidearth.requested_outputs={'Sealevel','Bed', 'BedEast', 'BedNorth'};
+ 
++
+ %Physics: 
+ md.transient.issmb=0; 
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
+-md.transient.isoceantransport=1;
+ md.transient.isslc=1;
+-
+  
+ md.timestepping.start_time=0;
+ md.timestepping.time_step=1;
+ md.timestepping.final_time=1;
+ 
+-
+ %eustatic + rigid + elastic run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+@@ -97,6 +88,9 @@
+ %md.verbose=verbose('111111111');
+ md=solve(md,'Transient');
+ SnoRotation=md.results.TransientSolution.Sealevel;
++BUnoRotation=md.results.TransientSolution.Bed;
++BEnoRotation=md.results.TransientSolution.BedEast;
++BNnoRotation=md.results.TransientSolution.BedNorth;
+ 
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+@@ -106,8 +100,12 @@
+ %md.verbose=verbose('111111111');
+ md=solve(md,'Transient');
+ SRotation=md.results.TransientSolution.Sealevel;
++BURotation=md.results.TransientSolution.Bed;
++BERotation=md.results.TransientSolution.BedEast;
++BNRotation=md.results.TransientSolution.BedNorth;
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'noRotation','Rotation'};
+-field_tolerances={1e-13,1e-13};
+-field_values={SnoRotation,SRotation};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={SRotation-SnoRotation,BURotation-BUnoRotation,BNRotation-BNnoRotation,BERotation-BEnoRotation};
++
+Index: ../trunk-jpl/test/NightlyRun/test2007.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2007.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test2007.m	(revision 26248)
+@@ -0,0 +1,73 @@
++%Test Name: offline solid earth solution
++
++%mesh earth:
++md=model;
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++
++%Geometry for the bed, arbitrary thickness of 1000: 
++md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=zeros(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++%parameterize solidearth solution:
++late=md.mesh.lat;
++longe=md.mesh.long;
++time=0:0.5:5;
++md.solidearth.external=offlinesolidearthsolution;
++md.solidearth.external.displacementup=.5*sind(late).*cosd(late).*cosd(longe) .*time;
++md.solidearth.external.displacementup(end+1,:)=time;
++md.solidearth.external.geoid=-.1*sind(late).*cosd(late).*sind(longe) .*time;
++md.solidearth.external.geoid(end+1,:)=time;
++md.solidearth.external.displacementeast=late .*time;
++md.solidearth.external.displacementeast(end+1,:)=time;
++md.solidearth.external.displacementnorth=longe .*time;
++md.solidearth.external.displacementnorth(end+1,:)=time;
++md.solidearth.external.barystaticsealevel=0*late .*time;
++md.solidearth.external.barystaticsealevel(end+1,:)=time;
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++
++
++%mask:  {{{
++mask=gmtmask(md.mesh.lat,md.mesh.long);
++md.mask.ice_levelset=ones(md.mesh.numberofvertices,1);
++md.mask.ocean_levelset=ones(md.mesh.numberofvertices,1);
++% }}}
++
++%time stepping: 
++md.timestepping.start_time=time(1);
++md.timestepping.time_step=time(2)-time(1);
++md.timestepping.final_time=time(end);
++
++%Materials: 
++md.materials=materials('hydro');
++
++%Miscellaneous
++md.miscellaneous.name='test2007';
++
++%Solution parameters
++md.cluster.np=3;
++md.solidearth.settings.horiz=1;
++
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=0;
++md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel', 'Bed', 'BedEast', 'BedNorth'};
++
++%eustatic run:
++md=solve(md,'Transient');
++
++for i=length(time)-1;
++Geoid=md.results.TransientSolution(i).Sealevel;
++BedUp=md.results.TransientSolution(i).Bed;
++BedEast=md.results.TransientSolution(i).BedEast;
++BedNorth=md.results.TransientSolution(i).BedNorth;
++end
++
++%Fields and tolerances to track changes
++field_names={'Geoid','BedUp','BedEast','BedNorth'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={Geoid,BedUp,BedEast,BedNorth};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26248-26249.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26248-26249.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26248-26249.diff	(revision 26740)
@@ -0,0 +1,206 @@
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26248)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26249)
+@@ -163,7 +163,6 @@
+ 	int rheo=matlitho->rheologymodel[layer_index];
+ 
+ 	if (vi!=0 && omega!=0.0){ //take into account viscosity in the rigidity if the material isn't a perfect fluid
+-		//Otherwise return the elastic value
+ 		IssmDouble ka=la0 + 2.0/3.0*mu0; //Bulk modulus
+ 		if (rheo==2){//EBM
+ 			IssmDouble alpha=matlitho->ebm_alpha[layer_index];
+@@ -202,7 +201,7 @@
+ 			IssmDouble mu2=matlitho->burgers_mu[layer_index];
+ 
+ 			mu=mu0*omega*(omega+mu2/vi2)/((omega+mu2/vi2)*(omega+mu0/vi)+mu0/vi2*omega);
+-			la=ka-2.0/3.0*mu0;
++			la=ka-2.0/3.0*mu;
+ 		}
+ 		else{//Maxwell
+ 			la = (la0 + mu0*ka/vi/omega)/(1.0 + mu0/vi/omega);
+@@ -209,7 +208,10 @@
+ 			mu = mu0/(1.0+mu0/vi/omega);
+ 		}
+ 	}
+-
++	else{//Otherwise return the elastic value
++	la=la0;
++	mu=mu0;
++	}
+ 	*pla=la;
+ 	*pmu=mu;
+ 
+@@ -443,7 +445,7 @@
+ 			   dy[1*6+0]= (-4.0*(fgr/rg0)+fn/x)/x;
+ 			   dy[1*6+1]= -2.0/x-fgr/rg0;
+ 			   }
+-			   */ /*}}}*/
++	*/ /*}}}*/
+ 
+ 	if(issolid==1){
+ 		ny = 6;
+@@ -452,20 +454,21 @@
+ 	}
+ 
+ 	for (id=0;id<ny;id++){
++		dydx[id]=0.0;
+ 		for (iy=0;iy<ny;iy++){
+ 			nindex=layer_index*nstep*36+n*36;
+-			dydx[id]=dydx[id]+yi_prefactor[nindex+id*6+iy]*y[iy];
++			dydx[id]+=yi_prefactor[nindex+id*6+iy]*y[iy];
+ 		}
+ 	}
+ 	return;
+ }/*}}}*/
+-template <typename doubletype> void        propagate_yi_euler(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
++template <typename doubletype> void        propagate_yi_euler(doubletype* y, IssmDouble xmin, IssmDouble xmax, int layer_index, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+ 	//euler method
+ 	int nstep;
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 
+ 
+-	IssmDouble* dydx=xNewZeroInit<IssmDouble>(6);
++	doubletype* dydx=xNewZeroInit<doubletype>(6);
+ 	IssmDouble dr = (xmax -xmin)/nstep;
+ 	IssmDouble x=xmin;
+ 	for(int i = 0;i<nstep;i++){
+@@ -475,7 +478,7 @@
+ 		}
+ 		x = x + dr;
+ 	}
+-	xDelete<IssmDouble>(dydx);
++	xDelete<doubletype>(dydx);
+ }/*}}}*/
+ template <typename doubletype> void        propagate_yi_RK2(doubletype* y, IssmDouble xmin, IssmDouble xmax, int layer_index, doubletype* yi_prefactor, FemModel* femmodel, Matlitho* matlitho){ /*{{{*/
+ 	//yields this: if we have y[j]=1.0 and y[!j]=0.0 at the bottom of the layer, what is y at the top of the layer?
+@@ -680,7 +683,7 @@
+ 		// Boundary Condition matrix - solid regions
+ 		if (matlitho->issolid[i]){
+ 			one = -1.0;
+-			if (i>0 && !matlitho->issolid[i-1]) one = 1.0;
++			if (i>0) if (!matlitho->issolid[i-1]) one = 1.0;
+ 			for (int j=0;j<6;j++){
+ 				yi[(j+6*ici)+ nyi*(j+6*ici+3)] = one;
+ 			}
+@@ -890,9 +893,9 @@
+ 
+ 		if (loveratio<=underflow_tol || xIsNan(loveratio) || xIsInf(loveratio)){//We need to delete a layer and try again if the ratio between deepest love number to surface love number is too low (risk of underflow) or garbage
+ 			if(VerboseSolution()){
+-				printf("\n   Degree: %i, surface/Depth Love number ratio small: %e\n",deg, loveratio);
+-				printf("    Changing the interface where the integration starts\n");
+-				printf("    New start interface: r=%gm\n\n", matlitho->radius[starting_layer+1]);
++				_printf_("\n   Degree: " << deg <<", surface/Depth Love number ratio small: "<<loveratio<<"\n");
++				_printf_("    Changing the interface where the integration starts\n");
++				_printf_("    New start interface: r="<< matlitho->radius[starting_layer+1] <<"m\n\n");
+ 			}
+ 			nyi-=6;
+ 			starting_layer+=1;
+@@ -1004,7 +1007,7 @@
+ 	int         sh_nmin,sh_nmax,kernel_index,deleted_layer_offset;
+ 	bool        allow_layer_deletion,love_kernels, istemporal;
+ 	bool        verbosemod = (int)VerboseModule();
+-	IssmDouble  g0,r0,mu0, underflow_tol;
++	IssmDouble  mu0, underflow_tol;
+ 	IssmDouble *frequencies = NULL;
+ 	bool        save_results;
+ 	bool        complex_computation;
+@@ -1039,8 +1042,6 @@
+ 	femmodel->parameters->FindParam(&frequencies,&dummy,LoveFrequenciesEnum); _assert_(nfreq==dummy);
+ 	femmodel->parameters->FindParam(&sh_nmax,LoveShNmaxEnum);
+ 	femmodel->parameters->FindParam(&sh_nmin,LoveShNminEnum);
+-	femmodel->parameters->FindParam(&g0,LoveG0Enum);
+-	femmodel->parameters->FindParam(&r0,LoveR0Enum);
+ 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+ 	femmodel->parameters->FindParam(&allow_layer_deletion,LoveAllowLayerDeletionEnum);
+ 	femmodel->parameters->FindParam(&love_kernels,LoveKernelsEnum);
+@@ -1125,16 +1126,50 @@
+ 	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHiEnum,LoveHf,sh_nmax+1,nfreq,0,0));
+ 	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveLiEnum,LoveLf,sh_nmax+1,nfreq,0,0));
+ 
++	/*Only when love_kernels is on*/
++	if (love_kernels==1) {
++		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKernelsEnum,LoveKernels,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
++	}
+ 
++	/*Free resources:*/
++	xDelete<IssmDouble>(frequencies);
++	xDelete<doubletype>(LoveKf);
++	xDelete<doubletype>(LoveHf);
++	xDelete<doubletype>(LoveLf);
++	xDelete<doubletype>(LoveKernels);
++
++	/* Legacy for fortran core, to be removed after complete validation */
++
++	//IssmDouble g0,r0;
++	//femmodel->parameters->FindParam(&g0,LoveG0Enum);
++	//femmodel->parameters->FindParam(&r0,LoveR0Enum);
++	//IssmDouble* LoveKr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	//IssmDouble* LoveHr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	//IssmDouble* LoveLr = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	//IssmDouble* LoveKi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	//IssmDouble* LoveHi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++	//IssmDouble* LoveLi = xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1));
++
++	/*Initialize love kernels (real and imaginary parts): */
++	//IssmDouble* LoveKernelsr= xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
++	//IssmDouble* LoveKernelsi= xNewZeroInit<IssmDouble>(nfreq*(sh_nmax+1)*(matlitho->numlayers+1)*6);
++
+ 	/*call the main module: */
+ 	//if (false){
+-	//FourierLoveCorex(LoveKr,LoveKi,LoveHr,LoveHi,LoveLr,LoveLi,LoveKernelsReal,LoveKernelsImag,  //output
++	//FourierLoveCorex(LoveKr,LoveKi,LoveHr,LoveHr,LoveLr,LoveLi,LoveKernelsr,LoveKernelsi,  //output
+ 	//		nfreq,frequencies,sh_nmax,sh_nmin,g0,r0,mu0,allow_layer_deletion,forcing_type,verbosemod, //parameter inputs
+ 	//		matlitho->numlayers, matlitho->radius, matlitho->viscosity, matlitho->lame_lambda, matlitho->lame_mu,
+ 	//		matlitho->burgers_viscosity, matlitho->burgers_mu, matlitho->density, matlitho->rheologymodel, matlitho->issolid //matlitho inputs
+ 	//		);
++
++
++	/*Only when love_kernels is on*/
++	//if (love_kernels==1) {
++		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsEnum,LoveKernelsr,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
++		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+ 	//}
+ 
++
+ 	/*Add love matrices to results:*/
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKr,sh_nmax+1,nfreq,0,0));
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHr,sh_nmax+1,nfreq,0,0));
+@@ -1143,19 +1178,17 @@
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHi,sh_nmax+1,nfreq,0,0));
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLi,sh_nmax+1,nfreq,0,0));
+ 
+-	/*Only when love_kernels is on*/
+-	if (love_kernels==1) {
+-		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKernelsEnum,LoveKernels,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+-		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+-	}
+ 
+-	/*Free resources:*/
+-	xDelete<IssmDouble>(frequencies);
+-	xDelete<doubletype>(LoveKf);
+-	xDelete<doubletype>(LoveHf);
+-	xDelete<doubletype>(LoveLf);
++
++	//xDelete<IssmDouble>(LoveKr);
++	//xDelete<IssmDouble>(LoveHr);
++	//xDelete<IssmDouble>(LoveLr);
++	//xDelete<IssmDouble>(LoveKernelsr);
++	//xDelete<IssmDouble>(LoveKi);
++	//xDelete<IssmDouble>(LoveHi);
+ 	//xDelete<IssmDouble>(LoveLi);
+-	xDelete<doubletype>(LoveKernels);
++	//xDelete<IssmDouble>(LoveKernelsi);
++
+ } /*}}}*/
+ 
+ /*cores and template instantiations:*/
+@@ -1172,6 +1205,8 @@
+ template void        yi_derivatives<IssmComplex>(IssmComplex* dydx, IssmComplex* y, int layer_index, int n, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+ template void        propagate_yi_RK2<IssmDouble>(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+ template void        propagate_yi_RK2<IssmComplex>(IssmComplex* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
++template void        propagate_yi_euler<IssmDouble>(IssmDouble* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
++template void        propagate_yi_euler<IssmComplex>(IssmComplex* y, IssmDouble xmin, IssmDouble xmax, int layer_index, IssmComplex* yi_prefactor, FemModel* femmodel, Matlitho* matlitho);
+ template void        Innersphere_boundaryconditions<IssmDouble>(IssmDouble* yi, int layer_index, int deg, IssmDouble omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+ template void        Innersphere_boundaryconditions<IssmComplex>(IssmComplex* yi, int layer_index, int deg, IssmComplex omega, FemModel* femmodel, Matlitho* matlitho, LoveVariables* vars);
+ template void        build_yi_system<IssmDouble>(IssmDouble* yi, int deg, IssmDouble omega, IssmDouble* yi_prefactor, FemModel* femmodel, Matlitho* matlitho,LoveVariables* vars);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26249-26250.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26249-26250.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26249-26250.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26249)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh	(revision 26250)
+@@ -54,7 +54,6 @@
+ 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
+ 	-DCMAKE_CXX_FLAGS="-fPIC" \
+ 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
+-	-DCMAKE_Fortran_FLAGS="-fPIC -fallow-argument-mismatch" \
+ 	-DBoost_NO_BOOST_CMAKE=TRUE \
+ 	-DHAVE_ACRO=OFF \
+ 	-DHAVE_JEGA=OFF \
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 26249)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-linux.sh	(revision 26250)
+@@ -54,7 +54,6 @@
+ 	-DCMAKE_C_FLAGS="-Wno-error=implicit-function-declaration" \
+ 	-DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
+ 	-DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
+-	-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch" \
+ 	-DBoost_NO_BOOST_CMAKE=TRUE \
+ 	-DHAVE_ACRO=OFF \
+ 	-DHAVE_JEGA=OFF \
Index: /issm/oecreview/Archive/25834-26739/ISSM-26250-26251.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26250-26251.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26250-26251.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/types.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26250)
++++ ../trunk-jpl/src/c/shared/Numerics/types.h	(revision 26251)
+@@ -25,7 +25,8 @@
+ /*ADOLC typedefs*/
+ #include "adolc/adolc.h"
+ typedef adouble              IssmDouble;  /*for active variables*/
+-typedef acomplex             IssmComplex; /*for active variables*/
++//typedef acomplex             IssmComplex; /*for active variables*/ /*FIXME!*/
++typedef std::complex<double> IssmComplex; /*for active variables*/ /*FIXME!*/
+ typedef double               IssmPDouble; /*for passive variables*/
+ typedef std::complex<double> IssmPComplex;/*for passive variables*/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26251-26252.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26251-26252.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26251-26252.diff	(revision 26740)
@@ -0,0 +1,585 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26251)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26252)
+@@ -90,6 +90,7 @@
+ 	./classes/Cfsurfacesquare.cpp \
+ 	./classes/Cfdragcoeffabsgrad.cpp \
+ 	./classes/Cfsurfacelogvel.cpp \
++	./classes/Cflevelsetmisfit.cpp \
+ 	./classes/Regionaloutput.cpp \
+ 	./classes/Nodalvalue.cpp \
+ 	./classes/Node.cpp \
+Index: ../trunk-jpl/src/c/classes/classes.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/classes.h	(revision 26251)
++++ ../trunk-jpl/src/c/classes/classes.h	(revision 26252)
+@@ -25,6 +25,7 @@
+ #include "./Cfsurfacesquare.h"
+ #include "./Cfdragcoeffabsgrad.h"
+ #include "./Cfsurfacelogvel.h"
++#include "./Cflevelsetmisfit.h"
+ #include "./Masscon.h"
+ #include "./Massconaxpby.h"
+ #include "./Regionaloutput.h"
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 26251)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 26252)
+@@ -169,7 +169,7 @@
+ 				int*         cfsurfacesquare_weights_M_s				= NULL;
+ 				int*         cfsurfacesquare_weights_N_s				= NULL;
+ 				char**       cfsurfacesquare_weights_string_s		= NULL;
+-				int*	 cfsurfacesquare_datatime_s				= NULL;
++				IssmDouble*	 cfsurfacesquare_datatime_s				= NULL;
+ 
+ 				/*Fetch name, model_string, observation, observation_string, etc ... (see src/m/classes/cfsurfacesquare.m): */
+ 				iomodel->FetchMultipleData(&cfsurfacesquare_name_s,&num_cfsurfacesquares,                                                        "md.cfsurfacesquare.name");
+@@ -240,7 +240,7 @@
+ 				xDelete<int>(cfsurfacesquare_weights_M_s);
+ 				xDelete<int>(cfsurfacesquare_weights_N_s);
+ 				xDelete<char*>(cfsurfacesquare_weights_string_s);
+-				xDelete<int>(cfsurfacesquare_datatime_s);
++				xDelete<IssmDouble>(cfsurfacesquare_datatime_s);
+ 				/*}}}*/
+ 			}
+ 			else if (output_definition_enums[i]==CfdragcoeffabsgradEnum){
+@@ -322,7 +322,7 @@
+ 				int*         cfsurfacelogvel_weights_M				= NULL;
+ 				int*         cfsurfacelogvel_weights_N				= NULL;
+ 				char**       cfsurfacelogvel_weightstring		= NULL;
+-				int*				cfsurfacelogvel_datatime				= NULL;
++				IssmDouble*  cfsurfacelogvel_datatime				= NULL;
+ 
+ 				/*Fetch name, modeltring, observation, observationtring, etc ... (see src/m/classes/cfsurfacelogvel.m): */
+ 				iomodel->FetchMultipleData(&cfsurfacelogvel_name,&num_cfsurfacelogvels,                                                        "md.cfsurfacelogvel.name");
+@@ -398,9 +398,96 @@
+ 				xDelete<int>(cfsurfacelogvel_weights_M);
+ 				xDelete<int>(cfsurfacelogvel_weights_N);
+ 				xDelete<char*>(cfsurfacelogvel_weightstring);
+-				xDelete<int>(cfsurfacelogvel_datatime);
++				xDelete<IssmDouble>(cfsurfacelogvel_datatime);
+ 				/*}}}*/
+ 			}
++			else if (output_definition_enums[i]==CflevelsetmisfitEnum){
++				/*Deal with cflevelsetmisfit: {{{*/
++
++				/*cflevelsetmisfit variables: */
++				int          num_cflevelsetmisfits;
++				char**       cflevelsetmisfit_name_s						= NULL;    
++				char**		 cflevelsetmisfit_definitionstring_s		= NULL;    
++				char**       cflevelsetmisfit_model_string_s			= NULL;
++				IssmDouble** cflevelsetmisfit_observation_s			= NULL;
++				char**		 cflevelsetmisfit_observation_string_s	= NULL;
++				int*         cflevelsetmisfit_observation_M_s			= NULL;
++				int*         cflevelsetmisfit_observation_N_s			= NULL;
++				IssmDouble** cflevelsetmisfit_weights_s					= NULL;
++				int*         cflevelsetmisfit_weights_M_s				= NULL;
++				int*         cflevelsetmisfit_weights_N_s				= NULL;
++				char**       cflevelsetmisfit_weights_string_s		= NULL;
++				IssmDouble*	 cflevelsetmisfit_datatime_s				= NULL;
++
++				/*Fetch name, model_string, observation, observation_string, etc ... (see src/m/classes/cflevelsetmisfit.m): */
++				iomodel->FetchMultipleData(&cflevelsetmisfit_name_s,&num_cflevelsetmisfits,                                                        "md.cflevelsetmisfit.name");
++				iomodel->FetchMultipleData(&cflevelsetmisfit_definitionstring_s,&num_cflevelsetmisfits,                                            "md.cflevelsetmisfit.definitionstring");
++				iomodel->FetchMultipleData(&cflevelsetmisfit_model_string_s,&num_cflevelsetmisfits,                                                "md.cflevelsetmisfit.model_string");
++				iomodel->FetchMultipleData(&cflevelsetmisfit_observation_s,&cflevelsetmisfit_observation_M_s,&cflevelsetmisfit_observation_N_s,&num_cflevelsetmisfits, "md.cflevelsetmisfit.observation");
++				iomodel->FetchMultipleData(&cflevelsetmisfit_observation_string_s,&num_cflevelsetmisfits,                                          "md.cflevelsetmisfit.observation_string");
++				iomodel->FetchMultipleData(&cflevelsetmisfit_weights_s,&cflevelsetmisfit_weights_M_s,&cflevelsetmisfit_weights_N_s,&num_cflevelsetmisfits,             "md.cflevelsetmisfit.weights");
++				iomodel->FetchMultipleData(&cflevelsetmisfit_weights_string_s,&num_cflevelsetmisfits,                                              "md.cflevelsetmisfit.weights_string");
++				iomodel->FetchMultipleData(&cflevelsetmisfit_datatime_s,&num_cflevelsetmisfits,																	 "md.cflevelsetmisfit.datatime");
++
++				for(j=0;j<num_cflevelsetmisfits;j++){
++					int obs_vector_type=0;
++					if ((cflevelsetmisfit_observation_M_s[j]==iomodel->numberofvertices) || (cflevelsetmisfit_observation_M_s[j]==iomodel->numberofvertices+1)){
++						obs_vector_type=1;
++					}
++					else if ((cflevelsetmisfit_observation_M_s[j]==iomodel->numberofelements) || (cflevelsetmisfit_observation_M_s[j]==iomodel->numberofelements+1)){
++						obs_vector_type=2;
++					}
++					else
++					 _error_("cflevelsetmisfit observation size not supported yet");
++
++					int weight_vector_type=0;
++					if ((cflevelsetmisfit_weights_M_s[j]==iomodel->numberofvertices) || (cflevelsetmisfit_weights_M_s[j]==iomodel->numberofvertices+1)){
++						weight_vector_type=1;
++					}
++					else if ((cflevelsetmisfit_weights_M_s[j]==iomodel->numberofelements) || (cflevelsetmisfit_weights_M_s[j]==iomodel->numberofelements+1)){
++						weight_vector_type=2;
++					}
++					else
++					 _error_("cflevelsetmisfit weight size not supported yet");
++
++					/*First create a cflevelsetmisfit object for that specific string (cflevelsetmisfit_model_string_s[j]):*/
++					output_definitions->AddObject(new Cflevelsetmisfit(cflevelsetmisfit_name_s[j],StringToEnumx(cflevelsetmisfit_definitionstring_s[j]),StringToEnumx(cflevelsetmisfit_model_string_s[j]),StringToEnumx(cflevelsetmisfit_observation_string_s[j]),StringToEnumx(cflevelsetmisfit_weights_string_s[j]),cflevelsetmisfit_datatime_s[j],false));
++
++					/*Now, for this particular cflevelsetmisfit object, make sure we plug into the elements: the observation, and the weights.*/
++					for(Object* & object : elements->objects){
++						Element* element=xDynamicCast<Element*>(object);
++						element->DatasetInputAdd(StringToEnumx(cflevelsetmisfit_definitionstring_s[j]),cflevelsetmisfit_observation_s[j],inputs,iomodel,cflevelsetmisfit_observation_M_s[j],cflevelsetmisfit_observation_N_s[j],obs_vector_type,StringToEnumx(cflevelsetmisfit_observation_string_s[j]),7,LevelsetObservationEnum);
++						element->DatasetInputAdd(StringToEnumx(cflevelsetmisfit_definitionstring_s[j]),cflevelsetmisfit_weights_s[j],inputs,iomodel,cflevelsetmisfit_weights_M_s[j],cflevelsetmisfit_weights_N_s[j],weight_vector_type,StringToEnumx(cflevelsetmisfit_weights_string_s[j]),7,WeightsLevelsetObservationEnum);
++					}
++				}
++
++				  /*Free ressources:*/
++				for(j=0;j<num_cflevelsetmisfits;j++){
++					char* string=NULL;
++					IssmDouble* matrix = NULL;
++
++					string = cflevelsetmisfit_definitionstring_s[j];		xDelete<char>(string);
++					string = cflevelsetmisfit_observation_string_s[j];	xDelete<char>(string);
++					string = cflevelsetmisfit_model_string_s[j];			xDelete<char>(string);
++					string = cflevelsetmisfit_weights_string_s[j];		xDelete<char>(string);
++					string = cflevelsetmisfit_name_s[j];    xDelete<char>(string);
++					matrix = cflevelsetmisfit_observation_s[j]; xDelete<IssmDouble>(matrix);
++					matrix = cflevelsetmisfit_weights_s[j]; xDelete<IssmDouble>(matrix);
++				}
++				xDelete<char*>(cflevelsetmisfit_name_s);
++				xDelete<char*>(cflevelsetmisfit_model_string_s);
++				xDelete<char*>(cflevelsetmisfit_definitionstring_s);
++				xDelete<IssmDouble*>(cflevelsetmisfit_observation_s);
++				xDelete<char*>(cflevelsetmisfit_observation_string_s);
++				xDelete<int>(cflevelsetmisfit_observation_M_s);
++				xDelete<int>(cflevelsetmisfit_observation_N_s);
++				xDelete<IssmDouble*>(cflevelsetmisfit_weights_s);
++				xDelete<int>(cflevelsetmisfit_weights_M_s);
++				xDelete<int>(cflevelsetmisfit_weights_N_s);
++				xDelete<char*>(cflevelsetmisfit_weights_string_s);
++				xDelete<IssmDouble>(cflevelsetmisfit_datatime_s);
++				/*}}}*/
++			}
+ 			else if (output_definition_enums[i]==NodalvalueEnum){
+ 				/*Deal with nodal values: {{{*/
+ 
+Index: ../trunk-jpl/src/m/classes/cflevelsetmisfit.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/cflevelsetmisfit.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/cflevelsetmisfit.m	(revision 26252)
+@@ -0,0 +1,103 @@
++%MISFIT class definition
++%
++%   Usage:
++%      cflevelsetmisfit=cflevelsetmisfit();
++%      cflevelsetmisfit=cflevelsetmisfit('name','CalvingFrontPosition',...
++%                    'definitionstring','Outputdefinition1',... 
++%							'model_string','MaskIceLevelset',...
++%                    'observation_string','LevelsetObservations',...
++%                    'observation',md.mask.ice_levelset,...
++%                    'weights',ones(md.mesh.numberofvertices,1),...
++%                    'weights_string','WeightsLevelsetObservations',...
++%							'datatime',time);
++%
++%
++
++classdef cflevelsetmisfit
++	properties (SetAccess=public)
++		%cflevelsetmisfit
++		name               = '';
++		definitionstring   = ''; %string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
++		model_string       = ''; %string for field that is modeled
++		observation        = NaN; %observed field that we compare the model against
++		observation_string = ''; %string for observed field.
++		weights            = NaN; %weight coefficients for every vertex
++		weights_string     = ''; %string to identify this particular set of weights
++		datatime				 = 0; %time in years from start that the data is from 
++		cumulated          = NaN; %do we cumulate cflevelsetmisfit through time?
++	end
++	
++	methods
++		function self = extrude(self,md) % {{{
++			if ~isnan(self.weights)
++				self.weights=project3d(md,'vector',self.weights,'type','node');
++			end
++			if ~isnan(self.observation)
++				self.observation=project3d(md,'vector',self.observation,'type','node');
++			end
++		end % }}}
++		function self = cflevelsetmisfit(varargin) % {{{
++			if nargin==0,
++				self=setdefaultparameters(self);
++			else
++				%use provided options to change fields
++				options=pairoptions(varargin{:});
++
++				%get name
++				self.name=getfieldvalue(options,'name','');
++				self.definitionstring=getfieldvalue(options,'definitionstring');
++				self.model_string=getfieldvalue(options,'model_string');
++				self.observation=getfieldvalue(options,'observation',NaN);
++				self.observation_string=getfieldvalue(options,'observation_string');
++				self.weights=getfieldvalue(options,'weights',NaN);
++				self.weights_string=getfieldvalue(options,'weights_string','');
++				self.datatime = getfieldvalue(options, 'datatime');
++
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++			self.datatime = 0;
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if ~ischar(self.name),
++				error('cflevelsetmisfit error message: ''name'' field should be a string!');
++			end
++			OutputdefinitionStringArray={};
++			for i=1:100
++				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
++			end
++			md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray);
++
++			md = checkfield(md,'fieldname','self.observation','field',self.observation,'timeseries',1,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','self.datatime','field',self.datatime,'<=',md.timestepping.final_time);
++
++		end % }}}
++		function md = disp(self) % {{{
++		
++			disp(sprintf('   TimeMisfit:\n'));
++
++			fielddisplay(self,'name','identifier for this cflevelsetmisfit response');
++			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-10]''');
++			fielddisplay(self,'model_string','string for field that is modeled');
++			fielddisplay(self,'observation','observed field that we compare the model against');
++			fielddisplay(self,'observation_string','observation string');
++			fielddisplay(self,'weights','weights (at vertices) to apply to the cflevelsetmisfit');
++			fielddisplay(self,'weights_string','string for weights for identification purposes');
++			fielddisplay(self,'datatime','time to compare data to model for misfit');
++
++		end % }}}
++		function md = marshall(self,prefix,md,fid) % {{{
++
++		WriteData(fid,prefix,'data',self.name,'name','md.cflevelsetmisfit.name','format','String');
++		WriteData(fid,prefix,'data',self.definitionstring,'name','md.cflevelsetmisfit.definitionstring','format','String');
++		WriteData(fid,prefix,'data',self.model_string,'name','md.cflevelsetmisfit.model_string','format','String');
++		WriteData(fid,prefix,'data',self.observation,'name','md.cflevelsetmisfit.observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++		WriteData(fid,prefix,'data',self.observation_string,'name','md.cflevelsetmisfit.observation_string','format','String');
++		WriteData(fid,prefix,'data',self.weights,'name','md.cflevelsetmisfit.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++		WriteData(fid,prefix,'data',self.weights_string,'name','md.cflevelsetmisfit.weights_string','format','String');
++		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cflevelsetmisfit.datatime','format','Double');
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/classes/cfsurfacelogvel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/cfsurfacelogvel.m	(revision 26251)
++++ ../trunk-jpl/src/m/classes/cfsurfacelogvel.m	(revision 26252)
+@@ -100,7 +100,7 @@
+ 		WriteData(fid,prefix,'data',self.vyobs_string,'name','md.cfsurfacelogvel.vyobs_string','format','String');
+ 		WriteData(fid,prefix,'data',self.weights,'name','md.cfsurfacelogvel.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfsurfacelogvel.weights_string','format','String');
+-		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacelogvel.datatime','format','Integer');
++		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacelogvel.datatime','format','Double');
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/cfsurfacesquare.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/cfsurfacesquare.m	(revision 26251)
++++ ../trunk-jpl/src/m/classes/cfsurfacesquare.m	(revision 26252)
+@@ -97,7 +97,7 @@
+ 		WriteData(fid,prefix,'data',self.observation_string,'name','md.cfsurfacesquare.observation_string','format','String');
+ 		WriteData(fid,prefix,'data',self.weights,'name','md.cfsurfacesquare.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 		WriteData(fid,prefix,'data',self.weights_string,'name','md.cfsurfacesquare.weights_string','format','String');
+-		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacesquare.datatime','format','Integer');
++		WriteData(fid,prefix,'data',round(self.datatime*md.constants.yts),'name','md.cfsurfacesquare.datatime','format','Double');
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp	(revision 26252)
+@@ -0,0 +1,203 @@
++/*!\file Cflevelsetmisfit.cpp
++ * \brief: Cflevelsetmisfit Object
++ */
++
++/*Headers:*/
++/*{{{*/
++#ifdef HAVE_CONFIG_H
++   #include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "./classes.h"
++#include "./ExternalResults/ExternalResult.h"
++#include "./ExternalResults/Results.h"
++#include "../datastructures/datastructures.h"
++#include "./Elements/Element.h"
++#include "./Elements/Elements.h"
++#include "./FemModel.h"
++#include "../modules/SurfaceAreax/SurfaceAreax.h"
++#include "../classes/Params/Parameters.h"
++#include "../classes/gauss/Gauss.h"
++#include "./Inputs/DatasetInput.h"
++/*}}}*/
++
++/*Cflevelsetmisfit constructors, destructors :*/
++Cflevelsetmisfit::Cflevelsetmisfit(){/*{{{*/
++
++	this->definitionenum = -1;
++	this->name = NULL;
++	this->model_enum = UNDEF;
++	this->observation_enum = UNDEF;
++	this->weights_enum = UNDEF;
++	this->misfit=0;
++	this->datatime=0.;
++	this->timepassedflag = false;
++}
++/*}}}*/
++Cflevelsetmisfit::Cflevelsetmisfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, int in_weights_enum, IssmDouble in_datatime, bool in_timepassedflag){/*{{{*/
++
++	this->definitionenum=in_definitionenum;
++
++	this->name		= xNew<char>(strlen(in_name)+1);
++	xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
++
++	this->model_enum=in_model_enum;
++	this->observation_enum=in_observation_enum;
++	this->weights_enum=in_weights_enum;
++	this->datatime=in_datatime;
++	this->timepassedflag=in_timepassedflag;
++
++	this->misfit=0;
++}
++/*}}}*/
++Cflevelsetmisfit::~Cflevelsetmisfit(){/*{{{*/
++	if(this->name)xDelete(this->name);
++	this->misfit=0;
++}
++/*}}}*/
++/*Object virtual function resolutoin: */
++Object* Cflevelsetmisfit::copy() {/*{{{*/
++	Cflevelsetmisfit* mf = new Cflevelsetmisfit(this->name,this->definitionenum, this->model_enum,this->observation_enum,this->weights_enum,this->datatime,this->timepassedflag);
++	mf->misfit=this->misfit;
++	return (Object*) mf;
++}
++/*}}}*/
++void Cflevelsetmisfit::DeepEcho(void){/*{{{*/
++	this->Echo();
++}
++/*}}}*/
++void Cflevelsetmisfit::Echo(void){/*{{{*/
++	_printf_(" Cflevelsetmisfit: " << name << " " << this->definitionenum << "\n");
++	_printf_("    model_enum: " << model_enum << " " << EnumToStringx(model_enum) << "\n");
++	_printf_("    observation_enum: " << observation_enum << " " << EnumToStringx(observation_enum) << "\n");
++	_printf_("    weights_enum: " << weights_enum << " " << EnumToStringx(weights_enum) << "\n");
++	_printf_("    datatime: " << datatime << "\n");
++	_printf_("	  timepassedflag: "<<timepassedflag<<"\n");
++}
++/*}}}*/
++int Cflevelsetmisfit::Id(void){/*{{{*/
++	return -1;
++}
++/*}}}*/
++void Cflevelsetmisfit::Marshall(MarshallHandle* marshallhandle){/*{{{*/
++	_error_("not implemented yet!"); 
++} 
++/*}}}*/
++int Cflevelsetmisfit::ObjectEnum(void){/*{{{*/
++	return CflevelsetmisfitEnum;
++}
++/*}}}*/
++/*Definition virtual function resolutoin: */
++int Cflevelsetmisfit::DefinitionEnum(){/*{{{*/
++	return this->definitionenum;
++}
++/*}}}*/
++char* Cflevelsetmisfit::Name(){/*{{{*/
++	char* name2=xNew<char>(strlen(this->name)+1);
++	xMemCpy(name2,this->name,strlen(this->name)+1);
++
++	return name2;
++}
++/*}}}*/
++IssmDouble Cflevelsetmisfit::Response(FemModel* femmodel){/*{{{*/
++	 /*diverse: */
++	 IssmDouble time;
++
++	 /*recover time parameters: */
++	 femmodel->parameters->FindParam(&time,TimeEnum);
++
++	 IssmDouble J=0.;
++	 IssmDouble J_sum=0.;
++
++	 if(datatime<=time && !timepassedflag){
++		 for(Object* & object : femmodel->elements->objects){
++			 Element* element=xDynamicCast<Element*>(object);
++			 J+=this->Cflevelsetmisfit_Calculation(element,model_enum,observation_enum,weights_enum);
++		 }
++
++		 ISSM_MPI_Allreduce ( (void*)&J,(void*)&J_sum,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
++		 ISSM_MPI_Bcast(&J_sum,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++		 J=J_sum;
++
++		 timepassedflag = true;
++		 return J;
++	 }
++	 else return J;
++ }
++	/*}}}*/
++IssmDouble Cflevelsetmisfit::Cflevelsetmisfit_Calculation(Element* element, int model_enum, int observation_enum, int weights_enum){/*{{{*/
++
++	int        domaintype,numcomponents;
++	IssmDouble Jelem=0.;
++	IssmDouble misfit,Jdet;
++	IssmDouble model,obs,weight;
++	IssmDouble modelLevel,obsLevel;
++	IssmDouble* xyz_list = NULL;
++
++	/*Get basal element*/
++	if(!element->IsOnSurface()) return 0.;
++
++	/*If on water, return 0: */
++//	if(!element->IsIceInElement()) return 0.;
++
++	/*Get problem dimension*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DverticalEnum:   numcomponents   = 1; break;
++		case Domain3DEnum:           numcomponents   = 2; break;
++		case Domain2DhorizontalEnum: numcomponents   = 2; break;
++		default: _error_("not supported yet");
++	}
++
++	/*Spawn surface element*/
++	Element* topelement = element->SpawnTopElement();
++
++	/* Get node coordinates*/
++	topelement->GetVerticesCoordinates(&xyz_list);
++
++	/*Retrieve all inputs we will be needing: */
++	DatasetInput *datasetinput = topelement->GetDatasetInput(definitionenum); _assert_(datasetinput);
++	Input        *model_input  = topelement->GetInput(model_enum);            _assert_(model_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=topelement->NewGauss(2);
++	while(gauss->next()){
++
++		/* Get Jacobian determinant: */
++		topelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++
++		/*Get all parameters at gaussian point*/
++		datasetinput->GetInputValue(&weight,gauss,WeightsLevelsetObservationEnum);
++		model_input->GetInputValue(&model,gauss);
++		datasetinput->GetInputValue(&obs,gauss,LevelsetObservationEnum);
++
++		/*Compute Levelset misfit:
++		 *  J = || H(\phi) - H(\phi_obs)||^2
++		 *                                           */
++//		modelLevel = this->Heaviside(model);
++//		obsLevel = this->Heaviside(obs);
++		modelLevel = model;
++		obsLevel = obs;
++
++		misfit=0.5*(modelLevel-obsLevel)*(modelLevel-obsLevel);
++
++//		if (modelLevel*obsLevel<0.0) {
++		/*Add to cost function*/
++			Jelem+=misfit*weight*Jdet*gauss->weight;
++//		}
++	}
++
++	/*clean up and Return: */
++	if(topelement->IsSpawnedElement()){topelement->DeleteMaterials(); delete topelement;};
++	xDelete<IssmDouble>(xyz_list);
++	delete gauss;
++	return Jelem;
++}/*}}}*/
++IssmDouble Cflevelsetmisfit::Heaviside(IssmDouble x){/*{{{*/
++	if (x>0) return 1.;
++	else if (x<0) return -1.;
++	else return 0.;
++}
++	/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h	(nonexistent)
++++ ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h	(revision 26252)
+@@ -0,0 +1,51 @@
++/*!\file Cflevelsetmisfit.h
++ * \brief: header file for Cflevelsetmisfit object
++ */
++
++#ifndef _CFLEVELSETMISFIT_H_
++#define _CFLEVELSETMISFIT_H_
++
++/*Headers:*/
++#include "./Definition.h"
++#include "./FemModel.h"
++
++IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);
++void  GetVectorFromInputsx( IssmDouble** pvector, int* pvector_size, FemModel* femmodel,int name);
++
++class Cflevelsetmisfit: public Object, public Definition{
++
++	public: 
++
++		int         definitionenum;
++		int         local;     
++		int         model_enum;
++		char*       name;
++		int         observation_enum;
++		char*       timeinterpolation;
++		int         weights_enum;
++		IssmDouble	datatime;
++		bool			timepassedflag;
++		
++		IssmDouble  misfit; //value carried over in time.
++		
++		/*Cflevelsetmisfit constructors, destructors :*/
++		Cflevelsetmisfit();
++		Cflevelsetmisfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, int in_weights_enum, IssmDouble in_datatime, bool timepassedflag);
++		~Cflevelsetmisfit();
++		
++		/*Object virtual function resolutoin: */
++		Object* copy();
++		void DeepEcho(void);
++		void Echo(void);
++		int Id(void);
++		void Marshall(MarshallHandle* marshallhandle);
++		int ObjectEnum(void);
++		
++		/*Definition virtual function resolutoin: */
++		int DefinitionEnum();
++		char* Name();
++		IssmDouble Response(FemModel* femmodel);
++		IssmDouble Cflevelsetmisfit_Calculation(Element* element, int model_enum, int observation_enum, int weights_enum);
++		IssmDouble Heaviside(IssmDouble x);
++};
++#endif  /* _CFLEVELSETMISFIT_H_ */
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26251)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26252)
+@@ -706,11 +706,13 @@
+ 	InversionVyObsEnum,
+ 	LevelsetfunctionSlopeXEnum,
+ 	LevelsetfunctionSlopeYEnum,
++	LevelsetObservationEnum,
+ 	LoadingforceXEnum,
+ 	LoadingforceYEnum,
+ 	LoadingforceZEnum,
+ 	MaskOceanLevelsetEnum,
+ 	MaskIceLevelsetEnum,
++	MaskIceRefLevelsetEnum,
+ 	MasstransportSpcthicknessEnum,
+ 	MaterialsRheologyBEnum,
+ 	MaterialsRheologyBbarEnum,
+@@ -1011,6 +1013,7 @@
+ 	WaterfractionDrainageIntegratedEnum,
+ 	WaterfractionEnum,
+ 	WaterheightEnum,
++	WeightsLevelsetObservationEnum,
+ 	WeightsSurfaceObservationEnum,
+ 	OldAccumulatedDeltaBottomPressureEnum,
+ 	OldAccumulatedDeltaIceThicknessEnum,
+@@ -1156,6 +1159,7 @@
+ 	CfdragcoeffabsgradEnum,
+ 	CfsurfacelogvelEnum,
+ 	CfsurfacesquareEnum,
++	CflevelsetmisfitEnum,
+ 	ChannelEnum,
+ 	ChannelAreaEnum,
+ 	ChannelAreaOldEnum,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26252-26253.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26252-26253.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26252-26253.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26252)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26253)
+@@ -696,6 +696,9 @@
+ 							/*create DoubleParam: */
+ 							this->AddConstant(new IoConstant(scalar,record_name));
+ 						}
++						else{
++							if(fread(&pscalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar ");
++						}
+ 					  }
+ 					break;
+ 				case 4:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26253-26254.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26253-26254.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26253-26254.diff	(revision 26740)
@@ -0,0 +1,27 @@
+Index: ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp	(revision 26253)
++++ ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp	(revision 26254)
+@@ -82,7 +82,21 @@
+ }
+ /*}}}*/
+ void Cflevelsetmisfit::Marshall(MarshallHandle* marshallhandle){/*{{{*/
+-	_error_("not implemented yet!"); 
++
++	/*ok, marshall operations: */
++   int object_enum=CflevelsetmisfitEnum;
++   marshallhandle->call(object_enum);
++
++	marshallhandle->call(this->definitionenum);
++	marshallhandle->call(this->local);
++	marshallhandle->call(this->model_enum);
++	marshallhandle->call(this->name);
++	marshallhandle->call(this->observation_enum);
++	marshallhandle->call(this->timeinterpolation);
++	marshallhandle->call(this->weights_enum);
++	marshallhandle->call(this->datatime);
++	marshallhandle->call(this->timepassedflag);
++	marshallhandle->call(this->misfit);
+ } 
+ /*}}}*/
+ int Cflevelsetmisfit::ObjectEnum(void){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26254-26255.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26254-26255.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26254-26255.diff	(revision 26740)
@@ -0,0 +1,280 @@
+Index: ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp	(revision 26254)
++++ ../trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp	(revision 26255)
+@@ -88,11 +88,9 @@
+    marshallhandle->call(object_enum);
+ 
+ 	marshallhandle->call(this->definitionenum);
+-	marshallhandle->call(this->local);
+ 	marshallhandle->call(this->model_enum);
+ 	marshallhandle->call(this->name);
+ 	marshallhandle->call(this->observation_enum);
+-	marshallhandle->call(this->timeinterpolation);
+ 	marshallhandle->call(this->weights_enum);
+ 	marshallhandle->call(this->datatime);
+ 	marshallhandle->call(this->timepassedflag);
+Index: ../trunk-jpl/test/Archives/Archive3203.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive3203.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test3203.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3203.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test3203.m	(revision 26255)
+@@ -0,0 +1,91 @@
++%Test Name: SquareShelfTransientLevelsetMisfitcodipack
++
++md=triangle(model(),'../Exp/Square.exp',50000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++%Do not kill ice bergs as all is floating
++md.levelset.kill_icebergs=0;
++
++x = md.mesh.x;
++xmin = min(x);
++xmax = max(x);
++Lx = (xmax-xmin);
++alpha = 2./3.;
++md.mask.ice_levelset = ((x - alpha*Lx)>0) - ((x - alpha*Lx)<0);
++
++md.timestepping.time_step=10;
++md.timestepping.final_time=30;
++
++%Transient
++md.transient.isstressbalance=1;
++md.transient.ismasstransport=1;
++md.transient.issmb=1;
++md.transient.isthermal=0;
++md.transient.isgroundingline=0;
++md.transient.ismovingfront=1;
++
++md.calving=calvinglevermann();
++md.calving.coeff=4.89e13*ones(md.mesh.numberofvertices,1);
++md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
++md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 1e8;
++
++md = solve(md,'tr');
++%plotmodel(md,'axis#all','tight','data',md.materials.rheology_B(1:end-1,1),'caxis#all',[ 1.3 1.9]*10^8,'title','"True" B',...
++%'data',md.materials.rheology_B(1:end-1,2),'title','"True" B 2')
++
++%Modify rheology, now constant
++md.materials.rheology_B(1:end-1,:) = 1.8e8;
++
++%Set cost function
++weights= ones(md.mesh.numberofvertices,1);
++count = 1;
++
++for i=1:numel(md.results.TransientSolution)
++	time   = md.results.TransientSolution(i).time;
++   md.outputdefinition.definitions{count}=cflevelsetmisfit('name',['LevelsetMisfit' num2str(count)],...
++      'definitionstring',['Outputdefinition' num2str(count)],...
++      'model_string','MaskIceLevelset','observation_string','LevelsetObservation',...
++      'observation',reinitializelevelset(md, md.results.TransientSolution(i).MaskIceLevelset),'weights',weights,'weights_string','WeightsLevelsetObservation',...
++      'datatime',time);
++   md.autodiff.dependents{count} = dependent('name',['Outputdefinition' num2str(count)],'type','scalar','fos_reverse_index',1);
++
++	count = count+1;
++end
++
++%Independent
++min_params = md.materials.rheology_B; min_params(1:end-1,:) = cuffey(273);
++max_params = md.materials.rheology_B; max_params(1:end-1,:) = cuffey(200);
++md.autodiff.independents{1} = independent('name','MaterialsRheologyBbar',...
++	'md_name','md.materials.rheology_B',...
++	'control_size',size(md.materials.rheology_B,2),...
++	'type','vertex',... %Really needed??
++	'min_parameters',min_params,...
++	'max_parameters',max_params,...
++	'control_scaling_factor',1e8);
++
++md.inversion=adm1qn3inversion(md.inversion);
++md.inversion.iscontrol=1;
++md.inversion.maxiter=4;
++md.inversion.maxsteps=md.inversion.maxiter;
++md.inversion.dxmin=1e-5;
++md.autodiff.isautodiff=1;
++md.autodiff.driver='fos_reverse';
++
++%Go solve!
++md.verbose=verbose(0);
++md=solve(md,'tr');
++%plotmodel(md,'axis#all','tight','data',md.results.TransientSolution(1).MaterialsRheologyBbar(:,1),'caxis#all',[ 1.3 1.9]*10^8,'title','B1',...
++%'data',md.results.TransientSolution(1).MaterialsRheologyBbar(:,2),'title','B2')
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient','Misfit','Rheology'};
++field_tolerances={1e-12,1e-12,1e-12};
++field_values={...
++	(md.results.TransientSolution(1).Gradient1),...
++	(md.results.TransientSolution(1).J),...
++	(md.results.TransientSolution(1).MaterialsRheologyBbar),...
++	};
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26254)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26255)
+@@ -9,7 +9,9 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
++#include "../classes/Inputs/DatasetInput.h"
+ 
++
+ void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 	int finiteelement;
+ 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
+@@ -48,6 +50,7 @@
+ 	}
+ 
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
++//	iomodel->FetchDataToInput(inputs,elements,"md.mask.ref_levelset",MaskIceRefLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+ 
+@@ -66,6 +69,12 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+ 			break;
++		case CalvingTestEnum:
++			iomodel->FetchDataToInput(inputs,elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.calving.Qrates",CalvingNonlinearQRateEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
++			break;
+ 		case CalvingMinthicknessEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+ 			break;
+@@ -102,6 +111,9 @@
+ /*}}}*/
+ void LevelsetAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
++	IssmDouble* coefficients=NULL;
++	int nco;
++
+ 	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));
+@@ -116,6 +128,15 @@
+ 		case CalvingVonmisesEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.calving.min_thickness",CalvingMinthicknessEnum));
+ 			break;
++		case CalvingTestEnum:
++			parameters->AddObject(iomodel->CopyConstantObject("md.calving.min_thickness",CalvingMinthicknessEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.calving.dt_order",CalvingDtimeorderEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.calving.nonlinear_law",CalvingNonlinearLawEnum));
++			
++			/* Add the coefficients for the new nonlinear law */
++			iomodel->FetchData(&coefficients, &nco, NULL, "md.calving.coefficients");
++	      parameters->AddObject(new DoubleMatParam(CalvingNonlinearCoeffEnum, coefficients, nco, 1));
++			xDelete<IssmDouble>(coefficients);
+ 		case CalvingMinthicknessEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.calving.min_thickness",CalvingMinthicknessEnum));
+ 			break;
+@@ -214,6 +235,7 @@
+ 	IssmDouble*    basis    = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*    dbasis   = xNew<IssmDouble>(2*numnodes);
+ 	IssmDouble*    Bprime = NULL;
++	IssmDouble		tau;
+ 	if(stabilization==2){
+ 		Bprime   = xNew<IssmDouble>(dim*numnodes);
+ 	}
+@@ -339,10 +361,11 @@
+ 	Element* basalelement = element->SpawnBasalElement();
+ 
+ 	/*Intermediaries */
+-	int domaintype;
++	int domaintype, stabilization;
+ 	IssmDouble  Jdet,dt;
+ 	IssmDouble  lsf;
+ 	IssmDouble* xyz_list = NULL;
++   IssmDouble  vx,vy,vel,h,tau;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+@@ -350,6 +373,7 @@
+ 	/*Initialize Element vector*/
+ 	ElementVector* pe = basalelement->NewElementVector();
+ 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
++   basalelement->FindParam(&stabilization,LevelsetStabilizationEnum);
+ 
+ 	if(dt!=0.){
+ 		/*Initialize basis vector*/
+@@ -358,6 +382,8 @@
+ 		/*Retrieve all inputs and parameters*/
+ 		basalelement->GetVerticesCoordinates(&xyz_list);
+ 		Input* levelset_input     = basalelement->GetInput(MaskIceLevelsetEnum);                    _assert_(levelset_input);
++		
++	//	h=element->CharacteristicLength();
+ 
+ 		/* Start  looping on the number of gaussian points: */
+ 		Gauss* gauss=basalelement->NewGauss(2);
+@@ -472,6 +498,41 @@
+ 		}
+ 	}
+ 
++	if(calvinglaw==CalvingTestEnum){
++
++		/*Get minimum thickness threshold*/
++		femmodel->parameters->FindParam(&min_thickness,CalvingMinthicknessEnum);
++
++		/*Loop over all elements of this partition*/
++		for(Object* & object : femmodel->elements->objects){
++			Element* element  = xDynamicCast<Element*>(object);
++
++			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*/
++			for(int in=0;in<numnodes;in++){
++				gauss->GaussNode(element->GetElementType(),in);
++				Node* node=element->GetNode(in);
++				if(!node->IsActive()) continue;
++
++				H_input->GetInputValue(&thickness,gauss);
++				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);
++				}
++			}
++			delete gauss;
++		}
++	}
+ 	if(calvinglaw==CalvingHabEnum){
+ 
+ 		/*Get the fraction of the flotation thickness at the terminus*/
+Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp
+===================================================================
+--- ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 26254)
++++ ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 26255)
+@@ -250,6 +250,11 @@
+ 				res->Marshall(marshallhandle);
+ 				this->AddObject(res);
+ 			}
++			else if(obj_enum==CflevelsetmisfitEnum){
++				Cflevelsetmisfit* Cflevelset=new Cflevelsetmisfit();
++				Cflevelset->Marshall(marshallhandle);
++				this->AddObject(Cflevelset);
++			}
+ 			else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); 
+ 		}
+ 	}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26255-26256.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26255-26256.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26255-26256.diff	(revision 26740)
@@ -0,0 +1,157 @@
+Index: ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h	(revision 26255)
++++ ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h	(revision 26256)
+@@ -17,11 +17,9 @@
+ 	public: 
+ 
+ 		int         definitionenum;
+-		int         local;     
+ 		int         model_enum;
+ 		char*       name;
+ 		int         observation_enum;
+-		char*       timeinterpolation;
+ 		int         weights_enum;
+ 		IssmDouble	datatime;
+ 		bool			timepassedflag;
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26255)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26256)
+@@ -9,9 +9,7 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+-#include "../classes/Inputs/DatasetInput.h"
+ 
+-
+ void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 	int finiteelement;
+ 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
+@@ -50,7 +48,6 @@
+ 	}
+ 
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+-//	iomodel->FetchDataToInput(inputs,elements,"md.mask.ref_levelset",MaskIceRefLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+ 
+@@ -69,12 +66,6 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+ 			break;
+-		case CalvingTestEnum:
+-			iomodel->FetchDataToInput(inputs,elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
+-			iomodel->FetchDataToInput(inputs,elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
+-			iomodel->FetchDataToInput(inputs,elements,"md.calving.Qrates",CalvingNonlinearQRateEnum);
+-			iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+-			break;
+ 		case CalvingMinthicknessEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.geometry.bed",BedEnum);
+ 			break;
+@@ -111,9 +102,6 @@
+ /*}}}*/
+ void LevelsetAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+-	IssmDouble* coefficients=NULL;
+-	int nco;
+-
+ 	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));
+@@ -128,15 +116,6 @@
+ 		case CalvingVonmisesEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.calving.min_thickness",CalvingMinthicknessEnum));
+ 			break;
+-		case CalvingTestEnum:
+-			parameters->AddObject(iomodel->CopyConstantObject("md.calving.min_thickness",CalvingMinthicknessEnum));
+-			parameters->AddObject(iomodel->CopyConstantObject("md.calving.dt_order",CalvingDtimeorderEnum));
+-			parameters->AddObject(iomodel->CopyConstantObject("md.calving.nonlinear_law",CalvingNonlinearLawEnum));
+-			
+-			/* Add the coefficients for the new nonlinear law */
+-			iomodel->FetchData(&coefficients, &nco, NULL, "md.calving.coefficients");
+-	      parameters->AddObject(new DoubleMatParam(CalvingNonlinearCoeffEnum, coefficients, nco, 1));
+-			xDelete<IssmDouble>(coefficients);
+ 		case CalvingMinthicknessEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.calving.min_thickness",CalvingMinthicknessEnum));
+ 			break;
+@@ -235,7 +214,6 @@
+ 	IssmDouble*    basis    = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*    dbasis   = xNew<IssmDouble>(2*numnodes);
+ 	IssmDouble*    Bprime = NULL;
+-	IssmDouble		tau;
+ 	if(stabilization==2){
+ 		Bprime   = xNew<IssmDouble>(dim*numnodes);
+ 	}
+@@ -361,11 +339,10 @@
+ 	Element* basalelement = element->SpawnBasalElement();
+ 
+ 	/*Intermediaries */
+-	int domaintype, stabilization;
++	int domaintype;
+ 	IssmDouble  Jdet,dt;
+ 	IssmDouble  lsf;
+ 	IssmDouble* xyz_list = NULL;
+-   IssmDouble  vx,vy,vel,h,tau;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+@@ -373,7 +350,6 @@
+ 	/*Initialize Element vector*/
+ 	ElementVector* pe = basalelement->NewElementVector();
+ 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+-   basalelement->FindParam(&stabilization,LevelsetStabilizationEnum);
+ 
+ 	if(dt!=0.){
+ 		/*Initialize basis vector*/
+@@ -382,8 +358,6 @@
+ 		/*Retrieve all inputs and parameters*/
+ 		basalelement->GetVerticesCoordinates(&xyz_list);
+ 		Input* levelset_input     = basalelement->GetInput(MaskIceLevelsetEnum);                    _assert_(levelset_input);
+-		
+-	//	h=element->CharacteristicLength();
+ 
+ 		/* Start  looping on the number of gaussian points: */
+ 		Gauss* gauss=basalelement->NewGauss(2);
+@@ -498,41 +472,6 @@
+ 		}
+ 	}
+ 
+-	if(calvinglaw==CalvingTestEnum){
+-
+-		/*Get minimum thickness threshold*/
+-		femmodel->parameters->FindParam(&min_thickness,CalvingMinthicknessEnum);
+-
+-		/*Loop over all elements of this partition*/
+-		for(Object* & object : femmodel->elements->objects){
+-			Element* element  = xDynamicCast<Element*>(object);
+-
+-			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*/
+-			for(int in=0;in<numnodes;in++){
+-				gauss->GaussNode(element->GetElementType(),in);
+-				Node* node=element->GetNode(in);
+-				if(!node->IsActive()) continue;
+-
+-				H_input->GetInputValue(&thickness,gauss);
+-				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);
+-				}
+-			}
+-			delete gauss;
+-		}
+-	}
+ 	if(calvinglaw==CalvingHabEnum){
+ 
+ 		/*Get the fraction of the flotation thickness at the terminus*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26256-26257.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26256-26257.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26256-26257.diff	(revision 26740)
@@ -0,0 +1,8 @@
+Index: ../trunk-jpl/test/Archives/Archive2002.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2003.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26257-26258.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26257-26258.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26257-26258.diff	(revision 26740)
@@ -0,0 +1,366 @@
+Index: ../trunk-jpl/examples/Functions/grace.m
+===================================================================
+--- ../trunk-jpl/examples/Functions/grace.m	(revision 26257)
++++ ../trunk-jpl/examples/Functions/grace.m	(revision 26258)
+@@ -1,8 +1,11 @@
+ % map grace loads in meters [m] of water equivalent height 
+-function water_load = grace(index,lat,lon,tmin,tmax); 
++function water_load = grace(index,lat,lon,tmin,tmax,onvertex); 
+ 
+ 	%compute centroids using (lat,lon) data {{{
+ 	ne = length(index); % number of elements 
++	nv = length(lat); % number of vertices
++	% [lat,lon] \in [-90:90,-180,180]; 
++	lat_vertex_0=lat; long_vertex_0=lon; 
+ 	% lat -> [0,180]; long -> [0,360] to compute centroids 
+ 	lat=90-lat; 
+ 	lon(lon<0)=180+(180+lon(lon<0)); 
+@@ -115,10 +118,18 @@
+ 	time_yr=time_yr(pos1:pos2); 
+ 	load_grace_plus=load_grace_plus(pos1:pos2,:); 
+ 	num_yr=length(time_yr); 
+-	water_load_0=zeros(ne,num_yr);
++	if onvertex
++		water_load_0=zeros(nv,num_yr);
++	else
++		water_load_0=zeros(ne,num_yr);
++	end
+ 
+ 	for jj=1:num_yr
+-		water_load_0(:,jj) = griddata(lat_grace_plus,lon_grace_plus,load_grace_plus(jj,:),lat_element_0,lon_element);
++		if onvertex
++			water_load_0(:,jj) = griddata(lat_grace_plus,lon_grace_plus,load_grace_plus(jj,:),lat_vertex_0,lon);
++		else 
++			water_load_0(:,jj) = griddata(lat_grace_plus,lon_grace_plus,load_grace_plus(jj,:),lat_element_0,lon_element);
++		end
+ 		disp([num2str(jj),' of ',num2str(num_yr),' months done!']); 
+ 	end 
+ 
+Index: ../trunk-jpl/examples/SlrFarrell/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrFarrell/runme.m	(revision 26257)
++++ ../trunk-jpl/examples/SlrFarrell/runme.m	(revision 26258)
+@@ -1,10 +1,7 @@
+ clear all;
+ 
+-steps=[1:5];
++steps=[4];
+ 
+-try
+- % [1:5]
+-
+ if any(steps==1) 
+ 	disp('   Step 1: Global mesh creation');
+ 
+@@ -19,16 +16,16 @@
+ 	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km]
+ 
+ 	for i=1:numrefine,
+-		md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
++		ocean_mask_levelset=gmtmask(md.mesh.lat,md.mesh.long);
+ 
+ 		distance=zeros(md.mesh.numberofvertices,1);
+ 
+-		pos=find(~md.mask.ocean_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);
+-		pos=find(md.mask.ocean_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);
++		pos=find(~ocean_mask_levelset);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos);
++		pos=find(ocean_mask_levelset);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos);
+ 
+ 		for j=1:md.mesh.numberofvertices
+ 			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+-			if md.mask.ocean_levelset(j),
++			if ocean_mask_levelset(j),
+ 				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
+ 				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+ 				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+@@ -41,7 +38,7 @@
+ 		end
+ 		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+ 
+-		pos2=find(md.mask.ocean_levelset~=1 & distance>mindistance_land);
++		pos2=find(ocean_mask_levelset~=1 & distance>mindistance_land);
+ 		distance(pos2)=mindistance_land;
+ 
+ 		dist=min(maxdistance,distance);
+@@ -48,7 +45,10 @@
+ 		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
+ 	end
+ 
+-	md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);
++	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
++	pos = find(ocean_mask==0); 
++	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
++	md.mask.ocean_levelset(pos)=1; 
+ 
+ 	save ./Models/SlrFarrell_Mesh md;
+ 
+@@ -59,13 +59,19 @@
+ 	disp('   Step 2: Define source as in Farrell, 1972, Figure 1');
+ 	md = loadmodel('./Models/SlrFarrell_Mesh');
+ 
+-	md.slr.sealevel=md.mask.ocean_levelset; % 1 m SLR everywhere
+-	md.slr.deltathickness=zeros(md.mesh.numberofelements,1);
+-	md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
++	md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofvertices,1);
++	md.mask.ice_levelset=ones(md.mesh.numberofvertices,1); 
+ 
++	pos = find(md.mask.ocean_levelset==-1); 
++	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
++	md.solidearth.initialsealevel(pos)=1; % 1 m SLR everywhere
++	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
++	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++
+ 	save ./Models/SlrFarrell_Loads md;
+ 
+-	plotmodel (md,'data',md.slr.sealevel,'view',[90 90],'title#all','Initial sea-level [m]');
++	plotmodel (md,'data',md.solidearth.initialsealevel,'view',[90 90],'title#all','Initial sea-level [m]');
+ end 
+ 
+ if any(steps==3) 
+@@ -74,18 +80,17 @@
+ 
+ 	md.solidearth.lovenumbers=lovenumbers('maxdeg',10000);
+ 
+-	md.mask.land_levelset = 1-md.mask.ocean_levelset;
+-	md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
+-	md.mask.ocean_levelset = -ones(md.mesh.numberofvertices,1);
+-	pos=find(md.mesh.lat <-80);
+-	md.mask.ice_levelset(pos(1))=-1; % ice yes!
+-	md.mask.ocean_levelset(pos(1))=1; % ice grounded!
++	%md.mask.ice_levelset = ones(md.mesh.numberofvertices,1);
++	%md.mask.ocean_levelset = -ones(md.mesh.numberofvertices,1);
++	%pos=find(md.mesh.lat <-80);
++	%md.mask.ice_levelset(pos(1))=-1; % ice yes!
++	%md.mask.ocean_levelset(pos(1))=1; % ice grounded!
+ 
+-	di=md.materials.rho_ice/md.materials.rho_water;
+-	md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+-	md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+-	md.geometry.base=md.geometry.surface-md.geometry.thickness;
+-	md.geometry.bed=md.geometry.base;
++	% arbitary to pass consistency check. 
++	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++	md.geometry.surface=ones(md.mesh.numberofvertices,1);
++	md.geometry.base=md.geometry.bed; 
++	md.geometry.thickness=md.geometry.surface-md.geometry.base; 
+ 
+ 	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+ 	md.materials.rheology_B=paterson(md.initialization.temperature);
+@@ -103,7 +108,7 @@
+ 	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+-	md.slr.reltol = 0.1/100; % percent change in solution
++	md.solidearth.settings.reltol = 0.1/100; % percent change in solution
+ 
+ 	md=solve(md,'Slr');
+ 
+Index: ../trunk-jpl/examples/EsaGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26257)
++++ ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26258)
+@@ -1,7 +1,7 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1]; % [1:5]
++steps=[5]; 
+ 
+ if any(steps==1) 
+ 	disp('   Step 1: Global mesh creation');
+Index: ../trunk-jpl/examples/EsaWahr/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaWahr/runme.m	(revision 26257)
++++ ../trunk-jpl/examples/EsaWahr/runme.m	(revision 26258)
+@@ -1,7 +1,7 @@
+ clear all;
+ addpath('../Functions');
+ 
+-steps=[1]; % [1:7]
++steps=[2]; 
+ 
+ if any(steps==1) 
+ 	disp('   Step 1: Mesh creation');
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26257)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26258)
+@@ -1,9 +1,9 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[7];
++steps=[1:7];
+ 
+-if any(steps==1)
++if any(steps==1) % {{{ 
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	numrefine=5;
+@@ -50,8 +50,8 @@
+ 	save ./Models/SlrGRACE_Mesh md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end
+-if any(steps==2)
++end % }}} 
++if any(steps==2) % {{{ 
+ 	disp('   Step 2: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/SlrGRACE_Mesh');
+ 
+@@ -58,40 +58,59 @@
+ 	year_month = 2007+15/365;
+ 	time_range = [year_month year_month];
+ 
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
++	onvertex = 1; % map data on vertex. If 0, it maps on the elemental centroid. 
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2),onvertex);
++	rho_water2ice = md.materials.rho_freshwater/md.materials.rho_ice; 
++	ice_load = water_load*rho_water2ice; % ice height equivalent. 
+ 
+-	md.solidearth.surfaceload.icethicknesschange = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
++	%Geometry for the bed, arbitrary thickness of 100:
++	md.geometry.bed=zeros(md.mesh.numberofvertices,1);
++	md.geometry.base=md.geometry.bed;
++	md.geometry.thickness = 100*ones(md.mesh.numberofvertices,1);
++	md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
++	md.masstransport.spcthickness = [md.geometry.thickness + ice_load; 0];
++
++	md.smb.mass_balance=zeros(md.mesh.numberofvertices,1); 
++
+ 	save ./Models/SlrGRACE_Loads md;
+ 
+-	plotmodel (md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');
+-end
+-if any(steps==3)
++	plotmodel (md,'data',ice_load,...
++		'edgecolor','k','view',[45 45],'caxis',[-.1 .1],...
++		'title','Ice height equivalent [m]');
++end % }}} 
++if any(steps==3) % {{{ 
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/SlrGRACE_Loads');
+-
++	
++	md.mask.ice_levelset=-md.mask.ocean_levelset;
++	
+ 	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
++	md.solidearth.settings.reltol=NaN;
++	md.solidearth.settings.abstol=1e-3;
++	md.solidearth.settings.computesealevelchange=1;
++	md.solidearth.settings.isgrd=1;
++	md.solidearth.settings.grdmodel=1;
++	md.solidearth.settings.maxiter=10; 
++	
++	%time stepping:
++	md.timestepping.start_time=0;
++	md.timestepping.time_step=1;
++	md.timestepping.final_time=1;
+ 
+-	md.mask.ice_levelset=-md.mask.ocean_levelset;
+-	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+-	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++	%masstransport:
++	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++	md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++	md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++	md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++	md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++	md.initialization.str=0;
+ 
+-	md.solidearth.settings.ocean_area_scaling=1;
+-
+-	% arbitary to pass consistency check.	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+-	md.geometry.surface=ones(md.mesh.numberofvertices,1);
+-	md.geometry.base=md.geometry.bed;	md.geometry.thickness=md.geometry.surface-md.geometry.base;
+-	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+-	md.materials.rheology_B=paterson(md.initialization.temperature);
+-	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-
+ 	md.miscellaneous.name='SlrGRACE';
+ 
+ 	save ./Models/SlrGRACE_Parameterization md;
+-end
+-if any(steps==4)
++end % }}} 
++if any(steps==4) % {{{ 
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -99,21 +118,28 @@
+ 	md.solidearth.settings.elastic=1;
+ 	md.solidearth.settings.rotation=1;
+ 
+-	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
++	%Physics:
++	md.transient.issmb=0;
++	md.transient.isstressbalance=0;
++	md.transient.isthermal=0;
++	md.transient.ismasstransport=1;
++	md.transient.isslc=1;
++	
++	md.solidearth.requested_outputs={'Sealevel','Bed'}; 
+ 
+ 	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+-	md=solve(md,'Slr');
++	md=solve(md,'Transient');
+ 
+ 	save ./Models/SlrGRACE_Solution md;
+-end
+-if any(steps==5)
++end % }}}
++if any(steps==5) % {{{ 
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/SlrGRACE_Solution');
+ 
+-	sol1 = md.solidearth.surfaceload.icethicknesschange*100; % [cm]
+-	sol2 = md.results.SealevelriseSolution.SealevelRSL*1000;	% [mm]
++	sol1 = (md.masstransport.spcthickness(1:end-1)-md.geometry.thickness)*100; % [cm]
++	sol2 = (md.results.TransientSolution.Sealevel-md.results.TransientSolution.Bed)*1000;	% [mm]
+ 
+ 	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
+ 	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+@@ -153,7 +179,7 @@
+ 		if (kk==1)
+ 			geoshow(flipud(coastlat),flipud(coastlon),'DisplayType','polygon','FaceColor','white');
+ 		else
+-			geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor',[.5 1 .5]);
++			geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor','none');
+ 		end
+ 		plot(coastlon, coastlat,'k'); hold off;
+ 		c1=colorbar;
+@@ -166,8 +192,8 @@
+ 		set(gcf,'color','w');
+ 		%export_fig(fig_name{kk});
+ 	end
+-end
+-if any(steps==6)
++end % }}} 
++if any(steps==6) % {{{
+ 	disp('   Step 6: Transient run');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+@@ -200,8 +226,8 @@
+ 	md=solve(md,'tr');
+ 
+ 	save ./Models/SlrGRACE_Transient md;
+-end
+-if any(steps==7)
++end % }}} 
++if any(steps==7) % {{{ 
+ 	disp('   Step 7: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+@@ -283,4 +309,5 @@
+ 	ylabel('GMSL [mm/yr]');
+ 	set(gcf,'color','w');
+ 	%export_fig('Fig7.pdf');
+-end
++end % }}} 
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26258-26259.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26258-26259.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26258-26259.diff	(revision 26740)
@@ -0,0 +1,103 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26258)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26259)
+@@ -1,7 +1,7 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1:7];
++steps=[6:7];
+ 
+ if any(steps==1) % {{{ 
+ 	disp('   Step 1: Global mesh creation');
+@@ -141,7 +141,7 @@
+ 	sol1 = (md.masstransport.spcthickness(1:end-1)-md.geometry.thickness)*100; % [cm]
+ 	sol2 = (md.results.TransientSolution.Sealevel-md.results.TransientSolution.Bed)*1000;	% [mm]
+ 
+-	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
++	sol_name={'Change in water equivalent height [cm]', 'Relative sea level [mm]'};
+ 	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+ 
+ 	res = 1.0;
+@@ -199,29 +199,36 @@
+ 
+ 	disp('Projecting  loads onto the mesh...');
+ 	time_range = 2007 + [15 350]/365;
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
++	onvertex = 1; % map data on vertex. If 0, it maps on the elemental centroid. 
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2),onvertex);
++	rho_water2ice = md.materials.rho_freshwater/md.materials.rho_ice; 
++	ice_load = water_load*rho_water2ice; % ice height equivalent. 
+ 
+-	[ne,nt]=size(water_load);
+-	md.solidearth.surfaceload.icethicknesschange = zeros(ne+1,nt);
+-	md.solidearth.surfaceload.icethicknesschange(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+-	md.solidearth.surfaceload.icethicknesschange(ne+1,:)=[1:nt]; % times
++	% masstransport evalulates diff between the successive times, so we should cumsum. 
++	num_time = size(ice_load,2); 
++	md.masstransport.spcthickness = [md.geometry.thickness + ice_load];
++	md.masstransport.spcthickness(md.mesh.numberofvertices+1,:)=[0:num_time-1]; 
+ 
++	%Physics 
+ 	md.transient.issmb=0;
+-	md.transient.ismasstransport=0;
+ 	md.transient.isstressbalance=0;
+ 	md.transient.isthermal=0;
+-	md.transient.isgia=1;	md.transient.isslr=1;
++	md.transient.ismasstransport=1;
++	md.transient.isslc=1;
+ 
+-	md.timestepping.start_time=-1;
+-	md.timestepping.final_time=nt;
++	md.solidearth.settings.rigid=1;
++	md.solidearth.settings.elastic=1;
++	md.solidearth.settings.rotation=1;
++	
++	%time stepping:
++	md.timestepping.start_time=0;
+ 	md.timestepping.time_step=1;
+-	md.timestepping.interp_forcing=0;
+-	md.settings.output_frequency=1;
++	md.timestepping.final_time=num_time; 
+ 
+ 	md.cluster=generic('name',oshostname(),'np',3);
+ 	md.verbose=verbose('111111111');
+ 
+-	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
++	md.solidearth.requested_outputs = {'Sealevel','Bed'};
+ 
+ 	md=solve(md,'tr');
+ 
+@@ -231,16 +238,16 @@
+ 	disp('   Step 7: Plot transient');
+ 	md = loadmodel('./Models/SlrGRACE_Transient');
+ 
+-	time = md.solidearth.surfaceload.icethicknesschange(end,:);
++	time = md.masstransport.spcthickness(end,:);
+ 
+ 	for tt=1:length(time)
+-		gmsl(tt) = md.results.TransientSolution(tt).Bslr*1000; % GMSL rate mm/yr
+-		sol1(:,tt) = md.solidearth.surfaceload.icethicknesschange(1:end-1,tt)*100;	% ice equivalent height [cm/yr]
+-		sol2(:,tt) = md.results.TransientSolution(tt+1).SealevelRSL*1000;	% mm/yr
++		gmsl(tt) = md.results.TransientSolution(tt).Bslc*1000; % [mm]
++		sol1(:,tt) = (md.masstransport.spcthickness(1:end-1,tt)-md.geometry.thickness)*100; % [cm]
++		sol2(:,tt) = (md.results.TransientSolution(tt).Sealevel-md.results.TransientSolution(tt).Bed)*1000;	% [mm]
+ 	end
+-	sol_name = {'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
++	sol_name = {'Change in water equivalent height [cm]', 'Relative sea level [mm]'};
+ 	movie_name = {'Movie_dH.mp4','Movie_slr.mp4'};
+-
++	
+ 	res = 1.0;
+ 
+ 	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
+@@ -283,7 +290,7 @@
+ 			if (kk==1)
+ 				geoshow(flipud(coastlat),flipud(coastlon),'DisplayType','polygon','FaceColor','white');
+ 			else
+-				geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor','white');
++				geoshow(coastlat,coastlon,'DisplayType','polygon','FaceColor','none');
+ 			end
+ 			plot(coastlon,coastlat,'k'); hold off;
+ 			c1=colorbar;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26259-26260.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26259-26260.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26259-26260.diff	(revision 26740)
@@ -0,0 +1,310 @@
+Index: ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(revision 26259)
++++ ../trunk-jpl/examples/SlrGRACE_NIMS/runme.m	(nonexistent)
+@@ -1,305 +0,0 @@
+-clear all;
+-addpath('../Data','../Functions');
+-
+-steps=[8];
+-
+-if any(steps==1) 
+-	disp('   Step 1: Global mesh creation');
+-
+-	resolution=300;			% [km]
+-	radius = 6.371012*10^3;	% [km]
+-
+-	md=model;
+-	md.mesh=gmshplanet('radius',radius,'resolution',resolution);
+-
+-	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+-	pos = find(ocean_mask==0); 
+-	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
+-	md.mask.ocean_levelset(pos)=1; 
+-
+-	save ./Models/SlrGRACE_Mesh md;
+-
+-	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end 
+-
+-if any(steps==2) 
+-	disp('   Step 2: Global mesh creation: refined coastlines');
+-
+-	numrefine=1;
+-	resolution=150*1e3;			% inital resolution [m]
+-	radius = 6.371012*10^6;		% mean radius of Earth, m
+-	mindistance_coast=150*1e3;	% coastal resolution [m]
+-	mindistance_source=75*1e3;	% source resolution [m]
+-	mindistance_land=300*1e3;	% resolution on the continents [m]
+-	maxdistance=600*1e3;		% max element size (on mid-oceans) [m]
+-
+-	md=model;
+-	md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3); % attributes in [km]
+-
+-	for i=1:numrefine,
+-
+-		ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+-
+-		distance=zeros(md.mesh.numberofvertices,1);
+-
+-		pos=find(~ocean_mask);	coaste.lat=md.mesh.lat(pos);	coaste.long=md.mesh.long(pos); 
+-		pos=find(ocean_mask);	coasto.lat=md.mesh.lat(pos);	coasto.long=md.mesh.long(pos); 
+-
+-		for j=1:md.mesh.numberofvertices
+-			phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi;
+-			if ocean_mask(j),
+-				phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi;
+-				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+-				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+-			else
+-				phi2=coasto.lat/180*pi; lambda2=coasto.long/180*pi;
+-				deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1);
+-				d=radius*2*asin(sqrt(sin(deltaphi/2).^2+cos(phi1).*cos(phi2).*sin(deltalambda/2).^2));
+-			end
+-			distance(j)=min(d);
+-		end
+-		pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast;
+-		
+-		pos2=find(ocean_mask~=1 & distance>mindistance_land);
+-		distance(pos2)=mindistance_land;
+-
+-		domain = 'Greenland'; %'Antarctica'; %'HMA'; %'Alaska'; %'Glaciers'
+-		mask = domain_mask(md.mesh.lat,md.mesh.long,domain); 
+-		distance(mask>0)=mindistance_source;
+-
+-		dist=min(maxdistance,distance);
+-		md.mesh=gmshplanet('radius',radius*1e-3,'resolution',resolution*1e-3,'refine',md.mesh,'refinemetric',dist);
+-	end
+-
+-	ocean_mask=gmtmask(md.mesh.lat,md.mesh.long);
+-	pos = find(ocean_mask==0); 
+-	md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 
+-	md.mask.ocean_levelset(pos)=1; 
+-
+-	save ./Models/SlrGRACE_Mesh_refined md;
+-
+-	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end 
+-
+-if any(steps==3) 
+-	disp('   Step 3: Define loads in meters of ice height equivalent');
+-	md = loadmodel('./Models/SlrGRACE_Mesh_refined');
+-
+-	year_month = 2007+15/365;
+-	time_range = [year_month year_month];
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+-
+-	index = md.mesh.elements;
+-	lat=90-md.mesh.lat;
+-	lon=md.mesh.long;
+-	lon(lon<0)=180+(180+lon(lon<0));
+-
+-	ax_0=lat(index(:,1)); ay_0=lon(index(:,1));
+-	bx_0=lat(index(:,2)); by_0=lon(index(:,2));
+-	cx_0=lat(index(:,3)); cy_0=lon(index(:,3));
+-
+-	for ii=1:md.mesh.numberofelements
+-		if (min([ay_0(ii),by_0(ii),cy_0(ii)])==0 && max([ay_0(ii),by_0(ii),cy_0(ii)])>180)
+-			if ay_0(ii)==0
+-				ay_0(ii)=360;
+-			end
+-			if by_0(ii)==0
+-				by_0(ii)=360;
+-			end
+-			if cy_0(ii)==0
+-				cy_0(ii)=360;
+-			end
+-		end
+-	end
+-
+-	ay_0(ax_0==0)=(by_0(ax_0==0)+cy_0(ax_0==0))./2;
+-	by_0(bx_0==0)=(cy_0(bx_0==0)+ay_0(bx_0==0))./2;
+-	cy_0(cx_0==0)=(ay_0(cx_0==0)+by_0(cx_0==0))./2;
+-
+-	ay_0(ax_0==180)=(by_0(ax_0==180)+cy_0(ax_0==180))./2;
+-	by_0(bx_0==180)=(cy_0(bx_0==180)+ay_0(bx_0==180))./2;
+-	cy_0(cx_0==180)=(ay_0(cx_0==180)+by_0(cx_0==180))./2;
+-
+-	lat_element=(ax_0+bx_0+cx_0)/3;
+-	lon_element=(ay_0+by_0+cy_0)/3;
+-
+-	lat_element_0 = 90-lat_element;	lon_element_0 = lon_element;
+-	lon_element_0(lon_element>180) = (lon_element(lon_element>180)-180) - 180;
+-
+-	domain = 'Greenland'; %'HMA'; %'Alaska'; %'Antarctica'; %'Glaciers';
+-	mask = domain_mask(lat_element_0,lon_element_0,domain); 
+-
+-	md.solidearth.surfaceload.icethicknesschange = mask.*water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+-
+-	save ./Models/SlrGRACE_Loads md;
+-
+-	plotmodel(md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 90],'title','Ice height equivalent [m]');
+-end 
+-
+-if any(steps==4) 
+-	disp('   Step 4: Parameterization');
+-	md = loadmodel('./Models/SlrGRACE_Loads');
+-
+-	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+-
+-	md.mask.ice_levelset=-md.mask.ocean_levelset; 
+-
+-	md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-	md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+-	md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-	md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
+-
+-	md.solidearth.settings.ocean_area_scaling=1;
+-
+-	% arbitary to pass consistency check. 
+-	md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+-	md.geometry.surface=ones(md.mesh.numberofvertices,1);
+-	md.geometry.base=md.geometry.bed; 
+-	md.geometry.thickness=md.geometry.surface-md.geometry.base; 
+-
+-	md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+-	md.materials.rheology_B=paterson(md.initialization.temperature);
+-	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-
+-	md.miscellaneous.name='SlrGRACE';
+-
+-	save ./Models/SlrGRACE_Parameterization md;
+-end 
+-
+-if any(steps==5) 
+-	disp('   Step 5: Solve Slr solver');
+-	md = loadmodel('./Models/SlrGRACE_Parameterization');
+-
+-	md.solidearth.settings.rigid=1;
+-	md.solidearth.settings.elastic=1;
+-	md.solidearth.settings.rotation=1;
+-
+-	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
+-
+-	md.cluster=generic('name',oshostname(),'np',3);
+-	md.verbose=verbose('111111111');
+-
+-	md=solve(md,'Slr');
+-
+-	save ./Models/SlrGRACE_Solution md;
+-end 
+-
+-if any(steps==6) 
+-	disp('   Step 6: Plot solutions');
+-	md = loadmodel('./Models/SlrGRACE_Solution');
+-
+-	sol1 = md.solidearth.surfaceload.icethicknesschange*100;						% [cm]
+-	sol2 = md.results.SealevelriseSolution.SealevelRSL*1000;	% [mm]
+-
+-	sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'};
+-	fig_name={'Fig_dH.pdf','Fig_slr.pdf'};
+-
+-	res = 1.0;
+-
+-	[lat_grid, lon_grid] = meshgrid(linspace(-90,90,180/res), linspace(-180,180,360/res));
+-	sol_grid = zeros(size(lat_grid));
+-
+-	for kk=1:2
+-		sol=eval(sprintf('sol%d',kk));
+-
+-		if length(sol)==md.mesh.numberofelements
+-			for jj=1:md.mesh.numberofelements
+-				ii=(jj-1)*3;
+-				pp(ii+1:ii+3)=md.mesh.elements(jj,:);
+-			end
+-			for jj=1:md.mesh.numberofvertices
+-				pos=ceil(find(pp==jj)/3);
+-				temp(jj)=mean(sol(pos));
+-			end
+-			sol=temp';
+-		end
+-
+-		F = scatteredInterpolant(md.mesh.lat,md.mesh.long,sol);
+-		F.Method = 'linear';
+-		F.ExtrapolationMethod = 'linear';
+-		
+-		sol_grid = F(lat_grid, lon_grid);
+-		sol_grid(isnan(sol_grid))=0;
+-		sol_grid(lat_grid>85 & sol_grid==0) = NaN;
+-
+-		set(0,'DefaultAxesFontSize',18,'DefaultAxesLineWidth',1,'DefaultTextFontSize',18,'DefaultLineMarkerSize',8)
+-		figure1=figure('Position', [100, 100, 1000, 500]);
+-		gcf; load coast; cla;
+-		pcolor(lon_grid,lat_grid,sol_grid); shading flat; hold on;
+-		if (kk==1)
+-			geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','white');
+-		else
+-			geoshow(lat,long,'DisplayType','polygon','FaceColor',[0.75 0.75 0.75]);
+-		end
+-		plot(long,lat,'k'); hold off;
+-		c1=colorbar;
+-		colormap('haxby');
+-		caxis([-floor(min(abs(min(sol)),abs(max(sol)))) floor(min(abs(min(sol)),abs(max(sol))))]);
+-		xlim([-180 180]);
+-		ylim([-90 90]);
+-		grid on;
+-		title(sol_name(kk));
+-		set(gcf,'color','w');
+-		%export_fig(fig_name{kk});
+-	end
+-end 
+-
+-if any(steps==7) 
+-	disp('   Step 7: Transient run');
+-	md = loadmodel('./Models/SlrGRACE_Parameterization');
+-
+-	disp('Projecting  loads onto the mesh...');
+-	%time_range = [2005+15/365 2014+350/365];
+-	time_range = 2007 + [15 350]/365;
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
+-
+-	[ne,nt]=size(water_load);
+-	md.solidearth.surfaceload.icethicknesschange = zeros(ne+1,nt);
+-	md.solidearth.surfaceload.icethicknesschange(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;
+-	md.solidearth.surfaceload.icethicknesschange(ne+1,:)=[1:nt]; % times
+-
+-	md.transient.issmb=0;
+-	md.transient.ismasstransport=0;
+-	md.transient.isstressbalance=0;
+-	md.transient.isthermal=0;
+-	md.transient.isslr=1;
+-	md.transient.isgia=1;
+-
+-	md.timestepping.start_time=-1;
+-	md.timestepping.final_time=nt;
+-	md.timestepping.time_step=1;
+-	md.timestepping.interp_forcing=0;
+-	md.settings.output_frequency=1;
+-
+-	md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'};
+-	
+-	md.cluster=generic('name',oshostname(),'np',3);
+-	md.verbose=verbose('111111111');
+-
+-	md=solve(md,'tr');
+-
+-	save ./Models/SlrGRACE_Transient md;
+-end 
+-
+-if any(steps==8) 
+-	disp('   Step 8: Plot transient');
+-	md = loadmodel('./Models/SlrGRACE_Transient');
+-
+-	time = md.solidearth.surfaceload.icethicknesschange(end,:);
+-
+-	tide_x = 37+29/60;	% degree N
+-	tide_y = 126+20/60;	% degree E
+-
+-	for tt=1:length(time)
+-		gmsl(tt) = md.results.TransientSolution(tt).Bslr*1000;
+-		sol = md.results.TransientSolution(tt+1).SealevelRSL*1000;
+-		slr_incheon(tt) = griddata(md.mesh.lat,md.mesh.long,sol,tide_x,tide_y);
+-	end
+-
+-	plot(2005+time/12,gmsl-gmsl(1),'-*','linewidth',3); grid on; hold on;
+-	plot(2005+time/12,slr_incheon-slr_incheon(1),'-*r','linewidth',3); hold off;
+-	xlabel('Year');
+-	ylabel('GMSL [mm]');
+-	set(gcf,'color','w');
+-	legend('GMSL','Incheon');
+-end 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26260-26261.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26260-26261.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26260-26261.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26260)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26261)
+@@ -241,7 +241,7 @@
+ 	time = md.masstransport.spcthickness(end,:);
+ 
+ 	for tt=1:length(time)
+-		gmsl(tt) = md.results.TransientSolution(tt).Bslc*1000; % [mm]
++		gmsl(tt) = md.results.TransientSolution(tt).CumBslc*1000; % [mm]
+ 		sol1(:,tt) = (md.masstransport.spcthickness(1:end-1,tt)-md.geometry.thickness)*100; % [cm]
+ 		sol2(:,tt) = (md.results.TransientSolution(tt).Sealevel-md.results.TransientSolution(tt).Bed)*1000;	% [mm]
+ 	end
+@@ -295,7 +295,7 @@
+ 			plot(coastlon,coastlat,'k'); hold off;
+ 			c1=colorbar;
+ 			colormap('haxby');
+-			caxis([-floor(min(abs(min(min(sol))),abs(max(max(sol))))) floor(min(abs(min(min(sol))),abs(max(max(sol)))))]);
++			%caxis([-floor(min(abs(min(min(sol))),abs(max(max(sol))))) floor(min(abs(min(min(sol))),abs(max(max(sol)))))]);
+ 			xlim([-180 180]);
+ 			ylim([-90 90]);
+ 			grid on;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26261-26262.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26261-26262.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26261-26262.diff	(revision 26740)
@@ -0,0 +1,125 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(nonexistent)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26262)
+@@ -0,0 +1,89 @@
++#--------------------#
++# ISSM Configuration #
++#--------------------#
++
++MATLAB_PATH="/Applications/MATLAB_R2018a.app"
++
++ISSM_CONFIG='\
++	--prefix=${ISSM_DIR} \
++	--disable-static \
++	--enable-development \
++	--enable-debugging \
++	--with-numthreads=4 \
++	--with-matlab-dir=${MATLAB_PATH} \
++	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
++	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
++	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
++	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-metis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-parmetis-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-scalapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
++	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
++	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
++	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
++	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
++	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
++	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
++'
++
++#-------------------#
++# External Packages #
++#-------------------#
++
++#List of external pakages to be installed and their installation scripts
++EXTERNALPACKAGES="
++	autotools	install-mac.sh
++	cmake		install.sh
++	petsc		install-3.12-mac.sh
++	gsl			install.sh
++	boost		install-1.7-mac.sh
++	dakota		install-6.2-mac.sh
++	curl		install-7-mac.sh
++	netcdf		install-4.7-parallel.sh
++	proj		install-6.2.sh
++	gdal		install-3-python.sh
++	gshhg		install.sh
++	gmt			install-6-mac.sh
++	gmsh		install-4.sh
++	triangle	install-mac.sh
++	chaco		install.sh
++	m1qn3		install.sh
++	semic		install.sh
++	shell2junit	install.sh
++"
++
++#---------#
++# Testing #
++#---------#
++
++# Test suites
++MATLAB_TEST=1
++PYTHON_TEST=1
++JAVASCRIPT_TEST=0
++EXAMPLES_TEST=0
++
++# Number of CPUs used in ISSM compilation
++#
++# NOTE: One is usually safer as some packages are very sensitive to parallel
++# 		compilation
++#
++NUMCPUS_INSTALL=4
++
++# Number of CPUs used in the nightly runs
++NUMCPUS_RUN=2
++
++# Nightly run options
++#
++# See documentation in test/NightlyRun/runme.* for more information.
++#
++# NOTE:
++# - Excluding 2006 until it can be debugged (file I/O)
++#
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2006]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2005 2006"
+
+Property changes on: ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26261)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26262)
+@@ -85,5 +85,5 @@
+ # NOTE:
+ # - Excluding 2006 until it can be debugged (file I/O)
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2006]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2005 2006"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26261)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26262)
+@@ -90,5 +90,5 @@
+ # generated on macOS).
+ # - Excluding 2006 until it can be debugged (PETSc crash)
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2005 2006 2010 2021 2101]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2005 2006 2010 2021 2101"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26262-26263.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26262-26263.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26262-26263.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26262)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26263)
+@@ -1,7 +1,7 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[6:7];
++steps=[1:7];
+ 
+ if any(steps==1) % {{{ 
+ 	disp('   Step 1: Global mesh creation');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26263-26264.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26263-26264.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26263-26264.diff	(revision 26740)
@@ -0,0 +1,70 @@
+Index: ../trunk-jpl/src/m/contrib/adhikari/wahr.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/adhikari/wahr.m	(nonexistent)
++++ ../trunk-jpl/src/m/contrib/adhikari/wahr.m	(revision 26264)
+@@ -0,0 +1,58 @@
++function [vert, horz] = wahr(disc_rad,xi,love_h,love_l); 
++% a function to compute vertical and horizontal crustal motion... 
++% ...for a disc load, inspired by Figure 1 of Wahr et al., 2013. 
++% 
++% usage: 
++%		[vert, horz] = wahr(disc_rad,xi,love_h,love_l); 
++%		
++%		vert = vertical crustal motion [m] 
++%		horz = horizontal crustal motion [m] 
++%		disc_rad = disc radius [m] => set to 20 km to replicate the Wahr experiment. 
++%		xi = grid points along the distance away from the disc center [m] 
++%		love_h = load Love numbers h for the vertical crustal motion. 
++%		love_l = load Love numbers l for the horizontal crustal motion. 
++%		
++
++	disc_rad = disc_rad/1000; % km 
++	% compute P(x), dP(x)/dx, d2P(x)/dx2
++	%---------------------------------------------------------------------
++	% compute p_value 
++	theta=km2deg(xi/1000)';
++	ang = theta/180*pi; 
++	alpha=cos(ang);
++	m=length(alpha);
++	n=length(love_h)-1; 
++	p_value = p_polynomial_value(m,n,alpha);
++	p_prime = p_polynomial_prime(m,n,alpha);
++	%---------------------------------------------------------------------
++	nn=[0:n];
++	nn_plus_1=nn+1; 
++
++	% disc radius in degree 
++	disc_rad = km2deg(disc_rad)/180*pi; 
++	tau=zeros(size(love_h)); 
++	tau(1) = 0.5*(1-cos(disc_rad)); % tau_0 
++	p_value_disc = p_polynomial_value(1,n+1,cos(disc_rad));
++	p_prime_disc = p_polynomial_prime(1,n,cos(disc_rad));
++	for jj=2:n+1
++		nnn = jj-1; 
++		tau(jj) = 0.5 * (p_value_disc(jj-1) - p_value_disc(jj+1)); 
++	end
++
++	const=zeros(size(love_h)); 
++	for jj=1:n+1
++		const(jj) = 1/(2*(jj-1)+1); 
++	end
++
++	disc=sum(bsxfun(@times,p_value,tau'),2); 
++
++	g1 = -sum(bsxfun(@times,p_value,(tau.*love_h.*const)'),2); 
++	g5 = -sum(bsxfun(@times,-sin(ang),bsxfun(@times,p_prime,(tau.*love_l.*const)')),2); 
++
++	% coeff 
++	coeff = 1000*4*pi*(6.67408*10^-11)*(6.3781*10^6)/9.81; 
++
++	% vertical and horizontal solutions in mm 
++	vert = g1*coeff % m 
++	horz = g5*coeff; % m 
++
+
+Property changes on: ../trunk-jpl/src/m/contrib/adhikari/wahr.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26264-26265.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26264-26265.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26264-26265.diff	(revision 26740)
@@ -0,0 +1,58 @@
+Index: ../trunk-jpl/examples/Functions/wahr.m
+===================================================================
+--- ../trunk-jpl/examples/Functions/wahr.m	(revision 26264)
++++ ../trunk-jpl/examples/Functions/wahr.m	(nonexistent)
+@@ -1,46 +0,0 @@
+-% compute semi-analytic solutions for a disc load 
+-function [vert, horz] = wahr(disc_rad,xi,love_h,love_l); 
+-
+-	disc_rad = disc_rad/1000; % km 
+-	% compute P(x), dP(x)/dx, d2P(x)/dx2
+-	%---------------------------------------------------------------------
+-	% compute p_value 
+-	theta=km2deg(xi/1000)';
+-	ang = theta/180*pi; 
+-	alpha=cos(ang);
+-	m=length(alpha);
+-	n=length(love_h)-1; 
+-	p_value = p_polynomial_value(m,n,alpha);
+-	p_prime = p_polynomial_prime(m,n,alpha);
+-	%---------------------------------------------------------------------
+-	nn=[0:n];
+-	nn_plus_1=nn+1; 
+-
+-	% disc radius in degree 
+-	disc_rad = km2deg(disc_rad)/180*pi; 
+-	tau=zeros(size(love_h)); 
+-	tau(1) = 0.5*(1-cos(disc_rad)); % tau_0 
+-	p_value_disc = p_polynomial_value(1,n+1,cos(disc_rad));
+-	p_prime_disc = p_polynomial_prime(1,n,cos(disc_rad));
+-	for jj=2:n+1
+-		nnn = jj-1; 
+-		tau(jj) = 0.5 * (p_value_disc(jj-1) - p_value_disc(jj+1)); 
+-	end
+-
+-	const=zeros(size(love_h)); 
+-	for jj=1:n+1
+-		const(jj) = 1/(2*(jj-1)+1); 
+-	end
+-
+-	disc=sum(bsxfun(@times,p_value,tau'),2); 
+-
+-	g1 = -sum(bsxfun(@times,p_value,(tau.*love_h.*const)'),2); 
+-	g5 = -sum(bsxfun(@times,-sin(ang),bsxfun(@times,p_prime,(tau.*love_l.*const)')),2); 
+-
+-	% coeff 
+-	coeff = 1000*4*pi*(6.67408*10^-11)*(6.3781*10^6)/9.81; 
+-
+-	% vertical and horizontal solutions in mm 
+-	vert = g1*coeff*1000; % mm 
+-	horz = g5*coeff*1000; % mm 
+-
+
+Property changes on: ../trunk-jpl/examples/Functions/wahr.m
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26265-26266.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26265-26266.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26265-26266.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/contrib/adhikari/wahr.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/adhikari/wahr.m	(revision 26265)
++++ ../trunk-jpl/src/m/contrib/adhikari/wahr.m	(revision 26266)
+@@ -52,7 +52,7 @@
+ 	% coeff 
+ 	coeff = 1000*4*pi*(6.67408*10^-11)*(6.3781*10^6)/9.81; 
+ 
+-	% vertical and horizontal solutions in mm 
++	% vertical and horizontal solutions
+ 	vert = g1*coeff % m 
+ 	horz = g5*coeff; % m 
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26266-26267.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26266-26267.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26266-26267.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/contrib/adhikari/wahr.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/adhikari/wahr.m	(revision 26266)
++++ ../trunk-jpl/src/m/contrib/adhikari/wahr.m	(revision 26267)
+@@ -53,6 +53,6 @@
+ 	coeff = 1000*4*pi*(6.67408*10^-11)*(6.3781*10^6)/9.81; 
+ 
+ 	% vertical and horizontal solutions
+-	vert = g1*coeff % m 
++	vert = g1*coeff; % m 
+ 	horz = g5*coeff; % m 
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26267-26268.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26267-26268.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26267-26268.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26267)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26268)
+@@ -89,6 +89,7 @@
+ md.solidearth.settings.rigid=0;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ 
+ md=solve(md,'Transient');
+ Seustatic=md.results.TransientSolution.Sealevel;
+@@ -98,6 +99,7 @@
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ md=solve(md,'tr');
+ Srigid=md.results.TransientSolution.Sealevel;
+ Brigid=md.results.TransientSolution.Bed;
+@@ -106,6 +108,7 @@
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ md=solve(md,'tr');
+ Selastic=md.results.TransientSolution.Sealevel;
+ Belastic=md.results.TransientSolution.Bed;
+@@ -114,6 +117,7 @@
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
++md.solidearth.settings.viscous=0;
+ md=solve(md,'tr');
+ Srotation=md.results.TransientSolution.Sealevel;
+ Brotation=md.results.TransientSolution.Bed;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26268-26269.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26268-26269.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26268-26269.diff	(revision 26740)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26268)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26269)
+@@ -84,6 +84,7 @@
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+ %md.verbose=verbose('111111111');
+ md=solve(md,'Transient');
+@@ -96,6 +97,7 @@
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
++md.solidearth.settings.viscous=0;
+ md.cluster=generic('name',oshostname(),'np',3);
+ %md.verbose=verbose('111111111');
+ md=solve(md,'Transient');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26269-26270.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26269-26270.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26269-26270.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26269)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26270)
+@@ -85,5 +85,5 @@
+ # NOTE:
+ # - Excluding 2006 until it can be debugged (file I/O)
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26269)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26270)
+@@ -90,5 +90,5 @@
+ # generated on macOS).
+ # - Excluding 2006 until it can be debugged (PETSc crash)
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
+Index: ../trunk-jpl/test/Archives/Archive2002.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2003.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26270-26271.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26270-26271.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26270-26271.diff	(revision 26740)
@@ -0,0 +1,869 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26270)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26271)
+@@ -1277,7 +1277,7 @@
+ 	*pswf=swf;
+ 
+ } /*}}}*/ 
+-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble T_air, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid){ /*{{{*/
++void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* pRa, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble T_air, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid){ /*{{{*/
+ 
+ 	// Adds precipitation and deposition to the model grid
+ 
+@@ -1293,10 +1293,11 @@
+ 		C =  average accumulation rate [kg m-2 yr-1]
+ 	   dz = topgrid cell length [m]
+ 	   d = density of top grid gell [kg m-3]
+-	   P = precipitation [mm w.e.] or [kg m-3]
+-	   re = effective grain radius [mm]
+-	   gdn = grain dentricity
+-	   gsp = grain sphericity*/
++		P = precipitation [mm w.e.] or [kg m-3]
++		Ra = rainfall [mm w.e.] or [kg m-3]
++		re = effective grain radius [mm]
++		gdn = grain dentricity
++		gsp = grain sphericity*/
+ 
+ 	// MAIN FUNCTION
+ 	// specify constants
+@@ -1322,6 +1323,7 @@
+ 	IssmDouble* re=NULL;
+ 	IssmDouble* gdn=NULL;
+ 	IssmDouble* gsp=NULL;
++	IssmDouble  ra=0.0;
+ 	int         m=0;
+ 
+ 	if(VerboseSmb() && sid==0 && IssmComm::GetRank()==0)_printf0_("   accumulation module\n");
+@@ -1337,6 +1339,7 @@
+ 	gdn=*pgdn;
+ 	gsp=*pgsp;
+ 	m=*pm;
++	ra=*pRa;
+ 
+ 	//Density of fresh snow [kg m-3]
+ 	switch (dsnowIdx){
+@@ -1438,6 +1441,8 @@
+ 				d[0] = dIce;           // adjust d
+ 				dz[0] = mass / d[0];    // dz is adjusted to conserve mass
+ 			}
++
++			ra=P;
+ 		}
+ 
+ 		// check for conservation of mass
+@@ -1465,8 +1470,9 @@
+ 	*pgdn=gdn;
+ 	*pgsp=gsp;
+ 	*pm=m;
++	*pRa=ra;
+ } /*}}}*/
+-void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid){ /*{{{*/
++void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pF, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble Ra, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid){ /*{{{*/
+ 
+ 	//// MELT ROUTINE
+ 
+@@ -1487,7 +1493,7 @@
+ 	IssmDouble* EI=NULL;
+ 	IssmDouble* EW=NULL;
+ 	IssmDouble* M=NULL;
+-	int*       D=NULL;
++	int*        D=NULL;
+ 
+ 	IssmDouble sumM=0.0;
+ 	IssmDouble sumER=0.0;
+@@ -1531,8 +1537,9 @@
+ 	IssmDouble  mAdd = 0.0;
+ 	IssmDouble  surplusE = 0.0;
+ 	IssmDouble  surplusT = 0.0;
+-	IssmDouble dz_add = 0.0;
++	IssmDouble  dz_add = 0.0;
+ 	IssmDouble  Rsum = 0.0;
++	IssmDouble  Fsum = 0.0;
+ 	IssmDouble* T=*pT;
+ 	IssmDouble* d=*pd;
+ 	IssmDouble* dz=*pdz;
+@@ -1564,6 +1571,7 @@
+ 
+ 	// initialize melt and runoff scalars
+ 	Rsum = 0.0;       // runoff [kg]
++	Fsum = 0.0;       // refreeze [kg]
+ 	sumM = 0.0;       // total melt [kg]
+ 	mAdd = 0.0;       // mass added/removed to/from base of model [kg]
+ 	addE = 0.0;       // energy added/removed to/from base of model [J]
+@@ -1609,7 +1617,16 @@
+ 	}
+ 
+ 	//// MELT, PERCOLATION AND REFREEZE
++	
++	// initialize refreeze, runoff, flxDn and dW vectors [kg]
++	IssmDouble* F = xNewZeroInit<IssmDouble>(n);
+ 
++	// Add previous refreeze to F and reset dW
++	for(int i=0;i<n;i++){
++		F[i]=F[i]+dW[i];
++		dW[i] = 0.0;
++	}
++
+ 	// run melt algorithm if there is melt water or excess pore water
+ 	if ((cellsum(exsT,n) > 0.0+Ttol) || (cellsum(exsW,n) > 0.0+Wtol)){
+ 		// _printf_(""MELT OCCURS");
+@@ -1659,16 +1676,14 @@
+ 			M[i] = min(Mmax, m[i]);  // melt
+ 		}
+ 		Msurf = M[0];
+-		sumM = cellsum(M,n);                                                       // total melt [kg]
++		sumM = max(0.0,cellsum(M,n)-Ra);  // total melt [kg] minus the liquid rain that had been added
+ 
+ 		// calculate maximum refreeze amount, maxF [kg]
+ 		for(int i=0;i<n;i++)maxF[i] = max(0.0, -((T[i] - CtoK) * d[i] * dz[i] * CI)/ LF);
+ 
+ 		// initialize refreeze, runoff, flxDn and dW vectors [kg]
+- 		IssmDouble* F = xNewZeroInit<IssmDouble>(n);
+ 		IssmDouble* R = xNewZeroInit<IssmDouble>(n);
+ 
+-		for(int i=0;i<n;i++)dW[i] = 0.0;
+ 		flxDn=xNewZeroInit<IssmDouble>(n+1);
+ 
+ 		// determine the deepest grid cell where melt/pore water is generated
+@@ -1681,6 +1696,7 @@
+ 		}
+ 
+ 		IssmDouble depthice=0.0;
++		int Xi=0;
+ 		//// meltwater percolation
+ 		for(int i=0;i<n;i++){
+ 			// calculate total melt water entering cell
+@@ -1690,7 +1706,7 @@
+ 			if (d[i] >= dPHC-Dtol){
+ 				for(int l=i;(l<n && d[l]>=dPHC-Dtol);l++) depthice=depthice+dz[l];
+ 			}
+-
++			
+ 			// break loop if there is no meltwater and if depth is > mw_depth
+ 			if (fabs(inM) < Wtol && i > X){
+ 				break;
+@@ -1706,7 +1722,6 @@
+ 				Wi = (dIce-d[i]) * Swi * (m[i]/d[i]);    // irreducible water 
+ 				dW[i] = max(min(inM, Wi - W[i]),-1*W[i]);            // change in pore water
+ 				R[i] = max(0.0, inM - dW[i]);             // runoff
+-				F[i] = 0.0;
+ 			}
+ 			// check if no energy to refreeze meltwater
+ 			else if (fabs(maxF[i]) < Dtol){
+@@ -1719,7 +1734,6 @@
+ 				dW[i] = max(min(inM, Wi - W[i]),-1*W[i]);              // change in pore water
+ 				flxDn[i+1] = max(0.0, inM - dW[i]);         // meltwater out
+ 				R[i] = 0.0;
+-				F[i] = 0.0;                               // no freeze 
+ 			}
+ 			// some or all meltwater refreezes
+ 			else{
+@@ -1735,10 +1749,7 @@
+ 
+ 				//-----------------------pore water-----------------------------
+ 				Wi = (dIce-d[i])* Swi * dz_0;            // irreducible water 
+-				dW[i] = min(inM - F1, Wi-W[i]);         // change in pore water
+-				if (dW[i] < 0.0-Wtol && -1*dW[i]> W[i]-Wtol ){
+-					dW[i]= -1*W[i];
+-				}
++				dW[i] = max(min(inM - F1, Wi-W[i]),-1*W[i]);         // change in pore water
+ 				IssmDouble F2 = 0.0;                                 
+ 
+ 				if (dW[i] < 0.0-Wtol){                         // excess pore water
+@@ -1747,12 +1758,11 @@
+ 					F2 = min(-1*dW[i], maxF2);            // pore water refreeze
+ 					m[i] = m[i] + F2;                   // mass after refreeze
+ 					d[i] = m[i]/dz_0;
+-					dW[i] = dW[i] - F2;
+ 				}
+ 
+-				F[i] = F1 + F2;
++				F[i] = F[i] + F1 + F2;
+ 
+-				flxDn[i+1] = inM - F1 - dW[i];     // meltwater out        
++				flxDn[i+1] = max(0.0,inM - F1 - dW[i]);     // meltwater out        
+ 				if (m[i]>Wtol){
+ 					T[i] = T[i] + ((F1+F2)*(LF+(CtoK - T[i])*CI)/(m[i]*CI));// change in temperature
+ 				}
+@@ -1766,6 +1776,7 @@
+ 					flxDn[i+1] = 0.0;
+ 				}
+ 			}
++			Xi=Xi+1;
+ 		}
+ 
+ 		//// GRID CELL SPACING AND MODEL DEPTH
+@@ -1776,7 +1787,7 @@
+ 		for(int i=0;i<n;i++)W[i] += dW[i];
+ 
+ 		//calculate Rsum:
+-		Rsum=cellsum(R,n) + flxDn[n];
++		Rsum=cellsum(R,n) + flxDn[Xi];
+ 
+ 		// delete all cells with zero mass
+ 		D_size=0; for(int i=0;i<n;i++)if(m[i]> (0.0+Wtol))D_size++; 
+@@ -1802,10 +1813,15 @@
+ 		for(int i=0;i<n;i++)dz[i] = m[i] / d[i];
+ 
+ 		/*Free resources:*/
+-		xDelete<IssmDouble>(F);
+ 		xDelete<IssmDouble>(R);
+ 	}
+ 
++	//calculate Fsum:
++	Fsum=cellsum(F,n);
++
++	/*Free resources:*/
++	xDelete<IssmDouble>(F);
++
+ 	//Merging of cells as they are burried under snow.
+ 	Zcum=xNew<IssmDouble>(n);
+ 	dzMin2=xNew<IssmDouble>(n);
+@@ -2039,6 +2055,7 @@
+ 	*pMs=Msurf;
+ 	*pM=sumM;
+ 	*pR=Rsum;
++	*pF=Fsum;
+ 	*pmAdd=mAdd;
+ 	*pdz_add=dz_add;
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26270)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26271)
+@@ -32,8 +32,8 @@
+ void albedo(IssmDouble** a, IssmDouble** adiff, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
+ void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble dswdiff, IssmDouble as, IssmDouble asdiff, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
+ void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT);
+-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
+-void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid);
++void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* pRa, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
++void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pF, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble Ra, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid);
+ void densification(IssmDouble** pd,IssmDouble** pdz, IssmDouble* T, IssmDouble* re, int denIdx, int aIdx, int swIdx, IssmDouble adThresh, IssmDouble C, IssmDouble dt, IssmDouble Tmean, IssmDouble dIce, int m, int sid);
+ void turbulentFlux(IssmDouble* pshf, IssmDouble* plhf, IssmDouble* pEC, IssmDouble Ta, IssmDouble Ts, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble ds, IssmDouble Ws, IssmDouble Vz, IssmDouble Tz, IssmDouble dIce, int sid);
+ #endif  /* _SurfaceMassBalancex_H*/
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26270)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26271)
+@@ -262,6 +262,8 @@
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'SmbPrecipitation'),
+ 		field = field*yts;
++	elseif strcmp(fieldname,'SmbRain'),
++		field = field*yts;
+ 	elseif strcmp(fieldname,'SmbRunoff'),
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'SmbRunoffSubstep'),
+@@ -278,6 +280,8 @@
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'SmbMAdd'),
+ 		field = field*yts;
++	elseif strcmp(fieldname,'SmbWAdd'),
++		field = field*yts;
+ 	elseif strcmp(fieldname,'CalvingCalvingrate'),
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'Calvingratex'),
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26270)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26271)
+@@ -213,6 +213,8 @@
+             field = field * yts
+         elif fieldname == 'SmbPrecipitation':
+             field = field * yts
++        elif fieldname == 'SmbRain':
++            field = field * yts
+         elif fieldname == 'SmbRunoff':
+             field = field * yts
+         elif fieldname == 'SmbRunoffSubstep':
+@@ -229,6 +231,8 @@
+             field = field * yts
+         elif fieldname == 'SmbMAdd':
+             field = field * yts
++        elif fieldname == 'SmbWAdd':
++            field = field * yts
+         elif fieldname == 'CalvingCalvingrate':
+             field = field * yts
+         elif fieldname == 'Calvingratex':
+Index: ../trunk-jpl/test/Archives/Archive243.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test243.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test243.m	(revision 26270)
++++ ../trunk-jpl/test/NightlyRun/test243.m	(revision 26271)
+@@ -29,8 +29,10 @@
+ %smb settings
+ md.smb.requested_outputs={'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC',...
+ 	'SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF',...
+-	'SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',...
+-	'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation'};
++	'SmbMeanULW','SmbNetLW','SmbNetSW','SmbWAdd','SmbRunoff','SmbRefreeze','SmbMelt',...
++	'SmbEC','SmbPrecipitation','SmbRain','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',...
++	'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain',...
++	'SmbAccumulatedPrecipitation','SmbAccumulatedRefreeze'};
+ 
+ %only run smb core: 
+ md.transient.isstressbalance=0;
+@@ -52,8 +54,8 @@
+ end
+ 
+ %Fields and tolerances to track changes
+-field_names      ={'Layers','SmbDz','SmbT' ,'SmbD' ,'SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation'};
+-field_tolerances ={1e-12,2e-12,1e-12,2e-11,1e-11,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,2e-11,2e-11,1e-11,9e-10,2e-11,1e-11,9e-10,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,};
++field_names      ={'Layers','SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain','SmbAccumulatedRefreeze','SmbRunoff','SmbMelt','SmbEC','SmbPrecipitation','SmbRain','SmbRefreeze','SmbWAdd'};
++field_tolerances ={1e-12,2e-12,1e-12,2e-11,1e-11,2e-11,1e-11,1e-12,1e-11,1e-12,1e-12,1e-12,1e-11,2e-11,2e-11,1e-11,9e-10,2e-11,1e-11,9e-10,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11};
+ 
+ field_values={...
+ 	(nlayers),...
+@@ -78,5 +80,14 @@
+ 	(md.results.TransientSolution(end).SmbAccumulatedRunoff(1)),...
+ 	(md.results.TransientSolution(end).SmbAccumulatedMelt(1)),...
+ 	(md.results.TransientSolution(end).SmbAccumulatedEC(1)),...
+-	(md.results.TransientSolution(end).SmbAccumulatedPrecipitation(1))
++	(md.results.TransientSolution(end).SmbAccumulatedPrecipitation(1)),...
++	(md.results.TransientSolution(end).SmbAccumulatedRain(1)),...
++	(md.results.TransientSolution(end).SmbAccumulatedRefreeze(1)),...
++	(md.results.TransientSolution(200).SmbRunoff(1)),...
++	(md.results.TransientSolution(200).SmbMelt(1)),...
++	(md.results.TransientSolution(200).SmbEC(1)),...
++	(md.results.TransientSolution(200).SmbPrecipitation(1)),...
++	(md.results.TransientSolution(200).SmbRain(1)),...
++	(md.results.TransientSolution(200).SmbRefreeze(1)),...
++	(md.results.TransientSolution(200).SmbWAdd(1))...
+ };
+Index: ../trunk-jpl/test/NightlyRun/test243.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test243.py	(revision 26270)
++++ ../trunk-jpl/test/NightlyRun/test243.py	(revision 26271)
+@@ -44,10 +44,12 @@
+ 
+ #smb settings
+ md.smb.requested_outputs = [
+-    'SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbEC',
+-    'SmbA', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF',
+-    'SmbMeanULW', 'SmbNetLW', 'SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',
+-    'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation'
++        'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC',
++        'SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF',
++        'SmbMeanULW','SmbNetLW','SmbNetSW','SmbWAdd','SmbRunoff','SmbRefreeze','SmbMelt',
++        'SmbEC','SmbPrecipitation','SmbRain','SmbAccumulatedMassBalance','SmbAccumulatedRunoff',
++        'SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain',
++        'SmbAccumulatedPrecipitation','SmbAccumulatedRefreeze'
+     ]
+ 
+ #only run smb core:
+@@ -69,8 +71,10 @@
+     nlayers=np.minimum(md.results.TransientSolution[i].SmbT.shape[1], nlayers)
+ 
+ #Fields and tolerances to track changes
+-field_names = ['Layers', 'SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbA', 'SmbEC', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF', 'SmbMeanULW', 'SmbNetLW', 'SmbNetSW', 'SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation']
+-field_tolerances = [1e-12, 2e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 1e-12, 1e-11, 1e-12, 1e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11]
++field_names = ['Layers','SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW','SmbAccumulatedMassBalance','SmbAccumulatedRunoff','SmbAccumulatedMelt','SmbAccumulatedEC','SmbAccumulatedPrecipitation','SmbAccumulatedRain','SmbAccumulatedRefreeze','SmbRunoff','SmbMelt','SmbEC','SmbPrecipitation','SmbRain','SmbRefreeze','SmbWAdd']
++field_tolerances = [1e-12, 2e-12, 1e-12, 2e-11, 1e-11, 2e-11, 1e-11, 1e-12, 1e-11, 1e-12, 1e-12, 1e-12, 1e-11, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 9e-10, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11]
++
++
+ # Shape is different in python solution (fixed using reshape) which can cause test failure
+ field_values = [
+     nlayers,
+@@ -95,5 +99,14 @@
+     md.results.TransientSolution[-1].SmbAccumulatedRunoff[0],
+     md.results.TransientSolution[-1].SmbAccumulatedMelt[0],
+     md.results.TransientSolution[-1].SmbAccumulatedEC[0],
+-    md.results.TransientSolution[-1].SmbAccumulatedPrecipitation[0]
++    md.results.TransientSolution[-1].SmbAccumulatedPrecipitation[0],
++    md.results.TransientSolution[-1].SmbAccumulatedRain[0],
++    md.results.TransientSolution[-1].SmbAccumulatedRefreeze[0],
++    md.results.TransientSolution[199].SmbRunoff[0],
++    md.results.TransientSolution[199].SmbMelt[0],
++    md.results.TransientSolution[199].SmbEC[0],
++    md.results.TransientSolution[199].SmbPrecipitation[0],
++    md.results.TransientSolution[199].SmbRain[0],
++    md.results.TransientSolution[199].SmbRefreeze[0],
++    md.results.TransientSolution[199].SmbWAdd[0]
+     ]
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26270)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26271)
+@@ -3620,20 +3620,24 @@
+ 	IssmDouble dayEC=0.0;
+ 	IssmDouble initMass=0.0;
+    IssmDouble sumR=0.0;
+-   IssmDouble sumM=0.0;
++	IssmDouble sumF=0.0;
++	IssmDouble sumM=0.0;
+ 	IssmDouble sumMsurf=0.0;
+-   IssmDouble sumEC=0.0;
+-   IssmDouble sumP=0.0;
+-   IssmDouble sumW=0.0;
+-   IssmDouble sumMassAdd=0.0;
++	IssmDouble sumEC=0.0;
++	IssmDouble sumP=0.0;
++	IssmDouble sumRa=0.0;
++	IssmDouble sumW=0.0;
++	IssmDouble sumMassAdd=0.0;
+ 	IssmDouble fac=0.0;
+ 	IssmDouble sumMass=0.0;
+ 	IssmDouble dMass=0.0;
+ 	IssmDouble accsumR=0.0;
++	IssmDouble accsumF=0.0;
+ 	IssmDouble accsumM=0.0;
+ 	IssmDouble accsumSMB=0.0;
+ 	IssmDouble accsumEC=0.0;
+ 	IssmDouble accsumP=0.0;
++	IssmDouble accsumRa=0.0;
+ 	bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux;
+ 	bool isconstrainsurfaceT=false;
+ 	IssmDouble init_scaling=0.0;
+@@ -3662,6 +3666,8 @@
+ 	IssmDouble  M = 0.0;
+ 	IssmDouble  Msurf = 0.0;
+ 	IssmDouble  R = 0.0;
++	IssmDouble  F = 0.0;
++	IssmDouble  Ra = 0.0;
+ 	IssmDouble  mAdd = 0.0;
+ 	IssmDouble  dz_add = 0.0;
+ 	IssmDouble* dzini=NULL;
+@@ -3801,6 +3807,8 @@
+ 		this->SetElementInput(SmbAccumulatedMassBalanceEnum,0.0);
+ 		this->SetElementInput(SmbAccumulatedMeltEnum,0.0);
+ 		this->SetElementInput(SmbAccumulatedRunoffEnum,0.0);
++		this->SetElementInput(SmbAccumulatedRefreezeEnum,0.0);
++		this->SetElementInput(SmbAccumulatedRainEnum,0.0);
+ 		this->SetElementInput(SmbAccumulatedPrecipitationEnum,0.0);
+ 
+ 		/*Flag the initialization:*/
+@@ -3829,7 +3837,7 @@
+ 	initMass=0; for(int i=0;i<m;i++) initMass += dz[i]*d[i] + W[i];
+ 
+ 	// initialize cumulative variables
+-	sumR = 0; sumM = 0; sumEC = 0; sumP = 0; sumMassAdd = 0; sumMsurf = 0;
++	sumR = 0; sumF=0; sumM = 0; sumEC = 0; sumP = 0; sumMassAdd = 0; sumMsurf = 0; sumRa = 0;
+ 
+ 	//before starting loop, realize that the transient core runs this smb_core at time = time +deltaT.
+    //go back to time - deltaT:
+@@ -3842,6 +3850,8 @@
+ 		Input *sumEC_input         = this->GetInput(SmbECEnum);  _assert_(sumEC_input);
+ 		Input *sumM_input          = this->GetInput(SmbMeltEnum);  _assert_(sumM_input);
+ 		Input *sumR_input          = this->GetInput(SmbRunoffEnum);  _assert_(sumR_input);
++		Input *sumF_input          = this->GetInput(SmbRefreezeEnum);  _assert_(sumF_input);
++		Input *sumRa_input         = this->GetInput(SmbRainEnum);  _assert_(sumRa_input);
+ 		Input *sumP_input          = this->GetInput(SmbPrecipitationEnum);  _assert_(sumP_input);
+ 		Input *ULW_input           = this->GetInput(SmbMeanULWEnum);  _assert_(ULW_input);
+ 		Input *LW_input            = this->GetInput(SmbNetLWEnum);  _assert_(LW_input);
+@@ -3870,6 +3880,10 @@
+       sumMsurf=sumMsurf*dt*rho_ice;
+ 		sumR_input->GetInputAverage(&sumR);
+ 		sumR=sumR*dt*rho_ice;
++		sumF_input->GetInputAverage(&sumF);
++		sumF=sumF*dt*rho_ice;
++		sumRa_input->GetInputAverage(&sumRa);
++		sumRa=sumRa*dt*rho_ice;
+ 		sumP_input->GetInputAverage(&sumP);
+ 		sumP=sumP*dt*rho_ice;
+ 	}
+@@ -3933,11 +3947,11 @@
+ 	dz[0] = dz[0] + EC / d[0];
+ 
+ 	/*Add snow/rain to top grid cell adjusting cell depth, temperature and density*/
+-	if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &adiff, &re, &gdn, &gsp, &m, aIdx, dsnowIdx, Tmean, Ta, P, dzMin, aSnow, C, V, Vmean, rho_ice,this->Sid());
++	if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &adiff, &re, &gdn, &gsp, &Ra, &m, aIdx, dsnowIdx, Tmean, Ta, P, dzMin, aSnow, C, V, Vmean, rho_ice,this->Sid());
+ 
+ 	/*Calculate water production, M [kg m-2] resulting from snow/ice temperature exceeding 273.15 deg K
+ 	 * (> 0 deg C), runoff R [kg m-2] and resulting changes in density and determine wet compaction [m]*/
+-	if(ismelt)melt(&M, &Msurf, &R, &mAdd, &dz_add, &T, &d, &dz, &W, &a, &adiff, &re, &gdn, &gsp, &m, dzMin, zMax, zMin, zTop, zY, rho_ice,this->Sid());
++	if(ismelt)melt(&M, &Msurf, &R, &F, &mAdd, &dz_add, &T, &d, &dz, &W, &a, &adiff, &re, &gdn, &gsp, &m, Ra, dzMin, zMax, zMin, zTop, zY, rho_ice,this->Sid());
+ 
+ 	/*Allow non-melt densification and determine compaction [m]*/
+ 	if(isdensification)densification(&d,&dz, T, re, denIdx, aIdx, swIdx, adThresh, C, smb_dt, Tmean,rho_ice,m,this->Sid());
+@@ -3982,7 +3996,9 @@
+ 	sumR = R + sumR;
+ 	sumW = cellsum(W,m);
+ 	sumP = P +  sumP;
+-	sumEC = sumEC + EC;  // evap (-)/cond(+)
++	sumEC = EC + sumEC;  // evap (-)/cond(+)
++	sumRa = Ra + sumRa;
++	sumF = F + sumF;
+ 
+ 	/*Calculate total system mass:*/
+ 	sumMass=0;
+@@ -4014,20 +4030,26 @@
+ 	/*Save accumulated inputs {{{*/
+    Input *accsumEC_input         = this->GetInput(SmbAccumulatedECEnum);  _assert_(accsumEC_input);
+    Input *accsumM_input          = this->GetInput(SmbAccumulatedMeltEnum);  _assert_(accsumM_input);
+-   Input *accsumR_input          = this->GetInput(SmbAccumulatedRunoffEnum);  _assert_(accsumR_input);
+-   Input *accsumP_input          = this->GetInput(SmbAccumulatedPrecipitationEnum);  _assert_(accsumP_input);
+-   Input *accsumSMB_input        = this->GetInput(SmbAccumulatedMassBalanceEnum);  _assert_(accsumP_input);
++	Input *accsumR_input          = this->GetInput(SmbAccumulatedRunoffEnum);  _assert_(accsumR_input);
++	Input *accsumF_input          = this->GetInput(SmbAccumulatedRefreezeEnum);  _assert_(accsumF_input);
++	Input *accsumRa_input         = this->GetInput(SmbAccumulatedRainEnum);  _assert_(accsumRa_input);
++	Input *accsumP_input          = this->GetInput(SmbAccumulatedPrecipitationEnum);  _assert_(accsumP_input);
++	Input *accsumSMB_input        = this->GetInput(SmbAccumulatedMassBalanceEnum);  _assert_(accsumSMB_input);
+ 
+    accsumEC_input->GetInputAverage(&accsumEC);
+-   accsumM_input->GetInputAverage(&accsumM);
+-   accsumR_input->GetInputAverage(&accsumR);
+-   accsumP_input->GetInputAverage(&accsumP);
+-   accsumSMB_input->GetInputAverage(&accsumSMB);
++	accsumM_input->GetInputAverage(&accsumM);
++	accsumR_input->GetInputAverage(&accsumR);
++	accsumF_input->GetInputAverage(&accsumF);
++	accsumRa_input->GetInputAverage(&accsumRa);
++	accsumP_input->GetInputAverage(&accsumP);
++	accsumSMB_input->GetInputAverage(&accsumSMB);
+ 
+ 	this->SetElementInput(SmbAccumulatedECEnum,accsumEC+EC/rho_ice);
+ 	this->SetElementInput(SmbAccumulatedMassBalanceEnum,accsumSMB+(P + EC -R)/rho_ice);
+ 	this->SetElementInput(SmbAccumulatedMeltEnum,accsumM+M/rho_ice);
+ 	this->SetElementInput(SmbAccumulatedRunoffEnum,accsumR+R/rho_ice);
++	this->SetElementInput(SmbAccumulatedRefreezeEnum,accsumF+F/rho_ice);
++	this->SetElementInput(SmbAccumulatedRainEnum,accsumRa+Ra/rho_ice);
+ 	this->SetElementInput(SmbAccumulatedPrecipitationEnum,accsumP+P/rho_ice);
+    /*}}}*/
+ 
+@@ -4045,6 +4067,8 @@
+ 	this->SetElementInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/dt/rho_ice);
+ 	this->SetElementInput(SmbMeltEnum,sumM/dt/rho_ice);
+ 	this->SetElementInput(SmbRunoffEnum,sumR/dt/rho_ice);
++	this->SetElementInput(SmbRefreezeEnum,sumF/dt/rho_ice);
++	this->SetElementInput(SmbRainEnum,sumRa/dt/rho_ice);
+ 	this->SetElementInput(SmbPrecipitationEnum,sumP/dt/rho_ice);
+ 	this->SetElementInput(SmbMeanULWEnum,meanULW);
+ 	this->SetElementInput(SmbNetLWEnum,netLW);
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26270)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26271)
+@@ -710,11 +710,13 @@
+ syn keyword cConstant InversionVyObsEnum
+ syn keyword cConstant LevelsetfunctionSlopeXEnum
+ syn keyword cConstant LevelsetfunctionSlopeYEnum
++syn keyword cConstant LevelsetObservationEnum
+ syn keyword cConstant LoadingforceXEnum
+ syn keyword cConstant LoadingforceYEnum
+ syn keyword cConstant LoadingforceZEnum
+ syn keyword cConstant MaskOceanLevelsetEnum
+ syn keyword cConstant MaskIceLevelsetEnum
++syn keyword cConstant MaskIceRefLevelsetEnum
+ syn keyword cConstant MasstransportSpcthicknessEnum
+ syn keyword cConstant MaterialsRheologyBEnum
+ syn keyword cConstant MaterialsRheologyBbarEnum
+@@ -837,6 +839,8 @@
+ syn keyword cConstant SmbAccumulatedMassBalanceEnum
+ syn keyword cConstant SmbAccumulatedMeltEnum
+ syn keyword cConstant SmbAccumulatedPrecipitationEnum
++syn keyword cConstant SmbAccumulatedRainEnum
++syn keyword cConstant SmbAccumulatedRefreezeEnum
+ syn keyword cConstant SmbAccumulatedRunoffEnum
+ syn keyword cConstant SmbAEnum
+ syn keyword cConstant SmbAdiffEnum
+@@ -905,6 +909,7 @@
+ syn keyword cConstant SmbPrecipitationsLgmEnum
+ syn keyword cConstant SmbPrecipitationsPresentdayEnum
+ syn keyword cConstant SmbPrecipitationsReconstructedEnum
++syn keyword cConstant SmbRainEnum
+ syn keyword cConstant SmbReEnum
+ syn keyword cConstant SmbRefreezeEnum
+ syn keyword cConstant SmbReiniEnum
+@@ -1014,6 +1019,7 @@
+ syn keyword cConstant WaterfractionDrainageIntegratedEnum
+ syn keyword cConstant WaterfractionEnum
+ syn keyword cConstant WaterheightEnum
++syn keyword cConstant WeightsLevelsetObservationEnum
+ syn keyword cConstant WeightsSurfaceObservationEnum
+ syn keyword cConstant OldAccumulatedDeltaBottomPressureEnum
+ syn keyword cConstant OldAccumulatedDeltaIceThicknessEnum
+@@ -1157,6 +1163,7 @@
+ syn keyword cConstant CfdragcoeffabsgradEnum
+ syn keyword cConstant CfsurfacelogvelEnum
+ syn keyword cConstant CfsurfacesquareEnum
++syn keyword cConstant CflevelsetmisfitEnum
+ syn keyword cConstant ChannelEnum
+ syn keyword cConstant ChannelAreaEnum
+ syn keyword cConstant ChannelAreaOldEnum
+@@ -1507,6 +1514,7 @@
+ syn keyword cType BoolInput
+ syn keyword cType BoolParam
+ syn keyword cType Cfdragcoeffabsgrad
++syn keyword cType Cflevelsetmisfit
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26270)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26271)
+@@ -835,6 +835,8 @@
+ 	SmbAccumulatedMassBalanceEnum,
+ 	SmbAccumulatedMeltEnum,
+ 	SmbAccumulatedPrecipitationEnum,
++	SmbAccumulatedRainEnum,
++	SmbAccumulatedRefreezeEnum,
+ 	SmbAccumulatedRunoffEnum,
+ 	SmbAEnum,
+ 	SmbAdiffEnum,
+@@ -904,6 +906,7 @@
+ 	SmbPrecipitationsLgmEnum,
+ 	SmbPrecipitationsPresentdayEnum,
+ 	SmbPrecipitationsReconstructedEnum,
++	SmbRainEnum,
+ 	SmbReEnum,
+ 	SmbRefreezeEnum,
+ 	SmbReiniEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26270)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26271)
+@@ -712,11 +712,13 @@
+ 		case InversionVyObsEnum : return "InversionVyObs";
+ 		case LevelsetfunctionSlopeXEnum : return "LevelsetfunctionSlopeX";
+ 		case LevelsetfunctionSlopeYEnum : return "LevelsetfunctionSlopeY";
++		case LevelsetObservationEnum : return "LevelsetObservation";
+ 		case LoadingforceXEnum : return "LoadingforceX";
+ 		case LoadingforceYEnum : return "LoadingforceY";
+ 		case LoadingforceZEnum : return "LoadingforceZ";
+ 		case MaskOceanLevelsetEnum : return "MaskOceanLevelset";
+ 		case MaskIceLevelsetEnum : return "MaskIceLevelset";
++		case MaskIceRefLevelsetEnum : return "MaskIceRefLevelset";
+ 		case MasstransportSpcthicknessEnum : return "MasstransportSpcthickness";
+ 		case MaterialsRheologyBEnum : return "MaterialsRheologyB";
+ 		case MaterialsRheologyBbarEnum : return "MaterialsRheologyBbar";
+@@ -839,6 +841,8 @@
+ 		case SmbAccumulatedMassBalanceEnum : return "SmbAccumulatedMassBalance";
+ 		case SmbAccumulatedMeltEnum : return "SmbAccumulatedMelt";
+ 		case SmbAccumulatedPrecipitationEnum : return "SmbAccumulatedPrecipitation";
++		case SmbAccumulatedRainEnum : return "SmbAccumulatedRain";
++		case SmbAccumulatedRefreezeEnum : return "SmbAccumulatedRefreeze";
+ 		case SmbAccumulatedRunoffEnum : return "SmbAccumulatedRunoff";
+ 		case SmbAEnum : return "SmbA";
+ 		case SmbAdiffEnum : return "SmbAdiff";
+@@ -907,6 +911,7 @@
+ 		case SmbPrecipitationsLgmEnum : return "SmbPrecipitationsLgm";
+ 		case SmbPrecipitationsPresentdayEnum : return "SmbPrecipitationsPresentday";
+ 		case SmbPrecipitationsReconstructedEnum : return "SmbPrecipitationsReconstructed";
++		case SmbRainEnum : return "SmbRain";
+ 		case SmbReEnum : return "SmbRe";
+ 		case SmbRefreezeEnum : return "SmbRefreeze";
+ 		case SmbReiniEnum : return "SmbReini";
+@@ -1016,6 +1021,7 @@
+ 		case WaterfractionDrainageIntegratedEnum : return "WaterfractionDrainageIntegrated";
+ 		case WaterfractionEnum : return "Waterfraction";
+ 		case WaterheightEnum : return "Waterheight";
++		case WeightsLevelsetObservationEnum : return "WeightsLevelsetObservation";
+ 		case WeightsSurfaceObservationEnum : return "WeightsSurfaceObservation";
+ 		case OldAccumulatedDeltaBottomPressureEnum : return "OldAccumulatedDeltaBottomPressure";
+ 		case OldAccumulatedDeltaIceThicknessEnum : return "OldAccumulatedDeltaIceThickness";
+@@ -1159,6 +1165,7 @@
+ 		case CfdragcoeffabsgradEnum : return "Cfdragcoeffabsgrad";
+ 		case CfsurfacelogvelEnum : return "Cfsurfacelogvel";
+ 		case CfsurfacesquareEnum : return "Cfsurfacesquare";
++		case CflevelsetmisfitEnum : return "Cflevelsetmisfit";
+ 		case ChannelEnum : return "Channel";
+ 		case ChannelAreaEnum : return "ChannelArea";
+ 		case ChannelAreaOldEnum : return "ChannelAreaOld";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26270)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26271)
+@@ -727,11 +727,13 @@
+ 	      else if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
++	      else if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum;
+ 	      else if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
+ 	      else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
+ 	      else if (strcmp(name,"LoadingforceZ")==0) return LoadingforceZEnum;
+ 	      else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum;
+ 	      else if (strcmp(name,"MaskIceLevelset")==0) return MaskIceLevelsetEnum;
++	      else if (strcmp(name,"MaskIceRefLevelset")==0) return MaskIceRefLevelsetEnum;
+ 	      else if (strcmp(name,"MasstransportSpcthickness")==0) return MasstransportSpcthicknessEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyB")==0) return MaterialsRheologyBEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyBbar")==0) return MaterialsRheologyBbarEnum;
+@@ -749,12 +751,12 @@
+ 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+ 	      else if (strcmp(name,"MovingFrontalVx")==0) return MovingFrontalVxEnum;
+ 	      else if (strcmp(name,"MovingFrontalVy")==0) return MovingFrontalVyEnum;
+-	      else if (strcmp(name,"Neumannflux")==0) return NeumannfluxEnum;
+-	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"Node")==0) return NodeEnum;
++	      if (strcmp(name,"Neumannflux")==0) return NeumannfluxEnum;
++	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
++	      else if (strcmp(name,"Node")==0) return NodeEnum;
+ 	      else if (strcmp(name,"OmegaAbsGradient")==0) return OmegaAbsGradientEnum;
+ 	      else if (strcmp(name,"OceantransportSpcbottompressure")==0) return OceantransportSpcbottompressureEnum;
+ 	      else if (strcmp(name,"OceantransportSpcstr")==0) return OceantransportSpcstrEnum;
+@@ -857,6 +859,8 @@
+ 	      else if (strcmp(name,"SmbAccumulatedMassBalance")==0) return SmbAccumulatedMassBalanceEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedMelt")==0) return SmbAccumulatedMeltEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedPrecipitation")==0) return SmbAccumulatedPrecipitationEnum;
++	      else if (strcmp(name,"SmbAccumulatedRain")==0) return SmbAccumulatedRainEnum;
++	      else if (strcmp(name,"SmbAccumulatedRefreeze")==0) return SmbAccumulatedRefreezeEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedRunoff")==0) return SmbAccumulatedRunoffEnum;
+ 	      else if (strcmp(name,"SmbA")==0) return SmbAEnum;
+ 	      else if (strcmp(name,"SmbAdiff")==0) return SmbAdiffEnum;
+@@ -870,14 +874,14 @@
+ 	      else if (strcmp(name,"SmbBPos")==0) return SmbBPosEnum;
+ 	      else if (strcmp(name,"SmbC")==0) return SmbCEnum;
+ 	      else if (strcmp(name,"SmbCcsnowValue")==0) return SmbCcsnowValueEnum;
+-	      else if (strcmp(name,"SmbCciceValue")==0) return SmbCciceValueEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SmbCciceValue")==0) return SmbCciceValueEnum;
+ 	      else if (strcmp(name,"SmbCotValue")==0) return SmbCotValueEnum;
+ 	      else if (strcmp(name,"SmbD")==0) return SmbDEnum;
+ 	      else if (strcmp(name,"SmbDailyairdensity")==0) return SmbDailyairdensityEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbDailyairhumidity")==0) return SmbDailyairhumidityEnum;
++	      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;
+@@ -928,6 +932,7 @@
+ 	      else if (strcmp(name,"SmbPrecipitationsLgm")==0) return SmbPrecipitationsLgmEnum;
+ 	      else if (strcmp(name,"SmbPrecipitationsPresentday")==0) return SmbPrecipitationsPresentdayEnum;
+ 	      else if (strcmp(name,"SmbPrecipitationsReconstructed")==0) return SmbPrecipitationsReconstructedEnum;
++	      else if (strcmp(name,"SmbRain")==0) return SmbRainEnum;
+ 	      else if (strcmp(name,"SmbRe")==0) return SmbReEnum;
+ 	      else if (strcmp(name,"SmbRefreeze")==0) return SmbRefreezeEnum;
+ 	      else if (strcmp(name,"SmbReini")==0) return SmbReiniEnum;
+@@ -992,15 +997,15 @@
+ 	      else if (strcmp(name,"Surface")==0) return SurfaceEnum;
+ 	      else if (strcmp(name,"SurfaceOld")==0) return SurfaceOldEnum;
+ 	      else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum;
+-	      else if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;
+ 	      else if (strcmp(name,"SurfaceObservation")==0) return SurfaceObservationEnum;
+ 	      else if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum;
+ 	      else if (strcmp(name,"SurfaceSlopeX")==0) return SurfaceSlopeXEnum;
+ 	      else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"Temperature")==0) return TemperatureEnum;
++	      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;
+@@ -1040,6 +1045,7 @@
+ 	      else if (strcmp(name,"WaterfractionDrainageIntegrated")==0) return WaterfractionDrainageIntegratedEnum;
+ 	      else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
+ 	      else if (strcmp(name,"Waterheight")==0) return WaterheightEnum;
++	      else if (strcmp(name,"WeightsLevelsetObservation")==0) return WeightsLevelsetObservationEnum;
+ 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
+ 	      else if (strcmp(name,"OldAccumulatedDeltaBottomPressure")==0) return OldAccumulatedDeltaBottomPressureEnum;
+ 	      else if (strcmp(name,"OldAccumulatedDeltaIceThickness")==0) return OldAccumulatedDeltaIceThicknessEnum;
+@@ -1114,16 +1120,16 @@
+ 	      else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
+ 	      else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
+ 	      else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum;
+-	      else if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum;
+ 	      else if (strcmp(name,"Outputdefinition75")==0) return Outputdefinition75Enum;
+ 	      else if (strcmp(name,"Outputdefinition76")==0) return Outputdefinition76Enum;
+ 	      else if (strcmp(name,"Outputdefinition77")==0) return Outputdefinition77Enum;
+ 	      else if (strcmp(name,"Outputdefinition78")==0) return Outputdefinition78Enum;
+ 	      else if (strcmp(name,"Outputdefinition79")==0) return Outputdefinition79Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition7")==0) return Outputdefinition7Enum;
++	      else if (strcmp(name,"Outputdefinition7")==0) return Outputdefinition7Enum;
+ 	      else if (strcmp(name,"Outputdefinition80")==0) return Outputdefinition80Enum;
+ 	      else if (strcmp(name,"Outputdefinition81")==0) return Outputdefinition81Enum;
+ 	      else if (strcmp(name,"Outputdefinition82")==0) return Outputdefinition82Enum;
+@@ -1186,6 +1192,7 @@
+ 	      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,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
+ 	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+ 	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
+ 	      else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum;
+@@ -1236,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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;
+@@ -1243,10 +1253,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"FloatingArea")==0) return FloatingAreaEnum;
++	      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;
+@@ -1359,7 +1366,10 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      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;
+@@ -1366,10 +1376,7 @@
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"MismipFloatingMeltRate")==0) return MismipFloatingMeltRateEnum;
++	      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;
+@@ -1482,7 +1489,10 @@
+ 	      else if (strcmp(name,"SubelementMelt2")==0) return SubelementMelt2Enum;
+ 	      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 stage=13;
++   }
++   if(stage==13){
++	      if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
+ 	      else if (strcmp(name,"Tetra")==0) return TetraEnum;
+ 	      else if (strcmp(name,"TetraInput")==0) return TetraInputEnum;
+ 	      else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
+@@ -1489,10 +1499,7 @@
+ 	      else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
+ 	      else if (strcmp(name,"ThicknessErrorEstimator")==0) return ThicknessErrorEstimatorEnum;
+ 	      else if (strcmp(name,"TotalCalvingFluxLevelset")==0) return TotalCalvingFluxLevelsetEnum;
+-         else stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"TotalCalvingMeltingFluxLevelset")==0) return TotalCalvingMeltingFluxLevelsetEnum;
++	      else if (strcmp(name,"TotalCalvingMeltingFluxLevelset")==0) return TotalCalvingMeltingFluxLevelsetEnum;
+ 	      else if (strcmp(name,"TotalFloatingBmb")==0) return TotalFloatingBmbEnum;
+ 	      else if (strcmp(name,"TotalFloatingBmbScaled")==0) return TotalFloatingBmbScaledEnum;
+ 	      else if (strcmp(name,"TotalGroundedBmb")==0) return TotalGroundedBmbEnum;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26271-26272.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26271-26272.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26271-26272.diff	(revision 26740)
@@ -0,0 +1,2234 @@
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26271)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26272)
+@@ -1018,6 +1018,7 @@
+ 	doubletype*  LoveKf = NULL;
+ 	doubletype*  LoveHf = NULL;
+ 	doubletype*  LoveLf = NULL;
++	
+ 	doubletype*  LoveKernels= NULL;
+ 	LoveVariables* vars=NULL;
+ 	doubletype* yi_prefactor=NULL;
+@@ -1103,16 +1104,48 @@
+ 
+ 	//Temporal love numbers
+ 	if (istemporal && !complex_computation){
++
++		IssmDouble*  LoveHtDouble=NULL;
++		IssmDouble*  LoveKtDouble=NULL;
++		IssmDouble*  LoveLtDouble=NULL;
++		doubletype*  LoveHt=NULL;
++		doubletype*  LoveLt=NULL;
++		doubletype*  LoveKt=NULL;
++
+ 		int NTit;
+ 		femmodel->parameters->FindParam(&NTit,LoveNTemporalIterationsEnum);
+ 		int nt = nfreq/2/NTit;
+ 
+-		doubletype* LoveHt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
+-		doubletype* LoveLt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
+-		doubletype* LoveKt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
++		LoveHt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
++		LoveLt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
++		LoveKt=xNewZeroInit<doubletype>((sh_nmax+1)*nt);
+ 
+ 		love_freq_to_temporal<doubletype>(LoveHt,LoveLt,LoveKt,LoveHf,LoveLf,LoveKf,femmodel);
+ 
++		/*Downcast and add into parameters:*/
++		LoveHtDouble=xNew<IssmDouble>((sh_nmax+1)*nt);
++		LoveLtDouble=xNew<IssmDouble>((sh_nmax+1)*nt);
++		LoveKtDouble=xNew<IssmDouble>((sh_nmax+1)*nt);
++		for(int i=0;i<(sh_nmax+1)*nt;i++){
++			LoveHtDouble[i]=std::real(LoveHt[i]);
++			LoveLtDouble[i]=std::real(LoveLt[i]);
++			LoveKtDouble[i]=std::real(LoveKt[i]);
++		}
++		if(forcing_type==9){ //tidal loading
++			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,LoveHtDouble,(sh_nmax+1)*nt,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,LoveKtDouble,(sh_nmax+1)*nt,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,LoveLtDouble,(sh_nmax+1)*nt,1));
++		}
++		else if(forcing_type==11){ //surface loading
++			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,LoveHtDouble,(sh_nmax+1)*nt,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,LoveKtDouble,(sh_nmax+1)*nt,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,LoveLtDouble,(sh_nmax+1)*nt,1));
++		}
++		xDelete<IssmDouble>(LoveHtDouble);
++		xDelete<IssmDouble>(LoveKtDouble);
++		xDelete<IssmDouble>(LoveLtDouble);
++	
++		/*Add into external results, no need to downcast, we can handle complexes/quad precision: */
+ 		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKrEnum,LoveKt,sh_nmax+1,nt,0,0));
+ 		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHrEnum,LoveHt,sh_nmax+1,nt,0,0));
+ 		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveLrEnum,LoveLt,sh_nmax+1,nt,0,0));
+@@ -1121,7 +1154,37 @@
+ 		xDelete<doubletype>(LoveLt);
+ 		xDelete<doubletype>(LoveKt);
+ 	}
++	else{
+ 
++		IssmDouble*  LoveHfDouble=NULL;
++		IssmDouble*  LoveKfDouble=NULL;
++		IssmDouble*  LoveLfDouble=NULL;
++
++		/*Add into parameters:*/
++		LoveHfDouble=xNew<IssmDouble>((sh_nmax+1)*nfreq);
++		LoveLfDouble=xNew<IssmDouble>((sh_nmax+1)*nfreq);
++		LoveKfDouble=xNew<IssmDouble>((sh_nmax+1)*nfreq);
++		for(int i=0;i<(sh_nmax+1)*nfreq;i++){
++			LoveHfDouble[i]=std::real(LoveHf[i]);
++			LoveLfDouble[i]=std::real(LoveLf[i]);
++			LoveKfDouble[i]=std::real(LoveKf[i]);
++		}
++		if(forcing_type==9){ //tidal loading
++			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,LoveHfDouble,(sh_nmax+1)*nfreq,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,LoveKfDouble,(sh_nmax+1)*nfreq,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,LoveLfDouble,(sh_nmax+1)*nfreq,1));
++		}
++		else if(forcing_type==11){ //surface loading
++			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,LoveHfDouble,(sh_nmax+1)*nfreq,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,LoveKfDouble,(sh_nmax+1)*nfreq,1));
++			femmodel->parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,LoveLfDouble,(sh_nmax+1)*nfreq,1));
++		}
++		xDelete<IssmDouble>(LoveHfDouble);
++		xDelete<IssmDouble>(LoveKfDouble);
++		xDelete<IssmDouble>(LoveLfDouble);
++	}
++
++	/*Add into external results:*/
+ 	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKiEnum,LoveKf,sh_nmax+1,nfreq,0,0));
+ 	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHiEnum,LoveHf,sh_nmax+1,nfreq,0,0));
+ 	femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveLiEnum,LoveLf,sh_nmax+1,nfreq,0,0));
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26271)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26272)
+@@ -363,6 +363,7 @@
+ syn keyword cConstant SolidearthSettingsCrossSectionShapeEnum
+ syn keyword cConstant RotationalAngularVelocityEnum
+ syn keyword cConstant SolidearthSettingsElasticEnum
++syn keyword cConstant SolidearthSettingsViscousEnum
+ syn keyword cConstant SealevelchangeGeometryDoneEnum
+ syn keyword cConstant RotationalEquatorialMoiEnum
+ syn keyword cConstant TidalLoveHEnum
+@@ -372,12 +373,15 @@
+ syn keyword cConstant LoadLoveHEnum
+ syn keyword cConstant LoadLoveKEnum
+ syn keyword cConstant LoadLoveLEnum
++syn keyword cConstant LoveTimeFreqEnum
++syn keyword cConstant LoveIsTimeEnum
+ syn keyword cConstant SealevelchangeGRigidEnum
+-syn keyword cConstant SealevelchangeGElasticEnum
++syn keyword cConstant SealevelchangeGViscoElasticEnum
+ syn keyword cConstant SolidearthSettingsComputesealevelchangeEnum
+ syn keyword cConstant SolidearthSettingsGRDEnum
+ syn keyword cConstant SolidearthSettingsRunFrequencyEnum
+-syn keyword cConstant SealevelchangeHElasticEnum
++syn keyword cConstant SolidearthSettingsTimeAccEnum
++syn keyword cConstant SealevelchangeHViscoElasticEnum
+ syn keyword cConstant SolidearthSettingsHorizEnum
+ syn keyword cConstant SolidearthSettingsMaxiterEnum
+ syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
+@@ -388,7 +392,7 @@
+ syn keyword cConstant SolidearthSettingsRotationEnum
+ syn keyword cConstant SealevelchangeRunCountEnum
+ syn keyword cConstant SealevelchangeTransitionsEnum
+-syn keyword cConstant SealevelchangeUElasticEnum
++syn keyword cConstant SealevelchangeUViscoElasticEnum
+ syn keyword cConstant SettingsIoGatherEnum
+ syn keyword cConstant SettingsNumResultsOnNodesEnum
+ syn keyword cConstant SettingsOutputFrequencyEnum
+@@ -397,6 +401,9 @@
+ syn keyword cConstant SettingsSbCouplingFrequencyEnum
+ syn keyword cConstant SettingsSolverResidueThresholdEnum
+ syn keyword cConstant SettingsWaitonlockEnum
++syn keyword cConstant StackNumStepsEnum
++syn keyword cConstant StackTimesEnum
++syn keyword cConstant StackIndexEnum
+ syn keyword cConstant SmbAIceEnum
+ syn keyword cConstant SmbAIdxEnum
+ syn keyword cConstant SmbASnowEnum
+@@ -948,6 +955,10 @@
+ syn keyword cConstant SolidearthExternalDisplacementUpRateEnum
+ syn keyword cConstant SolidearthExternalGeoidRateEnum
+ syn keyword cConstant SolidearthExternalBarystaticSeaLevelRateEnum
++syn keyword cConstant StackRSLEnum
++syn keyword cConstant StackUEnum
++syn keyword cConstant StackNEnum
++syn keyword cConstant StackEEnum
+ syn keyword cConstant StrainRateeffectiveEnum
+ syn keyword cConstant StrainRateparallelEnum
+ syn keyword cConstant StrainRateperpendicularEnum
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26271)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26272)
+@@ -79,6 +79,7 @@
+ void SealevelchangeAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+ 	int         nl;
++	int         ntimesteps;
+ 	IssmDouble* love_h=NULL;
+ 	IssmDouble* love_k=NULL;
+ 	IssmDouble* love_l=NULL;
+@@ -85,25 +86,38 @@
+ 	IssmDouble* love_th=NULL;
+ 	IssmDouble* love_tk=NULL;
+ 	IssmDouble* love_tl=NULL;
++	IssmDouble* love_timefreq=NULL;
++	bool        love_istime=true;
+ 	int         externalnature=0;
+ 	int         isexternal=0;
+ 
+ 	IssmDouble* G_rigid = NULL;
+ 	IssmDouble* G_rigid_local = NULL;
+-	IssmDouble* G_elastic = NULL;
+-	IssmDouble* G_elastic_local = NULL;
+-	IssmDouble* U_elastic = NULL;
+-	IssmDouble* U_elastic_local = NULL;
+-	IssmDouble* H_elastic = NULL;
+-	IssmDouble* H_elastic_local = NULL;
++	IssmDouble* G_viscoelastic = NULL;
++	IssmDouble* G_viscoelastic_interpolated = NULL;
++	IssmDouble* G_viscoelastic_local = NULL;
++	IssmDouble* U_viscoelastic = NULL;
++	IssmDouble* U_viscoelastic_interpolated = NULL;
++	IssmDouble* U_viscoelastic_local = NULL;
++	IssmDouble* H_viscoelastic = NULL;
++	IssmDouble* H_viscoelastic_interpolated= NULL;
++	IssmDouble* H_viscoelastic_local = NULL;
+ 	int         M,m,lower_row,upper_row;
+ 	IssmDouble  degacc=.01;
++	IssmDouble  timeacc;
+ 	IssmDouble  planetradius=0;
+ 	IssmDouble  planetarea=0;
+ 	bool		rigid=false;
+ 	bool		elastic=false;
++	bool		viscous=false;
+ 	bool		rotation=false;
++	int         ndeg;
++	int         horiz;
+ 
++	bool istime=true;
++	IssmDouble start_time,final_time;
++	int  nt,precomputednt;
++
+ 	int     numoutputs;
+ 	char**  requestedoutputs = NULL;
+ 
+@@ -119,8 +133,8 @@
+ 	IssmDouble*  bslchydro_partition=NULL;
+ 	IssmDouble*  bslcocean_partition=NULL;
+ 	int          npartice,nparthydro,npartocean,nel;
++	int          grdmodel;
+ 
+-
+ 	/*some constant parameters: */
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.dsl.model",DslModelEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.isexternal",SolidearthIsExternalEnum));
+@@ -133,6 +147,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rigid",SolidearthSettingsRigidEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.viscous",SolidearthSettingsViscousEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rotation",SolidearthSettingsRotationEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.equatorialmoi",RotationalEquatorialMoiEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.polarmoi",RotationalPolarMoiEnum));
+@@ -210,195 +225,311 @@
+ 		} /*}}}*/
+ 	}
+ 
+-	/*Deal with elasticity {{{*/
+-	iomodel->FetchData(&rigid,"md.solidearth.settings.rigid");
+-	iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
+-	iomodel->FetchData(&rotation,"md.solidearth.settings.rotation");
++	parameters->FindParam(&grdmodel,GrdModelEnum);
++	if(grdmodel!=IvinsEnum){
++		/*Deal with elasticity {{{*/
++		iomodel->FetchData(&rigid,"md.solidearth.settings.rigid");
++		iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
++		iomodel->FetchData(&viscous,"md.solidearth.settings.viscous");
++		iomodel->FetchData(&rotation,"md.solidearth.settings.rotation");
++		iomodel->FetchData(&horiz,"md.solidearth.settings.horiz");
+ 
+-	if(elastic | rigid){
+-		/*compute green functions for a range of angles*/
+-		iomodel->FetchData(&degacc,"md.solidearth.settings.degacc");
+-		M=reCast<int,IssmDouble>(180./degacc+1.);
+-	}
++		if(rigid){
++			/*compute green functions for a range of angles*/
++			iomodel->FetchData(&degacc,"md.solidearth.settings.degacc");
++			M=reCast<int,IssmDouble>(180./degacc+1.);
++		}
+ 
+-	/*love numbers: */
+-	if(elastic){
+-		iomodel->FetchData(&love_h,&nl,NULL,"md.solidearth.lovenumbers.h");
+-		iomodel->FetchData(&love_k,&nl,NULL,"md.solidearth.lovenumbers.k");
+-		iomodel->FetchData(&love_l,&nl,NULL,"md.solidearth.lovenumbers.l");
+-		iomodel->FetchData(&love_th,&nl,NULL,"md.solidearth.lovenumbers.th");
+-		iomodel->FetchData(&love_tk,&nl,NULL,"md.solidearth.lovenumbers.tk");
+-		iomodel->FetchData(&love_tl,&nl,NULL,"md.solidearth.lovenumbers.tl");
++		/*love numbers: */
++		if(viscous || elastic){
++			int dummy;
+ 
+-		parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,love_h,nl,1));
+-		parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,love_k,nl,1));
+-		parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,love_l,nl,1));
+-		parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,love_th,nl,1));
+-		parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,love_tk,nl,1));
+-		parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,love_tl,nl,1));
++			iomodel->FetchData(&timeacc,"md.solidearth.settings.timeacc");
++			iomodel->FetchData(&start_time,"md.timestepping.start_time");
++			iomodel->FetchData(&final_time,"md.timestepping.final_time");
++			iomodel->FetchData(&love_istime,"md.solidearth.lovenumbers.istime");
++			iomodel->FetchData(&love_timefreq,&precomputednt,&dummy,"md.solidearth.lovenumbers.timefreq");
++			iomodel->FetchData(&love_h,&ndeg,&precomputednt,"md.solidearth.lovenumbers.h");
++			iomodel->FetchData(&love_k,&ndeg,&precomputednt,"md.solidearth.lovenumbers.k");
++			iomodel->FetchData(&love_l,&ndeg,&precomputednt,"md.solidearth.lovenumbers.l");
++			iomodel->FetchData(&love_th,&ndeg,&precomputednt,"md.solidearth.lovenumbers.th");
++			iomodel->FetchData(&love_tk,&ndeg,&precomputednt,"md.solidearth.lovenumbers.tk");
++			iomodel->FetchData(&love_tl,&ndeg,&precomputednt,"md.solidearth.lovenumbers.tl");
+ 
+-		// AD performance is sensitive to calls to ensurecontiguous.
+-		// // Providing "t" will cause ensurecontiguous to be called.
+-		#ifdef _HAVE_AD_
+-		G_elastic=xNew<IssmDouble>(M,"t");
+-		U_elastic=xNew<IssmDouble>(M,"t");
+-		H_elastic=xNew<IssmDouble>(M,"t");
+-		#else
+-		G_elastic=xNew<IssmDouble>(M);
+-		U_elastic=xNew<IssmDouble>(M);
+-		H_elastic=xNew<IssmDouble>(M);
+-		#endif
+-	}
+-	if(rigid){
+-		#ifdef _HAVE_AD_
+-		G_rigid=xNew<IssmDouble>(M,"t");
+-		#else
+-		G_rigid=xNew<IssmDouble>(M);
+-		#endif
+-	}
+-	
+-	if(rotation)parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.lovenumbers.tk2secular",TidalLoveK2SecularEnum));
++			parameters->AddObject(new DoubleParam(SolidearthSettingsTimeAccEnum,timeacc));
++			parameters->AddObject(new DoubleMatParam(LoadLoveHEnum,love_h,ndeg,precomputednt));
++			parameters->AddObject(new DoubleMatParam(LoadLoveKEnum,love_k,ndeg,precomputednt));
++			parameters->AddObject(new DoubleMatParam(LoadLoveLEnum,love_l,ndeg,precomputednt));
++			parameters->AddObject(new DoubleMatParam(TidalLoveHEnum,love_th,ndeg,precomputednt));
++			parameters->AddObject(new DoubleMatParam(TidalLoveKEnum,love_tk,ndeg,precomputednt));
++			parameters->AddObject(new DoubleMatParam(TidalLoveLEnum,love_tl,ndeg,precomputednt));
++			parameters->AddObject(new DoubleMatParam(LoveTimeFreqEnum,love_timefreq,precomputednt,1));
++			parameters->AddObject(new BoolParam(LoveIsTimeEnum,love_istime));
+ 
+-	if(rigid | elastic){
++			// AD performance is sensitive to calls to ensurecontiguous.
++			// // Providing "t" will cause ensurecontiguous to be called.
++			if(viscous){
++				IssmDouble* stacktimes=NULL;
++				ntimesteps=precomputednt; 
++				nt=reCast<int>((final_time-start_time)/timeacc)+1;
+ 
+-		/*compute combined legendre + love number (elastic green function:*/
+-		m=DetermineLocalSize(M,IssmComm::GetComm());
+-		GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
+-	}
+-	if(elastic){
+-		#ifdef _HAVE_AD_
+-		G_elastic_local=xNew<IssmDouble>(m,"t");
+-		U_elastic_local=xNew<IssmDouble>(m,"t");
+-		H_elastic_local=xNew<IssmDouble>(m,"t");
+-		#else
+-		G_elastic_local=xNew<IssmDouble>(m);
+-		U_elastic_local=xNew<IssmDouble>(m);
+-		H_elastic_local=xNew<IssmDouble>(m);
+-		#endif
+-	}
+-	if(rigid){
+-		#ifdef _HAVE_AD_
+-		G_rigid_local=xNew<IssmDouble>(m,"t");
+-		#else
+-		G_rigid_local=xNew<IssmDouble>(m);
+-		#endif
+-	}
++				parameters->AddObject(new IntParam(StackNumStepsEnum,nt));
++				/*Initialize stack times:*/
++				stacktimes=xNew<IssmDouble>(nt);
++				for(int t=0;t<nt;t++){
++					stacktimes[t]=start_time+timeacc*t;
++				}
++				parameters->AddObject(new DoubleVecParam(StackTimesEnum,stacktimes,nt));
++				parameters->AddObject(new IntParam(StackIndexEnum,0));
++				xDelete<IssmDouble>(stacktimes);
++			}
++			else {
++				ntimesteps=1;
++				nt=1;
++			}
+ 
+-	if(rigid){
+-		for(int i=lower_row;i<upper_row;i++){
+-			IssmDouble alpha,x;
+-			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
+-			G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
++#ifdef _HAVE_AD_
++			G_viscoelastic=xNew<IssmDouble>(M*ntimesteps,"t");
++			U_viscoelastic=xNew<IssmDouble>(M*ntimesteps,"t");
++			if(horiz)H_viscoelastic=xNew<IssmDouble>(M*ntimesteps,"t");
++#else
++			G_viscoelastic=xNew<IssmDouble>(M*ntimesteps);
++			U_viscoelastic=xNew<IssmDouble>(M*ntimesteps);
++			if(horiz)H_viscoelastic=xNew<IssmDouble>(M*ntimesteps);
++#endif
+ 		}
+-	}
+-	if(elastic){
+-		for(int i=lower_row;i<upper_row;i++){
+-			IssmDouble alpha,x;
+-			alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
++		if(rigid){
++#ifdef _HAVE_AD_
++			G_rigid=xNew<IssmDouble>(M,"t");
++#else
++			G_rigid=xNew<IssmDouble>(M);
++#endif
++		}
+ 
+-			G_elastic_local[i-lower_row]= (love_k[nl-1]-love_h[nl-1])*G_rigid_local[i-lower_row];
+-			U_elastic_local[i-lower_row]= (love_h[nl-1])*G_rigid_local[i-lower_row];
+-			H_elastic_local[i-lower_row]= 0; 
+-			IssmDouble Pn = 0.; 
+-			IssmDouble Pn1 = 0.; 
+-			IssmDouble Pn2 = 0.; 
+-			IssmDouble Pn_p = 0.; 
+-			IssmDouble Pn_p1 = 0.; 
+-			IssmDouble Pn_p2 = 0.; 
++		if(rotation)parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.lovenumbers.tk2secular",TidalLoveK2SecularEnum));
+ 
+-			for (int n=0;n<nl;n++) {
+-				IssmDouble deltalove_G;
+-				IssmDouble deltalove_U;
++		if(rigid){
+ 
+-				deltalove_G = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]);
+-				deltalove_U = (love_h[n]-love_h[nl-1]);
++			/*compute combined legendre + love number (elastic green function:*/
++			m=DetermineLocalSize(M,IssmComm::GetComm());
++			GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
++		}
++		if(viscous | elastic){
++#ifdef _HAVE_AD_
++			G_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps,"t");
++			U_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps,"t");
++			if(horiz)H_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps,"t");
++#else
++			G_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps);
++			U_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps);
++			if(horiz)H_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps);
++#endif
++		}
++		if(rigid){
++#ifdef _HAVE_AD_
++			G_rigid_local=xNew<IssmDouble>(m,"t");
++#else
++			G_rigid_local=xNew<IssmDouble>(m);
++#endif
++		}
+ 
+-				/*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
+-				if(n==0){
+-					Pn=1; 
+-					Pn_p=0; 
++		if(rigid){
++			for(int i=lower_row;i<upper_row;i++){
++				IssmDouble alpha,x;
++				alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
++				G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
++			}
++		}
++		if(viscous | elastic){
++			for(int i=lower_row;i<upper_row;i++){
++				IssmDouble alpha,x;
++				alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
++
++				for(int t=0;t<ntimesteps;t++){
++					G_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_k[(ndeg-1)*precomputednt+t]-love_h[(ndeg-1)*precomputednt+t])*G_rigid_local[i-lower_row];
++					U_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_h[(ndeg-1)*precomputednt+t])*G_rigid_local[i-lower_row];
++					if(horiz)H_viscoelastic_local[(i-lower_row)*ntimesteps+t]= 0; 
+ 				}
+-				else if(n==1){ 
+-					Pn = cos(alpha); 
+-					Pn_p = 1; 
++
++				IssmDouble Pn = 0.; 
++				IssmDouble Pn1 = 0.; 
++				IssmDouble Pn2 = 0.; 
++				IssmDouble Pn_p = 0.; 
++				IssmDouble Pn_p1 = 0.; 
++				IssmDouble Pn_p2 = 0.; 
++
++				for (int n=0;n<ndeg;n++) {
++
++					/*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
++					if(n==0){
++						Pn=1; 
++						Pn_p=0; 
++					}
++					else if(n==1){ 
++						Pn = cos(alpha); 
++						Pn_p = 1; 
++					}
++					else{
++						Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
++						Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
++					}
++					Pn2=Pn1; Pn1=Pn;
++					Pn_p2=Pn_p1; Pn_p1=Pn_p;
++
++					for(int t=0;t<ntimesteps;t++){
++						IssmDouble deltalove_G;
++						IssmDouble deltalove_U;
++
++						deltalove_G = (love_k[n*precomputednt+t]-love_k[(ndeg-1)*precomputednt+t]-love_h[n*precomputednt+t]+love_h[(ndeg-1)*precomputednt+t]);
++						deltalove_U = (love_h[n*precomputednt+t]-love_h[(ndeg-1)*precomputednt+t]);
++
++						G_viscoelastic_local[(i-lower_row)*ntimesteps+t] += deltalove_G*Pn;		                // gravitational potential 
++						U_viscoelastic_local[(i-lower_row)*ntimesteps+t] += deltalove_U*Pn;		                // vertical (up) displacement 
++						if(horiz)H_viscoelastic_local[(i-lower_row)*ntimesteps+t] += sin(alpha)*love_l[n*precomputednt+t]*Pn_p;		// horizontal displacements 
++					}
+ 				}
+-				else{
+-					Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
+-					Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
+-				}
+-				Pn2=Pn1; Pn1=Pn;
+-				Pn_p2=Pn_p1; Pn_p1=Pn_p;
+-
+-				G_elastic_local[i-lower_row] += deltalove_G*Pn;		// gravitational potential 
+-				U_elastic_local[i-lower_row] += deltalove_U*Pn;		// vertical (up) displacement 
+-				H_elastic_local[i-lower_row] += sin(alpha)*love_l[n]*Pn_p;		// horizontal displacements 
+ 			}
+ 		}
+-	}
+-	if(rigid){
++		if(rigid){
+ 
+-		/*merge G_elastic_local into G_elastic; U_elastic_local into U_elastic; H_elastic_local to H_elastic:{{{*/
+-		int* recvcounts=xNew<int>(IssmComm::GetSize());
+-		int* displs=xNew<int>(IssmComm::GetSize());
++			/*merge G_viscoelastic_local into G_viscoelastic; U_viscoelastic_local into U_viscoelastic; H_viscoelastic_local to H_viscoelastic:{{{*/
++			int* recvcounts=xNew<int>(IssmComm::GetSize());
++			int* displs=xNew<int>(IssmComm::GetSize());
++			int  rc;
++			int  offset;
+ 
+-		//recvcounts:
+-		ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
++			//deal with rigid first: 
++			ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
+ 
+-		/*displs: */
+-		ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
++			/*displs: */
++			ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
+ 
+-		/*All gather:*/
+-		ISSM_MPI_Allgatherv(G_rigid_local, m, ISSM_MPI_DOUBLE, G_rigid, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-		if(elastic){
+-			ISSM_MPI_Allgatherv(G_elastic_local, m, ISSM_MPI_DOUBLE, G_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-			ISSM_MPI_Allgatherv(U_elastic_local, m, ISSM_MPI_DOUBLE, U_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-			ISSM_MPI_Allgatherv(H_elastic_local, m, ISSM_MPI_DOUBLE, H_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+-		}
+-		
+-		/*free resources: */
+-		xDelete<int>(recvcounts);
+-		xDelete<int>(displs);
++			/*All gather:*/
++			ISSM_MPI_Allgatherv(G_rigid_local, m, ISSM_MPI_DOUBLE, G_rigid, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+ 
+-		/*Avoid singularity at 0: */
+-		G_rigid[0]=G_rigid[1];
+-		if(elastic){
+-			G_elastic[0]=G_elastic[1];
+-			U_elastic[0]=U_elastic[1];
+-			H_elastic[0]=H_elastic[1];
+-		}
+-		
++			if(elastic){
++				rc=m*ntimesteps;
++				offset=lower_row*ntimesteps;
++				ISSM_MPI_Allgather(&rc,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
++				ISSM_MPI_Allgather(&offset,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
+ 
+-		/*Save our precomputed tables into parameters*/
+-		parameters->AddObject(new DoubleVecParam(SealevelchangeGRigidEnum,G_rigid,M));
+-		if(elastic){
+-			parameters->AddObject(new DoubleVecParam(SealevelchangeGElasticEnum,G_elastic,M));
+-			parameters->AddObject(new DoubleVecParam(SealevelchangeUElasticEnum,U_elastic,M));
+-			parameters->AddObject(new DoubleVecParam(SealevelchangeHElasticEnum,H_elastic,M));
+-		}
++				ISSM_MPI_Allgatherv(G_viscoelastic_local, m*ntimesteps, ISSM_MPI_DOUBLE, G_viscoelastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++				ISSM_MPI_Allgatherv(U_viscoelastic_local, m*ntimesteps, ISSM_MPI_DOUBLE, U_viscoelastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++				if(horiz)ISSM_MPI_Allgatherv(H_viscoelastic_local, m*ntimesteps, ISSM_MPI_DOUBLE, H_viscoelastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++			}
+ 
+-		/*free resources: */
+-		xDelete<IssmDouble>(G_rigid);
+-		xDelete<IssmDouble>(G_rigid_local);
+-		if(elastic){
+-			xDelete<IssmDouble>(love_h);
+-			xDelete<IssmDouble>(love_k);
+-			xDelete<IssmDouble>(love_l);
+-			xDelete<IssmDouble>(love_th);
+-			xDelete<IssmDouble>(love_tk);
+-			xDelete<IssmDouble>(love_tl);
+-			xDelete<IssmDouble>(G_elastic);
+-			xDelete<IssmDouble>(G_elastic_local);
+-			xDelete<IssmDouble>(U_elastic);
+-			xDelete<IssmDouble>(U_elastic_local);
+-			xDelete<IssmDouble>(H_elastic);
+-			xDelete<IssmDouble>(H_elastic_local);
+-		}
+-	} /*}}}*/
++			/*free resources: */
++			xDelete<int>(recvcounts);
++			xDelete<int>(displs);
+ 
+-	/*Indicate we have not yet run the Geometry Core module: */
+-	parameters->AddObject(new BoolParam(SealevelchangeGeometryDoneEnum,false));
+-	/*}}}*/
++			
+ 
++			/*Avoid singularity at 0: */
++			G_rigid[0]=G_rigid[1];
++			if(elastic){
++				for(int t=0;t<ntimesteps;t++){
++					G_viscoelastic[t]=G_viscoelastic[ntimesteps+t];
++					U_viscoelastic[t]=U_viscoelastic[ntimesteps+t];
++					if(horiz)H_viscoelastic[t]=H_viscoelastic[ntimesteps+t];
++				}
++			}
++
++			
++
++			/*Reinterpolate viscoelastic green kernels onto a regular gridded time 
++			 *with steps equal to timeacc:*/
++			if(viscous){
++				nt=reCast<int>((final_time-start_time)/timeacc)+1;
++#ifdef _HAVE_AD_
++				G_viscoelastic_interpolated=xNew<IssmDouble>(M*nt,"t");
++				U_viscoelastic_interpolated=xNew<IssmDouble>(M*nt,"t");
++				if(horiz)H_viscoelastic_interpolated=xNew<IssmDouble>(M*nt,"t");
++#else
++				G_viscoelastic_interpolated=xNew<IssmDouble>(M*nt);
++				U_viscoelastic_interpolated=xNew<IssmDouble>(M*nt);
++				if(horiz)H_viscoelastic_interpolated=xNew<IssmDouble>(M*nt);
++#endif
++
++				for(int t=0;t<nt;t++){
++					IssmDouble lincoeff;
++					IssmDouble viscoelastic_time=t*timeacc;
++					int        timeindex2=-1;
++
++					/*Find a way to interpolate precomputed Gkernels to our solution time stepping:*/
++					if(t!=0){
++						for(int t2=0;t2<ntimesteps;t2++){
++							if (viscoelastic_time<love_timefreq[t2]){
++								timeindex2=t2-1;
++								if(timeindex2<0)_error_("Temporal Love numbers are computed  with a time accuracy superior to the requested solution time step!");
++								lincoeff=(viscoelastic_time-love_timefreq[t2-1])/(love_timefreq[t2]-love_timefreq[t2-1]);
++								break;
++							}
++						}
++						if(timeindex2==-1)_error_("Temporal love numbers should be extended in time to encompass the requested solution time interval!");
++					}
++					else{
++						timeindex2=0;
++						lincoeff=0;
++					}
++
++					for(int index=0;index<M;index++){
++
++						int timeindex=index*nt+t;
++						int timepreindex= index*ntimesteps+timeindex2;
++						G_viscoelastic_interpolated[timeindex]+=(1-lincoeff)*G_viscoelastic[timepreindex]+lincoeff*G_viscoelastic[timepreindex+1];
++						U_viscoelastic_interpolated[timeindex]+=(1-lincoeff)*U_viscoelastic[timepreindex]+lincoeff*U_viscoelastic[timepreindex+1];
++						if(horiz)H_viscoelastic_interpolated[timeindex]+=(1-lincoeff)*H_viscoelastic[timepreindex]+lincoeff*H_viscoelastic[timepreindex+1];
++					}
++				}
++						
++			}
++			else if(elastic){
++				nt=1; //in elastic, or if we run only rigid, we need only one step
++#ifdef _HAVE_AD_
++				G_viscoelastic_interpolated=G_viscoelastic;
++				U_viscoelastic_interpolated=U_viscoelastic;
++				if(horiz)H_viscoelastic_interpolated=H_viscoelastic;
++#else
++				G_viscoelastic_interpolated=G_viscoelastic;
++				U_viscoelastic_interpolated=U_viscoelastic;
++				if(horiz)H_viscoelastic_interpolated=H_viscoelastic;
++#endif
++			}	
++
++			/*Save our precomputed tables into parameters*/
++			parameters->AddObject(new DoubleVecParam(SealevelchangeGRigidEnum,G_rigid,M));
++			if(viscous || elastic){
++				parameters->AddObject(new DoubleVecParam(SealevelchangeGViscoElasticEnum,G_viscoelastic_interpolated,M*nt));
++				parameters->AddObject(new DoubleVecParam(SealevelchangeUViscoElasticEnum,U_viscoelastic_interpolated,M*nt));
++				if(horiz)parameters->AddObject(new DoubleVecParam(SealevelchangeHViscoElasticEnum,H_viscoelastic_interpolated,M*nt));
++			}
++
++			/*free resources: */
++			xDelete<IssmDouble>(G_rigid);
++			xDelete<IssmDouble>(G_rigid_local);
++			if(elastic){
++				xDelete<IssmDouble>(love_h);
++				xDelete<IssmDouble>(love_k);
++				xDelete<IssmDouble>(love_l);
++				xDelete<IssmDouble>(love_th);
++				xDelete<IssmDouble>(love_tk);
++				xDelete<IssmDouble>(love_tl);
++				xDelete<IssmDouble>(G_viscoelastic);
++				xDelete<IssmDouble>(G_viscoelastic_local);
++				xDelete<IssmDouble>(U_viscoelastic);
++				xDelete<IssmDouble>(U_viscoelastic_local);
++				if(horiz){
++					xDelete<IssmDouble>(H_viscoelastic);
++					xDelete<IssmDouble>(H_viscoelastic_local);
++				}
++			}
++		} /*}}}*/
++
++		/*Indicate we have not yet run the Geometry Core module: */
++		parameters->AddObject(new BoolParam(SealevelchangeGeometryDoneEnum,false));
++		/*}}}*/
++	}
++
+ 	/*Transitions:{{{ */
+ 	iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions,"md.solidearth.transitions");
+ 	if(transitions){
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26271)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26272)
+@@ -400,6 +400,7 @@
+ 		virtual void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeUpdateViscousFields()=0;
+ 		#endif
+ 
+ };
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26271)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26272)
+@@ -233,6 +233,7 @@
+ 		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
+ 		#endif
+ 
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26271)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26272)
+@@ -188,6 +188,7 @@
+ 		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26271)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26272)
+@@ -195,6 +195,7 @@
+ 		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
+ #endif
+ 
+ #ifdef _HAVE_DAKOTA_
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26271)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26272)
+@@ -6099,27 +6099,33 @@
+ 	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
++	/*stacks:*/
++	IssmDouble* stackRSL = NULL;
++	IssmDouble* stackU = NULL;
++	IssmDouble* stackN = NULL;
++	IssmDouble* stackE = NULL;
++
+ 	#ifdef _HAVE_RESTRICT_
+ 	IssmDouble* __restrict__ G=NULL;
+ 	IssmDouble* __restrict__ GU=NULL;
+ 	IssmDouble* __restrict__ GN=NULL;
+ 	IssmDouble* __restrict__ GE=NULL;
+-	IssmDouble* __restrict__ G_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ G_viscoelastic_precomputed=NULL;
+ 	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
+-	IssmDouble* __restrict__ U_elastic_precomputed=NULL;
+-	IssmDouble* __restrict__ H_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ U_viscoelastic_precomputed=NULL;
++	IssmDouble* __restrict__ H_viscoelastic_precomputed=NULL;
+ 	#else
+ 	IssmDouble* G=NULL;
+ 	IssmDouble* GU=NULL;
+ 	IssmDouble* GN=NULL;
+ 	IssmDouble* GE=NULL;
+-	IssmDouble* G_elastic_precomputed=NULL;
++	IssmDouble* G_viscoelastic_precomputed=NULL;
+ 	IssmDouble* G_rigid_precomputed=NULL;
+-	IssmDouble* U_elastic_precomputed=NULL;
+-	IssmDouble* H_elastic_precomputed=NULL;
++	IssmDouble* U_viscoelastic_precomputed=NULL;
++	IssmDouble* H_viscoelastic_precomputed=NULL;
+ 	#endif
+ 	
+-	/*elastic green function:*/
++	/*viscoelastic green function:*/
+ 	int index;
+ 	int         M;
+ 
+@@ -6127,7 +6133,12 @@
+ 	bool computerigid = false;
+ 	bool computeelastic = false;
+ 	bool computerotation = false;
++	bool computeviscous = false;
+ 	int  horiz;
++	bool istime=true;
++	IssmDouble timeacc=0;
++	IssmDouble start_time,final_time;
++	int  nt,precomputednt;
+ 
+ 	/*Rotational:*/
+ 	IssmDouble* tide_love_h  = NULL;
+@@ -6148,6 +6159,7 @@
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&computerotation,SolidearthSettingsRotationEnum);
++	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+@@ -6172,16 +6184,16 @@
+ 	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
+ 
+ 	if(computeelastic){
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&G_viscoelastic_precomputed,NULL);
++		
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUViscoElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&U_viscoelastic_precomputed,NULL);
+ 
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&M);
+-
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
+-
+-		
++		if(horiz){
++			parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHViscoElasticEnum)); _assert_(parameter);
++			parameter->GetParameterValueByPointer((IssmDouble**)&H_viscoelastic_precomputed,NULL);
++		}
+ 	}
+ 	/*}}}*/
+ 	/*Compute lat long of all vertices in the element:{{{*/
+@@ -6193,15 +6205,26 @@
+ 	}
+ 	/*}}}*/
+ 	/*Compute green functions:{{{ */
++	if(computeviscous){
++		this->parameters->FindParam(&istime,LoveIsTimeEnum);
++		if(!istime)_error_("Frequency love numbers not supported yet!");
++		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
++		this->parameters->FindParam(&start_time,TimesteppingStartTimeEnum);
++		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
++		nt=reCast<int>((final_time-start_time)/timeacc)+1;
++	}
++	else{
++		nt=1; //in elastic, or if we run only rigid, we need only one step
++	}
++
+ 	constant=3/rho_earth/planetarea;
+-	
+-	//Allocate: 
+-	G=xNewZeroInit<IssmDouble>(3*nel);
++
++	G=xNewZeroInit<IssmDouble>(3*nel*nt);
+ 	if(computeelastic){
+-		GU=xNewZeroInit<IssmDouble>(3*nel);
++		GU=xNewZeroInit<IssmDouble>(3*nel*nt);
+ 		if(horiz){
+-			GN=xNewZeroInit<IssmDouble>(3*nel);
+-			GE=xNewZeroInit<IssmDouble>(3*nel);
++			GN=xNewZeroInit<IssmDouble>(3*nel*nt);
++			GE=xNewZeroInit<IssmDouble>(3*nel*nt);
+ 		}
+ 	}
+ 
+@@ -6223,45 +6246,51 @@
+ 			index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
+ 			_assert_(index>0 && index<M);
+ 
+-			/*Rigid earth gravitational perturbation: */
+-			G[i*nel+e]+=G_rigid_precomputed[index];
+-			
+-			if(computeelastic){
+-				G[i*nel+e]+=G_elastic_precomputed[index];
++			if(horiz){
++				/*Compute azimuths, both north and east components: */
++				x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
++				if(lati==M_PI/2){
++					x=1e-12; y=1e-12;
++				}
++				if(lati==-M_PI/2){
++					x=1e-12; y=1e-12;
++				}
++				dx = xxe[e]-x; dy = yye[e]-y; dz = zze[e]-z;
++				N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++				E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+ 			}
+-			G[i*nel+e]=G[i*nel+e]*ratioe;
+ 
+-			/*Elastic components:*/
+-			if(computeelastic){
+-				GU[i*nel+e] =  ratioe * U_elastic_precomputed[index];
+-				if(horiz){
+-					/*Compute azimuths, both north and east components: */
+-					x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
+-					if(lati==M_PI/2){
+-						x=1e-12; y=1e-12;
+-					}
+-					if(lati==-M_PI/2){
+-						x=1e-12; y=1e-12;
+-					}
+-					dx = xxe[e]-x; dy = yye[e]-y; dz = zze[e]-z;
+-					N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+-					E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++			for(int t=0;t<nt;t++){
++				int timeindex=i*nel*nt+e*nt+t; 
+ 
+-					GN[i*nel+e] = ratioe*H_elastic_precomputed[index]*N_azim;
+-					GE[i*nel+e] = ratioe*H_elastic_precomputed[index]*E_azim;
++				/*Rigid earth gravitational perturbation: */
++				G[timeindex]+=G_rigid_precomputed[index];
++
++				/*Find a way to interpolate precomputed Gkernels to our solution time stepping:*/
++				if(computeelastic){
++					G[timeindex]+=G_viscoelastic_precomputed[index*nt+t];
+ 				}
+-			}
+-		}
+-	}
++				G[timeindex]=G[timeindex]*ratioe;
+ 
++				/*Elastic components:*/
++				if(computeelastic){
++					GU[timeindex] =  ratioe * U_viscoelastic_precomputed[index*nt+t];
++					if(horiz){
++						GN[timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*N_azim;
++						GE[timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*E_azim;
++					}
++				}
++			} //for(int t=0;t<nt;t++)
++		} //for (int i=0;i<3;i++)
++	} //for(int e=0;e<nel;e++)
+ 
+ 	/*Add in inputs:*/
+-	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,nel*3);
++	this->inputs->SetArrayInput(SealevelchangeGEnum,this->lid,G,nel*3*nt);
+ 	if(computeelastic){
+-		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,nel*3);
++		this->inputs->SetArrayInput(SealevelchangeGUEnum,this->lid,GU,nel*3*nt);
+ 		if(horiz){
+-			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,nel*3);
+-			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,nel*3);
++			this->inputs->SetArrayInput(SealevelchangeGNEnum,this->lid,GN,nel*3*nt);
++			this->inputs->SetArrayInput(SealevelchangeGEEnum,this->lid,GE,nel*3*nt);
+ 		}
+ 	}
+ 	/*}}}*/
+@@ -6345,6 +6374,22 @@
+ 		}
+ 	}
+ 	/*}}}*/
++	/*Initialize stacks: {{{*/
++	if(computeviscous){
++		stackRSL=xNewZeroInit<IssmDouble>(3*nt);
++		stackU=xNewZeroInit<IssmDouble>(3*nt);
++
++		this->inputs->SetArrayInput(StackRSLEnum,this->lid,stackRSL,3*nt);
++		this->inputs->SetArrayInput(StackUEnum,this->lid,stackU,3*nt);
++		if(horiz){
++			stackN=xNewZeroInit<IssmDouble>(3*nt);
++			stackE=xNewZeroInit<IssmDouble>(3*nt);
++			this->inputs->SetArrayInput(StackNEnum,this->lid,stackRSL,3*nt);
++			this->inputs->SetArrayInput(StackEEnum,this->lid,stackU,3*nt);
++		}
++	}
++	/*}}}*/
++
+ 	/*Free allocations:{{{*/
+ 	#ifdef _HAVE_RESTRICT_
+ 	delete G;
+@@ -6691,10 +6736,10 @@
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+ 	#ifdef _HAVE_RESTRICT_
+-	IssmDouble* __restrict__ G_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ G_viscoelastic_precomputed=NULL;
+ 	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
+-	IssmDouble* __restrict__ U_elastic_precomputed=NULL;
+-	IssmDouble* __restrict__ H_elastic_precomputed=NULL;
++	IssmDouble* __restrict__ U_viscoelastic_precomputed=NULL;
++	IssmDouble* __restrict__ H_viscoelastic_precomputed=NULL;
+ 	IssmDouble** __restrict__ Gsubel=NULL;
+ 	IssmDouble** __restrict__ GUsubel=NULL;
+ 	IssmDouble** __restrict__ GNsubel=NULL;
+@@ -6701,10 +6746,10 @@
+ 	IssmDouble** __restrict__ GEsubel=NULL;
+ 
+ 	#else
+-	IssmDouble* G_elastic_precomputed=NULL;
++	IssmDouble* G_viscoelastic_precomputed=NULL;
+ 	IssmDouble* G_rigid_precomputed=NULL;
+-	IssmDouble* U_elastic_precomputed=NULL;
+-	IssmDouble* H_elastic_precomputed=NULL;
++	IssmDouble* U_viscoelastic_precomputed=NULL;
++	IssmDouble* H_viscoelastic_precomputed=NULL;
+ 	IssmDouble** Gsubel=NULL;
+ 	IssmDouble** GUsubel=NULL;
+ 	IssmDouble** GNsubel=NULL;
+@@ -6718,13 +6763,20 @@
+ 	/*Computational flags:*/
+ 	bool computerigid = false;
+ 	bool computeelastic = false;
++	bool computeviscous = false;
+ 	int  horiz;
+ 
++	bool istime=true;
++	IssmDouble timeacc=0;
++	IssmDouble start_time,final_time;
++	int  nt,precomputednt;
++
+ 	/*}}}*/
+ 	/*Recover parameters:{{{ */
+ 	rho_earth=FindParam(MaterialsEarthDensityEnum);
+ 	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
++	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+@@ -6739,14 +6791,17 @@
+ 	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
+ 
+ 	if(computeelastic){
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&G_elastic_precomputed,&M);
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&G_viscoelastic_precomputed,NULL);
+ 
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&H_elastic_precomputed,&M);
++		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUViscoElasticEnum)); _assert_(parameter);
++		parameter->GetParameterValueByPointer((IssmDouble**)&U_viscoelastic_precomputed,NULL);
+ 
+-		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUElasticEnum)); _assert_(parameter);
+-		parameter->GetParameterValueByPointer((IssmDouble**)&U_elastic_precomputed,&M);
++		if(horiz){
++			parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeHViscoElasticEnum)); _assert_(parameter);
++			parameter->GetParameterValueByPointer((IssmDouble**)&H_viscoelastic_precomputed,NULL);
++
++		}
+ 	}
+ 	/*}}}*/
+ 	/*Compute lat long of all vertices in the element:{{{*/
+@@ -6759,6 +6814,17 @@
+ 	/*Compute green functions:{{{ */
+ 	constant=3/rho_earth/planetarea;
+ 
++	if(computeviscous){
++		this->parameters->FindParam(&istime,LoveIsTimeEnum);
++		if(!istime)_error_("Frequency love numbers not supported yet!");
++		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
++		this->parameters->FindParam(&start_time,TimesteppingStartTimeEnum);
++		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
++		nt=reCast<int>((final_time-start_time)/timeacc)+1;
++	}
++	else{
++		nt=1; //in elastic, or if we run only rigid, we need only one step
++	}
+ 	Gsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+ 	if(computeelastic){
+ 		GUsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+@@ -6771,12 +6837,12 @@
+ 	//Allocate: 
+ 	for(int l=0;l<SLGEOM_NUMLOADS;l++){
+ 		int nbar=slgeom->nbar[l];
+-		Gsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
++		Gsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
+ 		if(computeelastic){
+-			GUsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
++			GUsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
+ 			if(horiz){
+-				GNsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
+-				GEsubel[l]=xNewZeroInit<IssmDouble>(3*nbar);
++				GNsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
++				GEsubel[l]=xNewZeroInit<IssmDouble>(3*nbar*nt);
+ 			}
+ 		}
+ 
+@@ -6794,41 +6860,49 @@
+ 				lati=latitude[i];
+ 				longi=longitude[i];
+ 
++				if(horiz){
++					/*Compute azimuths, both north and east components: */
++					x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
++					if(lati==90){
++						x=1e-12; y=1e-12;
++					}
++					if(lati==-90){
++						x=1e-12; y=1e-12;
++					}
++					IssmDouble xbar=planetradius*cos(late)*cos(longe);
++					IssmDouble ybar=planetradius*cos(late)*sin(longe);
++					IssmDouble zbar=planetradius*sin(late);
++
++					dx = xbar-x; dy = ybar-y; dz = zbar-z;
++					N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++					E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++				}
++
+ 				/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+ 				delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+ 				alpha=2.*asin(sqrt(pow(sin(delPhi/2.0),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2.0),2.0)));
+ 				index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
+ 
+-				/*Rigid earth gravitational perturbation: */
+-				Gsubel[l][i*nbar+e]+=G_rigid_precomputed[index];
+ 
+-				if(computeelastic){
+-					Gsubel[l][i*nbar+e]+=G_elastic_precomputed[index];
+-				}
+-				Gsubel[l][i*nbar+e]*=ratioe;
++				for(int t=0;t<nt;t++){
++					int timeindex=i*nbar*nt+e*nt+t; 
+ 
+-				/*Elastic components:*/
+-				if(computeelastic){
+-					GUsubel[l][i*nbar+e] =  ratioe * U_elastic_precomputed[index];
+-					if(horiz){
+-						/*Compute azimuths, both north and east components: */
+-						x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
+-						if(lati==90){
+-							x=1e-12; y=1e-12;
+-						}
+-						if(lati==-90){
+-							x=1e-12; y=1e-12;
+-						}
+-						IssmDouble xbar=planetradius*cos(late)*cos(longe);
+-						IssmDouble ybar=planetradius*cos(late)*sin(longe);
+-						IssmDouble zbar=planetradius*sin(late);
++					/*Rigid earth gravitational perturbation: */
++					Gsubel[l][timeindex]+=G_rigid_precomputed[index];
+ 
+-						dx = xbar-x; dy = ybar-y; dz = zbar-z;
+-						N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
+-						E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
++					if(computeelastic){
++						Gsubel[l][timeindex]+=G_viscoelastic_precomputed[index*nt+t];
++					}
++					Gsubel[l][timeindex]*=ratioe;
+ 
+-						GNsubel[l][i*nbar+e] = ratioe*H_elastic_precomputed[index]*N_azim;
+-						GEsubel[l][i*nbar+e] = ratioe*H_elastic_precomputed[index]*E_azim;
++					/*Elastic components:*/
++					if(computeelastic){
++						GUsubel[l][timeindex] =  ratioe * U_viscoelastic_precomputed[index*nt+t];
++
++						if(horiz){
++							GNsubel[l][timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*N_azim;
++							GEsubel[l][timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*E_azim;
++						}
+ 					}
+ 				}
+ 			}
+@@ -6837,12 +6911,12 @@
+ 
+ 	/*Save all these arrayins for each element:*/
+ 	for (int l=0;l<SLGEOM_NUMLOADS;l++){
+-		this->inputs->SetArrayInput(slgeom->GEnum(l),this->lid,Gsubel[l],slgeom->nbar[l]*3);
++		this->inputs->SetArrayInput(slgeom->GEnum(l),this->lid,Gsubel[l],slgeom->nbar[l]*3*nt);
+ 		if(computeelastic){
+-			this->inputs->SetArrayInput(slgeom->GUEnum(l),this->lid,GUsubel[l],slgeom->nbar[l]*3);
++			this->inputs->SetArrayInput(slgeom->GUEnum(l),this->lid,GUsubel[l],slgeom->nbar[l]*3*nt);
+ 			if(horiz){
+-				this->inputs->SetArrayInput(slgeom->GNEnum(l),this->lid,GNsubel[l],slgeom->nbar[l]*3);
+-				this->inputs->SetArrayInput(slgeom->GEEnum(l),this->lid,GEsubel[l],slgeom->nbar[l]*3);
++				this->inputs->SetArrayInput(slgeom->GNEnum(l),this->lid,GNsubel[l],slgeom->nbar[l]*3*nt);
++				this->inputs->SetArrayInput(slgeom->GEEnum(l),this->lid,GEsubel[l],slgeom->nbar[l]*3*nt);
+ 			}
+ 		}
+ 	}
+@@ -6871,6 +6945,71 @@
+ 
+ }
+ /*}}}*/
++void       Tria::SealevelchangeUpdateViscousFields(){ /*{{{*/
++	
++	/*Inputs:*/
++	IssmDouble* stackRSL=NULL;
++	IssmDouble* stackU=NULL;
++	IssmDouble* stackN=NULL;
++	IssmDouble* stackE=NULL;
++	IssmDouble* stacktimes=NULL;
++	int         stacknumsteps;
++	int         stackindex; 
++	int         newindex; 
++	int         dummy;
++	bool        viscous=false;
++	IssmDouble  currenttime;
++	IssmDouble  lincoeff=0;
++	int horiz;
++		
++	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
++	
++	if(viscous){
++		this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++		
++		this->parameters->FindParam(&stacknumsteps,StackNumStepsEnum);
++		this->parameters->FindParam(&stacktimes,NULL,StackTimesEnum);
++		this->parameters->FindParam(&stackindex,StackIndexEnum);
++		this->parameters->FindParam(&currenttime,TimeEnum);
++
++		this->inputs->GetArrayPtr(StackRSLEnum,this->lid,&stackRSL,&dummy);
++		this->inputs->GetArrayPtr(StackUEnum,this->lid,&stackU,&dummy);
++		if(horiz){
++			this->inputs->GetArrayPtr(StackNEnum,this->lid,&stackN,&dummy);
++			this->inputs->GetArrayPtr(StackEEnum,this->lid,&stackE,&dummy);
++		}
++
++		lincoeff=0;
++		newindex=stacknumsteps-2;
++		for(int t=stackindex;t<stacknumsteps;t++){
++			if (stacktimes[t]>currenttime){
++				newindex=t-1;
++				lincoeff=(currenttime-stacktimes[newindex])/(stacktimes[t]-stacktimes[newindex]);
++				break;
++			}
++		}
++		if(newindex==(stacknumsteps-2))lincoeff=1;
++		stacktimes[newindex]=currenttime;
++		for(int i=0;i<NUMVERTICES;i++){
++			stackRSL[i*stacknumsteps+newindex]=(1-lincoeff)*stackRSL[i*stacknumsteps+newindex]+lincoeff*stackRSL[i*stacknumsteps+newindex+1];
++			stackU[i*stacknumsteps+newindex]=(1-lincoeff)*stackU[i*stacknumsteps+newindex]+lincoeff*stackU[i*stacknumsteps+newindex+1];
++			if(horiz){
++				stackN[i*stacknumsteps+newindex]=(1-lincoeff)*stackN[i*stacknumsteps+newindex]+lincoeff*stackN[i*stacknumsteps+newindex+1];
++				stackE[i*stacknumsteps+newindex]=(1-lincoeff)*stackE[i*stacknumsteps+newindex]+lincoeff*stackE[i*stacknumsteps+newindex+1];
++			}
++		}
++		stackindex=newindex;
++
++		this->parameters->SetParam(stackindex,StackIndexEnum);
++		this->parameters->SetParam(stacktimes,stacknumsteps,StackTimesEnum);
++
++		/*free allocations:*/
++		xDelete<IssmDouble>(stacktimes);
++	}
++
++
++}
++/*}}}*/
+ void       Tria::SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*Inputs:*/
+@@ -6958,8 +7097,10 @@
+ 	IssmDouble oceanaverage=0;
+ 	IssmDouble oceanarea=0;
+ 	IssmDouble rho_water;
++	bool computefuture=false;
+ 	
+ 	bool sal = false;
++	bool viscous = false;
+ 	bool rotation= false;
+ 	bool percpu= false;
+ 	int  size;
+@@ -6967,8 +7108,9 @@
+ 	IssmDouble Grotm1[3];
+ 	IssmDouble Grotm2[3];
+ 	IssmDouble Grotm3[3];
+-	
++		
+ 	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+ 	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+ 	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+@@ -6979,7 +7121,7 @@
+ 		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
+ 		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
+ 
+-		this->SealevelchangeGxL(sealevelpercpu, G, Gsub, loads, slgeom, nel,percpu=true);
++		this->SealevelchangeGxL(sealevelpercpu, G, Gsub, loads, slgeom, nel,percpu=true,StackRSLEnum,computefuture=false);
+ 	}
+ 
+ 	if(rotation){
+@@ -7050,6 +7192,7 @@
+ 	IssmDouble* GUsub[SLGEOM_NUMLOADS];
+ 	IssmDouble* GNsub[SLGEOM_NUMLOADS];
+ 	IssmDouble* GEsub[SLGEOM_NUMLOADS];
++	bool computefuture=false;
+ 
+ 	int horiz;
+ 	int size;
+@@ -7101,14 +7244,13 @@
+ 				this->inputs->GetArrayPtr(SealevelchangeGEsubelOceanEnum,this->lid,&GEsub[SLGEOM_OCEAN],&size);
+ 			}
+ 		}
++		this->SealevelchangeGxL(&SealevelRSL[0],G, Gsub, loads, slgeom, nel,percpu=false,StackRSLEnum,computefuture=true);
+ 
+-		this->SealevelchangeGxL(&SealevelRSL[0],G, Gsub, loads, slgeom, nel,percpu=false);
+-
+ 		if(elastic){
+-			this->SealevelchangeGxL(&SealevelU[0],GU, GUsub, loads, slgeom, nel,percpu=false);
++			this->SealevelchangeGxL(&SealevelU[0],GU, GUsub, loads, slgeom, nel,percpu=false,StackUEnum,computefuture=true);
+ 			if(horiz ){
+-				this->SealevelchangeGxL(&SealevelN[0],GN, GNsub, loads, slgeom, nel,percpu=false);
+-				this->SealevelchangeGxL(&SealevelE[0],GE, GEsub, loads, slgeom, nel,percpu=false);
++				this->SealevelchangeGxL(&SealevelN[0],GN, GNsub, loads, slgeom, nel,percpu=false,StackNEnum,computefuture=true);
++				this->SealevelchangeGxL(&SealevelE[0],GE, GEsub, loads, slgeom, nel,percpu=false,StackEEnum,computefuture=true);
+ 			}
+ 		}
+ 	}
+@@ -7165,25 +7307,51 @@
+ 
+ 
+ } /*}}}*/
+-void       Tria::SealevelchangeGxL(IssmDouble* sealevelout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu) { /*{{{*/
++void       Tria::SealevelchangeGxL(IssmDouble* sealevelout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu, int stackenum, bool computefuture) { /*{{{*/
+ 
+-	IssmDouble sealevel[3]={0};
+-	int i,e,l,nbar;
++	IssmDouble* sealevel=NULL;
++	int i,e,l,t,nbar;
++	bool viscous=false;
++	IssmDouble* stack=NULL;
++	int nt=1; //important
++	int stackindex=0; //important
++	int stacknumsteps=1; //important
+ 
++	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
++	if(viscous){
++		this->parameters->FindParam(&stacknumsteps,StackNumStepsEnum);
++		if(computefuture) nt=stacknumsteps;
++		else nt=1;
++
++		//allocate
++		sealevel=xNewZeroInit<IssmDouble>(3*nt);
++	}
++	else sealevel=xNewZeroInit<IssmDouble>(3*nt);
++
+ 	if(loads->sealevelloads){
++
+ 		for(i=0;i<NUMVERTICES;i++) {
+ 			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 			for (e=0;e<nel;e++){
+-				sealevel[i]+=G[i*nel+e]*(loads->sealevelloads[e]+loads->loads[e]);
++				for(t=0;t<nt;t++){
++					int index=i*nel*stacknumsteps+e*stacknumsteps+t;
++					sealevel[i*nt+t]+=G[index]*(loads->sealevelloads[e]+loads->loads[e]);
++				}
+ 			}
+ 			for(l=0;l<SLGEOM_NUMLOADS;l++){
+ 				nbar=slgeom->nbar[l];
+ 				for (e=0;e<nbar;e++){
+-					sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subloads[l][e]);
++					for(t=0;t<nt;t++){
++						int index=i*nbar*stacknumsteps+e*stacknumsteps+t;
++						sealevel[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
++					}
+ 				}
+ 				if(l==SLGEOM_OCEAN){
+ 					for (e=0;e<nbar;e++){
+-						sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subsealevelloads[e]);
++						for(t=0;t<nt;t++){
++							int index=i*nbar*stacknumsteps+e*stacknumsteps+t;
++							sealevel[i*nt+t]+=Gsub[l][index]*(loads->subsealevelloads[e]);
++						}
+ 					}
+ 				}
+ 			}
+@@ -7190,28 +7358,85 @@
+ 		}
+ 	}
+ 	else{  //this is the initial convolution where only loads are provided
++
+ 		for(i=0;i<NUMVERTICES;i++) {
+ 			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 			for (e=0;e<nel;e++){
+-				sealevel[i]+=G[i*nel+e]*(loads->loads[e]);
++				for(t=0;t<nt;t++){
++					int index=i*nel*stacknumsteps+e*stacknumsteps+t;
++					sealevel[i*nt+t]+=G[index]*(loads->loads[e]);
++				}
+ 			}
+ 			for(l=0;l<SLGEOM_NUMLOADS;l++){
+ 				nbar=slgeom->nbar[l];
+ 				for (e=0;e<nbar;e++){
+-					sealevel[i]+=Gsub[l][i*nbar+e]*(loads->subloads[l][e]);
++					for(t=0;t<nt;t++){
++						int index=i*nbar*stacknumsteps+e*stacknumsteps+t;
++						sealevel[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
++					}
+ 				}
+ 			}
+ 		}
+ 	}
++	
++	if(viscous){
++		IssmDouble* sealevelinterp=NULL;
++		IssmDouble* stacktimes=NULL;
++		IssmDouble  final_time;
++		IssmDouble  lincoeff;
++		IssmDouble  timeacc;
+ 
++		this->parameters->FindParam(&stackindex,StackIndexEnum);
++		this->parameters->FindParam(&stacktimes,NULL,StackTimesEnum);
++		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
++		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
++		this->inputs->GetArrayPtr(stackenum,this->lid,&stack,NULL);
++		if(computefuture){
++			sealevelinterp=xNew<IssmDouble>(3*nt); 
++			if(stacktimes[stackindex]<final_time){
++				lincoeff=1-(stacktimes[stackindex+1]-stacktimes[stackindex])/timeacc;
++				for(int t=stackindex;t<nt;t++){
++					if(t==stackindex){
++						for(int i=0;i<NUMVERTICES;i++){
++							sealevelinterp[i*nt+t]=  sealevel[i*nt+0];
++						}
++					}
++					else{
++						for(int i=0;i<NUMVERTICES;i++){
++							sealevelinterp[i*nt+t]=  (1-lincoeff)*sealevel[i*nt+(t-stackindex-1)]+lincoeff*sealevel[i*nt+(t-stackindex)];
++						}
++					}
++				}
++			}
++		}
++
++		/*update sealevel at present time using stack at present time: */
++		for(int i=0;i<NUMVERTICES;i++){
++			sealevel[i*nt+0]+=stack[i*stacknumsteps+stackindex]; 
++		}
++
++		if(computefuture){ /*update stack with future deformation from present load: */
++			for(int t=stackindex;t<nt;t++){
++				for(int i=0;i<NUMVERTICES;i++){
++					stack[i*stacknumsteps+t]+=sealevelinterp[i*nt+t];
++				}
++			}
++			/*Re-add stack now that we updated:*/
++			this->inputs->SetArrayInput(stackenum,this->lid,stack,3*stacknumsteps);
++		}
++
++		/*Free allocatoins:*/
++		xDelete<IssmDouble>(stacktimes);
++	}
++
+ 	/*store values computed on vertices, but don't repeat the computation if another element already computed it!:*/
+ 	if(percpu){
+ 		for(i=0;i<NUMVERTICES;i++){
+-			if(slgeom->lids[this->vertices[i]->lid]==this->lid)sealevelout[this->vertices[i]->lid]=sealevel[i];
++			if(slgeom->lids[this->vertices[i]->lid]==this->lid)sealevelout[this->vertices[i]->lid]=sealevel[i*nt+0];
+ 		}
+ 	}
+ 	else{
+-		for(i=0;i<NUMVERTICES;i++) sealevelout[i]=sealevel[i];
++		for(i=0;i<NUMVERTICES;i++) sealevelout[i]=sealevel[i*nt+0];
+ 	}
+ 
+ } /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26271)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26272)
+@@ -179,6 +179,7 @@
+ 		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom);
+ 		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom);
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom);
++		void       SealevelchangeUpdateViscousFields();
+ 		#endif
+ 		/*}}}*/
+ 		/*Tria specific routines:{{{*/
+@@ -242,7 +243,7 @@
+ 		void           StabilizationParameterAnisotropic(IssmDouble* tau_parameter_ansiotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
+ 		void           UpdateConstraintsExtrudeFromBase(void);
+ 		void           UpdateConstraintsExtrudeFromTop(void);
+-		void           SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool optimize);
++		void           SealevelchangeGxL(IssmDouble* sealevel, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu,int stackenum,bool computefuture);
+ 		/*}}}*/
+ 
+ };
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26271)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26272)
+@@ -244,6 +244,7 @@
+ 	int  grd=0;
+ 	int  grdmodel; 
+ 	int  computesealevel=0;
++	bool viscous=false;
+ 	IssmDouble*           sealevelpercpu=NULL;
+ 
+ 	/*}}}*/
+@@ -258,6 +259,7 @@
+ 	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+ 	femmodel->parameters->FindParam(&max_nonlinear_iterations,SolidearthSettingsMaxiterEnum);
+ 	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
++	femmodel->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+ 	/*}}}*/
+ 
+ 	/*only run if grd was requested, if we are the earth, and we have reached
+@@ -295,6 +297,12 @@
+ 	sealevelpercpu=xNewZeroInit<IssmDouble>(femmodel->vertices->Size());
+ 
+ 	if(VerboseSolution()) _printf0_("	  starting  GRD convolutions\n");
++	
++	/*update viscous RSL:*/
++	for(Object* & object : femmodel->elements->objects){
++		Element* element = xDynamicCast<Element*>(object);
++		element->SealevelchangeUpdateViscousFields();
++	}
+ 
+ 	/*buildup loads: */
+ 	for(Object* & object : femmodel->elements->objects){
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26271)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26272)
+@@ -357,6 +357,7 @@
+ 	SolidearthSettingsCrossSectionShapeEnum,
+ 	RotationalAngularVelocityEnum,
+ 	SolidearthSettingsElasticEnum,
++	SolidearthSettingsViscousEnum,
+ 	SealevelchangeGeometryDoneEnum,
+ 	RotationalEquatorialMoiEnum,
+ 	TidalLoveHEnum,
+@@ -366,12 +367,15 @@
+ 	LoadLoveHEnum,
+ 	LoadLoveKEnum,
+ 	LoadLoveLEnum,
++	LoveTimeFreqEnum,
++	LoveIsTimeEnum,
+ 	SealevelchangeGRigidEnum,
+-	SealevelchangeGElasticEnum,
++	SealevelchangeGViscoElasticEnum,
+ 	SolidearthSettingsComputesealevelchangeEnum,
+ 	SolidearthSettingsGRDEnum,
+ 	SolidearthSettingsRunFrequencyEnum,
+-	SealevelchangeHElasticEnum,
++	SolidearthSettingsTimeAccEnum,
++	SealevelchangeHViscoElasticEnum,
+ 	SolidearthSettingsHorizEnum,
+ 	SolidearthSettingsMaxiterEnum,
+ 	SolidearthSettingsOceanAreaScalingEnum,
+@@ -382,7 +386,7 @@
+ 	SolidearthSettingsRotationEnum,
+ 	SealevelchangeRunCountEnum,
+ 	SealevelchangeTransitionsEnum,
+-	SealevelchangeUElasticEnum,
++	SealevelchangeUViscoElasticEnum,
+ 	SettingsIoGatherEnum,
+ 	SettingsNumResultsOnNodesEnum,
+ 	SettingsOutputFrequencyEnum,
+@@ -391,6 +395,9 @@
+ 	SettingsSbCouplingFrequencyEnum,
+ 	SettingsSolverResidueThresholdEnum,
+ 	SettingsWaitonlockEnum,
++	StackNumStepsEnum,
++	StackTimesEnum,
++	StackIndexEnum,
+ 	SmbAIceEnum,
+ 	SmbAIdxEnum,
+ 	SmbASnowEnum,
+@@ -945,6 +952,10 @@
+ 	SolidearthExternalDisplacementUpRateEnum,
+ 	SolidearthExternalGeoidRateEnum,
+ 	SolidearthExternalBarystaticSeaLevelRateEnum,
++	StackRSLEnum,
++	StackUEnum,
++	StackNEnum,
++	StackEEnum,
+ 	StrainRateeffectiveEnum,
+ 	StrainRateparallelEnum,
+ 	StrainRateperpendicularEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26271)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26272)
+@@ -365,6 +365,7 @@
+ 		case SolidearthSettingsCrossSectionShapeEnum : return "SolidearthSettingsCrossSectionShape";
+ 		case RotationalAngularVelocityEnum : return "RotationalAngularVelocity";
+ 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
++		case SolidearthSettingsViscousEnum : return "SolidearthSettingsViscous";
+ 		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
+ 		case RotationalEquatorialMoiEnum : return "RotationalEquatorialMoi";
+ 		case TidalLoveHEnum : return "TidalLoveH";
+@@ -374,12 +375,15 @@
+ 		case LoadLoveHEnum : return "LoadLoveH";
+ 		case LoadLoveKEnum : return "LoadLoveK";
+ 		case LoadLoveLEnum : return "LoadLoveL";
++		case LoveTimeFreqEnum : return "LoveTimeFreq";
++		case LoveIsTimeEnum : return "LoveIsTime";
+ 		case SealevelchangeGRigidEnum : return "SealevelchangeGRigid";
+-		case SealevelchangeGElasticEnum : return "SealevelchangeGElastic";
++		case SealevelchangeGViscoElasticEnum : return "SealevelchangeGViscoElastic";
+ 		case SolidearthSettingsComputesealevelchangeEnum : return "SolidearthSettingsComputesealevelchange";
+ 		case SolidearthSettingsGRDEnum : return "SolidearthSettingsGRD";
+ 		case SolidearthSettingsRunFrequencyEnum : return "SolidearthSettingsRunFrequency";
+-		case SealevelchangeHElasticEnum : return "SealevelchangeHElastic";
++		case SolidearthSettingsTimeAccEnum : return "SolidearthSettingsTimeAcc";
++		case SealevelchangeHViscoElasticEnum : return "SealevelchangeHViscoElastic";
+ 		case SolidearthSettingsHorizEnum : return "SolidearthSettingsHoriz";
+ 		case SolidearthSettingsMaxiterEnum : return "SolidearthSettingsMaxiter";
+ 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
+@@ -390,7 +394,7 @@
+ 		case SolidearthSettingsRotationEnum : return "SolidearthSettingsRotation";
+ 		case SealevelchangeRunCountEnum : return "SealevelchangeRunCount";
+ 		case SealevelchangeTransitionsEnum : return "SealevelchangeTransitions";
+-		case SealevelchangeUElasticEnum : return "SealevelchangeUElastic";
++		case SealevelchangeUViscoElasticEnum : return "SealevelchangeUViscoElastic";
+ 		case SettingsIoGatherEnum : return "SettingsIoGather";
+ 		case SettingsNumResultsOnNodesEnum : return "SettingsNumResultsOnNodes";
+ 		case SettingsOutputFrequencyEnum : return "SettingsOutputFrequency";
+@@ -399,6 +403,9 @@
+ 		case SettingsSbCouplingFrequencyEnum : return "SettingsSbCouplingFrequency";
+ 		case SettingsSolverResidueThresholdEnum : return "SettingsSolverResidueThreshold";
+ 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
++		case StackNumStepsEnum : return "StackNumSteps";
++		case StackTimesEnum : return "StackTimes";
++		case StackIndexEnum : return "StackIndex";
+ 		case SmbAIceEnum : return "SmbAIce";
+ 		case SmbAIdxEnum : return "SmbAIdx";
+ 		case SmbASnowEnum : return "SmbASnow";
+@@ -950,6 +957,10 @@
+ 		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+ 		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
+ 		case SolidearthExternalBarystaticSeaLevelRateEnum : return "SolidearthExternalBarystaticSeaLevelRate";
++		case StackRSLEnum : return "StackRSL";
++		case StackUEnum : return "StackU";
++		case StackNEnum : return "StackN";
++		case StackEEnum : return "StackE";
+ 		case StrainRateeffectiveEnum : return "StrainRateeffective";
+ 		case StrainRateparallelEnum : return "StrainRateparallel";
+ 		case StrainRateperpendicularEnum : return "StrainRateperpendicular";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26271)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26272)
+@@ -371,6 +371,7 @@
+ 	      else if (strcmp(name,"SolidearthSettingsCrossSectionShape")==0) return SolidearthSettingsCrossSectionShapeEnum;
+ 	      else if (strcmp(name,"RotationalAngularVelocity")==0) return RotationalAngularVelocityEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
++	      else if (strcmp(name,"SolidearthSettingsViscous")==0) return SolidearthSettingsViscousEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
+ 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
+ 	      else if (strcmp(name,"TidalLoveH")==0) return TidalLoveHEnum;
+@@ -380,15 +381,18 @@
+ 	      else if (strcmp(name,"LoadLoveH")==0) return LoadLoveHEnum;
+ 	      else if (strcmp(name,"LoadLoveK")==0) return LoadLoveKEnum;
+ 	      else if (strcmp(name,"LoadLoveL")==0) return LoadLoveLEnum;
+-	      else if (strcmp(name,"SealevelchangeGRigid")==0) return SealevelchangeGRigidEnum;
+-	      else if (strcmp(name,"SealevelchangeGElastic")==0) return SealevelchangeGElasticEnum;
++	      else if (strcmp(name,"LoveTimeFreq")==0) return LoveTimeFreqEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
++	      if (strcmp(name,"LoveIsTime")==0) return LoveIsTimeEnum;
++	      else if (strcmp(name,"SealevelchangeGRigid")==0) return SealevelchangeGRigidEnum;
++	      else if (strcmp(name,"SealevelchangeGViscoElastic")==0) return SealevelchangeGViscoElasticEnum;
++	      else if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsGRD")==0) return SolidearthSettingsGRDEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRunFrequency")==0) return SolidearthSettingsRunFrequencyEnum;
+-	      else if (strcmp(name,"SealevelchangeHElastic")==0) return SealevelchangeHElasticEnum;
++	      else if (strcmp(name,"SolidearthSettingsTimeAcc")==0) return SolidearthSettingsTimeAccEnum;
++	      else if (strcmp(name,"SealevelchangeHViscoElastic")==0) return SealevelchangeHViscoElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsHoriz")==0) return SolidearthSettingsHorizEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsMaxiter")==0) return SolidearthSettingsMaxiterEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+@@ -399,7 +403,7 @@
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+-	      else if (strcmp(name,"SealevelchangeUElastic")==0) return SealevelchangeUElasticEnum;
++	      else if (strcmp(name,"SealevelchangeUViscoElastic")==0) return SealevelchangeUViscoElasticEnum;
+ 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+ 	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+@@ -408,6 +412,9 @@
+ 	      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,"StackNumSteps")==0) return StackNumStepsEnum;
++	      else if (strcmp(name,"StackTimes")==0) return StackTimesEnum;
++	      else if (strcmp(name,"StackIndex")==0) return StackIndexEnum;
+ 	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
+ 	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
+ 	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
+@@ -498,7 +505,10 @@
+ 	      else if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingInterpForcing")==0) return TimesteppingInterpForcingEnum;
+-	      else if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
+ 	      else if (strcmp(name,"TimesteppingStartTime")==0) return TimesteppingStartTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
+ 	      else if (strcmp(name,"TimesteppingTimeStepMax")==0) return TimesteppingTimeStepMaxEnum;
+@@ -505,10 +515,7 @@
+ 	      else if (strcmp(name,"TimesteppingTimeStepMin")==0) return TimesteppingTimeStepMinEnum;
+ 	      else if (strcmp(name,"TimesteppingType")==0) return TimesteppingTypeEnum;
+ 	      else if (strcmp(name,"ToMITgcmComm")==0) return ToMITgcmCommEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"ToolkitsFileName")==0) return ToolkitsFileNameEnum;
++	      else if (strcmp(name,"ToolkitsFileName")==0) return ToolkitsFileNameEnum;
+ 	      else if (strcmp(name,"ToolkitsOptionsAnalyses")==0) return ToolkitsOptionsAnalysesEnum;
+ 	      else if (strcmp(name,"ToolkitsOptionsStrings")==0) return ToolkitsOptionsStringsEnum;
+ 	      else if (strcmp(name,"ToolkitsTypes")==0) return ToolkitsTypesEnum;
+@@ -621,7 +628,10 @@
+ 	      else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
+ 	      else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
+ 	      else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum;
+-	      else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
+ 	      else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum;
+ 	      else if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum;
+ 	      else if (strcmp(name,"DeviatoricStress1")==0) return DeviatoricStress1Enum;
+@@ -628,10 +638,7 @@
+ 	      else if (strcmp(name,"DeviatoricStress2")==0) return DeviatoricStress2Enum;
+ 	      else if (strcmp(name,"DistanceToCalvingfront")==0) return DistanceToCalvingfrontEnum;
+ 	      else if (strcmp(name,"DistanceToGroundingline")==0) return DistanceToGroundinglineEnum;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"Domain2Dhorizontal")==0) return Domain2DhorizontalEnum;
++	      else if (strcmp(name,"Domain2Dhorizontal")==0) return Domain2DhorizontalEnum;
+ 	      else if (strcmp(name,"Domain2Dvertical")==0) return Domain2DverticalEnum;
+ 	      else if (strcmp(name,"Domain3D")==0) return Domain3DEnum;
+ 	      else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
+@@ -744,7 +751,10 @@
+ 	      else if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyEsbar")==0) return MaterialsRheologyEsbarEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
+-	      else if (strcmp(name,"MeshScaleFactor")==0) return MeshScaleFactorEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"MeshScaleFactor")==0) return MeshScaleFactorEnum;
+ 	      else if (strcmp(name,"MeshVertexonbase")==0) return MeshVertexonbaseEnum;
+ 	      else if (strcmp(name,"MeshVertexonboundary")==0) return MeshVertexonboundaryEnum;
+ 	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
+@@ -751,10 +761,7 @@
+ 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+ 	      else if (strcmp(name,"MovingFrontalVx")==0) return MovingFrontalVxEnum;
+ 	      else if (strcmp(name,"MovingFrontalVy")==0) return MovingFrontalVyEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"Neumannflux")==0) return NeumannfluxEnum;
++	      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;
+@@ -867,7 +874,10 @@
+ 	      else if (strcmp(name,"SmbAValue")==0) return SmbAValueEnum;
+ 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
+ 	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
+-	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
+ 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+ 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+ 	      else if (strcmp(name,"SmbBNeg")==0) return SmbBNegEnum;
+@@ -874,10 +884,7 @@
+ 	      else if (strcmp(name,"SmbBPos")==0) return SmbBPosEnum;
+ 	      else if (strcmp(name,"SmbC")==0) return SmbCEnum;
+ 	      else if (strcmp(name,"SmbCcsnowValue")==0) return SmbCcsnowValueEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbCciceValue")==0) return SmbCciceValueEnum;
++	      else if (strcmp(name,"SmbCciceValue")==0) return SmbCciceValueEnum;
+ 	      else if (strcmp(name,"SmbCotValue")==0) return SmbCotValueEnum;
+ 	      else if (strcmp(name,"SmbD")==0) return SmbDEnum;
+ 	      else if (strcmp(name,"SmbDailyairdensity")==0) return SmbDailyairdensityEnum;
+@@ -971,6 +978,10 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalBarystaticSeaLevelRate")==0) return SolidearthExternalBarystaticSeaLevelRateEnum;
++	      else if (strcmp(name,"StackRSL")==0) return StackRSLEnum;
++	      else if (strcmp(name,"StackU")==0) return StackUEnum;
++	      else if (strcmp(name,"StackN")==0) return StackNEnum;
++	      else if (strcmp(name,"StackE")==0) return StackEEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+@@ -986,7 +997,10 @@
+ 	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
+ 	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+ 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+-	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+ 	      else if (strcmp(name,"SurfaceAbsMisfit")==0) return SurfaceAbsMisfitEnum;
+ 	      else if (strcmp(name,"SurfaceAbsVelMisfit")==0) return SurfaceAbsVelMisfitEnum;
+ 	      else if (strcmp(name,"Area")==0) return AreaEnum;
+@@ -997,10 +1011,7 @@
+ 	      else if (strcmp(name,"Surface")==0) return SurfaceEnum;
+ 	      else if (strcmp(name,"SurfaceOld")==0) return SurfaceOldEnum;
+ 	      else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;
++	      else if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;
+ 	      else if (strcmp(name,"SurfaceObservation")==0) return SurfaceObservationEnum;
+ 	      else if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum;
+ 	      else if (strcmp(name,"SurfaceSlopeX")==0) return SurfaceSlopeXEnum;
+@@ -1109,7 +1120,10 @@
+ 	      else if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
+ 	      else if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
+ 	      else if (strcmp(name,"Outputdefinition63")==0) return Outputdefinition63Enum;
+-	      else if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
+ 	      else if (strcmp(name,"Outputdefinition65")==0) return Outputdefinition65Enum;
+ 	      else if (strcmp(name,"Outputdefinition66")==0) return Outputdefinition66Enum;
+ 	      else if (strcmp(name,"Outputdefinition67")==0) return Outputdefinition67Enum;
+@@ -1120,10 +1134,7 @@
+ 	      else if (strcmp(name,"Outputdefinition71")==0) return Outputdefinition71Enum;
+ 	      else if (strcmp(name,"Outputdefinition72")==0) return Outputdefinition72Enum;
+ 	      else if (strcmp(name,"Outputdefinition73")==0) return Outputdefinition73Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum;
++	      else if (strcmp(name,"Outputdefinition74")==0) return Outputdefinition74Enum;
+ 	      else if (strcmp(name,"Outputdefinition75")==0) return Outputdefinition75Enum;
+ 	      else if (strcmp(name,"Outputdefinition76")==0) return Outputdefinition76Enum;
+ 	      else if (strcmp(name,"Outputdefinition77")==0) return Outputdefinition77Enum;
+@@ -1232,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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;
+@@ -1243,10 +1257,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"FSApproximation")==0) return FSApproximationEnum;
++	      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;
+@@ -1355,7 +1366,10 @@
+ 	      else if (strcmp(name,"Matice")==0) return MaticeEnum;
+ 	      else if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
+ 	      else if (strcmp(name,"Mathydro")==0) return MathydroEnum;
+-	      else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      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;
+@@ -1366,10 +1380,7 @@
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
++	      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;
+@@ -1478,7 +1489,10 @@
+ 	      else if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
+ 	      else if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
+ 	      else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
+-	      else if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
++         else stage=13;
++   }
++   if(stage==13){
++	      if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
+ 	      else if (strcmp(name,"StressbalanceVerticalAnalysis")==0) return StressbalanceVerticalAnalysisEnum;
+ 	      else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
+ 	      else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
+@@ -1489,10 +1503,7 @@
+ 	      else if (strcmp(name,"SubelementMelt2")==0) return SubelementMelt2Enum;
+ 	      else if (strcmp(name,"SubelementMigration")==0) return SubelementMigrationEnum;
+ 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
+-         else stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
++	      else if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
+ 	      else if (strcmp(name,"Tetra")==0) return TetraEnum;
+ 	      else if (strcmp(name,"TetraInput")==0) return TetraInputEnum;
+ 	      else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
+Index: ../trunk-jpl/src/m/classes/lovenumbers.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26271)
++++ ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26272)
+@@ -8,7 +8,7 @@
+ 
+ classdef lovenumbers
+ 	properties (SetAccess=public) 
+-		
++
+ 		%regular love numbers:
+ 		h           = []; %provided by PREM model
+ 		k           = []; %idem
+@@ -20,6 +20,10 @@
+ 		tl          = []; 
+ 		tk2secular  = 0;  %deg 2 secular number.
+ 
++		%time/frequency for visco-elastic love numbers
++		timefreq    = [];
++		istime      = 1; 
++
+ 	end
+ 	methods
+ 		function self = lovenumbers(varargin) % {{{
+@@ -40,8 +44,11 @@
+ 
+ 			%secular fluid love number: 
+ 			self.tk2secular=0.942; 
++			
++			%time: 
++			self.istime=1; %temporal love numbers by default
++			self.timefreq=0; %elastic case by default.
+ 
+-
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+@@ -58,6 +65,8 @@
+ 			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk','NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','solidearth.lovenumbers.tl','NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','solidearth.lovenumbers.tk2secular','NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','solidearth.lovenumbers.timefreq','NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','solidearth.lovenumbers.istime','NaN',1,'Inf',1,'values',[0 1]);
+ 
+ 			%check that love numbers are provided at the same level of accuracy: 
+ 			if (size(self.h,1)~=size(self.k,1) | size(self.h,1)~=size(self.l,1)),
+@@ -64,6 +73,10 @@
+ 				error('lovenumbers error message: love numbers should be provided at the same level of accuracy');
+ 			end
+ 			
++			ntf=length(self.timefreq);
++			if( size(self.h,2) ~= ntf | size(self.k,2) ~= ntf | size(self.l,2) ~= ntf | size(self.th,2) ~= ntf | size(self.tk,2) ~= ntf | size(self.tl,2) ~= ntf ),
++				error('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector');
++			end
+ 
+ 		end % }}}
+ 		function list=defaultoutputs(self,md) % {{{
+@@ -80,6 +93,9 @@
+ 			fielddisplay(self,'tk','tidal load Love number (deg 2)');
+ 			fielddisplay(self,'tl','tidal load Love number (deg 2)');
+ 			fielddisplay(self,'tk2secular','secular fluid Love number');
++			
++			fielddisplay(self,'istime','time (default=1) or frequency love numbers (0)');
++			fielddisplay(self,'timefreq','time/frequency vector (yr or 1/yr)');
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -93,11 +109,21 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','tl','name','md.solidearth.lovenumbers.tl','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'data',self.tk2secular,'fieldname','lovenumbers.tk2secular','format','Double');
+ 
++			if self.istime,
++				scale=md.constants.yts; 
++			else
++				scale=1.0/md.constants.yts;
++			end
++			WriteData(fid,prefix,'object',self,'fieldname','istime','name','md.solidearth.lovenumbers.istime','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','timefreq','name','md.solidearth.lovenumbers.timefreq','format','DoubleMat','mattype',1,'scale',scale);
++
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 			writejs1Darray(fid,[modelname '.lovenumbers.h'],self.h);
+ 			writejs1Darray(fid,[modelname '.lovenumbers.k'],self.k);
+ 			writejs1Darray(fid,[modelname '.lovenumbers.l'],self.l);
++			writejs1Darray(fid,[modelname '.lovenumbers.istime'],self.istime);
++			writejs1Darray(fid,[modelname '.lovenumbers.time'],self.time);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26271)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26272)
+@@ -10,6 +10,7 @@
+ 		maxiter                = 0;
+ 		rigid                  = 0;
+ 		elastic                = 0;
++		viscous                = 0;
+ 		rotation               = 0;
+ 		ocean_area_scaling     = 0;
+ 		runfrequency           = 1; %how many time steps we skip before we run grd_core
+@@ -16,7 +17,8 @@
+ 		computesealevelchange  = 1; %will sea-level be coputed? 
+ 		isgrd                  = 0; %will GRD patterns be computed? 
+ 		compute_bp_grd         = 0; %will GRD patterns for bottom pressures be computed? 
+-		degacc                 = 0; %degree increment for resolution of Green tables
++		degacc                 = 0; %degree increment for resolution of Green tables.
++		timeacc                = 0; %time step accurary required to compute Green tables
+ 		horiz                  = 0; %compute horizontal deformation
+ 		grdmodel               = 0; %grd model (0 by default, 1 for elastic, 2 for Ivins)
+ 		cross_section_shape    = 0; %cross section only used when grd model is Ivins
+@@ -42,6 +44,7 @@
+ 		%computational flags: 
+ 		self.rigid=1;
+ 		self.elastic=1;
++		self.viscous=1;
+ 		self.rotation=1;
+ 		self.ocean_area_scaling=0;
+ 		self.compute_bp_grd=0;
+@@ -50,6 +53,7 @@
+ 
+ 		%numerical discretization accuracy
+ 		self.degacc=.01;
++		self.timeacc=1; 
+ 
+ 		%how many time steps we skip before we run solidearthsettings solver during transient
+ 		self.runfrequency=1;
+@@ -74,6 +78,7 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.maxiter','size',[1 1],'>=',1);
+ 			md = checkfield(md,'fieldname','solidearth.settings.runfrequency','size',[1 1],'>=',1);
+ 			md = checkfield(md,'fieldname','solidearth.settings.degacc','size',[1 1],'>=',1e-10);
++			md = checkfield(md,'fieldname','solidearth.settings.timeacc','size',[1 1],'>',0);
+ 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','>=',0,'<=',2);
+ 			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
+@@ -82,6 +87,9 @@
+ 			if self.elastic==1 & self.rigid==0,
+ 				error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
+ 			end
++			if self.viscous==1 & self.elastic==0,
++				error('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set');
++			end
+ 
+ 			%a GRD computation has been requested, make some checks on the nature of the meshes provided. 
+ 			if self.isgrd,
+@@ -100,7 +108,6 @@
+ 					error('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on');
+ 			end
+ 
+-
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   solidearth settings:'));
+@@ -115,8 +122,10 @@
+ 			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
+ 			fielddisplay(self,'rigid','rigid earth graviational potential perturbation');
+ 			fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
++			fielddisplay(self,'viscous','viscous earth graviational potential perturbation');
+ 			fielddisplay(self,'rotation','earth rotational potential perturbation');
+ 			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
++			fielddisplay(self,'timeacc','time accuracy (default 1 yr) for numerical discretization of the Green''s functions');
+ 			fielddisplay(self,'grdmodel','type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins');
+ 			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
+ 		end % }}}
+@@ -126,10 +135,12 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','maxiter','name','md.solidearth.settings.maxiter','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','rigid','name','md.solidearth.settings.rigid','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','elastic','name','md.solidearth.settings.elastic','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','viscous','name','md.solidearth.settings.viscous','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','rotation','name','md.solidearth.settings.rotation','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','name','md.solidearth.settings.ocean_area_scaling','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','runfrequency','name','md.solidearth.settings.runfrequency','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','degacc','name','md.solidearth.settings.degacc','format','Double');
++			WriteData(fid,prefix,'object',self,'fieldname','timeacc','name','md.solidearth.settings.timeacc','format','Double','scale',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','horiz','name','md.solidearth.settings.horiz','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','computesealevelchange','name','md.solidearth.settings.computesealevelchange','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isgrd','name','md.solidearth.settings.isgrd','format','Integer');
+@@ -144,10 +155,12 @@
+ 			writejsdouble(fid,[modelname '.solidearth.settings.abstol'],self.abstol);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.rigid'],self.rigid);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.elastic'],self.elastic);
++			writejsdouble(fid,[modelname '.solidearth.settings.viscous'],self.viscous);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.rotation'],self.rotation);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.ocean_area_scaling'],self.ocean_area_scaling);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.run_frequency'],self.run_frequency);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
++			writejsdouble(fid,[modelname '.solidearth.settings.timeacc'],self.timeacc);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+Index: ../trunk-jpl/test/NightlyRun/test2090.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2090.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26272)
+@@ -0,0 +1,114 @@
++%Test Name: ViscoElasticEarthSlc
++
++%mesh earth:
++md=model;
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500.); %700 km resolution mesh
++
++%Geometry for the bed, arbitrary thickness of 1000: 
++md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++
++%parameterize solidearth solution:
++%solidearth loading:  {{{
++md.masstransport.spcthickness=[md.geometry.thickness;0];
++md.dsl.global_average_thermosteric_sea_level=[0;0];
++md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
++md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
++%antarctica
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
++
++late=asind(ze./re);
++longe=atan2d(ye,xe);
++pos=find(late < -80);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posant=pos;
++%greenland
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posgre=pos;
++
++%visco-elastic loading from love numbers that we load ourselves. We 
++%still use the lovenumbers constructor to initialize the fields: 
++load ../Data/lnb_temporal.mat
++md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
++md.solidearth.lovenumbers.h=[zeros(1,100); h1];
++md.solidearth.lovenumbers.k=[zeros(1,100); k1];
++md.solidearth.lovenumbers.l=[zeros(1,100); l1];
++md.solidearth.lovenumbers.th=repmat(md.solidearth.lovenumbers.th,1,100);
++md.solidearth.lovenumbers.tk=repmat(md.solidearth.lovenumbers.tk,1,100);
++md.solidearth.lovenumbers.tl=repmat(md.solidearth.lovenumbers.tl,1,100);
++md.solidearth.lovenumbers.timefreq=time;
++
++%}}}
++%mask:  {{{
++mask=gmtmask(md.mesh.lat,md.mesh.long);
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1;
++
++icemask=ones(md.mesh.numberofvertices,1);
++icemask(md.mesh.elements(posant))=-1;
++icemask(md.mesh.elements(posgre))=-1;
++
++md.mask.ice_levelset=icemask;
++md.mask.ocean_levelset=oceanmask;
++% }}}
++
++%time stepping: 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=10;
++
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.bottompressure=zeros(md.mesh.numberofvertices,1);
++md.initialization.dsl=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
++
++%Materials: 
++md.materials=materials('hydro');
++
++%Miscellaneous
++md.miscellaneous.name='test2090';
++
++%Solution parameters
++md.cluster.np=3;
++md.solidearth.settings.reltol=NaN;
++md.solidearth.settings.abstol=1e-3;
++md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
++
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel','Bed','BedGRD'};
++
++
++% max number of iteration reverted back to 10 (i.e., the original default value)
++md.solidearth.settings.maxiter=10;
++
++%eustatic + rigid + elastic + rotation run:
++md.solidearth.settings.rigid=1;
++md.solidearth.settings.elastic=1;
++md.solidearth.settings.rotation=0;
++md=solve(md,'tr');
++S=md.results.TransientSolution.Sealevel;
++
++%Fields and tolerances to track changes
++field_names={'Sealevel'};
++field_tolerances={1e-13};
++field_values={S};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26272-26273.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26272-26273.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26272-26273.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 26272)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh	(revision 26273)
+@@ -35,7 +35,7 @@
+ #
+ PKG="ISSM-Linux-MATLAB" # Name of directory to copy distributable files to
+ 
+-COMPRESSED_PKG="${PKG}.zip"
++COMPRESSED_PKG="${PKG}.tar.gz"
+ 
+ ## Environment
+ #
+Index: ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 26272)
++++ ../trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh	(revision 26273)
+@@ -35,7 +35,7 @@
+ #
+ PKG="ISSM-Linux-Python" # Name of directory to copy distributable files to
+ 
+-COMPRESSED_PKG="${PKG}.zip"
++COMPRESSED_PKG="${PKG}.tar.gz"
+ 
+ ## Environment
+ #
Index: /issm/oecreview/Archive/25834-26739/ISSM-26273-26274.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26273-26274.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26273-26274.diff	(revision 26740)
@@ -0,0 +1,402 @@
+Index: ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 26273)
++++ ../trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m	(revision 26274)
+@@ -31,7 +31,6 @@
+ 			snorth=length(self.displacementnorth);
+ 			sup=length(self.displacementup);
+ 			sgeoid=length(self.geoid);
+-			sbarystaticsealevel=length(self.barystaticsealevel);
+ 
+ 			if (seast-snorth)~=0,
+ 				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
+@@ -44,10 +43,6 @@
+ 			if (seast-sgeoid)~=0,
+ 				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
+ 			end
+-
+-			if (seast-sbarystaticsealevel)~=0,
+-				error('mmeadditionalsolidearthsolution checkconsistency error message: displacementeast and barystaticsealevel should be the same size');
+-			end
+ 			
+ 			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
+ 
+@@ -56,7 +51,6 @@
+ 				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
+ 				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
+ 				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+-				md = checkfield(md,'field',self.barystaticsealevel{i},'NaN',1,'Inf',1,'timeseries',1);
+ 			end
+ 
+ 
+@@ -79,7 +73,6 @@
+ 				displacementnorth=self.displacementnorth{i}; 
+ 				displacementup=self.displacementup{i}; 
+ 				geoid=self.geoid{i}; 
+-				barystaticsealevel=self.barystaticsealevel{i}; 
+ 
+ 				time=displacementeast(end,:);
+ 				dt=diff(time,1,2);
+@@ -88,13 +81,11 @@
+ 				displacementnorth_rate=diff(displacementnorth(1:end-1,:),1,2)./dt;
+ 				displacementup_rate=diff(displacementup(1:end-1,:),1,2)./dt;
+ 				geoid_rate=diff(geoid(1:end-1,:),1,2)./dt;
+-				barystaticsealevel_rate=diff(barystaticsealevel(1:end-1,:),1,2)./dt;
+ 
+ 				self.displacementeast{i}=displacementeast_rate; 
+ 				self.displacementnorth{i}=displacementnorth_rate; 
+ 				self.displacementup{i}=displacementup_rate; 
+ 				self.geoid{i}=geoid_rate; 
+-				self.barystaticsealevel{i}=barystaticsealevel_rate; 
+ 			end
+ 			
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+@@ -101,7 +92,6 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+ 
+ 		end % }}}
+ 
+Index: ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 26273)
++++ ../trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m	(revision 26274)
+@@ -31,7 +31,6 @@
+ 			snorth=length(self.displacementnorth);
+ 			sup=length(self.displacementup);
+ 			sgeoid=length(self.geoid);
+-			sbarystaticsealevel=length(self.barystaticsealevel);
+ 
+ 			if (seast-snorth)~=0,
+ 				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and displacementnorth should be the same size');
+@@ -44,10 +43,6 @@
+ 			if (seast-sgeoid)~=0,
+ 				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and geoid should be the same size');
+ 			end
+-
+-			if (seast-sbarystaticsealevel)~=0,
+-				error('mmeofflinesolidearthsolution checkconsistency error message: displacementeast and barystaticsealevel should be the same size');
+-			end
+ 			
+ 			md = checkfield(md,'field',self.modelid,'NaN',1,'Inf',1,'>=',1,'<=',length(self.displacementeast));
+ 
+@@ -56,7 +51,6 @@
+ 				md = checkfield(md,'field',self.displacementup{i},'NaN',1,'Inf',1,'timeseries',1);
+ 				md = checkfield(md,'field',self.displacementnorth{i},'NaN',1,'Inf',1,'timeseries',1);
+ 				md = checkfield(md,'field',self.geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+-				md = checkfield(md,'field',self.barystaticsealevel{i},'NaN',1,'Inf',1,'timeseries',1);
+ 			end
+ 
+ 
+@@ -78,7 +72,6 @@
+ 				displacementnorth=self.displacementnorth{i}; 
+ 				displacementup=self.displacementup{i}; 
+ 				geoid=self.geoid{i}; 
+-				barystaticsealevel=self.barystaticsealevel{i}; 
+ 
+ 				time=displacementeast(end,:);
+ 				dt=diff(time,1,2);
+@@ -93,7 +86,6 @@
+ 				self.displacementnorth{i}=displacementnorth_rate; 
+ 				self.displacementup{i}=displacementup_rate; 
+ 				self.geoid{i}=geoid_rate; 
+-				self.barystaticsealevel{i}=barystaticsealevel_rate; 
+ 			end
+ 			
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+@@ -100,7 +92,6 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementup','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','geoid','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','format','MatArray','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1/yts);
+ 
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26273)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26274)
+@@ -41,13 +41,14 @@
+ 
+ 	/*external solidearthsolution: solid-Earth model*/
+ 	iomodel->FetchData(&isexternal,"md.solidearth.isexternal");
++
+ 	if(isexternal){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementeast",SolidearthExternalDisplacementEastRateEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementnorth",SolidearthExternalDisplacementNorthRateEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementup",SolidearthExternalDisplacementUpRateEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.geoid",SolidearthExternalGeoidRateEnum);
+-		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.barystaticsealevel",SolidearthExternalBarystaticSeaLevelRateEnum);
+ 
++
+ 		/*Resolve Mmes using the modelid, if necessary:*/
+ 		if (inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
+ 			int modelid;
+@@ -60,7 +61,6 @@
+ 			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+ 			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum);
+ 			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalGeoidRateEnum, P1Enum);
+-			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
+ 		}
+ 	}
+ 
+@@ -158,6 +158,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.compute_bp_grd",SolidearthSettingsComputeBpGrdEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.cross_section_shape",SolidearthSettingsCrossSectionShapeEnum));
++
+ 	parameters->AddObject(new DoubleParam(CumBslcEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcIceEnum,0.0));
+ 	parameters->AddObject(new DoubleParam(CumBslcHydroEnum,0.0));
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26273)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26274)
+@@ -384,6 +384,7 @@
+ 	SealevelchangeRequestedOutputsEnum,
+ 	SolidearthSettingsRigidEnum,
+ 	SolidearthSettingsRotationEnum,
++	SolidearthSettingsMaxSHCoeffEnum,
+ 	SealevelchangeRunCountEnum,
+ 	SealevelchangeTransitionsEnum,
+ 	SealevelchangeUViscoElasticEnum,
+@@ -951,7 +952,6 @@
+ 	SolidearthExternalDisplacementNorthRateEnum,
+ 	SolidearthExternalDisplacementUpRateEnum,
+ 	SolidearthExternalGeoidRateEnum,
+-	SolidearthExternalBarystaticSeaLevelRateEnum,
+ 	StackRSLEnum,
+ 	StackUEnum,
+ 	StackNEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26273)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26274)
+@@ -956,7 +956,6 @@
+ 		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
+ 		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+ 		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
+-		case SolidearthExternalBarystaticSeaLevelRateEnum : return "SolidearthExternalBarystaticSeaLevelRate";
+ 		case StackRSLEnum : return "StackRSL";
+ 		case StackUEnum : return "StackU";
+ 		case StackNEnum : return "StackN";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26273)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26274)
+@@ -977,7 +977,6 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+-	      else if (strcmp(name,"SolidearthExternalBarystaticSeaLevelRate")==0) return SolidearthExternalBarystaticSeaLevelRateEnum;
+ 	      else if (strcmp(name,"StackRSL")==0) return StackRSLEnum;
+ 	      else if (strcmp(name,"StackU")==0) return StackUEnum;
+ 	      else if (strcmp(name,"StackN")==0) return StackNEnum;
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26273)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26274)
+@@ -9,7 +9,6 @@
+ 		displacementnorth =[];
+ 		displacementup=[];
+ 		geoid=[];
+-		barystaticsealevel=[];
+ 	end
+ 	methods
+ 		function self = solidearthsolution(varargin) % {{{
+@@ -26,7 +25,6 @@
+ 			self.displacementnorth =[];
+ 			self.displacementup=[];
+ 			self.geoid=[];
+-			self.barystaticsealevel=[];
+ 	
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -35,7 +33,6 @@
+ 			md = checkfield(md,'fieldname','solidearth.external.displacementnorth','Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','solidearth.external.displacementup','Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','solidearth.external.geoid','Inf',1,'timeseries',1);
+-			md = checkfield(md,'fieldname','solidearth.external.barystaticsealevel','Inf',1,'timeseries',1);
+ 
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -44,7 +41,6 @@
+ 			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock displacement time series (m)');
+ 			fielddisplay(self,'displacementup','solid-Earth bedrock uplift time series (m)');
+ 			fielddisplay(self,'geoid','solid-Earth geoid time series (m)');
+-			fielddisplay(self,'barystaticsealevel','barystatic absolute sea-level time series (m)');
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -57,7 +53,6 @@
+ 				displacementnorth_rate=[self.displacementnorth;0];
+ 				displacementup_rate=[self.displacementup;0];
+ 				geoid_rate=[self.geoid;0];
+-				barystaticsealevel_rate=[self.barystaticsealevel;0];
+ 			else
+ 				time=self.displacementeast(end,:);
+ 				dt=diff(time,1,2);
+@@ -69,14 +64,11 @@
+ 				displacementup_rate(end+1,:)=time(1:end-1);
+ 				geoid_rate=diff(self.geoid(1:end-1,:),1,2)./dt;
+ 				geoid_rate(end+1,:)=time(1:end-1);
+-				barystaticsealevel_rate=diff(self.barystaticsealevel(1:end-1,:),1,2)./dt;
+-				barystaticsealevel_rate(end+1,:)=time(1:end-1);
+ 			end
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','barystaticsealevel','data',barystaticsealevel_rate,'format','DoubleMat','name', 'md.solidearth.external.barystaticsealevel','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+@@ -84,7 +76,6 @@
+ 			writejs1Darray(fid,[modelname '.solidearth.external.displacementnorth'],self.displacementnorth);
+ 			writejs1Darray(fid,[modelname '.solidearth.external.displacementup'],self.displacementup);
+ 			writejs1Darray(fid,[modelname '.solidearth.external.geoid'],self.geoid);
+-			writejs1Darray(fid,[modelname '.solidearth.external.barystaticsealevel'],self.barystaticsealevel);
+ 		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
+Index: ../trunk-jpl/test/NightlyRun/test2007.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2007.m	(revision 26273)
++++ ../trunk-jpl/test/NightlyRun/test2007.m	(revision 26274)
+@@ -23,8 +23,6 @@
+ md.solidearth.external.displacementeast(end+1,:)=time;
+ md.solidearth.external.displacementnorth=longe .*time;
+ md.solidearth.external.displacementnorth(end+1,:)=time;
+-md.solidearth.external.barystaticsealevel=0*late .*time;
+-md.solidearth.external.barystaticsealevel(end+1,:)=time;
+ md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+ 
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2008.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2008.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test2008.m	(revision 26274)
+@@ -0,0 +1,121 @@
++%Test Name: External:AdditionalSolidearthSolution
++
++%mesh earth:
++md=model;
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++
++%Geometry for the bed, arbitrary thickness of 100: 
++md.geometry.bed=zeros(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++%solidearth loading:  {{{
++md.masstransport.spcthickness=[md.geometry.thickness;0];
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
++%antarctica
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
++
++late=asind(ze./re);
++longe=atan2d(ye,xe);
++pos=find(late < -80);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posant=pos;
++%greenland
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posgre=pos;
++
++%elastic loading from love numbers:
++md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
++
++%}}}
++%mask:  {{{
++mask=gmtmask(md.mesh.lat,md.mesh.long);
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1;
++
++icemask=ones(md.mesh.numberofvertices,1);
++icemask(md.mesh.elements(posant))=-1;
++icemask(md.mesh.elements(posgre))=-1;
++
++md.mask.ice_levelset=icemask;
++md.mask.ocean_levelset=oceanmask;
++% }}}
++
++%time stepping: 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=1;
++
++%masstransport:
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
++
++%Materials: 
++md.materials=materials('hydro');
++
++%Miscellaneous
++md.miscellaneous.name='test2008';
++
++%Solution parameters
++md.cluster.np=3;
++md.solidearth.settings.reltol=NaN;
++md.solidearth.settings.abstol=1e-3;
++md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
++
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel','Bed'};
++
++% max number of iteration reverted back to 10 (i.e., the original default value)
++md.solidearth.settings.maxiter=10;
++
++%eustatic + rigid + elastic:
++md.solidearth.settings.rigid=1;
++md.solidearth.settings.elastic=1;
++md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
++md=solve(md,'tr');
++Sgrd=md.results.TransientSolution.Sealevel;
++Bgrd=md.results.TransientSolution.Bed;
++
++%parameterize additional solidearth solution:
++late=md.mesh.lat;
++longe=md.mesh.long;
++time=0:1;
++Y22=1.5*(1.+cosd(2.*late)).*cosd(2.*longe);
++md.solidearth.external=additionalsolidearthsolution;
++md.solidearth.external.displacementup=0.5*Y22 .*time;
++md.solidearth.external.displacementup(end+1,:)=time;
++md.solidearth.external.geoid=0.2*Y22 .*time;
++md.solidearth.external.geoid(end+1,:)=time;
++md.solidearth.external.displacementeast=late .*time;
++md.solidearth.external.displacementeast(end+1,:)=time;
++md.solidearth.external.displacementnorth=longe .*time;
++md.solidearth.external.displacementnorth(end+1,:)=time;
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++
++md=solve(md,'tr');
++Sadd=md.results.TransientSolution.Sealevel;
++Badd=md.results.TransientSolution.Bed;
++
++
++%Fields and tolerances to track changes
++field_names={'SealevelGrd','BedrockGrd', 'SealevelAdditional','BedrockAdditional'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={Sgrd, Bgrd,Sadd,Badd};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26274-26275.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26274-26275.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26274-26275.diff	(revision 26740)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26274)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26275)
+@@ -6310,11 +6310,11 @@
+ 			//Avoid singularity of the poles
+ 			if (latitude[i]==M_PI/2.){
+ 				//North pole: nudge south
+-				polenudge=-1.e12;
++				polenudge=-1.e-12;
+ 			}
+ 			else if (latitude[i]==-M_PI/2.){
+ 				//South pole: nudge north
+-				polenudge=1.e12;
++				polenudge=1.e-12;
+ 			}
+ 			else {
+ 				polenudge=0.0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26275-26276.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26275-26276.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26275-26276.diff	(revision 26740)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26275)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26276)
+@@ -6136,7 +6136,7 @@
+ 	bool computeviscous = false;
+ 	int  horiz;
+ 	bool istime=true;
+-	IssmDouble timeacc=0;
++	IssmDouble timeacc=0.;
+ 	IssmDouble start_time,final_time;
+ 	int  nt,precomputednt;
+ 
+@@ -6211,7 +6211,7 @@
+ 		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
+ 		this->parameters->FindParam(&start_time,TimesteppingStartTimeEnum);
+ 		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
+-		nt=reCast<int>((final_time-start_time)/timeacc)+1;
++		nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+ 	}
+ 	else{
+ 		nt=1; //in elastic, or if we run only rigid, we need only one step
+@@ -6820,7 +6820,7 @@
+ 		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
+ 		this->parameters->FindParam(&start_time,TimesteppingStartTimeEnum);
+ 		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
+-		nt=reCast<int>((final_time-start_time)/timeacc)+1;
++		nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+ 	}
+ 	else{
+ 		nt=1; //in elastic, or if we run only rigid, we need only one step
Index: /issm/oecreview/Archive/25834-26739/ISSM-26276-26277.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26276-26277.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26276-26277.diff	(revision 26740)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26276)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26277)
+@@ -195,8 +195,7 @@
+ 							}
+ 						} /*}}}*/
+ 						break;
+-					case MatlithoEnum:
+-						{ /*{{{*/
++					case MatlithoEnum: { /*{{{*/
+ 							iomodel->FetchData(13,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.ebm_alpha","md.materials.ebm_delta","md.materials.ebm_taul","md.materials.ebm_tauh","md.materials.rheologymodel","md.materials.issolid","md.materials.density");
+ 							materials->AddObject(new Matlitho(iomodel->numberofelements+1,iomodel));
+ 							iomodel->DeleteData(13,"md.materials.radius","md.materials.viscosity","md.materials.lame_lambda","md.materials.lame_mu","md.materials.burgers_viscosity","md.materials.burgers_mu","md.materials.ebm_alpha","md.materials.ebm_delta","md.materials.ebm_taul","md.materials.ebm_tauh","md.materials.rheologymodel","md.materials.issolid","md.materials.density");
+@@ -203,8 +202,7 @@
+ 						}
+ 						/*}}}*/
+ 						break;
+-					case MathydroEnum: /*{{{*/
+-						{ 
++					case MathydroEnum: {/*{{{*/
+ 							/*If we don't have any materials pointed to by elements (meaning, if we are running only litho or hydro), 
+ 							 * then we need to zero out the hmaterial pointers inside the elements dataset so that it won't error out 
+ 							 * during configuration: */
+@@ -238,7 +236,7 @@
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_E",MaterialsRheologyEEnum);
+-						for (int i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,MatenhancediceEnum));
++						for(int j=0;j<iomodel->numberofelements;j++) if(iomodel->my_elements[j]) materials->AddObject(new Matice(j+1,j,MatenhancediceEnum));
+ 						switch(iomodel->domaindim){
+ 							case 2:
+ 								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+@@ -255,7 +253,7 @@
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.damage.D",DamageDEnum);
+-						for (int i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,MatdamageiceEnum));
++						for (int j=0;j<iomodel->numberofelements;j++) if(iomodel->my_elements[j]) materials->AddObject(new Matice(j+1,j,MatdamageiceEnum));
+ 						switch(iomodel->domaindim){
+ 							case 2:
+ 								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+@@ -272,7 +270,7 @@
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum);
+ 						iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum);
+-						for(int i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matestar(i+1,i,iomodel));
++						for(int j=0;j<iomodel->numberofelements;j++) if(iomodel->my_elements[j]) materials->AddObject(new Matestar(j+1,j,iomodel));
+ 						switch(iomodel->domaindim){
+ 							case 2:
+ 								inputs->DuplicateInput(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26277-26278.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26277-26278.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26277-26278.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26277)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26278)
+@@ -272,7 +272,7 @@
+ 			if(viscous){
+ 				IssmDouble* stacktimes=NULL;
+ 				ntimesteps=precomputednt; 
+-				nt=reCast<int>((final_time-start_time)/timeacc)+1;
++				nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+ 
+ 				parameters->AddObject(new IntParam(StackNumStepsEnum,nt));
+ 				/*Initialize stack times:*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26278-26279.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26278-26279.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26278-26279.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m	(nonexistent)
++++ ../trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m	(revision 26279)
+@@ -0,0 +1,19 @@
++function [y, m, d] = fractionYear2Datetime(fy); 
++% a function to compute year, month, date from a fraction year. 
++% 
++% usage: 
++%		[y, m, d] = fractionYear2Datetime(fy); 
++%		
++%		y = year 
++%		m = month  
++%		d = day 
++%		fy = fraction year (e.g., 2007.391) 
++%		
++
++yr = fix(fy);	% year  
++secs = (fy-yr).*(365+leapyear(yr))*24*3600; % seconds in the year
++dn = fix(datenum(yr,1,0,0,0,secs));	
++ds = cellstr(datestr(dn,24));
++dt = datetime(ds,'InputFormat','dd/MM/yyyy');
++[y,m,d] = ymd(dt); 
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26279-26280.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26279-26280.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26279-26280.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m	(revision 26279)
++++ ../trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m	(nonexistent)
+@@ -1,19 +0,0 @@
+-function [y, m, d] = fractionYear2Datetime(fy); 
+-% a function to compute year, month, date from a fraction year. 
+-% 
+-% usage: 
+-%		[y, m, d] = fractionYear2Datetime(fy); 
+-%		
+-%		y = year 
+-%		m = month  
+-%		d = day 
+-%		fy = fraction year (e.g., 2007.391) 
+-%		
+-
+-yr = fix(fy);	% year  
+-secs = (fy-yr).*(365+leapyear(yr))*24*3600; % seconds in the year
+-dn = fix(datenum(yr,1,0,0,0,secs));	
+-ds = cellstr(datestr(dn,24));
+-dt = datetime(ds,'InputFormat','dd/MM/yyyy');
+-[y,m,d] = ymd(dt); 
+-
Index: /issm/oecreview/Archive/25834-26739/ISSM-26280-26281.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26280-26281.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26280-26281.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/c/classes/Massfluxatgate.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Massfluxatgate.h	(revision 26280)
++++ ../trunk-jpl/src/c/classes/Massfluxatgate.h	(revision 26281)
+@@ -31,9 +31,13 @@
+ 		/*Massfluxatgate constructors, destructors :*/
+ 		Massfluxatgate(){/*{{{*/
+ 			this->definitionenum        = -1;
+-			this->name        = 0;
++			this->name        = NULL;
+ 			this->numsegments = 0;
+-			this->segments    = 0;
++			this->elements    = NULL;
++			this->x1				= NULL;
++			this->x2				= NULL;
++			this->y1				= NULL;
++			this->y2				= NULL;
+ 		}
+ 		/*}}}*/
+ 		Massfluxatgate(char* in_name, int in_definitionenum, int in_numsegments, doubletype* in_segments) {/*{{{*/
+Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp
+===================================================================
+--- ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 26280)
++++ ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 26281)
+@@ -255,6 +255,11 @@
+ 				Cflevelset->Marshall(marshallhandle);
+ 				this->AddObject(Cflevelset);
+ 			}
++			else if(obj_enum==MassfluxatgateEnum){
++				Massfluxatgate<IssmDouble>* massfluxgate=new Massfluxatgate<IssmDouble>();
++				massfluxgate->Marshall(marshallhandle);
++				this->AddObject(massfluxgate);
++			}
+ 			else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); 
+ 		}
+ 	}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26281-26282.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26281-26282.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26281-26282.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26281)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26282)
+@@ -197,8 +197,8 @@
+ 		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalGeoidRateEnum)==DatasetInputEnum)
+ 			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalGeoidRateEnum, P1Enum);
+ 
+-		if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalBarystaticSeaLevelRateEnum)==DatasetInputEnum)
+-			MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
++		//if (femmodel->inputs->GetInputObjectEnum(SolidearthExternalBarystaticSeaLevelRateEnum)==DatasetInputEnum)
++		//	MmeToInput(femmodel,distributed_values,variable_partition,npart,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum);
+ 	} /*}}}*/
+ 
+ 	else _error_("InputUpdateSpecialtyCode error message: " << root << " not supported yet!");
Index: /issm/oecreview/Archive/25834-26739/ISSM-26282-26283.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26282-26283.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26282-26283.diff	(revision 26740)
@@ -0,0 +1,416 @@
+Index: ../trunk-jpl/test/Data/lnb_temporal.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26282)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26283)
+@@ -337,7 +337,7 @@
+ 		if(rigid){
+ 			for(int i=lower_row;i<upper_row;i++){
+ 				IssmDouble alpha,x;
+-				alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
++				alpha= reCast<IssmDouble>(i)*degacc * M_PI / 180.0;
+ 				G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
+ 			}
+ 		}
+@@ -344,7 +344,7 @@
+ 		if(viscous | elastic){
+ 			for(int i=lower_row;i<upper_row;i++){
+ 				IssmDouble alpha,x;
+-				alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
++				alpha= reCast<IssmDouble>(i)*degacc * M_PI / 180.0;
+ 
+ 				for(int t=0;t<ntimesteps;t++){
+ 					G_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_k[(ndeg-1)*precomputednt+t]-love_h[(ndeg-1)*precomputednt+t])*G_rigid_local[i-lower_row];
+@@ -477,9 +477,9 @@
+ 
+ 						int timeindex=index*nt+t;
+ 						int timepreindex= index*ntimesteps+timeindex2;
+-						G_viscoelastic_interpolated[timeindex]+=(1-lincoeff)*G_viscoelastic[timepreindex]+lincoeff*G_viscoelastic[timepreindex+1];
+-						U_viscoelastic_interpolated[timeindex]+=(1-lincoeff)*U_viscoelastic[timepreindex]+lincoeff*U_viscoelastic[timepreindex+1];
+-						if(horiz)H_viscoelastic_interpolated[timeindex]+=(1-lincoeff)*H_viscoelastic[timepreindex]+lincoeff*H_viscoelastic[timepreindex+1];
++						G_viscoelastic_interpolated[timeindex]=(1-lincoeff)*G_viscoelastic[timepreindex]+lincoeff*G_viscoelastic[timepreindex+1];
++						U_viscoelastic_interpolated[timeindex]=(1-lincoeff)*U_viscoelastic[timepreindex]+lincoeff*U_viscoelastic[timepreindex+1];
++						if(horiz)H_viscoelastic_interpolated[timeindex]=(1-lincoeff)*H_viscoelastic[timepreindex]+lincoeff*H_viscoelastic[timepreindex+1];
+ 					}
+ 				}
+ 						
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26282)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26283)
+@@ -130,6 +130,35 @@
+ 		
+ 
+ } /*}}}*/
++void BarystaticContributions::Reset(int eid){ /*{{{*/
++	
++	int id;
++	if(nice){
++		id=reCast<int>(pice[eid]);
++		ice->SetValue(id,0.,INS_VAL);
++	}
++	else{
++		ice->SetValue(0,0.,INS_VAL);
++	}
++
++	if(nhydro){
++		id=reCast<int>(phydro[eid]);
++		hydro->SetValue(id,0.,INS_VAL);
++	}
++	else{
++		hydro->SetValue(0,0.,INS_VAL);
++	}
++
++	if(nocean){
++		id=reCast<int>(pocean[eid]);
++		ocean->SetValue(id,0.,INS_VAL);
++	}
++	else{
++		ocean->SetValue(0,0.,INS_VAL);
++	}
++		
++
++} /*}}}*/
+ void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/
+ 
+ 	int        step;
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26282)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26283)
+@@ -41,6 +41,7 @@
+ 		void Cumulate(Parameters* parameters);
+ 		void Save(Results* results, Parameters* parameters, IssmDouble oceanarea);
+ 		void Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue);
++		void Reset(int eid);
+ 
+ };
+ #endif  /* _BARYSTATICCONTRIBUTIONS_H_ */
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26282)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26283)
+@@ -6217,6 +6217,7 @@
+ 		nt=1; //in elastic, or if we run only rigid, we need only one step
+ 	}
+ 
++
+ 	constant=3/rho_earth/planetarea;
+ 
+ 	G=xNewZeroInit<IssmDouble>(3*nel*nt);
+@@ -6244,7 +6245,7 @@
+ 			delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+ 			alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+ 			index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
+-			_assert_(index>0 && index<M);
++			_assert_(index>=0 && index<M);
+ 
+ 			if(horiz){
+ 				/*Compute azimuths, both north and east components: */
+@@ -6381,6 +6382,7 @@
+ 
+ 		this->inputs->SetArrayInput(StackRSLEnum,this->lid,stackRSL,3*nt);
+ 		this->inputs->SetArrayInput(StackUEnum,this->lid,stackU,3*nt);
++		this->parameters->SetParam(0,StackIndexEnum);
+ 		if(horiz){
+ 			stackN=xNewZeroInit<IssmDouble>(3*nt);
+ 			stackE=xNewZeroInit<IssmDouble>(3*nt);
+@@ -6954,8 +6956,8 @@
+ 	IssmDouble* stackE=NULL;
+ 	IssmDouble* stacktimes=NULL;
+ 	int         stacknumsteps;
+-	int         stackindex; 
+-	int         newindex; 
++	int         stackindex=0; 
++	int         newindex=0; 
+ 	int         dummy;
+ 	bool        viscous=false;
+ 	IssmDouble  currenttime;
+@@ -6979,27 +6981,35 @@
+ 			this->inputs->GetArrayPtr(StackEEnum,this->lid,&stackE,&dummy);
+ 		}
+ 
++
++		bool foundtime=false;
++		int offset=1;
+ 		lincoeff=0;
+ 		newindex=stacknumsteps-2;
++
+ 		for(int t=stackindex;t<stacknumsteps;t++){
+ 			if (stacktimes[t]>currenttime){
+ 				newindex=t-1;
+ 				lincoeff=(currenttime-stacktimes[newindex])/(stacktimes[t]-stacktimes[newindex]);
++				foundtime=true;
++				offset=0;
+ 				break;
+ 			}
+ 		}
+-		if(newindex==(stacknumsteps-2))lincoeff=1;
++
++		if(!foundtime) lincoeff=1;
+ 		stacktimes[newindex]=currenttime;
+ 		for(int i=0;i<NUMVERTICES;i++){
+-			stackRSL[i*stacknumsteps+newindex]=(1-lincoeff)*stackRSL[i*stacknumsteps+newindex]+lincoeff*stackRSL[i*stacknumsteps+newindex+1];
+-			stackU[i*stacknumsteps+newindex]=(1-lincoeff)*stackU[i*stacknumsteps+newindex]+lincoeff*stackU[i*stacknumsteps+newindex+1];
++			stackRSL[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackRSL[i*stacknumsteps+newindex]+lincoeff*stackRSL[i*stacknumsteps+newindex+1];
++			stackU[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackU[i*stacknumsteps+newindex]+lincoeff*stackU[i*stacknumsteps+newindex+1];
+ 			if(horiz){
+-				stackN[i*stacknumsteps+newindex]=(1-lincoeff)*stackN[i*stacknumsteps+newindex]+lincoeff*stackN[i*stacknumsteps+newindex+1];
+-				stackE[i*stacknumsteps+newindex]=(1-lincoeff)*stackE[i*stacknumsteps+newindex]+lincoeff*stackE[i*stacknumsteps+newindex+1];
++				stackN[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackN[i*stacknumsteps+newindex]+lincoeff*stackN[i*stacknumsteps+newindex+1];
++				stackE[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackE[i*stacknumsteps+newindex]+lincoeff*stackE[i*stacknumsteps+newindex+1];
+ 			}
+ 		}
+-		stackindex=newindex;
++		stackindex=newindex+offset;
+ 
++		
+ 		this->parameters->SetParam(stackindex,StackIndexEnum);
+ 		this->parameters->SetParam(stacktimes,stacknumsteps,StackTimesEnum);
+ 
+@@ -7161,9 +7171,11 @@
+ 	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+ 		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+ 		loads->vsubsealevelloads->SetValue(intj,oceanaverage*rho_water,INS_VAL);
++		loads->vsealevelloads->SetValue(this->sid,0.,INS_VAL);
+ 	}
+ 	else loads->vsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+ 
++
+ 	/*add ocean area into a global oceanareas vector:*/
+ 	if(!loads->sealevelloads){
+ 		oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
+@@ -7394,15 +7406,17 @@
+ 		if(computefuture){
+ 			sealevelinterp=xNew<IssmDouble>(3*nt); 
+ 			if(stacktimes[stackindex]<final_time){
+-				lincoeff=1-(stacktimes[stackindex+1]-stacktimes[stackindex])/timeacc;
++				lincoeff=(stacktimes[stackindex+1]-stacktimes[stackindex])/timeacc;
+ 				for(int t=stackindex;t<nt;t++){
+ 					if(t==stackindex){
+ 						for(int i=0;i<NUMVERTICES;i++){
++							if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 							sealevelinterp[i*nt+t]=  sealevel[i*nt+0];
+ 						}
+ 					}
+ 					else{
+ 						for(int i=0;i<NUMVERTICES;i++){
++							if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 							sealevelinterp[i*nt+t]=  (1-lincoeff)*sealevel[i*nt+(t-stackindex-1)]+lincoeff*sealevel[i*nt+(t-stackindex)];
+ 						}
+ 					}
+@@ -7412,13 +7426,16 @@
+ 
+ 		/*update sealevel at present time using stack at present time: */
+ 		for(int i=0;i<NUMVERTICES;i++){
++			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 			sealevel[i*nt+0]+=stack[i*stacknumsteps+stackindex]; 
+ 		}
+ 
+ 		if(computefuture){ /*update stack with future deformation from present load: */
+-			for(int t=stackindex;t<nt;t++){
++
++			for(int t=nt-1;t>=stackindex;t--){
+ 				for(int i=0;i<NUMVERTICES;i++){
+-					stack[i*stacknumsteps+t]+=sealevelinterp[i*nt+t];
++					if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
++					stack[i*stacknumsteps+t]+=sealevelinterp[i*nt+t]-sealevelinterp[i*nt+stackindex]-stack[i*stacknumsteps+stackindex];
+ 				}
+ 			}
+ 			/*Re-add stack now that we updated:*/
+@@ -7432,7 +7449,9 @@
+ 	/*store values computed on vertices, but don't repeat the computation if another element already computed it!:*/
+ 	if(percpu){
+ 		for(i=0;i<NUMVERTICES;i++){
+-			if(slgeom->lids[this->vertices[i]->lid]==this->lid)sealevelout[this->vertices[i]->lid]=sealevel[i*nt+0];
++			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
++				sealevelout[this->vertices[i]->lid]=sealevel[i*nt+0];
++			}
+ 		}
+ 	}
+ 	else{
+@@ -7439,6 +7458,7 @@
+ 		for(i=0;i<NUMVERTICES;i++) sealevelout[i]=sealevel[i*nt+0];
+ 	}
+ 
++
+ } /*}}}*/
+ void       Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){/*{{{*/
+ 		
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26282)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26283)
+@@ -387,6 +387,12 @@
+ 		//cumulate barystatic contributions and save to results: 
+ 		barycontrib->Cumulate(femmodel->parameters);
+ 		barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
++
++		//Avoid double counting barystatic contributions in future time steps: reset all non-cumulative bscl to 0
++		for(Object* & object : femmodel->elements->objects){
++			Element* element = xDynamicCast<Element*>(object);
++			barycontrib->Reset(element->Sid());
++		}
+ 	}
+ 
+ 	femmodel->inputs->AXPY(1,SealevelGRDEnum,SealevelEnum);
+@@ -713,8 +719,7 @@
+ 	delete vsealevelloadsvolume; 
+ 	delete vsubsealevelloadsvolume; 
+ 	
+-	//return (sealevelloadsaverage+subsealevelloadsaverage)/oceanarea;
+-	return (sealevelloadsaverage)/oceanarea;
++	return (sealevelloadsaverage+subsealevelloadsaverage)/oceanarea;
+ } /*}}}*/
+ void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom){ /*{{{*/
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2090.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26282)
++++ ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26283)
+@@ -2,12 +2,12 @@
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500.); %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+ md.geometry.base=md.geometry.bed;
+-md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
++md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+ 
+@@ -14,9 +14,7 @@
+ %parameterize solidearth solution:
+ %solidearth loading:  {{{
+ md.masstransport.spcthickness=[md.geometry.thickness;0];
+-md.dsl.global_average_thermosteric_sea_level=[0;0];
+-md.dsl.sea_surface_height_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++
+ md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ %antarctica
+ xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+@@ -27,11 +25,12 @@
+ late=asind(ze./re);
+ longe=atan2d(ye,xe);
+ pos=find(late < -80);
+-md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++%pos=10;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:)) -100;
+ posant=pos;
+ %greenland
+ pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+-md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:)) -100;
+ posgre=pos;
+ 
+ %visco-elastic loading from love numbers that we load ourselves. We 
+@@ -38,12 +37,17 @@
+ %still use the lovenumbers constructor to initialize the fields: 
+ load ../Data/lnb_temporal.mat
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+-md.solidearth.lovenumbers.h=[zeros(1,100); h1];
+-md.solidearth.lovenumbers.k=[zeros(1,100); k1];
+-md.solidearth.lovenumbers.l=[zeros(1,100); l1];
+-md.solidearth.lovenumbers.th=repmat(md.solidearth.lovenumbers.th,1,100);
+-md.solidearth.lovenumbers.tk=repmat(md.solidearth.lovenumbers.tk,1,100);
+-md.solidearth.lovenumbers.tl=repmat(md.solidearth.lovenumbers.tl,1,100);
++md.solidearth.lovenumbers.timefreq=[0];
++
++md.solidearth.lovenumbers.h=[h1'];
++md.solidearth.lovenumbers.k=[k1'];
++md.solidearth.lovenumbers.l=[l1'];
++%md.solidearth.lovenumbers.h=repmat(md.solidearth.lovenumbers.h,1,100);
++%md.solidearth.lovenumbers.k=repmat(md.solidearth.lovenumbers.k,1,100);
++%md.solidearth.lovenumbers.l=repmat(md.solidearth.lovenumbers.l,1,100);
++md.solidearth.lovenumbers.th=repmat(md.solidearth.lovenumbers.th,1,101);
++md.solidearth.lovenumbers.tk=repmat(md.solidearth.lovenumbers.tk,1,101);
++md.solidearth.lovenumbers.tl=repmat(md.solidearth.lovenumbers.tl,1,101);
+ md.solidearth.lovenumbers.timefreq=time;
+ 
+ %}}}
+@@ -55,6 +59,7 @@
+ icemask=ones(md.mesh.numberofvertices,1);
+ icemask(md.mesh.elements(posant))=-1;
+ icemask(md.mesh.elements(posgre))=-1;
++%oceanmask(md.mesh.elements(posant))=1;
+ 
+ md.mask.ice_levelset=icemask;
+ md.mask.ocean_levelset=oceanmask;
+@@ -62,9 +67,14 @@
+ 
+ %time stepping: 
+ md.timestepping.start_time=0;
+-md.timestepping.time_step=1;
+-md.timestepping.final_time=10;
++md.timestepping.time_step=100;
++md.timestepping.final_time=1000;
+ 
++time1=md.timestepping.start_time:md.timestepping.time_step:md.timestepping.final_time;
++md.masstransport.spcthickness=repmat(md.masstransport.spcthickness, [1 length(time1)]);
++md.masstransport.spcthickness(1:end-1,2:end)=0;
++md.masstransport.spcthickness(end,:)=time1;
++
+ md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+@@ -81,7 +91,7 @@
+ md.miscellaneous.name='test2090';
+ 
+ %Solution parameters
+-md.cluster.np=3;
++md.cluster.np=1;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+ md.solidearth.settings.computesealevelchange=1;
+@@ -88,16 +98,17 @@
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
++md.solidearth.settings.timeacc=md.timestepping.time_step;
++md.solidearth.settings.degacc=.01;
+ 
+-%Physics: 
++%Physics:
+ md.transient.issmb=0; 
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
+ md.transient.isslc=1;
+-md.solidearth.requested_outputs={'Sealevel','Bed','BedGRD'};
++md.solidearth.requested_outputs={'Sealevel','Bed'};
+ 
+-
+ % max number of iteration reverted back to 10 (i.e., the original default value)
+ md.solidearth.settings.maxiter=10;
+ 
+@@ -104,11 +115,18 @@
+ %eustatic + rigid + elastic + rotation run:
+ md.solidearth.settings.rigid=1;
+ md.solidearth.settings.elastic=1;
++md.solidearth.settings.viscous=1;
+ md.solidearth.settings.rotation=0;
+ md=solve(md,'tr');
+-S=md.results.TransientSolution.Sealevel;
+ 
++
++clear S B
++for i=length(time1)-1
++S(:,i)=md.results.TransientSolution(i).Sealevel;
++B(:,i)=md.results.TransientSolution(i).Bed;
++end
++
+ %Fields and tolerances to track changes
+-field_names={'Sealevel'};
+-field_tolerances={1e-13};
+-field_values={S};
++field_names={'Sealevel','Bed'};
++field_tolerances={1e-13,1e-13};
++field_values={S,B};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26283-26284.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26283-26284.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26283-26284.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test2090.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26283)
++++ ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26284)
+@@ -121,7 +121,7 @@
+ 
+ 
+ clear S B
+-for i=length(time1)-1
++for i=1:length(time1)-1
+ S(:,i)=md.results.TransientSolution(i).Sealevel;
+ B(:,i)=md.results.TransientSolution(i).Bed;
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26284-26285.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26284-26285.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26284-26285.diff	(revision 26740)
@@ -0,0 +1,75 @@
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26284)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26285)
+@@ -41,7 +41,7 @@
+ 		void Cumulate(Parameters* parameters);
+ 		void Save(Results* results, Parameters* parameters, IssmDouble oceanarea);
+ 		void Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue);
+-		void Reset(int eid);
++		void Reset();
+ 
+ };
+ #endif  /* _BARYSTATICCONTRIBUTIONS_H_ */
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26284)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26285)
+@@ -130,34 +130,13 @@
+ 		
+ 
+ } /*}}}*/
+-void BarystaticContributions::Reset(int eid){ /*{{{*/
+-	
+-	int id;
+-	if(nice){
+-		id=reCast<int>(pice[eid]);
+-		ice->SetValue(id,0.,INS_VAL);
+-	}
+-	else{
+-		ice->SetValue(0,0.,INS_VAL);
+-	}
++void BarystaticContributions::Reset(){ /*{{{*/
+ 
+-	if(nhydro){
+-		id=reCast<int>(phydro[eid]);
+-		hydro->SetValue(id,0.,INS_VAL);
+-	}
+-	else{
+-		hydro->SetValue(0,0.,INS_VAL);
+-	}
+ 
+-	if(nocean){
+-		id=reCast<int>(pocean[eid]);
+-		ocean->SetValue(id,0.,INS_VAL);
+-	}
+-	else{
+-		ocean->SetValue(0,0.,INS_VAL);
+-	}
+-		
+-
++	ice->SetValue(0);
++	hydro->SetValue(0);
++	ocean->SetValue(0);
++	
+ } /*}}}*/
+ void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/
+ 
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26284)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26285)
+@@ -387,12 +387,7 @@
+ 		//cumulate barystatic contributions and save to results: 
+ 		barycontrib->Cumulate(femmodel->parameters);
+ 		barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
+-
+-		//Avoid double counting barystatic contributions in future time steps: reset all non-cumulative bscl to 0
+-		for(Object* & object : femmodel->elements->objects){
+-			Element* element = xDynamicCast<Element*>(object);
+-			barycontrib->Reset(element->Sid());
+-		}
++		barycontrib->Reset();
+ 	}
+ 
+ 	femmodel->inputs->AXPY(1,SealevelGRDEnum,SealevelEnum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26285-26286.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26285-26286.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26285-26286.diff	(revision 26740)
@@ -0,0 +1,182 @@
+Index: ../trunk-jpl/examples/EsaWahr/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaWahr/runme.m	(revision 26285)
++++ ../trunk-jpl/examples/EsaWahr/runme.m	(revision 26286)
+@@ -1,9 +1,9 @@
+ clear all;
+ addpath('../Functions');
+ 
+-steps=[2]; 
++steps=[1];
+ 
+-if any(steps==1) 
++if any(steps==1)
+ 	disp('   Step 1: Mesh creation');
+ 
+ 	md=roundmesh(model,100000,10000);  % Domain radius and element size [m]
+@@ -11,9 +11,9 @@
+ 	save ./Models/EsaWahr_Mesh md;
+ 
+ 	plotmodel(md,'data','mesh');
+-end 
++end
+ 
+-if any(steps==2) 
++if any(steps==2)
+ 	disp('   Step 2: Anisotropic mesh creation');
+ 
+ 	md=roundmesh(model,100000,1000);
+@@ -27,9 +27,9 @@
+ 	save ./Models/EsaWahr_Mesh md;
+ 
+ 	plotmodel (md,'data','mesh');
+-end 
++end
+ 
+-if any(steps==3) 
++if any(steps==3)
+ 	disp('   Step 3: Define loads');
+ 	md = loadmodel('./Models/EsaWahr_Mesh');
+ 
+@@ -47,9 +47,9 @@
+ 	save ./Models/EsaWahr_Loads md;
+ 
+ 	plotmodel (md,'data',md.esa.deltathickness,'title','Ice height equivalent [m]');
+-end 
++end
+ 
+-if any(steps==4) 
++if any(steps==4)
+ 	disp('   Step 4: Parameterization');
+ 	md = loadmodel('./Models/EsaWahr_Loads');
+ 
+@@ -73,9 +73,9 @@
+ 	md.miscellaneous.name='EsaWahr';
+ 
+ 	save ./Models/EsaWahr_Parameterization md;
+-end 
++end
+ 
+-if any(steps==5) 
++if any(steps==5)
+ 	disp('   Step 5: Solve Esa solver');
+ 	md = loadmodel('./Models/EsaWahr_Parameterization');
+ 
+@@ -87,9 +87,9 @@
+ 	md=solve(md,'Esa');
+ 
+ 	save ./Models/EsaWahr_Solution md;
+-end 
++end
+ 
+-if any(steps==6) 
++if any(steps==6)
+ 	disp('   Step 6: Plot solutions');
+ 	md = loadmodel('./Models/EsaWahr_Solution');
+ 
+@@ -96,7 +96,7 @@
+ 	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm]
+ 	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm]
+ 	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm]
+-	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm] 
++	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]
+ 
+ 	set(0,'DefaultAxesFontSize',24,'DefaultAxesLineWidth',1,'DefaultTextFontSize',24,'DefaultLineMarkerSize',6);
+ 	figure('Position', [100, 100, 800, 600]);
+@@ -120,9 +120,9 @@
+ 		'axispos',[0.505 0.02 0.47 0.47],...
+ 		'colorbarpos',[0.53,0.065,0.18,0.02],'colorbartitle#4','East-west [mm]');
+ 	%export_fig('Fig5.pdf');
+-end 
++end
+ 
+-if any(steps==7) 
++if any(steps==7)
+ 	disp('   Step 7: Compare results against Wahr semi-analytic solutions');
+ 	md = loadmodel('./Models/EsaWahr_Solution');
+ 
+@@ -129,7 +129,7 @@
+ 	vert = md.results.EsaSolution.EsaUmotion*1000;		% [mm]
+ 	horz_n = md.results.EsaSolution.EsaYmotion*1000;	% [mm]
+ 	horz_e = md.results.EsaSolution.EsaXmotion*1000;	% [mm]
+-	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm] 
++	horz = sqrt(horz_n.^2+horz_e.^2);						% [mm]
+ 
+ 	xi=[0:500:100000]; % grid points [m]
+ 	yi=zeros(1,length(xi));
+@@ -161,4 +161,4 @@
+ 		set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize',16);
+ 		set(gcf,'color','w');
+ 	%export_fig('Fig6.pdf');
+-end 
++end
+Index: ../trunk-jpl/examples/EsaGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26285)
++++ ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26286)
+@@ -1,9 +1,9 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[5]; 
++steps=[1];
+ 
+-if any(steps==1) 
++if any(steps==1)
+ 	disp('   Step 1: Global mesh creation');
+ 
+ 	resolution=300;			% [km]
+@@ -17,9 +17,9 @@
+ 	save ./Models/EsaGRACE_Mesh md;
+ 
+ 	plotmodel (md,'data',md.mask.ocean_levelset,'edgecolor','k');
+-end 
++end
+ 
+-if any(steps==2) 
++if any(steps==2)
+ 	disp('   Step 2: Define loads in meters of ice height equivalent');
+ 	md = loadmodel('./Models/EsaGRACE_Mesh');
+ 
+@@ -35,9 +35,9 @@
+ 	plotmodel (md,'data',md.esa.deltathickness,...
+ 		'view',[90 -90],'caxis',[-.1 .1],...
+ 		'title','Ice height equivalent [m]');
+-end 
++end
+ 
+-if any(steps==3) 
++if any(steps==3)
+ 	disp('   Step 3: Parameterization');
+ 	md = loadmodel('./Models/EsaGRACE_Loads');
+ 
+@@ -64,9 +64,9 @@
+ 	md.miscellaneous.name='EsaGRACE';
+ 
+ 	save ./Models/EsaGRACE_Parameterization md;
+-end 
++end
+ 
+-if any(steps==4) 
++if any(steps==4)
+ 	disp('   Step 4: Solve Esa solver');
+ 	md = loadmodel('./Models/EsaGRACE_Parameterization');
+ 
+@@ -78,9 +78,9 @@
+ 	md=solve(md,'Esa');
+ 
+ 	save ./Models/EsaGRACE_Solution md;
+-end 
++end
+ 
+-if any(steps==5) 
++if any(steps==5)
+ 	disp('   Step 5: Plot solutions');
+ 	md = loadmodel('./Models/EsaGRACE_Solution');
+ 
+@@ -139,4 +139,4 @@
+ 		set(gcf,'color','w');
+ 		%export_fig(fig_name{kk});
+ 	end
+-end 
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26286-26287.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26286-26287.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26286-26287.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26286)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26287)
+@@ -133,9 +133,9 @@
+ void BarystaticContributions::Reset(){ /*{{{*/
+ 
+ 
+-	ice->SetValue(0);
+-	hydro->SetValue(0);
+-	ocean->SetValue(0);
++	ice->Set(0.);
++	hydro->Set(0.);
++	ocean->Set(0.);
+ 	
+ } /*}}}*/
+ void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26287-26288.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26287-26288.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26287-26288.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/examples/EsaGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26287)
++++ ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26288)
+@@ -1,7 +1,7 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1];
++steps=[1:5];
+ 
+ if any(steps==1)
+ 	disp('   Step 1: Global mesh creation');
+@@ -26,7 +26,8 @@
+ 	year_month = 2007+15/365;
+ 	time_range = [year_month year_month];
+ 
+-	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2));
++	onvertex = 0; % map data on vertex. If 0, it maps on the elemental centroid. 
++	water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2),onvertex);
+ 
+ 	md.esa.deltathickness = water_load*md.materials.rho_freshwater/md.materials.rho_ice; % ice height equivalent
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26288-26289.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26288-26289.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26288-26289.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/examples/EsaGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26288)
++++ ../trunk-jpl/examples/EsaGRACE/runme.m	(revision 26289)
+@@ -1,7 +1,7 @@
+ clear all;
+ addpath('../Data','../Functions');
+ 
+-steps=[1:5];
++steps=[1];
+ 
+ if any(steps==1)
+ 	disp('   Step 1: Global mesh creation');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26289-26290.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26289-26290.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26289-26290.diff	(revision 26740)
@@ -0,0 +1,65 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26289)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26290)
+@@ -193,13 +193,11 @@
+ 					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1);
+ 				}
+ 			}
+-			else{//itapopo FIXME only base velocities are constrained here
++			else{//MLHO itapopo FIXME base and shear velocities are constrained
+ 				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
+-				//IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,1);
+-				if(iomodel->domaintype!=Domain2DverticalEnum){
+-					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
+-					//IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,3);
+-				}
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,1);
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,3);
+ 			}
+ 		}
+ 
+@@ -3065,7 +3063,7 @@
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+ 		n_input->GetInputValue(&n,gauss);
+-
++		
+ 		for(int i=0;i<numnodes;i++){// per node: vx (basal vx), vshx, vy (basal vy), vshy
+ 			pe->values[i*4+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
+ 			pe->values[i*4+1]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
+@@ -3090,8 +3088,7 @@
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble  Jdet,thickness,base,sealevel,water_pressure,ice_pressure;
+-	IssmDouble  water_pressure_sh,ice_pressure_sh,pressure_sh,n,s,b;
+-	IssmDouble  surface_under_water,base_under_water,pressure;
++	IssmDouble  water_pressure_sh,ice_pressure_sh,pressure_sh,pressure,n,s,b;
+ 	IssmDouble *xyz_list = NULL;
+ 	IssmDouble *xyz_list_front = NULL;
+ 	IssmDouble  normal[2];
+@@ -3124,17 +3121,15 @@
+ 		sealevel_input->GetInputValue(&sealevel,gauss);
+ 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
+ 		element->NodalFunctions(basis,gauss);
+-
+-		surface_under_water = min(0.,thickness+base-sealevel); // 0 if the top of the glacier is above water level
+-		base_under_water    = min(0.,base-sealevel);           // 0 if the bottom of the glacier is above water level
++		
++		b = base-sealevel; // ice base shifted by the sea level
++		s = thickness+b;   // ice surface shifted by the sea level
+ 		/*Vertically integrated pressure - SSA type*/
+-		water_pressure = (1.0/2.0)*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
+-		ice_pressure   = (1.0/2.0)*gravity*rho_ice*thickness*thickness;
++		water_pressure = -(1.0/2.0)*gravity*rho_water*(b*b);
++		ice_pressure   =  (1.0/2.0)*gravity*rho_ice*thickness*thickness;
+ 		pressure = ice_pressure + water_pressure;
+ 		/*Vertically integrated pressure - HO type*/
+-		b=min(0.,base-sealevel); // 0 if the bottom of the glacier is above water level
+-		s=thickness+b; // ice surface regardless of whether the top of the glacier is above water level or not
+-		water_pressure_sh = gravity*rho_water*( -b*b/2 + (pow(-b,n+2)/pow(thickness,n+1))*(-s/(n+2)-b/(n+3)) );
++		water_pressure_sh = gravity*rho_water*( -b*b/2 - (s*thickness/(n+2))*(1-pow(s/thickness,n+2)) + (thickness*thickness/(n+3))*(1-pow(s/thickness,n+3)) );
+ 		ice_pressure_sh   = gravity*rho_ice*thickness*thickness*(n+1)/(2*(n+3));
+ 		pressure_sh = ice_pressure_sh + water_pressure_sh;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26290-26291.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26290-26291.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26290-26291.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/clusters/lonestar.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/lonestar.m	(revision 26290)
++++ ../trunk-jpl/src/m/classes/clusters/lonestar.m	(revision 26291)
+@@ -119,7 +119,7 @@
+ 			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+ 			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+ 			 fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.numnodes,24));
++			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.np/cluster.numnodes,24));
+ 			 fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
+ 			 fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
+ 			 for i=1:numel(cluster.modules),
Index: /issm/oecreview/Archive/25834-26739/ISSM-26291-26292.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26291-26292.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26291-26292.diff	(revision 26740)
@@ -0,0 +1,235 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Penpair.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 26292)
+@@ -354,6 +354,16 @@
+ 				case HOApproximationEnum:   return PenaltyCreateKMatrixStressbalanceSSAHO(kmax); 
+ 				default: _error_("Approximation "<<EnumToStringx(approximation1)<<" not supported yet");
+ 			}
++		case MLHOApproximationEnum:
++			switch(approximation1){
++				case MLHOApproximationEnum:   return PenaltyCreateKMatrixStressbalanceSSAHO(kmax); 
++				default: _error_("Approximation "<<EnumToStringx(approximation1)<<" not supported yet");
++			}
++		case L1L2ApproximationEnum:
++			switch(approximation1){
++				case L1L2ApproximationEnum:   return PenaltyCreateKMatrixStressbalanceSSAHO(kmax); 
++				default: _error_("Approximation "<<EnumToStringx(approximation1)<<" not supported yet");
++			}
+ 		case FSvelocityEnum:
+ 			switch(approximation1){
+ 				case FSvelocityEnum: return PenaltyCreateKMatrixStressbalanceFS(kmax); 
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26291)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26292)
+@@ -20,6 +20,7 @@
+ //#define FSANALYTICAL 10
+ //#define LATERALFRICTION 1
+ //#define DISCSLOPE 1 //testing for SSA
++#define NOSPCSHEARVEL 1 //MLHO
+ 
+ /*Model processing*/
+ void StressbalanceAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+@@ -193,11 +194,17 @@
+ 					IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1);
+ 				}
+ 			}
+-			else{//MLHO itapopo FIXME base and shear velocities are constrained
++			else{//MLHO 
++				#ifdef NOSPCSHEARVEL	
+ 				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
++				#else
++				/*Default: apply spcs to shear vx and shear vy*/
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
+ 				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,1);
+ 				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
+ 				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,3);
++				#endif
+ 			}
+ 		}
+ 
+@@ -780,7 +787,8 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum,0.);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum,0.);
+-	if(isMLHO){//itapopo FIXME shear and base velocities should be initialized correctly
++	if(isMLHO){
++		/*itapopo FIXME applying the same initialization for shear vx and shear vy for now*/
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxShearEnum,0.);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyShearEnum,0.);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
+@@ -2906,8 +2914,10 @@
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
+ 	Input* surface_input  = element->GetInput(SurfaceEnum);   _assert_(surface_input);
+-	Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input);
+-	Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input);
++	Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input); //vertically integrated vx
++	Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input); //vertically integrated vy
++	Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input); 
++	Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input);
+ 	Input* n_input			 = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+@@ -2922,8 +2932,8 @@
+ 
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		n_input->GetInputValue(&n,gauss);
+-		//FIXME testing with L1L2-type viscosity
+-		element->material->ViscosityL1L2(&viscosity,xyz_list,gauss,vx_input,vy_input,surface_input);
++		IssmDouble dim=2;//itapopo
++		element->material->ViscosityMLHO(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vxshear_input,vyshear_input,thickness_input);
+ 		//viscosity=10e13;//itapopo
+ 
+ 		for(int i=0;i<numnodes;i++){//shape functions on tria element
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26292)
+@@ -4211,6 +4211,41 @@
+ 	epsilon[1] = 0.5*dvx[1];
+ 
+ }/*}}}*/
++void       Element::StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){/*{{{*/
++	/*Compute the 2d Blatter/MLHO Strain Rate (5 components):
++	 *
++	 * epsilon=[exx eyy exy exz eyz]
++	 *
++	 * with exz=1/2 du/dz
++	 *      eyz=1/2 dv/dz
++	 *
++	 * the contribution of vz is neglected
++	 */
++
++	/*Intermediaries*/
++	IssmDouble dvx[2]; // [dvx/dx, dvx/dy]
++	IssmDouble dvy[2]; // [dvy/dx, dvy/dy]
++	IssmDouble vxshear,vyshear,thickness;
++
++	/*Check that both inputs have been found*/
++	if (!vx_input || !vy_input || !vxshear_input || !vyshear_input || !thickness_input){
++		_error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vxshear: " << vxshear_input << ", vyshear: " << vyshear_input << ", thickness: " << thickness_input << "\n");
++	}
++
++	/*Get strain rate assuming that epsilon has been allocated*/
++	vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
++	vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
++	thickness_input->GetInputValue(&thickness,gauss); _assert_(thickness>0);
++   vxshear_input->GetInputValue(&vxshear,gauss);
++   vyshear_input->GetInputValue(&vyshear,gauss);
++	
++	epsilon[0] = dvx[0];
++	epsilon[1] = dvy[1];
++	epsilon[2] = 0.5*(dvx[1] + dvy[0]);
++	epsilon[3] = 0.5*vxshear/thickness;
++	epsilon[4] = 0.5*vyshear/thickness;
++
++}/*}}}*/
+ void       Element::StrainRateSSA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
+ 
+ 	/*Intermediaries*/
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26292)
+@@ -180,6 +180,7 @@
+ 		void               StrainRateFS(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void               StrainRateHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               StrainRateHO2dvertical(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
++		void               StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input);
+ 		void               StrainRateSSA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               StrainRateSSA1d(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input);
+ 		void               StressMaxPrincipalCreateInput(void);
+Index: ../trunk-jpl/src/c/classes/Materials/Material.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 26292)
+@@ -50,6 +50,7 @@
+ 		virtual void       ViscositySSADerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss)=0;
+ 		virtual void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
+ 		virtual void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
++		virtual void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input)=0;
+ 		virtual void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf)=0;
+ 		virtual void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
+ 		virtual void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble epseff)=0;
+Index: ../trunk-jpl/src/c/classes/Materials/Matestar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matestar.cpp	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Materials/Matestar.cpp	(revision 26292)
+@@ -566,6 +566,9 @@
+ 	/*Compute viscosity*/
+ 	*pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
+ }/*}}}*/
++void  Matestar::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
+ void  Matestar::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matestar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 26292)
+@@ -75,6 +75,7 @@
+ 
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
++		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input);
+ 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
+ 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble eps_eff);
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26292)
+@@ -735,6 +735,24 @@
+ 	/*Assign output pointer*/
+ 	*pviscosity=viscosity;
+ }/*}}}*/
++void  Matice::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){/*{{{*/
++
++	/*Intermediaries*/
++	IssmDouble viscosity;
++	IssmDouble thickness;
++	IssmDouble epsilon[5];	/* epsilon=[exx,eyy,exy,exz,eyz]; */
++	IssmDouble eps_eff;
++
++	/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
++	element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,vx_input,vy_input,vxshear_input,vyshear_input,thickness_input);
++	eps_eff = sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2] +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
++
++	/*Get viscosity*/
++	this->GetViscosityBar(&viscosity,eps_eff,gauss);
++
++	/*Assign output pointer*/
++   *pviscosity=viscosity;
++}/*}}}*/
+ void  Matice::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
+ 	/*Compute the L1L2 viscosity
+ 	 *
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 26292)
+@@ -77,6 +77,7 @@
+ 
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
++		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input);
+ 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
+ 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		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");};
+Index: ../trunk-jpl/src/c/classes/Materials/Matlitho.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26291)
++++ ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26292)
+@@ -71,6 +71,7 @@
+ 
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
++		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){_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       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble epseff){_error_("not supported");};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26292-26293.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26292-26293.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26292-26293.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26292)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26293)
+@@ -2932,7 +2932,7 @@
+ 
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		n_input->GetInputValue(&n,gauss);
+-		IssmDouble dim=2;//itapopo
++		int dim=2;//itapopo
+ 		element->material->ViscosityMLHO(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vxshear_input,vyshear_input,thickness_input);
+ 		//viscosity=10e13;//itapopo
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26293-26294.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26293-26294.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26293-26294.diff	(revision 26740)
@@ -0,0 +1,343 @@
+Index: ../trunk-jpl/src/c/classes/Materials/Material.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 26294)
+@@ -50,7 +50,7 @@
+ 		virtual void       ViscositySSADerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss)=0;
+ 		virtual void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
+ 		virtual void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
+-		virtual void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input)=0;
++		virtual void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input)=0;
+ 		virtual void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf)=0;
+ 		virtual void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
+ 		virtual void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble epseff)=0;
+Index: ../trunk-jpl/src/c/classes/Materials/Matestar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matestar.cpp	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Materials/Matestar.cpp	(revision 26294)
+@@ -566,7 +566,7 @@
+ 	/*Compute viscosity*/
+ 	*pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
+ }/*}}}*/
+-void  Matestar::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){/*{{{*/
++void  Matestar::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+ void  Matestar::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matestar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 26294)
+@@ -75,7 +75,7 @@
+ 
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+-		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input);
++		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
+ 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
+ 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble eps_eff);
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26294)
+@@ -735,23 +735,65 @@
+ 	/*Assign output pointer*/
+ 	*pviscosity=viscosity;
+ }/*}}}*/
+-void  Matice::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){/*{{{*/
++void  Matice::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
+ 
+ 	/*Intermediaries*/
+-	IssmDouble viscosity;
+-	IssmDouble thickness;
+ 	IssmDouble epsilon[5];	/* epsilon=[exx,eyy,exy,exz,eyz]; */
+-	IssmDouble eps_eff;
++	IssmDouble epsilon_eff;
++	IssmDouble zeta,H,n;
++	IssmDouble f[4],F[4];
++	IssmDouble mubar[4];
++	IssmDouble mu;
++	int order=5; 
+ 
+-	/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
+-	element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,vx_input,vy_input,vxshear_input,vyshear_input,thickness_input);
+-	eps_eff = sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2] +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
++	for(int i=0;i<4;++i) mubar[i]=0;
+ 
+-	/*Get viscosity*/
+-	this->GetViscosityBar(&viscosity,eps_eff,gauss);
++	GaussSeg* gauss_seg=new GaussSeg(order);
++	//IssmDouble eps_eff_averaged=0;
++	while(gauss_seg->next()){
++		
++		/*Compute zeta for gauss_seg point (0=surface, 1=base)*/
++		zeta=0.5*(gauss_seg->coord1+1);	
+ 
++		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy (for a given zeta)*/
++		element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
++						vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
++		epsilon_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2] 
++						  +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
++
++		/*Get viscosity at zeta - FIXME for now Bbar*/
++		this->GetViscosityBar(&mu,epsilon_eff,gauss);
++
++		thickness_input->GetInputValue(&H, gauss);
++      n_input->GetInputValue(&n,gauss);
++
++		/*Compute fi and Fi at zeta*/
++		f[0]=1;
++		f[1]=(1-pow(zeta,n+1));
++		f[2]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
++		f[3]=((n+1)/H)*pow(zeta,n) * ((n+1)/H)*pow(zeta,n);
++	
++		F[0]=H;
++		F[1]=H*(n+1)/(n+2);
++		F[2]=2*H*(n+1)*(n+1)/( (2*n+3)*(n+2) );
++		F[3]=(n+1)*(n+1)/( H*(2*n+1) );
++
++		/*Sum the viscosity*/
++		mubar[0]+=(H/(2*F[0]))*gauss_seg->weight*mu*f[0];
++		mubar[1]+=(H/(2*F[1]))*gauss_seg->weight*mu*f[1];
++		mubar[2]+=(H/(2*F[2]))*gauss_seg->weight*mu*f[2];
++		mubar[3]+=(H/(2*F[3]))*gauss_seg->weight*mu*f[3];
++
++	}//while
++
+ 	/*Assign output pointer*/
+-   *pviscosity=viscosity;
++	pviscosity[0]=mubar[0];
++	pviscosity[1]=mubar[1];
++	pviscosity[2]=mubar[2];
++	pviscosity[3]=mubar[3];
++
++	/*Clean up*/
++	delete gauss_seg;
+ }/*}}}*/
+ void  Matice::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
+ 	/*Compute the L1L2 viscosity
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 26294)
+@@ -77,7 +77,7 @@
+ 
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+-		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input);
++		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
+ 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
+ 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		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");};
+Index: ../trunk-jpl/src/c/classes/Materials/Matlitho.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26294)
+@@ -71,7 +71,7 @@
+ 
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
+-		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){_error_("not supported");};
++		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){_error_("not supported");};
+ 		void       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       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble epseff){_error_("not supported");};
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26293)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26294)
+@@ -2881,7 +2881,7 @@
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOViscous(Element* element){/*{{{*/
+ 
+ 	/*Intermediaries*/
+-	IssmDouble  viscosity,Jdet,thickness,n;
++	IssmDouble  viscosity[4],Jdet,thickness,n;
+ 	IssmDouble *xyz_list = NULL;
+ 	int      domaintype;
+ 	Element* basalelement;
+@@ -2916,8 +2916,10 @@
+ 	Input* surface_input  = element->GetInput(SurfaceEnum);   _assert_(surface_input);
+ 	Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input); //vertically integrated vx
+ 	Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input); //vertically integrated vy
+-	Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input); 
+-	Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input);
++	Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input); 
++	Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
++	Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input); //shear vx at the surface 
++	Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input); //shear vy at the surface
+ 	Input* n_input			 = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+@@ -2933,67 +2935,66 @@
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		n_input->GetInputValue(&n,gauss);
+ 		int dim=2;//itapopo
+-		element->material->ViscosityMLHO(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vxshear_input,vyshear_input,thickness_input);
+-		//viscosity=10e13;//itapopo
++		element->material->ViscosityMLHO(&viscosity[0],dim,xyz_list,gauss,vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input);
+ 
+ 		for(int i=0;i<numnodes;i++){//shape functions on tria element
+ 			for(int j=0;j<numnodes;j++){
+-				Ke->values[(4*i+0)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+0)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[0]*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							);//K11
+-				Ke->values[(4*i+0)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+0)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[1]*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K12
+-				Ke->values[(4*i+0)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+0)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[0]*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							);//K13
+-				Ke->values[ (4*i+0)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[ (4*i+0)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[1]*thickness*(
+                      2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+                      )*(n+1)/(n+2);//K14
+ 				
+-				Ke->values[(4*i+1)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[1]*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K21
+-				Ke->values[(4*i+1)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[2]*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2)) 
+ 							+ 
+-							gauss->weight*Jdet*viscosity*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
++							gauss->weight*Jdet*viscosity[3]*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
+ 							;//K22
+-				Ke->values[(4*i+1)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[1]*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K23
+-				Ke->values[(4*i+1)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+1)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[2]*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2));//K24
+ 				
+-				Ke->values[(4*i+2)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[0]*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+ 							);//K31
+-				Ke->values[(4*i+2)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[1]*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K32
+-				Ke->values[(4*i+2)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[0]*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							);//K33
+-				Ke->values[(4*i+2)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+2)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[1]*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K34
+ 
+-				Ke->values[(4*i+3)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[1]*thickness*(
+                      2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                      )*(n+1)/(n+2);//K41
+-				Ke->values[(4*i+3)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+1] += gauss->weight*Jdet*viscosity[2]*thickness*(
+                      2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+                      )*2*pow(n+1,2)/((2*n+3)*(n+2));//K42
+-				Ke->values[(4*i+3)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+2] += gauss->weight*Jdet*viscosity[1]*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*(n+1)/(n+2);//K43
+-				Ke->values[(4*i+3)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity*thickness*(
++				Ke->values[(4*i+3)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[2]*thickness*(
+ 							4.*dbasis[1*numnodes+j]*dbasis[1*numnodes+i] + dbasis[0*numnodes+j]*dbasis[0*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2))
+ 							+ 
+-							gauss->weight*Jdet*viscosity*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
++							gauss->weight*Jdet*viscosity[3]*basis[j]*basis[i]*pow(n+1,2)/(thickness*(2*n+1))
+ 							;//K44
+ 			}
+ 		}
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26294)
+@@ -4211,8 +4211,8 @@
+ 	epsilon[1] = 0.5*dvx[1];
+ 
+ }/*}}}*/
+-void       Element::StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input){/*{{{*/
+-	/*Compute the 2d Blatter/MLHO Strain Rate (5 components):
++void       Element::StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input,IssmDouble zeta){/*{{{*/
++	/*Compute the 2d Blatter/MLHO Strain Rate (5 components) for a given vertical coordinate (zeta):
+ 	 *
+ 	 * epsilon=[exx eyy exy exz eyz]
+ 	 *
+@@ -4220,31 +4220,41 @@
+ 	 *      eyz=1/2 dv/dz
+ 	 *
+ 	 * the contribution of vz is neglected
++	 *
++	 * zeta = (surface - z)/thickness 
++	 * i.e., zeta=0 <=> ice surface
++	 * i.e., zeta=1 <=> ice base
+ 	 */
+ 
+ 	/*Intermediaries*/
+-	IssmDouble dvx[2]; // [dvx/dx, dvx/dy]
+-	IssmDouble dvy[2]; // [dvy/dx, dvy/dy]
+-	IssmDouble vxshear,vyshear,thickness;
++	IssmDouble dvxb[2];  // [dvx/dx, dvx/dy] at the base
++	IssmDouble dvyb[2];  // [dvy/dx, dvy/dy] at the base
++	IssmDouble dvxsh[2]; // [dvx/dx, dvx/dy] at the surface (only the shear)
++	IssmDouble dvysh[2]; // [dvy/dx, dvy/dy] at the surface (only the shear)
++	IssmDouble vxsh,vysh; // shear vx and shear at the surface
++	IssmDouble thickness,n;
+ 
+ 	/*Check that both inputs have been found*/
+-	if (!vx_input || !vy_input || !vxshear_input || !vyshear_input || !thickness_input){
+-		_error_("Input missing. Here are the input pointers we have for vx: " << vx_input << ", vy: " << vy_input << ", vxshear: " << vxshear_input << ", vyshear: " << vyshear_input << ", thickness: " << thickness_input << "\n");
++	if (!vxbase_input || !vybase_input || !vxshear_input || !vyshear_input || !thickness_input || !n_input){
++		_error_("Input missing. Here are the input pointers we have for vxb: " << vxbase_input << ", vyb: " << vybase_input << ", vxshear: " << vxshear_input << ", vyshear: " << vyshear_input << ", thickness: " << thickness_input << ", n: " << n_input<< "\n");
+ 	}
+ 
+ 	/*Get strain rate assuming that epsilon has been allocated*/
+-	vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
+-	vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
++	vxbase_input->GetInputDerivativeValue(&dvxb[0],xyz_list,gauss);
++	vybase_input->GetInputDerivativeValue(&dvyb[0],xyz_list,gauss);
++	vxshear_input->GetInputDerivativeValue(&dvxsh[0],xyz_list,gauss);
++	vyshear_input->GetInputDerivativeValue(&dvysh[0],xyz_list,gauss);
+ 	thickness_input->GetInputValue(&thickness,gauss); _assert_(thickness>0);
+-   vxshear_input->GetInputValue(&vxshear,gauss);
+-   vyshear_input->GetInputValue(&vyshear,gauss);
+-	
+-	epsilon[0] = dvx[0];
+-	epsilon[1] = dvy[1];
+-	epsilon[2] = 0.5*(dvx[1] + dvy[0]);
+-	epsilon[3] = 0.5*vxshear/thickness;
+-	epsilon[4] = 0.5*vyshear/thickness;
++   vxshear_input->GetInputValue(&vxsh,gauss);
++   vyshear_input->GetInputValue(&vysh,gauss);
++   n_input->GetInputValue(&n,gauss);
+ 
++	epsilon[0] = dvxb[0] + dvxsh[0]*( 1 - pow(zeta,n+1) );
++	epsilon[1] = dvyb[1] + dvysh[1]*( 1 - pow(zeta,n+1) );
++	epsilon[2] = 0.5*( dvxb[1] + dvxsh[1]*( 1 - pow(zeta,n+1) ) + dvyb[0] + dvysh[0]*( 1 - pow(zeta,n+1) ) ); 
++	epsilon[3] = 0.5*(vxsh/thickness)*(n+1)*pow(zeta,n);
++	epsilon[4] = 0.5*(vysh/thickness)*(n+1)*pow(zeta,n);
++
+ }/*}}}*/
+ void       Element::StrainRateSSA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26293)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26294)
+@@ -180,7 +180,7 @@
+ 		void               StrainRateFS(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void               StrainRateHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               StrainRateHO2dvertical(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+-		void               StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input);
++		void               StrainRateMLHO(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input,IssmDouble zeta);
+ 		void               StrainRateSSA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               StrainRateSSA1d(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input);
+ 		void               StressMaxPrincipalCreateInput(void);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26294-26295.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26294-26295.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26294-26295.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 26294)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 26295)
+@@ -110,11 +110,16 @@
+ 	bool *my_elements = xNewZeroInit<bool>(iomodel->numberofelements);
+ 
+ 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
++	bool check = false;
+ 	for(int i=0;i<iomodel->numberofelements;i++){
+ 
+ 		/*!All elements have been partitioned above, only deal with elements for this cpu: */
+-		if(my_rank==epart[i]) my_elements[i]=true;
++		if(my_rank==epart[i]){
++			my_elements[i]=true;
++			check = true;
++		}
+ 	}
++	if(!check) _error_("partition "<<my_rank<<" does not have any element! Try reducing md.cluster.np");
+ 
+ 	/*Assign pointers to iomodel*/
+ 	iomodel->epart      =epart;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26295-26296.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26295-26296.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26295-26296.diff	(revision 26740)
@@ -0,0 +1,3049 @@
+Index: ../trunk-jpl/src/c/analyses/EsaAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EsaAnalysis.cpp	(revision 26295)
++++ ../trunk-jpl/src/c/analyses/EsaAnalysis.cpp	(revision 26296)
+@@ -60,7 +60,7 @@
+ 
+ 	/*some constant parameters: */
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.esa.hemisphere",EsaHemisphereEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rigid",SolidearthSettingsRigidEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.selfattraction",SolidearthSettingsSelfAttractionEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rotation",SolidearthSettingsRotationEnum));
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26295)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26296)
+@@ -91,8 +91,8 @@
+ 	int         externalnature=0;
+ 	int         isexternal=0;
+ 
+-	IssmDouble* G_rigid = NULL;
+-	IssmDouble* G_rigid_local = NULL;
++	IssmDouble* G_gravi = NULL;
++	IssmDouble* G_gravi_local = NULL;
+ 	IssmDouble* G_viscoelastic = NULL;
+ 	IssmDouble* G_viscoelastic_interpolated = NULL;
+ 	IssmDouble* G_viscoelastic_local = NULL;
+@@ -107,7 +107,7 @@
+ 	IssmDouble  timeacc;
+ 	IssmDouble  planetradius=0;
+ 	IssmDouble  planetarea=0;
+-	bool		rigid=false;
++	bool		selfattraction=false;
+ 	bool		elastic=false;
+ 	bool		viscous=false;
+ 	bool		rotation=false;
+@@ -144,7 +144,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.reltol",SolidearthSettingsReltolEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.abstol",SolidearthSettingsAbstolEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.maxiter",SolidearthSettingsMaxiterEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.rigid",SolidearthSettingsRigidEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.selfattraction",SolidearthSettingsSelfAttractionEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.horiz",SolidearthSettingsHorizEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.elastic",SolidearthSettingsElasticEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.viscous",SolidearthSettingsViscousEnum));
+@@ -152,8 +152,9 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.equatorialmoi",RotationalEquatorialMoiEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.polarmoi",RotationalPolarMoiEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.rotational.angularvelocity",RotationalAngularVelocityEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.grdocean",SolidearthSettingsGrdOceanEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.ocean_area_scaling",SolidearthSettingsOceanAreaScalingEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.computesealevelchange",SolidearthSettingsComputesealevelchangeEnum));
++	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.sealevelloading",SolidearthSettingsSealevelLoadingEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.isgrd",SolidearthSettingsGRDEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.compute_bp_grd",SolidearthSettingsComputeBpGrdEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+@@ -227,15 +228,15 @@
+ 	}
+ 
+ 	parameters->FindParam(&grdmodel,GrdModelEnum);
+-	if(grdmodel!=IvinsEnum){
++	if(grdmodel==ElasticEnum){
+ 		/*Deal with elasticity {{{*/
+-		iomodel->FetchData(&rigid,"md.solidearth.settings.rigid");
++		iomodel->FetchData(&selfattraction,"md.solidearth.settings.selfattraction");
+ 		iomodel->FetchData(&elastic,"md.solidearth.settings.elastic");
+ 		iomodel->FetchData(&viscous,"md.solidearth.settings.viscous");
+ 		iomodel->FetchData(&rotation,"md.solidearth.settings.rotation");
+ 		iomodel->FetchData(&horiz,"md.solidearth.settings.horiz");
+ 
+-		if(rigid){
++		if(selfattraction){
+ 			/*compute green functions for a range of angles*/
+ 			iomodel->FetchData(&degacc,"md.solidearth.settings.degacc");
+ 			M=reCast<int,IssmDouble>(180./degacc+1.);
+@@ -270,19 +271,19 @@
+ 			// AD performance is sensitive to calls to ensurecontiguous.
+ 			// // Providing "t" will cause ensurecontiguous to be called.
+ 			if(viscous){
+-				IssmDouble* stacktimes=NULL;
++				IssmDouble* viscoustimes=NULL;
+ 				ntimesteps=precomputednt; 
+ 				nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+ 
+-				parameters->AddObject(new IntParam(StackNumStepsEnum,nt));
+-				/*Initialize stack times:*/
+-				stacktimes=xNew<IssmDouble>(nt);
++				parameters->AddObject(new IntParam(SealevelchangeViscousNumStepsEnum,nt));
++				/*Initialize viscous stack times:*/
++				viscoustimes=xNew<IssmDouble>(nt);
+ 				for(int t=0;t<nt;t++){
+-					stacktimes[t]=start_time+timeacc*t;
++					viscoustimes[t]=start_time+timeacc*t;
+ 				}
+-				parameters->AddObject(new DoubleVecParam(StackTimesEnum,stacktimes,nt));
+-				parameters->AddObject(new IntParam(StackIndexEnum,0));
+-				xDelete<IssmDouble>(stacktimes);
++				parameters->AddObject(new DoubleVecParam(SealevelchangeViscousTimesEnum,viscoustimes,nt));
++				parameters->AddObject(new IntParam(SealevelchangeViscousIndexEnum,0));
++				xDelete<IssmDouble>(viscoustimes);
+ 			}
+ 			else {
+ 				ntimesteps=1;
+@@ -299,17 +300,17 @@
+ 			if(horiz)H_viscoelastic=xNew<IssmDouble>(M*ntimesteps);
+ #endif
+ 		}
+-		if(rigid){
++		if(selfattraction){
+ #ifdef _HAVE_AD_
+-			G_rigid=xNew<IssmDouble>(M,"t");
++			G_gravi=xNew<IssmDouble>(M,"t");
+ #else
+-			G_rigid=xNew<IssmDouble>(M);
++			G_gravi=xNew<IssmDouble>(M);
+ #endif
+ 		}
+ 
+ 		if(rotation)parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.lovenumbers.tk2secular",TidalLoveK2SecularEnum));
+ 
+-		if(rigid){
++		if(selfattraction){
+ 
+ 			/*compute combined legendre + love number (elastic green function:*/
+ 			m=DetermineLocalSize(M,IssmComm::GetComm());
+@@ -326,19 +327,19 @@
+ 			if(horiz)H_viscoelastic_local=xNew<IssmDouble>(m*ntimesteps);
+ #endif
+ 		}
+-		if(rigid){
++		if(selfattraction){
+ #ifdef _HAVE_AD_
+-			G_rigid_local=xNew<IssmDouble>(m,"t");
++			G_gravi_local=xNew<IssmDouble>(m,"t");
+ #else
+-			G_rigid_local=xNew<IssmDouble>(m);
++			G_gravi_local=xNew<IssmDouble>(m);
+ #endif
+ 		}
+ 
+-		if(rigid){
++		if(selfattraction){
+ 			for(int i=lower_row;i<upper_row;i++){
+ 				IssmDouble alpha,x;
+ 				alpha= reCast<IssmDouble>(i)*degacc * M_PI / 180.0;
+-				G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
++				G_gravi_local[i-lower_row]= .5/sin(alpha/2.0);
+ 			}
+ 		}
+ 		if(viscous | elastic){
+@@ -347,8 +348,8 @@
+ 				alpha= reCast<IssmDouble>(i)*degacc * M_PI / 180.0;
+ 
+ 				for(int t=0;t<ntimesteps;t++){
+-					G_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_k[(ndeg-1)*precomputednt+t]-love_h[(ndeg-1)*precomputednt+t])*G_rigid_local[i-lower_row];
+-					U_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_h[(ndeg-1)*precomputednt+t])*G_rigid_local[i-lower_row];
++					G_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_k[(ndeg-1)*precomputednt+t]-love_h[(ndeg-1)*precomputednt+t])*G_gravi_local[i-lower_row];
++					U_viscoelastic_local[(i-lower_row)*ntimesteps+t]= (love_h[(ndeg-1)*precomputednt+t])*G_gravi_local[i-lower_row];
+ 					if(horiz)H_viscoelastic_local[(i-lower_row)*ntimesteps+t]= 0; 
+ 				}
+ 
+@@ -391,7 +392,7 @@
+ 				}
+ 			}
+ 		}
+-		if(rigid){
++		if(selfattraction){
+ 
+ 			/*merge G_viscoelastic_local into G_viscoelastic; U_viscoelastic_local into U_viscoelastic; H_viscoelastic_local to H_viscoelastic:{{{*/
+ 			int* recvcounts=xNew<int>(IssmComm::GetSize());
+@@ -399,7 +400,7 @@
+ 			int  rc;
+ 			int  offset;
+ 
+-			//deal with rigid first: 
++			//deal with selfattraction first: 
+ 			ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
+ 
+ 			/*displs: */
+@@ -406,7 +407,7 @@
+ 			ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
+ 
+ 			/*All gather:*/
+-			ISSM_MPI_Allgatherv(G_rigid_local, m, ISSM_MPI_DOUBLE, G_rigid, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
++			ISSM_MPI_Allgatherv(G_gravi_local, m, ISSM_MPI_DOUBLE, G_gravi, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
+ 
+ 			if(elastic){
+ 				rc=m*ntimesteps;
+@@ -426,7 +427,7 @@
+ 			
+ 
+ 			/*Avoid singularity at 0: */
+-			G_rigid[0]=G_rigid[1];
++			G_gravi[0]=G_gravi[1];
+ 			if(elastic){
+ 				for(int t=0;t<ntimesteps;t++){
+ 					G_viscoelastic[t]=G_viscoelastic[ntimesteps+t];
+@@ -485,7 +486,7 @@
+ 						
+ 			}
+ 			else if(elastic){
+-				nt=1; //in elastic, or if we run only rigid, we need only one step
++				nt=1; //in elastic, or if we run only selfattraction, we need only one step
+ #ifdef _HAVE_AD_
+ 				G_viscoelastic_interpolated=G_viscoelastic;
+ 				U_viscoelastic_interpolated=U_viscoelastic;
+@@ -498,7 +499,7 @@
+ 			}	
+ 
+ 			/*Save our precomputed tables into parameters*/
+-			parameters->AddObject(new DoubleVecParam(SealevelchangeGRigidEnum,G_rigid,M));
++			parameters->AddObject(new DoubleVecParam(SealevelchangeGSelfAttractionEnum,G_gravi,M));
+ 			if(viscous || elastic){
+ 				parameters->AddObject(new DoubleVecParam(SealevelchangeGViscoElasticEnum,G_viscoelastic_interpolated,M*nt));
+ 				parameters->AddObject(new DoubleVecParam(SealevelchangeUViscoElasticEnum,U_viscoelastic_interpolated,M*nt));
+@@ -506,8 +507,8 @@
+ 			}
+ 
+ 			/*free resources: */
+-			xDelete<IssmDouble>(G_rigid);
+-			xDelete<IssmDouble>(G_rigid_local);
++			xDelete<IssmDouble>(G_gravi);
++			xDelete<IssmDouble>(G_gravi_local);
+ 			if(elastic){
+ 				xDelete<IssmDouble>(love_h);
+ 				xDelete<IssmDouble>(love_k);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26295)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26296)
+@@ -222,7 +222,7 @@
+ 		#endif
+ 		#ifdef _HAVE_SEALEVELCHANGE_
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+@@ -231,7 +231,7 @@
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
+ 		#endif
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26295)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 26296)
+@@ -177,7 +177,7 @@
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+@@ -186,7 +186,7 @@
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26295)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 26296)
+@@ -184,7 +184,7 @@
+ #endif
+ #ifdef _HAVE_SEALEVELCHANGE_
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt, Matlitho* litho, IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+-		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae){_error_("not implemented yet");};
+@@ -193,7 +193,7 @@
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){_error_("not implemented yet");};
+-		void       SealevelchangeDeformationConvolution(GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads,  IssmDouble* rotationvector,SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){_error_("not implemented yet");};
+ 		void       SealevelchangeUpdateViscousFields(){_error_("not implemented yet");};
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26295)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26296)
+@@ -169,13 +169,13 @@
+ 		#ifdef _HAVE_SEALEVELCHANGE_
+ 		void       GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y);
+ 		void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+-		void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom);
++		void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom);
+ 		void       SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae);
+ 		void       SealevelchangeGeometryCentroidLoads(SealevelGeometry* slgeom, IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae);
+ 		void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom);
+ 		void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
+ 		void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom);
+-		void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
++		void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom);
+ 		void       SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom);
+ 		void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads,  SealevelGeometry* slgeom);
+ 		void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom);
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26295)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26296)
+@@ -23,8 +23,8 @@
+ void TransferForcing(FemModel* femmodel,int forcingenum);
+ void TransferSealevel(FemModel* femmodel,int forcingenum);
+ bool slcconvergence(Vector<IssmDouble>* RSLg,Vector<IssmDouble>* RSLg_old,IssmDouble eps_rel,IssmDouble eps_abs);
+-IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble oceanarea);
+-void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom);
++IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble totaloceanarea);
++void PolarMotion(IssmDouble* m, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom);
+ void ConserveOceanMass(FemModel* femmodel,GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom);
+ void ivins_deformation_core(FemModel* femmodel);
+ IssmDouble* CombineLoads(IssmDouble* load,IssmDouble* subload,FemModel* femmodel, SealevelGeometry* slgeom,int loadtype,int nel);
+@@ -220,12 +220,12 @@
+ 	int nel;
+ 	BarystaticContributions* barycontrib=NULL;
+ 	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
+-	IssmDouble rotationaxismotionvector[3]={0};
++	IssmDouble polarmotionvector[3]={0};
+ 	
+ 	GrdLoads*              loads=NULL;
+ 	Vector<IssmDouble>*    oldsealevelloads=NULL;
+ 	Vector<IssmDouble>*    oceanareas=NULL;
+-	IssmDouble             oceanarea;
++	IssmDouble             totaloceanarea;
+ 	Vector<IssmDouble>*    subelementoceanareas=NULL;
+ 	IssmDouble             oceanaverage;
+ 	bool                   scaleoceanarea=false;
+@@ -243,8 +243,10 @@
+ 	int  count,frequency,iscoupling;
+ 	int  grd=0;
+ 	int  grdmodel; 
+-	int  computesealevel=0;
++	int  sealevelloading=0;
+ 	bool viscous=false;
++	bool rotation=false;
++	bool planethasocean=false;
+ 	IssmDouble*           sealevelpercpu=NULL;
+ 
+ 	/*}}}*/
+@@ -254,12 +256,16 @@
+ 
+ 	/*retrieve parameters:{{{*/
+ 	femmodel->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
++	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+-	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
++	femmodel->parameters->FindParam(&step,StepEnum);
++	femmodel->parameters->FindParam(&time,TimeEnum);
++	femmodel->parameters->FindParam(&sealevelloading,SolidearthSettingsSealevelLoadingEnum);
+ 	femmodel->parameters->FindParam(&max_nonlinear_iterations,SolidearthSettingsMaxiterEnum);
+-	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 	femmodel->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
++	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
++	femmodel->parameters->FindParam(&planethasocean,SolidearthSettingsGrdOceanEnum);
+ 	/*}}}*/
+ 
+ 	/*only run if grd was requested, if we are the earth, and we have reached
+@@ -313,13 +319,14 @@
+ 	//broadcast loads 
+ 	loads->BroadcastLoads();
+ 
+-	//compute rotation axis motion:
+-	RotationAxisMotion(&rotationaxismotionvector[0],femmodel,loads,slgeom);
++	//compute polar motion:
++	PolarMotion(&polarmotionvector[0],femmodel,loads,slgeom);
+ 
+-	/*skip computation of sea level if requested, which means sea level loads should be zeroed */
+-	if(!computesealevel){
++	/*skip computation of sea level equation if requested, which means sea level loads should be zeroed */
++	if(!sealevelloading){
+ 		loads->sealevelloads=xNewZeroInit<IssmDouble>(nel);
+ 		loads->subsealevelloads=xNewZeroInit<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
++
+ 		goto deformation;
+ 	}
+ 
+@@ -331,7 +338,7 @@
+ 		/*convolve load and sealevel loads on oceans:*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			element->SealevelchangeConvolution(sealevelpercpu, loads , rotationaxismotionvector,slgeom);
++			element->SealevelchangeConvolution(sealevelpercpu, loads , polarmotionvector,slgeom);
+ 		}
+ 		
+ 		/*retrieve sea level average  and ocean area:*/
+@@ -346,19 +353,19 @@
+ 		if(!loads->sealevelloads){ //first time in the loop
+ 			oceanareas->Assemble(); 
+ 			subelementoceanareas->Assemble();
+-			oceanareas->Sum(&oceanarea); _assert_(oceanarea>0.);
+-			if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
++			oceanareas->Sum(&totaloceanarea); _assert_(totaloceanarea>0.);
++			if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2
+ 		}
+ 	
+ 		//Conserve ocean mass: 
+-		oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, oceanarea);
+-		ConserveOceanMass(femmodel,loads,barycontrib->Total()/oceanarea - oceanaverage,slgeom);
++		oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, totaloceanarea);
++		ConserveOceanMass(femmodel,loads,barycontrib->Total()/totaloceanarea - oceanaverage,slgeom);
+ 
+ 		//broadcast sea level loads 
+ 		loads->BroadcastSealevelLoads();
+ 
+-		//compute rotation axis motion:
+-		RotationAxisMotion(&rotationaxismotionvector[0],femmodel,loads, slgeom);
++		//compute polar motion:
++		PolarMotion(&polarmotionvector[0],femmodel,loads, slgeom);
+ 
+ 		//convergence?
+ 		if(slcconvergence(loads->vsealevelloads,oldsealevelloads,eps_rel,eps_abs))break;
+@@ -375,21 +382,48 @@
+ 	/*convolve loads and sea level loads to get the deformation:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->SealevelchangeDeformationConvolution(loads, rotationaxismotionvector,slgeom);
++		element->SealevelchangeDeformationConvolution(sealevelpercpu, loads, polarmotionvector,slgeom);
+ 	}
+ 
+ 	if(VerboseSolution()) _printf0_("	  updating GRD fields\n");
+ 
+-	/*Update bedrock motion and geoid:*/
+-	if(computesealevel){
+-		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/rho_water/oceanarea- oceanaverage/rho_water); //given that we converged, no need to recompute ocean average
++	if(planethasocean){
++		if (!sealevelloading){ //we haven't done so before, so we need to compute the ocean average and area
++			loads->sealevelloads=NULL; //needed to trigger the calculation of areas
++			/*retrieve sea level average  and ocean area:*/
++			for(Object* & object : femmodel->elements->objects){
++				Element* element = xDynamicCast<Element*>(object);
++				element->SealevelchangeOceanAverage(loads, oceanareas, subelementoceanareas, sealevelpercpu, slgeom);
++			}
++			loads->sealevelloads=xNewZeroInit<IssmDouble>(nel);
++			loads->AssembleSealevelLoads();
++			/*compute ocean areas:*/
++			oceanareas->Assemble(); 
++			subelementoceanareas->Assemble();
++			oceanareas->Sum(&totaloceanarea); _assert_(totaloceanarea>0.);
++			if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2
++				
++			//Conserve ocean mass
++			//Note that here we create sea-level loads but they will not generate GRD as we have already run all the convolutions
++			oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, totaloceanarea);
++			ConserveOceanMass(femmodel,loads,barycontrib->Total()/totaloceanarea - oceanaverage,slgeom);
++		}
+ 
++		femmodel->inputs->Shift(SealevelGRDEnum,barycontrib->Total()/rho_water/totaloceanarea- oceanaverage/rho_water);
++
+ 		//cumulate barystatic contributions and save to results: 
+ 		barycontrib->Cumulate(femmodel->parameters);
+-		barycontrib->Save(femmodel->results,femmodel->parameters,oceanarea);
++		barycontrib->Save(femmodel->results,femmodel->parameters,totaloceanarea);
+ 		barycontrib->Reset();
+ 	}
+ 
++	if (rotation) {
++		femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorXZEnum,polarmotionvector[0],step,time));
++		femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorYZEnum,polarmotionvector[1],step,time));
++		femmodel->results->AddResult(new GenericExternalResult<IssmDouble>(femmodel->results->Size()+1,SealevelInertiaTensorZZEnum,polarmotionvector[2],step,time));
++	}
++
++	/*Update bedrock motion and geoid:*/
+ 	femmodel->inputs->AXPY(1,SealevelGRDEnum,SealevelEnum);
+ 	femmodel->inputs->AXPY(1,BedGRDEnum,BedEnum);
+ 	if(horiz){
+@@ -408,7 +442,6 @@
+ 
+ 	/*parameters: */
+ 	int  step;
+-	int computesealevel=0;
+ 	bool isocean=false;
+ 	IssmDouble time;
+ 
+@@ -417,10 +450,6 @@
+ 	IssmDouble cumgmslc=0;
+ 	IssmDouble gmtslc=0;
+ 
+-	/*early return if we are not computing sea level, but rather deformation: */
+-	femmodel->parameters->FindParam(&computesealevel,SolidearthSettingsComputesealevelchangeEnum);
+-	if (!computesealevel)return;
+-
+ 	/*early return if we have no ocean transport:*/
+ 	femmodel->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
+ 	if(!isocean)return;
+@@ -609,7 +638,7 @@
+ 	femmodel->parameters->FindParam(&zze,&nel,ZzeEnum);
+ 	femmodel->parameters->FindParam(&areae,&nel,AreaeEnum);
+ 	
+-	/*initialize SealevelMasks structure: */
++	/*initialize SealevelloadMasks structure: */
+ 	slgeom=new SealevelGeometry(femmodel->elements->Size(),femmodel->vertices->Size());
+ 	
+ 	/*Verbose: */
+@@ -638,7 +667,7 @@
+ 	/*Create fractional green function kernels: */
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+-		element->SealevelchangeGeometryFractionKernel(slgeom);
++		element->SealevelchangeGeometrySubElementKernel(slgeom);
+ 	}
+ 
+ 
+@@ -698,7 +727,7 @@
+ 	return converged;
+ 
+ } /*}}}*/
+-IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* suboceanareas, IssmDouble oceanarea){ /*{{{*/
++IssmDouble  SealevelloadsOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* suboceanareas, IssmDouble totaloceanarea){ /*{{{*/
+ 
+ 	IssmDouble sealevelloadsaverage;	
+ 	IssmDouble subsealevelloadsaverage;	
+@@ -714,9 +743,9 @@
+ 	delete vsealevelloadsvolume; 
+ 	delete vsubsealevelloadsvolume; 
+ 	
+-	return (sealevelloadsaverage+subsealevelloadsaverage)/oceanarea;
++	return (sealevelloadsaverage+subsealevelloadsaverage)/totaloceanarea;
+ } /*}}}*/
+-void RotationAxisMotion(IssmDouble* m, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom){ /*{{{*/
++void PolarMotion(IssmDouble* polarmotionvector, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	IssmDouble  moi_list[3]={0,0,0};
+ 	IssmDouble  moi_list_sub[3]={0,0,0};
+@@ -745,7 +774,6 @@
+ 		Element* element = xDynamicCast<Element*>(object);
+ 
+ 		element->SealevelchangeMomentOfInertiaCentroid(&moi_list[0],loads,slgeom);
+-
+ 		element->SealevelchangeMomentOfInertiaSubElement(&moi_list_sub[0],loads, slgeom);
+ 
+ 		moi_list_cpu[0] += moi_list[0]+moi_list_sub[0];
+@@ -753,6 +781,7 @@
+ 		moi_list_cpu[2] += moi_list[2]+moi_list_sub[2];
+ 	}
+ 
++	for (int i=0;i<3;i++) moi_list[i]=0;
+ 
+ 	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+ 	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+@@ -769,9 +798,9 @@
+ 	m3 = -(1+load_love_k[2])/moi_p * moi_list[2];	// term associated with fluid number (3-order-of-magnitude smaller) is negelected
+ 
+ 	/*Assign output pointers:*/
+-	m[0]=m1;
+-	m[1]=m2;
+-	m[2]=m3;
++	polarmotionvector[0]=m1;
++	polarmotionvector[1]=m2;
++	polarmotionvector[2]=m3;
+ } /*}}}*/
+ void        ConserveOceanMass(FemModel* femmodel,GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26295)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26296)
+@@ -359,6 +359,9 @@
+ 	SolidearthSettingsElasticEnum,
+ 	SolidearthSettingsViscousEnum,
+ 	SealevelchangeGeometryDoneEnum,
++	SealevelchangeViscousNumStepsEnum,
++	SealevelchangeViscousTimesEnum,
++	SealevelchangeViscousIndexEnum,
+ 	RotationalEquatorialMoiEnum,
+ 	TidalLoveHEnum,
+ 	TidalLoveKEnum,
+@@ -369,9 +372,9 @@
+ 	LoadLoveLEnum,
+ 	LoveTimeFreqEnum,
+ 	LoveIsTimeEnum,
+-	SealevelchangeGRigidEnum,
++	SealevelchangeGSelfAttractionEnum,
+ 	SealevelchangeGViscoElasticEnum,
+-	SolidearthSettingsComputesealevelchangeEnum,
++	SolidearthSettingsSealevelLoadingEnum,
+ 	SolidearthSettingsGRDEnum,
+ 	SolidearthSettingsRunFrequencyEnum,
+ 	SolidearthSettingsTimeAccEnum,
+@@ -378,11 +381,12 @@
+ 	SealevelchangeHViscoElasticEnum,
+ 	SolidearthSettingsHorizEnum,
+ 	SolidearthSettingsMaxiterEnum,
++	SolidearthSettingsGrdOceanEnum,
+ 	SolidearthSettingsOceanAreaScalingEnum,
+ 	RotationalPolarMoiEnum,
+ 	SolidearthSettingsReltolEnum,
+ 	SealevelchangeRequestedOutputsEnum,
+-	SolidearthSettingsRigidEnum,
++	SolidearthSettingsSelfAttractionEnum,
+ 	SolidearthSettingsRotationEnum,
+ 	SolidearthSettingsMaxSHCoeffEnum,
+ 	SealevelchangeRunCountEnum,
+@@ -396,9 +400,6 @@
+ 	SettingsSbCouplingFrequencyEnum,
+ 	SettingsSolverResidueThresholdEnum,
+ 	SettingsWaitonlockEnum,
+-	StackNumStepsEnum,
+-	StackTimesEnum,
+-	StackIndexEnum,
+ 	SmbAIceEnum,
+ 	SmbAIdxEnum,
+ 	SmbASnowEnum,
+@@ -831,6 +832,10 @@
+ 	SealevelchangeGUsubelHydroEnum,
+ 	SealevelchangeGEsubelHydroEnum,
+ 	SealevelchangeGNsubelHydroEnum,
++	SealevelchangeViscousRSLEnum,
++	SealevelchangeViscousUEnum,
++	SealevelchangeViscousNEnum,
++	SealevelchangeViscousEEnum,
+ 	SedimentHeadEnum,
+ 	SedimentHeadOldEnum,
+ 	SedimentHeadSubstepEnum,
+@@ -952,10 +957,6 @@
+ 	SolidearthExternalDisplacementNorthRateEnum,
+ 	SolidearthExternalDisplacementUpRateEnum,
+ 	SolidearthExternalGeoidRateEnum,
+-	StackRSLEnum,
+-	StackUEnum,
+-	StackNEnum,
+-	StackEEnum,
+ 	StrainRateeffectiveEnum,
+ 	StrainRateparallelEnum,
+ 	StrainRateperpendicularEnum,
+@@ -1429,6 +1430,7 @@
+ 	SealevelInertiaTensorXZEnum,
+ 	SealevelInertiaTensorYZEnum,
+ 	SealevelInertiaTensorZZEnum,
++	SealevelchangePolarMotionEnum,
+ 	SealevelNmotionEnum,
+ 	SealevelUmotionEnum,
+ 	SealevelchangeAnalysisEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26295)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26296)
+@@ -377,9 +377,9 @@
+ 		case LoadLoveLEnum : return "LoadLoveL";
+ 		case LoveTimeFreqEnum : return "LoveTimeFreq";
+ 		case LoveIsTimeEnum : return "LoveIsTime";
+-		case SealevelchangeGRigidEnum : return "SealevelchangeGRigid";
++		case SealevelchangeGSelfAttractionEnum : return "SealevelchangeGSelfAttraction";
+ 		case SealevelchangeGViscoElasticEnum : return "SealevelchangeGViscoElastic";
+-		case SolidearthSettingsComputesealevelchangeEnum : return "SolidearthSettingsComputesealevelchange";
++		case SolidearthSettingsSealevelLoadingEnum : return "SolidearthSettingsSealevelLoading";
+ 		case SolidearthSettingsGRDEnum : return "SolidearthSettingsGRD";
+ 		case SolidearthSettingsRunFrequencyEnum : return "SolidearthSettingsRunFrequency";
+ 		case SolidearthSettingsTimeAccEnum : return "SolidearthSettingsTimeAcc";
+@@ -390,7 +390,7 @@
+ 		case RotationalPolarMoiEnum : return "RotationalPolarMoi";
+ 		case SolidearthSettingsReltolEnum : return "SolidearthSettingsReltol";
+ 		case SealevelchangeRequestedOutputsEnum : return "SealevelchangeRequestedOutputs";
+-		case SolidearthSettingsRigidEnum : return "SolidearthSettingsRigid";
++		case SolidearthSettingsSelfAttractionEnum : return "SolidearthSettingsSelfAttraction";
+ 		case SolidearthSettingsRotationEnum : return "SolidearthSettingsRotation";
+ 		case SealevelchangeRunCountEnum : return "SealevelchangeRunCount";
+ 		case SealevelchangeTransitionsEnum : return "SealevelchangeTransitions";
+@@ -403,9 +403,9 @@
+ 		case SettingsSbCouplingFrequencyEnum : return "SettingsSbCouplingFrequency";
+ 		case SettingsSolverResidueThresholdEnum : return "SettingsSolverResidueThreshold";
+ 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
+-		case StackNumStepsEnum : return "StackNumSteps";
+-		case StackTimesEnum : return "StackTimes";
+-		case StackIndexEnum : return "StackIndex";
++		case SealevelchangeViscousNumStepsEnum : return "SealevelchangeViscousNumSteps";
++		case SealevelchangeViscousTimesEnum : return "SealevelchangeViscousTimes";
++		case SealevelchangeViscousIndexEnum : return "SealevelchangeViscousIndex";
+ 		case SmbAIceEnum : return "SmbAIce";
+ 		case SmbAIdxEnum : return "SmbAIdx";
+ 		case SmbASnowEnum : return "SmbASnow";
+@@ -956,10 +956,10 @@
+ 		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
+ 		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+ 		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
+-		case StackRSLEnum : return "StackRSL";
+-		case StackUEnum : return "StackU";
+-		case StackNEnum : return "StackN";
+-		case StackEEnum : return "StackE";
++		case SealevelchangeViscousRSLEnum : return "SealevelchangeViscousRSL";
++		case SealevelchangeViscousUEnum : return "SealevelchangeViscousU";
++		case SealevelchangeViscousNEnum : return "SealevelchangeViscousN";
++		case SealevelchangeViscousEEnum : return "SealevelchangeViscousE";
+ 		case StrainRateeffectiveEnum : return "StrainRateeffective";
+ 		case StrainRateparallelEnum : return "StrainRateparallel";
+ 		case StrainRateperpendicularEnum : return "StrainRateperpendicular";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26295)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26296)
+@@ -386,9 +386,9 @@
+    }
+    if(stage==4){
+ 	      if (strcmp(name,"LoveIsTime")==0) return LoveIsTimeEnum;
+-	      else if (strcmp(name,"SealevelchangeGRigid")==0) return SealevelchangeGRigidEnum;
++	      else if (strcmp(name,"SealevelchangeGSelfAttraction")==0) return SealevelchangeGSelfAttractionEnum;
+ 	      else if (strcmp(name,"SealevelchangeGViscoElastic")==0) return SealevelchangeGViscoElasticEnum;
+-	      else if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
++	      else if (strcmp(name,"SolidearthSettingsSealevelLoading")==0) return SolidearthSettingsSealevelLoadingEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsGRD")==0) return SolidearthSettingsGRDEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRunFrequency")==0) return SolidearthSettingsRunFrequencyEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsTimeAcc")==0) return SolidearthSettingsTimeAccEnum;
+@@ -399,7 +399,7 @@
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+ 	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+-	      else if (strcmp(name,"SolidearthSettingsRigid")==0) return SolidearthSettingsRigidEnum;
++	      else if (strcmp(name,"SolidearthSettingsSelfAttraction")==0) return SolidearthSettingsSelfAttractionEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+@@ -412,9 +412,9 @@
+ 	      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,"StackNumSteps")==0) return StackNumStepsEnum;
+-	      else if (strcmp(name,"StackTimes")==0) return StackTimesEnum;
+-	      else if (strcmp(name,"StackIndex")==0) return StackIndexEnum;
++	      else if (strcmp(name,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
++	      else if (strcmp(name,"SealevelchangeViscousTimes")==0) return SealevelchangeViscousTimesEnum;
++	      else if (strcmp(name,"SealevelchangeViscousIndex")==0) return SealevelchangeViscousIndexEnum;
+ 	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
+ 	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
+ 	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
+@@ -977,10 +977,10 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+-	      else if (strcmp(name,"StackRSL")==0) return StackRSLEnum;
+-	      else if (strcmp(name,"StackU")==0) return StackUEnum;
+-	      else if (strcmp(name,"StackN")==0) return StackNEnum;
+-	      else if (strcmp(name,"StackE")==0) return StackEEnum;
++	      else if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
++	      else if (strcmp(name,"SealevelchangeViscousU")==0) return SealevelchangeViscousUEnum;
++	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
++	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+Index: ../trunk-jpl/test/NightlyRun/test2004.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26296)
+@@ -394,7 +394,7 @@
+ %Solution parameters
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.sealevelloading=1;
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
+@@ -422,7 +422,7 @@
+ md.solidearth.settings.maxiter=10;
+ 
+ %eustatic run:
+-md.solidearth.settings.rigid=0;
++md.solidearth.settings.selfattraction=0;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.requested_outputs= {'default',...
+@@ -431,22 +431,22 @@
+ md=solve(md,'Transient');
+ Seustatic=md.results.TransientSolution.Sealevel;
+ 
+-%eustatic + rigid run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+ md=solve(md,'Transient');
+-Srigid=md.results.TransientSolution.Sealevel;
++Sselfattraction=md.results.TransientSolution.Sealevel;
+ 
+-%eustatic + rigid + elastic run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+ md=solve(md,'Transient');
+ Selastic=md.results.TransientSolution.Sealevel;
+ 
+-%eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic + rotation run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
+ md=solve(md,'Transient');
+@@ -456,4 +456,4 @@
+ %Fields and tolerances to track changes
+ field_names     ={'Eustatic','Rigid','Elastic','Rotation'};
+ field_tolerances={1e-13,1e-13,1e-13,1e-13};
+-field_values={Seustatic,Srigid,Selastic,Srotation};
++field_values={Seustatic,Sselfattraction,Selastic,Srotation};
+Index: ../trunk-jpl/test/NightlyRun/test2005.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2005.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2005.m	(revision 26296)
+@@ -1,52 +1,64 @@
+-%Test Name: EarthSlc
++%Test Name: Earthslc_time
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+-%parameterize solidearth solution:
++%Geometry for the bed, arbitrary thickness of 100: 
++md.geometry.bed=zeros(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
+ %solidearth loading:  {{{
+-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-md.dsl.global_average_thermosteric_sea_level_change=[1;0];
+-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.masstransport.spcthickness=[md.geometry.thickness;0];
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ %antarctica
+-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
++
++late=asind(ze./re);
++longe=atan2d(ye,xe);
+ pos=find(late < -80);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posant=pos;
+ %greenland
+-pos=find(late>70 & late<80 & longe>-60 & longe<-30);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posgre=pos;
+ 
+ %elastic loading from love numbers:
+-md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
++md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
+ 
+ %}}}
+ %mask:  {{{
+ mask=gmtmask(md.mesh.lat,md.mesh.long);
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1;
++
+ icemask=ones(md.mesh.numberofvertices,1);
+-pos=find(mask==0);
+-icemask(pos)=-1;
+-pos=find(sum(mask(md.mesh.elements),2)<3);
+-icemask(md.mesh.elements(pos,:))=-1;
++icemask(md.mesh.elements(posant))=-1;
++icemask(md.mesh.elements(posgre))=-1;
++
+ md.mask.ice_levelset=icemask;
+-md.mask.ocean_levelset=-icemask;
+-
+-%make sure that the elements that have loads are fully grounded:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
+-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+-
+-%make sure wherever there is an ice load, that the mask is set to ice:
+-%pos=find(md.solidearth.surfaceload.icethicknesschange); % TODO: Do we need to do this twice?
+-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
++md.mask.ocean_levelset=oceanmask;
+ % }}}
+ 
+-md.solidearth.settings.ocean_area_scaling=0;
++%time stepping: 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=10;
+ 
+-%Geometry for the bed, arbitrary: 
+-md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++%masstransport:
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
+ 
+ %Materials: 
+ md.materials=materials('hydro');
+@@ -55,34 +67,34 @@
+ md.miscellaneous.name='test2005';
+ 
+ %Solution parameters
++md.cluster.np=3;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.sealevelloading=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
+ 
+-% max number of iteration reverted back to 10 (i.e., the original default value)
+-md.solidearth.settings.maxiter=10;
+-
+-%eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid=1;
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
++md.solidearth.settings.viscous=0;
+ 
+-%transient settings: 
+-md.timestepping.start_time=0;
+-md.timestepping.final_time=10;
+-md.timestepping.time_step=1;
+-md.transient.isslc=1;
+-md.transient.issmb=0;
+-md.transient.ismasstransport=0;
++%Physics: 
++md.transient.issmb=0; 
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+-dh=md.solidearth.surfaceload.icethicknesschange;
+-deltathickness=zeros(md.mesh.numberofelements+1,10);
+-for i=1:10,
+-	deltathickness(1:end-1,i)=dh*i;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel'};
++
++dh=md.masstransport.spcthickness;
++deltathickness=zeros(md.mesh.numberofvertices+1,10);
++for i=0:10,
++	deltathickness(1:end-1,i+1)=md.geometry.thickness+dh(1:end-1)*i;
+ end
+-deltathickness(end,:)=0:1:9;
+-md.solidearth.surfaceload.icethicknesschange=deltathickness;
++deltathickness(end,:)=0:1:10;
++md.masstransport.spcthickness=deltathickness;
+ %hack: 
+ md.geometry.surface=zeros(md.mesh.numberofvertices,1);
+ md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+@@ -89,6 +101,7 @@
+ md.geometry.base=-ones(md.mesh.numberofvertices,1);
+ md.geometry.bed=md.geometry.base;
+ 
++
+ %run transient solution: 
+ md=solve(md,'Transient');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2006.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2006.m	(revision 26296)
+@@ -2,24 +2,33 @@
+ 
+ %mesh earth:
+ md=model;
+-md.cluster=generic('name',oshostname(),'np',5);
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+-%parameterize solidearth solution:
++%Geometry for the bed, arbitrary thickness of 100: 
++md.geometry.bed=zeros(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
+ %solidearth loading:  {{{
+-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-md.dsl.global_average_thermosteric_sea_level_change=[1;0];
+-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++md.masstransport.spcthickness=[md.geometry.thickness;0];
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ %antarctica
+-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
++
++late=asind(ze./re);
++longe=atan2d(ye,xe);
+ pos=find(late < -80);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posant=pos;
+ %greenland
+-pos=find(late>70 & late<80 & longe>-60 & longe<-30);
+-md.solidearth.surfaceload.icethicknesschange(pos)=-100;
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posgre=pos;
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+@@ -27,27 +36,29 @@
+ %}}}
+ %mask:  {{{
+ mask=gmtmask(md.mesh.lat,md.mesh.long);
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1;
++
+ icemask=ones(md.mesh.numberofvertices,1);
+-pos=find(mask==0);
+-icemask(pos)=-1;
+-pos=find(sum(mask(md.mesh.elements),2)<3);
+-icemask(md.mesh.elements(pos,:))=-1;
++icemask(md.mesh.elements(posant))=-1;
++icemask(md.mesh.elements(posgre))=-1;
++
+ md.mask.ice_levelset=icemask;
+-md.mask.ocean_levelset=-icemask;
+-
+-%make sure that the elements that have loads are fully grounded:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
+-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
+-
+-%make sure wherever there is an ice load, that the mask is set to ice:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
+-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
++md.mask.ocean_levelset=oceanmask;
+ % }}}
+ 
+-md.solidearth.settings.ocean_area_scaling=0;
++%time stepping: 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=10;
+ 
+-%Geometry for the bed, arbitrary: 
+-md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++%masstransport:
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
+ 
+ %Materials: 
+ md.materials=materials('hydro');
+@@ -56,34 +67,34 @@
+ md.miscellaneous.name='test2006';
+ 
+ %Solution parameters
++md.cluster.np=3;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.sealevelloading=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
+ 
+-% max number of iteration reverted back to 10 (i.e., the original default value)
+-md.solidearth.settings.maxiter=10;
+-
+-%eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid=1;
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
++md.solidearth.settings.viscous=0;
+ 
+-%transient settings: 
+-md.timestepping.start_time=0;
+-md.timestepping.final_time=10;
+-md.timestepping.time_step=1;
+-md.transient.isslc=1;
+-md.transient.issmb=0;
+-md.transient.ismasstransport=0;
++%Physics: 
++md.transient.issmb=0; 
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+-dh=md.solidearth.surfaceload.icethicknesschange;
+-deltathickness=zeros(md.mesh.numberofelements+1,10);
+-for i=1:10,
+-	deltathickness(1:end-1,i)=dh*i;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++md.solidearth.requested_outputs={'Sealevel'};
++
++dh=md.masstransport.spcthickness;
++deltathickness=zeros(md.mesh.numberofvertices+1,10);
++for i=0:10,
++	deltathickness(1:end-1,i+1)=md.geometry.thickness+dh(1:end-1)*i;
+ end
+-deltathickness(end,:)=0:1:9;
+-md.solidearth.surfaceload.icethicknesschange=deltathickness;
++deltathickness(end,:)=0:1:10;
++md.masstransport.spcthickness=deltathickness;
+ 
+ %hack: 
+ md.geometry.surface=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test2007.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2007.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2007.m	(revision 26296)
+@@ -1,10 +1,11 @@
+-%Test Name: offline solid earth solution
++%Test Name: External_OfflineSolidearthSolution
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+-%Geometry for the bed, arbitrary thickness of 1000: 
++%Geometry for the bed, arbitrary
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+ md.geometry.base=md.geometry.bed;
+ md.geometry.thickness=zeros(md.mesh.numberofvertices,1);
+@@ -45,6 +46,7 @@
+ 
+ %Solution parameters
+ md.cluster.np=3;
++md.solidearth.settings.isgrd=0;
+ md.solidearth.settings.horiz=1;
+ 
+ %Physics: 
+Index: ../trunk-jpl/test/NightlyRun/test2008.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2008.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2008.m	(revision 26296)
+@@ -1,8 +1,9 @@
+-%Test Name: External:AdditionalSolidearthSolution
++%Test Name: External_AdditionalSolidearthSolution
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+ %Geometry for the bed, arbitrary thickness of 100: 
+ md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+@@ -69,7 +70,7 @@
+ md.cluster.np=3;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.sealevelloading=1;
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
+@@ -85,8 +86,8 @@
+ % max number of iteration reverted back to 10 (i.e., the original default value)
+ md.solidearth.settings.maxiter=10;
+ 
+-%eustatic + rigid + elastic:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.settings.viscous=0;
+Index: ../trunk-jpl/test/NightlyRun/test2010.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2010.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2010.m	(revision 26296)
+@@ -2,95 +2,125 @@
+ 
+ %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
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
++%Geometry for the bed, arbitrary thickness of 1000: 
++md.geometry.bed=-ones(md.mesh.numberofvertices,1);
++md.geometry.base=md.geometry.bed;
++md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
++md.geometry.surface=md.geometry.bed+md.geometry.thickness;
++
++
+ %parameterize slc solution:
+-%slc loading:  {{{
+-late=sum(md.mesh.lat(md.mesh.elements),2)/3;
+-longe=sum(md.mesh.long(md.mesh.elements),2)/3;
++%solidearth loading:  {{{
++md.masstransport.spcthickness=[md.geometry.thickness;0];
++md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 
+-md.solidearth.surfaceload.icethicknesschange=zeros(md.mesh.numberofelements,1);
+-pos=find(late <-75 & longe >0);
+-md.solidearth.surfaceload.icethicknesschange(pos(6:7))=-1;
+ 
+-md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1);
+-md.dsl.global_average_thermosteric_sea_level_change=[0;0];
+-md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1);
+-md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1);
++xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
++ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
++ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
++re=sqrt(xe.^2+ye.^2+ze.^2);
+ 
+-md.solidearth.settings.ocean_area_scaling = 1;
++late=asind(ze./re);
++longe=atan2d(ye,xe);
++%greenland
++pos=find(late>60 & late<90 & longe>-75 & longe<-15);
++md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++posice=pos;
+ 
+ %elastic loading from love numbers:
+-md.solidearth.lovenumbers=lovenumbers('maxdeg',1000);
++md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+ 
+ %}}}
+ %mask:  {{{
+ mask=gmtmask(md.mesh.lat,md.mesh.long);
+ icemask=ones(md.mesh.numberofvertices,1);
+-pos=find(mask==0);
+-icemask(pos)=-1;
+-pos=find(sum(mask(md.mesh.elements),2)<3);
+-icemask(md.mesh.elements(pos,:))=-1;
++icemask(md.mesh.elements(posice,:))=-0.5;
++
++oceanmask=-ones(md.mesh.numberofvertices,1);
++pos=find(mask==0); oceanmask(pos)=1; icemask(~pos)=1;
++
+ md.mask.ice_levelset=icemask;
+-md.mask.ocean_levelset=-icemask;
++md.mask.ocean_levelset=oceanmask;
+ 
+-%make sure that the elements that have loads are fully grounded:
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
+-md.mask.ocean_levelset(md.mesh.elements(pos,:))=1;
++% use model representation of ocen area (not the true area)
++md.solidearth.settings.ocean_area_scaling = 0;
+ 
+-%make sure wherever there is an ice load, that the mask is set to ice:
+-md.mask.ice_levelset=ones(md.mesh.numberofvertices,1);
+-pos=find(md.solidearth.surfaceload.icethicknesschange);
+-md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
+-% }}}
++%materials
++md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
++md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
++md.initialization.str=0;
+ 
+-%geometry {{{
+-di=md.materials.rho_ice/md.materials.rho_water;
+-md.geometry.thickness=ones(md.mesh.numberofvertices,1);
+-md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1);
+-md.geometry.base=md.geometry.surface-md.geometry.thickness;
+-md.geometry.bed=md.geometry.base;
+-% }}}
+-%materials {{{
+-md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1);
+-md.materials.rheology_B=paterson(md.initialization.temperature);
+-md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+-% }}}
+-%Miscellaneous {{{
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++
++%Miscellaneous
+ md.miscellaneous.name='test2010';
+-% }}}
+-%Solution parameters {{{
++
++%Solution parameters
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
+-% }}}
++md.solidearth.settings.sealevelloading=0;
++md.solidearth.settings.grdocean=1;
++md.solidearth.settings.isgrd=1;
++md.solidearth.settings.ocean_area_scaling=0;
++md.solidearth.settings.grdmodel=1;
++md.solidearth.settings.horiz=1;
++md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticIceArea','SealevelBarystaticIceLoad','SealevelBarystaticIceMask','SealevelBarystaticIceLatbar' 'SealevelBarystaticIceLongbar'};
+ 
+-%eustatic + rigid + elastic run:
+-md.solidearth.settings.rigid=1;
++%Physics: 
++md.transient.issmb=0; 
++md.transient.isstressbalance=0;
++md.transient.isthermal=0;
++md.transient.ismasstransport=1;
++md.transient.isslc=1;
++ 
++md.timestepping.start_time=0;
++md.timestepping.time_step=1;
++md.timestepping.final_time=1;
++
++%eustatic + selfattraction + elastic + rotation run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
++md.solidearth.settings.viscous=0;
+ md.cluster=generic('name',oshostname(),'np',3);
++%md.verbose=verbose('111111111');
++md=solve(md,'Transient');
+ 
++moi_p=md.solidearth.rotational.polarmoi;
++moi_e=md.solidearth.rotational.equatorialmoi;
++tide_love_k2=md.solidearth.lovenumbers.tk(3);
++load_love_k2=md.solidearth.lovenumbers.k(3);
++tide_love_k2secular=md.solidearth.lovenumbers.tk2secular;
+ % uncomment following 2 lines for
+-md=solve(md,'Sealevelchange');
+-eus=md.results.SealevelchangeSolution.Bslc;
+-slc=md.results.SealevelchangeSolution.Sealevel;
+-moixz=md.results.SealevelchangeSolution.SealevelInertiaTensorXZ;
+-moiyz=md.results.SealevelchangeSolution.SealevelInertiaTensorYZ;
+-moizz=md.results.SealevelchangeSolution.SealevelInertiaTensorZZ;
++eus=md.results.TransientSolution.Bslc;
++slc=md.results.TransientSolution.Sealevel;
++moixz=md.results.TransientSolution.SealevelInertiaTensorXZ / (1/(1-tide_love_k2/tide_love_k2secular) * (1+load_love_k2)/(moi_p-moi_e) );
++moiyz=md.results.TransientSolution.SealevelInertiaTensorYZ / (1/(1-tide_love_k2/tide_love_k2secular) * (1+load_love_k2)/(moi_p-moi_e) );
++moizz=md.results.TransientSolution.SealevelInertiaTensorZZ / ( -(1+load_love_k2)/moi_p);
+ 
++areaice=md.results.TransientSolution.SealevelBarystaticIceArea;
++loadice=md.results.TransientSolution.SealevelBarystaticIceLoad;
++
+ % analytical moi => just checking FOR ICE only!!! {{{
+ % ...have to mute ** slc induced MOI in Tria.cpp ** prior to the comparison
+-%rad_e = rad_e*1e3; % now in meters
+-%areas=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,rad_e);
+-%lat=late*pi/180; lon=longe*pi/180;
+-%moi_xz = sum(-md.materials.rho_freshwater.*md.solidearth.surfaceload.icethicknesschange.*areas.*rad_e^2.*sin(lat).*cos(lat).*cos(lon));
+-%moi_yz = sum(-md.materials.rho_freshwater.*md.solidearth.surfaceload.icethicknesschange.*areas.*rad_e^2.*sin(lat).*cos(lat).*sin(lon));
++rad_e = md.solidearth.planetradius;
++
++lat=md.results.TransientSolution.SealevelBarystaticIceLatbar*pi/180;
++lon=md.results.TransientSolution.SealevelBarystaticIceLongbar*pi/180;
++moi_xz = sum(-loadice.*areaice.*rad_e^2.*sin(lat).*cos(lat).*cos(lon));
++moi_yz = sum(-loadice.*areaice.*rad_e^2.*sin(lat).*cos(lat).*sin(lon));
++moi_zz = sum(-loadice.*areaice.*rad_e^2.*(1.0-sin(lat).^2));
++theoretical_value_check=[moixz/moi_xz moiyz/moi_yz moizz/moizz]
+ % }}}
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'eus','slc','moixz','moiyz','moizz'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
+ field_values={eus,slc,moixz,moiyz,moizz};
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2011.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2011.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2011.m	(revision 26296)
+@@ -1,8 +1,9 @@
+-%Test Name: EarthSlc
++%Test Name: SlcBarystatic
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500.); %700 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+@@ -69,13 +70,13 @@
+ md.materials=materials('hydro');
+ 
+ %Miscellaneous
+-md.miscellaneous.name='test2002';
++md.miscellaneous.name='test2011';
+ 
+ %Solution parameters
+ md.cluster.np=3;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.sealevelloading=1;
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
+@@ -93,9 +94,10 @@
+ md.solidearth.settings.maxiter=10;
+ 
+ %eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid=1;
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+-md.solidearth.settings.rotation=1;
++md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ md=solve(md,'tr');
+ 
+ %recover barystatic: 
+@@ -105,7 +107,7 @@
+ area=md.results.TransientSolution(1).SealevelBarystaticIceArea;
+ weights=md.results.TransientSolution(1).SealevelBarystaticIceWeights; 
+ dH=md.results.TransientSolution(1).DeltaIceThickness(md.mesh.elements); 
+-dHavg=sum(dH.*weights);
++dHavg=sum(dH.*weights,2);
+ oceanarea=sum(md.results.TransientSolution(1).SealevelBarystaticOceanArea);
+ bslc2=-sum(dHavg.*area)*md.materials.rho_ice/md.materials.rho_water/oceanarea;
+ 
+@@ -112,4 +114,4 @@
+ %Fields and tolerances to track changes
+ field_names={'BarystaticIce','BarystaticIce2','BarystaticIceDiff'};
+ field_tolerances={1e-13,1e-13,1e-13};
+-field_values={bslc,bslc2,bslc2-bslc2};
++field_values={bslc,bslc2,bslc2-bslc};
+Index: ../trunk-jpl/test/NightlyRun/test2090.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26296)
+@@ -2,7 +2,8 @@
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+@@ -72,7 +73,7 @@
+ 
+ time1=md.timestepping.start_time:md.timestepping.time_step:md.timestepping.final_time;
+ md.masstransport.spcthickness=repmat(md.masstransport.spcthickness, [1 length(time1)]);
+-md.masstransport.spcthickness(1:end-1,2:end)=0;
++md.masstransport.spcthickness(1:end-1,3:end)=0;
+ md.masstransport.spcthickness(end,:)=time1;
+ 
+ md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+@@ -91,15 +92,15 @@
+ md.miscellaneous.name='test2090';
+ 
+ %Solution parameters
+-md.cluster.np=1;
++md.cluster.np=3;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.sealevelloading=1;
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
+ md.solidearth.settings.timeacc=md.timestepping.time_step;
+-md.solidearth.settings.degacc=.01;
++md.solidearth.settings.degacc=.1;
+ 
+ %Physics:
+ md.transient.issmb=0; 
+@@ -112,8 +113,8 @@
+ % max number of iteration reverted back to 10 (i.e., the original default value)
+ md.solidearth.settings.maxiter=10;
+ 
+-%eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic + rotation run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.viscous=1;
+ md.solidearth.settings.rotation=0;
+@@ -126,6 +127,9 @@
+ B(:,i)=md.results.TransientSolution(i).Bed;
+ end
+ 
++hold on
++plot(md.timestepping.start_time:md.timestepping.time_step:(md.timestepping.final_time-md.timestepping.time_step), [B(916,:)]);
++
+ %Fields and tolerances to track changes
+ field_names={'Sealevel','Bed'};
+ field_tolerances={1e-13,1e-13};
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26295)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26296)
+@@ -390,7 +390,7 @@
+ 		virtual IssmDouble    GetTriangleAreaSpherical(IssmDouble xyz_list[3][3])=0;
+ 		virtual void          GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,Matlitho* litho, IssmDouble* x,IssmDouble* y)=0;
+ 
+-		virtual void       SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeGeometryInitial(IssmDouble* xxe, IssmDouble* yye, IssmDouble* zze, IssmDouble* areae)=0;
+@@ -399,7 +399,7 @@
+ 		virtual void       SealevelchangeBarystaticLoads(GrdLoads* loads, BarystaticContributions* barycontrib, SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom)=0;
+-		virtual void       SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
++		virtual void       SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom)=0;
+ 		virtual void       SealevelchangeUpdateViscousFields()=0;
+ 		#endif
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26295)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26296)
+@@ -1936,7 +1936,7 @@
+ 
+ 
+ 	bool istrapeze1, istrapeze2;
+-	IssmDouble phi1,phi2, f11,f12,f21,f22;
++	IssmDouble phi1,phi2, d,e,f,g,h1,h2;
+ 	int point1, point2,  i0,i1,i2,j0,j1,j2;
+ 	IssmDouble weights1[3],weights2[3];
+ 	IssmDouble levelset1[3];
+@@ -1950,7 +1950,6 @@
+ 	IssmDouble xyz2[3][3]={0};
+ 	IssmDouble xyz3[3][3]={0};
+ 	IssmDouble xyz[8][3]={0};
+-	IssmDouble f1o;
+ 	IssmDouble w[8][NUMVERTICES]={0};
+ 	IssmDouble areasub=0;
+ 	IssmDouble area1=0;
+@@ -2018,27 +2017,27 @@
+ 
+ 	//If just one levelset is all negative, just take the partitioning of the other, no interaction between them
+ 	if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0) {
+-		this->GetFractionGeometry(loadweights,&phi2,&point2,&f21,&f22,&istrapeze2,levelset2);
+-		this->GetBarycenterFromLevelset(platbar,plongbar, phi2, f21, f22, late, longe, point2,istrapeze2,planetradius);
++		this->GetFractionGeometry(loadweights,&phi2,&point2,&f,&g,&istrapeze2,levelset2);
++		this->GetBarycenterFromLevelset(platbar,plongbar, phi2, f, g, late, longe, point2,istrapeze2,planetradius);
+ 		*ploadarea=area*phi2;
+ 		return;
+ 	}
+ 	if (levelset2[0]<=0 && levelset2[1]<=0 && levelset2[2]<=0) {
+-		this->GetFractionGeometry(loadweights,&phi1,&point1,&f11,&f12,&istrapeze1,levelset1);
+-		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, f11, f12, late, longe, point1,istrapeze1,planetradius);
++		this->GetFractionGeometry(loadweights,&phi1,&point1,&d,&e,&istrapeze1,levelset1);
++		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, d, e, late, longe, point1,istrapeze1,planetradius);
+ 		*ploadarea=area*phi1;
+ 		return;
+ 	}
+ 
+ 
+-	this->GetFractionGeometry(&weights1[0],&phi1,&point1,&f11,&f12,&istrapeze1,levelset1);
+-	this->GetFractionGeometry(&weights2[0],&phi2,&point2,&f21,&f22,&istrapeze2,levelset2);
++	this->GetFractionGeometry(&weights1[0],&phi1,&point1,&d,&e,&istrapeze1,levelset1);
++	this->GetFractionGeometry(&weights2[0],&phi2,&point2,&f,&g,&istrapeze2,levelset2);
+ 
+ 
+ 	//Early return if levelsets are not independent
+ 	if (istrapeze1==istrapeze2 && point1==point2 && phi1==phi2){
+ 		//the two levelsets are redundant: levelset1 = positivescalar * levelset2
+-		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, f11, f12, late, longe, point1,istrapeze1,planetradius);
++		this->GetBarycenterFromLevelset(platbar,plongbar, phi1, d, e, late, longe, point1,istrapeze1,planetradius);
+ 		*ploadarea=area*phi1;
+ 		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=weights1[i];
+ 		return;
+@@ -2055,29 +2054,62 @@
+ 	
+ 	::GetVerticesCoordinates(&xyz0[0][0],vertices,NUMVERTICES); // initial triangle
+ 
+-	i0=point1;
+-	i1=(point1+1)%3;
+-	i2=(point1+2)%3;
++	//Let our element be triangle ABC with:
++	i0=point1; //A
++	i1=(point1+1)%3; //B
++	i2=(point1+2)%3; //C
+ 
+-	j0=point2;
+-	j1=(point2+1)%3;
+-	j2=(point2+2)%3;
++	j0=point2; //Can be A, B or C
++	j1=(point2+1)%3; //anticlockwise point from j0
++	j2=(point2+2)%3; //clockwise point from j0
+ 
+-	//f1o: fraction of segment {point_f11 -> point_f12} where the levelsets intersect (only used when f1o>=0 and f1o<=1)
+-	if(point2==i0) f1o= f22*(f11-f21)/(f11*f22-f12*f21);
+-	else if(point2==i1) f1o=f21*(1.0-f22-f11)/(f21*(f12-f11)-f12*f22);
+-	else f1o= (f22*(1.0-f21-f11)+f21*f11)/(f22*(f12-f11) +f21*f11);
++	/* Below we define the relative fractional lengths of ABC where the zero-level contours of the two level sets intersect with ABC and each other. For example D is the intersection of level set 1 with side AB with fractional length d=[AD]/[AB].
+ 
++	   levelset1 intersects ABC on D and E:
++	   A------D---B
++	   <--d--->		
+ 
++	   A-----E----C
++	   <--e-->
++
++	   levelset2 intersects ABC on F and G:
++	   j0---F------j1
++	   <--f->
++
++	   j0-------G--j2
++	   <---g---->
++
++	   levelset1 and 2 intersect on H (when that intersection exists inside the element)
++	   D----H------E
++	   <-h1->
++
++	   F-----H----G
++	   <--h2->
++	*/
++
++	if (point2==i0){
++		h1= g*(d-f)/(d*g-e*f);
++		h2= e/g * h1;
++	}
++        else if (point2==i1){
++		h1=f*(1.0-g-d)/(f*(e-d)-e*g);
++		h2= 1.0-e/f * h1;
++	}
++	else if (point2==i2){
++		h1= (g*(1.0-f-d)+f*d)/(g*(e-d) +f*d); 
++		h2= (d*(f+e-1))/(g*(e-d) +f*d);
++	}
++
++
+ 	//interpolant weights of each point. Any field F[0,1,2] provided at the original vertices [0,1,2] will be equal on point k to sum_i (F[i] * w[k][i])
+-	w[0][0]=1;
+-	w[1][1]=1;
+-	w[2][2]=1;
+-	w[3][i0]=1.0-f11; w[3][i1]=f11;
+-	w[4][i0]=1.0-f12; w[4][i2]=f12;
+-	w[5][j0]=1.0-f21; w[5][j1]=f21;
+-	w[6][j0]=1.0-f22; w[6][j2]=f22;
+-	for (int j=0;j<3;j++) w[7][j]=w[3][j]*(1.0-f1o) + w[4][j]*f1o; //we interpolate the intersection point between point_f11 and point_f12 at fraction f1o
++	w[0][0]=1; //A
++	w[1][1]=1; //B
++	w[2][2]=1; //C
++	w[3][i0]=1.0-d; w[3][i1]=d; //D
++	w[4][i0]=1.0-e; w[4][i2]=e; //E
++	w[5][j0]=1.0-f; w[5][j1]=f; //F
++	w[6][j0]=1.0-g; w[6][j2]=g; //G
++	for (int j=0;j<3;j++) w[7][j]=w[3][j]*(1.0-h1) + w[4][j]*h1; //H: we interpolate the intersection point H between D and E at fraction h1
+ 
+ 	for (int k=0;k<8;k++){
+ 		for (int i=0;i<NUMVERTICES;i++) {
+@@ -2087,128 +2119,176 @@
+ 
+ 		//point2 can be either i0,i1 or i2. We start the search with i1 and i2 as they have less computational cost in ifs
+ 		if(point2==i2){ /*{{{*/
+-			if (f12>1.0-f21){ /*{{{*/
++			if (e>1.0-f){ /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+-					tria1[0]=5; tria1[1]= 7; tria1[2]= 4;
++					tria1[0]=5; tria1[1]= 7; tria1[2]= 4; // FHE
++					area1=h2*(e+f-1.0)*g;
+ 				}
+ 				else if (!istrapeze1 && istrapeze2){
+-					tria1[0]=i0; tria1[1]= 3; tria1[2]= 7;
+-					tria2[0]=i0; tria2[1]= 7; tria2[2]= 5;
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 5; //ADF
++					area1=d*(1.0-f);
++					tria2[0]=3; tria2[1]= 7; tria2[2]= 5; //DHF
++					area2=d*h1*(e+f-1.0);
+ 				}
+ 				else if (istrapeze1 && !istrapeze2){
+-					tria1[0]=7; tria1[1]= 6; tria1[2]= 4;
+-					tria2[0]=4; tria2[1]= 6; tria2[2]= i2;
++					tria1[0]=7; tria1[1]= 6; tria1[2]= 4; //HGE
++					area1=g*(1.0-h2)*(e+f-1.0);
++					tria2[0]=4; tria2[1]= 6; tria2[2]= i2; //EGC
++					area2=g*(1.0-e);
+ 				}
+ 				else { //istrapeze1 && istrapeze2
+-					tria1[0]=3; tria1[1]= i1; tria1[2]= 7;
+-					tria2[0]=7; tria2[1]= i1; tria2[2]= 6;
++					tria1[0]=3; tria1[1]= i1; tria1[2]= 6; //DBG
++					area1=(1.0-d)*(1.0-g);
++					tria2[0]=3; tria2[1]= 6; tria2[2]= 7; //DGH
++					area2=g*((1.0-f)*(1.0-h2)+h2*e)+d*(1.0-e-g);
+ 				}  /*}}}*/
+ 			}
+-			else if (f12<=1.0-f21){ /*{{{*/
++			else if (e<=1.0-f){ /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+ 				}
+ 				else if (!istrapeze1 && istrapeze2){
+-					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4; //ADE
++					area1=d*e;
+ 				}
+ 				else if (istrapeze1 && !istrapeze2){
+-					tria1[0]=5; tria1[1]= 6; tria1[2]= i2;
++					tria1[0]=5; tria1[1]= 6; tria1[2]= i2; //FGC
++					area1=f*g;
+ 				}
+ 				else { //istrapeze1 && istrapeze2
+-					tria1[0]=3; tria1[1]= i1; tria1[2]= 4;
+-					tria2[0]=4; tria2[1]= i1; tria2[2]= 5;
+-					tria3[0]=5; tria3[1]= i1; tria3[2]= 6;
++					tria1[0]=3; tria1[1]= i1; tria1[2]= 5; //DBF
++			                area1=(1.0-d)*(1.0-f);
++					tria2[0]=4; tria2[1]= 3; tria2[2]= 5;  //EDF
++			                area2=d*(1.0-e-f);
++					tria3[0]=5; tria3[1]= i1; tria3[2]= 6; //FBG
++			                area3=f*(1.0-g);
+ 				} /*}}}*/
+ 			} 
+ 		}/*}}}*/    
+ 		else if(point2==i1){ /*{{{*/
+-			if (f11>1.0-f22){ /*{{{*/
++			if (d>1.0-g){ /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+-					tria1[0]=6; tria1[1]= 3; tria1[2]= 7;
++					tria1[0]=6; tria1[1]= 3; tria1[2]= 7; //GDH
++					area1=(1.0-h2)*(d+g-1.0)*f;
+ 				}
+ 				else if (!istrapeze1 && istrapeze2){
+-					tria1[0]=i0; tria1[1]= 6; tria1[2]= 7;
+-					tria2[0]=i0; tria2[1]= 7; tria2[2]= 4;
++					tria1[0]=i0; tria1[1]= 6; tria1[2]= 4; //AGE
++			                area1=(1.0-g)*e;
++					tria2[0]=6; tria2[1]= 7; tria2[2]= 4; //GHE
++			                area2=e*(1.0-h1)*(g+d-1.0);
+ 				}
+ 				else if (istrapeze1 && !istrapeze2){
+-					tria1[0]=3; tria1[1]= i1; tria1[2]= 7;
+-					tria2[0]=7; tria2[1]= i1; tria2[2]= 5;
++					tria1[0]=i1; tria1[1]= 5; tria1[2]= 3; //BFD
++			                area1=(1.0-d)*f;
++					tria2[0]=3; tria2[1]= 5; tria2[2]= 7; //DFH
++					area2=f*h2*(d+g-1.0);
+ 				}
+ 				else { //istrapeze1 && istrapeze2
+-					tria1[0]=7; tria1[1]= 5; tria1[2]= 4;
+-					tria2[0]=4; tria2[1]= 5; tria2[2]= i2;
++					tria1[0]=7; tria1[1]= 5; tria1[2]= 4; //HFE
++			                area1=e*((1.0-d)*(1.0-h1)+h1*g)+f*(1.0-g-e);
++					tria2[0]=4; tria2[1]= 5; tria2[2]= i2;//EFC
++			                area2=(1.0-e)*(1.0-f);
+ 				}  /*}}}*/
+ 			}
+-			else if (f11<=1.0-f22){ /*{{{*/
++			else if (d<=1.0-g){ /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+ 				}
+ 				else if (!istrapeze1 && istrapeze2){
+-					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4; //ADE
++			                area1=d*e;
+ 				}
+ 				else if (istrapeze1 && !istrapeze2){
+-					tria1[0]=6; tria1[1]= i1; tria1[2]= 5;
++					tria1[0]=6; tria1[1]= i1; tria1[2]= 5; //GBF
++			                area1=f*g;
+ 				}
+ 				else { //istrapeze1 && istrapeze2
+-					tria1[0]=3; tria1[1]= 6; tria1[2]= 4;
+-					tria2[0]=4; tria2[1]= 6; tria2[2]= 5;
+-					tria3[0]=4; tria3[1]= 5; tria3[2]= i2;
++					tria1[0]=3; tria1[1]= 6; tria1[2]= 4; //DGE
++					area1=e*(1.0-d-g);
++					tria2[0]=6; tria2[1]= i2; tria2[2]= 4; //GCE
++					area2=(1.0-g)*(1.0-e);
++					tria3[0]=6; tria3[1]= 5; tria3[2]= i2; //GFC
++					area3=g*(1.0-f);
+ 				} /*}}}*/
+ 			}
+ 			
+ 		}/*}}}*/
+ 		else{ /*{{{*/
+-			if (f11<=f21 && f12>=f22){  /*{{{*/
++			if (d<=f && e>=g){  /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+-					tria1[0]=i0; tria1[1]= 3; tria1[2]= 7;
+-					tria2[0]=i0; tria2[1]= 7; tria2[2]= 6;
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 7; //ADH
++			                area1=h1*d*e;
++					tria2[0]=i0; tria2[1]= 7; tria2[2]= 6; //AHG
++			                area2=(1.0-h2)*f*g;
+ 				}
+ 				else if (!istrapeze1 && istrapeze2){
+-					tria1[0]=6; tria1[1]= 7; tria1[2]= 4;
++					tria1[0]=6; tria1[1]= 7; tria1[2]= 4; //GHE
++			                area1=(e-g)*d*(1.0-h1);
+ 				}
+ 				else if (istrapeze1 && !istrapeze2){
+-					tria1[0]=3; tria1[1]= 5; tria1[2]= 7;
++					tria1[0]=3; tria1[1]= 5; tria1[2]= 7; //DFH
++					area1=(f-d)*g*h2;
+ 				}
+ 				else { //istrapeze1 && istrapeze2
+-					tria1[0]=7; tria1[1]= 5; tria1[2]= i1;
+-					tria2[0]=7; tria2[1]= i1; tria2[2]= 4;
+-					tria3[0]=4; tria3[1]= i1; tria3[2]= i2;
++					tria1[0]=5; tria1[1]= i1; tria1[2]= 7; //FBH
++			                area1=g*h2*(1.0-f);
++					tria2[0]=7; tria2[1]= i1; tria2[2]= i2;//HBC
++			                area2=1.0+d*(h1-e*h1-1.0)+g*h2*(d-1.0);
++					tria3[0]=7; tria3[1]= i2; tria3[2]= 4; //HCE
++			                area3=d*(1.0-h1)*(1.0-e);
+ 				} /*}}}*/
+ 			}
+-			else if (f11>=f21 && f12<=f22){ /*{{{*/
++			else if (d>=f && e<=g){ /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+-					tria1[0]=i0; tria1[1]= 5; tria1[2]= 7;
+-					tria2[0]=i0; tria2[1]= 4; tria2[2]= 7;
++					tria1[0]=i0; tria1[1]= 5; tria1[2]= 7; //AFH
++			                area1=h2*f*g;
++					tria2[0]=i0; tria2[1]= 7; tria2[2]= 4; //AHE
++			                area2=(1.0-h1)*d*e;
+ 				}else if (!istrapeze1 && istrapeze2){
+-					tria1[0]=5; tria1[1]= 3; tria1[2]= 7;
++					tria1[0]=5; tria1[1]= 3; tria1[2]= 7; //FDH
++			                area1=(d-f)*e*h1;
+ 				}else if (istrapeze1 && !istrapeze2){
+-					tria1[0]=4; tria1[1]= 7; tria1[2]= 6;
++					tria1[0]=4; tria1[1]= 7; tria1[2]= 6; //EHG
++			                area1=(g-e)*f*(1.0-h2);
+ 				}else { //istrapeze1 && istrapeze2
+-					tria1[0]=3; tria1[1]= i1; tria1[2]= 7;
+-					tria2[0]=7; tria2[1]= i1; tria2[2]= 6;
+-					tria3[0]=6; tria3[1]= i1; tria3[2]= i2;
++					tria1[0]=3; tria1[1]= i1; tria1[2]= 7; //DBH
++			                area1=e*h1*(1.0-d);
++					tria2[0]=7; tria2[1]= i1; tria2[2]= 6; //HCG
++			                area2=f*(1.0-h2)*(1.0-g);
++					tria3[0]=6; tria3[1]= i1; tria3[2]= i2; //HBC
++			                area3=1.0+f*(h2-g*h2-1.0)+e*h1*(f-1.0);
+ 				}  /*}}}*/
+ 			}
+-			else if (f11<=f21 && f12<=f22){ /*{{{*/
++			else if (d<=f && e<=g){ /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+-					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;
++					tria1[0]=i0; tria1[1]= 3; tria1[2]= 4;//ADE
++					area1=d*e;
+ 				}else if (!istrapeze1 && istrapeze2){
+ 				}else if (istrapeze1 && !istrapeze2){
+-					tria1[0]=3; tria1[1]= 5; tria1[2]= 4;
+-					tria2[0]=4; tria2[1]= 5; tria2[2]= 6;
++					tria1[0]=3; tria1[1]= 5; tria1[2]= 6; //DFG
++			                area1=g*(f-d);
++					tria2[0]=3; tria2[1]= 6; tria2[2]= 4; //DGE
++			                area2=d*(g-e);
+ 				}else { //istrapeze1 && istrapeze2
+-					tria1[0]=6; tria1[1]= 5; tria1[2]= i1;
+-					tria2[0]=6; tria2[1]= i1; tria2[2]= i2;
++					tria1[0]=5; tria1[1]= i2; tria1[2]= 6; //FCG
++			                area1=f*(1.0-g);
++					tria2[0]=5; tria2[1]= i1; tria2[2]= i2;//FBC
++			                area2=1.0-f;
+ 				}  /*}}}*/
+ 			}
+-			else if (f11>=f21 && f12>=f22){ /*{{{*/
++			else if (d>=f && e>=g){ /*{{{*/
+ 				if (!istrapeze1 && !istrapeze2){
+-					tria1[0]=i0; tria1[1]= 5; tria1[2]= 6;
++					tria1[0]=i0; tria1[1]= 5; tria1[2]= 6; //AFG
++			                area1=f*g;
+ 				}else if (!istrapeze1 && istrapeze2){
+-					tria1[0]=5; tria1[1]= 3; tria1[2]= 6;
+-					tria2[0]=6; tria2[1]= 3; tria2[2]= 4;
++					tria1[0]=5; tria1[1]= 4; tria1[2]= 6; //FEG
++			                area1=f*(e-g);
++					tria2[0]=5; tria2[1]= 3; tria2[2]= 4; //FDE
++			                area2=e*(d-f);
+ 				}else if (istrapeze1 && !istrapeze2){
+ 				}else { //istrapeze1 && istrapeze2
+-					tria1[0]=4; tria1[1]= 3; tria1[2]= i1;
+-					tria2[0]=i1; tria2[1]= i2; tria2[2]= 4;
++					tria1[0]=3; tria1[1]= i1; tria1[2]= i2; //DBC
++			                area1=1.0-d;
++					tria2[0]=3; tria2[1]= i2; tria2[2]= 4;//DCE
++			                area2=d*(1.0-e);
+ 				}  /*}}}*/
+ 			} 
+ 		} /*}}}*/
+@@ -2220,7 +2300,7 @@
+ 				w1[i][j]=w[tria1[i]][j];
+ 			}
+ 		}
+-		area1= GetTriangleAreaSpherical(xyz1);
++		area1*=area; //dimensionalize the fractional area from [0:1] to [0:area]
+ 	}
+ 	if(tria2[0]>-1){ 
+ 		for (int i=0;i<NUMVERTICES;i++){
+@@ -2229,7 +2309,7 @@
+ 				w2[i][j]=w[tria2[i]][j];
+ 			}
+ 		}
+-		area2= GetTriangleAreaSpherical(xyz2);
++		area2*=area;
+ 	}
+ 	if(tria3[0]>-1){ 
+ 		for (int i=0;i<NUMVERTICES;i++){
+@@ -2238,7 +2318,7 @@
+ 				w3[i][j]=w[tria3[i]][j];
+ 			}
+ 		}
+-		area3= GetTriangleAreaSpherical(xyz3);
++		area3*=area;
+ 	}
+ 
+ 	areasub=area1+area2+area3;
+@@ -6099,11 +6179,11 @@
+ 	IssmDouble x,y,z,dx,dy,dz,N_azim,E_azim;
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+-	/*stacks:*/
+-	IssmDouble* stackRSL = NULL;
+-	IssmDouble* stackU = NULL;
+-	IssmDouble* stackN = NULL;
+-	IssmDouble* stackE = NULL;
++	/*viscous stacks:*/
++	IssmDouble* viscousRSL = NULL;
++	IssmDouble* viscousU = NULL;
++	IssmDouble* viscousN = NULL;
++	IssmDouble* viscousE = NULL;
+ 
+ 	#ifdef _HAVE_RESTRICT_
+ 	IssmDouble* __restrict__ G=NULL;
+@@ -6111,7 +6191,7 @@
+ 	IssmDouble* __restrict__ GN=NULL;
+ 	IssmDouble* __restrict__ GE=NULL;
+ 	IssmDouble* __restrict__ G_viscoelastic_precomputed=NULL;
+-	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
++	IssmDouble* __restrict__ G_gravi_precomputed=NULL;
+ 	IssmDouble* __restrict__ U_viscoelastic_precomputed=NULL;
+ 	IssmDouble* __restrict__ H_viscoelastic_precomputed=NULL;
+ 	#else
+@@ -6120,7 +6200,7 @@
+ 	IssmDouble* GN=NULL;
+ 	IssmDouble* GE=NULL;
+ 	IssmDouble* G_viscoelastic_precomputed=NULL;
+-	IssmDouble* G_rigid_precomputed=NULL;
++	IssmDouble* G_gravi_precomputed=NULL;
+ 	IssmDouble* U_viscoelastic_precomputed=NULL;
+ 	IssmDouble* H_viscoelastic_precomputed=NULL;
+ 	#endif
+@@ -6127,10 +6207,11 @@
+ 	
+ 	/*viscoelastic green function:*/
+ 	int index;
+-	int         M;
++	int M;
++	IssmDouble doubleindex,lincoef;
+ 
+ 	/*Computational flags:*/
+-	bool computerigid = false;
++	bool computeselfattraction = false;
+ 	bool computeelastic = false;
+ 	bool computerotation = false;
+ 	bool computeviscous = false;
+@@ -6139,6 +6220,7 @@
+ 	IssmDouble timeacc=0.;
+ 	IssmDouble start_time,final_time;
+ 	int  nt,precomputednt;
++	int grd, grdmodel;
+ 
+ 	/*Rotational:*/
+ 	IssmDouble* tide_love_h  = NULL;
+@@ -6154,9 +6236,10 @@
+ 	IssmDouble LoveRotRSL,LoveRotU,LoveRothoriz;
+ 	IssmDouble polenudge;
+ 	/*}}}*/
++
+ 	/*Recover parameters:{{{ */
+ 	rho_earth=FindParam(MaterialsEarthDensityEnum);
+-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&computeselfattraction,SolidearthSettingsSelfAttractionEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&computerotation,SolidearthSettingsRotationEnum);
+ 	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
+@@ -6165,7 +6248,13 @@
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+ 	this->parameters->FindParam(&NewtonG,ConstantsNewtonGravityEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++	this->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
++	this->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 
++	/*early return:*/
++	if (!grd || grdmodel!=ElasticEnum) return; //Love numbers won't be found in this case, return before loading them
++	if(!computeselfattraction)return;
++
+ 	if(computerotation){
+ 		parameters->FindParam(&tide_love_h,NULL,NULL,TidalLoveHEnum);
+ 		parameters->FindParam(&tide_love_k,NULL,NULL,TidalLoveKEnum);
+@@ -6176,12 +6265,9 @@
+ 	}
+ 	/*}}}*/
+ 
+-	/*early return:*/
+-	if(!computerigid)return;
+-
+ 	/*Recover precomputed green function kernels:{{{*/
+-	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
+-	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
++	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGSelfAttractionEnum)); _assert_(parameter);
++	parameter->GetParameterValueByPointer((IssmDouble**)&G_gravi_precomputed,&M);
+ 
+ 	if(computeelastic){
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter);
+@@ -6214,7 +6300,7 @@
+ 		nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+ 	}
+ 	else{
+-		nt=1; //in elastic, or if we run only rigid, we need only one step
++		nt=1; //in elastic, or if we run only selfattraction, we need only one step
+ 	}
+ 
+ 
+@@ -6244,9 +6330,18 @@
+ 			/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+ 			delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+ 			alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
+-			index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
++			doubleindex=alpha/M_PI*reCast<IssmDouble,int>(M-1); //maps 0<alpha<PI on [0:M-1]
++			index=reCast<int,IssmDouble>(doubleindex); //truncates doubleindex to integer part
+ 			_assert_(index>=0 && index<M);
+ 
++
++			lincoef=doubleindex-index; //where between index and index+1 is alpha
++			if (index==M-1){ //avoids out of bound case
++				index-=1;
++				lincoef=1;
++			}
++			
++
+ 			if(horiz){
+ 				/*Compute azimuths, both north and east components: */
+ 				x = xyz_list[i][0]; y = xyz_list[i][1]; z = xyz_list[i][2];
+@@ -6265,20 +6360,25 @@
+ 				int timeindex=i*nel*nt+e*nt+t; 
+ 
+ 				/*Rigid earth gravitational perturbation: */
+-				G[timeindex]+=G_rigid_precomputed[index];
++				G[timeindex]+=G_gravi_precomputed[index+0]*(1.-lincoef) 
++					     +G_gravi_precomputed[index+1]*lincoef; //linear interpolation
+ 
+ 				/*Find a way to interpolate precomputed Gkernels to our solution time stepping:*/
+ 				if(computeelastic){
+-					G[timeindex]+=G_viscoelastic_precomputed[index*nt+t];
++					G[timeindex]+=G_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++						     +G_viscoelastic_precomputed[(index+1)*nt+t]*lincoef; //linear interpolation
+ 				}
+ 				G[timeindex]=G[timeindex]*ratioe;
+ 
+ 				/*Elastic components:*/
+ 				if(computeelastic){
+-					GU[timeindex] =  ratioe * U_viscoelastic_precomputed[index*nt+t];
++					GU[timeindex] =  ratioe *(U_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++								 +U_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+ 					if(horiz){
+-						GN[timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*N_azim;
+-						GE[timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*E_azim;
++						GN[timeindex] = N_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++								 	       +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
++						GE[timeindex] = E_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++								 	       +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+ 					}
+ 				}
+ 			} //for(int t=0;t<nt;t++)
+@@ -6375,19 +6475,19 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*Initialize stacks: {{{*/
++	/*Initialize viscous stacks: {{{*/
+ 	if(computeviscous){
+-		stackRSL=xNewZeroInit<IssmDouble>(3*nt);
+-		stackU=xNewZeroInit<IssmDouble>(3*nt);
++		viscousRSL=xNewZeroInit<IssmDouble>(3*nt);
++		viscousU=xNewZeroInit<IssmDouble>(3*nt);
+ 
+-		this->inputs->SetArrayInput(StackRSLEnum,this->lid,stackRSL,3*nt);
+-		this->inputs->SetArrayInput(StackUEnum,this->lid,stackU,3*nt);
+-		this->parameters->SetParam(0,StackIndexEnum);
++		this->inputs->SetArrayInput(SealevelchangeViscousRSLEnum,this->lid,viscousRSL,3*nt);
++		this->inputs->SetArrayInput(SealevelchangeViscousUEnum,this->lid,viscousU,3*nt);
++		this->parameters->SetParam(0,SealevelchangeViscousIndexEnum);
+ 		if(horiz){
+-			stackN=xNewZeroInit<IssmDouble>(3*nt);
+-			stackE=xNewZeroInit<IssmDouble>(3*nt);
+-			this->inputs->SetArrayInput(StackNEnum,this->lid,stackRSL,3*nt);
+-			this->inputs->SetArrayInput(StackEEnum,this->lid,stackU,3*nt);
++			viscousN=xNewZeroInit<IssmDouble>(3*nt);
++			viscousE=xNewZeroInit<IssmDouble>(3*nt);
++			this->inputs->SetArrayInput(SealevelchangeViscousNEnum,this->lid,viscousRSL,3*nt);
++			this->inputs->SetArrayInput(SealevelchangeViscousEEnum,this->lid,viscousU,3*nt);
+ 		}
+ 	}
+ 	/*}}}*/
+@@ -6471,7 +6571,7 @@
+ 	slgeom->longe[this->lid]=longe;
+ 	slgeom->late[this->lid]=late;
+ 
+-	/*compute fractional areas and load weights for ocean:*/
++	/*compute areas and load weights for ocean and flag elements only partially in the ocean:*/
+ 	if(isoceanonly){ 
+ 		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=area;
+ 		for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_OCEAN][i][this->lid]=1.0/3.0;
+@@ -6581,7 +6681,7 @@
+ 	
+ 	/*Deal with ice loads if we are on grounded ice:*/
+ 	if(isice && !isoceanonly && computeice){
+-		if(isiceonly){
++		if(isiceonly && !isocean){
+ 			slgeom->LoadArea[SLGEOM_ICE][this->lid]=area;
+ 			for(int i=0;i<NUMVERTICES;i++) slgeom->LoadWeigths[SLGEOM_ICE][i][this->lid]=1.0/3.0;
+ 
+@@ -6634,8 +6734,8 @@
+ 	IssmDouble loadareaocean;
+ 	IssmDouble loadweightsocean[3]; //to keep memory of these loads, no need to recompute for bottom pressure.
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble latbar=0;
+-	IssmDouble longbar=0;
++	IssmDouble latbar=slgeom->late[this->lid];
++	IssmDouble longbar=slgeom->longe[this->lid];
+ 	IssmDouble constant;
+ 	IssmDouble nanconstant=NAN;
+ 	
+@@ -6644,12 +6744,12 @@
+ 	area=areae[this->sid];
+ 
+ 	#ifdef _ISSM_DEBUG_
+-	this->AddInput(SealevelBarystaticIceLatbarEnum,&nanconstant,P0Enum); 
+-	this->AddInput(SealevelBarystaticIceLongbarEnum,&nanconstant,P0Enum); 
+-	this->AddInput(SealevelBarystaticHydroLatbarEnum,&nanconstant,P0Enum); 
+-	this->AddInput(SealevelBarystaticHydroLongbarEnum,&nanconstant,P0Enum); 
+-	this->AddInput(SealevelBarystaticOceanLatbarEnum,&nanconstant,P0Enum); 
+-	this->AddInput(SealevelBarystaticOceanLongbarEnum,&nanconstant,P0Enum); 
++	this->AddInput(SealevelBarystaticIceLatbarEnum,&latbar,P0Enum); 
++	this->AddInput(SealevelBarystaticIceLongbarEnum,&longbar,P0Enum); 
++	this->AddInput(SealevelBarystaticHydroLatbarEnum,&latbar,P0Enum); 
++	this->AddInput(SealevelBarystaticHydroLongbarEnum,&longbar,P0Enum); 
++	this->AddInput(SealevelBarystaticOceanLatbarEnum,&latbar,P0Enum); 
++	this->AddInput(SealevelBarystaticOceanLongbarEnum,&longbar,P0Enum); 
+ 	#endif
+ 	
+ 	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+@@ -6724,7 +6824,7 @@
+ 	
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeGeometryFractionKernel(SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*Declarations:{{{*/
+ 	int nel;
+@@ -6739,7 +6839,7 @@
+ 
+ 	#ifdef _HAVE_RESTRICT_
+ 	IssmDouble* __restrict__ G_viscoelastic_precomputed=NULL;
+-	IssmDouble* __restrict__ G_rigid_precomputed=NULL;
++	IssmDouble* __restrict__ G_gravi_precomputed=NULL;
+ 	IssmDouble* __restrict__ U_viscoelastic_precomputed=NULL;
+ 	IssmDouble* __restrict__ H_viscoelastic_precomputed=NULL;
+ 	IssmDouble** __restrict__ Gsubel=NULL;
+@@ -6749,7 +6849,7 @@
+ 
+ 	#else
+ 	IssmDouble* G_viscoelastic_precomputed=NULL;
+-	IssmDouble* G_rigid_precomputed=NULL;
++	IssmDouble* G_gravi_precomputed=NULL;
+ 	IssmDouble* U_viscoelastic_precomputed=NULL;
+ 	IssmDouble* H_viscoelastic_precomputed=NULL;
+ 	IssmDouble** Gsubel=NULL;
+@@ -6758,15 +6858,17 @@
+ 	IssmDouble** GEsubel=NULL;
+ 	#endif
+ 	
+-	/*elastic green function:*/
++	/*viscoelastic green function:*/
+ 	int index;
+-	int         M;
++	int M;
++	IssmDouble doubleindex,lincoef;
+ 
+ 	/*Computational flags:*/
+-	bool computerigid = false;
++	bool computeselfattraction = false;
+ 	bool computeelastic = false;
+ 	bool computeviscous = false;
+ 	int  horiz;
++	int grd, grdmodel;
+ 
+ 	bool istime=true;
+ 	IssmDouble timeacc=0;
+@@ -6776,7 +6878,7 @@
+ 	/*}}}*/
+ 	/*Recover parameters:{{{ */
+ 	rho_earth=FindParam(MaterialsEarthDensityEnum);
+-	this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&computeselfattraction,SolidearthSettingsSelfAttractionEnum);
+ 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+@@ -6783,14 +6885,17 @@
+ 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
++	this->parameters->FindParam(&grd,SolidearthSettingsGRDEnum); 
++	this->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 	/*}}}*/
+ 
+ 	/*early return:*/
+-	if(!computerigid)return;
++	if (!grd || grdmodel!=ElasticEnum) return; //Love numbers won't be found in this case, return before loading them
++	if(!computeselfattraction)return;
+ 
+ 	/*Recover precomputed green function kernels:{{{*/
+-	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGRigidEnum)); _assert_(parameter);
+-	parameter->GetParameterValueByPointer((IssmDouble**)&G_rigid_precomputed,&M);
++	DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGSelfAttractionEnum)); _assert_(parameter);
++	parameter->GetParameterValueByPointer((IssmDouble**)&G_gravi_precomputed,&M);
+ 
+ 	if(computeelastic){
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter);
+@@ -6825,7 +6930,7 @@
+ 		nt=reCast<int,IssmDouble>((final_time-start_time)/timeacc)+1;
+ 	}
+ 	else{
+-		nt=1; //in elastic, or if we run only rigid, we need only one step
++		nt=1; //in elastic, or if we run only selfattraction, we need only one step
+ 	}
+ 	Gsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+ 	if(computeelastic){
+@@ -6883,27 +6988,37 @@
+ 				/*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
+ 				delPhi=fabs(lati-late); delLambda=fabs(longi-longe); if (delLambda>M_PI)delLambda=2*M_PI-delLambda;
+ 				alpha=2.*asin(sqrt(pow(sin(delPhi/2.0),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2.0),2.0)));
+-				index=reCast<int,IssmDouble>( alpha/M_PI*reCast<IssmDouble,int>(M-1) );
++				doubleindex=alpha/M_PI*reCast<IssmDouble,int>(M-1); //maps 0<alpha<PI on [0:M-1]
++				index=reCast<int,IssmDouble>(doubleindex); //truncates doubleindex to integer part
+ 
++				lincoef=doubleindex-index; //where between index and index+1 is alpha
++				if (index==M-1){ //avoids out of bound case
++					index-=1;
++					lincoef=1;
++				}
+ 
+ 				for(int t=0;t<nt;t++){
+ 					int timeindex=i*nbar*nt+e*nt+t; 
+ 
+ 					/*Rigid earth gravitational perturbation: */
+-					Gsubel[l][timeindex]+=G_rigid_precomputed[index];
++					Gsubel[l][timeindex]+=G_gravi_precomputed[index+0]*(1.-lincoef) 
++					    		     +G_gravi_precomputed[index+1]*lincoef; //linear interpolation
+ 
+ 					if(computeelastic){
+-						Gsubel[l][timeindex]+=G_viscoelastic_precomputed[index*nt+t];
++						Gsubel[l][timeindex]+=G_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++								     +G_viscoelastic_precomputed[(index+1)*nt+t]*lincoef; //linear interpolation
+ 					}
+ 					Gsubel[l][timeindex]*=ratioe;
+ 
+ 					/*Elastic components:*/
+ 					if(computeelastic){
+-						GUsubel[l][timeindex] =  ratioe * U_viscoelastic_precomputed[index*nt+t];
+-
++						GUsubel[l][timeindex] =  ratioe *(U_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++										 +U_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+ 						if(horiz){
+-							GNsubel[l][timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*N_azim;
+-							GEsubel[l][timeindex] = ratioe*H_viscoelastic_precomputed[index*nt+t]*E_azim;
++							GNsubel[l][timeindex] = N_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++								 			      +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
++							GEsubel[l][timeindex] = E_azim*ratioe *(H_viscoelastic_precomputed[(index+0)*nt+t]*(1.-lincoef)
++								 			      +H_viscoelastic_precomputed[(index+1)*nt+t]*lincoef);
+ 						}
+ 					}
+ 				}
+@@ -6950,13 +7065,13 @@
+ void       Tria::SealevelchangeUpdateViscousFields(){ /*{{{*/
+ 	
+ 	/*Inputs:*/
+-	IssmDouble* stackRSL=NULL;
+-	IssmDouble* stackU=NULL;
+-	IssmDouble* stackN=NULL;
+-	IssmDouble* stackE=NULL;
+-	IssmDouble* stacktimes=NULL;
+-	int         stacknumsteps;
+-	int         stackindex=0; 
++	IssmDouble* viscousRSL=NULL;
++	IssmDouble* viscousU=NULL;
++	IssmDouble* viscousN=NULL;
++	IssmDouble* viscousE=NULL;
++	IssmDouble* viscoustimes=NULL;
++	int         viscousnumsteps;
++	int         viscousindex=0; 
+ 	int         newindex=0; 
+ 	int         dummy;
+ 	bool        viscous=false;
+@@ -6969,16 +7084,16 @@
+ 	if(viscous){
+ 		this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 		
+-		this->parameters->FindParam(&stacknumsteps,StackNumStepsEnum);
+-		this->parameters->FindParam(&stacktimes,NULL,StackTimesEnum);
+-		this->parameters->FindParam(&stackindex,StackIndexEnum);
++		this->parameters->FindParam(&viscousnumsteps,SealevelchangeViscousNumStepsEnum);
++		this->parameters->FindParam(&viscoustimes,NULL,SealevelchangeViscousTimesEnum);
++		this->parameters->FindParam(&viscousindex,SealevelchangeViscousIndexEnum);
+ 		this->parameters->FindParam(&currenttime,TimeEnum);
+ 
+-		this->inputs->GetArrayPtr(StackRSLEnum,this->lid,&stackRSL,&dummy);
+-		this->inputs->GetArrayPtr(StackUEnum,this->lid,&stackU,&dummy);
++		this->inputs->GetArrayPtr(SealevelchangeViscousRSLEnum,this->lid,&viscousRSL,&dummy);
++		this->inputs->GetArrayPtr(SealevelchangeViscousUEnum,this->lid,&viscousU,&dummy);
+ 		if(horiz){
+-			this->inputs->GetArrayPtr(StackNEnum,this->lid,&stackN,&dummy);
+-			this->inputs->GetArrayPtr(StackEEnum,this->lid,&stackE,&dummy);
++			this->inputs->GetArrayPtr(SealevelchangeViscousNEnum,this->lid,&viscousN,&dummy);
++			this->inputs->GetArrayPtr(SealevelchangeViscousEEnum,this->lid,&viscousE,&dummy);
+ 		}
+ 
+ 
+@@ -6985,12 +7100,12 @@
+ 		bool foundtime=false;
+ 		int offset=1;
+ 		lincoeff=0;
+-		newindex=stacknumsteps-2;
++		newindex=viscousnumsteps-2;
+ 
+-		for(int t=stackindex;t<stacknumsteps;t++){
+-			if (stacktimes[t]>currenttime){
++		for(int t=viscousindex;t<viscousnumsteps;t++){
++			if (viscoustimes[t]>currenttime){
+ 				newindex=t-1;
+-				lincoeff=(currenttime-stacktimes[newindex])/(stacktimes[t]-stacktimes[newindex]);
++				lincoeff=(currenttime-viscoustimes[newindex])/(viscoustimes[t]-viscoustimes[newindex]);
+ 				foundtime=true;
+ 				offset=0;
+ 				break;
+@@ -6998,23 +7113,23 @@
+ 		}
+ 
+ 		if(!foundtime) lincoeff=1;
+-		stacktimes[newindex]=currenttime;
++		viscoustimes[newindex]=currenttime;
+ 		for(int i=0;i<NUMVERTICES;i++){
+-			stackRSL[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackRSL[i*stacknumsteps+newindex]+lincoeff*stackRSL[i*stacknumsteps+newindex+1];
+-			stackU[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackU[i*stacknumsteps+newindex]+lincoeff*stackU[i*stacknumsteps+newindex+1];
++			viscousRSL[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousRSL[i*viscousnumsteps+newindex]+lincoeff*viscousRSL[i*viscousnumsteps+newindex+1];
++			viscousU[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousU[i*viscousnumsteps+newindex]+lincoeff*viscousU[i*viscousnumsteps+newindex+1];
+ 			if(horiz){
+-				stackN[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackN[i*stacknumsteps+newindex]+lincoeff*stackN[i*stacknumsteps+newindex+1];
+-				stackE[i*stacknumsteps+newindex+offset]=(1-lincoeff)*stackE[i*stacknumsteps+newindex]+lincoeff*stackE[i*stacknumsteps+newindex+1];
++				viscousN[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousN[i*viscousnumsteps+newindex]+lincoeff*viscousN[i*viscousnumsteps+newindex+1];
++				viscousE[i*viscousnumsteps+newindex+offset]=(1-lincoeff)*viscousE[i*viscousnumsteps+newindex]+lincoeff*viscousE[i*viscousnumsteps+newindex+1];
+ 			}
+ 		}
+-		stackindex=newindex+offset;
++		viscousindex=newindex+offset;
+ 
+ 		
+-		this->parameters->SetParam(stackindex,StackIndexEnum);
+-		this->parameters->SetParam(stacktimes,stacknumsteps,StackTimesEnum);
++		this->parameters->SetParam(viscousindex,SealevelchangeViscousIndexEnum);
++		this->parameters->SetParam(viscoustimes,viscousnumsteps,SealevelchangeViscousTimesEnum);
+ 
+ 		/*free allocations:*/
+-		xDelete<IssmDouble>(stacktimes);
++		xDelete<IssmDouble>(viscoustimes);
+ 	}
+ 
+ 
+@@ -7098,15 +7213,11 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* polarmotionvector,SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*sal green function:*/
+ 	IssmDouble* G=NULL;
+ 	IssmDouble* Gsub[SLGEOM_NUMLOADS];
+-	IssmDouble SealevelGRD[NUMVERTICES]={0};
+-	IssmDouble oceanaverage=0;
+-	IssmDouble oceanarea=0;
+-	IssmDouble rho_water;
+ 	bool computefuture=false;
+ 	
+ 	bool sal = false;
+@@ -7119,11 +7230,10 @@
+ 	IssmDouble Grotm2[3];
+ 	IssmDouble Grotm3[3];
+ 		
+-	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&sal,SolidearthSettingsSelfAttractionEnum);
+ 	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+ 	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+-	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+ 
+ 	if(sal){
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+@@ -7131,7 +7241,7 @@
+ 		this->inputs->GetArrayPtr(SealevelchangeGsubelHydroEnum,this->lid,&Gsub[SLGEOM_WATER],&size);
+ 		this->inputs->GetArrayPtr(SealevelchangeGsubelOceanEnum,this->lid,&Gsub[SLGEOM_OCEAN],&size);
+ 
+-		this->SealevelchangeGxL(sealevelpercpu, G, Gsub, loads, slgeom, nel,percpu=true,StackRSLEnum,computefuture=false);
++		this->SealevelchangeGxL(sealevelpercpu, G, Gsub, loads, slgeom, nel,percpu=true,SealevelchangeViscousRSLEnum,computefuture=false);
+ 	}
+ 
+ 	if(rotation){
+@@ -7141,7 +7251,7 @@
+ 		
+ 		for(int i=0;i<NUMVERTICES;i++){
+ 			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+-				sealevelpercpu[this->vertices[i]->lid]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++				sealevelpercpu[this->vertices[i]->lid]+=Grotm1[i]*polarmotionvector[0]+Grotm2[i]*polarmotionvector[1]+Grotm3[i]*polarmotionvector[2];
+ 			}
+ 		}
+ 	}
+@@ -7150,8 +7260,6 @@
+ void       Tria::SealevelchangeOceanAverage(GrdLoads* loads, Vector<IssmDouble>* oceanareas, Vector<IssmDouble>* subelementoceanareas, IssmDouble* sealevelpercpu, SealevelGeometry* slgeom){ /*{{{*/
+ 
+ 	/*sal green function:*/
+-	IssmDouble* G=NULL;
+-	IssmDouble* Gsub[SLGEOM_NUMLOADS];
+ 	IssmDouble oceanaverage=0;
+ 	IssmDouble oceanarea=0;
+ 	IssmDouble rho_water;
+@@ -7187,13 +7295,13 @@
+ 	
+ 	return;
+ } /*}}}*/
+-void       Tria::SealevelchangeDeformationConvolution(GrdLoads* loads, IssmDouble* rotationvector,SealevelGeometry* slgeom){ /*{{{*/
++void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* polarmotionvector,SealevelGeometry* slgeom){ /*{{{*/
+ 
+-	IssmDouble Sealevel[3]={0,0,0};
+-	IssmDouble SealevelRSL[3]={0,0,0};
+-	IssmDouble SealevelU[3]={0,0,0};
+-	IssmDouble SealevelN[3]={0,0,0};
+-	IssmDouble SealevelE[3]={0,0,0};
++	IssmDouble SealevelGrd[3]={0,0,0};
++	IssmDouble RSLGrd[3]={0,0,0};
++	IssmDouble UGrd[3]={0,0,0};
++	IssmDouble NGrd[3]={0,0,0};
++	IssmDouble EGrd[3]={0,0,0};
+ 	int nel,nbar;
+ 	bool sal = false;
+ 	IssmDouble* G=NULL;
+@@ -7223,13 +7331,14 @@
+ 	bool rotation= false;
+ 	bool elastic=false;
+ 	bool percpu=false;
++	bool planethasocean=false;
+ 
+ 	this->parameters->FindParam(&nel,MeshNumberofelementsEnum);
+-	this->parameters->FindParam(&sal,SolidearthSettingsRigidEnum);
++	this->parameters->FindParam(&sal,SolidearthSettingsSelfAttractionEnum);
+ 	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+ 	this->parameters->FindParam(&elastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-
++	this->parameters->FindParam(&planethasocean,SolidearthSettingsGrdOceanEnum);
+ 	
+ 		
+ 	if(sal){
+@@ -7256,13 +7365,13 @@
+ 				this->inputs->GetArrayPtr(SealevelchangeGEsubelOceanEnum,this->lid,&GEsub[SLGEOM_OCEAN],&size);
+ 			}
+ 		}
+-		this->SealevelchangeGxL(&SealevelRSL[0],G, Gsub, loads, slgeom, nel,percpu=false,StackRSLEnum,computefuture=true);
++		this->SealevelchangeGxL(&RSLGrd[0],G, Gsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousRSLEnum,computefuture=true);
+ 
+ 		if(elastic){
+-			this->SealevelchangeGxL(&SealevelU[0],GU, GUsub, loads, slgeom, nel,percpu=false,StackUEnum,computefuture=true);
++			this->SealevelchangeGxL(&UGrd[0],GU, GUsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousUEnum,computefuture=true);
+ 			if(horiz ){
+-				this->SealevelchangeGxL(&SealevelN[0],GN, GNsub, loads, slgeom, nel,percpu=false,StackNEnum,computefuture=true);
+-				this->SealevelchangeGxL(&SealevelE[0],GE, GEsub, loads, slgeom, nel,percpu=false,StackEEnum,computefuture=true);
++				this->SealevelchangeGxL(&NGrd[0],GN, GNsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousNEnum,computefuture=true);
++				this->SealevelchangeGxL(&EGrd[0],GE, GEsub, loads, slgeom, nel,percpu=false,SealevelchangeViscousEEnum,computefuture=true);
+ 			}
+ 		}
+ 	}
+@@ -7274,7 +7383,7 @@
+ 		
+ 		for(int i=0;i<NUMVERTICES;i++){
+ 			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+-				SealevelRSL[i]+=Grotm1[i]*rotationvector[0]+Grotm2[i]*rotationvector[1]+Grotm3[i]*rotationvector[2];
++				RSLGrd[i]+=Grotm1[i]*polarmotionvector[0]+Grotm2[i]*polarmotionvector[1]+Grotm3[i]*polarmotionvector[2];
+ 			}
+ 		}
+ 
+@@ -7285,7 +7394,7 @@
+ 		
+ 			for(int i=0;i<NUMVERTICES;i++){
+ 				if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+-					SealevelU[i]+=GUrotm1[i]*rotationvector[0]+GUrotm2[i]*rotationvector[1]+GUrotm3[i]*rotationvector[2];
++					UGrd[i]+=GUrotm1[i]*polarmotionvector[0]+GUrotm2[i]*polarmotionvector[1]+GUrotm3[i]*polarmotionvector[2];
+ 				}
+ 			}
+ 			if (horiz){
+@@ -7298,8 +7407,8 @@
+ 		
+ 				for(int i=0;i<NUMVERTICES;i++){
+ 					if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+-						SealevelN[i]+=GNrotm1[i]*rotationvector[0]+GNrotm2[i]*rotationvector[1]+GNrotm3[i]*rotationvector[2];
+-						SealevelE[i]+=GErotm1[i]*rotationvector[0]+GErotm2[i]*rotationvector[1]+GErotm3[i]*rotationvector[2];
++						NGrd[i]+=GNrotm1[i]*polarmotionvector[0]+GNrotm2[i]*polarmotionvector[1]+GNrotm3[i]*polarmotionvector[2];
++						EGrd[i]+=GErotm1[i]*polarmotionvector[0]+GErotm2[i]*polarmotionvector[1]+GErotm3[i]*polarmotionvector[2];
+ 					}
+ 				}
+ 			}
+@@ -7306,39 +7415,47 @@
+ 		}
+ 	}
+ 
++	if (planethasocean){ //We must also output the RSL on vertices to compute the ocean mass conservation
++		for(int i=0;i<NUMVERTICES;i++){
++			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
++				sealevelpercpu[this->vertices[i]->lid]=RSLGrd[i];
++			}
++		}
++	}
++
+ 	/*Create geoid: */
+-	for(int i=0;i<NUMVERTICES;i++)Sealevel[i]=SealevelU[i]+SealevelRSL[i];
++	for(int i=0;i<NUMVERTICES;i++)SealevelGrd[i]=UGrd[i]+RSLGrd[i];
+ 	
+ 	/*Create inputs*/
+-	this->AddInput(SealevelGRDEnum,Sealevel,P1Enum);
+-	this->AddInput(BedGRDEnum,SealevelU,P1Enum);
++	this->AddInput(SealevelGRDEnum,SealevelGrd,P1Enum);
++	this->AddInput(BedGRDEnum,UGrd,P1Enum);
+ 	if(horiz){
+-		this->AddInput(BedNorthGRDEnum,SealevelN,P1Enum);
+-		this->AddInput(BedEastGRDEnum,SealevelE,P1Enum);
++		this->AddInput(BedNorthGRDEnum,NGrd,P1Enum);
++		this->AddInput(BedEastGRDEnum,EGrd,P1Enum);
+ 	}
+ 
+ 
+ } /*}}}*/
+-void       Tria::SealevelchangeGxL(IssmDouble* sealevelout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu, int stackenum, bool computefuture) { /*{{{*/
++void       Tria::SealevelchangeGxL(IssmDouble* grdfieldout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu, int viscousenum, bool computefuture) { /*{{{*/
+ 
+-	IssmDouble* sealevel=NULL;
++	IssmDouble* grdfield=NULL;
+ 	int i,e,l,t,nbar;
+-	bool viscous=false;
+-	IssmDouble* stack=NULL;
++	bool computeviscous=false;
++	IssmDouble* viscousfield=NULL;
+ 	int nt=1; //important
+-	int stackindex=0; //important
+-	int stacknumsteps=1; //important
++	int viscousindex=0; //important
++	int viscousnumsteps=1; //important
+ 
+-	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+-	if(viscous){
+-		this->parameters->FindParam(&stacknumsteps,StackNumStepsEnum);
+-		if(computefuture) nt=stacknumsteps;
++	this->parameters->FindParam(&computeviscous,SolidearthSettingsViscousEnum);
++	if(computeviscous){
++		this->parameters->FindParam(&viscousnumsteps,SealevelchangeViscousNumStepsEnum);
++		if(computefuture) nt=viscousnumsteps;
+ 		else nt=1;
+ 
+ 		//allocate
+-		sealevel=xNewZeroInit<IssmDouble>(3*nt);
++		grdfield=xNewZeroInit<IssmDouble>(3*nt);
+ 	}
+-	else sealevel=xNewZeroInit<IssmDouble>(3*nt);
++	else grdfield=xNewZeroInit<IssmDouble>(3*nt);
+ 
+ 	if(loads->sealevelloads){
+ 
+@@ -7346,8 +7463,8 @@
+ 			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 			for (e=0;e<nel;e++){
+ 				for(t=0;t<nt;t++){
+-					int index=i*nel*stacknumsteps+e*stacknumsteps+t;
+-					sealevel[i*nt+t]+=G[index]*(loads->sealevelloads[e]+loads->loads[e]);
++					int index=i*nel*viscousnumsteps+e*viscousnumsteps+t;
++					grdfield[i*nt+t]+=G[index]*(loads->sealevelloads[e]+loads->loads[e]);
+ 				}
+ 			}
+ 			for(l=0;l<SLGEOM_NUMLOADS;l++){
+@@ -7354,15 +7471,15 @@
+ 				nbar=slgeom->nbar[l];
+ 				for (e=0;e<nbar;e++){
+ 					for(t=0;t<nt;t++){
+-						int index=i*nbar*stacknumsteps+e*stacknumsteps+t;
+-						sealevel[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
++						int index=i*nbar*viscousnumsteps+e*viscousnumsteps+t;
++						grdfield[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
+ 					}
+ 				}
+ 				if(l==SLGEOM_OCEAN){
+ 					for (e=0;e<nbar;e++){
+ 						for(t=0;t<nt;t++){
+-							int index=i*nbar*stacknumsteps+e*stacknumsteps+t;
+-							sealevel[i*nt+t]+=Gsub[l][index]*(loads->subsealevelloads[e]);
++							int index=i*nbar*viscousnumsteps+e*viscousnumsteps+t;
++							grdfield[i*nt+t]+=Gsub[l][index]*(loads->subsealevelloads[e]);
+ 						}
+ 					}
+ 				}
+@@ -7375,8 +7492,8 @@
+ 			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+ 			for (e=0;e<nel;e++){
+ 				for(t=0;t<nt;t++){
+-					int index=i*nel*stacknumsteps+e*stacknumsteps+t;
+-					sealevel[i*nt+t]+=G[index]*(loads->loads[e]);
++					int index=i*nel*viscousnumsteps+e*viscousnumsteps+t;
++					grdfield[i*nt+t]+=G[index]*(loads->loads[e]);
+ 				}
+ 			}
+ 			for(l=0;l<SLGEOM_NUMLOADS;l++){
+@@ -7383,8 +7500,8 @@
+ 				nbar=slgeom->nbar[l];
+ 				for (e=0;e<nbar;e++){
+ 					for(t=0;t<nt;t++){
+-						int index=i*nbar*stacknumsteps+e*stacknumsteps+t;
+-						sealevel[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
++						int index=i*nbar*viscousnumsteps+e*viscousnumsteps+t;
++						grdfield[i*nt+t]+=Gsub[l][index]*(loads->subloads[l][e]);
+ 					}
+ 				}
+ 			}
+@@ -7391,33 +7508,33 @@
+ 		}
+ 	}
+ 	
+-	if(viscous){
+-		IssmDouble* sealevelinterp=NULL;
+-		IssmDouble* stacktimes=NULL;
++	if(computeviscous){
++		IssmDouble* grdfieldinterp=NULL;
++		IssmDouble* viscoustimes=NULL;
+ 		IssmDouble  final_time;
+ 		IssmDouble  lincoeff;
+ 		IssmDouble  timeacc;
+ 
+-		this->parameters->FindParam(&stackindex,StackIndexEnum);
+-		this->parameters->FindParam(&stacktimes,NULL,StackTimesEnum);
++		this->parameters->FindParam(&viscousindex,SealevelchangeViscousIndexEnum);
++		this->parameters->FindParam(&viscoustimes,NULL,SealevelchangeViscousTimesEnum);
+ 		this->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
+ 		this->parameters->FindParam(&timeacc,SolidearthSettingsTimeAccEnum);
+-		this->inputs->GetArrayPtr(stackenum,this->lid,&stack,NULL);
++		this->inputs->GetArrayPtr(viscousenum,this->lid,&viscousfield,NULL);
+ 		if(computefuture){
+-			sealevelinterp=xNew<IssmDouble>(3*nt); 
+-			if(stacktimes[stackindex]<final_time){
+-				lincoeff=(stacktimes[stackindex+1]-stacktimes[stackindex])/timeacc;
+-				for(int t=stackindex;t<nt;t++){
+-					if(t==stackindex){
++			grdfieldinterp=xNew<IssmDouble>(3*nt); 
++			if(viscoustimes[viscousindex]<final_time){
++				lincoeff=(viscoustimes[viscousindex+1]-viscoustimes[viscousindex])/timeacc;
++				for(int t=viscousindex;t<nt;t++){
++					if(t==viscousindex){
+ 						for(int i=0;i<NUMVERTICES;i++){
+ 							if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+-							sealevelinterp[i*nt+t]=  sealevel[i*nt+0];
++							grdfieldinterp[i*nt+t]=  grdfield[i*nt+0];
+ 						}
+ 					}
+ 					else{
+ 						for(int i=0;i<NUMVERTICES;i++){
+ 							if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+-							sealevelinterp[i*nt+t]=  (1-lincoeff)*sealevel[i*nt+(t-stackindex-1)]+lincoeff*sealevel[i*nt+(t-stackindex)];
++							grdfieldinterp[i*nt+t]=  (1-lincoeff)*grdfield[i*nt+(t-viscousindex-1)]+lincoeff*grdfield[i*nt+(t-viscousindex)];
+ 						}
+ 					}
+ 				}
+@@ -7424,26 +7541,27 @@
+ 			}
+ 		}
+ 
+-		/*update sealevel at present time using stack at present time: */
++		/*update grdfield at present time using viscous stack at present time: */
+ 		for(int i=0;i<NUMVERTICES;i++){
+ 			if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+-			sealevel[i*nt+0]+=stack[i*stacknumsteps+stackindex]; 
++			grdfield[i*nt+0]+=viscousfield[i*viscousnumsteps+viscousindex]; 
+ 		}
+ 
+-		if(computefuture){ /*update stack with future deformation from present load: */
++		if(computefuture){ /*update viscous stack with future deformation from present load: */
+ 
+-			for(int t=nt-1;t>=stackindex;t--){
++			for(int t=nt-1;t>=viscousindex;t--){
+ 				for(int i=0;i<NUMVERTICES;i++){
+ 					if(slgeom->lids[this->vertices[i]->lid]!=this->lid)continue;
+-					stack[i*stacknumsteps+t]+=sealevelinterp[i*nt+t]-sealevelinterp[i*nt+stackindex]-stack[i*stacknumsteps+stackindex];
++					//offset viscousfield to remove all deformation that has already been added
++					viscousfield[i*viscousnumsteps+t]+=grdfieldinterp[i*nt+t]-grdfieldinterp[i*nt+viscousindex]-viscousfield[i*viscousnumsteps+viscousindex];
+ 				}
+ 			}
+-			/*Re-add stack now that we updated:*/
+-			this->inputs->SetArrayInput(stackenum,this->lid,stack,3*stacknumsteps);
++			/*Re-add viscous stack now that we updated:*/
++			this->inputs->SetArrayInput(viscousenum,this->lid,viscousfield,3*viscousnumsteps);
+ 		}
+ 
+ 		/*Free allocatoins:*/
+-		xDelete<IssmDouble>(stacktimes);
++		xDelete<IssmDouble>(viscoustimes);
+ 	}
+ 
+ 	/*store values computed on vertices, but don't repeat the computation if another element already computed it!:*/
+@@ -7450,12 +7568,12 @@
+ 	if(percpu){
+ 		for(i=0;i<NUMVERTICES;i++){
+ 			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+-				sealevelout[this->vertices[i]->lid]=sealevel[i*nt+0];
++				grdfieldout[this->vertices[i]->lid]=grdfield[i*nt+0];
+ 			}
+ 		}
+ 	}
+ 	else{
+-		for(i=0;i<NUMVERTICES;i++) sealevelout[i]=sealevel[i*nt+0];
++		for(i=0;i<NUMVERTICES;i++) grdfieldout[i]=grdfield[i*nt+0];
+ 	}
+ 
+ 
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26295)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26296)
+@@ -8,22 +8,44 @@
+ 		reltol                 = 0;
+ 		abstol                 = 0;
+ 		maxiter                = 0;
+-		rigid                  = 0;
+-		elastic                = 0;
+-		viscous                = 0;
+-		rotation               = 0;
++		selfattraction         = 1;
++		elastic                = 1;
++		viscous                = 1;
++		rotation               = 1;
++		grdocean	       = 1;
+ 		ocean_area_scaling     = 0;
+ 		runfrequency           = 1; %how many time steps we skip before we run grd_core
+-		computesealevelchange  = 1; %will sea-level be coputed? 
++		sealevelloading        = 1; %will sea-level loads be computed? 
+ 		isgrd                  = 0; %will GRD patterns be computed? 
+ 		compute_bp_grd         = 0; %will GRD patterns for bottom pressures be computed? 
+ 		degacc                 = 0; %degree increment for resolution of Green tables.
+ 		timeacc                = 0; %time step accurary required to compute Green tables
+ 		horiz                  = 0; %compute horizontal deformation
+-		grdmodel               = 0; %grd model (0 by default, 1 for elastic, 2 for Ivins)
++		grdmodel               = 0; %grd model (0 by default, 1 for (visco)-elastic, 2 for Ivins)
+ 		cross_section_shape    = 0; %cross section only used when grd model is Ivins
+ 	end
++	methods (Static)
++		function self = loadobj(self) % {{{
++			% This function is directly called by matlab when a model object is
++			% loaded. If the input is a struct it is an old version of this class and
++			% old fields must be recovered (make sure they are in the deprecated
++			% model properties)
++
++			if isstruct(self)
++				% 2021, Jun 4
++				if isfield(self,'rigid')
++					self.selfattraction = self.rigid;
++				end
++				if isfield(self,'computesealevelchange')
++					self.sealevelloading = self.computesealevelchange;
++				end
++				self = structtoobj(solidearthsettings(),self);
++
++			end
++		end% }}}
++	end
+ 	methods
++
+ 		function self = solidearthsettings(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -42,14 +64,15 @@
+ 		self.maxiter=5;
+ 
+ 		%computational flags: 
+-		self.rigid=1;
++		self.selfattraction=1;
+ 		self.elastic=1;
+ 		self.viscous=1;
+ 		self.rotation=1;
++		self.grdocean=1;
+ 		self.ocean_area_scaling=0;
+ 		self.compute_bp_grd=0;
+ 		self.isgrd=0;
+-		self.computesealevelchange=1;
++		self.sealevelloading=1;
+ 
+ 		%numerical discretization accuracy
+ 		self.degacc=.01;
+@@ -82,10 +105,8 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','>=',0,'<=',2);
+ 			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
+-
+-			%checks on computational flags
+-			if self.elastic==1 & self.rigid==0,
+-				error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
++			if self.elastic==1 & self.selfattraction==0,
++				error('solidearthsettings checkconsistency error message: need selfattraction on if elastic flag is set');
+ 			end
+ 			if self.viscous==1 & self.elastic==0,
+ 				error('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set');
+@@ -102,6 +123,9 @@
+ 						error('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)');
+ 					end
+ 				end
++				if self.sealevelloading==1 & self.grdocean==0
++					error('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set');
++				end
+ 			end
+ 
+ 			if self.compute_bp_grd==1 & md.solidearth.settings.isgrd==0,
+@@ -115,18 +139,19 @@
+ 			fielddisplay(self,'reltol','sea level change relative convergence criterion, (default, NaN: not applied)');
+ 			fielddisplay(self,'abstol','sea level change absolute convergence criterion, NaN: not applied');
+ 			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
++			fielddisplay(self,'grdocean','does this planet have an ocean, if set to 1: global water mass is conserved in GRD module [default: 1]'); 
+ 			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
+-			fielddisplay(self,'computesealevelchange','compute sealevel change (default 1)');
++			fielddisplay(self,'sealevelloading','enables surface loading from sea-level change (default 1)');
+ 			fielddisplay(self,'isgrd','compute GRD patterns (default 1)');
+ 			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default 1)');
+ 			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
+-			fielddisplay(self,'rigid','rigid earth graviational potential perturbation');
+-			fielddisplay(self,'elastic','elastic earth graviational potential perturbation');
+-			fielddisplay(self,'viscous','viscous earth graviational potential perturbation');
+-			fielddisplay(self,'rotation','earth rotational potential perturbation');
++			fielddisplay(self,'selfattraction','enables surface mass load to perturb the gravity field');
++			fielddisplay(self,'elastic','enables elastic deformation from surface loading');
++			fielddisplay(self,'viscous','enables viscous deformation from surface loading');
++			fielddisplay(self,'rotation','enables polar motion to feedback on the GRD fields');
+ 			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+ 			fielddisplay(self,'timeacc','time accuracy (default 1 yr) for numerical discretization of the Green''s functions');
+-			fielddisplay(self,'grdmodel','type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins');
++			fielddisplay(self,'grdmodel','type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)');
+ 			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -133,16 +158,17 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','reltol','name','md.solidearth.settings.reltol','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','abstol','name','md.solidearth.settings.abstol','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','maxiter','name','md.solidearth.settings.maxiter','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','rigid','name','md.solidearth.settings.rigid','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','selfattraction','name','md.solidearth.settings.selfattraction','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','elastic','name','md.solidearth.settings.elastic','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','viscous','name','md.solidearth.settings.viscous','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','rotation','name','md.solidearth.settings.rotation','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','grdocean','name','md.solidearth.settings.grdocean','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','name','md.solidearth.settings.ocean_area_scaling','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','runfrequency','name','md.solidearth.settings.runfrequency','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','degacc','name','md.solidearth.settings.degacc','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','timeacc','name','md.solidearth.settings.timeacc','format','Double','scale',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','horiz','name','md.solidearth.settings.horiz','format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','computesealevelchange','name','md.solidearth.settings.computesealevelchange','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','sealevelloading','name','md.solidearth.settings.sealevelloading','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','isgrd','name','md.solidearth.settings.isgrd','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','compute_bp_grd','name','md.solidearth.settings.compute_bp_grd','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
+@@ -153,10 +179,11 @@
+ 			writejsdouble(fid,[modelname '.solidearth.settings.maxiter'],self.maxiter);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.reltol'],self.reltol);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.abstol'],self.abstol);
+-			writejsdouble(fid,[modelname '.solidearth.settings.rigid'],self.rigid);
++			writejsdouble(fid,[modelname '.solidearth.settings.selfattraction'],self.selfattraction);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.elastic'],self.elastic);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.viscous'],self.viscous);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.rotation'],self.rotation);
++			writejsdouble(fid,[modelname '.solidearth.settings.grdocean'],self.rotation);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.ocean_area_scaling'],self.ocean_area_scaling);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.run_frequency'],self.run_frequency);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.degacc'],self.degacc);
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26296)
+@@ -16,7 +16,8 @@
+ md.materials.viscosity=[1e21            0];
+ md.initialization.sealevel=zeros(md.mesh.numberofvertices,1);
+ md.solidearth.settings.cross_section_shape=1;    % for square-edged x-section 
+-md.solidearth.settings.computesealevelchange=0;  %do not compute sea level, only deformation
++md.solidearth.settings.grdocean=0;  %do not compute sea level, only deformation
++md.solidearth.settings.sealevelloading=0;  %do not compute sea level, only deformation
+ md.solidearth.requested_outputs={'Sealevel','BedGRD'};
+ 
+ %Loading history 
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26296)
+@@ -2,9 +2,10 @@
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500.); %700 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+-%Geometry for the bed, arbitrary thickness of 1000: 
++%Geometry for the bed, arbitrary thickness of 100: 
+ md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+ md.geometry.base=md.geometry.bed;
+ md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+@@ -69,7 +70,7 @@
+ md.cluster.np=3;
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=1;
++md.solidearth.settings.sealevelloading=1;
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
+@@ -86,7 +87,7 @@
+ md.solidearth.settings.maxiter=10;
+ 
+ %eustatic run:
+-md.solidearth.settings.rigid=0;
++md.solidearth.settings.selfattraction=0;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.settings.viscous=0;
+@@ -95,17 +96,17 @@
+ Seustatic=md.results.TransientSolution.Sealevel;
+ Beustatic=md.results.TransientSolution.Bed;
+ 
+-%eustatic + rigid run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.settings.viscous=0;
+ md=solve(md,'tr');
+-Srigid=md.results.TransientSolution.Sealevel;
+-Brigid=md.results.TransientSolution.Bed;
++Sselfattraction=md.results.TransientSolution.Sealevel;
++Bselfattraction=md.results.TransientSolution.Bed;
+ 
+-%eustatic + rigid + elastic run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.settings.viscous=0;
+@@ -113,8 +114,8 @@
+ Selastic=md.results.TransientSolution.Sealevel;
+ Belastic=md.results.TransientSolution.Bed;
+ 
+-%eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic + rotation run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
+ md.solidearth.settings.viscous=0;
+@@ -123,6 +124,6 @@
+ Brotation=md.results.TransientSolution.Bed;
+ 
+ %Fields and tolerances to track changes
+-field_names={'Seustatic','Srigid','Selastic','Srotation','Beustatic','Brigid','Belastic','Brotation'};
++field_names={'Seustatic','Sselfattraction','Selastic','Srotation','Beustatic','Bselfattraction','Belastic','Brotation'};
+ field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+-field_values={Seustatic,Srigid,Selastic,Srotation,Beustatic,Brigid,Belastic,Brotation};
++field_values={Seustatic,Sselfattraction,Selastic,Srotation,Beustatic,Bselfattraction,Belastic,Brotation};
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26295)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26296)
+@@ -2,7 +2,8 @@
+ 
+ %mesh earth:
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',1000.); %1000 km resolution mesh
++load ../Data/SlcTestMesh.mat;
++md.mesh=SlcMesh; %700 km resolution mesh
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+@@ -61,7 +62,8 @@
+ %Solution parameters
+ md.solidearth.settings.reltol=NaN;
+ md.solidearth.settings.abstol=1e-3;
+-md.solidearth.settings.computesealevelchange=0;
++md.solidearth.settings.sealevelloading=0;
++md.solidearth.settings.grdocean=0;
+ md.solidearth.settings.isgrd=1;
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
+@@ -68,7 +70,6 @@
+ md.solidearth.settings.horiz=1;
+ md.solidearth.requested_outputs={'Sealevel','Bed', 'BedEast', 'BedNorth'};
+ 
+-
+ %Physics: 
+ md.transient.issmb=0; 
+ md.transient.isstressbalance=0;
+@@ -80,8 +81,8 @@
+ md.timestepping.time_step=1;
+ md.timestepping.final_time=1;
+ 
+-%eustatic + rigid + elastic run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
+ md.solidearth.settings.viscous=0;
+@@ -93,8 +94,8 @@
+ BEnoRotation=md.results.TransientSolution.BedEast;
+ BNnoRotation=md.results.TransientSolution.BedNorth;
+ 
+-%eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid=1;
++%eustatic + selfattraction + elastic + rotation run:
++md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
+ md.solidearth.settings.viscous=0;
+@@ -107,7 +108,7 @@
+ BNRotation=md.results.TransientSolution.BedNorth;
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'noRotation','Rotation'};
++field_names     ={'Sealevel', 'Uplift', 'NorthDisplacement', 'EastDisplacement'};
+ field_tolerances={1e-13,1e-13,1e-13,1e-13};
+ field_values={SRotation-SnoRotation,BURotation-BUnoRotation,BNRotation-BNnoRotation,BERotation-BEnoRotation};
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26296-26297.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26296-26297.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26296-26297.diff	(revision 26740)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/test/Data/SlcTestMesh.mat
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Data/SlcTestMesh.mat
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26297-26298.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26297-26298.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26297-26298.diff	(revision 26740)
@@ -0,0 +1,57 @@
+Index: ../trunk-jpl/test/Archives/Archive2001.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2002.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2003.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2005.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2007.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive2007.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive2008.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive2008.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive2010.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2011.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2090.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive2090.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26298-26299.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26298-26299.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26298-26299.diff	(revision 26740)
@@ -0,0 +1,1202 @@
+Index: ../trunk-jpl/src/m/classes/geometry.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.m	(revision 26298)
++++ ../trunk-jpl/src/m/classes/geometry.m	(revision 26299)
+@@ -32,13 +32,6 @@
+ 		end% }}}
+ 	end
+ 	methods
+-		function self = extrude(self,md) % {{{
+-			self.surface=project3d(md,'vector',self.surface,'type','node');
+-			self.thickness=project3d(md,'vector',self.thickness,'type','node');
+-			self.hydrostatic_ratio=project3d(md,'vector',self.hydrostatic_ratio,'type','node');
+-			self.base=project3d(md,'vector',self.base,'type','node');
+-			self.bed=project3d(md,'vector',self.bed,'type','node');
+-		end % }}}
+ 		function self = geometry(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -98,6 +91,13 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','bed','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);
+ 		end % }}}
++		function self = extrude(self,md) % {{{
++			self.surface=project3d(md,'vector',self.surface,'type','node');
++			self.thickness=project3d(md,'vector',self.thickness,'type','node');
++			self.hydrostatic_ratio=project3d(md,'vector',self.hydrostatic_ratio,'type','node');
++			self.base=project3d(md,'vector',self.base,'type','node');
++			self.bed=project3d(md,'vector',self.bed,'type','node');
++		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+ 			writejs1Darray(fid,[modelname '.geometry.surface'],self.surface);
+Index: ../trunk-jpl/test/NightlyRun/test2001.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26298)
++++ ../trunk-jpl/test/NightlyRun/test2001.m	(revision 26299)
+@@ -1,5 +1,5 @@
+ %Test Name: SquareSheetConstrainedGia2d
+-%GIA test, inspired on test101. Running default GIA Ivins class.
++%GIA test, based off of test101. Running default GIA Ivins class.
+ md=triangle(model(),'../Exp/Square.exp',100000.);
+ md=setmask(md,'','');
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+Index: ../trunk-jpl/test/NightlyRun/test2001.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26298)
++++ ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26299)
+@@ -1,4 +1,5 @@
+ #Test Name: SquareSheetConstrainedGia2d
++#GIA test, based off of test101. Running default GIA Ivins class.
+ from socket import gethostname
+ 
+ import numpy as np
+@@ -18,6 +19,7 @@
+ 
+ # GIA Ivins, 2 layer model
+ md.solidearth.settings.grdmodel = 2
++md.solidearth.settings.isgrd = 1
+ 
+ md.materials = materials('litho','ice')
+ md.materials.numlayers = 2;
+@@ -27,8 +29,9 @@
+ md.materials.viscosity = [1e21, 0]
+ md.initialization.sealevel = np.zeros(md.mesh.numberofvertices)
+ md.solidearth.settings.cross_section_shape = 1 # for square-edged x-section 
+-md.solidearth.settings.computesealevelchange = 0 # do not compute sea level, only deformation
+-md.solidearth.requested_outputs = ['Sealevel', 'SealevelUGrd']
++md.solidearth.settings.grdocean = 0 # do not compute sea level, only deformation
++md.solidearth.settings.sealevelloading = 0 # do not compute sea level, only deformation
++md.solidearth.requested_outputs = ['Sealevel', 'BedGRD']
+ 
+ # Loading history
+ md.timestepping.start_time = -2400000  # 4,800 kyr :: EVALUATION TIME
+@@ -35,7 +38,7 @@
+ md.timestepping.time_step = 2400000  # 2,400 kyr :: EVALUATION TIME
+ # To get rid of default final_time, make sure final_time > start_time
+ md.timestepping.final_time = 2400000  # 2,400 kyr
+-md.masstransport.spcthickness np.array([
++md.masstransport.spcthickness = np.array([
+     np.append(md.geometry.thickness, 0),
+     np.append(md.geometry.thickness, 2400000)
+     ]).T
+@@ -49,11 +52,10 @@
+ md.transient.issmb = 0
+ md.transient.isstressbalance = 0
+ md.transient.isthermal = 0
+-md.transient.ismasstransport = 0
+-md.transient.isslc = 0
++md.transient.ismasstransport = 1
++md.transient.isslc = 1
+ 
+ #Solve for GIA deflection
+-md.cluster = generic('name', gethostname(), 'np', 1)
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.verbose = verbose('11111111111')
+ md.verbose.solver = 0
+@@ -62,4 +64,4 @@
+ #Fields and tolerances to track changes
+ field_names = ['UGrd']
+ field_tolerances = [1e-13]
+-field_values = [md.results.TransientSolution[0].SealevelUGrd]
++field_values = [md.results.TransientSolution[1].BedGRD]
+Index: ../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.py	(revision 26298)
++++ ../trunk-jpl/src/m/classes/geometry.py	(revision 26299)
+@@ -20,8 +20,7 @@
+         self.bed = np.nan
+         self.hydrostatic_ratio = np.nan
+ 
+-        nargs = len(args)
+-        if nargs == 0:
++        if len(args) == 0:
+             self.setdefaultparameters()
+         else:
+             raise Exception('constructor not supported')
+@@ -36,15 +35,6 @@
+         return s
+     #}}}
+ 
+-    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
+     #}}}
+@@ -55,15 +45,15 @@
+         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")
++            md = checkfield(md, 'fieldname', 'geometry.thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>=', 0)
++            if any(abs(self.thickness - self.surface + self.base) > 1e-9):
++                md.checkmessage('equality thickness = surface-base violated')
+             if solution == 'TransientSolution' and md.transient.isgroundingline:
+                 md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+-                if np.any(self.bed - self.base > 10**-12):
++                if np.any(self.bed - self.base > 1e-12):
+                     md.checkmessage('base < bed on one or more vertex')
+                 pos = np.where(md.mask.ocean_levelset > 0)
+-                if np.any(np.abs(self.bed[pos] - self.base[pos]) > 10**-9):
++                if np.any(np.abs(self.bed[pos] - self.base[pos]) > 1e-9):
+                     md.checkmessage('equality base = bed on grounded ice violated')
+                 md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+         return md
+@@ -70,9 +60,10 @@
+     # }}}
+ 
+     def marshall(self, prefix, md, fid): #{{{
+-        if (len(self.thickness) == md.mesh.numberofvertices) or (len(self.thickness) == md.mesh.numberofvertices + 1):
++        length_thickness = len(self.thickness)
++        if (length_thickness == md.mesh.numberofvertices) or (length_thickness == md.mesh.numberofvertices + 1):
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+-        elif (len(self.thickness) == md.mesh.numberofelements) or (len(self.thickness) == md.mesh.numberofelements + 1):
++        elif (length_thickness == md.mesh.numberofelements) or (length_thickness == md.mesh.numberofelements + 1):
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+         else:
+             raise RuntimeError('geometry thickness time series should be a vertex or element time series')
+@@ -82,3 +73,12 @@
+         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
++    #}}}
+Index: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 26298)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 26299)
+@@ -95,7 +95,7 @@
+ 					self.heatcapacity=2093.;
+ 
+ 					%ice latent heat of fusion L (J/kg)
+-					self.latentheat=3.34*10^5;
++					self.latentheat=3.34*1e5;
+ 
+ 					%ice thermal conductivity (W/m/K)
+ 					self.thermalconductivity=2.4;
+@@ -110,13 +110,13 @@
+ 					self.meltingpoint=273.15;
+ 
+ 					%rate of change of melting point with pressure (K/Pa)
+-					self.beta=9.8*10^-8;
++					self.beta=9.8*1e-8;
+ 
+ 					%mixed layer (ice-water interface) heat capacity (J/kg/K)
+ 					self.mixed_layer_capacity=3974.;
+ 
+ 					%thermal exchange velocity (ice-water interface) (m/s)
+-					self.thermal_exchange_velocity=1.00*10^-4;
++					self.thermal_exchange_velocity=1.00*1e-4;
+ 
+ 					%Rheology law: what is the temperature dependence of B with T
+ 					%available: none, paterson and arrhenius
+@@ -123,7 +123,7 @@
+ 					self.rheology_law='Paterson';
+ 
+ 					%Rheology fields default: 
+-					self.rheology_B   = 1*1e8; 
++					self.rheology_B   = 1 * 1e8;
+ 					self.rheology_n   = 3;
+ 
+ 				case 'litho'
+@@ -135,7 +135,7 @@
+ 					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*10^10];  % (Pa) %lithosphere and mantle shear modulus (respectively) [Pa]
++					self.lame_mu=[1.45*1e11;6.7*1e10];  % (Pa) %lithosphere and mantle shear modulus (respectively) [Pa]
+ 					self.lame_lambda=self.lame_mu;  % (Pa) %mantle and lithosphere lamba parameter (respectively) [Pa]
+ 					self.burgers_viscosity=[NaN;NaN];
+ 					self.burgers_mu=[NaN;NaN];
+@@ -192,7 +192,7 @@
+ 					fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'', ''LliboutryDuval'', ''NyeCO2'', or ''NyeH2O''']);
+ 				case 'litho'
+ 					disp(sprintf('   \nLitho:'));
+-					fielddisplay(self,'numlayers','number of layers (default 2)');
++					fielddisplay(self,'numlayers','number of layers (default: 2)');
+ 					fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]');
+ 					fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]');
+ 					fielddisplay(self,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
+@@ -206,7 +206,7 @@
+ 					fielddisplay(self,'ebm_tauh','array describing each layer''s array describing each layer''s end period for transient relaxation, only for Burgers rheology  (numlayers) [s]');
+ 
+ 
+-					fielddisplay(self,'rheologymodel','array describing whether we adopt a MaxWell (0), Burgers (1) or EBM (2) rheology (default 0)');
++					fielddisplay(self,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
+ 					fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]');
+ 					fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
+ 				case 'hydro'
+@@ -260,11 +260,11 @@
+ 						end
+ 					end
+ 					if md.materials.issolid(1)==0 | md.materials.lame_mu(1)==0
+-							error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
++						error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
+ 					end
+ 					ind=find(md.materials.issolid==0);
+ 					if sum(ismember(diff(ind),1)>=1) %if there are at least two consecutive indices that contain issolid = 0
+-							error(['Fluid layers detected at layers #', num2str(ind'), ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'])
++						error(['Fluid layers detected at layers #', num2str(ind'), ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'])
+ 					end
+ 
+ 				case 'hydro'
+@@ -322,7 +322,7 @@
+ 					%compute earth density compatible with our layer density distribution: 
+ 					earth_density=0;
+ 					for i=1:self.numlayers,
+-						earth_density=earth_density+ (self.radius(i+1)^3-self.radius(i)^3)*self.density(i);
++						earth_density=earth_density + (self.radius(i+1)^3-self.radius(i)^3)*self.density(i);
+ 					end
+ 					earth_density=earth_density/self.radius(self.numlayers+1)^3;
+ 					self.earth_density=earth_density;
+@@ -564,7 +564,7 @@
+ 	intnat=zeros(length(strnat),1);
+ 	for i=1:length(strnat),
+ 		switch strnat{i},
+-			case 'damageice'
++		case 'damageice'
+ 			intnat(i)=1;
+ 		case 'estar'
+ 			intnat(i)=2;
+Index: ../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.py	(revision 26298)
++++ ../trunk-jpl/src/m/classes/materials.py	(revision 26299)
+@@ -15,7 +15,7 @@
+ 
+     def __init__(self, *args): #{{{
+         self.nature = []
+-        if not len(args):
++        if len(args) == 0:
+             self.nature = ['ice']
+         else:
+             self.nature = args
+@@ -24,177 +24,192 @@
+             if not(self.nature[i] == 'litho' or self.nature[i] == 'ice' or self.nature[i] == 'hydro'):
+                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+ 
+-        #start filling in the dynamic fields:
+         for i in range(len(self.nature)):
+             nat = self.nature[i]
+             if nat == 'ice':
+-                setattr(self, 'rho_ice', 0)
+-                setattr(self, 'rho_water', 0)
+-                setattr(self, 'rho_freshwater', 0)
+-                setattr(self, 'mu_water', 0)
+-                setattr(self, 'heatcapacity', 0)
+-                setattr(self, 'latentheat', 0)
+-                setattr(self, 'thermalconductivity', 0)
+-                setattr(self, 'temperateiceconductivity', 0)
+-                setattr(self, 'effectiveconductivity_averaging', 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)
++                self.rho_ice = 0
++                self.rho_water = 0
++                self.rho_freshwater = 0
++                self.mu_water = 0
++                self.heatcapacity = 0
++                self.latentheat = 0
++                self.thermalconductivity = 0
++                self.temperateiceconductivity = 0
++                self.effectiveconductivity_averaging = 0
++                self.meltingpoint = 0
++                self.beta = 0
++                self.mixed_layer_capacity = 0
++                self.thermal_exchange_velocity = 0
++                self.rheology_B = 0
++                self.rheology_n = 0
++                self.rheology_law = 0
+             elif nat == 'litho':
+-                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)
++                self.numlayers = 0
++                self.radius = 0
++                self.viscosity = 0
++                self.lame_lambda = 0
++                self.lame_mu = 0
++                self.burgers_viscosity = 0
++                self.burgers_mu = 0
++                self.ebm_alpha = 0
++                self.ebm_delta = 0
++                self.ebm_taul = 0
++                self.ebm_tauh = 0
++                self.rheologymodel = 0
++                self.density = 0
++                self.issolid = 0
+             elif nat == 'hydro':
+-                setattr(self, 'rho_ice', 0)
+-                setattr(self, 'rho_water', 0)
+-                setattr(self, 'rho_freshwater', 0)
++                self.rho_ice = 0
++                self.rho_water = 0
++                self.rho_freshwater = 0
+             else:
+                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+-        setattr(self, 'earth_density', 0)
++        self.earth_density = 0
+ 
+-        #set default parameters:
++        # Set default parameters
+         self.setdefaultparameters()
+     #}}}
+ 
++    def __repr__(self): #{{{
++        s = '   Materials:\n'
++        for i in range(len(self.nature)):
++            nat = self.nature[i]
++            if nat == 'ice':
++                s += 'Ice:\n'
++                s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
++                s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
++                s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
++                s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
++                s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
++                s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
++                s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
++                s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
++                s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
++                s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
++                s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\''))
++            elif nat == 'litho':
++                s += 'Litho:\n'
++                s += '{}\n'.format(fielddisplay(self, 'numlayers', 'number of layers (default: 2)'))
++                s += '{}\n'.format(fielddisplay(self, 'radius', 'array describing the radius for each interface (numlayers + 1) [m]'))
++                s += '{}\n'.format(fielddisplay(self, 'viscosity', 'array describing each layer\'s viscosity (numlayers) [Pa.s]'))
++                s += '{}\n'.format(fielddisplay(self, 'lame_lambda', 'array describing the lame lambda parameter (numlayers) [Pa]'))
++                s += '{}\n'.format(fielddisplay(self, 'lame_mu', 'array describing the shear modulus for each layers (numlayers) [Pa]'))
++                s += '{}\n'.format(fielddisplay(self, 'burgers_viscosity', 'array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
++                s += '{}\n'.format(fielddisplay(self, 'burgers_mu', 'array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
++
++                s += '{}\n'.format(fielddisplay(self, 'ebm_alpha', 'array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)'))
++                s += '{}\n'.format(fielddisplay(self, 'ebm_delta', 'array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)'))
++                s += '{}\n'.format(fielddisplay(self, 'ebm_taul', 'array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]'))
++                s += '{}\n'.format(fielddisplay(self, 'ebm_tauh', 'array describing each layer''s array describing each layer\'s end period for transient relaxation, only for Burgers rheology  (numlayers) [s]'))
++
++                s += '{}\n'.format(fielddisplay(self, 'rheologymodel', 'array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)'))
++                s += '{}\n'.format(fielddisplay(self, 'density', 'array describing each layer\'s density (numlayers) [kg/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default 1) (numlayers)'))
++            elif nat == 'hydro':
++                s += 'Hydro:\n'
++                s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'earth_density', 'mantle density [kg/m^3]'))
++                s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
++
++            else:
++                raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
++        return s
++    #}}}
++
+     def setdefaultparameters(self): #{{{
+         for i in range(len(self.nature)):
+             nat = self.nature[i]
+             if nat == 'ice':
+-                #ice density (kg/m^3)
++                # Ice density (kg/m^3)
+                 self.rho_ice = 917.
+ 
+-                #ocean water density (kg/m^3)
++                # Ocean water density (kg/m^3)
+                 self.rho_water = 1023.
+ 
+-                #fresh water density (kg/m^3)
++                # Fresh water density (kg/m^3)
+                 self.rho_freshwater = 1000.
+ 
+-                #water viscosity (N.s/m^2)
++                # Water viscosity (N.s/m^2)
+                 self.mu_water = 0.001787
+ 
+-                #ice heat capacity cp (J/kg/K)
++                # Ice heat capacity cp (J/kg/K)
+                 self.heatcapacity = 2093.
+ 
+-                #ice latent heat of fusion L (J / kg)
+-                self.latentheat = 3.34e5
++                # Ice latent heat of fusion L (J/kg)
++                self.latentheat = 3.34 * 1e5
+ 
+-                #ice thermal conductivity (W/m/K)
++                # Ice thermal conductivity (W/m/K)
+                 self.thermalconductivity = 2.4
+ 
+-                #wet ice thermal conductivity (W/m/K)
++                # Wet ice thermal conductivity (W/m/K)
+                 self.temperateiceconductivity = 0.24
+ 
+-                #computation of effective conductivity
++                # Computation of effective conductivity
+                 self.effectiveconductivity_averaging = 1
+ 
+-                #the melting point of ice at 1 atmosphere of pressure in K
++                # The melting point of ice at 1 atmosphere of pressure in K
+                 self.meltingpoint = 273.15
+ 
+-                #rate of change of melting point with pressure (K/Pa)
+-                self.beta = 9.8e-8
++                # Rate of change of melting point with pressure (K/Pa)
++                self.beta = 9.8 * 1e-8
+ 
+-                #mixed layer (ice-water interface) heat capacity (J/kg/K)
++                # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+                 self.mixed_layer_capacity = 3974.
+ 
+-                #thermal exchange velocity (ice-water interface) (m/s)
+-                self.thermal_exchange_velocity = 1.00e-4
++                # Thermal exchange velocity (ice-water interface) (m/s)
++                self.thermal_exchange_velocity = 1.00 * 1e-4
+ 
+-                #Rheology law: what is the temperature dependence of B with T
+-                #available: none, paterson and arrhenius
++                # Rheology law: what is the temperature dependence of B with T
++                # available: none, paterson and arrhenius
+                 self.rheology_law = 'Paterson'
+ 
+-                #Rheology fields default
+-                self.rheology_B = 1e8
++                # Rheology fields default
++                self.rheology_B = 1 * 1e8
+                 self.rheology_n = 3
+             elif nat == 'litho':
+-                #we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
++                # We default to a configuration that enables running GIA 
++                # solutions using giacaron and/or giaivins
+                 self.numlayers = 2
+ 
+-                #center of the earth (approximation, must not be 0), then the lab (lithosphere / asthenosphere boundary) then the surface
+-                #(with 1d3 to avoid numerical singularities)
+-                self.radius = [1e3, 6278e3, 6378e3]
++                # 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.45e11, 6.7e10]  # (Pa)  #lithosphere and mantle shear modulus (respectively) [Pa]
+-                self.lame_lambda = self.lame_mu  # (Pa)  #mantle and lithosphere lamba parameter (respectively) [Pa]
++                self.viscosity = [1e21, 1e40] # Mantle and lithosphere viscosity (respectively) [Pa.s]
++                self.lame_mu = [1.45 * 1e11, 6.7 * 1e10] # (Pa) # Lithosphere and mantle shear modulus (respectively) [Pa]
++                self.lame_lambda = self.lame_mu # (Pa) # Mantle and lithosphere lamba parameter (respectively) [Pa]
+                 self.burgers_viscosity = [np.nan, np.nan]
+                 self.burgers_mu = [np.nan, np.nan]
+-                self.isburgers = [0, 0]
+-                self.density = [5.51e3, 5.50e3]  # (Pa)  #mantle and lithosphere density [kg/m^3]
+-                self.issolid = [1, 1]  # is layer solid or liquid.
++
++                self.ebm_alpha = [np.nan, np.nan]
++                self.ebm_delta = [np.nan, np.nan]
++                self.ebm_taul = [np.nan, np.nan]
++                self.ebm_tauh = [np.nan, np.nan]
++                self.rheologymodel = [0, 0]
++                self.density = [5.51e3, 5.50e3]  # (Pa) # Mantle and lithosphere density [kg/m^3]
++                self.issolid = [1, 1]  # Is layer solid or liquid?
+             elif nat == 'hydro':
+-                #ice density (kg/m^3)
++                # Ice density (kg/m^3)
+                 self.rho_ice = 917.
+ 
+-                #ocean water density (kg/m^3)
++                # Ocean water density (kg/m^3)
+                 self.rho_water = 1023.
+ 
+-                #fresh water density (kg/m^3)
++                # Fresh water density (kg/m^3)
+                 self.rho_freshwater = 1000.
+             else:
+                 raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+ 
+-            #average density of the Earth (kg/m^3)
++            # Average density of the Earth (kg/m^3)
+             self.earth_density = 5512
+     #}}}
+ 
+-    def __repr__(self): #{{{
+-        string = "   Materials:"
+-        for i in range(len(self.nature)):
+-            nat = self.nature[i]
+-            if nat == 'ice':
+-                string = "%s\n%s" % (string, 'Ice:')
+-                string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "ocean water density [kg/m^3]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s/m^2]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J/kg/K]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W/m/K]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W/m/K]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J/m^3]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K/Pa]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W/kg/K]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m/s]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'"))
+-            elif nat == 'litho':
+-                string = "%s\n%s" % (string, 'Litho:')
+-                string = "%s\n%s" % (string, fielddisplay(self, 'numlayers', 'number of layers (default 2)'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'radius', 'array describing the radius for each interface (numlayers + 1) [m]'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'viscosity', 'array describing each layer''s viscosity (numlayers) [Pa.s]'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'lame_lambda', 'array describing the lame lambda parameter (numlayers) [Pa]'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'lame_mu', 'array describing the shear modulus for each layers (numlayers) [Pa]'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'burgers_viscosity', 'array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'burgers_mu', 'array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'isburgers', 'array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'density', 'array describing each layer''s density (numlayers) [kg/m^3]'))
+-                string = "%s\n%s" % (string, fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default 1) (numlayers)'))
+-            elif nat == 'hydro':
+-                string = "%s\n%s" % (string, 'Hydro:')
+-                string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "ocean water density [kg/m^3]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "mantle density [kg/m^3]"))
+-                string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
+-
+-            else:
+-                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+-
+-        return string
+-    #}}}
+-
+     def checkconsistency(self, md, solution, analyses): #{{{
+         for i in range(len(self.nature)):
+             nat = self.nature[i]
+@@ -217,20 +232,26 @@
+                 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.rheologymodel', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 2)
+                 md = checkfield(md, 'fieldname', 'materials.burgers_viscosity', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                 md = checkfield(md, 'fieldname', 'materials.burgers_mu', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
++                md = checkfield(md, 'fieldname', 'materials.ebm_alpha', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
++                md = checkfield(md, 'fieldname', 'materials.ebm_delta', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
++                md = checkfield(md, 'fieldname', 'materials.ebm_taul', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
++                md = checkfield(md, 'fieldname', 'materials.ebm_tauh', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+ 
+                 for i in range(md.materials.numlayers):
+-                    if md.materials.isburgers[i] and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
+-                        raise RuntimeError("materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice")
++                    if md.materials.rheologymodel[i] == 1 and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
++                        raise RuntimeError('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice')
+ 
+-                    if md.materials.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.')
++                    if md.materials.rheologymodel[i] == 2 and (np.isnan(md.materials.ebm_alpha[i]) or np.isnan(md.materials.ebm_delta[i]) or np.isnan(md.materials.ebm_taul[i]) or np.isnan(md.materials.ebm_tauh[i])):
++                        raise RuntimeError('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice')
++                if md.materials.issolid[0] == 0 or md.materials.lame_mu[0] == 0:
++                    raise RuntimeError('First layer must be solid (issolid[0] > 0 AND lame_mu[0] > 0). Add a weak inner core if necessary.')
++                ind = np.where(md.materials.issolid == 0)[0]
++                if np.sum(np.in1d(np.diff(ind),1) >= 1): # If there are at least two consecutive indices that contain issolid = 0
++                    raise RuntimeError('Fluid layers detected at layers #{} but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'.format(i))
+ 
+-                    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.'))
+             elif nat == 'hydro':
+                 md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+                 md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+@@ -237,7 +258,7 @@
+                 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
+                 md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+             else:
+-                raise RuntimeError("materials checkconsistency error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
++                raise RuntimeError('materials checkconsistency error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
+ 
+         return md
+     #}}}
+@@ -249,7 +270,6 @@
+         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')
+@@ -274,14 +294,18 @@
+                 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', 'rheologymodel', 'format', 'DoubleMat', 'mattype', 3) 
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3)
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3)
++                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_alpha', 'format', 'DoubleMat', 'mattype', 3)
++                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_delta', 'format', 'DoubleMat', 'mattype', 3)
++                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_taul', 'format', 'DoubleMat', 'mattype', 3)
++                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'ebm_tauh', 'format', 'DoubleMat', 'mattype', 3)
+                 # Compute earth density compatible with our layer density distribution
+                 earth_density = 0
+-                for i in range(len(self.numlayers)):
+-                    earth_density = earth_density + (self.radius[i + 1] ** 3 - self.radius[i] ** 3) * self.density[i]
+-                earth_density = earth_density / self.radius[self.numlayers + 1] ** 3
++                for i in range(self.numlayers):
++                    earth_density = earth_density + (pow(self.radius[i + 1], 3) - pow(self.radius[i], 3)) * self.density[i]
++                earth_density = earth_density / pow(self.radius[self.numlayers], 3)
+                 self.earth_density = earth_density
+             elif nat == 'hydro':
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+@@ -288,7 +312,7 @@
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
+             else:
+-                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
++                raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
+         WriteData(fid, prefix, 'data', self.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double')
+     #}}}
+ 
+@@ -321,7 +345,7 @@
+         elif strnat[i] == 'hydro':
+             intnat[i] = 7
+         else:
+-            raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
++            raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
+ 
+     return intnat
+ #}}}
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 26298)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 26299)
+@@ -82,7 +82,6 @@
+ 				self.external.checkconsistency(md,solution,analyses);
+ 			end
+ 
+-			
+ 		end % }}}
+ 		function list=defaultoutputs(self,md) % {{{
+ 			list = {'Sealevel'};
+@@ -106,10 +105,10 @@
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-			
++
+ 			WriteData(fid,prefix,'object',self,'fieldname','planetradius','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray');
+-		
++
+ 			if ~isempty(self.partitionice),
+ 				npartice=max(self.partitionice)+2;
+ 			else
+@@ -126,8 +125,6 @@
+ 				npartocean=0;
+ 			end
+ 
+-
+-			
+ 			WriteData(fid,prefix,'object',self,'fieldname','partitionice','mattype',1,'format','DoubleMat');
+ 			WriteData(fid,prefix,'data',npartice,'format','Integer','name','md.solidearth.npartice');
+ 			WriteData(fid,prefix,'object',self,'fieldname','partitionhydro','mattype',1,'format','DoubleMat');
+@@ -134,7 +131,7 @@
+ 			WriteData(fid,prefix,'data',nparthydro,'format','Integer','name','md.solidearth.nparthydro');
+ 			WriteData(fid,prefix,'object',self,'fieldname','partitionocean','mattype',1,'format','DoubleMat');
+ 			WriteData(fid,prefix,'data',npartocean,'format','Integer','name','md.solidearth.npartocean');
+-			
++
+ 			self.settings.marshall(prefix,md,fid);
+ 			self.lovenumbers.marshall(prefix,md,fid);
+ 			self.rotational.marshall(prefix,md,fid);
+@@ -144,10 +141,10 @@
+ 			else
+ 				WriteData(fid,prefix,'data',0,'format','Integer','name','md.solidearth.isexternal');
+ 			end
+-			
++
+ 			%process requested outputs
+ 			outputs = self.requested_outputs;
+-			pos  = find(ismember(outputs,'default'));
++			pos = find(ismember(outputs,'default'));
+ 			if ~isempty(pos),
+ 				outputs(pos) = [];                         %remove 'default' from outputs
+ 				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+@@ -155,6 +152,8 @@
+ 			WriteData(fid,prefix,'data',outputs,'name','md.solidearth.requested_outputs','format','StringArray');
+ 
+ 		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+ 			self.settings.savemodeljs(fid,modelname);
+@@ -167,7 +166,5 @@
+ 			writejscellarray(fid,[modelname '.solidearth.transitions'],self.transitions);
+ 			writejscellarray(fid,[modelname '.solidearth.partition'],self.partition);
+ 		end % }}}
+-		function self = extrude(self,md) % {{{
+-		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/solidearth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.py	(revision 26298)
++++ ../trunk-jpl/src/m/classes/solidearth.py	(revision 26299)
+@@ -18,11 +18,9 @@
+         solidearth = solidearth()
+     """
+ 
+-    def __init__(self, *args):  #{{{
+-        self.initialsealevel    = np.nan
++    def __init__(self, *args): #{{{
+         self.settings           = solidearthsettings()
+         self.external           = []
+-        self.surfaceload        = surfaceload()
+         self.lovenumbers        = lovenumbers()
+         self.rotational         = rotational()
+         self.planetradius       = planetradius('earth')
+@@ -30,9 +28,9 @@
+         self.transitions        = []
+         self.partitionice       = []
+         self.partitionhydro     = []
++        self.partitionocean     = []
+ 
+         nargs = len(args)
+-
+         if nargs == 0:
+             self.setdefaultparameters('earth')
+         elif nargs == 1:
+@@ -40,18 +38,17 @@
+         else:
+             raise Exception('solidearth constructor error message: zero or one argument only!')
+     #}}}
+-    def __repr__(self):  # {{{
++    def __repr__(self): #{{{
+         s = '   solidearthinputs, forcings and settings:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'initialsealevel', 'sea level at the start of computation [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'planetradius', 'planet radius [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
+         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+         s += '{}\n'.format(fielddisplay(self, 'partitionice', 'ice partition vector for barystatic contribution'))
+         s += '{}\n'.format(fielddisplay(self, 'partitionhydro', 'hydro partition vector for barystatic contribution'))
++        s += '{}\n'.format(fielddisplay(self, 'partitionocean', 'ocean partition vector for barystatic contribution'))
+         if not self.external:
+             s += '{}\n'.format(fielddisplay(self, 'external', 'external solution, of the type solidearthsolution'))
+         print(self.settings)
+-        print(self.surfaceload)
+         print(self.lovenumbers)
+         print(self.rotational)
+         if self.external:
+@@ -58,8 +55,8 @@
+             print(self.external)
+         return s
+     #}}}
+-    def setdefaultparameters(self, planet):  # {{{
+-        # Default output
++    def setdefaultparameters(self, planet): #{{{
++        # Output default
+         self.requested_outputs = ['default']
+ 
+         # Transitions should be a list
+@@ -68,35 +65,34 @@
+         # No partitions requested for barystatic contribution
+         self.partitionice = []
+         self.partitionhydro = []
++        self.partitionocean = []
+ 
+-        # No external solutions by defalt
++        # No external solutions by default
+         self.external = []
+ 
+         # Earth radius
+         self.planetradius = planetradius(planet)
+     #}}}
+-    def checkconsistency(self, md, solution, analyses):  # {{{
++    def checkconsistency(self, md, solution, analyses): #{{{
+         if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+-        md = checkfield(md, 'fieldname', 'solidearth.initialsealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
++
+         md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1)
+ 
+         self.settings.checkconsistency(md, solution, analyses)
+-        self.surfaceload.checkconsistency(md, solution, analyses)
+         self.lovenumbers.checkconsistency(md, solution, analyses)
+         self.rotational.checkconsistency(md, solution, analyses)
+         if self.external:
+-            if not isinstance(self.external,'solidearthsolution'):
++            if not isinstance(self.external, 'solidearthsolution'):
+                 raise Exception('solidearth consistency check: external field should be a solidearthsolution')
+             end
+-            self.external.checkconsistency(md,solution,analyses)
++            self.external.checkconsistency(md, solution, analyses)
+         return md
+     #}}}
+-    def defaultoutputs(self, md):  #{{{
++    def defaultoutputs(self, md): #{{{
+         return ['Sealevel']
+     #}}}
+-    def marshall(self, prefix, md, fid):  #{{{
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'initialsealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++    def marshall(self, prefix, md, fid): #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
+ 
+@@ -110,27 +106,35 @@
+         else:
+             nparthydro = 0
+ 
++        if len(self.partitionocean):
++            npartocean = np.max(self.partitionocean) + 2
++        else:
++            npartocean = 0
++
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionice', 'mattype', 1, 'format', 'DoubleMat');
+         WriteData(fid, prefix, 'data', npartice, 'format', 'Integer', 'name', 'md.solidearth.npartice');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionhydro', 'mattype', 1, 'format', 'DoubleMat');
+         WriteData(fid, prefix, 'data', nparthydro,'format', 'Integer', 'name','md.solidearth.nparthydro');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'partitionocean', 'mattype', 1, 'format', 'DoubleMat');
++        WriteData(fid, prefix, 'data', npartocean,'format', 'Integer', 'name','md.solidearth.npartocean');
+ 
+         self.settings.marshall(prefix, md, fid)
+-        self.surfaceload.marshall(prefix, md, fid)
+         self.lovenumbers.marshall(prefix, md, fid)
+         self.rotational.marshall(prefix, md, fid)
+         if self.external:
++            WriteData(fid, prefix, 'data', 1, 'format', 'Integer', 'name', 'md.solidearth.isexternal')
+             self.external.marshall(prefix, md, fid)
++        else:
++            WriteData(fid, prefix, 'data', 0, 'format', 'Integer', 'name', 'md.solidearth.isexternal')
+ 
+         #process requested outputs
+         outputs = self.requested_outputs
+         pos = np.where(np.asarray(outputs) == 'default')[0]
+         if len(pos):
+-            outputs = np.delete(outputs, pos)  #remove 'default' from outputs
+-            outputs = np.append(outputs, self.defaultoutputs(md))  #add defaults
++            outputs = np.delete(outputs, pos)  # remove 'default' from outputs
++            outputs = np.append(outputs, self.defaultoutputs(md)) # add defaults
+         WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray')
+     #}}}
+     def extrude(self, md): #{{{
+-        self.initialsealevel = project3d(md, 'vector', self.initialsealevel, 'type', 'node')
+         return self
+     #}}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26298)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26299)
+@@ -4,7 +4,7 @@
+ %      solidearthsettings=solidearthsettings();
+ 
+ classdef solidearthsettings
+-	properties (SetAccess=public) 
++	properties (SetAccess=public)
+ 		reltol                 = 0;
+ 		abstol                 = 0;
+ 		maxiter                = 0;
+@@ -12,7 +12,7 @@
+ 		elastic                = 1;
+ 		viscous                = 1;
+ 		rotation               = 1;
+-		grdocean	       = 1;
++		grdocean               = 1;
+ 		ocean_area_scaling     = 0;
+ 		runfrequency           = 1; %how many time steps we skip before we run grd_core
+ 		sealevelloading        = 1; %will sea-level loads be computed? 
+@@ -19,9 +19,9 @@
+ 		isgrd                  = 0; %will GRD patterns be computed? 
+ 		compute_bp_grd         = 0; %will GRD patterns for bottom pressures be computed? 
+ 		degacc                 = 0; %degree increment for resolution of Green tables.
+-		timeacc                = 0; %time step accurary required to compute Green tables
++		timeacc                = 0; %time step accuracy required to compute Green tables
+ 		horiz                  = 0; %compute horizontal deformation
+-		grdmodel               = 0; %grd model (0 by default, 1 for (visco)-elastic, 2 for Ivins)
++		grdmodel               = 0; %grd model (0 by default, 1 for (visco-)elastic, 2 for Ivins)
+ 		cross_section_shape    = 0; %cross section only used when grd model is Ivins
+ 	end
+ 	methods (Static)
+@@ -80,11 +80,11 @@
+ 
+ 		%how many time steps we skip before we run solidearthsettings solver during transient
+ 		self.runfrequency=1;
+-		
+-		%horizontal displacement?  (not by default)
++
++		%horizontal displacement? (not on by default)
+ 		self.horiz=0;
+-		
+-		%cross section for Ivins model 
++
++		%cross section for Ivins model
+ 		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
+ 
+ 		%no grd model by default: 
+@@ -105,6 +105,7 @@
+ 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
+ 			md = checkfield(md,'fieldname','solidearth.settings.grdmodel','>=',0,'<=',2);
+ 			md = checkfield(md,'fieldname','solidearth.settings.cross_section_shape','numel',[1],'values',[1,2]);
++
+ 			if self.elastic==1 & self.selfattraction==0,
+ 				error('solidearthsettings checkconsistency error message: need selfattraction on if elastic flag is set');
+ 			end
+@@ -136,21 +137,21 @@
+ 		function disp(self) % {{{
+ 			disp(sprintf('   solidearth settings:'));
+ 
+-			fielddisplay(self,'reltol','sea level change relative convergence criterion, (default, NaN: not applied)');
+-			fielddisplay(self,'abstol','sea level change absolute convergence criterion, NaN: not applied');
++			fielddisplay(self,'reltol','sea level change relative convergence criterion (default, NaN: not applied)');
++			fielddisplay(self,'abstol','sea level change absolute convergence criterion(default, NaN: not applied)');
+ 			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
+-			fielddisplay(self,'grdocean','does this planet have an ocean, if set to 1: global water mass is conserved in GRD module [default: 1]'); 
+-			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
+-			fielddisplay(self,'sealevelloading','enables surface loading from sea-level change (default 1)');
+-			fielddisplay(self,'isgrd','compute GRD patterns (default 1)');
+-			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default 1)');
++			fielddisplay(self,'grdocean','does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'); 
++			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)'); 
++			fielddisplay(self,'sealevelloading','enables surface loading from sea-level change (default: 1)');
++			fielddisplay(self,'isgrd','compute GRD patterns (default: 1)');
++			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default: 1)');
+ 			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
+ 			fielddisplay(self,'selfattraction','enables surface mass load to perturb the gravity field');
+ 			fielddisplay(self,'elastic','enables elastic deformation from surface loading');
+ 			fielddisplay(self,'viscous','enables viscous deformation from surface loading');
+ 			fielddisplay(self,'rotation','enables polar motion to feedback on the GRD fields');
+-			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+-			fielddisplay(self,'timeacc','time accuracy (default 1 yr) for numerical discretization of the Green''s functions');
++			fielddisplay(self,'degacc','accuracy (default: .01 deg) for numerical discretization of the Green''s functions');
++			fielddisplay(self,'timeacc','time accuracy (default: 1 yr) for numerical discretization of the Green''s functions');
+ 			fielddisplay(self,'grdmodel','type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)');
+ 			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
+ 		end % }}}
+@@ -174,6 +175,8 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','grdmodel','name','md.solidearth.settings.grdmodel','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','name','md.solidearth.settings.cross_section_shape','format','Integer');
+ 		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+ 			writejsdouble(fid,[modelname '.solidearth.settings.maxiter'],self.maxiter);
+@@ -190,7 +193,5 @@
+ 			writejsdouble(fid,[modelname '.solidearth.settings.timeacc'],self.timeacc);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.cross_section_shape'],self.cross_section_shape);
+ 		end % }}}
+-		function self = extrude(self,md) % {{{
+-		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26298)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26299)
+@@ -12,52 +12,55 @@
+         solidearthsettings = solidearthsettings()
+     """
+ 
+-    def __init__(self, *args):  #{{{
++    def __init__(self, *args): #{{{
+         self.reltol                 = 0
+         self.abstol                 = 0
+         self.maxiter                = 0
+-        self.rigid                  = 0
+-        self.elastic                = 0
+-        self.rotation               = 0
++        self.selfattraction         = 1
++        self.elastic                = 1
++        self.viscous                = 1
++        self.rotation               = 1
++        self.grdocean               = 1
+         self.ocean_area_scaling     = 0
+         self.runfrequency           = 1 # How many time steps we skip before we run grd_core
+-        self.computesealevelchange  = 1 # Will grd_core compute sea level?
+-        self.isgrd                  = 1 # Will GRD patterns be computed?
+-        self.compute_bp_grd         = 1 # Will GRD patterns for bottom pressures be computed?
++        self.sealevelloading        = 1 # Will sea-level loads be computed?
++        self.isgrd                  = 0 # Will GRD patterns be computed?
++        self.compute_bp_grd         = 0 # Will GRD patterns for bottom pressures be computed?
+         self.degacc                 = 0 # Degree increment for resolution of Green tables
+-        self.horiz                  = 0 # Compute horizontal displacement?
+-        self.glfraction             = 1 # Barystatic contribution: full or fractional (default: fractional)
+-        self.grdmodel               = 0 # GRD model (0 by default, 1 for elastic, 2 for Ivins)
++        self.timeacc                = 0 # Time step accuracy required to compute Green tables
++        self.horiz                  = 0 # Compute horizontal deformation?
++        self.grdmodel               = 0 # GRD model (0 by default, 1 for (visco-)elastic, 2 for Ivins)
+         self.cross_section_shape    = 0 # Cross section only used when GRD model is Ivins
+ 
+-        nargin = len(args)
+-
+-        if nargin == 0:
++        if len(args) == 0:
+             self.setdefaultparameters()
+         else:
+             raise Exception('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self):  # {{{
++    def __repr__(self): #{{{
+         s = '   solidearth settings:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level rise relative convergence criterion, (default, NaN: not applied)'))
+-        s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level rise absolute convergence criterion, NaN: not applied'))
++        s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level change relative convergence criterion (default, NaN: not applied)'))
++        s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level change absolute convergence criterion (default, NaN: not applied)'))
+         s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
+-        s += '{}\n'.format(fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area [default: No correction]'))
+-        s += '{}\n'.format(fielddisplay(self, 'computesealevelchange', 'compute sealevel change from GRD in addition to steric?) default 0'))
++        s += '{}\n'.format(fielddisplay(self, 'grdocean', 'does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area (default: No correction)'))
++        s += '{}\n'.format(fielddisplay(self, 'sealevelloading', 'enables surface loading from sea-level change (default: 1)'))
+         s += '{}\n'.format(fielddisplay(self, 'isgrd', 'compute GRD patterns (default: 1'))
+         s += '{}\n'.format(fielddisplay(self, 'compute_bp_grd', 'compute GRD patterns for bottom pressure loads (default 1)'))
+         s += '{}\n'.format(fielddisplay(self, 'runfrequency', 'how many time steps we skip before we run solidearthsettings solver during transient (default: 1)'))
+-        s += '{}\n'.format(fielddisplay(self, 'rigid', 'rigid earth graviational potential perturbation'))
+-        s += '{}\n'.format(fielddisplay(self, 'elastic', 'elastic earth graviational potential perturbation'))
+-        s += '{}\n'.format(fielddisplay(self, 'degacc', 'accuracy (default .01 deg) for numerical discretization of the Green\'s functions'))
+-        s += '{}\n'.format(fielddisplay(self, 'glfraction', 'contribute fractionally (default, 1) to barystatic sea level'))
+-        s += '{}\n'.format(fielddisplay(self, 'grdmodel', 'type of deformation model, 1 for elastic, 2 for visco-elastic from Ivins'))
++        s += '{}\n'.format(fielddisplay(self, 'selfattraction', 'enables surface mass load to perturb the gravity field'))
++        s += '{}\n'.format(fielddisplay(self, 'elastic', 'enables elastic deformation from surface loading'))
++        s += '{}\n'.format(fielddisplay(self, 'viscous', 'enables viscous deformation from surface loading'))
++        s += '{}\n'.format(fielddisplay(self, 'rotation', 'enables polar motion to feedback on the GRD fields'))
++        s += '{}\n'.format(fielddisplay(self, 'degacc', 'accuracy (default: .01 deg) for numerical discretization of the Green\'s functions'))
++        s += '{}\n'.format(fielddisplay(self, 'timeacc', 'time accuracy (default: 1 year) for numerical discretization of the Green\'s functions'))
++        s += '{}\n'.format(fielddisplay(self, 'grdmodel', 'type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)'))
+         s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', '1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore'))
+         return s
+     #}}}
+ 
+-    def setdefaultparameters(self):  # {{{
++    def setdefaultparameters(self): #{{{
+         # Convergence criterion: absolute, relative, and residual
+         self.reltol = 0.01  # 1 percent
+         self.abstol = np.nan  # default
+@@ -66,49 +69,51 @@
+         self.maxiter = 5
+ 
+         # Computational flags
+-        self.rigid = 1
++        self.selfattraction = 1
+         self.elastic = 1
++        self.viscous = 1
+         self.rotation = 1
++        self.grdocean = 1
+         self.ocean_area_scaling = 0
+-        self.compute_bp_grd = 1
++        self.compute_bp_grd = 0
+         self.isgrd = 0
+-        self.computesealevelchange = 1
++        self.sealevelloading = 1
+ 
+         # Numerical discretization accuracy
+         self.degacc = .01
++        self.timeacc = 1
+ 
+         # How many time steps we skip before we run solidearthsettings solver during transient
+         self.runfrequency = 1
+ 
+-        # Fractional contribution
+-        self.glfraction = 1
+-
+         # Horizontal displacement? (not on by default)
+         self.horiz = 0
+ 
+         # Cross section for Ivins model
+-        self.cross_section_shape = 1 # Square as default (see iedde in GiaDeflectionCorex)
++        self.cross_section_shape = 1 # Square as default (see iedge in GiaDeflectionCorex)
+ 
+         # No GRD model by default
+         self.grdmodel = 0
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses):  # {{{
++    def checkconsistency(self, md, solution, analyses): #{{{
+         if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
++
+         md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1])
+         md = checkfield(md, 'fieldname', 'solidearth.settings.abstol', 'size', [1])
+         md = checkfield(md, 'fieldname', 'solidearth.settings.maxiter', 'size', [1], '>=', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.settings.runfrequency', 'size', [1], '>=', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.settings.degacc', 'size', [1], '>=', 1e-10)
++        md = checkfield(md, 'fieldname', 'solidearth.settings.timeacc', 'size', [1], '>', 0)
+         md = checkfield(md, 'fieldname', 'solidearth.settings.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'solidearth.settings.glfraction', 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', 'values', [1, 2])
++        md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', '>=', 0, '<=', 2)
+         md = checkfield(md, 'fieldname', 'solidearth.settings.cross_section_shape', 'numel', [1], 'values', [1, 2])
+ 
+-        # Checks on computational flags
+-        if self.elastic and not self.rigid:
+-            raise Exception('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set')
++        if self.elastic and not self.selfattraction:
++            raise Exception('solidearthsettings checkconsistency error message: need selfattraction on if elastic flag is set')
++        if self.viscous and not self.elastic:
++            raise Exception('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set')
+ 
+         # A GRD computation has been requested, make some checks on the nature of the meshes provided
+         if self.isgrd:
+@@ -118,6 +123,8 @@
+                 else:
+                     if self.grdmodel == 1:
+                         raise RuntimeException('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)')
++            if self.sealevelloading and not self.grdocean:
++                raise RuntimeException('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set')
+ 
+         if self.compute_bp_grd and not md.solidearth.settings.isgrd:
+             raise RuntimeException('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on')
+@@ -125,25 +132,27 @@
+         return md
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid):  #{{{
++    def marshall(self, prefix, md, fid): #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rigid', 'name', 'md.solidearth.settings.rigid', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'computesealevelchange', 'name', 'md.solidearth.settings.computesealevelchange', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname','isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname','glfraction', 'name', 'md.solidearth.settings.glfraction', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer')
+     #}}}
+ 
+-    def extrude(self, md):  #{{{
++    def extrude(self, md): #{{{
+         return self
+     #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26299-26300.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26299-26300.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26299-26300.diff	(revision 26740)
@@ -0,0 +1,4983 @@
+Index: ../trunk-jpl/src/m/array/arrayoperations.js
+===================================================================
+--- ../trunk-jpl/src/m/array/arrayoperations.js	(revision 26299)
++++ ../trunk-jpl/src/m/array/arrayoperations.js	(revision 26300)
+@@ -53,7 +53,7 @@
+     var size, array, arg, initial;
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array) {
++        if (arg instanceof Array || arg instanceof Float64Array) {
+             size = arg.length;
+             array = arg;
+ 			initial = a;
+@@ -63,9 +63,9 @@
+ 	//check internal consistency of arrays provided!: 
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array && arg.length != size) {
++        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
+             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
+-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
++        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
+             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
+         }
+ 	}
+@@ -74,11 +74,11 @@
+ 	for (var a = 0; a < arguments.length; a++) {
+ 		if (a != initial) {
+ 			arg = arguments[a];
+-			if (arg instanceof Array) {
++			if (arg instanceof Array || arg instanceof Float64Array) {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] += arg[i];
+ 				}
+-			} else if (typeof arg != 'number') {
++			} else if (typeof arg === 'number') {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] += arg;
+ 				}
+@@ -93,7 +93,7 @@
+     var size, array, arg, initial;
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array) {
++        if (arg instanceof Array || arg instanceof Float64Array) {
+             size = arg.length;
+             array = arg;
+ 			initial = a;
+@@ -103,9 +103,9 @@
+ 	//check internal consistency of arrays provided!: 
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array && arg.length != size) {
++        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
+             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
+-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
++        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
+             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
+         }
+ 	}
+@@ -114,11 +114,11 @@
+ 	for (var a = 0; a < arguments.length; a++) {
+ 		if (a !== initial) {
+ 			arg = arguments[a];
+-			if (arg instanceof Array) {
++			if (arg instanceof Array || arg instanceof Float64Array) {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] -= arg[i];
+ 				}
+-			} else if (typeof arg != 'number') {
++			} else if (typeof arg === 'number') {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] -= arg;
+ 				}
+@@ -127,6 +127,52 @@
+ 	}
+ 	return result;
+ } //}}}
++function ArraySubtract2D(){ //{{{
++    //Takes in any number of scalars or arrays, and calculates the subtraction. Scalars are treated as similar length arrays of the scalar.
++    //Determine reference array and size
++    var size, array, arg, initial;
++	for (var a = 0; a < arguments.length; a++) {
++        arg = arguments[a];
++        if (arg instanceof Array || arg instanceof Float64Array) {
++            size = arg.length;
++            array = arg;
++			initial = a;
++            break;
++        }
++    }
++	//check internal consistency of arrays provided!: 
++	for (var a = 0; a < arguments.length; a++) {
++        arg = arguments[a];
++        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
++            throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
++        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
++            throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
++        }
++	}
++	//calculate the result, using the first argument to initialize:
++	var result = [];
++	for (var a = 0; a < arguments.length; a++) {
++		if (a !== initial) {
++			arg = arguments[a];
++			if (arg instanceof Array || arg instanceof Float64Array) {
++				for(var i = 0; i < array.length; i++){
++					result[i] = [];
++					for(var j = 0; j < array[i].length; j++){
++					    result[i][j] = array[i][j] - arg[i][j];
++					}
++				}
++			} else if (typeof arg === 'number') {
++				for(var i = 0; i < array.length; i++){
++					result[i] = [];
++					for(var j = 0; j < array[i].length; j++){
++					    result[i][j] = array[i][j] - arg;
++					}
++				}
++			}
++        }
++	}
++	return result;
++} //}}}
+ function ArrayMultiply(){ //{{{
+     //Takes in any number of scalars or arrays, and calculates the product. Scalars are treated as similar length arrays of the scalar.
+     //Determine reference array and size
+@@ -133,7 +179,7 @@
+     var size, array, arg, initial;
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array) {
++        if (arg instanceof Array || arg instanceof Float64Array) {
+             size = arg.length;
+             array = arg;
+ 			initial = a;
+@@ -143,9 +189,9 @@
+ 	//check internal consistency of arrays provided!: 
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array && arg.length != size) {
++        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
+             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
+-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
++        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
+             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
+         }
+ 	}
+@@ -154,11 +200,11 @@
+ 	for (var a = 0; a < arguments.length; a++) {
+ 		if (a !== initial) {
+ 			arg = arguments[a];
+-			if (arg instanceof Array) {
++			if (arg instanceof Array || arg instanceof Float64Array) {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] *= arg[i];
+ 				}
+-			} else if (typeof arg != 'number') {
++			} else if (typeof arg === 'number') {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] *= arg;
+ 				}
+@@ -173,7 +219,7 @@
+     var size, array, arg, initial;
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array) {
++        if (arg instanceof Array || arg instanceof Float64Array) {
+             size = arg.length;
+             array = arg;
+ 			initial = a;
+@@ -183,9 +229,9 @@
+ 	//check internal consistency of arrays provided!: 
+ 	for (var a = 0; a < arguments.length; a++) {
+         arg = arguments[a];
+-        if (arg instanceof Array && arg.length != size) {
++        if ((arg instanceof Array || arg instanceof Float64Array) && arg.length != size) {
+             throw Error("ArrayAdd error message: arrays provided as arguments are not of the same length!");
+-        } else if (!(arg instanceof Array) && typeof arg != 'number') {
++        } else if (!(arg instanceof Array || arg instanceof Float64Array) && typeof arg != 'number') {
+             throw Error("ArrayAdd error message: arguments provided are not of the type Array or Number!");
+         }
+ 	}
+@@ -194,11 +240,11 @@
+ 	for (var a = 0; a < arguments.length; a++) {
+ 		if (a !== initial) {
+ 			arg = arguments[a];
+-			if (arg instanceof Array) {
++			if (arg instanceof Array || arg instanceof Float64Array) {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] /= arg[i];
+ 				}
+-			} else if (typeof arg != 'number') {
++			} else if (typeof arg === 'number') {
+ 				for(var i = 0; i < result.length; i++){
+ 					result[i] /= arg;
+ 				}
+@@ -281,29 +327,6 @@
+ 	return sum;
+ 
+ } //}}}
+-function ArrayOr(){ //{{{
+-    if (arguments.length<2)throw Error("ArrayOr error message: sum has to be for at least two arrays!");
+-
+-	//check internal consistency of arrays provided!: 
+-	var firstarray=arguments[0];
+-	var firstsize=firstarray.length;
+-	
+-	for(var a=1;a<arguments.length;a++){
+-		var array=arguments[a];
+-		if(array.length!=firstsize)throw Error("ArrayOr error message: arrays provided as arguments are not of the same length!");
+-	}
+-
+-	//do the or:
+-	var or=NewArrayFill(firstsize,0);
+-	for(var a=0;a<arguments.length;a++){
+-		var array=arguments[a];
+-		for(var i=0;i<array.length;i++){
+-			or[i] = or[i] | array[i];
+-		}
+-	}
+-	return or;
+-
+-} //}}}
+ function ArrayConcat(a, b) { //{{{
+ 	// Make sure that both typed arrays are of the same type
+ 	if(Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {
+@@ -321,24 +344,24 @@
+ 	return c;
+ } //}}}
+ function ArrayCol(matrix, cols) { //{{{
+-    var column = [];
+-    if (cols instanceof Array) {
++    var columns = [];
++    if (cols instanceof Array || cols instanceof Float64Array) {
+         for (var i = 0; i < matrix.length; i++){
+-            var row = [];
+-            for (var j = cols[0]; j <= cols[1]; j++){
+-                row.push(matrix[i][j]);
++            var col = [];
++            for (var j = 0; j < cols.length; j++){
++                col.push(matrix[i][cols[j]]);
+             }
+-            column.push(row); 
++            columns.push(col); 
+         }
+ 
+     } else if (typeof cols == 'number') {
+         for (var i = 0; i < matrix.length; i++){
+-            column.push(matrix[i][cols]);
++            columns.push(matrix[i][cols]);
+         }
+     } else {
+         throw new Error("ArrayCol error: cols must be a single integer or an array with 2 integers!");
+     }
+-   return column;
++   return columns;
+ } //}}}
+ function ListToMatrix(list, elementsPerSubArray) { //{{{
+ 	var matrix = [], i, k;
+@@ -444,19 +467,150 @@
+     }
+     return 0;
+ } //}}}
+-function ArrayUnique(arr) { //{{{
++function ArrayUnique(arr,rows) { //{{{
++	if (arguments.length == 2){
++		if (rows == 'rows') {
++			//See Matlab unique function and https://stackoverflow.com/a/20339709/1905613
++			let equals = (a, b) => JSON.stringify(a) === JSON.stringify(b);
++			let uniques = [];
++			let indexA = [];
++			let indexC = [];
++			let itemsFound = {};;
++			for(let i = 0, l = arr.length; i < l; i++) {
++				let stringified = JSON.stringify(arr[i]);
++				if (typeof(itemsFound[stringified]) != 'undefined') {
++					indexC.push(itemsFound[stringified]);
++					continue;
++				}
++				uniques.push(arr[i]);
++				indexA.push(i);
++				itemsFound[stringified] = uniques.length-1;
++				indexC.push(itemsFound[stringified]);
++			}
++			//assert arr == uniques[indexC,:];
++			for (let i = 0; i < indexC.length; i++) {
++				if (!equals(arr[i], uniques[indexC[i]])) {
++					throw new Error('bad implementation');	
++				}
++			}
++			//assert uniques == arr[indexA, :];
++			for (let i = 0; i < indexA.length; i++) {
++				if (!equals(uniques[i], arr[indexA[i]])) {
++					throw new Error('bad implementation');	
++				}
++			}
++			let [uniquesSorted, indexInToOut, indexOutToIn] = ArraySortWithIndices(uniques);
++			//indexMapping is the index of the edge in the old array
++			indexCSorted = []; //indexC.length == arr.length
++			//assert uniquesSorted[i,:] = uniques[indexInToOut[i],:]
++			for (let i = 0; i < indexInToOut.length; i++) {
++				if (!equals(uniquesSorted[i], uniques[indexInToOut[i]])) {
++					console.log(i, uniquesSorted[indexInToOut[i]], uniques[i]);
++					throw new Error('bad implementation');	
++				}
++			}
++			//assert uniques[i,:] = uniquesSorted[indexOutToIn[i],:]
++			for (let i = 0; i < indexOutToIn.length; i++) {
++				if (!equals(uniques[i], uniquesSorted[indexOutToIn[i]])) {
++					console.log(i, uniques[indexOutToIn[i]], uniquesSorted[i]);
++					throw new Error('bad implementation');	
++				}
++			}
++			//GOAL: assert arr[i,:] == uniquesSorted[indexCSorted[i], :]
++			//GIVEN: assert arr[i,:] == uniques[indexC[i],:];
++			//GIVEN: assert uniquesSorted[i,:] = uniques[indexInToOut[i],:]
++			//GIVEN: assert uniques[i,:] = uniquesSorted[indexOutToIn[i],:]
++			//assert uniques[indexC[i],:] == uniquesSorted[indexOutToIn[indexC[i]],:]
++			//assert uniquesSorted[indexCSorted[i],:]; == uniquesSorted[indexOutToIn[indexC[i]],:];
++			for (let i = 0; i < arr.length; i++) {
++				indexCSorted[i] = indexOutToIn[indexC[i]];
++			}
++			for (let i = 0; i < indexC.length; i++) {
++				if (!equals(arr[i], uniquesSorted[indexCSorted[i]])) {
++					console.log(i, arr[i], uniquesSorted[indexCSorted[i]]);
++					throw new Error('bad implementation');	
++				}
++			}
+ 
+-	return arr.reverse().filter(function (e, i, arr) {
+-		    return arr.indexOf(e, i+1) === -1;
+-	}).reverse();
++			indexASorted = []; //indexA.length == uniques.length
++			//GOAL: uniquesSorted[i, :] == arr[indexASorted[i], :]
++			//GIVEN: assert arr[i,:] == uniques[indexC[i],:];
++			//GIVEN: assert arr[indexA[i],:] == uniques[i,:];
++			//GIVEN: assert uniques[indexInToOut[i],:] == uniquesSorted[i,:]
++			//GIVEN: assert uniques[i,:] = uniquesSorted[indexOutToIn[i],:]
++			//assert uniquesSorted[i,:] == uniques[indexInToOut[i],:]
++			//assert uniques[indexInToOut[i],:] == arr[indexA[indexInToOut[i]],:];
++			//assert indexA[indexInToOut] == indexASorted
++			//indexASorted == indexA[indexMapping[i]]
++			for (let i = 0; i < indexA.length; i++) {
++				indexASorted[i] = indexA[indexInToOut[i]];
++			}
++			//assert uniques == arr[indexA, :];
++			for (let i = 0; i < indexASorted.length; i++) {
++				if (!equals(uniquesSorted[i], arr[indexASorted[i]])) {
++					throw new Error('bad implementation');	
++				}
++			}
++			console.log('Good uniques');
++			return [uniquesSorted, indexASorted, indexCSorted];
++		} else {
++			throw new Error('ArrayUnique non "rows" not supported');	
++		}
++	} else {
++		return arr.reverse().filter(function (e, i, arr) {
++				return arr.indexOf(e, i+1) === -1;
++		}).reverse();
++	}
+ } //}}}
+-function ArraySort(array) { //{{{
+-
+-	return array.sort(function(a, b) {
+-		return a - b;
+-	});
+-
++function ArraySortWithIndices(toSort, sortingFunction) { //{{{
++	//returns the sorted and index such that toSort[index[i]] == sorted[i]
++	let toSortCopy = [];
++	for (var i = 0; i < toSort.length; i++) {
++	    toSortCopy[i] = [toSort[i], i];
++	}
++	if (typeof(sortingFunction) == 'undefined') {
++		let numeric2DFunction = function(a, b) {
++			if (a[0][0] == b[0][0]) {
++                return a[0][1] - b[0][1];
++			} else {
++			    return a[0][0] - b[0][0];
++			}
++		};
++		sortingFunction = numeric2DFunction;
++	}
++	toSortCopy.sort(sortingFunction);
++	let indicesInToOut = [];
++	let indicesOutToIn = [];
++	let sorted = [];
++	for (var j = 0; j < toSortCopy.length; j++) {
++	    indicesInToOut[j] = toSortCopy[j][1];
++	    indicesOutToIn[toSortCopy[j][1]] = j;
++	    sorted[j] = toSortCopy[j][0];
++	}
++	return [sorted, indicesInToOut, indicesOutToIn];
+ } //}}}
++function ArraySort(array,dim) { //{{{
++	let numericFunction = function(a, b) {
++	    return a - b;
++	};
++	let numeric2DFunction = function(a, b) {
++	    return a[0] - b[0];
++	};
++	if (arguments.length == 2){
++		if (dim == 1) {
++			array.sort(numeric2DFunction);
++		} else if (dim == 2) {
++			for (let i = 0; i < array.length; i++) {
++				array[i].sort(numericFunction);
++			}
++		} else {
++			throw new Error('ArraySort dim > 2 not yet supported')
++		}
++		return array;
++	} else {
++		return array.sort(numericFunction);
++	}
++} //}}}
+ function ArrayRange(lower, upper) { //{{{
+ 
+     var range = upper - lower + 1;
+@@ -514,11 +668,104 @@
+ 	return 0;
+ } //}}}
+ function ArrayAnd(array1,array2) { //{{{
++	var array = new Array(array1.length);
++	for (var i=0;i<array1.length;i++) {
++		array[i]=array1[i] & array2[i];
++	}
++	return array;
++} //}}}
++function ArrayOr(array1,array2) { //{{{
++	var array = new Array(array1.length);
++	for (var i=0;i<array1.length;i++) {
++		array[i]=array1[i] | array2[i];
++	}
++	return array;
++} //}}}
++function ArrayEqual(array1,array2) { //{{{
++	var array = new Array(array1.length);
+ 
+-	var array=array1;
+-	for (var i=0;i<array1.length;i++)array[i]=array1[i] & array2[i];
++	if (typeof(array1[0]) == 'number') {
++		if (typeof(array2) == 'number') {
++			for(var i=0;i<array1.length;i++){
++				array[i] = array1[i] == array2;
++			}
++		} else {
++			for(var i=0;i<array1.length;i++){
++				array[i] = array1[i] == array2[i];
++			}
++		}
++	} else { //provide support for 2d arrays
++		if (typeof(array2) == 'number') {
++			for(var i=0;i<array1.length;i++){
++				array[i] = new Array(array1[i].length);
++				for(var j=0;j<array1[i].length;j++){
++					array[i][j] = array1[i][j] == array2;
++				}
++			}
++		} else {
++			for(var i=0;i<array1.length;i++){
++				array[i] = new Array(array1[i].length);
++				for(var j=0;j<array1[i].length;j++){
++					array[i][j] = array1[i][j] == array2[i][j];
++				}
++			}
++		}
++	}
+ 	return array;
+ } //}}}
++function ArrayLessThan(array1,array2) { //{{{
++	var array = new Array(array1.length);
++
++	if (typeof(array2) == 'number') {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] < array2;
++		}
++	} else {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] < array2[i];
++		}
++	}
++	return array;
++} //}}}
++function ArrayGreaterThan(array1,array2) { //{{{
++	var array = new Array(array1.length);
++	if (typeof(array2) == 'number') {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] > array2;
++		}
++	} else {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] > array2[i];
++		}
++	}
++	return array;
++} //}}}
++function ArrayLessEqualThan(array1,array2) { //{{{
++	var array = new Array(array1.length);
++	if (typeof(array2) == 'number') {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] <= array2;
++		}
++	} else {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] <= array2[i];
++		}
++	}
++	return array;
++} //}}}
++function ArrayGreaterEqualThan(array1,array2) { //{{{
++	var array = new Array(array1.length);
++	if (typeof(array2) == 'number') {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] >= array2;
++		}
++	} else {
++		for(var i=0;i<array1.length;i++){
++			array[i] = array1[i] >= array2[i];
++		}
++	}
++	return array;
++} //}}}
+ function ArrayIsMember(array1,array2) { //{{{
+ 
+ 	var array=NewArrayFill(array1.length,0);
+@@ -550,7 +797,7 @@
+ 
+ 	return arr;
+ } //}}}
+-function NewArrayFillIncrement(size,start,increment) { //{{{
++function NewArrayFillIncrement(start,size,increment) { //{{{
+ 	var array=new Array(size); 
+ 
+ 	for(var i=0;i<size;i++){
+@@ -559,6 +806,12 @@
+ 
+ 	return array;
+ } //}}}
++function ones(size) { //{{{
++	return NewArrayFill(size,1);
++} //}}}
++function zeros(size) { //{{{
++	return NewArrayFill(size,0);
++} //}}}
+ function ArrayFind(array,value) { //{{{
+ 	var count=0;
+ 	var indices=[];
+@@ -611,6 +864,32 @@
+ 	}
+ 	return indices;
+ } //}}}
++function ArrayIndex(array1,array2,value) { //{{{
++	//Change behavior between get (if no value is provided) to set (if value to set is provided)
++	if (arguments.length == 2){
++		let data = []
++		if (typeof(array2[0]) == 'number') {
++			for (let i=0;i<array2.length;i++){
++				data.push(array1[array2[i]]);
++			}
++		} else {
++			//2d index array
++			for (let i=0;i<array2.length;i++){
++				let data2 = [];
++				for (let j=0;j<array2[i].length;j++){
++				    data2.push(array1[array2[i][j]]);
++				}
++				data.push(data2);
++			}
++		}
++		return data;
++	} else {
++		for (var i=0;i<array2.length;i++){
++			array1[array2[i]]=value;
++		}
++		return array1;
++	}
++} //}}}
+ function Create2DArray(rows,cols) { //{{{
+ 	var arr=new Array(rows); 
+ 
+@@ -643,7 +922,7 @@
+ 	}
+ 
+ 	// Handle Array
+-	if (obj instanceof Array) {
++	if (obj instanceof Array || arg instanceof Float64Array) {
+ 		copy = [];
+ 		for (var i = 0, len = obj.length; i < len; i++) {
+ 			copy[i] = clone(obj[i]);
+Index: ../trunk-jpl/src/m/classes/SMBforcing.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBforcing.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/SMBforcing.js	(revision 26300)
+@@ -11,7 +11,12 @@
+ 	this.disp = function(){ // {{{
+ 		console.log(sprintf('   surface forcings parameters:'));
+ 		fielddisplay(this,'mass_balance','surface mass balance [m/yr ice eq]');
++		fielddisplay(this,'steps_per_step', 'number of smb steps per time step');
+ 		fielddisplay(this,'requested_outputs','additional outputs requested');
++		fielddisplay(this,'averaging','averaging methods from short to long steps');
++		console.log(sprintf('%51s  0: Arithmetic (default)',' '));
++		console.log(sprintf('%51s  1: Geometric',' '));
++		console.log(sprintf('%51s  2: Harmonic',' '));
+ 	} // }}}
+ 	this.defaultoutputs = function(){ // {{{
+ 		return '';
+@@ -32,7 +37,7 @@
+ 
+     } // }}}
+     this.checkconsistency = function(md,solution,analyses) { //{{{
+-
++		if (solution=='TransientSolution' && md.transient.issmb == 0) return;
+         if(ArrayAnyEqual(ArrayIsMember('MasstransportAnalysis',analyses),1)){
+             checkfield(md,'fieldname','smb.mass_balance','timeseries',1,'NaN',1,'Inf',1);
+         }
+@@ -39,8 +44,9 @@
+         if(ArrayAnyEqual(ArrayIsMember('BalancethicknessAnalysis',analyses),1)){
+             checkfield(md,'fieldname','smb.mass_balance','size',[md.mesh.numberofvertices,1],'NaN',1,'Inf',1);
+         }
+-        checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+-
++		checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
++		checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
++		checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0,1,2]);
+     } // }}}
+     this.marshall=function(md,prefix,fid) { //{{{
+ 
+@@ -48,6 +54,8 @@
+ 
+         WriteData(fid,prefix,'name','md.smb.model','data',1,'format','Integer');
+         WriteData(fid,prefix,'object',this,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++		WriteData(fid,prefix,'object',this,'fieldname','steps_per_step','format','Integer');
++		WriteData(fid,prefix,'object',this,'fieldname','averaging','format','Integer');
+ 
+         //process requested outputs
+         var outputs = this.requested_outputs.slice();
+@@ -65,8 +73,10 @@
+     }//}}}
+ 	//properties 
+     // {{{
+-	this.mass_balance = NaN;
+-	this.requested_outputs      = [];
++	this.mass_balance 	   = NaN;
++	this.requested_outputs = [];
++	this.steps_per_step    = 1;
++	this.averaging         = 0;
+ 	this.setdefaultparameters();
+     // }}}
+ }
+Index: ../trunk-jpl/src/m/classes/amr.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/amr.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/amr.js	(revision 26300)
+@@ -6,12 +6,22 @@
+ function amr (){
+ 	//methods
+ 	this.setdefaultparameters = function(){// {{{
++
++		//hmin and hmax
+ 		this.hmin								= 100.;
+ 		this.hmax								= 100.e3;
++
++		//fields
+ 		this.fieldname							= "Vel";
+ 		this.err								= 3.;
++
++		//keep metric?
+ 		this.keepmetric							= 1;
++
++		//control of element lengths
+ 		this.gradation							= 1.5;
++
++		//other criterias
+ 		this.groundingline_resolution			= 500.;
+ 		this.groundingline_distance				= 0;
+ 		this.icefront_resolution				= 500;
+@@ -24,6 +34,9 @@
+ 		this.deviatoricerror_threshold			= 0;	
+ 		this.deviatoricerror_groupthreshold		= 0;	
+ 		this.deviatoricerror_maximum			= 0;	
++
++		//is restart? This calls femmodel->ReMesh() before first time step. 
++		this.restart							= 0;
+ 	}// }}}
+ 	this.disp= function(){// {{{
+ 		console.log(sprintf('   amr parameters:'));
+@@ -44,6 +57,8 @@
+ 		fielddisplay(this,'deviatoricerror_threshold','maximum threshold deviatoricstress error permitted');
+ 		fielddisplay(this,'deviatoricerror_groupthreshold','maximum group threshold deviatoricstress error permitted');
+ 		fielddisplay(this,'deviatoricerror_maximum','maximum deviatoricstress error permitted');
++		fielddisplay(this,'deviatoricerror_maximum','maximum deviatoricstress error permitted');
++		fielddisplay(this,'restart','indicates if ReMesh() will call before first time step');
+ 	}// }}}
+ 	this.classname= function(){// {{{
+ 		return "amr";
+@@ -66,6 +81,7 @@
+ 		checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);
+ 		checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
+ 		checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
++		checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1);
+ 	} // }}}
+ 	this.marshall=function(md,prefix,fid) { //{{{
+ 		WriteData(fid,prefix,'name','md.amr.type','data',1,'format','Integer');
+@@ -87,6 +103,7 @@
+ 		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_threshold','format','Double');
+ 		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_groupthreshold','format','Double');
+ 		WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_maximum','format','Double');
++		WriteData(fid,prefix,'object',this,'fieldname','restart','format','Integer');
+ 	}//}}}
+ 	this.fix=function() { //{{{
+ 	}//}}}
+@@ -110,6 +127,7 @@
+ 	this.deviatoricerror_threshold			= 0.;
+ 	this.deviatoricerror_groupthreshold		= 0.;
+ 	this.deviatoricerror_maximum			= 0.;
++	this.restart							= 0.;
+ 
+ 	this.setdefaultparameters();
+ 	//}}}
+Index: ../trunk-jpl/src/m/classes/balancethickness.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/balancethickness.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/balancethickness.js	(revision 26300)
+@@ -39,6 +39,9 @@
+ 			WriteData(fid,prefix,'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1/yts);
+ 			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
++
++			WriteData(fid,prefix,'object',this,'fieldname','slopex','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',this,'fieldname','slopey','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','omega','format','DoubleMat','mattype',1);
+ 
+ 		}//}}}
+@@ -52,7 +55,10 @@
+ 	this.spcthickness      = NaN;
+ 	this.thickening_rate   = NaN;
+ 	this.stabilization     = 0;
++
+ 	this.omega             = NaN;
++	this.slopex            = NaN;
++	this.slopey            = NaN;
+ 	this.setdefaultparameters();
+ 	//}}}
+ }
+Index: ../trunk-jpl/src/m/classes/calving.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/calving.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/calving.js	(revision 26300)
+@@ -34,6 +34,7 @@
+ 		}//}}}
+ 		this.fix=function() { //{{{
+ 			this.calvingrate=NullFix(this.calvingrate,NaN);
++			this.meltingrate=NullFix(this.meltingrate,NaN);
+ 		}//}}}
+ 	//properties 
+ 	// {{{
+Index: ../trunk-jpl/src/m/classes/constants.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/constants.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/constants.js	(revision 26300)
+@@ -18,6 +18,9 @@
+ 
+ 			//the reference temperature for enthalpy model (cf Aschwanden)
+ 			this.referencetemperature=223.15;
++
++			//gravitational constant: 
++			this.gravitational_constant = 6.67259e-11;
+ 		}// }}}
+ 		this.disp = function () { //{{{
+ 			console.log(sprintf("   Constants parameters:")); 
+@@ -26,6 +29,7 @@
+ 			fielddisplay(this,'omega','angular velocity of Earth [rad/s]');
+ 			fielddisplay(this,'yts','number of seconds in a year [s/yr]');
+ 			fielddisplay(this,'referencetemperature','reference temperature used in the enthalpy model [K]');
++			fielddisplay(this,'gravitational_constant','Newtonian constant of gravitation [m^3/kg/s^2]');
+ 
+ 		} //}}}
+ 		this.classname = function () { //{{{
+@@ -38,6 +42,7 @@
+ 			checkfield(md,'fieldname','constants.omega','>=',0,'size',[1,1]);
+ 			checkfield(md,'fieldname','constants.yts','>',0,'size',[1,1]);
+ 			checkfield(md,'fieldname','constants.referencetemperature','size',[1,1]);
++			checkfield(md,'fieldname','constants.gravitational_constant','size',[1,1]);
+ 
+ 		} // }}}
+ 		this.marshall=function(md,prefix,fid) { //{{{
+@@ -44,15 +49,17 @@
+ 			WriteData(fid,prefix,'object',this,'fieldname','g','format','Double');
+ 			WriteData(fid,prefix,'object',this,'fieldname','yts','format','Double');
+ 			WriteData(fid,prefix,'object',this,'fieldname','referencetemperature','format','Double');
++			WriteData(fid,prefix,'object',this,'fieldname','gravitational_constant','format','Double');
+ 		}//}}}
+ 		this.fix=function() { //{{{
+ 		}//}}}
+ 	//properties 
+ 	// {{{
+-		this.g                    = 0.;
+-		this.omega                = 0.;
+-		this.yts                  = 0.;
+-		this.referencetemperature = 0.;
++		this.g						  = 0.;
++		this.omega					  = 0.;
++		this.yts					  = 0.;
++		this.referencetemperature	  = 0.;
++		this.gravitational_constant   = 0.;
+ 		this.setdefaultparameters();
+ 		//}}}
+ }
+Index: ../trunk-jpl/src/m/classes/initialization.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/initialization.js	(revision 26300)
+@@ -16,11 +16,18 @@
+ 		fielddisplay(this,'vel','velocity norm [m/yr]');
+ 		fielddisplay(this,'pressure','pressure field [Pa]');
+ 		fielddisplay(this,'temperature','temperature [K]');
++		fielddisplay(this,'enthalpy','enthalpy [J]');
+ 		fielddisplay(this,'waterfraction','fraction of water in the ice');
+ 		fielddisplay(this,'sediment_head','sediment water head of subglacial system [m]');
+ 		fielddisplay(this,'epl_head','epl water head of subglacial system [m]');
+ 		fielddisplay(this,'epl_thickness','epl layer thickness [m]');
+-		fielddisplay(this,'watercolumn','thickness of subglacial water [m]');
++		fielddisplay(this,'watercolumn','subglacial water sheet thickness (for Shreve and GlaDS) [m]');
++		fielddisplay(this,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]');
++		fielddisplay(this,'channelarea','subglacial water channel area (for GlaDS) [m2]');
++		fielddisplay(this,'sample','Realization of a Gaussian random field');
++		fielddisplay(this,'bottompressure','Bottom pressures');
++		fielddisplay(this,'dsl','Dynamic sea level.');
++		fielddisplay(this,'str','Steric sea level.');
+ 
+ 	}// }}}
+     this.extrude = function(md) {//{{{
+@@ -50,6 +57,13 @@
+ 				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+ 				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+ 			}
++			if(ArrayAnyEqual(ArrayIsMember('OceantransportAnalysis',analyses),1)){
++				if (strcmp(solution,'TransientSolution') && md.transient.isslc && md.transient.isoceantransport) {
++					checkfield(md,'fieldname','initialization.bottompressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
++					checkfield(md,'fieldname','initialization.dsl','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
++					checkfield(md,'fieldname','initialization.str','NaN',1,'Inf',1,'size',[1, 1]);
++				}
++			}
+ 			if(ArrayAnyEqual(ArrayIsMember('BalancethicknessSolution',analyses),1) & (solution=='BalancethicknessSolution')){
+ 				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+ 				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+@@ -64,30 +78,47 @@
+ 					}
+ 				}
+ 			}
+-			if(ArrayAnyEqual(ArrayIsMember('ThermalAnalysis',analyses),1)){
++			if ((ArrayAnyEqual(ArrayIsMember('ThermalAnalysis',analyses),1)) && !strcmp(solution,'TransientSolution') && md.transient.isthermal == 0){
+ 				checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+ 				checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+-				if (md.mesh.dimension() == 3){
+-					checkfield(md,'fieldname','initialization.vz','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
++				if (md.mesh.dimension()==3) {
++					checkfield(md,'fieldname','initialization.vz','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+ 				}
+-				checkfield(md,'fieldname','initialization.pressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
+-				checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
++				checkfield(md,'fieldname','initialization.pressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
++				checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size','universal');
+ 			}
+-			if( ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1) & md.thermal.isenthalpy){
+-				checkfield(md,'fieldname','initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices, 1]);
+-				checkfield(md,'fieldname','initialization.watercolumn'  ,'>=',0,'size',[md.mesh.numberofvertices, 1]);
++			if (ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1) && md.thermal.isenthalpy){
++				checkfield(md,'fieldname','initialization.waterfraction','>=',0,'size','universal');
++				checkfield(md,'fieldname','initialization.watercolumn'  ,'>=',0,'size','universal');
+ 			}
+-			if(ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1)){
++			if (ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1)){
+ 				if (md.hydrology.type() == 'hydrologyshreve'){
+ 					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
+ 				}
+ 			}
+-			if(ArrayAnyEqual(ArrayIsMember('HydrologyDCInefficientAnalysis',analyses),1)){
++			if (ArrayAnyEqual(ArrayIsMember('HydrologyTwsAnalysis',analyses),1)){
++				if (md.hydrology.type() == 'hydrologytws'){
++					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
++				}
++			}
++			if (ArrayAnyEqual(ArrayIsMember('SealevelchangeAnalysis',analyses),1)){
++				if (strcmp(solution,'TransientSolution') && md.transient.isslc) {
++					checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
++				}
++			}
++			if (ArrayAnyEqual(ArrayIsMember('HydrologyGlaDSAnalysis',analyses),1)){
++				if (md.hydrology.type() == 'hydrologyglads'){
++					checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
++					checkfield(md,'fieldname','initialization.hydraulic_potential','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
++					checkfield(md,'fieldname','initialization.channelarea','NaN',1,'Inf',1,'>=',0,'size',[md.mesh.numberofedges, 1]);
++				}
++			}
++			if (ArrayAnyEqual(ArrayIsMember('HydrologyDCInefficientAnalysis',analyses),1)){
+ 				if (md.hydrology.type() == 'hydrologydc'){
+ 					checkfield(md,'fieldname','initialization.sediment_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+ 				}
+ 			}
+-			if(ArrayAnyEqual(ArrayIsMember('HydrologyDCEfficientAnalysis',analyses),1)){
++			if (ArrayAnyEqual(ArrayIsMember('HydrologyDCEfficientAnalysis',analyses),1)){
+ 				if (md.hydrology.type() == 'hydrologydc'){
+ 					if (md.hydrology.isefficientlayer==1){
+ 						checkfield(md,'fieldname','initialization.epl_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices ,1]);
+@@ -95,6 +126,11 @@
+ 					}
+ 				}
+ 			}
++			if (ArrayAnyEqual(ArrayIsMember('SamplingAnalysis',analyses),1) && !strcmp(solution,'TransientSolution')&& md.transient.issampling == 0){
++				if (!isNaN(md.initialization.sample)) {
++					checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
++				}
++			}
+ 		} //}}}
+ 		this.marshall=function(md,prefix,fid) { //{{{
+ 
+@@ -104,6 +140,10 @@
+ 			WriteData(fid,prefix,'object',this,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,prefix,'object',this,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,prefix,'object',this,'fieldname','pressure','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',this,'fieldname','sealevel','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',this,'fieldname','bottompressure','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',this,'fieldname','str','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',this,'fieldname','dsl','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','temperature','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','waterfraction','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','sediment_head','format','DoubleMat','mattype',1);
+@@ -110,15 +150,22 @@
+ 			WriteData(fid,prefix,'object',this,'fieldname','epl_head','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','epl_thickness','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','watercolumn','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',this,'fieldname','channelarea','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',this,'fieldname','hydraulic_potential','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',this,'fieldname','sample','format','DoubleMat','mattype',1);
+ 
+ 			if (md.thermal.isenthalpy){
+-				tpmp=NewArrayFill(md.mesh.numberofvertices,0);
+-				for (var i=0;i<md.mesh.numberofvertices;i++) tpmp[i]= md.materials.meltingpoint - md.materials.beta*md.initialization.pressure[i];
+-				enthalpy=NewArrayFill(md.mesh.numberofvertices,0); 
+-				for (var i=0;i<md.mesh.numberofvertices;i++)enthalpy[i] = md.materials.heatcapacity*(md.initialization.temperature[i]-md.constants.referencetemperature);
+-				
+-				for (var i=0;i<md.mesh.numberofvertices;i++)if(md.initialization.temperature[i]>=tpmp[i]){
+-					enthalpy[i] = md.materials.heatcapacity*(tpmp[i] - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[i];
++				let enthalpy;
++				if (isNaN(self.enthalpy) && this.enthalpy.length <= 1) {
++					tpmp=NewArrayFill(md.mesh.numberofvertices,0);
++					for (var i=0;i<md.mesh.numberofvertices;i++) tpmp[i]= md.materials.meltingpoint - md.materials.beta*md.initialization.pressure[i];
++					enthalpy=NewArrayFill(md.mesh.numberofvertices,0); 
++					for (var i=0;i<md.mesh.numberofvertices;i++)enthalpy[i] = md.materials.heatcapacity*(md.initialization.temperature[i]-md.constants.referencetemperature);
++					for (var i=0;i<md.mesh.numberofvertices;i++)if(md.initialization.temperature[i]>=tpmp[i]){
++						enthalpy[i] = md.materials.heatcapacity*(tpmp[i] - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[i];
++					}
++				} else {
++					enthalpy = this.enthalpy;
+ 				}
+ 				WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
+ 			}
+@@ -135,17 +182,25 @@
+ 		}//}}}
+ 	//properties 
+ 	// {{{
+-	this.vx            = NaN;
+-	this.vy            = NaN;
+-	this.vz            = NaN;
+-	this.vel           = NaN;
+-	this.pressure      = NaN;
+-	this.temperature   = NaN;
+-	this.waterfraction = NaN;
+-	this.sediment_head = NaN;
+-	this.epl_head      = NaN;
+-	this.epl_thickness = NaN;
+-	this.watercolumn   = NaN;
++	this.vx                  = NaN;
++	this.vy                  = NaN;
++	this.vz                  = NaN;
++	this.vel                 = NaN;
++	this.pressure            = NaN;
++	this.temperature         = NaN;
++	this.enthalpy            = NaN;
++	this.waterfraction       = NaN;
++	this.sediment_head       = NaN;
++	this.epl_head            = NaN;
++	this.epl_thickness       = NaN;
++	this.watercolumn         = NaN;
++	this.hydraulic_potential = NaN;
++	this.channelarea         = NaN;
++	this.sealevel            = NaN;
++	this.bottompressure      = NaN;
++	this.dsl                 = NaN;
++	this.str                 = NaN;
++	this.sample              = NaN;
+ 	this.setdefaultparameters();
+ 
+ 	//}}}
+Index: ../trunk-jpl/src/m/classes/inversion.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversion.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/inversion.js	(revision 26300)
+@@ -139,6 +139,7 @@
+ 			WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer');
+ 			WriteData(fid,prefix,'object',this,'fieldname','iscontrol','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','incomplete_adjoint','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1/yts);
+ 			if (!this.iscontrol) return;
+ 			WriteData(fid,prefix,'object',this,'fieldname','nsteps','format','Integer');
+ 			WriteData(fid,prefix,'object',this,'fieldname','maxiter_per_step','format','IntMat','mattype',3);
+Index: ../trunk-jpl/src/m/classes/issmsettings.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/issmsettings.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/issmsettings.js	(revision 26300)
+@@ -4,91 +4,96 @@
+ //      issmsettings=new issmsettings();
+ 
+ function issmsettings (){
+-	//methods
+-	this.setdefaultparameters = function(){// {{{
+-		//are we short in memory ? (0 faster but requires more memory)
+-		this.lowmem=0;
++    //methods
++    this.setdefaultparameters = function(){// {{{
++        //are we short in memory ? (0 faster but requires more memory)
++        this.lowmem=0;
+ 
+-		//i/o:
+-		this.io_gather=1;
++        //i/o:
++        this.io_gather=1;
+ 
+-		//results frequency by default every step
+-		this.output_frequency=1;
++        //results frequency by default every step
++        this.output_frequency=1;
+ 
+-		//checkpoints frequency, by default never: 
+-		this.checkpoint_frequency=0;
++        //coupling frequency of the stress balance solver by default every step
++        this.sb_coupling_frequency=1;
+ 
+-		//this option can be activated to load automatically the results
+-		//onto the model after a parallel run by waiting for the lock file
+-		//N minutes that is generated once the solution has converged
+-		//0 to deactivate
+-		this.waitonlock=Infinity;
++        //checkpoints frequency, by default never:
++        this.checkpoint_frequency=0;
+ 
+-		//upload options: 
+-		upload_port         = 0;
+-		
+-		//throw an error if solver residue exceeds this value
+-		this.solver_residue_threshold=1e-6;
++        //this option can be activated to load automatically the results
++        //onto the model after a parallel run by waiting for the lock file
++        //N minutes that is generated once the solution has converged
++        //0 to deactivate
++        this.waitonlock=Infinity;
+ 
+-	}// }}}
+-	this.disp= function(){// {{{
+-		console.log(sprintf('   issmsettings class echo:'));
+-		
+-		fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
+-		fielddisplay(this,'io_gather','I/O gathering strategy for result outputs (default 1)');
+-		fielddisplay(this,'lowmem','is the memory limited ? (0 or 1)');
+-		fielddisplay(this,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
+-		fielddisplay(this,'checkpoint_frequency','frequency at which the runs are being recorded, allowing for a restart');
+-		fielddisplay(this,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
+-		fielddisplay(this,'upload_server','server hostname where model should be uploaded');
+-		fielddisplay(this,'upload_path','path on server where model should be uploaded');
+-		fielddisplay(this,'upload_login','server login');
+-		fielddisplay(this,'upload_port','port login (default is 0)');
+-		fielddisplay(this,'upload_filename','unique id generated when uploading the file to server');
+-		fielddisplay(this,'solver_residue_threshold','throw an error if solver residue exceeds this value');
++        //upload options:
++        this.upload_port         = 0;
+ 
++        //throw an error if solver residue exceeds this value
++        this.solver_residue_threshold=1e-6;
+ 
+-	}// }}}
+-	this.classname= function(){// {{{
+-		return "issmsettings";
++    }// }}}
++    this.disp= function(){// {{{
++        console.log(sprintf('   issmsettings class echo:'));
+ 
+-	}// }}}
+-		this.checkconsistency = function(md,solution,analyses) { // {{{
++        fielddisplay(this,'results_on_nodes','results are output for all the nodes of each element');
++        fielddisplay(this,'io_gather','I/O gathering strategy for result outputs (default 1)');
++        fielddisplay(this,'lowmem','is the memory limited ? (0 or 1)');
++        fielddisplay(this,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
++        fielddisplay(this,'checkpoint_frequency','frequency at which the runs are being recorded, allowing for a restart');
++        fielddisplay(this,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
++        fielddisplay(this,'upload_server','server hostname where model should be uploaded');
++        fielddisplay(this,'upload_path','path on server where model should be uploaded');
++        fielddisplay(this,'upload_login','server login');
++        fielddisplay(this,'upload_port','port login (default is 0)');
++        fielddisplay(this,'upload_filename','unique id generated when uploading the file to server');
++        fielddisplay(this,'solver_residue_threshold','throw an error if solver residue exceeds this value');
+ 
+-			checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
+-			checkfield(md,'fieldname','settings.checkpoint_frequency','numel',[1],'>=',0);
+-			checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
+-			checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
+-		} // }}}
+-		this.marshall=function(md,prefix,fid) { //{{{
+-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','results_on_nodes','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','io_gather','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','lowmem','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','output_frequency','format','Integer');
+-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','checkpoint_frequency','format','Integer');
+-			WriteData(fid,prefix,'object',this,'class','settings','fieldname','solver_residue_threshold','format','Double');
+-			if (this.waitonlock>0) WriteData(fid,prefix,'name','md.settings.waitonlock','data',true,'format','Boolean');
+-			else WriteData(fid,prefix,'name','md.settings.waitonlock','data',false,'format','Boolean');
+-		}//}}}
+-		this.fix=function() { //{{{
+-		}//}}}
+-	//properties 
+-	// {{{
+-	this.results_on_nodes    = 0;
+-	this.io_gather           = 0;
+-	this.lowmem              = 0;
+-	this.output_frequency    = 0;
+-	this.checkpoint_frequency   = 0;
+-	this.waitonlock          = 0;
+-	this.upload_server       = '';
+-	this.upload_path         = '';
+-	this.upload_login        = '';
+-	this.upload_port         = 0;
+-	this.upload_filename     = '';
+-	this.solver_residue_threshold = 0;
+-	this.setdefaultparameters();
+-	//}}}
++
++    }// }}}
++    this.classname= function(){// {{{
++        return "issmsettings";
++
++    }// }}}
++	this.checkconsistency = function(md,solution,analyses) { // {{{
++
++		checkfield(md,'fieldname','settings.results_on_nodes','stringrow',1);
++		checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0, 1]);
++		checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0, 1]);
++		checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
++		checkfield(md,'fieldname','settings.sb_coupling_frequency','numel',[1],'>=',1);
++		checkfield(md,'fieldname','settings.checkpoint_frequency','numel',[1],'>=',0);
++		checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
++		checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0);
++	} // }}}
++	this.marshall=function(md,prefix,fid) { //{{{
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','results_on_nodes','format','StringArray');
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','io_gather','format','Boolean');
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','lowmem','format','Boolean');
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','output_frequency','format','Integer');
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','sb_coupling_frequency','format','Integer');
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','checkpoint_frequency','format','Integer');
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','waitonlock','data',this.waitonlock>0,'format','Boolean');
++		WriteData(fid,prefix,'object',this,'class','settings','fieldname','solver_residue_threshold','format','Double');
++	}//}}}
++	this.fix=function() { //{{{
++	}//}}}
++	//properties
++    // {{{
++    this.results_on_nodes        = '';
++    this.io_gather               = 0;
++    this.lowmem                  = 0;
++    this.output_frequency        = 0;
++    this.sb_coupling_frequency   = 0;
++    this.checkpoint_frequency    = 0;
++    this.waitonlock              = 0;
++    this.upload_server           = '';
++    this.upload_path             = '';
++    this.upload_login            = '';
++    this.upload_port             = 0;
++    this.upload_filename         = '';
++    this.solver_residue_threshold = 0;
++    this.setdefaultparameters();
++    //}}}
+ }
+Index: ../trunk-jpl/src/m/classes/mask.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/mask.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/mask.js	(revision 26300)
+@@ -6,17 +6,17 @@
+ function mask () {
+ 	//properties 
+ 	// {{{
+-		this.ocean_levelset                           = NaN;
+-		this.ice_levelset                           = NaN;
++		this.ocean_levelset	= NaN;
++		this.ice_levelset	= NaN;
+ 		//}}}
+ 	//methods 
+ 		this.setdefaultparameters = function (){ //{{{
+ 		} // }}}
+ 		this.disp = function () { //{{{
+-			console.log(sprintf("   mask:")); 
++			console.log(sprintf("   masks:")); 
+ 
+-			fielddisplay(this,"ocean_levelset","presence of ocean if < 0, coastline/grounding line if = 0, no ocean if > 0");
+-			fielddisplay(this,"ice_levelset","presence of ice if < 0, icefront position if = 0, no ice if > 0");
++			fielddisplay(this,'ocean_levelset','presence of ocean if < 0, coastline/grounding line if = 0, no ocean if > 0');
++			fielddisplay(this,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0');
+ 		} //}}}
+ 		this.extrude = function(md) {//{{{
+ 			this.ocean_levelset=project3d(md,'vector',this.ocean_levelset,'type','node');
+@@ -27,6 +27,7 @@
+ 			return "mask";
+ 		} //}}}
+ 		this.checkconsistency = function(md,solution,analyses){ //{{{
++			if (solution=='LoveSolution') return;
+ 
+ 			checkfield(md,'fieldname','mask.ocean_levelset','size',[md.mesh.numberofvertices, 1]);
+ 			checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices, 1]);
+@@ -45,5 +46,4 @@
+ 		}//}}}
+ 		this.fix=function() { //{{{
+ 		}//}}}
+-
+ }
+Index: ../trunk-jpl/src/m/classes/mesh3dprisms.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/mesh3dprisms.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/mesh3dprisms.js	(revision 26300)
+@@ -22,7 +22,7 @@
+ 			checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements, 6]);
+ 
+             if(ArrayAnyEqual(ArrayIsMember(NewArrayFillIncrement(md.mesh.numberofvertices,1,1),ArraySort(ArrayUnique(MatrixToList(md.mesh.elements)))),0)){
+-				//md = checkmessage(md,'orphan nodes have been found. Check the mesh outline'); @TODO
++				//checkmessage(md,'orphan nodes have been found. Check the mesh outline'); @TODO
+                 md.checkmessage('orphan nodes have been found. Check the mesh outline');
+ 			}
+ 			checkfield(md,'fieldname','mesh.numberoflayers','>=',0);
+@@ -126,7 +126,8 @@
+             return "mesh3dprisms";
+         } //}}}
+ 
+-        //properties (SetAccess=public) 
++	//properties 
++	// {{{
+         this.x                           = NaN;
+         this.y                           = NaN;
+         this.z                           = NaN;
+@@ -138,7 +139,7 @@
+         this.lat                         = NaN;
+         this.long                        = NaN;
+         this.epsg                        = 0;
+-		  this.scale_factor                = NaN;
++		this.scale_factor                = NaN;
+ 
+         this.vertexonbase                = NaN;
+         this.vertexonsurface             = NaN;
+@@ -160,4 +161,5 @@
+ 
+         this.extractedvertices           = NaN;
+         this.extractedelements           = NaN;
++	//}}}
+ }
+Index: ../trunk-jpl/src/m/classes/qmu.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/qmu.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/qmu.js	(revision 26300)
+@@ -11,7 +11,9 @@
+ 
+ 		console.log(sprintf('   qmu parameters:'));
+ 
+-		/*fielddisplay(this,'isdakota','is qmu analysis activated?');
++		fielddisplay(this,'isdakota','is qmu analysis activated?');
++		fielddisplay(this,'output','are we outputting ISSM results, default is 0');
++		/*
+ 		for (var i=0;i<this.variables.length;i++){
+ 			console.log(sprintf('         variables%s:  (arrays of each variable class)',...
+ 						string_dim(this.variables,i)));
+@@ -105,6 +107,7 @@
+ 		} // }}}
+ 		this.marshall=function(md,prefix,fid) { //{{{
+ 			WriteData(fid,prefix,'object',this,'fieldname','isdakota','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','output','format','Boolean');
+ 			if (!this.isdakota){
+ 				WriteData(fid,prefix,'data',0,'name','md.qmu.mass_flux_segments_present','format','Boolean');
+ 			}
+@@ -128,6 +131,7 @@
+ 	// {{{
+ 
+ 	this.isdakota                    = 0;
++	this.output                      = 0;
+ 	this.variables                   = []
+ 	this.responses                   = [];
+ 	this.method                      = []
+Index: ../trunk-jpl/src/m/classes/slr.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/slr.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/slr.js	(revision 26300)
+@@ -113,7 +113,8 @@
+ 		fielddisplay(this,'steric_rate','rate of steric ocean expansion [mm/yr]');
+ 		} //}}}
+ 		this.marshall=function(md,prefix,fid) { //{{{
+-
++			console.log('WARNING: NOT MARHSALLING SLR FOR NOW.');
++			return;
+ 			WriteData(fid,prefix,'object',this,'fieldname','deltathickness','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'object',this,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',this,'fieldname','reltol','format','Double');
+Index: ../trunk-jpl/src/m/classes/stressbalance.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/stressbalance.js	(revision 26300)
+@@ -157,14 +157,12 @@
+ 		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer');
+ 		WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1);
+ 
+-		var lx=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)lx[i]=this.loadingforce[i][0];
+-		var ly=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)ly[i]=this.loadingforce[i][1];
+-		var lz=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)lz[i]=this.loadingforce[i][2];
++		if (size(this.loadingforce,1)==3) {
++			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,0),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
++			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,1),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey');
++			WriteData(fid,prefix,'data',ArrayCol(this.loadingforce,2),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez');
++		}
+ 
+-		WriteData(fid,prefix,'data',lx,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex');
+-		WriteData(fid,prefix,'data',ly,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey');
+-		WriteData(fid,prefix,'data',lz,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez');
+-
+ 		//process requested outputs
+ 		var outputs = this.requested_outputs;
+ 		for (var i=0;i<outputs.length;i++){
+Index: ../trunk-jpl/src/m/classes/thermal.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/thermal.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/thermal.js	(revision 26300)
+@@ -63,11 +63,11 @@
+ 	this.classname= function(){// {{{
+ 		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++){
+ 				if(count===pos[posIndex]){
+@@ -88,10 +88,10 @@
+ //					count++;
+ //				}
+ //			}
+-		}
++        }
+ 
+-		return this;
+-	}//}}}
++        return this;
++    }//}}}
+ 	this.checkconsistency = function(md,solution,analyses){ // {{{
+ 
+ 		//Early return
+@@ -103,7 +103,7 @@
+ 		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++){
+ 					if (!isNaN(md.thermal.spctemperature[i][j])){
+@@ -122,8 +122,8 @@
+ 				if (isNan(md.stressbalance.reltol)){
+ 					md.checkmessage('for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!');
+ 				}
++				checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
+ 			}
+-			checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
+ 		}
+ 		checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1);
+ 	} // }}} 
+@@ -162,21 +162,20 @@
+ 		}//}}}
+ 	//properties 
+ 	// {{{
++	this.spctemperature    		= NaN;
++	this.penalty_threshold 		= 0;
++	this.stabilization     		= 0;
++	this.reltol			   		= 0;
++	this.maxiter           		= 0;
++	this.penalty_lock      		= 0;
++	this.penalty_factor    		= 0;
++	this.isenthalpy        		= 0;
++	this.isdynamicbasalspc 		= 0;
++	this.isdrainicecolumn  		= 0;
++	this.watercolumn_upperlimit = 0;
++	this.fe                		= 'P1';
++	this.requested_outputs 		= [];
+ 
+-	this.spctemperature    = NaN;
+-	this.penalty_threshold = 0;
+-	this.stabilization     = 0;
+-	this.reltol	   = 0;
+-	this.maxiter           = 0;
+-	this.penalty_lock      = 0;
+-	this.penalty_factor    = 0;
+-	this.isenthalpy        = 0;
+-	this.isdynamicbasalspc = 0;
+-	this.isdrainicecolumn  = 0;
+-	this.watercolumn_upperlimit=0;
+-	this.fe                = 'P1';
+-	this.requested_outputs = [];
+-
+ 	this.setdefaultparameters();
+ 	//}}}
+ }
+Index: ../trunk-jpl/src/m/plot/applyoptions.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/applyoptions.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/applyoptions.js	(revision 26300)
+@@ -1,4 +1,6 @@
+-function applyoptions(md, data, options, canvas){ //{{{
++'use strict';
++
++function applyoptions(md, data, options, canvas) {
+ 	//APPLYOPTIONS - apply colobar, text, cloud, and expdisp options to current plot
+ 	//
+ 	//   Usage:
+@@ -7,472 +9,359 @@
+ 	//   See also: PLOTMODEL, PARSE_OPTIONS
+ 
+ 	//{{{ colorbar
+-	var gl = canvas.gl;
+-	if (options.exist('colorbar')) {
+-		if (options.getfieldvalue('colorbar')==1) {
+-			//{{{ Variable options initialization
+-			var caxis = options.getfieldvalue('caxis');
+-			var ccanvasid, ctitleid, clabelsid, ccanvas, ctitle, clabels, ccontext, cmap, colorbar, cwidth, cheight, cgradient, color, y, x;
+-			//}}}
+-			//{{{ Create colorbar labels
+-			var labels = [];
+-			var cdivisions = options.getfieldvalue('colorbarnticks', 6);
+-			var caxisdelta = caxis[1] - caxis[0];
+-			var precision = options.getfieldvalue('colorbarprecision', 3);
+-			var format = options.getfieldvalue('colorbarformat', 'f').toLowerCase();
+-			if (options.getfieldvalue('log','off')!='off') {
+-				for (var i=cdivisions; i >= 0; i--) {
+-					var scale = (Math.log10(caxis[1])-Math.log10(caxis[0]))/Math.log10(options.getfieldvalue('log', 10));
+-					if (format === 'f') {
+-						labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(caxis[0])/Math.log10(options.getfieldvalue('log', 10))+scale*(cdivisions-i)/cdivisions)).toFixed(precision);
+-					}
+-					else if (format === 'e') {
+-						labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(caxis[0])/Math.log10(options.getfieldvalue('log', 10))+scale*(cdivisions-i)/cdivisions)).toPrecision(precision);
+-					}
+-					else {
+-						labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(caxis[0])/Math.log10(options.getfieldvalue('log', 10))+scale*(cdivisions-i)/cdivisions)).toFixed(precision);
+-					}
++	let gl = canvas.gl;
++	
++	if (options.getfieldvalue('colorbar', false)) {
++		//{{{ Create colorbar labels
++		let cAxis = options.getfieldvalue('caxis');
++		let labels = [];
++		let divisions = options.getfieldvalue('colorbarnticks', 6);
++		let cAxisDelta = cAxis[1] - cAxis[0];
++		let precision = options.getfieldvalue('colorbarprecision', 3);
++		let format = options.getfieldvalue('colorbarformat', 'f').toLowerCase();
++		if (options.getfieldvalue('log','off') !== 'off') {
++			for (let i = divisions; i >= 0; i--) {
++				let scale = (Math.log10(cAxis[1]) - Math.log10(cAxis[0])) / Math.log10(options.getfieldvalue('log', 10));
++				if (format === 'f') {
++					labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(cAxis[0]) / Math.log10(options.getfieldvalue('log', 10)) + scale * (divisions - i) / divisions)).toFixed(precision);
++				} else if (format === 'e') {
++					labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(cAxis[0]) / Math.log10(options.getfieldvalue('log', 10)) + scale * (divisions - i) / divisions)).toPrecision(precision);
++				} else {
++					labels[i] = (Math.pow(options.getfieldvalue('log', 10), Math.log10(cAxis[0]) / Math.log10(options.getfieldvalue('log', 10)) + scale * (divisions - i) / divisions)).toFixed(precision);
+ 				}
+-			} else {
+-				for (var i=cdivisions; i >= 0; i--) {
+-					if (format === 'f') {
+-						labels[i] = (caxisdelta*(cdivisions-i)/cdivisions+caxis[0]).toFixed(precision);
+-					}
+-					else if (format === 'e') {
+-						labels[i] = (caxisdelta*(cdivisions-i)/cdivisions+caxis[0]).toPrecision(precision);
+-					}
+-					else {
+-						labels[i] = (caxisdelta*(cdivisions-i)/cdivisions+caxis[0]).toFixed(precision);
+-					}
++			}
++		} else {
++			for (let i = divisions; i >= 0; i--) {
++				if (format === 'f') {
++					labels[i] = (cAxisDelta * (divisions - i) / divisions + cAxis[0]).toFixed(precision);
++				} else if (format === 'e') {
++					labels[i] = (cAxisDelta * (divisions - i) / divisions + cAxis[0]).toPrecision(precision);
++				} else {
++					labels[i] = (cAxisDelta * (divisions - i) / divisions + cAxis[0]).toFixed(precision);
+ 				}
+-			} //}}}
+-			//{{{ Initialize colorbar canvas
+-			let colorbarSlug = options.getfieldvalue('colorbarSlug', options.getfieldvalue('canvasid') + '-colorbar');
+-			ccanvasid = colorbarSlug + '-canvas';
+-			ccanvas = $('#'+ccanvasid)[0];
+-			cwidth = ccanvas.width*options.getfieldvalue('colorbarwidth', 1);
+-			cheight = ccanvas.height*options.getfieldvalue('colorbarheight', 1);
+-			ccontext = ccanvas.getContext('2d');
+-			ccontext.clearRect(0, 0, cwidth, cheight);
+-			ccontext.beginPath();
+-			cmap = options.getfieldvalue('colormap','jet');
+-			colorbar = colorbars[cmap];
+-			cgradient = ccontext.createLinearGradient(0, 0, 0, cheight);
+-			//}}}
+-			//{{{ Draw colorbar gradient
+-			var position;
+-			var offset = 1 / (colorbar.length - 1) / 2;
+-			var scaling = 1 - 2 * offset;
+-			for (var i=0; i < colorbar.length; i++) {
+-				color = colorbar[colorbar.length-i-1];
+-				color = [Math.round(color[0]*255), Math.round(color[1]*255), Math.round(color[2]*255)];
+-				position = (i / (colorbar.length - 1) * scaling) + offset;
+-				cgradient.addColorStop(position, 'rgba(' + color.toString() + ', 1.0)');
+ 			}
+-			ccontext.fillStyle=cgradient;
+-			ccontext.fillRect(0, 0, cwidth, cheight);
+-			//}}}
+-			//{{{ Draw colorbar border
+-			ccontext.beginPath();
+-			ccontext.lineWidth='1';
+-			ccontext.strokeStyle=options.getfieldvalue('colorbarfontcolor','black');
+-			ccontext.rect(0, 0, cwidth, cheight);
+-			ccontext.stroke();
+-			//}}}
+-			//{{{ Draw colorbar labels
+-			clabelsid = colorbarSlug + '-labels';
+-			clabels = $('#'+clabelsid);
+-			var clabelstring = '';
+-			clabels.empty();
+-			for (var i=0; i <= cdivisions; i++) {
+-				y = (i+0.5)/(cdivisions+1)*cheight;
+-				x = 0.2*cwidth;
+-				clabelstring += '<li><span>'+labels[i]+'</span></li>';
+-				ccontext.beginPath();
+-				ccontext.moveTo(0, y);
+-				ccontext.lineTo(x, y);
+-				ccontext.moveTo(cwidth-x, y);
+-				ccontext.lineTo(cwidth, y);
+-				ccontext.stroke();
+-			}
+-			clabels.append(clabelstring);
+-			//}}}
+-			//{{{ Draw colorbar title
+-			ctitleid = colorbarSlug + '-heading';
+-			ctitle = $('#'+ctitleid);
+-			if (options.exist('colorbarHeader')) { ctitle.html(options.getfieldvalue('colorbarHeader')); }
+-			//}}}
++		} //}}}
++		//{{{ Initialize colorbar canvas
++		let cCanvasId = options.getfieldvalue('colorbarid', options.getfieldvalue('canvasid') + ('-colorbar-canvas'));
++		let cCanvasIdBase = cCanvasId.substring(0, cCanvasId.lastIndexOf('-canvas'));
++		let cCanvas = document.getElementById(cCanvasId);
++		let cWidth = cCanvas.width * options.getfieldvalue('colorbarwidth', 1);
++		let cHeight = cCanvas.height * options.getfieldvalue('colorbarheight', 1);
++		let cContext = cCanvas.getContext('2d');
++		let cMap = options.getfieldvalue('colormap', 'amp');
++		
++		// If value of cMap is of type array, assume we have a custom colorbar; otherwise, look up colormap by name from global letiable "colorbars"
++		let colorbar = null;
++		
++		if (vesl.arrays.isArray(cMap)) {
++			colorbar = cMap;
++		} else {
++    		for (let colormap in colorbars) {
++        		if (colormap === cMap) {
++			        colorbar = colorbars[cMap];
++			        break;
++                }
++            }
++            
++            if (colorbar === null) {
++                for (let colormap in cmoceanColormaps) {
++            		if (colormap === cMap) {
++    			        colorbar = cmoceanColormaps[cMap];
++    			        break;
++                    }
++                }
++            }
+ 		}
+-	} //}}}
+-	//{{{ texture canvas
+-	var tcontext, tcanvas, tcanvasid, tURL, tgradient;
+-	tcanvasid = 'texturecanvas';
+-	var tcanvas = document.getElementById(tcanvasid);
+-	if (tcanvas == null) {
+-		$('<canvas id="texturecanvas" width="256" height="256" style="display: none;"></canvas>').insertAfter('#'+String(options.getfieldvalue('canvasid')));
+-		tcanvas = document.getElementById(tcanvasid);
+-	}
+-	tcontext = tcanvas.getContext('2d');
+-	tgradient = tcontext.createLinearGradient(0, 0, 0, 256);
+-
+-	var cmap = options.getfieldvalue('colormap','jet');
+-	var colorbar = colorbars[cmap];
+-	for (var i = 0; i < colorbar.length; i++) {
+-		color = colorbar[colorbar.length - i - 1];
+-		color = [Math.round(color[0] * 255), Math.round(color[1] * 255), Math.round(color[2] * 255)];
+-		tgradient.addColorStop(i / (colorbar.length - 1), 'rgba(' + color.toString() + ', 1.0)');
+-	}
+-	tcontext.fillStyle = tgradient;
+-	tcontext.fillRect(0, 0, 256, 256);
+-
+-	//Allow for special texture colors, drawing each color in equal width vertical rectangles. The last rectanglar section is reserved for the colormap.
+-	if (options.exist('maskregion')) {
+-		var maskObject = options.getfieldvalue('maskregion',{'enabled':false});
+-		if (maskObject.enabled && !vesl.helpers.isEmptyOrUndefined(maskObject.colors)) {
+-			var x = 0;
+-			var sections = Object.keys(maskObject.colors).length + 1;
+-			var size = 256;
+-			var width = Math.floor(1 / sections * size);
+-			for (var color in maskObject.colors) {
+-				tcontext.fillStyle = maskObject.colors[color];
+-				tcontext.fillRect(x++ * width, 0, width, size);
+-			}
++		
++		let gradient = cContext.createLinearGradient(0, 0, 0, cHeight);
++		//}}}
++		//{{{ Draw colorbar gradient
++		// TODO: Allow for passing the opacity in as a fourth value of each array of a colormap?
++		let applyOpacityToColorbar  = options.getfieldvalue('applyOpacityToColorbar', false);
++		let color                   = null;
++		let background              = options.getfieldvalue('colorbarBackground', null);
++		let offset                  = 1 / (colorbar.length - 1) / 2;
++		let opacity                 = options.getfieldvalue('opacity', 1.0);
++		let position                = null;
++		let scaling                 = 1 - 2 * offset;
++		
++		if (!applyOpacityToColorbar) {
++    		opacity = 1.0;
+ 		}
+-	}
+-
+-	tURL = tcanvas.toDataURL();
+-	if (options.getfieldvalue('clf','on')=='off') {
+-		canvas.nodes['unit' + (Object.keys(canvas.nodes).length - 1)].texture = initTexture(canvas.gl, tURL);
+-	} else {
+-		canvas.nodes.unit.texture = initTexture(canvas.gl, tURL);
+-	}
+-	//}}}
+-	//{{{ text display
+-	var ctx;
+-	var overlaycanvasid;
+-	var overlaycanvas;
+-	//Only intialize overlay canvas once by checking if it's already been defined
+-	if (vesl.helpers.isEmptyOrUndefined(canvas.overlaycanvas)) {
+-		//Get drawing context and save reference on main WebGL canvas
+-		overlaycanvasid = options.getfieldvalue('overlayid', options.getfieldvalue('canvasid') + '-overlay')
+-		overlaycanvas = $('#' + overlaycanvasid)[0];
+-		ctx = overlaycanvas.getContext('2d');
+-		canvas.overlaycanvas = overlaycanvas;
+-	}
+-	overlaycanvas = canvas.overlaycanvas;
+-	ctx = overlaycanvas.getContext('2d');
+-
+-	if (options.exist('textlabels')) {//{{{
+-		//Attatch new overlay handler to display text labels
+-		var textLabels = options.getfieldvalue('textlabels',[]);
+-		canvas.overlayHandlers['text'] = function(canvas) {
+-			for (var i = 0; i < textLabels.length; i++) {
+-				//Get text label to display
+-				var textLabel = textLabels[i];
+-				textLabel = {
+-					position: defaultFor(textLabel.position, vec3.create()),
+-					text: defaultFor(textLabel.text, ''),
+-					fontSize: defaultFor(textLabel.fontSize, 18),
+-					fontColor: defaultFor(textLabel.fontColor, 'black'),
+-
+-				};
+-
+-				// function declared in slr-gfm sim-front-end-controller.js
+-				// if labels are behind the globe sphere then skip iteartion and do not display them
+-				if (vesl.ui.isLabelVisible(textLabel)) {
+-					//Transform from world space to viewport space
+-					var screenPoint = vec3.transformMat4(vec3.create(), textLabel.position, canvas.camera.vpMatrix);
+-					var x = (screenPoint[0] + 1.0) * (canvas.width / 2) + canvas.selector.offset().left;
+-					var y = (-screenPoint[1] + 1.0) * (canvas.height / 2) + canvas.selector.offset().top;
+-
+-					//Draw text
+-					ctx.font = 'bold ' + String(textLabel.fontSize) + 'px Arial Black, sans-serif';
+-					ctx.fillStyle = textLabel.fontColor;
+-					ctx.strokeStyle = 'white';
+-					ctx.textAlign = 'center';
+-					ctx.textBaseline = 'middle';
+-					ctx.fillText(textLabel.text, x, y);
+-					ctx.strokeText(textLabel.text, x, y);
++		
++		if (background !== null) {
++    		background = [background[0] * 255, background[1] * 255, background[2] * 255];
++    		$('#' + cCanvasId).css('background', 'rgba(' + background.toString() + ', 1.0');
++		}
++		
++		for (let i = 0; i < colorbar.length; i++) {
++			color = colorbar[colorbar.length - i - 1];
++			color = [Math.round(color[0] * 255), Math.round(color[1] * 255), Math.round(color[2] * 255)];
++			position = (i / (colorbar.length - 1) * scaling) + offset;
++			gradient.addColorStop(position, 'rgba(' + color.toString() + ', ' + opacity + ')');
++		}
++		
++		cContext.clearRect(0, 0, cWidth, cHeight);
++		cContext.beginPath();
++		cContext.fillStyle = gradient;
++		cContext.fillRect(0, 0, cWidth, cHeight);
++		//}}}
++		//{{{ Draw colorbar border
++		cContext.beginPath();
++		cContext.lineWidth = '1';
++		cContext.strokeStyle=options.getfieldvalue('colorbarfontcolor','black');
++		cContext.rect(0, 0, cWidth, cHeight);
++		cContext.stroke();
++		//}}}
++		//{{{ Draw colorbar labels
++		let cLabelsId = cCanvasIdBase + '-labels';
++		let cLabels = $('#' + cLabelsId);
++		let cLabelString = '';
++		let x, y;
++		cLabels.empty();
++		for (let i = 0; i <= divisions; i++) {
++			y = (i + 0.5) / (divisions + 1) * cHeight;
++			x = 0.2 * cWidth;
++			cLabelString += '<li><span>' + labels[i] + '</span></li>';
++			cContext.beginPath();
++			cContext.moveTo(0, y);
++			cContext.lineTo(x, y);
++			cContext.moveTo(cWidth - x, y);
++			cContext.lineTo(cWidth, y);
++			cContext.stroke();
++		}
++		cLabels.append(cLabelString);
++		//}}}
++		//{{{ Draw colorbar title
++		let cTitleId = cCanvasIdBase + '-heading';
++		let cTitle = $('#' + cTitleId);
++		if (options.exist('colorbartitle')) { cTitle.html(options.getfieldvalue('colorbartitle')); }
++		//}}}
++		//{{{ Setup texture/alpha canvases
++		let $canvas 	= $(canvas);
++		let tCanvasId 	= options.getfieldvalue('texturecanvasid', 'texturecanvas');
++		let aCanvasId 	= options.getfieldvalue('alphacanvasid', 'alphacanvas');
++		let tCanvas 	= document.getElementById(tCanvasId);
++		let aCanvas 	= document.getElementById(aCanvasId);
++		
++		if (tCanvas == null) {
++			$('<canvas id="' + tCanvasId + '" width="256" height="256" style="display: none;"></canvas>').insertAfter($canvas);
++			tCanvas = document.getElementById(tCanvasId);
++		}
++		
++		if (aCanvas == null) {
++			$('<canvas id="' + aCanvasId + '" width="256" height="256" style="display: none;"></canvas>').insertAfter($canvas);
++			aCanvas = document.getElementById(aCanvasId);
++		}
++	
++		//Set up canvas drawing contexes and gradients.
++		let tContext = tCanvas.getContext('2d');
++		let aContext = aCanvas.getContext('2d');
++		let tGradient = tContext.createLinearGradient(0, 0, 0, 256);
++		let aGradient = aContext.createLinearGradient(0, 0, 0, 256);
++		
++		//Determine where in gradient to start unit mesh transparency
++		let maskAlphaEnabled = options.getfieldvalue('maskAlphaEnabled', false);
++		let maskAlphaTolerance = options.getfieldvalue('maskAlphaTolerance', 0.1);
++		let maskAlphaValue = options.getfieldvalue('maskAlphaValue', 1.1);
++		let maskAlphaUseColor = options.getfieldvalue('maskAlphaUseColor', false);
++		let maskAlphaColor = options.getfieldvalue('maskAlphaColor', 'rgba(0.0, 0.0, 255, 1.0)');
++		let alphaValue = (maskAlphaValue - cAxis[0]) / cAxisDelta;
++		
++		//Apply transparency to alpha map that enables alpha to be read from texture, and to actual texture alpha.
++		for (let i = 0; i < colorbar.length; i++) {
++			color = colorbar[colorbar.length - i - 1];
++			color = [Math.round(color[0] * 255), Math.round(color[1] * 255), Math.round(color[2] * 255)];
++			let colorStop = i / (colorbar.length - 1);
++			if (maskAlphaEnabled && (colorStop > 1 - alphaValue || colorStop == colorbar.length - 1)) {
++				if (maskAlphaUseColor) {
++					tGradient.addColorStop(colorStop, maskAlphaColor);
++					aGradient.addColorStop(colorStop, 'rgb(255, 255, 255)');
++				} else {
++					tGradient.addColorStop(colorStop, 'rgba(' + color.toString() + ', 0.0)');
++					aGradient.addColorStop(colorStop, 'rgb(0, 0, 0)');
+ 				}
++			} else {
++				tGradient.addColorStop(colorStop, 'rgba(' + color.toString() + ', 1.0)');
++				aGradient.addColorStop(colorStop, 'rgb(255, 255, 255)');
+ 			}
+ 		}
+-	}//}}}
+-
+-	//{{{ additional rendering nodes
+-	if (options.exist('render')) {
+-		var meshresults = processmesh(md, data, options);
+-		var x = meshresults[0];
+-		var y = meshresults[1];
+-		var z = meshresults[2];
+-		var elements = meshresults[3];
+-		var is2d = meshresults[4];
+-		var isplanet = meshresults[5];
+-
+-		var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
+-		var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
+-		var zlim = options.getfieldvalue('zlim', [ArrayMin(z), ArrayMax(z)]);
+-
+-		var global = vec3.length([(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2]) < 6371000/10; //tolerance for global models = center is 637100 meters away from center of earth
+-		var translation = global ? [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2] : canvas.view.position;
+-
+-		var renderObjects = options.getfieldvalue('render',{});
+-
+-		for (var renderObject in renderObjects) {
+-			//Modify renderObejct?
+-			var object = renderObjects[renderObject];
+-			object = {
+-				enabled: defaultFor(object.enabled, true),					//Toggle display of the render object node
+-				scale: defaultFor(object.scale, 1),							//Model matrix scaling
+-				x: defaultFor(object.x, [0.0, 1.0, 0.0, 0.0, 0.0, 0.0]),	//x coordinate array
+-				y: defaultFor(object.y, [0.0, 0.0, 0.0, 1.0, 0.0, 0.0]),	//y coordinate array
+-				z: defaultFor(object.z, [0.0, 0.0, 0.0, 0.0, 0.0, 1.0]),	//z coordinate array
+-				indices: defaultFor(object.indices, []),					//indices array
+-				name: defaultFor(object.name, 'NY'),						//Text to display for cities.
+-				size: defaultFor(object.size, 1),							//Physical size of the object in meters
+-				color: defaultFor(object.color, 'black'),					//Diffuse color of object
+-				height: defaultFor(object.height, 25000),					//Height of object along y axis, currently for clouds only
+-				range: defaultFor(object.range, 120000),					//Range of sz plane to spawn object, currently for clouds only
+-				quantity: defaultFor(object.quantity, 15),					//Quantity of objects to display, currently for clouds only
+-				source: defaultFor(object.source, 'NY'),					//Quantity of objects to display, currently for clouds only
+-				targets: defaultFor(object.targets, ['NY'])					//Quantity of objects to display, currently for clouds only
+-			};
+-			if (!object.enabled) { continue; }
+-			if ('sky' === renderObject && !('sky' in canvas.nodes)) {
+-				var mesh = GL.Mesh.icosahedron({size: 6371000 * canvas.atmosphere.scaleHeight, subdivisions: 5});
+-				var texture = initTexture(gl, canvas.assetsPath + '/textures/TychoSkymapII_t4_2k.jpg');
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'sky',
+-					'shaderName', 'SkyFromSpace',
+-					'cullFace', gl.FRONT,
+-					'mesh', mesh,
+-					'texture',texture,
+-					'translation',translation
+-				);
+-			}
+-			if ('space' === renderObject && !('space' in canvas.nodes)) {
+-				var mesh = GL.Mesh.sphere({size: 6371000 * 20});
+-				var texture = initTexture(gl, canvas.assetsPath + '/textures/TychoSkymapII_t4_2k.jpg');
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'space',
+-					'shaderName', 'Textured',
+-					'cullFace', gl.FRONT,
+-					'drawOrder', 2,
+-					'mesh', mesh,
+-					'texture',texture,
+-					'translation',translation
+-				);
+-			}
+-			if ('coastlines' === renderObject) {
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'coastlines',
+-					'shaderName', 'Colored',
+-					'drawMode', gl.LINE_STRIP,
+-					'lineWidth', options.getfieldvalue('linewidth', 1),
+-					'scale', [object.scale, object.scale, object.scale],
+-					'rotation', [-90, 0, 0]
+-				);
+-				node.patch('Vertices', [object.x, object.y, object.z], 'FaceColor', 'none');
+-			}
+-			if ('graticule' === renderObject && !('graticule' in canvas.nodes)) {
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'graticule',
+-					'shaderName', 'Colored',
+-					'drawMode', gl.LINE_STRIP,
+-					'lineWidth', options.getfieldvalue('linewidth', 1),
+-					'scale', [object.scale, object.scale, object.scale],
+-					'rotation', [-90, 180, 0]
+-				);
+-				node.patch('Vertices', [object.x, object.y, object.z], 'FaceColor', 'none');
+-			}
+-			if ('cities' === renderObject && !('cities' in canvas.nodes)) {
+-				var mesh = GL.Mesh.icosahedron({size: object.size, subdivisions: 1});
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'cities',
+-					'shaderName', 'ColoredDiffuse',
+-					'diffuseColor', object.color,
+-					'lineWidth', options.getfieldvalue('linewidth', 1),
+-					'scale', [object.scale, object.scale, object.scale],
+-					'rotation', [-90, 0, 0]
+-				);
+-				node.geometryShader('Mesh', mesh, 'Vertices', [object.x, object.y, object.z], 'Indices', object.indices);
+-			}
+-			if ('axis' === renderObject && !('axis' in canvas.nodes)) {
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'axis',
+-					'shaderName', 'Colored',
+-					'drawMode', gl.LINES,
+-					'diffuseColor', [1.0, 0.0, 0.0, 1.0],
+-					'lineWidth', options.getfieldvalue('linewidth', 1),
+-					'scale', [object.scale, object.scale, object.scale],
+-					'rotation', [0, 0, 0]
+-				);
+-				node.patch('Vertices', [object.x, object.y, object.z], 'FaceColor', 'none');
+-			}
+-			if ('city' === renderObject && !vesl.helpers.isEmptyOrUndefined(overlaycanvas)) {
+-				//city
+-				var mesh = GL.Mesh.sphere({size: object.size});
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'city',
+-					'shaderName', 'ColoredDiffuse',
+-					'diffuseColor', object.color,
+-					'mesh', mesh,
+-					'translation', [object.x, object.z, -object.y]
+-				);
+-				//Attatch new overlay handler to display city name
+-				canvas.overlayHandlers['city'] = function(canvas) {
+-					var node = canvas.nodes['city'];
+-					var object = node.renderObject;
+-					var screenPoint = vec3.transformMat4(vec3.create(), node.translation, canvas.camera.vpMatrix);
+-					var x = (screenPoint[0] + 1.0) * (canvas.width / 2) + canvas.selector.offset().left;
+-					var y = (-screenPoint[1] + 1.0) * (canvas.height / 2) + canvas.selector.offset().top;
+-
+-					ctx.font = 'bold ' + String(options.getfieldvalue('colorbarfontsize', 22))+'px Arial Black, sans-serif';
+-					ctx.fillStyle = options.getfieldvalue('colorbarfontcolor','black');
+-					ctx.strokeStyle = 'white';
+-					ctx.textAlign = 'center';
+-					ctx.textBaseline = 'middle';
+-					ctx.fillText(object.name, x, y);
+-					ctx.strokeText(object.name, x, y);
++		
++		//Draw gradients to canvaes.
++		tContext.fillStyle = tGradient;
++		aContext.fillStyle = aGradient;
++		tContext.fillRect(0, 0, 256, 256);
++		aContext.fillRect(0, 0, 256, 256);
++		
++		//Allow for special texture colors, drawing each color in equal width vertical rectangles. The last rectanglar section is reserved for the colormap.
++		if (options.exist('maskregion')) {
++			let maskObject = options.getfieldvalue('maskregion',{'enabled':false});
++			if (maskObject.enabled && !vesl.helpers.isEmptyOrUndefined(maskObject.colors)) {
++				let x = 0;
++				let sections = Object.keys(maskObject.colors).length + 1;
++				let size = 256;
++				let width = Math.floor(1 / sections * size);
++				for (let color in maskObject.colors) {
++					tContext.fillStyle = maskObject.colors[color];
++					tContext.fillRect(x++ * width, 0, width, size);
+ 				}
+ 			}
+-			if ('clouds' === renderObject && !('clouds0' in canvas.nodes)) {
+-				//clouds
+-				var mesh = GL.Mesh.fromURL(canvas.assetsPath + '/obj/cloud.obj');
+-				for (var i = 0; i < object.quantity; i++) {
+-					//TODO: More options, less magic numbers. Add animation. Better shading.
+-					var offset = [randomizeAxis(translation[0], object.range),
+-												randomizeCloudHeight(translation[1], object),
+-												randomizeAxis(translation[2], object.range)];
+-					var randomSize = randomizeCloudSize(object.scale);
+-					var randomColor = randomizeCloudColor();
+-					node = new Node(
+-						'canvas', canvas,
+-						'options', options,
+-						'renderObject', object,
+-						'name', 'clouds' + i,
+-						'shaderName', 'ColoredDiffuse',
+-						'diffuseColor', [randomColor, randomColor, randomColor, 1.0],
+-						'specularColor', [0.1, 0.1, 0.1, 1.0],
+-						'mesh', mesh,
+-						'scale', [randomSize, randomSize, randomSize],
+-						'translation', offset
+-					);
++		}
++		
++		//Read canvases as images, and load as textures in Three.js
++		let tURL            = tCanvas.toDataURL();
++		let aURL            = aCanvas.toDataURL();
++		let textureMap      = new THREE.TextureLoader().load(tURL);
++		let alphaMap        = new THREE.TextureLoader().load(aURL);
++		let unitOptions 	= options.getfieldvalue('unitOptions', {'name' : 'unit'});
++		let unitName 		= unitOptions.name;
++		let unitSceneNode 	= canvas.unitNodes[unitName].sceneNode;
++		unitSceneNode.material.map          = textureMap;
++		unitSceneNode.material.emissiveMap  = textureMap;
++		unitSceneNode.material.color        = new THREE.Color(0xffffff);
++		unitSceneNode.material.needsUpdate  = true;
++		
++		//Only apply alpha map if enabled.
++		if (maskAlphaEnabled) {
++			unitSceneNode.material.alphaMap = alphaMap;
++		}
++	} //}}}
++	//}}}
++	//{{{ Data marker
++	// TODO: Default parameters are already being handled by /js/vesl/DataMarker.js::constructor, so perhaps we should be initializing this elsewhere and/or by some other manner	
++	if (vesl.helpers.isEmptyOrUndefined(canvas.dataMarker)) { // Only define data marker once
++		let dataMarker 			= {};
++		let dataMarkerOptions 	= options.getfieldvalue('dataMarker', {});
++		
++		dataMarker = {
++			enabled: defaultFor(dataMarkerOptions.enabled, false)
++		};
++		
++		// Only initialize data marker object if we have enabled data markers for this canvas
++		if (dataMarker.enabled) {
++			dataMarker.object = new vesl.DataMarker(
++				{
++					canvas 			: canvas,
++					hasMarker 		: defaultFor(dataMarkerOptions.hasMarker, true),
++					markerImgPath 	: defaultFor(dataMarkerOptions.markerImgPath, '/canvas/data-markers/data-marker.svg'),
++					hasTooltip		: defaultFor(dataMarkerOptions.hasTooltip, false),
++					tooltipFormat	: defaultFor(dataMarkerOptions.tooltipFormat, ''),
++					tooltipFields	: defaultFor(dataMarkerOptions.tooltipFields, null),
++					width			: defaultFor(dataMarkerOptions.width, 32),
++					height			: defaultFor(dataMarkerOptions.height, 32)
+ 				}
++			);
++		}
++		
++		canvas.dataMarker = dataMarker;
++	}
++	//}}}
++	//contours
++	if (options.exist('contourlevels')) {
++		plot_contour(md,data,options,canvas);
++	}
++} //}}}
++function drawGroundingLines(md, canvas, options, renderObject, lines, colors) { //{{{
++	let renderObjects = options.getfieldvalue('render',{});
++	let state = canvas.state;
++	let scene = state.scene;
++	
++	let group = scene.getObjectByName('groundingLines');
++	if (group !== undefined) {
++		scene.remove(group); //Remove old group if already exists
++	}
++	group = new THREE.Group();
++	group.name = 'groundingLines';
++	
++	//Plot multiple grounding lines, each consisting of multiple polygons. 
++	for (let i = 0; i < lines.length; i++) {
++		let groundingLine = lines[i]; //of type Proxy (not object or array), thus must iterate without length attribute
++		let color = processColor(colors[i]);
++		let x = [];
++		let y = [];
++		let z = [];
++		//In order to show polygons correctly, must convert from line strip to line segments
++		for (let j in groundingLine) {
++			let polygon = groundingLine[j]
++			let lineStripX = polygon['x'];
++			let lineStripY = polygon['y'];
++			let lineStripZ = polygon['z'];
++			let lineSegmentsX = [lineStripX[0]];
++			let lineSegmentsY = [lineStripY[0]];
++			let lineSegmentsZ = [lineStripZ[0]];
++			//Must push same coordinates as end of previous segment and beginning of next segment
++			for (let k = 1; k < lineStripX.length - 1; k++) {
++				lineSegmentsX.push(lineStripX[k], lineStripX[k]);
++				lineSegmentsY.push(lineStripY[k], lineStripY[k]);
++				lineSegmentsZ.push(lineStripZ[k], lineStripZ[k]);
+ 			}
+-			if ('citylines' === renderObject) {
+-				//city
+-				node = new Node(
+-					'canvas', canvas,
+-					'options', options,
+-					'renderObject', object,
+-					'name', 'citylines',
+-					'shaderName', 'ColoredDiffuse',
+-					'drawMode', gl.LINES,
+-					'diffuseColor', object.color,
+-					'lineWidth', options.getfieldvalue('linewidth', 1),
+-					'scale', [object.scale, object.scale, object.scale],
+-					'rotation', [0, 0, 0]
+-				);
+-
+-				//For each target city, calculate the shortest line across the earth by performing a quaternion slerp.
+-				//Treat source and target city as vectors to rotate to from the north pole.
+-				//Then, slerp between the two rotations, and generate points across equidistance points on the earth to create the line.
+-				var north = vec3.fromValues(0, 1, 0);
+-				var source = object.source;
+-				var sourceXYZ = vec3.fromValues(xcity[source], zcity[source], -ycity[source]);
+-				var radius = vec3.length(sourceXYZ);
+-				var lineSteps = 50;
+-				var lineX = [];
+-				var lineY = [];
+-				var lineZ = [];
+-				var lineXYZ = vec3.create();
+-
+-				for (var i = 0; i < object.targets.length; i++) {
+-					var target = object.targets[i];
+-					var targetXYZ = vec3.fromValues(xcity[target], zcity[target], -ycity[target]);
+-					var axis = vec3.cross(vec3.create(), sourceXYZ, targetXYZ);
+-					vec3.normalize(axis, axis);
+-
+-					//Get the total angle between the two cities.
+-					var sourceXYZAxis = vec3.normalize(vec3.create(), sourceXYZ);
+-					var targetXYZAxis = vec3.normalize(vec3.create(), targetXYZ);
+-					var dotProduct = vec3.dot(sourceXYZAxis, targetXYZAxis);
+-					var totalAngle = Math.acos(dotProduct); //theta = arccos(u . v / (||u|| * ||v||); in this case, ||u|| and ||v|| are 1, since u and v are unit vectors.
+-
+-					var lineQuat = quat.create();
+-					for (var j = 1; j <= lineSteps; j++) {
+-						//Calculate the partial rotation to obtain points on the line between the two cities.
+-						var angle = j / lineSteps * totalAngle;
+-						quat.setAxisAngle(lineQuat, axis, angle);
+-						quat.normalize(lineQuat, lineQuat);
+-						vec3.transformQuat(lineXYZ, sourceXYZ, lineQuat);
+-						//GL.LINES needs 2 points for each line - at the beginning, just use the sourceXYZ.
+-						//TODO: Eliminate this if statement.
+-						if (j === 1) {
+-							lineX.push(sourceXYZ[0]);
+-							lineY.push(sourceXYZ[1]);
+-							lineZ.push(sourceXYZ[2]);
+-						} else {
+-							lineX.push(lineX[lineX.length - 1]);
+-							lineY.push(lineY[lineY.length - 1]);
+-							lineZ.push(lineZ[lineZ.length - 1]);
+-						}
+-						lineX.push(lineXYZ[0]);
+-						lineY.push(lineXYZ[1]);
+-						lineZ.push(lineXYZ[2]);
+-					}
+-				}
+-				node.patch('Vertices', [lineX, lineY, lineZ]);
++			//Cap off last coordinate
++			lineSegmentsX.push(lineStripX[lineStripX.length - 1]);
++			lineSegmentsY.push(lineStripY[lineStripY.length - 1]);
++			lineSegmentsZ.push(lineStripZ[lineStripZ.length - 1]);
++			//Add polygon coordinates to existing groundingLine
++			x = x.concat(lineSegmentsX);
++			y = y.concat(lineSegmentsY);
++			if (renderObject.followsBed) {
++				z = z.concat(lineSegmentsZ);
++			} else {
++				z = z.concat(NewArrayFill(lineSegmentsX.length, 10 * i));
+ 			}
+ 		}
+-	} //}}}
++		z = ArrayScale(z, options.getfieldvalue('heightscale', 1));
++		let vertices = [x, y, z];
++		//console.log('ArrayMin(x):', ArrayMin(x), 'ArrayMax(x):', ArrayMax(x), 'ArrayMin(y):', ArrayMin(y), 'ArrayMax(y):', ArrayMax(y));
++			
++		let node = new Node(
++			'canvas', canvas,
++			'options', options,
++			'renderObject', renderObject,
++			'name', 'groundingLine_' + String(i),
++			'shaderName', 'lines',
++			//'dashed', dashed,
++			'depthTest', false,
++			'diffuseColor', color,
++			'lineWidth', renderObject.lineWidth,
++			//'lineWidth', options.getfieldvalue('linewidth', 3),
++			'scale', [renderObject.scale, renderObject.scale, renderObject.scale]
++		);
++		node.patch('Vertices', vertices, 'group', group, 'ViewReset', false);
++	}
++	scene.add(group);
++	return group;
+ } //}}}
+-
+-function randomizeCloudHeight(canvasGroundHeight, object) {
+-		// -+7000 seems a reasonable range
+-		var maxHeight = object.height + 7000;
+-		var minHeigth = object.height - 7000;
+-		var randomHeight = (Math.random() * (maxHeight - minHeigth)) + minHeigth;
+-
+-		return canvasGroundHeight + randomHeight;
+-}
+-
+-// assumes that originAxisValue is the mid-value between min and max.
+-function randomizeAxis(originAxisValue, range) {
+-		return originAxisValue + (Math.random() - 0.5) * (range * 2);
+-}
+-
+-function randomizeCloudSize(scale) {
+-	var maxResize = 1.3;
+-	var minResize = 0.5;
+-	var randomizationFactor = Math.random() * (maxResize - minResize) + minResize;
+-	return scale * randomizationFactor;
+-}
+-
+-function randomizeCloudColor() {
+-	var lighestColor = 1;
+-	var darkestColor = 0.9;
+-	var randomColor = Math.random() * (lighestColor - darkestColor) + darkestColor;
+-	return randomColor;
+-}
++function drawText(state, options, textLabels) { //{{{
++	let camera = state.camera;
++	let overlayCanvas = state.overlayCanvas;
++	let ctx = overlayCanvas.getContext('2d');
++	let widthHalf = overlayCanvas.width / 2
++	let heightHalf = overlayCanvas.height / 2;
++	
++	for (let i = 0; i < textLabels.length; i++) {
++		let textLabel = textLabels[i];
++		let position = textLabel.position.clone();
++		let text = textLabel.text;
++		
++		//Project world coordinates to screenspace coordinates
++		position.project(camera);
++		let x = (position.x * widthHalf) + widthHalf;
++		let y = -(position.y * heightHalf) + heightHalf;
++		
++		ctx.font = 'bold ' + String(options.getfieldvalue('colorbarfontsize', 22))+'px Arial Black, sans-serif';
++		ctx.fillStyle = options.getfieldvalue('colorbarfontcolor','black');
++		ctx.strokeStyle = 'white';
++		ctx.textAlign = 'center';
++		ctx.textBaseline = 'middle';
++		ctx.fillText(text, x, y);
++		ctx.strokeText(text, x, y);
++	}
++} //}}}
++function processColor(color) { //{{{
++	//Update the diffuse color with an RGB color name or vec4 containing r, g, b, and opacity values from 0.0 to 1.0
++	if (typeof color === 'string') {
++		color = new THREE.Color(color);
++	} else if (Array.isArray(color)) {
++		color = new THREE.Color().fromArray(color);
++	}
++	return color;
++} //}}}
+Index: ../trunk-jpl/src/m/plot/plot_manager.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_manager.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plot_manager.js	(revision 26300)
+@@ -1,131 +1,163 @@
+-function plot_manager(md,options,subplotwidth,nlines,ncols,i){ //{{{
++'use strict';
++
++function plot_manager(md, options, subplotwidth, nlines, ncols, i) { //{{{
+ 	//PLOT__MANAGER - distribute the plots, called by plotmodel
+ 	//
+ 	//   Usage:
+-	//      plot_manager(md,options,subplotwidth,i);
++	//      plot_manager(md, options, subplotwidth, i);
+ 	//
+ 	//   See also: PLOTMODEL, PLOT_UNIT
++	let canvas      = document.getElementById(options.getfieldvalue('canvasid'));
++	let data        = options.getfieldvalue('data'); // Get data to be displayed
++	let dataresults = null; 
++	let datatype    = 0;
++	let	data2       = null;
+ 			
+-	//parse options and get a structure of options. 
+-	checkplotoptions(md,options);
+-	
+-	//get data to be displayed
+-	var data = options.getfieldvalue('data');
+-	var canvas = initCanvas(options);
+-	var gl = canvas.gl;
++	// Parse options and get a structure of options
++	checkplotoptions(md, options);
+ 
+-	//figure out if this is a special plot
+-	if (typeof data === 'string'){
+-		
+-		switch(data){
+-
++	// Figure out if this is a special plot
++	if (typeof data === 'string') {
++		switch(data) {
+ 			case 'boundaries':
+-				plot_boundaries(md,options,subplotwidth,i);
++				plot_boundaries(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'BC':
+-				plot_BC(md,options,subplotwidth,i,data);
++				plot_BC(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'edges':
+-				plot_edges(md,options,subplotwidth,i,data);
++				plot_edges(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'elementnumbering':
+-				plot_elementnumbering(md,options,subplotwidth,i);
++				plot_elementnumbering(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'highlightelements':
+-				plot_highlightelements(md,options,subplotwidth,i);
++				plot_highlightelements(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'qmumean':
+-				plot_qmumean(md,options,nlines,ncols,i);
++				plot_qmumean(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'qmustddev':
+-				plot_qmustddev(md,options,nlines,ncols,i);
++				plot_qmustddev(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'qmuhistnorm':
+-				plot_qmuhistnorm(md,options,nlines,ncols,i);
++				plot_qmuhistnorm(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'qmu_mass_flux_segments':
+-				plot_qmu_mass_flux_segments(md,options,nlines,ncols,i);
++				plot_qmu_mass_flux_segments(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'part_hist':
+-				plot_parthist(md,options,nlines,ncols,i);
++				plot_parthist(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'part_hist_n':
+-				plot_parthistn(md,options,nlines,ncols,i);
++				plot_parthistn(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'part_hist_w':
+-				plot_parthistw(md,options,nlines,ncols,i);
++				plot_parthistw(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'elements_type':
+-				plot_elementstype(md,options,subplotwidth,i);
++				plot_elementstype(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'vertexnumbering':
+-				plot_vertexnumbering(md,options,subplotwidth,i);
++				plot_vertexnumbering(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'highlightvertices':
+-				plot_highlightvertices(md,options,subplotwidth,i);
++				plot_highlightvertices(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'basal_drag':
+-				plot_basaldrag(md,options,subplotwidth,i,data);
++				plot_basaldrag(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'basal_dragx':
+-				plot_basaldrag(md,options,subplotwidth,i,data);
++				plot_basaldrag(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'basal_dragy':
+-				plot_basaldrag(md,options,subplotwidth,i,data);
++				plot_basaldrag(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'driving_stress':
+-				plot_drivingstress(md,options,subplotwidth,i);
++				plot_drivingstress(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'mesh':
+-				plot_mesh(md,options,canvas);
++				plot_mesh(md, options, canvas);
+ 				return;
++				
+ 			case 'none':
+-				//if (!(options.exist('overlay'))){
+-				//	plot_none(md,options,nlines,ncols,i);
+-				//}
+ 				return;
++				
+ 			case 'penalties':
+-				plot_penalties(md,options,subplotwidth,i);
++				plot_penalties(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'partition':
+-				plot_partition(md,options,nlines,ncols,i);
++				plot_partition(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'referential':
+-				plot_referential(md,options,nlines,ncols,i);
++				plot_referential(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'riftvel':
+-				plot_riftvel(md,options,nlines,ncols,i);
++				plot_riftvel(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'riftnumbering':
+-				plot_riftnumbering(md,options,nlines,ncols,i);
++				plot_riftnumbering(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'rifts':
+-				plot_rifts(md,options,nlines,ncols,i);
++				plot_rifts(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'riftrelvel':
+-				plot_riftrelvel(md,options,nlines,ncols,i);
++				plot_riftrelvel(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'riftpenetration':
+-				plot_riftpenetration(md,options,nlines,ncols,i);
++				plot_riftpenetration(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'riftfraction':
+-				plot_riftfraction(md,options,nlines,ncols,i);
++				plot_riftfraction(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'sarpwr':
+-				plot_sarpwr(md,options,subplotwidth,i);
++				plot_sarpwr(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'time_dependant':
+-				plot_vstime(md,options,nlines,ncols,i);
++				plot_vstime(md, options, nlines, ncols, i);
+ 				return;
++				
+ 			case 'icefront':
+-				plot_icefront(md,options,subplotwidth,i,data);
++				plot_icefront(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'segments':
+-				plot_segments(md,options,subplotwidth,i,data);
++				plot_segments(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'quiver':
+-				plot_quiver(md,options,canvas);
++				plot_quiver(md, options, canvas);
+ 				return;
++				
+ 			case 'strainrate_tensor':
+ 			case 'strainrate':
+ 			case 'strainrate_principal':
+@@ -144,65 +176,70 @@
+ 			case 'deviatoricstress_principalaxis1':
+ 			case 'deviatoricstress_principalaxis2':
+ 			case 'deviatoricstress_principalaxis3':
+-				plot_tensor(md,options,subplotwidth,i,data);
++				plot_tensor(md, options, subplotwidth, i, data);
+ 				return;
++				
+ 			case 'thermaltransient_results':
+-				plot_thermaltransient_results(md,options,subplotwidth,i);
++				plot_thermaltransient_results(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'transient_movie':
+-				plot_transient_movie(md,options,canvas);
++				plot_transient_movie(md, options, canvas);
+ 				return;
++				
+ 			case 'transient_results':
+-				plot_transient_results(md,options,subplotwidth,i);
++				plot_transient_results(md, options, subplotwidth, i);
+ 				return;
++				
+ 			case 'transient_field':
+-				plot_transient_field(md,options,subplotwidth,i);
++				plot_transient_field(md, options, subplotwidth, i);
+ 				return;
++				
+ 			default:
+-				if (data in md){
+-					data=md[data];
+-				}
+-				else{
++				if (data in md) {
++					data = md[data];
++				} else {
+ 					error('plot error message: data provided not supported yet. Type plotdoc for help');
+ 				}
+ 		}
+ 	}
+ 
+-	//Figure out if this is a semi-transparent plot.
+-	if (options.getfieldvalue('overlay','off')=='on'){
+-		plot_overlay(md,data,options,canvas);
++	// Figure out if this is a semi-transparent plot.
++	if (options.getfieldvalue('overlay', 'off') === 'on') {
++		plot_overlay(md, data, options, canvas);
++		//return;
+ 	}
+ 
+-	//Figure out if this is a semi-transparent plot.
+-	if (options.exist('googlemaps')){
+-		plot_googlemaps(md,data,options,nlines,ncols,i);
++	// Figure out if this is a semi-transparent plot.
++	if (options.exist('googlemaps')) {
++		plot_googlemaps(md, data, options, nlines, ncols, i);
+ 		return;
+ 	}
+ 
+-	//Figure out if this is a semi-transparent plot.
+-	if (options.exist('gridded')){
+-		plot_gridded(md,data,options,nlines,ncols,i);
++	// Figure out if this is a semi-transparent plot.
++	if (options.exist('gridded')) {
++		plot_gridded(md, data, options, nlines, ncols, i);
+ 		return;
+ 	}
+ 
+-	//Figure out if this is a Section plot
+-	if (options.exist('sectionvalue')){
+-		plot_section(md,data,options,nlines,ncols,i);
++	// Figure out if this is a Section plot
++	if (options.exist('sectionvalue')) {
++		plot_section(md, data, options, nlines, ncols, i);
+ 		return;
+ 	}
+ 
+ 	//Figure out if this is a Profile plot
+-	if (options.exist('profile')){
+-		plot_profile(md,data,options,nlines,ncols,i);
++	if (options.exist('profile')) {
++		plot_profile(md, data, options, nlines, ncols, i);
+ 		return;
+ 	}
+ 	
+-	var	dataresults = processdata(md,data,options);
+-	var	data2 = dataresults[0]; 
+-	var	datatype = dataresults[1];
++	dataresults = processdata(md, data, options);
++	data2       = dataresults[0]; 
++	datatype    = dataresults[1];
+ 	
+-	//plot unit
+-	plot_unit(md,data2,datatype,options,canvas);
++	// Plot unit
++	plot_unit(md, data2, datatype, options, canvas);
+ 
+-	applyoptions(md,data2,options,canvas);
++	applyoptions(md, data2, options, canvas);
+ } //}}}
+Index: ../trunk-jpl/src/m/plot/plot_mesh.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_mesh.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plot_mesh.js	(revision 26300)
+@@ -6,66 +6,49 @@
+ 	//
+ 	//   See also: PLOTMODEL, PLOT_MANAGER
+ 
+-	// If we already have the overlay and are using caching, short circuit
+-	if ('mesh' in canvas.nodes && options.getfieldvalue('cachenodes', 'off') === 'on') {
+-		return;
+-	}
+-	
+-	/*
+-		Local variables
+-	*/
+ 	//{{{
+ 	//Process data and model
+-	var meshresults = processmesh(md, [], options);
+-	var x = meshresults[0]; 
+-	var y = meshresults[1]; 
+-	var z = meshresults[2]; 
+-	var elements = meshresults[3]; 
+-	var is2d = meshresults[4]; 
+-	var isplanet = meshresults[5];
+-		
+-	//Compute coordinates and data range:
+-	var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
+-	var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
+-	var zlim = options.getfieldvalue('zlim', [ArrayMin(z), ArrayMax(z)]);
++	let meshresults = processmesh(md, [], options);
++	meshresults = scaleMesh(md, meshresults, options);
++	let x = meshresults[0]; 
++	let y = meshresults[1]; 
++	let z = meshresults[2]; 
++	let elements = meshresults[3];
++	let is2d = meshresults[4]; 
++	let isplanet = meshresults[5];
++	let vertices = meshresults[6];
++	let scale = meshresults[7];
+ 	
+-	//Handle heightscale
+-	var vertices, scale;
+-	if (md.mesh.classname() !== 'mesh3dsurface') {
+-		vertices = [x, y, z];
+-		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
+-	}
+-	else {
+-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
+-		scale = [1, 1, 1];
+-	}
+-	
+ 	//Compute gl variables:
+-	var edgecolor = options.getfieldvalue('edgecolor', 'black');
+-	var node = new Node(
++	let edgecolor = options.getfieldvalue('edgecolor', 'black');
++	let node = new Node(
+ 		'canvas', canvas,
+ 		'options', options,
++		'md', md,
+ 		'name', 'mesh',
+-		'shaderName', 'Colored',
+-		'alpha', options.getfieldvalue('alpha', 1.0),
+-		//'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, md.mesh.classname() === 'mesh3dsurface' ? (zlim[0] + zlim[1]) / 2 : zlim[0]],
+-		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
+-		'drawMode', canvas.gl.LINES,
+-		'diffuseColor', edgecolor,
++		'cullFace', THREE.DoubleSide,
++		'shaderName', 'lines',
++		'opacity', options.getfieldvalue('opacity', 1.0),
+ 		'lineWidth', options.getfieldvalue('linewidth', 1),
+-		'maskEnabled', options.getfieldvalue('innermask','off') == 'on',
+-		'maskHeight', options.getfieldvalue('innermaskheight', 150.0) / options.getfieldvalue('heightscale', 1),
+-		'maskColor', options.getfieldvalue('innermaskcolor',[0.0, 0.0, 1.0, 1.0]),
+-		'rotation', [-90, 0, 0],
+ 		'scale', scale
+ 	);
+ 	//}}}
+ 	//{{{ node plot
+-	if (elements[0].length==6){ //prisms
+-	}
+-	else if (elements[0].length==4){ //tetras
+-	}
+-	else{ //2D triangular elements
++	if (elements[0].length === 6) { //prisms
++		//We can skip bottom and every other side to avoid drawing edges twice.
++		let abc = elements.map(function(value, index) { return [value[0], value[1], value[2]]; }); //top
++		// let dfe = elements.map(function(value, index) { return [value[3], value[5], value[4]]; }); //bottom
++		// let aeb = elements.map(function(value, index) { return [value[0], value[4], value[1]]; }); //1st side upper right
++		let ade = elements.map(function(value, index) { return [value[0], value[3], value[4]]; }); //1st side lower left
++		// let bfc = elements.map(function(value, index) { return [value[1], value[5], value[2]]; }); //2nd side upper right
++		let bef = elements.map(function(value, index) { return [value[1], value[4], value[5]]; }); //2nd side lower left
++		// let cda = elements.map(function(value, index) { return [value[2], value[3], value[0]]; }); //3rd side upper right
++		let cfd = elements.map(function(value, index) { return [value[2], value[5], value[3]]; }); //3rd side lower left
++		let prismElements = abc.concat(ade, bef, cfd);
++		node.patch('Faces', prismElements, 'Vertices', vertices, 'FaceColor', 'none', 'EdgeColor', edgecolor);
++	} else if (elements[0].length === 4) { //tetras
++        // TODO: Implement handling for tetras
++	} else { // 2D triangular elements
+ 		node.patch('Faces', elements, 'Vertices', vertices, 'FaceColor', 'none', 'EdgeColor', edgecolor);
+ 	}
+ 	//}}}
+Index: ../trunk-jpl/src/m/plot/plot_overlay.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_overlay.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plot_overlay.js	(revision 26300)
+@@ -1,98 +1,157 @@
+-function plot_overlay(md, data, options, canvas){ //{{{
+-	//PLOT_OVERLAY - Function for plotting a georeferenced image.  
+-	//
+-	//   Usage:
+-	//      plot_overlay(md, data, options, canvas);
+-	//
+-	//   See also: PLOTMODEL, PLOT_MANAGER
++'use strict';
+ 
+-	// If we already have the overlay and are using caching, short circuit
+-	if ('overlay' in canvas.nodes && options.getfieldvalue('cachenodes', 'off') === 'on') {
+-		return;
++/**
++ * Global Function: plotOverlay
++ *
++ * Plot a georeferenced image 
++ *
++ * Dependencies:
++ *      - /ext/proj4-<version>
++ *
++ * See Also:
++ *      - /js/plotmodel.js
++ *      - /js/plotmanager.js
++ */
++function plot_overlay(md, data, options, canvas) {
++    let elements        = null;
++    let meshresults     = null; // results from call to processmesh
++    let newX            = null; // scaled x-coordinates (array)
++    let newY            = null; // scaled y-coordinates (array)
++    let newZ            = null; // scaled z-coordinates (array)
++    let position        = null; // x-, y-, and z-coordinates of vertex (object)
++    let renderObject    = null; 
++    let reproject       = false; // default; whether or not to reproject overlay
++    let result          = null; // First, projection of radar overlay onto mesh; then, projection of overlay onto mesh
++    let scale           = null; // coordinate scalars (array)
++	let vertices        = null;
++    let x               = null; // x-coordinates from results (array)
++    let xlim            = null; // x-cooridinate limits (array)
++    let y               = null; // y-coordinates from results (array)
++    let ylim            = null; // y-cooridinate limits (array)
++    let z               = null; // z-coordinates from results (array)
++    
++	// Process data and model
++    meshresults = processmesh(md, [], options);
++	x           = meshresults[0]; 
++	y           = meshresults[1]; 
++	z           = meshresults[2]; 
++	elements    = meshresults[3];
++	
++	if (md.mesh.classname().startsWith('mesh2d')) {
++		if (vesl.helpers.isNaN(md.geometry.surface) || (md.geometry.surface[0] !== undefined && vesl.helpers.isNaN(md.geometry.surface[0]))) {
++			md.geometry.surface = NewArrayFill(x.length, 0);
++			z = NewArrayFill(x.length, 0);
++		} else {
++			z = md.geometry.surface;
++		}
+ 	}
+ 	
+-	/*
+-		Local variables
+-	*/
+-	//{{{
+-	//Process data and model
+-	var meshresults = processmesh(md, [], options);
+-	var x = meshresults[0]; 
+-	var y = meshresults[1]; 
+-	var z = meshresults[2]; 
+-	var elements = meshresults[3]; 
+-	var is2d = meshresults[4]; 
+-	var isplanet = meshresults[5];
+-	if (md.mesh.classname() !== 'mesh3dsurface') z = md.geometry.surface;
++	// Compute coordinates and data range
++	xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
++	ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
+ 	
+-	//Compute coordinates and data range:
+-	var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
+-	var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
+-	var zlim = options.getfieldvalue('zlim', [ArrayMin(md.geometry.surface), ArrayMax(md.geometry.surface)]);
+-	
+-	//Handle radaroverlay
++	// Handle radaroverlay
+ 	if (md.radaroverlay.outerx) {
+-		var result = Node.prototype.mergeVertices(x, y, z, elements, md.radaroverlay.outerx, md.radaroverlay.outery, md.radaroverlay.outerheight, md.radaroverlay.outerindex);
+-		x = result.x;
+-		y = result.y;
+-		z = result.z;
+-		elements = result.elements;
++		result      = Node.prototype.mergeVertices(x, y, z, elements, md.radaroverlay.outerx, md.radaroverlay.outery, md.radaroverlay.outerheight, md.radaroverlay.outerindex);
++		x           = result.x;
++		y           = result.y;
++		z           = result.z;
++		elements    = result.elements;
+ 	}
+ 	
+-	//Handle heightscale
+-	var vertices, scale;
+-	if (md.mesh.classname() !== 'mesh3dsurface') {
+-		vertices = [x, y, z];
+-		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
++	// Handle heightscale
++	renderObject = options.getfieldvalue('render', {});
++	
++	if ('overlay' in renderObject && renderObject.overlay.reproject !== undefined) {
++		reproject = renderObject.overlay.reproject;
+ 	}
+-	else {
+-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
+-		scale = [1, 1, 1];
++	
++	if (reproject) {
++		//NOTE: This is being hardcoded for now, as we want to display Josh's greenland-ice-retreat model on a globe.
++		// If mesh3dprisims do not need to be displayed on a globe, add an option to the view/render objects to specify the reprojection.
++		// Currently, we are also hardcoding the reprojection from EPSG:3413 (WGS 84 / NSIDC Sea Ice Polar Stereographic North) to EPSG:4326 (WGS 84, standard 2d spherical projection))
++		// projection definitions are taken from http://epsg.io/XXXXX.js, where XXXXX is the projection number.
++		// Can be dynamically taken and retrieved via md.mesh.epsg, but again, hardcoded for efficiency.
++		proj4.defs("EPSG:3413","+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"); // http://epsg.io/3413.js
++		//Don't need to redefine EPSG:4326, as it is defined by default - however, this is still included just in case.
++		// proj4.defs("EPSG:4326","+proj=longlat +datum=WGS84 +no_defs"); // http://epsg.io/4326.js
++		//Create empty copies of XYZ to avoid rescaling md.geomtery.surface in the case that z = md.geomtery.surface
++		newX = NewArrayFill(x.length, 0);
++		newY = NewArrayFill(x.length, 0);
++		newZ = NewArrayFill(x.length, 0);
++		
++		for (let i = 0; i < x.length; ++i) {
++			result      = proj4('EPSG:3413','EPSG:4326', [x[i], y[i]]);
++			position    = vesl.geo.geographicToCartesian(vesl.EARTH_RADIUS + z[i], result[1], result[0], true);
++			newX[i]     = position.x;
++			newY[i]     = position.y;
++			newZ[i]     = position.z;
++		}
++		
++		x           = newX;
++		y           = newY;
++		z           = newZ;
++		vertices    = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':reproject}), true);
++		scale       = [1, 1, 1];
++    } else {
++		vertices    = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':reproject}), true);
++		scale       = [1, 1, 1];
+ 	}
+ 	
+-	//Compute gl variables:
+-	var edgecolor = options.getfieldvalue('edgecolor', 'black');
+-	var texture = initTexture(gl, options.getfieldvalue('overlay_image'));
+-	var node = new Node(
++	// Compute coordinates and data range
++	xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
++	ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
++	
++	// Compute GL variables
++	let texture         = new THREE.TextureLoader().load(options.getfieldvalue('overlay_image'));
++	let groundEnabled   = false;
++	let name            = 'overlay';
++	
++	if ('ground' in renderObject) {
++    	groundEnabled = renderObject.ground.enabled;
++    }
++    
++	if ('overlay' in renderObject) {
++    	name = renderObject.overlay.name;
++    }
++    
++	let shaderName = groundEnabled ? 'ground' : 'overlay';
++	
++	let node = new Node(
+ 		'canvas', canvas,
+ 		'options', options,
+-		'name', 'overlay',
+-		'shaderName', 'ground' in options.getfieldvalue('render', {}) ? 'GroundFromSpace' : 'TexturedDiffuse',
+-		'alpha', options.getfieldvalue('outeralpha', 1.0),
+-		//'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, md.mesh.classname() === 'mesh3dsurface' ? (zlim[0] + zlim[1]) / 2 : zlim[0]],
+-		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
+-		'ambientColor', [0.1, 0.1, 0.1 ,1.0],
+-		'diffuseColor', [1.0, 1.0, 1.0 ,1.0],
+-		'specularStrength', 0.0,
+-		'maskEnabled', options.getfieldvalue('outermask','off') == 'on',
+-		'maskHeight', options.getfieldvalue('outermaskheight', 150.0),
+-		'maskColor', options.getfieldvalue('outermaskcolor',[0.0, 0.0, 1.0, 1.0]),
++		'md', md,
++		'name', name,
++		'shaderName', shaderName,
++		'opacity', options.getfieldvalue('outeropacity', 1.0),
++		'cullFace', THREE.DoubleSide,
+ 		'texture', texture,
+-		'rotation', [-90, 0, 0],
+ 		'scale', scale
+ 	);
+-	//}}}
++	canvas.overlayNode = node;
+ 
+-	var xRange = xlim[1] - xlim[0];
+-	var yRange = ylim[1] - ylim[0];
+-	var coordArray = [new Array(x.length), new Array(x.length)];
++	let xRange      = xlim[1] - xlim[0];
++	let yRange      = ylim[1] - ylim[0];
++	let coordArray  = [new Array(x.length), new Array(x.length)];
+ 	
+-	//generate mesh:
+-	if (md.mesh.classname() == 'mesh3dsurface') {
+-		var xyz, magnitude;
+-		for(var i = 0; i < x.length; i++){
+-			xyz = vec3.fromValues(vertices[0][i], vertices[1][i], vertices[2][i]);
+-			magnitude = vec3.length(xyz);
++	// Generate mesh
++	if (reproject || md.mesh.classname().startsWith('mesh3d')) {
++		let magnitude   = 0;
++		let xyz         = null;
+ 		
+-			coordArray[0][i] = Math.atan2(xyz[1], xyz[0]) / (2 * Math.PI) + 0.5;
+-			coordArray[1][i] = Math.asin(xyz[2] / magnitude) / Math.PI + 0.5;
++		for (let i = 0; i < x.length; ++i) {
++			xyz                 = vec3.fromValues(vertices[0][i], vertices[1][i], vertices[2][i]);
++			magnitude           = vec3.length(xyz);
++		
++			coordArray[0][i]    = Math.atan2(xyz[1], xyz[0]) / (2 * Math.PI) + 0.5;
++			coordArray[1][i]    = Math.asin(xyz[2] / magnitude) / Math.PI + 0.5;
+ 		}
+-	}
+-	else {
+-		for(var i = 0; i < x.length; i++){
++	} else {
++		for (let i = 0; i < x.length; ++i) {
+ 			coordArray[0][i] = (vertices[0][i] - xlim[0]) / xRange;
+ 			coordArray[1][i] = (vertices[1][i] - ylim[0]) / yRange;
+ 		}
+ 	}
++	
+ 	node.patch('Faces', elements, 'Vertices', vertices, 'FaceVertexCData', coordArray, 'FaceColor', 'interp');
+-} //}}}
++}
+Index: ../trunk-jpl/src/m/plot/plot_quiver.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_quiver.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plot_quiver.js	(revision 26300)
+@@ -20,7 +20,9 @@
+ 	var elements = meshresults[3]; 
+ 	var is2d = meshresults[4]; 
+ 	var isplanet = meshresults[5];
+-	if (md.mesh.classname() !== 'mesh3dsurface') z = md.geometry.surface;
++	if (!md.mesh.classname().startsWith('mesh3d')) {
++		z = md.geometry.surface;
++	}
+ 		
+ 	//Compute coordinates and data range:
+ 	var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
+@@ -34,12 +36,12 @@
+ 
+ 	//Handle heightscale
+ 	var vertices, scale;
+-	if (md.mesh.classname() !== 'mesh3dsurface') {
++	if (!md.mesh.classname().startsWith('mesh3d')) {
+ 		vertices = [x, y, z];
+ 		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
+ 	}
+ 	else {
+-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
++		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}), true);
+ 		scale = [1, 1, 1];
+ 	}
+ 	
+@@ -50,7 +52,7 @@
+ 		'options', options,
+ 		'name', 'quiver',
+ 		'shaderName', 'Colored',
+-		'alpha', options.getfieldvalue('alpha', 1.0),
++		'opacity', options.getfieldvalue('opacity', 1.0),
+ 		//'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, md.mesh.classname() === 'mesh3dsurface' ? (zlim[0] + zlim[1]) / 2 : zlim[0]],
+ 		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
+ 		'drawMode', canvas.gl.LINES,
+Index: ../trunk-jpl/src/m/plot/plot_transient_movie.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_transient_movie.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plot_transient_movie.js	(revision 26300)
+@@ -1,119 +1,177 @@
+-function plot_transient_movie(md, options, canvas) {//{{{
+-	/**
+-	 * PLOT_TRANSIENT_MOVIE - plot a transient result as a movie
+-	 *
+-	 * Usage:
+-	 *	plot_transient_movie(md, options, canvas);
+-	 *
+-	 * See also: PLOTMODEL, PLOT_MANAGER
+-	 */
++'use strict';
+ 
+-	// Loop over the time steps
+-	let data	 	= options.getfieldvalue('transient_field_data');
+-	let dataType	= {};
+-	let steps 		= new Array(data.length);
+-
+-	for (let i = 0, numSteps = steps.length; i < numSteps; ++i) {
++/**
++ * Global Function: plot_transient_movie
++ *
++ * Parameters:
++ *		options			- Object containing a number of property/value pairs.
++ *		animation		- Object containing a number of property/value pairs related to transient solution animation.
++ *		progressText	- Object containing a number of property/value pairs related to updating the playback slider text on frame change.
++ *		unit 			- String (default: '') which is appended to the frame index with a single white space before updating #playback-progress-text on frame change.
++ *		update			- Boolean (default: true) indicating whether or not to update #playback-progress-text on frame change with the frame index. Set this to 'false' if you would rather manage the update of #playback-progress-text via 'onMovieUpdate' handler (or by some other means).
++ * 
++ * See Also:
++ *		- /web/js/plotmodel.js
++ *		- /web/js/plot_manager.js
++ *
++ * TODO:
++ *		- Update function signature/handling to use ES6 default parameters for 'unit' and 'handling'.
++ */
++function plot_transient_movie(md, options, canvas) {
++	//loop over the time steps
++	let data = options.getfieldvalue('transient_field_data');
++	let steps = new Array(data.length);
++	
++	for (let i = 0; i < steps.length; i++) {
+ 		steps[i] = i;
+ 	}
+-
+-	// Calculate caxis
++	
++	//calculate caxis
+ 	if (!options.exist('caxis')) {
+-		let range 			= [Infinity, -Infinity];
+-		let	dataResults;
+-
++		let range = [Infinity, -Infinity];
++		let dataresults;
+ 		for (let i in steps) {
+-			dataResults = processdata(md, data[i], options);
+-			range[0] = Math.min(range[0], ArrayMin(dataResults[1]));
+-			range[1] = Math.max(range[1], ArrayMax(dataResults[1]));
++			dataresults = processdata(md, data[i], options);
++			range[0] = Math.min(range[0], ArrayMin(dataresults[1]));
++			range[1] = Math.max(range[1], ArrayMax(dataresults[1]));
+ 		}
+-
+-		dataType = dataResults[1];
+ 		options.addfielddefault('caxis', range);
+ 	}
+-
+-	// Create unit node if it does not already exist
+-	if (!('unit' in canvas.nodes)) {
+-		let	dataResults = processdata(md, data[0],options);
+-		let	data2 		= dataResults[0];
+-		let	dataType 	= dataResults[1];
+-
+-		// Plot unit
+-		plot_unit(md,data2,dataType,options,canvas);
+-	}
+-
+-	// Setup rendering node
+-	let node = canvas.nodes.unit;
+-
+-	node.options 	= options;
+-	node.alpha 		= options.getfieldvalue('alpha', 1.0);
+-	node.caxis 		= options.getfieldvalue('caxis');
+-	node.enabled 	= options.getfieldvalue('nodata', 'off') === 'off';
+-	node.log 		= options.getfieldvalue('log', false);
+-
+-	// Process data
+-	let	dataResults;
++	
++	//Create unit node 
++	let dataresults = processdata(md, data[0], options);
++	let data2 = dataresults[0]; 
++	let datatype = dataresults[1];
++	plot_unit(md, data2, datatype, options, canvas);
++	let unitOptions = options.getfieldvalue('unitOptions', {'name' : 'unit'});
++	let unitName 	= unitOptions.name;
++	let node 		= canvas.unitNodes[unitName];
++	
++	//process data
+ 	let processedData = [];
+-
+ 	for (let i in steps) {
+-		dataResults 		= processdata(md, data[i].slice(), options);
+-		processedData[i] 	= dataResults[0];
++		dataresults = processdata(md, data[i].slice(), options);
++		processedData[i] = dataresults[0];
+ 	}
++	
++	//process mesh
++	let meshresults = processmesh(md, data2, options);
++	meshresults = scaleMesh(md, meshresults, options);
++	let x = meshresults[0]; 
++	let y = meshresults[1]; 
++	let z = meshresults[2]; 
++	let elements = meshresults[3];
++	let is2d = meshresults[4]; 
++	let isplanet = meshresults[5];
++	let vertices = meshresults[6];
++	let scale = meshresults[7];
++	
++	//process options
++	if (canvas.animation !== undefined && canvas.animation.handler !== undefined) {
++		clearInterval(canvas.animation.handler);
++	}
++	let animation = options.getfieldvalue('animation', {});
++	
++	let progressText = null;
++	if (!vesl.helpers.isEmptyOrUndefined(animation.progressText)) {
++		progressText = {
++					update	: defaultFor(animation.progressText.update, true),
++					unit	: defaultFor(animation.progressText.unit,  	'')
++				};
++	} else {
++		progressText = {
++					update	: false,
++					unit	: ''
++				};
++	}
++	canvas.animation = {
++		frame: defaultFor(animation.frame, 			0),
++		play: defaultFor(animation.play, 			true),
++		fps: defaultFor(animation.fps, 				4),
++		interval: defaultFor(animation.interval, 	1000 / defaultFor(animation.fps, 4)),
++		loop: defaultFor(animation.loop, 			true),
++		handler: 						{}, // Initialized below
++		progressText: 						progressText
++	}
++	//display movie
++	canvas.unitMovieData = processedData;
++	canvas.animation.totalFrames = processedData.length;
++	canvas.animation.frame = 0;
+ 
+-	// Display movie
+-	canvas.unitMovieData		= processedData;
+-	canvas.animation.frame 		= 0;
+-	canvas.animation.handler 	= setInterval(function () {
++	let slider = null;
++	
++	if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls)) {
++		if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.slider)) {
++			slider = canvas.playbackControls.slider;
++		}
++		
++		
++		if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.progressText)) {
++			progressText = canvas.playbackControls.progressText;
++		}
++	}
++	
++	clearInterval(canvas.animation.handler);
++	canvas.animation.handler = setInterval(function() {
+ 		// Update current animation frame
+-		let frame 		= canvas.animation.frame;
+-		let numFrames 	= steps.length;
+-
++		let frame = canvas.animation.frame;
++		
+ 		if (canvas.animation.play) {
+-			if (canvas.animation.increment) {
+-				if (frame >= numFrames - 1) {
+-					if (canvas.animation.loop) {
+-						frame = 0;
+-					} else {
+-						toggleMoviePlay(canvas);
+-					}
++			if (frame >= steps.length - 1) {
++				if (canvas.animation.loop) {
++					frame = 0;
+ 				} else {
+-					frame = (frame + 1) % numFrames;
++					canvas.animation.play = !canvas.animation.play;
+ 				}
++			} else {
++				frame = (frame + 1) % steps.length;
+ 			}
+ 		}
+-
+-		// If frame has changed, update unit node and data marker display
++		
++		//If frame has changed, update unit node and data marker display.
+ 		if (frame !== canvas.animation.lastFrame) {
++			canvas.state.dispatchEvent('onMovieUpdate', canvas, frame, node);
++			
++			//Rescale in case surface has changed
++			if (md.mesh.classname() === 'mesh3dsurface' || md.mesh.classname() === 'mesh3dprisms') {
++				vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':false}), true);
++			} else {
++				vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false, 'reproject':false}), true);
++				//vertices = [x, y, z];
++			}
++	
++			node.updateBuffer('Vertices', vertices);
+ 			node.updateBuffer('Coords', processedData[frame]);
+-			canvas.unitData = processedData[frame];
+-
++			canvas.unitData[unitName] = processedData[frame];
+ 			if (canvas.graph.enabled) {
+ 				vesl.graph.draw(canvas);
+ 			}
+-
+-			if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.slider)) {
+-				canvas.playbackControls.slider.val(frame);
++			if (slider != null) {
++				slider.val(frame);
+ 			}
+-
+-			if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.progressText)) {
+-				canvas.playbackControls.progressText.html(steps[frame].toFixed(0) + ' ' + options.getfieldvalue('movietimeunit', 'yr'));
++			if (!vesl.helpers.isEmptyOrUndefined(progressText) && canvas.animation.progressText.update) {
++				if (canvas.animation.progressText.unit === '') {
++					progressText.html(steps[frame].toFixed(0));
++				} else {
++					progressText.html(steps[frame].toFixed(0) + ' ' + canvas.animation.progressText.unit);
++				}
+ 			}
+-
+-			if (!vesl.helpers.isEmptyOrUndefined(canvas.nodes.quiver)) {
+-				plot_quiver(md, options, canvas, false);
+-			}
++			//if (!vesl.helpers.isEmptyOrUndefined(canvas.nodes.quiver)) {
++			//	plot_quiver(md,options,canvas,false);
++			//}
++			
+ 		}
+-
+-		// Save new frame info
+-		canvas.animation.lastFrame 	= canvas.animation.frame;
+-		canvas.animation.frame 		= frame;
++		
++		//Save new frame info.
++		canvas.animation.lastFrame = canvas.animation.frame;
++		canvas.animation.frame = frame;
+ 	}, canvas.animation.interval);
+-
+-	// Update progress bar with new frame info
+-	if (!vesl.helpers.isEmptyOrUndefined(canvas.playbackControls.slider)) {
+-		canvas.playbackControls.slider.val(canvas.animation.frame);
+-		canvas.playbackControls.slider.setUpperBound(steps.length - 1);
++	
++	//Update progress bar with new frame info.
++	if (!vesl.helpers.isEmptyOrUndefined(slider)) {
++		slider.max(steps.length - 1);
++		slider.val(canvas.animation.frame);
+ 	}
+-
++				
+ 	applyoptions(md, [], options, canvas);
+-}//}}}
++}
+Index: ../trunk-jpl/src/m/plot/plot_unit.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_unit.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plot_unit.js	(revision 26300)
+@@ -1,3 +1,5 @@
++'use strict';
++
+ function plot_unit(md, data, datatype, options, canvas) { //{{{
+ 	//PLOT_UNIT - unit plot, display data
+ 	//
+@@ -5,123 +7,125 @@
+ 	//      plot_unit(md, data, options, canvas);
+ 	//
+ 	//   See also: PLOTMODEL, PLOT_MANAGER
+-
+-	var name = 'unit';
+-	if ('unit' in canvas.nodes) {
+-		if (options.getfieldvalue('clf','on')=='on') {
+-			for (var node in canvas.nodes) {
+-				if (vesl.string.startsWith(node, 'unit')) {
+-					delete canvas.octrees[node];
+-					delete canvas.nodes[node];
+-				}
+-			}
+-		}
+-		else {
+-			name = 'unit' + Object.keys(canvas.nodes).length;
+-		}
+-	}
+-
+-	//{{{ declare variables:
+-	//Process data and model
+-	var meshresults = processmesh(md, data, options);
+-	var x = meshresults[0]; 
+-	var y = meshresults[1]; 
+-	var z = meshresults[2]; 
+-	var elements = meshresults[3];
+-	var is2d = meshresults[4]; 
+-	var isplanet = meshresults[5];
+-	if (md.mesh.classname() !== 'mesh3dsurface') {
+-		if (vesl.helpers.isNaN(md.geometry.surface) || (md.geometry.surface[0] !== undefined && vesl.helpers.isNaN(md.geometry.surface[0]))) {
+-			md.geometry.surface = NewArrayFill(x.length, 0);
+-		}
+-		z = md.geometry.surface;
+-	}
+ 	
+-	//Compute coordinates and data range:
+-	var xlim = options.getfieldvalue('xlim', [ArrayMin(x), ArrayMax(x)]);
+-	var ylim = options.getfieldvalue('ylim', [ArrayMin(y), ArrayMax(y)]);
+-	var zlim = options.getfieldvalue('zlim', [ArrayMin(z), ArrayMax(z)]);
++	//{{{
++	// Process data and model
++	let meshresults = processmesh(md, data, options);
++	meshresults = scaleMesh(md, meshresults, options);
++	let x = meshresults[0]; 
++	let y = meshresults[1]; 
++	let z = meshresults[2]; 
++	let elements = meshresults[3];
++	let is2d = meshresults[4]; 
++	let isplanet = meshresults[5];
++	let vertices = meshresults[6];
++	let scale = meshresults[7];
+ 	
+-	//Handle heightscale
+-	var vertices, scale;
+-	if (md.mesh.classname() !== 'mesh3dsurface') {
+-		vertices = [x, y, z];
+-		scale = [1, 1, options.getfieldvalue('heightscale', 1)];
+-	}
+-	else {
+-		vertices = Node.prototype.scaleVertices(md, x, y, z, elements, options.getfieldvalue('heightscale', 1), options.getfieldvalue('maskregion',{'enabled':false}));
+-		scale = [1, 1, 1];
+-	}
+-
+ 	//Compute gl variables:
+-	var edgecolor = options.getfieldvalue('edgecolor', [1.0, 1.0, 1.0 ,1.0]);
+-	var maskzeros = options.getfieldvalue('maskzeros', {});
+-	var render = options.getfieldvalue('render', {});
+-	var cullFace = ("unit" in render) ? canvas.gl[render.unit.cullFace] : canvas.gl.BACK;
+-	var node = new Node(
++	let edgecolor = options.getfieldvalue('edgecolor', [1.0, 1.0, 1.0, 1.0]);
++	let maskzeros = options.getfieldvalue('maskzeros', {});
++	
++	let unitOptions = options.getfieldvalue('unitOptions', {'name' : 'unit'});
++	let unitName 	= unitOptions.name;
++	
++	let node = new Node(
+ 		'canvas', canvas,
+ 		'options', options,
+-		'name', name,
+-		'shaderName', 'TexturedDiffuse',
+-		'alpha', options.getfieldvalue('alpha', 1.0),
++		'md', md,
++		'name', unitName,
++		'shaderName', 'unit',
++		'opacity', options.getfieldvalue('opacity', 1.0),
+ 		'caxis', options.getfieldvalue('caxis',[ArrayMin(data), ArrayMax(data)]),
+-		'center', [(xlim[0] + xlim[1]) / 2, (ylim[0] + ylim[1]) / 2, (zlim[0] + zlim[1]) / 2],
+-		'cullFace', cullFace,
+-		'lightingBias', canvas.view.lightingBias,
+-		'diffuseColor', edgecolor,
+-		'specularStrength', 0.0,
+-		'enabled', options.getfieldvalue('nodata','off') == 'off' || (("unit" in render) && render.unit.enabled),
++		'cullFace', THREE.FrontSide,
++		'enabled', options.getfieldvalue('nodata', 'off') === 'off',
+ 		'log', options.getfieldvalue('log',false),
+-		'maskEnabled', options.getfieldvalue('innermask','off') == 'on',
+-		'maskHeight', options.getfieldvalue('innermaskheight', 150.0) / options.getfieldvalue('heightscale', 1),
+-		'maskColor', options.getfieldvalue('innermaskcolor',[0.0, 0.0, 1.0, 1.0]),
+-		'maskObject', options.getfieldvalue('maskregion',{'enabled':false}),
+-		'maskZerosColor', defaultFor(maskzeros.color,[1.0, 1.0, 1.0, 1.0]),
+-		'maskZerosEnabled', defaultFor(maskzeros.enabled,false),
+-		'maskZerosTolerance', defaultFor(maskzeros.tolerance,1e-3),
+-		'maskZerosZeroValue', defaultFor(maskzeros.zeroValue,0.5),
+-		'rotation', [-90, 0, 0],
+-		'scale', ("unit" in render) ? [render.unit.scale, render.unit.scale, render.unit.scale] : scale
++		'maskObject', options.getfieldvalue('maskregion', {'enabled': false}),
++		'maskZerosColor', defaultFor(maskzeros.color, [1.0, 1.0, 1.0, 1.0]),
++		'maskZerosEnabled', defaultFor(maskzeros.enabled, false),
++		'maskZerosTolerance', defaultFor(maskzeros.tolerance, 1e-3),
++		'maskZerosZeroValue', defaultFor(maskzeros.zeroValue, 0.5),
++		'scale', scale
+ 	);
+ 	//}
+-	if (options.getfieldvalue('clf','on')=='on') {
+-		canvas.unitNode = node;
+-		canvas.unitData = data;
++	
++	if (vesl.helpers.isEmptyOrUndefined(canvas.unitNodes)) {
++		canvas.unitNodes = {};
+ 	}
++	
++	if (vesl.helpers.isEmptyOrUndefined(canvas.unitData)) {
++		canvas.unitData = {};
++	}
++	
++	// If option 'clf' is on, remove all cached data associated with this unit
++	if (options.getfieldvalue('clf', 'on') === 'on') {
++		delete canvas.unitNodes[unitName];
++		canvas.unitData[unitName] = data;
++		
++		for (let i = 0, numUnits = canvas.state.scene.children.length; i < numUnits; ++i) {
++			if (canvas.state.scene.children[i].name === unitName) {
++				canvas.state.scene.children.splice(i, 1);
++				break;
++			}
++		}
++	}
++	
++	canvas.unitNodes[unitName] = node;
++	
+ 	//}}}
+-	switch(datatype){
++	switch(datatype) {
+ 		//{{{ element plot
+ 		case 1:
+ 			//WARNING: NaN are not properly found (NaN != NaN = true)
+-			pos=ArrayFindNot(data, NaN); //needed for element on water
+-			if (elements[0].length==6){ //prisms
+-			}
+-			else if (elements[0].length==4){ //tetras
+-			}
+-			else{ //triangular elements
++			let pos = ArrayFindNot(data, NaN); //needed for element on water
++			
++			if (elements[0].length === 6) { // prisms
++				let abc = elements.map(function(value, index) { return [value[0], value[1], value[2]]; }); //top
++				let dfe = elements.map(function(value, index) { return [value[3], value[5], value[4]]; }); //bottom
++				let aeb = elements.map(function(value, index) { return [value[0], value[4], value[1]]; }); //1st side upper right
++				let ade = elements.map(function(value, index) { return [value[0], value[3], value[4]]; }); //1st side lower left
++				let bfc = elements.map(function(value, index) { return [value[1], value[5], value[2]]; }); //2nd side upper right
++				let bef = elements.map(function(value, index) { return [value[1], value[4], value[5]]; }); //2nd side lower left
++				let cda = elements.map(function(value, index) { return [value[2], value[3], value[0]]; }); //3rd side upper right
++				let cfd = elements.map(function(value, index) { return [value[2], value[5], value[3]]; }); //3rd side lower left
++				let prismElements = abc.concat(dfe, aeb, ade, bfc, bef, cda, cfd);
++				node.patch('Faces', prismElements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'flat', 'EdgeColor', edgecolor);
++			} else if (elements[0].length === 4) { // tetras
++    			// TODO: Implement handling for tetras
++			} else { // triangular elements
+ 				node.patch('Faces', elements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'flat', 'EdgeColor', edgecolor);
+ 			}
++			
+ 			break;
+ 		//}}}
+ 		//{{{ node plot
+ 		case 2:
+-			if (elements[0].length==6){ //prisms
+-			}
+-			else if (elements[0].length==4){ //tetras
+-			}
+-			else{ //triangular elements	
++			if (elements[0].length === 6) { // prisms
++				let abc = elements.map(function(value, index) { return [value[0], value[1], value[2]]; }); //top
++				let dfe = elements.map(function(value, index) { return [value[3], value[5], value[4]]; }); //bottom
++				let aeb = elements.map(function(value, index) { return [value[0], value[4], value[1]]; }); //1st side upper right
++				let ade = elements.map(function(value, index) { return [value[0], value[3], value[4]]; }); //1st side lower left
++				let bfc = elements.map(function(value, index) { return [value[1], value[5], value[2]]; }); //2nd side upper right
++				let bef = elements.map(function(value, index) { return [value[1], value[4], value[5]]; }); //2nd side lower left
++				let cda = elements.map(function(value, index) { return [value[2], value[3], value[0]]; }); //3rd side upper right
++				let cfd = elements.map(function(value, index) { return [value[2], value[5], value[3]]; }); //3rd side lower left
++				let prismElements = abc.concat(dfe, aeb, ade, bfc, bef, cda, cfd);
++				node.patch('Faces', prismElements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'interp', 'EdgeColor', edgecolor);
++			} else if (elements[0].length === 4) { // tetras
++    			// TODO: Implement handling for tetras
++			} else { // triangular elements	
+ 				node.patch('Faces', elements, 'Vertices', vertices, 'FaceVertexCData', data, 'FaceColor', 'interp', 'EdgeColor', edgecolor);
+ 			}
++			
+ 			break;
+ 		//}}}
+ 		//{{{ quiver plot 
+ 		case 3:
+-			if (is2d){
++			if (is2d) {
+ 				//plot_quiver(x, y, data(:, 1), data(:, 2), options);
+-			}
+-			else{
++			} else {
+ 				//plot_quiver3(x, y, z, data(:, 1), data(:, 2), data(:, 3), options);
+ 			}
++			
+ 			break;
+ 		//}}}
+ 		default:
+Index: ../trunk-jpl/src/m/plot/plotdoc.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotdoc.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plotdoc.js	(revision 26300)
+@@ -23,7 +23,7 @@
+ 	console.log('       	"enabled": toggle clouds (default false, ex: true)');
+ 	console.log('       	"height": height to spawn clouds at (ex: 7500)');
+ 	console.log('       	"quantity": quantity of clouds to spawn (ex: 10)');
+-	console.log('       "caxis": modify  colorbar range. (array of type [a, b] where b>=a)');
++	console.log('       "caxis": modify colorbar range (array of type [a, b] where b>=a)');
+ 	console.log('       "colorbar": add colorbar (default "off", ex: "on", "off")');
+ 	console.log('       "colorbarid": colorbar canvas id (string)');
+ 	console.log('       "colorbartitle": colorbar title (string)');	
+@@ -38,11 +38,12 @@
+ 	console.log('       "controlsensitivity": sensitivty of view/zoom changes as a percentage of default (default 1, ex: 0.5, 2.75)');
+ 	console.log('       "dataMarker": object cotaining data marker parameters. See webgl.js for defaults. (ex: {"enabled":true,"format":["<div id="sim-plot"></div>"],"labels":["thickness","velocity","value"],"animated":true})');
+ 	console.log('       	"enabled": toggle data marker displays (default true, ex: false)');
+-	console.log('       	"image": image used for marking the clicked point (ex: "/canvas/data-markers/data-marker.svg")');
+-	console.log('       	"labels": when displaying a sim-plot graph, display these model fields. (ex: ["thickness","velocity","value"])');
+-	console.log('       	"font": font to be used for display (ex: "24px "Comic Sans MS", cursive")');
+-	console.log('       	"format": an array compatible with sprintf that will be displayed as html (ex: ["X: %.2e<br>Y: %.2e<br>Z: %.2e]<br>Value: %0.1f","x","y","z","value"])');
+-	console.log('      		"size": specifiy the width and height of the data markers (default [32,32], ex: [24,32], [105,10])');
++	console.log('       	"hasMarker": whether or not the data marker has a marker (default true, ex: false)');
++	console.log('       	"markerImgPath": path to image to use for marker (default "/canvas/data-markers/data-marker.svg")');
++	console.log('       	"hasTooltip": whether or not the data marker has a tooltip (default false, ex: true)');
++	console.log('       	"tooltipFormat": C-style format string to be used when on calls to vesl.DataMarker.tooltipContent to format passed data points (default "", ex: ["X: %.2e<br>Y: %.2e<br>Z: %.2e])');	
++	console.log('       	"width": width, in pixels, of the data marker (default 32)');	
++	console.log('       	"height": height, in pixels, of the data marker (default 32)');
+ 	console.log('       "displayview": print view value to console (default "off", ex: "on", "off")');
+ 	console.log('       "displayzoom": print zoom value to console (default "off", ex: "on", "off")');
+ 	console.log('       "edgecolor": same as standard matlab option EdgeColor (default "black", ex: color name: "blue" or RGB array: [0.5, 0.2, 0.8])');
+@@ -59,10 +60,10 @@
+ 	console.log('       "innermask*": Special mask that colors all parts of a data mesh below a height a certain color. provide innermaskheight and innermaskcolor options also (default "off", ex: "on", "off")');
+ 	console.log('       "outermask*": Special mask that colors all parts of a overlay mesh below a height a certain color. provide outermaskheight and outermaskcolor options also (default "off", ex: "on", "off")');
+ 	console.log('       "overlay": overlay a radar amplitude image behind (default "off", ex: "on", "off")');
+-	console.log('       "overlay_image": path to overlay image (default "", ex: "./images/radar.png")');
++	console.log('       "overlay_image": path to overlay image (default "", ex: "./img/radar.png")');
+ 	console.log('       "quiver": add quiver plot overlay for velocities. (default "off", ex: "on", "off")');
+ 	console.log('       "scaling": scaling factor used by quiver plots. Default is 0.4');
+-	console.log('       "alpha": transparency coefficient 0.0 to 1.0, the lower, the more transparent. (default 1.0, ex: 0.5, 0.25)');
++	console.log('       "opacity": transparency coefficient 0.0 to 1.0, the lower, the more transparent. (default 1.0, ex: 0.5, 0.25)');
+ 	console.log('       "render": a object containing a list of default object to render. (default {}, ex: {"sky", "space"})');
+ 	console.log('       	"sky": render the atmosphere. (ex: {"enabled":true})');
+ 	console.log('       		"enabled": toggle sky (default false, ex: true)');
+Index: ../trunk-jpl/src/m/plot/plotmodel.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotmodel.js	(revision 26299)
++++ ../trunk-jpl/src/m/plot/plotmodel.js	(revision 26300)
+@@ -1,46 +1,55 @@
+-function plotmodel(md){ //{{{
+-	//Convert arguments to array: 
+-	var args = Array.prototype.slice.call(arguments);
++'use strict';
+ 
+-	//First process options
+-	var options = new plotoptions(args.slice(1,args.length));
+-	
+-	//get number of subplots
+-	subplotwidth=Math.ceil(Math.sqrt(options.numberofplots)); 
+-	
+-	//Get figure number and number of plots
+-	numberofplots=options.numberofplots;
++function plotmodel(md) { //{{{
++	let args            = Array.prototype.slice.call(arguments); // Convert arguments to array 
++    let canvas          = null;
++    let ncols           = 0;
++    let nlines          = 0;
++    let numberofplots   = 0;
++    let options         = new plotoptions(args.slice(1, args.length)); // Process options
++    let subplotwidth    = Math.ceil(Math.sqrt(options.numberofplots)); // Get number of subplots
++    
++	// Get figure number and number of plots
++	numberofplots = options.numberofplots;
+ 
+-	//if nlines and ncols specified, then bypass.
+-	var nlines,ncols;
+-	if (options.list[0].exist('nlines')){
+-		nlines=options.list[0].getfieldvalue('nlines');
++	// If nlines and ncols specified, then bypass.
++	if (options.list[0].exist('nlines')) {
++		nlines = options.list[0].getfieldvalue('nlines');
++	} else {
++		nlines = Math.ceil(numberofplots / subplotwidth);
+ 	}
+-	else {
+-		nlines=Math.ceil(numberofplots/subplotwidth);
+-	}
++	
+ 	if (options.list[0].exist('ncols')){
+-		ncols=options.list[0].getfieldvalue('ncols');
++		ncols = options.list[0].getfieldvalue('ncols');
++	} else {
++		ncols = subplotwidth;
+ 	}
+-	else {
+-		ncols=subplotwidth;
+-	}
+ 	
+ 	//check that nlines and ncols were given at the same time!
+-	if ((options.list[0].exist('ncols') & !options.list[0].exist('nlines')) | (options.list[0].exist('nlines') & !options.list[0].exist('ncols'))) throw Error('plotmodel error message: nlines and ncols need to be specified together, or not at all');
++	if ((options.list[0].exist('ncols') && !options.list[0].exist('nlines')) 
++	    || ((options.list[0].exist('nlines') && !options.list[0].exist('ncols')))) {
++    	    throw Error('plotmodel error message: nlines and ncols need to be specified together, or not at all');
++    }
+ 
+-	//go through subplots
+-	if (numberofplots){
+-		//Reinitialize all canvases
+-		for (var i=0;i<numberofplots;i++){
+-			if (options.list[i].getfieldvalue('clf','on')!='off') document.getElementById(options.list[i].getfieldvalue('canvasid')).initialized = false;
++	// Go through subplots
++	if (numberofplots) {
++		// Go through all data plottable and close window if an error occurs
++
++		let canvases = [];
++		for (let i = 0; i < numberofplots; ++i) {
++			canvases[i] = document.getElementById(options.list[i].getfieldvalue('canvasid'));
++			canvases[i].state.dispatchEvent('onPlotModelStart', canvases[i], options.list[i]);
+ 		}
+-		//Go through all data plottable and close window if an error occurs
+-		for (var i=0;i<numberofplots;i++){
+-			plot_manager(options.list[i].getfieldvalue('model',md),options.list[i],subplotwidth,nlines,ncols,i);
++		for (let i = 0; i < numberofplots; ++i) {
++			canvases[i].state.dispatchEvent('onPlotManagerStart', canvases[i], options.list[i]);
++			plot_manager(options.list[i].getfieldvalue('model',md), options.list[i], subplotwidth, nlines, ncols, i);
++			canvases[i].state.dispatchEvent('onPlotManagerEnd', canvases[i], options.list[i]);
+ 
+-			//List all unused options
++			// List all unused options
+ 			options.list[i].displayunused();
+ 		}
++		for (let i = 0; i < numberofplots; ++i) {
++			canvases[i].state.dispatchEvent('onPlotModelEnd', canvases[i], options.list[i]);
++		}
+ 	}
+ } //}}}
+Index: ../trunk-jpl/src/m/solve/solve.js
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.js	(revision 26299)
++++ ../trunk-jpl/src/m/solve/solve.js	(revision 26300)
+@@ -1,91 +1,117 @@
+-function solve(md, solutionstring) {//{{{
+-/**
+- * SOLVE - apply solution sequence for this model
+- *
+- *	Usage:
+- *		solve(md, solutionstring, varargin);
+- *		where varargin is a list of paired arguments of string OR enums
+- *
+- *	solution types available comprise:
+- *		- 'Stressbalance'		or 'sb'
+- *		- 'Masstransport'		or 'mt'
+- *		- 'Thermal'				or 'th'
+- *		- 'Steadystate'			or 'ss'
+- *		- 'Transient'			or 'tr'
+- *		- 'Balancethickness'	or 'mc'
+- *		- 'Balancevelocity'		or 'bv'
+- *		- 'BedSlope'			or 'bsl'
+- *		- 'SurfaceSlope'		or 'ssl'
+- *		- 'Hydrology'			or 'hy'
+- *		- 'DamageEvolution'		or 'da'
+- *		- 'Gia'					or 'gia'
+- *		- 'Sealevelchange'		or 'slc'
+- *
+- *	extra options:
+- *		- loadonly    		: do not solve, only load results
+- *		- runtimename 		: true or false (default is true), makes name unique
+- *		- checkconsistency 	: 'yes' or 'no' (default is 'yes'), ensures checks on consistency of model
+- *		- restart			: directory name (relative to the execution directory) where the restart file is located
+- *		- successCallback	: callback function to be called on success
+- *		- errorCallback		: callback function to be called on error
+- *
+- *	reporting:
+- *		With no optional arguments for reporting, progress and error reporting is written to the DOM element with ID 'solve-button'.
+- *		- solveButtonId		: overrides default solve button ID
+- *		- callout			: Callout to report progress/errors to; overrides reporting to solve button
+- *		- withProgressBar	: reports progress of certain solution stages with a progress bar; will not display if a Callout has not been provided
+- *
+- *	Examples:
+- *		md = solve(md, 'Stressbalance');
+- *		md = solve(md, 'sb');
+- */
+-	if (typeof solutionstring !== 'string') {
+-		throw Error(sprintf("%s\n", "ISSM's solve function only accepts strings for solution sequences. Type help solve to get a list of supported solutions."));
++async function solve(md, solutionstring, ...varargin) { //{{{
++/*
++SOLVE - apply solution sequence for this model
++
++Usage:
++	solve(md, solutionstring[, ...]);
++
++where varargin is a list of paired arguments of string OR enums
++
++Solution types available comprise:
++- 'Stressbalance'			or 'sb'
++- 'Masstransport'			or 'mt'
++- 'Oceantransport'			or 'oceant'
++- 'Thermal'					or 'th'
++- 'Steadystate'				or 'ss'
++- 'Transient'				or 'tr'
++- 'Balancethickness'		or 'mc'
++- 'BalancethicknessSoft'	or 'mcsoft'
++- 'Balancevelocity'			or 'bv'
++- 'BedSlope'				or 'bsl'
++- 'SurfaceSlope'			or 'ssl'
++- 'Hydrology'				or 'hy'
++- 'DamageEvolution'			or 'da'
++- 'Gia'						or 'gia'
++- 'Love'					or 'lv'
++- 'Esa'						or 'esa'
++- 'Sampling'				or 'smp'
++- 'Gmsh'
++
++Extra options (these all need to be passed in via the third parameter, which is 
++a rest parameter):
++- loadonly    		: do not solve, only load results
++- runtimename 		: true or false (default is true); makes name unique
++- checkconsistency 	: true or false (default is true); checks consistency of model
++- restart			: directory name (relative to the execution directory) where the restart file is located
++
++Examples:
++	md = solve(md, 'Stressbalance');
++	md = solve(md, 'sb');
++	
++NOTE:
++- We do not strictly need to return md as objects are passed by reference in 
++JavaScript, but we do so to mirror MATLAB and Python APIs.
++
++TODO:
++- Refactor UI reporting structure so we do not have to check if it is defined
++*/	
++ 
++/*
++	// Check that md exists and that it is a model
++ 	if (md === null || md === undefined || md.constructor.name !== 'model') {
++ 		throw new Error('md needs to be an instance of the model class');
++ 	}
++*/
++	
++	if (typeof(solutionstring) !== 'string') {
++		throw new Error('ISSM\'s solve function only accepts strings for solution sequences. Type help solve to get a list of supported solutions.');
+ 	}
+ 
+-	//recover and process solve options
+-	let solutionStringLowerCase = solutionstring.toLowerCase();
+-	
+-	if ((solutionStringLowerCase === 'sb') || (solutionStringLowerCase === 'stressbalance')) {
++	// Recover and process solve options
++	if (vesl.strings.strcmpi(solutionstring, 'sb') || vesl.strings.strcmpi(solutionstring, 'Stressbalance')) {
+ 		solutionstring = 'StressbalanceSolution';
+-	} else if ((solutionStringLowerCase === 'mt') || (solutionStringLowerCase === 'masstransport')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'mt') || vesl.strings.strcmpi(solutionstring, 'Masstransport')) {
+ 		solutionstring = 'MasstransportSolution';	
+-	} else if ((solutionStringLowerCase === 'th') || (solutionStringLowerCase === 'thermal')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'oceant') || vesl.strings.strcmpi(solutionstring, 'Oceantransport')) {
++		solutionstring = 'OceantransportSolution';	
++	} else if (vesl.strings.strcmpi(solutionstring, 'th') || vesl.strings.strcmpi(solutionstring, 'Thermal')) {
+ 		solutionstring = 'ThermalSolution';
+-	} else if ((solutionStringLowerCase === 'st') || (solutionStringLowerCase === 'steadystate')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'st') || vesl.strings.strcmpi(solutionstring, 'Steadystate')) {
+ 		solutionstring = 'SteadystateSolution';
+-	} else if ((solutionStringLowerCase === 'tr') || (solutionStringLowerCase === 'transient')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'tr') || vesl.strings.strcmpi(solutionstring, 'Transient')) {
+ 		solutionstring = 'TransientSolution';
+-	} else if ((solutionStringLowerCase === 'mc') || (solutionStringLowerCase === 'balancethickness')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'mc') || vesl.strings.strcmpi(solutionstring, 'Balancethickness')) {
+ 		solutionstring = 'BalancethicknessSolution';
+-	} else if ((solutionStringLowerCase === 'bv') || (solutionStringLowerCase === 'balancevelocity')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'mcsoft') || vesl.strings.strcmpi(solutionstring, 'BalancethicknessSoft')) {
++		solutionstring = 'BalancethicknessSoftSolution';
++	} else if (vesl.strings.strcmpi(solutionstring, 'bv') || vesl.strings.strcmpi(solutionstring, 'Balancevelocity')) {
+ 		solutionstring = 'BalancevelocitySolution';
+-	} else if ((solutionStringLowerCase === 'bsl') || (solutionStringLowerCase === 'bedslope')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'bsl') || vesl.strings.strcmpi(solutionstring, 'BedSlope')) {
+ 		solutionstring = 'BedSlopeSolution';
+-	} else if ((solutionStringLowerCase === 'ssl') || (solutionStringLowerCase === 'surfaceslope')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'ssl') || vesl.strings.strcmpi(solutionstring, 'SurfaceSlope')) {
+ 		solutionstring = 'SurfaceSlopeSolution';
+-	} else if ((solutionStringLowerCase === 'hy') || (solutionStringLowerCase === 'hydrology')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'hy') || vesl.strings.strcmpi(solutionstring, 'Hydrology')) {
+ 		solutionstring = 'HydrologySolution';
+-	} else if ((solutionStringLowerCase === 'da') || (solutionStringLowerCase === 'damageevolution')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'da') || vesl.strings.strcmpi(solutionstring, 'DamageEvolution')) {
+ 		solutionstring = 'DamageEvolutionSolution';
+-	} else if ((solutionStringLowerCase === 'gia') || (solutionStringLowerCase === 'gia')) {
++	} else if (vesl.strings.strcmpi(solutionstring, 'gia') || vesl.strings.strcmpi(solutionstring, 'Gia')) {
+ 		solutionstring = 'GiaSolution';
+-	} else if ((solutionStringLowerCase === 'slc') || (solutionStringLowerCase === 'sealevelchange')) {
+-		solutionstring = 'SealevelriseSolution';
++	} else if (vesl.strings.strcmpi(solutionstring, 'lv') || vesl.strings.strcmpi(solutionstring, 'Love')) {
++		solutionstring = 'LoveSolution';
++	} else if (vesl.strings.strcmpi(solutionstring, 'Esa')) {
++		solutionstring = 'EsaSolution';
++	} else if (vesl.strings.strcmpi(solutionstring, 'smp') || vesl.strings.strcmpi(solutionstring, 'Sampling')) {
++		solutionstring = 'SamplingSolution';
++	} else if (vesl.strings.strcmpi(solutionstring, 'gmsh')) {
++		solutionstring = 'GmshSolution';
++	} else if (vesl.strings.strcmpi(solutionstring, 'gmt')) {
++		solutionstring = 'GmtSolution';
+ 	} else {
+-		throw Error(sprintf("%s%s%s\n",'solutionstring ',solutionstring,' not supported!'));
++		throw new Error('solutionstring ' + solutionstring + ' not supported!');
+ 	}
++	let options = new pairoptions(varargin, 'solutionstring', solutionstring);
+ 	
+-	// Process options
+-	let args 	= Array.prototype.slice.call(arguments);
+-	let options = new pairoptions(args.slice(2, args.length));
+-	options.addfield('solutionstring', solutionstring);
+-
+-	// recover some fields
++	// Recover some fields
+ 	md.priv.solution 	= solutionstring;
+-	cluster 			= md.cluster;
+-
+-	//check model consistency
++	let cluster 		= md.cluster;
++	
++	// NOTE: Batch scripts are not currently implemented
++	let batch = 0; 
++	if (options.getfieldvalue('batch', 'no') === 'yes') {
++		batch = 1;
++	}
++	
++	// Check model consistency
+ 	if (options.getfieldvalue('checkconsistency', 'yes') === 'yes') {
+ 		if (md.verbose.solution) {
+ 			console.log('checking model consistency');
+@@ -93,30 +119,32 @@
+ 		
+ 		ismodelselfconsistent(md);
+ 	}
+-
++	
+ 	// If we are restarting, actually use the provided runtime name:
+ 	restart = options.getfieldvalue('restart', '');
+ 
+ 	// First, build a runtime name that is unique
+-	if (restart === 1 ) {
++	if (restart === 1) {
+ 		// Leave the runtimename as is
+ 	} else {
+-		if (!(restart === '')) {
+-			md.priv.runtimename=restart;
+-		} else if (options.getfieldvalue('runtimename',true)) {
+-			let c = new Date().getTime();
+-			md.priv.runtimename = sprintf('%s-%g', md.miscellaneous.name, c);
++		if (restart !== '') {
++			md.priv.runtimename = restart;
+ 		} else {
+-			md.priv.runtimename = md.miscellaneous.name;
++			if (options.getfieldvalue('runtimename', true)) {
++				let c = new Date().getTime();
++				md.priv.runtimename = sprintf('%s-%g', md.miscellaneous.name, c);
++			} else {
++				md.priv.runtimename = md.miscellaneous.name;
++			}
+ 		}
+ 	}
+ 
+-	// If running qmu analysis, some preprocessing of dakota files using models fields needs to be carried out
++	// If running QMU analysis, some preprocessing of Dakota files using model fields needs to be carried out
+ 	if (md.qmu.isdakota) {
+-		throw Error("solve error message: qmu runs not supported yet!");
+-		//md.preqmu(options);
++		throw new Error("QMU not supported yet!");
++		//md = preqmu(md, options);
+ 	}
+-
++	
+ 	// Do we load results only?
+ 	if (options.getfieldvalue('loadonly', false)){
+ 		loadresultsfromcluster(md);
+@@ -123,99 +151,55 @@
+ 		return;
+ 	}
+ 
+-	// Marshall into a binary array (fid) all the fields of model
+-	let fid = marshall(md); // bin file
+-	
+-	//deal with toolkits options: 
+-	toolkitsstring = md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits'); // toolkits file
+-
+-
+ 	/*
+-		Set success callback function
+-		
+-		Default: do nothing if no success callback function requested
+-	*/
+-	//{{{
+-	function successCallbackDefault() {
+-		solving = false;
+-	}; 
++	Write all input arrays (as opposed to, under MATLAB/Python, input binary 
++	files)
+ 	
+-	let successCallback = options.getfieldvalue('successCallback', successCallbackDefault);
+-	//}}}
+-	
+-	
+-	/*
+-		Set error callback function
+-		
+-		Default: do nothing if no error callback function requested
++	NOTE: The JavaScript implementation diverges significantly from the 
++		  MATLAB/Python APIs here.
+ 	*/
+-	//{{{ 
+-	function errorCallbackDefault() {
+-		solving = false;
+-	}; 
+-	
+-	let errorCallback = options.getfieldvalue('errorCallback', errorCallbackDefault);
+-	//}}}
+-	
+-	
+-	/*
+-		Set solve button ID
+-		
+-		Default: update #solve-button element with progress updates
+-	*/
+-	//{{{
+-	let solveButtonId = options.getfieldvalue('solveButtonId', '#solve-button');
+-	//}}}
+-	
+-	
+-	/*
+-		Set Callout
+-	*/
+-	//{{{
+-	var callout = {};
+-	
+-	// Default: Callout is an empty object
+-	callout = options.getfieldvalue('callout', {});
+-	//}}}
+-	
+-	
+-	/*
+-		Set progress bar display boolean
+-		
+-		Default: no progress bar
+-		
+-		NOTE: must have supplied a callout for progress bar to display
+-	*/
+-	//{{{
+-	let withProgressBar = options.getfieldvalue('withProgressBar', false);
+-	//}}}
++	let fid = null; // bin file equivalent
++	//TODO: FIND A BETTER WAY TO DO THIS! (IE, SYNC UP WRITEDATA AND HAVE A FULL DEMARSHALL/READMODEL IN PYTHON
++	if (solutionstring === 'GmshSolution') {
++		//open file for binary writing
++		fid = new fileptr('mode','w');
++	} else if (solutionstring === 'GmtSolution') {
++		//open file for binary writing
++		fid = new fileptr('mode','w');
++		let prefix='md.mesh';
++		WriteData(fid,prefix,'object',md.mesh,'fieldname','lat','format','DoubleMat','mattype',1);
++		WriteData(fid,prefix,'object',md.mesh,'fieldname','long','format','DoubleMat','mattype',1);
++	} else {
++		// Marshall into a binary array (fid) all the fields of model
++		fid = marshall(md); // bin file
++	}
++	let toolkitsstring = md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits'); // toolkits file equivalent
+ 
+-
+ 	if (cluster.classname() === 'local') {//{{{
+ 
+-		// We are running locally on the machine, using the issm module
++		// We are running locally on the machine, using the ISSM module
+ 		console.log('running issm locally');
+ 		
+-		// Call issm
++		// Call ISSM
+ 		let outputs = issm(fid, toolkitsstring, solutionstring, md.miscellaneous.name); 
+ 		
+-		// Recover output arguments:
++		// Recover output
+ 		let outputbuffer 		= outputs[0]; 
+ 		let outputbuffersize 	= outputs[1];
+ 			
+ 		// Load results 
+-		md = loadresultsfrombuffer(md, outputbuffer, outputbuffersize); 
++		md = loadresultsfrombuffer(md, outputbuffer, outputbuffersize); // TODO: Pass reporting construct to loadresultsfrombuffer
+ 		
+-		// Call success callback 
+-		successCallback();
+-
+-		return md;
++		// Call success callback
++		if (vesl.helpers.isFunction(vesl.ui.reporting.success_callback)) {
++			vesl.ui.reporting.success_callback();
++		}
+ 	//}}}
+-	} else {//{{{
++	} else { //{{{
+ 		// We are running somewhere else on a computational server. Send the buffer to that server and retrieve output.
+ 		console.log('running issm remotely');
+ 		
+-		cluster.UploadAndRun(
++		await cluster.uploadandrun(
+ 			md, 
+ 			fid, 
+ 			toolkitsstring, 
+@@ -222,14 +206,24 @@
+ 			solutionstring, 
+ 			md.miscellaneous.name, 
+ 			md.priv.runtimename,
+-			successCallback, 
+-			errorCallback, 
+-			solveButtonId, 
+-			callout, 
+-			withProgressBar
+-		);
+-
++			options
++		);/*
++.catch(function(e) {
++			if (vesl.helpers.isDefined(vesl.ui) && vesl.helpers.isDefined(vesl.ui.reporting) && vesl.helpers.isFunction(vesl.ui.reporting.error_callback)) {
++				vesl.ui.reporting.error_callback(e);
++			}
++		}).catch(function(e) {
++			// Handle unexpected errors (source: http://thecodebarbarian.com/async-await-error-handling-in-javascript.html)
++			console.log(e);
++		});
++			
++		if (vesl.helpers.isDefined(vesl.ui) && vesl.helpers.isDefined(vesl.ui.reporting) && vesl.helpers.isFunction(vesl.ui.reporting.success_callback)) {
++			vesl.ui.reporting.success_callback(md);
++		}
++*/
++		
++		// Why is md undefined at vesl.ui.reporting.success_callback(md)? See issm-refactor
++		
+ 		return md;
+-	}//}}}
+-}//}}}
+-
++	} //}}}
++} //}}}
+Index: ../trunk-jpl/src/m/classes/flowequation.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/flowequation.js	(revision 26300)
+@@ -21,9 +21,11 @@
+ 		fielddisplay(this,'isSIA','is the Shallow Ice Approximation (SIA) used ?');
+ 		fielddisplay(this,'isSSA','is the Shelfy-Stream Approximation (SSA) used ?');
+ 		fielddisplay(this,'isL1L2','is the L1L2 approximation used ?');
+-		fielddisplay(this,'isMLHO','is the MLHO approximation used ?');
++		fielddisplay(this,'isMLHO','is the Mono-Layer Higher-Order approximation used?');
+ 		fielddisplay(this,'isHO','is the Higher-Order (HO) approximation used ?');
+ 		fielddisplay(this,'isFS','are the Full-FS (FS) equations used ?');
++		fielddisplay(this,'isNitscheBC','is weakly imposed condition used?');
++		fielddisplay(this,'FSNitscheGamma','Gamma value for the Nitsche term (default: 1e6)');
+ 		fielddisplay(this,'fe_SSA',"Finite Element for SSA  'P1', 'P1bubble' 'P1bubblecondensed' 'P2'");
+ 		fielddisplay(this,'fe_HO', "Finite Element for HO   'P1' 'P1bubble' 'P1bubblecondensed' 'P1xP2' 'P2xP1' 'P2'");
+ 		fielddisplay(this,'fe_FS', "Finite Element for FS   'P1P1' (debugging only) 'P1P1GLS' 'MINIcondensed' 'MINI' 'TaylorHood' 'XTaylorHood'");
+@@ -59,6 +61,8 @@
+ 			checkfield(md,'fieldname','flowequation.isMLHO','numel',[1],'values',[0, 1]);
+ 			checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0, 1]);
+ 			checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','flowequation.isNitscheBC','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','flowequation.FSNitscheGamma','numel',[1], '>=', 0);
+ 			checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble']);
+ 			checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4']);
+ 			checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart','LACrouzeixRaviart']);
+@@ -79,21 +83,21 @@
+ 				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[1,2]);
+ 			}
+ 			else if (md.mesh.domaintype() =='2Dvertical'){
+-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[2,5,6]);
+-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[2,5,6]);
++				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[2,4,5]);
++				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[2,4,5]);
+ 			}
+ 			else if (md.mesh.domaintype() =='3D'){
+-				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[0,1,2,3,4,5,6,7,8,9]);
+-				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[0,1,2,3,4,5,6,7,8,9]);
++				checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices, 1],'values',[0,1,2,3,4,5,6,7,8]);
++				checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements, 1],'values',[0,1,2,3,4,5,6,7,8]);
+ 			}
+ 			else throw Error('Case not supported yet');
+ 			
+ 			if (!(this.isSIA | this.isSSA | this.isL1L2 | this.isMLHO | this.isHO | this.isFS)){
+-				md = checkmessage(md,['no element types set for this model']);
++				checkmessage(md,['no element types set for this model']);
+ 			}
+ 			if(ArrayAnyEqual(ArrayIsMember('StressbalanceSIAAnalysis', analyses),1)){
+ 				if (ArrayAnyEqual(this.element_equation,1)){
+-					if(this.vertex_equation & ArrayAnyBelowStrict(md.mask.ocean_levelset)){
++					if(this.vertex_equation & ArrayAnyBelowStrict(md.mask.groundedice_levelset)){
+ 						console.log(sprintf("\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n"));
+ 					}
+ 				}
+@@ -106,6 +110,8 @@
+ 			WriteData(fid,prefix,'object',this,'fieldname','isMLHO','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isHO','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isFS','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isNitscheBC','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','FSNitscheGamma','format','Double');
+ 			WriteData(fid,prefix,'object',this,'fieldname','fe_SSA','data',this.fe_SSA,'format','String');
+ 			WriteData(fid,prefix,'object',this,'fieldname','fe_HO','data',this.fe_HO,'format','String');
+ 			WriteData(fid,prefix,'object',this,'fieldname','fe_FS','data',this.fe_FS,'format','String');
+@@ -134,6 +140,8 @@
+ 	this.isMLHO                         = 0;
+ 	this.isHO                           = 0;
+ 	this.isFS                           = 0;
++	this.isNitscheBC                    = 0;
++	this.FSNitscheGamma                 = 0;
+ 	this.fe_SSA                         = '';
+ 	this.fe_HO                          = '';
+ 	this.fe_FS                          = '';
+Index: ../trunk-jpl/src/m/classes/fourierlove.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/fourierlove.js	(revision 26300)
+@@ -10,16 +10,26 @@
+ 	} // }}}
+ 	this.setdefaultparameters = function() { // {{{
+ 		//we setup an elastic love number computation by default.
+-		this.nfreq=1; 
+-		this.frequencies=[0]; //Hz
+-		this.sh_nmax=256; // .35 degree, 40 km at the equator.
+-		this.sh_nmin=1; 
+-		this.g0=10; // m/s^2; 
+-		this.r0=6378*1e3; //m;
+-		this.mu0=10**11; // Pa
+-		this.allow_layer_deletion=1; 
+-		this.love_kernels=0; 
+-		this.forcing_type = 11; 
++			this.nfreq=1; 
++			this.frequencies=[0]; //Hz
++			this.sh_nmax=256; // .35 degree, 40 km at the equator.
++			this.sh_nmin=1;
++			// work on matlab script for computing g0 for given Earth's structure. 
++			this.g0=9.81; // m/s^2; 
++			this.r0=6371*1e3; //m;
++			this.mu0=10^11; // Pa
++			this.Gravitational_Constant=6.67259e-11; // m^3 kg^-1 s^-2
++			this.allow_layer_deletion=1;
++			this.underflow_tol=1e-16; //threshold of deep to surface love number ratio to trigger the deletion of layer 
++			this.integration_steps_per_layer=100;
++			this.istemporal=0;
++			this.n_temporal_iterations=8;
++			this.time=[0]; //s
++			this.love_kernels=0; 
++			this.forcing_type = 11; // surface loading
++			this.inner_core_boundary=1;
++			this.core_mantle_boundary=2;
++			this.complex_computation=0;
+ 	} // }}}
+ 	this.disp = function() { // {{{
+ 		fielddisplay(this,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]');
+@@ -27,28 +37,63 @@
+ 		fielddisplay(this,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)');
+ 		fielddisplay(this,'sh_nmin','minimum spherical harmonic degree (default 1)');
+ 		fielddisplay(this,'g0','adimensioning constant for gravity (default 10) [m/s^2]');
+-		fielddisplay(this,'r0','adimensioning constant for radius (default 6378*10^3) [m]');
++		fielddisplay(this,'r0','adimensioning constant for radius (default 6371*10^3) [m]');
+ 		fielddisplay(this,'mu0','adimensioning constant for stress (default 10^11) [Pa]');
++		fielddisplay(this,'Gravitational_Constant','Newtonian constant of gravitation (default 6.67259e-11 [m^3 kg^-1 s^-2])');
+ 		fielddisplay(this,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)');
++		fielddisplay(this,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default 2.2204460492503131E-016)');
++		fielddisplay(this,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default 100)');
++		fielddisplay(this,'istemporal','1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency');
++		fielddisplay(this,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default 8)');
++		fielddisplay(this,'time','time vector for deformation if istemporal (default 0) [s]');
+ 		fielddisplay(this,'love_kernels','compute love numbers at depth? (default 0)');
+-		fielddisplay(this,'forcing_type',['integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction ']); 
++		fielddisplay(this,'forcing_type','integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction ');
++		fielddisplay(this,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default 1)');
++		fielddisplay(this,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default 2)'); 
+ 
+ 	} // }}}
+ 	this.checkconsistency = function(md,solution,analyses) { // {{{
+ 
+-		md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
+-		md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
+-		md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
+-		md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
+-		md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
+-		md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
+-		md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
+-		md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0, 1]);
+-		md = checkfield(md,'fieldname','love.love_kernels','values',[0, 1]);
+-		md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
+-		if (md.love.sh_nmin<=1 && md.love.forcing_type==9) {
++		if (ArrayAnyEqual(ArrayIsMember('LoveAnalysis',analyses),1)) return; 
++
++		checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',md.love.nfreq);
++		checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.Gravitational_Constant','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.allow_layer_deletion','values',[0, 1]);
++		checkfield(md,'fieldname','love.underflow_tol','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.integration_steps_per_layer','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','love.love_kernels','values',[0, 1]);
++		checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',1,'>',0, '<=', 12);
++		checkfield(md,'fieldname','love.complex_computation','NaN',1,'Inf',1,'numel',1,'values',[0, 1]);
++
++		checkfield(md,'fieldname','love.istemporal','values',[0, 1]);
++
++		if (md.love.istemporal==1){
++			checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
++			checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
++		}
++		if (md.love.sh_nmin<=1 && md.love.forcing_type==9 || md.love.forcing_type==5 || md.love.forcing_type==1) {
+ 			throw 'Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.';
+ 		}
++
++		//need 'litho' material: 
++		console.log('md.fourierlove check consistency only paritally implemented for litho material');
++		/*
++		if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
++			error('Need a ''litho'' material to run a Fourier Love number analysis');
++		end
++
++		mat=find(strcmpi(md.materials.nature,'litho'));
++		if (md.love.forcing_type<=4) {
++			checkfield(md,'fieldname','love.inner_core_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
++		} else if (md.love.forcing_type<=8) {
++			checkfield(md,'fieldname','love.core_mantle_boundary','NaN',1,'Inf',1,'numel',1,'>',0, '<=', md.materials(mat).numlayers);
++		} */
+ 	} // }}}
+ 	this.marshall = function(md,prefix,fid) { // {{{
+ 	
+@@ -59,24 +104,41 @@
+ 		WriteData(fid,prefix,'object',this,'fieldname','g0','format','Double');
+ 		WriteData(fid,prefix,'object',this,'fieldname','r0','format','Double');
+ 		WriteData(fid,prefix,'object',this,'fieldname','mu0','format','Double');
++		WriteData(fid,prefix,'object',this,'fieldname','Gravitational_Constant','format','Double');
+ 		WriteData(fid,prefix,'object',this,'fieldname','allow_layer_deletion','format','Boolean');
++		WriteData(fid,prefix,'object',this,'fieldname','underflow_tol','format','Double');
++		WriteData(fid,prefix,'object',this,'fieldname','integration_steps_per_layer','format','Integer');
++		WriteData(fid,prefix,'object',this,'fieldname','istemporal','format','Boolean');
++		WriteData(fid,prefix,'object',this,'fieldname','n_temporal_iterations','format','Integer');
++		WriteData(fid,prefix,'object',this,'fieldname','complex_computation','format','Boolean');
++		//note: no need to marshall the time vector, we have frequencies
+ 		WriteData(fid,prefix,'object',this,'fieldname','love_kernels','format','Boolean');
+ 		WriteData(fid,prefix,'object',this,'fieldname','forcing_type','format','Integer');
++		WriteData(fid,prefix,'object',this,'fieldname','inner_core_boundary','format','Integer');
++		WriteData(fid,prefix,'object',this,'fieldname','core_mantle_boundary','format','Integer');
+ 
+ 	} // }}}
+ 	//properties 
+ 	// {{{
+-		
+-	this.nfreq                =  NaN;
+-	this.frequencies          =  NaN;
+-	this.sh_nmax              =  NaN;
+-	this.sh_nmin              =  NaN;
+-	this.g0                   =  NaN; 
+-	this.r0                   =  NaN; 
+-	this.mu0                  =  NaN;
+-	this.allow_layer_deletion =  NaN;
+-	this.love_kernels =  NaN;
+-	this.forcing_type         =  NaN;
++	this.nfreq                		= NaN;
++	this.frequencies          		= NaN;
++	this.sh_nmax              		= NaN;
++	this.sh_nmin              		= NaN;
++	this.g0                   		= NaN; 
++	this.r0                   		= NaN; 
++	this.mu0                  		= NaN;
++	this.Gravitational_Constant 	= 0;
++	this.allow_layer_deletion 		= NaN;
++	this.underflow_tol              = 0;
++	this.integration_steps_per_layer= 0;
++	this.istemporal		   			= 0;
++	this.n_temporal_iterations	  	= 0;
++	this.time			            = 0;
++	this.love_kernels 				= NaN;
++	this.forcing_type         		= NaN;
++	this.inner_core_boundary	    = 0;
++	this.core_mantle_boundary	    = 0;
++	this.complex_computation        = 0;
+ 	
+ 	//set defaults
+ 	this.setdefaultparameters();
+Index: ../trunk-jpl/src/m/classes/friction.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/friction.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/friction.js	(revision 26300)
+@@ -13,7 +13,9 @@
+ 		fielddisplay(this,'coefficient','friction coefficient [SI]');
+ 		fielddisplay(this,'p','p exponent');
+ 		fielddisplay(this,'q','q exponent');
++		fielddisplay(this,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
+ 		fielddisplay(this,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)');
++		fielddisplay(this,'effective_pressure_limit','Neff do not allow to fall below a certain limit: effective_pressure_limit*rho_ice*g*thickness (default 0)');
+ 	} // }}}
+ 	this.extrude = function(md) {//{{{
+ 		this.coefficient = project3d(md, 'vector', this.coefficient, 'type', 'node', 'layer', 1);
+@@ -41,14 +43,15 @@
+ 			if ((!ArrayAnyEqual(ArrayIsMember('StressbalanceAnalysis',analyses),1)) & (!ArrayAnyEqual(ArrayIsMember('StressbalanceAnalysis',analyses),1))){
+ 				return; 
+ 			}
+-			md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
+-			md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
+-			md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
+-			md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0, 1, 2]);
++			checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1);
++			checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
++			checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements ,1]);
++			checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0, 1, 2]);
++			checkfield(md,'fieldname','friction.effective_pressure_limit','numel',[1],'>=',0);
+ 			switch (this.coupling) {
+ 				case 0:
+ 				case 1:
+-					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
++					checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
+ 					break;
+ 				case 2:
+ 					console.error('not implemented yet');
+@@ -62,11 +65,19 @@
+ 			var yts=md.constants.yts;
+ 
+ 			WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer');
+-			WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			//WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1);
++			let mattype,tsl;
++			if ((size(this.coefficient,1)==md.mesh.numberofvertices | size(this.coefficient,1)==md.mesh.numberofvertices+1)) {
++				mattype=1;
++				tsl = md.mesh.numberofvertices;
++			} else {
++				mattype=2;
++				tsl = md.mesh.numberofelements;
++			}
++			WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',this,'fieldname','p','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'object',this,'fieldname','q','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'class','friction','object',this,'fieldname','coupling','format','Integer');
++			WriteData(fid,prefix,'object',this,'class','friction','fieldname','effective_pressure_limit','format','Double');
+ 			switch (this.coupling) {
+ 				case 0:
+ 				case 1:
+@@ -78,18 +89,17 @@
+ 				default:
+ 					console.error('not supported yet');		
+ 			}
+-			
+-
+ 		}//}}}
+ 		this.fix=function() { //{{{
+ 		}//}}}
+ 	//properties 
+ 	//{{{
+-	this.coefficient = NaN;
+-	this.p           = NaN;
+-	this.q           = NaN;
+-	this.coupling    = 0;
+-	this.effective_pressure = NaN;
++	this.coefficient			  = NaN;
++	this.p						  = NaN;
++	this.q						  = NaN;
++	this.coupling				  = 0;
++	this.effective_pressure 	  = NaN;
++	this.effective_pressure_limit = 0;
+ 	this.setdefaultparameters();
+ 	//}}}
+ }
+Index: ../trunk-jpl/src/m/classes/geometry.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/geometry.js	(revision 26300)
+@@ -29,7 +29,7 @@
+ 		this.checkconsistency = function(md,solution,analyses) { //{{{
+ 
+ 			if ((solution=='TransientSolution' & md.trans.isgia) | (solution=='GiaSolution')){
+-				checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1);
++				checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1,'>=',0);
+ 			}
+ 			else{
+ 				checkfield(md,'fieldname','geometry.surface'  ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]);
+@@ -37,7 +37,7 @@
+ 				checkfield(md,'fieldname','geometry.thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1],'>',0);
+ 				for(var i=0;i<md.mesh.numberofvertices;i++){
+ 					if (Math.abs(md.geometry.thickness[i]-md.geometry.surface[i]+md.geometry.base[i])>Math.pow(10,9)){
+-						md = checkmessage(md,'equality thickness=surface-base violated');
++						checkmessage(md,'equality thickness=surface-base violated');
+ 						break;
+ 					}
+ 				}
+@@ -47,8 +47,15 @@
+ 			}
+ 		} // }}}
+ 		this.marshall=function(md,prefix,fid) { //{{{
++			let length_thickness=size(this.thickness,1);
++			if (length_thickness==md.mesh.numberofvertices || length_thickness==md.mesh.numberofvertices+1) {
++				WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			} else if (length_thickness==md.mesh.numberofelements || length_thickness==md.mesh.numberofelements+1) {
++				WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			} else {
++				error('geometry thickness time series should be a vertex or element time series');
++			}
+ 			WriteData(fid,prefix,'object',this,'fieldname','surface','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',this,'fieldname','base','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','bed','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);
+Index: ../trunk-jpl/src/m/classes/groundingline.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/groundingline.js	(revision 26300)
+@@ -7,9 +7,9 @@
+ 	//methods
+ 	this.setdefaultparameters = function(){// {{{
+ 		//Type of migration
+-		this.migration='AggressiveMigration';
+-		this.friction_interpolation='SubelementFriction1';
+-		this.melt_interpolation='NoMeltOnPartiallyFloating';
++		this.migration				= 'SubelementMigration';
++		this.friction_interpolation	= 'SubelementFriction1';
++		this.melt_interpolation		= 'NoMeltOnPartiallyFloating';
+ 
+ 	}// }}}
+ 	this.disp= function(){// {{{
+@@ -28,17 +28,17 @@
+ 			checkfield(md,'fieldname','groundingline.friction_interpolation','values',['NoFrictionOnPartiallyFloating', 'SubelementFriction1', 'SubelementFriction2']);
+ 			checkfield(md,'fieldname','groundingline.melt_interpolation','values',['NoMeltOnPartiallyFloating', 'SubelementMelt1', 'SubelementMelt2', 'FullMeltOnPartiallyFloating']);
+ 
+-			if(this.migration !='None' & md.trans.isgroundingline==1 & solution == 'TransientSolution'){
++			if (this.migration !='None'){
+ 				if (isNaN(md.geometry.bed)){
+ 					md.checkmessage('requesting grounding line migration, but bathymetry is absent!');
+ 				}
+ 				for (var i=0;i<md.mesh.numberofvertices;i++){
+-					if(md.mask.ocean_levelset[i]>0){
++					if(md.mask.groundedice_levelset[i]>0){
+ 						md.checkmessage('base not equal to bed on grounded ice!');
+ 						break;
+ 					}
+ 					if(md.geometry.bed[i] - md.geometry.base[i] > Math.pow(10,-9)){
+-						md = checkmessage(md,'bed superior to base on floating ice!');
++						checkmessage(md,'bed superior to base on floating ice!');
+ 						break;
+ 					}
+ 				}
+Index: ../trunk-jpl/src/m/classes/levelset.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/levelset.js	(revision 26300)
+@@ -10,6 +10,11 @@
+ 		//stabilization = 2 by default
+ 		this.stabilization		= 2;
+ 		this.reinit_frequency	= 5;
++		this.kill_icebergs      = 1;
++		this.migration_max      = 1e12; //No need for general cases, unless specified
++
++		//Linear elements by default
++		this.fe='P1';
+ 	
+ 	}// }}}
+ 	this.disp= function(){// {{{
+@@ -18,12 +23,15 @@
+ 		fielddisplay(this,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
+ 		fielddisplay(this,'spclevelset','Levelset constraints (NaN means no constraint)');
+ 		fielddisplay(this,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized (NaN: no re-initialization).');
++		fielddisplay(this,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
++		fielddisplay(this,'migration_max','maximum allowed migration rate (m/a)');
++		fielddisplay(this,'fe','Finite Element type: "P1" (default), or "P2"');
+ 
+ 	}// }}}
+-	this.extrude = function(md) {//{{{
+-		this.spclevelset=project3d(md,'vector',this.spclevelset,'type','node');
+-		return this;
+-	}//}}}
++    this.extrude = function(md) {//{{{
++        this.spclevelset=project3d(md,'vector',this.spclevelset,'type','node');
++        return this;
++    }//}}}
+ 	this.classname= function(){// {{{
+ 		return "levelset";
+ 	}// }}}
+@@ -33,22 +41,33 @@
+ 
+ 		checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
+ 		checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2]);
++		checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0, 1]);
++		checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
++		checkfield(md,'fieldname','levelset.fe','values',['P1','P2']);
+ 	} //}}}
+ 	this.marshall=function(md,prefix,fid) { //{{{
++
++		let yts=md.constants.yts;
++
+ 		WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
+ 		WriteData(fid,prefix,'object',this,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 		WriteData(fid,prefix,'object',this,'fieldname','reinit_frequency','format','Integer');
+-
++		WriteData(fid,prefix,'object',this,'fieldname','kill_icebergs','format','Boolean');
++		WriteData(fid,prefix,'object',this,'fieldname','migration_max','format','Double','scale',1/yts);
++		WriteData(fid,prefix,'object',this,'fieldname','fe','format','String');
+ 	}//}}}
+-	this.fix=function() { //{{{
+-		this.spclevelset=NullFix(this.spclevelset,NaN);
+-	}//}}}
++		this.fix=function() { //{{{
++			this.spclevelset=NullFix(this.spclevelset,NaN);
++		}//}}}
+ 	//properties 
+ 	// {{{
+ 
+ 	this.stabilization		= 0;
+-	this.spclevelset			= NaN;
++	this.spclevelset		= NaN;
+ 	this.reinit_frequency	= NaN;
++	this.kill_icebergs     	= 0;
++	this.migration_max      = 0.;
++	this.fe              	= 'P1';
+ 
+ 	this.setdefaultparameters();
+ 	//}}}
+Index: ../trunk-jpl/src/m/classes/timestepping.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/timestepping.js	(revision 26300)
+@@ -5,7 +5,7 @@
+ 
+ function timestepping (){
+ 	//methods
+-	this.setdefaultparameters = function(){// {{{
++	this.setdefaultparameters = function(){ //{{{
+ 		//time between 2 time steps
+ 		this.time_step=1./2.;
+ 
+@@ -13,10 +13,10 @@
+ 		this.final_time=10.*this.time_step;
+ 
+ 		//should we interpolate forcings between timesteps?
+-		this.interp_forcings=1;
++		this.interp_forcing=1;
+ 		this.cycle_forcing=0;
+-	}// }}}
+-	this.disp= function(){// {{{
++	} //}}}
++	this.disp= function(){ //{{{
+ 
+ 		var unit;
+ 		console.log(sprintf('   timestepping parameters:'));
+@@ -24,26 +24,30 @@
+ 		fielddisplay(this,'start_time','simulation starting time ['+ unit + ']');
+ 		fielddisplay(this,'final_time','final time to stop the simulation ['+ unit + ']');
+ 		fielddisplay(this,'time_step','length of time steps [' +unit+ ']');
+-		fielddisplay(this,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
++		fielddisplay(this,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
+ 		fielddisplay(this,'cycle_forcing','cycle through forcing ? (0 or 1)');
+ 		fielddisplay(this,'coupling_time','length of coupling time steps with ocean model [' +unit+ ']');
+ 
+-	}// }}}
+-	this.classname= function(){// {{{
++	} //}}}
++	this.classname= function(){ //{{{
+ 		return "timestepping";
+ 
+-	}// }}}
++	} //}}}
+ 	this.checkconsistency = function(md,solution,analyses) { //{{{
+ 
+ 		checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1);
+ 		checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1);
+ 		checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
+-		checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1]);
++		checkfield(md,'fieldname','timestepping.interp_forcing','numel',[1],'values',[0,1]);
+ 		checkfield(md,'fieldname','timestepping.cycle_forcing','numel',[1],'values',[0,1]);
+ 		checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 		if (this.final_time-this.start_time<0){
+ 			md.checkmessage('timestepping.final_time should be larger than timestepping.start_time');
+ 		}
++		if (solution=='TransientSolution'){
++			checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1);
++			checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
++		}
+ 	} // }}}
+ 	this.marshall=function(md,prefix,fid) { //{{{
+ 
+@@ -54,7 +58,7 @@
+ 		WriteData(fid,prefix,'object',this,'fieldname','start_time','format','Double','scale',scale);
+ 		WriteData(fid,prefix,'object',this,'fieldname','final_time','format','Double','scale',scale);
+ 		WriteData(fid,prefix,'object',this,'fieldname','time_step','format','Double','scale',scale);
+-		WriteData(fid,prefix,'object',this,'fieldname','interp_forcings','format','Boolean');
++		WriteData(fid,prefix,'object',this,'fieldname','interp_forcing','format','Boolean');
+ 		WriteData(fid,prefix,'object',this,'fieldname','cycle_forcing','format','Boolean');
+ 		WriteData(fid,prefix,'object',this,'fieldname','coupling_time','format','Double','scale',scale);
+ 
+@@ -66,8 +70,8 @@
+ 	this.start_time      = 0.;
+ 	this.final_time      = 0.;
+ 	this.time_step       = 0.;
+-	this.interp_forcings = 1;
+-	this.cycle_forcing   = 0;
++	this.interp_forcing  = 1;
++	this.cycle_forcing   = 1;
+ 	this.coupling_time   = 0.;
+ 
+ 	this.setdefaultparameters();
+Index: ../trunk-jpl/src/m/classes/trans.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/trans.js	(revision 26299)
++++ ../trunk-jpl/src/m/classes/trans.js	(revision 26300)
+@@ -78,17 +78,17 @@
+ 			prefix='md.transient';
+ 			WriteData(fid,prefix,'object',this,'fieldname','issmb','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','ismasstransport','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isoceantransport','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isstressbalance','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isthermal','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isgroundingline','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isgia','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isesa','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isdamageevolution','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','ishydrology','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','ismovingfront','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isslr','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','issampling','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isslc','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','isoceancoupling','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','iscoupler','format','Boolean');
+ 			WriteData(fid,prefix,'object',this,'fieldname','amr_frequency','format','Integer');
+ 
+ 			//process requested outputs
+Index: ../trunk-jpl/src/m/plot/plot_contour.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_contour.js	(nonexistent)
++++ ../trunk-jpl/src/m/plot/plot_contour.js	(revision 26300)
+@@ -0,0 +1,299 @@
++function plot_contour(md, datain, options, canvas) { //{{{
++	//PLOT_MESH - Function for plotting wireframe contour.
++	//
++	//   Usage:
++	//      plot_contour(md, options, canvas);
++	//
++	//   See also: PLOTMODEL, PLOT_MANAGER
++
++	//{{{
++	//Process data and model
++	//let meshresults = processmesh(md, [], options);
++	//let [x, y, z, index, is2d, isplanet, vertices, scale] = scaleMesh(md, meshresults, options);
++	let [x, y, z, index, is2d, isplanet]=processmesh(md,[],options);
++	options.removefield('log',0);;
++	let [data, datatype]=processdata(md,datain,options);
++	if (vesl.helpers.isEmptyOrUndefined(data)) error('data provided is empty');
++	
++	//check is2d
++	if (!is2d && !isplanet) {
++		error('plot_contour error message: contour not supported for 3d meshes, project on a layer');
++	}
++
++	//first, process data: must be on nodes
++	if (datatype==1) {
++		//elements -> take average
++		//data=averaging(md,data,0);
++		error('plot_contour error message: contour not supported for element data yet');
++	} else if (datatype==2) {
++		//nodes -> do nothing
++	} else if (datatype==3) {
++		//quiver -> take norm
++		//data=sqrt(sum(datain.*datain,2)); //(original)
++		//data=ArraySqrt(ArraySum(ArrayMultiply(datain, datain),2)); //js version
++		error('plot_contour error message: contour not supported for quiver data yet');
++	} else {
++		error('datatype not supported yet');
++	}
++
++	//prepare colors
++	if (options.exist('contouronly')) {
++		//remove the previous plots
++		//cla
++		error('contouronly not supported yet');
++	}
++	let color=options.getfieldvalue('contourcolor','yellow');
++	let linewidth=options.getfieldvalue('linewidth',1);
++
++	//get contours levels
++	let contourlevels=options.getfieldvalue('contourlevels');
++	let levels;
++	if (typeof(contourlevels) == 'number') {
++		//levels=round_ice(linspace(max(data),min(data),contourlevels),2);
++		error('numeric contourlevels not supported yet - must provide levels as an array');
++	} else {
++		//levels=sort(unique(levels),'descend');
++		levels=ArraySort(ArrayUnique(contourlevels)).reverse();
++	}
++	let numlevels=levels.length;
++
++	//initialization of some variables
++	let numberofelements=index.length; //same as size(index,1)
++	let elementslist=NewArrayFillIncrement(0,numberofelements,1); //1:numberofelements;
++	let c=[];
++	let h=[];;
++
++	//get unique edges in mesh
++	//1: list of edges
++	index = ArraySubtract2D(index, 1);
++	//edges=[index[:,[1,2]); index(:,[2,3]); index(:,[3,1])];
++	let edges=ArrayConcat(ArrayConcat(ArrayCol(index,[0,1]), ArrayCol(index,[1,2])), ArrayCol(index,[2,0]));
++	//2: find unique edges
++	//[edges,I,J]=unique(sort(edges,2),'rows');
++	[edges,I,J]=ArrayUnique(ArraySort(edges,2),'rows');
++	//3: unique edge numbers
++	let vec=J;
++	//4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
++	//   the same edge number)
++	let edges_tria=ArrayTranspose([ArrayIndex(vec,elementslist), ArrayIndex(vec,ArrayAdd(elementslist,numberofelements)), ArrayIndex(vec,ArrayAdd(elementslist,2*numberofelements))]);
++
++	//segments [nodes1 nodes2]
++	let Seg1=ArrayCol(index,[0,1]);
++	let Seg2=ArrayCol(index,[1,2]);
++	let Seg3=ArrayCol(index,[2,0]);
++	
++	//segment numbers [1;4;6;...]
++	let Seg1_num=ArrayCol(edges_tria,0);
++	let Seg2_num=ArrayCol(edges_tria,1);
++	let Seg3_num=ArrayCol(edges_tria,2);
++
++	//value of data on each tips of the segments
++	let Data1=ArrayIndex(data,Seg1);
++	let Data2=ArrayIndex(data,Seg2);
++	let Data3=ArrayIndex(data,Seg3);
++
++	//get the ranges for each segment
++	let Range1=ArraySort(Data1,2);
++	let Range2=ArraySort(Data2,2);
++	let Range3=ArraySort(Data3,2);
++	
++	let hx = [];
++	let hy = [];
++	let hz = [];
++	for (let i=0; i<numlevels; i++) {
++		let level=levels[i];
++
++		//find the segments that contain this value
++		let pos1=ArrayAnd(ArrayLessThan(ArrayCol(Range1,0),level), ArrayGreaterThan(ArrayCol(Range1,1),level)); //pos1=(Range1(:,1)<level & Range1(:,2)>level);
++		let pos2=ArrayAnd(ArrayLessThan(ArrayCol(Range2,0),level), ArrayGreaterThan(ArrayCol(Range2,1),level)); //pos2=(Range2(:,1)<level & Range2(:,2)>level);
++		let pos3=ArrayAnd(ArrayLessThan(ArrayCol(Range3,0),level), ArrayGreaterThan(ArrayCol(Range3,1),level)); //pos3=(Range3(:,1)<level & Range3(:,2)>level);
++
++		//get elements
++		let poselem12=ArrayAnd(pos1, pos2);
++		let poselem13=ArrayAnd(pos1, pos3);
++		let poselem23=ArrayAnd(pos2, pos3);
++		let poselem=find(ArrayOr(ArrayOr(poselem12, poselem13), poselem23));
++		let numelems=length(poselem);
++
++		//if no element has been flagged, skip to the next level
++		if (numelems==0) {
++			continue;
++		}
++
++		//go through the elements and build the coordinates for each segment (1 by element)
++		let x1=zeros(numelems,1);
++		let x2=zeros(numelems,1);
++		let y1=zeros(numelems,1);
++		let y2=zeros(numelems,1);
++		let z1=zeros(numelems,1);
++		let z2=zeros(numelems,1);
++
++		let edge_l=zeros(numelems,2);
++
++		for (let j=0; j < numelems; j++) {
++
++			let weight1=(level-Data1[poselem[j]][0])/(Data1[poselem[j]][1]-Data1[poselem[j]][0]);
++			let weight2=(level-Data2[poselem[j]][0])/(Data2[poselem[j]][1]-Data2[poselem[j]][0]);
++			let weight3=(level-Data3[poselem[j]][0])/(Data3[poselem[j]][1]-Data3[poselem[j]][0]);
++
++			if (poselem12[poselem[j]]) {
++				x1[j]=x[Seg1[poselem[j]][0]]+weight1*(x[Seg1[poselem[j]][1]]-x[Seg1[poselem[j]][0]]);
++				x2[j]=x[Seg2[poselem[j]][0]]+weight2*(x[Seg2[poselem[j]][1]]-x[Seg2[poselem[j]][0]]);
++				y1[j]=y[Seg1[poselem[j]][0]]+weight1*(y[Seg1[poselem[j]][1]]-y[Seg1[poselem[j]][0]]);
++				y2[j]=y[Seg2[poselem[j]][0]]+weight2*(y[Seg2[poselem[j]][1]]-y[Seg2[poselem[j]][0]]);
++				z1[j]=z[Seg1[poselem[j]][0]]+weight1*(z[Seg1[poselem[j]][1]]-z[Seg1[poselem[j]][0]]);
++				z2[j]=z[Seg2[poselem[j]][0]]+weight2*(z[Seg2[poselem[j]][1]]-z[Seg2[poselem[j]][0]]);
++				edge_l[j][0]=Seg1_num[poselem[j]];
++				edge_l[j][1]=Seg2_num[poselem[j]];
++
++			} else if (poselem13[poselem[j]]) {
++                x1[j]=x[Seg1[poselem[j]][0]]+weight1*(x[Seg1[poselem[j]][1]]-x[Seg1[poselem[j]][0]]);
++				x2[j]=x[Seg3[poselem[j]][0]]+weight3*(x[Seg3[poselem[j]][1]]-x[Seg3[poselem[j]][0]]);
++				y1[j]=y[Seg1[poselem[j]][0]]+weight1*(y[Seg1[poselem[j]][1]]-y[Seg1[poselem[j]][0]]);
++				y2[j]=y[Seg3[poselem[j]][0]]+weight3*(y[Seg3[poselem[j]][1]]-y[Seg3[poselem[j]][0]]);
++				z1[j]=z[Seg1[poselem[j]][0]]+weight1*(z[Seg1[poselem[j]][1]]-z[Seg1[poselem[j]][0]]);
++				z2[j]=z[Seg3[poselem[j]][0]]+weight3*(z[Seg3[poselem[j]][1]]-z[Seg3[poselem[j]][0]]);
++				edge_l[j][0]=Seg1_num[poselem[j]];
++				edge_l[j][1]=Seg3_num[poselem[j]];
++
++			} else if (poselem23[poselem[j]]) {
++                x1[j]=x[Seg2[poselem[j]][0]]+weight2*(x[Seg2[poselem[j]][1]]-x[Seg2[poselem[j]][0]]);
++				x2[j]=x[Seg3[poselem[j]][0]]+weight3*(x[Seg3[poselem[j]][1]]-x[Seg3[poselem[j]][0]]);
++				y1[j]=y[Seg2[poselem[j]][0]]+weight2*(y[Seg2[poselem[j]][1]]-y[Seg2[poselem[j]][0]]);
++				y2[j]=y[Seg3[poselem[j]][0]]+weight3*(y[Seg3[poselem[j]][1]]-y[Seg3[poselem[j]][0]]);
++				z1[j]=z[Seg2[poselem[j]][0]]+weight2*(z[Seg2[poselem[j]][1]]-z[Seg2[poselem[j]][0]]);
++				z2[j]=z[Seg3[poselem[j]][0]]+weight3*(z[Seg3[poselem[j]][1]]-z[Seg3[poselem[j]][0]]);
++				edge_l[j][0]=Seg2_num[poselem[j]];
++				edge_l[j][1]=Seg3_num[poselem[j]];
++			} else {
++				//it shoud not go here
++			}
++			let test = new THREE.Vector3(x1[j], y1[j], z1[j]);
++			//console.log('helo', test.length());
++		}
++		//now that we have the segments, we must try to connect them...
++
++		//loop over the subcontours
++		while (!isempty(edge_l)) {
++			//take the right edge of the second segment and connect it to the next segments if any
++			let e1=edge_l[0][0];   let e2=edge_l[0][1];
++			let xc=[x1[0],x2[0]]; let yc=[y1[0],y2[0]]; let zc=[z1[0],z2[0]]; 
++
++			//erase the lines corresponding to this edge
++			//edge_l(1,:)=[];
++			//x1(1)=[]; x2(1)=[];
++			//y1(1)=[]; y2(1)=[];
++			//z1(1)=[]; z2(1)=[]
++			edge_l.splice(0,1);
++			x1.splice(0,1); x2.splice(0,1);
++			y1.splice(0,1); y2.splice(0,1);
++			z1.splice(0,1); z2.splice(0,1);
++			let [ro1,co1]=find(ArrayEqual(edge_l,e1));
++
++			while (!isempty(ro1)) {
++				if (co1==0) {
++					xc=[x2[ro1]].concat(xc); yc=[y2[ro1]].concat(yc); zc=[z2[ro1]].concat(zc);
++
++					//next edge:
++					e1=edge_l[ro1][1];
++
++				} else {
++					xc=[x1[ro1]].concat(xc); yc=[y1[ro1]].concat(yc); zc=[z1[ro1]].concat(zc);
++
++					//next edge:
++					e1=edge_l[ro1][0];
++				}
++
++				//erase the lines of this
++				edge_l.splice(ro1,1);
++				x1.splice(ro1,1); x2.splice(ro1,1);
++				y1.splice(ro1,1); y2.splice(ro1,1);
++				z1.splice(ro1,1); z2.splice(ro1,1);
++
++				//next connection
++				[ro1,co1]=find(ArrayEqual(edge_l,e1));
++			}
++
++			//same thing the other way (to the right)
++			let [ro2,co2]=find(ArrayEqual(edge_l,e2));
++
++			while (!isempty(ro2)) {
++
++				if (co2==0) {
++					xc=[x2[ro2]].concat(xc); yc=[y2[ro2]].concat(yc); zc=[z2[ro2]].concat(zc);
++
++					//next edge:
++					e2=edge_l[ro2][1];
++
++				} else {
++					xc=[x1[ro2]].concat(xc); yc=[y1[ro2]].concat(yc); zc=[z1[ro2]].concat(zc);
++
++					//next edge:
++					e2=edge_l[ro2][0];
++				}
++
++				//erase the lines of this
++				edge_l.splice(ro2,1);
++				x1.splice(ro2,1); x2.splice(ro2,1);
++				y1.splice(ro2,1); y2.splice(ro2,1);
++				z1.splice(ro2,1); z2.splice(ro2,1);
++
++				//next connection
++				[ro2,co2]=find(ArrayEqual(edge_l,e2));
++			}
++
++			//we now have one subcontour ready to be plotted
++			if (options.getfieldvalue('contouronly',0)) {
++				if (isplanet) {
++					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
++					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
++					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
++					//h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',[zc;NaN],'facecolor','none','linewidth',linewidth)];
++				} else {
++					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
++					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
++					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
++					//h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',zc,'Cdata',zc,'facecolor','none','edgecolor','flat','linewidth',linewidth)];
++				}
++				//hold on      
++			} else {
++				//dist = 5000;
++				dist = 0;
++				if (isplanet) {
++					if ((max(xc)-min(xc)+max(yc)-min(yc)+max(zc)-min(zc))<dist) { continue; }
++					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
++					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
++					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
++					//h=[h;patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'Zdata',[zc;NaN],'facecolor','none','edgecolor',color,'linewidth',linewidth)];
++					//c = horzcat([level, xc'; length(xc), yc'; length(xc), zc']);
++				} else {
++					if ((max(xc)-min(xc)+max(yc)-min(yc))<dist) { continue; }
++					hx = ArrayConcat(hx, ArrayConcat(xc, [NaN]));
++					hy = ArrayConcat(hy, ArrayConcat(yc, [NaN]));
++					hz = ArrayConcat(hz, ArrayConcat(zc, [NaN]));
++					//h=patch('Xdata',[xc;NaN],'Ydata',[yc;NaN],'facecolor','none','edgecolor',color,'linewidth',linewidth);
++					//c = horzcat([level, xc'; length(xc), yc']);
++				}
++				//clabel(c,h,'FontSize',10,'labelspacing',20000,'color',color);
++				//hold on
++			}
++			//break;
++		}
++	}
++
++	//Compute gl variables:
++	let node = new Node(
++		'canvas', canvas,
++		'options', options,
++		'md', md,
++		'name', 'contours',
++		'replaceNaN', false,
++		'shaderName', 'line_strip',
++		'lineWidth', options.getfieldvalue('linewidth', 1),
++		'scale', [1.0005, 1.0005, 1.0005]
++	);
++
++	node.patch('Vertices', [hx, hy, hz], 'FaceColor', 'none', 'EdgeColor', color);
++	//node.patch('Faces', elements, 'Vertices', vertices, 'FaceColor', 'none', 'EdgeColor', edgecolor);
++	//}}}
++} //}}}
+Index: ../trunk-jpl/src/m/solve/WriteData.js
+===================================================================
+--- ../trunk-jpl/src/m/solve/WriteData.js	(revision 26299)
++++ ../trunk-jpl/src/m/solve/WriteData.js	(revision 26300)
+@@ -1,4 +1,4 @@
+-function WriteData(fid,prefix){
++function WriteData(fid,prefix){ //{{{
+ //WRITEDATA - write model field into binary buffer 
+ //
+ //   Usage:
+@@ -73,6 +73,11 @@
+ 		}
+ 	}
+ 
++	let recordlengthtype = 'int';
++	if (svnversion >= 22708) {
++		recordlengthtype = 'long long';
++	}
++
+ 	//Step 1: write the name to identify this record uniquely
+ 	fid.fwrite(name.length,'int'); 
+ 	fid.fwrite(name,'char'); 
+@@ -82,7 +87,7 @@
+ 		if(IsArray(data)) throw  Error(sprintf("field '%s' cannot be marshalled as it has more than one element!",name));
+ 
+ 		//first write length of record
+-		fid.fwrite(4+4,'int');  //1 bool (disguised as an int)+code
++		fid.fwrite(4+4,recordlengthtype);  //1 bool (disguised as an int)+code
+ 
+ 		//write data code: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -94,7 +99,7 @@
+ 		if(IsArray(data)) throw  Error(sprintf("field '%s' cannot be marshalled as it has more than one element!",name));
+ 
+ 		//first write length of record
+-		fid.fwrite(4+4,'int');  //1 integer + code
++		fid.fwrite(4+4,recordlengthtype);  //1 integer + code
+ 
+ 		//write data code: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -106,7 +111,7 @@
+ 		if(IsArray(data)) throw  Error(sprintf("field '%s' cannot be marshalled as it has more than one element!",name));
+ 
+ 		//first write length of record
+-		fid.fwrite(8+4,'int');  //1 double+code
++		fid.fwrite(8+4,recordlengthtype);  //1 double+code
+ 
+ 		//write data code: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -116,7 +121,7 @@
+ 	} // }}}
+ 	else if (format == 'String'){ // {{{
+ 		//first write length of record
+-		fid.fwrite(data.length+4+4,'int');  //string + string size + code
++		fid.fwrite(data.length+4+4,recordlengthtype);  //string + string size + code
+ 
+ 		//write data code: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -140,7 +145,7 @@
+ 		}
+ 
+ 		//first write length of record
+-		fid.fwrite(4+4+8*s[0]*s[1]+4+4,'int');  //2 integers (32 bits) + the double matrix + code + matrix type
++		fid.fwrite(4+4+8*s[0]*s[1]+4+4,recordlengthtype);  //2 integers (32 bits) + the double matrix + code + matrix type
+ 
+ 		//write data code and matrix type: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -166,7 +171,7 @@
+ 		}
+ 
+ 		//first write length of record
+-		fid.fwrite(4+4+8*s[0]*s[1]+4+4,'int');  //2 integers (32 bits) + the double matrix + code + matrix type
++		fid.fwrite(4+4+8*s[0]*s[1]+4+4,recordlengthtype);  //2 integers (32 bits) + the double matrix + code + matrix type
+ 
+ 		//write data code and matrix type: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -196,7 +201,7 @@
+ 		//first write length of record
+ 		var recordlength=4+4+8*s[0]*s[1]+4+4; //2 integers (32 bits) + the double matrix + code + matrix type
+ 		if (recordlength>Math.pow(2,31)) throw Error(sprintf("field '%s' cannot be marshalled because it is larger than 2^31 bytes!",name));
+-		fid.fwrite(recordlength,'int');
++		fid.fwrite(recordlength,recordlengthtype);
+ 
+ 		//write data code and matrix type: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -223,7 +228,7 @@
+ 		}
+ 
+ 		//write length of record
+-		fid.fwrite(recordlength,'int'); 
++		fid.fwrite(recordlength,recordlengthtype); 
+ 
+ 		//write data code: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -258,7 +263,7 @@
+ 		}
+ 
+ 		//write length of record
+-		fid.fwrite(recordlength,'int'); 
++		fid.fwrite(recordlength,recordlengthtype); 
+ 
+ 		//write data code: 
+ 		fid.fwrite(FormatToCode(format),'int'); 
+@@ -277,8 +282,7 @@
+ 		throw Error(sprintf("WriteData error message: data type: %s not supported yet! ('%s')",
+ 					format.toString(),name));
+ 	}
+-}
+-
++} //}}}
+ function 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 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26300-26301.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26300-26301.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26300-26301.diff	(revision 26740)
@@ -0,0 +1,3298 @@
+Index: ../trunk-jpl/src/m/boundaryconditions/getlovenumbers.py
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/getlovenumbers.py	(revision 26300)
++++ ../trunk-jpl/src/m/boundaryconditions/getlovenumbers.py	(revision 26301)
+@@ -4,23 +4,27 @@
+ 
+ 
+ def getlovenumbers(*args): #{{{
+-    '''
+-    GETLOVENUMBERS - provide love numbers retrieved from: 
++    """GETLOVENUMBERS - provide love numbers retrieved from: 
+     http://www.srosat.com/iag-jsg/loveNb.php in a chosen reference frame
+ 
+-        Usage:
+-            series = love_numbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', 1001)
++    Usage:
++        series = love_numbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', 1001)
+ 
+-        - type = one of 'loadingverticaldisplacement', 
+-        'loadinggravitationalpotential', 'loadinghorizontaldisplacement', 
+-        'tidalverticaldisplacement', 'tidalgravitationalpotential', 
+-        'tidalhorizontaldisplacement'
+-        - reference_frame = one of 'CM' (default) and 'CF'
+-        - maxdeg = default 1000
++    - type = one of 'loadingverticaldisplacement', 
++    'loadinggravitationalpotential', 'loadinghorizontaldisplacement', 
++    'tidalverticaldisplacement', 'tidalgravitationalpotential', 
++    'tidalhorizontaldisplacement'
++    - reference_frame = one of 'CM' (default) and 'CF'
++    - maxdeg = default 1000
+ 
+-        Example:
+-            h = love_number
+-    '''
++    Example:
++        h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
++        k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg)
++        l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
++        th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
++        tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg)
++        tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg)
++    """
+ 
+     TYPES = [
+         'loadingverticaldisplacement', 
+@@ -31,12 +35,15 @@
+         'tidalhorizontaldisplacement'
+     ]
+ 
+-    #recover options
++    # Recover options
+     options = pairoptions(*args)
+     type = options.getfieldvalue('type')
+     frame = options.getfieldvalue('referenceframe', 'CM')
+     maxdeg = options.getfieldvalue('maxdeg', 1000)
+ 
++    if (maxdeg > 10000):
++        raise Exception('PREM love numbers computed only for deg < 10,000. Request lower maxdeg')
++
+     if type not in TYPES:
+         raise Exception('type should be one of {}'.format(TYPES))
+ 
+@@ -10044,10 +10051,10 @@
+         [-6.27342778, -0.00030945, 0.00018956, 0.00031100, -0.00000116, 0.00000000]
+     ])
+ 
+-    #cut off series at maxdeg
++    # Cut off series at maxdeg
+     love_numbers = np.delete(love_numbers, range(maxdeg + 1, len(love_numbers)), axis=0)
+ 
+-    #retrieve right type
++    # Retrieve right type
+     if type == 'loadingverticaldisplacement':
+         series = love_numbers[:, 0]
+     elif type == 'loadinggravitationalpotential':
+@@ -10061,7 +10068,7 @@
+     elif type == 'tidalhorizontaldisplacement':
+         series = love_numbers[:, 5]
+     else:
+-        raise Exception("love_numbers error message: unknown type: {}".format(type))
++        raise Exception('love_numbers error message: unknown type: {}'.format(type))
+ 
+     #choose degree 1 term for CF reference system
+     if frame == 'CM':
+@@ -10074,7 +10081,7 @@
+         elif type == 'loadinghorizontaldisplacement':
+             series[1] = 0.134
+     else:
+-        raise Exception("love_numbers error message: unknown reference frame: {}".format(frame))
++        raise Exception('love_numbers error message: unknown reference frame: {}'.format(frame))
+ 
+     return series
+ #}}}
+Index: ../trunk-jpl/src/m/classes/amr.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/amr.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/amr.m	(revision 26301)
+@@ -83,7 +83,7 @@
+ 			%control of element lengths
+ 			self.gradation=1.5;
+ 
+-			%other criterias
++			%other criteria
+ 			self.groundingline_resolution=500.;
+ 			self.groundingline_distance=0.;
+ 			self.icefront_resolution=500.;
+Index: ../trunk-jpl/src/m/classes/amr.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/amr.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/amr.py	(revision 26301)
+@@ -4,84 +4,93 @@
+ 
+ 
+ class amr(object):
+-    """
+-    AMR Class definition
++    """AMR Class definition
+ 
+     Usage:
+         amr = amr()
+     """
+ 
+-    def __init__(self):  # {{{
+-        self.hmin = 0.
+-        self.hmax = 0.
++    def __init__(self): #{{{
++        self.hmin = 0
++        self.hmax = 0
+         self.fieldname = ''
+-        self.err = 0.
+-        self.keepmetric = 0.
+-        self.gradation = 0.
+-        self.groundingline_resolution = 0.
+-        self.groundingline_distance = 0.
+-        self.icefront_resolution = 0.
+-        self.icefront_distance = 0.
+-        self.thicknesserror_resolution = 0.
+-        self.thicknesserror_threshold = 0.
+-        self.thicknesserror_groupthreshold = 0.
+-        self.thicknesserror_maximum = 0.
+-        self.deviatoricerror_resolution = 0.
+-        self.deviatoricerror_threshold = 0.
+-        self.deviatoricerror_groupthreshold = 0.
+-        self.deviatoricerror_maximum = 0.
+-        self.restart = 0.
+-    #set defaults
++        self.err = 0
++        self.keepmetric = 0
++        self.gradation = 0
++        self.groundingline_resolution = 0
++        self.groundingline_distance = 0
++        self.icefront_resolution = 0
++        self.icefront_distance = 0
++        self.thicknesserror_resolution = 0
++        self.thicknesserror_threshold = 0
++        self.thicknesserror_groupthreshold = 0
++        self.thicknesserror_maximum = 0
++        self.deviatoricerror_resolution = 0
++        self.deviatoricerror_threshold = 0
++        self.deviatoricerror_groupthreshold = 0
++        self.deviatoricerror_maximum = 0
++        self.restart = 0
++
+         self.setdefaultparameters()
+     #}}}
+ 
+-    def __repr__(self):  # {{{
+-        string = "   amr parameters:"
+-        string = "%s\n%s" % (string, fielddisplay(self, "hmin", "minimum element length"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "hmax", "maximum element length"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "fieldname", "name of input that will be used to compute the metric (should be an input of FemModel)"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "keepmetric", "indicates whether the metric should be kept every remeshing time"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "gradation", "maximum ratio between two adjacent edges"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "groundingline_resolution", "element length near the grounding line"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "groundingline_distance", "distance around the grounding line which elements will be refined"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "icefront_resolution", "element length near the ice front"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "icefront_distance", "distance around the ice front which elements will be refined"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_resolution", "element length when thickness error estimator is used"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_threshold", "maximum threshold thickness error permitted"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_groupthreshold", "maximum group threshold thickness error permitted"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_maximum", "maximum thickness error permitted"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_resolution", "element length when deviatoric stress error estimator is used"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_threshold", "maximum threshold deviatoricstress error permitted"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_groupthreshold", "maximum group threshold deviatoric stress error permitted"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_maximum", "maximum deviatoricstress error permitted"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "restart", "indicates if ReMesh() will call before first time step"))
+-        return string
++    def __repr__(self): #{{{
++        s = '   amr parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'hmin', 'minimum element length'))
++        s += '{}\n'.format(fielddisplay(self, 'hmax', 'maximum element length'))
++        s += '{}\n'.format(fielddisplay(self, 'fieldname', 'name of input that will be used to compute the metric (should be an input of FemModel)'))
++        s += '{}\n'.format(fielddisplay(self, 'keepmetric', 'indicates whether the metric should be kept every remeshing time'))
++        s += '{}\n'.format(fielddisplay(self, 'gradation', 'maximum ratio between two adjacent edges'))
++        s += '{}\n'.format(fielddisplay(self, 'groundingline_resolution', 'element length near the grounding line'))
++        s += '{}\n'.format(fielddisplay(self, 'groundingline_distance', 'distance around the grounding line which elements will be refined'))
++        s += '{}\n'.format(fielddisplay(self, 'icefront_resolution', 'element length near the ice front'))
++        s += '{}\n'.format(fielddisplay(self, 'icefront_distance', 'distance around the ice front which elements will be refined'))
++        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_resolution', 'element length when thickness error estimator is used'))
++        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_threshold', 'maximum threshold thickness error permitted'))
++        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_groupthreshold', 'maximum group threshold thickness error permitted'))
++        s += '{}\n'.format(fielddisplay(self, 'thicknesserror_maximum', 'maximum thickness error permitted'))
++        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_resolution', 'element length when deviatoric stress error estimator is used'))
++        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_threshold', 'maximum threshold deviatoricstress error permitted'))
++        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_groupthreshold', 'maximum group threshold deviatoric stress error permitted'))
++        s += '{}\n'.format(fielddisplay(self, 'deviatoricerror_maximum', 'maximum deviatoricstress error permitted'))
++        s += '{}\n'.format(fielddisplay(self, 'restart', 'indicates if ReMesh() will call before first time step'))
++        return s
+     #}}}
+ 
+-    def setdefaultparameters(self):  # {{{
+-        self.hmin = 100.
+-        self.hmax = 100.e3
++    def setdefaultparameters(self): #{{{
++        self.hmin = 100
++        self.hmax = 100e3
++
++        # Fields
+         self.fieldname = 'Vel'
+-        self.err = 3.
++        self.err = 3
++
++        # Keep metric?
+         self.keepmetric = 1
++
++        # Control of element lengths
+         self.gradation = 1.5
+-        self.groundingline_resolution = 500.
++
++        # Other criteria
++        self.groundingline_resolution = 500
+         self.groundingline_distance = 0
+-        self.icefront_resolution = 500.
++        self.icefront_resolution = 500
+         self.icefront_distance = 0
+-        self.thicknesserror_resolution = 500.
++        self.thicknesserror_resolution = 500
+         self.thicknesserror_threshold = 0
+         self.thicknesserror_groupthreshold = 0
+         self.thicknesserror_maximum = 0
+-        self.deviatoricerror_resolution = 500.
++        self.deviatoricerror_resolution = 500
+         self.deviatoricerror_threshold = 0
+         self.deviatoricerror_groupthreshold = 0
+         self.deviatoricerror_maximum = 0
+-        self.restart = 0.
++
++        # Is restart? This calls femmodel->ReMesh() before first time step.
++        self.restart = 0
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses):  # {{{
++    def checkconsistency(self, md, solution, analyses): #{{{
+         md = checkfield(md, 'fieldname', 'amr.hmax', 'numel', [1], '>', 0, 'NaN', 1)
+         md = checkfield(md, 'fieldname', 'amr.hmin', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
+         md = checkfield(md, 'fieldname', 'amr.keepmetric', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
+@@ -100,9 +109,9 @@
+         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):  # {{{
++    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')
+@@ -123,4 +132,4 @@
+         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: ../trunk-jpl/src/m/classes/dsl.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/dsl.m	(revision 26301)
+@@ -12,10 +12,6 @@
+ 
+ 	end
+ 	methods
+-		function self = extrude(self,md) % {{{
+-			self.sea_surface_height_above_geoid=project3d(md,'vector',self.sea_surface_height_above_geoid,'type','node','layer',1);
+-			self.sea_water_pressure_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_at_sea_floor,'type','node','layer',1);
+-		end % }}}
+ 		function self = dsl(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -33,6 +29,14 @@
+ 			self.sea_water_pressure_at_sea_floor=NaN;
+ 
+ 		end % }}}
++		function disp(self) % {{{
++
++			disp(sprintf('   dsl parameters:'));
++			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).');
++			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).');
++			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).');
++
++		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			%Early return
+@@ -48,28 +52,17 @@
+ 			end
+ 			
+ 		end % }}}
+-		function disp(self) % {{{
+-
+-			disp(sprintf('   dsl parameters:'));
+-			fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).');
+-			fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).');
+-			fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).');
+-
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-
++			yts=md.constants.yts;
+ 			WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','DoubleMat','mattype',2,'timeseries',1,'timeserieslength',2,'yts',md.constants.yts); %mattype 2, because we are sending a GMSL value identical everywhere on each element. 
+-			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); %mattype 1 because we specify DSL at vertex locations.
+-			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); %mattype 1 because we specify bottom pressure at vertex locations.
++			WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','DoubleMat','mattype',2,'timeseries',1,'timeserieslength',2,'yts',yts); %mattype 2, because we are sending a GMSL value identical everywhere on each element. 
++			WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); %mattype 1 because we specify DSL at vertex locations.
++			WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); %mattype 1 because we specify bottom pressure at vertex locations.
+ 
+ 		end % }}}
+-		function savemodeljs(self,fid,modelname) % {{{
+-
+-			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
+-			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
+-			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
+-
++		function self = extrude(self,md) % {{{
++			self.sea_surface_height_above_geoid=project3d(md,'vector',self.sea_surface_height_above_geoid,'type','node','layer',1);
++			self.sea_water_pressure_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_at_sea_floor,'type','node','layer',1);
+ 		end % }}}
+ 		function self = initialize(self,md) % {{{
+ 
+@@ -86,6 +79,12 @@
+ 				disp('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero');
+ 			end
+ 		end % }}}
+-	
++		function savemodeljs(self,fid,modelname) % {{{
++
++			writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
++			writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
++			writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
++
++		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/fourierlove.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/fourierlove.m	(revision 26301)
+@@ -5,25 +5,25 @@
+ 
+ classdef fourierlove
+ 	properties (SetAccess=public) 
+-		nfreq                      = 0;
+-		frequencies                = 0;
+-		sh_nmax                    = 0;
+-		sh_nmin                    = 0;
+-		g0                         = 0;
+-		r0                         = 0;
+-		mu0                        = 0;
+-		Gravitational_Constant     = 0;
+-		allow_layer_deletion       = 0;
+-		underflow_tol              = 0;
+-		integration_steps_per_layer= 0;
+-		istemporal		   = 0;
+-		n_temporal_iterations	   = 0;
+-		time			           = 0;
+-		love_kernels               = 0;
+-		forcing_type               = 0;
+-		inner_core_boundary	       = 0;
+-		core_mantle_boundary	   = 0;
+-		complex_computation        = 0;
++		nfreq                       = 0;
++		frequencies                 = 0;
++		sh_nmax                     = 0;
++		sh_nmin                     = 0;
++		g0                          = 0;
++		r0                          = 0;
++		mu0                         = 0;
++		Gravitational_Constant      = 0;
++		allow_layer_deletion        = 0;
++		underflow_tol               = 0;
++		integration_steps_per_layer = 0;
++		istemporal                  = 0;
++		n_temporal_iterations       = 0;
++		time                        = 0;
++		love_kernels                = 0;
++		forcing_type                = 0;
++		inner_core_boundary         = 0;
++		core_mantle_boundary        = 0;
++		complex_computation         = 0;
+ 
+ 	end
+ 	methods (Static)
+@@ -33,8 +33,6 @@
+ 		end% }}}
+ 	end
+ 	methods
+-		function self = extrude(self,md) % {{{
+-		end % }}}
+ 		function self = fourierlove(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -52,7 +50,7 @@
+ 			% work on matlab script for computing g0 for given Earth's structure. 
+ 			self.g0=9.81; % m/s^2; 
+ 			self.r0=6371*1e3; %m;
+-			self.mu0=10^11; % Pa
++			self.mu0=1e11; % Pa
+ 			self.Gravitational_Constant=6.67259e-11; % m^3 kg^-1 s^-2
+ 			self.allow_layer_deletion=1;
+ 			self.underflow_tol=1e-16; %threshold of deep to surface love number ratio to trigger the deletion of layer 
+@@ -67,24 +65,24 @@
+ 			self.complex_computation=0;
+ 		end % }}}
+ 		function disp(self) % {{{
+-			fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]');
++			fielddisplay(self,'nfreq','number of frequencies sampled (default: 1, elastic) [Hz]');
+ 			fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]');
+-			fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)');
+-			fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default 1)');
+-			fielddisplay(self,'g0','adimensioning constant for gravity (default 10) [m/s^2]');
+-			fielddisplay(self,'r0','adimensioning constant for radius (default 6371*10^3) [m]');
+-			fielddisplay(self,'mu0','adimensioning constant for stress (default 10^11) [Pa]');
+-			fielddisplay(self,'Gravitational_Constant','Newtonian constant of gravitation (default 6.67259e-11 [m^3 kg^-1 s^-2])');
+-			fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)');
+-			fielddisplay(self,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default 2.2204460492503131E-016)');
+-			fielddisplay(self,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default 100)');
+-			fielddisplay(self,'istemporal',{'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency'});
+-			fielddisplay(self,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default 8)');
+-			fielddisplay(self,'time','time vector for deformation if istemporal (default 0) [s]');
+-			fielddisplay(self,'love_kernels','compute love numbers at depth? (default 0)');
+-			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '});
+-			fielddisplay(self,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default 1)');
+-			fielddisplay(self,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default 2)'); 
++			fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)');
++			fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default: 1)');
++			fielddisplay(self,'g0','adimensioning constant for gravity (default: 10) [m/s^2]');
++			fielddisplay(self,'r0','adimensioning constant for radius (default: 6371*10^3) [m]');
++			fielddisplay(self,'mu0','adimensioning constant for stress (default: 10^11) [Pa]');
++			fielddisplay(self,'Gravitational_Constant','Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])');
++			fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)');
++			fielddisplay(self,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)');
++			fielddisplay(self,'integration_steps_per_layer','number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 100)');
++			fielddisplay(self,'istemporal',{'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency'});
++			fielddisplay(self,'n_temporal_iterations','max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)');
++			fielddisplay(self,'time','time vector for deformation if istemporal (default: 0) [s]');
++			fielddisplay(self,'love_kernels','compute love numbers at depth? (default: 0)');
++			fielddisplay(self,'forcing_type',{'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):','1:  Inner core boundary -- Volumic Potential','2:  Inner core boundary -- Pressure','3:  Inner core boundary -- Loading','4:  Inner core boundary -- Tangential traction','5:  Core mantle boundary -- Volumic Potential','6:  Core mantle boundary -- Pressure','7:  Core mantle boundary -- Loading','8:  Core mantle boundary -- Tangential traction','9:  Surface -- Volumic Potential','10: Surface -- Pressure','11: Surface -- Loading','12: Surface -- Tangential traction '});
++			fielddisplay(self,'inner_core_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)');
++			fielddisplay(self,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'); 
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -111,8 +109,8 @@
+ 				md = checkfield(md,'fieldname','love.n_temporal_iterations','NaN',1,'Inf',1,'numel',1,'>',0);
+ 				md = checkfield(md,'fieldname','love.time','NaN',1,'Inf',1,'numel',md.love.nfreq/2/md.love.n_temporal_iterations);
+ 			end
+-			if md.love.sh_nmin<=1 & (md.love.forcing_type==9 || md.love.forcing_type==5 || md.love.forcing_type==1)
+-				error('Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.')
++			if md.love.sh_nmin<=1 & (md.love.forcing_type==1 || md.love.forcing_type==5 || md.love.forcing_type==9)
++				error(['Degree 1 not supported for forcing type ' num2str(md.love.forcing_type) '. Use sh_min>=2 for this kind of calculation.'])
+ 			end
+ 
+ 			%need 'litho' material: 
+@@ -129,7 +127,7 @@
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-		
++
+ 			WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
+ 			WriteData(fid,prefix,'object',self,'fieldname','sh_nmax','format','Integer');
+@@ -151,6 +149,8 @@
+ 			WriteData(fid,prefix,'object',self,'fieldname','core_mantle_boundary','format','Integer');
+ 
+ 		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 			error('not implemented yet!');
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/fourierlove.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/fourierlove.py	(revision 26301)
+@@ -1,3 +1,5 @@
++import numpy as np
++
+ from fielddisplay import fielddisplay
+ from checkfield import checkfield
+ from WriteData import WriteData
+@@ -4,12 +6,13 @@
+ 
+ 
+ class fourierlove(object):
+-    """FOURIERLOVE - Fourier Love Number class definition
++    """FOURIERLOVE - class definition
+ 
+     Usage:
+-        fourierlove = fourierlove()
++        md.love = fourierlove()
+     """
+-    def __init__(self):  # {{{
++
++    def __init__(self): #{{{
+         self.nfreq = 0
+         self.frequencies = 0
+         self.sh_nmax = 0
+@@ -17,96 +20,155 @@
+         self.g0 = 0
+         self.r0 = 0
+         self.mu0 = 0
++        self.Gravitational_Constant = 0
+         self.allow_layer_deletion = 0
++        self.underflow_tol = 0
++        self.integration_steps_per_layer = 0
++        self.istemporal = 0
++        self.n_temporal_iterations = 0
++        self.time = 0
+         self.love_kernels = 0
+         self.forcing_type = 0
++        self.inner_core_boundary = 0
++        self.core_mantle_boundary = 0
++        self.complex_computation = 0
+ 
+         self.setdefaultparameters()
+     #}}}
+ 
+-    def __repr__(self):  # {{{
+-        # TODO:
+-        # - Convert all formatting to calls to <string>.format (see any 
+-        #   already converted <class>.__repr__ method for examples)
+-        #
+-        string = '   Fourier Love class:'
+-        string = "%s\n%s" % (string, fielddisplay(self, 'nfreq', 'number of frequencies sampled (default 1, elastic) [Hz]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default 1)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'g0', 'adimensioning constant for gravity (default 10) [m / s^2]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'r0', 'adimensioning constant for radius (default 6378e3) [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'mu0', 'adimensioning constant for stress (default 1.0e11) [Pa]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default 0)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :'))
+-        string = "%s\n%s" % (string, '                                                     1:  Inner core boundary -- Volumic Potential')
+-        string = "%s\n%s" % (string, '                                                     2:  Inner core boundary --  Pressure')
+-        string = "%s\n%s" % (string, '                                                     3:  Inner core boundary --  Loading')
+-        string = "%s\n%s" % (string, '                                                     4:  Inner core boundary --  Tangential traction')
+-        string = "%s\n%s" % (string, '                                                     5:  Core mantle boundary --  Volumic Potential')
+-        string = "%s\n%s" % (string, '                                                     6:  Core mantle boundary --  Pressure')
+-        string = "%s\n%s" % (string, '                                                     7:  Core mantle boundary --  Loading')
+-        string = "%s\n%s" % (string, '                                                     8:  Core mantle boundary --  Tangential traction')
+-        string = "%s\n%s" % (string, '                                                     9:  Surface--  Volumic Potential')
+-        string = "%s\n%s" % (string, '                                                     10: Surface--  Pressure')
+-        string = "%s\n%s" % (string, '                                                     11: Surface--  Loading')
+-        string = "%s\n%s" % (string, '                                                     12: Surface--  Tangential traction ')
++    def __repr__(self): #{{{
++        s = '   Fourier Love class:\n'
++        s += '{}\n'.format(fielddisplay(self, 'nfreq', 'number of frequencies sampled (default: 1, elastic) [Hz]'))
++        s += '{}\n'.format(fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
++        s += '{}\n'.format(fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)'))
++        s += '{}\n'.format(fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default: 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'g0', 'adimensioning constant for gravity (default: 10) [m / s^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'r0', 'adimensioning constant for radius (default: 6378e3) [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'mu0', 'adimensioning constant for stress (default: 1.0e11) [Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'Gravitational_Constant', 'Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])'))
++        s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'underflow_tol', 'threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)'))
++        s += '{}\n'.format(fielddisplay(self, 'integration_steps_per_layer', 'number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 100)'))
++        s += '{}\n'.format(fielddisplay(self, 'istemporal', {'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency'}))
++        s += '{}\n'.format(fielddisplay(self, 'n_temporal_iterations', 'max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)'))
++        s += '{}\n'.format(fielddisplay(self, 'time', 'time vector for deformation if istemporal (default: 0) [s]'))
++        s += '{}\n'.format(fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default: 0)'))
++        s += '{}\n'.format(fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):'))
++        s += '{}\n'.format('                                                     1:  Inner core boundary -- Volumic Potential')
++        s += '{}\n'.format('                                                     2:  Inner core boundary --  Pressure')
++        s += '{}\n'.format('                                                     3:  Inner core boundary --  Loading')
++        s += '{}\n'.format('                                                     4:  Inner core boundary --  Tangential traction')
++        s += '{}\n'.format('                                                     5:  Core mantle boundary --  Volumic Potential')
++        s += '{}\n'.format('                                                     6:  Core mantle boundary --  Pressure')
++        s += '{}\n'.format('                                                     7:  Core mantle boundary --  Loading')
++        s += '{}\n'.format('                                                     8:  Core mantle boundary --  Tangential traction')
++        s += '{}\n'.format('                                                     9:  Surface--  Volumic Potential')
++        s += '{}\n'.format('                                                     10: Surface--  Pressure')
++        s += '{}\n'.format('                                                     11: Surface--  Loading')
++        s += '{}\n'.format('                                                     12: Surface--  Tangential traction ')
++        s += '{}\n'.format(fielddisplay(self, 'inner_core_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'core_mantle_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'))
+ 
+-        return string
++        return s
+     #}}}
+ 
+-    def extrude(self, md):  # {{{
+-        return self
+-    #}}}
+-
+-    def setdefaultparameters(self):  # {{{
+-        #we setup an elastic love number computation by default.
++    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.frequencies = [0] # Hz
++        self.sh_nmax = 256 # .35 degree, 40 km at the equator
+         self.sh_nmin = 1
++        # Work on matlab script for computing g0 for given Earth's structure
+         self.g0 = 9.81 # m/s^2
+-        self.r0 = 6371e3 #m
++        self.r0 = 6371 * 1e3 # m
+         self.mu0 = 1e11 # Pa
++        self.Gravitational_Constant = 6.67259e-11 # m^3 kg^-1 s^-2
+         self.allow_layer_deletion = 1
++        self.underflow_tol = 1e-16 # Threshold of deep to surface love number ratio to trigger the deletion of layer
++        self.integration_steps_per_layer = 100
++        self.istemporal = 0
++        self.n_temporal_iterations = 8
++        self.time = [0] # s
+         self.love_kernels = 0
+-        self.forcing_type = 11
+-
+-        return self
++        self.forcing_type = 11 # Surface loading
++        self.inner_core_boundary = 1
++        self.core_mantle_boundary = 2
++        self.complex_computation = 0
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses):  # {{{
++    def checkconsistency(self, md, solution, analyses): #{{{
+         if 'LoveAnalysis' not in 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.nfreq', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'love.frequencies', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq)
++        md = checkfield(md, 'fieldname', 'love.sh_nmax', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'love.sh_nmin', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'love.g0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'love.r0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'love.mu0', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'love.Gravitational_Constant', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+         md = checkfield(md, 'fieldname', 'love.allow_layer_deletion', 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'love.underflow_tol', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'love.integration_steps_per_layer', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+         md = checkfield(md, 'fieldname', 'love.love_kernels', 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'love.forcing_type', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0, '<=', 12)
+-        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.")
++        md = checkfield(md, 'fieldname', 'love.forcing_type', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', 12)
++        md = checkfield(md, 'fieldname', 'love.complex_computation', 'NaN', 1, 'Inf', 1, 'numel', 1, 'values', [0, 1])
+ 
+-        # need 'litho' material
++        md = checkfield(md, 'fieldname', 'love.istemporal', 'values', [0, 1])
++        if md.love.istemporal:
++            md = checkfield(md, 'fieldname', 'love.n_temporal_iterations', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++            md = checkfield(md, 'fieldname', 'love.time', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq / 2 / md.love.n_temporal_iterations)
++        if md.love.sh_nmin <= 1 and (md.love.forcing_type == 1 or md.love.forcing_type == 5 or md.love.forcing_type == 9):
++            raise RuntimeError('Degree 1 not supported for forcing type {}. Use sh_min >= 2 for this kind of calculation.'.format(md.love.forcing_type))
++
++        # Need 'litho' material
+         if not hasattr(md.materials, 'materials') or 'litho' not in md.materials.nature:
+             raise RuntimeError('Need a \'litho\' material to run a Fourier Love number analysis')
++
++        mat = np.where(np.array(nature) == 'litho')[0]
++        if md.love.forcing_type <= 4:
++            md = checkfield(md, 'fieldname', 'love.inner_core_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
++        elif md.love.forcing_type <= 8:
++            md = checkfield(md, 'fieldname', 'love.core_mantle_boundary', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0, '<=', md.materials[mat].numlayers)
++
+         return md
+-    # }}}
++    #}}}
+ 
+-    def marshall(self, prefix, md, fid):  # {{{
++    def marshall(self, prefix, md, fid): #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'nfreq', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'frequencies', 'format', 'DoubleMat', 'mattype', 3)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'frequencies', 'format', 'DoubleMat', 'mattype',3)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmax', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmin', 'format', 'Integer')
+         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', 'Gravitational_Constant', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'allow_layer_deletion', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'underflow_tol', 'format', 'Double')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'integration_steps_per_layer', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'istemporal', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'n_temporal_iterations', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'complex_computation', 'format', 'Boolean')
++        # Note: no need to marshall the time vector, we have frequencies
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'love_kernels', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'forcing_type', 'format', 'Integer')
+-    # }}}
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'inner_core_boundary', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'core_mantle_boundary', 'format', 'Integer')
++    #}}}
++
++    def extrude(self, md): #{{{
++        return self
++    #}}}
++
++    def build_frequencies_from_time(self): #{{{
++        if not self.istemporal:
++            raise RuntimeError('cannot build frequencies for temporal love numbers if love.istemporal==0')
++        print('Temporal love numbers: Overriding md.love.nfreq and md.love.frequencies')
++        self.nfreq = len(self.time) * 2 * self.n_temporal_iterations
++        self.frequencies = np.zeros((self.nfreq, 1))
++        for i in range(len(self.time)):
++            for j in range(2 * self.n_temporal_iterations):
++                self.frequencies[(i - 1) * 2 * self.n_temporal_iterations + j] = j * np.log(2) / self.time[i] / 2 / np.pi
++    #}}}
+Index: ../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/geometry.py	(revision 26301)
+@@ -36,7 +36,7 @@
+     #}}}
+ 
+     def setdefaultparameters(self): #{{{
+-        return self
++        return
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses): #{{{
+Index: ../trunk-jpl/src/m/classes/hydrologyshreve.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologyshreve.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/hydrologyshreve.py	(revision 26301)
+@@ -1,3 +1,5 @@
++import numpy as np
++
+ from fielddisplay import fielddisplay
+ from checkfield import checkfield
+ from WriteData import WriteData
+@@ -10,43 +12,35 @@
+         hydrologyshreve = hydrologyshreve()
+     """
+ 
+-    def __init__(self):  # {{{
+-        self.spcwatercolumn = float('NaN')
++    def __init__(self, *args): #{{{
++        self.spcwatercolumn = np.nan
+         self.stabilization = 0
+         self.requested_outputs = []
+ 
+-        self.setdefaultparameters()
++        nargs = len(args)
++        if nargs == 0:
++            self.setdefaultparameters()
++        elif nargs == 1:
++            self.setdefaultparameters(args)
++        else:
++            raise RuntimeError('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self):  # {{{
+-        # TODO:
+-        # - Convert all formatting to calls to <string>.format (see any 
+-        #   already converted <class>.__repr__ method for examples)
+-        #
+-        string = '   hydrologyshreve solution parameters:'
+-        string = "%s\n%s" % (string, fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', 'artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+-        return string
++    def __repr__(self): #{{{
++        s = '   hydrologyshreve solution parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'stabilization', 'artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.'))
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
++        return s
+     #}}}
+ 
+-    def extrude(self, md):  # {{{
+-        return self
+-    #}}}
+-
+-    def setdefaultparameters(self):  # {{{
+-        #Type of stabilization to use 0:nothing 1:artificial_diffusivity
++    def setdefaultparameters(self): #{{{
++        # Type of stabilization to use 0:nothing 1:artificial_diffusivity
+         self.stabilization = 1
+         self.requested_outputs = ['default']
+-        return self
+     #}}}
+ 
+-    def defaultoutputs(self, md):  # {{{
+-        list = ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy']
+-        return list
+-    #}}}
+-
+-    def checkconsistency(self, md, solution, analyses):  # {{{
++    def checkconsistency(self, md, solution, analyses): #{{{
+         #Early return
+         if 'HydrologyShreveAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.ishydrology):
+             return md
+@@ -53,20 +47,25 @@
+ 
+         md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
+         md = checkfield(md, 'fieldname', 'hydrology.stabilization', '>=', 0)
+-        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
+         return md
+     # }}}
+ 
+-    def marshall(self, prefix, md, fid):  # {{{
++    def defaultoutputs(self, md): #{{{
++        return ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy']
++    #}}}
++
++    def marshall(self, prefix, md, fid): #{{{
+         WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Double')
+-        #process requested outputs
+         outputs = self.requested_outputs
+         indices = [i for i, x in enumerate(outputs) if x == 'default']
+-        if len(indices) > 0:
++        if len(indices):
+             outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+             outputs = outputscopy
+         WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
++    # }}}
+ 
+-    # }}}
++    def extrude(self, md): #{{{
++        return self
++    #}}}
+Index: ../trunk-jpl/src/m/classes/initialization.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/initialization.m	(revision 26301)
+@@ -26,26 +26,6 @@
+ 		sample              = NaN;
+ 	end
+ 	methods
+-		function self = extrude(self,md) % {{{
+-			self.vx=project3d(md,'vector',self.vx,'type','node');
+-			self.vy=project3d(md,'vector',self.vy,'type','node');
+-			self.vz=project3d(md,'vector',self.vz,'type','node');
+-			self.vel=project3d(md,'vector',self.vel,'type','node');
+-			self.temperature=project3d(md,'vector',self.temperature,'type','node');
+-			self.enthalpy=project3d(md,'vector',self.enthalpy,'type','node');
+-			self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node');
+-			self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node','layer',1);
+-			self.sediment_head=project3d(md,'vector',self.sediment_head,'type','node','layer',1);
+-			self.epl_head=project3d(md,'vector',self.epl_head,'type','node','layer',1);
+-			self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1);
+-			self.sealevel=project3d(md,'vector',self.sealevel,'type','node','layer',1);
+-			self.bottompressure=project3d(md,'vector',self.bottompressure,'type','node','layer',1);
+-			self.dsl=project3d(md,'vector',self.dsl,'type','node','layer',1);
+-			self.str=project3d(md,'vector',self.str,'type','node','layer',1);
+-
+-			%Lithostatic pressure by default
+-			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
+-		end % }}}
+ 		function self = initialization(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -200,6 +180,26 @@
+ 				WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
+ 			end
+ 		end % }}}
++		function self = extrude(self,md) % {{{
++			self.vx=project3d(md,'vector',self.vx,'type','node');
++			self.vy=project3d(md,'vector',self.vy,'type','node');
++			self.vz=project3d(md,'vector',self.vz,'type','node');
++			self.vel=project3d(md,'vector',self.vel,'type','node');
++			self.temperature=project3d(md,'vector',self.temperature,'type','node');
++			self.enthalpy=project3d(md,'vector',self.enthalpy,'type','node');
++			self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node');
++			self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node','layer',1);
++			self.sediment_head=project3d(md,'vector',self.sediment_head,'type','node','layer',1);
++			self.epl_head=project3d(md,'vector',self.epl_head,'type','node','layer',1);
++			self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1);
++			self.sealevel=project3d(md,'vector',self.sealevel,'type','node','layer',1);
++			self.bottompressure=project3d(md,'vector',self.bottompressure,'type','node','layer',1);
++			self.dsl=project3d(md,'vector',self.dsl,'type','node','layer',1);
++			self.str=project3d(md,'vector',self.str,'type','node','layer',1);
++
++			%Lithostatic pressure by default
++			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
++		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 
+ 			writejs1Darray(fid,[modelname '.initialization.vx'],self.vx);
+Index: ../trunk-jpl/src/m/classes/lovenumbers.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/lovenumbers.m	(revision 26301)
+@@ -15,14 +15,14 @@
+ 		l           = []; %idem
+ 		
+ 		%tidal love numbers for computing rotational feedback:
+-		th          = []; 
+-		tk          = []; 
+-		tl          = []; 
+-		tk2secular  = 0;  %deg 2 secular number.
++		th          = [];
++		tk          = [];
++		tl          = [];
++		tk2secular  = 0; %deg 2 secular number.
+ 
+ 		%time/frequency for visco-elastic love numbers
+ 		timefreq    = [];
+-		istime      = 1; 
++		istime      = 1;
+ 
+ 	end
+ 	methods
+@@ -32,8 +32,24 @@
+ 			referenceframe=getfieldvalue(options,'referenceframe','CM');
+ 			self=setdefaultparameters(self,maxdeg,referenceframe);
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   lovenumbers parameters:'));
++
++			fielddisplay(self,'h','load Love number for radial displacement');
++			fielddisplay(self,'k','load Love number for gravitational potential perturbation');
++			fielddisplay(self,'l','load Love number for horizontal displacements');
++
++			fielddisplay(self,'th','tidal load Love number (deg 2)');
++			fielddisplay(self,'tk','tidal load Love number (deg 2)');
++			fielddisplay(self,'tl','tidal load Love number (deg 2)');
++			fielddisplay(self,'tk2secular','secular fluid Love number');
++
++			fielddisplay(self,'istime','time (default: 1) or frequency love numbers (0)');
++			fielddisplay(self,'timefreq','time/frequency vector (yr or 1/yr)');
++
++		end % }}}
+ 		function self = setdefaultparameters(self,maxdeg,referenceframe) % {{{
+-		
++
+ 			%initialize love numbers:
+ 			self.h=getlovenumbers('type','loadingverticaldisplacement','referenceframe',referenceframe,'maxdeg',maxdeg);
+ 			self.k=getlovenumbers('type','loadinggravitationalpotential','referenceframe',referenceframe,'maxdeg',maxdeg);
+@@ -44,7 +60,7 @@
+ 
+ 			%secular fluid love number: 
+ 			self.tk2secular=0.942; 
+-			
++
+ 			%time: 
+ 			self.istime=1; %temporal love numbers by default
+ 			self.timefreq=0; %elastic case by default.
+@@ -72,7 +88,7 @@
+ 			if (size(self.h,1)~=size(self.k,1) | size(self.h,1)~=size(self.l,1)),
+ 				error('lovenumbers error message: love numbers should be provided at the same level of accuracy');
+ 			end
+-			
++
+ 			ntf=length(self.timefreq);
+ 			if( size(self.h,2) ~= ntf | size(self.k,2) ~= ntf | size(self.l,2) ~= ntf | size(self.th,2) ~= ntf | size(self.tk,2) ~= ntf | size(self.tl,2) ~= ntf ),
+ 				error('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector');
+@@ -82,22 +98,6 @@
+ 		function list=defaultoutputs(self,md) % {{{
+ 			list = {};
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   lovenumbers parameters:'));
+-
+-			fielddisplay(self,'h','load Love number for radial displacement');
+-			fielddisplay(self,'k','load Love number for gravitational potential perturbation');
+-			fielddisplay(self,'l','load Love number for horizontal displacements');
+-
+-			fielddisplay(self,'th','tidal load Love number (deg 2)');
+-			fielddisplay(self,'tk','tidal load Love number (deg 2)');
+-			fielddisplay(self,'tl','tidal load Love number (deg 2)');
+-			fielddisplay(self,'tk2secular','secular fluid Love number');
+-			
+-			fielddisplay(self,'istime','time (default=1) or frequency love numbers (0)');
+-			fielddisplay(self,'timefreq','time/frequency vector (yr or 1/yr)');
+-
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			WriteData(fid,prefix,'object',self,'fieldname','h','name','md.solidearth.lovenumbers.h','format','DoubleMat','mattype',1);
+Index: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 26301)
+@@ -203,7 +203,7 @@
+ 					fielddisplay(self,'ebm_alpha','array describing each layer''s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
+ 					fielddisplay(self,'ebm_delta','array describing each layer''s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
+ 					fielddisplay(self,'ebm_taul','array describing each layer''s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
+-					fielddisplay(self,'ebm_tauh','array describing each layer''s array describing each layer''s end period for transient relaxation, only for Burgers rheology  (numlayers) [s]');
++					fielddisplay(self,'ebm_tauh','array describing each layer''s array describing each layer''s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
+ 
+ 
+ 					fielddisplay(self,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
+@@ -255,7 +255,7 @@
+ 						if md.materials.rheologymodel(i)==1 & (isnan(md.materials.burgers_viscosity(i) | isnan(md.materials.burgers_mu(i)))),
+ 							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
+ 						end
+-						if md.materials.rheologymodel(i)==2 & (isnan(md.materials.ebm_alpha(i)) | isnan(md.materials.ebm_delta(i)) | isnan(md.materials.ebm_taul(i)) | isnan(md.materials.ebm_tauh(i)) ),
++						if md.materials.rheologymodel(i)==2 & (isnan(md.materials.ebm_alpha(i)) | isnan(md.materials.ebm_delta(i)) | isnan(md.materials.ebm_taul(i)) | isnan(md.materials.ebm_tauh(i))),
+ 							error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
+ 						end
+ 					end
+@@ -283,7 +283,7 @@
+ 
+ 			%1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+ 			WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(self.nature),'format','IntMat','mattype',3);
+-			WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); %DANGER, this can evolve if you have classes.
++			WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); %DANGER: this can evolve if you have classes.
+ 			for i=1:length(self.nature),
+ 				nat=self.nature{i};
+ 				switch nat
+@@ -325,6 +325,7 @@
+ 						earth_density=earth_density + (self.radius(i+1)^3-self.radius(i)^3)*self.density(i);
+ 					end
+ 					earth_density=earth_density/self.radius(self.numlayers+1)^3;
++					disp(earth_density)
+ 					self.earth_density=earth_density;
+ 				case 'hydro'
+ 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
+@@ -540,7 +541,7 @@
+ 				t4 = s(i,4)/((ra^3)*6.);
+ 				vs =  vs + t1*(r2^3) + t2*(r2^4) + t3*(r2^5) + t4*(r2^6) - ( t1*(r1^3) + t2*(r1^4) + t3*(r1^5) + t4*(r1^6) );
+ 
+-			end 
++			end
+ 			ro = ro*3 / (rad(j+1)^3-rad(j)^3);
+ 			vp = vp*3 /(rad(j+1)^3-rad(j)^3);
+ 			vs = vs*3 / (rad(j+1)^3-rad(j)^3);
+@@ -556,7 +557,6 @@
+ 		  end
+ 
+ 		end % }}}
+-   
+ 	end
+ end
+ 
+@@ -583,5 +583,3 @@
+ 		end
+ 	end
+ end % }}}
+-
+-   
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26301)
+@@ -38,10 +38,10 @@
+ 		thermal          = 0;
+ 		steadystate      = 0;
+ 		transient        = 0;
+-		levelset	     = 0;
++		levelset         = 0;
+ 		calving          = 0;
+ 		frontalforcings  = 0;
+-		love			 = 0;
++		love             = 0;
+ 		esa              = 0;
+ 		sampling         = 0;
+ 
+@@ -48,7 +48,7 @@
+ 		autodiff         = 0;
+ 		inversion        = 0;
+ 		qmu              = 0;
+-		amr				 = 0;
++		amr              = 0;
+ 		results          = 0;
+ 		outputdefinition = 0;
+ 		radaroverlay     = 0;
+@@ -206,6 +206,50 @@
+ 
+ 		end
+ 		%}}}
++		function disp(self) % {{{
++			disp(sprintf('%19s: %-22s -- %s','mesh'            ,['[1x1 ' class(self.mesh) ']'],'mesh properties'));
++			disp(sprintf('%19s: %-22s -- %s','mask'            ,['[1x1 ' class(self.mask) ']'],'defines grounded and floating elements'));
++			disp(sprintf('%19s: %-22s -- %s','geometry'        ,['[1x1 ' class(self.geometry) ']'],'surface elevation, bedrock topography, ice thickness,...'));
++			disp(sprintf('%19s: %-22s -- %s','constants'       ,['[1x1 ' class(self.constants) ']'],'physical constants'));
++			disp(sprintf('%19s: %-22s -- %s','smb'             ,['[1x1 ' class(self.smb) ']'],'surface mass balance'));
++			disp(sprintf('%19s: %-22s -- %s','basalforcings'   ,['[1x1 ' class(self.basalforcings) ']'],'bed forcings'));
++			disp(sprintf('%19s: %-22s -- %s','materials'       ,['[1x1 ' class(self.materials) ']'],'material properties'));
++			disp(sprintf('%19s: %-22s -- %s','damage'          ,['[1x1 ' class(self.damage) ']'],'parameters for damage evolution solution'));
++			disp(sprintf('%19s: %-22s -- %s','friction'        ,['[1x1 ' class(self.friction) ']'],'basal friction/drag properties'));
++			disp(sprintf('%19s: %-22s -- %s','flowequation'    ,['[1x1 ' class(self.flowequation) ']'],'flow equations'));
++			disp(sprintf('%19s: %-22s -- %s','timestepping'    ,['[1x1 ' class(self.timestepping) ']'],'time stepping for transient models'));
++			disp(sprintf('%19s: %-22s -- %s','initialization'  ,['[1x1 ' class(self.initialization) ']'],'initial guess/state'));
++			disp(sprintf('%19s: %-22s -- %s','rifts'           ,['[1x1 ' class(self.rifts) ']'],'rifts properties'));
++			disp(sprintf('%19s: %-22s -- %s','solidearth'      ,['[1x1 ' class(self.solidearth) ']'],'solidearth inputs and settings'));
++			disp(sprintf('%19s: %-22s -- %s','dsl'             ,['[1x1 ' class(self.dsl) ']'],'dynamic sea-level '));
++			disp(sprintf('%19s: %-22s -- %s','debug'           ,['[1x1 ' class(self.debug) ']'],'debugging tools (valgrind, gprof)'));
++			disp(sprintf('%19s: %-22s -- %s','verbose'         ,['[1x1 ' class(self.verbose) ']'],'verbosity level in solve'));
++			disp(sprintf('%19s: %-22s -- %s','settings'        ,['[1x1 ' class(self.settings) ']'],'settings properties'));
++			disp(sprintf('%19s: %-22s -- %s','toolkits'        ,['[1x1 ' class(self.toolkits) ']'],'PETSc options for each solution'));
++			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of CPUs...)'));
++			disp(sprintf('%19s: %-22s -- %s','balancethickness',['[1x1 ' class(self.balancethickness) ']'],'parameters for balancethickness solution'));
++			disp(sprintf('%19s: %-22s -- %s','stressbalance'   ,['[1x1 ' class(self.stressbalance) ']'],'parameters for stressbalance solution'));
++			disp(sprintf('%19s: %-22s -- %s','groundingline'   ,['[1x1 ' class(self.groundingline) ']'],'parameters for groundingline solution'));
++			disp(sprintf('%19s: %-22s -- %s','hydrology'       ,['[1x1 ' class(self.hydrology) ']'],'parameters for hydrology solution'));
++			disp(sprintf('%19s: %-22s -- %s','masstransport'   ,['[1x1 ' class(self.masstransport) ']'],'parameters for masstransport solution'));
++			disp(sprintf('%19s: %-22s -- %s','thermal'         ,['[1x1 ' class(self.thermal) ']'],'parameters for thermal solution'));
++			disp(sprintf('%19s: %-22s -- %s','steadystate'     ,['[1x1 ' class(self.steadystate) ']'],'parameters for steadystate solution'));
++			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parHwoameters for transient solution'));
++			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
++			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
++			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
++			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
++			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
++			disp(sprintf('%19s: %-22s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
++			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
++			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
++			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'Dakota properties'));
++			disp(sprintf('%19s: %-22s -- %s','amr'             ,['[1x1 ' class(self.amr) ']'],'adaptive mesh refinement properties'));
++			disp(sprintf('%19s: %-22s -- %s','outputdefinition',['[1x1 ' class(self.outputdefinition) ']'],'output definition'));
++			disp(sprintf('%19s: %-22s -- %s','results'         ,['[1x1 ' class(self.results) ']'],'model results'));
++			disp(sprintf('%19s: %-22s -- %s','radaroverlay'    ,['[1x1 ' class(self.radaroverlay) ']'],'radar image for plot overlay'));
++			disp(sprintf('%19s: %-22s -- %s','miscellaneous'   ,['[1x1 ' class(self.miscellaneous) ']'],'miscellaneous fields'));
++		end % }}}
+ 		function md = setdefaultparameters(md,planet) % {{{
+ 
+ 			%initialize subclasses
+@@ -1132,7 +1176,7 @@
+ 			if md.mesh.average_vertex_connectivity<=25,
+ 				md.mesh.average_vertex_connectivity=100;
+ 			end
+-			end % }}}
++		end % }}}
+ 		function md = structtomodel(md,structmd) % {{{
+ 
+ 			if ~isstruct(structmd) error('input model is not a structure'); end
+@@ -1583,97 +1627,54 @@
+ 				md.mesh.average_vertex_connectivity=100;
+ 			end
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('%19s: %-22s -- %s','mesh'            ,['[1x1 ' class(self.mesh) ']'],'mesh properties'));
+-			disp(sprintf('%19s: %-22s -- %s','mask'            ,['[1x1 ' class(self.mask) ']'],'defines grounded and floating elements'));
+-			disp(sprintf('%19s: %-22s -- %s','geometry'        ,['[1x1 ' class(self.geometry) ']'],'surface elevation, bedrock topography, ice thickness,...'));
+-			disp(sprintf('%19s: %-22s -- %s','constants'       ,['[1x1 ' class(self.constants) ']'],'physical constants'));
+-			disp(sprintf('%19s: %-22s -- %s','smb'             ,['[1x1 ' class(self.smb) ']'],'surface mass balance'));
+-			disp(sprintf('%19s: %-22s -- %s','basalforcings'   ,['[1x1 ' class(self.basalforcings) ']'],'bed forcings'));
+-			disp(sprintf('%19s: %-22s -- %s','materials'       ,['[1x1 ' class(self.materials) ']'],'material properties'));
+-			disp(sprintf('%19s: %-22s -- %s','damage'          ,['[1x1 ' class(self.damage) ']'],'parameters for damage evolution solution'));
+-			disp(sprintf('%19s: %-22s -- %s','friction'        ,['[1x1 ' class(self.friction) ']'],'basal friction/drag properties'));
+-			disp(sprintf('%19s: %-22s -- %s','flowequation'    ,['[1x1 ' class(self.flowequation) ']'],'flow equations'));
+-			disp(sprintf('%19s: %-22s -- %s','timestepping'    ,['[1x1 ' class(self.timestepping) ']'],'time stepping for transient models'));
+-			disp(sprintf('%19s: %-22s -- %s','initialization'  ,['[1x1 ' class(self.initialization) ']'],'initial guess/state'));
+-			disp(sprintf('%19s: %-22s -- %s','rifts'           ,['[1x1 ' class(self.rifts) ']'],'rifts properties'));
+-			disp(sprintf('%19s: %-22s -- %s','solidearth'      ,['[1x1 ' class(self.solidearth) ']'],'solidearth inputs and settings'));
+-			disp(sprintf('%19s: %-22s -- %s','dsl'             ,['[1x1 ' class(self.dsl) ']'],'dynamic sea-level '));
+-			disp(sprintf('%19s: %-22s -- %s','debug'           ,['[1x1 ' class(self.debug) ']'],'debugging tools (valgrind, gprof)'));
+-			disp(sprintf('%19s: %-22s -- %s','verbose'         ,['[1x1 ' class(self.verbose) ']'],'verbosity level in solve'));
+-			disp(sprintf('%19s: %-22s -- %s','settings'        ,['[1x1 ' class(self.settings) ']'],'settings properties'));
+-			disp(sprintf('%19s: %-22s -- %s','toolkits'        ,['[1x1 ' class(self.toolkits) ']'],'PETSc options for each solution'));
+-			disp(sprintf('%19s: %-22s -- %s','cluster'         ,['[1x1 ' class(self.cluster) ']'],'cluster parameters (number of CPUs...)'));
+-			disp(sprintf('%19s: %-22s -- %s','balancethickness',['[1x1 ' class(self.balancethickness) ']'],'parameters for balancethickness solution'));
+-			disp(sprintf('%19s: %-22s -- %s','stressbalance'   ,['[1x1 ' class(self.stressbalance) ']'],'parameters for stressbalance solution'));
+-			disp(sprintf('%19s: %-22s -- %s','groundingline'   ,['[1x1 ' class(self.groundingline) ']'],'parameters for groundingline solution'));
+-			disp(sprintf('%19s: %-22s -- %s','hydrology'       ,['[1x1 ' class(self.hydrology) ']'],'parameters for hydrology solution'));
+-			disp(sprintf('%19s: %-22s -- %s','masstransport'   ,['[1x1 ' class(self.masstransport) ']'],'parameters for masstransport solution'));
+-			disp(sprintf('%19s: %-22s -- %s','thermal'         ,['[1x1 ' class(self.thermal) ']'],'parameters for thermal solution'));
+-			disp(sprintf('%19s: %-22s -- %s','steadystate'     ,['[1x1 ' class(self.steadystate) ']'],'parameters for steadystate solution'));
+-			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parHwoameters for transient solution'));
+-			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
+-			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
+-			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
+-			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
+-			disp(sprintf('%19s: %-22s -- %s','love'            ,['[1x1 ' class(self.love) ']'],'parameters for love solution'));
+-			disp(sprintf('%19s: %-22s -- %s','sampling'        ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler'));
+-			disp(sprintf('%19s: %-22s -- %s','autodiff'        ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters'));
+-			disp(sprintf('%19s: %-22s -- %s','inversion'       ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods'));
+-			disp(sprintf('%19s: %-22s -- %s','qmu'             ,['[1x1 ' class(self.qmu) ']'],'Dakota properties'));
+-			disp(sprintf('%19s: %-22s -- %s','amr'             ,['[1x1 ' class(self.amr) ']'],'adaptive mesh refinement properties'));
+-			disp(sprintf('%19s: %-22s -- %s','outputdefinition',['[1x1 ' class(self.outputdefinition) ']'],'output definition'));
+-			disp(sprintf('%19s: %-22s -- %s','results'         ,['[1x1 ' class(self.results) ']'],'model results'));
+-			disp(sprintf('%19s: %-22s -- %s','radaroverlay'    ,['[1x1 ' class(self.radaroverlay) ']'],'radar image for plot overlay'));
+-			disp(sprintf('%19s: %-22s -- %s','miscellaneous'   ,['[1x1 ' class(self.miscellaneous) ']'],'miscellaneous fields'));
+-		end % }}}
+ 		function memory(self) % {{{
+ 
+-		disp(sprintf('\nMemory imprint:\n'));
++			disp(sprintf('\nMemory imprint:\n'));
+ 
+-		fields=properties('model');
+-		mem=0;
++			fields=properties('model');
++			mem=0;
+ 
+-		for i=1:length(fields),
+-			field=self.(fields{i});
+-			s=whos('field'); 
+-			mem=mem+s.bytes/1e6;
+-			disp(sprintf('%19s: %6.2f Mb',fields{i},s.bytes/1e6));
++			for i=1:length(fields),
++				field=self.(fields{i});
++				s=whos('field'); 
++				mem=mem+s.bytes/1e6;
++				disp(sprintf('%19s: %6.2f Mb',fields{i},s.bytes/1e6));
++			end
++			disp(sprintf('%19s--%10s','--------------','--------------'));
++			disp(sprintf('%19s: %g Mb','Total',mem));
+ 		end
+-		disp(sprintf('%19s--%10s','--------------','--------------'));
+-		disp(sprintf('%19s: %g Mb','Total',mem));
+-		end % }}}
++		% }}}
+ 		function netcdf(self,filename) % {{{
+-		%NETCDF - save model as netcdf
+-		%
+-		%   Usage:
+-		%      netcdf(md,filename)
+-		%
+-		%   Example:
+-		%      netcdf(md,'model.nc');
++			%NETCDF - save model as netcdf
++			%
++			%   Usage:
++			%      netcdf(md,filename)
++			%
++			%   Example:
++			%      netcdf(md,'model.nc');
+ 
+-		disp('Saving model as NetCDF');
+-		%1. Create NetCDF file
+-		ncid=netcdf.create(filename,'CLOBBER');
+-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Conventions','CF-1.4');
+-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Title',['ISSM model (' self.miscellaneous.name ')']);
+-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Author',getenv('USER'));
+-		netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Date',datestr(now));
++			disp('Saving model as NetCDF');
++			%1. Create NetCDF file
++			ncid=netcdf.create(filename,'CLOBBER');
++			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Conventions','CF-1.4');
++			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Title',['ISSM model (' self.miscellaneous.name ')']);
++			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Author',getenv('USER'));
++			netcdf.putAtt(ncid,netcdf.getConstant('NC_GLOBAL'),'Date',datestr(now));
+ 
+-		%Preallocate variable id, needed to write variables in netcdf file
+-		var_id=zeros(1000,1);%preallocate
++			%Preallocate variable id, needed to write variables in netcdf file
++			var_id=zeros(1000,1);%preallocate
+ 
+-		for step=1:2,
+-			counter=0;
+-			[var_id,counter]=structtonc(ncid,'md',self,0,var_id,counter,step);
+-			if step==1, netcdf.endDef(ncid); end
+-		end
++			for step=1:2,
++				counter=0;
++				[var_id,counter]=structtonc(ncid,'md',self,0,var_id,counter,step);
++				if step==1, netcdf.endDef(ncid); end
++			end
+ 
+-		if counter>1000,
+-			warning(['preallocation of var_id need to be updated from ' num2str(1000) ' to ' num2str(counter)]);
+-		end
++			if counter>1000,
++				warning(['preallocation of var_id need to be updated from ' num2str(1000) ' to ' num2str(counter)]);
++			end
+ 
+-		netcdf.close(ncid)
++			netcdf.close(ncid)
+ 		end % }}}
+ 		function xylim(self) % {{{
+ 
+@@ -1681,40 +1682,40 @@
+ 			ylim([min(self.mesh.y) max(self.mesh.y)])
+ 		end % }}}
+ 		function md=upload(md) % {{{
+-		%the goal of this routine is to upload the model onto a server, and to empty it.
+-		%So first, save the model with a unique name and upload the file to the server: 
+-		random_part=fix(rand(1)*10000);
+-		id=[md.miscellaneous.name '-' regexprep(datestr(now),'[^\w'']','') '-' num2str(random_part)  '-' getenv('USER') '-' oshostname() '.upload']; 
+-		eval(['save ' id ' md']);
++			%the goal of this routine is to upload the model onto a server, and to empty it.
++			%So first, save the model with a unique name and upload the file to the server: 
++			random_part=fix(rand(1)*10000);
++			id=[md.miscellaneous.name '-' regexprep(datestr(now),'[^\w'']','') '-' num2str(random_part)  '-' getenv('USER') '-' oshostname() '.upload']; 
++			eval(['save ' id ' md']);
+ 
+-		%Now, upload the file: 
+-		issmscpout(md.settings.upload_server,md.settings.upload_path,md.settings.upload_login,md.settings.upload_port,{id},1);
++			%Now, upload the file: 
++			issmscpout(md.settings.upload_server,md.settings.upload_path,md.settings.upload_login,md.settings.upload_port,{id},1);
+ 
+-		%Now, empty this model of everything except settings, and record name of file we just uploaded!
+-		settings_back=md.settings;
+-		md=model();
+-		md.settings=settings_back;
+-		md.settings.upload_filename=id;
++			%Now, empty this model of everything except settings, and record name of file we just uploaded!
++			settings_back=md.settings;
++			md=model();
++			md.settings=settings_back;
++			md.settings.upload_filename=id;
+ 
+-		%get locally rid of file that was uploaded
+-		eval(['delete ' id]);
++			%get locally rid of file that was uploaded
++			eval(['delete ' id]);
+ 
+ 		end % }}}
+ 		function md=download(md) % {{{
+ 
+-		%the goal of this routine is to download the internals of the current model from a server, because 
+-		%this model is empty, except for the settings which tell us where to go and find this model!
++			%the goal of this routine is to download the internals of the current model from a server, because 
++			%this model is empty, except for the settings which tell us where to go and find this model!
+ 
+-		%Download the file: 
+-		issmscpin(md.settings.upload_server, md.settings.upload_login, md.settings.upload_port, md.settings.upload_path, {md.settings.upload_filename});
++			%Download the file: 
++			issmscpin(md.settings.upload_server, md.settings.upload_login, md.settings.upload_port, md.settings.upload_path, {md.settings.upload_filename});
+ 
+-		name=md.settings.upload_filename;
++			name=md.settings.upload_filename;
+ 
+-		%Now, load this model: 
+-		md=loadmodel(md.settings.upload_filename);
++			%Now, load this model: 
++			md=loadmodel(md.settings.upload_filename);
+ 
+-		%get locally rid of file that was downloaded
+-		eval(['delete ' name]);
++			%get locally rid of file that was downloaded
++			eval(['delete ' name]);
+ 
+ 		end % }}}
+ 		function savemodeljs(md,modelname,websiteroot,varargin) % {{{
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26301)
+@@ -75,31 +75,39 @@
+ 
+ 
+ class model(object):
+-    #properties
++    """MODEL - class definition
++
++    Usage:
++        md = model()
++    """
++
+     def __init__(self, *args): #{{{
+         self.mesh = None
+         self.mask = None
++
++        self.geometry = None
+         self.constants = None
+-        self.geometry = None
+-        self.initialization = None
+         self.smb = None
+         self.basalforcings = None
++        self.materials = None
++        self.damage = None
+         self.friction = None
++        self.flowequation = None
++        self.timestepping = None
++        self.initialization = None
+         self.rifts = None
++        self.dsl = None
+         self.solidearth = None
+-        self.dsl = None
+-        self.timestepping = None
+-        self.groundingline = None
+-        self.materials = None
+-        self.damage = None
+-        self.flowequation = None
++
+         self.debug = None
+         self.verbose = None
+         self.settings = None
+         self.toolkits = None
+         self.cluster = None
++
+         self.balancethickness = None
+         self.stressbalance = None
++        self.groundingline = None
+         self.hydrology = None
+         self.masstransport = None
+         self.thermal = None
+@@ -111,81 +119,30 @@
+         self.love = None
+         self.esa = None
+         self.sampling = None
++
+         self.autodiff = None
+         self.inversion = None
+         self.qmu = None
+         self.amr = None
+-        self.radaroverlay = None
+         self.results = None
+         self.outputdefinition = None
++        self.radaroverlay = None
+         self.miscellaneous = None
+         self.private = None
+ 
+-        nargs = len(args)
+-
+-        if nargs == 0:
++        if len(args) == 0:
+             self.setdefaultparameters('earth')
+         else:
+-            self.setdefaultparameters(args[0])
+             options = pairoptions(*args)
+             planet = options.getfieldvalue('planet', 'earth')
+             self.setdefaultparameters(planet)
+-#}}}
++    #}}}
+ 
+-    def properties(self):  # {{{
+-        # ordered list of properties since vars(self) is random
+-        return ['mesh',
+-                'mask',
+-                'constants',
+-                'geometry',
+-                'initialization',
+-                'smb',
+-                'basalforcings',
+-                'friction',
+-                'rifts',
+-                'solidearth',
+-                'dsl',
+-                'timestepping',
+-                'groundingline',
+-                'materials',
+-                'damage',
+-                'flowequation',
+-                'debug',
+-                'verbose',
+-                'settings',
+-                'toolkits',
+-                'cluster',
+-                'balancethickness',
+-                'stressbalance',
+-                'hydrology',
+-                'masstransport',
+-                'thermal',
+-                'steadystate',
+-                'transient',
+-                'levelset',
+-                'calving',
+-                'frontalforcings',
+-                'love',
+-                'esa',
+-                'sampling',
+-                'autodiff',
+-                'inversion',
+-                'qmu',
+-                'amr',
+-                'radaroverlay',
+-                'results',
+-                'outputdefinition',
+-                'miscellaneous',
+-                'private']
+-    # }}}
+-
+     def __repr__(obj):  #{{{
+         # TODO:
+         # - Convert all formatting to calls to <string>.format (see any
+         #   already converted <class>.__repr__ method for examples)
+         #
+-
+-        #print "Here %s the number: %d" % ("is", 37)
+         s = "%19s: %-22s -- %s" % ("mesh", "[%s %s]" % ("1x1", obj.mesh.__class__.__name__), "mesh properties")
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("mask", "[%s %s]" % ("1x1", obj.mask.__class__.__name__), "defines grounded and floating elements"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("geometry", "[%s %s]" % ("1x1", obj.geometry.__class__.__name__), "surface elevation, bedrock topography, ice thickness, ..."))
+@@ -229,8 +186,55 @@
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("radaroverlay", "[%s %s]" % ("1x1", obj.radaroverlay.__class__.__name__), "radar image for plot overlay"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("miscellaneous", "[%s %s]" % ("1x1", obj.miscellaneous.__class__.__name__), "miscellaneous fields"))
+         return s
+-    # }}}
++    #}}}
+ 
++    def properties(self): #{{{
++        # ordered list of properties since vars(self) is random
++        return ['mesh',
++                'mask',
++                'geometry',
++                'constants',
++                'smb',
++                'basalforcings',
++                'materials',
++                'damage',
++                'friction',
++                'flowequation',
++                'timestepping',
++                'initialization',
++                'rifts',
++                'dsl',
++                'solidearth',
++                'debug',
++                'verbose',
++                'settings',
++                'toolkits',
++                'cluster',
++                'balancethickness',
++                'stressbalance',
++                'groundingline',
++                'hydrology',
++                'masstransport',
++                'thermal',
++                'steadystate',
++                'transient',
++                'levelset',
++                'calving',
++                'frontalforcings',
++                'love',
++                'esa',
++                'sampling',
++                'autodiff',
++                'inversion',
++                'qmu',
++                'amr',
++                'results',
++                'outputdefinition',
++                'radaroverlay',
++                'miscellaneous',
++                'private']
++    #}}}
++
+     def setdefaultparameters(self, planet): #{{{
+         self.mesh = mesh2d()
+         self.mask = mask()
+@@ -277,14 +281,14 @@
+         self.private = private()
+     #}}}
+ 
+-    def checkmessage(self, string):  # {{{
++    def checkmessage(self, string): #{{{
+         print("model not consistent: {}".format(string))
+         self.private.isconsistent = False
+         return self
+-    # }}}
++    #}}}
+     #@staticmethod
+ 
+-    def extract(self, area):  # {{{
++    def extract(self, area): #{{{
+         """EXTRACT - extract a model according to an Argus contour or flag list
+ 
+         This routine extracts a submodel from a bigger model with respect to a given contour
+@@ -561,9 +565,9 @@
+         md2.mesh.extractedelements = pos_elem + 1
+ 
+         return md2
+-    # }}}
++    #}}}
+ 
+-    def extrude(md, *args):  # {{{
++    def extrude(md, *args): #{{{
+         """EXTRUDE - vertically extrude a 2d mesh
+ 
+         vertically extrude a 2d mesh and create corresponding 3d mesh.
+@@ -748,7 +752,7 @@
+             md.mesh.average_vertex_connectivity = 100
+ 
+         return md
+-    # }}}
++    #}}}
+ 
+     def collapse(md): #{{{
+         """COLLAPSE - collapses a 3d mesh into a 2d mesh
+Index: ../trunk-jpl/src/m/classes/sampling.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/sampling.m	(revision 26301)
+@@ -5,107 +5,98 @@
+ 
+ classdef sampling
+ 	properties (SetAccess=public)
+-         kappa          = NaN;
+-		 tau            = 0;
+-		 beta           = NaN;
+-         phi            = 0;
+-         alpha          = 0;
+-         robin          = 0;
+-         seed           = 0;
+-		 requested_outputs      = {};
+-    end
++		kappa             = NaN;
++		tau               = 0;
++		beta              = NaN;
++		phi               = 0;
++		alpha             = 0;
++		robin             = 0;
++		seed              = 0;
++		requested_outputs = {};
++	end
+ 	methods
+ 		function self = sampling(varargin) % {{{
+-            switch nargin
++			switch nargin
+ 				case 0
+ 					self=setdefaultparameters(self);
+ 				otherwise
+ 					error('constructor not supported');
+-            end
++			end
+ 		end % }}}
+-		function list = defaultoutputs(self,md) % {{{
++		function disp(self) % {{{
+ 
+-            list = {};
++			disp(sprintf('   Sampling parameters:'));
+ 
+-		end % }}}
++			disp(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
++			fielddisplay(self,'kappa','coefficient of the identity operator');
++			fielddisplay(self,'tau','scaling coefficient of the solution (default: 1.0)');
++			fielddisplay(self,'alpha','exponent in PDE operator, (default: 2.0, BiLaplacian covariance operator)');
++
++			disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
++			fielddisplay(self,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default: 0)');
++			fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');
++
++			disp(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
++			fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
++
++			disp(sprintf('\n      %s','Other parameters of stochastic sampler:'));
++			fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default: -1)');
++			fielddisplay(self,'requested_outputs','additional outputs requested (not implemented yet)');
++
++		end % }}}','
+ 		function self = setdefaultparameters(self) % {{{
+-            
+-            %Scaling coefficient
+-			self.tau=1;  
+ 
+-            %Apply Robin boundary conditions
+-			self.robin=0;   
+-            
+-            %Temporal correlation factor
+-			self.phi=0;  
+-            
+-			%Exponent in fraction SPDE (default=2, biLaplacian covariance
++			%Scaling coefficient
++			self.tau=1;
++
++			%Apply Robin boundary conditions
++			self.robin=0;
++
++			%Temporal correlation factor
++			self.phi=0;
++
++			%Exponent in fraction SPDE (default: 2, biLaplacian covariance
+ 			%operator)
+ 			self.alpha=2; % Default 
+-            
+-            %Seed for pseudorandom number generator (default -1 for random seed)
+-            self.seed=-1;
+-            
++
++			%Seed for pseudorandom number generator (default: -1, for random seed)
++			self.seed=-1;
++
+ 			%default output
+ 			self.requested_outputs={'default'};
+ 
+ 		end % }}}
+-        function md = setparameters(self,md,lc,sigma) % {{{
+-            
+-            nu = self.alpha-1; 
+-            KAPPA = sqrt(8*nu)/lc;
+-            TAU = sqrt(gamma(nu)/(gamma(self.alpha)*(4*pi)*KAPPA^(2*nu)*sigma^2));
+-            md.sampling.kappa = KAPPA*ones(md.mesh.numberofvertices,1);
+-            md.sampling.tau = TAU;
+-       
++		function list = defaultoutputs(self,md) % {{{
++
++			list = {};
++
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+-            
+-            if ~ismember('SamplingAnalysis',analyses), return; end
+-			
+-            md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+-            md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
+-            md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
+-            if(md.sampling.robin)
+-                md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
+-            end    
+-            md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
+-            md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
+-            md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
+-            md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
+ 
+-		end % }}}
+-		function disp(self) % {{{
++			if ~ismember('SamplingAnalysis',analyses), return; end
+ 
+-            disp(sprintf('   Sampling parameters:'));
++			md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++			md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
++			md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]);
++			if(md.sampling.robin)
++				md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0);
++			end
++			md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
++			md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
++			md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
++			md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
+ 
+-			disp(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
+-            fielddisplay(self,'kappa','coefficient of the identity operator');
+-			fielddisplay(self,'tau','scaling coefficient of the solution (default 1.0)');
+-			fielddisplay(self,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)');
+-          
+-			disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
+-			fielddisplay(self,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default 0)');
+-			fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');          
+-            
+-            disp(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
+-			fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
+-            
+-			disp(sprintf('\n      %s','Other parameters of stochastic sampler:'));
+-            fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)');
+-			fielddisplay(self,'requested_outputs','additional outputs requested (not implemented yet)');
+- 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+-            WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1);
+-            WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double');
+-            WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1);
+-            WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double');
+-            WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer');
+-            WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean');
+-            WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer');
+-            
++			WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double');
++			WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1);
++			WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double');
++			WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean');
++			WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer');
++
+ 			%process requested outputs
+ 			outputs = self.requested_outputs;
+ 			pos  = find(ismember(outputs,'default'));
+@@ -115,17 +106,26 @@
+ 			end
+ 			WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
+ 		end % }}}
++		function md = setparameters(self,md,lc,sigma) % {{{
++
++			nu = self.alpha-1;
++			KAPPA = sqrt(8*nu)/lc;
++			TAU = sqrt(gamma(nu)/(gamma(self.alpha)*(4*pi)*KAPPA^(2*nu)*sigma^2));
++			md.sampling.kappa = KAPPA*ones(md.mesh.numberofvertices,1);
++			md.sampling.tau = TAU;
++
++		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+-            
+-            writejsdouble(fid,[modelname '.sampling.kappa'],self.kappa);
+-            writejsdouble(fid,[modelname '.sampling.tau'],self.tau);
+-            writejsdouble(fid,[modelname '.sampling.beta'],self.beta);
+-            writejsdouble(fid,[modelname '.sampling.phi'],self.beta);
+-            writejsdouble(fid,[modelname '.sampling.alpha'],self.alpha);
+-            writejsdouble(fid,[modelname '.sampling.robin'],self.robin);
+-            writejsdouble(fid,[modelname '.sampling.seed'],self.seed);
++
++			writejsdouble(fid,[modelname '.sampling.kappa'],self.kappa);
++			writejsdouble(fid,[modelname '.sampling.tau'],self.tau);
++			writejsdouble(fid,[modelname '.sampling.beta'],self.beta);
++			writejsdouble(fid,[modelname '.sampling.phi'],self.beta);
++			writejsdouble(fid,[modelname '.sampling.alpha'],self.alpha);
++			writejsdouble(fid,[modelname '.sampling.robin'],self.robin);
++			writejsdouble(fid,[modelname '.sampling.seed'],self.seed);
+ 			writejscellstring(fid,[modelname '.sampling.requested_outputs'],self.requested_outputs);
+ 
+ 		end % }}}
+ 	end
+-end
+\ No newline at end of file
++end
+Index: ../trunk-jpl/src/m/classes/sampling.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/sampling.py	(revision 26301)
+@@ -1,5 +1,7 @@
+ import numpy as np
+ 
++from math import *
++
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from project3d import project3d
+@@ -13,11 +15,10 @@
+         sampling = sampling()
+     """
+ 
+-    def __init__(self):  # {{{
+-        self.kappa = float('NaN')
++    def __init__(self, *args): #{{{
++        self.kappa = np.nan
+         self.tau = 0
+-        self.beta = float('NaN')
+-        self.hydrostatic_adjustment = 0
++        self.beta = np.nan
+         self.phi = 0
+         self.alpha = 0
+         self.robin = 0
+@@ -24,72 +25,87 @@
+         self.seed = 0
+         self.requested_outputs = []
+ 
+-        # Set defaults
+-        self.setdefaultparameters()
+-
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            raise RuntimeError('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self):  # {{{
++    def __repr__(self): #{{{
+         s = '   Sampling parameters::\n'
+-        s += '{}\n'.format(fielddisplay(self,'kappa','coefficient of the identity operator'))
+-        s += '{}\n'.format(fielddisplay(self,'tau','scaling coefficient of the solution (default 1.0)'))
+-        s += '{}\n'.format(fielddisplay(self,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)'))
+-        s += '{}\n'.format(disp(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():')))
+-        s += '{}\n'.format(fielddisplay(self,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)'))
+-        s += '{}\n'.format(fielddisplay(self,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)'))
+-        s += '{}\n'.format(fielddisplay(self,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)'))
++        s += '      Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):\n'
++        s += '{}\n'.format(fielddisplay(self, 'kappa', 'coefficient of the identity operator'))
++        s += '{}\n'.format(fielddisplay(self, 'tau', 'scaling coefficient of the solution (default: 1.0)'))
++        s += '{}\n'.format(fielddisplay(self, 'alpha', 'exponent in PDE operator, (default: 2.0, BiLaplacian covariance operator)'))
++
++        s += '      Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():\n'
++        s += '{}\n'.format(fielddisplay(self, 'robin', 'Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default: 0)'))
++        s += '{}\n'.format(fielddisplay(self, 'beta', 'Coefficient in Robin boundary conditions (to be defined for robin = 1)'))
++
++        s += '      Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):\n'
++        s += '{}\n'.format(fielddisplay(self, 'phi', 'Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)'))
++
++        s += '      Other parameters of stochastic sampler:\n'
++        s += '{}\n'.format(fielddisplay(self, 'seed', 'Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default: -1)'))
+         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested (not implemented yet)'))
++
+         return s
+     #}}}
+ 
+-    def defaultoutputs(self, md):  # {{{
+-        return []
+-
+-    #}}}
+-    def setdefaultparameters(self):  # {{{
++    def setdefaultparameters(self): #{{{
+         # Scaling coefficient
+         self.tau = 1
++
+         # Apply Robin boundary conditions
+         self.robin = 0
++
+         # Temporal correlation factor
+         self.phi = 0
+-        # Exponent in fraction SPDE (default=2, biLaplacian covariance operator)
++
++        # Exponent in fraction SPDE (default: 2, biLaplacian covariance operator)
+         self.alpha = 2
+-        # Seed for pseudorandom number generator (default -1 for random seed)
+-        self.alpha = -1
++
++        # Seed for pseudorandom number generator (default: -1, for random seed)
++        self.seed = -1
++
+         # Default output
+         self.requested_outputs = ['default']
++
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses):  # {{{
+-        # Early return
++    def defaultoutputs(self, md): #{{{
++        return []
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses): #{{{
+         if ('SamplingAnalysis' not in analyses):
+             return md
+ 
+-        md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
+-        md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0, 1])
++        md = checkfield(md, 'fieldname', 'sampling.kappa', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
++        md = checkfield(md, 'fieldname', 'sampling.tau', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'sampling.robin', 'numel', 1, 'values', [0, 1])
+         if md.sampling.robin:
+-            md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
+-        md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0)
+-        md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0)
+-        md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1)
+-        md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1)
++            md = checkfield(md, 'fieldname', 'sampling.beta', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
++        end
++        md = checkfield(md, 'fieldname', 'sampling.phi', 'NaN', 1, 'Inf', 1, 'numel', 1, '>=', 0)
++        md = checkfield(md, 'fieldname', 'sampling.alpha', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'sampling.seed', 'NaN', 1, 'Inf', 1, 'numel', 1)
++        md = checkfield(md, 'fieldname', 'sampling.requested_outputs', 'stringrow', 1)
+ 
+         return md
+-    # }}}
++    #}}}
+ 
+-    def marshall(self, prefix, md, fid):  # {{{
+-        WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1)
+-        WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double')
+-        WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1)
+-        WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double')
+-        WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer')
+-        WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean')
+-        WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer')
++    def marshall(self, prefix, md, fid): #{{{
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'kappa', 'format', 'DoubleMat', 'mattype', 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'tau', 'format', 'Double')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'beta', 'format', 'DoubleMat', 'mattype', 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'phi', 'format', 'Double')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'alpha', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'robin', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'seed', 'format', 'Integer')
+ 
+-    #process requested outputs
++        # Process requested outputs
+         outputs = self.requested_outputs
+         indices = [i for i, x in enumerate(outputs) if x == 'default']
+         if len(indices) > 0:
+@@ -96,5 +112,14 @@
+             outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+             outputs = outputscopy
+         WriteData(fid, prefix, 'data', outputs, 'name', 'md.sampling.requested_outputs', 'format', 'StringArray')
++    #}}}
+ 
+-    # }}}
++    def setparameters(self, md, lc, sigma): #{{{
++        nu = self.alpha - 1
++        KAPPA = pow((8 * nu), 0.5) / lc
++        TAU = pow((math.gamma(nu) / math.gamma(self.alpha) * (4 *  np.pi) * pow(KAPPA, 2 * nu) * pow(sigma, 2)), 0.5)
++        md.sampling.kappa = KAPPA * np.ones((md.mesh.numberofvertices, 1))
++        md.sampling.tau = TAU
++
++        return md
++    #}}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26301)
+@@ -91,6 +91,27 @@
+ 		self.grdmodel=0; 
+ 
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   solidearth settings:'));
++
++			fielddisplay(self,'reltol','sea level change relative convergence criterion (default, NaN: not applied)');
++			fielddisplay(self,'abstol','sea level change absolute convergence criterion(default, NaN: not applied)');
++			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
++			fielddisplay(self,'grdocean','does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'); 
++			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)'); 
++			fielddisplay(self,'sealevelloading','enables surface loading from sea-level change (default: 1)');
++			fielddisplay(self,'isgrd','compute GRD patterns (default: 1)');
++			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default: 1)');
++			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
++			fielddisplay(self,'selfattraction','enables surface mass load to perturb the gravity field');
++			fielddisplay(self,'elastic','enables elastic deformation from surface loading');
++			fielddisplay(self,'viscous','enables viscous deformation from surface loading');
++			fielddisplay(self,'rotation','enables polar motion to feedback on the GRD fields');
++			fielddisplay(self,'degacc','accuracy (default: .01 deg) for numerical discretization of the Green''s functions');
++			fielddisplay(self,'timeacc','time accuracy (default: 1 yr) for numerical discretization of the Green''s functions');
++			fielddisplay(self,'grdmodel','type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)');
++			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
++		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 
+@@ -134,27 +155,6 @@
+ 			end
+ 
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   solidearth settings:'));
+-
+-			fielddisplay(self,'reltol','sea level change relative convergence criterion (default, NaN: not applied)');
+-			fielddisplay(self,'abstol','sea level change absolute convergence criterion(default, NaN: not applied)');
+-			fielddisplay(self,'maxiter','maximum number of nonlinear iterations');
+-			fielddisplay(self,'grdocean','does this planet have an ocean, if set to 1: global water mass is conserved in GRD module (default: 1)'); 
+-			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area (default: No correction)'); 
+-			fielddisplay(self,'sealevelloading','enables surface loading from sea-level change (default: 1)');
+-			fielddisplay(self,'isgrd','compute GRD patterns (default: 1)');
+-			fielddisplay(self,'compute_bp_grd','compute GRD patterns for bottom pressure loads (default: 1)');
+-			fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)');
+-			fielddisplay(self,'selfattraction','enables surface mass load to perturb the gravity field');
+-			fielddisplay(self,'elastic','enables elastic deformation from surface loading');
+-			fielddisplay(self,'viscous','enables viscous deformation from surface loading');
+-			fielddisplay(self,'rotation','enables polar motion to feedback on the GRD fields');
+-			fielddisplay(self,'degacc','accuracy (default: .01 deg) for numerical discretization of the Green''s functions');
+-			fielddisplay(self,'timeacc','time accuracy (default: 1 yr) for numerical discretization of the Green''s functions');
+-			fielddisplay(self,'grdmodel','type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)');
+-			fielddisplay(self,'cross_section_shape','1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore');
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			WriteData(fid,prefix,'object',self,'fieldname','reltol','name','md.solidearth.settings.reltol','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','abstol','name','md.solidearth.settings.abstol','format','Double');
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26300)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26301)
+@@ -1,60 +1,79 @@
+-def oshostname():
+-    import socket
++def acosd(X): #{{{
++    """ function acosd - Inverse cosine in degrees
+ 
+-    return socket.gethostname()
++    Usage:
++        Y = acosd(X)
++    """
++    import numpy as np
+ 
++    return np.degrees(np.arccos(X))
++#}}}
+ 
+-def ispc():
+-    import platform
++def asind(X): #{{{
++    """ function asind - Inverse sine in degrees
+ 
+-    if 'Windows' in platform.system():
+-        return True
+-    else:
+-        return False
++    Usage:
++        Y = asind(X)
++    """
++    import numpy as np
+ 
++    return np.degrees(np.arcsin(X))
++#}}}
+ 
+-def ismac():
+-    import platform
++def atand(X): #{{{
++    """ function atand - Inverse tangent in degrees
+ 
+-    if 'Darwin' in platform.system():
+-        return True
+-    else:
+-        return False
++    Usage:
++        Y = atand(X)
++    """
++    import numpy as np
+ 
++    return np.degrees(np.arctan(X))
++#}}}
+ 
+-def strcmp(s1, s2):
+ 
+-    if s1 == s2:
+-        return True
+-    else:
+-        return False
++def atan2d(Y, X): #{{{
++    """ function atan2d - Four-quadrant inverse tangent in degrees
+ 
++    Usage:
++        D = atan2d(Y, X)
++    """
++    import numpy as np
+ 
+-def strncmp(s1, s2, n):
++    return np.degrees(np.arctan2(Y, X))
++#}}}
+ 
+-    if s1[0:n] == s2[0:n]:
+-        return True
++def det(a): #{{{
++    if a.shape == (1, ):
++        return a[0]
++    elif a.shape == (1, 1):
++        return a[0, 0]
++    elif a.shape == (2, 2):
++        return a[0, 0] * a[1, 1] - a[0, 1] * a[1, 0]
+     else:
+-        return False
++        raise TypeError("MatlabFunc.det only implemented for shape (2, 2), not for shape %s." % str(a.shape))
++#}}}
+ 
++def heaviside(x): #{{{
++    import numpy as np
+ 
+-def strcmpi(s1, s2):
++    y = np.zeros_like(x)
++    y[np.nonzero(x > 0.)] = 1.
++    y[np.nonzero(x == 0.)] = 0.5
+ 
+-    if s1.lower() == s2.lower():
+-        return True
+-    else:
+-        return False
++    return y
++#}}}
+ 
++def ismac(): #{{{
++    import platform
+ 
+-def strncmpi(s1, s2, n):
+-
+-    if s1.lower()[0:n] == s2.lower()[0:n]:
++    if 'Darwin' in platform.system():
+         return True
+     else:
+         return False
++#}}}
+ 
+-
+-def ismember(a, s):
++def ismember(a, s): #{{{
+     import numpy as np
+ 
+     if not isinstance(s, (tuple, list, dict, np.ndarray)):
+@@ -65,32 +84,33 @@
+ 
+     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 ispc(): #{{{
++    import platform
+ 
+-def det(a):
+-
+-    if a.shape == (1, ):
+-        return a[0]
+-    elif a.shape == (1, 1):
+-        return a[0, 0]
+-    elif a.shape == (2, 2):
+-        return a[0, 0] * a[1, 1] - a[0, 1] * a[1, 0]
++    if 'Windows' in platform.system():
++        return True
+     else:
+-        raise TypeError("MatlabFunc.det only implemented for shape (2, 2), not for shape %s." % str(a.shape))
++        return False
++#}}}
+ 
++def oshostname(): #{{{
++    import socket
+ 
+-def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):
++    return socket.gethostname()
++#}}}
++
++def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0): #{{{
+     import numpy as np
+ 
+     if not m:
+@@ -104,13 +124,32 @@
+         a[i - 1, j - 1] += s
+ 
+     return a
++#}}}
+ 
++def strcmp(s1, s2): #{{{
++    if s1 == s2:
++        return True
++    else:
++        return False
++#}}}
+ 
+-def heaviside(x):
+-    import numpy as np
++def strcmpi(s1, s2): #{{{
++    if s1.lower() == s2.lower():
++        return True
++    else:
++        return False
++#}}}
+ 
+-    y = np.zeros_like(x)
+-    y[np.nonzero(x > 0.)] = 1.
+-    y[np.nonzero(x == 0.)] = 0.5
++def strncmp(s1, s2, n): #{{{
++    if s1[0:n] == s2[0:n]:
++        return True
++    else:
++        return False
++#}}}
+ 
+-    return y
++def strncmpi(s1, s2, n): #{{{
++    if s1.lower()[0:n] == s2.lower()[0:n]:
++        return True
++    else:
++        return False
++#}}}
+Index: ../trunk-jpl/src/m/miscellaneous/PythonFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/PythonFuncs.py	(revision 26300)
++++ ../trunk-jpl/src/m/miscellaneous/PythonFuncs.py	(revision 26301)
+@@ -1,25 +1,22 @@
+ import numpy as np
+ 
+ 
+-def logical_and_n(*arg):
+-
++def logical_and_n(*arg): #{{{
+     if len(arg):
+         result = arg[0]
+         for item in arg[1:]:
+             result = np.logical_and(result, item)
+         return result
+-
+     else:
+         return None
++#}}}
+ 
+-
+-def logical_or_n(*arg):
+-
++def logical_or_n(*arg): #{{{
+     if len(arg):
+         result = arg[0]
+         for item in arg[1:]:
+             result = np.logical_or(result, item)
+         return result
+-
+     else:
+         return None
++#}}}
+Index: ../trunk-jpl/src/m/solve/marshall.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/marshall.m	(revision 26300)
++++ ../trunk-jpl/src/m/solve/marshall.m	(revision 26301)
+@@ -44,7 +44,7 @@
+ st=fclose(fid);
+ 
+ % Uncomment the following to make a copy of the binary input file for debugging 
+-% purposes (can be fed into scripts/ReadBin.py).
++% purposes (can be fed into scripts/BinRead.py).
+ % copyfile([md.miscellaneous.name '.bin'], [md.miscellaneous.name '.m.bin'])
+ 
+ if st==-1,
+Index: ../trunk-jpl/src/m/solve/marshall.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/marshall.py	(revision 26300)
++++ ../trunk-jpl/src/m/solve/marshall.py	(revision 26301)
+@@ -45,7 +45,7 @@
+         fid.close()
+ 
+         # Uncomment the following to make a copy of the binary input file for 
+-        # debugging purposes (can be fed into scripts/ReadBin.py).
++        # debugging purposes (can be fed into scripts/BinRead.py).
+         # copy_cmd = "cp {}.bin {}.py.bin".format(md.miscellaneous.name, md.miscellaneous.name)
+         # subprocess.call(copy_cmd, shell=True)
+ 
+Index: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 26301)
+@@ -7,16 +7,21 @@
+ 
+ 
+ class dsl(object):
+-    """DSL - slass definition
++    """DSL - class definition
+ 
+     Usage:
+-        dsl = dsl()
++        dsl = dsl() # dynamic sea level class, based on CMIP5 outputs
+     """
+ 
+-    def __init__(self): #{{{
++    def __init__(self, *args): #{{{
+         self.global_average_thermosteric_sea_level = np.nan # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
+         self.sea_surface_height_above_geoid        = np.nan # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
+         self.sea_water_pressure_at_sea_floor       = np.nan # Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
++
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            raise Exception('constructor not supported')
+     #}}}
+ 
+     def __repr__(self): #{{{
+@@ -27,27 +32,15 @@
+         return s
+     #}}}
+ 
+-    def defaultoutputs(self, md): #{{{
+-        return []
++    def setdefaultparameters(self): #{{{
++        self.global_average_thermosteric_sea_level = np.nan
++        self.sea_surface_height_above_geoid        = np.nan
++        self.sea_water_pressure_at_sea_floor       = np.nan
+     #}}}
+ 
+-    def initialize(self, md): #{{{
+-        if np.isnan(self.global_average_thermosteric_sea_level):
+-            self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
+-            print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
+-
+-        if np.isnan(self.sea_surface_height_above_geoid):
+-            self.sea_surface_height_above_geoid = np.array(np.zeros(md.mesh.numberofvertices)).reshape(-1, 1)
+-            print('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero')
+-
+-        if np.isnan(self.sea_water_pressure_at_sea_floor):
+-            self.sea_water_pressure_at_sea_floor = np.array(np.zeros(md.mesh.numberofvertices)).reshape(-1, 1)
+-            print('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero')
+-    #}}}
+-
+     def checkconsistency(self, md, solution, analyses): #{{{
+         # Early return
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+ 
+         md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1)
+@@ -60,16 +53,31 @@
+         return md
+     # }}}
+ 
++    def marshall(self, prefix, md, fid):   #{{{
++        yts = md.constants.yts
++        WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'yts', yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify DSL at vertex locations.
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify bottom pressure at vertex locations.
++    # }}}
++
+     def extrude(self, md): #{{{
+-        self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node')
+-        self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node')
++        self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1)
++        self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1)
+         return self
+     #}}}
+ 
+-    def marshall(self, prefix, md, fid):   #{{{
+-        yts = md.constants.yts
+-        WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', 1+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.
+-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) # mattype 1 because we specify DSL at vertex locations.
+-        WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts) # mattype 1 because we specify bottom pressure at vertex locations.
+-    # }}}
++
++    def initialize(self, md): #{{{
++        if np.isnan(self.global_average_thermosteric_sea_level):
++            self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
++            print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
++
++        if np.isnan(self.sea_surface_height_above_geoid):
++            self.sea_surface_height_above_geoid = np.append(np.zeros((md.mesh.numberofvertices, 1)), 0).reshape(-1, 1)
++            print('      no dsl.sea_surface_height_above_geoid specified: transient values set at zero')
++
++        if np.isnan(self.sea_water_pressure_at_sea_floor):
++            self.sea_water_pressure_at_sea_floor = np.append(np.zeros((md.mesh.numberofvertices, 1)), 0).reshape(-1, 1)
++            print('      no dsl.sea_water_pressure_at_sea_floor specified: transient values set at zero')
++    #}}}
+Index: ../trunk-jpl/src/m/classes/hydrologyshreve.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26301)
+@@ -10,8 +10,6 @@
+ 		requested_outputs  = {};
+ 	end
+ 	methods
+-		function self = extrude(self,md) % {{{
+-		end % }}}
+ 		function self = hydrologyshreve(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -22,10 +20,13 @@
+ 					error('constructor not supported');
+ 			end
+ 		end % }}}
+-		function list = defaultoutputs(self,md) % {{{
+-			list = {'Watercolumn','HydrologyWaterVx','HydrologyWaterVy'};
+-		end % }}}    
++		function disp(self) % {{{
++			disp(sprintf('   hydrologyshreve solution parameters:'));
++			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
++			fielddisplay(self,'stabilization','artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.');
++			fielddisplay(self,'requested_outputs','additional outputs requested');
+ 
++		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
+ 			%Type of stabilization to use 0:nothing 1:artificial_diffusivity
+@@ -33,7 +34,7 @@
+ 			self.requested_outputs = {'default'};
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+-			
++
+ 			%Early return
+ 			if ~ismember('HydrologyShreveAnalysis',analyses) |  (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
+ 
+@@ -40,25 +41,23 @@
+ 			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','hydrology.stabilization','>=',0);
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   hydrologyshreve solution parameters:'));
+-			fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
+-			fielddisplay(self,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.');
+-      fielddisplay(self,'requested_outputs','additional outputs requested');
+-
++		function list = defaultoutputs(self,md) % {{{
++			list = {'Watercolumn','HydrologyWaterVx','HydrologyWaterVy'};
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			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');
+-      outputs = self.requested_outputs;
+-      pos  = find(ismember(outputs,'default'));
+-      if ~isempty(pos),
+-        outputs(pos) = [];  %remove 'default' from outputs
+-        outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+-      end
+-      WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
++			outputs = self.requested_outputs;
++			pos = find(ismember(outputs,'default'));
++			if ~isempty(pos),
++				outputs(pos) = []; %remove 'default' from outputs
++				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
++			end
++			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+ 		end % }}}
++		function self = extrude(self,md) % {{{
++		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+ 			writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn);
+Index: ../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/initialization.py	(revision 26301)
+@@ -10,32 +10,33 @@
+     """INITIALIZATION class definition
+ 
+     Usage:
+-    initialization = initialization()
++        initialization = initialization()
+     """
+ 
+-    def __init__(self):  # {{{
++    def __init__(self): #{{{
+         self.vx = np.nan
+         self.vy = np.nan
+         self.vz = np.nan
+         self.vel = np.nan
+-        self.enthalpy = np.nan
+         self.pressure = np.nan
+         self.temperature = np.nan
++        self.enthalpy = np.nan
+         self.waterfraction = np.nan
+-        self.watercolumn = np.nan
+         self.sediment_head = np.nan
+         self.epl_head = np.nan
+         self.epl_thickness = np.nan
++        self.watercolumn = np.nan
+         self.hydraulic_potential = np.nan
+         self.channelarea = np.nan
+         self.sealevel = np.nan
+         self.bottompressure = np.nan
++        self.dsl = np.nan
++        self.str = np.nan
+         self.sample = np.nan
+ 
+-        #set defaults
+         self.setdefaultparameters()
+     #}}}
+-    def __repr__(self):  # {{{
++    def __repr__(self): #{{{
+         s = '   initial field values:\n'
+         s += '{}\n'.format(fielddisplay(self, 'vx', 'x component of velocity [m / yr]'))
+         s += '{}\n'.format(fielddisplay(self, 'vy', 'y component of velocity [m / yr]'))
+@@ -51,37 +52,13 @@
+         s += '{}\n'.format(fielddisplay(self, 'epl_thickness', 'thickness of the epl [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'hydraulic_potential', 'Hydraulic potential (for GlaDS) [Pa]'))
+         s += '{}\n'.format(fielddisplay(self, 'channelarea', 'subglaciale water channel area (for GlaDS) [m2]'))
+-        s += '{}\n'.format(fielddisplay(self,'sample','Realization of a Gaussian random field'))
++        s += '{}\n'.format(fielddisplay(self,'sample', 'Realization of a Gaussian random field'))
+         return s
+     #}}}
+-    def extrude(self, md):  # {{{
+-        self.vx = project3d(md, 'vector', self.vx, 'type', 'node')
+-        self.vy = project3d(md, 'vector', self.vy, 'type', 'node')
+-        self.vz = project3d(md, 'vector', self.vz, 'type', 'node')
+-        self.vel = project3d(md, 'vector', self.vel, 'type', 'node')
+-        self.temperature = project3d(md, 'vector', self.temperature, 'type', 'node')
+-        self.enthalpy = project3d(md, 'vector', self.enthalpy, 'type', 'node')
+-        self.waterfraction = project3d(md, 'vector', self.waterfraction, 'type', 'node')
+-        self.watercolumn = project3d(md, 'vector', self.watercolumn, 'type', 'node')
+-        self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1)
+-        self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1)
+-        self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
+-        self.sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node', 'layer', 1)
+-        self.bottompressure = project3d(md, 'vector', self.bottompressure, 'type', 'node', 'layer', 1)
+-
+-        #Lithostatic pressure by default
+-        if np.ndim(md.geometry.surface) == 2:
+-            print('Reshaping md.geometry.surface for your convenience but you should fix it in your model set up')
+-            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface.reshape(-1, ) - md.mesh.z)
+-        else:
+-            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.z)
+-
+-        return self
++    def setdefaultparameters(self): #{{{
++        return
+     #}}}
+-    def setdefaultparameters(self):  # {{{
+-        return self
+-    #}}}
+-    def checkconsistency(self, md, solution, analyses):  # {{{
++    def checkconsistency(self, md, solution, analyses): #{{{
+         if 'StressbalanceAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.isstressbalance:
+             if not np.any(np.logical_or(np.isnan(md.initialization.vx), np.isnan(md.initialization.vy))):
+                 md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+@@ -129,17 +106,20 @@
+                 md = checkfield(md, 'fieldname', 'initialization.channelarea', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [md.mesh.numberofelements])
+         if 'SamplingAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.issampling:
+             if np.any(np.isnan(md.initialization.sample)):
+-                md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
++                md = checkfield(md, 'fieldname', 'initialization.sample', 'NaN', 1,'Inf', 1, 'size', [md.mesh.numberofvertices])
+         return md
+-    # }}}
+-    def marshall(self, prefix, md, fid):  # {{{
++    #}}}
++    def marshall(self, prefix, md, fid): #{{{
+         yts = md.constants.yts
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
++
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'bottompressure', 'format', 'DoubleMat', 'mattype', 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'str', 'format', 'DoubleMat', 'mattype', 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'dsl', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'temperature', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'waterfraction', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_head', 'format', 'DoubleMat', 'mattype', 1)
+@@ -148,13 +128,39 @@
+         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)
+-        WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sample', 'format', 'DoubleMat', 'mattype', 1)
++
+         if md.thermal.isenthalpy:
+             if (np.size(self.enthalpy) <= 1):
++                # Reconstruct enthalpy
+                 tpmp = md.materials.meltingpoint - md.materials.beta * md.initialization.pressure
+-                pos = np.nonzero(md.initialization.waterfraction > 0.)[0]
++                pos = np.where(md.initialization.waterfraction > 0)[0]
+                 self.enthalpy = md.materials.heatcapacity * (md.initialization.temperature - md.constants.referencetemperature)
+-                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1, ) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1, )
++                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1, 1) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1, 1)
+ 
+             WriteData(fid, prefix, 'data', self.enthalpy, 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.initialization.enthalpy')
+-    # }}}
++    #}}}
++    def extrude(self, md): #{{{
++        self.vx = project3d(md, 'vector', self.vx, 'type', 'node')
++        self.vy = project3d(md, 'vector', self.vy, 'type', 'node')
++        self.vz = project3d(md, 'vector', self.vz, 'type', 'node')
++        self.vel = project3d(md, 'vector', self.vel, 'type', 'node')
++        self.temperature = project3d(md, 'vector', self.temperature, 'type', 'node')
++        self.enthalpy = project3d(md, 'vector', self.enthalpy, 'type', 'node')
++        self.waterfraction = project3d(md, 'vector', self.waterfraction, 'type', 'node')
++        self.watercolumn = project3d(md, 'vector', self.watercolumn, 'type', 'node')
++        self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1)
++        self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1)
++        self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
++        self.sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node', 'layer', 1)
++        self.bottompressure = project3d(md, 'vector', self.bottompressure, 'type', 'node', 'layer', 1)
++
++        # Lithostatic pressure by default
++        if np.ndim(md.geometry.surface) == 2:
++            print('Reshaping md.geometry.surface for your convenience but you should fix it in your model set up')
++            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface.reshape(-1, 1) - md.mesh.z)
++        else:
++            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.z)
++
++        return self
++    #}}}
+Index: ../trunk-jpl/src/m/classes/lovenumbers.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26301)
+@@ -9,8 +9,11 @@
+     """LOVENUMBERS class definition
+ 
+     Usage:
+-        lovenumbers = lovenumbers()  #will setup love numbers deg 1001 by default
+-        lovenumbers = lovenumbers('maxdeg', 10001);   #supply numbers of degrees required (here, 10001)
++        lovenumbers = lovenumbers()
++        lovenumbers = lovenumbers('maxdeg', 10000, 'referenceframe', 'CF');
++
++    Choose numbers of degrees required (1000 by default) and reference frame 
++    (between CF and CM; CM by default)
+     """
+ 
+     def __init__(self, *args):  #{{{
+@@ -25,6 +28,10 @@
+         self.tl = []
+         self.tk2secular = 0  # deg 2 secular number
+ 
++        # Time/frequency for visco-elastic love numbers
++        self.timefreq = []
++        self.istime = 1
++
+         options = pairoptions(*args)
+         maxdeg = options.getfieldvalue('maxdeg', 1000)
+         referenceframe = options.getfieldvalue('referenceframe', 'CM')
+@@ -31,6 +38,20 @@
+         self.setdefaultparameters(maxdeg, referenceframe)
+     #}}}
+ 
++    def __repr__(self):  #{{{
++        s = '   lovenumbers parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'h', 'load Love number for radial displacement'))
++        s += '{}\n'.format(fielddisplay(self, 'k', 'load Love number for gravitational potential perturbation'))
++        s += '{}\n'.format(fielddisplay(self, 'l', 'load Love number for horizontal displacements'))
++        s += '{}\n'.format(fielddisplay(self, 'th', 'tidal load Love number (deg 2)'))
++        s += '{}\n'.format(fielddisplay(self, 'tk', 'tidal load Love number (deg 2)'))
++        s += '{}\n'.format(fielddisplay(self, 'tl', 'tidal load Love number (deg 2)'))
++        s += '{}\n'.format(fielddisplay(self, 'tk2secular', 'secular fluid Love number'))
++        s += '{}\n'.format(fielddisplay(self, 'istime', 'time (default: 1) or frequency love numbers (0)'))
++        s += '{}\n'.format(fielddisplay(self, 'timefreq', 'time/frequency vector (yr or 1/yr)'))
++        return s
++    #}}}
++
+     def setdefaultparameters(self, maxdeg, referenceframe):  #{{{
+         # Initialize love numbers
+         self.h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+@@ -42,11 +63,15 @@
+ 
+         # Secular fluid love number
+         self.tk2secular = 0.942
++
++        # Time
++        self.istime = 1 # Temporal love numbers by default
++        self.timefreq = 0 # Elastic case by default
+         return self
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  #{{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.h', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.k', 'NaN', 1, 'Inf', 1)
+@@ -55,9 +80,17 @@
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.th', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk2secular', 'NaN', 1, 'Inf', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.timefreq', 'NaN', 1, 'Inf', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.istime', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
++
+         # Check that love numbers are provided at the same level of accuracy
+         if (self.h.shape[0] != self.k.shape[0]) or (self.h.shape[0] != self.l.shape[0]):
+             raise ValueError('lovenumbers error message: love numbers should be provided at the same level of accuracy')
++
++        ntf = len(self.timefreq)
++        if (self.h.shape[1] != ntf or self.k.shape[1] != ntf or self.l.shape[1] != ntf or self.th.shape[1] != ntf or self.tk.shape[1] != ntf or self.tl.shape[1] != ntf):
++            raise ValueError('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector')
++
+         return md
+     #}}}
+ 
+@@ -65,17 +98,6 @@
+         return[]
+     #}}}
+ 
+-    def __repr__(self):  #{{{
+-        s = '   lovenumbers parameters:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'h', 'load Love number for radial displacement'))
+-        s += '{}\n'.format(fielddisplay(self, 'k', 'load Love number for gravitational potential perturbation'))
+-        s += '{}\n'.format(fielddisplay(self, 'l', 'load Love number for horizontal displacements'))
+-        s += '{}\n'.format(fielddisplay(self, 'th', 'tidal load Love number (deg 2)'))
+-        s += '{}\n'.format(fielddisplay(self, 'tk', 'tidal load Love number (deg 2)'))
+-        s += '{}\n'.format(fielddisplay(self, 'tk2secular', 'secular fluid Love number'))
+-        return s
+-    #}}}
+-
+     def marshall(self, prefix, md, fid):  #{{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'h', 'name', 'md.solidearth.lovenumbers.h', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'k', 'name', 'md.solidearth.lovenumbers.k', 'format', 'DoubleMat', 'mattype', 1)
+@@ -85,6 +107,13 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'tk', 'name', 'md.solidearth.lovenumbers.tk', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'tl', 'name', 'md.solidearth.lovenumbers.tl', 'format', 'DoubleMat', 'mattype', 1)
+         WriteData(fid, prefix, 'object', self, 'data', self.tk2secular, 'fieldname', 'lovenumbers.tk2secular', 'format', 'Double')
++
++        if (self.istime):
++            scale = md.constants.yts
++        else:
++            scale = 1.0 / md.constants.yts
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'istime', 'name', 'md.solidearth.lovenumbers.istime', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'timefreq', 'name', 'md.solidearth.lovenumbers.timefreq', 'format', 'DoubleMat', 'mattype', 1, 'scale', scale);
+     #}}}
+ 
+     def extrude(self, md):  #{{{
+Index: ../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/materials.py	(revision 26301)
+@@ -24,6 +24,7 @@
+             if not(self.nature[i] == 'litho' or self.nature[i] == 'ice' or self.nature[i] == 'hydro'):
+                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+ 
++        # Start filling in the dynamic fields (not truly dynamic under Python)
+         for i in range(len(self.nature)):
+             nat = self.nature[i]
+             if nat == 'ice':
+@@ -66,7 +67,6 @@
+                 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+         self.earth_density = 0
+ 
+-        # Set default parameters
+         self.setdefaultparameters()
+     #}}}
+ 
+@@ -104,11 +104,11 @@
+                 s += '{}\n'.format(fielddisplay(self, 'ebm_alpha', 'array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)'))
+                 s += '{}\n'.format(fielddisplay(self, 'ebm_delta', 'array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)'))
+                 s += '{}\n'.format(fielddisplay(self, 'ebm_taul', 'array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]'))
+-                s += '{}\n'.format(fielddisplay(self, 'ebm_tauh', 'array describing each layer''s array describing each layer\'s end period for transient relaxation, only for Burgers rheology  (numlayers) [s]'))
++                s += '{}\n'.format(fielddisplay(self, 'ebm_tauh', 'array describing each layer''s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]'))
+ 
+                 s += '{}\n'.format(fielddisplay(self, 'rheologymodel', 'array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)'))
+                 s += '{}\n'.format(fielddisplay(self, 'density', 'array describing each layer\'s density (numlayers) [kg/m^3]'))
+-                s += '{}\n'.format(fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default 1) (numlayers)'))
++                s += '{}\n'.format(fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default: 1) (numlayers)'))
+             elif nat == 'hydro':
+                 s += 'Hydro:\n'
+                 s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+@@ -126,19 +126,19 @@
+             nat = self.nature[i]
+             if nat == 'ice':
+                 # Ice density (kg/m^3)
+-                self.rho_ice = 917.
++                self.rho_ice = 917
+ 
+                 # Ocean water density (kg/m^3)
+-                self.rho_water = 1023.
++                self.rho_water = 1023
+ 
+                 # Fresh water density (kg/m^3)
+-                self.rho_freshwater = 1000.
++                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.
++                self.heatcapacity = 2093
+ 
+                 # Ice latent heat of fusion L (J/kg)
+                 self.latentheat = 3.34 * 1e5
+@@ -159,7 +159,7 @@
+                 self.beta = 9.8 * 1e-8
+ 
+                 # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+-                self.mixed_layer_capacity = 3974.
++                self.mixed_layer_capacity = 3974
+ 
+                 # Thermal exchange velocity (ice-water interface) (m/s)
+                 self.thermal_exchange_velocity = 1.00 * 1e-4
+@@ -192,17 +192,17 @@
+                 self.ebm_taul = [np.nan, np.nan]
+                 self.ebm_tauh = [np.nan, np.nan]
+                 self.rheologymodel = [0, 0]
+-                self.density = [5.51e3, 5.50e3]  # (Pa) # Mantle and lithosphere density [kg/m^3]
+-                self.issolid = [1, 1]  # Is layer solid or liquid?
++                self.density = [5.51e3, 5.50e3] # (Pa) # Mantle and lithosphere density [kg/m^3]
++                self.issolid = [1, 1] # Is layer solid or liquid?
+             elif nat == 'hydro':
+                 # Ice density (kg/m^3)
+-                self.rho_ice = 917.
++                self.rho_ice = 917
+ 
+                 # Ocean water density (kg/m^3)
+-                self.rho_water = 1023.
++                self.rho_water = 1023
+ 
+                 # Fresh water density (kg/m^3)
+-                self.rho_freshwater = 1000.
++                self.rho_freshwater = 1000
+             else:
+                 raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+ 
+@@ -250,7 +250,7 @@
+                     raise RuntimeError('First layer must be solid (issolid[0] > 0 AND lame_mu[0] > 0). Add a weak inner core if necessary.')
+                 ind = np.where(md.materials.issolid == 0)[0]
+                 if np.sum(np.in1d(np.diff(ind),1) >= 1): # If there are at least two consecutive indices that contain issolid = 0
+-                    raise RuntimeError('Fluid layers detected at layers #{} but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'.format(i))
++                    raise RuntimeError('Fluid layers detected at layers #' + indices + ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.')
+ 
+             elif nat == 'hydro':
+                 md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+@@ -266,7 +266,7 @@
+     def marshall(self, prefix, md, fid): #{{{
+         #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+         WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(self.nature), 'format', 'IntMat', 'mattype', 3)
+-        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer') #DANGER, this can evolve if you have classes
++        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer') #DANGER: this can evolve if you have classes
+         for i in range(len(self.nature)):
+             nat = self.nature[i]
+             if nat == 'ice':
+@@ -306,6 +306,7 @@
+                 for i in range(self.numlayers):
+                     earth_density = earth_density + (pow(self.radius[i + 1], 3) - pow(self.radius[i], 3)) * self.density[i]
+                 earth_density = earth_density / pow(self.radius[self.numlayers], 3)
++                print(earth_density)
+                 self.earth_density = earth_density
+             elif nat == 'hydro':
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 26300)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 26301)
+@@ -44,6 +44,24 @@
+ 					error('solidearth constructor error message: zero or one argument only!'); 
+ 			end
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   solidearth inputs, forcings and settings:'));
++
++			fielddisplay(self,'planetradius','planet radius [m]');
++			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
++			fielddisplay(self,'requested_outputs','additional outputs requested');
++			fielddisplay(self,'partitionice','ice partition vector for barystatic contribution');
++			fielddisplay(self,'partitionhydro','hydro partition vector for barystatic contribution');
++			fielddisplay(self,'partitionocean','ocean partition vector for barystatic contribution');
++			if isempty(self.external), fielddisplay(self,'external','external solution, of the type solidearthsolution'); end
++			self.settings.disp();
++			self.lovenumbers.disp();
++			self.rotational.disp();
++			if ~isempty(self.external),
++				self.external.disp();
++			end
++
++		end % }}}
+ 		function self = setdefaultparameters(self,planet) % {{{
+ 
+ 			%output default:
+@@ -86,24 +104,6 @@
+ 		function list=defaultoutputs(self,md) % {{{
+ 			list = {'Sealevel'};
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   solidearth inputs, forcings and settings:'));
+-
+-			fielddisplay(self,'planetradius','planet radius [m]');
+-			fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
+-			fielddisplay(self,'requested_outputs','additional outputs requested');
+-			fielddisplay(self,'partitionice','ice partition vector for barystatic contribution');
+-			fielddisplay(self,'partitionhydro','hydro partition vector for barystatic contribution');
+-			fielddisplay(self,'partitionocean','ocean partition vector for barystatic contribution');
+-			if isempty(self.external), fielddisplay(self,'external','external solution, of the type solidearthsolution'); end
+-			self.settings.disp();
+-			self.lovenumbers.disp();
+-			self.rotational.disp();
+-			if ~isempty(self.external),
+-				self.external.disp();
+-			end
+-
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			WriteData(fid,prefix,'object',self,'fieldname','planetradius','format','Double');
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26300)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26301)
+@@ -120,9 +120,9 @@
+             if md.mesh.__class__.__name__ is 'mesh3dsurface':
+                 if self.grdmodel == 2:
+                     raise RuntimeException('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)')
+-                else:
+-                    if self.grdmodel == 1:
+-                        raise RuntimeException('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)')
++            else:
++                if self.grdmodel == 1:
++                    raise RuntimeException('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)')
+             if self.sealevelloading and not self.grdocean:
+                 raise RuntimeException('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set')
+ 
+@@ -133,24 +133,24 @@
+     #}}}
+ 
+     def marshall(self, prefix, md, fid): #{{{
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname','isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale',md.constants.yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer');
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer');
+     #}}}
+ 
+     def extrude(self, md): #{{{
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26301)
+@@ -0,0 +1,80 @@
++import numpy as np
++
++from checkfield import checkfield
++from fielddisplay import fielddisplay
++from WriteData import WriteData
++
++
++class solidearthsolution(object):
++    """SOLIDEARTHSOLUTION class definition
++
++    Usage:
++        solidearthsolution = solidearthsolution()
++    """
++
++    def __init__(self, *args): #{{{
++        self.displacementeast = None
++        self.displacementnorth = None
++        self.displacementup = None
++        self.geoid = None
++
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            raise RuntimeError('constructor not supported')
++    #}}}
++
++    def __repr__(self): #{{{
++        s = '         units for time series is (yr)\n'
++        s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
++        s += '{}\n'.format(fielddisplay(self, 'displacementnorth', 'solid-Earth Northwards bedrock displacement time series (m)'))
++        s += '{}\n'.format(fielddisplay(self, 'displacementup', 'solid-Earth bedrock uplift time series (m)'))
++        s += '{}\n'.format(fielddisplay(self, 'geoid', 'solid-Earth geoid time series (m)'))
++
++        return s
++    #}}}
++
++    def setdefaultparameters(self): #{{{
++        self.displacementeast = []
++        self.displacementnorth = []
++        self.displacementup = []
++        self.geoid = []
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses): #{{{
++        md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1)
++    #}}}
++
++    def marshall(self, prefix, md, fid): #{{{
++        yts = md.constants.yts
++
++        # Transform our time series into time series rates
++        if np.shape(self.displacementeast, 1) == 1:
++            print('External solidearthsolution warning: only one time step provided, assuming the values are rates per year')
++            displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
++            displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
++            displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
++            geoid_rate = np.append(np.array(self.geoid).reshape(-1, 1), 0)
++        else:
++            time = self.displacementeast[-1, :]
++            dt = np.diff(time, 1, 1)
++            displacementeast_rate = np.diff(self.displacementeast[0:-2, :], 1, 1) / dt
++            displacementeast_rate.append(time[0:-2])
++            displacementnorth_rate = np.diff(self.displacementnorth[0:-2, :], 1, 1) / dt
++            displacementnorth_rate.append(time[0:-2])
++            displacementup_rate = np.diff(self.displacementup[0:-2, :], 1, 1) / dt
++            displacementup_rate.append(time[0:-2])
++            geoid_rate = np.diff(self.geoid[0:-2, :], 1, 1) / dt
++            geoid_rate.append(time[0:-2])
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'geoid', 'data', geoid_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++    #}}}
++
++    def extrude(self, md): #{{{
++        return self
++    #}}}
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26300)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26301)
+@@ -14,6 +14,7 @@
+ %solidearth loading:  {{{
+ md.masstransport.spcthickness=[md.geometry.thickness;0];
+ md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
++
+ %antarctica
+ xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+@@ -25,6 +26,7 @@
+ pos=find(late < -80);
+ md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+ posant=pos;
++
+ %greenland
+ pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+ md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+@@ -95,6 +97,7 @@
+ md=solve(md,'Transient');
+ Seustatic=md.results.TransientSolution.Sealevel;
+ Beustatic=md.results.TransientSolution.Bed;
++pause
+ 
+ %eustatic + selfattraction run:
+ md.solidearth.settings.selfattraction=1;
+Index: ../trunk-jpl/test/NightlyRun/test2002.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.py	(revision 26300)
++++ ../trunk-jpl/test/NightlyRun/test2002.py	(revision 26301)
+@@ -1,6 +1,8 @@
+ #Test Name: EarthSlc
+ import numpy as np
+ 
++from MatlabFuncs import *
++
+ from gmshplanet import *
+ from gmtmask import *
+ from lovenumbers import *
+@@ -11,98 +13,137 @@
+ from solve import *
+ 
+ 
+-#mesh earth:
++# Mesh earth
++#
++# NOTE: In MATLAB, we currently use cached mesh to account for differences in 
++# mesh generated under Linux versus under macOS
++#
+ md = model()
+-md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
++md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
+ 
+-#parameterize solidearth solution:
+-#solidearth loading:
+-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
+-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, 1))
+-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
+-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
++# Geometry for the bed, arbitrary thickness of 100
++md.geometry.bed = np.zeros((md.mesh.numberofvertices, 1))
++md.geometry.base = md.geometry.bed
++md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, 1))
++md.geometry.surface = md.geometry.bed + md.geometry.thickness
+ 
+-#antarctica
+-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
+-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
++# Solidearth loading #{{{
++md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
++md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, 1))
++
++# Antarctica
++xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
++ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
++ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
++re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
++
++late = asind(ze / re)
++longe = atan2d(ye, xe)
+ pos = np.where(late < -80)[0]
+-md.solidearth.surfaceload.icethicknesschange[pos] = -100
+-#greenland
+-pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
+-md.solidearth.surfaceload.icethicknesschange[pos] = -100
++md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100
++posant = pos
+ 
+-#elastic loading from love numbers:
+-md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
++# Greenland
++pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
++md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100
++posgre = pos
++
++# Elastic loading from love numbers:
++md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
+ #}}}
+ 
+-#mask:  {{{
++# Mask: {{{
+ mask = gmtmask(md.mesh.lat, md.mesh.long)
+-icemask = np.ones((md.mesh.numberofvertices, 1))
++oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
+ pos = np.where(mask == 0)[0]
+-icemask[pos] = -1
+-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
+-icemask[md.mesh.elements[pos, :] - 1] = -1
+-md.mask.ice_levelset = icemask
+-md.mask.ocean_levelset = -icemask
++oceanmask[pos] = 1
+ 
+-#make sure that the elements that have loads are fully grounded
+-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
+-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
++icemask = np.ones((md.mesh.numberofvertices, 1))
++icemask[md.mesh.elements[posant]] = -1
++icemask[md.mesh.elements[posgre]] = -1
+ 
+-#make sure wherever there is an ice load, that the mask is set to ice:
+-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # TODO: Do we need to do this twice?
+-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
+-# }}}
++md.mask.ice_levelset = icemask
++md.mask.ocean_levelset = oceanmask
++#}}}
+ 
+-md.solidearth.settings.ocean_area_scaling = 0
++# Time stepping {{{
++md.timestepping.start_time = 0
++md.timestepping.time_step = 1
++md.timestepping.final_time = 1
++#}}}
+ 
+-#geometry for the bed, arbitrary
+-md.geometry.bed = -np.ones((md.mesh.numberofvertices, 1))
++# Masstransport
++md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, 1))
++md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, 1))
++md.initialization.vx = np.zeros((md.mesh.numberofvertices, 1))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices, 1))
++md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, 1))
++md.initialization.str = 0
+ 
+-#materials
+-md.materials=materials('hydro')
++# Materials
++md.materials = materials('hydro')
+ 
+-#Miscellaneous
++# Miscellaneous
+ md.miscellaneous.name = 'test2002'
+ 
+-#Solution parameters
++# Solution parameters
++md.cluster.np = 3
+ md.solidearth.settings.reltol = np.nan
+ md.solidearth.settings.abstol = 1e-3
+-md.solidearth.settings.computesealevelchange = 1
++md.solidearth.settings.sealevelloading = 1
++md.solidearth.settings.isgrd = 1
++md.solidearth.settings.ocean_area_scaling = 0
++md.solidearth.settings.grdmodel = 1
+ 
+-#max number of iterations reverted back to 10 (i.e., the original default value)
++# Physics
++md.transient.issmb = 0
++md.transient.isstressbalance = 0
++md.transient.isthermal = 0
++md.transient.ismasstransport = 1
++md.transient.isslc = 1
++md.solidearth.requested_outputs = ['Sealevel', 'Bed']
++
++# Max number of iterations reverted back to 10 (i.e., the original default value)
+ md.solidearth.settings.maxiter = 10
+ 
+-#eustatic run:
+-md.solidearth.settings.rigid = 0
++# Eustatic run
++md.solidearth.settings.selfattraction = 0
+ md.solidearth.settings.elastic = 0
+ md.solidearth.settings.rotation = 0
+-md = solve(md, 'Sealevelrise')
+-Seustatic = md.results.SealevelriseSolution.Sealevel
++md.solidearth.settings.viscous = 0
+ 
+-#eustatic + rigid run:
+-md.solidearth.settings.rigid = 1
++md = solve(md, 'Transient')
++Seustatic = md.results.TransientSolution.Sealevel
++Beustatic = md.results.TransientSolution.Bed
++
++# Eustatic + selfattraction run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 0
+ md.solidearth.settings.rotation = 0
+-md = solve(md, 'Sealevelrise')
+-Srigid = md.results.SealevelriseSolution.Sealevel
++md.solidearth.settings.viscous = 0
++md = solve(md, 'tr')
++Sselfattraction = md.results.TransientSolution.Sealevel
++Bselfattraction = md.results.TransientSolution.Bed
+ 
+-#eustatic + rigid + elastic run:
+-md.solidearth.settings.rigid = 1
++# Eustatic + selfattraction + elastic run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 0
+-md = solve(md, 'Sealevelrise')
+-Selastic = md.results.SealevelriseSolution.Sealevel
++md.solidearth.settings.viscous = 0
++md = solve(md, 'tr')
++Selastic = md.results.TransientSolution.Sealevel
++Belastic = md.results.TransientSolution.Bed
+ 
+-#eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid = 1
++# Eustatic + selfattraction + elastic + rotation run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
+-md = solve(md, 'Sealevelrise')
+-Srotation = md.results.SealevelriseSolution.Sealevel
++md.solidearth.settings.viscous = 0
++md = solve(md, 'tr')
++Srotation = md.results.TransientSolution.Sealevel
++Brotation = md.results.TransientSolution.Bed
+ 
+-#Fields and tolerances to track changes
+-field_names = ['Eustatic', 'Rigid', 'Elastic', 'Rotation']
+-field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+-field_values = [Seustatic, Srigid, Selastic, Srotation]
++# Fields and tolerances to track changes
++field_names = ['Seustatic', 'Sselfattraction', 'Selastic', 'Srotation', 'Beustatic', 'Bselfattraction', 'Belastic', 'Brotation']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [Seustatic, Sselfattraction, Selastic, Srotation, Beustatic, Bselfattraction, Belastic, Brotation]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26301-26302.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26301-26302.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26301-26302.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.py	(revision 26301)
++++ ../trunk-jpl/src/m/classes/initialization.py	(revision 26302)
+@@ -136,7 +136,7 @@
+                 tpmp = md.materials.meltingpoint - md.materials.beta * md.initialization.pressure
+                 pos = np.where(md.initialization.waterfraction > 0)[0]
+                 self.enthalpy = md.materials.heatcapacity * (md.initialization.temperature - md.constants.referencetemperature)
+-                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1, 1) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1, 1)
++                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1,) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1,)
+ 
+             WriteData(fid, prefix, 'data', self.enthalpy, 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.initialization.enthalpy')
+     #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26302-26303.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26302-26303.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26302-26303.diff	(revision 26740)
@@ -0,0 +1,428 @@
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26302)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26303)
+@@ -97,7 +97,6 @@
+ md=solve(md,'Transient');
+ Seustatic=md.results.TransientSolution.Sealevel;
+ Beustatic=md.results.TransientSolution.Bed;
+-pause
+ 
+ %eustatic + selfattraction run:
+ md.solidearth.settings.selfattraction=1;
+Index: ../trunk-jpl/test/NightlyRun/test2002.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.py	(revision 26302)
++++ ../trunk-jpl/test/NightlyRun/test2002.py	(revision 26303)
+@@ -22,9 +22,9 @@
+ md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
+ 
+ # Geometry for the bed, arbitrary thickness of 100
+-md.geometry.bed = np.zeros((md.mesh.numberofvertices, 1))
++md.geometry.bed = np.zeros((md.mesh.numberofvertices, ))
+ md.geometry.base = md.geometry.bed
+-md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, 1))
++md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
+ md.geometry.surface = md.geometry.bed + md.geometry.thickness
+ 
+ # Solidearth loading #{{{
+@@ -54,11 +54,11 @@
+ 
+ # Mask: {{{
+ mask = gmtmask(md.mesh.lat, md.mesh.long)
+-oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
++oceanmask = -1 * np.ones((md.mesh.numberofvertices, ))
+ pos = np.where(mask == 0)[0]
+ oceanmask[pos] = 1
+ 
+-icemask = np.ones((md.mesh.numberofvertices, 1))
++icemask = np.ones((md.mesh.numberofvertices, ))
+ icemask[md.mesh.elements[posant]] = -1
+ icemask[md.mesh.elements[posgre]] = -1
+ 
+@@ -73,11 +73,11 @@
+ #}}}
+ 
+ # Masstransport
+-md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, 1))
+-md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, 1))
+-md.initialization.vx = np.zeros((md.mesh.numberofvertices, 1))
+-md.initialization.vy = np.zeros((md.mesh.numberofvertices, 1))
+-md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, 1))
++md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+ md.initialization.str = 0
+ 
+ # Materials
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26302)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26303)
+@@ -11,13 +11,11 @@
+ md.geometry.thickness=1000*ones(md.mesh.numberofvertices,1);
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+-
+ %parameterize slc solution:
+ %solidearth loading:  {{{
+ md.masstransport.spcthickness=[md.geometry.thickness;0];
+ md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 
+-
+ xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+@@ -43,7 +41,7 @@
+ pos=find(mask==0); oceanmask(pos)=1;
+ md.mask.ocean_levelset=oceanmask;
+ 
+-% use model representation of ocen area (not the true area)
++% use model representation of ocean area (not the true area)
+ md.solidearth.settings.ocean_area_scaling = 0;
+ 
+ %materials
+Index: ../trunk-jpl/test/NightlyRun/test2003.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.py	(revision 26302)
++++ ../trunk-jpl/test/NightlyRun/test2003.py	(revision 26303)
+@@ -11,91 +11,116 @@
+ from solve import *
+ 
+ 
+-#mesh earth:
++# Mesh earth
++#
++# NOTE: In MATLAB, we currently use cached mesh to account for differences in 
++# mesh generated under Linux versus under macOS
++#
+ md = model()
+-md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 1000.)  #1000 km resolution mesh
++md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
+ 
+-#parameterize solidearth solution:
++# Geometry for the bed, arbitrary thickness of 100
++md.geometry.bed = -1 * np.ones(md.mesh.numberofvertices)
++md.geometry.base = md.geometry.bed
++md.geometry.thickness = 1000 * np.ones(md.mesh.numberofvertices)
++md.geometry.surface = md.geometry.bed + md.geometry.thickness
++
++# Parameterize slc solution:
+ #solidearth loading:  {{{
+-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, ))
+-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, ))
+-md.dsl.global_average_thermosteric_sea_level_change=np.zeros((2, ))
+-md.dsl.sea_surface_height_change_above_geoid=np.zeros((md.mesh.numberofvertices+1, ))
+-md.dsl.sea_water_pressure_change_at_sea_floor=np.zeros((md.mesh.numberofvertices+1, ))
++md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
++md.smb.mass_balance = np.zeros(md.mesh.numberofvertices)
+ 
+-#antarctica
+-#Access every element in lat using the indices in elements
+-# - 1 to convert to base 0 indexing, 1 (not 2, in matlab) to sum over rows
+-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1)/ 3
+-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1)/ 3
+-pos = np.intersect1d(np.array(np.where(late < -75)[0]), np.array(np.where(longe < 0)[0]))
+-md.solidearth.surfaceload.icethicknesschange[pos] = -1
++xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
++ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
++ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
++re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
+ 
+-#elastic loading from love numbers:
+-md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
++late = asind(ze / re)
++longe = atan2d(ye, xe)
++# Greenland
++pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
++md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 1000
++posice = pos
++
++# Elastic loading from love numbers
++md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
+ #}}}
+ 
+-#mask:  {{{
++# Mask: {{{
+ mask = gmtmask(md.mesh.lat, md.mesh.long)
+ icemask = np.ones(md.mesh.numberofvertices)
++icemask[md.mesh.elements[posice]] = -1
++md.mask.ice_levelset = icemask
++oceanmask = -1 * np.ones(md.mesh.numberofvertices)
+ pos = np.where(mask == 0)[0]
+-icemask[pos] = -1
+-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
+-icemask[md.mesh.elements[pos, :] - 1] = -1
+-md.mask.ice_levelset = icemask
+-md.mask.ocean_levelset = -icemask
++oceanmask[pos] = 1
++md.mask.ocean_levelset = oceanmask
+ 
+-#make sure that the elements that have loads are fully grounded
+-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
+-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
+-
+-#make sure wherever there is an ice load, that the mask is set to ice:
+-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # Do we need to do this twice?
+-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
+-# }}}
+-
+-# use model representation of ocen area (not the true area)
++# Use model representation of ocean area (not the true area)
+ md.solidearth.settings.ocean_area_scaling = 0
+ 
+-#geometry
+-di = md.materials.rho_ice / md.materials.rho_water
+-md.geometry.thickness = np.ones(md.mesh.numberofvertices)
+-md.geometry.surface = (1 - di) * np.zeros(md.mesh.numberofvertices)
+-md.geometry.base = md.geometry.surface - md.geometry.thickness
+-md.geometry.bed = md.geometry.base
++# Materials
++md.initialization.temperature = 273.25 * np.ones(md.mesh.numberofvertices)
++md.initialization.sealevel = np.zeros(md.mesh.numberofvertices)
++md.initialization.str = 0
+ 
+-#materials
+-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
+-md.materials.rheology_B = paterson(md.initialization.temperature)
+-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
++md.basalforcings.groundedice_melting_rate = np.zeros(md.mesh.numberofvertices)
++md.basalforcings.floatingice_melting_rate = np.zeros(md.mesh.numberofvertices)
++md.initialization.vx = np.zeros(md.mesh.numberofvertices)
++md.initialization.vy = np.zeros(md.mesh.numberofvertices)
+ 
+-#Miscellaneous
++# Miscellaneous
+ md.miscellaneous.name = 'test2003'
+ 
+-#Solution parameters
++# Solution parameters
+ md.solidearth.settings.reltol = np.nan
+ md.solidearth.settings.abstol = 1e-3
+-md.solidearth.settings.computesealevelchange = 1
++md.solidearth.settings.sealevelloading = 0
++md.solidearth.settings.grdocean = 0
++md.solidearth.settings.isgrd = 1
++md.solidearth.settings.ocean_area_scaling = 0
++md.solidearth.settings.grdmodel = 1
++md.solidearth.settings.horiz = 1
++md.solidearth.requested_outputs = ['Sealevel', 'Bed', 'BedEast', 'BedNorth']
+ 
+-#eustatic + rigid + elastic run:
+-md.solidearth.settings.rigid = 1
++# Physics
++md.transient.issmb = 0
++md.transient.isstressbalance = 0
++md.transient.isthermal = 0
++md.transient.ismasstransport = 1
++md.transient.isslc = 1
++
++md.timestepping.start_time = 0
++md.timestepping.time_step = 1
++md.timestepping.final_time = 1
++
++# Eustatic + selfattraction + elastic run:
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 0
++md.solidearth.settings.viscous = 0
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ #md.verbose = verbose('111111111')
+-md = solve(md, 'Sealevelrise')
+-SnoRotation = md.results.SealevelriseSolution.Sealevel
++md = solve(md, 'Transient')
++SnoRotation = md.results.TransientSolution.Sealevel
++BUnoRotation = md.results.TransientSolution.Bed
++BEnoRotation = md.results.TransientSolution.BedEast
++BNnoRotation = md.results.TransientSolution.BedNorth
+ 
+-#eustatic + rigid + elastic + rotation run:
+-md.solidearth.settings.rigid = 1
++# Eustatic + selfattraction + elastic + rotation run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
++md.solidearth.settings.viscous = 0
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ #md.verbose = verbose('111111111')
+-md = solve(md, 'Sealevelrise')
+-SRotation = md.results.SealevelriseSolution.Sealevel
++md = solve(md, 'Transient')
++SRotation = md.results.TransientSolution.Sealevel
++BURotation = md.results.TransientSolution.Bed
++BERotation = md.results.TransientSolution.BedEast
++BNRotation = md.results.TransientSolution.BedNorth
+ 
+-#Fields and tolerances to track changes
+-field_names = ['noRotation', 'Rotation']
+-field_tolerances = [1e-13, 1e-13]
+-field_values = [SnoRotation, SRotation]
++# Fields and tolerances to track changes
++field_names = ['Sealevel', 'Uplift', 'NorthDisplacement', 'EastDisplacement']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [SRotation - SnoRotation, BURotation - BUnoRotation, BNRotation - BNnoRotation,BERotation - BEnoRotation]
+Index: ../trunk-jpl/src/m/classes/timestepping.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.m	(revision 26302)
++++ ../trunk-jpl/src/m/classes/timestepping.m	(revision 26303)
+@@ -23,6 +23,18 @@
+ 					error('constructor not supported');
+ 			end
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   timestepping parameters:'));
++
++			unit = 'yr';
++			fielddisplay(self,'start_time',['simulation starting time [' unit ']']);
++			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
++			fielddisplay(self,'time_step',['length of time steps [' unit ']']);
++			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values? (0 or 1)');
++			fielddisplay(self,'cycle_forcing','cycle through forcing? (0 or 1)');
++			fielddisplay(self,'coupling_time',['length of coupling time step with ocean model [' unit ']']);
++
++		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
+ 			%time between 2 time steps
+@@ -50,18 +62,6 @@
+ 				md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 			end
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   timestepping parameters:'));
+-
+-			unit = 'yr';
+-			fielddisplay(self,'start_time',['simulation starting time [' unit ']']);
+-			fielddisplay(self,'final_time',['final time to stop the simulation [' unit ']']);
+-			fielddisplay(self,'time_step',['length of time steps [' unit ']']);
+-			fielddisplay(self,'interp_forcing','interpolate in time between requested forcing values ? (0 or 1)');
+-			fielddisplay(self,'cycle_forcing','cycle through forcing ? (0 or 1)');
+-			fielddisplay(self,'coupling_time',['length of coupling time step with ocean model  [' unit ']']);
+-
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			scale = md.constants.yts;
+Index: ../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.py	(revision 26302)
++++ ../trunk-jpl/src/m/classes/timestepping.py	(revision 26303)
+@@ -4,43 +4,46 @@
+ 
+ 
+ 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.
++    def __init__(self, *args): #{{{
++        self.start_time = 0
++        self.final_time = 0
++        self.time_step = 0
+         self.interp_forcing = 1
+         self.cycle_forcing = 0
+-        self.coupling_time = 0.
++        self.coupling_time = 0
+ 
+-    #set defaults
+-        self.setdefaultparameters()
+-
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            raise RuntimeError('constructor not supported')
+     #}}}
+ 
+-    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_forcing", "interpolate in time between requested forcing values ? (0 or 1)"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "cycle_forcing", "cycle through forcing ? (0 or 1)"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "length of coupling time steps with ocean model [yr]"))
+-        return string
++    def __repr__(self): #{{{
++        s = '   timestepping parameters:\n'
++        unit = 'yr'
++        s += '{}\n'.format(fielddisplay(self, 'start_time', 'simulation starting time [' + unit + ']'))
++        s += '{}\n'.format(fielddisplay(self, 'final_time', 'final time to stop the simulation [' + unit + ']'))
++        s += '{}\n'.format(fielddisplay(self, 'time_step', 'length of time steps [' + unit + ']'))
++        s += '{}\n'.format(fielddisplay(self, 'interp_forcing', 'interpolate in time between requested forcing values? (0 or 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'cycle_forcing', 'cycle through forcing? (0 or 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'coupling_time', 'length of coupling time steps with ocean model [' + unit + ']'))
++        return s
+     #}}}
+ 
+-    def setdefaultparameters(self):  # {{{
+-        #time between 2 time steps
+-        self.time_step = 1. / 2.
+-        #final time
+-        self.final_time = 10. * self.time_step
+-        #should we interpolate forcing between timesteps?
++    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 forcing between timesteps?
+         self.interp_forcing = 1
+         self.cycle_forcing = 0
+ 
+@@ -47,28 +50,27 @@
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses):  # {{{
+-
++    def checkconsistency(self, md, solution, analyses): #{{{
+         md = checkfield(md, 'fieldname', 'timestepping.start_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'timestepping.final_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+-        if self.final_time - self.start_time < 0:
+-            md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
+-            md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+-        md = checkfield(md, 'fieldname', 'timestepping.interp_forcing', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'timestepping.cycle_forcing', 'numel', [1], 'values', [0, 1])
++        if (self.final_time - self.start_time) < 0:
++            md.checkmessage('timestepping.final_time should be larger than timestepping.start_time')
++        if solution == 'TransientSolution':
++            md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>', 0, 'NaN', 1, 'Inf', 1)
++            md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+ 
+         return md
+-    # }}}
++    #}}}
+ 
+-    def marshall(self, prefix, md, fid):  # {{{
+-
+-        yts = md.constants.yts
++    def marshall(self, prefix, md, fid): #{{{
++        scale = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.timestepping.type', 'data', 1, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'start_time', 'format', 'Double', 'scale', yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'final_time', 'format', 'Double', 'scale', yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'time_step', 'format', 'Double', 'scale', yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'start_time', 'format', 'Double', 'scale', scale)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'final_time', 'format', 'Double', 'scale', scale)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'time_step', 'format', 'Double', 'scale', scale)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'interp_forcing', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'cycle_forcing', 'format', 'Boolean')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
+-    # }}}
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', scale)
++    #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26303-26304.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26303-26304.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26303-26304.diff	(revision 26740)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/src/m/classes/timestepping.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.js	(revision 26303)
++++ ../trunk-jpl/src/m/classes/timestepping.js	(revision 26304)
+@@ -46,7 +46,6 @@
+ 		}
+ 		if (solution=='TransientSolution'){
+ 			checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1);
+-			checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 		}
+ 	} // }}}
+ 	this.marshall=function(md,prefix,fid) { //{{{
+Index: ../trunk-jpl/src/m/classes/timestepping.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.m	(revision 26303)
++++ ../trunk-jpl/src/m/classes/timestepping.m	(revision 26304)
+@@ -59,7 +59,6 @@
+ 			end 
+ 			if strcmp(solution,'TransientSolution'),
+ 				md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>',0,'NaN',1,'Inf',1);
+-				md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1);
+ 			end
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+Index: ../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.py	(revision 26303)
++++ ../trunk-jpl/src/m/classes/timestepping.py	(revision 26304)
+@@ -23,7 +23,6 @@
+         else:
+             raise RuntimeError('constructor not supported')
+     #}}}
+-
+     def __repr__(self): #{{{
+         s = '   timestepping parameters:\n'
+         unit = 'yr'
+@@ -35,7 +34,6 @@
+         s += '{}\n'.format(fielddisplay(self, 'coupling_time', 'length of coupling time steps with ocean model [' + unit + ']'))
+         return s
+     #}}}
+-
+     def setdefaultparameters(self): #{{{
+         # Time between 2 time steps
+         self.time_step = 1 / 2
+@@ -49,7 +47,6 @@
+ 
+         return self
+     #}}}
+-
+     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)
+@@ -59,11 +56,9 @@
+             md.checkmessage('timestepping.final_time should be larger than timestepping.start_time')
+         if solution == 'TransientSolution':
+             md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>', 0, 'NaN', 1, 'Inf', 1)
+-            md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+ 
+         return md
+     #}}}
+-
+     def marshall(self, prefix, md, fid): #{{{
+         scale = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.timestepping.type', 'data', 1, 'format', 'Integer')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26304-26305.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26304-26305.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26304-26305.diff	(revision 26740)
@@ -0,0 +1,1087 @@
+Index: ../trunk-jpl/src/m/classes/trans.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/trans.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/trans.js	(nonexistent)
+@@ -1,132 +0,0 @@
+-//TRANS class definition
+-//
+-//   Usage:
+-//      trans =new trans();
+-
+-function trans (){
+-	//methods
+-	this.setdefaultparameters = function(){// {{{
+-
+-		//full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+-		this.issmb             = 1;
+-		this.ismasstransport   = 1;
+-		this.isstressbalance   = 1;
+-		this.isthermal         = 0;
+-		this.isgroundingline   = 0;
+-		this.isgia             = 0;
+-		this.isesa             = 0;
+-		this.isdamageevolution = 0;
+-		this.ismovingfront     = 0;
+-		this.ishydrology       = 0;
+-		this.isslr             = 0;
+-		this.isoceancoupling   = 0;
+-		this.iscoupler         = 0;
+-		this.amr_frequency     = 0;
+-
+-		//default output
+-		this.requested_outputs=['default'];
+-
+-	}// }}}
+-	this.disp= function(){// {{{
+-
+-		console.log(sprintf('   transient solution parameters:'));
+-
+-		fielddisplay(this,'issmb','indicates whether a surface mass balance solution is used in the transient');
+-		fielddisplay(this,'ismasstransport','indicates whether a masstransport solution is used in the transient');
+-		fielddisplay(this,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
+-		fielddisplay(this,'isthermal','indicates whether a thermal solution is used in the transient');
+-		fielddisplay(this,'isgroundingline','indicates whether a groundingline migration is used in the transient');
+-		fielddisplay(this,'isgia','indicates whether a postglacial rebound model is used in the transient');
+-		fielddisplay(this,'isesa','indicates whether an elastic adjustment model is used in the transient');
+-		fielddisplay(this,'isdamageevolution','indicates whether damage evolution is used in the transient');
+-		fielddisplay(this,'ismovingfront','indicates whether a moving front capability is used in the transient');
+-		fielddisplay(this,'ishydrology','indicates whether an hydrology model is used');
+-		fielddisplay(this,'isslr','indicates whether a sea-level rise model is used');
+-		fielddisplay(this,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
+-		fielddisplay(this,'iscoupler','indicates whether different models are being run with need for coupling');
+-		fielddisplay(this,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
+-		fielddisplay(this,'requested_outputs','list of additional outputs requested');
+-
+-
+-	}// }}}
+-	this.classname= function(){// {{{
+-		return "transient";
+-	}// }}}
+-		this.checkconsistency = function(md,solution,analyses) { // {{{
+-
+-			//Early return
+-			if (solution!='TransientSolution') return;
+-
+-			checkfield(md,'fieldname','trans.issmb','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.ismasstransport','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isstressbalance','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isthermal','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isgroundingline','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isgia','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isesa','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isdamageevolution','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.ismovingfront','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.ishydrology','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isslr','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.isoceancoupling','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.iscoupler','numel',[1],'values',[0, 1]);
+-			checkfield(md,'fieldname','trans.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
+-			checkfield(md,'fieldname','trans.requested_outputs','stringrow',1);
+-		} // }}}
+-		this.marshall=function(md,prefix,fid) { //{{{
+-
+-			prefix='md.transient';
+-			WriteData(fid,prefix,'object',this,'fieldname','issmb','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','ismasstransport','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isoceantransport','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isstressbalance','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isthermal','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isgroundingline','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isesa','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isdamageevolution','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','ishydrology','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','ismovingfront','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','issampling','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isslc','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','isoceancoupling','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','amr_frequency','format','Integer');
+-
+-			//process requested outputs
+-			var outputs = this.requested_outputs;
+-			for (var i=0;i<outputs.length;i++){
+-				if (outputs[i] == 'default') {
+-					outputs.splice(i,1);
+-					var newoutputs=this.defaultoutputs(md);
+-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
+-				}
+-			}			
+-			WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray');
+-		}//}}}
+-		this.defaultoutputs = function(md) { //{{{
+-			if(this.issmb)return ['SmbMassBalance'];
+-			else return [];
+-		}//}}}
+-		this.fix=function() { //{{{
+-		}//}}}
+-	//properties 
+-	// {{{
+-
+-	this.issmb             = 0;
+-	this.ismasstransport   = 0;
+-	this.isstressbalance   = 0;
+-	this.isthermal         = 0;
+-	this.isgroundingline   = 0;
+-	this.isgia             = 0;
+-	this.isesa             = 0;
+-	this.isdamageevolution = 0;
+-	this.ismovingfront     = 0;
+-	this.ishydrology       = 0;
+-	this.isslr             = 0;
+-	this.isoceancoupling   = 0;
+-	this.iscoupler         = 0;
+-	this.amr_frequency	   = 0;
+-	this.requested_outputs = [];
+-
+-	this.setdefaultparameters();
+-	//}}}
+-}
+Index: ../trunk-jpl/src/m/classes/flowequation.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/flowequation.js	(revision 26305)
+@@ -141,7 +141,7 @@
+ 	this.isHO                           = 0;
+ 	this.isFS                           = 0;
+ 	this.isNitscheBC                    = 0;
+-	this.FSNitscheGamma                 = 0;
++	this.FSNitscheGamma                 = 1e6;
+ 	this.fe_SSA                         = '';
+ 	this.fe_HO                          = '';
+ 	this.fe_FS                          = '';
+Index: ../trunk-jpl/src/m/classes/fourierlove.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/fourierlove.js	(revision 26305)
+@@ -17,7 +17,7 @@
+ 			// work on matlab script for computing g0 for given Earth's structure. 
+ 			this.g0=9.81; // m/s^2; 
+ 			this.r0=6371*1e3; //m;
+-			this.mu0=10^11; // Pa
++			this.mu0=1e11; // Pa
+ 			this.Gravitational_Constant=6.67259e-11; // m^3 kg^-1 s^-2
+ 			this.allow_layer_deletion=1;
+ 			this.underflow_tol=1e-16; //threshold of deep to surface love number ratio to trigger the deletion of layer 
+@@ -85,7 +85,7 @@
+ 		console.log('md.fourierlove check consistency only paritally implemented for litho material');
+ 		/*
+ 		if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho'))
+-			error('Need a ''litho'' material to run a Fourier Love number analysis');
++			error('Need a "litho" material to run a Fourier Love number analysis');
+ 		end
+ 
+ 		mat=find(strcmpi(md.materials.nature,'litho'));
+Index: ../trunk-jpl/src/m/classes/friction.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/friction.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/friction.js	(revision 26305)
+@@ -66,7 +66,7 @@
+ 
+ 			WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer');
+ 			let mattype,tsl;
+-			if ((size(this.coefficient,1)==md.mesh.numberofvertices | size(this.coefficient,1)==md.mesh.numberofvertices+1)) {
++			if ((size(this.coefficient,0)==md.mesh.numberofvertices | size(this.coefficient,1)==md.mesh.numberofvertices+1)) {
+ 				mattype=1;
+ 				tsl = md.mesh.numberofvertices;
+ 			} else {
+@@ -80,6 +80,7 @@
+ 			WriteData(fid,prefix,'object',this,'class','friction','fieldname','effective_pressure_limit','format','Double');
+ 			switch (this.coupling) {
+ 				case 0:
++					break;
+ 				case 1:
+ 					WriteData(fid,prefix,'class','friction','object',this,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 					break;
+Index: ../trunk-jpl/src/m/classes/frontalforcings.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcings.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/frontalforcings.js	(revision 26305)
+@@ -0,0 +1,41 @@
++//FRONTAL FORCINGS Class definition
++//
++//   Usage:
++//      frontalforcings=frontalforcings();
++
++function frontalforcings(){
++	//methods
++    this.classname = function(){ // {{{
++        return "frontalforcings";
++    } // }}}
++    this.extrude = function(md) {//{{{
++		this.meltingrate=project3d(md,'vector',this.meltingrate,'type','node');
++        return this;
++    }//}}}
++	this.setdefaultparameters = function(){// {{{
++		this.meltingrate   = NaN;
++	} // }}}
++    this.checkconsistency = function(md,solution,analyses) { //{{{
++		//Early return
++		if (!solution=='TransientSolution' || md.transient.ismovingfront == 0) return;
++
++		md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
++
++    } // }}}
++	this.disp = function(){ // {{{
++		console.log(sprintf('   Frontalforcings parameters:'));
++		fielddisplay(this,'meltingrate','melting rate at given location [m/a]');
++	} // }}}
++    this.marshall=function(md,prefix,fid) { //{{{
++		let yts=md.constants.yts;
++		WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer');
++		WriteData(fid,prefix,'object',this,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
++    }//}}}
++    this.fix=function() { //{{{
++    }//}}}
++	//properties 
++    // {{{
++	this.meltingrate   = NaN;
++	this.setdefaultparameters();
++    // }}}
++}
+Index: ../trunk-jpl/src/m/classes/geometry.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/geometry.js	(revision 26305)
+@@ -47,7 +47,7 @@
+ 			}
+ 		} // }}}
+ 		this.marshall=function(md,prefix,fid) { //{{{
+-			let length_thickness=size(this.thickness,1);
++			let length_thickness=size(this.thickness,0);
+ 			if (length_thickness==md.mesh.numberofvertices || length_thickness==md.mesh.numberofvertices+1) {
+ 				WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			} else if (length_thickness==md.mesh.numberofelements || length_thickness==md.mesh.numberofelements+1) {
+Index: ../trunk-jpl/src/m/classes/groundingline.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/groundingline.js	(revision 26305)
+@@ -46,8 +46,8 @@
+ 		} // }}}
+ 		this.marshall=function(md,prefix,fid) { //{{{
+ 			WriteData(fid,prefix,'data',this.migration,'name','md.groundingline.migration','format','String');
+-			WriteData(fid,prefix,'data',this.migration,'name','md.groundingline.friction_interpolation','format','String');
+-			WriteData(fid,prefix,'data',this.migration,'name','md.groundingline.melt_interpolation','format','String');
++			WriteData(fid,prefix,'data',this.friction_interpolation,'name','md.groundingline.friction_interpolation','format','String');
++			WriteData(fid,prefix,'data',this.melt_interpolation,'name','md.groundingline.melt_interpolation','format','String');
+ 		}//}}}
+ 		this.fix=function() { //{{{
+ 		}//}}}
+Index: ../trunk-jpl/src/m/classes/levelset.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/levelset.js	(revision 26305)
+@@ -7,8 +7,8 @@
+ 	//methods
+ 	this.setdefaultparameters = function(){// {{{
+ 
+-		//stabilization = 2 by default
+-		this.stabilization		= 2;
++		//stabilization = 1 by default
++		this.stabilization		= 1;
+ 		this.reinit_frequency	= 5;
+ 		this.kill_icebergs      = 1;
+ 		this.migration_max      = 1e12; //No need for general cases, unless specified
+Index: ../trunk-jpl/src/m/classes/mesh3dsurface.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/mesh3dsurface.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/mesh3dsurface.js	(revision 26305)
+@@ -86,12 +86,13 @@
+ 			WriteData(fid,prefix,'object',this,'fieldname','lat','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','long','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','r','format','DoubleMat','mattype',1);
++			//WriteData(fid,prefix,'object',this,'fieldname','z','format','DoubleMat','mattype',1);
+ 			WriteData(fid,prefix,'object',this,'fieldname','elements','format','DoubleMat','mattype',2);
+ 			WriteData(fid,prefix,'object',this,'fieldname','numberofelements','format','Integer');
+ 			WriteData(fid,prefix,'object',this,'fieldname','numberofvertices','format','Integer');
+ 			WriteData(fid,prefix,'object',this,'fieldname','average_vertex_connectivity','format','Integer');
+ 			WriteData(fid,prefix,'object',this,'fieldname','vertexonboundary','format','DoubleMat','mattype',1);
+-			WriteData(fid,prefix,'object',this,'fieldname','segments','format','DoubleMat','mattype',3);
++			//WriteData(fid,prefix,'object',this,'fieldname','segments','format','DoubleMat','mattype',3);
+ 		}//}}}
+ 		this.fix=function() { //{{{
+ 			//Transform objects into Float64Arrays:
+Index: ../trunk-jpl/src/m/classes/sampling.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/sampling.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/sampling.js	(revision 26305)
+@@ -0,0 +1,99 @@
++//SAMPLING class definition
++//
++//   Usage:
++//      sampling=new sampling();
++
++function sampling (){
++	//methods
++	this.defaultoutputs = function(){// {{{
++       	return [];
++	}// }}}
++	this.setdefaultparameters = function(){// {{{
++
++		//Scaling coefficient
++		this.tau=1;  
++
++		//Apply Robin boundary conditions
++		this.robin=0;   
++		
++		//Temporal correlation factor
++		this.phi=0;  
++		
++		//Exponent in fraction SPDE (default=2, biLaplacian covariance
++		//operator)
++		this.alpha=2; // Default 
++		
++		//Seed for pseudorandom number generator (default -1 for random seed)
++		this.seed=-1;
++		
++		//default output
++		this.requested_outputs=['default'];
++	}// }}}
++	this.disp= function(){// {{{
++		console.log(sprintf('   Sampling parameters:'));
++
++		console.log(sprintf('\n      %s','Parameters of PDE operator (kappa^2 I-Laplacian)^(alpha/2)(tau):'));
++		fielddisplay(this,'kappa','coefficient of the identity operator');
++		fielddisplay(this,'tau','scaling coefficient of the solution (default 1.0)');
++		fielddisplay(this,'alpha','exponent in PDE operator, (default 2.0, BiLaplacian covariance operator)');
++	  
++		console.log(sprintf('\n      %s','Parameters of Robin boundary conditions nabla () \cdot normvec + beta ():'));
++		fielddisplay(this,'robin','Apply Robin boundary conditions (1 if applied and 0 for homogenous Neumann boundary conditions) (default 0)');
++		fielddisplay(this,'beta','Coefficient in Robin boundary conditions (to be defined for robin = 1)');          
++		
++		console.log(sprintf('\n      %s','Parameters for first-order autoregressive process (X_t = phi X_{t-1} + noise) (if transient):'));
++		fielddisplay(this,'phi','Temporal correlation factor (|phi|<1 for stationary process, phi = 1 for random walk process) (default 0)');
++		
++		console.log(sprintf('\n      %s','Other parameters of stochastic sampler:'));
++		fielddisplay(this,'seed','Seed for pseudorandom number generator (given seed if >=0 and random seed if <0) (default -1)');
++		fielddisplay(this,'requested_outputs','additional outputs requested (not implemented yet)');
++	}// }}}
++	this.classname= function(){// {{{
++		return "sampling";
++	}// }}}
++	this.checkconsistency = function(md,solution,analyses) { //{{{
++		if (!ismember('SamplingAnalysis',analyses)) return;
++		
++		checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
++		checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0,1]);
++		if (md.sampling.robin) {
++			checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1],'>',0);
++		}
++		checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0);
++		checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0);
++		checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1);
++		checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1);
++	} // }}}
++	this.marshall=function(md,prefix,fid) { //{{{
++		WriteData(fid,prefix,'object',this,'fieldname','kappa','format','DoubleMat','mattype',1);
++		WriteData(fid,prefix,'object',this,'fieldname','tau','format','Double');
++		WriteData(fid,prefix,'object',this,'fieldname','beta','format','DoubleMat','mattype',1);
++		WriteData(fid,prefix,'object',this,'fieldname','phi','format','Double');
++		WriteData(fid,prefix,'object',this,'fieldname','alpha','format','Integer');
++		WriteData(fid,prefix,'object',this,'fieldname','robin','format','Boolean');
++		WriteData(fid,prefix,'object',this,'fieldname','seed','format','Integer');
++		
++		//process requested outputs
++		outputs = this.requested_outputs;
++		pos = find(ismember(outputs,'default'));
++		if (!isempty(pos)) {
++			ArrayIndex(outputs,pos,[]);                         //remove 'default' from outputs
++			outputs = ArrayConcat(outputs, this.defaultoutputs()); //add defaults
++		}
++		WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray');
++	}//}}}
++	//properties 
++	// {{{
++    this.kappa          	= NaN;
++	this.tau            	= 0;
++	this.beta           	= NaN;
++    this.phi            	= 0;
++    this.alpha          	= 0;
++    this.robin          	= 0;
++    this.seed           	= 0;
++	this.requested_outputs  = [];
++
++	this.setdefaultparameters();
++	//}}}
++}
+Index: ../trunk-jpl/src/m/classes/transient.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/transient.js	(revision 26305)
+@@ -0,0 +1,132 @@
++//TRANSIENT class definition
++//
++//   Usage:
++//      transient =new transient();
++
++function transient (){
++	//methods
++	this.setdefaultparameters = function(){// {{{
++
++		//full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
++		this.issmb             = 1;
++		this.ismasstransport   = 1;
++		this.isstressbalance   = 1;
++		this.isthermal         = 0;
++		this.isgroundingline   = 0;
++		this.isgia             = 0;
++		this.isesa             = 0;
++		this.isdamageevolution = 0;
++		this.ismovingfront     = 0;
++		this.ishydrology       = 0;
++		this.isslr             = 0;
++		this.isoceancoupling   = 0;
++		this.iscoupler         = 0;
++		this.amr_frequency     = 0;
++
++		//default output
++		this.requested_outputs=['default'];
++
++	}// }}}
++	this.disp= function(){// {{{
++
++		console.log(sprintf('   transient solution parameters:'));
++
++		fielddisplay(this,'issmb','indicates whether a surface mass balance solution is used in the transient');
++		fielddisplay(this,'ismasstransport','indicates whether a masstransport solution is used in the transient');
++		fielddisplay(this,'isstressbalance','indicates whether a stressbalance solution is used in the transient');
++		fielddisplay(this,'isthermal','indicates whether a thermal solution is used in the transient');
++		fielddisplay(this,'isgroundingline','indicates whether a groundingline migration is used in the transient');
++		fielddisplay(this,'isgia','indicates whether a postglacial rebound model is used in the transient');
++		fielddisplay(this,'isesa','indicates whether an elastic adjustment model is used in the transient');
++		fielddisplay(this,'isdamageevolution','indicates whether damage evolution is used in the transient');
++		fielddisplay(this,'ismovingfront','indicates whether a moving front capability is used in the transient');
++		fielddisplay(this,'ishydrology','indicates whether an hydrology model is used');
++		fielddisplay(this,'isslr','indicates whether a sea-level rise model is used');
++		fielddisplay(this,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient');
++		fielddisplay(this,'iscoupler','indicates whether different models are being run with need for coupling');
++		fielddisplay(this,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps');
++		fielddisplay(this,'requested_outputs','list of additional outputs requested');
++
++
++	}// }}}
++	this.classname= function(){// {{{
++		return "transient";
++	}// }}}
++		this.checkconsistency = function(md,solution,analyses) { // {{{
++
++			//Early return
++			if (solution!='TransientSolution') return;
++
++			checkfield(md,'fieldname','transient.issmb','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.ismasstransport','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isstressbalance','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isthermal','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isslr','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0, 1]);
++			checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1);
++			checkfield(md,'fieldname','transient.requested_outputs','stringrow',1);
++		} // }}}
++		this.marshall=function(md,prefix,fid) { //{{{
++
++			prefix='md.transient';
++			WriteData(fid,prefix,'object',this,'fieldname','issmb','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','ismasstransport','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isoceantransport','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isstressbalance','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isthermal','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isgroundingline','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isesa','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isdamageevolution','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','ishydrology','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','ismovingfront','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','issampling','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isslc','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','isoceancoupling','format','Boolean');
++			WriteData(fid,prefix,'object',this,'fieldname','amr_frequency','format','Integer');
++
++			//process requested outputs
++			var outputs = this.requested_outputs;
++			for (var i=0;i<outputs.length;i++){
++				if (outputs[i] == 'default') {
++					outputs.splice(i,1);
++					var newoutputs=this.defaultoutputs(md);
++					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
++				}
++			}			
++			WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray');
++		}//}}}
++		this.defaultoutputs = function(md) { //{{{
++			if(this.issmb)return ['SmbMassBalance'];
++			else return [];
++		}//}}}
++		this.fix=function() { //{{{
++		}//}}}
++	//properties 
++	// {{{
++
++	this.issmb             = 0;
++	this.ismasstransport   = 0;
++	this.isstressbalance   = 0;
++	this.isthermal         = 0;
++	this.isgroundingline   = 0;
++	this.isgia             = 0;
++	this.isesa             = 0;
++	this.isdamageevolution = 0;
++	this.ismovingfront     = 0;
++	this.ishydrology       = 0;
++	this.isslr             = 0;
++	this.isoceancoupling   = 0;
++	this.iscoupler         = 0;
++	this.amr_frequency	   = 0;
++	this.requested_outputs = [];
++
++	this.setdefaultparameters();
++	//}}}
++}
+Index: ../trunk-jpl/src/m/classes/verbose.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/verbose.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/verbose.js	(revision 26305)
+@@ -24,6 +24,11 @@
+ function verbose (){
+ 	//methods
+ 	this.setdefaultparameters = function(){// {{{
++		//switch(nargin),
++			//case 0,
++		this.verbose.solution=true;
++		this.verbose.qmu=true;
++		this.verbose.control=true;
+ 	}// }}}
+ 	this.disp= function(){// {{{
+ 		//BEGINDISP
+@@ -66,7 +71,6 @@
+ 		}//}}}
+ 	//properties 
+ 	// {{{
+-	//BEGINFIELDS
+ 	this.mprocessor=false;
+ 	this.module=false;
+ 	this.solution=false;
+@@ -76,8 +80,7 @@
+ 	this.qmu=false;
+ 	this.autodiff=false;
+ 	this.smb=false;
+-	//ENDFIELDS
++
++	this.setdefaultparameters();
+ 	// }}}
+-	this.setdefaultparameters();
+-	//}}}
+ }
+Index: ../trunk-jpl/src/m/solve/WriteData.js
+===================================================================
+--- ../trunk-jpl/src/m/solve/WriteData.js	(revision 26304)
++++ ../trunk-jpl/src/m/solve/WriteData.js	(revision 26305)
+@@ -132,15 +132,21 @@
+ 	} // }}}
+ 	else if (format == 'BooleanMat'){ // {{{
+ 
+-		//Get size
+-		var s=[data.length,1];
+-		if(IsArray(data[0]))s[1]=data[0].length;
++		//Get size (TODO: use into matlab.js::size)
++		var s=[data.length,1]; //vector
++		if (IsArray(data[0])) { //matrix
++			s[1]=data[0].length;
++        } else if (typeof data == 'number') { //scalar
++        	s[0]=1; s[1]=1
++        } else if (data.length == 0) { //empty matrix/vector
++            s[1]=0;
++        }
+ 
+ 		//if matrix = NaN, then do not write anything
+-		if (s[0]==1 & s[1]==1 & isNaN(data)){
++		if (s[0]==1 && s[1]==1 && isNaN(data)){
+ 			s[0]=0; s[1]=0;
+ 		}
+-		if (s[0]==1 & s[1]==1 & isNaN(data[0])){
++		if (typeof data != 'number' && s[0]==1 && s[1]==1 && isNaN(data[0])){
+ 			s[0]=0; s[1]=0;
+ 		}
+ 
+@@ -158,15 +164,21 @@
+ 	} // }}}
+ 	else if (format == 'IntMat'){ // {{{
+ 
+-		//Get size
+-		var s=[data.length,1];
+-		if(IsArray(data[0]))s[1]=data[0].length;
++		//Get size (TODO: use into matlab.js::size)
++		var s=[data.length,1]; //vector
++		if (IsArray(data[0])) { //matrix
++			s[1]=data[0].length;
++        } else if (typeof data == 'number') { //scalar
++        	s[0]=1; s[1]=1
++        } else if (data.length == 0) { //empty matrix/vector
++            s[1]=0;
++        }
+ 
+ 		//if matrix = NaN, then do not write anything
+-		if (s[0]==1 & s[1]==1 & isNaN(data)){
++		if (s[0]==1 && s[1]==1 && isNaN(data)){
+ 			s[0]=0; s[1]=0;
+ 		}
+-		if (s[0]==1 & s[1]==1 & isNaN(data[0])){
++		if (typeof data != 'number' && s[0]==1 && s[1]==1 && isNaN(data[0])){
+ 			s[0]=0; s[1]=0;
+ 		}
+ 
+@@ -185,16 +197,21 @@
+ 	} // }}}
+ 	else if (format == 'DoubleMat'){ // {{{
+ 
+-		//Get size
+-		var s=[data.length,1];
+-		if(IsArray(data[0]))s[1]=data[0].length;
+-		if(typeof data == 'number'){s[0]=1; s[1]=1}
+-
++		//Get size (TODO: use into matlab.js::size)
++		var s=[data.length,1]; //vector
++		if (IsArray(data[0])) { //matrix
++			s[1]=data[0].length;
++        } else if (typeof data == 'number') { //scalar
++        	s[0]=1; s[1]=1
++        } else if (data.length == 0) { //empty matrix/vector
++            s[1]=0;
++        }
++        
+ 		//if matrix = NaN, then do not write anything
+-		if (s[0]==1 & s[1]==1 & isNaN(data)){
++		if (s[0]==1 && s[1]==1 && isNaN(data)){
+ 			s[0]=0; s[1]=0;
+ 		}
+-		if (s[0]==1 & s[1]==1 & isNaN(data[0])){
++		if (typeof data != 'number' && s[0]==1 && s[1]==1 && isNaN(data[0])){
+ 			s[0]=0; s[1]=0;
+ 		}
+ 
+@@ -251,7 +268,7 @@
+ 
+ 		//first get length of string array: 
+ 		num=data.length;
+-		if ((typeof data[0] == 'numeric') & num==1 & isNaN(data[0])){
++		if ((typeof data[0] == 'number') & num==1 & isNaN(data[0])){
+ 			num = 0;
+ 		}
+ 
+Index: ../trunk-jpl/src/m/classes/materials.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/materials.js	(revision 26305)
+@@ -0,0 +1,389 @@
++//MATERIALS class definition
++//
++//	Usage:
++//		materials=materials();
++
++class materials {
++	//methods
++	constructor() {//{{{
++		this.nature = [];
++
++		let nargs = arguments.length;
++		if (nargs == 0) {
++			this.nature=['ice'];
++		} else {
++			this.nature=arguments;
++		}
++
++		//check this is acceptable:
++		for (let i=0; i < length(this.nature); i++){
++			if (!(strcmpi(this.nature[i],'litho') || strcmpi(this.nature[i],'ice') || strcmpi(this.nature[i],'hydro'))) {
++				error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
++			}
++		}
++
++		//start filling in the dynamic fields:
++		for (let i=0; i < length(this.nature); i++) {
++			let nat=this.nature[i];
++			switch (nat) {
++				case 'ice':
++					this.rho_ice = 0;
++					this.rho_water = 0;
++					this.rho_freshwater = 0;
++					this.mu_water = 0;
++					this.heatcapacity = 0;
++					this.latentheat = 0;
++					this.thermalconductivity = 0;
++					this.temperateiceconductivity = 0;
++					this.effectiveconductivity_averaging = 0;
++					this.meltingpoint = 0;
++					this.beta = 0;
++					this.mixed_layer_capacity = 0;
++					this.thermal_exchange_velocity = 0;
++					this.rheology_B = 0;
++					this.rheology_n = 0;
++					this.rheology_law = 0;
++					break;
++				case 'litho':
++					this.numlayers = 0;
++					this.radius = 0;
++					this.viscosity = 0;
++					this.lame_lambda = 0;
++					this.lame_mu = 0;
++					this.burgers_viscosity = 0;
++					this.burgers_mu = 0;
++					this.ebm_alpha = 0;
++					this.ebm_delta = 0;
++					this.ebm_taul = 0;
++					this.ebm_tauh = 0;
++					this.rheologymodel = 0;
++					this.density = 0;
++					this.issolid = 0;
++					break;
++				case 'hydro':
++					this.rho_ice = 0;
++					this.rho_water = 0;
++					this.rho_freshwater = 0;
++					break;
++				default:	
++					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
++			}
++		}
++	} //}}}
++	setdefaultparameters() {//{{{
++		for (let i=0; i < length(this.nature); i++) {
++			let nat=this.nature[i];
++			switch (nat) {
++				case 'ice':
++					//ice density (kg/m^3)
++					this.rho_ice=917.;
++
++					//ocean water density (kg/m^3)
++					this.rho_water=1023.;
++
++					//fresh water density (kg/m^3)
++					this.rho_freshwater=1000.;
++
++					//water viscosity (N.s/m^2)
++					this.mu_water=0.001787;
++
++					//ice heat capacity cp (J/kg/K)
++					this.heatcapacity=2093.;
++
++					//ice latent heat of fusion L (J/kg)
++					this.latentheat=3.34*1e5;
++
++					//ice thermal conductivity (W/m/K)
++					this.thermalconductivity=2.4;
++
++					//wet ice thermal conductivity (W/m/K)
++					this.temperateiceconductivity=.24;
++
++					//computation of effective conductivity
++					this.effectiveconductivity_averaging=1;
++
++					//the melting point of ice at 1 atmosphere of pressure in K
++					this.meltingpoint=273.15;
++
++					//rate of change of melting point with pressure (K/Pa)
++					this.beta=9.8*1e-8;
++
++					//mixed layer (ice-water interface) heat capacity (J/kg/K)
++					this.mixed_layer_capacity=3974.;
++
++					//thermal exchange velocity (ice-water interface) (m/s)
++					this.thermal_exchange_velocity=1.00*1e-4;
++
++					//Rheology law: what is the temperature dependence of B with T
++					//available: none, paterson and arrhenius
++					this.rheology_law='Paterson';
++
++					//Rheology fields default: 
++					this.rheology_B   = 1 * 1e8;
++					this.rheology_n   = 3;
++                    break;
++
++				case 'litho':
++					//we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
++					this.numlayers=2;
++
++					//center of the earth (approximation, must not be 0), then the lab (lithosphere/asthenosphere boundary) then the surface
++					//(with 1d3 to avoid numerical singularities)
++					this.radius=[1e3,6278*1e3,6378*1e3];
++
++					this.viscosity=[1e21,1e40]; //mantle and lithosphere viscosity (respectively) [Pa.s]
++					this.lame_mu=[1.45*1e11,6.7*1e10];  // (Pa) //lithosphere and mantle shear modulus (respectively) [Pa]
++					this.lame_lambda=this.lame_mu;  // (Pa) //mantle and lithosphere lamba parameter (respectively) [Pa]
++					this.burgers_viscosity=[NaN,NaN];
++					this.burgers_mu=[NaN,NaN];
++
++					this.ebm_alpha=[NaN,NaN];
++					this.ebm_delta=[NaN,NaN];
++					this.ebm_taul=[NaN,NaN];
++					this.ebm_tauh=[NaN,NaN];
++					this.rheologymodel=[0,0];
++					this.density=[5.51*1e3,5.50*1e3];  // (Pa) //mantle and lithosphere density [kg/m^3]
++					this.issolid=[1,1]; // is layer solid or liquid.
++                    break;
++
++				case 'hydro':
++					//ice density (kg/m^3)
++					this.rho_ice=917.;
++
++					//ocean water density (kg/m^3)
++					this.rho_water=1023.;
++					
++					//fresh water density (kg/m^3)
++					this.rho_freshwater=1000.;
++                    break;
++
++				default:
++					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
++			}
++
++			// average density of the Earth (kg/m^3)
++			this.earth_density=5512;
++
++		}
++	} //}}}
++	disp() {//{{{
++		console.log(sprintf('   Materials:'));
++
++		for (let i=0; i < length(this.nature); i++) {
++			let nat=this.nature[i];
++			switch (nat) {
++				case 'ice':
++					console.log(sprintf('   \nIce:'));
++					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
++					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
++					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
++					fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
++					fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
++					fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
++					fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
++					fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
++					fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
++					fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
++					fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
++					fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
++					fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
++					fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
++					fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: "None", "BuddJacka", Cuffey", "CuffeyTemperate", "Paterson", "Arrhenius", "LliboutryDuval", "NyeCO2", or "NyeH2O"');
++				    break;
++				case 'litho':
++					console.log(sprintf('   \nLitho:'));
++					fielddisplay(this,'numlayers','number of layers (default: 2)');
++					fielddisplay(this,'radius','array describing the radius for each interface (numlayers+1) [m]');
++					fielddisplay(this,'viscosity','array describing each layer\'s viscosity (numlayers) [Pa.s]');
++					fielddisplay(this,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
++					fielddisplay(this,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
++					fielddisplay(this,'burgers_viscosity','array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
++					fielddisplay(this,'burgers_mu','array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
++
++					fielddisplay(this,'ebm_alpha','array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
++					fielddisplay(this,'ebm_delta','array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
++					fielddisplay(this,'ebm_taul','array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
++					fielddisplay(this,'ebm_tauh','array describing each layer\'s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
++
++
++					fielddisplay(this,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
++					fielddisplay(this,'density','array describing each layer\'s density (numlayers) [kg/m^3]');
++					fielddisplay(this,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
++				    break;
++				case 'hydro':
++					console.log(sprintf('   \nHydro:'));
++					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
++					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
++					fielddisplay(this,'earth_density','mantle density [kg/m^3]');
++					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
++                    break;
++				default:	
++					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
++			}	
++		}
++
++	} // }}}
++	extrude() {//{{{
++		for (let i=0; i < length(this.nature); i++) {
++			let nat=this.nature[i];
++			switch (nat) {
++				case 'ice':
++					this.rheology_B=project3d(md,'vector',this.rheology_B,'type','node');
++					this.rheology_n=project3d(md,'vector',this.rheology_n,'type','element');
++			        break;
++			}
++		}
++		return this;
++	}//}}}
++	checkconsistency(md,solution,analyses) { // {{{
++
++		for (let i=0; i < length(this.nature); i++) {
++			let nat=this.nature[i];
++			switch (nat) {
++				case 'ice':
++					checkfield(md,'fieldname','materials.rho_ice','>',0);
++					checkfield(md,'fieldname','materials.rho_water','>',0);
++					checkfield(md,'fieldname','materials.rho_freshwater','>',0);
++					checkfield(md,'fieldname','materials.mu_water','>',0);
++					checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
++					checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements, 1]);
++					checkfield(md,'fieldname','materials.rheology_law','values',['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O']);
++				    break;
++				case 'litho':
++					if (!ismember('LoveAnalysis',analyses)) return; end
++					checkfield(md,'fieldname','materials.numlayers','NaN',1,'Inf',1,'>',0,'numel',1);
++					checkfield(md,'fieldname','materials.radius','NaN',1,'Inf',1,'size',[md.materials.numlayers+1, 1],'>',0);
++					checkfield(md,'fieldname','materials.lame_mu','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.lame_lambda','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.issolid','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0,'<',2);
++					checkfield(md,'fieldname','materials.density','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>',0);
++					checkfield(md,'fieldname','materials.viscosity','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.rheologymodel','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0,'<=',2);
++					checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.ebm_alpha','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.ebm_delta','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.ebm_taul','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++					checkfield(md,'fieldname','materials.ebm_tauh','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
++
++					for (let i=0; i < md.materials.numlayers; i++) {
++						if (md.materials.rheologymodel[i]==1 && (isNaN(md.materials.burgers_viscosity[i] || isNaN(md.materials.burgers_mu[i])))) {
++							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
++						}
++						if (md.materials.rheologymodel[i]==2 && (isNaN(md.materials.ebm_alpha[i]) || isNaN(md.materials.ebm_delta[i]) || isNaN(md.materials.ebm_taul[i]) || isNaN(md.materials.ebm_tauh[i]))) {
++							error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
++						}
++					}
++					if (md.materials.issolid[0]==0 || md.materials.lame_mu[0]==0) {
++						error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
++					}
++					ind=find(ArrayEqual(md.materials.issolid,0)); //ind=find(md.materials.issolid==0);
++					console.log('materials consistency warning: not checking for fluid layers (not implemented)');
++					//if sum(ismember(diff(ind),1)>=1) %if there are at least two consecutive indices that contain issolid = 0
++					//	error(['Fluid layers detected at layers #', num2str(ind'), ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'])
++					//}
++                    break;
++				case 'hydro':
++					checkfield(md,'fieldname','materials.rho_ice','>',0);
++					checkfield(md,'fieldname','materials.rho_water','>',0);
++					checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
++					checkfield(md,'fieldname','materials.rho_freshwater','>',0);
++                    break;
++				default:	
++					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
++			}
++		}
++
++	} // }}}
++	marshall(md,prefix,fid) { //{{{
++		//1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
++		WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(this.nature),'format','IntMat','mattype',3);
++		WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); //DANGER: this can evolve if you have classes.
++		for (let i=0; i < length(this.nature); i++) {
++			let nat=this.nature[i];
++			switch (nat) {
++				case 'ice':
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
++					WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
++				    break;
++				case 'litho':
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','numlayers','format','Integer');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','radius','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','lame_mu','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','lame_lambda','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','issolid','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','density','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','viscosity','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheologymodel','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_alpha','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_delta','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_taul','format','DoubleMat','mattype',3);
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_tauh','format','DoubleMat','mattype',3);
++					//compute earth density compatible with our layer density distribution: 
++					let earth_density=0;
++					for (let i=0; i < this.numlayers; i++){
++						earth_density=earth_density + (this.radius[i+1]**3-this.radius[i]**3)*this.density[i];
++					}
++					earth_density=earth_density/this.radius(this.numlayers+1)**3;
++					console.log(earth_density);
++					this.earth_density=earth_density;
++				    break;
++				case 'hydro':
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
++					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
++				    break;
++				default:	
++					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
++			}
++		}
++		WriteData(fid,prefix,'data',this.earth_density,'name','md.materials.earth_density','format','Double');
++	}//}}}
++}
++function naturetointeger(strnat) {// {{{
++	let intnat=zeros(length(strnat),1);
++	for (let i=0; i < length(strnat); i++){
++		switch (strnat[i]) {
++			case 'damageice':
++				intnat[i]=1;
++				break;
++			case 'estar':
++				intnat[i]=2;
++				break;
++			case 'ice':
++				intnat[i]=3;
++				break;
++			case 'enhancedice':
++				intnat[i]=4;
++				break;
++			//case 'materials': //this case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
++			//	intnat[i]=5;
++			//  break;
++			case 'litho':
++				intnat[i]=6;
++				break;
++			case 'hydro':
++				intnat[i]=7;
++				break;
++			default:
++				error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
++		}
++	}
++	return intnat;
++}// }}}
+Index: ../trunk-jpl/src/m/classes/model.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.js	(revision 26304)
++++ ../trunk-jpl/src/m/classes/model.js	(revision 26305)
+@@ -85,6 +85,7 @@
+ 			this.levelset         = new levelset();
+ 			this.calving          = new calving();
+ 			this.gia              = new giaivins();
++			this.frontforcings    = new frontforcings();
+ 			this.love             = new fourierlove();
+ 			this.esa              = new esa();
+ 			this.autodiff         = new autodiff();
+@@ -758,6 +759,7 @@
+ 		this.trans            = 0;
+ 		this.levelset         = 0;
+ 		this.calving          = 0;
++		this.frontforcings	  = 0;
+ 		this.love             = 0;
+ 		this.gia              = 0;
+ 		this.esa              = 0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26305-26306.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26305-26306.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26305-26306.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/classes/materials.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.js	(revision 26305)
++++ ../trunk-jpl/src/m/classes/materials.js	(revision 26306)
+@@ -69,6 +69,10 @@
+ 					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+ 			}
+ 		}
++		this.earth_density = 0;
++
++		//set default parameters:
++		this.setdefaultparameters();
+ 	} //}}}
+ 	setdefaultparameters() {//{{{
+ 		for (let i=0; i < length(this.nature); i++) {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26306-26307.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26306-26307.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26306-26307.diff	(revision 26740)
@@ -0,0 +1,463 @@
+Index: ../trunk-jpl/src/m/classes/pairoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/pairoptions.m	(revision 26306)
++++ ../trunk-jpl/src/m/classes/pairoptions.m	(revision 26307)
+@@ -181,7 +181,7 @@
+ 			num=sum(strcmpi(field,self.list(:,1)));
+ 		end % }}}
+ 		function value = getfieldvalue(self,field,varargin), % {{{
+-		%GETOPTION - get the value of an option
++		%GETFIELDVALUE - get the value of an option
+ 		%
+ 		%   Usage:
+ 		%      value=getfieldvalue(self,field,varargin)
+@@ -219,7 +219,7 @@
+ 			end
+ 		end % }}}
+ 		function values = getfieldvalues(self,field,varargin), % {{{
+-		%GETOPTION - get the value of an option (if the option is repeated, return multiple values)
++		%GETFIELDVALUES - get the value of an option (if the option is repeated, return multiple values)
+ 		%
+ 		%   Usage:
+ 		%      values=getfieldvalues(self,field,varargin)
+@@ -228,8 +228,8 @@
+ 		%   can be given in input if the field does not exist
+ 		%
+ 		%   Examples:
+-		%      values=getfieldvalue(options,'caxis');
+-		%      values=getfieldvalue(options,'caxis',{[0 2],[3 4]});
++		%      values=getfieldvalues(options,'caxis');
++		%      values=getfieldvalues(options,'caxis',{[0 2],[3 4]});
+ 
+ 			%some argument checking: 
+ 			if nargin~=2 && nargin~=3,
+@@ -247,7 +247,7 @@
+ 				values={};
+ 				for i=1:length(pos),
+ 					values{i}=self.list{pos(i),2};
+-					self.list{pos(i),3}=true;  % option used
++					self.list{pos(i),3}=true; % option used
+ 				end
+ 				return;
+ 			end
+@@ -266,7 +266,7 @@
+ 		%      self=removefield(self,field,warn)
+ 		%
+ 		%   if warn==1 display an info message to warn user that
+-		%   some of his options have been removed.
++		%   some of their options have been removed.
+ 
+ 			%check is field exist
+ 			if exist(self,field),
+Index: ../trunk-jpl/src/m/classes/pairoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/pairoptions.py	(revision 26306)
++++ ../trunk-jpl/src/m/classes/pairoptions.py	(revision 26307)
+@@ -13,12 +13,12 @@
+         self.functionname = ''
+         self.list = OrderedDict()
+ 
+-    #get calling function name
++        #get calling function name
+         import inspect
+         if len(inspect.stack()) > 1:
+             self.functionname = inspect.stack()[1][3]
+ 
+-    #initialize list
++        #initialize list
+         if not len(arg):
+             pass  #Do nothing,
+         else:
+@@ -56,7 +56,9 @@
+     # }}}
+ 
+     def addfield(self, field, value):  # {{{
+-        """ADDFIELD - add a field to an options list"""
++        """ADDFIELD - add a field to an options list
++        """
++
+         if isinstance(field, str):
+             if field in self.list:
+                 print(("WARNING: field '{}' with value={} exists and will be overwritten with value={}.".format(field, str(self.list[field]), str(value))))
+@@ -64,7 +66,9 @@
+     # }}}
+ 
+     def addfielddefault(self, field, value):  # {{{
+-        """ADDFIELDDEFAULT - add a field to an options list if it does not already exist"""
++        """ADDFIELDDEFAULT - add a field to an options list if it does not already exist
++        """
++
+         if isinstance(field, str):
+             if field not in self.list:
+                 self.list[field] = value
+@@ -71,7 +75,9 @@
+     # }}}
+ 
+     def AssignObjectFields(self, obj2):  # {{{
+-        """ASSIGNOBJECTFIELDS - assign object fields from options"""
++        """ASSIGNOBJECTFIELDS - assign object fields from options
++        """
++
+         for item in list(self.list.items()):
+             if item[0] in dir(obj2):
+                 setattr(obj2, item[0], item[1])
+@@ -81,13 +87,21 @@
+     # }}}
+ 
+     def changefieldvalue(self, field, newvalue):  # {{{
+-        """CHANGEOPTIONVALUE - change the value of an option in an option list"""
++        """CHANGEOPTIONVALUE - change the value of an option in an option list
++        """
+ 
+         self.list[field] = newvalue
+     # }}}
+ 
++    def displayunused(self): #{{{
++        """DISPLAYUNUSED - display unused options
++        """
++
++        disp(['WARNING: pairoptions::displayunused is not yet implemented'])
++    # }}}
+     def exist(self, field):  # {{{
+-        """EXIST - check if the option exist"""
++        """EXIST - check if the option exists
++        """
+ 
+         #some argument checking:
+         if field is None or field == '':
+@@ -103,8 +117,7 @@
+     # }}}
+ 
+     def getfieldvalue(self, field, default=None):  # {{{
+-        """
+-        GETOPTION - get the value of an option
++        """GETFIELDVALUE - get the value of an option
+ 
+         Usage:
+            value = options.getfieldvalue(field, default)
+@@ -117,13 +130,13 @@
+            value = options.getfieldvalue(options, 'caxis', [0 2])
+         """
+ 
+-    #some argument checking:
++        #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
++        #Recover option
+         if field in self.list:
+             value = self.list[field]
+         else:
+@@ -136,14 +149,13 @@
+     # }}}
+ 
+     def removefield(self, field, warn):  # {{{
+-        """
+-        REMOVEFIELD - delete a field in an option list
++        """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.
++        some of their options have been removed.
+         """
+ 
+         #check if field exist
+Index: ../trunk-jpl/src/m/classes/rotational.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/rotational.m	(revision 26306)
++++ ../trunk-jpl/src/m/classes/rotational.m	(revision 26307)
+@@ -19,13 +19,13 @@
+ 			end
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+-		
+-		%moment of inertia: 
+-		self.equatorialmoi	=8.0077*10^37; % [kg m^2] 
+-		self.polarmoi		=8.0345*10^37; % [kg m^2] 
+ 
+-		% mean rotational velocity of earth 
+-		self.angularvelocity=7.2921*10^-5; % [s^-1] 
++			%moment of inertia: 
++			self.equatorialmoi	=8.0077*10^37; % [kg m^2] 
++			self.polarmoi		=8.0345*10^37; % [kg m^2] 
++
++			% mean rotational velocity of earth 
++			self.angularvelocity=7.2921*10^-5; % [s^-1] 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26306)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26307)
+@@ -13,7 +13,7 @@
+ 		% {{{
+ 		icecaps          = {}; % list of land/ice models, name should  be change longer term.
+ 		earth            = 0;  % model for the whole earth
+-		basins           = {}; % list  of basins, matching icecaps, where shapefile info is held.
++		basins           = {}; % list of basins, matching icecaps, where shapefile info is held
+ 		cluster          = 0;
+ 		miscellaneous    = 0;
+ 		settings         = 0;
+@@ -49,25 +49,25 @@
+ 			%is the coupler turned on? 
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.transient.iscoupler==0,
+-					warning(sprintf('sealevelmodel checkconsistenty error:  icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
++					warning(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
+ 				end
+ 			end
+ 				
+ 			if slm.earth.transient.iscoupler==0,
+-				warning('sealevelmodel checkconsistenty error:  earth model should have the transient coupler option turned on!');
++				warning('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!');
+ 			end
+ 
+ 			%check that the transition vectors have the right size: 
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}),
+-					error(['sealevelmodel checkconsistenty issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
++					error(['sealevelmodel checkconsistency issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
+ 				end
+ 			end
+ 			
+-			%check that run_frequency is the same everywhere: 
++			%check that runfrequency is the same everywhere: 
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency,
+-					error(sprintf('sealevelmodel checkconsistenty error:  icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
++					error(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
+ 				end
+ 			end
+ 
+@@ -86,6 +86,7 @@
+ 					error(sprintf('isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+ 				end
+ 			end
++
+ 			%make sure that there is no solid earth external forcing on the basins: 
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+@@ -102,7 +103,6 @@
+ 				end
+ 			end
+ 
+-
+ 		end
+ 		%}}}
+ 		function slm = setdefaultparameters(slm) % {{{
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26306)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26307)
+@@ -133,6 +133,7 @@
+         for i in range(len(self.mergedcaps / 2)):
+             md = self.mergedcaps[2 * i]
+             trans = self.mergedcaps[2 * i + 1]
++            #icecaps = self.icecaps[self.range[2 * i + 2]]
+             for j in range(len(self.icecaps[0].results.TransientSolution)):
+                 for k in range(len(champs)):
+                     if isinstance(getattr(icecaps[0].results.TransientSolution[j], champs[k]), float):
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 26306)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 26307)
+@@ -2,6 +2,7 @@
+ %
+ %   Usage:
+ %      solidearth=solidearth();
++%      solidearth=solidearth('earth');
+ 
+ classdef solidearth
+ 	properties (SetAccess=public) 
+@@ -78,7 +79,7 @@
+ 			%no external solutions by default: 
+ 			self.external=[];
+ 
+-			%earth radius
++			%planet radius
+ 			self.planetradius= planetradius(planet);
+ 		
+ 		end % }}}
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 26306)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 26307)
+@@ -7,29 +7,30 @@
+ %   where varargin is a lit of paired arguments of string OR enums
+ %
+ %   Solution types available comprise:
+-%   - 'Stressbalance'      or 'sb'
+-%   - 'Masstransport'      or 'mt'
+-%   - 'Oceantransport'     or 'oceant'
+-%   - 'Thermal'            or 'th'
+-%   - 'Steadystate'        or 'ss'
+-%   - 'Transient'          or 'tr'
+-%   - 'Balancethickness'   or 'mc'
+-%   - 'Balancevelocity'    or 'bv'
+-%   - 'BedSlope'           or 'bsl'
+-%   - 'SurfaceSlope'       or 'ssl'
+-%   - 'Hydrology'          or 'hy'
+-%   - 'DamageEvolution'    or 'da'
+-%   - 'Gia'                or 'gia'
+-%   - 'Love'               or 'lv'
+-%   - 'Esa'                or 'esa'
+-%   - 'Sampling'           or 'smp'
++%   - 'Stressbalance'        or 'sb'
++%   - 'Masstransport'        or 'mt'
++%   - 'Oceantransport'       or 'oceant'
++%   - 'Thermal'              or 'th'
++%   - 'Steadystate'          or 'ss'
++%   - 'Transient'            or 'tr'
++%   - 'Balancethickness'     or 'mc'
++%   - 'Balancethickness2'
++%   - 'BalancethicknessSoft' or 'mcsoft'
++%   - 'Balancevelocity'      or 'bv'
++%   - 'BedSlope'             or 'bsl'
++%   - 'SurfaceSlope'         or 'ssl'
++%   - 'Hydrology'            or 'hy'
++%   - 'DamageEvolution'      or 'da'
++%   - 'Gia'                  or 'gia'
++%   - 'Love'                 or 'lv'
++%   - 'Esa'                  or 'esa'
++%   - 'Sampling'             or 'smp'
+ %
+ %   Extra options:
+-%   - loadonly         : does not solve. only load results
+-%   - runtimename      : true or false (default is true), makes name unique
+-%   - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on 
+-%                        consistency of model
+-%   - restart          : 'directory name (relative to the execution directory) 
++%   - loadonly         : do not solve, only load results
++%   - runtimename      : true or false (default is true); makes name unique
++%   - checkconsistency : 'yes' or 'no' (default is 'yes'); checks consistency of model
++%   - restart          : directory name (relative to the execution directory) 
+ %                        where the restart file is located
+ %
+ %   Examples:
+@@ -115,7 +116,7 @@
+ 	end
+ end
+ 
+-%if running QMU analysis, some preprocessing of Dakota files using models fields needs to be carried out. 
++%if running QMU analysis, some preprocessing of Dakota files using model fields needs to be carried out. 
+ if md.qmu.isdakota,
+ 	md=preqmu(md,options);
+ end
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 26306)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 26307)
+@@ -14,32 +14,33 @@
+ 
+     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'
+-    - 'Oceantransport'     or 'oceant'
+-    - 'Thermal'            or 'th'
+-    - 'Steadystate'        or 'ss'
+-    - 'Transient'          or 'tr'
+-    - 'Balancethickness'   or 'mc'
+-    - 'Balancevelocity'    or 'bv'
+-    - 'BedSlope'           or 'bsl'
+-    - 'SurfaceSlope'       or 'ssl'
+-    - 'Hydrology'          or 'hy'
+-    - 'DamageEvolution'    or 'da'
+-    - 'Gia'                or 'gia'
+-    - 'Love'               or 'lv'
+-    - 'Esa'                or 'esa'
+-    - 'Sampling'           or 'smp'
++    - 'Stressbalance'        or 'sb'
++    - 'Masstransport'        or 'mt'
++    - 'Oceantransport'       or 'oceant'
++    - 'Thermal'              or 'th'
++    - 'Steadystate'          or 'ss'
++    - 'Transient'            or 'tr'
++    - 'Balancethickness'     or 'mc'
++    - 'BalancethicknessSoft' or 'mcsoft'
++    - 'Balancevelocity'      or 'bv'
++    - 'BedSlope'             or 'bsl'
++    - 'SurfaceSlope'         or 'ssl'
++    - 'Hydrology'            or 'hy'
++    - 'DamageEvolution'      or 'da'
++    - 'Gia'                  or 'gia'
++    - 'Love'                 or 'lv'
++    - 'Esa'                  or 'esa'
++    - 'Sampling'             or 'smp'
+ 
+     Extra options:
+-    - loadonly         : does not solve. only load results
+-    - runtimename      : true or false (default is true), makes name unique
+-    - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on 
+-                         consistency of model
++    - loadonly         : do not solve, only load results
++    - runtimename      : true or false (default is true); makes name unique
++    - checkconsistency : 'yes' or 'no' (default is 'yes'); checks consistency 
++                         of model
+     - restart          : directory name (relative to the execution directory) 
+                          where the restart file is located
+ 
+@@ -113,7 +114,7 @@
+             else:
+                 md.private.runtimename = md.miscellaneous.name
+ 
+-    # If running QMU analysis, some preprocessing of Dakota files using models 
++    # If running QMU analysis, some preprocessing of Dakota files using model 
+     # fields needs to be carried out
+     if md.qmu.isdakota:
+         md = preqmu(md, options)
+Index: ../trunk-jpl/src/m/classes/solidearth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.py	(revision 26306)
++++ ../trunk-jpl/src/m/classes/solidearth.py	(revision 26307)
+@@ -16,6 +16,10 @@
+ 
+     Usage:
+         solidearth = solidearth()
++        solidearth = solidearth('earth')
++
++    TODO:
++    - Update translation from solidearth.m
+     """
+ 
+     def __init__(self, *args): #{{{
+@@ -70,7 +74,7 @@
+         # No external solutions by default
+         self.external = []
+ 
+-        # Earth radius
++        # Planet radius
+         self.planetradius = planetradius(planet)
+     #}}}
+     def checkconsistency(self, md, solution, analyses): #{{{
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26306)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26307)
+@@ -65,10 +65,10 @@
+ 				geoid_rate=diff(self.geoid(1:end-1,:),1,2)./dt;
+ 				geoid_rate(end+1,:)=time(1:end-1);
+ 			end
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
++			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
++			WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+ 			
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26307-26308.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26307-26308.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26307-26308.diff	(revision 26740)
@@ -0,0 +1,13835 @@
+Index: ../trunk-jpl/src/m/boundaryconditions/getlovenumbers.js
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/getlovenumbers.js	(nonexistent)
++++ ../trunk-jpl/src/m/boundaryconditions/getlovenumbers.js	(revision 26308)
+@@ -0,0 +1,10104 @@
++function getlovenumbers() {//{{{
++	/**
++	 * GETLOVENUMBERS: provide love numbers retrieved from,
++	 *
++	 *     http://www.srosat.com/iag-jsg/loveNb.php
++	 *
++	 * in a chosen reference frame
++	 *
++	 * Usage:
++	 *     series = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', 1000);
++	 * - type = one of 'loadingverticaldisplacement', 
++	'loadinggravitationalpotential', 'loadinghorizontaldisplacement', 
++	'tidalverticaldisplacement', 'tidalgravitationalpotential', 
++	'tidalhorizontaldisplacement'
++	 * - referenceframe = one of 'CM' (default) and 'CF'
++	 * - maxdeg = default 1000
++	 *
++	 * Example:
++	 *     h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
++	 *     k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg);
++	 *     l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
++	 *     th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
++	 *     tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', 'CM', 'maxdeg', maxdeg);
++	 *     tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', 'CM', 'maxdeg', maxdeg);
++	 */
++
++	// Recover options
++	let options = new pairoptions(arguments);
++	let type = options.getfieldvalue('type');
++	let frame = options.getfieldvalue('referenceframe', 'CM');
++	let maxdeg = options.getfieldvalue('maxdeg', 1000);
++
++	if (maxdeg > 10000) {
++		error('PREM love numbers computed only for deg < 10,000. Request lower maxdeg');
++	}
++
++	const TYPES = [
++		'loadingverticaldisplacement',
++		'loadinggravitationalpotential',
++		'loadinghorizontaldisplacement',
++		'tidalverticaldisplacement',
++		'tidalgravitationalpotential',
++		'tidalhorizontaldisplacement'
++	];
++
++	if (!(TYPES.includes(type))) {
++		error('type should be one of \'loadingverticaldisplacement\', \'loadinggravitationalpotential\', \'loadinghorizontaldisplacement\',\'tidalverticaldisplacement\', \'tidalgravitationalpotential\', \'tidalhorizontaldisplacement\'');
++	}
++
++	let love_numbers = [
++		[0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000],
++		[-1.28740059, -1.00000000, -0.89858519, 0.00000000, 0.00000000, 0.00000000],
++		[-1.00025365, -0.30922675, 0.02060926, 0.62933648, 0.30136172, 0.08745784],
++		[-1.06243501, -0.19927948, 0.06801636, 0.29799672, 0.09304210, 0.01525258],
++		[-1.06779588, -0.13649834, 0.05667027, 0.18024117, 0.04181593, 0.01055799],
++		[-1.10365923, -0.10736896, 0.04401221, 0.13257950, 0.02455390, 0.00874595],
++		[-1.16440348, -0.09295485, 0.03638747, 0.10999739, 0.01694141, 0.00701045],
++		[-1.23634156, -0.08469861, 0.03202759, 0.09727833, 0.01279626, 0.00556581],
++		[-1.31140380, -0.07921412, 0.02937593, 0.08896691, 0.01019313, 0.00445157],
++		[-1.38582399, -0.07513541, 0.02762338, 0.08291950, 0.00840274, 0.00360620],
++		[-1.45807465, -0.07187005, 0.02638627, 0.07819716, 0.00709641, 0.00295944],
++		[-1.52763314, -0.06913154, 0.02547640, 0.07433538, 0.00610349, 0.00245649],
++		[-1.59437866, -0.06676258, 0.02479080, 0.07107472, 0.00532548, 0.00205857],
++		[-1.65833071, -0.06466619, 0.02426511, 0.06825469, 0.00470107, 0.00173889],
++		[-1.71954820, -0.06277732, 0.02385464, 0.06576832, 0.00418998, 0.00147872],
++		[-1.77809640, -0.06105001, 0.02352654, 0.06354080, 0.00376467, 0.00126474],
++		[-1.83403970, -0.05945081, 0.02325609, 0.06151811, 0.00340573, 0.00108719],
++		[-1.88744242, -0.05795502, 0.02302469, 0.05966045, 0.00309910, 0.00093879],
++		[-1.93837115, -0.05654418, 0.02281843, 0.05793806, 0.00283441, 0.00081397],
++		[-1.98689666, -0.05520447, 0.02262706, 0.05632844, 0.00260382, 0.00070843],
++		[-2.03309477, -0.05392545, 0.02244322, 0.05481440, 0.00240132, 0.00061877],
++		[-2.07704643, -0.05269926, 0.02226173, 0.05338269, 0.00222224, 0.00054227],
++		[-2.11883714, -0.05151988, 0.02207909, 0.05202300, 0.00206289, 0.00047675],
++		[-2.15855611, -0.05038274, 0.02189307, 0.05072723, 0.00192031, 0.00042043],
++		[-2.19629514, -0.04928430, 0.02170238, 0.04948894, 0.00179212, 0.00037187],
++		[-2.23214747, -0.04822179, 0.02150643, 0.04830294, 0.00167634, 0.00032986],
++		[-2.26620674, -0.04719301, 0.02130509, 0.04716500, 0.00157138, 0.00029341],
++		[-2.29856595, -0.04619619, 0.02109858, 0.04607163, 0.00147587, 0.00026171],
++		[-2.32931659, -0.04522983, 0.02088735, 0.04501989, 0.00138869, 0.00023405],
++		[-2.35854794, -0.04429270, 0.02067197, 0.04400725, 0.00130886, 0.00020985],
++		[-2.38634650, -0.04338368, 0.02045310, 0.04303154, 0.00123559, 0.00018864],
++		[-2.41279547, -0.04250179, 0.02023142, 0.04209082, 0.00116814, 0.00017000],
++		[-2.43797451, -0.04164613, 0.02000761, 0.04118337, 0.00110593, 0.00015358],
++		[-2.46195951, -0.04081583, 0.01978231, 0.04030761, 0.00104841, 0.00013908],
++		[-2.48482241, -0.04001011, 0.01955614, 0.03946212, 0.00099513, 0.00012625],
++		[-2.50663126, -0.03922817, 0.01932966, 0.03864555, 0.00094568, 0.00011488],
++		[-2.52745016, -0.03846928, 0.01910337, 0.03785666, 0.00089971, 0.00010477],
++		[-2.54733938, -0.03773269, 0.01887774, 0.03709428, 0.00085689, 0.00009577],
++		[-2.56635547, -0.03701769, 0.01865317, 0.03635731, 0.00081696, 0.00008775],
++		[-2.58455138, -0.03632358, 0.01843000, 0.03564469, 0.00077965, 0.00008057],
++		[-2.60197665, -0.03564968, 0.01820854, 0.03495543, 0.00074474, 0.00007415],
++		[-2.61867756, -0.03499532, 0.01798905, 0.03428858, 0.00071205, 0.00006839],
++		[-2.63469733, -0.03435985, 0.01777176, 0.03364323, 0.00068137, 0.00006322],
++		[-2.65007629, -0.03374263, 0.01755683, 0.03301851, 0.00065257, 0.00005857],
++		[-2.66485208, -0.03314303, 0.01734443, 0.03241359, 0.00062548, 0.00005438],
++		[-2.67905981, -0.03256047, 0.01713468, 0.03182769, 0.00059998, 0.00005059],
++		[-2.69273222, -0.03199435, 0.01692767, 0.03126003, 0.00057595, 0.00004717],
++		[-2.70589990, -0.03144411, 0.01672347, 0.03070991, 0.00055327, 0.00004407],
++		[-2.71859139, -0.03090919, 0.01652215, 0.03017662, 0.00053186, 0.00004127],
++		[-2.73083334, -0.03038907, 0.01632374, 0.02965950, 0.00051162, 0.00003872],
++		[-2.74265068, -0.02988323, 0.01612826, 0.02915791, 0.00049246, 0.00003641],
++		[-2.75406669, -0.02939118, 0.01593573, 0.02867125, 0.00047432, 0.00003431],
++		[-2.76510320, -0.02891245, 0.01574615, 0.02819894, 0.00045712, 0.00003239],
++		[-2.77578063, -0.02844656, 0.01555950, 0.02774043, 0.00044081, 0.00003065],
++		[-2.78611812, -0.02799309, 0.01537578, 0.02729517, 0.00042531, 0.00002905],
++		[-2.79613364, -0.02755161, 0.01519496, 0.02686267, 0.00041059, 0.00002760],
++		[-2.80584405, -0.02712170, 0.01501701, 0.02644244, 0.00039659, 0.00002627],
++		[-2.81526521, -0.02670298, 0.01484191, 0.02603402, 0.00038326, 0.00002505],
++		[-2.82441204, -0.02629506, 0.01466961, 0.02563696, 0.00037057, 0.00002393],
++		[-2.83329857, -0.02589759, 0.01450009, 0.02525085, 0.00035847, 0.00002291],
++		[-2.84193804, -0.02551021, 0.01433329, 0.02487527, 0.00034693, 0.00002197],
++		[-2.85034293, -0.02513260, 0.01416919, 0.02450984, 0.00033591, 0.00002111],
++		[-2.85852503, -0.02476443, 0.01400773, 0.02415420, 0.00032539, 0.00002031],
++		[-2.86649548, -0.02440538, 0.01384888, 0.02380798, 0.00031534, 0.00001958],
++		[-2.87426481, -0.02405518, 0.01369258, 0.02347086, 0.00030573, 0.00001891],
++		[-2.88184299, -0.02371352, 0.01353880, 0.02314250, 0.00029653, 0.00001829],
++		[-2.88923945, -0.02338014, 0.01338749, 0.02282261, 0.00028772, 0.00001772],
++		[-2.89646316, -0.02305478, 0.01323861, 0.02251087, 0.00027928, 0.00001720],
++		[-2.90352261, -0.02273718, 0.01309211, 0.02220702, 0.00027120, 0.00001671],
++		[-2.91042585, -0.02242710, 0.01294795, 0.02191078, 0.00026344, 0.00001626],
++		[-2.91718054, -0.02212431, 0.01280609, 0.02162189, 0.00025600, 0.00001585],
++		[-2.92379397, -0.02182859, 0.01266648, 0.02134010, 0.00024886, 0.00001546],
++		[-2.93027306, -0.02153971, 0.01252908, 0.02106517, 0.00024200, 0.00001511],
++		[-2.93662439, -0.02125748, 0.01239386, 0.02079689, 0.00023540, 0.00001478],
++		[-2.94285425, -0.02098169, 0.01226077, 0.02053502, 0.00022907, 0.00001447],
++		[-2.94896860, -0.02071215, 0.01212977, 0.02027936, 0.00022297, 0.00001419],
++		[-2.95497314, -0.02044868, 0.01200082, 0.02002971, 0.00021710, 0.00001392],
++		[-2.96087331, -0.02019110, 0.01187388, 0.01978587, 0.00021146, 0.00001368],
++		[-2.96667427, -0.01993924, 0.01174893, 0.01954767, 0.00020602, 0.00001345],
++		[-2.97238097, -0.01969293, 0.01162591, 0.01931492, 0.00020078, 0.00001324],
++		[-2.97799813, -0.01945201, 0.01150481, 0.01908746, 0.00019573, 0.00001305],
++		[-2.98353025, -0.01921634, 0.01138557, 0.01886511, 0.00019086, 0.00001286],
++		[-2.98898162, -0.01898576, 0.01126817, 0.01864773, 0.00018616, 0.00001269],
++		[-2.99435636, -0.01876014, 0.01115257, 0.01843516, 0.00018162, 0.00001253],
++		[-2.99965838, -0.01853932, 0.01103875, 0.01822725, 0.00017725, 0.00001238],
++		[-3.00489143, -0.01832319, 0.01092666, 0.01802387, 0.00017302, 0.00001224],
++		[-3.01005909, -0.01811161, 0.01081628, 0.01782489, 0.00016893, 0.00001211],
++		[-3.01516479, -0.01790446, 0.01070757, 0.01763017, 0.00016499, 0.00001199],
++		[-3.02021180, -0.01770162, 0.01060052, 0.01743958, 0.00016117, 0.00001187],
++		[-3.02520323, -0.01750298, 0.01049508, 0.01725302, 0.00015748, 0.00001177],
++		[-3.03014209, -0.01730842, 0.01039123, 0.01707036, 0.00015391, 0.00001166],
++		[-3.03503122, -0.01711783, 0.01028894, 0.01689149, 0.00015045, 0.00001157],
++		[-3.03987336, -0.01693111, 0.01018819, 0.01671631, 0.00014711, 0.00001148],
++		[-3.04467112, -0.01674816, 0.01008894, 0.01654470, 0.00014387, 0.00001139],
++		[-3.04942699, -0.01656889, 0.00999117, 0.01637658, 0.00014073, 0.00001131],
++		[-3.05414335, -0.01639319, 0.00989485, 0.01621185, 0.00013769, 0.00001124],
++		[-3.05882250, -0.01622097, 0.00979997, 0.01605041, 0.00013474, 0.00001116],
++		[-3.06346660, -0.01605215, 0.00970649, 0.01589217, 0.00013189, 0.00001109],
++		[-3.06807773, -0.01588664, 0.00961439, 0.01573705, 0.00012912, 0.00001103],
++		[-3.07265789, -0.01572436, 0.00952364, 0.01558496, 0.00012643, 0.00001097],
++		[-3.07720897, -0.01556522, 0.00943423, 0.01543582, 0.00012382, 0.00001091],
++		[-3.08173279, -0.01540916, 0.00934613, 0.01528956, 0.00012129, 0.00001085],
++		[-3.08623109, -0.01525608, 0.00925931, 0.01514610, 0.00011883, 0.00001080],
++		[-3.09070551, -0.01510592, 0.00917376, 0.01500536, 0.00011645, 0.00001074],
++		[-3.09515765, -0.01495861, 0.00908946, 0.01486728, 0.00011413, 0.00001069],
++		[-3.09958899, -0.01481408, 0.00900637, 0.01473179, 0.00011188, 0.00001064],
++		[-3.10400100, -0.01467225, 0.00892449, 0.01459882, 0.00010969, 0.00001060],
++		[-3.10839504, -0.01453308, 0.00884379, 0.01446831, 0.00010756, 0.00001055],
++		[-3.11277241, -0.01439648, 0.00876425, 0.01434019, 0.00010549, 0.00001051],
++		[-3.11713438, -0.01426240, 0.00868586, 0.01421441, 0.00010348, 0.00001047],
++		[-3.12148213, -0.01413079, 0.00860858, 0.01409091, 0.00010152, 0.00001042],
++		[-3.12581680, -0.01400157, 0.00853241, 0.01396963, 0.00009962, 0.00001038],
++		[-3.13013947, -0.01387471, 0.00845733, 0.01385052, 0.00009776, 0.00001034],
++		[-3.13445117, -0.01375013, 0.00838331, 0.01373352, 0.00009596, 0.00001031],
++		[-3.13875289, -0.01362779, 0.00831034, 0.01361859, 0.00009420, 0.00001027],
++		[-3.14304556, -0.01350764, 0.00823841, 0.01350567, 0.00009249, 0.00001023],
++		[-3.14733008, -0.01338963, 0.00816748, 0.01339472, 0.00009083, 0.00001020],
++		[-3.15160728, -0.01327370, 0.00809756, 0.01328569, 0.00008920, 0.00001016],
++		[-3.15587797, -0.01315981, 0.00802862, 0.01317853, 0.00008762, 0.00001012],
++		[-3.16014293, -0.01304792, 0.00796064, 0.01307320, 0.00008608, 0.00001009],
++		[-3.16440288, -0.01293797, 0.00789361, 0.01296967, 0.00008458, 0.00001006],
++		[-3.16865852, -0.01282993, 0.00782751, 0.01286788, 0.00008311, 0.00001002],
++		[-3.17291049, -0.01272375, 0.00776233, 0.01276779, 0.00008169, 0.00000999],
++		[-3.17715942, -0.01261940, 0.00769805, 0.01266938, 0.00008029, 0.00000996],
++		[-3.18140591, -0.01251682, 0.00763466, 0.01257259, 0.00007893, 0.00000992],
++		[-3.18565052, -0.01241598, 0.00757215, 0.01247740, 0.00007761, 0.00000989],
++		[-3.18989378, -0.01231685, 0.00751049, 0.01238376, 0.00007631, 0.00000986],
++		[-3.19413619, -0.01221938, 0.00744968, 0.01229165, 0.00007505, 0.00000983],
++		[-3.19837823, -0.01212354, 0.00738970, 0.01220103, 0.00007381, 0.00000979],
++		[-3.20262035, -0.01202930, 0.00733053, 0.01211186, 0.00007261, 0.00000976],
++		[-3.20686298, -0.01193661, 0.00727217, 0.01202412, 0.00007143, 0.00000973],
++		[-3.21110653, -0.01184546, 0.00721461, 0.01193777, 0.00007028, 0.00000970],
++		[-3.21535137, -0.01175579, 0.00715782, 0.01185279, 0.00006916, 0.00000967],
++		[-3.21959786, -0.01166759, 0.00710179, 0.01176914, 0.00006806, 0.00000964],
++		[-3.22384634, -0.01158082, 0.00704652, 0.01168680, 0.00006699, 0.00000961],
++		[-3.22809714, -0.01149545, 0.00699199, 0.01160573, 0.00006594, 0.00000957],
++		[-3.23235055, -0.01141146, 0.00693819, 0.01152591, 0.00006492, 0.00000954],
++		[-3.23660685, -0.01132880, 0.00688511, 0.01144732, 0.00006392, 0.00000951],
++		[-3.24086631, -0.01124746, 0.00683273, 0.01136993, 0.00006294, 0.00000948],
++		[-3.24512918, -0.01116741, 0.00678105, 0.01129371, 0.00006198, 0.00000945],
++		[-3.24939569, -0.01108862, 0.00673005, 0.01121864, 0.00006105, 0.00000942],
++		[-3.25366606, -0.01101107, 0.00667973, 0.01114470, 0.00006013, 0.00000939],
++		[-3.25794050, -0.01093473, 0.00663007, 0.01107186, 0.00005923, 0.00000936],
++		[-3.26221918, -0.01085957, 0.00658106, 0.01100010, 0.00005835, 0.00000932],
++		[-3.26650230, -0.01078557, 0.00653269, 0.01092939, 0.00005750, 0.00000929],
++		[-3.27079000, -0.01071272, 0.00648495, 0.01085973, 0.00005665, 0.00000926],
++		[-3.27508246, -0.01064097, 0.00643784, 0.01079108, 0.00005583, 0.00000923],
++		[-3.27937980, -0.01057032, 0.00639134, 0.01072343, 0.00005503, 0.00000920],
++		[-3.28368216, -0.01050074, 0.00634544, 0.01065676, 0.00005424, 0.00000917],
++		[-3.28798965, -0.01043222, 0.00630013, 0.01059104, 0.00005346, 0.00000914],
++		[-3.29230239, -0.01036472, 0.00625541, 0.01052626, 0.00005271, 0.00000910],
++		[-3.29662047, -0.01029823, 0.00621126, 0.01046241, 0.00005196, 0.00000907],
++		[-3.30094399, -0.01023273, 0.00616768, 0.01039945, 0.00005124, 0.00000904],
++		[-3.30527303, -0.01016819, 0.00612465, 0.01033738, 0.00005053, 0.00000901],
++		[-3.30960766, -0.01010461, 0.00608218, 0.01027618, 0.00004983, 0.00000898],
++		[-3.31394795, -0.01004197, 0.00604024, 0.01021583, 0.00004914, 0.00000895],
++		[-3.31829395, -0.00998024, 0.00599883, 0.01015631, 0.00004847, 0.00000891],
++		[-3.32264573, -0.00991940, 0.00595795, 0.01009762, 0.00004781, 0.00000888],
++		[-3.32700331, -0.00985945, 0.00591759, 0.01003973, 0.00004717, 0.00000885],
++		[-3.33136675, -0.00980035, 0.00587773, 0.00998262, 0.00004654, 0.00000882],
++		[-3.33573607, -0.00974211, 0.00583838, 0.00992630, 0.00004592, 0.00000879],
++		[-3.34011130, -0.00968470, 0.00579951, 0.00987073, 0.00004531, 0.00000875],
++		[-3.34449246, -0.00962810, 0.00576113, 0.00981591, 0.00004471, 0.00000872],
++		[-3.34887956, -0.00957230, 0.00572323, 0.00976182, 0.00004413, 0.00000869],
++		[-3.35327261, -0.00951729, 0.00568581, 0.00970845, 0.00004355, 0.00000866],
++		[-3.35767163, -0.00946304, 0.00564884, 0.00965578, 0.00004299, 0.00000863],
++		[-3.36207660, -0.00940956, 0.00561233, 0.00960381, 0.00004244, 0.00000859],
++		[-3.36648753, -0.00935681, 0.00557627, 0.00955252, 0.00004189, 0.00000856],
++		[-3.37090440, -0.00930480, 0.00554066, 0.00950190, 0.00004136, 0.00000853],
++		[-3.37532721, -0.00925350, 0.00550548, 0.00945194, 0.00004084, 0.00000850],
++		[-3.37975593, -0.00920290, 0.00547073, 0.00940262, 0.00004032, 0.00000847],
++		[-3.38419056, -0.00915300, 0.00543641, 0.00935393, 0.00003982, 0.00000843],
++		[-3.38863105, -0.00910377, 0.00540251, 0.00930586, 0.00003932, 0.00000840],
++		[-3.39307740, -0.00905520, 0.00536901, 0.00925841, 0.00003884, 0.00000837],
++		[-3.39752956, -0.00900729, 0.00533593, 0.00921156, 0.00003836, 0.00000834],
++		[-3.40198751, -0.00896002, 0.00530324, 0.00916530, 0.00003789, 0.00000830],
++		[-3.40645121, -0.00891338, 0.00527095, 0.00911962, 0.00003743, 0.00000827],
++		[-3.41092063, -0.00886736, 0.00523904, 0.00907451, 0.00003697, 0.00000824],
++		[-3.41539571, -0.00882195, 0.00520752, 0.00902996, 0.00003653, 0.00000821],
++		[-3.41987643, -0.00877713, 0.00517637, 0.00898596, 0.00003609, 0.00000817],
++		[-3.42436272, -0.00873290, 0.00514560, 0.00894250, 0.00003566, 0.00000814],
++		[-3.42885456, -0.00868925, 0.00511520, 0.00889958, 0.00003524, 0.00000811],
++		[-3.43335188, -0.00864617, 0.00508515, 0.00885718, 0.00003482, 0.00000808],
++		[-3.43785464, -0.00860364, 0.00505546, 0.00881530, 0.00003441, 0.00000804],
++		[-3.44236278, -0.00856166, 0.00502613, 0.00877392, 0.00003401, 0.00000801],
++		[-3.44687625, -0.00852021, 0.00499714, 0.00873304, 0.00003361, 0.00000798],
++		[-3.45139500, -0.00847930, 0.00496849, 0.00869264, 0.00003323, 0.00000795],
++		[-3.45591895, -0.00843890, 0.00494017, 0.00865273, 0.00003284, 0.00000791],
++		[-3.46044807, -0.00839902, 0.00491219, 0.00861330, 0.00003247, 0.00000788],
++		[-3.46498227, -0.00835964, 0.00488454, 0.00857433, 0.00003210, 0.00000785],
++		[-3.46952151, -0.00832075, 0.00485721, 0.00853582, 0.00003173, 0.00000782],
++		[-3.47406572, -0.00828234, 0.00483019, 0.00849776, 0.00003138, 0.00000778],
++		[-3.47861484, -0.00824442, 0.00480349, 0.00846014, 0.00003102, 0.00000775],
++		[-3.48316880, -0.00820696, 0.00477710, 0.00842296, 0.00003068, 0.00000772],
++		[-3.48772753, -0.00816996, 0.00475102, 0.00838622, 0.00003034, 0.00000769],
++		[-3.49229097, -0.00813342, 0.00472523, 0.00834989, 0.00003000, 0.00000766],
++		[-3.49685904, -0.00809733, 0.00469975, 0.00831398, 0.00002967, 0.00000762],
++		[-3.50143169, -0.00806167, 0.00467455, 0.00827848, 0.00002935, 0.00000759],
++		[-3.50600884, -0.00802644, 0.00464964, 0.00824338, 0.00002903, 0.00000756],
++		[-3.51059042, -0.00799164, 0.00462502, 0.00820868, 0.00002871, 0.00000753],
++		[-3.51517637, -0.00795726, 0.00460068, 0.00817437, 0.00002840, 0.00000750],
++		[-3.51976660, -0.00792329, 0.00457662, 0.00814045, 0.00002810, 0.00000746],
++		[-3.52436105, -0.00788972, 0.00455283, 0.00810691, 0.00002779, 0.00000743],
++		[-3.52895964, -0.00785655, 0.00452930, 0.00807373, 0.00002750, 0.00000740],
++		[-3.53356231, -0.00782377, 0.00450605, 0.00804093, 0.00002721, 0.00000737],
++		[-3.53816898, -0.00779138, 0.00448306, 0.00800849, 0.00002692, 0.00000734],
++		[-3.54277957, -0.00775937, 0.00446032, 0.00797640, 0.00002664, 0.00000730],
++		[-3.54739402, -0.00772773, 0.00443784, 0.00794466, 0.00002636, 0.00000727],
++		[-3.55201224, -0.00769645, 0.00441562, 0.00791327, 0.00002608, 0.00000724],
++		[-3.55663417, -0.00766554, 0.00439364, 0.00788222, 0.00002581, 0.00000721],
++		[-3.56125973, -0.00763498, 0.00437190, 0.00785151, 0.00002555, 0.00000718],
++		[-3.56588885, -0.00760478, 0.00435041, 0.00782113, 0.00002528, 0.00000715],
++		[-3.57052145, -0.00757491, 0.00432916, 0.00779107, 0.00002502, 0.00000712],
++		[-3.57515745, -0.00754539, 0.00430814, 0.00776133, 0.00002477, 0.00000708],
++		[-3.57979678, -0.00751620, 0.00428736, 0.00773191, 0.00002452, 0.00000705],
++		[-3.58443937, -0.00748734, 0.00426681, 0.00770279, 0.00002427, 0.00000702],
++		[-3.58908514, -0.00745880, 0.00424648, 0.00767399, 0.00002403, 0.00000699],
++		[-3.59373401, -0.00743059, 0.00422637, 0.00764549, 0.00002379, 0.00000696],
++		[-3.59838592, -0.00740268, 0.00420649, 0.00761728, 0.00002355, 0.00000693],
++		[-3.60304078, -0.00737509, 0.00418682, 0.00758937, 0.00002331, 0.00000690],
++		[-3.60769852, -0.00734780, 0.00416737, 0.00756175, 0.00002308, 0.00000687],
++		[-3.61235907, -0.00732081, 0.00414813, 0.00753441, 0.00002286, 0.00000684],
++		[-3.61702235, -0.00729411, 0.00412910, 0.00750735, 0.00002263, 0.00000681],
++		[-3.62168828, -0.00726771, 0.00411028, 0.00748058, 0.00002241, 0.00000678],
++		[-3.62635680, -0.00724159, 0.00409166, 0.00745407, 0.00002219, 0.00000674],
++		[-3.63102782, -0.00721575, 0.00407325, 0.00742783, 0.00002198, 0.00000671],
++		[-3.63570128, -0.00719020, 0.00405503, 0.00740186, 0.00002176, 0.00000668],
++		[-3.64037709, -0.00716491, 0.00403700, 0.00737615, 0.00002156, 0.00000665],
++		[-3.64505519, -0.00713990, 0.00401918, 0.00735070, 0.00002135, 0.00000662],
++		[-3.64973550, -0.00711515, 0.00400154, 0.00732550, 0.00002115, 0.00000659],
++		[-3.65441795, -0.00709066, 0.00398409, 0.00730055, 0.00002094, 0.00000656],
++		[-3.65910247, -0.00706643, 0.00396683, 0.00727585, 0.00002075, 0.00000653],
++		[-3.66378898, -0.00704246, 0.00394975, 0.00725140, 0.00002055, 0.00000650],
++		[-3.66847740, -0.00701873, 0.00393286, 0.00722718, 0.00002036, 0.00000647],
++		[-3.67316767, -0.00699526, 0.00391614, 0.00720320, 0.00002017, 0.00000644],
++		[-3.67785972, -0.00697202, 0.00389960, 0.00717946, 0.00001998, 0.00000641],
++		[-3.68255347, -0.00694903, 0.00388324, 0.00715594, 0.00001979, 0.00000638],
++		[-3.68724885, -0.00692627, 0.00386705, 0.00713266, 0.00001961, 0.00000636],
++		[-3.69194579, -0.00690374, 0.00385103, 0.00710959, 0.00001943, 0.00000633],
++		[-3.69664421, -0.00688145, 0.00383518, 0.00708675, 0.00001925, 0.00000630],
++		[-3.70134406, -0.00685938, 0.00381949, 0.00706413, 0.00001907, 0.00000627],
++		[-3.70604525, -0.00683753, 0.00380397, 0.00704173, 0.00001890, 0.00000624],
++		[-3.71074772, -0.00681590, 0.00378861, 0.00701953, 0.00001873, 0.00000621],
++		[-3.71545140, -0.00679449, 0.00377342, 0.00699755, 0.00001856, 0.00000618],
++		[-3.72015622, -0.00677330, 0.00375838, 0.00697577, 0.00001839, 0.00000615],
++		[-3.72486211, -0.00675231, 0.00374349, 0.00695420, 0.00001823, 0.00000612],
++		[-3.72956899, -0.00673153, 0.00372877, 0.00693283, 0.00001806, 0.00000609],
++		[-3.73427682, -0.00671096, 0.00371419, 0.00691165, 0.00001790, 0.00000607],
++		[-3.73898550, -0.00669059, 0.00369976, 0.00689068, 0.00001774, 0.00000604],
++		[-3.74369498, -0.00667042, 0.00368549, 0.00686989, 0.00001759, 0.00000601],
++		[-3.74840519, -0.00665044, 0.00367136, 0.00684930, 0.00001743, 0.00000598],
++		[-3.75311607, -0.00663066, 0.00365738, 0.00682890, 0.00001728, 0.00000595],
++		[-3.75782754, -0.00661107, 0.00364354, 0.00680868, 0.00001713, 0.00000592],
++		[-3.76253955, -0.00659167, 0.00362984, 0.00678865, 0.00001698, 0.00000590],
++		[-3.76725202, -0.00657245, 0.00361628, 0.00676880, 0.00001683, 0.00000587],
++		[-3.77196489, -0.00655341, 0.00360286, 0.00674913, 0.00001668, 0.00000584],
++		[-3.77667809, -0.00653456, 0.00358958, 0.00672963, 0.00001654, 0.00000581],
++		[-3.78139156, -0.00651589, 0.00357643, 0.00671031, 0.00001640, 0.00000579],
++		[-3.78610525, -0.00649739, 0.00356342, 0.00669116, 0.00001625, 0.00000576],
++		[-3.79081907, -0.00647906, 0.00355053, 0.00667218, 0.00001612, 0.00000573],
++		[-3.79553298, -0.00646091, 0.00353778, 0.00665337, 0.00001598, 0.00000570],
++		[-3.80024690, -0.00644292, 0.00352516, 0.00663472, 0.00001584, 0.00000568],
++		[-3.80496078, -0.00642510, 0.00351266, 0.00661624, 0.00001571, 0.00000565],
++		[-3.80967455, -0.00640745, 0.00350029, 0.00659792, 0.00001557, 0.00000562],
++		[-3.81438815, -0.00638996, 0.00348804, 0.00657976, 0.00001544, 0.00000560],
++		[-3.81910152, -0.00637262, 0.00347592, 0.00656176, 0.00001531, 0.00000557],
++		[-3.82381460, -0.00635545, 0.00346392, 0.00654391, 0.00001519, 0.00000554],
++		[-3.82852732, -0.00633843, 0.00345204, 0.00652622, 0.00001506, 0.00000552],
++		[-3.83323964, -0.00632157, 0.00344027, 0.00650867, 0.00001493, 0.00000549],
++		[-3.83795149, -0.00630485, 0.00342863, 0.00649128, 0.00001481, 0.00000546],
++		[-3.84266280, -0.00628829, 0.00341709, 0.00647404, 0.00001469, 0.00000544],
++		[-3.84737353, -0.00627187, 0.00340568, 0.00645694, 0.00001457, 0.00000541],
++		[-3.85208361, -0.00625560, 0.00339437, 0.00643998, 0.00001445, 0.00000538],
++		[-3.85679299, -0.00623948, 0.00338318, 0.00642317, 0.00001433, 0.00000536],
++		[-3.86150160, -0.00622349, 0.00337210, 0.00640650, 0.00001421, 0.00000533],
++		[-3.86620939, -0.00620765, 0.00336112, 0.00638997, 0.00001410, 0.00000531],
++		[-3.87091631, -0.00619194, 0.00335026, 0.00637358, 0.00001398, 0.00000528],
++		[-3.87562229, -0.00617637, 0.00333950, 0.00635732, 0.00001387, 0.00000526],
++		[-3.88032729, -0.00616094, 0.00332885, 0.00634120, 0.00001376, 0.00000523],
++		[-3.88503124, -0.00614564, 0.00331830, 0.00632520, 0.00001364, 0.00000521],
++		[-3.88973410, -0.00613047, 0.00330785, 0.00630934, 0.00001354, 0.00000518],
++		[-3.89443580, -0.00611543, 0.00329750, 0.00629361, 0.00001343, 0.00000515],
++		[-3.89913629, -0.00610051, 0.00328726, 0.00627801, 0.00001332, 0.00000513],
++		[-3.90383552, -0.00608573, 0.00327711, 0.00626253, 0.00001321, 0.00000510],
++		[-3.90853343, -0.00607107, 0.00326707, 0.00624718, 0.00001311, 0.00000508],
++		[-3.91322998, -0.00605653, 0.00325712, 0.00623195, 0.00001301, 0.00000506],
++		[-3.91792511, -0.00604212, 0.00324726, 0.00621684, 0.00001290, 0.00000503],
++		[-3.92261876, -0.00602782, 0.00323750, 0.00620185, 0.00001280, 0.00000501],
++		[-3.92731089, -0.00601364, 0.00322784, 0.00618698, 0.00001270, 0.00000498],
++		[-3.93200144, -0.00599958, 0.00321826, 0.00617223, 0.00001260, 0.00000496],
++		[-3.93669036, -0.00598564, 0.00320878, 0.00615760, 0.00001250, 0.00000493],
++		[-3.94137761, -0.00597181, 0.00319939, 0.00614308, 0.00001241, 0.00000491],
++		[-3.94606313, -0.00595809, 0.00319009, 0.00612867, 0.00001231, 0.00000488],
++		[-3.95074687, -0.00594449, 0.00318088, 0.00611438, 0.00001221, 0.00000486],
++		[-3.95542878, -0.00593099, 0.00317175, 0.00610019, 0.00001212, 0.00000484],
++		[-3.96010882, -0.00591761, 0.00316271, 0.00608612, 0.00001203, 0.00000481],
++		[-3.96478693, -0.00590433, 0.00315376, 0.00607215, 0.00001193, 0.00000479],
++		[-3.96946306, -0.00589116, 0.00314489, 0.00605829, 0.00001184, 0.00000477],
++		[-3.97413718, -0.00587809, 0.00313611, 0.00604454, 0.00001175, 0.00000474],
++		[-3.97880922, -0.00586512, 0.00312740, 0.00603089, 0.00001166, 0.00000472],
++		[-3.98347915, -0.00585226, 0.00311878, 0.00601735, 0.00001157, 0.00000470],
++		[-3.98814692, -0.00583950, 0.00311024, 0.00600390, 0.00001149, 0.00000467],
++		[-3.99281247, -0.00582684, 0.00310178, 0.00599056, 0.00001140, 0.00000465],
++		[-3.99747577, -0.00581428, 0.00309340, 0.00597732, 0.00001131, 0.00000463],
++		[-4.00213677, -0.00580181, 0.00308510, 0.00596417, 0.00001123, 0.00000460],
++		[-4.00679542, -0.00578944, 0.00307688, 0.00595113, 0.00001114, 0.00000458],
++		[-4.01145168, -0.00577717, 0.00306873, 0.00593818, 0.00001106, 0.00000456],
++		[-4.01610551, -0.00576499, 0.00306065, 0.00592532, 0.00001098, 0.00000454],
++		[-4.02075685, -0.00575290, 0.00305266, 0.00591256, 0.00001090, 0.00000451],
++		[-4.02540567, -0.00574091, 0.00304473, 0.00589990, 0.00001082, 0.00000449],
++		[-4.03005191, -0.00572900, 0.00303688, 0.00588732, 0.00001073, 0.00000447],
++		[-4.03469555, -0.00571719, 0.00302910, 0.00587484, 0.00001066, 0.00000445],
++		[-4.03933654, -0.00570546, 0.00302139, 0.00586244, 0.00001058, 0.00000443],
++		[-4.04397482, -0.00569382, 0.00301375, 0.00585014, 0.00001050, 0.00000440],
++		[-4.04861037, -0.00568227, 0.00300619, 0.00583792, 0.00001042, 0.00000438],
++		[-4.05324314, -0.00567080, 0.00299869, 0.00582579, 0.00001035, 0.00000436],
++		[-4.05787308, -0.00565942, 0.00299126, 0.00581375, 0.00001027, 0.00000434],
++		[-4.06250017, -0.00564812, 0.00298390, 0.00580179, 0.00001019, 0.00000432],
++		[-4.06712435, -0.00563690, 0.00297660, 0.00578992, 0.00001012, 0.00000430],
++		[-4.07174558, -0.00562577, 0.00296937, 0.00577813, 0.00001005, 0.00000427],
++		[-4.07636383, -0.00561471, 0.00296221, 0.00576642, 0.00000997, 0.00000425],
++		[-4.08097906, -0.00560374, 0.00295511, 0.00575480, 0.00000990, 0.00000423],
++		[-4.08559122, -0.00559284, 0.00294807, 0.00574325, 0.00000983, 0.00000421],
++		[-4.09020028, -0.00558202, 0.00294110, 0.00573179, 0.00000976, 0.00000419],
++		[-4.09480620, -0.00557128, 0.00293419, 0.00572040, 0.00000969, 0.00000417],
++		[-4.09940894, -0.00556061, 0.00292734, 0.00570909, 0.00000962, 0.00000415],
++		[-4.10400846, -0.00555002, 0.00292056, 0.00569786, 0.00000955, 0.00000413],
++		[-4.10860473, -0.00553950, 0.00291383, 0.00568670, 0.00000948, 0.00000411],
++		[-4.11319770, -0.00552906, 0.00290717, 0.00567562, 0.00000942, 0.00000409],
++		[-4.11778734, -0.00551869, 0.00290056, 0.00566462, 0.00000935, 0.00000407],
++		[-4.12237362, -0.00550839, 0.00289401, 0.00565369, 0.00000928, 0.00000405],
++		[-4.12695649, -0.00549816, 0.00288752, 0.00564283, 0.00000922, 0.00000403],
++		[-4.13153592, -0.00548801, 0.00288109, 0.00563204, 0.00000915, 0.00000401],
++		[-4.13611188, -0.00547792, 0.00287471, 0.00562133, 0.00000909, 0.00000399],
++		[-4.14068433, -0.00546790, 0.00286839, 0.00561069, 0.00000902, 0.00000397],
++		[-4.14525323, -0.00545795, 0.00286213, 0.00560011, 0.00000896, 0.00000395],
++		[-4.14981854, -0.00544806, 0.00285592, 0.00558961, 0.00000890, 0.00000393],
++		[-4.15438025, -0.00543824, 0.00284976, 0.00557918, 0.00000883, 0.00000391],
++		[-4.15893830, -0.00542849, 0.00284366, 0.00556881, 0.00000877, 0.00000389],
++		[-4.16349267, -0.00541880, 0.00283761, 0.00555851, 0.00000871, 0.00000387],
++		[-4.16804332, -0.00540918, 0.00283162, 0.00554827, 0.00000865, 0.00000385],
++		[-4.17259021, -0.00539962, 0.00282567, 0.00553811, 0.00000859, 0.00000383],
++		[-4.17713333, -0.00539012, 0.00281978, 0.00552800, 0.00000853, 0.00000381],
++		[-4.18167262, -0.00538069, 0.00281394, 0.00551796, 0.00000847, 0.00000379],
++		[-4.18620807, -0.00537131, 0.00280815, 0.00550799, 0.00000841, 0.00000377],
++		[-4.19073963, -0.00536200, 0.00280241, 0.00549808, 0.00000836, 0.00000375],
++		[-4.19526728, -0.00535274, 0.00279671, 0.00548823, 0.00000830, 0.00000373],
++		[-4.19979098, -0.00534355, 0.00279107, 0.00547844, 0.00000824, 0.00000372],
++		[-4.20431070, -0.00533441, 0.00278548, 0.00546871, 0.00000818, 0.00000370],
++		[-4.20882641, -0.00532534, 0.00277993, 0.00545905, 0.00000813, 0.00000368],
++		[-4.21333809, -0.00531632, 0.00277443, 0.00544944, 0.00000807, 0.00000366],
++		[-4.21784569, -0.00530735, 0.00276897, 0.00543989, 0.00000802, 0.00000364],
++		[-4.22234919, -0.00529845, 0.00276357, 0.00543040, 0.00000796, 0.00000362],
++		[-4.22684856, -0.00528959, 0.00275820, 0.00542097, 0.00000791, 0.00000361],
++		[-4.23134377, -0.00528080, 0.00275289, 0.00541160, 0.00000786, 0.00000359],
++		[-4.23583479, -0.00527206, 0.00274762, 0.00540228, 0.00000780, 0.00000357],
++		[-4.24032159, -0.00526337, 0.00274239, 0.00539302, 0.00000775, 0.00000355],
++		[-4.24480413, -0.00525473, 0.00273720, 0.00538382, 0.00000770, 0.00000353],
++		[-4.24928241, -0.00524615, 0.00273206, 0.00537467, 0.00000765, 0.00000352],
++		[-4.25375637, -0.00523762, 0.00272697, 0.00536557, 0.00000759, 0.00000350],
++		[-4.25822600, -0.00522914, 0.00272191, 0.00535653, 0.00000754, 0.00000348],
++		[-4.26269127, -0.00522071, 0.00271690, 0.00534754, 0.00000749, 0.00000346],
++		[-4.26715214, -0.00521233, 0.00271193, 0.00533861, 0.00000744, 0.00000345],
++		[-4.27160860, -0.00520401, 0.00270700, 0.00532973, 0.00000739, 0.00000343],
++		[-4.27606061, -0.00519573, 0.00270211, 0.00532090, 0.00000734, 0.00000341],
++		[-4.28050816, -0.00518750, 0.00269726, 0.00531212, 0.00000729, 0.00000339],
++		[-4.28495120, -0.00517932, 0.00269245, 0.00530339, 0.00000725, 0.00000338],
++		[-4.28938971, -0.00517119, 0.00268767, 0.00529471, 0.00000720, 0.00000336],
++		[-4.29382368, -0.00516310, 0.00268294, 0.00528608, 0.00000715, 0.00000334],
++		[-4.29825306, -0.00515506, 0.00267825, 0.00527750, 0.00000710, 0.00000333],
++		[-4.30267785, -0.00514707, 0.00267359, 0.00526897, 0.00000706, 0.00000331],
++		[-4.30709800, -0.00513912, 0.00266898, 0.00526049, 0.00000701, 0.00000329],
++		[-4.31151350, -0.00513122, 0.00266440, 0.00525206, 0.00000696, 0.00000328],
++		[-4.31592431, -0.00512337, 0.00265985, 0.00524367, 0.00000692, 0.00000326],
++		[-4.32033043, -0.00511555, 0.00265535, 0.00523533, 0.00000687, 0.00000324],
++		[-4.32473181, -0.00510779, 0.00265088, 0.00522704, 0.00000683, 0.00000323],
++		[-4.32912844, -0.00510006, 0.00264644, 0.00521879, 0.00000678, 0.00000321],
++		[-4.33352030, -0.00509238, 0.00264204, 0.00521059, 0.00000674, 0.00000319],
++		[-4.33790735, -0.00508474, 0.00263768, 0.00520243, 0.00000669, 0.00000318],
++		[-4.34228957, -0.00507715, 0.00263335, 0.00519432, 0.00000665, 0.00000316],
++		[-4.34666695, -0.00506959, 0.00262906, 0.00518625, 0.00000661, 0.00000315],
++		[-4.35103946, -0.00506208, 0.00262479, 0.00517822, 0.00000656, 0.00000313],
++		[-4.35540706, -0.00505461, 0.00262057, 0.00517024, 0.00000652, 0.00000311],
++		[-4.35976976, -0.00504718, 0.00261637, 0.00516230, 0.00000648, 0.00000310],
++		[-4.36412751, -0.00503978, 0.00261221, 0.00515441, 0.00000644, 0.00000308],
++		[-4.36848029, -0.00503243, 0.00260808, 0.00514656, 0.00000639, 0.00000307],
++		[-4.37282810, -0.00502512, 0.00260399, 0.00513874, 0.00000635, 0.00000305],
++		[-4.37717089, -0.00501785, 0.00259992, 0.00513097, 0.00000631, 0.00000304],
++		[-4.38150866, -0.00501061, 0.00259589, 0.00512324, 0.00000627, 0.00000302],
++		[-4.38584137, -0.00500341, 0.00259189, 0.00511555, 0.00000623, 0.00000301],
++		[-4.39016901, -0.00499626, 0.00258792, 0.00510791, 0.00000619, 0.00000299],
++		[-4.39449156, -0.00498913, 0.00258397, 0.00510030, 0.00000615, 0.00000298],
++		[-4.39880900, -0.00498205, 0.00258006, 0.00509273, 0.00000611, 0.00000296],
++		[-4.40312130, -0.00497500, 0.00257618, 0.00508520, 0.00000607, 0.00000295],
++		[-4.40742845, -0.00496799, 0.00257233, 0.00507770, 0.00000603, 0.00000293],
++		[-4.41173042, -0.00496101, 0.00256851, 0.00507025, 0.00000599, 0.00000292],
++		[-4.41602719, -0.00495407, 0.00256472, 0.00506283, 0.00000596, 0.00000290],
++		[-4.42031875, -0.00494717, 0.00256096, 0.00505545, 0.00000592, 0.00000289],
++		[-4.42460508, -0.00494030, 0.00255722, 0.00504811, 0.00000588, 0.00000287],
++		[-4.42888615, -0.00493346, 0.00255351, 0.00504081, 0.00000584, 0.00000286],
++		[-4.43316194, -0.00492666, 0.00254984, 0.00503354, 0.00000581, 0.00000284],
++		[-4.43743244, -0.00491989, 0.00254618, 0.00502631, 0.00000577, 0.00000283],
++		[-4.44169763, -0.00491316, 0.00254256, 0.00501911, 0.00000573, 0.00000281],
++		[-4.44595749, -0.00490646, 0.00253896, 0.00501195, 0.00000570, 0.00000280],
++		[-4.45021200, -0.00489979, 0.00253539, 0.00500482, 0.00000566, 0.00000279],
++		[-4.45446115, -0.00489316, 0.00253185, 0.00499773, 0.00000562, 0.00000277],
++		[-4.45870490, -0.00488655, 0.00252833, 0.00499068, 0.00000559, 0.00000276],
++		[-4.46294326, -0.00487998, 0.00252484, 0.00498365, 0.00000555, 0.00000274],
++		[-4.46717619, -0.00487344, 0.00252137, 0.00497667, 0.00000552, 0.00000273],
++		[-4.47140368, -0.00486693, 0.00251793, 0.00496971, 0.00000548, 0.00000272],
++		[-4.47562571, -0.00486046, 0.00251451, 0.00496279, 0.00000545, 0.00000270],
++		[-4.47984227, -0.00485401, 0.00251112, 0.00495590, 0.00000541, 0.00000269],
++		[-4.48405334, -0.00484759, 0.00250775, 0.00494904, 0.00000538, 0.00000268],
++		[-4.48825891, -0.00484121, 0.00250441, 0.00494222, 0.00000535, 0.00000266],
++		[-4.49245894, -0.00483485, 0.00250109, 0.00493543, 0.00000531, 0.00000265],
++		[-4.49665344, -0.00482852, 0.00249780, 0.00492867, 0.00000528, 0.00000264],
++		[-4.50084238, -0.00482223, 0.00249453, 0.00492194, 0.00000525, 0.00000262],
++		[-4.50502575, -0.00481596, 0.00249128, 0.00491524, 0.00000521, 0.00000261],
++		[-4.50920352, -0.00480972, 0.00248805, 0.00490857, 0.00000518, 0.00000260],
++		[-4.51337569, -0.00480350, 0.00248485, 0.00490194, 0.00000515, 0.00000258],
++		[-4.51754224, -0.00479732, 0.00248167, 0.00489533, 0.00000512, 0.00000257],
++		[-4.52170315, -0.00479117, 0.00247851, 0.00488876, 0.00000508, 0.00000256],
++		[-4.52585842, -0.00478504, 0.00247538, 0.00488221, 0.00000505, 0.00000254],
++		[-4.53000801, -0.00477894, 0.00247227, 0.00487569, 0.00000502, 0.00000253],
++		[-4.53415192, -0.00477286, 0.00246917, 0.00486921, 0.00000499, 0.00000252],
++		[-4.53829014, -0.00476682, 0.00246610, 0.00486275, 0.00000496, 0.00000251],
++		[-4.54242264, -0.00476080, 0.00246306, 0.00485632, 0.00000493, 0.00000249],
++		[-4.54654942, -0.00475480, 0.00246003, 0.00484992, 0.00000490, 0.00000248],
++		[-4.55067046, -0.00474884, 0.00245702, 0.00484354, 0.00000487, 0.00000247],
++		[-4.55478574, -0.00474290, 0.00245404, 0.00483720, 0.00000484, 0.00000245],
++		[-4.55889526, -0.00473698, 0.00245107, 0.00483088, 0.00000481, 0.00000244],
++		[-4.56299899, -0.00473109, 0.00244812, 0.00482459, 0.00000478, 0.00000243],
++		[-4.56709693, -0.00472522, 0.00244520, 0.00481833, 0.00000475, 0.00000242],
++		[-4.57118906, -0.00471938, 0.00244229, 0.00481209, 0.00000472, 0.00000241],
++		[-4.57527536, -0.00471357, 0.00243940, 0.00480588, 0.00000469, 0.00000239],
++		[-4.57935583, -0.00470778, 0.00243654, 0.00479970, 0.00000466, 0.00000238],
++		[-4.58343045, -0.00470201, 0.00243369, 0.00479354, 0.00000463, 0.00000237],
++		[-4.58749921, -0.00469627, 0.00243086, 0.00478741, 0.00000460, 0.00000236],
++		[-4.59156210, -0.00469055, 0.00242805, 0.00478131, 0.00000457, 0.00000235],
++		[-4.59561910, -0.00468485, 0.00242526, 0.00477523, 0.00000454, 0.00000233],
++		[-4.59967020, -0.00467918, 0.00242248, 0.00476918, 0.00000452, 0.00000232],
++		[-4.60371538, -0.00467353, 0.00241973, 0.00476315, 0.00000449, 0.00000231],
++		[-4.60775465, -0.00466791, 0.00241699, 0.00475714, 0.00000446, 0.00000230],
++		[-4.61178797, -0.00466230, 0.00241427, 0.00475116, 0.00000443, 0.00000229],
++		[-4.61581536, -0.00465672, 0.00241157, 0.00474521, 0.00000441, 0.00000228],
++		[-4.61983678, -0.00465116, 0.00240889, 0.00473928, 0.00000438, 0.00000226],
++		[-4.62385223, -0.00464563, 0.00240622, 0.00473337, 0.00000435, 0.00000225],
++		[-4.62786170, -0.00464011, 0.00240357, 0.00472749, 0.00000432, 0.00000224],
++		[-4.63186517, -0.00463462, 0.00240093, 0.00472163, 0.00000430, 0.00000223],
++		[-4.63586264, -0.00462915, 0.00239832, 0.00471580, 0.00000427, 0.00000222],
++		[-4.63985410, -0.00462370, 0.00239572, 0.00470998, 0.00000425, 0.00000221],
++		[-4.64383953, -0.00461827, 0.00239313, 0.00470419, 0.00000422, 0.00000220],
++		[-4.64781892, -0.00461286, 0.00239057, 0.00469843, 0.00000419, 0.00000219],
++		[-4.65179227, -0.00460748, 0.00238802, 0.00469268, 0.00000417, 0.00000217],
++		[-4.65575956, -0.00460211, 0.00238548, 0.00468696, 0.00000414, 0.00000216],
++		[-4.65972078, -0.00459677, 0.00238296, 0.00468126, 0.00000412, 0.00000215],
++		[-4.66367592, -0.00459144, 0.00238046, 0.00467559, 0.00000409, 0.00000214],
++		[-4.66762497, -0.00458614, 0.00237797, 0.00466993, 0.00000407, 0.00000213],
++		[-4.67156793, -0.00458085, 0.00237549, 0.00466430, 0.00000404, 0.00000212],
++		[-4.67550478, -0.00457558, 0.00237303, 0.00465869, 0.00000402, 0.00000211],
++		[-4.67943552, -0.00457034, 0.00237059, 0.00465310, 0.00000399, 0.00000210],
++		[-4.68336012, -0.00456511, 0.00236816, 0.00464753, 0.00000397, 0.00000209],
++		[-4.68727860, -0.00455990, 0.00236575, 0.00464198, 0.00000394, 0.00000208],
++		[-4.69119092, -0.00455472, 0.00236335, 0.00463645, 0.00000392, 0.00000207],
++		[-4.69509710, -0.00454955, 0.00236096, 0.00463095, 0.00000389, 0.00000206],
++		[-4.69899711, -0.00454440, 0.00235859, 0.00462546, 0.00000387, 0.00000205],
++		[-4.70289095, -0.00453926, 0.00235623, 0.00461999, 0.00000385, 0.00000204],
++		[-4.70677861, -0.00453415, 0.00235389, 0.00461455, 0.00000382, 0.00000203],
++		[-4.71066008, -0.00452905, 0.00235156, 0.00460912, 0.00000380, 0.00000202],
++		[-4.71453535, -0.00452398, 0.00234924, 0.00460372, 0.00000378, 0.00000200],
++		[-4.71840442, -0.00451892, 0.00234694, 0.00459833, 0.00000375, 0.00000199],
++		[-4.72226728, -0.00451387, 0.00234465, 0.00459296, 0.00000373, 0.00000198],
++		[-4.72612392, -0.00450885, 0.00234237, 0.00458761, 0.00000371, 0.00000197],
++		[-4.72997433, -0.00450384, 0.00234011, 0.00458229, 0.00000369, 0.00000196],
++		[-4.73381850, -0.00449885, 0.00233786, 0.00457698, 0.00000366, 0.00000195],
++		[-4.73765643, -0.00449388, 0.00233562, 0.00457168, 0.00000364, 0.00000195],
++		[-4.74148810, -0.00448893, 0.00233340, 0.00456641, 0.00000362, 0.00000194],
++		[-4.74531352, -0.00448399, 0.00233119, 0.00456116, 0.00000360, 0.00000193],
++		[-4.74913267, -0.00447907, 0.00232899, 0.00455592, 0.00000357, 0.00000192],
++		[-4.75294555, -0.00447416, 0.00232680, 0.00455071, 0.00000355, 0.00000191],
++		[-4.75675214, -0.00446927, 0.00232462, 0.00454551, 0.00000353, 0.00000190],
++		[-4.76055246, -0.00446440, 0.00232246, 0.00454033, 0.00000351, 0.00000189],
++		[-4.76434647, -0.00445955, 0.00232031, 0.00453516, 0.00000349, 0.00000188],
++		[-4.76813419, -0.00445471, 0.00231816, 0.00453002, 0.00000347, 0.00000187],
++		[-4.77191560, -0.00444988, 0.00231604, 0.00452489, 0.00000344, 0.00000186],
++		[-4.77569070, -0.00444507, 0.00231392, 0.00451978, 0.00000342, 0.00000185],
++		[-4.77945947, -0.00444028, 0.00231181, 0.00451469, 0.00000340, 0.00000184],
++		[-4.78322192, -0.00443550, 0.00230972, 0.00450961, 0.00000338, 0.00000183],
++		[-4.78697804, -0.00443074, 0.00230763, 0.00450455, 0.00000336, 0.00000182],
++		[-4.79072783, -0.00442600, 0.00230556, 0.00449951, 0.00000334, 0.00000181],
++		[-4.79447127, -0.00442127, 0.00230350, 0.00449448, 0.00000332, 0.00000180],
++		[-4.79820836, -0.00441655, 0.00230145, 0.00448947, 0.00000330, 0.00000179],
++		[-4.80193909, -0.00441185, 0.00229941, 0.00448448, 0.00000328, 0.00000178],
++		[-4.80566347, -0.00440716, 0.00229738, 0.00447951, 0.00000326, 0.00000178],
++		[-4.80938148, -0.00440249, 0.00229536, 0.00447454, 0.00000324, 0.00000177],
++		[-4.81309312, -0.00439783, 0.00229335, 0.00446960, 0.00000322, 0.00000176],
++		[-4.81679838, -0.00439319, 0.00229135, 0.00446467, 0.00000320, 0.00000175],
++		[-4.82049726, -0.00438856, 0.00228937, 0.00445976, 0.00000318, 0.00000174],
++		[-4.82418976, -0.00438395, 0.00228739, 0.00445486, 0.00000316, 0.00000173],
++		[-4.82787587, -0.00437935, 0.00228542, 0.00444998, 0.00000314, 0.00000172],
++		[-4.83155558, -0.00437476, 0.00228346, 0.00444512, 0.00000312, 0.00000171],
++		[-4.83522889, -0.00437019, 0.00228151, 0.00444027, 0.00000310, 0.00000171],
++		[-4.83889580, -0.00436563, 0.00227957, 0.00443543, 0.00000308, 0.00000170],
++		[-4.84255630, -0.00436109, 0.00227764, 0.00443061, 0.00000306, 0.00000169],
++		[-4.84621038, -0.00435656, 0.00227572, 0.00442580, 0.00000305, 0.00000168],
++		[-4.84985805, -0.00435204, 0.00227381, 0.00442101, 0.00000303, 0.00000167],
++		[-4.85349930, -0.00434753, 0.00227191, 0.00441624, 0.00000301, 0.00000166],
++		[-4.85713412, -0.00434304, 0.00227002, 0.00441148, 0.00000299, 0.00000165],
++		[-4.86076252, -0.00433856, 0.00226813, 0.00440673, 0.00000297, 0.00000165],
++		[-4.86438448, -0.00433410, 0.00226626, 0.00440200, 0.00000295, 0.00000164],
++		[-4.86800001, -0.00432965, 0.00226439, 0.00439728, 0.00000294, 0.00000163],
++		[-4.87160909, -0.00432521, 0.00226253, 0.00439258, 0.00000292, 0.00000162],
++		[-4.87521174, -0.00432078, 0.00226069, 0.00438789, 0.00000290, 0.00000161],
++		[-4.87880793, -0.00431637, 0.00225885, 0.00438321, 0.00000288, 0.00000161],
++		[-4.88239768, -0.00431196, 0.00225701, 0.00437855, 0.00000286, 0.00000160],
++		[-4.88598098, -0.00430758, 0.00225519, 0.00437390, 0.00000285, 0.00000159],
++		[-4.88955781, -0.00430320, 0.00225338, 0.00436927, 0.00000283, 0.00000158],
++		[-4.89312819, -0.00429883, 0.00225157, 0.00436465, 0.00000281, 0.00000157],
++		[-4.89669211, -0.00429448, 0.00224977, 0.00436004, 0.00000279, 0.00000157],
++		[-4.90024957, -0.00429014, 0.00224798, 0.00435545, 0.00000278, 0.00000156],
++		[-4.90380055, -0.00428581, 0.00224620, 0.00435087, 0.00000276, 0.00000155],
++		[-4.90734507, -0.00428150, 0.00224442, 0.00434630, 0.00000274, 0.00000154],
++		[-4.91088312, -0.00427719, 0.00224266, 0.00434174, 0.00000272, 0.00000153],
++		[-4.91441469, -0.00427290, 0.00224090, 0.00433720, 0.00000271, 0.00000153],
++		[-4.91793978, -0.00426862, 0.00223915, 0.00433267, 0.00000269, 0.00000152],
++		[-4.92145840, -0.00426435, 0.00223740, 0.00432816, 0.00000267, 0.00000151],
++		[-4.92497053, -0.00426009, 0.00223566, 0.00432366, 0.00000266, 0.00000150],
++		[-4.92847618, -0.00425584, 0.00223394, 0.00431916, 0.00000264, 0.00000150],
++		[-4.93197535, -0.00425160, 0.00223221, 0.00431469, 0.00000262, 0.00000149],
++		[-4.93546803, -0.00424738, 0.00223050, 0.00431022, 0.00000261, 0.00000148],
++		[-4.93895423, -0.00424317, 0.00222879, 0.00430577, 0.00000259, 0.00000147],
++		[-4.94243393, -0.00423896, 0.00222709, 0.00430133, 0.00000258, 0.00000147],
++		[-4.94590714, -0.00423477, 0.00222540, 0.00429690, 0.00000256, 0.00000146],
++		[-4.94937386, -0.00423059, 0.00222371, 0.00429248, 0.00000254, 0.00000145],
++		[-4.95283409, -0.00422642, 0.00222203, 0.00428808, 0.00000253, 0.00000144],
++		[-4.95628782, -0.00422226, 0.00222036, 0.00428368, 0.00000251, 0.00000144],
++		[-4.95973505, -0.00421811, 0.00221869, 0.00427930, 0.00000250, 0.00000143],
++		[-4.96317579, -0.00421397, 0.00221703, 0.00427493, 0.00000248, 0.00000142],
++		[-4.96661002, -0.00420984, 0.00221538, 0.00427058, 0.00000246, 0.00000142],
++		[-4.97003776, -0.00420573, 0.00221373, 0.00426623, 0.00000245, 0.00000141],
++		[-4.97345900, -0.00420162, 0.00221209, 0.00426189, 0.00000243, 0.00000140],
++		[-4.97687374, -0.00419752, 0.00221046, 0.00425757, 0.00000242, 0.00000139],
++		[-4.98028197, -0.00419344, 0.00220883, 0.00425326, 0.00000240, 0.00000139],
++		[-4.98368371, -0.00418936, 0.00220721, 0.00424896, 0.00000239, 0.00000138],
++		[-4.98707894, -0.00418529, 0.00220559, 0.00424467, 0.00000237, 0.00000137],
++		[-4.99046767, -0.00418123, 0.00220398, 0.00424039, 0.00000236, 0.00000137],
++		[-4.99384989, -0.00417719, 0.00220238, 0.00423612, 0.00000234, 0.00000136],
++		[-4.99722561, -0.00417315, 0.00220078, 0.00423187, 0.00000233, 0.00000135],
++		[-5.00059483, -0.00416912, 0.00219919, 0.00422762, 0.00000231, 0.00000135],
++		[-5.00395754, -0.00416511, 0.00219761, 0.00422339, 0.00000230, 0.00000134],
++		[-5.00731375, -0.00416110, 0.00219603, 0.00421916, 0.00000228, 0.00000133],
++		[-5.01066346, -0.00415710, 0.00219445, 0.00421495, 0.00000227, 0.00000133],
++		[-5.01400667, -0.00415311, 0.00219288, 0.00421075, 0.00000226, 0.00000132],
++		[-5.01734337, -0.00414913, 0.00219132, 0.00420655, 0.00000224, 0.00000131],
++		[-5.02067356, -0.00414516, 0.00218976, 0.00420237, 0.00000223, 0.00000131],
++		[-5.02399726, -0.00414120, 0.00218821, 0.00419820, 0.00000221, 0.00000130],
++		[-5.02731445, -0.00413724, 0.00218666, 0.00419404, 0.00000220, 0.00000129],
++		[-5.03062515, -0.00413330, 0.00218512, 0.00418989, 0.00000218, 0.00000129],
++		[-5.03392934, -0.00412937, 0.00218359, 0.00418574, 0.00000217, 0.00000128],
++		[-5.03722703, -0.00412544, 0.00218206, 0.00418161, 0.00000216, 0.00000127],
++		[-5.04051822, -0.00412153, 0.00218053, 0.00417749, 0.00000214, 0.00000127],
++		[-5.04380292, -0.00411762, 0.00217901, 0.00417338, 0.00000213, 0.00000126],
++		[-5.04708112, -0.00411372, 0.00217750, 0.00416928, 0.00000212, 0.00000125],
++		[-5.05035282, -0.00410983, 0.00217599, 0.00416519, 0.00000210, 0.00000125],
++		[-5.05361802, -0.00410595, 0.00217448, 0.00416111, 0.00000209, 0.00000124],
++		[-5.05687674, -0.00410208, 0.00217298, 0.00415703, 0.00000207, 0.00000124],
++		[-5.06012896, -0.00409821, 0.00217148, 0.00415297, 0.00000206, 0.00000123],
++		[-5.06337469, -0.00409436, 0.00216999, 0.00414892, 0.00000205, 0.00000122],
++		[-5.06661393, -0.00409051, 0.00216851, 0.00414488, 0.00000203, 0.00000122],
++		[-5.06984668, -0.00408668, 0.00216703, 0.00414084, 0.00000202, 0.00000121],
++		[-5.07307294, -0.00408285, 0.00216555, 0.00413682, 0.00000201, 0.00000121],
++		[-5.07629272, -0.00407902, 0.00216408, 0.00413280, 0.00000199, 0.00000120],
++		[-5.07950602, -0.00407521, 0.00216261, 0.00412880, 0.00000198, 0.00000119],
++		[-5.08271283, -0.00407141, 0.00216115, 0.00412480, 0.00000197, 0.00000119],
++		[-5.08591317, -0.00406761, 0.00215969, 0.00412081, 0.00000196, 0.00000118],
++		[-5.08910703, -0.00406382, 0.00215823, 0.00411683, 0.00000194, 0.00000118],
++		[-5.09229441, -0.00406004, 0.00215678, 0.00411286, 0.00000193, 0.00000117],
++		[-5.09547532, -0.00405627, 0.00215534, 0.00410890, 0.00000192, 0.00000116],
++		[-5.09864975, -0.00405250, 0.00215390, 0.00410495, 0.00000191, 0.00000116],
++		[-5.10181772, -0.00404874, 0.00215246, 0.00410101, 0.00000189, 0.00000115],
++		[-5.10497922, -0.00404500, 0.00215102, 0.00409707, 0.00000188, 0.00000115],
++		[-5.10813425, -0.00404125, 0.00214960, 0.00409315, 0.00000187, 0.00000114],
++		[-5.11128282, -0.00403752, 0.00214817, 0.00408923, 0.00000186, 0.00000114],
++		[-5.11442494, -0.00403379, 0.00214675, 0.00408532, 0.00000184, 0.00000113],
++		[-5.11756059, -0.00403008, 0.00214533, 0.00408142, 0.00000183, 0.00000112],
++		[-5.12068979, -0.00402637, 0.00214392, 0.00407753, 0.00000182, 0.00000112],
++		[-5.12381254, -0.00402266, 0.00214251, 0.00407365, 0.00000181, 0.00000111],
++		[-5.12692884, -0.00401897, 0.00214110, 0.00406978, 0.00000179, 0.00000111],
++		[-5.13003869, -0.00401528, 0.00213970, 0.00406591, 0.00000178, 0.00000110],
++		[-5.13314210, -0.00401160, 0.00213831, 0.00406205, 0.00000177, 0.00000110],
++		[-5.13623906, -0.00400792, 0.00213691, 0.00405820, 0.00000176, 0.00000109],
++		[-5.13932959, -0.00400426, 0.00213552, 0.00405436, 0.00000175, 0.00000109],
++		[-5.14241368, -0.00400060, 0.00213413, 0.00405053, 0.00000173, 0.00000108],
++		[-5.14549135, -0.00399695, 0.00213275, 0.00404670, 0.00000172, 0.00000107],
++		[-5.14856258, -0.00399330, 0.00213137, 0.00404289, 0.00000171, 0.00000107],
++		[-5.15162739, -0.00398967, 0.00213000, 0.00403908, 0.00000170, 0.00000106],
++		[-5.15468577, -0.00398604, 0.00212862, 0.00403528, 0.00000169, 0.00000106],
++		[-5.15773774, -0.00398241, 0.00212725, 0.00403148, 0.00000168, 0.00000105],
++		[-5.16078329, -0.00397880, 0.00212589, 0.00402770, 0.00000167, 0.00000105],
++		[-5.16382243, -0.00397519, 0.00212453, 0.00402392, 0.00000165, 0.00000104],
++		[-5.16685516, -0.00397159, 0.00212317, 0.00402015, 0.00000164, 0.00000104],
++		[-5.16988149, -0.00396799, 0.00212181, 0.00401639, 0.00000163, 0.00000103],
++		[-5.17290141, -0.00396440, 0.00212046, 0.00401264, 0.00000162, 0.00000103],
++		[-5.17591494, -0.00396082, 0.00211911, 0.00400889, 0.00000161, 0.00000102],
++		[-5.17892208, -0.00395724, 0.00211776, 0.00400515, 0.00000160, 0.00000102],
++		[-5.18192282, -0.00395368, 0.00211642, 0.00400142, 0.00000159, 0.00000101],
++		[-5.18491718, -0.00395011, 0.00211508, 0.00399770, 0.00000158, 0.00000101],
++		[-5.18790516, -0.00394656, 0.00211374, 0.00399398, 0.00000156, 0.00000100],
++		[-5.19088675, -0.00394301, 0.00211241, 0.00399027, 0.00000155, 0.00000100],
++		[-5.19386198, -0.00393947, 0.00211108, 0.00398657, 0.00000154, 0.00000099],
++		[-5.19683083, -0.00393593, 0.00210975, 0.00398288, 0.00000153, 0.00000099],
++		[-5.19979332, -0.00393241, 0.00210843, 0.00397919, 0.00000152, 0.00000098],
++		[-5.20274945, -0.00392888, 0.00210710, 0.00397551, 0.00000151, 0.00000098],
++		[-5.20569922, -0.00392537, 0.00210578, 0.00397184, 0.00000150, 0.00000097],
++		[-5.20864264, -0.00392186, 0.00210447, 0.00396817, 0.00000149, 0.00000097],
++		[-5.21157971, -0.00391835, 0.00210315, 0.00396451, 0.00000148, 0.00000096],
++		[-5.21451043, -0.00391486, 0.00210184, 0.00396086, 0.00000147, 0.00000096],
++		[-5.21743482, -0.00391137, 0.00210054, 0.00395722, 0.00000146, 0.00000095],
++		[-5.22035287, -0.00390788, 0.00209923, 0.00395358, 0.00000145, 0.00000095],
++		[-5.22326459, -0.00390440, 0.00209793, 0.00394995, 0.00000144, 0.00000094],
++		[-5.22616999, -0.00390093, 0.00209663, 0.00394633, 0.00000143, 0.00000094],
++		[-5.22906906, -0.00389747, 0.00209533, 0.00394271, 0.00000142, 0.00000093],
++		[-5.23196182, -0.00389401, 0.00209404, 0.00393910, 0.00000141, 0.00000093],
++		[-5.23484826, -0.00389055, 0.00209274, 0.00393550, 0.00000140, 0.00000093],
++		[-5.23772840, -0.00388711, 0.00209145, 0.00393191, 0.00000139, 0.00000092],
++		[-5.24060224, -0.00388366, 0.00209017, 0.00392832, 0.00000138, 0.00000092],
++		[-5.24346978, -0.00388023, 0.00208888, 0.00392473, 0.00000137, 0.00000091],
++		[-5.24633103, -0.00387680, 0.00208760, 0.00392116, 0.00000136, 0.00000091],
++		[-5.24918599, -0.00387338, 0.00208632, 0.00391759, 0.00000135, 0.00000090],
++		[-5.25203467, -0.00386996, 0.00208504, 0.00391403, 0.00000134, 0.00000090],
++		[-5.25487707, -0.00386655, 0.00208377, 0.00391047, 0.00000133, 0.00000089],
++		[-5.25771320, -0.00386314, 0.00208250, 0.00390692, 0.00000132, 0.00000089],
++		[-5.26054307, -0.00385974, 0.00208123, 0.00390338, 0.00000131, 0.00000088],
++		[-5.26336668, -0.00385634, 0.00207996, 0.00389984, 0.00000130, 0.00000088],
++		[-5.26618402, -0.00385295, 0.00207869, 0.00389631, 0.00000129, 0.00000088],
++		[-5.26899512, -0.00384957, 0.00207743, 0.00389279, 0.00000128, 0.00000087],
++		[-5.27179998, -0.00384619, 0.00207617, 0.00388927, 0.00000127, 0.00000087],
++		[-5.27459860, -0.00384282, 0.00207491, 0.00388576, 0.00000126, 0.00000086],
++		[-5.27739098, -0.00383945, 0.00207365, 0.00388226, 0.00000125, 0.00000086],
++		[-5.28017713, -0.00383609, 0.00207240, 0.00387876, 0.00000124, 0.00000085],
++		[-5.28295706, -0.00383274, 0.00207115, 0.00387527, 0.00000123, 0.00000085],
++		[-5.28573078, -0.00382939, 0.00206989, 0.00387178, 0.00000122, 0.00000085],
++		[-5.28849828, -0.00382604, 0.00206865, 0.00386830, 0.00000121, 0.00000084],
++		[-5.29125958, -0.00382271, 0.00206740, 0.00386483, 0.00000120, 0.00000084],
++		[-5.29401468, -0.00381937, 0.00206616, 0.00386136, 0.00000119, 0.00000083],
++		[-5.29676358, -0.00381604, 0.00206491, 0.00385790, 0.00000118, 0.00000083],
++		[-5.29950630, -0.00381272, 0.00206367, 0.00385445, 0.00000118, 0.00000083],
++		[-5.30224283, -0.00380940, 0.00206243, 0.00385100, 0.00000117, 0.00000082],
++		[-5.30497319, -0.00380609, 0.00206120, 0.00384755, 0.00000116, 0.00000082],
++		[-5.30769738, -0.00380279, 0.00205996, 0.00384412, 0.00000115, 0.00000081],
++		[-5.31041540, -0.00379948, 0.00205873, 0.00384068, 0.00000114, 0.00000081],
++		[-5.31312727, -0.00379619, 0.00205750, 0.00383726, 0.00000113, 0.00000081],
++		[-5.31583299, -0.00379290, 0.00205627, 0.00383384, 0.00000112, 0.00000080],
++		[-5.31853255, -0.00378961, 0.00205504, 0.00383043, 0.00000111, 0.00000080],
++		[-5.32122598, -0.00378633, 0.00205382, 0.00382702, 0.00000110, 0.00000079],
++		[-5.32391328, -0.00378306, 0.00205259, 0.00382362, 0.00000110, 0.00000079],
++		[-5.32659445, -0.00377979, 0.00205137, 0.00382022, 0.00000109, 0.00000079],
++		[-5.32926950, -0.00377652, 0.00205015, 0.00381683, 0.00000108, 0.00000078],
++		[-5.33193843, -0.00377326, 0.00204893, 0.00381344, 0.00000107, 0.00000078],
++		[-5.33460126, -0.00377000, 0.00204772, 0.00381006, 0.00000106, 0.00000077],
++		[-5.33725798, -0.00376675, 0.00204650, 0.00380669, 0.00000105, 0.00000077],
++		[-5.33990861, -0.00376351, 0.00204529, 0.00380332, 0.00000104, 0.00000077],
++		[-5.34255316, -0.00376027, 0.00204408, 0.00379996, 0.00000103, 0.00000076],
++		[-5.34519162, -0.00375703, 0.00204287, 0.00379660, 0.00000103, 0.00000076],
++		[-5.34782400, -0.00375380, 0.00204166, 0.00379325, 0.00000102, 0.00000075],
++		[-5.35045032, -0.00375058, 0.00204045, 0.00378991, 0.00000101, 0.00000075],
++		[-5.35307057, -0.00374736, 0.00203925, 0.00378657, 0.00000100, 0.00000075],
++		[-5.35568477, -0.00374414, 0.00203804, 0.00378323, 0.00000099, 0.00000074],
++		[-5.35829292, -0.00374093, 0.00203684, 0.00377990, 0.00000098, 0.00000074],
++		[-5.36089503, -0.00373773, 0.00203564, 0.00377658, 0.00000098, 0.00000074],
++		[-5.36349110, -0.00373453, 0.00203444, 0.00377326, 0.00000097, 0.00000073],
++		[-5.36608114, -0.00373133, 0.00203324, 0.00376994, 0.00000096, 0.00000073],
++		[-5.36866517, -0.00372814, 0.00203205, 0.00376664, 0.00000095, 0.00000073],
++		[-5.37124318, -0.00372495, 0.00203085, 0.00376333, 0.00000094, 0.00000072],
++		[-5.37381518, -0.00372177, 0.00202966, 0.00376004, 0.00000094, 0.00000072],
++		[-5.37638118, -0.00371859, 0.00202847, 0.00375674, 0.00000093, 0.00000071],
++		[-5.37894119, -0.00371542, 0.00202728, 0.00375346, 0.00000092, 0.00000071],
++		[-5.38149521, -0.00371225, 0.00202609, 0.00375018, 0.00000091, 0.00000071],
++		[-5.38404325, -0.00370909, 0.00202490, 0.00374690, 0.00000090, 0.00000070],
++		[-5.38658532, -0.00370593, 0.00202371, 0.00374363, 0.00000090, 0.00000070],
++		[-5.38912142, -0.00370278, 0.00202253, 0.00374036, 0.00000089, 0.00000070],
++		[-5.39165157, -0.00369963, 0.00202134, 0.00373710, 0.00000088, 0.00000069],
++		[-5.39417576, -0.00369648, 0.00202016, 0.00373385, 0.00000087, 0.00000069],
++		[-5.39669401, -0.00369334, 0.00201898, 0.00373059, 0.00000087, 0.00000069],
++		[-5.39920633, -0.00369021, 0.00201780, 0.00372735, 0.00000086, 0.00000068],
++		[-5.40171272, -0.00368707, 0.00201662, 0.00372411, 0.00000085, 0.00000068],
++		[-5.40421318, -0.00368395, 0.00201544, 0.00372087, 0.00000084, 0.00000068],
++		[-5.40670773, -0.00368082, 0.00201427, 0.00371764, 0.00000083, 0.00000067],
++		[-5.40919637, -0.00367771, 0.00201309, 0.00371442, 0.00000083, 0.00000067],
++		[-5.41167912, -0.00367459, 0.00201192, 0.00371119, 0.00000082, 0.00000067],
++		[-5.41415597, -0.00367148, 0.00201075, 0.00370798, 0.00000081, 0.00000066],
++		[-5.41662693, -0.00366838, 0.00200957, 0.00370477, 0.00000080, 0.00000066],
++		[-5.41909202, -0.00366528, 0.00200840, 0.00370156, 0.00000080, 0.00000066],
++		[-5.42155124, -0.00366218, 0.00200724, 0.00369836, 0.00000079, 0.00000065],
++		[-5.42400460, -0.00365909, 0.00200607, 0.00369516, 0.00000078, 0.00000065],
++		[-5.42645210, -0.00365600, 0.00200490, 0.00369197, 0.00000077, 0.00000065],
++		[-5.42889376, -0.00365292, 0.00200374, 0.00368879, 0.00000077, 0.00000064],
++		[-5.43132958, -0.00364984, 0.00200257, 0.00368560, 0.00000076, 0.00000064],
++		[-5.43375956, -0.00364677, 0.00200141, 0.00368243, 0.00000075, 0.00000064],
++		[-5.43618372, -0.00364370, 0.00200024, 0.00367926, 0.00000075, 0.00000063],
++		[-5.43860207, -0.00364063, 0.00199908, 0.00367609, 0.00000074, 0.00000063],
++		[-5.44101460, -0.00363757, 0.00199792, 0.00367293, 0.00000073, 0.00000063],
++		[-5.44342134, -0.00363451, 0.00199676, 0.00366977, 0.00000072, 0.00000063],
++		[-5.44582228, -0.00363146, 0.00199561, 0.00366661, 0.00000072, 0.00000062],
++		[-5.44821744, -0.00362841, 0.00199445, 0.00366346, 0.00000071, 0.00000062],
++		[-5.45060682, -0.00362536, 0.00199329, 0.00366032, 0.00000070, 0.00000062],
++		[-5.45299043, -0.00362232, 0.00199214, 0.00365718, 0.00000070, 0.00000061],
++		[-5.45536828, -0.00361929, 0.00199098, 0.00365405, 0.00000069, 0.00000061],
++		[-5.45774037, -0.00361625, 0.00198983, 0.00365092, 0.00000068, 0.00000061],
++		[-5.46010672, -0.00361323, 0.00198868, 0.00364779, 0.00000067, 0.00000060],
++		[-5.46246734, -0.00361020, 0.00198753, 0.00364467, 0.00000067, 0.00000060],
++		[-5.46482222, -0.00360718, 0.00198638, 0.00364155, 0.00000066, 0.00000060],
++		[-5.46717138, -0.00360417, 0.00198523, 0.00363844, 0.00000065, 0.00000060],
++		[-5.46951483, -0.00360115, 0.00198408, 0.00363533, 0.00000065, 0.00000059],
++		[-5.47185257, -0.00359814, 0.00198293, 0.00363223, 0.00000064, 0.00000059],
++		[-5.47418461, -0.00359514, 0.00198178, 0.00362913, 0.00000063, 0.00000059],
++		[-5.47651097, -0.00359214, 0.00198064, 0.00362604, 0.00000063, 0.00000058],
++		[-5.47883164, -0.00358914, 0.00197949, 0.00362295, 0.00000062, 0.00000058],
++		[-5.48114664, -0.00358615, 0.00197835, 0.00361986, 0.00000061, 0.00000058],
++		[-5.48345598, -0.00358316, 0.00197721, 0.00361678, 0.00000061, 0.00000058],
++		[-5.48575966, -0.00358018, 0.00197606, 0.00361370, 0.00000060, 0.00000057],
++		[-5.48805769, -0.00357720, 0.00197492, 0.00361063, 0.00000059, 0.00000057],
++		[-5.49035007, -0.00357422, 0.00197378, 0.00360756, 0.00000059, 0.00000057],
++		[-5.49263683, -0.00357125, 0.00197264, 0.00360450, 0.00000058, 0.00000056],
++		[-5.49491797, -0.00356828, 0.00197150, 0.00360144, 0.00000057, 0.00000056],
++		[-5.49719348, -0.00356532, 0.00197036, 0.00359839, 0.00000057, 0.00000056],
++		[-5.49946339, -0.00356236, 0.00196923, 0.00359534, 0.00000056, 0.00000056],
++		[-5.50172771, -0.00355940, 0.00196809, 0.00359229, 0.00000056, 0.00000055],
++		[-5.50398643, -0.00355645, 0.00196695, 0.00358925, 0.00000055, 0.00000055],
++		[-5.50623957, -0.00355350, 0.00196582, 0.00358621, 0.00000054, 0.00000055],
++		[-5.50848713, -0.00355055, 0.00196468, 0.00358318, 0.00000054, 0.00000054],
++		[-5.51072913, -0.00354761, 0.00196355, 0.00358015, 0.00000053, 0.00000054],
++		[-5.51296557, -0.00354467, 0.00196242, 0.00357712, 0.00000052, 0.00000054],
++		[-5.51519647, -0.00354174, 0.00196129, 0.00357410, 0.00000052, 0.00000054],
++		[-5.51742182, -0.00353881, 0.00196016, 0.00357108, 0.00000051, 0.00000053],
++		[-5.51964164, -0.00353588, 0.00195902, 0.00356807, 0.00000050, 0.00000053],
++		[-5.52185594, -0.00353296, 0.00195789, 0.00356506, 0.00000050, 0.00000053],
++		[-5.52406473, -0.00353004, 0.00195677, 0.00356206, 0.00000049, 0.00000053],
++		[-5.52626800, -0.00352712, 0.00195564, 0.00355906, 0.00000049, 0.00000052],
++		[-5.52846578, -0.00352421, 0.00195451, 0.00355606, 0.00000048, 0.00000052],
++		[-5.53065808, -0.00352130, 0.00195338, 0.00355307, 0.00000047, 0.00000052],
++		[-5.53284489, -0.00351840, 0.00195226, 0.00355008, 0.00000047, 0.00000052],
++		[-5.53502623, -0.00351550, 0.00195113, 0.00354710, 0.00000046, 0.00000051],
++		[-5.53720210, -0.00351260, 0.00195001, 0.00354412, 0.00000046, 0.00000051],
++		[-5.53937252, -0.00350971, 0.00194888, 0.00354114, 0.00000045, 0.00000051],
++		[-5.54153750, -0.00350682, 0.00194776, 0.00353817, 0.00000044, 0.00000051],
++		[-5.54369704, -0.00350393, 0.00194663, 0.00353520, 0.00000044, 0.00000050],
++		[-5.54585115, -0.00350105, 0.00194551, 0.00353224, 0.00000043, 0.00000050],
++		[-5.54799984, -0.00349817, 0.00194439, 0.00352928, 0.00000043, 0.00000050],
++		[-5.55014311, -0.00349529, 0.00194327, 0.00352632, 0.00000042, 0.00000050],
++		[-5.55228099, -0.00349242, 0.00194215, 0.00352337, 0.00000041, 0.00000049],
++		[-5.55441347, -0.00348955, 0.00194103, 0.00352042, 0.00000041, 0.00000049],
++		[-5.55654057, -0.00348669, 0.00193991, 0.00351748, 0.00000040, 0.00000049],
++		[-5.55866229, -0.00348383, 0.00193879, 0.00351454, 0.00000040, 0.00000049],
++		[-5.56077864, -0.00348097, 0.00193767, 0.00351160, 0.00000039, 0.00000048],
++		[-5.56288964, -0.00347811, 0.00193655, 0.00350867, 0.00000039, 0.00000048],
++		[-5.56499528, -0.00347526, 0.00193544, 0.00350574, 0.00000038, 0.00000048],
++		[-5.56709558, -0.00347242, 0.00193432, 0.00350282, 0.00000037, 0.00000048],
++		[-5.56919055, -0.00346957, 0.00193321, 0.00349990, 0.00000037, 0.00000047],
++		[-5.57128020, -0.00346673, 0.00193209, 0.00349698, 0.00000036, 0.00000047],
++		[-5.57336453, -0.00346390, 0.00193098, 0.00349407, 0.00000036, 0.00000047],
++		[-5.57544356, -0.00346106, 0.00192986, 0.00349116, 0.00000035, 0.00000047],
++		[-5.57751729, -0.00345823, 0.00192875, 0.00348825, 0.00000035, 0.00000047],
++		[-5.57958573, -0.00345541, 0.00192764, 0.00348535, 0.00000034, 0.00000046],
++		[-5.58164889, -0.00345259, 0.00192652, 0.00348245, 0.00000033, 0.00000046],
++		[-5.58370679, -0.00344977, 0.00192541, 0.00347956, 0.00000033, 0.00000046],
++		[-5.58575942, -0.00344695, 0.00192430, 0.00347667, 0.00000032, 0.00000046],
++		[-5.58780679, -0.00344414, 0.00192319, 0.00347378, 0.00000032, 0.00000045],
++		[-5.58984893, -0.00344133, 0.00192208, 0.00347090, 0.00000031, 0.00000045],
++		[-5.59188583, -0.00343852, 0.00192097, 0.00346802, 0.00000031, 0.00000045],
++		[-5.59391750, -0.00343572, 0.00191986, 0.00346515, 0.00000030, 0.00000045],
++		[-5.59594396, -0.00343292, 0.00191875, 0.00346228, 0.00000030, 0.00000045],
++		[-5.59796521, -0.00343013, 0.00191764, 0.00345941, 0.00000029, 0.00000044],
++		[-5.59998126, -0.00342733, 0.00191653, 0.00345654, 0.00000029, 0.00000044],
++		[-5.60199212, -0.00342455, 0.00191543, 0.00345368, 0.00000028, 0.00000044],
++		[-5.60399781, -0.00342176, 0.00191432, 0.00345083, 0.00000028, 0.00000044],
++		[-5.60599831, -0.00341898, 0.00191321, 0.00344797, 0.00000027, 0.00000043],
++		[-5.60799366, -0.00341620, 0.00191211, 0.00344513, 0.00000026, 0.00000043],
++		[-5.60998385, -0.00341342, 0.00191100, 0.00344228, 0.00000026, 0.00000043],
++		[-5.61196890, -0.00341065, 0.00190990, 0.00343944, 0.00000025, 0.00000043],
++		[-5.61394881, -0.00340788, 0.00190879, 0.00343660, 0.00000025, 0.00000043],
++		[-5.61592360, -0.00340512, 0.00190769, 0.00343376, 0.00000024, 0.00000042],
++		[-5.61789327, -0.00340235, 0.00190659, 0.00343093, 0.00000024, 0.00000042],
++		[-5.61985783, -0.00339960, 0.00190548, 0.00342811, 0.00000023, 0.00000042],
++		[-5.62181729, -0.00339684, 0.00190438, 0.00342528, 0.00000023, 0.00000042],
++		[-5.62377166, -0.00339409, 0.00190328, 0.00342246, 0.00000022, 0.00000042],
++		[-5.62572095, -0.00339134, 0.00190218, 0.00341964, 0.00000022, 0.00000041],
++		[-5.62766517, -0.00338859, 0.00190108, 0.00341683, 0.00000021, 0.00000041],
++		[-5.62960432, -0.00338585, 0.00189998, 0.00341402, 0.00000021, 0.00000041],
++		[-5.63153842, -0.00338311, 0.00189888, 0.00341122, 0.00000020, 0.00000041],
++		[-5.63346748, -0.00338037, 0.00189778, 0.00340841, 0.00000020, 0.00000041],
++		[-5.63539150, -0.00337764, 0.00189668, 0.00340561, 0.00000019, 0.00000040],
++		[-5.63731050, -0.00337491, 0.00189558, 0.00340282, 0.00000019, 0.00000040],
++		[-5.63922447, -0.00337218, 0.00189448, 0.00340003, 0.00000018, 0.00000040],
++		[-5.64113344, -0.00336946, 0.00189338, 0.00339724, 0.00000018, 0.00000040],
++		[-5.64303741, -0.00336674, 0.00189229, 0.00339445, 0.00000017, 0.00000040],
++		[-5.64493639, -0.00336402, 0.00189119, 0.00339167, 0.00000017, 0.00000039],
++		[-5.64683039, -0.00336131, 0.00189009, 0.00338889, 0.00000016, 0.00000039],
++		[-5.64871942, -0.00335860, 0.00188899, 0.00338612, 0.00000016, 0.00000039],
++		[-5.65060348, -0.00335589, 0.00188790, 0.00338335, 0.00000015, 0.00000039],
++		[-5.65248259, -0.00335319, 0.00188680, 0.00338058, 0.00000015, 0.00000039],
++		[-5.65435676, -0.00335049, 0.00188571, 0.00337781, 0.00000014, 0.00000038],
++		[-5.65622600, -0.00334779, 0.00188461, 0.00337505, 0.00000014, 0.00000038],
++		[-5.65809030, -0.00334509, 0.00188352, 0.00337229, 0.00000013, 0.00000038],
++		[-5.65994970, -0.00334240, 0.00188243, 0.00336954, 0.00000013, 0.00000038],
++		[-5.66180418, -0.00333971, 0.00188133, 0.00336679, 0.00000013, 0.00000038],
++		[-5.66365377, -0.00333703, 0.00188024, 0.00336404, 0.00000012, 0.00000038],
++		[-5.66549846, -0.00333434, 0.00187915, 0.00336130, 0.00000012, 0.00000037],
++		[-5.66733828, -0.00333166, 0.00187805, 0.00335856, 0.00000011, 0.00000037],
++		[-5.66917323, -0.00332899, 0.00187696, 0.00335582, 0.00000011, 0.00000037],
++		[-5.67100331, -0.00332631, 0.00187587, 0.00335309, 0.00000010, 0.00000037],
++		[-5.67282855, -0.00332364, 0.00187478, 0.00335035, 0.00000010, 0.00000037],
++		[-5.67464894, -0.00332098, 0.00187369, 0.00334763, 0.00000009, 0.00000036],
++		[-5.67646450, -0.00331831, 0.00187260, 0.00334490, 0.00000009, 0.00000036],
++		[-5.67827523, -0.00331565, 0.00187151, 0.00334218, 0.00000008, 0.00000036],
++		[-5.68008115, -0.00331299, 0.00187042, 0.00333947, 0.00000008, 0.00000036],
++		[-5.68188226, -0.00331034, 0.00186933, 0.00333675, 0.00000007, 0.00000036],
++		[-5.68367858, -0.00330769, 0.00186824, 0.00333404, 0.00000007, 0.00000036],
++		[-5.68547011, -0.00330504, 0.00186715, 0.00333133, 0.00000007, 0.00000035],
++		[-5.68725686, -0.00330239, 0.00186606, 0.00332863, 0.00000006, 0.00000035],
++		[-5.68903884, -0.00329975, 0.00186498, 0.00332593, 0.00000006, 0.00000035],
++		[-5.69081606, -0.00329711, 0.00186389, 0.00332323, 0.00000005, 0.00000035],
++		[-5.69258853, -0.00329447, 0.00186280, 0.00332054, 0.00000005, 0.00000035],
++		[-5.69435627, -0.00329184, 0.00186172, 0.00331785, 0.00000004, 0.00000035],
++		[-5.69611926, -0.00328921, 0.00186063, 0.00331516, 0.00000004, 0.00000034],
++		[-5.69787754, -0.00328658, 0.00185954, 0.00331247, 0.00000003, 0.00000034],
++		[-5.69963110, -0.00328396, 0.00185846, 0.00330979, 0.00000003, 0.00000034],
++		[-5.70137996, -0.00328133, 0.00185737, 0.00330711, 0.00000003, 0.00000034],
++		[-5.70312413, -0.00327872, 0.00185629, 0.00330444, 0.00000002, 0.00000034],
++		[-5.70486360, -0.00327610, 0.00185520, 0.00330177, 0.00000002, 0.00000034],
++		[-5.70659840, -0.00327349, 0.00185412, 0.00329910, 0.00000001, 0.00000033],
++		[-5.70832854, -0.00327088, 0.00185304, 0.00329643, 0.00000001, 0.00000033],
++		[-5.71005402, -0.00326827, 0.00185195, 0.00329377, 0.00000000, 0.00000033],
++		[-5.71177484, -0.00326567, 0.00185087, 0.00329111, 0.00000000, 0.00000033],
++		[-5.71349103, -0.00326306, 0.00184979, 0.00328846, -0.00000000, 0.00000033],
++		[-5.71520259, -0.00326047, 0.00184870, 0.00328580, -0.00000001, 0.00000033],
++		[-5.71690953, -0.00325787, 0.00184762, 0.00328316, -0.00000001, 0.00000032],
++		[-5.71861185, -0.00325528, 0.00184654, 0.00328051, -0.00000002, 0.00000032],
++		[-5.72030958, -0.00325269, 0.00184546, 0.00327787, -0.00000002, 0.00000032],
++		[-5.72200271, -0.00325010, 0.00184438, 0.00327523, -0.00000002, 0.00000032],
++		[-5.72369126, -0.00324752, 0.00184330, 0.00327259, -0.00000003, 0.00000032],
++		[-5.72537523, -0.00324494, 0.00184222, 0.00326996, -0.00000003, 0.00000032],
++		[-5.72705463, -0.00324236, 0.00184114, 0.00326733, -0.00000004, 0.00000032],
++		[-5.72872948, -0.00323979, 0.00184006, 0.00326470, -0.00000004, 0.00000031],
++		[-5.73039979, -0.00323721, 0.00183898, 0.00326207, -0.00000005, 0.00000031],
++		[-5.73206555, -0.00323464, 0.00183790, 0.00325945, -0.00000005, 0.00000031],
++		[-5.73372679, -0.00323208, 0.00183682, 0.00325683, -0.00000005, 0.00000031],
++		[-5.73538351, -0.00322952, 0.00183574, 0.00325422, -0.00000006, 0.00000031],
++		[-5.73703572, -0.00322695, 0.00183466, 0.00325161, -0.00000006, 0.00000031],
++		[-5.73868343, -0.00322440, 0.00183359, 0.00324900, -0.00000007, 0.00000030],
++		[-5.74032664, -0.00322184, 0.00183251, 0.00324639, -0.00000007, 0.00000030],
++		[-5.74196538, -0.00321929, 0.00183143, 0.00324379, -0.00000007, 0.00000030],
++		[-5.74359964, -0.00321674, 0.00183036, 0.00324119, -0.00000008, 0.00000030],
++		[-5.74522943, -0.00321419, 0.00182928, 0.00323859, -0.00000008, 0.00000030],
++		[-5.74685478, -0.00321165, 0.00182820, 0.00323600, -0.00000009, 0.00000030],
++		[-5.74847567, -0.00320911, 0.00182713, 0.00323341, -0.00000009, 0.00000030],
++		[-5.75009213, -0.00320657, 0.00182605, 0.00323082, -0.00000009, 0.00000029],
++		[-5.75170417, -0.00320404, 0.00182498, 0.00322824, -0.00000010, 0.00000029],
++		[-5.75331179, -0.00320151, 0.00182390, 0.00322566, -0.00000010, 0.00000029],
++		[-5.75491499, -0.00319898, 0.00182283, 0.00322308, -0.00000010, 0.00000029],
++		[-5.75651380, -0.00319645, 0.00182176, 0.00322050, -0.00000011, 0.00000029],
++		[-5.75810822, -0.00319393, 0.00182068, 0.00321793, -0.00000011, 0.00000029],
++		[-5.75969826, -0.00319141, 0.00181961, 0.00321536, -0.00000012, 0.00000029],
++		[-5.76128392, -0.00318889, 0.00181854, 0.00321280, -0.00000012, 0.00000028],
++		[-5.76286523, -0.00318637, 0.00181746, 0.00321023, -0.00000012, 0.00000028],
++		[-5.76444218, -0.00318386, 0.00181639, 0.00320767, -0.00000013, 0.00000028],
++		[-5.76601479, -0.00318135, 0.00181532, 0.00320512, -0.00000013, 0.00000028],
++		[-5.76758306, -0.00317884, 0.00181425, 0.00320256, -0.00000013, 0.00000028],
++		[-5.76914700, -0.00317634, 0.00181318, 0.00320001, -0.00000014, 0.00000028],
++		[-5.77070663, -0.00317384, 0.00181210, 0.00319746, -0.00000014, 0.00000028],
++		[-5.77226195, -0.00317134, 0.00181103, 0.00319492, -0.00000015, 0.00000028],
++		[-5.77381298, -0.00316884, 0.00180996, 0.00319237, -0.00000015, 0.00000027],
++		[-5.77535971, -0.00316635, 0.00180889, 0.00318984, -0.00000015, 0.00000027],
++		[-5.77690216, -0.00316386, 0.00180782, 0.00318730, -0.00000016, 0.00000027],
++		[-5.77844035, -0.00316137, 0.00180675, 0.00318477, -0.00000016, 0.00000027],
++		[-5.77997427, -0.00315889, 0.00180569, 0.00318223, -0.00000016, 0.00000027],
++		[-5.78150394, -0.00315640, 0.00180462, 0.00317971, -0.00000017, 0.00000027],
++		[-5.78302936, -0.00315393, 0.00180355, 0.00317718, -0.00000017, 0.00000027],
++		[-5.78455056, -0.00315145, 0.00180248, 0.00317466, -0.00000017, 0.00000026],
++		[-5.78606752, -0.00314897, 0.00180141, 0.00317214, -0.00000018, 0.00000026],
++		[-5.78758027, -0.00314650, 0.00180035, 0.00316963, -0.00000018, 0.00000026],
++		[-5.78908882, -0.00314403, 0.00179928, 0.00316711, -0.00000019, 0.00000026],
++		[-5.79059316, -0.00314157, 0.00179821, 0.00316460, -0.00000019, 0.00000026],
++		[-5.79209332, -0.00313911, 0.00179715, 0.00316209, -0.00000019, 0.00000026],
++		[-5.79358930, -0.00313665, 0.00179608, 0.00315959, -0.00000020, 0.00000026],
++		[-5.79508110, -0.00313419, 0.00179501, 0.00315709, -0.00000020, 0.00000026],
++		[-5.79656875, -0.00313173, 0.00179395, 0.00315459, -0.00000020, 0.00000025],
++		[-5.79805224, -0.00312928, 0.00179288, 0.00315209, -0.00000021, 0.00000025],
++		[-5.79953159, -0.00312683, 0.00179182, 0.00314960, -0.00000021, 0.00000025],
++		[-5.80100681, -0.00312438, 0.00179075, 0.00314711, -0.00000021, 0.00000025],
++		[-5.80247790, -0.00312194, 0.00178969, 0.00314462, -0.00000022, 0.00000025],
++		[-5.80394487, -0.00311950, 0.00178863, 0.00314214, -0.00000022, 0.00000025],
++		[-5.80540774, -0.00311706, 0.00178756, 0.00313966, -0.00000022, 0.00000025],
++		[-5.80686651, -0.00311462, 0.00178650, 0.00313718, -0.00000023, 0.00000025],
++		[-5.80832119, -0.00311219, 0.00178544, 0.00313470, -0.00000023, 0.00000024],
++		[-5.80977179, -0.00310976, 0.00178438, 0.00313223, -0.00000023, 0.00000024],
++		[-5.81121832, -0.00310733, 0.00178331, 0.00312976, -0.00000024, 0.00000024],
++		[-5.81266079, -0.00310490, 0.00178225, 0.00312729, -0.00000024, 0.00000024],
++		[-5.81409921, -0.00310248, 0.00178119, 0.00312483, -0.00000024, 0.00000024],
++		[-5.81553358, -0.00310006, 0.00178013, 0.00312237, -0.00000025, 0.00000024],
++		[-5.81696392, -0.00309764, 0.00177907, 0.00311991, -0.00000025, 0.00000024],
++		[-5.81839023, -0.00309523, 0.00177801, 0.00311745, -0.00000025, 0.00000024],
++		[-5.81981252, -0.00309282, 0.00177695, 0.00311500, -0.00000026, 0.00000024],
++		[-5.82123081, -0.00309041, 0.00177589, 0.00311255, -0.00000026, 0.00000023],
++		[-5.82264509, -0.00308800, 0.00177483, 0.00311010, -0.00000026, 0.00000023],
++		[-5.82405539, -0.00308560, 0.00177377, 0.00310766, -0.00000027, 0.00000023],
++		[-5.82546171, -0.00308319, 0.00177271, 0.00310521, -0.00000027, 0.00000023],
++		[-5.82686405, -0.00308079, 0.00177165, 0.00310277, -0.00000027, 0.00000023],
++		[-5.82826243, -0.00307840, 0.00177059, 0.00310034, -0.00000028, 0.00000023],
++		[-5.82965686, -0.00307600, 0.00176954, 0.00309790, -0.00000028, 0.00000023],
++		[-5.83104734, -0.00307361, 0.00176848, 0.00309547, -0.00000028, 0.00000023],
++		[-5.83243389, -0.00307122, 0.00176742, 0.00309305, -0.00000029, 0.00000023],
++		[-5.83381650, -0.00306884, 0.00176637, 0.00309062, -0.00000029, 0.00000022],
++		[-5.83519520, -0.00306645, 0.00176531, 0.00308820, -0.00000029, 0.00000022],
++		[-5.83656999, -0.00306407, 0.00176425, 0.00308578, -0.00000030, 0.00000022],
++		[-5.83794088, -0.00306169, 0.00176320, 0.00308336, -0.00000030, 0.00000022],
++		[-5.83930788, -0.00305932, 0.00176214, 0.00308095, -0.00000030, 0.00000022],
++		[-5.84067099, -0.00305695, 0.00176109, 0.00307853, -0.00000031, 0.00000022],
++		[-5.84203023, -0.00305458, 0.00176003, 0.00307612, -0.00000031, 0.00000022],
++		[-5.84338560, -0.00305221, 0.00175898, 0.00307372, -0.00000031, 0.00000022],
++		[-5.84473712, -0.00304984, 0.00175793, 0.00307132, -0.00000031, 0.00000022],
++		[-5.84608479, -0.00304748, 0.00175687, 0.00306891, -0.00000032, 0.00000022],
++		[-5.84742862, -0.00304512, 0.00175582, 0.00306652, -0.00000032, 0.00000021],
++		[-5.84876862, -0.00304276, 0.00175477, 0.00306412, -0.00000032, 0.00000021],
++		[-5.85010480, -0.00304041, 0.00175371, 0.00306173, -0.00000033, 0.00000021],
++		[-5.85143717, -0.00303805, 0.00175266, 0.00305934, -0.00000033, 0.00000021],
++		[-5.85276573, -0.00303570, 0.00175161, 0.00305695, -0.00000033, 0.00000021],
++		[-5.85409050, -0.00303336, 0.00175056, 0.00305457, -0.00000034, 0.00000021],
++		[-5.85541148, -0.00303101, 0.00174951, 0.00305218, -0.00000034, 0.00000021],
++		[-5.85672868, -0.00302867, 0.00174846, 0.00304981, -0.00000034, 0.00000021],
++		[-5.85804212, -0.00302633, 0.00174741, 0.00304743, -0.00000034, 0.00000021],
++		[-5.85935180, -0.00302399, 0.00174636, 0.00304506, -0.00000035, 0.00000020],
++		[-5.86065772, -0.00302166, 0.00174531, 0.00304268, -0.00000035, 0.00000020],
++		[-5.86195991, -0.00301932, 0.00174426, 0.00304032, -0.00000035, 0.00000020],
++		[-5.86325835, -0.00301699, 0.00174321, 0.00303795, -0.00000036, 0.00000020],
++		[-5.86455308, -0.00301467, 0.00174216, 0.00303559, -0.00000036, 0.00000020],
++		[-5.86584409, -0.00301234, 0.00174111, 0.00303323, -0.00000036, 0.00000020],
++		[-5.86713139, -0.00301002, 0.00174006, 0.00303087, -0.00000037, 0.00000020],
++		[-5.86841499, -0.00300770, 0.00173902, 0.00302851, -0.00000037, 0.00000020],
++		[-5.86969490, -0.00300538, 0.00173797, 0.00302616, -0.00000037, 0.00000020],
++		[-5.87097113, -0.00300307, 0.00173692, 0.00302381, -0.00000037, 0.00000020],
++		[-5.87224368, -0.00300076, 0.00173588, 0.00302146, -0.00000038, 0.00000020],
++		[-5.87351257, -0.00299845, 0.00173483, 0.00301912, -0.00000038, 0.00000019],
++		[-5.87477781, -0.00299614, 0.00173378, 0.00301678, -0.00000038, 0.00000019],
++		[-5.87603940, -0.00299383, 0.00173274, 0.00301444, -0.00000039, 0.00000019],
++		[-5.87729735, -0.00299153, 0.00173169, 0.00301210, -0.00000039, 0.00000019],
++		[-5.87855167, -0.00298923, 0.00173065, 0.00300977, -0.00000039, 0.00000019],
++		[-5.87980237, -0.00298694, 0.00172961, 0.00300744, -0.00000039, 0.00000019],
++		[-5.88104946, -0.00298464, 0.00172856, 0.00300511, -0.00000040, 0.00000019],
++		[-5.88229294, -0.00298235, 0.00172752, 0.00300278, -0.00000040, 0.00000019],
++		[-5.88353283, -0.00298006, 0.00172648, 0.00300046, -0.00000040, 0.00000019],
++		[-5.88476913, -0.00297777, 0.00172543, 0.00299814, -0.00000040, 0.00000019],
++		[-5.88600185, -0.00297549, 0.00172439, 0.00299582, -0.00000041, 0.00000019],
++		[-5.88723100, -0.00297320, 0.00172335, 0.00299350, -0.00000041, 0.00000018],
++		[-5.88845659, -0.00297093, 0.00172231, 0.00299119, -0.00000041, 0.00000018],
++		[-5.88967862, -0.00296865, 0.00172127, 0.00298888, -0.00000042, 0.00000018],
++		[-5.89089712, -0.00296637, 0.00172022, 0.00298657, -0.00000042, 0.00000018],
++		[-5.89211207, -0.00296410, 0.00171918, 0.00298427, -0.00000042, 0.00000018],
++		[-5.89332350, -0.00296183, 0.00171814, 0.00298196, -0.00000042, 0.00000018],
++		[-5.89453141, -0.00295956, 0.00171710, 0.00297966, -0.00000043, 0.00000018],
++		[-5.89573581, -0.00295730, 0.00171607, 0.00297737, -0.00000043, 0.00000018],
++		[-5.89693670, -0.00295504, 0.00171503, 0.00297507, -0.00000043, 0.00000018],
++		[-5.89813411, -0.00295278, 0.00171399, 0.00297278, -0.00000043, 0.00000018],
++		[-5.89932802, -0.00295052, 0.00171295, 0.00297049, -0.00000044, 0.00000018],
++		[-5.90051846, -0.00294826, 0.00171191, 0.00296820, -0.00000044, 0.00000017],
++		[-5.90170544, -0.00294601, 0.00171088, 0.00296592, -0.00000044, 0.00000017],
++		[-5.90288895, -0.00294376, 0.00170984, 0.00296363, -0.00000045, 0.00000017],
++		[-5.90406901, -0.00294151, 0.00170880, 0.00296136, -0.00000045, 0.00000017],
++		[-5.90524562, -0.00293927, 0.00170777, 0.00295908, -0.00000045, 0.00000017],
++		[-5.90641881, -0.00293702, 0.00170673, 0.00295680, -0.00000045, 0.00000017],
++		[-5.90758856, -0.00293478, 0.00170569, 0.00295453, -0.00000046, 0.00000017],
++		[-5.90875490, -0.00293254, 0.00170466, 0.00295226, -0.00000046, 0.00000017],
++		[-5.90991782, -0.00293031, 0.00170363, 0.00295000, -0.00000046, 0.00000017],
++		[-5.91107735, -0.00292807, 0.00170259, 0.00294773, -0.00000046, 0.00000017],
++		[-5.91223348, -0.00292584, 0.00170156, 0.00294547, -0.00000047, 0.00000017],
++		[-5.91338622, -0.00292362, 0.00170052, 0.00294321, -0.00000047, 0.00000017],
++		[-5.91453559, -0.00292139, 0.00169949, 0.00294095, -0.00000047, 0.00000016],
++		[-5.91568159, -0.00291917, 0.00169846, 0.00293870, -0.00000047, 0.00000016],
++		[-5.91682423, -0.00291694, 0.00169743, 0.00293645, -0.00000048, 0.00000016],
++		[-5.91796352, -0.00291472, 0.00169639, 0.00293420, -0.00000048, 0.00000016],
++		[-5.91909946, -0.00291251, 0.00169536, 0.00293195, -0.00000048, 0.00000016],
++		[-5.92023207, -0.00291029, 0.00169433, 0.00292971, -0.00000048, 0.00000016],
++		[-5.92136135, -0.00290808, 0.00169330, 0.00292746, -0.00000049, 0.00000016],
++		[-5.92248731, -0.00290587, 0.00169227, 0.00292523, -0.00000049, 0.00000016],
++		[-5.92360996, -0.00290367, 0.00169124, 0.00292299, -0.00000049, 0.00000016],
++		[-5.92472930, -0.00290146, 0.00169021, 0.00292075, -0.00000049, 0.00000016],
++		[-5.92584536, -0.00289926, 0.00168918, 0.00291852, -0.00000050, 0.00000016],
++		[-5.92695812, -0.00289706, 0.00168816, 0.00291629, -0.00000050, 0.00000016],
++		[-5.92806761, -0.00289486, 0.00168713, 0.00291407, -0.00000050, 0.00000016],
++		[-5.92917382, -0.00289267, 0.00168610, 0.00291184, -0.00000050, 0.00000015],
++		[-5.93027677, -0.00289047, 0.00168507, 0.00290962, -0.00000051, 0.00000015],
++		[-5.93137647, -0.00288828, 0.00168405, 0.00290740, -0.00000051, 0.00000015],
++		[-5.93247293, -0.00288610, 0.00168302, 0.00290518, -0.00000051, 0.00000015],
++		[-5.93356614, -0.00288391, 0.00168199, 0.00290297, -0.00000051, 0.00000015],
++		[-5.93465613, -0.00288173, 0.00168097, 0.00290076, -0.00000051, 0.00000015],
++		[-5.93574289, -0.00287955, 0.00167994, 0.00289855, -0.00000052, 0.00000015],
++		[-5.93682644, -0.00287737, 0.00167892, 0.00289634, -0.00000052, 0.00000015],
++		[-5.93790678, -0.00287519, 0.00167789, 0.00289414, -0.00000052, 0.00000015],
++		[-5.93898392, -0.00287302, 0.00167687, 0.00289193, -0.00000052, 0.00000015],
++		[-5.94005788, -0.00287085, 0.00167585, 0.00288973, -0.00000053, 0.00000015],
++		[-5.94112865, -0.00286868, 0.00167482, 0.00288754, -0.00000053, 0.00000015],
++		[-5.94219625, -0.00286651, 0.00167380, 0.00288534, -0.00000053, 0.00000015],
++		[-5.94326068, -0.00286435, 0.00167278, 0.00288315, -0.00000053, 0.00000015],
++		[-5.94432196, -0.00286218, 0.00167176, 0.00288096, -0.00000054, 0.00000014],
++		[-5.94538008, -0.00286002, 0.00167074, 0.00287877, -0.00000054, 0.00000014],
++		[-5.94643506, -0.00285787, 0.00166971, 0.00287659, -0.00000054, 0.00000014],
++		[-5.94748691, -0.00285571, 0.00166869, 0.00287441, -0.00000054, 0.00000014],
++		[-5.94853563, -0.00285356, 0.00166767, 0.00287222, -0.00000055, 0.00000014],
++		[-5.94958124, -0.00285141, 0.00166666, 0.00287005, -0.00000055, 0.00000014],
++		[-5.95062373, -0.00284926, 0.00166564, 0.00286787, -0.00000055, 0.00000014],
++		[-5.95166312, -0.00284711, 0.00166462, 0.00286570, -0.00000055, 0.00000014],
++		[-5.95269941, -0.00284497, 0.00166360, 0.00286353, -0.00000055, 0.00000014],
++		[-5.95373262, -0.00284283, 0.00166258, 0.00286136, -0.00000056, 0.00000014],
++		[-5.95476275, -0.00284069, 0.00166156, 0.00285919, -0.00000056, 0.00000014],
++		[-5.95578980, -0.00283855, 0.00166055, 0.00285703, -0.00000056, 0.00000014],
++		[-5.95681380, -0.00283642, 0.00165953, 0.00285487, -0.00000056, 0.00000014],
++		[-5.95783474, -0.00283429, 0.00165852, 0.00285271, -0.00000057, 0.00000014],
++		[-5.95885262, -0.00283216, 0.00165750, 0.00285056, -0.00000057, 0.00000014],
++		[-5.95986747, -0.00283003, 0.00165648, 0.00284840, -0.00000057, 0.00000013],
++		[-5.96087929, -0.00282791, 0.00165547, 0.00284625, -0.00000057, 0.00000013],
++		[-5.96188808, -0.00282578, 0.00165446, 0.00284410, -0.00000057, 0.00000013],
++		[-5.96289385, -0.00282366, 0.00165344, 0.00284196, -0.00000058, 0.00000013],
++		[-5.96389662, -0.00282154, 0.00165243, 0.00283981, -0.00000058, 0.00000013],
++		[-5.96489638, -0.00281943, 0.00165142, 0.00283767, -0.00000058, 0.00000013],
++		[-5.96589315, -0.00281732, 0.00165040, 0.00283553, -0.00000058, 0.00000013],
++		[-5.96688693, -0.00281520, 0.00164939, 0.00283339, -0.00000058, 0.00000013],
++		[-5.96787774, -0.00281310, 0.00164838, 0.00283126, -0.00000059, 0.00000013],
++		[-5.96886557, -0.00281099, 0.00164737, 0.00282913, -0.00000059, 0.00000013],
++		[-5.96985044, -0.00280888, 0.00164636, 0.00282700, -0.00000059, 0.00000013],
++		[-5.97083235, -0.00280678, 0.00164535, 0.00282487, -0.00000059, 0.00000013],
++		[-5.97181132, -0.00280468, 0.00164434, 0.00282274, -0.00000060, 0.00000013],
++		[-5.97278734, -0.00280258, 0.00164333, 0.00282062, -0.00000060, 0.00000013],
++		[-5.97376044, -0.00280049, 0.00164232, 0.00281850, -0.00000060, 0.00000013],
++		[-5.97473060, -0.00279840, 0.00164131, 0.00281638, -0.00000060, 0.00000013],
++		[-5.97569785, -0.00279631, 0.00164031, 0.00281427, -0.00000060, 0.00000012],
++		[-5.97666219, -0.00279422, 0.00163930, 0.00281215, -0.00000061, 0.00000012],
++		[-5.97762362, -0.00279213, 0.00163829, 0.00281004, -0.00000061, 0.00000012],
++		[-5.97858216, -0.00279005, 0.00163729, 0.00280793, -0.00000061, 0.00000012],
++		[-5.97953782, -0.00278796, 0.00163628, 0.00280583, -0.00000061, 0.00000012],
++		[-5.98049059, -0.00278589, 0.00163527, 0.00280372, -0.00000061, 0.00000012],
++		[-5.98144049, -0.00278381, 0.00163427, 0.00280162, -0.00000062, 0.00000012],
++		[-5.98238752, -0.00278173, 0.00163326, 0.00279952, -0.00000062, 0.00000012],
++		[-5.98333170, -0.00277966, 0.00163226, 0.00279742, -0.00000062, 0.00000012],
++		[-5.98427302, -0.00277759, 0.00163126, 0.00279533, -0.00000062, 0.00000012],
++		[-5.98521150, -0.00277552, 0.00163025, 0.00279324, -0.00000062, 0.00000012],
++		[-5.98614715, -0.00277346, 0.00162925, 0.00279115, -0.00000063, 0.00000012],
++		[-5.98707997, -0.00277139, 0.00162825, 0.00278906, -0.00000063, 0.00000012],
++		[-5.98800996, -0.00276933, 0.00162725, 0.00278697, -0.00000063, 0.00000012],
++		[-5.98893715, -0.00276727, 0.00162625, 0.00278489, -0.00000063, 0.00000012],
++		[-5.98986153, -0.00276521, 0.00162525, 0.00278281, -0.00000063, 0.00000012],
++		[-5.99078310, -0.00276316, 0.00162425, 0.00278073, -0.00000064, 0.00000012],
++		[-5.99170189, -0.00276111, 0.00162325, 0.00277865, -0.00000064, 0.00000012],
++		[-5.99261789, -0.00275906, 0.00162225, 0.00277658, -0.00000064, 0.00000011],
++		[-5.99353112, -0.00275701, 0.00162125, 0.00277451, -0.00000064, 0.00000011],
++		[-5.99444158, -0.00275496, 0.00162025, 0.00277244, -0.00000064, 0.00000011],
++		[-5.99534927, -0.00275292, 0.00161925, 0.00277037, -0.00000065, 0.00000011],
++		[-5.99625421, -0.00275088, 0.00161826, 0.00276831, -0.00000065, 0.00000011],
++		[-5.99715640, -0.00274884, 0.00161726, 0.00276624, -0.00000065, 0.00000011],
++		[-5.99805585, -0.00274680, 0.00161626, 0.00276418, -0.00000065, 0.00000011],
++		[-5.99895257, -0.00274476, 0.00161527, 0.00276213, -0.00000065, 0.00000011],
++		[-5.99984656, -0.00274273, 0.00161427, 0.00276007, -0.00000066, 0.00000011],
++		[-6.00073784, -0.00274070, 0.00161328, 0.00275802, -0.00000066, 0.00000011],
++		[-6.00162640, -0.00273867, 0.00161228, 0.00275597, -0.00000066, 0.00000011],
++		[-6.00251225, -0.00273665, 0.00161129, 0.00275392, -0.00000066, 0.00000011],
++		[-6.00339541, -0.00273462, 0.00161030, 0.00275187, -0.00000066, 0.00000011],
++		[-6.00427588, -0.00273260, 0.00160931, 0.00274983, -0.00000066, 0.00000011],
++		[-6.00515367, -0.00273058, 0.00160831, 0.00274778, -0.00000067, 0.00000011],
++		[-6.00602878, -0.00272856, 0.00160732, 0.00274574, -0.00000067, 0.00000011],
++		[-6.00690122, -0.00272655, 0.00160633, 0.00274371, -0.00000067, 0.00000011],
++		[-6.00777100, -0.00272454, 0.00160534, 0.00274167, -0.00000067, 0.00000011],
++		[-6.00863812, -0.00272252, 0.00160435, 0.00273964, -0.00000067, 0.00000011],
++		[-6.00950260, -0.00272052, 0.00160336, 0.00273761, -0.00000068, 0.00000010],
++		[-6.01036444, -0.00271851, 0.00160237, 0.00273558, -0.00000068, 0.00000010],
++		[-6.01122364, -0.00271651, 0.00160138, 0.00273355, -0.00000068, 0.00000010],
++		[-6.01208022, -0.00271450, 0.00160039, 0.00273153, -0.00000068, 0.00000010],
++		[-6.01293417, -0.00271250, 0.00159941, 0.00272951, -0.00000068, 0.00000010],
++		[-6.01378552, -0.00271051, 0.00159842, 0.00272749, -0.00000068, 0.00000010],
++		[-6.01463426, -0.00270851, 0.00159743, 0.00272547, -0.00000069, 0.00000010],
++		[-6.01548040, -0.00270652, 0.00159645, 0.00272346, -0.00000069, 0.00000010],
++		[-6.01632394, -0.00270453, 0.00159546, 0.00272144, -0.00000069, 0.00000010],
++		[-6.01716491, -0.00270254, 0.00159448, 0.00271943, -0.00000069, 0.00000010],
++		[-6.01800329, -0.00270055, 0.00159349, 0.00271742, -0.00000069, 0.00000010],
++		[-6.01883911, -0.00269856, 0.00159251, 0.00271542, -0.00000070, 0.00000010],
++		[-6.01967236, -0.00269658, 0.00159153, 0.00271341, -0.00000070, 0.00000010],
++		[-6.02050306, -0.00269460, 0.00159054, 0.00271141, -0.00000070, 0.00000010],
++		[-6.02133120, -0.00269262, 0.00158956, 0.00270941, -0.00000070, 0.00000010],
++		[-6.02215680, -0.00269065, 0.00158858, 0.00270741, -0.00000070, 0.00000010],
++		[-6.02297987, -0.00268867, 0.00158760, 0.00270542, -0.00000070, 0.00000010],
++		[-6.02380040, -0.00268670, 0.00158662, 0.00270343, -0.00000071, 0.00000010],
++		[-6.02461841, -0.00268473, 0.00158564, 0.00270144, -0.00000071, 0.00000010],
++		[-6.02543391, -0.00268276, 0.00158466, 0.00269945, -0.00000071, 0.00000010],
++		[-6.02624690, -0.00268080, 0.00158368, 0.00269746, -0.00000071, 0.00000010],
++		[-6.02705738, -0.00267883, 0.00158270, 0.00269548, -0.00000071, 0.00000009],
++		[-6.02786537, -0.00267687, 0.00158172, 0.00269350, -0.00000071, 0.00000009],
++		[-6.02867087, -0.00267491, 0.00158074, 0.00269152, -0.00000072, 0.00000009],
++		[-6.02947389, -0.00267296, 0.00157977, 0.00268954, -0.00000072, 0.00000009],
++		[-6.03027443, -0.00267100, 0.00157879, 0.00268756, -0.00000072, 0.00000009],
++		[-6.03107251, -0.00266905, 0.00157781, 0.00268559, -0.00000072, 0.00000009],
++		[-6.03186812, -0.00266710, 0.00157684, 0.00268362, -0.00000072, 0.00000009],
++		[-6.03266127, -0.00266515, 0.00157586, 0.00268165, -0.00000072, 0.00000009],
++		[-6.03345198, -0.00266320, 0.00157489, 0.00267968, -0.00000073, 0.00000009],
++		[-6.03424025, -0.00266126, 0.00157391, 0.00267772, -0.00000073, 0.00000009],
++		[-6.03502608, -0.00265932, 0.00157294, 0.00267576, -0.00000073, 0.00000009],
++		[-6.03580948, -0.00265738, 0.00157197, 0.00267380, -0.00000073, 0.00000009],
++		[-6.03659046, -0.00265544, 0.00157100, 0.00267184, -0.00000073, 0.00000009],
++		[-6.03736903, -0.00265350, 0.00157002, 0.00266988, -0.00000073, 0.00000009],
++		[-6.03814518, -0.00265157, 0.00156905, 0.00266793, -0.00000074, 0.00000009],
++		[-6.03891894, -0.00264964, 0.00156808, 0.00266598, -0.00000074, 0.00000009],
++		[-6.03969029, -0.00264771, 0.00156711, 0.00266403, -0.00000074, 0.00000009],
++		[-6.04045926, -0.00264578, 0.00156614, 0.00266208, -0.00000074, 0.00000009],
++		[-6.04122585, -0.00264386, 0.00156517, 0.00266014, -0.00000074, 0.00000009],
++		[-6.04199006, -0.00264193, 0.00156421, 0.00265819, -0.00000074, 0.00000009],
++		[-6.04275190, -0.00264001, 0.00156324, 0.00265625, -0.00000075, 0.00000009],
++		[-6.04351138, -0.00263809, 0.00156227, 0.00265431, -0.00000075, 0.00000009],
++		[-6.04426850, -0.00263618, 0.00156130, 0.00265238, -0.00000075, 0.00000009],
++		[-6.04502327, -0.00263426, 0.00156034, 0.00265044, -0.00000075, 0.00000008],
++		[-6.04577570, -0.00263235, 0.00155937, 0.00264851, -0.00000075, 0.00000008],
++		[-6.04652579, -0.00263044, 0.00155841, 0.00264658, -0.00000075, 0.00000008],
++		[-6.04727354, -0.00262853, 0.00155744, 0.00264465, -0.00000075, 0.00000008],
++		[-6.04801898, -0.00262662, 0.00155648, 0.00264273, -0.00000076, 0.00000008],
++		[-6.04876210, -0.00262472, 0.00155552, 0.00264080, -0.00000076, 0.00000008],
++		[-6.04950290, -0.00262282, 0.00155455, 0.00263888, -0.00000076, 0.00000008],
++		[-6.05024140, -0.00262092, 0.00155359, 0.00263696, -0.00000076, 0.00000008],
++		[-6.05097760, -0.00261902, 0.00155263, 0.00263505, -0.00000076, 0.00000008],
++		[-6.05171151, -0.00261712, 0.00155167, 0.00263313, -0.00000076, 0.00000008],
++		[-6.05244313, -0.00261523, 0.00155071, 0.00263122, -0.00000077, 0.00000008],
++		[-6.05317248, -0.00261334, 0.00154975, 0.00262931, -0.00000077, 0.00000008],
++		[-6.05389955, -0.00261145, 0.00154879, 0.00262740, -0.00000077, 0.00000008],
++		[-6.05462435, -0.00260956, 0.00154783, 0.00262549, -0.00000077, 0.00000008],
++		[-6.05534689, -0.00260767, 0.00154687, 0.00262359, -0.00000077, 0.00000008],
++		[-6.05606718, -0.00260579, 0.00154591, 0.00262169, -0.00000077, 0.00000008],
++		[-6.05678521, -0.00260391, 0.00154495, 0.00261979, -0.00000077, 0.00000008],
++		[-6.05750101, -0.00260203, 0.00154400, 0.00261789, -0.00000078, 0.00000008],
++		[-6.05821457, -0.00260015, 0.00154304, 0.00261599, -0.00000078, 0.00000008],
++		[-6.05892590, -0.00259827, 0.00154209, 0.00261410, -0.00000078, 0.00000008],
++		[-6.05963501, -0.00259640, 0.00154113, 0.00261221, -0.00000078, 0.00000008],
++		[-6.06034190, -0.00259453, 0.00154018, 0.00261032, -0.00000078, 0.00000008],
++		[-6.06104657, -0.00259266, 0.00153922, 0.00260843, -0.00000078, 0.00000008],
++		[-6.06174905, -0.00259079, 0.00153827, 0.00260654, -0.00000078, 0.00000008],
++		[-6.06244932, -0.00258893, 0.00153732, 0.00260466, -0.00000079, 0.00000008],
++		[-6.06314740, -0.00258706, 0.00153637, 0.00260278, -0.00000079, 0.00000008],
++		[-6.06384330, -0.00258520, 0.00153541, 0.00260090, -0.00000079, 0.00000008],
++		[-6.06453701, -0.00258334, 0.00153446, 0.00259902, -0.00000079, 0.00000007],
++		[-6.06522855, -0.00258148, 0.00153351, 0.00259715, -0.00000079, 0.00000007],
++		[-6.06591793, -0.00257963, 0.00153256, 0.00259527, -0.00000079, 0.00000007],
++		[-6.06660514, -0.00257778, 0.00153161, 0.00259340, -0.00000079, 0.00000007],
++		[-6.06729019, -0.00257592, 0.00153067, 0.00259153, -0.00000080, 0.00000007],
++		[-6.06797309, -0.00257408, 0.00152972, 0.00258967, -0.00000080, 0.00000007],
++		[-6.06865385, -0.00257223, 0.00152877, 0.00258780, -0.00000080, 0.00000007],
++		[-6.06933248, -0.00257038, 0.00152782, 0.00258594, -0.00000080, 0.00000007],
++		[-6.07000896, -0.00256854, 0.00152688, 0.00258408, -0.00000080, 0.00000007],
++		[-6.07068333, -0.00256670, 0.00152593, 0.00258222, -0.00000080, 0.00000007],
++		[-6.07135557, -0.00256486, 0.00152499, 0.00258036, -0.00000080, 0.00000007],
++		[-6.07202570, -0.00256302, 0.00152404, 0.00257851, -0.00000081, 0.00000007],
++		[-6.07269372, -0.00256119, 0.00152310, 0.00257666, -0.00000081, 0.00000007],
++		[-6.07335964, -0.00255935, 0.00152215, 0.00257480, -0.00000081, 0.00000007],
++		[-6.07402346, -0.00255752, 0.00152121, 0.00257296, -0.00000081, 0.00000007],
++		[-6.07468520, -0.00255569, 0.00152027, 0.00257111, -0.00000081, 0.00000007],
++		[-6.07534484, -0.00255387, 0.00151933, 0.00256927, -0.00000081, 0.00000007],
++		[-6.07600241, -0.00255204, 0.00151839, 0.00256742, -0.00000081, 0.00000007],
++		[-6.07665791, -0.00255022, 0.00151745, 0.00256558, -0.00000082, 0.00000007],
++		[-6.07731134, -0.00254840, 0.00151651, 0.00256374, -0.00000082, 0.00000007],
++		[-6.07796271, -0.00254658, 0.00151557, 0.00256191, -0.00000082, 0.00000007],
++		[-6.07861202, -0.00254476, 0.00151463, 0.00256007, -0.00000082, 0.00000007],
++		[-6.07925928, -0.00254294, 0.00151369, 0.00255824, -0.00000082, 0.00000007],
++		[-6.07990450, -0.00254113, 0.00151275, 0.00255641, -0.00000082, 0.00000007],
++		[-6.08054769, -0.00253932, 0.00151182, 0.00255458, -0.00000082, 0.00000007],
++		[-6.08118884, -0.00253751, 0.00151088, 0.00255276, -0.00000082, 0.00000007],
++		[-6.08182796, -0.00253570, 0.00150994, 0.00255093, -0.00000083, 0.00000007],
++		[-6.08246507, -0.00253390, 0.00150901, 0.00254911, -0.00000083, 0.00000007],
++		[-6.08310016, -0.00253210, 0.00150807, 0.00254729, -0.00000083, 0.00000007],
++		[-6.08373324, -0.00253029, 0.00150714, 0.00254547, -0.00000083, 0.00000007],
++		[-6.08436431, -0.00252849, 0.00150621, 0.00254366, -0.00000083, 0.00000006],
++		[-6.08499339, -0.00252670, 0.00150527, 0.00254184, -0.00000083, 0.00000006],
++		[-6.08562048, -0.00252490, 0.00150434, 0.00254003, -0.00000083, 0.00000006],
++		[-6.08624558, -0.00252311, 0.00150341, 0.00253822, -0.00000084, 0.00000006],
++		[-6.08686870, -0.00252132, 0.00150248, 0.00253641, -0.00000084, 0.00000006],
++		[-6.08748985, -0.00251953, 0.00150155, 0.00253461, -0.00000084, 0.00000006],
++		[-6.08810902, -0.00251774, 0.00150062, 0.00253280, -0.00000084, 0.00000006],
++		[-6.08872624, -0.00251595, 0.00149969, 0.00253100, -0.00000084, 0.00000006],
++		[-6.08934149, -0.00251417, 0.00149876, 0.00252920, -0.00000084, 0.00000006],
++		[-6.08995479, -0.00251239, 0.00149784, 0.00252740, -0.00000084, 0.00000006],
++		[-6.09056615, -0.00251061, 0.00149691, 0.00252561, -0.00000084, 0.00000006],
++		[-6.09117556, -0.00250883, 0.00149598, 0.00252381, -0.00000085, 0.00000006],
++		[-6.09178304, -0.00250705, 0.00149506, 0.00252202, -0.00000085, 0.00000006],
++		[-6.09238859, -0.00250528, 0.00149413, 0.00252023, -0.00000085, 0.00000006],
++		[-6.09299221, -0.00250351, 0.00149320, 0.00251844, -0.00000085, 0.00000006],
++		[-6.09359392, -0.00250174, 0.00149228, 0.00251666, -0.00000085, 0.00000006],
++		[-6.09419371, -0.00249997, 0.00149136, 0.00251487, -0.00000085, 0.00000006],
++		[-6.09479159, -0.00249820, 0.00149043, 0.00251309, -0.00000085, 0.00000006],
++		[-6.09538757, -0.00249644, 0.00148951, 0.00251131, -0.00000085, 0.00000006],
++		[-6.09598165, -0.00249468, 0.00148859, 0.00250953, -0.00000086, 0.00000006],
++		[-6.09657385, -0.00249292, 0.00148767, 0.00250776, -0.00000086, 0.00000006],
++		[-6.09716415, -0.00249116, 0.00148675, 0.00250598, -0.00000086, 0.00000006],
++		[-6.09775257, -0.00248940, 0.00148583, 0.00250421, -0.00000086, 0.00000006],
++		[-6.09833912, -0.00248765, 0.00148491, 0.00250244, -0.00000086, 0.00000006],
++		[-6.09892380, -0.00248589, 0.00148399, 0.00250067, -0.00000086, 0.00000006],
++		[-6.09950662, -0.00248414, 0.00148307, 0.00249891, -0.00000086, 0.00000006],
++		[-6.10008757, -0.00248239, 0.00148215, 0.00249714, -0.00000086, 0.00000006],
++		[-6.10066667, -0.00248065, 0.00148124, 0.00249538, -0.00000086, 0.00000006],
++		[-6.10124393, -0.00247890, 0.00148032, 0.00249362, -0.00000087, 0.00000006],
++		[-6.10181934, -0.00247716, 0.00147941, 0.00249186, -0.00000087, 0.00000006],
++		[-6.10239291, -0.00247542, 0.00147849, 0.00249010, -0.00000087, 0.00000006],
++		[-6.10296465, -0.00247368, 0.00147758, 0.00248835, -0.00000087, 0.00000006],
++		[-6.10353456, -0.00247194, 0.00147666, 0.00248660, -0.00000087, 0.00000006],
++		[-6.10410265, -0.00247020, 0.00147575, 0.00248484, -0.00000087, 0.00000006],
++		[-6.10466892, -0.00246847, 0.00147484, 0.00248310, -0.00000087, 0.00000006],
++		[-6.10523338, -0.00246674, 0.00147393, 0.00248135, -0.00000087, 0.00000005],
++		[-6.10579604, -0.00246501, 0.00147301, 0.00247960, -0.00000088, 0.00000005],
++		[-6.10635689, -0.00246328, 0.00147210, 0.00247786, -0.00000088, 0.00000005],
++		[-6.10691595, -0.00246155, 0.00147119, 0.00247612, -0.00000088, 0.00000005],
++		[-6.10747322, -0.00245983, 0.00147028, 0.00247438, -0.00000088, 0.00000005],
++		[-6.10802871, -0.00245811, 0.00146937, 0.00247264, -0.00000088, 0.00000005],
++		[-6.10858241, -0.00245639, 0.00146847, 0.00247091, -0.00000088, 0.00000005],
++		[-6.10913434, -0.00245467, 0.00146756, 0.00246917, -0.00000088, 0.00000005],
++		[-6.10968450, -0.00245295, 0.00146665, 0.00246744, -0.00000088, 0.00000005],
++		[-6.11023289, -0.00245123, 0.00146575, 0.00246571, -0.00000088, 0.00000005],
++		[-6.11077953, -0.00244952, 0.00146484, 0.00246398, -0.00000089, 0.00000005],
++		[-6.11132441, -0.00244781, 0.00146393, 0.00246226, -0.00000089, 0.00000005],
++		[-6.11186754, -0.00244610, 0.00146303, 0.00246053, -0.00000089, 0.00000005],
++		[-6.11240893, -0.00244439, 0.00146213, 0.00245881, -0.00000089, 0.00000005],
++		[-6.11294858, -0.00244269, 0.00146122, 0.00245709, -0.00000089, 0.00000005],
++		[-6.11348649, -0.00244098, 0.00146032, 0.00245537, -0.00000089, 0.00000005],
++		[-6.11402268, -0.00243928, 0.00145942, 0.00245366, -0.00000089, 0.00000005],
++		[-6.11455714, -0.00243758, 0.00145852, 0.00245194, -0.00000089, 0.00000005],
++		[-6.11508989, -0.00243588, 0.00145762, 0.00245023, -0.00000089, 0.00000005],
++		[-6.11562092, -0.00243419, 0.00145672, 0.00244852, -0.00000090, 0.00000005],
++		[-6.11615024, -0.00243249, 0.00145582, 0.00244681, -0.00000090, 0.00000005],
++		[-6.11667786, -0.00243080, 0.00145492, 0.00244510, -0.00000090, 0.00000005],
++		[-6.11720378, -0.00242911, 0.00145402, 0.00244340, -0.00000090, 0.00000005],
++		[-6.11772800, -0.00242742, 0.00145312, 0.00244170, -0.00000090, 0.00000005],
++		[-6.11825054, -0.00242574, 0.00145223, 0.00244000, -0.00000090, 0.00000005],
++		[-6.11877140, -0.00242405, 0.00145133, 0.00243830, -0.00000090, 0.00000005],
++		[-6.11929057, -0.00242237, 0.00145043, 0.00243660, -0.00000090, 0.00000005],
++		[-6.11980807, -0.00242069, 0.00144954, 0.00243490, -0.00000090, 0.00000005],
++		[-6.12032390, -0.00241901, 0.00144864, 0.00243321, -0.00000090, 0.00000005],
++		[-6.12083807, -0.00241733, 0.00144775, 0.00243152, -0.00000091, 0.00000005],
++		[-6.12135058, -0.00241565, 0.00144686, 0.00242983, -0.00000091, 0.00000005],
++		[-6.12186144, -0.00241398, 0.00144597, 0.00242814, -0.00000091, 0.00000005],
++		[-6.12237064, -0.00241231, 0.00144507, 0.00242645, -0.00000091, 0.00000005],
++		[-6.12287820, -0.00241064, 0.00144418, 0.00242477, -0.00000091, 0.00000005],
++		[-6.12338412, -0.00240897, 0.00144329, 0.00242309, -0.00000091, 0.00000005],
++		[-6.12388841, -0.00240730, 0.00144240, 0.00242141, -0.00000091, 0.00000005],
++		[-6.12439107, -0.00240563, 0.00144151, 0.00241973, -0.00000091, 0.00000005],
++		[-6.12489210, -0.00240397, 0.00144062, 0.00241805, -0.00000091, 0.00000005],
++		[-6.12539151, -0.00240231, 0.00143974, 0.00241637, -0.00000092, 0.00000005],
++		[-6.12588931, -0.00240065, 0.00143885, 0.00241470, -0.00000092, 0.00000005],
++		[-6.12638549, -0.00239899, 0.00143796, 0.00241303, -0.00000092, 0.00000005],
++		[-6.12688007, -0.00239734, 0.00143708, 0.00241136, -0.00000092, 0.00000005],
++		[-6.12737305, -0.00239568, 0.00143619, 0.00240969, -0.00000092, 0.00000005],
++		[-6.12786443, -0.00239403, 0.00143531, 0.00240803, -0.00000092, 0.00000004],
++		[-6.12835422, -0.00239238, 0.00143442, 0.00240636, -0.00000092, 0.00000004],
++		[-6.12884242, -0.00239073, 0.00143354, 0.00240470, -0.00000092, 0.00000004],
++		[-6.12932904, -0.00238908, 0.00143266, 0.00240304, -0.00000092, 0.00000004],
++		[-6.12981408, -0.00238744, 0.00143177, 0.00240138, -0.00000092, 0.00000004],
++		[-6.13029755, -0.00238580, 0.00143089, 0.00239972, -0.00000093, 0.00000004],
++		[-6.13077945, -0.00238416, 0.00143001, 0.00239807, -0.00000093, 0.00000004],
++		[-6.13125979, -0.00238252, 0.00142913, 0.00239642, -0.00000093, 0.00000004],
++		[-6.13173857, -0.00238088, 0.00142825, 0.00239477, -0.00000093, 0.00000004],
++		[-6.13221579, -0.00237924, 0.00142737, 0.00239312, -0.00000093, 0.00000004],
++		[-6.13269147, -0.00237761, 0.00142649, 0.00239147, -0.00000093, 0.00000004],
++		[-6.13316560, -0.00237598, 0.00142562, 0.00238982, -0.00000093, 0.00000004],
++		[-6.13363819, -0.00237434, 0.00142474, 0.00238818, -0.00000093, 0.00000004],
++		[-6.13410924, -0.00237272, 0.00142386, 0.00238654, -0.00000093, 0.00000004],
++		[-6.13457876, -0.00237109, 0.00142299, 0.00238490, -0.00000093, 0.00000004],
++		[-6.13504676, -0.00236946, 0.00142211, 0.00238326, -0.00000093, 0.00000004],
++		[-6.13551323, -0.00236784, 0.00142124, 0.00238162, -0.00000094, 0.00000004],
++		[-6.13597818, -0.00236622, 0.00142036, 0.00237999, -0.00000094, 0.00000004],
++		[-6.13644163, -0.00236460, 0.00141949, 0.00237835, -0.00000094, 0.00000004],
++		[-6.13690356, -0.00236298, 0.00141862, 0.00237672, -0.00000094, 0.00000004],
++		[-6.13736399, -0.00236136, 0.00141774, 0.00237509, -0.00000094, 0.00000004],
++		[-6.13782292, -0.00235975, 0.00141687, 0.00237347, -0.00000094, 0.00000004],
++		[-6.13828035, -0.00235814, 0.00141600, 0.00237184, -0.00000094, 0.00000004],
++		[-6.13873630, -0.00235652, 0.00141513, 0.00237022, -0.00000094, 0.00000004],
++		[-6.13919076, -0.00235492, 0.00141426, 0.00236859, -0.00000094, 0.00000004],
++		[-6.13964373, -0.00235331, 0.00141339, 0.00236697, -0.00000094, 0.00000004],
++		[-6.14009523, -0.00235170, 0.00141253, 0.00236535, -0.00000094, 0.00000004],
++		[-6.14054526, -0.00235010, 0.00141166, 0.00236374, -0.00000095, 0.00000004],
++		[-6.14099381, -0.00234850, 0.00141079, 0.00236212, -0.00000095, 0.00000004],
++		[-6.14144091, -0.00234689, 0.00140993, 0.00236051, -0.00000095, 0.00000004],
++		[-6.14188654, -0.00234530, 0.00140906, 0.00235890, -0.00000095, 0.00000004],
++		[-6.14233072, -0.00234370, 0.00140820, 0.00235729, -0.00000095, 0.00000004],
++		[-6.14277345, -0.00234210, 0.00140733, 0.00235568, -0.00000095, 0.00000004],
++		[-6.14321473, -0.00234051, 0.00140647, 0.00235407, -0.00000095, 0.00000004],
++		[-6.14365457, -0.00233892, 0.00140561, 0.00235247, -0.00000095, 0.00000004],
++		[-6.14409297, -0.00233733, 0.00140474, 0.00235087, -0.00000095, 0.00000004],
++		[-6.14452994, -0.00233574, 0.00140388, 0.00234926, -0.00000095, 0.00000004],
++		[-6.14496548, -0.00233415, 0.00140302, 0.00234767, -0.00000095, 0.00000004],
++		[-6.14539959, -0.00233257, 0.00140216, 0.00234607, -0.00000096, 0.00000004],
++		[-6.14583228, -0.00233098, 0.00140130, 0.00234447, -0.00000096, 0.00000004],
++		[-6.14626356, -0.00232940, 0.00140044, 0.00234288, -0.00000096, 0.00000004],
++		[-6.14669342, -0.00232782, 0.00139958, 0.00234129, -0.00000096, 0.00000004],
++		[-6.14712188, -0.00232625, 0.00139873, 0.00233970, -0.00000096, 0.00000004],
++		[-6.14754894, -0.00232467, 0.00139787, 0.00233811, -0.00000096, 0.00000004],
++		[-6.14797459, -0.00232309, 0.00139701, 0.00233652, -0.00000096, 0.00000004],
++		[-6.14839885, -0.00232152, 0.00139616, 0.00233493, -0.00000096, 0.00000004],
++		[-6.14882172, -0.00231995, 0.00139530, 0.00233335, -0.00000096, 0.00000004],
++		[-6.14924320, -0.00231838, 0.00139445, 0.00233177, -0.00000096, 0.00000004],
++		[-6.14966330, -0.00231681, 0.00139359, 0.00233019, -0.00000096, 0.00000004],
++		[-6.15008202, -0.00231525, 0.00139274, 0.00232861, -0.00000097, 0.00000004],
++		[-6.15049937, -0.00231368, 0.00139189, 0.00232704, -0.00000097, 0.00000004],
++		[-6.15091535, -0.00231212, 0.00139104, 0.00232546, -0.00000097, 0.00000004],
++		[-6.15132996, -0.00231056, 0.00139018, 0.00232389, -0.00000097, 0.00000004],
++		[-6.15174321, -0.00230900, 0.00138933, 0.00232232, -0.00000097, 0.00000003],
++		[-6.15215510, -0.00230744, 0.00138848, 0.00232075, -0.00000097, 0.00000003],
++		[-6.15256564, -0.00230589, 0.00138763, 0.00231918, -0.00000097, 0.00000003],
++		[-6.15297483, -0.00230433, 0.00138679, 0.00231761, -0.00000097, 0.00000003],
++		[-6.15338268, -0.00230278, 0.00138594, 0.00231605, -0.00000097, 0.00000003],
++		[-6.15378918, -0.00230123, 0.00138509, 0.00231449, -0.00000097, 0.00000003],
++		[-6.15419435, -0.00229968, 0.00138424, 0.00231293, -0.00000097, 0.00000003],
++		[-6.15459818, -0.00229814, 0.00138340, 0.00231137, -0.00000097, 0.00000003],
++		[-6.15500069, -0.00229659, 0.00138255, 0.00230981, -0.00000097, 0.00000003],
++		[-6.15540187, -0.00229505, 0.00138171, 0.00230825, -0.00000098, 0.00000003],
++		[-6.15580173, -0.00229350, 0.00138087, 0.00230670, -0.00000098, 0.00000003],
++		[-6.15620027, -0.00229196, 0.00138002, 0.00230515, -0.00000098, 0.00000003],
++		[-6.15659750, -0.00229042, 0.00137918, 0.00230360, -0.00000098, 0.00000003],
++		[-6.15699342, -0.00228889, 0.00137834, 0.00230205, -0.00000098, 0.00000003],
++		[-6.15738804, -0.00228735, 0.00137750, 0.00230050, -0.00000098, 0.00000003],
++		[-6.15778136, -0.00228582, 0.00137666, 0.00229896, -0.00000098, 0.00000003],
++		[-6.15817338, -0.00228429, 0.00137582, 0.00229741, -0.00000098, 0.00000003],
++		[-6.15856410, -0.00228276, 0.00137498, 0.00229587, -0.00000098, 0.00000003],
++		[-6.15895354, -0.00228123, 0.00137414, 0.00229433, -0.00000098, 0.00000003],
++		[-6.15934170, -0.00227970, 0.00137330, 0.00229279, -0.00000098, 0.00000003],
++		[-6.15972857, -0.00227818, 0.00137246, 0.00229125, -0.00000098, 0.00000003],
++		[-6.16011416, -0.00227665, 0.00137162, 0.00228972, -0.00000099, 0.00000003],
++		[-6.16049848, -0.00227513, 0.00137079, 0.00228818, -0.00000099, 0.00000003],
++		[-6.16088154, -0.00227361, 0.00136995, 0.00228665, -0.00000099, 0.00000003],
++		[-6.16126332, -0.00227209, 0.00136912, 0.00228512, -0.00000099, 0.00000003],
++		[-6.16164385, -0.00227057, 0.00136828, 0.00228359, -0.00000099, 0.00000003],
++		[-6.16202312, -0.00226906, 0.00136745, 0.00228207, -0.00000099, 0.00000003],
++		[-6.16240113, -0.00226754, 0.00136662, 0.00228054, -0.00000099, 0.00000003],
++		[-6.16277790, -0.00226603, 0.00136579, 0.00227902, -0.00000099, 0.00000003],
++		[-6.16315341, -0.00226452, 0.00136495, 0.00227750, -0.00000099, 0.00000003],
++		[-6.16352769, -0.00226301, 0.00136412, 0.00227598, -0.00000099, 0.00000003],
++		[-6.16390073, -0.00226151, 0.00136329, 0.00227446, -0.00000099, 0.00000003],
++		[-6.16427253, -0.00226000, 0.00136246, 0.00227294, -0.00000099, 0.00000003],
++		[-6.16464310, -0.00225850, 0.00136164, 0.00227143, -0.00000099, 0.00000003],
++		[-6.16501245, -0.00225700, 0.00136081, 0.00226991, -0.00000100, 0.00000003],
++		[-6.16538057, -0.00225549, 0.00135998, 0.00226840, -0.00000100, 0.00000003],
++		[-6.16574747, -0.00225400, 0.00135915, 0.00226689, -0.00000100, 0.00000003],
++		[-6.16611316, -0.00225250, 0.00135833, 0.00226538, -0.00000100, 0.00000003],
++		[-6.16647763, -0.00225100, 0.00135750, 0.00226388, -0.00000100, 0.00000003],
++		[-6.16684090, -0.00224951, 0.00135668, 0.00226237, -0.00000100, 0.00000003],
++		[-6.16720296, -0.00224802, 0.00135585, 0.00226087, -0.00000100, 0.00000003],
++		[-6.16756382, -0.00224653, 0.00135503, 0.00225936, -0.00000100, 0.00000003],
++		[-6.16792348, -0.00224504, 0.00135421, 0.00225786, -0.00000100, 0.00000003],
++		[-6.16828195, -0.00224355, 0.00135338, 0.00225637, -0.00000100, 0.00000003],
++		[-6.16863923, -0.00224206, 0.00135256, 0.00225487, -0.00000100, 0.00000003],
++		[-6.16899533, -0.00224058, 0.00135174, 0.00225337, -0.00000100, 0.00000003],
++		[-6.16935024, -0.00223910, 0.00135092, 0.00225188, -0.00000100, 0.00000003],
++		[-6.16970397, -0.00223762, 0.00135010, 0.00225039, -0.00000100, 0.00000003],
++		[-6.17005653, -0.00223614, 0.00134928, 0.00224890, -0.00000101, 0.00000003],
++		[-6.17040791, -0.00223466, 0.00134846, 0.00224741, -0.00000101, 0.00000003],
++		[-6.17075813, -0.00223318, 0.00134765, 0.00224592, -0.00000101, 0.00000003],
++		[-6.17110719, -0.00223171, 0.00134683, 0.00224444, -0.00000101, 0.00000003],
++		[-6.17145508, -0.00223024, 0.00134601, 0.00224295, -0.00000101, 0.00000003],
++		[-6.17180182, -0.00222876, 0.00134520, 0.00224147, -0.00000101, 0.00000003],
++		[-6.17214740, -0.00222729, 0.00134438, 0.00223999, -0.00000101, 0.00000003],
++		[-6.17249183, -0.00222583, 0.00134357, 0.00223851, -0.00000101, 0.00000003],
++		[-6.17283512, -0.00222436, 0.00134275, 0.00223703, -0.00000101, 0.00000003],
++		[-6.17317726, -0.00222289, 0.00134194, 0.00223556, -0.00000101, 0.00000003],
++		[-6.17351827, -0.00222143, 0.00134113, 0.00223408, -0.00000101, 0.00000003],
++		[-6.17385813, -0.00221997, 0.00134032, 0.00223261, -0.00000101, 0.00000003],
++		[-6.17419687, -0.00221851, 0.00133950, 0.00223114, -0.00000101, 0.00000003],
++		[-6.17453448, -0.00221705, 0.00133869, 0.00222967, -0.00000101, 0.00000003],
++		[-6.17487096, -0.00221559, 0.00133788, 0.00222820, -0.00000101, 0.00000003],
++		[-6.17520632, -0.00221414, 0.00133708, 0.00222674, -0.00000102, 0.00000003],
++		[-6.17554056, -0.00221269, 0.00133627, 0.00222527, -0.00000102, 0.00000003],
++		[-6.17587369, -0.00221123, 0.00133546, 0.00222381, -0.00000102, 0.00000003],
++		[-6.17620571, -0.00220978, 0.00133465, 0.00222235, -0.00000102, 0.00000003],
++		[-6.17653662, -0.00220833, 0.00133385, 0.00222089, -0.00000102, 0.00000003],
++		[-6.17686642, -0.00220689, 0.00133304, 0.00221943, -0.00000102, 0.00000003],
++		[-6.17719513, -0.00220544, 0.00133223, 0.00221798, -0.00000102, 0.00000003],
++		[-6.17752273, -0.00220400, 0.00133143, 0.00221652, -0.00000102, 0.00000003],
++		[-6.17784925, -0.00220255, 0.00133063, 0.00221507, -0.00000102, 0.00000003],
++		[-6.17817467, -0.00220111, 0.00132982, 0.00221362, -0.00000102, 0.00000002],
++		[-6.17849900, -0.00219967, 0.00132902, 0.00221217, -0.00000102, 0.00000002],
++		[-6.17882225, -0.00219823, 0.00132822, 0.00221072, -0.00000102, 0.00000002],
++		[-6.17914442, -0.00219680, 0.00132742, 0.00220927, -0.00000102, 0.00000002],
++		[-6.17946552, -0.00219536, 0.00132662, 0.00220782, -0.00000102, 0.00000002],
++		[-6.17978554, -0.00219393, 0.00132582, 0.00220638, -0.00000102, 0.00000002],
++		[-6.18010448, -0.00219250, 0.00132502, 0.00220494, -0.00000103, 0.00000002],
++		[-6.18042237, -0.00219107, 0.00132422, 0.00220350, -0.00000103, 0.00000002],
++		[-6.18073919, -0.00218964, 0.00132342, 0.00220206, -0.00000103, 0.00000002],
++		[-6.18105494, -0.00218821, 0.00132262, 0.00220062, -0.00000103, 0.00000002],
++		[-6.18136964, -0.00218679, 0.00132183, 0.00219919, -0.00000103, 0.00000002],
++		[-6.18168329, -0.00218536, 0.00132103, 0.00219775, -0.00000103, 0.00000002],
++		[-6.18199589, -0.00218394, 0.00132024, 0.00219632, -0.00000103, 0.00000002],
++		[-6.18230744, -0.00218252, 0.00131944, 0.00219489, -0.00000103, 0.00000002],
++		[-6.18261795, -0.00218110, 0.00131865, 0.00219346, -0.00000103, 0.00000002],
++		[-6.18292741, -0.00217968, 0.00131785, 0.00219203, -0.00000103, 0.00000002],
++		[-6.18323584, -0.00217827, 0.00131706, 0.00219060, -0.00000103, 0.00000002],
++		[-6.18354323, -0.00217685, 0.00131627, 0.00218918, -0.00000103, 0.00000002],
++		[-6.18384960, -0.00217544, 0.00131548, 0.00218776, -0.00000103, 0.00000002],
++		[-6.18415493, -0.00217403, 0.00131469, 0.00218633, -0.00000103, 0.00000002],
++		[-6.18445924, -0.00217262, 0.00131390, 0.00218491, -0.00000103, 0.00000002],
++		[-6.18476253, -0.00217121, 0.00131311, 0.00218350, -0.00000103, 0.00000002],
++		[-6.18506481, -0.00216980, 0.00131232, 0.00218208, -0.00000104, 0.00000002],
++		[-6.18536606, -0.00216840, 0.00131153, 0.00218066, -0.00000104, 0.00000002],
++		[-6.18566631, -0.00216699, 0.00131074, 0.00217925, -0.00000104, 0.00000002],
++		[-6.18596555, -0.00216559, 0.00130996, 0.00217784, -0.00000104, 0.00000002],
++		[-6.18626378, -0.00216419, 0.00130917, 0.00217643, -0.00000104, 0.00000002],
++		[-6.18656101, -0.00216279, 0.00130839, 0.00217502, -0.00000104, 0.00000002],
++		[-6.18685724, -0.00216139, 0.00130760, 0.00217361, -0.00000104, 0.00000002],
++		[-6.18715248, -0.00216000, 0.00130682, 0.00217220, -0.00000104, 0.00000002],
++		[-6.18744673, -0.00215860, 0.00130603, 0.00217080, -0.00000104, 0.00000002],
++		[-6.18773998, -0.00215721, 0.00130525, 0.00216939, -0.00000104, 0.00000002],
++		[-6.18803225, -0.00215582, 0.00130447, 0.00216799, -0.00000104, 0.00000002],
++		[-6.18832353, -0.00215443, 0.00130369, 0.00216659, -0.00000104, 0.00000002],
++		[-6.18861384, -0.00215304, 0.00130291, 0.00216519, -0.00000104, 0.00000002],
++		[-6.18890316, -0.00215165, 0.00130213, 0.00216380, -0.00000104, 0.00000002],
++		[-6.18919152, -0.00215026, 0.00130135, 0.00216240, -0.00000104, 0.00000002],
++		[-6.18947890, -0.00214888, 0.00130057, 0.00216101, -0.00000104, 0.00000002],
++		[-6.18976532, -0.00214750, 0.00129979, 0.00215961, -0.00000104, 0.00000002],
++		[-6.19005077, -0.00214612, 0.00129901, 0.00215822, -0.00000105, 0.00000002],
++		[-6.19033526, -0.00214474, 0.00129823, 0.00215683, -0.00000105, 0.00000002],
++		[-6.19061879, -0.00214336, 0.00129746, 0.00215545, -0.00000105, 0.00000002],
++		[-6.19090136, -0.00214198, 0.00129668, 0.00215406, -0.00000105, 0.00000002],
++		[-6.19118298, -0.00214061, 0.00129591, 0.00215268, -0.00000105, 0.00000002],
++		[-6.19146366, -0.00213923, 0.00129513, 0.00215129, -0.00000105, 0.00000002],
++		[-6.19174338, -0.00213786, 0.00129436, 0.00214991, -0.00000105, 0.00000002],
++		[-6.19202217, -0.00213649, 0.00129359, 0.00214853, -0.00000105, 0.00000002],
++		[-6.19230001, -0.00213512, 0.00129281, 0.00214715, -0.00000105, 0.00000002],
++		[-6.19257691, -0.00213375, 0.00129204, 0.00214577, -0.00000105, 0.00000002],
++		[-6.19285288, -0.00213239, 0.00129127, 0.00214440, -0.00000105, 0.00000002],
++		[-6.19312792, -0.00213102, 0.00129050, 0.00214302, -0.00000105, 0.00000002],
++		[-6.19340203, -0.00212966, 0.00128973, 0.00214165, -0.00000105, 0.00000002],
++		[-6.19367521, -0.00212830, 0.00128896, 0.00214028, -0.00000105, 0.00000002],
++		[-6.19394748, -0.00212694, 0.00128819, 0.00213891, -0.00000105, 0.00000002],
++		[-6.19421882, -0.00212558, 0.00128743, 0.00213754, -0.00000105, 0.00000002],
++		[-6.19448924, -0.00212422, 0.00128666, 0.00213617, -0.00000105, 0.00000002],
++		[-6.19475875, -0.00212286, 0.00128589, 0.00213481, -0.00000105, 0.00000002],
++		[-6.19502735, -0.00212151, 0.00128513, 0.00213344, -0.00000105, 0.00000002],
++		[-6.19529504, -0.00212016, 0.00128436, 0.00213208, -0.00000106, 0.00000002],
++		[-6.19556183, -0.00211880, 0.00128360, 0.00213072, -0.00000106, 0.00000002],
++		[-6.19582771, -0.00211745, 0.00128283, 0.00212936, -0.00000106, 0.00000002],
++		[-6.19609270, -0.00211611, 0.00128207, 0.00212800, -0.00000106, 0.00000002],
++		[-6.19635678, -0.00211476, 0.00128131, 0.00212665, -0.00000106, 0.00000002],
++		[-6.19661998, -0.00211341, 0.00128054, 0.00212529, -0.00000106, 0.00000002],
++		[-6.19688228, -0.00211207, 0.00127978, 0.00212394, -0.00000106, 0.00000002],
++		[-6.19714369, -0.00211073, 0.00127902, 0.00212259, -0.00000106, 0.00000002],
++		[-6.19740422, -0.00210938, 0.00127826, 0.00212123, -0.00000106, 0.00000002],
++		[-6.19766387, -0.00210804, 0.00127750, 0.00211989, -0.00000106, 0.00000002],
++		[-6.19792264, -0.00210671, 0.00127674, 0.00211854, -0.00000106, 0.00000002],
++		[-6.19818053, -0.00210537, 0.00127599, 0.00211719, -0.00000106, 0.00000002],
++		[-6.19843754, -0.00210403, 0.00127523, 0.00211585, -0.00000106, 0.00000002],
++		[-6.19869369, -0.00210270, 0.00127447, 0.00211450, -0.00000106, 0.00000002],
++		[-6.19894896, -0.00210137, 0.00127372, 0.00211316, -0.00000106, 0.00000002],
++		[-6.19920337, -0.00210004, 0.00127296, 0.00211182, -0.00000106, 0.00000002],
++		[-6.19945692, -0.00209871, 0.00127221, 0.00211048, -0.00000106, 0.00000002],
++		[-6.19970961, -0.00209738, 0.00127145, 0.00210914, -0.00000106, 0.00000002],
++		[-6.19996144, -0.00209605, 0.00127070, 0.00210781, -0.00000106, 0.00000002],
++		[-6.20021242, -0.00209473, 0.00126995, 0.00210647, -0.00000107, 0.00000002],
++		[-6.20046254, -0.00209340, 0.00126919, 0.00210514, -0.00000107, 0.00000002],
++		[-6.20071181, -0.00209208, 0.00126844, 0.00210381, -0.00000107, 0.00000002],
++		[-6.20096024, -0.00209076, 0.00126769, 0.00210248, -0.00000107, 0.00000002],
++		[-6.20120782, -0.00208944, 0.00126694, 0.00210115, -0.00000107, 0.00000002],
++		[-6.20145457, -0.00208812, 0.00126619, 0.00209982, -0.00000107, 0.00000002],
++		[-6.20170047, -0.00208680, 0.00126544, 0.00209850, -0.00000107, 0.00000002],
++		[-6.20194554, -0.00208549, 0.00126469, 0.00209717, -0.00000107, 0.00000002],
++		[-6.20218978, -0.00208417, 0.00126395, 0.00209585, -0.00000107, 0.00000002],
++		[-6.20243318, -0.00208286, 0.00126320, 0.00209453, -0.00000107, 0.00000002],
++		[-6.20267576, -0.00208155, 0.00126245, 0.00209321, -0.00000107, 0.00000002],
++		[-6.20291751, -0.00208024, 0.00126171, 0.00209189, -0.00000107, 0.00000002],
++		[-6.20315844, -0.00207893, 0.00126096, 0.00209057, -0.00000107, 0.00000002],
++		[-6.20339855, -0.00207762, 0.00126022, 0.00208925, -0.00000107, 0.00000002],
++		[-6.20363785, -0.00207632, 0.00125947, 0.00208794, -0.00000107, 0.00000002],
++		[-6.20387633, -0.00207501, 0.00125873, 0.00208663, -0.00000107, 0.00000002],
++		[-6.20411399, -0.00207371, 0.00125799, 0.00208532, -0.00000107, 0.00000002],
++		[-6.20435085, -0.00207241, 0.00125725, 0.00208400, -0.00000107, 0.00000002],
++		[-6.20458690, -0.00207111, 0.00125650, 0.00208270, -0.00000107, 0.00000002],
++		[-6.20482215, -0.00206981, 0.00125576, 0.00208139, -0.00000107, 0.00000002],
++		[-6.20505660, -0.00206852, 0.00125502, 0.00208008, -0.00000107, 0.00000002],
++		[-6.20529024, -0.00206722, 0.00125428, 0.00207878, -0.00000108, 0.00000002],
++		[-6.20552310, -0.00206593, 0.00125355, 0.00207748, -0.00000108, 0.00000002],
++		[-6.20575515, -0.00206463, 0.00125281, 0.00207617, -0.00000108, 0.00000002],
++		[-6.20598642, -0.00206334, 0.00125207, 0.00207487, -0.00000108, 0.00000002],
++		[-6.20621690, -0.00206205, 0.00125133, 0.00207357, -0.00000108, 0.00000002],
++		[-6.20644659, -0.00206076, 0.00125060, 0.00207228, -0.00000108, 0.00000002],
++		[-6.20667550, -0.00205947, 0.00124986, 0.00207098, -0.00000108, 0.00000002],
++		[-6.20690362, -0.00205819, 0.00124913, 0.00206969, -0.00000108, 0.00000002],
++		[-6.20713097, -0.00205690, 0.00124839, 0.00206839, -0.00000108, 0.00000002],
++		[-6.20735754, -0.00205562, 0.00124766, 0.00206710, -0.00000108, 0.00000002],
++		[-6.20758334, -0.00205434, 0.00124693, 0.00206581, -0.00000108, 0.00000002],
++		[-6.20780837, -0.00205306, 0.00124619, 0.00206452, -0.00000108, 0.00000001],
++		[-6.20803263, -0.00205178, 0.00124546, 0.00206323, -0.00000108, 0.00000001],
++		[-6.20825612, -0.00205050, 0.00124473, 0.00206195, -0.00000108, 0.00000001],
++		[-6.20847885, -0.00204923, 0.00124400, 0.00206066, -0.00000108, 0.00000001],
++		[-6.20870082, -0.00204795, 0.00124327, 0.00205938, -0.00000108, 0.00000001],
++		[-6.20892203, -0.00204668, 0.00124254, 0.00205810, -0.00000108, 0.00000001],
++		[-6.20914249, -0.00204540, 0.00124181, 0.00205681, -0.00000108, 0.00000001],
++		[-6.20936219, -0.00204413, 0.00124109, 0.00205554, -0.00000108, 0.00000001],
++		[-6.20958114, -0.00204286, 0.00124036, 0.00205426, -0.00000108, 0.00000001],
++		[-6.20979934, -0.00204160, 0.00123963, 0.00205298, -0.00000108, 0.00000001],
++		[-6.21001679, -0.00204033, 0.00123891, 0.00205171, -0.00000108, 0.00000001],
++		[-6.21023350, -0.00203906, 0.00123818, 0.00205043, -0.00000108, 0.00000001],
++		[-6.21044947, -0.00203780, 0.00123746, 0.00204916, -0.00000109, 0.00000001],
++		[-6.21066470, -0.00203654, 0.00123673, 0.00204789, -0.00000109, 0.00000001],
++		[-6.21087920, -0.00203528, 0.00123601, 0.00204662, -0.00000109, 0.00000001],
++		[-6.21109295, -0.00203402, 0.00123529, 0.00204535, -0.00000109, 0.00000001],
++		[-6.21130598, -0.00203276, 0.00123456, 0.00204408, -0.00000109, 0.00000001],
++		[-6.21151828, -0.00203150, 0.00123384, 0.00204282, -0.00000109, 0.00000001],
++		[-6.21172985, -0.00203024, 0.00123312, 0.00204155, -0.00000109, 0.00000001],
++		[-6.21194069, -0.00202899, 0.00123240, 0.00204029, -0.00000109, 0.00000001],
++		[-6.21215082, -0.00202774, 0.00123168, 0.00203903, -0.00000109, 0.00000001],
++		[-6.21236022, -0.00202648, 0.00123096, 0.00203777, -0.00000109, 0.00000001],
++		[-6.21256890, -0.00202523, 0.00123025, 0.00203651, -0.00000109, 0.00000001],
++		[-6.21277687, -0.00202398, 0.00122953, 0.00203525, -0.00000109, 0.00000001],
++		[-6.21298413, -0.00202274, 0.00122881, 0.00203399, -0.00000109, 0.00000001],
++		[-6.21319067, -0.00202149, 0.00122809, 0.00203274, -0.00000109, 0.00000001],
++		[-6.21339651, -0.00202025, 0.00122738, 0.00203149, -0.00000109, 0.00000001],
++		[-6.21360164, -0.00201900, 0.00122666, 0.00203023, -0.00000109, 0.00000001],
++		[-6.21380607, -0.00201776, 0.00122595, 0.00202898, -0.00000109, 0.00000001],
++		[-6.21400979, -0.00201652, 0.00122523, 0.00202773, -0.00000109, 0.00000001],
++		[-6.21421282, -0.00201528, 0.00122452, 0.00202649, -0.00000109, 0.00000001],
++		[-6.21441515, -0.00201404, 0.00122381, 0.00202524, -0.00000109, 0.00000001],
++		[-6.21461678, -0.00201280, 0.00122310, 0.00202399, -0.00000109, 0.00000001],
++		[-6.21481773, -0.00201157, 0.00122239, 0.00202275, -0.00000109, 0.00000001],
++		[-6.21501798, -0.00201033, 0.00122167, 0.00202151, -0.00000109, 0.00000001],
++		[-6.21521754, -0.00200910, 0.00122096, 0.00202026, -0.00000109, 0.00000001],
++		[-6.21541642, -0.00200787, 0.00122026, 0.00201902, -0.00000110, 0.00000001],
++		[-6.21561461, -0.00200664, 0.00121955, 0.00201779, -0.00000110, 0.00000001],
++		[-6.21581213, -0.00200541, 0.00121884, 0.00201655, -0.00000110, 0.00000001],
++		[-6.21600896, -0.00200418, 0.00121813, 0.00201531, -0.00000110, 0.00000001],
++		[-6.21620512, -0.00200295, 0.00121742, 0.00201408, -0.00000110, 0.00000001],
++		[-6.21640060, -0.00200173, 0.00121672, 0.00201284, -0.00000110, 0.00000001],
++		[-6.21659541, -0.00200050, 0.00121601, 0.00201161, -0.00000110, 0.00000001],
++		[-6.21678955, -0.00199928, 0.00121531, 0.00201038, -0.00000110, 0.00000001],
++		[-6.21698302, -0.00199806, 0.00121460, 0.00200915, -0.00000110, 0.00000001],
++		[-6.21717583, -0.00199684, 0.00121390, 0.00200792, -0.00000110, 0.00000001],
++		[-6.21736797, -0.00199562, 0.00121320, 0.00200670, -0.00000110, 0.00000001],
++		[-6.21755945, -0.00199440, 0.00121249, 0.00200547, -0.00000110, 0.00000001],
++		[-6.21775028, -0.00199319, 0.00121179, 0.00200425, -0.00000110, 0.00000001],
++		[-6.21794044, -0.00199197, 0.00121109, 0.00200302, -0.00000110, 0.00000001],
++		[-6.21812995, -0.00199076, 0.00121039, 0.00200180, -0.00000110, 0.00000001],
++		[-6.21831881, -0.00198955, 0.00120969, 0.00200058, -0.00000110, 0.00000001],
++		[-6.21850702, -0.00198833, 0.00120899, 0.00199936, -0.00000110, 0.00000001],
++		[-6.21869457, -0.00198712, 0.00120829, 0.00199815, -0.00000110, 0.00000001],
++		[-6.21888149, -0.00198592, 0.00120759, 0.00199693, -0.00000110, 0.00000001],
++		[-6.21906775, -0.00198471, 0.00120689, 0.00199571, -0.00000110, 0.00000001],
++		[-6.21925338, -0.00198350, 0.00120620, 0.00199450, -0.00000110, 0.00000001],
++		[-6.21943836, -0.00198230, 0.00120550, 0.00199329, -0.00000110, 0.00000001],
++		[-6.21962271, -0.00198110, 0.00120481, 0.00199208, -0.00000110, 0.00000001],
++		[-6.21980642, -0.00197989, 0.00120411, 0.00199087, -0.00000110, 0.00000001],
++		[-6.21998950, -0.00197869, 0.00120342, 0.00198966, -0.00000110, 0.00000001],
++		[-6.22017194, -0.00197749, 0.00120272, 0.00198845, -0.00000110, 0.00000001],
++		[-6.22035376, -0.00197630, 0.00120203, 0.00198724, -0.00000110, 0.00000001],
++		[-6.22053495, -0.00197510, 0.00120134, 0.00198604, -0.00000110, 0.00000001],
++		[-6.22071551, -0.00197390, 0.00120064, 0.00198484, -0.00000111, 0.00000001],
++		[-6.22089545, -0.00197271, 0.00119995, 0.00198363, -0.00000111, 0.00000001],
++		[-6.22107477, -0.00197152, 0.00119926, 0.00198243, -0.00000111, 0.00000001],
++		[-6.22125347, -0.00197032, 0.00119857, 0.00198123, -0.00000111, 0.00000001],
++		[-6.22143155, -0.00196913, 0.00119788, 0.00198003, -0.00000111, 0.00000001],
++		[-6.22160902, -0.00196794, 0.00119719, 0.00197884, -0.00000111, 0.00000001],
++		[-6.22178587, -0.00196676, 0.00119650, 0.00197764, -0.00000111, 0.00000001],
++		[-6.22196211, -0.00196557, 0.00119582, 0.00197645, -0.00000111, 0.00000001],
++		[-6.22213774, -0.00196438, 0.00119513, 0.00197525, -0.00000111, 0.00000001],
++		[-6.22231277, -0.00196320, 0.00119444, 0.00197406, -0.00000111, 0.00000001],
++		[-6.22248719, -0.00196202, 0.00119376, 0.00197287, -0.00000111, 0.00000001],
++		[-6.22266101, -0.00196083, 0.00119307, 0.00197168, -0.00000111, 0.00000001],
++		[-6.22283422, -0.00195965, 0.00119239, 0.00197049, -0.00000111, 0.00000001],
++		[-6.22300684, -0.00195848, 0.00119170, 0.00196931, -0.00000111, 0.00000001],
++		[-6.22317886, -0.00195730, 0.00119102, 0.00196812, -0.00000111, 0.00000001],
++		[-6.22335028, -0.00195612, 0.00119034, 0.00196694, -0.00000111, 0.00000001],
++		[-6.22352111, -0.00195495, 0.00118965, 0.00196575, -0.00000111, 0.00000001],
++		[-6.22369135, -0.00195377, 0.00118897, 0.00196457, -0.00000111, 0.00000001],
++		[-6.22386100, -0.00195260, 0.00118829, 0.00196339, -0.00000111, 0.00000001],
++		[-6.22403007, -0.00195143, 0.00118761, 0.00196221, -0.00000111, 0.00000001],
++		[-6.22419854, -0.00195026, 0.00118693, 0.00196103, -0.00000111, 0.00000001],
++		[-6.22436644, -0.00194909, 0.00118625, 0.00195986, -0.00000111, 0.00000001],
++		[-6.22453375, -0.00194792, 0.00118557, 0.00195868, -0.00000111, 0.00000001],
++		[-6.22470048, -0.00194675, 0.00118490, 0.00195751, -0.00000111, 0.00000001],
++		[-6.22486664, -0.00194559, 0.00118422, 0.00195633, -0.00000111, 0.00000001],
++		[-6.22503222, -0.00194442, 0.00118354, 0.00195516, -0.00000111, 0.00000001],
++		[-6.22519722, -0.00194326, 0.00118287, 0.00195399, -0.00000111, 0.00000001],
++		[-6.22536166, -0.00194210, 0.00118219, 0.00195282, -0.00000111, 0.00000001],
++		[-6.22552552, -0.00194094, 0.00118152, 0.00195165, -0.00000111, 0.00000001],
++		[-6.22568881, -0.00193978, 0.00118084, 0.00195049, -0.00000111, 0.00000001],
++		[-6.22585154, -0.00193862, 0.00118017, 0.00194932, -0.00000112, 0.00000001],
++		[-6.22601370, -0.00193746, 0.00117950, 0.00194816, -0.00000112, 0.00000001],
++		[-6.22617531, -0.00193631, 0.00117882, 0.00194699, -0.00000112, 0.00000001],
++		[-6.22633635, -0.00193515, 0.00117815, 0.00194583, -0.00000112, 0.00000001],
++		[-6.22649683, -0.00193400, 0.00117748, 0.00194467, -0.00000112, 0.00000001],
++		[-6.22665675, -0.00193285, 0.00117681, 0.00194351, -0.00000112, 0.00000001],
++		[-6.22681612, -0.00193170, 0.00117614, 0.00194235, -0.00000112, 0.00000001],
++		[-6.22697494, -0.00193055, 0.00117547, 0.00194120, -0.00000112, 0.00000001],
++		[-6.22713320, -0.00192940, 0.00117480, 0.00194004, -0.00000112, 0.00000001],
++		[-6.22729092, -0.00192825, 0.00117413, 0.00193889, -0.00000112, 0.00000001],
++		[-6.22744808, -0.00192711, 0.00117346, 0.00193773, -0.00000112, 0.00000001],
++		[-6.22760470, -0.00192596, 0.00117280, 0.00193658, -0.00000112, 0.00000001],
++		[-6.22776078, -0.00192482, 0.00117213, 0.00193543, -0.00000112, 0.00000001],
++		[-6.22791631, -0.00192368, 0.00117147, 0.00193428, -0.00000112, 0.00000001],
++		[-6.22807131, -0.00192253, 0.00117080, 0.00193313, -0.00000112, 0.00000001],
++		[-6.22822576, -0.00192139, 0.00117014, 0.00193198, -0.00000112, 0.00000001],
++		[-6.22837968, -0.00192026, 0.00116947, 0.00193084, -0.00000112, 0.00000001],
++		[-6.22853306, -0.00191912, 0.00116881, 0.00192969, -0.00000112, 0.00000001],
++		[-6.22868591, -0.00191798, 0.00116815, 0.00192855, -0.00000112, 0.00000001],
++		[-6.22883823, -0.00191685, 0.00116748, 0.00192741, -0.00000112, 0.00000001],
++		[-6.22899002, -0.00191571, 0.00116682, 0.00192627, -0.00000112, 0.00000001],
++		[-6.22914128, -0.00191458, 0.00116616, 0.00192513, -0.00000112, 0.00000001],
++		[-6.22929201, -0.00191345, 0.00116550, 0.00192399, -0.00000112, 0.00000001],
++		[-6.22944222, -0.00191232, 0.00116484, 0.00192285, -0.00000112, 0.00000001],
++		[-6.22959190, -0.00191119, 0.00116418, 0.00192171, -0.00000112, 0.00000001],
++		[-6.22974107, -0.00191006, 0.00116352, 0.00192058, -0.00000112, 0.00000001],
++		[-6.22988971, -0.00190893, 0.00116286, 0.00191944, -0.00000112, 0.00000001],
++		[-6.23003784, -0.00190781, 0.00116221, 0.00191831, -0.00000112, 0.00000001],
++		[-6.23018545, -0.00190669, 0.00116155, 0.00191718, -0.00000112, 0.00000001],
++		[-6.23033255, -0.00190556, 0.00116089, 0.00191605, -0.00000112, 0.00000001],
++		[-6.23047913, -0.00190444, 0.00116024, 0.00191492, -0.00000112, 0.00000001],
++		[-6.23062521, -0.00190332, 0.00115958, 0.00191379, -0.00000112, 0.00000001],
++		[-6.23077077, -0.00190220, 0.00115893, 0.00191267, -0.00000112, 0.00000001],
++		[-6.23091583, -0.00190108, 0.00115828, 0.00191154, -0.00000112, 0.00000001],
++		[-6.23106038, -0.00189996, 0.00115762, 0.00191042, -0.00000113, 0.00000001],
++		[-6.23120443, -0.00189885, 0.00115697, 0.00190929, -0.00000113, 0.00000001],
++		[-6.23134798, -0.00189773, 0.00115632, 0.00190817, -0.00000113, 0.00000001],
++		[-6.23149102, -0.00189662, 0.00115567, 0.00190705, -0.00000113, 0.00000001],
++		[-6.23163357, -0.00189551, 0.00115501, 0.00190593, -0.00000113, 0.00000001],
++		[-6.23177562, -0.00189439, 0.00115436, 0.00190481, -0.00000113, 0.00000001],
++		[-6.23191717, -0.00189328, 0.00115371, 0.00190369, -0.00000113, 0.00000001],
++		[-6.23205823, -0.00189218, 0.00115307, 0.00190258, -0.00000113, 0.00000001],
++		[-6.23219880, -0.00189107, 0.00115242, 0.00190146, -0.00000113, 0.00000001],
++		[-6.23233888, -0.00188996, 0.00115177, 0.00190035, -0.00000113, 0.00000001],
++		[-6.23247846, -0.00188886, 0.00115112, 0.00189924, -0.00000113, 0.00000001],
++		[-6.23261756, -0.00188775, 0.00115047, 0.00189812, -0.00000113, 0.00000001],
++		[-6.23275618, -0.00188665, 0.00114983, 0.00189701, -0.00000113, 0.00000001],
++		[-6.23289431, -0.00188555, 0.00114918, 0.00189591, -0.00000113, 0.00000001],
++		[-6.23303196, -0.00188444, 0.00114854, 0.00189480, -0.00000113, 0.00000001],
++		[-6.23316912, -0.00188334, 0.00114789, 0.00189369, -0.00000113, 0.00000001],
++		[-6.23330581, -0.00188225, 0.00114725, 0.00189258, -0.00000113, 0.00000001],
++		[-6.23344202, -0.00188115, 0.00114661, 0.00189148, -0.00000113, 0.00000001],
++		[-6.23357776, -0.00188005, 0.00114596, 0.00189038, -0.00000113, 0.00000001],
++		[-6.23371302, -0.00187896, 0.00114532, 0.00188927, -0.00000113, 0.00000001],
++		[-6.23384781, -0.00187786, 0.00114468, 0.00188817, -0.00000113, 0.00000001],
++		[-6.23398212, -0.00187677, 0.00114404, 0.00188707, -0.00000113, 0.00000001],
++		[-6.23411597, -0.00187568, 0.00114340, 0.00188598, -0.00000113, 0.00000001],
++		[-6.23424935, -0.00187459, 0.00114276, 0.00188488, -0.00000113, 0.00000001],
++		[-6.23438226, -0.00187350, 0.00114212, 0.00188378, -0.00000113, 0.00000001],
++		[-6.23451471, -0.00187241, 0.00114148, 0.00188269, -0.00000113, 0.00000001],
++		[-6.23464669, -0.00187132, 0.00114084, 0.00188159, -0.00000113, 0.00000001],
++		[-6.23477821, -0.00187024, 0.00114021, 0.00188050, -0.00000113, 0.00000001],
++		[-6.23490927, -0.00186915, 0.00113957, 0.00187941, -0.00000113, 0.00000001],
++		[-6.23503988, -0.00186807, 0.00113893, 0.00187832, -0.00000113, 0.00000001],
++		[-6.23517002, -0.00186698, 0.00113830, 0.00187723, -0.00000113, 0.00000001],
++		[-6.23529971, -0.00186590, 0.00113766, 0.00187614, -0.00000113, 0.00000001],
++		[-6.23542895, -0.00186482, 0.00113703, 0.00187505, -0.00000113, 0.00000001],
++		[-6.23555773, -0.00186374, 0.00113639, 0.00187396, -0.00000113, 0.00000001],
++		[-6.23568606, -0.00186267, 0.00113576, 0.00187288, -0.00000113, 0.00000001],
++		[-6.23581395, -0.00186159, 0.00113513, 0.00187180, -0.00000113, 0.00000001],
++		[-6.23594138, -0.00186051, 0.00113449, 0.00187071, -0.00000113, 0.00000001],
++		[-6.23606837, -0.00185944, 0.00113386, 0.00186963, -0.00000113, 0.00000001],
++		[-6.23619491, -0.00185836, 0.00113323, 0.00186855, -0.00000113, 0.00000001],
++		[-6.23632102, -0.00185729, 0.00113260, 0.00186747, -0.00000113, 0.00000001],
++		[-6.23644667, -0.00185622, 0.00113197, 0.00186639, -0.00000114, 0.00000001],
++		[-6.23657189, -0.00185515, 0.00113134, 0.00186532, -0.00000114, 0.00000001],
++		[-6.23669667, -0.00185408, 0.00113071, 0.00186424, -0.00000114, 0.00000001],
++		[-6.23682101, -0.00185301, 0.00113009, 0.00186317, -0.00000114, 0.00000001],
++		[-6.23694492, -0.00185195, 0.00112946, 0.00186209, -0.00000114, 0.00000001],
++		[-6.23706839, -0.00185088, 0.00112883, 0.00186102, -0.00000114, 0.00000001],
++		[-6.23719143, -0.00184981, 0.00112820, 0.00185995, -0.00000114, 0.00000001],
++		[-6.23731403, -0.00184875, 0.00112758, 0.00185888, -0.00000114, 0.00000001],
++		[-6.23743621, -0.00184769, 0.00112695, 0.00185781, -0.00000114, 0.00000001],
++		[-6.23755795, -0.00184663, 0.00112633, 0.00185674, -0.00000114, 0.00000001],
++		[-6.23767927, -0.00184557, 0.00112570, 0.00185567, -0.00000114, 0.00000001],
++		[-6.23780017, -0.00184451, 0.00112508, 0.00185461, -0.00000114, 0.00000001],
++		[-6.23792064, -0.00184345, 0.00112446, 0.00185354, -0.00000114, 0.00000001],
++		[-6.23804068, -0.00184239, 0.00112383, 0.00185248, -0.00000114, 0.00000001],
++		[-6.23816031, -0.00184134, 0.00112321, 0.00185142, -0.00000114, 0.00000001],
++		[-6.23827952, -0.00184028, 0.00112259, 0.00185035, -0.00000114, 0.00000001],
++		[-6.23839830, -0.00183923, 0.00112197, 0.00184929, -0.00000114, 0.00000001],
++		[-6.23851667, -0.00183817, 0.00112135, 0.00184823, -0.00000114, 0.00000001],
++		[-6.23863462, -0.00183712, 0.00112073, 0.00184718, -0.00000114, 0.00000001],
++		[-6.23875216, -0.00183607, 0.00112011, 0.00184612, -0.00000114, 0.00000001],
++		[-6.23886929, -0.00183502, 0.00111949, 0.00184506, -0.00000114, 0.00000001],
++		[-6.23898600, -0.00183398, 0.00111887, 0.00184401, -0.00000114, 0.00000001],
++		[-6.23910231, -0.00183293, 0.00111826, 0.00184295, -0.00000114, 0.00000001],
++		[-6.23921820, -0.00183188, 0.00111764, 0.00184190, -0.00000114, 0.00000001],
++		[-6.23933369, -0.00183084, 0.00111702, 0.00184085, -0.00000114, 0.00000001],
++		[-6.23944877, -0.00182979, 0.00111641, 0.00183980, -0.00000114, 0.00000001],
++		[-6.23956345, -0.00182875, 0.00111579, 0.00183875, -0.00000114, 0.00000001],
++		[-6.23967773, -0.00182771, 0.00111518, 0.00183770, -0.00000114, 0.00000001],
++		[-6.23979160, -0.00182667, 0.00111456, 0.00183665, -0.00000114, 0.00000001],
++		[-6.23990507, -0.00182563, 0.00111395, 0.00183561, -0.00000114, 0.00000001],
++		[-6.24001814, -0.00182459, 0.00111334, 0.00183456, -0.00000114, 0.00000001],
++		[-6.24013082, -0.00182355, 0.00111273, 0.00183352, -0.00000114, 0.00000001],
++		[-6.24024309, -0.00182251, 0.00111211, 0.00183248, -0.00000114, 0.00000001],
++		[-6.24035498, -0.00182148, 0.00111150, 0.00183143, -0.00000114, 0.00000001],
++		[-6.24046647, -0.00182045, 0.00111089, 0.00183039, -0.00000114, 0.00000001],
++		[-6.24057756, -0.00181941, 0.00111028, 0.00182935, -0.00000114, 0.00000001],
++		[-6.24068827, -0.00181838, 0.00110967, 0.00182831, -0.00000114, 0.00000001],
++		[-6.24079858, -0.00181735, 0.00110906, 0.00182728, -0.00000114, 0.00000001],
++		[-6.24090851, -0.00181632, 0.00110846, 0.00182624, -0.00000114, 0.00000001],
++		[-6.24101805, -0.00181529, 0.00110785, 0.00182521, -0.00000114, 0.00000001],
++		[-6.24112720, -0.00181426, 0.00110724, 0.00182417, -0.00000114, 0.00000001],
++		[-6.24123597, -0.00181324, 0.00110663, 0.00182314, -0.00000114, 0.00000001],
++		[-6.24134436, -0.00181221, 0.00110603, 0.00182211, -0.00000114, 0.00000001],
++		[-6.24145237, -0.00181118, 0.00110542, 0.00182107, -0.00000114, 0.00000001],
++		[-6.24155999, -0.00181016, 0.00110482, 0.00182004, -0.00000114, 0.00000001],
++		[-6.24166723, -0.00180914, 0.00110421, 0.00181902, -0.00000114, 0.00000001],
++		[-6.24177410, -0.00180812, 0.00110361, 0.00181799, -0.00000114, 0.00000001],
++		[-6.24188059, -0.00180710, 0.00110300, 0.00181696, -0.00000115, 0.00000001],
++		[-6.24198671, -0.00180608, 0.00110240, 0.00181593, -0.00000115, 0.00000001],
++		[-6.24209245, -0.00180506, 0.00110180, 0.00181491, -0.00000115, 0.00000001],
++		[-6.24219781, -0.00180404, 0.00110120, 0.00181389, -0.00000115, 0.00000001],
++		[-6.24230281, -0.00180302, 0.00110060, 0.00181286, -0.00000115, 0.00000001],
++		[-6.24240743, -0.00180201, 0.00110000, 0.00181184, -0.00000115, 0.00000001],
++		[-6.24251169, -0.00180100, 0.00109940, 0.00181082, -0.00000115, 0.00000001],
++		[-6.24261558, -0.00179998, 0.00109880, 0.00180980, -0.00000115, 0.00000001],
++		[-6.24271910, -0.00179897, 0.00109820, 0.00180878, -0.00000115, 0.00000001],
++		[-6.24282226, -0.00179796, 0.00109760, 0.00180777, -0.00000115, 0.00000001],
++		[-6.24292505, -0.00179695, 0.00109700, 0.00180675, -0.00000115, 0.00000001],
++		[-6.24302748, -0.00179594, 0.00109640, 0.00180573, -0.00000115, 0.00000001],
++		[-6.24312955, -0.00179493, 0.00109581, 0.00180472, -0.00000115, 0.00000001],
++		[-6.24323126, -0.00179392, 0.00109521, 0.00180371, -0.00000115, 0.00000001],
++		[-6.24333261, -0.00179292, 0.00109461, 0.00180269, -0.00000115, 0.00000001],
++		[-6.24343360, -0.00179191, 0.00109402, 0.00180168, -0.00000115, 0.00000001],
++		[-6.24353423, -0.00179091, 0.00109342, 0.00180067, -0.00000115, 0.00000001],
++		[-6.24363451, -0.00178991, 0.00109283, 0.00179966, -0.00000115, 0.00000001],
++		[-6.24373444, -0.00178891, 0.00109224, 0.00179866, -0.00000115, 0.00000001],
++		[-6.24383401, -0.00178790, 0.00109164, 0.00179765, -0.00000115, 0.00000001],
++		[-6.24393323, -0.00178690, 0.00109105, 0.00179664, -0.00000115, 0.00000001],
++		[-6.24403210, -0.00178591, 0.00109046, 0.00179564, -0.00000115, 0.00000001],
++		[-6.24413062, -0.00178491, 0.00108987, 0.00179463, -0.00000115, 0.00000001],
++		[-6.24422879, -0.00178391, 0.00108928, 0.00179363, -0.00000115, 0.00000001],
++		[-6.24432661, -0.00178292, 0.00108869, 0.00179263, -0.00000115, 0.00000001],
++		[-6.24442409, -0.00178192, 0.00108810, 0.00179163, -0.00000115, 0.00000001],
++		[-6.24452123, -0.00178093, 0.00108751, 0.00179063, -0.00000115, 0.00000000],
++		[-6.24461802, -0.00177993, 0.00108692, 0.00178963, -0.00000115, 0.00000000],
++		[-6.24471446, -0.00177894, 0.00108633, 0.00178863, -0.00000115, 0.00000000],
++		[-6.24481057, -0.00177795, 0.00108574, 0.00178764, -0.00000115, 0.00000000],
++		[-6.24490634, -0.00177696, 0.00108516, 0.00178664, -0.00000115, 0.00000000],
++		[-6.24500177, -0.00177597, 0.00108457, 0.00178565, -0.00000115, 0.00000000],
++		[-6.24509686, -0.00177499, 0.00108398, 0.00178465, -0.00000115, 0.00000000],
++		[-6.24519161, -0.00177400, 0.00108340, 0.00178366, -0.00000115, 0.00000000],
++		[-6.24528603, -0.00177301, 0.00108281, 0.00178267, -0.00000115, 0.00000000],
++		[-6.24538012, -0.00177203, 0.00108223, 0.00178168, -0.00000115, 0.00000000],
++		[-6.24547387, -0.00177105, 0.00108164, 0.00178069, -0.00000115, 0.00000000],
++		[-6.24556729, -0.00177006, 0.00108106, 0.00177970, -0.00000115, 0.00000000],
++		[-6.24566038, -0.00176908, 0.00108048, 0.00177871, -0.00000115, 0.00000000],
++		[-6.24575314, -0.00176810, 0.00107990, 0.00177772, -0.00000115, 0.00000000],
++		[-6.24584557, -0.00176712, 0.00107931, 0.00177674, -0.00000115, 0.00000000],
++		[-6.24593768, -0.00176614, 0.00107873, 0.00177575, -0.00000115, 0.00000000],
++		[-6.24602946, -0.00176517, 0.00107815, 0.00177477, -0.00000115, 0.00000000],
++		[-6.24612091, -0.00176419, 0.00107757, 0.00177379, -0.00000115, 0.00000000],
++		[-6.24621204, -0.00176321, 0.00107699, 0.00177281, -0.00000115, 0.00000000],
++		[-6.24630285, -0.00176224, 0.00107641, 0.00177183, -0.00000115, 0.00000000],
++		[-6.24639333, -0.00176127, 0.00107584, 0.00177085, -0.00000115, 0.00000000],
++		[-6.24648350, -0.00176029, 0.00107526, 0.00176987, -0.00000115, 0.00000000],
++		[-6.24657334, -0.00175932, 0.00107468, 0.00176889, -0.00000115, 0.00000000],
++		[-6.24666287, -0.00175835, 0.00107410, 0.00176791, -0.00000115, 0.00000000],
++		[-6.24675208, -0.00175738, 0.00107353, 0.00176694, -0.00000115, 0.00000000],
++		[-6.24684097, -0.00175641, 0.00107295, 0.00176596, -0.00000115, 0.00000000],
++		[-6.24692955, -0.00175545, 0.00107238, 0.00176499, -0.00000115, 0.00000000],
++		[-6.24701781, -0.00175448, 0.00107180, 0.00176402, -0.00000115, 0.00000000],
++		[-6.24710576, -0.00175351, 0.00107123, 0.00176305, -0.00000115, 0.00000000],
++		[-6.24719340, -0.00175255, 0.00107065, 0.00176207, -0.00000115, 0.00000000],
++		[-6.24728073, -0.00175158, 0.00107008, 0.00176110, -0.00000115, 0.00000000],
++		[-6.24736775, -0.00175062, 0.00106951, 0.00176014, -0.00000115, 0.00000000],
++		[-6.24745446, -0.00174966, 0.00106893, 0.00175917, -0.00000115, 0.00000000],
++		[-6.24754086, -0.00174870, 0.00106836, 0.00175820, -0.00000115, 0.00000000],
++		[-6.24762695, -0.00174774, 0.00106779, 0.00175724, -0.00000116, 0.00000000],
++		[-6.24771274, -0.00174678, 0.00106722, 0.00175627, -0.00000116, 0.00000000],
++		[-6.24779823, -0.00174582, 0.00106665, 0.00175531, -0.00000116, 0.00000000],
++		[-6.24788341, -0.00174487, 0.00106608, 0.00175434, -0.00000116, 0.00000000],
++		[-6.24796829, -0.00174391, 0.00106551, 0.00175338, -0.00000116, 0.00000000],
++		[-6.24805287, -0.00174296, 0.00106494, 0.00175242, -0.00000116, 0.00000000],
++		[-6.24813715, -0.00174200, 0.00106438, 0.00175146, -0.00000116, 0.00000000],
++		[-6.24822113, -0.00174105, 0.00106381, 0.00175050, -0.00000116, 0.00000000],
++		[-6.24830481, -0.00174010, 0.00106324, 0.00174955, -0.00000116, 0.00000000],
++		[-6.24838819, -0.00173915, 0.00106267, 0.00174859, -0.00000116, 0.00000000],
++		[-6.24847128, -0.00173819, 0.00106211, 0.00174763, -0.00000116, 0.00000000],
++		[-6.24855407, -0.00173725, 0.00106154, 0.00174668, -0.00000116, 0.00000000],
++		[-6.24863657, -0.00173630, 0.00106098, 0.00174572, -0.00000116, 0.00000000],
++		[-6.24871878, -0.00173535, 0.00106041, 0.00174477, -0.00000116, 0.00000000],
++		[-6.24880069, -0.00173440, 0.00105985, 0.00174382, -0.00000116, 0.00000000],
++		[-6.24888231, -0.00173346, 0.00105929, 0.00174287, -0.00000116, 0.00000000],
++		[-6.24896365, -0.00173251, 0.00105872, 0.00174192, -0.00000116, 0.00000000],
++		[-6.24904469, -0.00173157, 0.00105816, 0.00174097, -0.00000116, 0.00000000],
++		[-6.24912545, -0.00173063, 0.00105760, 0.00174002, -0.00000116, 0.00000000],
++		[-6.24920591, -0.00172969, 0.00105704, 0.00173907, -0.00000116, 0.00000000],
++		[-6.24928610, -0.00172875, 0.00105648, 0.00173813, -0.00000116, 0.00000000],
++		[-6.24936599, -0.00172781, 0.00105592, 0.00173718, -0.00000116, 0.00000000],
++		[-6.24944561, -0.00172687, 0.00105536, 0.00173624, -0.00000116, 0.00000000],
++		[-6.24952494, -0.00172593, 0.00105480, 0.00173529, -0.00000116, 0.00000000],
++		[-6.24960399, -0.00172499, 0.00105424, 0.00173435, -0.00000116, 0.00000000],
++		[-6.24968275, -0.00172406, 0.00105368, 0.00173341, -0.00000116, 0.00000000],
++		[-6.24976124, -0.00172312, 0.00105312, 0.00173247, -0.00000116, 0.00000000],
++		[-6.24983945, -0.00172219, 0.00105257, 0.00173153, -0.00000116, 0.00000000],
++		[-6.24991738, -0.00172126, 0.00105201, 0.00173059, -0.00000116, 0.00000000],
++		[-6.24999503, -0.00172032, 0.00105145, 0.00172965, -0.00000116, 0.00000000],
++		[-6.25007241, -0.00171939, 0.00105090, 0.00172871, -0.00000116, 0.00000000],
++		[-6.25014951, -0.00171846, 0.00105034, 0.00172778, -0.00000116, 0.00000000],
++		[-6.25022634, -0.00171753, 0.00104979, 0.00172684, -0.00000116, 0.00000000],
++		[-6.25030289, -0.00171660, 0.00104923, 0.00172591, -0.00000116, 0.00000000],
++		[-6.25037917, -0.00171568, 0.00104868, 0.00172498, -0.00000116, 0.00000000],
++		[-6.25045518, -0.00171475, 0.00104813, 0.00172404, -0.00000116, 0.00000000],
++		[-6.25053092, -0.00171382, 0.00104758, 0.00172311, -0.00000116, 0.00000000],
++		[-6.25060639, -0.00171290, 0.00104702, 0.00172218, -0.00000116, 0.00000000],
++		[-6.25068159, -0.00171198, 0.00104647, 0.00172125, -0.00000116, 0.00000000],
++		[-6.25075652, -0.00171105, 0.00104592, 0.00172032, -0.00000116, 0.00000000],
++		[-6.25083119, -0.00171013, 0.00104537, 0.00171940, -0.00000116, 0.00000000],
++		[-6.25090559, -0.00170921, 0.00104482, 0.00171847, -0.00000116, 0.00000000],
++		[-6.25097972, -0.00170829, 0.00104427, 0.00171754, -0.00000116, 0.00000000],
++		[-6.25105359, -0.00170737, 0.00104372, 0.00171662, -0.00000116, 0.00000000],
++		[-6.25112720, -0.00170645, 0.00104317, 0.00171570, -0.00000116, 0.00000000],
++		[-6.25120055, -0.00170554, 0.00104262, 0.00171477, -0.00000116, 0.00000000],
++		[-6.25127363, -0.00170462, 0.00104208, 0.00171385, -0.00000116, 0.00000000],
++		[-6.25134646, -0.00170370, 0.00104153, 0.00171293, -0.00000116, 0.00000000],
++		[-6.25141902, -0.00170279, 0.00104098, 0.00171201, -0.00000116, 0.00000000],
++		[-6.25149133, -0.00170188, 0.00104044, 0.00171109, -0.00000116, 0.00000000],
++		[-6.25156338, -0.00170096, 0.00103989, 0.00171017, -0.00000116, 0.00000000],
++		[-6.25163517, -0.00170005, 0.00103935, 0.00170926, -0.00000116, 0.00000000],
++		[-6.25170670, -0.00169914, 0.00103880, 0.00170834, -0.00000116, 0.00000000],
++		[-6.25177798, -0.00169823, 0.00103826, 0.00170742, -0.00000116, 0.00000000],
++		[-6.25184901, -0.00169732, 0.00103771, 0.00170651, -0.00000116, 0.00000000],
++		[-6.25191978, -0.00169641, 0.00103717, 0.00170560, -0.00000116, 0.00000000],
++		[-6.25199031, -0.00169551, 0.00103663, 0.00170468, -0.00000116, 0.00000000],
++		[-6.25206057, -0.00169460, 0.00103609, 0.00170377, -0.00000116, 0.00000000],
++		[-6.25213059, -0.00169369, 0.00103555, 0.00170286, -0.00000116, 0.00000000],
++		[-6.25220036, -0.00169279, 0.00103500, 0.00170195, -0.00000116, 0.00000000],
++		[-6.25226988, -0.00169189, 0.00103446, 0.00170104, -0.00000116, 0.00000000],
++		[-6.25233916, -0.00169098, 0.00103392, 0.00170013, -0.00000116, 0.00000000],
++		[-6.25240818, -0.00169008, 0.00103338, 0.00169923, -0.00000116, 0.00000000],
++		[-6.25247696, -0.00168918, 0.00103285, 0.00169832, -0.00000116, 0.00000000],
++		[-6.25254550, -0.00168828, 0.00103231, 0.00169741, -0.00000116, 0.00000000],
++		[-6.25261379, -0.00168738, 0.00103177, 0.00169651, -0.00000116, 0.00000000],
++		[-6.25268183, -0.00168648, 0.00103123, 0.00169560, -0.00000116, 0.00000000],
++		[-6.25274963, -0.00168559, 0.00103069, 0.00169470, -0.00000116, 0.00000000],
++		[-6.25281720, -0.00168469, 0.00103016, 0.00169380, -0.00000116, 0.00000000],
++		[-6.25288452, -0.00168379, 0.00102962, 0.00169290, -0.00000116, 0.00000000],
++		[-6.25295160, -0.00168290, 0.00102909, 0.00169200, -0.00000116, 0.00000000],
++		[-6.25301844, -0.00168200, 0.00102855, 0.00169110, -0.00000116, 0.00000000],
++		[-6.25308504, -0.00168111, 0.00102802, 0.00169020, -0.00000116, 0.00000000],
++		[-6.25315140, -0.00168022, 0.00102748, 0.00168930, -0.00000116, 0.00000000],
++		[-6.25321753, -0.00167933, 0.00102695, 0.00168841, -0.00000116, 0.00000000],
++		[-6.25328342, -0.00167844, 0.00102641, 0.00168751, -0.00000116, 0.00000000],
++		[-6.25334907, -0.00167755, 0.00102588, 0.00168662, -0.00000116, 0.00000000],
++		[-6.25341450, -0.00167666, 0.00102535, 0.00168572, -0.00000116, 0.00000000],
++		[-6.25347968, -0.00167577, 0.00102482, 0.00168483, -0.00000116, 0.00000000],
++		[-6.25354464, -0.00167489, 0.00102429, 0.00168394, -0.00000116, 0.00000000],
++		[-6.25360936, -0.00167400, 0.00102376, 0.00168305, -0.00000116, 0.00000000],
++		[-6.25367385, -0.00167312, 0.00102323, 0.00168216, -0.00000116, 0.00000000],
++		[-6.25373811, -0.00167223, 0.00102270, 0.00168127, -0.00000116, 0.00000000],
++		[-6.25380215, -0.00167135, 0.00102217, 0.00168038, -0.00000116, 0.00000000],
++		[-6.25386595, -0.00167047, 0.00102164, 0.00167949, -0.00000117, 0.00000000],
++		[-6.25392952, -0.00166958, 0.00102111, 0.00167860, -0.00000117, 0.00000000],
++		[-6.25399287, -0.00166870, 0.00102058, 0.00167772, -0.00000117, 0.00000000],
++		[-6.25405599, -0.00166782, 0.00102005, 0.00167683, -0.00000117, 0.00000000],
++		[-6.25411889, -0.00166694, 0.00101953, 0.00167595, -0.00000117, 0.00000000],
++		[-6.25418156, -0.00166607, 0.00101900, 0.00167507, -0.00000117, 0.00000000],
++		[-6.25424401, -0.00166519, 0.00101847, 0.00167418, -0.00000117, 0.00000000],
++		[-6.25430623, -0.00166431, 0.00101795, 0.00167330, -0.00000117, 0.00000000],
++		[-6.25436823, -0.00166344, 0.00101742, 0.00167242, -0.00000117, 0.00000000],
++		[-6.25443001, -0.00166256, 0.00101690, 0.00167154, -0.00000117, 0.00000000],
++		[-6.25449157, -0.00166169, 0.00101638, 0.00167066, -0.00000117, 0.00000000],
++		[-6.25455291, -0.00166082, 0.00101585, 0.00166978, -0.00000117, 0.00000000],
++		[-6.25461403, -0.00165994, 0.00101533, 0.00166891, -0.00000117, 0.00000000],
++		[-6.25467493, -0.00165907, 0.00101481, 0.00166803, -0.00000117, 0.00000000],
++		[-6.25473561, -0.00165820, 0.00101428, 0.00166715, -0.00000117, 0.00000000],
++		[-6.25479608, -0.00165733, 0.00101376, 0.00166628, -0.00000117, 0.00000000],
++		[-6.25485633, -0.00165647, 0.00101324, 0.00166541, -0.00000117, 0.00000000],
++		[-6.25491636, -0.00165560, 0.00101272, 0.00166453, -0.00000117, 0.00000000],
++		[-6.25497618, -0.00165473, 0.00101220, 0.00166366, -0.00000117, 0.00000000],
++		[-6.25503579, -0.00165386, 0.00101168, 0.00166279, -0.00000117, 0.00000000],
++		[-6.25509518, -0.00165300, 0.00101116, 0.00166192, -0.00000117, 0.00000000],
++		[-6.25515436, -0.00165214, 0.00101064, 0.00166105, -0.00000117, 0.00000000],
++		[-6.25521333, -0.00165127, 0.00101012, 0.00166018, -0.00000117, 0.00000000],
++		[-6.25527209, -0.00165041, 0.00100961, 0.00165931, -0.00000117, 0.00000000],
++		[-6.25533063, -0.00164955, 0.00100909, 0.00165845, -0.00000117, 0.00000000],
++		[-6.25538897, -0.00164869, 0.00100857, 0.00165758, -0.00000117, 0.00000000],
++		[-6.25544710, -0.00164783, 0.00100806, 0.00165672, -0.00000117, 0.00000000],
++		[-6.25550502, -0.00164697, 0.00100754, 0.00165585, -0.00000117, 0.00000000],
++		[-6.25556273, -0.00164611, 0.00100702, 0.00165499, -0.00000117, 0.00000000],
++		[-6.25562024, -0.00164525, 0.00100651, 0.00165413, -0.00000117, 0.00000000],
++		[-6.25567754, -0.00164440, 0.00100599, 0.00165326, -0.00000117, 0.00000000],
++		[-6.25573464, -0.00164354, 0.00100548, 0.00165240, -0.00000117, 0.00000000],
++		[-6.25579153, -0.00164268, 0.00100497, 0.00165154, -0.00000117, 0.00000000],
++		[-6.25584821, -0.00164183, 0.00100445, 0.00165068, -0.00000117, 0.00000000],
++		[-6.25590470, -0.00164098, 0.00100394, 0.00164982, -0.00000117, 0.00000000],
++		[-6.25596098, -0.00164012, 0.00100343, 0.00164897, -0.00000117, 0.00000000],
++		[-6.25601706, -0.00163927, 0.00100292, 0.00164811, -0.00000117, 0.00000000],
++		[-6.25607294, -0.00163842, 0.00100241, 0.00164725, -0.00000117, 0.00000000],
++		[-6.25612862, -0.00163757, 0.00100189, 0.00164640, -0.00000117, 0.00000000],
++		[-6.25618410, -0.00163672, 0.00100138, 0.00164554, -0.00000117, 0.00000000],
++		[-6.25623938, -0.00163587, 0.00100087, 0.00164469, -0.00000117, 0.00000000],
++		[-6.25629447, -0.00163503, 0.00100036, 0.00164384, -0.00000117, 0.00000000],
++		[-6.25634936, -0.00163418, 0.00099986, 0.00164299, -0.00000117, 0.00000000],
++		[-6.25640405, -0.00163333, 0.00099935, 0.00164214, -0.00000117, 0.00000000],
++		[-6.25645854, -0.00163249, 0.00099884, 0.00164129, -0.00000117, 0.00000000],
++		[-6.25651284, -0.00163164, 0.00099833, 0.00164044, -0.00000117, 0.00000000],
++		[-6.25656694, -0.00163080, 0.00099782, 0.00163959, -0.00000117, 0.00000000],
++		[-6.25662085, -0.00162996, 0.00099732, 0.00163874, -0.00000117, 0.00000000],
++		[-6.25667457, -0.00162912, 0.00099681, 0.00163789, -0.00000117, 0.00000000],
++		[-6.25672809, -0.00162828, 0.00099631, 0.00163705, -0.00000117, 0.00000000],
++		[-6.25678143, -0.00162744, 0.00099580, 0.00163620, -0.00000117, 0.00000000],
++		[-6.25683457, -0.00162660, 0.00099530, 0.00163536, -0.00000117, 0.00000000],
++		[-6.25688752, -0.00162576, 0.00099479, 0.00163451, -0.00000117, 0.00000000],
++		[-6.25694028, -0.00162492, 0.00099429, 0.00163367, -0.00000117, 0.00000000],
++		[-6.25699285, -0.00162408, 0.00099378, 0.00163283, -0.00000117, 0.00000000],
++		[-6.25704524, -0.00162325, 0.00099328, 0.00163199, -0.00000117, 0.00000000],
++		[-6.25709743, -0.00162241, 0.00099278, 0.00163115, -0.00000117, 0.00000000],
++		[-6.25714944, -0.00162158, 0.00099228, 0.00163031, -0.00000117, 0.00000000],
++		[-6.25720127, -0.00162074, 0.00099177, 0.00162947, -0.00000117, 0.00000000],
++		[-6.25725290, -0.00161991, 0.00099127, 0.00162863, -0.00000117, 0.00000000],
++		[-6.25730435, -0.00161908, 0.00099077, 0.00162780, -0.00000117, 0.00000000],
++		[-6.25735562, -0.00161825, 0.00099027, 0.00162696, -0.00000117, 0.00000000],
++		[-6.25740670, -0.00161742, 0.00098977, 0.00162613, -0.00000117, 0.00000000],
++		[-6.25745761, -0.00161659, 0.00098927, 0.00162529, -0.00000117, 0.00000000],
++		[-6.25750832, -0.00161576, 0.00098877, 0.00162446, -0.00000117, 0.00000000],
++		[-6.25755886, -0.00161493, 0.00098828, 0.00162362, -0.00000117, 0.00000000],
++		[-6.25760921, -0.00161411, 0.00098778, 0.00162279, -0.00000117, 0.00000000],
++		[-6.25765939, -0.00161328, 0.00098728, 0.00162196, -0.00000117, 0.00000000],
++		[-6.25770938, -0.00161245, 0.00098678, 0.00162113, -0.00000117, 0.00000000],
++		[-6.25775920, -0.00161163, 0.00098629, 0.00162030, -0.00000117, 0.00000000],
++		[-6.25780883, -0.00161080, 0.00098579, 0.00161947, -0.00000117, 0.00000000],
++		[-6.25785829, -0.00160998, 0.00098529, 0.00161864, -0.00000117, 0.00000000],
++		[-6.25790757, -0.00160916, 0.00098480, 0.00161782, -0.00000117, 0.00000000],
++		[-6.25795667, -0.00160834, 0.00098430, 0.00161699, -0.00000117, 0.00000000],
++		[-6.25800560, -0.00160752, 0.00098381, 0.00161616, -0.00000117, 0.00000000],
++		[-6.25805435, -0.00160670, 0.00098332, 0.00161534, -0.00000117, 0.00000000],
++		[-6.25810293, -0.00160588, 0.00098282, 0.00161452, -0.00000117, 0.00000000],
++		[-6.25815133, -0.00160506, 0.00098233, 0.00161369, -0.00000117, 0.00000000],
++		[-6.25819956, -0.00160424, 0.00098184, 0.00161287, -0.00000117, 0.00000000],
++		[-6.25824762, -0.00160342, 0.00098134, 0.00161205, -0.00000117, 0.00000000],
++		[-6.25829550, -0.00160261, 0.00098085, 0.00161123, -0.00000117, 0.00000000],
++		[-6.25834321, -0.00160179, 0.00098036, 0.00161041, -0.00000117, 0.00000000],
++		[-6.25839075, -0.00160098, 0.00097987, 0.00160959, -0.00000117, 0.00000000],
++		[-6.25843812, -0.00160017, 0.00097938, 0.00160877, -0.00000117, 0.00000000],
++		[-6.25848532, -0.00159935, 0.00097889, 0.00160795, -0.00000117, 0.00000000],
++		[-6.25853235, -0.00159854, 0.00097840, 0.00160713, -0.00000117, 0.00000000],
++		[-6.25857922, -0.00159773, 0.00097791, 0.00160632, -0.00000117, 0.00000000],
++		[-6.25862591, -0.00159692, 0.00097742, 0.00160550, -0.00000117, 0.00000000],
++		[-6.25867244, -0.00159611, 0.00097693, 0.00160469, -0.00000117, 0.00000000],
++		[-6.25871879, -0.00159530, 0.00097645, 0.00160387, -0.00000117, 0.00000000],
++		[-6.25876499, -0.00159449, 0.00097596, 0.00160306, -0.00000117, 0.00000000],
++		[-6.25881101, -0.00159368, 0.00097547, 0.00160225, -0.00000117, 0.00000000],
++		[-6.25885688, -0.00159288, 0.00097499, 0.00160144, -0.00000117, 0.00000000],
++		[-6.25890257, -0.00159207, 0.00097450, 0.00160063, -0.00000117, 0.00000000],
++		[-6.25894810, -0.00159127, 0.00097402, 0.00159982, -0.00000117, 0.00000000],
++		[-6.25899347, -0.00159046, 0.00097353, 0.00159901, -0.00000117, 0.00000000],
++		[-6.25903868, -0.00158966, 0.00097305, 0.00159820, -0.00000117, 0.00000000],
++		[-6.25908372, -0.00158886, 0.00097256, 0.00159739, -0.00000117, 0.00000000],
++		[-6.25912861, -0.00158805, 0.00097208, 0.00159659, -0.00000117, 0.00000000],
++		[-6.25917333, -0.00158725, 0.00097159, 0.00159578, -0.00000117, 0.00000000],
++		[-6.25921789, -0.00158645, 0.00097111, 0.00159497, -0.00000117, 0.00000000],
++		[-6.25926229, -0.00158565, 0.00097063, 0.00159417, -0.00000117, 0.00000000],
++		[-6.25930653, -0.00158485, 0.00097015, 0.00159337, -0.00000117, 0.00000000],
++		[-6.25935061, -0.00158406, 0.00096966, 0.00159256, -0.00000117, 0.00000000],
++		[-6.25939453, -0.00158326, 0.00096918, 0.00159176, -0.00000117, 0.00000000],
++		[-6.25943830, -0.00158246, 0.00096870, 0.00159096, -0.00000117, 0.00000000],
++		[-6.25948191, -0.00158167, 0.00096822, 0.00159016, -0.00000117, 0.00000000],
++		[-6.25952536, -0.00158087, 0.00096774, 0.00158936, -0.00000117, 0.00000000],
++		[-6.25956866, -0.00158008, 0.00096726, 0.00158856, -0.00000117, 0.00000000],
++		[-6.25961180, -0.00157928, 0.00096678, 0.00158776, -0.00000117, 0.00000000],
++		[-6.25965478, -0.00157849, 0.00096631, 0.00158696, -0.00000117, 0.00000000],
++		[-6.25969761, -0.00157770, 0.00096583, 0.00158617, -0.00000117, 0.00000000],
++		[-6.25974029, -0.00157691, 0.00096535, 0.00158537, -0.00000117, 0.00000000],
++		[-6.25978282, -0.00157612, 0.00096487, 0.00158458, -0.00000117, 0.00000000],
++		[-6.25982519, -0.00157533, 0.00096440, 0.00158378, -0.00000117, 0.00000000],
++		[-6.25986741, -0.00157454, 0.00096392, 0.00158299, -0.00000117, 0.00000000],
++		[-6.25990947, -0.00157375, 0.00096344, 0.00158220, -0.00000117, 0.00000000],
++		[-6.25995139, -0.00157296, 0.00096297, 0.00158140, -0.00000117, 0.00000000],
++		[-6.25999315, -0.00157217, 0.00096249, 0.00158061, -0.00000117, 0.00000000],
++		[-6.26003477, -0.00157139, 0.00096202, 0.00157982, -0.00000117, 0.00000000],
++		[-6.26007624, -0.00157060, 0.00096154, 0.00157903, -0.00000117, 0.00000000],
++		[-6.26011755, -0.00156982, 0.00096107, 0.00157824, -0.00000117, 0.00000000],
++		[-6.26015872, -0.00156903, 0.00096060, 0.00157745, -0.00000117, 0.00000000],
++		[-6.26019974, -0.00156825, 0.00096012, 0.00157667, -0.00000117, 0.00000000],
++		[-6.26024061, -0.00156747, 0.00095965, 0.00157588, -0.00000117, 0.00000000],
++		[-6.26028134, -0.00156669, 0.00095918, 0.00157509, -0.00000117, 0.00000000],
++		[-6.26032192, -0.00156591, 0.00095871, 0.00157431, -0.00000117, 0.00000000],
++		[-6.26036235, -0.00156513, 0.00095823, 0.00157352, -0.00000117, 0.00000000],
++		[-6.26040264, -0.00156435, 0.00095776, 0.00157274, -0.00000117, 0.00000000],
++		[-6.26044279, -0.00156357, 0.00095729, 0.00157195, -0.00000117, 0.00000000],
++		[-6.26048279, -0.00156279, 0.00095682, 0.00157117, -0.00000117, 0.00000000],
++		[-6.26052264, -0.00156201, 0.00095635, 0.00157039, -0.00000117, 0.00000000],
++		[-6.26056235, -0.00156124, 0.00095588, 0.00156961, -0.00000117, 0.00000000],
++		[-6.26060192, -0.00156046, 0.00095542, 0.00156883, -0.00000117, 0.00000000],
++		[-6.26064135, -0.00155969, 0.00095495, 0.00156805, -0.00000117, 0.00000000],
++		[-6.26068064, -0.00155891, 0.00095448, 0.00156727, -0.00000117, 0.00000000],
++		[-6.26071978, -0.00155814, 0.00095401, 0.00156649, -0.00000117, 0.00000000],
++		[-6.26075879, -0.00155737, 0.00095354, 0.00156572, -0.00000117, 0.00000000],
++		[-6.26079765, -0.00155659, 0.00095308, 0.00156494, -0.00000117, 0.00000000],
++		[-6.26083637, -0.00155582, 0.00095261, 0.00156416, -0.00000117, 0.00000000],
++		[-6.26087496, -0.00155505, 0.00095215, 0.00156339, -0.00000117, 0.00000000],
++		[-6.26091341, -0.00155428, 0.00095168, 0.00156261, -0.00000117, 0.00000000],
++		[-6.26095171, -0.00155351, 0.00095122, 0.00156184, -0.00000117, 0.00000000],
++		[-6.26098988, -0.00155274, 0.00095075, 0.00156107, -0.00000117, 0.00000000],
++		[-6.26102792, -0.00155198, 0.00095029, 0.00156029, -0.00000117, 0.00000000],
++		[-6.26106581, -0.00155121, 0.00094982, 0.00155952, -0.00000117, 0.00000000],
++		[-6.26110357, -0.00155044, 0.00094936, 0.00155875, -0.00000117, 0.00000000],
++		[-6.26114120, -0.00154968, 0.00094890, 0.00155798, -0.00000117, 0.00000000],
++		[-6.26117869, -0.00154891, 0.00094843, 0.00155721, -0.00000117, 0.00000000],
++		[-6.26121604, -0.00154815, 0.00094797, 0.00155644, -0.00000117, 0.00000000],
++		[-6.26125326, -0.00154739, 0.00094751, 0.00155568, -0.00000117, 0.00000000],
++		[-6.26129035, -0.00154662, 0.00094705, 0.00155491, -0.00000117, 0.00000000],
++		[-6.26132730, -0.00154586, 0.00094659, 0.00155414, -0.00000117, 0.00000000],
++		[-6.26136412, -0.00154510, 0.00094613, 0.00155338, -0.00000117, 0.00000000],
++		[-6.26140081, -0.00154434, 0.00094567, 0.00155261, -0.00000117, 0.00000000],
++		[-6.26143736, -0.00154358, 0.00094521, 0.00155185, -0.00000117, 0.00000000],
++		[-6.26147379, -0.00154282, 0.00094475, 0.00155109, -0.00000117, 0.00000000],
++		[-6.26151008, -0.00154206, 0.00094429, 0.00155032, -0.00000117, 0.00000000],
++		[-6.26154624, -0.00154131, 0.00094383, 0.00154956, -0.00000117, 0.00000000],
++		[-6.26158228, -0.00154055, 0.00094337, 0.00154880, -0.00000117, 0.00000000],
++		[-6.26161818, -0.00153979, 0.00094292, 0.00154804, -0.00000117, 0.00000000],
++		[-6.26165395, -0.00153904, 0.00094246, 0.00154728, -0.00000117, 0.00000000],
++		[-6.26168960, -0.00153828, 0.00094200, 0.00154652, -0.00000117, 0.00000000],
++		[-6.26172512, -0.00153753, 0.00094155, 0.00154576, -0.00000117, 0.00000000],
++		[-6.26176051, -0.00153677, 0.00094109, 0.00154500, -0.00000117, 0.00000000],
++		[-6.26179577, -0.00153602, 0.00094063, 0.00154425, -0.00000117, 0.00000000],
++		[-6.26183090, -0.00153527, 0.00094018, 0.00154349, -0.00000117, 0.00000000],
++		[-6.26186591, -0.00153452, 0.00093972, 0.00154273, -0.00000117, 0.00000000],
++		[-6.26190080, -0.00153377, 0.00093927, 0.00154198, -0.00000117, 0.00000000],
++		[-6.26193555, -0.00153302, 0.00093882, 0.00154123, -0.00000117, 0.00000000],
++		[-6.26197019, -0.00153227, 0.00093836, 0.00154047, -0.00000117, 0.00000000],
++		[-6.26200470, -0.00153152, 0.00093791, 0.00153972, -0.00000117, 0.00000000],
++		[-6.26203908, -0.00153077, 0.00093746, 0.00153897, -0.00000117, 0.00000000],
++		[-6.26207334, -0.00153003, 0.00093700, 0.00153822, -0.00000118, 0.00000000],
++		[-6.26210748, -0.00152928, 0.00093655, 0.00153746, -0.00000118, 0.00000000],
++		[-6.26214149, -0.00152853, 0.00093610, 0.00153671, -0.00000118, 0.00000000],
++		[-6.26217539, -0.00152779, 0.00093565, 0.00153597, -0.00000118, 0.00000000],
++		[-6.26220916, -0.00152705, 0.00093520, 0.00153522, -0.00000118, 0.00000000],
++		[-6.26224280, -0.00152630, 0.00093475, 0.00153447, -0.00000118, 0.00000000],
++		[-6.26227633, -0.00152556, 0.00093430, 0.00153372, -0.00000118, 0.00000000],
++		[-6.26230974, -0.00152482, 0.00093385, 0.00153298, -0.00000118, 0.00000000],
++		[-6.26234303, -0.00152408, 0.00093340, 0.00153223, -0.00000118, 0.00000000],
++		[-6.26237620, -0.00152333, 0.00093295, 0.00153148, -0.00000118, 0.00000000],
++		[-6.26240924, -0.00152259, 0.00093250, 0.00153074, -0.00000118, 0.00000000],
++		[-6.26244217, -0.00152186, 0.00093205, 0.00153000, -0.00000118, 0.00000000],
++		[-6.26247499, -0.00152112, 0.00093161, 0.00152925, -0.00000118, 0.00000000],
++		[-6.26250768, -0.00152038, 0.00093116, 0.00152851, -0.00000118, 0.00000000],
++		[-6.26254025, -0.00151964, 0.00093071, 0.00152777, -0.00000118, 0.00000000],
++		[-6.26257271, -0.00151890, 0.00093027, 0.00152703, -0.00000118, 0.00000000],
++		[-6.26260505, -0.00151817, 0.00092982, 0.00152629, -0.00000118, 0.00000000],
++		[-6.26263728, -0.00151743, 0.00092937, 0.00152555, -0.00000118, 0.00000000],
++		[-6.26266939, -0.00151670, 0.00092893, 0.00152481, -0.00000118, 0.00000000],
++		[-6.26270138, -0.00151596, 0.00092848, 0.00152407, -0.00000118, 0.00000000],
++		[-6.26273326, -0.00151523, 0.00092804, 0.00152333, -0.00000118, 0.00000000],
++		[-6.26276503, -0.00151450, 0.00092760, 0.00152260, -0.00000118, 0.00000000],
++		[-6.26279668, -0.00151377, 0.00092715, 0.00152186, -0.00000118, 0.00000000],
++		[-6.26282822, -0.00151304, 0.00092671, 0.00152113, -0.00000118, 0.00000000],
++		[-6.26285964, -0.00151231, 0.00092627, 0.00152039, -0.00000118, 0.00000000],
++		[-6.26289095, -0.00151158, 0.00092582, 0.00151966, -0.00000118, 0.00000000],
++		[-6.26292215, -0.00151085, 0.00092538, 0.00151892, -0.00000118, 0.00000000],
++		[-6.26295323, -0.00151012, 0.00092494, 0.00151819, -0.00000118, 0.00000000],
++		[-6.26298421, -0.00150939, 0.00092450, 0.00151746, -0.00000118, 0.00000000],
++		[-6.26301507, -0.00150866, 0.00092406, 0.00151673, -0.00000118, 0.00000000],
++		[-6.26304582, -0.00150794, 0.00092362, 0.00151600, -0.00000118, 0.00000000],
++		[-6.26307646, -0.00150721, 0.00092318, 0.00151527, -0.00000118, 0.00000000],
++		[-6.26310699, -0.00150649, 0.00092274, 0.00151454, -0.00000118, 0.00000000],
++		[-6.26313741, -0.00150576, 0.00092230, 0.00151381, -0.00000118, 0.00000000],
++		[-6.26316772, -0.00150504, 0.00092186, 0.00151308, -0.00000118, 0.00000000],
++		[-6.26319793, -0.00150431, 0.00092142, 0.00151235, -0.00000118, 0.00000000],
++		[-6.26322802, -0.00150359, 0.00092098, 0.00151163, -0.00000118, 0.00000000],
++		[-6.26325801, -0.00150287, 0.00092055, 0.00151090, -0.00000118, 0.00000000],
++		[-6.26328788, -0.00150215, 0.00092011, 0.00151018, -0.00000118, 0.00000000],
++		[-6.26331765, -0.00150143, 0.00091967, 0.00150945, -0.00000118, 0.00000000],
++		[-6.26334732, -0.00150071, 0.00091924, 0.00150873, -0.00000118, 0.00000000],
++		[-6.26337687, -0.00149999, 0.00091880, 0.00150800, -0.00000118, 0.00000000],
++		[-6.26340633, -0.00149927, 0.00091836, 0.00150728, -0.00000118, 0.00000000],
++		[-6.26343567, -0.00149855, 0.00091793, 0.00150656, -0.00000118, 0.00000000],
++		[-6.26346491, -0.00149784, 0.00091749, 0.00150584, -0.00000118, 0.00000000],
++		[-6.26349404, -0.00149712, 0.00091706, 0.00150512, -0.00000118, 0.00000000],
++		[-6.26352307, -0.00149640, 0.00091662, 0.00150440, -0.00000118, 0.00000000],
++		[-6.26355200, -0.00149569, 0.00091619, 0.00150368, -0.00000118, 0.00000000],
++		[-6.26358082, -0.00149498, 0.00091576, 0.00150296, -0.00000118, 0.00000000],
++		[-6.26360954, -0.00149426, 0.00091532, 0.00150224, -0.00000118, 0.00000000],
++		[-6.26363815, -0.00149355, 0.00091489, 0.00150152, -0.00000118, 0.00000000],
++		[-6.26366666, -0.00149284, 0.00091446, 0.00150081, -0.00000118, 0.00000000],
++		[-6.26369507, -0.00149212, 0.00091403, 0.00150009, -0.00000118, 0.00000000],
++		[-6.26372338, -0.00149141, 0.00091359, 0.00149938, -0.00000118, 0.00000000],
++		[-6.26375159, -0.00149070, 0.00091316, 0.00149866, -0.00000118, 0.00000000],
++		[-6.26377969, -0.00148999, 0.00091273, 0.00149795, -0.00000118, 0.00000000],
++		[-6.26380769, -0.00148928, 0.00091230, 0.00149723, -0.00000118, 0.00000000],
++		[-6.26383560, -0.00148857, 0.00091187, 0.00149652, -0.00000118, 0.00000000],
++		[-6.26386340, -0.00148787, 0.00091144, 0.00149581, -0.00000118, 0.00000000],
++		[-6.26389110, -0.00148716, 0.00091101, 0.00149510, -0.00000118, 0.00000000],
++		[-6.26391870, -0.00148645, 0.00091058, 0.00149439, -0.00000118, 0.00000000],
++		[-6.26394621, -0.00148575, 0.00091016, 0.00149368, -0.00000118, 0.00000000],
++		[-6.26397361, -0.00148504, 0.00090973, 0.00149297, -0.00000118, 0.00000000],
++		[-6.26400092, -0.00148434, 0.00090930, 0.00149226, -0.00000118, 0.00000000],
++		[-6.26402813, -0.00148363, 0.00090887, 0.00149155, -0.00000118, 0.00000000],
++		[-6.26405524, -0.00148293, 0.00090844, 0.00149084, -0.00000118, 0.00000000],
++		[-6.26408225, -0.00148223, 0.00090802, 0.00149014, -0.00000118, 0.00000000],
++		[-6.26410916, -0.00148152, 0.00090759, 0.00148943, -0.00000118, 0.00000000],
++		[-6.26413598, -0.00148082, 0.00090717, 0.00148872, -0.00000118, 0.00000000],
++		[-6.26416271, -0.00148012, 0.00090674, 0.00148802, -0.00000118, 0.00000000],
++		[-6.26418933, -0.00147942, 0.00090631, 0.00148732, -0.00000118, 0.00000000],
++		[-6.26421586, -0.00147872, 0.00090589, 0.00148661, -0.00000118, 0.00000000],
++		[-6.26424230, -0.00147802, 0.00090547, 0.00148591, -0.00000118, 0.00000000],
++		[-6.26426864, -0.00147733, 0.00090504, 0.00148521, -0.00000118, 0.00000000],
++		[-6.26429489, -0.00147663, 0.00090462, 0.00148450, -0.00000118, 0.00000000],
++		[-6.26432104, -0.00147593, 0.00090419, 0.00148380, -0.00000118, 0.00000000],
++		[-6.26434710, -0.00147523, 0.00090377, 0.00148310, -0.00000118, 0.00000000],
++		[-6.26437306, -0.00147454, 0.00090335, 0.00148240, -0.00000118, 0.00000000],
++		[-6.26439893, -0.00147384, 0.00090293, 0.00148170, -0.00000118, 0.00000000],
++		[-6.26442471, -0.00147315, 0.00090250, 0.00148101, -0.00000118, 0.00000000],
++		[-6.26445040, -0.00147246, 0.00090208, 0.00148031, -0.00000118, 0.00000000],
++		[-6.26447599, -0.00147176, 0.00090166, 0.00147961, -0.00000118, 0.00000000],
++		[-6.26450150, -0.00147107, 0.00090124, 0.00147891, -0.00000118, 0.00000000],
++		[-6.26452691, -0.00147038, 0.00090082, 0.00147822, -0.00000118, 0.00000000],
++		[-6.26455222, -0.00146969, 0.00090040, 0.00147752, -0.00000118, 0.00000000],
++		[-6.26457745, -0.00146900, 0.00089998, 0.00147683, -0.00000118, 0.00000000],
++		[-6.26460259, -0.00146831, 0.00089956, 0.00147613, -0.00000118, 0.00000000],
++		[-6.26462764, -0.00146762, 0.00089914, 0.00147544, -0.00000118, 0.00000000],
++		[-6.26465259, -0.00146693, 0.00089872, 0.00147475, -0.00000118, 0.00000000],
++		[-6.26467746, -0.00146624, 0.00089831, 0.00147406, -0.00000118, 0.00000000],
++		[-6.26470224, -0.00146555, 0.00089789, 0.00147336, -0.00000118, 0.00000000],
++		[-6.26472693, -0.00146486, 0.00089747, 0.00147267, -0.00000118, 0.00000000],
++		[-6.26475153, -0.00146418, 0.00089705, 0.00147198, -0.00000118, 0.00000000],
++		[-6.26477604, -0.00146349, 0.00089664, 0.00147129, -0.00000118, 0.00000000],
++		[-6.26480047, -0.00146281, 0.00089622, 0.00147060, -0.00000118, 0.00000000],
++		[-6.26482481, -0.00146212, 0.00089580, 0.00146992, -0.00000118, 0.00000000],
++		[-6.26484906, -0.00146144, 0.00089539, 0.00146923, -0.00000118, 0.00000000],
++		[-6.26487322, -0.00146076, 0.00089497, 0.00146854, -0.00000118, 0.00000000],
++		[-6.26489730, -0.00146007, 0.00089456, 0.00146785, -0.00000118, 0.00000000],
++		[-6.26492129, -0.00145939, 0.00089414, 0.00146717, -0.00000118, 0.00000000],
++		[-6.26494519, -0.00145871, 0.00089373, 0.00146648, -0.00000118, 0.00000000],
++		[-6.26496901, -0.00145803, 0.00089332, 0.00146580, -0.00000118, 0.00000000],
++		[-6.26499274, -0.00145735, 0.00089290, 0.00146511, -0.00000118, 0.00000000],
++		[-6.26501639, -0.00145667, 0.00089249, 0.00146443, -0.00000118, 0.00000000],
++		[-6.26503995, -0.00145599, 0.00089208, 0.00146375, -0.00000118, 0.00000000],
++		[-6.26506343, -0.00145531, 0.00089166, 0.00146307, -0.00000118, 0.00000000],
++		[-6.26508682, -0.00145463, 0.00089125, 0.00146238, -0.00000118, 0.00000000],
++		[-6.26511013, -0.00145396, 0.00089084, 0.00146170, -0.00000118, 0.00000000],
++		[-6.26513336, -0.00145328, 0.00089043, 0.00146102, -0.00000118, 0.00000000],
++		[-6.26515650, -0.00145261, 0.00089002, 0.00146034, -0.00000118, 0.00000000],
++		[-6.26517956, -0.00145193, 0.00088961, 0.00145966, -0.00000118, 0.00000000],
++		[-6.26520254, -0.00145126, 0.00088920, 0.00145898, -0.00000118, 0.00000000],
++		[-6.26522543, -0.00145058, 0.00088879, 0.00145831, -0.00000118, 0.00000000],
++		[-6.26524824, -0.00144991, 0.00088838, 0.00145763, -0.00000118, 0.00000000],
++		[-6.26527098, -0.00144924, 0.00088797, 0.00145695, -0.00000118, 0.00000000],
++		[-6.26529363, -0.00144856, 0.00088756, 0.00145628, -0.00000118, 0.00000000],
++		[-6.26531619, -0.00144789, 0.00088715, 0.00145560, -0.00000118, 0.00000000],
++		[-6.26533868, -0.00144722, 0.00088674, 0.00145493, -0.00000118, 0.00000000],
++		[-6.26536109, -0.00144655, 0.00088634, 0.00145425, -0.00000118, 0.00000000],
++		[-6.26538341, -0.00144588, 0.00088593, 0.00145358, -0.00000118, 0.00000000],
++		[-6.26540566, -0.00144521, 0.00088552, 0.00145291, -0.00000118, 0.00000000],
++		[-6.26542783, -0.00144454, 0.00088511, 0.00145223, -0.00000118, 0.00000000],
++		[-6.26544992, -0.00144387, 0.00088471, 0.00145156, -0.00000118, 0.00000000],
++		[-6.26547192, -0.00144321, 0.00088430, 0.00145089, -0.00000118, 0.00000000],
++		[-6.26549385, -0.00144254, 0.00088390, 0.00145022, -0.00000118, 0.00000000],
++		[-6.26551570, -0.00144187, 0.00088349, 0.00144955, -0.00000118, 0.00000000],
++		[-6.26553748, -0.00144121, 0.00088309, 0.00144888, -0.00000118, 0.00000000],
++		[-6.26555917, -0.00144054, 0.00088268, 0.00144821, -0.00000118, 0.00000000],
++		[-6.26558079, -0.00143988, 0.00088228, 0.00144754, -0.00000118, 0.00000000],
++		[-6.26560233, -0.00143922, 0.00088187, 0.00144687, -0.00000118, 0.00000000],
++		[-6.26562379, -0.00143855, 0.00088147, 0.00144621, -0.00000118, 0.00000000],
++		[-6.26564518, -0.00143789, 0.00088107, 0.00144554, -0.00000118, 0.00000000],
++		[-6.26566648, -0.00143723, 0.00088066, 0.00144488, -0.00000118, 0.00000000],
++		[-6.26568772, -0.00143657, 0.00088026, 0.00144421, -0.00000118, 0.00000000],
++		[-6.26570887, -0.00143590, 0.00087986, 0.00144355, -0.00000118, 0.00000000],
++		[-6.26572995, -0.00143524, 0.00087946, 0.00144288, -0.00000118, 0.00000000],
++		[-6.26575096, -0.00143458, 0.00087906, 0.00144222, -0.00000118, 0.00000000],
++		[-6.26577189, -0.00143393, 0.00087865, 0.00144155, -0.00000118, 0.00000000],
++		[-6.26579274, -0.00143327, 0.00087825, 0.00144089, -0.00000118, 0.00000000],
++		[-6.26581352, -0.00143261, 0.00087785, 0.00144023, -0.00000118, 0.00000000],
++		[-6.26583423, -0.00143195, 0.00087745, 0.00143957, -0.00000118, 0.00000000],
++		[-6.26585486, -0.00143130, 0.00087705, 0.00143891, -0.00000118, 0.00000000],
++		[-6.26587542, -0.00143064, 0.00087665, 0.00143825, -0.00000118, 0.00000000],
++		[-6.26589591, -0.00142998, 0.00087626, 0.00143759, -0.00000118, 0.00000000],
++		[-6.26591632, -0.00142933, 0.00087586, 0.00143693, -0.00000118, 0.00000000],
++		[-6.26593666, -0.00142867, 0.00087546, 0.00143627, -0.00000118, 0.00000000],
++		[-6.26595692, -0.00142802, 0.00087506, 0.00143562, -0.00000118, 0.00000000],
++		[-6.26597711, -0.00142737, 0.00087466, 0.00143496, -0.00000118, 0.00000000],
++		[-6.26599724, -0.00142671, 0.00087426, 0.00143430, -0.00000118, 0.00000000],
++		[-6.26601728, -0.00142606, 0.00087387, 0.00143365, -0.00000118, 0.00000000],
++		[-6.26603726, -0.00142541, 0.00087347, 0.00143299, -0.00000118, 0.00000000],
++		[-6.26605717, -0.00142476, 0.00087307, 0.00143234, -0.00000118, 0.00000000],
++		[-6.26607700, -0.00142411, 0.00087268, 0.00143168, -0.00000118, 0.00000000],
++		[-6.26609676, -0.00142346, 0.00087228, 0.00143103, -0.00000118, 0.00000000],
++		[-6.26611646, -0.00142281, 0.00087189, 0.00143038, -0.00000118, 0.00000000],
++		[-6.26613608, -0.00142216, 0.00087149, 0.00142972, -0.00000118, 0.00000000],
++		[-6.26615563, -0.00142151, 0.00087110, 0.00142907, -0.00000118, 0.00000000],
++		[-6.26617512, -0.00142087, 0.00087070, 0.00142842, -0.00000118, 0.00000000],
++		[-6.26619453, -0.00142022, 0.00087031, 0.00142777, -0.00000118, 0.00000000],
++		[-6.26621387, -0.00141957, 0.00086992, 0.00142712, -0.00000118, 0.00000000],
++		[-6.26623315, -0.00141893, 0.00086952, 0.00142647, -0.00000118, 0.00000000],
++		[-6.26625235, -0.00141828, 0.00086913, 0.00142582, -0.00000118, 0.00000000],
++		[-6.26627149, -0.00141764, 0.00086874, 0.00142517, -0.00000118, 0.00000000],
++		[-6.26629056, -0.00141699, 0.00086835, 0.00142452, -0.00000118, 0.00000000],
++		[-6.26630956, -0.00141635, 0.00086795, 0.00142388, -0.00000118, 0.00000000],
++		[-6.26632849, -0.00141571, 0.00086756, 0.00142323, -0.00000118, 0.00000000],
++		[-6.26634735, -0.00141506, 0.00086717, 0.00142258, -0.00000118, 0.00000000],
++		[-6.26636615, -0.00141442, 0.00086678, 0.00142194, -0.00000118, 0.00000000],
++		[-6.26638488, -0.00141378, 0.00086639, 0.00142129, -0.00000118, 0.00000000],
++		[-6.26640355, -0.00141314, 0.00086600, 0.00142065, -0.00000118, 0.00000000],
++		[-6.26642214, -0.00141250, 0.00086561, 0.00142001, -0.00000118, 0.00000000],
++		[-6.26644067, -0.00141186, 0.00086522, 0.00141936, -0.00000118, 0.00000000],
++		[-6.26645914, -0.00141122, 0.00086483, 0.00141872, -0.00000118, 0.00000000],
++		[-6.26647754, -0.00141058, 0.00086444, 0.00141808, -0.00000118, 0.00000000],
++		[-6.26649587, -0.00140995, 0.00086405, 0.00141744, -0.00000118, 0.00000000],
++		[-6.26651414, -0.00140931, 0.00086366, 0.00141680, -0.00000118, 0.00000000],
++		[-6.26653234, -0.00140867, 0.00086328, 0.00141616, -0.00000118, 0.00000000],
++		[-6.26655048, -0.00140804, 0.00086289, 0.00141552, -0.00000118, 0.00000000],
++		[-6.26656855, -0.00140740, 0.00086250, 0.00141488, -0.00000118, 0.00000000],
++		[-6.26658656, -0.00140677, 0.00086211, 0.00141424, -0.00000118, 0.00000000],
++		[-6.26660450, -0.00140613, 0.00086173, 0.00141360, -0.00000118, 0.00000000],
++		[-6.26662238, -0.00140550, 0.00086134, 0.00141296, -0.00000118, 0.00000000],
++		[-6.26664020, -0.00140486, 0.00086096, 0.00141233, -0.00000118, 0.00000000],
++		[-6.26665795, -0.00140423, 0.00086057, 0.00141169, -0.00000118, 0.00000000],
++		[-6.26667564, -0.00140360, 0.00086018, 0.00141105, -0.00000118, 0.00000000],
++		[-6.26669326, -0.00140297, 0.00085980, 0.00141042, -0.00000118, 0.00000000],
++		[-6.26671083, -0.00140234, 0.00085942, 0.00140978, -0.00000118, 0.00000000],
++		[-6.26672833, -0.00140171, 0.00085903, 0.00140915, -0.00000118, 0.00000000],
++		[-6.26674577, -0.00140108, 0.00085865, 0.00140852, -0.00000118, 0.00000000],
++		[-6.26676314, -0.00140045, 0.00085826, 0.00140788, -0.00000118, 0.00000000],
++		[-6.26678046, -0.00139982, 0.00085788, 0.00140725, -0.00000118, 0.00000000],
++		[-6.26679771, -0.00139919, 0.00085750, 0.00140662, -0.00000118, 0.00000000],
++		[-6.26681490, -0.00139856, 0.00085711, 0.00140599, -0.00000118, 0.00000000],
++		[-6.26683203, -0.00139793, 0.00085673, 0.00140536, -0.00000118, 0.00000000],
++		[-6.26684910, -0.00139731, 0.00085635, 0.00140472, -0.00000118, 0.00000000],
++		[-6.26686611, -0.00139668, 0.00085597, 0.00140409, -0.00000118, 0.00000000],
++		[-6.26688306, -0.00139605, 0.00085559, 0.00140347, -0.00000118, 0.00000000],
++		[-6.26689994, -0.00139543, 0.00085521, 0.00140284, -0.00000118, 0.00000000],
++		[-6.26691677, -0.00139481, 0.00085482, 0.00140221, -0.00000118, 0.00000000],
++		[-6.26693354, -0.00139418, 0.00085444, 0.00140158, -0.00000118, 0.00000000],
++		[-6.26695024, -0.00139356, 0.00085406, 0.00140095, -0.00000118, 0.00000000],
++		[-6.26696689, -0.00139293, 0.00085368, 0.00140033, -0.00000118, 0.00000000],
++		[-6.26698348, -0.00139231, 0.00085331, 0.00139970, -0.00000118, 0.00000000],
++		[-6.26700001, -0.00139169, 0.00085293, 0.00139908, -0.00000118, 0.00000000],
++		[-6.26701648, -0.00139107, 0.00085255, 0.00139845, -0.00000118, 0.00000000],
++		[-6.26703289, -0.00139045, 0.00085217, 0.00139783, -0.00000118, 0.00000000],
++		[-6.26704925, -0.00138983, 0.00085179, 0.00139720, -0.00000118, 0.00000000],
++		[-6.26706554, -0.00138921, 0.00085141, 0.00139658, -0.00000118, 0.00000000],
++		[-6.26708178, -0.00138859, 0.00085104, 0.00139596, -0.00000118, 0.00000000],
++		[-6.26709796, -0.00138797, 0.00085066, 0.00139534, -0.00000118, 0.00000000],
++		[-6.26711408, -0.00138735, 0.00085028, 0.00139471, -0.00000118, 0.00000000],
++		[-6.26713015, -0.00138674, 0.00084990, 0.00139409, -0.00000118, 0.00000000],
++		[-6.26714616, -0.00138612, 0.00084953, 0.00139347, -0.00000118, 0.00000000],
++		[-6.26716211, -0.00138550, 0.00084915, 0.00139285, -0.00000118, 0.00000000],
++		[-6.26717800, -0.00138489, 0.00084878, 0.00139223, -0.00000118, 0.00000000],
++		[-6.26719384, -0.00138427, 0.00084840, 0.00139161, -0.00000118, 0.00000000],
++		[-6.26720962, -0.00138366, 0.00084803, 0.00139100, -0.00000118, 0.00000000],
++		[-6.26722535, -0.00138304, 0.00084765, 0.00139038, -0.00000118, 0.00000000],
++		[-6.26724102, -0.00138243, 0.00084728, 0.00138976, -0.00000118, 0.00000000],
++		[-6.26725663, -0.00138181, 0.00084690, 0.00138914, -0.00000118, 0.00000000],
++		[-6.26727219, -0.00138120, 0.00084653, 0.00138853, -0.00000118, 0.00000000],
++		[-6.26728769, -0.00138059, 0.00084616, 0.00138791, -0.00000118, 0.00000000],
++		[-6.26730314, -0.00137998, 0.00084578, 0.00138730, -0.00000118, 0.00000000],
++		[-6.26731854, -0.00137937, 0.00084541, 0.00138668, -0.00000118, 0.00000000],
++		[-6.26733388, -0.00137876, 0.00084504, 0.00138607, -0.00000118, 0.00000000],
++		[-6.26734916, -0.00137815, 0.00084467, 0.00138545, -0.00000118, 0.00000000],
++		[-6.26736439, -0.00137754, 0.00084429, 0.00138484, -0.00000118, 0.00000000],
++		[-6.26737957, -0.00137693, 0.00084392, 0.00138423, -0.00000118, 0.00000000],
++		[-6.26739469, -0.00137632, 0.00084355, 0.00138362, -0.00000118, 0.00000000],
++		[-6.26740976, -0.00137571, 0.00084318, 0.00138301, -0.00000118, 0.00000000],
++		[-6.26742477, -0.00137510, 0.00084281, 0.00138239, -0.00000118, 0.00000000],
++		[-6.26743974, -0.00137450, 0.00084244, 0.00138178, -0.00000118, 0.00000000],
++		[-6.26745464, -0.00137389, 0.00084207, 0.00138117, -0.00000118, 0.00000000],
++		[-6.26746950, -0.00137328, 0.00084170, 0.00138056, -0.00000118, 0.00000000],
++		[-6.26748430, -0.00137268, 0.00084133, 0.00137996, -0.00000117, 0.00000000],
++		[-6.26749906, -0.00137207, 0.00084096, 0.00137935, -0.00000117, 0.00000000],
++		[-6.26751375, -0.00137147, 0.00084059, 0.00137874, -0.00000117, 0.00000000],
++		[-6.26752840, -0.00137087, 0.00084022, 0.00137813, -0.00000117, 0.00000000],
++		[-6.26754300, -0.00137026, 0.00083986, 0.00137753, -0.00000117, 0.00000000],
++		[-6.26755754, -0.00136966, 0.00083949, 0.00137692, -0.00000117, 0.00000000],
++		[-6.26757203, -0.00136906, 0.00083912, 0.00137631, -0.00000117, 0.00000000],
++		[-6.26758647, -0.00136846, 0.00083875, 0.00137571, -0.00000117, 0.00000000],
++		[-6.26760086, -0.00136786, 0.00083839, 0.00137510, -0.00000117, 0.00000000],
++		[-6.26761520, -0.00136725, 0.00083802, 0.00137450, -0.00000117, 0.00000000],
++		[-6.26762949, -0.00136665, 0.00083765, 0.00137390, -0.00000117, 0.00000000],
++		[-6.26764372, -0.00136605, 0.00083729, 0.00137329, -0.00000117, 0.00000000],
++		[-6.26765791, -0.00136546, 0.00083692, 0.00137269, -0.00000117, 0.00000000],
++		[-6.26767205, -0.00136486, 0.00083656, 0.00137209, -0.00000117, 0.00000000],
++		[-6.26768613, -0.00136426, 0.00083619, 0.00137149, -0.00000117, 0.00000000],
++		[-6.26770017, -0.00136366, 0.00083583, 0.00137089, -0.00000117, 0.00000000],
++		[-6.26771416, -0.00136306, 0.00083546, 0.00137029, -0.00000117, 0.00000000],
++		[-6.26772809, -0.00136247, 0.00083510, 0.00136969, -0.00000117, 0.00000000],
++		[-6.26774198, -0.00136187, 0.00083474, 0.00136909, -0.00000117, 0.00000000],
++		[-6.26775582, -0.00136128, 0.00083437, 0.00136849, -0.00000117, 0.00000000],
++		[-6.26776961, -0.00136068, 0.00083401, 0.00136789, -0.00000117, 0.00000000],
++		[-6.26778335, -0.00136009, 0.00083365, 0.00136729, -0.00000117, 0.00000000],
++		[-6.26779704, -0.00135949, 0.00083328, 0.00136669, -0.00000117, 0.00000000],
++		[-6.26781069, -0.00135890, 0.00083292, 0.00136610, -0.00000117, 0.00000000],
++		[-6.26782428, -0.00135831, 0.00083256, 0.00136550, -0.00000117, 0.00000000],
++		[-6.26783783, -0.00135771, 0.00083220, 0.00136490, -0.00000117, 0.00000000],
++		[-6.26785133, -0.00135712, 0.00083184, 0.00136431, -0.00000117, 0.00000000],
++		[-6.26786479, -0.00135653, 0.00083148, 0.00136371, -0.00000117, 0.00000000],
++		[-6.26787819, -0.00135594, 0.00083111, 0.00136312, -0.00000117, 0.00000000],
++		[-6.26789155, -0.00135535, 0.00083075, 0.00136253, -0.00000117, 0.00000000],
++		[-6.26790486, -0.00135476, 0.00083039, 0.00136193, -0.00000117, 0.00000000],
++		[-6.26791812, -0.00135417, 0.00083003, 0.00136134, -0.00000117, 0.00000000],
++		[-6.26793134, -0.00135358, 0.00082967, 0.00136075, -0.00000117, 0.00000000],
++		[-6.26794451, -0.00135299, 0.00082931, 0.00136016, -0.00000117, 0.00000000],
++		[-6.26795764, -0.00135240, 0.00082896, 0.00135956, -0.00000117, 0.00000000],
++		[-6.26797071, -0.00135182, 0.00082860, 0.00135897, -0.00000117, 0.00000000],
++		[-6.26798374, -0.00135123, 0.00082824, 0.00135838, -0.00000117, 0.00000000],
++		[-6.26799673, -0.00135064, 0.00082788, 0.00135779, -0.00000117, 0.00000000],
++		[-6.26800967, -0.00135006, 0.00082752, 0.00135720, -0.00000117, 0.00000000],
++		[-6.26802256, -0.00134947, 0.00082717, 0.00135662, -0.00000117, 0.00000000],
++		[-6.26803541, -0.00134889, 0.00082681, 0.00135603, -0.00000117, 0.00000000],
++		[-6.26804822, -0.00134830, 0.00082645, 0.00135544, -0.00000117, 0.00000000],
++		[-6.26806098, -0.00134772, 0.00082609, 0.00135485, -0.00000117, 0.00000000],
++		[-6.26807369, -0.00134713, 0.00082574, 0.00135427, -0.00000117, 0.00000000],
++		[-6.26808636, -0.00134655, 0.00082538, 0.00135368, -0.00000117, 0.00000000],
++		[-6.26809898, -0.00134597, 0.00082503, 0.00135309, -0.00000117, 0.00000000],
++		[-6.26811156, -0.00134539, 0.00082467, 0.00135251, -0.00000117, 0.00000000],
++		[-6.26812410, -0.00134481, 0.00082432, 0.00135192, -0.00000117, 0.00000000],
++		[-6.26813659, -0.00134422, 0.00082396, 0.00135134, -0.00000117, 0.00000000],
++		[-6.26814904, -0.00134364, 0.00082361, 0.00135075, -0.00000117, 0.00000000],
++		[-6.26816144, -0.00134306, 0.00082325, 0.00135017, -0.00000117, 0.00000000],
++		[-6.26817380, -0.00134248, 0.00082290, 0.00134959, -0.00000117, 0.00000000],
++		[-6.26818612, -0.00134191, 0.00082255, 0.00134901, -0.00000117, 0.00000000],
++		[-6.26819839, -0.00134133, 0.00082219, 0.00134842, -0.00000117, 0.00000000],
++		[-6.26821062, -0.00134075, 0.00082184, 0.00134784, -0.00000117, 0.00000000],
++		[-6.26822281, -0.00134017, 0.00082149, 0.00134726, -0.00000117, 0.00000000],
++		[-6.26823495, -0.00133959, 0.00082113, 0.00134668, -0.00000117, 0.00000000],
++		[-6.26824705, -0.00133902, 0.00082078, 0.00134610, -0.00000117, 0.00000000],
++		[-6.26825911, -0.00133844, 0.00082043, 0.00134552, -0.00000117, 0.00000000],
++		[-6.26827113, -0.00133787, 0.00082008, 0.00134494, -0.00000117, 0.00000000],
++		[-6.26828310, -0.00133729, 0.00081973, 0.00134437, -0.00000117, 0.00000000],
++		[-6.26829504, -0.00133672, 0.00081938, 0.00134379, -0.00000117, 0.00000000],
++		[-6.26830693, -0.00133614, 0.00081902, 0.00134321, -0.00000117, 0.00000000],
++		[-6.26831878, -0.00133557, 0.00081867, 0.00134263, -0.00000117, 0.00000000],
++		[-6.26833058, -0.00133499, 0.00081832, 0.00134206, -0.00000117, 0.00000000],
++		[-6.26834235, -0.00133442, 0.00081797, 0.00134148, -0.00000117, 0.00000000],
++		[-6.26835407, -0.00133385, 0.00081762, 0.00134090, -0.00000117, 0.00000000],
++		[-6.26836576, -0.00133328, 0.00081728, 0.00134033, -0.00000117, 0.00000000],
++		[-6.26837740, -0.00133271, 0.00081693, 0.00133976, -0.00000117, 0.00000000],
++		[-6.26838900, -0.00133214, 0.00081658, 0.00133918, -0.00000117, 0.00000000],
++		[-6.26840056, -0.00133157, 0.00081623, 0.00133861, -0.00000117, 0.00000000],
++		[-6.26841209, -0.00133100, 0.00081588, 0.00133803, -0.00000117, 0.00000000],
++		[-6.26842357, -0.00133043, 0.00081553, 0.00133746, -0.00000117, 0.00000000],
++		[-6.26843501, -0.00132986, 0.00081519, 0.00133689, -0.00000117, 0.00000000],
++		[-6.26844641, -0.00132929, 0.00081484, 0.00133632, -0.00000117, 0.00000000],
++		[-6.26845777, -0.00132872, 0.00081449, 0.00133575, -0.00000117, 0.00000000],
++		[-6.26846909, -0.00132815, 0.00081414, 0.00133518, -0.00000117, 0.00000000],
++		[-6.26848037, -0.00132759, 0.00081380, 0.00133461, -0.00000117, 0.00000000],
++		[-6.26849161, -0.00132702, 0.00081345, 0.00133404, -0.00000117, 0.00000000],
++		[-6.26850281, -0.00132645, 0.00081311, 0.00133347, -0.00000117, 0.00000000],
++		[-6.26851397, -0.00132589, 0.00081276, 0.00133290, -0.00000117, 0.00000000],
++		[-6.26852510, -0.00132532, 0.00081242, 0.00133233, -0.00000117, 0.00000000],
++		[-6.26853618, -0.00132476, 0.00081207, 0.00133176, -0.00000117, 0.00000000],
++		[-6.26854723, -0.00132419, 0.00081173, 0.00133120, -0.00000117, 0.00000000],
++		[-6.26855824, -0.00132363, 0.00081138, 0.00133063, -0.00000117, 0.00000000],
++		[-6.26856921, -0.00132307, 0.00081104, 0.00133006, -0.00000117, 0.00000000],
++		[-6.26858014, -0.00132251, 0.00081069, 0.00132950, -0.00000117, 0.00000000],
++		[-6.26859103, -0.00132194, 0.00081035, 0.00132893, -0.00000117, 0.00000000],
++		[-6.26860188, -0.00132138, 0.00081001, 0.00132837, -0.00000117, 0.00000000],
++		[-6.26861270, -0.00132082, 0.00080966, 0.00132780, -0.00000117, 0.00000000],
++		[-6.26862348, -0.00132026, 0.00080932, 0.00132724, -0.00000117, 0.00000000],
++		[-6.26863422, -0.00131970, 0.00080898, 0.00132667, -0.00000117, 0.00000000],
++		[-6.26864493, -0.00131914, 0.00080864, 0.00132611, -0.00000117, 0.00000000],
++		[-6.26865559, -0.00131858, 0.00080829, 0.00132555, -0.00000117, 0.00000000],
++		[-6.26866622, -0.00131802, 0.00080795, 0.00132499, -0.00000117, 0.00000000],
++		[-6.26867681, -0.00131746, 0.00080761, 0.00132442, -0.00000117, 0.00000000],
++		[-6.26868737, -0.00131690, 0.00080727, 0.00132386, -0.00000117, 0.00000000],
++		[-6.26869789, -0.00131635, 0.00080693, 0.00132330, -0.00000117, 0.00000000],
++		[-6.26870837, -0.00131579, 0.00080659, 0.00132274, -0.00000117, 0.00000000],
++		[-6.26871882, -0.00131523, 0.00080625, 0.00132218, -0.00000117, 0.00000000],
++		[-6.26872923, -0.00131468, 0.00080591, 0.00132162, -0.00000117, 0.00000000],
++		[-6.26873960, -0.00131412, 0.00080557, 0.00132106, -0.00000117, 0.00000000],
++		[-6.26874993, -0.00131357, 0.00080523, 0.00132050, -0.00000117, 0.00000000],
++		[-6.26876024, -0.00131301, 0.00080489, 0.00131995, -0.00000117, 0.00000000],
++		[-6.26877050, -0.00131246, 0.00080455, 0.00131939, -0.00000117, 0.00000000],
++		[-6.26878073, -0.00131190, 0.00080421, 0.00131883, -0.00000117, 0.00000000],
++		[-6.26879092, -0.00131135, 0.00080387, 0.00131828, -0.00000117, 0.00000000],
++		[-6.26880108, -0.00131080, 0.00080354, 0.00131772, -0.00000117, 0.00000000],
++		[-6.26881120, -0.00131024, 0.00080320, 0.00131716, -0.00000117, 0.00000000],
++		[-6.26882129, -0.00130969, 0.00080286, 0.00131661, -0.00000117, 0.00000000],
++		[-6.26883135, -0.00130914, 0.00080252, 0.00131605, -0.00000117, 0.00000000],
++		[-6.26884136, -0.00130859, 0.00080219, 0.00131550, -0.00000117, 0.00000000],
++		[-6.26885135, -0.00130804, 0.00080185, 0.00131495, -0.00000117, 0.00000000],
++		[-6.26886129, -0.00130749, 0.00080151, 0.00131439, -0.00000117, 0.00000000],
++		[-6.26887121, -0.00130694, 0.00080118, 0.00131384, -0.00000117, 0.00000000],
++		[-6.26888109, -0.00130639, 0.00080084, 0.00131329, -0.00000117, 0.00000000],
++		[-6.26889093, -0.00130584, 0.00080051, 0.00131274, -0.00000117, 0.00000000],
++		[-6.26890074, -0.00130529, 0.00080017, 0.00131218, -0.00000117, 0.00000000],
++		[-6.26891052, -0.00130474, 0.00079984, 0.00131163, -0.00000117, 0.00000000],
++		[-6.26892026, -0.00130420, 0.00079950, 0.00131108, -0.00000117, 0.00000000],
++		[-6.26892997, -0.00130365, 0.00079917, 0.00131053, -0.00000117, 0.00000000],
++		[-6.26893965, -0.00130310, 0.00079883, 0.00130998, -0.00000117, 0.00000000],
++		[-6.26894929, -0.00130256, 0.00079850, 0.00130943, -0.00000117, 0.00000000],
++		[-6.26895890, -0.00130201, 0.00079816, 0.00130888, -0.00000117, 0.00000000],
++		[-6.26896848, -0.00130146, 0.00079783, 0.00130834, -0.00000117, 0.00000000],
++		[-6.26897802, -0.00130092, 0.00079750, 0.00130779, -0.00000117, 0.00000000],
++		[-6.26898753, -0.00130038, 0.00079717, 0.00130724, -0.00000117, 0.00000000],
++		[-6.26899700, -0.00129983, 0.00079683, 0.00130669, -0.00000117, 0.00000000],
++		[-6.26900645, -0.00129929, 0.00079650, 0.00130615, -0.00000117, 0.00000000],
++		[-6.26901586, -0.00129875, 0.00079617, 0.00130560, -0.00000117, 0.00000000],
++		[-6.26902524, -0.00129820, 0.00079584, 0.00130506, -0.00000117, 0.00000000],
++		[-6.26903458, -0.00129766, 0.00079550, 0.00130451, -0.00000117, 0.00000000],
++		[-6.26904390, -0.00129712, 0.00079517, 0.00130397, -0.00000117, 0.00000000],
++		[-6.26905318, -0.00129658, 0.00079484, 0.00130342, -0.00000117, 0.00000000],
++		[-6.26906243, -0.00129604, 0.00079451, 0.00130288, -0.00000117, 0.00000000],
++		[-6.26907164, -0.00129550, 0.00079418, 0.00130233, -0.00000117, 0.00000000],
++		[-6.26908083, -0.00129496, 0.00079385, 0.00130179, -0.00000117, 0.00000000],
++		[-6.26908998, -0.00129442, 0.00079352, 0.00130125, -0.00000117, 0.00000000],
++		[-6.26909911, -0.00129388, 0.00079319, 0.00130071, -0.00000117, 0.00000000],
++		[-6.26910820, -0.00129334, 0.00079286, 0.00130016, -0.00000117, 0.00000000],
++		[-6.26911726, -0.00129280, 0.00079253, 0.00129962, -0.00000117, 0.00000000],
++		[-6.26912629, -0.00129226, 0.00079220, 0.00129908, -0.00000117, 0.00000000],
++		[-6.26913528, -0.00129173, 0.00079188, 0.00129854, -0.00000117, 0.00000000],
++		[-6.26914425, -0.00129119, 0.00079155, 0.00129800, -0.00000117, 0.00000000],
++		[-6.26915318, -0.00129065, 0.00079122, 0.00129746, -0.00000117, 0.00000000],
++		[-6.26916209, -0.00129012, 0.00079089, 0.00129692, -0.00000117, 0.00000000],
++		[-6.26917096, -0.00128958, 0.00079056, 0.00129639, -0.00000117, 0.00000000],
++		[-6.26917981, -0.00128905, 0.00079024, 0.00129585, -0.00000117, 0.00000000],
++		[-6.26918862, -0.00128851, 0.00078991, 0.00129531, -0.00000117, 0.00000000],
++		[-6.26919740, -0.00128798, 0.00078958, 0.00129477, -0.00000117, 0.00000000],
++		[-6.26920615, -0.00128744, 0.00078926, 0.00129424, -0.00000117, 0.00000000],
++		[-6.26921488, -0.00128691, 0.00078893, 0.00129370, -0.00000117, 0.00000000],
++		[-6.26922357, -0.00128638, 0.00078860, 0.00129316, -0.00000117, 0.00000000],
++		[-6.26923223, -0.00128585, 0.00078828, 0.00129263, -0.00000117, 0.00000000],
++		[-6.26924086, -0.00128531, 0.00078795, 0.00129209, -0.00000117, 0.00000000],
++		[-6.26924947, -0.00128478, 0.00078763, 0.00129156, -0.00000117, 0.00000000],
++		[-6.26925804, -0.00128425, 0.00078730, 0.00129102, -0.00000117, 0.00000000],
++		[-6.26926658, -0.00128372, 0.00078698, 0.00129049, -0.00000117, 0.00000000],
++		[-6.26927510, -0.00128319, 0.00078665, 0.00128996, -0.00000117, 0.00000000],
++		[-6.26928358, -0.00128266, 0.00078633, 0.00128942, -0.00000117, 0.00000000],
++		[-6.26929204, -0.00128213, 0.00078601, 0.00128889, -0.00000117, 0.00000000],
++		[-6.26930047, -0.00128160, 0.00078568, 0.00128836, -0.00000117, 0.00000000],
++		[-6.26930887, -0.00128107, 0.00078536, 0.00128783, -0.00000117, 0.00000000],
++		[-6.26931724, -0.00128054, 0.00078504, 0.00128730, -0.00000117, 0.00000000],
++		[-6.26932558, -0.00128002, 0.00078471, 0.00128677, -0.00000117, 0.00000000],
++		[-6.26933389, -0.00127949, 0.00078439, 0.00128624, -0.00000117, 0.00000000],
++		[-6.26934217, -0.00127896, 0.00078407, 0.00128571, -0.00000117, 0.00000000],
++		[-6.26935043, -0.00127844, 0.00078375, 0.00128518, -0.00000117, 0.00000000],
++		[-6.26935866, -0.00127791, 0.00078342, 0.00128465, -0.00000117, 0.00000000],
++		[-6.26936686, -0.00127738, 0.00078310, 0.00128412, -0.00000117, 0.00000000],
++		[-6.26937503, -0.00127686, 0.00078278, 0.00128359, -0.00000117, 0.00000000],
++		[-6.26938317, -0.00127634, 0.00078246, 0.00128306, -0.00000117, 0.00000000],
++		[-6.26939129, -0.00127581, 0.00078214, 0.00128254, -0.00000117, 0.00000000],
++		[-6.26939937, -0.00127529, 0.00078182, 0.00128201, -0.00000117, 0.00000000],
++		[-6.26940743, -0.00127476, 0.00078150, 0.00128148, -0.00000117, 0.00000000],
++		[-6.26941547, -0.00127424, 0.00078118, 0.00128096, -0.00000117, 0.00000000],
++		[-6.26942347, -0.00127372, 0.00078086, 0.00128043, -0.00000117, 0.00000000],
++		[-6.26943145, -0.00127320, 0.00078054, 0.00127991, -0.00000117, 0.00000000],
++		[-6.26943940, -0.00127267, 0.00078022, 0.00127938, -0.00000117, 0.00000000],
++		[-6.26944732, -0.00127215, 0.00077990, 0.00127886, -0.00000117, 0.00000000],
++		[-6.26945522, -0.00127163, 0.00077958, 0.00127833, -0.00000117, 0.00000000],
++		[-6.26946309, -0.00127111, 0.00077926, 0.00127781, -0.00000117, 0.00000000],
++		[-6.26947093, -0.00127059, 0.00077895, 0.00127729, -0.00000117, 0.00000000],
++		[-6.26947875, -0.00127007, 0.00077863, 0.00127677, -0.00000117, 0.00000000],
++		[-6.26948654, -0.00126955, 0.00077831, 0.00127624, -0.00000117, 0.00000000],
++		[-6.26949430, -0.00126903, 0.00077799, 0.00127572, -0.00000117, 0.00000000],
++		[-6.26950204, -0.00126852, 0.00077768, 0.00127520, -0.00000117, 0.00000000],
++		[-6.26950975, -0.00126800, 0.00077736, 0.00127468, -0.00000117, 0.00000000],
++		[-6.26951743, -0.00126748, 0.00077704, 0.00127416, -0.00000117, 0.00000000],
++		[-6.26952509, -0.00126696, 0.00077673, 0.00127364, -0.00000117, 0.00000000],
++		[-6.26953272, -0.00126645, 0.00077641, 0.00127312, -0.00000117, 0.00000000],
++		[-6.26954033, -0.00126593, 0.00077609, 0.00127260, -0.00000117, 0.00000000],
++		[-6.26954791, -0.00126541, 0.00077578, 0.00127208, -0.00000117, 0.00000000],
++		[-6.26955546, -0.00126490, 0.00077546, 0.00127156, -0.00000117, 0.00000000],
++		[-6.26956299, -0.00126438, 0.00077515, 0.00127104, -0.00000117, 0.00000000],
++		[-6.26957049, -0.00126387, 0.00077483, 0.00127053, -0.00000117, 0.00000000],
++		[-6.26957797, -0.00126335, 0.00077452, 0.00127001, -0.00000117, 0.00000000],
++		[-6.26958542, -0.00126284, 0.00077420, 0.00126949, -0.00000117, 0.00000000],
++		[-6.26959285, -0.00126233, 0.00077389, 0.00126898, -0.00000117, 0.00000000],
++		[-6.26960025, -0.00126181, 0.00077357, 0.00126846, -0.00000117, 0.00000000],
++		[-6.26960763, -0.00126130, 0.00077326, 0.00126795, -0.00000117, 0.00000000],
++		[-6.26961498, -0.00126079, 0.00077295, 0.00126743, -0.00000117, 0.00000000],
++		[-6.26962230, -0.00126028, 0.00077263, 0.00126692, -0.00000117, 0.00000000],
++		[-6.26962961, -0.00125977, 0.00077232, 0.00126640, -0.00000117, 0.00000000],
++		[-6.26963688, -0.00125926, 0.00077201, 0.00126589, -0.00000117, 0.00000000],
++		[-6.26964414, -0.00125874, 0.00077170, 0.00126537, -0.00000117, 0.00000000],
++		[-6.26965137, -0.00125823, 0.00077138, 0.00126486, -0.00000117, 0.00000000],
++		[-6.26965857, -0.00125772, 0.00077107, 0.00126435, -0.00000117, 0.00000000],
++		[-6.26966575, -0.00125722, 0.00077076, 0.00126384, -0.00000117, 0.00000000],
++		[-6.26967290, -0.00125671, 0.00077045, 0.00126333, -0.00000117, 0.00000000],
++		[-6.26968003, -0.00125620, 0.00077014, 0.00126281, -0.00000117, 0.00000000],
++		[-6.26968714, -0.00125569, 0.00076983, 0.00126230, -0.00000117, 0.00000000],
++		[-6.26969422, -0.00125518, 0.00076952, 0.00126179, -0.00000117, 0.00000000],
++		[-6.26970128, -0.00125468, 0.00076920, 0.00126128, -0.00000117, 0.00000000],
++		[-6.26970832, -0.00125417, 0.00076889, 0.00126077, -0.00000117, 0.00000000],
++		[-6.26971533, -0.00125366, 0.00076858, 0.00126026, -0.00000117, 0.00000000],
++		[-6.26972232, -0.00125316, 0.00076827, 0.00125975, -0.00000117, 0.00000000],
++		[-6.26972928, -0.00125265, 0.00076797, 0.00125925, -0.00000117, 0.00000000],
++		[-6.26973622, -0.00125214, 0.00076766, 0.00125874, -0.00000117, 0.00000000],
++		[-6.26974314, -0.00125164, 0.00076735, 0.00125823, -0.00000117, 0.00000000],
++		[-6.26975003, -0.00125114, 0.00076704, 0.00125772, -0.00000117, 0.00000000],
++		[-6.26975691, -0.00125063, 0.00076673, 0.00125722, -0.00000117, 0.00000000],
++		[-6.26976375, -0.00125013, 0.00076642, 0.00125671, -0.00000117, 0.00000000],
++		[-6.26977058, -0.00124962, 0.00076611, 0.00125620, -0.00000117, 0.00000000],
++		[-6.26977738, -0.00124912, 0.00076581, 0.00125570, -0.00000117, 0.00000000],
++		[-6.26978416, -0.00124862, 0.00076550, 0.00125519, -0.00000117, 0.00000000],
++		[-6.26979092, -0.00124812, 0.00076519, 0.00125469, -0.00000117, 0.00000000],
++		[-6.26979765, -0.00124762, 0.00076488, 0.00125418, -0.00000117, 0.00000000],
++		[-6.26980436, -0.00124711, 0.00076458, 0.00125368, -0.00000117, 0.00000000],
++		[-6.26981105, -0.00124661, 0.00076427, 0.00125318, -0.00000117, 0.00000000],
++		[-6.26981772, -0.00124611, 0.00076396, 0.00125267, -0.00000117, 0.00000000],
++		[-6.26982436, -0.00124561, 0.00076366, 0.00125217, -0.00000117, 0.00000000],
++		[-6.26983098, -0.00124511, 0.00076335, 0.00125167, -0.00000117, 0.00000000],
++		[-6.26983758, -0.00124461, 0.00076305, 0.00125116, -0.00000117, 0.00000000],
++		[-6.26984416, -0.00124412, 0.00076274, 0.00125066, -0.00000117, 0.00000000],
++		[-6.26985071, -0.00124362, 0.00076244, 0.00125016, -0.00000117, 0.00000000],
++		[-6.26985725, -0.00124312, 0.00076213, 0.00124966, -0.00000117, 0.00000000],
++		[-6.26986376, -0.00124262, 0.00076183, 0.00124916, -0.00000117, 0.00000000],
++		[-6.26987025, -0.00124212, 0.00076152, 0.00124866, -0.00000117, 0.00000000],
++		[-6.26987672, -0.00124163, 0.00076122, 0.00124816, -0.00000117, 0.00000000],
++		[-6.26988316, -0.00124113, 0.00076091, 0.00124766, -0.00000117, 0.00000000],
++		[-6.26988959, -0.00124063, 0.00076061, 0.00124716, -0.00000117, 0.00000000],
++		[-6.26989599, -0.00124014, 0.00076031, 0.00124666, -0.00000117, 0.00000000],
++		[-6.26990237, -0.00123964, 0.00076000, 0.00124617, -0.00000117, 0.00000000],
++		[-6.26990873, -0.00123915, 0.00075970, 0.00124567, -0.00000117, 0.00000000],
++		[-6.26991507, -0.00123865, 0.00075940, 0.00124517, -0.00000117, 0.00000000],
++		[-6.26992139, -0.00123816, 0.00075909, 0.00124467, -0.00000117, 0.00000000],
++		[-6.26992769, -0.00123767, 0.00075879, 0.00124418, -0.00000117, 0.00000000],
++		[-6.26993396, -0.00123717, 0.00075849, 0.00124368, -0.00000117, 0.00000000],
++		[-6.26994022, -0.00123668, 0.00075819, 0.00124319, -0.00000117, 0.00000000],
++		[-6.26994645, -0.00123619, 0.00075789, 0.00124269, -0.00000117, 0.00000000],
++		[-6.26995267, -0.00123569, 0.00075758, 0.00124219, -0.00000117, 0.00000000],
++		[-6.26995886, -0.00123520, 0.00075728, 0.00124170, -0.00000117, 0.00000000],
++		[-6.26996503, -0.00123471, 0.00075698, 0.00124121, -0.00000117, 0.00000000],
++		[-6.26997119, -0.00123422, 0.00075668, 0.00124071, -0.00000117, 0.00000000],
++		[-6.26997732, -0.00123373, 0.00075638, 0.00124022, -0.00000117, 0.00000000],
++		[-6.26998343, -0.00123324, 0.00075608, 0.00123973, -0.00000117, 0.00000000],
++		[-6.26998952, -0.00123275, 0.00075578, 0.00123923, -0.00000117, 0.00000000],
++		[-6.26999559, -0.00123226, 0.00075548, 0.00123874, -0.00000117, 0.00000000],
++		[-6.27000164, -0.00123177, 0.00075518, 0.00123825, -0.00000117, 0.00000000],
++		[-6.27000767, -0.00123128, 0.00075488, 0.00123776, -0.00000117, 0.00000000],
++		[-6.27001368, -0.00123079, 0.00075458, 0.00123727, -0.00000117, 0.00000000],
++		[-6.27001968, -0.00123031, 0.00075428, 0.00123678, -0.00000117, 0.00000000],
++		[-6.27002565, -0.00122982, 0.00075399, 0.00123629, -0.00000117, 0.00000000],
++		[-6.27003160, -0.00122933, 0.00075369, 0.00123580, -0.00000117, 0.00000000],
++		[-6.27003753, -0.00122884, 0.00075339, 0.00123531, -0.00000117, 0.00000000],
++		[-6.27004344, -0.00122836, 0.00075309, 0.00123482, -0.00000117, 0.00000000],
++		[-6.27004933, -0.00122787, 0.00075279, 0.00123433, -0.00000117, 0.00000000],
++		[-6.27005521, -0.00122739, 0.00075250, 0.00123384, -0.00000117, 0.00000000],
++		[-6.27006106, -0.00122690, 0.00075220, 0.00123335, -0.00000117, 0.00000000],
++		[-6.27006690, -0.00122642, 0.00075190, 0.00123286, -0.00000117, 0.00000000],
++		[-6.27007271, -0.00122593, 0.00075160, 0.00123238, -0.00000117, 0.00000000],
++		[-6.27007851, -0.00122545, 0.00075131, 0.00123189, -0.00000117, 0.00000000],
++		[-6.27008428, -0.00122496, 0.00075101, 0.00123140, -0.00000117, 0.00000000],
++		[-6.27009004, -0.00122448, 0.00075072, 0.00123092, -0.00000117, 0.00000000],
++		[-6.27009578, -0.00122400, 0.00075042, 0.00123043, -0.00000117, 0.00000000],
++		[-6.27010150, -0.00122351, 0.00075012, 0.00122995, -0.00000117, 0.00000000],
++		[-6.27010720, -0.00122303, 0.00074983, 0.00122946, -0.00000117, 0.00000000],
++		[-6.27011288, -0.00122255, 0.00074953, 0.00122898, -0.00000117, 0.00000000],
++		[-6.27011855, -0.00122207, 0.00074924, 0.00122849, -0.00000117, 0.00000000],
++		[-6.27012419, -0.00122159, 0.00074894, 0.00122801, -0.00000117, 0.00000000],
++		[-6.27012982, -0.00122111, 0.00074865, 0.00122752, -0.00000117, 0.00000000],
++		[-6.27013543, -0.00122063, 0.00074836, 0.00122704, -0.00000117, 0.00000000],
++		[-6.27014102, -0.00122015, 0.00074806, 0.00122656, -0.00000117, 0.00000000],
++		[-6.27014659, -0.00121967, 0.00074777, 0.00122608, -0.00000117, 0.00000000],
++		[-6.27015214, -0.00121919, 0.00074747, 0.00122559, -0.00000117, 0.00000000],
++		[-6.27015767, -0.00121871, 0.00074718, 0.00122511, -0.00000117, 0.00000000],
++		[-6.27016319, -0.00121823, 0.00074689, 0.00122463, -0.00000117, 0.00000000],
++		[-6.27016869, -0.00121775, 0.00074659, 0.00122415, -0.00000117, 0.00000000],
++		[-6.27017417, -0.00121727, 0.00074630, 0.00122367, -0.00000117, 0.00000000],
++		[-6.27017963, -0.00121680, 0.00074601, 0.00122319, -0.00000117, 0.00000000],
++		[-6.27018508, -0.00121632, 0.00074572, 0.00122271, -0.00000117, 0.00000000],
++		[-6.27019050, -0.00121584, 0.00074543, 0.00122223, -0.00000117, 0.00000000],
++		[-6.27019591, -0.00121537, 0.00074513, 0.00122175, -0.00000117, 0.00000000],
++		[-6.27020130, -0.00121489, 0.00074484, 0.00122127, -0.00000117, 0.00000000],
++		[-6.27020668, -0.00121441, 0.00074455, 0.00122080, -0.00000117, 0.00000000],
++		[-6.27021203, -0.00121394, 0.00074426, 0.00122032, -0.00000117, 0.00000000],
++		[-6.27021737, -0.00121346, 0.00074397, 0.00121984, -0.00000117, 0.00000000],
++		[-6.27022270, -0.00121299, 0.00074368, 0.00121936, -0.00000117, 0.00000000],
++		[-6.27022800, -0.00121252, 0.00074339, 0.00121889, -0.00000117, 0.00000000],
++		[-6.27023329, -0.00121204, 0.00074310, 0.00121841, -0.00000117, 0.00000000],
++		[-6.27023856, -0.00121157, 0.00074281, 0.00121793, -0.00000117, 0.00000000],
++		[-6.27024381, -0.00121110, 0.00074252, 0.00121746, -0.00000117, 0.00000000],
++		[-6.27024904, -0.00121062, 0.00074223, 0.00121698, -0.00000117, 0.00000000],
++		[-6.27025426, -0.00121015, 0.00074194, 0.00121651, -0.00000117, 0.00000000],
++		[-6.27025946, -0.00120968, 0.00074165, 0.00121603, -0.00000117, 0.00000000],
++		[-6.27026465, -0.00120921, 0.00074136, 0.00121556, -0.00000117, 0.00000000],
++		[-6.27026982, -0.00120874, 0.00074107, 0.00121509, -0.00000117, 0.00000000],
++		[-6.27027497, -0.00120827, 0.00074078, 0.00121461, -0.00000117, 0.00000000],
++		[-6.27028010, -0.00120780, 0.00074050, 0.00121414, -0.00000117, 0.00000000],
++		[-6.27028522, -0.00120732, 0.00074021, 0.00121367, -0.00000116, 0.00000000],
++		[-6.27029032, -0.00120686, 0.00073992, 0.00121319, -0.00000116, 0.00000000],
++		[-6.27029541, -0.00120639, 0.00073963, 0.00121272, -0.00000116, 0.00000000],
++		[-6.27030047, -0.00120592, 0.00073934, 0.00121225, -0.00000116, 0.00000000],
++		[-6.27030552, -0.00120545, 0.00073906, 0.00121178, -0.00000116, 0.00000000],
++		[-6.27031056, -0.00120498, 0.00073877, 0.00121131, -0.00000116, 0.00000000],
++		[-6.27031558, -0.00120451, 0.00073848, 0.00121084, -0.00000116, 0.00000000],
++		[-6.27032058, -0.00120404, 0.00073820, 0.00121037, -0.00000116, 0.00000000],
++		[-6.27032557, -0.00120358, 0.00073791, 0.00120990, -0.00000116, 0.00000000],
++		[-6.27033054, -0.00120311, 0.00073763, 0.00120943, -0.00000116, 0.00000000],
++		[-6.27033549, -0.00120264, 0.00073734, 0.00120896, -0.00000116, 0.00000000],
++		[-6.27034043, -0.00120218, 0.00073705, 0.00120849, -0.00000116, 0.00000000],
++		[-6.27034536, -0.00120171, 0.00073677, 0.00120802, -0.00000116, 0.00000000],
++		[-6.27035026, -0.00120125, 0.00073648, 0.00120755, -0.00000116, 0.00000000],
++		[-6.27035515, -0.00120078, 0.00073620, 0.00120709, -0.00000116, 0.00000000],
++		[-6.27036003, -0.00120032, 0.00073591, 0.00120662, -0.00000116, 0.00000000],
++		[-6.27036489, -0.00119985, 0.00073563, 0.00120615, -0.00000116, 0.00000000],
++		[-6.27036973, -0.00119939, 0.00073535, 0.00120569, -0.00000116, 0.00000000],
++		[-6.27037456, -0.00119892, 0.00073506, 0.00120522, -0.00000116, 0.00000000],
++		[-6.27037937, -0.00119846, 0.00073478, 0.00120475, -0.00000116, 0.00000000],
++		[-6.27038417, -0.00119800, 0.00073449, 0.00120429, -0.00000116, 0.00000000],
++		[-6.27038895, -0.00119754, 0.00073421, 0.00120382, -0.00000116, 0.00000000],
++		[-6.27039372, -0.00119707, 0.00073393, 0.00120336, -0.00000116, 0.00000000],
++		[-6.27039847, -0.00119661, 0.00073364, 0.00120289, -0.00000116, 0.00000000],
++		[-6.27040321, -0.00119615, 0.00073336, 0.00120243, -0.00000116, 0.00000000],
++		[-6.27040793, -0.00119569, 0.00073308, 0.00120197, -0.00000116, 0.00000000],
++		[-6.27041263, -0.00119523, 0.00073280, 0.00120150, -0.00000116, 0.00000000],
++		[-6.27041732, -0.00119477, 0.00073251, 0.00120104, -0.00000116, 0.00000000],
++		[-6.27042200, -0.00119431, 0.00073223, 0.00120058, -0.00000116, 0.00000000],
++		[-6.27042666, -0.00119385, 0.00073195, 0.00120011, -0.00000116, 0.00000000],
++		[-6.27043131, -0.00119339, 0.00073167, 0.00119965, -0.00000116, 0.00000000],
++		[-6.27043594, -0.00119293, 0.00073139, 0.00119919, -0.00000116, 0.00000000],
++		[-6.27044055, -0.00119247, 0.00073111, 0.00119873, -0.00000116, 0.00000000],
++		[-6.27044516, -0.00119201, 0.00073083, 0.00119827, -0.00000116, 0.00000000],
++		[-6.27044974, -0.00119155, 0.00073054, 0.00119781, -0.00000116, 0.00000000],
++		[-6.27045432, -0.00119110, 0.00073026, 0.00119735, -0.00000116, 0.00000000],
++		[-6.27045887, -0.00119064, 0.00072998, 0.00119689, -0.00000116, 0.00000000],
++		[-6.27046342, -0.00119018, 0.00072970, 0.00119643, -0.00000116, 0.00000000],
++		[-6.27046795, -0.00118973, 0.00072942, 0.00119597, -0.00000116, 0.00000000],
++		[-6.27047246, -0.00118927, 0.00072914, 0.00119551, -0.00000116, 0.00000000],
++		[-6.27047696, -0.00118881, 0.00072887, 0.00119505, -0.00000116, 0.00000000],
++		[-6.27048145, -0.00118836, 0.00072859, 0.00119459, -0.00000116, 0.00000000],
++		[-6.27048592, -0.00118790, 0.00072831, 0.00119414, -0.00000116, 0.00000000],
++		[-6.27049038, -0.00118745, 0.00072803, 0.00119368, -0.00000116, 0.00000000],
++		[-6.27049482, -0.00118699, 0.00072775, 0.00119322, -0.00000116, 0.00000000],
++		[-6.27049925, -0.00118654, 0.00072747, 0.00119277, -0.00000116, 0.00000000],
++		[-6.27050366, -0.00118609, 0.00072719, 0.00119231, -0.00000116, 0.00000000],
++		[-6.27050807, -0.00118563, 0.00072692, 0.00119185, -0.00000116, 0.00000000],
++		[-6.27051245, -0.00118518, 0.00072664, 0.00119140, -0.00000116, 0.00000000],
++		[-6.27051683, -0.00118473, 0.00072636, 0.00119094, -0.00000116, 0.00000000],
++		[-6.27052119, -0.00118427, 0.00072608, 0.00119049, -0.00000116, 0.00000000],
++		[-6.27052553, -0.00118382, 0.00072581, 0.00119003, -0.00000116, 0.00000000],
++		[-6.27052986, -0.00118337, 0.00072553, 0.00118958, -0.00000116, 0.00000000],
++		[-6.27053418, -0.00118292, 0.00072525, 0.00118912, -0.00000116, 0.00000000],
++		[-6.27053849, -0.00118247, 0.00072498, 0.00118867, -0.00000116, 0.00000000],
++		[-6.27054278, -0.00118202, 0.00072470, 0.00118822, -0.00000116, 0.00000000],
++		[-6.27054706, -0.00118157, 0.00072442, 0.00118776, -0.00000116, 0.00000000],
++		[-6.27055132, -0.00118112, 0.00072415, 0.00118731, -0.00000116, 0.00000000],
++		[-6.27055557, -0.00118067, 0.00072387, 0.00118686, -0.00000116, 0.00000000],
++		[-6.27055981, -0.00118022, 0.00072360, 0.00118641, -0.00000116, 0.00000000],
++		[-6.27056403, -0.00117977, 0.00072332, 0.00118596, -0.00000116, 0.00000000],
++		[-6.27056825, -0.00117932, 0.00072305, 0.00118550, -0.00000116, 0.00000000],
++		[-6.27057244, -0.00117887, 0.00072277, 0.00118505, -0.00000116, 0.00000000],
++		[-6.27057663, -0.00117842, 0.00072250, 0.00118460, -0.00000116, 0.00000000],
++		[-6.27058080, -0.00117798, 0.00072222, 0.00118415, -0.00000116, 0.00000000],
++		[-6.27058496, -0.00117753, 0.00072195, 0.00118370, -0.00000116, 0.00000000],
++		[-6.27058910, -0.00117708, 0.00072167, 0.00118325, -0.00000116, 0.00000000],
++		[-6.27059324, -0.00117663, 0.00072140, 0.00118280, -0.00000116, 0.00000000],
++		[-6.27059736, -0.00117619, 0.00072113, 0.00118236, -0.00000116, 0.00000000],
++		[-6.27060146, -0.00117574, 0.00072085, 0.00118191, -0.00000116, 0.00000000],
++		[-6.27060556, -0.00117530, 0.00072058, 0.00118146, -0.00000116, 0.00000000],
++		[-6.27060964, -0.00117485, 0.00072031, 0.00118101, -0.00000116, 0.00000000],
++		[-6.27061371, -0.00117441, 0.00072004, 0.00118056, -0.00000116, 0.00000000],
++		[-6.27061776, -0.00117396, 0.00071976, 0.00118012, -0.00000116, 0.00000000],
++		[-6.27062180, -0.00117352, 0.00071949, 0.00117967, -0.00000116, 0.00000000],
++		[-6.27062583, -0.00117307, 0.00071922, 0.00117922, -0.00000116, 0.00000000],
++		[-6.27062985, -0.00117263, 0.00071895, 0.00117878, -0.00000116, 0.00000000],
++		[-6.27063386, -0.00117219, 0.00071867, 0.00117833, -0.00000116, 0.00000000],
++		[-6.27063785, -0.00117174, 0.00071840, 0.00117789, -0.00000116, 0.00000000],
++		[-6.27064183, -0.00117130, 0.00071813, 0.00117744, -0.00000116, 0.00000000],
++		[-6.27064580, -0.00117086, 0.00071786, 0.00117700, -0.00000116, 0.00000000],
++		[-6.27064976, -0.00117042, 0.00071759, 0.00117655, -0.00000116, 0.00000000],
++		[-6.27065370, -0.00116997, 0.00071732, 0.00117611, -0.00000116, 0.00000000],
++		[-6.27065763, -0.00116953, 0.00071705, 0.00117566, -0.00000116, 0.00000000],
++		[-6.27066155, -0.00116909, 0.00071678, 0.00117522, -0.00000116, 0.00000000],
++		[-6.27066546, -0.00116865, 0.00071651, 0.00117478, -0.00000116, 0.00000000],
++		[-6.27066935, -0.00116821, 0.00071624, 0.00117433, -0.00000116, 0.00000000],
++		[-6.27067323, -0.00116777, 0.00071597, 0.00117389, -0.00000116, 0.00000000],
++		[-6.27067711, -0.00116733, 0.00071570, 0.00117345, -0.00000116, 0.00000000],
++		[-6.27068096, -0.00116689, 0.00071543, 0.00117301, -0.00000116, 0.00000000],
++		[-6.27068481, -0.00116645, 0.00071516, 0.00117257, -0.00000116, 0.00000000],
++		[-6.27068865, -0.00116601, 0.00071489, 0.00117212, -0.00000116, 0.00000000],
++		[-6.27069247, -0.00116558, 0.00071462, 0.00117168, -0.00000116, 0.00000000],
++		[-6.27069628, -0.00116514, 0.00071435, 0.00117124, -0.00000116, 0.00000000],
++		[-6.27070008, -0.00116470, 0.00071409, 0.00117080, -0.00000116, 0.00000000],
++		[-6.27070387, -0.00116426, 0.00071382, 0.00117036, -0.00000116, 0.00000000],
++		[-6.27070765, -0.00116383, 0.00071355, 0.00116992, -0.00000116, 0.00000000],
++		[-6.27071141, -0.00116339, 0.00071328, 0.00116948, -0.00000116, 0.00000000],
++		[-6.27071516, -0.00116295, 0.00071301, 0.00116905, -0.00000116, 0.00000000],
++		[-6.27071891, -0.00116252, 0.00071275, 0.00116861, -0.00000116, 0.00000000],
++		[-6.27072264, -0.00116208, 0.00071248, 0.00116817, -0.00000116, 0.00000000],
++		[-6.27072636, -0.00116165, 0.00071221, 0.00116773, -0.00000116, 0.00000000],
++		[-6.27073006, -0.00116121, 0.00071195, 0.00116729, -0.00000116, 0.00000000],
++		[-6.27073376, -0.00116078, 0.00071168, 0.00116686, -0.00000116, 0.00000000],
++		[-6.27073744, -0.00116034, 0.00071141, 0.00116642, -0.00000116, 0.00000000],
++		[-6.27074112, -0.00115991, 0.00071115, 0.00116598, -0.00000116, 0.00000000],
++		[-6.27074478, -0.00115947, 0.00071088, 0.00116555, -0.00000116, 0.00000000],
++		[-6.27074843, -0.00115904, 0.00071062, 0.00116511, -0.00000116, 0.00000000],
++		[-6.27075207, -0.00115861, 0.00071035, 0.00116468, -0.00000116, 0.00000000],
++		[-6.27075570, -0.00115817, 0.00071008, 0.00116424, -0.00000116, 0.00000000],
++		[-6.27075932, -0.00115774, 0.00070982, 0.00116381, -0.00000116, 0.00000000],
++		[-6.27076293, -0.00115731, 0.00070955, 0.00116337, -0.00000116, 0.00000000],
++		[-6.27076652, -0.00115688, 0.00070929, 0.00116294, -0.00000116, 0.00000000],
++		[-6.27077011, -0.00115644, 0.00070902, 0.00116250, -0.00000116, 0.00000000],
++		[-6.27077368, -0.00115601, 0.00070876, 0.00116207, -0.00000116, 0.00000000],
++		[-6.27077724, -0.00115558, 0.00070850, 0.00116164, -0.00000116, 0.00000000],
++		[-6.27078080, -0.00115515, 0.00070823, 0.00116120, -0.00000116, 0.00000000],
++		[-6.27078434, -0.00115472, 0.00070797, 0.00116077, -0.00000116, 0.00000000],
++		[-6.27078787, -0.00115429, 0.00070770, 0.00116034, -0.00000116, 0.00000000],
++		[-6.27079139, -0.00115386, 0.00070744, 0.00115991, -0.00000116, 0.00000000],
++		[-6.27079490, -0.00115343, 0.00070718, 0.00115947, -0.00000116, 0.00000000],
++		[-6.27079840, -0.00115300, 0.00070692, 0.00115904, -0.00000116, 0.00000000],
++		[-6.27080189, -0.00115257, 0.00070665, 0.00115861, -0.00000116, 0.00000000],
++		[-6.27080537, -0.00115215, 0.00070639, 0.00115818, -0.00000116, 0.00000000],
++		[-6.27080883, -0.00115172, 0.00070613, 0.00115775, -0.00000116, 0.00000000],
++		[-6.27081229, -0.00115129, 0.00070586, 0.00115732, -0.00000116, 0.00000000],
++		[-6.27081574, -0.00115086, 0.00070560, 0.00115689, -0.00000116, 0.00000000],
++		[-6.27081917, -0.00115044, 0.00070534, 0.00115646, -0.00000116, 0.00000000],
++		[-6.27082260, -0.00115001, 0.00070508, 0.00115603, -0.00000116, 0.00000000],
++		[-6.27082601, -0.00114958, 0.00070482, 0.00115560, -0.00000116, 0.00000000],
++		[-6.27082942, -0.00114916, 0.00070456, 0.00115517, -0.00000116, 0.00000000],
++		[-6.27083281, -0.00114873, 0.00070430, 0.00115475, -0.00000116, 0.00000000],
++		[-6.27083620, -0.00114830, 0.00070403, 0.00115432, -0.00000116, 0.00000000],
++		[-6.27083957, -0.00114788, 0.00070377, 0.00115389, -0.00000116, 0.00000000],
++		[-6.27084294, -0.00114745, 0.00070351, 0.00115346, -0.00000116, 0.00000000],
++		[-6.27084629, -0.00114703, 0.00070325, 0.00115304, -0.00000116, 0.00000000],
++		[-6.27084964, -0.00114661, 0.00070299, 0.00115261, -0.00000116, 0.00000000],
++		[-6.27085297, -0.00114618, 0.00070273, 0.00115218, -0.00000116, 0.00000000],
++		[-6.27085630, -0.00114576, 0.00070247, 0.00115176, -0.00000116, 0.00000000],
++		[-6.27085961, -0.00114533, 0.00070221, 0.00115133, -0.00000116, 0.00000000],
++		[-6.27086292, -0.00114491, 0.00070195, 0.00115091, -0.00000116, 0.00000000],
++		[-6.27086621, -0.00114449, 0.00070169, 0.00115048, -0.00000116, 0.00000000],
++		[-6.27086950, -0.00114407, 0.00070144, 0.00115006, -0.00000116, 0.00000000],
++		[-6.27087277, -0.00114364, 0.00070118, 0.00114963, -0.00000116, 0.00000000],
++		[-6.27087604, -0.00114322, 0.00070092, 0.00114921, -0.00000116, 0.00000000],
++		[-6.27087929, -0.00114280, 0.00070066, 0.00114878, -0.00000116, 0.00000000],
++		[-6.27088254, -0.00114238, 0.00070040, 0.00114836, -0.00000116, 0.00000000],
++		[-6.27088577, -0.00114196, 0.00070014, 0.00114794, -0.00000116, 0.00000000],
++		[-6.27088900, -0.00114154, 0.00069989, 0.00114751, -0.00000116, 0.00000000],
++		[-6.27089222, -0.00114112, 0.00069963, 0.00114709, -0.00000116, 0.00000000],
++		[-6.27089543, -0.00114070, 0.00069937, 0.00114667, -0.00000116, 0.00000000],
++		[-6.27089862, -0.00114028, 0.00069911, 0.00114625, -0.00000116, 0.00000000],
++		[-6.27090181, -0.00113986, 0.00069886, 0.00114582, -0.00000116, 0.00000000],
++		[-6.27090499, -0.00113944, 0.00069860, 0.00114540, -0.00000116, 0.00000000],
++		[-6.27090816, -0.00113902, 0.00069834, 0.00114498, -0.00000116, 0.00000000],
++		[-6.27091132, -0.00113860, 0.00069809, 0.00114456, -0.00000116, 0.00000000],
++		[-6.27091447, -0.00113818, 0.00069783, 0.00114414, -0.00000116, 0.00000000],
++		[-6.27091762, -0.00113777, 0.00069757, 0.00114372, -0.00000116, 0.00000000],
++		[-6.27092075, -0.00113735, 0.00069732, 0.00114330, -0.00000116, 0.00000000],
++		[-6.27092387, -0.00113693, 0.00069706, 0.00114288, -0.00000116, 0.00000000],
++		[-6.27092699, -0.00113651, 0.00069681, 0.00114246, -0.00000116, 0.00000000],
++		[-6.27093009, -0.00113610, 0.00069655, 0.00114204, -0.00000116, 0.00000000],
++		[-6.27093319, -0.00113568, 0.00069629, 0.00114162, -0.00000116, 0.00000000],
++		[-6.27093627, -0.00113527, 0.00069604, 0.00114121, -0.00000116, 0.00000000],
++		[-6.27093935, -0.00113485, 0.00069578, 0.00114079, -0.00000116, 0.00000000],
++		[-6.27094242, -0.00113443, 0.00069553, 0.00114037, -0.00000116, 0.00000000],
++		[-6.27094548, -0.00113402, 0.00069528, 0.00113995, -0.00000116, 0.00000000],
++		[-6.27094853, -0.00113360, 0.00069502, 0.00113954, -0.00000116, 0.00000000],
++		[-6.27095157, -0.00113319, 0.00069477, 0.00113912, -0.00000116, 0.00000000],
++		[-6.27095461, -0.00113278, 0.00069451, 0.00113870, -0.00000116, 0.00000000],
++		[-6.27095763, -0.00113236, 0.00069426, 0.00113829, -0.00000116, 0.00000000],
++		[-6.27096065, -0.00113195, 0.00069401, 0.00113787, -0.00000116, 0.00000000],
++		[-6.27096365, -0.00113154, 0.00069375, 0.00113745, -0.00000116, 0.00000000],
++		[-6.27096665, -0.00113112, 0.00069350, 0.00113704, -0.00000116, 0.00000000],
++		[-6.27096964, -0.00113071, 0.00069325, 0.00113662, -0.00000116, 0.00000000],
++		[-6.27097262, -0.00113030, 0.00069299, 0.00113621, -0.00000116, 0.00000000],
++		[-6.27097559, -0.00112989, 0.00069274, 0.00113580, -0.00000116, 0.00000000],
++		[-6.27097856, -0.00112947, 0.00069249, 0.00113538, -0.00000116, 0.00000000],
++		[-6.27098151, -0.00112906, 0.00069224, 0.00113497, -0.00000116, 0.00000000],
++		[-6.27098446, -0.00112865, 0.00069198, 0.00113455, -0.00000116, 0.00000000],
++		[-6.27098739, -0.00112824, 0.00069173, 0.00113414, -0.00000116, 0.00000000],
++		[-6.27099032, -0.00112783, 0.00069148, 0.00113373, -0.00000116, 0.00000000],
++		[-6.27099324, -0.00112742, 0.00069123, 0.00113332, -0.00000116, 0.00000000],
++		[-6.27099616, -0.00112701, 0.00069098, 0.00113290, -0.00000116, 0.00000000],
++		[-6.27099906, -0.00112660, 0.00069072, 0.00113249, -0.00000116, 0.00000000],
++		[-6.27100196, -0.00112619, 0.00069047, 0.00113208, -0.00000116, 0.00000000],
++		[-6.27100484, -0.00112578, 0.00069022, 0.00113167, -0.00000116, 0.00000000],
++		[-6.27100772, -0.00112537, 0.00068997, 0.00113126, -0.00000116, 0.00000000],
++		[-6.27101059, -0.00112496, 0.00068972, 0.00113085, -0.00000116, 0.00000000],
++		[-6.27101345, -0.00112455, 0.00068947, 0.00113044, -0.00000116, 0.00000000],
++		[-6.27101631, -0.00112415, 0.00068922, 0.00113003, -0.00000116, 0.00000000],
++		[-6.27101915, -0.00112374, 0.00068897, 0.00112962, -0.00000116, 0.00000000],
++		[-6.27102199, -0.00112333, 0.00068872, 0.00112921, -0.00000116, 0.00000000],
++		[-6.27102482, -0.00112292, 0.00068847, 0.00112880, -0.00000116, 0.00000000],
++		[-6.27102764, -0.00112252, 0.00068822, 0.00112839, -0.00000116, 0.00000000],
++		[-6.27103045, -0.00112211, 0.00068797, 0.00112798, -0.00000116, 0.00000000],
++		[-6.27103326, -0.00112171, 0.00068772, 0.00112757, -0.00000116, 0.00000000],
++		[-6.27103606, -0.00112130, 0.00068747, 0.00112716, -0.00000116, 0.00000000],
++		[-6.27103885, -0.00112089, 0.00068723, 0.00112675, -0.00000116, 0.00000000],
++		[-6.27104163, -0.00112049, 0.00068698, 0.00112635, -0.00000116, 0.00000000],
++		[-6.27104440, -0.00112008, 0.00068673, 0.00112594, -0.00000116, 0.00000000],
++		[-6.27104717, -0.00111968, 0.00068648, 0.00112553, -0.00000116, 0.00000000],
++		[-6.27104992, -0.00111927, 0.00068623, 0.00112513, -0.00000116, 0.00000000],
++		[-6.27105267, -0.00111887, 0.00068599, 0.00112472, -0.00000116, 0.00000000],
++		[-6.27105541, -0.00111847, 0.00068574, 0.00112431, -0.00000116, 0.00000000],
++		[-6.27105815, -0.00111806, 0.00068549, 0.00112391, -0.00000116, 0.00000000],
++		[-6.27106088, -0.00111766, 0.00068524, 0.00112350, -0.00000116, 0.00000000],
++		[-6.27106359, -0.00111726, 0.00068500, 0.00112310, -0.00000116, 0.00000000],
++		[-6.27106630, -0.00111685, 0.00068475, 0.00112269, -0.00000116, 0.00000000],
++		[-6.27106901, -0.00111645, 0.00068450, 0.00112229, -0.00000116, 0.00000000],
++		[-6.27107170, -0.00111605, 0.00068426, 0.00112188, -0.00000116, 0.00000000],
++		[-6.27107439, -0.00111565, 0.00068401, 0.00112148, -0.00000116, 0.00000000],
++		[-6.27107707, -0.00111525, 0.00068376, 0.00112107, -0.00000116, 0.00000000],
++		[-6.27107974, -0.00111484, 0.00068352, 0.00112067, -0.00000116, 0.00000000],
++		[-6.27108241, -0.00111444, 0.00068327, 0.00112027, -0.00000116, 0.00000000],
++		[-6.27108507, -0.00111404, 0.00068302, 0.00111987, -0.00000116, 0.00000000],
++		[-6.27108772, -0.00111364, 0.00068278, 0.00111946, -0.00000116, 0.00000000],
++		[-6.27109036, -0.00111324, 0.00068253, 0.00111906, -0.00000116, 0.00000000],
++		[-6.27109300, -0.00111284, 0.00068229, 0.00111866, -0.00000116, 0.00000000],
++		[-6.27109562, -0.00111244, 0.00068204, 0.00111826, -0.00000116, 0.00000000],
++		[-6.27109825, -0.00111204, 0.00068180, 0.00111786, -0.00000116, 0.00000000],
++		[-6.27110086, -0.00111164, 0.00068155, 0.00111745, -0.00000116, 0.00000000],
++		[-6.27110347, -0.00111125, 0.00068131, 0.00111705, -0.00000116, 0.00000000],
++		[-6.27110606, -0.00111085, 0.00068106, 0.00111665, -0.00000116, 0.00000000],
++		[-6.27110866, -0.00111045, 0.00068082, 0.00111625, -0.00000116, 0.00000000],
++		[-6.27111124, -0.00111005, 0.00068058, 0.00111585, -0.00000116, 0.00000000],
++		[-6.27111382, -0.00110965, 0.00068033, 0.00111545, -0.00000116, 0.00000000],
++		[-6.27111639, -0.00110926, 0.00068009, 0.00111505, -0.00000116, 0.00000000],
++		[-6.27111895, -0.00110886, 0.00067985, 0.00111465, -0.00000116, 0.00000000],
++		[-6.27112151, -0.00110846, 0.00067960, 0.00111425, -0.00000116, 0.00000000],
++		[-6.27112405, -0.00110807, 0.00067936, 0.00111386, -0.00000116, 0.00000000],
++		[-6.27112660, -0.00110767, 0.00067912, 0.00111346, -0.00000116, 0.00000000],
++		[-6.27112913, -0.00110728, 0.00067887, 0.00111306, -0.00000116, 0.00000000],
++		[-6.27113166, -0.00110688, 0.00067863, 0.00111266, -0.00000116, 0.00000000],
++		[-6.27113418, -0.00110648, 0.00067839, 0.00111226, -0.00000116, 0.00000000],
++		[-6.27113669, -0.00110609, 0.00067815, 0.00111187, -0.00000116, 0.00000000],
++		[-6.27113920, -0.00110569, 0.00067790, 0.00111147, -0.00000116, 0.00000000],
++		[-6.27114170, -0.00110530, 0.00067766, 0.00111107, -0.00000116, 0.00000000],
++		[-6.27114419, -0.00110491, 0.00067742, 0.00111068, -0.00000116, 0.00000000],
++		[-6.27114668, -0.00110451, 0.00067718, 0.00111028, -0.00000116, 0.00000000],
++		[-6.27114915, -0.00110412, 0.00067694, 0.00110989, -0.00000116, 0.00000000],
++		[-6.27115163, -0.00110372, 0.00067670, 0.00110949, -0.00000116, 0.00000000],
++		[-6.27115409, -0.00110333, 0.00067646, 0.00110910, -0.00000116, 0.00000000],
++		[-6.27115655, -0.00110294, 0.00067621, 0.00110870, -0.00000116, 0.00000000],
++		[-6.27115900, -0.00110255, 0.00067597, 0.00110831, -0.00000116, 0.00000000],
++		[-6.27116145, -0.00110215, 0.00067573, 0.00110791, -0.00000116, 0.00000000],
++		[-6.27116389, -0.00110176, 0.00067549, 0.00110752, -0.00000116, 0.00000000],
++		[-6.27116632, -0.00110137, 0.00067525, 0.00110712, -0.00000116, 0.00000000],
++		[-6.27116874, -0.00110098, 0.00067501, 0.00110673, -0.00000116, 0.00000000],
++		[-6.27117116, -0.00110059, 0.00067477, 0.00110634, -0.00000115, 0.00000000],
++		[-6.27117357, -0.00110020, 0.00067453, 0.00110594, -0.00000115, 0.00000000],
++		[-6.27117598, -0.00109981, 0.00067429, 0.00110555, -0.00000115, 0.00000000],
++		[-6.27117838, -0.00109942, 0.00067405, 0.00110516, -0.00000115, 0.00000000],
++		[-6.27118077, -0.00109903, 0.00067381, 0.00110477, -0.00000115, 0.00000000],
++		[-6.27118315, -0.00109864, 0.00067358, 0.00110437, -0.00000115, 0.00000000],
++		[-6.27118553, -0.00109825, 0.00067334, 0.00110398, -0.00000115, 0.00000000],
++		[-6.27118791, -0.00109786, 0.00067310, 0.00110359, -0.00000115, 0.00000000],
++		[-6.27119027, -0.00109747, 0.00067286, 0.00110320, -0.00000115, 0.00000000],
++		[-6.27119263, -0.00109708, 0.00067262, 0.00110281, -0.00000115, 0.00000000],
++		[-6.27119499, -0.00109669, 0.00067238, 0.00110242, -0.00000115, 0.00000000],
++		[-6.27119733, -0.00109630, 0.00067214, 0.00110203, -0.00000115, 0.00000000],
++		[-6.27119968, -0.00109592, 0.00067191, 0.00110164, -0.00000115, 0.00000000],
++		[-6.27120201, -0.00109553, 0.00067167, 0.00110125, -0.00000115, 0.00000000],
++		[-6.27120434, -0.00109514, 0.00067143, 0.00110086, -0.00000115, 0.00000000],
++		[-6.27120666, -0.00109475, 0.00067119, 0.00110047, -0.00000115, 0.00000000],
++		[-6.27120898, -0.00109437, 0.00067096, 0.00110008, -0.00000115, 0.00000000],
++		[-6.27121129, -0.00109398, 0.00067072, 0.00109969, -0.00000115, 0.00000000],
++		[-6.27121359, -0.00109360, 0.00067048, 0.00109930, -0.00000115, 0.00000000],
++		[-6.27121589, -0.00109321, 0.00067025, 0.00109892, -0.00000115, 0.00000000],
++		[-6.27121818, -0.00109282, 0.00067001, 0.00109853, -0.00000115, 0.00000000],
++		[-6.27122046, -0.00109244, 0.00066977, 0.00109814, -0.00000115, 0.00000000],
++		[-6.27122274, -0.00109205, 0.00066954, 0.00109775, -0.00000115, 0.00000000],
++		[-6.27122501, -0.00109167, 0.00066930, 0.00109737, -0.00000115, 0.00000000],
++		[-6.27122728, -0.00109128, 0.00066907, 0.00109698, -0.00000115, 0.00000000],
++		[-6.27122954, -0.00109090, 0.00066883, 0.00109659, -0.00000115, 0.00000000],
++		[-6.27123179, -0.00109052, 0.00066859, 0.00109621, -0.00000115, 0.00000000],
++		[-6.27123404, -0.00109013, 0.00066836, 0.00109582, -0.00000115, 0.00000000],
++		[-6.27123629, -0.00108975, 0.00066812, 0.00109544, -0.00000115, 0.00000000],
++		[-6.27123852, -0.00108937, 0.00066789, 0.00109505, -0.00000115, 0.00000000],
++		[-6.27124075, -0.00108898, 0.00066765, 0.00109467, -0.00000115, 0.00000000],
++		[-6.27124298, -0.00108860, 0.00066742, 0.00109428, -0.00000115, 0.00000000],
++		[-6.27124520, -0.00108822, 0.00066718, 0.00109390, -0.00000115, 0.00000000],
++		[-6.27124741, -0.00108784, 0.00066695, 0.00109351, -0.00000115, 0.00000000],
++		[-6.27124962, -0.00108745, 0.00066672, 0.00109313, -0.00000115, 0.00000000],
++		[-6.27125182, -0.00108707, 0.00066648, 0.00109275, -0.00000115, 0.00000000],
++		[-6.27125401, -0.00108669, 0.00066625, 0.00109236, -0.00000115, 0.00000000],
++		[-6.27125620, -0.00108631, 0.00066601, 0.00109198, -0.00000115, 0.00000000],
++		[-6.27125839, -0.00108593, 0.00066578, 0.00109160, -0.00000115, 0.00000000],
++		[-6.27126057, -0.00108555, 0.00066555, 0.00109121, -0.00000115, 0.00000000],
++		[-6.27126274, -0.00108517, 0.00066531, 0.00109083, -0.00000115, 0.00000000],
++		[-6.27126490, -0.00108479, 0.00066508, 0.00109045, -0.00000115, 0.00000000],
++		[-6.27126707, -0.00108441, 0.00066485, 0.00109007, -0.00000115, 0.00000000],
++		[-6.27126922, -0.00108403, 0.00066461, 0.00108969, -0.00000115, 0.00000000],
++		[-6.27127137, -0.00108365, 0.00066438, 0.00108930, -0.00000115, 0.00000000],
++		[-6.27127351, -0.00108327, 0.00066415, 0.00108892, -0.00000115, 0.00000000],
++		[-6.27127565, -0.00108289, 0.00066392, 0.00108854, -0.00000115, 0.00000000],
++		[-6.27127779, -0.00108251, 0.00066369, 0.00108816, -0.00000115, 0.00000000],
++		[-6.27127991, -0.00108214, 0.00066345, 0.00108778, -0.00000115, 0.00000000],
++		[-6.27128204, -0.00108176, 0.00066322, 0.00108740, -0.00000115, 0.00000000],
++		[-6.27128415, -0.00108138, 0.00066299, 0.00108702, -0.00000115, 0.00000000],
++		[-6.27128626, -0.00108100, 0.00066276, 0.00108664, -0.00000115, 0.00000000],
++		[-6.27128837, -0.00108063, 0.00066253, 0.00108626, -0.00000115, 0.00000000],
++		[-6.27129047, -0.00108025, 0.00066230, 0.00108588, -0.00000115, 0.00000000],
++		[-6.27129256, -0.00107987, 0.00066206, 0.00108551, -0.00000115, 0.00000000],
++		[-6.27129465, -0.00107950, 0.00066183, 0.00108513, -0.00000115, 0.00000000],
++		[-6.27129674, -0.00107912, 0.00066160, 0.00108475, -0.00000115, 0.00000000],
++		[-6.27129881, -0.00107874, 0.00066137, 0.00108437, -0.00000115, 0.00000000],
++		[-6.27130089, -0.00107837, 0.00066114, 0.00108399, -0.00000115, 0.00000000],
++		[-6.27130295, -0.00107799, 0.00066091, 0.00108362, -0.00000115, 0.00000000],
++		[-6.27130502, -0.00107762, 0.00066068, 0.00108324, -0.00000115, 0.00000000],
++		[-6.27130707, -0.00107724, 0.00066045, 0.00108286, -0.00000115, 0.00000000],
++		[-6.27130913, -0.00107687, 0.00066022, 0.00108249, -0.00000115, 0.00000000],
++		[-6.27131117, -0.00107649, 0.00065999, 0.00108211, -0.00000115, 0.00000000],
++		[-6.27131321, -0.00107612, 0.00065976, 0.00108173, -0.00000115, 0.00000000],
++		[-6.27131525, -0.00107575, 0.00065953, 0.00108136, -0.00000115, 0.00000000],
++		[-6.27131728, -0.00107537, 0.00065931, 0.00108098, -0.00000115, 0.00000000],
++		[-6.27131930, -0.00107500, 0.00065908, 0.00108061, -0.00000115, 0.00000000],
++		[-6.27132133, -0.00107463, 0.00065885, 0.00108023, -0.00000115, 0.00000000],
++		[-6.27132334, -0.00107425, 0.00065862, 0.00107986, -0.00000115, 0.00000000],
++		[-6.27132535, -0.00107388, 0.00065839, 0.00107948, -0.00000115, 0.00000000],
++		[-6.27132736, -0.00107351, 0.00065816, 0.00107911, -0.00000115, 0.00000000],
++		[-6.27132936, -0.00107314, 0.00065793, 0.00107873, -0.00000115, 0.00000000],
++		[-6.27133135, -0.00107277, 0.00065771, 0.00107836, -0.00000115, 0.00000000],
++		[-6.27133334, -0.00107239, 0.00065748, 0.00107799, -0.00000115, 0.00000000],
++		[-6.27133532, -0.00107202, 0.00065725, 0.00107761, -0.00000115, 0.00000000],
++		[-6.27133730, -0.00107165, 0.00065702, 0.00107724, -0.00000115, 0.00000000],
++		[-6.27133928, -0.00107128, 0.00065680, 0.00107687, -0.00000115, 0.00000000],
++		[-6.27134125, -0.00107091, 0.00065657, 0.00107650, -0.00000115, 0.00000000],
++		[-6.27134321, -0.00107054, 0.00065634, 0.00107612, -0.00000115, 0.00000000],
++		[-6.27134517, -0.00107017, 0.00065611, 0.00107575, -0.00000115, 0.00000000],
++		[-6.27134713, -0.00106980, 0.00065589, 0.00107538, -0.00000115, 0.00000000],
++		[-6.27134908, -0.00106943, 0.00065566, 0.00107501, -0.00000115, 0.00000000],
++		[-6.27135102, -0.00106906, 0.00065543, 0.00107464, -0.00000115, 0.00000000],
++		[-6.27135296, -0.00106870, 0.00065521, 0.00107427, -0.00000115, 0.00000000],
++		[-6.27135490, -0.00106833, 0.00065498, 0.00107390, -0.00000115, 0.00000000],
++		[-6.27135683, -0.00106796, 0.00065476, 0.00107353, -0.00000115, 0.00000000],
++		[-6.27135875, -0.00106759, 0.00065453, 0.00107316, -0.00000115, 0.00000000],
++		[-6.27136067, -0.00106722, 0.00065430, 0.00107279, -0.00000115, 0.00000000],
++		[-6.27136259, -0.00106685, 0.00065408, 0.00107242, -0.00000115, 0.00000000],
++		[-6.27136450, -0.00106649, 0.00065385, 0.00107205, -0.00000115, 0.00000000],
++		[-6.27136641, -0.00106612, 0.00065363, 0.00107168, -0.00000115, 0.00000000],
++		[-6.27136831, -0.00106575, 0.00065340, 0.00107131, -0.00000115, 0.00000000],
++		[-6.27137021, -0.00106539, 0.00065318, 0.00107094, -0.00000115, 0.00000000],
++		[-6.27137210, -0.00106502, 0.00065295, 0.00107057, -0.00000115, 0.00000000],
++		[-6.27137399, -0.00106465, 0.00065273, 0.00107020, -0.00000115, 0.00000000],
++		[-6.27137587, -0.00106429, 0.00065250, 0.00106984, -0.00000115, 0.00000000],
++		[-6.27137775, -0.00106392, 0.00065228, 0.00106947, -0.00000115, 0.00000000],
++		[-6.27137962, -0.00106356, 0.00065206, 0.00106910, -0.00000115, 0.00000000],
++		[-6.27138149, -0.00106319, 0.00065183, 0.00106873, -0.00000115, 0.00000000],
++		[-6.27138335, -0.00106283, 0.00065161, 0.00106837, -0.00000115, 0.00000000],
++		[-6.27138521, -0.00106246, 0.00065139, 0.00106800, -0.00000115, 0.00000000],
++		[-6.27138707, -0.00106210, 0.00065116, 0.00106763, -0.00000115, 0.00000000],
++		[-6.27138892, -0.00106173, 0.00065094, 0.00106727, -0.00000115, 0.00000000],
++		[-6.27139077, -0.00106137, 0.00065072, 0.00106690, -0.00000115, 0.00000000],
++		[-6.27139261, -0.00106101, 0.00065049, 0.00106654, -0.00000115, 0.00000000],
++		[-6.27139445, -0.00106064, 0.00065027, 0.00106617, -0.00000115, 0.00000000],
++		[-6.27139628, -0.00106028, 0.00065005, 0.00106581, -0.00000115, 0.00000000],
++		[-6.27139811, -0.00105992, 0.00064982, 0.00106544, -0.00000115, 0.00000000],
++		[-6.27139993, -0.00105956, 0.00064960, 0.00106508, -0.00000115, 0.00000000],
++		[-6.27140175, -0.00105919, 0.00064938, 0.00106471, -0.00000115, 0.00000000],
++		[-6.27140356, -0.00105883, 0.00064916, 0.00106435, -0.00000115, 0.00000000],
++		[-6.27140537, -0.00105847, 0.00064893, 0.00106399, -0.00000115, 0.00000000],
++		[-6.27140718, -0.00105811, 0.00064871, 0.00106362, -0.00000115, 0.00000000],
++		[-6.27140898, -0.00105775, 0.00064849, 0.00106326, -0.00000115, 0.00000000],
++		[-6.27141078, -0.00105739, 0.00064827, 0.00106290, -0.00000115, 0.00000000],
++		[-6.27141257, -0.00105702, 0.00064805, 0.00106253, -0.00000115, 0.00000000],
++		[-6.27141436, -0.00105666, 0.00064783, 0.00106217, -0.00000115, 0.00000000],
++		[-6.27141614, -0.00105630, 0.00064761, 0.00106181, -0.00000115, 0.00000000],
++		[-6.27141792, -0.00105594, 0.00064739, 0.00106145, -0.00000115, 0.00000000],
++		[-6.27141970, -0.00105558, 0.00064716, 0.00106108, -0.00000115, 0.00000000],
++		[-6.27142147, -0.00105522, 0.00064694, 0.00106072, -0.00000115, 0.00000000],
++		[-6.27142324, -0.00105486, 0.00064672, 0.00106036, -0.00000115, 0.00000000],
++		[-6.27142500, -0.00105451, 0.00064650, 0.00106000, -0.00000115, 0.00000000],
++		[-6.27142676, -0.00105415, 0.00064628, 0.00105964, -0.00000115, 0.00000000],
++		[-6.27142851, -0.00105379, 0.00064606, 0.00105928, -0.00000115, 0.00000000],
++		[-6.27143026, -0.00105343, 0.00064584, 0.00105892, -0.00000115, 0.00000000],
++		[-6.27143201, -0.00105307, 0.00064562, 0.00105856, -0.00000115, 0.00000000],
++		[-6.27143375, -0.00105271, 0.00064540, 0.00105820, -0.00000115, 0.00000000],
++		[-6.27143549, -0.00105236, 0.00064518, 0.00105784, -0.00000115, 0.00000000],
++		[-6.27143722, -0.00105200, 0.00064496, 0.00105748, -0.00000115, 0.00000000],
++		[-6.27143895, -0.00105164, 0.00064475, 0.00105712, -0.00000115, 0.00000000],
++		[-6.27144068, -0.00105128, 0.00064453, 0.00105676, -0.00000115, 0.00000000],
++		[-6.27144240, -0.00105093, 0.00064431, 0.00105640, -0.00000115, 0.00000000],
++		[-6.27144412, -0.00105057, 0.00064409, 0.00105604, -0.00000115, 0.00000000],
++		[-6.27144583, -0.00105021, 0.00064387, 0.00105569, -0.00000115, 0.00000000],
++		[-6.27144754, -0.00104986, 0.00064365, 0.00105533, -0.00000115, 0.00000000],
++		[-6.27144924, -0.00104950, 0.00064343, 0.00105497, -0.00000115, 0.00000000],
++		[-6.27145094, -0.00104915, 0.00064322, 0.00105461, -0.00000115, 0.00000000],
++		[-6.27145264, -0.00104879, 0.00064300, 0.00105425, -0.00000115, 0.00000000],
++		[-6.27145433, -0.00104844, 0.00064278, 0.00105390, -0.00000115, 0.00000000],
++		[-6.27145602, -0.00104808, 0.00064256, 0.00105354, -0.00000115, 0.00000000],
++		[-6.27145771, -0.00104773, 0.00064234, 0.00105318, -0.00000115, 0.00000000],
++		[-6.27145939, -0.00104737, 0.00064213, 0.00105283, -0.00000115, 0.00000000],
++		[-6.27146107, -0.00104702, 0.00064191, 0.00105247, -0.00000115, 0.00000000],
++		[-6.27146274, -0.00104667, 0.00064169, 0.00105212, -0.00000115, 0.00000000],
++		[-6.27146441, -0.00104631, 0.00064148, 0.00105176, -0.00000115, 0.00000000],
++		[-6.27146607, -0.00104596, 0.00064126, 0.00105141, -0.00000115, 0.00000000],
++		[-6.27146774, -0.00104561, 0.00064104, 0.00105105, -0.00000115, 0.00000000],
++		[-6.27146939, -0.00104525, 0.00064083, 0.00105070, -0.00000115, 0.00000000],
++		[-6.27147105, -0.00104490, 0.00064061, 0.00105034, -0.00000115, 0.00000000],
++		[-6.27147270, -0.00104455, 0.00064039, 0.00104999, -0.00000115, 0.00000000],
++		[-6.27147434, -0.00104420, 0.00064018, 0.00104963, -0.00000115, 0.00000000],
++		[-6.27147599, -0.00104384, 0.00063996, 0.00104928, -0.00000115, 0.00000000],
++		[-6.27147762, -0.00104349, 0.00063975, 0.00104893, -0.00000115, 0.00000000],
++		[-6.27147926, -0.00104314, 0.00063953, 0.00104857, -0.00000115, 0.00000000],
++		[-6.27148089, -0.00104279, 0.00063931, 0.00104822, -0.00000115, 0.00000000],
++		[-6.27148252, -0.00104244, 0.00063910, 0.00104787, -0.00000115, 0.00000000],
++		[-6.27148414, -0.00104209, 0.00063888, 0.00104751, -0.00000115, 0.00000000],
++		[-6.27148576, -0.00104174, 0.00063867, 0.00104716, -0.00000115, 0.00000000],
++		[-6.27148738, -0.00104139, 0.00063845, 0.00104681, -0.00000115, 0.00000000],
++		[-6.27148899, -0.00104104, 0.00063824, 0.00104646, -0.00000115, 0.00000000],
++		[-6.27149060, -0.00104069, 0.00063802, 0.00104610, -0.00000115, 0.00000000],
++		[-6.27149220, -0.00104034, 0.00063781, 0.00104575, -0.00000115, 0.00000000],
++		[-6.27149380, -0.00103999, 0.00063760, 0.00104540, -0.00000115, 0.00000000],
++		[-6.27149540, -0.00103964, 0.00063738, 0.00104505, -0.00000115, 0.00000000],
++		[-6.27149699, -0.00103929, 0.00063717, 0.00104470, -0.00000115, 0.00000000],
++		[-6.27149859, -0.00103894, 0.00063695, 0.00104435, -0.00000115, 0.00000000],
++		[-6.27150017, -0.00103859, 0.00063674, 0.00104400, -0.00000115, 0.00000000],
++		[-6.27150175, -0.00103824, 0.00063653, 0.00104365, -0.00000115, 0.00000000],
++		[-6.27150333, -0.00103790, 0.00063631, 0.00104330, -0.00000115, 0.00000000],
++		[-6.27150491, -0.00103755, 0.00063610, 0.00104295, -0.00000115, 0.00000000],
++		[-6.27150648, -0.00103720, 0.00063589, 0.00104260, -0.00000115, 0.00000000],
++		[-6.27150805, -0.00103685, 0.00063567, 0.00104225, -0.00000115, 0.00000000],
++		[-6.27150962, -0.00103651, 0.00063546, 0.00104190, -0.00000115, 0.00000000],
++		[-6.27151118, -0.00103616, 0.00063525, 0.00104155, -0.00000115, 0.00000000],
++		[-6.27151274, -0.00103581, 0.00063503, 0.00104120, -0.00000115, 0.00000000],
++		[-6.27151429, -0.00103547, 0.00063482, 0.00104086, -0.00000115, 0.00000000],
++		[-6.27151584, -0.00103512, 0.00063461, 0.00104051, -0.00000115, 0.00000000],
++		[-6.27151739, -0.00103478, 0.00063440, 0.00104016, -0.00000115, 0.00000000],
++		[-6.27151893, -0.00103443, 0.00063419, 0.00103981, -0.00000115, 0.00000000],
++		[-6.27152048, -0.00103408, 0.00063397, 0.00103947, -0.00000115, 0.00000000],
++		[-6.27152201, -0.00103374, 0.00063376, 0.00103912, -0.00000115, 0.00000000],
++		[-6.27152355, -0.00103339, 0.00063355, 0.00103877, -0.00000115, 0.00000000],
++		[-6.27152508, -0.00103305, 0.00063334, 0.00103843, -0.00000115, 0.00000000],
++		[-6.27152660, -0.00103270, 0.00063313, 0.00103808, -0.00000115, 0.00000000],
++		[-6.27152813, -0.00103236, 0.00063292, 0.00103773, -0.00000115, 0.00000000],
++		[-6.27152965, -0.00103202, 0.00063271, 0.00103739, -0.00000115, 0.00000000],
++		[-6.27153117, -0.00103167, 0.00063249, 0.00103704, -0.00000115, 0.00000000],
++		[-6.27153268, -0.00103133, 0.00063228, 0.00103670, -0.00000115, 0.00000000],
++		[-6.27153419, -0.00103099, 0.00063207, 0.00103635, -0.00000115, 0.00000000],
++		[-6.27153570, -0.00103064, 0.00063186, 0.00103601, -0.00000115, 0.00000000],
++		[-6.27153720, -0.00103030, 0.00063165, 0.00103566, -0.00000115, 0.00000000],
++		[-6.27153870, -0.00102996, 0.00063144, 0.00103532, -0.00000115, 0.00000000],
++		[-6.27154020, -0.00102961, 0.00063123, 0.00103497, -0.00000115, 0.00000000],
++		[-6.27154169, -0.00102927, 0.00063102, 0.00103463, -0.00000115, 0.00000000],
++		[-6.27154318, -0.00102893, 0.00063081, 0.00103428, -0.00000115, 0.00000000],
++		[-6.27154467, -0.00102859, 0.00063060, 0.00103394, -0.00000115, 0.00000000],
++		[-6.27154615, -0.00102825, 0.00063039, 0.00103360, -0.00000115, 0.00000000],
++		[-6.27154763, -0.00102791, 0.00063018, 0.00103325, -0.00000115, 0.00000000],
++		[-6.27154911, -0.00102756, 0.00062997, 0.00103291, -0.00000115, 0.00000000],
++		[-6.27155059, -0.00102722, 0.00062976, 0.00103257, -0.00000115, 0.00000000],
++		[-6.27155206, -0.00102688, 0.00062956, 0.00103223, -0.00000115, 0.00000000],
++		[-6.27155352, -0.00102654, 0.00062935, 0.00103188, -0.00000115, 0.00000000],
++		[-6.27155499, -0.00102620, 0.00062914, 0.00103154, -0.00000115, 0.00000000],
++		[-6.27155645, -0.00102586, 0.00062893, 0.00103120, -0.00000115, 0.00000000],
++		[-6.27155791, -0.00102552, 0.00062872, 0.00103086, -0.00000115, 0.00000000],
++		[-6.27155936, -0.00102518, 0.00062851, 0.00103052, -0.00000115, 0.00000000],
++		[-6.27156082, -0.00102484, 0.00062830, 0.00103018, -0.00000115, 0.00000000],
++		[-6.27156226, -0.00102451, 0.00062810, 0.00102983, -0.00000115, 0.00000000],
++		[-6.27156371, -0.00102417, 0.00062789, 0.00102949, -0.00000115, 0.00000000],
++		[-6.27156515, -0.00102383, 0.00062768, 0.00102915, -0.00000115, 0.00000000],
++		[-6.27156659, -0.00102349, 0.00062747, 0.00102881, -0.00000115, 0.00000000],
++		[-6.27156803, -0.00102315, 0.00062727, 0.00102847, -0.00000115, 0.00000000],
++		[-6.27156946, -0.00102281, 0.00062706, 0.00102813, -0.00000115, 0.00000000],
++		[-6.27157089, -0.00102248, 0.00062685, 0.00102779, -0.00000115, 0.00000000],
++		[-6.27157232, -0.00102214, 0.00062664, 0.00102745, -0.00000115, 0.00000000],
++		[-6.27157374, -0.00102180, 0.00062644, 0.00102712, -0.00000115, 0.00000000],
++		[-6.27157517, -0.00102146, 0.00062623, 0.00102678, -0.00000115, 0.00000000],
++		[-6.27157658, -0.00102113, 0.00062602, 0.00102644, -0.00000115, 0.00000000],
++		[-6.27157800, -0.00102079, 0.00062582, 0.00102610, -0.00000115, 0.00000000],
++		[-6.27157941, -0.00102045, 0.00062561, 0.00102576, -0.00000115, 0.00000000],
++		[-6.27158082, -0.00102012, 0.00062540, 0.00102542, -0.00000115, 0.00000000],
++		[-6.27158223, -0.00101978, 0.00062520, 0.00102509, -0.00000115, 0.00000000],
++		[-6.27158363, -0.00101945, 0.00062499, 0.00102475, -0.00000115, 0.00000000],
++		[-6.27158503, -0.00101911, 0.00062479, 0.00102441, -0.00000115, 0.00000000],
++		[-6.27158643, -0.00101878, 0.00062458, 0.00102407, -0.00000115, 0.00000000],
++		[-6.27158782, -0.00101844, 0.00062438, 0.00102374, -0.00000115, 0.00000000],
++		[-6.27158921, -0.00101811, 0.00062417, 0.00102340, -0.00000115, 0.00000000],
++		[-6.27159060, -0.00101777, 0.00062396, 0.00102306, -0.00000115, 0.00000000],
++		[-6.27159199, -0.00101744, 0.00062376, 0.00102273, -0.00000115, 0.00000000],
++		[-6.27159337, -0.00101710, 0.00062355, 0.00102239, -0.00000115, 0.00000000],
++		[-6.27159475, -0.00101677, 0.00062335, 0.00102206, -0.00000115, 0.00000000],
++		[-6.27159613, -0.00101644, 0.00062314, 0.00102172, -0.00000115, 0.00000000],
++		[-6.27159750, -0.00101610, 0.00062294, 0.00102138, -0.00000115, 0.00000000],
++		[-6.27159887, -0.00101577, 0.00062274, 0.00102105, -0.00000115, 0.00000000],
++		[-6.27160024, -0.00101544, 0.00062253, 0.00102071, -0.00000115, 0.00000000],
++		[-6.27160160, -0.00101510, 0.00062233, 0.00102038, -0.00000115, 0.00000000],
++		[-6.27160297, -0.00101477, 0.00062212, 0.00102005, -0.00000115, 0.00000000],
++		[-6.27160433, -0.00101444, 0.00062192, 0.00101971, -0.00000115, 0.00000000],
++		[-6.27160568, -0.00101410, 0.00062171, 0.00101938, -0.00000115, 0.00000000],
++		[-6.27160704, -0.00101377, 0.00062151, 0.00101904, -0.00000115, 0.00000000],
++		[-6.27160839, -0.00101344, 0.00062131, 0.00101871, -0.00000115, 0.00000000],
++		[-6.27160974, -0.00101311, 0.00062110, 0.00101838, -0.00000115, 0.00000000],
++		[-6.27161108, -0.00101278, 0.00062090, 0.00101804, -0.00000115, 0.00000000],
++		[-6.27161243, -0.00101245, 0.00062070, 0.00101771, -0.00000115, 0.00000000],
++		[-6.27161377, -0.00101212, 0.00062049, 0.00101738, -0.00000115, 0.00000000],
++		[-6.27161511, -0.00101179, 0.00062029, 0.00101705, -0.00000115, 0.00000000],
++		[-6.27161644, -0.00101146, 0.00062009, 0.00101671, -0.00000115, 0.00000000],
++		[-6.27161777, -0.00101112, 0.00061989, 0.00101638, -0.00000115, 0.00000000],
++		[-6.27161910, -0.00101079, 0.00061968, 0.00101605, -0.00000115, 0.00000000],
++		[-6.27162043, -0.00101046, 0.00061948, 0.00101572, -0.00000115, 0.00000000],
++		[-6.27162175, -0.00101014, 0.00061928, 0.00101539, -0.00000115, 0.00000000],
++		[-6.27162307, -0.00100981, 0.00061908, 0.00101505, -0.00000115, 0.00000000],
++		[-6.27162439, -0.00100948, 0.00061887, 0.00101472, -0.00000115, 0.00000000],
++		[-6.27162571, -0.00100915, 0.00061867, 0.00101439, -0.00000115, 0.00000000],
++		[-6.27162702, -0.00100882, 0.00061847, 0.00101406, -0.00000115, 0.00000000],
++		[-6.27162833, -0.00100849, 0.00061827, 0.00101373, -0.00000115, 0.00000000],
++		[-6.27162964, -0.00100816, 0.00061807, 0.00101340, -0.00000115, 0.00000000],
++		[-6.27163095, -0.00100783, 0.00061787, 0.00101307, -0.00000115, 0.00000000],
++		[-6.27163225, -0.00100751, 0.00061767, 0.00101274, -0.00000115, 0.00000000],
++		[-6.27163355, -0.00100718, 0.00061746, 0.00101241, -0.00000115, 0.00000000],
++		[-6.27163485, -0.00100685, 0.00061726, 0.00101208, -0.00000115, 0.00000000],
++		[-6.27163614, -0.00100652, 0.00061706, 0.00101175, -0.00000115, 0.00000000],
++		[-6.27163743, -0.00100620, 0.00061686, 0.00101143, -0.00000115, 0.00000000],
++		[-6.27163872, -0.00100587, 0.00061666, 0.00101110, -0.00000115, 0.00000000],
++		[-6.27164001, -0.00100554, 0.00061646, 0.00101077, -0.00000115, 0.00000000],
++		[-6.27164130, -0.00100522, 0.00061626, 0.00101044, -0.00000115, 0.00000000],
++		[-6.27164258, -0.00100489, 0.00061606, 0.00101011, -0.00000115, 0.00000000],
++		[-6.27164386, -0.00100456, 0.00061586, 0.00100978, -0.00000115, 0.00000000],
++		[-6.27164513, -0.00100424, 0.00061566, 0.00100946, -0.00000115, 0.00000000],
++		[-6.27164641, -0.00100391, 0.00061546, 0.00100913, -0.00000114, 0.00000000],
++		[-6.27164768, -0.00100359, 0.00061526, 0.00100880, -0.00000114, 0.00000000],
++		[-6.27164895, -0.00100326, 0.00061506, 0.00100848, -0.00000114, 0.00000000],
++		[-6.27165022, -0.00100294, 0.00061486, 0.00100815, -0.00000114, 0.00000000],
++		[-6.27165148, -0.00100261, 0.00061466, 0.00100782, -0.00000114, 0.00000000],
++		[-6.27165274, -0.00100229, 0.00061446, 0.00100750, -0.00000114, 0.00000000],
++		[-6.27165400, -0.00100196, 0.00061427, 0.00100717, -0.00000114, 0.00000000],
++		[-6.27165526, -0.00100164, 0.00061407, 0.00100684, -0.00000114, 0.00000000],
++		[-6.27165651, -0.00100132, 0.00061387, 0.00100652, -0.00000114, 0.00000000],
++		[-6.27165777, -0.00100099, 0.00061367, 0.00100619, -0.00000114, 0.00000000],
++		[-6.27165902, -0.00100067, 0.00061347, 0.00100587, -0.00000114, 0.00000000],
++		[-6.27166026, -0.00100035, 0.00061327, 0.00100554, -0.00000114, 0.00000000],
++		[-6.27166151, -0.00100002, 0.00061307, 0.00100522, -0.00000114, 0.00000000],
++		[-6.27166275, -0.00099970, 0.00061288, 0.00100489, -0.00000114, 0.00000000],
++		[-6.27166399, -0.00099938, 0.00061268, 0.00100457, -0.00000114, 0.00000000],
++		[-6.27166523, -0.00099905, 0.00061248, 0.00100424, -0.00000114, 0.00000000],
++		[-6.27166646, -0.00099873, 0.00061228, 0.00100392, -0.00000114, 0.00000000],
++		[-6.27166770, -0.00099841, 0.00061208, 0.00100360, -0.00000114, 0.00000000],
++		[-6.27166893, -0.00099809, 0.00061189, 0.00100327, -0.00000114, 0.00000000],
++		[-6.27167015, -0.00099777, 0.00061169, 0.00100295, -0.00000114, 0.00000000],
++		[-6.27167138, -0.00099745, 0.00061149, 0.00100263, -0.00000114, 0.00000000],
++		[-6.27167260, -0.00099712, 0.00061130, 0.00100230, -0.00000114, 0.00000000],
++		[-6.27167382, -0.00099680, 0.00061110, 0.00100198, -0.00000114, 0.00000000],
++		[-6.27167504, -0.00099648, 0.00061090, 0.00100166, -0.00000114, 0.00000000],
++		[-6.27167626, -0.00099616, 0.00061070, 0.00100134, -0.00000114, 0.00000000],
++		[-6.27167747, -0.00099584, 0.00061051, 0.00100101, -0.00000114, 0.00000000],
++		[-6.27167868, -0.00099552, 0.00061031, 0.00100069, -0.00000114, 0.00000000],
++		[-6.27167989, -0.00099520, 0.00061012, 0.00100037, -0.00000114, 0.00000000],
++		[-6.27168110, -0.00099488, 0.00060992, 0.00100005, -0.00000114, 0.00000000],
++		[-6.27168231, -0.00099456, 0.00060972, 0.00099973, -0.00000114, 0.00000000],
++		[-6.27168351, -0.00099424, 0.00060953, 0.00099941, -0.00000114, 0.00000000],
++		[-6.27168471, -0.00099392, 0.00060933, 0.00099909, -0.00000114, 0.00000000],
++		[-6.27168591, -0.00099360, 0.00060914, 0.00099877, -0.00000114, 0.00000000],
++		[-6.27168710, -0.00099329, 0.00060894, 0.00099844, -0.00000114, 0.00000000],
++		[-6.27168829, -0.00099297, 0.00060874, 0.00099812, -0.00000114, 0.00000000],
++		[-6.27168949, -0.00099265, 0.00060855, 0.00099780, -0.00000114, 0.00000000],
++		[-6.27169067, -0.00099233, 0.00060835, 0.00099748, -0.00000114, 0.00000000],
++		[-6.27169186, -0.00099201, 0.00060816, 0.00099716, -0.00000114, 0.00000000],
++		[-6.27169305, -0.00099170, 0.00060796, 0.00099685, -0.00000114, 0.00000000],
++		[-6.27169423, -0.00099138, 0.00060777, 0.00099653, -0.00000114, 0.00000000],
++		[-6.27169541, -0.00099106, 0.00060757, 0.00099621, -0.00000114, 0.00000000],
++		[-6.27169659, -0.00099074, 0.00060738, 0.00099589, -0.00000114, 0.00000000],
++		[-6.27169776, -0.00099043, 0.00060719, 0.00099557, -0.00000114, 0.00000000],
++		[-6.27169893, -0.00099011, 0.00060699, 0.00099525, -0.00000114, 0.00000000],
++		[-6.27170011, -0.00098979, 0.00060680, 0.00099493, -0.00000114, 0.00000000],
++		[-6.27170128, -0.00098948, 0.00060660, 0.00099461, -0.00000114, 0.00000000],
++		[-6.27170244, -0.00098916, 0.00060641, 0.00099430, -0.00000114, 0.00000000],
++		[-6.27170361, -0.00098884, 0.00060622, 0.00099398, -0.00000114, 0.00000000],
++		[-6.27170477, -0.00098853, 0.00060602, 0.00099366, -0.00000114, 0.00000000],
++		[-6.27170593, -0.00098821, 0.00060583, 0.00099334, -0.00000114, 0.00000000],
++		[-6.27170709, -0.00098790, 0.00060563, 0.00099303, -0.00000114, 0.00000000],
++		[-6.27170825, -0.00098758, 0.00060544, 0.00099271, -0.00000114, 0.00000000],
++		[-6.27170940, -0.00098727, 0.00060525, 0.00099239, -0.00000114, 0.00000000],
++		[-6.27171055, -0.00098695, 0.00060505, 0.00099208, -0.00000114, 0.00000000],
++		[-6.27171170, -0.00098664, 0.00060486, 0.00099176, -0.00000114, 0.00000000],
++		[-6.27171285, -0.00098633, 0.00060467, 0.00099145, -0.00000114, 0.00000000],
++		[-6.27171399, -0.00098601, 0.00060448, 0.00099113, -0.00000114, 0.00000000],
++		[-6.27171514, -0.00098570, 0.00060428, 0.00099081, -0.00000114, 0.00000000],
++		[-6.27171628, -0.00098538, 0.00060409, 0.00099050, -0.00000114, 0.00000000],
++		[-6.27171742, -0.00098507, 0.00060390, 0.00099018, -0.00000114, 0.00000000],
++		[-6.27171856, -0.00098476, 0.00060371, 0.00098987, -0.00000114, 0.00000000],
++		[-6.27171969, -0.00098444, 0.00060351, 0.00098955, -0.00000114, 0.00000000],
++		[-6.27172082, -0.00098413, 0.00060332, 0.00098924, -0.00000114, 0.00000000],
++		[-6.27172196, -0.00098382, 0.00060313, 0.00098893, -0.00000114, 0.00000000],
++		[-6.27172309, -0.00098351, 0.00060294, 0.00098861, -0.00000114, 0.00000000],
++		[-6.27172421, -0.00098319, 0.00060275, 0.00098830, -0.00000114, 0.00000000],
++		[-6.27172534, -0.00098288, 0.00060256, 0.00098798, -0.00000114, 0.00000000],
++		[-6.27172646, -0.00098257, 0.00060236, 0.00098767, -0.00000114, 0.00000000],
++		[-6.27172758, -0.00098226, 0.00060217, 0.00098736, -0.00000114, 0.00000000],
++		[-6.27172870, -0.00098195, 0.00060198, 0.00098704, -0.00000114, 0.00000000],
++		[-6.27172982, -0.00098163, 0.00060179, 0.00098673, -0.00000114, 0.00000000],
++		[-6.27173093, -0.00098132, 0.00060160, 0.00098642, -0.00000114, 0.00000000],
++		[-6.27173205, -0.00098101, 0.00060141, 0.00098610, -0.00000114, 0.00000000],
++		[-6.27173316, -0.00098070, 0.00060122, 0.00098579, -0.00000114, 0.00000000],
++		[-6.27173427, -0.00098039, 0.00060103, 0.00098548, -0.00000114, 0.00000000],
++		[-6.27173537, -0.00098008, 0.00060084, 0.00098517, -0.00000114, 0.00000000],
++		[-6.27173648, -0.00097977, 0.00060065, 0.00098486, -0.00000114, 0.00000000],
++		[-6.27173758, -0.00097946, 0.00060046, 0.00098454, -0.00000114, 0.00000000],
++		[-6.27173868, -0.00097915, 0.00060027, 0.00098423, -0.00000114, 0.00000000],
++		[-6.27173978, -0.00097884, 0.00060008, 0.00098392, -0.00000114, 0.00000000],
++		[-6.27174088, -0.00097853, 0.00059989, 0.00098361, -0.00000114, 0.00000000],
++		[-6.27174198, -0.00097822, 0.00059970, 0.00098330, -0.00000114, 0.00000000],
++		[-6.27174307, -0.00097791, 0.00059951, 0.00098299, -0.00000114, 0.00000000],
++		[-6.27174416, -0.00097761, 0.00059932, 0.00098268, -0.00000114, 0.00000000],
++		[-6.27174525, -0.00097730, 0.00059913, 0.00098237, -0.00000114, 0.00000000],
++		[-6.27174634, -0.00097699, 0.00059894, 0.00098206, -0.00000114, 0.00000000],
++		[-6.27174743, -0.00097668, 0.00059875, 0.00098175, -0.00000114, 0.00000000],
++		[-6.27174851, -0.00097637, 0.00059856, 0.00098144, -0.00000114, 0.00000000],
++		[-6.27174959, -0.00097606, 0.00059837, 0.00098113, -0.00000114, 0.00000000],
++		[-6.27175067, -0.00097576, 0.00059818, 0.00098082, -0.00000114, 0.00000000],
++		[-6.27175175, -0.00097545, 0.00059800, 0.00098051, -0.00000114, 0.00000000],
++		[-6.27175283, -0.00097514, 0.00059781, 0.00098020, -0.00000114, 0.00000000],
++		[-6.27175390, -0.00097484, 0.00059762, 0.00097989, -0.00000114, 0.00000000],
++		[-6.27175497, -0.00097453, 0.00059743, 0.00097958, -0.00000114, 0.00000000],
++		[-6.27175605, -0.00097422, 0.00059724, 0.00097928, -0.00000114, 0.00000000],
++		[-6.27175712, -0.00097392, 0.00059705, 0.00097897, -0.00000114, 0.00000000],
++		[-6.27175818, -0.00097361, 0.00059687, 0.00097866, -0.00000114, 0.00000000],
++		[-6.27175925, -0.00097330, 0.00059668, 0.00097835, -0.00000114, 0.00000000],
++		[-6.27176031, -0.00097300, 0.00059649, 0.00097805, -0.00000114, 0.00000000],
++		[-6.27176137, -0.00097269, 0.00059630, 0.00097774, -0.00000114, 0.00000000],
++		[-6.27176243, -0.00097239, 0.00059612, 0.00097743, -0.00000114, 0.00000000],
++		[-6.27176349, -0.00097208, 0.00059593, 0.00097712, -0.00000114, 0.00000000],
++		[-6.27176455, -0.00097178, 0.00059574, 0.00097682, -0.00000114, 0.00000000],
++		[-6.27176560, -0.00097147, 0.00059555, 0.00097651, -0.00000114, 0.00000000],
++		[-6.27176666, -0.00097117, 0.00059537, 0.00097620, -0.00000114, 0.00000000],
++		[-6.27176771, -0.00097086, 0.00059518, 0.00097590, -0.00000114, 0.00000000],
++		[-6.27176876, -0.00097056, 0.00059499, 0.00097559, -0.00000114, 0.00000000],
++		[-6.27176980, -0.00097025, 0.00059481, 0.00097529, -0.00000114, 0.00000000],
++		[-6.27177085, -0.00096995, 0.00059462, 0.00097498, -0.00000114, 0.00000000],
++		[-6.27177189, -0.00096965, 0.00059443, 0.00097468, -0.00000114, 0.00000000],
++		[-6.27177294, -0.00096934, 0.00059425, 0.00097437, -0.00000114, 0.00000000],
++		[-6.27177398, -0.00096904, 0.00059406, 0.00097407, -0.00000114, 0.00000000],
++		[-6.27177502, -0.00096874, 0.00059388, 0.00097376, -0.00000114, 0.00000000],
++		[-6.27177605, -0.00096843, 0.00059369, 0.00097346, -0.00000114, 0.00000000],
++		[-6.27177709, -0.00096813, 0.00059350, 0.00097315, -0.00000114, 0.00000000],
++		[-6.27177812, -0.00096783, 0.00059332, 0.00097285, -0.00000114, 0.00000000],
++		[-6.27177915, -0.00096752, 0.00059313, 0.00097254, -0.00000114, 0.00000000],
++		[-6.27178018, -0.00096722, 0.00059295, 0.00097224, -0.00000114, 0.00000000],
++		[-6.27178121, -0.00096692, 0.00059276, 0.00097194, -0.00000114, 0.00000000],
++		[-6.27178224, -0.00096662, 0.00059258, 0.00097163, -0.00000114, 0.00000000],
++		[-6.27178326, -0.00096632, 0.00059239, 0.00097133, -0.00000114, 0.00000000],
++		[-6.27178429, -0.00096602, 0.00059221, 0.00097103, -0.00000114, 0.00000000],
++		[-6.27178531, -0.00096571, 0.00059202, 0.00097072, -0.00000114, 0.00000000],
++		[-6.27178633, -0.00096541, 0.00059184, 0.00097042, -0.00000114, 0.00000000],
++		[-6.27178735, -0.00096511, 0.00059165, 0.00097012, -0.00000114, 0.00000000],
++		[-6.27178836, -0.00096481, 0.00059147, 0.00096981, -0.00000114, 0.00000000],
++		[-6.27178938, -0.00096451, 0.00059128, 0.00096951, -0.00000114, 0.00000000],
++		[-6.27179039, -0.00096421, 0.00059110, 0.00096921, -0.00000114, 0.00000000],
++		[-6.27179140, -0.00096391, 0.00059091, 0.00096891, -0.00000114, 0.00000000],
++		[-6.27179242, -0.00096361, 0.00059073, 0.00096861, -0.00000114, 0.00000000],
++		[-6.27179342, -0.00096331, 0.00059055, 0.00096831, -0.00000114, 0.00000000],
++		[-6.27179443, -0.00096301, 0.00059036, 0.00096800, -0.00000114, 0.00000000],
++		[-6.27179544, -0.00096271, 0.00059018, 0.00096770, -0.00000114, 0.00000000],
++		[-6.27179644, -0.00096241, 0.00058999, 0.00096740, -0.00000114, 0.00000000],
++		[-6.27179744, -0.00096211, 0.00058981, 0.00096710, -0.00000114, 0.00000000],
++		[-6.27179844, -0.00096181, 0.00058963, 0.00096680, -0.00000114, 0.00000000],
++		[-6.27179944, -0.00096152, 0.00058944, 0.00096650, -0.00000114, 0.00000000],
++		[-6.27180044, -0.00096122, 0.00058926, 0.00096620, -0.00000114, 0.00000000],
++		[-6.27180143, -0.00096092, 0.00058908, 0.00096590, -0.00000114, 0.00000000],
++		[-6.27180243, -0.00096062, 0.00058890, 0.00096560, -0.00000114, 0.00000000],
++		[-6.27180342, -0.00096032, 0.00058871, 0.00096530, -0.00000114, 0.00000000],
++		[-6.27180441, -0.00096002, 0.00058853, 0.00096500, -0.00000114, 0.00000000],
++		[-6.27180540, -0.00095973, 0.00058835, 0.00096470, -0.00000114, 0.00000000],
++		[-6.27180639, -0.00095943, 0.00058816, 0.00096440, -0.00000114, 0.00000000],
++		[-6.27180737, -0.00095913, 0.00058798, 0.00096410, -0.00000114, 0.00000000],
++		[-6.27180836, -0.00095884, 0.00058780, 0.00096381, -0.00000114, 0.00000000],
++		[-6.27180934, -0.00095854, 0.00058762, 0.00096351, -0.00000114, 0.00000000],
++		[-6.27181032, -0.00095824, 0.00058744, 0.00096321, -0.00000114, 0.00000000],
++		[-6.27181130, -0.00095795, 0.00058725, 0.00096291, -0.00000114, 0.00000000],
++		[-6.27181228, -0.00095765, 0.00058707, 0.00096261, -0.00000114, 0.00000000],
++		[-6.27181325, -0.00095735, 0.00058689, 0.00096232, -0.00000114, 0.00000000],
++		[-6.27181423, -0.00095706, 0.00058671, 0.00096202, -0.00000114, 0.00000000],
++		[-6.27181520, -0.00095676, 0.00058653, 0.00096172, -0.00000114, 0.00000000],
++		[-6.27181618, -0.00095647, 0.00058635, 0.00096142, -0.00000114, 0.00000000],
++		[-6.27181715, -0.00095617, 0.00058616, 0.00096113, -0.00000114, 0.00000000],
++		[-6.27181811, -0.00095588, 0.00058598, 0.00096083, -0.00000114, 0.00000000],
++		[-6.27181908, -0.00095558, 0.00058580, 0.00096053, -0.00000114, 0.00000000],
++		[-6.27182005, -0.00095529, 0.00058562, 0.00096024, -0.00000114, 0.00000000],
++		[-6.27182101, -0.00095499, 0.00058544, 0.00095994, -0.00000114, 0.00000000],
++		[-6.27182198, -0.00095470, 0.00058526, 0.00095964, -0.00000114, 0.00000000],
++		[-6.27182294, -0.00095440, 0.00058508, 0.00095935, -0.00000114, 0.00000000],
++		[-6.27182390, -0.00095411, 0.00058490, 0.00095905, -0.00000114, 0.00000000],
++		[-6.27182486, -0.00095381, 0.00058472, 0.00095876, -0.00000114, 0.00000000],
++		[-6.27182581, -0.00095352, 0.00058454, 0.00095846, -0.00000114, 0.00000000],
++		[-6.27182677, -0.00095323, 0.00058436, 0.00095817, -0.00000114, 0.00000000],
++		[-6.27182772, -0.00095293, 0.00058418, 0.00095787, -0.00000114, 0.00000000],
++		[-6.27182867, -0.00095264, 0.00058400, 0.00095758, -0.00000114, 0.00000000],
++		[-6.27182963, -0.00095235, 0.00058382, 0.00095728, -0.00000114, 0.00000000],
++		[-6.27183058, -0.00095205, 0.00058364, 0.00095699, -0.00000114, 0.00000000],
++		[-6.27183152, -0.00095176, 0.00058346, 0.00095669, -0.00000114, 0.00000000],
++		[-6.27183247, -0.00095147, 0.00058328, 0.00095640, -0.00000114, 0.00000000],
++		[-6.27183342, -0.00095118, 0.00058310, 0.00095611, -0.00000114, 0.00000000],
++		[-6.27183436, -0.00095088, 0.00058292, 0.00095581, -0.00000114, 0.00000000],
++		[-6.27183530, -0.00095059, 0.00058274, 0.00095552, -0.00000114, 0.00000000],
++		[-6.27183624, -0.00095030, 0.00058256, 0.00095523, -0.00000114, 0.00000000],
++		[-6.27183718, -0.00095001, 0.00058238, 0.00095493, -0.00000114, 0.00000000],
++		[-6.27183812, -0.00094972, 0.00058221, 0.00095464, -0.00000114, 0.00000000],
++		[-6.27183906, -0.00094943, 0.00058203, 0.00095435, -0.00000114, 0.00000000],
++		[-6.27183999, -0.00094914, 0.00058185, 0.00095405, -0.00000114, 0.00000000],
++		[-6.27184093, -0.00094884, 0.00058167, 0.00095376, -0.00000114, 0.00000000],
++		[-6.27184186, -0.00094855, 0.00058149, 0.00095347, -0.00000114, 0.00000000],
++		[-6.27184279, -0.00094826, 0.00058131, 0.00095318, -0.00000114, 0.00000000],
++		[-6.27184372, -0.00094797, 0.00058113, 0.00095288, -0.00000114, 0.00000000],
++		[-6.27184465, -0.00094768, 0.00058096, 0.00095259, -0.00000114, 0.00000000],
++		[-6.27184558, -0.00094739, 0.00058078, 0.00095230, -0.00000114, 0.00000000],
++		[-6.27184650, -0.00094710, 0.00058060, 0.00095201, -0.00000114, 0.00000000],
++		[-6.27184743, -0.00094681, 0.00058042, 0.00095172, -0.00000114, 0.00000000],
++		[-6.27184835, -0.00094652, 0.00058025, 0.00095143, -0.00000114, 0.00000000],
++		[-6.27184927, -0.00094623, 0.00058007, 0.00095114, -0.00000114, 0.00000000],
++		[-6.27185019, -0.00094595, 0.00057989, 0.00095085, -0.00000114, 0.00000000],
++		[-6.27185111, -0.00094566, 0.00057971, 0.00095056, -0.00000114, 0.00000000],
++		[-6.27185203, -0.00094537, 0.00057954, 0.00095027, -0.00000114, 0.00000000],
++		[-6.27185294, -0.00094508, 0.00057936, 0.00094998, -0.00000114, 0.00000000],
++		[-6.27185386, -0.00094479, 0.00057918, 0.00094969, -0.00000114, 0.00000000],
++		[-6.27185477, -0.00094450, 0.00057901, 0.00094940, -0.00000114, 0.00000000],
++		[-6.27185568, -0.00094421, 0.00057883, 0.00094911, -0.00000114, 0.00000000],
++		[-6.27185659, -0.00094393, 0.00057865, 0.00094882, -0.00000114, 0.00000000],
++		[-6.27185750, -0.00094364, 0.00057848, 0.00094853, -0.00000114, 0.00000000],
++		[-6.27185841, -0.00094335, 0.00057830, 0.00094824, -0.00000114, 0.00000000],
++		[-6.27185932, -0.00094306, 0.00057812, 0.00094795, -0.00000114, 0.00000000],
++		[-6.27186022, -0.00094278, 0.00057795, 0.00094766, -0.00000114, 0.00000000],
++		[-6.27186113, -0.00094249, 0.00057777, 0.00094737, -0.00000114, 0.00000000],
++		[-6.27186203, -0.00094220, 0.00057759, 0.00094708, -0.00000114, 0.00000000],
++		[-6.27186293, -0.00094192, 0.00057742, 0.00094680, -0.00000114, 0.00000000],
++		[-6.27186383, -0.00094163, 0.00057724, 0.00094651, -0.00000114, 0.00000000],
++		[-6.27186473, -0.00094134, 0.00057707, 0.00094622, -0.00000114, 0.00000000],
++		[-6.27186563, -0.00094106, 0.00057689, 0.00094593, -0.00000114, 0.00000000],
++		[-6.27186652, -0.00094077, 0.00057672, 0.00094564, -0.00000114, 0.00000000],
++		[-6.27186742, -0.00094049, 0.00057654, 0.00094536, -0.00000114, 0.00000000],
++		[-6.27186831, -0.00094020, 0.00057636, 0.00094507, -0.00000114, 0.00000000],
++		[-6.27186920, -0.00093991, 0.00057619, 0.00094478, -0.00000114, 0.00000000],
++		[-6.27187010, -0.00093963, 0.00057601, 0.00094450, -0.00000114, 0.00000000],
++		[-6.27187098, -0.00093934, 0.00057584, 0.00094421, -0.00000114, 0.00000000],
++		[-6.27187187, -0.00093906, 0.00057567, 0.00094392, -0.00000114, 0.00000000],
++		[-6.27187276, -0.00093877, 0.00057549, 0.00094364, -0.00000114, 0.00000000],
++		[-6.27187365, -0.00093849, 0.00057532, 0.00094335, -0.00000114, 0.00000000],
++		[-6.27187453, -0.00093821, 0.00057514, 0.00094306, -0.00000114, 0.00000000],
++		[-6.27187541, -0.00093792, 0.00057497, 0.00094278, -0.00000114, 0.00000000],
++		[-6.27187630, -0.00093764, 0.00057479, 0.00094249, -0.00000114, 0.00000000],
++		[-6.27187718, -0.00093735, 0.00057462, 0.00094221, -0.00000114, 0.00000000],
++		[-6.27187806, -0.00093707, 0.00057444, 0.00094192, -0.00000114, 0.00000000],
++		[-6.27187894, -0.00093679, 0.00057427, 0.00094164, -0.00000114, 0.00000000],
++		[-6.27187981, -0.00093650, 0.00057410, 0.00094135, -0.00000114, 0.00000000],
++		[-6.27188069, -0.00093622, 0.00057392, 0.00094107, -0.00000114, 0.00000000],
++		[-6.27188156, -0.00093594, 0.00057375, 0.00094078, -0.00000114, 0.00000000],
++		[-6.27188244, -0.00093565, 0.00057358, 0.00094050, -0.00000114, 0.00000000],
++		[-6.27188331, -0.00093537, 0.00057340, 0.00094021, -0.00000114, 0.00000000],
++		[-6.27188418, -0.00093509, 0.00057323, 0.00093993, -0.00000114, 0.00000000],
++		[-6.27188505, -0.00093481, 0.00057306, 0.00093965, -0.00000114, 0.00000000],
++		[-6.27188592, -0.00093452, 0.00057288, 0.00093936, -0.00000114, 0.00000000],
++		[-6.27188679, -0.00093424, 0.00057271, 0.00093908, -0.00000114, 0.00000000],
++		[-6.27188765, -0.00093396, 0.00057254, 0.00093880, -0.00000114, 0.00000000],
++		[-6.27188852, -0.00093368, 0.00057236, 0.00093851, -0.00000114, 0.00000000],
++		[-6.27188938, -0.00093340, 0.00057219, 0.00093823, -0.00000114, 0.00000000],
++		[-6.27189025, -0.00093312, 0.00057202, 0.00093795, -0.00000114, 0.00000000],
++		[-6.27189111, -0.00093283, 0.00057185, 0.00093766, -0.00000114, 0.00000000],
++		[-6.27189197, -0.00093255, 0.00057167, 0.00093738, -0.00000114, 0.00000000],
++		[-6.27189283, -0.00093227, 0.00057150, 0.00093710, -0.00000114, 0.00000000],
++		[-6.27189369, -0.00093199, 0.00057133, 0.00093682, -0.00000114, 0.00000000],
++		[-6.27189454, -0.00093171, 0.00057116, 0.00093654, -0.00000114, 0.00000000],
++		[-6.27189540, -0.00093143, 0.00057098, 0.00093625, -0.00000114, 0.00000000],
++		[-6.27189625, -0.00093115, 0.00057081, 0.00093597, -0.00000114, 0.00000000],
++		[-6.27189711, -0.00093087, 0.00057064, 0.00093569, -0.00000114, 0.00000000],
++		[-6.27189796, -0.00093059, 0.00057047, 0.00093541, -0.00000114, 0.00000000],
++		[-6.27189881, -0.00093031, 0.00057030, 0.00093513, -0.00000114, 0.00000000],
++		[-6.27189966, -0.00093003, 0.00057013, 0.00093485, -0.00000114, 0.00000000],
++		[-6.27190051, -0.00092975, 0.00056995, 0.00093457, -0.00000114, 0.00000000],
++		[-6.27190136, -0.00092947, 0.00056978, 0.00093429, -0.00000114, 0.00000000],
++		[-6.27190220, -0.00092919, 0.00056961, 0.00093401, -0.00000114, 0.00000000],
++		[-6.27190305, -0.00092892, 0.00056944, 0.00093372, -0.00000114, 0.00000000],
++		[-6.27190389, -0.00092864, 0.00056927, 0.00093344, -0.00000114, 0.00000000],
++		[-6.27190474, -0.00092836, 0.00056910, 0.00093316, -0.00000114, 0.00000000],
++		[-6.27190558, -0.00092808, 0.00056893, 0.00093288, -0.00000114, 0.00000000],
++		[-6.27190642, -0.00092780, 0.00056876, 0.00093261, -0.00000114, 0.00000000],
++		[-6.27190726, -0.00092752, 0.00056859, 0.00093233, -0.00000114, 0.00000000],
++		[-6.27190810, -0.00092725, 0.00056842, 0.00093205, -0.00000114, 0.00000000],
++		[-6.27190893, -0.00092697, 0.00056825, 0.00093177, -0.00000114, 0.00000000],
++		[-6.27190977, -0.00092669, 0.00056808, 0.00093149, -0.00000114, 0.00000000],
++		[-6.27191061, -0.00092641, 0.00056791, 0.00093121, -0.00000114, 0.00000000],
++		[-6.27191144, -0.00092614, 0.00056774, 0.00093093, -0.00000114, 0.00000000],
++		[-6.27191227, -0.00092586, 0.00056757, 0.00093065, -0.00000114, 0.00000000],
++		[-6.27191311, -0.00092558, 0.00056740, 0.00093037, -0.00000114, 0.00000000],
++		[-6.27191394, -0.00092531, 0.00056723, 0.00093010, -0.00000114, 0.00000000],
++		[-6.27191477, -0.00092503, 0.00056706, 0.00092982, -0.00000114, 0.00000000],
++		[-6.27191559, -0.00092475, 0.00056689, 0.00092954, -0.00000114, 0.00000000],
++		[-6.27191642, -0.00092448, 0.00056672, 0.00092926, -0.00000114, 0.00000000],
++		[-6.27191725, -0.00092420, 0.00056655, 0.00092899, -0.00000114, 0.00000000],
++		[-6.27191807, -0.00092393, 0.00056638, 0.00092871, -0.00000114, 0.00000000],
++		[-6.27191890, -0.00092365, 0.00056621, 0.00092843, -0.00000114, 0.00000000],
++		[-6.27191972, -0.00092338, 0.00056604, 0.00092815, -0.00000114, 0.00000000],
++		[-6.27192054, -0.00092310, 0.00056587, 0.00092788, -0.00000114, 0.00000000],
++		[-6.27192136, -0.00092282, 0.00056570, 0.00092760, -0.00000114, 0.00000000],
++		[-6.27192218, -0.00092255, 0.00056553, 0.00092732, -0.00000114, 0.00000000],
++		[-6.27192300, -0.00092227, 0.00056537, 0.00092705, -0.00000114, 0.00000000],
++		[-6.27192382, -0.00092200, 0.00056520, 0.00092677, -0.00000114, 0.00000000],
++		[-6.27192464, -0.00092173, 0.00056503, 0.00092650, -0.00000114, 0.00000000],
++		[-6.27192545, -0.00092145, 0.00056486, 0.00092622, -0.00000114, 0.00000000],
++		[-6.27192627, -0.00092118, 0.00056469, 0.00092594, -0.00000114, 0.00000000],
++		[-6.27192708, -0.00092090, 0.00056452, 0.00092567, -0.00000114, 0.00000000],
++		[-6.27192790, -0.00092063, 0.00056436, 0.00092539, -0.00000114, 0.00000000],
++		[-6.27192871, -0.00092036, 0.00056419, 0.00092512, -0.00000114, 0.00000000],
++		[-6.27192952, -0.00092008, 0.00056402, 0.00092484, -0.00000114, 0.00000000],
++		[-6.27193033, -0.00091981, 0.00056385, 0.00092457, -0.00000114, 0.00000000],
++		[-6.27193114, -0.00091954, 0.00056368, 0.00092429, -0.00000114, 0.00000000],
++		[-6.27193194, -0.00091926, 0.00056352, 0.00092402, -0.00000114, 0.00000000],
++		[-6.27193275, -0.00091899, 0.00056335, 0.00092374, -0.00000114, 0.00000000],
++		[-6.27193356, -0.00091872, 0.00056318, 0.00092347, -0.00000114, 0.00000000],
++		[-6.27193436, -0.00091844, 0.00056301, 0.00092320, -0.00000114, 0.00000000],
++		[-6.27193516, -0.00091817, 0.00056285, 0.00092292, -0.00000114, 0.00000000],
++		[-6.27193597, -0.00091790, 0.00056268, 0.00092265, -0.00000114, 0.00000000],
++		[-6.27193677, -0.00091763, 0.00056251, 0.00092238, -0.00000114, 0.00000000],
++		[-6.27193757, -0.00091736, 0.00056235, 0.00092210, -0.00000114, 0.00000000],
++		[-6.27193837, -0.00091708, 0.00056218, 0.00092183, -0.00000114, 0.00000000],
++		[-6.27193917, -0.00091681, 0.00056201, 0.00092156, -0.00000114, 0.00000000],
++		[-6.27193996, -0.00091654, 0.00056185, 0.00092128, -0.00000114, 0.00000000],
++		[-6.27194076, -0.00091627, 0.00056168, 0.00092101, -0.00000114, 0.00000000],
++		[-6.27194155, -0.00091600, 0.00056151, 0.00092074, -0.00000114, 0.00000000],
++		[-6.27194235, -0.00091573, 0.00056135, 0.00092046, -0.00000114, 0.00000000],
++		[-6.27194314, -0.00091546, 0.00056118, 0.00092019, -0.00000114, 0.00000000],
++		[-6.27194394, -0.00091519, 0.00056102, 0.00091992, -0.00000114, 0.00000000],
++		[-6.27194473, -0.00091492, 0.00056085, 0.00091965, -0.00000114, 0.00000000],
++		[-6.27194552, -0.00091465, 0.00056068, 0.00091938, -0.00000114, 0.00000000],
++		[-6.27194631, -0.00091438, 0.00056052, 0.00091911, -0.00000114, 0.00000000],
++		[-6.27194710, -0.00091411, 0.00056035, 0.00091883, -0.00000114, 0.00000000],
++		[-6.27194788, -0.00091384, 0.00056019, 0.00091856, -0.00000114, 0.00000000],
++		[-6.27194867, -0.00091357, 0.00056002, 0.00091829, -0.00000114, 0.00000000],
++		[-6.27194946, -0.00091330, 0.00055986, 0.00091802, -0.00000114, 0.00000000],
++		[-6.27195024, -0.00091303, 0.00055969, 0.00091775, -0.00000114, 0.00000000],
++		[-6.27195102, -0.00091276, 0.00055953, 0.00091748, -0.00000114, 0.00000000],
++		[-6.27195181, -0.00091249, 0.00055936, 0.00091721, -0.00000114, 0.00000000],
++		[-6.27195259, -0.00091222, 0.00055920, 0.00091694, -0.00000114, 0.00000000],
++		[-6.27195337, -0.00091195, 0.00055903, 0.00091667, -0.00000114, 0.00000000],
++		[-6.27195415, -0.00091168, 0.00055887, 0.00091640, -0.00000114, 0.00000000],
++		[-6.27195493, -0.00091141, 0.00055870, 0.00091613, -0.00000114, 0.00000000],
++		[-6.27195571, -0.00091115, 0.00055854, 0.00091586, -0.00000114, 0.00000000],
++		[-6.27195648, -0.00091088, 0.00055837, 0.00091559, -0.00000114, 0.00000000],
++		[-6.27195726, -0.00091061, 0.00055821, 0.00091532, -0.00000114, 0.00000000],
++		[-6.27195803, -0.00091034, 0.00055804, 0.00091505, -0.00000114, 0.00000000],
++		[-6.27195881, -0.00091007, 0.00055788, 0.00091478, -0.00000114, 0.00000000],
++		[-6.27195958, -0.00090981, 0.00055771, 0.00091451, -0.00000114, 0.00000000],
++		[-6.27196035, -0.00090954, 0.00055755, 0.00091424, -0.00000114, 0.00000000],
++		[-6.27196113, -0.00090927, 0.00055739, 0.00091397, -0.00000114, 0.00000000],
++		[-6.27196190, -0.00090901, 0.00055722, 0.00091371, -0.00000114, 0.00000000],
++		[-6.27196267, -0.00090874, 0.00055706, 0.00091344, -0.00000114, 0.00000000],
++		[-6.27196344, -0.00090847, 0.00055690, 0.00091317, -0.00000114, 0.00000000],
++		[-6.27196420, -0.00090821, 0.00055673, 0.00091290, -0.00000114, 0.00000000],
++		[-6.27196497, -0.00090794, 0.00055657, 0.00091263, -0.00000114, 0.00000000],
++		[-6.27196574, -0.00090767, 0.00055641, 0.00091237, -0.00000114, 0.00000000],
++		[-6.27196650, -0.00090741, 0.00055624, 0.00091210, -0.00000114, 0.00000000],
++		[-6.27196726, -0.00090714, 0.00055608, 0.00091183, -0.00000114, 0.00000000],
++		[-6.27196803, -0.00090688, 0.00055592, 0.00091156, -0.00000114, 0.00000000],
++		[-6.27196879, -0.00090661, 0.00055575, 0.00091130, -0.00000114, 0.00000000],
++		[-6.27196955, -0.00090634, 0.00055559, 0.00091103, -0.00000114, 0.00000000],
++		[-6.27197031, -0.00090608, 0.00055543, 0.00091076, -0.00000114, 0.00000000],
++		[-6.27197107, -0.00090581, 0.00055526, 0.00091050, -0.00000114, 0.00000000],
++		[-6.27197183, -0.00090555, 0.00055510, 0.00091023, -0.00000114, 0.00000000],
++		[-6.27197259, -0.00090528, 0.00055494, 0.00090997, -0.00000114, 0.00000000],
++		[-6.27197335, -0.00090502, 0.00055478, 0.00090970, -0.00000114, 0.00000000],
++		[-6.27197410, -0.00090476, 0.00055461, 0.00090943, -0.00000114, 0.00000000],
++		[-6.27197486, -0.00090449, 0.00055445, 0.00090917, -0.00000114, 0.00000000],
++		[-6.27197561, -0.00090423, 0.00055429, 0.00090890, -0.00000114, 0.00000000],
++		[-6.27197637, -0.00090396, 0.00055413, 0.00090864, -0.00000114, 0.00000000],
++		[-6.27197712, -0.00090370, 0.00055397, 0.00090837, -0.00000114, 0.00000000],
++		[-6.27197787, -0.00090344, 0.00055380, 0.00090811, -0.00000114, 0.00000000],
++		[-6.27197862, -0.00090317, 0.00055364, 0.00090784, -0.00000114, 0.00000000],
++		[-6.27197937, -0.00090291, 0.00055348, 0.00090758, -0.00000114, 0.00000000],
++		[-6.27198012, -0.00090264, 0.00055332, 0.00090731, -0.00000114, 0.00000000],
++		[-6.27198087, -0.00090238, 0.00055316, 0.00090705, -0.00000114, 0.00000000],
++		[-6.27198162, -0.00090212, 0.00055300, 0.00090678, -0.00000114, 0.00000000],
++		[-6.27198236, -0.00090186, 0.00055284, 0.00090652, -0.00000114, 0.00000000],
++		[-6.27198311, -0.00090159, 0.00055267, 0.00090625, -0.00000114, 0.00000000],
++		[-6.27198385, -0.00090133, 0.00055251, 0.00090599, -0.00000113, 0.00000000],
++		[-6.27198460, -0.00090107, 0.00055235, 0.00090573, -0.00000113, 0.00000000],
++		[-6.27198534, -0.00090081, 0.00055219, 0.00090546, -0.00000113, 0.00000000],
++		[-6.27198608, -0.00090054, 0.00055203, 0.00090520, -0.00000113, 0.00000000],
++		[-6.27198682, -0.00090028, 0.00055187, 0.00090494, -0.00000113, 0.00000000],
++		[-6.27198756, -0.00090002, 0.00055171, 0.00090467, -0.00000113, 0.00000000],
++		[-6.27198830, -0.00089976, 0.00055155, 0.00090441, -0.00000113, 0.00000000],
++		[-6.27198904, -0.00089950, 0.00055139, 0.00090415, -0.00000113, 0.00000000],
++		[-6.27198978, -0.00089924, 0.00055123, 0.00090388, -0.00000113, 0.00000000],
++		[-6.27199052, -0.00089898, 0.00055107, 0.00090362, -0.00000113, 0.00000000],
++		[-6.27199126, -0.00089871, 0.00055091, 0.00090336, -0.00000113, 0.00000000],
++		[-6.27199199, -0.00089845, 0.00055075, 0.00090310, -0.00000113, 0.00000000],
++		[-6.27199273, -0.00089819, 0.00055059, 0.00090284, -0.00000113, 0.00000000],
++		[-6.27199346, -0.00089793, 0.00055043, 0.00090257, -0.00000113, 0.00000000],
++		[-6.27199419, -0.00089767, 0.00055027, 0.00090231, -0.00000113, 0.00000000],
++		[-6.27199493, -0.00089741, 0.00055011, 0.00090205, -0.00000113, 0.00000000],
++		[-6.27199566, -0.00089715, 0.00054995, 0.00090179, -0.00000113, 0.00000000],
++		[-6.27199639, -0.00089689, 0.00054979, 0.00090153, -0.00000113, 0.00000000],
++		[-6.27199712, -0.00089663, 0.00054963, 0.00090127, -0.00000113, 0.00000000],
++		[-6.27199785, -0.00089637, 0.00054947, 0.00090100, -0.00000113, 0.00000000],
++		[-6.27199857, -0.00089611, 0.00054931, 0.00090074, -0.00000113, 0.00000000],
++		[-6.27199930, -0.00089585, 0.00054915, 0.00090048, -0.00000113, 0.00000000],
++		[-6.27200003, -0.00089559, 0.00054899, 0.00090022, -0.00000113, 0.00000000],
++		[-6.27200076, -0.00089534, 0.00054883, 0.00089996, -0.00000113, 0.00000000],
++		[-6.27200148, -0.00089508, 0.00054868, 0.00089970, -0.00000113, 0.00000000],
++		[-6.27200220, -0.00089482, 0.00054852, 0.00089944, -0.00000113, 0.00000000],
++		[-6.27200293, -0.00089456, 0.00054836, 0.00089918, -0.00000113, 0.00000000],
++		[-6.27200365, -0.00089430, 0.00054820, 0.00089892, -0.00000113, 0.00000000],
++		[-6.27200437, -0.00089404, 0.00054804, 0.00089866, -0.00000113, 0.00000000],
++		[-6.27200509, -0.00089378, 0.00054788, 0.00089840, -0.00000113, 0.00000000],
++		[-6.27200581, -0.00089353, 0.00054772, 0.00089814, -0.00000113, 0.00000000],
++		[-6.27200653, -0.00089327, 0.00054757, 0.00089788, -0.00000113, 0.00000000],
++		[-6.27200725, -0.00089301, 0.00054741, 0.00089763, -0.00000113, 0.00000000],
++		[-6.27200797, -0.00089275, 0.00054725, 0.00089737, -0.00000113, 0.00000000],
++		[-6.27200869, -0.00089250, 0.00054709, 0.00089711, -0.00000113, 0.00000000],
++		[-6.27200940, -0.00089224, 0.00054693, 0.00089685, -0.00000113, 0.00000000],
++		[-6.27201012, -0.00089198, 0.00054678, 0.00089659, -0.00000113, 0.00000000],
++		[-6.27201083, -0.00089172, 0.00054662, 0.00089633, -0.00000113, 0.00000000],
++		[-6.27201155, -0.00089147, 0.00054646, 0.00089607, -0.00000113, 0.00000000],
++		[-6.27201226, -0.00089121, 0.00054630, 0.00089582, -0.00000113, 0.00000000],
++		[-6.27201297, -0.00089095, 0.00054615, 0.00089556, -0.00000113, 0.00000000],
++		[-6.27201369, -0.00089070, 0.00054599, 0.00089530, -0.00000113, 0.00000000],
++		[-6.27201440, -0.00089044, 0.00054583, 0.00089504, -0.00000113, 0.00000000],
++		[-6.27201511, -0.00089019, 0.00054568, 0.00089479, -0.00000113, 0.00000000],
++		[-6.27201582, -0.00088993, 0.00054552, 0.00089453, -0.00000113, 0.00000000],
++		[-6.27201653, -0.00088967, 0.00054536, 0.00089427, -0.00000113, 0.00000000],
++		[-6.27201723, -0.00088942, 0.00054520, 0.00089401, -0.00000113, 0.00000000],
++		[-6.27201794, -0.00088916, 0.00054505, 0.00089376, -0.00000113, 0.00000000],
++		[-6.27201865, -0.00088891, 0.00054489, 0.00089350, -0.00000113, 0.00000000],
++		[-6.27201935, -0.00088865, 0.00054473, 0.00089324, -0.00000113, 0.00000000],
++		[-6.27202006, -0.00088840, 0.00054458, 0.00089299, -0.00000113, 0.00000000],
++		[-6.27202076, -0.00088814, 0.00054442, 0.00089273, -0.00000113, 0.00000000],
++		[-6.27202147, -0.00088789, 0.00054427, 0.00089248, -0.00000113, 0.00000000],
++		[-6.27202217, -0.00088763, 0.00054411, 0.00089222, -0.00000113, 0.00000000],
++		[-6.27202287, -0.00088738, 0.00054395, 0.00089196, -0.00000113, 0.00000000],
++		[-6.27202357, -0.00088713, 0.00054380, 0.00089171, -0.00000113, 0.00000000],
++		[-6.27202427, -0.00088687, 0.00054364, 0.00089145, -0.00000113, 0.00000000],
++		[-6.27202497, -0.00088662, 0.00054349, 0.00089120, -0.00000113, 0.00000000],
++		[-6.27202567, -0.00088636, 0.00054333, 0.00089094, -0.00000113, 0.00000000],
++		[-6.27202637, -0.00088611, 0.00054317, 0.00089069, -0.00000113, 0.00000000],
++		[-6.27202707, -0.00088586, 0.00054302, 0.00089043, -0.00000113, 0.00000000],
++		[-6.27202777, -0.00088560, 0.00054286, 0.00089018, -0.00000113, 0.00000000],
++		[-6.27202846, -0.00088535, 0.00054271, 0.00088992, -0.00000113, 0.00000000],
++		[-6.27202916, -0.00088510, 0.00054255, 0.00088967, -0.00000113, 0.00000000],
++		[-6.27202985, -0.00088484, 0.00054240, 0.00088941, -0.00000113, 0.00000000],
++		[-6.27203055, -0.00088459, 0.00054224, 0.00088916, -0.00000113, 0.00000000],
++		[-6.27203124, -0.00088434, 0.00054209, 0.00088891, -0.00000113, 0.00000000],
++		[-6.27203193, -0.00088409, 0.00054193, 0.00088865, -0.00000113, 0.00000000],
++		[-6.27203262, -0.00088383, 0.00054178, 0.00088840, -0.00000113, 0.00000000],
++		[-6.27203332, -0.00088358, 0.00054162, 0.00088814, -0.00000113, 0.00000000],
++		[-6.27203401, -0.00088333, 0.00054147, 0.00088789, -0.00000113, 0.00000000],
++		[-6.27203470, -0.00088308, 0.00054131, 0.00088764, -0.00000113, 0.00000000],
++		[-6.27203539, -0.00088282, 0.00054116, 0.00088738, -0.00000113, 0.00000000],
++		[-6.27203607, -0.00088257, 0.00054100, 0.00088713, -0.00000113, 0.00000000],
++		[-6.27203676, -0.00088232, 0.00054085, 0.00088688, -0.00000113, 0.00000000],
++		[-6.27203745, -0.00088207, 0.00054069, 0.00088663, -0.00000113, 0.00000000],
++		[-6.27203813, -0.00088182, 0.00054054, 0.00088637, -0.00000113, 0.00000000],
++		[-6.27203882, -0.00088157, 0.00054039, 0.00088612, -0.00000113, 0.00000000],
++		[-6.27203950, -0.00088132, 0.00054023, 0.00088587, -0.00000113, 0.00000000],
++		[-6.27204019, -0.00088107, 0.00054008, 0.00088562, -0.00000113, 0.00000000],
++		[-6.27204087, -0.00088082, 0.00053992, 0.00088536, -0.00000113, 0.00000000],
++		[-6.27204156, -0.00088056, 0.00053977, 0.00088511, -0.00000113, 0.00000000],
++		[-6.27204224, -0.00088031, 0.00053962, 0.00088486, -0.00000113, 0.00000000],
++		[-6.27204292, -0.00088006, 0.00053946, 0.00088461, -0.00000113, 0.00000000],
++		[-6.27204360, -0.00087981, 0.00053931, 0.00088436, -0.00000113, 0.00000000],
++		[-6.27204428, -0.00087956, 0.00053916, 0.00088411, -0.00000113, 0.00000000],
++		[-6.27204496, -0.00087931, 0.00053900, 0.00088385, -0.00000113, 0.00000000],
++		[-6.27204564, -0.00087906, 0.00053885, 0.00088360, -0.00000113, 0.00000000],
++		[-6.27204632, -0.00087881, 0.00053870, 0.00088335, -0.00000113, 0.00000000],
++		[-6.27204699, -0.00087857, 0.00053854, 0.00088310, -0.00000113, 0.00000000],
++		[-6.27204767, -0.00087832, 0.00053839, 0.00088285, -0.00000113, 0.00000000],
++		[-6.27204835, -0.00087807, 0.00053824, 0.00088260, -0.00000113, 0.00000000],
++		[-6.27204902, -0.00087782, 0.00053809, 0.00088235, -0.00000113, 0.00000000],
++		[-6.27204970, -0.00087757, 0.00053793, 0.00088210, -0.00000113, 0.00000000],
++		[-6.27205037, -0.00087732, 0.00053778, 0.00088185, -0.00000113, 0.00000000],
++		[-6.27205104, -0.00087707, 0.00053763, 0.00088160, -0.00000113, 0.00000000],
++		[-6.27205172, -0.00087682, 0.00053748, 0.00088135, -0.00000113, 0.00000000],
++		[-6.27205239, -0.00087658, 0.00053732, 0.00088110, -0.00000113, 0.00000000],
++		[-6.27205306, -0.00087633, 0.00053717, 0.00088085, -0.00000113, 0.00000000],
++		[-6.27205373, -0.00087608, 0.00053702, 0.00088060, -0.00000113, 0.00000000],
++		[-6.27205440, -0.00087583, 0.00053687, 0.00088035, -0.00000113, 0.00000000],
++		[-6.27205507, -0.00087558, 0.00053671, 0.00088010, -0.00000113, 0.00000000],
++		[-6.27205574, -0.00087534, 0.00053656, 0.00087985, -0.00000113, 0.00000000],
++		[-6.27205641, -0.00087509, 0.00053641, 0.00087961, -0.00000113, 0.00000000],
++		[-6.27205707, -0.00087484, 0.00053626, 0.00087936, -0.00000113, 0.00000000],
++		[-6.27205774, -0.00087459, 0.00053611, 0.00087911, -0.00000113, 0.00000000],
++		[-6.27205841, -0.00087435, 0.00053596, 0.00087886, -0.00000113, 0.00000000],
++		[-6.27205907, -0.00087410, 0.00053580, 0.00087861, -0.00000113, 0.00000000],
++		[-6.27205974, -0.00087385, 0.00053565, 0.00087836, -0.00000113, 0.00000000],
++		[-6.27206040, -0.00087361, 0.00053550, 0.00087812, -0.00000113, 0.00000000],
++		[-6.27206106, -0.00087336, 0.00053535, 0.00087787, -0.00000113, 0.00000000],
++		[-6.27206173, -0.00087311, 0.00053520, 0.00087762, -0.00000113, 0.00000000],
++		[-6.27206239, -0.00087287, 0.00053505, 0.00087737, -0.00000113, 0.00000000],
++		[-6.27206305, -0.00087262, 0.00053490, 0.00087713, -0.00000113, 0.00000000],
++		[-6.27206371, -0.00087238, 0.00053475, 0.00087688, -0.00000113, 0.00000000],
++		[-6.27206437, -0.00087213, 0.00053460, 0.00087663, -0.00000113, 0.00000000],
++		[-6.27206503, -0.00087188, 0.00053445, 0.00087638, -0.00000113, 0.00000000],
++		[-6.27206569, -0.00087164, 0.00053429, 0.00087614, -0.00000113, 0.00000000],
++		[-6.27206635, -0.00087139, 0.00053414, 0.00087589, -0.00000113, 0.00000000],
++		[-6.27206701, -0.00087115, 0.00053399, 0.00087564, -0.00000113, 0.00000000],
++		[-6.27206767, -0.00087090, 0.00053384, 0.00087540, -0.00000113, 0.00000000],
++		[-6.27206832, -0.00087066, 0.00053369, 0.00087515, -0.00000113, 0.00000000],
++		[-6.27206898, -0.00087041, 0.00053354, 0.00087491, -0.00000113, 0.00000000],
++		[-6.27206963, -0.00087017, 0.00053339, 0.00087466, -0.00000113, 0.00000000],
++		[-6.27207029, -0.00086992, 0.00053324, 0.00087441, -0.00000113, 0.00000000],
++		[-6.27207094, -0.00086968, 0.00053309, 0.00087417, -0.00000113, 0.00000000],
++		[-6.27207160, -0.00086944, 0.00053294, 0.00087392, -0.00000113, 0.00000000],
++		[-6.27207225, -0.00086919, 0.00053279, 0.00087368, -0.00000113, 0.00000000],
++		[-6.27207290, -0.00086895, 0.00053264, 0.00087343, -0.00000113, 0.00000000],
++		[-6.27207355, -0.00086870, 0.00053249, 0.00087319, -0.00000113, 0.00000000],
++		[-6.27207420, -0.00086846, 0.00053234, 0.00087294, -0.00000113, 0.00000000],
++		[-6.27207485, -0.00086822, 0.00053219, 0.00087270, -0.00000113, 0.00000000],
++		[-6.27207550, -0.00086797, 0.00053205, 0.00087245, -0.00000113, 0.00000000],
++		[-6.27207615, -0.00086773, 0.00053190, 0.00087221, -0.00000113, 0.00000000],
++		[-6.27207680, -0.00086749, 0.00053175, 0.00087196, -0.00000113, 0.00000000],
++		[-6.27207745, -0.00086724, 0.00053160, 0.00087172, -0.00000113, 0.00000000],
++		[-6.27207810, -0.00086700, 0.00053145, 0.00087147, -0.00000113, 0.00000000],
++		[-6.27207874, -0.00086676, 0.00053130, 0.00087123, -0.00000113, 0.00000000],
++		[-6.27207939, -0.00086652, 0.00053115, 0.00087099, -0.00000113, 0.00000000],
++		[-6.27208004, -0.00086627, 0.00053100, 0.00087074, -0.00000113, 0.00000000],
++		[-6.27208068, -0.00086603, 0.00053085, 0.00087050, -0.00000113, 0.00000000],
++		[-6.27208132, -0.00086579, 0.00053070, 0.00087026, -0.00000113, 0.00000000],
++		[-6.27208197, -0.00086555, 0.00053056, 0.00087001, -0.00000113, 0.00000000],
++		[-6.27208261, -0.00086530, 0.00053041, 0.00086977, -0.00000113, 0.00000000],
++		[-6.27208325, -0.00086506, 0.00053026, 0.00086953, -0.00000113, 0.00000000],
++		[-6.27208390, -0.00086482, 0.00053011, 0.00086928, -0.00000113, 0.00000000],
++		[-6.27208454, -0.00086458, 0.00052996, 0.00086904, -0.00000113, 0.00000000],
++		[-6.27208518, -0.00086434, 0.00052981, 0.00086880, -0.00000113, 0.00000000],
++		[-6.27208582, -0.00086410, 0.00052967, 0.00086856, -0.00000113, 0.00000000],
++		[-6.27208646, -0.00086386, 0.00052952, 0.00086831, -0.00000113, 0.00000000],
++		[-6.27208710, -0.00086361, 0.00052937, 0.00086807, -0.00000113, 0.00000000],
++		[-6.27208774, -0.00086337, 0.00052922, 0.00086783, -0.00000113, 0.00000000],
++		[-6.27208837, -0.00086313, 0.00052908, 0.00086759, -0.00000113, 0.00000000],
++		[-6.27208901, -0.00086289, 0.00052893, 0.00086734, -0.00000113, 0.00000000],
++		[-6.27208965, -0.00086265, 0.00052878, 0.00086710, -0.00000113, 0.00000000],
++		[-6.27209028, -0.00086241, 0.00052863, 0.00086686, -0.00000113, 0.00000000],
++		[-6.27209092, -0.00086217, 0.00052849, 0.00086662, -0.00000113, 0.00000000],
++		[-6.27209155, -0.00086193, 0.00052834, 0.00086638, -0.00000113, 0.00000000],
++		[-6.27209219, -0.00086169, 0.00052819, 0.00086614, -0.00000113, 0.00000000],
++		[-6.27209282, -0.00086145, 0.00052804, 0.00086590, -0.00000113, 0.00000000],
++		[-6.27209346, -0.00086121, 0.00052790, 0.00086565, -0.00000113, 0.00000000],
++		[-6.27209409, -0.00086097, 0.00052775, 0.00086541, -0.00000113, 0.00000000],
++		[-6.27209472, -0.00086073, 0.00052760, 0.00086517, -0.00000113, 0.00000000],
++		[-6.27209535, -0.00086049, 0.00052746, 0.00086493, -0.00000113, 0.00000000],
++		[-6.27209598, -0.00086025, 0.00052731, 0.00086469, -0.00000113, 0.00000000],
++		[-6.27209661, -0.00086002, 0.00052716, 0.00086445, -0.00000113, 0.00000000],
++		[-6.27209724, -0.00085978, 0.00052702, 0.00086421, -0.00000113, 0.00000000],
++		[-6.27209787, -0.00085954, 0.00052687, 0.00086397, -0.00000113, 0.00000000],
++		[-6.27209850, -0.00085930, 0.00052672, 0.00086373, -0.00000113, 0.00000000],
++		[-6.27209913, -0.00085906, 0.00052658, 0.00086349, -0.00000113, 0.00000000],
++		[-6.27209976, -0.00085882, 0.00052643, 0.00086325, -0.00000113, 0.00000000],
++		[-6.27210038, -0.00085858, 0.00052628, 0.00086301, -0.00000113, 0.00000000],
++		[-6.27210101, -0.00085835, 0.00052614, 0.00086277, -0.00000113, 0.00000000],
++		[-6.27210164, -0.00085811, 0.00052599, 0.00086253, -0.00000113, 0.00000000],
++		[-6.27210226, -0.00085787, 0.00052585, 0.00086230, -0.00000113, 0.00000000],
++		[-6.27210289, -0.00085763, 0.00052570, 0.00086206, -0.00000113, 0.00000000],
++		[-6.27210351, -0.00085740, 0.00052555, 0.00086182, -0.00000113, 0.00000000],
++		[-6.27210414, -0.00085716, 0.00052541, 0.00086158, -0.00000113, 0.00000000],
++		[-6.27210476, -0.00085692, 0.00052526, 0.00086134, -0.00000113, 0.00000000],
++		[-6.27210538, -0.00085668, 0.00052512, 0.00086110, -0.00000113, 0.00000000],
++		[-6.27210600, -0.00085645, 0.00052497, 0.00086086, -0.00000113, 0.00000000],
++		[-6.27210663, -0.00085621, 0.00052483, 0.00086063, -0.00000113, 0.00000000],
++		[-6.27210725, -0.00085597, 0.00052468, 0.00086039, -0.00000113, 0.00000000],
++		[-6.27210787, -0.00085574, 0.00052454, 0.00086015, -0.00000113, 0.00000000],
++		[-6.27210849, -0.00085550, 0.00052439, 0.00085991, -0.00000113, 0.00000000],
++		[-6.27210911, -0.00085526, 0.00052425, 0.00085967, -0.00000113, 0.00000000],
++		[-6.27210973, -0.00085503, 0.00052410, 0.00085944, -0.00000113, 0.00000000],
++		[-6.27211034, -0.00085479, 0.00052396, 0.00085920, -0.00000113, 0.00000000],
++		[-6.27211096, -0.00085456, 0.00052381, 0.00085896, -0.00000113, 0.00000000],
++		[-6.27211158, -0.00085432, 0.00052367, 0.00085873, -0.00000113, 0.00000000],
++		[-6.27211220, -0.00085408, 0.00052352, 0.00085849, -0.00000113, 0.00000000],
++		[-6.27211281, -0.00085385, 0.00052338, 0.00085825, -0.00000113, 0.00000000],
++		[-6.27211343, -0.00085361, 0.00052323, 0.00085801, -0.00000113, 0.00000000],
++		[-6.27211404, -0.00085338, 0.00052309, 0.00085778, -0.00000113, 0.00000000],
++		[-6.27211466, -0.00085314, 0.00052295, 0.00085754, -0.00000113, 0.00000000],
++		[-6.27211527, -0.00085291, 0.00052280, 0.00085731, -0.00000113, 0.00000000],
++		[-6.27211589, -0.00085267, 0.00052266, 0.00085707, -0.00000113, 0.00000000],
++		[-6.27211650, -0.00085244, 0.00052251, 0.00085683, -0.00000113, 0.00000000],
++		[-6.27211711, -0.00085220, 0.00052237, 0.00085660, -0.00000113, 0.00000000],
++		[-6.27211772, -0.00085197, 0.00052222, 0.00085636, -0.00000113, 0.00000000],
++		[-6.27211833, -0.00085173, 0.00052208, 0.00085613, -0.00000113, 0.00000000],
++		[-6.27211895, -0.00085150, 0.00052194, 0.00085589, -0.00000113, 0.00000000],
++		[-6.27211956, -0.00085127, 0.00052179, 0.00085565, -0.00000113, 0.00000000],
++		[-6.27212017, -0.00085103, 0.00052165, 0.00085542, -0.00000113, 0.00000000],
++		[-6.27212078, -0.00085080, 0.00052151, 0.00085518, -0.00000113, 0.00000000],
++		[-6.27212138, -0.00085056, 0.00052136, 0.00085495, -0.00000113, 0.00000000],
++		[-6.27212199, -0.00085033, 0.00052122, 0.00085471, -0.00000113, 0.00000000],
++		[-6.27212260, -0.00085010, 0.00052108, 0.00085448, -0.00000113, 0.00000000],
++		[-6.27212321, -0.00084986, 0.00052093, 0.00085425, -0.00000113, 0.00000000],
++		[-6.27212381, -0.00084963, 0.00052079, 0.00085401, -0.00000113, 0.00000000],
++		[-6.27212442, -0.00084940, 0.00052065, 0.00085378, -0.00000113, 0.00000000],
++		[-6.27212503, -0.00084916, 0.00052050, 0.00085354, -0.00000113, 0.00000000],
++		[-6.27212563, -0.00084893, 0.00052036, 0.00085331, -0.00000113, 0.00000000],
++		[-6.27212624, -0.00084870, 0.00052022, 0.00085307, -0.00000113, 0.00000000],
++		[-6.27212684, -0.00084847, 0.00052008, 0.00085284, -0.00000113, 0.00000000],
++		[-6.27212744, -0.00084823, 0.00051993, 0.00085261, -0.00000113, 0.00000000],
++		[-6.27212805, -0.00084800, 0.00051979, 0.00085237, -0.00000113, 0.00000000],
++		[-6.27212865, -0.00084777, 0.00051965, 0.00085214, -0.00000113, 0.00000000],
++		[-6.27212925, -0.00084754, 0.00051951, 0.00085191, -0.00000113, 0.00000000],
++		[-6.27212986, -0.00084730, 0.00051936, 0.00085167, -0.00000113, 0.00000000],
++		[-6.27213046, -0.00084707, 0.00051922, 0.00085144, -0.00000113, 0.00000000],
++		[-6.27213106, -0.00084684, 0.00051908, 0.00085121, -0.00000113, 0.00000000],
++		[-6.27213166, -0.00084661, 0.00051894, 0.00085097, -0.00000113, 0.00000000],
++		[-6.27213226, -0.00084638, 0.00051879, 0.00085074, -0.00000113, 0.00000000],
++		[-6.27213286, -0.00084615, 0.00051865, 0.00085051, -0.00000113, 0.00000000],
++		[-6.27213345, -0.00084592, 0.00051851, 0.00085028, -0.00000113, 0.00000000],
++		[-6.27213405, -0.00084568, 0.00051837, 0.00085004, -0.00000113, 0.00000000],
++		[-6.27213465, -0.00084545, 0.00051823, 0.00084981, -0.00000113, 0.00000000],
++		[-6.27213525, -0.00084522, 0.00051809, 0.00084958, -0.00000113, 0.00000000],
++		[-6.27213585, -0.00084499, 0.00051794, 0.00084935, -0.00000113, 0.00000000],
++		[-6.27213644, -0.00084476, 0.00051780, 0.00084912, -0.00000113, 0.00000000],
++		[-6.27213704, -0.00084453, 0.00051766, 0.00084888, -0.00000113, 0.00000000],
++		[-6.27213763, -0.00084430, 0.00051752, 0.00084865, -0.00000113, 0.00000000],
++		[-6.27213823, -0.00084407, 0.00051738, 0.00084842, -0.00000113, 0.00000000],
++		[-6.27213882, -0.00084384, 0.00051724, 0.00084819, -0.00000113, 0.00000000],
++		[-6.27213942, -0.00084361, 0.00051710, 0.00084796, -0.00000113, 0.00000000],
++		[-6.27214001, -0.00084338, 0.00051696, 0.00084773, -0.00000113, 0.00000000],
++		[-6.27214060, -0.00084315, 0.00051681, 0.00084750, -0.00000113, 0.00000000],
++		[-6.27214120, -0.00084292, 0.00051667, 0.00084727, -0.00000113, 0.00000000],
++		[-6.27214179, -0.00084269, 0.00051653, 0.00084703, -0.00000113, 0.00000000],
++		[-6.27214238, -0.00084246, 0.00051639, 0.00084680, -0.00000113, 0.00000000],
++		[-6.27214297, -0.00084223, 0.00051625, 0.00084657, -0.00000113, 0.00000000],
++		[-6.27214356, -0.00084200, 0.00051611, 0.00084634, -0.00000113, 0.00000000],
++		[-6.27214415, -0.00084178, 0.00051597, 0.00084611, -0.00000113, 0.00000000],
++		[-6.27214474, -0.00084155, 0.00051583, 0.00084588, -0.00000113, 0.00000000],
++		[-6.27214533, -0.00084132, 0.00051569, 0.00084565, -0.00000113, 0.00000000],
++		[-6.27214592, -0.00084109, 0.00051555, 0.00084542, -0.00000113, 0.00000000],
++		[-6.27214651, -0.00084086, 0.00051541, 0.00084519, -0.00000113, 0.00000000],
++		[-6.27214709, -0.00084063, 0.00051527, 0.00084496, -0.00000113, 0.00000000],
++		[-6.27214768, -0.00084040, 0.00051513, 0.00084473, -0.00000113, 0.00000000],
++		[-6.27214827, -0.00084018, 0.00051499, 0.00084451, -0.00000113, 0.00000000],
++		[-6.27214885, -0.00083995, 0.00051485, 0.00084428, -0.00000113, 0.00000000],
++		[-6.27214944, -0.00083972, 0.00051471, 0.00084405, -0.00000113, 0.00000000],
++		[-6.27215002, -0.00083949, 0.00051457, 0.00084382, -0.00000113, 0.00000000],
++		[-6.27215061, -0.00083926, 0.00051443, 0.00084359, -0.00000113, 0.00000000],
++		[-6.27215119, -0.00083904, 0.00051429, 0.00084336, -0.00000113, 0.00000000],
++		[-6.27215178, -0.00083881, 0.00051415, 0.00084313, -0.00000113, 0.00000000],
++		[-6.27215236, -0.00083858, 0.00051401, 0.00084290, -0.00000113, 0.00000000],
++		[-6.27215294, -0.00083836, 0.00051387, 0.00084268, -0.00000113, 0.00000000],
++		[-6.27215353, -0.00083813, 0.00051373, 0.00084245, -0.00000113, 0.00000000],
++		[-6.27215411, -0.00083790, 0.00051359, 0.00084222, -0.00000113, 0.00000000],
++		[-6.27215469, -0.00083768, 0.00051345, 0.00084199, -0.00000113, 0.00000000],
++		[-6.27215527, -0.00083745, 0.00051332, 0.00084176, -0.00000113, 0.00000000],
++		[-6.27215585, -0.00083722, 0.00051318, 0.00084154, -0.00000113, 0.00000000],
++		[-6.27215643, -0.00083700, 0.00051304, 0.00084131, -0.00000113, 0.00000000],
++		[-6.27215701, -0.00083677, 0.00051290, 0.00084108, -0.00000113, 0.00000000],
++		[-6.27215759, -0.00083654, 0.00051276, 0.00084085, -0.00000113, 0.00000000],
++		[-6.27215817, -0.00083632, 0.00051262, 0.00084063, -0.00000113, 0.00000000],
++		[-6.27215875, -0.00083609, 0.00051248, 0.00084040, -0.00000113, 0.00000000],
++		[-6.27215933, -0.00083587, 0.00051234, 0.00084017, -0.00000113, 0.00000000],
++		[-6.27215990, -0.00083564, 0.00051221, 0.00083995, -0.00000113, 0.00000000],
++		[-6.27216048, -0.00083541, 0.00051207, 0.00083972, -0.00000113, 0.00000000],
++		[-6.27216106, -0.00083519, 0.00051193, 0.00083949, -0.00000113, 0.00000000],
++		[-6.27216164, -0.00083496, 0.00051179, 0.00083927, -0.00000113, 0.00000000],
++		[-6.27216221, -0.00083474, 0.00051165, 0.00083904, -0.00000113, 0.00000000],
++		[-6.27216279, -0.00083451, 0.00051151, 0.00083881, -0.00000113, 0.00000000],
++		[-6.27216336, -0.00083429, 0.00051138, 0.00083859, -0.00000113, 0.00000000],
++		[-6.27216394, -0.00083406, 0.00051124, 0.00083836, -0.00000113, 0.00000000],
++		[-6.27216451, -0.00083384, 0.00051110, 0.00083813, -0.00000113, 0.00000000],
++		[-6.27216508, -0.00083361, 0.00051096, 0.00083791, -0.00000113, 0.00000000],
++		[-6.27216566, -0.00083339, 0.00051083, 0.00083768, -0.00000113, 0.00000000],
++		[-6.27216623, -0.00083317, 0.00051069, 0.00083746, -0.00000113, 0.00000000],
++		[-6.27216680, -0.00083294, 0.00051055, 0.00083723, -0.00000113, 0.00000000],
++		[-6.27216737, -0.00083272, 0.00051041, 0.00083701, -0.00000113, 0.00000000],
++		[-6.27216794, -0.00083249, 0.00051028, 0.00083678, -0.00000113, 0.00000000],
++		[-6.27216851, -0.00083227, 0.00051014, 0.00083656, -0.00000113, 0.00000000],
++		[-6.27216909, -0.00083205, 0.00051000, 0.00083633, -0.00000113, 0.00000000],
++		[-6.27216966, -0.00083182, 0.00050986, 0.00083611, -0.00000113, 0.00000000],
++		[-6.27217022, -0.00083160, 0.00050973, 0.00083588, -0.00000113, 0.00000000],
++		[-6.27217079, -0.00083138, 0.00050959, 0.00083566, -0.00000113, 0.00000000],
++		[-6.27217136, -0.00083115, 0.00050945, 0.00083543, -0.00000113, 0.00000000],
++		[-6.27217193, -0.00083093, 0.00050932, 0.00083521, -0.00000113, 0.00000000],
++		[-6.27217250, -0.00083071, 0.00050918, 0.00083499, -0.00000113, 0.00000000],
++		[-6.27217307, -0.00083048, 0.00050904, 0.00083476, -0.00000113, 0.00000000],
++		[-6.27217363, -0.00083026, 0.00050891, 0.00083454, -0.00000113, 0.00000000],
++		[-6.27217420, -0.00083004, 0.00050877, 0.00083431, -0.00000113, 0.00000000],
++		[-6.27217477, -0.00082982, 0.00050863, 0.00083409, -0.00000113, 0.00000000],
++		[-6.27217533, -0.00082959, 0.00050850, 0.00083387, -0.00000113, 0.00000000],
++		[-6.27217590, -0.00082937, 0.00050836, 0.00083364, -0.00000113, 0.00000000],
++		[-6.27217646, -0.00082915, 0.00050822, 0.00083342, -0.00000113, 0.00000000],
++		[-6.27217703, -0.00082893, 0.00050809, 0.00083320, -0.00000113, 0.00000000],
++		[-6.27217759, -0.00082871, 0.00050795, 0.00083297, -0.00000113, 0.00000000],
++		[-6.27217815, -0.00082848, 0.00050782, 0.00083275, -0.00000113, 0.00000000],
++		[-6.27217872, -0.00082826, 0.00050768, 0.00083253, -0.00000113, 0.00000000],
++		[-6.27217928, -0.00082804, 0.00050754, 0.00083230, -0.00000113, 0.00000000],
++		[-6.27217984, -0.00082782, 0.00050741, 0.00083208, -0.00000113, 0.00000000],
++		[-6.27218040, -0.00082760, 0.00050727, 0.00083186, -0.00000113, 0.00000000],
++		[-6.27218097, -0.00082738, 0.00050714, 0.00083164, -0.00000113, 0.00000000],
++		[-6.27218153, -0.00082716, 0.00050700, 0.00083141, -0.00000113, 0.00000000],
++		[-6.27218209, -0.00082693, 0.00050686, 0.00083119, -0.00000113, 0.00000000],
++		[-6.27218265, -0.00082671, 0.00050673, 0.00083097, -0.00000113, 0.00000000],
++		[-6.27218321, -0.00082649, 0.00050659, 0.00083075, -0.00000113, 0.00000000],
++		[-6.27218377, -0.00082627, 0.00050646, 0.00083053, -0.00000113, 0.00000000],
++		[-6.27218433, -0.00082605, 0.00050632, 0.00083031, -0.00000113, 0.00000000],
++		[-6.27218488, -0.00082583, 0.00050619, 0.00083008, -0.00000113, 0.00000000],
++		[-6.27218544, -0.00082561, 0.00050605, 0.00082986, -0.00000113, 0.00000000],
++		[-6.27218600, -0.00082539, 0.00050592, 0.00082964, -0.00000113, 0.00000000],
++		[-6.27218656, -0.00082517, 0.00050578, 0.00082942, -0.00000113, 0.00000000],
++		[-6.27218711, -0.00082495, 0.00050565, 0.00082920, -0.00000113, 0.00000000],
++		[-6.27218767, -0.00082473, 0.00050551, 0.00082898, -0.00000113, 0.00000000],
++		[-6.27218823, -0.00082451, 0.00050538, 0.00082876, -0.00000113, 0.00000000],
++		[-6.27218878, -0.00082429, 0.00050524, 0.00082854, -0.00000113, 0.00000000],
++		[-6.27218934, -0.00082407, 0.00050511, 0.00082832, -0.00000113, 0.00000000],
++		[-6.27218989, -0.00082385, 0.00050497, 0.00082810, -0.00000113, 0.00000000],
++		[-6.27219045, -0.00082363, 0.00050484, 0.00082787, -0.00000113, 0.00000000],
++		[-6.27219100, -0.00082341, 0.00050471, 0.00082765, -0.00000113, 0.00000000],
++		[-6.27219155, -0.00082320, 0.00050457, 0.00082743, -0.00000113, 0.00000000],
++		[-6.27219211, -0.00082298, 0.00050444, 0.00082721, -0.00000113, 0.00000000],
++		[-6.27219266, -0.00082276, 0.00050430, 0.00082699, -0.00000113, 0.00000000],
++		[-6.27219321, -0.00082254, 0.00050417, 0.00082677, -0.00000113, 0.00000000],
++		[-6.27219376, -0.00082232, 0.00050403, 0.00082656, -0.00000113, 0.00000000],
++		[-6.27219432, -0.00082210, 0.00050390, 0.00082634, -0.00000113, 0.00000000],
++		[-6.27219487, -0.00082188, 0.00050377, 0.00082612, -0.00000113, 0.00000000],
++		[-6.27219542, -0.00082167, 0.00050363, 0.00082590, -0.00000113, 0.00000000],
++		[-6.27219597, -0.00082145, 0.00050350, 0.00082568, -0.00000113, 0.00000000],
++		[-6.27219652, -0.00082123, 0.00050337, 0.00082546, -0.00000113, 0.00000000],
++		[-6.27219707, -0.00082101, 0.00050323, 0.00082524, -0.00000113, 0.00000000],
++		[-6.27219762, -0.00082080, 0.00050310, 0.00082502, -0.00000113, 0.00000000],
++		[-6.27219817, -0.00082058, 0.00050296, 0.00082480, -0.00000113, 0.00000000],
++		[-6.27219872, -0.00082036, 0.00050283, 0.00082458, -0.00000113, 0.00000000],
++		[-6.27219926, -0.00082014, 0.00050270, 0.00082436, -0.00000113, 0.00000000],
++		[-6.27219981, -0.00081993, 0.00050256, 0.00082415, -0.00000113, 0.00000000],
++		[-6.27220036, -0.00081971, 0.00050243, 0.00082393, -0.00000113, 0.00000000],
++		[-6.27220091, -0.00081949, 0.00050230, 0.00082371, -0.00000113, 0.00000000],
++		[-6.27220145, -0.00081927, 0.00050216, 0.00082349, -0.00000113, 0.00000000],
++		[-6.27220200, -0.00081906, 0.00050203, 0.00082327, -0.00000113, 0.00000000],
++		[-6.27220254, -0.00081884, 0.00050190, 0.00082306, -0.00000113, 0.00000000],
++		[-6.27220309, -0.00081862, 0.00050177, 0.00082284, -0.00000113, 0.00000000],
++		[-6.27220363, -0.00081841, 0.00050163, 0.00082262, -0.00000113, 0.00000000],
++		[-6.27220418, -0.00081819, 0.00050150, 0.00082240, -0.00000113, 0.00000000],
++		[-6.27220472, -0.00081798, 0.00050137, 0.00082219, -0.00000113, 0.00000000],
++		[-6.27220527, -0.00081776, 0.00050124, 0.00082197, -0.00000113, 0.00000000],
++		[-6.27220581, -0.00081754, 0.00050110, 0.00082175, -0.00000113, 0.00000000],
++		[-6.27220635, -0.00081733, 0.00050097, 0.00082153, -0.00000113, 0.00000000],
++		[-6.27220690, -0.00081711, 0.00050084, 0.00082132, -0.00000113, 0.00000000],
++		[-6.27220744, -0.00081690, 0.00050071, 0.00082110, -0.00000113, 0.00000000],
++		[-6.27220798, -0.00081668, 0.00050057, 0.00082088, -0.00000113, 0.00000000],
++		[-6.27220852, -0.00081647, 0.00050044, 0.00082067, -0.00000113, 0.00000000],
++		[-6.27220906, -0.00081625, 0.00050031, 0.00082045, -0.00000113, 0.00000000],
++		[-6.27220960, -0.00081604, 0.00050018, 0.00082024, -0.00000113, 0.00000000],
++		[-6.27221014, -0.00081582, 0.00050005, 0.00082002, -0.00000113, 0.00000000],
++		[-6.27221068, -0.00081561, 0.00049991, 0.00081980, -0.00000113, 0.00000000],
++		[-6.27221122, -0.00081539, 0.00049978, 0.00081959, -0.00000113, 0.00000000],
++		[-6.27221176, -0.00081518, 0.00049965, 0.00081937, -0.00000113, 0.00000000],
++		[-6.27221230, -0.00081496, 0.00049952, 0.00081916, -0.00000113, 0.00000000],
++		[-6.27221284, -0.00081475, 0.00049939, 0.00081894, -0.00000113, 0.00000000],
++		[-6.27221338, -0.00081453, 0.00049926, 0.00081872, -0.00000113, 0.00000000],
++		[-6.27221391, -0.00081432, 0.00049912, 0.00081851, -0.00000113, 0.00000000],
++		[-6.27221445, -0.00081410, 0.00049899, 0.00081829, -0.00000113, 0.00000000],
++		[-6.27221499, -0.00081389, 0.00049886, 0.00081808, -0.00000113, 0.00000000],
++		[-6.27221552, -0.00081368, 0.00049873, 0.00081786, -0.00000113, 0.00000000],
++		[-6.27221606, -0.00081346, 0.00049860, 0.00081765, -0.00000113, 0.00000000],
++		[-6.27221660, -0.00081325, 0.00049847, 0.00081743, -0.00000113, 0.00000000],
++		[-6.27221713, -0.00081303, 0.00049834, 0.00081722, -0.00000113, 0.00000000],
++		[-6.27221767, -0.00081282, 0.00049821, 0.00081700, -0.00000113, 0.00000000],
++		[-6.27221820, -0.00081261, 0.00049807, 0.00081679, -0.00000113, 0.00000000],
++		[-6.27221874, -0.00081239, 0.00049794, 0.00081657, -0.00000113, 0.00000000],
++		[-6.27221927, -0.00081218, 0.00049781, 0.00081636, -0.00000113, 0.00000000],
++		[-6.27221980, -0.00081197, 0.00049768, 0.00081615, -0.00000113, 0.00000000],
++		[-6.27222034, -0.00081176, 0.00049755, 0.00081593, -0.00000113, 0.00000000],
++		[-6.27222087, -0.00081154, 0.00049742, 0.00081572, -0.00000113, 0.00000000],
++		[-6.27222140, -0.00081133, 0.00049729, 0.00081550, -0.00000113, 0.00000000],
++		[-6.27222193, -0.00081112, 0.00049716, 0.00081529, -0.00000113, 0.00000000],
++		[-6.27222247, -0.00081090, 0.00049703, 0.00081508, -0.00000113, 0.00000000],
++		[-6.27222300, -0.00081069, 0.00049690, 0.00081486, -0.00000113, 0.00000000],
++		[-6.27222353, -0.00081048, 0.00049677, 0.00081465, -0.00000113, 0.00000000],
++		[-6.27222406, -0.00081027, 0.00049664, 0.00081444, -0.00000113, 0.00000000],
++		[-6.27222459, -0.00081006, 0.00049651, 0.00081422, -0.00000113, 0.00000000],
++		[-6.27222512, -0.00080984, 0.00049638, 0.00081401, -0.00000113, 0.00000000],
++		[-6.27222565, -0.00080963, 0.00049625, 0.00081380, -0.00000113, 0.00000000],
++		[-6.27222618, -0.00080942, 0.00049612, 0.00081359, -0.00000113, 0.00000000],
++		[-6.27222671, -0.00080921, 0.00049599, 0.00081337, -0.00000113, 0.00000000],
++		[-6.27222723, -0.00080900, 0.00049586, 0.00081316, -0.00000113, 0.00000000],
++		[-6.27222776, -0.00080879, 0.00049573, 0.00081295, -0.00000113, 0.00000000],
++		[-6.27222829, -0.00080857, 0.00049560, 0.00081273, -0.00000113, 0.00000000],
++		[-6.27222882, -0.00080836, 0.00049547, 0.00081252, -0.00000113, 0.00000000],
++		[-6.27222934, -0.00080815, 0.00049534, 0.00081231, -0.00000113, 0.00000000],
++		[-6.27222987, -0.00080794, 0.00049521, 0.00081210, -0.00000113, 0.00000000],
++		[-6.27223040, -0.00080773, 0.00049508, 0.00081189, -0.00000113, 0.00000000],
++		[-6.27223092, -0.00080752, 0.00049495, 0.00081167, -0.00000113, 0.00000000],
++		[-6.27223145, -0.00080731, 0.00049482, 0.00081146, -0.00000113, 0.00000000],
++		[-6.27223197, -0.00080710, 0.00049469, 0.00081125, -0.00000113, 0.00000000],
++		[-6.27223250, -0.00080689, 0.00049457, 0.00081104, -0.00000113, 0.00000000],
++		[-6.27223302, -0.00080668, 0.00049444, 0.00081083, -0.00000113, 0.00000000],
++		[-6.27223355, -0.00080647, 0.00049431, 0.00081062, -0.00000113, 0.00000000],
++		[-6.27223407, -0.00080626, 0.00049418, 0.00081041, -0.00000113, 0.00000000],
++		[-6.27223460, -0.00080605, 0.00049405, 0.00081019, -0.00000113, 0.00000000],
++		[-6.27223512, -0.00080584, 0.00049392, 0.00080998, -0.00000113, 0.00000000],
++		[-6.27223564, -0.00080563, 0.00049379, 0.00080977, -0.00000113, 0.00000000],
++		[-6.27223616, -0.00080542, 0.00049366, 0.00080956, -0.00000113, 0.00000000],
++		[-6.27223669, -0.00080521, 0.00049354, 0.00080935, -0.00000113, 0.00000000],
++		[-6.27223721, -0.00080500, 0.00049341, 0.00080914, -0.00000113, 0.00000000],
++		[-6.27223773, -0.00080479, 0.00049328, 0.00080893, -0.00000113, 0.00000000],
++		[-6.27223825, -0.00080458, 0.00049315, 0.00080872, -0.00000113, 0.00000000],
++		[-6.27223877, -0.00080437, 0.00049302, 0.00080851, -0.00000113, 0.00000000],
++		[-6.27223929, -0.00080416, 0.00049289, 0.00080830, -0.00000113, 0.00000000],
++		[-6.27223981, -0.00080395, 0.00049277, 0.00080809, -0.00000113, 0.00000000],
++		[-6.27224033, -0.00080375, 0.00049264, 0.00080788, -0.00000113, 0.00000000],
++		[-6.27224085, -0.00080354, 0.00049251, 0.00080767, -0.00000113, 0.00000000],
++		[-6.27224137, -0.00080333, 0.00049238, 0.00080746, -0.00000113, 0.00000000],
++		[-6.27224189, -0.00080312, 0.00049225, 0.00080725, -0.00000113, 0.00000000],
++		[-6.27224241, -0.00080291, 0.00049213, 0.00080704, -0.00000113, 0.00000000],
++		[-6.27224292, -0.00080270, 0.00049200, 0.00080683, -0.00000113, 0.00000000],
++		[-6.27224344, -0.00080250, 0.00049187, 0.00080662, -0.00000113, 0.00000000],
++		[-6.27224396, -0.00080229, 0.00049174, 0.00080641, -0.00000113, 0.00000000],
++		[-6.27224447, -0.00080208, 0.00049162, 0.00080621, -0.00000113, 0.00000000],
++		[-6.27224499, -0.00080187, 0.00049149, 0.00080600, -0.00000113, 0.00000000],
++		[-6.27224551, -0.00080166, 0.00049136, 0.00080579, -0.00000113, 0.00000000],
++		[-6.27224602, -0.00080146, 0.00049123, 0.00080558, -0.00000113, 0.00000000],
++		[-6.27224654, -0.00080125, 0.00049111, 0.00080537, -0.00000113, 0.00000000],
++		[-6.27224705, -0.00080104, 0.00049098, 0.00080516, -0.00000113, 0.00000000],
++		[-6.27224757, -0.00080084, 0.00049085, 0.00080495, -0.00000113, 0.00000000],
++		[-6.27224808, -0.00080063, 0.00049072, 0.00080475, -0.00000113, 0.00000000],
++		[-6.27224860, -0.00080042, 0.00049060, 0.00080454, -0.00000113, 0.00000000],
++		[-6.27224911, -0.00080021, 0.00049047, 0.00080433, -0.00000113, 0.00000000],
++		[-6.27224962, -0.00080001, 0.00049034, 0.00080412, -0.00000113, 0.00000000],
++		[-6.27225014, -0.00079980, 0.00049022, 0.00080391, -0.00000113, 0.00000000],
++		[-6.27225065, -0.00079959, 0.00049009, 0.00080371, -0.00000113, 0.00000000],
++		[-6.27225116, -0.00079939, 0.00048996, 0.00080350, -0.00000113, 0.00000000],
++		[-6.27225168, -0.00079918, 0.00048984, 0.00080329, -0.00000113, 0.00000000],
++		[-6.27225219, -0.00079897, 0.00048971, 0.00080308, -0.00000113, 0.00000000],
++		[-6.27225270, -0.00079877, 0.00048958, 0.00080288, -0.00000113, 0.00000000],
++		[-6.27225321, -0.00079856, 0.00048946, 0.00080267, -0.00000113, 0.00000000],
++		[-6.27225372, -0.00079836, 0.00048933, 0.00080246, -0.00000113, 0.00000000],
++		[-6.27225423, -0.00079815, 0.00048921, 0.00080226, -0.00000113, 0.00000000],
++		[-6.27225474, -0.00079795, 0.00048908, 0.00080205, -0.00000113, 0.00000000],
++		[-6.27225525, -0.00079774, 0.00048895, 0.00080184, -0.00000113, 0.00000000],
++		[-6.27225576, -0.00079753, 0.00048883, 0.00080164, -0.00000113, 0.00000000],
++		[-6.27225627, -0.00079733, 0.00048870, 0.00080143, -0.00000113, 0.00000000],
++		[-6.27225678, -0.00079712, 0.00048857, 0.00080122, -0.00000113, 0.00000000],
++		[-6.27225729, -0.00079692, 0.00048845, 0.00080102, -0.00000113, 0.00000000],
++		[-6.27225780, -0.00079671, 0.00048832, 0.00080081, -0.00000113, 0.00000000],
++		[-6.27225830, -0.00079651, 0.00048820, 0.00080060, -0.00000113, 0.00000000],
++		[-6.27225881, -0.00079630, 0.00048807, 0.00080040, -0.00000113, 0.00000000],
++		[-6.27225932, -0.00079610, 0.00048795, 0.00080019, -0.00000113, 0.00000000],
++		[-6.27225983, -0.00079589, 0.00048782, 0.00079999, -0.00000113, 0.00000000],
++		[-6.27226033, -0.00079569, 0.00048769, 0.00079978, -0.00000113, 0.00000000],
++		[-6.27226084, -0.00079548, 0.00048757, 0.00079957, -0.00000113, 0.00000000],
++		[-6.27226134, -0.00079528, 0.00048744, 0.00079937, -0.00000113, 0.00000000],
++		[-6.27226185, -0.00079508, 0.00048732, 0.00079916, -0.00000113, 0.00000000],
++		[-6.27226235, -0.00079487, 0.00048719, 0.00079896, -0.00000113, 0.00000000],
++		[-6.27226286, -0.00079467, 0.00048707, 0.00079875, -0.00000113, 0.00000000],
++		[-6.27226336, -0.00079446, 0.00048694, 0.00079855, -0.00000113, 0.00000000],
++		[-6.27226387, -0.00079426, 0.00048682, 0.00079834, -0.00000113, 0.00000000],
++		[-6.27226437, -0.00079406, 0.00048669, 0.00079814, -0.00000113, 0.00000000],
++		[-6.27226488, -0.00079385, 0.00048657, 0.00079793, -0.00000113, 0.00000000],
++		[-6.27226538, -0.00079365, 0.00048644, 0.00079773, -0.00000113, 0.00000000],
++		[-6.27226588, -0.00079345, 0.00048632, 0.00079752, -0.00000113, 0.00000000],
++		[-6.27226639, -0.00079324, 0.00048619, 0.00079732, -0.00000113, 0.00000000],
++		[-6.27226689, -0.00079304, 0.00048607, 0.00079712, -0.00000113, 0.00000000],
++		[-6.27226739, -0.00079284, 0.00048594, 0.00079691, -0.00000113, 0.00000000],
++		[-6.27226789, -0.00079263, 0.00048582, 0.00079671, -0.00000113, 0.00000000],
++		[-6.27226839, -0.00079243, 0.00048570, 0.00079650, -0.00000113, 0.00000000],
++		[-6.27226889, -0.00079223, 0.00048557, 0.00079630, -0.00000113, 0.00000000],
++		[-6.27226939, -0.00079202, 0.00048545, 0.00079610, -0.00000113, 0.00000000],
++		[-6.27226990, -0.00079182, 0.00048532, 0.00079589, -0.00000113, 0.00000000],
++		[-6.27227040, -0.00079162, 0.00048520, 0.00079569, -0.00000113, 0.00000000],
++		[-6.27227090, -0.00079142, 0.00048507, 0.00079549, -0.00000113, 0.00000000],
++		[-6.27227139, -0.00079121, 0.00048495, 0.00079528, -0.00000113, 0.00000000],
++		[-6.27227189, -0.00079101, 0.00048483, 0.00079508, -0.00000113, 0.00000000],
++		[-6.27227239, -0.00079081, 0.00048470, 0.00079488, -0.00000113, 0.00000000],
++		[-6.27227289, -0.00079061, 0.00048458, 0.00079467, -0.00000113, 0.00000000],
++		[-6.27227339, -0.00079041, 0.00048445, 0.00079447, -0.00000113, 0.00000000],
++		[-6.27227389, -0.00079020, 0.00048433, 0.00079427, -0.00000113, 0.00000000],
++		[-6.27227439, -0.00079000, 0.00048421, 0.00079406, -0.00000113, 0.00000000],
++		[-6.27227488, -0.00078980, 0.00048408, 0.00079386, -0.00000113, 0.00000000],
++		[-6.27227538, -0.00078960, 0.00048396, 0.00079366, -0.00000113, 0.00000000],
++		[-6.27227588, -0.00078940, 0.00048384, 0.00079346, -0.00000113, 0.00000000],
++		[-6.27227637, -0.00078920, 0.00048371, 0.00079325, -0.00000113, 0.00000000],
++		[-6.27227687, -0.00078900, 0.00048359, 0.00079305, -0.00000113, 0.00000000],
++		[-6.27227736, -0.00078880, 0.00048347, 0.00079285, -0.00000113, 0.00000000],
++		[-6.27227786, -0.00078859, 0.00048334, 0.00079265, -0.00000113, 0.00000000],
++		[-6.27227836, -0.00078839, 0.00048322, 0.00079245, -0.00000113, 0.00000000],
++		[-6.27227885, -0.00078819, 0.00048310, 0.00079224, -0.00000113, 0.00000000],
++		[-6.27227934, -0.00078799, 0.00048297, 0.00079204, -0.00000113, 0.00000000],
++		[-6.27227984, -0.00078779, 0.00048285, 0.00079184, -0.00000113, 0.00000000],
++		[-6.27228033, -0.00078759, 0.00048273, 0.00079164, -0.00000113, 0.00000000],
++		[-6.27228083, -0.00078739, 0.00048260, 0.00079144, -0.00000113, 0.00000000],
++		[-6.27228132, -0.00078719, 0.00048248, 0.00079124, -0.00000113, 0.00000000],
++		[-6.27228181, -0.00078699, 0.00048236, 0.00079104, -0.00000113, 0.00000000],
++		[-6.27228231, -0.00078679, 0.00048224, 0.00079083, -0.00000113, 0.00000000],
++		[-6.27228280, -0.00078659, 0.00048211, 0.00079063, -0.00000113, 0.00000000],
++		[-6.27228329, -0.00078639, 0.00048199, 0.00079043, -0.00000113, 0.00000000],
++		[-6.27228378, -0.00078619, 0.00048187, 0.00079023, -0.00000113, 0.00000000],
++		[-6.27228427, -0.00078599, 0.00048175, 0.00079003, -0.00000113, 0.00000000],
++		[-6.27228476, -0.00078579, 0.00048162, 0.00078983, -0.00000113, 0.00000000],
++		[-6.27228526, -0.00078559, 0.00048150, 0.00078963, -0.00000113, 0.00000000],
++		[-6.27228575, -0.00078539, 0.00048138, 0.00078943, -0.00000113, 0.00000000],
++		[-6.27228624, -0.00078519, 0.00048126, 0.00078923, -0.00000113, 0.00000000],
++		[-6.27228673, -0.00078500, 0.00048113, 0.00078903, -0.00000113, 0.00000000],
++		[-6.27228722, -0.00078480, 0.00048101, 0.00078883, -0.00000113, 0.00000000],
++		[-6.27228771, -0.00078460, 0.00048089, 0.00078863, -0.00000113, 0.00000000],
++		[-6.27228819, -0.00078440, 0.00048077, 0.00078843, -0.00000113, 0.00000000],
++		[-6.27228868, -0.00078420, 0.00048065, 0.00078823, -0.00000113, 0.00000000],
++		[-6.27228917, -0.00078400, 0.00048052, 0.00078803, -0.00000113, 0.00000000],
++		[-6.27228966, -0.00078380, 0.00048040, 0.00078783, -0.00000113, 0.00000000],
++		[-6.27229015, -0.00078360, 0.00048028, 0.00078763, -0.00000113, 0.00000000],
++		[-6.27229064, -0.00078341, 0.00048016, 0.00078743, -0.00000113, 0.00000000],
++		[-6.27229112, -0.00078321, 0.00048004, 0.00078723, -0.00000113, 0.00000000],
++		[-6.27229161, -0.00078301, 0.00047992, 0.00078703, -0.00000113, 0.00000000],
++		[-6.27229210, -0.00078281, 0.00047979, 0.00078683, -0.00000113, 0.00000000],
++		[-6.27229258, -0.00078261, 0.00047967, 0.00078663, -0.00000113, 0.00000000],
++		[-6.27229307, -0.00078242, 0.00047955, 0.00078644, -0.00000113, 0.00000000],
++		[-6.27229356, -0.00078222, 0.00047943, 0.00078624, -0.00000113, 0.00000000],
++		[-6.27229404, -0.00078202, 0.00047931, 0.00078604, -0.00000113, 0.00000000],
++		[-6.27229453, -0.00078182, 0.00047919, 0.00078584, -0.00000113, 0.00000000],
++		[-6.27229501, -0.00078163, 0.00047907, 0.00078564, -0.00000113, 0.00000000],
++		[-6.27229550, -0.00078143, 0.00047895, 0.00078544, -0.00000113, 0.00000000],
++		[-6.27229598, -0.00078123, 0.00047882, 0.00078524, -0.00000113, 0.00000000],
++		[-6.27229646, -0.00078103, 0.00047870, 0.00078505, -0.00000113, 0.00000000],
++		[-6.27229695, -0.00078084, 0.00047858, 0.00078485, -0.00000113, 0.00000000],
++		[-6.27229743, -0.00078064, 0.00047846, 0.00078465, -0.00000113, 0.00000000],
++		[-6.27229791, -0.00078044, 0.00047834, 0.00078445, -0.00000113, 0.00000000],
++		[-6.27229840, -0.00078025, 0.00047822, 0.00078426, -0.00000113, 0.00000000],
++		[-6.27229888, -0.00078005, 0.00047810, 0.00078406, -0.00000113, 0.00000000],
++		[-6.27229936, -0.00077985, 0.00047798, 0.00078386, -0.00000113, 0.00000000],
++		[-6.27229984, -0.00077966, 0.00047786, 0.00078366, -0.00000113, 0.00000000],
++		[-6.27230033, -0.00077946, 0.00047774, 0.00078346, -0.00000113, 0.00000000],
++		[-6.27230081, -0.00077926, 0.00047762, 0.00078327, -0.00000113, 0.00000000],
++		[-6.27230129, -0.00077907, 0.00047750, 0.00078307, -0.00000113, 0.00000000],
++		[-6.27230177, -0.00077887, 0.00047738, 0.00078287, -0.00000113, 0.00000000],
++		[-6.27230225, -0.00077868, 0.00047726, 0.00078268, -0.00000113, 0.00000000],
++		[-6.27230273, -0.00077848, 0.00047714, 0.00078248, -0.00000113, 0.00000000],
++		[-6.27230321, -0.00077828, 0.00047702, 0.00078228, -0.00000113, 0.00000000],
++		[-6.27230369, -0.00077809, 0.00047690, 0.00078209, -0.00000113, 0.00000000],
++		[-6.27230417, -0.00077789, 0.00047678, 0.00078189, -0.00000113, 0.00000000],
++		[-6.27230465, -0.00077770, 0.00047666, 0.00078169, -0.00000113, 0.00000000],
++		[-6.27230513, -0.00077750, 0.00047654, 0.00078150, -0.00000113, 0.00000000],
++		[-6.27230561, -0.00077731, 0.00047642, 0.00078130, -0.00000113, 0.00000000],
++		[-6.27230609, -0.00077711, 0.00047630, 0.00078110, -0.00000113, 0.00000000],
++		[-6.27230656, -0.00077692, 0.00047618, 0.00078091, -0.00000113, 0.00000000],
++		[-6.27230704, -0.00077672, 0.00047606, 0.00078071, -0.00000113, 0.00000000],
++		[-6.27230752, -0.00077653, 0.00047594, 0.00078052, -0.00000113, 0.00000000],
++		[-6.27230800, -0.00077633, 0.00047582, 0.00078032, -0.00000113, 0.00000000],
++		[-6.27230847, -0.00077614, 0.00047570, 0.00078012, -0.00000113, 0.00000000],
++		[-6.27230895, -0.00077594, 0.00047558, 0.00077993, -0.00000113, 0.00000000],
++		[-6.27230943, -0.00077575, 0.00047546, 0.00077973, -0.00000113, 0.00000000],
++		[-6.27230990, -0.00077556, 0.00047534, 0.00077954, -0.00000113, 0.00000000],
++		[-6.27231038, -0.00077536, 0.00047522, 0.00077934, -0.00000113, 0.00000000],
++		[-6.27231085, -0.00077517, 0.00047510, 0.00077915, -0.00000113, 0.00000000],
++		[-6.27231133, -0.00077497, 0.00047498, 0.00077895, -0.00000113, 0.00000000],
++		[-6.27231180, -0.00077478, 0.00047487, 0.00077876, -0.00000113, 0.00000000],
++		[-6.27231228, -0.00077458, 0.00047475, 0.00077856, -0.00000113, 0.00000000],
++		[-6.27231275, -0.00077439, 0.00047463, 0.00077837, -0.00000113, 0.00000000],
++		[-6.27231323, -0.00077420, 0.00047451, 0.00077817, -0.00000113, 0.00000000],
++		[-6.27231370, -0.00077400, 0.00047439, 0.00077798, -0.00000113, 0.00000000],
++		[-6.27231417, -0.00077381, 0.00047427, 0.00077778, -0.00000113, 0.00000000],
++		[-6.27231465, -0.00077362, 0.00047415, 0.00077759, -0.00000113, 0.00000000],
++		[-6.27231512, -0.00077342, 0.00047403, 0.00077740, -0.00000113, 0.00000000],
++		[-6.27231559, -0.00077323, 0.00047392, 0.00077720, -0.00000113, 0.00000000],
++		[-6.27231607, -0.00077304, 0.00047380, 0.00077701, -0.00000113, 0.00000000],
++		[-6.27231654, -0.00077284, 0.00047368, 0.00077681, -0.00000113, 0.00000000],
++		[-6.27231701, -0.00077265, 0.00047356, 0.00077662, -0.00000113, 0.00000000],
++		[-6.27231748, -0.00077246, 0.00047344, 0.00077643, -0.00000113, 0.00000000],
++		[-6.27231795, -0.00077227, 0.00047332, 0.00077623, -0.00000113, 0.00000000],
++		[-6.27231842, -0.00077207, 0.00047321, 0.00077604, -0.00000113, 0.00000000],
++		[-6.27231889, -0.00077188, 0.00047309, 0.00077584, -0.00000113, 0.00000000],
++		[-6.27231936, -0.00077169, 0.00047297, 0.00077565, -0.00000113, 0.00000000],
++		[-6.27231984, -0.00077150, 0.00047285, 0.00077546, -0.00000113, 0.00000000],
++		[-6.27232031, -0.00077130, 0.00047273, 0.00077526, -0.00000113, 0.00000000],
++		[-6.27232077, -0.00077111, 0.00047262, 0.00077507, -0.00000113, 0.00000000],
++		[-6.27232124, -0.00077092, 0.00047250, 0.00077488, -0.00000113, 0.00000000],
++		[-6.27232171, -0.00077073, 0.00047238, 0.00077469, -0.00000113, 0.00000000],
++		[-6.27232218, -0.00077054, 0.00047226, 0.00077449, -0.00000113, 0.00000000],
++		[-6.27232265, -0.00077034, 0.00047215, 0.00077430, -0.00000113, 0.00000000],
++		[-6.27232312, -0.00077015, 0.00047203, 0.00077411, -0.00000113, 0.00000000],
++		[-6.27232359, -0.00076996, 0.00047191, 0.00077391, -0.00000113, 0.00000000],
++		[-6.27232406, -0.00076977, 0.00047179, 0.00077372, -0.00000113, 0.00000000],
++		[-6.27232452, -0.00076958, 0.00047168, 0.00077353, -0.00000113, 0.00000000],
++		[-6.27232499, -0.00076939, 0.00047156, 0.00077334, -0.00000113, 0.00000000],
++		[-6.27232546, -0.00076920, 0.00047144, 0.00077315, -0.00000113, 0.00000000],
++		[-6.27232592, -0.00076900, 0.00047132, 0.00077295, -0.00000113, 0.00000000],
++		[-6.27232639, -0.00076881, 0.00047121, 0.00077276, -0.00000113, 0.00000000],
++		[-6.27232686, -0.00076862, 0.00047109, 0.00077257, -0.00000113, 0.00000000],
++		[-6.27232732, -0.00076843, 0.00047097, 0.00077238, -0.00000113, 0.00000000],
++		[-6.27232779, -0.00076824, 0.00047086, 0.00077219, -0.00000113, 0.00000000],
++		[-6.27232825, -0.00076805, 0.00047074, 0.00077199, -0.00000113, 0.00000000],
++		[-6.27232872, -0.00076786, 0.00047062, 0.00077180, -0.00000113, 0.00000000],
++		[-6.27232918, -0.00076767, 0.00047050, 0.00077161, -0.00000113, 0.00000000],
++		[-6.27232965, -0.00076748, 0.00047039, 0.00077142, -0.00000113, 0.00000000],
++		[-6.27233011, -0.00076729, 0.00047027, 0.00077123, -0.00000113, 0.00000000],
++		[-6.27233058, -0.00076710, 0.00047015, 0.00077104, -0.00000113, 0.00000000],
++		[-6.27233104, -0.00076691, 0.00047004, 0.00077085, -0.00000113, 0.00000000],
++		[-6.27233150, -0.00076672, 0.00046992, 0.00077066, -0.00000113, 0.00000000],
++		[-6.27233197, -0.00076653, 0.00046981, 0.00077046, -0.00000113, 0.00000000],
++		[-6.27233243, -0.00076634, 0.00046969, 0.00077027, -0.00000113, 0.00000000],
++		[-6.27233289, -0.00076615, 0.00046957, 0.00077008, -0.00000113, 0.00000000],
++		[-6.27233336, -0.00076596, 0.00046946, 0.00076989, -0.00000113, 0.00000000],
++		[-6.27233382, -0.00076577, 0.00046934, 0.00076970, -0.00000113, 0.00000000],
++		[-6.27233428, -0.00076558, 0.00046922, 0.00076951, -0.00000113, 0.00000000],
++		[-6.27233474, -0.00076539, 0.00046911, 0.00076932, -0.00000113, 0.00000000],
++		[-6.27233520, -0.00076520, 0.00046899, 0.00076913, -0.00000113, 0.00000000],
++		[-6.27233566, -0.00076501, 0.00046888, 0.00076894, -0.00000113, 0.00000000],
++		[-6.27233612, -0.00076482, 0.00046876, 0.00076875, -0.00000113, 0.00000000],
++		[-6.27233658, -0.00076464, 0.00046864, 0.00076856, -0.00000113, 0.00000000],
++		[-6.27233705, -0.00076445, 0.00046853, 0.00076837, -0.00000113, 0.00000000],
++		[-6.27233751, -0.00076426, 0.00046841, 0.00076818, -0.00000113, 0.00000000],
++		[-6.27233797, -0.00076407, 0.00046830, 0.00076799, -0.00000113, 0.00000000],
++		[-6.27233843, -0.00076388, 0.00046818, 0.00076780, -0.00000113, 0.00000000],
++		[-6.27233888, -0.00076369, 0.00046806, 0.00076761, -0.00000113, 0.00000000],
++		[-6.27233934, -0.00076350, 0.00046795, 0.00076742, -0.00000113, 0.00000000],
++		[-6.27233980, -0.00076332, 0.00046783, 0.00076723, -0.00000113, 0.00000000],
++		[-6.27234026, -0.00076313, 0.00046772, 0.00076704, -0.00000113, 0.00000000],
++		[-6.27234072, -0.00076294, 0.00046760, 0.00076686, -0.00000113, 0.00000000],
++		[-6.27234118, -0.00076275, 0.00046749, 0.00076667, -0.00000113, 0.00000000],
++		[-6.27234163, -0.00076256, 0.00046737, 0.00076648, -0.00000113, 0.00000000],
++		[-6.27234209, -0.00076238, 0.00046726, 0.00076629, -0.00000113, 0.00000000],
++		[-6.27234255, -0.00076219, 0.00046714, 0.00076610, -0.00000113, 0.00000000],
++		[-6.27234301, -0.00076200, 0.00046703, 0.00076591, -0.00000113, 0.00000000],
++		[-6.27234346, -0.00076181, 0.00046691, 0.00076572, -0.00000113, 0.00000000],
++		[-6.27234392, -0.00076163, 0.00046680, 0.00076553, -0.00000113, 0.00000000],
++		[-6.27234438, -0.00076144, 0.00046668, 0.00076535, -0.00000113, 0.00000000],
++		[-6.27234483, -0.00076125, 0.00046657, 0.00076516, -0.00000113, 0.00000000],
++		[-6.27234529, -0.00076106, 0.00046645, 0.00076497, -0.00000113, 0.00000000],
++		[-6.27234574, -0.00076088, 0.00046634, 0.00076478, -0.00000113, 0.00000000],
++		[-6.27234620, -0.00076069, 0.00046622, 0.00076459, -0.00000113, 0.00000000],
++		[-6.27234665, -0.00076050, 0.00046611, 0.00076441, -0.00000113, 0.00000000],
++		[-6.27234711, -0.00076032, 0.00046599, 0.00076422, -0.00000113, 0.00000000],
++		[-6.27234756, -0.00076013, 0.00046588, 0.00076403, -0.00000113, 0.00000000],
++		[-6.27234802, -0.00075994, 0.00046576, 0.00076384, -0.00000113, 0.00000000],
++		[-6.27234847, -0.00075976, 0.00046565, 0.00076366, -0.00000113, 0.00000000],
++		[-6.27234892, -0.00075957, 0.00046554, 0.00076347, -0.00000113, 0.00000000],
++		[-6.27234938, -0.00075938, 0.00046542, 0.00076328, -0.00000113, 0.00000000],
++		[-6.27234983, -0.00075920, 0.00046531, 0.00076309, -0.00000113, 0.00000000],
++		[-6.27235028, -0.00075901, 0.00046519, 0.00076291, -0.00000113, 0.00000000],
++		[-6.27235074, -0.00075882, 0.00046508, 0.00076272, -0.00000113, 0.00000000],
++		[-6.27235119, -0.00075864, 0.00046496, 0.00076253, -0.00000113, 0.00000000],
++		[-6.27235164, -0.00075845, 0.00046485, 0.00076235, -0.00000113, 0.00000000],
++		[-6.27235209, -0.00075827, 0.00046474, 0.00076216, -0.00000113, 0.00000000],
++		[-6.27235255, -0.00075808, 0.00046462, 0.00076197, -0.00000113, 0.00000000],
++		[-6.27235300, -0.00075790, 0.00046451, 0.00076179, -0.00000113, 0.00000000],
++		[-6.27235345, -0.00075771, 0.00046440, 0.00076160, -0.00000113, 0.00000000],
++		[-6.27235390, -0.00075753, 0.00046428, 0.00076141, -0.00000113, 0.00000000],
++		[-6.27235435, -0.00075734, 0.00046417, 0.00076123, -0.00000113, 0.00000000],
++		[-6.27235480, -0.00075715, 0.00046405, 0.00076104, -0.00000113, 0.00000000],
++		[-6.27235525, -0.00075697, 0.00046394, 0.00076085, -0.00000113, 0.00000000],
++		[-6.27235570, -0.00075678, 0.00046383, 0.00076067, -0.00000113, 0.00000000],
++		[-6.27235615, -0.00075660, 0.00046371, 0.00076048, -0.00000113, 0.00000000],
++		[-6.27235660, -0.00075641, 0.00046360, 0.00076030, -0.00000113, 0.00000000],
++		[-6.27235705, -0.00075623, 0.00046349, 0.00076011, -0.00000113, 0.00000000],
++		[-6.27235750, -0.00075605, 0.00046337, 0.00075992, -0.00000113, 0.00000000],
++		[-6.27235795, -0.00075586, 0.00046326, 0.00075974, -0.00000113, 0.00000000],
++		[-6.27235840, -0.00075568, 0.00046315, 0.00075955, -0.00000113, 0.00000000],
++		[-6.27235884, -0.00075549, 0.00046303, 0.00075937, -0.00000113, 0.00000000],
++		[-6.27235929, -0.00075531, 0.00046292, 0.00075918, -0.00000113, 0.00000000],
++		[-6.27235974, -0.00075512, 0.00046281, 0.00075900, -0.00000113, 0.00000000],
++		[-6.27236019, -0.00075494, 0.00046269, 0.00075881, -0.00000113, 0.00000000],
++		[-6.27236063, -0.00075475, 0.00046258, 0.00075863, -0.00000113, 0.00000000],
++		[-6.27236108, -0.00075457, 0.00046247, 0.00075844, -0.00000113, 0.00000000],
++		[-6.27236153, -0.00075439, 0.00046236, 0.00075826, -0.00000113, 0.00000000],
++		[-6.27236197, -0.00075420, 0.00046224, 0.00075807, -0.00000113, 0.00000000],
++		[-6.27236242, -0.00075402, 0.00046213, 0.00075789, -0.00000113, 0.00000000],
++		[-6.27236287, -0.00075384, 0.00046202, 0.00075770, -0.00000113, 0.00000000],
++		[-6.27236331, -0.00075365, 0.00046191, 0.00075752, -0.00000113, 0.00000000],
++		[-6.27236376, -0.00075347, 0.00046179, 0.00075733, -0.00000113, 0.00000000],
++		[-6.27236420, -0.00075329, 0.00046168, 0.00075715, -0.00000113, 0.00000000],
++		[-6.27236465, -0.00075310, 0.00046157, 0.00075697, -0.00000113, 0.00000000],
++		[-6.27236509, -0.00075292, 0.00046146, 0.00075678, -0.00000113, 0.00000000],
++		[-6.27236554, -0.00075274, 0.00046134, 0.00075660, -0.00000113, 0.00000000],
++		[-6.27236598, -0.00075255, 0.00046123, 0.00075641, -0.00000113, 0.00000000],
++		[-6.27236643, -0.00075237, 0.00046112, 0.00075623, -0.00000113, 0.00000000],
++		[-6.27236687, -0.00075219, 0.00046101, 0.00075605, -0.00000113, 0.00000000],
++		[-6.27236731, -0.00075200, 0.00046089, 0.00075586, -0.00000113, 0.00000000],
++		[-6.27236776, -0.00075182, 0.00046078, 0.00075568, -0.00000113, 0.00000000],
++		[-6.27236820, -0.00075164, 0.00046067, 0.00075550, -0.00000113, 0.00000000],
++		[-6.27236864, -0.00075146, 0.00046056, 0.00075531, -0.00000113, 0.00000000],
++		[-6.27236909, -0.00075127, 0.00046045, 0.00075513, -0.00000113, 0.00000000],
++		[-6.27236953, -0.00075109, 0.00046034, 0.00075495, -0.00000113, 0.00000000],
++		[-6.27236997, -0.00075091, 0.00046022, 0.00075476, -0.00000113, 0.00000000],
++		[-6.27237041, -0.00075073, 0.00046011, 0.00075458, -0.00000113, 0.00000000],
++		[-6.27237085, -0.00075055, 0.00046000, 0.00075440, -0.00000113, 0.00000000],
++		[-6.27237130, -0.00075036, 0.00045989, 0.00075421, -0.00000113, 0.00000000],
++		[-6.27237174, -0.00075018, 0.00045978, 0.00075403, -0.00000113, 0.00000000],
++		[-6.27237218, -0.00075000, 0.00045967, 0.00075385, -0.00000113, 0.00000000],
++		[-6.27237262, -0.00074982, 0.00045955, 0.00075366, -0.00000113, 0.00000000],
++		[-6.27237306, -0.00074964, 0.00045944, 0.00075348, -0.00000113, 0.00000000],
++		[-6.27237350, -0.00074946, 0.00045933, 0.00075330, -0.00000113, 0.00000000],
++		[-6.27237394, -0.00074927, 0.00045922, 0.00075312, -0.00000113, 0.00000000],
++		[-6.27237438, -0.00074909, 0.00045911, 0.00075294, -0.00000113, 0.00000000],
++		[-6.27237482, -0.00074891, 0.00045900, 0.00075275, -0.00000113, 0.00000000],
++		[-6.27237526, -0.00074873, 0.00045889, 0.00075257, -0.00000113, 0.00000000],
++		[-6.27237570, -0.00074855, 0.00045878, 0.00075239, -0.00000113, 0.00000000],
++		[-6.27237614, -0.00074837, 0.00045866, 0.00075221, -0.00000113, 0.00000000],
++		[-6.27237657, -0.00074819, 0.00045855, 0.00075203, -0.00000113, 0.00000000],
++		[-6.27237701, -0.00074801, 0.00045844, 0.00075184, -0.00000113, 0.00000000],
++		[-6.27237745, -0.00074783, 0.00045833, 0.00075166, -0.00000113, 0.00000000],
++		[-6.27237789, -0.00074765, 0.00045822, 0.00075148, -0.00000113, 0.00000000],
++		[-6.27237833, -0.00074747, 0.00045811, 0.00075130, -0.00000113, 0.00000000],
++		[-6.27237876, -0.00074728, 0.00045800, 0.00075112, -0.00000113, 0.00000000],
++		[-6.27237920, -0.00074710, 0.00045789, 0.00075094, -0.00000113, 0.00000000],
++		[-6.27237964, -0.00074692, 0.00045778, 0.00075075, -0.00000113, 0.00000000],
++		[-6.27238007, -0.00074674, 0.00045767, 0.00075057, -0.00000113, 0.00000000],
++		[-6.27238051, -0.00074656, 0.00045756, 0.00075039, -0.00000113, 0.00000000],
++		[-6.27238095, -0.00074638, 0.00045745, 0.00075021, -0.00000113, 0.00000000],
++		[-6.27238138, -0.00074620, 0.00045734, 0.00075003, -0.00000113, 0.00000000],
++		[-6.27238182, -0.00074602, 0.00045723, 0.00074985, -0.00000113, 0.00000000],
++		[-6.27238225, -0.00074584, 0.00045712, 0.00074967, -0.00000113, 0.00000000],
++		[-6.27238269, -0.00074566, 0.00045701, 0.00074949, -0.00000113, 0.00000000],
++		[-6.27238312, -0.00074548, 0.00045690, 0.00074931, -0.00000113, 0.00000000],
++		[-6.27238356, -0.00074531, 0.00045679, 0.00074913, -0.00000113, 0.00000000],
++		[-6.27238399, -0.00074513, 0.00045668, 0.00074895, -0.00000113, 0.00000000],
++		[-6.27238443, -0.00074495, 0.00045657, 0.00074877, -0.00000113, 0.00000000],
++		[-6.27238486, -0.00074477, 0.00045646, 0.00074859, -0.00000113, 0.00000000],
++		[-6.27238530, -0.00074459, 0.00045635, 0.00074841, -0.00000113, 0.00000000],
++		[-6.27238573, -0.00074441, 0.00045624, 0.00074823, -0.00000113, 0.00000000],
++		[-6.27238616, -0.00074423, 0.00045613, 0.00074805, -0.00000113, 0.00000000],
++		[-6.27238660, -0.00074405, 0.00045602, 0.00074787, -0.00000113, 0.00000000],
++		[-6.27238703, -0.00074387, 0.00045591, 0.00074769, -0.00000113, 0.00000000],
++		[-6.27238746, -0.00074369, 0.00045580, 0.00074751, -0.00000113, 0.00000000],
++		[-6.27238790, -0.00074352, 0.00045569, 0.00074733, -0.00000113, 0.00000000],
++		[-6.27238833, -0.00074334, 0.00045558, 0.00074715, -0.00000113, 0.00000000],
++		[-6.27238876, -0.00074316, 0.00045547, 0.00074697, -0.00000113, 0.00000000],
++		[-6.27238919, -0.00074298, 0.00045536, 0.00074679, -0.00000113, 0.00000000],
++		[-6.27238962, -0.00074280, 0.00045525, 0.00074661, -0.00000113, 0.00000000],
++		[-6.27239006, -0.00074262, 0.00045514, 0.00074643, -0.00000113, 0.00000000],
++		[-6.27239049, -0.00074245, 0.00045503, 0.00074625, -0.00000113, 0.00000000],
++		[-6.27239092, -0.00074227, 0.00045492, 0.00074607, -0.00000113, 0.00000000],
++		[-6.27239135, -0.00074209, 0.00045481, 0.00074589, -0.00000113, 0.00000000],
++		[-6.27239178, -0.00074191, 0.00045470, 0.00074572, -0.00000113, 0.00000000],
++		[-6.27239221, -0.00074173, 0.00045459, 0.00074554, -0.00000113, 0.00000000],
++		[-6.27239264, -0.00074156, 0.00045449, 0.00074536, -0.00000113, 0.00000000],
++		[-6.27239307, -0.00074138, 0.00045438, 0.00074518, -0.00000113, 0.00000000],
++		[-6.27239350, -0.00074120, 0.00045427, 0.00074500, -0.00000113, 0.00000000],
++		[-6.27239393, -0.00074102, 0.00045416, 0.00074482, -0.00000113, 0.00000000],
++		[-6.27239436, -0.00074085, 0.00045405, 0.00074464, -0.00000113, 0.00000000],
++		[-6.27239479, -0.00074067, 0.00045394, 0.00074447, -0.00000113, 0.00000000],
++		[-6.27239522, -0.00074049, 0.00045383, 0.00074429, -0.00000113, 0.00000000],
++		[-6.27239564, -0.00074031, 0.00045372, 0.00074411, -0.00000113, 0.00000000],
++		[-6.27239607, -0.00074014, 0.00045362, 0.00074393, -0.00000113, 0.00000000],
++		[-6.27239650, -0.00073996, 0.00045351, 0.00074375, -0.00000113, 0.00000000],
++		[-6.27239693, -0.00073978, 0.00045340, 0.00074358, -0.00000112, 0.00000000],
++		[-6.27239736, -0.00073961, 0.00045329, 0.00074340, -0.00000112, 0.00000000],
++		[-6.27239778, -0.00073943, 0.00045318, 0.00074322, -0.00000112, 0.00000000],
++		[-6.27239821, -0.00073925, 0.00045307, 0.00074304, -0.00000112, 0.00000000],
++		[-6.27239864, -0.00073908, 0.00045296, 0.00074287, -0.00000112, 0.00000000],
++		[-6.27239906, -0.00073890, 0.00045286, 0.00074269, -0.00000112, 0.00000000],
++		[-6.27239949, -0.00073872, 0.00045275, 0.00074251, -0.00000112, 0.00000000],
++		[-6.27239992, -0.00073855, 0.00045264, 0.00074233, -0.00000112, 0.00000000],
++		[-6.27240034, -0.00073837, 0.00045253, 0.00074216, -0.00000112, 0.00000000],
++		[-6.27240077, -0.00073820, 0.00045242, 0.00074198, -0.00000112, 0.00000000],
++		[-6.27240119, -0.00073802, 0.00045232, 0.00074180, -0.00000112, 0.00000000],
++		[-6.27240162, -0.00073784, 0.00045221, 0.00074163, -0.00000112, 0.00000000],
++		[-6.27240205, -0.00073767, 0.00045210, 0.00074145, -0.00000112, 0.00000000],
++		[-6.27240247, -0.00073749, 0.00045199, 0.00074127, -0.00000112, 0.00000000],
++		[-6.27240289, -0.00073732, 0.00045188, 0.00074110, -0.00000112, 0.00000000],
++		[-6.27240332, -0.00073714, 0.00045178, 0.00074092, -0.00000112, 0.00000000],
++		[-6.27240374, -0.00073697, 0.00045167, 0.00074074, -0.00000112, 0.00000000],
++		[-6.27240417, -0.00073679, 0.00045156, 0.00074057, -0.00000112, 0.00000000],
++		[-6.27240459, -0.00073662, 0.00045145, 0.00074039, -0.00000112, 0.00000000],
++		[-6.27240502, -0.00073644, 0.00045135, 0.00074022, -0.00000112, 0.00000000],
++		[-6.27240544, -0.00073626, 0.00045124, 0.00074004, -0.00000112, 0.00000000],
++		[-6.27240586, -0.00073609, 0.00045113, 0.00073986, -0.00000112, 0.00000000],
++		[-6.27240628, -0.00073591, 0.00045102, 0.00073969, -0.00000112, 0.00000000],
++		[-6.27240671, -0.00073574, 0.00045092, 0.00073951, -0.00000112, 0.00000000],
++		[-6.27240713, -0.00073556, 0.00045081, 0.00073934, -0.00000112, 0.00000000],
++		[-6.27240755, -0.00073539, 0.00045070, 0.00073916, -0.00000112, 0.00000000],
++		[-6.27240797, -0.00073522, 0.00045060, 0.00073898, -0.00000112, 0.00000000],
++		[-6.27240840, -0.00073504, 0.00045049, 0.00073881, -0.00000112, 0.00000000],
++		[-6.27240882, -0.00073487, 0.00045038, 0.00073863, -0.00000112, 0.00000000],
++		[-6.27240924, -0.00073469, 0.00045027, 0.00073846, -0.00000112, 0.00000000],
++		[-6.27240966, -0.00073452, 0.00045017, 0.00073828, -0.00000112, 0.00000000],
++		[-6.27241008, -0.00073434, 0.00045006, 0.00073811, -0.00000112, 0.00000000],
++		[-6.27241050, -0.00073417, 0.00044995, 0.00073793, -0.00000112, 0.00000000],
++		[-6.27241092, -0.00073400, 0.00044985, 0.00073776, -0.00000112, 0.00000000],
++		[-6.27241134, -0.00073382, 0.00044974, 0.00073758, -0.00000112, 0.00000000],
++		[-6.27241176, -0.00073365, 0.00044963, 0.00073741, -0.00000112, 0.00000000],
++		[-6.27241218, -0.00073347, 0.00044953, 0.00073723, -0.00000112, 0.00000000],
++		[-6.27241260, -0.00073330, 0.00044942, 0.00073706, -0.00000112, 0.00000000],
++		[-6.27241302, -0.00073313, 0.00044931, 0.00073688, -0.00000112, 0.00000000],
++		[-6.27241344, -0.00073295, 0.00044921, 0.00073671, -0.00000112, 0.00000000],
++		[-6.27241386, -0.00073278, 0.00044910, 0.00073653, -0.00000112, 0.00000000],
++		[-6.27241428, -0.00073261, 0.00044899, 0.00073636, -0.00000112, 0.00000000],
++		[-6.27241470, -0.00073243, 0.00044889, 0.00073619, -0.00000112, 0.00000000],
++		[-6.27241512, -0.00073226, 0.00044878, 0.00073601, -0.00000112, 0.00000000],
++		[-6.27241554, -0.00073209, 0.00044868, 0.00073584, -0.00000112, 0.00000000],
++		[-6.27241595, -0.00073191, 0.00044857, 0.00073566, -0.00000112, 0.00000000],
++		[-6.27241637, -0.00073174, 0.00044846, 0.00073549, -0.00000112, 0.00000000],
++		[-6.27241679, -0.00073157, 0.00044836, 0.00073532, -0.00000112, 0.00000000],
++		[-6.27241721, -0.00073139, 0.00044825, 0.00073514, -0.00000112, 0.00000000],
++		[-6.27241762, -0.00073122, 0.00044815, 0.00073497, -0.00000112, 0.00000000],
++		[-6.27241804, -0.00073105, 0.00044804, 0.00073479, -0.00000112, 0.00000000],
++		[-6.27241846, -0.00073088, 0.00044793, 0.00073462, -0.00000112, 0.00000000],
++		[-6.27241887, -0.00073070, 0.00044783, 0.00073445, -0.00000112, 0.00000000],
++		[-6.27241929, -0.00073053, 0.00044772, 0.00073427, -0.00000112, 0.00000000],
++		[-6.27241971, -0.00073036, 0.00044762, 0.00073410, -0.00000112, 0.00000000],
++		[-6.27242012, -0.00073019, 0.00044751, 0.00073393, -0.00000112, 0.00000000],
++		[-6.27242054, -0.00073001, 0.00044741, 0.00073376, -0.00000112, 0.00000000],
++		[-6.27242095, -0.00072984, 0.00044730, 0.00073358, -0.00000112, 0.00000000],
++		[-6.27242137, -0.00072967, 0.00044719, 0.00073341, -0.00000112, 0.00000000],
++		[-6.27242178, -0.00072950, 0.00044709, 0.00073324, -0.00000112, 0.00000000],
++		[-6.27242220, -0.00072933, 0.00044698, 0.00073306, -0.00000112, 0.00000000],
++		[-6.27242261, -0.00072915, 0.00044688, 0.00073289, -0.00000112, 0.00000000],
++		[-6.27242303, -0.00072898, 0.00044677, 0.00073272, -0.00000112, 0.00000000],
++		[-6.27242344, -0.00072881, 0.00044667, 0.00073255, -0.00000112, 0.00000000],
++		[-6.27242386, -0.00072864, 0.00044656, 0.00073237, -0.00000112, 0.00000000],
++		[-6.27242427, -0.00072847, 0.00044646, 0.00073220, -0.00000112, 0.00000000],
++		[-6.27242468, -0.00072830, 0.00044635, 0.00073203, -0.00000112, 0.00000000],
++		[-6.27242510, -0.00072813, 0.00044625, 0.00073186, -0.00000112, 0.00000000],
++		[-6.27242551, -0.00072795, 0.00044614, 0.00073168, -0.00000112, 0.00000000],
++		[-6.27242592, -0.00072778, 0.00044604, 0.00073151, -0.00000112, 0.00000000],
++		[-6.27242634, -0.00072761, 0.00044593, 0.00073134, -0.00000112, 0.00000000],
++		[-6.27242675, -0.00072744, 0.00044583, 0.00073117, -0.00000112, 0.00000000],
++		[-6.27242716, -0.00072727, 0.00044572, 0.00073100, -0.00000112, 0.00000000],
++		[-6.27242757, -0.00072710, 0.00044562, 0.00073082, -0.00000112, 0.00000000],
++		[-6.27242798, -0.00072693, 0.00044551, 0.00073065, -0.00000112, 0.00000000],
++		[-6.27242840, -0.00072676, 0.00044541, 0.00073048, -0.00000112, 0.00000000],
++		[-6.27242881, -0.00072659, 0.00044530, 0.00073031, -0.00000112, 0.00000000],
++		[-6.27242922, -0.00072642, 0.00044520, 0.00073014, -0.00000112, 0.00000000],
++		[-6.27242963, -0.00072625, 0.00044509, 0.00072997, -0.00000112, 0.00000000],
++		[-6.27243004, -0.00072608, 0.00044499, 0.00072980, -0.00000112, 0.00000000],
++		[-6.27243045, -0.00072591, 0.00044488, 0.00072962, -0.00000112, 0.00000000],
++		[-6.27243086, -0.00072574, 0.00044478, 0.00072945, -0.00000112, 0.00000000],
++		[-6.27243127, -0.00072557, 0.00044468, 0.00072928, -0.00000112, 0.00000000],
++		[-6.27243168, -0.00072540, 0.00044457, 0.00072911, -0.00000112, 0.00000000],
++		[-6.27243209, -0.00072523, 0.00044447, 0.00072894, -0.00000112, 0.00000000],
++		[-6.27243250, -0.00072506, 0.00044436, 0.00072877, -0.00000112, 0.00000000],
++		[-6.27243291, -0.00072489, 0.00044426, 0.00072860, -0.00000112, 0.00000000],
++		[-6.27243332, -0.00072472, 0.00044416, 0.00072843, -0.00000112, 0.00000000],
++		[-6.27243373, -0.00072455, 0.00044405, 0.00072826, -0.00000112, 0.00000000],
++		[-6.27243414, -0.00072438, 0.00044395, 0.00072809, -0.00000112, 0.00000000],
++		[-6.27243455, -0.00072421, 0.00044384, 0.00072792, -0.00000112, 0.00000000],
++		[-6.27243496, -0.00072404, 0.00044374, 0.00072775, -0.00000112, 0.00000000],
++		[-6.27243536, -0.00072387, 0.00044364, 0.00072758, -0.00000112, 0.00000000],
++		[-6.27243577, -0.00072370, 0.00044353, 0.00072741, -0.00000112, 0.00000000],
++		[-6.27243618, -0.00072353, 0.00044343, 0.00072724, -0.00000112, 0.00000000],
++		[-6.27243659, -0.00072336, 0.00044332, 0.00072707, -0.00000112, 0.00000000],
++		[-6.27243700, -0.00072319, 0.00044322, 0.00072690, -0.00000112, 0.00000000],
++		[-6.27243740, -0.00072302, 0.00044312, 0.00072673, -0.00000112, 0.00000000],
++		[-6.27243781, -0.00072285, 0.00044301, 0.00072656, -0.00000112, 0.00000000],
++		[-6.27243822, -0.00072269, 0.00044291, 0.00072639, -0.00000112, 0.00000000],
++		[-6.27243862, -0.00072252, 0.00044281, 0.00072622, -0.00000112, 0.00000000],
++		[-6.27243903, -0.00072235, 0.00044270, 0.00072605, -0.00000112, 0.00000000],
++		[-6.27243944, -0.00072218, 0.00044260, 0.00072588, -0.00000112, 0.00000000],
++		[-6.27243984, -0.00072201, 0.00044250, 0.00072571, -0.00000112, 0.00000000],
++		[-6.27244025, -0.00072184, 0.00044239, 0.00072554, -0.00000112, 0.00000000],
++		[-6.27244065, -0.00072167, 0.00044229, 0.00072537, -0.00000112, 0.00000000],
++		[-6.27244106, -0.00072151, 0.00044219, 0.00072520, -0.00000112, 0.00000000],
++		[-6.27244146, -0.00072134, 0.00044208, 0.00072503, -0.00000112, 0.00000000],
++		[-6.27244187, -0.00072117, 0.00044198, 0.00072486, -0.00000112, 0.00000000],
++		[-6.27244227, -0.00072100, 0.00044188, 0.00072470, -0.00000112, 0.00000000],
++		[-6.27244268, -0.00072083, 0.00044177, 0.00072453, -0.00000112, 0.00000000],
++		[-6.27244308, -0.00072067, 0.00044167, 0.00072436, -0.00000112, 0.00000000],
++		[-6.27244349, -0.00072050, 0.00044157, 0.00072419, -0.00000112, 0.00000000],
++		[-6.27244389, -0.00072033, 0.00044147, 0.00072402, -0.00000112, 0.00000000],
++		[-6.27244429, -0.00072016, 0.00044136, 0.00072385, -0.00000112, 0.00000000],
++		[-6.27244470, -0.00072000, 0.00044126, 0.00072368, -0.00000112, 0.00000000],
++		[-6.27244510, -0.00071983, 0.00044116, 0.00072352, -0.00000112, 0.00000000],
++		[-6.27244550, -0.00071966, 0.00044105, 0.00072335, -0.00000112, 0.00000000],
++		[-6.27244591, -0.00071949, 0.00044095, 0.00072318, -0.00000112, 0.00000000],
++		[-6.27244631, -0.00071933, 0.00044085, 0.00072301, -0.00000112, 0.00000000],
++		[-6.27244671, -0.00071916, 0.00044075, 0.00072284, -0.00000112, 0.00000000],
++		[-6.27244712, -0.00071899, 0.00044064, 0.00072268, -0.00000112, 0.00000000],
++		[-6.27244752, -0.00071883, 0.00044054, 0.00072251, -0.00000112, 0.00000000],
++		[-6.27244792, -0.00071866, 0.00044044, 0.00072234, -0.00000112, 0.00000000],
++		[-6.27244832, -0.00071849, 0.00044034, 0.00072217, -0.00000112, 0.00000000],
++		[-6.27244872, -0.00071833, 0.00044024, 0.00072200, -0.00000112, 0.00000000],
++		[-6.27244912, -0.00071816, 0.00044013, 0.00072184, -0.00000112, 0.00000000],
++		[-6.27244953, -0.00071799, 0.00044003, 0.00072167, -0.00000112, 0.00000000],
++		[-6.27244993, -0.00071783, 0.00043993, 0.00072150, -0.00000112, 0.00000000],
++		[-6.27245033, -0.00071766, 0.00043983, 0.00072133, -0.00000112, 0.00000000],
++		[-6.27245073, -0.00071749, 0.00043972, 0.00072117, -0.00000112, 0.00000000],
++		[-6.27245113, -0.00071733, 0.00043962, 0.00072100, -0.00000112, 0.00000000],
++		[-6.27245153, -0.00071716, 0.00043952, 0.00072083, -0.00000112, 0.00000000],
++		[-6.27245193, -0.00071699, 0.00043942, 0.00072067, -0.00000112, 0.00000000],
++		[-6.27245233, -0.00071683, 0.00043932, 0.00072050, -0.00000112, 0.00000000],
++		[-6.27245273, -0.00071666, 0.00043922, 0.00072033, -0.00000112, 0.00000000],
++		[-6.27245313, -0.00071650, 0.00043911, 0.00072017, -0.00000112, 0.00000000],
++		[-6.27245353, -0.00071633, 0.00043901, 0.00072000, -0.00000112, 0.00000000],
++		[-6.27245393, -0.00071617, 0.00043891, 0.00071983, -0.00000112, 0.00000000],
++		[-6.27245432, -0.00071600, 0.00043881, 0.00071967, -0.00000112, 0.00000000],
++		[-6.27245472, -0.00071583, 0.00043871, 0.00071950, -0.00000112, 0.00000000],
++		[-6.27245512, -0.00071567, 0.00043861, 0.00071933, -0.00000112, 0.00000000],
++		[-6.27245552, -0.00071550, 0.00043850, 0.00071917, -0.00000112, 0.00000000],
++		[-6.27245592, -0.00071534, 0.00043840, 0.00071900, -0.00000112, 0.00000000],
++		[-6.27245632, -0.00071517, 0.00043830, 0.00071883, -0.00000112, 0.00000000],
++		[-6.27245671, -0.00071501, 0.00043820, 0.00071867, -0.00000112, 0.00000000],
++		[-6.27245711, -0.00071484, 0.00043810, 0.00071850, -0.00000112, 0.00000000],
++		[-6.27245751, -0.00071468, 0.00043800, 0.00071834, -0.00000112, 0.00000000],
++		[-6.27245791, -0.00071451, 0.00043790, 0.00071817, -0.00000112, 0.00000000],
++		[-6.27245830, -0.00071435, 0.00043779, 0.00071800, -0.00000112, 0.00000000],
++		[-6.27245870, -0.00071418, 0.00043769, 0.00071784, -0.00000112, 0.00000000],
++		[-6.27245910, -0.00071402, 0.00043759, 0.00071767, -0.00000112, 0.00000000],
++		[-6.27245949, -0.00071385, 0.00043749, 0.00071751, -0.00000112, 0.00000000],
++		[-6.27245989, -0.00071369, 0.00043739, 0.00071734, -0.00000112, 0.00000000],
++		[-6.27246028, -0.00071352, 0.00043729, 0.00071718, -0.00000112, 0.00000000],
++		[-6.27246068, -0.00071336, 0.00043719, 0.00071701, -0.00000112, 0.00000000],
++		[-6.27246108, -0.00071320, 0.00043709, 0.00071685, -0.00000112, 0.00000000],
++		[-6.27246147, -0.00071303, 0.00043699, 0.00071668, -0.00000112, 0.00000000],
++		[-6.27246187, -0.00071287, 0.00043689, 0.00071652, -0.00000112, 0.00000000],
++		[-6.27246226, -0.00071270, 0.00043679, 0.00071635, -0.00000112, 0.00000000],
++		[-6.27246266, -0.00071254, 0.00043669, 0.00071619, -0.00000112, 0.00000000],
++		[-6.27246305, -0.00071237, 0.00043658, 0.00071602, -0.00000112, 0.00000000],
++		[-6.27246345, -0.00071221, 0.00043648, 0.00071586, -0.00000112, 0.00000000],
++		[-6.27246384, -0.00071205, 0.00043638, 0.00071569, -0.00000112, 0.00000000],
++		[-6.27246423, -0.00071188, 0.00043628, 0.00071553, -0.00000112, 0.00000000],
++		[-6.27246463, -0.00071172, 0.00043618, 0.00071536, -0.00000112, 0.00000000],
++		[-6.27246502, -0.00071156, 0.00043608, 0.00071520, -0.00000112, 0.00000000],
++		[-6.27246541, -0.00071139, 0.00043598, 0.00071503, -0.00000112, 0.00000000],
++		[-6.27246581, -0.00071123, 0.00043588, 0.00071487, -0.00000112, 0.00000000],
++		[-6.27246620, -0.00071107, 0.00043578, 0.00071471, -0.00000112, 0.00000000],
++		[-6.27246659, -0.00071090, 0.00043568, 0.00071454, -0.00000112, 0.00000000],
++		[-6.27246699, -0.00071074, 0.00043558, 0.00071438, -0.00000112, 0.00000000],
++		[-6.27246738, -0.00071058, 0.00043548, 0.00071421, -0.00000112, 0.00000000],
++		[-6.27246777, -0.00071041, 0.00043538, 0.00071405, -0.00000112, 0.00000000],
++		[-6.27246816, -0.00071025, 0.00043528, 0.00071389, -0.00000112, 0.00000000],
++		[-6.27246856, -0.00071009, 0.00043518, 0.00071372, -0.00000112, 0.00000000],
++		[-6.27246895, -0.00070992, 0.00043508, 0.00071356, -0.00000112, 0.00000000],
++		[-6.27246934, -0.00070976, 0.00043498, 0.00071339, -0.00000112, 0.00000000],
++		[-6.27246973, -0.00070960, 0.00043488, 0.00071323, -0.00000112, 0.00000000],
++		[-6.27247012, -0.00070944, 0.00043478, 0.00071307, -0.00000112, 0.00000000],
++		[-6.27247051, -0.00070927, 0.00043468, 0.00071290, -0.00000112, 0.00000000],
++		[-6.27247090, -0.00070911, 0.00043458, 0.00071274, -0.00000112, 0.00000000],
++		[-6.27247129, -0.00070895, 0.00043448, 0.00071258, -0.00000112, 0.00000000],
++		[-6.27247168, -0.00070879, 0.00043438, 0.00071241, -0.00000112, 0.00000000],
++		[-6.27247207, -0.00070862, 0.00043428, 0.00071225, -0.00000112, 0.00000000],
++		[-6.27247246, -0.00070846, 0.00043418, 0.00071209, -0.00000112, 0.00000000],
++		[-6.27247285, -0.00070830, 0.00043409, 0.00071193, -0.00000112, 0.00000000],
++		[-6.27247324, -0.00070814, 0.00043399, 0.00071176, -0.00000112, 0.00000000],
++		[-6.27247363, -0.00070798, 0.00043389, 0.00071160, -0.00000112, 0.00000000],
++		[-6.27247402, -0.00070781, 0.00043379, 0.00071144, -0.00000112, 0.00000000],
++		[-6.27247441, -0.00070765, 0.00043369, 0.00071127, -0.00000112, 0.00000000],
++		[-6.27247480, -0.00070749, 0.00043359, 0.00071111, -0.00000112, 0.00000000],
++		[-6.27247519, -0.00070733, 0.00043349, 0.00071095, -0.00000112, 0.00000000],
++		[-6.27247558, -0.00070717, 0.00043339, 0.00071079, -0.00000112, 0.00000000],
++		[-6.27247597, -0.00070701, 0.00043329, 0.00071062, -0.00000112, 0.00000000],
++		[-6.27247636, -0.00070684, 0.00043319, 0.00071046, -0.00000112, 0.00000000],
++		[-6.27247674, -0.00070668, 0.00043309, 0.00071030, -0.00000112, 0.00000000],
++		[-6.27247713, -0.00070652, 0.00043299, 0.00071014, -0.00000112, 0.00000000],
++		[-6.27247752, -0.00070636, 0.00043290, 0.00070998, -0.00000112, 0.00000000],
++		[-6.27247791, -0.00070620, 0.00043280, 0.00070981, -0.00000112, 0.00000000],
++		[-6.27247829, -0.00070604, 0.00043270, 0.00070965, -0.00000112, 0.00000000],
++		[-6.27247868, -0.00070588, 0.00043260, 0.00070949, -0.00000112, 0.00000000],
++		[-6.27247907, -0.00070572, 0.00043250, 0.00070933, -0.00000112, 0.00000000],
++		[-6.27247945, -0.00070556, 0.00043240, 0.00070917, -0.00000112, 0.00000000],
++		[-6.27247984, -0.00070539, 0.00043230, 0.00070900, -0.00000112, 0.00000000],
++		[-6.27248023, -0.00070523, 0.00043220, 0.00070884, -0.00000112, 0.00000000],
++		[-6.27248061, -0.00070507, 0.00043211, 0.00070868, -0.00000112, 0.00000000],
++		[-6.27248100, -0.00070491, 0.00043201, 0.00070852, -0.00000112, 0.00000000],
++		[-6.27248139, -0.00070475, 0.00043191, 0.00070836, -0.00000112, 0.00000000],
++		[-6.27248177, -0.00070459, 0.00043181, 0.00070820, -0.00000112, 0.00000000],
++		[-6.27248216, -0.00070443, 0.00043171, 0.00070804, -0.00000112, 0.00000000],
++		[-6.27248254, -0.00070427, 0.00043161, 0.00070788, -0.00000112, 0.00000000],
++		[-6.27248293, -0.00070411, 0.00043152, 0.00070771, -0.00000112, 0.00000000],
++		[-6.27248331, -0.00070395, 0.00043142, 0.00070755, -0.00000112, 0.00000000],
++		[-6.27248370, -0.00070379, 0.00043132, 0.00070739, -0.00000112, 0.00000000],
++		[-6.27248408, -0.00070363, 0.00043122, 0.00070723, -0.00000112, 0.00000000],
++		[-6.27248447, -0.00070347, 0.00043112, 0.00070707, -0.00000112, 0.00000000],
++		[-6.27248485, -0.00070331, 0.00043103, 0.00070691, -0.00000112, 0.00000000],
++		[-6.27248523, -0.00070315, 0.00043093, 0.00070675, -0.00000112, 0.00000000],
++		[-6.27248562, -0.00070299, 0.00043083, 0.00070659, -0.00000112, 0.00000000],
++		[-6.27248600, -0.00070283, 0.00043073, 0.00070643, -0.00000112, 0.00000000],
++		[-6.27248638, -0.00070267, 0.00043063, 0.00070627, -0.00000112, 0.00000000],
++		[-6.27248677, -0.00070251, 0.00043054, 0.00070611, -0.00000112, 0.00000000],
++		[-6.27248715, -0.00070235, 0.00043044, 0.00070595, -0.00000112, 0.00000000],
++		[-6.27248753, -0.00070219, 0.00043034, 0.00070579, -0.00000112, 0.00000000],
++		[-6.27248792, -0.00070203, 0.00043024, 0.00070563, -0.00000112, 0.00000000],
++		[-6.27248830, -0.00070188, 0.00043014, 0.00070547, -0.00000112, 0.00000000],
++		[-6.27248868, -0.00070172, 0.00043005, 0.00070531, -0.00000112, 0.00000000],
++		[-6.27248906, -0.00070156, 0.00042995, 0.00070515, -0.00000112, 0.00000000],
++		[-6.27248945, -0.00070140, 0.00042985, 0.00070499, -0.00000112, 0.00000000],
++		[-6.27248983, -0.00070124, 0.00042975, 0.00070483, -0.00000112, 0.00000000],
++		[-6.27249021, -0.00070108, 0.00042966, 0.00070467, -0.00000112, 0.00000000],
++		[-6.27249059, -0.00070092, 0.00042956, 0.00070451, -0.00000112, 0.00000000],
++		[-6.27249097, -0.00070076, 0.00042946, 0.00070435, -0.00000112, 0.00000000],
++		[-6.27249135, -0.00070060, 0.00042937, 0.00070419, -0.00000112, 0.00000000],
++		[-6.27249173, -0.00070045, 0.00042927, 0.00070403, -0.00000112, 0.00000000],
++		[-6.27249211, -0.00070029, 0.00042917, 0.00070387, -0.00000112, 0.00000000],
++		[-6.27249250, -0.00070013, 0.00042907, 0.00070371, -0.00000112, 0.00000000],
++		[-6.27249288, -0.00069997, 0.00042898, 0.00070355, -0.00000112, 0.00000000],
++		[-6.27249326, -0.00069981, 0.00042888, 0.00070339, -0.00000112, 0.00000000],
++		[-6.27249364, -0.00069965, 0.00042878, 0.00070323, -0.00000112, 0.00000000],
++		[-6.27249402, -0.00069950, 0.00042869, 0.00070308, -0.00000112, 0.00000000],
++		[-6.27249440, -0.00069934, 0.00042859, 0.00070292, -0.00000112, 0.00000000],
++		[-6.27249477, -0.00069918, 0.00042849, 0.00070276, -0.00000112, 0.00000000],
++		[-6.27249515, -0.00069902, 0.00042840, 0.00070260, -0.00000112, 0.00000000],
++		[-6.27249553, -0.00069887, 0.00042830, 0.00070244, -0.00000112, 0.00000000],
++		[-6.27249591, -0.00069871, 0.00042820, 0.00070228, -0.00000112, 0.00000000],
++		[-6.27249629, -0.00069855, 0.00042810, 0.00070212, -0.00000112, 0.00000000],
++		[-6.27249667, -0.00069839, 0.00042801, 0.00070197, -0.00000112, 0.00000000],
++		[-6.27249705, -0.00069823, 0.00042791, 0.00070181, -0.00000112, 0.00000000],
++		[-6.27249743, -0.00069808, 0.00042781, 0.00070165, -0.00000112, 0.00000000],
++		[-6.27249780, -0.00069792, 0.00042772, 0.00070149, -0.00000112, 0.00000000],
++		[-6.27249818, -0.00069776, 0.00042762, 0.00070133, -0.00000112, 0.00000000],
++		[-6.27249856, -0.00069761, 0.00042753, 0.00070117, -0.00000112, 0.00000000],
++		[-6.27249894, -0.00069745, 0.00042743, 0.00070102, -0.00000112, 0.00000000],
++		[-6.27249931, -0.00069729, 0.00042733, 0.00070086, -0.00000112, 0.00000000],
++		[-6.27249969, -0.00069713, 0.00042724, 0.00070070, -0.00000112, 0.00000000],
++		[-6.27250007, -0.00069698, 0.00042714, 0.00070054, -0.00000112, 0.00000000],
++		[-6.27250045, -0.00069682, 0.00042704, 0.00070038, -0.00000112, 0.00000000],
++		[-6.27250082, -0.00069666, 0.00042695, 0.00070023, -0.00000112, 0.00000000],
++		[-6.27250120, -0.00069651, 0.00042685, 0.00070007, -0.00000112, 0.00000000],
++		[-6.27250158, -0.00069635, 0.00042676, 0.00069991, -0.00000112, 0.00000000],
++		[-6.27250195, -0.00069619, 0.00042666, 0.00069975, -0.00000112, 0.00000000],
++		[-6.27250233, -0.00069604, 0.00042656, 0.00069960, -0.00000112, 0.00000000],
++		[-6.27250270, -0.00069588, 0.00042647, 0.00069944, -0.00000112, 0.00000000],
++		[-6.27250308, -0.00069572, 0.00042637, 0.00069928, -0.00000112, 0.00000000],
++		[-6.27250345, -0.00069557, 0.00042628, 0.00069913, -0.00000112, 0.00000000],
++		[-6.27250383, -0.00069541, 0.00042618, 0.00069897, -0.00000112, 0.00000000],
++		[-6.27250420, -0.00069525, 0.00042608, 0.00069881, -0.00000112, 0.00000000],
++		[-6.27250458, -0.00069510, 0.00042599, 0.00069865, -0.00000112, 0.00000000],
++		[-6.27250495, -0.00069494, 0.00042589, 0.00069850, -0.00000112, 0.00000000],
++		[-6.27250533, -0.00069479, 0.00042580, 0.00069834, -0.00000112, 0.00000000],
++		[-6.27250570, -0.00069463, 0.00042570, 0.00069818, -0.00000112, 0.00000000],
++		[-6.27250608, -0.00069447, 0.00042561, 0.00069803, -0.00000112, 0.00000000],
++		[-6.27250645, -0.00069432, 0.00042551, 0.00069787, -0.00000112, 0.00000000],
++		[-6.27250683, -0.00069416, 0.00042541, 0.00069771, -0.00000112, 0.00000000],
++		[-6.27250720, -0.00069401, 0.00042532, 0.00069756, -0.00000112, 0.00000000],
++		[-6.27250757, -0.00069385, 0.00042522, 0.00069740, -0.00000112, 0.00000000],
++		[-6.27250795, -0.00069370, 0.00042513, 0.00069725, -0.00000112, 0.00000000],
++		[-6.27250832, -0.00069354, 0.00042503, 0.00069709, -0.00000112, 0.00000000],
++		[-6.27250869, -0.00069339, 0.00042494, 0.00069693, -0.00000112, 0.00000000],
++		[-6.27250906, -0.00069323, 0.00042484, 0.00069678, -0.00000112, 0.00000000],
++		[-6.27250944, -0.00069308, 0.00042475, 0.00069662, -0.00000112, 0.00000000],
++		[-6.27250981, -0.00069292, 0.00042465, 0.00069646, -0.00000112, 0.00000000],
++		[-6.27251018, -0.00069277, 0.00042456, 0.00069631, -0.00000112, 0.00000000],
++		[-6.27251055, -0.00069261, 0.00042446, 0.00069615, -0.00000112, 0.00000000],
++		[-6.27251093, -0.00069246, 0.00042437, 0.00069600, -0.00000112, 0.00000000],
++		[-6.27251130, -0.00069230, 0.00042427, 0.00069584, -0.00000112, 0.00000000],
++		[-6.27251167, -0.00069215, 0.00042418, 0.00069569, -0.00000112, 0.00000000],
++		[-6.27251204, -0.00069199, 0.00042408, 0.00069553, -0.00000112, 0.00000000],
++		[-6.27251241, -0.00069184, 0.00042399, 0.00069537, -0.00000112, 0.00000000],
++		[-6.27251278, -0.00069168, 0.00042389, 0.00069522, -0.00000112, 0.00000000],
++		[-6.27251315, -0.00069153, 0.00042380, 0.00069506, -0.00000112, 0.00000000],
++		[-6.27251353, -0.00069137, 0.00042370, 0.00069491, -0.00000112, 0.00000000],
++		[-6.27251390, -0.00069122, 0.00042361, 0.00069475, -0.00000112, 0.00000000],
++		[-6.27251427, -0.00069106, 0.00042351, 0.00069460, -0.00000112, 0.00000000],
++		[-6.27251464, -0.00069091, 0.00042342, 0.00069444, -0.00000112, 0.00000000],
++		[-6.27251501, -0.00069076, 0.00042332, 0.00069429, -0.00000112, 0.00000000],
++		[-6.27251538, -0.00069060, 0.00042323, 0.00069413, -0.00000112, 0.00000000],
++		[-6.27251575, -0.00069045, 0.00042314, 0.00069398, -0.00000112, 0.00000000],
++		[-6.27251612, -0.00069029, 0.00042304, 0.00069382, -0.00000112, 0.00000000],
++		[-6.27251649, -0.00069014, 0.00042295, 0.00069367, -0.00000112, 0.00000000],
++		[-6.27251685, -0.00068999, 0.00042285, 0.00069351, -0.00000112, 0.00000000],
++		[-6.27251722, -0.00068983, 0.00042276, 0.00069336, -0.00000112, 0.00000000],
++		[-6.27251759, -0.00068968, 0.00042266, 0.00069321, -0.00000112, 0.00000000],
++		[-6.27251796, -0.00068952, 0.00042257, 0.00069305, -0.00000112, 0.00000000],
++		[-6.27251833, -0.00068937, 0.00042248, 0.00069290, -0.00000112, 0.00000000],
++		[-6.27251870, -0.00068922, 0.00042238, 0.00069274, -0.00000112, 0.00000000],
++		[-6.27251907, -0.00068906, 0.00042229, 0.00069259, -0.00000112, 0.00000000],
++		[-6.27251943, -0.00068891, 0.00042219, 0.00069243, -0.00000112, 0.00000000],
++		[-6.27251980, -0.00068876, 0.00042210, 0.00069228, -0.00000112, 0.00000000],
++		[-6.27252017, -0.00068860, 0.00042200, 0.00069213, -0.00000112, 0.00000000],
++		[-6.27252054, -0.00068845, 0.00042191, 0.00069197, -0.00000112, 0.00000000],
++		[-6.27252091, -0.00068830, 0.00042182, 0.00069182, -0.00000112, 0.00000000],
++		[-6.27252127, -0.00068815, 0.00042172, 0.00069166, -0.00000112, 0.00000000],
++		[-6.27252164, -0.00068799, 0.00042163, 0.00069151, -0.00000112, 0.00000000],
++		[-6.27252201, -0.00068784, 0.00042154, 0.00069136, -0.00000112, 0.00000000],
++		[-6.27252237, -0.00068769, 0.00042144, 0.00069120, -0.00000112, 0.00000000],
++		[-6.27252274, -0.00068753, 0.00042135, 0.00069105, -0.00000112, 0.00000000],
++		[-6.27252311, -0.00068738, 0.00042125, 0.00069090, -0.00000112, 0.00000000],
++		[-6.27252347, -0.00068723, 0.00042116, 0.00069074, -0.00000112, 0.00000000],
++		[-6.27252384, -0.00068708, 0.00042107, 0.00069059, -0.00000112, 0.00000000],
++		[-6.27252420, -0.00068692, 0.00042097, 0.00069044, -0.00000112, 0.00000000],
++		[-6.27252457, -0.00068677, 0.00042088, 0.00069028, -0.00000112, 0.00000000],
++		[-6.27252494, -0.00068662, 0.00042079, 0.00069013, -0.00000112, 0.00000000],
++		[-6.27252530, -0.00068647, 0.00042069, 0.00068998, -0.00000112, 0.00000000],
++		[-6.27252567, -0.00068631, 0.00042060, 0.00068982, -0.00000112, 0.00000000],
++		[-6.27252603, -0.00068616, 0.00042051, 0.00068967, -0.00000112, 0.00000000],
++		[-6.27252640, -0.00068601, 0.00042041, 0.00068952, -0.00000112, 0.00000000],
++		[-6.27252676, -0.00068586, 0.00042032, 0.00068937, -0.00000112, 0.00000000],
++		[-6.27252712, -0.00068571, 0.00042023, 0.00068921, -0.00000112, 0.00000000],
++		[-6.27252749, -0.00068555, 0.00042013, 0.00068906, -0.00000112, 0.00000000],
++		[-6.27252785, -0.00068540, 0.00042004, 0.00068891, -0.00000112, 0.00000000],
++		[-6.27252822, -0.00068525, 0.00041995, 0.00068875, -0.00000112, 0.00000000],
++		[-6.27252858, -0.00068510, 0.00041985, 0.00068860, -0.00000112, 0.00000000],
++		[-6.27252895, -0.00068495, 0.00041976, 0.00068845, -0.00000112, 0.00000000],
++		[-6.27252931, -0.00068480, 0.00041967, 0.00068830, -0.00000112, 0.00000000],
++		[-6.27252967, -0.00068464, 0.00041958, 0.00068815, -0.00000112, 0.00000000],
++		[-6.27253004, -0.00068449, 0.00041948, 0.00068799, -0.00000112, 0.00000000],
++		[-6.27253040, -0.00068434, 0.00041939, 0.00068784, -0.00000112, 0.00000000],
++		[-6.27253076, -0.00068419, 0.00041930, 0.00068769, -0.00000112, 0.00000000],
++		[-6.27253112, -0.00068404, 0.00041920, 0.00068754, -0.00000112, 0.00000000],
++		[-6.27253149, -0.00068389, 0.00041911, 0.00068738, -0.00000112, 0.00000000],
++		[-6.27253185, -0.00068374, 0.00041902, 0.00068723, -0.00000112, 0.00000000],
++		[-6.27253221, -0.00068359, 0.00041893, 0.00068708, -0.00000112, 0.00000000],
++		[-6.27253257, -0.00068344, 0.00041883, 0.00068693, -0.00000112, 0.00000000],
++		[-6.27253293, -0.00068328, 0.00041874, 0.00068678, -0.00000112, 0.00000000],
++		[-6.27253330, -0.00068313, 0.00041865, 0.00068663, -0.00000112, 0.00000000],
++		[-6.27253366, -0.00068298, 0.00041856, 0.00068647, -0.00000112, 0.00000000],
++		[-6.27253402, -0.00068283, 0.00041846, 0.00068632, -0.00000112, 0.00000000],
++		[-6.27253438, -0.00068268, 0.00041837, 0.00068617, -0.00000112, 0.00000000],
++		[-6.27253474, -0.00068253, 0.00041828, 0.00068602, -0.00000112, 0.00000000],
++		[-6.27253510, -0.00068238, 0.00041819, 0.00068587, -0.00000112, 0.00000000],
++		[-6.27253546, -0.00068223, 0.00041810, 0.00068572, -0.00000112, 0.00000000],
++		[-6.27253582, -0.00068208, 0.00041800, 0.00068557, -0.00000112, 0.00000000],
++		[-6.27253618, -0.00068193, 0.00041791, 0.00068542, -0.00000112, 0.00000000],
++		[-6.27253654, -0.00068178, 0.00041782, 0.00068526, -0.00000112, 0.00000000],
++		[-6.27253690, -0.00068163, 0.00041773, 0.00068511, -0.00000112, 0.00000000],
++		[-6.27253726, -0.00068148, 0.00041763, 0.00068496, -0.00000112, 0.00000000],
++		[-6.27253762, -0.00068133, 0.00041754, 0.00068481, -0.00000112, 0.00000000],
++		[-6.27253798, -0.00068118, 0.00041745, 0.00068466, -0.00000112, 0.00000000],
++		[-6.27253834, -0.00068103, 0.00041736, 0.00068451, -0.00000112, 0.00000000],
++		[-6.27253870, -0.00068088, 0.00041727, 0.00068436, -0.00000112, 0.00000000],
++		[-6.27253906, -0.00068073, 0.00041718, 0.00068421, -0.00000112, 0.00000000],
++		[-6.27253942, -0.00068058, 0.00041708, 0.00068406, -0.00000112, 0.00000000],
++		[-6.27253978, -0.00068043, 0.00041699, 0.00068391, -0.00000112, 0.00000000],
++		[-6.27254014, -0.00068028, 0.00041690, 0.00068376, -0.00000112, 0.00000000],
++		[-6.27254050, -0.00068013, 0.00041681, 0.00068361, -0.00000112, 0.00000000],
++		[-6.27254086, -0.00067998, 0.00041672, 0.00068346, -0.00000112, 0.00000000],
++		[-6.27254121, -0.00067983, 0.00041662, 0.00068331, -0.00000112, 0.00000000],
++		[-6.27254157, -0.00067968, 0.00041653, 0.00068316, -0.00000112, 0.00000000],
++		[-6.27254193, -0.00067953, 0.00041644, 0.00068301, -0.00000112, 0.00000000],
++		[-6.27254229, -0.00067939, 0.00041635, 0.00068286, -0.00000112, 0.00000000],
++		[-6.27254264, -0.00067924, 0.00041626, 0.00068271, -0.00000112, 0.00000000],
++		[-6.27254300, -0.00067909, 0.00041617, 0.00068256, -0.00000112, 0.00000000],
++		[-6.27254336, -0.00067894, 0.00041608, 0.00068241, -0.00000112, 0.00000000],
++		[-6.27254372, -0.00067879, 0.00041598, 0.00068226, -0.00000112, 0.00000000],
++		[-6.27254407, -0.00067864, 0.00041589, 0.00068211, -0.00000112, 0.00000000],
++		[-6.27254443, -0.00067849, 0.00041580, 0.00068196, -0.00000112, 0.00000000],
++		[-6.27254479, -0.00067834, 0.00041571, 0.00068181, -0.00000112, 0.00000000],
++		[-6.27254514, -0.00067819, 0.00041562, 0.00068166, -0.00000112, 0.00000000],
++		[-6.27254550, -0.00067805, 0.00041553, 0.00068151, -0.00000112, 0.00000000],
++		[-6.27254585, -0.00067790, 0.00041544, 0.00068136, -0.00000112, 0.00000000],
++		[-6.27254621, -0.00067775, 0.00041535, 0.00068121, -0.00000112, 0.00000000],
++		[-6.27254657, -0.00067760, 0.00041526, 0.00068106, -0.00000112, 0.00000000],
++		[-6.27254692, -0.00067745, 0.00041516, 0.00068092, -0.00000112, 0.00000000],
++		[-6.27254728, -0.00067730, 0.00041507, 0.00068077, -0.00000112, 0.00000000],
++		[-6.27254763, -0.00067716, 0.00041498, 0.00068062, -0.00000112, 0.00000000],
++		[-6.27254799, -0.00067701, 0.00041489, 0.00068047, -0.00000112, 0.00000000],
++		[-6.27254834, -0.00067686, 0.00041480, 0.00068032, -0.00000112, 0.00000000],
++		[-6.27254870, -0.00067671, 0.00041471, 0.00068017, -0.00000112, 0.00000000],
++		[-6.27254905, -0.00067656, 0.00041462, 0.00068002, -0.00000112, 0.00000000],
++		[-6.27254941, -0.00067642, 0.00041453, 0.00067987, -0.00000112, 0.00000000],
++		[-6.27254976, -0.00067627, 0.00041444, 0.00067972, -0.00000112, 0.00000000],
++		[-6.27255012, -0.00067612, 0.00041435, 0.00067958, -0.00000112, 0.00000000],
++		[-6.27255047, -0.00067597, 0.00041426, 0.00067943, -0.00000112, 0.00000000],
++		[-6.27255082, -0.00067583, 0.00041417, 0.00067928, -0.00000112, 0.00000000],
++		[-6.27255118, -0.00067568, 0.00041408, 0.00067913, -0.00000112, 0.00000000],
++		[-6.27255153, -0.00067553, 0.00041399, 0.00067898, -0.00000112, 0.00000000],
++		[-6.27255188, -0.00067538, 0.00041390, 0.00067883, -0.00000112, 0.00000000],
++		[-6.27255224, -0.00067524, 0.00041381, 0.00067869, -0.00000112, 0.00000000],
++		[-6.27255259, -0.00067509, 0.00041372, 0.00067854, -0.00000112, 0.00000000],
++		[-6.27255294, -0.00067494, 0.00041362, 0.00067839, -0.00000112, 0.00000000],
++		[-6.27255330, -0.00067479, 0.00041353, 0.00067824, -0.00000112, 0.00000000],
++		[-6.27255365, -0.00067465, 0.00041344, 0.00067810, -0.00000112, 0.00000000],
++		[-6.27255400, -0.00067450, 0.00041335, 0.00067795, -0.00000112, 0.00000000],
++		[-6.27255435, -0.00067435, 0.00041326, 0.00067780, -0.00000112, 0.00000000],
++		[-6.27255470, -0.00067421, 0.00041317, 0.00067765, -0.00000112, 0.00000000],
++		[-6.27255506, -0.00067406, 0.00041308, 0.00067750, -0.00000112, 0.00000000],
++		[-6.27255541, -0.00067391, 0.00041299, 0.00067736, -0.00000112, 0.00000000],
++		[-6.27255576, -0.00067377, 0.00041290, 0.00067721, -0.00000112, 0.00000000],
++		[-6.27255611, -0.00067362, 0.00041281, 0.00067706, -0.00000112, 0.00000000],
++		[-6.27255646, -0.00067347, 0.00041272, 0.00067691, -0.00000112, 0.00000000],
++		[-6.27255681, -0.00067333, 0.00041263, 0.00067677, -0.00000112, 0.00000000],
++		[-6.27255717, -0.00067318, 0.00041254, 0.00067662, -0.00000112, 0.00000000],
++		[-6.27255752, -0.00067303, 0.00041245, 0.00067647, -0.00000112, 0.00000000],
++		[-6.27255787, -0.00067289, 0.00041236, 0.00067633, -0.00000112, 0.00000000],
++		[-6.27255822, -0.00067274, 0.00041228, 0.00067618, -0.00000112, 0.00000000],
++		[-6.27255857, -0.00067260, 0.00041219, 0.00067603, -0.00000112, 0.00000000],
++		[-6.27255892, -0.00067245, 0.00041210, 0.00067589, -0.00000112, 0.00000000],
++		[-6.27255927, -0.00067230, 0.00041201, 0.00067574, -0.00000112, 0.00000000],
++		[-6.27255962, -0.00067216, 0.00041192, 0.00067559, -0.00000112, 0.00000000],
++		[-6.27255997, -0.00067201, 0.00041183, 0.00067544, -0.00000112, 0.00000000],
++		[-6.27256032, -0.00067187, 0.00041174, 0.00067530, -0.00000112, 0.00000000],
++		[-6.27256067, -0.00067172, 0.00041165, 0.00067515, -0.00000112, 0.00000000],
++		[-6.27256102, -0.00067157, 0.00041156, 0.00067501, -0.00000112, 0.00000000],
++		[-6.27256137, -0.00067143, 0.00041147, 0.00067486, -0.00000112, 0.00000000],
++		[-6.27256171, -0.00067128, 0.00041138, 0.00067471, -0.00000112, 0.00000000],
++		[-6.27256206, -0.00067114, 0.00041129, 0.00067457, -0.00000112, 0.00000000],
++		[-6.27256241, -0.00067099, 0.00041120, 0.00067442, -0.00000112, 0.00000000],
++		[-6.27256276, -0.00067085, 0.00041111, 0.00067427, -0.00000112, 0.00000000],
++		[-6.27256311, -0.00067070, 0.00041102, 0.00067413, -0.00000112, 0.00000000],
++		[-6.27256346, -0.00067056, 0.00041093, 0.00067398, -0.00000112, 0.00000000],
++		[-6.27256381, -0.00067041, 0.00041085, 0.00067384, -0.00000112, 0.00000000],
++		[-6.27256415, -0.00067027, 0.00041076, 0.00067369, -0.00000112, 0.00000000],
++		[-6.27256450, -0.00067012, 0.00041067, 0.00067354, -0.00000112, 0.00000000],
++		[-6.27256485, -0.00066998, 0.00041058, 0.00067340, -0.00000112, 0.00000000],
++		[-6.27256520, -0.00066983, 0.00041049, 0.00067325, -0.00000112, 0.00000000],
++		[-6.27256554, -0.00066969, 0.00041040, 0.00067311, -0.00000112, 0.00000000],
++		[-6.27256589, -0.00066954, 0.00041031, 0.00067296, -0.00000112, 0.00000000],
++		[-6.27256624, -0.00066940, 0.00041022, 0.00067282, -0.00000112, 0.00000000],
++		[-6.27256658, -0.00066925, 0.00041013, 0.00067267, -0.00000112, 0.00000000],
++		[-6.27256693, -0.00066911, 0.00041005, 0.00067252, -0.00000112, 0.00000000],
++		[-6.27256728, -0.00066896, 0.00040996, 0.00067238, -0.00000112, 0.00000000],
++		[-6.27256762, -0.00066882, 0.00040987, 0.00067223, -0.00000112, 0.00000000],
++		[-6.27256797, -0.00066867, 0.00040978, 0.00067209, -0.00000112, 0.00000000],
++		[-6.27256832, -0.00066853, 0.00040969, 0.00067194, -0.00000112, 0.00000000],
++		[-6.27256866, -0.00066838, 0.00040960, 0.00067180, -0.00000112, 0.00000000],
++		[-6.27256901, -0.00066824, 0.00040951, 0.00067165, -0.00000112, 0.00000000],
++		[-6.27256935, -0.00066810, 0.00040943, 0.00067151, -0.00000112, 0.00000000],
++		[-6.27256970, -0.00066795, 0.00040934, 0.00067136, -0.00000112, 0.00000000],
++		[-6.27257004, -0.00066781, 0.00040925, 0.00067122, -0.00000112, 0.00000000],
++		[-6.27257039, -0.00066766, 0.00040916, 0.00067107, -0.00000112, 0.00000000],
++		[-6.27257073, -0.00066752, 0.00040907, 0.00067093, -0.00000112, 0.00000000],
++		[-6.27257108, -0.00066738, 0.00040898, 0.00067078, -0.00000112, 0.00000000],
++		[-6.27257142, -0.00066723, 0.00040890, 0.00067064, -0.00000112, 0.00000000],
++		[-6.27257177, -0.00066709, 0.00040881, 0.00067050, -0.00000112, 0.00000000],
++		[-6.27257211, -0.00066694, 0.00040872, 0.00067035, -0.00000112, 0.00000000],
++		[-6.27257246, -0.00066680, 0.00040863, 0.00067021, -0.00000112, 0.00000000],
++		[-6.27257280, -0.00066666, 0.00040854, 0.00067006, -0.00000112, 0.00000000],
++		[-6.27257315, -0.00066651, 0.00040846, 0.00066992, -0.00000112, 0.00000000],
++		[-6.27257349, -0.00066637, 0.00040837, 0.00066977, -0.00000112, 0.00000000],
++		[-6.27257383, -0.00066623, 0.00040828, 0.00066963, -0.00000112, 0.00000000],
++		[-6.27257418, -0.00066608, 0.00040819, 0.00066949, -0.00000112, 0.00000000],
++		[-6.27257452, -0.00066594, 0.00040810, 0.00066934, -0.00000112, 0.00000000],
++		[-6.27257486, -0.00066580, 0.00040802, 0.00066920, -0.00000112, 0.00000000],
++		[-6.27257521, -0.00066565, 0.00040793, 0.00066905, -0.00000112, 0.00000000],
++		[-6.27257555, -0.00066551, 0.00040784, 0.00066891, -0.00000112, 0.00000000],
++		[-6.27257589, -0.00066537, 0.00040775, 0.00066877, -0.00000112, 0.00000000],
++		[-6.27257623, -0.00066522, 0.00040766, 0.00066862, -0.00000112, 0.00000000],
++		[-6.27257658, -0.00066508, 0.00040758, 0.00066848, -0.00000112, 0.00000000],
++		[-6.27257692, -0.00066494, 0.00040749, 0.00066833, -0.00000112, 0.00000000],
++		[-6.27257726, -0.00066480, 0.00040740, 0.00066819, -0.00000112, 0.00000000],
++		[-6.27257760, -0.00066465, 0.00040731, 0.00066805, -0.00000112, 0.00000000],
++		[-6.27257795, -0.00066451, 0.00040723, 0.00066790, -0.00000112, 0.00000000],
++		[-6.27257829, -0.00066437, 0.00040714, 0.00066776, -0.00000112, 0.00000000],
++		[-6.27257863, -0.00066422, 0.00040705, 0.00066762, -0.00000112, 0.00000000],
++		[-6.27257897, -0.00066408, 0.00040696, 0.00066747, -0.00000112, 0.00000000],
++		[-6.27257931, -0.00066394, 0.00040688, 0.00066733, -0.00000112, 0.00000000],
++		[-6.27257965, -0.00066380, 0.00040679, 0.00066719, -0.00000112, 0.00000000],
++		[-6.27257999, -0.00066366, 0.00040670, 0.00066704, -0.00000112, 0.00000000],
++		[-6.27258033, -0.00066351, 0.00040662, 0.00066690, -0.00000112, 0.00000000],
++		[-6.27258068, -0.00066337, 0.00040653, 0.00066676, -0.00000112, 0.00000000],
++		[-6.27258102, -0.00066323, 0.00040644, 0.00066662, -0.00000112, 0.00000000],
++		[-6.27258136, -0.00066309, 0.00040635, 0.00066647, -0.00000112, 0.00000000],
++		[-6.27258170, -0.00066294, 0.00040627, 0.00066633, -0.00000112, 0.00000000],
++		[-6.27258204, -0.00066280, 0.00040618, 0.00066619, -0.00000112, 0.00000000],
++		[-6.27258238, -0.00066266, 0.00040609, 0.00066604, -0.00000112, 0.00000000],
++		[-6.27258272, -0.00066252, 0.00040601, 0.00066590, -0.00000112, 0.00000000],
++		[-6.27258306, -0.00066238, 0.00040592, 0.00066576, -0.00000112, 0.00000000],
++		[-6.27258340, -0.00066224, 0.00040583, 0.00066562, -0.00000112, 0.00000000],
++		[-6.27258373, -0.00066209, 0.00040574, 0.00066547, -0.00000112, 0.00000000],
++		[-6.27258407, -0.00066195, 0.00040566, 0.00066533, -0.00000112, 0.00000000],
++		[-6.27258441, -0.00066181, 0.00040557, 0.00066519, -0.00000112, 0.00000000],
++		[-6.27258475, -0.00066167, 0.00040548, 0.00066505, -0.00000112, 0.00000000],
++		[-6.27258509, -0.00066153, 0.00040540, 0.00066491, -0.00000112, 0.00000000],
++		[-6.27258543, -0.00066139, 0.00040531, 0.00066476, -0.00000112, 0.00000000],
++		[-6.27258577, -0.00066125, 0.00040522, 0.00066462, -0.00000112, 0.00000000],
++		[-6.27258611, -0.00066110, 0.00040514, 0.00066448, -0.00000112, 0.00000000],
++		[-6.27258644, -0.00066096, 0.00040505, 0.00066434, -0.00000112, 0.00000000],
++		[-6.27258678, -0.00066082, 0.00040496, 0.00066420, -0.00000112, 0.00000000],
++		[-6.27258712, -0.00066068, 0.00040488, 0.00066405, -0.00000112, 0.00000000],
++		[-6.27258746, -0.00066054, 0.00040479, 0.00066391, -0.00000112, 0.00000000],
++		[-6.27258780, -0.00066040, 0.00040471, 0.00066377, -0.00000112, 0.00000000],
++		[-6.27258813, -0.00066026, 0.00040462, 0.00066363, -0.00000112, 0.00000000],
++		[-6.27258847, -0.00066012, 0.00040453, 0.00066349, -0.00000112, 0.00000000],
++		[-6.27258881, -0.00065998, 0.00040445, 0.00066335, -0.00000112, 0.00000000],
++		[-6.27258914, -0.00065984, 0.00040436, 0.00066320, -0.00000112, 0.00000000],
++		[-6.27258948, -0.00065970, 0.00040427, 0.00066306, -0.00000112, 0.00000000],
++		[-6.27258982, -0.00065955, 0.00040419, 0.00066292, -0.00000112, 0.00000000],
++		[-6.27259015, -0.00065941, 0.00040410, 0.00066278, -0.00000112, 0.00000000],
++		[-6.27259049, -0.00065927, 0.00040401, 0.00066264, -0.00000112, 0.00000000],
++		[-6.27259083, -0.00065913, 0.00040393, 0.00066250, -0.00000112, 0.00000000],
++		[-6.27259116, -0.00065899, 0.00040384, 0.00066236, -0.00000112, 0.00000000],
++		[-6.27259150, -0.00065885, 0.00040376, 0.00066222, -0.00000112, 0.00000000],
++		[-6.27259184, -0.00065871, 0.00040367, 0.00066208, -0.00000112, 0.00000000],
++		[-6.27259217, -0.00065857, 0.00040358, 0.00066193, -0.00000112, 0.00000000],
++		[-6.27259251, -0.00065843, 0.00040350, 0.00066179, -0.00000112, 0.00000000],
++		[-6.27259284, -0.00065829, 0.00040341, 0.00066165, -0.00000112, 0.00000000],
++		[-6.27259318, -0.00065815, 0.00040333, 0.00066151, -0.00000112, 0.00000000],
++		[-6.27259351, -0.00065801, 0.00040324, 0.00066137, -0.00000112, 0.00000000],
++		[-6.27259385, -0.00065787, 0.00040316, 0.00066123, -0.00000112, 0.00000000],
++		[-6.27259418, -0.00065773, 0.00040307, 0.00066109, -0.00000112, 0.00000000],
++		[-6.27259452, -0.00065759, 0.00040298, 0.00066095, -0.00000112, 0.00000000],
++		[-6.27259485, -0.00065745, 0.00040290, 0.00066081, -0.00000112, 0.00000000],
++		[-6.27259519, -0.00065731, 0.00040281, 0.00066067, -0.00000112, 0.00000000],
++		[-6.27259552, -0.00065717, 0.00040273, 0.00066053, -0.00000112, 0.00000000],
++		[-6.27259585, -0.00065703, 0.00040264, 0.00066039, -0.00000112, 0.00000000],
++		[-6.27259619, -0.00065690, 0.00040256, 0.00066025, -0.00000112, 0.00000000],
++		[-6.27259652, -0.00065676, 0.00040247, 0.00066011, -0.00000112, 0.00000000],
++		[-6.27259686, -0.00065662, 0.00040239, 0.00065997, -0.00000112, 0.00000000],
++		[-6.27259719, -0.00065648, 0.00040230, 0.00065983, -0.00000112, 0.00000000],
++		[-6.27259752, -0.00065634, 0.00040221, 0.00065969, -0.00000112, 0.00000000],
++		[-6.27259786, -0.00065620, 0.00040213, 0.00065955, -0.00000112, 0.00000000],
++		[-6.27259819, -0.00065606, 0.00040204, 0.00065941, -0.00000112, 0.00000000],
++		[-6.27259852, -0.00065592, 0.00040196, 0.00065927, -0.00000112, 0.00000000],
++		[-6.27259885, -0.00065578, 0.00040187, 0.00065913, -0.00000112, 0.00000000],
++		[-6.27259919, -0.00065564, 0.00040179, 0.00065899, -0.00000112, 0.00000000],
++		[-6.27259952, -0.00065550, 0.00040170, 0.00065885, -0.00000112, 0.00000000],
++		[-6.27259985, -0.00065537, 0.00040162, 0.00065871, -0.00000112, 0.00000000],
++		[-6.27260018, -0.00065523, 0.00040153, 0.00065857, -0.00000112, 0.00000000],
++		[-6.27260052, -0.00065509, 0.00040145, 0.00065843, -0.00000112, 0.00000000],
++		[-6.27260085, -0.00065495, 0.00040136, 0.00065829, -0.00000112, 0.00000000],
++		[-6.27260118, -0.00065481, 0.00040128, 0.00065815, -0.00000112, 0.00000000],
++		[-6.27260151, -0.00065467, 0.00040119, 0.00065801, -0.00000112, 0.00000000],
++		[-6.27260184, -0.00065453, 0.00040111, 0.00065788, -0.00000112, 0.00000000],
++		[-6.27260217, -0.00065440, 0.00040102, 0.00065774, -0.00000112, 0.00000000],
++		[-6.27260251, -0.00065426, 0.00040094, 0.00065760, -0.00000112, 0.00000000],
++		[-6.27260284, -0.00065412, 0.00040085, 0.00065746, -0.00000112, 0.00000000],
++		[-6.27260317, -0.00065398, 0.00040077, 0.00065732, -0.00000112, 0.00000000],
++		[-6.27260350, -0.00065384, 0.00040068, 0.00065718, -0.00000112, 0.00000000],
++		[-6.27260383, -0.00065370, 0.00040060, 0.00065704, -0.00000112, 0.00000000],
++		[-6.27260416, -0.00065357, 0.00040051, 0.00065690, -0.00000112, 0.00000000],
++		[-6.27260449, -0.00065343, 0.00040043, 0.00065676, -0.00000112, 0.00000000],
++		[-6.27260482, -0.00065329, 0.00040035, 0.00065663, -0.00000112, 0.00000000],
++		[-6.27260515, -0.00065315, 0.00040026, 0.00065649, -0.00000112, 0.00000000],
++		[-6.27260548, -0.00065302, 0.00040018, 0.00065635, -0.00000112, 0.00000000],
++		[-6.27260581, -0.00065288, 0.00040009, 0.00065621, -0.00000112, 0.00000000],
++		[-6.27260614, -0.00065274, 0.00040001, 0.00065607, -0.00000112, 0.00000000],
++		[-6.27260647, -0.00065260, 0.00039992, 0.00065593, -0.00000112, 0.00000000],
++		[-6.27260680, -0.00065246, 0.00039984, 0.00065580, -0.00000112, 0.00000000],
++		[-6.27260713, -0.00065233, 0.00039975, 0.00065566, -0.00000112, 0.00000000],
++		[-6.27260746, -0.00065219, 0.00039967, 0.00065552, -0.00000112, 0.00000000],
++		[-6.27260779, -0.00065205, 0.00039959, 0.00065538, -0.00000112, 0.00000000],
++		[-6.27260812, -0.00065192, 0.00039950, 0.00065524, -0.00000112, 0.00000000],
++		[-6.27260844, -0.00065178, 0.00039942, 0.00065510, -0.00000112, 0.00000000],
++		[-6.27260877, -0.00065164, 0.00039933, 0.00065497, -0.00000112, 0.00000000],
++		[-6.27260910, -0.00065150, 0.00039925, 0.00065483, -0.00000112, 0.00000000],
++		[-6.27260943, -0.00065137, 0.00039917, 0.00065469, -0.00000112, 0.00000000],
++		[-6.27260976, -0.00065123, 0.00039908, 0.00065455, -0.00000112, 0.00000000],
++		[-6.27261009, -0.00065109, 0.00039900, 0.00065442, -0.00000112, 0.00000000],
++		[-6.27261041, -0.00065096, 0.00039891, 0.00065428, -0.00000112, 0.00000000],
++		[-6.27261074, -0.00065082, 0.00039883, 0.00065414, -0.00000112, 0.00000000],
++		[-6.27261107, -0.00065068, 0.00039875, 0.00065400, -0.00000112, 0.00000000],
++		[-6.27261140, -0.00065055, 0.00039866, 0.00065387, -0.00000112, 0.00000000],
++		[-6.27261172, -0.00065041, 0.00039858, 0.00065373, -0.00000112, 0.00000000],
++		[-6.27261205, -0.00065027, 0.00039849, 0.00065359, -0.00000112, 0.00000000],
++		[-6.27261238, -0.00065014, 0.00039841, 0.00065345, -0.00000112, 0.00000000],
++		[-6.27261271, -0.00065000, 0.00039833, 0.00065332, -0.00000112, 0.00000000],
++		[-6.27261303, -0.00064986, 0.00039824, 0.00065318, -0.00000112, 0.00000000],
++		[-6.27261336, -0.00064973, 0.00039816, 0.00065304, -0.00000112, 0.00000000],
++		[-6.27261369, -0.00064959, 0.00039808, 0.00065290, -0.00000112, 0.00000000],
++		[-6.27261401, -0.00064945, 0.00039799, 0.00065277, -0.00000112, 0.00000000],
++		[-6.27261434, -0.00064932, 0.00039791, 0.00065263, -0.00000112, 0.00000000],
++		[-6.27261466, -0.00064918, 0.00039782, 0.00065249, -0.00000112, 0.00000000],
++		[-6.27261499, -0.00064904, 0.00039774, 0.00065236, -0.00000112, 0.00000000],
++		[-6.27261532, -0.00064891, 0.00039766, 0.00065222, -0.00000112, 0.00000000],
++		[-6.27261564, -0.00064877, 0.00039757, 0.00065208, -0.00000112, 0.00000000],
++		[-6.27261597, -0.00064864, 0.00039749, 0.00065195, -0.00000112, 0.00000000],
++		[-6.27261629, -0.00064850, 0.00039741, 0.00065181, -0.00000112, 0.00000000],
++		[-6.27261662, -0.00064836, 0.00039732, 0.00065167, -0.00000112, 0.00000000],
++		[-6.27261694, -0.00064823, 0.00039724, 0.00065154, -0.00000112, 0.00000000],
++		[-6.27261727, -0.00064809, 0.00039716, 0.00065140, -0.00000112, 0.00000000],
++		[-6.27261759, -0.00064796, 0.00039707, 0.00065126, -0.00000112, 0.00000000],
++		[-6.27261792, -0.00064782, 0.00039699, 0.00065113, -0.00000112, 0.00000000],
++		[-6.27261824, -0.00064769, 0.00039691, 0.00065099, -0.00000112, 0.00000000],
++		[-6.27261857, -0.00064755, 0.00039683, 0.00065086, -0.00000112, 0.00000000],
++		[-6.27261889, -0.00064742, 0.00039674, 0.00065072, -0.00000112, 0.00000000],
++		[-6.27261921, -0.00064728, 0.00039666, 0.00065058, -0.00000112, 0.00000000],
++		[-6.27261954, -0.00064715, 0.00039658, 0.00065045, -0.00000112, 0.00000000],
++		[-6.27261986, -0.00064701, 0.00039649, 0.00065031, -0.00000112, 0.00000000],
++		[-6.27262019, -0.00064687, 0.00039641, 0.00065018, -0.00000112, 0.00000000],
++		[-6.27262051, -0.00064674, 0.00039633, 0.00065004, -0.00000112, 0.00000000],
++		[-6.27262083, -0.00064660, 0.00039624, 0.00064990, -0.00000112, 0.00000000],
++		[-6.27262116, -0.00064647, 0.00039616, 0.00064977, -0.00000112, 0.00000000],
++		[-6.27262148, -0.00064633, 0.00039608, 0.00064963, -0.00000112, 0.00000000],
++		[-6.27262180, -0.00064620, 0.00039600, 0.00064950, -0.00000112, 0.00000000],
++		[-6.27262213, -0.00064606, 0.00039591, 0.00064936, -0.00000112, 0.00000000],
++		[-6.27262245, -0.00064593, 0.00039583, 0.00064923, -0.00000112, 0.00000000],
++		[-6.27262277, -0.00064579, 0.00039575, 0.00064909, -0.00000112, 0.00000000],
++		[-6.27262309, -0.00064566, 0.00039567, 0.00064895, -0.00000112, 0.00000000],
++		[-6.27262342, -0.00064553, 0.00039558, 0.00064882, -0.00000112, 0.00000000],
++		[-6.27262374, -0.00064539, 0.00039550, 0.00064868, -0.00000112, 0.00000000],
++		[-6.27262406, -0.00064526, 0.00039542, 0.00064855, -0.00000112, 0.00000000],
++		[-6.27262438, -0.00064512, 0.00039534, 0.00064841, -0.00000112, 0.00000000],
++		[-6.27262470, -0.00064499, 0.00039525, 0.00064828, -0.00000112, 0.00000000],
++		[-6.27262503, -0.00064485, 0.00039517, 0.00064814, -0.00000112, 0.00000000],
++		[-6.27262535, -0.00064472, 0.00039509, 0.00064801, -0.00000112, 0.00000000],
++		[-6.27262567, -0.00064458, 0.00039501, 0.00064787, -0.00000112, 0.00000000],
++		[-6.27262599, -0.00064445, 0.00039492, 0.00064774, -0.00000112, 0.00000000],
++		[-6.27262631, -0.00064432, 0.00039484, 0.00064760, -0.00000112, 0.00000000],
++		[-6.27262663, -0.00064418, 0.00039476, 0.00064747, -0.00000112, 0.00000000],
++		[-6.27262695, -0.00064405, 0.00039468, 0.00064733, -0.00000112, 0.00000000],
++		[-6.27262727, -0.00064391, 0.00039460, 0.00064720, -0.00000112, 0.00000000],
++		[-6.27262759, -0.00064378, 0.00039451, 0.00064706, -0.00000112, 0.00000000],
++		[-6.27262792, -0.00064365, 0.00039443, 0.00064693, -0.00000112, 0.00000000],
++		[-6.27262824, -0.00064351, 0.00039435, 0.00064680, -0.00000112, 0.00000000],
++		[-6.27262856, -0.00064338, 0.00039427, 0.00064666, -0.00000112, 0.00000000],
++		[-6.27262888, -0.00064325, 0.00039418, 0.00064653, -0.00000112, 0.00000000],
++		[-6.27262920, -0.00064311, 0.00039410, 0.00064639, -0.00000112, 0.00000000],
++		[-6.27262952, -0.00064298, 0.00039402, 0.00064626, -0.00000112, 0.00000000],
++		[-6.27262984, -0.00064284, 0.00039394, 0.00064612, -0.00000112, 0.00000000],
++		[-6.27263015, -0.00064271, 0.00039386, 0.00064599, -0.00000112, 0.00000000],
++		[-6.27263047, -0.00064258, 0.00039378, 0.00064586, -0.00000112, 0.00000000],
++		[-6.27263079, -0.00064244, 0.00039369, 0.00064572, -0.00000112, 0.00000000],
++		[-6.27263111, -0.00064231, 0.00039361, 0.00064559, -0.00000112, 0.00000000],
++		[-6.27263143, -0.00064218, 0.00039353, 0.00064545, -0.00000112, 0.00000000],
++		[-6.27263175, -0.00064204, 0.00039345, 0.00064532, -0.00000112, 0.00000000],
++		[-6.27263207, -0.00064191, 0.00039337, 0.00064519, -0.00000112, 0.00000000],
++		[-6.27263239, -0.00064178, 0.00039329, 0.00064505, -0.00000112, 0.00000000],
++		[-6.27263271, -0.00064165, 0.00039320, 0.00064492, -0.00000112, 0.00000000],
++		[-6.27263302, -0.00064151, 0.00039312, 0.00064478, -0.00000112, 0.00000000],
++		[-6.27263334, -0.00064138, 0.00039304, 0.00064465, -0.00000112, 0.00000000],
++		[-6.27263366, -0.00064125, 0.00039296, 0.00064452, -0.00000112, 0.00000000],
++		[-6.27263398, -0.00064111, 0.00039288, 0.00064438, -0.00000112, 0.00000000],
++		[-6.27263430, -0.00064098, 0.00039280, 0.00064425, -0.00000112, 0.00000000],
++		[-6.27263461, -0.00064085, 0.00039271, 0.00064412, -0.00000112, 0.00000000],
++		[-6.27263493, -0.00064072, 0.00039263, 0.00064398, -0.00000112, 0.00000000],
++		[-6.27263525, -0.00064058, 0.00039255, 0.00064385, -0.00000112, 0.00000000],
++		[-6.27263557, -0.00064045, 0.00039247, 0.00064372, -0.00000112, 0.00000000],
++		[-6.27263588, -0.00064032, 0.00039239, 0.00064358, -0.00000112, 0.00000000],
++		[-6.27263620, -0.00064019, 0.00039231, 0.00064345, -0.00000112, 0.00000000],
++		[-6.27263652, -0.00064005, 0.00039223, 0.00064332, -0.00000112, 0.00000000],
++		[-6.27263683, -0.00063992, 0.00039215, 0.00064319, -0.00000112, 0.00000000],
++		[-6.27263715, -0.00063979, 0.00039206, 0.00064305, -0.00000112, 0.00000000],
++		[-6.27263747, -0.00063966, 0.00039198, 0.00064292, -0.00000112, 0.00000000],
++		[-6.27263778, -0.00063952, 0.00039190, 0.00064279, -0.00000112, 0.00000000],
++		[-6.27263810, -0.00063939, 0.00039182, 0.00064265, -0.00000112, 0.00000000],
++		[-6.27263842, -0.00063926, 0.00039174, 0.00064252, -0.00000112, 0.00000000],
++		[-6.27263873, -0.00063913, 0.00039166, 0.00064239, -0.00000112, 0.00000000],
++		[-6.27263905, -0.00063900, 0.00039158, 0.00064226, -0.00000112, 0.00000000],
++		[-6.27263936, -0.00063886, 0.00039150, 0.00064212, -0.00000112, 0.00000000],
++		[-6.27263968, -0.00063873, 0.00039142, 0.00064199, -0.00000112, 0.00000000],
++		[-6.27263999, -0.00063860, 0.00039134, 0.00064186, -0.00000112, 0.00000000],
++		[-6.27264031, -0.00063847, 0.00039126, 0.00064173, -0.00000112, 0.00000000],
++		[-6.27264063, -0.00063834, 0.00039117, 0.00064159, -0.00000112, 0.00000000],
++		[-6.27264094, -0.00063821, 0.00039109, 0.00064146, -0.00000112, 0.00000000],
++		[-6.27264126, -0.00063807, 0.00039101, 0.00064133, -0.00000112, 0.00000000],
++		[-6.27264157, -0.00063794, 0.00039093, 0.00064120, -0.00000112, 0.00000000],
++		[-6.27264188, -0.00063781, 0.00039085, 0.00064106, -0.00000112, 0.00000000],
++		[-6.27264220, -0.00063768, 0.00039077, 0.00064093, -0.00000112, 0.00000000],
++		[-6.27264251, -0.00063755, 0.00039069, 0.00064080, -0.00000113, 0.00000000],
++		[-6.27264283, -0.00063742, 0.00039061, 0.00064067, -0.00000113, 0.00000000],
++		[-6.27264314, -0.00063729, 0.00039053, 0.00064054, -0.00000113, 0.00000000],
++		[-6.27264346, -0.00063716, 0.00039045, 0.00064040, -0.00000113, 0.00000000],
++		[-6.27264377, -0.00063702, 0.00039037, 0.00064027, -0.00000113, 0.00000000],
++		[-6.27264408, -0.00063689, 0.00039029, 0.00064014, -0.00000113, 0.00000000],
++		[-6.27264440, -0.00063676, 0.00039021, 0.00064001, -0.00000113, 0.00000000],
++		[-6.27264471, -0.00063663, 0.00039013, 0.00063988, -0.00000113, 0.00000000],
++		[-6.27264502, -0.00063650, 0.00039005, 0.00063975, -0.00000113, 0.00000000],
++		[-6.27264534, -0.00063637, 0.00038997, 0.00063961, -0.00000113, 0.00000000],
++		[-6.27264565, -0.00063624, 0.00038989, 0.00063948, -0.00000113, 0.00000000],
++		[-6.27264596, -0.00063611, 0.00038981, 0.00063935, -0.00000113, 0.00000000],
++		[-6.27264628, -0.00063598, 0.00038973, 0.00063922, -0.00000113, 0.00000000],
++		[-6.27264659, -0.00063585, 0.00038965, 0.00063909, -0.00000113, 0.00000000],
++		[-6.27264690, -0.00063572, 0.00038957, 0.00063896, -0.00000113, 0.00000000],
++		[-6.27264721, -0.00063559, 0.00038949, 0.00063883, -0.00000113, 0.00000000],
++		[-6.27264753, -0.00063545, 0.00038941, 0.00063870, -0.00000113, 0.00000000],
++		[-6.27264784, -0.00063532, 0.00038933, 0.00063856, -0.00000113, 0.00000000],
++		[-6.27264815, -0.00063519, 0.00038925, 0.00063843, -0.00000113, 0.00000000],
++		[-6.27264846, -0.00063506, 0.00038917, 0.00063830, -0.00000113, 0.00000000],
++		[-6.27264877, -0.00063493, 0.00038909, 0.00063817, -0.00000113, 0.00000000],
++		[-6.27264909, -0.00063480, 0.00038901, 0.00063804, -0.00000113, 0.00000000],
++		[-6.27264940, -0.00063467, 0.00038893, 0.00063791, -0.00000113, 0.00000000],
++		[-6.27264971, -0.00063454, 0.00038885, 0.00063778, -0.00000113, 0.00000000],
++		[-6.27265002, -0.00063441, 0.00038877, 0.00063765, -0.00000113, 0.00000000],
++		[-6.27265033, -0.00063428, 0.00038869, 0.00063752, -0.00000113, 0.00000000],
++		[-6.27265064, -0.00063415, 0.00038861, 0.00063739, -0.00000113, 0.00000000],
++		[-6.27265095, -0.00063402, 0.00038853, 0.00063726, -0.00000113, 0.00000000],
++		[-6.27265126, -0.00063389, 0.00038845, 0.00063713, -0.00000113, 0.00000000],
++		[-6.27265157, -0.00063376, 0.00038837, 0.00063700, -0.00000113, 0.00000000],
++		[-6.27265189, -0.00063363, 0.00038829, 0.00063686, -0.00000113, 0.00000000],
++		[-6.27265220, -0.00063350, 0.00038821, 0.00063673, -0.00000113, 0.00000000],
++		[-6.27265251, -0.00063337, 0.00038813, 0.00063660, -0.00000113, 0.00000000],
++		[-6.27265282, -0.00063324, 0.00038805, 0.00063647, -0.00000113, 0.00000000],
++		[-6.27265313, -0.00063312, 0.00038797, 0.00063634, -0.00000113, 0.00000000],
++		[-6.27265344, -0.00063299, 0.00038789, 0.00063621, -0.00000113, 0.00000000],
++		[-6.27265375, -0.00063286, 0.00038781, 0.00063608, -0.00000113, 0.00000000],
++		[-6.27265406, -0.00063273, 0.00038773, 0.00063595, -0.00000113, 0.00000000],
++		[-6.27265436, -0.00063260, 0.00038765, 0.00063582, -0.00000113, 0.00000000],
++		[-6.27265467, -0.00063247, 0.00038758, 0.00063569, -0.00000113, 0.00000000],
++		[-6.27265498, -0.00063234, 0.00038750, 0.00063556, -0.00000113, 0.00000000],
++		[-6.27265529, -0.00063221, 0.00038742, 0.00063543, -0.00000113, 0.00000000],
++		[-6.27265560, -0.00063208, 0.00038734, 0.00063530, -0.00000113, 0.00000000],
++		[-6.27265591, -0.00063195, 0.00038726, 0.00063517, -0.00000113, 0.00000000],
++		[-6.27265622, -0.00063182, 0.00038718, 0.00063504, -0.00000113, 0.00000000],
++		[-6.27265653, -0.00063169, 0.00038710, 0.00063492, -0.00000113, 0.00000000],
++		[-6.27265684, -0.00063157, 0.00038702, 0.00063479, -0.00000113, 0.00000000],
++		[-6.27265714, -0.00063144, 0.00038694, 0.00063466, -0.00000113, 0.00000000],
++		[-6.27265745, -0.00063131, 0.00038686, 0.00063453, -0.00000113, 0.00000000],
++		[-6.27265776, -0.00063118, 0.00038678, 0.00063440, -0.00000113, 0.00000000],
++		[-6.27265807, -0.00063105, 0.00038671, 0.00063427, -0.00000113, 0.00000000],
++		[-6.27265838, -0.00063092, 0.00038663, 0.00063414, -0.00000113, 0.00000000],
++		[-6.27265868, -0.00063079, 0.00038655, 0.00063401, -0.00000113, 0.00000000],
++		[-6.27265899, -0.00063066, 0.00038647, 0.00063388, -0.00000113, 0.00000000],
++		[-6.27265930, -0.00063054, 0.00038639, 0.00063375, -0.00000113, 0.00000000],
++		[-6.27265961, -0.00063041, 0.00038631, 0.00063362, -0.00000113, 0.00000000],
++		[-6.27265991, -0.00063028, 0.00038623, 0.00063349, -0.00000113, 0.00000000],
++		[-6.27266022, -0.00063015, 0.00038615, 0.00063336, -0.00000113, 0.00000000],
++		[-6.27266053, -0.00063002, 0.00038608, 0.00063323, -0.00000113, 0.00000000],
++		[-6.27266083, -0.00062989, 0.00038600, 0.00063311, -0.00000113, 0.00000000],
++		[-6.27266114, -0.00062977, 0.00038592, 0.00063298, -0.00000113, 0.00000000],
++		[-6.27266145, -0.00062964, 0.00038584, 0.00063285, -0.00000113, 0.00000000],
++		[-6.27266175, -0.00062951, 0.00038576, 0.00063272, -0.00000113, 0.00000000],
++		[-6.27266206, -0.00062938, 0.00038568, 0.00063259, -0.00000113, 0.00000000],
++		[-6.27266237, -0.00062925, 0.00038560, 0.00063246, -0.00000113, 0.00000000],
++		[-6.27266267, -0.00062913, 0.00038553, 0.00063233, -0.00000113, 0.00000000],
++		[-6.27266298, -0.00062900, 0.00038545, 0.00063221, -0.00000113, 0.00000000],
++		[-6.27266329, -0.00062887, 0.00038537, 0.00063208, -0.00000113, 0.00000000],
++		[-6.27266359, -0.00062874, 0.00038529, 0.00063195, -0.00000113, 0.00000000],
++		[-6.27266390, -0.00062862, 0.00038521, 0.00063182, -0.00000113, 0.00000000],
++		[-6.27266420, -0.00062849, 0.00038513, 0.00063169, -0.00000113, 0.00000000],
++		[-6.27266451, -0.00062836, 0.00038506, 0.00063156, -0.00000113, 0.00000000],
++		[-6.27266481, -0.00062823, 0.00038498, 0.00063144, -0.00000113, 0.00000000],
++		[-6.27266512, -0.00062811, 0.00038490, 0.00063131, -0.00000113, 0.00000000],
++		[-6.27266542, -0.00062798, 0.00038482, 0.00063118, -0.00000113, 0.00000000],
++		[-6.27266573, -0.00062785, 0.00038474, 0.00063105, -0.00000113, 0.00000000],
++		[-6.27266603, -0.00062772, 0.00038467, 0.00063092, -0.00000113, 0.00000000],
++		[-6.27266634, -0.00062760, 0.00038459, 0.00063080, -0.00000113, 0.00000000],
++		[-6.27266664, -0.00062747, 0.00038451, 0.00063067, -0.00000113, 0.00000000],
++		[-6.27266695, -0.00062734, 0.00038443, 0.00063054, -0.00000113, 0.00000000],
++		[-6.27266725, -0.00062721, 0.00038435, 0.00063041, -0.00000113, 0.00000000],
++		[-6.27266755, -0.00062709, 0.00038428, 0.00063028, -0.00000113, 0.00000000],
++		[-6.27266786, -0.00062696, 0.00038420, 0.00063016, -0.00000113, 0.00000000],
++		[-6.27266816, -0.00062683, 0.00038412, 0.00063003, -0.00000113, 0.00000000],
++		[-6.27266847, -0.00062671, 0.00038404, 0.00062990, -0.00000113, 0.00000000],
++		[-6.27266877, -0.00062658, 0.00038396, 0.00062977, -0.00000113, 0.00000000],
++		[-6.27266907, -0.00062645, 0.00038389, 0.00062965, -0.00000113, 0.00000000],
++		[-6.27266938, -0.00062633, 0.00038381, 0.00062952, -0.00000113, 0.00000000],
++		[-6.27266968, -0.00062620, 0.00038373, 0.00062939, -0.00000113, 0.00000000],
++		[-6.27266998, -0.00062607, 0.00038365, 0.00062926, -0.00000113, 0.00000000],
++		[-6.27267028, -0.00062595, 0.00038358, 0.00062914, -0.00000113, 0.00000000],
++		[-6.27267059, -0.00062582, 0.00038350, 0.00062901, -0.00000113, 0.00000000],
++		[-6.27267089, -0.00062569, 0.00038342, 0.00062888, -0.00000113, 0.00000000],
++		[-6.27267119, -0.00062557, 0.00038334, 0.00062876, -0.00000113, 0.00000000],
++		[-6.27267150, -0.00062544, 0.00038327, 0.00062863, -0.00000113, 0.00000000],
++		[-6.27267180, -0.00062531, 0.00038319, 0.00062850, -0.00000113, 0.00000000],
++		[-6.27267210, -0.00062519, 0.00038311, 0.00062837, -0.00000113, 0.00000000],
++		[-6.27267240, -0.00062506, 0.00038303, 0.00062825, -0.00000113, 0.00000000],
++		[-6.27267270, -0.00062494, 0.00038296, 0.00062812, -0.00000113, 0.00000000],
++		[-6.27267301, -0.00062481, 0.00038288, 0.00062799, -0.00000113, 0.00000000],
++		[-6.27267331, -0.00062468, 0.00038280, 0.00062787, -0.00000113, 0.00000000],
++		[-6.27267361, -0.00062456, 0.00038272, 0.00062774, -0.00000113, 0.00000000],
++		[-6.27267391, -0.00062443, 0.00038265, 0.00062761, -0.00000113, 0.00000000],
++		[-6.27267421, -0.00062431, 0.00038257, 0.00062749, -0.00000113, 0.00000000],
++		[-6.27267451, -0.00062418, 0.00038249, 0.00062736, -0.00000113, 0.00000000],
++		[-6.27267481, -0.00062405, 0.00038241, 0.00062723, -0.00000113, 0.00000000],
++		[-6.27267512, -0.00062393, 0.00038234, 0.00062711, -0.00000113, 0.00000000],
++		[-6.27267542, -0.00062380, 0.00038226, 0.00062698, -0.00000113, 0.00000000],
++		[-6.27267572, -0.00062368, 0.00038218, 0.00062685, -0.00000113, 0.00000000],
++		[-6.27267602, -0.00062355, 0.00038211, 0.00062673, -0.00000113, 0.00000000],
++		[-6.27267632, -0.00062342, 0.00038203, 0.00062660, -0.00000113, 0.00000000],
++		[-6.27267662, -0.00062330, 0.00038195, 0.00062648, -0.00000113, 0.00000000],
++		[-6.27267692, -0.00062317, 0.00038188, 0.00062635, -0.00000113, 0.00000000],
++		[-6.27267722, -0.00062305, 0.00038180, 0.00062622, -0.00000113, 0.00000000],
++		[-6.27267752, -0.00062292, 0.00038172, 0.00062610, -0.00000113, 0.00000000],
++		[-6.27267782, -0.00062280, 0.00038164, 0.00062597, -0.00000113, 0.00000000],
++		[-6.27267812, -0.00062267, 0.00038157, 0.00062585, -0.00000113, 0.00000000],
++		[-6.27267842, -0.00062255, 0.00038149, 0.00062572, -0.00000113, 0.00000000],
++		[-6.27267872, -0.00062242, 0.00038141, 0.00062559, -0.00000113, 0.00000000],
++		[-6.27267902, -0.00062230, 0.00038134, 0.00062547, -0.00000113, 0.00000000],
++		[-6.27267932, -0.00062217, 0.00038126, 0.00062534, -0.00000113, 0.00000000],
++		[-6.27267962, -0.00062205, 0.00038118, 0.00062522, -0.00000113, 0.00000000],
++		[-6.27267992, -0.00062192, 0.00038111, 0.00062509, -0.00000113, 0.00000000],
++		[-6.27268021, -0.00062180, 0.00038103, 0.00062497, -0.00000113, 0.00000000],
++		[-6.27268051, -0.00062167, 0.00038095, 0.00062484, -0.00000113, 0.00000000],
++		[-6.27268081, -0.00062155, 0.00038088, 0.00062471, -0.00000113, 0.00000000],
++		[-6.27268111, -0.00062142, 0.00038080, 0.00062459, -0.00000113, 0.00000000],
++		[-6.27268141, -0.00062130, 0.00038072, 0.00062446, -0.00000113, 0.00000000],
++		[-6.27268171, -0.00062117, 0.00038065, 0.00062434, -0.00000113, 0.00000000],
++		[-6.27268201, -0.00062105, 0.00038057, 0.00062421, -0.00000113, 0.00000000],
++		[-6.27268230, -0.00062092, 0.00038050, 0.00062409, -0.00000113, 0.00000000],
++		[-6.27268260, -0.00062080, 0.00038042, 0.00062396, -0.00000113, 0.00000000],
++		[-6.27268290, -0.00062067, 0.00038034, 0.00062384, -0.00000113, 0.00000000],
++		[-6.27268320, -0.00062055, 0.00038027, 0.00062371, -0.00000113, 0.00000000],
++		[-6.27268350, -0.00062043, 0.00038019, 0.00062359, -0.00000113, 0.00000000],
++		[-6.27268379, -0.00062030, 0.00038011, 0.00062346, -0.00000113, 0.00000000],
++		[-6.27268409, -0.00062018, 0.00038004, 0.00062334, -0.00000113, 0.00000000],
++		[-6.27268439, -0.00062005, 0.00037996, 0.00062321, -0.00000113, 0.00000000],
++		[-6.27268468, -0.00061993, 0.00037989, 0.00062309, -0.00000113, 0.00000000],
++		[-6.27268498, -0.00061980, 0.00037981, 0.00062296, -0.00000113, 0.00000000],
++		[-6.27268528, -0.00061968, 0.00037973, 0.00062284, -0.00000113, 0.00000000],
++		[-6.27268558, -0.00061956, 0.00037966, 0.00062271, -0.00000113, 0.00000000],
++		[-6.27268587, -0.00061943, 0.00037958, 0.00062259, -0.00000113, 0.00000000],
++		[-6.27268617, -0.00061931, 0.00037951, 0.00062246, -0.00000113, 0.00000000],
++		[-6.27268647, -0.00061919, 0.00037943, 0.00062234, -0.00000113, 0.00000000],
++		[-6.27268676, -0.00061906, 0.00037935, 0.00062222, -0.00000113, 0.00000000],
++		[-6.27268706, -0.00061894, 0.00037928, 0.00062209, -0.00000113, 0.00000000],
++		[-6.27268735, -0.00061881, 0.00037920, 0.00062197, -0.00000113, 0.00000000],
++		[-6.27268765, -0.00061869, 0.00037913, 0.00062184, -0.00000113, 0.00000000],
++		[-6.27268795, -0.00061857, 0.00037905, 0.00062172, -0.00000113, 0.00000000],
++		[-6.27268824, -0.00061844, 0.00037897, 0.00062159, -0.00000113, 0.00000000],
++		[-6.27268854, -0.00061832, 0.00037890, 0.00062147, -0.00000113, 0.00000000],
++		[-6.27268883, -0.00061820, 0.00037882, 0.00062135, -0.00000113, 0.00000000],
++		[-6.27268913, -0.00061807, 0.00037875, 0.00062122, -0.00000113, 0.00000000],
++		[-6.27268942, -0.00061795, 0.00037867, 0.00062110, -0.00000113, 0.00000000],
++		[-6.27268972, -0.00061783, 0.00037860, 0.00062097, -0.00000113, 0.00000000],
++		[-6.27269001, -0.00061770, 0.00037852, 0.00062085, -0.00000113, 0.00000000],
++		[-6.27269031, -0.00061758, 0.00037844, 0.00062073, -0.00000113, 0.00000000],
++		[-6.27269060, -0.00061746, 0.00037837, 0.00062060, -0.00000113, 0.00000000],
++		[-6.27269090, -0.00061733, 0.00037829, 0.00062048, -0.00000113, 0.00000000],
++		[-6.27269119, -0.00061721, 0.00037822, 0.00062035, -0.00000113, 0.00000000],
++		[-6.27269149, -0.00061709, 0.00037814, 0.00062023, -0.00000113, 0.00000000],
++		[-6.27269178, -0.00061696, 0.00037807, 0.00062011, -0.00000113, 0.00000000],
++		[-6.27269208, -0.00061684, 0.00037799, 0.00061998, -0.00000113, 0.00000000],
++		[-6.27269237, -0.00061672, 0.00037792, 0.00061986, -0.00000113, 0.00000000],
++		[-6.27269266, -0.00061660, 0.00037784, 0.00061974, -0.00000113, 0.00000000],
++		[-6.27269296, -0.00061647, 0.00037777, 0.00061961, -0.00000113, 0.00000000],
++		[-6.27269325, -0.00061635, 0.00037769, 0.00061949, -0.00000113, 0.00000000],
++		[-6.27269354, -0.00061623, 0.00037762, 0.00061937, -0.00000113, 0.00000000],
++		[-6.27269384, -0.00061610, 0.00037754, 0.00061924, -0.00000113, 0.00000000],
++		[-6.27269413, -0.00061598, 0.00037746, 0.00061912, -0.00000113, 0.00000000],
++		[-6.27269442, -0.00061586, 0.00037739, 0.00061900, -0.00000113, 0.00000000],
++		[-6.27269472, -0.00061574, 0.00037731, 0.00061887, -0.00000113, 0.00000000],
++		[-6.27269501, -0.00061561, 0.00037724, 0.00061875, -0.00000113, 0.00000000],
++		[-6.27269530, -0.00061549, 0.00037716, 0.00061863, -0.00000113, 0.00000000],
++		[-6.27269560, -0.00061537, 0.00037709, 0.00061850, -0.00000113, 0.00000000],
++		[-6.27269589, -0.00061525, 0.00037701, 0.00061838, -0.00000113, 0.00000000],
++		[-6.27269618, -0.00061512, 0.00037694, 0.00061826, -0.00000113, 0.00000000],
++		[-6.27269647, -0.00061500, 0.00037686, 0.00061814, -0.00000113, 0.00000000],
++		[-6.27269677, -0.00061488, 0.00037679, 0.00061801, -0.00000113, 0.00000000],
++		[-6.27269706, -0.00061476, 0.00037671, 0.00061789, -0.00000113, 0.00000000],
++		[-6.27269735, -0.00061464, 0.00037664, 0.00061777, -0.00000113, 0.00000000],
++		[-6.27269764, -0.00061451, 0.00037656, 0.00061764, -0.00000113, 0.00000000],
++		[-6.27269793, -0.00061439, 0.00037649, 0.00061752, -0.00000113, 0.00000000],
++		[-6.27269823, -0.00061427, 0.00037642, 0.00061740, -0.00000113, 0.00000000],
++		[-6.27269852, -0.00061415, 0.00037634, 0.00061728, -0.00000113, 0.00000000],
++		[-6.27269881, -0.00061403, 0.00037627, 0.00061715, -0.00000113, 0.00000000],
++		[-6.27269910, -0.00061390, 0.00037619, 0.00061703, -0.00000113, 0.00000000],
++		[-6.27269939, -0.00061378, 0.00037612, 0.00061691, -0.00000113, 0.00000000],
++		[-6.27269968, -0.00061366, 0.00037604, 0.00061679, -0.00000113, 0.00000000],
++		[-6.27269997, -0.00061354, 0.00037597, 0.00061667, -0.00000113, 0.00000000],
++		[-6.27270027, -0.00061342, 0.00037589, 0.00061654, -0.00000113, 0.00000000],
++		[-6.27270056, -0.00061330, 0.00037582, 0.00061642, -0.00000113, 0.00000000],
++		[-6.27270085, -0.00061318, 0.00037574, 0.00061630, -0.00000113, 0.00000000],
++		[-6.27270114, -0.00061305, 0.00037567, 0.00061618, -0.00000113, 0.00000000],
++		[-6.27270143, -0.00061293, 0.00037559, 0.00061605, -0.00000113, 0.00000000],
++		[-6.27270172, -0.00061281, 0.00037552, 0.00061593, -0.00000113, 0.00000000],
++		[-6.27270201, -0.00061269, 0.00037545, 0.00061581, -0.00000113, 0.00000000],
++		[-6.27270230, -0.00061257, 0.00037537, 0.00061569, -0.00000113, 0.00000000],
++		[-6.27270259, -0.00061245, 0.00037530, 0.00061557, -0.00000113, 0.00000000],
++		[-6.27270288, -0.00061233, 0.00037522, 0.00061545, -0.00000113, 0.00000000],
++		[-6.27270317, -0.00061221, 0.00037515, 0.00061532, -0.00000113, 0.00000000],
++		[-6.27270346, -0.00061208, 0.00037507, 0.00061520, -0.00000113, 0.00000000],
++		[-6.27270375, -0.00061196, 0.00037500, 0.00061508, -0.00000113, 0.00000000],
++		[-6.27270404, -0.00061184, 0.00037493, 0.00061496, -0.00000113, 0.00000000],
++		[-6.27270433, -0.00061172, 0.00037485, 0.00061484, -0.00000113, 0.00000000],
++		[-6.27270462, -0.00061160, 0.00037478, 0.00061472, -0.00000113, 0.00000000],
++		[-6.27270490, -0.00061148, 0.00037470, 0.00061459, -0.00000113, 0.00000000],
++		[-6.27270519, -0.00061136, 0.00037463, 0.00061447, -0.00000113, 0.00000000],
++		[-6.27270548, -0.00061124, 0.00037456, 0.00061435, -0.00000113, 0.00000000],
++		[-6.27270577, -0.00061112, 0.00037448, 0.00061423, -0.00000113, 0.00000000],
++		[-6.27270606, -0.00061100, 0.00037441, 0.00061411, -0.00000113, 0.00000000],
++		[-6.27270635, -0.00061088, 0.00037433, 0.00061399, -0.00000113, 0.00000000],
++		[-6.27270664, -0.00061076, 0.00037426, 0.00061387, -0.00000113, 0.00000000],
++		[-6.27270692, -0.00061064, 0.00037419, 0.00061375, -0.00000113, 0.00000000],
++		[-6.27270721, -0.00061051, 0.00037411, 0.00061362, -0.00000113, 0.00000000],
++		[-6.27270750, -0.00061039, 0.00037404, 0.00061350, -0.00000113, 0.00000000],
++		[-6.27270779, -0.00061027, 0.00037396, 0.00061338, -0.00000113, 0.00000000],
++		[-6.27270808, -0.00061015, 0.00037389, 0.00061326, -0.00000113, 0.00000000],
++		[-6.27270836, -0.00061003, 0.00037382, 0.00061314, -0.00000113, 0.00000000],
++		[-6.27270865, -0.00060991, 0.00037374, 0.00061302, -0.00000113, 0.00000000],
++		[-6.27270894, -0.00060979, 0.00037367, 0.00061290, -0.00000113, 0.00000000],
++		[-6.27270923, -0.00060967, 0.00037360, 0.00061278, -0.00000113, 0.00000000],
++		[-6.27270951, -0.00060955, 0.00037352, 0.00061266, -0.00000113, 0.00000000],
++		[-6.27270980, -0.00060943, 0.00037345, 0.00061254, -0.00000113, 0.00000000],
++		[-6.27271009, -0.00060931, 0.00037338, 0.00061242, -0.00000113, 0.00000000],
++		[-6.27271038, -0.00060919, 0.00037330, 0.00061230, -0.00000113, 0.00000000],
++		[-6.27271066, -0.00060907, 0.00037323, 0.00061218, -0.00000113, 0.00000000],
++		[-6.27271095, -0.00060895, 0.00037315, 0.00061205, -0.00000113, 0.00000000],
++		[-6.27271124, -0.00060883, 0.00037308, 0.00061193, -0.00000113, 0.00000000],
++		[-6.27271152, -0.00060871, 0.00037301, 0.00061181, -0.00000113, 0.00000000],
++		[-6.27271181, -0.00060859, 0.00037293, 0.00061169, -0.00000113, 0.00000000],
++		[-6.27271209, -0.00060847, 0.00037286, 0.00061157, -0.00000113, 0.00000000],
++		[-6.27271238, -0.00060836, 0.00037279, 0.00061145, -0.00000113, 0.00000000],
++		[-6.27271267, -0.00060824, 0.00037271, 0.00061133, -0.00000113, 0.00000000],
++		[-6.27271295, -0.00060812, 0.00037264, 0.00061121, -0.00000113, 0.00000000],
++		[-6.27271324, -0.00060800, 0.00037257, 0.00061109, -0.00000113, 0.00000000],
++		[-6.27271352, -0.00060788, 0.00037249, 0.00061097, -0.00000113, 0.00000000],
++		[-6.27271381, -0.00060776, 0.00037242, 0.00061085, -0.00000113, 0.00000000],
++		[-6.27271410, -0.00060764, 0.00037235, 0.00061073, -0.00000113, 0.00000000],
++		[-6.27271438, -0.00060752, 0.00037228, 0.00061061, -0.00000113, 0.00000000],
++		[-6.27271467, -0.00060740, 0.00037220, 0.00061049, -0.00000113, 0.00000000],
++		[-6.27271495, -0.00060728, 0.00037213, 0.00061037, -0.00000113, 0.00000000],
++		[-6.27271524, -0.00060716, 0.00037206, 0.00061025, -0.00000113, 0.00000000],
++		[-6.27271552, -0.00060704, 0.00037198, 0.00061013, -0.00000113, 0.00000000],
++		[-6.27271581, -0.00060692, 0.00037191, 0.00061001, -0.00000113, 0.00000000],
++		[-6.27271609, -0.00060680, 0.00037184, 0.00060989, -0.00000113, 0.00000000],
++		[-6.27271637, -0.00060669, 0.00037176, 0.00060978, -0.00000113, 0.00000000],
++		[-6.27271666, -0.00060657, 0.00037169, 0.00060966, -0.00000113, 0.00000000],
++		[-6.27271694, -0.00060645, 0.00037162, 0.00060954, -0.00000113, 0.00000000],
++		[-6.27271723, -0.00060633, 0.00037155, 0.00060942, -0.00000113, 0.00000000],
++		[-6.27271751, -0.00060621, 0.00037147, 0.00060930, -0.00000113, 0.00000000],
++		[-6.27271780, -0.00060609, 0.00037140, 0.00060918, -0.00000113, 0.00000000],
++		[-6.27271808, -0.00060597, 0.00037133, 0.00060906, -0.00000113, 0.00000000],
++		[-6.27271836, -0.00060585, 0.00037125, 0.00060894, -0.00000113, 0.00000000],
++		[-6.27271865, -0.00060574, 0.00037118, 0.00060882, -0.00000113, 0.00000000],
++		[-6.27271893, -0.00060562, 0.00037111, 0.00060870, -0.00000113, 0.00000000],
++		[-6.27271921, -0.00060550, 0.00037104, 0.00060858, -0.00000113, 0.00000000],
++		[-6.27271950, -0.00060538, 0.00037096, 0.00060846, -0.00000113, 0.00000000],
++		[-6.27271978, -0.00060526, 0.00037089, 0.00060834, -0.00000113, 0.00000000],
++		[-6.27272006, -0.00060514, 0.00037082, 0.00060823, -0.00000113, 0.00000000],
++		[-6.27272035, -0.00060503, 0.00037075, 0.00060811, -0.00000113, 0.00000000],
++		[-6.27272063, -0.00060491, 0.00037067, 0.00060799, -0.00000113, 0.00000000],
++		[-6.27272091, -0.00060479, 0.00037060, 0.00060787, -0.00000113, 0.00000000],
++		[-6.27272120, -0.00060467, 0.00037053, 0.00060775, -0.00000113, 0.00000000],
++		[-6.27272148, -0.00060455, 0.00037046, 0.00060763, -0.00000113, 0.00000000],
++		[-6.27272176, -0.00060444, 0.00037038, 0.00060751, -0.00000113, 0.00000000],
++		[-6.27272204, -0.00060432, 0.00037031, 0.00060739, -0.00000113, 0.00000000],
++		[-6.27272232, -0.00060420, 0.00037024, 0.00060728, -0.00000113, 0.00000000],
++		[-6.27272261, -0.00060408, 0.00037017, 0.00060716, -0.00000113, 0.00000000],
++		[-6.27272289, -0.00060396, 0.00037009, 0.00060704, -0.00000113, 0.00000000],
++		[-6.27272317, -0.00060385, 0.00037002, 0.00060692, -0.00000113, 0.00000000],
++		[-6.27272345, -0.00060373, 0.00036995, 0.00060680, -0.00000113, 0.00000000],
++		[-6.27272373, -0.00060361, 0.00036988, 0.00060668, -0.00000113, 0.00000000],
++		[-6.27272402, -0.00060349, 0.00036981, 0.00060657, -0.00000113, 0.00000000],
++		[-6.27272430, -0.00060337, 0.00036973, 0.00060645, -0.00000113, 0.00000000],
++		[-6.27272458, -0.00060326, 0.00036966, 0.00060633, -0.00000113, 0.00000000],
++		[-6.27272486, -0.00060314, 0.00036959, 0.00060621, -0.00000113, 0.00000000],
++		[-6.27272514, -0.00060302, 0.00036952, 0.00060609, -0.00000113, 0.00000000],
++		[-6.27272542, -0.00060290, 0.00036945, 0.00060597, -0.00000113, 0.00000000],
++		[-6.27272570, -0.00060279, 0.00036937, 0.00060586, -0.00000113, 0.00000000],
++		[-6.27272598, -0.00060267, 0.00036930, 0.00060574, -0.00000113, 0.00000000],
++		[-6.27272626, -0.00060255, 0.00036923, 0.00060562, -0.00000113, 0.00000000],
++		[-6.27272654, -0.00060244, 0.00036916, 0.00060550, -0.00000113, 0.00000000],
++		[-6.27272683, -0.00060232, 0.00036909, 0.00060538, -0.00000113, 0.00000000],
++		[-6.27272711, -0.00060220, 0.00036901, 0.00060527, -0.00000113, 0.00000000],
++		[-6.27272739, -0.00060208, 0.00036894, 0.00060515, -0.00000113, 0.00000000],
++		[-6.27272767, -0.00060197, 0.00036887, 0.00060503, -0.00000113, 0.00000000],
++		[-6.27272795, -0.00060185, 0.00036880, 0.00060491, -0.00000113, 0.00000000],
++		[-6.27272823, -0.00060173, 0.00036873, 0.00060480, -0.00000113, 0.00000000],
++		[-6.27272851, -0.00060162, 0.00036865, 0.00060468, -0.00000113, 0.00000000],
++		[-6.27272879, -0.00060150, 0.00036858, 0.00060456, -0.00000113, 0.00000000],
++		[-6.27272907, -0.00060138, 0.00036851, 0.00060444, -0.00000113, 0.00000000],
++		[-6.27272934, -0.00060127, 0.00036844, 0.00060433, -0.00000113, 0.00000000],
++		[-6.27272962, -0.00060115, 0.00036837, 0.00060421, -0.00000113, 0.00000000],
++		[-6.27272990, -0.00060103, 0.00036830, 0.00060409, -0.00000113, 0.00000000],
++		[-6.27273018, -0.00060092, 0.00036823, 0.00060397, -0.00000113, 0.00000000],
++		[-6.27273046, -0.00060080, 0.00036815, 0.00060386, -0.00000113, 0.00000000],
++		[-6.27273074, -0.00060068, 0.00036808, 0.00060374, -0.00000113, 0.00000000],
++		[-6.27273102, -0.00060057, 0.00036801, 0.00060362, -0.00000113, 0.00000000],
++		[-6.27273130, -0.00060045, 0.00036794, 0.00060351, -0.00000113, 0.00000000],
++		[-6.27273158, -0.00060033, 0.00036787, 0.00060339, -0.00000113, 0.00000000],
++		[-6.27273186, -0.00060022, 0.00036780, 0.00060327, -0.00000113, 0.00000000],
++		[-6.27273213, -0.00060010, 0.00036773, 0.00060315, -0.00000113, 0.00000000],
++		[-6.27273241, -0.00059998, 0.00036765, 0.00060304, -0.00000113, 0.00000000],
++		[-6.27273269, -0.00059987, 0.00036758, 0.00060292, -0.00000113, 0.00000000],
++		[-6.27273297, -0.00059975, 0.00036751, 0.00060280, -0.00000113, 0.00000000],
++		[-6.27273325, -0.00059963, 0.00036744, 0.00060269, -0.00000113, 0.00000000],
++		[-6.27273352, -0.00059952, 0.00036737, 0.00060257, -0.00000113, 0.00000000],
++		[-6.27273380, -0.00059940, 0.00036730, 0.00060245, -0.00000113, 0.00000000],
++		[-6.27273408, -0.00059929, 0.00036723, 0.00060234, -0.00000113, 0.00000000],
++		[-6.27273436, -0.00059917, 0.00036716, 0.00060222, -0.00000113, 0.00000000],
++		[-6.27273463, -0.00059905, 0.00036708, 0.00060210, -0.00000113, 0.00000000],
++		[-6.27273491, -0.00059894, 0.00036701, 0.00060199, -0.00000113, 0.00000000],
++		[-6.27273519, -0.00059882, 0.00036694, 0.00060187, -0.00000113, 0.00000000],
++		[-6.27273547, -0.00059871, 0.00036687, 0.00060175, -0.00000113, 0.00000000],
++		[-6.27273574, -0.00059859, 0.00036680, 0.00060164, -0.00000113, 0.00000000],
++		[-6.27273602, -0.00059848, 0.00036673, 0.00060152, -0.00000113, 0.00000000],
++		[-6.27273630, -0.00059836, 0.00036666, 0.00060141, -0.00000113, 0.00000000],
++		[-6.27273657, -0.00059824, 0.00036659, 0.00060129, -0.00000113, 0.00000000],
++		[-6.27273685, -0.00059813, 0.00036652, 0.00060117, -0.00000113, 0.00000000],
++		[-6.27273713, -0.00059801, 0.00036645, 0.00060106, -0.00000113, 0.00000000],
++		[-6.27273740, -0.00059790, 0.00036637, 0.00060094, -0.00000113, 0.00000000],
++		[-6.27273768, -0.00059778, 0.00036630, 0.00060082, -0.00000113, 0.00000000],
++		[-6.27273796, -0.00059767, 0.00036623, 0.00060071, -0.00000113, 0.00000000],
++		[-6.27273823, -0.00059755, 0.00036616, 0.00060059, -0.00000113, 0.00000000],
++		[-6.27273851, -0.00059744, 0.00036609, 0.00060048, -0.00000113, 0.00000000],
++		[-6.27273878, -0.00059732, 0.00036602, 0.00060036, -0.00000113, 0.00000000],
++		[-6.27273906, -0.00059721, 0.00036595, 0.00060025, -0.00000113, 0.00000000],
++		[-6.27273933, -0.00059709, 0.00036588, 0.00060013, -0.00000113, 0.00000000],
++		[-6.27273961, -0.00059698, 0.00036581, 0.00060001, -0.00000113, 0.00000000],
++		[-6.27273989, -0.00059686, 0.00036574, 0.00059990, -0.00000113, 0.00000000],
++		[-6.27274016, -0.00059674, 0.00036567, 0.00059978, -0.00000113, 0.00000000],
++		[-6.27274044, -0.00059663, 0.00036560, 0.00059967, -0.00000113, 0.00000000],
++		[-6.27274071, -0.00059651, 0.00036553, 0.00059955, -0.00000113, 0.00000000],
++		[-6.27274099, -0.00059640, 0.00036546, 0.00059944, -0.00000113, 0.00000000],
++		[-6.27274126, -0.00059629, 0.00036539, 0.00059932, -0.00000113, 0.00000000],
++		[-6.27274154, -0.00059617, 0.00036532, 0.00059920, -0.00000113, 0.00000000],
++		[-6.27274181, -0.00059606, 0.00036525, 0.00059909, -0.00000113, 0.00000000],
++		[-6.27274208, -0.00059594, 0.00036517, 0.00059897, -0.00000113, 0.00000000],
++		[-6.27274236, -0.00059583, 0.00036510, 0.00059886, -0.00000113, 0.00000000],
++		[-6.27274263, -0.00059571, 0.00036503, 0.00059874, -0.00000113, 0.00000000],
++		[-6.27274291, -0.00059560, 0.00036496, 0.00059863, -0.00000113, 0.00000000],
++		[-6.27274318, -0.00059548, 0.00036489, 0.00059851, -0.00000113, 0.00000000],
++		[-6.27274346, -0.00059537, 0.00036482, 0.00059840, -0.00000113, 0.00000000],
++		[-6.27274373, -0.00059525, 0.00036475, 0.00059828, -0.00000113, 0.00000000],
++		[-6.27274400, -0.00059514, 0.00036468, 0.00059817, -0.00000113, 0.00000000],
++		[-6.27274428, -0.00059502, 0.00036461, 0.00059805, -0.00000113, 0.00000000],
++		[-6.27274455, -0.00059491, 0.00036454, 0.00059794, -0.00000113, 0.00000000],
++		[-6.27274482, -0.00059480, 0.00036447, 0.00059782, -0.00000113, 0.00000000],
++		[-6.27274510, -0.00059468, 0.00036440, 0.00059771, -0.00000113, 0.00000000],
++		[-6.27274537, -0.00059457, 0.00036433, 0.00059759, -0.00000113, 0.00000000],
++		[-6.27274564, -0.00059445, 0.00036426, 0.00059748, -0.00000113, 0.00000000],
++		[-6.27274592, -0.00059434, 0.00036419, 0.00059736, -0.00000113, 0.00000000],
++		[-6.27274619, -0.00059422, 0.00036412, 0.00059725, -0.00000113, 0.00000000],
++		[-6.27274646, -0.00059411, 0.00036405, 0.00059713, -0.00000113, 0.00000000],
++		[-6.27274674, -0.00059400, 0.00036398, 0.00059702, -0.00000113, 0.00000000],
++		[-6.27274701, -0.00059388, 0.00036391, 0.00059690, -0.00000113, 0.00000000],
++		[-6.27274728, -0.00059377, 0.00036384, 0.00059679, -0.00000113, 0.00000000],
++		[-6.27274755, -0.00059365, 0.00036377, 0.00059668, -0.00000113, 0.00000000],
++		[-6.27274783, -0.00059354, 0.00036370, 0.00059656, -0.00000113, 0.00000000],
++		[-6.27274810, -0.00059343, 0.00036363, 0.00059645, -0.00000113, 0.00000000],
++		[-6.27274837, -0.00059331, 0.00036356, 0.00059633, -0.00000113, 0.00000000],
++		[-6.27274864, -0.00059320, 0.00036349, 0.00059622, -0.00000113, 0.00000000],
++		[-6.27274891, -0.00059309, 0.00036342, 0.00059610, -0.00000113, 0.00000000],
++		[-6.27274919, -0.00059297, 0.00036335, 0.00059599, -0.00000113, 0.00000000],
++		[-6.27274946, -0.00059286, 0.00036329, 0.00059588, -0.00000113, 0.00000000],
++		[-6.27274973, -0.00059275, 0.00036322, 0.00059576, -0.00000113, 0.00000000],
++		[-6.27275000, -0.00059263, 0.00036315, 0.00059565, -0.00000113, 0.00000000],
++		[-6.27275027, -0.00059252, 0.00036308, 0.00059553, -0.00000113, 0.00000000],
++		[-6.27275054, -0.00059241, 0.00036301, 0.00059542, -0.00000113, 0.00000000],
++		[-6.27275081, -0.00059229, 0.00036294, 0.00059531, -0.00000113, 0.00000000],
++		[-6.27275109, -0.00059218, 0.00036287, 0.00059519, -0.00000113, 0.00000000],
++		[-6.27275136, -0.00059207, 0.00036280, 0.00059508, -0.00000113, 0.00000000],
++		[-6.27275163, -0.00059195, 0.00036273, 0.00059496, -0.00000113, 0.00000000],
++		[-6.27275190, -0.00059184, 0.00036266, 0.00059485, -0.00000113, 0.00000000],
++		[-6.27275217, -0.00059173, 0.00036259, 0.00059474, -0.00000113, 0.00000000],
++		[-6.27275244, -0.00059161, 0.00036252, 0.00059462, -0.00000113, 0.00000000],
++		[-6.27275271, -0.00059150, 0.00036245, 0.00059451, -0.00000113, 0.00000000],
++		[-6.27275298, -0.00059139, 0.00036238, 0.00059440, -0.00000113, 0.00000000],
++		[-6.27275325, -0.00059127, 0.00036231, 0.00059428, -0.00000113, 0.00000000],
++		[-6.27275352, -0.00059116, 0.00036224, 0.00059417, -0.00000113, 0.00000000],
++		[-6.27275379, -0.00059105, 0.00036217, 0.00059406, -0.00000113, 0.00000000],
++		[-6.27275406, -0.00059094, 0.00036211, 0.00059394, -0.00000113, 0.00000000],
++		[-6.27275433, -0.00059082, 0.00036204, 0.00059383, -0.00000113, 0.00000000],
++		[-6.27275460, -0.00059071, 0.00036197, 0.00059372, -0.00000113, 0.00000000],
++		[-6.27275487, -0.00059060, 0.00036190, 0.00059360, -0.00000113, 0.00000000],
++		[-6.27275514, -0.00059048, 0.00036183, 0.00059349, -0.00000113, 0.00000000],
++		[-6.27275541, -0.00059037, 0.00036176, 0.00059338, -0.00000113, 0.00000000],
++		[-6.27275568, -0.00059026, 0.00036169, 0.00059326, -0.00000113, 0.00000000],
++		[-6.27275595, -0.00059015, 0.00036162, 0.00059315, -0.00000113, 0.00000000],
++		[-6.27275622, -0.00059003, 0.00036155, 0.00059304, -0.00000113, 0.00000000],
++		[-6.27275649, -0.00058992, 0.00036148, 0.00059292, -0.00000113, 0.00000000],
++		[-6.27275675, -0.00058981, 0.00036141, 0.00059281, -0.00000113, 0.00000000],
++		[-6.27275702, -0.00058970, 0.00036135, 0.00059270, -0.00000113, 0.00000000],
++		[-6.27275729, -0.00058958, 0.00036128, 0.00059258, -0.00000113, 0.00000000],
++		[-6.27275756, -0.00058947, 0.00036121, 0.00059247, -0.00000113, 0.00000000],
++		[-6.27275783, -0.00058936, 0.00036114, 0.00059236, -0.00000113, 0.00000000],
++		[-6.27275810, -0.00058925, 0.00036107, 0.00059225, -0.00000113, 0.00000000],
++		[-6.27275837, -0.00058914, 0.00036100, 0.00059213, -0.00000113, 0.00000000],
++		[-6.27275863, -0.00058902, 0.00036093, 0.00059202, -0.00000113, 0.00000000],
++		[-6.27275890, -0.00058891, 0.00036086, 0.00059191, -0.00000113, 0.00000000],
++		[-6.27275917, -0.00058880, 0.00036080, 0.00059180, -0.00000113, 0.00000000],
++		[-6.27275944, -0.00058869, 0.00036073, 0.00059168, -0.00000113, 0.00000000],
++		[-6.27275971, -0.00058858, 0.00036066, 0.00059157, -0.00000113, 0.00000000],
++		[-6.27275997, -0.00058846, 0.00036059, 0.00059146, -0.00000113, 0.00000000],
++		[-6.27276024, -0.00058835, 0.00036052, 0.00059135, -0.00000113, 0.00000000],
++		[-6.27276051, -0.00058824, 0.00036045, 0.00059123, -0.00000113, 0.00000000],
++		[-6.27276078, -0.00058813, 0.00036038, 0.00059112, -0.00000113, 0.00000000],
++		[-6.27276104, -0.00058802, 0.00036032, 0.00059101, -0.00000113, 0.00000000],
++		[-6.27276131, -0.00058790, 0.00036025, 0.00059090, -0.00000113, 0.00000000],
++		[-6.27276158, -0.00058779, 0.00036018, 0.00059078, -0.00000113, 0.00000000],
++		[-6.27276184, -0.00058768, 0.00036011, 0.00059067, -0.00000113, 0.00000000],
++		[-6.27276211, -0.00058757, 0.00036004, 0.00059056, -0.00000113, 0.00000000],
++		[-6.27276238, -0.00058746, 0.00035997, 0.00059045, -0.00000113, 0.00000000],
++		[-6.27276265, -0.00058735, 0.00035991, 0.00059034, -0.00000113, 0.00000000],
++		[-6.27276291, -0.00058724, 0.00035984, 0.00059022, -0.00000113, 0.00000000],
++		[-6.27276318, -0.00058712, 0.00035977, 0.00059011, -0.00000113, 0.00000000],
++		[-6.27276344, -0.00058701, 0.00035970, 0.00059000, -0.00000113, 0.00000000],
++		[-6.27276371, -0.00058690, 0.00035963, 0.00058989, -0.00000113, 0.00000000],
++		[-6.27276398, -0.00058679, 0.00035956, 0.00058978, -0.00000113, 0.00000000],
++		[-6.27276424, -0.00058668, 0.00035950, 0.00058966, -0.00000113, 0.00000000],
++		[-6.27276451, -0.00058657, 0.00035943, 0.00058955, -0.00000113, 0.00000000],
++		[-6.27276478, -0.00058646, 0.00035936, 0.00058944, -0.00000113, 0.00000000],
++		[-6.27276504, -0.00058635, 0.00035929, 0.00058933, -0.00000113, 0.00000000],
++		[-6.27276531, -0.00058623, 0.00035922, 0.00058922, -0.00000113, 0.00000000],
++		[-6.27276557, -0.00058612, 0.00035916, 0.00058911, -0.00000113, 0.00000000],
++		[-6.27276584, -0.00058601, 0.00035909, 0.00058899, -0.00000113, 0.00000000],
++		[-6.27276610, -0.00058590, 0.00035902, 0.00058888, -0.00000113, 0.00000000],
++		[-6.27276637, -0.00058579, 0.00035895, 0.00058877, -0.00000113, 0.00000000],
++		[-6.27276663, -0.00058568, 0.00035888, 0.00058866, -0.00000113, 0.00000000],
++		[-6.27276690, -0.00058557, 0.00035882, 0.00058855, -0.00000113, 0.00000000],
++		[-6.27276716, -0.00058546, 0.00035875, 0.00058844, -0.00000113, 0.00000000],
++		[-6.27276743, -0.00058535, 0.00035868, 0.00058833, -0.00000113, 0.00000000],
++		[-6.27276769, -0.00058524, 0.00035861, 0.00058821, -0.00000113, 0.00000000],
++		[-6.27276796, -0.00058513, 0.00035854, 0.00058810, -0.00000113, 0.00000000],
++		[-6.27276822, -0.00058502, 0.00035848, 0.00058799, -0.00000113, 0.00000000],
++		[-6.27276849, -0.00058491, 0.00035841, 0.00058788, -0.00000113, 0.00000000],
++		[-6.27276875, -0.00058480, 0.00035834, 0.00058777, -0.00000113, 0.00000000],
++		[-6.27276902, -0.00058468, 0.00035827, 0.00058766, -0.00000113, 0.00000000],
++		[-6.27276928, -0.00058457, 0.00035820, 0.00058755, -0.00000113, 0.00000000],
++		[-6.27276954, -0.00058446, 0.00035814, 0.00058744, -0.00000113, 0.00000000],
++		[-6.27276981, -0.00058435, 0.00035807, 0.00058733, -0.00000113, 0.00000000],
++		[-6.27277007, -0.00058424, 0.00035800, 0.00058721, -0.00000113, 0.00000000],
++		[-6.27277034, -0.00058413, 0.00035793, 0.00058710, -0.00000113, 0.00000000],
++		[-6.27277060, -0.00058402, 0.00035787, 0.00058699, -0.00000113, 0.00000000],
++		[-6.27277086, -0.00058391, 0.00035780, 0.00058688, -0.00000113, 0.00000000],
++		[-6.27277113, -0.00058380, 0.00035773, 0.00058677, -0.00000113, 0.00000000],
++		[-6.27277139, -0.00058369, 0.00035766, 0.00058666, -0.00000113, 0.00000000],
++		[-6.27277165, -0.00058358, 0.00035760, 0.00058655, -0.00000113, 0.00000000],
++		[-6.27277192, -0.00058347, 0.00035753, 0.00058644, -0.00000113, 0.00000000],
++		[-6.27277218, -0.00058336, 0.00035746, 0.00058633, -0.00000113, 0.00000000],
++		[-6.27277244, -0.00058325, 0.00035739, 0.00058622, -0.00000113, 0.00000000],
++		[-6.27277270, -0.00058314, 0.00035733, 0.00058611, -0.00000113, 0.00000000],
++		[-6.27277297, -0.00058303, 0.00035726, 0.00058600, -0.00000113, 0.00000000],
++		[-6.27277323, -0.00058292, 0.00035719, 0.00058589, -0.00000113, 0.00000000],
++		[-6.27277349, -0.00058281, 0.00035712, 0.00058578, -0.00000113, 0.00000000],
++		[-6.27277376, -0.00058270, 0.00035706, 0.00058567, -0.00000113, 0.00000000],
++		[-6.27277402, -0.00058259, 0.00035699, 0.00058556, -0.00000113, 0.00000000],
++		[-6.27277428, -0.00058248, 0.00035692, 0.00058545, -0.00000113, 0.00000000],
++		[-6.27277454, -0.00058237, 0.00035686, 0.00058534, -0.00000113, 0.00000000],
++		[-6.27277480, -0.00058227, 0.00035679, 0.00058523, -0.00000113, 0.00000000],
++		[-6.27277507, -0.00058216, 0.00035672, 0.00058512, -0.00000113, 0.00000000],
++		[-6.27277533, -0.00058205, 0.00035665, 0.00058501, -0.00000113, 0.00000000],
++		[-6.27277559, -0.00058194, 0.00035659, 0.00058490, -0.00000113, 0.00000000],
++		[-6.27277585, -0.00058183, 0.00035652, 0.00058479, -0.00000113, 0.00000000],
++		[-6.27277611, -0.00058172, 0.00035645, 0.00058468, -0.00000113, 0.00000000],
++		[-6.27277637, -0.00058161, 0.00035639, 0.00058457, -0.00000113, 0.00000000],
++		[-6.27277664, -0.00058150, 0.00035632, 0.00058446, -0.00000113, 0.00000000],
++		[-6.27277690, -0.00058139, 0.00035625, 0.00058435, -0.00000113, 0.00000000],
++		[-6.27277716, -0.00058128, 0.00035619, 0.00058424, -0.00000113, 0.00000000],
++		[-6.27277742, -0.00058117, 0.00035612, 0.00058413, -0.00000113, 0.00000000],
++		[-6.27277768, -0.00058106, 0.00035605, 0.00058402, -0.00000113, 0.00000000],
++		[-6.27277794, -0.00058095, 0.00035598, 0.00058391, -0.00000113, 0.00000000],
++		[-6.27277820, -0.00058084, 0.00035592, 0.00058380, -0.00000113, 0.00000000],
++		[-6.27277846, -0.00058074, 0.00035585, 0.00058369, -0.00000113, 0.00000000],
++		[-6.27277872, -0.00058063, 0.00035578, 0.00058358, -0.00000113, 0.00000000],
++		[-6.27277898, -0.00058052, 0.00035572, 0.00058347, -0.00000113, 0.00000000],
++		[-6.27277924, -0.00058041, 0.00035565, 0.00058336, -0.00000113, 0.00000000],
++		[-6.27277950, -0.00058030, 0.00035558, 0.00058325, -0.00000113, 0.00000000],
++		[-6.27277977, -0.00058019, 0.00035552, 0.00058314, -0.00000113, 0.00000000],
++		[-6.27278003, -0.00058008, 0.00035545, 0.00058303, -0.00000113, 0.00000000],
++		[-6.27278029, -0.00057997, 0.00035538, 0.00058292, -0.00000113, 0.00000000],
++		[-6.27278055, -0.00057987, 0.00035532, 0.00058281, -0.00000113, 0.00000000],
++		[-6.27278080, -0.00057976, 0.00035525, 0.00058271, -0.00000113, 0.00000000],
++		[-6.27278106, -0.00057965, 0.00035518, 0.00058260, -0.00000113, 0.00000000],
++		[-6.27278132, -0.00057954, 0.00035512, 0.00058249, -0.00000113, 0.00000000],
++		[-6.27278158, -0.00057943, 0.00035505, 0.00058238, -0.00000113, 0.00000000],
++		[-6.27278184, -0.00057932, 0.00035498, 0.00058227, -0.00000113, 0.00000000],
++		[-6.27278210, -0.00057921, 0.00035492, 0.00058216, -0.00000113, 0.00000000],
++		[-6.27278236, -0.00057911, 0.00035485, 0.00058205, -0.00000113, 0.00000000],
++		[-6.27278262, -0.00057900, 0.00035479, 0.00058194, -0.00000113, 0.00000000],
++		[-6.27278288, -0.00057889, 0.00035472, 0.00058183, -0.00000113, 0.00000000],
++		[-6.27278314, -0.00057878, 0.00035465, 0.00058172, -0.00000113, 0.00000000],
++		[-6.27278340, -0.00057867, 0.00035459, 0.00058162, -0.00000113, 0.00000000],
++		[-6.27278366, -0.00057857, 0.00035452, 0.00058151, -0.00000113, 0.00000000],
++		[-6.27278392, -0.00057846, 0.00035445, 0.00058140, -0.00000113, 0.00000000],
++		[-6.27278417, -0.00057835, 0.00035439, 0.00058129, -0.00000113, 0.00000000],
++		[-6.27278443, -0.00057824, 0.00035432, 0.00058118, -0.00000113, 0.00000000],
++		[-6.27278469, -0.00057813, 0.00035425, 0.00058107, -0.00000113, 0.00000000],
++		[-6.27278495, -0.00057802, 0.00035419, 0.00058096, -0.00000113, 0.00000000],
++		[-6.27278521, -0.00057792, 0.00035412, 0.00058086, -0.00000113, 0.00000000],
++		[-6.27278547, -0.00057781, 0.00035406, 0.00058075, -0.00000113, 0.00000000],
++		[-6.27278572, -0.00057770, 0.00035399, 0.00058064, -0.00000113, 0.00000000],
++		[-6.27278598, -0.00057759, 0.00035392, 0.00058053, -0.00000113, 0.00000000],
++		[-6.27278624, -0.00057749, 0.00035386, 0.00058042, -0.00000113, 0.00000000],
++		[-6.27278650, -0.00057738, 0.00035379, 0.00058031, -0.00000113, 0.00000000],
++		[-6.27278675, -0.00057727, 0.00035373, 0.00058021, -0.00000113, 0.00000000],
++		[-6.27278701, -0.00057716, 0.00035366, 0.00058010, -0.00000113, 0.00000000],
++		[-6.27278727, -0.00057706, 0.00035359, 0.00057999, -0.00000113, 0.00000000],
++		[-6.27278753, -0.00057695, 0.00035353, 0.00057988, -0.00000113, 0.00000000],
++		[-6.27278778, -0.00057684, 0.00035346, 0.00057977, -0.00000113, 0.00000000],
++		[-6.27278804, -0.00057673, 0.00035340, 0.00057966, -0.00000113, 0.00000000],
++		[-6.27278830, -0.00057663, 0.00035333, 0.00057956, -0.00000113, 0.00000000],
++		[-6.27278855, -0.00057652, 0.00035326, 0.00057945, -0.00000113, 0.00000000],
++		[-6.27278881, -0.00057641, 0.00035320, 0.00057934, -0.00000113, 0.00000000],
++		[-6.27278907, -0.00057630, 0.00035313, 0.00057923, -0.00000113, 0.00000000],
++		[-6.27278933, -0.00057620, 0.00035307, 0.00057913, -0.00000113, 0.00000000],
++		[-6.27278958, -0.00057609, 0.00035300, 0.00057902, -0.00000113, 0.00000000],
++		[-6.27278984, -0.00057598, 0.00035294, 0.00057891, -0.00000113, 0.00000000],
++		[-6.27279009, -0.00057587, 0.00035287, 0.00057880, -0.00000113, 0.00000000],
++		[-6.27279035, -0.00057577, 0.00035280, 0.00057869, -0.00000113, 0.00000000],
++		[-6.27279061, -0.00057566, 0.00035274, 0.00057859, -0.00000113, 0.00000000],
++		[-6.27279086, -0.00057555, 0.00035267, 0.00057848, -0.00000113, 0.00000000],
++		[-6.27279112, -0.00057545, 0.00035261, 0.00057837, -0.00000113, 0.00000000],
++		[-6.27279137, -0.00057534, 0.00035254, 0.00057826, -0.00000113, 0.00000000],
++		[-6.27279163, -0.00057523, 0.00035248, 0.00057816, -0.00000113, 0.00000000],
++		[-6.27279189, -0.00057513, 0.00035241, 0.00057805, -0.00000113, 0.00000000],
++		[-6.27279214, -0.00057502, 0.00035235, 0.00057794, -0.00000113, 0.00000000],
++		[-6.27279240, -0.00057491, 0.00035228, 0.00057783, -0.00000113, 0.00000000],
++		[-6.27279265, -0.00057480, 0.00035221, 0.00057773, -0.00000113, 0.00000000],
++		[-6.27279291, -0.00057470, 0.00035215, 0.00057762, -0.00000113, 0.00000000],
++		[-6.27279316, -0.00057459, 0.00035208, 0.00057751, -0.00000113, 0.00000000],
++		[-6.27279342, -0.00057448, 0.00035202, 0.00057741, -0.00000113, 0.00000000],
++		[-6.27279367, -0.00057438, 0.00035195, 0.00057730, -0.00000113, 0.00000000],
++		[-6.27279393, -0.00057427, 0.00035189, 0.00057719, -0.00000113, 0.00000000],
++		[-6.27279418, -0.00057417, 0.00035182, 0.00057708, -0.00000113, 0.00000000],
++		[-6.27279444, -0.00057406, 0.00035176, 0.00057698, -0.00000113, 0.00000000],
++		[-6.27279469, -0.00057395, 0.00035169, 0.00057687, -0.00000113, 0.00000000],
++		[-6.27279495, -0.00057385, 0.00035163, 0.00057676, -0.00000113, 0.00000000],
++		[-6.27279520, -0.00057374, 0.00035156, 0.00057666, -0.00000113, 0.00000000],
++		[-6.27279546, -0.00057363, 0.00035150, 0.00057655, -0.00000113, 0.00000000],
++		[-6.27279571, -0.00057353, 0.00035143, 0.00057644, -0.00000113, 0.00000000],
++		[-6.27279596, -0.00057342, 0.00035137, 0.00057634, -0.00000113, 0.00000000],
++		[-6.27279622, -0.00057331, 0.00035130, 0.00057623, -0.00000113, 0.00000000],
++		[-6.27279647, -0.00057321, 0.00035124, 0.00057612, -0.00000113, 0.00000000],
++		[-6.27279673, -0.00057310, 0.00035117, 0.00057602, -0.00000113, 0.00000000],
++		[-6.27279698, -0.00057300, 0.00035111, 0.00057591, -0.00000113, 0.00000000],
++		[-6.27279723, -0.00057289, 0.00035104, 0.00057580, -0.00000113, 0.00000000],
++		[-6.27279749, -0.00057278, 0.00035098, 0.00057570, -0.00000113, 0.00000000],
++		[-6.27279774, -0.00057268, 0.00035091, 0.00057559, -0.00000113, 0.00000000],
++		[-6.27279799, -0.00057257, 0.00035085, 0.00057548, -0.00000113, 0.00000000],
++		[-6.27279825, -0.00057247, 0.00035078, 0.00057538, -0.00000113, 0.00000000],
++		[-6.27279850, -0.00057236, 0.00035072, 0.00057527, -0.00000113, 0.00000000],
++		[-6.27279875, -0.00057225, 0.00035065, 0.00057516, -0.00000113, 0.00000000],
++		[-6.27279901, -0.00057215, 0.00035059, 0.00057506, -0.00000113, 0.00000000],
++		[-6.27279926, -0.00057204, 0.00035052, 0.00057495, -0.00000113, 0.00000000],
++		[-6.27279951, -0.00057194, 0.00035046, 0.00057484, -0.00000113, 0.00000000],
++		[-6.27279977, -0.00057183, 0.00035039, 0.00057474, -0.00000113, 0.00000000],
++		[-6.27280002, -0.00057173, 0.00035033, 0.00057463, -0.00000113, 0.00000000],
++		[-6.27280027, -0.00057162, 0.00035026, 0.00057453, -0.00000113, 0.00000000],
++		[-6.27280052, -0.00057152, 0.00035020, 0.00057442, -0.00000113, 0.00000000],
++		[-6.27280078, -0.00057141, 0.00035013, 0.00057431, -0.00000113, 0.00000000],
++		[-6.27280103, -0.00057130, 0.00035007, 0.00057421, -0.00000113, 0.00000000],
++		[-6.27280128, -0.00057120, 0.00035000, 0.00057410, -0.00000113, 0.00000000],
++		[-6.27280153, -0.00057109, 0.00034994, 0.00057400, -0.00000113, 0.00000000],
++		[-6.27280178, -0.00057099, 0.00034987, 0.00057389, -0.00000113, 0.00000000],
++		[-6.27280204, -0.00057088, 0.00034981, 0.00057378, -0.00000113, 0.00000000],
++		[-6.27280229, -0.00057078, 0.00034974, 0.00057368, -0.00000113, 0.00000000],
++		[-6.27280254, -0.00057067, 0.00034968, 0.00057357, -0.00000113, 0.00000000],
++		[-6.27280279, -0.00057057, 0.00034962, 0.00057347, -0.00000113, 0.00000000],
++		[-6.27280304, -0.00057046, 0.00034955, 0.00057336, -0.00000113, 0.00000000],
++		[-6.27280329, -0.00057036, 0.00034949, 0.00057326, -0.00000113, 0.00000000],
++		[-6.27280355, -0.00057025, 0.00034942, 0.00057315, -0.00000113, 0.00000000],
++		[-6.27280380, -0.00057015, 0.00034936, 0.00057304, -0.00000113, 0.00000000],
++		[-6.27280405, -0.00057004, 0.00034929, 0.00057294, -0.00000113, 0.00000000],
++		[-6.27280430, -0.00056994, 0.00034923, 0.00057283, -0.00000113, 0.00000000],
++		[-6.27280455, -0.00056983, 0.00034916, 0.00057273, -0.00000113, 0.00000000],
++		[-6.27280480, -0.00056973, 0.00034910, 0.00057262, -0.00000113, 0.00000000],
++		[-6.27280505, -0.00056962, 0.00034904, 0.00057252, -0.00000113, 0.00000000],
++		[-6.27280530, -0.00056952, 0.00034897, 0.00057241, -0.00000113, 0.00000000],
++		[-6.27280555, -0.00056941, 0.00034891, 0.00057231, -0.00000113, 0.00000000],
++		[-6.27280580, -0.00056931, 0.00034884, 0.00057220, -0.00000113, 0.00000000],
++		[-6.27280606, -0.00056920, 0.00034878, 0.00057210, -0.00000113, 0.00000000],
++		[-6.27280631, -0.00056910, 0.00034872, 0.00057199, -0.00000113, 0.00000000],
++		[-6.27280656, -0.00056899, 0.00034865, 0.00057189, -0.00000113, 0.00000000],
++		[-6.27280681, -0.00056889, 0.00034859, 0.00057178, -0.00000113, 0.00000000],
++		[-6.27280706, -0.00056878, 0.00034852, 0.00057168, -0.00000113, 0.00000000],
++		[-6.27280731, -0.00056868, 0.00034846, 0.00057157, -0.00000113, 0.00000000],
++		[-6.27280756, -0.00056858, 0.00034839, 0.00057147, -0.00000113, 0.00000000],
++		[-6.27280781, -0.00056847, 0.00034833, 0.00057136, -0.00000113, 0.00000000],
++		[-6.27280806, -0.00056837, 0.00034827, 0.00057126, -0.00000113, 0.00000000],
++		[-6.27280830, -0.00056826, 0.00034820, 0.00057115, -0.00000113, 0.00000000],
++		[-6.27280855, -0.00056816, 0.00034814, 0.00057105, -0.00000113, 0.00000000],
++		[-6.27280880, -0.00056805, 0.00034807, 0.00057094, -0.00000113, 0.00000000],
++		[-6.27280905, -0.00056795, 0.00034801, 0.00057084, -0.00000113, 0.00000000],
++		[-6.27280930, -0.00056785, 0.00034795, 0.00057073, -0.00000113, 0.00000000],
++		[-6.27280955, -0.00056774, 0.00034788, 0.00057063, -0.00000113, 0.00000000],
++		[-6.27280980, -0.00056764, 0.00034782, 0.00057052, -0.00000113, 0.00000000],
++		[-6.27281005, -0.00056753, 0.00034776, 0.00057042, -0.00000113, 0.00000000],
++		[-6.27281030, -0.00056743, 0.00034769, 0.00057031, -0.00000113, 0.00000000],
++		[-6.27281055, -0.00056733, 0.00034763, 0.00057021, -0.00000113, 0.00000000],
++		[-6.27281080, -0.00056722, 0.00034756, 0.00057010, -0.00000113, 0.00000000],
++		[-6.27281104, -0.00056712, 0.00034750, 0.00057000, -0.00000113, 0.00000000],
++		[-6.27281129, -0.00056701, 0.00034744, 0.00056990, -0.00000113, 0.00000000],
++		[-6.27281154, -0.00056691, 0.00034737, 0.00056979, -0.00000113, 0.00000000],
++		[-6.27281179, -0.00056681, 0.00034731, 0.00056969, -0.00000113, 0.00000000],
++		[-6.27281204, -0.00056670, 0.00034725, 0.00056958, -0.00000113, 0.00000000],
++		[-6.27281229, -0.00056660, 0.00034718, 0.00056948, -0.00000113, 0.00000000],
++		[-6.27281253, -0.00056649, 0.00034712, 0.00056937, -0.00000113, 0.00000000],
++		[-6.27281278, -0.00056639, 0.00034706, 0.00056927, -0.00000113, 0.00000000],
++		[-6.27281303, -0.00056629, 0.00034699, 0.00056917, -0.00000113, 0.00000000],
++		[-6.27281328, -0.00056618, 0.00034693, 0.00056906, -0.00000113, 0.00000000],
++		[-6.27281353, -0.00056608, 0.00034686, 0.00056896, -0.00000113, 0.00000000],
++		[-6.27281377, -0.00056598, 0.00034680, 0.00056885, -0.00000113, 0.00000000],
++		[-6.27281402, -0.00056587, 0.00034674, 0.00056875, -0.00000113, 0.00000000],
++		[-6.27281427, -0.00056577, 0.00034667, 0.00056865, -0.00000113, 0.00000000],
++		[-6.27281452, -0.00056567, 0.00034661, 0.00056854, -0.00000113, 0.00000000],
++		[-6.27281476, -0.00056556, 0.00034655, 0.00056844, -0.00000113, 0.00000000],
++		[-6.27281501, -0.00056546, 0.00034648, 0.00056833, -0.00000113, 0.00000000],
++		[-6.27281526, -0.00056536, 0.00034642, 0.00056823, -0.00000113, 0.00000000],
++		[-6.27281550, -0.00056525, 0.00034636, 0.00056813, -0.00000113, 0.00000000],
++		[-6.27281575, -0.00056515, 0.00034629, 0.00056802, -0.00000113, 0.00000000],
++		[-6.27281600, -0.00056505, 0.00034623, 0.00056792, -0.00000113, 0.00000000],
++		[-6.27281624, -0.00056494, 0.00034617, 0.00056781, -0.00000113, 0.00000000],
++		[-6.27281649, -0.00056484, 0.00034610, 0.00056771, -0.00000113, 0.00000000],
++		[-6.27281674, -0.00056474, 0.00034604, 0.00056761, -0.00000113, 0.00000000],
++		[-6.27281698, -0.00056463, 0.00034598, 0.00056750, -0.00000113, 0.00000000],
++		[-6.27281723, -0.00056453, 0.00034592, 0.00056740, -0.00000113, 0.00000000],
++		[-6.27281748, -0.00056443, 0.00034585, 0.00056730, -0.00000113, 0.00000000],
++		[-6.27281772, -0.00056433, 0.00034579, 0.00056719, -0.00000113, 0.00000000],
++		[-6.27281797, -0.00056422, 0.00034573, 0.00056709, -0.00000113, 0.00000000],
++		[-6.27281822, -0.00056412, 0.00034566, 0.00056699, -0.00000113, 0.00000000],
++		[-6.27281846, -0.00056402, 0.00034560, 0.00056688, -0.00000113, 0.00000000],
++		[-6.27281871, -0.00056391, 0.00034554, 0.00056678, -0.00000113, 0.00000000],
++		[-6.27281895, -0.00056381, 0.00034547, 0.00056668, -0.00000113, 0.00000000],
++		[-6.27281920, -0.00056371, 0.00034541, 0.00056657, -0.00000113, 0.00000000],
++		[-6.27281944, -0.00056361, 0.00034535, 0.00056647, -0.00000113, 0.00000000],
++		[-6.27281969, -0.00056350, 0.00034528, 0.00056637, -0.00000113, 0.00000000],
++		[-6.27281993, -0.00056340, 0.00034522, 0.00056626, -0.00000113, 0.00000000],
++		[-6.27282018, -0.00056330, 0.00034516, 0.00056616, -0.00000113, 0.00000000],
++		[-6.27282043, -0.00056320, 0.00034510, 0.00056606, -0.00000113, 0.00000000],
++		[-6.27282067, -0.00056309, 0.00034503, 0.00056596, -0.00000113, 0.00000000],
++		[-6.27282092, -0.00056299, 0.00034497, 0.00056585, -0.00000113, 0.00000000],
++		[-6.27282116, -0.00056289, 0.00034491, 0.00056575, -0.00000113, 0.00000000],
++		[-6.27282141, -0.00056279, 0.00034485, 0.00056565, -0.00000113, 0.00000000],
++		[-6.27282165, -0.00056268, 0.00034478, 0.00056554, -0.00000113, 0.00000000],
++		[-6.27282189, -0.00056258, 0.00034472, 0.00056544, -0.00000113, 0.00000000],
++		[-6.27282214, -0.00056248, 0.00034466, 0.00056534, -0.00000113, 0.00000000],
++		[-6.27282238, -0.00056238, 0.00034459, 0.00056524, -0.00000113, 0.00000000],
++		[-6.27282263, -0.00056228, 0.00034453, 0.00056513, -0.00000113, 0.00000000],
++		[-6.27282287, -0.00056217, 0.00034447, 0.00056503, -0.00000113, 0.00000000],
++		[-6.27282312, -0.00056207, 0.00034441, 0.00056493, -0.00000113, 0.00000000],
++		[-6.27282336, -0.00056197, 0.00034434, 0.00056483, -0.00000113, 0.00000000],
++		[-6.27282360, -0.00056187, 0.00034428, 0.00056472, -0.00000113, 0.00000000],
++		[-6.27282385, -0.00056177, 0.00034422, 0.00056462, -0.00000113, 0.00000000],
++		[-6.27282409, -0.00056166, 0.00034416, 0.00056452, -0.00000113, 0.00000000],
++		[-6.27282434, -0.00056156, 0.00034409, 0.00056442, -0.00000113, 0.00000000],
++		[-6.27282458, -0.00056146, 0.00034403, 0.00056431, -0.00000113, 0.00000000],
++		[-6.27282482, -0.00056136, 0.00034397, 0.00056421, -0.00000113, 0.00000000],
++		[-6.27282507, -0.00056126, 0.00034391, 0.00056411, -0.00000113, 0.00000000],
++		[-6.27282531, -0.00056115, 0.00034384, 0.00056401, -0.00000113, 0.00000000],
++		[-6.27282555, -0.00056105, 0.00034378, 0.00056390, -0.00000113, 0.00000000],
++		[-6.27282580, -0.00056095, 0.00034372, 0.00056380, -0.00000113, 0.00000000],
++		[-6.27282604, -0.00056085, 0.00034366, 0.00056370, -0.00000113, 0.00000000],
++		[-6.27282628, -0.00056075, 0.00034360, 0.00056360, -0.00000113, 0.00000000],
++		[-6.27282653, -0.00056065, 0.00034353, 0.00056349, -0.00000113, 0.00000000],
++		[-6.27282677, -0.00056055, 0.00034347, 0.00056339, -0.00000113, 0.00000000],
++		[-6.27282701, -0.00056044, 0.00034341, 0.00056329, -0.00000113, 0.00000000],
++		[-6.27282725, -0.00056034, 0.00034335, 0.00056319, -0.00000113, 0.00000000],
++		[-6.27282750, -0.00056024, 0.00034328, 0.00056309, -0.00000113, 0.00000000],
++		[-6.27282774, -0.00056014, 0.00034322, 0.00056299, -0.00000113, 0.00000000],
++		[-6.27282798, -0.00056004, 0.00034316, 0.00056288, -0.00000113, 0.00000000],
++		[-6.27282822, -0.00055994, 0.00034310, 0.00056278, -0.00000113, 0.00000000],
++		[-6.27282847, -0.00055984, 0.00034304, 0.00056268, -0.00000113, 0.00000000],
++		[-6.27282871, -0.00055973, 0.00034297, 0.00056258, -0.00000113, 0.00000000],
++		[-6.27282895, -0.00055963, 0.00034291, 0.00056248, -0.00000113, 0.00000000],
++		[-6.27282919, -0.00055953, 0.00034285, 0.00056237, -0.00000113, 0.00000000],
++		[-6.27282944, -0.00055943, 0.00034279, 0.00056227, -0.00000113, 0.00000000],
++		[-6.27282968, -0.00055933, 0.00034273, 0.00056217, -0.00000113, 0.00000000],
++		[-6.27282992, -0.00055923, 0.00034266, 0.00056207, -0.00000113, 0.00000000],
++		[-6.27283016, -0.00055913, 0.00034260, 0.00056197, -0.00000113, 0.00000000],
++		[-6.27283040, -0.00055903, 0.00034254, 0.00056187, -0.00000113, 0.00000000],
++		[-6.27283064, -0.00055893, 0.00034248, 0.00056177, -0.00000113, 0.00000000],
++		[-6.27283089, -0.00055882, 0.00034242, 0.00056166, -0.00000113, 0.00000000],
++		[-6.27283113, -0.00055872, 0.00034235, 0.00056156, -0.00000113, 0.00000000],
++		[-6.27283137, -0.00055862, 0.00034229, 0.00056146, -0.00000113, 0.00000000],
++		[-6.27283161, -0.00055852, 0.00034223, 0.00056136, -0.00000113, 0.00000000],
++		[-6.27283185, -0.00055842, 0.00034217, 0.00056126, -0.00000113, 0.00000000],
++		[-6.27283209, -0.00055832, 0.00034211, 0.00056116, -0.00000113, 0.00000000],
++		[-6.27283233, -0.00055822, 0.00034204, 0.00056106, -0.00000113, 0.00000000],
++		[-6.27283257, -0.00055812, 0.00034198, 0.00056095, -0.00000113, 0.00000000],
++		[-6.27283281, -0.00055802, 0.00034192, 0.00056085, -0.00000113, 0.00000000],
++		[-6.27283305, -0.00055792, 0.00034186, 0.00056075, -0.00000113, 0.00000000],
++		[-6.27283329, -0.00055782, 0.00034180, 0.00056065, -0.00000113, 0.00000000],
++		[-6.27283353, -0.00055772, 0.00034174, 0.00056055, -0.00000113, 0.00000000],
++		[-6.27283378, -0.00055762, 0.00034168, 0.00056045, -0.00000113, 0.00000000],
++		[-6.27283402, -0.00055752, 0.00034161, 0.00056035, -0.00000113, 0.00000000],
++		[-6.27283426, -0.00055742, 0.00034155, 0.00056025, -0.00000113, 0.00000000],
++		[-6.27283450, -0.00055732, 0.00034149, 0.00056015, -0.00000113, 0.00000000],
++		[-6.27283474, -0.00055722, 0.00034143, 0.00056005, -0.00000113, 0.00000000],
++		[-6.27283498, -0.00055712, 0.00034137, 0.00055994, -0.00000113, 0.00000000],
++		[-6.27283522, -0.00055701, 0.00034131, 0.00055984, -0.00000113, 0.00000000],
++		[-6.27283546, -0.00055691, 0.00034124, 0.00055974, -0.00000113, 0.00000000],
++		[-6.27283570, -0.00055681, 0.00034118, 0.00055964, -0.00000113, 0.00000000],
++		[-6.27283593, -0.00055671, 0.00034112, 0.00055954, -0.00000113, 0.00000000],
++		[-6.27283617, -0.00055661, 0.00034106, 0.00055944, -0.00000113, 0.00000000],
++		[-6.27283641, -0.00055651, 0.00034100, 0.00055934, -0.00000113, 0.00000000],
++		[-6.27283665, -0.00055641, 0.00034094, 0.00055924, -0.00000113, 0.00000000],
++		[-6.27283689, -0.00055631, 0.00034088, 0.00055914, -0.00000113, 0.00000000],
++		[-6.27283713, -0.00055621, 0.00034081, 0.00055904, -0.00000113, 0.00000000],
++		[-6.27283737, -0.00055611, 0.00034075, 0.00055894, -0.00000113, 0.00000000],
++		[-6.27283761, -0.00055601, 0.00034069, 0.00055884, -0.00000113, 0.00000000],
++		[-6.27283785, -0.00055591, 0.00034063, 0.00055874, -0.00000113, 0.00000000],
++		[-6.27283809, -0.00055581, 0.00034057, 0.00055864, -0.00000113, 0.00000000],
++		[-6.27283833, -0.00055571, 0.00034051, 0.00055854, -0.00000113, 0.00000000],
++		[-6.27283856, -0.00055562, 0.00034045, 0.00055844, -0.00000113, 0.00000000],
++		[-6.27283880, -0.00055552, 0.00034039, 0.00055834, -0.00000113, 0.00000000],
++		[-6.27283904, -0.00055542, 0.00034033, 0.00055824, -0.00000113, 0.00000000],
++		[-6.27283928, -0.00055532, 0.00034026, 0.00055814, -0.00000113, 0.00000000],
++		[-6.27283952, -0.00055522, 0.00034020, 0.00055804, -0.00000113, 0.00000000],
++		[-6.27283976, -0.00055512, 0.00034014, 0.00055794, -0.00000113, 0.00000000],
++		[-6.27283999, -0.00055502, 0.00034008, 0.00055784, -0.00000113, 0.00000000],
++		[-6.27284023, -0.00055492, 0.00034002, 0.00055774, -0.00000113, 0.00000000],
++		[-6.27284047, -0.00055482, 0.00033996, 0.00055764, -0.00000113, 0.00000000],
++		[-6.27284071, -0.00055472, 0.00033990, 0.00055754, -0.00000113, 0.00000000],
++		[-6.27284095, -0.00055462, 0.00033984, 0.00055744, -0.00000113, 0.00000000],
++		[-6.27284118, -0.00055452, 0.00033978, 0.00055734, -0.00000113, 0.00000000],
++		[-6.27284142, -0.00055442, 0.00033972, 0.00055724, -0.00000113, 0.00000000],
++		[-6.27284166, -0.00055432, 0.00033965, 0.00055714, -0.00000113, 0.00000000],
++		[-6.27284190, -0.00055422, 0.00033959, 0.00055704, -0.00000113, 0.00000000],
++		[-6.27284213, -0.00055412, 0.00033953, 0.00055694, -0.00000113, 0.00000000],
++		[-6.27284237, -0.00055402, 0.00033947, 0.00055684, -0.00000113, 0.00000000],
++		[-6.27284261, -0.00055393, 0.00033941, 0.00055674, -0.00000113, 0.00000000],
++		[-6.27284285, -0.00055383, 0.00033935, 0.00055664, -0.00000113, 0.00000000],
++		[-6.27284308, -0.00055373, 0.00033929, 0.00055654, -0.00000113, 0.00000000],
++		[-6.27284332, -0.00055363, 0.00033923, 0.00055644, -0.00000113, 0.00000000],
++		[-6.27284356, -0.00055353, 0.00033917, 0.00055634, -0.00000113, 0.00000000],
++		[-6.27284379, -0.00055343, 0.00033911, 0.00055624, -0.00000113, 0.00000000],
++		[-6.27284403, -0.00055333, 0.00033905, 0.00055614, -0.00000113, 0.00000000],
++		[-6.27284427, -0.00055323, 0.00033899, 0.00055604, -0.00000113, 0.00000000],
++		[-6.27284450, -0.00055313, 0.00033893, 0.00055594, -0.00000113, 0.00000000],
++		[-6.27284474, -0.00055303, 0.00033887, 0.00055584, -0.00000113, 0.00000000],
++		[-6.27284498, -0.00055294, 0.00033880, 0.00055574, -0.00000113, 0.00000000],
++		[-6.27284521, -0.00055284, 0.00033874, 0.00055564, -0.00000113, 0.00000000],
++		[-6.27284545, -0.00055274, 0.00033868, 0.00055555, -0.00000113, 0.00000000],
++		[-6.27284568, -0.00055264, 0.00033862, 0.00055545, -0.00000113, 0.00000000],
++		[-6.27284592, -0.00055254, 0.00033856, 0.00055535, -0.00000113, 0.00000000],
++		[-6.27284616, -0.00055244, 0.00033850, 0.00055525, -0.00000113, 0.00000000],
++		[-6.27284639, -0.00055234, 0.00033844, 0.00055515, -0.00000113, 0.00000000],
++		[-6.27284663, -0.00055225, 0.00033838, 0.00055505, -0.00000113, 0.00000000],
++		[-6.27284686, -0.00055215, 0.00033832, 0.00055495, -0.00000113, 0.00000000],
++		[-6.27284710, -0.00055205, 0.00033826, 0.00055485, -0.00000113, 0.00000000],
++		[-6.27284733, -0.00055195, 0.00033820, 0.00055475, -0.00000113, 0.00000000],
++		[-6.27284757, -0.00055185, 0.00033814, 0.00055465, -0.00000113, 0.00000000],
++		[-6.27284781, -0.00055175, 0.00033808, 0.00055455, -0.00000113, 0.00000000],
++		[-6.27284804, -0.00055165, 0.00033802, 0.00055446, -0.00000113, 0.00000000],
++		[-6.27284828, -0.00055156, 0.00033796, 0.00055436, -0.00000113, 0.00000000],
++		[-6.27284851, -0.00055146, 0.00033790, 0.00055426, -0.00000113, 0.00000000],
++		[-6.27284875, -0.00055136, 0.00033784, 0.00055416, -0.00000113, 0.00000000],
++		[-6.27284898, -0.00055126, 0.00033778, 0.00055406, -0.00000113, 0.00000000],
++		[-6.27284922, -0.00055116, 0.00033772, 0.00055396, -0.00000113, 0.00000000],
++		[-6.27284945, -0.00055107, 0.00033766, 0.00055386, -0.00000113, 0.00000000],
++		[-6.27284968, -0.00055097, 0.00033760, 0.00055377, -0.00000113, 0.00000000],
++		[-6.27284992, -0.00055087, 0.00033754, 0.00055367, -0.00000113, 0.00000000],
++		[-6.27285015, -0.00055077, 0.00033748, 0.00055357, -0.00000113, 0.00000000],
++		[-6.27285039, -0.00055067, 0.00033742, 0.00055347, -0.00000113, 0.00000000],
++		[-6.27285062, -0.00055058, 0.00033736, 0.00055337, -0.00000113, 0.00000000],
++		[-6.27285086, -0.00055048, 0.00033730, 0.00055327, -0.00000113, 0.00000000],
++		[-6.27285109, -0.00055038, 0.00033724, 0.00055317, -0.00000113, 0.00000000],
++		[-6.27285133, -0.00055028, 0.00033718, 0.00055308, -0.00000113, 0.00000000],
++		[-6.27285156, -0.00055018, 0.00033712, 0.00055298, -0.00000113, 0.00000000],
++		[-6.27285179, -0.00055009, 0.00033706, 0.00055288, -0.00000113, 0.00000000],
++		[-6.27285203, -0.00054999, 0.00033700, 0.00055278, -0.00000113, 0.00000000],
++		[-6.27285226, -0.00054989, 0.00033694, 0.00055268, -0.00000113, 0.00000000],
++		[-6.27285249, -0.00054979, 0.00033688, 0.00055258, -0.00000113, 0.00000000],
++		[-6.27285273, -0.00054970, 0.00033682, 0.00055249, -0.00000113, 0.00000000],
++		[-6.27285296, -0.00054960, 0.00033676, 0.00055239, -0.00000113, 0.00000000],
++		[-6.27285319, -0.00054950, 0.00033670, 0.00055229, -0.00000113, 0.00000000],
++		[-6.27285343, -0.00054940, 0.00033664, 0.00055219, -0.00000113, 0.00000000],
++		[-6.27285366, -0.00054931, 0.00033658, 0.00055209, -0.00000113, 0.00000000],
++		[-6.27285389, -0.00054921, 0.00033652, 0.00055200, -0.00000113, 0.00000000],
++		[-6.27285413, -0.00054911, 0.00033646, 0.00055190, -0.00000113, 0.00000000],
++		[-6.27285436, -0.00054901, 0.00033640, 0.00055180, -0.00000113, 0.00000000],
++		[-6.27285459, -0.00054892, 0.00033634, 0.00055170, -0.00000113, 0.00000000],
++		[-6.27285483, -0.00054882, 0.00033628, 0.00055160, -0.00000113, 0.00000000],
++		[-6.27285506, -0.00054872, 0.00033622, 0.00055151, -0.00000113, 0.00000000],
++		[-6.27285529, -0.00054862, 0.00033616, 0.00055141, -0.00000113, 0.00000000],
++		[-6.27285552, -0.00054853, 0.00033610, 0.00055131, -0.00000113, 0.00000000],
++		[-6.27285576, -0.00054843, 0.00033604, 0.00055121, -0.00000113, 0.00000000],
++		[-6.27285599, -0.00054833, 0.00033598, 0.00055112, -0.00000113, 0.00000000],
++		[-6.27285622, -0.00054824, 0.00033592, 0.00055102, -0.00000113, 0.00000000],
++		[-6.27285645, -0.00054814, 0.00033586, 0.00055092, -0.00000113, 0.00000000],
++		[-6.27285669, -0.00054804, 0.00033580, 0.00055082, -0.00000113, 0.00000000],
++		[-6.27285692, -0.00054794, 0.00033574, 0.00055073, -0.00000113, 0.00000000],
++		[-6.27285715, -0.00054785, 0.00033568, 0.00055063, -0.00000113, 0.00000000],
++		[-6.27285738, -0.00054775, 0.00033563, 0.00055053, -0.00000113, 0.00000000],
++		[-6.27285761, -0.00054765, 0.00033557, 0.00055043, -0.00000113, 0.00000000],
++		[-6.27285785, -0.00054756, 0.00033551, 0.00055034, -0.00000113, 0.00000000],
++		[-6.27285808, -0.00054746, 0.00033545, 0.00055024, -0.00000113, 0.00000000],
++		[-6.27285831, -0.00054736, 0.00033539, 0.00055014, -0.00000113, 0.00000000],
++		[-6.27285854, -0.00054727, 0.00033533, 0.00055004, -0.00000113, 0.00000000],
++		[-6.27285877, -0.00054717, 0.00033527, 0.00054995, -0.00000113, 0.00000000],
++		[-6.27285900, -0.00054707, 0.00033521, 0.00054985, -0.00000113, 0.00000000],
++		[-6.27285923, -0.00054698, 0.00033515, 0.00054975, -0.00000113, 0.00000000],
++		[-6.27285947, -0.00054688, 0.00033509, 0.00054966, -0.00000113, 0.00000000],
++		[-6.27285970, -0.00054678, 0.00033503, 0.00054956, -0.00000113, 0.00000000],
++		[-6.27285993, -0.00054669, 0.00033497, 0.00054946, -0.00000113, 0.00000000],
++		[-6.27286016, -0.00054659, 0.00033491, 0.00054936, -0.00000113, 0.00000000],
++		[-6.27286039, -0.00054649, 0.00033485, 0.00054927, -0.00000113, 0.00000000],
++		[-6.27286062, -0.00054640, 0.00033480, 0.00054917, -0.00000113, 0.00000000],
++		[-6.27286085, -0.00054630, 0.00033474, 0.00054907, -0.00000113, 0.00000000],
++		[-6.27286108, -0.00054620, 0.00033468, 0.00054898, -0.00000113, 0.00000000],
++		[-6.27286131, -0.00054611, 0.00033462, 0.00054888, -0.00000113, 0.00000000],
++		[-6.27286154, -0.00054601, 0.00033456, 0.00054878, -0.00000113, 0.00000000],
++		[-6.27286177, -0.00054591, 0.00033450, 0.00054869, -0.00000113, 0.00000000],
++		[-6.27286200, -0.00054582, 0.00033444, 0.00054859, -0.00000113, 0.00000000],
++		[-6.27286223, -0.00054572, 0.00033438, 0.00054849, -0.00000113, 0.00000000],
++		[-6.27286246, -0.00054563, 0.00033432, 0.00054840, -0.00000113, 0.00000000],
++		[-6.27286269, -0.00054553, 0.00033426, 0.00054830, -0.00000113, 0.00000000],
++		[-6.27286292, -0.00054543, 0.00033420, 0.00054820, -0.00000113, 0.00000000],
++		[-6.27286315, -0.00054534, 0.00033415, 0.00054811, -0.00000113, 0.00000000],
++		[-6.27286338, -0.00054524, 0.00033409, 0.00054801, -0.00000113, 0.00000000],
++		[-6.27286361, -0.00054515, 0.00033403, 0.00054791, -0.00000113, 0.00000000],
++		[-6.27286384, -0.00054505, 0.00033397, 0.00054782, -0.00000113, 0.00000000],
++		[-6.27286407, -0.00054495, 0.00033391, 0.00054772, -0.00000113, 0.00000000],
++		[-6.27286430, -0.00054486, 0.00033385, 0.00054762, -0.00000113, 0.00000000],
++		[-6.27286453, -0.00054476, 0.00033379, 0.00054753, -0.00000113, 0.00000000],
++		[-6.27286476, -0.00054467, 0.00033373, 0.00054743, -0.00000113, 0.00000000],
++		[-6.27286499, -0.00054457, 0.00033368, 0.00054733, -0.00000113, 0.00000000],
++		[-6.27286522, -0.00054447, 0.00033362, 0.00054724, -0.00000113, 0.00000000],
++		[-6.27286545, -0.00054438, 0.00033356, 0.00054714, -0.00000113, 0.00000000],
++		[-6.27286568, -0.00054428, 0.00033350, 0.00054705, -0.00000113, 0.00000000],
++		[-6.27286591, -0.00054419, 0.00033344, 0.00054695, -0.00000113, 0.00000000],
++		[-6.27286614, -0.00054409, 0.00033338, 0.00054685, -0.00000113, 0.00000000],
++		[-6.27286636, -0.00054400, 0.00033332, 0.00054676, -0.00000113, 0.00000000],
++		[-6.27286659, -0.00054390, 0.00033326, 0.00054666, -0.00000113, 0.00000000],
++		[-6.27286682, -0.00054380, 0.00033321, 0.00054657, -0.00000113, 0.00000000],
++		[-6.27286705, -0.00054371, 0.00033315, 0.00054647, -0.00000113, 0.00000000],
++		[-6.27286728, -0.00054361, 0.00033309, 0.00054637, -0.00000113, 0.00000000],
++		[-6.27286751, -0.00054352, 0.00033303, 0.00054628, -0.00000113, 0.00000000],
++		[-6.27286774, -0.00054342, 0.00033297, 0.00054618, -0.00000113, 0.00000000],
++		[-6.27286796, -0.00054333, 0.00033291, 0.00054609, -0.00000113, 0.00000000],
++		[-6.27286819, -0.00054323, 0.00033286, 0.00054599, -0.00000113, 0.00000000],
++		[-6.27286842, -0.00054314, 0.00033280, 0.00054589, -0.00000113, 0.00000000],
++		[-6.27286865, -0.00054304, 0.00033274, 0.00054580, -0.00000113, 0.00000000],
++		[-6.27286888, -0.00054295, 0.00033268, 0.00054570, -0.00000113, 0.00000000],
++		[-6.27286910, -0.00054285, 0.00033262, 0.00054561, -0.00000113, 0.00000000],
++		[-6.27286933, -0.00054276, 0.00033256, 0.00054551, -0.00000113, 0.00000000],
++		[-6.27286956, -0.00054266, 0.00033250, 0.00054542, -0.00000113, 0.00000000],
++		[-6.27286979, -0.00054257, 0.00033245, 0.00054532, -0.00000113, 0.00000000],
++		[-6.27287001, -0.00054247, 0.00033239, 0.00054522, -0.00000113, 0.00000000],
++		[-6.27287024, -0.00054238, 0.00033233, 0.00054513, -0.00000113, 0.00000000],
++		[-6.27287047, -0.00054228, 0.00033227, 0.00054503, -0.00000113, 0.00000000],
++		[-6.27287070, -0.00054219, 0.00033221, 0.00054494, -0.00000113, 0.00000000],
++		[-6.27287092, -0.00054209, 0.00033216, 0.00054484, -0.00000113, 0.00000000],
++		[-6.27287115, -0.00054200, 0.00033210, 0.00054475, -0.00000113, 0.00000000],
++		[-6.27287138, -0.00054190, 0.00033204, 0.00054465, -0.00000113, 0.00000000],
++		[-6.27287160, -0.00054181, 0.00033198, 0.00054456, -0.00000113, 0.00000000],
++		[-6.27287183, -0.00054171, 0.00033192, 0.00054446, -0.00000113, 0.00000000],
++		[-6.27287206, -0.00054162, 0.00033186, 0.00054437, -0.00000113, 0.00000000],
++		[-6.27287228, -0.00054152, 0.00033181, 0.00054427, -0.00000113, 0.00000000],
++		[-6.27287251, -0.00054143, 0.00033175, 0.00054417, -0.00000113, 0.00000000],
++		[-6.27287274, -0.00054133, 0.00033169, 0.00054408, -0.00000113, 0.00000000],
++		[-6.27287296, -0.00054124, 0.00033163, 0.00054398, -0.00000113, 0.00000000],
++		[-6.27287319, -0.00054114, 0.00033157, 0.00054389, -0.00000113, 0.00000000],
++		[-6.27287342, -0.00054105, 0.00033152, 0.00054379, -0.00000113, 0.00000000],
++		[-6.27287364, -0.00054095, 0.00033146, 0.00054370, -0.00000113, 0.00000000],
++		[-6.27287387, -0.00054086, 0.00033140, 0.00054360, -0.00000113, 0.00000000],
++		[-6.27287409, -0.00054076, 0.00033134, 0.00054351, -0.00000113, 0.00000000],
++		[-6.27287432, -0.00054067, 0.00033128, 0.00054341, -0.00000113, 0.00000000],
++		[-6.27287455, -0.00054058, 0.00033123, 0.00054332, -0.00000113, 0.00000000],
++		[-6.27287477, -0.00054048, 0.00033117, 0.00054322, -0.00000113, 0.00000000],
++		[-6.27287500, -0.00054039, 0.00033111, 0.00054313, -0.00000113, 0.00000000],
++		[-6.27287522, -0.00054029, 0.00033105, 0.00054304, -0.00000113, 0.00000000],
++		[-6.27287545, -0.00054020, 0.00033100, 0.00054294, -0.00000113, 0.00000000],
++		[-6.27287568, -0.00054010, 0.00033094, 0.00054285, -0.00000113, 0.00000000],
++		[-6.27287590, -0.00054001, 0.00033088, 0.00054275, -0.00000113, 0.00000000],
++		[-6.27287613, -0.00053992, 0.00033082, 0.00054266, -0.00000113, 0.00000000],
++		[-6.27287635, -0.00053982, 0.00033076, 0.00054256, -0.00000113, 0.00000000],
++		[-6.27287658, -0.00053973, 0.00033071, 0.00054247, -0.00000113, 0.00000000],
++		[-6.27287680, -0.00053963, 0.00033065, 0.00054237, -0.00000113, 0.00000000],
++		[-6.27287703, -0.00053954, 0.00033059, 0.00054228, -0.00000113, 0.00000000],
++		[-6.27287725, -0.00053945, 0.00033053, 0.00054218, -0.00000113, 0.00000000],
++		[-6.27287748, -0.00053935, 0.00033048, 0.00054209, -0.00000113, 0.00000000],
++		[-6.27287770, -0.00053926, 0.00033042, 0.00054199, -0.00000113, 0.00000000],
++		[-6.27287793, -0.00053916, 0.00033036, 0.00054190, -0.00000113, 0.00000000],
++		[-6.27287815, -0.00053907, 0.00033030, 0.00054181, -0.00000113, 0.00000000],
++		[-6.27287838, -0.00053898, 0.00033025, 0.00054171, -0.00000113, 0.00000000],
++		[-6.27287860, -0.00053888, 0.00033019, 0.00054162, -0.00000113, 0.00000000],
++		[-6.27287882, -0.00053879, 0.00033013, 0.00054152, -0.00000113, 0.00000000],
++		[-6.27287905, -0.00053869, 0.00033007, 0.00054143, -0.00000113, 0.00000000],
++		[-6.27287927, -0.00053860, 0.00033002, 0.00054133, -0.00000113, 0.00000000],
++		[-6.27287950, -0.00053851, 0.00032996, 0.00054124, -0.00000113, 0.00000000],
++		[-6.27287972, -0.00053841, 0.00032990, 0.00054115, -0.00000113, 0.00000000],
++		[-6.27287994, -0.00053832, 0.00032984, 0.00054105, -0.00000113, 0.00000000],
++		[-6.27288017, -0.00053823, 0.00032979, 0.00054096, -0.00000113, 0.00000000],
++		[-6.27288039, -0.00053813, 0.00032973, 0.00054086, -0.00000113, 0.00000000],
++		[-6.27288062, -0.00053804, 0.00032967, 0.00054077, -0.00000113, 0.00000000],
++		[-6.27288084, -0.00053795, 0.00032961, 0.00054068, -0.00000113, 0.00000000],
++		[-6.27288106, -0.00053785, 0.00032956, 0.00054058, -0.00000113, 0.00000000],
++		[-6.27288129, -0.00053776, 0.00032950, 0.00054049, -0.00000113, 0.00000000],
++		[-6.27288151, -0.00053767, 0.00032944, 0.00054039, -0.00000113, 0.00000000],
++		[-6.27288173, -0.00053757, 0.00032938, 0.00054030, -0.00000113, 0.00000000],
++		[-6.27288196, -0.00053748, 0.00032933, 0.00054021, -0.00000113, 0.00000000],
++		[-6.27288218, -0.00053739, 0.00032927, 0.00054011, -0.00000113, 0.00000000],
++		[-6.27288240, -0.00053729, 0.00032921, 0.00054002, -0.00000113, 0.00000000],
++		[-6.27288263, -0.00053720, 0.00032916, 0.00053992, -0.00000113, 0.00000000],
++		[-6.27288285, -0.00053711, 0.00032910, 0.00053983, -0.00000113, 0.00000000],
++		[-6.27288307, -0.00053701, 0.00032904, 0.00053974, -0.00000113, 0.00000000],
++		[-6.27288330, -0.00053692, 0.00032898, 0.00053964, -0.00000113, 0.00000000],
++		[-6.27288352, -0.00053683, 0.00032893, 0.00053955, -0.00000113, 0.00000000],
++		[-6.27288374, -0.00053673, 0.00032887, 0.00053946, -0.00000113, 0.00000000],
++		[-6.27288396, -0.00053664, 0.00032881, 0.00053936, -0.00000113, 0.00000000],
++		[-6.27288419, -0.00053655, 0.00032876, 0.00053927, -0.00000113, 0.00000000],
++		[-6.27288441, -0.00053645, 0.00032870, 0.00053918, -0.00000113, 0.00000000],
++		[-6.27288463, -0.00053636, 0.00032864, 0.00053908, -0.00000113, 0.00000000],
++		[-6.27288485, -0.00053627, 0.00032859, 0.00053899, -0.00000113, 0.00000000],
++		[-6.27288508, -0.00053618, 0.00032853, 0.00053890, -0.00000113, 0.00000000],
++		[-6.27288530, -0.00053608, 0.00032847, 0.00053880, -0.00000113, 0.00000000],
++		[-6.27288552, -0.00053599, 0.00032841, 0.00053871, -0.00000113, 0.00000000],
++		[-6.27288574, -0.00053590, 0.00032836, 0.00053862, -0.00000113, 0.00000000],
++		[-6.27288596, -0.00053580, 0.00032830, 0.00053852, -0.00000113, 0.00000000],
++		[-6.27288619, -0.00053571, 0.00032824, 0.00053843, -0.00000113, 0.00000000],
++		[-6.27288641, -0.00053562, 0.00032819, 0.00053834, -0.00000113, 0.00000000],
++		[-6.27288663, -0.00053553, 0.00032813, 0.00053824, -0.00000113, 0.00000000],
++		[-6.27288685, -0.00053543, 0.00032807, 0.00053815, -0.00000113, 0.00000000],
++		[-6.27288707, -0.00053534, 0.00032802, 0.00053806, -0.00000113, 0.00000000],
++		[-6.27288729, -0.00053525, 0.00032796, 0.00053796, -0.00000113, 0.00000000],
++		[-6.27288752, -0.00053516, 0.00032790, 0.00053787, -0.00000113, 0.00000000],
++		[-6.27288774, -0.00053506, 0.00032785, 0.00053778, -0.00000113, 0.00000000],
++		[-6.27288796, -0.00053497, 0.00032779, 0.00053769, -0.00000113, 0.00000000],
++		[-6.27288818, -0.00053488, 0.00032773, 0.00053759, -0.00000113, 0.00000000],
++		[-6.27288840, -0.00053479, 0.00032768, 0.00053750, -0.00000113, 0.00000000],
++		[-6.27288862, -0.00053469, 0.00032762, 0.00053741, -0.00000113, 0.00000000],
++		[-6.27288884, -0.00053460, 0.00032756, 0.00053731, -0.00000113, 0.00000000],
++		[-6.27288906, -0.00053451, 0.00032751, 0.00053722, -0.00000113, 0.00000000],
++		[-6.27288928, -0.00053442, 0.00032745, 0.00053713, -0.00000113, 0.00000000],
++		[-6.27288950, -0.00053432, 0.00032739, 0.00053704, -0.00000113, 0.00000000],
++		[-6.27288973, -0.00053423, 0.00032734, 0.00053694, -0.00000113, 0.00000000],
++		[-6.27288995, -0.00053414, 0.00032728, 0.00053685, -0.00000113, 0.00000000],
++		[-6.27289017, -0.00053405, 0.00032722, 0.00053676, -0.00000113, 0.00000000],
++		[-6.27289039, -0.00053396, 0.00032717, 0.00053666, -0.00000113, 0.00000000],
++		[-6.27289061, -0.00053386, 0.00032711, 0.00053657, -0.00000113, 0.00000000],
++		[-6.27289083, -0.00053377, 0.00032705, 0.00053648, -0.00000113, 0.00000000],
++		[-6.27289105, -0.00053368, 0.00032700, 0.00053639, -0.00000113, 0.00000000],
++		[-6.27289127, -0.00053359, 0.00032694, 0.00053629, -0.00000113, 0.00000000],
++		[-6.27289149, -0.00053350, 0.00032689, 0.00053620, -0.00000113, 0.00000000],
++		[-6.27289171, -0.00053340, 0.00032683, 0.00053611, -0.00000113, 0.00000000],
++		[-6.27289193, -0.00053331, 0.00032677, 0.00053602, -0.00000113, 0.00000000],
++		[-6.27289215, -0.00053322, 0.00032672, 0.00053593, -0.00000113, 0.00000000],
++		[-6.27289237, -0.00053313, 0.00032666, 0.00053583, -0.00000113, 0.00000000],
++		[-6.27289259, -0.00053304, 0.00032660, 0.00053574, -0.00000113, 0.00000000],
++		[-6.27289281, -0.00053294, 0.00032655, 0.00053565, -0.00000113, 0.00000000],
++		[-6.27289303, -0.00053285, 0.00032649, 0.00053556, -0.00000113, 0.00000000],
++		[-6.27289325, -0.00053276, 0.00032643, 0.00053546, -0.00000113, 0.00000000],
++		[-6.27289346, -0.00053267, 0.00032638, 0.00053537, -0.00000113, 0.00000000],
++		[-6.27289368, -0.00053258, 0.00032632, 0.00053528, -0.00000113, 0.00000000],
++		[-6.27289390, -0.00053249, 0.00032627, 0.00053519, -0.00000113, 0.00000000],
++		[-6.27289412, -0.00053239, 0.00032621, 0.00053510, -0.00000113, 0.00000000],
++		[-6.27289434, -0.00053230, 0.00032615, 0.00053500, -0.00000113, 0.00000000],
++		[-6.27289456, -0.00053221, 0.00032610, 0.00053491, -0.00000113, 0.00000000],
++		[-6.27289478, -0.00053212, 0.00032604, 0.00053482, -0.00000113, 0.00000000],
++		[-6.27289500, -0.00053203, 0.00032599, 0.00053473, -0.00000113, 0.00000000],
++		[-6.27289522, -0.00053194, 0.00032593, 0.00053464, -0.00000113, 0.00000000],
++		[-6.27289544, -0.00053185, 0.00032587, 0.00053454, -0.00000113, 0.00000000],
++		[-6.27289565, -0.00053175, 0.00032582, 0.00053445, -0.00000113, 0.00000000],
++		[-6.27289587, -0.00053166, 0.00032576, 0.00053436, -0.00000113, 0.00000000],
++		[-6.27289609, -0.00053157, 0.00032571, 0.00053427, -0.00000113, 0.00000000],
++		[-6.27289631, -0.00053148, 0.00032565, 0.00053418, -0.00000113, 0.00000000],
++		[-6.27289653, -0.00053139, 0.00032559, 0.00053408, -0.00000113, 0.00000000],
++		[-6.27289675, -0.00053130, 0.00032554, 0.00053399, -0.00000113, 0.00000000],
++		[-6.27289696, -0.00053121, 0.00032548, 0.00053390, -0.00000113, 0.00000000],
++		[-6.27289718, -0.00053112, 0.00032543, 0.00053381, -0.00000113, 0.00000000],
++		[-6.27289740, -0.00053102, 0.00032537, 0.00053372, -0.00000113, 0.00000000],
++		[-6.27289762, -0.00053093, 0.00032531, 0.00053363, -0.00000113, 0.00000000],
++		[-6.27289784, -0.00053084, 0.00032526, 0.00053354, -0.00000113, 0.00000000],
++		[-6.27289805, -0.00053075, 0.00032520, 0.00053344, -0.00000113, 0.00000000],
++		[-6.27289827, -0.00053066, 0.00032515, 0.00053335, -0.00000113, 0.00000000],
++		[-6.27289849, -0.00053057, 0.00032509, 0.00053326, -0.00000113, 0.00000000],
++		[-6.27289871, -0.00053048, 0.00032504, 0.00053317, -0.00000113, 0.00000000],
++		[-6.27289892, -0.00053039, 0.00032498, 0.00053308, -0.00000113, 0.00000000],
++		[-6.27289914, -0.00053030, 0.00032492, 0.00053299, -0.00000113, 0.00000000],
++		[-6.27289936, -0.00053021, 0.00032487, 0.00053290, -0.00000113, 0.00000000],
++		[-6.27289958, -0.00053012, 0.00032481, 0.00053280, -0.00000113, 0.00000000],
++		[-6.27289979, -0.00053002, 0.00032476, 0.00053271, -0.00000113, 0.00000000],
++		[-6.27290001, -0.00052993, 0.00032470, 0.00053262, -0.00000113, 0.00000000],
++		[-6.27290023, -0.00052984, 0.00032465, 0.00053253, -0.00000113, 0.00000000],
++		[-6.27290044, -0.00052975, 0.00032459, 0.00053244, -0.00000113, 0.00000000],
++		[-6.27290066, -0.00052966, 0.00032453, 0.00053235, -0.00000113, 0.00000000],
++		[-6.27290088, -0.00052957, 0.00032448, 0.00053226, -0.00000113, 0.00000000],
++		[-6.27290109, -0.00052948, 0.00032442, 0.00053217, -0.00000113, 0.00000000],
++		[-6.27290131, -0.00052939, 0.00032437, 0.00053208, -0.00000113, 0.00000000],
++		[-6.27290153, -0.00052930, 0.00032431, 0.00053198, -0.00000113, 0.00000000],
++		[-6.27290174, -0.00052921, 0.00032426, 0.00053189, -0.00000113, 0.00000000],
++		[-6.27290196, -0.00052912, 0.00032420, 0.00053180, -0.00000113, 0.00000000],
++		[-6.27290218, -0.00052903, 0.00032415, 0.00053171, -0.00000113, 0.00000000],
++		[-6.27290239, -0.00052894, 0.00032409, 0.00053162, -0.00000113, 0.00000000],
++		[-6.27290261, -0.00052885, 0.00032404, 0.00053153, -0.00000113, 0.00000000],
++		[-6.27290283, -0.00052876, 0.00032398, 0.00053144, -0.00000113, 0.00000000],
++		[-6.27290304, -0.00052867, 0.00032392, 0.00053135, -0.00000113, 0.00000000],
++		[-6.27290326, -0.00052858, 0.00032387, 0.00053126, -0.00000113, 0.00000000],
++		[-6.27290347, -0.00052849, 0.00032381, 0.00053117, -0.00000113, 0.00000000],
++		[-6.27290369, -0.00052840, 0.00032376, 0.00053108, -0.00000113, 0.00000000],
++		[-6.27290391, -0.00052831, 0.00032370, 0.00053099, -0.00000113, 0.00000000],
++		[-6.27290412, -0.00052822, 0.00032365, 0.00053089, -0.00000113, 0.00000000],
++		[-6.27290434, -0.00052813, 0.00032359, 0.00053080, -0.00000113, 0.00000000],
++		[-6.27290455, -0.00052804, 0.00032354, 0.00053071, -0.00000113, 0.00000000],
++		[-6.27290477, -0.00052795, 0.00032348, 0.00053062, -0.00000113, 0.00000000],
++		[-6.27290498, -0.00052786, 0.00032343, 0.00053053, -0.00000113, 0.00000000],
++		[-6.27290520, -0.00052777, 0.00032337, 0.00053044, -0.00000113, 0.00000000],
++		[-6.27290541, -0.00052768, 0.00032332, 0.00053035, -0.00000113, 0.00000000],
++		[-6.27290563, -0.00052759, 0.00032326, 0.00053026, -0.00000113, 0.00000000],
++		[-6.27290584, -0.00052750, 0.00032321, 0.00053017, -0.00000113, 0.00000000],
++		[-6.27290606, -0.00052741, 0.00032315, 0.00053008, -0.00000113, 0.00000000],
++		[-6.27290627, -0.00052732, 0.00032310, 0.00052999, -0.00000113, 0.00000000],
++		[-6.27290649, -0.00052723, 0.00032304, 0.00052990, -0.00000113, 0.00000000],
++		[-6.27290670, -0.00052714, 0.00032299, 0.00052981, -0.00000113, 0.00000000],
++		[-6.27290692, -0.00052705, 0.00032293, 0.00052972, -0.00000113, 0.00000000],
++		[-6.27290713, -0.00052696, 0.00032288, 0.00052963, -0.00000113, 0.00000000],
++		[-6.27290735, -0.00052687, 0.00032282, 0.00052954, -0.00000113, 0.00000000],
++		[-6.27290756, -0.00052678, 0.00032277, 0.00052945, -0.00000113, 0.00000000],
++		[-6.27290778, -0.00052669, 0.00032271, 0.00052936, -0.00000113, 0.00000000],
++		[-6.27290799, -0.00052660, 0.00032266, 0.00052927, -0.00000113, 0.00000000],
++		[-6.27290821, -0.00052651, 0.00032260, 0.00052918, -0.00000113, 0.00000000],
++		[-6.27290842, -0.00052642, 0.00032255, 0.00052909, -0.00000113, 0.00000000],
++		[-6.27290863, -0.00052633, 0.00032249, 0.00052900, -0.00000113, 0.00000000],
++		[-6.27290885, -0.00052624, 0.00032244, 0.00052891, -0.00000113, 0.00000000],
++		[-6.27290906, -0.00052615, 0.00032238, 0.00052882, -0.00000113, 0.00000000],
++		[-6.27290928, -0.00052606, 0.00032233, 0.00052873, -0.00000113, 0.00000000],
++		[-6.27290949, -0.00052597, 0.00032227, 0.00052864, -0.00000113, 0.00000000],
++		[-6.27290970, -0.00052588, 0.00032222, 0.00052855, -0.00000113, 0.00000000],
++		[-6.27290992, -0.00052579, 0.00032216, 0.00052846, -0.00000113, 0.00000000],
++		[-6.27291013, -0.00052570, 0.00032211, 0.00052837, -0.00000113, 0.00000000],
++		[-6.27291034, -0.00052561, 0.00032205, 0.00052828, -0.00000113, 0.00000000],
++		[-6.27291056, -0.00052553, 0.00032200, 0.00052819, -0.00000113, 0.00000000],
++		[-6.27291077, -0.00052544, 0.00032194, 0.00052810, -0.00000113, 0.00000000],
++		[-6.27291098, -0.00052535, 0.00032189, 0.00052801, -0.00000113, 0.00000000],
++		[-6.27291120, -0.00052526, 0.00032183, 0.00052792, -0.00000113, 0.00000000],
++		[-6.27291141, -0.00052517, 0.00032178, 0.00052783, -0.00000113, 0.00000000],
++		[-6.27291162, -0.00052508, 0.00032173, 0.00052774, -0.00000113, 0.00000000],
++		[-6.27291184, -0.00052499, 0.00032167, 0.00052765, -0.00000113, 0.00000000],
++		[-6.27291205, -0.00052490, 0.00032162, 0.00052756, -0.00000113, 0.00000000],
++		[-6.27291226, -0.00052481, 0.00032156, 0.00052747, -0.00000113, 0.00000000],
++		[-6.27291248, -0.00052472, 0.00032151, 0.00052738, -0.00000113, 0.00000000],
++		[-6.27291269, -0.00052463, 0.00032145, 0.00052730, -0.00000113, 0.00000000],
++		[-6.27291290, -0.00052455, 0.00032140, 0.00052721, -0.00000113, 0.00000000],
++		[-6.27291311, -0.00052446, 0.00032134, 0.00052712, -0.00000113, 0.00000000],
++		[-6.27291333, -0.00052437, 0.00032129, 0.00052703, -0.00000113, 0.00000000],
++		[-6.27291354, -0.00052428, 0.00032123, 0.00052694, -0.00000113, 0.00000000],
++		[-6.27291375, -0.00052419, 0.00032118, 0.00052685, -0.00000113, 0.00000000],
++		[-6.27291396, -0.00052410, 0.00032113, 0.00052676, -0.00000113, 0.00000000],
++		[-6.27291418, -0.00052401, 0.00032107, 0.00052667, -0.00000113, 0.00000000],
++		[-6.27291439, -0.00052392, 0.00032102, 0.00052658, -0.00000113, 0.00000000],
++		[-6.27291460, -0.00052384, 0.00032096, 0.00052649, -0.00000113, 0.00000000],
++		[-6.27291481, -0.00052375, 0.00032091, 0.00052640, -0.00000113, 0.00000000],
++		[-6.27291503, -0.00052366, 0.00032085, 0.00052631, -0.00000113, 0.00000000],
++		[-6.27291524, -0.00052357, 0.00032080, 0.00052622, -0.00000113, 0.00000000],
++		[-6.27291545, -0.00052348, 0.00032075, 0.00052614, -0.00000113, 0.00000000],
++		[-6.27291566, -0.00052339, 0.00032069, 0.00052605, -0.00000113, 0.00000000],
++		[-6.27291587, -0.00052330, 0.00032064, 0.00052596, -0.00000113, 0.00000000],
++		[-6.27291608, -0.00052322, 0.00032058, 0.00052587, -0.00000113, 0.00000000],
++		[-6.27291630, -0.00052313, 0.00032053, 0.00052578, -0.00000113, 0.00000000],
++		[-6.27291651, -0.00052304, 0.00032047, 0.00052569, -0.00000113, 0.00000000],
++		[-6.27291672, -0.00052295, 0.00032042, 0.00052560, -0.00000113, 0.00000000],
++		[-6.27291693, -0.00052286, 0.00032037, 0.00052551, -0.00000113, 0.00000000],
++		[-6.27291714, -0.00052277, 0.00032031, 0.00052542, -0.00000113, 0.00000000],
++		[-6.27291735, -0.00052269, 0.00032026, 0.00052534, -0.00000113, 0.00000000],
++		[-6.27291756, -0.00052260, 0.00032020, 0.00052525, -0.00000113, 0.00000000],
++		[-6.27291777, -0.00052251, 0.00032015, 0.00052516, -0.00000113, 0.00000000],
++		[-6.27291799, -0.00052242, 0.00032010, 0.00052507, -0.00000113, 0.00000000],
++		[-6.27291820, -0.00052233, 0.00032004, 0.00052498, -0.00000113, 0.00000000],
++		[-6.27291841, -0.00052225, 0.00031999, 0.00052489, -0.00000113, 0.00000000],
++		[-6.27291862, -0.00052216, 0.00031993, 0.00052480, -0.00000113, 0.00000000],
++		[-6.27291883, -0.00052207, 0.00031988, 0.00052472, -0.00000113, 0.00000000],
++		[-6.27291904, -0.00052198, 0.00031983, 0.00052463, -0.00000113, 0.00000000],
++		[-6.27291925, -0.00052189, 0.00031977, 0.00052454, -0.00000113, 0.00000000],
++		[-6.27291946, -0.00052180, 0.00031972, 0.00052445, -0.00000113, 0.00000000],
++		[-6.27291967, -0.00052172, 0.00031966, 0.00052436, -0.00000113, 0.00000000],
++		[-6.27291988, -0.00052163, 0.00031961, 0.00052427, -0.00000113, 0.00000000],
++		[-6.27292009, -0.00052154, 0.00031956, 0.00052419, -0.00000113, 0.00000000],
++		[-6.27292030, -0.00052145, 0.00031950, 0.00052410, -0.00000113, 0.00000000],
++		[-6.27292051, -0.00052137, 0.00031945, 0.00052401, -0.00000113, 0.00000000],
++		[-6.27292072, -0.00052128, 0.00031939, 0.00052392, -0.00000113, 0.00000000],
++		[-6.27292093, -0.00052119, 0.00031934, 0.00052383, -0.00000113, 0.00000000],
++		[-6.27292114, -0.00052110, 0.00031929, 0.00052374, -0.00000113, 0.00000000],
++		[-6.27292135, -0.00052101, 0.00031923, 0.00052366, -0.00000113, 0.00000000],
++		[-6.27292156, -0.00052093, 0.00031918, 0.00052357, -0.00000113, 0.00000000],
++		[-6.27292177, -0.00052084, 0.00031913, 0.00052348, -0.00000113, 0.00000000],
++		[-6.27292198, -0.00052075, 0.00031907, 0.00052339, -0.00000113, 0.00000000],
++		[-6.27292219, -0.00052066, 0.00031902, 0.00052330, -0.00000113, 0.00000000],
++		[-6.27292240, -0.00052058, 0.00031896, 0.00052322, -0.00000113, 0.00000000],
++		[-6.27292261, -0.00052049, 0.00031891, 0.00052313, -0.00000113, 0.00000000],
++		[-6.27292282, -0.00052040, 0.00031886, 0.00052304, -0.00000113, 0.00000000],
++		[-6.27292303, -0.00052031, 0.00031880, 0.00052295, -0.00000113, 0.00000000],
++		[-6.27292324, -0.00052023, 0.00031875, 0.00052286, -0.00000113, 0.00000000],
++		[-6.27292345, -0.00052014, 0.00031870, 0.00052278, -0.00000113, 0.00000000],
++		[-6.27292366, -0.00052005, 0.00031864, 0.00052269, -0.00000113, 0.00000000],
++		[-6.27292386, -0.00051996, 0.00031859, 0.00052260, -0.00000113, 0.00000000],
++		[-6.27292407, -0.00051988, 0.00031854, 0.00052251, -0.00000113, 0.00000000],
++		[-6.27292428, -0.00051979, 0.00031848, 0.00052242, -0.00000113, 0.00000000],
++		[-6.27292449, -0.00051970, 0.00031843, 0.00052234, -0.00000113, 0.00000000],
++		[-6.27292470, -0.00051962, 0.00031837, 0.00052225, -0.00000113, 0.00000000],
++		[-6.27292491, -0.00051953, 0.00031832, 0.00052216, -0.00000113, 0.00000000],
++		[-6.27292512, -0.00051944, 0.00031827, 0.00052207, -0.00000113, 0.00000000],
++		[-6.27292533, -0.00051935, 0.00031821, 0.00052199, -0.00000113, 0.00000000],
++		[-6.27292553, -0.00051927, 0.00031816, 0.00052190, -0.00000113, 0.00000000],
++		[-6.27292574, -0.00051918, 0.00031811, 0.00052181, -0.00000113, 0.00000000],
++		[-6.27292595, -0.00051909, 0.00031805, 0.00052172, -0.00000113, 0.00000000],
++		[-6.27292616, -0.00051901, 0.00031800, 0.00052164, -0.00000113, 0.00000000],
++		[-6.27292637, -0.00051892, 0.00031795, 0.00052155, -0.00000113, 0.00000000],
++		[-6.27292658, -0.00051883, 0.00031789, 0.00052146, -0.00000113, 0.00000000],
++		[-6.27292678, -0.00051874, 0.00031784, 0.00052137, -0.00000113, 0.00000000],
++		[-6.27292699, -0.00051866, 0.00031779, 0.00052129, -0.00000113, 0.00000000],
++		[-6.27292720, -0.00051857, 0.00031773, 0.00052120, -0.00000113, 0.00000000],
++		[-6.27292741, -0.00051848, 0.00031768, 0.00052111, -0.00000113, 0.00000000],
++		[-6.27292762, -0.00051840, 0.00031763, 0.00052102, -0.00000113, 0.00000000],
++		[-6.27292782, -0.00051831, 0.00031757, 0.00052094, -0.00000113, 0.00000000],
++		[-6.27292803, -0.00051822, 0.00031752, 0.00052085, -0.00000113, 0.00000000],
++		[-6.27292824, -0.00051814, 0.00031747, 0.00052076, -0.00000113, 0.00000000],
++		[-6.27292845, -0.00051805, 0.00031742, 0.00052068, -0.00000113, 0.00000000],
++		[-6.27292865, -0.00051796, 0.00031736, 0.00052059, -0.00000113, 0.00000000],
++		[-6.27292886, -0.00051788, 0.00031731, 0.00052050, -0.00000113, 0.00000000],
++		[-6.27292907, -0.00051779, 0.00031726, 0.00052041, -0.00000113, 0.00000000],
++		[-6.27292927, -0.00051770, 0.00031720, 0.00052033, -0.00000113, 0.00000000],
++		[-6.27292948, -0.00051762, 0.00031715, 0.00052024, -0.00000113, 0.00000000],
++		[-6.27292969, -0.00051753, 0.00031710, 0.00052015, -0.00000113, 0.00000000],
++		[-6.27292990, -0.00051744, 0.00031704, 0.00052007, -0.00000113, 0.00000000],
++		[-6.27293010, -0.00051736, 0.00031699, 0.00051998, -0.00000113, 0.00000000],
++		[-6.27293031, -0.00051727, 0.00031694, 0.00051989, -0.00000113, 0.00000000],
++		[-6.27293052, -0.00051718, 0.00031688, 0.00051981, -0.00000113, 0.00000000],
++		[-6.27293072, -0.00051710, 0.00031683, 0.00051972, -0.00000113, 0.00000000],
++		[-6.27293093, -0.00051701, 0.00031678, 0.00051963, -0.00000113, 0.00000000],
++		[-6.27293114, -0.00051693, 0.00031673, 0.00051955, -0.00000113, 0.00000000],
++		[-6.27293134, -0.00051684, 0.00031667, 0.00051946, -0.00000113, 0.00000000],
++		[-6.27293155, -0.00051675, 0.00031662, 0.00051937, -0.00000113, 0.00000000],
++		[-6.27293176, -0.00051667, 0.00031657, 0.00051929, -0.00000113, 0.00000000],
++		[-6.27293196, -0.00051658, 0.00031651, 0.00051920, -0.00000113, 0.00000000],
++		[-6.27293217, -0.00051649, 0.00031646, 0.00051911, -0.00000113, 0.00000000],
++		[-6.27293237, -0.00051641, 0.00031641, 0.00051903, -0.00000113, 0.00000000],
++		[-6.27293258, -0.00051632, 0.00031636, 0.00051894, -0.00000113, 0.00000000],
++		[-6.27293279, -0.00051624, 0.00031630, 0.00051885, -0.00000113, 0.00000000],
++		[-6.27293299, -0.00051615, 0.00031625, 0.00051877, -0.00000113, 0.00000000],
++		[-6.27293320, -0.00051606, 0.00031620, 0.00051868, -0.00000113, 0.00000000],
++		[-6.27293340, -0.00051598, 0.00031614, 0.00051859, -0.00000113, 0.00000000],
++		[-6.27293361, -0.00051589, 0.00031609, 0.00051851, -0.00000113, 0.00000000],
++		[-6.27293382, -0.00051581, 0.00031604, 0.00051842, -0.00000113, 0.00000000],
++		[-6.27293402, -0.00051572, 0.00031599, 0.00051833, -0.00000113, 0.00000000],
++		[-6.27293423, -0.00051563, 0.00031593, 0.00051825, -0.00000113, 0.00000000],
++		[-6.27293443, -0.00051555, 0.00031588, 0.00051816, -0.00000113, 0.00000000],
++		[-6.27293464, -0.00051546, 0.00031583, 0.00051807, -0.00000113, 0.00000000],
++		[-6.27293484, -0.00051538, 0.00031578, 0.00051799, -0.00000113, 0.00000000],
++		[-6.27293505, -0.00051529, 0.00031572, 0.00051790, -0.00000113, 0.00000000],
++		[-6.27293525, -0.00051520, 0.00031567, 0.00051782, -0.00000113, 0.00000000],
++		[-6.27293546, -0.00051512, 0.00031562, 0.00051773, -0.00000113, 0.00000000],
++		[-6.27293566, -0.00051503, 0.00031557, 0.00051764, -0.00000113, 0.00000000],
++		[-6.27293587, -0.00051495, 0.00031551, 0.00051756, -0.00000113, 0.00000000],
++		[-6.27293607, -0.00051486, 0.00031546, 0.00051747, -0.00000113, 0.00000000],
++		[-6.27293628, -0.00051478, 0.00031541, 0.00051739, -0.00000113, 0.00000000],
++		[-6.27293648, -0.00051469, 0.00031536, 0.00051730, -0.00000113, 0.00000000],
++		[-6.27293669, -0.00051461, 0.00031530, 0.00051721, -0.00000113, 0.00000000],
++		[-6.27293689, -0.00051452, 0.00031525, 0.00051713, -0.00000113, 0.00000000],
++		[-6.27293710, -0.00051443, 0.00031520, 0.00051704, -0.00000113, 0.00000000],
++		[-6.27293730, -0.00051435, 0.00031515, 0.00051696, -0.00000113, 0.00000000],
++		[-6.27293751, -0.00051426, 0.00031509, 0.00051687, -0.00000113, 0.00000000],
++		[-6.27293771, -0.00051418, 0.00031504, 0.00051678, -0.00000113, 0.00000000],
++		[-6.27293792, -0.00051409, 0.00031499, 0.00051670, -0.00000113, 0.00000000],
++		[-6.27293812, -0.00051401, 0.00031494, 0.00051661, -0.00000113, 0.00000000],
++		[-6.27293832, -0.00051392, 0.00031488, 0.00051653, -0.00000113, 0.00000000],
++		[-6.27293853, -0.00051384, 0.00031483, 0.00051644, -0.00000113, 0.00000000],
++		[-6.27293873, -0.00051375, 0.00031478, 0.00051635, -0.00000113, 0.00000000],
++		[-6.27293894, -0.00051367, 0.00031473, 0.00051627, -0.00000113, 0.00000000],
++		[-6.27293914, -0.00051358, 0.00031467, 0.00051618, -0.00000113, 0.00000000],
++		[-6.27293934, -0.00051350, 0.00031462, 0.00051610, -0.00000113, 0.00000000],
++		[-6.27293955, -0.00051341, 0.00031457, 0.00051601, -0.00000113, 0.00000000],
++		[-6.27293975, -0.00051333, 0.00031452, 0.00051593, -0.00000113, 0.00000000],
++		[-6.27293995, -0.00051324, 0.00031447, 0.00051584, -0.00000113, 0.00000000],
++		[-6.27294016, -0.00051315, 0.00031441, 0.00051576, -0.00000113, 0.00000000],
++		[-6.27294036, -0.00051307, 0.00031436, 0.00051567, -0.00000113, 0.00000000],
++		[-6.27294057, -0.00051298, 0.00031431, 0.00051558, -0.00000113, 0.00000000],
++		[-6.27294077, -0.00051290, 0.00031426, 0.00051550, -0.00000113, 0.00000000],
++		[-6.27294097, -0.00051281, 0.00031421, 0.00051541, -0.00000113, 0.00000000],
++		[-6.27294118, -0.00051273, 0.00031415, 0.00051533, -0.00000113, 0.00000000],
++		[-6.27294138, -0.00051265, 0.00031410, 0.00051524, -0.00000113, 0.00000000],
++		[-6.27294158, -0.00051256, 0.00031405, 0.00051516, -0.00000113, 0.00000000],
++		[-6.27294178, -0.00051248, 0.00031400, 0.00051507, -0.00000113, 0.00000000],
++		[-6.27294199, -0.00051239, 0.00031395, 0.00051499, -0.00000113, 0.00000000],
++		[-6.27294219, -0.00051231, 0.00031389, 0.00051490, -0.00000113, 0.00000000],
++		[-6.27294239, -0.00051222, 0.00031384, 0.00051482, -0.00000113, 0.00000000],
++		[-6.27294260, -0.00051214, 0.00031379, 0.00051473, -0.00000113, 0.00000000],
++		[-6.27294280, -0.00051205, 0.00031374, 0.00051465, -0.00000113, 0.00000000],
++		[-6.27294300, -0.00051197, 0.00031369, 0.00051456, -0.00000113, 0.00000000],
++		[-6.27294320, -0.00051188, 0.00031363, 0.00051448, -0.00000113, 0.00000000],
++		[-6.27294341, -0.00051180, 0.00031358, 0.00051439, -0.00000113, 0.00000000],
++		[-6.27294361, -0.00051171, 0.00031353, 0.00051431, -0.00000113, 0.00000000],
++		[-6.27294381, -0.00051163, 0.00031348, 0.00051422, -0.00000113, 0.00000000],
++		[-6.27294401, -0.00051154, 0.00031343, 0.00051414, -0.00000113, 0.00000000],
++		[-6.27294422, -0.00051146, 0.00031337, 0.00051405, -0.00000113, 0.00000000],
++		[-6.27294442, -0.00051137, 0.00031332, 0.00051397, -0.00000113, 0.00000000],
++		[-6.27294462, -0.00051129, 0.00031327, 0.00051388, -0.00000113, 0.00000000],
++		[-6.27294482, -0.00051121, 0.00031322, 0.00051380, -0.00000113, 0.00000000],
++		[-6.27294502, -0.00051112, 0.00031317, 0.00051371, -0.00000113, 0.00000000],
++		[-6.27294523, -0.00051104, 0.00031312, 0.00051363, -0.00000113, 0.00000000],
++		[-6.27294543, -0.00051095, 0.00031306, 0.00051354, -0.00000113, 0.00000000],
++		[-6.27294563, -0.00051087, 0.00031301, 0.00051346, -0.00000113, 0.00000000],
++		[-6.27294583, -0.00051078, 0.00031296, 0.00051337, -0.00000113, 0.00000000],
++		[-6.27294603, -0.00051070, 0.00031291, 0.00051329, -0.00000113, 0.00000000],
++		[-6.27294623, -0.00051062, 0.00031286, 0.00051320, -0.00000113, 0.00000000],
++		[-6.27294644, -0.00051053, 0.00031281, 0.00051312, -0.00000113, 0.00000000],
++		[-6.27294664, -0.00051045, 0.00031275, 0.00051303, -0.00000113, 0.00000000],
++		[-6.27294684, -0.00051036, 0.00031270, 0.00051295, -0.00000113, 0.00000000],
++		[-6.27294704, -0.00051028, 0.00031265, 0.00051286, -0.00000113, 0.00000000],
++		[-6.27294724, -0.00051019, 0.00031260, 0.00051278, -0.00000113, 0.00000000],
++		[-6.27294744, -0.00051011, 0.00031255, 0.00051270, -0.00000113, 0.00000000],
++		[-6.27294764, -0.00051003, 0.00031250, 0.00051261, -0.00000113, 0.00000000],
++		[-6.27294784, -0.00050994, 0.00031244, 0.00051253, -0.00000113, 0.00000000],
++		[-6.27294805, -0.00050986, 0.00031239, 0.00051244, -0.00000113, 0.00000000],
++		[-6.27294825, -0.00050977, 0.00031234, 0.00051236, -0.00000113, 0.00000000],
++		[-6.27294845, -0.00050969, 0.00031229, 0.00051227, -0.00000113, 0.00000000],
++		[-6.27294865, -0.00050961, 0.00031224, 0.00051219, -0.00000113, 0.00000000],
++		[-6.27294885, -0.00050952, 0.00031219, 0.00051210, -0.00000113, 0.00000000],
++		[-6.27294905, -0.00050944, 0.00031214, 0.00051202, -0.00000113, 0.00000000],
++		[-6.27294925, -0.00050936, 0.00031208, 0.00051194, -0.00000113, 0.00000000],
++		[-6.27294945, -0.00050927, 0.00031203, 0.00051185, -0.00000113, 0.00000000],
++		[-6.27294965, -0.00050919, 0.00031198, 0.00051177, -0.00000113, 0.00000000],
++		[-6.27294985, -0.00050910, 0.00031193, 0.00051168, -0.00000113, 0.00000000],
++		[-6.27295005, -0.00050902, 0.00031188, 0.00051160, -0.00000113, 0.00000000],
++		[-6.27295025, -0.00050894, 0.00031183, 0.00051152, -0.00000113, 0.00000000],
++		[-6.27295045, -0.00050885, 0.00031178, 0.00051143, -0.00000113, 0.00000000],
++		[-6.27295065, -0.00050877, 0.00031173, 0.00051135, -0.00000113, 0.00000000],
++		[-6.27295085, -0.00050869, 0.00031167, 0.00051126, -0.00000113, 0.00000000],
++		[-6.27295105, -0.00050860, 0.00031162, 0.00051118, -0.00000113, 0.00000000],
++		[-6.27295125, -0.00050852, 0.00031157, 0.00051109, -0.00000113, 0.00000000],
++		[-6.27295145, -0.00050844, 0.00031152, 0.00051101, -0.00000113, 0.00000000],
++		[-6.27295165, -0.00050835, 0.00031147, 0.00051093, -0.00000113, 0.00000000],
++		[-6.27295185, -0.00050827, 0.00031142, 0.00051084, -0.00000113, 0.00000000],
++		[-6.27295205, -0.00050818, 0.00031137, 0.00051076, -0.00000113, 0.00000000],
++		[-6.27295225, -0.00050810, 0.00031132, 0.00051068, -0.00000113, 0.00000000],
++		[-6.27295245, -0.00050802, 0.00031126, 0.00051059, -0.00000113, 0.00000000],
++		[-6.27295265, -0.00050793, 0.00031121, 0.00051051, -0.00000113, 0.00000000],
++		[-6.27295285, -0.00050785, 0.00031116, 0.00051042, -0.00000113, 0.00000000],
++		[-6.27295305, -0.00050777, 0.00031111, 0.00051034, -0.00000113, 0.00000000],
++		[-6.27295325, -0.00050768, 0.00031106, 0.00051026, -0.00000113, 0.00000000],
++		[-6.27295345, -0.00050760, 0.00031101, 0.00051017, -0.00000113, 0.00000000],
++		[-6.27295365, -0.00050752, 0.00031096, 0.00051009, -0.00000113, 0.00000000],
++		[-6.27295385, -0.00050743, 0.00031091, 0.00051001, -0.00000113, 0.00000000],
++		[-6.27295404, -0.00050735, 0.00031086, 0.00050992, -0.00000113, 0.00000000],
++		[-6.27295424, -0.00050727, 0.00031081, 0.00050984, -0.00000113, 0.00000000],
++		[-6.27295444, -0.00050719, 0.00031075, 0.00050975, -0.00000113, 0.00000000],
++		[-6.27295464, -0.00050710, 0.00031070, 0.00050967, -0.00000113, 0.00000000],
++		[-6.27295484, -0.00050702, 0.00031065, 0.00050959, -0.00000113, 0.00000000],
++		[-6.27295504, -0.00050694, 0.00031060, 0.00050950, -0.00000113, 0.00000000],
++		[-6.27295524, -0.00050685, 0.00031055, 0.00050942, -0.00000113, 0.00000000],
++		[-6.27295544, -0.00050677, 0.00031050, 0.00050934, -0.00000113, 0.00000000],
++		[-6.27295563, -0.00050669, 0.00031045, 0.00050925, -0.00000113, 0.00000000],
++		[-6.27295583, -0.00050660, 0.00031040, 0.00050917, -0.00000113, 0.00000000],
++		[-6.27295603, -0.00050652, 0.00031035, 0.00050909, -0.00000113, 0.00000000],
++		[-6.27295623, -0.00050644, 0.00031030, 0.00050900, -0.00000113, 0.00000000],
++		[-6.27295643, -0.00050636, 0.00031025, 0.00050892, -0.00000113, 0.00000000],
++		[-6.27295663, -0.00050627, 0.00031019, 0.00050884, -0.00000113, 0.00000000],
++		[-6.27295682, -0.00050619, 0.00031014, 0.00050875, -0.00000113, 0.00000000],
++		[-6.27295702, -0.00050611, 0.00031009, 0.00050867, -0.00000113, 0.00000000],
++		[-6.27295722, -0.00050602, 0.00031004, 0.00050859, -0.00000113, 0.00000000],
++		[-6.27295742, -0.00050594, 0.00030999, 0.00050851, -0.00000113, 0.00000000],
++		[-6.27295762, -0.00050586, 0.00030994, 0.00050842, -0.00000113, 0.00000000],
++		[-6.27295781, -0.00050578, 0.00030989, 0.00050834, -0.00000113, 0.00000000],
++		[-6.27295801, -0.00050569, 0.00030984, 0.00050826, -0.00000113, 0.00000000],
++		[-6.27295821, -0.00050561, 0.00030979, 0.00050817, -0.00000113, 0.00000000],
++		[-6.27295841, -0.00050553, 0.00030974, 0.00050809, -0.00000113, 0.00000000],
++		[-6.27295860, -0.00050545, 0.00030969, 0.00050801, -0.00000113, 0.00000000],
++		[-6.27295880, -0.00050536, 0.00030964, 0.00050792, -0.00000113, 0.00000000],
++		[-6.27295900, -0.00050528, 0.00030959, 0.00050784, -0.00000113, 0.00000000],
++		[-6.27295920, -0.00050520, 0.00030954, 0.00050776, -0.00000113, 0.00000000],
++		[-6.27295939, -0.00050512, 0.00030949, 0.00050768, -0.00000113, 0.00000000],
++		[-6.27295959, -0.00050503, 0.00030944, 0.00050759, -0.00000113, 0.00000000],
++		[-6.27295979, -0.00050495, 0.00030938, 0.00050751, -0.00000113, 0.00000000],
++		[-6.27295998, -0.00050487, 0.00030933, 0.00050743, -0.00000113, 0.00000000],
++		[-6.27296018, -0.00050479, 0.00030928, 0.00050734, -0.00000113, 0.00000000],
++		[-6.27296038, -0.00050470, 0.00030923, 0.00050726, -0.00000113, 0.00000000],
++		[-6.27296058, -0.00050462, 0.00030918, 0.00050718, -0.00000113, 0.00000000],
++		[-6.27296077, -0.00050454, 0.00030913, 0.00050710, -0.00000113, 0.00000000],
++		[-6.27296097, -0.00050446, 0.00030908, 0.00050701, -0.00000113, 0.00000000],
++		[-6.27296117, -0.00050438, 0.00030903, 0.00050693, -0.00000113, 0.00000000],
++		[-6.27296136, -0.00050429, 0.00030898, 0.00050685, -0.00000113, 0.00000000],
++		[-6.27296156, -0.00050421, 0.00030893, 0.00050677, -0.00000113, 0.00000000],
++		[-6.27296176, -0.00050413, 0.00030888, 0.00050668, -0.00000113, 0.00000000],
++		[-6.27296195, -0.00050405, 0.00030883, 0.00050660, -0.00000113, 0.00000000],
++		[-6.27296215, -0.00050397, 0.00030878, 0.00050652, -0.00000113, 0.00000000],
++		[-6.27296234, -0.00050388, 0.00030873, 0.00050644, -0.00000113, 0.00000000],
++		[-6.27296254, -0.00050380, 0.00030868, 0.00050635, -0.00000113, 0.00000000],
++		[-6.27296274, -0.00050372, 0.00030863, 0.00050627, -0.00000113, 0.00000000],
++		[-6.27296293, -0.00050364, 0.00030858, 0.00050619, -0.00000113, 0.00000000],
++		[-6.27296313, -0.00050356, 0.00030853, 0.00050611, -0.00000113, 0.00000000],
++		[-6.27296332, -0.00050347, 0.00030848, 0.00050602, -0.00000113, 0.00000000],
++		[-6.27296352, -0.00050339, 0.00030843, 0.00050594, -0.00000113, 0.00000000],
++		[-6.27296372, -0.00050331, 0.00030838, 0.00050586, -0.00000113, 0.00000000],
++		[-6.27296391, -0.00050323, 0.00030833, 0.00050578, -0.00000113, 0.00000000],
++		[-6.27296411, -0.00050315, 0.00030828, 0.00050569, -0.00000113, 0.00000000],
++		[-6.27296430, -0.00050306, 0.00030823, 0.00050561, -0.00000113, 0.00000000],
++		[-6.27296450, -0.00050298, 0.00030818, 0.00050553, -0.00000113, 0.00000000],
++		[-6.27296469, -0.00050290, 0.00030813, 0.00050545, -0.00000113, 0.00000000],
++		[-6.27296489, -0.00050282, 0.00030808, 0.00050537, -0.00000113, 0.00000000],
++		[-6.27296509, -0.00050274, 0.00030803, 0.00050528, -0.00000113, 0.00000000],
++		[-6.27296528, -0.00050266, 0.00030798, 0.00050520, -0.00000113, 0.00000000],
++		[-6.27296548, -0.00050257, 0.00030793, 0.00050512, -0.00000113, 0.00000000],
++		[-6.27296567, -0.00050249, 0.00030788, 0.00050504, -0.00000113, 0.00000000],
++		[-6.27296587, -0.00050241, 0.00030783, 0.00050496, -0.00000113, 0.00000000],
++		[-6.27296606, -0.00050233, 0.00030778, 0.00050487, -0.00000113, 0.00000000],
++		[-6.27296626, -0.00050225, 0.00030773, 0.00050479, -0.00000113, 0.00000000],
++		[-6.27296645, -0.00050217, 0.00030768, 0.00050471, -0.00000113, 0.00000000],
++		[-6.27296665, -0.00050209, 0.00030763, 0.00050463, -0.00000113, 0.00000000],
++		[-6.27296684, -0.00050200, 0.00030758, 0.00050455, -0.00000113, 0.00000000],
++		[-6.27296704, -0.00050192, 0.00030753, 0.00050446, -0.00000113, 0.00000000],
++		[-6.27296723, -0.00050184, 0.00030748, 0.00050438, -0.00000113, 0.00000000],
++		[-6.27296743, -0.00050176, 0.00030743, 0.00050430, -0.00000113, 0.00000000],
++		[-6.27296762, -0.00050168, 0.00030738, 0.00050422, -0.00000113, 0.00000000],
++		[-6.27296781, -0.00050160, 0.00030733, 0.00050414, -0.00000113, 0.00000000],
++		[-6.27296801, -0.00050152, 0.00030728, 0.00050406, -0.00000113, 0.00000000],
++		[-6.27296820, -0.00050143, 0.00030723, 0.00050397, -0.00000113, 0.00000000],
++		[-6.27296840, -0.00050135, 0.00030718, 0.00050389, -0.00000113, 0.00000000],
++		[-6.27296859, -0.00050127, 0.00030713, 0.00050381, -0.00000113, 0.00000000],
++		[-6.27296879, -0.00050119, 0.00030708, 0.00050373, -0.00000113, 0.00000000],
++		[-6.27296898, -0.00050111, 0.00030703, 0.00050365, -0.00000113, 0.00000000],
++		[-6.27296917, -0.00050103, 0.00030698, 0.00050357, -0.00000113, 0.00000000],
++		[-6.27296937, -0.00050095, 0.00030693, 0.00050348, -0.00000113, 0.00000000],
++		[-6.27296956, -0.00050087, 0.00030688, 0.00050340, -0.00000113, 0.00000000],
++		[-6.27296976, -0.00050079, 0.00030683, 0.00050332, -0.00000113, 0.00000000],
++		[-6.27296995, -0.00050070, 0.00030678, 0.00050324, -0.00000113, 0.00000000],
++		[-6.27297014, -0.00050062, 0.00030673, 0.00050316, -0.00000113, 0.00000000],
++		[-6.27297034, -0.00050054, 0.00030668, 0.00050308, -0.00000113, 0.00000000],
++		[-6.27297053, -0.00050046, 0.00030663, 0.00050300, -0.00000113, 0.00000000],
++		[-6.27297073, -0.00050038, 0.00030658, 0.00050291, -0.00000113, 0.00000000],
++		[-6.27297092, -0.00050030, 0.00030653, 0.00050283, -0.00000113, 0.00000000],
++		[-6.27297111, -0.00050022, 0.00030648, 0.00050275, -0.00000113, 0.00000000],
++		[-6.27297131, -0.00050014, 0.00030643, 0.00050267, -0.00000113, 0.00000000],
++		[-6.27297150, -0.00050006, 0.00030638, 0.00050259, -0.00000113, 0.00000000],
++		[-6.27297169, -0.00049998, 0.00030633, 0.00050251, -0.00000113, 0.00000000],
++		[-6.27297189, -0.00049990, 0.00030629, 0.00050243, -0.00000113, 0.00000000],
++		[-6.27297208, -0.00049982, 0.00030624, 0.00050235, -0.00000113, 0.00000000],
++		[-6.27297227, -0.00049973, 0.00030619, 0.00050227, -0.00000113, 0.00000000],
++		[-6.27297246, -0.00049965, 0.00030614, 0.00050218, -0.00000113, 0.00000000],
++		[-6.27297266, -0.00049957, 0.00030609, 0.00050210, -0.00000113, 0.00000000],
++		[-6.27297285, -0.00049949, 0.00030604, 0.00050202, -0.00000113, 0.00000000],
++		[-6.27297304, -0.00049941, 0.00030599, 0.00050194, -0.00000113, 0.00000000],
++		[-6.27297324, -0.00049933, 0.00030594, 0.00050186, -0.00000113, 0.00000000],
++		[-6.27297343, -0.00049925, 0.00030589, 0.00050178, -0.00000113, 0.00000000],
++		[-6.27297362, -0.00049917, 0.00030584, 0.00050170, -0.00000113, 0.00000000],
++		[-6.27297381, -0.00049909, 0.00030579, 0.00050162, -0.00000113, 0.00000000],
++		[-6.27297401, -0.00049901, 0.00030574, 0.00050154, -0.00000113, 0.00000000],
++		[-6.27297420, -0.00049893, 0.00030569, 0.00050146, -0.00000113, 0.00000000],
++		[-6.27297439, -0.00049885, 0.00030564, 0.00050137, -0.00000113, 0.00000000],
++		[-6.27297458, -0.00049877, 0.00030559, 0.00050129, -0.00000113, 0.00000000],
++		[-6.27297478, -0.00049869, 0.00030554, 0.00050121, -0.00000113, 0.00000000],
++		[-6.27297497, -0.00049861, 0.00030550, 0.00050113, -0.00000113, 0.00000000],
++		[-6.27297516, -0.00049853, 0.00030545, 0.00050105, -0.00000113, 0.00000000],
++		[-6.27297535, -0.00049845, 0.00030540, 0.00050097, -0.00000113, 0.00000000],
++		[-6.27297554, -0.00049837, 0.00030535, 0.00050089, -0.00000113, 0.00000000],
++		[-6.27297574, -0.00049829, 0.00030530, 0.00050081, -0.00000113, 0.00000000],
++		[-6.27297593, -0.00049821, 0.00030525, 0.00050073, -0.00000113, 0.00000000],
++		[-6.27297612, -0.00049813, 0.00030520, 0.00050065, -0.00000113, 0.00000000],
++		[-6.27297631, -0.00049805, 0.00030515, 0.00050057, -0.00000113, 0.00000000],
++		[-6.27297650, -0.00049797, 0.00030510, 0.00050049, -0.00000113, 0.00000000],
++		[-6.27297670, -0.00049789, 0.00030505, 0.00050041, -0.00000113, 0.00000000],
++		[-6.27297689, -0.00049781, 0.00030500, 0.00050033, -0.00000113, 0.00000000],
++		[-6.27297708, -0.00049773, 0.00030495, 0.00050025, -0.00000113, 0.00000000],
++		[-6.27297727, -0.00049765, 0.00030491, 0.00050017, -0.00000113, 0.00000000],
++		[-6.27297746, -0.00049757, 0.00030486, 0.00050009, -0.00000113, 0.00000000],
++		[-6.27297765, -0.00049749, 0.00030481, 0.00050000, -0.00000113, 0.00000000],
++		[-6.27297784, -0.00049741, 0.00030476, 0.00049992, -0.00000113, 0.00000000],
++		[-6.27297804, -0.00049733, 0.00030471, 0.00049984, -0.00000113, 0.00000000],
++		[-6.27297823, -0.00049725, 0.00030466, 0.00049976, -0.00000113, 0.00000000],
++		[-6.27297842, -0.00049717, 0.00030461, 0.00049968, -0.00000113, 0.00000000],
++		[-6.27297861, -0.00049709, 0.00030456, 0.00049960, -0.00000113, 0.00000000],
++		[-6.27297880, -0.00049701, 0.00030451, 0.00049952, -0.00000113, 0.00000000],
++		[-6.27297899, -0.00049693, 0.00030446, 0.00049944, -0.00000113, 0.00000000],
++		[-6.27297918, -0.00049685, 0.00030442, 0.00049936, -0.00000113, 0.00000000],
++		[-6.27297937, -0.00049677, 0.00030437, 0.00049928, -0.00000113, 0.00000000],
++		[-6.27297956, -0.00049669, 0.00030432, 0.00049920, -0.00000113, 0.00000000],
++		[-6.27297975, -0.00049661, 0.00030427, 0.00049912, -0.00000113, 0.00000000],
++		[-6.27297994, -0.00049653, 0.00030422, 0.00049904, -0.00000113, 0.00000000],
++		[-6.27298013, -0.00049645, 0.00030417, 0.00049896, -0.00000113, 0.00000000],
++		[-6.27298033, -0.00049637, 0.00030412, 0.00049888, -0.00000114, 0.00000000],
++		[-6.27298052, -0.00049629, 0.00030407, 0.00049880, -0.00000114, 0.00000000],
++		[-6.27298071, -0.00049621, 0.00030403, 0.00049872, -0.00000114, 0.00000000],
++		[-6.27298090, -0.00049613, 0.00030398, 0.00049864, -0.00000114, 0.00000000],
++		[-6.27298109, -0.00049605, 0.00030393, 0.00049856, -0.00000114, 0.00000000],
++		[-6.27298128, -0.00049597, 0.00030388, 0.00049848, -0.00000114, 0.00000000],
++		[-6.27298147, -0.00049589, 0.00030383, 0.00049840, -0.00000114, 0.00000000],
++		[-6.27298166, -0.00049581, 0.00030378, 0.00049832, -0.00000114, 0.00000000],
++		[-6.27298185, -0.00049573, 0.00030373, 0.00049824, -0.00000114, 0.00000000],
++		[-6.27298204, -0.00049565, 0.00030368, 0.00049816, -0.00000114, 0.00000000],
++		[-6.27298223, -0.00049557, 0.00030364, 0.00049808, -0.00000114, 0.00000000],
++		[-6.27298242, -0.00049550, 0.00030359, 0.00049800, -0.00000114, 0.00000000],
++		[-6.27298261, -0.00049542, 0.00030354, 0.00049792, -0.00000114, 0.00000000],
++		[-6.27298280, -0.00049534, 0.00030349, 0.00049784, -0.00000114, 0.00000000],
++		[-6.27298299, -0.00049526, 0.00030344, 0.00049776, -0.00000114, 0.00000000],
++		[-6.27298318, -0.00049518, 0.00030339, 0.00049769, -0.00000114, 0.00000000],
++		[-6.27298336, -0.00049510, 0.00030334, 0.00049761, -0.00000114, 0.00000000],
++		[-6.27298355, -0.00049502, 0.00030330, 0.00049753, -0.00000114, 0.00000000],
++		[-6.27298374, -0.00049494, 0.00030325, 0.00049745, -0.00000114, 0.00000000],
++		[-6.27298393, -0.00049486, 0.00030320, 0.00049737, -0.00000114, 0.00000000],
++		[-6.27298412, -0.00049478, 0.00030315, 0.00049729, -0.00000114, 0.00000000],
++		[-6.27298431, -0.00049470, 0.00030310, 0.00049721, -0.00000114, 0.00000000],
++		[-6.27298450, -0.00049462, 0.00030305, 0.00049713, -0.00000114, 0.00000000],
++		[-6.27298469, -0.00049455, 0.00030300, 0.00049705, -0.00000114, 0.00000000],
++		[-6.27298488, -0.00049447, 0.00030296, 0.00049697, -0.00000114, 0.00000000],
++		[-6.27298507, -0.00049439, 0.00030291, 0.00049689, -0.00000114, 0.00000000],
++		[-6.27298526, -0.00049431, 0.00030286, 0.00049681, -0.00000114, 0.00000000],
++		[-6.27298545, -0.00049423, 0.00030281, 0.00049673, -0.00000114, 0.00000000],
++		[-6.27298563, -0.00049415, 0.00030276, 0.00049665, -0.00000114, 0.00000000],
++		[-6.27298582, -0.00049407, 0.00030271, 0.00049657, -0.00000114, 0.00000000],
++		[-6.27298601, -0.00049399, 0.00030267, 0.00049649, -0.00000114, 0.00000000],
++		[-6.27298620, -0.00049391, 0.00030262, 0.00049641, -0.00000114, 0.00000000],
++		[-6.27298639, -0.00049384, 0.00030257, 0.00049634, -0.00000114, 0.00000000],
++		[-6.27298658, -0.00049376, 0.00030252, 0.00049626, -0.00000114, 0.00000000],
++		[-6.27298677, -0.00049368, 0.00030247, 0.00049618, -0.00000114, 0.00000000],
++		[-6.27298695, -0.00049360, 0.00030242, 0.00049610, -0.00000114, 0.00000000],
++		[-6.27298714, -0.00049352, 0.00030238, 0.00049602, -0.00000114, 0.00000000],
++		[-6.27298733, -0.00049344, 0.00030233, 0.00049594, -0.00000114, 0.00000000],
++		[-6.27298752, -0.00049336, 0.00030228, 0.00049586, -0.00000114, 0.00000000],
++		[-6.27298771, -0.00049328, 0.00030223, 0.00049578, -0.00000114, 0.00000000],
++		[-6.27298790, -0.00049321, 0.00030218, 0.00049570, -0.00000114, 0.00000000],
++		[-6.27298808, -0.00049313, 0.00030214, 0.00049562, -0.00000114, 0.00000000],
++		[-6.27298827, -0.00049305, 0.00030209, 0.00049554, -0.00000114, 0.00000000],
++		[-6.27298846, -0.00049297, 0.00030204, 0.00049547, -0.00000114, 0.00000000],
++		[-6.27298865, -0.00049289, 0.00030199, 0.00049539, -0.00000114, 0.00000000],
++		[-6.27298883, -0.00049281, 0.00030194, 0.00049531, -0.00000114, 0.00000000],
++		[-6.27298902, -0.00049273, 0.00030189, 0.00049523, -0.00000114, 0.00000000],
++		[-6.27298921, -0.00049266, 0.00030185, 0.00049515, -0.00000114, 0.00000000],
++		[-6.27298940, -0.00049258, 0.00030180, 0.00049507, -0.00000114, 0.00000000],
++		[-6.27298959, -0.00049250, 0.00030175, 0.00049499, -0.00000114, 0.00000000],
++		[-6.27298977, -0.00049242, 0.00030170, 0.00049491, -0.00000114, 0.00000000],
++		[-6.27298996, -0.00049234, 0.00030165, 0.00049484, -0.00000114, 0.00000000],
++		[-6.27299015, -0.00049226, 0.00030161, 0.00049476, -0.00000114, 0.00000000],
++		[-6.27299033, -0.00049219, 0.00030156, 0.00049468, -0.00000114, 0.00000000],
++		[-6.27299052, -0.00049211, 0.00030151, 0.00049460, -0.00000114, 0.00000000],
++		[-6.27299071, -0.00049203, 0.00030146, 0.00049452, -0.00000114, 0.00000000],
++		[-6.27299090, -0.00049195, 0.00030141, 0.00049444, -0.00000114, 0.00000000],
++		[-6.27299108, -0.00049187, 0.00030137, 0.00049436, -0.00000114, 0.00000000],
++		[-6.27299127, -0.00049180, 0.00030132, 0.00049428, -0.00000114, 0.00000000],
++		[-6.27299146, -0.00049172, 0.00030127, 0.00049421, -0.00000114, 0.00000000],
++		[-6.27299164, -0.00049164, 0.00030122, 0.00049413, -0.00000114, 0.00000000],
++		[-6.27299183, -0.00049156, 0.00030118, 0.00049405, -0.00000114, 0.00000000],
++		[-6.27299202, -0.00049148, 0.00030113, 0.00049397, -0.00000114, 0.00000000],
++		[-6.27299220, -0.00049140, 0.00030108, 0.00049389, -0.00000114, 0.00000000],
++		[-6.27299239, -0.00049133, 0.00030103, 0.00049381, -0.00000114, 0.00000000],
++		[-6.27299258, -0.00049125, 0.00030098, 0.00049374, -0.00000114, 0.00000000],
++		[-6.27299276, -0.00049117, 0.00030094, 0.00049366, -0.00000114, 0.00000000],
++		[-6.27299295, -0.00049109, 0.00030089, 0.00049358, -0.00000114, 0.00000000],
++		[-6.27299314, -0.00049102, 0.00030084, 0.00049350, -0.00000114, 0.00000000],
++		[-6.27299332, -0.00049094, 0.00030079, 0.00049342, -0.00000114, 0.00000000],
++		[-6.27299351, -0.00049086, 0.00030075, 0.00049334, -0.00000114, 0.00000000],
++		[-6.27299370, -0.00049078, 0.00030070, 0.00049327, -0.00000114, 0.00000000],
++		[-6.27299388, -0.00049070, 0.00030065, 0.00049319, -0.00000114, 0.00000000],
++		[-6.27299407, -0.00049063, 0.00030060, 0.00049311, -0.00000114, 0.00000000],
++		[-6.27299425, -0.00049055, 0.00030055, 0.00049303, -0.00000114, 0.00000000],
++		[-6.27299444, -0.00049047, 0.00030051, 0.00049295, -0.00000114, 0.00000000],
++		[-6.27299463, -0.00049039, 0.00030046, 0.00049288, -0.00000114, 0.00000000],
++		[-6.27299481, -0.00049032, 0.00030041, 0.00049280, -0.00000114, 0.00000000],
++		[-6.27299500, -0.00049024, 0.00030036, 0.00049272, -0.00000114, 0.00000000],
++		[-6.27299518, -0.00049016, 0.00030032, 0.00049264, -0.00000114, 0.00000000],
++		[-6.27299537, -0.00049008, 0.00030027, 0.00049256, -0.00000114, 0.00000000],
++		[-6.27299556, -0.00049000, 0.00030022, 0.00049249, -0.00000114, 0.00000000],
++		[-6.27299574, -0.00048993, 0.00030017, 0.00049241, -0.00000114, 0.00000000],
++		[-6.27299593, -0.00048985, 0.00030013, 0.00049233, -0.00000114, 0.00000000],
++		[-6.27299611, -0.00048977, 0.00030008, 0.00049225, -0.00000114, 0.00000000],
++		[-6.27299630, -0.00048969, 0.00030003, 0.00049217, -0.00000114, 0.00000000],
++		[-6.27299648, -0.00048962, 0.00029998, 0.00049210, -0.00000114, 0.00000000],
++		[-6.27299667, -0.00048954, 0.00029994, 0.00049202, -0.00000114, 0.00000000],
++		[-6.27299685, -0.00048946, 0.00029989, 0.00049194, -0.00000114, 0.00000000],
++		[-6.27299704, -0.00048938, 0.00029984, 0.00049186, -0.00000114, 0.00000000],
++		[-6.27299722, -0.00048931, 0.00029979, 0.00049178, -0.00000114, 0.00000000],
++		[-6.27299741, -0.00048923, 0.00029975, 0.00049171, -0.00000114, 0.00000000],
++		[-6.27299759, -0.00048915, 0.00029970, 0.00049163, -0.00000114, 0.00000000],
++		[-6.27299778, -0.00048908, 0.00029965, 0.00049155, -0.00000114, 0.00000000],
++		[-6.27299796, -0.00048900, 0.00029960, 0.00049147, -0.00000114, 0.00000000],
++		[-6.27299815, -0.00048892, 0.00029956, 0.00049140, -0.00000114, 0.00000000],
++		[-6.27299833, -0.00048884, 0.00029951, 0.00049132, -0.00000114, 0.00000000],
++		[-6.27299852, -0.00048877, 0.00029946, 0.00049124, -0.00000114, 0.00000000],
++		[-6.27299870, -0.00048869, 0.00029941, 0.00049116, -0.00000114, 0.00000000],
++		[-6.27299889, -0.00048861, 0.00029937, 0.00049109, -0.00000114, 0.00000000],
++		[-6.27299907, -0.00048854, 0.00029932, 0.00049101, -0.00000114, 0.00000000],
++		[-6.27299926, -0.00048846, 0.00029927, 0.00049093, -0.00000114, 0.00000000],
++		[-6.27299944, -0.00048838, 0.00029923, 0.00049085, -0.00000114, 0.00000000],
++		[-6.27299962, -0.00048830, 0.00029918, 0.00049078, -0.00000114, 0.00000000],
++		[-6.27299981, -0.00048823, 0.00029913, 0.00049070, -0.00000114, 0.00000000],
++		[-6.27299999, -0.00048815, 0.00029908, 0.00049062, -0.00000114, 0.00000000],
++		[-6.27300018, -0.00048807, 0.00029904, 0.00049054, -0.00000114, 0.00000000],
++		[-6.27300036, -0.00048800, 0.00029899, 0.00049047, -0.00000114, 0.00000000],
++		[-6.27300055, -0.00048792, 0.00029894, 0.00049039, -0.00000114, 0.00000000],
++		[-6.27300073, -0.00048784, 0.00029890, 0.00049031, -0.00000114, 0.00000000],
++		[-6.27300091, -0.00048777, 0.00029885, 0.00049023, -0.00000114, 0.00000000],
++		[-6.27300110, -0.00048769, 0.00029880, 0.00049016, -0.00000114, 0.00000000],
++		[-6.27300128, -0.00048761, 0.00029875, 0.00049008, -0.00000114, 0.00000000],
++		[-6.27300146, -0.00048754, 0.00029871, 0.00049000, -0.00000114, 0.00000000],
++		[-6.27300165, -0.00048746, 0.00029866, 0.00048993, -0.00000114, 0.00000000],
++		[-6.27300183, -0.00048738, 0.00029861, 0.00048985, -0.00000114, 0.00000000],
++		[-6.27300202, -0.00048730, 0.00029857, 0.00048977, -0.00000114, 0.00000000],
++		[-6.27300220, -0.00048723, 0.00029852, 0.00048969, -0.00000114, 0.00000000],
++		[-6.27300238, -0.00048715, 0.00029847, 0.00048962, -0.00000114, 0.00000000],
++		[-6.27300257, -0.00048707, 0.00029842, 0.00048954, -0.00000114, 0.00000000],
++		[-6.27300275, -0.00048700, 0.00029838, 0.00048946, -0.00000114, 0.00000000],
++		[-6.27300293, -0.00048692, 0.00029833, 0.00048939, -0.00000114, 0.00000000],
++		[-6.27300312, -0.00048685, 0.00029828, 0.00048931, -0.00000114, 0.00000000],
++		[-6.27300330, -0.00048677, 0.00029824, 0.00048923, -0.00000114, 0.00000000],
++		[-6.27300348, -0.00048669, 0.00029819, 0.00048916, -0.00000114, 0.00000000],
++		[-6.27300367, -0.00048662, 0.00029814, 0.00048908, -0.00000114, 0.00000000],
++		[-6.27300385, -0.00048654, 0.00029810, 0.00048900, -0.00000114, 0.00000000],
++		[-6.27300403, -0.00048646, 0.00029805, 0.00048892, -0.00000114, 0.00000000],
++		[-6.27300421, -0.00048639, 0.00029800, 0.00048885, -0.00000114, 0.00000000],
++		[-6.27300440, -0.00048631, 0.00029796, 0.00048877, -0.00000114, 0.00000000],
++		[-6.27300458, -0.00048623, 0.00029791, 0.00048869, -0.00000114, 0.00000000],
++		[-6.27300476, -0.00048616, 0.00029786, 0.00048862, -0.00000114, 0.00000000],
++		[-6.27300495, -0.00048608, 0.00029782, 0.00048854, -0.00000114, 0.00000000],
++		[-6.27300513, -0.00048600, 0.00029777, 0.00048846, -0.00000114, 0.00000000],
++		[-6.27300531, -0.00048593, 0.00029772, 0.00048839, -0.00000114, 0.00000000],
++		[-6.27300549, -0.00048585, 0.00029768, 0.00048831, -0.00000114, 0.00000000],
++		[-6.27300568, -0.00048578, 0.00029763, 0.00048823, -0.00000114, 0.00000000],
++		[-6.27300586, -0.00048570, 0.00029758, 0.00048816, -0.00000114, 0.00000000],
++		[-6.27300604, -0.00048562, 0.00029753, 0.00048808, -0.00000114, 0.00000000],
++		[-6.27300622, -0.00048555, 0.00029749, 0.00048800, -0.00000114, 0.00000000],
++		[-6.27300640, -0.00048547, 0.00029744, 0.00048793, -0.00000114, 0.00000000],
++		[-6.27300659, -0.00048539, 0.00029739, 0.00048785, -0.00000114, 0.00000000],
++		[-6.27300677, -0.00048532, 0.00029735, 0.00048777, -0.00000114, 0.00000000],
++		[-6.27300695, -0.00048524, 0.00029730, 0.00048770, -0.00000114, 0.00000000],
++		[-6.27300713, -0.00048517, 0.00029725, 0.00048762, -0.00000114, 0.00000000],
++		[-6.27300732, -0.00048509, 0.00029721, 0.00048755, -0.00000114, 0.00000000],
++		[-6.27300750, -0.00048501, 0.00029716, 0.00048747, -0.00000114, 0.00000000],
++		[-6.27300768, -0.00048494, 0.00029712, 0.00048739, -0.00000114, 0.00000000],
++		[-6.27300786, -0.00048486, 0.00029707, 0.00048732, -0.00000114, 0.00000000],
++		[-6.27300804, -0.00048479, 0.00029702, 0.00048724, -0.00000114, 0.00000000],
++		[-6.27300822, -0.00048471, 0.00029698, 0.00048716, -0.00000114, 0.00000000],
++		[-6.27300841, -0.00048463, 0.00029693, 0.00048709, -0.00000114, 0.00000000],
++		[-6.27300859, -0.00048456, 0.00029688, 0.00048701, -0.00000114, 0.00000000],
++		[-6.27300877, -0.00048448, 0.00029684, 0.00048693, -0.00000114, 0.00000000],
++		[-6.27300895, -0.00048441, 0.00029679, 0.00048686, -0.00000114, 0.00000000],
++		[-6.27300913, -0.00048433, 0.00029674, 0.00048678, -0.00000114, 0.00000000],
++		[-6.27300931, -0.00048426, 0.00029670, 0.00048671, -0.00000114, 0.00000000],
++		[-6.27300949, -0.00048418, 0.00029665, 0.00048663, -0.00000114, 0.00000000],
++		[-6.27300968, -0.00048410, 0.00029660, 0.00048655, -0.00000114, 0.00000000],
++		[-6.27300986, -0.00048403, 0.00029656, 0.00048648, -0.00000114, 0.00000000],
++		[-6.27301004, -0.00048395, 0.00029651, 0.00048640, -0.00000114, 0.00000000],
++		[-6.27301022, -0.00048388, 0.00029646, 0.00048633, -0.00000114, 0.00000000],
++		[-6.27301040, -0.00048380, 0.00029642, 0.00048625, -0.00000114, 0.00000000],
++		[-6.27301058, -0.00048373, 0.00029637, 0.00048617, -0.00000114, 0.00000000],
++		[-6.27301076, -0.00048365, 0.00029633, 0.00048610, -0.00000114, 0.00000000],
++		[-6.27301094, -0.00048357, 0.00029628, 0.00048602, -0.00000114, 0.00000000],
++		[-6.27301112, -0.00048350, 0.00029623, 0.00048595, -0.00000114, 0.00000000],
++		[-6.27301130, -0.00048342, 0.00029619, 0.00048587, -0.00000114, 0.00000000],
++		[-6.27301148, -0.00048335, 0.00029614, 0.00048579, -0.00000114, 0.00000000],
++		[-6.27301166, -0.00048327, 0.00029609, 0.00048572, -0.00000114, 0.00000000],
++		[-6.27301185, -0.00048320, 0.00029605, 0.00048564, -0.00000114, 0.00000000],
++		[-6.27301203, -0.00048312, 0.00029600, 0.00048557, -0.00000114, 0.00000000],
++		[-6.27301221, -0.00048305, 0.00029596, 0.00048549, -0.00000114, 0.00000000],
++		[-6.27301239, -0.00048297, 0.00029591, 0.00048542, -0.00000114, 0.00000000],
++		[-6.27301257, -0.00048290, 0.00029586, 0.00048534, -0.00000114, 0.00000000],
++		[-6.27301275, -0.00048282, 0.00029582, 0.00048526, -0.00000114, 0.00000000],
++		[-6.27301293, -0.00048275, 0.00029577, 0.00048519, -0.00000114, 0.00000000],
++		[-6.27301311, -0.00048267, 0.00029572, 0.00048511, -0.00000114, 0.00000000],
++		[-6.27301329, -0.00048259, 0.00029568, 0.00048504, -0.00000114, 0.00000000],
++		[-6.27301347, -0.00048252, 0.00029563, 0.00048496, -0.00000114, 0.00000000],
++		[-6.27301365, -0.00048244, 0.00029559, 0.00048489, -0.00000114, 0.00000000],
++		[-6.27301383, -0.00048237, 0.00029554, 0.00048481, -0.00000114, 0.00000000],
++		[-6.27301401, -0.00048229, 0.00029549, 0.00048473, -0.00000114, 0.00000000],
++		[-6.27301419, -0.00048222, 0.00029545, 0.00048466, -0.00000114, 0.00000000],
++		[-6.27301437, -0.00048214, 0.00029540, 0.00048458, -0.00000114, 0.00000000],
++		[-6.27301455, -0.00048207, 0.00029536, 0.00048451, -0.00000114, 0.00000000],
++		[-6.27301473, -0.00048199, 0.00029531, 0.00048443, -0.00000114, 0.00000000],
++		[-6.27301491, -0.00048192, 0.00029526, 0.00048436, -0.00000114, 0.00000000],
++		[-6.27301509, -0.00048184, 0.00029522, 0.00048428, -0.00000114, 0.00000000],
++		[-6.27301526, -0.00048177, 0.00029517, 0.00048421, -0.00000114, 0.00000000],
++		[-6.27301544, -0.00048169, 0.00029513, 0.00048413, -0.00000114, 0.00000000],
++		[-6.27301562, -0.00048162, 0.00029508, 0.00048406, -0.00000114, 0.00000000],
++		[-6.27301580, -0.00048154, 0.00029503, 0.00048398, -0.00000114, 0.00000000],
++		[-6.27301598, -0.00048147, 0.00029499, 0.00048390, -0.00000114, 0.00000000],
++		[-6.27301616, -0.00048139, 0.00029494, 0.00048383, -0.00000114, 0.00000000],
++		[-6.27301634, -0.00048132, 0.00029490, 0.00048375, -0.00000114, 0.00000000],
++		[-6.27301652, -0.00048124, 0.00029485, 0.00048368, -0.00000114, 0.00000000],
++		[-6.27301670, -0.00048117, 0.00029480, 0.00048360, -0.00000114, 0.00000000],
++		[-6.27301688, -0.00048109, 0.00029476, 0.00048353, -0.00000114, 0.00000000],
++		[-6.27301706, -0.00048102, 0.00029471, 0.00048345, -0.00000114, 0.00000000],
++		[-6.27301724, -0.00048095, 0.00029467, 0.00048338, -0.00000114, 0.00000000],
++		[-6.27301741, -0.00048087, 0.00029462, 0.00048330, -0.00000114, 0.00000000],
++		[-6.27301759, -0.00048080, 0.00029458, 0.00048323, -0.00000114, 0.00000000],
++		[-6.27301777, -0.00048072, 0.00029453, 0.00048315, -0.00000114, 0.00000000],
++		[-6.27301795, -0.00048065, 0.00029448, 0.00048308, -0.00000114, 0.00000000],
++		[-6.27301813, -0.00048057, 0.00029444, 0.00048300, -0.00000114, 0.00000000],
++		[-6.27301831, -0.00048050, 0.00029439, 0.00048293, -0.00000114, 0.00000000],
++		[-6.27301849, -0.00048042, 0.00029435, 0.00048285, -0.00000114, 0.00000000],
++		[-6.27301866, -0.00048035, 0.00029430, 0.00048278, -0.00000114, 0.00000000],
++		[-6.27301884, -0.00048027, 0.00029426, 0.00048270, -0.00000114, 0.00000000],
++		[-6.27301902, -0.00048020, 0.00029421, 0.00048263, -0.00000114, 0.00000000],
++		[-6.27301920, -0.00048012, 0.00029416, 0.00048255, -0.00000114, 0.00000000],
++		[-6.27301938, -0.00048005, 0.00029412, 0.00048248, -0.00000114, 0.00000000],
++		[-6.27301956, -0.00047998, 0.00029407, 0.00048240, -0.00000114, 0.00000000],
++		[-6.27301973, -0.00047990, 0.00029403, 0.00048233, -0.00000114, 0.00000000],
++		[-6.27301991, -0.00047983, 0.00029398, 0.00048225, -0.00000114, 0.00000000],
++		[-6.27302009, -0.00047975, 0.00029394, 0.00048218, -0.00000114, 0.00000000],
++		[-6.27302027, -0.00047968, 0.00029389, 0.00048211, -0.00000114, 0.00000000],
++		[-6.27302044, -0.00047960, 0.00029384, 0.00048203, -0.00000114, 0.00000000],
++		[-6.27302062, -0.00047953, 0.00029380, 0.00048196, -0.00000114, 0.00000000],
++		[-6.27302080, -0.00047946, 0.00029375, 0.00048188, -0.00000114, 0.00000000],
++		[-6.27302098, -0.00047938, 0.00029371, 0.00048181, -0.00000114, 0.00000000],
++		[-6.27302116, -0.00047931, 0.00029366, 0.00048173, -0.00000114, 0.00000000],
++		[-6.27302133, -0.00047923, 0.00029362, 0.00048166, -0.00000114, 0.00000000],
++		[-6.27302151, -0.00047916, 0.00029357, 0.00048158, -0.00000114, 0.00000000],
++		[-6.27302169, -0.00047908, 0.00029353, 0.00048151, -0.00000114, 0.00000000],
++		[-6.27302187, -0.00047901, 0.00029348, 0.00048143, -0.00000114, 0.00000000],
++		[-6.27302204, -0.00047894, 0.00029344, 0.00048136, -0.00000114, 0.00000000],
++		[-6.27302222, -0.00047886, 0.00029339, 0.00048128, -0.00000114, 0.00000000],
++		[-6.27302240, -0.00047879, 0.00029334, 0.00048121, -0.00000114, 0.00000000],
++		[-6.27302257, -0.00047871, 0.00029330, 0.00048114, -0.00000114, 0.00000000],
++		[-6.27302275, -0.00047864, 0.00029325, 0.00048106, -0.00000114, 0.00000000],
++		[-6.27302293, -0.00047857, 0.00029321, 0.00048099, -0.00000114, 0.00000000],
++		[-6.27302311, -0.00047849, 0.00029316, 0.00048091, -0.00000114, 0.00000000],
++		[-6.27302328, -0.00047842, 0.00029312, 0.00048084, -0.00000114, 0.00000000],
++		[-6.27302346, -0.00047834, 0.00029307, 0.00048076, -0.00000114, 0.00000000],
++		[-6.27302364, -0.00047827, 0.00029303, 0.00048069, -0.00000114, 0.00000000],
++		[-6.27302381, -0.00047820, 0.00029298, 0.00048062, -0.00000114, 0.00000000],
++		[-6.27302399, -0.00047812, 0.00029294, 0.00048054, -0.00000114, 0.00000000],
++		[-6.27302417, -0.00047805, 0.00029289, 0.00048047, -0.00000114, 0.00000000],
++		[-6.27302434, -0.00047797, 0.00029285, 0.00048039, -0.00000114, 0.00000000],
++		[-6.27302452, -0.00047790, 0.00029280, 0.00048032, -0.00000114, 0.00000000],
++		[-6.27302470, -0.00047783, 0.00029276, 0.00048024, -0.00000114, 0.00000000],
++		[-6.27302487, -0.00047775, 0.00029271, 0.00048017, -0.00000114, 0.00000000],
++		[-6.27302505, -0.00047768, 0.00029267, 0.00048010, -0.00000114, 0.00000000],
++		[-6.27302523, -0.00047761, 0.00029262, 0.00048002, -0.00000114, 0.00000000],
++		[-6.27302540, -0.00047753, 0.00029257, 0.00047995, -0.00000114, 0.00000000],
++		[-6.27302558, -0.00047746, 0.00029253, 0.00047987, -0.00000114, 0.00000000],
++		[-6.27302575, -0.00047739, 0.00029248, 0.00047980, -0.00000114, 0.00000000],
++		[-6.27302593, -0.00047731, 0.00029244, 0.00047973, -0.00000114, 0.00000000],
++		[-6.27302611, -0.00047724, 0.00029239, 0.00047965, -0.00000114, 0.00000000],
++		[-6.27302628, -0.00047716, 0.00029235, 0.00047958, -0.00000114, 0.00000000],
++		[-6.27302646, -0.00047709, 0.00029230, 0.00047950, -0.00000114, 0.00000000],
++		[-6.27302664, -0.00047702, 0.00029226, 0.00047943, -0.00000114, 0.00000000],
++		[-6.27302681, -0.00047694, 0.00029221, 0.00047936, -0.00000114, 0.00000000],
++		[-6.27302699, -0.00047687, 0.00029217, 0.00047928, -0.00000114, 0.00000000],
++		[-6.27302716, -0.00047680, 0.00029212, 0.00047921, -0.00000114, 0.00000000],
++		[-6.27302734, -0.00047672, 0.00029208, 0.00047913, -0.00000114, 0.00000000],
++		[-6.27302751, -0.00047665, 0.00029203, 0.00047906, -0.00000114, 0.00000000],
++		[-6.27302769, -0.00047658, 0.00029199, 0.00047899, -0.00000114, 0.00000000],
++		[-6.27302787, -0.00047650, 0.00029194, 0.00047891, -0.00000114, 0.00000000],
++		[-6.27302804, -0.00047643, 0.00029190, 0.00047884, -0.00000114, 0.00000000],
++		[-6.27302822, -0.00047636, 0.00029185, 0.00047877, -0.00000114, 0.00000000],
++		[-6.27302839, -0.00047628, 0.00029181, 0.00047869, -0.00000114, 0.00000000],
++		[-6.27302857, -0.00047621, 0.00029176, 0.00047862, -0.00000114, 0.00000000],
++		[-6.27302874, -0.00047614, 0.00029172, 0.00047855, -0.00000114, 0.00000000],
++		[-6.27302892, -0.00047606, 0.00029167, 0.00047847, -0.00000114, 0.00000000],
++		[-6.27302909, -0.00047599, 0.00029163, 0.00047840, -0.00000114, 0.00000000],
++		[-6.27302927, -0.00047592, 0.00029158, 0.00047832, -0.00000114, 0.00000000],
++		[-6.27302944, -0.00047584, 0.00029154, 0.00047825, -0.00000114, 0.00000000],
++		[-6.27302962, -0.00047577, 0.00029150, 0.00047818, -0.00000114, 0.00000000],
++		[-6.27302979, -0.00047570, 0.00029145, 0.00047810, -0.00000114, 0.00000000],
++		[-6.27302997, -0.00047562, 0.00029141, 0.00047803, -0.00000114, 0.00000000],
++		[-6.27303014, -0.00047555, 0.00029136, 0.00047796, -0.00000114, 0.00000000],
++		[-6.27303032, -0.00047548, 0.00029132, 0.00047788, -0.00000114, 0.00000000],
++		[-6.27303049, -0.00047541, 0.00029127, 0.00047781, -0.00000114, 0.00000000],
++		[-6.27303067, -0.00047533, 0.00029123, 0.00047774, -0.00000114, 0.00000000],
++		[-6.27303084, -0.00047526, 0.00029118, 0.00047766, -0.00000114, 0.00000000],
++		[-6.27303102, -0.00047519, 0.00029114, 0.00047759, -0.00000114, 0.00000000],
++		[-6.27303119, -0.00047511, 0.00029109, 0.00047752, -0.00000114, 0.00000000],
++		[-6.27303137, -0.00047504, 0.00029105, 0.00047744, -0.00000114, 0.00000000],
++		[-6.27303154, -0.00047497, 0.00029100, 0.00047737, -0.00000114, 0.00000000],
++		[-6.27303171, -0.00047490, 0.00029096, 0.00047730, -0.00000114, 0.00000000],
++		[-6.27303189, -0.00047482, 0.00029091, 0.00047722, -0.00000114, 0.00000000],
++		[-6.27303206, -0.00047475, 0.00029087, 0.00047715, -0.00000114, 0.00000000],
++		[-6.27303224, -0.00047468, 0.00029082, 0.00047708, -0.00000114, 0.00000000],
++		[-6.27303241, -0.00047460, 0.00029078, 0.00047700, -0.00000114, 0.00000000],
++		[-6.27303259, -0.00047453, 0.00029073, 0.00047693, -0.00000114, 0.00000000],
++		[-6.27303276, -0.00047446, 0.00029069, 0.00047686, -0.00000114, 0.00000000],
++		[-6.27303293, -0.00047439, 0.00029065, 0.00047678, -0.00000114, 0.00000000],
++		[-6.27303311, -0.00047431, 0.00029060, 0.00047671, -0.00000114, 0.00000000],
++		[-6.27303328, -0.00047424, 0.00029056, 0.00047664, -0.00000114, 0.00000000],
++		[-6.27303345, -0.00047417, 0.00029051, 0.00047657, -0.00000114, 0.00000000],
++		[-6.27303363, -0.00047410, 0.00029047, 0.00047649, -0.00000114, 0.00000000],
++		[-6.27303380, -0.00047402, 0.00029042, 0.00047642, -0.00000114, 0.00000000],
++		[-6.27303398, -0.00047395, 0.00029038, 0.00047635, -0.00000114, 0.00000000],
++		[-6.27303415, -0.00047388, 0.00029033, 0.00047627, -0.00000114, 0.00000000],
++		[-6.27303432, -0.00047380, 0.00029029, 0.00047620, -0.00000114, 0.00000000],
++		[-6.27303450, -0.00047373, 0.00029025, 0.00047613, -0.00000114, 0.00000000],
++		[-6.27303467, -0.00047366, 0.00029020, 0.00047606, -0.00000114, 0.00000000],
++		[-6.27303484, -0.00047359, 0.00029016, 0.00047598, -0.00000114, 0.00000000],
++		[-6.27303502, -0.00047351, 0.00029011, 0.00047591, -0.00000114, 0.00000000],
++		[-6.27303519, -0.00047344, 0.00029007, 0.00047584, -0.00000114, 0.00000000],
++		[-6.27303536, -0.00047337, 0.00029002, 0.00047576, -0.00000114, 0.00000000],
++		[-6.27303554, -0.00047330, 0.00028998, 0.00047569, -0.00000114, 0.00000000],
++		[-6.27303571, -0.00047323, 0.00028993, 0.00047562, -0.00000114, 0.00000000],
++		[-6.27303588, -0.00047315, 0.00028989, 0.00047555, -0.00000114, 0.00000000],
++		[-6.27303606, -0.00047308, 0.00028985, 0.00047547, -0.00000114, 0.00000000],
++		[-6.27303623, -0.00047301, 0.00028980, 0.00047540, -0.00000114, 0.00000000],
++		[-6.27303640, -0.00047294, 0.00028976, 0.00047533, -0.00000114, 0.00000000],
++		[-6.27303658, -0.00047286, 0.00028971, 0.00047526, -0.00000114, 0.00000000],
++		[-6.27303675, -0.00047279, 0.00028967, 0.00047518, -0.00000114, 0.00000000],
++		[-6.27303692, -0.00047272, 0.00028962, 0.00047511, -0.00000114, 0.00000000],
++		[-6.27303709, -0.00047265, 0.00028958, 0.00047504, -0.00000114, 0.00000000],
++		[-6.27303727, -0.00047258, 0.00028954, 0.00047497, -0.00000114, 0.00000000],
++		[-6.27303744, -0.00047250, 0.00028949, 0.00047489, -0.00000114, 0.00000000],
++		[-6.27303761, -0.00047243, 0.00028945, 0.00047482, -0.00000114, 0.00000000],
++		[-6.27303778, -0.00047236, 0.00028940, 0.00047475, -0.00000114, 0.00000000],
++		[-6.27303796, -0.00047229, 0.00028936, 0.00047468, -0.00000114, 0.00000000],
++		[-6.27303813, -0.00047221, 0.00028931, 0.00047460, -0.00000114, 0.00000000],
++		[-6.27303830, -0.00047214, 0.00028927, 0.00047453, -0.00000114, 0.00000000],
++		[-6.27303847, -0.00047207, 0.00028923, 0.00047446, -0.00000114, 0.00000000],
++		[-6.27303865, -0.00047200, 0.00028918, 0.00047439, -0.00000114, 0.00000000],
++		[-6.27303882, -0.00047193, 0.00028914, 0.00047431, -0.00000114, 0.00000000],
++		[-6.27303899, -0.00047185, 0.00028909, 0.00047424, -0.00000114, 0.00000000],
++		[-6.27303916, -0.00047178, 0.00028905, 0.00047417, -0.00000114, 0.00000000],
++		[-6.27303933, -0.00047171, 0.00028901, 0.00047410, -0.00000114, 0.00000000],
++		[-6.27303951, -0.00047164, 0.00028896, 0.00047402, -0.00000114, 0.00000000],
++		[-6.27303968, -0.00047157, 0.00028892, 0.00047395, -0.00000114, 0.00000000],
++		[-6.27303985, -0.00047150, 0.00028887, 0.00047388, -0.00000114, 0.00000000],
++		[-6.27304002, -0.00047142, 0.00028883, 0.00047381, -0.00000114, 0.00000000],
++		[-6.27304019, -0.00047135, 0.00028879, 0.00047374, -0.00000114, 0.00000000],
++		[-6.27304037, -0.00047128, 0.00028874, 0.00047366, -0.00000114, 0.00000000],
++		[-6.27304054, -0.00047121, 0.00028870, 0.00047359, -0.00000114, 0.00000000],
++		[-6.27304071, -0.00047114, 0.00028865, 0.00047352, -0.00000114, 0.00000000],
++		[-6.27304088, -0.00047106, 0.00028861, 0.00047345, -0.00000114, 0.00000000],
++		[-6.27304105, -0.00047099, 0.00028857, 0.00047337, -0.00000114, 0.00000000],
++		[-6.27304122, -0.00047092, 0.00028852, 0.00047330, -0.00000114, 0.00000000],
++		[-6.27304139, -0.00047085, 0.00028848, 0.00047323, -0.00000114, 0.00000000],
++		[-6.27304157, -0.00047078, 0.00028843, 0.00047316, -0.00000114, 0.00000000],
++		[-6.27304174, -0.00047071, 0.00028839, 0.00047309, -0.00000114, 0.00000000],
++		[-6.27304191, -0.00047064, 0.00028835, 0.00047302, -0.00000114, 0.00000000],
++		[-6.27304208, -0.00047056, 0.00028830, 0.00047294, -0.00000114, 0.00000000],
++		[-6.27304225, -0.00047049, 0.00028826, 0.00047287, -0.00000114, 0.00000000],
++		[-6.27304242, -0.00047042, 0.00028822, 0.00047280, -0.00000114, 0.00000000],
++		[-6.27304259, -0.00047035, 0.00028817, 0.00047273, -0.00000114, 0.00000000],
++		[-6.27304276, -0.00047028, 0.00028813, 0.00047266, -0.00000114, 0.00000000],
++		[-6.27304294, -0.00047021, 0.00028808, 0.00047258, -0.00000114, 0.00000000],
++		[-6.27304311, -0.00047013, 0.00028804, 0.00047251, -0.00000114, 0.00000000],
++		[-6.27304328, -0.00047006, 0.00028800, 0.00047244, -0.00000114, 0.00000000],
++		[-6.27304345, -0.00046999, 0.00028795, 0.00047237, -0.00000114, 0.00000000],
++		[-6.27304362, -0.00046992, 0.00028791, 0.00047230, -0.00000114, 0.00000000],
++		[-6.27304379, -0.00046985, 0.00028787, 0.00047223, -0.00000114, 0.00000000],
++		[-6.27304396, -0.00046978, 0.00028782, 0.00047215, -0.00000114, 0.00000000],
++		[-6.27304413, -0.00046971, 0.00028778, 0.00047208, -0.00000114, 0.00000000],
++		[-6.27304430, -0.00046964, 0.00028773, 0.00047201, -0.00000114, 0.00000000],
++		[-6.27304447, -0.00046956, 0.00028769, 0.00047194, -0.00000114, 0.00000000],
++		[-6.27304464, -0.00046949, 0.00028765, 0.00047187, -0.00000114, 0.00000000],
++		[-6.27304481, -0.00046942, 0.00028760, 0.00047180, -0.00000114, 0.00000000],
++		[-6.27304498, -0.00046935, 0.00028756, 0.00047172, -0.00000114, 0.00000000],
++		[-6.27304515, -0.00046928, 0.00028752, 0.00047165, -0.00000114, 0.00000000],
++		[-6.27304532, -0.00046921, 0.00028747, 0.00047158, -0.00000114, 0.00000000],
++		[-6.27304549, -0.00046914, 0.00028743, 0.00047151, -0.00000114, 0.00000000],
++		[-6.27304566, -0.00046907, 0.00028738, 0.00047144, -0.00000114, 0.00000000],
++		[-6.27304583, -0.00046900, 0.00028734, 0.00047137, -0.00000114, 0.00000000],
++		[-6.27304600, -0.00046892, 0.00028730, 0.00047130, -0.00000114, 0.00000000],
++		[-6.27304617, -0.00046885, 0.00028725, 0.00047122, -0.00000114, 0.00000000],
++		[-6.27304634, -0.00046878, 0.00028721, 0.00047115, -0.00000114, 0.00000000],
++		[-6.27304651, -0.00046871, 0.00028717, 0.00047108, -0.00000114, 0.00000000],
++		[-6.27304668, -0.00046864, 0.00028712, 0.00047101, -0.00000114, 0.00000000],
++		[-6.27304685, -0.00046857, 0.00028708, 0.00047094, -0.00000114, 0.00000000],
++		[-6.27304702, -0.00046850, 0.00028704, 0.00047087, -0.00000114, 0.00000000],
++		[-6.27304719, -0.00046843, 0.00028699, 0.00047080, -0.00000114, 0.00000000],
++		[-6.27304736, -0.00046836, 0.00028695, 0.00047072, -0.00000114, 0.00000000],
++		[-6.27304753, -0.00046829, 0.00028691, 0.00047065, -0.00000114, 0.00000000],
++		[-6.27304770, -0.00046821, 0.00028686, 0.00047058, -0.00000114, 0.00000000],
++		[-6.27304787, -0.00046814, 0.00028682, 0.00047051, -0.00000114, 0.00000000],
++		[-6.27304804, -0.00046807, 0.00028678, 0.00047044, -0.00000114, 0.00000000],
++		[-6.27304821, -0.00046800, 0.00028673, 0.00047037, -0.00000114, 0.00000000],
++		[-6.27304838, -0.00046793, 0.00028669, 0.00047030, -0.00000114, 0.00000000],
++		[-6.27304855, -0.00046786, 0.00028665, 0.00047023, -0.00000114, 0.00000000],
++		[-6.27304872, -0.00046779, 0.00028660, 0.00047016, -0.00000114, 0.00000000],
++		[-6.27304889, -0.00046772, 0.00028656, 0.00047008, -0.00000114, 0.00000000],
++		[-6.27304906, -0.00046765, 0.00028652, 0.00047001, -0.00000114, 0.00000000],
++		[-6.27304922, -0.00046758, 0.00028647, 0.00046994, -0.00000114, 0.00000000],
++		[-6.27304939, -0.00046751, 0.00028643, 0.00046987, -0.00000114, 0.00000000],
++		[-6.27304956, -0.00046744, 0.00028639, 0.00046980, -0.00000114, 0.00000000],
++		[-6.27304973, -0.00046737, 0.00028634, 0.00046973, -0.00000114, 0.00000000],
++		[-6.27304990, -0.00046730, 0.00028630, 0.00046966, -0.00000114, 0.00000000],
++		[-6.27305007, -0.00046723, 0.00028626, 0.00046959, -0.00000114, 0.00000000],
++		[-6.27305024, -0.00046715, 0.00028621, 0.00046952, -0.00000114, 0.00000000],
++		[-6.27305041, -0.00046708, 0.00028617, 0.00046945, -0.00000114, 0.00000000],
++		[-6.27305057, -0.00046701, 0.00028613, 0.00046938, -0.00000114, 0.00000000],
++		[-6.27305074, -0.00046694, 0.00028608, 0.00046930, -0.00000114, 0.00000000],
++		[-6.27305091, -0.00046687, 0.00028604, 0.00046923, -0.00000114, 0.00000000],
++		[-6.27305108, -0.00046680, 0.00028600, 0.00046916, -0.00000114, 0.00000000],
++		[-6.27305125, -0.00046673, 0.00028595, 0.00046909, -0.00000114, 0.00000000],
++		[-6.27305142, -0.00046666, 0.00028591, 0.00046902, -0.00000114, 0.00000000],
++		[-6.27305159, -0.00046659, 0.00028587, 0.00046895, -0.00000114, 0.00000000],
++		[-6.27305175, -0.00046652, 0.00028582, 0.00046888, -0.00000114, 0.00000000],
++		[-6.27305192, -0.00046645, 0.00028578, 0.00046881, -0.00000114, 0.00000000],
++		[-6.27305209, -0.00046638, 0.00028574, 0.00046874, -0.00000114, 0.00000000],
++		[-6.27305226, -0.00046631, 0.00028570, 0.00046867, -0.00000114, 0.00000000],
++		[-6.27305243, -0.00046624, 0.00028565, 0.00046860, -0.00000114, 0.00000000],
++		[-6.27305259, -0.00046617, 0.00028561, 0.00046853, -0.00000114, 0.00000000],
++		[-6.27305276, -0.00046610, 0.00028557, 0.00046846, -0.00000114, 0.00000000],
++		[-6.27305293, -0.00046603, 0.00028552, 0.00046839, -0.00000114, 0.00000000],
++		[-6.27305310, -0.00046596, 0.00028548, 0.00046832, -0.00000114, 0.00000000],
++		[-6.27305327, -0.00046589, 0.00028544, 0.00046824, -0.00000114, 0.00000000],
++		[-6.27305343, -0.00046582, 0.00028539, 0.00046817, -0.00000114, 0.00000000],
++		[-6.27305360, -0.00046575, 0.00028535, 0.00046810, -0.00000114, 0.00000000],
++		[-6.27305377, -0.00046568, 0.00028531, 0.00046803, -0.00000114, 0.00000000],
++		[-6.27305394, -0.00046561, 0.00028527, 0.00046796, -0.00000114, 0.00000000],
++		[-6.27305410, -0.00046554, 0.00028522, 0.00046789, -0.00000114, 0.00000000],
++		[-6.27305427, -0.00046547, 0.00028518, 0.00046782, -0.00000114, 0.00000000],
++		[-6.27305444, -0.00046540, 0.00028514, 0.00046775, -0.00000114, 0.00000000],
++		[-6.27305461, -0.00046533, 0.00028509, 0.00046768, -0.00000114, 0.00000000],
++		[-6.27305477, -0.00046526, 0.00028505, 0.00046761, -0.00000114, 0.00000000],
++		[-6.27305494, -0.00046519, 0.00028501, 0.00046754, -0.00000114, 0.00000000],
++		[-6.27305511, -0.00046512, 0.00028497, 0.00046747, -0.00000114, 0.00000000],
++		[-6.27305528, -0.00046505, 0.00028492, 0.00046740, -0.00000114, 0.00000000],
++		[-6.27305544, -0.00046498, 0.00028488, 0.00046733, -0.00000114, 0.00000000],
++		[-6.27305561, -0.00046491, 0.00028484, 0.00046726, -0.00000114, 0.00000000],
++		[-6.27305578, -0.00046484, 0.00028479, 0.00046719, -0.00000114, 0.00000000],
++		[-6.27305594, -0.00046477, 0.00028475, 0.00046712, -0.00000114, 0.00000000],
++		[-6.27305611, -0.00046470, 0.00028471, 0.00046705, -0.00000114, 0.00000000],
++		[-6.27305628, -0.00046463, 0.00028467, 0.00046698, -0.00000114, 0.00000000],
++		[-6.27305645, -0.00046456, 0.00028462, 0.00046691, -0.00000114, 0.00000000],
++		[-6.27305661, -0.00046449, 0.00028458, 0.00046684, -0.00000114, 0.00000000],
++		[-6.27305678, -0.00046442, 0.00028454, 0.00046677, -0.00000114, 0.00000000],
++		[-6.27305695, -0.00046435, 0.00028449, 0.00046670, -0.00000114, 0.00000000],
++		[-6.27305711, -0.00046428, 0.00028445, 0.00046663, -0.00000114, 0.00000000],
++		[-6.27305728, -0.00046421, 0.00028441, 0.00046656, -0.00000114, 0.00000000],
++		[-6.27305745, -0.00046414, 0.00028437, 0.00046649, -0.00000114, 0.00000000],
++		[-6.27305761, -0.00046407, 0.00028432, 0.00046642, -0.00000114, 0.00000000],
++		[-6.27305778, -0.00046400, 0.00028428, 0.00046635, -0.00000114, 0.00000000],
++		[-6.27305795, -0.00046393, 0.00028424, 0.00046628, -0.00000114, 0.00000000],
++		[-6.27305811, -0.00046386, 0.00028420, 0.00046621, -0.00000114, 0.00000000],
++		[-6.27305828, -0.00046380, 0.00028415, 0.00046614, -0.00000114, 0.00000000],
++		[-6.27305844, -0.00046373, 0.00028411, 0.00046607, -0.00000114, 0.00000000],
++		[-6.27305861, -0.00046366, 0.00028407, 0.00046600, -0.00000114, 0.00000000],
++		[-6.27305878, -0.00046359, 0.00028403, 0.00046593, -0.00000114, 0.00000000],
++		[-6.27305894, -0.00046352, 0.00028398, 0.00046586, -0.00000114, 0.00000000],
++		[-6.27305911, -0.00046345, 0.00028394, 0.00046579, -0.00000114, 0.00000000],
++		[-6.27305927, -0.00046338, 0.00028390, 0.00046572, -0.00000114, 0.00000000],
++		[-6.27305944, -0.00046331, 0.00028386, 0.00046565, -0.00000114, 0.00000000],
++		[-6.27305961, -0.00046324, 0.00028381, 0.00046558, -0.00000114, 0.00000000],
++		[-6.27305977, -0.00046317, 0.00028377, 0.00046551, -0.00000114, 0.00000000],
++		[-6.27305994, -0.00046310, 0.00028373, 0.00046544, -0.00000114, 0.00000000],
++		[-6.27306010, -0.00046303, 0.00028369, 0.00046537, -0.00000114, 0.00000000],
++		[-6.27306027, -0.00046296, 0.00028364, 0.00046530, -0.00000114, 0.00000000],
++		[-6.27306044, -0.00046289, 0.00028360, 0.00046523, -0.00000114, 0.00000000],
++		[-6.27306060, -0.00046282, 0.00028356, 0.00046516, -0.00000114, 0.00000000],
++		[-6.27306077, -0.00046276, 0.00028352, 0.00046509, -0.00000114, 0.00000000],
++		[-6.27306093, -0.00046269, 0.00028347, 0.00046502, -0.00000114, 0.00000000],
++		[-6.27306110, -0.00046262, 0.00028343, 0.00046496, -0.00000114, 0.00000000],
++		[-6.27306126, -0.00046255, 0.00028339, 0.00046489, -0.00000114, 0.00000000],
++		[-6.27306143, -0.00046248, 0.00028335, 0.00046482, -0.00000114, 0.00000000],
++		[-6.27306159, -0.00046241, 0.00028330, 0.00046475, -0.00000114, 0.00000000],
++		[-6.27306176, -0.00046234, 0.00028326, 0.00046468, -0.00000114, 0.00000000],
++		[-6.27306192, -0.00046227, 0.00028322, 0.00046461, -0.00000114, 0.00000000],
++		[-6.27306209, -0.00046220, 0.00028318, 0.00046454, -0.00000114, 0.00000000],
++		[-6.27306225, -0.00046213, 0.00028314, 0.00046447, -0.00000114, 0.00000000],
++		[-6.27306242, -0.00046206, 0.00028309, 0.00046440, -0.00000114, 0.00000000],
++		[-6.27306259, -0.00046200, 0.00028305, 0.00046433, -0.00000114, 0.00000000],
++		[-6.27306275, -0.00046193, 0.00028301, 0.00046426, -0.00000114, 0.00000000],
++		[-6.27306292, -0.00046186, 0.00028297, 0.00046419, -0.00000114, 0.00000000],
++		[-6.27306308, -0.00046179, 0.00028292, 0.00046412, -0.00000114, 0.00000000],
++		[-6.27306324, -0.00046172, 0.00028288, 0.00046405, -0.00000114, 0.00000000],
++		[-6.27306341, -0.00046165, 0.00028284, 0.00046398, -0.00000114, 0.00000000],
++		[-6.27306357, -0.00046158, 0.00028280, 0.00046392, -0.00000114, 0.00000000],
++		[-6.27306374, -0.00046151, 0.00028275, 0.00046385, -0.00000114, 0.00000000],
++		[-6.27306390, -0.00046144, 0.00028271, 0.00046378, -0.00000114, 0.00000000],
++		[-6.27306407, -0.00046138, 0.00028267, 0.00046371, -0.00000114, 0.00000000],
++		[-6.27306423, -0.00046131, 0.00028263, 0.00046364, -0.00000114, 0.00000000],
++		[-6.27306440, -0.00046124, 0.00028259, 0.00046357, -0.00000114, 0.00000000],
++		[-6.27306456, -0.00046117, 0.00028254, 0.00046350, -0.00000114, 0.00000000],
++		[-6.27306473, -0.00046110, 0.00028250, 0.00046343, -0.00000114, 0.00000000],
++		[-6.27306489, -0.00046103, 0.00028246, 0.00046336, -0.00000114, 0.00000000],
++		[-6.27306505, -0.00046096, 0.00028242, 0.00046329, -0.00000114, 0.00000000],
++		[-6.27306522, -0.00046090, 0.00028238, 0.00046322, -0.00000114, 0.00000000],
++		[-6.27306538, -0.00046083, 0.00028233, 0.00046316, -0.00000114, 0.00000000],
++		[-6.27306555, -0.00046076, 0.00028229, 0.00046309, -0.00000114, 0.00000000],
++		[-6.27306571, -0.00046069, 0.00028225, 0.00046302, -0.00000114, 0.00000000],
++		[-6.27306588, -0.00046062, 0.00028221, 0.00046295, -0.00000114, 0.00000000],
++		[-6.27306604, -0.00046055, 0.00028217, 0.00046288, -0.00000114, 0.00000000],
++		[-6.27306620, -0.00046048, 0.00028212, 0.00046281, -0.00000114, 0.00000000],
++		[-6.27306637, -0.00046042, 0.00028208, 0.00046274, -0.00000114, 0.00000000],
++		[-6.27306653, -0.00046035, 0.00028204, 0.00046267, -0.00000114, 0.00000000],
++		[-6.27306670, -0.00046028, 0.00028200, 0.00046260, -0.00000114, 0.00000000],
++		[-6.27306686, -0.00046021, 0.00028196, 0.00046254, -0.00000114, 0.00000000],
++		[-6.27306702, -0.00046014, 0.00028191, 0.00046247, -0.00000114, 0.00000000],
++		[-6.27306719, -0.00046007, 0.00028187, 0.00046240, -0.00000114, 0.00000000],
++		[-6.27306735, -0.00046000, 0.00028183, 0.00046233, -0.00000114, 0.00000000],
++		[-6.27306751, -0.00045994, 0.00028179, 0.00046226, -0.00000114, 0.00000000],
++		[-6.27306768, -0.00045987, 0.00028175, 0.00046219, -0.00000114, 0.00000000],
++		[-6.27306784, -0.00045980, 0.00028170, 0.00046212, -0.00000114, 0.00000000],
++		[-6.27306800, -0.00045973, 0.00028166, 0.00046205, -0.00000114, 0.00000000],
++		[-6.27306817, -0.00045966, 0.00028162, 0.00046199, -0.00000114, 0.00000000],
++		[-6.27306833, -0.00045959, 0.00028158, 0.00046192, -0.00000114, 0.00000000],
++		[-6.27306849, -0.00045953, 0.00028154, 0.00046185, -0.00000114, 0.00000000],
++		[-6.27306866, -0.00045946, 0.00028150, 0.00046178, -0.00000114, 0.00000000],
++		[-6.27306882, -0.00045939, 0.00028145, 0.00046171, -0.00000114, 0.00000000],
++		[-6.27306898, -0.00045932, 0.00028141, 0.00046164, -0.00000114, 0.00000000],
++		[-6.27306915, -0.00045925, 0.00028137, 0.00046158, -0.00000114, 0.00000000],
++		[-6.27306931, -0.00045919, 0.00028133, 0.00046151, -0.00000114, 0.00000000],
++		[-6.27306947, -0.00045912, 0.00028129, 0.00046144, -0.00000114, 0.00000000],
++		[-6.27306964, -0.00045905, 0.00028124, 0.00046137, -0.00000114, 0.00000000],
++		[-6.27306980, -0.00045898, 0.00028120, 0.00046130, -0.00000114, 0.00000000],
++		[-6.27306996, -0.00045891, 0.00028116, 0.00046123, -0.00000114, 0.00000000],
++		[-6.27307012, -0.00045885, 0.00028112, 0.00046116, -0.00000114, 0.00000000],
++		[-6.27307029, -0.00045878, 0.00028108, 0.00046110, -0.00000114, 0.00000000],
++		[-6.27307045, -0.00045871, 0.00028104, 0.00046103, -0.00000114, 0.00000000],
++		[-6.27307061, -0.00045864, 0.00028099, 0.00046096, -0.00000114, 0.00000000],
++		[-6.27307078, -0.00045857, 0.00028095, 0.00046089, -0.00000114, 0.00000000],
++		[-6.27307094, -0.00045851, 0.00028091, 0.00046082, -0.00000114, 0.00000000],
++		[-6.27307110, -0.00045844, 0.00028087, 0.00046075, -0.00000114, 0.00000000],
++		[-6.27307126, -0.00045837, 0.00028083, 0.00046069, -0.00000114, 0.00000000],
++		[-6.27307142, -0.00045830, 0.00028079, 0.00046062, -0.00000114, 0.00000000],
++		[-6.27307159, -0.00045823, 0.00028074, 0.00046055, -0.00000114, 0.00000000],
++		[-6.27307175, -0.00045817, 0.00028070, 0.00046048, -0.00000114, 0.00000000],
++		[-6.27307191, -0.00045810, 0.00028066, 0.00046041, -0.00000114, 0.00000000],
++		[-6.27307207, -0.00045803, 0.00028062, 0.00046035, -0.00000114, 0.00000000],
++		[-6.27307224, -0.00045796, 0.00028058, 0.00046028, -0.00000114, 0.00000000],
++		[-6.27307240, -0.00045790, 0.00028054, 0.00046021, -0.00000114, 0.00000000],
++		[-6.27307256, -0.00045783, 0.00028050, 0.00046014, -0.00000114, 0.00000000],
++		[-6.27307272, -0.00045776, 0.00028045, 0.00046007, -0.00000114, 0.00000000],
++		[-6.27307288, -0.00045769, 0.00028041, 0.00046001, -0.00000114, 0.00000000],
++		[-6.27307305, -0.00045762, 0.00028037, 0.00045994, -0.00000114, 0.00000000],
++		[-6.27307321, -0.00045756, 0.00028033, 0.00045987, -0.00000114, 0.00000000],
++		[-6.27307337, -0.00045749, 0.00028029, 0.00045980, -0.00000114, 0.00000000],
++		[-6.27307353, -0.00045742, 0.00028025, 0.00045973, -0.00000114, 0.00000000],
++		[-6.27307369, -0.00045735, 0.00028021, 0.00045967, -0.00000114, 0.00000000],
++		[-6.27307386, -0.00045729, 0.00028016, 0.00045960, -0.00000114, 0.00000000],
++		[-6.27307402, -0.00045722, 0.00028012, 0.00045953, -0.00000114, 0.00000000],
++		[-6.27307418, -0.00045715, 0.00028008, 0.00045946, -0.00000114, 0.00000000],
++		[-6.27307434, -0.00045708, 0.00028004, 0.00045939, -0.00000114, 0.00000000],
++		[-6.27307450, -0.00045702, 0.00028000, 0.00045933, -0.00000114, 0.00000000],
++		[-6.27307466, -0.00045695, 0.00027996, 0.00045926, -0.00000114, 0.00000000],
++		[-6.27307482, -0.00045688, 0.00027992, 0.00045919, -0.00000114, 0.00000000],
++		[-6.27307499, -0.00045681, 0.00027987, 0.00045912, -0.00000114, 0.00000000],
++		[-6.27307515, -0.00045675, 0.00027983, 0.00045905, -0.00000114, 0.00000000],
++		[-6.27307531, -0.00045668, 0.00027979, 0.00045899, -0.00000114, 0.00000000],
++		[-6.27307547, -0.00045661, 0.00027975, 0.00045892, -0.00000114, 0.00000000],
++		[-6.27307563, -0.00045654, 0.00027971, 0.00045885, -0.00000114, 0.00000000],
++		[-6.27307579, -0.00045648, 0.00027967, 0.00045878, -0.00000114, 0.00000000],
++		[-6.27307595, -0.00045641, 0.00027963, 0.00045872, -0.00000114, 0.00000000],
++		[-6.27307611, -0.00045634, 0.00027959, 0.00045865, -0.00000114, 0.00000000],
++		[-6.27307628, -0.00045628, 0.00027954, 0.00045858, -0.00000114, 0.00000000],
++		[-6.27307644, -0.00045621, 0.00027950, 0.00045851, -0.00000114, 0.00000000],
++		[-6.27307660, -0.00045614, 0.00027946, 0.00045845, -0.00000114, 0.00000000],
++		[-6.27307676, -0.00045607, 0.00027942, 0.00045838, -0.00000114, 0.00000000],
++		[-6.27307692, -0.00045601, 0.00027938, 0.00045831, -0.00000114, 0.00000000],
++		[-6.27307708, -0.00045594, 0.00027934, 0.00045824, -0.00000114, 0.00000000],
++		[-6.27307724, -0.00045587, 0.00027930, 0.00045818, -0.00000114, 0.00000000],
++		[-6.27307740, -0.00045581, 0.00027926, 0.00045811, -0.00000114, 0.00000000],
++		[-6.27307756, -0.00045574, 0.00027921, 0.00045804, -0.00000114, 0.00000000],
++		[-6.27307772, -0.00045567, 0.00027917, 0.00045797, -0.00000114, 0.00000000],
++		[-6.27307788, -0.00045560, 0.00027913, 0.00045791, -0.00000114, 0.00000000],
++		[-6.27307804, -0.00045554, 0.00027909, 0.00045784, -0.00000114, 0.00000000],
++		[-6.27307820, -0.00045547, 0.00027905, 0.00045777, -0.00000114, 0.00000000],
++		[-6.27307836, -0.00045540, 0.00027901, 0.00045770, -0.00000114, 0.00000000],
++		[-6.27307852, -0.00045534, 0.00027897, 0.00045764, -0.00000114, 0.00000000],
++		[-6.27307868, -0.00045527, 0.00027893, 0.00045757, -0.00000114, 0.00000000],
++		[-6.27307884, -0.00045520, 0.00027889, 0.00045750, -0.00000114, 0.00000000],
++		[-6.27307900, -0.00045514, 0.00027884, 0.00045743, -0.00000114, 0.00000000],
++		[-6.27307916, -0.00045507, 0.00027880, 0.00045737, -0.00000114, 0.00000000],
++		[-6.27307932, -0.00045500, 0.00027876, 0.00045730, -0.00000114, 0.00000000],
++		[-6.27307949, -0.00045493, 0.00027872, 0.00045723, -0.00000114, 0.00000000],
++		[-6.27307964, -0.00045487, 0.00027868, 0.00045717, -0.00000114, 0.00000000],
++		[-6.27307980, -0.00045480, 0.00027864, 0.00045710, -0.00000114, 0.00000000],
++		[-6.27307996, -0.00045473, 0.00027860, 0.00045703, -0.00000114, 0.00000000],
++		[-6.27308012, -0.00045467, 0.00027856, 0.00045696, -0.00000114, 0.00000000],
++		[-6.27308028, -0.00045460, 0.00027852, 0.00045690, -0.00000114, 0.00000000],
++		[-6.27308044, -0.00045453, 0.00027848, 0.00045683, -0.00000114, 0.00000000],
++		[-6.27308060, -0.00045447, 0.00027844, 0.00045676, -0.00000114, 0.00000000],
++		[-6.27308076, -0.00045440, 0.00027839, 0.00045670, -0.00000114, 0.00000000],
++		[-6.27308092, -0.00045433, 0.00027835, 0.00045663, -0.00000114, 0.00000000],
++		[-6.27308108, -0.00045427, 0.00027831, 0.00045656, -0.00000114, 0.00000000],
++		[-6.27308124, -0.00045420, 0.00027827, 0.00045650, -0.00000114, 0.00000000],
++		[-6.27308140, -0.00045413, 0.00027823, 0.00045643, -0.00000114, 0.00000000],
++		[-6.27308156, -0.00045407, 0.00027819, 0.00045636, -0.00000114, 0.00000000],
++		[-6.27308172, -0.00045400, 0.00027815, 0.00045629, -0.00000114, 0.00000000],
++		[-6.27308188, -0.00045393, 0.00027811, 0.00045623, -0.00000114, 0.00000000],
++		[-6.27308204, -0.00045387, 0.00027807, 0.00045616, -0.00000114, 0.00000000],
++		[-6.27308220, -0.00045380, 0.00027803, 0.00045609, -0.00000114, 0.00000000],
++		[-6.27308236, -0.00045373, 0.00027799, 0.00045603, -0.00000114, 0.00000000],
++		[-6.27308252, -0.00045367, 0.00027795, 0.00045596, -0.00000114, 0.00000000],
++		[-6.27308268, -0.00045360, 0.00027790, 0.00045589, -0.00000114, 0.00000000],
++		[-6.27308284, -0.00045353, 0.00027786, 0.00045583, -0.00000114, 0.00000000],
++		[-6.27308299, -0.00045347, 0.00027782, 0.00045576, -0.00000114, 0.00000000],
++		[-6.27308315, -0.00045340, 0.00027778, 0.00045569, -0.00000114, 0.00000000],
++		[-6.27308331, -0.00045334, 0.00027774, 0.00045563, -0.00000114, 0.00000000],
++		[-6.27308347, -0.00045327, 0.00027770, 0.00045556, -0.00000114, 0.00000000],
++		[-6.27308363, -0.00045320, 0.00027766, 0.00045549, -0.00000114, 0.00000000],
++		[-6.27308379, -0.00045314, 0.00027762, 0.00045543, -0.00000114, 0.00000000],
++		[-6.27308395, -0.00045307, 0.00027758, 0.00045536, -0.00000114, 0.00000000],
++		[-6.27308411, -0.00045300, 0.00027754, 0.00045529, -0.00000114, 0.00000000],
++		[-6.27308426, -0.00045294, 0.00027750, 0.00045523, -0.00000114, 0.00000000],
++		[-6.27308442, -0.00045287, 0.00027746, 0.00045516, -0.00000114, 0.00000000],
++		[-6.27308458, -0.00045281, 0.00027742, 0.00045509, -0.00000114, 0.00000000],
++		[-6.27308474, -0.00045274, 0.00027738, 0.00045503, -0.00000114, 0.00000000],
++		[-6.27308490, -0.00045267, 0.00027734, 0.00045496, -0.00000114, 0.00000000],
++		[-6.27308506, -0.00045261, 0.00027729, 0.00045489, -0.00000114, 0.00000000],
++		[-6.27308522, -0.00045254, 0.00027725, 0.00045483, -0.00000114, 0.00000000],
++		[-6.27308537, -0.00045247, 0.00027721, 0.00045476, -0.00000114, 0.00000000],
++		[-6.27308553, -0.00045241, 0.00027717, 0.00045469, -0.00000114, 0.00000000],
++		[-6.27308569, -0.00045234, 0.00027713, 0.00045463, -0.00000114, 0.00000000],
++		[-6.27308585, -0.00045228, 0.00027709, 0.00045456, -0.00000114, 0.00000000],
++		[-6.27308601, -0.00045221, 0.00027705, 0.00045449, -0.00000114, 0.00000000],
++		[-6.27308616, -0.00045214, 0.00027701, 0.00045443, -0.00000114, 0.00000000],
++		[-6.27308632, -0.00045208, 0.00027697, 0.00045436, -0.00000114, 0.00000000],
++		[-6.27308648, -0.00045201, 0.00027693, 0.00045430, -0.00000114, 0.00000000],
++		[-6.27308664, -0.00045195, 0.00027689, 0.00045423, -0.00000114, 0.00000000],
++		[-6.27308680, -0.00045188, 0.00027685, 0.00045416, -0.00000114, 0.00000000],
++		[-6.27308695, -0.00045181, 0.00027681, 0.00045410, -0.00000114, 0.00000000],
++		[-6.27308711, -0.00045175, 0.00027677, 0.00045403, -0.00000114, 0.00000000],
++		[-6.27308727, -0.00045168, 0.00027673, 0.00045396, -0.00000114, 0.00000000],
++		[-6.27308743, -0.00045162, 0.00027669, 0.00045390, -0.00000114, 0.00000000],
++		[-6.27308759, -0.00045155, 0.00027665, 0.00045383, -0.00000114, 0.00000000],
++		[-6.27308774, -0.00045148, 0.00027661, 0.00045376, -0.00000114, 0.00000000],
++		[-6.27308790, -0.00045142, 0.00027657, 0.00045370, -0.00000114, 0.00000000],
++		[-6.27308806, -0.00045135, 0.00027653, 0.00045363, -0.00000114, 0.00000000],
++		[-6.27308822, -0.00045129, 0.00027649, 0.00045357, -0.00000114, 0.00000000],
++		[-6.27308837, -0.00045122, 0.00027645, 0.00045350, -0.00000114, 0.00000000],
++		[-6.27308853, -0.00045116, 0.00027641, 0.00045343, -0.00000114, 0.00000000],
++		[-6.27308869, -0.00045109, 0.00027636, 0.00045337, -0.00000114, 0.00000000],
++		[-6.27308884, -0.00045102, 0.00027632, 0.00045330, -0.00000114, 0.00000000],
++		[-6.27308900, -0.00045096, 0.00027628, 0.00045324, -0.00000114, 0.00000000],
++		[-6.27308916, -0.00045089, 0.00027624, 0.00045317, -0.00000114, 0.00000000],
++		[-6.27308932, -0.00045083, 0.00027620, 0.00045310, -0.00000114, 0.00000000],
++		[-6.27308947, -0.00045076, 0.00027616, 0.00045304, -0.00000114, 0.00000000],
++		[-6.27308963, -0.00045070, 0.00027612, 0.00045297, -0.00000114, 0.00000000],
++		[-6.27308979, -0.00045063, 0.00027608, 0.00045291, -0.00000114, 0.00000000],
++		[-6.27308994, -0.00045056, 0.00027604, 0.00045284, -0.00000114, 0.00000000],
++		[-6.27309010, -0.00045050, 0.00027600, 0.00045277, -0.00000114, 0.00000000],
++		[-6.27309026, -0.00045043, 0.00027596, 0.00045271, -0.00000114, 0.00000000],
++		[-6.27309042, -0.00045037, 0.00027592, 0.00045264, -0.00000114, 0.00000000],
++		[-6.27309057, -0.00045030, 0.00027588, 0.00045258, -0.00000114, 0.00000000],
++		[-6.27309073, -0.00045024, 0.00027584, 0.00045251, -0.00000114, 0.00000000],
++		[-6.27309089, -0.00045017, 0.00027580, 0.00045245, -0.00000114, 0.00000000],
++		[-6.27309104, -0.00045011, 0.00027576, 0.00045238, -0.00000114, 0.00000000],
++		[-6.27309120, -0.00045004, 0.00027572, 0.00045231, -0.00000114, 0.00000000],
++		[-6.27309136, -0.00044997, 0.00027568, 0.00045225, -0.00000114, 0.00000000],
++		[-6.27309151, -0.00044991, 0.00027564, 0.00045218, -0.00000114, 0.00000000],
++		[-6.27309167, -0.00044984, 0.00027560, 0.00045212, -0.00000114, 0.00000000],
++		[-6.27309183, -0.00044978, 0.00027556, 0.00045205, -0.00000114, 0.00000000],
++		[-6.27309198, -0.00044971, 0.00027552, 0.00045198, -0.00000114, 0.00000000],
++		[-6.27309214, -0.00044965, 0.00027548, 0.00045192, -0.00000114, 0.00000000],
++		[-6.27309229, -0.00044958, 0.00027544, 0.00045185, -0.00000114, 0.00000000],
++		[-6.27309245, -0.00044952, 0.00027540, 0.00045179, -0.00000114, 0.00000000],
++		[-6.27309261, -0.00044945, 0.00027536, 0.00045172, -0.00000114, 0.00000000],
++		[-6.27309276, -0.00044939, 0.00027532, 0.00045166, -0.00000114, 0.00000000],
++		[-6.27309292, -0.00044932, 0.00027528, 0.00045159, -0.00000114, 0.00000000],
++		[-6.27309307, -0.00044926, 0.00027524, 0.00045153, -0.00000114, 0.00000000],
++		[-6.27309323, -0.00044919, 0.00027520, 0.00045146, -0.00000114, 0.00000000],
++		[-6.27309339, -0.00044913, 0.00027516, 0.00045139, -0.00000114, 0.00000000],
++		[-6.27309354, -0.00044906, 0.00027512, 0.00045133, -0.00000114, 0.00000000],
++		[-6.27309370, -0.00044900, 0.00027508, 0.00045126, -0.00000114, 0.00000000],
++		[-6.27309385, -0.00044893, 0.00027504, 0.00045120, -0.00000114, 0.00000000],
++		[-6.27309401, -0.00044887, 0.00027500, 0.00045113, -0.00000114, 0.00000000],
++		[-6.27309417, -0.00044880, 0.00027496, 0.00045107, -0.00000114, 0.00000000],
++		[-6.27309432, -0.00044874, 0.00027492, 0.00045100, -0.00000114, 0.00000000],
++		[-6.27309448, -0.00044867, 0.00027488, 0.00045094, -0.00000114, 0.00000000],
++		[-6.27309463, -0.00044861, 0.00027484, 0.00045087, -0.00000114, 0.00000000],
++		[-6.27309479, -0.00044854, 0.00027480, 0.00045081, -0.00000114, 0.00000000],
++		[-6.27309494, -0.00044848, 0.00027476, 0.00045074, -0.00000114, 0.00000000],
++		[-6.27309510, -0.00044841, 0.00027472, 0.00045068, -0.00000114, 0.00000000],
++		[-6.27309526, -0.00044835, 0.00027468, 0.00045061, -0.00000114, 0.00000000],
++		[-6.27309541, -0.00044828, 0.00027464, 0.00045054, -0.00000114, 0.00000000],
++		[-6.27309557, -0.00044822, 0.00027460, 0.00045048, -0.00000114, 0.00000000],
++		[-6.27309572, -0.00044815, 0.00027456, 0.00045041, -0.00000114, 0.00000000],
++		[-6.27309588, -0.00044809, 0.00027452, 0.00045035, -0.00000114, 0.00000000],
++		[-6.27309603, -0.00044802, 0.00027448, 0.00045028, -0.00000114, 0.00000000],
++		[-6.27309619, -0.00044796, 0.00027444, 0.00045022, -0.00000114, 0.00000000],
++		[-6.27309634, -0.00044789, 0.00027440, 0.00045015, -0.00000114, 0.00000000],
++		[-6.27309650, -0.00044783, 0.00027436, 0.00045009, -0.00000114, 0.00000000],
++		[-6.27309665, -0.00044776, 0.00027432, 0.00045002, -0.00000114, 0.00000000],
++		[-6.27309681, -0.00044770, 0.00027429, 0.00044996, -0.00000114, 0.00000000],
++		[-6.27309696, -0.00044763, 0.00027425, 0.00044989, -0.00000114, 0.00000000],
++		[-6.27309712, -0.00044757, 0.00027421, 0.00044983, -0.00000114, 0.00000000],
++		[-6.27309727, -0.00044750, 0.00027417, 0.00044976, -0.00000114, 0.00000000],
++		[-6.27309743, -0.00044744, 0.00027413, 0.00044970, -0.00000114, 0.00000000],
++		[-6.27309758, -0.00044737, 0.00027409, 0.00044963, -0.00000114, 0.00000000],
++		[-6.27309774, -0.00044731, 0.00027405, 0.00044957, -0.00000114, 0.00000000],
++		[-6.27309789, -0.00044724, 0.00027401, 0.00044950, -0.00000114, 0.00000000],
++		[-6.27309805, -0.00044718, 0.00027397, 0.00044944, -0.00000114, 0.00000000],
++		[-6.27309820, -0.00044712, 0.00027393, 0.00044937, -0.00000114, 0.00000000],
++		[-6.27309835, -0.00044705, 0.00027389, 0.00044931, -0.00000114, 0.00000000],
++		[-6.27309851, -0.00044699, 0.00027385, 0.00044924, -0.00000114, 0.00000000],
++		[-6.27309866, -0.00044692, 0.00027381, 0.00044918, -0.00000114, 0.00000000],
++		[-6.27309882, -0.00044686, 0.00027377, 0.00044911, -0.00000114, 0.00000000],
++		[-6.27309897, -0.00044679, 0.00027373, 0.00044905, -0.00000114, 0.00000000],
++		[-6.27309913, -0.00044673, 0.00027369, 0.00044898, -0.00000114, 0.00000000],
++		[-6.27309928, -0.00044666, 0.00027365, 0.00044892, -0.00000114, 0.00000000],
++		[-6.27309944, -0.00044660, 0.00027361, 0.00044885, -0.00000114, 0.00000000],
++		[-6.27309959, -0.00044653, 0.00027357, 0.00044879, -0.00000114, 0.00000000],
++		[-6.27309974, -0.00044647, 0.00027353, 0.00044873, -0.00000114, 0.00000000],
++		[-6.27309990, -0.00044641, 0.00027349, 0.00044866, -0.00000114, 0.00000000],
++		[-6.27310005, -0.00044634, 0.00027345, 0.00044860, -0.00000114, 0.00000000],
++		[-6.27310021, -0.00044628, 0.00027341, 0.00044853, -0.00000114, 0.00000000],
++		[-6.27310036, -0.00044621, 0.00027338, 0.00044847, -0.00000114, 0.00000000],
++		[-6.27310051, -0.00044615, 0.00027334, 0.00044840, -0.00000114, 0.00000000],
++		[-6.27310067, -0.00044608, 0.00027330, 0.00044834, -0.00000114, 0.00000000],
++		[-6.27310082, -0.00044602, 0.00027326, 0.00044827, -0.00000114, 0.00000000],
++		[-6.27310097, -0.00044596, 0.00027322, 0.00044821, -0.00000114, 0.00000000],
++		[-6.27310113, -0.00044589, 0.00027318, 0.00044814, -0.00000114, 0.00000000],
++		[-6.27310128, -0.00044583, 0.00027314, 0.00044808, -0.00000114, 0.00000000],
++		[-6.27310144, -0.00044576, 0.00027310, 0.00044801, -0.00000114, 0.00000000],
++		[-6.27310159, -0.00044570, 0.00027306, 0.00044795, -0.00000114, 0.00000000],
++		[-6.27310174, -0.00044563, 0.00027302, 0.00044789, -0.00000114, 0.00000000],
++		[-6.27310190, -0.00044557, 0.00027298, 0.00044782, -0.00000114, 0.00000000],
++		[-6.27310205, -0.00044551, 0.00027294, 0.00044776, -0.00000114, 0.00000000],
++		[-6.27310220, -0.00044544, 0.00027290, 0.00044769, -0.00000114, 0.00000000],
++		[-6.27310236, -0.00044538, 0.00027286, 0.00044763, -0.00000114, 0.00000000],
++		[-6.27310251, -0.00044531, 0.00027282, 0.00044756, -0.00000114, 0.00000000],
++		[-6.27310266, -0.00044525, 0.00027279, 0.00044750, -0.00000114, 0.00000000],
++		[-6.27310282, -0.00044519, 0.00027275, 0.00044743, -0.00000114, 0.00000000],
++		[-6.27310297, -0.00044512, 0.00027271, 0.00044737, -0.00000114, 0.00000000],
++		[-6.27310312, -0.00044506, 0.00027267, 0.00044731, -0.00000114, 0.00000000],
++		[-6.27310328, -0.00044499, 0.00027263, 0.00044724, -0.00000114, 0.00000000],
++		[-6.27310343, -0.00044493, 0.00027259, 0.00044718, -0.00000114, 0.00000000],
++		[-6.27310358, -0.00044487, 0.00027255, 0.00044711, -0.00000114, 0.00000000],
++		[-6.27310374, -0.00044480, 0.00027251, 0.00044705, -0.00000114, 0.00000000],
++		[-6.27310389, -0.00044474, 0.00027247, 0.00044698, -0.00000114, 0.00000000],
++		[-6.27310404, -0.00044467, 0.00027243, 0.00044692, -0.00000114, 0.00000000],
++		[-6.27310419, -0.00044461, 0.00027239, 0.00044686, -0.00000114, 0.00000000],
++		[-6.27310435, -0.00044455, 0.00027235, 0.00044679, -0.00000114, 0.00000000],
++		[-6.27310450, -0.00044448, 0.00027231, 0.00044673, -0.00000114, 0.00000000],
++		[-6.27310465, -0.00044442, 0.00027228, 0.00044666, -0.00000114, 0.00000000],
++		[-6.27310481, -0.00044436, 0.00027224, 0.00044660, -0.00000114, 0.00000000],
++		[-6.27310496, -0.00044429, 0.00027220, 0.00044654, -0.00000114, 0.00000000],
++		[-6.27310511, -0.00044423, 0.00027216, 0.00044647, -0.00000114, 0.00000000],
++		[-6.27310526, -0.00044416, 0.00027212, 0.00044641, -0.00000114, 0.00000000],
++		[-6.27310542, -0.00044410, 0.00027208, 0.00044634, -0.00000114, 0.00000000],
++		[-6.27310557, -0.00044404, 0.00027204, 0.00044628, -0.00000114, 0.00000000],
++		[-6.27310572, -0.00044397, 0.00027200, 0.00044621, -0.00000114, 0.00000000],
++		[-6.27310587, -0.00044391, 0.00027196, 0.00044615, -0.00000114, 0.00000000],
++		[-6.27310603, -0.00044385, 0.00027192, 0.00044609, -0.00000114, 0.00000000],
++		[-6.27310618, -0.00044378, 0.00027189, 0.00044602, -0.00000114, 0.00000000],
++		[-6.27310633, -0.00044372, 0.00027185, 0.00044596, -0.00000114, 0.00000000],
++		[-6.27310648, -0.00044365, 0.00027181, 0.00044590, -0.00000114, 0.00000000],
++		[-6.27310663, -0.00044359, 0.00027177, 0.00044583, -0.00000114, 0.00000000],
++		[-6.27310679, -0.00044353, 0.00027173, 0.00044577, -0.00000114, 0.00000000],
++		[-6.27310694, -0.00044346, 0.00027169, 0.00044570, -0.00000114, 0.00000000],
++		[-6.27310709, -0.00044340, 0.00027165, 0.00044564, -0.00000114, 0.00000000],
++		[-6.27310724, -0.00044334, 0.00027161, 0.00044558, -0.00000114, 0.00000000],
++		[-6.27310739, -0.00044327, 0.00027157, 0.00044551, -0.00000114, 0.00000000],
++		[-6.27310755, -0.00044321, 0.00027153, 0.00044545, -0.00000114, 0.00000000],
++		[-6.27310770, -0.00044315, 0.00027150, 0.00044538, -0.00000114, 0.00000000],
++		[-6.27310785, -0.00044308, 0.00027146, 0.00044532, -0.00000114, 0.00000000],
++		[-6.27310800, -0.00044302, 0.00027142, 0.00044526, -0.00000114, 0.00000000],
++		[-6.27310815, -0.00044296, 0.00027138, 0.00044519, -0.00000114, 0.00000000],
++		[-6.27310831, -0.00044289, 0.00027134, 0.00044513, -0.00000114, 0.00000000],
++		[-6.27310846, -0.00044283, 0.00027130, 0.00044507, -0.00000114, 0.00000000],
++		[-6.27310861, -0.00044277, 0.00027126, 0.00044500, -0.00000114, 0.00000000],
++		[-6.27310876, -0.00044270, 0.00027122, 0.00044494, -0.00000114, 0.00000000],
++		[-6.27310891, -0.00044264, 0.00027119, 0.00044487, -0.00000114, 0.00000000],
++		[-6.27310906, -0.00044258, 0.00027115, 0.00044481, -0.00000114, 0.00000000],
++		[-6.27310921, -0.00044251, 0.00027111, 0.00044475, -0.00000114, 0.00000000],
++		[-6.27310937, -0.00044245, 0.00027107, 0.00044468, -0.00000114, 0.00000000],
++		[-6.27310952, -0.00044239, 0.00027103, 0.00044462, -0.00000114, 0.00000000],
++		[-6.27310967, -0.00044232, 0.00027099, 0.00044456, -0.00000114, 0.00000000],
++		[-6.27310982, -0.00044226, 0.00027095, 0.00044449, -0.00000114, 0.00000000],
++		[-6.27310997, -0.00044220, 0.00027091, 0.00044443, -0.00000114, 0.00000000],
++		[-6.27311012, -0.00044213, 0.00027088, 0.00044437, -0.00000114, 0.00000000],
++		[-6.27311027, -0.00044207, 0.00027084, 0.00044430, -0.00000114, 0.00000000],
++		[-6.27311042, -0.00044201, 0.00027080, 0.00044424, -0.00000114, 0.00000000],
++		[-6.27311058, -0.00044194, 0.00027076, 0.00044418, -0.00000114, 0.00000000],
++		[-6.27311073, -0.00044188, 0.00027072, 0.00044411, -0.00000114, 0.00000000],
++		[-6.27311088, -0.00044182, 0.00027068, 0.00044405, -0.00000114, 0.00000000],
++		[-6.27311103, -0.00044176, 0.00027064, 0.00044399, -0.00000114, 0.00000000],
++		[-6.27311118, -0.00044169, 0.00027060, 0.00044392, -0.00000114, 0.00000000],
++		[-6.27311133, -0.00044163, 0.00027057, 0.00044386, -0.00000114, 0.00000000],
++		[-6.27311148, -0.00044157, 0.00027053, 0.00044380, -0.00000114, 0.00000000],
++		[-6.27311163, -0.00044150, 0.00027049, 0.00044373, -0.00000114, 0.00000000],
++		[-6.27311178, -0.00044144, 0.00027045, 0.00044367, -0.00000114, 0.00000000],
++		[-6.27311193, -0.00044138, 0.00027041, 0.00044361, -0.00000114, 0.00000000],
++		[-6.27311208, -0.00044131, 0.00027037, 0.00044354, -0.00000114, 0.00000000],
++		[-6.27311223, -0.00044125, 0.00027033, 0.00044348, -0.00000114, 0.00000000],
++		[-6.27311238, -0.00044119, 0.00027030, 0.00044342, -0.00000114, 0.00000000],
++		[-6.27311253, -0.00044113, 0.00027026, 0.00044335, -0.00000114, 0.00000000],
++		[-6.27311269, -0.00044106, 0.00027022, 0.00044329, -0.00000114, 0.00000000],
++		[-6.27311284, -0.00044100, 0.00027018, 0.00044323, -0.00000114, 0.00000000],
++		[-6.27311299, -0.00044094, 0.00027014, 0.00044316, -0.00000114, 0.00000000],
++		[-6.27311314, -0.00044087, 0.00027010, 0.00044310, -0.00000114, 0.00000000],
++		[-6.27311329, -0.00044081, 0.00027006, 0.00044304, -0.00000114, 0.00000000],
++		[-6.27311344, -0.00044075, 0.00027003, 0.00044297, -0.00000114, 0.00000000],
++		[-6.27311359, -0.00044069, 0.00026999, 0.00044291, -0.00000114, 0.00000000],
++		[-6.27311374, -0.00044062, 0.00026995, 0.00044285, -0.00000114, 0.00000000],
++		[-6.27311389, -0.00044056, 0.00026991, 0.00044279, -0.00000114, 0.00000000],
++		[-6.27311404, -0.00044050, 0.00026987, 0.00044272, -0.00000114, 0.00000000],
++		[-6.27311419, -0.00044044, 0.00026983, 0.00044266, -0.00000114, 0.00000000],
++		[-6.27311434, -0.00044037, 0.00026980, 0.00044260, -0.00000114, 0.00000000],
++		[-6.27311449, -0.00044031, 0.00026976, 0.00044253, -0.00000114, 0.00000000],
++		[-6.27311464, -0.00044025, 0.00026972, 0.00044247, -0.00000114, 0.00000000],
++		[-6.27311479, -0.00044018, 0.00026968, 0.00044241, -0.00000114, 0.00000000],
++		[-6.27311494, -0.00044012, 0.00026964, 0.00044234, -0.00000114, 0.00000000],
++		[-6.27311509, -0.00044006, 0.00026960, 0.00044228, -0.00000114, 0.00000000],
++		[-6.27311524, -0.00044000, 0.00026957, 0.00044222, -0.00000114, 0.00000000],
++		[-6.27311539, -0.00043993, 0.00026953, 0.00044216, -0.00000114, 0.00000000],
++		[-6.27311554, -0.00043987, 0.00026949, 0.00044209, -0.00000114, 0.00000000],
++		[-6.27311569, -0.00043981, 0.00026945, 0.00044203, -0.00000114, 0.00000000],
++		[-6.27311583, -0.00043975, 0.00026941, 0.00044197, -0.00000114, 0.00000000],
++		[-6.27311598, -0.00043968, 0.00026937, 0.00044190, -0.00000114, 0.00000000],
++		[-6.27311613, -0.00043962, 0.00026934, 0.00044184, -0.00000114, 0.00000000],
++		[-6.27311628, -0.00043956, 0.00026930, 0.00044178, -0.00000114, 0.00000000],
++		[-6.27311643, -0.00043950, 0.00026926, 0.00044172, -0.00000114, 0.00000000],
++		[-6.27311658, -0.00043944, 0.00026922, 0.00044165, -0.00000114, 0.00000000],
++		[-6.27311673, -0.00043937, 0.00026918, 0.00044159, -0.00000114, 0.00000000],
++		[-6.27311688, -0.00043931, 0.00026914, 0.00044153, -0.00000114, 0.00000000],
++		[-6.27311703, -0.00043925, 0.00026911, 0.00044147, -0.00000114, 0.00000000],
++		[-6.27311718, -0.00043919, 0.00026907, 0.00044140, -0.00000114, 0.00000000],
++		[-6.27311733, -0.00043912, 0.00026903, 0.00044134, -0.00000114, 0.00000000],
++		[-6.27311748, -0.00043906, 0.00026899, 0.00044128, -0.00000114, 0.00000000],
++		[-6.27311763, -0.00043900, 0.00026895, 0.00044122, -0.00000114, 0.00000000],
++		[-6.27311777, -0.00043894, 0.00026892, 0.00044115, -0.00000114, 0.00000000],
++		[-6.27311792, -0.00043887, 0.00026888, 0.00044109, -0.00000114, 0.00000000],
++		[-6.27311807, -0.00043881, 0.00026884, 0.00044103, -0.00000114, 0.00000000],
++		[-6.27311822, -0.00043875, 0.00026880, 0.00044096, -0.00000114, 0.00000000],
++		[-6.27311837, -0.00043869, 0.00026876, 0.00044090, -0.00000114, 0.00000000],
++		[-6.27311852, -0.00043863, 0.00026872, 0.00044084, -0.00000114, 0.00000000],
++		[-6.27311867, -0.00043856, 0.00026869, 0.00044078, -0.00000114, 0.00000000],
++		[-6.27311882, -0.00043850, 0.00026865, 0.00044072, -0.00000114, 0.00000000],
++		[-6.27311897, -0.00043844, 0.00026861, 0.00044065, -0.00000114, 0.00000000],
++		[-6.27311911, -0.00043838, 0.00026857, 0.00044059, -0.00000114, 0.00000000],
++		[-6.27311926, -0.00043832, 0.00026853, 0.00044053, -0.00000114, 0.00000000],
++		[-6.27311941, -0.00043825, 0.00026850, 0.00044047, -0.00000114, 0.00000000],
++		[-6.27311956, -0.00043819, 0.00026846, 0.00044040, -0.00000114, 0.00000000],
++		[-6.27311971, -0.00043813, 0.00026842, 0.00044034, -0.00000114, 0.00000000],
++		[-6.27311986, -0.00043807, 0.00026838, 0.00044028, -0.00000114, 0.00000000],
++		[-6.27312000, -0.00043800, 0.00026834, 0.00044022, -0.00000114, 0.00000000],
++		[-6.27312015, -0.00043794, 0.00026831, 0.00044015, -0.00000114, 0.00000000],
++		[-6.27312030, -0.00043788, 0.00026827, 0.00044009, -0.00000114, 0.00000000],
++		[-6.27312045, -0.00043782, 0.00026823, 0.00044003, -0.00000114, 0.00000000],
++		[-6.27312060, -0.00043776, 0.00026819, 0.00043997, -0.00000114, 0.00000000],
++		[-6.27312075, -0.00043770, 0.00026815, 0.00043990, -0.00000114, 0.00000000],
++		[-6.27312089, -0.00043763, 0.00026812, 0.00043984, -0.00000114, 0.00000000],
++		[-6.27312104, -0.00043757, 0.00026808, 0.00043978, -0.00000114, 0.00000000],
++		[-6.27312119, -0.00043751, 0.00026804, 0.00043972, -0.00000114, 0.00000000],
++		[-6.27312134, -0.00043745, 0.00026800, 0.00043966, -0.00000114, 0.00000000],
++		[-6.27312149, -0.00043739, 0.00026796, 0.00043959, -0.00000114, 0.00000000],
++		[-6.27312163, -0.00043732, 0.00026793, 0.00043953, -0.00000114, 0.00000000],
++		[-6.27312178, -0.00043726, 0.00026789, 0.00043947, -0.00000114, 0.00000000],
++		[-6.27312193, -0.00043720, 0.00026785, 0.00043941, -0.00000114, 0.00000000],
++		[-6.27312208, -0.00043714, 0.00026781, 0.00043935, -0.00000114, 0.00000000],
++		[-6.27312223, -0.00043708, 0.00026778, 0.00043928, -0.00000114, 0.00000000],
++		[-6.27312237, -0.00043702, 0.00026774, 0.00043922, -0.00000114, 0.00000000],
++		[-6.27312252, -0.00043695, 0.00026770, 0.00043916, -0.00000114, 0.00000000],
++		[-6.27312267, -0.00043689, 0.00026766, 0.00043910, -0.00000114, 0.00000000],
++		[-6.27312282, -0.00043683, 0.00026762, 0.00043904, -0.00000114, 0.00000000],
++		[-6.27312296, -0.00043677, 0.00026759, 0.00043897, -0.00000114, 0.00000000],
++		[-6.27312311, -0.00043671, 0.00026755, 0.00043891, -0.00000114, 0.00000000],
++		[-6.27312326, -0.00043665, 0.00026751, 0.00043885, -0.00000114, 0.00000000],
++		[-6.27312341, -0.00043658, 0.00026747, 0.00043879, -0.00000114, 0.00000000],
++		[-6.27312355, -0.00043652, 0.00026744, 0.00043873, -0.00000114, 0.00000000],
++		[-6.27312370, -0.00043646, 0.00026740, 0.00043866, -0.00000114, 0.00000000],
++		[-6.27312385, -0.00043640, 0.00026736, 0.00043860, -0.00000114, 0.00000000],
++		[-6.27312399, -0.00043634, 0.00026732, 0.00043854, -0.00000114, 0.00000000],
++		[-6.27312414, -0.00043628, 0.00026728, 0.00043848, -0.00000114, 0.00000000],
++		[-6.27312429, -0.00043622, 0.00026725, 0.00043842, -0.00000114, 0.00000000],
++		[-6.27312444, -0.00043615, 0.00026721, 0.00043836, -0.00000114, 0.00000000],
++		[-6.27312458, -0.00043609, 0.00026717, 0.00043829, -0.00000114, 0.00000000],
++		[-6.27312473, -0.00043603, 0.00026713, 0.00043823, -0.00000114, 0.00000000],
++		[-6.27312488, -0.00043597, 0.00026710, 0.00043817, -0.00000114, 0.00000000],
++		[-6.27312502, -0.00043591, 0.00026706, 0.00043811, -0.00000114, 0.00000000],
++		[-6.27312517, -0.00043585, 0.00026702, 0.00043805, -0.00000114, 0.00000000],
++		[-6.27312532, -0.00043579, 0.00026698, 0.00043798, -0.00000114, 0.00000000],
++		[-6.27312546, -0.00043572, 0.00026695, 0.00043792, -0.00000114, 0.00000000],
++		[-6.27312561, -0.00043566, 0.00026691, 0.00043786, -0.00000114, 0.00000000],
++		[-6.27312576, -0.00043560, 0.00026687, 0.00043780, -0.00000114, 0.00000000],
++		[-6.27312590, -0.00043554, 0.00026683, 0.00043774, -0.00000114, 0.00000000],
++		[-6.27312605, -0.00043548, 0.00026680, 0.00043768, -0.00000114, 0.00000000],
++		[-6.27312620, -0.00043542, 0.00026676, 0.00043762, -0.00000114, 0.00000000],
++		[-6.27312634, -0.00043536, 0.00026672, 0.00043755, -0.00000114, 0.00000000],
++		[-6.27312649, -0.00043529, 0.00026668, 0.00043749, -0.00000114, 0.00000000],
++		[-6.27312664, -0.00043523, 0.00026665, 0.00043743, -0.00000114, 0.00000000],
++		[-6.27312678, -0.00043517, 0.00026661, 0.00043737, -0.00000114, 0.00000000],
++		[-6.27312693, -0.00043511, 0.00026657, 0.00043731, -0.00000114, 0.00000000],
++		[-6.27312708, -0.00043505, 0.00026653, 0.00043725, -0.00000114, 0.00000000],
++		[-6.27312722, -0.00043499, 0.00026650, 0.00043718, -0.00000114, 0.00000000],
++		[-6.27312737, -0.00043493, 0.00026646, 0.00043712, -0.00000114, 0.00000000],
++		[-6.27312752, -0.00043487, 0.00026642, 0.00043706, -0.00000114, 0.00000000],
++		[-6.27312766, -0.00043481, 0.00026638, 0.00043700, -0.00000114, 0.00000000],
++		[-6.27312781, -0.00043474, 0.00026635, 0.00043694, -0.00000114, 0.00000000],
++		[-6.27312795, -0.00043468, 0.00026631, 0.00043688, -0.00000114, 0.00000000],
++		[-6.27312810, -0.00043462, 0.00026627, 0.00043682, -0.00000114, 0.00000000],
++		[-6.27312825, -0.00043456, 0.00026623, 0.00043676, -0.00000114, 0.00000000],
++		[-6.27312839, -0.00043450, 0.00026620, 0.00043669, -0.00000114, 0.00000000],
++		[-6.27312854, -0.00043444, 0.00026616, 0.00043663, -0.00000114, 0.00000000],
++		[-6.27312868, -0.00043438, 0.00026612, 0.00043657, -0.00000114, 0.00000000],
++		[-6.27312883, -0.00043432, 0.00026608, 0.00043651, -0.00000114, 0.00000000],
++		[-6.27312898, -0.00043426, 0.00026605, 0.00043645, -0.00000114, 0.00000000],
++		[-6.27312912, -0.00043420, 0.00026601, 0.00043639, -0.00000114, 0.00000000],
++		[-6.27312927, -0.00043413, 0.00026597, 0.00043633, -0.00000114, 0.00000000],
++		[-6.27312941, -0.00043407, 0.00026593, 0.00043626, -0.00000114, 0.00000000],
++		[-6.27312956, -0.00043401, 0.00026590, 0.00043620, -0.00000114, 0.00000000],
++		[-6.27312970, -0.00043395, 0.00026586, 0.00043614, -0.00000114, 0.00000000],
++		[-6.27312985, -0.00043389, 0.00026582, 0.00043608, -0.00000114, 0.00000000],
++		[-6.27313000, -0.00043383, 0.00026579, 0.00043602, -0.00000114, 0.00000000],
++		[-6.27313014, -0.00043377, 0.00026575, 0.00043596, -0.00000114, 0.00000000],
++		[-6.27313029, -0.00043371, 0.00026571, 0.00043590, -0.00000114, 0.00000000],
++		[-6.27313043, -0.00043365, 0.00026567, 0.00043584, -0.00000114, 0.00000000],
++		[-6.27313058, -0.00043359, 0.00026564, 0.00043578, -0.00000114, 0.00000000],
++		[-6.27313072, -0.00043353, 0.00026560, 0.00043572, -0.00000114, 0.00000000],
++		[-6.27313087, -0.00043347, 0.00026556, 0.00043565, -0.00000114, 0.00000000],
++		[-6.27313101, -0.00043341, 0.00026552, 0.00043559, -0.00000114, 0.00000000],
++		[-6.27313116, -0.00043335, 0.00026549, 0.00043553, -0.00000114, 0.00000000],
++		[-6.27313130, -0.00043328, 0.00026545, 0.00043547, -0.00000114, 0.00000000],
++		[-6.27313145, -0.00043322, 0.00026541, 0.00043541, -0.00000114, 0.00000000],
++		[-6.27313159, -0.00043316, 0.00026538, 0.00043535, -0.00000114, 0.00000000],
++		[-6.27313174, -0.00043310, 0.00026534, 0.00043529, -0.00000114, 0.00000000],
++		[-6.27313188, -0.00043304, 0.00026530, 0.00043523, -0.00000114, 0.00000000],
++		[-6.27313203, -0.00043298, 0.00026526, 0.00043517, -0.00000114, 0.00000000],
++		[-6.27313217, -0.00043292, 0.00026523, 0.00043511, -0.00000114, 0.00000000],
++		[-6.27313232, -0.00043286, 0.00026519, 0.00043504, -0.00000114, 0.00000000],
++		[-6.27313246, -0.00043280, 0.00026515, 0.00043498, -0.00000114, 0.00000000],
++		[-6.27313261, -0.00043274, 0.00026512, 0.00043492, -0.00000114, 0.00000000],
++		[-6.27313275, -0.00043268, 0.00026508, 0.00043486, -0.00000114, 0.00000000],
++		[-6.27313290, -0.00043262, 0.00026504, 0.00043480, -0.00000114, 0.00000000],
++		[-6.27313304, -0.00043256, 0.00026501, 0.00043474, -0.00000114, 0.00000000],
++		[-6.27313319, -0.00043250, 0.00026497, 0.00043468, -0.00000114, 0.00000000],
++		[-6.27313333, -0.00043244, 0.00026493, 0.00043462, -0.00000114, 0.00000000],
++		[-6.27313348, -0.00043238, 0.00026489, 0.00043456, -0.00000114, 0.00000000],
++		[-6.27313362, -0.00043232, 0.00026486, 0.00043450, -0.00000114, 0.00000000],
++		[-6.27313377, -0.00043226, 0.00026482, 0.00043444, -0.00000114, 0.00000000],
++		[-6.27313391, -0.00043220, 0.00026478, 0.00043438, -0.00000114, 0.00000000],
++		[-6.27313405, -0.00043214, 0.00026475, 0.00043432, -0.00000114, 0.00000000],
++		[-6.27313420, -0.00043207, 0.00026471, 0.00043426, -0.00000114, 0.00000000],
++		[-6.27313434, -0.00043201, 0.00026467, 0.00043419, -0.00000114, 0.00000000],
++		[-6.27313449, -0.00043195, 0.00026464, 0.00043413, -0.00000114, 0.00000000],
++		[-6.27313463, -0.00043189, 0.00026460, 0.00043407, -0.00000114, 0.00000000],
++		[-6.27313478, -0.00043183, 0.00026456, 0.00043401, -0.00000114, 0.00000000],
++		[-6.27313492, -0.00043177, 0.00026452, 0.00043395, -0.00000114, 0.00000000],
++		[-6.27313506, -0.00043171, 0.00026449, 0.00043389, -0.00000114, 0.00000000],
++		[-6.27313521, -0.00043165, 0.00026445, 0.00043383, -0.00000114, 0.00000000],
++		[-6.27313535, -0.00043159, 0.00026441, 0.00043377, -0.00000114, 0.00000000],
++		[-6.27313550, -0.00043153, 0.00026438, 0.00043371, -0.00000114, 0.00000000],
++		[-6.27313564, -0.00043147, 0.00026434, 0.00043365, -0.00000114, 0.00000000],
++		[-6.27313578, -0.00043141, 0.00026430, 0.00043359, -0.00000114, 0.00000000],
++		[-6.27313593, -0.00043135, 0.00026427, 0.00043353, -0.00000114, 0.00000000],
++		[-6.27313607, -0.00043129, 0.00026423, 0.00043347, -0.00000114, 0.00000000],
++		[-6.27313622, -0.00043123, 0.00026419, 0.00043341, -0.00000114, 0.00000000],
++		[-6.27313636, -0.00043117, 0.00026416, 0.00043335, -0.00000114, 0.00000000],
++		[-6.27313650, -0.00043111, 0.00026412, 0.00043329, -0.00000114, 0.00000000],
++		[-6.27313665, -0.00043105, 0.00026408, 0.00043323, -0.00000114, 0.00000000],
++		[-6.27313679, -0.00043099, 0.00026405, 0.00043317, -0.00000114, 0.00000000],
++		[-6.27313693, -0.00043093, 0.00026401, 0.00043311, -0.00000114, 0.00000000],
++		[-6.27313708, -0.00043087, 0.00026397, 0.00043305, -0.00000114, 0.00000000],
++		[-6.27313722, -0.00043081, 0.00026394, 0.00043299, -0.00000114, 0.00000000],
++		[-6.27313737, -0.00043075, 0.00026390, 0.00043293, -0.00000114, 0.00000000],
++		[-6.27313751, -0.00043069, 0.00026386, 0.00043287, -0.00000114, 0.00000000],
++		[-6.27313765, -0.00043063, 0.00026382, 0.00043281, -0.00000114, 0.00000000],
++		[-6.27313780, -0.00043057, 0.00026379, 0.00043275, -0.00000114, 0.00000000],
++		[-6.27313794, -0.00043051, 0.00026375, 0.00043268, -0.00000114, 0.00000000],
++		[-6.27313808, -0.00043045, 0.00026371, 0.00043262, -0.00000114, 0.00000000],
++		[-6.27313823, -0.00043039, 0.00026368, 0.00043256, -0.00000114, 0.00000000],
++		[-6.27313837, -0.00043033, 0.00026364, 0.00043250, -0.00000114, 0.00000000],
++		[-6.27313851, -0.00043027, 0.00026360, 0.00043244, -0.00000114, 0.00000000],
++		[-6.27313865, -0.00043021, 0.00026357, 0.00043238, -0.00000114, 0.00000000],
++		[-6.27313880, -0.00043015, 0.00026353, 0.00043232, -0.00000114, 0.00000000],
++		[-6.27313894, -0.00043009, 0.00026349, 0.00043226, -0.00000114, 0.00000000],
++		[-6.27313908, -0.00043003, 0.00026346, 0.00043220, -0.00000114, 0.00000000],
++		[-6.27313923, -0.00042997, 0.00026342, 0.00043214, -0.00000114, 0.00000000],
++		[-6.27313937, -0.00042991, 0.00026338, 0.00043208, -0.00000114, 0.00000000],
++		[-6.27313951, -0.00042985, 0.00026335, 0.00043202, -0.00000114, 0.00000000],
++		[-6.27313966, -0.00042980, 0.00026331, 0.00043196, -0.00000114, 0.00000000],
++		[-6.27313980, -0.00042974, 0.00026328, 0.00043190, -0.00000114, 0.00000000],
++		[-6.27313994, -0.00042968, 0.00026324, 0.00043184, -0.00000114, 0.00000000],
++		[-6.27314008, -0.00042962, 0.00026320, 0.00043178, -0.00000114, 0.00000000],
++		[-6.27314023, -0.00042956, 0.00026317, 0.00043172, -0.00000114, 0.00000000],
++		[-6.27314037, -0.00042950, 0.00026313, 0.00043166, -0.00000114, 0.00000000],
++		[-6.27314051, -0.00042944, 0.00026309, 0.00043160, -0.00000114, 0.00000000],
++		[-6.27314065, -0.00042938, 0.00026306, 0.00043154, -0.00000114, 0.00000000],
++		[-6.27314080, -0.00042932, 0.00026302, 0.00043148, -0.00000114, 0.00000000],
++		[-6.27314094, -0.00042926, 0.00026298, 0.00043142, -0.00000114, 0.00000000],
++		[-6.27314108, -0.00042920, 0.00026295, 0.00043136, -0.00000114, 0.00000000],
++		[-6.27314122, -0.00042914, 0.00026291, 0.00043131, -0.00000114, 0.00000000],
++		[-6.27314137, -0.00042908, 0.00026287, 0.00043125, -0.00000114, 0.00000000],
++		[-6.27314151, -0.00042902, 0.00026284, 0.00043119, -0.00000114, 0.00000000],
++		[-6.27314165, -0.00042896, 0.00026280, 0.00043113, -0.00000114, 0.00000000],
++		[-6.27314179, -0.00042890, 0.00026276, 0.00043107, -0.00000114, 0.00000000],
++		[-6.27314194, -0.00042884, 0.00026273, 0.00043101, -0.00000114, 0.00000000],
++		[-6.27314208, -0.00042878, 0.00026269, 0.00043095, -0.00000114, 0.00000000],
++		[-6.27314222, -0.00042872, 0.00026265, 0.00043089, -0.00000114, 0.00000000],
++		[-6.27314236, -0.00042866, 0.00026262, 0.00043083, -0.00000114, 0.00000000],
++		[-6.27314250, -0.00042861, 0.00026258, 0.00043077, -0.00000114, 0.00000000],
++		[-6.27314265, -0.00042855, 0.00026255, 0.00043071, -0.00000114, 0.00000000],
++		[-6.27314279, -0.00042849, 0.00026251, 0.00043065, -0.00000114, 0.00000000],
++		[-6.27314293, -0.00042843, 0.00026247, 0.00043059, -0.00000114, 0.00000000],
++		[-6.27314307, -0.00042837, 0.00026244, 0.00043053, -0.00000114, 0.00000000],
++		[-6.27314321, -0.00042831, 0.00026240, 0.00043047, -0.00000114, 0.00000000],
++		[-6.27314336, -0.00042825, 0.00026236, 0.00043041, -0.00000114, 0.00000000],
++		[-6.27314350, -0.00042819, 0.00026233, 0.00043035, -0.00000114, 0.00000000],
++		[-6.27314364, -0.00042813, 0.00026229, 0.00043029, -0.00000114, 0.00000000],
++		[-6.27314378, -0.00042807, 0.00026226, 0.00043023, -0.00000114, 0.00000000],
++		[-6.27314392, -0.00042801, 0.00026222, 0.00043017, -0.00000114, 0.00000000],
++		[-6.27314406, -0.00042795, 0.00026218, 0.00043011, -0.00000114, 0.00000000],
++		[-6.27314421, -0.00042789, 0.00026215, 0.00043005, -0.00000114, 0.00000000],
++		[-6.27314435, -0.00042783, 0.00026211, 0.00042999, -0.00000114, 0.00000000],
++		[-6.27314449, -0.00042778, 0.00026207, 0.00042993, -0.00000114, 0.00000000],
++		[-6.27314463, -0.00042772, 0.00026204, 0.00042987, -0.00000114, 0.00000000],
++		[-6.27314477, -0.00042766, 0.00026200, 0.00042982, -0.00000114, 0.00000000],
++		[-6.27314491, -0.00042760, 0.00026197, 0.00042976, -0.00000114, 0.00000000],
++		[-6.27314505, -0.00042754, 0.00026193, 0.00042970, -0.00000114, 0.00000000],
++		[-6.27314520, -0.00042748, 0.00026189, 0.00042964, -0.00000114, 0.00000000],
++		[-6.27314534, -0.00042742, 0.00026186, 0.00042958, -0.00000114, 0.00000000],
++		[-6.27314548, -0.00042736, 0.00026182, 0.00042952, -0.00000114, 0.00000000],
++		[-6.27314562, -0.00042730, 0.00026178, 0.00042946, -0.00000114, 0.00000000],
++		[-6.27314576, -0.00042724, 0.00026175, 0.00042940, -0.00000114, 0.00000000],
++		[-6.27314590, -0.00042719, 0.00026171, 0.00042934, -0.00000114, 0.00000000],
++		[-6.27314604, -0.00042713, 0.00026168, 0.00042928, -0.00000114, 0.00000000],
++		[-6.27314618, -0.00042707, 0.00026164, 0.00042922, -0.00000114, 0.00000000],
++		[-6.27314633, -0.00042701, 0.00026160, 0.00042916, -0.00000114, 0.00000000],
++		[-6.27314647, -0.00042695, 0.00026157, 0.00042910, -0.00000114, 0.00000000],
++		[-6.27314661, -0.00042689, 0.00026153, 0.00042904, -0.00000114, 0.00000000],
++		[-6.27314675, -0.00042683, 0.00026150, 0.00042899, -0.00000114, 0.00000000],
++		[-6.27314689, -0.00042677, 0.00026146, 0.00042893, -0.00000114, 0.00000000],
++		[-6.27314703, -0.00042671, 0.00026142, 0.00042887, -0.00000114, 0.00000000],
++		[-6.27314717, -0.00042666, 0.00026139, 0.00042881, -0.00000114, 0.00000000],
++		[-6.27314731, -0.00042660, 0.00026135, 0.00042875, -0.00000114, 0.00000000],
++		[-6.27314745, -0.00042654, 0.00026132, 0.00042869, -0.00000114, 0.00000000],
++		[-6.27314759, -0.00042648, 0.00026128, 0.00042863, -0.00000114, 0.00000000],
++		[-6.27314773, -0.00042642, 0.00026124, 0.00042857, -0.00000114, 0.00000000],
++		[-6.27314787, -0.00042636, 0.00026121, 0.00042851, -0.00000114, 0.00000000],
++		[-6.27314801, -0.00042630, 0.00026117, 0.00042845, -0.00000114, 0.00000000],
++		[-6.27314815, -0.00042624, 0.00026114, 0.00042839, -0.00000114, 0.00000000],
++		[-6.27314830, -0.00042619, 0.00026110, 0.00042834, -0.00000114, 0.00000000],
++		[-6.27314844, -0.00042613, 0.00026106, 0.00042828, -0.00000114, 0.00000000],
++		[-6.27314858, -0.00042607, 0.00026103, 0.00042822, -0.00000114, 0.00000000],
++		[-6.27314872, -0.00042601, 0.00026099, 0.00042816, -0.00000114, 0.00000000],
++		[-6.27314886, -0.00042595, 0.00026096, 0.00042810, -0.00000114, 0.00000000],
++		[-6.27314900, -0.00042589, 0.00026092, 0.00042804, -0.00000114, 0.00000000],
++		[-6.27314914, -0.00042583, 0.00026088, 0.00042798, -0.00000114, 0.00000000],
++		[-6.27314928, -0.00042578, 0.00026085, 0.00042792, -0.00000114, 0.00000000],
++		[-6.27314942, -0.00042572, 0.00026081, 0.00042786, -0.00000114, 0.00000000],
++		[-6.27314956, -0.00042566, 0.00026078, 0.00042781, -0.00000114, 0.00000000],
++		[-6.27314970, -0.00042560, 0.00026074, 0.00042775, -0.00000114, 0.00000000],
++		[-6.27314984, -0.00042554, 0.00026070, 0.00042769, -0.00000114, 0.00000000],
++		[-6.27314998, -0.00042548, 0.00026067, 0.00042763, -0.00000114, 0.00000000],
++		[-6.27315012, -0.00042542, 0.00026063, 0.00042757, -0.00000114, 0.00000000],
++		[-6.27315026, -0.00042537, 0.00026060, 0.00042751, -0.00000114, 0.00000000],
++		[-6.27315040, -0.00042531, 0.00026056, 0.00042745, -0.00000114, 0.00000000],
++		[-6.27315054, -0.00042525, 0.00026052, 0.00042739, -0.00000114, 0.00000000],
++		[-6.27315068, -0.00042519, 0.00026049, 0.00042734, -0.00000114, 0.00000000],
++		[-6.27315082, -0.00042513, 0.00026045, 0.00042728, -0.00000114, 0.00000000],
++		[-6.27315096, -0.00042507, 0.00026042, 0.00042722, -0.00000114, 0.00000000],
++		[-6.27315110, -0.00042502, 0.00026038, 0.00042716, -0.00000114, 0.00000000],
++		[-6.27315124, -0.00042496, 0.00026035, 0.00042710, -0.00000114, 0.00000000],
++		[-6.27315138, -0.00042490, 0.00026031, 0.00042704, -0.00000114, 0.00000000],
++		[-6.27315152, -0.00042484, 0.00026027, 0.00042698, -0.00000114, 0.00000000],
++		[-6.27315165, -0.00042478, 0.00026024, 0.00042692, -0.00000114, 0.00000000],
++		[-6.27315179, -0.00042472, 0.00026020, 0.00042687, -0.00000114, 0.00000000],
++		[-6.27315193, -0.00042467, 0.00026017, 0.00042681, -0.00000114, 0.00000000],
++		[-6.27315207, -0.00042461, 0.00026013, 0.00042675, -0.00000114, 0.00000000],
++		[-6.27315221, -0.00042455, 0.00026010, 0.00042669, -0.00000114, 0.00000000],
++		[-6.27315235, -0.00042449, 0.00026006, 0.00042663, -0.00000114, 0.00000000],
++		[-6.27315249, -0.00042443, 0.00026002, 0.00042657, -0.00000114, 0.00000000],
++		[-6.27315263, -0.00042437, 0.00025999, 0.00042652, -0.00000114, 0.00000000],
++		[-6.27315277, -0.00042432, 0.00025995, 0.00042646, -0.00000114, 0.00000000],
++		[-6.27315291, -0.00042426, 0.00025992, 0.00042640, -0.00000114, 0.00000000],
++		[-6.27315305, -0.00042420, 0.00025988, 0.00042634, -0.00000114, 0.00000000],
++		[-6.27315319, -0.00042414, 0.00025985, 0.00042628, -0.00000114, 0.00000000],
++		[-6.27315333, -0.00042408, 0.00025981, 0.00042622, -0.00000114, 0.00000000],
++		[-6.27315347, -0.00042403, 0.00025978, 0.00042616, -0.00000114, 0.00000000],
++		[-6.27315360, -0.00042397, 0.00025974, 0.00042611, -0.00000114, 0.00000000],
++		[-6.27315374, -0.00042391, 0.00025970, 0.00042605, -0.00000114, 0.00000000],
++		[-6.27315388, -0.00042385, 0.00025967, 0.00042599, -0.00000114, 0.00000000],
++		[-6.27315402, -0.00042379, 0.00025963, 0.00042593, -0.00000114, 0.00000000],
++		[-6.27315416, -0.00042374, 0.00025960, 0.00042587, -0.00000114, 0.00000000],
++		[-6.27315430, -0.00042368, 0.00025956, 0.00042581, -0.00000114, 0.00000000],
++		[-6.27315444, -0.00042362, 0.00025953, 0.00042576, -0.00000114, 0.00000000],
++		[-6.27315458, -0.00042356, 0.00025949, 0.00042570, -0.00000114, 0.00000000],
++		[-6.27315472, -0.00042350, 0.00025946, 0.00042564, -0.00000114, 0.00000000],
++		[-6.27315485, -0.00042345, 0.00025942, 0.00042558, -0.00000114, 0.00000000],
++		[-6.27315499, -0.00042339, 0.00025938, 0.00042552, -0.00000114, 0.00000000],
++		[-6.27315513, -0.00042333, 0.00025935, 0.00042547, -0.00000114, 0.00000000],
++		[-6.27315527, -0.00042327, 0.00025931, 0.00042541, -0.00000114, 0.00000000],
++		[-6.27315541, -0.00042321, 0.00025928, 0.00042535, -0.00000114, 0.00000000],
++		[-6.27315555, -0.00042316, 0.00025924, 0.00042529, -0.00000114, 0.00000000],
++		[-6.27315569, -0.00042310, 0.00025921, 0.00042523, -0.00000114, 0.00000000],
++		[-6.27315582, -0.00042304, 0.00025917, 0.00042517, -0.00000114, 0.00000000],
++		[-6.27315596, -0.00042298, 0.00025914, 0.00042512, -0.00000114, 0.00000000],
++		[-6.27315610, -0.00042292, 0.00025910, 0.00042506, -0.00000114, 0.00000000],
++		[-6.27315624, -0.00042287, 0.00025907, 0.00042500, -0.00000114, 0.00000000],
++		[-6.27315638, -0.00042281, 0.00025903, 0.00042494, -0.00000114, 0.00000000],
++		[-6.27315652, -0.00042275, 0.00025899, 0.00042488, -0.00000114, 0.00000000],
++		[-6.27315665, -0.00042269, 0.00025896, 0.00042483, -0.00000114, 0.00000000],
++		[-6.27315679, -0.00042264, 0.00025892, 0.00042477, -0.00000114, 0.00000000],
++		[-6.27315693, -0.00042258, 0.00025889, 0.00042471, -0.00000114, 0.00000000],
++		[-6.27315707, -0.00042252, 0.00025885, 0.00042465, -0.00000114, 0.00000000],
++		[-6.27315721, -0.00042246, 0.00025882, 0.00042459, -0.00000114, 0.00000000],
++		[-6.27315734, -0.00042241, 0.00025878, 0.00042454, -0.00000114, 0.00000000],
++		[-6.27315748, -0.00042235, 0.00025875, 0.00042448, -0.00000114, 0.00000000],
++		[-6.27315762, -0.00042229, 0.00025871, 0.00042442, -0.00000114, 0.00000000],
++		[-6.27315776, -0.00042223, 0.00025868, 0.00042436, -0.00000114, 0.00000000],
++		[-6.27315790, -0.00042218, 0.00025864, 0.00042430, -0.00000114, 0.00000000],
++		[-6.27315803, -0.00042212, 0.00025861, 0.00042425, -0.00000114, 0.00000000],
++		[-6.27315817, -0.00042206, 0.00025857, 0.00042419, -0.00000114, 0.00000000],
++		[-6.27315831, -0.00042200, 0.00025854, 0.00042413, -0.00000114, 0.00000000],
++		[-6.27315845, -0.00042194, 0.00025850, 0.00042407, -0.00000114, 0.00000000],
++		[-6.27315858, -0.00042189, 0.00025846, 0.00042402, -0.00000114, 0.00000000],
++		[-6.27315872, -0.00042183, 0.00025843, 0.00042396, -0.00000114, 0.00000000],
++		[-6.27315886, -0.00042177, 0.00025839, 0.00042390, -0.00000114, 0.00000000],
++		[-6.27315900, -0.00042171, 0.00025836, 0.00042384, -0.00000114, 0.00000000],
++		[-6.27315913, -0.00042166, 0.00025832, 0.00042378, -0.00000114, 0.00000000],
++		[-6.27315927, -0.00042160, 0.00025829, 0.00042373, -0.00000114, 0.00000000],
++		[-6.27315941, -0.00042154, 0.00025825, 0.00042367, -0.00000114, 0.00000000],
++		[-6.27315955, -0.00042149, 0.00025822, 0.00042361, -0.00000114, 0.00000000],
++		[-6.27315968, -0.00042143, 0.00025818, 0.00042355, -0.00000114, 0.00000000],
++		[-6.27315982, -0.00042137, 0.00025815, 0.00042350, -0.00000114, 0.00000000],
++		[-6.27315996, -0.00042131, 0.00025811, 0.00042344, -0.00000114, 0.00000000],
++		[-6.27316010, -0.00042126, 0.00025808, 0.00042338, -0.00000114, 0.00000000],
++		[-6.27316023, -0.00042120, 0.00025804, 0.00042332, -0.00000114, 0.00000000],
++		[-6.27316037, -0.00042114, 0.00025801, 0.00042327, -0.00000114, 0.00000000],
++		[-6.27316051, -0.00042108, 0.00025797, 0.00042321, -0.00000114, 0.00000000],
++		[-6.27316064, -0.00042103, 0.00025794, 0.00042315, -0.00000114, 0.00000000],
++		[-6.27316078, -0.00042097, 0.00025790, 0.00042309, -0.00000114, 0.00000000],
++		[-6.27316092, -0.00042091, 0.00025787, 0.00042304, -0.00000114, 0.00000000],
++		[-6.27316105, -0.00042085, 0.00025783, 0.00042298, -0.00000114, 0.00000000],
++		[-6.27316119, -0.00042080, 0.00025780, 0.00042292, -0.00000114, 0.00000000],
++		[-6.27316133, -0.00042074, 0.00025776, 0.00042286, -0.00000114, 0.00000000],
++		[-6.27316147, -0.00042068, 0.00025773, 0.00042281, -0.00000114, 0.00000000],
++		[-6.27316160, -0.00042063, 0.00025769, 0.00042275, -0.00000114, 0.00000000],
++		[-6.27316174, -0.00042057, 0.00025766, 0.00042269, -0.00000114, 0.00000000],
++		[-6.27316188, -0.00042051, 0.00025762, 0.00042263, -0.00000114, 0.00000000],
++		[-6.27316201, -0.00042045, 0.00025759, 0.00042258, -0.00000114, 0.00000000],
++		[-6.27316215, -0.00042040, 0.00025755, 0.00042252, -0.00000114, 0.00000000],
++		[-6.27316229, -0.00042034, 0.00025752, 0.00042246, -0.00000114, 0.00000000],
++		[-6.27316242, -0.00042028, 0.00025748, 0.00042240, -0.00000114, 0.00000000],
++		[-6.27316256, -0.00042023, 0.00025745, 0.00042235, -0.00000114, 0.00000000],
++		[-6.27316270, -0.00042017, 0.00025741, 0.00042229, -0.00000114, 0.00000000],
++		[-6.27316283, -0.00042011, 0.00025738, 0.00042223, -0.00000114, 0.00000000],
++		[-6.27316297, -0.00042006, 0.00025734, 0.00042217, -0.00000114, 0.00000000],
++		[-6.27316311, -0.00042000, 0.00025731, 0.00042212, -0.00000114, 0.00000000],
++		[-6.27316324, -0.00041994, 0.00025727, 0.00042206, -0.00000114, 0.00000000],
++		[-6.27316338, -0.00041988, 0.00025724, 0.00042200, -0.00000114, 0.00000000],
++		[-6.27316351, -0.00041983, 0.00025720, 0.00042194, -0.00000114, 0.00000000],
++		[-6.27316365, -0.00041977, 0.00025717, 0.00042189, -0.00000114, 0.00000000],
++		[-6.27316379, -0.00041971, 0.00025713, 0.00042183, -0.00000114, 0.00000000],
++		[-6.27316392, -0.00041966, 0.00025710, 0.00042177, -0.00000114, 0.00000000],
++		[-6.27316406, -0.00041960, 0.00025706, 0.00042172, -0.00000114, 0.00000000],
++		[-6.27316420, -0.00041954, 0.00025703, 0.00042166, -0.00000114, 0.00000000],
++		[-6.27316433, -0.00041949, 0.00025699, 0.00042160, -0.00000114, 0.00000000],
++		[-6.27316447, -0.00041943, 0.00025696, 0.00042154, -0.00000114, 0.00000000],
++		[-6.27316460, -0.00041937, 0.00025692, 0.00042149, -0.00000114, 0.00000000],
++		[-6.27316474, -0.00041932, 0.00025689, 0.00042143, -0.00000114, 0.00000000],
++		[-6.27316488, -0.00041926, 0.00025685, 0.00042137, -0.00000114, 0.00000000],
++		[-6.27316501, -0.00041920, 0.00025682, 0.00042132, -0.00000114, 0.00000000],
++		[-6.27316515, -0.00041915, 0.00025678, 0.00042126, -0.00000114, 0.00000000],
++		[-6.27316528, -0.00041909, 0.00025675, 0.00042120, -0.00000114, 0.00000000],
++		[-6.27316542, -0.00041903, 0.00025671, 0.00042115, -0.00000114, 0.00000000],
++		[-6.27316555, -0.00041898, 0.00025668, 0.00042109, -0.00000114, 0.00000000],
++		[-6.27316569, -0.00041892, 0.00025664, 0.00042103, -0.00000114, 0.00000000],
++		[-6.27316583, -0.00041886, 0.00025661, 0.00042097, -0.00000114, 0.00000000],
++		[-6.27316596, -0.00041881, 0.00025658, 0.00042092, -0.00000114, 0.00000000],
++		[-6.27316610, -0.00041875, 0.00025654, 0.00042086, -0.00000114, 0.00000000],
++		[-6.27316623, -0.00041869, 0.00025651, 0.00042080, -0.00000114, 0.00000000],
++		[-6.27316637, -0.00041864, 0.00025647, 0.00042075, -0.00000114, 0.00000000],
++		[-6.27316650, -0.00041858, 0.00025644, 0.00042069, -0.00000114, 0.00000000],
++		[-6.27316664, -0.00041852, 0.00025640, 0.00042063, -0.00000114, 0.00000000],
++		[-6.27316677, -0.00041847, 0.00025637, 0.00042058, -0.00000114, 0.00000000],
++		[-6.27316691, -0.00041841, 0.00025633, 0.00042052, -0.00000114, 0.00000000],
++		[-6.27316705, -0.00041835, 0.00025630, 0.00042046, -0.00000114, 0.00000000],
++		[-6.27316718, -0.00041830, 0.00025626, 0.00042041, -0.00000114, 0.00000000],
++		[-6.27316732, -0.00041824, 0.00025623, 0.00042035, -0.00000114, 0.00000000],
++		[-6.27316745, -0.00041818, 0.00025619, 0.00042029, -0.00000114, 0.00000000],
++		[-6.27316759, -0.00041813, 0.00025616, 0.00042023, -0.00000114, 0.00000000],
++		[-6.27316772, -0.00041807, 0.00025612, 0.00042018, -0.00000114, 0.00000000],
++		[-6.27316786, -0.00041801, 0.00025609, 0.00042012, -0.00000114, 0.00000000],
++		[-6.27316799, -0.00041796, 0.00025606, 0.00042006, -0.00000114, 0.00000000],
++		[-6.27316813, -0.00041790, 0.00025602, 0.00042001, -0.00000114, 0.00000000],
++		[-6.27316826, -0.00041784, 0.00025599, 0.00041995, -0.00000114, 0.00000000],
++		[-6.27316840, -0.00041779, 0.00025595, 0.00041989, -0.00000114, 0.00000000],
++		[-6.27316853, -0.00041773, 0.00025592, 0.00041984, -0.00000114, 0.00000000],
++		[-6.27316867, -0.00041768, 0.00025588, 0.00041978, -0.00000114, 0.00000000],
++		[-6.27316880, -0.00041762, 0.00025585, 0.00041972, -0.00000114, 0.00000000],
++		[-6.27316894, -0.00041756, 0.00025581, 0.00041967, -0.00000114, 0.00000000],
++		[-6.27316907, -0.00041751, 0.00025578, 0.00041961, -0.00000114, 0.00000000],
++		[-6.27316921, -0.00041745, 0.00025574, 0.00041955, -0.00000114, 0.00000000],
++		[-6.27316934, -0.00041739, 0.00025571, 0.00041950, -0.00000114, 0.00000000],
++		[-6.27316948, -0.00041734, 0.00025568, 0.00041944, -0.00000114, 0.00000000],
++		[-6.27316961, -0.00041728, 0.00025564, 0.00041939, -0.00000114, 0.00000000],
++		[-6.27316974, -0.00041722, 0.00025561, 0.00041933, -0.00000114, 0.00000000],
++		[-6.27316988, -0.00041717, 0.00025557, 0.00041927, -0.00000114, 0.00000000],
++		[-6.27317001, -0.00041711, 0.00025554, 0.00041922, -0.00000114, 0.00000000],
++		[-6.27317015, -0.00041706, 0.00025550, 0.00041916, -0.00000114, 0.00000000],
++		[-6.27317028, -0.00041700, 0.00025547, 0.00041910, -0.00000114, 0.00000000],
++		[-6.27317042, -0.00041694, 0.00025543, 0.00041905, -0.00000114, 0.00000000],
++		[-6.27317055, -0.00041689, 0.00025540, 0.00041899, -0.00000114, 0.00000000],
++		[-6.27317069, -0.00041683, 0.00025537, 0.00041893, -0.00000114, 0.00000000],
++		[-6.27317082, -0.00041678, 0.00025533, 0.00041888, -0.00000114, 0.00000000],
++		[-6.27317095, -0.00041672, 0.00025530, 0.00041882, -0.00000114, 0.00000000],
++		[-6.27317109, -0.00041666, 0.00025526, 0.00041876, -0.00000114, 0.00000000],
++		[-6.27317122, -0.00041661, 0.00025523, 0.00041871, -0.00000114, 0.00000000],
++		[-6.27317136, -0.00041655, 0.00025519, 0.00041865, -0.00000114, 0.00000000],
++		[-6.27317149, -0.00041649, 0.00025516, 0.00041860, -0.00000114, 0.00000000],
++		[-6.27317163, -0.00041644, 0.00025512, 0.00041854, -0.00000114, 0.00000000],
++		[-6.27317176, -0.00041638, 0.00025509, 0.00041848, -0.00000114, 0.00000000],
++		[-6.27317189, -0.00041633, 0.00025506, 0.00041843, -0.00000114, 0.00000000],
++		[-6.27317203, -0.00041627, 0.00025502, 0.00041837, -0.00000114, 0.00000000],
++		[-6.27317216, -0.00041621, 0.00025499, 0.00041831, -0.00000114, 0.00000000],
++		[-6.27317230, -0.00041616, 0.00025495, 0.00041826, -0.00000114, 0.00000000],
++		[-6.27317243, -0.00041610, 0.00025492, 0.00041820, -0.00000114, 0.00000000],
++		[-6.27317256, -0.00041605, 0.00025488, 0.00041814, -0.00000114, 0.00000000],
++		[-6.27317270, -0.00041599, 0.00025485, 0.00041809, -0.00000114, 0.00000000],
++		[-6.27317283, -0.00041594, 0.00025482, 0.00041803, -0.00000114, 0.00000000],
++		[-6.27317297, -0.00041588, 0.00025478, 0.00041798, -0.00000114, 0.00000000],
++		[-6.27317310, -0.00041582, 0.00025475, 0.00041792, -0.00000115, 0.00000000],
++		[-6.27317323, -0.00041577, 0.00025471, 0.00041786, -0.00000115, 0.00000000],
++		[-6.27317337, -0.00041571, 0.00025468, 0.00041781, -0.00000115, 0.00000000],
++		[-6.27317350, -0.00041566, 0.00025465, 0.00041775, -0.00000115, 0.00000000],
++		[-6.27317363, -0.00041560, 0.00025461, 0.00041770, -0.00000115, 0.00000000],
++		[-6.27317377, -0.00041554, 0.00025458, 0.00041764, -0.00000115, 0.00000000],
++		[-6.27317390, -0.00041549, 0.00025454, 0.00041758, -0.00000115, 0.00000000],
++		[-6.27317403, -0.00041543, 0.00025451, 0.00041753, -0.00000115, 0.00000000],
++		[-6.27317417, -0.00041538, 0.00025447, 0.00041747, -0.00000115, 0.00000000],
++		[-6.27317430, -0.00041532, 0.00025444, 0.00041742, -0.00000115, 0.00000000],
++		[-6.27317443, -0.00041527, 0.00025441, 0.00041736, -0.00000115, 0.00000000],
++		[-6.27317457, -0.00041521, 0.00025437, 0.00041730, -0.00000115, 0.00000000],
++		[-6.27317470, -0.00041515, 0.00025434, 0.00041725, -0.00000115, 0.00000000],
++		[-6.27317483, -0.00041510, 0.00025430, 0.00041719, -0.00000115, 0.00000000],
++		[-6.27317497, -0.00041504, 0.00025427, 0.00041714, -0.00000115, 0.00000000],
++		[-6.27317510, -0.00041499, 0.00025424, 0.00041708, -0.00000115, 0.00000000],
++		[-6.27317523, -0.00041493, 0.00025420, 0.00041702, -0.00000115, 0.00000000],
++		[-6.27317537, -0.00041488, 0.00025417, 0.00041697, -0.00000115, 0.00000000],
++		[-6.27317550, -0.00041482, 0.00025413, 0.00041691, -0.00000115, 0.00000000],
++		[-6.27317563, -0.00041476, 0.00025410, 0.00041686, -0.00000115, 0.00000000],
++		[-6.27317577, -0.00041471, 0.00025406, 0.00041680, -0.00000115, 0.00000000],
++		[-6.27317590, -0.00041465, 0.00025403, 0.00041674, -0.00000115, 0.00000000],
++		[-6.27317603, -0.00041460, 0.00025400, 0.00041669, -0.00000115, 0.00000000],
++		[-6.27317616, -0.00041454, 0.00025396, 0.00041663, -0.00000115, 0.00000000],
++		[-6.27317630, -0.00041449, 0.00025393, 0.00041658, -0.00000115, 0.00000000],
++		[-6.27317643, -0.00041443, 0.00025389, 0.00041652, -0.00000115, 0.00000000],
++		[-6.27317656, -0.00041438, 0.00025386, 0.00041647, -0.00000115, 0.00000000],
++		[-6.27317670, -0.00041432, 0.00025383, 0.00041641, -0.00000115, 0.00000000],
++		[-6.27317683, -0.00041427, 0.00025379, 0.00041635, -0.00000115, 0.00000000],
++		[-6.27317696, -0.00041421, 0.00025376, 0.00041630, -0.00000115, 0.00000000],
++		[-6.27317709, -0.00041415, 0.00025372, 0.00041624, -0.00000115, 0.00000000],
++		[-6.27317723, -0.00041410, 0.00025369, 0.00041619, -0.00000115, 0.00000000],
++		[-6.27317736, -0.00041404, 0.00025366, 0.00041613, -0.00000115, 0.00000000],
++		[-6.27317749, -0.00041399, 0.00025362, 0.00041608, -0.00000115, 0.00000000],
++		[-6.27317762, -0.00041393, 0.00025359, 0.00041602, -0.00000115, 0.00000000],
++		[-6.27317776, -0.00041388, 0.00025355, 0.00041596, -0.00000115, 0.00000000],
++		[-6.27317789, -0.00041382, 0.00025352, 0.00041591, -0.00000115, 0.00000000],
++		[-6.27317802, -0.00041377, 0.00025349, 0.00041585, -0.00000115, 0.00000000],
++		[-6.27317815, -0.00041371, 0.00025345, 0.00041580, -0.00000115, 0.00000000],
++		[-6.27317829, -0.00041366, 0.00025342, 0.00041574, -0.00000115, 0.00000000],
++		[-6.27317842, -0.00041360, 0.00025339, 0.00041569, -0.00000115, 0.00000000],
++		[-6.27317855, -0.00041355, 0.00025335, 0.00041563, -0.00000115, 0.00000000],
++		[-6.27317868, -0.00041349, 0.00025332, 0.00041558, -0.00000115, 0.00000000],
++		[-6.27317882, -0.00041344, 0.00025328, 0.00041552, -0.00000115, 0.00000000],
++		[-6.27317895, -0.00041338, 0.00025325, 0.00041546, -0.00000115, 0.00000000],
++		[-6.27317908, -0.00041333, 0.00025322, 0.00041541, -0.00000115, 0.00000000],
++		[-6.27317921, -0.00041327, 0.00025318, 0.00041535, -0.00000115, 0.00000000],
++		[-6.27317934, -0.00041321, 0.00025315, 0.00041530, -0.00000115, 0.00000000],
++		[-6.27317948, -0.00041316, 0.00025311, 0.00041524, -0.00000115, 0.00000000],
++		[-6.27317961, -0.00041310, 0.00025308, 0.00041519, -0.00000115, 0.00000000],
++		[-6.27317974, -0.00041305, 0.00025305, 0.00041513, -0.00000115, 0.00000000],
++		[-6.27317987, -0.00041299, 0.00025301, 0.00041508, -0.00000115, 0.00000000],
++		[-6.27318000, -0.00041294, 0.00025298, 0.00041502, -0.00000115, 0.00000000],
++		[-6.27318014, -0.00041288, 0.00025295, 0.00041497, -0.00000115, 0.00000000],
++		[-6.27318027, -0.00041283, 0.00025291, 0.00041491, -0.00000115, 0.00000000],
++		[-6.27318040, -0.00041277, 0.00025288, 0.00041485, -0.00000115, 0.00000000],
++		[-6.27318053, -0.00041272, 0.00025284, 0.00041480, -0.00000115, 0.00000000],
++		[-6.27318066, -0.00041266, 0.00025281, 0.00041474, -0.00000115, 0.00000000],
++		[-6.27318079, -0.00041261, 0.00025278, 0.00041469, -0.00000115, 0.00000000],
++		[-6.27318093, -0.00041255, 0.00025274, 0.00041463, -0.00000115, 0.00000000],
++		[-6.27318106, -0.00041250, 0.00025271, 0.00041458, -0.00000115, 0.00000000],
++		[-6.27318119, -0.00041244, 0.00025268, 0.00041452, -0.00000115, 0.00000000],
++		[-6.27318132, -0.00041239, 0.00025264, 0.00041447, -0.00000115, 0.00000000],
++		[-6.27318145, -0.00041233, 0.00025261, 0.00041441, -0.00000115, 0.00000000],
++		[-6.27318158, -0.00041228, 0.00025258, 0.00041436, -0.00000115, 0.00000000],
++		[-6.27318171, -0.00041222, 0.00025254, 0.00041430, -0.00000115, 0.00000000],
++		[-6.27318185, -0.00041217, 0.00025251, 0.00041425, -0.00000115, 0.00000000],
++		[-6.27318198, -0.00041211, 0.00025247, 0.00041419, -0.00000115, 0.00000000],
++		[-6.27318211, -0.00041206, 0.00025244, 0.00041414, -0.00000115, 0.00000000],
++		[-6.27318224, -0.00041200, 0.00025241, 0.00041408, -0.00000115, 0.00000000],
++		[-6.27318237, -0.00041195, 0.00025237, 0.00041403, -0.00000115, 0.00000000],
++		[-6.27318250, -0.00041190, 0.00025234, 0.00041397, -0.00000115, 0.00000000],
++		[-6.27318263, -0.00041184, 0.00025231, 0.00041392, -0.00000115, 0.00000000],
++		[-6.27318276, -0.00041179, 0.00025227, 0.00041386, -0.00000115, 0.00000000],
++		[-6.27318290, -0.00041173, 0.00025224, 0.00041381, -0.00000115, 0.00000000],
++		[-6.27318303, -0.00041168, 0.00025221, 0.00041375, -0.00000115, 0.00000000],
++		[-6.27318316, -0.00041162, 0.00025217, 0.00041370, -0.00000115, 0.00000000],
++		[-6.27318329, -0.00041157, 0.00025214, 0.00041364, -0.00000115, 0.00000000],
++		[-6.27318342, -0.00041151, 0.00025210, 0.00041359, -0.00000115, 0.00000000],
++		[-6.27318355, -0.00041146, 0.00025207, 0.00041353, -0.00000115, 0.00000000],
++		[-6.27318368, -0.00041140, 0.00025204, 0.00041348, -0.00000115, 0.00000000],
++		[-6.27318381, -0.00041135, 0.00025200, 0.00041342, -0.00000115, 0.00000000],
++		[-6.27318394, -0.00041129, 0.00025197, 0.00041337, -0.00000115, 0.00000000],
++		[-6.27318407, -0.00041124, 0.00025194, 0.00041331, -0.00000115, 0.00000000],
++		[-6.27318420, -0.00041118, 0.00025190, 0.00041326, -0.00000115, 0.00000000],
++		[-6.27318434, -0.00041113, 0.00025187, 0.00041320, -0.00000115, 0.00000000],
++		[-6.27318447, -0.00041107, 0.00025184, 0.00041315, -0.00000115, 0.00000000],
++		[-6.27318460, -0.00041102, 0.00025180, 0.00041309, -0.00000115, 0.00000000],
++		[-6.27318473, -0.00041097, 0.00025177, 0.00041304, -0.00000115, 0.00000000],
++		[-6.27318486, -0.00041091, 0.00025174, 0.00041298, -0.00000115, 0.00000000],
++		[-6.27318499, -0.00041086, 0.00025170, 0.00041293, -0.00000115, 0.00000000],
++		[-6.27318512, -0.00041080, 0.00025167, 0.00041287, -0.00000115, 0.00000000],
++		[-6.27318525, -0.00041075, 0.00025164, 0.00041282, -0.00000115, 0.00000000],
++		[-6.27318538, -0.00041069, 0.00025160, 0.00041276, -0.00000115, 0.00000000],
++		[-6.27318551, -0.00041064, 0.00025157, 0.00041271, -0.00000115, 0.00000000],
++		[-6.27318564, -0.00041058, 0.00025154, 0.00041265, -0.00000115, 0.00000000],
++		[-6.27318577, -0.00041053, 0.00025150, 0.00041260, -0.00000115, 0.00000000],
++		[-6.27318590, -0.00041048, 0.00025147, 0.00041254, -0.00000115, 0.00000000],
++		[-6.27318603, -0.00041042, 0.00025144, 0.00041249, -0.00000115, 0.00000000],
++		[-6.27318616, -0.00041037, 0.00025140, 0.00041243, -0.00000115, 0.00000000],
++		[-6.27318629, -0.00041031, 0.00025137, 0.00041238, -0.00000115, 0.00000000],
++		[-6.27318642, -0.00041026, 0.00025134, 0.00041233, -0.00000115, 0.00000000],
++		[-6.27318655, -0.00041020, 0.00025130, 0.00041227, -0.00000115, 0.00000000],
++		[-6.27318668, -0.00041015, 0.00025127, 0.00041222, -0.00000115, 0.00000000],
++		[-6.27318681, -0.00041009, 0.00025124, 0.00041216, -0.00000115, 0.00000000],
++		[-6.27318694, -0.00041004, 0.00025120, 0.00041211, -0.00000115, 0.00000000],
++		[-6.27318707, -0.00040999, 0.00025117, 0.00041205, -0.00000115, 0.00000000],
++		[-6.27318720, -0.00040993, 0.00025114, 0.00041200, -0.00000115, 0.00000000],
++		[-6.27318733, -0.00040988, 0.00025110, 0.00041194, -0.00000115, 0.00000000],
++		[-6.27318746, -0.00040982, 0.00025107, 0.00041189, -0.00000115, 0.00000000],
++		[-6.27318759, -0.00040977, 0.00025104, 0.00041183, -0.00000115, 0.00000000],
++		[-6.27318772, -0.00040971, 0.00025100, 0.00041178, -0.00000115, 0.00000000],
++		[-6.27318785, -0.00040966, 0.00025097, 0.00041173, -0.00000115, 0.00000000],
++		[-6.27318798, -0.00040961, 0.00025094, 0.00041167, -0.00000115, 0.00000000],
++		[-6.27318811, -0.00040955, 0.00025090, 0.00041162, -0.00000115, 0.00000000],
++		[-6.27318824, -0.00040950, 0.00025087, 0.00041156, -0.00000115, 0.00000000],
++		[-6.27318837, -0.00040944, 0.00025084, 0.00041151, -0.00000115, 0.00000000],
++		[-6.27318850, -0.00040939, 0.00025080, 0.00041145, -0.00000115, 0.00000000],
++		[-6.27318863, -0.00040934, 0.00025077, 0.00041140, -0.00000115, 0.00000000],
++		[-6.27318876, -0.00040928, 0.00025074, 0.00041134, -0.00000115, 0.00000000],
++		[-6.27318889, -0.00040923, 0.00025070, 0.00041129, -0.00000115, 0.00000000],
++		[-6.27318902, -0.00040917, 0.00025067, 0.00041124, -0.00000115, 0.00000000],
++		[-6.27318915, -0.00040912, 0.00025064, 0.00041118, -0.00000115, 0.00000000],
++		[-6.27318928, -0.00040906, 0.00025060, 0.00041113, -0.00000115, 0.00000000],
++		[-6.27318941, -0.00040901, 0.00025057, 0.00041107, -0.00000115, 0.00000000],
++		[-6.27318954, -0.00040896, 0.00025054, 0.00041102, -0.00000115, 0.00000000],
++		[-6.27318967, -0.00040890, 0.00025051, 0.00041096, -0.00000115, 0.00000000],
++		[-6.27318979, -0.00040885, 0.00025047, 0.00041091, -0.00000115, 0.00000000],
++		[-6.27318992, -0.00040879, 0.00025044, 0.00041086, -0.00000115, 0.00000000],
++		[-6.27319005, -0.00040874, 0.00025041, 0.00041080, -0.00000115, 0.00000000],
++		[-6.27319018, -0.00040869, 0.00025037, 0.00041075, -0.00000115, 0.00000000],
++		[-6.27319031, -0.00040863, 0.00025034, 0.00041069, -0.00000115, 0.00000000],
++		[-6.27319044, -0.00040858, 0.00025031, 0.00041064, -0.00000115, 0.00000000],
++		[-6.27319057, -0.00040852, 0.00025027, 0.00041058, -0.00000115, 0.00000000],
++		[-6.27319070, -0.00040847, 0.00025024, 0.00041053, -0.00000115, 0.00000000],
++		[-6.27319083, -0.00040842, 0.00025021, 0.00041048, -0.00000115, 0.00000000],
++		[-6.27319096, -0.00040836, 0.00025017, 0.00041042, -0.00000115, 0.00000000],
++		[-6.27319109, -0.00040831, 0.00025014, 0.00041037, -0.00000115, 0.00000000],
++		[-6.27319121, -0.00040826, 0.00025011, 0.00041031, -0.00000115, 0.00000000],
++		[-6.27319134, -0.00040820, 0.00025008, 0.00041026, -0.00000115, 0.00000000],
++		[-6.27319147, -0.00040815, 0.00025004, 0.00041021, -0.00000115, 0.00000000],
++		[-6.27319160, -0.00040809, 0.00025001, 0.00041015, -0.00000115, 0.00000000],
++		[-6.27319173, -0.00040804, 0.00024998, 0.00041010, -0.00000115, 0.00000000],
++		[-6.27319186, -0.00040799, 0.00024994, 0.00041004, -0.00000115, 0.00000000],
++		[-6.27319199, -0.00040793, 0.00024991, 0.00040999, -0.00000115, 0.00000000],
++		[-6.27319212, -0.00040788, 0.00024988, 0.00040993, -0.00000115, 0.00000000],
++		[-6.27319224, -0.00040783, 0.00024985, 0.00040988, -0.00000115, 0.00000000],
++		[-6.27319237, -0.00040777, 0.00024981, 0.00040983, -0.00000115, 0.00000000],
++		[-6.27319250, -0.00040772, 0.00024978, 0.00040977, -0.00000115, 0.00000000],
++		[-6.27319263, -0.00040766, 0.00024975, 0.00040972, -0.00000115, 0.00000000],
++		[-6.27319276, -0.00040761, 0.00024971, 0.00040966, -0.00000115, 0.00000000],
++		[-6.27319289, -0.00040756, 0.00024968, 0.00040961, -0.00000115, 0.00000000],
++		[-6.27319302, -0.00040750, 0.00024965, 0.00040956, -0.00000115, 0.00000000],
++		[-6.27319314, -0.00040745, 0.00024961, 0.00040950, -0.00000115, 0.00000000],
++		[-6.27319327, -0.00040740, 0.00024958, 0.00040945, -0.00000115, 0.00000000],
++		[-6.27319340, -0.00040734, 0.00024955, 0.00040940, -0.00000115, 0.00000000],
++		[-6.27319353, -0.00040729, 0.00024952, 0.00040934, -0.00000115, 0.00000000],
++		[-6.27319366, -0.00040724, 0.00024948, 0.00040929, -0.00000115, 0.00000000],
++		[-6.27319379, -0.00040718, 0.00024945, 0.00040923, -0.00000115, 0.00000000],
++		[-6.27319391, -0.00040713, 0.00024942, 0.00040918, -0.00000115, 0.00000000],
++		[-6.27319404, -0.00040707, 0.00024938, 0.00040913, -0.00000115, 0.00000000],
++		[-6.27319417, -0.00040702, 0.00024935, 0.00040907, -0.00000115, 0.00000000],
++		[-6.27319430, -0.00040697, 0.00024932, 0.00040902, -0.00000115, 0.00000000],
++		[-6.27319443, -0.00040691, 0.00024929, 0.00040896, -0.00000115, 0.00000000],
++		[-6.27319455, -0.00040686, 0.00024925, 0.00040891, -0.00000115, 0.00000000],
++		[-6.27319468, -0.00040681, 0.00024922, 0.00040886, -0.00000115, 0.00000000],
++		[-6.27319481, -0.00040675, 0.00024919, 0.00040880, -0.00000115, 0.00000000],
++		[-6.27319494, -0.00040670, 0.00024916, 0.00040875, -0.00000115, 0.00000000],
++		[-6.27319507, -0.00040665, 0.00024912, 0.00040870, -0.00000115, 0.00000000],
++		[-6.27319519, -0.00040659, 0.00024909, 0.00040864, -0.00000115, 0.00000000],
++		[-6.27319532, -0.00040654, 0.00024906, 0.00040859, -0.00000115, 0.00000000],
++		[-6.27319545, -0.00040649, 0.00024902, 0.00040854, -0.00000115, 0.00000000],
++		[-6.27319558, -0.00040643, 0.00024899, 0.00040848, -0.00000115, 0.00000000],
++		[-6.27319571, -0.00040638, 0.00024896, 0.00040843, -0.00000115, 0.00000000],
++		[-6.27319583, -0.00040633, 0.00024893, 0.00040837, -0.00000115, 0.00000000],
++		[-6.27319596, -0.00040627, 0.00024889, 0.00040832, -0.00000115, 0.00000000],
++		[-6.27319609, -0.00040622, 0.00024886, 0.00040827, -0.00000115, 0.00000000],
++		[-6.27319622, -0.00040617, 0.00024883, 0.00040821, -0.00000115, 0.00000000],
++		[-6.27319634, -0.00040611, 0.00024880, 0.00040816, -0.00000115, 0.00000000],
++		[-6.27319647, -0.00040606, 0.00024876, 0.00040811, -0.00000115, 0.00000000],
++		[-6.27319660, -0.00040601, 0.00024873, 0.00040805, -0.00000115, 0.00000000],
++		[-6.27319673, -0.00040595, 0.00024870, 0.00040800, -0.00000115, 0.00000000],
++		[-6.27319685, -0.00040590, 0.00024867, 0.00040795, -0.00000115, 0.00000000],
++		[-6.27319698, -0.00040585, 0.00024863, 0.00040789, -0.00000115, 0.00000000],
++		[-6.27319711, -0.00040579, 0.00024860, 0.00040784, -0.00000115, 0.00000000],
++		[-6.27319724, -0.00040574, 0.00024857, 0.00040779, -0.00000115, 0.00000000],
++		[-6.27319736, -0.00040569, 0.00024853, 0.00040773, -0.00000115, 0.00000000],
++		[-6.27319749, -0.00040563, 0.00024850, 0.00040768, -0.00000115, 0.00000000],
++		[-6.27319762, -0.00040558, 0.00024847, 0.00040763, -0.00000115, 0.00000000],
++		[-6.27319774, -0.00040553, 0.00024844, 0.00040757, -0.00000115, 0.00000000],
++		[-6.27319787, -0.00040547, 0.00024840, 0.00040752, -0.00000115, 0.00000000],
++		[-6.27319800, -0.00040542, 0.00024837, 0.00040746, -0.00000115, 0.00000000],
++		[-6.27319813, -0.00040537, 0.00024834, 0.00040741, -0.00000115, 0.00000000],
++		[-6.27319825, -0.00040532, 0.00024831, 0.00040736, -0.00000115, 0.00000000],
++		[-6.27319838, -0.00040526, 0.00024827, 0.00040730, -0.00000115, 0.00000000],
++		[-6.27319851, -0.00040521, 0.00024824, 0.00040725, -0.00000115, 0.00000000],
++		[-6.27319863, -0.00040516, 0.00024821, 0.00040720, -0.00000115, 0.00000000],
++		[-6.27319876, -0.00040510, 0.00024818, 0.00040714, -0.00000115, 0.00000000],
++		[-6.27319889, -0.00040505, 0.00024814, 0.00040709, -0.00000115, 0.00000000],
++		[-6.27319901, -0.00040500, 0.00024811, 0.00040704, -0.00000115, 0.00000000],
++		[-6.27319914, -0.00040494, 0.00024808, 0.00040699, -0.00000115, 0.00000000],
++		[-6.27319927, -0.00040489, 0.00024805, 0.00040693, -0.00000115, 0.00000000],
++		[-6.27319939, -0.00040484, 0.00024801, 0.00040688, -0.00000115, 0.00000000],
++		[-6.27319952, -0.00040479, 0.00024798, 0.00040683, -0.00000115, 0.00000000],
++		[-6.27319965, -0.00040473, 0.00024795, 0.00040677, -0.00000115, 0.00000000],
++		[-6.27319977, -0.00040468, 0.00024792, 0.00040672, -0.00000115, 0.00000000],
++		[-6.27319990, -0.00040463, 0.00024788, 0.00040667, -0.00000115, 0.00000000],
++		[-6.27320003, -0.00040457, 0.00024785, 0.00040661, -0.00000115, 0.00000000],
++		[-6.27320015, -0.00040452, 0.00024782, 0.00040656, -0.00000115, 0.00000000],
++		[-6.27320028, -0.00040447, 0.00024779, 0.00040651, -0.00000115, 0.00000000],
++		[-6.27320041, -0.00040442, 0.00024776, 0.00040645, -0.00000115, 0.00000000],
++		[-6.27320053, -0.00040436, 0.00024772, 0.00040640, -0.00000115, 0.00000000],
++		[-6.27320066, -0.00040431, 0.00024769, 0.00040635, -0.00000115, 0.00000000],
++		[-6.27320079, -0.00040426, 0.00024766, 0.00040629, -0.00000115, 0.00000000],
++		[-6.27320091, -0.00040420, 0.00024763, 0.00040624, -0.00000115, 0.00000000],
++		[-6.27320104, -0.00040415, 0.00024759, 0.00040619, -0.00000115, 0.00000000],
++		[-6.27320117, -0.00040410, 0.00024756, 0.00040613, -0.00000115, 0.00000000],
++		[-6.27320129, -0.00040405, 0.00024753, 0.00040608, -0.00000115, 0.00000000],
++		[-6.27320142, -0.00040399, 0.00024750, 0.00040603, -0.00000115, 0.00000000],
++		[-6.27320154, -0.00040394, 0.00024746, 0.00040598, -0.00000115, 0.00000000],
++		[-6.27320167, -0.00040389, 0.00024743, 0.00040592, -0.00000115, 0.00000000],
++		[-6.27320180, -0.00040383, 0.00024740, 0.00040587, -0.00000115, 0.00000000],
++		[-6.27320192, -0.00040378, 0.00024737, 0.00040582, -0.00000115, 0.00000000],
++		[-6.27320205, -0.00040373, 0.00024733, 0.00040576, -0.00000115, 0.00000000],
++		[-6.27320217, -0.00040368, 0.00024730, 0.00040571, -0.00000115, 0.00000000],
++		[-6.27320230, -0.00040362, 0.00024727, 0.00040566, -0.00000115, 0.00000000],
++		[-6.27320243, -0.00040357, 0.00024724, 0.00040561, -0.00000115, 0.00000000],
++		[-6.27320255, -0.00040352, 0.00024721, 0.00040555, -0.00000115, 0.00000000],
++		[-6.27320268, -0.00040347, 0.00024717, 0.00040550, -0.00000115, 0.00000000],
++		[-6.27320280, -0.00040341, 0.00024714, 0.00040545, -0.00000115, 0.00000000],
++		[-6.27320293, -0.00040336, 0.00024711, 0.00040539, -0.00000115, 0.00000000],
++		[-6.27320306, -0.00040331, 0.00024708, 0.00040534, -0.00000115, 0.00000000],
++		[-6.27320318, -0.00040326, 0.00024704, 0.00040529, -0.00000115, 0.00000000],
++		[-6.27320331, -0.00040320, 0.00024701, 0.00040524, -0.00000115, 0.00000000],
++		[-6.27320343, -0.00040315, 0.00024698, 0.00040518, -0.00000115, 0.00000000],
++		[-6.27320356, -0.00040310, 0.00024695, 0.00040513, -0.00000115, 0.00000000],
++		[-6.27320368, -0.00040305, 0.00024692, 0.00040508, -0.00000115, 0.00000000],
++		[-6.27320381, -0.00040299, 0.00024688, 0.00040502, -0.00000115, 0.00000000],
++		[-6.27320394, -0.00040294, 0.00024685, 0.00040497, -0.00000115, 0.00000000],
++		[-6.27320406, -0.00040289, 0.00024682, 0.00040492, -0.00000115, 0.00000000],
++		[-6.27320419, -0.00040284, 0.00024679, 0.00040487, -0.00000115, 0.00000000],
++		[-6.27320431, -0.00040278, 0.00024676, 0.00040481, -0.00000115, 0.00000000],
++		[-6.27320444, -0.00040273, 0.00024672, 0.00040476, -0.00000115, 0.00000000],
++		[-6.27320456, -0.00040268, 0.00024669, 0.00040471, -0.00000115, 0.00000000],
++		[-6.27320469, -0.00040263, 0.00024666, 0.00040466, -0.00000115, 0.00000000],
++		[-6.27320481, -0.00040257, 0.00024663, 0.00040460, -0.00000115, 0.00000000],
++		[-6.27320494, -0.00040252, 0.00024659, 0.00040455, -0.00000115, 0.00000000],
++		[-6.27320506, -0.00040247, 0.00024656, 0.00040450, -0.00000115, 0.00000000],
++		[-6.27320519, -0.00040242, 0.00024653, 0.00040445, -0.00000115, 0.00000000],
++		[-6.27320532, -0.00040237, 0.00024650, 0.00040439, -0.00000115, 0.00000000],
++		[-6.27320544, -0.00040231, 0.00024647, 0.00040434, -0.00000115, 0.00000000],
++		[-6.27320557, -0.00040226, 0.00024643, 0.00040429, -0.00000115, 0.00000000],
++		[-6.27320569, -0.00040221, 0.00024640, 0.00040424, -0.00000115, 0.00000000],
++		[-6.27320582, -0.00040216, 0.00024637, 0.00040418, -0.00000115, 0.00000000],
++		[-6.27320594, -0.00040210, 0.00024634, 0.00040413, -0.00000115, 0.00000000],
++		[-6.27320607, -0.00040205, 0.00024631, 0.00040408, -0.00000115, 0.00000000],
++		[-6.27320619, -0.00040200, 0.00024627, 0.00040403, -0.00000115, 0.00000000],
++		[-6.27320632, -0.00040195, 0.00024624, 0.00040397, -0.00000115, 0.00000000],
++		[-6.27320644, -0.00040190, 0.00024621, 0.00040392, -0.00000115, 0.00000000],
++		[-6.27320657, -0.00040184, 0.00024618, 0.00040387, -0.00000115, 0.00000000],
++		[-6.27320669, -0.00040179, 0.00024615, 0.00040382, -0.00000115, 0.00000000],
++		[-6.27320682, -0.00040174, 0.00024611, 0.00040376, -0.00000115, 0.00000000],
++		[-6.27320694, -0.00040169, 0.00024608, 0.00040371, -0.00000115, 0.00000000],
++		[-6.27320706, -0.00040163, 0.00024605, 0.00040366, -0.00000115, 0.00000000],
++		[-6.27320719, -0.00040158, 0.00024602, 0.00040361, -0.00000115, 0.00000000],
++		[-6.27320731, -0.00040153, 0.00024599, 0.00040355, -0.00000115, 0.00000000],
++		[-6.27320744, -0.00040148, 0.00024595, 0.00040350, -0.00000115, 0.00000000],
++		[-6.27320756, -0.00040143, 0.00024592, 0.00040345, -0.00000115, 0.00000000],
++		[-6.27320769, -0.00040137, 0.00024589, 0.00040340, -0.00000115, 0.00000000],
++		[-6.27320781, -0.00040132, 0.00024586, 0.00040334, -0.00000115, 0.00000000],
++		[-6.27320794, -0.00040127, 0.00024583, 0.00040329, -0.00000115, 0.00000000],
++		[-6.27320806, -0.00040122, 0.00024580, 0.00040324, -0.00000115, 0.00000000],
++		[-6.27320819, -0.00040117, 0.00024576, 0.00040319, -0.00000115, 0.00000000],
++		[-6.27320831, -0.00040111, 0.00024573, 0.00040313, -0.00000115, 0.00000000],
++		[-6.27320843, -0.00040106, 0.00024570, 0.00040308, -0.00000115, 0.00000000],
++		[-6.27320856, -0.00040101, 0.00024567, 0.00040303, -0.00000115, 0.00000000],
++		[-6.27320868, -0.00040096, 0.00024564, 0.00040298, -0.00000115, 0.00000000],
++		[-6.27320881, -0.00040091, 0.00024560, 0.00040293, -0.00000115, 0.00000000],
++		[-6.27320893, -0.00040085, 0.00024557, 0.00040287, -0.00000115, 0.00000000],
++		[-6.27320906, -0.00040080, 0.00024554, 0.00040282, -0.00000115, 0.00000000],
++		[-6.27320918, -0.00040075, 0.00024551, 0.00040277, -0.00000115, 0.00000000],
++		[-6.27320930, -0.00040070, 0.00024548, 0.00040272, -0.00000115, 0.00000000],
++		[-6.27320943, -0.00040065, 0.00024545, 0.00040267, -0.00000115, 0.00000000],
++		[-6.27320955, -0.00040059, 0.00024541, 0.00040261, -0.00000115, 0.00000000],
++		[-6.27320968, -0.00040054, 0.00024538, 0.00040256, -0.00000115, 0.00000000],
++		[-6.27320980, -0.00040049, 0.00024535, 0.00040251, -0.00000115, 0.00000000],
++		[-6.27320993, -0.00040044, 0.00024532, 0.00040246, -0.00000115, 0.00000000],
++		[-6.27321005, -0.00040039, 0.00024529, 0.00040240, -0.00000115, 0.00000000],
++		[-6.27321017, -0.00040034, 0.00024525, 0.00040235, -0.00000115, 0.00000000],
++		[-6.27321030, -0.00040028, 0.00024522, 0.00040230, -0.00000115, 0.00000000],
++		[-6.27321042, -0.00040023, 0.00024519, 0.00040225, -0.00000115, 0.00000000],
++		[-6.27321054, -0.00040018, 0.00024516, 0.00040220, -0.00000115, 0.00000000],
++		[-6.27321067, -0.00040013, 0.00024513, 0.00040214, -0.00000115, 0.00000000],
++		[-6.27321079, -0.00040008, 0.00024510, 0.00040209, -0.00000115, 0.00000000],
++		[-6.27321092, -0.00040003, 0.00024506, 0.00040204, -0.00000115, 0.00000000],
++		[-6.27321104, -0.00039997, 0.00024503, 0.00040199, -0.00000115, 0.00000000],
++		[-6.27321116, -0.00039992, 0.00024500, 0.00040194, -0.00000115, 0.00000000],
++		[-6.27321129, -0.00039987, 0.00024497, 0.00040189, -0.00000115, 0.00000000],
++		[-6.27321141, -0.00039982, 0.00024494, 0.00040183, -0.00000115, 0.00000000],
++		[-6.27321153, -0.00039977, 0.00024491, 0.00040178, -0.00000115, 0.00000000],
++		[-6.27321166, -0.00039972, 0.00024487, 0.00040173, -0.00000115, 0.00000000],
++		[-6.27321178, -0.00039966, 0.00024484, 0.00040168, -0.00000115, 0.00000000],
++		[-6.27321191, -0.00039961, 0.00024481, 0.00040163, -0.00000115, 0.00000000],
++		[-6.27321203, -0.00039956, 0.00024478, 0.00040157, -0.00000115, 0.00000000],
++		[-6.27321215, -0.00039951, 0.00024475, 0.00040152, -0.00000115, 0.00000000],
++		[-6.27321228, -0.00039946, 0.00024472, 0.00040147, -0.00000115, 0.00000000],
++		[-6.27321240, -0.00039941, 0.00024468, 0.00040142, -0.00000115, 0.00000000],
++		[-6.27321252, -0.00039935, 0.00024465, 0.00040137, -0.00000115, 0.00000000],
++		[-6.27321265, -0.00039930, 0.00024462, 0.00040131, -0.00000115, 0.00000000],
++		[-6.27321277, -0.00039925, 0.00024459, 0.00040126, -0.00000115, 0.00000000],
++		[-6.27321289, -0.00039920, 0.00024456, 0.00040121, -0.00000115, 0.00000000],
++		[-6.27321302, -0.00039915, 0.00024453, 0.00040116, -0.00000115, 0.00000000],
++		[-6.27321314, -0.00039910, 0.00024450, 0.00040111, -0.00000115, 0.00000000],
++		[-6.27321326, -0.00039905, 0.00024446, 0.00040106, -0.00000115, 0.00000000],
++		[-6.27321338, -0.00039899, 0.00024443, 0.00040100, -0.00000115, 0.00000000],
++		[-6.27321351, -0.00039894, 0.00024440, 0.00040095, -0.00000115, 0.00000000],
++		[-6.27321363, -0.00039889, 0.00024437, 0.00040090, -0.00000115, 0.00000000],
++		[-6.27321375, -0.00039884, 0.00024434, 0.00040085, -0.00000115, 0.00000000],
++		[-6.27321388, -0.00039879, 0.00024431, 0.00040080, -0.00000115, 0.00000000],
++		[-6.27321400, -0.00039874, 0.00024427, 0.00040075, -0.00000115, 0.00000000],
++		[-6.27321412, -0.00039869, 0.00024424, 0.00040069, -0.00000115, 0.00000000],
++		[-6.27321425, -0.00039863, 0.00024421, 0.00040064, -0.00000115, 0.00000000],
++		[-6.27321437, -0.00039858, 0.00024418, 0.00040059, -0.00000115, 0.00000000],
++		[-6.27321449, -0.00039853, 0.00024415, 0.00040054, -0.00000115, 0.00000000],
++		[-6.27321461, -0.00039848, 0.00024412, 0.00040049, -0.00000115, 0.00000000],
++		[-6.27321474, -0.00039843, 0.00024409, 0.00040044, -0.00000115, 0.00000000],
++		[-6.27321486, -0.00039838, 0.00024405, 0.00040039, -0.00000115, 0.00000000],
++		[-6.27321498, -0.00039833, 0.00024402, 0.00040033, -0.00000115, 0.00000000],
++		[-6.27321511, -0.00039828, 0.00024399, 0.00040028, -0.00000115, 0.00000000],
++		[-6.27321523, -0.00039822, 0.00024396, 0.00040023, -0.00000115, 0.00000000],
++		[-6.27321535, -0.00039817, 0.00024393, 0.00040018, -0.00000115, 0.00000000],
++		[-6.27321547, -0.00039812, 0.00024390, 0.00040013, -0.00000115, 0.00000000],
++		[-6.27321560, -0.00039807, 0.00024387, 0.00040008, -0.00000115, 0.00000000],
++		[-6.27321572, -0.00039802, 0.00024383, 0.00040002, -0.00000115, 0.00000000],
++		[-6.27321584, -0.00039797, 0.00024380, 0.00039997, -0.00000115, 0.00000000],
++		[-6.27321596, -0.00039792, 0.00024377, 0.00039992, -0.00000115, 0.00000000],
++		[-6.27321609, -0.00039787, 0.00024374, 0.00039987, -0.00000115, 0.00000000],
++		[-6.27321621, -0.00039781, 0.00024371, 0.00039982, -0.00000115, 0.00000000],
++		[-6.27321633, -0.00039776, 0.00024368, 0.00039977, -0.00000115, 0.00000000],
++		[-6.27321645, -0.00039771, 0.00024365, 0.00039972, -0.00000115, 0.00000000],
++		[-6.27321658, -0.00039766, 0.00024362, 0.00039966, -0.00000115, 0.00000000],
++		[-6.27321670, -0.00039761, 0.00024358, 0.00039961, -0.00000115, 0.00000000],
++		[-6.27321682, -0.00039756, 0.00024355, 0.00039956, -0.00000115, 0.00000000],
++		[-6.27321694, -0.00039751, 0.00024352, 0.00039951, -0.00000115, 0.00000000],
++		[-6.27321706, -0.00039746, 0.00024349, 0.00039946, -0.00000115, 0.00000000],
++		[-6.27321719, -0.00039741, 0.00024346, 0.00039941, -0.00000115, 0.00000000],
++		[-6.27321731, -0.00039736, 0.00024343, 0.00039936, -0.00000115, 0.00000000],
++		[-6.27321743, -0.00039730, 0.00024340, 0.00039931, -0.00000115, 0.00000000],
++		[-6.27321755, -0.00039725, 0.00024337, 0.00039925, -0.00000115, 0.00000000],
++		[-6.27321767, -0.00039720, 0.00024333, 0.00039920, -0.00000115, 0.00000000],
++		[-6.27321780, -0.00039715, 0.00024330, 0.00039915, -0.00000115, 0.00000000],
++		[-6.27321792, -0.00039710, 0.00024327, 0.00039910, -0.00000115, 0.00000000],
++		[-6.27321804, -0.00039705, 0.00024324, 0.00039905, -0.00000115, 0.00000000],
++		[-6.27321816, -0.00039700, 0.00024321, 0.00039900, -0.00000115, 0.00000000],
++		[-6.27321828, -0.00039695, 0.00024318, 0.00039895, -0.00000115, 0.00000000],
++		[-6.27321841, -0.00039690, 0.00024315, 0.00039890, -0.00000115, 0.00000000],
++		[-6.27321853, -0.00039685, 0.00024312, 0.00039884, -0.00000115, 0.00000000],
++		[-6.27321865, -0.00039680, 0.00024308, 0.00039879, -0.00000115, 0.00000000],
++		[-6.27321877, -0.00039674, 0.00024305, 0.00039874, -0.00000115, 0.00000000],
++		[-6.27321889, -0.00039669, 0.00024302, 0.00039869, -0.00000115, 0.00000000],
++		[-6.27321901, -0.00039664, 0.00024299, 0.00039864, -0.00000115, 0.00000000],
++		[-6.27321914, -0.00039659, 0.00024296, 0.00039859, -0.00000115, 0.00000000],
++		[-6.27321926, -0.00039654, 0.00024293, 0.00039854, -0.00000115, 0.00000000],
++		[-6.27321938, -0.00039649, 0.00024290, 0.00039849, -0.00000115, 0.00000000],
++		[-6.27321950, -0.00039644, 0.00024287, 0.00039844, -0.00000115, 0.00000000],
++		[-6.27321962, -0.00039639, 0.00024284, 0.00039839, -0.00000115, 0.00000000],
++		[-6.27321974, -0.00039634, 0.00024280, 0.00039833, -0.00000115, 0.00000000],
++		[-6.27321987, -0.00039629, 0.00024277, 0.00039828, -0.00000115, 0.00000000],
++		[-6.27321999, -0.00039624, 0.00024274, 0.00039823, -0.00000115, 0.00000000],
++		[-6.27322011, -0.00039619, 0.00024271, 0.00039818, -0.00000115, 0.00000000],
++		[-6.27322023, -0.00039613, 0.00024268, 0.00039813, -0.00000115, 0.00000000],
++		[-6.27322035, -0.00039608, 0.00024265, 0.00039808, -0.00000115, 0.00000000],
++		[-6.27322047, -0.00039603, 0.00024262, 0.00039803, -0.00000115, 0.00000000],
++		[-6.27322059, -0.00039598, 0.00024259, 0.00039798, -0.00000115, 0.00000000],
++		[-6.27322071, -0.00039593, 0.00024256, 0.00039793, -0.00000115, 0.00000000],
++		[-6.27322084, -0.00039588, 0.00024252, 0.00039788, -0.00000115, 0.00000000],
++		[-6.27322096, -0.00039583, 0.00024249, 0.00039782, -0.00000115, 0.00000000],
++		[-6.27322108, -0.00039578, 0.00024246, 0.00039777, -0.00000115, 0.00000000],
++		[-6.27322120, -0.00039573, 0.00024243, 0.00039772, -0.00000115, 0.00000000],
++		[-6.27322132, -0.00039568, 0.00024240, 0.00039767, -0.00000115, 0.00000000],
++		[-6.27322144, -0.00039563, 0.00024237, 0.00039762, -0.00000115, 0.00000000],
++		[-6.27322156, -0.00039558, 0.00024234, 0.00039757, -0.00000115, 0.00000000],
++		[-6.27322168, -0.00039553, 0.00024231, 0.00039752, -0.00000115, 0.00000000],
++		[-6.27322180, -0.00039548, 0.00024228, 0.00039747, -0.00000115, 0.00000000],
++		[-6.27322193, -0.00039543, 0.00024225, 0.00039742, -0.00000115, 0.00000000],
++		[-6.27322205, -0.00039538, 0.00024221, 0.00039737, -0.00000115, 0.00000000],
++		[-6.27322217, -0.00039533, 0.00024218, 0.00039732, -0.00000115, 0.00000000],
++		[-6.27322229, -0.00039528, 0.00024215, 0.00039727, -0.00000115, 0.00000000],
++		[-6.27322241, -0.00039522, 0.00024212, 0.00039722, -0.00000115, 0.00000000],
++		[-6.27322253, -0.00039517, 0.00024209, 0.00039716, -0.00000115, 0.00000000],
++		[-6.27322265, -0.00039512, 0.00024206, 0.00039711, -0.00000115, 0.00000000],
++		[-6.27322277, -0.00039507, 0.00024203, 0.00039706, -0.00000115, 0.00000000],
++		[-6.27322289, -0.00039502, 0.00024200, 0.00039701, -0.00000115, 0.00000000],
++		[-6.27322301, -0.00039497, 0.00024197, 0.00039696, -0.00000115, 0.00000000],
++		[-6.27322313, -0.00039492, 0.00024194, 0.00039691, -0.00000115, 0.00000000],
++		[-6.27322325, -0.00039487, 0.00024191, 0.00039686, -0.00000115, 0.00000000],
++		[-6.27322337, -0.00039482, 0.00024187, 0.00039681, -0.00000115, 0.00000000],
++		[-6.27322349, -0.00039477, 0.00024184, 0.00039676, -0.00000115, 0.00000000],
++		[-6.27322362, -0.00039472, 0.00024181, 0.00039671, -0.00000115, 0.00000000],
++		[-6.27322374, -0.00039467, 0.00024178, 0.00039666, -0.00000115, 0.00000000],
++		[-6.27322386, -0.00039462, 0.00024175, 0.00039661, -0.00000115, 0.00000000],
++		[-6.27322398, -0.00039457, 0.00024172, 0.00039656, -0.00000115, 0.00000000],
++		[-6.27322410, -0.00039452, 0.00024169, 0.00039651, -0.00000115, 0.00000000],
++		[-6.27322422, -0.00039447, 0.00024166, 0.00039646, -0.00000115, 0.00000000],
++		[-6.27322434, -0.00039442, 0.00024163, 0.00039641, -0.00000115, 0.00000000],
++		[-6.27322446, -0.00039437, 0.00024160, 0.00039635, -0.00000115, 0.00000000],
++		[-6.27322458, -0.00039432, 0.00024157, 0.00039630, -0.00000115, 0.00000000],
++		[-6.27322470, -0.00039427, 0.00024154, 0.00039625, -0.00000115, 0.00000000],
++		[-6.27322482, -0.00039422, 0.00024150, 0.00039620, -0.00000115, 0.00000000],
++		[-6.27322494, -0.00039417, 0.00024147, 0.00039615, -0.00000115, 0.00000000],
++		[-6.27322506, -0.00039412, 0.00024144, 0.00039610, -0.00000115, 0.00000000],
++		[-6.27322518, -0.00039407, 0.00024141, 0.00039605, -0.00000115, 0.00000000],
++		[-6.27322530, -0.00039402, 0.00024138, 0.00039600, -0.00000115, 0.00000000],
++		[-6.27322542, -0.00039397, 0.00024135, 0.00039595, -0.00000115, 0.00000000],
++		[-6.27322554, -0.00039392, 0.00024132, 0.00039590, -0.00000115, 0.00000000],
++		[-6.27322566, -0.00039387, 0.00024129, 0.00039585, -0.00000115, 0.00000000],
++		[-6.27322578, -0.00039382, 0.00024126, 0.00039580, -0.00000115, 0.00000000],
++		[-6.27322590, -0.00039377, 0.00024123, 0.00039575, -0.00000115, 0.00000000],
++		[-6.27322602, -0.00039372, 0.00024120, 0.00039570, -0.00000115, 0.00000000],
++		[-6.27322614, -0.00039367, 0.00024117, 0.00039565, -0.00000115, 0.00000000],
++		[-6.27322626, -0.00039362, 0.00024114, 0.00039560, -0.00000115, 0.00000000],
++		[-6.27322638, -0.00039357, 0.00024111, 0.00039555, -0.00000115, 0.00000000],
++		[-6.27322650, -0.00039352, 0.00024107, 0.00039550, -0.00000115, 0.00000000],
++		[-6.27322662, -0.00039347, 0.00024104, 0.00039545, -0.00000115, 0.00000000],
++		[-6.27322674, -0.00039342, 0.00024101, 0.00039540, -0.00000115, 0.00000000],
++		[-6.27322686, -0.00039337, 0.00024098, 0.00039535, -0.00000115, 0.00000000],
++		[-6.27322698, -0.00039332, 0.00024095, 0.00039530, -0.00000115, 0.00000000],
++		[-6.27322710, -0.00039327, 0.00024092, 0.00039525, -0.00000115, 0.00000000],
++		[-6.27322722, -0.00039322, 0.00024089, 0.00039520, -0.00000115, 0.00000000],
++		[-6.27322734, -0.00039317, 0.00024086, 0.00039515, -0.00000115, 0.00000000],
++		[-6.27322746, -0.00039312, 0.00024083, 0.00039510, -0.00000115, 0.00000000],
++		[-6.27322757, -0.00039307, 0.00024080, 0.00039505, -0.00000115, 0.00000000],
++		[-6.27322769, -0.00039302, 0.00024077, 0.00039500, -0.00000115, 0.00000000],
++		[-6.27322781, -0.00039297, 0.00024074, 0.00039495, -0.00000115, 0.00000000],
++		[-6.27322793, -0.00039292, 0.00024071, 0.00039490, -0.00000115, 0.00000000],
++		[-6.27322805, -0.00039287, 0.00024068, 0.00039485, -0.00000115, 0.00000000],
++		[-6.27322817, -0.00039282, 0.00024065, 0.00039480, -0.00000115, 0.00000000],
++		[-6.27322829, -0.00039277, 0.00024062, 0.00039475, -0.00000115, 0.00000000],
++		[-6.27322841, -0.00039272, 0.00024059, 0.00039470, -0.00000115, 0.00000000],
++		[-6.27322853, -0.00039267, 0.00024055, 0.00039465, -0.00000115, 0.00000000],
++		[-6.27322865, -0.00039262, 0.00024052, 0.00039460, -0.00000115, 0.00000000],
++		[-6.27322877, -0.00039257, 0.00024049, 0.00039455, -0.00000115, 0.00000000],
++		[-6.27322889, -0.00039252, 0.00024046, 0.00039450, -0.00000115, 0.00000000],
++		[-6.27322901, -0.00039247, 0.00024043, 0.00039445, -0.00000115, 0.00000000],
++		[-6.27322913, -0.00039242, 0.00024040, 0.00039440, -0.00000115, 0.00000000],
++		[-6.27322924, -0.00039237, 0.00024037, 0.00039435, -0.00000115, 0.00000000],
++		[-6.27322936, -0.00039232, 0.00024034, 0.00039430, -0.00000115, 0.00000000],
++		[-6.27322948, -0.00039227, 0.00024031, 0.00039425, -0.00000115, 0.00000000],
++		[-6.27322960, -0.00039222, 0.00024028, 0.00039420, -0.00000115, 0.00000000],
++		[-6.27322972, -0.00039217, 0.00024025, 0.00039415, -0.00000115, 0.00000000],
++		[-6.27322984, -0.00039212, 0.00024022, 0.00039410, -0.00000115, 0.00000000],
++		[-6.27322996, -0.00039207, 0.00024019, 0.00039405, -0.00000115, 0.00000000],
++		[-6.27323008, -0.00039202, 0.00024016, 0.00039400, -0.00000115, 0.00000000],
++		[-6.27323020, -0.00039197, 0.00024013, 0.00039395, -0.00000115, 0.00000000],
++		[-6.27323032, -0.00039192, 0.00024010, 0.00039390, -0.00000115, 0.00000000],
++		[-6.27323043, -0.00039187, 0.00024007, 0.00039385, -0.00000115, 0.00000000],
++		[-6.27323055, -0.00039182, 0.00024004, 0.00039380, -0.00000115, 0.00000000],
++		[-6.27323067, -0.00039177, 0.00024001, 0.00039375, -0.00000115, 0.00000000],
++		[-6.27323079, -0.00039172, 0.00023998, 0.00039370, -0.00000115, 0.00000000],
++		[-6.27323091, -0.00039167, 0.00023995, 0.00039365, -0.00000115, 0.00000000],
++		[-6.27323103, -0.00039162, 0.00023992, 0.00039360, -0.00000115, 0.00000000],
++		[-6.27323115, -0.00039158, 0.00023989, 0.00039355, -0.00000115, 0.00000000],
++		[-6.27323126, -0.00039153, 0.00023985, 0.00039350, -0.00000115, 0.00000000],
++		[-6.27323138, -0.00039148, 0.00023982, 0.00039345, -0.00000115, 0.00000000],
++		[-6.27323150, -0.00039143, 0.00023979, 0.00039340, -0.00000115, 0.00000000],
++		[-6.27323162, -0.00039138, 0.00023976, 0.00039335, -0.00000115, 0.00000000],
++		[-6.27323174, -0.00039133, 0.00023973, 0.00039330, -0.00000115, 0.00000000],
++		[-6.27323186, -0.00039128, 0.00023970, 0.00039325, -0.00000115, 0.00000000],
++		[-6.27323198, -0.00039123, 0.00023967, 0.00039320, -0.00000115, 0.00000000],
++		[-6.27323209, -0.00039118, 0.00023964, 0.00039315, -0.00000115, 0.00000000],
++		[-6.27323221, -0.00039113, 0.00023961, 0.00039310, -0.00000115, 0.00000000],
++		[-6.27323233, -0.00039108, 0.00023958, 0.00039305, -0.00000115, 0.00000000],
++		[-6.27323245, -0.00039103, 0.00023955, 0.00039300, -0.00000115, 0.00000000],
++		[-6.27323257, -0.00039098, 0.00023952, 0.00039295, -0.00000115, 0.00000000],
++		[-6.27323268, -0.00039093, 0.00023949, 0.00039290, -0.00000115, 0.00000000],
++		[-6.27323280, -0.00039088, 0.00023946, 0.00039285, -0.00000115, 0.00000000],
++		[-6.27323292, -0.00039083, 0.00023943, 0.00039280, -0.00000115, 0.00000000],
++		[-6.27323304, -0.00039078, 0.00023940, 0.00039275, -0.00000115, 0.00000000],
++		[-6.27323316, -0.00039073, 0.00023937, 0.00039270, -0.00000115, 0.00000000],
++		[-6.27323328, -0.00039069, 0.00023934, 0.00039265, -0.00000115, 0.00000000],
++		[-6.27323339, -0.00039064, 0.00023931, 0.00039260, -0.00000115, 0.00000000],
++		[-6.27323351, -0.00039059, 0.00023928, 0.00039255, -0.00000115, 0.00000000],
++		[-6.27323363, -0.00039054, 0.00023925, 0.00039250, -0.00000115, 0.00000000],
++		[-6.27323375, -0.00039049, 0.00023922, 0.00039245, -0.00000115, 0.00000000],
++		[-6.27323387, -0.00039044, 0.00023919, 0.00039241, -0.00000115, 0.00000000],
++		[-6.27323398, -0.00039039, 0.00023916, 0.00039236, -0.00000115, 0.00000000],
++		[-6.27323410, -0.00039034, 0.00023913, 0.00039231, -0.00000115, 0.00000000],
++		[-6.27323422, -0.00039029, 0.00023910, 0.00039226, -0.00000115, 0.00000000],
++		[-6.27323434, -0.00039024, 0.00023907, 0.00039221, -0.00000115, 0.00000000],
++		[-6.27323445, -0.00039019, 0.00023904, 0.00039216, -0.00000115, 0.00000000],
++		[-6.27323457, -0.00039014, 0.00023901, 0.00039211, -0.00000115, 0.00000000],
++		[-6.27323469, -0.00039009, 0.00023898, 0.00039206, -0.00000115, 0.00000000],
++		[-6.27323481, -0.00039005, 0.00023895, 0.00039201, -0.00000115, 0.00000000],
++		[-6.27323493, -0.00039000, 0.00023892, 0.00039196, -0.00000115, 0.00000000],
++		[-6.27323504, -0.00038995, 0.00023889, 0.00039191, -0.00000115, 0.00000000],
++		[-6.27323516, -0.00038990, 0.00023886, 0.00039186, -0.00000115, 0.00000000],
++		[-6.27323528, -0.00038985, 0.00023883, 0.00039181, -0.00000115, 0.00000000],
++		[-6.27323540, -0.00038980, 0.00023880, 0.00039176, -0.00000115, 0.00000000],
++		[-6.27323551, -0.00038975, 0.00023877, 0.00039171, -0.00000115, 0.00000000],
++		[-6.27323563, -0.00038970, 0.00023874, 0.00039166, -0.00000115, 0.00000000],
++		[-6.27323575, -0.00038965, 0.00023871, 0.00039161, -0.00000115, 0.00000000],
++		[-6.27323587, -0.00038960, 0.00023868, 0.00039157, -0.00000115, 0.00000000],
++		[-6.27323598, -0.00038955, 0.00023865, 0.00039152, -0.00000115, 0.00000000],
++		[-6.27323610, -0.00038951, 0.00023862, 0.00039147, -0.00000115, 0.00000000],
++		[-6.27323622, -0.00038946, 0.00023859, 0.00039142, -0.00000115, 0.00000000],
++		[-6.27323633, -0.00038941, 0.00023856, 0.00039137, -0.00000115, 0.00000000],
++		[-6.27323645, -0.00038936, 0.00023853, 0.00039132, -0.00000115, 0.00000000],
++		[-6.27323657, -0.00038931, 0.00023850, 0.00039127, -0.00000115, 0.00000000],
++		[-6.27323669, -0.00038926, 0.00023847, 0.00039122, -0.00000115, 0.00000000],
++		[-6.27323680, -0.00038921, 0.00023844, 0.00039117, -0.00000115, 0.00000000],
++		[-6.27323692, -0.00038916, 0.00023841, 0.00039112, -0.00000115, 0.00000000],
++		[-6.27323704, -0.00038911, 0.00023838, 0.00039107, -0.00000115, 0.00000000],
++		[-6.27323715, -0.00038907, 0.00023835, 0.00039102, -0.00000115, 0.00000000],
++		[-6.27323727, -0.00038902, 0.00023832, 0.00039097, -0.00000115, 0.00000000],
++		[-6.27323739, -0.00038897, 0.00023829, 0.00039093, -0.00000115, 0.00000000],
++		[-6.27323751, -0.00038892, 0.00023826, 0.00039088, -0.00000115, 0.00000000],
++		[-6.27323762, -0.00038887, 0.00023823, 0.00039083, -0.00000115, 0.00000000],
++		[-6.27323774, -0.00038882, 0.00023820, 0.00039078, -0.00000115, 0.00000000],
++		[-6.27323786, -0.00038877, 0.00023817, 0.00039073, -0.00000115, 0.00000000],
++		[-6.27323797, -0.00038872, 0.00023814, 0.00039068, -0.00000115, 0.00000000],
++		[-6.27323809, -0.00038867, 0.00023811, 0.00039063, -0.00000115, 0.00000000],
++		[-6.27323821, -0.00038863, 0.00023808, 0.00039058, -0.00000115, 0.00000000],
++		[-6.27323832, -0.00038858, 0.00023805, 0.00039053, -0.00000115, 0.00000000],
++		[-6.27323844, -0.00038853, 0.00023802, 0.00039048, -0.00000115, 0.00000000],
++		[-6.27323856, -0.00038848, 0.00023799, 0.00039044, -0.00000115, 0.00000000],
++		[-6.27323867, -0.00038843, 0.00023796, 0.00039039, -0.00000115, 0.00000000],
++		[-6.27323879, -0.00038838, 0.00023793, 0.00039034, -0.00000115, 0.00000000],
++		[-6.27323891, -0.00038833, 0.00023790, 0.00039029, -0.00000115, 0.00000000],
++		[-6.27323902, -0.00038828, 0.00023787, 0.00039024, -0.00000115, 0.00000000],
++		[-6.27323914, -0.00038824, 0.00023784, 0.00039019, -0.00000115, 0.00000000],
++		[-6.27323926, -0.00038819, 0.00023781, 0.00039014, -0.00000115, 0.00000000],
++		[-6.27323937, -0.00038814, 0.00023778, 0.00039009, -0.00000115, 0.00000000],
++		[-6.27323949, -0.00038809, 0.00023775, 0.00039004, -0.00000115, 0.00000000],
++		[-6.27323961, -0.00038804, 0.00023772, 0.00038999, -0.00000115, 0.00000000],
++		[-6.27323972, -0.00038799, 0.00023769, 0.00038995, -0.00000115, 0.00000000],
++		[-6.27323984, -0.00038794, 0.00023766, 0.00038990, -0.00000115, 0.00000000],
++		[-6.27323996, -0.00038789, 0.00023763, 0.00038985, -0.00000115, 0.00000000],
++		[-6.27324007, -0.00038785, 0.00023760, 0.00038980, -0.00000115, 0.00000000],
++		[-6.27324019, -0.00038780, 0.00023757, 0.00038975, -0.00000115, 0.00000000],
++		[-6.27324030, -0.00038775, 0.00023754, 0.00038970, -0.00000115, 0.00000000],
++		[-6.27324042, -0.00038770, 0.00023751, 0.00038965, -0.00000115, 0.00000000],
++		[-6.27324054, -0.00038765, 0.00023748, 0.00038960, -0.00000115, 0.00000000],
++		[-6.27324065, -0.00038760, 0.00023745, 0.00038956, -0.00000115, 0.00000000],
++		[-6.27324077, -0.00038755, 0.00023742, 0.00038951, -0.00000115, 0.00000000],
++		[-6.27324089, -0.00038751, 0.00023739, 0.00038946, -0.00000115, 0.00000000],
++		[-6.27324100, -0.00038746, 0.00023736, 0.00038941, -0.00000115, 0.00000000],
++		[-6.27324112, -0.00038741, 0.00023733, 0.00038936, -0.00000115, 0.00000000],
++		[-6.27324123, -0.00038736, 0.00023730, 0.00038931, -0.00000115, 0.00000000],
++		[-6.27324135, -0.00038731, 0.00023727, 0.00038926, -0.00000115, 0.00000000],
++		[-6.27324147, -0.00038726, 0.00023724, 0.00038921, -0.00000115, 0.00000000],
++		[-6.27324158, -0.00038722, 0.00023721, 0.00038917, -0.00000115, 0.00000000],
++		[-6.27324170, -0.00038717, 0.00023718, 0.00038912, -0.00000115, 0.00000000],
++		[-6.27324181, -0.00038712, 0.00023715, 0.00038907, -0.00000115, 0.00000000],
++		[-6.27324193, -0.00038707, 0.00023712, 0.00038902, -0.00000115, 0.00000000],
++		[-6.27324205, -0.00038702, 0.00023709, 0.00038897, -0.00000115, 0.00000000],
++		[-6.27324216, -0.00038697, 0.00023706, 0.00038892, -0.00000115, 0.00000000],
++		[-6.27324228, -0.00038693, 0.00023704, 0.00038887, -0.00000115, 0.00000000],
++		[-6.27324239, -0.00038688, 0.00023701, 0.00038882, -0.00000115, 0.00000000],
++		[-6.27324251, -0.00038683, 0.00023698, 0.00038878, -0.00000115, 0.00000000],
++		[-6.27324262, -0.00038678, 0.00023695, 0.00038873, -0.00000115, 0.00000000],
++		[-6.27324274, -0.00038673, 0.00023692, 0.00038868, -0.00000115, 0.00000000],
++		[-6.27324286, -0.00038668, 0.00023689, 0.00038863, -0.00000115, 0.00000000],
++		[-6.27324297, -0.00038664, 0.00023686, 0.00038858, -0.00000115, 0.00000000],
++		[-6.27324309, -0.00038659, 0.00023683, 0.00038853, -0.00000115, 0.00000000],
++		[-6.27324320, -0.00038654, 0.00023680, 0.00038848, -0.00000115, 0.00000000],
++		[-6.27324332, -0.00038649, 0.00023677, 0.00038844, -0.00000115, 0.00000000],
++		[-6.27324343, -0.00038644, 0.00023674, 0.00038839, -0.00000115, 0.00000000],
++		[-6.27324355, -0.00038639, 0.00023671, 0.00038834, -0.00000115, 0.00000000],
++		[-6.27324366, -0.00038635, 0.00023668, 0.00038829, -0.00000115, 0.00000000],
++		[-6.27324378, -0.00038630, 0.00023665, 0.00038824, -0.00000115, 0.00000000],
++		[-6.27324390, -0.00038625, 0.00023662, 0.00038819, -0.00000115, 0.00000000],
++		[-6.27324401, -0.00038620, 0.00023659, 0.00038815, -0.00000115, 0.00000000],
++		[-6.27324413, -0.00038615, 0.00023656, 0.00038810, -0.00000115, 0.00000000],
++		[-6.27324424, -0.00038610, 0.00023653, 0.00038805, -0.00000115, 0.00000000],
++		[-6.27324436, -0.00038606, 0.00023650, 0.00038800, -0.00000115, 0.00000000],
++		[-6.27324447, -0.00038601, 0.00023647, 0.00038795, -0.00000115, 0.00000000],
++		[-6.27324459, -0.00038596, 0.00023644, 0.00038790, -0.00000115, 0.00000000],
++		[-6.27324470, -0.00038591, 0.00023641, 0.00038786, -0.00000115, 0.00000000],
++		[-6.27324482, -0.00038586, 0.00023638, 0.00038781, -0.00000115, 0.00000000],
++		[-6.27324493, -0.00038582, 0.00023636, 0.00038776, -0.00000115, 0.00000000],
++		[-6.27324505, -0.00038577, 0.00023633, 0.00038771, -0.00000115, 0.00000000],
++		[-6.27324516, -0.00038572, 0.00023630, 0.00038766, -0.00000115, 0.00000000],
++		[-6.27324528, -0.00038567, 0.00023627, 0.00038761, -0.00000115, 0.00000000],
++		[-6.27324539, -0.00038562, 0.00023624, 0.00038757, -0.00000115, 0.00000000],
++		[-6.27324551, -0.00038558, 0.00023621, 0.00038752, -0.00000115, 0.00000000],
++		[-6.27324562, -0.00038553, 0.00023618, 0.00038747, -0.00000115, 0.00000000],
++		[-6.27324574, -0.00038548, 0.00023615, 0.00038742, -0.00000115, 0.00000000],
++		[-6.27324585, -0.00038543, 0.00023612, 0.00038737, -0.00000115, 0.00000000],
++		[-6.27324597, -0.00038538, 0.00023609, 0.00038732, -0.00000115, 0.00000000],
++		[-6.27324608, -0.00038534, 0.00023606, 0.00038728, -0.00000115, 0.00000000],
++		[-6.27324620, -0.00038529, 0.00023603, 0.00038723, -0.00000115, 0.00000000],
++		[-6.27324631, -0.00038524, 0.00023600, 0.00038718, -0.00000115, 0.00000000],
++		[-6.27324643, -0.00038519, 0.00023597, 0.00038713, -0.00000115, 0.00000000],
++		[-6.27324654, -0.00038514, 0.00023594, 0.00038708, -0.00000115, 0.00000000],
++		[-6.27324666, -0.00038510, 0.00023591, 0.00038703, -0.00000115, 0.00000000],
++		[-6.27324677, -0.00038505, 0.00023588, 0.00038699, -0.00000115, 0.00000000],
++		[-6.27324689, -0.00038500, 0.00023586, 0.00038694, -0.00000115, 0.00000000],
++		[-6.27324700, -0.00038495, 0.00023583, 0.00038689, -0.00000115, 0.00000000],
++		[-6.27324711, -0.00038490, 0.00023580, 0.00038684, -0.00000115, 0.00000000],
++		[-6.27324723, -0.00038486, 0.00023577, 0.00038679, -0.00000115, 0.00000000],
++		[-6.27324734, -0.00038481, 0.00023574, 0.00038675, -0.00000115, 0.00000000],
++		[-6.27324746, -0.00038476, 0.00023571, 0.00038670, -0.00000115, 0.00000000],
++		[-6.27324757, -0.00038471, 0.00023568, 0.00038665, -0.00000115, 0.00000000],
++		[-6.27324769, -0.00038467, 0.00023565, 0.00038660, -0.00000115, 0.00000000],
++		[-6.27324780, -0.00038462, 0.00023562, 0.00038655, -0.00000115, 0.00000000],
++		[-6.27324792, -0.00038457, 0.00023559, 0.00038651, -0.00000115, 0.00000000],
++		[-6.27324803, -0.00038452, 0.00023556, 0.00038646, -0.00000115, 0.00000000],
++		[-6.27324814, -0.00038447, 0.00023553, 0.00038641, -0.00000115, 0.00000000],
++		[-6.27324826, -0.00038443, 0.00023550, 0.00038636, -0.00000115, 0.00000000],
++		[-6.27324837, -0.00038438, 0.00023547, 0.00038631, -0.00000115, 0.00000000],
++		[-6.27324849, -0.00038433, 0.00023545, 0.00038627, -0.00000115, 0.00000000],
++		[-6.27324860, -0.00038428, 0.00023542, 0.00038622, -0.00000115, 0.00000000],
++		[-6.27324872, -0.00038424, 0.00023539, 0.00038617, -0.00000115, 0.00000000],
++		[-6.27324883, -0.00038419, 0.00023536, 0.00038612, -0.00000115, 0.00000000],
++		[-6.27324894, -0.00038414, 0.00023533, 0.00038607, -0.00000115, 0.00000000],
++		[-6.27324906, -0.00038409, 0.00023530, 0.00038603, -0.00000115, 0.00000000],
++		[-6.27324917, -0.00038405, 0.00023527, 0.00038598, -0.00000115, 0.00000000],
++		[-6.27324929, -0.00038400, 0.00023524, 0.00038593, -0.00000115, 0.00000000],
++		[-6.27324940, -0.00038395, 0.00023521, 0.00038588, -0.00000115, 0.00000000],
++		[-6.27324951, -0.00038390, 0.00023518, 0.00038583, -0.00000115, 0.00000000],
++		[-6.27324963, -0.00038385, 0.00023515, 0.00038579, -0.00000115, 0.00000000],
++		[-6.27324974, -0.00038381, 0.00023512, 0.00038574, -0.00000115, 0.00000000],
++		[-6.27324986, -0.00038376, 0.00023509, 0.00038569, -0.00000115, 0.00000000],
++		[-6.27324997, -0.00038371, 0.00023507, 0.00038564, -0.00000115, 0.00000000],
++		[-6.27325008, -0.00038366, 0.00023504, 0.00038560, -0.00000115, 0.00000000],
++		[-6.27325020, -0.00038362, 0.00023501, 0.00038555, -0.00000115, 0.00000000],
++		[-6.27325031, -0.00038357, 0.00023498, 0.00038550, -0.00000115, 0.00000000],
++		[-6.27325043, -0.00038352, 0.00023495, 0.00038545, -0.00000115, 0.00000000],
++		[-6.27325054, -0.00038347, 0.00023492, 0.00038540, -0.00000115, 0.00000000],
++		[-6.27325065, -0.00038343, 0.00023489, 0.00038536, -0.00000115, 0.00000000],
++		[-6.27325077, -0.00038338, 0.00023486, 0.00038531, -0.00000115, 0.00000000],
++		[-6.27325088, -0.00038333, 0.00023483, 0.00038526, -0.00000115, 0.00000000],
++		[-6.27325099, -0.00038328, 0.00023480, 0.00038521, -0.00000115, 0.00000000],
++		[-6.27325111, -0.00038324, 0.00023477, 0.00038517, -0.00000115, 0.00000000],
++		[-6.27325122, -0.00038319, 0.00023475, 0.00038512, -0.00000115, 0.00000000],
++		[-6.27325133, -0.00038314, 0.00023472, 0.00038507, -0.00000115, 0.00000000],
++		[-6.27325145, -0.00038309, 0.00023469, 0.00038502, -0.00000115, 0.00000000],
++		[-6.27325156, -0.00038305, 0.00023466, 0.00038498, -0.00000115, 0.00000000],
++		[-6.27325168, -0.00038300, 0.00023463, 0.00038493, -0.00000115, 0.00000000],
++		[-6.27325179, -0.00038295, 0.00023460, 0.00038488, -0.00000115, 0.00000000],
++		[-6.27325190, -0.00038291, 0.00023457, 0.00038483, -0.00000115, 0.00000000],
++		[-6.27325202, -0.00038286, 0.00023454, 0.00038478, -0.00000115, 0.00000000],
++		[-6.27325213, -0.00038281, 0.00023451, 0.00038474, -0.00000115, 0.00000000],
++		[-6.27325224, -0.00038276, 0.00023448, 0.00038469, -0.00000115, 0.00000000],
++		[-6.27325236, -0.00038272, 0.00023446, 0.00038464, -0.00000115, 0.00000000],
++		[-6.27325247, -0.00038267, 0.00023443, 0.00038459, -0.00000115, 0.00000000],
++		[-6.27325258, -0.00038262, 0.00023440, 0.00038455, -0.00000115, 0.00000000],
++		[-6.27325269, -0.00038257, 0.00023437, 0.00038450, -0.00000115, 0.00000000],
++		[-6.27325281, -0.00038253, 0.00023434, 0.00038445, -0.00000115, 0.00000000],
++		[-6.27325292, -0.00038248, 0.00023431, 0.00038440, -0.00000115, 0.00000000],
++		[-6.27325303, -0.00038243, 0.00023428, 0.00038436, -0.00000115, 0.00000000],
++		[-6.27325315, -0.00038238, 0.00023425, 0.00038431, -0.00000115, 0.00000000],
++		[-6.27325326, -0.00038234, 0.00023422, 0.00038426, -0.00000115, 0.00000000],
++		[-6.27325337, -0.00038229, 0.00023419, 0.00038421, -0.00000115, 0.00000000],
++		[-6.27325349, -0.00038224, 0.00023417, 0.00038417, -0.00000115, 0.00000000],
++		[-6.27325360, -0.00038220, 0.00023414, 0.00038412, -0.00000115, 0.00000000],
++		[-6.27325371, -0.00038215, 0.00023411, 0.00038407, -0.00000115, 0.00000000],
++		[-6.27325383, -0.00038210, 0.00023408, 0.00038402, -0.00000115, 0.00000000],
++		[-6.27325394, -0.00038205, 0.00023405, 0.00038398, -0.00000115, 0.00000000],
++		[-6.27325405, -0.00038201, 0.00023402, 0.00038393, -0.00000115, 0.00000000],
++		[-6.27325416, -0.00038196, 0.00023399, 0.00038388, -0.00000115, 0.00000000],
++		[-6.27325428, -0.00038191, 0.00023396, 0.00038384, -0.00000115, 0.00000000],
++		[-6.27325439, -0.00038187, 0.00023393, 0.00038379, -0.00000115, 0.00000000],
++		[-6.27325450, -0.00038182, 0.00023391, 0.00038374, -0.00000115, 0.00000000],
++		[-6.27325462, -0.00038177, 0.00023388, 0.00038369, -0.00000115, 0.00000000],
++		[-6.27325473, -0.00038172, 0.00023385, 0.00038365, -0.00000115, 0.00000000],
++		[-6.27325484, -0.00038168, 0.00023382, 0.00038360, -0.00000115, 0.00000000],
++		[-6.27325495, -0.00038163, 0.00023379, 0.00038355, -0.00000115, 0.00000000],
++		[-6.27325507, -0.00038158, 0.00023376, 0.00038350, -0.00000115, 0.00000000],
++		[-6.27325518, -0.00038154, 0.00023373, 0.00038346, -0.00000115, 0.00000000],
++		[-6.27325529, -0.00038149, 0.00023370, 0.00038341, -0.00000115, 0.00000000],
++		[-6.27325540, -0.00038144, 0.00023367, 0.00038336, -0.00000115, 0.00000000],
++		[-6.27325552, -0.00038140, 0.00023365, 0.00038332, -0.00000115, 0.00000000],
++		[-6.27325563, -0.00038135, 0.00023362, 0.00038327, -0.00000115, 0.00000000],
++		[-6.27325574, -0.00038130, 0.00023359, 0.00038322, -0.00000115, 0.00000000],
++		[-6.27325585, -0.00038125, 0.00023356, 0.00038317, -0.00000115, 0.00000000],
++		[-6.27325597, -0.00038121, 0.00023353, 0.00038313, -0.00000115, 0.00000000],
++		[-6.27325608, -0.00038116, 0.00023350, 0.00038308, -0.00000115, 0.00000000],
++		[-6.27325619, -0.00038111, 0.00023347, 0.00038303, -0.00000115, 0.00000000],
++		[-6.27325630, -0.00038107, 0.00023344, 0.00038298, -0.00000115, 0.00000000],
++		[-6.27325642, -0.00038102, 0.00023342, 0.00038294, -0.00000115, 0.00000000],
++		[-6.27325653, -0.00038097, 0.00023339, 0.00038289, -0.00000115, 0.00000000],
++		[-6.27325664, -0.00038093, 0.00023336, 0.00038284, -0.00000115, 0.00000000],
++		[-6.27325675, -0.00038088, 0.00023333, 0.00038280, -0.00000115, 0.00000000],
++		[-6.27325686, -0.00038083, 0.00023330, 0.00038275, -0.00000115, 0.00000000],
++		[-6.27325698, -0.00038079, 0.00023327, 0.00038270, -0.00000115, 0.00000000],
++		[-6.27325709, -0.00038074, 0.00023324, 0.00038265, -0.00000115, 0.00000000],
++		[-6.27325720, -0.00038069, 0.00023321, 0.00038261, -0.00000115, 0.00000000],
++		[-6.27325731, -0.00038065, 0.00023319, 0.00038256, -0.00000115, 0.00000000],
++		[-6.27325742, -0.00038060, 0.00023316, 0.00038251, -0.00000115, 0.00000000],
++		[-6.27325754, -0.00038055, 0.00023313, 0.00038247, -0.00000115, 0.00000000],
++		[-6.27325765, -0.00038050, 0.00023310, 0.00038242, -0.00000115, 0.00000000],
++		[-6.27325776, -0.00038046, 0.00023307, 0.00038237, -0.00000115, 0.00000000],
++		[-6.27325787, -0.00038041, 0.00023304, 0.00038233, -0.00000115, 0.00000000],
++		[-6.27325798, -0.00038036, 0.00023301, 0.00038228, -0.00000115, 0.00000000],
++		[-6.27325810, -0.00038032, 0.00023299, 0.00038223, -0.00000115, 0.00000000],
++		[-6.27325821, -0.00038027, 0.00023296, 0.00038218, -0.00000115, 0.00000000],
++		[-6.27325832, -0.00038022, 0.00023293, 0.00038214, -0.00000115, 0.00000000],
++		[-6.27325843, -0.00038018, 0.00023290, 0.00038209, -0.00000115, 0.00000000],
++		[-6.27325854, -0.00038013, 0.00023287, 0.00038204, -0.00000115, 0.00000000],
++		[-6.27325866, -0.00038008, 0.00023284, 0.00038200, -0.00000115, 0.00000000],
++		[-6.27325877, -0.00038004, 0.00023281, 0.00038195, -0.00000115, 0.00000000],
++		[-6.27325888, -0.00037999, 0.00023279, 0.00038190, -0.00000115, 0.00000000],
++		[-6.27325899, -0.00037994, 0.00023276, 0.00038186, -0.00000115, 0.00000000],
++		[-6.27325910, -0.00037990, 0.00023273, 0.00038181, -0.00000115, 0.00000000],
++		[-6.27325921, -0.00037985, 0.00023270, 0.00038176, -0.00000115, 0.00000000],
++		[-6.27325932, -0.00037980, 0.00023267, 0.00038172, -0.00000115, 0.00000000],
++		[-6.27325944, -0.00037976, 0.00023264, 0.00038167, -0.00000115, 0.00000000],
++		[-6.27325955, -0.00037971, 0.00023261, 0.00038162, -0.00000115, 0.00000000],
++		[-6.27325966, -0.00037966, 0.00023259, 0.00038158, -0.00000115, 0.00000000],
++		[-6.27325977, -0.00037962, 0.00023256, 0.00038153, -0.00000115, 0.00000000],
++		[-6.27325988, -0.00037957, 0.00023253, 0.00038148, -0.00000115, 0.00000000],
++		[-6.27325999, -0.00037953, 0.00023250, 0.00038144, -0.00000115, 0.00000000],
++		[-6.27326011, -0.00037948, 0.00023247, 0.00038139, -0.00000115, 0.00000000],
++		[-6.27326022, -0.00037943, 0.00023244, 0.00038134, -0.00000115, 0.00000000],
++		[-6.27326033, -0.00037939, 0.00023241, 0.00038129, -0.00000115, 0.00000000],
++		[-6.27326044, -0.00037934, 0.00023239, 0.00038125, -0.00000115, 0.00000000],
++		[-6.27326055, -0.00037929, 0.00023236, 0.00038120, -0.00000115, 0.00000000],
++		[-6.27326066, -0.00037925, 0.00023233, 0.00038115, -0.00000115, 0.00000000],
++		[-6.27326077, -0.00037920, 0.00023230, 0.00038111, -0.00000115, 0.00000000],
++		[-6.27326088, -0.00037915, 0.00023227, 0.00038106, -0.00000115, 0.00000000],
++		[-6.27326100, -0.00037911, 0.00023224, 0.00038101, -0.00000115, 0.00000000],
++		[-6.27326111, -0.00037906, 0.00023221, 0.00038097, -0.00000115, 0.00000000],
++		[-6.27326122, -0.00037901, 0.00023219, 0.00038092, -0.00000115, 0.00000000],
++		[-6.27326133, -0.00037897, 0.00023216, 0.00038087, -0.00000115, 0.00000000],
++		[-6.27326144, -0.00037892, 0.00023213, 0.00038083, -0.00000115, 0.00000000],
++		[-6.27326155, -0.00037887, 0.00023210, 0.00038078, -0.00000115, 0.00000000],
++		[-6.27326166, -0.00037883, 0.00023207, 0.00038073, -0.00000115, 0.00000000],
++		[-6.27326177, -0.00037878, 0.00023204, 0.00038069, -0.00000115, 0.00000000],
++		[-6.27326188, -0.00037874, 0.00023202, 0.00038064, -0.00000115, 0.00000000],
++		[-6.27326199, -0.00037869, 0.00023199, 0.00038060, -0.00000115, 0.00000000],
++		[-6.27326211, -0.00037864, 0.00023196, 0.00038055, -0.00000115, 0.00000000],
++		[-6.27326222, -0.00037860, 0.00023193, 0.00038050, -0.00000115, 0.00000000],
++		[-6.27326233, -0.00037855, 0.00023190, 0.00038046, -0.00000115, 0.00000000],
++		[-6.27326244, -0.00037850, 0.00023187, 0.00038041, -0.00000115, 0.00000000],
++		[-6.27326255, -0.00037846, 0.00023185, 0.00038036, -0.00000115, 0.00000000],
++		[-6.27326266, -0.00037841, 0.00023182, 0.00038032, -0.00000115, 0.00000000],
++		[-6.27326277, -0.00037837, 0.00023179, 0.00038027, -0.00000115, 0.00000000],
++		[-6.27326288, -0.00037832, 0.00023176, 0.00038022, -0.00000115, 0.00000000],
++		[-6.27326299, -0.00037827, 0.00023173, 0.00038018, -0.00000115, 0.00000000],
++		[-6.27326310, -0.00037823, 0.00023170, 0.00038013, -0.00000115, 0.00000000],
++		[-6.27326321, -0.00037818, 0.00023168, 0.00038008, -0.00000115, 0.00000000],
++		[-6.27326332, -0.00037813, 0.00023165, 0.00038004, -0.00000115, 0.00000000],
++		[-6.27326343, -0.00037809, 0.00023162, 0.00037999, -0.00000115, 0.00000000],
++		[-6.27326354, -0.00037804, 0.00023159, 0.00037994, -0.00000115, 0.00000000],
++		[-6.27326366, -0.00037800, 0.00023156, 0.00037990, -0.00000115, 0.00000000],
++		[-6.27326377, -0.00037795, 0.00023153, 0.00037985, -0.00000115, 0.00000000],
++		[-6.27326388, -0.00037790, 0.00023151, 0.00037981, -0.00000115, 0.00000000],
++		[-6.27326399, -0.00037786, 0.00023148, 0.00037976, -0.00000115, 0.00000000],
++		[-6.27326410, -0.00037781, 0.00023145, 0.00037971, -0.00000115, 0.00000000],
++		[-6.27326421, -0.00037777, 0.00023142, 0.00037967, -0.00000115, 0.00000000],
++		[-6.27326432, -0.00037772, 0.00023139, 0.00037962, -0.00000115, 0.00000000],
++		[-6.27326443, -0.00037767, 0.00023136, 0.00037957, -0.00000115, 0.00000000],
++		[-6.27326454, -0.00037763, 0.00023134, 0.00037953, -0.00000115, 0.00000000],
++		[-6.27326465, -0.00037758, 0.00023131, 0.00037948, -0.00000115, 0.00000000],
++		[-6.27326476, -0.00037753, 0.00023128, 0.00037943, -0.00000115, 0.00000000],
++		[-6.27326487, -0.00037749, 0.00023125, 0.00037939, -0.00000115, 0.00000000],
++		[-6.27326498, -0.00037744, 0.00023122, 0.00037934, -0.00000115, 0.00000000],
++		[-6.27326509, -0.00037740, 0.00023120, 0.00037930, -0.00000115, 0.00000000],
++		[-6.27326520, -0.00037735, 0.00023117, 0.00037925, -0.00000115, 0.00000000],
++		[-6.27326531, -0.00037730, 0.00023114, 0.00037920, -0.00000115, 0.00000000],
++		[-6.27326542, -0.00037726, 0.00023111, 0.00037916, -0.00000115, 0.00000000],
++		[-6.27326553, -0.00037721, 0.00023108, 0.00037911, -0.00000115, 0.00000000],
++		[-6.27326564, -0.00037717, 0.00023105, 0.00037906, -0.00000115, 0.00000000],
++		[-6.27326575, -0.00037712, 0.00023103, 0.00037902, -0.00000115, 0.00000000],
++		[-6.27326586, -0.00037707, 0.00023100, 0.00037897, -0.00000115, 0.00000000],
++		[-6.27326597, -0.00037703, 0.00023097, 0.00037893, -0.00000115, 0.00000000],
++		[-6.27326608, -0.00037698, 0.00023094, 0.00037888, -0.00000115, 0.00000000],
++		[-6.27326619, -0.00037694, 0.00023091, 0.00037883, -0.00000115, 0.00000000],
++		[-6.27326630, -0.00037689, 0.00023089, 0.00037879, -0.00000115, 0.00000000],
++		[-6.27326641, -0.00037685, 0.00023086, 0.00037874, -0.00000115, 0.00000000],
++		[-6.27326652, -0.00037680, 0.00023083, 0.00037870, -0.00000115, 0.00000000],
++		[-6.27326663, -0.00037675, 0.00023080, 0.00037865, -0.00000115, 0.00000000],
++		[-6.27326674, -0.00037671, 0.00023077, 0.00037860, -0.00000115, 0.00000000],
++		[-6.27326685, -0.00037666, 0.00023074, 0.00037856, -0.00000115, 0.00000000],
++		[-6.27326696, -0.00037662, 0.00023072, 0.00037851, -0.00000115, 0.00000000],
++		[-6.27326707, -0.00037657, 0.00023069, 0.00037847, -0.00000115, 0.00000000],
++		[-6.27326718, -0.00037652, 0.00023066, 0.00037842, -0.00000115, 0.00000000],
++		[-6.27326729, -0.00037648, 0.00023063, 0.00037837, -0.00000115, 0.00000000],
++		[-6.27326740, -0.00037643, 0.00023060, 0.00037833, -0.00000115, 0.00000000],
++		[-6.27326751, -0.00037639, 0.00023058, 0.00037828, -0.00000115, 0.00000000],
++		[-6.27326762, -0.00037634, 0.00023055, 0.00037823, -0.00000115, 0.00000000],
++		[-6.27326773, -0.00037630, 0.00023052, 0.00037819, -0.00000115, 0.00000000],
++		[-6.27326783, -0.00037625, 0.00023049, 0.00037814, -0.00000115, 0.00000000],
++		[-6.27326794, -0.00037620, 0.00023046, 0.00037810, -0.00000115, 0.00000000],
++		[-6.27326805, -0.00037616, 0.00023044, 0.00037805, -0.00000115, 0.00000000],
++		[-6.27326816, -0.00037611, 0.00023041, 0.00037801, -0.00000115, 0.00000000],
++		[-6.27326827, -0.00037607, 0.00023038, 0.00037796, -0.00000115, 0.00000000],
++		[-6.27326838, -0.00037602, 0.00023035, 0.00037791, -0.00000115, 0.00000000],
++		[-6.27326849, -0.00037598, 0.00023032, 0.00037787, -0.00000115, 0.00000000],
++		[-6.27326860, -0.00037593, 0.00023030, 0.00037782, -0.00000115, 0.00000000],
++		[-6.27326871, -0.00037588, 0.00023027, 0.00037778, -0.00000115, 0.00000000],
++		[-6.27326882, -0.00037584, 0.00023024, 0.00037773, -0.00000115, 0.00000000],
++		[-6.27326893, -0.00037579, 0.00023021, 0.00037768, -0.00000115, 0.00000000],
++		[-6.27326904, -0.00037575, 0.00023018, 0.00037764, -0.00000115, 0.00000000],
++		[-6.27326915, -0.00037570, 0.00023016, 0.00037759, -0.00000115, 0.00000000],
++		[-6.27326926, -0.00037566, 0.00023013, 0.00037755, -0.00000115, 0.00000000],
++		[-6.27326937, -0.00037561, 0.00023010, 0.00037750, -0.00000115, 0.00000000],
++		[-6.27326947, -0.00037557, 0.00023007, 0.00037745, -0.00000115, 0.00000000],
++		[-6.27326958, -0.00037552, 0.00023004, 0.00037741, -0.00000115, 0.00000000],
++		[-6.27326969, -0.00037547, 0.00023002, 0.00037736, -0.00000115, 0.00000000],
++		[-6.27326980, -0.00037543, 0.00022999, 0.00037732, -0.00000115, 0.00000000],
++		[-6.27326991, -0.00037538, 0.00022996, 0.00037727, -0.00000115, 0.00000000],
++		[-6.27327002, -0.00037534, 0.00022993, 0.00037723, -0.00000115, 0.00000000],
++		[-6.27327013, -0.00037529, 0.00022991, 0.00037718, -0.00000115, 0.00000000],
++		[-6.27327024, -0.00037525, 0.00022988, 0.00037713, -0.00000115, 0.00000000],
++		[-6.27327035, -0.00037520, 0.00022985, 0.00037709, -0.00000115, 0.00000000],
++		[-6.27327045, -0.00037516, 0.00022982, 0.00037704, -0.00000115, 0.00000000],
++		[-6.27327056, -0.00037511, 0.00022979, 0.00037700, -0.00000115, 0.00000000],
++		[-6.27327067, -0.00037506, 0.00022977, 0.00037695, -0.00000115, 0.00000000],
++		[-6.27327078, -0.00037502, 0.00022974, 0.00037691, -0.00000115, 0.00000000],
++		[-6.27327089, -0.00037497, 0.00022971, 0.00037686, -0.00000115, 0.00000000],
++		[-6.27327100, -0.00037493, 0.00022968, 0.00037681, -0.00000115, 0.00000000],
++		[-6.27327111, -0.00037488, 0.00022965, 0.00037677, -0.00000115, 0.00000000],
++		[-6.27327122, -0.00037484, 0.00022963, 0.00037672, -0.00000115, 0.00000000],
++		[-6.27327132, -0.00037479, 0.00022960, 0.00037668, -0.00000115, 0.00000000],
++		[-6.27327143, -0.00037475, 0.00022957, 0.00037663, -0.00000115, 0.00000000],
++		[-6.27327154, -0.00037470, 0.00022954, 0.00037659, -0.00000115, 0.00000000],
++		[-6.27327165, -0.00037466, 0.00022952, 0.00037654, -0.00000115, 0.00000000],
++		[-6.27327176, -0.00037461, 0.00022949, 0.00037650, -0.00000115, 0.00000000],
++		[-6.27327187, -0.00037457, 0.00022946, 0.00037645, -0.00000115, 0.00000000],
++		[-6.27327198, -0.00037452, 0.00022943, 0.00037640, -0.00000115, 0.00000000],
++		[-6.27327208, -0.00037447, 0.00022940, 0.00037636, -0.00000115, 0.00000000],
++		[-6.27327219, -0.00037443, 0.00022938, 0.00037631, -0.00000115, 0.00000000],
++		[-6.27327230, -0.00037438, 0.00022935, 0.00037627, -0.00000115, 0.00000000],
++		[-6.27327241, -0.00037434, 0.00022932, 0.00037622, -0.00000115, 0.00000000],
++		[-6.27327252, -0.00037429, 0.00022929, 0.00037618, -0.00000115, 0.00000000],
++		[-6.27327263, -0.00037425, 0.00022927, 0.00037613, -0.00000115, 0.00000000],
++		[-6.27327273, -0.00037420, 0.00022924, 0.00037609, -0.00000115, 0.00000000],
++		[-6.27327284, -0.00037416, 0.00022921, 0.00037604, -0.00000115, 0.00000000],
++		[-6.27327295, -0.00037411, 0.00022918, 0.00037599, -0.00000115, 0.00000000],
++		[-6.27327306, -0.00037407, 0.00022915, 0.00037595, -0.00000115, 0.00000000],
++		[-6.27327317, -0.00037402, 0.00022913, 0.00037590, -0.00000115, 0.00000000],
++		[-6.27327328, -0.00037398, 0.00022910, 0.00037586, -0.00000115, 0.00000000],
++		[-6.27327338, -0.00037393, 0.00022907, 0.00037581, -0.00000115, 0.00000000],
++		[-6.27327349, -0.00037389, 0.00022904, 0.00037577, -0.00000115, 0.00000000],
++		[-6.27327360, -0.00037384, 0.00022902, 0.00037572, -0.00000115, 0.00000000],
++		[-6.27327371, -0.00037380, 0.00022899, 0.00037568, -0.00000115, 0.00000000],
++		[-6.27327382, -0.00037375, 0.00022896, 0.00037563, -0.00000115, 0.00000000],
++		[-6.27327392, -0.00037371, 0.00022893, 0.00037559, -0.00000115, 0.00000000],
++		[-6.27327403, -0.00037366, 0.00022891, 0.00037554, -0.00000115, 0.00000000],
++		[-6.27327414, -0.00037362, 0.00022888, 0.00037550, -0.00000115, 0.00000000],
++		[-6.27327425, -0.00037357, 0.00022885, 0.00037545, -0.00000115, 0.00000000],
++		[-6.27327436, -0.00037353, 0.00022882, 0.00037541, -0.00000115, 0.00000000],
++		[-6.27327446, -0.00037348, 0.00022880, 0.00037536, -0.00000115, 0.00000000],
++		[-6.27327457, -0.00037344, 0.00022877, 0.00037531, -0.00000115, 0.00000000],
++		[-6.27327468, -0.00037339, 0.00022874, 0.00037527, -0.00000115, 0.00000000],
++		[-6.27327479, -0.00037335, 0.00022871, 0.00037522, -0.00000115, 0.00000000],
++		[-6.27327490, -0.00037330, 0.00022868, 0.00037518, -0.00000115, 0.00000000],
++		[-6.27327500, -0.00037326, 0.00022866, 0.00037513, -0.00000115, 0.00000000],
++		[-6.27327511, -0.00037321, 0.00022863, 0.00037509, -0.00000115, 0.00000000],
++		[-6.27327522, -0.00037317, 0.00022860, 0.00037504, -0.00000115, 0.00000000],
++		[-6.27327533, -0.00037312, 0.00022857, 0.00037500, -0.00000115, 0.00000000],
++		[-6.27327543, -0.00037308, 0.00022855, 0.00037495, -0.00000115, 0.00000000],
++		[-6.27327554, -0.00037303, 0.00022852, 0.00037491, -0.00000115, 0.00000000],
++		[-6.27327565, -0.00037299, 0.00022849, 0.00037486, -0.00000115, 0.00000000],
++		[-6.27327576, -0.00037294, 0.00022846, 0.00037482, -0.00000115, 0.00000000],
++		[-6.27327586, -0.00037290, 0.00022844, 0.00037477, -0.00000115, 0.00000000],
++		[-6.27327597, -0.00037285, 0.00022841, 0.00037473, -0.00000115, 0.00000000],
++		[-6.27327608, -0.00037281, 0.00022838, 0.00037468, -0.00000115, 0.00000000],
++		[-6.27327619, -0.00037276, 0.00022835, 0.00037464, -0.00000115, 0.00000000],
++		[-6.27327629, -0.00037272, 0.00022833, 0.00037459, -0.00000115, 0.00000000],
++		[-6.27327640, -0.00037267, 0.00022830, 0.00037455, -0.00000115, 0.00000000],
++		[-6.27327651, -0.00037263, 0.00022827, 0.00037450, -0.00000115, 0.00000000],
++		[-6.27327662, -0.00037258, 0.00022824, 0.00037446, -0.00000115, 0.00000000],
++		[-6.27327672, -0.00037254, 0.00022822, 0.00037441, -0.00000115, 0.00000000],
++		[-6.27327683, -0.00037249, 0.00022819, 0.00037437, -0.00000115, 0.00000000],
++		[-6.27327694, -0.00037245, 0.00022816, 0.00037432, -0.00000115, 0.00000000],
++		[-6.27327705, -0.00037240, 0.00022813, 0.00037428, -0.00000115, 0.00000000],
++		[-6.27327715, -0.00037236, 0.00022811, 0.00037423, -0.00000115, 0.00000000],
++		[-6.27327726, -0.00037231, 0.00022808, 0.00037419, -0.00000115, 0.00000000],
++		[-6.27327737, -0.00037227, 0.00022805, 0.00037414, -0.00000115, 0.00000000],
++		[-6.27327747, -0.00037222, 0.00022802, 0.00037410, -0.00000115, 0.00000000],
++		[-6.27327758, -0.00037218, 0.00022800, 0.00037405, -0.00000115, 0.00000000],
++		[-6.27327769, -0.00037213, 0.00022797, 0.00037401, -0.00000115, 0.00000000],
++		[-6.27327780, -0.00037209, 0.00022794, 0.00037396, -0.00000115, 0.00000000],
++		[-6.27327790, -0.00037204, 0.00022791, 0.00037392, -0.00000115, 0.00000000],
++		[-6.27327801, -0.00037200, 0.00022789, 0.00037387, -0.00000115, 0.00000000],
++		[-6.27327812, -0.00037195, 0.00022786, 0.00037383, -0.00000115, 0.00000000],
++		[-6.27327822, -0.00037191, 0.00022783, 0.00037378, -0.00000115, 0.00000000],
++		[-6.27327833, -0.00037187, 0.00022781, 0.00037374, -0.00000115, 0.00000000],
++		[-6.27327844, -0.00037182, 0.00022778, 0.00037369, -0.00000115, 0.00000000],
++		[-6.27327855, -0.00037178, 0.00022775, 0.00037365, -0.00000115, 0.00000000],
++		[-6.27327865, -0.00037173, 0.00022772, 0.00037360, -0.00000115, 0.00000000],
++		[-6.27327876, -0.00037169, 0.00022770, 0.00037356, -0.00000115, 0.00000000],
++		[-6.27327887, -0.00037164, 0.00022767, 0.00037351, -0.00000115, 0.00000000],
++		[-6.27327897, -0.00037160, 0.00022764, 0.00037347, -0.00000115, 0.00000000],
++		[-6.27327908, -0.00037155, 0.00022761, 0.00037342, -0.00000115, 0.00000000],
++		[-6.27327919, -0.00037151, 0.00022759, 0.00037338, -0.00000115, 0.00000000],
++		[-6.27327929, -0.00037146, 0.00022756, 0.00037333, -0.00000115, 0.00000000],
++		[-6.27327940, -0.00037142, 0.00022753, 0.00037329, -0.00000115, 0.00000000],
++		[-6.27327951, -0.00037137, 0.00022750, 0.00037324, -0.00000115, 0.00000000],
++		[-6.27327961, -0.00037133, 0.00022748, 0.00037320, -0.00000115, 0.00000000],
++		[-6.27327972, -0.00037129, 0.00022745, 0.00037315, -0.00000115, 0.00000000],
++		[-6.27327983, -0.00037124, 0.00022742, 0.00037311, -0.00000115, 0.00000000],
++		[-6.27327993, -0.00037120, 0.00022740, 0.00037306, -0.00000115, 0.00000000],
++		[-6.27328004, -0.00037115, 0.00022737, 0.00037302, -0.00000115, 0.00000000],
++		[-6.27328015, -0.00037111, 0.00022734, 0.00037297, -0.00000115, 0.00000000],
++		[-6.27328025, -0.00037106, 0.00022731, 0.00037293, -0.00000115, 0.00000000],
++		[-6.27328036, -0.00037102, 0.00022729, 0.00037289, -0.00000115, 0.00000000],
++		[-6.27328047, -0.00037097, 0.00022726, 0.00037284, -0.00000115, 0.00000000],
++		[-6.27328057, -0.00037093, 0.00022723, 0.00037280, -0.00000115, 0.00000000],
++		[-6.27328068, -0.00037089, 0.00022720, 0.00037275, -0.00000115, 0.00000000],
++		[-6.27328078, -0.00037084, 0.00022718, 0.00037271, -0.00000115, 0.00000000],
++		[-6.27328089, -0.00037080, 0.00022715, 0.00037266, -0.00000115, 0.00000000],
++		[-6.27328100, -0.00037075, 0.00022712, 0.00037262, -0.00000115, 0.00000000],
++		[-6.27328110, -0.00037071, 0.00022710, 0.00037257, -0.00000115, 0.00000000],
++		[-6.27328121, -0.00037066, 0.00022707, 0.00037253, -0.00000115, 0.00000000],
++		[-6.27328132, -0.00037062, 0.00022704, 0.00037248, -0.00000115, 0.00000000],
++		[-6.27328142, -0.00037057, 0.00022701, 0.00037244, -0.00000115, 0.00000000],
++		[-6.27328153, -0.00037053, 0.00022699, 0.00037239, -0.00000115, 0.00000000],
++		[-6.27328163, -0.00037049, 0.00022696, 0.00037235, -0.00000115, 0.00000000],
++		[-6.27328174, -0.00037044, 0.00022693, 0.00037230, -0.00000115, 0.00000000],
++		[-6.27328185, -0.00037040, 0.00022691, 0.00037226, -0.00000115, 0.00000000],
++		[-6.27328195, -0.00037035, 0.00022688, 0.00037222, -0.00000115, 0.00000000],
++		[-6.27328206, -0.00037031, 0.00022685, 0.00037217, -0.00000115, 0.00000000],
++		[-6.27328217, -0.00037026, 0.00022682, 0.00037213, -0.00000115, 0.00000000],
++		[-6.27328227, -0.00037022, 0.00022680, 0.00037208, -0.00000115, 0.00000000],
++		[-6.27328238, -0.00037018, 0.00022677, 0.00037204, -0.00000115, 0.00000000],
++		[-6.27328248, -0.00037013, 0.00022674, 0.00037199, -0.00000115, 0.00000000],
++		[-6.27328259, -0.00037009, 0.00022672, 0.00037195, -0.00000115, 0.00000000],
++		[-6.27328269, -0.00037004, 0.00022669, 0.00037190, -0.00000115, 0.00000000],
++		[-6.27328280, -0.00037000, 0.00022666, 0.00037186, -0.00000115, 0.00000000],
++		[-6.27328291, -0.00036995, 0.00022663, 0.00037182, -0.00000115, 0.00000000],
++		[-6.27328301, -0.00036991, 0.00022661, 0.00037177, -0.00000115, 0.00000000],
++		[-6.27328312, -0.00036987, 0.00022658, 0.00037173, -0.00000115, 0.00000000],
++		[-6.27328322, -0.00036982, 0.00022655, 0.00037168, -0.00000115, 0.00000000],
++		[-6.27328333, -0.00036978, 0.00022653, 0.00037164, -0.00000115, 0.00000000],
++		[-6.27328344, -0.00036973, 0.00022650, 0.00037159, -0.00000115, 0.00000000],
++		[-6.27328354, -0.00036969, 0.00022647, 0.00037155, -0.00000115, 0.00000000],
++		[-6.27328365, -0.00036965, 0.00022644, 0.00037150, -0.00000115, 0.00000000],
++		[-6.27328375, -0.00036960, 0.00022642, 0.00037146, -0.00000115, 0.00000000],
++		[-6.27328386, -0.00036956, 0.00022639, 0.00037142, -0.00000115, 0.00000000],
++		[-6.27328396, -0.00036951, 0.00022636, 0.00037137, -0.00000115, 0.00000000],
++		[-6.27328407, -0.00036947, 0.00022634, 0.00037133, -0.00000115, 0.00000000],
++		[-6.27328418, -0.00036942, 0.00022631, 0.00037128, -0.00000115, 0.00000000],
++		[-6.27328428, -0.00036938, 0.00022628, 0.00037124, -0.00000115, 0.00000000],
++		[-6.27328439, -0.00036934, 0.00022626, 0.00037119, -0.00000115, 0.00000000],
++		[-6.27328449, -0.00036929, 0.00022623, 0.00037115, -0.00000115, 0.00000000],
++		[-6.27328460, -0.00036925, 0.00022620, 0.00037111, -0.00000115, 0.00000000],
++		[-6.27328470, -0.00036920, 0.00022617, 0.00037106, -0.00000115, 0.00000000],
++		[-6.27328481, -0.00036916, 0.00022615, 0.00037102, -0.00000115, 0.00000000],
++		[-6.27328491, -0.00036912, 0.00022612, 0.00037097, -0.00000115, 0.00000000],
++		[-6.27328502, -0.00036907, 0.00022609, 0.00037093, -0.00000115, 0.00000000],
++		[-6.27328512, -0.00036903, 0.00022607, 0.00037088, -0.00000115, 0.00000000],
++		[-6.27328523, -0.00036898, 0.00022604, 0.00037084, -0.00000115, 0.00000000],
++		[-6.27328533, -0.00036894, 0.00022601, 0.00037080, -0.00000115, 0.00000000],
++		[-6.27328544, -0.00036890, 0.00022599, 0.00037075, -0.00000115, 0.00000000],
++		[-6.27328555, -0.00036885, 0.00022596, 0.00037071, -0.00000115, 0.00000000],
++		[-6.27328565, -0.00036881, 0.00022593, 0.00037066, -0.00000115, 0.00000000],
++		[-6.27328576, -0.00036876, 0.00022590, 0.00037062, -0.00000115, 0.00000000],
++		[-6.27328586, -0.00036872, 0.00022588, 0.00037058, -0.00000115, 0.00000000],
++		[-6.27328597, -0.00036868, 0.00022585, 0.00037053, -0.00000115, 0.00000000],
++		[-6.27328607, -0.00036863, 0.00022582, 0.00037049, -0.00000115, 0.00000000],
++		[-6.27328618, -0.00036859, 0.00022580, 0.00037044, -0.00000115, 0.00000000],
++		[-6.27328628, -0.00036855, 0.00022577, 0.00037040, -0.00000115, 0.00000000],
++		[-6.27328639, -0.00036850, 0.00022574, 0.00037035, -0.00000115, 0.00000000],
++		[-6.27328649, -0.00036846, 0.00022572, 0.00037031, -0.00000115, 0.00000000],
++		[-6.27328660, -0.00036841, 0.00022569, 0.00037027, -0.00000115, 0.00000000],
++		[-6.27328670, -0.00036837, 0.00022566, 0.00037022, -0.00000115, 0.00000000],
++		[-6.27328681, -0.00036833, 0.00022564, 0.00037018, -0.00000115, 0.00000000],
++		[-6.27328691, -0.00036828, 0.00022561, 0.00037013, -0.00000115, 0.00000000],
++		[-6.27328702, -0.00036824, 0.00022558, 0.00037009, -0.00000115, 0.00000000],
++		[-6.27328712, -0.00036819, 0.00022556, 0.00037005, -0.00000115, 0.00000000],
++		[-6.27328723, -0.00036815, 0.00022553, 0.00037000, -0.00000115, 0.00000000],
++		[-6.27328733, -0.00036811, 0.00022550, 0.00036996, -0.00000115, 0.00000000],
++		[-6.27328744, -0.00036806, 0.00022547, 0.00036991, -0.00000115, 0.00000000],
++		[-6.27328754, -0.00036802, 0.00022545, 0.00036987, -0.00000115, 0.00000000],
++		[-6.27328764, -0.00036798, 0.00022542, 0.00036983, -0.00000115, 0.00000000],
++		[-6.27328775, -0.00036793, 0.00022539, 0.00036978, -0.00000115, 0.00000000],
++		[-6.27328785, -0.00036789, 0.00022537, 0.00036974, -0.00000115, 0.00000000],
++		[-6.27328796, -0.00036784, 0.00022534, 0.00036969, -0.00000115, 0.00000000],
++		[-6.27328806, -0.00036780, 0.00022531, 0.00036965, -0.00000115, 0.00000000],
++		[-6.27328817, -0.00036776, 0.00022529, 0.00036961, -0.00000115, 0.00000000],
++		[-6.27328827, -0.00036771, 0.00022526, 0.00036956, -0.00000115, 0.00000000],
++		[-6.27328838, -0.00036767, 0.00022523, 0.00036952, -0.00000115, 0.00000000],
++		[-6.27328848, -0.00036763, 0.00022521, 0.00036947, -0.00000115, 0.00000000],
++		[-6.27328859, -0.00036758, 0.00022518, 0.00036943, -0.00000115, 0.00000000],
++		[-6.27328869, -0.00036754, 0.00022515, 0.00036939, -0.00000115, 0.00000000],
++		[-6.27328880, -0.00036749, 0.00022513, 0.00036934, -0.00000115, 0.00000000],
++		[-6.27328890, -0.00036745, 0.00022510, 0.00036930, -0.00000115, 0.00000000],
++		[-6.27328900, -0.00036741, 0.00022507, 0.00036926, -0.00000115, 0.00000000],
++		[-6.27328911, -0.00036736, 0.00022505, 0.00036921, -0.00000115, 0.00000000],
++		[-6.27328921, -0.00036732, 0.00022502, 0.00036917, -0.00000115, 0.00000000],
++		[-6.27328932, -0.00036728, 0.00022499, 0.00036912, -0.00000115, 0.00000000],
++		[-6.27328942, -0.00036723, 0.00022497, 0.00036908, -0.00000115, 0.00000000],
++		[-6.27328953, -0.00036719, 0.00022494, 0.00036904, -0.00000115, 0.00000000],
++		[-6.27328963, -0.00036715, 0.00022491, 0.00036899, -0.00000115, 0.00000000],
++		[-6.27328973, -0.00036710, 0.00022489, 0.00036895, -0.00000115, 0.00000000],
++		[-6.27328984, -0.00036706, 0.00022486, 0.00036891, -0.00000115, 0.00000000],
++		[-6.27328994, -0.00036702, 0.00022483, 0.00036886, -0.00000115, 0.00000000],
++		[-6.27329005, -0.00036697, 0.00022481, 0.00036882, -0.00000115, 0.00000000],
++		[-6.27329015, -0.00036693, 0.00022478, 0.00036877, -0.00000115, 0.00000000],
++		[-6.27329025, -0.00036689, 0.00022475, 0.00036873, -0.00000115, 0.00000000],
++		[-6.27329036, -0.00036684, 0.00022473, 0.00036869, -0.00000115, 0.00000000],
++		[-6.27329046, -0.00036680, 0.00022470, 0.00036864, -0.00000115, 0.00000000],
++		[-6.27329057, -0.00036675, 0.00022467, 0.00036860, -0.00000115, 0.00000000],
++		[-6.27329067, -0.00036671, 0.00022465, 0.00036856, -0.00000115, 0.00000000],
++		[-6.27329078, -0.00036667, 0.00022462, 0.00036851, -0.00000115, 0.00000000],
++		[-6.27329088, -0.00036662, 0.00022459, 0.00036847, -0.00000115, 0.00000000],
++		[-6.27329098, -0.00036658, 0.00022457, 0.00036842, -0.00000115, 0.00000000],
++		[-6.27329109, -0.00036654, 0.00022454, 0.00036838, -0.00000115, 0.00000000],
++		[-6.27329119, -0.00036649, 0.00022451, 0.00036834, -0.00000115, 0.00000000],
++		[-6.27329129, -0.00036645, 0.00022449, 0.00036829, -0.00000115, 0.00000000],
++		[-6.27329140, -0.00036641, 0.00022446, 0.00036825, -0.00000115, 0.00000000],
++		[-6.27329150, -0.00036636, 0.00022443, 0.00036821, -0.00000115, 0.00000000],
++		[-6.27329161, -0.00036632, 0.00022441, 0.00036816, -0.00000115, 0.00000000],
++		[-6.27329171, -0.00036628, 0.00022438, 0.00036812, -0.00000115, 0.00000000],
++		[-6.27329181, -0.00036623, 0.00022435, 0.00036808, -0.00000115, 0.00000000],
++		[-6.27329192, -0.00036619, 0.00022433, 0.00036803, -0.00000115, 0.00000000],
++		[-6.27329202, -0.00036615, 0.00022430, 0.00036799, -0.00000115, 0.00000000],
++		[-6.27329212, -0.00036610, 0.00022427, 0.00036795, -0.00000115, 0.00000000],
++		[-6.27329223, -0.00036606, 0.00022425, 0.00036790, -0.00000115, 0.00000000],
++		[-6.27329233, -0.00036602, 0.00022422, 0.00036786, -0.00000115, 0.00000000],
++		[-6.27329244, -0.00036597, 0.00022419, 0.00036781, -0.00000115, 0.00000000],
++		[-6.27329254, -0.00036593, 0.00022417, 0.00036777, -0.00000115, 0.00000000],
++		[-6.27329264, -0.00036589, 0.00022414, 0.00036773, -0.00000115, 0.00000000],
++		[-6.27329275, -0.00036584, 0.00022412, 0.00036768, -0.00000115, 0.00000000],
++		[-6.27329285, -0.00036580, 0.00022409, 0.00036764, -0.00000115, 0.00000000],
++		[-6.27329295, -0.00036576, 0.00022406, 0.00036760, -0.00000115, 0.00000000],
++		[-6.27329306, -0.00036571, 0.00022404, 0.00036755, -0.00000115, 0.00000000],
++		[-6.27329316, -0.00036567, 0.00022401, 0.00036751, -0.00000115, 0.00000000],
++		[-6.27329326, -0.00036563, 0.00022398, 0.00036747, -0.00000115, 0.00000000],
++		[-6.27329337, -0.00036559, 0.00022396, 0.00036742, -0.00000115, 0.00000000],
++		[-6.27329347, -0.00036554, 0.00022393, 0.00036738, -0.00000115, 0.00000000],
++		[-6.27329357, -0.00036550, 0.00022390, 0.00036734, -0.00000115, 0.00000000],
++		[-6.27329368, -0.00036546, 0.00022388, 0.00036729, -0.00000115, 0.00000000],
++		[-6.27329378, -0.00036541, 0.00022385, 0.00036725, -0.00000115, 0.00000000],
++		[-6.27329388, -0.00036537, 0.00022382, 0.00036721, -0.00000115, 0.00000000],
++		[-6.27329399, -0.00036533, 0.00022380, 0.00036716, -0.00000115, 0.00000000],
++		[-6.27329409, -0.00036528, 0.00022377, 0.00036712, -0.00000115, 0.00000000],
++		[-6.27329419, -0.00036524, 0.00022374, 0.00036708, -0.00000115, 0.00000000],
++		[-6.27329430, -0.00036520, 0.00022372, 0.00036703, -0.00000115, 0.00000000],
++		[-6.27329440, -0.00036515, 0.00022369, 0.00036699, -0.00000115, 0.00000000],
++		[-6.27329450, -0.00036511, 0.00022367, 0.00036695, -0.00000115, 0.00000000],
++		[-6.27329461, -0.00036507, 0.00022364, 0.00036690, -0.00000115, 0.00000000],
++		[-6.27329471, -0.00036502, 0.00022361, 0.00036686, -0.00000115, 0.00000000],
++		[-6.27329481, -0.00036498, 0.00022359, 0.00036682, -0.00000115, 0.00000000],
++		[-6.27329491, -0.00036494, 0.00022356, 0.00036677, -0.00000115, 0.00000000],
++		[-6.27329502, -0.00036490, 0.00022353, 0.00036673, -0.00000115, 0.00000000],
++		[-6.27329512, -0.00036485, 0.00022351, 0.00036669, -0.00000115, 0.00000000],
++		[-6.27329522, -0.00036481, 0.00022348, 0.00036664, -0.00000115, 0.00000000],
++		[-6.27329533, -0.00036477, 0.00022345, 0.00036660, -0.00000115, 0.00000000],
++		[-6.27329543, -0.00036472, 0.00022343, 0.00036656, -0.00000115, 0.00000000],
++		[-6.27329553, -0.00036468, 0.00022340, 0.00036651, -0.00000115, 0.00000000],
++		[-6.27329564, -0.00036464, 0.00022338, 0.00036647, -0.00000115, 0.00000000],
++		[-6.27329574, -0.00036460, 0.00022335, 0.00036643, -0.00000115, 0.00000000],
++		[-6.27329584, -0.00036455, 0.00022332, 0.00036639, -0.00000115, 0.00000000],
++		[-6.27329594, -0.00036451, 0.00022330, 0.00036634, -0.00000115, 0.00000000],
++		[-6.27329605, -0.00036447, 0.00022327, 0.00036630, -0.00000115, 0.00000000],
++		[-6.27329615, -0.00036442, 0.00022324, 0.00036626, -0.00000115, 0.00000000],
++		[-6.27329625, -0.00036438, 0.00022322, 0.00036621, -0.00000115, 0.00000000],
++		[-6.27329635, -0.00036434, 0.00022319, 0.00036617, -0.00000115, 0.00000000],
++		[-6.27329646, -0.00036429, 0.00022317, 0.00036613, -0.00000115, 0.00000000],
++		[-6.27329656, -0.00036425, 0.00022314, 0.00036608, -0.00000115, 0.00000000],
++		[-6.27329666, -0.00036421, 0.00022311, 0.00036604, -0.00000115, 0.00000000],
++		[-6.27329677, -0.00036417, 0.00022309, 0.00036600, -0.00000115, 0.00000000],
++		[-6.27329687, -0.00036412, 0.00022306, 0.00036595, -0.00000115, 0.00000000],
++		[-6.27329697, -0.00036408, 0.00022303, 0.00036591, -0.00000115, 0.00000000],
++		[-6.27329707, -0.00036404, 0.00022301, 0.00036587, -0.00000115, 0.00000000],
++		[-6.27329718, -0.00036399, 0.00022298, 0.00036583, -0.00000115, 0.00000000],
++		[-6.27329728, -0.00036395, 0.00022296, 0.00036578, -0.00000115, 0.00000000],
++		[-6.27329738, -0.00036391, 0.00022293, 0.00036574, -0.00000115, 0.00000000],
++		[-6.27329748, -0.00036387, 0.00022290, 0.00036570, -0.00000115, 0.00000000],
++		[-6.27329758, -0.00036382, 0.00022288, 0.00036565, -0.00000115, 0.00000000],
++		[-6.27329769, -0.00036378, 0.00022285, 0.00036561, -0.00000115, 0.00000000],
++		[-6.27329779, -0.00036374, 0.00022282, 0.00036557, -0.00000115, 0.00000000],
++		[-6.27329789, -0.00036370, 0.00022280, 0.00036552, -0.00000115, 0.00000000],
++		[-6.27329799, -0.00036365, 0.00022277, 0.00036548, -0.00000115, 0.00000000],
++		[-6.27329810, -0.00036361, 0.00022275, 0.00036544, -0.00000115, 0.00000000],
++		[-6.27329820, -0.00036357, 0.00022272, 0.00036540, -0.00000115, 0.00000000],
++		[-6.27329830, -0.00036352, 0.00022269, 0.00036535, -0.00000115, 0.00000000],
++		[-6.27329840, -0.00036348, 0.00022267, 0.00036531, -0.00000115, 0.00000000],
++		[-6.27329851, -0.00036344, 0.00022264, 0.00036527, -0.00000115, 0.00000000],
++		[-6.27329861, -0.00036340, 0.00022261, 0.00036522, -0.00000115, 0.00000000],
++		[-6.27329871, -0.00036335, 0.00022259, 0.00036518, -0.00000115, 0.00000000],
++		[-6.27329881, -0.00036331, 0.00022256, 0.00036514, -0.00000115, 0.00000000],
++		[-6.27329891, -0.00036327, 0.00022254, 0.00036510, -0.00000115, 0.00000000],
++		[-6.27329902, -0.00036323, 0.00022251, 0.00036505, -0.00000115, 0.00000000],
++		[-6.27329912, -0.00036318, 0.00022248, 0.00036501, -0.00000115, 0.00000000],
++		[-6.27329922, -0.00036314, 0.00022246, 0.00036497, -0.00000115, 0.00000000],
++		[-6.27329932, -0.00036310, 0.00022243, 0.00036492, -0.00000115, 0.00000000],
++		[-6.27329942, -0.00036306, 0.00022241, 0.00036488, -0.00000115, 0.00000000],
++		[-6.27329953, -0.00036301, 0.00022238, 0.00036484, -0.00000115, 0.00000000],
++		[-6.27329963, -0.00036297, 0.00022235, 0.00036480, -0.00000115, 0.00000000],
++		[-6.27329973, -0.00036293, 0.00022233, 0.00036475, -0.00000115, 0.00000000],
++		[-6.27329983, -0.00036289, 0.00022230, 0.00036471, -0.00000115, 0.00000000],
++		[-6.27329993, -0.00036284, 0.00022228, 0.00036467, -0.00000115, 0.00000000],
++		[-6.27330004, -0.00036280, 0.00022225, 0.00036462, -0.00000115, 0.00000000],
++		[-6.27330014, -0.00036276, 0.00022222, 0.00036458, -0.00000115, 0.00000000],
++		[-6.27330024, -0.00036272, 0.00022220, 0.00036454, -0.00000115, 0.00000000],
++		[-6.27330034, -0.00036267, 0.00022217, 0.00036450, -0.00000115, 0.00000000],
++		[-6.27330044, -0.00036263, 0.00022215, 0.00036445, -0.00000115, 0.00000000],
++		[-6.27330054, -0.00036259, 0.00022212, 0.00036441, -0.00000115, 0.00000000],
++		[-6.27330065, -0.00036255, 0.00022209, 0.00036437, -0.00000115, 0.00000000],
++		[-6.27330075, -0.00036250, 0.00022207, 0.00036433, -0.00000115, 0.00000000],
++		[-6.27330085, -0.00036246, 0.00022204, 0.00036428, -0.00000115, 0.00000000],
++		[-6.27330095, -0.00036242, 0.00022202, 0.00036424, -0.00000115, 0.00000000],
++		[-6.27330105, -0.00036238, 0.00022199, 0.00036420, -0.00000115, 0.00000000],
++		[-6.27330115, -0.00036233, 0.00022196, 0.00036416, -0.00000115, 0.00000000],
++		[-6.27330126, -0.00036229, 0.00022194, 0.00036411, -0.00000115, 0.00000000],
++		[-6.27330136, -0.00036225, 0.00022191, 0.00036407, -0.00000115, 0.00000000],
++		[-6.27330146, -0.00036221, 0.00022189, 0.00036403, -0.00000115, 0.00000000],
++		[-6.27330156, -0.00036216, 0.00022186, 0.00036398, -0.00000115, 0.00000000],
++		[-6.27330166, -0.00036212, 0.00022183, 0.00036394, -0.00000115, 0.00000000],
++		[-6.27330176, -0.00036208, 0.00022181, 0.00036390, -0.00000115, 0.00000000],
++		[-6.27330186, -0.00036204, 0.00022178, 0.00036386, -0.00000115, 0.00000000],
++		[-6.27330197, -0.00036199, 0.00022176, 0.00036381, -0.00000115, 0.00000000],
++		[-6.27330207, -0.00036195, 0.00022173, 0.00036377, -0.00000115, 0.00000000],
++		[-6.27330217, -0.00036191, 0.00022170, 0.00036373, -0.00000115, 0.00000000],
++		[-6.27330227, -0.00036187, 0.00022168, 0.00036369, -0.00000115, 0.00000000],
++		[-6.27330237, -0.00036182, 0.00022165, 0.00036364, -0.00000115, 0.00000000],
++		[-6.27330247, -0.00036178, 0.00022163, 0.00036360, -0.00000115, 0.00000000],
++		[-6.27330257, -0.00036174, 0.00022160, 0.00036356, -0.00000115, 0.00000000],
++		[-6.27330267, -0.00036170, 0.00022157, 0.00036352, -0.00000115, 0.00000000],
++		[-6.27330278, -0.00036166, 0.00022155, 0.00036347, -0.00000115, 0.00000000],
++		[-6.27330288, -0.00036161, 0.00022152, 0.00036343, -0.00000115, 0.00000000],
++		[-6.27330298, -0.00036157, 0.00022150, 0.00036339, -0.00000115, 0.00000000],
++		[-6.27330308, -0.00036153, 0.00022147, 0.00036335, -0.00000115, 0.00000000],
++		[-6.27330318, -0.00036149, 0.00022144, 0.00036330, -0.00000115, 0.00000000],
++		[-6.27330328, -0.00036144, 0.00022142, 0.00036326, -0.00000115, 0.00000000],
++		[-6.27330338, -0.00036140, 0.00022139, 0.00036322, -0.00000115, 0.00000000],
++		[-6.27330348, -0.00036136, 0.00022137, 0.00036318, -0.00000115, 0.00000000],
++		[-6.27330358, -0.00036132, 0.00022134, 0.00036313, -0.00000115, 0.00000000],
++		[-6.27330368, -0.00036128, 0.00022132, 0.00036309, -0.00000115, 0.00000000],
++		[-6.27330379, -0.00036123, 0.00022129, 0.00036305, -0.00000115, 0.00000000],
++		[-6.27330389, -0.00036119, 0.00022126, 0.00036301, -0.00000115, 0.00000000],
++		[-6.27330399, -0.00036115, 0.00022124, 0.00036297, -0.00000115, 0.00000000],
++		[-6.27330409, -0.00036111, 0.00022121, 0.00036292, -0.00000115, 0.00000000],
++		[-6.27330419, -0.00036107, 0.00022119, 0.00036288, -0.00000115, 0.00000000],
++		[-6.27330429, -0.00036102, 0.00022116, 0.00036284, -0.00000115, 0.00000000],
++		[-6.27330439, -0.00036098, 0.00022113, 0.00036280, -0.00000115, 0.00000000],
++		[-6.27330449, -0.00036094, 0.00022111, 0.00036275, -0.00000115, 0.00000000],
++		[-6.27330459, -0.00036090, 0.00022108, 0.00036271, -0.00000115, 0.00000000],
++		[-6.27330469, -0.00036085, 0.00022106, 0.00036267, -0.00000115, 0.00000000],
++		[-6.27330479, -0.00036081, 0.00022103, 0.00036263, -0.00000115, 0.00000000],
++		[-6.27330489, -0.00036077, 0.00022101, 0.00036258, -0.00000115, 0.00000000],
++		[-6.27330499, -0.00036073, 0.00022098, 0.00036254, -0.00000115, 0.00000000],
++		[-6.27330510, -0.00036069, 0.00022095, 0.00036250, -0.00000115, 0.00000000],
++		[-6.27330520, -0.00036064, 0.00022093, 0.00036246, -0.00000115, 0.00000000],
++		[-6.27330530, -0.00036060, 0.00022090, 0.00036242, -0.00000115, 0.00000000],
++		[-6.27330540, -0.00036056, 0.00022088, 0.00036237, -0.00000115, 0.00000000],
++		[-6.27330550, -0.00036052, 0.00022085, 0.00036233, -0.00000115, 0.00000000],
++		[-6.27330560, -0.00036048, 0.00022083, 0.00036229, -0.00000115, 0.00000000],
++		[-6.27330570, -0.00036043, 0.00022080, 0.00036225, -0.00000115, 0.00000000],
++		[-6.27330580, -0.00036039, 0.00022077, 0.00036220, -0.00000115, 0.00000000],
++		[-6.27330590, -0.00036035, 0.00022075, 0.00036216, -0.00000115, 0.00000000],
++		[-6.27330600, -0.00036031, 0.00022072, 0.00036212, -0.00000115, 0.00000000],
++		[-6.27330610, -0.00036027, 0.00022070, 0.00036208, -0.00000115, 0.00000000],
++		[-6.27330620, -0.00036023, 0.00022067, 0.00036204, -0.00000115, 0.00000000],
++		[-6.27330630, -0.00036018, 0.00022065, 0.00036199, -0.00000115, 0.00000000],
++		[-6.27330640, -0.00036014, 0.00022062, 0.00036195, -0.00000115, 0.00000000],
++		[-6.27330650, -0.00036010, 0.00022059, 0.00036191, -0.00000115, 0.00000000],
++		[-6.27330660, -0.00036006, 0.00022057, 0.00036187, -0.00000115, 0.00000000],
++		[-6.27330670, -0.00036002, 0.00022054, 0.00036183, -0.00000115, 0.00000000],
++		[-6.27330680, -0.00035997, 0.00022052, 0.00036178, -0.00000115, 0.00000000],
++		[-6.27330690, -0.00035993, 0.00022049, 0.00036174, -0.00000115, 0.00000000],
++		[-6.27330700, -0.00035989, 0.00022047, 0.00036170, -0.00000115, 0.00000000],
++		[-6.27330710, -0.00035985, 0.00022044, 0.00036166, -0.00000115, 0.00000000],
++		[-6.27330720, -0.00035981, 0.00022041, 0.00036162, -0.00000115, 0.00000000],
++		[-6.27330730, -0.00035976, 0.00022039, 0.00036157, -0.00000115, 0.00000000],
++		[-6.27330740, -0.00035972, 0.00022036, 0.00036153, -0.00000115, 0.00000000],
++		[-6.27330750, -0.00035968, 0.00022034, 0.00036149, -0.00000115, 0.00000000],
++		[-6.27330760, -0.00035964, 0.00022031, 0.00036145, -0.00000115, 0.00000000],
++		[-6.27330770, -0.00035960, 0.00022029, 0.00036141, -0.00000115, 0.00000000],
++		[-6.27330780, -0.00035956, 0.00022026, 0.00036136, -0.00000115, 0.00000000],
++		[-6.27330790, -0.00035951, 0.00022024, 0.00036132, -0.00000115, 0.00000000],
++		[-6.27330800, -0.00035947, 0.00022021, 0.00036128, -0.00000115, 0.00000000],
++		[-6.27330810, -0.00035943, 0.00022018, 0.00036124, -0.00000115, 0.00000000],
++		[-6.27330820, -0.00035939, 0.00022016, 0.00036120, -0.00000115, 0.00000000],
++		[-6.27330830, -0.00035935, 0.00022013, 0.00036115, -0.00000115, 0.00000000],
++		[-6.27330840, -0.00035931, 0.00022011, 0.00036111, -0.00000115, 0.00000000],
++		[-6.27330850, -0.00035926, 0.00022008, 0.00036107, -0.00000115, 0.00000000],
++		[-6.27330860, -0.00035922, 0.00022006, 0.00036103, -0.00000115, 0.00000000],
++		[-6.27330870, -0.00035918, 0.00022003, 0.00036099, -0.00000115, 0.00000000],
++		[-6.27330880, -0.00035914, 0.00022001, 0.00036094, -0.00000115, 0.00000000],
++		[-6.27330890, -0.00035910, 0.00021998, 0.00036090, -0.00000115, 0.00000000],
++		[-6.27330900, -0.00035906, 0.00021995, 0.00036086, -0.00000115, 0.00000000],
++		[-6.27330910, -0.00035901, 0.00021993, 0.00036082, -0.00000115, 0.00000000],
++		[-6.27330920, -0.00035897, 0.00021990, 0.00036078, -0.00000115, 0.00000000],
++		[-6.27330930, -0.00035893, 0.00021988, 0.00036073, -0.00000115, 0.00000000],
++		[-6.27330940, -0.00035889, 0.00021985, 0.00036069, -0.00000115, 0.00000000],
++		[-6.27330950, -0.00035885, 0.00021983, 0.00036065, -0.00000115, 0.00000000],
++		[-6.27330960, -0.00035881, 0.00021980, 0.00036061, -0.00000115, 0.00000000],
++		[-6.27330970, -0.00035876, 0.00021978, 0.00036057, -0.00000115, 0.00000000],
++		[-6.27330980, -0.00035872, 0.00021975, 0.00036053, -0.00000115, 0.00000000],
++		[-6.27330990, -0.00035868, 0.00021972, 0.00036048, -0.00000115, 0.00000000],
++		[-6.27331000, -0.00035864, 0.00021970, 0.00036044, -0.00000115, 0.00000000],
++		[-6.27331010, -0.00035860, 0.00021967, 0.00036040, -0.00000115, 0.00000000],
++		[-6.27331020, -0.00035856, 0.00021965, 0.00036036, -0.00000115, 0.00000000],
++		[-6.27331030, -0.00035851, 0.00021962, 0.00036032, -0.00000115, 0.00000000],
++		[-6.27331040, -0.00035847, 0.00021960, 0.00036028, -0.00000115, 0.00000000],
++		[-6.27331050, -0.00035843, 0.00021957, 0.00036023, -0.00000115, 0.00000000],
++		[-6.27331059, -0.00035839, 0.00021955, 0.00036019, -0.00000115, 0.00000000],
++		[-6.27331069, -0.00035835, 0.00021952, 0.00036015, -0.00000115, 0.00000000],
++		[-6.27331079, -0.00035831, 0.00021950, 0.00036011, -0.00000115, 0.00000000],
++		[-6.27331089, -0.00035827, 0.00021947, 0.00036007, -0.00000115, 0.00000000],
++		[-6.27331099, -0.00035822, 0.00021944, 0.00036002, -0.00000115, 0.00000000],
++		[-6.27331109, -0.00035818, 0.00021942, 0.00035998, -0.00000115, 0.00000000],
++		[-6.27331119, -0.00035814, 0.00021939, 0.00035994, -0.00000115, 0.00000000],
++		[-6.27331129, -0.00035810, 0.00021937, 0.00035990, -0.00000115, 0.00000000],
++		[-6.27331139, -0.00035806, 0.00021934, 0.00035986, -0.00000115, 0.00000000],
++		[-6.27331149, -0.00035802, 0.00021932, 0.00035982, -0.00000115, 0.00000000],
++		[-6.27331159, -0.00035798, 0.00021929, 0.00035978, -0.00000115, 0.00000000],
++		[-6.27331169, -0.00035793, 0.00021927, 0.00035973, -0.00000115, 0.00000000],
++		[-6.27331179, -0.00035789, 0.00021924, 0.00035969, -0.00000115, 0.00000000],
++		[-6.27331188, -0.00035785, 0.00021922, 0.00035965, -0.00000115, 0.00000000],
++		[-6.27331198, -0.00035781, 0.00021919, 0.00035961, -0.00000115, 0.00000000],
++		[-6.27331208, -0.00035777, 0.00021917, 0.00035957, -0.00000115, 0.00000000],
++		[-6.27331218, -0.00035773, 0.00021914, 0.00035953, -0.00000115, 0.00000000],
++		[-6.27331228, -0.00035769, 0.00021911, 0.00035948, -0.00000115, 0.00000000],
++		[-6.27331238, -0.00035764, 0.00021909, 0.00035944, -0.00000115, 0.00000000],
++		[-6.27331248, -0.00035760, 0.00021906, 0.00035940, -0.00000115, 0.00000000],
++		[-6.27331258, -0.00035756, 0.00021904, 0.00035936, -0.00000115, 0.00000000],
++		[-6.27331268, -0.00035752, 0.00021901, 0.00035932, -0.00000115, 0.00000000],
++		[-6.27331277, -0.00035748, 0.00021899, 0.00035928, -0.00000115, 0.00000000],
++		[-6.27331287, -0.00035744, 0.00021896, 0.00035923, -0.00000115, 0.00000000],
++		[-6.27331297, -0.00035740, 0.00021894, 0.00035919, -0.00000115, 0.00000000],
++		[-6.27331307, -0.00035736, 0.00021891, 0.00035915, -0.00000115, 0.00000000],
++		[-6.27331317, -0.00035731, 0.00021889, 0.00035911, -0.00000115, 0.00000000],
++		[-6.27331327, -0.00035727, 0.00021886, 0.00035907, -0.00000115, 0.00000000],
++		[-6.27331337, -0.00035723, 0.00021884, 0.00035903, -0.00000115, 0.00000000],
++		[-6.27331347, -0.00035719, 0.00021881, 0.00035899, -0.00000115, 0.00000000],
++		[-6.27331356, -0.00035715, 0.00021879, 0.00035894, -0.00000115, 0.00000000],
++		[-6.27331366, -0.00035711, 0.00021876, 0.00035890, -0.00000115, 0.00000000],
++		[-6.27331376, -0.00035707, 0.00021874, 0.00035886, -0.00000115, 0.00000000],
++		[-6.27331386, -0.00035703, 0.00021871, 0.00035882, -0.00000115, 0.00000000],
++		[-6.27331396, -0.00035698, 0.00021869, 0.00035878, -0.00000115, 0.00000000],
++		[-6.27331406, -0.00035694, 0.00021866, 0.00035874, -0.00000115, 0.00000000],
++		[-6.27331416, -0.00035690, 0.00021863, 0.00035870, -0.00000115, 0.00000000],
++		[-6.27331425, -0.00035686, 0.00021861, 0.00035866, -0.00000115, 0.00000000],
++		[-6.27331435, -0.00035682, 0.00021858, 0.00035861, -0.00000115, 0.00000000],
++		[-6.27331445, -0.00035678, 0.00021856, 0.00035857, -0.00000115, 0.00000000],
++		[-6.27331455, -0.00035674, 0.00021853, 0.00035853, -0.00000115, 0.00000000],
++		[-6.27331465, -0.00035670, 0.00021851, 0.00035849, -0.00000115, 0.00000000],
++		[-6.27331475, -0.00035666, 0.00021848, 0.00035845, -0.00000115, 0.00000000],
++		[-6.27331485, -0.00035661, 0.00021846, 0.00035841, -0.00000115, 0.00000000],
++		[-6.27331494, -0.00035657, 0.00021843, 0.00035837, -0.00000115, 0.00000000],
++		[-6.27331504, -0.00035653, 0.00021841, 0.00035832, -0.00000115, 0.00000000],
++		[-6.27331514, -0.00035649, 0.00021838, 0.00035828, -0.00000115, 0.00000000],
++		[-6.27331524, -0.00035645, 0.00021836, 0.00035824, -0.00000115, 0.00000000],
++		[-6.27331534, -0.00035641, 0.00021833, 0.00035820, -0.00000115, 0.00000000],
++		[-6.27331543, -0.00035637, 0.00021831, 0.00035816, -0.00000115, 0.00000000],
++		[-6.27331553, -0.00035633, 0.00021828, 0.00035812, -0.00000115, 0.00000000],
++		[-6.27331563, -0.00035629, 0.00021826, 0.00035808, -0.00000115, 0.00000000],
++		[-6.27331573, -0.00035625, 0.00021823, 0.00035804, -0.00000115, 0.00000000],
++		[-6.27331583, -0.00035620, 0.00021821, 0.00035799, -0.00000115, 0.00000000],
++		[-6.27331593, -0.00035616, 0.00021818, 0.00035795, -0.00000115, 0.00000000],
++		[-6.27331602, -0.00035612, 0.00021816, 0.00035791, -0.00000115, 0.00000000],
++		[-6.27331612, -0.00035608, 0.00021813, 0.00035787, -0.00000115, 0.00000000],
++		[-6.27331622, -0.00035604, 0.00021811, 0.00035783, -0.00000115, 0.00000000],
++		[-6.27331632, -0.00035600, 0.00021808, 0.00035779, -0.00000115, 0.00000000],
++		[-6.27331642, -0.00035596, 0.00021806, 0.00035775, -0.00000115, 0.00000000],
++		[-6.27331651, -0.00035592, 0.00021803, 0.00035771, -0.00000115, 0.00000000],
++		[-6.27331661, -0.00035588, 0.00021801, 0.00035767, -0.00000115, 0.00000000],
++		[-6.27331671, -0.00035584, 0.00021798, 0.00035762, -0.00000115, 0.00000000],
++		[-6.27331681, -0.00035579, 0.00021796, 0.00035758, -0.00000115, 0.00000000],
++		[-6.27331691, -0.00035575, 0.00021793, 0.00035754, -0.00000115, 0.00000000],
++		[-6.27331700, -0.00035571, 0.00021791, 0.00035750, -0.00000115, 0.00000000],
++		[-6.27331710, -0.00035567, 0.00021788, 0.00035746, -0.00000115, 0.00000000],
++		[-6.27331720, -0.00035563, 0.00021786, 0.00035742, -0.00000115, 0.00000000],
++		[-6.27331730, -0.00035559, 0.00021783, 0.00035738, -0.00000115, 0.00000000],
++		[-6.27331740, -0.00035555, 0.00021781, 0.00035734, -0.00000115, 0.00000000],
++		[-6.27331749, -0.00035551, 0.00021778, 0.00035730, -0.00000115, 0.00000000],
++		[-6.27331759, -0.00035547, 0.00021776, 0.00035725, -0.00000115, 0.00000000],
++		[-6.27331769, -0.00035543, 0.00021773, 0.00035721, -0.00000115, 0.00000000],
++		[-6.27331779, -0.00035539, 0.00021771, 0.00035717, -0.00000115, 0.00000000],
++		[-6.27331788, -0.00035535, 0.00021768, 0.00035713, -0.00000115, 0.00000000],
++		[-6.27331798, -0.00035530, 0.00021766, 0.00035709, -0.00000115, 0.00000000],
++		[-6.27331808, -0.00035526, 0.00021763, 0.00035705, -0.00000115, 0.00000000],
++		[-6.27331818, -0.00035522, 0.00021761, 0.00035701, -0.00000115, 0.00000000],
++		[-6.27331827, -0.00035518, 0.00021758, 0.00035697, -0.00000115, 0.00000000],
++		[-6.27331837, -0.00035514, 0.00021756, 0.00035693, -0.00000115, 0.00000000],
++		[-6.27331847, -0.00035510, 0.00021753, 0.00035689, -0.00000115, 0.00000000],
++		[-6.27331857, -0.00035506, 0.00021751, 0.00035684, -0.00000115, 0.00000000],
++		[-6.27331866, -0.00035502, 0.00021748, 0.00035680, -0.00000115, 0.00000000],
++		[-6.27331876, -0.00035498, 0.00021746, 0.00035676, -0.00000115, 0.00000000],
++		[-6.27331886, -0.00035494, 0.00021743, 0.00035672, -0.00000115, 0.00000000],
++		[-6.27331896, -0.00035490, 0.00021741, 0.00035668, -0.00000115, 0.00000000],
++		[-6.27331905, -0.00035486, 0.00021738, 0.00035664, -0.00000115, 0.00000000],
++		[-6.27331915, -0.00035482, 0.00021736, 0.00035660, -0.00000115, 0.00000000],
++		[-6.27331925, -0.00035478, 0.00021733, 0.00035656, -0.00000115, 0.00000000],
++		[-6.27331935, -0.00035473, 0.00021731, 0.00035652, -0.00000115, 0.00000000],
++		[-6.27331944, -0.00035469, 0.00021728, 0.00035648, -0.00000115, 0.00000000],
++		[-6.27331954, -0.00035465, 0.00021726, 0.00035644, -0.00000115, 0.00000000],
++		[-6.27331964, -0.00035461, 0.00021723, 0.00035640, -0.00000115, 0.00000000],
++		[-6.27331974, -0.00035457, 0.00021721, 0.00035635, -0.00000115, 0.00000000],
++		[-6.27331983, -0.00035453, 0.00021718, 0.00035631, -0.00000115, 0.00000000],
++		[-6.27331993, -0.00035449, 0.00021716, 0.00035627, -0.00000115, 0.00000000],
++		[-6.27332003, -0.00035445, 0.00021713, 0.00035623, -0.00000115, 0.00000000],
++		[-6.27332012, -0.00035441, 0.00021711, 0.00035619, -0.00000115, 0.00000000],
++		[-6.27332022, -0.00035437, 0.00021708, 0.00035615, -0.00000115, 0.00000000],
++		[-6.27332032, -0.00035433, 0.00021706, 0.00035611, -0.00000115, 0.00000000],
++		[-6.27332042, -0.00035429, 0.00021703, 0.00035607, -0.00000115, 0.00000000],
++		[-6.27332051, -0.00035425, 0.00021701, 0.00035603, -0.00000115, 0.00000000],
++		[-6.27332061, -0.00035421, 0.00021698, 0.00035599, -0.00000115, 0.00000000],
++		[-6.27332071, -0.00035417, 0.00021696, 0.00035595, -0.00000115, 0.00000000],
++		[-6.27332080, -0.00035413, 0.00021693, 0.00035591, -0.00000115, 0.00000000],
++		[-6.27332090, -0.00035409, 0.00021691, 0.00035587, -0.00000115, 0.00000000],
++		[-6.27332100, -0.00035405, 0.00021688, 0.00035582, -0.00000115, 0.00000000],
++		[-6.27332109, -0.00035400, 0.00021686, 0.00035578, -0.00000115, 0.00000000],
++		[-6.27332119, -0.00035396, 0.00021683, 0.00035574, -0.00000115, 0.00000000],
++		[-6.27332129, -0.00035392, 0.00021681, 0.00035570, -0.00000115, 0.00000000],
++		[-6.27332139, -0.00035388, 0.00021678, 0.00035566, -0.00000115, 0.00000000],
++		[-6.27332148, -0.00035384, 0.00021676, 0.00035562, -0.00000115, 0.00000000],
++		[-6.27332158, -0.00035380, 0.00021673, 0.00035558, -0.00000115, 0.00000000],
++		[-6.27332168, -0.00035376, 0.00021671, 0.00035554, -0.00000115, 0.00000000],
++		[-6.27332177, -0.00035372, 0.00021669, 0.00035550, -0.00000115, 0.00000000],
++		[-6.27332187, -0.00035368, 0.00021666, 0.00035546, -0.00000115, 0.00000000],
++		[-6.27332197, -0.00035364, 0.00021664, 0.00035542, -0.00000115, 0.00000000],
++		[-6.27332206, -0.00035360, 0.00021661, 0.00035538, -0.00000115, 0.00000000],
++		[-6.27332216, -0.00035356, 0.00021659, 0.00035534, -0.00000115, 0.00000000],
++		[-6.27332226, -0.00035352, 0.00021656, 0.00035530, -0.00000115, 0.00000000],
++		[-6.27332235, -0.00035348, 0.00021654, 0.00035526, -0.00000115, 0.00000000],
++		[-6.27332245, -0.00035344, 0.00021651, 0.00035522, -0.00000115, 0.00000000],
++		[-6.27332255, -0.00035340, 0.00021649, 0.00035517, -0.00000115, 0.00000000],
++		[-6.27332264, -0.00035336, 0.00021646, 0.00035513, -0.00000115, 0.00000000],
++		[-6.27332274, -0.00035332, 0.00021644, 0.00035509, -0.00000115, 0.00000000],
++		[-6.27332284, -0.00035328, 0.00021641, 0.00035505, -0.00000115, 0.00000000],
++		[-6.27332293, -0.00035324, 0.00021639, 0.00035501, -0.00000115, 0.00000000],
++		[-6.27332303, -0.00035320, 0.00021636, 0.00035497, -0.00000115, 0.00000000],
++		[-6.27332313, -0.00035316, 0.00021634, 0.00035493, -0.00000115, 0.00000000],
++		[-6.27332322, -0.00035312, 0.00021631, 0.00035489, -0.00000115, 0.00000000],
++		[-6.27332332, -0.00035308, 0.00021629, 0.00035485, -0.00000115, 0.00000000],
++		[-6.27332341, -0.00035304, 0.00021626, 0.00035481, -0.00000115, 0.00000000],
++		[-6.27332351, -0.00035300, 0.00021624, 0.00035477, -0.00000115, 0.00000000],
++		[-6.27332361, -0.00035296, 0.00021622, 0.00035473, -0.00000115, 0.00000000],
++		[-6.27332370, -0.00035291, 0.00021619, 0.00035469, -0.00000115, 0.00000000],
++		[-6.27332380, -0.00035287, 0.00021617, 0.00035465, -0.00000115, 0.00000000],
++		[-6.27332390, -0.00035283, 0.00021614, 0.00035461, -0.00000115, 0.00000000],
++		[-6.27332399, -0.00035279, 0.00021612, 0.00035457, -0.00000115, 0.00000000],
++		[-6.27332409, -0.00035275, 0.00021609, 0.00035453, -0.00000115, 0.00000000],
++		[-6.27332418, -0.00035271, 0.00021607, 0.00035449, -0.00000115, 0.00000000],
++		[-6.27332428, -0.00035267, 0.00021604, 0.00035445, -0.00000115, 0.00000000],
++		[-6.27332438, -0.00035263, 0.00021602, 0.00035441, -0.00000115, 0.00000000],
++		[-6.27332447, -0.00035259, 0.00021599, 0.00035437, -0.00000115, 0.00000000],
++		[-6.27332457, -0.00035255, 0.00021597, 0.00035432, -0.00000115, 0.00000000],
++		[-6.27332467, -0.00035251, 0.00021594, 0.00035428, -0.00000115, 0.00000000],
++		[-6.27332476, -0.00035247, 0.00021592, 0.00035424, -0.00000115, 0.00000000],
++		[-6.27332486, -0.00035243, 0.00021590, 0.00035420, -0.00000115, 0.00000000],
++		[-6.27332495, -0.00035239, 0.00021587, 0.00035416, -0.00000115, 0.00000000],
++		[-6.27332505, -0.00035235, 0.00021585, 0.00035412, -0.00000115, 0.00000000],
++		[-6.27332515, -0.00035231, 0.00021582, 0.00035408, -0.00000115, 0.00000000],
++		[-6.27332524, -0.00035227, 0.00021580, 0.00035404, -0.00000115, 0.00000000],
++		[-6.27332534, -0.00035223, 0.00021577, 0.00035400, -0.00000115, 0.00000000],
++		[-6.27332543, -0.00035219, 0.00021575, 0.00035396, -0.00000115, 0.00000000],
++		[-6.27332553, -0.00035215, 0.00021572, 0.00035392, -0.00000115, 0.00000000],
++		[-6.27332563, -0.00035211, 0.00021570, 0.00035388, -0.00000115, 0.00000000],
++		[-6.27332572, -0.00035207, 0.00021567, 0.00035384, -0.00000115, 0.00000000],
++		[-6.27332582, -0.00035203, 0.00021565, 0.00035380, -0.00000115, 0.00000000],
++		[-6.27332591, -0.00035199, 0.00021563, 0.00035376, -0.00000115, 0.00000000],
++		[-6.27332601, -0.00035195, 0.00021560, 0.00035372, -0.00000115, 0.00000000],
++		[-6.27332611, -0.00035191, 0.00021558, 0.00035368, -0.00000115, 0.00000000],
++		[-6.27332620, -0.00035187, 0.00021555, 0.00035364, -0.00000115, 0.00000000],
++		[-6.27332630, -0.00035183, 0.00021553, 0.00035360, -0.00000115, 0.00000000],
++		[-6.27332639, -0.00035179, 0.00021550, 0.00035356, -0.00000115, 0.00000000],
++		[-6.27332649, -0.00035175, 0.00021548, 0.00035352, -0.00000115, 0.00000000],
++		[-6.27332658, -0.00035171, 0.00021545, 0.00035348, -0.00000115, 0.00000000],
++		[-6.27332668, -0.00035167, 0.00021543, 0.00035344, -0.00000115, 0.00000000],
++		[-6.27332678, -0.00035163, 0.00021540, 0.00035340, -0.00000115, 0.00000000],
++		[-6.27332687, -0.00035159, 0.00021538, 0.00035336, -0.00000115, 0.00000000],
++		[-6.27332697, -0.00035155, 0.00021536, 0.00035332, -0.00000115, 0.00000000],
++		[-6.27332706, -0.00035151, 0.00021533, 0.00035328, -0.00000115, 0.00000000],
++		[-6.27332716, -0.00035147, 0.00021531, 0.00035324, -0.00000115, 0.00000000],
++		[-6.27332725, -0.00035143, 0.00021528, 0.00035320, -0.00000115, 0.00000000],
++		[-6.27332735, -0.00035139, 0.00021526, 0.00035316, -0.00000115, 0.00000000],
++		[-6.27332744, -0.00035135, 0.00021523, 0.00035312, -0.00000115, 0.00000000],
++		[-6.27332754, -0.00035131, 0.00021521, 0.00035308, -0.00000115, 0.00000000],
++		[-6.27332763, -0.00035127, 0.00021518, 0.00035304, -0.00000115, 0.00000000],
++		[-6.27332773, -0.00035123, 0.00021516, 0.00035300, -0.00000115, 0.00000000],
++		[-6.27332783, -0.00035119, 0.00021514, 0.00035296, -0.00000115, 0.00000000],
++		[-6.27332792, -0.00035115, 0.00021511, 0.00035292, -0.00000115, 0.00000000],
++		[-6.27332802, -0.00035111, 0.00021509, 0.00035288, -0.00000115, 0.00000000],
++		[-6.27332811, -0.00035107, 0.00021506, 0.00035284, -0.00000115, 0.00000000],
++		[-6.27332821, -0.00035103, 0.00021504, 0.00035280, -0.00000115, 0.00000000],
++		[-6.27332830, -0.00035099, 0.00021501, 0.00035276, -0.00000115, 0.00000000],
++		[-6.27332840, -0.00035095, 0.00021499, 0.00035272, -0.00000115, 0.00000000],
++		[-6.27332849, -0.00035091, 0.00021496, 0.00035268, -0.00000115, 0.00000000],
++		[-6.27332859, -0.00035087, 0.00021494, 0.00035264, -0.00000115, 0.00000000],
++		[-6.27332868, -0.00035084, 0.00021492, 0.00035260, -0.00000115, 0.00000000],
++		[-6.27332878, -0.00035080, 0.00021489, 0.00035256, -0.00000115, 0.00000000],
++		[-6.27332887, -0.00035076, 0.00021487, 0.00035252, -0.00000115, 0.00000000],
++		[-6.27332897, -0.00035072, 0.00021484, 0.00035248, -0.00000115, 0.00000000],
++		[-6.27332906, -0.00035068, 0.00021482, 0.00035244, -0.00000115, 0.00000000],
++		[-6.27332916, -0.00035064, 0.00021479, 0.00035240, -0.00000115, 0.00000000],
++		[-6.27332925, -0.00035060, 0.00021477, 0.00035236, -0.00000115, 0.00000000],
++		[-6.27332935, -0.00035056, 0.00021475, 0.00035232, -0.00000115, 0.00000000],
++		[-6.27332944, -0.00035052, 0.00021472, 0.00035228, -0.00000115, 0.00000000],
++		[-6.27332954, -0.00035048, 0.00021470, 0.00035224, -0.00000115, 0.00000000],
++		[-6.27332963, -0.00035044, 0.00021467, 0.00035220, -0.00000115, 0.00000000],
++		[-6.27332973, -0.00035040, 0.00021465, 0.00035216, -0.00000115, 0.00000000],
++		[-6.27332982, -0.00035036, 0.00021462, 0.00035212, -0.00000115, 0.00000000],
++		[-6.27332992, -0.00035032, 0.00021460, 0.00035208, -0.00000115, 0.00000000],
++		[-6.27333001, -0.00035028, 0.00021458, 0.00035204, -0.00000115, 0.00000000],
++		[-6.27333011, -0.00035024, 0.00021455, 0.00035200, -0.00000115, 0.00000000],
++		[-6.27333020, -0.00035020, 0.00021453, 0.00035196, -0.00000115, 0.00000000],
++		[-6.27333030, -0.00035016, 0.00021450, 0.00035192, -0.00000115, 0.00000000],
++		[-6.27333039, -0.00035012, 0.00021448, 0.00035188, -0.00000115, 0.00000000],
++		[-6.27333049, -0.00035008, 0.00021445, 0.00035184, -0.00000115, 0.00000000],
++		[-6.27333058, -0.00035004, 0.00021443, 0.00035180, -0.00000115, 0.00000000],
++		[-6.27333068, -0.00035000, 0.00021441, 0.00035176, -0.00000115, 0.00000000],
++		[-6.27333077, -0.00034996, 0.00021438, 0.00035172, -0.00000115, 0.00000000],
++		[-6.27333087, -0.00034992, 0.00021436, 0.00035168, -0.00000115, 0.00000000],
++		[-6.27333096, -0.00034988, 0.00021433, 0.00035164, -0.00000115, 0.00000000],
++		[-6.27333106, -0.00034984, 0.00021431, 0.00035160, -0.00000115, 0.00000000],
++		[-6.27333115, -0.00034980, 0.00021428, 0.00035156, -0.00000115, 0.00000000],
++		[-6.27333125, -0.00034976, 0.00021426, 0.00035152, -0.00000115, 0.00000000],
++		[-6.27333134, -0.00034973, 0.00021424, 0.00035148, -0.00000115, 0.00000000],
++		[-6.27333144, -0.00034969, 0.00021421, 0.00035144, -0.00000115, 0.00000000],
++		[-6.27333153, -0.00034965, 0.00021419, 0.00035140, -0.00000115, 0.00000000],
++		[-6.27333162, -0.00034961, 0.00021416, 0.00035136, -0.00000115, 0.00000000],
++		[-6.27333172, -0.00034957, 0.00021414, 0.00035132, -0.00000115, 0.00000000],
++		[-6.27333181, -0.00034953, 0.00021412, 0.00035128, -0.00000115, 0.00000000],
++		[-6.27333191, -0.00034949, 0.00021409, 0.00035124, -0.00000115, 0.00000000],
++		[-6.27333200, -0.00034945, 0.00021407, 0.00035120, -0.00000115, 0.00000000],
++		[-6.27333210, -0.00034941, 0.00021404, 0.00035117, -0.00000115, 0.00000000],
++		[-6.27333219, -0.00034937, 0.00021402, 0.00035113, -0.00000115, 0.00000000],
++		[-6.27333229, -0.00034933, 0.00021399, 0.00035109, -0.00000115, 0.00000000],
++		[-6.27333238, -0.00034929, 0.00021397, 0.00035105, -0.00000115, 0.00000000],
++		[-6.27333247, -0.00034925, 0.00021395, 0.00035101, -0.00000115, 0.00000000],
++		[-6.27333257, -0.00034921, 0.00021392, 0.00035097, -0.00000115, 0.00000000],
++		[-6.27333266, -0.00034917, 0.00021390, 0.00035093, -0.00000115, 0.00000000],
++		[-6.27333276, -0.00034913, 0.00021387, 0.00035089, -0.00000115, 0.00000000],
++		[-6.27333285, -0.00034909, 0.00021385, 0.00035085, -0.00000115, 0.00000000],
++		[-6.27333295, -0.00034905, 0.00021383, 0.00035081, -0.00000115, 0.00000000],
++		[-6.27333304, -0.00034902, 0.00021380, 0.00035077, -0.00000115, 0.00000000],
++		[-6.27333313, -0.00034898, 0.00021378, 0.00035073, -0.00000115, 0.00000000],
++		[-6.27333323, -0.00034894, 0.00021375, 0.00035069, -0.00000115, 0.00000000],
++		[-6.27333332, -0.00034890, 0.00021373, 0.00035065, -0.00000115, 0.00000000],
++		[-6.27333342, -0.00034886, 0.00021370, 0.00035061, -0.00000115, 0.00000000],
++		[-6.27333351, -0.00034882, 0.00021368, 0.00035057, -0.00000115, 0.00000000],
++		[-6.27333360, -0.00034878, 0.00021366, 0.00035053, -0.00000115, 0.00000000],
++		[-6.27333370, -0.00034874, 0.00021363, 0.00035049, -0.00000115, 0.00000000],
++		[-6.27333379, -0.00034870, 0.00021361, 0.00035045, -0.00000115, 0.00000000],
++		[-6.27333389, -0.00034866, 0.00021358, 0.00035041, -0.00000115, 0.00000000],
++		[-6.27333398, -0.00034862, 0.00021356, 0.00035037, -0.00000115, 0.00000000],
++		[-6.27333408, -0.00034858, 0.00021354, 0.00035033, -0.00000115, 0.00000000],
++		[-6.27333417, -0.00034854, 0.00021351, 0.00035030, -0.00000115, 0.00000000],
++		[-6.27333426, -0.00034850, 0.00021349, 0.00035026, -0.00000115, 0.00000000],
++		[-6.27333436, -0.00034847, 0.00021346, 0.00035022, -0.00000115, 0.00000000],
++		[-6.27333445, -0.00034843, 0.00021344, 0.00035018, -0.00000115, 0.00000000],
++		[-6.27333454, -0.00034839, 0.00021342, 0.00035014, -0.00000115, 0.00000000],
++		[-6.27333464, -0.00034835, 0.00021339, 0.00035010, -0.00000115, 0.00000000],
++		[-6.27333473, -0.00034831, 0.00021337, 0.00035006, -0.00000115, 0.00000000],
++		[-6.27333483, -0.00034827, 0.00021334, 0.00035002, -0.00000115, 0.00000000],
++		[-6.27333492, -0.00034823, 0.00021332, 0.00034998, -0.00000115, 0.00000000],
++		[-6.27333501, -0.00034819, 0.00021330, 0.00034994, -0.00000115, 0.00000000],
++		[-6.27333511, -0.00034815, 0.00021327, 0.00034990, -0.00000115, 0.00000000],
++		[-6.27333520, -0.00034811, 0.00021325, 0.00034986, -0.00000115, 0.00000000],
++		[-6.27333530, -0.00034807, 0.00021322, 0.00034982, -0.00000115, 0.00000000],
++		[-6.27333539, -0.00034803, 0.00021320, 0.00034978, -0.00000115, 0.00000000],
++		[-6.27333548, -0.00034800, 0.00021318, 0.00034974, -0.00000115, 0.00000000],
++		[-6.27333558, -0.00034796, 0.00021315, 0.00034970, -0.00000115, 0.00000000],
++		[-6.27333567, -0.00034792, 0.00021313, 0.00034967, -0.00000115, 0.00000000],
++		[-6.27333576, -0.00034788, 0.00021310, 0.00034963, -0.00000115, 0.00000000],
++		[-6.27333586, -0.00034784, 0.00021308, 0.00034959, -0.00000115, 0.00000000],
++		[-6.27333595, -0.00034780, 0.00021306, 0.00034955, -0.00000115, 0.00000000],
++		[-6.27333604, -0.00034776, 0.00021303, 0.00034951, -0.00000115, 0.00000000],
++		[-6.27333614, -0.00034772, 0.00021301, 0.00034947, -0.00000115, 0.00000000],
++		[-6.27333623, -0.00034768, 0.00021298, 0.00034943, -0.00000115, 0.00000000],
++		[-6.27333632, -0.00034764, 0.00021296, 0.00034939, -0.00000115, 0.00000000],
++		[-6.27333642, -0.00034760, 0.00021294, 0.00034935, -0.00000115, 0.00000000],
++		[-6.27333651, -0.00034757, 0.00021291, 0.00034931, -0.00000115, 0.00000000],
++		[-6.27333661, -0.00034753, 0.00021289, 0.00034927, -0.00000115, 0.00000000],
++		[-6.27333670, -0.00034749, 0.00021286, 0.00034923, -0.00000115, 0.00000000],
++		[-6.27333679, -0.00034745, 0.00021284, 0.00034919, -0.00000115, 0.00000000],
++		[-6.27333689, -0.00034741, 0.00021282, 0.00034915, -0.00000115, 0.00000000],
++		[-6.27333698, -0.00034737, 0.00021279, 0.00034912, -0.00000115, 0.00000000],
++		[-6.27333707, -0.00034733, 0.00021277, 0.00034908, -0.00000115, 0.00000000],
++		[-6.27333717, -0.00034729, 0.00021275, 0.00034904, -0.00000115, 0.00000000],
++		[-6.27333726, -0.00034725, 0.00021272, 0.00034900, -0.00000115, 0.00000000],
++		[-6.27333735, -0.00034721, 0.00021270, 0.00034896, -0.00000115, 0.00000000],
++		[-6.27333745, -0.00034718, 0.00021267, 0.00034892, -0.00000115, 0.00000000],
++		[-6.27333754, -0.00034714, 0.00021265, 0.00034888, -0.00000115, 0.00000000],
++		[-6.27333763, -0.00034710, 0.00021263, 0.00034884, -0.00000115, 0.00000000],
++		[-6.27333772, -0.00034706, 0.00021260, 0.00034880, -0.00000115, 0.00000000],
++		[-6.27333782, -0.00034702, 0.00021258, 0.00034876, -0.00000115, 0.00000000],
++		[-6.27333791, -0.00034698, 0.00021255, 0.00034872, -0.00000115, 0.00000000],
++		[-6.27333800, -0.00034694, 0.00021253, 0.00034869, -0.00000115, 0.00000000],
++		[-6.27333810, -0.00034690, 0.00021251, 0.00034865, -0.00000115, 0.00000000],
++		[-6.27333819, -0.00034686, 0.00021248, 0.00034861, -0.00000115, 0.00000000],
++		[-6.27333828, -0.00034683, 0.00021246, 0.00034857, -0.00000115, 0.00000000],
++		[-6.27333838, -0.00034679, 0.00021244, 0.00034853, -0.00000115, 0.00000000],
++		[-6.27333847, -0.00034675, 0.00021241, 0.00034849, -0.00000115, 0.00000000],
++		[-6.27333856, -0.00034671, 0.00021239, 0.00034845, -0.00000115, 0.00000000],
++		[-6.27333866, -0.00034667, 0.00021236, 0.00034841, -0.00000115, 0.00000000],
++		[-6.27333875, -0.00034663, 0.00021234, 0.00034837, -0.00000115, 0.00000000],
++		[-6.27333884, -0.00034659, 0.00021232, 0.00034833, -0.00000115, 0.00000000],
++		[-6.27333893, -0.00034655, 0.00021229, 0.00034829, -0.00000115, 0.00000000],
++		[-6.27333903, -0.00034652, 0.00021227, 0.00034826, -0.00000115, 0.00000000],
++		[-6.27333912, -0.00034648, 0.00021225, 0.00034822, -0.00000115, 0.00000000],
++		[-6.27333921, -0.00034644, 0.00021222, 0.00034818, -0.00000115, 0.00000000],
++		[-6.27333931, -0.00034640, 0.00021220, 0.00034814, -0.00000115, 0.00000000],
++		[-6.27333940, -0.00034636, 0.00021217, 0.00034810, -0.00000115, 0.00000000],
++		[-6.27333949, -0.00034632, 0.00021215, 0.00034806, -0.00000115, 0.00000000],
++		[-6.27333958, -0.00034628, 0.00021213, 0.00034802, -0.00000115, 0.00000000],
++		[-6.27333968, -0.00034624, 0.00021210, 0.00034798, -0.00000115, 0.00000000],
++		[-6.27333977, -0.00034620, 0.00021208, 0.00034794, -0.00000115, 0.00000000],
++		[-6.27333986, -0.00034617, 0.00021206, 0.00034791, -0.00000115, 0.00000000],
++		[-6.27333995, -0.00034613, 0.00021203, 0.00034787, -0.00000115, 0.00000000],
++		[-6.27334005, -0.00034609, 0.00021201, 0.00034783, -0.00000115, 0.00000000],
++		[-6.27334014, -0.00034605, 0.00021198, 0.00034779, -0.00000115, 0.00000000],
++		[-6.27334023, -0.00034601, 0.00021196, 0.00034775, -0.00000115, 0.00000000],
++		[-6.27334033, -0.00034597, 0.00021194, 0.00034771, -0.00000115, 0.00000000],
++		[-6.27334042, -0.00034593, 0.00021191, 0.00034767, -0.00000115, 0.00000000],
++		[-6.27334051, -0.00034590, 0.00021189, 0.00034763, -0.00000115, 0.00000000],
++		[-6.27334060, -0.00034586, 0.00021187, 0.00034759, -0.00000115, 0.00000000],
++		[-6.27334070, -0.00034582, 0.00021184, 0.00034756, -0.00000115, 0.00000000],
++		[-6.27334079, -0.00034578, 0.00021182, 0.00034752, -0.00000115, 0.00000000],
++		[-6.27334088, -0.00034574, 0.00021179, 0.00034748, -0.00000115, 0.00000000],
++		[-6.27334097, -0.00034570, 0.00021177, 0.00034744, -0.00000115, 0.00000000],
++		[-6.27334107, -0.00034566, 0.00021175, 0.00034740, -0.00000115, 0.00000000],
++		[-6.27334116, -0.00034563, 0.00021172, 0.00034736, -0.00000115, 0.00000000],
++		[-6.27334125, -0.00034559, 0.00021170, 0.00034732, -0.00000115, 0.00000000],
++		[-6.27334134, -0.00034555, 0.00021168, 0.00034728, -0.00000115, 0.00000000],
++		[-6.27334143, -0.00034551, 0.00021165, 0.00034725, -0.00000115, 0.00000000],
++		[-6.27334153, -0.00034547, 0.00021163, 0.00034721, -0.00000115, 0.00000000],
++		[-6.27334162, -0.00034543, 0.00021161, 0.00034717, -0.00000115, 0.00000000],
++		[-6.27334171, -0.00034539, 0.00021158, 0.00034713, -0.00000115, 0.00000000],
++		[-6.27334180, -0.00034536, 0.00021156, 0.00034709, -0.00000115, 0.00000000],
++		[-6.27334190, -0.00034532, 0.00021153, 0.00034705, -0.00000115, 0.00000000],
++		[-6.27334199, -0.00034528, 0.00021151, 0.00034701, -0.00000115, 0.00000000],
++		[-6.27334208, -0.00034524, 0.00021149, 0.00034697, -0.00000115, 0.00000000],
++		[-6.27334217, -0.00034520, 0.00021146, 0.00034694, -0.00000115, 0.00000000],
++		[-6.27334226, -0.00034516, 0.00021144, 0.00034690, -0.00000115, 0.00000000],
++		[-6.27334236, -0.00034512, 0.00021142, 0.00034686, -0.00000115, 0.00000000],
++		[-6.27334245, -0.00034509, 0.00021139, 0.00034682, -0.00000115, 0.00000000],
++		[-6.27334254, -0.00034505, 0.00021137, 0.00034678, -0.00000115, 0.00000000],
++		[-6.27334263, -0.00034501, 0.00021135, 0.00034674, -0.00000115, 0.00000000],
++		[-6.27334273, -0.00034497, 0.00021132, 0.00034670, -0.00000115, 0.00000000],
++		[-6.27334282, -0.00034493, 0.00021130, 0.00034666, -0.00000115, 0.00000000],
++		[-6.27334291, -0.00034489, 0.00021128, 0.00034663, -0.00000115, 0.00000000],
++		[-6.27334300, -0.00034486, 0.00021125, 0.00034659, -0.00000115, 0.00000000],
++		[-6.27334309, -0.00034482, 0.00021123, 0.00034655, -0.00000115, 0.00000000],
++		[-6.27334319, -0.00034478, 0.00021120, 0.00034651, -0.00000115, 0.00000000],
++		[-6.27334328, -0.00034474, 0.00021118, 0.00034647, -0.00000115, 0.00000000],
++		[-6.27334337, -0.00034470, 0.00021116, 0.00034643, -0.00000115, 0.00000000],
++		[-6.27334346, -0.00034466, 0.00021113, 0.00034639, -0.00000115, 0.00000000],
++		[-6.27334355, -0.00034462, 0.00021111, 0.00034636, -0.00000115, 0.00000000],
++		[-6.27334364, -0.00034459, 0.00021109, 0.00034632, -0.00000115, 0.00000000],
++		[-6.27334374, -0.00034455, 0.00021106, 0.00034628, -0.00000115, 0.00000000],
++		[-6.27334383, -0.00034451, 0.00021104, 0.00034624, -0.00000115, 0.00000000],
++		[-6.27334392, -0.00034447, 0.00021102, 0.00034620, -0.00000115, 0.00000000],
++		[-6.27334401, -0.00034443, 0.00021099, 0.00034616, -0.00000115, 0.00000000],
++		[-6.27334410, -0.00034439, 0.00021097, 0.00034612, -0.00000115, 0.00000000],
++		[-6.27334420, -0.00034436, 0.00021095, 0.00034609, -0.00000115, 0.00000000],
++		[-6.27334429, -0.00034432, 0.00021092, 0.00034605, -0.00000115, 0.00000000],
++		[-6.27334438, -0.00034428, 0.00021090, 0.00034601, -0.00000115, 0.00000000],
++		[-6.27334447, -0.00034424, 0.00021088, 0.00034597, -0.00000115, 0.00000000],
++		[-6.27334456, -0.00034420, 0.00021085, 0.00034593, -0.00000115, 0.00000000],
++		[-6.27334465, -0.00034417, 0.00021083, 0.00034589, -0.00000115, 0.00000000],
++		[-6.27334475, -0.00034413, 0.00021081, 0.00034586, -0.00000115, 0.00000000],
++		[-6.27334484, -0.00034409, 0.00021078, 0.00034582, -0.00000115, 0.00000000],
++		[-6.27334493, -0.00034405, 0.00021076, 0.00034578, -0.00000115, 0.00000000],
++		[-6.27334502, -0.00034401, 0.00021073, 0.00034574, -0.00000115, 0.00000000],
++		[-6.27334511, -0.00034397, 0.00021071, 0.00034570, -0.00000115, 0.00000000],
++		[-6.27334520, -0.00034394, 0.00021069, 0.00034566, -0.00000115, 0.00000000],
++		[-6.27334529, -0.00034390, 0.00021066, 0.00034562, -0.00000115, 0.00000000],
++		[-6.27334539, -0.00034386, 0.00021064, 0.00034559, -0.00000115, 0.00000000],
++		[-6.27334548, -0.00034382, 0.00021062, 0.00034555, -0.00000115, 0.00000000],
++		[-6.27334557, -0.00034378, 0.00021059, 0.00034551, -0.00000115, 0.00000000],
++		[-6.27334566, -0.00034374, 0.00021057, 0.00034547, -0.00000115, 0.00000000],
++		[-6.27334575, -0.00034371, 0.00021055, 0.00034543, -0.00000116, 0.00000000],
++		[-6.27334584, -0.00034367, 0.00021052, 0.00034539, -0.00000116, 0.00000000],
++		[-6.27334593, -0.00034363, 0.00021050, 0.00034536, -0.00000116, 0.00000000],
++		[-6.27334603, -0.00034359, 0.00021048, 0.00034532, -0.00000116, 0.00000000],
++		[-6.27334612, -0.00034355, 0.00021045, 0.00034528, -0.00000116, 0.00000000],
++		[-6.27334621, -0.00034352, 0.00021043, 0.00034524, -0.00000116, 0.00000000],
++		[-6.27334630, -0.00034348, 0.00021041, 0.00034520, -0.00000116, 0.00000000],
++		[-6.27334639, -0.00034344, 0.00021038, 0.00034516, -0.00000116, 0.00000000],
++		[-6.27334648, -0.00034340, 0.00021036, 0.00034513, -0.00000116, 0.00000000],
++		[-6.27334657, -0.00034336, 0.00021034, 0.00034509, -0.00000116, 0.00000000],
++		[-6.27334666, -0.00034333, 0.00021031, 0.00034505, -0.00000116, 0.00000000],
++		[-6.27334676, -0.00034329, 0.00021029, 0.00034501, -0.00000116, 0.00000000],
++		[-6.27334685, -0.00034325, 0.00021027, 0.00034497, -0.00000116, 0.00000000],
++		[-6.27334694, -0.00034321, 0.00021024, 0.00034494, -0.00000116, 0.00000000],
++		[-6.27334703, -0.00034317, 0.00021022, 0.00034490, -0.00000116, 0.00000000],
++		[-6.27334712, -0.00034313, 0.00021020, 0.00034486, -0.00000116, 0.00000000],
++		[-6.27334721, -0.00034310, 0.00021017, 0.00034482, -0.00000116, 0.00000000],
++		[-6.27334730, -0.00034306, 0.00021015, 0.00034478, -0.00000116, 0.00000000],
++		[-6.27334739, -0.00034302, 0.00021013, 0.00034474, -0.00000116, 0.00000000],
++		[-6.27334748, -0.00034298, 0.00021010, 0.00034471, -0.00000116, 0.00000000],
++		[-6.27334758, -0.00034294, 0.00021008, 0.00034467, -0.00000116, 0.00000000],
++		[-6.27334767, -0.00034291, 0.00021006, 0.00034463, -0.00000116, 0.00000000],
++		[-6.27334776, -0.00034287, 0.00021003, 0.00034459, -0.00000116, 0.00000000],
++		[-6.27334785, -0.00034283, 0.00021001, 0.00034455, -0.00000116, 0.00000000],
++		[-6.27334794, -0.00034279, 0.00020999, 0.00034451, -0.00000116, 0.00000000],
++		[-6.27334803, -0.00034276, 0.00020996, 0.00034448, -0.00000116, 0.00000000],
++		[-6.27334812, -0.00034272, 0.00020994, 0.00034444, -0.00000116, 0.00000000],
++		[-6.27334821, -0.00034268, 0.00020992, 0.00034440, -0.00000116, 0.00000000],
++		[-6.27334830, -0.00034264, 0.00020989, 0.00034436, -0.00000116, 0.00000000],
++		[-6.27334839, -0.00034260, 0.00020987, 0.00034432, -0.00000116, 0.00000000],
++		[-6.27334848, -0.00034257, 0.00020985, 0.00034429, -0.00000116, 0.00000000],
++		[-6.27334857, -0.00034253, 0.00020983, 0.00034425, -0.00000116, 0.00000000],
++		[-6.27334867, -0.00034249, 0.00020980, 0.00034421, -0.00000116, 0.00000000],
++		[-6.27334876, -0.00034245, 0.00020978, 0.00034417, -0.00000116, 0.00000000],
++		[-6.27334885, -0.00034241, 0.00020976, 0.00034413, -0.00000116, 0.00000000],
++		[-6.27334894, -0.00034238, 0.00020973, 0.00034410, -0.00000116, 0.00000000],
++		[-6.27334903, -0.00034234, 0.00020971, 0.00034406, -0.00000116, 0.00000000],
++		[-6.27334912, -0.00034230, 0.00020969, 0.00034402, -0.00000116, 0.00000000],
++		[-6.27334921, -0.00034226, 0.00020966, 0.00034398, -0.00000116, 0.00000000],
++		[-6.27334930, -0.00034222, 0.00020964, 0.00034394, -0.00000116, 0.00000000],
++		[-6.27334939, -0.00034219, 0.00020962, 0.00034391, -0.00000116, 0.00000000],
++		[-6.27334948, -0.00034215, 0.00020959, 0.00034387, -0.00000116, 0.00000000],
++		[-6.27334957, -0.00034211, 0.00020957, 0.00034383, -0.00000116, 0.00000000],
++		[-6.27334966, -0.00034207, 0.00020955, 0.00034379, -0.00000116, 0.00000000],
++		[-6.27334975, -0.00034204, 0.00020952, 0.00034375, -0.00000116, 0.00000000],
++		[-6.27334984, -0.00034200, 0.00020950, 0.00034372, -0.00000116, 0.00000000],
++		[-6.27334993, -0.00034196, 0.00020948, 0.00034368, -0.00000116, 0.00000000],
++		[-6.27335002, -0.00034192, 0.00020945, 0.00034364, -0.00000116, 0.00000000],
++		[-6.27335011, -0.00034188, 0.00020943, 0.00034360, -0.00000116, 0.00000000],
++		[-6.27335021, -0.00034185, 0.00020941, 0.00034356, -0.00000116, 0.00000000],
++		[-6.27335030, -0.00034181, 0.00020938, 0.00034353, -0.00000116, 0.00000000],
++		[-6.27335039, -0.00034177, 0.00020936, 0.00034349, -0.00000116, 0.00000000],
++		[-6.27335048, -0.00034173, 0.00020934, 0.00034345, -0.00000116, 0.00000000],
++		[-6.27335057, -0.00034170, 0.00020932, 0.00034341, -0.00000116, 0.00000000],
++		[-6.27335066, -0.00034166, 0.00020929, 0.00034337, -0.00000116, 0.00000000],
++		[-6.27335075, -0.00034162, 0.00020927, 0.00034334, -0.00000116, 0.00000000],
++		[-6.27335084, -0.00034158, 0.00020925, 0.00034330, -0.00000116, 0.00000000],
++		[-6.27335093, -0.00034154, 0.00020922, 0.00034326, -0.00000116, 0.00000000],
++		[-6.27335102, -0.00034151, 0.00020920, 0.00034322, -0.00000116, 0.00000000],
++		[-6.27335111, -0.00034147, 0.00020918, 0.00034318, -0.00000116, 0.00000000],
++		[-6.27335120, -0.00034143, 0.00020915, 0.00034315, -0.00000116, 0.00000000],
++		[-6.27335129, -0.00034139, 0.00020913, 0.00034311, -0.00000116, 0.00000000],
++		[-6.27335138, -0.00034136, 0.00020911, 0.00034307, -0.00000116, 0.00000000],
++		[-6.27335147, -0.00034132, 0.00020908, 0.00034303, -0.00000116, 0.00000000],
++		[-6.27335156, -0.00034128, 0.00020906, 0.00034300, -0.00000116, 0.00000000],
++		[-6.27335165, -0.00034124, 0.00020904, 0.00034296, -0.00000116, 0.00000000],
++		[-6.27335174, -0.00034121, 0.00020902, 0.00034292, -0.00000116, 0.00000000],
++		[-6.27335183, -0.00034117, 0.00020899, 0.00034288, -0.00000116, 0.00000000],
++		[-6.27335192, -0.00034113, 0.00020897, 0.00034284, -0.00000116, 0.00000000],
++		[-6.27335201, -0.00034109, 0.00020895, 0.00034281, -0.00000116, 0.00000000],
++		[-6.27335210, -0.00034106, 0.00020892, 0.00034277, -0.00000116, 0.00000000],
++		[-6.27335219, -0.00034102, 0.00020890, 0.00034273, -0.00000116, 0.00000000],
++		[-6.27335228, -0.00034098, 0.00020888, 0.00034269, -0.00000116, 0.00000000],
++		[-6.27335237, -0.00034094, 0.00020885, 0.00034266, -0.00000116, 0.00000000],
++		[-6.27335246, -0.00034091, 0.00020883, 0.00034262, -0.00000116, 0.00000000],
++		[-6.27335255, -0.00034087, 0.00020881, 0.00034258, -0.00000116, 0.00000000],
++		[-6.27335264, -0.00034083, 0.00020878, 0.00034254, -0.00000116, 0.00000000],
++		[-6.27335273, -0.00034079, 0.00020876, 0.00034250, -0.00000116, 0.00000000],
++		[-6.27335282, -0.00034076, 0.00020874, 0.00034247, -0.00000116, 0.00000000],
++		[-6.27335291, -0.00034072, 0.00020872, 0.00034243, -0.00000116, 0.00000000],
++		[-6.27335300, -0.00034068, 0.00020869, 0.00034239, -0.00000116, 0.00000000],
++		[-6.27335309, -0.00034064, 0.00020867, 0.00034235, -0.00000116, 0.00000000],
++		[-6.27335318, -0.00034061, 0.00020865, 0.00034232, -0.00000116, 0.00000000],
++		[-6.27335327, -0.00034057, 0.00020862, 0.00034228, -0.00000116, 0.00000000],
++		[-6.27335336, -0.00034053, 0.00020860, 0.00034224, -0.00000116, 0.00000000],
++		[-6.27335345, -0.00034049, 0.00020858, 0.00034220, -0.00000116, 0.00000000],
++		[-6.27335354, -0.00034046, 0.00020856, 0.00034217, -0.00000116, 0.00000000],
++		[-6.27335363, -0.00034042, 0.00020853, 0.00034213, -0.00000116, 0.00000000],
++		[-6.27335372, -0.00034038, 0.00020851, 0.00034209, -0.00000116, 0.00000000],
++		[-6.27335380, -0.00034034, 0.00020849, 0.00034205, -0.00000116, 0.00000000],
++		[-6.27335389, -0.00034031, 0.00020846, 0.00034201, -0.00000116, 0.00000000],
++		[-6.27335398, -0.00034027, 0.00020844, 0.00034198, -0.00000116, 0.00000000],
++		[-6.27335407, -0.00034023, 0.00020842, 0.00034194, -0.00000116, 0.00000000],
++		[-6.27335416, -0.00034019, 0.00020839, 0.00034190, -0.00000116, 0.00000000],
++		[-6.27335425, -0.00034016, 0.00020837, 0.00034186, -0.00000116, 0.00000000],
++		[-6.27335434, -0.00034012, 0.00020835, 0.00034183, -0.00000116, 0.00000000],
++		[-6.27335443, -0.00034008, 0.00020833, 0.00034179, -0.00000116, 0.00000000],
++		[-6.27335452, -0.00034004, 0.00020830, 0.00034175, -0.00000116, 0.00000000],
++		[-6.27335461, -0.00034001, 0.00020828, 0.00034171, -0.00000116, 0.00000000],
++		[-6.27335470, -0.00033997, 0.00020826, 0.00034168, -0.00000116, 0.00000000],
++		[-6.27335479, -0.00033993, 0.00020823, 0.00034164, -0.00000116, 0.00000000],
++		[-6.27335488, -0.00033989, 0.00020821, 0.00034160, -0.00000116, 0.00000000],
++		[-6.27335497, -0.00033986, 0.00020819, 0.00034156, -0.00000116, 0.00000000],
++		[-6.27335506, -0.00033982, 0.00020817, 0.00034153, -0.00000116, 0.00000000],
++		[-6.27335515, -0.00033978, 0.00020814, 0.00034149, -0.00000116, 0.00000000],
++		[-6.27335524, -0.00033975, 0.00020812, 0.00034145, -0.00000116, 0.00000000],
++		[-6.27335533, -0.00033971, 0.00020810, 0.00034141, -0.00000116, 0.00000000],
++		[-6.27335541, -0.00033967, 0.00020807, 0.00034138, -0.00000116, 0.00000000],
++		[-6.27335550, -0.00033963, 0.00020805, 0.00034134, -0.00000116, 0.00000000],
++		[-6.27335559, -0.00033960, 0.00020803, 0.00034130, -0.00000116, 0.00000000],
++		[-6.27335568, -0.00033956, 0.00020801, 0.00034126, -0.00000116, 0.00000000],
++		[-6.27335577, -0.00033952, 0.00020798, 0.00034123, -0.00000116, 0.00000000],
++		[-6.27335586, -0.00033948, 0.00020796, 0.00034119, -0.00000116, 0.00000000],
++		[-6.27335595, -0.00033945, 0.00020794, 0.00034115, -0.00000116, 0.00000000],
++		[-6.27335604, -0.00033941, 0.00020791, 0.00034111, -0.00000116, 0.00000000],
++		[-6.27335613, -0.00033937, 0.00020789, 0.00034108, -0.00000116, 0.00000000],
++		[-6.27335622, -0.00033934, 0.00020787, 0.00034104, -0.00000116, 0.00000000],
++		[-6.27335631, -0.00033930, 0.00020785, 0.00034100, -0.00000116, 0.00000000],
++		[-6.27335639, -0.00033926, 0.00020782, 0.00034097, -0.00000116, 0.00000000],
++		[-6.27335648, -0.00033922, 0.00020780, 0.00034093, -0.00000116, 0.00000000],
++		[-6.27335657, -0.00033919, 0.00020778, 0.00034089, -0.00000116, 0.00000000],
++		[-6.27335666, -0.00033915, 0.00020776, 0.00034085, -0.00000116, 0.00000000],
++		[-6.27335675, -0.00033911, 0.00020773, 0.00034082, -0.00000116, 0.00000000],
++		[-6.27335684, -0.00033908, 0.00020771, 0.00034078, -0.00000116, 0.00000000],
++		[-6.27335693, -0.00033904, 0.00020769, 0.00034074, -0.00000116, 0.00000000],
++		[-6.27335702, -0.00033900, 0.00020766, 0.00034070, -0.00000116, 0.00000000],
++		[-6.27335711, -0.00033896, 0.00020764, 0.00034067, -0.00000116, 0.00000000],
++		[-6.27335720, -0.00033893, 0.00020762, 0.00034063, -0.00000116, 0.00000000],
++		[-6.27335728, -0.00033889, 0.00020760, 0.00034059, -0.00000116, 0.00000000],
++		[-6.27335737, -0.00033885, 0.00020757, 0.00034055, -0.00000116, 0.00000000],
++		[-6.27335746, -0.00033882, 0.00020755, 0.00034052, -0.00000116, 0.00000000],
++		[-6.27335755, -0.00033878, 0.00020753, 0.00034048, -0.00000116, 0.00000000],
++		[-6.27335764, -0.00033874, 0.00020751, 0.00034044, -0.00000116, 0.00000000],
++		[-6.27335773, -0.00033870, 0.00020748, 0.00034041, -0.00000116, 0.00000000],
++		[-6.27335782, -0.00033867, 0.00020746, 0.00034037, -0.00000116, 0.00000000],
++		[-6.27335791, -0.00033863, 0.00020744, 0.00034033, -0.00000116, 0.00000000],
++		[-6.27335799, -0.00033859, 0.00020741, 0.00034029, -0.00000116, 0.00000000],
++		[-6.27335808, -0.00033856, 0.00020739, 0.00034026, -0.00000116, 0.00000000],
++		[-6.27335817, -0.00033852, 0.00020737, 0.00034022, -0.00000116, 0.00000000],
++		[-6.27335826, -0.00033848, 0.00020735, 0.00034018, -0.00000116, 0.00000000],
++		[-6.27335835, -0.00033845, 0.00020732, 0.00034015, -0.00000116, 0.00000000],
++		[-6.27335844, -0.00033841, 0.00020730, 0.00034011, -0.00000116, 0.00000000],
++		[-6.27335853, -0.00033837, 0.00020728, 0.00034007, -0.00000116, 0.00000000],
++		[-6.27335861, -0.00033833, 0.00020726, 0.00034003, -0.00000116, 0.00000000],
++		[-6.27335870, -0.00033830, 0.00020723, 0.00034000, -0.00000116, 0.00000000],
++		[-6.27335879, -0.00033826, 0.00020721, 0.00033996, -0.00000116, 0.00000000],
++		[-6.27335888, -0.00033822, 0.00020719, 0.00033992, -0.00000116, 0.00000000],
++		[-6.27335897, -0.00033819, 0.00020716, 0.00033988, -0.00000116, 0.00000000],
++		[-6.27335906, -0.00033815, 0.00020714, 0.00033985, -0.00000116, 0.00000000],
++		[-6.27335915, -0.00033811, 0.00020712, 0.00033981, -0.00000116, 0.00000000],
++		[-6.27335923, -0.00033808, 0.00020710, 0.00033977, -0.00000116, 0.00000000],
++		[-6.27335932, -0.00033804, 0.00020707, 0.00033974, -0.00000116, 0.00000000],
++		[-6.27335941, -0.00033800, 0.00020705, 0.00033970, -0.00000116, 0.00000000],
++		[-6.27335950, -0.00033797, 0.00020703, 0.00033966, -0.00000116, 0.00000000],
++		[-6.27335959, -0.00033793, 0.00020701, 0.00033963, -0.00000116, 0.00000000],
++		[-6.27335968, -0.00033789, 0.00020698, 0.00033959, -0.00000116, 0.00000000],
++		[-6.27335976, -0.00033785, 0.00020696, 0.00033955, -0.00000116, 0.00000000],
++		[-6.27335985, -0.00033782, 0.00020694, 0.00033951, -0.00000116, 0.00000000],
++		[-6.27335994, -0.00033778, 0.00020692, 0.00033948, -0.00000116, 0.00000000],
++		[-6.27336003, -0.00033774, 0.00020689, 0.00033944, -0.00000116, 0.00000000],
++		[-6.27336012, -0.00033771, 0.00020687, 0.00033940, -0.00000116, 0.00000000],
++		[-6.27336021, -0.00033767, 0.00020685, 0.00033937, -0.00000116, 0.00000000],
++		[-6.27336029, -0.00033763, 0.00020683, 0.00033933, -0.00000116, 0.00000000],
++		[-6.27336038, -0.00033760, 0.00020680, 0.00033929, -0.00000116, 0.00000000],
++		[-6.27336047, -0.00033756, 0.00020678, 0.00033925, -0.00000116, 0.00000000],
++		[-6.27336056, -0.00033752, 0.00020676, 0.00033922, -0.00000116, 0.00000000],
++		[-6.27336065, -0.00033749, 0.00020674, 0.00033918, -0.00000116, 0.00000000],
++		[-6.27336073, -0.00033745, 0.00020671, 0.00033914, -0.00000116, 0.00000000],
++		[-6.27336082, -0.00033741, 0.00020669, 0.00033911, -0.00000116, 0.00000000],
++		[-6.27336091, -0.00033738, 0.00020667, 0.00033907, -0.00000116, 0.00000000],
++		[-6.27336100, -0.00033734, 0.00020665, 0.00033903, -0.00000116, 0.00000000],
++		[-6.27336109, -0.00033730, 0.00020662, 0.00033900, -0.00000116, 0.00000000],
++		[-6.27336117, -0.00033727, 0.00020660, 0.00033896, -0.00000116, 0.00000000],
++		[-6.27336126, -0.00033723, 0.00020658, 0.00033892, -0.00000116, 0.00000000],
++		[-6.27336135, -0.00033719, 0.00020656, 0.00033889, -0.00000116, 0.00000000],
++		[-6.27336144, -0.00033716, 0.00020653, 0.00033885, -0.00000116, 0.00000000],
++		[-6.27336153, -0.00033712, 0.00020651, 0.00033881, -0.00000116, 0.00000000],
++		[-6.27336161, -0.00033708, 0.00020649, 0.00033877, -0.00000116, 0.00000000],
++		[-6.27336170, -0.00033705, 0.00020647, 0.00033874, -0.00000116, 0.00000000],
++		[-6.27336179, -0.00033701, 0.00020644, 0.00033870, -0.00000116, 0.00000000],
++		[-6.27336188, -0.00033697, 0.00020642, 0.00033866, -0.00000116, 0.00000000],
++		[-6.27336197, -0.00033694, 0.00020640, 0.00033863, -0.00000116, 0.00000000],
++		[-6.27336205, -0.00033690, 0.00020638, 0.00033859, -0.00000116, 0.00000000],
++		[-6.27336214, -0.00033686, 0.00020635, 0.00033855, -0.00000116, 0.00000000],
++		[-6.27336223, -0.00033683, 0.00020633, 0.00033852, -0.00000116, 0.00000000],
++		[-6.27336232, -0.00033679, 0.00020631, 0.00033848, -0.00000116, 0.00000000],
++		[-6.27336240, -0.00033675, 0.00020629, 0.00033844, -0.00000116, 0.00000000],
++		[-6.27336249, -0.00033672, 0.00020626, 0.00033841, -0.00000116, 0.00000000],
++		[-6.27336258, -0.00033668, 0.00020624, 0.00033837, -0.00000116, 0.00000000],
++		[-6.27336267, -0.00033664, 0.00020622, 0.00033833, -0.00000116, 0.00000000],
++		[-6.27336275, -0.00033661, 0.00020620, 0.00033830, -0.00000116, 0.00000000],
++		[-6.27336284, -0.00033657, 0.00020617, 0.00033826, -0.00000116, 0.00000000],
++		[-6.27336293, -0.00033653, 0.00020615, 0.00033822, -0.00000116, 0.00000000],
++		[-6.27336302, -0.00033650, 0.00020613, 0.00033819, -0.00000116, 0.00000000],
++		[-6.27336311, -0.00033646, 0.00020611, 0.00033815, -0.00000116, 0.00000000],
++		[-6.27336319, -0.00033642, 0.00020608, 0.00033811, -0.00000116, 0.00000000],
++		[-6.27336328, -0.00033639, 0.00020606, 0.00033808, -0.00000116, 0.00000000],
++		[-6.27336337, -0.00033635, 0.00020604, 0.00033804, -0.00000116, 0.00000000],
++		[-6.27336346, -0.00033631, 0.00020602, 0.00033800, -0.00000116, 0.00000000],
++		[-6.27336354, -0.00033628, 0.00020599, 0.00033796, -0.00000116, 0.00000000],
++		[-6.27336363, -0.00033624, 0.00020597, 0.00033793, -0.00000116, 0.00000000],
++		[-6.27336372, -0.00033620, 0.00020595, 0.00033789, -0.00000116, 0.00000000],
++		[-6.27336381, -0.00033617, 0.00020593, 0.00033785, -0.00000116, 0.00000000],
++		[-6.27336389, -0.00033613, 0.00020590, 0.00033782, -0.00000116, 0.00000000],
++		[-6.27336398, -0.00033609, 0.00020588, 0.00033778, -0.00000116, 0.00000000],
++		[-6.27336407, -0.00033606, 0.00020586, 0.00033774, -0.00000116, 0.00000000],
++		[-6.27336415, -0.00033602, 0.00020584, 0.00033771, -0.00000116, 0.00000000],
++		[-6.27336424, -0.00033598, 0.00020582, 0.00033767, -0.00000116, 0.00000000],
++		[-6.27336433, -0.00033595, 0.00020579, 0.00033763, -0.00000116, 0.00000000],
++		[-6.27336442, -0.00033591, 0.00020577, 0.00033760, -0.00000116, 0.00000000],
++		[-6.27336450, -0.00033587, 0.00020575, 0.00033756, -0.00000116, 0.00000000],
++		[-6.27336459, -0.00033584, 0.00020573, 0.00033752, -0.00000116, 0.00000000],
++		[-6.27336468, -0.00033580, 0.00020570, 0.00033749, -0.00000116, 0.00000000],
++		[-6.27336477, -0.00033577, 0.00020568, 0.00033745, -0.00000116, 0.00000000],
++		[-6.27336485, -0.00033573, 0.00020566, 0.00033742, -0.00000116, 0.00000000],
++		[-6.27336494, -0.00033569, 0.00020564, 0.00033738, -0.00000116, 0.00000000],
++		[-6.27336503, -0.00033566, 0.00020561, 0.00033734, -0.00000116, 0.00000000],
++		[-6.27336511, -0.00033562, 0.00020559, 0.00033731, -0.00000116, 0.00000000],
++		[-6.27336520, -0.00033558, 0.00020557, 0.00033727, -0.00000116, 0.00000000],
++		[-6.27336529, -0.00033555, 0.00020555, 0.00033723, -0.00000116, 0.00000000],
++		[-6.27336538, -0.00033551, 0.00020553, 0.00033720, -0.00000116, 0.00000000],
++		[-6.27336546, -0.00033547, 0.00020550, 0.00033716, -0.00000116, 0.00000000],
++		[-6.27336555, -0.00033544, 0.00020548, 0.00033712, -0.00000116, 0.00000000],
++		[-6.27336564, -0.00033540, 0.00020546, 0.00033709, -0.00000116, 0.00000000],
++		[-6.27336572, -0.00033537, 0.00020544, 0.00033705, -0.00000116, 0.00000000],
++		[-6.27336581, -0.00033533, 0.00020541, 0.00033701, -0.00000116, 0.00000000],
++		[-6.27336590, -0.00033529, 0.00020539, 0.00033698, -0.00000116, 0.00000000],
++		[-6.27336598, -0.00033526, 0.00020537, 0.00033694, -0.00000116, 0.00000000],
++		[-6.27336607, -0.00033522, 0.00020535, 0.00033690, -0.00000116, 0.00000000],
++		[-6.27336616, -0.00033518, 0.00020532, 0.00033687, -0.00000116, 0.00000000],
++		[-6.27336625, -0.00033515, 0.00020530, 0.00033683, -0.00000116, 0.00000000],
++		[-6.27336633, -0.00033511, 0.00020528, 0.00033679, -0.00000116, 0.00000000],
++		[-6.27336642, -0.00033508, 0.00020526, 0.00033676, -0.00000116, 0.00000000],
++		[-6.27336651, -0.00033504, 0.00020524, 0.00033672, -0.00000116, 0.00000000],
++		[-6.27336659, -0.00033500, 0.00020521, 0.00033668, -0.00000116, 0.00000000],
++		[-6.27336668, -0.00033497, 0.00020519, 0.00033665, -0.00000116, 0.00000000],
++		[-6.27336677, -0.00033493, 0.00020517, 0.00033661, -0.00000116, 0.00000000],
++		[-6.27336685, -0.00033489, 0.00020515, 0.00033658, -0.00000116, 0.00000000],
++		[-6.27336694, -0.00033486, 0.00020512, 0.00033654, -0.00000116, 0.00000000],
++		[-6.27336703, -0.00033482, 0.00020510, 0.00033650, -0.00000116, 0.00000000],
++		[-6.27336711, -0.00033479, 0.00020508, 0.00033647, -0.00000116, 0.00000000],
++		[-6.27336720, -0.00033475, 0.00020506, 0.00033643, -0.00000116, 0.00000000],
++		[-6.27336729, -0.00033471, 0.00020504, 0.00033639, -0.00000116, 0.00000000],
++		[-6.27336737, -0.00033468, 0.00020501, 0.00033636, -0.00000116, 0.00000000],
++		[-6.27336746, -0.00033464, 0.00020499, 0.00033632, -0.00000116, 0.00000000],
++		[-6.27336755, -0.00033460, 0.00020497, 0.00033628, -0.00000116, 0.00000000],
++		[-6.27336763, -0.00033457, 0.00020495, 0.00033625, -0.00000116, 0.00000000],
++		[-6.27336772, -0.00033453, 0.00020493, 0.00033621, -0.00000116, 0.00000000],
++		[-6.27336781, -0.00033450, 0.00020490, 0.00033618, -0.00000116, 0.00000000],
++		[-6.27336789, -0.00033446, 0.00020488, 0.00033614, -0.00000116, 0.00000000],
++		[-6.27336798, -0.00033442, 0.00020486, 0.00033610, -0.00000116, 0.00000000],
++		[-6.27336807, -0.00033439, 0.00020484, 0.00033607, -0.00000116, 0.00000000],
++		[-6.27336815, -0.00033435, 0.00020481, 0.00033603, -0.00000116, 0.00000000],
++		[-6.27336824, -0.00033432, 0.00020479, 0.00033599, -0.00000116, 0.00000000],
++		[-6.27336833, -0.00033428, 0.00020477, 0.00033596, -0.00000116, 0.00000000],
++		[-6.27336841, -0.00033424, 0.00020475, 0.00033592, -0.00000116, 0.00000000],
++		[-6.27336850, -0.00033421, 0.00020473, 0.00033588, -0.00000116, 0.00000000],
++		[-6.27336858, -0.00033417, 0.00020470, 0.00033585, -0.00000116, 0.00000000],
++		[-6.27336867, -0.00033413, 0.00020468, 0.00033581, -0.00000116, 0.00000000],
++		[-6.27336876, -0.00033410, 0.00020466, 0.00033578, -0.00000116, 0.00000000],
++		[-6.27336884, -0.00033406, 0.00020464, 0.00033574, -0.00000116, 0.00000000],
++		[-6.27336893, -0.00033403, 0.00020462, 0.00033570, -0.00000116, 0.00000000],
++		[-6.27336902, -0.00033399, 0.00020459, 0.00033567, -0.00000116, 0.00000000],
++		[-6.27336910, -0.00033395, 0.00020457, 0.00033563, -0.00000116, 0.00000000],
++		[-6.27336919, -0.00033392, 0.00020455, 0.00033559, -0.00000116, 0.00000000],
++		[-6.27336927, -0.00033388, 0.00020453, 0.00033556, -0.00000116, 0.00000000],
++		[-6.27336936, -0.00033385, 0.00020451, 0.00033552, -0.00000116, 0.00000000],
++		[-6.27336945, -0.00033381, 0.00020448, 0.00033549, -0.00000116, 0.00000000],
++		[-6.27336953, -0.00033377, 0.00020446, 0.00033545, -0.00000116, 0.00000000],
++		[-6.27336962, -0.00033374, 0.00020444, 0.00033541, -0.00000116, 0.00000000],
++		[-6.27336971, -0.00033370, 0.00020442, 0.00033538, -0.00000116, 0.00000000],
++		[-6.27336979, -0.00033367, 0.00020439, 0.00033534, -0.00000116, 0.00000000],
++		[-6.27336988, -0.00033363, 0.00020437, 0.00033531, -0.00000116, 0.00000000],
++		[-6.27336996, -0.00033359, 0.00020435, 0.00033527, -0.00000116, 0.00000000],
++		[-6.27337005, -0.00033356, 0.00020433, 0.00033523, -0.00000116, 0.00000000],
++		[-6.27337014, -0.00033352, 0.00020431, 0.00033520, -0.00000116, 0.00000000],
++		[-6.27337022, -0.00033349, 0.00020428, 0.00033516, -0.00000116, 0.00000000],
++		[-6.27337031, -0.00033345, 0.00020426, 0.00033513, -0.00000116, 0.00000000],
++		[-6.27337039, -0.00033342, 0.00020424, 0.00033509, -0.00000116, 0.00000000],
++		[-6.27337048, -0.00033338, 0.00020422, 0.00033505, -0.00000116, 0.00000000],
++		[-6.27337057, -0.00033334, 0.00020420, 0.00033502, -0.00000116, 0.00000000],
++		[-6.27337065, -0.00033331, 0.00020417, 0.00033498, -0.00000116, 0.00000000],
++		[-6.27337074, -0.00033327, 0.00020415, 0.00033494, -0.00000116, 0.00000000],
++		[-6.27337082, -0.00033324, 0.00020413, 0.00033491, -0.00000116, 0.00000000],
++		[-6.27337091, -0.00033320, 0.00020411, 0.00033487, -0.00000116, 0.00000000],
++		[-6.27337100, -0.00033316, 0.00020409, 0.00033484, -0.00000116, 0.00000000],
++		[-6.27337108, -0.00033313, 0.00020406, 0.00033480, -0.00000116, 0.00000000],
++		[-6.27337117, -0.00033309, 0.00020404, 0.00033476, -0.00000116, 0.00000000],
++		[-6.27337125, -0.00033306, 0.00020402, 0.00033473, -0.00000116, 0.00000000],
++		[-6.27337134, -0.00033302, 0.00020400, 0.00033469, -0.00000116, 0.00000000],
++		[-6.27337142, -0.00033298, 0.00020398, 0.00033466, -0.00000116, 0.00000000],
++		[-6.27337151, -0.00033295, 0.00020395, 0.00033462, -0.00000116, 0.00000000],
++		[-6.27337160, -0.00033291, 0.00020393, 0.00033458, -0.00000116, 0.00000000],
++		[-6.27337168, -0.00033288, 0.00020391, 0.00033455, -0.00000116, 0.00000000],
++		[-6.27337177, -0.00033284, 0.00020389, 0.00033451, -0.00000116, 0.00000000],
++		[-6.27337185, -0.00033281, 0.00020387, 0.00033448, -0.00000116, 0.00000000],
++		[-6.27337194, -0.00033277, 0.00020385, 0.00033444, -0.00000116, 0.00000000],
++		[-6.27337202, -0.00033273, 0.00020382, 0.00033440, -0.00000116, 0.00000000],
++		[-6.27337211, -0.00033270, 0.00020380, 0.00033437, -0.00000116, 0.00000000],
++		[-6.27337220, -0.00033266, 0.00020378, 0.00033433, -0.00000116, 0.00000000],
++		[-6.27337228, -0.00033263, 0.00020376, 0.00033430, -0.00000116, 0.00000000],
++		[-6.27337237, -0.00033259, 0.00020374, 0.00033426, -0.00000116, 0.00000000],
++		[-6.27337245, -0.00033256, 0.00020371, 0.00033422, -0.00000116, 0.00000000],
++		[-6.27337254, -0.00033252, 0.00020369, 0.00033419, -0.00000116, 0.00000000],
++		[-6.27337262, -0.00033248, 0.00020367, 0.00033415, -0.00000116, 0.00000000],
++		[-6.27337271, -0.00033245, 0.00020365, 0.00033412, -0.00000116, 0.00000000],
++		[-6.27337279, -0.00033241, 0.00020363, 0.00033408, -0.00000116, 0.00000000],
++		[-6.27337288, -0.00033238, 0.00020360, 0.00033405, -0.00000116, 0.00000000],
++		[-6.27337297, -0.00033234, 0.00020358, 0.00033401, -0.00000116, 0.00000000],
++		[-6.27337305, -0.00033231, 0.00020356, 0.00033397, -0.00000116, 0.00000000],
++		[-6.27337314, -0.00033227, 0.00020354, 0.00033394, -0.00000116, 0.00000000],
++		[-6.27337322, -0.00033223, 0.00020352, 0.00033390, -0.00000116, 0.00000000],
++		[-6.27337331, -0.00033220, 0.00020350, 0.00033387, -0.00000116, 0.00000000],
++		[-6.27337339, -0.00033216, 0.00020347, 0.00033383, -0.00000116, 0.00000000],
++		[-6.27337348, -0.00033213, 0.00020345, 0.00033379, -0.00000116, 0.00000000],
++		[-6.27337356, -0.00033209, 0.00020343, 0.00033376, -0.00000116, 0.00000000],
++		[-6.27337365, -0.00033206, 0.00020341, 0.00033372, -0.00000116, 0.00000000],
++		[-6.27337373, -0.00033202, 0.00020339, 0.00033369, -0.00000116, 0.00000000],
++		[-6.27337382, -0.00033198, 0.00020336, 0.00033365, -0.00000116, 0.00000000],
++		[-6.27337390, -0.00033195, 0.00020334, 0.00033362, -0.00000116, 0.00000000],
++		[-6.27337399, -0.00033191, 0.00020332, 0.00033358, -0.00000116, 0.00000000],
++		[-6.27337407, -0.00033188, 0.00020330, 0.00033354, -0.00000116, 0.00000000],
++		[-6.27337416, -0.00033184, 0.00020328, 0.00033351, -0.00000116, 0.00000000],
++		[-6.27337425, -0.00033181, 0.00020326, 0.00033347, -0.00000116, 0.00000000],
++		[-6.27337433, -0.00033177, 0.00020323, 0.00033344, -0.00000116, 0.00000000],
++		[-6.27337442, -0.00033174, 0.00020321, 0.00033340, -0.00000116, 0.00000000],
++		[-6.27337450, -0.00033170, 0.00020319, 0.00033337, -0.00000116, 0.00000000],
++		[-6.27337459, -0.00033166, 0.00020317, 0.00033333, -0.00000116, 0.00000000],
++		[-6.27337467, -0.00033163, 0.00020315, 0.00033329, -0.00000116, 0.00000000],
++		[-6.27337476, -0.00033159, 0.00020312, 0.00033326, -0.00000116, 0.00000000],
++		[-6.27337484, -0.00033156, 0.00020310, 0.00033322, -0.00000116, 0.00000000],
++		[-6.27337493, -0.00033152, 0.00020308, 0.00033319, -0.00000116, 0.00000000],
++		[-6.27337501, -0.00033149, 0.00020306, 0.00033315, -0.00000116, 0.00000000],
++		[-6.27337510, -0.00033145, 0.00020304, 0.00033312, -0.00000116, 0.00000000],
++		[-6.27337518, -0.00033142, 0.00020302, 0.00033308, -0.00000116, 0.00000000],
++		[-6.27337527, -0.00033138, 0.00020299, 0.00033304, -0.00000116, 0.00000000],
++		[-6.27337535, -0.00033135, 0.00020297, 0.00033301, -0.00000116, 0.00000000],
++		[-6.27337544, -0.00033131, 0.00020295, 0.00033297, -0.00000116, 0.00000000],
++		[-6.27337552, -0.00033127, 0.00020293, 0.00033294, -0.00000116, 0.00000000],
++		[-6.27337561, -0.00033124, 0.00020291, 0.00033290, -0.00000116, 0.00000000],
++		[-6.27337569, -0.00033120, 0.00020289, 0.00033287, -0.00000116, 0.00000000],
++		[-6.27337578, -0.00033117, 0.00020286, 0.00033283, -0.00000116, 0.00000000],
++		[-6.27337586, -0.00033113, 0.00020284, 0.00033279, -0.00000116, 0.00000000],
++		[-6.27337594, -0.00033110, 0.00020282, 0.00033276, -0.00000116, 0.00000000],
++		[-6.27337603, -0.00033106, 0.00020280, 0.00033272, -0.00000116, 0.00000000],
++		[-6.27337611, -0.00033103, 0.00020278, 0.00033269, -0.00000116, 0.00000000],
++		[-6.27337620, -0.00033099, 0.00020275, 0.00033265, -0.00000116, 0.00000000],
++		[-6.27337628, -0.00033096, 0.00020273, 0.00033262, -0.00000116, 0.00000000],
++		[-6.27337637, -0.00033092, 0.00020271, 0.00033258, -0.00000116, 0.00000000],
++		[-6.27337645, -0.00033088, 0.00020269, 0.00033255, -0.00000116, 0.00000000],
++		[-6.27337654, -0.00033085, 0.00020267, 0.00033251, -0.00000116, 0.00000000],
++		[-6.27337662, -0.00033081, 0.00020265, 0.00033247, -0.00000116, 0.00000000],
++		[-6.27337671, -0.00033078, 0.00020262, 0.00033244, -0.00000116, 0.00000000],
++		[-6.27337679, -0.00033074, 0.00020260, 0.00033240, -0.00000116, 0.00000000],
++		[-6.27337688, -0.00033071, 0.00020258, 0.00033237, -0.00000116, 0.00000000],
++		[-6.27337696, -0.00033067, 0.00020256, 0.00033233, -0.00000116, 0.00000000],
++		[-6.27337705, -0.00033064, 0.00020254, 0.00033230, -0.00000116, 0.00000000],
++		[-6.27337713, -0.00033060, 0.00020252, 0.00033226, -0.00000116, 0.00000000],
++		[-6.27337721, -0.00033057, 0.00020250, 0.00033223, -0.00000116, 0.00000000],
++		[-6.27337730, -0.00033053, 0.00020247, 0.00033219, -0.00000116, 0.00000000],
++		[-6.27337738, -0.00033050, 0.00020245, 0.00033216, -0.00000116, 0.00000000],
++		[-6.27337747, -0.00033046, 0.00020243, 0.00033212, -0.00000116, 0.00000000],
++		[-6.27337755, -0.00033043, 0.00020241, 0.00033208, -0.00000116, 0.00000000],
++		[-6.27337764, -0.00033039, 0.00020239, 0.00033205, -0.00000116, 0.00000000],
++		[-6.27337772, -0.00033035, 0.00020237, 0.00033201, -0.00000116, 0.00000000],
++		[-6.27337781, -0.00033032, 0.00020234, 0.00033198, -0.00000116, 0.00000000],
++		[-6.27337789, -0.00033028, 0.00020232, 0.00033194, -0.00000116, 0.00000000],
++		[-6.27337797, -0.00033025, 0.00020230, 0.00033191, -0.00000116, 0.00000000],
++		[-6.27337806, -0.00033021, 0.00020228, 0.00033187, -0.00000116, 0.00000000],
++		[-6.27337814, -0.00033018, 0.00020226, 0.00033184, -0.00000116, 0.00000000],
++		[-6.27337823, -0.00033014, 0.00020224, 0.00033180, -0.00000116, 0.00000000],
++		[-6.27337831, -0.00033011, 0.00020221, 0.00033177, -0.00000116, 0.00000000],
++		[-6.27337840, -0.00033007, 0.00020219, 0.00033173, -0.00000116, 0.00000000],
++		[-6.27337848, -0.00033004, 0.00020217, 0.00033169, -0.00000116, 0.00000000],
++		[-6.27337856, -0.00033000, 0.00020215, 0.00033166, -0.00000116, 0.00000000],
++		[-6.27337865, -0.00032997, 0.00020213, 0.00033162, -0.00000116, 0.00000000],
++		[-6.27337873, -0.00032993, 0.00020211, 0.00033159, -0.00000116, 0.00000000],
++		[-6.27337882, -0.00032990, 0.00020208, 0.00033155, -0.00000116, 0.00000000],
++		[-6.27337890, -0.00032986, 0.00020206, 0.00033152, -0.00000116, 0.00000000],
++		[-6.27337899, -0.00032983, 0.00020204, 0.00033148, -0.00000116, 0.00000000],
++		[-6.27337907, -0.00032979, 0.00020202, 0.00033145, -0.00000116, 0.00000000],
++		[-6.27337915, -0.00032976, 0.00020200, 0.00033141, -0.00000116, 0.00000000],
++		[-6.27337924, -0.00032972, 0.00020198, 0.00033138, -0.00000116, 0.00000000],
++		[-6.27337932, -0.00032969, 0.00020196, 0.00033134, -0.00000116, 0.00000000],
++		[-6.27337941, -0.00032965, 0.00020193, 0.00033131, -0.00000116, 0.00000000],
++		[-6.27337949, -0.00032962, 0.00020191, 0.00033127, -0.00000116, 0.00000000],
++		[-6.27337957, -0.00032958, 0.00020189, 0.00033124, -0.00000116, 0.00000000],
++		[-6.27337966, -0.00032955, 0.00020187, 0.00033120, -0.00000116, 0.00000000],
++		[-6.27337974, -0.00032951, 0.00020185, 0.00033116, -0.00000116, 0.00000000],
++		[-6.27337983, -0.00032948, 0.00020183, 0.00033113, -0.00000116, 0.00000000],
++		[-6.27337991, -0.00032944, 0.00020181, 0.00033109, -0.00000116, 0.00000000],
++		[-6.27337999, -0.00032941, 0.00020178, 0.00033106, -0.00000116, 0.00000000],
++		[-6.27338008, -0.00032937, 0.00020176, 0.00033102, -0.00000116, 0.00000000],
++		[-6.27338016, -0.00032934, 0.00020174, 0.00033099, -0.00000116, 0.00000000],
++		[-6.27338025, -0.00032930, 0.00020172, 0.00033095, -0.00000116, 0.00000000],
++		[-6.27338033, -0.00032927, 0.00020170, 0.00033092, -0.00000116, 0.00000000],
++		[-6.27338041, -0.00032923, 0.00020168, 0.00033088, -0.00000116, 0.00000000],
++		[-6.27338050, -0.00032920, 0.00020165, 0.00033085, -0.00000116, 0.00000000],
++		[-6.27338058, -0.00032916, 0.00020163, 0.00033081, -0.00000116, 0.00000000],
++		[-6.27338067, -0.00032913, 0.00020161, 0.00033078, -0.00000116, 0.00000000],
++		[-6.27338075, -0.00032909, 0.00020159, 0.00033074, -0.00000116, 0.00000000],
++		[-6.27338083, -0.00032906, 0.00020157, 0.00033071, -0.00000116, 0.00000000],
++		[-6.27338092, -0.00032902, 0.00020155, 0.00033067, -0.00000116, 0.00000000],
++		[-6.27338100, -0.00032899, 0.00020153, 0.00033064, -0.00000116, 0.00000000],
++		[-6.27338108, -0.00032895, 0.00020150, 0.00033060, -0.00000116, 0.00000000],
++		[-6.27338117, -0.00032892, 0.00020148, 0.00033057, -0.00000116, 0.00000000],
++		[-6.27338125, -0.00032888, 0.00020146, 0.00033053, -0.00000116, 0.00000000],
++		[-6.27338134, -0.00032885, 0.00020144, 0.00033050, -0.00000116, 0.00000000],
++		[-6.27338142, -0.00032881, 0.00020142, 0.00033046, -0.00000116, 0.00000000],
++		[-6.27338150, -0.00032878, 0.00020140, 0.00033043, -0.00000116, 0.00000000],
++		[-6.27338159, -0.00032874, 0.00020138, 0.00033039, -0.00000116, 0.00000000],
++		[-6.27338167, -0.00032871, 0.00020135, 0.00033036, -0.00000116, 0.00000000],
++		[-6.27338175, -0.00032867, 0.00020133, 0.00033032, -0.00000116, 0.00000000],
++		[-6.27338184, -0.00032864, 0.00020131, 0.00033029, -0.00000116, 0.00000000],
++		[-6.27338192, -0.00032860, 0.00020129, 0.00033025, -0.00000116, 0.00000000],
++		[-6.27338200, -0.00032857, 0.00020127, 0.00033022, -0.00000116, 0.00000000],
++		[-6.27338209, -0.00032853, 0.00020125, 0.00033018, -0.00000116, 0.00000000],
++		[-6.27338217, -0.00032850, 0.00020123, 0.00033015, -0.00000116, 0.00000000],
++		[-6.27338225, -0.00032846, 0.00020121, 0.00033011, -0.00000116, 0.00000000],
++		[-6.27338234, -0.00032843, 0.00020118, 0.00033008, -0.00000116, 0.00000000],
++		[-6.27338242, -0.00032839, 0.00020116, 0.00033004, -0.00000116, 0.00000000],
++		[-6.27338250, -0.00032836, 0.00020114, 0.00033001, -0.00000116, 0.00000000],
++		[-6.27338259, -0.00032832, 0.00020112, 0.00032997, -0.00000116, 0.00000000],
++		[-6.27338267, -0.00032829, 0.00020110, 0.00032994, -0.00000116, 0.00000000],
++		[-6.27338275, -0.00032825, 0.00020108, 0.00032990, -0.00000116, 0.00000000],
++		[-6.27338284, -0.00032822, 0.00020106, 0.00032987, -0.00000116, 0.00000000],
++		[-6.27338292, -0.00032818, 0.00020103, 0.00032983, -0.00000116, 0.00000000],
++		[-6.27338300, -0.00032815, 0.00020101, 0.00032980, -0.00000116, 0.00000000],
++		[-6.27338309, -0.00032811, 0.00020099, 0.00032976, -0.00000116, 0.00000000],
++		[-6.27338317, -0.00032808, 0.00020097, 0.00032973, -0.00000116, 0.00000000],
++		[-6.27338325, -0.00032804, 0.00020095, 0.00032969, -0.00000116, 0.00000000],
++		[-6.27338334, -0.00032801, 0.00020093, 0.00032966, -0.00000116, 0.00000000],
++		[-6.27338342, -0.00032797, 0.00020091, 0.00032962, -0.00000116, 0.00000000],
++		[-6.27338350, -0.00032794, 0.00020089, 0.00032959, -0.00000116, 0.00000000],
++		[-6.27338359, -0.00032791, 0.00020086, 0.00032955, -0.00000116, 0.00000000],
++		[-6.27338367, -0.00032787, 0.00020084, 0.00032952, -0.00000116, 0.00000000],
++		[-6.27338375, -0.00032784, 0.00020082, 0.00032948, -0.00000116, 0.00000000],
++		[-6.27338384, -0.00032780, 0.00020080, 0.00032945, -0.00000116, 0.00000000],
++		[-6.27338392, -0.00032777, 0.00020078, 0.00032941, -0.00000116, 0.00000000],
++		[-6.27338400, -0.00032773, 0.00020076, 0.00032938, -0.00000116, 0.00000000],
++		[-6.27338409, -0.00032770, 0.00020074, 0.00032934, -0.00000116, 0.00000000],
++		[-6.27338417, -0.00032766, 0.00020072, 0.00032931, -0.00000116, 0.00000000],
++		[-6.27338425, -0.00032763, 0.00020069, 0.00032927, -0.00000116, 0.00000000],
++		[-6.27338433, -0.00032759, 0.00020067, 0.00032924, -0.00000116, 0.00000000],
++		[-6.27338442, -0.00032756, 0.00020065, 0.00032920, -0.00000116, 0.00000000],
++		[-6.27338450, -0.00032752, 0.00020063, 0.00032917, -0.00000116, 0.00000000],
++		[-6.27338458, -0.00032749, 0.00020061, 0.00032913, -0.00000116, 0.00000000],
++		[-6.27338467, -0.00032745, 0.00020059, 0.00032910, -0.00000116, 0.00000000],
++		[-6.27338475, -0.00032742, 0.00020057, 0.00032906, -0.00000116, 0.00000000],
++		[-6.27338483, -0.00032739, 0.00020055, 0.00032903, -0.00000116, 0.00000000],
++		[-6.27338492, -0.00032735, 0.00020052, 0.00032899, -0.00000116, 0.00000000],
++		[-6.27338500, -0.00032732, 0.00020050, 0.00032896, -0.00000116, 0.00000000],
++		[-6.27338508, -0.00032728, 0.00020048, 0.00032892, -0.00000116, 0.00000000],
++		[-6.27338516, -0.00032725, 0.00020046, 0.00032889, -0.00000116, 0.00000000],
++		[-6.27338525, -0.00032721, 0.00020044, 0.00032885, -0.00000116, 0.00000000],
++		[-6.27338533, -0.00032718, 0.00020042, 0.00032882, -0.00000116, 0.00000000],
++		[-6.27338541, -0.00032714, 0.00020040, 0.00032878, -0.00000116, 0.00000000],
++		[-6.27338550, -0.00032711, 0.00020038, 0.00032875, -0.00000116, 0.00000000],
++		[-6.27338558, -0.00032707, 0.00020035, 0.00032872, -0.00000116, 0.00000000],
++		[-6.27338566, -0.00032704, 0.00020033, 0.00032868, -0.00000116, 0.00000000],
++		[-6.27338574, -0.00032700, 0.00020031, 0.00032865, -0.00000116, 0.00000000],
++		[-6.27338583, -0.00032697, 0.00020029, 0.00032861, -0.00000116, 0.00000000],
++		[-6.27338591, -0.00032694, 0.00020027, 0.00032858, -0.00000116, 0.00000000],
++		[-6.27338599, -0.00032690, 0.00020025, 0.00032854, -0.00000116, 0.00000000],
++		[-6.27338607, -0.00032687, 0.00020023, 0.00032851, -0.00000116, 0.00000000],
++		[-6.27338616, -0.00032683, 0.00020021, 0.00032847, -0.00000116, 0.00000000],
++		[-6.27338624, -0.00032680, 0.00020019, 0.00032844, -0.00000116, 0.00000000],
++		[-6.27338632, -0.00032676, 0.00020016, 0.00032840, -0.00000116, 0.00000000],
++		[-6.27338640, -0.00032673, 0.00020014, 0.00032837, -0.00000116, 0.00000000],
++		[-6.27338649, -0.00032669, 0.00020012, 0.00032833, -0.00000116, 0.00000000],
++		[-6.27338657, -0.00032666, 0.00020010, 0.00032830, -0.00000116, 0.00000000],
++		[-6.27338665, -0.00032663, 0.00020008, 0.00032826, -0.00000116, 0.00000000],
++		[-6.27338674, -0.00032659, 0.00020006, 0.00032823, -0.00000116, 0.00000000],
++		[-6.27338682, -0.00032656, 0.00020004, 0.00032820, -0.00000116, 0.00000000],
++		[-6.27338690, -0.00032652, 0.00020002, 0.00032816, -0.00000116, 0.00000000],
++		[-6.27338698, -0.00032649, 0.00020000, 0.00032813, -0.00000116, 0.00000000],
++		[-6.27338706, -0.00032645, 0.00019997, 0.00032809, -0.00000116, 0.00000000],
++		[-6.27338715, -0.00032642, 0.00019995, 0.00032806, -0.00000116, 0.00000000],
++		[-6.27338723, -0.00032638, 0.00019993, 0.00032802, -0.00000116, 0.00000000],
++		[-6.27338731, -0.00032635, 0.00019991, 0.00032799, -0.00000116, 0.00000000],
++		[-6.27338739, -0.00032632, 0.00019989, 0.00032795, -0.00000116, 0.00000000],
++		[-6.27338748, -0.00032628, 0.00019987, 0.00032792, -0.00000116, 0.00000000],
++		[-6.27338756, -0.00032625, 0.00019985, 0.00032788, -0.00000116, 0.00000000],
++		[-6.27338764, -0.00032621, 0.00019983, 0.00032785, -0.00000116, 0.00000000],
++		[-6.27338772, -0.00032618, 0.00019981, 0.00032781, -0.00000116, 0.00000000],
++		[-6.27338781, -0.00032614, 0.00019978, 0.00032778, -0.00000116, 0.00000000],
++		[-6.27338789, -0.00032611, 0.00019976, 0.00032775, -0.00000116, 0.00000000],
++		[-6.27338797, -0.00032607, 0.00019974, 0.00032771, -0.00000116, 0.00000000],
++		[-6.27338805, -0.00032604, 0.00019972, 0.00032768, -0.00000116, 0.00000000],
++		[-6.27338814, -0.00032601, 0.00019970, 0.00032764, -0.00000116, 0.00000000],
++		[-6.27338822, -0.00032597, 0.00019968, 0.00032761, -0.00000116, 0.00000000],
++		[-6.27338830, -0.00032594, 0.00019966, 0.00032757, -0.00000116, 0.00000000],
++		[-6.27338838, -0.00032590, 0.00019964, 0.00032754, -0.00000116, 0.00000000],
++		[-6.27338846, -0.00032587, 0.00019962, 0.00032750, -0.00000116, 0.00000000],
++		[-6.27338855, -0.00032583, 0.00019960, 0.00032747, -0.00000116, 0.00000000],
++		[-6.27338863, -0.00032580, 0.00019957, 0.00032744, -0.00000116, 0.00000000],
++		[-6.27338871, -0.00032577, 0.00019955, 0.00032740, -0.00000116, 0.00000000],
++		[-6.27338879, -0.00032573, 0.00019953, 0.00032737, -0.00000116, 0.00000000],
++		[-6.27338887, -0.00032570, 0.00019951, 0.00032733, -0.00000116, 0.00000000],
++		[-6.27338896, -0.00032566, 0.00019949, 0.00032730, -0.00000116, 0.00000000],
++		[-6.27338904, -0.00032563, 0.00019947, 0.00032726, -0.00000116, 0.00000000],
++		[-6.27338912, -0.00032559, 0.00019945, 0.00032723, -0.00000116, 0.00000000],
++		[-6.27338920, -0.00032556, 0.00019943, 0.00032719, -0.00000116, 0.00000000],
++		[-6.27338928, -0.00032553, 0.00019941, 0.00032716, -0.00000116, 0.00000000],
++		[-6.27338937, -0.00032549, 0.00019939, 0.00032713, -0.00000116, 0.00000000],
++		[-6.27338945, -0.00032546, 0.00019936, 0.00032709, -0.00000116, 0.00000000],
++		[-6.27338953, -0.00032542, 0.00019934, 0.00032706, -0.00000116, 0.00000000],
++		[-6.27338961, -0.00032539, 0.00019932, 0.00032702, -0.00000116, 0.00000000],
++		[-6.27338969, -0.00032536, 0.00019930, 0.00032699, -0.00000116, 0.00000000],
++		[-6.27338978, -0.00032532, 0.00019928, 0.00032695, -0.00000116, 0.00000000],
++		[-6.27338986, -0.00032529, 0.00019926, 0.00032692, -0.00000116, 0.00000000],
++		[-6.27338994, -0.00032525, 0.00019924, 0.00032688, -0.00000116, 0.00000000],
++		[-6.27339002, -0.00032522, 0.00019922, 0.00032685, -0.00000116, 0.00000000],
++		[-6.27339010, -0.00032518, 0.00019920, 0.00032682, -0.00000116, 0.00000000],
++		[-6.27339019, -0.00032515, 0.00019918, 0.00032678, -0.00000116, 0.00000000],
++		[-6.27339027, -0.00032512, 0.00019915, 0.00032675, -0.00000116, 0.00000000],
++		[-6.27339035, -0.00032508, 0.00019913, 0.00032671, -0.00000116, 0.00000000],
++		[-6.27339043, -0.00032505, 0.00019911, 0.00032668, -0.00000116, 0.00000000],
++		[-6.27339051, -0.00032501, 0.00019909, 0.00032664, -0.00000116, 0.00000000],
++		[-6.27339059, -0.00032498, 0.00019907, 0.00032661, -0.00000116, 0.00000000],
++		[-6.27339068, -0.00032495, 0.00019905, 0.00032658, -0.00000116, 0.00000000],
++		[-6.27339076, -0.00032491, 0.00019903, 0.00032654, -0.00000116, 0.00000000],
++		[-6.27339084, -0.00032488, 0.00019901, 0.00032651, -0.00000116, 0.00000000],
++		[-6.27339092, -0.00032484, 0.00019899, 0.00032647, -0.00000116, 0.00000000],
++		[-6.27339100, -0.00032481, 0.00019897, 0.00032644, -0.00000116, 0.00000000],
++		[-6.27339108, -0.00032477, 0.00019895, 0.00032640, -0.00000116, 0.00000000],
++		[-6.27339117, -0.00032474, 0.00019892, 0.00032637, -0.00000116, 0.00000000],
++		[-6.27339125, -0.00032471, 0.00019890, 0.00032634, -0.00000116, 0.00000000],
++		[-6.27339133, -0.00032467, 0.00019888, 0.00032630, -0.00000116, 0.00000000],
++		[-6.27339141, -0.00032464, 0.00019886, 0.00032627, -0.00000116, 0.00000000],
++		[-6.27339149, -0.00032460, 0.00019884, 0.00032623, -0.00000116, 0.00000000],
++		[-6.27339157, -0.00032457, 0.00019882, 0.00032620, -0.00000116, 0.00000000],
++		[-6.27339165, -0.00032454, 0.00019880, 0.00032617, -0.00000116, 0.00000000],
++		[-6.27339174, -0.00032450, 0.00019878, 0.00032613, -0.00000116, 0.00000000],
++		[-6.27339182, -0.00032447, 0.00019876, 0.00032610, -0.00000116, 0.00000000],
++		[-6.27339190, -0.00032443, 0.00019874, 0.00032606, -0.00000116, 0.00000000],
++		[-6.27339198, -0.00032440, 0.00019872, 0.00032603, -0.00000116, 0.00000000],
++		[-6.27339206, -0.00032437, 0.00019870, 0.00032599, -0.00000116, 0.00000000],
++		[-6.27339214, -0.00032433, 0.00019867, 0.00032596, -0.00000116, 0.00000000],
++		[-6.27339222, -0.00032430, 0.00019865, 0.00032593, -0.00000116, 0.00000000],
++		[-6.27339231, -0.00032426, 0.00019863, 0.00032589, -0.00000116, 0.00000000],
++		[-6.27339239, -0.00032423, 0.00019861, 0.00032586, -0.00000116, 0.00000000],
++		[-6.27339247, -0.00032420, 0.00019859, 0.00032582, -0.00000116, 0.00000000],
++		[-6.27339255, -0.00032416, 0.00019857, 0.00032579, -0.00000116, 0.00000000],
++		[-6.27339263, -0.00032413, 0.00019855, 0.00032576, -0.00000116, 0.00000000],
++		[-6.27339271, -0.00032409, 0.00019853, 0.00032572, -0.00000116, 0.00000000],
++		[-6.27339279, -0.00032406, 0.00019851, 0.00032569, -0.00000116, 0.00000000],
++		[-6.27339287, -0.00032403, 0.00019849, 0.00032565, -0.00000116, 0.00000000],
++		[-6.27339296, -0.00032399, 0.00019847, 0.00032562, -0.00000116, 0.00000000],
++		[-6.27339304, -0.00032396, 0.00019845, 0.00032558, -0.00000116, 0.00000000],
++		[-6.27339312, -0.00032393, 0.00019843, 0.00032555, -0.00000116, 0.00000000],
++		[-6.27339320, -0.00032389, 0.00019840, 0.00032552, -0.00000116, 0.00000000],
++		[-6.27339328, -0.00032386, 0.00019838, 0.00032548, -0.00000116, 0.00000000],
++		[-6.27339336, -0.00032382, 0.00019836, 0.00032545, -0.00000116, 0.00000000],
++		[-6.27339344, -0.00032379, 0.00019834, 0.00032541, -0.00000116, 0.00000000],
++		[-6.27339352, -0.00032376, 0.00019832, 0.00032538, -0.00000116, 0.00000000],
++		[-6.27339360, -0.00032372, 0.00019830, 0.00032535, -0.00000116, 0.00000000],
++		[-6.27339369, -0.00032369, 0.00019828, 0.00032531, -0.00000116, 0.00000000],
++		[-6.27339377, -0.00032365, 0.00019826, 0.00032528, -0.00000116, 0.00000000],
++		[-6.27339385, -0.00032362, 0.00019824, 0.00032524, -0.00000116, 0.00000000],
++		[-6.27339393, -0.00032359, 0.00019822, 0.00032521, -0.00000116, 0.00000000],
++		[-6.27339401, -0.00032355, 0.00019820, 0.00032518, -0.00000116, 0.00000000],
++		[-6.27339409, -0.00032352, 0.00019818, 0.00032514, -0.00000116, 0.00000000],
++		[-6.27339417, -0.00032349, 0.00019816, 0.00032511, -0.00000116, 0.00000000],
++		[-6.27339425, -0.00032345, 0.00019813, 0.00032507, -0.00000116, 0.00000000],
++		[-6.27339433, -0.00032342, 0.00019811, 0.00032504, -0.00000116, 0.00000000],
++		[-6.27339441, -0.00032338, 0.00019809, 0.00032501, -0.00000116, 0.00000000],
++		[-6.27339450, -0.00032335, 0.00019807, 0.00032497, -0.00000116, 0.00000000],
++		[-6.27339458, -0.00032332, 0.00019805, 0.00032494, -0.00000116, 0.00000000],
++		[-6.27339466, -0.00032328, 0.00019803, 0.00032490, -0.00000116, 0.00000000],
++		[-6.27339474, -0.00032325, 0.00019801, 0.00032487, -0.00000116, 0.00000000],
++		[-6.27339482, -0.00032321, 0.00019799, 0.00032484, -0.00000116, 0.00000000],
++		[-6.27339490, -0.00032318, 0.00019797, 0.00032480, -0.00000116, 0.00000000],
++		[-6.27339498, -0.00032315, 0.00019795, 0.00032477, -0.00000116, 0.00000000],
++		[-6.27339506, -0.00032311, 0.00019793, 0.00032473, -0.00000116, 0.00000000],
++		[-6.27339514, -0.00032308, 0.00019791, 0.00032470, -0.00000116, 0.00000000],
++		[-6.27339522, -0.00032305, 0.00019789, 0.00032467, -0.00000116, 0.00000000],
++		[-6.27339530, -0.00032301, 0.00019787, 0.00032463, -0.00000116, 0.00000000],
++		[-6.27339538, -0.00032298, 0.00019785, 0.00032460, -0.00000116, 0.00000000],
++		[-6.27339546, -0.00032295, 0.00019782, 0.00032457, -0.00000116, 0.00000000],
++		[-6.27339555, -0.00032291, 0.00019780, 0.00032453, -0.00000116, 0.00000000],
++		[-6.27339563, -0.00032288, 0.00019778, 0.00032450, -0.00000116, 0.00000000],
++		[-6.27339571, -0.00032284, 0.00019776, 0.00032446, -0.00000116, 0.00000000],
++		[-6.27339579, -0.00032281, 0.00019774, 0.00032443, -0.00000116, 0.00000000],
++		[-6.27339587, -0.00032278, 0.00019772, 0.00032440, -0.00000116, 0.00000000],
++		[-6.27339595, -0.00032274, 0.00019770, 0.00032436, -0.00000116, 0.00000000],
++		[-6.27339603, -0.00032271, 0.00019768, 0.00032433, -0.00000116, 0.00000000],
++		[-6.27339611, -0.00032268, 0.00019766, 0.00032429, -0.00000116, 0.00000000],
++		[-6.27339619, -0.00032264, 0.00019764, 0.00032426, -0.00000116, 0.00000000],
++		[-6.27339627, -0.00032261, 0.00019762, 0.00032423, -0.00000116, 0.00000000],
++		[-6.27339635, -0.00032258, 0.00019760, 0.00032419, -0.00000116, 0.00000000],
++		[-6.27339643, -0.00032254, 0.00019758, 0.00032416, -0.00000116, 0.00000000],
++		[-6.27339651, -0.00032251, 0.00019756, 0.00032413, -0.00000116, 0.00000000],
++		[-6.27339659, -0.00032247, 0.00019754, 0.00032409, -0.00000116, 0.00000000],
++		[-6.27339667, -0.00032244, 0.00019752, 0.00032406, -0.00000116, 0.00000000],
++		[-6.27339675, -0.00032241, 0.00019749, 0.00032402, -0.00000116, 0.00000000],
++		[-6.27339683, -0.00032237, 0.00019747, 0.00032399, -0.00000116, 0.00000000],
++		[-6.27339691, -0.00032234, 0.00019745, 0.00032396, -0.00000116, 0.00000000],
++		[-6.27339699, -0.00032231, 0.00019743, 0.00032392, -0.00000116, 0.00000000],
++		[-6.27339708, -0.00032227, 0.00019741, 0.00032389, -0.00000116, 0.00000000],
++		[-6.27339716, -0.00032224, 0.00019739, 0.00032386, -0.00000116, 0.00000000],
++		[-6.27339724, -0.00032221, 0.00019737, 0.00032382, -0.00000116, 0.00000000],
++		[-6.27339732, -0.00032217, 0.00019735, 0.00032379, -0.00000116, 0.00000000],
++		[-6.27339740, -0.00032214, 0.00019733, 0.00032375, -0.00000116, 0.00000000],
++		[-6.27339748, -0.00032210, 0.00019731, 0.00032372, -0.00000116, 0.00000000],
++		[-6.27339756, -0.00032207, 0.00019729, 0.00032369, -0.00000116, 0.00000000],
++		[-6.27339764, -0.00032204, 0.00019727, 0.00032365, -0.00000116, 0.00000000],
++		[-6.27339772, -0.00032200, 0.00019725, 0.00032362, -0.00000116, 0.00000000],
++		[-6.27339780, -0.00032197, 0.00019723, 0.00032359, -0.00000116, 0.00000000],
++		[-6.27339788, -0.00032194, 0.00019721, 0.00032355, -0.00000116, 0.00000000],
++		[-6.27339796, -0.00032190, 0.00019719, 0.00032352, -0.00000116, 0.00000000],
++		[-6.27339804, -0.00032187, 0.00019717, 0.00032349, -0.00000116, 0.00000000],
++		[-6.27339812, -0.00032184, 0.00019715, 0.00032345, -0.00000116, 0.00000000],
++		[-6.27339820, -0.00032180, 0.00019713, 0.00032342, -0.00000116, 0.00000000],
++		[-6.27339828, -0.00032177, 0.00019710, 0.00032338, -0.00000116, 0.00000000],
++		[-6.27339836, -0.00032174, 0.00019708, 0.00032335, -0.00000116, 0.00000000],
++		[-6.27339844, -0.00032170, 0.00019706, 0.00032332, -0.00000116, 0.00000000],
++		[-6.27339852, -0.00032167, 0.00019704, 0.00032328, -0.00000116, 0.00000000],
++		[-6.27339860, -0.00032164, 0.00019702, 0.00032325, -0.00000116, 0.00000000],
++		[-6.27339868, -0.00032160, 0.00019700, 0.00032322, -0.00000116, 0.00000000],
++		[-6.27339876, -0.00032157, 0.00019698, 0.00032318, -0.00000116, 0.00000000],
++		[-6.27339884, -0.00032154, 0.00019696, 0.00032315, -0.00000116, 0.00000000],
++		[-6.27339892, -0.00032150, 0.00019694, 0.00032312, -0.00000116, 0.00000000],
++		[-6.27339900, -0.00032147, 0.00019692, 0.00032308, -0.00000116, 0.00000000],
++		[-6.27339908, -0.00032144, 0.00019690, 0.00032305, -0.00000116, 0.00000000],
++		[-6.27339916, -0.00032140, 0.00019688, 0.00032302, -0.00000116, 0.00000000],
++		[-6.27339924, -0.00032137, 0.00019686, 0.00032298, -0.00000116, 0.00000000],
++		[-6.27339932, -0.00032134, 0.00019684, 0.00032295, -0.00000116, 0.00000000],
++		[-6.27339940, -0.00032130, 0.00019682, 0.00032291, -0.00000116, 0.00000000],
++		[-6.27339948, -0.00032127, 0.00019680, 0.00032288, -0.00000116, 0.00000000],
++		[-6.27339956, -0.00032124, 0.00019678, 0.00032285, -0.00000116, 0.00000000],
++		[-6.27339964, -0.00032120, 0.00019676, 0.00032281, -0.00000116, 0.00000000],
++		[-6.27339972, -0.00032117, 0.00019674, 0.00032278, -0.00000116, 0.00000000],
++		[-6.27339980, -0.00032114, 0.00019672, 0.00032275, -0.00000116, 0.00000000],
++		[-6.27339988, -0.00032110, 0.00019670, 0.00032271, -0.00000116, 0.00000000],
++		[-6.27339996, -0.00032107, 0.00019668, 0.00032268, -0.00000116, 0.00000000],
++		[-6.27340004, -0.00032104, 0.00019665, 0.00032265, -0.00000116, 0.00000000],
++		[-6.27340012, -0.00032100, 0.00019663, 0.00032261, -0.00000116, 0.00000000],
++		[-6.27340020, -0.00032097, 0.00019661, 0.00032258, -0.00000116, 0.00000000],
++		[-6.27340028, -0.00032094, 0.00019659, 0.00032255, -0.00000116, 0.00000000],
++		[-6.27340036, -0.00032090, 0.00019657, 0.00032251, -0.00000116, 0.00000000],
++		[-6.27340043, -0.00032087, 0.00019655, 0.00032248, -0.00000116, 0.00000000],
++		[-6.27340051, -0.00032084, 0.00019653, 0.00032245, -0.00000116, 0.00000000],
++		[-6.27340059, -0.00032080, 0.00019651, 0.00032241, -0.00000116, 0.00000000],
++		[-6.27340067, -0.00032077, 0.00019649, 0.00032238, -0.00000116, 0.00000000],
++		[-6.27340075, -0.00032074, 0.00019647, 0.00032235, -0.00000116, 0.00000000],
++		[-6.27340083, -0.00032070, 0.00019645, 0.00032231, -0.00000116, 0.00000000],
++		[-6.27340091, -0.00032067, 0.00019643, 0.00032228, -0.00000116, 0.00000000],
++		[-6.27340099, -0.00032064, 0.00019641, 0.00032225, -0.00000116, 0.00000000],
++		[-6.27340107, -0.00032060, 0.00019639, 0.00032221, -0.00000116, 0.00000000],
++		[-6.27340115, -0.00032057, 0.00019637, 0.00032218, -0.00000116, 0.00000000],
++		[-6.27340123, -0.00032054, 0.00019635, 0.00032215, -0.00000116, 0.00000000],
++		[-6.27340131, -0.00032050, 0.00019633, 0.00032211, -0.00000116, 0.00000000],
++		[-6.27340139, -0.00032047, 0.00019631, 0.00032208, -0.00000116, 0.00000000],
++		[-6.27340147, -0.00032044, 0.00019629, 0.00032205, -0.00000116, 0.00000000],
++		[-6.27340155, -0.00032040, 0.00019627, 0.00032201, -0.00000116, 0.00000000],
++		[-6.27340163, -0.00032037, 0.00019625, 0.00032198, -0.00000116, 0.00000000],
++		[-6.27340171, -0.00032034, 0.00019623, 0.00032195, -0.00000116, 0.00000000],
++		[-6.27340179, -0.00032031, 0.00019621, 0.00032191, -0.00000116, 0.00000000],
++		[-6.27340187, -0.00032027, 0.00019619, 0.00032188, -0.00000116, 0.00000000],
++		[-6.27340194, -0.00032024, 0.00019617, 0.00032185, -0.00000116, 0.00000000],
++		[-6.27340202, -0.00032021, 0.00019615, 0.00032181, -0.00000116, 0.00000000],
++		[-6.27340210, -0.00032017, 0.00019613, 0.00032178, -0.00000116, 0.00000000],
++		[-6.27340218, -0.00032014, 0.00019611, 0.00032175, -0.00000116, 0.00000000],
++		[-6.27340226, -0.00032011, 0.00019608, 0.00032171, -0.00000116, 0.00000000],
++		[-6.27340234, -0.00032007, 0.00019606, 0.00032168, -0.00000116, 0.00000000],
++		[-6.27340242, -0.00032004, 0.00019604, 0.00032165, -0.00000116, 0.00000000],
++		[-6.27340250, -0.00032001, 0.00019602, 0.00032161, -0.00000116, 0.00000000],
++		[-6.27340258, -0.00031997, 0.00019600, 0.00032158, -0.00000116, 0.00000000],
++		[-6.27340266, -0.00031994, 0.00019598, 0.00032155, -0.00000116, 0.00000000],
++		[-6.27340274, -0.00031991, 0.00019596, 0.00032151, -0.00000116, 0.00000000],
++		[-6.27340282, -0.00031987, 0.00019594, 0.00032148, -0.00000116, 0.00000000],
++		[-6.27340290, -0.00031984, 0.00019592, 0.00032145, -0.00000116, 0.00000000],
++		[-6.27340297, -0.00031981, 0.00019590, 0.00032141, -0.00000116, 0.00000000],
++		[-6.27340305, -0.00031978, 0.00019588, 0.00032138, -0.00000116, 0.00000000],
++		[-6.27340313, -0.00031974, 0.00019586, 0.00032135, -0.00000116, 0.00000000],
++		[-6.27340321, -0.00031971, 0.00019584, 0.00032131, -0.00000116, 0.00000000],
++		[-6.27340329, -0.00031968, 0.00019582, 0.00032128, -0.00000116, 0.00000000],
++		[-6.27340337, -0.00031964, 0.00019580, 0.00032125, -0.00000116, 0.00000000],
++		[-6.27340345, -0.00031961, 0.00019578, 0.00032121, -0.00000116, 0.00000000],
++		[-6.27340353, -0.00031958, 0.00019576, 0.00032118, -0.00000116, 0.00000000],
++		[-6.27340361, -0.00031954, 0.00019574, 0.00032115, -0.00000116, 0.00000000],
++		[-6.27340369, -0.00031951, 0.00019572, 0.00032111, -0.00000116, 0.00000000],
++		[-6.27340377, -0.00031948, 0.00019570, 0.00032108, -0.00000116, 0.00000000],
++		[-6.27340384, -0.00031945, 0.00019568, 0.00032105, -0.00000116, 0.00000000],
++		[-6.27340392, -0.00031941, 0.00019566, 0.00032102, -0.00000116, 0.00000000],
++		[-6.27340400, -0.00031938, 0.00019564, 0.00032098, -0.00000116, 0.00000000],
++		[-6.27340408, -0.00031935, 0.00019562, 0.00032095, -0.00000116, 0.00000000],
++		[-6.27340416, -0.00031931, 0.00019560, 0.00032092, -0.00000116, 0.00000000],
++		[-6.27340424, -0.00031928, 0.00019558, 0.00032088, -0.00000116, 0.00000000],
++		[-6.27340432, -0.00031925, 0.00019556, 0.00032085, -0.00000116, 0.00000000],
++		[-6.27340440, -0.00031922, 0.00019554, 0.00032082, -0.00000116, 0.00000000],
++		[-6.27340448, -0.00031918, 0.00019552, 0.00032078, -0.00000116, 0.00000000],
++		[-6.27340455, -0.00031915, 0.00019550, 0.00032075, -0.00000116, 0.00000000],
++		[-6.27340463, -0.00031912, 0.00019548, 0.00032072, -0.00000116, 0.00000000],
++		[-6.27340471, -0.00031908, 0.00019546, 0.00032068, -0.00000116, 0.00000000],
++		[-6.27340479, -0.00031905, 0.00019544, 0.00032065, -0.00000116, 0.00000000],
++		[-6.27340487, -0.00031902, 0.00019542, 0.00032062, -0.00000116, 0.00000000],
++		[-6.27340495, -0.00031899, 0.00019540, 0.00032059, -0.00000116, 0.00000000],
++		[-6.27340503, -0.00031895, 0.00019538, 0.00032055, -0.00000116, 0.00000000],
++		[-6.27340511, -0.00031892, 0.00019536, 0.00032052, -0.00000116, 0.00000000],
++		[-6.27340518, -0.00031889, 0.00019534, 0.00032049, -0.00000116, 0.00000000],
++		[-6.27340526, -0.00031885, 0.00019532, 0.00032045, -0.00000116, 0.00000000],
++		[-6.27340534, -0.00031882, 0.00019530, 0.00032042, -0.00000116, 0.00000000],
++		[-6.27340542, -0.00031879, 0.00019528, 0.00032039, -0.00000116, 0.00000000],
++		[-6.27340550, -0.00031876, 0.00019526, 0.00032035, -0.00000116, 0.00000000],
++		[-6.27340558, -0.00031872, 0.00019524, 0.00032032, -0.00000116, 0.00000000],
++		[-6.27340566, -0.00031869, 0.00019522, 0.00032029, -0.00000116, 0.00000000],
++		[-6.27340573, -0.00031866, 0.00019520, 0.00032026, -0.00000116, 0.00000000],
++		[-6.27340581, -0.00031862, 0.00019518, 0.00032022, -0.00000116, 0.00000000],
++		[-6.27340589, -0.00031859, 0.00019516, 0.00032019, -0.00000116, 0.00000000],
++		[-6.27340597, -0.00031856, 0.00019514, 0.00032016, -0.00000116, 0.00000000],
++		[-6.27340605, -0.00031853, 0.00019512, 0.00032012, -0.00000116, 0.00000000],
++		[-6.27340613, -0.00031849, 0.00019510, 0.00032009, -0.00000116, 0.00000000],
++		[-6.27340621, -0.00031846, 0.00019508, 0.00032006, -0.00000116, 0.00000000],
++		[-6.27340628, -0.00031843, 0.00019506, 0.00032002, -0.00000116, 0.00000000],
++		[-6.27340636, -0.00031839, 0.00019504, 0.00031999, -0.00000116, 0.00000000],
++		[-6.27340644, -0.00031836, 0.00019502, 0.00031996, -0.00000116, 0.00000000],
++		[-6.27340652, -0.00031833, 0.00019500, 0.00031993, -0.00000116, 0.00000000],
++		[-6.27340660, -0.00031830, 0.00019498, 0.00031989, -0.00000116, 0.00000000],
++		[-6.27340668, -0.00031826, 0.00019496, 0.00031986, -0.00000116, 0.00000000],
++		[-6.27340675, -0.00031823, 0.00019494, 0.00031983, -0.00000116, 0.00000000],
++		[-6.27340683, -0.00031820, 0.00019492, 0.00031979, -0.00000116, 0.00000000],
++		[-6.27340691, -0.00031817, 0.00019490, 0.00031976, -0.00000116, 0.00000000],
++		[-6.27340699, -0.00031813, 0.00019488, 0.00031973, -0.00000116, 0.00000000],
++		[-6.27340707, -0.00031810, 0.00019486, 0.00031970, -0.00000116, 0.00000000],
++		[-6.27340715, -0.00031807, 0.00019484, 0.00031966, -0.00000116, 0.00000000],
++		[-6.27340722, -0.00031803, 0.00019482, 0.00031963, -0.00000116, 0.00000000],
++		[-6.27340730, -0.00031800, 0.00019480, 0.00031960, -0.00000116, 0.00000000],
++		[-6.27340738, -0.00031797, 0.00019478, 0.00031956, -0.00000116, 0.00000000],
++		[-6.27340746, -0.00031794, 0.00019476, 0.00031953, -0.00000116, 0.00000000],
++		[-6.27340754, -0.00031790, 0.00019474, 0.00031950, -0.00000116, 0.00000000],
++		[-6.27340761, -0.00031787, 0.00019472, 0.00031947, -0.00000116, 0.00000000],
++		[-6.27340769, -0.00031784, 0.00019470, 0.00031943, -0.00000116, 0.00000000],
++		[-6.27340777, -0.00031781, 0.00019468, 0.00031940, -0.00000116, 0.00000000],
++		[-6.27340785, -0.00031777, 0.00019466, 0.00031937, -0.00000116, 0.00000000],
++		[-6.27340793, -0.00031774, 0.00019464, 0.00031933, -0.00000116, 0.00000000],
++		[-6.27340801, -0.00031771, 0.00019462, 0.00031930, -0.00000116, 0.00000000],
++		[-6.27340808, -0.00031768, 0.00019460, 0.00031927, -0.00000116, 0.00000000],
++		[-6.27340816, -0.00031764, 0.00019458, 0.00031924, -0.00000116, 0.00000000],
++		[-6.27340824, -0.00031761, 0.00019456, 0.00031920, -0.00000116, 0.00000000],
++		[-6.27340832, -0.00031758, 0.00019454, 0.00031917, -0.00000116, 0.00000000],
++		[-6.27340840, -0.00031755, 0.00019452, 0.00031914, -0.00000116, 0.00000000],
++		[-6.27340847, -0.00031751, 0.00019450, 0.00031911, -0.00000116, 0.00000000],
++		[-6.27340855, -0.00031748, 0.00019448, 0.00031907, -0.00000116, 0.00000000],
++		[-6.27340863, -0.00031745, 0.00019446, 0.00031904, -0.00000116, 0.00000000],
++		[-6.27340871, -0.00031742, 0.00019444, 0.00031901, -0.00000116, 0.00000000],
++		[-6.27340879, -0.00031738, 0.00019442, 0.00031897, -0.00000116, 0.00000000],
++		[-6.27340886, -0.00031735, 0.00019440, 0.00031894, -0.00000116, 0.00000000],
++		[-6.27340894, -0.00031732, 0.00019438, 0.00031891, -0.00000116, 0.00000000],
++		[-6.27340902, -0.00031728, 0.00019436, 0.00031888, -0.00000116, 0.00000000],
++		[-6.27340910, -0.00031725, 0.00019434, 0.00031884, -0.00000116, 0.00000000],
++		[-6.27340917, -0.00031722, 0.00019432, 0.00031881, -0.00000116, 0.00000000],
++		[-6.27340925, -0.00031719, 0.00019430, 0.00031878, -0.00000116, 0.00000000],
++		[-6.27340933, -0.00031715, 0.00019428, 0.00031875, -0.00000116, 0.00000000],
++		[-6.27340941, -0.00031712, 0.00019426, 0.00031871, -0.00000116, 0.00000000],
++		[-6.27340949, -0.00031709, 0.00019424, 0.00031868, -0.00000116, 0.00000000],
++		[-6.27340956, -0.00031706, 0.00019422, 0.00031865, -0.00000116, 0.00000000],
++		[-6.27340964, -0.00031702, 0.00019420, 0.00031862, -0.00000116, 0.00000000],
++		[-6.27340972, -0.00031699, 0.00019418, 0.00031858, -0.00000116, 0.00000000],
++		[-6.27340980, -0.00031696, 0.00019416, 0.00031855, -0.00000116, 0.00000000],
++		[-6.27340987, -0.00031693, 0.00019414, 0.00031852, -0.00000116, 0.00000000],
++		[-6.27340995, -0.00031690, 0.00019412, 0.00031848, -0.00000116, 0.00000000],
++		[-6.27341003, -0.00031686, 0.00019410, 0.00031845, -0.00000116, 0.00000000],
++		[-6.27341011, -0.00031683, 0.00019408, 0.00031842, -0.00000116, 0.00000000],
++		[-6.27341019, -0.00031680, 0.00019406, 0.00031839, -0.00000116, 0.00000000],
++		[-6.27341026, -0.00031677, 0.00019404, 0.00031835, -0.00000116, 0.00000000],
++		[-6.27341034, -0.00031673, 0.00019402, 0.00031832, -0.00000116, 0.00000000],
++		[-6.27341042, -0.00031670, 0.00019400, 0.00031829, -0.00000116, 0.00000000],
++		[-6.27341050, -0.00031667, 0.00019398, 0.00031826, -0.00000116, 0.00000000],
++		[-6.27341057, -0.00031664, 0.00019396, 0.00031822, -0.00000116, 0.00000000],
++		[-6.27341065, -0.00031660, 0.00019394, 0.00031819, -0.00000116, 0.00000000],
++		[-6.27341073, -0.00031657, 0.00019392, 0.00031816, -0.00000116, 0.00000000],
++		[-6.27341081, -0.00031654, 0.00019390, 0.00031813, -0.00000116, 0.00000000],
++		[-6.27341088, -0.00031651, 0.00019388, 0.00031809, -0.00000116, 0.00000000],
++		[-6.27341096, -0.00031647, 0.00019386, 0.00031806, -0.00000116, 0.00000000],
++		[-6.27341104, -0.00031644, 0.00019384, 0.00031803, -0.00000116, 0.00000000],
++		[-6.27341112, -0.00031641, 0.00019382, 0.00031800, -0.00000116, 0.00000000],
++		[-6.27341119, -0.00031638, 0.00019380, 0.00031796, -0.00000116, 0.00000000],
++		[-6.27341127, -0.00031634, 0.00019378, 0.00031793, -0.00000116, 0.00000000],
++		[-6.27341135, -0.00031631, 0.00019376, 0.00031790, -0.00000116, 0.00000000],
++		[-6.27341143, -0.00031628, 0.00019374, 0.00031787, -0.00000116, 0.00000000],
++		[-6.27341150, -0.00031625, 0.00019372, 0.00031783, -0.00000116, 0.00000000],
++		[-6.27341158, -0.00031622, 0.00019370, 0.00031780, -0.00000116, 0.00000000],
++		[-6.27341166, -0.00031618, 0.00019368, 0.00031777, -0.00000116, 0.00000000],
++		[-6.27341173, -0.00031615, 0.00019366, 0.00031774, -0.00000116, 0.00000000],
++		[-6.27341181, -0.00031612, 0.00019364, 0.00031770, -0.00000116, 0.00000000],
++		[-6.27341189, -0.00031609, 0.00019362, 0.00031767, -0.00000116, 0.00000000],
++		[-6.27341197, -0.00031605, 0.00019360, 0.00031764, -0.00000116, 0.00000000],
++		[-6.27341204, -0.00031602, 0.00019358, 0.00031761, -0.00000116, 0.00000000],
++		[-6.27341212, -0.00031599, 0.00019356, 0.00031757, -0.00000116, 0.00000000],
++		[-6.27341220, -0.00031596, 0.00019354, 0.00031754, -0.00000116, 0.00000000],
++		[-6.27341228, -0.00031592, 0.00019352, 0.00031751, -0.00000116, 0.00000000],
++		[-6.27341235, -0.00031589, 0.00019350, 0.00031748, -0.00000116, 0.00000000],
++		[-6.27341243, -0.00031586, 0.00019348, 0.00031744, -0.00000116, 0.00000000],
++		[-6.27341251, -0.00031583, 0.00019346, 0.00031741, -0.00000116, 0.00000000],
++		[-6.27341258, -0.00031580, 0.00019344, 0.00031738, -0.00000116, 0.00000000],
++		[-6.27341266, -0.00031576, 0.00019342, 0.00031735, -0.00000116, 0.00000000],
++		[-6.27341274, -0.00031573, 0.00019340, 0.00031732, -0.00000116, 0.00000000],
++		[-6.27341282, -0.00031570, 0.00019338, 0.00031728, -0.00000116, 0.00000000],
++		[-6.27341289, -0.00031567, 0.00019336, 0.00031725, -0.00000116, 0.00000000],
++		[-6.27341297, -0.00031563, 0.00019334, 0.00031722, -0.00000116, 0.00000000],
++		[-6.27341305, -0.00031560, 0.00019333, 0.00031719, -0.00000116, 0.00000000],
++		[-6.27341312, -0.00031557, 0.00019331, 0.00031715, -0.00000116, 0.00000000],
++		[-6.27341320, -0.00031554, 0.00019329, 0.00031712, -0.00000116, 0.00000000],
++		[-6.27341328, -0.00031551, 0.00019327, 0.00031709, -0.00000116, 0.00000000],
++		[-6.27341336, -0.00031547, 0.00019325, 0.00031706, -0.00000116, 0.00000000],
++		[-6.27341343, -0.00031544, 0.00019323, 0.00031702, -0.00000116, 0.00000000],
++		[-6.27341351, -0.00031541, 0.00019321, 0.00031699, -0.00000116, 0.00000000],
++		[-6.27341359, -0.00031538, 0.00019319, 0.00031696, -0.00000116, 0.00000000],
++		[-6.27341366, -0.00031535, 0.00019317, 0.00031693, -0.00000116, 0.00000000],
++		[-6.27341374, -0.00031531, 0.00019315, 0.00031689, -0.00000116, 0.00000000],
++		[-6.27341382, -0.00031528, 0.00019313, 0.00031686, -0.00000116, 0.00000000],
++		[-6.27341389, -0.00031525, 0.00019311, 0.00031683, -0.00000116, 0.00000000],
++		[-6.27341397, -0.00031522, 0.00019309, 0.00031680, -0.00000116, 0.00000000],
++		[-6.27341405, -0.00031519, 0.00019307, 0.00031677, -0.00000116, 0.00000000],
++		[-6.27341412, -0.00031515, 0.00019305, 0.00031673, -0.00000116, 0.00000000],
++		[-6.27341420, -0.00031512, 0.00019303, 0.00031670, -0.00000116, 0.00000000],
++		[-6.27341428, -0.00031509, 0.00019301, 0.00031667, -0.00000116, 0.00000000],
++		[-6.27341435, -0.00031506, 0.00019299, 0.00031664, -0.00000116, 0.00000000],
++		[-6.27341443, -0.00031502, 0.00019297, 0.00031660, -0.00000116, 0.00000000],
++		[-6.27341451, -0.00031499, 0.00019295, 0.00031657, -0.00000116, 0.00000000],
++		[-6.27341459, -0.00031496, 0.00019293, 0.00031654, -0.00000116, 0.00000000],
++		[-6.27341466, -0.00031493, 0.00019291, 0.00031651, -0.00000116, 0.00000000],
++		[-6.27341474, -0.00031490, 0.00019289, 0.00031648, -0.00000116, 0.00000000],
++		[-6.27341482, -0.00031486, 0.00019287, 0.00031644, -0.00000116, 0.00000000],
++		[-6.27341489, -0.00031483, 0.00019285, 0.00031641, -0.00000116, 0.00000000],
++		[-6.27341497, -0.00031480, 0.00019283, 0.00031638, -0.00000116, 0.00000000],
++		[-6.27341505, -0.00031477, 0.00019281, 0.00031635, -0.00000116, 0.00000000],
++		[-6.27341512, -0.00031474, 0.00019279, 0.00031631, -0.00000116, 0.00000000],
++		[-6.27341520, -0.00031470, 0.00019277, 0.00031628, -0.00000116, 0.00000000],
++		[-6.27341528, -0.00031467, 0.00019275, 0.00031625, -0.00000116, 0.00000000],
++		[-6.27341535, -0.00031464, 0.00019274, 0.00031622, -0.00000116, 0.00000000],
++		[-6.27341543, -0.00031461, 0.00019272, 0.00031619, -0.00000116, 0.00000000],
++		[-6.27341550, -0.00031458, 0.00019270, 0.00031615, -0.00000116, 0.00000000],
++		[-6.27341558, -0.00031454, 0.00019268, 0.00031612, -0.00000116, 0.00000000],
++		[-6.27341566, -0.00031451, 0.00019266, 0.00031609, -0.00000116, 0.00000000],
++		[-6.27341573, -0.00031448, 0.00019264, 0.00031606, -0.00000116, 0.00000000],
++		[-6.27341581, -0.00031445, 0.00019262, 0.00031603, -0.00000116, 0.00000000],
++		[-6.27341589, -0.00031442, 0.00019260, 0.00031599, -0.00000116, 0.00000000],
++		[-6.27341596, -0.00031438, 0.00019258, 0.00031596, -0.00000116, 0.00000000],
++		[-6.27341604, -0.00031435, 0.00019256, 0.00031593, -0.00000116, 0.00000000],
++		[-6.27341612, -0.00031432, 0.00019254, 0.00031590, -0.00000116, 0.00000000],
++		[-6.27341619, -0.00031429, 0.00019252, 0.00031587, -0.00000116, 0.00000000],
++		[-6.27341627, -0.00031426, 0.00019250, 0.00031583, -0.00000116, 0.00000000],
++		[-6.27341635, -0.00031423, 0.00019248, 0.00031580, -0.00000116, 0.00000000],
++		[-6.27341642, -0.00031419, 0.00019246, 0.00031577, -0.00000116, 0.00000000],
++		[-6.27341650, -0.00031416, 0.00019244, 0.00031574, -0.00000116, 0.00000000],
++		[-6.27341658, -0.00031413, 0.00019242, 0.00031571, -0.00000116, 0.00000000],
++		[-6.27341665, -0.00031410, 0.00019240, 0.00031567, -0.00000116, 0.00000000],
++		[-6.27341673, -0.00031407, 0.00019238, 0.00031564, -0.00000116, 0.00000000],
++		[-6.27341680, -0.00031403, 0.00019236, 0.00031561, -0.00000116, 0.00000000],
++		[-6.27341688, -0.00031400, 0.00019234, 0.00031558, -0.00000116, 0.00000000],
++		[-6.27341696, -0.00031397, 0.00019232, 0.00031554, -0.00000116, 0.00000000],
++		[-6.27341703, -0.00031394, 0.00019231, 0.00031551, -0.00000116, 0.00000000],
++		[-6.27341711, -0.00031391, 0.00019229, 0.00031548, -0.00000116, 0.00000000],
++		[-6.27341719, -0.00031387, 0.00019227, 0.00031545, -0.00000116, 0.00000000],
++		[-6.27341726, -0.00031384, 0.00019225, 0.00031542, -0.00000116, 0.00000000],
++		[-6.27341734, -0.00031381, 0.00019223, 0.00031538, -0.00000116, 0.00000000],
++		[-6.27341741, -0.00031378, 0.00019221, 0.00031535, -0.00000116, 0.00000000],
++		[-6.27341749, -0.00031375, 0.00019219, 0.00031532, -0.00000116, 0.00000000],
++		[-6.27341757, -0.00031372, 0.00019217, 0.00031529, -0.00000116, 0.00000000],
++		[-6.27341764, -0.00031368, 0.00019215, 0.00031526, -0.00000116, 0.00000000],
++		[-6.27341772, -0.00031365, 0.00019213, 0.00031523, -0.00000116, 0.00000000],
++		[-6.27341779, -0.00031362, 0.00019211, 0.00031519, -0.00000116, 0.00000000],
++		[-6.27341787, -0.00031359, 0.00019209, 0.00031516, -0.00000116, 0.00000000],
++		[-6.27341795, -0.00031356, 0.00019207, 0.00031513, -0.00000116, 0.00000000],
++		[-6.27341802, -0.00031353, 0.00019205, 0.00031510, -0.00000116, 0.00000000],
++		[-6.27341810, -0.00031349, 0.00019203, 0.00031507, -0.00000116, 0.00000000],
++		[-6.27341817, -0.00031346, 0.00019201, 0.00031503, -0.00000116, 0.00000000],
++		[-6.27341825, -0.00031343, 0.00019199, 0.00031500, -0.00000116, 0.00000000],
++		[-6.27341833, -0.00031340, 0.00019197, 0.00031497, -0.00000116, 0.00000000],
++		[-6.27341840, -0.00031337, 0.00019195, 0.00031494, -0.00000116, 0.00000000],
++		[-6.27341848, -0.00031333, 0.00019194, 0.00031491, -0.00000116, 0.00000000],
++		[-6.27341855, -0.00031330, 0.00019192, 0.00031487, -0.00000116, 0.00000000],
++		[-6.27341863, -0.00031327, 0.00019190, 0.00031484, -0.00000116, 0.00000000],
++		[-6.27341871, -0.00031324, 0.00019188, 0.00031481, -0.00000116, 0.00000000],
++		[-6.27341878, -0.00031321, 0.00019186, 0.00031478, -0.00000116, 0.00000000],
++		[-6.27341886, -0.00031318, 0.00019184, 0.00031475, -0.00000116, 0.00000000],
++		[-6.27341893, -0.00031314, 0.00019182, 0.00031471, -0.00000116, 0.00000000],
++		[-6.27341901, -0.00031311, 0.00019180, 0.00031468, -0.00000116, 0.00000000],
++		[-6.27341909, -0.00031308, 0.00019178, 0.00031465, -0.00000116, 0.00000000],
++		[-6.27341916, -0.00031305, 0.00019176, 0.00031462, -0.00000116, 0.00000000],
++		[-6.27341924, -0.00031302, 0.00019174, 0.00031459, -0.00000116, 0.00000000],
++		[-6.27341931, -0.00031299, 0.00019172, 0.00031456, -0.00000116, 0.00000000],
++		[-6.27341939, -0.00031295, 0.00019170, 0.00031452, -0.00000116, 0.00000000],
++		[-6.27341946, -0.00031292, 0.00019168, 0.00031449, -0.00000116, 0.00000000],
++		[-6.27341954, -0.00031289, 0.00019166, 0.00031446, -0.00000116, 0.00000000],
++		[-6.27341962, -0.00031286, 0.00019164, 0.00031443, -0.00000116, 0.00000000],
++		[-6.27341969, -0.00031283, 0.00019162, 0.00031440, -0.00000116, 0.00000000],
++		[-6.27341977, -0.00031280, 0.00019161, 0.00031437, -0.00000116, 0.00000000],
++		[-6.27341984, -0.00031276, 0.00019159, 0.00031433, -0.00000116, 0.00000000],
++		[-6.27341992, -0.00031273, 0.00019157, 0.00031430, -0.00000116, 0.00000000],
++		[-6.27341999, -0.00031270, 0.00019155, 0.00031427, -0.00000116, 0.00000000],
++		[-6.27342007, -0.00031267, 0.00019153, 0.00031424, -0.00000116, 0.00000000],
++		[-6.27342015, -0.00031264, 0.00019151, 0.00031421, -0.00000116, 0.00000000],
++		[-6.27342022, -0.00031261, 0.00019149, 0.00031417, -0.00000116, 0.00000000],
++		[-6.27342030, -0.00031258, 0.00019147, 0.00031414, -0.00000116, 0.00000000],
++		[-6.27342037, -0.00031254, 0.00019145, 0.00031411, -0.00000116, 0.00000000],
++		[-6.27342045, -0.00031251, 0.00019143, 0.00031408, -0.00000116, 0.00000000],
++		[-6.27342052, -0.00031248, 0.00019141, 0.00031405, -0.00000116, 0.00000000],
++		[-6.27342060, -0.00031245, 0.00019139, 0.00031402, -0.00000116, 0.00000000],
++		[-6.27342067, -0.00031242, 0.00019137, 0.00031398, -0.00000116, 0.00000000],
++		[-6.27342075, -0.00031239, 0.00019135, 0.00031395, -0.00000116, 0.00000000],
++		[-6.27342083, -0.00031235, 0.00019133, 0.00031392, -0.00000116, 0.00000000],
++		[-6.27342090, -0.00031232, 0.00019132, 0.00031389, -0.00000116, 0.00000000],
++		[-6.27342098, -0.00031229, 0.00019130, 0.00031386, -0.00000116, 0.00000000],
++		[-6.27342105, -0.00031226, 0.00019128, 0.00031383, -0.00000116, 0.00000000],
++		[-6.27342113, -0.00031223, 0.00019126, 0.00031379, -0.00000116, 0.00000000],
++		[-6.27342120, -0.00031220, 0.00019124, 0.00031376, -0.00000116, 0.00000000],
++		[-6.27342128, -0.00031217, 0.00019122, 0.00031373, -0.00000116, 0.00000000],
++		[-6.27342135, -0.00031213, 0.00019120, 0.00031370, -0.00000116, 0.00000000],
++		[-6.27342143, -0.00031210, 0.00019118, 0.00031367, -0.00000116, 0.00000000],
++		[-6.27342150, -0.00031207, 0.00019116, 0.00031364, -0.00000116, 0.00000000],
++		[-6.27342158, -0.00031204, 0.00019114, 0.00031360, -0.00000116, 0.00000000],
++		[-6.27342166, -0.00031201, 0.00019112, 0.00031357, -0.00000116, 0.00000000],
++		[-6.27342173, -0.00031198, 0.00019110, 0.00031354, -0.00000116, 0.00000000],
++		[-6.27342181, -0.00031195, 0.00019108, 0.00031351, -0.00000116, 0.00000000],
++		[-6.27342188, -0.00031191, 0.00019106, 0.00031348, -0.00000116, 0.00000000],
++		[-6.27342196, -0.00031188, 0.00019105, 0.00031345, -0.00000116, 0.00000000],
++		[-6.27342203, -0.00031185, 0.00019103, 0.00031341, -0.00000116, 0.00000000],
++		[-6.27342211, -0.00031182, 0.00019101, 0.00031338, -0.00000116, 0.00000000],
++		[-6.27342218, -0.00031179, 0.00019099, 0.00031335, -0.00000116, 0.00000000],
++		[-6.27342226, -0.00031176, 0.00019097, 0.00031332, -0.00000116, 0.00000000],
++		[-6.27342233, -0.00031173, 0.00019095, 0.00031329, -0.00000116, 0.00000000],
++		[-6.27342241, -0.00031169, 0.00019093, 0.00031326, -0.00000116, 0.00000000],
++		[-6.27342248, -0.00031166, 0.00019091, 0.00031323, -0.00000116, 0.00000000],
++		[-6.27342256, -0.00031163, 0.00019089, 0.00031319, -0.00000116, 0.00000000],
++		[-6.27342263, -0.00031160, 0.00019087, 0.00031316, -0.00000116, 0.00000000],
++		[-6.27342271, -0.00031157, 0.00019085, 0.00031313, -0.00000116, 0.00000000],
++		[-6.27342278, -0.00031154, 0.00019083, 0.00031310, -0.00000116, 0.00000000],
++		[-6.27342286, -0.00031151, 0.00019081, 0.00031307, -0.00000116, 0.00000000],
++		[-6.27342293, -0.00031147, 0.00019080, 0.00031304, -0.00000116, 0.00000000],
++		[-6.27342301, -0.00031144, 0.00019078, 0.00031300, -0.00000116, 0.00000000],
++		[-6.27342308, -0.00031141, 0.00019076, 0.00031297, -0.00000116, 0.00000000],
++		[-6.27342316, -0.00031138, 0.00019074, 0.00031294, -0.00000116, 0.00000000],
++		[-6.27342323, -0.00031135, 0.00019072, 0.00031291, -0.00000116, 0.00000000],
++		[-6.27342331, -0.00031132, 0.00019070, 0.00031288, -0.00000116, 0.00000000],
++		[-6.27342338, -0.00031129, 0.00019068, 0.00031285, -0.00000116, 0.00000000],
++		[-6.27342346, -0.00031126, 0.00019066, 0.00031282, -0.00000116, 0.00000000],
++		[-6.27342353, -0.00031122, 0.00019064, 0.00031278, -0.00000116, 0.00000000],
++		[-6.27342361, -0.00031119, 0.00019062, 0.00031275, -0.00000116, 0.00000000],
++		[-6.27342368, -0.00031116, 0.00019060, 0.00031272, -0.00000116, 0.00000000],
++		[-6.27342376, -0.00031113, 0.00019058, 0.00031269, -0.00000116, 0.00000000],
++		[-6.27342383, -0.00031110, 0.00019057, 0.00031266, -0.00000116, 0.00000000],
++		[-6.27342391, -0.00031107, 0.00019055, 0.00031263, -0.00000116, 0.00000000],
++		[-6.27342398, -0.00031104, 0.00019053, 0.00031260, -0.00000116, 0.00000000],
++		[-6.27342406, -0.00031101, 0.00019051, 0.00031256, -0.00000116, 0.00000000],
++		[-6.27342413, -0.00031097, 0.00019049, 0.00031253, -0.00000116, 0.00000000],
++		[-6.27342421, -0.00031094, 0.00019047, 0.00031250, -0.00000116, 0.00000000],
++		[-6.27342428, -0.00031091, 0.00019045, 0.00031247, -0.00000116, 0.00000000],
++		[-6.27342436, -0.00031088, 0.00019043, 0.00031244, -0.00000116, 0.00000000],
++		[-6.27342443, -0.00031085, 0.00019041, 0.00031241, -0.00000116, 0.00000000],
++		[-6.27342451, -0.00031082, 0.00019039, 0.00031238, -0.00000116, 0.00000000],
++		[-6.27342458, -0.00031079, 0.00019037, 0.00031235, -0.00000116, 0.00000000],
++		[-6.27342466, -0.00031076, 0.00019035, 0.00031231, -0.00000116, 0.00000000],
++		[-6.27342473, -0.00031072, 0.00019034, 0.00031228, -0.00000116, 0.00000000],
++		[-6.27342480, -0.00031069, 0.00019032, 0.00031225, -0.00000116, 0.00000000],
++		[-6.27342488, -0.00031066, 0.00019030, 0.00031222, -0.00000116, 0.00000000],
++		[-6.27342495, -0.00031063, 0.00019028, 0.00031219, -0.00000116, 0.00000000],
++		[-6.27342503, -0.00031060, 0.00019026, 0.00031216, -0.00000116, 0.00000000],
++		[-6.27342510, -0.00031057, 0.00019024, 0.00031213, -0.00000116, 0.00000000],
++		[-6.27342518, -0.00031054, 0.00019022, 0.00031209, -0.00000116, 0.00000000],
++		[-6.27342525, -0.00031051, 0.00019020, 0.00031206, -0.00000116, 0.00000000],
++		[-6.27342533, -0.00031047, 0.00019018, 0.00031203, -0.00000116, 0.00000000],
++		[-6.27342540, -0.00031044, 0.00019016, 0.00031200, -0.00000116, 0.00000000],
++		[-6.27342548, -0.00031041, 0.00019014, 0.00031197, -0.00000116, 0.00000000],
++		[-6.27342555, -0.00031038, 0.00019013, 0.00031194, -0.00000116, 0.00000000],
++		[-6.27342563, -0.00031035, 0.00019011, 0.00031191, -0.00000116, 0.00000000],
++		[-6.27342570, -0.00031032, 0.00019009, 0.00031188, -0.00000116, 0.00000000],
++		[-6.27342577, -0.00031029, 0.00019007, 0.00031184, -0.00000116, 0.00000000],
++		[-6.27342585, -0.00031026, 0.00019005, 0.00031181, -0.00000116, 0.00000000],
++		[-6.27342592, -0.00031023, 0.00019003, 0.00031178, -0.00000116, 0.00000000],
++		[-6.27342600, -0.00031019, 0.00019001, 0.00031175, -0.00000116, 0.00000000],
++		[-6.27342607, -0.00031016, 0.00018999, 0.00031172, -0.00000116, 0.00000000],
++		[-6.27342615, -0.00031013, 0.00018997, 0.00031169, -0.00000116, 0.00000000],
++		[-6.27342622, -0.00031010, 0.00018995, 0.00031166, -0.00000116, 0.00000000],
++		[-6.27342630, -0.00031007, 0.00018993, 0.00031163, -0.00000116, 0.00000000],
++		[-6.27342637, -0.00031004, 0.00018992, 0.00031159, -0.00000116, 0.00000000],
++		[-6.27342644, -0.00031001, 0.00018990, 0.00031156, -0.00000116, 0.00000000],
++		[-6.27342652, -0.00030998, 0.00018988, 0.00031153, -0.00000116, 0.00000000],
++		[-6.27342659, -0.00030995, 0.00018986, 0.00031150, -0.00000116, 0.00000000],
++		[-6.27342667, -0.00030992, 0.00018984, 0.00031147, -0.00000116, 0.00000000],
++		[-6.27342674, -0.00030988, 0.00018982, 0.00031144, -0.00000116, 0.00000000],
++		[-6.27342682, -0.00030985, 0.00018980, 0.00031141, -0.00000116, 0.00000000],
++		[-6.27342689, -0.00030982, 0.00018978, 0.00031138, -0.00000116, 0.00000000],
++		[-6.27342696, -0.00030979, 0.00018976, 0.00031134, -0.00000116, 0.00000000],
++		[-6.27342704, -0.00030976, 0.00018974, 0.00031131, -0.00000116, 0.00000000],
++		[-6.27342711, -0.00030973, 0.00018973, 0.00031128, -0.00000116, 0.00000000],
++		[-6.27342719, -0.00030970, 0.00018971, 0.00031125, -0.00000116, 0.00000000],
++		[-6.27342726, -0.00030967, 0.00018969, 0.00031122, -0.00000116, 0.00000000],
++		[-6.27342733, -0.00030964, 0.00018967, 0.00031119, -0.00000116, 0.00000000],
++		[-6.27342741, -0.00030961, 0.00018965, 0.00031116, -0.00000116, 0.00000000],
++		[-6.27342748, -0.00030957, 0.00018963, 0.00031113, -0.00000116, 0.00000000],
++		[-6.27342756, -0.00030954, 0.00018961, 0.00031110, -0.00000116, 0.00000000],
++		[-6.27342763, -0.00030951, 0.00018959, 0.00031106, -0.00000116, 0.00000000],
++		[-6.27342771, -0.00030948, 0.00018957, 0.00031103, -0.00000116, 0.00000000],
++		[-6.27342778, -0.00030945, 0.00018956, 0.00031100, -0.00000116, 0.00000000]
++	];
++
++	// Cut off series at maxdeg
++	love_numbers.splice(maxdeg + 1, love_numbers.length - maxdeg + 1);
++
++	// Retrieve right type
++
++	/*
++	Arrow function to retrieve column of values
++
++	Sources:
++	 - https://stackoverflow.com/questions/7848004/get-column-from-a-two-dimensional-array
++
++	TODO:
++	- Place this in another scope so that it is available generally as a helper 
++	function.
++	*/
++	const array_column = (arr, n) => arr.map(x => x[n]);
++
++	let series = [];
++	if (type === 'loadingverticaldisplacement') {
++		series = array_column(love_numbers, 0);
++	} else if (type === 'loadinggravitationalpotential') {
++		series = array_column(love_numbers, 1);
++	} else if (type === 'loadinghorizontaldisplacement') {
++		series = array_column(love_numbers, 2);
++	} else if (type === 'tidalverticaldisplacement') {
++		series = array_column(love_numbers, 3);
++	} else if (type === 'tidalgravitationalpotential') {
++		series = array_column(love_numbers, 4);
++	} else if (type === 'tidalhorizontaldisplacement') {
++		series = array_column(love_numbers, 5);
++	} else {
++		error('love_numbers error message: unknown type: ' + type);
++	}
++
++	// Choose degree 1 term for CF reference system
++	if (frame === 'CM') {
++		// pass
++	} else if (frame === 'CF') {
++		if (type === 'loadingverticaldisplacement') {
++			series[1] = -0.269;
++		} else if (type === 'loadinggravitationalpotential') {
++			series[1] = -0.021;
++		} else if (type === 'loadinghorizontaldisplacement') {
++			series[1] = -0.134;
++		}
++	} else {
++		error('love_numbers error message: unknown reference frame:' + frame);
++	}
++
++	return series;
++} //}}}
+Index: ../trunk-jpl/src/m/classes/dsl.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.js	(revision 26307)
++++ ../trunk-jpl/src/m/classes/dsl.js	(revision 26308)
+@@ -1,55 +1,61 @@
+-//dsl Class definition
+-//
+-//   Usage:
+-//      dsl=dsl();
++class dsl {//{{{
++	/**
++	 * DSL class definition
++	 *
++	 * Usage:
++	 *     dsl=dsl();
++	 * 
++	 * TODO:
++	 * - Implement from struct constructor (see dsl.m)?
++	 */
++	constructor() {//{{{
++		this.global_average_thermosteric_sea_level; // Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)
++		this.sea_surface_height_above_geoid; // Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m)
++		this.sea_water_pressure_at_sea_floor; // Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!)
+ 
+-function dsl(){
+-	//methods
+-	this.setdefaultparameters = function(){// {{{
+-		this.requested_outputs=['default'];
+-	} // }}}
+-	this.disp = function(){ // {{{
+-		console.log(sprintf('   dsl parameters:'));
+-		fielddisplay(this,'global_average_thermosteric_sea_level_change','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)');
+-		fielddisplay(this,'sea_surface_height_change_above_geoid','corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)');
+-		fielddisplay(this,'sea_water_pressure_change_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)');
++		let nargs = arguments.length;
++		if (nargs == 0) {
++			this.setdefaultparameters();
++		} else {
++			error('constructor not supported');
++		}
++	} //}}}
+ 
++	setdefaultparameters() {//{{{
++		this.global_average_thermosteric_sea_level = NaN;
++		this.sea_surface_height_above_geoid = NaN;
++		this.sea_water_pressure_at_sea_floor = NaN;
++	} //}}}
+ 
+-	} // }}}
+-	this.defaultoutputs = function(){ // {{{
+-		return '';
+-	}//}}}
+-    this.classname = function(){ // {{{
+-        return "dsl";
+-    } // }}}
+-    this.extrude = function(md) {//{{{
+-        this.sea_surface_height_change_above_geoid=project3d(md,'vector',this.sea_surface_height_change_above_geoid,'type','node');
+-        this.sea_water_pressure_change_at_sea_floor=project3d(md,'vector',this.sea_water_pressure_change_at_sea_floor,'type','node');
+-        return this;
+-    }//}}}
+-    this.checkconsistency = function(md,solution,analyses) { //{{{
++	checkconsistency(md, solution, analyses) {//{{{
++		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc) || !md.transient.isoceantransport) {
++			return md;
++		}
+ 
+-        if(ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
+-            checkfield(md,'fieldname','dsl.sea_surface_height_change_above_geoid','timeseries',1,'NaN',1,'Inf',1);
+-            checkfield(md,'fieldname','dsl.sea_water_pressure_change_at_sea_floor','timeseries',1,'NaN',1,'Inf',1);
+-        }
++		md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1);
++		md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1);
++		md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1);
+ 
+-    } // }}}
+-    this.marshall=function(md,prefix,fid) { //{{{
++		if (md.solidearth.settings.compute_bp_grd) {
++			md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'empty', 1);
++		}
+ 
+-        var yts=md.constants.yts;
++		return md;
++	} //}}}
+ 
+-		WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
+-		WriteData(fid,prefix,'object',this,'class','dsl','fieldname','global_average_thermosteric_sea_level_change','format','DoubleMat','mattype',1,'timeserieslength',1+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
+-			WriteData(fid,prefix,'object',this,'class','dsl','fieldname','sea_water_pressure_change_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
+-			WriteData(fid,prefix,'object',this,'class',dsl,'fieldname','sea_surface_height_change_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-    }//}}}
+-    this.fix=function() { //{{{
+-    }//}}}
+-	//properties 
+-    // {{{
+-	this.global_average_thermosteric_sea_level_change = NaN;
+-	this.sea_surface_height_change_above_geoid = NaN;
+-	this.sea_water_pressure_change_at_sea_floor = NaN;
+-    // }}}
+-}
++	disp() {//{{{
++		console.log('WARNING: dsl::disp is not yet implemented');
++	} //}}}
++
++	marshall(md, prefix, fid) {//{{{
++		WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts); // mattype 2, because we are sending a GMSL value identical everywhere on each element
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts); // mattype 1 because we specify DSL at vertex locations
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts); // mattype 1 because we specify bottom pressure at vertex locations
++	} //}}}
++
++	extrude(md) {//{{{
++		this.sea_surface_height_above_geoid = project3d(md, 'vector', this.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1);
++		this.sea_water_pressure_at_sea_floor = project3d(md, 'vector', this.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1);
++	} //}}}
++} //}}}
+Index: ../trunk-jpl/src/m/classes/hydrologyshreve.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologyshreve.js	(revision 26307)
++++ ../trunk-jpl/src/m/classes/hydrologyshreve.js	(revision 26308)
+@@ -1,73 +1,74 @@
+-//HYDROLOGYSHREVE class definition
+-//
+-//   Usage:
+-//      hydrologyshreve=new hydrologyshreve();
++class hydrologyshreve {//{{{
++	/**
++	 * HYDROLOGYSHREVE class definition
++	 *
++	 * Usage:
++	 *     hydrologyshreve = hydrologyshreve();
++	 */
++	constructor() {//{{{
++		this.spcwatercolumn = NaN;
++		this.stabilization = 0;
++		this.requested_outputs = [];
+ 
+-function hydrologyshreve (){
+-	//methods
+-	this.setdefaultparameters = function(){// {{{
++		if (arguments.length == 0) {
++			this.setdefaultparameters();
++		} else {
++			error('constructor not supported');
++		}
++	} //}}}
+ 
+-		//Type of stabilization to use 0:nothing 1:artificial_diffusivity
+-		this.stabilization=1;
+-
+-		//default output
+-		this.requested_outputs=['default'];
+-
+-	}// }}}
+-		this.disp= function(){// {{{
+-
++	disp() {//{{{
+ 		console.log(sprintf('   hydrologyshreve solution parameters:'));
+-		fielddisplay(this,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]');
+-		fielddisplay(this,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.');
+-		fielddisplay(this,'requested_outputs','additional outputs requested');
++		fielddisplay(this, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]');
++		fielddisplay(this, 'stabilization', 'artificial diffusivity (default: 1). can be more than 1 to increase diffusivity.');
++		fielddisplay(this, 'requested_outputs', 'additional outputs requested');
++	} //}}}
+ 
+-	}// }}}
+-    this.extrude = function(md) {//{{{
+-        return this;
+-    };//}}}
+-		this.classname= function(){// {{{
+-			return "hydrologyshreve";
++	setdefaultparameters() {//{{{
++		// Type of stabilization to use 0:nothing 1:artificial_diffusivity
++		this.stabilization = 1;
++		this.requested_outputs = ['default'];
++	} //}}}
+ 
+-		}// }}}
+-	this.type= function(){// {{{
++	checkconsistency(md, solution, analyses) {//{{{
++		// Early return
++		if (!analyses.contains('HydrologyShreveAnalysis') || (solution == 'TransientSolution' && !md.transient.ishydrology)) {
++			return md;
++		}
++		md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1);
++		md = checkfield(md, 'fieldname', 'hydrology.stabilization', '>=', 0);
++		return md;
++	} //}}}
+ 
+-		return "hydrologyshreve";
+-	}// }}}
+-		this.checkconsistency = function(md,solution,analyses) { //{{{
++	defaultoutputs(md) {//{{{
++		return ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy'];
++	} //}}}
+ 
+-			//Early return
+-			if(!ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1)) return;
++	marshall(md, prefix, fid) {//{{{
++		WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts);
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'stabilization', 'format', 'Double');
+ 
+-			checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
+-			checkfield(md,'fieldname','hydrology.stabilization','>=',0);
+-			checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
++		// Process requested outputs
++		let outputs = this.requested_outputs;
++		let pos = find(ismember(outputs, 'default'));
++		if (pos.length) {
++			/*
++			NOTE: In order to handle case where user has added 'default' more 
++			than once to this.requested_outputs, need to remove elements by 
++			index in reverse order.
++			*/
++			for (let i = (pos.length - 1); i >= 0; --i) {
++				outputs.splice(pos[i], 1);
++			}
++			let default_outputs = this.defaultoutputs(md);
++			for (let i = 0; i < default_outputs.length; ++i) {
++				outputs.push(default_outputs[i]);
++			}
++		}
++		WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray');
++	} //}}}
+ 
+-		} // }}}
+-		this.marshall=function(md,prefix,fid) { //{{{
+-			WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
+-			WriteData(fid,prefix,'object',this,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Double');
+-			var outputs = this.requested_outputs;
+-			for (var i=0;i<outputs.length;i++){
+-				if (outputs[i] == 'default') {
+-					outputs.splice(i,1);
+-					var newoutputs=this.defaultoutputs(md);
+-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
+-				}
+-			}
+-			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+-		}//}}}
+-		this.defaultoutputs = function(md) { //{{{
+-				return ['Watercolumn','HydrologyWaterVx','HydrologyWaterVy'];
+-		}//}}}
+-		this.fix=function() { //{{{
+-			this.spcwatercolumn=NullFix(this.spcwatercolumn,NaN);
+-		}//}}}
+-	//properties 
+-	// {{{
+-	this.spcwatercolumn = NaN;
+-	this.stabilization  = 0;
+-	this.requested_outputs = [];
+-	this.setdefaultparameters();
+-	//}}}
+-}
++	extrude(md) {//{{{
++	} //}}}
++} //}}}
+Index: ../trunk-jpl/src/m/classes/masstransport.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/masstransport.js	(revision 26307)
++++ ../trunk-jpl/src/m/classes/masstransport.js	(revision 26308)
+@@ -1,104 +1,102 @@
+-//MASSTRANSPORT class definition
+-//
+-//   Usage:
+-//      masstransport=new masstransport();
++class masstransport {//{{{
++	/**
++	 * MASSTRANSPORT class definition
++	 *
++	 * Usage:
++	 *     masstransport = masstransport();
++	 */
++	constructor() {//{{{
++		this.spcthickness = NaN;
++		this.isfreesurface = 0;
++		this.min_thickness = 0;
++		this.hydrostatic_adjustment = 0;
++		this.stabilization = 0;
++		this.vertex_pairing = 0;
++		this.penalty_factor = 0;
++		this.requested_outputs = 0;
+ 
+-function masstransport (){
+-	//methods
+-	this.setdefaultparameters = function(){// {{{
++		if (arguments.length == 0) {
++			this.setdefaultparameters();
++		} else {
++			error('constructor not supported');
++		}
++	} //}}}
+ 
+-		//Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
+-		this.stabilization=1;
++	disp() {//{{{
++		console.log('WARNING: masstransport::disp is not yet implemented');
++	} //}}}
+ 
+-		//Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
+-		this.penalty_factor=3;
++	setdefaultparameters() {//{{{
++		// Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
++		this.stabilization = 1;
+ 
+-		//Minimum ice thickness that can be used
+-		this.min_thickness=1;
++		// Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
++		this.penalty_factor = 3;
+ 
+-		//Hydrostatic adjustment
+-		this.hydrostatic_adjustment='Absolute';
++		// Minimum ice thickness that can be used
++		this.min_thickness = 1;
+ 
+-		//default output
+-		this.requested_outputs=['default'];
++		// Hydrostatic adjustment
++		this.hydrostatic_adjustment = 'Absolute';
+ 
+-	}// }}}
+-	this.disp= function(){// {{{
+-		console.log(sprintf('   Masstransport solution parameters:'));
+-		fielddisplay(this,'spcthickness','thickness constraints (NaN means no constraint) [m]');
+-		fielddisplay(this,'isfreesurface','do we use free surfaces (FS only) or mass conservation');
+-		fielddisplay(this,'min_thickness','minimum ice thickness allowed [m]');
+-		fielddisplay(this,'hydrostatic_adjustment',"adjustment of ice shelves surface and bed elevations: 'Incremental' or 'Absolute' ");
+-		fielddisplay(this,'stabilization','0: no stabilization, 1: artificial diffusion, 2: streamline upwinding, 3: discontinuous Galerkin, 4: flux corrected transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
++		// Default output
++		this.requested_outputs = ['default'];
++	} //}}}
+ 
+-		console.log(sprintf('\n      %s','Penalty options:'));
+-		fielddisplay(this,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset');
+-		fielddisplay(this,'vertex_pairing','pairs of vertices that are penalized');
+-		fielddisplay(this,'requested_outputs','additional outputs requested');
++	checkconsistency(md, solution, analyses) {//{{{
++		// Early return
++		if (analyses.includes('HydrologyShreveAnalysis') || (solution == 'TransientSolution' && !md.trans.ismasstransport)) {
++			return md;
++		}
+ 
+-	}// }}}
+-	this.classname= function(){// {{{
+-		return "masstransport";
+-	}// }}}
+-    this.extrude = function(md) {//{{{
+-        this.spcthickness=project3d(md,'vector',this.spcthickness,'type','node');
+-        return this;
+-    }//}}}
+-		this.checkconsistency = function (md,solution,analyses){  // {{{
++		md = checkfield(md, 'fieldname', 'masstransport.spcthickness', 'Inf', 1, 'timeseries', 1);
++		md = checkfield(md, 'fieldname', 'masstransport.isfreesurface', 'values', [0, 1]);
++		md = checkfield(md, 'fieldname', 'masstransport.hydrostatic_adjustment', 'values', ['Absolute', 'Incremental']);
++		md = checkfield(md, 'fieldname', 'masstransport.stabilization', 'values', [0, 1, 2, 3, 4, 5]);
++		md = checkfield(md, 'fieldname', 'masstransport.min_thickness', '>', 0);
++		md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1);
++		if (!any(isnan(md.stressbalance.vertex.vertex_pairing))) {
++			md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0);
++		}
+ 
+-			//Early return
+-			if(!ArrayAnyEqual(ArrayIsMember('HydrologyShreveAnalysis',analyses),1) | (solution=='TransientSolution' & md.trans.ismasstransport==0)) return; 
++		return md;
++	} //}}}
+ 
+-			checkfield(md,'fieldname','masstransport.spcthickness','Inf',1,'timeseries',1);
+-			checkfield(md,'fieldname','masstransport.isfreesurface','values',[0 ,1]);
+-			checkfield(md,'fieldname','masstransport.hydrostatic_adjustment','values',['Absolute', 'Incremental']);
+-			checkfield(md,'fieldname','masstransport.stabilization','values',[0,1,2,3,4]);
+-			checkfield(md,'fieldname','masstransport.min_thickness','>',0);
+-			checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1);
++	defaultoutputs(md) {//{{{
++		return ['Thickness', 'Surface', 'Base'];
++	} //}}}
+ 
+-		} // }}}
+-		this.marshall=function(md,prefix,fid) { //{{{
++	marshall(md, prefix, fid) {//{{{
++		let yts = md.constants.yts;
+ 
+-			var yts=md.constants.yts;
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'isfreesurface', 'format', 'Boolean');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'min_thickness', 'format', 'Double');
++		WriteData(fid, prefix, 'data', this.hydrostatic_adjustment, 'format', 'String', 'name', 'md.masstransport.hydrostatic_adjustment');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'stabilization', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3);
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'penalty_factor', 'format', 'Double');
+ 
+-			WriteData(fid,prefix,'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',this,'fieldname','isfreesurface','format','Boolean');
+-			WriteData(fid,prefix,'object',this,'fieldname','min_thickness','format','Double');
+-			WriteData(fid,prefix,'data',this.hydrostatic_adjustment,'format','String','name','md.masstransport.hydrostatic_adjustment');
+-			WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer');
+-			WriteData(fid,prefix,'object',this,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
+-			WriteData(fid,prefix,'object',this,'fieldname','penalty_factor','format','Double');
+-
+-			//process requested outputs
+-			var outputs = this.requested_outputs;
+-			for (var i=0;i<outputs.length;i++){
+-				if (outputs[i] == 'default') {
+-					outputs.splice(i,1);
+-					var newoutputs=this.defaultoutputs(md);
+-					for (var j=0;j<newoutputs.length;j++) outputs.push(newoutputs[j]);
+-				}
++		// Process requested outputs
++		let outputs = this.requested_outputs;
++		let pos = find(ismember(outputs, 'default'));
++		if (pos.length) {
++			/*
++			NOTE: In order to handle case where user has added 'default' more 
++			than once to this.requested_outputs, need to remove elements by 
++			index in reverse order.
++			*/
++			for (let i = (pos.length - 1); i >= 0; --i) {
++				outputs.splice(pos[i], 1);
+ 			}
+-			WriteData(fid,prefix,'data',outputs,'name','md.masstransport.requested_outputs','format','StringArray');
+-		}//}}}
+-		this.defaultoutputs = function(md) { //{{{
+-			return ['Thickness','Surface','Base'];
+-		}//}}}
+-		this.fix=function() { //{{{
+-			this.spcthickness=NullFix(this.spcthickness,NaN);
+-			this.vertex_pairing=NullFix(this.vertex_pairing,NaN);
+-		}//}}}
+-	//properties 
+-	// {{{
++			let default_outputs = this.defaultoutputs(md);
++			for (let i = 0; i < default_outputs.length; ++i) {
++				outputs.push(default_outputs[i]);
++			}
++		}
++		WriteData(fid, prefix, 'data', outputs, 'name', 'md.masstransport.requested_outputs', 'format', 'StringArray');
++	} //}}}
+ 
+-	this.spcthickness           = NaN;
+-	this.isfreesurface          = 0;
+-	this.min_thickness          = 0;
+-	this.hydrostatic_adjustment = 0;
+-	this.stabilization          = 0;
+-	this.vertex_pairing         = NaN;
+-	this.penalty_factor         = 0;
+-	this.requested_outputs      = [];
+-
+-	this.setdefaultparameters();
+-	//}}}
++	extrude(md) {//{{{
++	} //}}}
+ }
+Index: ../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.py	(revision 26307)
++++ ../trunk-jpl/src/m/classes/materials.py	(revision 26308)
+@@ -331,19 +331,20 @@
+     intnat = np.zeros(len(strnat))
+ 
+     for i in range(len(intnat)):
+-        if strnat[i] == 'damageice':
++        str_nat = strnat[i]
++        if str_nat == 'damageice':
+             intnat[i] = 1
+-        elif strnat[i] == 'estar':
++        elif str_nat == 'estar':
+             intnat[i] = 2
+-        elif strnat[i] == 'ice':
++        elif str_nat == 'ice':
+             intnat[i] = 3
+-        elif strnat[i] == 'enhancedice':
++        elif str_nat == 'enhancedice':
+             intnat[i] = 4
+-        # elif strnat[i] == 'materials':
++        # elif str_nat == 'materials':
+         #     intnat[i] = 5 #this case will never happen, kept to ensure equivalent of codes between IoCodeToMeterialsEnum and IoCodeToNatureEnum
+-        elif strnat[i] == 'litho':
++        elif str_nat == 'litho':
+             intnat[i] = 6
+-        elif strnat[i] == 'hydro':
++        elif str_nat == 'hydro':
+             intnat[i] = 7
+         else:
+             raise RuntimeError('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')')
+Index: ../trunk-jpl/src/m/classes/model.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.js	(revision 26307)
++++ ../trunk-jpl/src/m/classes/model.js	(revision 26308)
+@@ -1,782 +1,785 @@
+-//MODEL class definition
+-//
+-//   Usage:
+-//      md = new model()
+-
+-function model () {
++/**
++ * MODEL class definition
++ *
++ * Usage:
++ *     md = new model();
++ *
++ * TODO:
++ * - Convert to ES6 class
++ */
++function model(planet) {
+ 	//methods
+-		this.disp = function() { //{{{
+-			console.log(sprintf("class model echo: "));
+-			console.log(sprintf("//19s: //-22s -- //s","mesh"            ,"[1x1 " + typeof(this.mesh) + "]","mesh properties"));
+-			console.log(sprintf("//19s: //-22s -- //s","mask"            ,"[1x1 " + typeof(this.mask) + "]","defines grounded and floating elements"));
+-			console.log(sprintf("//19s: //-22s -- //s","geometry"        ,"[1x1 " + typeof(this.geometry) + "]","surface elevation, bedrock topography, ice thickness,..."));
+-			console.log(sprintf("//19s: //-22s -- //s","constants"       ,"[1x1 " + typeof(this.constants) + "]","physical constants"));
+-			console.log(sprintf("//19s: //-22s -- //s","smb"             ,"[1x1 " + typeof(this.smb) + "]","surface mass balance"));
+-			console.log(sprintf("//19s: //-22s -- //s","basalforcings"   ,"[1x1 " + typeof(this.basalforcings) + "]","bed forcings"));
+-			console.log(sprintf("//19s: //-22s -- //s","materials"       ,"[1x1 " + typeof(this.materials) + "]","material properties"));
+-			console.log(sprintf("//19s: //-22s -- //s","damage"          ,"[1x1 " + typeof(this.damage) + "]","parameters for damage evolution solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","friction"        ,"[1x1 " + typeof(this.friction) + "]","basal friction/drag properties"));
+-			console.log(sprintf("//19s: //-22s -- //s","flowequation"    ,"[1x1 " + typeof(this.flowequation) + "]","flow equations"));
+-			console.log(sprintf("//19s: //-22s -- //s","timestepping"    ,"[1x1 " + typeof(this.timestepping) + "]","time stepping for trans models"));
+-			console.log(sprintf("//19s: //-22s -- //s","initialization"  ,"[1x1 " + typeof(this.initialization) + "]","initial guess/state"));
+-			console.log(sprintf("//19s: //-22s -- //s","rifts"           ,"[1x1 " + typeof(this.rifts) + "]","rifts properties"));
+-			console.log(sprintf("//19s: //-22s -- //s","slr"             ,"[1x1 " + typeof(this.slr) + "]","slr forcings"));
+-			console.log(sprintf("//19s: //-22s -- //s","dsl"             ,"[1x1 " + typeof(this.dsl) + "]","dynamic sea level"));
+-			console.log(sprintf("//19s: //-22s -- //s","debug"           ,"[1x1 " + typeof(this.debug) + "]","debugging tools (valgrind, gprof)"));
+-			console.log(sprintf("//19s: //-22s -- //s","verbose"         ,"[1x1 " + typeof(this.verbose) + "]","verbosity level in solve"));
+-			console.log(sprintf("//19s: //-22s -- //s","settings"        ,"[1x1 " + typeof(this.settings) + "]","settings properties"));
+-			console.log(sprintf("//19s: //-22s -- //s","toolkits"        ,"[1x1 " + typeof(this.toolkits) + "]","PETSc options for each solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","cluster"         ,"[1x1 " + typeof(this.cluster) + "]","cluster parameters (number of CPUs...)"));
+-			console.log(sprintf("//19s: //-22s -- //s","balancethickness","[1x1 " + typeof(this.balancethickness) + "]","parameters for balancethickness solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","stressbalance"   ,"[1x1 " + typeof(this.stressbalance) + "]","parameters for stressbalance solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","groundingline"   ,"[1x1 " + typeof(this.groundingline) + "]","parameters for groundingline solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","hydrology"       ,"[1x1 " + typeof(this.hydrology) + "]","parameters for hydrology solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","masstransport"   ,"[1x1 " + typeof(this.masstransport) + "]","parameters for masstransport solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","thermal"         ,"[1x1 " + typeof(this.thermal) + "]","parameters for thermal solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","steadystate"     ,"[1x1 " + typeof(this.steadystate) + "]","parameters for steadystate solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","trans"           ,"[1x1 " + typeof(this.trans) + "]","parameters for trans solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","levelset"        ,"[1x1 " + typeof(this.levelset) + "]","parameters for moving boundaries (level-set method)"));
+-			console.log(sprintf("//19s: //-22s -- //s","calving"         ,"[1x1 " + typeof(this.calving) + "]","parameters for calving"));
+-			console.log(sprintf("//19s: //-22s -- //s","gia"             ,"[1x1 " + typeof(this.gia) + "]","parameters for gia solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","love"            ,"[1x1 " + typeof(this.love) + "]","parameters for love solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","esa"             ,"[1x1 " + typeof(this.esa) + "]","parameters for elastic adjustment solution"));
+-			console.log(sprintf("//19s: //-22s -- //s","autodiff"        ,"[1x1 " + typeof(this.autodiff) + "]","automatic differentiation parameters"));
+-			console.log(sprintf("//19s: //-22s -- //s","inversion"       ,"[1x1 " + typeof(this.inversion) + "]","parameters for inverse methods"));
+-			console.log(sprintf("//19s: //-22s -- //s","qmu"             ,"[1x1 " + typeof(this.qmu) + "]","Dakota properties"));
+-			console.log(sprintf("//19s: //-22s -- //s","amr"             ,"[1x1 " + typeof(this.amr) + "]","adaptive mesh refinement properties"));
+-			console.log(sprintf("//19s: //-22s -- //s","outputdefinition","[1x1 " + typeof(this.outputdefinition) + "]","output definition"));
+-			console.log(sprintf("//19s: //-22s -- //s","results"         ,"[1x1 " + typeof(this.results) + "]","model results"));
+-			console.log(sprintf("//19s: //-22s -- //s","radaroverlay"    ,"[1x1 " + typeof(this.radaroverlay) + "]","radar image for plot overlay"));
+-			console.log(sprintf("//19s: //-22s -- //s","miscellaneous"   ,"[1x1 " + typeof(this.miscellaneous) + "]","miscellaneous fields"));
+-		} //}}}
+-		this.setdefaultparameters = function () { // {{{
++	this.disp = function() { //{{{
++		console.log(sprintf("class model echo: "));
++		console.log(sprintf("//19s: //-22s -- //s","mesh"            ,"[1x1 " + typeof(this.mesh) + "]","mesh properties"));
++		console.log(sprintf("//19s: //-22s -- //s","mask"            ,"[1x1 " + typeof(this.mask) + "]","defines grounded and floating elements"));
++		console.log(sprintf("//19s: //-22s -- //s","geometry"        ,"[1x1 " + typeof(this.geometry) + "]","surface elevation, bedrock topography, ice thickness,..."));
++		console.log(sprintf("//19s: //-22s -- //s","constants"       ,"[1x1 " + typeof(this.constants) + "]","physical constants"));
++		console.log(sprintf("//19s: //-22s -- //s","smb"             ,"[1x1 " + typeof(this.smb) + "]","surface mass balance"));
++		console.log(sprintf("//19s: //-22s -- //s","basalforcings"   ,"[1x1 " + typeof(this.basalforcings) + "]","bed forcings"));
++		console.log(sprintf("//19s: //-22s -- //s","materials"       ,"[1x1 " + typeof(this.materials) + "]","material properties"));
++		console.log(sprintf("//19s: //-22s -- //s","damage"          ,"[1x1 " + typeof(this.damage) + "]","parameters for damage evolution solution"));
++		console.log(sprintf("//19s: //-22s -- //s","friction"        ,"[1x1 " + typeof(this.friction) + "]","basal friction/drag properties"));
++		console.log(sprintf("//19s: //-22s -- //s","flowequation"    ,"[1x1 " + typeof(this.flowequation) + "]","flow equations"));
++		console.log(sprintf("//19s: //-22s -- //s","timestepping"    ,"[1x1 " + typeof(this.timestepping) + "]","time stepping for trans models"));
++		console.log(sprintf("//19s: //-22s -- //s","initialization"  ,"[1x1 " + typeof(this.initialization) + "]","initial guess/state"));
++		console.log(sprintf("//19s: //-22s -- //s","rifts"           ,"[1x1 " + typeof(this.rifts) + "]","rifts properties"));
++		console.log(sprintf("//19s: //-22s -- //s","solidearth"      ,"[1x1 " + typeof(this.solidearth) + "]","solidearth inputs and settings"));
++		console.log(sprintf("//19s: //-22s -- //s","slr"             ,"[1x1 " + typeof(this.slr) + "]","slr forcings"));
++		console.log(sprintf("//19s: //-22s -- //s","dsl"             ,"[1x1 " + typeof(this.dsl) + "]","dynamic sea level"));
++		console.log(sprintf("//19s: //-22s -- //s","debug"           ,"[1x1 " + typeof(this.debug) + "]","debugging tools (valgrind, gprof)"));
++		console.log(sprintf("//19s: //-22s -- //s","verbose"         ,"[1x1 " + typeof(this.verbose) + "]","verbosity level in solve"));
++		console.log(sprintf("//19s: //-22s -- //s","settings"        ,"[1x1 " + typeof(this.settings) + "]","settings properties"));
++		console.log(sprintf("//19s: //-22s -- //s","toolkits"        ,"[1x1 " + typeof(this.toolkits) + "]","PETSc options for each solution"));
++		console.log(sprintf("//19s: //-22s -- //s","cluster"         ,"[1x1 " + typeof(this.cluster) + "]","cluster parameters (number of CPUs...)"));
++		console.log(sprintf("//19s: //-22s -- //s","balancethickness","[1x1 " + typeof(this.balancethickness) + "]","parameters for balancethickness solution"));
++		console.log(sprintf("//19s: //-22s -- //s","stressbalance"   ,"[1x1 " + typeof(this.stressbalance) + "]","parameters for stressbalance solution"));
++		console.log(sprintf("//19s: //-22s -- //s","groundingline"   ,"[1x1 " + typeof(this.groundingline) + "]","parameters for groundingline solution"));
++		console.log(sprintf("//19s: //-22s -- //s","hydrology"       ,"[1x1 " + typeof(this.hydrology) + "]","parameters for hydrology solution"));
++		console.log(sprintf("//19s: //-22s -- //s","masstransport"   ,"[1x1 " + typeof(this.masstransport) + "]","parameters for masstransport solution"));
++		console.log(sprintf("//19s: //-22s -- //s","thermal"         ,"[1x1 " + typeof(this.thermal) + "]","parameters for thermal solution"));
++		console.log(sprintf("//19s: //-22s -- //s","steadystate"     ,"[1x1 " + typeof(this.steadystate) + "]","parameters for steadystate solution"));
++		console.log(sprintf("//19s: //-22s -- //s","transient"       ,"[1x1 " + typeof(this.transient) + "]","parameters for transient solution"));
++		console.log(sprintf("//19s: //-22s -- //s","levelset"        ,"[1x1 " + typeof(this.levelset) + "]","parameters for moving boundaries (level-set method)"));
++		console.log(sprintf("//19s: //-22s -- //s","calving"         ,"[1x1 " + typeof(this.calving) + "]","parameters for calving"));
++		console.log(sprintf("//19s: //-22s -- //s","gia"             ,"[1x1 " + typeof(this.gia) + "]","parameters for gia solution"));
++		console.log(sprintf("//19s: //-22s -- //s","love"            ,"[1x1 " + typeof(this.love) + "]","parameters for love solution"));
++		console.log(sprintf("//19s: //-22s -- //s","esa"             ,"[1x1 " + typeof(this.esa) + "]","parameters for elastic adjustment solution"));
++		console.log(sprintf("//19s: //-22s -- //s","sampling"        ,"[1x1 " + typeof(this.sampling) + "]","parameters for stochastic sampler"));
++		console.log(sprintf("//19s: //-22s -- //s","autodiff"        ,"[1x1 " + typeof(this.autodiff) + "]","automatic differentiation parameters"));
++		console.log(sprintf("//19s: //-22s -- //s","inversion"       ,"[1x1 " + typeof(this.inversion) + "]","parameters for inverse methods"));
++		console.log(sprintf("//19s: //-22s -- //s","qmu"             ,"[1x1 " + typeof(this.qmu) + "]","Dakota properties"));
++		console.log(sprintf("//19s: //-22s -- //s","amr"             ,"[1x1 " + typeof(this.amr) + "]","adaptive mesh refinement properties"));
++		console.log(sprintf("//19s: //-22s -- //s","outputdefinition","[1x1 " + typeof(this.outputdefinition) + "]","output definition"));
++		console.log(sprintf("//19s: //-22s -- //s","results"         ,"[1x1 " + typeof(this.results) + "]","model results"));
++		console.log(sprintf("//19s: //-22s -- //s","radaroverlay"    ,"[1x1 " + typeof(this.radaroverlay) + "]","radar image for plot overlay"));
++		console.log(sprintf("//19s: //-22s -- //s","miscellaneous"   ,"[1x1 " + typeof(this.miscellaneous) + "]","miscellaneous fields"));
++	} //}}}
++	this.setdefaultparameters = function(planet) { // {{{
++		this.mesh             = new mesh2d();
++		this.mask             = new mask();
+ 
+-			//initialize subclasses
+-			this.mesh             = new mesh2d();
+-			this.mask             = new mask();
+-			this.constants        = new constants();
+-			this.geometry         = new geometry();
+-			this.smb              = new SMBforcing();
+-			this.basalforcings    = new basalforcings();
+-			this.materials        = new matice();
+-			this.damage           = new damage();
+-			this.friction         = new friction();
+-			this.flowequation     = new flowequation();
+-			this.timestepping     = new timestepping();
+-			this.initialization   = new initialization();
+-			this.rifts            = new rifts();
+-			this.slr              = new slr();
+-			this.dsl              = new dsl();
++		this.geometry         = new geometry();
++		this.constants        = new constants();
++		this.smb              = new SMBforcing();
++		this.basalforcings    = new basalforcings();
++		this.materials        = new matice();
++		this.damage           = new damage();
++		this.friction         = new friction();
++		this.flowequation     = new flowequation();
++		this.timestepping     = new timestepping();
++		this.initialization   = new initialization();
++		this.rifts            = new rifts();
++		this.dsl              = new dsl();
++		this.solidearth       = new solidearth(planet);
+ 
+-			this.debug            = new debug();
+-			this.verbose          = new verbose();
+-			this.settings         = new issmsettings();
+-			this.toolkits         = new toolkits();
+-			this.cluster          = new local();
++		this.debug            = new debug();
++		this.verbose          = new verbose();
++		this.settings         = new issmsettings();
++		this.toolkits         = new toolkits();
++		this.cluster          = new local();
+ 
+-			this.balancethickness = new balancethickness();
+-			this.stressbalance    = new stressbalance();
+-			this.groundingline    = new groundingline();
+-			this.hydrology        = new hydrologyshreve();
+-			this.masstransport    = new masstransport();
+-			this.thermal          = new thermal();
+-			this.steadystate      = new steadystate();
+-			this.trans            = new trans();
+-			this.levelset         = new levelset();
+-			this.calving          = new calving();
+-			this.gia              = new giaivins();
+-			this.frontforcings    = new frontforcings();
+-			this.love             = new fourierlove();
+-			this.esa              = new esa();
+-			this.autodiff         = new autodiff();
+-			this.inversion        = new inversion();
+-			this.qmu              = new qmu();
+-			this.amr					 = new amr();
+-			this.radaroverlay     = new radaroverlay();
+-			this.results          = {};
+-			this.outputdefinition = new outputdefinition();
+-			this.radaroverlay     = new radaroverlay();
+-			this.miscellaneous    = new miscellaneous();
+-			this.priv             = new priv();
+-		} //}}}
+-		this.checkmessage = function(string){ //{{{
+-			console.log('model not consistent: ' + string);
+-			this.priv.isconsistent=false;
+-		} //}}}
+-		this.fix = function(){ //{{{
++		this.balancethickness = new balancethickness();
++		this.stressbalance    = new stressbalance();
++		this.groundingline    = new groundingline();
++		this.hydrology        = new hydrologyshreve();
++		this.masstransport    = new masstransport();
++		this.thermal          = new thermal();
++		this.steadystate      = new steadystate();
++		this.transient        = new transient();
++		this.levelset         = new levelset();
++		this.calving          = new calving();
++		this.frontalforcings  = new frontalforcings();
++		this.love             = new fourierlove();
++		this.esa              = new esa();
++		this.sampling         = new sampling();
+ 
+-			for (var field in this){
++		this.autodiff         = new autodiff();
++		this.inversion        = new inversion();
++		this.qmu              = new qmu();
++		this.amr              = new amr();
++		this.results          = {};
++		this.outputdefinition = new outputdefinition();
++		this.radaroverlay     = new radaroverlay();
++		this.miscellaneous    = new miscellaneous();
++		this.priv             = new priv();
++	} //}}}
++	this.checkmessage = function(string){ //{{{
++		console.log('model not consistent: ' + string);
++		this.priv.isconsistent=false;
++	} //}}}
++	this.fix = function(){ //{{{
+ 
+-				//Some properties do not need to be fixed
+-				if (field == 'results' | field =='radaroverlay' | field == 'toolkits' | field =='cluster' | field == 'priv') continue;
++		for (var field in this){
+ 
+-				//Check that current field is a class
+-				if(typeof this[field] == 'function'){
+-					continue;
+-				}
++			//Some properties do not need to be fixed
++			if (field == 'results' | field =='radaroverlay' | field == 'toolkits' | field =='cluster' | field == 'priv') continue;
+ 
+-				//Fix current object
+-				this[field].fix(this);
++			//Check that current field is a class
++			if(typeof this[field] == 'function'){
++				continue;
+ 			}
+ 
+-		} //}}}
+-		this.extrude = function(md) { //{{{
+-			//EXTRUDE - vertically extrude a 2d mesh
+-			//
+-			//   vertically extrude a 2d mesh and create corresponding 3d mesh.
+-			//   The vertical distribution can:
+-			//    - follow a polynomial law
+-			//    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
+-			//    - be described by a list of coefficients (between 0 and 1)
+-			//   
+-			//
+-			//   Usage:
+-			//      md=extrude(md,numlayers,extrusionexponent);
+-			//      md=extrude(md,numlayers,lowerexponent,upperexponent);
+-			//      md=extrude(md,listofcoefficients);
+-			//
+-			//   Example:
+-			//      md=extrude(md,15,1.3);
+-			//      md=extrude(md,15,1.3,1.2);
+-			//      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
+-			//
+-			//   See also: MODELEXTRACT, COLLAPSE
++			//Fix current object
++			this[field].fix(this);
++		}
+ 
+-			//some checks on list of arguments
+-			var argc = arguments.length;
+-			var extrusionlist;
+-			var numlayers;
+-			
+-			if ((argc > 4) | (argc < 2)) {
+-				throw "extrude error message";
+-			}
++	} //}}}
++	this.extrude = function(md) { //{{{
++		//EXTRUDE - vertically extrude a 2d mesh
++		//
++		//   vertically extrude a 2d mesh and create corresponding 3d mesh.
++		//   The vertical distribution can:
++		//    - follow a polynomial law
++		//    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
++		//    - be described by a list of coefficients (between 0 and 1)
++		//   
++		//
++		//   Usage:
++		//      md=extrude(md,numlayers,extrusionexponent);
++		//      md=extrude(md,numlayers,lowerexponent,upperexponent);
++		//      md=extrude(md,listofcoefficients);
++		//
++		//   Example:
++		//      md=extrude(md,15,1.3);
++		//      md=extrude(md,15,1.3,1.2);
++		//      md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1]);
++		//
++		//   See also: MODELEXTRACT, COLLAPSE
+ 
+-			//Extrude the mesh
+-			if (argc==2) { //list of coefficients
+-				clist=arguments[0];
+-				if (ArrayAnyBelowStrict(clist,0) || ArrayAnyAboveStrict(clist,1)) {
+-					throw 'extrusioncoefficients must be between 0 and 1';
+-				}
+-				extrusionlist=ArraySort(ArrayUnique(clist.push(0,1)));
+-				numlayers=extrusionlist.length;
+-			} else if (argc==3) { //one polynomial law
+-				if (arguments[1]<=0) {
+-					throw 'extrusionexponent must be >=0';
+-				}
+-				numlayers=arguments[1];
+-				extrusionlist = [];
+-				for (var i = 0; i < numlayers; i++) {
+-					extrusionlist.push(Math.pow(i/(numlayers-1), arguments[2]));
+-				}
+-			} else if (argc==4) { //two polynomial laws
+-				numlayers=arguments[1];
+-				var lowerexp=arguments[2];
+-				var upperexp=arguments[3];
++		//some checks on list of arguments
++		var argc = arguments.length;
++		var extrusionlist;
++		var numlayers;
++		
++		if ((argc > 4) | (argc < 2)) {
++			error("extrude error message");
++		}
+ 
+-				if (arguments[2]<=0 || arguments[3]<=0) {
+-					throw 'lower and upper extrusionexponents must be >=0';
+-				}
++		//Extrude the mesh
++		if (argc==2) { //list of coefficients
++			clist=arguments[0];
++			if (ArrayAnyBelowStrict(clist,0) || ArrayAnyAboveStrict(clist,1)) {
++				error('extrusioncoefficients must be between 0 and 1');
++			}
++			extrusionlist=ArraySort(ArrayUnique(clist.push(0,1)));
++			numlayers=extrusionlist.length;
++		} else if (argc==3) { //one polynomial law
++			if (arguments[1]<=0) {
++				error('extrusionexponent must be >=0');
++			}
++			numlayers=arguments[1];
++			extrusionlist = [];
++			for (var i = 0; i < numlayers; i++) {
++				extrusionlist.push(Math.pow(i/(numlayers-1), arguments[2]));
++			}
++		} else if (argc==4) { //two polynomial laws
++			numlayers=arguments[1];
++			var lowerexp=arguments[2];
++			var upperexp=arguments[3];
+ 
+-				var lowerextrusionlist = [];
+-				for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
+-					lowerextrusionlist.push(Math.pow(i, lowerexp)/2)
+-				}
+-				var upperextrusionlist = [];
+-				for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
+-					upperextrusionlist.push(1-Math.pow(i, upperexp)/2)
+-				}
+-				extrusionlist=ArrayConcat(lowerextrusionlist,upperextrusionlist);
+-				extrusionlist=ArraySort(ArrayUnique(extrusionlist.push(1)));
++			if (arguments[2]<=0 || arguments[3]<=0) {
++				error('lower and upper extrusionexponents must be >=0');
+ 			}
+ 
+-			if (numlayers<2) {
+-				console.error('number of layers should be at least 2');
++			var lowerextrusionlist = [];
++			for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
++				lowerextrusionlist.push(Math.pow(i, lowerexp)/2)
+ 			}
+-			if (md.mesh.domaintype() === '3D') {
+-				console.error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
++			var upperextrusionlist = [];
++			for (var i = 0; i <= 1; i += (2/(numlayers-1))) {
++				upperextrusionlist.push(1-Math.pow(i, upperexp)/2)
+ 			}
++			extrusionlist=ArrayConcat(lowerextrusionlist,upperextrusionlist);
++			extrusionlist=ArraySort(ArrayUnique(extrusionlist.push(1)));
++		}
+ 
+-			//Initialize with the 2d mesh
+-			var mesh2d = md.mesh;
+-			md.mesh=new mesh3dprisms();
+-			md.mesh.x                           = mesh2d.x;
+-			md.mesh.y                           = mesh2d.y;
+-			md.mesh.elements                    = mesh2d.elements;
+-			md.mesh.numberofelements            = mesh2d.numberofelements;
+-			md.mesh.numberofvertices            = mesh2d.numberofvertices;
++		if (numlayers<2) {
++			console.error('number of layers should be at least 2');
++		}
++		if (md.mesh.domaintype() === '3D') {
++			console.error('Cannot extrude a 3d mesh (extrude cannot be called more than once)');
++		}
+ 
+-			md.mesh.lat                         = mesh2d.lat;
+-			md.mesh.long                        = mesh2d.long;
+-			md.mesh.epsg                        = mesh2d.epsg;
+-			md.mesh.scale_factor                = mesh2d.scale_factor;
++		//Initialize with the 2d mesh
++		var mesh2d = md.mesh;
++		md.mesh=new mesh3dprisms();
++		md.mesh.x                           = mesh2d.x;
++		md.mesh.y                           = mesh2d.y;
++		md.mesh.elements                    = mesh2d.elements;
++		md.mesh.numberofelements            = mesh2d.numberofelements;
++		md.mesh.numberofvertices            = mesh2d.numberofvertices;
+ 
+-			md.mesh.vertexonboundary            = mesh2d.vertexonboundary;
+-			md.mesh.vertexconnectivity          = mesh2d.vertexconnectivity;
+-			md.mesh.elementconnectivity         = mesh2d.elementconnectivity;
+-			md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity;
++		md.mesh.lat                         = mesh2d.lat;
++		md.mesh.long                        = mesh2d.long;
++		md.mesh.epsg                        = mesh2d.epsg;
++		md.mesh.scale_factor                = mesh2d.scale_factor;
+ 
+-			md.mesh.extractedvertices           = mesh2d.extractedvertices;
+-			md.mesh.extractedelements           = mesh2d.extractedelements;
++		md.mesh.vertexonboundary            = mesh2d.vertexonboundary;
++		md.mesh.vertexconnectivity          = mesh2d.vertexconnectivity;
++		md.mesh.elementconnectivity         = mesh2d.elementconnectivity;
++		md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity;
+ 
+-			var x3d=new Float64Array(); 
+-			var y3d=new Float64Array();
+-			var z3d=new Float64Array();  //the lower node is on the bed
+-			var thickness3d=md.geometry.thickness; //thickness and bed for these nodes
+-			var bed3d=md.geometry.base;
++		md.mesh.extractedvertices           = mesh2d.extractedvertices;
++		md.mesh.extractedelements           = mesh2d.extractedelements;
+ 
+-			//Create the new layers
+-			//Dimensions of x/y/z3d: md.mesh.numberofvertices * numlayers, 1
+-			for (var i = 1; i <= numlayers; i++) {
+-				x3d=ArrayConcat(x3d, md.mesh.x); 
+-				y3d=ArrayConcat(y3d, md.mesh.y); 
+-				//nodes are distributed between bed and surface accordingly to the given exponent
+-				z3d=ArrayConcat(z3d, FloatFix(thickness3d.map(function(value,index) { return bed3d[index] + value * extrusionlist[i-1]; }), thickness3d.length)); 
+-			}
+-			var number_nodes3d=x3d.length; //number of 3d nodes for the non extruded part of the mesh
++		var x3d=new Float64Array(); 
++		var y3d=new Float64Array();
++		var z3d=new Float64Array();  //the lower node is on the bed
++		var thickness3d=md.geometry.thickness; //thickness and bed for these nodes
++		var bed3d=md.geometry.base;
+ 
+-			//Extrude elements 
+-			//Create the elements of the 3d mesh for the non extruded part
+-			//Dimensions of elements3d: md.mesh.numberofelements * (numlayers - 1), 6
+-			var elements3d=[];
+-			var elements_prisms=[];
+-			for (var i = 1; i < numlayers; i++) {
+-				for (var j = 0; j < md.mesh.numberofelements; j++) {
+-					elements_prisms = [];
+-					for (var k = 0, offset = (i - 1) * md.mesh.numberofvertices; k < 3; k++) {
+-						elements_prisms.push(md.mesh.elements[j][k]+offset);
+-					}
+-					for (var k = 0, offset = i * md.mesh.numberofvertices; k < 3; k++) {
+-						elements_prisms.push(md.mesh.elements[j][k]+offset);
+-					}
+-					elements3d.push(elements_prisms);
+-				}				
+-			}
+-			number_el3d=elements3d.length; //number of 3d nodes for the non extruded part of the mesh
++		//Create the new layers
++		//Dimensions of x/y/z3d: md.mesh.numberofvertices * numlayers, 1
++		for (var i = 1; i <= numlayers; i++) {
++			x3d=ArrayConcat(x3d, md.mesh.x); 
++			y3d=ArrayConcat(y3d, md.mesh.y); 
++			//nodes are distributed between bed and surface accordingly to the given exponent
++			z3d=ArrayConcat(z3d, FloatFix(thickness3d.map(function(value,index) { return bed3d[index] + value * extrusionlist[i-1]; }), thickness3d.length)); 
++		}
++		var number_nodes3d=x3d.length; //number of 3d nodes for the non extruded part of the mesh
+ 
+-			//Keep a trace of lower and upper nodes
+-			var lowervertex = NewArrayFill(number_nodes3d, NaN);
+-			var uppervertex = NewArrayFill(number_nodes3d, NaN);
+-			//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofvertices+1)
+-			for (var i = md.mesh.numberofvertices, k = 1; i < lowervertex.length; i++, k++) {
+-				lowervertex[i] = k;
+-			};
+-			//Set last layer to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
+-			for (var i = 0, k = md.mesh.numberofvertices+1; i < (numlayers-1)*md.mesh.numberofvertices; i++, k++) {
+-				uppervertex[i] = k;
+-			};
+-			md.mesh.lowervertex=lowervertex;
+-			md.mesh.uppervertex=uppervertex;
++		//Extrude elements 
++		//Create the elements of the 3d mesh for the non extruded part
++		//Dimensions of elements3d: md.mesh.numberofelements * (numlayers - 1), 6
++		var elements3d=[];
++		var elements_prisms=[];
++		for (var i = 1; i < numlayers; i++) {
++			for (var j = 0; j < md.mesh.numberofelements; j++) {
++				elements_prisms = [];
++				for (var k = 0, offset = (i - 1) * md.mesh.numberofvertices; k < 3; k++) {
++					elements_prisms.push(md.mesh.elements[j][k]+offset);
++				}
++				for (var k = 0, offset = i * md.mesh.numberofvertices; k < 3; k++) {
++					elements_prisms.push(md.mesh.elements[j][k]+offset);
++				}
++				elements3d.push(elements_prisms);
++			}				
++		}
++		number_el3d=elements3d.length; //number of 3d nodes for the non extruded part of the mesh
+ 
+-			//same for lower and upper elements
+-			var lowerelements = NewArrayFill(number_el3d, NaN);
+-			var upperelements = NewArrayFill(number_el3d, NaN);
+-			//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofelements+1)
+-			for (var i = md.mesh.numberofelements, k = 1; i < lowerelements.length; i++, k++) {
+-				lowerelements[i] = k;
+-			};
+-			//Set last 2 layers to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
+-			for (var i = 0, k = md.mesh.numberofelements + 1; i < (numlayers-2)*md.mesh.numberofelements; i++, k++) {
+-				upperelements[i] = k;
+-			};
+-			md.mesh.lowerelements=lowerelements;
+-			md.mesh.upperelements=upperelements;
++		//Keep a trace of lower and upper nodes
++		var lowervertex = NewArrayFill(number_nodes3d, NaN);
++		var uppervertex = NewArrayFill(number_nodes3d, NaN);
++		//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofvertices+1)
++		for (var i = md.mesh.numberofvertices, k = 1; i < lowervertex.length; i++, k++) {
++			lowervertex[i] = k;
++		};
++		//Set last layer to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
++		for (var i = 0, k = md.mesh.numberofvertices+1; i < (numlayers-1)*md.mesh.numberofvertices; i++, k++) {
++			uppervertex[i] = k;
++		};
++		md.mesh.lowervertex=lowervertex;
++		md.mesh.uppervertex=uppervertex;
+ 
+-			//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;
++		//same for lower and upper elements
++		var lowerelements = NewArrayFill(number_el3d, NaN);
++		var upperelements = NewArrayFill(number_el3d, NaN);
++		//Set first layer to NaN and start count from 1 at next layer (i = md.mesh.numberofelements+1)
++		for (var i = md.mesh.numberofelements, k = 1; i < lowerelements.length; i++, k++) {
++			lowerelements[i] = k;
++		};
++		//Set last 2 layers to NaN and start count from md.mesh.numberofvertices+1 at first layer (i = 1)
++		for (var i = 0, k = md.mesh.numberofelements + 1; i < (numlayers-2)*md.mesh.numberofelements; i++, k++) {
++			upperelements[i] = k;
++		};
++		md.mesh.lowerelements=lowerelements;
++		md.mesh.upperelements=upperelements;
+ 
+-			//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;
++		//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;
+ 
+-			//Ok, now deal with the other fields from the 2d mesh:
++		//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;
+ 
+-			//bedinfo and surface info
+-			md.mesh.vertexonbase=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',1);
+-			md.mesh.vertexonsurface=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers);
+-			md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
++		//Ok, now deal with the other fields from the 2d mesh:
+ 
+-			//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');
++		//bedinfo and surface info
++		md.mesh.vertexonbase=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',1);
++		md.mesh.vertexonsurface=project3d(md,'vector',NewArrayFill(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers);
++		md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node');
+ 
+-			md.geometry=md.geometry.extrude(md);
+-			md.friction=md.friction.extrude(md);
+-			md.inversion=md.inversion.extrude(md);
+-			md.smb=md.smb.extrude(md);
+-			md.initialization=md.initialization.extrude(md);
++		//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.flowequation=md.flowequation.extrude(md);
+-			md.stressbalance=md.stressbalance.extrude(md);
+-			md.thermal=md.thermal.extrude(md);
+-			md.masstransport=md.masstransport.extrude(md);
+-			md.levelset=md.levelset.extrude(md);
+-			md.calving=md.calving.extrude(md);
+-			md.hydrology = md.hydrology.extrude(md);
++		md.geometry=md.geometry.extrude(md);
++		md.friction=md.friction.extrude(md);
++		md.inversion=md.inversion.extrude(md);
++		md.smb=md.smb.extrude(md);
++		md.initialization=md.initialization.extrude(md);
+ 
+-			//connectivity
+-			if (!ArrayAnyNaN(md.mesh.elementconnectivity)) {
+-				//md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1); //Replicate the matrix across numlayers-1 
+-				var temparr = [];
+-				for (var i = 0; i < numlayers - 1; i++) {
+-					temparr = ArrayConcat(temparr, md.mesh.elementconnectivity);
+-				}
+-				md.mesh.elementconnectivity = temparr;
+-		
+-				//md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
+-				var indices = ArrayFind(md.mesh.elementconnectivity, 0);
+-				for (var i = 0; i < indices.length; i++) {
+-					md.mesh.elementconnectivity[i] = NaN;
+-				};
+-		
+-				for (var i = 2; i < numlayers; i++) {
+-					//md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
+-					//=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
+-					for (var j = (i-1)*md.mesh.numberofelements2d; j <= (i)*md.mesh.numberofelements2d-1; j++) {
+-						for (var k = 0; k < 3; k++) {
+-							md.mesh.elementconnectivity[j][k] += md.mesh.numberofelements2d;
+-						}
++		md.flowequation=md.flowequation.extrude(md);
++		md.stressbalance=md.stressbalance.extrude(md);
++		md.thermal=md.thermal.extrude(md);
++		md.masstransport=md.masstransport.extrude(md);
++		md.levelset=md.levelset.extrude(md);
++		md.calving=md.calving.extrude(md);
++		md.hydrology = md.hydrology.extrude(md);
++		md.solidearth = md.solidearth.extrude(md);
++
++		//connectivity
++		if (!ArrayAnyNaN(md.mesh.elementconnectivity)) {
++			//md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1); //Replicate the matrix across numlayers-1 
++			var temparr = [];
++			for (var i = 0; i < numlayers - 1; i++) {
++				temparr = ArrayConcat(temparr, md.mesh.elementconnectivity);
++			}
++			md.mesh.elementconnectivity = temparr;
++	
++			//md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
++			var indices = ArrayFind(md.mesh.elementconnectivity, 0);
++			for (var i = 0; i < indices.length; i++) {
++				md.mesh.elementconnectivity[i] = NaN;
++			};
++	
++			for (var i = 2; i < numlayers; i++) {
++				//md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
++				//=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
++				for (var j = (i-1)*md.mesh.numberofelements2d; j <= (i)*md.mesh.numberofelements2d-1; j++) {
++					for (var k = 0; k < 3; k++) {
++						md.mesh.elementconnectivity[j][k] += md.mesh.numberofelements2d;
+ 					}
+ 				}
+-				md.mesh.elementconnectivity = md.mesh.elementconnectivity.map(function(value) { return (Number.isNaN(value)) ? 0 : value; });
+ 			}
++			md.mesh.elementconnectivity = md.mesh.elementconnectivity.map(function(value) { return (Number.isNaN(value)) ? 0 : value; });
++		}
+ 
+-			md.materials=md.materials.extrude(md);
+-			md.damage=md.damage.extrude(md);
+-			md.mask=md.mask.extrude(md);
+-			md.qmu=md.qmu.extrude(md);
+-			md.basalforcings=md.basalforcings.extrude(md);
++		md.materials=md.materials.extrude(md);
++		md.damage=md.damage.extrude(md);
++		md.mask=md.mask.extrude(md);
++		md.qmu=md.qmu.extrude(md);
++		md.basalforcings=md.basalforcings.extrude(md);
+ 
+-			//increase connectivity if less than 25:
+-			if (md.mesh.average_vertex_connectivity<=25) {
+-				md.mesh.average_vertex_connectivity=100;
+-			}
+-		} //}}}
+-		this.extract = function(md,area) { //{{{
+-			//extract - extract a model according to an Argus contour or flag list
+-			//
+-			//   This routine extracts a submodel from a bigger model with respect to a given contour
+-			//   md must be followed by the corresponding exp file or flags list
+-			//   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
+-			//   If user wants every element outside the domain to be 
+-			//   extract2d, add '~' to the name of the domain file (ex: '~HO.exp');
+-			//   an empty string '' will be considered as an empty domain
+-			//   a string 'all' will be considered as the entire domain
+-			//
+-			//   Usage:
+-			//      md2=extract(md,area);
+-			//
+-			//   Examples:
+-			//      md2=extract(md,'Domain.exp');
+-			//
+-			//   See also: EXTRUDE, COLLAPSE
++		//increase connectivity if less than 25:
++		if (md.mesh.average_vertex_connectivity<=25) {
++			md.mesh.average_vertex_connectivity=100;
++		}
++	} //}}}
++	this.extract = function(md,area) { //{{{
++		//extract - extract a model according to an Argus contour or flag list
++		//
++		//   This routine extracts a submodel from a bigger model with respect to a given contour
++		//   md must be followed by the corresponding exp file or flags list
++		//   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
++		//   If user wants every element outside the domain to be 
++		//   extract2d, add '~' to the name of the domain file (ex: '~HO.exp');
++		//   an empty string '' will be considered as an empty domain
++		//   a string 'all' will be considered as the entire domain
++		//
++		//   Usage:
++		//      md2=extract(md,area);
++		//
++		//   Examples:
++		//      md2=extract(md,'Domain.exp');
++		//
++		//   See also: EXTRUDE, COLLAPSE
+ 
+-			//some checks on list of arguments
+-			var argc = arguments.length;
++		//some checks on list of arguments
++		var argc = arguments.length;
+ 
+-			if (!((argc == 2) | (argc == 1))) {
+-				throw "extract error message: bad usage";
+-			}
+-			
+-			//get elements that are inside area
+-			flag_elem=FlagElements(this,area);
++		if (!((argc == 2) | (argc == 1))) {
++			error('extract error message: bad usage');
++		}
++		
++		//get elements that are inside area
++		flag_elem=FlagElements(this,area);
+ 
+-			if (!ArrayAnyEqual(flag_elem,1))throw "extracted model is empty!"
++		if (!ArrayAnyEqual(flag_elem,1)) {
++			error('extracted model is empty!');
++		}
+ 
+-			/*kick out all elements with 3 dirichlets: actually, not so fast, not good for javscript usually.
+-			spc_elem=find(~flag_elem);
+-			spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
+-			flag=ones(md1.mesh.numberofvertices,1);
+-			flag(spc_node)=0;
+-			pos=find(sum(flag(md1.mesh.elements),2)==0);
+-			flag_elem(pos)=0;*/
++		/*kick out all elements with 3 dirichlets: actually, not so fast, not good for javscript usually.
++		spc_elem=find(~flag_elem);
++		spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
++		flag=ones(md1.mesh.numberofvertices,1);
++		flag(spc_node)=0;
++		pos=find(sum(flag(md1.mesh.elements),2)==0);
++		flag_elem(pos)=0;*/
+ 
+-			//extracted elements and nodes lists
+-			var pos_elem = ArrayFind(flag_elem,1);
+-			var dup_nodes= new Array(pos_elem.length*3);
+-			for(var i=0;i<pos_elem.length;i++){
+-				dup_nodes[3*i]=md.mesh.elements[pos_elem[i]][0]-1;
+-				dup_nodes[3*i+1]=md.mesh.elements[pos_elem[i]][1]-1;
+-				dup_nodes[3*i+2]=md.mesh.elements[pos_elem[i]][2]-1;
+-			}
+-			pos_node=ArrayUnique(dup_nodes); pos_node=ArraySort(pos_node);
++		//extracted elements and nodes lists
++		var pos_elem = ArrayFind(flag_elem,1);
++		var dup_nodes= new Array(pos_elem.length*3);
++		for(var i=0;i<pos_elem.length;i++){
++			dup_nodes[3*i]=md.mesh.elements[pos_elem[i]][0]-1;
++			dup_nodes[3*i+1]=md.mesh.elements[pos_elem[i]][1]-1;
++			dup_nodes[3*i+2]=md.mesh.elements[pos_elem[i]][2]-1;
++		}
++		pos_node=ArrayUnique(dup_nodes); pos_node=ArraySort(pos_node);
+ 
+-			//keep track of some fields
+-			var numberofvertices1=md.mesh.numberofvertices;
+-			var numberofelements1=md.mesh.numberofelements;
+-			var numberofvertices2=pos_node.length;
+-			var numberofelements2=pos_elem.length;
+-			var flag_node=NewArrayFill(numberofvertices1,0);
+-			for (var i=0;i<pos_node.length;i++)flag_node[pos_node[i]]=1;
++		//keep track of some fields
++		var numberofvertices1=md.mesh.numberofvertices;
++		var numberofelements1=md.mesh.numberofelements;
++		var numberofvertices2=pos_node.length;
++		var numberofelements2=pos_elem.length;
++		var flag_node=NewArrayFill(numberofvertices1,0);
++		for (var i=0;i<pos_node.length;i++)flag_node[pos_node[i]]=1;
+ 
+-			//Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
+-			Pelem=NewArrayFill(numberofelements1,0);
+-			for (var i=0;i<numberofelements2;i++) Pelem[pos_elem[i]]=i;
+-			Pnode=NewArrayFill(numberofvertices1,0);
+-			for (var i=0;i<numberofvertices2;i++) Pnode[pos_node[i]]=i;
+-			//renumber the elements (some nodes won't exist anymore)
+-			var elements_2=NewArrayFill2D(numberofelements2,3,0);
+-			for (var i=0;i<numberofelements2;i++){
+-				for (var j=0;j<3;j++){
+-					elements_2[i][j]=Pnode[md.mesh.elements[i][j]-1]+1;
+-				}
++		//Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
++		Pelem=NewArrayFill(numberofelements1,0);
++		for (var i=0;i<numberofelements2;i++) Pelem[pos_elem[i]]=i;
++		Pnode=NewArrayFill(numberofvertices1,0);
++		for (var i=0;i<numberofvertices2;i++) Pnode[pos_node[i]]=i;
++		//renumber the elements (some nodes won't exist anymore)
++		var elements_2=NewArrayFill2D(numberofelements2,3,0);
++		for (var i=0;i<numberofelements2;i++){
++			for (var j=0;j<3;j++){
++				elements_2[i][j]=Pnode[md.mesh.elements[i][j]-1]+1;
+ 			}
+-			
+-			/*if isa(md.mesh,'mesh3dprisms'),
+-				elements_2(:,4)=Pnode(elements_2(:,4));
+-				elements_2(:,5)=Pnode(elements_2(:,5));
+-				elements_2(:,6)=Pnode(elements_2(:,6));
+-			end
+-			*/
+-			
+-			//OK, now create the new model!
++		}
++		
++		/*if isa(md.mesh,'mesh3dprisms'),
++			elements_2(:,4)=Pnode(elements_2(:,4));
++			elements_2(:,5)=Pnode(elements_2(:,5));
++			elements_2(:,6)=Pnode(elements_2(:,6));
++		end
++		*/
++		
++		//OK, now create the new model!
+ 
+-			//take every field from model
+-			var md2=md.deepcopy(md);
+-			//var md2=new model(); md2.mesh=new mesh3dsurface();
+-			
+-			//deal with mesh: {{{
+-			md2.mesh.numberofvertices=numberofvertices2;
+-			md2.mesh.numberofelements=numberofelements2;
+-			md2.mesh.elements=elements_2;
++		//take every field from model
++		var md2=md.deepcopy(md);
++		//var md2=new model(); md2.mesh=new mesh3dsurface();
++		
++		//deal with mesh: {{{
++		md2.mesh.numberofvertices=numberofvertices2;
++		md2.mesh.numberofelements=numberofelements2;
++		md2.mesh.elements=elements_2;
+ 
+-			md2.mesh.x=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.x[i]=md.mesh.x[pos_node[i]];
+-			md2.mesh.y=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.y[i]=md.mesh.y[pos_node[i]];
+-			md2.mesh.z=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.z[i]=md.mesh.z[pos_node[i]];
+-			md2.mesh.lat=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.lat[i]=md.mesh.lat[pos_node[i]];
+-			md2.mesh.long=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.long[i]=md.mesh.long[pos_node[i]];
+-			md2.mesh.r=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.r[i]=md.mesh.r[pos_node[i]];
+-			//}}}
+-			//deal with geometry: {{{
+-			md2.geometry.base=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.base[i]=md.geometry.base[pos_node[i]];
+-			md2.geometry.thickness=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.thickness[i]=md.geometry.thickness[pos_node[i]];
+-			md2.geometry.surface=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.surface[i]=md.geometry.surface[pos_node[i]];
+-			md2.geometry.bed=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.bed[i]=md.geometry.bed[pos_node[i]];
+-			//}}}
++		md2.mesh.x=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.x[i]=md.mesh.x[pos_node[i]];
++		md2.mesh.y=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.y[i]=md.mesh.y[pos_node[i]];
++		md2.mesh.z=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.z[i]=md.mesh.z[pos_node[i]];
++		md2.mesh.lat=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.lat[i]=md.mesh.lat[pos_node[i]];
++		md2.mesh.long=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.long[i]=md.mesh.long[pos_node[i]];
++		md2.mesh.r=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.mesh.r[i]=md.mesh.r[pos_node[i]];
++		//}}}
++		//deal with geometry: {{{
++		md2.geometry.base=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.base[i]=md.geometry.base[pos_node[i]];
++		md2.geometry.thickness=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.thickness[i]=md.geometry.thickness[pos_node[i]];
++		md2.geometry.surface=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.surface[i]=md.geometry.surface[pos_node[i]];
++		md2.geometry.bed=new Array(numberofvertices2); for (var i=0;i<numberofvertices2;i++)md2.geometry.bed[i]=md.geometry.bed[pos_node[i]];
++		//}}}
+ 
+-			//Keep track of pos_node and pos_elem
+-			for (var i=0;i<md2.mesh.numberofvertices;i++)pos_node[i]=pos_node[i]+1;
+-			for (var i=0;i<md2.mesh.numberofelements;i++)pos_elem[i]=pos_elem[i]+1;
+-			md2.mesh.extractedvertices=pos_node;
+-			md2.mesh.extractedelements=pos_elem;
++		//Keep track of pos_node and pos_elem
++		for (var i=0;i<md2.mesh.numberofvertices;i++)pos_node[i]=pos_node[i]+1;
++		for (var i=0;i<md2.mesh.numberofelements;i++)pos_elem[i]=pos_elem[i]+1;
++		md2.mesh.extractedvertices=pos_node;
++		md2.mesh.extractedelements=pos_elem;
+ 
+-			return md2;
++		return md2;
+ 
++		//automatically modify fields
+ 
++		//loop over model fields
++		//model_fields=fields(md);
++	} //}}}
++	this.collapse = function(md) { //{{{
++		/*
++		 *COLLAPSE - collapses a 3d mesh into a 2d mesh
++		 *
++		 *   This routine collapses a 3d model into a 2d model
++		 *   and collapses all the fileds of the 3d model by
++		 *   taking their depth-averaged values
++		 *
++		 *   Usage:
++		 *	 md=collapse(md)
++		 *
++		 *   See also: EXTRUDE, MODELEXTRACT
++		 */
+ 
+-			//automatically modify fields
++		// Check that the model is really a 3d model
++		if (md.mesh.elementtype() !== 'Penta') {
++			console.error('collapse error message: only 3d mesh can be collapsed')
++		}
+ 
+-			//loop over model fields
+-			//model_fields=fields(md);
++		// Start with changing all the fields from the 3d mesh 
+ 
++		// dealing with the friction law
++		// drag is limited to nodes that are on the bedrock.
++		if (md.friction.classname() === 'friction') {
++			md.friction.coefficient=project2d(md,md.friction.coefficient,1);
++			md.friction.p=project2d(md,md.friction.p,1);
++			md.friction.q=project2d(md,md.friction.q,1);
++		} else if (md.friction.classname() === 'frictionhydro') {
++			md.friction.q=project2d(md,md.friction.q,1);
++			md.friction.C=project2d(md,md.friction.C,1);
++			md.friction.As=project2d(md,md.friction.As,1);
++			md.friction.effective_pressure=project2d(md,md.friction.effective_pressure,1);
++		} else if (md.friction.classname() === 'frictionwaterlayer') {
++			md.friction.coefficient=project2d(md,md.friction.coefficient,1);
++			md.friction.p=project2d(md,md.friction.p,1);
++			md.friction.q=project2d(md,md.friction.q,1);
++			md.friction.water_layer=project2d(md,md.friction.water_layer,1);
++		} else if (md.friction.classname() === 'frictionweertman') {
++			md.friction.C=project2d(md,md.friction.C,1);
++			md.friction.m=project2d(md,md.friction.m,1);
++		} else if (md.friction.classname() === 'frictionweertmantemp') {
++			md.friction.C=project2d(md,md.friction.C,1);
++			md.friction.m=project2d(md,md.friction.m,1);
++		} else {
++			disp('friction type not supported');
++		}
+ 
++		// observations
++		if (!Number.isNaN(md.inversion.vx_obs))
++			md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
+ 
++		if (!Number.isNaN(md.inversion.vy_obs))
++			md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
+ 
++		if (!Number.isNaN(md.inversion.vel_obs))
++			md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers);
+ 
+-		} //}}}
+-		this.collapse = function(md) { //{{{
+-			/*
+-			 *COLLAPSE - collapses a 3d mesh into a 2d mesh
+-			 *
+-			 *   This routine collapses a 3d model into a 2d model
+-			 *   and collapses all the fileds of the 3d model by
+-			 *   taking their depth-averaged values
+-			 *
+-			 *   Usage:
+-			 *	 md=collapse(md)
+-			 *
+-			 *   See also: EXTRUDE, MODELEXTRACT
+-			 */
++		if (!Number.isNaN(md.inversion.cost_functions_coefficients))
++			md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers);
+ 
+-			// Check that the model is really a 3d model
+-			if (md.mesh.elementtype() !== 'Penta') {
+-				console.error('collapse error message: only 3d mesh can be collapsed')
+-			}
++		if (numel(md.inversion.min_parameters)>1)
++			md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers);
+ 
+-			// Start with changing all the fields from the 3d mesh 
++		if (numel(md.inversion.max_parameters)>1) 
++			md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers);
+ 
+-			// dealing with the friction law
+-			// drag is limited to nodes that are on the bedrock.
+-			if (md.friction.classname() === 'friction') {
+-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
+-				md.friction.p=project2d(md,md.friction.p,1);
+-				md.friction.q=project2d(md,md.friction.q,1);
+-			} else if (md.friction.classname() === 'frictionhydro') {
+-				md.friction.q=project2d(md,md.friction.q,1);
+-				md.friction.C=project2d(md,md.friction.C,1);
+-				md.friction.As=project2d(md,md.friction.As,1);
+-				md.friction.effective_pressure=project2d(md,md.friction.effective_pressure,1);
+-			} else if (md.friction.classname() === 'frictionwaterlayer') {
+-				md.friction.coefficient=project2d(md,md.friction.coefficient,1);
+-				md.friction.p=project2d(md,md.friction.p,1);
+-				md.friction.q=project2d(md,md.friction.q,1);
+-				md.friction.water_layer=project2d(md,md.friction.water_layer,1);
+-			} else if (md.friction.classname() === 'frictionweertman') {
+-				md.friction.C=project2d(md,md.friction.C,1);
+-				md.friction.m=project2d(md,md.friction.m,1);
+-			} else if (md.friction.classname() === 'frictionweertmantemp') {
+-				md.friction.C=project2d(md,md.friction.C,1);
+-				md.friction.m=project2d(md,md.friction.m,1);
+-			} else {
+-				disp('friction type not supported');
+-			}
++		if (md.smb.classname() === 'SMBforcing' && !Number.isNaN(md.smb.mass_balance)) {
++			md.smb.mass_balance=project2d(md,md.smb.mass_balance,md.mesh.numberoflayers);
++		} else if (md.smb.classname() === 'SMBhenning' && !Number.isNaN(md.smb.smbref)) {
++			md.smb.smbref=project2d(md,md.smb.smbref,md.mesh.numberoflayers);
++		}
+ 
+-			// observations
+-			if (!Number.isNaN(md.inversion.vx_obs))
+-				md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers);
++		// results
++		if (!Number.isNaN(md.initialization.vx))
++			md.initialization.vx=DepthAverage(md,md.initialization.vx);
++		if (!Number.isNaN(md.initialization.vy))
++			md.initialization.vy=DepthAverage(md,md.initialization.vy);
++		if (!Number.isNaN(md.initialization.vz))
++			md.initialization.vz=DepthAverage(md,md.initialization.vz);
++		if (!Number.isNaN(md.initialization.vel))
++			md.initialization.vel=DepthAverage(md,md.initialization.vel);
++		if (!Number.isNaN(md.initialization.temperature))
++			md.initialization.temperature=DepthAverage(md,md.initialization.temperature);
++		if (!Number.isNaN(md.initialization.pressure))
++			md.initialization.pressure=project2d(md,md.initialization.pressure,1);
++		if (!Number.isNaN(md.initialization.sediment_head))
++			md.initialization.sediment_head=project2d(md,md.initialization.sediment_head,1);
++		if (!Number.isNaN(md.initialization.epl_head))
++			md.initialization.epl_head=project2d(md,md.initialization.epl_head,1);
++		if (!Number.isNaN(md.initialization.epl_thickness))
++			md.initialization.epl_thickness=project2d(md,md.initialization.epl_thickness,1);
+ 
+-			if (!Number.isNaN(md.inversion.vy_obs))
+-				md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers);
++		// giaivins
++		if (!Number.isNaN(md.gia.mantle_viscosity))
++			md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1);
++		if (!Number.isNaN(md.gia.lithosphere_thickness))
++			md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1);
+ 
+-			if (!Number.isNaN(md.inversion.vel_obs))
+-				md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers);
++		// elementstype
++		if (!Number.isNaN(md.flowequation.element_equation)) {
++			md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
++			md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
++			md.flowequation.borderSSA=project2d(md,md.flowequation.borderSSA,1);
++			md.flowequation.borderHO=project2d(md,md.flowequation.borderHO,1);
++			md.flowequation.borderFS=project2d(md,md.flowequation.borderFS,1);
++		}
+ 
+-			if (!Number.isNaN(md.inversion.cost_functions_coefficients))
+-				md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers);
++		// boundary conditions
++		md.stressbalance.spcvx=project2d(md,md.stressbalance.spcvx,md.mesh.numberoflayers);
++		md.stressbalance.spcvy=project2d(md,md.stressbalance.spcvy,md.mesh.numberoflayers);
++		md.stressbalance.spcvz=project2d(md,md.stressbalance.spcvz,md.mesh.numberoflayers);
++		md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers);
++		md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers);
++		md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers);
++		if (!Number.isNaN(md.damage.spcdamage))
++			md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers);
++		md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
+ 
+-			if (numel(md.inversion.min_parameters)>1)
+-				md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers);
++		// Hydrologydc variables
++		if (md.hydrology.classname() === 'hydrologydc') {
++			md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1);
++			md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1);
++			md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1);
++			md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1);
+ 
+-			if (numel(md.inversion.max_parameters)>1) 
+-				md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers);
++			if(md.hydrology.isefficientlayer==1)
++				md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1);
++		}
++		
++		// materials
++		md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
++		md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
++		
++		// damage: 
++		if (md.damage.isdamage)
++			md.damage.D=DepthAverage(md,md.damage.D);
+ 
+-			if (md.smb.classname() === 'SMBforcing' && !Number.isNaN(md.smb.mass_balance)) {
+-				md.smb.mass_balance=project2d(md,md.smb.mass_balance,md.mesh.numberoflayers);
+-			} else if (md.smb.classname() === 'SMBhenning' && !Number.isNaN(md.smb.smbref)) {
+-				md.smb.smbref=project2d(md,md.smb.smbref,md.mesh.numberoflayers);
+-			}
++		// special for thermal modeling:
++		if (!Number.isNaN(md.basalforcings.groundedice_melting_rate))
++			md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
+ 
+-			// results
+-			if (!Number.isNaN(md.initialization.vx))
+-				md.initialization.vx=DepthAverage(md,md.initialization.vx);
+-			if (!Number.isNaN(md.initialization.vy))
+-				md.initialization.vy=DepthAverage(md,md.initialization.vy);
+-			if (!Number.isNaN(md.initialization.vz))
+-				md.initialization.vz=DepthAverage(md,md.initialization.vz);
+-			if (!Number.isNaN(md.initialization.vel))
+-				md.initialization.vel=DepthAverage(md,md.initialization.vel);
+-			if (!Number.isNaN(md.initialization.temperature))
+-				md.initialization.temperature=DepthAverage(md,md.initialization.temperature);
+-			if (!Number.isNaN(md.initialization.pressure))
+-				md.initialization.pressure=project2d(md,md.initialization.pressure,1);
+-			if (!Number.isNaN(md.initialization.sediment_head))
+-				md.initialization.sediment_head=project2d(md,md.initialization.sediment_head,1);
+-			if (!Number.isNaN(md.initialization.epl_head))
+-				md.initialization.epl_head=project2d(md,md.initialization.epl_head,1);
+-			if (!Number.isNaN(md.initialization.epl_thickness))
+-				md.initialization.epl_thickness=project2d(md,md.initialization.epl_thickness,1);
++		if (!Number.isNaN(md.basalforcings.floatingice_melting_rate))
++			md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
+ 
+-			// giaivins
+-			if (!Number.isNaN(md.gia.mantle_viscosity))
+-				md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1);
+-			if (!Number.isNaN(md.gia.lithosphere_thickness))
+-				md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1);
++		md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); // bedrock only gets geothermal flux
+ 
+-			// elementstype
+-			if (!Number.isNaN(md.flowequation.element_equation)) {
+-				md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1);
+-				md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1);
+-				md.flowequation.borderSSA=project2d(md,md.flowequation.borderSSA,1);
+-				md.flowequation.borderHO=project2d(md,md.flowequation.borderHO,1);
+-				md.flowequation.borderFS=project2d(md,md.flowequation.borderFS,1);
+-			}
++		// update of connectivity matrix
++		md.mesh.average_vertex_connectivity=25;
+ 
+-			// boundary conditions
+-			md.stressbalance.spcvx=project2d(md,md.stressbalance.spcvx,md.mesh.numberoflayers);
+-			md.stressbalance.spcvy=project2d(md,md.stressbalance.spcvy,md.mesh.numberoflayers);
+-			md.stressbalance.spcvz=project2d(md,md.stressbalance.spcvz,md.mesh.numberoflayers);
+-			md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers);
+-			md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers);
+-			md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers);
+-			if (!Number.isNaN(md.damage.spcdamage))
+-				md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers);
+-			md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
++		// Collapse the mesh
++		var nodes2d=md.mesh.numberofvertices2d;
++		var elements2d=md.mesh.numberofelements2d;
+ 
+-			// Hydrologydc variables
+-			if (md.hydrology.classname() === 'hydrologydc') {
+-				md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1);
+-				md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1);
+-				md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1);
+-				md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1);
++		// parameters
++		md.geometry.surface=project2d(md,md.geometry.surface,1);
++		md.geometry.thickness=project2d(md,md.geometry.thickness,1);
++		md.geometry.base=project2d(md,md.geometry.base,1);
++		if (!Number.isNaN(md.geometry.bed))
++			md.geometry.bed=project2d(md,md.geometry.bed,1);
+ 
+-				if(md.hydrology.isefficientlayer==1)
+-					md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1);
+-			}
+-			
+-			// materials
+-			md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
+-			md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
+-			
+-			// damage: 
+-			if (md.damage.isdamage)
+-				md.damage.D=DepthAverage(md,md.damage.D);
++		if (!Number.isNaN(md.mask.ocean_levelset))
++			md.mask.ocean_levelset=project2d(md,md.mask.ocean_levelset,1);
+ 
+-			// special for thermal modeling:
+-			if (!Number.isNaN(md.basalforcings.groundedice_melting_rate))
+-				md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
++		if (!Number.isNaN(md.mask.ice_levelset))
++			md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
+ 
+-			if (!Number.isNaN(md.basalforcings.floatingice_melting_rate))
+-				md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
++		// lat long
++		if (numel(md.mesh.lat) === md.mesh.numberofvertices)
++			md.mesh.lat=project2d(md,md.mesh.lat,1);
++		if (numel(md.mesh.long) === md.mesh.numberofvertices)
++			md.mesh.long=project2d(md,md.mesh.long,1);
++		if (numel(md.mesh.scale_factor) === md.mesh.numberofvertices)
++			md.mesh.scale_factor=project2d(md,md.mesh.scale_factor,1);
+ 
+-			md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); // bedrock only gets geothermal flux
++		// Initialize with the 2d mesh
++		var mesh = new mesh2d();
++		mesh.x=md.mesh.x2d;
++		mesh.y=md.mesh.y2d;
++		mesh.numberofvertices=md.mesh.numberofvertices2d;
++		mesh.numberofelements=md.mesh.numberofelements2d;
++		mesh.elements=md.mesh.elements2d;
+ 
+-			// update of connectivity matrix
+-			md.mesh.average_vertex_connectivity=25;
++		if (!Number.isNaN(md.mesh.vertexonboundary))
++			mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
++		if (!Number.isNaN(md.mesh.elementconnectivity))
++			mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
+ 
+-			// Collapse the mesh
+-			var nodes2d=md.mesh.numberofvertices2d;
+-			var elements2d=md.mesh.numberofelements2d;
++		md.mesh=mesh;
++		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
++		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
++		md.mesh.segments=contourenvelope(md.mesh);
+ 
+-			// parameters
+-			md.geometry.surface=project2d(md,md.geometry.surface,1);
+-			md.geometry.thickness=project2d(md,md.geometry.thickness,1);
+-			md.geometry.base=project2d(md,md.geometry.base,1);
+-			if (!Number.isNaN(md.geometry.bed))
+-				md.geometry.bed=project2d(md,md.geometry.bed,1);
++		return md;
++	} /*}}}*/
++	this.deepCopy = function(md) { //{{{
++		/*
++		 *DEEPCOPY - returns a deep copy of the model.
++		 *
++		 *   This routine creates a new model with new objects 
++		 *   for each corresponding object in the original model,
++		 *   so that changes in one do not affect the other.
++		 *
++		 *   Usage:
++		 *	 md1=deepCopy(md)
++		 *
++		 */
++		function recursiveDeepCopy(obj) {
++			var returnValue;
+ 
+-			if (!Number.isNaN(md.mask.ocean_levelset))
+-				md.mask.ocean_levelset=project2d(md,md.mask.ocean_levelset,1);
+-
+-			if (!Number.isNaN(md.mask.ice_levelset))
+-				md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
+-
+-			// lat long
+-			if (numel(md.mesh.lat) === md.mesh.numberofvertices)
+-				md.mesh.lat=project2d(md,md.mesh.lat,1);
+-			if (numel(md.mesh.long) === md.mesh.numberofvertices)
+-				md.mesh.long=project2d(md,md.mesh.long,1);
+-			if (numel(md.mesh.scale_factor) === md.mesh.numberofvertices)
+-				md.mesh.scale_factor=project2d(md,md.mesh.scale_factor,1);
+-
+-			// Initialize with the 2d mesh
+-			var mesh = new mesh2d();
+-			mesh.x=md.mesh.x2d;
+-			mesh.y=md.mesh.y2d;
+-			mesh.numberofvertices=md.mesh.numberofvertices2d;
+-			mesh.numberofelements=md.mesh.numberofelements2d;
+-			mesh.elements=md.mesh.elements2d;
+-
+-			if (!Number.isNaN(md.mesh.vertexonboundary))
+-				mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
+-			if (!Number.isNaN(md.mesh.elementconnectivity))
+-				mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
+-
+-			md.mesh=mesh;
+-			md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+-			md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+-			md.mesh.segments=contourenvelope(md.mesh);
+-
+-			return md;
+-		} /*}}}*/
+-		this.deepCopy = function(md) { //{{{
+-			/*
+-			 *DEEPCOPY - returns a deep copy of the model.
+-			 *
+-			 *   This routine creates a new model with new objects 
+-			 *   for each corresponding object in the original model,
+-			 *   so that changes in one do not affect the other.
+-			 *
+-			 *   Usage:
+-			 *	 md1=deepCopy(md)
+-			 *
+-			 */
+-			function recursiveDeepCopy(obj) {
+-				var returnValue;
+-
+-				switch (typeof obj) {
+-					case "object":
+-						if (obj === null) {
+-							// null => null
+-							returnValue = null;
+-						} else {
+-							switch (toString.call(obj)) {
+-								case "[object Array]":
+-									// It's an array, create a new array with deep copies of the entries
+-									returnValue = obj.map(recursiveDeepCopy);
+-									break;
+-								default:
+-									// Some other kind of object, deep-copy its properties into a new object
+-									returnValue = Object.keys(obj).reduce(function(prev, key) {
+-										prev[key] = recursiveDeepCopy(obj[key]);
+-										return prev;
+-									}, {});
+-									break;
+-							}
++			switch (typeof obj) {
++				case "object":
++					if (obj === null) {
++						// null => null
++						returnValue = null;
++					} else {
++						switch (toString.call(obj)) {
++							case "[object Array]":
++								// It's an array, create a new array with deep copies of the entries
++								returnValue = obj.map(recursiveDeepCopy);
++								break;
++							default:
++								// Some other kind of object, deep-copy its properties into a new object
++								returnValue = Object.keys(obj).reduce(function(prev, key) {
++									prev[key] = recursiveDeepCopy(obj[key]);
++									return prev;
++								}, {});
++								break;
+ 						}
+-						break;
+-					default:
+-						// It's a primitive, copy via assignment
+-						returnValue = obj;
+-						break;
+-				}
+-				return returnValue;
++					}
++					break;
++				default:
++					// It's a primitive, copy via assignment
++					returnValue = obj;
++					break;
+ 			}
+-			
+-			return recursiveDeepCopy(md);
+-		} /*}}}*/
+-	//properties
+-	// {{{
+-		//Careful here: no other class should be used as default value this is a bug of matlab
+-		this.mesh             = 0;
+-		this.mask             = 0;
++			return returnValue;
++		}
++		
++		return recursiveDeepCopy(md);
++	} /*}}}*/
++//properties
++// {{{
++	//Careful here: no other class should be used as default value this is a bug of matlab
++	this.mesh             = 0;
++	this.mask             = 0;
+ 
+-		this.geometry         = 0;
+-		this.constants        = 0;
+-		this.smb              = 0;
+-		this.basalforcings    = 0;
+-		this.materials        = 0;
+-		this.damage           = 0;
+-		this.friction         = 0;
+-		this.flowequation     = 0;
+-		this.timestepping     = 0;
+-		this.initialization   = 0;
+-		this.rifts            = 0;
+-		this.slr              = 0;
+-		this.dsl              = 0;
++	this.geometry         = 0;
++	this.constants        = 0;
++	this.smb              = 0;
++	this.basalforcings    = 0;
++	this.materials        = 0;
++	this.damage           = 0;
++	this.friction         = 0;
++	this.flowequation     = 0;
++	this.timestepping     = 0;
++	this.initialization   = 0;
++	this.rifts            = 0;
++	this.dsl              = 0;
++	this.solidearth       = 0;
+ 
+-		this.debug            = 0;
+-		this.verbose          = 0;
+-		this.settings         = 0;
+-		this.toolkits         = 0;
+-		this.cluster          = 0;
++	this.debug            = 0;
++	this.verbose          = 0;
++	this.settings         = 0;
++	this.toolkits         = 0;
++	this.cluster          = 0;
+ 
+-		this.balancethickness = 0;
+-		this.stressbalance    = 0;
+-		this.groundingline    = 0;
+-		this.hydrology        = 0;
+-		this.masstransport    = 0;
+-		this.thermal          = 0;
+-		this.steadystate      = 0;
+-		this.trans            = 0;
+-		this.levelset         = 0;
+-		this.calving          = 0;
+-		this.frontforcings	  = 0;
+-		this.love             = 0;
+-		this.gia              = 0;
+-		this.esa              = 0;
++	this.balancethickness = 0;
++	this.stressbalance    = 0;
++	this.groundingline    = 0;
++	this.hydrology        = 0;
++	this.masstransport    = 0;
++	this.thermal          = 0;
++	this.steadystate      = 0;
++	this.transient        = 0;
++	this.levelset         = 0;
++	this.calving          = 0;
++	this.frontalforcings  = 0;
++	this.love             = 0;
++	this.esa              = 0;
++	this.sampling         = 0;
+ 
+-		this.autodiff         = 0;
+-		this.inversion        = 0;
+-		this.qmu              = 0;
+-		this.amr					 = 0;
++	this.autodiff         = 0;
++	this.inversion        = 0;
++	this.qmu              = 0;
++	this.amr              = 0;
++	this.results          = 0;
++	this.outputdefinition = 0;
++	this.radaroverlay     = 0;
++	this.miscellaneous    = 0;
++	this.priv             = 0;
+ 
+-		this.results          = 0;
+-		this.outputdefinition = 0;
+-		this.radaroverlay     = 0;
+-		this.miscellaneous    = 0;
+-		this.priv             = 0;
+-
+-		//set default values for fields
+-		this.setdefaultparameters();
+-
+-		//}}}
++	// Set default values for fields
++	if (arguments.length == 0) {
++		this.setdefaultparameters('earth');
++	} else {
++		this.setdefaultparameters(planet);
++	}
++	//}}}
+ }
+Index: ../trunk-jpl/src/m/classes/rotational.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/rotational.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/rotational.js	(revision 26308)
+@@ -0,0 +1,58 @@
++class rotational {//{{{
++	/**
++	 * ROTATIONAL class definition
++	 *
++	 * Usage:
++	 *     rotational = rotational();
++	 */
++	constructor() {//{{{
++		this.equatorialmoi		= 0;
++		this.polarmoi			= 0;
++		this.angularvelocity	= 0;
++
++		let nargs = arguments.length;
++		if (nargs == 0) {
++			this.setdefaultparameters();
++		} else {
++			error('constructor not supported');
++		}
++	} //}}}
++
++	disp() {//{{{
++		console.log('WARNING: rotational::disp is not yet implemented');
++	} //}}}
++
++	setdefaultparameters() {//{{{
++		// Moment of inertia
++		this.equatorialmoi	= 8.0077e37; // [kg m^2]
++		this.polarmoi		= 8.0345e37; // [kg m^2]
++
++		// Mean rotational velocity of earth
++		this.angularvelocity = 7.2921e-5; // [s^-1]
++	} //}}}
++
++	checkconsistency(md, solution, analyses) {//{{{
++		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
++			return md;
++		}
++
++		md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1);
++		md = checkfield(md, 'fieldname', 'solidearth.rotational.polarmoi', 'NaN', 1, 'Inf', 1);
++		md = checkfield(md, 'fieldname', 'solidearth.rotational.angularvelocity', 'NaN', 1, 'Inf', 1);
++
++		return md;
++	} //}}}
++
++	defaultoutputs(md) {//{{{
++		return [];
++	} //}}}
++
++	marshall(md, prefix, fid) {//{{{
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'equatorialmoi', 'name', 'md.solidearth.rotational.equatorialmoi', 'format', 'Double');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'polarmoi', 'name', 'md.solidearth.rotational.polarmoi', 'format', 'Double');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'angularvelocity', 'name', 'md.solidearth.rotational.angularvelocity', 'format', 'Double');
++	} //}}}
++
++	extrude(md) {//{{{
++	} //}}}
++} //}}}
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.js	(revision 26308)
+@@ -0,0 +1,143 @@
++class sealevelmodel {
++	/**
++	 * SEALEVELMODEL class definition
++	 * 
++	 * Usage:
++	 *     slm = sealevelmodel(varargin)
++	 *
++	 * Example:
++	 *     slm = sealevelmodel(
++	 *         'icecap', md_greenland,
++	 *         'icecap', md_antarctica,
++	 *         'earth', md_earth
++	 *     )
++	 *
++	 * TODO:
++	 * - Finish translation
++	 */
++	constructor(...varargin) {//{{{
++		this.icecaps = []; // list of land/ice models; name should be changed later
++		this.earth = null; // model for the whole earth
++		this.basins = []; // list of basins, matching icecaps, where shapefile info is held
++		this.cluster = null;
++		this.miscellaneous = null;
++		this.settings = null;
++		this.private = null;
++		this.mergedcaps = null;
++		this.transitions = [];
++		this.eltransitions = [];
++		this.planet = '';
++
++		this.setdefaultparamters();
++
++		if (varargin.length) {
++			let options = pairoptions(varargin);
++
++			// Recover all the icecap models
++			this.icecaps = options.getfieldvalues('ice_cap', []);
++
++			// Recover the earth model
++			this.earth = options.getfieldvalue('earth', 0);
++
++			// Set planet type
++			this.planet = options.getfieldvalue('planet', 'earth');
++		}
++	} //}}}
++
++	setdefaultparamters() {//{{{
++		// Initialize subclasses
++		this.icecaps = [];
++		this.earth = [];
++		this.cluster = generic();
++		this.miscellaneous = miscellaneous();
++		this.settings = issmsettings();
++		this.private = private();
++		this.transitions = [];
++		this.eltransitions = [];
++		this.planet = 'earth';
++	} //}}}
++
++	static checkconsistency(slm, solutiontype) {//{{{
++		// Is the coupler turned on?
++		for (let i = 0; slm.icecaps.length; ++i) {
++			if (!slm.icecaps[0].transient.iscoupler) {
++				console.log('sealevelmodel checkconsistency error: icecap model ' +  slm.icecaps[0].miscellaneous.name + ' should have the transient coupler option turned on!');
++			}
++		}
++
++		if (!slm.earth.transient.iscoupler) {
++			console.log('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!');
++		}
++
++		// Check that the transition vectors have the right size
++		for (let i = 0; i < slm.icecaps.length; ++i) {
++			if (slm.icecaps[0].mesh.numberorvertices != slm.earth.solidearth.transitions[0].length) {
++				error('sealevelmodel checkconsistency issue with size of transition vector for ice cap: ' + i + ' name: ' + slm.icecaps[0].miscellaneous.name);
++			}
++		}
++
++		// Check that runfrequency is the same everywhere
++		for (let i = 0; i < slm.icecaps; ++i) {
++			if (slm.icecaps[i].solidearth.settings.runfrequency != slm.earth.solidearth.settings.runfrequency) {
++				error('sealevelmodel checkconsistency error: icecap model ' + slm.icecaps[i].miscellaneous.name + ' should have the same run frequency as earth!');
++			}
++		}
++
++		// Make sure steric_rate is the same everywhere
++		for (let i = 0; i < slm.icecaps.length; ++i) {
++			let md = slm.icecaps[i];
++			if (!isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate[slm.earth.dsl.transitions[i]]))) {
++				error('steric rate on ice cap ' + md.miscellaneous.name + ' is not the same as for the earth');
++			}
++		}
++
++		// Make sure grd is the same everywhere
++		for (let i = 0; i < slm.icecaps.length; ++i) {
++			let md = slm.icecaps[i];
++			if (md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd) {
++				error('isgrd on ice cap ' + md.miscellaneous.name + ' is not the same as for the earth');
++			}
++		}
++
++		// Make sure that there is no solid earth external forcing on the basins
++		for (let i = 0; i < slm.icecaps.length; ++i) {
++			let md = slm.icecaps[i];
++			if (!isempty(md.solidearth.external)) {
++				error('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
++			}
++		}
++
++		// Make sure that we have the right grd model for computing out sealevel patterns
++		for (let i = 0; i < slm.icecaps.length; ++i) {
++			let md = slm.icecaps[i];
++			if (md.solidearth.settings.grdmodel) {
++				error('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap ' + i);
++			}
++		}
++	} //}}}
++
++	disp() {//{{{
++		console.log('WARNING: sealevelmodel::disp is not yet implemented');
++	} //}}}
++
++	mergeresults() {//{{{
++		let champs = fieldnames(this.icecaps[0].results.TransientSolution);
++		for (let i = 0; i < this.mergedcaps.length / 2; ++i) {
++			let md = this.mergedcaps[2 * i];
++			let trans = this.mergedcaps[2 * i + 1];
++			//let icecaps = this.icecaps[this.range[2 * i + 2]];
++			for (let j = 0; j < this.icecaps[0].results.TransientSolution) {
++				for (let k = 0; champs.length; ++k) {
++					if (strcmpi(typeof(icecaps[0].results.TransientSolution[j][champs[k]]) == 'double')) {
++						// Vertex or element?
++						if (icecaps[0].results.TransientSolution[j][champs[k]].length == icecaps[0].mesh.numberofvertices) {
++							md.results.TransientSolution[j][champs[k]] == icecaps[0].mesh.numberofvertices;
++
++						}
++					} else {
++
++					}
++				}
++			}
++	} //}}}
++}
+Index: ../trunk-jpl/src/m/classes/solidearth.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/solidearth.js	(revision 26308)
+@@ -0,0 +1,135 @@
++class solidearth {//{{{
++	/**
++	 * SOLIDEARTH class definition
++	 *
++	 * Usage:
++	 *     solidearth = solidearth();
++	 *     solidearth = solidearth('earth');
++	 */
++	constructor() {//{{{
++		this.settings = new solidearthsettings();
++		this.external = null;
++		this.lovenumbers = new lovenumbers();
++		this.rotational = new rotational();
++		this.planetradius = planetradius('earth');
++		this.requested_outputs = [];
++		this.transitions = [];
++		this.partitionice = [];
++		this.partitionhydro = [];
++		this.partitionocean = [];
++
++		let nargs = arguments.length;
++		if (nargs == 0) {
++			this.setdefaultparameters('earth');
++		} else if (nargs == 1) {
++			this.setdefaultparameters(arguments[0]);
++		} else {
++			error('solidearth constructor error message: zero or one argument only!');
++		}
++	} //}}}
++
++	disp() {//{{{
++		console.log('WARNING: solidearth::disp is not yet implemented');
++	} //}}}
++
++	setdefaultparameters(planet) {//{{{
++		// Output default
++		this.requested_outputs = ['default'];
++
++		// Transitions should be an array
++		this.transitions = [];
++
++		// No partitions requested for barystatic contribution
++		this.partitionice = [];
++		this.partitionhydro = [];
++		this.partitionocean = [];
++
++		// No external solutions by default
++		this.external = null;
++
++		// Planet radius
++		this.planetradius = planetradius(planet);
++	} //}}}
++
++	checkconsistency(md, solution, analyses) {//{{{
++		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
++			return md;
++		}
++
++		md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1);
++
++		this.settings.checkconsistency(md, solution, analyses);
++		this.lovenumbers.checkconsistency(md, solution, analyses);
++		this.rotational.checkconsistency(md, solution, analyses);
++
++		if (this.external != null) {
++			if (typeof(this.external) != 'solidearthsolution') {
++				error('solidearth consistency check: external field should be a solidearthsolution');
++			}
++		}
++
++		return md;
++	} //}}}
++
++	defaultoutputs(md) {//{{{
++		return ['Sealevel'];
++	} //}}}
++
++	marshall(md, prefix, fid) {//{{{
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'planetradius', 'format', 'Double');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'transitions', 'format', 'MatArray');
++
++		let npartice = 0;
++		if (this.partitionice.length) {
++			npartice = max(this.partitionice) + 2;
++		}
++
++		let nparthydro = 0;
++		if (this.partitionhydro.length) {
++			nparthydro = max(this.partitionhydro) + 2;
++		}
++
++		let npartocean = 0;
++		if (this.partitionocean.length) {
++			npartocean = max(this.partitionocean) + 2;
++		}
++
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionice', 'mattype', 1, 'format', 'DoubleMat');
++		WriteData(fid, prefix, 'data', npartice, 'format', 'Integer', 'name', 'md.solidearth.npartice');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionhydro', 'mattype', 1, 'format', 'DoubleMat');
++		WriteData(fid, prefix, 'data', nparthydro, 'format', 'Integer', 'name', 'md.solidearth.nparthydro');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'partitionocean', 'mattype', 1, 'format', 'DoubleMat');
++		WriteData(fid, prefix, 'data', npartocean, 'format', 'Integer', 'name', 'md.solidearth.npartocean');
++
++		this.settings.marshall(md, prefix, fid);
++		this.lovenumbers.marshall(md, prefix, fid);
++		this.rotational.marshall(md, prefix, fid);
++
++		if (this.external != null) {
++			WriteData(fid, prefix, 'data', 1, 'format', 'Integer', 'name', 'md.solidearth.isexternal');
++			this.external.marshall(md, prefix, fid);
++		} else {
++			WriteData(fid, prefix, 'data', 0, 'format', 'Integer', 'name', 'md.solidearth.isexternal');
++		}
++
++		// Process requested outputs
++		let outputs = this.requested_outputs;
++		let pos = find(ismember(outputs, 'default'));
++		if (pos.length) {
++			/*
++			NOTE: In order to handle case where user has added 'default' more 
++			than once to this.requested_outputs, need to remove elements by 
++			index in reverse order.
++			*/
++			for (let i = (pos.length - 1); i >= 0; --i) {
++				outputs.splice(pos[i], 1);
++			}
++
++			outputs.push(this.defaultoutputs(md));
++		}
++		WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray');
++	} //}}}
++
++	extrude(md) {//{{{
++	} //}}}
++} //}}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.js	(revision 26308)
+@@ -0,0 +1,145 @@
++class solidearthsettings {//{{{
++	/**
++	 * SOLIDEARTHSETTINGS class definition
++	 *
++	 * Usage:
++	 *     solidearthsettings = solidearthsettings();
++	 */
++	constructor() {//{{{
++		this.reltol					= 0;
++		this.abstol					= 0;
++		this.maxiter				= 0;
++		this.selfattraction			= 1;
++		this.elastic				= 1;
++		this.viscous				= 1;
++		this.rotation				= 1;
++		this.grdocean				= 1;
++		this.ocean_area_scaling		= 0;
++		this.runfrequency			= 1; // How many time steps will we skip before we run grd_core
++		this.sealevelloading		= 1; // Will sea-level loads be computed?
++		this.isgrd					= 0; // Will GRD patterns be computed?
++		this.compute_bp_grd			= 0; // Will GRD patterns for bottom pressures be computed?
++		this.degacc					= 0; // Degree increment for resolution of Green tables
++		this.timeacc				= 0; // Time step accuracy required to compute Green tables
++		this.horiz					= 0; // Compute horizontal deformation
++		this.grdmodel				= 0; // GRD model (0 by defualt, 1 for (visco-)elastic, 2 for Ivins)
++		this.cross_section_shape	= 0; // Cross section only used when GRD model is Ivins
++
++		if (arguments.length == 0) {
++			this.setdefaultparameters();
++		} else {
++			error('constructor not supported');
++		}
++	} //}}}
++
++	disp() {//{{{
++		console.log('WARNING: solidearthsettings::disp is not yet implemented');
++	} //}}}
++
++	setdefaultparameters() {//{{{
++		// Convergence criterion: absolute, relative, and residual
++		this.restol = 0.01; // 1 percent
++		this.abstol = NaN;
++
++		// Maximum of non-linear iterations
++		this.maxiter = 5;
++
++		// Computational flags
++		this.selfattraction = 1;
++		this.elastic = 1;
++		this.viscous = 1;
++		this.rotation = 1;
++		this.grdocean = 1;
++		this.ocean_area_scaling = 0;
++		this.compute_bp_grd = 0;
++		this.isgrd = 0;
++		this.sealevelloading = 1;
++
++		// Numerical discretiztion accuracy
++		this.degacc = 0.01;
++		this.timeacc = 1;
++
++		// How many time steps we skip before we run solidearthsettings solver during transient
++		this.runfrequency = 1;
++
++		// Horizontal displacement? (not on by default)
++		this.horiz = 0;
++
++		// Cross section for Ivins model
++		this.cross_section_shape = 1; // Square as default (see idege in GiaDeflectionCorex)
++
++		// No GRD model by default
++		this.grdmodel = 0;
++	} //}}}
++
++	checkconsistency(md, solution, analyses) {//{{{
++		if (!analyses.includes('SealevelchangeAnalysis') || (solution === 'TransientSolution' && !md.transient.isslc)) {
++			return md;
++		}
++
++		md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1]);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.abstol', 'size', [1]);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.maxiter', 'size', [1], '>=', 1);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.runfrequency', 'size', [1], '>=', 1);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.degacc', 'size', [1], '>=', 1e-10);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.timeacc', 'size', [1], '>', 0);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1]);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.grdmodel', '>=', 0, '<=', 2);
++		md = checkfield(md, 'fieldname', 'solidearth.settings.cross_section_shape', 'numel', [1], 'values', [1, 2]);
++
++		// Checks on computational flags
++		if (this.elastic && !this.rigid) {
++			error('solidearthsettings checkconsistency error message: need rigid on if elastic flag is set');
++		}
++		if (this.viscous && !this.elastic) {
++			error('solidearthsettings checkconsistency error message: need elastic on if viscous flag is set');
++		}
++
++		// A GRD computation has been requested, make some checks on the nature of the meshes provided
++		if (this.isgrd) {
++			if (strcmpi(typeof(md.mesh), 'mesh3dsurface')) {
++				if (this.grdmodel == 2) {
++					error('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)');
++				}
++			} else {
++				if (this.grdmodel == 1) {
++					error('model requires a 3D surface mesh to run GRD computations (change mesh from mesh2d to mesh3dsurface)');
++				}
++			}
++			
++			if (this.sealevelloading && !this.grdocean) {
++				error('solidearthsettings checkconsistency error message: need grdocean on if sealevelloading flag is set');
++			}
++		}
++
++		if (this.compute_bp_grd && !md.solidearth.settings.isgrd) {
++			error('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on');
++		}
++
++		return md;
++	} //}}}
++
++	marshall(md, prefix, fid) {//{{{
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'selfattraction', 'name', 'md.solidearth.settings.selfattraction', 'format', 'Boolean');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'elastic', 'name', 'md.solidearth.settings.elastic', 'format', 'Boolean');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'viscous', 'name', 'md.solidearth.settings.viscous', 'format', 'Boolean');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'rotation', 'name', 'md.solidearth.settings.rotation', 'format', 'Boolean');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'grdocean', 'name', 'md.solidearth.settings.grdocean', 'format', 'Boolean');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts);
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer');
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer');
++	} //}}}
++
++	extrude(md) {//{{{
++	} //}}}
++} //}}}
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.js	(nonexistent)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.js	(revision 26308)
+@@ -0,0 +1,77 @@
++class solidearthsolution {//{{{
++	/**
++	 * SOLIDEARTHSOLUTION class definition
++	 *
++	 * Usage:
++	 *     solidearthsolution = solidearthsolution();
++	 */
++	constructor() {//{{{
++		this.displacementeast	= [];
++		this.displacementnorth	= [];
++		this.displacementup		= [];
++		this.geoid				= [];
++
++		let nargs = arguments.length;
++		if (nargs == 0) {
++			this.setdefaultparameters();
++		} else {
++			error('constructor not supported');
++		}
++	} //}}}
++
++	setdefaultparameters() {//{{{
++		this.displacementeast	= [];
++		this.displacementnorth	= [];
++		this.displacementup		= [];
++		this.geoid				= [];
++	} //}}}
++
++	checkconsistency(md, solution, analyses) {//{{{
++		md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1);
++		md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1);
++		md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1);
++		md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1);
++
++		return md;
++	} //}}}
++
++	disp() {//{{{
++		console.log('WARNING: solidearthsolution::disp is not yet implemented');
++	} //}}}
++
++	marshall(md, prefix, fid) {//{{{
++		let yts = md.constants.yts;
++
++		// Transform our time series into time series rates
++		let displacementeast_rate	= [];
++		let displacementnorth_rate	= [];
++		let displacementup_rate		= [];
++		let geoid_rate				= [];
++		if (size(this.displacementeast, 1) == 1) {
++			disp('External solidearthsolution warning: only one time step provided, assuming the values are rates per year');
++			displacementeast_rate	= [this.displacementeast; 0];
++			displacementnorth_rate	= [this.displacementnorth; 0];
++			displacementup_rate		= [this.displacementup; 0];
++			geoid_rate				= [this.geoid; 0];
++		} else {
++			let time = this.displacementeast[end, :];
++			let dt = diff(time, 1, 2);
++			displacementeast_rate = diff(this.displacementeast[0:-1,:], 1, 2) ./ dt;
++			displacementeast_rate[end + 1, :] = time[0:-1];
++			displacementnorth_rate = diff(this.displacementnorth_rate[0:-1,:], 1, 2) ./ dt;
++			displacementnorth_rate[end + 1, :] = time[0:-1];
++			displacementup_rate = diff(this.displacementup_rate[0:-1,:], 1, 2) ./ dt;
++			displacementup_rate[end + 1, :] = time[0:-1];
++			geoid_rate = diff(this.geoid_rate[0:-1,:], 1, 2) ./ dt;
++			geoid_rate[end + 1, :] = tgeoid_rateime[0:-1];
++		}
++
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementup', 'data', displacementup_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++		WriteData(fid, prefix, 'object', this, 'fieldname', 'geoid', 'data', geoid_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++	} //}}}
++
++	extrude(md) {//{{{
++	} //}}}
++} //}}}
+Index: ../trunk-jpl/src/m/geometry/planetradius.js
+===================================================================
+--- ../trunk-jpl/src/m/geometry/planetradius.js	(nonexistent)
++++ ../trunk-jpl/src/m/geometry/planetradius.js	(revision 26308)
+@@ -0,0 +1,20 @@
++function planetradius(planet) {//{{{
++	/**
++	 * PLANETRADIUS - return planet radius according to planetary body name
++	 *
++	 * Usage:
++	 *     radius = planetradius(planet);
++	 *
++	 * Examples:
++	 * earthradius = planetradius('earth');
++	 */
++
++	let radius = 0;
++	if (planet === 'earth') {
++		radius = 6.371012e6;
++	} else if (planet === 'europa') {
++		radius = 1.5008e6;
++	} else {
++		error('planet type ' + planet + ' not supported yet!');
++	}
++} //}}}
+Index: ../trunk-jpl/src/m/classes/materials.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.js	(revision 26307)
++++ ../trunk-jpl/src/m/classes/materials.js	(revision 26308)
+@@ -1,393 +1,318 @@
+-//MATERIALS class definition
+-//
+-//	Usage:
+-//		materials=materials();
+-
+-class materials {
+-	//methods
+-	constructor() {//{{{
+-		this.nature = [];
+-
+-		let nargs = arguments.length;
+-		if (nargs == 0) {
+-			this.nature=['ice'];
+-		} else {
+-			this.nature=arguments;
+-		}
+-
+-		//check this is acceptable:
+-		for (let i=0; i < length(this.nature); i++){
+-			if (!(strcmpi(this.nature[i],'litho') || strcmpi(this.nature[i],'ice') || strcmpi(this.nature[i],'hydro'))) {
+-				error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+-			}
+-		}
+-
+-		//start filling in the dynamic fields:
+-		for (let i=0; i < length(this.nature); i++) {
+-			let nat=this.nature[i];
+-			switch (nat) {
+-				case 'ice':
+-					this.rho_ice = 0;
+-					this.rho_water = 0;
+-					this.rho_freshwater = 0;
+-					this.mu_water = 0;
+-					this.heatcapacity = 0;
+-					this.latentheat = 0;
+-					this.thermalconductivity = 0;
+-					this.temperateiceconductivity = 0;
+-					this.effectiveconductivity_averaging = 0;
+-					this.meltingpoint = 0;
+-					this.beta = 0;
+-					this.mixed_layer_capacity = 0;
+-					this.thermal_exchange_velocity = 0;
+-					this.rheology_B = 0;
+-					this.rheology_n = 0;
+-					this.rheology_law = 0;
+-					break;
+-				case 'litho':
+-					this.numlayers = 0;
+-					this.radius = 0;
+-					this.viscosity = 0;
+-					this.lame_lambda = 0;
+-					this.lame_mu = 0;
+-					this.burgers_viscosity = 0;
+-					this.burgers_mu = 0;
+-					this.ebm_alpha = 0;
+-					this.ebm_delta = 0;
+-					this.ebm_taul = 0;
+-					this.ebm_tauh = 0;
+-					this.rheologymodel = 0;
+-					this.density = 0;
+-					this.issolid = 0;
+-					break;
+-				case 'hydro':
+-					this.rho_ice = 0;
+-					this.rho_water = 0;
+-					this.rho_freshwater = 0;
+-					break;
+-				default:	
+-					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+-			}
+-		}
+-		this.earth_density = 0;
+-
+-		//set default parameters:
+-		this.setdefaultparameters();
+-	} //}}}
+-	setdefaultparameters() {//{{{
+-		for (let i=0; i < length(this.nature); i++) {
+-			let nat=this.nature[i];
+-			switch (nat) {
+-				case 'ice':
+-					//ice density (kg/m^3)
+-					this.rho_ice=917.;
+-
+-					//ocean water density (kg/m^3)
+-					this.rho_water=1023.;
+-
+-					//fresh water density (kg/m^3)
+-					this.rho_freshwater=1000.;
+-
+-					//water viscosity (N.s/m^2)
+-					this.mu_water=0.001787;
+-
+-					//ice heat capacity cp (J/kg/K)
+-					this.heatcapacity=2093.;
+-
+-					//ice latent heat of fusion L (J/kg)
+-					this.latentheat=3.34*1e5;
+-
+-					//ice thermal conductivity (W/m/K)
+-					this.thermalconductivity=2.4;
+-
+-					//wet ice thermal conductivity (W/m/K)
+-					this.temperateiceconductivity=.24;
+-
+-					//computation of effective conductivity
+-					this.effectiveconductivity_averaging=1;
+-
+-					//the melting point of ice at 1 atmosphere of pressure in K
+-					this.meltingpoint=273.15;
+-
+-					//rate of change of melting point with pressure (K/Pa)
+-					this.beta=9.8*1e-8;
+-
+-					//mixed layer (ice-water interface) heat capacity (J/kg/K)
+-					this.mixed_layer_capacity=3974.;
+-
+-					//thermal exchange velocity (ice-water interface) (m/s)
+-					this.thermal_exchange_velocity=1.00*1e-4;
+-
+-					//Rheology law: what is the temperature dependence of B with T
+-					//available: none, paterson and arrhenius
+-					this.rheology_law='Paterson';
+-
+-					//Rheology fields default: 
+-					this.rheology_B   = 1 * 1e8;
+-					this.rheology_n   = 3;
+-                    break;
+-
+-				case 'litho':
+-					//we default to a configuration that enables running GIA solutions using giacaron and/or giaivins.
+-					this.numlayers=2;
+-
+-					//center of the earth (approximation, must not be 0), then the lab (lithosphere/asthenosphere boundary) then the surface
+-					//(with 1d3 to avoid numerical singularities)
+-					this.radius=[1e3,6278*1e3,6378*1e3];
+-
+-					this.viscosity=[1e21,1e40]; //mantle and lithosphere viscosity (respectively) [Pa.s]
+-					this.lame_mu=[1.45*1e11,6.7*1e10];  // (Pa) //lithosphere and mantle shear modulus (respectively) [Pa]
+-					this.lame_lambda=this.lame_mu;  // (Pa) //mantle and lithosphere lamba parameter (respectively) [Pa]
+-					this.burgers_viscosity=[NaN,NaN];
+-					this.burgers_mu=[NaN,NaN];
+-
+-					this.ebm_alpha=[NaN,NaN];
+-					this.ebm_delta=[NaN,NaN];
+-					this.ebm_taul=[NaN,NaN];
+-					this.ebm_tauh=[NaN,NaN];
+-					this.rheologymodel=[0,0];
+-					this.density=[5.51*1e3,5.50*1e3];  // (Pa) //mantle and lithosphere density [kg/m^3]
+-					this.issolid=[1,1]; // is layer solid or liquid.
+-                    break;
+-
+-				case 'hydro':
+-					//ice density (kg/m^3)
+-					this.rho_ice=917.;
+-
+-					//ocean water density (kg/m^3)
+-					this.rho_water=1023.;
+-					
+-					//fresh water density (kg/m^3)
+-					this.rho_freshwater=1000.;
+-                    break;
+-
+-				default:
+-					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+-			}
+-
+-			// average density of the Earth (kg/m^3)
+-			this.earth_density=5512;
+-
+-		}
+-	} //}}}
+-	disp() {//{{{
+-		console.log(sprintf('   Materials:'));
+-
+-		for (let i=0; i < length(this.nature); i++) {
+-			let nat=this.nature[i];
+-			switch (nat) {
+-				case 'ice':
+-					console.log(sprintf('   \nIce:'));
+-					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
+-					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
+-					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
+-					fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
+-					fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
+-					fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
+-					fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+-					fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
+-					fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
+-					fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
+-					fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
+-					fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
+-					fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
+-					fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
+-					fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: "None", "BuddJacka", Cuffey", "CuffeyTemperate", "Paterson", "Arrhenius", "LliboutryDuval", "NyeCO2", or "NyeH2O"');
+-				    break;
+-				case 'litho':
+-					console.log(sprintf('   \nLitho:'));
+-					fielddisplay(this,'numlayers','number of layers (default: 2)');
+-					fielddisplay(this,'radius','array describing the radius for each interface (numlayers+1) [m]');
+-					fielddisplay(this,'viscosity','array describing each layer\'s viscosity (numlayers) [Pa.s]');
+-					fielddisplay(this,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
+-					fielddisplay(this,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
+-					fielddisplay(this,'burgers_viscosity','array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
+-					fielddisplay(this,'burgers_mu','array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
+-
+-					fielddisplay(this,'ebm_alpha','array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
+-					fielddisplay(this,'ebm_delta','array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
+-					fielddisplay(this,'ebm_taul','array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
+-					fielddisplay(this,'ebm_tauh','array describing each layer\'s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
+-
+-
+-					fielddisplay(this,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
+-					fielddisplay(this,'density','array describing each layer\'s density (numlayers) [kg/m^3]');
+-					fielddisplay(this,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
+-				    break;
+-				case 'hydro':
+-					console.log(sprintf('   \nHydro:'));
+-					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
+-					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
+-					fielddisplay(this,'earth_density','mantle density [kg/m^3]');
+-					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
+-                    break;
+-				default:	
+-					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+-			}	
+-		}
+-
+-	} // }}}
+-	extrude() {//{{{
+-		for (let i=0; i < length(this.nature); i++) {
+-			let nat=this.nature[i];
+-			switch (nat) {
+-				case 'ice':
+-					this.rheology_B=project3d(md,'vector',this.rheology_B,'type','node');
+-					this.rheology_n=project3d(md,'vector',this.rheology_n,'type','element');
+-			        break;
+-			}
+-		}
+-		return this;
+-	}//}}}
+-	checkconsistency(md,solution,analyses) { // {{{
+-
+-		for (let i=0; i < length(this.nature); i++) {
+-			let nat=this.nature[i];
+-			switch (nat) {
+-				case 'ice':
+-					checkfield(md,'fieldname','materials.rho_ice','>',0);
+-					checkfield(md,'fieldname','materials.rho_water','>',0);
+-					checkfield(md,'fieldname','materials.rho_freshwater','>',0);
+-					checkfield(md,'fieldname','materials.mu_water','>',0);
+-					checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
+-					checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements, 1]);
+-					checkfield(md,'fieldname','materials.rheology_law','values',['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O']);
+-				    break;
+-				case 'litho':
+-					if (!ismember('LoveAnalysis',analyses)) return; end
+-					checkfield(md,'fieldname','materials.numlayers','NaN',1,'Inf',1,'>',0,'numel',1);
+-					checkfield(md,'fieldname','materials.radius','NaN',1,'Inf',1,'size',[md.materials.numlayers+1, 1],'>',0);
+-					checkfield(md,'fieldname','materials.lame_mu','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.lame_lambda','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.issolid','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0,'<',2);
+-					checkfield(md,'fieldname','materials.density','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>',0);
+-					checkfield(md,'fieldname','materials.viscosity','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.rheologymodel','NaN',1,'Inf',1,'size',[md.materials.numlayers, 1],'>=',0,'<=',2);
+-					checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.ebm_alpha','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.ebm_delta','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.ebm_taul','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-					checkfield(md,'fieldname','materials.ebm_tauh','Inf',1,'size',[md.materials.numlayers, 1],'>=',0);
+-
+-					for (let i=0; i < md.materials.numlayers; i++) {
+-						if (md.materials.rheologymodel[i]==1 && (isNaN(md.materials.burgers_viscosity[i] || isNaN(md.materials.burgers_mu[i])))) {
+-							error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
+-						}
+-						if (md.materials.rheologymodel[i]==2 && (isNaN(md.materials.ebm_alpha[i]) || isNaN(md.materials.ebm_delta[i]) || isNaN(md.materials.ebm_taul[i]) || isNaN(md.materials.ebm_tauh[i]))) {
+-							error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
+-						}
+-					}
+-					if (md.materials.issolid[0]==0 || md.materials.lame_mu[0]==0) {
+-						error('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.');
+-					}
+-					ind=find(ArrayEqual(md.materials.issolid,0)); //ind=find(md.materials.issolid==0);
+-					console.log('materials consistency warning: not checking for fluid layers (not implemented)');
+-					//if sum(ismember(diff(ind),1)>=1) %if there are at least two consecutive indices that contain issolid = 0
+-					//	error(['Fluid layers detected at layers #', num2str(ind'), ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.'])
+-					//}
+-                    break;
+-				case 'hydro':
+-					checkfield(md,'fieldname','materials.rho_ice','>',0);
+-					checkfield(md,'fieldname','materials.rho_water','>',0);
+-					checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+-					checkfield(md,'fieldname','materials.rho_freshwater','>',0);
+-                    break;
+-				default:	
+-					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+-			}
+-		}
+-
+-	} // }}}
+-	marshall(md,prefix,fid) { //{{{
+-		//1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+-		WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(this.nature),'format','IntMat','mattype',3);
+-		WriteData(fid,prefix,'name','md.materials.type','data',5,'format','Integer'); //DANGER: this can evolve if you have classes.
+-		for (let i=0; i < length(this.nature); i++) {
+-			let nat=this.nature[i];
+-			switch (nat) {
+-				case 'ice':
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
+-					WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
+-				    break;
+-				case 'litho':
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','numlayers','format','Integer');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','radius','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','lame_mu','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','lame_lambda','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','issolid','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','density','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','viscosity','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheologymodel','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_alpha','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_delta','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_taul','format','DoubleMat','mattype',3);
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','ebm_tauh','format','DoubleMat','mattype',3);
+-					//compute earth density compatible with our layer density distribution: 
+-					let earth_density=0;
+-					for (let i=0; i < this.numlayers; i++){
+-						earth_density=earth_density + (this.radius[i+1]**3-this.radius[i]**3)*this.density[i];
+-					}
+-					earth_density=earth_density/this.radius(this.numlayers+1)**3;
+-					console.log(earth_density);
+-					this.earth_density=earth_density;
+-				    break;
+-				case 'hydro':
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double');
+-					WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double');
+-				    break;
+-				default:	
+-					error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+-			}
+-		}
+-		WriteData(fid,prefix,'data',this.earth_density,'name','md.materials.earth_density','format','Double');
+-	}//}}}
+-}
+-function naturetointeger(strnat) {// {{{
+-	let intnat=zeros(length(strnat),1);
+-	for (let i=0; i < length(strnat); i++){
+-		switch (strnat[i]) {
+-			case 'damageice':
+-				intnat[i]=1;
+-				break;
+-			case 'estar':
+-				intnat[i]=2;
+-				break;
+-			case 'ice':
+-				intnat[i]=3;
+-				break;
+-			case 'enhancedice':
+-				intnat[i]=4;
+-				break;
+-			//case 'materials': //this case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
+-			//	intnat[i]=5;
+-			//  break;
+-			case 'litho':
+-				intnat[i]=6;
+-				break;
+-			case 'hydro':
+-				intnat[i]=7;
+-				break;
+-			default:
+-				error('materials constructor error message: nature of the material not supported yet! ("ice" or "litho" or "hydro")');
+-		}
+-	}
+-	return intnat;
+-}// }}}
++class materials {//{{{
++	/**
++	 * MATERIALS class definition
++	 *
++	 * Usage:
++	 *     materials = materials();
++	 */
++	constructor() {//{{{
++		this.nature = [];
++
++		let nargs = arguments.length;
++		if (nargs == 0) {
++			this.nature = ['ice'];
++		} else {
++			this.nature = arguments;
++		}
++
++		// Check this is acceptable
++		for (let i = 0; i < this.nature.length; ++i) {
++			if (!(strcmpi(this.nature[i], 'litho') || strcmpi(this.nature[i], 'ice') || strcmpi(this.nature[i], 'hydro'))) {
++				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++			}
++		}
++
++		// Start filling in the dynamic fields (not truly dynamic under JavaScript)
++		for (let i = 0; i < this.nature.length; ++i) {
++			let nat = this.nature[i];
++			if (nat == 'ice') {
++				this.rho_ice = 0;
++				this.rho_water = 0;
++				this.rho_freshwater = 0;
++				this.mu_water = 0;
++				this.heatcapacity = 0;
++				this.latentheat = 0;
++				this.thermalconductivity = 0;
++				this.temperateiceconductivity = 0;
++				this.effectiveconductivity_averaging = 0;
++				this.meltingpoint = 0;
++				this.beta = 0;
++				this.mixed_layer_capacity = 0;
++				this.thermal_exchange_velocity = 0;
++				this.rheology_B = 0;
++				this.rheology_n = 0;
++				this.rheology_law = 0;
++			} else if (nat == 'litho') {
++				this.numlayers = 0;
++				this.radius = 0;
++				this.viscosity = 0;
++				this.lame_lambda = 0;
++				this.lame_mu = 0;
++				this.burgers_viscosity = 0;
++				this.burgers_mu = 0;
++				this.ebm_alpha = 0;
++				this.ebm_delta = 0;
++				this.ebm_taul = 0;
++				this.ebm_tauh = 0;
++				this.rheologymodel = 0;
++				this.density = 0;
++				this.issolid = 0;
++			} else if (nat == 'hydro') {
++				this.rho_ice = 0;
++				this.rho_water = 0;
++				this.rho_freshwater = 0;
++			} else {
++				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++			}
++		}
++		this.earth_density = 0;
++
++		// Set default parameters
++		this.setdefaultparameters();
++	} //}}}
++
++	disp() {//{{{
++		console.log('WARNING: materials::disp is not yet implemented');
++	} //}}}
++
++	setdefaultparameters() {//{{{
++		for (let i = 0; i < this.nature.length; ++i) {
++			let nat = this.nature[i];
++			if (nat == 'ice') {
++				// Ice density (kg/m^3)
++				this.rho_ice = 917;
++
++				// Ocean water density (kg/m^3)
++				this.rho_water = 1023
++
++				// Fresh water density (kg/m^3)
++				this.rho_freshwater = 1000;
++
++				// Water viscosity (N.s/m^2)
++				this.mu_water = 0.001787;
++
++				// Ice heat capacity cp (J/kg/K)
++				this.heatcapacity = 2093;
++
++				// Ice latent heat of fusion L (J/kg)
++				this.latentheat = 3.34 * 1e5;
++
++				// Ice thermal conductivity (W/m/K)
++				this.thermalconductivity = 2.4;
++
++				// Wet ice thermal conductivity (W/m/K)
++				this.temperateiceconductivity = 0.24;
++
++				// Computation of effective conductivity
++				this.effectiveconductivity_averaging = 1;
++
++				// The melting point of ice at 1 atmosphere of pressure in K
++				this.meltingpoint = 273.15;
++
++				// Rate of change of melting point with pressure (K/Pa)
++				this.beta = 9.8 * 1e-8;
++
++				// Mixed layer (ice-water interface) heat capacity (J/kg/K)
++				this.mixed_layer_capacity = 3974;
++
++				// Thermal exchange velocity (ice-water interface) (m/s)
++				this.thermal_exchange_velocity = 1.00 * 1e-4;
++
++				// Rheology law: what is the temperature dependence of B with T
++				// available: none, paterson and arrhenius
++				this.rheology_law = 'Paterson';
++
++				// Rheology fields default
++				this.rheology_B = 1 * 1e8;
++				this.rheology_n = 3;
++			} else if (nat == 'litho') {
++				// We default to a configuration that enables running GIA 
++				// solutions using giacaron and/or giaivins
++				this.numlayers = 2;
++
++				// Center of the earth (approximation, must not be 0), then the 
++				// lab (lithosphere/asthenosphere boundary) then the surface
++				// (with 1d3 to avoid numerical singularities)
++				this.radius = [1e3, 6278 * 1e3, 6378 * 1e3];
++
++				this.viscosity = [1e21, 1e40]; // Mantle and lithosphere viscosity (respectively) [Pa.s]
++				this.lame_mu = [1.45 * 1e11, 6.7 * 1e10]; // (Pa) // Lithosphere and mantle shear modulus (respectively) [Pa]
++				this.lame_lambda = this.lame_mu; // (Pa) // Mantle and lithosphere lamba parameter (respectively) [Pa]
++				this.burgers_viscosity = [NaN, NaN];
++				this.burgers_mu = [NaN, NaN];
++
++				this.ebm_alpha = [NaN, NaN];
++				this.ebm_delta = [NaN, NaN];
++				this.ebm_taul = [NaN, NaN];
++				this.ebm_tauh = [NaN, NaN];
++				this.rheologymodel = [0, 0];
++				this.density = [5.51 * 1e3, 5.50 * 1e3]; // (Pa) // Mantle and lithosphere density [kg/m^3]
++				this.issolid = [1, 1]; // Is layer solid or liquid?
++			} else if (nat == 'hydro') {
++				// Ice density (kg/m^3)
++				this.rho_ice = 917;
++
++				// Ocean water density (kg/m^3)
++				this.rho_water = 1023;
++
++				// Fresh water density (kg/m^3)
++				this.rho_freshwater = 1000;
++			} else {
++				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++			}
++
++			// Average density of the Earth (kg/m^3)
++			this.earth_density=5512;
++		}
++	} //}}}
++
++	checkconsistency(md, solution, analyses) {//{{{
++		for (let i = 0; i < this.nature.length; ++i) {
++			let nat = this.nature[i];
++			if (nat == 'ice') {
++				md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1);
++				md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements, 1]);
++				md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O']);
++			} else if (nat == 'litho') {
++				if (!analyses.includes('LoveAnalysis')) {
++					return md;
++				}
++
++				md = checkfield(md, 'fieldname', 'materials.numlayers', 'NaN', 1, 'Inf', 1, '>', 0, 'numel', 1);
++				md = checkfield(md, 'fieldname', 'materials.radius', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers + 1, 1], '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.lame_mu', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.lame_lambda', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.issolid', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<', 2);
++				md = checkfield(md, 'fieldname', 'materials.density', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.rheologymodel', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 2);
++				md = checkfield(md, 'fieldname', 'materials.burgers_viscosity', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.burgers_mu', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.ebm_alpha', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.ebm_delta', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.ebm_taul', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++				md = checkfield(md, 'fieldname', 'materials.ebm_tauh', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0);
++
++				for (let i = 0; i < md.materials.numlayers; ++i) {
++					if (md.materials.rheologymodel[i] == 1 && (isnan(md.materials.burgers_viscosity[i]) || isnan(md.materials.burgers_mu[i]))) {
++						error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');
++					}
++					if (md.materials.rheologymodel[i] == 2 && (isnan(md.materials.ebm_alpha[i]) || isnan(md.materials.ebm_delta[i])) || isnan(md.materials.ebm_taul[i] || isnan(md.materials.ebm_tauh[i]))) {
++						error('materials checkconsistency error message: Litho ebm_alpha, ebm_delta, ebm_taul or ebm_tauh has NaN values, inconsistent with rheologymodel choice');
++					}
++				}
++				if (md.materials.issolid[0] == 0 || md.materials.lame_mu[0] == 0) {
++					error('First layer must be solid (issolid[0] > 0 AND lame_mu[0] > 0). Add a weak inner core if necessary.');
++				}
++				let ind = find(md.materials.issolid == 0);
++				if (sum(ismember(diff(ind), 1) >= 1)) { // If there are at least two consecutive indices that contain issolid = 0
++					error('Fluid layers detected at layers #' + ind + ', but having 2 or more adjacent fluid layers is not supported yet. Consider merging them.');
++				}
++			} else if (nat == 'hydro') {
++				md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0);
++				md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1);
++				md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0);
++			} else {
++				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++			}
++		}
++
++		return md;
++	} //}}}
++
++	marshall(md, prefix, fid) {//{{{
++		// 1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
++		WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(this.nature), 'format', 'IntMat', 'mattype', 3);
++		WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer'); // DANGER: this can evolve if you have classes
++		for (let i = 0; i < this.nature.length; ++i) {
++			let nat = this.nature[i];
++			if (nat == 'ice') {
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'thermal_exchange_velocity', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2);
++				WriteData(fid, prefix, 'data', this.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String');
++			} else if (nat == 'litho') {
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'numlayers', 'format', 'Integer');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'radius', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'lame_mu', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'lame_lambda', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'issolid', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'density', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'viscosity', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rheologymodel', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_alpha', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_delta', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_taul', 'format', 'DoubleMat', 'mattype', 3);
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'ebm_tauh', 'format', 'DoubleMat', 'mattype', 3);
++				// Compute earth density compatible with our layer density distribution
++				let earth_density = 0;
++				for (let i = 0; i < this.numlayers; ++i) {
++					earth_density = earth_density + (Math.pow(this.radius[i + 1], 3) - Math.pow(this.radius[i], 3)) * this.density[i];
++				}
++				earth_density = earth_density / Math.pow(this.radius[this.numlayers]);
++				this.earth_density = earth_density;
++			} else if (nat == 'hydro') {
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double');
++				WriteData(fid, prefix, 'object', this, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double');
++			} else {
++				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++			}
++			WriteData(fid, prefix, 'data', this.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double');
++		}
++	} //}}}
++
++	extrude(md) {//{{{
++		for (let i = 0; i < this.nature.length; ++i) {
++			let nat = this.nature[i];
++			if (nat == 'ice') {
++				this.rheology_B = project3d(md, 'vector', this.rheology_B, 'type', 'node');
++				this.rheology_n = project3d(md, 'vector', this.rheology_n, 'type', 'element');
++			}
++		}
++	} //}}}
++} //}}}
++
++function naturetointeger(strnat) {//{{{
++	let intnat = zeros(strnat.length, 1);
++	for (let i = 0; i < strnat.length; ++i) {
++		let str_nat = strnat[i];
++		if (str_nat == 'damageice') {
++			intnat[i] = 1;
++		} else if (str_nat == 'estar') {
++			intnat[i] = 2;
++		} else if (str_nat == 'ice') {
++			intnat[i] = 3;
++		} else if (str_nat == 'enhancedice') {
++			intnat[i] = 4;
++		//} else if (str_nat == 'materials') { // This case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
++		//	intnat[i] = 5;
++		} else if (str_nat == 'litho') {
++			intnat[i] = 6;
++		} else if (str_nat == 'hydro') {
++			intnat[i] = 7;
++		} else {
++			error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++		}
++	}
++	return intnat;
++} //}}}
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.js
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.js	(nonexistent)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.js	(revision 26308)
+@@ -0,0 +1,434 @@
++/*
++A collection of functions that replicate the behavior of MATLAB built-in
++functions of the same, respective name.
++
++Where possible, users are encouraged to use native and/or the most efficient 
++methods in JavaScript, but we provide these functions as a way to make 
++translations from the MATLAB to the JavaScript ISSM API more seamless.
++
++NOTE:
++- We cannot implement the following MATLAB built-in functions by name as their
++names are reserved keywords in JavaScript,
++	class
++
++TODO:
++- Implement,
++	sort
++	unique
++
++Sources:
++- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords
++*/
++
++/**
++ * FUNCTION any - Determine if any array elements are nonzero
++ *
++ * Replicates behavior of MATLAB's 'any' function.
++ *
++ * Usage:
++ *     B = any(A);
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/any.html
++ *
++ * NOTE:
++ * - Only basic functionality is implemented
++ */
++function any(A) {//{{{
++	for (let i = 0; i < A.length; ++i) {
++		if (A[i] !== 0) {
++			return true;
++		}
++	}
++	return false;
++} //}}}
++
++/**
++ * FUNCTION diff - Differences and approximate derivatives
++ *
++ * Replicates behavior of MATLAB's 'diff' function.
++ * 
++ * Y = diff(X) calculates differences between adjacent elements of X.
++ *
++ * Usage:
++ *     Y = diff(X);
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/diff.html
++ *
++ * NOTE:
++ * - Not all functionality is implemented
++ */
++function diff(X) {//{{{
++	let diffs = [];
++	for (let i = 0; i < X.length - 1; ++i) {
++		diffs[i] = X[i + 1] - X[i];
++	}
++	return diffs;
++} //}}}
++
++/**
++ * FUNCTION disp - Display value of variable
++ *
++ * Replicates behavior of MATLAB's 'disp' function.
++ *
++ * Output is logged to console.
++ *
++ * Usage:
++ *     disp(X);
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/disp.html
++ */
++function disp(X) {//{{{
++	console.log(X);
++} //}}}
++
++/**
++ * FUNCTION error - Throw error and display message
++ *
++ * Replicates behavior of MATLAB's 'error' function
++ *
++ * Usage:
++ *     error(msg);
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/error.html
++ *
++ * NOTE:
++ * - Only basic functionality is implemented
++ */
++function error(msg) {//{{{
++	throw new Error(msg);
++} //}}}
++
++/**
++ * FUNCTION find - Find indices and values of nonzero elements
++ *
++ * Replicates behavior of MATLAB's 'find' function
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/find.html
++ *
++ * TODO:
++ * - Implement support for multidimensional arrays
++ * - Implement 'n' parameter
++ * - Implement 'direction' parameter
++ */
++function find(X, n, direction) {//{{{
++	if (typeof(X[0]) == 'number') {
++		let indices = [];
++		for (let i = 0; i < X.length; ++i) {
++			if (X[i] != 0) {
++				indices.push(i);
++			}
++		}
++		return indices;
++	} else { //TODO: If 2d array, assume return rows & cols - try to find a way to not always return rows/cols
++		let rowindices = [];
++		let colindices = [];
++		for (let i = 0; i < X.length; ++i) {
++			for (let j = 0; j < X[i].length; ++j) {
++				if (X[i][j] != 0) {
++					rowindices.push(i);
++					colindices.push(j);
++				}
++			}
++		}
++		return [rowindices, colindices];
++	}
++} //}}}
++
++/**
++ * FUNCTION isempty - Determine whether array is empty
++ *
++ * Replicates behavior of MATLAB's 'isempty' function
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/isempty.html
++ *
++ * TODO:
++ * - Implement support for multidimensional arrays
++ */
++function isempty(A) {//{{{
++	//NOTE: Expanded for clarity/debugging. Can reduce later.
++	if (A === undefined) {
++		return 1; //TODO: Fix this: for now, treat undefined as empty
++	} else {
++		return A.length == 0;
++	}
++} //}}}
++
++/**
++ * FUNCTION ismember - Array elements that are members of set array
++ *
++ * Replicates basic behavior of MATLAB's 'ismember' function with an important 
++ * modification: because of the way we use ismember under MATLAB (to determine 
++ * if *any* element of A is in B) and because the truthiness of an empty array 
++ * in JavaScript is true, we return 0 if the A is not in B.
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/double.ismember.html
++ *
++ * TODO:
++ * - Implement support for multidimensional arrays
++ */
++function ismember(A, B) {//{{{
++	let b = B;
++	if (typeof(B) == 'number' || typeof(B) == 'string') {
++		b = [B];
++	}
++	let indices = zeros(A.length);
++	for (let i = 0; i < A.length; ++i) {
++		for (let j = 0; j < b.length; ++j) {
++			if (A[i] === b[j]) {
++				indices[i] = 1;
++			}
++		}
++	}
++	if (indices.length) {
++		return indices;
++	} else {
++		return 0;
++	}
++} //}}}
++
++/**
++ * FUNCTION isnan - Determine which array elements are NaN
++ *
++ * Replicates behavior of MATLAB's 'isnan' function
++ *
++ * Usage:
++ *     TF = isnan(A)
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/isnan.html
++ * - https://medium.com/coding-in-simple-english/how-to-check-for-nan-in-javascript-4294e555b447
++ * 
++ * NOTE:
++ * - Not to be confused with JavaScript built-in function isNaN
++ * - Not to be confused with function Number.isNaN
++ */
++function isnan(A) {//{{{
++	if (A.constructor !== Array) {
++		error('isnan: argument must be an array')
++	}
++	is_nan = [];
++	for (let i = 0; i < A.length; ++i) {
++		if (Number.isNaN(A[i])) {
++			is_nan.push(1);
++		} else {
++			is_nan.push(0);
++		}
++	}
++	return is_nan;
++} //}}}/*
++
++/**
++ * FUNCTION length - Length of largest array dimension
++ *
++ * Replicates behavior of MATLAB's 'length' function
++ *
++ * Usage:
++ *     L = length(X)
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/length.html
++ *
++ * TODO:
++ * - Implement support for multidimensional arrays
++ */
++function length(A) {//{{{
++	return A.length;
++} //}}}/*
++
++/**
++ * FUNCTION max - Maximum elements of an array
++ *
++ * Replicates behavior of MATLAB's 'max' function
++ *
++ * Usage:
++ *     M = max(A)
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/max.html
++ *
++ * TODO:
++ * - Implement support for multidimensional arrays
++ * - Implement 'nanflag' parameter
++ */
++function max(A) {//{{{
++	return Math.max.apply(null, A);
++} //}}}/*
++
++/**
++ * FUNCTION min - Minimum elements of an array
++ *
++ * Replicates behavior of MATLAB's 'min' function
++ *
++ * Usage:
++ *     M = min(A)
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/min.html
++ *
++ * TODO:
++ * - Implement support for multidimensional arrays
++ * - Implement 'nanflag' parameter
++ */
++function min(A) {//{{{
++	return Math.min.apply(null, A);
++} //}}}/*
++
++/**
++ * FUNCTION sum - Sum of elements of an array
++ *
++ * Replicates behavior of MATLAB's 'sum' function
++ *
++ * Usage:
++ *     S = sum(A)
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/sum.html
++ *
++ * TODO:
++ * - Implement support for multidimensional arrays
++ * - Implement 'nanflag' parameter
++ */
++function sum(A) {//{{{
++	return ArraySum(A);
++} //}}}/*
++
++/**
++ * FUNCTION ones - Create array of all ones
++ *
++ * Replicates behavior of MATLAB's 'ones' function
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/ones.html
++ *
++ * NOTE:
++ * - Current behavior is to initialize and return a 1D array of length 'size'
++ *
++ * TODO:
++ * - Implement actual behavior of MATLAB's 'ones' function
++ */
++function ones(size) {//{{{
++	return NewArrayFill(size, 1);
++} //}}}
++
++/**
++ * FUNCTION size - Array size
++ *
++ * Replicates behavior of MATLAB's 'size' function
++ * 
++ * Usage:
++ *     sz = size(A);
++ *     szdim = size(A, dim);
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/size.html
++ * 
++ * NOTE:
++ * - Not all functionality is implemented
++ * - In a 2D array, if length of all columns are not equal, unexpected behavior 
++ * may result from subsequent processing based on the values returned from this 
++ * function.
++ */
++function size(A, dim) {//{{{
++	let nargs = arguments.length;
++	if (nargs == 0) {
++		error('size: at least one argument is required');
++	} else if (nargs == 1) {
++		if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
++			return [1, 1];
++		} else if (A.constructor != Array) {
++			error('size: A argument must be a number or an Array');
++		}
++		if (typeof(A) == 'undefined' || isNaN(A)) {
++			return [0];
++		} else if (A.length && A[0].constructor == Array) {
++			return [A.length, A[0].length];
++		} else {
++			return [A.length];
++		}
++	} else if (nargs == 2) {
++		if (typeof(dim) != 'number' || dim < 0 || dim > 1) {
++			error('size: dim argument must be a number between 0 and 1, inclusive');
++		}
++		if (dim == 0) {
++			if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
++				return 1;
++			} else {
++				return A.length;
++			}
++		} else {
++			if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
++				return 1;
++			} else if (typeof(A) == 'undefined' || isNaN(A)) {
++				return 0;
++			} else if (A[0].constructor != Array) {
++				error('size: A[0] is not an Array');
++			}
++			return A[0].length;
++		}
++	} else {
++		error('size: functionality for more than 2 arguments is not currently implemented');
++	}
++} //}}}
++
++/**
++ * FUNCTION strcmpi - Compare strings (case insensitive)
++ *
++ * Replicates behavior of MATLAB's 'strcmpi' function
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/strcmpi.html
++ */
++function strcmpi(s1, s2) {//{{{
++	return s1.toLowerCase() == s2.toLowerCase();
++} //}}}
++
++/**
++ * FUNCTION sum - Sum of array elements
++ *
++ * Replicates behavior of MATLAB's 'sum' function
++ * 
++ * Sum(A) returns the sum of the elements of A along the first array dimension 
++ * whose size does not equal 1.
++ * - If A is a 1D array, then sum(A) returns the sum of the elements
++ *
++ * Usage:
++ *     S = sum(A)
++ * 
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/sum.html
++ *
++ * NOTE:
++ * - Not all functionality is implemented
++ */
++function sum(A) {//{{{
++	return A.reduce((x, y) => x + y);
++} //}}}
++
++/**
++ * FUNCTION zeros - Create array of all zeros
++ *
++ * Replicates behavior of MATLAB's 'zeros' function
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/ref/zeros.html
++ *
++ * NOTE:
++ * - Current behavior is to initialize and return a 1D array of length 'size'
++ *
++ * TODO:
++ * - Implement actual behavior of MATLAB's 'ones' function
++ */
++function zeros(size, size2) {//{{{
++	if (size2 !== undefined) {
++		return NewArrayFill2D(size, size2, 0);
++	} else {
++		return NewArrayFill(size, 0);
++	}
++} //}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26308-26309.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26308-26309.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26308-26309.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/m/solvers/mumpsoptions.js
+===================================================================
+--- ../trunk-jpl/src/m/solvers/mumpsoptions.js	(nonexistent)
++++ ../trunk-jpl/src/m/solvers/mumpsoptions.js	(revision 26309)
+@@ -0,0 +1,25 @@
++function mumpsoptions(){
++//MUMPSOPTIONS - 
++//
++//   Usage:
++//      options=mumpsoptions(varargin);
++
++	//Retrieve options provided in varargin. First convert arguments to array:
++	var args = Array.prototype.slice.call(arguments);
++
++	//Then process options
++	var  options = new pairoptions(args.slice(1,args.length));
++
++	//default issmoptions options
++	var mumpsoptions={};
++	mumpsoptions['toolkit']='petsc';
++	mumpsoptions['mat_type']=options.getfieldvalue('mat_type','mpiaij');
++	mumpsoptions['ksp_type']=options.getfieldvalue('ksp_type','preonly');
++	mumpsoptions['pc_type']=options.getfieldvalue('pc_type','lu');
++	mumpsoptions['pc_factor_mat_solver_type']=options.getfieldvalue('pc_factor_mat_solver_type','mumps');
++	mumpsoptions['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120);
++	mumpsoptions['mat_mumps_icntl_28']=options.getfieldvalue('mat_mumps_icntl_28',2);
++	mumpsoptions['mat_mumps_icntl_29']=options.getfieldvalue('mat_mumps_icntl_29',2);
++
++	return mumpsoptions;
++}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26309-26310.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26309-26310.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26309-26310.diff	(revision 26740)
@@ -0,0 +1,605 @@
+Index: ../trunk-jpl/src/m/classes/hydrologyshreve.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26309)
++++ ../trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26310)
+@@ -36,7 +36,7 @@
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember('HydrologyShreveAnalysis',analyses) |  (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
++			if ~ismember('HydrologyShreveAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
+ 
+ 			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','hydrology.stabilization','>=',0);
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.js
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.js	(revision 26309)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.js	(revision 26310)
+@@ -9,12 +9,12 @@
+ NOTE:
+ - We cannot implement the following MATLAB built-in functions by name as their
+ names are reserved keywords in JavaScript,
+-	class
++    class
+ 
+ TODO:
+ - Implement,
+-	sort
+-	unique
++    sort
++    unique
+ 
+ Sources:
+ - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords
+@@ -35,12 +35,12 @@
+  * - Only basic functionality is implemented
+  */
+ function any(A) {//{{{
+-	for (let i = 0; i < A.length; ++i) {
+-		if (A[i] !== 0) {
+-			return true;
+-		}
+-	}
+-	return false;
++    for (let i = 0; i < A.length; ++i) {
++        if (A[i] !== 0) {
++            return true;
++        }
++    }
++    return false;
+ } //}}}
+ 
+ /**
+@@ -60,11 +60,11 @@
+  * - Not all functionality is implemented
+  */
+ function diff(X) {//{{{
+-	let diffs = [];
+-	for (let i = 0; i < X.length - 1; ++i) {
+-		diffs[i] = X[i + 1] - X[i];
+-	}
+-	return diffs;
++    let diffs = [];
++    for (let i = 0; i < (X.length - 1); ++i) {
++        diffs[i] = X[i + 1] - X[i];
++    }
++    return diffs;
+ } //}}}
+ 
+ /**
+@@ -81,7 +81,7 @@
+  * - https://www.mathworks.com/help/matlab/ref/disp.html
+  */
+ function disp(X) {//{{{
+-	console.log(X);
++    console.log(X);
+ } //}}}
+ 
+ /**
+@@ -99,7 +99,7 @@
+  * - Only basic functionality is implemented
+  */
+ function error(msg) {//{{{
+-	throw new Error(msg);
++    throw new Error(msg);
+ } //}}}
+ 
+ /**
+@@ -116,27 +116,27 @@
+  * - Implement 'direction' parameter
+  */
+ function find(X, n, direction) {//{{{
+-	if (typeof(X[0]) == 'number') {
+-		let indices = [];
+-		for (let i = 0; i < X.length; ++i) {
+-			if (X[i] != 0) {
+-				indices.push(i);
+-			}
+-		}
+-		return indices;
+-	} else { //TODO: If 2d array, assume return rows & cols - try to find a way to not always return rows/cols
+-		let rowindices = [];
+-		let colindices = [];
+-		for (let i = 0; i < X.length; ++i) {
+-			for (let j = 0; j < X[i].length; ++j) {
+-				if (X[i][j] != 0) {
+-					rowindices.push(i);
+-					colindices.push(j);
+-				}
+-			}
+-		}
+-		return [rowindices, colindices];
+-	}
++    if (typeof(X[0]) == 'number') {
++        let indices = [];
++        for (let i = 0; i < X.length; ++i) {
++            if (X[i] != 0) {
++                indices.push(i);
++            }
++        }
++        return indices;
++    } else { //TODO: If 2d array, assume return rows & cols - try to find a way to not always return rows/cols
++        let rowindices = [];
++        let colindices = [];
++        for (let i = 0; i < X.length; ++i) {
++            for (let j = 0; j < X[i].length; ++j) {
++                if (X[i][j] != 0) {
++                    rowindices.push(i);
++                    colindices.push(j);
++                }
++            }
++        }
++        return [rowindices, colindices];
++    }
+ } //}}}
+ 
+ /**
+@@ -151,12 +151,12 @@
+  * - Implement support for multidimensional arrays
+  */
+ function isempty(A) {//{{{
+-	//NOTE: Expanded for clarity/debugging. Can reduce later.
+-	if (A === undefined) {
+-		return 1; //TODO: Fix this: for now, treat undefined as empty
+-	} else {
+-		return A.length == 0;
+-	}
++    //NOTE: Expanded for clarity/debugging. Can reduce later.
++    if (A === undefined) {
++        return 1; //TODO: Fix this: for now, treat undefined as empty
++    } else {
++        return A.length == 0;
++    }
+ } //}}}
+ 
+ /**
+@@ -174,23 +174,23 @@
+  * - Implement support for multidimensional arrays
+  */
+ function ismember(A, B) {//{{{
+-	let b = B;
+-	if (typeof(B) == 'number' || typeof(B) == 'string') {
+-		b = [B];
+-	}
+-	let indices = zeros(A.length);
+-	for (let i = 0; i < A.length; ++i) {
+-		for (let j = 0; j < b.length; ++j) {
+-			if (A[i] === b[j]) {
+-				indices[i] = 1;
+-			}
+-		}
+-	}
+-	if (indices.length) {
+-		return indices;
+-	} else {
+-		return 0;
+-	}
++    let b = B;
++    if (typeof(B) == 'number' || typeof(B) == 'string') {
++        b = [B];
++    }
++    let indices = zeros(A.length);
++    for (let i = 0; i < A.length; ++i) {
++        for (let j = 0; j < b.length; ++j) {
++            if (A[i] === b[j]) {
++                indices[i] = 1;
++            }
++        }
++    }
++    if (indices.length) {
++        return indices;
++    } else {
++        return 0;
++    }
+ } //}}}
+ 
+ /**
+@@ -210,18 +210,18 @@
+  * - Not to be confused with function Number.isNaN
+  */
+ function isnan(A) {//{{{
+-	if (A.constructor !== Array) {
+-		error('isnan: argument must be an array')
+-	}
+-	is_nan = [];
+-	for (let i = 0; i < A.length; ++i) {
+-		if (Number.isNaN(A[i])) {
+-			is_nan.push(1);
+-		} else {
+-			is_nan.push(0);
+-		}
+-	}
+-	return is_nan;
++    if (A.constructor !== Array) {
++        error('isnan: argument must be an array')
++    }
++    is_nan = [];
++    for (let i = 0; i < A.length; ++i) {
++        if (Number.isNaN(A[i])) {
++            is_nan.push(1);
++        } else {
++            is_nan.push(0);
++        }
++    }
++    return is_nan;
+ } //}}}/*
+ 
+ /**
+@@ -239,7 +239,7 @@
+  * - Implement support for multidimensional arrays
+  */
+ function length(A) {//{{{
+-	return A.length;
++    return A.length;
+ } //}}}/*
+ 
+ /**
+@@ -258,7 +258,7 @@
+  * - Implement 'nanflag' parameter
+  */
+ function max(A) {//{{{
+-	return Math.max.apply(null, A);
++    return Math.max.apply(null, A);
+ } //}}}/*
+ 
+ /**
+@@ -277,44 +277,46 @@
+  * - Implement 'nanflag' parameter
+  */
+ function min(A) {//{{{
+-	return Math.min.apply(null, A);
++    return Math.min.apply(null, A);
+ } //}}}/*
+ 
+ /**
+- * FUNCTION sum - Sum of elements of an array
++ * FUNCTION ones - Create array of all ones
+  *
+- * Replicates behavior of MATLAB's 'sum' function
+- *
++ * Replicates behavior of MATLAB's 'zeros' function
++ * 
+  * Usage:
+- *     S = sum(A)
++ *     X = ones
++ *     X = ones(n)
++ *     X = ones(sz1,...,szN)
++ *     X = ones(sz)
+  *
+  * Sources:
+- * - https://www.mathworks.com/help/matlab/ref/sum.html
+- *
+- * TODO:
+- * - Implement support for multidimensional arrays
+- * - Implement 'nanflag' parameter
+- */
+-function sum(A) {//{{{
+-	return ArraySum(A);
+-} //}}}/*
+-
+-/**
+- * FUNCTION ones - Create array of all ones
+- *
+- * Replicates behavior of MATLAB's 'ones' function
+- *
+- * Sources:
+  * - https://www.mathworks.com/help/matlab/ref/ones.html
+  *
+- * NOTE:
+- * - Current behavior is to initialize and return a 1D array of length 'size'
+- *
+  * TODO:
+- * - Implement actual behavior of MATLAB's 'ones' function
++ * - Create lower-level function to handle both ones and zeros functions as 
++ * they are essentially the same
++ * - Implement functionality for more than 2 dimensions
+  */
+-function ones(size) {//{{{
+-	return NewArrayFill(size, 1);
++function ones() {//{{{
++    nargs = arguments.length;
++    if (nargs == 0) {
++        return 1;
++    } else if (nargs == 1) {
++        let arg = arguments[0];
++        if (typeof(arg) == 'number') {
++            return NewArrayFill(arg, 1);
++        } else if (arg.constructor == Array) {
++            return ones(...arg); // spread array of sizes
++        } else {
++            error('ones: functionality for greater than 2 dimensions is not currently implemented')
++        }
++    } else if (nargs == 2) {
++        return NewArrayFill2D(arguments[0], arguments[1], 1);
++    } else {
++        error('ones: functionality for greater than 2 dimensions is not currently implemented')
++    }
+ } //}}}
+ 
+ /**
+@@ -336,45 +338,45 @@
+  * function.
+  */
+ function size(A, dim) {//{{{
+-	let nargs = arguments.length;
+-	if (nargs == 0) {
+-		error('size: at least one argument is required');
+-	} else if (nargs == 1) {
+-		if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+-			return [1, 1];
+-		} else if (A.constructor != Array) {
+-			error('size: A argument must be a number or an Array');
+-		}
+-		if (typeof(A) == 'undefined' || isNaN(A)) {
+-			return [0];
+-		} else if (A.length && A[0].constructor == Array) {
+-			return [A.length, A[0].length];
+-		} else {
+-			return [A.length];
+-		}
+-	} else if (nargs == 2) {
+-		if (typeof(dim) != 'number' || dim < 0 || dim > 1) {
+-			error('size: dim argument must be a number between 0 and 1, inclusive');
+-		}
+-		if (dim == 0) {
+-			if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+-				return 1;
+-			} else {
+-				return A.length;
+-			}
+-		} else {
+-			if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+-				return 1;
+-			} else if (typeof(A) == 'undefined' || isNaN(A)) {
+-				return 0;
+-			} else if (A[0].constructor != Array) {
+-				error('size: A[0] is not an Array');
+-			}
+-			return A[0].length;
+-		}
+-	} else {
+-		error('size: functionality for more than 2 arguments is not currently implemented');
+-	}
++    let nargs = arguments.length;
++    if (nargs == 0) {
++        error('size: at least one argument is required');
++    } else if (nargs == 1) {
++        if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
++            return [1, 1];
++        } else if (A.constructor != Array) {
++            error('size: A argument must be a number or an Array');
++        }
++        if (typeof(A) == 'undefined' || isNaN(A)) {
++            return [0];
++        } else if (A.length && A[0].constructor == Array) {
++            return [A.length, A[0].length];
++        } else {
++            return [A.length];
++        }
++    } else if (nargs == 2) {
++        if (typeof(dim) != 'number' || dim < 0 || dim > 1) {
++            error('size: dim argument must be a number between 0 and 1, inclusive');
++        }
++        if (dim == 0) {
++            if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
++                return 1;
++            } else {
++                return A.length;
++            }
++        } else {
++            if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
++                return 1;
++            } else if (typeof(A) == 'undefined' || isNaN(A)) {
++                return 0;
++            } else if (A[0].constructor != Array) {
++                error('size: A[0] is not an Array');
++            }
++            return A[0].length;
++        }
++    } else {
++        error('size: functionality for more than 2 arguments is not currently implemented');
++    }
+ } //}}}
+ 
+ /**
+@@ -386,29 +388,26 @@
+  * - https://www.mathworks.com/help/matlab/ref/strcmpi.html
+  */
+ function strcmpi(s1, s2) {//{{{
+-	return s1.toLowerCase() == s2.toLowerCase();
++    return s1.toLowerCase() == s2.toLowerCase();
+ } //}}}
+ 
+ /**
+- * FUNCTION sum - Sum of array elements
++ * FUNCTION sum - Sum of elements of an array
+  *
+  * Replicates behavior of MATLAB's 'sum' function
+- * 
+- * Sum(A) returns the sum of the elements of A along the first array dimension 
+- * whose size does not equal 1.
+- * - If A is a 1D array, then sum(A) returns the sum of the elements
+  *
+  * Usage:
+  *     S = sum(A)
+- * 
++ *
+  * Sources:
+  * - https://www.mathworks.com/help/matlab/ref/sum.html
+  *
+- * NOTE:
+- * - Not all functionality is implemented
++ * TODO:
++ * - Implement support for multidimensional arrays
++ * - Implement 'nanflag' parameter
+  */
+ function sum(A) {//{{{
+-	return A.reduce((x, y) => x + y);
++    return ArraySum(A);
+ } //}}}
+ 
+ /**
+@@ -415,20 +414,153 @@
+  * FUNCTION zeros - Create array of all zeros
+  *
+  * Replicates behavior of MATLAB's 'zeros' function
++ * 
++ * Usage:
++ *     X = zeros
++ *     X = zeros(n)
++ *     X = zeros(sz1,...,szN)
++ *     X = zeros(sz)
+  *
+  * Sources:
+  * - https://www.mathworks.com/help/matlab/ref/zeros.html
+  *
+- * NOTE:
+- * - Current behavior is to initialize and return a 1D array of length 'size'
+- *
+  * TODO:
+- * - Implement actual behavior of MATLAB's 'ones' function
++ * - Create lower-level function to handle both ones and zeros functions as 
++ * they are essentially the same
++ * - Implement functionality for more than 2 dimensions
+  */
+-function zeros(size, size2) {//{{{
+-	if (size2 !== undefined) {
+-		return NewArrayFill2D(size, size2, 0);
+-	} else {
+-		return NewArrayFill(size, 0);
+-	}
++function zeros() {//{{{
++    nargs = arguments.length;
++    if (nargs == 0) {
++        return 0;
++    } else if (nargs == 1) {
++        let arg = arguments[0];
++        if (typeof(arg) == 'number') {
++            return NewArrayFill(arg, 0);
++        } else if (arg.constructor == Array) {
++            return zeros(...arg); // spread array of sizes
++        } else {
++            error('zeros: functionality for greater than 2 dimensions is not currently implemented')
++        }
++    } else if (nargs == 2) {
++        return NewArrayFill2D(arguments[0], arguments[1], 0);
++    } else {
++        error('zeros: functionality for greater than 2 dimensions is not currently implemented')
++    }
+ } //}}}
++
++/**
++ * FUNCTIONS sin, cos, tan, asin, acos, atan2 - trig functions that work with radians
++ *
++ * Replicates behavior of MATLAB's trig functions
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/trigonometry.html
++ *
++ */
++function sin(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.sin(X[i]);
++    }
++    return result;
++} //}}}
++
++function cos(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.cos(X[i]);
++    }
++    return result;
++} //}}}
++
++function tan(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.tan(X[i]);
++    }
++    return result;
++} //}}}
++
++function asin(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.asin(X[i]);
++    }
++    return result;
++} //}}}
++
++function acos(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.acos(X[i]);
++    }
++    return result;
++} //}}}
++
++// TODO: Test that the arguments do not need to be reversed, as they are in MATLAB and Python
++function atan2(X, Y) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.atan2(X[i], Y[i]);
++    }
++    return result;
++} //}}}
++
++/**
++ * FUNCTIONS sind, cosd, tand, asind, acosd, atan2d - trig functions that work with degrees
++ *
++ * Replicates behavior of MATLAB's trig functions
++ *
++ * Sources:
++ * - https://www.mathworks.com/help/matlab/trigonometry.html
++ *
++ */
++function sind(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.sin(X[i] * DEG2RAD);
++    }
++    return result;
++} //}}}
++
++function cosd(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.cos(X[i] * DEG2RAD);
++    }
++    return result;
++} //}}}
++
++function tand(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = Math.tan(X[i] * DEG2RAD);
++    }
++    return result;
++} //}}}
++
++function asind(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = RAD2DEG * Math.asin(X[i]);
++    }
++    return result;
++} //}}}
++
++function acosd(X) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = RAD2DEG * Math.acos(X[i]);
++    }
++    return result;
++} //}}}
++
++// TODO: Test that the arguments do not need to be reversed, as they are in MATLAB and Python
++function atan2d(X, Y) {//{{{
++    let result = NewArrayFill(size, X.length);
++    for (let i = 0; i < X.length; ++i) {
++        result[i] = RAD2DEG * Math.atan2(X[i], Y[i]);
++    }
++    return result;
++} //}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26310-26311.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26310-26311.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26310-26311.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/c/shared/MemOps/MemOps.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 26310)
++++ ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 26311)
+@@ -6,6 +6,7 @@
+ #define _MEM_OPS_H_
+ 
+ #include <cassert>
++#include <cstring> /*for memcpy*/
+ 
+ /* memory management of types T with non-trivial constructors require C++ style memory management*/
+ #define USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
+@@ -67,8 +68,7 @@
+ #else
+   T* aT_p=xNew<T>(size);
+ #endif
+-  for (unsigned int i=0; i<size;++i) 
+-    aT_p[i]=(T)0;
++  for(unsigned int i=0; i<size;++i) aT_p[i]=(T)0;
+   return aT_p;
+ #else
+   T* aT_p=(T*)calloc(size,sizeof(T));
+@@ -79,8 +79,7 @@
+ template <class T> T** xNewZeroInit(unsigned int dim1, unsigned int dim2) {/*{{{*/
+ #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
+   T** aT_pp=xNew<T>(dim1,dim2);
+-  for (unsigned int i=0; i<dim1*dim2;++i)
+-    (*aT_pp)[i]=(T)0;
++  for (unsigned int i=0; i<dim1*dim2;++i) (*aT_pp)[i]=(T)0;
+   return aT_pp;
+ #else
+   T* buf=(T*)calloc(dim1*dim2*sizeof(T));
+@@ -151,8 +150,8 @@
+ }/*}}}*/
+ template <class T>  T* xMemCpy(T* dest, const T* src, unsigned int size) {/*{{{*/
+   assert(dest); assert(src);
+-  for (int i=0; i<size;++i) 
+-    dest[i]=src[i];
++  //for (int i=0; i<size;++i) dest[i]=src[i]; //OLD
++  memcpy(dest,src,size*sizeof(T)); //NEW
+   return dest;
+ };
+ /*}}}*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26311-26312.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26311-26312.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26311-26312.diff	(revision 26740)
@@ -0,0 +1,405 @@
+Index: ../trunk-jpl/src/m/classes/materials.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.js	(revision 26311)
++++ ../trunk-jpl/src/m/classes/materials.js	(revision 26312)
+@@ -1,4 +1,4 @@
+-class materials {//{{{
++class materials {
+ 	/**
+ 	 * MATERIALS class definition
+ 	 *
+@@ -10,9 +10,9 @@
+ 
+ 		let nargs = arguments.length;
+ 		if (nargs == 0) {
+-			this.nature = ['ice'];
++			this.nature=['ice'];
+ 		} else {
+-			this.nature = arguments;
++			this.nature=arguments;
+ 		}
+ 
+ 		// Check this is acceptable
+@@ -23,149 +23,206 @@
+ 		}
+ 
+ 		// Start filling in the dynamic fields (not truly dynamic under JavaScript)
+-		for (let i = 0; i < this.nature.length; ++i) {
++		for (let i = 0; i < length(this.nature); ++i) {
+ 			let nat = this.nature[i];
+-			if (nat == 'ice') {
+-				this.rho_ice = 0;
+-				this.rho_water = 0;
+-				this.rho_freshwater = 0;
+-				this.mu_water = 0;
+-				this.heatcapacity = 0;
+-				this.latentheat = 0;
+-				this.thermalconductivity = 0;
+-				this.temperateiceconductivity = 0;
+-				this.effectiveconductivity_averaging = 0;
+-				this.meltingpoint = 0;
+-				this.beta = 0;
+-				this.mixed_layer_capacity = 0;
+-				this.thermal_exchange_velocity = 0;
+-				this.rheology_B = 0;
+-				this.rheology_n = 0;
+-				this.rheology_law = 0;
+-			} else if (nat == 'litho') {
+-				this.numlayers = 0;
+-				this.radius = 0;
+-				this.viscosity = 0;
+-				this.lame_lambda = 0;
+-				this.lame_mu = 0;
+-				this.burgers_viscosity = 0;
+-				this.burgers_mu = 0;
+-				this.ebm_alpha = 0;
+-				this.ebm_delta = 0;
+-				this.ebm_taul = 0;
+-				this.ebm_tauh = 0;
+-				this.rheologymodel = 0;
+-				this.density = 0;
+-				this.issolid = 0;
+-			} else if (nat == 'hydro') {
+-				this.rho_ice = 0;
+-				this.rho_water = 0;
+-				this.rho_freshwater = 0;
+-			} else {
+-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++			switch (nat) {
++				case 'ice':
++					this.rho_ice = 0;
++					this.rho_water = 0;
++					this.rho_freshwater = 0;
++					this.mu_water = 0;
++					this.heatcapacity = 0;
++					this.latentheat = 0;
++					this.thermalconductivity = 0;
++					this.temperateiceconductivity = 0;
++					this.effectiveconductivity_averaging = 0;
++					this.meltingpoint = 0;
++					this.beta = 0;
++					this.mixed_layer_capacity = 0;
++					this.thermal_exchange_velocity = 0;
++					this.rheology_B = 0;
++					this.rheology_n = 0;
++					this.rheology_law = 0;
++					break;
++				case 'litho':
++					this.numlayers = 0;
++					this.radius = 0;
++					this.viscosity = 0;
++					this.lame_lambda = 0;
++					this.lame_mu = 0;
++					this.burgers_viscosity = 0;
++					this.burgers_mu = 0;
++					this.ebm_alpha = 0;
++					this.ebm_delta = 0;
++					this.ebm_taul = 0;
++					this.ebm_tauh = 0;
++					this.rheologymodel = 0;
++					this.density = 0;
++					this.issolid = 0;
++					break;
++				case 'hydro':
++					this.rho_ice = 0;
++					this.rho_water = 0;
++					this.rho_freshwater = 0;
++					break;
++				default:
++					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+ 			}
++			this.earth_density = 0;
++
++			// Set default parameters
++			this.setdefaultparameters();
+ 		}
+-		this.earth_density = 0;
+-
+-		// Set default parameters
+-		this.setdefaultparameters();
+ 	} //}}}
++	disp() {//{{{
++		console.log(sprintf('   Materials:'));
+ 
+-	disp() {//{{{
+-		console.log('WARNING: materials::disp is not yet implemented');
++		for (let i = 0; i < length(this.nature); ++i) {
++			let nat = this.nature[i];
++			switch (nat) {
++				case 'ice':
++					console.log(sprintf('   \nIce:'));
++					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
++					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
++					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
++					fielddisplay(this,'mu_water','water viscosity [N s/m^2]');
++					fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
++					fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
++					fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
++					fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
++					fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
++					fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
++					fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
++					fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
++					fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
++					fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
++					fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\'');
++					break;
++				case 'litho':
++					console.log(sprintf('   \nLitho:'));
++					fielddisplay(this,'numlayers','number of layers (default: 2)');
++					fielddisplay(this,'radius','array describing the radius for each interface (numlayers+1) [m]');
++					fielddisplay(this,'viscosity','array describing each layer\'s viscosity (numlayers) [Pa.s]');
++					fielddisplay(this,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]');
++					fielddisplay(this,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]');
++					fielddisplay(this,'burgers_viscosity','array describing each layer\'s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]');
++					fielddisplay(this,'burgers_mu','array describing each layer\'s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]');
++
++					fielddisplay(this,'ebm_alpha','array describing each layer\'s exponent parameter controlling the shape of shear modulus curve between taul and tauh, only for EBM rheology (numlayers)');
++					fielddisplay(this,'ebm_delta','array describing each layer\'s amplitude of the transient relaxation (ratio between elastic rigity to pre-maxwell relaxation rigity), only for EBM rheology (numlayers)');
++					fielddisplay(this,'ebm_taul','array describing each layer\'s starting period for transient relaxation, only for EBM rheology  (numlayers) [s]');
++					fielddisplay(this,'ebm_tauh','array describing each layer\'s array describing each layer\'s end period for transient relaxation, only for Burgers rheology (numlayers) [s]');
++
++					fielddisplay(this,'rheologymodel','array describing whether we adopt a Maxwell (0), Burgers (1) or EBM (2) rheology (default: 0)');
++					fielddisplay(this,'density','array describing each layer\'s density (numlayers) [kg/m^3]');
++					fielddisplay(this,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
++					break;
++				case 'hydro':
++					console.log(sprintf('   \nHydro:'));
++					fielddisplay(this,'rho_ice','ice density [kg/m^3]');
++					fielddisplay(this,'rho_water','ocean water density [kg/m^3]');
++					fielddisplay(this,'earth_density','mantle density [kg/m^3]');
++					fielddisplay(this,'rho_freshwater','fresh water density [kg/m^3]');
++					break;
++				default:
++					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++			}
++		}
+ 	} //}}}
+-
+ 	setdefaultparameters() {//{{{
+ 		for (let i = 0; i < this.nature.length; ++i) {
+ 			let nat = this.nature[i];
+-			if (nat == 'ice') {
+-				// Ice density (kg/m^3)
+-				this.rho_ice = 917;
++			switch (nat) {
++				case 'ice':
++					// Ice density (kg/m^3)
++					this.rho_ice = 917;
+ 
+-				// Ocean water density (kg/m^3)
+-				this.rho_water = 1023
++					// Ocean water density (kg/m^3)
++					this.rho_water = 1023
+ 
+-				// Fresh water density (kg/m^3)
+-				this.rho_freshwater = 1000;
++					// Fresh water density (kg/m^3)
++					this.rho_freshwater = 1000;
+ 
+-				// Water viscosity (N.s/m^2)
+-				this.mu_water = 0.001787;
++					// Water viscosity (N.s/m^2)
++					this.mu_water = 0.001787;
+ 
+-				// Ice heat capacity cp (J/kg/K)
+-				this.heatcapacity = 2093;
++					// Ice heat capacity cp (J/kg/K)
++					this.heatcapacity = 2093;
+ 
+-				// Ice latent heat of fusion L (J/kg)
+-				this.latentheat = 3.34 * 1e5;
++					// Ice latent heat of fusion L (J/kg)
++					this.latentheat = 3.34 * 1e5;
+ 
+-				// Ice thermal conductivity (W/m/K)
+-				this.thermalconductivity = 2.4;
++					// Ice thermal conductivity (W/m/K)
++					this.thermalconductivity = 2.4;
+ 
+-				// Wet ice thermal conductivity (W/m/K)
+-				this.temperateiceconductivity = 0.24;
++					// Wet ice thermal conductivity (W/m/K)
++					this.temperateiceconductivity = 0.24;
+ 
+-				// Computation of effective conductivity
+-				this.effectiveconductivity_averaging = 1;
++					// Computation of effective conductivity
++					this.effectiveconductivity_averaging = 1;
+ 
+-				// The melting point of ice at 1 atmosphere of pressure in K
+-				this.meltingpoint = 273.15;
++					// The melting point of ice at 1 atmosphere of pressure in K
++					this.meltingpoint = 273.15;
+ 
+-				// Rate of change of melting point with pressure (K/Pa)
+-				this.beta = 9.8 * 1e-8;
++					// Rate of change of melting point with pressure (K/Pa)
++					this.beta = 9.8 * 1e-8;
+ 
+-				// Mixed layer (ice-water interface) heat capacity (J/kg/K)
+-				this.mixed_layer_capacity = 3974;
++					// Mixed layer (ice-water interface) heat capacity (J/kg/K)
++					this.mixed_layer_capacity = 3974;
+ 
+-				// Thermal exchange velocity (ice-water interface) (m/s)
+-				this.thermal_exchange_velocity = 1.00 * 1e-4;
++					// Thermal exchange velocity (ice-water interface) (m/s)
++					this.thermal_exchange_velocity = 1.00 * 1e-4;
+ 
+-				// Rheology law: what is the temperature dependence of B with T
+-				// available: none, paterson and arrhenius
+-				this.rheology_law = 'Paterson';
++					// Rheology law: what is the temperature dependence of B with T
++					// available: none, paterson and arrhenius
++					this.rheology_law = 'Paterson';
+ 
+-				// Rheology fields default
+-				this.rheology_B = 1 * 1e8;
+-				this.rheology_n = 3;
+-			} else if (nat == 'litho') {
+-				// We default to a configuration that enables running GIA 
+-				// solutions using giacaron and/or giaivins
+-				this.numlayers = 2;
++					// Rheology fields default
++					this.rheology_B = 1 * 1e8;
++					this.rheology_n = 3;
++					break;
++				case 'litho':
++					// We default to a configuration that enables running GIA 
++					// solutions using giacaron and/or giaivins
++					this.numlayers = 2;
+ 
+-				// Center of the earth (approximation, must not be 0), then the 
+-				// lab (lithosphere/asthenosphere boundary) then the surface
+-				// (with 1d3 to avoid numerical singularities)
+-				this.radius = [1e3, 6278 * 1e3, 6378 * 1e3];
++					// Center of the earth (approximation, must not be 0), then the 
++					// lab (lithosphere/asthenosphere boundary) then the surface
++					// (with 1d3 to avoid numerical singularities)
++					this.radius = [1e3, 6278 * 1e3, 6378 * 1e3];
+ 
+-				this.viscosity = [1e21, 1e40]; // Mantle and lithosphere viscosity (respectively) [Pa.s]
+-				this.lame_mu = [1.45 * 1e11, 6.7 * 1e10]; // (Pa) // Lithosphere and mantle shear modulus (respectively) [Pa]
+-				this.lame_lambda = this.lame_mu; // (Pa) // Mantle and lithosphere lamba parameter (respectively) [Pa]
+-				this.burgers_viscosity = [NaN, NaN];
+-				this.burgers_mu = [NaN, NaN];
++					this.viscosity = [1e21, 1e40]; // Mantle and lithosphere viscosity (respectively) [Pa.s]
++					this.lame_mu = [1.45 * 1e11, 6.7 * 1e10]; // (Pa) // Lithosphere and mantle shear modulus (respectively) [Pa]
++					this.lame_lambda = this.lame_mu; // (Pa) // Mantle and lithosphere lamba parameter (respectively) [Pa]
++					this.burgers_viscosity = [NaN, NaN];
++					this.burgers_mu = [NaN, NaN];
+ 
+-				this.ebm_alpha = [NaN, NaN];
+-				this.ebm_delta = [NaN, NaN];
+-				this.ebm_taul = [NaN, NaN];
+-				this.ebm_tauh = [NaN, NaN];
+-				this.rheologymodel = [0, 0];
+-				this.density = [5.51 * 1e3, 5.50 * 1e3]; // (Pa) // Mantle and lithosphere density [kg/m^3]
+-				this.issolid = [1, 1]; // Is layer solid or liquid?
+-			} else if (nat == 'hydro') {
+-				// Ice density (kg/m^3)
+-				this.rho_ice = 917;
++					this.ebm_alpha = [NaN, NaN];
++					this.ebm_delta = [NaN, NaN];
++					this.ebm_taul = [NaN, NaN];
++					this.ebm_tauh = [NaN, NaN];
++					this.rheologymodel = [0, 0];
++					this.density = [5.51 * 1e3, 5.50 * 1e3]; // (Pa) // Mantle and lithosphere density [kg/m^3]
++					this.issolid = [1, 1]; // Is layer solid or liquid?
++					break;
++				case 'hydro':
++					// Ice density (kg/m^3)
++					this.rho_ice = 917;
+ 
+-				// Ocean water density (kg/m^3)
+-				this.rho_water = 1023;
++					// Ocean water density (kg/m^3)
++					this.rho_water = 1023;
+ 
+-				// Fresh water density (kg/m^3)
+-				this.rho_freshwater = 1000;
+-			} else {
+-				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++					// Fresh water density (kg/m^3)
++					this.rho_freshwater = 1000;
++					break;
++				default:
++					error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+ 			}
+ 
+ 			// Average density of the Earth (kg/m^3)
+-			this.earth_density=5512;
++			this.earth_density = 5512;
+ 		}
+ 	} //}}}
+-
+ 	checkconsistency(md, solution, analyses) {//{{{
+ 		for (let i = 0; i < this.nature.length; ++i) {
+ 			let nat = this.nature[i];
+@@ -224,7 +281,6 @@
+ 
+ 		return md;
+ 	} //}}}
+-
+ 	marshall(md, prefix, fid) {//{{{
+ 		// 1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+ 		WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(this.nature), 'format', 'IntMat', 'mattype', 3);
+@@ -280,7 +336,6 @@
+ 			WriteData(fid, prefix, 'data', this.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double');
+ 		}
+ 	} //}}}
+-
+ 	extrude(md) {//{{{
+ 		for (let i = 0; i < this.nature.length; ++i) {
+ 			let nat = this.nature[i];
+@@ -295,24 +350,31 @@
+ function naturetointeger(strnat) {//{{{
+ 	let intnat = zeros(strnat.length, 1);
+ 	for (let i = 0; i < strnat.length; ++i) {
+-		let str_nat = strnat[i];
+-		if (str_nat == 'damageice') {
+-			intnat[i] = 1;
+-		} else if (str_nat == 'estar') {
+-			intnat[i] = 2;
+-		} else if (str_nat == 'ice') {
+-			intnat[i] = 3;
+-		} else if (str_nat == 'enhancedice') {
+-			intnat[i] = 4;
+-		//} else if (str_nat == 'materials') { // This case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
+-		//	intnat[i] = 5;
+-		} else if (str_nat == 'litho') {
+-			intnat[i] = 6;
+-		} else if (str_nat == 'hydro') {
+-			intnat[i] = 7;
+-		} else {
+-			error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
++		switch (strnat[i]) {
++			case 'damageice':
++				intnat[i] = 1;
++				break;
++			case 'estar':
++				intnat[i] = 2;
++				break;
++			case 'ice':
++				intnat[i] = 3;
++				break;
++			case 'enhancedice':
++				intnat[i] = 4;
++				break;
++			//case 'materials': // This case will never happen, kept to ensure equivalent of codes between IoCodeToMaterialsEnum and IoCodeToNatureEnum
++			//	intnat[i] = 5;
++			//	break;
++			case 'litho':
++				intnat[i] = 6;
++				break;
++			case 'hydro':
++				intnat[i] = 7;
++				break;
++			default:
++				error('materials constructor error message: nature of the material not supported yet! (\'ice\' or \'litho\' or \'hydro\')');
+ 		}
+ 	}
+ 	return intnat;
+-} //}}}
++}// }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26312-26313.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26312-26313.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26312-26313.diff	(revision 26740)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/c/shared/MemOps/MemOps.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 26312)
++++ ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 26313)
+@@ -150,8 +150,11 @@
+ }/*}}}*/
+ template <class T>  T* xMemCpy(T* dest, const T* src, unsigned int size) {/*{{{*/
+   assert(dest); assert(src);
+-  //for (int i=0; i<size;++i) dest[i]=src[i]; //OLD
+-  memcpy(dest,src,size*sizeof(T)); //NEW
++  #if defined(_HAVE_ADOLC_)
++  for (int i=0; i<size;++i) dest[i]=src[i];
++  #else
++  memcpy(dest,src,size*sizeof(T));
++  #endif
+   return dest;
+ };
+ /*}}}*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26313-26314.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26313-26314.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26313-26314.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/plot/applyoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/applyoptions.m	(revision 26313)
++++ ../trunk-jpl/src/m/plot/applyoptions.m	(revision 26314)
+@@ -51,7 +51,7 @@
+ set(gca,'FontSize',getfieldvalue(options,'axisfontsize',fontsize));;
+ if exist(options,'axis')
+ 	axisopts = getfieldvalue(options,'axis');
+-	if ischar(axisopts) & contains(axisopts,' ');
++	if ischar(axisopts) & any(axisopts==' ');
+ 		axisopts = strsplit(axisopts);
+ 		axis(axisopts{:});
+ 	else
Index: /issm/oecreview/Archive/25834-26739/ISSM-26314-26315.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26314-26315.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26314-26315.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/externalpackages/dakota/configs/6.2/linux/cmake/BuildDakotaCustom.cmake
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/configs/6.2/linux/cmake/BuildDakotaCustom.cmake	(revision 26314)
++++ ../trunk-jpl/externalpackages/dakota/configs/6.2/linux/cmake/BuildDakotaCustom.cmake	(revision 26315)
+@@ -67,6 +67,8 @@
+      CACHE FILEPATH "Use MPI headers" FORCE)
+ set( MPI_LIBRARY "-L$ENV{MPI_INSTALL}/lib -lmpich"
+      CACHE FILEPATH "Use MPI library" FORCE)
++set( MPI_EXTRA_LIBRARY "-L$ENV{MPI_INSTALL}/lib -lmpich"
++	  CACHE FILEPATH "Use MPI extra libraries" FORCE)
+ 
+ ##############################################################################
+ # Set Boost path if CMake cannot find your installed version of Boost or
Index: /issm/oecreview/Archive/25834-26739/ISSM-26315-26316.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26315-26316.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26315-26316.diff	(revision 26740)
@@ -0,0 +1,90 @@
+Index: ../trunk-jpl/src/m/classes/offlinesolidearthsolution.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/offlinesolidearthsolution.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/offlinesolidearthsolution.py	(revision 26316)
+@@ -0,0 +1,85 @@
++import numpy as np
++
++from checkfield import checkfield
++from fielddisplay import fielddisplay
++from WriteData import WriteData
++
++
++class offlinesolidearthsolution(object):
++    """OFFLINESOLIDEARTHSOLUTION class definition
++
++    Usage:
++        offlinesolidearthsolution = offlinesolidearthsolution()
++    """
++
++    def __init__(self, *args): #{{{
++        self.displacementeast = None
++        self.displacementnorth = None
++        self.displacementup = None
++        self.geoid = None
++
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            raise RuntimeError('constructor not supported')
++    #}}}
++
++    def __repr__(self): #{{{
++        s = '         units for time series is (yr)\n       external: offlinesolidearth solution\n'
++        s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
++        s += '{}\n'.format(fielddisplay(self, 'displacementnorth', 'solid-Earth Northwards bedrock displacement time series (m)'))
++        s += '{}\n'.format(fielddisplay(self, 'displacementup', 'solid-Earth bedrock uplift time series (m)'))
++        s += '{}\n'.format(fielddisplay(self, 'geoid', 'solid-Earth geoid time series (m)'))
++
++        return s
++    #}}}
++
++    def setdefaultparameters(self): #{{{
++        self.displacementeast = []
++        self.displacementnorth = []
++        self.displacementup = []
++        self.geoid = []
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses): #{{{
++        if ('SealevelchangeAnalysis' not in analyses) or ((solution=='TransientSolution') and (md.solidearth.settings.isgrd==1)): 
++            print('offlinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!')
++            return md
++        md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1)
++    #}}}
++
++    def marshall(self, prefix, md, fid): #{{{
++        yts = md.constants.yts
++
++        # Transform our time series into time series rates
++        if len(np.shape(self.displacementeast)) == 1:
++            print('External solidearthsolution warning: only one time step provided, assuming the values are rates per year')
++            displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
++            displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
++            displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
++            geoid_rate = np.append(np.array(self.geoid).reshape(-1, 1), 0)
++        else:
++            time = self.displacementeast[-1, :]
++            dt = np.diff(time, axis=0)
++            displacementeast_rate = np.diff(self.displacementeast[0:-2, :], 1, 1) / dt
++            displacementeast_rate = np.append(displacementeast_rate,time[:-1].reshape(1,-1),axis=0)
++            displacementnorth_rate = np.diff(self.displacementnorth[0:-2, :], 1, 1) / dt
++            displacementnorth_rate = np.append(displacementnorth_rate,time[:-1].reshape(1,-1),axis=0)
++            displacementup_rate = np.diff(self.displacementup[0:-2, :], 1, 1) / dt
++            displacementup_rate = np.append(displacementup_rate,time[:-1].reshape(1,-1),axis=0)
++            geoid_rate = np.diff(self.geoid[0:-2, :], 1, 1) / dt
++            geoid_rate = np.append(geoid_rate,time[:-1].reshape(1,-1),axis=0)
++
++        WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 2, 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'geoid', 'data', geoid_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
++    #}}}
++
++    def extrude(self, md): #{{{
++        return self
++    #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26316-26317.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26316-26317.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26316-26317.diff	(revision 26740)
@@ -0,0 +1,269 @@
+Index: ../trunk-jpl/src/m/classes/dslmme.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/dslmme.py	(revision 26317)
+@@ -40,7 +40,7 @@
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         # Early return
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+ 
+         for i in range(len(self.global_average_thermosteric_sea_level)):
+Index: ../trunk-jpl/src/m/classes/lovenumbers.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26317)
+@@ -1,3 +1,4 @@
++import numpy as np
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from getlovenumbers import getlovenumbers
+@@ -54,12 +55,12 @@
+ 
+     def setdefaultparameters(self, maxdeg, referenceframe):  #{{{
+         # Initialize love numbers
+-        self.h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+-        self.k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+-        self.l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+-        self.th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+-        self.tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
+-        self.tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg)
++        self.h = getlovenumbers('type', 'loadingverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
++        self.k = getlovenumbers('type', 'loadinggravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
++        self.l = getlovenumbers('type', 'loadinghorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
++        self.th = getlovenumbers('type', 'tidalverticaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
++        self.tk = getlovenumbers('type', 'tidalgravitationalpotential', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
++        self.tl = getlovenumbers('type', 'tidalhorizontaldisplacement', 'referenceframe', referenceframe, 'maxdeg', maxdeg).reshape(-1,1)
+ 
+         # Secular fluid love number
+         self.tk2secular = 0.942
+@@ -66,7 +67,7 @@
+ 
+         # Time
+         self.istime = 1 # Temporal love numbers by default
+-        self.timefreq = 0 # Elastic case by default
++        self.timefreq = np.zeros(1) # Elastic case by default
+         return self
+     #}}}
+ 
+@@ -88,7 +89,7 @@
+             raise ValueError('lovenumbers error message: love numbers should be provided at the same level of accuracy')
+ 
+         ntf = len(self.timefreq)
+-        if (self.h.shape[1] != ntf or self.k.shape[1] != ntf or self.l.shape[1] != ntf or self.th.shape[1] != ntf or self.tk.shape[1] != ntf or self.tl.shape[1] != ntf):
++        if (np.shape(self.h)[1] != ntf or np.shape(self.k)[1] != ntf or np.shape(self.l)[1] != ntf or np.shape(self.th)[1] != ntf or np.shape(self.tk)[1] != ntf or np.shape(self.tl)[1] != ntf):
+             raise ValueError('lovenumbers error message: love numbers should have as many time/frequency steps as the time/frequency vector')
+ 
+         return md
+Index: ../trunk-jpl/src/m/classes/matdamageice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26317)
+@@ -114,7 +114,7 @@
+         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 'SealevelriseAnalysis' in analyses:
++        if 'SealevelchangeAnalysis' in analyses:
+                 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
+ 
+         return md
+Index: ../trunk-jpl/src/m/classes/matenhancedice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matenhancedice.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/matenhancedice.py	(revision 26317)
+@@ -125,7 +125,7 @@
+         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 'SealevelriseAnalysis' in analyses:
++        if 'SealevelchangeAnalysis' in analyses:
+             md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
+         return md
+     # }}}
+Index: ../trunk-jpl/src/m/classes/matestar.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matestar.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/matestar.py	(revision 26317)
+@@ -119,7 +119,7 @@
+         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 'SealevelriseAnalysis' in analyses:
++        if 'SealevelchangeAnalysis' in analyses:
+             md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
+ 
+         return md
+Index: ../trunk-jpl/src/m/classes/nodalvalue.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/nodalvalue.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/nodalvalue.py	(revision 26317)
+@@ -11,9 +11,9 @@
+     Usage:
+         nodalvalue=nodalvalue()
+         nodalvalue=nodalvalue(
+-            'name', 'SealevelriseSNodalValue',
++            'name', 'SealevelchangeSNodalValue',
+             'definitionstring', 'Outputdefinition1',
+-            'model_string', 'SealevelriseS',
++            'model_string', 'SealevelchangeS',
+             'node', 1
+         )
+     """
+Index: ../trunk-jpl/src/m/classes/rotational.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/rotational.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/rotational.py	(revision 26317)
+@@ -41,7 +41,7 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+         md = checkfield(md, 'fieldname', 'solidearth.rotational.equatorialmoi', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.rotational.polarmoi', 'NaN', 1, 'Inf', 1)
+Index: ../trunk-jpl/src/m/classes/slr.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/slr.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/slr.py	(revision 26317)
+@@ -6,6 +6,7 @@
+ from model import *
+ from planetradius import planetradius
+ from WriteData import WriteData
++from project3d import project3d
+ 
+ 
+ class slr(object):
+@@ -119,7 +120,7 @@
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         # Early return
+-        if 'SealevelriseAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.isslr):
++        if 'SealevelchangeAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.isslr):
+             return md
+ 
+         md = checkfield(md, 'fieldname', 'slr.deltathickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+Index: ../trunk-jpl/src/m/classes/solidearth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/solidearth.py	(revision 26317)
+@@ -7,6 +7,8 @@
+ from project3d import project3d
+ from rotational import rotational
+ from solidearthsettings import solidearthsettings
++from solidearthsolution import solidearthsolution
++from offlinesolidearthsolution import offlinesolidearthsolution
+ from surfaceload import surfaceload
+ from WriteData import WriteData
+ 
+@@ -78,7 +80,7 @@
+         self.planetradius = planetradius(planet)
+     #}}}
+     def checkconsistency(self, md, solution, analyses): #{{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+ 
+         md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1)
+@@ -87,9 +89,8 @@
+         self.lovenumbers.checkconsistency(md, solution, analyses)
+         self.rotational.checkconsistency(md, solution, analyses)
+         if self.external:
+-            if not isinstance(self.external, 'solidearthsolution'):
++            if (not isinstance(self.external,solidearthsolution)) and (not isinstance(self.external,offlinesolidearthsolution)):
+                 raise Exception('solidearth consistency check: external field should be a solidearthsolution')
+-            end
+             self.external.checkconsistency(md, solution, analyses)
+         return md
+     #}}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26317)
+@@ -97,7 +97,7 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses): #{{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+ 
+         md = checkfield(md, 'fieldname', 'solidearth.settings.reltol', 'size', [1])
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26316)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26317)
+@@ -65,6 +65,8 @@
+ 				geoid_rate=diff(self.geoid(1:end-1,:),1,2)./dt;
+ 				geoid_rate(end+1,:)=time(1:end-1);
+ 			end
++
++			WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 0, 'format', 'Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26317)
+@@ -52,7 +52,7 @@
+         yts = md.constants.yts
+ 
+         # Transform our time series into time series rates
+-        if np.shape(self.displacementeast, 1) == 1:
++        if len(np.shape(self.displacementeast)) == 1:
+             print('External solidearthsolution warning: only one time step provided, assuming the values are rates per year')
+             displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
+             displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
+@@ -60,15 +60,17 @@
+             geoid_rate = np.append(np.array(self.geoid).reshape(-1, 1), 0)
+         else:
+             time = self.displacementeast[-1, :]
+-            dt = np.diff(time, 1, 1)
++            dt = np.diff(time, axis=0)
+             displacementeast_rate = np.diff(self.displacementeast[0:-2, :], 1, 1) / dt
+-            displacementeast_rate.append(time[0:-2])
++            displacementeast_rate = np.append(displacementeast_rate,time[:-1].reshape(1,-1),axis=0)
+             displacementnorth_rate = np.diff(self.displacementnorth[0:-2, :], 1, 1) / dt
+-            displacementnorth_rate.append(time[0:-2])
++            displacementnorth_rate = np.append(displacementnorth_rate,time[:-1].reshape(1,-1),axis=0)
+             displacementup_rate = np.diff(self.displacementup[0:-2, :], 1, 1) / dt
+-            displacementup_rate.append(time[0:-2])
++            displacementup_rate = np.append(displacementup_rate,time[:-1].reshape(1,-1),axis=0)
+             geoid_rate = np.diff(self.geoid[0:-2, :], 1, 1) / dt
+-            geoid_rate.append(time[0:-2])
++            geoid_rate = np.append(geoid_rate,time[:-1].reshape(1,-1),axis=0)
++
++        WriteData(fid, prefix, 'name', 'md.solidearth.external.nature', 'data', 0, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementeast', 'data', displacementeast_rate, 'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementeast', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+Index: ../trunk-jpl/src/m/classes/surfaceload.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/surfaceload.py	(revision 26317)
+@@ -38,7 +38,7 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+         if type(self.icethicknesschange) == np.ndarray:
+             md = checkfield(md, 'fieldname', 'solidearth.surfaceload.icethicknesschange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+Index: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 26316)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 26317)
+@@ -48,7 +48,7 @@
+         md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+ 
+         if md.solidearth.settings.compute_bp_grd:
+-            md = checkfield(md, 'fieldname', dsl.sea_water_pressure_at_sea_floor, 'empty', 1)
++            md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'empty', 1)
+ 
+         return md
+     # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26317-26318.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26317-26318.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26317-26318.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26317)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26318)
+@@ -72,9 +72,9 @@
+     elif solutiontype == 'EsaSolution':
+         analyses = ['EsaAnalysis']
+     elif solutiontype == 'TransientSolution':
+-        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'OceantransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShreveAnalysis', 'HydrologyTwsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelriseAnalysis']
+-    elif solutiontype == 'SealevelriseSolution':
+-        analyses = ['SealevelriseAnalysis']
++        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'OceantransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShreveAnalysis', 'HydrologyTwsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelchangeAnalysis']
++    elif solutiontype == 'SealevelchangeSolution':
++        analyses = ['SealevelchangeAnalysis']
+     elif solutiontype == 'HydrologySolution':
+         analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyTwsAnalysis']
+     elif 'DamageEvolutionSolution':
Index: /issm/oecreview/Archive/25834-26739/ISSM-26318-26319.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26318-26319.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26318-26319.diff	(revision 26740)
@@ -0,0 +1,76 @@
+Index: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 26318)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 26319)
+@@ -13,10 +13,10 @@
+         dsl = dsl() # dynamic sea level class, based on CMIP5 outputs
+     """
+ 
+-    def __init__(self, *args): #{{{
+-        self.global_average_thermosteric_sea_level = np.nan # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
+-        self.sea_surface_height_above_geoid        = np.nan # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
+-        self.sea_water_pressure_at_sea_floor       = np.nan # Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
++    def __init__(self, *args):  #{{{
++        self.global_average_thermosteric_sea_level = np.nan  # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).
++        self.sea_surface_height_above_geoid = np.nan  # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).
++        self.sea_water_pressure_at_sea_floor = np.nan  #  Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).
+ 
+         if len(args) == 0:
+             self.setdefaultparameters()
+@@ -24,7 +24,7 @@
+             raise Exception('constructor not supported')
+     #}}}
+ 
+-    def __repr__(self): #{{{
++    def __repr__(self):  #{{{
+         s = '   dsl parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).'))
+         s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_above_geoid', 'Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).'))
+@@ -32,17 +32,16 @@
+         return s
+     #}}}
+ 
+-    def setdefaultparameters(self): #{{{
++    def setdefaultparameters(self):  #{{{
+         self.global_average_thermosteric_sea_level = np.nan
+-        self.sea_surface_height_above_geoid        = np.nan
+-        self.sea_water_pressure_at_sea_floor       = np.nan
++        self.sea_surface_height_above_geoid = np.nan
++        self.sea_water_pressure_at_sea_floor = np.nan
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    def checkconsistency(self, md, solution, analyses):  #{{{
+         # Early return
+-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (md.transient.isoceantransport == 0):
+             return md
+-
+         md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+         md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+@@ -56,19 +55,18 @@
+     def marshall(self, prefix, md, fid):   #{{{
+         yts = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'yts', yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify DSL at vertex locations.
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify bottom pressure at vertex locations.
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'yts', yts)  # mattype 2, because we are sending a GMSL value identical everywhere on each element.
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify DSL at vertex locations.
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify bottom pressure at vertex locations.
+     # }}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  #{{{
+         self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1)
+         self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1)
+         return self
+     #}}}
+ 
+-
+-    def initialize(self, md): #{{{
++    def initialize(self, md):  #{{{
+         if np.isnan(self.global_average_thermosteric_sea_level):
+             self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
+             print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26319-26320.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26319-26320.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26319-26320.diff	(revision 26740)
@@ -0,0 +1,156 @@
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26319)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26320)
+@@ -306,7 +306,7 @@
+ }/*}}}*/
+ 
+ /*Finite Element Analysis*/
+-void           EnthalpyAnalysis::ApplyBasalConstraints(IssmDouble* serial_spc,Element* element){/*{{{*/
++void           EnthalpyAnalysis::ApplyBasalConstraints(IssmDouble* local_spc,Element* element){/*{{{*/
+ 
+ 	/* Do not check if ice in element, this may lead to inconsistencies between cpu partitions */
+ 	/* Only update constraints at the base. */
+@@ -316,7 +316,6 @@
+ 	bool        isdynamicbasalspc;
+ 	int         numindices;
+ 	int        *indices = NULL;
+-	Node*       node = NULL;
+ 	IssmDouble	pressure;
+ 
+ 	/*Check wether dynamic basal boundary conditions are activated */
+@@ -324,7 +323,7 @@
+ 	if(!isdynamicbasalspc) return;
+ 
+ 	/*Get parameters and inputs: */
+-	Input* pressure_input		 = element->GetInput(PressureEnum);							 _assert_(pressure_input);
++	Input* pressure_input = element->GetInput(PressureEnum); _assert_(pressure_input);
+ 
+ 	/*Fetch indices of basal & surface nodes for this finite element*/
+ 	Penta *penta =  (Penta *) element; // TODO: add Basal-/SurfaceNodeIndices to element.h, and change this to Element*
+@@ -337,9 +336,9 @@
+ 		pressure_input->GetInputValue(&pressure,gauss);
+ 
+ 		/*apply or release spc*/
+-		node=element->GetNode(indices[i]);
++		Node* node=element->GetNode(indices[i]);
+ 		if(!node->IsActive()) continue;
+-		if(serial_spc[node->Sid()]==1.){
++		if(local_spc[node->Lid()]==1.){
+ 			pressure_input->GetInputValue(&pressure, gauss);
+ 			node->ApplyConstraint(0,PureIceEnthalpy(element,pressure));
+ 		}
+@@ -1343,23 +1342,23 @@
+ 		switch (state) {
+ 			case 0:
+ 				// cold, dry base: apply basal surface forcing
+-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
+ 				break;
+ 			case 1:
+ 				// cold, wet base: keep at pressure melting point
+-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
+ 				break;
+ 			case 2:
+ 				// temperate, thin refreezing base:
+-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
+ 				break;
+ 			case 3:
+ 				// temperate, thin melting base: set spc
+-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
+ 				break;
+ 			case 4:
+ 				// temperate, thick melting base:
+-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
+ 				break;
+ 			default:
+ 				_printf0_("	unknown thermal basal state found!");
+@@ -1416,23 +1415,23 @@
+ 		switch (state) {
+ 			case 0:
+ 				// cold, dry base: apply basal surface forcing
+-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
+ 				break;
+ 			case 1:
+ 				// cold, wet base: keep at pressure melting point
+-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
+ 				break;
+ 			case 2:
+ 				// temperate, thin refreezing base: release spc
+-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
+ 				break;
+ 			case 3:
+ 				// temperate, thin melting base: set spc
+-				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),1.,INS_VAL);
+ 				break;
+ 			case 4:
+ 				// temperate, thick melting base: set grad H*n=0
+-				vec_spc->SetValue(element->nodes[i]->Sid(),0.,INS_VAL);
++				vec_spc->SetValue(element->nodes[i]->Pid(),0.,INS_VAL);
+ 				break;
+ 			default:
+ 				_printf0_("	unknown thermal basal state found!");
+@@ -1667,10 +1666,10 @@
+ void           EnthalpyAnalysis::UpdateBasalConstraints(FemModel* femmodel){/*{{{*/
+ 
+ 	/*Update basal dirichlet BCs for enthalpy: */
+-	Vector<IssmDouble>* spc           = NULL;
+-	IssmDouble*         serial_spc    = NULL;
++	int numnodes            = femmodel->nodes->NumberOfNodes();
++   int localmasters        = femmodel->nodes->NumberOfNodesLocal();
++	Vector<IssmDouble>* spc = new Vector<IssmDouble>(localmasters,numnodes);
+ 
+-	spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes());
+ 	/*First create a vector to figure out what elements should be constrained*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element=xDynamicCast<Element*>(object);
+@@ -1677,21 +1676,24 @@
+ 		GetBasalConstraints(spc,element);
+ 	}
+ 
+-	/*Assemble and serialize*/
++	/*Assemble*/
+ 	spc->Assemble();
+-	serial_spc=spc->ToMPISerial();
++
++	/*Get local vector with both masters and slaves:*/
++	IssmDouble *local_spc = NULL;
++	femmodel->GetLocalVectorWithClonesNodes(&local_spc,spc);
+ 	delete spc;
+ 
+ 	/*Then update basal constraints nodes accordingly*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element=xDynamicCast<Element*>(object);
+-		ApplyBasalConstraints(serial_spc,element);
++		ApplyBasalConstraints(local_spc,element);
+ 	}
+ 
+ 	femmodel->UpdateConstraintsx();
+ 
+ 	/*Delete*/
+-	xDelete<IssmDouble>(serial_spc);
++	xDelete<IssmDouble>(local_spc);
+ }/*}}}*/
+ void           EnthalpyAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	SetActiveNodesLSMx(femmodel);
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26319)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26320)
+@@ -357,7 +357,7 @@
+ 
+ 		/*Retrieve all inputs and parameters*/
+ 		basalelement->GetVerticesCoordinates(&xyz_list);
+-		Input* levelset_input     = basalelement->GetInput(MaskIceLevelsetEnum);                    _assert_(levelset_input);
++		Input* levelset_input  = basalelement->GetInput(MaskIceLevelsetEnum); _assert_(levelset_input);
+ 
+ 		/* Start  looping on the number of gaussian points: */
+ 		Gauss* gauss=basalelement->NewGauss(2);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26320-26321.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26320-26321.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26320-26321.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test455.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test455.m	(revision 26320)
++++ ../trunk-jpl/test/NightlyRun/test455.m	(revision 26321)
+@@ -13,7 +13,7 @@
+ 	md.flowequation.fe_HO=i{1};
+ 	md=solve(md,'Stressbalance');
+ 	field_names     ={field_names{:},['Vx' i{1}],['Vy' i{1}],['Vz' i{1}],['Vel' i{1}],['Pressure' i{1}]};
+-	field_tolerances={field_tolerances{:},7e-08,6e-08,6e-08,6e-08,3e-13};
++	field_tolerances={field_tolerances{:},8e-08,6e-08,6e-08,6e-08,3e-13};
+ 	field_values={field_values{:},...
+ 	(md.results.StressbalanceSolution.Vx),...
+ 	(md.results.StressbalanceSolution.Vy),...
+Index: ../trunk-jpl/test/NightlyRun/test455.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test455.py	(revision 26320)
++++ ../trunk-jpl/test/NightlyRun/test455.py	(revision 26321)
+@@ -22,7 +22,7 @@
+     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_tolerances = field_tolerances + [8e-08, 6e-08, 6e-08, 6e-08, 3e-13]
+     field_values = field_values + [md.results.StressbalanceSolution.Vx,
+                                    md.results.StressbalanceSolution.Vy,
+                                    md.results.StressbalanceSolution.Vz,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26321-26322.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26321-26322.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26321-26322.diff	(revision 26740)
@@ -0,0 +1,86 @@
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.js
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.js	(nonexistent)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.js	(revision 26322)
+@@ -0,0 +1,60 @@
++//GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh from $ISSM_DIR/src/demos/simple_geo/sphere.geo
++//
++//   Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
++//
++//   - radius:             radius of the planet in km
++//   - resolution:         resolution in km
++//   - refine:             provide mesh
++//   - refinemetric:       mesh quantity to specify resolution
++//
++//   Returns 'mesh3dsurface' type mesh
++//
++//   Examples:
++//      md.mesh=gmshplanet('radius',6000,'resolution',100);
++//      md.mesh=gmshplanet('radius',6000,'resolution',100);
++async function gmshplanet(md) {
++	let args = Array.prototype.slice.call(arguments, 1);
++	let options = new pairoptions(args);
++	let radius = options.getfieldvalue('radius', planetradius('earth')); //warning: planetradius in m, not km
++	let resolution = options.getfieldvalue('resolution', 700);
++
++	md.cluster = cluster;
++	md = await solve(md, 'gmsh', 'checkconsistency', 'false', 'hmin', resolution);
++
++	//methods 
++	let results = md.results[0];
++	let mesh = new mesh3dsurface();
++	let elements = [];
++	for (let i = 0; i < results.Elements.length; i=i+3){
++		elements.push(results.Elements.slice(i, i+3));
++	}
++	mesh.numberofelements = results.NumberOfElements;
++	mesh.numberofvertices =  results.NumberOfVertices;
++	mesh.x = results.X;
++	mesh.y = results.Y;
++	mesh.z = results.Z;
++	mesh.r = results.R;
++	mesh.elements = elements;
++	mesh.lat = results.Lat;
++	mesh.long = results.Long;
++	mesh.average_vertex_connectivity = results.AverageVertexConnectivity;
++
++	//a little technicality here. the mesh generate is not exactly on the 
++	//sphere. we create lat,long coordinates, and reproject on an exact sphere. 
++	mesh.r=ArraySqrt(ArrayAdd(ArrayAdd(ArrayPow(mesh.x,2),ArrayPow(mesh.y,2)),ArrayPow(mesh.z,2)));
++
++	//make sure we don't have south and north pole: 
++	let pos=find(ArrayAnd(ArrayEqual(mesh.x,0), ArrayEqual(mesh.y,0)));
++	mesh.lat = asind(ArrayDivide(mesh.z,mesh.r));
++	mesh.long = atan2d(mesh.y,mesh.x);
++	pos=find(ArrayEqual(mesh.lat,90)); ArrayIndex(mesh.lat,pos,90-.01);
++	pos=find(ArrayEqual(mesh.lat,-90)); ArrayIndex(mesh.lat,pos,-90+.01);
++
++	let radius = planetradius('earth');
++	mesh.r=NewArrayFill(mesh.numberofvertices,radius);
++	mesh.x=ArrayMultiply(radius,ArrayMultiply(cosd(mesh.lat),cosd(mesh.long)));
++	mesh.y=ArrayMultiply(radius,ArrayMultiply(cosd(mesh.lat),sind(mesh.long)));
++	mesh.z=ArrayMultiply(radius,sind(mesh.lat));
++
++	return mesh;
++}
+Index: ../trunk-jpl/src/m/plot/plot_contour.js
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_contour.js	(revision 26321)
++++ ../trunk-jpl/src/m/plot/plot_contour.js	(revision 26322)
+@@ -282,6 +282,7 @@
+ 	}
+ 
+ 	//Compute gl variables:
++	let scale = options.getfieldvalue('contourscale', 1.0005);
+ 	let node = new Node(
+ 		'canvas', canvas,
+ 		'options', options,
+@@ -290,7 +291,7 @@
+ 		'replaceNaN', false,
+ 		'shaderName', 'line_strip',
+ 		'lineWidth', options.getfieldvalue('linewidth', 1),
+-		'scale', [1.0005, 1.0005, 1.0005]
++		'scale', [scale, scale, scale]
+ 	);
+ 
+ 	node.patch('Vertices', [hx, hy, hz], 'FaceColor', 'none', 'EdgeColor', color);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26322-26323.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26322-26323.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26322-26323.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26322)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26323)
+@@ -93,15 +93,13 @@
+ }/*}}}*/
+ void TransientInput::DeepEcho(void){/*{{{*/
+ 
+-	int i;
+-
+ 	_printf_("TransientInput:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+ 	_printf_("   numtimesteps: " << this->numtimesteps << "\n");
+ 	_printf_("---inputs: \n");
+-	for(i=0;i<this->numtimesteps;i++){
++	for(int i=0;i<this->numtimesteps;i++){
+ 		_printf_("   time: " << this->timesteps[i]<<"  ");
+-		if(this->inputs[i]) this->inputs[i]->Echo();
++		if(this->inputs[i]) this->inputs[i]->DeepEcho();
+ 		else                _printf_(" NOT SET! \n");
+ 	}
+ }
+@@ -111,7 +109,15 @@
+ }
+ /*}}}*/
+ void TransientInput::Echo(void){/*{{{*/
+-	this->DeepEcho();
++	_printf_("TransientInput:\n");
++	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
++	_printf_("   numtimesteps: " << this->numtimesteps << "\n");
++	_printf_("---inputs: \n");
++	for(int i=0;i<this->numtimesteps;i++){
++		_printf_("   time: " << this->timesteps[i]<<"  ");
++		if(this->inputs[i]) this->inputs[i]->Echo();
++		else                _printf_(" NOT SET! \n");
++	}
+ }
+ /*}}}*/
+ int  TransientInput::Id(void){ return -1; }/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26323-26324.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26323-26324.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26323-26324.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26323)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26324)
+@@ -552,7 +552,7 @@
+ 					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);
++						vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
+ 					}
+ 				}
+ 			}
+@@ -581,7 +581,7 @@
+ 				bool isconnected = false;
+ 				for(int in=0;in<numnodes;in++){
+ 					Node* node=element->GetNode(in);
+-					if(constraint_nodes[node->Sid()]==1.){
++					if(constraint_nodes[node->Pid()]==1.){
+ 						isconnected = true;
+ 						break;
+ 					}
+@@ -599,9 +599,9 @@
+ 						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.){
++						if((surface_crevasse-surface>0. || crevassedepth-thickness>0.) && bed<0. && levelset>-300. && levelset<0. && constraint_nodes[node->Pid()]==0.){
+ 							local_nflipped++;
+-							vec_constraint_nodes->SetValue(node->Sid(),1.0,INS_VAL);
++							vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
+ 						}
+ 					}
+ 				}
+@@ -630,7 +630,7 @@
+ 				Node* node=element->GetNode(in);
+ 				if(!node->IsActive()) continue;
+ 
+-				if(constraint_nodes[node->Sid()]>0.){
++				if(constraint_nodes[node->Pid()]>0.){
+ 					node->ApplyConstraint(0,+1.);
+ 				}
+ 				else {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26324-26325.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26324-26325.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26324-26325.diff	(revision 26740)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp	(revision 26324)
++++ ../trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp	(revision 26325)
+@@ -62,8 +62,10 @@
+ 	/*Initialize vector with number of vertices*/
+ 	int numvertices=femmodel->vertices->NumberOfVertices();
+ 	if(numvertices==0)  return;
+-	Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(numvertices);
+ 
++	int numvert_local = femmodel->vertices->NumberOfVerticesLocal();
++	Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(numvert_local,numvertices);
++
+ 	/*Fill vector with values: */
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element=xDynamicCast<Element*>(object);
+@@ -70,7 +72,7 @@
+ 		if(element->IsIceInElement()){
+ 			int nbv = element->GetNumberOfVertices();
+ 			for(int iv=0;iv<nbv;iv++){
+-				vec_mask_ice->SetValue(element->vertices[iv]->Sid(),1.,INS_VAL);
++				vec_mask_ice->SetValue(element->vertices[iv]->Pid(),1.,INS_VAL);
+ 			}
+ 		}
+ 	}
+@@ -77,7 +79,7 @@
+ 
+ 	/*Assemble vector and serialize */
+ 	vec_mask_ice->Assemble();
+-	InputUpdateFromVectorx(femmodel,vec_mask_ice,IceMaskNodeActivationEnum,VertexSIdEnum);
++	InputUpdateFromVectorx(femmodel,vec_mask_ice,IceMaskNodeActivationEnum,VertexPIdEnum);
+ 	delete vec_mask_ice;
+ }/*}}}*/
+ void GetMaskOfIceVerticesLSMx(FemModel* femmodel){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26325-26326.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26325-26326.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26325-26326.diff	(revision 26740)
@@ -0,0 +1,56 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26325)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26326)
+@@ -4053,7 +4053,7 @@
+ 	return Jelem;
+ }
+ /*}}}*/
+-void	   Tria::MovingFrontalVelocity(void){/*{{{*/
++void	      Tria::MovingFrontalVelocity(void){/*{{{*/
+ 
+ 	int  dim, domaintype, calvinglaw, i;
+ 	IssmDouble v[3],w[3],c[3],m[3],dlsf[3];
+@@ -4319,6 +4319,42 @@
+ 		movingfrontvy[iv] = w[1];		
+ 	}
+ 
++	/**************************************  MICI  START ************************************/
++	/*MICI from Crawford et al. 2021:
++	 * Tice = 20C; Bf  ->  I = 3.7e-16; α = 6.9
++	 * Tice = 20C; Bn  ->  I = 5.1e-14; α = 6.0
++	 * Tice = 20C; Bh  ->  I = 3.2e-17; α = 7.2
++	 * Tice = 10C; Bn  ->  I = 6.9e-17; α = 7.3
++	 * Tice = 5C;  Bn  ->  I = 1.9e-16; α = 7.3
++	 */
++	//Input* surface_input = this->GetInput(SurfaceEnum); _assert_(surface_input);
++	//Input* bed_input     = this->GetInput(BedEnum);     _assert_(bed_input);
++	//Input* ls_input      = this->GetInput(MaskIceLevelsetEnum);   _assert_(ls_input);
++	//IssmDouble Hc,bed,ls;
++	//for(int iv=0;iv<NUMVERTICES;iv++){
++	//	gauss.GaussVertex(iv);
++
++	//	surface_input->GetInputValue(&Hc,&gauss);
++	//	bed_input->GetInputValue(&bed,&gauss);
++	//	ls_input->GetInputValue(&ls,&gauss);
++
++	//	if(Hc>135. && bed<0. && fabs(ls)<100.e3){
++
++	//		lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++	//		norm_dlsf=0.;
++	//		for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++	//		norm_dlsf=sqrt(norm_dlsf);
++
++	//		/*5C Bn (worst case scenario)*/
++	//		IssmDouble I     = 1.9e-16;
++	//		IssmDouble alpha = 7.3;
++	//		IssmDouble C = I*pow(Hc,alpha)/(24*3600.); /*convert from m/day to m/s*/
++	//		movingfrontvx[iv] = -C*dlsf[0]/norm_dlsf;
++	//		movingfrontvy[iv] = -C*dlsf[1]/norm_dlsf;
++	//	}
++	//}
++	/**************************************  END MICI  *************************************/
++
+ 	/*Add input*/
+ 	this->AddInput(MovingFrontalVxEnum,&movingfrontvx[0],P1DGEnum);
+ 	this->AddInput(MovingFrontalVyEnum,&movingfrontvy[0],P1DGEnum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26326-26327.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26326-26327.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26326-26327.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26326)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 26327)
+@@ -178,8 +178,8 @@
+ 			}
+ 
+ 			//go through list of materials, and create them: 
+-			for(int i=0;i<nnat;i++){
+-				switch(IoCodeToEnumNature(nature[i])){ 
++			for(int nat=0;nat<nnat;nat++){
++				switch(IoCodeToEnumNature(nature[nat])){ 
+ 					case MaticeEnum:{ /*{{{*/
+ 							iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_B",MaterialsRheologyBEnum);
+ 							iomodel->FetchDataToInput(inputs,elements,"md.materials.rheology_n",MaterialsRheologyNEnum);
+@@ -285,7 +285,7 @@
+ 						/*}}}*/
+ 						break; 
+ 					default:
+-						_error_("Materials nature type "<<EnumToStringx(IoCodeToEnumNature(nature[i]))<<" not supported");
++						_error_("Materials nature type "<<EnumToStringx(IoCodeToEnumNature(nature[nat]))<<" not supported");
+ 						break;
+ 				}
+ 			}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26327-26328.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26327-26328.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26327-26328.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26327)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26328)
+@@ -13,6 +13,7 @@
+ void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 	int finiteelement;
+ 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
++	//IoModelToDynamicConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+ 	IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+ }
+ /*}}}*/
+@@ -405,7 +406,7 @@
+ 	return fabs(a[0]*b[1]-a[1]*b[0])/norm_b;
+ }/*}}}*/
+ void           LevelsetAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+-	_error_("not implemented yet");
++	element->GetSolutionFromInputsOneDof(solution,MaskIceLevelsetEnum);
+ }/*}}}*/
+ void           LevelsetAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
Index: /issm/oecreview/Archive/25834-26739/ISSM-26328-26329.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26328-26329.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26328-26329.diff	(revision 26740)
@@ -0,0 +1,584 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26329)
+@@ -1659,7 +1659,7 @@
+ void           AdjointHorizAnalysis::GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating (gradient is 0)*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+@@ -1752,7 +1752,7 @@
+ void           AdjointHorizAnalysis::GradientJDragFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating or not on bed (gradient is 0)*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 	if(!element->IsOnBase()) return;
+ 
+ 	/*Intermediaries*/
+@@ -1865,7 +1865,7 @@
+ void           AdjointHorizAnalysis::GradientJDragHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating or not on bed (gradient is 0)*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 	if(!element->IsOnBase()) return;
+ 
+ 	/*Intermediaries*/
+@@ -1952,7 +1952,7 @@
+ void           AdjointHorizAnalysis::GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating (gradient is 0)*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+@@ -2070,7 +2070,7 @@
+ void           AdjointHorizAnalysis::GradientJDragHydroFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating or not on bed (gradient is 0)*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 	if(!element->IsOnBase()) return;
+ 
+ 	/*Intermediaries*/
+@@ -2168,7 +2168,7 @@
+ void           AdjointHorizAnalysis::GradientJDragHydroHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating or not on bed (gradient is 0)*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 	if(!element->IsOnBase()) return;
+ 
+ 	/*Intermediaries*/
+@@ -2239,7 +2239,7 @@
+ void           AdjointHorizAnalysis::GradientJDragHydroSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating (gradient is 0)*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26329)
+@@ -370,7 +370,7 @@
+ 	if(!element->IsIceInElement()) return;
+ 
+ 	/* Only compute melt rates at the base of grounded ice*/
+-	if(!element->IsOnBase() || element->IsFloating()) return;
++	if(!element->IsOnBase() || element->IsAllFloating()) return;
+ 
+ 	/* Intermediaries */
+ 	bool			converged;
+@@ -727,7 +727,7 @@
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+ 	/*Initialize Element matrix and return if necessary*/
+-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble  dt,Jdet,D;
+@@ -921,7 +921,7 @@
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+ 	/* implementation of the basal condition decision chart of Aschwanden 2012, Fig.5 */
+-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
+ 
+ 	bool converged, isdynamicbasalspc;
+ 	int i, state;
+@@ -1022,7 +1022,7 @@
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+ 	/*Get basal element*/
+-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
+ 
+ 	IssmDouble  Hpmp,dt,Jdet,scalar_ocean,pressure;
+ 	IssmDouble *xyz_list_base = NULL;
+@@ -1307,7 +1307,7 @@
+ 
+ 	/* Only update constraints at the base.
+ 	 * Floating ice is not affected by basal BC decision chart. */
+-	if(!(element->IsOnBase()) || element->IsFloating()) return;
++	if(!(element->IsOnBase()) || element->IsAllFloating()) return;
+ 
+ 	/*Intermediary*/
+ 	int         numindices, numindicesup, state;
+@@ -1378,7 +1378,7 @@
+ 
+ 	/* Only update constraints at the base.
+ 	 * Floating ice is not affected by basal BC decision chart.*/
+-	if(!(element->IsOnBase()) || element->IsFloating()) return;
++	if(!(element->IsOnBase()) || element->IsAllFloating()) return;
+ 
+ 	/*Intermediary*/
+ 	int         numindices, numindicesup, state;
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26329)
+@@ -324,7 +324,7 @@
+ ElementVector* HydrologyGlaDSAnalysis::CreatePVector(Element* element){/*{{{*/
+ 
+ 	/*Skip if water or ice shelf element*/
+-	if(element->IsFloating()) return NULL;
++	if(element->IsAllFloating()) return NULL;
+ 
+ 	/*Intermediaries */
+ 	bool        meltflag;
+@@ -467,7 +467,7 @@
+ void HydrologyGlaDSAnalysis::UpdateSheetThickness(Element* element){/*{{{*/
+ 
+ 	/*Skip if water or ice shelf element*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 
+ 	/*Intermediaries */
+ 	IssmDouble  Jdet,vx,vy,ub,h_old,N,h_r,H,b;
+@@ -556,7 +556,7 @@
+ void HydrologyGlaDSAnalysis::UpdateEffectivePressure(Element* element){/*{{{*/
+ 
+ 	/*Skip if water or ice shelf element*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 	
+ 	/*Intermediary*/
+ 	IssmDouble phi_0, phi_m, p_i;
+Index: ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 26329)
+@@ -103,7 +103,7 @@
+ void HydrologyPismAnalysis::UpdateWaterColumn(Element* element){/*{{{*/
+ 
+ 	/*Skip if water or ice shelf element*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 
+ 	/*Intermediaries */
+ 	IssmDouble  dt,drainage_rate,water_column;
+@@ -133,7 +133,7 @@
+ 	}
+ 
+ 	/* Divide by connectivity, add degree of channelization as an input */
+-	/*FIXME: should be changed to P1, this is due to the NR, IsFloating will return 0 on this element, but it should not be DG*/
++	/*FIXME: should be changed to P1, this is due to the NR, IsAllFloating will return 0 on this element, but it should not be DG*/
+ 	element->AddInput(WatercolumnEnum,&watercolumn[0],P1DGEnum);
+ 
+ 	/*Clean up and return*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26329)
+@@ -222,7 +222,7 @@
+ ElementVector* HydrologyShaktiAnalysis::CreatePVector(Element* element){/*{{{*/
+ 
+ 	/*Skip if water or ice shelf element*/
+-	if(element->IsFloating()) return NULL;
++	if(element->IsAllFloating()) return NULL;
+ 
+ 	/*Intermediaries */
+ 	IssmDouble  Jdet,meltrate,G,dh[2],B,A,n;
+@@ -466,7 +466,7 @@
+ void HydrologyShaktiAnalysis::UpdateGapHeight(Element* element){/*{{{*/
+ 
+ 	/*Skip if water or ice shelf element*/
+-	if(element->IsFloating()) return;
++	if(element->IsAllFloating()) return;
+ 
+ 	/*Intermediaries */
+ 	IssmDouble newgap = 0.;
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26329)
+@@ -233,7 +233,7 @@
+ ElementVector* HydrologyShreveAnalysis::CreatePVector(Element* element){/*{{{*/
+ 
+ 	/*Skip if water or ice shelf element*/
+-	if(element->IsFloating()) return NULL;
++	if(element->IsAllFloating()) return NULL;
+ 
+ 	/*Intermediaries */
+ 	IssmDouble  Jdet,dt;
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26329)
+@@ -1467,7 +1467,7 @@
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixSSAFriction(Element* element){/*{{{*/
+ 
+ 	/*Return if element is inactive*/
+-	if(element->IsFloating() || !element->IsIceInElement()) return NULL;
++	if(element->IsAllFloating() || !element->IsIceInElement()) return NULL;
+ 
+ 	/*Intermediaries*/
+ 	int         dim,domaintype;
+@@ -2432,7 +2432,7 @@
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixL1L2Friction(Element* element){/*{{{*/
+ 
+-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
+ 	Element* basalelement = element->SpawnBasalElement();
+ 	ElementMatrix* Ke = CreateKMatrixSSAFriction(basalelement);
+ 
+@@ -2753,7 +2753,7 @@
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOFriction(Element* element){/*{{{*/
+ 
+-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
+ 
+ 	/*Intermediaries*/
+ 	int         dim,domaintype;
+@@ -3438,7 +3438,7 @@
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	/*Intermediaries*/
+ 	int         dim;
+@@ -4159,7 +4159,7 @@
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSShelf(Element* element){/*{{{*/
+ 
+-	if(!element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(!element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	/*If on not water or not FS, skip stiffness: */
+ 	int approximation,shelf_dampening;
+@@ -4879,7 +4879,7 @@
+ #ifdef FSANALYTICAL
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFriction(Element* element){/*{{{*/
+ 
+-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	/*If on water or not FS, skip stiffness: */
+ 	int approximation;
+@@ -5151,7 +5151,7 @@
+ #else
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFriction(Element* element){/*{{{*/
+ 
+-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	/*If on water or not FS, skip stiffness: */
+ 	int approximation;
+@@ -5371,7 +5371,7 @@
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFrictionNitsche(Element* element){/*{{{*/
+ 
+-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	/*If on water or not FS, skip stiffness: */
+ 	int approximation;
+@@ -5593,7 +5593,7 @@
+ 	IssmDouble *xyz_list_base = NULL;
+ 
+ 	/*Get basal element*/
+-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
+ 
+ 	/*Get problem dimension*/
+ 	element->FindParam(&dim,DomainDimensionEnum);
+@@ -7147,7 +7147,7 @@
+ 
+ 	/*If on water or not FS, skip stiffness: */
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	int vnumnodes = element->NumberofNodesVelocity();
+ 	int pnumnodes = element->NumberofNodesPressure();
+@@ -7364,7 +7364,7 @@
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	/*Constants*/
+ 	int numnodes    = element->GetNumberOfNodes();
+@@ -7592,7 +7592,7 @@
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+ 	/*Initialize Element matrix and return if necessary*/
+-	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	if(element->IsAllFloating() || !element->IsOnBase()) return NULL;
+ 
+ 	/*Build a tria element using the 3 nodes of the base of the penta. Then use
+ 	 * the tria functionality to build a friction stiffness matrix on these 3
+@@ -7709,7 +7709,7 @@
+ 	IssmDouble  basis[6]; //for the six nodes of the penta
+ 
+ 	/*Initialize Element vector and return if necessary*/
+-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+ 	if(approximation!=HOFSApproximationEnum) return NULL;
+ 
+@@ -7875,7 +7875,7 @@
+ 	IssmDouble  *xyz_list      = NULL;
+ 
+ 	/*Initialize Element vector and return if necessary*/
+-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+ 	if(approximation!=SSAFSApproximationEnum) return NULL;
+ 	int vnumnodes = element->NumberofNodesVelocity();
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 26329)
+@@ -329,13 +329,13 @@
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+ 	/*Initialize Element matrix and return if necessary*/
+-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
+ 
+ 	IssmDouble  dt,Jdet,D;
+ 	IssmDouble *xyz_list_base = NULL;
+ 
+ 	/*Get basal element*/
+-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+@@ -536,7 +536,7 @@
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+ 	/* Geothermal flux on ice sheet base and basal friction */
+-	if(!element->IsOnBase() || element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
+ 
+ 	IssmDouble  dt,Jdet,geothermalflux,vx,vy,vz;
+ 	IssmDouble  alpha2,scalar,basalfriction,heatflux;
+@@ -600,7 +600,7 @@
+ 	IssmDouble *xyz_list_base = NULL;
+ 
+ 	/*Get basal element*/
+-	if(!element->IsOnBase() || !element->IsFloating()) return NULL;
++	if(!element->IsOnBase() || !element->IsAllFloating()) return NULL;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26329)
+@@ -1992,7 +1992,7 @@
+ bool       Element::IsOnBase(){/*{{{*/
+ 	return this->isonbase;
+ }/*}}}*/
+-bool       Element::IsFloating(){/*{{{*/
++bool       Element::IsAllFloating(){/*{{{*/
+ 
+ 	bool shelf;
+ 	int  migration_style;
+@@ -2053,7 +2053,7 @@
+ /*}}}*/
+ void       Element::Ismip6FloatingiceMeltingRate(){/*{{{*/
+ 
+-	if(!this->IsIceInElement() || !this->IsFloating() || !this->IsOnBase()) return;
++	if(!this->IsIceInElement() || !this->IsAllFloating() || !this->IsOnBase()) return;
+ 
+ 	int         basinid,num_basins,M,N;
+ 	IssmDouble  tf,gamma0,base,delta_t_basin,mean_tf_basin,absval,meltanomaly;
+@@ -2499,7 +2499,7 @@
+ /*}}}*/
+ void       Element::PicoUpdateBoxid(int* max_boxid_basin_list){/*{{{*/
+ 
+-	if(!this->IsIceInElement() || !this->IsFloating()) return;
++	if(!this->IsIceInElement() || !this->IsAllFloating()) return;
+ 
+ 	int        basin_id;
+ 	IssmDouble dist_gl,dist_cf;
+@@ -2540,7 +2540,7 @@
+ }/*}}}*/
+ void       Element::PicoUpdateBox(int loopboxid){/*{{{*/
+ 
+-	if(!this->IsIceInElement() || !this->IsFloating()) return;
++	if(!this->IsIceInElement() || !this->IsAllFloating()) return;
+ 
+ 	int boxid;
+ 	this->GetInputValue(&boxid,BasalforcingsPicoBoxIdEnum);
+@@ -2674,7 +2674,7 @@
+ }/*}}}*/
+ void       Element::PicoComputeBasalMelt(){/*{{{*/
+ 
+-	if(!this->IsIceInElement() || !this->IsFloating()) return;
++	if(!this->IsIceInElement() || !this->IsAllFloating()) return;
+ 
+ 	const int NUM_VERTICES = this->GetNumberOfVertices();
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26328)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26329)
+@@ -139,7 +139,7 @@
+ 		void               InputUpdateFromConstant(bool constant, int name);
+ 		void               InputUpdateFromConstant(IssmDouble constant, int name, int type);
+ 
+-		bool               IsFloating();
++		bool               IsAllFloating();
+ 		bool               IsGrounded();
+ 		bool               IsOnBase();
+ 		bool               IsOnSurface();
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26329)
+@@ -2127,7 +2127,7 @@
+ 	IssmDouble base,bed,surface,bathymetry,scalefactor;
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+-	if(!IsIceInElement() || IsFloating() || !IsOnBase())return 0;
++	if(!IsIceInElement() || IsAllFloating() || !IsOnBase())return 0;
+ 
+ 	rho_ice=FindParam(MaterialsRhoIceEnum);
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+@@ -5037,7 +5037,7 @@
+ //					for(j=0;j<6;j++)thickness[j]=values[j];
+ 
+ 					/*build new bed and surface: */
+-					if (this->IsFloating()){
++					if (this->IsAllFloating()){
+ 						/*hydrostatic equilibrium: */
+ 						IssmDouble rho_ice,rho_water,di;
+ 						rho_ice=this->FindParam(MaterialsRhoIceEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26329)
+@@ -3575,7 +3575,7 @@
+ 	IssmDouble base,surface,bed,bathymetry,scalefactor;
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+-	if(!IsIceInElement() || IsFloating())return 0;
++	if(!IsIceInElement() || IsAllFloating())return 0;
+ 
+ 	rho_ice=FindParam(MaterialsRhoIceEnum);
+ 	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+@@ -7873,7 +7873,7 @@
+ 					Element::GetInputListOnVertices(&surface[0],SurfaceEnum);
+ 
+ 					/*build new bed and surface: */
+-					if (this->IsFloating()){
++					if (this->IsAllFloating()){
+ 						/*hydrostatic equilibrium: */
+ 						IssmDouble rho_ice,rho_water,di;
+ 						rho_ice   = this->FindParam(MaterialsRhoIceEnum);
+Index: ../trunk-jpl/src/c/classes/Loads/Neumannflux.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Neumannflux.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/classes/Loads/Neumannflux.cpp	(revision 26329)
+@@ -353,7 +353,7 @@
+ 	/*Initialize Load Vector and return if necessary*/
+ 	Tria*  tria=(Tria*)element;
+ 	_assert_(tria->FiniteElement()==P1Enum); 
+-	if(!tria->IsIceInElement() || tria->IsFloating()) return NULL;
++	if(!tria->IsIceInElement() || tria->IsAllFloating()) return NULL;
+ 
+ 	/*Initialize Element vector and other vectors*/
+ 	ElementVector* pe=new ElementVector(nodes,NUMNODES_BOUNDARY,this->parameters);
+@@ -395,7 +395,7 @@
+ 	/*Initialize Load Vector and return if necessary*/
+ 	Tria*  tria=(Tria*)element;
+ 	_assert_(tria->FiniteElement()==P1Enum); 
+-	if(!tria->IsIceInElement() || tria->IsFloating()) return NULL;
++	if(!tria->IsIceInElement() || tria->IsAllFloating()) return NULL;
+ 
+ 	/*Initialize Element vector and other vectors*/
+ 	ElementVector* pe=new ElementVector(nodes,NUMNODES_BOUNDARY,this->parameters);
+Index: ../trunk-jpl/src/c/classes/Node.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.h	(revision 26328)
++++ ../trunk-jpl/src/c/classes/Node.h	(revision 26329)
+@@ -94,8 +94,6 @@
+ 		void  HardDeactivate(void);
+ 		bool  IsActive(void);
+ 		int   IsClone();
+-		int   IsFloating();
+-		int   IsGrounded();
+ 		int   Lid(void); 
+ 		void  DistributeGlobalDofsMasters(int dofcount,int setenum);
+ 		void  ReindexingDone(void);
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26329)
+@@ -56,7 +56,7 @@
+ 	for(int i=0;i<num_basins;i++){dmax_basin_cpu[i]=-1;}
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element=xDynamicCast<Element*>(object);
+-		if(!element->IsIceInElement() || !element->IsFloating()) continue;
++		if(!element->IsIceInElement() || !element->IsAllFloating()) continue;
+ 		numvertices = element->GetNumberOfVertices();
+ 		distances=xNew<IssmDouble>(numvertices);
+ 		element->GetInputListOnVertices(&distances[0],DistanceToGroundinglineEnum);
+@@ -115,7 +115,7 @@
+ 		Element* element=xDynamicCast<Element*>(object);
+ 		if(!element->IsOnBase()) continue;
+ 		Element* basalelement = element->SpawnBasalElement();
+-		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()){
++		if(!basalelement->IsIceInElement() || !basalelement->IsAllFloating()){
+ 			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 			continue;
+ 		}
+@@ -165,7 +165,7 @@
+ 		Element* element=xDynamicCast<Element*>(object);
+ 		if(!element->IsOnBase()) continue;
+ 		Element* basalelement = element->SpawnBasalElement();
+-		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()){
++		if(!basalelement->IsIceInElement() || !basalelement->IsAllFloating()){
+ 			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 			continue;
+ 		}
+@@ -208,7 +208,7 @@
+ 			Element* element=xDynamicCast<Element*>(object);
+ 			if(!element->IsOnBase()) continue;
+ 			Element* basalelement = element->SpawnBasalElement();
+-			if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
++			if(!basalelement->IsIceInElement() || !basalelement->IsAllFloating()) continue;
+ 			int el_boxid;
+ 			basalelement->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+ 			if(el_boxid!=boxid) continue;
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 26328)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 26329)
+@@ -100,7 +100,7 @@
+ 		int      numvertices = element->GetNumberOfVertices();
+ 
+ 		/*Set melt to 0 if non floating*/
+-		if(!element->IsIceInElement() || !element->IsFloating() || !element->IsOnBase()){
++		if(!element->IsIceInElement() || !element->IsAllFloating() || !element->IsOnBase()){
+ 			IssmDouble* values = xNewZeroInit<IssmDouble>(numvertices);
+ 			element->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1DGEnum);
+ 			element->AddInput(BasalforcingsIsmip6TfShelfEnum,values,P1DGEnum);
+@@ -158,7 +158,7 @@
+ 		/*Compute sums of tf*area and shelf-area per cpu*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+-			if(!element->IsOnBase() || !element->IsIceInElement() || !element->IsFloating()) continue;
++			if(!element->IsOnBase() || !element->IsIceInElement() || !element->IsAllFloating()) continue;
+ 			/*Spawn basal element if on base to compute element area*/
+ 			Element* basalelement = element->SpawnBasalElement();
+ 			Input* tf_input=basalelement->GetInput(BasalforcingsIsmip6TfShelfEnum); _assert_(tf_input);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26329-26330.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26329-26330.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26329-26330.diff	(revision 26740)
@@ -0,0 +1,3817 @@
+Index: ../trunk-jpl/src/m/classes/clusters/aurora.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/aurora.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/aurora.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%AURORA class definition
++%AURORA cluster class definition
+ %
+ %   Usage:
+ %      cluster=aurora();
+@@ -6,129 +6,129 @@
+ %      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) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name='aurora.jpl.nasa.gov'
++		login='username';
++		numnodes = 1;
++		cpuspernode = 24;
++		modules = {'intel/cluster-toolkit-2013.5.192'};
++		port=1070;
++		queue='shortq';
++		time=3*60;
++		codepath='~/issm/trunk/';
++		executionpath='~/issm/trunk/execution/';
++		mpipath='/opt/intel/impi/4.1.3/intel64/bin/';
++		%}}}
++	end
++	methods
++		function cluster=aurora(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('aurora_settings')==2), aurora_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('aurora_settings')==2), aurora_settings; end
+ 
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    queue: %s',cluster.queue));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    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=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'debugq','shortq','mediumq','longq','verylongq'};
+-			 queue_requirements_time=[60*1 60*3 60*12 60*48 60*192];
+-			 queue_requirements_np=[16 256 256 128 128];
++			available_queues={'debugq','shortq','mediumq','longq','verylongq'};
++			queue_requirements_time=[60*1 60*3 60*12 60*48 60*192];
++			queue_requirements_np=[16 256 256 128 128];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.numnodes.*cluster.cpuspernode,cluster.time)
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.numnodes.*cluster.cpuspernode,cluster.time)
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+-			 executable='issm.exe';
+-			 if isdakota,
+-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+-				 if (version>=6),
+-					 executable='issm_dakota.exe';
+-				 end
+-			 end
+-			 if isoceancoupling,
+-				 executable='issm_ocean.exe';
+-			 end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			executable='issm.exe';
++			if isdakota,
++				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
++				if (version>=6),
++					executable='issm_dakota.exe';
++				end
++			end
++			if isoceancoupling,
++				executable='issm_ocean.exe';
++			end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#PBS -l select=%i:ncpus=%i\n',cluster.numnodes,cluster.cpuspernode);
+-			 fprintf(fid,'#PBS -N %s\n',modelname);
+-			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+-			 fprintf(fid,'#PBS -q %s\n',cluster.queue);
+-			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+-			 fprintf(fid,'source /usr/share/Modules/init/bash\n');
+-			 for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n\n']); end
+-			 fprintf(fid,'export PATH="$PATH:."\n\n');
+-			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+-			 fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');      
+-			 fprintf(fid,'export PATH="$PATH:.:%s"\n',cluster.mpipath);
+-			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+-			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+-			 fprintf(fid,'mpirun -n %i %s/%s %s %s %s',cluster.np(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-			 fclose(fid);
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#PBS -l select=%i:ncpus=%i\n',cluster.numnodes,cluster.cpuspernode);
++			fprintf(fid,'#PBS -N %s\n',modelname);
++			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
++			fprintf(fid,'#PBS -q %s\n',cluster.queue);
++			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
++			fprintf(fid,'#PBS -e %s.errlog \n',modelname);
++			fprintf(fid,'source /usr/share/Modules/init/bash\n');
++			for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n\n']); end
++			fprintf(fid,'export PATH="$PATH:."\n\n');
++			fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
++			fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');      
++			fprintf(fid,'export PATH="$PATH:.:%s"\n',cluster.mpipath);
++			fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
++			fprintf(fid,'cd $PBS_O_WORKDIR\n');
++			fprintf(fid,'mpirun -n %i %s/%s %s %s %s',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++			fclose(fid);
+ 
+-		 end
+-		 %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++		end
++		%}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+-			 end
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
++			end
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++			disp('launching solution sequence on remote cluster');
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+ 
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/camhpc.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/camhpc.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/camhpc.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%PFE class definition
++%CAMHPC cluster class definition
+ %
+ %   Usage:
+ %      cluster=camhpc();
+@@ -6,146 +6,146 @@
+ %      cluster=camhpc('np',3,'login','username');
+ 
+ classdef camhpc
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name          = 'camhpc'
+-		 login         = '';
+-		 numnodes      = 20;
+-		 cpuspernode   = 8;
+-		 port          = 8000;
+-		 project       = '';
+-		 partition     = '';
+-		 codepath      = '';
+-		 executionpath = '';
+-		 interactive   = 0;
+-		 time          = 24*60;
+-		 memory        = 2;
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=camhpc(varargin) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name          = 'camhpc'
++		login         = '';
++		numnodes      = 20;
++		cpuspernode   = 8;
++		port          = 8000;
++		project       = '';
++		partition     = '';
++		codepath      = '';
++		executionpath = '';
++		interactive   = 0;
++		time          = 24*60;
++		memory        = 2;
++	end
++	%}}}
++	methods
++		function cluster=camhpc(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('camhpc_settings')==2), camhpc_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('camhpc_settings')==2), camhpc_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    project: %s',cluster.project));
+-			 disp(sprintf('    partition: %s',cluster.partition));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    memory: %i',cluster.memory));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    project: %s',cluster.project));
++			disp(sprintf('    partition: %s',cluster.partition));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    memory: %i',cluster.memory));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'ARNOLD-SL3-CPU'}; % Updated for csd3 NSA 28/3/18
+-			 queue_requirements_time=[Inf Inf];
+-			 queue_requirements_np=[80 80];
++			available_queues={'ARNOLD-SL3-CPU'}; % Updated for csd3 NSA 28/3/18
++			queue_requirements_time=[Inf Inf];
++			queue_requirements_np=[80 80];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.project,cluster.np,1)
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.project,cluster.np,1)
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+ 
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-             disp(modelname)
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+-			 fprintf(fid,'#SBATCH -p %s \n',cluster.partition);
+-			 fprintf(fid,'#SBATCH -A %s \n',cluster.project);
+-			 fprintf(fid,'#SBATCH --mail-type=ALL\n');
+-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60) %walltime is in seconds.
+-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++			%write queuing script
++			disp(modelname)
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
++			fprintf(fid,'#SBATCH -p %s \n',cluster.partition);
++			fprintf(fid,'#SBATCH -A %s \n',cluster.project);
++			fprintf(fid,'#SBATCH --mail-type=ALL\n');
++			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60) %walltime is in seconds.
++			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.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,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-				 if ~io_gather, %concatenate the output files:
+-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-				 end
+-				 fclose(fid);
+-				 fid=fopen([modelname '.errlog'],'w');
+-				 fclose(fid);
+-				 fid=fopen([modelname '.outlog'],'w');
+-				 fclose(fid);
+-			 end
+-		 end %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.run'],'w');
++				fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
++				fid=fopen([modelname '.errlog'],'w');
++				fclose(fid);
++				fid=fopen([modelname '.outlog'],'w');
++				fclose(fid);
++			end
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 disp('launching solution sequence on remote cluster');
++			disp('launching solution sequence on remote cluster');
+              %
+              % qsub replaced by sbatch for csd3 system NSA 28/3/18
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+-			 end
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/discover.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/discover.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/discover.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%PFE class definition
++%DISCOVER cluster class definition
+ %
+ %   Usage:
+ %      cluster=discover();
+@@ -5,222 +5,222 @@
+ %      cluster=discover('np',3);
+ %      cluster=discover('np',3,'login','username');
+ 
+-classdef discover 
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name=oshostname();
+-		 login='';
+-		 modules        = {};
+-		 numnodes=20;
+-		 cpuspernode=8; 
+-		 port=0;
+-		 queue='general';
+-		 time=12*60*60;
+-		 processor='west';
+-		 codepath='';
+-		 executionpath='';
+-		 interactive=0;
+-		 bbftp=0;
+-		 numstreams=8;
+-		 hyperthreading=0;
+-		 email='';
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=discover(varargin) % {{{
++classdef discover
++	properties (SetAccess=public)
++		% {{{
++		name=oshostname();
++		login='';
++		modules        = {};
++		numnodes=20;
++		cpuspernode=8; 
++		port=0;
++		queue='general';
++		time=12*60*60;
++		processor='west';
++		codepath='';
++		executionpath='';
++		interactive=0;
++		bbftp=0;
++		numstreams=8;
++		hyperthreading=0;
++		email='';
++	end
++	%}}}
++	methods
++		function cluster=discover(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('discover_settings')==2), discover_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('discover_settings')==2), discover_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    queue: %s',cluster.queue));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    processor: %s',cluster.processor));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-			 disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
+-			 disp(sprintf('    email: %s',cluster.email));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    processor: %s',cluster.processor));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++			disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
++			disp(sprintf('    email: %s',cluster.email));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'long','allnccs','debug'};
+-			 queue_requirements_time=[24*60*60 12*60*60 1*60*60];
+-			 queue_requirements_np=[560 6000 532];
++			available_queues={'long','allnccs','debug'};
++			queue_requirements_time=[24*60*60 12*60*60 1*60*60];
++			queue_requirements_np=[560 6000 532];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 
+-			 %now, check cluster.cpuspernode according to processor type
+-			 if ( strcmpi(cluster.processor,'sand')),
+-				 if ((cluster.cpuspernode>16 ) | (cluster.cpuspernode<1)),
+-					 md = checkmessage(md,'cpuspernode should be between 1 and 16 for ''sand'' processors');
+-				 end
+-			 elseif strcmpi(cluster.processor,'hasw'),
+-				 if ((cluster.cpuspernode>28 ) | (cluster.cpuspernode<1)),
+-					 md = checkmessage(md,'cpuspernode should be between 1 and 28 for ''hasw'' processors');
+-				 end
+-			 else
+-				 md = checkmessage(md,'unknown processor type, should be ''sand'' or ''hasw'' ');
+-			 end
++			%now, check cluster.cpuspernode according to processor type
++			if ( strcmpi(cluster.processor,'sand')),
++				if ((cluster.cpuspernode>16 ) | (cluster.cpuspernode<1)),
++					md = checkmessage(md,'cpuspernode should be between 1 and 16 for ''sand'' processors');
++				end
++			elseif strcmpi(cluster.processor,'hasw'),
++				if ((cluster.cpuspernode>28 ) | (cluster.cpuspernode<1)),
++					md = checkmessage(md,'cpuspernode should be between 1 and 28 for ''hasw'' processors');
++				end
++			else
++				md = checkmessage(md,'unknown processor type, should be ''sand'' or ''hasw'' ');
++			end
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+ 
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isgprof),    disp('gprof 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
++			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');
++			%write queuing script
++			fid=fopen([modelname '.queue'],'w');
+ 
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH -J %s \n',modelname);
+-			 fprintf(fid,'#SBATCH --qos=%s \n',cluster.queue);
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
+-			 fprintf(fid,'#SBATCH -t %02i:%02i:00 \n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
+-			 fprintf(fid,'#SBATCH -A s1690 \n\n');
+-			 for i=1:numel(cluster.modules),
+-				 fprintf(fid,['module load ' cluster.modules{i} '\n']);
+-			 end
+-			 if length(find(cluster.email=='@'))>0
+-				 fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
+-				 fprintf(fid,'#SBATCH --mail-type=end \n\n');
+-			 end
+-			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+-			 fprintf(fid,'module load comp/intel/20.0.0.166\n');
+-			 fprintf(fid,'module load mpi/sgi-mpt/2.17\n');
+-			 fprintf(fid,'module load cmake/3.17.0\n');
+-			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+-			 fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
+-			 fprintf(fid,'export PATH="$PATH:."\n\n');
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH -J %s \n',modelname);
++			fprintf(fid,'#SBATCH --qos=%s \n',cluster.queue);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
++			fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*cluster.cpuspernode);
++			fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
++			fprintf(fid,'#SBATCH -t %02i:%02i:00 \n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
++			fprintf(fid,'#SBATCH -A s1690 \n\n');
++			for i=1:numel(cluster.modules),
++				fprintf(fid,['module load ' cluster.modules{i} '\n']);
++			end
++			if length(find(cluster.email=='@'))>0
++				fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
++				fprintf(fid,'#SBATCH --mail-type=end \n\n');
++			end
++			fprintf(fid,'. /usr/share/modules/init/bash\n\n');
++			fprintf(fid,'module load comp/intel/20.0.0.166\n');
++			fprintf(fid,'module load mpi/sgi-mpt/2.17\n');
++			fprintf(fid,'module load cmake/3.17.0\n');
++			fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
++			fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
++			fprintf(fid,'export PATH="$PATH:."\n\n');
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+ 
+-			 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
+ 
+-			 %in interactive mode, create a run file, and errlog and outlog file
+-			 if cluster.interactive,
+-				 fid=fopen([modelname '.run'],'w');
+-				 if ~isvalgrind,
+-					 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-				 else
+-					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-				 end
+-				 if ~io_gather, %concatenate the output files:
+-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-				 end
+-				 fclose(fid);
+-				 fid=fopen([modelname '.errlog'],'w');
+-				 fclose(fid);
+-				 fid=fopen([modelname '.outlog'],'w');
+-				 fclose(fid);
+-			 end
+-		 end %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.run'],'w');
++				if ~isvalgrind,
++					fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++				else
++					fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++				end
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
++				fid=fopen([modelname '.errlog'],'w');
++				fclose(fid);
++				fid=fopen([modelname '.outlog'],'w');
++				fclose(fid);
++			end
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.run '  modelname '.errlog ' modelname '.outlog '];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.run '  modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 if cluster.interactive,
+-				 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+-			 else 
+-				 directory=cluster.executionpath;
+-			 end
++			disp('uploading input file and queueing script');
++			if cluster.interactive,
++				directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
++			else 
++				directory=cluster.executionpath;
++			end
+ 
+-			 if ~cluster.bbftp,
+-				 issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+-			 else
+-				 issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
+-			 end
++			if ~cluster.bbftp,
++				issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			else
++				issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
++			end
+ 
+-		 end
+-		 %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end
++		%}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 if ~cluster.interactive, 
+-				 if ~isempty(restart)
+-					 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
+-				 else
+-					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
+-				 end
+-			 else
+-				 if ~isempty(restart)
+-					 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+-				 else
+-					 launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive) ' && tar -zxf ' dirname '.tar.gz'];
+-				 end
+-			 end
++			if ~cluster.interactive, 
++				if ~isempty(restart)
++					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
++				else
++					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
++				end
++			else
++				if ~isempty(restart)
++					launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
++				else
++					launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive) ' && tar -zxf ' dirname '.tar.gz'];
++				end
++			end
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end
+-		 %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end
++		%}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 if ~cluster.interactive,
+-				 directory=[cluster.executionpath '/' dirname '/'];
+-			 else
+-				 directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
+-			 end
++			%copy files from cluster to current directory
++			if ~cluster.interactive,
++				directory=[cluster.executionpath '/' dirname '/'];
++			else
++				directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
++			end
+ 
+-			 if ~cluster.bbftp,
+-				 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+-			 else
+-				 issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
+-			 end
++			if ~cluster.bbftp,
++				issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			else
++				issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
++			end
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26330)
+@@ -285,7 +285,7 @@
+ 			end
+ 		end
+ 		%}}}
+-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+ 			if ~ispc,
+ 
+@@ -306,7 +306,7 @@
+ 				issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 			end
+ 		end %}}}
+-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+ 			if ~ispc,
+ 				%figure out what shell extension we will use:
+@@ -335,7 +335,7 @@
+ 			end
+ 
+ 		end %}}}
+-		function LaunchQueueJobIceOcean(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		function LaunchQueueJobIceOcean(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+ 			if ~ispc,
+ 
+@@ -364,7 +364,7 @@
+ 			end
+ 
+ 		end %}}}
+-		function Download(cluster,dirname,filelist)% {{{
++		function Download(cluster,dirname,filelist) % {{{
+ 
+ 			if ispc(),
+ 				%do nothing
+Index: ../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26330)
+@@ -3,6 +3,7 @@
+ 
+ import numpy as np
+ 
++from fielddisplay import fielddisplay
+ try:
+     from generic_settings import generic_settings
+ except ImportError:
+@@ -38,20 +39,19 @@
+         self.verbose = 1
+         self.shell = '/bin/sh'
+ 
+-        #use provided options to change fields
++        # Use provided options to change fields
+         options = pairoptions(*args)
+ 
+-        #get name
++        # Get name
+         self.name = gethostname()
+ 
+-        #initialize cluster using user settings if provided
+-
++        # Initialize cluster using user settings if provided
+         try:
+             self = generic_settings(self)
+         except NameError:
+-            print("generic_settings.py not found, using default settings")
++            print('generic_settings.py not found, using default settings')
+ 
+-        #OK get other fields
++        # OK get other fields
+         self = options.AssignObjectFields(self)
+     # }}}
+ 
+@@ -58,17 +58,17 @@
+     def __repr__(self):  # {{{
+         #  display the object
+         s = "class '%s' object '%s' = \n" % (type(self), 'self')
+-        s += "    name: %s\n" % self.name
+-        s += "    login: %s\n" % self.login
+-        s += "    np: %i\n" % self.np
+-        s += "    port: %i\n" % self.port
+-        s += "    codepath: %s\n" % self.codepath
+-        s += "    executionpath: %s\n" % self.executionpath
+-        s += "    valgrind: %s\n" % self.valgrind
+-        s += "    valgrindlib: %s\n" % self.valgrindlib
+-        s += "    valgrindsup: %s\n" % self.valgrindsup
+-        s += "    verbose: %s\n" % self.verbose
+-        s += "    shell: %s\n" % self.shell
++        s += '{}\n'.format(fielddisplay(self, 'name', ''))
++        s += '{}\n'.format(fielddisplay(self, 'login', ''))
++        s += '{}\n'.format(fielddisplay(self, 'np', ''))
++        s += '{}\n'.format(fielddisplay(self, 'port', ''))
++        s += '{}\n'.format(fielddisplay(self, 'codepath', ''))
++        s += '{}\n'.format(fielddisplay(self, 'executionpath', ''))
++        s += '{}\n'.format(fielddisplay(self, 'valgrind', ''))
++        s += '{}\n'.format(fielddisplay(self, 'valgrindlib', ''))
++        s += '{}\n'.format(fielddisplay(self, 'valgrindsup', ''))
++        s += '{}\n'.format(fielddisplay(self, 'verbose', ''))
++        s += '{}\n'.format(fielddisplay(self, 'shell', ''))
+         return s
+     # }}}
+ 
+Index: ../trunk-jpl/src/m/classes/clusters/greenplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%PFE class definition
++%GREENPLANET cluster class definition
+ %
+ %   Usage:
+ %      cluster=greenplanet();
+@@ -6,172 +6,172 @@
+ %      cluster=greenplanet('np',3,'login','username');
+ 
+ classdef greenplanet
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name          = 'greenplanet'
+-		 login         = '';
+-		 numnodes      = 20;
+-		 cpuspernode   = 8;
+-		 port          = 8000;
+-		 queue         = 'c6145';
+-		 codepath      = '';
+-		 executionpath = '';
+-		 interactive   = 0;
+-		 time          = 24*60;
+-		 memory        = 2;
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=greenplanet(varargin) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name          = 'greenplanet'
++		login         = '';
++		numnodes      = 20;
++		cpuspernode   = 8;
++		port          = 8000;
++		queue         = 'c6145';
++		codepath      = '';
++		executionpath = '';
++		interactive   = 0;
++		time          = 24*60;
++		memory        = 2;
++	end
++	%}}}
++	methods
++		function cluster=greenplanet(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('greenplanet_settings')==2), greenplanet_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('greenplanet_settings')==2), greenplanet_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    queue: %s',cluster.queue));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    memory: %i',cluster.memory));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    memory: %i',cluster.memory));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'brd2.4','has2.5','ilg2.3','m-c1.9','m-c2.2','nes2.8','sib2.9','m2090','default'};
+-			 queue_requirements_time=[Inf Inf Inf Inf Inf Inf Inf Inf Inf];
+-			 queue_requirements_np=[80 80 80 80 80 80 80 80 80];
++			available_queues={'brd2.4','has2.5','ilg2.3','m-c1.9','m-c2.2','nes2.8','sib2.9','m2090','default'};
++			queue_requirements_time=[Inf Inf Inf Inf Inf Inf Inf Inf Inf];
++			queue_requirements_np=[80 80 80 80 80 80 80 80 80];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			%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) % {{{
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
++			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
++			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
++			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+-			 fprintf(fid,'#SBATCH --partition=%s',cluster.queue{1});
+-			 for i=2:length(cluster.queue) 
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
++			fprintf(fid,'#SBATCH --partition=%s',cluster.queue{1});
++			for i=2:length(cluster.queue) 
+ 				fprintf(fid,',%s',cluster.queue{i});
+-			 end
+-			 fprintf(fid,'\n');
+-			 %fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+-			 %fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+-			 fprintf(fid,'#SBATCH --nodes=%i\n',cluster.numnodes); % in general, just 1
+-			 fprintf(fid,'#SBATCH --ntasks=%i\n',cluster.cpuspernode); % in general, just 1
+-			 fprintf(fid,'#SBATCH --cpus-per-task=%i\n',1); 
+-			 fprintf(fid,'#SBATCH --mem=%igb\n',cluster.memory); % minimum total node memory required
+-			 fprintf(fid,'#SBATCH --time=%s\n',datestr(cluster.time/24,'HH:MM:SS')); %walltime is in HH:MM:SS format. cluster.time is in hour
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++			end
++			fprintf(fid,'\n');
++			%fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			%fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			fprintf(fid,'#SBATCH --nodes=%i\n',cluster.numnodes); % in general, just 1
++			fprintf(fid,'#SBATCH --ntasks=%i\n',cluster.cpuspernode); % in general, just 1
++			fprintf(fid,'#SBATCH --cpus-per-task=%i\n',1); 
++			fprintf(fid,'#SBATCH --mem=%igb\n',cluster.memory); % minimum total node memory required
++			fprintf(fid,'#SBATCH --time=%s\n',datestr(cluster.time/24,'HH:MM:SS')); %walltime is in HH:MM:SS format. cluster.time is in hour
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.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)% {{{
++			%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);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+-			 end
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/hpc.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/hpc.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/hpc.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%HPC class definition
++%HPC cluster class definition
+ %
+ %   Usage:
+ %      cluster=hpc();
+@@ -6,160 +6,160 @@
+ %      cluster=hpc('np',3,'login','username');
+ 
+ classdef hpc
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name='hpc.oit.uci.edu'
+-		 login='';
+-		 numnodes=1;
+-		 cpuspernode=4; 
+-		 port=0;
+-		 queue='pub64';
+-		 codepath='';
+-		 executionpath='';
+-		 interactive=0;
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=hpc(varargin) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name='hpc.oit.uci.edu'
++		login='';
++		numnodes=1;
++		cpuspernode=4; 
++		port=0;
++		queue='pub64';
++		codepath='';
++		executionpath='';
++		interactive=0;
++	end
++	%}}}
++	methods
++		function cluster=hpc(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('hpc_settings')==2), hpc_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('hpc_settings')==2), hpc_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    queue: %s',cluster.queue));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'pub64','free64','free48','free*,pub64','free*'};
+-			 queue_requirements_time=[Inf Inf Inf Inf Inf];
+-			 queue_requirements_np=[64 64 48 48 48];
++			available_queues={'pub64','free64','free48','free*,pub64','free*'};
++			queue_requirements_time=[Inf Inf Inf Inf Inf];
++			queue_requirements_np=[64 64 48 48 48];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+ 
+-		 end
+-		 %}}}
+-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#$ -N %s\n',modelname);
+-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
+-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+-			 fprintf(fid,'#$ -R y\n');
+-			 fprintf(fid,'#$ -m beas\n');
+-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#$ -N %s\n',modelname);
++			fprintf(fid,'#$ -q %s \n',cluster.queue);
++			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
++			fprintf(fid,'#$ -R y\n');
++			fprintf(fid,'#$ -m beas\n');
++			fprintf(fid,'#$ -o %s.outlog \n',modelname);
++			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
++			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#$ -N %s\n',modelname);
+-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
+-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+-			 fprintf(fid,'#$ -R y\n');
+-			 %fprintf(fid,'#$ -m beas\n');
+-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#$ -N %s\n',modelname);
++			fprintf(fid,'#$ -q %s \n',cluster.queue);
++			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
++			fprintf(fid,'#$ -R y\n');
++			%fprintf(fid,'#$ -m beas\n');
++			fprintf(fid,'#$ -o %s.outlog \n',modelname);
++			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
+ 
+-			 %in interactive mode, create a run file, and errlog and outlog file
+-			 if cluster.interactive,
+-				 fid=fopen([modelname '.run'],'w');
+-				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-				 if ~io_gather, %concatenate the output files:
+-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-				 end
+-				 fclose(fid);
+-				 fid=fopen([modelname '.errlog'],'w');
+-				 fclose(fid);
+-				 fid=fopen([modelname '.outlog'],'w');
+-				 fclose(fid);
+-			 end
+-		 end %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.run'],'w');
++				fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
++				fid=fopen([modelname '.errlog'],'w');
++				fclose(fid);
++				fid=fopen([modelname '.outlog'],'w');
++				fclose(fid);
++			end
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+-			 end
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/hpc_simba.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/hpc_simba.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/hpc_simba.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%HPC class definition
++%HPC_SIMBA cluster class definition
+ %
+ %   Usage:
+ %      cluster=hpc();
+@@ -6,177 +6,177 @@
+ %      cluster=hpc('np',3,'login','username');
+ 
+ classdef hpc_simba
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name='simba00'
+-		 login='inwoo';
+-		 numnodes=1;
+-		 cpuspernode=36; 
+-		 np=4;
+-		 port=7777;
+-		 queue='pub64';
+-		 codepath='/home/DATA/externalpackagesissm/issm/trunk-jpl/bin';
+-		 executionpath='/home/DATA/externalpackages/issm/trunk-jpl/execution/';
+-		 interactive=0;
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=hpc_simba(varargin) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name='simba00'
++		login='inwoo';
++		numnodes=1;
++		cpuspernode=36; 
++		np=4;
++		port=7777;
++		queue='pub64';
++		codepath='/home/DATA/externalpackagesissm/issm/trunk-jpl/bin';
++		executionpath='/home/DATA/externalpackages/issm/trunk-jpl/execution/';
++		interactive=0;
++	end
++	%}}}
++	methods
++		function cluster=hpc_simba(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('hpc_settings')==2), hpc_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('hpc_settings')==2), hpc_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    queue: %s',cluster.queue));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-		 end
+-		 %}}}
+-		 %function numprocs=np(cluster) % {{{
+-		%	 %compute number of processors
+-		%	 numprocs=cluster.numnodes*cluster.cpuspernode;
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++		end
++		%}}}
++		%function numprocs=nprocs(cluster) % {{{
++		%	%compute number of processors
++		%	numprocs=cluster.numnodes*cluster.cpuspernode;
+ 		% end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'pub64','free64','free48','free*,pub64','free*'};
+-			 queue_requirements_time=[Inf Inf Inf Inf Inf];
+-			 queue_requirements_np=[64 64 48 48 48];
++			available_queues={'pub64','free64','free48','free*,pub64','free*'};
++			queue_requirements_time=[Inf Inf Inf Inf Inf];
++			queue_requirements_np=[64 64 48 48 48];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+ 
+-		 end
+-		 %}}}
+-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#$ -N %s\n',modelname);
+-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
+-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+-			 fprintf(fid,'#$ -R y\n');
+-			 fprintf(fid,'#$ -m beas\n');
+-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#$ -N %s\n',modelname);
++			fprintf(fid,'#$ -q %s \n',cluster.queue);
++			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
++			fprintf(fid,'#$ -R y\n');
++			fprintf(fid,'#$ -m beas\n');
++			fprintf(fid,'#$ -o %s.outlog \n',modelname);
++			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
++			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 if 0
+-				 fprintf(fid,'#!/bin/bash\n');
+-				 fprintf(fid,'#$ -N %s\n',modelname);
+-				 fprintf(fid,'#$ -q %s \n',cluster.queue);
+-				 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+-				 fprintf(fid,'#$ -R y\n');
+-				 %fprintf(fid,'#$ -m beas\n');
+-				 fprintf(fid,'#$ -o %s.outlog \n',modelname);
+-				 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+-			 else % FIXME : This script for SIMBA-Kopri 
+-				 fprintf(fid,'#!/bin/bash\n');
+-				 %fprintf(fid,'#PBS -q workq\n');
+-				 fprintf(fid,'#PBS -N %s\n',modelname);
+-				 %fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
+-				%	 ceil(cluster.np/cluster.cpuspernode), cluster.np);
+-				 fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			if 0
++				fprintf(fid,'#!/bin/bash\n');
++				fprintf(fid,'#$ -N %s\n',modelname);
++				fprintf(fid,'#$ -q %s \n',cluster.queue);
++				fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
++				fprintf(fid,'#$ -R y\n');
++				%fprintf(fid,'#$ -m beas\n');
++				fprintf(fid,'#$ -o %s.outlog \n',modelname);
++				fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
++			else % FIXME : This script for SIMBA-Kopri 
++				fprintf(fid,'#!/bin/bash\n');
++				%fprintf(fid,'#PBS -q workq\n');
++				fprintf(fid,'#PBS -N %s\n',modelname);
++				%fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
++				%	ceil(cluster.np/cluster.cpuspernode), cluster.np);
++				fprintf(fid,'#PBS -l nodes=simba01:ppn=%d\n',...
+ 					cluster.np);
+-				 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+-				 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+-				 fprintf(fid,'\n');
+-			 end
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'\n');
+-			 fprintf(fid,'module load intel18/impi-18\n');
+-			 fprintf(fid,'\n');
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++				fprintf(fid,'#PBS -o %s.outlog \n',modelname);
++				fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
++				fprintf(fid,'\n');
++			end
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'\n');
++			fprintf(fid,'module load intel18/impi-18\n');
++			fprintf(fid,'\n');
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
+ 
+-			 %in interactive mode, create a run file, and errlog and outlog file
+-			 if cluster.interactive,
+-				 fid=fopen([modelname '.run'],'w');
+-				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-				 if ~io_gather, %concatenate the output files:
+-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-				 end
+-				 fclose(fid);
+-				 fid=fopen([modelname '.errlog'],'w');
+-				 fclose(fid);
+-				 fid=fopen([modelname '.outlog'],'w');
+-				 fclose(fid);
+-			 end
+-		 end %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.run'],'w');
++				fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
++				fid=fopen([modelname '.errlog'],'w');
++				fclose(fid);
++				fid=fopen([modelname '.outlog'],'w');
++				fclose(fid);
++			end
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+-			 end
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/lonestar.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/lonestar.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/lonestar.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%LONESTAR class definition
++%LONESTAR cluster class definition
+ %
+ %   Usage:
+ %      cluster=lonestar();
+@@ -6,195 +6,195 @@
+ %      cluster=lonestar('np',3,'login','username');
+ 
+ classdef lonestar
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name          = 'ls5.tacc.utexas.edu'
+-		 login         = '';
+-		 modules        = {'intel/18.0.2' 'gsl'};
+-		 numnodes      = 1;
+-		 cpuspernode   = 24;
+-		 port          = 1099;
+-		 queue         = 'normal';
+-		 codepath      = '';
+-		 executionpath = '';
+-		 interactive   = 0;
+-		 time          = 48*60*60;
+-		 email         = '';
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=lonestar(varargin) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name          = 'ls5.tacc.utexas.edu'
++		login         = '';
++		modules        = {'intel/18.0.2' 'gsl'};
++		numnodes      = 1;
++		cpuspernode   = 24;
++		port          = 1099;
++		queue         = 'normal';
++		codepath      = '';
++		executionpath = '';
++		interactive   = 0;
++		time          = 48*60*60;
++		email         = '';
++	end
++	%}}}
++	methods
++		function cluster=lonestar(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('lonestar_settings')==2), lonestar_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('lonestar_settings')==2), lonestar_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+ 
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.np));
+-			 disp(sprintf('    queue: %s',cluster.queue));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    email: %s',cluster.email));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.np));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    email: %s',cluster.email));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'normal','development'};
+-			 queue_requirements_time=[48*60*60 2*60*60];
+-			 queue_requirements_np=[4104 264];
++			available_queues={'normal','development'};
++			queue_requirements_time=[48*60*60 2*60*60];
++			queue_requirements_np=[4104 264];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+-		 end
+-		 %}}}
+-		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#$ -N %s\n',modelname);
+-			 fprintf(fid,'#$ -q %s \n',cluster.queue);
+-			 fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
+-			 fprintf(fid,'#$ -R y\n');
+-			 fprintf(fid,'#$ -m beas\n');
+-			 fprintf(fid,'#$ -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
+-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#$ -N %s\n',modelname);
++			fprintf(fid,'#$ -q %s \n',cluster.queue);
++			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
++			fprintf(fid,'#$ -R y\n');
++			fprintf(fid,'#$ -m beas\n');
++			fprintf(fid,'#$ -o %s.outlog \n',modelname);
++			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
++			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 executable='issm.exe';
+-			 if isdakota,
+-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+-				 if (version>=6),
+-					 executable='issm_dakota.exe';
+-				 end
+-			 end
+-			 if isoceancoupling,
+-				 executable='issm_ocean.exe';
+-			 end
++			executable='issm.exe';
++			if isdakota,
++				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
++				if (version>=6),
++					executable='issm_dakota.exe';
++				end
++			end
++			if isoceancoupling,
++				executable='issm_ocean.exe';
++			end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
+ 
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH -J %s \n',modelname);
+-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.np/cluster.numnodes,24));
+-			 fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
+-			 fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
+-			 for i=1:numel(cluster.modules),
+-				 fprintf(fid,['module load ' cluster.modules{i} '\n']);
+-			 end
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH -J %s \n',modelname);
++			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
++			fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.np/cluster.numnodes,24));
++			fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
++			fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
++			for i=1:numel(cluster.modules),
++				fprintf(fid,['module load ' cluster.modules{i} '\n']);
++			end
+ 
+-			 if isdakota,
+-				 fprintf(fid,'export KMP_AFFINITY="granularity=fine,compact,verbose" \n\n');
+-			 end
++			if 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');
++			if length(find(cluster.email=='@'))>0
++				fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
++				fprintf(fid,'#SBATCH --mail-type=end \n\n');
+ 
+-				 %fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
+-			 end
++				%fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
++			end
+ 
+-			 fprintf(fid,'export PATH="$PATH:."\n\n');
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
++			fprintf(fid,'export PATH="$PATH:."\n\n');
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
+ 
+-			 fclose(fid);
++			fclose(fid);
+ 
+-			 %in interactive mode, create a run file, and errlog and outlog file
+-			 if cluster.interactive,
+-				 fid=fopen([modelname '.run'],'w');
+-				 fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.np,executable,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-				 if ~io_gather, %concatenate the output files:
+-					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-				 end
+-				 fclose(fid);
+-				 fid=fopen([modelname '.errlog'],'w');
+-				 fclose(fid);
+-				 fid=fopen([modelname '.outlog'],'w');
+-				 fclose(fid);
+-			 end
+-		 end %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.run'],'w');
++				fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.np,executable,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
++				fid=fopen([modelname '.errlog'],'w');
++				fclose(fid);
++				fid=fopen([modelname '.outlog'],'w');
++				fclose(fid);
++			end
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 if cluster.interactive,
+-				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+-			 end
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/maui.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/maui.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/maui.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%MAUI class definition
++%MAUI cluster class definition
+ %
+ %   Usage:
+ %      cluster=maui();
+@@ -6,147 +6,147 @@
+ %      cluster=maui('np',3,'login','username');
+ 
+ classdef maui
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name           = 'maui'
+-		 login          = '';
+-		 numnodes       = 1;
+-		 cpuspernode    = 8;
+-		 port           = 0;
+-		 projectaccount = '';
+-		 partition      = 'nesi_research';
+-		 codepath       = '';
+-		 executionpath  = '';
+-		 interactive    = 0;
+-		 time           = 24*60;
+-		 memory         = 2;
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=maui(varargin) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name           = 'maui'
++		login          = '';
++		numnodes       = 1;
++		cpuspernode    = 8;
++		port           = 0;
++		projectaccount = '';
++		partition      = 'nesi_research';
++		codepath       = '';
++		executionpath  = '';
++		interactive    = 0;
++		time           = 24*60;
++		memory         = 2;
++	end
++	%}}}
++	methods
++		function cluster=maui(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('maui_settings')==2), maui_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('maui_settings')==2), maui_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    projectaccount: %s',cluster.projectaccount));
+-			 disp(sprintf('    partition: %s',cluster.partition));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    memory: %i',cluster.memory));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    projectaccount: %s',cluster.projectaccount));
++			disp(sprintf('    partition: %s',cluster.partition));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    memory: %i',cluster.memory));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_partitions={'nesi_research'}
+-			 partition_requirements_time=[24*60];
+-			 partition_requirements_np=[80];
++			available_partitions={'nesi_research'}
++			partition_requirements_time=[24*60];
++			partition_requirements_np=[80];
+ 
+-			 QueueRequirements(available_partitions,partition_requirements_time,partition_requirements_np,cluster.partition,cluster.np,1)
++			QueueRequirements(available_partitions,partition_requirements_time,partition_requirements_np,cluster.partition,cluster.np,1)
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+-		 end
+-		 %}}}
+-		 function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+-			 error('not implemented yet');
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			error('not implemented yet');
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+-			 fprintf(fid,'#SBATCH --account=%s \n',cluster.projectaccount);
+-			 fprintf(fid,'#SBATCH --partition=%s \n',cluster.partition);
+-			 fprintf(fid,'#SBATCH --ntasks=%i  \n',cluster.numnodes);
+-			 fprintf(fid,'#SBATCH --cpus-per-task=%i\n',cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time); %walltime is in minutes
+-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'module swap PrgEnv-cray PrgEnv-intel\n');
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'srun -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
++			fprintf(fid,'#SBATCH --account=%s \n',cluster.projectaccount);
++			fprintf(fid,'#SBATCH --partition=%s \n',cluster.partition);
++			fprintf(fid,'#SBATCH --ntasks=%i  \n',cluster.numnodes);
++			fprintf(fid,'#SBATCH --cpus-per-task=%i\n',cluster.cpuspernode);
++			fprintf(fid,'#SBATCH --time=%i\n',cluster.time); %walltime is in minutes
++			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'module swap PrgEnv-cray PrgEnv-intel\n');
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'srun -n %i %s/issm.exe %s %s %s\n',cluster.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)% {{{
++			%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);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+-			 end
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%PFE class definition
++%PFE cluster class definition
+ %
+ %   Usage:
+ %      cluster=pfe();
+@@ -6,7 +6,7 @@
+ %      cluster=pfe('np',3,'login','username');
+ 
+ classdef pfe
+-	properties (SetAccess=public)  
++	properties (SetAccess=public)
+ 		% {{{
+ 		name           = 'pfe'
+ 		login          = '';
+@@ -38,25 +38,31 @@
+ 		end
+ 		%}}}
+ 		function disp(cluster) % {{{
+-			%  display the object
++			% TODO:
++			% - Correct formatting of modules and cluster.np
++			%
++
++			% display the object
+ 			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			disp(sprintf('    name: %s',cluster.name));
+-			disp(sprintf('    login: %s',cluster.login));
+-			modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1); 
+-			disp(sprintf('    modules: %s',modules));
+-			disp(sprintf('    port: %i',cluster.port));
+-			disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			disp(sprintf('    queue: %s',cluster.queue));
+-			disp(sprintf('    time: %i',cluster.time));
+-			disp(sprintf('    processor: %s',cluster.processor));
+-			disp(sprintf('    srcpath: %s ($ISSM_DIR on pfe)',cluster.srcpath));
+-			disp(sprintf('    codepath: %s  ($ISSM_DIR/bin on pfe)',cluster.codepath));
+-			disp(sprintf('    executionpath: %s  (directory containing issm.exe on pfe)',cluster.executionpath));
+-			disp(sprintf('    grouplist: %s',cluster.grouplist));
+-			disp(sprintf('    interactive: %i',cluster.interactive));
+-			disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
++			fielddisplay(cluster,'name','name of the cluster');
++			fielddisplay(cluster,'login','login');
++			modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1);
++			disp(sprintf('         modules                : %s',modules));
++			fielddisplay(cluster,'port','machine access port');
++			fielddisplay(cluster,'numnodes','number of nodes');
++			fielddisplay(cluster,'cpuspernode','number of CPUs per node');
++			disp(sprintf('         np:                    : %i             -- %s',cluster.np(),'number of CPUs'));
++			fielddisplay(cluster,'queue','name of the queue');
++			fielddisplay(cluster,'time','walltime requested');
++			fielddisplay(cluster,'processor','type of processor');
++			fielddisplay(cluster,'srcpath','$ISSM_DIR on pfe');
++			fielddisplay(cluster,'codepath','$ISSM_DIR/bin on pfe');
++			fielddisplay(cluster,'executionpath','directory containing issm.exe on pfe');
++			fielddisplay(cluster,'grouplist','grouplist');
++			fielddisplay(cluster,'interactive','');
++			fielddisplay(cluster,'bbftp','');
++			fielddisplay(cluster,'numstreams','');
++			fielddisplay(cluster,'hyperthreading','');
+ 		end
+ 		%}}}
+ 		function numprocs=np(cluster) % {{{
+@@ -127,7 +133,7 @@
+ 				end
+ 			
+ 			else
+-				md = checkmessage(md,'unknown processor type, should be ''bro'' or ''has'' or ''ivy'' or ''san'' or ''cas_ait''');
++				md = checkmessage(md,'unknown processor type, should be ''bro'', ''has'', ''ivy'', ''san'', or ''cas_ait''');
+ 			end
+ 
+ 			%Miscellaneous
+@@ -136,6 +142,7 @@
+ 			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+ 			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+ 			if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
++			if ~isempty(cluster.interactive), md = checkmessage(md,'interactive mode not implemented'); end
+ 
+ 		end
+ 		%}}}
+@@ -163,8 +170,8 @@
+ 			fprintf(fid,'#PBS -q %s \n',cluster.queue);
+ 			fprintf(fid,'#PBS -W group_list=%s\n',cluster.grouplist);
+ 			fprintf(fid,'#PBS -m e\n');
+-			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+-			fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
++			fprintf(fid,'#PBS -o %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
++			fprintf(fid,'#PBS -e %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
+ 			fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+ 			for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n']); end
+ 			fprintf(fid,'export PATH="$PATH:."\n\n');
+@@ -175,7 +182,7 @@
+ 			fprintf(fid,'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ISSM_DIR/externalpackages/petsc/install/lib"\n');
+ 			fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
+ 			if ~isvalgrind,
+-				fprintf(fid,'/u/scicon/tools/bin/several_tries mpiexec -np %i /u/scicon/tools/bin/mbind.x -cs -n%i %s/%s %s %s %s\n',cluster.np,cluster.cpuspernode,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++				fprintf(fid,'/u/scicon/tools/bin/several_tries mpiexec -np %i /u/scicon/tools/bin/mbind.x -cs -n%i %s/%s %s %s/%s %s\n',cluster.np,cluster.cpuspernode,cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
+ 			else
+ 				fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+ 			end
+@@ -381,10 +388,10 @@
+ 			end
+ 
+ 		end %}}}
+-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+ 			%compress the files into one zip.
+-			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			compressstring=['tar -zcf ' dirname '.tar.gz'];
+ 			for i=1:numel(filelist),
+ 				compressstring = [compressstring ' ' filelist{i}];
+ 			end
+@@ -410,7 +417,7 @@
+ 
+ 		end
+ 		%}}}
+-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+ 			%lauch command, to be executed via ssh
+ 			if ~cluster.interactive, 
+@@ -436,7 +443,7 @@
+ 			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+ 		end
+ 		%}}}
+-		function Download(cluster,dirname,filelist)% {{{
++		function Download(cluster,dirname,filelist) % {{{
+ 
+ 			%copy files from cluster to current directory
+ 			if cluster.interactive==10,
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26330)
+@@ -1,85 +1,95 @@
+ import subprocess
++
+ from fielddisplay import fielddisplay
+-from pairoptions import pairoptions
+-from issmssh import issmssh
++from IssmConfig import IssmConfig
+ from issmscpin import issmscpin
+ from issmscpout import issmscpout
+-from QueueRequirements import QueueRequirements
+-from IssmConfig import IssmConfig
++from issmssh import issmssh
++from pairoptions import pairoptions
+ try:
+     from pfe_settings import pfe_settings
+ except ImportError:
+     print('You need pfe_settings.py to proceed, check presence and sys.path')
++from QueueRequirements import QueueRequirements
+ 
+-
+ class pfe(object):
+-    """
+-    PFE cluster class definition
++    """PFE cluster class definition
+ 
+-       Usage:
+-          cluster = pfe()
+-          cluster = pfe('np', 3)
+-          cluster = pfe('np', 3, 'login', 'username')
++    Usage:
++        cluster = pfe()
++        cluster = pfe('np', 3)
++        cluster = pfe('np', 3, 'login', 'username')
+     """
+ 
+-    def __init__(self, *args):    # {{{
++    def __init__(self, *args):  # {{{
+         self.name = 'pfe'
+         self.login = ''
++        self.modules = ['comp-intel/2016.2.181', 'mpi-sgi/mpt']
+         self.numnodes = 20
+         self.cpuspernode = 8
+         self.port = 1025
+         self.queue = 'long'
+         self.time = 12 * 60
+-        self.processor = 'bro'
++        self.processor = 'ivy'
+         self.srcpath = ''
+         self.codepath = ''
+         self.executionpath = ''
+-        self.grouplist = 's1010'
++        self.grouplist = 's1690'
+         self.interactive = 0
+         self.bbftp = 0
+         self.numstreams = 8
+         self.hyperthreading = 0
+ 
+-        #use provided options to change fields
++        # Use provided options to change fields
+         options = pairoptions(*args)
+ 
+-        #initialize cluster using user settings if provided
+-        self = pfe_settings(self)
+-        self.np = self.nprocs()
++        # Initialize cluster using user settings if provided
++        try:
++            self = pfe_settings(self)
++        except NameError:
++            print('pfe_settings.py not found, using default settings')
+ 
+         #OK get other fields
+         self = options.AssignObjectFields(self)
+-
+     # }}}
+ 
+-    def __repr__(self):    # {{{
+-        #  display the object
+-        s = "class pfe object:"
+-        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'np', 'number of CPUs'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'port', 'machine access port'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'processor', 'type of processor'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', '$ISSM_DIR on pfe'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'directory containing issm.exe on pfe'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'grouplist', 'name of the group'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'bbftp', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'numstreams', ''))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'hyperthreading', ''))
++    def __repr__(self):  # {{{
++        # TODO:
++        # - Correct formatting of modules and cluster.np
++        #
++
++        # Display the object
++        s = 'class pfe object\n'
++        s += '{}\n'.format(fielddisplay(self, 'name', 'name of the cluster'))
++        s += '{}\n'.format(fielddisplay(self, 'login', 'login'))
++        modules = ''
++        for i in range(len(self.modules)):
++            modules += self.modules[i] + ','
++        modules = modules[:-1]
++        s += '         modules                : {}\n'.format(modules)
++        s += '{}\n'.format(fielddisplay(self, 'port', 'machine access port'))
++        s += '{}\n'.format(fielddisplay(self, 'numnodes', 'number of nodes'))
++        s += '{}\n'.format(fielddisplay(self, 'cpuspernode', 'number of CPUs per node'))
++        s += '         np:                    : {}             -- {}\n'.format(self.nprocs(), 'number of CPUs')
++        s += '{}\n'.format(fielddisplay(self, 'queue', 'name of the queue'))
++        s += '{}\n'.format(fielddisplay(self, 'time', 'walltime requested'))
++        s += '{}\n'.format(fielddisplay(self, 'processor', 'type of processor'))
++        s += '{}\n'.format(fielddisplay(self, 'srcpath', '$ISSM_DIR on pfe'))
++        s += '{}\n'.format(fielddisplay(self, 'codepath', '$ISSM_DIR/bin on pfe'))
++        s += '{}\n'.format(fielddisplay(self, 'executionpath', 'directory containing issm.exe on pfe'))
++        s += '{}\n'.format(fielddisplay(self, 'grouplist', 'grouplist'))
++        s += '{}\n'.format(fielddisplay(self, 'interactive', ''))
++        s += '{}\n'.format(fielddisplay(self, 'bbftp', ''))
++        s += '{}\n'.format(fielddisplay(self, 'numstreams', ''))
++        s += '{}\n'.format(fielddisplay(self, 'hyperthreading', ''))
+         return s
+     # }}}
+ 
+-    def nprocs(self):    # {{{
+-        self.np = self.numnodes * self.cpuspernode
+-        return self.np
++    def nprocs(self):  # {{{
++        return self.numnodes * self.cpuspernode
+     # }}}
+ 
+-    def checkconsistency(self, md, solution, analyses):    # {{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         queuedict = {'long': [5 * 24 * 60, 2048],
+                      'normal': [8 * 60, 2048],
+                      'debug': [2 * 60, 150],
+@@ -86,34 +96,32 @@
+                      'devel': [2 * 60, 150]}
+         QueueRequirements(queuedict, self.queue, self.nprocs(), self.time)
+ 
+-        #now, check cluster.cpuspernode according to processor type
+-        if self.processor == 'har' or self.processor == 'neh':
++        # Now, check cluster.cpuspernode according to processor type
++        if self.processor == 'ivy':
+             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')
++                if self.cpuspernode > 40 or self.cpuspernode < 1:
++                    md = md.checkmessage('cpuspernode should be between 1 and 40 for ''ivy'' processors in hyperthreading mode')
+             else:
+-                if not 0 < self.cpuspernode < 9:
+-                    md = md.checkmessage('cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors')
+-
++                if self.cpuspernode > 20 or self.cpuspernode < 1:
++                    md = md.checkmessage('cpuspernode should be between 1 and 20 for ''ivy'' processors')
+         elif self.processor == 'bro':
+             if self.hyperthreading:
+-                if not 0 < self.cpuspernode < 57:
++                if self.cpuspernode > 56 or self.cpuspernode < 1:
+                     md = md.checkmessage('cpuspernode should be between 1 and 56 for ''bro'' processors in hyperthreading mode')
+             else:
+-                if not 0 < self.cpuspernode < 29:
++                if self.cpuspernode > 28 or self.cpuspernode < 1:
+                     md = md.checkmessage('cpuspernode should be between 1 and 28 for ''bro'' processors')
+-
+-        elif self.processor == 'ivy':
++        elif self.processor == 'har' or self.processor == 'neh':
+             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')
++                if self.cpuspernode > 16 or self.cpuspernode < 1:
++                    md = md.checkmessage('cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode')
+             else:
+-                if not 0 < self.cpuspernode < 21:
+-                    md = md.checkmessage('cpuspernode should be between 1 and 20 for ''ivy'' processors')
++                if self.cpuspernode > 8 or self.cpuspernode < 1:
++                    md = md.checkmessage('cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors')
+         else:
+-            md = md.checkmessage('unknown processor type, should be ''neh'', ''bro'' or ''har'' or ''ivy''')
++            md = md.checkmessage('unknown processor type, should be \'ivy\', \'bro\', \'har\', or \'neh\'')
+ 
+-        #Miscellaneous
++        # Miscellaneous
+         if not self.login:
+             md = md.checkmessage('login empty')
+         if not self.srcpath:
+@@ -130,7 +138,10 @@
+         return self
+     # }}}
+ 
+-    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
++    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
++        if isgprof:
++            print('gprof not supported by cluster, ignoring...')
++
+         executable = 'issm.exe'
+         if isdakota:
+             version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+@@ -140,53 +151,56 @@
+         if isoceancoupling:
+             executable = 'issm_ocean.exe'
+ 
+-    #write queuing script
++        # Write queuing script
+         fid = open(modelname + '.queue', 'w')
+-        fid.write('#PBS -S / bin / bash\n')
+-        fid.write('#PBS -l select=%i:ncpus=%i:model=%s\n' % (self.numnodes, self.cpuspernode, self.processor))
+-        fid.write('#PBS -l walltime=%i\n' % (self.time * 60))
+-        fid.write('#PBS -q %s \n' % self.queue)
+-        fid.write('#PBS -W group_list=%s\n' % self.grouplist)
++        fid.write('#PBS -S /bin/bash\n')
++        fid.write('#PBS -l select={}:ncpus={}:model={}\n'.format(self.numnodes, self.cpuspernode, self.processor))
++        fid.write('#PBS -l walltime={}\n'.format(self.time * 60)) # walltime is in seconds
++        fid.write('#PBS -q {} \n'.format(self.queue))
++        fid.write('#PBS -W group_list={}\n'.format(self.grouplist))
+         fid.write('#PBS -m e\n')
+-        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+-        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+-        fid.write('./usr/share/modules/init/bash\n\n')
+-        fid.write('module load comp-intel/2015.0.090\n')
+-        fid.write('module load mpi-sgi/mpt.2.11r13\n')
++        fid.write('#PBS -o {}/{}/{}.outlog \n'.format(self.executionpath, dirname, modelname))
++        fid.write('#PBS -e {}/{}/{}.errlog \n\n'.format(self.executionpath, dirname, modelname))
++        fid.write('. /usr/share/modules/init/bash\n\n')
++        for i in range(len(self.modules)):
++            fid.write('module load {}\n'.format(self.modules[i]))
+         fid.write('export PATH="$PATH:."\n\n')
++        fid.write('export MPI_LAUNCH_TIMEOUT=520\n')
+         fid.write('export MPI_GROUP_MAX=64\n\n')
+-        fid.write('export ISSM_DIR="%s"\n' % self.srcpath)
+-        fid.write('source $ISSM_DIR/etc/environment.sh\n')
++        fid.write('export ISSM_DIR="{}"\n'.format(self.srcpath)) # FIXME
++        fid.write('source $ISSM_DIR/etc/environment.sh\n') # FIXME
+         fid.write('export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ISSM_DIR/externalpackages/petsc/install/lib"\n')
+-        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
+-        fid.write('mpiexec - np %i %s/%s %s %s/%s %s\n' % (self.nprocs(), self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
++        fid.write('cd %s/%s/\n\n'.format(self.executionpath, dirname))
++        fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.cpuspernode, self.codepath, executable, solution, self.executionpath, dirname, modelname))
+ 
+         fid.close()
+ 
+     # }}}
+ 
+-    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+-        #compress the files into one zip.
+-        compressstring = 'tar -zcf %s.tar.gz ' % dirname
++    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
++        # Compress the files into one zip
++        compressstring = 'tar -zcf {}.tar.gz'.format(dirname)
+         for file in filelist:
+-            compressstring += ' %s' % file
++            compressstring += 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'])
++        directory = self.executionpath
++        issmscpout(self.name, directory, self.login, self.port, [dirname + '.tar.gz'])
+ 
+     # }}}
+-    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+-        print('launching solution sequence on remote cluster')
++    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+         if restart:
+-            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
++            launchcommand = 'cd {} && cd {} && qsub {}.queue'.format(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)
++            launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz  && qsub {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
++
++        print('launching solution sequence on remote cluster')
+         issmssh(self.name, self.login, self.port, launchcommand)
+ 
+     # }}}
+-    def Download(self, dirname, filelist):    # {{{
+-        #copy files from cluster to current directory
+-        directory = '%s/%s/' % (self.executionpath, dirname)
++    def Download(self, dirname, filelist):  # {{{
++        # Copy files from cluster to current directory
++        directory = '{}/{}/'.format(self.executionpath, dirname)
+         issmscpin(self.name, self.login, self.port, directory, filelist)
+     # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/sherlock.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/sherlock.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/sherlock.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%PFE class definition
++%SHERLOCK cluster class definition
+ %
+ %   Usage:
+ %      cluster=sherlock();
+@@ -6,155 +6,155 @@
+ %      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) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name          = 'sherlock'
++		login         = '';
++		numnodes      = 1;
++		cpuspernode   = 24;
++		port          = 0;
++		codepath      = '';
++		executionpath = '';
++		interactive   = 0;
++		time          = 30;
++		memory        = 2;
++	end
++	%}}}
++	methods
++		function cluster=sherlock(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('sherlock_settings')==2), sherlock_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('sherlock_settings')==2), sherlock_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    interactive: %i',cluster.interactive));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    memory: %i',cluster.memory));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    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=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			%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) % {{{
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH --job-name=%s\n',mdelname);
+-			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',mdelname);
++			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
++			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
++			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+-			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/bash\n');
+-			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+-			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+-			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+-			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+-			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+-			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+-			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+-			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+-			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+-			 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
++			fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
++			fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
++			fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.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)% {{{
++			%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);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 if ~isempty(restart)
+-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+-			 else
+-				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+-			 end
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/clusters/tetralith.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/tetralith.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/tetralith.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%teralith class definition
++%TERALITH cluster class definition
+ %
+ %   Usage:
+ %      cluster=tetralith();
+@@ -6,7 +6,7 @@
+ %      cluster=tetralith('np',3,'login','username');
+ 
+ classdef tetralith
+-	properties (SetAccess=public)  
++	properties (SetAccess=public)
+ 		% {{{
+ 		name           = 'tetralith';
+ 		login          = '';
+@@ -65,7 +65,7 @@
+ 
+ 		end
+ 		%}}}
+-		function numprocs=np(self) % {{{
++		function numprocs=nprocs(self) % {{{
+ 			%compute number of processors
+ 			numprocs=self.numnodes*self.cpuspernode;
+ 		end
+@@ -77,7 +77,7 @@
+ 
+ 			%compute number of processors
+ % 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;
++			nprocs(cluster);%=cluster.numnodes*cluster.cpuspernode;
+ 
+ 			%write queuing script 
+ 			fid=fopen([modelname '.queue'],'w');
+@@ -105,12 +105,12 @@
+ 			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+ % 			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+ % 			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++			fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+ % 			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+-			 if ~io_gather, %concatenate the output files:
+-				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+-			 end
+-			 fclose(fid);
++			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) % {{{
+@@ -131,7 +131,7 @@
+ 
+ 			%compute number of processors
+ % 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+-			np(cluster);%=cluster.numnodes*cluster.cpuspernode;                     
++			nprocs(cluster);%=cluster.numnodes*cluster.cpuspernode;
+ % 			shortname = substring(modelname,1,min(12,length(modelname)));
+ 
+ 			%write queuing script 
+@@ -159,7 +159,7 @@
+ 			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+ 			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+ % 			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++			fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+ % 			fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+ % 			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+ 
+@@ -182,7 +182,7 @@
+ 				fclose(fid);
+ 			end
+ 		end %}}}
+-		function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+ 			%compress the files into one zip.
+ 			compressstring=['tar -zcf ' dirname '.tar.gz '];
+@@ -197,7 +197,7 @@
+ 
+ 		end
+ 		%}}}
+-		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+ 			disp('launching solution sequence on remote cluster');
+ 			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+@@ -205,7 +205,7 @@
+ 
+ 			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+ 		end %}}}
+-		function Download(cluster,dirname,filelist)% {{{
++		function Download(cluster,dirname,filelist) % {{{
+ 
+ 			%copy files from cluster to current directory
+ 			directory=[cluster.executionpath '/' dirname '/'];
+Index: ../trunk-jpl/src/m/classes/clusters/yellowstone.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/yellowstone.m	(revision 26329)
++++ ../trunk-jpl/src/m/classes/clusters/yellowstone.m	(revision 26330)
+@@ -1,4 +1,4 @@
+-%YELLOWSTONE class definition
++%YELLOWSTONE cluster class definition
+ %
+ %   Usage:
+ %      cluster=yellowstone();
+@@ -6,151 +6,151 @@
+ %      cluster=yellowstone('np',3,'login','username');
+ 
+ classdef yellowstone
+-    properties (SetAccess=public)  
+-		 % {{{
+-		 name           = 'yellowstone.ucar.edu'
+-		 login          = '';
+-		 modules        = {'ncarenv/1.0' 'ncarbinlibs/1.1' 'perlmods/5.0' 'gmake/4.1' 'python/2.7.7' 'all-python-libs' 'git/2.3.0' 'intel/15.0.3' 'mkl/11.1.2' 'esmf' 'esmf-6.3.0rp1-defio-mpi-O' 'netcdf-mpi/4.3.3.1' 'pnetcdf/1.6.1' 'ncarcompilers/1.0' 'cmake/3.0.2' 'matlab/R2015b' 'issm'};
+-		 numnodes       = 1;
+-		 cpuspernode    = 8;
+-		 port           = 0;
+-		 queue          = 'premium';
+-		 time           = 12*60;
+-		 processor      = 'sandy';
+-		 codepath       = '';
+-		 executionpath  = '';
+-		 grouplist     = 'P93300301';
+-	 end
+-	 %}}}
+-	 methods
+-		 function cluster=yellowstone(varargin) % {{{
++	properties (SetAccess=public)
++		% {{{
++		name           = 'yellowstone.ucar.edu'
++		login          = '';
++		modules        = {'ncarenv/1.0' 'ncarbinlibs/1.1' 'perlmods/5.0' 'gmake/4.1' 'python/2.7.7' 'all-python-libs' 'git/2.3.0' 'intel/15.0.3' 'mkl/11.1.2' 'esmf' 'esmf-6.3.0rp1-defio-mpi-O' 'netcdf-mpi/4.3.3.1' 'pnetcdf/1.6.1' 'ncarcompilers/1.0' 'cmake/3.0.2' 'matlab/R2015b' 'issm'};
++		numnodes       = 1;
++		cpuspernode    = 8;
++		port           = 0;
++		queue          = 'premium';
++		time           = 12*60;
++		processor      = 'sandy';
++		codepath       = '';
++		executionpath  = '';
++		grouplist     = 'P93300301';
++	end
++	%}}}
++	methods
++		function cluster=yellowstone(varargin) % {{{
+ 
+-			 %initialize cluster using default settings if provided
+-			 if (exist('yellowstone_settings')==2), yellowstone_settings; end
++			%initialize cluster using default settings if provided
++			if (exist('yellowstone_settings')==2), yellowstone_settings; end
+ 
+-			 %use provided options to change fields
+-			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+-		 end
+-		 %}}}
+-		 function disp(cluster) % {{{
+-			 %  display the object
+-			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+-			 disp(sprintf('    name: %s',cluster.name));
+-			 disp(sprintf('    login: %s',cluster.login));
+-			 modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1); 
+-			 disp(sprintf('    modules: %s',modules));
+-			 disp(sprintf('    port: %i',cluster.port));
+-			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+-			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+-			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+-			 disp(sprintf('    queue: %s',cluster.queue));
+-			 disp(sprintf('    time: %i',cluster.time));
+-			 disp(sprintf('    processor: %s',cluster.processor));
+-			 disp(sprintf('    codepath: %s',cluster.codepath));
+-			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+-			 disp(sprintf('    grouplist: %s',cluster.grouplist));
+-		 end
+-		 %}}}
+-		 function numprocs=np(cluster) % {{{
+-			 %compute number of processors
+-			 numprocs=cluster.numnodes*cluster.cpuspernode;
+-		 end
+-		 %}}}
+-		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1); 
++			disp(sprintf('    modules: %s',modules));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    processor: %s',cluster.processor));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    grouplist: %s',cluster.grouplist));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 
+-			 available_queues={'premium','regular'};
+-			 queue_requirements_time=[12*60 12*650];
+-			 queue_requirements_np=[16384 16384];
++			available_queues={'premium','regular'};
++			queue_requirements_time=[12*60 12*650];
++			queue_requirements_np=[16384 16384];
+ 
+-			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
+ 
+-			 %Miscelaneous
+-			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+-			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+-			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+-			 if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
++			%Miscelaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++			if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
+ 
+-		 end
+-		 %}}}
+-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+ 
+-			 executable='issm.exe';
+-			 if isdakota,
+-				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+-				 if (version>=6),
+-					 executable='issm_dakota.exe';
+-				 end
+-			 end
+-			 if isoceancoupling,
+-				 executable='issm_ocean.exe';
+-			 end
++			executable='issm.exe';
++			if isdakota,
++				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
++				if (version>=6),
++					executable='issm_dakota.exe';
++				end
++			end
++			if isoceancoupling,
++				executable='issm_ocean.exe';
++			end
+ 
+ 
+-			 %write queuing script 
+-			 fid=fopen([modelname '.queue'],'w');
+-			 fprintf(fid,'#!/bin/tcsh\n');
+-			 fprintf(fid,'#BSUB -P %s\n',cluster.grouplist);
+-			 fprintf(fid,'#BSUB -W %i:%i\n',floor(cluster.time/60),cluster.time-floor(cluster.time/60)*60);
+-			 fprintf(fid,'#BSUB -n %i\n',cluster.np);
+-			 fprintf(fid,'#BSUB -J %s\n',modelname);
+-			 fprintf(fid,'#BSUB -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+-			 fprintf(fid,'#BSUB -e %s.errlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+-			 fprintf(fid,'#BSUB -q %s\n',cluster.queue);
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/tcsh\n');
++			fprintf(fid,'#BSUB -P %s\n',cluster.grouplist);
++			fprintf(fid,'#BSUB -W %i:%i\n',floor(cluster.time/60),cluster.time-floor(cluster.time/60)*60);
++			fprintf(fid,'#BSUB -n %i\n',cluster.np);
++			fprintf(fid,'#BSUB -J %s\n',modelname);
++			fprintf(fid,'#BSUB -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
++			fprintf(fid,'#BSUB -e %s.errlog \n',[cluster.executionpath '/' dirname '/' modelname]);
++			fprintf(fid,'#BSUB -q %s\n',cluster.queue);
+ 
+-			 fprintf(fid,'module purge\n');
+-			 for i=1:length(cluster.modules),
+-				 fprintf(fid,'module load %s\n',cluster.modules{i});
+-			 end
++			fprintf(fid,'module purge\n');
++			for i=1:length(cluster.modules),
++				fprintf(fid,'module load %s\n',cluster.modules{i});
++			end
+ 
+-			 fprintf(fid,'setenv OMP_STACKSIZE 256M\n');
+-			 fprintf(fid,'setenv MP_LABELIO yes\n');
+-			 fprintf(fid,'setenv MP_INFOLEVEL 2\n');
+-			 fprintf(fid,'setenv MP_SHARED_MEMORY yes\n');
+-			 fprintf(fid,'setenv MP_EUILIB us\n');
+-			 fprintf(fid,'setenv MP_STDOUTMODE unordered\n');
+-			 fprintf(fid,'setenv MP_RC_USE_LMC yes\n');
+-			 fprintf(fid,'setenv MP_MPILIB mpich2\n');
+-			 fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/ibmhpc/pecurrent/mpich2/intel/lib64/\n');
+-			 fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/ncar/opt/intel/psxe-2015_update3/impi/5.0.3.048/lib64/\n');
++			fprintf(fid,'setenv OMP_STACKSIZE 256M\n');
++			fprintf(fid,'setenv MP_LABELIO yes\n');
++			fprintf(fid,'setenv MP_INFOLEVEL 2\n');
++			fprintf(fid,'setenv MP_SHARED_MEMORY yes\n');
++			fprintf(fid,'setenv MP_EUILIB us\n');
++			fprintf(fid,'setenv MP_STDOUTMODE unordered\n');
++			fprintf(fid,'setenv MP_RC_USE_LMC yes\n');
++			fprintf(fid,'setenv MP_MPILIB mpich2\n');
++			fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/ibmhpc/pecurrent/mpich2/intel/lib64/\n');
++			fprintf(fid,'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/ncar/opt/intel/psxe-2015_update3/impi/5.0.3.048/lib64/\n');
+ 
+-			 fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
+ 
+-			 fprintf(fid,'mpirun.lsf %s/%s %s %s %s\n',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+-			 fclose(fid);
++			fprintf(fid,'mpirun.lsf %s/%s %s %s %s\n',cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++			fclose(fid);
+ 
+-		 end %}}}
+-		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+ 
+-			 %compress the files into one zip.
+-			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+-			 for i=1:numel(filelist),
+-				 compressstring = [compressstring ' ' filelist{i}];
+-			 end
+-			 system(compressstring);
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			system(compressstring);
+ 
+-			 disp('uploading input file and queueing script');
+-			 directory=cluster.executionpath;
++			disp('uploading input file and queueing script');
++			directory=cluster.executionpath;
+ 
+-			 issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
++			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+ 
+-		 end
+-		 %}}}
+-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
++		end
++		%}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
+ 
+-			 %lauch command, to be executed via ssh
+-			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && bsub < ' modelname '.queue '];
++			%lauch command, to be executed via ssh
++			launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && bsub < ' modelname '.queue '];
+ 
+-			 disp('launching solution sequence on remote cluster');
+-			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+-		 end
+-		 %}}}
+-		 function Download(cluster,dirname,filelist)% {{{
++			disp('launching solution sequence on remote cluster');
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end
++		%}}}
++		function Download(cluster,dirname,filelist) % {{{
+ 
+-			 %copy files from cluster to current directory
+-			 directory=[cluster.executionpath '/' dirname '/'];
+-			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+ 
+-		 end %}}}
++		end %}}}
+ 	end
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26332-26333.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26332-26333.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26332-26333.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26332)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26333)
+@@ -177,8 +177,8 @@
+         fid.write('export ISSM_DIR="{}"\n'.format(self.srcpath)) # FIXME
+         fid.write('source $ISSM_DIR/etc/environment.sh\n') # FIXME
+         fid.write('export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ISSM_DIR/externalpackages/petsc/install/lib"\n')
+-        fid.write('cd %s/%s/\n\n'.format(self.executionpath, dirname))
+-        fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.cpuspernode, self.codepath, executable, solution, self.executionpath, dirname, modelname))
++        fid.write('cd {}/{}/\n\n'.format(self.executionpath, dirname))
++        fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+ 
+         fid.close()
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26333-26334.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26333-26334.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26333-26334.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26333)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26334)
+@@ -461,6 +461,9 @@
+ 			%materials
+ 			md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B);
+ 			md.materials.rheology_n=project2d(md,md.materials.rheology_n,1);
++			if isprop(md.materials,'rheology_E')
++				md.materials.rheology_E=project2d(md,md.materials.rheology_E,1);
++			end
+ 			
+ 			%damage: 
+ 			if md.damage.isdamage,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26334-26335.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26334-26335.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26334-26335.diff	(revision 26740)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.14-discover.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.14-discover.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.14-discover.sh	(revision 26335)
+@@ -0,0 +1,56 @@
++#!/bin/bash
++set -eu
++
++
++# NOTE: There is a single difference between the Linux and macOS 
++#		configurations, which is the addition of the -static-libgfortran 
++#		option to FFLAGS on the macOS static configurations. For the sake of 
++#		consistency, we maintain separate files for each, respective Linux and 
++#		macOS configuration.
++
++# Constants
++VER="3.14.0"
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf install src
++mkdir install src
++
++# Move source to 'src' directory
++mv petsc-${VER}/* src/
++rm -rf petsc-${VER}
++
++# Configure
++cd src
++./config/configure.py \
++	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
++	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
++	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-pic=1 \
++	--with-blas-lapack-dir="/usr/local/intel/2020/compilers_and_libraries_2020.0.166/linux/mkl/" \
++	--with-cc="/usr/local/sgi/mpi/mpt-2.17/bin/mpicc" \
++	--with-cxx="/usr/local/sgi/mpi/mpt-2.17/bin/mpicxx" \
++	--with-fc="/usr/local/sgi/mpi/mpt-2.17/bin/mpif90" \
++	--known-mpi-shared-libraries=1 \
++	--known-64-bit-blas-indices \
++	--known-mpi-long-double=1 \
++	--known-mpi-int64_t=1 \
++	--known-mpi-c-double-complex=1 \
++	--with-shared-libraries=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-scalapack=1 \
++	--download-mumps=1
++
++# Compile and install
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.14-discover.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26335-26336.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26335-26336.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26335-26336.diff	(revision 26740)
@@ -0,0 +1,55 @@
+Index: ../trunk-jpl/externalpackages/triangle/install-discover.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-discover.sh	(revision 26335)
++++ ../trunk-jpl/externalpackages/triangle/install-discover.sh	(revision 26336)
+@@ -1,24 +1,34 @@
+ #!/bin/bash
+ set -eu
+ 
+-#Some cleanup 
+-rm -rf install triangle
+-mkdir install
+ 
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
++# Constants
++#
++export PREFIX="${ISSM_DIR}/externalpackages/triangle/install" # Set to location where external package should be installed
+ 
+-#Untar 
+-cd install
+-cp ../triangle.zip ./
+-unzip triangle.zip
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} ${PREFIX}/include ${PREFIX}/lib src
+ 
+-#copy new makefile
+-cp ../configs/pleiades/configure.make ./
+-cp ../makefile ./
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/triangle.zip" "triangle.zip"
+ 
+-#Compile triangle
+-make
++# Unpack source
++unzip triangle.zip -d src
+ 
+-#Patch triangle.h
+-patch triangle.h ../triangle.h.patch
++# Copy customized source files to 'src' directory
++cp configs/makefile src
++cp configs/triangle.h src
++cp configs/linux/configure.make src
++
++# Compile
++cd src
++make shared
++
++# Install
++cd ..
++cp src/libtriangle.* ${PREFIX}/lib
++cp src/triangle.h ${PREFIX}/include
++
++# Cleanup
++rm -rf src
Index: /issm/oecreview/Archive/25834-26739/ISSM-26336-26337.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26336-26337.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26336-26337.diff	(revision 26740)
@@ -0,0 +1,302 @@
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-intel20-discover.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-intel20-discover.sh	(revision 26336)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-intel20-discover.sh	(nonexistent)
+@@ -1,58 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf Dakota
+-rm -rf src 
+-rm -rf build 
+-rm -rf install 
+-mkdir src build install 
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+-
+-#Untar 
+-tar -zxvf dakota-6.2-public-src.tar.gz
+-
+-#Move Dakota to src directory
+-mv dakota-6.2.0.src/* src
+-rm -rf dakota-6.2.0.src
+-
+-#Set up Dakota cmake variables and config
+-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
+-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
+-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
+-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
+-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover20.patch
+-
+-#Apply patches
+-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
+-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
+-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
+-
+-#Configure dakota
+-cd $DAK_BUILD
+-
+-cmake -D CMAKE_C_COMPILER=mpicc \
+-	   -D CMAKE_CXX_COMPILER=mpicxx \
+-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+-		-DHAVE_ACRO=off \
+-		-DHAVE_JEGA=off \
+-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
+-		-C $DAK_SRC/cmake/DakotaDev.cmake \
+-		$DAK_SRC
+-cd ..
+-
+-#Compile and install dakota
+-cd $DAK_BUILD
+-if [ $# -eq 0 ];
+-then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/dakota/install-6.2-intel20-discover.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-intel15-discover.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-intel15-discover.sh	(revision 26336)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-intel15-discover.sh	(nonexistent)
+@@ -1,58 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf Dakota
+-rm -rf src 
+-rm -rf build 
+-rm -rf install 
+-mkdir src build install 
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+-
+-#Untar 
+-tar -zxvf dakota-6.2-public-src.tar.gz
+-
+-#Move Dakota to src directory
+-mv dakota-6.2.0.src/* src
+-rm -rf dakota-6.2.0.src
+-
+-#Set up Dakota cmake variables and config
+-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
+-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
+-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
+-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
+-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover.patch
+-
+-#Apply patches
+-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
+-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
+-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
+-
+-#Configure dakota
+-cd $DAK_BUILD
+-
+-cmake -D CMAKE_C_COMPILER=mpicc \
+-	   -D CMAKE_CXX_COMPILER=mpicxx \
+-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+-		-DHAVE_ACRO=off \
+-		-DHAVE_JEGA=off \
+-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
+-		-C $DAK_SRC/cmake/DakotaDev.cmake \
+-		$DAK_SRC
+-cd ..
+-
+-#Compile and install dakota
+-cd $DAK_BUILD
+-if [ $# -eq 0 ];
+-then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/dakota/install-6.2-intel15-discover.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-intel16-discover.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-intel16-discover.sh	(revision 26336)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-intel16-discover.sh	(nonexistent)
+@@ -1,58 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf Dakota
+-rm -rf src 
+-rm -rf build 
+-rm -rf install 
+-mkdir src build install 
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+-
+-#Untar 
+-tar -zxvf dakota-6.2-public-src.tar.gz
+-
+-#Move Dakota to src directory
+-mv dakota-6.2.0.src/* src
+-rm -rf dakota-6.2.0.src
+-
+-#Set up Dakota cmake variables and config
+-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
+-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
+-export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
+-patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
+-patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover16.patch
+-
+-#Apply patches
+-patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
+-patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
+-patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
+-
+-#Configure dakota
+-cd $DAK_BUILD
+-
+-cmake -D CMAKE_C_COMPILER=mpicc \
+-	   -D CMAKE_CXX_COMPILER=mpicxx \
+-	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+-		-DHAVE_ACRO=off \
+-		-DHAVE_JEGA=off \
+-		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
+-		-C $DAK_SRC/cmake/DakotaDev.cmake \
+-		$DAK_SRC
+-cd ..
+-
+-#Compile and install dakota
+-cd $DAK_BUILD
+-if [ $# -eq 0 ];
+-then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/dakota/install-6.2-intel16-discover.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/dakota/install-6.2-discover.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-6.2-discover.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/dakota/install-6.2-discover.sh	(revision 26337)
+@@ -0,0 +1,63 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf Dakota
++rm -rf src 
++rm -rf build 
++rm -rf install 
++mkdir src build install 
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
++
++#Untar 
++tar -zxvf dakota-6.2-public-src.tar.gz
++
++#Move Dakota to src directory
++mv dakota-6.2.0.src/* src
++rm -rf dakota-6.2.0.src
++
++#Set up Dakota cmake variables and config
++export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
++export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
++export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
++cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
++patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.discover.patch
++patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
++patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.discover20.patch
++
++#Apply patches
++patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
++patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
++patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
++
++#Configure dakota
++cd $DAK_BUILD
++
++cmake -D CMAKE_C_COMPILER=mpicc \
++	   -D CMAKE_CXX_COMPILER=mpicxx \
++	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
++		-DBUILD_SHARED_LIBS=ON \
++		-DBUILD_STATIC_LIBS=OFF \
++		-DBoost_NO_BOOST_CMAKE=TRUE \
++		-DHAVE_ACRO=OFF \
++		-DHAVE_JEGA=OFF \
++		-DHAVE_QUESO=ON \
++		-DDAKOTA_HAVE_GSL=ON \
++		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
++		-C $DAK_SRC/cmake/DakotaDev.cmake \
++		$DAK_SRC
++cd ..
++
++#Compile and install dakota
++cd $DAK_BUILD
++if [ $# -eq 0 ];
++then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/dakota/install-6.2-discover.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26336)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26337)
+@@ -290,9 +290,9 @@
+ 			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
+-			export CXX=icpc
+-			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
++		   export CC=mpicc
++		   export CXX=mpicxx
++			export CXXFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK -std=c++11"
+ 			export CFLAGS="-O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
+ 		elif test "${VENDOR}" == "intel-pleiades"; then
+ 			export CC=icc
Index: /issm/oecreview/Archive/25834-26739/ISSM-26337-26338.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26337-26338.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26337-26338.diff	(revision 26740)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/src/m/classes/clusters/discover.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26337)
++++ ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26338)
+@@ -128,7 +128,7 @@
+         # Write queuing script
+         fid = open(modelname + '.queue', 'w')
+ 
+-        fid.write('#/bin/bash\n')
++        fid.write('#!/bin/bash\n')
+         fid.write('#SBATCH -J {} \n'.format(modelname))
+         fid.write('#SBATCH --qos={} \n'.format(self.queue))
+         fid.write('#SBATCH -o {}.outlog \n'.format(modelname))
+@@ -135,9 +135,9 @@
+         fid.write('#SBATCH -e {}.errlog \n'.format(modelname))
+         fid.write('#SBATCH -n {} \n'.format(self.nprocs()))
+         fid.write('#SBATCH -N {} \n'.format(self.numnodes))
+-        fid.write('#SBATCH -y {:02d}:{:02d}:00 \n'.format(int(math.floor(self.time / 3600)), int(math.floor(self.time % 3600) / 60)))
++        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(int(math.floor(self.time / 3600)), int(math.floor(self.time % 3600) / 60)))
+         fid.write('#SBATCH -A {} \n\n'.format(self.grouplist))
+-        if len(np.where(self.email, '@')[0]):
++        if (self.email.find('@')>-1):
+             fid.write('#SBATCH --mail-user={} \n'.format(self.email))
+             fid.write('#SBATCH --mail-type=end \n\n')
+         fid.write('. /usr/share/modules/init/bash\n\n')
+@@ -170,7 +170,6 @@
+             fid.close()
+             fid = open(modelname + '.outlog', 'w') # TODO: Change this to system call (touch <file>)?
+             fid.close()
+-        end
+     # }}}
+ 
+     def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+@@ -191,7 +190,7 @@
+         if self.bbftp:
+             issmbbftpout(self.name, directory, self.login, self.port, self.numstreams, '{}.tar.gz'.format(dirname))
+         else:
+-            issmscpout(self.name, directory, self.login, self.port, '{}.tar.gz'.format(dirname))
++            issmscpout(self.name, directory, self.login, self.port, ['{}.tar.gz'.format(dirname)])
+     # }}}
+ 
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26338-26339.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26338-26339.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26338-26339.diff	(revision 26740)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/src/m/classes/qmu.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/qmu.m	(revision 26338)
++++ ../trunk-jpl/src/m/classes/qmu.m	(revision 26339)
+@@ -87,7 +87,7 @@
+ 				if ~strcmpi(self.params.evaluation_scheduling,'master'),
+ 					md = checkmessage(md,['evaluation_scheduling in qmu.params should be set to ''master''']);
+ 				end
+-				if md.cluster.np<=1,
++				if md.cluster.nprocs()<=1,
+ 					md = checkmessage(md,['in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluster.np accordingly.']);
+ 				end
+ 
+@@ -94,7 +94,7 @@
+ 				if self.params.processors_per_evaluation<1,
+ 					md = checkmessage(md,['in parallel library mode, Dakota needs to run at least one slave on one cpu (md.qmu.params.processors_per_evaluation >=1)!']);
+ 				end
+-				if mod(md.cluster.np-1,self.params.processors_per_evaluation),
++				if mod(md.cluster.nprocs()-1,self.params.processors_per_evaluation),
+ 					%md = checkmessage(md,['in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly']);
+ 				end
+ 			end
+Index: ../trunk-jpl/src/m/classes/qmu.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/qmu.py	(revision 26338)
++++ ../trunk-jpl/src/m/classes/qmu.py	(revision 26339)
+@@ -148,13 +148,13 @@
+             if not strcmpi(self.params.evaluation_scheduling, 'master'):
+                 md.checkmessage('evaluation_scheduling in qmu.params should be set to "master"')
+ 
+-            if md.cluster.np <= 1:
++            if md.cluster.nprocs() <= 1:
+                 md.checkmessage('in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluster.np accordingly.')
+ 
+             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):
++            if np.mod(md.cluster.nprocs() - 1, self.params.processors_per_evaluation):
+                 #md.checkmessage('in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly')
+                 pass
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26339-26340.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26339-26340.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26339-26340.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/clusters/discover.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26339)
++++ ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26340)
+@@ -119,7 +119,7 @@
+         executable = 'issm.exe'
+         if isdakota:
+             version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+-            version = float(version)
++            version = float(str(version[0]))
+             if version >= 6:
+                 executable = 'issm_dakota.exe'
+         if isoceancoupling:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26340-26341.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26340-26341.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26340-26341.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/m/classes/clusters/generic.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26340)
++++ ../trunk-jpl/src/m/classes/clusters/generic.m	(revision 26341)
+@@ -69,6 +69,10 @@
+ 			disp(sprintf('    shell: %s',cluster.shell));
+ 		end
+ 		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			numprocs=cluster.np;
++		end
++		%}}}
+ 		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+ 			if cluster.np<1
+ 				md = checkmessage(md,['number of processors should be at least 1']);
+Index: ../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26340)
++++ ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26341)
+@@ -71,6 +71,10 @@
+         return s
+     # }}}
+ 
++    def nprocs(self):  # {{{
++        return self.np
++    # }}}
++
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         if self.np < 1:
+             md.checkmessage('number of processors should be at least 1')
+@@ -201,7 +205,7 @@
+ 
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+         print('launching solution sequence on remote cluster')
+-        if restart:
++        if not isempty(restart):
+             launchcommand = 'cd {} && cd {} chmod 755 {}.queue && ./{}.queue'.format(self.executionpath, dirname, modelname, modelname)
+         else:
+             if batch:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26341-26342.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26341-26342.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26341-26342.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26341)
++++ ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26342)
+@@ -1,8 +1,7 @@
+ from subprocess import call
+ 
+-import numpy as np
+-
+ from fielddisplay import fielddisplay
++from helpers import *
+ try:
+     from generic_settings import generic_settings
+ except ImportError:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26342-26343.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26342-26343.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26342-26343.diff	(revision 26740)
@@ -0,0 +1,468 @@
+Index: ../trunk-jpl/configure.ac
+===================================================================
+--- ../trunk-jpl/configure.ac	(revision 26342)
++++ ../trunk-jpl/configure.ac	(revision 26343)
+@@ -25,7 +25,7 @@
+ #Initialize automake and declare foreign so that we don't need a ChangeLog, INSTALL, etc
+ AM_INIT_AUTOMAKE([foreign])
+ AC_CONFIG_HEADERS([./config.h])		# Config file must be config.h
+-AM_SILENT_RULES([yes])				# Do not show compilation command by default
++AM_SILENT_RULES([yes])				# Reduce compilation and linking output (comment this line out or set value to "no" for verbose output)
+ AM_PROG_AR
+ 
+ #Libtool
+Index: ../trunk-jpl/jenkins/pleiades-basic
+===================================================================
+--- ../trunk-jpl/jenkins/pleiades-basic	(nonexistent)
++++ ../trunk-jpl/jenkins/pleiades-basic	(revision 26343)
+@@ -0,0 +1,56 @@
++#--------------------#
++# ISSM Configuration #
++#--------------------#
++
++ISSM_CONFIG='\
++	--prefix=${ISSM_DIR} \
++	--with-wrappers=no \
++	--with-petsc-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-m1qn3-dir="${ISSM_DIR}/externalpackages/m1qn3/install" \
++	--with-mpi-include=" " \
++	--with-mpi-libflags=" -lmpi" \
++	--with-mkl-libflags="-L/nasa/intel/Compiler/2016.2.181/mkl/lib/intel64/ -mkl=cluster " \
++	--with-metis-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-mumps-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-scalapack-dir="${ISSM_DIR}/externalpackages/petsc/install" \
++	--with-cxxoptflags="-g -O3 -axCORE-AVX2,AVX -xSSE4.2 -ipo -no-inline-min-size -inline-max-size=345 -no-inline-max-total-size -no-inline-max-per-routine -no-inline-max-per-compile " \
++	--with-fortran-lib="-L/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/compiler/lib/intel64/ -lifcore -lifport" \
++	--with-vendor="intel-pleiades" \
++	--enable-development
++'
++
++#-------------------#
++# External Packages #
++#-------------------#
++
++EXTERNALPACKAGES="
++	petsc	install-3.13-pleiades.sh
++	m1qn3	install.sh
++"
++
++#---------#
++# Testing #
++#---------#
++
++# Test suites
++MATLAB_TEST=0
++PYTHON_TEST=0
++JAVASCRIPT_TEST=0
++EXAMPLES_TEST=0
++
++# Number of CPUs used in ISSM compilation
++#
++# NOTE: One is usually safer as some packages are very sensitive to parallel
++# 		compilation.
++#
++NUMCPUS_INSTALL=8
++
++# Number of CPUs used in the nightly runs
++NUMCPUS_RUN=1
++
++# Nightly run options
++#
++# See documentation in test/NightlyRun/runme.* for more information.
++#
++MATLAB_NROPTIONS=""
++PYTHON_NROPTIONS=""
+
+Property changes on: ../trunk-jpl/jenkins/pleiades-basic
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 26342)
++++ ../trunk-jpl/etc/environment.sh	(revision 26343)
+@@ -445,10 +445,10 @@
+ 	export BOOST_ROOT # Used in installation of Dakota
+ 	export BOOST_DIR=${BOOST_ROOT}
+ 	export BOOSTROOT=${BOOST_ROOT}
+-	library_path_prepend "${BOOST_ROOT}/lib"
+-	ld_library_path_prepend "${BOOST_ROOT}/lib"
+-	dyld_library_path_prepend "${BOOST_ROOT}/lib"
+-	path_prepend "${BOOST_ROOT}/bin"
++	library_path_append "${BOOST_ROOT}/lib"
++	ld_library_path_append "${BOOST_ROOT}/lib"
++	dyld_library_path_append "${BOOST_ROOT}/lib"
++	path_append "${BOOST_ROOT}/bin"
+ fi
+ 
+ GSL_ROOT="${ISSM_EXT_DIR}/gsl/install"
+Index: ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26342)
++++ ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26343)
+@@ -6,6 +6,9 @@
+ #
+ VER="3.13.6"
+ 
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
+ # Download source
+ $ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz' 'petsc-${VER}.tar.gz'
+ 
+@@ -29,20 +32,29 @@
+ ./config/configure.py \
+ 	--prefix="${PREFIX}" \
+ 	--PETSC_DIR="${PETSC_DIR}" \
+-	--with-cc=icc --with-cxx=icpc --with-fc=ifort --with-f77=ifort\
+-	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
++	--with-cc=icc \
++	--with-cpp=/usr/bin/cpp \
++	--with-cxx=icpc \
++	--with-fc=ifort \
++	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
++	-CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
++	-FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
+ 	--with-blas-lapack-dir="/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/" \
++	--with-scalapack-include=/nasa/intel/Compiler/2016.2.181/mkl/include \
++	--with-scalapack-lib="/nasa/intel/Compiler/2016.2.181/mkl/lib/intel64/libmkl_scalapack_lp64.so /nasa/intel/Compiler/2016.2.181/mkl/lib/intel64/libmkl_blacs_sgimpt_lp64.so" \
+ 	--known-mpi-shared-libraries=1 \
++	--with-gnu-compilers=0 \
++	--with-vendor-compilers=intel \
+ 	--with-debugging=0 \
+ 	--with-valgrind=0 \
+ 	--with-x=0 \
+ 	--with-ssl=0 \
+-	--with-batch=1  \
++	--with-batch=1 \
+ 	--with-shared-libraries=1 \
+ 	--download-metis=1 \
+ 	--download-parmetis=1 \
+ 	--download-mumps=1 \
+-	--download-scalapack=1
++	--download-zlib=1
+ 
+ # Compile and install
+ make
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26342)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26343)
+@@ -611,17 +611,19 @@
+ 		dnl
+ 		dnl   	AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_], ${DAKOTA_VERSION}, [Dakota version number])
+ 		dnl
+-		DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
+-		if test -n "${DAKOTA_VERSION_OUTPUT}"; then
+-			DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
+-		elif test -f "${DAKOTA_ROOT}/VERSION"; then
++		if test -f "${DAKOTA_ROOT}/VERSION"; then
+ 			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`
+-		elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
+-			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
+-		elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
+-			DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
+ 		else
+-			AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
++			DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v`
++			if test -n "${DAKOTA_VERSION_OUTPUT}"; then
++				DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`
++			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then
++				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
++			elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then
++				DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' | grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `
++			else
++				AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]);
++			fi
+ 		fi
+ 		AC_MSG_RESULT([${DAKOTA_VERSION}])
+ 		AC_DEFINE_UNQUOTED(_DAKOTA_VERSION_, "${DAKOTA_VERSION}", [Dakota version number])
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26342)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26343)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @PARMETISINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
+ AM_FCFLAGS = @SEMICINCL@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+@@ -5,7 +5,7 @@
+ 
+ EXEEXT=$(ISSMEXT)
+ 
+-#Library declaration {{{
++# Library declaration {{{
+ if !WINDOWS
+ lib_LTLIBRARIES = libISSMCore.la
+ if !MSYS2
+@@ -22,10 +22,10 @@
+ endif
+ #}}}
+ 
+-#Core sources
++# Core sources
+ issm_sources =
+ 
+-#BAMG sources  {{{
++# BAMG sources {{{
+ if BAMG
+ issm_sources += \
+ 	./bamg/BamgGeom.cpp \
+@@ -56,7 +56,7 @@
+ 	./modules/BamgConvertMeshx/BamgConvertMeshx.cpp \
+ 	./modules/BamgTriangulatex/BamgTriangulatex.cpp
+ 
+-#do not include AmrBamg with AD
++# Do not include AmrBamg with AD
+ if ADOLC
+ issm_sources += \
+ 	./shared/Numerics/isnan.cpp \
+@@ -70,7 +70,7 @@
+ endif
+ endif
+ #}}}
+-#Core sources{{{
++# Core sources {{{
+ issm_sources += \
+ 	./datastructures/DataSet.cpp \
+ 	./classes/gauss/GaussSeg.cpp \
+@@ -343,7 +343,7 @@
+ 	./classes/Inputs/TransientInput.cpp \
+ 	./classes/Inputs/ArrayInput.cpp
+ #}}}
+-#ADJOINTMPI/MeDiPack sources {{{
++# ADJOINTMPI/MeDiPack sources {{{
+ if ADJOINTMPI
+ issm_sources += ./toolkits/codipack/ampi_interface.cpp
+ endif
+@@ -350,8 +350,8 @@
+ if MEDIPACK
+ issm_sources += ./toolkits/codipack/ampi_interface.cpp
+ endif
+-# }}}
+-#DAKOTA sources  {{{
++#}}}
++# DAKOTA sources {{{
+ if DAKOTA
+ issm_sources += \
+ 	./classes/Dakota/IssmDirectApplicInterface.h \
+@@ -368,7 +368,7 @@
+ endif
+ endif
+ #}}}
+-#Petsc sources  {{{
++# PETSc sources {{{
+ if PETSC
+ issm_sources += \
+ 	./toolkits/petsc \
+@@ -390,22 +390,22 @@
+ 	./toolkits/petsc/objects/PetscSolver.cpp
+ endif
+ #}}}
+-#Mumps sources  {{{
++# MUMPS sources {{{
+ if MUMPS
+ issm_sources += ./toolkits/mumps/MumpsSolve.cpp
+ endif
+ #}}}
+-#Gsl sources  {{{
++#GSL sources {{{
+ if GSL
+ issm_sources += ./toolkits/gsl/DenseGslSolve.cpp
+ endif
+ #}}}
+-#proj sources  {{{
++# PROJ sources {{{
+ if PROJ
+ issm_sources += ./modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
+ endif
+ #}}}
+-#Analyses{{{
++# Analyses {{{
+ if ADJOINTBALANCETHICKNESS
+ issm_sources += ./analyses/AdjointBalancethicknessAnalysis.cpp
+ endif
+@@ -520,7 +520,7 @@
+ issm_sources += ./analyses/ExtrapolationAnalysis.cpp
+ endif
+ #}}}
+-#Love sources (only if have fortran){{{
++# Love sources (only if have Fortran) {{{
+ if LOVE
+ if FORTRAN
+ issm_sources += \
+@@ -535,7 +535,7 @@
+ endif
+ endif
+ #}}}
+-#Esa sources  {{{
++# Esa sources {{{
+ if ESA
+ issm_sources += \
+ 	./cores/esa_core.cpp \
+@@ -542,19 +542,19 @@
+ 	./analyses/EsaAnalysis.cpp
+ endif
+ #}}}
+-#Oceansources  {{{
++# Ocean sources {{{
+ if OCEAN
+ issm_sources += ./modules/OceanExchangeDatax/OceanExchangeDatax.cpp
+ endif
+ #}}}
+-#Sampling sources  {{{
++# Sampling sources {{{
+ if SAMPLING
+ issm_sources += \
+ 	./cores/sampling_core.cpp \
+ 	./analyses/SamplingAnalysis.cpp
+ endif
+-# }}}
+-#Slc sources  {{{
++#}}}
++# SLC sources {{{
+ if SEALEVELCHANGE
+ issm_sources += \
+ 	./cores/sealevelchange_core.cpp \
+@@ -562,7 +562,7 @@
+ 	./classes/GrdLoads.cpp\
+ 	./classes/SealevelGeometry.cpp
+ 
+-#gia ivins physics (only if have fortran)
++# GIA Ivins physics (only if have Fortran)
+ if FORTRAN
+ issm_sources += \
+ 	./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp \
+@@ -577,17 +577,17 @@
+ 
+ endif
+ #}}}
+-#Metis sources  {{{
++# METIS sources {{{
+ if METIS
+ issm_sources += ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
+ endif
+ #}}}
+-#Esmf sources  {{{
++# Esmf sources {{{
+ if ESMF
+ issm_sources += ./main/esmfbinders.cpp
+ endif
+ #}}}
+-#SEMIC sources  {{{
++# SEMIC sources {{{
+ if SEMIC
+ if FORTRAN
+ issm_sources += ./modules/SurfaceMassBalancex/run_semic.f90
+@@ -594,8 +594,8 @@
+ endif
+ endif
+ #}}}
+-#Wrapper sources
+-#Kml sources  {{{
++# Wrapper sources
++# Kml sources {{{
+ kml_sources = \
+ 	./modules/Exp2Kmlx/Exp2Kmlx.cpp \
+ 	./modules/Kml2Expx/Kml2Expx.cpp \
+@@ -631,10 +631,10 @@
+ 	./kml/KML_Unknown.cpp \
+ 	./kml/KMLFileReadUtils.cpp
+ #}}}
+-#NEOPZ sources  {{{
++# NEOPZ sources {{{
+ neopz_sources = ./classes/AmrNeopz.cpp
+ #}}}
+-#Modules sources{{{
++# Modules sources {{{
+ modules_sources = \
+ 	./shared/Threads/LaunchThread.cpp \
+ 	./shared/Threads/PartitionRange.cpp \
+@@ -677,8 +677,8 @@
+ endif
+ #}}}
+ 
+-#kriging (WRAPPER and executable)
+-#Kriging sources  {{{
++# Kriging (wrapper and executable)
++# Kriging sources {{{
+ if KRIGING
+ issm_sources += \
+ 	./classes/kriging/Observations.cpp \
+@@ -696,7 +696,7 @@
+ 	./modules/Krigingx/pKrigingx.cpp
+ endif
+ #}}}
+-#Library flags and sources {{{
++# Library flags and sources {{{
+ ALL_CXXFLAGS = $(CXXFLAGS) $(CXXOPTFLAGS)
+ 
+ if MSYS2
+@@ -710,7 +710,7 @@
+ 
+ if !WINDOWS
+ if !STANDALONE_LIBRARIES
+-libISSMCore_la_LIBADD = $(CHACOLIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
++libISSMCore_la_LIBADD = $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
+ if FORTRAN
+ libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
+ endif
+@@ -784,7 +784,7 @@
+ #}}}
+ 
+ if !MSYS2
+-#Overload library, to overload any non-standard symbols. {{{
++# Overload library, to overload any non-standard symbols {{{
+ libISSMOverload_la_SOURCES = ./shared/String/ApiPrintf.cpp
+ libISSMOverload_la_CFLAGS  = -D_C_ -fPIC $(COPTFLAGS) $(CFLAGS)
+ 
+@@ -799,7 +799,7 @@
+ endif
+ endif
+ #}}}
+-#Executable {{{
++# Executable {{{
+ if ANDROID
+ if ANDROIDEXE
+ bin_PROGRAMS = issm issm_slc
+@@ -814,7 +814,7 @@
+ endif
+ endif
+ 
+-#Standard libraries
++# Standard libraries
+ LDADD = ./libISSMCore.la 
+ 
+ if !MSYS2
+@@ -825,7 +825,7 @@
+ LDADD += ./libISSMModules.la $(TRIANGLELIB)
+ endif
+ 
+-#External packages
++# External packages
+ LDADD += $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HDF5LIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(ESMFLIB) $(OSLIBS)
+ 
+ if FORTRAN
+Index: ../trunk-jpl/src/wrappers/javascript/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26342)
++++ ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26343)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @CODIPACKINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(JAVASCRIPTWRAPPEREXT)
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26342)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26343)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@ @PROJINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@ @PROJINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(MATLABWRAPPEREXT)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26343-26344.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26343-26344.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26343-26344.diff	(revision 26740)
@@ -0,0 +1,938 @@
+Index: ../trunk-jpl/src/m/classes/clusters/cloud.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/cloud.m	(revision 26343)
++++ ../trunk-jpl/src/m/classes/clusters/cloud.m	(revision 26344)
+@@ -19,8 +19,8 @@
+ 		function cluster=cloud(varargin) % {{{
+ 
+ 			%initialize cluster using user settings if provided
+-			if (exist('cloud_settings')==2), 
+-				eval('cloud_settings'); 
++			if (exist('cloud_settings')==2),
++				cloud_settings;
+ 			end
+ 
+ 			%OK get other fields
+@@ -28,7 +28,7 @@
+ 		end
+ 		%}}}
+ 		function disp(cluster) % {{{
+-			%  display the object
++			%display the object
+ 			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+ 			disp(sprintf('    name: %s',cluster.name));
+ 			disp(sprintf('    login: %s',cluster.login));
+@@ -52,15 +52,9 @@
+ 			%write queuing script 
+ 			fid=fopen([modelname '.queue'],'w');
+ 			fprintf(fid,'#!/bin/bash\n');
+-			if cluster.interactive
+-				fprintf(fid,'source %s%s\n',cluster.codepath,'/../etc/environment.sh');
+-				fprintf(fid,'cd %s\n',[cluster.executionpath '/' dirname]);
+-				fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s %s 2> %s.errlog > /dev/stdout | tee %s.outlog ',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+-			else
+-				fprintf(fid,'source %s%s\n',cluster.codepath,'/../etc/environment.sh');
+-				fprintf(fid,'cd %s\n',[cluster.executionpath '/' dirname]);
+-				fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s %s 2> %s.errlog > /dev/stdout | tee %s.outlog ',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+-			end
++			fprintf(fid,'source %s%s\n',cluster.codepath,'/../etc/environment.sh');
++			fprintf(fid,'cd %s\n',[cluster.executionpath '/' dirname]);
++			fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s/%s %s 2> %s.errlog > /dev/stdout | tee %s.outlog',cluster.np,cluster.codepath,solution,cluster.executionpath,dirname,modelname,modelname,modelname);
+ 		end
+ 		%}}}
+ 		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
+@@ -87,15 +81,15 @@
+ 					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname];
+ 				else
+ 					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz '];
++						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz'];
+ 				end
+ 			else
+ 				disp('launching solution sequence on remote cluster');
+ 				if ~isempty(restart)
+-					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub  ' modelname '.queue '];
++					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue'];
+ 				else
+ 					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub  ' modelname '.queue '];
++						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue'];
+ 				end
+ 			end
+ 			issmstssh(cluster.name,cluster.login,launchcommand);
+Index: ../trunk-jpl/src/m/classes/clusters/cloud.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/cloud.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/cloud.py	(revision 26344)
+@@ -0,0 +1,101 @@
++import subprocess
++
++try:
++    from cloud_settings import cloud_settings
++except ImportError:
++    print('You need cloud_settings.py to proceed, check presence and sys.path')
++
++class cloud(object):
++    """CLOUD cluster class definition
++
++    Usage:
++        cluster = cloud('name', 'astrid', 'np', 3)
++        cluster = cloud('name', oshostname(), 'np', 3, 'login', 'username')
++    """
++
++    def __init__(self, *args):  # {{{
++        self.name = ''
++        self.login = ''
++        self.np = 1
++        self.codepath = ''
++        self.executionpath = ''
++        self.interactive = 0
++
++        # Initialize cluster using user settings if provided
++        try:
++            self = cloud_settings(self)
++        except NameError:
++            print('cloud_settings.py not found, using default settings')
++
++        # OK get other fields
++        options = pairoptions(*args)
++        self = options.AssignObjectFields(self)
++    # }}}
++
++    def __repr__(self):  # {{{
++        # Display the object
++        s = 'class \'{}\' object \'{}\' = \n'.format(type(self), 'self')
++        s += '    name: {}\n'.format(self.name)
++        s += '    login: {}\n'.format(self.login)
++        s += '    np: {}\n'.format(self.np)
++        s += '    codepath: {}\n'.format(self.codepath)
++        s += '    executionpath: {}\n'.format(self.executionpath)
++        s += '    interactive: {}\n'.format(self.interactive)
++        return s
++    # }}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        if self.np < 1:
++            md = md.checkmessage('number of processors should be at least 1')
++
++        if np.isnan(self.np):
++            md = md.checkmessage('number of processors should not be NaN!')
++
++        return self
++    # }}}
++
++    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
++        # Write queuing script
++        fid = open(modelname + '.queue', 'w')
++
++        fid.write('#/bin/bash\n')
++        fid.write('source {}{}\n'.format(self.codepath, '/../etc/environment.sh'))
++        fid.write('cd {}/{}\n'.format(self.executionpath, dirname))
++        fid.write('mpiexec -np {} -f /home/mpich2.hosts {}/issm.exe {} {}/{} {} 2> {}.errlog > /dev/stdout | tee {}.outlog\n'.format(self.np, self.codepath, solution, self.executionpath, dirname, modelname, modelname, modelname))
++    # }}}
++
++    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
++        # Compress the files into one zip
++        compressstring = 'tar -zcf {}.tar.gz'.format(dirname)
++        for file in filelist:
++            compressstring += ' {}'.format(file)
++        subprocess.call(compressstring, shell=True)
++
++        if isempty(self.login):
++            raise Exception('cloud BuildQueueScript: login should be supplied!')
++
++        print('uploading input file and queueing script')
++        issmstscpout(self.name, self.executionpath, self.login, '{}.tar.gz'.format(dirname))
++    # }}}
++
++    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
++        if self.interactive:
++            print('sending files to remote cluster. once done, please log into cluster and launch job')
++            if not isempty(restart):
++                launchcommand = 'cd {} && cd {}'.format(self.executionpath, dirname)
++            else:
++                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname)
++        else:
++            print('launching solution sequence on remote cluster')
++            if not isempty(restart):
++                launchcommand = 'cd {} && cd {} && qsub {}.queue'.format(self.executionpath, dirname, modelname)
++            else:
++                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz && qsub {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
++        issmstssh(self.name, self.login, launchcommand)
++    # }}}
++
++    def Download(self, dirname, filelist):  # {{{
++        # Copy files from cluster to current directory
++        directory = '{}/{}/'.format(self.executionpath, dirname)
++        issmstscpin(self.name, self.login, directory, filelist)
++    # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/cyclone.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/cyclone.py	(revision 26343)
++++ ../trunk-jpl/src/m/classes/clusters/cyclone.py	(revision 26344)
+@@ -1,13 +1,15 @@
+ import subprocess
++
++try:
++    from cyclone_settings import cyclone_settings
++except ImportError:
++    print('You need cyclone_settings.py to proceed, check presence and sys.path')
+ from fielddisplay import fielddisplay
++from helpers import *
+ from pairoptions import pairoptions
+-from issmssh import issmssh
+ from issmscpin import issmscpin
+ from issmscpout import issmscpout
+-try:
+-    from cyclone_settings import cyclone_settings
+-except ImportError:
+-    print('You need cyclone_settings.py to proceed, check presence and sys.path')
++from issmssh import issmssh
+ 
+ 
+ class cyclone(object):
+@@ -95,7 +97,7 @@
+     # }}}
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+         print('launching solution sequence on remote cluster')
+-        if restart:
++        if not isempty(restart):
+             launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+         else:
+             launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && chmod +x ./%s.queue && ./%s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname, modelname)
+Index: ../trunk-jpl/src/m/classes/clusters/fram.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/fram.py	(revision 26343)
++++ ../trunk-jpl/src/m/classes/clusters/fram.py	(revision 26344)
+@@ -1,16 +1,19 @@
+ import subprocess
++
+ import numpy as np
++
+ from fielddisplay import fielddisplay
++try:
++    from fram_settings import fram_settings
++except ImportError:
++    print('You need fram_settings.py to proceed, check presence and sys.path')
++from helpers import *
+ from pairoptions import pairoptions
+-from issmssh import issmssh
++from IssmConfig import IssmConfig
+ from issmscpin import issmscpin
+ from issmscpout import issmscpout
++from issmssh import issmssh
+ from QueueRequirements import QueueRequirements
+-from IssmConfig import IssmConfig
+-try:
+-    from fram_settings import fram_settings
+-except ImportError:
+-    print('You need fram_settings.py to proceed, check presence and sys.path')
+ 
+ 
+ class fram(object):
+@@ -146,7 +149,7 @@
+     # }}}
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+         print('launching solution sequence on remote cluster')
+-        if restart:
++        if not isempty(restart):
+             launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
+         else:
+             launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 26343)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.m	(revision 26344)
+@@ -137,7 +137,6 @@
+ 			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+ 			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+ 			if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
+-			if ~isempty(cluster.interactive), md = checkmessage(md,'interactive mode not implemented'); end
+ 
+ 		end
+ 		%}}}
+@@ -162,7 +161,7 @@
+ %			fprintf(fid,'#PBS -N %s\n',modelname);
+ 			fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
+ 			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+-			fprintf(fid,'#PBS -q %s \n',cluster.queue);
++			fprintf(fid,'#PBS -q %s\n',cluster.queue);
+ 			fprintf(fid,'#PBS -W group_list=%s\n',cluster.grouplist);
+ 			fprintf(fid,'#PBS -m e\n');
+ 			fprintf(fid,'#PBS -o %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
+@@ -430,7 +429,7 @@
+ 					launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+ 				else
+ 					launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+-						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
++						' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue '];
+ 				end
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/clusters/saga.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/saga.py	(revision 26343)
++++ ../trunk-jpl/src/m/classes/clusters/saga.py	(revision 26344)
+@@ -1,12 +1,14 @@
++import datetime
+ import subprocess
++
+ from fielddisplay import fielddisplay
+-from pairoptions import pairoptions
+-from issmssh import issmssh
++from helpers import *
++from IssmConfig import IssmConfig
+ from issmscpin import issmscpin
+ from issmscpout import issmscpout
++from issmssh import issmssh
++from pairoptions import pairoptions
+ from QueueRequirements import QueueRequirements
+-from IssmConfig import IssmConfig
+-import datetime
+ try:
+     from saga_settings import saga_settings
+ except ImportError:
+@@ -156,7 +158,7 @@
+ 
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+         print('launching solution sequence on remote cluster')
+-        if restart:
++        if not isempty(restart):
+             launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
+         else:
+             launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+Index: ../trunk-jpl/src/m/classes/clusters/discover.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26343)
++++ ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26344)
+@@ -5,13 +5,12 @@
+ except ImportError:
+     print('You need discover_settings.py to proceed, check presence and sys.path')
+ from fielddisplay import fielddisplay
++from helpers import *
+ from IssmConfig import IssmConfig
+ from issmscpin import issmscpin
+ from issmscpout import issmscpout
+ from issmssh import issmssh
+ from MatlabFuncs import *
+-import math
+-import numpy as np
+ from pairoptions import pairoptions
+ from QueueRequirements import QueueRequirements
+ 
+@@ -59,7 +58,7 @@
+ 
+     def __repr__(self):  # {{{
+         # Display the object
+-        s = 'class pfe object\n'
++        s = 'class discover object\n'
+         s += '    name: {}\n'.format(self.name)
+         s += '    login: {}\n'.format(self.login)
+         s += '    modules: {}\n'.format(strjoin(self.modules, ', '))
+@@ -86,9 +85,9 @@
+     # }}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        queuedict = {'long': [24*60*60, 560],
+-                     'allnccs': [12*60*60, 6000],
+-                     'debug': [1*60*60, 532]}
++        queuedict = {'long': [24 * 60 * 60, 560],
++                     'allnccs': [12 * 60 * 60, 6000],
++                     'debug': [1 * 60 * 60, 532]}
+         QueueRequirements(queuedict, self.queue, self.nprocs(), self.time)
+ 
+         # Now, check cluster.cpuspernode according to processor type
+@@ -135,7 +134,7 @@
+         fid.write('#SBATCH -e {}.errlog \n'.format(modelname))
+         fid.write('#SBATCH -n {} \n'.format(self.nprocs()))
+         fid.write('#SBATCH -N {} \n'.format(self.numnodes))
+-        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(int(math.floor(self.time / 3600)), int(math.floor(self.time % 3600) / 60)))
++        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(floor(self.time / 3600), floor(self.time % 3600) / 60))
+         fid.write('#SBATCH -A {} \n\n'.format(self.grouplist))
+         if (self.email.find('@')>-1):
+             fid.write('#SBATCH --mail-user={} \n'.format(self.email))
+@@ -195,12 +194,12 @@
+ 
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+         if self.interactive:
+-            if restart:
++            if not isempty(restart):
+                 launchcommand = 'cd {}/Interactive{}'.format(self.executionpath, self.interactive)
+             else:
+                 launchcommand = 'cd {}/Interactive{} && tar -zxf {}.tar.gz'.format(self.executionpath, self.interactive, dirname)
+         else:
+-            if restart:
++            if not isempty(restart):
+                 launchcommand = 'cd {} && cd {} && sbatch {}.queue'.format(self.executionpath, dirname, modelname)
+             else:
+                 launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz && sbatch {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26343)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26344)
+@@ -1,6 +1,7 @@
+ import subprocess
+ 
+ from fielddisplay import fielddisplay
++from helpers import *
+ from IssmConfig import IssmConfig
+ from issmscpin import issmscpin
+ from issmscpout import issmscpout
+@@ -139,8 +140,6 @@
+             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
+     # }}}
+@@ -181,7 +180,6 @@
+         fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
+ 
+         fid.close()
+-
+     # }}}
+ 
+     def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+@@ -199,7 +197,7 @@
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+         # Launch command, to be executed via ssh
+         if self.interactive:
+-            if restart:
++            if not isempty(restart):
+                 launchcommand = 'cd {} /Interactive{}'.format(self.executionpath, self.interactive)
+             else:
+                 if self.interactive == 10:
+@@ -207,7 +205,7 @@
+                 else:
+                     launchcommand = 'cd {} /Interactive{} && tar -zxf {}.tar.gz'.format(self.executionpath, self.interactive, dirname)
+         else:
+-            if restart:
++            if not isempty(restart):
+                 launchcommand = 'cd {} && cd {} && qsub {}.queue'.format(self.executionpath, dirname, modelname)
+             else:
+                 launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz  && qsub {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26343)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26344)
+@@ -8,8 +8,7 @@
+ 
+ 
+ def gmshplanet(*args):
+-    '''
+-    GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh from $ISSM_DIR/src/demos/simple_geo/sphere.geo
++    """GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh from $ISSM_DIR/src/demos/simple_geo/sphere.geo
+ 
+     Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
+     - radius:             radius of the planet in km
+@@ -17,12 +16,12 @@
+     - refine:             provide mesh
+     - refinemetric:       mesh quantity to specify resolution
+ 
+-        Returns 'mesh3dsurface' type mesh
++    Returns 'mesh3dsurface' type mesh
+ 
+-        Examples:
+-            md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
+-            md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
+-    '''
++    Examples:
++        md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
++        md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
++    """
+ 
+     # Get Gmsh version
+     subproc_args = "gmsh -info 2>&1 | command grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"
+@@ -34,17 +33,17 @@
+     if gmshmajorversion not in [3, 4]:
+         raise RuntimeError("gmshplanet: Gmsh major version {} not supported!".format(gmshmajorversion))
+ 
+-    #process options
++    # Process options
+     options = pairoptions(*args)
+     #options = deleteduplicates(options, 1)
+ 
+-    #recover parameters:
++    # Recover parameters
+     radius = options.getfieldvalue('radius') * 1000
+     resolution = options.getfieldvalue('resolution') * 1000
+ 
+-    #initialize mesh:
++    # Initialize mesh
+     mesh = mesh3dsurface()
+-    #create .geo file:  {{{
++    # Create .geo file:  {{{
+     fid = open('sphere.geo', 'w')
+ 
+     fid.write('Mesh.Algorithm = 1;\n')
+@@ -107,7 +106,7 @@
+         meshini = options.getfieldvalue('refine')
+         metric = options.getfieldvalue('refinemetric')
+ 
+-    #create .pos file with existing mesh and refining metric:  {{{
++        # Create .pos file with existing mesh and refining metric:  {{{
+         fid = open('sphere.pos', 'w')
+ 
+         fid.write('View "background mesh" [;\n')
+@@ -119,7 +118,7 @@
+                       metric(meshini.elements(i, 0)), metric(meshini.elements(i, 1)), metric(meshini.elements(i, 2)))
+         fid.write('];\n')
+         fid.close()
+-    # }}}
++        #}}}
+ 
+     # Call gmsh
+     #
+@@ -132,10 +131,10 @@
+     else:
+         subprocess.call('gmsh -tol 1e-8 -2 -format msh2 sphere.geo', shell=True)
+ 
+-    #import mesh:  {{{
++    # Import mesh  {{{
+     fid = open('sphere.msh', 'r')
+ 
+-    #Get Mesh format
++    # Get mesh format
+     A = fid.readline().strip()
+     if A != '$MeshFormat':
+         raise RuntimeError(['Expecting $MeshFormat (', A, ')'])
+@@ -145,7 +144,7 @@
+     if A != '$EndMeshFormat':
+         raise RuntimeError(['Expecting $EndMeshFormat (', A, ')'])
+ 
+-    #Nodes
++    # Nodes
+     A = fid.readline().strip()
+     if A != '$Nodes':
+         raise RuntimeError(['Expecting $Nodes (', A, ')'])
+@@ -164,7 +163,7 @@
+     if A != '$EndNodes':
+         raise RuntimeError(['Expecting $EndNodes (', A, ')'])
+ 
+-    #Elements
++    # Elements
+     A = fid.readline().strip()
+     if A != '$Elements':
+         raise RuntimeError(['Expecting $Elements (', A, ')'])
+@@ -185,8 +184,8 @@
+     mesh.lat = np.arcsin(mesh.z / mesh.r) / np.pi * 180
+     mesh.long = np.arctan2(mesh.y, mesh.x) / np.pi * 180
+ 
+-    #erase files:
++    # Erase files
+     subprocess.call('rm -rf sphere.geo sphere.msh sphere.pos', shell=True)
+ 
+-    #return mesh:
++    # Return mesh
+     return mesh
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26343)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26344)
+@@ -7,7 +7,7 @@
+ from the MATLAB to the Python ISSM API more seamless.
+ """
+ 
+-def acosd(X): #{{{
++def acosd(X):  #{{{
+     """ function acosd - Inverse cosine in degrees
+ 
+     Usage:
+@@ -18,7 +18,7 @@
+     return np.degrees(np.arccos(X))
+ #}}}
+ 
+-def asind(X): #{{{
++def asind(X):  #{{{
+     """ function asind - Inverse sine in degrees
+ 
+     Usage:
+@@ -29,7 +29,7 @@
+     return np.degrees(np.arcsin(X))
+ #}}}
+ 
+-def atand(X): #{{{
++def atand(X):  #{{{
+     """ function atand - Inverse tangent in degrees
+ 
+     Usage:
+@@ -41,8 +41,8 @@
+ #}}}
+ 
+ 
+-def atan2d(Y, X): #{{{
+-    """ function atan2d - Four-quadrant inverse tangent in degrees
++def atan2d(Y, X):  #{{{
++    """function atan2d - Four-quadrant inverse tangent in degrees
+ 
+     Usage:
+         D = atan2d(Y, X)
+@@ -52,7 +52,7 @@
+     return np.degrees(np.arctan2(Y, X))
+ #}}}
+ 
+-def det(a): #{{{
++def det(a):  #{{{
+     if a.shape == (1, ):
+         return a[0]
+     elif a.shape == (1, 1):
+@@ -63,7 +63,15 @@
+         raise TypeError("MatlabFunc.det only implemented for shape (2, 2), not for shape %s." % str(a.shape))
+ #}}}
+ 
+-def find(*args): #{{{
++def error(msg):  #{{{
++    raise Exception(msg)
++#}}}
++
++def etime(t2, t1):  #{{{
++    return t2 - t1
++#}}}
++
++def find(*args):  #{{{
+     nargs = len(args)
+     if nargs >= 1 or nargs <= 2:
+         X = args[0]
+@@ -79,7 +87,13 @@
+         raise Exception('find: must have 1 or 2 arguments')
+ #}}}
+ 
+-def heaviside(x): #{{{
++def floor(X):  #{{{
++    import math
++
++    return int(math.floor(X))
++#}}}
++
++def heaviside(x):  #{{{
+     import numpy as np
+ 
+     y = np.zeros_like(x)
+@@ -89,7 +103,13 @@
+     return y
+ #}}}
+ 
+-def ismac(): #{{{
++def isfile(fileName):  #{{{
++    import os
++
++    return os.path.exists(fileName)
++#}}}
++
++def ismac():  #{{{
+     import platform
+ 
+     if 'Darwin' in platform.system():
+@@ -98,7 +118,7 @@
+         return False
+ #}}}
+ 
+-def ismember(a, s): #{{{
++def ismember(a, s):  #{{{
+     import numpy as np
+ 
+     if not isinstance(s, (tuple, list, dict, np.ndarray)):
+@@ -120,7 +140,13 @@
+     return b
+ #}}}
+ 
+-def ispc(): #{{{
++def isnan(A):  #{{{
++    import numpy as np
++
++    return np.isnan(A)
++#}}}
++
++def ispc():  #{{{
+     import platform
+ 
+     if 'Windows' in platform.system():
+@@ -129,17 +155,37 @@
+         return False
+ #}}}
+ 
+-def mod(a, m): #{{{
++def isprop(obj, PropertyName):  #{{{
++    return hasattr(obj, PropertyName)
++#}}}
++
++def mod(a, m):  #{{{
+     return a % m
+ #}}}
+ 
+-def oshostname(): #{{{
++def pause(n):  #{{{
++    import time
++
++    time.sleep(n)
++#}}}
++
++def pwd():  #{{{
++    import os
++
++    return os.getcwd()
++#}}}
++
++def oshostname():  #{{{
+     import socket
+ 
+     return socket.gethostname()
+ #}}}
+ 
+-def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0): #{{{
++def rem(a, b):  #{{{
++    return a % b
++#}}}
++
++def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):  #{{{
+     import numpy as np
+ 
+     if not m:
+@@ -155,7 +201,7 @@
+     return a
+ #}}}
+ 
+-def strcmp(s1, s2): #{{{
++def strcmp(s1, s2):  #{{{
+     if s1 == s2:
+         return True
+     else:
+@@ -162,7 +208,7 @@
+         return False
+ #}}}
+ 
+-def strcmpi(s1, s2): #{{{
++def strcmpi(s1, s2):  #{{{
+     if s1.lower() == s2.lower():
+         return True
+     else:
+@@ -169,7 +215,7 @@
+         return False
+ #}}}
+ 
+-def strjoin(*args): #{{{
++def strjoin(*args):  #{{{
+     nargs = len(args)
+     if nargs >= 1 or nargs <= 2:
+         sep = ' '
+@@ -180,7 +226,7 @@
+         raise Exception('strjoin: must have 1 or 2 arguments')
+ #}}}
+ 
+-def strncmp(s1, s2, n): #{{{
++def strncmp(s1, s2, n):  #{{{
+     if s1[0:n] == s2[0:n]:
+         return True
+     else:
+@@ -187,7 +233,7 @@
+         return False
+ #}}}
+ 
+-def strncmpi(s1, s2, n): #{{{
++def strncmpi(s1, s2, n):  #{{{
+     if s1.lower()[0:n] == s2.lower()[0:n]:
+         return True
+     else:
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 26343)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 26344)
+@@ -105,7 +105,7 @@
+     if restart == 1:
+         pass  # do nothing
+     else:
+-        if restart:
++        if not isempty(restart):
+             md.private.runtimename = restart
+         else:
+             if options.getfieldvalue('runtimename', True):
+Index: ../trunk-jpl/src/m/solve/waitonlock.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.m	(revision 26343)
++++ ../trunk-jpl/src/m/solve/waitonlock.m	(revision 26344)
+@@ -36,7 +36,7 @@
+ end
+ 
+ %initialize time and file presence test flag
+-time=0; ispresent=0; time0=clock;
++elapsedtime=0; ispresent=0; starttime=clock;
+ disp(['waiting for ' lockfilename ' hold on... (Ctrl+C to exit)'])
+ 
+ %prepare command if the job is not running on the local machine
+@@ -57,16 +57,16 @@
+ end
+ 
+ %loop till file .lock exist or time is up
+-while (ispresent==0 & time<timelimit)
++while (ispresent==0 & elapsedtime<timelimit)
+ 	if strcmpi(oshostname(),cluster.name),
+ 		pause(1);
+ 		ispresent=(exist(lockfilename,'file') & exist(logfilename,'file'));
+-		time=etime(clock,time0)/60;
++		elapsedtime=etime(clock,starttime)/60;
+ 	else
+ 		pause(5);
+-		time=etime(clock,time0);
+-		fprintf('\rchecking for job completion (time: %i min %i sec)      ',floor(time/60),floor(rem(time,60)));
+-		time=time/60; %converts time from sec to min
++		elapsedtime=etime(clock,starttime);
++		fprintf('\rchecking for job completion (time: %i min %i sec)      ',floor(elapsedtime/60),floor(rem(elapsedtime,60)));
++		elapsedtime=elapsedtime/60; %converts time from sec to min
+ 		ispresent=~system(command);
+ 		if ispresent, fprintf('\n'); end
+ 	end
+@@ -73,7 +73,7 @@
+ end
+ 
+ %build output
+-if (time>timelimit),
++if (elapsedtime>timelimit),
+ 	disp('Time limit exceeded. Increase md.settings.waitonlock');
+ 	disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
+ 	error(['waitonlock error message: time limit exceeded']);
+Index: ../trunk-jpl/src/m/solve/waitonlock.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26343)
++++ ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26344)
+@@ -1,4 +1,5 @@
+-import os
++import subprocess
++import sys
+ import time
+ from MatlabFuncs import *
+ 
+@@ -5,54 +6,82 @@
+ 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
++    This routine will return when a file named 'lockfilename' is written to 
++    disk. Also check for outlog file because it might be written several 
++    seconds after the lock file.
+ 
++    If the time limit given in input is exceeded, return 0.
++
+     Usage:
+         flag = waitonlock(md)
+     """
+ 
+-    #Get filename (lock file) and options
++    # Get lockfilename (lock file) and options
+     executionpath = md.cluster.executionpath
+-    cluster = md.cluster.name
+     timelimit = md.settings.waitonlock
+-    filename = os.path.join(executionpath, md.private.runtimename, md.miscellaneous.name + '.lock')
++    cluster = md.cluster
+ 
+-    #waitonlock will work if the lock is on the same machine only:
+-    if not strcmpi(oshostname(), cluster):
++    """
++    NOTE: We check cluster.name against string as cluster classes are not 
++          defined globally and we do not have to import them all
++    """
++    if cluster.name == 'pfe' and cluster.interactive > 1:
++        lockfilename = '{}/Interactive{}/{}.lock'.format(executionpath, cluster.interactive, md.miscellaneous.name)
++        logfilename = '{}/Interactive{}/{}.outlog'.format(executionpath, cluster.interactive, md.miscellaneous.name)
++    elif cluster.name == 'localpfe':
++        lockfilename = '{}/{}.lock'.format(executionpath, md.miscellaneous.name)
++        logfilename = '{}/{}.outlog'.format(executionpath, md.miscellaneous.name)
++    else:
++        lockfilename = '{}/{}/{}.lock'.format(executionpath, md.private.runtimename, md.miscellaneous.name)
++        logfilename = '{}/{}/{}.outlog'.format(executionpath, md.private.runtimename, md.miscellaneous.name)
+ 
+-        print('solution launched on remote cluster. log in to detect job completion.')
+-        choice = eval(input('Is the job successfully completed? (y / n) '))
+-        if not strcmp(choice, 'y'):
+-            print('Results not loaded... exiting')
+-            flag = 0
+-        else:
+-            flag = 1
++    # If we are using the generic cluster in interactive mode, job is already complete
++    if (cluster.name == 'generic' and cluster.interactive) or (cluster.name == 'generic_static'):
++        # We are in interactive mode, no need to check for job completion
++        return 1
+ 
+-    #job is running on the same machine
+-    else:
+-        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))
++    # Initialize time and file presence test flag
++    elapsedtime = 0
++    ispresent = 0
++    starttime = time.time()
++    print('waiting for {} hold on... (Ctrl+C to exit)'.format(lockfilename))
+ 
+-        #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
++    # Prepare command if the job is not running on the local machine
++    if not strcmpi(oshostname(), cluster.name):
++        login = cluster.login
++        port = 0
++        if isprop(cluster, 'port'):
++            port = cluster.port
++        if port:
++            command = 'ssh -l {} -p {} localhost "[ -f {} ] && [ -f {} ]" 2>/dev/null'.format(login, port, lockfilename, logfilename)
++        elif cluster.name == 'cloud':
++            command = '[ -f {} ] && [ -f {} ] 2>/dev/null'.format(lockfilename, logfilename)
++            command = '{} sshmaster {} --user {} \'{}\''.format(starcluster(), cluster.name, cluster.login, command)
++        else:
++            command = 'ssh -l {} {} "[ -f {} ] && [ -f {} ]" 2>/dev/null'.format(login, cluster.name, lockfilename, logfilename)
+ 
+-        #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
++    while not ispresent and elapsedtime < timelimit:
++        if strcmpi(oshostname(), cluster.name):
++            pause(1)
++            ispresent = (isfile(lockfilename) and isfile(logfilename))
++            elapsedtime = etime(time.time(), starttime) / 60
+         else:
+-            flag = 1
++            pause(5)
++            elapsedtime = etime(time.time(), starttime)
++            sys.stdout.write('\rchecking for job completion (time: {} min {} sec)      '.format(floor(elapsedtime / 60), floor(rem(elapsedtime, 60)))) # TODO: After Python 2 is deprecated, we can change this call to print([...], end='')
++            elapsedtime = elapsedtime / 60 # Converts time from sec to min
++            subproc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
++            outs, errs = subproc.communicate() # NOTE: Need to consume output before checking return code
++            if errs != '':
++                raise Exception("waitonlock: check for existence of files failed: {}".format(errs))
++            ispresent = not subproc.returncode
++            if ispresent:
++                print('')
+ 
+-    return flag
++    # Build output
++    if elapsedtime > timelimit:
++        print('Time limit exceeded. Increase md.settings.waitonlock')
++        print('The results must be loaded manually with md = loadresultsfromcluster(md).')
++        raise RuntimeError('waitonlock error message: time limit exceeded.')
++
++    return ispresent
+Index: ../trunk-jpl/src/wrappers/javascript/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26343)
++++ ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26344)
+@@ -7,7 +7,7 @@
+ AM_CPPFLAGS+=  -DISSM_PREFIX='"$(prefix)"'
+ 
+ js_scripts = ${ISSM_DIR}/src/wrappers/BamgMesher/BamgMesher.js \
+-             ${ISSM_DIR}/src/wrappers/Triangle/Triangle.js  \
++			 ${ISSM_DIR}/src/wrappers/Triangle/Triangle.js \
+ 			 ${ISSM_DIR}/src/wrappers/NodeConnectivity/NodeConnectivity.js\
+ 			 ${ISSM_DIR}/src/wrappers/ContourToMesh/ContourToMesh.js\
+ 			 ${ISSM_DIR}/src/wrappers/ElementConnectivity/ElementConnectivity.js\
Index: /issm/oecreview/Archive/25834-26739/ISSM-26344-26345.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26344-26345.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26344-26345.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/m/solve/waitonlock.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26344)
++++ ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26345)
+@@ -72,8 +72,10 @@
+             elapsedtime = elapsedtime / 60 # Converts time from sec to min
+             subproc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+             outs, errs = subproc.communicate() # NOTE: Need to consume output before checking return code
+-            if errs != '':
+-                raise Exception("waitonlock: check for existence of files failed: {}".format(errs))
++            # TODO: Debug the following check under Linux (exits after first iteration with errs = "b")
++            #
++            # if errs != '':
++            #     raise Exception("waitonlock: check for existence of files failed: {}".format(errs))
+             ispresent = not subproc.returncode
+             if ispresent:
+                 print('')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26345-26346.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26345-26346.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26345-26346.diff	(revision 26740)
@@ -0,0 +1,93 @@
+Index: ../trunk-jpl/src/m/classes/clusters/generic.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.js	(revision 26345)
++++ ../trunk-jpl/src/m/classes/clusters/generic.js	(revision 26346)
+@@ -114,8 +114,9 @@
+ 		request.open('POST', this.url, true);
+ 		
+ 		// Set request properties
+-		request.position 	= 0; // Keep track of current parsing position in repsonseText
+-		request.timeout 	= 1000 * 60 * 60 * 3; // 3 hrs (in milliseconds); NOTE: This should match FastCgiServer timeout in Apache conf
++		request.position 	 = 0; // Keep track of current parsing position in repsonseText
++		request.timeout 	= 1000 * 60 * 10; // in milliseconds; NOTE: Under current implementation, this should match 'Timeout' option in Apache conf (/etc/apache2/apache2.conf)
++		request.resultBegin = false;
+ 		
+ 		request.ontimeout = function(event) { //{{{
+ 			console.log('Error: timeout!');
+@@ -186,7 +187,16 @@
+ 						solveButton.text('Downloading: ' + progress + '%').prop('disabled', true);
+ 					}
+ 				} else if (request.responseText.length >= endIndex) { // Ensure entire chunk is loaded
+-					progress = parseInt(request.responseText.slice(startIndex, endIndex));
++					if (request.resultBegin) {
++						return;
++					}
++					chunk = request.responseText.slice(startIndex, endIndex)
++					if (chunk == 'RESULT_BEGIN') {
++						progress = 100;
++						request.resultBegin = true;
++					} else {
++						progress = parseInt(chunk);
++					}
+ 					if (hasCallout) {
+ 						callout.setHeader('Computing...');
+ 						if (withProgressBar) {
+@@ -220,16 +230,23 @@
+ 			} //}}}
+ 			
+ 			try {
+-/*
+-				console.log(request.responseText);
+-				console.log('request.position : ' + request.position);
+-				console.log('request.responseType : ' + request.responseType);
+-				console.log('request.responseText.length : ' + request.responseText.length);
+-*/
++				//Scan through buffer until progress updates stop and 'RESULT_BEGIN' string is received
++				let startIndex 	= request.position;
++				let endIndex 	= request.position + 10;
++				let chunkSize = 0;
++				let chunk = 0;
++				while (!request.resultBegin && chunk != 'RESULT_BEGIN') {
++					chunkSize = parseInt(request.responseText.slice(startIndex, endIndex));
++					startIndex 	= endIndex;
++					endIndex 	= startIndex + chunkSize;
++					chunk = request.responseText.slice(startIndex, endIndex);
++					startIndex 	= endIndex;
++					endIndex 	= startIndex + 10;
++					request.position = startIndex;
++				}
++
+ 				responseText 	= window.atob(request.responseText.slice(request.position + 10).replace(/\s/g, ''));
+-// 				console.log('responseText.length : ' + responseText.length);
+ 				buffer 			= str2ab(responseText);
+-// 				console.log('buffer.length : ' + buffer.length);
+ /*
+ 	            bufferInflated 	= UZIP.inflate(buffer);
+ 				console.log('bufferInflated.length : ' + bufferInflated.length);
+@@ -247,7 +264,7 @@
+ 				
+ 				// Let front end script handle changes to callout
+ 				if (hasCallout) {
+-					callout.set('Success!', '<p>Solve successful</p>');
++					callout.set('Success!', '<p>Request successful</p>');
+ 				} else {
+ 					solveButton.text(solveButtonText).prop('disabled', false);
+ 				}
+@@ -254,7 +271,7 @@
+ 				successCallback();
+ 			} catch (e) {
+ 				console.log(e);
+-				if (vesl.string.startsWith(responseText, 'Error')) {
++				if (vesl.strings.startsWith(responseText, 'Error')) {
+ 					if (hasCallout) {
+ 						callout.set(vesl.ERROR_HEADER_GENERAL, '<p>Something went wrong. ' + vesl.ERROR_CONTENT_TRY_AGAIN + '</p>');
+ 					} else {
+@@ -271,7 +288,7 @@
+ 			}
+ 		}; //}}}
+ 		
+-		request.responseType = 'application/octet-stream';
++		request.responseType = 'text';
+ 		
+ 		/* Construct request */
+ 		let npbuffer = this.str2ab(md.cluster.np.toString());
Index: /issm/oecreview/Archive/25834-26739/ISSM-26346-26347.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26346-26347.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26346-26347.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/m/solve/waitonlock.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26346)
++++ ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26347)
+@@ -73,9 +73,10 @@
+             subproc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+             outs, errs = subproc.communicate() # NOTE: Need to consume output before checking return code
+             # TODO: Debug the following check under Linux (exits after first iteration with errs = "b")
++            # UPDATE: Works in testing under Debian Linux system. Leaving comment for now so that it is easier to backtrace this issue if someone else encounters it.
+             #
+-            # if errs != '':
+-            #     raise Exception("waitonlock: check for existence of files failed: {}".format(errs))
++            if errs != '':
++                raise Exception("waitonlock: check for existence of files failed: {}".format(errs))
+             ispresent = not subproc.returncode
+             if ispresent:
+                 print('')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26347-26348.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26347-26348.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26347-26348.diff	(revision 26740)
@@ -0,0 +1,45 @@
+Index: ../trunk-jpl/externalpackages/emscripten/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/emscripten/install.sh	(revision 26347)
++++ ../trunk-jpl/externalpackages/emscripten/install.sh	(revision 26348)
+@@ -14,28 +14,23 @@
+ 
+ ## Environment
+ #
+-PREFIX="${ISSM_DIR}/externalpackages/emscripten/install"
++PREFIX="${ISSM_EXT_DIR}/emscripten/install"
+ 
+-# Get Emscripten SDK (emsdk) driver if we have not previously installed
+-# Emscripten. Otherwise, just get the latest version.
+-if [[ ! -d ${PREFIX} ]]; then
+-        # Get the emsdk repo
+-        git clone https://github.com/emscripten-core/emsdk.git
++# Cleanup
++rm -rf ${PREFIX}
+ 
+-        # Create $PREFIX directory
+-        mkdir -p ${PREFIX}
++# Get the emsdk repo
++git clone https://github.com/emscripten-core/emsdk.git
+ 
+-        # Move source to $PREFIX directory
+-        mv emsdk/* ${PREFIX}
+-        rm -rf emsdk
++# Create $PREFIX directory
++mkdir -p ${PREFIX}
+ 
+-        cd ${PREFIX}
+-else
+-        # Fetch the latest version of the emsdk
+-        cd ${PREFIX}
+-        git pull
+-fi
++# Move source to $PREFIX directory
++mv emsdk/* ${PREFIX}
++rm -rf emsdk
+ 
++cd ${PREFIX}
++
+ # Download and install the latest SDK tools.
+ ./emsdk install ${VER}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26348-26349.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26348-26349.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26348-26349.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/externalpackages/emscripten/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/emscripten/install.sh	(revision 26348)
++++ ../trunk-jpl/externalpackages/emscripten/install.sh	(revision 26349)
+@@ -14,7 +14,7 @@
+ 
+ ## Environment
+ #
+-PREFIX="${ISSM_EXT_DIR}/emscripten/install"
++PREFIX="${ISSM_DIR}/externalpackages/emscripten/install"
+ 
+ # Cleanup
+ rm -rf ${PREFIX}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26349-26350.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26349-26350.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26349-26350.diff	(revision 26740)
@@ -0,0 +1,161 @@
+Index: ../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.m	(revision 26349)
++++ ../trunk-jpl/test/NightlyRun/runme.m	(revision 26350)
+@@ -1,13 +1,15 @@
+ function varargout=runme(varargin)
+ %RUNME - test deck for ISSM nightly runs
+ %
+-%   In a test deck directory (test/Vertification/NightlyRun for example)
+-%   The following command will launch all the existing tests:
+-%   >> runme
+-%   To run the tests 101 and 102:
+-%   >> runme('id',[101 102])
+-%   etc...
++%   In a test deck directory (for example, test/NightlyRun) the following 
++%   command will launch all existing tests,
+ %
++%      >> runme
++%
++%   To run tests 101 and 102,
++%
++%      >> runme('id',[101 102])
++%
+ %   Available options:
+ %      'id'            followed by the list of ids requested
+ %      'exclude'       ids to be excluded from the test
+@@ -23,7 +25,6 @@
+ %                      'slc'         : validation of slc tests
+ %                      'thermal'     : validation of thermal tests
+ %                      'tranforcing' : validation of transient forcing tests
+-%                      ...
+ %      'procedure'     'check' :   run the test (default)
+ %                      'update':   update the archive
+ %                      'valgrind': check for memory leaks (default value of md.debug.valgrind needs to be changed manually)
+@@ -36,8 +37,15 @@
+ %      runme;
+ %      runme('exclude',101);
+ %      runme('id',102,'procedure','update');
+-
+ %      runme('procedure','valgrind','stoponerror',1,'exclude','IdFromString('Dak'));
++%
++%   NOTE:
++%   - Will only run test scripts whose names explicitly follow the convention,
++%
++%         test<id>.m
++%
++%   where <id> is any integer.
++%
+ 
+ %Check inputs
+ % {{{
+@@ -81,18 +89,22 @@
+ flist=dir;%use dir, as it seems to act OS independent
+ list_ids=[];
+ for i=1:numel(flist),
+-	if ( strncmp(flist(i).name,'test',4) &...                         %File name must start with 'test'
+-			strncmp(fliplr(flist(i).name),fliplr('.m'),2)&...           %File name must end by '.m'
+-			~strcmp(flist(i).name,'test.m'))                            %File name must be different than 'test.m'
+-		id=str2num(flist(i).name(5:end-2));
+-		if isempty(id),
+-			disp(['WARNING: ignore file ' flist(i).name ]);
+-		else
+-			list_ids(end+1)=eval(flist(i).name(5:end-2));                  %Keep test id only (skip 'test' and '.m')
++	fname=flist(i).name;
++	if (contains(fname,'.')), %Before split, check that file name contains '.'
++		ftokens=string(split(fname,'.')); %Tokenize file name on '.'
++		if (regexp(ftokens{1},'^test[0-9]+$') &... %Basename must start with 'test' and end with a number
++			strcmp(ftokens{end},'m') ... %Extension (less '.') must be 'm'
++		),
++			id=sscanf(ftokens{1},'test%d');
++			if isempty(id),
++				disp(['WARNING: ignore file ' flist(i).name]);
++			else
++				list_ids(end+1)=id;%Keep test id only (strip 'test' and '.m')
++			end
+ 		end
+ 	end
+ end
+-[i1,i2]=parallelrange(rank,numprocs,length(list_ids));               %Get tests for this cpu only
++[i1,i2]=parallelrange(rank,numprocs,length(list_ids)); %Get tests for this cpu only
+ list_ids=list_ids(i1:i2);
+ 
+ test_ids=getfieldvalue(options,'id',list_ids);
+Index: ../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.py	(revision 26349)
++++ ../trunk-jpl/test/NightlyRun/runme.py	(revision 26350)
+@@ -2,6 +2,7 @@
+ import argparse
+ from glob import glob
+ import os
++import re
+ from sys import float_info
+ from traceback import format_exc
+ 
+@@ -21,12 +22,12 @@
+ 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 (test/NightlyRun for example), the following 
+-    command will launch all the existing tests,
++    In a test deck directory (for example, test/NightlyRun) the following 
++    command will launch all existing tests,
+ 
+         ./runme.py
+ 
+-    To run tests 101 and 102:
++    To run tests 101 and 102,
+ 
+         ./runme.py -i [101, 102]
+ 
+@@ -33,10 +34,8 @@
+     Options:
+         -i/--id             followed by the list of ids or (parts of) test names requested
+                             NOTE: runs all tests by default
+-
+         -e/--exclude        ids or (parts of) test names to be excluded (same format as id)
+                             NOTE: exclude does nothing if 'id' is specified with different values
+-
+         -b/--benchmark      'all'           : (all of the tests)
+                             'nightly'       : (nightly run/daily run)
+                             'validation'    : (validation)
+@@ -49,7 +48,6 @@
+                             'slc'           : validation of slc tests
+                             'thermal'       : validation of thermal tests
+                             'tranforcing'   : validation of transient forcing tests
+-
+         -p/--procedure      'check'         : run the test (default)
+                             'update'        : update the archive
+ 
+@@ -64,10 +62,19 @@
+         ./runme.py -e 'Dakota' --benchmark 'all'
+         ./runme.py -i [[101, 102], ['Dakota', 'Slc']]
+ 
++    NOTE:
++    - Will only run test scripts whose names explicitly follow the convention,
++
++        test<id>.py
++
++    where <id> is any integer.
++
+     TODO:
+     - At '#disp test result', make sure precision of output matches that of 
+-        MATLAB.
+-    - Check for failures that do not raise exceptions (for example, 'Standard exception'; see also jenkins/jenkins.sh). These should be counted as failures.
++    MATLAB.
++    - Check for failures that do not raise exceptions (for example, 'Standard 
++    exception'; see also jenkins/jenkins.sh). These should be counted as 
++    failures.
+     """
+ 
+     #Get ISSM_DIR variable
+@@ -95,7 +102,7 @@
+     # }}}
+     #GET ids  {{{
+     flist = glob('test*.py')  #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
+-    list_ids = [int(file[4:-3]) for file in flist if not file == 'test.py']  #Keep test id only (skip 'test' and '.py')
++    list_ids = [int(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] #Keep test id only (skip 'test' and '.py')
+ 
+     i1, i2 = parallelrange(rank, numprocs, len(list_ids))  #Get tests for this cpu only
+     list_ids = list_ids[i1:i2 + 1]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26350-26351.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26350-26351.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26350-26351.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 26350)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 26351)
+@@ -325,7 +325,6 @@
+ 						earth_density=earth_density + (self.radius(i+1)^3-self.radius(i)^3)*self.density(i);
+ 					end
+ 					earth_density=earth_density/self.radius(self.numlayers+1)^3;
+-					disp(earth_density)
+ 					self.earth_density=earth_density;
+ 				case 'hydro'
+ 					WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double');
+Index: ../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.py	(revision 26350)
++++ ../trunk-jpl/src/m/classes/materials.py	(revision 26351)
+@@ -306,7 +306,6 @@
+                 for i in range(self.numlayers):
+                     earth_density = earth_density + (pow(self.radius[i + 1], 3) - pow(self.radius[i], 3)) * self.density[i]
+                 earth_density = earth_density / pow(self.radius[self.numlayers], 3)
+-                print(earth_density)
+                 self.earth_density = earth_density
+             elif nat == 'hydro':
+                 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26351-26352.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26351-26352.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26351-26352.diff	(revision 26740)
@@ -0,0 +1,532 @@
+Index: ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 26351)
++++ ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m	(revision 26352)
+@@ -39,7 +39,7 @@
+ end
+ pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
+ if isempty(pos),
+-	disp('SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet applied')
++	disp('Warning: SetMarineIceSheetBC.m: ice front all around the glacier, no dirichlet applied')
+ end
+ md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+ md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 26351)
++++ ../trunk-jpl/src/m/classes/offlinesolidearthsolution.m	(revision 26352)
+@@ -21,7 +21,7 @@
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 
+-				error('offlinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
++				error('offlinesolidearthsolution.m::checkconsistency: trying to run GRD patterns while supplying an offline solution for those patterns!'); 
+ 			end
+ 			self.checkconsistency@solidearthsolution(md,solution,analyses);
+ 
+Index: ../trunk-jpl/src/m/classes/offlinesolidearthsolution.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/offlinesolidearthsolution.py	(revision 26351)
++++ ../trunk-jpl/src/m/classes/offlinesolidearthsolution.py	(revision 26352)
+@@ -56,7 +56,7 @@
+ 
+         # Transform our time series into time series rates
+         if len(np.shape(self.displacementeast)) == 1:
+-            print('External solidearthsolution warning: only one time step provided, assuming the values are rates per year')
++            print('Warning: offlinesolidearthsolution.py::marshall: only one time step provided, assuming the values are rates per year')
+             displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
+             displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
+             displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
+Index: ../trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.m	(revision 26351)
++++ ../trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.m	(revision 26352)
+@@ -597,7 +597,5 @@
+ 		fprintf(fidi,[sbeg '%s' smid '%s' send],pname,params.(pname));
+ 	else
+ 		warning('param_write:param_unrecog','Parameter ''%s'' is of unrecognized type ''%s''.',pname,class(params.(pname)));
+-		return
+ 	end
+-
+ end% }}}
+Index: ../trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.py	(revision 26351)
++++ ../trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.py	(revision 26352)
+@@ -6,9 +6,9 @@
+ 
+ 
+ def dmeth_params_write(dm, fid, sbeg='\t  '):
+-    '''  write the parameters from a dakota_method object.
++    """write the parameters from a dakota_method object.
+     [] = dmeth_params_write(dm, fid, sbeg)
+-    '''
++    """
+ 
+     if not isinstance(dm, dakota_method):
+         raise RuntimeError('Object ' + str(dm) + ' is a ' + type(dm) + ' class object, not < dakota_method > .')
+@@ -508,12 +508,12 @@
+ 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 + '.')
++        print('Warning: dmeth_params_write.py::param_write: Parameter {} not found in {}.'.format(pname, params))
+         return
+     elif type(vars(params)[pname]) == bool and not vars(params)[pname]:
+         return
+     elif isempty(vars(params)[pname]):
+-        print('Warning: param_write:param_empty: Parameter {} requires input of type {}.'.format(pname, type(vars(params)[pname])))
++        print('Warning: dmeth_params_write.py::param_write: Parameter {} requires input of type {}.'.format(pname, type(vars(params)[pname])))
+         return
+ 
+     #  construct the parameter string based on type
+@@ -534,5 +534,5 @@
+         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
++        print('Warning: dmeth_params_write.py::param_write: Parameter {} is of unrecognized type {}.'.format(pname, type(vars(params)[pname])))
++    return
+Index: ../trunk-jpl/src/m/classes/slr.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/slr.py	(revision 26351)
++++ ../trunk-jpl/src/m/classes/slr.py	(revision 26352)
+@@ -10,12 +10,11 @@
+ 
+ 
+ class slr(object):
+-    '''
+-    SLR class definition
++    """SLR class definition
+ 
+-        Usage:
+-          slr = slr()
+-    '''
++    Usage:
++        slr = slr()
++    """
+     def __init__(self):  # {{{
+         self.deltathickness = np.nan
+         self.sealevel = np.nan
+@@ -153,7 +152,7 @@
+         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!')
++            print('Warning: slr.py::checkconsistency: there are elements with ice loads where some vertices are not on the ice!')
+ 
+         # Check that if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, a coupler to a planet model is provided
+         if self.geodetic:
+Index: ../trunk-jpl/src/m/materials/nye.m
+===================================================================
+--- ../trunk-jpl/src/m/materials/nye.m	(revision 26351)
++++ ../trunk-jpl/src/m/materials/nye.m	(revision 26352)
+@@ -12,13 +12,13 @@
+ 	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))');
++			warning('nye.m: CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\nLook at indexes: %s', mat2str(find(temperature>200 & temperature<220))');
+ 		end
+ 		if (any(temperature>=220))
+-			warning('CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\nLook at indexes: %s', mat2str(find(temperature>=220))');
++			warning('nye.m: CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\nLook at indexes: %s', mat2str(find(temperature>=220))');
+ 		end
+ 	elseif ((ice_type==2)&&(any(temperature>273.15)))
+-		warning('H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\nLook at indexes: %s', mat2str(find(temperature>273.15))');
++		warning('nye.m: H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\nLook at indexes: %s', mat2str(find(temperature>273.15))');
+ 	end
+ 
+ 	% Coefficients
+Index: ../trunk-jpl/src/m/materials/nye.py
+===================================================================
+--- ../trunk-jpl/src/m/materials/nye.py	(revision 26351)
++++ ../trunk-jpl/src/m/materials/nye.py	(revision 26352)
+@@ -1,17 +1,15 @@
+ import numpy as np
+-from warnings import warn
+ 
+ 
+ def nye(temperature, ice_type):
++    """NYE - figure out the rigidity of ice (either CO2 or H2O) for a given 
++    temperature rigidity (in s^(1/n)Pa) is the flow law parameter in the flow 
++    law sigma=B*e(1/n) (Nye, p2000). Temperature is in Kelvin degrees.
++
++    Usage:
++        rigidity=nye(temperature,ice_type) % ice_type = 1: CO2 ice // ice_type = 2: H2O ice
+     """
+-    NYE - figure out the rigidity of ice (either CO2 or H2O) for a given temperature
+-        rigidity (in s^(1/n)Pa) is the flow law parameter in the flow law sigma=B*e(1/n) (Nye, p2000).
+-        temperature is in Kelvin degrees
+ 
+-   Usage:
+-           rigidity=nye(temperature,ice_type) % ice_type = 1: CO2 ice // ice_type = 2: H2O ice
+-        """
+-
+     # Declaring temperature and rigidity arrays
+     if np.ndim(temperature) == 2:
+         T = temperature.flatten()
+@@ -25,12 +23,12 @@
+     if (ice_type == 1):
+         for i in range(len(T)):
+             if (200 < T[i] < 220):
+-                warn('CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.')
++                print('Warning: nye.py: CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.')
+             break
+         if ((T >= 220).any()):
+-            warn('CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.')
++            print('Warning: nye.py: CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.')
+     elif (ice_type == 2) and ((T > 273.15).any()):
+-        warn('H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.')
++        print('Warning: nye.py: H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.')
+ 
+     Rg = 8.3144598              # J mol^-1 K^-1
+ 
+Index: ../trunk-jpl/src/m/mech/steadystateiceshelftemp.py
+===================================================================
+--- ../trunk-jpl/src/m/mech/steadystateiceshelftemp.py	(revision 26351)
++++ ../trunk-jpl/src/m/mech/steadystateiceshelftemp.py	(revision 26352)
+@@ -48,7 +48,7 @@
+     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.')
++        print('Warning: steadystateiceshelf.py: overflow encountered in multipy/divide/exp, trying another formulation.')
+         temperature[pos] = -(((Tb[pos] - Ts[pos]) * ki / wi[pos] + Hi[pos] * Tb[pos]) / np.exp(Hi[pos] * wi[pos] / ki) - Hi[pos] * Ts[pos] + (Tb[pos] - Ts[pos]) * ki / wi[pos]) / (Hi[pos] * (1 - np.exp(-Hi[pos] * wi[pos] / ki)))
+ 
+     #temperature should not be less than surface temp
+Index: ../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 26351)
++++ ../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 26352)
+@@ -59,7 +59,7 @@
+ 
+ %check that each element has only one flag
+ if any(SIAflag+SSAflag+HOflag+L1L2flag+MLHOflag+FSflag>1),
+-	disp('setflowequation warning message: some elements have several types, higher order type is used for them')
++	disp('setflowequation.m: Warning: some elements have several types, higher order type is used for them')
+ 	SIAflag(find(SIAflag & SSAflag))=0;
+ 	SIAflag(find(SIAflag & HOflag))=0;
+ 	SSAflag(find(SSAflag & HOflag))=0;
+Index: ../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 26351)
++++ ../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 26352)
+@@ -5,24 +5,25 @@
+ 
+ 
+ def setflowequation(md, *args):
+-    """
+-    SETFLOWEQUATION - associate a solution type to each element
++    """SETFLOWEQUATION - associate a solution type to each element
+ 
+-       This routine works like plotmodel: it works with an even number of inputs
+-       'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible options
+-       that must be followed by the corresponding exp file or flags list
+-       It can either be a domain file (argus type, .exp extension), or an array of element flags.
+-       If user wants every element outside the domain to be
+-       setflowequationd, add '~' to the name of the domain file (ex: '~HO.exp')
+-       an empty string '' will be considered as an empty domain
+-       a string 'all' will be considered as the entire domain
+-       You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
++    This routine works like plotmodel: it works with an even number of inputs
++    'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible 
++    options that must be followed by the corresponding exp file or flags list. 
++    It can either be a domain file (argus type, .exp extension), or an array of 
++    element flags.
++    If user wants every element outside the domain to be setflowequationd, add 
++    '~' to the name of the domain file (ex: '~HO.exp') an empty string '' will 
++    be considered as an empty domain a string 'all' will be considered as the 
++    entire domain.
++    You can specify the type of coupling, 'penalties' or 'tiling', to use with 
++    the input 'coupling'.
+ 
+-       Usage:
+-          md = setflowequation(md, varargin)
++    Usage:
++        md = setflowequation(md, varargin)
+ 
+-       Example:
+-          md = setflowequation(md, 'HO', 'HO.exp', fill', 'SIA', 'coupling', 'tiling')
++    Example:
++        md = setflowequation(md, 'HO', 'HO.exp', fill', 'SIA', 'coupling', 'tiling')
+     """
+ 
+     #some checks on list of arguments
+@@ -60,7 +61,7 @@
+ 
+     #check that each element has only one flag
+     if any(SIAflag + SSAflag + L1L2flag + MLHOflag + HOflag + FSflag > 1):
+-        print("setflowequation warning message: some elements have several types, higher order type is used for them")
++        print('Warning: setflowequation.py: some elements have several types, higher order type is used for them')
+         SIAflag[np.where(np.logical_and(SIAflag, SSAflag))] = False
+         SIAflag[np.where(np.logical_and(SIAflag, HOflag))] = False
+         SSAflag[np.where(np.logical_and(SSAflag, HOflag))] = False
+Index: ../trunk-jpl/src/m/plot/processdata.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/processdata.m	(revision 26351)
++++ ../trunk-jpl/src/m/plot/processdata.m	(revision 26352)
+@@ -163,7 +163,7 @@
+ 		elseif length(flags)==numberofelements
+ 			data(pos,:)=maskvalue;
+ 		else
+-			disp('plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');
++			disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements');
+ 		end
+ 	end
+ 
+@@ -193,7 +193,7 @@
+ 		elseif length(flags)==numberofelements
+ 			data(md.mesh.elements(pos,:),:)=maskvalue;
+ 		else
+-			disp('plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');
++			disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements');
+ 		end
+ 	end
+ 
+@@ -235,7 +235,7 @@
+ 		elseif length(flags)==numberofelements
+ 			data(md.mesh.elements(pos,:),:)=NaN;
+ 		else
+-			disp('plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');
++			disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements');
+ 		end
+ 	end
+ end
+Index: ../trunk-jpl/src/m/plot/processdata.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/processdata.py	(revision 26351)
++++ ../trunk-jpl/src/m/plot/processdata.py	(revision 26352)
+@@ -88,7 +88,7 @@
+                 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')
++                print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
+     # }}}
+ 
+     # }}}
+@@ -109,7 +109,7 @@
+                 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')
++                print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
+     # }}}
+     # }}}
+     # {{{ spc time series
+Index: ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26351)
++++ ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26352)
+@@ -4,22 +4,22 @@
+ 
+ 
+ def SetMarineIceSheetBC(md, icefrontfile=''):
+-    """
+-    SETICEMARINESHEETBC - Create the boundary conditions for stressbalance and thermal models for a  Marine Ice Sheet with Ice Front
++    """SETICEMARINESHEETBC - Create the boundary conditions for stressbalance 
++    and thermal models for a  Marine Ice Sheet with Ice Front
+ 
+-       Neumann BC are used on the ice front (an ARGUS contour around the ice front
+-       can be given in input, or it will be deduced as onfloatingice & onboundary)
+-       Dirichlet BC are used elsewhere for stressbalance
++    Neumann BC are used on the ice front (an ARGUS contour around the ice front
++    can be given in input, or it will be deduced as onfloatingice & onboundary)
++    Dirichlet BC are used elsewhere for stressbalance
+ 
+-       Usage:
+-          md = SetMarineIceSheetBC(md, icefrontfile)
+-          md = SetMarineIceSheetBC(md)
++    Usage:
++        md = SetMarineIceSheetBC(md, icefrontfile)
++        md = SetMarineIceSheetBC(md)
+ 
+-       Example:
+-          md = SetMarineIceSheetBC(md, 'Front.exp')
+-          md = SetMarineIceSheetBC(md)
++    Example:
++        md = SetMarineIceSheetBC(md, 'Front.exp')
++        md = SetMarineIceSheetBC(md)
+ 
+-       See also: SETICESHELFBC, SETMARINEICESHEETBC
++    See also: SETICESHELFBC, SETMARINEICESHEETBC
+     """
+     #node on Dirichlet (boundary and ~icefront)
+     if icefrontfile:
+@@ -38,7 +38,7 @@
+     #pos = find(md.mesh.vertexonboundary & ~vertexonicefront)
+     pos = np.nonzero(np.logical_and(md.mesh.vertexonboundary, np.logical_not(vertexonicefront)))[0]
+     if not np.size(pos):
+-        print("SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.")
++        print("Warning: SetMarineIceSheetBC.py: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.")
+ 
+     md.stressbalance.spcvx = float('nan') * np.ones(md.mesh.numberofvertices)
+     md.stressbalance.spcvy = float('nan') * np.ones(md.mesh.numberofvertices)
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26351)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26352)
+@@ -49,18 +49,18 @@
+ 			%is the coupler turned on? 
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.transient.iscoupler==0,
+-					warning(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
++					warning(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
+ 				end
+ 			end
+ 				
+ 			if slm.earth.transient.iscoupler==0,
+-				warning('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!');
++				warning('sealevelmodel.m::checkconsistency: earth model should have the transient coupler option turned on!');
+ 			end
+ 
+ 			%check that the transition vectors have the right size: 
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}),
+-					error(['sealevelmodel checkconsistency issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
++					error(['sealevelmodel.m::checkconsistency: issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
+ 				end
+ 			end
+ 			
+@@ -67,7 +67,7 @@
+ 			%check that runfrequency is the same everywhere: 
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency,
+-					error(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
++					error(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
+ 				end
+ 			end
+ 
+@@ -75,7 +75,7 @@
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+ 				if ~isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate(slm.earth.dsl.transitions{i}))),
+-					error(sprintf('steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
++					error(sprintf('sealevelmodel.m::checkconsistency: steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+ 				end
+ 			end
+ 
+@@ -83,7 +83,7 @@
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+ 				if md.solidearthsettings.isgrd~=slm.earth.solidearthsettings.isgrd
+-					error(sprintf('isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
++					error(sprintf('sealevelmodel.m::checkconsistency: isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+ 				end
+ 			end
+ 
+@@ -91,7 +91,7 @@
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+ 				if ~isempty(md.solidearth.external),
+-					error('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
++					error('sealevelmodel.m::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
+ 				end
+ 
+ 			end
+@@ -99,7 +99,7 @@
+ 			for i=1:length(slm.icecaps),
+ 				md= slm.icecaps{i}; 
+ 				if md.solidearth.settings.grdmodel~=0
+-					error(sprintf('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
++					error(sprintf('sealevelmodel.m::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
+ 				end
+ 			end
+ 
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26351)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26352)
+@@ -1,5 +1,4 @@
+ from copy import deepcopy
+-import warnings
+ 
+ import numpy as np
+ 
+@@ -90,42 +89,42 @@
+         # Is the coupler turned on?
+         for i in range(len(slm.icecaps)):
+             if not slm.icecaps[i].transient.iscoupler:
+-                warnings.warn('sealevelmodel checkconsistency error: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name))
++                print('Warning: sealevelmodel.py::checkconsistency: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name))
+ 
+         if not slm.earth.transient.iscoupler:
+-            warnings.warn('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!')
++            print('Warning: sealevelmodel.py::checkconsistency: earth model should have the transient coupler option turned on!')
+ 
+         # Check that the transition vectors have the right size
+         for i in range(len(slm.icecaps)):
+             if slm.icecaps[i].mesh.numberofvertices != len(slm.earth.slr.transitions[i]):
+-                raise Exception('sealevelmodel checkconsistency issue with size of transition vector for ice cap: {} name: {}'.format(i, slm.icecaps[i].miscellaneous.name))
++                raise Exception('sealevelmodel.py::checkconsistency: issue with size of transition vector for ice cap: {} name: {}'.format(i, slm.icecaps[i].miscellaneous.name))
+ 
+         # Check that run frequency is the same everywhere
+         for i in range(len(slm.icecaps)):
+             if slm.icecaps[i].slr.geodetic_run_frequency != slm.earth.geodetic_run_frequency:
+-                raise Exception('sealevelmodel checkconsistency error: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name))
++                raise Exception('sealevelmodel.py::checkconsistency: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name))
+ 
+         # Make sure steric_rate is the same everywhere
+         for i in range(len(slm.icecaps)):
+             md = slm.icecaps[i]
+             if np.nonzero(md.slr.steric_rate - slm.earth.slr.steric_rate[slm.earth.slr.transitions[i]]) != []:
+-                raise Exception('steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))
++                raise Exception('sealevelmodel.py::checkconsistency: steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))
+ 
+         # Make sure grd is the same everywhere
+         for i in range(len(slm.icecaps)):
+             md = slm.icecaps[i]
+             if md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd:
+-                raise RuntimeError('isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name))
++                raise RuntimeError('sealevelmodel.py::checkconsistency: isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name))
+         # Make sure that there is no solid earth external forcing on the basins
+         for i in range(len(slm.icecaps)):
+             md = slm.icecaps[i]
+             if md.solidearth.external:
+-                raise RuntimeError('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model')
++                raise RuntimeError('sealevelmodel.py::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model')
+         # Make sure that we have the right grd model for computing our sealevel patterns
+         for i in range(len(slm.icecaps)):
+             md = slm.icecaps[i]
+             if md.solidearth.settings.grdmodel != 0:
+-                raise RuntimeError('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i))
++                raise RuntimeError('sealevelmodel.py::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i))
+     #}}}
+ 
+     def mergeresults(self):  # {{{
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26351)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26352)
+@@ -53,7 +53,7 @@
+ 
+         # Transform our time series into time series rates
+         if len(np.shape(self.displacementeast)) == 1:
+-            print('External solidearthsolution warning: only one time step provided, assuming the values are rates per year')
++            print('solidearthsolution.py::marshall: Warning: only one time step provided, assuming the values are rates per year')
+             displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
+             displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
+             displacementup_rate = np.append(np.array(self.displacementup).reshape(-1, 1), 0)
+Index: ../trunk-jpl/src/m/dev/devpath.py
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.py	(revision 26351)
++++ ../trunk-jpl/src/m/dev/devpath.py	(revision 26352)
+@@ -1,7 +1,6 @@
+ #!/usr/bin/env python
+ import os
+ import sys
+-import warnings
+ 
+ #Recover ISSM_DIR and USERNAME
+ ISSM_DIR = os.getenv('ISSM_DIR')
+@@ -35,7 +34,7 @@
+         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))
++        print('Warning: devpath.py: cluster settings should be in {}'.format(jpl_path))
+ 
+ from runme import runme  #first because plotmodel may fail
+ from plotmodel import plotmodel
Index: /issm/oecreview/Archive/25834-26739/ISSM-26352-26353.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26352-26353.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26352-26353.diff	(revision 26740)
@@ -0,0 +1,494 @@
+Index: ../trunk-jpl/src/m/classes/clusters/pfe.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26352)
++++ ../trunk-jpl/src/m/classes/clusters/pfe.py	(revision 26353)
+@@ -11,7 +11,8 @@
+ try:
+     from pfe_settings import pfe_settings
+ except ImportError:
+-    print('You need pfe_settings.py to proceed, check presence and sys.path')
++    # print('You need pfe_settings.py to proceed, check presence and sys.path')
++    pass
+ from QueueRequirements import QueueRequirements
+ 
+ class pfe(object):
+@@ -24,7 +25,7 @@
+     """
+ 
+     def __init__(self, *args):  # {{{
+-        self.name = 'pfe'
++        self.name = ''
+         self.login = ''
+         self.modules = ['comp-intel/2016.2.181', 'mpi-sgi/mpt']
+         self.numnodes = 20
+@@ -49,7 +50,8 @@
+         try:
+             self = pfe_settings(self)
+         except NameError:
+-            print('pfe_settings.py not found, using default settings')
++            #print('pfe_settings.py not found, using default settings')
++            pass
+ 
+         # OK get other fields
+         self = options.AssignObjectFields(self)
+Index: ../trunk-jpl/src/m/coordsystems/gdaltransform.m
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/gdaltransform.m	(revision 26352)
++++ ../trunk-jpl/src/m/coordsystems/gdaltransform.m	(revision 26353)
+@@ -19,7 +19,7 @@
+ %		Bamber's Greeland projection
+ %			+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs
+ %
+-%	To get proj.4 string from EPSG, use gdalsrsinfo. Example:
++%	To get PROJ.4 string from EPSG, use gdalsrsinfo. Example:
+ %		gdalsrsinfo epsg:4326 | grep "PROJ.4" | sed "s/PROJ.4 : //"
+ 
+ 	%give ourselves unique file names
+Index: ../trunk-jpl/src/m/dev/devpath.py
+===================================================================
+--- ../trunk-jpl/src/m/dev/devpath.py	(revision 26352)
++++ ../trunk-jpl/src/m/dev/devpath.py	(revision 26353)
+@@ -14,8 +14,8 @@
+     if '.svn' in dirs:
+         dirs.remove('.svn')
+     for file in files:
+-        if file.find(".py") != -1:
+-            if file.find(".pyc") == -1:
++        if file.find('.py') != -1:
++            if file.find('.pyc') == -1:
+                 if root not in sys.path:
+                     sys.path.append(root)
+ 
+@@ -45,5 +45,5 @@
+ #c.InteractiveShellApp.exec_lines.append('%autoreload 2')
+ #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
+ 
+-print("\n  ISSM development path correctly loaded")
+-print("Current path is {}\n\n".format(ISSM_DIR))
++# print("\n  ISSM development path correctly loaded")
++# print("Current path is {}\n\n".format(ISSM_DIR))
+Index: ../trunk-jpl/src/m/plot/googlemaps.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/googlemaps.m	(revision 26352)
++++ ../trunk-jpl/src/m/plot/googlemaps.m	(revision 26353)
+@@ -174,10 +174,10 @@
+ 	' -a_srs "' EPSGgoogle '" "temp.png" "temp.tiff"']);
+ delete('temp.png');
+ 
+-%If not gdal, exit
++%If not GDAL, exit
+ if status~=0,
+ 	disp(result);
+-	disp('googlemaps info: gdal not found or not working properly, the Google image will not be transformed');
++	disp('googlemaps info: GDAL not found or not working properly, the Google image will not be transformed');
+ 	[gX gY]=meshgrid(ulx:ulx+size(final,2)-1,uly:-1:uly-size(final,1)+1);
+ 	[LAT LON]=pixelstolatlon(gX,gY, zoom);
+ 	if md.mesh.epsg==3413,
+@@ -203,7 +203,7 @@
+ %If previous command failed, exit
+ if ~isempty(strfind(result,'ERROR')),
+ 	disp(result);
+-	disp(' ');disp('googlemaps info: gdal not working properly (missing proj.4 library?), Google image will not be transformed');
++	disp(' ');disp('googlemaps info: GDAL not working properly (missing PROJ.4 library?), Google image will not be transformed');
+ 	disp(result);
+ 	[gX gY]=meshgrid(ulx:ulx+size(final,2)-1,uly:-1:uly-size(final,1)+1);
+ 	[LAT LON]=pixelstolatlon(gX,gY, zoom);
+Index: ../trunk-jpl/src/m/plot/plot_manager.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_manager.py	(revision 26352)
++++ ../trunk-jpl/src/m/plot/plot_manager.py	(revision 26353)
+@@ -2,7 +2,7 @@
+     from osgeo import gdal
+     overlaysupport = True
+ except ImportError:
+-    print('osgeo/gdal for python not installed, overlay plots are not enabled')
++    print('OSGeo/GDAL for Python not installed, overlay plots are not enabled')
+     overlaysupport = False
+ 
+ from applyoptions import applyoptions
+@@ -19,8 +19,7 @@
+ 
+ 
+ def plot_manager(md, options, fig, axgrid, gridindex):
+-    '''
+-    PLOT_MANAGER - distribute the plots called by plotmodel
++    """PLOT_MANAGER - distribute the plots called by plotmodel
+ 
+     'fig' is a handle to the figure instance created by plotmodel.
+ 
+@@ -34,7 +33,7 @@
+         plot_manager(md, options, fig, ax)
+ 
+     See also: PLOTMODEL, PLOT_UNIT
+-    '''
++    """
+     #parse options and get a structure of options
+     options = checkplotoptions(md, options)
+ 
+@@ -45,6 +44,7 @@
+     #
+     # TODO: Check why we are doing this and if it is absolutely necessary (see
+     #       also src/m/plot/plot_mesh.py, src/m/plot/applyoptions.py)
++    #
+     options.addfielddefault('ticklabels', 'on')
+ 
+     ax = axgrid[gridindex]
+Index: ../trunk-jpl/src/m/plot/plot_overlay.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_overlay.py	(revision 26352)
++++ ../trunk-jpl/src/m/plot/plot_overlay.py	(revision 26353)
+@@ -10,7 +10,7 @@
+ try:
+     from osgeo import gdal
+ except ImportError:
+-    print('osgeo/gdal for python not installed, plot_overlay is disabled')
++    print('OSGeo/GDAL for python not installed, plot_overlay is disabled')
+ 
+ from processdata import processdata
+ from processmesh import processmesh
+@@ -18,8 +18,7 @@
+ 
+ 
+ def plot_overlay(md, data, options, ax):
+-    '''
+-    Function for plotting a georeferenced image. Called from plot_manager by 
++    """Function for plotting a georeferenced image. Called from plot_manager by 
+     call to plotmodel.
+ 
+     Usage:
+@@ -26,7 +25,7 @@
+         plot_overlay(md, data, options, ax)
+ 
+     See also: PLOTMODEL
+-    '''
++    """
+ 
+     x, y, z, elements, is2d, isplanet = processmesh(md, [], options)
+     try:
+Index: ../trunk-jpl/src/m/plot/radarpower.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/radarpower.m	(revision 26352)
++++ ../trunk-jpl/src/m/plot/radarpower.m	(revision 26353)
+@@ -28,7 +28,7 @@
+ c = getfieldvalue(options,'overlay_adjust_c',0);
+ d = getfieldvalue(options,'overlay_adjust_d',1);
+ 
+-%find gdal coordinates
++%find GDAL coordinates
+ x0=min(xlim); x1=max(xlim);
+ y0=min(ylim); y1=max(ylim);
+ 
+Index: ../trunk-jpl/src/m/solve/waitonlock.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.m	(revision 26352)
++++ ../trunk-jpl/src/m/solve/waitonlock.m	(revision 26353)
+@@ -4,6 +4,7 @@
+ %   This routine will return when a file named 'lockfilename' is written to 
+ %   disk. Also check for outlog file be cause it might be written several 
+ %   seconds after the lock file.
++%
+ %   If the time limit given in input is exceeded, return 0
+ %
+ %   Usage:
+Index: ../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.py	(revision 26352)
++++ ../trunk-jpl/test/NightlyRun/runme.py	(revision 26353)
+@@ -9,14 +9,15 @@
+ import numpy as np
+ 
+ try:
+-    from parallelrange import parallelrange
+-except ImportError:  #we don't have issm code in path, just get it
++    from arch import archread
++except: # ISSM_DIR is not on path
+     import devpath
+-    from parallelrange import parallelrange
++
+ from arch import archread
+ from arch import archwrite
+ from GetIds import *
+ from IdToName import IdToName
++from parallelrange import parallelrange
+ 
+ 
+ def runme(id=None, exclude=None, benchmark='nightly', procedure='check', output='none', rank=1, numprocs=1):
+@@ -32,24 +33,25 @@
+         ./runme.py -i [101, 102]
+ 
+     Options:
+-        -i/--id             followed by the list of ids or (parts of) test names requested
+-                            NOTE: runs all tests by default
+-        -e/--exclude        ids or (parts of) test names to be excluded (same format as id)
+-                            NOTE: exclude does nothing if 'id' is specified with different values
+-        -b/--benchmark      'all'           : (all of the tests)
+-                            'nightly'       : (nightly run/daily run)
+-                            'validation'    : (validation)
+-                            'adolc'         : validation of adolc tests
+-                            'eismint'       : validation of eismint tests
+-                            'ismip'         : validation of ismip-hom tests
+-                            'mesh'          : validation of mesh tests
+-                            'qmu'           : validation of qmu tests
+-                            'referential'   : validation of referential tests
+-                            'slc'           : validation of slc tests
+-                            'thermal'       : validation of thermal tests
+-                            'tranforcing'   : validation of transient forcing tests
+-        -p/--procedure      'check'         : run the test (default)
+-                            'update'        : update the archive
++        -i/--id         Followed by the list of ids or (parts of) test names 
++                        requested
++        -e/--exclude    Ids or (parts of) test names to be excluded (same 
++                        format as id). Does nothing if 'id' is specified with 
++                        different values.
++        -b/--benchmark  'all'           : (all of the tests)
++                        'nightly'       : (nightly run/daily run)
++                        'validation'    : (validation)
++                        'adolc'         : validation of adolc tests
++                        'eismint'       : validation of eismint tests
++                        'ismip'         : validation of ismip-hom tests
++                        'mesh'          : validation of mesh tests
++                        'qmu'           : validation of qmu tests
++                        'referential'   : validation of referential tests
++                        'slc'           : validation of slc tests
++                        'thermal'       : validation of thermal tests
++                        'tranforcing'   : validation of transient forcing tests
++        -p/--procedure  'check'         : run the test (default)
++                        'update'        : update the archive
+ 
+     Usage:
+         ./runme.py [option [args]]
+@@ -102,7 +104,7 @@
+     # }}}
+     #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(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] #Keep test id only (skip 'test' and '.py')
++    list_ids = [int(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] # Keep test id only (skip 'test' and '.py')
+ 
+     i1, i2 = parallelrange(rank, numprocs, len(list_ids))  #Get tests for this cpu only
+     list_ids = list_ids[i1:i2 + 1]
+Index: ../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26352)
++++ ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26353)
+@@ -5,7 +5,8 @@
+ try:
+     from generic_settings import generic_settings
+ except ImportError:
+-    print('Warning generic_settings.py not found, default will be used')
++    #print('Warning: generic.py: generic_settings.py not found, default will be used')
++    pass
+ from MatlabFuncs import *
+ from IssmConfig import IssmConfig
+ from issmdir import issmdir
+@@ -47,7 +48,8 @@
+         try:
+             self = generic_settings(self)
+         except NameError:
+-            print('generic_settings.py not found, using default settings')
++            # print('generic_settings.py not found, using default settings')
++            pass
+ 
+         # OK get other fields
+         self = options.AssignObjectFields(self)
+Index: ../trunk-jpl/src/m/classes/issmsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/issmsettings.py	(revision 26352)
++++ ../trunk-jpl/src/m/classes/issmsettings.py	(revision 26353)
+@@ -20,23 +20,21 @@
+         self.waitonlock = 0
+         self.solver_residue_threshold = 0
+ 
+-    #set defaults
++        # Set defaults
+         self.setdefaultparameters()
+-
+     #}}}
+ 
+     def __repr__(self):  # {{{
+-        string = "   general issmsettings parameters:"
+-
+-        string = "%s\n%s" % (string, fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes."))
+-        string = "%s\n%s" % (string, fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "output_frequency", "frequency at which results are saved in all solutions with multiple time_steps"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "checkpoint_frequency", "frequency at which the runs are being recorded, allowing for a restart"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)"))
+-        return string
++        s = "   general issmsettings parameters:\n"
++        s += '{}\n'.format(fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes."))
++        s += '{}\n'.format(fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)"))
++        s += '{}\n'.format(fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)"))
++        s += '{}\n'.format(fielddisplay(self, "output_frequency", "frequency at which results are saved in all solutions with multiple time_steps"))
++        s += '{}\n'.format(fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)"))
++        s += '{}\n'.format(fielddisplay(self, "checkpoint_frequency", "frequency at which the runs are being recorded, allowing for a restart"))
++        s += '{}\n'.format(fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0"))
++        s += '{}\n'.format(fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)"))
++        return s
+     #}}}
+ 
+     def setdefaultparameters(self):  # {{{
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26352)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26353)
+@@ -36,9 +36,6 @@
+ from issmsettings import issmsettings
+ from toolkits import toolkits
+ from generic import generic
+-from pfe import pfe
+-from cyclone import cyclone
+-from saga import saga
+ from balancethickness import balancethickness
+ from stressbalance import stressbalance
+ from groundingline import groundingline
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26352)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26353)
+@@ -117,7 +117,7 @@
+ 
+         # A GRD computation has been requested, make some checks on the nature of the meshes provided
+         if self.isgrd:
+-            if md.mesh.__class__.__name__ is 'mesh3dsurface':
++            if md.mesh.__class__.__name__ == 'mesh3dsurface':
+                 if self.grdmodel == 2:
+                     raise RuntimeException('model requires a 2D mesh to run gia Ivins computations (change mesh from mesh3dsurface to mesh2d)')
+             else:
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26352)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26353)
+@@ -103,6 +103,16 @@
+     return y
+ #}}}
+ 
++def isa(A, dataType):  #{{{
++    """FUNCTION ISA
++
++    NOTE:
++    - Takes a type as its second argument (in contrast to the MATLAB function 
++    that it replicates, which takes a string representing the name of a type)
++    """
++    return type(A) == dataType
++#}}}
++
+ def isfile(fileName):  #{{{
+     import os
+ 
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 26352)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 26353)
+@@ -172,7 +172,7 @@
+ 		md=loadresultsfromcluster(md);
+ 	end
+ elseif md.settings.waitonlock>0,
+-	%we wait for the done file
++	%wait for done file
+ 	done=waitonlock(md);
+ 	if md.verbose.solution,
+ 		disp('loading results from cluster');
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 26352)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 26353)
+@@ -140,7 +140,7 @@
+     filelist = [modelname + '.bin ', modelname + '.toolkits ', modelname + '.queue ']
+     if md.qmu.isdakota:
+         filelist.append(modelname + '.qmu.in')
+-        
++
+     if not restart:
+         cluster.UploadQueueJob(md.miscellaneous.name, md.private.runtimename, filelist)
+ 
+@@ -149,12 +149,12 @@
+ 
+     # Wait on lock
+     if md.settings.waitonlock > 0:
+-        islock = waitonlock(md)
+-        if islock == 0: # no results to be loaded
+-            print('The results must be loaded manually with md = loadresultsfromcluster(md).')
+-        else: # load results
+-            if md.verbose.solution:
+-                print('loading results from cluster')
+-            md = loadresultsfromcluster(md)
++        # Wait for done file
++        done = waitonlock(md)
++        if md.verbose.solution:
++            print('loading results from cluster')
++        md = loadresultsfromcluster(md)
++    elif md.settings.waitonlock == 0:
++        print('Model results must be loaded manually with md = loadresultsfromcluster(md).')
+ 
+     return md
+Index: ../trunk-jpl/src/m/solve/waitonlock.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26352)
++++ ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26353)
+@@ -1,7 +1,11 @@
+ import subprocess
+ import sys
+ import time
++from generic import *
++from generic_static import *
++# from localpfe import *
+ from MatlabFuncs import *
++from pfe import *
+ 
+ def waitonlock(md):
+     """WAITONLOCK - wait for a file
+@@ -14,6 +18,10 @@
+ 
+     Usage:
+         flag = waitonlock(md)
++
++    TODO:
++    - Uncomment import of localpfe and check on cluster type once localpfe.py 
++    has been translated from localpfe.m.
+     """
+ 
+     # Get lockfilename (lock file) and options
+@@ -21,22 +29,18 @@
+     timelimit = md.settings.waitonlock
+     cluster = md.cluster
+ 
+-    """
+-    NOTE: We check cluster.name against string as cluster classes are not 
+-          defined globally and we do not have to import them all
+-    """
+-    if cluster.name == 'pfe' and cluster.interactive > 1:
++    if isa(cluster, pfe) and cluster.interactive > 1:
+         lockfilename = '{}/Interactive{}/{}.lock'.format(executionpath, cluster.interactive, md.miscellaneous.name)
+         logfilename = '{}/Interactive{}/{}.outlog'.format(executionpath, cluster.interactive, md.miscellaneous.name)
+-    elif cluster.name == 'localpfe':
+-        lockfilename = '{}/{}.lock'.format(executionpath, md.miscellaneous.name)
+-        logfilename = '{}/{}.outlog'.format(executionpath, md.miscellaneous.name)
++    # elif isa(cluster, localpfe):
++    #     lockfilename = '{}/{}.lock'.format(executionpath, md.miscellaneous.name)
++    #     logfilename = '{}/{}.outlog'.format(executionpath, md.miscellaneous.name)
+     else:
+         lockfilename = '{}/{}/{}.lock'.format(executionpath, md.private.runtimename, md.miscellaneous.name)
+         logfilename = '{}/{}/{}.outlog'.format(executionpath, md.private.runtimename, md.miscellaneous.name)
+ 
+     # If we are using the generic cluster in interactive mode, job is already complete
+-    if (cluster.name == 'generic' and cluster.interactive) or (cluster.name == 'generic_static'):
++    if (isa(cluster, generic) and cluster.interactive) or (isa(cluster, generic_static)):
+         # We are in interactive mode, no need to check for job completion
+         return 1
+ 
+@@ -72,11 +76,12 @@
+             elapsedtime = elapsedtime / 60 # Converts time from sec to min
+             subproc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+             outs, errs = subproc.communicate() # NOTE: Need to consume output before checking return code
++
+             # TODO: Debug the following check under Linux (exits after first iteration with errs = "b")
+             # UPDATE: Works in testing under Debian Linux system. Leaving comment for now so that it is easier to backtrace this issue if someone else encounters it.
+             #
+             if errs != '':
+-                raise Exception("waitonlock: check for existence of files failed: {}".format(errs))
++                raise Exception('waitonlock: check for existence of files failed: {}'.format(errs))
+             ispresent = not subproc.returncode
+             if ispresent:
+                 print('')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26353-26354.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26353-26354.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26353-26354.diff	(revision 26740)
@@ -0,0 +1,65 @@
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26353)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26354)
+@@ -38,12 +38,15 @@
+ 	%create .geo file:  {{{
+ 	fid=fopen('sphere.geo','w');
+ 
+-	fprintf(fid,'Mesh.Algorithm = 1;\n');
++	fprintf(fid,'Mesh.Algorithm = 1;\n'); % MeshAdapt
++	fprintf(fid,'Mesh.RandomFactor = 1e-10;\n');
+ 	if  exist(options,'refine'),
+-		fprintf(fid,'Mesh.Algorithm = 7;\n');
+-		fprintf(fid,'Mesh.CharacteristicLengthFromPoints= 0;\n');
+-		fprintf(fid,'Mesh.SmoothRatio= 3;\n');
+-		fprintf(fid,'Mesh.RemeshAlgorithm= 1;\n');
++		fprintf(fid,'Mesh.Algorithm = 7;\n'); % BAMG
++		fprintf(fid,'Mesh.CharacteristicLengthFromPoints = 0;\n');
++		fprintf(fid,'Mesh.SmoothRatio = 3;\n');
++		if gmshmajorversion == 3,
++			fprintf(fid,'Mesh.RemeshAlgorithm = 1;\n');
++		end
+ 	end
+ 	fprintf(fid,'resolution=%g;\n',resolution);
+ 	fprintf(fid,'radius=%g;\n',radius);
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26353)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26354)
+@@ -24,14 +24,14 @@
+     """
+ 
+     # Get Gmsh version
+-    subproc_args = "gmsh -info 2>&1 | command grep 'Version' | sed -e 's/Version[[:blank:]]*:[[:blank:]]//' | cut -d '.' -f1"
++    subproc_args = 'gmsh -info 2>&1 | command grep \'Version\' | sed -e \'s/Version[[:blank:]]*:[[:blank:]]//\' | cut -d \'.\' -f1'
+     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     outs, errs = subproc.communicate()
+     if errs != '':
+-        raise Exception("gmshplanet: call to gmsh failed: {}".format(errs))
++        raise Exception('gmshplanet: call to gmsh failed: {}'.format(errs))
+     gmshmajorversion = int(outs)
+     if gmshmajorversion not in [3, 4]:
+-        raise RuntimeError("gmshplanet: Gmsh major version {} not supported!".format(gmshmajorversion))
++        raise RuntimeError('gmshplanet: Gmsh major version {} not supported!'.format(gmshmajorversion))
+ 
+     # Process options
+     options = pairoptions(*args)
+@@ -46,12 +46,14 @@
+     # Create .geo file:  {{{
+     fid = open('sphere.geo', 'w')
+ 
+-    fid.write('Mesh.Algorithm = 1;\n')
++    fid.write('Mesh.Algorithm = 1;\n') # MeshAdapt
++    fid.write('Mesh.RandomFactor = 1e-10;\n')
+     if options.exist('refine'):
+-        fid.write('Mesh.Algorithm = 7;\n')
++        fid.write('Mesh.Algorithm = 7;\n') # BAMG
+         fid.write('Mesh.CharacteristicLengthFromPoints = 0;\n')
+         fid.write('Mesh.SmoothRatio = 3;\n')
+-        fid.write('Mesh.RemeshAlgorithm = 1;\n')
++        if gmshmajorversion == 3:
++            fid.write('Mesh.RemeshAlgorithm = 1;\n')
+     fid.write('resolution = %g;\n' % resolution)
+     fid.write('radius = %g;\n' % radius)
+     fid.write('Point(1) = {0.0, 0.0, 0.0, resolution};\n')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26354-26355.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26354-26355.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26354-26355.diff	(revision 26740)
@@ -0,0 +1,207 @@
+Index: ../trunk-jpl/src/m/classes/clusters/frontera.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/frontera.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/frontera.m	(revision 26355)
+@@ -0,0 +1,202 @@
++%FRONTERA cluster class definition
++%
++%   Usage:
++%      cluster=frontera();
++%      cluster=frontera('np',3);
++%      cluster=frontera('np',3,'login','username');
++
++classdef frontera
++	properties (SetAccess=public)
++		% {{{
++		name          = 'ls5.tacc.utexas.edu'
++		login         = '';
++		modules        = {'intel/18.0.2' 'gsl'};
++		numnodes      = 1;
++		cpuspernode   = 24;
++		port          = 1099;
++		queue         = 'normal';
++		codepath      = '';
++		executionpath = '';
++		interactive   = 0;
++		time          = 48*60*60;
++		email         = '';
++	end
++	%}}}
++	methods
++		function cluster=frontera(varargin) % {{{
++
++			%initialize cluster using default settings if provided
++			if (exist('frontera_settings')==2), frontera_settings; end
++
++			%use provided options to change fields
++			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
++
++		end
++		%}}}
++		function disp(cluster) % {{{
++			%  display the object
++			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
++			disp(sprintf('    name: %s',cluster.name));
++			disp(sprintf('    login: %s',cluster.login));
++			disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    numnodes: %i',cluster.numnodes));
++			disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
++			disp(sprintf('    np: %i',cluster.nprocs()));
++			disp(sprintf('    port: %i',cluster.port));
++			disp(sprintf('    queue: %s',cluster.queue));
++			disp(sprintf('    codepath: %s',cluster.codepath));
++			disp(sprintf('    executionpath: %s',cluster.executionpath));
++			disp(sprintf('    interactive: %i',cluster.interactive));
++			disp(sprintf('    time: %i',cluster.time));
++			disp(sprintf('    email: %s',cluster.email));
++		end
++		%}}}
++		function numprocs=nprocs(cluster) % {{{
++			%compute number of processors
++			numprocs=cluster.numnodes*cluster.cpuspernode;
++		end
++		%}}}
++		function md = checkconsistency(cluster,md,solution,analyses) % {{{
++
++			%https://frontera-portal.tacc.utexas.edu/user-guide/running/
++			available_queues={'small','normal','development'};
++			queue_requirements_time=[48*60*60 48*60*60 2*60*60];
++			queue_requirements_np=[2*56 512*56 40*56];
++
++			QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),cluster.time)
++
++			%Miscellaneous
++			if isempty(cluster.login), md = checkmessage(md,'login empty'); end
++			if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
++			if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
++		end
++		%}}}
++		function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
++
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#$ -N %s\n',modelname);
++			fprintf(fid,'#$ -q %s \n',cluster.queue);
++			fprintf(fid,'#$ -pe one-node-mpi 2-64\n');
++			fprintf(fid,'#$ -R y\n');
++			fprintf(fid,'#$ -m beas\n');
++			fprintf(fid,'#$ -o %s.outlog \n',modelname);
++			fprintf(fid,'#$ -e %s.errlog \n\n',modelname);
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
++			fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++			fclose(fid);
++		end
++		%}}}
++		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
++
++			if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
++			if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
++
++			executable='issm.exe';
++			if isdakota,
++				version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
++				if (version>=6),
++					executable='issm_dakota.exe';
++				end
++			end
++			if isoceancoupling,
++				executable='issm_ocean.exe';
++			end
++
++			%write queuing script 
++			fid=fopen([modelname '.queue'],'w');
++
++			fprintf(fid,'#!/bin/bash\n');
++			fprintf(fid,'#SBATCH -J %s \n',modelname);
++			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
++			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
++			fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
++			fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.nprocs()/cluster.numnodes,24));
++			fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
++			fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
++			for i=1:numel(cluster.modules),
++				fprintf(fid,['module load ' cluster.modules{i} '\n']);
++			end
++
++			if isdakota,
++				fprintf(fid,'export KMP_AFFINITY="granularity=fine,compact,verbose" \n\n');
++			end
++
++			if length(find(cluster.email=='@'))>0
++				fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
++				fprintf(fid,'#SBATCH --mail-type=end \n\n');
++
++				%fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
++			end
++
++			fprintf(fid,'export PATH="$PATH:."\n\n');
++			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
++			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
++			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
++			fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
++			if ~io_gather, %concatenate the output files:
++				fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++			end
++
++			fclose(fid);
++
++			%in interactive mode, create a run file, and errlog and outlog file
++			if cluster.interactive,
++				fid=fopen([modelname '.run'],'w');
++				fprintf(fid,'ibrun -np %i %s/%s %s %s %s\n',cluster.nprocs(),executable,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
++				if ~io_gather, %concatenate the output files:
++					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
++				end
++				fclose(fid);
++				fid=fopen([modelname '.errlog'],'w');
++				fclose(fid);
++				fid=fopen([modelname '.outlog'],'w');
++				fclose(fid);
++			end
++		end %}}}
++		function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
++
++			%compress the files into one zip.
++			compressstring=['tar -zcf ' dirname '.tar.gz '];
++			for i=1:numel(filelist),
++				compressstring = [compressstring ' ' filelist{i}];
++			end
++			if cluster.interactive,
++				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
++			end
++			system(compressstring);
++
++			disp('uploading input file and queueing script');
++			issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
++
++		end %}}}
++		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
++
++			disp('launching solution sequence on remote cluster');
++			if ~isempty(restart)
++				launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
++			else
++				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
++					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
++			end
++			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
++		end %}}}
++		function Download(cluster,dirname,filelist) % {{{
++
++			%copy files from cluster to current directory
++			directory=[cluster.executionpath '/' dirname '/'];
++			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
++
++		end %}}}
++	end
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26355-26356.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26355-26356.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26355-26356.diff	(revision 26740)
@@ -0,0 +1,618 @@
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim	(revision 26356)
+@@ -0,0 +1,543 @@
++" Vim syntax file
++" Language:	julia
++" Maintainer:	Carlo Baldassi <carlobaldassi@gmail.com>
++" Last Change:	2013 feb 11
++
++if version < 600
++  syntax clear
++elseif exists("b:current_syntax")
++  finish
++endif
++
++if version < 704
++  " this is used to disable regex syntax like `\@3<='
++  " on older vim versions
++  function! s:d(x)
++    return ''
++  endfunction
++else
++  function! s:d(x)
++    return string(a:x)
++  endfunction
++endif
++
++scriptencoding utf-8
++
++let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0)
++let s:julia_spellcheck_docstrings = get(g:, "julia_spellcheck_docstrings", 1)
++let s:julia_spellcheck_comments = get(g:, "julia_spellcheck_comments", 1)
++
++let s:julia_highlight_operators = get(g:, "julia_highlight_operators", 1)
++
++" List of characters, up to \UFF, which cannot be used in identifiers.
++" (It includes operator characters; we don't consider them identifiers.)
++" This is used mostly in lookbehinds with `\@<=`, e.g. when we need to check
++" that that we're not in the middle of an identifier.
++" It doesn't include a few characters (spaces and all closing parentheses)
++" because those may or may not be valid in the lookbehind on a case-by-case
++" basis.
++let s:nonid_chars = '\U00-\U08' . '\U0A-\U1F' .
++      \             '\U21-\U28' . '\U2A-\U2F' . '\U3A-\U40' . '\U5B-\U5E' . '\U60' . '\U7B\U7C' .
++      \             '\U7E-\UA1' . '\UA7\UA8' . '\UAB-\UAD' . '\UAF\UB1\UB4' . '\UB6-\UB8' . '\UBB\UBF' . '\UD7\UF7'
++
++" The complete list
++let s:nonidS_chars = '[:space:])\U5D}' . s:nonid_chars
++
++
++" List of all valid operator chars up to \UFF (NOTE: they must all be included
++" in s:nonidS_chars, so that if we include that, then this is redundant)
++" It does not include '!' since it can be used in an identifier.
++" The list contains the following characters: '%&*+-/<=>\\^|~¬±×÷'
++let s:op_chars = '\U25\U26\U2A\U2B\U2D\U2F\U3C-\U3E\U5C\U5E\U7C\U7E\UAC\UB1\UD7\UF7'
++
++" List of all valid operator chars above \UFF
++" Written with ranges for performance reasons
++" The list contains the following characters: '…⁝⅋←↑→↓↔↚↛↜↝↞↠↢↣↤↦↩↪↫↬↮↶↷↺↻↼↽⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠⇢⇴⇵⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤∥∦∧∨∩∪∷∸∺∻∽∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡⊢⊣⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⊻⊼⊽⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌿▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱⟵⟶⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⦷⦸⦼⦾⦿⧀⧁⧡⧣⧤⧥⧴⧶⧷⧺⧻⨇⨈⨝⨟⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨰⨱⨲⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡⩢⩣⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫛⫷⫸⫹⫺⬰⬱⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌￩￪￫￬'
++let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC'
++
++" Full operators regex
++let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?=' .
++      \           '\|'  . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?' .
++      \           '\|'  . '\.\?[!' . s:op_chars . s:op_chars_wc . ']' .
++      \           '\)'
++
++
++" Characters that can be used to start an identifier. Above \UBF we don't
++" bother checking. (If a UTF8 operator is used, it will take precedence anyway.)
++let s:id_charsH = '\%([A-Za-z_\UA2-\UA6\UA9\UAA\UAE\UB0\UB5\UBA]\|[^\U00-\UBF]\)'
++" Characters that can appear in an identifier, starting in 2nd position. Above
++" \UBF we check for operators since we need to stop the identifier if one
++" appears. We don't check for invalid characters though.
++let s:id_charsW = '\%([0-9A-Za-z_!\UA2-\UA6\UA9\UAA\UAE-\UB0\UB2-\UB5\UB8-\UBA\UBC-\UBE]\|[^\U00-\UBF]\@=[^' . s:op_chars_wc . ']\)'
++
++" A valid julia identifier, more or less
++let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)'
++
++
++
++syn case match
++
++syntax cluster juliaExpressions		contains=@juliaParItems,@juliaStringItems,@juliaKeywordItems,@juliaBlocksItems,@juliaTypesItems,@juliaConstItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaNumberItems,@juliaCommentItems,@juliaErrorItems,@juliaSyntaxRegions
++syntax cluster juliaExprsPrintf		contains=@juliaExpressions,@juliaPrintfItems
++syntax cluster juliaExprsNodot		contains=@juliaParItems,@juliaStringItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaCommentItems,juliaIdSymbol
++
++syntax cluster juliaParItems		contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
++syntax cluster juliaKeywordItems	contains=juliaKeyword,juliaWhereKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword
++syntax cluster juliaBlocksItems		contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
++syntax cluster juliaTypesItems		contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
++
++syntax cluster juliaConstItems  	contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler
++
++syntax cluster juliaMacroItems		contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra
++syntax cluster juliaSymbolItems		contains=juliaPossibleSymbol
++syntax cluster juliaNumberItems		contains=juliaNumbers
++syntax cluster juliaStringItems		contains=juliaChar,juliaString,juliabString,juliasString,juliaShellString,juliaDocString,juliaRegEx
++syntax cluster juliaPrintfItems		contains=juliaPrintfParBlock,juliaPrintfString
++syntax cluster juliaOperatorItems	contains=juliaOperator,juliaRangeOperator,juliaCTransOperator,juliaTernaryRegion,juliaColon,juliaSemicolon,juliaComma
++syntax cluster juliaCommentItems	contains=juliaCommentL,juliaCommentM
++syntax cluster juliaErrorItems		contains=juliaErrorPar,juliaErrorEnd,juliaErrorElse,juliaErrorCatch,juliaErrorFinally
++
++syntax cluster juliaSyntaxRegions	contains=juliaIdSymbol,juliaTypeOperatorR2,juliaTypeOperatorR3,juliaWhereR,juliaDotted
++
++syntax cluster juliaSpellcheckStrings		contains=@spell
++syntax cluster juliaSpellcheckDocStrings	contains=@spell
++syntax cluster juliaSpellcheckComments		contains=@spell
++
++if !s:julia_spellcheck_docstrings
++  syntax cluster juliaSpellcheckDocStrings	remove=@spell
++endif
++if !s:julia_spellcheck_strings
++  syntax cluster juliaSpellcheckStrings		remove=@spell
++endif
++if !s:julia_spellcheck_comments
++  syntax cluster juliaSpellcheckComments	remove=@spell
++endif
++
++syntax match   juliaSemicolon		display ";"
++syntax match   juliaComma		display ","
++syntax match   juliaColon		display ":"
++
++" A dot can introduce a sort of 'environment' such that words after it are not
++" recognized as keywords. This has low precedence so that it can be overridden
++" by operators
++syntax match   juliaDotted		transparent "\.\s*[^])}.]" contains=@juliaExprsNodot
++syntax match   juliaDottedT		contained transparent "\.\s*[^])}.]" contains=@juliaExprsNodot,juliaType
++
++syntax match   juliaErrorPar		display "[])}]"
++syntax match   juliaErrorEnd		display "\<end\>"
++syntax match   juliaErrorElse		display "\<\%(else\|elseif\)\>"
++syntax match   juliaErrorCatch		display "\<catch\>"
++syntax match   juliaErrorFinally	display "\<finally\>"
++syntax match   juliaErrorSemicol	display contained ";"
++
++syntax region  juliaParBlock		matchgroup=juliaParDelim start="(" end=")" contains=@juliaExpressions,juliaComprehensionFor
++syntax region  juliaParBlockInRange	matchgroup=juliaParDelim contained start="(" end=")" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor
++syntax region  juliaSqBraIdxBlock	matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS
++exec 'syntax region  juliaSqBraBlock	matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
++syntax region  juliaCurBraBlock		matchgroup=juliaParDelim start="{" end="}" contains=juliaType,juliaDottedT,@juliaExpressions
++
++exec 'syntax match   juliaType		contained "\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
++
++" This is a generic identifier followed by some symbol, either a type
++" operator (<: or >:), or an open parenthesis, or an open curly bracket.
++" It's used to recognize one of the contained regions looking for identifiers
++" only once. Once recognized, those regions no longer need to use the
++" expensive s:idregex.
++exec 'syntax match   juliaIdSymbol	transparent "' . s:idregex . '\%(\s*[<>]:\|\.\?(\|{\|\"\)\@=" contains=juliaFunctionCall,juliaParamType,juliaStringPrefixed,juliaTypeOperatorR1'
++
++syntax match  juliaFunctionCall		contained "[^{([:space:]<>\"]\+(\@=" nextgroup=juliaParBlock
++
++exec 'syntax match   juliaFunctionDef	contained transparent "\%(\<\%(function\|macro\)\)\@'.s:d(8).'<=\s\+\zs' . s:idregex . '\%(\.' . s:idregex . '\)*\ze\s*\%((\|\send\>\|$\)" contains=juliaFunctionName'
++exec 'syntax match   juliaFunctionName	contained "\%(\<\%(function\|macro\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
++
++exec 'syntax match   juliaStructR	contained transparent "\%(\<\%(\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*' . s:idregex . '\>\(\s*(\)\@!" contains=juliaType'
++
++syntax match   juliaKeyword		display "\<\%(return\|local\|global\|const\)\>"
++syntax match   juliaInfixKeyword	display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
++
++" The import/export/using keywords introduce a sort of special parsing
++" environment with its own rules
++exec 'syntax region  juliaImportLine		matchgroup=juliaKeyword excludenl start="\<\%(import\|using\|export\)\>" skip="\%(\%(\<\%(import\|using\|export\)\>\)\|^\)\@'.s:d(6).'<=$" end="$" end="\%([])}]\)\@=" contains=@juliaExpressions,juliaAsKeyword,@juliaContinuationItems,juliaMacroName'
++syntax match   juliaAsKeyword		display contained "\<as\>"
++
++syntax match   juliaRepKeyword		display "\<\%(break\|continue\)\>"
++syntax region  juliaConditionalBlock	matchgroup=juliaConditional start="\<if\>" end="\<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold
++syntax region  juliaConditionalEIBlock	matchgroup=juliaConditional transparent contained start="\<elseif\>" end="\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock
++syntax region  juliaConditionalEBlock	matchgroup=juliaConditional transparent contained start="\<else\>" end="\<end\>"me=s-1 contains=@juliaExpressions
++syntax region  juliaWhileBlock		matchgroup=juliaRepeat start="\<while\>" end="\<end\>" contains=@juliaExpressions fold
++syntax region  juliaForBlock		matchgroup=juliaRepeat start="\<for\>" end="\<end\>" contains=@juliaExpressions,juliaOuter fold
++syntax region  juliaBeginBlock		matchgroup=juliaBlKeyword start="\<begin\>" end="\<end\>" contains=@juliaExpressions fold
++syntax region  juliaFunctionBlock	matchgroup=juliaBlKeyword start="\<function\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
++syntax region  juliaMacroBlock		matchgroup=juliaBlKeyword start="\<macro\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
++syntax region  juliaQuoteBlock		matchgroup=juliaBlKeyword start="\<quote\>" end="\<end\>" contains=@juliaExpressions fold
++syntax region  juliaStructBlock		matchgroup=juliaBlKeyword start="\<struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
++syntax region  juliaMutableStructBlock	matchgroup=juliaBlKeyword start="\<mutable\s\+struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
++syntax region  juliaLetBlock		matchgroup=juliaBlKeyword start="\<let\>" end="\<end\>" contains=@juliaExpressions fold
++syntax region  juliaDoBlock		matchgroup=juliaBlKeyword start="\<do\>" end="\<end\>" contains=@juliaExpressions fold
++syntax region  juliaModuleBlock		matchgroup=juliaBlKeyword start="\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold
++syntax region  juliaExceptionBlock	matchgroup=juliaException start="\<try\>" end="\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold
++syntax region  juliaCatchBlock		matchgroup=juliaException transparent contained start="\<catch\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock
++syntax region  juliaFinallyBlock	matchgroup=juliaException transparent contained start="\<finally\>" end="\<end\>"me=s-1 contains=@juliaExpressions
++syntax region  juliaAbstractBlock	matchgroup=juliaBlKeyword start="\<abstract\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
++syntax region  juliaPrimitiveBlock	matchgroup=juliaBlKeyword start="\<primitive\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
++
++exec 'syntax region  juliaComprehensionFor	matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
++syntax match   juliaComprehensionIf	contained "\<if\>"
++
++exec 'syntax match   juliaOuter		contained "\<outer\ze\s\+' . s:idregex . '\>"'
++
++syntax match   juliaRangeKeyword	contained "\<\%(begin\|end\)\>"
++
++syntax match   juliaBaseTypeBasic	display "\<\%(\%(N\|Named\)\?Tuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\|Nothing\|Some\|Missing\)\>"
++syntax match   juliaBaseTypeNum		display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|\%(Abstract\)\?Irrational\|Enum\|BigInt\|BigFloat\|MathConst\|ComplexF\%(16\|32\|64\)\)\>"
++syntax match   juliaBaseTypeC		display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\|void\)\)\>"
++syntax match   juliaBaseTypeError	display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|ReadOnlyMemory\|StringIndex\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Missing\|\%(Process\|Task\)Failed\)Exception\|DimensionMismatch\|SegmentationFault\)\>"
++syntax match   juliaBaseTypeIter	display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\|CartesianIndices\)\>"
++syntax match   juliaBaseTypeString	display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\|Substitution\)\?String\>"
++syntax match   juliaBaseTypeArray	display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|\%(Sparse\|Row\)Vector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
++syntax match   juliaBaseTypeDict	display "\<\%(WeakKey\|Id\|Abstract\)\?Dict\>"
++syntax match   juliaBaseTypeSet		display "\<\%(\%(Abstract\|Bit\)\?Set\)\>"
++syntax match   juliaBaseTypeIO		display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\|GenericIOBuffer\)\>"
++syntax match   juliaBaseTypeProcess	display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>"
++syntax match   juliaBaseTypeRange	display "\<\%(Dims\|RangeIndex\|\%(Abstract\|Lin\|Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>"
++syntax match   juliaBaseTypeRegex	display "\<Regex\%(Match\)\?\>"
++syntax match   juliaBaseTypeFact	display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>"
++syntax match   juliaBaseTypeSort	display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>"
++syntax match   juliaBaseTypeRound	display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>"
++syntax match   juliaBaseTypeSpecial	display "\<\%(LocalProcess\|ClusterManager\)\>"
++syntax match   juliaBaseTypeRandom	display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>"
++syntax match   juliaBaseTypeDisplay	display "\<\%(Text\(Display\)\?\|\%(Abstract\)\?Display\|MIME\|HTML\)\>"
++syntax match   juliaBaseTypeTime	display "\<\%(Date\%(Time\)\?\|DateFormat\)\>"
++syntax match   juliaBaseTypeOther	display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>"
++
++syntax match   juliaConstNum		display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|π\)\>\)"
++" Note: recognition of ℯ, which Vim does not consider a valid identifier, is
++" complicated. We detect possible uses by just looking for the character (for
++" performance) and then check that it's actually used by its own.
++" (This also tries to detect preceding number constants; it does so in a crude
++" way.)
++syntax match   juliaPossibleEuler	"ℯ" contains=juliaEuler
++exec 'syntax match   juliaEuler		contained "\%(\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\%(.\?[0-9][.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=ℯ\ze[' . s:nonidS_chars . s:op_chars_wc . ']"'
++syntax match   juliaConstBool		display "\<\%(true\|false\)\>"
++syntax match   juliaConstEnv		display "\<\%(ARGS\|ENV\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|PROGRAM_FILE\|DEPOT_PATH\)\>"
++syntax match   juliaConstIO		display "\<\%(std\%(out\|in\|err\)\|devnull\)\>"
++syntax match   juliaConstC		display "\<\%(C_NULL\)\>"
++syntax match   juliaConstGeneric	display "\<\%(nothing\|Main\|undef\|missing\)\>"
++
++syntax match   juliaParamType		contained "[^{([:space:]<>\"]\+\ze{" nextgroup=juliaCurBraBlock
++
++syntax match   juliaPossibleMacro	transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro,juliaDocMacro,juliaDocMacroPre
++
++exec 'syntax match   juliaMacro		contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
++syntax match   juliaMacro		contained "@[!.~$%^*/\\|<>+-]\ze[^0-9]"
++exec 'syntax region  juliaMacroCall	contained transparent start="\(@' . s:idregex . '\%(\.' . s:idregex . '\)*\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
++exec 'syntax region  juliaMacroCall	contained transparent start="\(@.\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
++exec 'syntax region  juliaMacroCallP	contained transparent start="@' . s:idregex . '\%(\.' . s:idregex . '\)*(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
++exec 'syntax region  juliaMacroCallP	contained transparent start="@.(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
++
++exec 'syntax match   juliaNumbers	transparent "\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\@'.s:d(1).'<=\d\|\.\d\|im\>" contains=juliaNumber,juliaFloat,juliaComplexUnit'
++
++"integer regexes
++let s:dec_regex = '\d\%(_\?\d\)*\%(\>\|im\>\|\ze\D\)'
++let s:hex_regex = '0x\x\%(_\?\x\)*\%(\>\|im\>\|\ze\X\)'
++let s:bin_regex = '0b[01]\%(_\?[01]\)*\%(\>\|im\>\|\ze[^01]\)'
++let s:oct_regex = '0o\o\%(_\?\o\)*\%(\>\|im\>\|\ze\O\)'
++
++let s:int_regex = '\%(' . s:hex_regex .
++      \           '\|'  . s:bin_regex .
++      \           '\|'  . s:oct_regex .
++      \           '\|'  . s:dec_regex .
++      \           '\)'
++
++"floating point regexes
++"  starting with a dot, optional exponent
++let s:float_regex1 = '\.\d\%(_\?\d\)*\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
++"  with dot, optional exponent
++let s:float_regex2 = '\d\%(_\?\d\)*\.\%(\d\%(_\?\d\)*\)\?\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
++"  without dot, with exponent
++let s:float_regex3 = '\d\%(_\?\d\)*[eEf][-+]\?\d\+\%(\>\|im\>\|\ze\D\)'
++
++"hex floating point numbers
++"  starting with a dot
++let s:hexfloat_regex1 = '0x\.\%\(\x\%(_\?\x\)*\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
++"  starting with a digit
++let s:hexfloat_regex2 = '0x\x\%(_\?\x\)*\%\(\.\%\(\x\%(_\?\x\)*\)\?\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
++
++let s:float_regex = '\%(' . s:float_regex3 .
++      \             '\|'  . s:float_regex2 .
++      \             '\|'  . s:float_regex1 .
++      \             '\|'  . s:hexfloat_regex2 .
++      \             '\|'  . s:hexfloat_regex1 .
++      \             '\)'
++
++exec 'syntax match   juliaNumber	contained "' . s:int_regex . '" contains=juliaComplexUnit'
++exec 'syntax match   juliaFloat		contained "' . s:float_regex . '" contains=juliaComplexUnit'
++syntax match   juliaComplexUnit		display	contained "\<im\>"
++
++syntax match   juliaRangeOperator	display ":"
++exec 'syntax match   juliaOperator	"' . s:operators . '"'
++
++exec 'syntax region  juliaTernaryRegion	matchgroup=juliaTernaryOperator start="\s\zs?\ze\s" skip="\%(:\(:\|[^:[:space:]'."'".'"({[]\+\s*\ze:\)\|\%(?\s*\)\@'.s:d(6).'<=:(\)" end=":" contains=@juliaExpressions,juliaErrorSemicol'
++
++let s:interp_dollar = '\([' . s:nonidS_chars . s:op_chars_wc . '!]\|^\)\@'.s:d(1).'<=\$'
++
++exec 'syntax match   juliaDollarVar	display contained "' . s:interp_dollar . s:idregex . '"'
++exec 'syntax region  juliaDollarPar	matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '(" end=")" contains=@juliaExpressions'
++exec 'syntax region  juliaDollarSqBra	matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS'
++
++syntax match   juliaChar		"'\\\?.'" contains=juliaSpecialChar
++syntax match   juliaChar		display "'\\\o\{3\}'" contains=juliaOctalEscapeChar
++syntax match   juliaChar		display "'\\x\x\{2\}'" contains=juliaHexEscapeChar
++syntax match   juliaChar		display "'\\u\x\{1,4\}'" contains=juliaUniCharSmall
++syntax match   juliaChar		display "'\\U\x\{1,8\}'" contains=juliaUniCharLarge
++
++exec 'syntax match   juliaCTransOperator	"[[:space:]}' . s:nonid_chars . s:op_chars_wc . '!]\@'.s:d(1).'<!\.\?' . "'" . 'ᵀ\?"'
++
++" TODO: some of these might be specialized; the rest could be just left to the
++"       generic juliaStringPrefixed fallback
++syntax region  juliaString		matchgroup=juliaStringDelim start=+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckStrings
++syntax region  juliaStringPrefixed	contained matchgroup=juliaStringDelim start=+[^{([:space:]<>"]\+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialCharsRaw
++syntax region  juliabString		matchgroup=juliaStringDelim start=+\<b\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
++syntax region  juliasString		matchgroup=juliaStringDelim start=+\<s\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
++
++syntax region  juliaDocString		matchgroup=juliaDocStringDelim fold start=+^"""+ skip=+\%(\\\\\)*\\"+ end=+"""+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
++
++exec 'syntax region  juliaPrintfMacro		contained transparent start="@s\?printf(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaPrintfParBlock'
++syntax region  juliaPrintfMacro		contained transparent start="@s\?printf\s\+" end="\ze\%([])};#]\|$\|\<for\>\)" contains=@juliaExprsPrintf,juliaMacro,juliaSymbolS,juliaQuotedParBlockS
++syntax region  juliaPrintfParBlock	contained matchgroup=juliaParDelim start="(" end=")" contains=@juliaExprsPrintf
++syntax region  juliaPrintfString	contained matchgroup=juliaStringDelim start=+"+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=@juliaSpecialChars,@juliaPrintfChars
++
++exec 'syntax region  juliaDocMacroPre	contained transparent start=+@doc\s\+\%(' . s:idregex . '\%(\.' . s:idregex . '\)*\)\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringMRaw'
++exec 'syntax region  juliaDocMacro	contained transparent start=+@doc\s\+\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringM'
++syntax region  juliaDocStringMRaw	contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpellcheckDocStrings
++syntax region  juliaDocStringM		contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
++
++syntax region  juliaShellString		matchgroup=juliaStringDelim start=+`+ skip=+\%(\\\\\)*\\`+ end=+`+ contains=@juliaStringVars,juliaSpecialChar
++
++syntax cluster juliaStringVars		contains=juliaStringVarsPar,juliaStringVarsSqBra,juliaStringVarsCurBra,juliaStringVarsPla
++syntax region  juliaStringVarsPar	contained matchgroup=juliaStringVarDelim start="$(" end=")" contains=@juliaExpressions
++syntax region  juliaStringVarsSqBra	contained matchgroup=juliaStringVarDelim start="$\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS
++syntax region  juliaStringVarsCurBra	contained matchgroup=juliaStringVarDelim start="${" end="}" contains=@juliaExpressions
++exec 'syntax match   juliaStringVarsPla	contained "\$' . s:idregex . '"'
++
++" TODO improve RegEx
++syntax region  juliaRegEx		matchgroup=juliaStringDelim start=+\<r\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1[imsx]*+
++
++syntax cluster juliaSpecialChars	contains=juliaSpecialChar,juliaDoubleBackslash,juliaEscapedQuote,juliaOctalEscapeChar,juliaHexEscapeChar,juliaUniCharSmall,juliaUniCharLarge
++syntax match   juliaSpecialChar		display contained "\\."
++syntax match   juliaOctalEscapeChar	display contained "\\\o\{3\}"
++syntax match   juliaHexEscapeChar	display contained "\\x\x\{2\}"
++syntax match   juliaUniCharSmall	display contained "\\u\x\{1,4\}"
++syntax match   juliaUniCharLarge	display contained "\\U\x\{1,8\}"
++syntax cluster juliaSpecialCharsRaw	contains=juliaDoubleBackslash,juliaEscapedQuote
++syntax match   juliaDoubleBackslash	contained "\\\\"
++syntax match   juliaEscapedQuote	contained "\\\""
++
++syntax cluster juliaPrintfChars		contains=juliaErrorPrintfFmt,juliaPrintfFmt
++syntax match   juliaErrorPrintfFmt	display contained "\\\?%."
++syntax match   juliaPrintfFmt		display contained "%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"
++syntax match   juliaPrintfFmt		display contained "%%"
++syntax match   juliaPrintfFmt		display contained "\\%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"hs=s+1
++syntax match   juliaPrintfFmt		display contained "\\%%"hs=s+1
++
++" this is used to restrict the search for Symbols to when colons appear at all
++" (for performance reasons)
++syntax match   juliaPossibleSymbol	transparent ":\ze[^:]" contains=juliaSymbol,juliaQuotedParBlock,juliaQuotedQMarkPar,juliaColon
++
++let s:quotable = '\%(' . s:idregex . '\|' . s:operators . '\|[?.]\|' . s:float_regex . '\|' . s:int_regex . '\)'
++let s:quoting_colon = '\%(\%(^\s*\|\s\{6,\}\|[' . s:nonid_chars . s:op_chars_wc . ']\s*\)\@'.s:d(6).'<=\|\%(\<\%(return\|if\|else\%(if\)\?\|while\|try\|begin\)\s\+\)\@'.s:d(9).'<=\)\zs:'
++let s:quoting_colonS = '\s\@'.s:d(1).'<=:'
++
++" note: juliaSymbolS only works within whitespace-sensitive contexts,
++" such as in macro calls without parentheses, or within square brackets.
++" It is used to override the recognition of expressions like `a :b` as
++" ranges rather than symbols in those contexts.
++" (Note that such `a :b` expressions only allows at most 5 spaces between
++" the identifier and the colon anyway.)
++
++exec 'syntax match   juliaSymbol	contained "' . s:quoting_colon . s:quotable . '"'
++exec 'syntax match   juliaSymbolS	contained "' . s:quoting_colonS . s:quotable . '"'
++
++" same as above for quoted expressions such as :(expr)
++exec 'syntax region   juliaQuotedParBlock	matchgroup=juliaQParDelim start="' . s:quoting_colon . '(" end=")" contains=@juliaExpressions'
++exec 'syntax match    juliaQuotedQMarkPar	"' . s:quoting_colon . '(\s*?\s*)" contains=juliaQuotedQMark'
++exec 'syntax region   juliaQuotedParBlockS	matchgroup=juliaQParDelim contained start="' . s:quoting_colonS . '(" end=")" contains=@juliaExpressions'
++
++
++syntax match   juliaTypeOperatorR1	contained "[^{([:space:]<>\"]\+\%(\s*[<>]:\)\@="
++
++" force precedence over Symbols
++syntax match   juliaTypeOperator	contained "[<>:]:"
++exec 'syntax match   juliaTypeOperatorR2	transparent "[<>:]:\s*\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaTypeOperator,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaTypeOperator'
++syntax match   juliaIsaKeyword		contained "\<isa\>"
++exec 'syntax match   juliaTypeOperatorR3	transparent "\<isa\s\+\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaIsaKeyword,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaIsaKeyword'
++
++syntax match   juliaWhereKeyword       	"\<where\>"
++exec 'syntax match   juliaWhereR	transparent "\<where\s\+' . s:idregex . '" contains=juliaWhereKeyword,juliaType,juliaDottedT,juliaIdSymbol'
++
++syntax region  juliaCommentL		matchgroup=juliaCommentDelim excludenl start="#\ze\%([^=]\|$\)" end="$" contains=juliaTodo,@juliaSpellcheckComments
++syntax region  juliaCommentM		matchgroup=juliaCommentDelim fold start="#=\ze\%([^#]\|$\)" end="=#" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
++syntax keyword juliaTodo		contained TODO FIXME XXX
++
++" detect an end-of-line with only whitespace or comments before it
++let s:eol = '\s*\%(\%(\%(#=\%(=#\@!\|[^=]\|\n\)\{-}=#\)\s*\)\+\)\?\%(#=\@!.*\)\?\n'
++
++" a trailing comma, or colon, or an empty line in an import/using/export
++" multi-line command. Used to recognize the as keyword, and for indentation
++" (this needs to take precedence over normal commas and colons, and comments)
++syntax cluster juliaContinuationItems	contains=juliaContinuationComma,juliaContinuationColon,juliaContinuationNone
++exec 'syntax region  juliaContinuationComma	matchgroup=juliaComma contained start=",\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
++exec 'syntax region  juliaContinuationColon	matchgroup=juliaColon contained start=":\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
++exec 'syntax region  juliaContinuationNone	matchgroup=NONE contained start="\%(\<\%(import\|using\|export\)\>\|^\)\@'.s:d(6).'<=\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems,juliaAsKeyword'
++exec 'syntax match   juliaMacroName		contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
++
++" the following are disabled by default, but
++" can be enabled by entering e.g.
++"   :hi link juliaParDelim Delimiter
++hi def link juliaParDelim		juliaNone
++hi def link juliaSemicolon		juliaNone
++hi def link juliaComma			juliaNone
++hi def link juliaFunctionCall		juliaNone
++
++hi def link juliaColon			juliaOperator
++
++hi def link juliaFunctionName		juliaFunction
++hi def link juliaFunctionName1		juliaFunction
++hi def link juliaMacroName		juliaMacro
++
++
++hi def link juliaKeyword		Keyword
++hi def link juliaWhereKeyword		Keyword
++hi def link juliaInfixKeyword		Keyword
++hi def link juliaIsaKeyword		Keyword
++hi def link juliaAsKeyword		Keyword
++hi def link juliaRepKeyword		Keyword
++hi def link juliaBlKeyword		Keyword
++hi def link juliaConditional		Conditional
++hi def link juliaRepeat			Repeat
++hi def link juliaException		Exception
++hi def link juliaOuter			Keyword
++hi def link juliaBaseTypeBasic		Type
++hi def link juliaBaseTypeNum		Type
++hi def link juliaBaseTypeC		Type
++hi def link juliaBaseTypeError		Type
++hi def link juliaBaseTypeIter		Type
++hi def link juliaBaseTypeString		Type
++hi def link juliaBaseTypeArray		Type
++hi def link juliaBaseTypeDict		Type
++hi def link juliaBaseTypeSet		Type
++hi def link juliaBaseTypeIO		Type
++hi def link juliaBaseTypeProcess	Type
++hi def link juliaBaseTypeRange		Type
++hi def link juliaBaseTypeRegex		Type
++hi def link juliaBaseTypeFact		Type
++hi def link juliaBaseTypeSort		Type
++hi def link juliaBaseTypeRound		Type
++hi def link juliaBaseTypeSpecial	Type
++hi def link juliaBaseTypeRandom		Type
++hi def link juliaBaseTypeDisplay	Type
++hi def link juliaBaseTypeTime		Type
++hi def link juliaBaseTypeOther		Type
++
++hi def link juliaType			Type
++hi def link juliaParamType		Type
++hi def link juliaTypeOperatorR1		Type
++
++" NOTE: deprecated constants are not highlighted as such. For once,
++" one can still legitimately use them by importing Base.MathConstants.
++" Plus, one-letter variables like `e` and `γ` can be used with other
++" meanings.
++hi def link juliaConstNum		Constant
++hi def link juliaEuler			Constant
++
++hi def link juliaConstEnv		Constant
++hi def link juliaConstC			Constant
++hi def link juliaConstLimits		Constant
++hi def link juliaConstGeneric		Constant
++hi def link juliaRangeKeyword		Constant
++hi def link juliaConstBool		Boolean
++hi def link juliaConstIO		Boolean
++
++hi def link juliaComprehensionFor	Keyword
++hi def link juliaComprehensionIf	Keyword
++
++hi def link juliaDollarVar		Identifier
++
++hi def link juliaFunction		Function
++hi def link juliaMacro			Macro
++hi def link juliaSymbol			Identifier
++hi def link juliaSymbolS		Identifier
++hi def link juliaQParDelim		Identifier
++hi def link juliaQuotedQMarkPar		Identifier
++hi def link juliaQuotedQMark		juliaOperatorHL
++
++hi def link juliaNumber			Number
++hi def link juliaFloat			Float
++hi def link juliaComplexUnit		Constant
++
++hi def link juliaChar			Character
++
++hi def link juliaString			String
++hi def link juliaStringPrefixed		juliaString
++hi def link juliabString		juliaString
++hi def link juliasString		juliaString
++hi def link juliavString		juliaString
++hi def link juliarString		juliaString
++hi def link juliaipString		juliaString
++hi def link juliabigString		juliaString
++hi def link juliaMIMEString		juliaString
++hi def link juliarawString		juliaString
++hi def link juliatestString		juliaString
++hi def link juliahtmlString		juliaString
++hi def link juliaint128String		juliaString
++hi def link juliaPrintfString		juliaString
++hi def link juliaShellString		juliaString
++hi def link juliaDocString		juliaString
++hi def link juliaDocStringM		juliaDocString
++hi def link juliaDocStringMRaw		juliaDocString
++hi def link juliaStringDelim		juliaString
++hi def link juliaDocStringDelim		juliaDocString
++hi def link juliaStringVarsPla		Identifier
++hi def link juliaStringVarDelim		Identifier
++
++hi def link juliaRegEx			String
++
++hi def link juliaSpecialChar		SpecialChar
++hi def link juliaOctalEscapeChar	SpecialChar
++hi def link juliaHexEscapeChar		SpecialChar
++hi def link juliaUniCharSmall		SpecialChar
++hi def link juliaUniCharLarge		SpecialChar
++hi def link juliaDoubleBackslash	SpecialChar
++hi def link juliaEscapedQuote		SpecialChar
++
++hi def link juliaPrintfFmt		SpecialChar
++
++if s:julia_highlight_operators
++  hi! def link juliaOperatorHL		Operator
++else
++  hi! def link juliaOperatorHL		juliaNone
++endif
++hi def link juliaOperator		juliaOperatorHL
++hi def link juliaRangeOperator		juliaOperatorHL
++hi def link juliaCTransOperator		juliaOperatorHL
++hi def link juliaTernaryOperator	juliaOperatorHL
++hi def link juliaTypeOperator		juliaOperatorHL
++
++hi def link juliaCommentL		Comment
++hi def link juliaCommentM		Comment
++hi def link juliaCommentDelim		Comment
++hi def link juliaTodo			Todo
++
++hi def link juliaErrorPar		juliaError
++hi def link juliaErrorEnd		juliaError
++hi def link juliaErrorElse		juliaError
++hi def link juliaErrorCatch		juliaError
++hi def link juliaErrorFinally		juliaError
++hi def link juliaErrorSemicol		juliaError
++hi def link juliaErrorPrintfFmt		juliaError
++
++hi def link juliaError			Error
++
++syntax sync fromstart
++
++let b:current_syntax = "julia"
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim	(revision 26356)
+@@ -0,0 +1,65 @@
++" Vim syntax file for julia document view
++scriptencoding utf-8
++
++if exists('b:current_syntax')
++  finish
++endif
++
++syntax sync fromstart
++
++syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="`" end="`" concealends display oneline
++syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="``" end="``" concealends display oneline contains=juliadocCodeLatex
++syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="^\s*```.*$" end='^\s*```' concealends
++syntax region juliadocH1 matchgroup=juliadocHeadingDelimiter start="##\@!"      end="$" concealends display oneline
++syntax region juliadocH2 matchgroup=juliadocHeadingDelimiter start="###\@!"     end="$" concealends display oneline
++syntax region juliadocH3 matchgroup=juliadocHeadingDelimiter start="####\@!"    end="$" concealends display oneline
++syntax region juliadocH4 matchgroup=juliadocHeadingDelimiter start="#####\@!"   end="$" concealends display oneline
++syntax region juliadocH5 matchgroup=juliadocHeadingDelimiter start="######\@!"  end="$" concealends display oneline
++syntax region juliadocH6 matchgroup=juliadocHeadingDelimiter start="#######\@!" end="$" concealends display oneline
++syntax match juliadocLink "\[\^\@!.\{-1,}\](.\{-1,})" contains=juliadocLinkBody,juliadocLinkUrl display keepend
++syntax region juliadocLinkBody matchgroup=juliadocLinkDelimiter start="\[" end="\]" concealends display contained oneline
++syntax match juliadocLinkUrl "(\zs@ref\s\+.\{-1,}\ze)" contains=juliadocLinkUrlConceal display keepend
++syntax match juliadocLinkUrlConceal "@ref\s\+" conceal display contained
++syntax match juliadocCrossref "\[`.\{-1,}`\](@ref)" contains=juliadocCrossrefBody display keepend
++syntax region juliadocCrossrefBody matchgroup=juliadocCrossrefDelimiter start="\[`" end="`\](@ref)" concealends display contained oneline
++syntax region juliadocMath matchgroup=juliadocMathDelimiter start="\$" end="\$" concealends display oneline
++syntax match juliadocListing "^\s*\zs\%([-+*]\|\d\+[.)]\)\ze\s" display
++syntax match juliadocFootnote "^\s*\[\^[[:alnum:]]\+\]:\s*" display contains=juliadocFootnoteBody keepend
++syntax region juliadocFootnoteBody matchgroup=juliadocFootnoteDelimiter start="^\s*\zs\[\^" end="\]" concealends display contained oneline
++syntax match juliadocFootnoteRef "\s\[\^[[:alnum:]]\+\]" display contains=juliadocFootnoteRefBody,juliadocFootnoteRefConceal keepend
++syntax match juliadocFootnoteRefBody "[[:alnum:]]\+" display contained
++syntax match juliadocFootnoteRefConceal "\^" conceal display contained
++syntax region juliadocBlockquote matchgroup=juliadocBlockquoteDelimiter start="^\s*>\s" end="$" concealends display oneline
++syntax match juliadocRules "^-\{3,}" display
++syntax region juliadocAdmonitions matchgroup=juliadocAdmonitionsDelimiter start="^\s*!!!" end="$" concealends display contains=juliadocAdmonitionsType,juliadocAdmonitionsTitle oneline keepend
++syntax match juliadocAdmonitionsType "\c\%(danger\|warning\|info\|note\|tip\)\>" display contained
++syntax region juliadocAdmonitionsTitle matchgroup=juliadocAdmonitionsTitleDelimiter start='"' end='"' display contained oneline
++
++if &encoding ==# 'utf-8'
++  for [s:from, s:to] in items(julia_latex_symbols#get_dict())
++    execute printf('syntax match juliadocCodeLatex "\\%s" conceal cchar=%s display contained', escape(s:from, '~"\.^$[]*'), s:to)
++  endfor
++endif
++
++highlight default link juliadocCode String
++highlight default link juliadocCodeLatex String
++highlight default link juliadocH1 Title
++highlight default link juliadocH2 Title
++highlight default link juliadocH3 Title
++highlight default link juliadocH4 Title
++highlight default link juliadocH5 Title
++highlight default link juliadocH6 Title
++highlight default link juliadocLinkBody Identifier
++highlight default link juliadocLinkUrl Underlined
++highlight default link juliadocCrossref Underlined
++highlight default link juliadocCrossrefBody Underlined
++highlight default link juliadocMath Special
++highlight default link juliadocListing PreProc
++highlight default link juliadocFootnoteBody PreProc
++highlight default link juliadocFootnoteRefBody PreProc
++highlight default link juliadocBlockquote Comment
++highlight default link juliadocRules PreProc
++highlight default link juliadocAdmonitionsType Todo
++highlight default link juliadocAdmonitionsTitle Title
++
++let b:current_syntax = "juliadoc"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26356-26357.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26356-26357.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26356-26357.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/m/classes/clusters/frontera.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/frontera.m	(revision 26356)
++++ ../trunk-jpl/src/m/classes/clusters/frontera.m	(revision 26357)
+@@ -8,12 +8,12 @@
+ classdef frontera
+ 	properties (SetAccess=public)
+ 		% {{{
+-		name          = 'ls5.tacc.utexas.edu'
++		name          = 'frontera'
+ 		login         = '';
+-		modules        = {'intel/18.0.2' 'gsl'};
++		modules        = {'petsc/3.15'};
+ 		numnodes      = 1;
+-		cpuspernode   = 24;
+-		port          = 1099;
++		cpuspernode   = 56;
++		port          = 0;
+ 		queue         = 'normal';
+ 		codepath      = '';
+ 		executionpath = '';
+@@ -121,7 +121,7 @@
+ 			fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+ 			fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+ 			fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
+-			fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.nprocs()/cluster.numnodes,24));
++			fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.nprocs()/cluster.numnodes,56));
+ 			fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
+ 			fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
+ 			for i=1:numel(cluster.modules),
Index: /issm/oecreview/Archive/25834-26739/ISSM-26357-26358.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26357-26358.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26357-26358.diff	(revision 26740)
@@ -0,0 +1,9176 @@
+Index: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh	(revision 26357)
++++ ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh	(nonexistent)
+@@ -1,83 +0,0 @@
+-#!/bin/bash
+-
+-# This script is intended to test binaries downloaded to a user-end machine.
+-#
+-# NOTE: Tarball must already exist in INSTALL_DIR
+-#
+-
+-MATLAB_NROPTIONS="'id',[IdFromString('Dakota')]"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-INSTALL_DIR=~/Downloads
+-PACKAGE_NAME="ISSM"
+-PYTHON_NROPTIONS="--include_name 'Dakota' --exclude 234 418 420"
+-TARBALL_NAME="issm-linux-with_dakota"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
+-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
+-
+-cd ${INSTALL_DIR}
+-rm -rf ${PACKAGE_NAME}
+-tar -zxvf ${TARBALL}
+-cd ${PACKAGE_NAME}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+-
+-# Check that Python tests run
+-echo "Running Python tests"
+-
+-export ISSM_DIR="${INSTALL_DIR}"
+-export PATH="${PATH}:${ISSM_DIR}/bin"
+-export PYTHONPATH="${ISSM_DIR}/scripts"
+-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+-
+-rm python.log 2> /dev/null
+-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+-
+-# Check that Python did not exit in error
+-pythonExitCode=`echo $?`
+-pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
+-
+-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-	echo "----------Python exited in error!----------"
+-	cat python.log
+-	echo "-----------End of python.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all Python tests passed
+-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
+-	echo "One or more Python tests FAILED"
+-	exit 1
+-else
+-	echo "All Python tests PASSED"
+-fi
+
+Property changes on: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-with_dakota.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh	(revision 26357)
++++ ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh	(nonexistent)
+@@ -1,49 +0,0 @@
+-#!/bin/bash
+-
+-# This script is intended to test binaries downloaded to a user-end machine.
+-#
+-# NOTE: Tarball must already exist in INSTALL_DIR
+-#
+-
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-INSTALL_DIR=~/Downloads
+-PACKAGE_NAME="ISSM"
+-TARBALL_NAME="issm-linux"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
+-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
+-
+-cd ${INSTALL_DIR}
+-rm -rf ${PACKAGE_NAME}
+-tar -zxvf ${TARBALL}
+-cd ${PACKAGE_NAME}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+
+Property changes on: ../trunk-jpl/packagers/linux/test-issm-linux-binaries.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh	(revision 26357)
++++ ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh	(nonexistent)
+@@ -1,81 +0,0 @@
+-#!/bin/bash
+-
+-# This script is intended to test binaries downloaded to a user-end machine.
+-#
+-# NOTE: Tarball must already exist in INSTALL_DIR
+-#
+-
+-MATLAB_NROPTIONS="'benchmark','slr'"
+-MATLAB_PATH="/usr/local/MATLAB/R2019b"
+-INSTALL_DIR=~/Downloads
+-PACKAGE_NAME="ISSM-Solid_Earth"
+-PYTHON_NROPTIONS="--benchmark slr"
+-TARBALL_NAME="issm-linux-solid_earth"
+-TARBALL="${TARBALL_NAME}.tar.gz"
+-
+-export ISSM_DIR="${INSTALL_DIR}/${PACKAGE_NAME}"
+-export PATH="${PATH}:${ISSM_DIR}/bin:${ISSM_DIR}/scripts"
+-
+-cd ${INSTALL_DIR}
+-rm -rf ${PACKAGE_NAME}
+-tar -zxvf ${TARBALL}
+-cd ${PACKAGE_NAME}/test/NightlyRun
+-
+-# Check that MATLAB tests run
+-echo "Running MATLAB tests"
+-rm matlab.log 2> /dev/null
+-
+-# Run MATLAB tests redirecting output to logfile and suppressing output to console
+-${MATLAB_PATH}/bin/matlab -nosplash -nodesktop -nojvm -r "try, addpath ../../bin; addpath ../../lib; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log &> /dev/null
+-
+-# Check that MATLAB did not exit in error
+-matlabExitCode=`echo $?`
+-matlabExitedInError=`grep -E "Activation cannot proceed|license|Error" matlab.log | wc -l`
+-
+-if [[ ${matlabExitCode} -ne 0 || ${matlabExitedInError} -ne 0 ]]; then
+-	echo "----------MATLAB exited in error!----------"
+-	cat matlab.log
+-	echo "-----------End of matlab.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all MATLAB tests passed
+-numMatlabTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numMatlabTestsFailed} -ne 0 ]]; then
+-	echo "One or more MATLAB tests FAILED"
+-	exit 1
+-else
+-	echo "All MATLAB tests PASSED"
+-fi
+-
+-# Check that Python tests run
+-echo "Running Python tests"
+-
+-export PYTHONPATH="${ISSM_DIR}/scripts"
+-export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+-export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
+-
+-rm python.log 2> /dev/null
+-./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
+-
+-# Check that Python did not exit in error
+-pythonExitCode=`echo $?`
+-pythonExitedInError=`grep -E "runme.py: error" python.log | wc -l`
+-
+-if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
+-	echo "----------Python exited in error!----------"
+-	cat python.log
+-	echo "-----------End of python.log-----------"
+-	exit 1
+-fi
+-
+-# Check that all Python tests passed
+-numPythonTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
+-
+-if [[ ${numPythonTestsFailed} -ne 0 ]]; then
+-	echo "One or more Python tests FAILED"
+-	exit 1
+-else
+-	echo "All Python tests PASSED"
+-fi
+
+Property changes on: ../trunk-jpl/packagers/linux/test-issm-linux-binaries-solid_earth.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/packagers/mac/test-issm-mac-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/test-issm-mac-binaries-matlab.sh	(revision 26357)
++++ ../trunk-jpl/packagers/mac/test-issm-mac-binaries-matlab.sh	(revision 26358)
+@@ -10,7 +10,7 @@
+ ## Constants
+ #
+ INSTALL_DIR=.
+-MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2006,2020,2021,2051,2052,2053,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
++MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2004,2006,2051,2052,2053,2084,2085,2424,2425,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ MATLAB_PATH="/Applications/MATLAB_R2018a.app"
+ PKG="ISSM-macOS-MATLAB"
+ 
+Index: ../trunk-jpl/packagers/mac/test-issm-mac-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/mac/test-issm-mac-binaries-python.sh	(revision 26357)
++++ ../trunk-jpl/packagers/mac/test-issm-mac-binaries-python.sh	(revision 26358)
+@@ -11,7 +11,7 @@
+ #
+ INSTALL_DIR=.
+ PKG="ISSM-macOS-Python"
+-PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2006 2020 2021 2051 2052 2053 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
++PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2004 2006 2007 2051 2052 2053 2084 2085 2424 2425 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ 
+ COMPRESSED_PKG="${PKG}.zip"
+ 
+Index: ../trunk-jpl/src/m/archive/arch.py
+===================================================================
+--- ../trunk-jpl/src/m/archive/arch.py	(revision 26357)
++++ ../trunk-jpl/src/m/archive/arch.py	(revision 26358)
+@@ -5,11 +5,11 @@
+ 
+ 
+ def archwrite(filename, *args):  # {{{
++    """ARCHWRITE - Write data to a field, given the file name, field name, and data.
++
++    Usage:
++        archwrite('archive101.arch', 'variable_name', data)
+     """
+-    ARCHWRITE - Write data to a field, given the file name, field name, and data.
+-        Usage:
+-            archwrite('archive101.arch', 'variable_name', data)
+-    """
+ 
+     nargs = len(args)
+     if nargs % 2 != 0:
+@@ -44,12 +44,12 @@
+ 
+ 
+ def archread(filename, fieldname):  # {{{
++    """ARCHREAD - Given an arch file name, and a field name, find and return 
++    the data associated with that field name.
++
++    Usage:
++        archread('archive101.arch', 'field_var_1')
+     """
+-    ARCHREAD - Given an arch file name, and a field name, find and return the data
+-                    associated with that field name.
+-        Usage:
+-            archread('archive101.arch', 'field_var_1')
+-    """
+     try:
+         if path.isfile(filename):
+             fid = open(filename, 'rb')
+@@ -75,11 +75,10 @@
+ 
+ 
+ def archdisp(filename):  # {{{
+-    """
+-    ARCHDISP - Given an arch filename, display the contents of that file
++    """ARCHDISP - Given an arch filename, display the contents of that file
+ 
+-        Usage:
+-            archdisp('archive101.arch')
++    Usage:
++        archdisp('archive101.arch')
+     """
+     try:
+         if path.isfile(filename):
+@@ -96,7 +95,7 @@
+         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
++        # go to next result
+         result = read_field(fid)
+     # close file
+     fid.close()
+@@ -105,9 +104,8 @@
+ 
+ # Helper functions
+ def write_field_name(fid, data):  # {{{
++    """Routine to write field name (variable name) to an archive file.
+     """
+-    Routine to write field name (variable name) to an archive file.
+-    """
+     # write the length of the record
+     # length to write + string size (len) + format code
+     reclen = len(data) + 4 + 4
+@@ -124,9 +122,8 @@
+ 
+ 
+ def write_scalar(fid, data):  # {{{
++    """Procedure to write a double to an arch file pointed to by fid
+     """
+-    Procedure to write a double to an arch file pointed to by fid
+-    """
+     # write length of record
+     # double (8 bytes) + format code (4 bytes)
+     reclen = 8 + 4
+@@ -140,9 +137,8 @@
+ 
+ 
+ def write_vector(fid, data):  # {{{
++    """Procedure to write a np.array to an arch file
+     """
+-    Procedure to write a np.array to an arch file
+-    """
+     # Make sure our vector is the correct shape.
+     # Reshape it into a row vector if it is not correct.
+     if isinstance(data, (bool, int, float)):
+@@ -160,7 +156,7 @@
+     # 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:
++    if reclen > pow(2, 31):
+         raise ValueError("archwrite error : can not write vector to binary file because it is too large")
+     fid.write(struct.pack('>i', reclen))
+     # write format code
+@@ -175,18 +171,19 @@
+ 
+ 
+ def read_field(fid):  # {{{
++    """Procedure to read a field and return a results list with the following 
++    attributes:
++
++        result['field_name']    -> the name of the variable that was just read
++        result['size']          -> size (dimensions) of the variable just read
++        result['data_type']     -> the type of data that was just read
++        result['data']          -> the actual data
+     """
+-    Procedure to read a field and return a results list with the following attributes:
+-    result['field_name']     -> the name of the variable that was just read
+-    result['size']             -> size (dimensions) of the variable just read
+-    result['data_type']     -> the type of data that was just read
+-    result['data']             -> the actual data
+-    """
+ 
+     try:
+         # first, read the string
+-        #first read the size and continue reading
+-        struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]  #name length
++        # first read the size and continue reading
++        struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]  # name length
+         check_name = struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]
+         if check_name != 1:
+             raise ValueError('archread error : a string was not present at the start of the arch file')
+@@ -193,8 +190,8 @@
+         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
++        # 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:
+@@ -234,23 +231,20 @@
+     # }}}
+ 
+ 
+-def format_archive_code(format):  # {{{
+-    """
+-    Given a variable, determine it's type and return
+-    an integer value:
++def format_archive_code(var):  # {{{
++    """Given a variable, determine it's type and return an integer value:
+ 
+-    1 : string
+-    2 : double (scalar)
+-    3 : vector or matrix (of type double)
+-
++        1 : string
++        2 : double (scalar)
++        3 : vector or matrix (of type double)
+     """
+-    if isinstance(format, str):
++    if isinstance(var, str):
+         code = 1
+-    elif format.shape[0] == 1 and format.shape[1] == 1:
++    elif var.shape[0] == 1 and var.shape[1] == 1:
+         code = 2
+-    elif isinstance(format, (list, tuple, np.ndarray)):
++    elif isinstance(var, (list, tuple, np.ndarray)):
+         code = 3
+     else:
+-        raise TypeError("archwrite error: data type '%s' is not valid." % type(format))
++        raise TypeError('archwrite error: data type {} is not valid.'.format(type(var)))
+     return code
+     # }}}
+Index: ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26357)
++++ ../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py	(revision 26358)
+@@ -10,50 +10,50 @@
+     See also: SETICESHELFBC, SETMARINEICESHEETBC
+     """
+ 
+-    #node on Dirichlet
++    # node on Dirichlet
+     pos = np.nonzero(md.mesh.vertexonboundary)
+-    md.stressbalance.spcvx = float('nan') * np.ones((md.mesh.numberofvertices))
+-    md.stressbalance.spcvy = float('nan') * np.ones((md.mesh.numberofvertices))
+-    md.stressbalance.spcvz = float('nan') * np.ones((md.mesh.numberofvertices))
++    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
++    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
++    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
+     md.stressbalance.spcvx[pos] = 0
+     md.stressbalance.spcvy[pos] = 0
+     md.stressbalance.spcvz[pos] = 0
+-    md.stressbalance.referential = float('nan') * np.ones((md.mesh.numberofvertices, 6))
++    md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
+     md.stressbalance.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
+ 
+-    #Dirichlet Values
++    # Dirichlet Values
+     if isinstance(md.inversion.vx_obs, np.ndarray) and np.size(md.inversion.vx_obs, axis=0) == md.mesh.numberofvertices and isinstance(md.inversion.vy_obs, np.ndarray) and np.size(md.inversion.vy_obs, axis=0) == md.mesh.numberofvertices:
+-        print("      boundary conditions for stressbalance model: spc set as observed velocities")
++        print('      boundary conditions for stressbalance model: spc set as observed velocities')
+         md.stressbalance.spcvx[pos] = md.inversion.vx_obs[pos]
+         md.stressbalance.spcvy[pos] = md.inversion.vy_obs[pos]
+     else:
+-        print("      boundary conditions for stressbalance model: spc set as zero")
++        print('      boundary conditions for stressbalance model: spc set as zero')
+ 
+-    #No ice front -> do nothing
++    # No ice front -> do nothing
+ 
+-    #Initialize surface and basal forcings
++    # Initialize surface and basal forcings
+     md.smb.initialize(md)
+     md.basalforcings.initialize(md)
+ 
+-    #Initialize ocean forcings and sealevel
++    # Initialize ocean forcings and sealevel
+     md.dsl.initialize(md)
+ 
+-    #Deal with other boundary conditions
++    # Deal with other boundary conditions
+     if np.all(np.isnan(md.balancethickness.thickening_rate)):
+         md.balancethickness.thickening_rate = np.zeros((md.mesh.numberofvertices))
+-        print("      no balancethickness.thickening_rate specified: values set as zero")
+-    md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+-    md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+-    md.damage.spcdamage = float('nan') * np.ones((md.mesh.numberofvertices))
++        print('      no balancethickness.thickening_rate specified: values set as zero')
++    md.masstransport.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
++    md.balancethickness.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
++    md.damage.spcdamage = np.nan * np.ones((md.mesh.numberofvertices))
+ 
+     if isinstance(md.initialization.temperature, np.ndarray) and np.size(md.initialization.temperature, axis=0) == md.mesh.numberofvertices:
+-        md.thermal.spctemperature = float('nan') * np.ones((md.mesh.numberofvertices))
++        md.thermal.spctemperature = np.nan * np.ones((md.mesh.numberofvertices))
+         if hasattr(md.mesh, 'vertexonsurface'):
+             pos = np.nonzero(md.mesh.vertexonsurface)[0]
+-            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  #impose observed temperature on surface
++            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  # impose observed temperature on surface
+         if not isinstance(md.basalforcings.geothermalflux, np.ndarray) or not np.size(md.basalforcings.geothermalflux) == md.mesh.numberofvertices:
+-            md.basalforcings.geothermalflux = 50. * 10**-3 * np.ones((md.mesh.numberofvertices))  #50 mW / m^2
++            md.basalforcings.geothermalflux = 50.0 * pow(10, -3) * np.ones((md.mesh.numberofvertices))  # 50 mW/m^2
+     else:
+-        print("      no thermal boundary conditions created: no observed temperature found")
++        print('      no thermal boundary conditions created: no observed temperature found')
+ 
+     return md
+Index: ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26357)
++++ ../trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 26358)
+@@ -23,46 +23,46 @@
+     """
+     #node on Dirichlet (boundary and ~icefront)
+     if icefrontfile:
+-        #User provided Front.exp, use it
++        # User provided Front.exp, use it
+         if not os.path.exists(icefrontfile):
+-            raise IOError("SetMarineIceSheetBC error message: ice front file '%s' not found." % icefrontfile)
++            raise IOError('SetMarineIceSheetBC error message: ice front file \'{}\' not found.'.format(icefrontfile))
+         incontour = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, icefrontfile, 'node', 2)
+         vertexonicefront = np.logical_and(md.mesh.vertexonboundary, incontour.reshape(-1))
+     else:
+-        #Guess where the ice front is
++        # Guess where the ice front is
+         vertexonfloatingice = np.zeros((md.mesh.numberofvertices))
+-        pos = np.nonzero(np.sum(md.mask.ocean_levelset[md.mesh.elements - 1] < 0., axis=1) > 0.)[0]
++        pos = np.nonzero(np.sum(md.mask.ocean_levelset[md.mesh.elements - 1] < 0.0, axis=1) > 0.0)[0]
+         vertexonfloatingice[md.mesh.elements[pos].astype(int) - 1] = 1.
+-        vertexonicefront = np.logical_and(np.reshape(md.mesh.vertexonboundary, (-1, )), vertexonfloatingice > 0.)
++        vertexonicefront = np.logical_and(np.reshape(md.mesh.vertexonboundary, (-1, )), vertexonfloatingice > 0.0)
+ 
+     #pos = find(md.mesh.vertexonboundary & ~vertexonicefront)
+     pos = np.nonzero(np.logical_and(md.mesh.vertexonboundary, np.logical_not(vertexonicefront)))[0]
+     if not np.size(pos):
+-        print("Warning: SetMarineIceSheetBC.py: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.")
++        print('Warning: SetMarineIceSheetBC.py: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.')
+ 
+-    md.stressbalance.spcvx = float('nan') * np.ones(md.mesh.numberofvertices)
+-    md.stressbalance.spcvy = float('nan') * np.ones(md.mesh.numberofvertices)
+-    md.stressbalance.spcvz = float('nan') * np.ones(md.mesh.numberofvertices)
+-    md.stressbalance.referential = float('nan') * np.ones((md.mesh.numberofvertices, 6))
++    md.stressbalance.spcvx = np.nan * np.ones(md.mesh.numberofvertices)
++    md.stressbalance.spcvy = np.nan * np.ones(md.mesh.numberofvertices)
++    md.stressbalance.spcvz = np.nan * np.ones(md.mesh.numberofvertices)
++    md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
+     md.stressbalance.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
+ 
+-    #Position of ice front
++    # Position of ice front
+     pos = np.nonzero(vertexonicefront)[0]
+     md.mask.ice_levelset[pos] = 0
+ 
+-    #First find segments that are not completely on the front
++    # First find segments that are not completely on the front
+     if md.mesh.elementtype() == 'Penta':
+         numbernodesfront = 4
+     elif md.mesh.elementtype() == 'Tria':
+         numbernodesfront = 2
+     else:
+-        raise Exception("Mesh type not supported")
++        raise Exception('Mesh type not supported')
+     if any(md.mask.ice_levelset <= 0):
+         values = md.mask.ice_levelset[md.mesh.segments[:, 0:-1] - 1]
+         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
++        # 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]
+@@ -70,13 +70,13 @@
+     md.stressbalance.spcvy[pos] = 0
+     md.stressbalance.spcvz[pos] = 0
+ 
+-    #Dirichlet Values
++    # Dirichlet Values
+     if isinstance(md.inversion.vx_obs, np.ndarray) and np.size(md.inversion.vx_obs, axis=0) == md.mesh.numberofvertices and isinstance(md.inversion.vy_obs, np.ndarray) and np.size(md.inversion.vy_obs, axis=0) == md.mesh.numberofvertices:
+-        print("      boundary conditions for stressbalance model: spc set as observed velocities")
++        print('      boundary conditions for stressbalance model: spc set as observed velocities')
+         md.stressbalance.spcvx[pos] = md.inversion.vx_obs[pos]
+         md.stressbalance.spcvy[pos] = md.inversion.vy_obs[pos]
+     else:
+-        print("      boundary conditions for stressbalance model: spc set as zero")
++        print('      boundary conditions for stressbalance model: spc set as zero')
+ 
+     md.hydrology.spcwatercolumn = np.zeros((md.mesh.numberofvertices, 2))
+     pos = np.nonzero(md.mesh.vertexonboundary)[0]
+@@ -89,21 +89,21 @@
+     #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")
++        print('      no balancethickness.thickening_rate specified: values set as zero')
+ 
+-    md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+-    md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+-    md.damage.spcdamage = float('nan') * np.ones((md.mesh.numberofvertices))
++    md.masstransport.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
++    md.balancethickness.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
++    md.damage.spcdamage = np.nan * np.ones((md.mesh.numberofvertices))
+ 
+     if isinstance(md.initialization.temperature, np.ndarray) and np.size(md.initialization.temperature, axis=0) == md.mesh.numberofvertices:
+-        md.thermal.spctemperature = float('nan') * np.ones((md.mesh.numberofvertices))
++        md.thermal.spctemperature = np.nan * np.ones((md.mesh.numberofvertices))
+         if hasattr(md.mesh, 'vertexonsurface'):
+             pos = np.nonzero(md.mesh.vertexonsurface)[0]
+-            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  #impose observed temperature on surface
++            md.thermal.spctemperature[pos] = md.initialization.temperature[pos]  # impose observed temperature on surface
+         if not isinstance(md.basalforcings.geothermalflux, np.ndarray) or not np.size(md.basalforcings.geothermalflux, axis=0) == md.mesh.numberofvertices:
+             md.basalforcings.geothermalflux = np.zeros((md.mesh.numberofvertices))
+-            md.basalforcings.geothermalflux[np.nonzero(md.mask.ocean_levelset > 0.)] = 50. * 10.**- 3  #50mW / m2
++            md.basalforcings.geothermalflux[np.nonzero(md.mask.ocean_levelset > 0.0)] = 50.0 * pow(10.0, -3)  # 50mW/m2
+     else:
+-        print("      no thermal boundary conditions created: no observed temperature found")
++        print('      no thermal boundary conditions created: no observed temperature found')
+ 
+     return md
+Index: ../trunk-jpl/src/m/classes/SMBforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBforcing.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/SMBforcing.py	(revision 26358)
+@@ -18,6 +18,7 @@
+         self.steps_per_step = 1
+         self.requested_outputs = []
+         self.averaging = 0
++        self.isclimatology = np.nan
+ 
+         nargs = len(args)
+         if nargs == 0:
+@@ -30,11 +31,11 @@
+         s = '   surface forcings parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
+         s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+         s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+         s += '\t\t{}\n'.format('0: Arithmetic (default)')
+         s += '\t\t{}\n'.format('1: Geometric')
+         s += '\t\t{}\n'.format('2: Harmonic')
+-        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+         return s
+     #}}}
+ 
+@@ -50,7 +51,7 @@
+     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")
++            print("      no smb.mass_balance specified: values set as zero")
+         return self
+     #}}}
+ 
+@@ -70,7 +71,7 @@
+     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, 'class', 'smb', 'fieldname', 'mass_balance', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
+ 
+Index: ../trunk-jpl/src/m/classes/SMBgemb.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26358)
+@@ -121,7 +121,8 @@
+ 		averaging = 0;
+ 		requested_outputs      = {};
+ 
+-		%Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM.
++		%Several fields are missing from the standard GEMB model, which are 
++		%captured intrinsically by ISSM.
+ 		%dateN: that's the last row of the above fields.
+ 		%dt:    included in dateN. Not an input.
+ 		%elev:  this is taken from the ISSM surface itself.
+@@ -138,6 +139,109 @@
+ 					error('constructor not supported: need geometry and mesh to set defaults');
+ 			end
+ 		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)');
++			fielddisplay(self,'isshortwave','run short wave module (default true)');
++			fielddisplay(self,'isthermal','run thermal module (default true)');
++			fielddisplay(self,'isaccumulation','run accumulation module (default true)');
++			fielddisplay(self,'ismelt','run melting  module (default true)');
++			fielddisplay(self,'isdensification','run densification module (default true)');
++			fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)');
++			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change');
++			fielddisplay(self,'Ta','2 m air temperature, in Kelvin');
++			fielddisplay(self,'V','wind speed (m s-1)');
++			fielddisplay(self,'dswrf','downward shortwave radiation flux [W/m^2]');
++			fielddisplay(self,'dswdiffrf','downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]');
++			fielddisplay(self,'dlwrf','downward longwave radiation flux [W/m^2]');
++			fielddisplay(self,'P','precipitation [mm w.e. / m^2]');
++			fielddisplay(self,'eAir','screen level vapor pressure [Pa]');
++			fielddisplay(self,'pAir','surface pressure [Pa]');
++			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) 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] ');
++			fielddisplay(self,'dzMin','initial min vertical allowable grid spacing (default dzMin/2) [m] ');
++			fielddisplay(self,'zMax','initial max model depth (default is min(thickness,250)) [m]');
++			fielddisplay(self,'zMin','initial min model depth (default is min(thickness,130)) [m]');
++			fielddisplay(self,'zY','strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]');
++			fielddisplay(self,'InitDensityScaling',{'initial scaling factor multiplying the density of ice','which describes the density of the snowpack.'});
++			fielddisplay(self,'ThermoDeltaTScaling',{'scaling factor to multiply the thermal diffusion timestep (delta t)'});
++			fielddisplay(self,'outputFreq','output frequency in days (default is monthly, 30)');
++			fielddisplay(self,'adThresh',{'Apply aIdx method to all areas with densities below this value,','or else apply direct input value from aValue, allowing albedo to be altered.'});
++			fielddisplay(self,'aIdx',{'method for calculating albedo and subsurface absorption (default is 1)',...
++				'0: direct input from aValue parameter',...
++				'1: effective grain radius [Gardner & Sharp, 2009]',...
++				'2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',...
++				'3: density and cloud amount [Greuell & Konzelmann, 1994]',...
++				'4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
++
++			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]');
++			fielddisplay(self,'Dini','Initial snow density when restart [kg m-3]');
++			fielddisplay(self,'Reini','Initial grain size when restart [mm]');
++			fielddisplay(self,'Gdnini','Initial grain dendricity when restart [-]');
++			fielddisplay(self,'Gspini','Initial grain sphericity when restart [-]');
++			fielddisplay(self,'ECini','Initial evaporation/condensation when restart [kg m-2]');
++			fielddisplay(self,'Wini','Initial snow water content when restart [kg m-2]');
++			fielddisplay(self,'Aini','Initial albedo when restart [-]');
++			fielddisplay(self,'Adiffini','Initial diffusive radiation albedo when restart (default to 1) [-]');
++			fielddisplay(self,'Tini','Initial snow temperature when restart [K]');
++			fielddisplay(self,'Sizeini','Initial number of layers when restart [-]');
++
++			%additional albedo parameters:
++			fielddisplay(self,'aValue','Albedo forcing at every element');
++			switch self.aIdx
++				case {1 2}
++					fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
++					fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
++					if self.aIdx==1
++						fielddisplay(self,'szaValue','Solar Zenith Angle [degree]');
++						fielddisplay(self,'cotValue','Cloud Optical Thickness');
++						fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]');
++						fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]');
++					end
++				case 3
++					fielddisplay(self,'cldFrac','average cloud amount');
++				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, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]');
++			fielddisplay(self,'denIdx',{'densification model to use (default is 2):',...
++				'1 = emperical model of Herron and Langway (1980)',...
++				'2 = semi-emperical model of Anthern et al. (2010)',...
++				'3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
++				'4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
++				'5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
++				'6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
++				'7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
++			fielddisplay(self,'dsnowIdx',{'model for fresh snow accumulation density (default is 1):',...
++				'0 = Original GEMB value, 150 kg/m^3',...
++				'1 = Antarctica value of fresh snow density, 350 kg/m^3',...
++				'2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',...
++				'3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
++				'4 = Greenland model of Kuipers Munneke et al. (2015)'});
++
++			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
++			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
++			disp(sprintf('%51s  0: Arithmetic (default)',' '));
++			disp(sprintf('%51s  1: Geometric',' '));
++			disp(sprintf('%51s  2: Harmonic',' '));
++			fielddisplay(self,'requested_outputs','additional outputs requested');
++
++
++		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 
+ 			self.Ta=project3d(md,'vector',self.Ta,'type','element');
+@@ -340,109 +444,6 @@
+ 			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)');
+-			fielddisplay(self,'isshortwave','run short wave module (default true)');
+-			fielddisplay(self,'isthermal','run thermal module (default true)');
+-			fielddisplay(self,'isaccumulation','run accumulation module (default true)');
+-			fielddisplay(self,'ismelt','run melting  module (default true)');
+-			fielddisplay(self,'isdensification','run densification module (default true)');
+-			fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)');
+-			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change');
+-			fielddisplay(self,'Ta','2 m air temperature, in Kelvin');
+-			fielddisplay(self,'V','wind speed (m s-1)');
+-			fielddisplay(self,'dswrf','downward shortwave radiation flux [W/m^2]');
+-			fielddisplay(self,'dswdiffrf','downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]');
+-			fielddisplay(self,'dlwrf','downward longwave radiation flux [W/m^2]');
+-			fielddisplay(self,'P','precipitation [mm w.e. / m^2]');
+-			fielddisplay(self,'eAir','screen level vapor pressure [Pa]');
+-			fielddisplay(self,'pAir','surface pressure [Pa]');
+-			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) 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] ');
+-			fielddisplay(self,'dzMin','initial min vertical allowable grid spacing (default dzMin/2) [m] ');
+-			fielddisplay(self,'zMax','initial max model depth (default is min(thickness,250)) [m]');
+-			fielddisplay(self,'zMin','initial min model depth (default is min(thickness,130)) [m]');
+-			fielddisplay(self,'zY','strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]');
+-			fielddisplay(self,'InitDensityScaling',{'initial scaling factor multiplying the density of ice','which describes the density of the snowpack.'});
+-			fielddisplay(self,'ThermoDeltaTScaling',{'scaling factor to multiply the thermal diffusion timestep (delta t)'});
+-			fielddisplay(self,'outputFreq','output frequency in days (default is monthly, 30)');
+-			fielddisplay(self,'adThresh',{'Apply aIdx method to all areas with densities below this value,','or else apply direct input value from aValue, allowing albedo to be altered.'});
+-			fielddisplay(self,'aIdx',{'method for calculating albedo and subsurface absorption (default is 1)',...
+-				'0: direct input from aValue parameter',...
+-				'1: effective grain radius [Gardner & Sharp, 2009]',...
+-				'2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',...
+-				'3: density and cloud amount [Greuell & Konzelmann, 1994]',...
+-				'4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
+-
+-			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]');
+-			fielddisplay(self,'Dini','Initial snow density when restart [kg m-3]');
+-			fielddisplay(self,'Reini','Initial grain size when restart [mm]');
+-			fielddisplay(self,'Gdnini','Initial grain dendricity when restart [-]');
+-			fielddisplay(self,'Gspini','Initial grain sphericity when restart [-]');
+-			fielddisplay(self,'ECini','Initial evaporation/condensation when restart [kg m-2]');
+-			fielddisplay(self,'Wini','Initial snow water content when restart [kg m-2]');
+-			fielddisplay(self,'Aini','Initial albedo when restart [-]');
+-			fielddisplay(self,'Adiffini','Initial diffusive radiation albedo when restart (default to 1) [-]');
+-			fielddisplay(self,'Tini','Initial snow temperature when restart [K]');
+-			fielddisplay(self,'Sizeini','Initial number of layers when restart [-]');
+-
+-			%additional albedo parameters:
+-			fielddisplay(self,'aValue','Albedo forcing at every element');
+-			switch self.aIdx
+-				case {1 2}
+-					fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
+-					fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
+-					if self.aIdx==1
+-						fielddisplay(self,'szaValue','Solar Zenith Angle [degree]');
+-						fielddisplay(self,'cotValue','Cloud Optical Thickness');
+-						fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]');
+-						fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]');
+-					end
+-				case 3
+-					fielddisplay(self,'cldFrac','average cloud amount');
+-				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, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]');
+-			fielddisplay(self,'denIdx',{'densification model to use (default is 2):',...
+-				'1 = emperical model of Herron and Langway (1980)',...
+-				'2 = semi-emperical model of Anthern et al. (2010)',...
+-				'3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
+-				'4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
+-				'5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
+-				'6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
+-				'7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
+-			fielddisplay(self,'dsnowIdx',{'model for fresh snow accumulation density (default is 1):',...
+-				'0 = Original GEMB value, 150 kg/m^3',...
+-				'1 = Antarctica value of fresh snow density, 350 kg/m^3',...
+-				'2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',...
+-				'3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
+-				'4 = Greenland model of Kuipers Munneke et al. (2015)'});
+-
+-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+-			disp(sprintf('%51s  1: Geometric',' '));
+-			disp(sprintf('%51s  2: Harmonic',' '));
+-			fielddisplay(self,'requested_outputs','additional outputs requested');
+-
+-
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			yts=md.constants.yts;
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 26358)
+@@ -9,9 +9,9 @@
+ 		evaporation = NaN;
+ 		melt = NaN;
+ 		refreeze = NaN;
+-		steps_per_step=1;
++		steps_per_step = 1;
+ 		averaging = 0;
+-		requested_outputs      = {};
++		requested_outputs= {};
+ 		isclimatology;
+ 	end
+ 	methods
+@@ -22,6 +22,19 @@
+ 					error('constructor not supported');
+ 			end
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :'));
++			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
++			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
++			fielddisplay(self,'melt','amount of ice melt in ice column [m/yr ice eq]');
++			fielddisplay(self,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
++			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
++			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
++			disp(sprintf('%51s  0: Arithmetic (default)',' '));
++			disp(sprintf('%51s  1: Geometric',' '));
++			disp(sprintf('%51s  2: Harmonic',' '));
++			fielddisplay(self,'requested_outputs','additional outputs requested');
++		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 
+ 			self.accumulation=project3d(md,'vector',self.accumulation,'type','node');
+@@ -71,19 +84,6 @@
+ 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+ 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :'));
+-			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
+-			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
+-			fielddisplay(self,'melt','amount of ice melt in ice column [m/yr ice eq]');
+-			fielddisplay(self,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
+-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+-			disp(sprintf('%51s  1: Geometric',' '));
+-			disp(sprintf('%51s  2: Harmonic',' '));
+-			fielddisplay(self,'requested_outputs','additional outputs requested');
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			yts=md.constants.yts;
+Index: ../trunk-jpl/src/m/classes/basalforcings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcings.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/basalforcings.m	(revision 26358)
+@@ -10,11 +10,6 @@
+ 		geothermalflux            = NaN;
+ 	end
+ 	methods
+-		function self = extrude(self,md) % {{{
+-			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
+-			self.floatingice_melting_rate=project3d(md,'vector',self.floatingice_melting_rate,'type','node','layer',1); 
+-			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
+-		end % }}}
+ 		function self = basalforcings(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -23,6 +18,19 @@
+ 					error('constructor not supported');
+ 			end
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   basal forcings parameters:'));
++
++			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
++			fielddisplay(self,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
++			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
++
++		end % }}}
++		function self = extrude(self,md) % {{{
++			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1); 
++			self.floatingice_melting_rate=project3d(md,'vector',self.floatingice_melting_rate,'type','node','layer',1); 
++			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
++		end % }}}
+ 		function self = initialize(self,md) % {{{
+ 
+ 			if isnan(self.groundedice_melting_rate),
+@@ -55,22 +63,14 @@
+ 				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
+ 			end
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   basal forcings parameters:'));
+-
+-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
+-			fielddisplay(self,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
+-			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
+-
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			yts=md.constants.yts;
+ 
+ 			WriteData(fid,prefix,'name','md.basalforcings.model','data',1,'format','Integer');
+-			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+-			WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+-			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts)
++			WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts)
++			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 		
+Index: ../trunk-jpl/src/m/classes/basalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcings.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/basalforcings.py	(revision 26358)
+@@ -22,9 +22,9 @@
+     #}}}
+     def __repr__(self):  # {{{
+         s = '   basal forcings parameters:\n'
+-        s += '{}\n'.format(fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
+-        s += '{}\n'.format(fielddisplay(self, "floatingice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
+-        s += '{}\n'.format(fielddisplay(self, "geothermalflux", "geothermal heat flux [W / m^2]"))
++        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'geothermalflux', 'geothermal heat flux [W/m^2]'))
+         return s
+     #}}}
+     def extrude(self, md):  # {{{
+@@ -36,10 +36,10 @@
+     def initialize(self, md):  # {{{
+         if np.all(np.isnan(self.groundedice_melting_rate)):
+             self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+-            print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
++            print('      no basalforcings.groundedice_melting_rate specified: values set as zero')
+         if np.all(np.isnan(self.floatingice_melting_rate)):
+             self.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+-            print("      no basalforcings.floatingice_melting_rate specified: values set as zero")
++            print('      no basalforcings.floatingice_melting_rate specified: values set as zero')
+         return self
+     #}}}
+     def setdefaultparameters(self):  # {{{
+@@ -61,7 +61,7 @@
+     def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 1, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+     # }}}
+Index: ../trunk-jpl/src/m/classes/clusters/generic.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/clusters/generic.py	(revision 26358)
+@@ -56,7 +56,7 @@
+     # }}}
+ 
+     def __repr__(self):  # {{{
+-        #  display the object
++        # Display the object
+         s = 'class \'{}\' object \'{}\' = \n'.format(type(self), 'self')
+         s += '    name: {}\n'.format(self.name)
+         s += '    login: {}\n'.format(self.login)
+@@ -182,7 +182,7 @@
+                           (self.codepath, solution, self.executionpath, modelname, modelname, modelname, modelname))
+             fid.close()
+ 
+-        #in interactive mode, create a run file, and errlog and outlog file
++        # In interactive mode, create a run file, and errlog and outlog file
+         if self.interactive:
+             fid = open(modelname + '.errlog', 'w')
+             fid.close()
+@@ -191,7 +191,7 @@
+     # }}}
+ 
+     def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+-        #compress the files into one zip.
++        # Compress the files into one zip
+         compressstring = 'tar -zcf {}.tar.gz '.format(dirname)
+         for file in filelist:
+             compressstring += ' {}'.format(file)
+@@ -218,9 +218,9 @@
+ 
+     def Download(self, dirname, filelist):  # {{{
+         if ispc():
+-            #do nothing
++            # Do nothing
+             return
+-        #copy files from cluster to current directory
++        # Copy files from cluster to current directory
+         directory = '{}/{}/'.format(self.executionpath, dirname)
+         issmscpin(self.name, self.login, self.port, directory, filelist)
+     # }}}
+Index: ../trunk-jpl/src/m/classes/constants.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/constants.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/constants.py	(revision 26358)
+@@ -1,11 +1,10 @@
++from checkfield import checkfield
+ from fielddisplay import fielddisplay
+-from checkfield import checkfield
+ from WriteData import WriteData
+ 
+ 
+ class constants(object):
+-    """
+-    CONSTANTS class definition
++    """CONSTANTS class definition
+ 
+        Usage:
+           constants = constants()
+@@ -22,36 +21,34 @@
+         self.setdefaultparameters()
+     #}}}
+     def __repr__(self):  # {{{
+-        string = "   constants parameters:"
+-
+-        string = "%s\n%s" % (string, fielddisplay(self, "g", "gravitational acceleration [m / s^2]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "omega", "angular velocity of Earth [rad / s]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "yts", "number of seconds in a year [s / yr]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "referencetemperature", "reference temperature used in the enthalpy model [K]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "gravitational_constant", "Newtonian constant of gravitation [m^3/kg/s^2]"))
+-
+-        return string
++        s = '   constants parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'g', 'gravitational acceleration [m/s^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'omega', 'angular velocity of Earth [rad/s]'))
++        s += '{}\n'.format(fielddisplay(self, 'yts', 'number of seconds in a year [s/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'referencetemperature', 'reference temperature used in the enthalpy model [K]'))
++        s += '{}\n'.format(fielddisplay(self, 'gravitational_constant', 'Newtonian constant of gravitation [m^3/kg/s^2]'))
++        return s
+     #}}}
+     def setdefaultparameters(self):  # {{{
+-        #acceleration due to gravity (m / s^2)
++        # Acceleration due to gravity (m / s^2)
+         self.g = 9.81
+ 
+-        #Earth's rotation speed
++        # Earth's rotation speed
+         self.omega = 7.292 * 1e-5
+ 
+-        #converstion from year to seconds
+-        self.yts = 365. * 24. * 3600.
++        # Converstion from year to seconds
++        self.yts = 365.0 * 24.0 * 3600.0
+ 
+-        #the reference temperature for enthalpy model (cf Aschwanden)
++        # The reference temperature for enthalpy model (cf Aschwanden)
+         self.referencetemperature = 223.15
+ 
+-        #gravitational constant:
++        # Gravitational constant:
+         self.gravitational_constant = 6.67259e-11
+ 
+         return self
+     #}}}
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        md = checkfield(md, 'fieldname', 'constants.g', '>=', 0, 'size', [1])
++        md = checkfield(md, 'fieldname', 'constants.g', '>=', 0, 'size', [1]) # We allow 0 for validation tests
+         md = checkfield(md, 'fieldname', 'constants.omega', '>=', 0, 'size', [1])
+         md = checkfield(md, 'fieldname', 'constants.yts', '>', 0, 'size', [1])
+         md = checkfield(md, 'fieldname', 'constants.referencetemperature', 'size', [1])
+Index: ../trunk-jpl/src/m/classes/dsl.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/dsl.m	(revision 26358)
+@@ -40,9 +40,9 @@
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember('SealevelchangeAnalysis',analyses), return; end
+-			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+-			if (md.transient.isoceantransport==0) return;end
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc == 0) | (md.transient.isoceantransport==0),
++				return;
++			end
+ 			md = checkfield(md,'fieldname','dsl.global_average_thermosteric_sea_level','NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','dsl.sea_surface_height_above_geoid','NaN',1,'Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','dsl.sea_water_pressure_at_sea_floor','NaN',1,'Inf',1,'timeseries',1);
+Index: ../trunk-jpl/src/m/classes/dslmme.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/dslmme.m	(revision 26358)
+@@ -34,9 +34,9 @@
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+ 			%Early return
+-			if ~ismember('SealevelchangeAnalysis',analyses), return; end
+-			if (strcmp(solution,'TransientSolution') & md.transient.isslc == 0), return; end
+-			if (md.transient.isoceantransport==0) return;end
++			if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc == 0) | (md.transient.isoceantransport==0),
++				return;
++			end
+ 			for i=1:length(self.global_average_thermosteric_sea_level),
+ 				md = checkfield(md,'field',self.global_average_thermosteric_sea_level{i},'NaN',1,'Inf',1);
+ 				md = checkfield(md,'field',self.sea_surface_height_above_geoid{i},'NaN',1,'Inf',1,'timeseries',1);
+Index: ../trunk-jpl/src/m/classes/dslmme.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dslmme.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/dslmme.py	(revision 26358)
+@@ -12,10 +12,10 @@
+     """
+ 
+     def __init__(self, *args):  #{{{
+-        self.modelid = 0  # Index into the multi-model ensemble
+-        self.global_average_thermosteric_sea_level = []  # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
+-        self.sea_surface_height_above_geoid = []  # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
+-        self.sea_water_pressure_at_sea_floor = []  #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
++        self.modelid = 0  # Index into the multi-model ensemble, determine which field will be used
++        self.global_average_thermosteric_sea_level = [] # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.
++        self.sea_surface_height_above_geoid = [] # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m) for each ensemble.
++        self.sea_water_pressure_at_sea_floor = [] #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!) for each ensemble.
+ 
+         nargs = len(args)
+ 
+@@ -40,7 +40,7 @@
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         # Early return
+-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (not md.transient.isoceantransport):
+             return md
+ 
+         for i in range(len(self.global_average_thermosteric_sea_level)):
+@@ -59,9 +59,9 @@
+         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 2, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'modelid', 'format', 'Double')
+         WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level), 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1)
+     #}}}
+ 
+     def extrude(self, md):  #{{{
+Index: ../trunk-jpl/src/m/classes/fourierlove.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/fourierlove.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/fourierlove.py	(revision 26358)
+@@ -37,20 +37,23 @@
+     #}}}
+ 
+     def __repr__(self): #{{{
++        # TODO:
++        # - Correct display to match MATLAB
++        #
+         s = '   Fourier Love class:\n'
+         s += '{}\n'.format(fielddisplay(self, 'nfreq', 'number of frequencies sampled (default: 1, elastic) [Hz]'))
+         s += '{}\n'.format(fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
+         s += '{}\n'.format(fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)'))
+         s += '{}\n'.format(fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default: 1)'))
+-        s += '{}\n'.format(fielddisplay(self, 'g0', 'adimensioning constant for gravity (default: 10) [m / s^2]'))
+-        s += '{}\n'.format(fielddisplay(self, 'r0', 'adimensioning constant for radius (default: 6378e3) [m]'))
+-        s += '{}\n'.format(fielddisplay(self, 'mu0', 'adimensioning constant for stress (default: 1.0e11) [Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'g0', 'adimensioning constant for gravity (default: 10) [m/s^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'r0', 'adimensioning constant for radius (default: 6371*10^3) [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'mu0', 'adimensioning constant for stress (default: 10^11) [Pa]'))
+         s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
+         s += '{}\n'.format(fielddisplay(self, 'Gravitational_Constant', 'Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])'))
+         s += '{}\n'.format(fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'))
+         s += '{}\n'.format(fielddisplay(self, 'underflow_tol', 'threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)'))
+         s += '{}\n'.format(fielddisplay(self, 'integration_steps_per_layer', 'number of radial steps to propagate the yi system from the bottom to the top of each layer (default: 100)'))
+-        s += '{}\n'.format(fielddisplay(self, 'istemporal', {'1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency'}))
++        s += '{}\n'.format(fielddisplay(self, 'istemporal', ['1 for time-dependent love numbers, 0 for frequency-dependent or elastic love numbers (default: 0)', 'If 1: use fourierlove function build_frequencies_from_time to meet consistency']))
+         s += '{}\n'.format(fielddisplay(self, 'n_temporal_iterations', 'max number of iterations in the inverse Laplace transform. Also the number of spectral samples per time step requested (default: 8)'))
+         s += '{}\n'.format(fielddisplay(self, 'time', 'time vector for deformation if istemporal (default: 0) [s]'))
+         s += '{}\n'.format(fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default: 0)'))
+@@ -120,7 +123,7 @@
+         if md.love.istemporal:
+             md = checkfield(md, 'fieldname', 'love.n_temporal_iterations', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0)
+             md = checkfield(md, 'fieldname', 'love.time', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq / 2 / md.love.n_temporal_iterations)
+-        if md.love.sh_nmin <= 1 and (md.love.forcing_type == 1 or md.love.forcing_type == 5 or md.love.forcing_type == 9):
++        if md.love.sh_nmin <= 1 and (md.love.forcing_type == 9 or md.love.forcing_type == 5 or md.love.forcing_type == 1):
+             raise RuntimeError('Degree 1 not supported for forcing type {}. Use sh_min >= 2 for this kind of calculation.'.format(md.love.forcing_type))
+ 
+         # Need 'litho' material
+Index: ../trunk-jpl/src/m/classes/geometry.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/geometry.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/geometry.py	(revision 26358)
+@@ -13,7 +13,7 @@
+         geometry = geometry()
+     """
+ 
+-    def __init__(self, *args): #{{{
++    def __init__(self, *args):  # {{{
+         self.surface = np.nan
+         self.thickness = np.nan
+         self.base = np.nan
+@@ -24,9 +24,9 @@
+             self.setdefaultparameters()
+         else:
+             raise Exception('constructor not supported')
+-    #}}}
++    # }}}
+ 
+-    def __repr__(self): #{{{
++    def __repr__(self):  # {{{
+         s = '   geometry parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'surface', 'ice upper surface elevation [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'thickness', 'ice thickness [m]'))
+@@ -33,13 +33,13 @@
+         s += '{}\n'.format(fielddisplay(self, 'base', 'ice base elevation [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'bed', 'bed elevation [m]'))
+         return s
+-    #}}}
++    # }}}
+ 
+-    def setdefaultparameters(self): #{{{
++    def setdefaultparameters(self):  # {{{
+         return
+-    #}}}
++    # }}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         if solution == 'LoveSolution':
+             return md
+         else:
+@@ -59,12 +59,12 @@
+         return md
+     # }}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  # {{{
+         length_thickness = len(self.thickness)
+         if (length_thickness == md.mesh.numberofvertices) or (length_thickness == md.mesh.numberofvertices + 1):
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+         elif (length_thickness == md.mesh.numberofelements) or (length_thickness == md.mesh.numberofelements + 1):
+-            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+         else:
+             raise RuntimeError('geometry thickness time series should be a vertex or element time series')
+ 
+@@ -74,7 +74,7 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'hydrostatic_ratio', 'format', 'DoubleMat', 'mattype', 1)
+     # }}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  # {{{
+         self.surface = project3d(md, 'vector', self.surface, 'type', 'node')
+         self.thickness = project3d(md, 'vector', self.thickness, 'type', 'node')
+         self.hydrostatic_ratio = project3d(md, 'vector', self.hydrostatic_ratio, 'type', 'node')
+@@ -81,4 +81,4 @@
+         self.base = project3d(md, 'vector', self.base, 'type', 'node')
+         self.bed = project3d(md, 'vector', self.bed, 'type', 'node')
+         return self
+-    #}}}
++    # }}}
+Index: ../trunk-jpl/src/m/classes/groundingline.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/groundingline.py	(revision 26358)
+@@ -1,8 +1,8 @@
+ import numpy as np
++from checkfield import checkfield
+ from fielddisplay import fielddisplay
+-from checkfield import checkfield
++import MatlabFuncs as m
+ from WriteData import WriteData
+-import MatlabFuncs as m
+ 
+ 
+ class groundingline(object):
+@@ -18,32 +18,29 @@
+         self.friction_interpolation = ''
+         self.melt_interpolation = ''
+ 
+-    #set defaults
++        # Set defaults
+         self.setdefaultparameters()
+ 
+-    #}}}
++    # }}}
+ 
+     def __repr__(self):  # {{{
+-        string = '   grounding line migration parameters:'
++        s = '   grounding line migration parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of grounding line migration: \'SoftMigration\', \'SubelementMigration\', \'AggressiveMigration\', \'Contact\', \'None\''))
++        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of friction interpolation on partially floating elements: ''SubelementFriction1'', ''SubelementFriction2'', ''NoFrictionOnPartiallyFloating'''))
++        s += '{}\n'.format(fielddisplay(self, 'migration', 'type of melt interpolation on partially floating elements: \'SubelementMelt1\', \'SubelementMelt2\', \'NoMeltOnPartiallyFloating\', \'FullMeltOnPartiallyFloating\''))
++        return s
++    # }}}
+ 
+-        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):  # {{{
+-
+-        #Type of migration
++        # Type of migration
+         self.migration = 'SubelementMigration'
+         self.friction_interpolation = 'SubelementFriction1'
+         self.melt_interpolation = 'NoMeltOnPartiallyFloating'
+ 
+         return self
+-    #}}}
++    # }}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-
+         md = checkfield(md, 'fieldname', 'groundingline.migration', 'values', ['None', 'SubelementMigration', 'AggressiveMigration', 'SoftMigration', 'Contact', 'GroundingOnly'])
+         md = checkfield(md, 'fieldname', 'groundingline.friction_interpolation', 'values', ['SubelementFriction1', 'SubelementFriction2', 'NoFrictionOnPartiallyFloating'])
+         md = checkfield(md, 'fieldname', 'groundingline.melt_interpolation', 'values', ['SubelementMelt1', 'SubelementMelt2', 'NoMeltOnPartiallyFloating', 'FullMeltOnPartiallyFloating'])
+@@ -52,9 +49,9 @@
+             if np.any(np.isnan(md.geometry.bed)):
+                 md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
+             pos = np.nonzero(md.mask.ocean_levelset > 0.)[0]
+-            if any(np.abs(md.geometry.base[pos] - md.geometry.bed[pos]) > 10**-10):
++            if any(np.abs(md.geometry.base[pos] - md.geometry.bed[pos]) > pow(10, -10)):
+                 md.checkmessage("base not equal to bed on grounded ice!")
+-            if any(md.geometry.bed - md.geometry.base > 10**-9):
++            if any(md.geometry.bed - md.geometry.base > pow(10, -9)):
+                 md.checkmessage("bed superior to base on floating ice!")
+ 
+         return md
+Index: ../trunk-jpl/src/m/classes/initialization.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/initialization.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/initialization.py	(revision 26358)
+@@ -38,10 +38,10 @@
+     #}}}
+     def __repr__(self): #{{{
+         s = '   initial field values:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'vx', 'x component of velocity [m / yr]'))
+-        s += '{}\n'.format(fielddisplay(self, 'vy', 'y component of velocity [m / yr]'))
+-        s += '{}\n'.format(fielddisplay(self, 'vz', 'z component of velocity [m / yr]'))
+-        s += '{}\n'.format(fielddisplay(self, 'vel', 'velocity norm [m / yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'vx', 'x component of velocity [m/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'vy', 'y component of velocity [m/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'vz', 'z component of velocity [m/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'vel', 'velocity norm [m/yr]'))
+         s += '{}\n'.format(fielddisplay(self, 'pressure', 'pressure [Pa]'))
+         s += '{}\n'.format(fielddisplay(self, 'temperature', 'temperature [K]'))
+         s += '{}\n'.format(fielddisplay(self, 'enthalpy', 'enthalpy [J]'))
+@@ -69,6 +69,8 @@
+         if 'OceantransportAnalysis' in analyses:
+             if solution == 'TransientSolution' and md.transient.isslc and md.transient.isoceantransport:
+                 md = checkfield(md, 'fieldname', 'initialization.bottompressure', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
++                md = checkfield(md, 'fieldname', 'initialization.dsl', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
++                md = checkfield(md, 'fieldname', 'initialization.str', 'NaN', 1, 'Inf', 1, 'size', [1])
+         if 'BalancethicknessAnalysis' in analyses and solution == 'BalancethicknessSolution':
+             md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+             md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+@@ -154,6 +156,8 @@
+         self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
+         self.sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node', 'layer', 1)
+         self.bottompressure = project3d(md, 'vector', self.bottompressure, 'type', 'node', 'layer', 1)
++        self.dsl = project3d(md, 'vector', self.dsl, 'type', 'node', 'layer', 1)
++        self.str = project3d(md, 'vector', self.str, 'type', 'node', 'layer', 1)
+ 
+         # Lithostatic pressure by default
+         if np.ndim(md.geometry.surface) == 2:
+Index: ../trunk-jpl/src/m/classes/issmsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/issmsettings.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/issmsettings.py	(revision 26358)
+@@ -38,22 +38,22 @@
+     #}}}
+ 
+     def setdefaultparameters(self):  # {{{
+-        #are we short in memory ? (0 faster but requires more memory)
++        # Are we short in memory? (0 faster but requires more memory)
+         self.lowmem = 0
+-        #i / o:
++        # I/O:
+         self.io_gather = 1
+-        #results frequency by default every step
++        # Results frequency by default every step
+         self.output_frequency = 1
+-        #coupling frequency of the stress balance solver by default every step
++        # Coupling frequency of the stress balance solver by default every step
+         self.sb_coupling_frequency = 1
+-        #checkpoints frequency, by default never:
++        # Checkpoints frequency, by default never:
+         self.checkpoint_frequency = 0
+-        #this option can be activated to load automatically the results
+-        #onto the model after a parallel run by waiting for the lock file
+-        #N minutes that is generated once the solution has converged
+-        #0 to deactivate
+-        self.waitonlock = 2**31 - 1
+-        #throw an error if solver residue exceeds this value
++        # This option can be activated to load automatically the results onto 
++        # the model after a parallel run by waiting for the lock file N minutes 
++        # that is generated once the solution has converged
++        # Set to 0 to deactivate
++        self.waitonlock = pow(2, 31) - 1
++        # Throw an error if solver residue exceeds this value
+         self.solver_residue_threshold = 1e-6
+ 
+         return self
+Index: ../trunk-jpl/src/m/classes/lovenumbers.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/lovenumbers.py	(revision 26358)
+@@ -80,6 +80,7 @@
+ 
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.th', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk', 'NaN', 1, 'Inf', 1)
++        md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tl', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.tk2secular', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.timefreq', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.lovenumbers.istime', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
+Index: ../trunk-jpl/src/m/classes/matdamageice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matdamageice.m	(revision 26358)
+@@ -94,8 +94,8 @@
+ 			%available: none, paterson and arrhenius
+ 			self.rheology_law='Paterson';
+ 
+-			%SLR
+-			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
++			%SLC
++			self.earth_density= 5512; % average density of the Earth (kg/m^3)
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+Index: ../trunk-jpl/src/m/classes/matenhancedice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matenhancedice.m	(revision 26358)
+@@ -63,7 +63,7 @@
+ 			self.rho_freshwater=1000.;
+ 
+ 			%water viscosity (N.s/m^2)
+-			self.mu_water=0.001787;  
++			self.mu_water=0.001787;
+ 
+ 			%ice heat capacity cp (J/kg/K)
+ 			self.heatcapacity=2093.;
+@@ -79,7 +79,7 @@
+ 
+ 			%computation of effective conductivity
+ 			self.effectiveconductivity_averaging=1;
+-            
++
+ 			%the melting point of ice at 1 atmosphere of pressure in K
+ 			self.meltingpoint=273.15;
+ 
+@@ -96,7 +96,7 @@
+ 			%available: none, paterson and arrhenius
+ 			self.rheology_law='Paterson';
+ 
+-			%SLR
++			%SLC
+ 			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/matenhancedice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matenhancedice.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matenhancedice.py	(revision 26358)
+@@ -1,3 +1,5 @@
++import numpy as np
++
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from project3d import project3d
+@@ -11,110 +13,100 @@
+         matenhancedice = matenhancedice()
+     """
+ 
+-    def __init__(self): #{{{
+-        self.rho_ice = 0.
+-        self.rho_water = 0.
+-        self.rho_freshwater = 0.
+-        self.mu_water = 0.
+-        self.heatcapacity = 0.
+-        self.latentheat = 0.
+-        self.thermalconductivity = 0.
+-        self.temperateiceconductivity = 0.
++    def __init__(self):  # {{{
++        self.rho_ice = 0
++        self.rho_water = 0
++        self.rho_freshwater = 0
++        self.mu_water = 0
++        self.heatcapacity = 0
++        self.latentheat = 0
++        self.thermalconductivity = 0
++        self.temperateiceconductivity = 0
+         self.effectiveconductivity_averaging = 0
+-        self.meltingpoint = 0.
+-        self.beta = 0.
+-        self.mixed_layer_capacity = 0.
+-        self.thermal_exchange_velocity = 0.
+-        self.rheology_E = float('NaN')
+-        self.rheology_B = float('NaN')
+-        self.rheology_n = float('NaN')
++        self.meltingpoint = 0
++        self.beta = 0
++        self.mixed_layer_capacity = 0
++        self.thermal_exchange_velocity = 0
++        self.rheology_E = np.nan
++        self.rheology_B = np.nan
++        self.rheology_n = np.nan
+         self.rheology_law = ''
+ 
+         #SLC
+-        self.earth_density = 0  # average density of the Earth, (kg/m^3)
++        self.earth_density = 0
+ 
+         self.setdefaultparameters()
+-    #}}}
++    # }}}
+ 
+-    def __repr__(self): #{{{
+-        # TODO:
+-        # - Convert all formatting to calls to <string>.format (see any 
+-        #   already converted <class>.__repr__ method for examples)
+-        #
+-        s = "   Materials:"
+-        s = "%s\n%s" % (s, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rho_water", "water density [kg/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mu_water", "water viscosity [N s/m^2]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "heatcapacity", "heat capacity [J/kg/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W/m/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W/m/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "latentheat", "latent heat of fusion [J/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "beta", "rate of change of melting point with pressure [K/Pa]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W/kg/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m/s]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_E", "enhancement factor"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]"))
++    def __repr__(self):  # {{{
++        s = '   Materials:\n'
++        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
++        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
++        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_E', 'enhancement factor'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\''))
++        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
+ 
+         return s
+-    #}}}
++    # }}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  # {{{
+         self.rheology_E = project3d(md, 'vector', self.rheology_E, 'type', 'node')
+         self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
+         self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
+         return self
+-    #}}}
++    # }}}
+ 
+-    def setdefaultparameters(self): #{{{
+-        #ice density (kg / m^3)
+-        self.rho_ice = 917.
+-        #ocean water density (kg / m^3)
+-        self.rho_water = 1023.
+-        #fresh water density (kg / m^3)
+-        self.rho_freshwater = 1000.
+-        #water viscosity (N.s / m^2)
++    def setdefaultparameters(self):  # {{{
++        # Ice density (kg/m^3)
++        self.rho_ice = 917.0
++        # Ocean water density (kg/m^3)
++        self.rho_water = 1023.0
++        # Fresh water density (kg/m^3)
++        self.rho_freshwater = 1000.0
++        # Water viscosity (N.s/m^2)
+         self.mu_water = 0.001787
+-        #ice heat capacity cp (J / kg / K)
+-        self.heatcapacity = 2093.
+-        #ice latent heat of fusion L (J / kg)
+-        self.latentheat = 3.34 * 10**5
+-        #ice thermal conductivity (W / m / K)
++        # Ice heat capacity cp (J/kg/K)
++        self.heatcapacity = 2093.0
++        # Ice latent heat of fusion L (J/kg)
++        self.latentheat = 3.34 * pow(10, 5)
++        # Ice thermal conductivity (W/m/K)
+         self.thermalconductivity = 2.4
+-        #temperate ice thermal conductivity (W / m / K)
++        # Temperate ice thermal conductivity (W/m/K)
+         self.temperateiceconductivity = 0.24
+-        #computation of effective conductivity
++        # Computation of effective conductivity
+         self.effectiveconductivity_averaging = 1
+-        #the melting point of ice at 1 atmosphere of pressure in K
++        # The melting point of ice at 1 atmosphere of pressure in K
+         self.meltingpoint = 273.15
+-        #rate of change of melting point with pressure (K / Pa)
+-        self.beta = 9.8 * 10**-8
+-        #mixed layer (ice-water interface) heat capacity (J / kg / K)
+-        self.mixed_layer_capacity = 3974.
+-        #thermal exchange velocity (ice-water interface) (m / s)
+-        self.thermal_exchange_velocity = 1.00 * 10**-4
+-        #Rheology law: what is the temperature dependence of B with T
+-        #available: none, paterson and arrhenius
++        # Rate of change of melting point with pressure (K/Pa)
++        self.beta = 9.8 * pow(10, -8)
++        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
++        self.mixed_layer_capacity = 3974.0
++        # Thermal exchange velocity (ice-water interface) (m/s)
++        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
++        # Rheology law: what is the temperature dependence of B with T
++        # available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+ 
+-        #GIA
+-        self.lithosphere_shear_modulus = 6.7 * 10**10  # (Pa)
+-        self.lithosphere_density = 3.32  # (g / cm^ - 3)
+-        self.mantle_shear_modulus = 1.45 * 10**11  # (Pa)
+-        self.mantle_density = 3.34  # (g / cm^ - 3)
++        # SLC
++        self.earth_density = 5512 # average density of the Earth, (kg/m^3)
+ 
+-        #SLC
+-        self.earth_density = 5512  #average density of the Earth, (kg / m^3)
+-
+         return self
+-    #}}}
++    # }}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+         md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+         md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+@@ -130,7 +122,7 @@
+         return md
+     # }}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 4, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+Index: ../trunk-jpl/src/m/classes/materials.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/materials.m	(revision 26358)
+@@ -174,7 +174,7 @@
+ 				nat=self.nature{i};
+ 				switch nat
+ 				case 'ice'
+-					disp(sprintf('   \nIce:'));
++					disp(sprintf('\n      Ice:'));
+ 					fielddisplay(self,'rho_ice','ice density [kg/m^3]');
+ 					fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
+ 					fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]');
+@@ -191,7 +191,7 @@
+ 					fielddisplay(self,'rheology_n','Glen''s flow law exponent');
+ 					fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'', ''LliboutryDuval'', ''NyeCO2'', or ''NyeH2O''']);
+ 				case 'litho'
+-					disp(sprintf('   \nLitho:'));
++					disp(sprintf('\n      Litho:'));
+ 					fielddisplay(self,'numlayers','number of layers (default: 2)');
+ 					fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]');
+ 					fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]');
+@@ -210,7 +210,7 @@
+ 					fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]');
+ 					fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)');
+ 				case 'hydro'
+-					disp(sprintf('   \nHydro:'));
++					disp(sprintf('\n      Hydro:'));
+ 					fielddisplay(self,'rho_ice','ice density [kg/m^3]');
+ 					fielddisplay(self,'rho_water','ocean water density [kg/m^3]');
+ 					fielddisplay(self,'earth_density','mantle density [kg/m^3]');
+Index: ../trunk-jpl/src/m/classes/materials.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/materials.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/materials.py	(revision 26358)
+@@ -75,7 +75,7 @@
+         for i in range(len(self.nature)):
+             nat = self.nature[i]
+             if nat == 'ice':
+-                s += 'Ice:\n'
++                s += '\n      Ice:\n'
+                 s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+                 s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
+                 s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+@@ -92,7 +92,7 @@
+                 s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
+                 s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\''))
+             elif nat == 'litho':
+-                s += 'Litho:\n'
++                s += '\n      Litho:\n'
+                 s += '{}\n'.format(fielddisplay(self, 'numlayers', 'number of layers (default: 2)'))
+                 s += '{}\n'.format(fielddisplay(self, 'radius', 'array describing the radius for each interface (numlayers + 1) [m]'))
+                 s += '{}\n'.format(fielddisplay(self, 'viscosity', 'array describing each layer\'s viscosity (numlayers) [Pa.s]'))
+@@ -110,7 +110,7 @@
+                 s += '{}\n'.format(fielddisplay(self, 'density', 'array describing each layer\'s density (numlayers) [kg/m^3]'))
+                 s += '{}\n'.format(fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default: 1) (numlayers)'))
+             elif nat == 'hydro':
+-                s += 'Hydro:\n'
++                s += '\n      Hydro:\n'
+                 s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+                 s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
+                 s += '{}\n'.format(fielddisplay(self, 'earth_density', 'mantle density [kg/m^3]'))
+@@ -126,19 +126,19 @@
+             nat = self.nature[i]
+             if nat == 'ice':
+                 # Ice density (kg/m^3)
+-                self.rho_ice = 917
++                self.rho_ice = 917.0
+ 
+                 # Ocean water density (kg/m^3)
+-                self.rho_water = 1023
++                self.rho_water = 1023.0
+ 
+                 # Fresh water density (kg/m^3)
+-                self.rho_freshwater = 1000
++                self.rho_freshwater = 1000.0
+ 
+                 # Water viscosity (N.s/m^2)
+                 self.mu_water = 0.001787
+ 
+                 # Ice heat capacity cp (J/kg/K)
+-                self.heatcapacity = 2093
++                self.heatcapacity = 2093.0
+ 
+                 # Ice latent heat of fusion L (J/kg)
+                 self.latentheat = 3.34 * 1e5
+@@ -159,7 +159,7 @@
+                 self.beta = 9.8 * 1e-8
+ 
+                 # Mixed layer (ice-water interface) heat capacity (J/kg/K)
+-                self.mixed_layer_capacity = 3974
++                self.mixed_layer_capacity = 3974.0
+ 
+                 # Thermal exchange velocity (ice-water interface) (m/s)
+                 self.thermal_exchange_velocity = 1.00 * 1e-4
+@@ -192,17 +192,17 @@
+                 self.ebm_taul = [np.nan, np.nan]
+                 self.ebm_tauh = [np.nan, np.nan]
+                 self.rheologymodel = [0, 0]
+-                self.density = [5.51e3, 5.50e3] # (Pa) # Mantle and lithosphere density [kg/m^3]
++                self.density = [5.51 * 1e3, 5.50 * 1e3] # (Pa) # Mantle and lithosphere density [kg/m^3]
+                 self.issolid = [1, 1] # Is layer solid or liquid?
+             elif nat == 'hydro':
+                 # Ice density (kg/m^3)
+-                self.rho_ice = 917
++                self.rho_ice = 917.0
+ 
+                 # Ocean water density (kg/m^3)
+-                self.rho_water = 1023
++                self.rho_water = 1023.0
+ 
+                 # Fresh water density (kg/m^3)
+-                self.rho_freshwater = 1000
++                self.rho_freshwater = 1000.0
+             else:
+                 raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')")
+ 
+Index: ../trunk-jpl/src/m/classes/matestar.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matestar.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matestar.m	(revision 26358)
+@@ -23,7 +23,7 @@
+ 		rheology_Es                     = NaN;
+ 		rheology_law                    = '';
+ 
+-		%slc
++		%SLC
+ 		earth_density                   = 0;
+ 
+ 	end
+@@ -86,7 +86,7 @@
+ 
+ 			%computation of effective conductivity
+ 			self.effectiveconductivity_averaging=1;
+-            
++
+ 			%the melting point of ice at 1 atmosphere of pressure in K
+ 			self.meltingpoint=273.15;
+ 
+@@ -103,8 +103,8 @@
+ 			%available: none, paterson and arrhenius
+ 			self.rheology_law='Paterson';
+ 
+-			%SLR
+-			self.earth_density= 5512;  % average density of the Earth, (kg/m^3)
++			%SLC
++			self.earth_density= 5512; % average density of the Earth, (kg/m^3)
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -117,7 +117,7 @@
+ 			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('SealevelchangeAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+ 			end
+Index: ../trunk-jpl/src/m/classes/matestar.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matestar.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matestar.py	(revision 26358)
+@@ -7,14 +7,13 @@
+ 
+ 
+ class matestar(object):
+-    '''
+-    MATESTAR class definition
++    """MATESTAR class definition
+ 
+-        Usage:
+-            matestar = matestar()
+-    '''
++    Usage:
++        matestar = matestar()
++    """
+ 
+-    def __init__(self): #{{{
++    def __init__(self):  # {{{
+         self.rho_ice = 0.
+         self.rho_water = 0.
+         self.rho_freshwater = 0.
+@@ -33,82 +32,82 @@
+         self.rheology_Es = np.nan
+         self.rheology_law = ''
+ 
+-        #slc
++        # SLC
+         self.earth_density = 0
+ 
+-        #set default parameters
++        # Set default parameters
+         self.setdefaultparameters()
+-    #}}}
++    # }}}
+ 
+-    def __repr__(self): #{{{
+-        s = "   Materials:"
+-        s = "%s\n%s" % (s, fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'thermalconductivity', ['ice thermal conductivity [W/m/K]']))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'latentheat', 'latent heat of fusion [J / kg]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/3)]'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Es', 'shear enhancement factor'))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']))
+-        s = "%s\n%s" % (s, fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
++    def __repr__(self):  # {{{
++        s = '   Materials:\n'
++        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'ocean water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', ['ice thermal conductivity [W/m/K]']))
++        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
++        s += '{}\n'.format(fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
++        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
++        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/kg]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/3)]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_Es', 'shear enhancement factor'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\'']))
++        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
+ 
+         return s
+-    #}}}
++    # }}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  # {{{
+         self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
+         self.rheology_Ec = project3d(md, 'vector', self.rheology_Ec, 'type', 'node')
+         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.
+-        #ocean water density (kg / m^3)
+-        self.rho_water = 1023.
+-        #fresh water density (kg / m^3)
+-        self.rho_freshwater = 1000.
+-        #water viscosity (N.s / m^2)
++    def setdefaultparameters(self):  # {{{
++        # Ice density (kg/m^3)
++        self.rho_ice = 917.0
++        # Ocean water density (kg/m^3)
++        self.rho_water = 1023.0
++        # Fresh water density (kg/m^3)
++        self.rho_freshwater = 1000.0
++        # Water viscosity (N.s/m^2)
+         self.mu_water = 0.001787
+-        #ice heat capacity cp (J / kg / K)
+-        self.heatcapacity = 2093.
+-        #ice latent heat of fusion L (J / kg)
+-        self.latentheat = 3.34e5
+-        #ice thermal conductivity (W / m / K)
++        # Ice heat capacity cp (J/kg/K)
++        self.heatcapacity = 2093.0
++        # Ice latent heat of fusion L (J/kg)
++        self.latentheat = 3.34 * pow(10, 5)
++        # Ice thermal conductivity (W/m/K)
+         self.thermalconductivity = 2.4
+-        #wet ice thermal conductivity (W / m / K)
++        # Wet ice thermal conductivity (W/m/K)
+         self.temperateiceconductivity = 0.24
+-        #computation of effective conductivity
++        # Computation of effective conductivity
+         self.effectiveconductivity_averaging = 1
+-        #the melting point of ice at 1 atmosphere of pressure in K
++        # The melting point of ice at 1 atmosphere of pressure in K
+         self.meltingpoint = 273.15
+-        #rate of change of melting point with pressure (K / Pa)
+-        self.beta = 9.8e-8
+-        #mixed layer (ice-water interface) heat capacity (J / kg / K)
+-        self.mixed_layer_capacity = 3974.
+-        #thermal exchange velocity (ice-water interface) (m / s)
+-        self.thermal_exchange_velocity = 1.00e-4
+-        #Rheology law: what is the temperature dependence of B with T
+-        #available: none, paterson and arrhenius
++        # Rate of change of melting point with pressure (K/Pa)
++        self.beta = 9.8 * pow(10, -8)
++        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
++        self.mixed_layer_capacity = 3974.0
++        # Thermal exchange velocity (ice-water interface) (m/s)
++        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
++        # Rheology law: what is the temperature dependence of B with T
++        # available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+-        #slc
+-        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
++        # SLC
++        self.earth_density = 5512 # average density of the Earth (kg/m^3)
+ 
+         return self
+-    #}}}
++    # }}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+         md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+         md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+@@ -125,7 +124,7 @@
+         return md
+     # }}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 2, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+Index: ../trunk-jpl/src/m/classes/matice.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.js	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matice.js	(revision 26358)
+@@ -1,29 +1,54 @@
+ //MATICE class definition
+ //
+ //   Usage:
+-//      matice=matice();
++//      matice = new matice();
+ 
+ function matice(){
++	//properties
++	// {{{
++	this.rho_ice							= 0;
++	this.rho_water							= 0;
++	this.rho_freshwater						= 0;
++	this.mu_water							= 0;
++	this.heatcapacity						= 0;
++	this.latentheat							= 0;
++	this.thermalconductivity				= 0;
++	this.temperateiceconductivity			= 0;
++	this.effectiveconductivity_averaging	= 0;
++	this.meltingpoint						= 0;
++	this.beta								= 0;
++	this.mixed_layer_capacity				= 0;
++	this.thermal_exchange_velocity			= 0;
++	this.rheology_B							= NaN;
++	this.rheology_n							= NaN;
++	this.rheology_law						= '';
++
++	//SLC
++	this.earth_density= 5512; // average density of the Earth, (kg/m^3)
++
++	this.setdefaultparameters();
++	//}}}
++
+ 	//methods
+ 	this.setdefaultparameters = function(){ // {{{
+ 
+ 		//ice density (kg/m^3)
+-		this.rho_ice=917.;
++		this.rho_ice=917;
+ 
+ 		//ocean water density (kg/m^3)
+-		this.rho_water=1023.;
++		this.rho_water=1023;
+ 
+ 		//fresh water density (kg/m^3)
+-		this.rho_freshwater=1000.;
++		this.rho_freshwater=1000;
+ 
+ 		//water viscosity (N.s/m^2)
+-		this.mu_water=0.001787;  
++		this.mu_water=0.001787;
+ 
+ 		//ice heat capacity cp (J/kg/K)
+-		this.heatcapacity=2093.;
++		this.heatcapacity=2093;
+ 
+ 		//ice latent heat of fusion L (J/kg)
+-		this.latentheat=3.34*Math.pow(10,5);
++		this.latentheat=3.34*Math.pow(10, 5);
+ 
+ 		//ice thermal conductivity (W/m/K)
+ 		this.thermalconductivity=2.4;
+@@ -31,30 +56,31 @@
+ 		//wet ice thermal conductivity (W/m/K)
+ 		this.temperateiceconductivity=.24;
+ 
++		//computation of effective conductivity
++		this.effectiveconductivity_averaging=1;
++
+ 		//the melting point of ice at 1 atmosphere of pressure in K
+ 		this.meltingpoint=273.15;
+ 
+ 		//rate of change of melting point with pressure (K/Pa)
+-		this.beta=9.8*Math.pow(10,-8);
++		this.beta=9.8e-8;
+ 
+ 		//mixed layer (ice-water interface) heat capacity (J/kg/K)
+-		this.mixed_layer_capacity=3974.;
++		this.mixed_layer_capacity=3974;
+ 
+ 		//thermal exchange velocity (ice-water interface) (m/s)
+-		this.thermal_exchange_velocity=1.00*Math.pow(10,-4);
++		this.thermal_exchange_velocity=1.00*1e-4;
+ 
+ 		//Rheology law: what is the temperature dependence of B with T
+ 		//available: none, paterson and arrhenius
+ 		this.rheology_law='Paterson';
+ 
+-		// GIA:
+-		this.lithosphere_shear_modulus  = 6.7*Math.pow(10,10);  // (Pa)
+-		this.lithosphere_density        = 3.32;       // (g/cm^-3)
+-		this.mantle_shear_modulus       = 1.45*Math.pow(10,11); // (Pa)
+-		this.mantle_density             = 3.34;       // (g/cm^-3)
++		// Rheology for ice
++		this.rheology_B = 2.1 * 1e8
++		this.rheology_n = 3
+ 
+-		//SLR
+-		this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
++		//SLC
++		this.earth_density= 5512; // average density of the Earth, (kg/m^3)
+ 
+ 
+ 	} //}}}
+@@ -68,6 +94,7 @@
+ 		fielddisplay(this,'heatcapacity','heat capacity [J/kg/K]');
+ 		fielddisplay(this,'thermalconductivity','ice thermal conductivity [W/m/K]');
+ 		fielddisplay(this,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
++		fielddisplay(this,'effectiveconductivity_averaging','computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
+ 		fielddisplay(this,'meltingpoint','melting point of ice at 1atm in K');
+ 		fielddisplay(this,'latentheat','latent heat of fusion [J/kg]');
+ 		fielddisplay(this,'beta','rate of change of melting point with pressure [K/Pa]');
+@@ -74,12 +101,8 @@
+ 		fielddisplay(this,'mixed_layer_capacity','mixed layer capacity [W/kg/K]');
+ 		fielddisplay(this,'thermal_exchange_velocity','thermal exchange velocity [m/s]');
+ 		fielddisplay(this,'rheology_B','flow law parameter [Pa s^(1/n)]');
+-		fielddisplay(this,'rheology_n',"Glen's flow law exponent");
+-		fielddisplay(this,'rheology_law',"law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius','LliboutryDuval','NyeH2O', or 'NyeCO2'");
+-		fielddisplay(this,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
+-		fielddisplay(this,'lithosphere_density','Lithosphere density [g/cm^-3]');
+-		fielddisplay(this,'mantle_shear_modulus','Mantle shear modulus [Pa]');
+-		fielddisplay(this,'mantle_density','Mantle density [g/cm^-3]');
++		fielddisplay(this,'rheology_n','Glen\'s flow law exponent');
++		fielddisplay(this,'rheology_law','law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeH2O\', or \'NyeCO2\'');
+ 		fielddisplay(this,'earth_density','Mantle density [kg/m^-3]');
+ 
+ 	} // }}}
+@@ -89,28 +112,21 @@
+ 		return this;
+ 	}//}}}
+ 	this.classname = function() {// {{{
+-		return "matice";
++		return 'matice';
+ 	} // }}}
+ 	this.checkconsistency = function(md,solution,analyses) { // {{{
+-		checkfield(md,'fieldname','materials.rho_ice','>',0);
+-		checkfield(md,'fieldname','materials.rho_water','>',0);
+-		checkfield(md,'fieldname','materials.rho_freshwater','>',0);
+-		checkfield(md,'fieldname','materials.mu_water','>',0);
+-		checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
+-		checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements,1]);
+-		checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval','NyeH2O','NyeCO2']);
+-
+-		if(ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1)){
+-			checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
+-			checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1);
+-			checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1);
+-			checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1);
++		if (solution == 'TransientSolution' && md.transient.isslc) {
++			checkfield(md,'fieldname','materials.earth_density','>',0,'numel',[1])
++		} else {
++			checkfield(md,'fieldname','materials.rho_ice','>',0);
++			checkfield(md,'fieldname','materials.rho_water','>',0);
++			checkfield(md,'fieldname','materials.rho_freshwater','>',0);
++			checkfield(md,'fieldname','materials.mu_water','>',0);
++			checkfield(md,'fieldname','materials.rheology_B','>',0,'universal',1,'NaN',1,'Inf',1);
++			checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1);
++			checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval','NyeH2O','NyeCO2']);
++			checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0,1,2])
+ 		}
+-		if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
+-			checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1);
+-		}
+-
+-
+ 	} // }}}
+ 	this.marshall=function(md,prefix,fid) { //{{{
+ 		WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer');
+@@ -122,49 +138,24 @@
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double');
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double');
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');
++		WriteData(fid,prefix,'object',this,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double');
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double');
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');
+-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++		if ((shape(self.rheology_B)[0] == md.mesh.numberofvertices) || (shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1) or (shape(self.rheology_B)[0] == md.mesh.numberofelements && shape(self.rheology_B)[1] > 1)) {
++			mattype = 1
++			tsl = md.mesh.numberofvertices
++		} else {
++			mattype = 2
++			tsl = md.mesh.numberofelements
++		}
++		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',mattype,'timeserieslength',tsl+1,'yts',md.constants.yts);
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);
+ 		WriteData(fid,prefix,'data',this.rheology_law,'name','md.materials.rheology_law','format','String');
+-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
+-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',Math.pow(10,3));
+-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double');
+-		WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',Math.pow(10,3));
+ 		WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double');
+ 
+ 	}//}}}
+ 	this.fix=function() { //{{{
+ 	}//}}}
+-	//properties 
+-	// {{{
+-		this.rho_ice                    = 0.;
+-		this.rho_water                  = 0.;
+-		this.rho_freshwater             = 0.;
+-		this.mu_water                   = 0.;
+-		this.heatcapacity               = 0.;
+-		this.latentheat                 = 0.;
+-		this.thermalconductivity        = 0.;
+-		this.temperateiceconductivity   = 0.;
+-		this.meltingpoint               = 0.;
+-		this.beta                       = 0.;
+-		this.mixed_layer_capacity       = 0.;
+-		this.thermal_exchange_velocity  = 0.;
+-		this.rheology_B   = NaN;
+-		this.rheology_n   = NaN;
+-		this.rheology_law = '';
+-
+-		//giaivins: 
+-		this.lithosphere_shear_modulus  = 0.;
+-		this.lithosphere_density        = 0.;
+-		this.mantle_shear_modulus       = 0.;
+-		this.mantle_density             = 0.;
+-
+-		//SLR
+-		this.earth_density= 5512;  // average density of the Earth, (kg/m^3)
+-
+-		this.setdefaultparameters();
+-		//}}}
+ }
+Index: ../trunk-jpl/src/m/classes/matice.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matice.m	(revision 26358)
+@@ -74,7 +74,7 @@
+ 			
+ 			%wet ice thermal conductivity (W/m/K)
+ 			self.temperateiceconductivity=.24;
+-			
++
+ 			%computation of effective conductivity
+ 			self.effectiveconductivity_averaging=1;
+ 
+Index: ../trunk-jpl/src/m/classes/plumebasalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/plumebasalforcings.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/plumebasalforcings.py	(revision 26358)
+@@ -38,15 +38,15 @@
+             self = structtoobj(self, args[0])
+         else:
+             error('constuctor not supported')
+-    #}}}
++    # }}}
+ 
+     def __repr__(self):  # {{{
+         s = '   mantle plume basal melt parameterization:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m / yr]'))
+-        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m / yr]'))
+-        s += '{}\n'.format(fielddisplay(self, 'mantleconductivity', 'mantle heat conductivity [W / m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m/yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'mantleconductivity', 'mantle heat conductivity [W/m^3]'))
+         s += '{}\n'.format(fielddisplay(self, 'nusselt', 'nusselt number, ratio of mantle to plume [1]'))
+-        s += '{}\n'.format(fielddisplay(self, 'dtbg', 'background temperature gradient [degree / m]'))
++        s += '{}\n'.format(fielddisplay(self, 'dtbg', 'background temperature gradient [degree/m]'))
+         s += '{}\n'.format(fielddisplay(self, 'plumeradius', 'radius of the mantle plume [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'topplumedepth', 'depth of the mantle plume top below the crust [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'bottomplumedepth', 'depth of the mantle plume base below the crust [m]'))
+@@ -54,10 +54,10 @@
+         s += '{}\n'.format(fielddisplay(self, 'plumey', 'y coordinate of the center of the plume [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'crustthickness', 'thickness of the crust [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'uppercrustthickness', 'thickness of the upper crust [m]'))
+-        s += '{}\n'.format(fielddisplay(self, 'uppercrustheat', 'volumic heat of the upper crust [w / m^3]'))
+-        s += '{}\n'.format(fielddisplay(self, 'lowercrustheat', 'volumic heat of the lowercrust [w / m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'uppercrustheat', 'volumic heat of the upper crust [w/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'lowercrustheat', 'volumic heat of the lowercrust [w/m^3]'))
+         return s
+-    #}}}
++    # }}}
+ 
+     def initialize(self, md):  #{{{
+         if np.all(np.isnan(self.groundedice_melting_rate)):
+@@ -67,28 +67,28 @@
+             self.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+             print('      no basalforcings.floatingice_melting_rate specified: values set as zero')
+         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.dtbg = 11 / 1000.0
+         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
++        self.uppercrustheat = 1.7 * pow(10, -6)
++        self.lowercrustheat = 0.4 * pow(10, -6)
+         return self
+-    #}}}
++    # }}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         if 'MasstransportAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.ismasstransport == 0):
+Index: ../trunk-jpl/src/m/classes/rotational.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/rotational.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/rotational.m	(revision 26358)
+@@ -20,12 +20,12 @@
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
+-			%moment of inertia: 
+-			self.equatorialmoi	=8.0077*10^37; % [kg m^2] 
+-			self.polarmoi		=8.0345*10^37; % [kg m^2] 
++			%moment of inertia:
++			self.equatorialmoi	=8.0077*10^37; % [kg m^2]
++			self.polarmoi		=8.0345*10^37; % [kg m^2]
+ 
+-			% mean rotational velocity of earth 
+-			self.angularvelocity=7.2921*10^-5; % [s^-1] 
++			% mean rotational velocity of earth
++			self.angularvelocity=7.2921*10^-5; % [s^-1]
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+Index: ../trunk-jpl/src/m/classes/rotational.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/rotational.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/rotational.py	(revision 26358)
+@@ -32,11 +32,11 @@
+ 
+     def setdefaultparameters(self):  # {{{
+         # Moment of inertia
+-        self.equatorialmoi = 8.0077e37  # [kg m^2]
+-        self.polarmoi = 8.0345e37  # [kg m^2]
++        self.equatorialmoi = 8.0077 * pow(10, 37) # [kg m^2]
++        self.polarmoi = 8.0345 * pow(10, 37) # [kg m^2]
+ 
+         # Mean rotational velocity of earth
+-        self.angularvelocity = 7.2921e-5  # [s^-1]
++        self.angularvelocity = 7.2921 * pow(10, -5) # [s^-1]
+         return self
+     #}}}
+ 
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.m	(revision 26358)
+@@ -3,9 +3,9 @@
+ %   Usage:
+ %      slm = sealevelmodel(varargin)
+ %
+-%      where varargin is a variable list of options: 
++%      where varargin is a variable list of options:
+ %
+-%   Example: 
++%   Example:
+ %      slm = sealevel('icecap',md_greenland,'icecap',md_antarctica,'earth',md_earth);
+ 
+ classdef sealevelmodel < handle
+@@ -32,13 +32,13 @@
+ 
+ 				options=pairoptions(varargin{:});
+ 
+-				%recover all the icecap models: 
+-				slm.icecaps=getfieldvalues(options,'ice_cap',{}); 
++				%recover all the icecap models:
++				slm.icecaps=getfieldvalues(options,'ice_cap',{});
+ 				
+ 				%recover the earth model:
+ 				slm.earth = getfieldvalue(options,'earth',0);
+ 
+-				%set planet type: 
++				%set planet type:
+ 				slm.planet=getfieldvalue(options,'planet','earth');
+ 
+ 			end
+@@ -46,7 +46,7 @@
+ 		%}}}
+ 		function checkconsistency(slm,solutiontype) % {{{
+ 
+-			%is the coupler turned on? 
++			%is the coupler turned on?
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.transient.iscoupler==0,
+ 					warning(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
+@@ -57,7 +57,7 @@
+ 				warning('sealevelmodel.m::checkconsistency: earth model should have the transient coupler option turned on!');
+ 			end
+ 
+-			%check that the transition vectors have the right size: 
++			%check that the transition vectors have the right size:
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}),
+ 					error(['sealevelmodel.m::checkconsistency: issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
+@@ -64,7 +64,7 @@
+ 				end
+ 			end
+ 			
+-			%check that runfrequency is the same everywhere: 
++			%check that runfrequency is the same everywhere:
+ 			for i=1:length(slm.icecaps),
+ 				if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency,
+ 					error(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
+@@ -71,9 +71,9 @@
+ 				end
+ 			end
+ 
+-			%make sure steric_rate is the same everywhere: 
++			%make sure steric_rate is the same everywhere:
+ 			for i=1:length(slm.icecaps),
+-				md= slm.icecaps{i}; 
++				md= slm.icecaps{i};
+ 				if ~isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate(slm.earth.dsl.transitions{i}))),
+ 					error(sprintf('sealevelmodel.m::checkconsistency: steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+ 				end
+@@ -81,23 +81,23 @@
+ 
+ 			%make sure grd is the same everywhere:
+ 			for i=1:length(slm.icecaps),
+-				md= slm.icecaps{i}; 
++				md= slm.icecaps{i};
+ 				if md.solidearthsettings.isgrd~=slm.earth.solidearthsettings.isgrd
+ 					error(sprintf('sealevelmodel.m::checkconsistency: isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));
+ 				end
+ 			end
+ 
+-			%make sure that there is no solid earth external forcing on the basins: 
++			%make sure that there is no solid earth external forcing on the basins:
+ 			for i=1:length(slm.icecaps),
+-				md= slm.icecaps{i}; 
++				md= slm.icecaps{i};
+ 				if ~isempty(md.solidearth.external),
+ 					error('sealevelmodel.m::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');
+ 				end
+ 
+ 			end
+-			%make sure that we have the right grd model for computing out sealevel patterns: 
++			%make sure that we have the right grd model for computing out sealevel patterns:
+ 			for i=1:length(slm.icecaps),
+-				md= slm.icecaps{i}; 
++				md= slm.icecaps{i};
+ 				if md.solidearth.settings.grdmodel~=0
+ 					error(sprintf('sealevelmodel.m::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));
+ 				end
+@@ -134,7 +134,7 @@
+ 				for j=1:length(self.icecaps{1}.results.TransientSolution),
+ 					for k=1:length(champs),
+ 						if strcmpi(class(icecaps{1}.results.TransientSolution(j).(champs{k})),'double'),
+-							%vertex or element? 
++							%vertex or element?
+ 							if length(icecaps{1}.results.TransientSolution(j).(champs{k}))==icecaps{1}.mesh.numberofvertices,
+ 								md.results.TransientSolution(j).(champs{k})=zeros(md.mesh.numberofvertices,1);
+ 								for l=1:length(trans),
+@@ -141,7 +141,7 @@
+ 									resultcap=icecaps{l}.results.TransientSolution(j).(champs{k});
+ 									md.results.TransientSolution(j).(champs{k})(trans{l})=resultcap;
+ 								end
+-							else 
++							else
+ 								if strcmpi(champs{k},'IceVolume') | strcmpi(champs{k},'IceVolumeAboveFloatation') ,
+ 									md.results.TransientSolution(j).(champs{k})=0;
+ 									for l=1:length(trans),
+@@ -194,10 +194,10 @@
+ 		end % }}}
+ 		function intersections2d(self,varargin) % {{{
+ 
+-			options=pairoptions(varargin{:}); 
++			options=pairoptions(varargin{:});
+ 			force=getfieldvalue(options,'force',0);
+ 			
+-			%initialize, to avoid issues of having more transitions than meshes. 
++			%initialize, to avoid issues of having more transitions than meshes.
+ 			self.transitions={};
+ 			self.eltransitions={};
+ 
+@@ -208,7 +208,7 @@
+ 			for i=1:length(self.icecaps),
+ 				mdi=self.icecaps{i};
+ 		
+-				%for elements: 
++				%for elements:
+ 				xei=mdi.mesh.x(mdi.mesh.elements)*[1;1;1]/3;
+ 				yei=mdi.mesh.y(mdi.mesh.elements)*[1;1;1]/3;
+ 		
+@@ -221,10 +221,10 @@
+ 		end % }}}
+ 		function intersections(self,varargin) % {{{
+ 
+-			options=pairoptions(varargin{:}); 
++			options=pairoptions(varargin{:});
+ 			force=getfieldvalue(options,'force',0);
+ 			
+-			%initialize, to avoid issues of having more transitions than meshes. 
++			%initialize, to avoid issues of having more transitions than meshes.
+ 			self.transitions={};
+ 			self.eltransitions={};
+ 
+@@ -237,7 +237,7 @@
+ 				mdi=self.icecaps{i};
+ 				mdi=TwoDToThreeD(mdi,self.planet);
+ 		
+-				%for elements: 
++				%for elements:
+ 				xei=mdi.mesh.x(mdi.mesh.elements)*[1;1;1]/3;
+ 				yei=mdi.mesh.y(mdi.mesh.elements)*[1;1;1]/3;
+ 				zei=mdi.mesh.z(mdi.mesh.elements)*[1;1;1]/3;
+@@ -264,7 +264,7 @@
+ 
+ 		end % }}}
+ 		function baslist=basinindx(self,varargin) % {{{
+-			options=pairoptions(varargin{:}); 
++			options=pairoptions(varargin{:});
+ 			continent=getfieldvalue(options,'continent','all');
+ 			bas=getfieldvalue(options,'basin','all');
+ 
+@@ -272,8 +272,8 @@
+ 			if iscell(continent),
+ 				if length(continent)==1,
+ 					if strcmpi(continent{1},'all'),
+-						%need to transform this into a list of continents: 
+-						continent={}; 
++						%need to transform this into a list of continents:
++						continent={};
+ 						for i=1:length(self.basins),
+ 							continent{end+1}=self.basins{i}.continent;
+ 						end
+@@ -286,8 +286,8 @@
+ 				end
+ 			else
+ 				if strcmpi(continent,'all'),
+-					%need to transform this into a list of continents: 
+-					continent={}; 
++					%need to transform this into a list of continents:
++					continent={};
+ 					for i=1:length(self.basins),
+ 						continent{end+1}=self.basins{i}.continent;
+ 					end
+@@ -301,7 +301,7 @@
+ 			if iscell(bas),
+ 				if length(bas)==1,
+ 					if strcmpi(bas{1},'all'),
+-						%need to transform this into a list of basins: 
++						%need to transform this into a list of basins:
+ 						baslist=[];
+ 						for i=1:length(self.basins),
+ 							if self.basins{i}.iscontinentany(continent{:}),
+@@ -322,7 +322,7 @@
+ 
+ 					end
+ 				else
+-					%we have a list of basin names: 
++					%we have a list of basin names:
+ 					baslist=[];
+ 					for i=1:length(bas),
+ 						basname=bas{i};
+@@ -373,8 +373,8 @@
+ 		end % }}}
+ 		function caticecaps(self,varargin) % {{{
+ 			
+-			%recover options: 
+-			options=pairoptions(varargin{:}); 
++			%recover options:
++			options=pairoptions(varargin{:});
+ 			tolerance=getfieldvalue(options,'tolerance',.65);
+ 			loneedgesdetect=getfieldvalue(options,'loneedgesdetect',0);
+ 	
+@@ -385,7 +385,7 @@
+ 			end
+ 			
+ 			%Plug all models together:
+-			md=models{1}; 
++			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];
+@@ -404,7 +404,7 @@
+ 				end
+ 			end %}}}
+ 	
+-			%Plug into earth: 
++			%Plug into earth:
+ 			self.earth=md;
+ 
+ 			%Create mesh radius:
+@@ -413,14 +413,14 @@
+ 		end % }}}
+ 		function caticecaps2d(self,varargin) % {{{
+ 
+-			%recover options: 
+-			options=pairoptions(varargin{:}); 
++			%recover options:
++			options=pairoptions(varargin{:});
+ 			tolerance=getfieldvalue(options,'tolerance',1e-5);
+ 			loneedgesdetect=getfieldvalue(options,'loneedgesdetect',0);
+ 			models=self.icecaps;
+ 
+ 			%Plug all models together:
+-			md=models{1}; 
++			md=models{1};
+ 			for i=2:length(models),
+ 				md=modelmerge2d(md,models{i},'tolerance',tolerance);
+ 			end
+@@ -436,7 +436,7 @@
+ 				end
+ 			end %}}}
+ 
+-			%Plug into earth: 
++			%Plug into earth:
+ 			self.earth=md;
+ 
+ 		end % }}}
+@@ -462,7 +462,7 @@
+ 			disp(sprintf('Earth: %i/%g',mvi,timei));
+ 		end % }}}
+ 		function transfer(self,string) % {{{
+-			%Recover field size in one icecap: 
++			%Recover field size in one icecap:
+ 			eval(['n=size(self.icecaps{1}.' string ',1);']);
+ 			if n==self.icecaps{1}.mesh.numberofvertices,
+ 				eval(['self.earth.' string '=zeros(self.earth.mesh.numberofvertices,1);']);
+@@ -470,7 +470,7 @@
+ 					eval(['self.earth.' string '(self.transitions{' num2str(i) '})=self.icecaps{' num2str(i) '}.' string ';']);
+ 				end
+ 			elseif n==(self.icecaps{1}.mesh.numberofvertices+1),
+-				%dealing with a transient dataset. 
++				%dealing with a transient dataset.
+ 				%check that all timetags are similar between all icecaps:  %{{{
+ 				for i=1:length(self.icecaps),
+ 					eval(['capfieldi= self.icecaps{' num2str(i) '}.' string ';']);
+@@ -481,7 +481,7 @@
+ 						end
+ 					end
+ 				end
+-				eval(['capfield1= self.icecaps{1}.' string ';']); 
++				eval(['capfield1= self.icecaps{1}.' string ';']);
+ 				times=capfield1(end,:);
+ 				nsteps=length(times);
+ 				%}}}
+@@ -513,7 +513,7 @@
+ 			end
+ 			mintimestep=Inf;
+ 			for  i=1:length(self.icecaps),
+-				ic=self.icecaps{i}; 
++				ic=self.icecaps{i};
+ 				mintimestep=min(mintimestep, length(ic.results.TransientSolution));
+ 			end
+ 			if ~noearth,
+@@ -521,7 +521,7 @@
+ 			end
+ 			
+ 			for  i=1:length(self.icecaps),
+-				ic=self.icecaps{i}; 
++				ic=self.icecaps{i};
+ 				ic.results.TransientSolution=ic.results.TransientSolution(1:mintimestep);
+ 				self.icecaps{i}=ic;
+ 			end
+Index: ../trunk-jpl/src/m/classes/sealevelmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/sealevelmodel.py	(revision 26358)
+@@ -34,9 +34,9 @@
+         )
+     """
+ 
+-    def __init__(self, *args):  #{{{
+-        self.icecaps = []  # list of land/ice models; name should be changed later
+-        self.earth = 0  # model for the whole earth
++    def __init__(self, *args):  # {{{
++        self.icecaps = [] # list of land/ice models; name should be changed later
++        self.earth = 0 # model for the whole earth
+         self.basins = []  # list of basins, matching icecaps, where shapefile info is held
+         self.cluster = 0
+         self.miscellaneous = 0
+@@ -60,7 +60,7 @@
+ 
+             # Set planet type
+             self.planet = options.getfieldvalue('planet', 'earth')
+-    #}}}
++    # }}}
+ 
+     def __repr__(self):  # {{{
+         s = '{}\n'.format(fielddisplay(self, 'icecaps', 'ice caps'))
+@@ -70,7 +70,7 @@
+         s += '{}\n'.format(fielddisplay(self, 'miscellaneous', 'miscellaneous fields'))
+ 
+         return s
+-    #}}}
++    # }}}
+ 
+     def setdefaultparameters(self):  # {{{
+         self.icecaps = []
+@@ -82,7 +82,7 @@
+         self.transitions = []
+         self.eltransitions = []
+         self.planet = 'earth'
+-    #}}}
++    # }}}
+ 
+     @staticmethod
+     def checkconsistency(slm, solutiontype):  # {{{
+@@ -101,13 +101,13 @@
+ 
+         # Check that run frequency is the same everywhere
+         for i in range(len(slm.icecaps)):
+-            if slm.icecaps[i].slr.geodetic_run_frequency != slm.earth.geodetic_run_frequency:
++            if slm.icecaps[i].solidearth.settings.runfrequency != slm.earth.solidearth.settings.runfrequency:
+                 raise Exception('sealevelmodel.py::checkconsistency: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name))
+ 
+         # Make sure steric_rate is the same everywhere
+         for i in range(len(slm.icecaps)):
+             md = slm.icecaps[i]
+-            if np.nonzero(md.slr.steric_rate - slm.earth.slr.steric_rate[slm.earth.slr.transitions[i]]) != []:
++            if np.nonzero(md.dsl.steric_rate - slm.earth.dsl.steric_rate[slm.earth.dsl.transitions[i]]) != []:
+                 raise Exception('sealevelmodel.py::checkconsistency: steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))
+ 
+         # Make sure grd is the same everywhere
+@@ -115,6 +115,7 @@
+             md = slm.icecaps[i]
+             if md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd:
+                 raise RuntimeError('sealevelmodel.py::checkconsistency: isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name))
++
+         # Make sure that there is no solid earth external forcing on the basins
+         for i in range(len(slm.icecaps)):
+             md = slm.icecaps[i]
+@@ -125,7 +126,7 @@
+             md = slm.icecaps[i]
+             if md.solidearth.settings.grdmodel != 0:
+                 raise RuntimeError('sealevelmodel.py::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i))
+-    #}}}
++    # }}}
+ 
+     def mergeresults(self):  # {{{
+         champs = fieldnames(self.icecaps[0].results.TransientSolution)
+@@ -155,16 +156,16 @@
+                     else:
+                         continue
+             self.mergedcaps[2 * i] = md
+-    #}}}
++    # }}}
+ 
+     def listcaps(self):  # {{{
+         for i in range(len(self.icecaps)):
+             print('{}: {}'.format(i, self.icecaps[i].miscellaneous.name))
+-    #}}}
++    # }}}
+ 
+     def ncaps(self): #{{{
+         return len(self.icecaps)
+-    #}}}
++    # }}}
+ 
+     def continents(self):  # {{{
+         list = []
+@@ -171,7 +172,7 @@
+         for i in range(len(self.basins)):
+             list.append = self.basins[i].continent
+         return np.unique(list)
+-    #}}}
++    # }}}
+ 
+     def basinsfromcontinent(self, continent):  # {{{
+         list = []
+@@ -179,13 +180,13 @@
+             if self.basins[i].continent == continent:
+                 list.append = self.basins[i].name
+         return np.unique(list)
+-    #}}}
++    # }}}
+ 
+     def addbasin(self, bas):  # {{{
+         if bas.__class__.__name__ != 'basin':
+             raise Exception('addbasin method only takes a \'basin\' class object as input')
+         self.basins.append(bas)
+-    #}}}
++    # }}}
+ 
+     def intersections2d(self, *args): #{{{
+         options = pairoptions(*args)
+@@ -210,9 +211,9 @@
+ 
+             self.transitions.append(meshintersect2d(self.earth.mesh.x, self.earth.mesh.y, mdi.mesh.x, mdi.mesh.y, 'force', force))
+             self.eltransitions.append(meshintersect2d(xe, ye, xei, yei, 'force', force))
+-    #}}}
++    # }}}
+ 
+-    def intersections(self, *args):  #{{{
++    def intersections(self, *args):  # {{{
+         options = pairoptions(*args)
+         force = options.getfieldvalue('force', 0)
+ 
+@@ -238,21 +239,21 @@
+ 
+             self.transitions.append(meshintersect3d(self.earth.mesh.x, self.earth.mesh.y, self.earth.mesh.z, mdi.mesh.x, mdi.mesh.y, mdi.mesh.z, 'force', force))
+             self.eltransitions.append(meshintersect3d(xe, ye, ze, xei, yei, zei, 'force', force))
+-    #}}}
++    # }}}
+ 
+-    def checkintersections(self):  #{{{
++    def checkintersections(self):  # {{{
+         flags = np.zeros(self.earth.mesh.numberofvertices, 1)
+         for i in range(len(self.basins)):
+             flags[self.transitions[i]] = i
+         plotmodel(self.earth, 'data', flags, 'coastline', 'on')
+-    #}}}
++    # }}}
+ 
+-    def checkbasinconsistency(self):  #{{{
++    def checkbasinconsistency(self):  # {{{
+         for i in range(len(self.basins)):
+             self.basins[i].checkconsistency()
+-    #}}}
++    # }}}
+ 
+-    def basinindx(self, *args):  #{{{
++    def basinindx(self, *args):  # {{{
+         options = pairoptions(*args)
+         continent = options.getfieldvalue('continent', 'all')
+         bas = options.getfieldvalue('basin', 'all')
+@@ -279,7 +280,7 @@
+                 continent = np.unique(continent)
+             else:
+                 pass  # Nothing to do: assume we have a list of continents
+-        #}}}
++        # }}}
+ 
+         # Expand basins list using the continent list above and the extra bas discriminator #{{{
+         if type(bas) == np.ndarray:
+@@ -324,22 +325,22 @@
+                 baslist = np.unique(baslist)
+ 
+         return baslist
+-        #}}}
+-    #}}}
++        # }}}
++    # }}}
+ 
+-    def addicecap(self, md):  #{{{
++    def addicecap(self, md):  # {{{
+         if not type(md) == model:
+             raise Exception("addicecap method only takes a 'model' class object as input")
+ 
+         self.icecaps.append(md)
+-    #}}}
++    # }}}
+ 
+-    def basinsplot3d(self, *args):  #{{{
++    def basinsplot3d(self, *args):  # {{{
+         for i in range(len(self.basins)):
+             self.basins[i].plot3d(*args)
+-    #}}}
++    # }}}
+ 
+-    def caticecaps(self, *args):  #{{{
++    def caticecaps(self, *args):  # {{{
+         # Recover options
+         options = pairoptions(*args)
+         tolerance = options.getfieldvalue('tolerance', .65)
+@@ -371,9 +372,9 @@
+ 
+         # Create mesh radius
+         self.earth.mesh.r = planetradius('earth') * np.ones((md.mesh.numberofvertices, ))
+-    #}}}
++    # }}}
+ 
+-    def caticecaps2d(self, *args):  #{{{
++    def caticecaps2d(self, *args):  # {{{
+         # Recover options
+         options = pairoptions(*args)
+         tolerance = options.getfieldvalue('tolerance', 1e-5)
+@@ -397,9 +398,9 @@
+ 
+         # Plug into earth
+         self.earth = md
+-    #}}}
++    # }}}
+ 
+-    def viscousiterations(self):  #{{{
++    def viscousiterations(self):  # {{{
+         for i in range(len(self.icecaps)):
+             ic = self.icecaps[i]
+             mvi = ic.results.TransientSolution[0].StressbalanceConvergenceNumSteps
+@@ -406,9 +407,9 @@
+             for j in range(1, len(ic.results.TransientSolution) - 1):
+                 mvi = np.max(mvi, ic.results.TransientSolution[j].StressbalanceConvergenceNumSteps)
+             print("{}, {}: {}".format(i, self.icecaps[i].miscellaneous.name, mvi))
+-    #}}}
++    # }}}
+ 
+-    def maxtimestep(self):  #{{{
++    def maxtimestep(self):  # {{{
+         for i in range(len(self.icecaps)):
+             ic = self.icecaps[i]
+             mvi = len(ic.results.TransientSolution)
+@@ -418,9 +419,9 @@
+         mvi = len(self.earth.results.TransientSolution)
+         timei = self.earth.results.TransientSolution[-1].time
+         print("Earth: {}/{}", mvi, timei)
+-    #}}}
++    # }}}
+ 
+-    def transfer(self, string):  #{{{
++    def transfer(self, string):  # {{{
+         # Recover field size in one icecap
+         n = getsubattr(self.icecaps[0], string).shape[0]
+ 
+@@ -441,11 +442,11 @@
+             capfield1 = getsubattr(self.icecaps[0], string)
+             times = capfield1[-1, :]
+             nsteps = len(times)
+-            #}}}
++            # }}}
+             # Initialize #{{{
+             field = np.zeros((self.earth.mesh.numberofvertices + 1, nsteps))
+             field[-1, :] = times  # Transfer the times only, not the values
+-            #}}}
++            # }}}
+             # Transfer all the time fields #{{{
+             for i in range(len(self.icecaps)):
+                 capfieldi = getsubattr(self.icecaps[i], string)
+@@ -452,7 +453,7 @@
+                 for j in range(nsteps):
+                     field[self.transitions[i], j] = capfieldi[0:-1, j]  # Transfer only the values, not the time
+             setsubattr(self.earth, string, field)  # Do not forget to plug the field variable into its final location
+-            #}}}
++            # }}}
+         elif n == (self.icecaps[0].mesh.numberofelements):
+             setsubattr(self.earth, string, np.zeros((self.earth.mesh.numberofelements, ))) # Assign array of zeros to target attribute
+             earth_attr = getsubattr(self.earth, string) # Retrieve reference to target attribute
+@@ -460,9 +461,9 @@
+                 earth_attr[self.eltransitions[i]] = getsubattr(self.icecaps[i], string)
+         else:
+             raise Exception('not supported yet')
+-    #}}}
++    # }}}
+ 
+-    def homogenize(self, noearth=0):  #{{{
++    def homogenize(self, noearth=0):  # {{{
+         mintimestep = np.inf
+ 
+         for i in range(len(self.icecaps)):
+@@ -485,11 +486,11 @@
+         self.earth = ic
+ 
+         return self
+-    #}}}
++    # }}}
+ 
+-    def initializemodels(self):  #{{{
++    def initializemodels(self):  # {{{
+         for i in range(len(self.basins)):
+             md = model()
+             md.miscellaneous.name = self.basins[i].name
+             self.addicecap(md)
+-    #}}}
++    # }}}
+Index: ../trunk-jpl/src/m/classes/solidearth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/solidearth.m	(revision 26358)
+@@ -68,20 +68,20 @@
+ 			%output default:
+ 			self.requested_outputs={'default'};
+ 
+-			%transitions should be a cell array of vectors: 
++			%transitions should be a cell array of vectors:
+ 			self.transitions={};
+-			
+-			%no partitions requested for barystatic contribution: 
++
++			%no partitions requested for barystatic contribution:
+ 			self.partitionice=[];
+ 			self.partitionhydro=[];
+ 			self.partitionocean=[];
+ 
+-			%no external solutions by default: 
++			%no external solutions by default:
+ 			self.external=[];
+ 
+ 			%planet radius
+ 			self.planetradius= planetradius(planet);
+-		
++
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+@@ -115,6 +115,7 @@
+ 			else
+ 				npartice=0;
+ 			end
++
+ 			if ~isempty(self.partitionhydro),
+ 				nparthydro=max(self.partitionhydro)+2;
+ 			else
+Index: ../trunk-jpl/src/m/classes/solidearth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearth.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/solidearth.py	(revision 26358)
+@@ -3,13 +3,12 @@
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from lovenumbers import lovenumbers
++from MatlabFuncs import *
+ from planetradius import planetradius
+ from project3d import project3d
+ from rotational import rotational
+ from solidearthsettings import solidearthsettings
+ from solidearthsolution import solidearthsolution
+-from offlinesolidearthsolution import offlinesolidearthsolution
+-from surfaceload import surfaceload
+ from WriteData import WriteData
+ 
+ 
+@@ -24,9 +23,9 @@
+     - Update translation from solidearth.m
+     """
+ 
+-    def __init__(self, *args): #{{{
++    def __init__(self, *args):  # {{{
+         self.settings           = solidearthsettings()
+-        self.external           = []
++        self.external           = None
+         self.lovenumbers        = lovenumbers()
+         self.rotational         = rotational()
+         self.planetradius       = planetradius('earth')
+@@ -43,8 +42,8 @@
+             self.setdefaultparameters(args[0])
+         else:
+             raise Exception('solidearth constructor error message: zero or one argument only!')
+-    #}}}
+-    def __repr__(self): #{{{
++    # }}}
++    def __repr__(self):  # {{{
+         s = '   solidearthinputs, forcings and settings:\n'
+         s += '{}\n'.format(fielddisplay(self, 'planetradius', 'planet radius [m]'))
+         s += '{}\n'.format(fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
+@@ -57,11 +56,11 @@
+         print(self.settings)
+         print(self.lovenumbers)
+         print(self.rotational)
+-        if self.external:
++        if len(self.external):
+             print(self.external)
+         return s
+-    #}}}
+-    def setdefaultparameters(self, planet): #{{{
++    # }}}
++    def setdefaultparameters(self, planet):  # {{{
+         # Output default
+         self.requested_outputs = ['default']
+ 
+@@ -74,12 +73,12 @@
+         self.partitionocean = []
+ 
+         # No external solutions by default
+-        self.external = []
++        self.external = None
+ 
+         # Planet radius
+         self.planetradius = planetradius(planet)
+-    #}}}
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    # }}}
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+ 
+@@ -89,15 +88,15 @@
+         self.lovenumbers.checkconsistency(md, solution, analyses)
+         self.rotational.checkconsistency(md, solution, analyses)
+         if self.external:
+-            if (not isinstance(self.external,solidearthsolution)) and (not isinstance(self.external,offlinesolidearthsolution)):
++            if not isa(self.external, solidearthsolution):
+                 raise Exception('solidearth consistency check: external field should be a solidearthsolution')
+             self.external.checkconsistency(md, solution, analyses)
+         return md
+-    #}}}
+-    def defaultoutputs(self, md): #{{{
++    # }}}
++    def defaultoutputs(self, md):  # {{{
+         return ['Sealevel']
+-    #}}}
+-    def marshall(self, prefix, md, fid): #{{{
++    # }}}
++    def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
+ 
+@@ -132,14 +131,14 @@
+         else:
+             WriteData(fid, prefix, 'data', 0, 'format', 'Integer', 'name', 'md.solidearth.isexternal')
+ 
+-        #process requested outputs
++        # Process requested outputs
+         outputs = self.requested_outputs
+         pos = np.where(np.asarray(outputs) == 'default')[0]
+         if len(pos):
+-            outputs = np.delete(outputs, pos)  # remove 'default' from outputs
++            outputs = np.delete(outputs, pos) # remove 'default' from outputs
+             outputs = np.append(outputs, self.defaultoutputs(md)) # add defaults
+         WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray')
+-    #}}}
+-    def extrude(self, md): #{{{
++    # }}}
++    def extrude(self, md):  # {{{
+         return self
+-    #}}}
++    # }}}
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.m	(revision 26358)
+@@ -55,41 +55,41 @@
+ 			end
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+-		
+-		%Convergence criterion: absolute, relative and residual
+-		self.reltol=0.01; % 1 percent
+-		self.abstol=NaN;  % default
+ 
+-		%maximum of non-linear iterations.
+-		self.maxiter=5;
++			%Convergence criterion: absolute, relative and residual
++			self.reltol=0.01; % 1 percent
++			self.abstol=NaN;  % default
+ 
+-		%computational flags: 
+-		self.selfattraction=1;
+-		self.elastic=1;
+-		self.viscous=1;
+-		self.rotation=1;
+-		self.grdocean=1;
+-		self.ocean_area_scaling=0;
+-		self.compute_bp_grd=0;
+-		self.isgrd=0;
+-		self.sealevelloading=1;
++			%maximum of non-linear iterations.
++			self.maxiter=5;
+ 
+-		%numerical discretization accuracy
+-		self.degacc=.01;
+-		self.timeacc=1; 
++			%computational flags:
++			self.selfattraction=1;
++			self.elastic=1;
++			self.viscous=1;
++			self.rotation=1;
++			self.grdocean=1;
++			self.ocean_area_scaling=0;
++			self.compute_bp_grd=0;
++			self.isgrd=0;
++			self.sealevelloading=1;
+ 
+-		%how many time steps we skip before we run solidearthsettings solver during transient
+-		self.runfrequency=1;
++			%numerical discretization accuracy
++			self.degacc=.01;
++			self.timeacc=1; 
+ 
+-		%horizontal displacement? (not on by default)
+-		self.horiz=0;
++			%how many time steps we skip before we run solidearthsettings solver during transient
++			self.runfrequency=1;
+ 
+-		%cross section for Ivins model
+-		self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
++			%horizontal displacement? (not on by default)
++			self.horiz=0;
+ 
+-		%no grd model by default: 
+-		self.grdmodel=0; 
++			%cross section for Ivins model
++			self.cross_section_shape=1; %square as default (see iedge in GiaDeflectionCorex)
+ 
++			%no grd model by default:
++			self.grdmodel=0;
++
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   solidearth settings:'));
+@@ -178,7 +178,7 @@
+ 		function self = extrude(self,md) % {{{
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+-		
++			% TODO: Update the following fields so that coverage is complete
+ 			writejsdouble(fid,[modelname '.solidearth.settings.maxiter'],self.maxiter);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.reltol'],self.reltol);
+ 			writejsdouble(fid,[modelname '.solidearth.settings.abstol'],self.abstol);
+Index: ../trunk-jpl/src/m/classes/solidearthsettings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/solidearthsettings.py	(revision 26358)
+@@ -12,7 +12,7 @@
+         solidearthsettings = solidearthsettings()
+     """
+ 
+-    def __init__(self, *args): #{{{
++    def __init__(self, *args):  # {{{
+         self.reltol                 = 0
+         self.abstol                 = 0
+         self.maxiter                = 0
+@@ -36,9 +36,9 @@
+             self.setdefaultparameters()
+         else:
+             raise Exception('constructor not supported')
+-    #}}}
++    # }}}
+ 
+-    def __repr__(self): #{{{
++    def __repr__(self):  # {{{
+         s = '   solidearth settings:\n'
+         s += '{}\n'.format(fielddisplay(self, 'reltol', 'sea level change relative convergence criterion (default, NaN: not applied)'))
+         s += '{}\n'.format(fielddisplay(self, 'abstol', 'sea level change absolute convergence criterion (default, NaN: not applied)'))
+@@ -58,9 +58,9 @@
+         s += '{}\n'.format(fielddisplay(self, 'grdmodel', 'type of deformation model, 0 for no GRD, 1 for spherical GRD model (SESAW model), 2 for half-space planar GRD (visco-elastic model from Ivins)'))
+         s += '{}\n'.format(fielddisplay(self, 'cross_section_shape', '1: square-edged (default). 2: elliptical. See iedge in GiaDeflectionCore'))
+         return s
+-    #}}}
++    # }}}
+ 
+-    def setdefaultparameters(self): #{{{
++    def setdefaultparameters(self):  # {{{
+         # Convergence criterion: absolute, relative, and residual
+         self.reltol = 0.01  # 1 percent
+         self.abstol = np.nan  # default
+@@ -80,7 +80,7 @@
+         self.sealevelloading = 1
+ 
+         # Numerical discretization accuracy
+-        self.degacc = .01
++        self.degacc = 0.01
+         self.timeacc = 1
+ 
+         # How many time steps we skip before we run solidearthsettings solver during transient
+@@ -94,9 +94,9 @@
+ 
+         # No GRD model by default
+         self.grdmodel = 0
+-    #}}}
++    # }}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
+             return md
+ 
+@@ -130,9 +130,9 @@
+             raise RuntimeException('solidearthsettings checkconsistency error message; if bottom pressure grd patterns are requested, solidearth settings class should have isgrd flag on')
+ 
+         return md
+-    #}}}
++    # }}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'name', 'md.solidearth.settings.reltol', 'format', 'Double');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'name', 'md.solidearth.settings.abstol', 'format', 'Double');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'name', 'md.solidearth.settings.maxiter', 'format', 'Integer');
+@@ -144,7 +144,7 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'name', 'md.solidearth.settings.ocean_area_scaling', 'format', 'Boolean');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'runfrequency', 'name', 'md.solidearth.settings.runfrequency', 'format', 'Integer');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'name', 'md.solidearth.settings.degacc', 'format', 'Double');
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale',md.constants.yts);
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'timeacc', 'name', 'md.solidearth.settings.timeacc', 'format', 'Double', 'scale', md.constants.yts);
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'name', 'md.solidearth.settings.horiz', 'format', 'Integer');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevelloading', 'name', 'md.solidearth.settings.sealevelloading', 'format', 'Integer');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isgrd', 'name', 'md.solidearth.settings.isgrd', 'format', 'Integer');
+@@ -151,8 +151,8 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_bp_grd', 'name', 'md.solidearth.settings.compute_bp_grd', 'format', 'Integer');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'grdmodel', 'name', 'md.solidearth.settings.grdmodel', 'format', 'Integer');
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'name', 'md.solidearth.settings.cross_section_shape', 'format', 'Integer');
+-    #}}}
++    # }}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  # {{{
+         return self
+-    #}}}
++    # }}}
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.m	(revision 26358)
+@@ -19,6 +19,14 @@
+ 					error('constructor not supported');
+ 			end
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('%s','         units for time series is (yr)'));
++			fielddisplay(self,'displacementeast','solid-Earth Eastwards bedrock displacement series (m)');
++			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock displacement time series (m)');
++			fielddisplay(self,'displacementup','solid-Earth bedrock uplift time series (m)');
++			fielddisplay(self,'geoid','solid-Earth geoid time series (m)');
++
++		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 	
+ 			self.displacementeast = [];
+@@ -35,14 +43,6 @@
+ 			md = checkfield(md,'fieldname','solidearth.external.geoid','Inf',1,'timeseries',1);
+ 
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('%s','         units for time series is (yr)'));
+-			fielddisplay(self,'displacementeast','solid-Earth Eastwards bedrock displacement series (m)');
+-			fielddisplay(self,'displacementnorth','solid-Earth Northwards bedrock displacement time series (m)');
+-			fielddisplay(self,'displacementup','solid-Earth bedrock uplift time series (m)');
+-			fielddisplay(self,'geoid','solid-Earth geoid time series (m)');
+-
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			yts=md.constants.yts;
+ 
+Index: ../trunk-jpl/src/m/classes/solidearthsolution.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/solidearthsolution.py	(revision 26358)
+@@ -12,19 +12,19 @@
+         solidearthsolution = solidearthsolution()
+     """
+ 
+-    def __init__(self, *args): #{{{
+-        self.displacementeast = None
+-        self.displacementnorth = None
+-        self.displacementup = None
+-        self.geoid = None
++    def __init__(self, *args):  # {{{
++        self.displacementeast = []
++        self.displacementnorth = []
++        self.displacementup = []
++        self.geoid = []
+ 
+         if len(args) == 0:
+             self.setdefaultparameters()
+         else:
+             raise RuntimeError('constructor not supported')
+-    #}}}
++    # }}}
+ 
+-    def __repr__(self): #{{{
++    def __repr__(self):  # {{{
+         s = '         units for time series is (yr)\n'
+         s += '{}\n'.format(fielddisplay(self, 'displacementeast', 'solid-Earth Eastwards bedrock displacement series (m)'))
+         s += '{}\n'.format(fielddisplay(self, 'displacementnorth', 'solid-Earth Northwards bedrock displacement time series (m)'))
+@@ -32,27 +32,30 @@
+         s += '{}\n'.format(fielddisplay(self, 'geoid', 'solid-Earth geoid time series (m)'))
+ 
+         return s
+-    #}}}
++    # }}}
+ 
+-    def setdefaultparameters(self): #{{{
++    def setdefaultparameters(self):  # {{{
+         self.displacementeast = []
+         self.displacementnorth = []
+         self.displacementup = []
+         self.geoid = []
+-    #}}}
++    # }}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         md = checkfield(md, 'fieldname', 'solidearth.external.displacementeast', 'Inf', 1, 'timeseries', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.external.displacementnorth', 'Inf', 1, 'timeseries', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.external.displacementup', 'Inf', 1, 'timeseries', 1)
+         md = checkfield(md, 'fieldname', 'solidearth.external.geoid', 'Inf', 1, 'timeseries', 1)
+-    #}}}
++    # }}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+ 
++        print('sadjsda')
++        exit()
++
+         # Transform our time series into time series rates
+-        if len(np.shape(self.displacementeast)) == 1:
++        if np.shape(self.displacementeast)[1] == 1:
+             print('solidearthsolution.py::marshall: Warning: only one time step provided, assuming the values are rates per year')
+             displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0)
+             displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0)
+@@ -75,8 +78,8 @@
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementup', 'data', displacementup_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementup', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'displacementnorth', 'data', displacementnorth_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.displacementnorth', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'geoid', 'data', geoid_rate,'format', 'DoubleMat', 'name', 'md.solidearth.external.geoid', 'mattype', 1, 'scale', 1 / yts,'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts);
+-    #}}}
++    # }}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  # {{{
+         return self
+-    #}}}
++    # }}}
+Index: ../trunk-jpl/src/m/classes/stressbalance.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/stressbalance.m	(revision 26358)
+@@ -52,30 +52,30 @@
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
+-			 %maximum of non-linear iterations.
+-			 self.maxiter=100;
++			%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;
++			%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;
++			self.FSreconditioning=10^13;
++			self.shelf_dampening=0;
+ 
+-			 %Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
+-			 self.penalty_factor=3;
++			%Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
++			self.penalty_factor=3;
+ 
+-			 %Stop the iterations of rift if below a threshold
+-			 self.rift_penalty_threshold=0;
++			%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;
++			%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'};
++			%output default:
++			self.requested_outputs={'default'};
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+Index: ../trunk-jpl/src/m/classes/surfaceload.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/surfaceload.m	(revision 26358)
+@@ -64,12 +64,12 @@
+ 
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+-			
++
+ 			%deal with ice thickness change: {{{
+ 			if isempty(self.icethicknesschange),
+ 				self.icethicknesschange=zeros(md.mesh.numberofelements+1,1);
+ 			end
+-			
++
+ 			yts=md.constants.yts;
+ 
+ 			if isa(self.icethicknesschange,'cell'),
+Index: ../trunk-jpl/src/m/classes/surfaceload.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/surfaceload.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/surfaceload.py	(revision 26358)
+@@ -50,15 +50,30 @@
+     #}}}
+ 
+     def marshall(self, prefix, md, fid):  #{{{
+-        if np.isnan(self.icethicknesschange).all():
+-            self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1))
+-        if np.isnan(self.waterheightchange).all():
+-            self.waterheightchange = np.zeros((md.mesh.numberofelements + 1))
+-        if np.isnan(self.other).all():
+-            self.other = np.zeros((md.mesh.numberofelements + 1))
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'icethicknesschange', 'name', 'md.solidearth.surfaceload.icethicknesschange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterheightchange', 'name', 'md.solidearth.surfaceload.waterheightchange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'other', 'name', 'md.solidearth.surfaceload.other', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
++        # TODO
++        # - When surfaceload class is used eventually, check premarshall 
++        # modifications against those done in MATLAB
++        #
++
++        # Deal with ice thickness change
++        if np.isempty(self.icethicknesschange):
++            self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1, ))
++
++        yts = md.constants.yts
++
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'icethicknesschange', 'name', 'md.solidearth.surfaceload.icethicknesschange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
++
++        # Deal with ice thickness change
++        if np.isempty(self.waterheightchange):
++            self.waterheightchange = np.zeros((md.mesh.numberofelements + 1, ))
++
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterheightchange', 'name', 'md.solidearth.surfaceload.waterheightchange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
++
++        # Deal with ice thickness change
++        if np.isempty(self.otherchange):
++            self.otherchange = np.zeros((md.mesh.numberofelements + 1, ))
++
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'otherchange', 'name', 'md.solidearth.surfaceload.otherchange', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts, 'scale', 1 / yts)
+     #}}}
+ 
+     def extrude(self, md):  #{{{
+Index: ../trunk-jpl/src/m/classes/transient.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/transient.m	(revision 26358)
+@@ -33,20 +33,20 @@
+ 		function self = deactivateall(self) % {{{
+ 
+ 			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+-			self.issmb           = 0;
+-			self.ismasstransport = 0;
+-			self.isoceantransport= 0;
+-			self.isstressbalance = 0;
+-			self.isthermal       = 0;
+-			self.isgroundingline = 0;
+-			self.isesa           = 0;
++			self.issmb             = 0;
++			self.ismasstransport   = 0;
++			self.isoceantransport  = 0;
++			self.isstressbalance   = 0;
++			self.isthermal         = 0;
++			self.isgroundingline   = 0;
++			self.isesa             = 0;
+ 			self.isdamageevolution = 0;
+-			self.ismovingfront   =0;
+-			self.ishydrology     = 0;
+-			self.issampling      = 0;
+-			self.isslc           = 0;
+-			self.isoceancoupling = 0;
+-			self.amr_frequency	= 0;
++			self.ismovingfront     = 0;
++			self.ishydrology       = 0;
++			self.issampling        = 0;
++			self.isslc             = 0;
++			self.isoceancoupling   = 0;
++			self.amr_frequency     = 0;
+ 
+ 			%default output
+ 			self.requested_outputs={};
+@@ -54,20 +54,20 @@
+ 		function self = setdefaultparameters(self) % {{{
+ 
+ 			%full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+-			self.issmb           = 1;
+-			self.ismasstransport = 1;
+-			self.isoceantransport = 0;
+-			self.isstressbalance = 1;
+-			self.isthermal       = 1;
+-			self.isgroundingline = 0;
+-			self.isesa           = 0;
++			self.issmb             = 1;
++			self.ismasstransport   = 1;
++			self.isoceantransport  = 0;
++			self.isstressbalance   = 1;
++			self.isthermal         = 1;
++			self.isgroundingline   = 0;
++			self.isesa             = 0;
+ 			self.isdamageevolution = 0;
+-			self.ismovingfront   = 0;
+-			self.ishydrology     = 0;
+-			self.issampling      = 0;
+-			self.isslc           = 0;
+-			self.isoceancoupling = 0;
+-			self.amr_frequency	= 0;
++			self.ismovingfront     = 0;
++			self.ishydrology       = 0;
++			self.issampling        = 0;
++			self.isslc             = 0;
++			self.isoceancoupling   = 0;
++			self.amr_frequency     = 0;
+ 
+ 			%default output
+ 			self.requested_outputs={'default'};
+Index: ../trunk-jpl/src/m/classes/transient.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/transient.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/transient.py	(revision 26358)
+@@ -28,7 +28,7 @@
+         self.requested_outputs = []
+ 
+         self.setdefaultparameters()
+-    #}}}
++    # }}}
+ 
+     def __repr__(self):  # {{{
+         s = '   transient solution parameters:\n'
+@@ -48,7 +48,7 @@
+         s += '{}\n'.format(fielddisplay(self, 'amr_frequency', 'frequency at which mesh is refined in simulations with multiple time_steps'))
+         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'list of additional outputs requested'))
+         return s
+-    #}}}
++    # }}}
+ 
+     def defaultoutputs(self, md):  # {{{
+         if self.issmb:
+@@ -55,7 +55,7 @@
+             return ['SmbMassBalance']
+         else:
+             return []
+-    #}}}
++    # }}}
+ 
+     def deactivateall(self):  #{{{
+         self.issmb = 0
+@@ -76,10 +76,11 @@
+         # Default output
+         self.requested_outputs = []
+         return self
+-    #}}}
++    # }}}
+ 
+     def setdefaultparameters(self):  # {{{
+-        #full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
++        # Full analysis: Stressbalance, Masstransport and Thermal but no 
++        # groundingline migration for now
+         self.issmb = 1
+         self.ismasstransport = 1
+         self.isoceantransport = 0
+@@ -98,7 +99,7 @@
+         # Default output
+         self.requested_outputs = ['default']
+         return self
+-    #}}}
++    # }}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         #Early return
+Index: ../trunk-jpl/src/m/classes/verbose.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/verbose.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/verbose.py	(revision 26358)
+@@ -3,28 +3,29 @@
+ 
+ 
+ class verbose(object):
+-    """
+-    VERBOSE class definition
++    """VERBOSE class definition
+ 
+-       Available verbosity levels:
+-          mprocessor  : model processing
+-          module      : modules
+-          solution    : solution sequence
+-          solver      : solver info (extensive)
+-          convergence : convergence criteria
+-          control     : control method
+-          qmu         : sensitivity analysis
+-          autodiff    : AD analysis
+-          smb         : SMB analysis
++    Available verbosity levels:
++        mprocessor  : model processing
++        module      : modules
++        solution    : solution sequence
++        solver      : solver info (extensive)
++        convergence : convergence criteria
++        control     : control method
++        qmu         : sensitivity analysis
++        autodiff    : AD analysis
++        smb         : SMB analysis
+ 
+-       Usage:
+-          verbose = verbose()
+-          verbose = verbose(3)
+-          verbose = verbose('001100')
+-          verbose = verbose('module', True, 'solver', False)
++    Usage:
++        verbose = verbose()
++        verbose = verbose(3)
++        verbose = verbose('001100')
++        verbose = verbose('module', True, 'solver', False)
+ 
+-    WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
+-             Do not modify these sections. See src/c/shared/Numerics/README for more info
++    NOTE:
++    - Some parts of this file are Synchronized with 
++    src/c/shared/Numerics/Verbosity.h. Do not modify these sections. See 
++    src/c/shared/Numerics/README for more info.
+     """
+ 
+     def __init__(self, *args):  # {{{
+@@ -41,7 +42,7 @@
+         #ENDFIELDS
+ 
+         if not len(args):
+-            #Don't do anything
++            # Don't do anything
+             self.solution = True
+             self.qmu = True
+             self.control = True
+@@ -51,9 +52,9 @@
+             binary = args[0]
+             if isinstance(binary, str):
+                 if binary.lower() == 'all':
+-                    binary = 2**11 - 1  #all ones
++                    binary = pow(2, 11) - 1  # all ones
+                     self.BinaryToVerbose(binary)
+-                    self.solver = False  #Do not use by default
++                    self.solver = False  # Do not use by default
+                 else:
+                     binary = int(binary, 2)
+                     self.BinaryToVerbose(binary)
+@@ -61,10 +62,10 @@
+                 self.BinaryToVerbose(int(binary))
+ 
+         else:
+-            #Use options to initialize object
++            # Use options to initialize object
+             self = pairoptions(*args).AssignObjectFields(self)
+ 
+-            #Cast to logicals
++            # Cast to logicals
+             listproperties = vars(self)
+             for fieldname, fieldvalue in list(listproperties.items()):
+                 if isinstance(fieldvalue, bool) or isinstance(fieldvalue, (int, float)):
+Index: ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26357)
++++ ../trunk-jpl/src/m/consistency/ismodelselfconsistent.py	(revision 26358)
+@@ -5,43 +5,42 @@
+         ismodelselfconsistent(md)
+     """
+ 
+-    #initialize consistency as true
++    # Initialize consistency as true
+     md.private.isconsistent = True
+ 
+     # print(md.mesh.z)
+     # exit()
+ 
+-    #Get solution and associated analyses
++    # Get solution and associated analyses
+     solution = md.private.solution
+     analyses = AnalysisConfiguration(solution)
+-    #Go through a model fields, check that it is a class, and call checkconsistency
++    # Go through a model fields, check that it is a class, and call checkconsistency
+     #fields = vars(md)
+     #for field in fields.iterkeys():
+     for field in md.properties():
+-        #Some properties do not need to be checked
++        # Some properties do not need to be checked
+         if field in ['results', 'debug', 'radaroverlay']:
+             continue
+ 
+-        #Check that current field is an object
++        # Check that current field is an object
+         if not hasattr(getattr(md, field), 'checkconsistency'):
+             md.checkmessage('field {} is not an object.'.format(field))
+ 
+-        #Check consistency of the object
+-        exec("md.{}.checkconsistency(md, '{}', {})".format(field, solution, analyses))
++        # Check consistency of the object
++        exec('md.{}.checkconsistency(md, \'{}\', {})'.format(field, solution, analyses))
+ 
+-    #error message if mode is not consistent
++    # Error message if mode is not consistent
+     if not md.private.isconsistent:
+         raise RuntimeError('Model not consistent, see messages above.')
+-#}}}
++# }}}
+ 
+ 
+ def AnalysisConfiguration(solutiontype):  #{{{
+-    '''
+-    ANALYSISCONFIGURATION - return type of analyses, number of analyses
++    """ANALYSISCONFIGURATION - return type of analyses, number of analyses
+ 
+-        Usage:
+-                [analyses] = AnalysisConfiguration(solutiontype)
+-    '''
++    Usage:
++        [analyses] = AnalysisConfiguration(solutiontype)
++    """
+ 
+     if solutiontype == 'StressbalanceSolution':
+         analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis']
+@@ -85,4 +84,4 @@
+         raise TypeError('solution type: {} not supported yet!'.format(solutiontype))
+ 
+     return analyses
+-#}}}
++# }}}
+Index: ../trunk-jpl/src/m/coordsystems/xy2ll.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/xy2ll.py	(revision 26357)
++++ ../trunk-jpl/src/m/coordsystems/xy2ll.py	(revision 26358)
+@@ -3,8 +3,7 @@
+ 
+ 
+ def xy2ll(x, y, sgn, *args):
+-    '''
+-    XY2LL - converts xy to lat long
++    """XY2LL - converts xy to lat long
+ 
+     Converts Polar  Stereographic (X, Y) coordinates for the polar regions to
+     latitude and longitude Stereographic (X, Y) coordinates for the polar
+@@ -12,14 +11,14 @@
+     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)
++        [lat, lon] = xy2ll(x, y, sgn)
++        [lat, lon] = xy2ll(x, y, sgn, central_meridian, standard_parallel)
+ 
+-     - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
+-     						   -1 : south latitude (default is mer = 0  lat = 71)
+-    '''
++    - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
++    						   -1 : south latitude (default is mer = 0  lat = 71)
++    """
+ 
+-    #Get central_meridian and standard_parallel depending on hemisphere
++    # Get central_meridian and standard_parallel depending on hemisphere
+     if len(args) == 2:
+         delta = args[0]
+         slat = args[1]
+@@ -46,13 +45,13 @@
+     # Conversion constant from degrees to radians
+     #cde = 57.29577951
+     # Radius of the earth in meters
+-    re = 6378.273 * 10**3
++    re = 6378.273 * pow(10, 3)
+     # Eccentricity of the Hughes ellipsoid squared
+-    ex2 = .006693883
++    ex2 = 0.006693883
+     # Eccentricity of the Hughes ellipsoid
+     ex = np.sqrt(ex2)
+ 
+-    sl = slat * pi / 180.
++    sl = slat * pi / 180.0
+     rho = np.sqrt(x**2 + y**2)
+     cm = np.cos(sl) / np.sqrt(1.0 - ex2 * (np.sin(sl)**2))
+     T = np.tan((pi / 4.0) - (sl / 2.0)) / ((1.0 - ex * np.sin(sl)) / (1.0 + ex * np.sin(sl)))**(ex / 2.0)
+Index: ../trunk-jpl/src/m/materials/cuffey.py
+===================================================================
+--- ../trunk-jpl/src/m/materials/cuffey.py	(revision 26357)
++++ ../trunk-jpl/src/m/materials/cuffey.py	(revision 26358)
+@@ -2,19 +2,19 @@
+ 
+ 
+ def cuffey(temperature):
+-    """
+-    CUFFEY - calculates ice rigidity as a function of temperature
++    """CUFFEY - calculates ice rigidity as a function of temperature
+ 
+-       rigidity (in s^(1 / 3)Pa) is the flow law parameter in the flow law sigma = B * e(1 / 3)
+-        (Cuffey and Paterson, p75).
+-       temperature is in Kelvin degrees
++    rigidity (in s^(1/3)Pa) is the flow law parameter in the flow law 
++    sigma = B * e(1/3) (Cuffey and Paterson, p75).
+ 
+-       Usage:
+-          rigidity = cuffey(temperature)
++    temperature is in Kelvin degrees
++
++    Usage:
++        rigidity = cuffey(temperature)
+     """
+ 
+-    if np.any(temperature < 0.):
+-        raise RuntimeError("input temperature should be in Kelvin (positive)")
++    if np.any(temperature < 0.0):
++        raise RuntimeError('input temperature should be in Kelvin (positive)')
+ 
+     if np.ndim(temperature) == 2:
+         #T = temperature.reshape(-1, ) - 273.15
+@@ -27,40 +27,40 @@
+     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)
++        rigidity[pos] = pow(10, 8) * (-0.000396645116301 * (T[pos] + 50)**3 + 0.013345579471334 * (T[pos] + 50)**2 - 0.356868703259105 * (T[pos] + 50) + 7.272363035371383)
+     pos = np.nonzero(np.logical_and(-45 <= T, T < -40))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (-0.000396645116301 * (T[pos] + 45)**3 + 0.007395902726819 * (T[pos] + 45)**2 - 0.253161292268336 * (T[pos] + 45) + 5.772078366321591)
++        rigidity[pos] = pow(10, 8) * (-0.000396645116301 * (T[pos] + 45)**3 + 0.007395902726819 * (T[pos] + 45)**2 - 0.253161292268336 * (T[pos] + 45) + 5.772078366321591)
+     pos = np.nonzero(np.logical_and(-40 <= T, T < -35))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (0.000408322072669 * (T[pos] + 40)**3 + 0.001446225982305 * (T[pos] + 40)**2 - 0.208950648722716 * (T[pos] + 40) + 4.641588833612773)
++        rigidity[pos] = pow(10, 8) * (0.000408322072669 * (T[pos] + 40)**3 + 0.001446225982305 * (T[pos] + 40)**2 - 0.208950648722716 * (T[pos] + 40) + 4.641588833612773)
+     pos = np.nonzero(np.logical_and(-35 <= T, T < -30))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (-0.000423888728124 * (T[pos] + 35)**3 + 0.007571057072334 * (T[pos] + 35)**2 - 0.163864233449525 * (T[pos] + 35) + 3.684031498640382)
++        rigidity[pos] = pow(10, 8) * (-0.000423888728124 * (T[pos] + 35)**3 + 0.007571057072334 * (T[pos] + 35)**2 - 0.163864233449525 * (T[pos] + 35) + 3.684031498640382)
+     pos = np.nonzero(np.logical_and(-30 <= T, T < -25))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (0.000147154327025 * (T[pos] + 30)**3 + 0.001212726150476 * (T[pos] + 30)**2 - 0.119945317335478 * (T[pos] + 30) + 3.001000667185614)
++        rigidity[pos] = pow(10, 8) * (0.000147154327025 * (T[pos] + 30)**3 + 0.001212726150476 * (T[pos] + 30)**2 - 0.119945317335478 * (T[pos] + 30) + 3.001000667185614)
+     pos = np.nonzero(np.logical_and(-25 <= T, T < -20))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (-0.000193435838672 * (T[pos] + 25)**3 + 0.003420041055847 * (T[pos] + 25)**2 - 0.096781481303861 * (T[pos] + 25) + 2.449986525148220)
++        rigidity[pos] = pow(10, 8) * (-0.000193435838672 * (T[pos] + 25)**3 + 0.003420041055847 * (T[pos] + 25)**2 - 0.096781481303861 * (T[pos] + 25) + 2.449986525148220)
+     pos = np.nonzero(np.logical_and(-20 <= T, T < -15))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (0.000219771255067 * (T[pos] + 20)**3 + 0.000518503475772 * (T[pos] + 20)**2 - 0.077088758645767 * (T[pos] + 20) + 2.027400665191131)
++        rigidity[pos] = pow(10, 8) * (0.000219771255067 * (T[pos] + 20)**3 + 0.000518503475772 * (T[pos] + 20)**2 - 0.077088758645767 * (T[pos] + 20) + 2.027400665191131)
+     pos = np.nonzero(np.logical_and(-15 <= T, T < -10))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (-0.000653438900191 * (T[pos] + 15)**3 + 0.003815072301777 * (T[pos] + 15)**2 - 0.055420879758021 * (T[pos] + 15) + 1.682390865739973)
++        rigidity[pos] = pow(10, 8) * (-0.000653438900191 * (T[pos] + 15)**3 + 0.003815072301777 * (T[pos] + 15)**2 - 0.055420879758021 * (T[pos] + 15) + 1.682390865739973)
+     pos = np.nonzero(np.logical_and(-10 <= T, T < -5))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (0.000692439419762 * (T[pos] + 10)**3 - 0.005986511201093 * (T[pos] + 10)**2 - 0.066278074254598 * (T[pos] + 10) + 1.418983411970382)
++        rigidity[pos] = pow(10, 8) * (0.000692439419762 * (T[pos] + 10)**3 - 0.005986511201093 * (T[pos] + 10)**2 - 0.066278074254598 * (T[pos] + 10) + 1.418983411970382)
+     pos = np.nonzero(np.logical_and(-5 <= T, T < -2))
+     if len(pos):
+-        rigidity[pos] = 10**8 * (-0.000132282004110 * (T[pos] + 5)**3 + 0.004400080095332 * (T[pos] + 5)**2 - 0.074210229783403 * (T[pos] + 5) + 1.024485188140279)
++        rigidity[pos] = pow(10, 8) * (-0.000132282004110 * (T[pos] + 5)**3 + 0.004400080095332 * (T[pos] + 5)**2 - 0.074210229783403 * (T[pos] + 5) + 1.024485188140279)
+     pos = np.nonzero(-2 <= T)
+     if len(pos):
+-        rigidity[pos] = 10**8 * (-0.000132282004110 * (T[pos] + 2)**3 + 0.003209542058346 * (T[pos] + 2)**2 - 0.051381363322371 * (T[pos] + 2) + 0.837883605537096)
++        rigidity[pos] = pow(10, 8) * (-0.000132282004110 * (T[pos] + 2)**3 + 0.003209542058346 * (T[pos] + 2)**2 - 0.051381363322371 * (T[pos] + 2) + 0.837883605537096)
+ 
+-    #Now make sure that rigidity is positive
++    # Now make sure that rigidity is positive
+     pos = np.nonzero(rigidity < 0)
+-    rigidity[pos] = 1**6
++    rigidity[pos] = pow(1, 6)
+ 
+     return rigidity
+Index: ../trunk-jpl/src/m/materials/paterson.py
+===================================================================
+--- ../trunk-jpl/src/m/materials/paterson.py	(revision 26357)
++++ ../trunk-jpl/src/m/materials/paterson.py	(revision 26358)
+@@ -2,18 +2,19 @@
+ 
+ 
+ def paterson(temperature):
+-    """
+-    PATERSON - figure out the rigidity of ice for a given temperature
++    """PATERSON - figure out the rigidity of ice for a given temperature
+ 
+-       rigidity (in s^(1 / 3)Pa) is the flow law paramter in the flow law sigma = B * e(1 / 3) (Paterson, p97).
+-       temperature is in Kelvin degrees
++    rigidity (in s^(1/3)Pa) is the flow law paramter in the flow law 
++    sigma = B * e(1/3) (Paterson, p97).
+ 
+-       Usage:
+-          rigidity = paterson(temperature)
++    temperature is in Kelvin degrees
++
++    Usage:
++        rigidity = paterson(temperature)
+     """
+ 
+-    if np.any(temperature < 0.):
+-        raise RuntimeError("input temperature should be in Kelvin (positive)")
++    if np.any(temperature < 0.0):
++        raise RuntimeError('input temperature should be in Kelvin (positive)')
+ 
+     if np.ndim(temperature) == 2:
+         #T = temperature.reshape(-1, ) - 273.15
+@@ -23,7 +24,7 @@
+     else:
+         T = temperature - 273.15
+ 
+-    #The routine below is equivalent to:
++    # The routine below is equivalent to:
+ 
+     # n = 3; T = temperature-273
+     # %From paterson,
+@@ -39,41 +40,41 @@
+     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)
++        rigidity[pos1] = pow(10, 8) * (-0.000292866376675 * (T[pos1] + 50)**3 + 0.011672640664130 * (T[pos1] + 50)**2 - 0.325004442485481 * (T[pos1] + 50) + 6.524779401948101)
+     pos2 = np.nonzero(np.logical_and(-45 <= T, T < -40))[0]
+     if len(pos2):
+-        rigidity[pos2] = 10**8 * (-0.000292866376675 * (T[pos2] + 45)**3 + 0.007279645014004 * (T[pos2] + 45)**2 - 0.230243014094813 * (T[pos2] + 45) + 5.154964909039554)
++        rigidity[pos2] = pow(10, 8) * (-0.000292866376675 * (T[pos2] + 45)**3 + 0.007279645014004 * (T[pos2] + 45)**2 - 0.230243014094813 * (T[pos2] + 45) + 5.154964909039554)
+     pos3 = np.nonzero(np.logical_and(-40 <= T, T < -35))[0]
+     if len(pos3):
+-        rigidity[pos3] = 10**8 * (0.000072737147457 * (T[pos3] + 40)**3 + 0.002886649363879 * (T[pos3] + 40)**2 - 0.179411542205399 * (T[pos3] + 40) + 4.149132666831214)
++        rigidity[pos3] = pow(10, 8) * (0.000072737147457 * (T[pos3] + 40)**3 + 0.002886649363879 * (T[pos3] + 40)**2 - 0.179411542205399 * (T[pos3] + 40) + 4.149132666831214)
+     pos4 = np.nonzero(np.logical_and(-35 <= T, T < -30))[0]
+     if len(pos4):
+-        rigidity[pos4] = 10**8 * (-0.000086144770023 * (T[pos4] + 35)**3 + 0.003977706575736 * (T[pos4] + 35)**2 - 0.145089762507325 * (T[pos4] + 35) + 3.333333333333331)
++        rigidity[pos4] = pow(10, 8) * (-0.000086144770023 * (T[pos4] + 35)**3 + 0.003977706575736 * (T[pos4] + 35)**2 - 0.145089762507325 * (T[pos4] + 35) + 3.333333333333331)
+     pos5 = np.nonzero(np.logical_and(-30 <= T, T < -25))[0]
+     if len(pos5):
+-        rigidity[pos5] = 10**8 * (-0.000043984685769 * (T[pos5] + 30)**3 + 0.002685535025386 * (T[pos5] + 30)**2 - 0.111773554501713 * (T[pos5] + 30) + 2.696559088937191)
++        rigidity[pos5] = pow(10, 8) * (-0.000043984685769 * (T[pos5] + 30)**3 + 0.002685535025386 * (T[pos5] + 30)**2 - 0.111773554501713 * (T[pos5] + 30) + 2.696559088937191)
+     pos6 = np.nonzero(np.logical_and(-25 <= T, T < -20))[0]
+     if len(pos6):
+-        rigidity[pos6] = 10**8 * (-0.000029799523463 * (T[pos6] + 25)**3 + 0.002025764738854 * (T[pos6] + 25)**2 - 0.088217055680511 * (T[pos6] + 25) + 2.199331606342181)
++        rigidity[pos6] = pow(10, 8) * (-0.000029799523463 * (T[pos6] + 25)**3 + 0.002025764738854 * (T[pos6] + 25)**2 - 0.088217055680511 * (T[pos6] + 25) + 2.199331606342181)
+     pos7 = np.nonzero(np.logical_and(-20 <= T, T < -15))[0]
+     if len(pos7):
+-        rigidity[pos7] = 10**8 * (0.000136920904777 * (T[pos7] + 20)**3 + 0.001578771886910 * (T[pos7] + 20)**2 - 0.070194372551690 * (T[pos7] + 20) + 1.805165505978111)
++        rigidity[pos7] = pow(10, 8) * (0.000136920904777 * (T[pos7] + 20)**3 + 0.001578771886910 * (T[pos7] + 20)**2 - 0.070194372551690 * (T[pos7] + 20) + 1.805165505978111)
+     pos8 = np.nonzero(np.logical_and(-15 <= T, T < -10))[0]
+     if len(pos8):
+-        rigidity[pos8] = 10**8 * (-0.000899763781026 * (T[pos8] + 15)**3 + 0.003632585458564 * (T[pos8] + 15)**2 - 0.044137585824322 * (T[pos8] + 15) + 1.510778053489523)
++        rigidity[pos8] = pow(10, 8) * (-0.000899763781026 * (T[pos8] + 15)**3 + 0.003632585458564 * (T[pos8] + 15)**2 - 0.044137585824322 * (T[pos8] + 15) + 1.510778053489523)
+     pos9 = np.nonzero(np.logical_and(-10 <= T, T < -5))[0]
+     if len(pos9):
+-        rigidity[pos9] = 10**8 * (0.001676964325070 * (T[pos9] + 10)**3 - 0.009863871256831 * (T[pos9] + 10)**2 - 0.075294014815659 * (T[pos9] + 10) + 1.268434288203714)
++        rigidity[pos9] = pow(10, 8) * (0.001676964325070 * (T[pos9] + 10)**3 - 0.009863871256831 * (T[pos9] + 10)**2 - 0.075294014815659 * (T[pos9] + 10) + 1.268434288203714)
+     pos10 = np.nonzero(np.logical_and(-5 <= T, T < -2))[0]
+     if len(pos10):
+-        rigidity[pos10] = 10**8 * (-0.003748937622487 * (T[pos10] + 5)**3 + 0.015290593619213 * (T[pos10] + 5)**2 - 0.048160403003748 * (T[pos10] + 5) + 0.854987973338348)
++        rigidity[pos10] = pow(10, 8) * (-0.003748937622487 * (T[pos10] + 5)**3 + 0.015290593619213 * (T[pos10] + 5)**2 - 0.048160403003748 * (T[pos10] + 5) + 0.854987973338348)
+     pos11 = np.nonzero(-2 <= T)[0]
+     if len(pos11):
+-        rigidity[pos11] = 10**8 * (-0.003748937622488 * (T[pos11] + 2)**3 - 0.018449844983174 * (T[pos11] + 2)**2 - 0.057638157095631 * (T[pos11] + 2) + 0.746900791092860)
++        rigidity[pos11] = pow(10, 8) * (-0.003748937622488 * (T[pos11] + 2)**3 - 0.018449844983174 * (T[pos11] + 2)**2 - 0.057638157095631 * (T[pos11] + 2) + 0.746900791092860)
+ 
+     #Now make sure that rigidity is positive
+     pos = np.nonzero(rigidity < 0)[0]
+     if len(pos):
+-        rigidity[pos] = 1.e6
++        rigidity[pos] = 1.0e6
+ 
+     return rigidity
+Index: ../trunk-jpl/src/m/mech/mechanicalproperties.m
+===================================================================
+--- ../trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 26357)
++++ ../trunk-jpl/src/m/mech/mechanicalproperties.m	(revision 26358)
+@@ -1,5 +1,5 @@
+ function md=mechanicalproperties(md,vx,vy,varargin)
+-%MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
++%MECHANICALPROPERTIES - compute stress and strain rate for a given velocity
+ %
+ %   this routine computes the components of the (deviatoric) stress tensor,
+ %   the strain rate tensor, and their respective principal directions.
+Index: ../trunk-jpl/src/m/mech/mechanicalproperties.py
+===================================================================
+--- ../trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 26357)
++++ ../trunk-jpl/src/m/mech/mechanicalproperties.py	(revision 26358)
+@@ -4,19 +4,19 @@
+ 
+ 
+ def mechanicalproperties(md, vx, vy, **kwargs):
+-    """
+-    MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
++    """MECHANICALPROPERTIES - compute stress and strain rate for a given 
++    velocity
+ 
+-   this routine computes the components of the stress tensor
+-   strain rate tensor and their respective principal directions.
+-   the results are in the model md: md.results
++    This routine computes the components of the stress tensor strain rate 
++    tensor and their respective principal directions. The results are in the 
++    model md: md.results
+ 
+-   Usage:
+-      md = mechanicalproperties(md, vx, vy)
++    Usage:
++        md = mechanicalproperties(md, vx, vy)
+ 
+-   Example:
+-      md = mechanicalproperties(md, md.initialization.vx, md.initialization.vy)
+-      md = mechanicalproperties(md, md.inversion.vx_obs, md.inversion.vy_obs)
++    Example:
++        md = mechanicalproperties(md, md.initialization.vx, md.initialization.vy)
++        md = mechanicalproperties(md, md.inversion.vx_obs, md.inversion.vy_obs)
+     """
+ 
+     #some checks
+@@ -74,7 +74,7 @@
+ 
+     #some corrections
+     location = np.nonzero(np.logical_and(second_inv == 0, power != 0))
+-    nu[location] = 10**18  #arbitrary maximum viscosity to apply where there is no effective shear
++    nu[location] = pow(10, 18) #arbitrary maximum viscosity to apply where there is no effective shear
+ 
+     if 'matice' in md.materials.__module__:
+         location = np.nonzero(second_inv)
+@@ -82,7 +82,7 @@
+         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
++        nu[location] = pow(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, )
+Index: ../trunk-jpl/src/m/mesh/bamg.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/bamg.py	(revision 26357)
++++ ../trunk-jpl/src/m/mesh/bamg.py	(revision 26358)
+@@ -22,49 +22,95 @@
+ 
+     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)
++    - 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)
++    - hmin :                                minimum edge length (default is 
++                                            1.0e-100)
++    - hmax :                                maximum edge length (default is 
++                                            1.0e100)
++    - hVertices :                           imposed edge length for each vertex 
++                                            (geometry or mesh)
++    - hminVertices :                        minimum edge length for each vertex 
++                                            (mesh)
++    - hmaxVertices :                        maximum edge length for each vertex 
++                                            (mesh)
+ 
+-    - anisomax :          maximum ratio between the smallest and largest edges (default is 1.0e30)
+-    - coeff :             coefficient applied to the metric (2 -> twice as many elements, default is 1)
+-    - cutoff :            scalar used to compute the metric when metric type 2 or 3 are applied
+-    - err :               error used to generate the metric from a field
+-    - errg :              geometric error (default is 0.1)
+-    - field :             field of the model that will be used to compute the metric
+-                                   to apply several fields, use one column per field
+-    - gradation :         maximum ratio between two adjacent edges
+-    - Hessiantype :       0 -> use double P2 projection (default)
+-                            1 -> use Green formula
+-    - KeepVertices :      try to keep initial vertices when adaptation is done on an existing mesh (default 1)
+-    - NoBoundaryRefinement: do not refine boundary, only follow contour provided (default 0). Allow subdomain boundary refinement though
+-    - NoBoundaryRefinementAllBoundaries: do not refine boundary, only follow contour provided (default 0)
+-    - maxnbv :            maximum number of vertices used to allocate memory (default is 1.0e6)
+-    - maxsubdiv :         maximum subdivision of exisiting elements (default is 10)
+-    - metric :            matrix (numberofnodes x 3) used as a metric
+-    - Metrictype :        1 -> absolute error          c / (err coeff^2) * Abs(H)        (default)
+-                                   2 -> relative error          c / (err coeff^2) * Abs(H) / max(s, cutoff * max(s))
+-                                   3 -> rescaled absolute error c / (err coeff^2) * Abs(H) / (smax - smin)
+-    - nbjacoby :          correction used by Hessiantype = 1 (default is 1)
+-    - nbsmooth :          number of metric smoothing procedure (default is 3)
+-    - omega :             relaxation parameter of the smoothing procedure (default is 1.8)
+-    - power :             power applied to the metric (default is 1)
+-    - splitcorners :      split triangles whuch have 3 vertices on the outline (default is 1)
+-    - verbose :           level of verbosity (default is 1)
++    - anisomax :                            maximum ratio between the smallest 
++                                            and largest edges (default is 
++                                            1.0e30)
++    - coeff :                               coefficient applied to the metric 
++                                            (2 -> twice as many elements, 
++                                            default is 1)
++    - cutoff :                              scalar used to compute the metric 
++                                            when metric type 2 or 3 are applied
++    - err :                                 error used to generate the metric 
++                                            from a field
++    - errg :                                geometric error (default is 0.1)
++    - field :                               field of the model that will be 
++                                            used to compute the metric to apply 
++                                            several fields, use one column per 
++                                            field
++    - gradation :                           maximum ratio between two adjacent 
++                                            edges
++    - Hessiantype :                         0 -> use double P2 projection 
++                                            (default)
++                                            1 -> use Green formula
++    - KeepVertices :                        try to keep initial vertices when 
++                                            adaptation is done on an existing 
++                                            mesh (default 1)
++    - NoBoundaryRefinement :                do not refine boundary, only follow 
++                                            contour provided (default 0). Allow 
++                                            subdomain boundary refinement 
++                                            though
++    - NoBoundaryRefinementAllBoundaries :   do not refine boundary, only follow 
++                                            contour provided (default 0)
++    - maxnbv :                              maximum number of vertices used to 
++                                            allocate memory (default is 1.0e6)
++    - maxsubdiv :                           maximum subdivision of exisiting 
++                                            elements (default is 10)
++    - metric :                              matrix (numberofnodes x 3) used as 
++                                            a metric
++    - Metrictype :                          1 -> absolute error 
++                                            c/(err coeff^2) * Abs(H) (default)
++                                            2 -> relative error 
++                                            c / (err coeff^2) * Abs(H) / 
++                                            max(s, cutoff * max(s))
++                                            3 -> rescaled absolute error 
++                                            c / (err coeff^2) * Abs(H) / 
++                                            (smax - smin)
++    - nbjacoby :                            correction used by Hessiantype = 1 
++                                            (default is 1)
++    - nbsmooth :                            number of metric smoothing 
++                                            procedure (default is 3)
++    - omega :                               relaxation parameter of the 
++                                            smoothing procedure (default is 
++                                            1.8)
++    - power :                               power applied to the metric 
++                                            (default is 1)
++    - splitcorners :                        split triangles which have 3 
++                                            vertices on the outline (default is 
++                                            1)
++    - verbose :                             level of verbosity (default is 1)
+ 
+-    - rifts :             followed by an ARGUS file that prescribes the rifts
+-    - toltip :            tolerance to move tip on an existing point of the domain outline
+-    - tracks :            followed by an ARGUS file that prescribes the tracks that the mesh will stick to
+-    - RequiredVertices :  mesh vertices that are required. [x, y, ref]; ref is optional
+-    - tol :               if the distance between 2 points of the domain outline is less than tol, they
+-                             will be merged
++    - 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)
+@@ -75,11 +121,11 @@
+     - Verify that values of third column of bamg_geometry.Vertices and bamg_geometry.Edges are valid (compare to src/m/mesh/bamg.m)
+     """
+ 
+-    #process options
++    # Process options
+     options = pairoptions(*args)
+     #options = deleteduplicates(options, 1)
+ 
+-    #initialize the structures required as input of Bamg
++    # Initialize the structures required as input of Bamg
+     bamg_options = OrderedDict()
+     bamg_geometry = bamggeom()
+     bamg_mesh = bamgmesh()
+@@ -137,13 +183,13 @@
+                     if type(holesfile[0]) in [dict, OrderedDict]:
+                         holes = holesfile
+                     else:
+-                        raise Exception("bamg error message: if 'holes' is a list, its elements must be of type dict or OrderedDict")
++                        raise Exception('bamg error message: if \'holes\' is a list, its elements must be of type dict or OrderedDict')
+                 else:
+                     holes = holesfile
+             elif type(holesfile) in [dict, OrderedDict]:
+                 holes = [holesfile]
+             else:
+-                raise Exception("'holes' type {} not supported yet".format(type(holesfile)))
++                raise Exception('\'holes\' type {} not supported yet'.format(type(holesfile)))
+ 
+         subdomains = []
+         if options.exist('subdomains'):
+@@ -150,7 +196,7 @@
+             subdomainsfile = options.getfieldvalue('subdomains')
+             if type(subdomainsfile) == str:
+                 if not os.path.exists(subdomainsfile):
+-                    raise IOError("bamg error message: file {} not found".format(subdomainsfile))
++                    raise IOError('bamg error message: file {} not found'.format(subdomainsfile))
+ 
+                 # Read subdomains accoridng to its extension
+                 path, name, ext = fileparts(subdomainsfile)
+@@ -165,13 +211,13 @@
+                     if type(subdomainsfile[0]) in [dict, OrderedDict]:
+                         subdomains = subdomainsfile
+                     else:
+-                        raise Exception("bamg error message: if 'subdomains' is a list, its elements must be of type dict or OrderedDict")
++                        raise Exception('bamg error message: if \'subdomains\' is a list, its elements must be of type dict or OrderedDict')
+                 else:
+                     subdomains = subdomainsfile
+             elif type(subdomainsfile) in [dict, OrderedDict]:
+                 subdomains = [subdomainsfile]
+             else:
+-                raise Exception("'subdomains' type {} not supported yet".format(type(subdomainsfile)))
++                raise Exception('\'subdomains\' type {} not supported yet'.format(type(subdomainsfile)))
+ 
+         # Build geometry
+         count = 0
+@@ -178,13 +224,13 @@
+         for i in range(len(domain)):
+             # Check that the domain is closed
+             if (domain[i]['x'][0] != domain[i]['x'][-1] or domain[i]['y'][0] != domain[i]['y'][-1]):
+-                raise RuntimeError("bamg error message: all contours provided in ''domain'' should be closed")
++                raise RuntimeError('bamg error message: all contours provided in \'domain\' should be closed')
+ 
+             # Check that all holes are INSIDE the principle domain outline
+             if i:
+                 flags = ContourToNodes(domain[i]['x'], domain[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
+                 if np.any(np.logical_not(flags)):
+-                    raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
++                    raise RuntimeError('bamg error message: All holes should be strictly inside the principal domain')
+ 
+             # Check orientation
+             nods = domain[i]['nods'] - 1  # the domain is closed (domain[0] = domain[-1])
+@@ -220,12 +266,12 @@
+         for i in range(len(holes)):
+             # heck that the hole is closed
+             if (holes[i]['x'][0] != holes[i]['x'][-1] or holes[i]['y'][0] != holes[i]['y'][-1]):
+-                raise RuntimeError("bamg error message: all contours provided in ''hole'' should be closed")
++                raise RuntimeError('bamg error message: all contours provided in \'hole\' should be closed')
+ 
+             # Check that all holes are INSIDE the principal domain (principal domain should be index 0)
+             flags = ContourToNodes(holes[i]['x'], holes[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
+             if np.any(np.logical_not(flags)):
+-                raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
++                raise RuntimeError('bamg error message: All holes should be strictly inside the principal domain')
+ 
+             # Check that hole is correctly oriented
+             nods = holes[i]['nods'] - 1  # the holes are closed (holes[0] = holes[-1])
+@@ -248,12 +294,12 @@
+         for i in range(len(subdomains)):
+             # Check that the subdomain is closed
+             if (subdomains[i]['x'][0] != subdomains[i]['x'][-1] or subdomains[i]['y'][0] != subdomains[i]['y'][-1]):
+-                raise RuntimeError("bamg error message: all contours provided in ''subdomains'' should be closed")
++                raise RuntimeError('bamg error message: all contours provided in \'subdomains\' should be closed')
+ 
+             # Check that all subdomains are INSIDE the principal domain (principal domain should be index 0)
+             flags = ContourToNodes(subdomains[i]['x'], subdomains[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
+             if np.any(np.logical_not(flags)):
+-                raise RuntimeError("bamg error message: All subdomains should be strictly inside the principal domain")
++                raise RuntimeError('bamg error message: All subdomains should be strictly inside the principal domain')
+ 
+             # Check that subdomain is correctly oriented
+             nods = subdomains[i]['nods'] - 1  # the subdomains are closed (subdomains[0] = subdomains[-1])
+@@ -276,7 +322,7 @@
+ 
+         if options.getfieldvalue('vertical', 0):
+             if np.size(options.getfieldvalue('Markers', [])) != np.size(bamg_geometry.Edges, 0):
+-                raise RuntimeError('for 2d vertical mesh, ''Markers'' option is required, and should be of size ' + str(np.size(bamg_geometry.Edges, 0)))
++                raise RuntimeError('for 2d vertical mesh, \'Markers\' option is required, and should be of size {}'.format(str(np.size(bamg_geometry.Edges, 0))))
+         if np.size(options.getfieldvalue('Markers', [])) == np.size(bamg_geometry.Edges, 0):
+             bamg_geometry.Edges[:, 2] = options.getfieldvalue('Markers')
+ 
+@@ -290,20 +336,20 @@
+             elif ext == '.shp':
+                 rift = shpread(riftfile)
+             else:
+-                raise IOError("bamg error message: file '{}' format not supported (.exp or .shp)".format(riftfile))
++                raise IOError('bamg error message: file \'{}\' format not supported (.exp or .shp)'.format(riftfile))
+ 
+             for i in range(len(rift)):
+                 # Detect whether all points of the rift are inside the domain
+                 flags = ContourToNodes(rift[i]['x'], rift[i]['y'], [domain[0]], 0)[0] # NOTE: Down stack call to FetchPythonData requires contour to be a list of struct if we are not passing in a path to a file, hence the odd addressing: '[domain[0]]'
+                 if np.all(np.logical_not(flags)):
+-                    raise RuntimeError("one rift has all its points outside of the domain outline")
++                    raise RuntimeError('one rift has all its points outside of the domain outline')
+                 elif np.any(np.logical_not(flags)):
+                     # We have LOTS of work to do
+-                    print("Rift tip outside of or on the domain has been detected and is being processed...")
++                    print('Rift tip outside of or on the domain has been detected and is being processed...')
+ 
+                     # Check that only one point is outside (for now)
+                     if np.sum(np.logical_not(flags).astype(int)) != 1:
+-                        raise RuntimeError("bamg error message: only one point outside of the domain is supported at this time")
++                        raise RuntimeError('bamg error message: only one point outside of the domain is supported at this time')
+ 
+                     # Move tip outside to the first position
+                     if not flags[0]:
+@@ -313,7 +359,7 @@
+                         rift[i]['x'] = np.flipud(rift[i]['x'])
+                         rift[i]['y'] = np.flipud(rift[i]['y'])
+                     else:
+-                        raise RuntimeError("bamg error message: only a rift tip can be outside of the domain")
++                        raise RuntimeError('bamg error message: only a rift tip can be outside of the domain')
+ 
+                     # Get coordinate of intersection point
+                     x1 = rift[i]['x'][0]
+@@ -340,7 +386,7 @@
+                             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")
++                                print('moving tip-domain intersection point')
+ 
+                                 # Get position of the closer point
+                                 if tipdis[0] > tipdis[1]:
+@@ -369,7 +415,7 @@
+                                 # 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...")
++                                    raise RuntimeError('bamg error message: a problem occurred...')
+                                 bamg_geometry.Edges = np.vstack((
+                                     bamg_geometry.Edges[0:pos - 1, :],
+                                     np.array([[
+@@ -506,28 +552,28 @@
+     #}}}
+     # Bamg options {{{
+     bamg_options['Crack'] = options.getfieldvalue('Crack', 0)
+-    bamg_options['anisomax'] = options.getfieldvalue('anisomax', 10.**18)
+-    bamg_options['coeff'] = options.getfieldvalue('coeff', 1.)
+-    bamg_options['cutoff'] = options.getfieldvalue('cutoff', 10.**-5)
++    bamg_options['anisomax'] = options.getfieldvalue('anisomax', pow(10.0, 18))
++    bamg_options['coeff'] = options.getfieldvalue('coeff', 1.0)
++    bamg_options['cutoff'] = options.getfieldvalue('cutoff', pow(10.0, -5))
+     bamg_options['err'] = options.getfieldvalue('err', np.array([[0.01]]))
+     bamg_options['errg'] = options.getfieldvalue('errg', 0.1)
+     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['hmin'] = options.getfieldvalue('hmin', pow(10.0, -100))
++    bamg_options['hmax'] = options.getfieldvalue('hmax', pow(10.0, 100))
+     bamg_options['hminVertices'] = options.getfieldvalue('hminVertices', np.empty((0, 1)))
+     bamg_options['hmaxVertices'] = options.getfieldvalue('hmaxVertices', np.empty((0, 1)))
+     bamg_options['hVertices'] = options.getfieldvalue('hVertices', np.empty((0, 1)))
+     bamg_options['KeepVertices'] = options.getfieldvalue('KeepVertices', 1)
+-    bamg_options['maxnbv'] = options.getfieldvalue('maxnbv', 10**6)
+-    bamg_options['maxsubdiv'] = options.getfieldvalue('maxsubdiv', 10.)
++    bamg_options['maxnbv'] = options.getfieldvalue('maxnbv', pow(10, 6))
++    bamg_options['maxsubdiv'] = options.getfieldvalue('maxsubdiv', 10.0)
+     bamg_options['metric'] = options.getfieldvalue('metric', np.empty((0, 1)))
+     bamg_options['Metrictype'] = options.getfieldvalue('Metrictype', 0)
+     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['power'] = options.getfieldvalue('power', 1.0)
+     bamg_options['splitcorners'] = options.getfieldvalue('splitcorners', 1)
+     bamg_options['verbose'] = options.getfieldvalue('verbose', 1)
+     #}}}
+@@ -594,18 +640,18 @@
+     md.mesh.elementconnectivity[np.nonzero(np.isnan(md.mesh.elementconnectivity))] = 0
+     md.mesh.elementconnectivity = md.mesh.elementconnectivity.astype(int)
+ 
+-    #Check for orphan
++    # Check for orphan
+     if np.any(np.logical_not(np.in1d(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements.flat))):
+-        raise RuntimeError("Output mesh has orphans. Check your Domain and / or RequiredVertices")
++        raise RuntimeError('Output mesh has orphans. Check your Domain and/or RequiredVertices')
+ 
+     return md
+ 
+ 
+ def processgeometry(geom, tol, outline):  # {{{
+-    raise RuntimeError("bamg.py::processgeometry is not complete.")
++    raise RuntimeError('bamg.py::processgeometry is not complete.')
+ 
+     # Deal with edges
+-    print("Checking Edge crossing...")
++    print('Checking Edge crossing...')
+     i = 0
+     while (i < np.size(geom.Edges, axis=0)):
+         # Edge counter
+@@ -658,7 +704,7 @@
+                 y2 = y
+ 
+     # Check point outside
+-    print("Checking for points outside the domain...")
++    print('Checking for points outside the domain...')
+     i = 0
+     num = 0
+     while (i < np.size(geom.Vertices, axis=0)):
+@@ -686,7 +732,7 @@
+             i -= 1
+ 
+     if num:
+-        print(("WARNING: %d points outside the domain outline have been removed" % num))
++        print(('WARNING: {} points outside the domain outline have been removed'.format(num)))
+ 
+     """
+     %Check point spacing
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26357)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26358)
+@@ -1,5 +1,4 @@
+-"""
+-A collection of functions that replicate the behavior of MATLAB built-in
++"""A collection of functions that replicate the behavior of MATLAB built-in
+ functions of the same, respective name.
+ 
+ Where possible, users are encouraged to use native and/or the most efficient 
+@@ -7,8 +6,8 @@
+ from the MATLAB to the Python ISSM API more seamless.
+ """
+ 
+-def acosd(X):  #{{{
+-    """ function acosd - Inverse cosine in degrees
++def acosd(X):  # {{{
++    """function acosd - Inverse cosine in degrees
+ 
+     Usage:
+         Y = acosd(X)
+@@ -16,10 +15,10 @@
+     import numpy as np
+ 
+     return np.degrees(np.arccos(X))
+-#}}}
++# }}}
+ 
+-def asind(X):  #{{{
+-    """ function asind - Inverse sine in degrees
++def asind(X):  # {{{
++    """function asind - Inverse sine in degrees
+ 
+     Usage:
+         Y = asind(X)
+@@ -27,10 +26,10 @@
+     import numpy as np
+ 
+     return np.degrees(np.arcsin(X))
+-#}}}
++# }}}
+ 
+-def atand(X):  #{{{
+-    """ function atand - Inverse tangent in degrees
++def atand(X):  # {{{
++    """function atand - Inverse tangent in degrees
+ 
+     Usage:
+         Y = atand(X)
+@@ -38,10 +37,10 @@
+     import numpy as np
+ 
+     return np.degrees(np.arctan(X))
+-#}}}
++# }}}
+ 
+ 
+-def atan2d(Y, X):  #{{{
++def atan2d(Y, X):  # {{{
+     """function atan2d - Four-quadrant inverse tangent in degrees
+ 
+     Usage:
+@@ -50,9 +49,48 @@
+     import numpy as np
+ 
+     return np.degrees(np.arctan2(Y, X))
+-#}}}
++# }}}
+ 
+-def det(a):  #{{{
++def cosd(X):  # {{{
++    """function cosd - Cosine of argument in degrees
++
++    Usage:
++        Y = cosd(X)
++    """
++    import numpy as np
++
++    if type(X) == np.ndarray:
++        Y = np.array([])
++        for x in X:
++            Y = np.append(Y, cosdsingle(x))
++        return Y
++    else:
++        return cosdsingle(X)
++# }}}
++
++def cosdsingle(x):  # {{{
++    """function cosdsingle - Helper function for cosd to reduce repetition of 
++    logic
++
++    Usage:
++        y = cosdsingle(x)
++    """
++    import numpy as np
++
++    while x >= 360:
++        x = x - 360
++
++    if x == 0:
++        return 1
++    elif x == 90 or x == 270:
++        return 0
++    elif x == 180:
++        return -1
++    else:
++        return np.cos(np.radians(x))
++# }}}
++
++def det(a):  # {{{
+     if a.shape == (1, ):
+         return a[0]
+     elif a.shape == (1, 1):
+@@ -60,18 +98,18 @@
+     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))
+-#}}}
++        raise TypeError('MatlabFunc.det only implemented for shape (2, 2), not for shape {}.'.format(a.shape))
++# }}}
+ 
+-def error(msg):  #{{{
++def error(msg):  # {{{
+     raise Exception(msg)
+-#}}}
++# }}}
+ 
+-def etime(t2, t1):  #{{{
++def etime(t2, t1):  # {{{
+     return t2 - t1
+-#}}}
++# }}}
+ 
+-def find(*args):  #{{{
++def find(*args):  # {{{
+     nargs = len(args)
+     if nargs >= 1 or nargs <= 2:
+         X = args[0]
+@@ -85,15 +123,15 @@
+         return indices
+     else:
+         raise Exception('find: must have 1 or 2 arguments')
+-#}}}
++# }}}
+ 
+-def floor(X):  #{{{
++def floor(X):  # {{{
+     import math
+ 
+     return int(math.floor(X))
+-#}}}
++# }}}
+ 
+-def heaviside(x):  #{{{
++def heaviside(x):  # {{{
+     import numpy as np
+ 
+     y = np.zeros_like(x)
+@@ -101,9 +139,9 @@
+     y[np.nonzero(x == 0.)] = 0.5
+ 
+     return y
+-#}}}
++# }}}
+ 
+-def isa(A, dataType):  #{{{
++def isa(A, dataType):  # {{{
+     """FUNCTION ISA
+ 
+     NOTE:
+@@ -111,15 +149,21 @@
+     that it replicates, which takes a string representing the name of a type)
+     """
+     return type(A) == dataType
+-#}}}
++# }}}
+ 
+-def isfile(fileName):  #{{{
++# NOTE: Conflicts with definition of isempty in $ISSM_DIR/src/m/qmu/helpers.py
++#
++# def isempty(A):  # {{{
++#     return len(A) > 0
++# # }}}
++
++def isfile(fileName):  # {{{
+     import os
+ 
+     return os.path.exists(fileName)
+-#}}}
++# }}}
+ 
+-def ismac():  #{{{
++def ismac():  # {{{
+     import platform
+ 
+     if 'Darwin' in platform.system():
+@@ -126,9 +170,9 @@
+         return True
+     else:
+         return False
+-#}}}
++# }}}
+ 
+-def ismember(a, s):  #{{{
++def ismember(a, s):  # {{{
+     import numpy as np
+ 
+     if not isinstance(s, (tuple, list, dict, np.ndarray)):
+@@ -148,15 +192,15 @@
+             b = np.in1d(a.flat, s.flat).reshape(a.shape)
+ 
+     return b
+-#}}}
++# }}}
+ 
+-def isnan(A):  #{{{
++def isnan(A):  # {{{
+     import numpy as np
+ 
+     return np.isnan(A)
+-#}}}
++# }}}
+ 
+-def ispc():  #{{{
++def ispc():  # {{{
+     import platform
+ 
+     if 'Windows' in platform.system():
+@@ -163,41 +207,80 @@
+         return True
+     else:
+         return False
+-#}}}
++# }}}
+ 
+-def isprop(obj, PropertyName):  #{{{
++def isprop(obj, PropertyName):  # {{{
+     return hasattr(obj, PropertyName)
+-#}}}
++# }}}
+ 
+-def mod(a, m):  #{{{
++def mod(a, m):  # {{{
+     return a % m
+-#}}}
++# }}}
+ 
+-def pause(n):  #{{{
++def pause(n):  # {{{
+     import time
+ 
+     time.sleep(n)
+-#}}}
++# }}}
+ 
+-def pwd():  #{{{
++def pwd():  # {{{
+     import os
+ 
+     return os.getcwd()
+-#}}}
++# }}}
+ 
+-def oshostname():  #{{{
++def oshostname():  # {{{
+     import socket
+ 
+     return socket.gethostname()
+-#}}}
++# }}}
+ 
+-def rem(a, b):  #{{{
++def rem(a, b):  # {{{
+     return a % b
+-#}}}
++# }}}
+ 
+-def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):  #{{{
++def sind(X):  # {{{
++    """function sind - Sine of argument in degrees
++
++    Usage:
++        Y = sind(X)
++    """
+     import numpy as np
+ 
++    if type(X) == np.ndarray:
++        Y = np.array([])
++        for x in X:
++            Y = np.append(Y, sindsingle(x))
++        return Y
++    else:
++        return sindsingle(X)
++# }}}
++
++def sindsingle(x):  # {{{
++    """function sindsingle - Helper function for sind to reduce repetition of 
++    logic
++
++    Usage:
++        y = sindsingle(x)
++    """
++    import numpy as np
++
++    while x >= 360:
++        x = x - 360
++
++    if x == 0 or x == 180:
++        return 0
++    elif x == 90:
++        return 1
++    elif x == 270:
++        return -1
++    else:
++        return np.sin(np.radians(x))
++# }}}
++
++def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):  # {{{
++    import numpy as np
++
+     if not m:
+         m = np.max(ivec)
+     if not n:
+@@ -209,23 +292,23 @@
+         a[i - 1, j - 1] += s
+ 
+     return a
+-#}}}
++# }}}
+ 
+-def strcmp(s1, s2):  #{{{
++def strcmp(s1, s2):  # {{{
+     if s1 == s2:
+         return True
+     else:
+         return False
+-#}}}
++# }}}
+ 
+-def strcmpi(s1, s2):  #{{{
++def strcmpi(s1, s2):  # {{{
+     if s1.lower() == s2.lower():
+         return True
+     else:
+         return False
+-#}}}
++# }}}
+ 
+-def strjoin(*args):  #{{{
++def strjoin(*args):  # {{{
+     nargs = len(args)
+     if nargs >= 1 or nargs <= 2:
+         sep = ' '
+@@ -234,18 +317,18 @@
+         return sep.join(args[0])
+     else:
+         raise Exception('strjoin: must have 1 or 2 arguments')
+-#}}}
++# }}}
+ 
+-def strncmp(s1, s2, n):  #{{{
++def strncmp(s1, s2, n):  # {{{
+     if s1[0:n] == s2[0:n]:
+         return True
+     else:
+         return False
+-#}}}
++# }}}
+ 
+-def strncmpi(s1, s2, n):  #{{{
++def strncmpi(s1, s2, n):  # {{{
+     if s1.lower()[0:n] == s2.lower()[0:n]:
+         return True
+     else:
+         return False
+-#}}}
++# }}}
+Index: ../trunk-jpl/src/m/miscellaneous/pretty_print.m
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/pretty_print.m	(revision 26357)
++++ ../trunk-jpl/src/m/miscellaneous/pretty_print.m	(revision 26358)
+@@ -29,12 +29,12 @@
+ 	if shape(1)>6
+ 		if shape(2)>6
+ 			output=sprintf('[[%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(1,1),data(1,2),data(1,3),data(1,end-2),data(1,end-1),data(1,end));
+-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(2,1),data(2,2),data(2,3),data(2,end-2),data(2,end-1),data(2,end));
+-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(3,1),data(3,2),data(3,3),data(3,end-2),data(3,end-1),data(3,end));
++			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(2,1),data(2,2),data(2,3),data(2,end-2),data(2,end-1),data(2,end));
++			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(3,1),data(3,2),data(3,3),data(3,end-2),data(3,end-1),data(3,end));
+ 			output=sprintf('%s ...\n',output);
+-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(end-2,1),data(end-2,2),data(end-2,3),data(end-2,end-2),data(end-2,end-1),data(end-2,end));
+-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',data(end-1,1),data(end-1,2),data(end-1,3),data(end-1,end-2),data(end-1,end-1),data(end-1,end));
+-			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]]',data(end,1),data(end,2),data(end,3),data(end,end-2),data(end,end-1),data(end,end));
++			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(end-2,1),data(end-2,2),data(end-2,3),data(end-2,end-2),data(end-2,end-1),data(end-2,end));
++			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]\n',output,data(end-1,1),data(end-1,2),data(end-1,3),data(end-1,end-2),data(end-1,end-1),data(end-1,end));
++			output=sprintf('%s [%.8f %.8f %.8f ... %.8f %.8f %.8f]]',output,data(end,1),data(end,2),data(end,3),data(end,end-2),data(end,end-1),data(end,end));
+ 		else
+ 			output=sprintf('[[%.8f]\n',data(1,:));
+ 			output=sprintf('%s [%.8f]\n',output,data(2,:));
+Index: ../trunk-jpl/src/m/plot/checkplotoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/checkplotoptions.py	(revision 26357)
++++ ../trunk-jpl/src/m/plot/checkplotoptions.py	(revision 26358)
+@@ -2,23 +2,22 @@
+ 
+ 
+ def checkplotoptions(md, options):
+-    '''
+-    CHECKPLOTOPTIONS - build a structure that holds all plot options
++    """CHECKPLOTOPTIONS - build a structure that holds all plot options
+ 
+-        Usage:
+-            options = checkplotoptions(md, options)
++    Usage:
++        options = checkplotoptions(md, options)
+ 
+-        See also: PLOTMODEL
++    See also: PLOTMODEL
+ 
+-        NOTE: not fully implemented yet
+-    '''
++    NOTE: not fully implemented yet
++    """
+ 
+     # {{{ units
+     if options.exist('unit'):
+         if 'km' in options.getfieldvalue('unit', 'km'):
+-            options.changefieldvalue('unit', 10**-3)
++            options.changefieldvalue('unit', pow(10, -3))
+         elif '100km' in options.getfieldvalue('unit', '100km'):
+-            options.changefieldvalue('unit', 10**-5)
++            options.changefieldvalue('unit', pow(10, -5))
+     # }}}
+     # {{{ density
+     if options.exist('density'):
+@@ -61,7 +60,7 @@
+         text = options.getfieldvalue('text', 'default text')
+         textlist.extend([text] if isinstance(text, str) else text)
+         numtext = len(textlist)
+-    # text position
++        # text position
+         textpos = options.getfieldvalue('textposition', [0.5, 0.5])
+         if not isinstance(textpos, list):
+             raise Exception('textposition should be passed as a list')
+@@ -74,7 +73,7 @@
+         if len(textx) != numtext or len(texty) != numtext:
+             raise Exception('textposition should contain one list of x, y vertices for every text instance')
+ 
+-    # font size
++        # font size
+         if options.exist('textfontsize'):
+             textfontsize = options.getfieldvalue('textfontsize', 12)
+             sizelist = []
+@@ -84,7 +83,7 @@
+         if len(sizelist) == 1:
+             sizelist = np.tile(sizelist, numtext)
+ 
+-    # font color
++        # font color
+         if options.exist('textcolor'):
+             textcolor = options.getfieldvalue('textcolor', 'k')
+             colorlist = []
+@@ -94,7 +93,7 @@
+         if len(colorlist) == 1:
+             colorlist = np.tile(colorlist, numtext)
+ 
+-    # textweight
++        # textweight
+         if options.exist('textweight'):
+             textweight = options.getfieldvalue('textweight')
+             weightlist = []
+@@ -104,7 +103,7 @@
+         if len(weightlist) == 1:
+             weightlist = np.tile(weightlist, numtext)
+ 
+-    # text rotation
++        # text rotation
+         if options.exist('textrotation'):
+             textrotation = options.getfieldvalue('textrotation', 0)
+             rotationlist = []
+@@ -151,7 +150,7 @@
+     # {{{ northarrow
+     if options.exist('northarrow'):
+         if 'on' in options.getfieldvalue('northarrow', 'on'):
+-            #default values
++            # default values
+             Lx = max(md.mesh.x) - min(md.mesh.x)
+             Ly = max(md.mesh.y) - min(md.mesh.y)
+             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])
+Index: ../trunk-jpl/src/m/solve/loadresultfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultfromdisk.py	(revision 26357)
++++ ../trunk-jpl/src/m/solve/loadresultfromdisk.py	(revision 26358)
+@@ -3,18 +3,16 @@
+ 
+ 
+ def loadresultfromdisk(filename, step, name, *args):  # {{{
+-    """
+-    LOADRESULTFROMDISK - load specific result of solution sequence from disk
++    """LOADRESULTFROMDISK - load specific result of solution sequence from disk
+     file "filename"
+ 
+-        Usage:
+-            variable = loadresultsfromdisk(filename, step, name)
++    Usage:
++        variable = loadresultsfromdisk(filename, step, name)
+ 
+-        TODO:
+-        - Test this module against output of src/m/solve/loadresultsfromdisk.m
++    TODO:
++    - Test this module against output of src/m/solve/loadresultsfromdisk.m
+     """
+-    print('Got hwrwefew')
+-    exit()
++
+     # Open file
+     try:
+         fid = open(filename, 'rb')
+@@ -58,6 +56,19 @@
+                 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')))
++            elif datatype == 5:
++                # TODO:
++                # - Check that the following results in the same output as 
++                # MATLAB
++                #
++                N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
++                fieldr = np.zeros(shape=(M, N), dtype=float)
++                fieldi = np.zeros(shape=(M, N), dtype=float)
++                for i in range(M):
++                    fieldr[i, :] = struct.unpack('{}d'.format(N), fid.read(N * struct.calcsize('d')))
++                    fieldi[i, :] = struct.unpack('{}d'.format(N), fid.read(N * struct.calcsize('d')))
++                field = np.vectorize(complex)(fieldr, fieldi)
++                print(field)
+             else:
+                 raise TypeError("cannot read data of type {}".format(datatype))
+ 
+Index: ../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26357)
++++ ../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26358)
+@@ -1,4 +1,6 @@
+ import os
++import subprocess
++
+ from helpers import *
+ from loadresultsfromdisk import loadresultsfromdisk
+ from MatlabFuncs import *
+Index: ../trunk-jpl/src/m/solve/loadresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 26357)
++++ ../trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 26358)
+@@ -15,7 +15,7 @@
+ 
+     # Check number of inputs/outputs
+     if not md or not filename:
+-        raise ValueError("loadresultsfromdisk: error message.")
++        raise ValueError('loadresultsfromdisk: error message.')
+ 
+     if not md.qmu.isdakota:
+ 
+@@ -30,7 +30,7 @@
+             print(err_msg)
+             return
+ 
+-        # Initialize md.results if not a structure yet
++        # Initialize md.results if it is not a structure yet
+         if not isinstance(md.results, results):
+             md.results = results()
+ 
+@@ -37,7 +37,7 @@
+         # Load results onto model
+         structure = parseresultsfromdisk(md, filename, not md.settings.io_gather)
+         if not structure:
+-            raise RuntimeError("No result found in binary file '{}'. Check for solution crash.".format(filename))
++            raise RuntimeError('No result found in binary file \'{}\'. Check for solution crash.'.format(filename))
+         if not hasattr(structure[0], 'SolutionType'):
+             if hasattr(structure[-1], 'SolutionType'):
+                 structure[0].SolutionType = structure[-1].SolutionType
+@@ -63,7 +63,7 @@
+             setattr(getattr(md.results, structure[0].SolutionType)[0], 'outlog', '')
+ 
+         if getattr(md.results, structure[0].SolutionType)[0].errlog:
+-            print("loadresultsfromdisk info message: error during solution. Check your errlog and outlog model fields.")
++            print('loadresultsfromdisk info message: error during solution. Check your errlog and outlog model fields.')
+ 
+         # If only one solution, extract it from list for user friendliness
+         if len(structure) == 1 and structure[0].SolutionType != 'TransientSolution':
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 26357)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 26358)
+@@ -46,7 +46,7 @@
+ 	solutionstring = 'StressbalanceSolution';
+ elseif strcmpi(solutionstring,'mt') || strcmpi(solutionstring,'Masstransport')
+ 	solutionstring = 'MasstransportSolution';
+-elseif strcmpi(solutionstring,'oceanmt') || strcmpi(solutionstring,'Oceantransport')
++elseif strcmpi(solutionstring,'oceant') || strcmpi(solutionstring,'Oceantransport')
+ 	solutionstring = 'OceantransportSolution';
+ elseif strcmpi(solutionstring,'th') || strcmpi(solutionstring,'Thermal')
+ 	solutionstring = 'ThermalSolution';
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 26357)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 26358)
+@@ -83,7 +83,7 @@
+     elif solutionstring.lower() == 'smp' or solutionstring.lower() == 'sampling':
+         solutionstring = 'SamplingSolution'
+     else:
+-        raise ValueError("solutionstring '%s' not supported!" % solutionstring)
++        raise ValueError('solutionstring {} not supported!'.format(solutionstring))
+     options = pairoptions('solutionstring', solutionstring, *args)
+ 
+     # Recover some fields
+@@ -100,10 +100,11 @@
+             print("checking model consistency")
+         ismodelselfconsistent(md)
+ 
++    # If we are restarting, actually use the provided runtime name
++    restart = options.getfieldvalue('restart', '')
+     # First, build a runtime name that is unique
+-    restart = options.getfieldvalue('restart', '')
+     if restart == 1:
+-        pass  # do nothing
++        pass # Leave the runtimename as is
+     else:
+         if not isempty(restart):
+             md.private.runtimename = restart
+@@ -129,24 +130,31 @@
+     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
+ 
+-    # Stop here if batch mode
+-    if options.getfieldvalue('batch', 'no') == 'yes':
+-        print('batch mode requested: not launching job interactively')
+-        print('launch solution sequence on remote cluster by hand')
+-        return md
++    # Upload all required files
++    modelname = md.miscellaneous.name
++    filelist = [modelname + '.bin', modelname + '.toolkits']
+ 
+-    # Upload all required files:
+-    modelname = md.miscellaneous.name
+-    filelist = [modelname + '.bin ', modelname + '.toolkits ', modelname + '.queue ']
++    if ispc():
++        filelist.append(modelname + '.bat')
++    else:
++        filelist.append(modelname + '.queue')
++
+     if md.qmu.isdakota:
+         filelist.append(modelname + '.qmu.in')
+ 
+-    if not restart:
++    if isempty(restart):
+         cluster.UploadQueueJob(md.miscellaneous.name, md.private.runtimename, filelist)
+ 
+     # Launch job
+     cluster.LaunchQueueJob(md.miscellaneous.name, md.private.runtimename, filelist, restart, batch)
+ 
++    # Return if batch
++    if batch:
++        if md.verbose.solution:
++            print('batch mode requested: not launching job interactively')
++            print('launch solution sequence on remote cluster by hand')
++        return md
++
+     # Wait on lock
+     if md.settings.waitonlock > 0:
+         # Wait for done file
+Index: ../trunk-jpl/src/m/solve/solveslm.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solveslm.m	(revision 26357)
++++ ../trunk-jpl/src/m/solve/solveslm.m	(revision 26358)
+@@ -2,16 +2,16 @@
+ %SOLVESLM - apply solution sequence for this sealevel model
+ %
+ %   Usage:
+-%      slm=solve(slm,solutionstring,varargin)
++%      slm=solveslm(slm,solutionstring,varargin)
+ %      where varargin is a lit of paired arguments of string OR enums
+ %
+ %   solution types available comprise:
+ %      - 'Transient'
+ %
+-%  extra options:
++%   extra options:
+ %
+ %   Examples:
+-%      slm=solve(slm,'Transient');
++%      slm=solveslm(slm,'Transient');
+ 
+ %recover and process solve options
+ if strcmpi(solutionstringi,'tr') || strcmpi(solutionstringi,'Transient')
+Index: ../trunk-jpl/src/m/solve/solveslm.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solveslm.py	(revision 26357)
++++ ../trunk-jpl/src/m/solve/solveslm.py	(revision 26358)
+@@ -12,7 +12,7 @@
+     """SOLVESLM - apply solution sequence for this sealevel model
+ 
+     Usage:
+-        slm=solve(slm,solutionstring,varargin)
++        slm=solveslm(slm,solutionstring,varargin)
+         where varargin is a lit of paired arguments of string OR enums
+ 
+     solution types available comprise:
+@@ -21,9 +21,12 @@
+     extra options:
+ 
+     Examples:
+-        slm=solve(slm,'Transient');
++        slm=solveslm(slm,'Transient');
+     """
+ 
++    print('Yep')
++    exit()
++
+     # Recover and process solve options
+     if solutionstringi.lower() == 'tr' or solutionstringi.lower() == 'transient':
+         solutionstring = 'TransientSolution'
+Index: ../trunk-jpl/test/Archives/Archive2002.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2003.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2005.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2007.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2008.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2010.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2011.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2021.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2090.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive2101.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test2001.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26358)
+@@ -1,10 +1,9 @@
+ #Test Name: SquareSheetConstrainedGia2d
+ #GIA test, based off of test101. Running default GIA Ivins class.
+-from socket import gethostname
+-
+ import numpy as np
+ 
+ from materials import *
++from MatlabFuncs import *
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -28,7 +27,7 @@
+ md.materials.lame_mu = [1.45e11, 6.7e10]
+ md.materials.viscosity = [1e21, 0]
+ md.initialization.sealevel = np.zeros(md.mesh.numberofvertices)
+-md.solidearth.settings.cross_section_shape = 1 # for square-edged x-section 
++md.solidearth.settings.cross_section_shape = 1 # for square-edged x-section
+ md.solidearth.settings.grdocean = 0 # do not compute sea level, only deformation
+ md.solidearth.settings.sealevelloading = 0 # do not compute sea level, only deformation
+ md.solidearth.requested_outputs = ['Sealevel', 'BedGRD']
+@@ -56,8 +55,7 @@
+ md.transient.isslc = 1
+ 
+ #Solve for GIA deflection
+-md.cluster = generic('name', gethostname(), 'np', 3)
+-md.verbose = verbose('11111111111')
++md.cluster = generic('name', oshostname(), 'np', 3)
+ md.verbose.solver = 0
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2002.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary thickness of 100: 
+ md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+@@ -24,12 +23,12 @@
+ late=asind(ze./re);
+ longe=atan2d(ye,xe);
+ pos=find(late < -80);
+-md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+ posant=pos;
+ 
+ %greenland
+ pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+-md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
++md.masstransport.spcthickness(md.mesh.elements(pos,:))=md.masstransport.spcthickness(md.mesh.elements(pos,:))-100;
+ posgre=pos;
+ 
+ %elastic loading from love numbers:
+Index: ../trunk-jpl/test/NightlyRun/test2002.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2002.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2002.py	(revision 26358)
+@@ -1,23 +1,15 @@
+ #Test Name: EarthSlc
+ import numpy as np
+ 
+-from MatlabFuncs import *
+-
+ from gmshplanet import *
+ from gmtmask import *
+ from lovenumbers import *
+ from materials import *
+ from model import *
+-from parameterize import *
+ from paterson import *
+ from solve import *
+ 
+ 
+-# Mesh earth
+-#
+-# NOTE: In MATLAB, we currently use cached mesh to account for differences in 
+-# mesh generated under Linux versus under macOS
+-#
+ md = model()
+ md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
+ 
+@@ -40,12 +32,12 @@
+ late = asind(ze / re)
+ longe = atan2d(ye, xe)
+ pos = np.where(late < -80)[0]
+-md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+ posant = pos
+ 
+ # Greenland
+ pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
+-md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
+ posgre = pos
+ 
+ # Elastic loading from love numbers:
+@@ -59,8 +51,11 @@
+ oceanmask[pos] = 1
+ 
+ icemask = np.ones((md.mesh.numberofvertices, ))
+-icemask[md.mesh.elements[posant]] = -1
+-icemask[md.mesh.elements[posgre]] = -1
++# NOTE: Need to be careful here: when using multidimensional array elements to 
++# address a one-dimensional array in MATLAB, only first column is used
++#
++icemask[md.mesh.elements[posant][:, 0] - 1] = -1
++icemask[md.mesh.elements[posgre][:, 0] - 1] = -1
+ 
+ md.mask.ice_levelset = icemask
+ md.mask.ocean_levelset = oceanmask
+Index: ../trunk-jpl/test/NightlyRun/test2003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2003.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+@@ -23,6 +22,7 @@
+ 
+ late=asind(ze./re);
+ longe=atan2d(ye,xe);
++
+ %greenland
+ pos=find(late>60 & late<90 & longe>-75 & longe<-15);
+ md.masstransport.spcthickness(md.mesh.elements(pos,:))= md.masstransport.spcthickness(md.mesh.elements(pos,:))-1000;
+@@ -30,7 +30,6 @@
+ 
+ %elastic loading from love numbers:
+ md.solidearth.lovenumbers=lovenumbers('maxdeg',100);
+-
+ %}}}
+ %mask:  {{{
+ mask=gmtmask(md.mesh.lat,md.mesh.long);
+@@ -69,12 +68,12 @@
+ md.solidearth.requested_outputs={'Sealevel','Bed', 'BedEast', 'BedNorth'};
+ 
+ %Physics: 
+-md.transient.issmb=0; 
++md.transient.issmb=0;
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
+ md.transient.isslc=1;
+- 
++
+ md.timestepping.start_time=0;
+ md.timestepping.time_step=1;
+ md.timestepping.final_time=1;
+Index: ../trunk-jpl/test/NightlyRun/test2003.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2003.py	(revision 26358)
+@@ -1,28 +1,22 @@
+ #Test Name: EarthSlc_rotationalFeedback
+ import numpy as np
+ 
+-from socket import gethostname
+-
+ from gmshplanet import *
+ from gmtmask import *
+ from lovenumbers import *
++from MatlabFuncs import *
+ from model import *
+ from paterson import *
+ from solve import *
+ 
+ 
+-# Mesh earth
+-#
+-# NOTE: In MATLAB, we currently use cached mesh to account for differences in 
+-# mesh generated under Linux versus under macOS
+-#
+ md = model()
+ md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) # 700 km resolution mesh
+ 
+ # Geometry for the bed, arbitrary thickness of 100
+-md.geometry.bed = -1 * np.ones(md.mesh.numberofvertices)
++md.geometry.bed = -1 * np.ones((md.mesh.numberofvertices, ))
+ md.geometry.base = md.geometry.bed
+-md.geometry.thickness = 1000 * np.ones(md.mesh.numberofvertices)
++md.geometry.thickness = 1000 * np.ones((md.mesh.numberofvertices, ))
+ md.geometry.surface = md.geometry.bed + md.geometry.thickness
+ 
+ # Parameterize slc solution:
+@@ -37,9 +31,10 @@
+ 
+ late = asind(ze / re)
+ longe = atan2d(ye, xe)
++
+ # Greenland
+ pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
+-md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 1000
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 1000
+ posice = pos
+ 
+ # Elastic loading from love numbers
+@@ -49,7 +44,7 @@
+ # Mask: {{{
+ mask = gmtmask(md.mesh.lat, md.mesh.long)
+ icemask = np.ones(md.mesh.numberofvertices)
+-icemask[md.mesh.elements[posice]] = -1
++icemask[md.mesh.elements[posice, :] - 1] = -1
+ md.mask.ice_levelset = icemask
+ oceanmask = -1 * np.ones(md.mesh.numberofvertices)
+ pos = np.where(mask == 0)[0]
+@@ -99,7 +94,7 @@
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 0
+ md.solidearth.settings.viscous = 0
+-md.cluster = generic('name', gethostname(), 'np', 3)
++md.cluster = generic('name', oshostname(), 'np', 3)
+ #md.verbose = verbose('111111111')
+ md = solve(md, 'Transient')
+ SnoRotation = md.results.TransientSolution.Sealevel
+@@ -112,7 +107,7 @@
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
+ md.solidearth.settings.viscous = 0
+-md.cluster = generic('name', gethostname(), 'np', 3)
++md.cluster = generic('name', oshostname(), 'np', 3)
+ #md.verbose = verbose('111111111')
+ md = solve(md, 'Transient')
+ SRotation = md.results.TransientSolution.Sealevel
+Index: ../trunk-jpl/test/NightlyRun/test2004.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2004.m	(revision 26358)
+@@ -71,7 +71,7 @@
+ %Go through basins and mesh:  %{{{
+ %meshing parameters:  {{{
+ hmin=500; hmax=700; hmin=hmin*1000; hmax=hmax*1000; 
+-tolerance=100; %tolerance of 100m on Earth position when mergin 3d meshes
++tolerance=100; %tolerance of 100m on Earth position when merging 3d meshes
+ threshold=5;
+ defaultoptions={'KeepVertices',0,'MaxCornerAngle',0.0000000001,'NoBoundaryRefinement',1}; 
+ alreadyloaded=0;
+@@ -268,8 +268,6 @@
+ 		longGIS=delH(:,1);
+ 		latGIS=delH(:,2);
+ 		delHGIS=delH(:,3);
+-		% points=[longGIS,latGIS];
+-		% index=delaunayn(points);
+ 		index=BamgTriangulate(longGIS, latGIS);
+ 		lat=md.mesh.lat;
+ 		long=md.mesh.long+360;
+@@ -276,14 +274,11 @@
+ 		pos=find(long>360);
+ 		long(pos)=long(pos)-360;
+ 		delHGIS=InterpFromMeshToMesh2d(index,longGIS,latGIS,delHGIS,long,lat);
+-		delHGISe=delHGIS(md.mesh.elements)*[1;1;1]/3;
+ 
+ 		delH=textread('../Data/GLA_delH_trend_15regions.txt');
+ 		longGLA=delH(:,1);
+ 		latGLA=delH(:,2);
+ 		delHGLA=sum(delH(:,3:end),2);
+-		% points=[longGLA,latGLA];
+-		% index=delaunayn(points);
+ 		index=BamgTriangulate(longGLA, latGLA);
+ 		lat=md.mesh.lat; 
+ 		long=md.mesh.long+360; 
+@@ -290,10 +285,9 @@
+ 		pos=find(long>360);
+ 		long(pos)=long(pos)-360;
+ 		delHGLA=InterpFromMeshToMesh2d(index,longGLA,latGLA,delHGLA,long,lat);
+-		delHGLAe=delHGLA(md.mesh.elements)*[1;1;1]/3;
+ 
+ 		pos=find(delHGIS);
+-		md.masstransport.spcthickness(pos)= md.masstransport.spcthickness(pos)-delHGIS(pos)/100;
++		md.masstransport.spcthickness(pos) = md.masstransport.spcthickness(pos)-delHGIS(pos)/100;
+ 		pos=find(delHGLA);
+ 		md.masstransport.spcthickness(pos)= md.masstransport.spcthickness(pos)-delHGLA(pos)/100;
+ 
+@@ -375,7 +369,7 @@
+ %}}}}
+ 
+ % }}}
+-%Solve Sea-level equation on Earth only:  {{{
++%Solve Sea-level eqEricuation on Earth only:  {{{
+ md=sl.earth; %we don't do computations on ice sheets or land.
+ 
+ %Materials: 
+@@ -425,6 +419,7 @@
+ md.solidearth.settings.selfattraction=0;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ md.solidearth.requested_outputs= {'default',...
+ 	'DeltaIceThickness','Sealevel','SealevelUGrd',...
+ 	'SealevelchangeBarystaticMask','SealevelchangeBarystaticOceanMask'};
+@@ -435,6 +430,7 @@
+ md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=0;
+ md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ md=solve(md,'Transient');
+ Sselfattraction=md.results.TransientSolution.Sealevel;
+ 
+@@ -442,6 +438,7 @@
+ md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=0;
++md.solidearth.settings.viscous=0;
+ md=solve(md,'Transient');
+ Selastic=md.results.TransientSolution.Sealevel;
+ 
+@@ -449,6 +446,7 @@
+ md.solidearth.settings.selfattraction=1;
+ md.solidearth.settings.elastic=1;
+ md.solidearth.settings.rotation=1;
++md.solidearth.settings.viscous=0;
+ md=solve(md,'Transient');
+ Srotation=md.results.TransientSolution.Sealevel;
+ %}}}
+Index: ../trunk-jpl/test/NightlyRun/test2004.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2004.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2004.py	(revision 26358)
+@@ -113,7 +113,7 @@
+ hmax = 700
+ hmin = hmin * 1000
+ hmax = hmax * 1000
+-tolerance = 100
++tolerance = 100 # tolerance of 100m on Earth position when merging 3d meshes
+ threshold = 5
+ defaultoptions = [
+     'KeepVertices', 0,
+@@ -144,6 +144,7 @@
+ 
+     # Vertex connectivity
+     md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)
++
+     # Add model to sl icecaps
+     sl.addicecap(md)
+ #}}}
+@@ -177,19 +178,22 @@
+ 
+         print('      reading bedrock')
+         md.geometry.bed = -np.ones((md.mesh.numberofvertices, ))
++        md.geometry.base = md.geometry.bed
++        md.geometry.thickness = 1000 * np.ones((md.mesh.numberofvertices, ))
++        md.geometry.surface = md.geometry.bed + md.geometry.thickness
+     #}}}
+ 
+-    # SLR #{{{
++    # SLC #{{{
+     if bas.iscontinentany('antarctica'):
+         if testagainst2002:
+             # TODO: Check if the following works as expected: 'pos' is empty, so nothing is assigned to 'md.solidearth.surfaceload.icethicknesschange[pos]'
+-            md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, ))
++            md.masstransport.spcthickness = np.zeros((md.mesh.numberofvertices, ))
+             # Antarctica
+             late = np.sum(md.mesh.lat[md.mesh.elements - 1], axis=1) / 3
+             longe = np.sum(md.mesh.long[md.mesh.elements - 1], axis=1) / 3
+             pos = np.where(late < -85)[0]
+             ratio = 0.225314032985172 / 0.193045366574523
+-            md.solidearth.surfaceload.icethicknesschange[pos] = -100 * ratio
++            md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100 * ratio
+         else:
+             delH = np.loadtxt('../Data/AIS_delH_trend.txt')
+             longAIS = delH[:, 0]
+@@ -200,16 +204,16 @@
+             longe = md.mesh.long + 360
+             pos = np.where(longe > 360)[0]
+             longe[pos] = longe[pos] - 360
+-            delHAIS = InterpFromMesh2d(index, longAIS, latAIS, delHAIS, longe, late)  # NOTE: Compare to corresponding output under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
++            delHAIS = InterpFromMesh2d(index, longAIS, latAIS, delHAIS, longe, late) # NOTE: Compare to corresponding output under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
+             northpole = find_point(md.mesh.long, md.mesh.lat, 0, 90)
+             delHAIS[northpole] = 0
+-            md.solidearth.surfaceload.icethicknesschange = np.mean(delHAIS[md.mesh.elements - 1], axis=1) / 100
++            md.masstransport.spcthickness = delHAIS / 100
+ 
+-        md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, ))
++        md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+ 
+-        md.dsl.global_average_thermostatic_sea_level_change = np.zeros((2, 1))
+-        md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+-        md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
++        md.dsl.global_average_thermosteric_sea_level = np.zeros((2, 1))
++        md.dsl.sea_surface_height_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
++        md.dsl.sea_water_pressure_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
+     #}}}
+ 
+     # Material properties #{{{
+@@ -225,7 +229,7 @@
+ 
+ # Parameterize continents #{{{
+ for ind in sl.basinindx('continent', ['hemisphereeast', 'hemispherewest']):
+-    print("Masks for basin {}".format(sl.icecaps[ind].miscellaneous.name))
++    print('Masks for basin {}'.format(sl.icecaps[ind].miscellaneous.name))
+     md = sl.icecaps[ind]
+     bas = sl.basins[ind]
+ 
+@@ -282,8 +286,8 @@
+         #}}}
+     #}}}
+ 
+-    # SLR loading/calibration #{{{
+-    md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, ))
++    # SLC loading/calibration #{{{
++    md.masstransport.spcthickness = np.zeros((md.mesh.numberofvertices, ))
+ 
+     if testagainst2002:
+         #{{{
+@@ -292,6 +296,7 @@
+         longe = np.sum(md.mesh.long[md.mesh.elements - 1], axis=1) / 3
+         pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
+         ratio = .3823 / .262344
++        md.masstransport.spcthickness[md.mesh.elements[pos]] = md.masstransport.spcthickness[md.mesh.elements[pos]] - 100 * ratio
+ 
+         # Correct mask
+         md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
+@@ -306,8 +311,7 @@
+         longe = md.mesh.long + 360
+         pos = np.where(longe > 360)[0]
+         longe[pos] = longe[pos] - 360
+-        delHGIS = InterpFromMeshToMesh2d(index, longGIS, latGIS, delHGIS, longe, late) # NOTE: Compare to corresponding ouptut under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
+-        delHGISe = np.mean(delHGIS[md.mesh.elements - 1], axis=1).flatten()
++        delHGIS = InterpFromMeshToMesh2d(index, longGIS, latGIS, delHGIS, longe, late)
+ 
+         delH = np.loadtxt('../Data/GLA_delH_trend_15regions.txt')
+         longGLA = delH[:, 0]
+@@ -318,31 +322,37 @@
+         longe = md.mesh.long + 360
+         pos = np.where(longe > 360)[0]
+         longe[pos] = longe[pos] - 360
+-        delHGLA = InterpFromMeshToMesh2d(index, longGLA, latGLA, delHGLA, longe, late) # NOTE: Compare to corresponding ouptut under MATLAB to understand why we offset triangle indices by 1 (only caught because Triangle.cpp was producing triangles with negative areas)
+-        delHGLAe = np.mean(delHGLA[md.mesh.elements - 1], axis=1).flatten()
++        delHGLA = InterpFromMeshToMesh2d(index, longGLA, latGLA, delHGLA, longe, late)
+ 
+-        pos = np.nonzero(delHGISe)[0]
+-        md.solidearth.surfaceload.icethicknesschange[pos] = delHGISe[pos] / 100
+-        pos = np.nonzero(delHGLAe)[0]
+-        md.solidearth.surfaceload.icethicknesschange[pos] = delHGLAe[pos] / 100
++        # NOTE: For some reason, cannot apply pos to multiple arrays in a 
++        #       singlelike we might do in MATLAB. Instead, we iterate over 
++        #       elements of pos.
++        #
++        pos = np.nonzero(delHGIS)[0]
++        for p in pos:
++            md.masstransport.spcthickness[p] = md.masstransport.spcthickness[p] - delHGIS[p] / 100
++        pos = np.nonzero(delHGLA)[0]
++        for p in pos:
++            md.masstransport.spcthickness[p] = md.masstransport.spcthickness[p] - delHGLA[p] / 100
+ 
+         # Adjust mask accordingly
+-        pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
+-        flags = np.zeros((md.mesh.numberofvertices, ))
+-        flags[md.mesh.elements[pos, :] - 1] = 1
+-        pos = np.nonzero(flags)[0]
++        pos = np.nonzero(md.masstransport.spcthickness)[0]
+         md.mask.ice_levelset[pos] = -1
+         md.mask.ocean_levelset[pos] = 1
+ 
+-    md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, ))
++    md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
+ 
+-    md.dsl.global_average_thermostatic_sea_level_change = np.zeros((2, 1))
+-    md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+-    md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
++    md.dsl.global_average_thermosteric_sea_level = np.zeros((2, 1))
++    md.dsl.sea_surface_height_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
++    md.dsl.sea_water_pressure_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
+     #}}}
++
+     # Geometry #{{{
+     di = md.materials.rho_ice / md.materials.rho_water
+     md.geometry.bed = -np.ones((md.mesh.numberofvertices, ))
++    md.geometry.base = md.geometry.bed
++    md.geometry.thickness = 1000 * np.ones((md.mesh.numberofvertices, ))
++    md.geometry.surface = md.geometry.bed + md.geometry.thickness
+     #}}}
+     # Materials #{{{
+     md.materials = materials('hydro')
+@@ -374,12 +384,15 @@
+ sl.transfer('mask.ice_levelset')
+ sl.transfer('mask.ocean_levelset')
+ sl.transfer('geometry.bed')
++sl.transfer('geometry.surface')
++sl.transfer('geometry.thickness')
++sl.transfer('geometry.base')
+ sl.transfer('mesh.lat')
+ sl.transfer('mesh.long')
+-sl.transfer('solidearth.surfaceload.icethicknesschange') #
+-sl.transfer('solidearth.initialsealevel')
+-sl.transfer('dsl.sea_surface_height_change_above_geoid')
+-sl.transfer('dsl.sea_water_pressure_change_at_sea_floor')
++sl.transfer('masstransport.spcthickness') #
++sl.transfer('initialization.sealevel')
++sl.transfer('dsl.sea_surface_height_above_geoid')
++sl.transfer('dsl.sea_water_pressure_at_sea_floor')
+ 
+ # Radius
+ sl.earth.mesh.r = (sl.earth.mesh.x ** 2 + sl.earth.mesh.y ** 2 + sl.earth.mesh.z ** 2) ** 0.5 # NOTE: math.sqrt cannot be applied element-wise to a list/numpy.array
+@@ -397,10 +410,10 @@
+ #}}}
+ 
+ # Solve Sea-level equation on Earth only #{{{
+-md = sl.earth #we don't do computations on ice sheets or land
++md = sl.earth # we don't do computations on ice sheets or land
+ 
+ #Materials
+-md.materials=materials('hydro')
++md.materials = materials('hydro')
+ 
+ # Elastic loading from love numbers
+ md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
+@@ -410,59 +423,79 @@
+ md.miscellaneous.name = 'test2004'
+ 
+ # New stuff
+-md.dsl.global_average_thermosteric_sea_level_change = np.array([[(1.1 + .38)], [0]]) # steric + water storage AR5
++md.dsl.global_average_thermosteric_sea_level = np.array([[(1.1 + .38)], [0]]) # steric + water storage AR5
+ 
+ # Solutuion parameters
+ md.solidearth.settings.reltol = np.nan
+ md.solidearth.settings.abstol = 1e-3
+-md.solidearth.settings.computesealevelchange = 1
++md.solidearth.settings.sealevelloading = 1
++md.solidearth.settings.isgrd = 1
++md.solidearth.settings.ocean_area_scaling = 1
++md.solidearth.settings.grdmodel = 1
+ md.timestepping.time_step = 1
+ 
++# Physics
++md.transient.issmb = 0
++md.transient.isstressbalance = 0
++md.transient.isthermal = 0
++md.transient.ismasstransport = 1
++md.transient.isslc = 1
++
++# Initializations
++md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices,))
++md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices,))
++md.initialization.vx = np.zeros((md.mesh.numberofvertices,))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices,))
++md.initialization.sealevel = np.zeros((md.mesh.numberofvertices,))
++md.initialization.bottompressure = np.zeros((md.mesh.numberofvertices,))
++md.initialization.dsl = np.zeros((md.mesh.numberofvertices,))
++md.initialization.str = 0
++md.smb.mass_balance = np.zeros((md.mesh.numberofvertices,))
++
+ # Max number of iterations reverted back to 10 (i.e. the original default value)
+ md.solidearth.settings.maxiter = 10
+ 
+ # Eustatic run:
+-md.solidearth.settings.rigid = 0
++md.solidearth.settings.selfattraction = 0
+ md.solidearth.settings.elastic = 0
+ md.solidearth.settings.rotation = 0
++md.solidearth.settings.viscous = 0
+ md.solidearth.requested_outputs = [
+     'default',
+-    'SurfaceloadIceThicknessChange',
++    'DeltaIceThickness',
+     'Sealevel',
+-    'SealevelRSLRate',
+-    'SealevelriseCumDeltathickness',
+-    'SealevelNEsaRate',
+-    'SealevelUEsaRate',
+-    'NGiaRate',
+-    'UGiaRate',
+-    'SealevelEustaticMask',
+-    'SealevelEustaticOceanMask'
++    'SealevelUGrd',
++    'SealevelchangeBarystaticMask',
++    'SealevelchangeBarystaticOceanMask',
+ ]
+-md = solve(md, 'Sealevelrise')
+-Seustatic = md.results.SealevelriseSolution.Sealevel
++md = solve(md, 'Transient')
++Seustatic = md.results.TransientSolution.Sealevel
+ 
+-# Eustatic + rigid run
+-md.solidearth.settings.rigid = 1
++# Eustatic + selfattraction run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 0
+ md.solidearth.settings.rotation = 0
+-md = solve(md, 'Sealevelrise')
+-Srigid = md.results.SealevelriseSolution.Sealevel
++md.solidearth.settings.viscous = 0
++md = solve(md, 'Transient')
++Sselfattraction = md.results.TransientSolution.Sealevel
+ 
+-# Eustatic + rigid + elastic run
+-md.solidearth.settings.rigid = 1
++# Eustatic + selfattraction + elastic run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 0
+-md = solve(md, 'Sealevelrise')
+-Selastic = md.results.SealevelriseSolution.Sealevel
++md.solidearth.settings.viscous = 0
++md = solve(md, 'Transient')
++Selastic = md.results.TransientSolution.Sealevel
+ 
+-# Eustatic + rigid + elastic + rotation run
+-md.solidearth.settings.rigid = 1
++# Eustatic + selfattraction + elastic + rotation run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
+-md = solve(md, 'Sealevelrise')
+-Srotation = md.results.SealevelriseSolution.Sealevel
++md.solidearth.settings.viscous = 0
++md = solve(md, 'Transient')
++Srotation = md.results.TransientSolution.Sealevel
+ 
+ #Fields and tolerances to track changes
+ field_names = ['Eustatic', 'Rigid', 'Elastic', 'Rotation']
+ field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+-field_values = [Seustatic, Srigid, Selastic, Srotation]
++field_values = [Seustatic, Sselfattraction, Selastic, Srotation]
+Index: ../trunk-jpl/test/NightlyRun/test2005.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2005.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2005.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary thickness of 100: 
+ md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test2005.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2005.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2005.py	(revision 26358)
+@@ -15,50 +15,63 @@
+ md = model()
+ md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
+ 
+-# Parameterize solidearth solution
++# Geometry for the bed, arbitrary thickness of 100
++md.geometry.bed = np.zeros((md.mesh.numberofvertices, ))
++md.geometry.base = md.geometry.bed
++md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
++md.geometry.surface = md.geometry.bed + md.geometry.thickness
++
+ # Solidearth loading #{{{
+-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
+-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, 1))
+-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
+-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
++md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
++md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, ))
++# Antarctica
++xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
++ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
++ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
++re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
+ 
+-# Antarctica
+-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
+-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
++late = asind(ze / re)
++longe = atan2d(ye, xe)
+ pos = np.where(late < -80)[0]
+-md.solidearth.surfaceload.icethicknesschange[pos] = -100
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
++posant = pos
+ # Greenland
+-pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
+-md.solidearth.surfaceload.icethicknesschange[pos] = -100
++pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
++posgre = pos
+ 
+ # Elastic loading from love numbers
+-md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
++md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
+ #}}}
+ 
+ # Mask #{{{
+ mask = gmtmask(md.mesh.lat, md.mesh.long)
+-icemask = np.ones((md.mesh.numberofvertices, 1))
++oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
+ pos = np.where(mask == 0)[0]
+-icemask[pos] = -1
+-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
+-icemask[md.mesh.elements[pos, :] - 1] = -1
+-md.mask.ice_levelset = icemask
+-md.mask.ocean_levelset = -icemask
++oceanmask[pos] = 1
+ 
+-# Make sure that the elements that have loads are fully grounded
+-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
+-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
++icemask = np.ones((md.mesh.numberofvertices, 1))
++# NOTE: Need to be careful here: when addressing with multidimensional array in 
++# MATLAB, only first column of values are used as indices
++#
++icemask[md.mesh.elements[posant][:,0] - 1] = -1
++icemask[md.mesh.elements[posgre][:,0] - 1] = -1
+ 
+-# Make sure wherever there is an ice load, that the mask is set to ice:
+-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # TODO: Do we need to do this twice?
+-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
+-# }}}
++md.mask.ice_levelset = icemask
++md.mask.ocean_levelset = oceanmask
+ 
+-md.solidearth.settings.ocean_area_scaling = 0
++# Time stepping
++md.timestepping.start_time = 0
++md.timestepping.time_step = 1
++md.timestepping.final_time = 10
+ 
+-# Geometry for the bed; arbitrary
+-md.geometry.bed = -np.ones((md.mesh.numberofvertices, 1))
++# Masstransport
++md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.str = 0
+ 
+ # Materials
+ md.materials = materials('hydro')
+@@ -67,34 +80,33 @@
+ md.miscellaneous.name = 'test2005'
+ 
+ # Solution parameters
++md.cluster.np = 3
+ md.solidearth.settings.reltol = np.nan
+ md.solidearth.settings.abstol = 1e-3
+-md.solidearth.settings.computesealevelchange = 1
++md.solidearth.settings.sealevelloading = 1
++md.solidearth.settings.isgrd = 1
++md.solidearth.settings.ocean_area_scaling = 0
++md.solidearth.settings.grdmodel = 1
+ 
+-# Max number of iterations reverted back to 10 (i.e. the original default value)
+-md.solidearth.settings.maxiter = 10
+-
+-# Eustatic + rigid + elastic + rotation run
+-md.solidearth.settings.rigid = 1
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
++md.solidearth.settings.viscous = 0
+ 
+-# Transient settings
+-md.timestepping.start_time = 0
+-md.timestepping.final_time = 10
+-md.timestepping.time_step = 1
+-md.transient.isslc = 1
++# Physics
+ md.transient.issmb = 0
+-md.transient.ismasstransport = 0
+ md.transient.isstressbalance = 0
+ md.transient.isthermal = 0
+-dh = np.asarray(md.solidearth.surfaceload.icethicknesschange).T
+-deltathickness = np.zeros((md.mesh.numberofelements + 1, 10))
+-for i in range(10):
+-    deltathickness[0:-1, i] = dh * (i + 1)
+-deltathickness[-1, :] = np.arange(0, 10, 1)
+-md.solidearth.surfaceload.icethicknesschange = deltathickness
++md.transient.ismasstransport = 1
++md.transient.isslc = 1
++md.solidearth.requested_outputs = ['Sealevel']
+ 
++dh = md.masstransport.spcthickness
++deltathickness = np.zeros((md.mesh.numberofvertices + 1, 10 + 1)) # NOTE: Need to add another row as it is added in loop in MATLAB, which causes a RuntimeError in Python
++for i in range(10 + 1):
++    deltathickness[0:-1, i] = md.geometry.thickness + dh[0:-1] * i
++deltathickness[-1, :] = np.arange(0, 10 + 1, 1)
++md.masstransport.spcthickness = deltathickness
+ # Hack
+ md.geometry.surface = np.zeros((md.mesh.numberofvertices, 1))
+ md.geometry.thickness = np.ones((md.mesh.numberofvertices, 1))
+@@ -109,7 +121,7 @@
+ S10 = md.results.TransientSolution[10 - 1].Sealevel
+ Seus10 = md.results.TransientSolution[10 - 1].Bslc
+ 
+-#Fields and tolerances to track changes
++# Fields and tolerances to track changes
+ field_names = ['Sealevel1', 'Sealevel5', 'Sealevel10', 'Seustatic10']
+ field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+ field_values = [S1, S5, S10, Seus10]
+Index: ../trunk-jpl/test/NightlyRun/test2006.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2006.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary thickness of 100: 
+ md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test2006.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2006.py	(revision 26358)
+@@ -6,6 +6,7 @@
+ from gmtmask import *
+ from lovenumbers import *
+ from materials import *
++from MatlabFuncs import *
+ from model import *
+ from nodalvalue import *
+ from normal_uncertain import *
+@@ -18,22 +19,30 @@
+ md.cluster = generic('name', oshostname(), 'np', 5)
+ md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
+ 
+-# Parameterize solidearth solution
++# Geometry for the bed, arbitrary thickness of 100
++md.geometry.bed = np.zeros((md.mesh.numberofvertices, ))
++md.geometry.base = md.geometry.bed
++md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
++md.geometry.surface = md.geometry.bed + md.geometry.thickness
++
+ # Solidearth loading #{{{
+-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
+-md.solidearth.initialsealevel = np.zeros((md.mesh.numberofvertices, 1))
+-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
+-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
++md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
++md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, ))
++# Antarctica
++xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
++ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
++ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
++re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
+ 
+-# Antarctica
+-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
+-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
++late = asind(ze / re)
++longe = atan2d(ye, xe)
+ pos = np.where(late < -80)[0]
+-md.solidearth.surfaceload.icethicknesschange[pos] = -100
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
++posant = pos
+ # Greenland
+-pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
+-md.solidearth.surfaceload.icethicknesschange[pos] = -100
++pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
++posgre = pos
+ 
+ # Elastic loading from love numbers
+ md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
+@@ -41,27 +50,32 @@
+ 
+ # Mask #{{{
+ mask = gmtmask(md.mesh.lat, md.mesh.long)
+-icemask = np.ones((md.mesh.numberofvertices, 1))
++oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
+ pos = np.where(mask == 0)[0]
+-icemask[pos] = -1
+-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
+-icemask[md.mesh.elements[pos, :] - 1] = -1
+-md.mask.ice_levelset = icemask
+-md.mask.ocean_levelset = -icemask
++oceanmask[pos] = 1
+ 
+-# Make sure that the elements that have loads are fully grounded
+-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
+-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
++icemask = np.ones((md.mesh.numberofvertices, 1))
++# NOTE: Need to be careful here: when addressing with multidimensional array in 
++# MATLAB, only first column of values are used as indices
++#
++icemask[md.mesh.elements[posant][:,0] - 1] = -1
++icemask[md.mesh.elements[posgre][:,0] - 1] = -1
+ 
+-# Make sure wherever there is an ice load, that the mask is set to ice:
+-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # TODO: Do we need to do this twice?
+-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
+-# }}}
++md.mask.ice_levelset = icemask
++md.mask.ocean_levelset = oceanmask
+ 
+-md.solidearth.settings.ocean_area_scaling = 0
++# Time stepping
++md.timestepping.start_time = 0
++md.timestepping.time_step = 1
++md.timestepping.final_time = 10
+ 
+-# Geometry for the bed; arbitrary
+-md.geometry.bed = -np.ones((md.mesh.numberofvertices, 1))
++# Masstransport
++md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.str = 0
+ 
+ # Materials
+ md.materials = materials('hydro')
+@@ -70,34 +84,34 @@
+ md.miscellaneous.name = 'test2006'
+ 
+ # Solution parameters
++md.cluster.np = 3
+ md.solidearth.settings.reltol = np.nan
+ md.solidearth.settings.abstol = 1e-3
+-md.solidearth.settings.computesealevelchange = 1
++md.solidearth.settings.sealevelloading = 1
++md.solidearth.settings.isgrd = 1
++md.solidearth.settings.ocean_area_scaling = 0
++md.solidearth.settings.grdmodel = 1
+ 
+-# Max number of iterations reverted back to 10 (i.e. the original default value)
+-md.solidearth.settings.maxiter = 10
+-
+-# Eustatic + rigid + elastic + rotation run
+-md.solidearth.settings.rigid = 1
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
++md.solidearth.settings.viscous = 0
+ 
+-# Transient settings
+-md.timestepping.start_time = 0
+-md.timestepping.final_time = 10
+-md.timestepping.time_step = 1
+-md.transient.isslc = 1
++# Physics
+ md.transient.issmb = 0
+-md.transient.ismasstransport = 0
+ md.transient.isstressbalance = 0
+ md.transient.isthermal = 0
+-dh = np.asarray(md.solidearth.surfaceload.icethicknesschange).T
+-deltathickness = np.zeros((md.mesh.numberofelements + 1, 10))
+-for i in range(10):
+-    deltathickness[0:-1, i] = dh * (i + 1)
+-deltathickness[-1, :] = np.arange(0, 10, 1)
+-md.solidearth.surfaceload.icethicknesschange = deltathickness
++md.transient.ismasstransport = 1
++md.transient.isslc = 1
++md.solidearth.requested_outputs = ['Sealevel']
+ 
++dh = md.masstransport.spcthickness
++deltathickness = np.zeros((md.mesh.numberofvertices + 1, 10 + 1)) # NOTE: Need to add another row as it is added in loop in MATLAB, which causes a RuntimeError in Python
++for i in range(10 + 1):
++    deltathickness[0:-1, i] = md.geometry.thickness + dh[0:-1] * i
++deltathickness[-1, :] = np.arange(0, 10 + 1, 1)
++md.masstransport.spcthickness = deltathickness
++
+ # Hack
+ md.geometry.surface = np.zeros((md.mesh.numberofvertices, 1))
+ md.geometry.thickness = np.ones((md.mesh.numberofvertices, 1))
+@@ -108,7 +122,7 @@
+ # Ice sheets #{{{
+ npart = 1
+ nt = 1
+-partition = -np.ones((md.mesh.numberofelements, 1))
++partition = -1 * np.ones((md.mesh.numberofelements, 1))
+ pos = np.where(late < -80)[0]
+ partition[pos] = 0
+ pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))[0]
+Index: ../trunk-jpl/test/NightlyRun/test2007.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2007.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2007.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+@@ -49,7 +48,7 @@
+ md.solidearth.settings.isgrd=0;
+ md.solidearth.settings.horiz=1;
+ 
+-%Physics: 
++%Physics: bary
+ md.transient.issmb=0; 
+ md.transient.isstressbalance=0;
+ md.transient.isthermal=0;
+Index: ../trunk-jpl/test/NightlyRun/test2008.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2008.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2008.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary thickness of 100: 
+ md.geometry.bed=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test2010.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2010.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2010.m	(revision 26358)
+@@ -2,22 +2,19 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+-%Geometry for the bed, arbitrary thickness of 1000: 
++%Geometry for the bed, arbitrary thickness of 100:
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+ md.geometry.base=md.geometry.bed;
+ md.geometry.thickness=100*ones(md.mesh.numberofvertices,1);
+ md.geometry.surface=md.geometry.bed+md.geometry.thickness;
+ 
+-
+ %parameterize slc solution:
+ %solidearth loading:  {{{
+ md.masstransport.spcthickness=[md.geometry.thickness;0];
+ md.smb.mass_balance=zeros(md.mesh.numberofvertices,1);
+ 
+-
+ xe=md.mesh.x(md.mesh.elements)*[1;1;1]/3;
+ ye=md.mesh.y(md.mesh.elements)*[1;1;1]/3;
+ ze=md.mesh.z(md.mesh.elements)*[1;1;1]/3;
+@@ -45,7 +42,7 @@
+ md.mask.ice_levelset=icemask;
+ md.mask.ocean_levelset=oceanmask;
+ 
+-% use model representation of ocen area (not the true area)
++% use model representation of ocean area (not the true area)
+ md.solidearth.settings.ocean_area_scaling = 0;
+ 
+ %materials
+@@ -70,7 +67,7 @@
+ md.solidearth.settings.ocean_area_scaling=0;
+ md.solidearth.settings.grdmodel=1;
+ md.solidearth.settings.horiz=1;
+-md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticIceArea','SealevelBarystaticIceLoad','SealevelBarystaticIceMask','SealevelBarystaticIceLatbar' 'SealevelBarystaticIceLongbar'};
++md.solidearth.requested_outputs={'Sealevel','SealevelBarystaticIceArea','SealevelBarystaticIceLoad','SealevelBarystaticIceMask','SealevelBarystaticIceLatbar','SealevelBarystaticIceLongbar'};
+ 
+ %Physics: 
+ md.transient.issmb=0; 
+@@ -78,7 +75,7 @@
+ md.transient.isthermal=0;
+ md.transient.ismasstransport=1;
+ md.transient.isslc=1;
+- 
++
+ md.timestepping.start_time=0;
+ md.timestepping.time_step=1;
+ md.timestepping.final_time=1;
+@@ -116,11 +113,11 @@
+ moi_xz = sum(-loadice.*areaice.*rad_e^2.*sin(lat).*cos(lat).*cos(lon));
+ moi_yz = sum(-loadice.*areaice.*rad_e^2.*sin(lat).*cos(lat).*sin(lon));
+ moi_zz = sum(-loadice.*areaice.*rad_e^2.*(1.0-sin(lat).^2));
+-theoretical_value_check=[moixz/moi_xz moiyz/moi_yz moizz/moizz]
++theoretical_value_check=[moixz/moi_xz moiyz/moi_yz moizz/moi_zz]
+ % }}}
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'eus','slc','moixz','moiyz','moizz'};
+-field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={eus,slc,moixz,moiyz,moizz};
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2010.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2010.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2010.py	(revision 26358)
+@@ -1,104 +1,139 @@
+ #Test Name: MomentOfIntertia
+-from socket import gethostname
+-
+ import numpy as np
+ 
+ from gmshplanet import *
+ from gmtmask import *
+ from lovenumbers import *
++from MatlabFuncs import *
+ from model import *
+ from paterson import *
+ from solve 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
++md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
+ 
+-#parameterize solidearth solution:
+-#solidearth loading:  {{{
+-late = md.mesh.lat[md.mesh.elements - 1].sum(axis=1) / 3
+-longe = md.mesh.long[md.mesh.elements - 1].sum(axis=1) / 3
++# Geometry for the bed, arbitrary thickness of 100
++md.geometry.bed = -1 * np.ones((md.mesh.numberofvertices, ))
++md.geometry.base = md.geometry.bed
++md.geometry.thickness = 100 * np.ones((md.mesh.numberofvertices, ))
++md.geometry.surface = md.geometry.bed + md.geometry.thickness
+ 
+-md.solidearth.surfaceload.icethicknesschange = np.zeros((md.mesh.numberofelements, 1))
+-pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe > 0)))
+-#NOTE: Python does not include last element in array slices: (6:7) -> [5:7]
+-md.solidearth.surfaceload.icethicknesschange[pos[5:7]] = -1
++# Parameterize SLC solution
++# Solidearth loading  {{{
++md.masstransport.spcthickness = np.append(md.geometry.thickness, 0)
++md.smb.mass_balance = np.zeros((md.mesh.numberofvertices, ))
+ 
+-md.solidearth.initialsealevel = np.zeros(md.mesh.numberofvertices)
+-md.dsl.global_average_thermosteric_sea_level_change = np.zeros((2, 1))
+-md.dsl.sea_surface_height_change_above_geoid = np.zeros((md.mesh.numberofvertices + 1, 1))
+-md.dsl.sea_water_pressure_change_at_sea_floor = np.zeros((md.mesh.numberofvertices + 1, 1))
++xe = md.mesh.x[md.mesh.elements - 1].sum(axis=1) / 3
++ye = md.mesh.y[md.mesh.elements - 1].sum(axis=1) / 3
++ze = md.mesh.z[md.mesh.elements - 1].sum(axis=1) / 3
++re = pow((pow(xe, 2) + pow(ye, 2) + pow(ze, 2)), 0.5)
+ 
+-md.solidearth.settings.ocean_area_scaling = 1
++late = asind(ze / re)
++longe = atan2d(ye, xe)
++# Greenland
++pos = np.where(np.logical_and.reduce((late > 60, late < 90, longe > -75, longe < -15)))[0]
++md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] = md.masstransport.spcthickness[md.mesh.elements[pos, :] - 1] - 100
++posice = pos
+ 
+-#elastic loading from love numbers:
+-md.solidearth.lovenumbers = lovenumbers('maxdeg', 1000)
++# Elastic loading from love numbers
++md.solidearth.lovenumbers = lovenumbers('maxdeg', 100)
+ 
+ #}}}
+ #mask:  {{{
+ mask = gmtmask(md.mesh.lat, md.mesh.long)
+ icemask = np.ones((md.mesh.numberofvertices, 1))
++icemask[md.mesh.elements[posice, :] - 1] = -0.5
++
++oceanmask = -1 * np.ones((md.mesh.numberofvertices, 1))
+ pos = np.where(mask == 0)[0]
+-icemask[pos] = -1
+-pos = np.where(mask[md.mesh.elements - 1].sum(axis=1) < 3)[0]
+-icemask[md.mesh.elements[pos, :] - 1] = -1
++oceanmask[pos] = 1
++icemask[np.logical_not(pos).astype(int)] = 1
++
+ md.mask.ice_levelset = icemask
+-md.mask.ocean_levelset = -icemask
++md.mask.ocean_levelset = oceanmask
+ 
+-#make sure that the elements that have loads are fully grounded
+-pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0]
+-md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1
++# Use model representation of ocean area (not the true area)
++md.solidearth.settings.ocean_area_scaling = 0
+ 
+-#make sure wherever there is an ice load, that the mask is set to ice:
+-md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, 1))
+-#pos = np.nonzero(md.solidearth.surfaceload.icethicknesschange)[0] # Do we need to do this twice?
+-md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
+-# }}}
++# Materials
++md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, 1))
++md.initialization.sealevel = np.zeros((md.mesh.numberofvertices, 1))
++md.initialization.str = 0
+ 
+-#geometry {{{
+-di = md.materials.rho_ice / md.materials.rho_water
+-md.geometry.thickness = np.ones((md.mesh.numberofvertices, 1))
+-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, 1))
+-md.geometry.base = md.geometry.surface - md.geometry.thickness
+-md.geometry.bed = md.geometry.base
+-# }}}
+-#materials {{{
+-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, 1))
+-md.materials.rheology_B = paterson(md.initialization.temperature)
+-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, 1))
+-# }}}
+-#Miscellaneous {{{
++md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
++
++# Miscellaneous
+ md.miscellaneous.name = 'test2010'
+-# }}}
+-#Solution parameters {{{
++
++# Solution parameters
+ md.solidearth.settings.reltol = np.nan
+ md.solidearth.settings.abstol = 1e-3
+-md.solidearth.settings.computesealevelchange = 1
+-# }}}
++md.solidearth.settings.sealevelloading = 0
++md.solidearth.settings.grdocean = 1
++md.solidearth.settings.isgrd = 1
++md.solidearth.settings.ocean_area_scaling = 0
++md.solidearth.settings.grdmodel = 1
++md.solidearth.settings.horiz = 1
++md.solidearth.requested_outputs = [
++    'Sealevel',
++    'SealevelBarystaticIceArea',
++    'SealevelBarystaticIceLoad',
++    'SealevelBarystaticIceMask',
++    'SealevelBarystaticIceLatbar',
++    'SealevelBarystaticIceLongbar'
++]
+ 
+-#eustatic + rigid + elastic run:
+-md.solidearth.settings.rigid = 1
++# Physics
++md.transient.issmb = 0
++md.transient.isstressbalance = 0
++md.transient.isthermal = 0
++md.transient.ismasstransport = 1
++md.transient.isslc = 1
++
++md.timestepping.start_time = 0
++md.timestepping.time_step = 1
++md.timestepping.final_time = 1
++
++# Eustatic + selfattraction + elastic + rotation run
++md.solidearth.settings.selfattraction = 1
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
+-md.cluster = generic('name', gethostname(), 'np', 3)
++md.solidearth.settings.viscous = 0
++md.cluster = generic('name', oshostname(), 'np', 3)
++md = solve(md, 'Transient')
+ 
++moi_p = md.solidearth.rotational.polarmoi
++moi_e = md.solidearth.rotational.equatorialmoi
++tide_love_k2 = md.solidearth.lovenumbers.tk[2]
++load_love_k2 = md.solidearth.lovenumbers.k[2]
++tide_love_k2secular = md.solidearth.lovenumbers.tk2secular
+ # uncomment following 2 lines for
+-md = solve(md, 'Sealevelrise')
+-eus = md.results.SealevelriseSolution.Bslc
+-slc = md.results.SealevelriseSolution.Sealevel
+-moixz = md.results.SealevelriseSolution.SealevelInertiaTensorXZ
+-moiyz = md.results.SealevelriseSolution.SealevelInertiaTensorYZ
+-moizz = md.results.SealevelriseSolution.SealevelInertiaTensorZZ
++eus = md.results.TransientSolution.Bslc
++slc = md.results.TransientSolution.Sealevel
++moixz = md.results.TransientSolution.SealevelInertiaTensorXZ / (1 / (1 - tide_love_k2 / tide_love_k2secular) * (1 + load_love_k2) / (moi_p - moi_e))
++moiyz = md.results.TransientSolution.SealevelInertiaTensorYZ / (1 / (1 - tide_love_k2 / tide_love_k2secular) * (1 + load_love_k2) / (moi_p - moi_e))
++moizz = md.results.TransientSolution.SealevelInertiaTensorZZ / ( -(1 + load_love_k2) / moi_p)
+ 
++areaice = md.results.TransientSolution.SealevelBarystaticIceArea
++loadice = md.results.TransientSolution.SealevelBarystaticIceLoad
++
+ # analytical moi = > just checking FOR ICE only!!! {{{
+-# ...have to mute**solidearth induced MOI in Tria.cpp**prior to the comparison
+-#rad_e = rad_e * 1e3  # now in meters
+-#areas = GetAreasSphericalTria(md.mesh.elements, md.mesh.lat, md.mesh.long, rad_e)
+-#lat = late * pi / 180 lon = longe * pi / 180
+-#moi_xz = sum(-md.materials.rho_freshwater. * md.solidearth.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * cos(lon))
+-#moi_yz = sum(-md.materials.rho_freshwater. * md.solidearth.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * sin(lon))
++# ...have to mute ** slc induced MOI in Tria.cpp**prior to the comparison
++rad_e = md.solidearth.planetradius
++
++lat = md.results.TransientSolution.SealevelBarystaticIceLatbar * np.pi / 180
++lon = md.results.TransientSolution.SealevelBarystaticIceLongbar * np.pi / 180
++moi_xz = sum(-loadice * areaice * pow(rad_e, 2) * np.sin(lat) * np.cos(lat) * np.cos(lon))
++moi_yz = sum(-loadice * areaice * pow(rad_e, 2) * np.sin(lat) * np.cos(lat) * np.sin(lon))
++moi_zz = sum(-loadice * areaice * pow(rad_e, 2) * (1 - np.sin(lat) ** 2))
++theoretical_value_check = [moixz / moi_xz, moiyz / moi_yz, moizz / moi_zz]
++print('\ntheoretical_value_check =\n')
++print('\t{}\n'.format(theoretical_value_check))
+ # }}}
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test2011.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2011.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2011.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test2021.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2021.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2021.m	(revision 26358)
+@@ -1,87 +1,87 @@
+-%Test Name: SESAWslc 
+-% SESAW method of solving GRD slc 
+-% reference: Adhikari et al., 2016, GMD, https://doi.org/10.5194/gmd-9-1087-2016 
++%Test Name: SESAWslc
++% SESAW method of solving GRD slc
++% reference: Adhikari et al., 2016, GMD, https://doi.org/10.5194/gmd-9-1087-2016
+ 
+ md=model;
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',500); %500 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %700 km resolution mesh
+ 
+-% read in love numbers. 
++% read in love numbers.
+ love_numbers = lovenumbers('maxdeg',10000);
+ 
+-% compute Green's functions 
+-disp(['Computing Greens functions...']); 
+-[Grigid,Gelastic,Uelastic]=greensfunctions(md.mesh.elements,md.mesh.lat,md.mesh.long,love_numbers); 
++% compute Green's functions
++disp(['Computing Greens functions...']);
++[Grigid,Gelastic,Uelastic]=greensfunctions(md.mesh.elements,md.mesh.lat,md.mesh.long,love_numbers);
+ greens.Grigid = Grigid;
+ greens.Gelast = Gelastic;
+ greens.Uelast = Uelastic;
+ clearvars Grigid Gelastic Uelastic
+ 
+-% compute lat,long at elemental centroids. 
+-[late,longe] = latelonge(md.mesh.elements,md.mesh.lat,md.mesh.long); 
++% compute lat,long at elemental centroids.
++[late,longe] = latelonge(md.mesh.elements,md.mesh.lat,md.mesh.long);
+ 
+-% load GRACE data. Same as used in test2020.  
+-load('../Data/GRACE_JPL_April2002_WEH.mat'); 
++% load GRACE data. Same as used in test2020.
++load('../Data/GRACE_JPL_April2002_WEH.mat');
+ lat = repmat(lat',720,1);
+ lon = repmat(lon,1,360);
+-F = scatteredInterpolant(lat(:),lon(:),weh(:)); 
++F = scatteredInterpolant(lat(:),lon(:),weh(:));
+ 
+-% map GRACE data onto elemental centorids. 
++% map GRACE data onto elemental centorids.
+ loads_element = F(late,longe);
+ loads_element(isnan(loads_element))=0;
+ 
+-% ocean mask mapped onto the elemental centroids. 
+-ocean_element = gmtmask(late,longe); 
++% ocean mask mapped onto the elemental centroids.
++ocean_element = gmtmask(late,longe);
+ 
+ % Area of individual elements
+-area_element=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,md.solidearth.planetradius); 
++area_element=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,md.solidearth.planetradius);
+ 
+-% Parameters input for SESAWslc solver. 
+-para.ocean_element = ocean_element; 
+-para.loads_element = loads_element; 
+-para.area_element = area_element; 
+-para.earth_density = md.materials.earth_density; 
++% Parameters input for SESAWslc solver.
++para.ocean_element = ocean_element;
++para.loads_element = loads_element;
++para.area_element = area_element;
++para.earth_density = md.materials.earth_density;
+ para.ocean_density = md.materials.rho_water;
+-para.loads_density = md.materials.rho_freshwater; % if land loads are ice, use ice density. 
++para.loads_density = md.materials.rho_freshwater; % if land loads are ice, use ice density.
+ 
+-para.rel_tol = 1e-5; 
++para.rel_tol = 1e-5;
+ 
+-% solid earth rheology. 
+-para.solidearth = 'rigid'; % 'rigid' or 'elastic'; 
++% solid earth rheology.
++para.solidearth = 'rigid'; % 'rigid' or 'elastic';
+ 
+-% rotational feedbacks. 
+-para.rotational.flag = 0; % Rotational flag on (1) or off (0) 
+-para.rotational.earth_radius = md.solidearth.planetradius; 
+-para.rotational.load_love_k2 = love_numbers.k(3); 
+-para.rotational.tide_love_k2 = love_numbers.tk(3); 
+-para.rotational.tide_love_h2 = love_numbers.th(3);  
+-para.rotational.tide_love_k2secular = love_numbers.tk2secular;  
+-para.rotational.moi_p = md.solidearth.rotational.polarmoi; 
+-para.rotational.moi_e = md.solidearth.rotational.equatorialmoi; 
++% rotational feedbacks.
++para.rotational.flag = 0; % Rotational flag on (1) or off (0)
++para.rotational.earth_radius = md.solidearth.planetradius;
++para.rotational.load_love_k2 = love_numbers.k(3);
++para.rotational.tide_love_k2 = love_numbers.tk(3);
++para.rotational.tide_love_h2 = love_numbers.th(3);
++para.rotational.tide_love_k2secular = love_numbers.tk2secular;
++para.rotational.moi_p = md.solidearth.rotational.polarmoi;
++para.rotational.moi_e = md.solidearth.rotational.equatorialmoi;
+ para.rotational.omega = md.solidearth.rotational.angularvelocity;
+ 
+-% solve: Rigid without rotational feedbacks. 
+-disp(['Solving sesaw-slc for Rigid Earth WITHOUT rotational feedback...']); 
+-[eus_rigid,rsl_rigid] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
++% solve: Rigid without rotational feedbacks.
++disp(['Solving sesaw-slc for Rigid Earth WITHOUT rotational feedback...']);
++[eus_rigid,rsl_rigid] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
+ 
+-% solve: Rigid with rotational feedbacks. 
+-para.rotational.flag = 1; 
+-disp(['Solving sesaw-slc for Rigid Earth WITH rotational feedback...']); 
+-[eus_rigid_rot,rsl_rigid_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
++% solve: Rigid with rotational feedbacks.
++para.rotational.flag = 1;
++disp(['Solving sesaw-slc for Rigid Earth WITH rotational feedback...']);
++[eus_rigid_rot,rsl_rigid_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
+ 
+-% solve: Elastic with rotational feedbacks. 
+-para.solidearth = 'elastic'; 
+-disp(['Solving sesaw-slc for Elastic Earth WITH rotational feedback...']); 
+-[eus_elast_rot,rsl_elast_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
++% solve: Elastic with rotational feedbacks.
++para.solidearth = 'elastic';
++disp(['Solving sesaw-slc for Elastic Earth WITH rotational feedback...']);
++[eus_elast_rot,rsl_elast_rot] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
+ 
+-% solve: Elastic with rotational feedbacks. 
+-para.rotational.flag = 0; 
+-disp(['Solving sesaw-slc for Elastic Earth WITHOUT rotational feedback...']); 
+-[eus_elast,rsl_elast] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para); 
++% solve: Elastic with rotational feedbacks.
++para.rotational.flag = 0;
++disp(['Solving sesaw-slc for Elastic Earth WITHOUT rotational feedback...']);
++[eus_elast,rsl_elast] = SESAWslr(md.mesh.elements,md.mesh.lat,md.mesh.long,greens,para);
+ 
+ %Fields and tolerances to track changes
+ field_names={'eus_rigid','eus_rigid_rot','eus_elast','eus_elast_rot',...
+-	          'rsl_rigid','rsl_rigid_rot','rsl_elast','rsl_elast_rot'};
++             'rsl_rigid','rsl_rigid_rot','rsl_elast','rsl_elast_rot'};
+ field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+ field_values={eus_rigid,eus_rigid_rot,eus_elast,eus_elast_rot,...
+-	          rsl_rigid,rsl_rigid_rot,rsl_elast,rsl_elast_rot};
++             rsl_rigid,rsl_rigid_rot,rsl_elast,rsl_elast_rot};
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2084.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2084.m	(revision 26358)
+@@ -8,7 +8,7 @@
+ md=model();
+ md.cluster=generic('name',oshostname(),'np',1);
+ 
+-% set validation=1 for comparing against the Spada benchark.   
++% set validation=1 for comparing against the Spada benchark.
+ validation=0; 
+ 
+ md.materials=materials('litho');
+@@ -25,7 +25,7 @@
+ md.materials.viscosity=[0            0   2.0000e+00   1.0000e+00   1.0000e+00   1.0000e+25]'*1e21;
+ md.materials.lame_lambda=md.materials.lame_mu*0+5e17;
+ md.materials.issolid=[1 0 1 1 1 1]';
+-md.materials.rheologymodel=0*ones(md.materials.numlayers,1);
++md.materials.rheologymodel=zeros(md.materials.numlayers,1);
+ md.materials.burgers_mu=md.materials.lame_mu/3;
+ md.materials.burgers_viscosity=md.materials.viscosity/10;
+ md.materials.ebm_alpha= ones(md.materials.numlayers,1)*.9;
+@@ -43,7 +43,6 @@
+ md.love.Gravitational_Constant=6.6732e-11;
+ md.love.integration_steps_per_layer=200;
+ 
+-
+ md.love.istemporal=1;
+ md.love.n_temporal_iterations=8;
+ %md.love.time=(logspace(-4,5, 2))'*cst;
+@@ -50,7 +49,7 @@
+ md.love.time=(logspace(-1,2, 50))'*cst;
+ md.love.love_kernels=1;
+ if md.love.istemporal
+-md.love=md.love.build_frequencies_from_time;
++	md.love=md.love.build_frequencies_from_time;
+ end
+ 
+ md=solve(md,'lv');
+@@ -64,8 +63,6 @@
+ %hs=permute(hs,[3 2 1]);
+ %[ht,h,hsig,hconv]=postwidder_love(md,md.love.n_temporal_iterations,t,hs,1e-5);
+ 
+-
+-
+ %Fields and tolerances to track changes
+ %loading love numbers
+ field_names     ={'LoveH_loading_elastic','LoveK_loading_elastic','LoveL_loading_elastic'};
+@@ -76,7 +73,6 @@
+ 	(md.results.LoveSolution.LoveLr(:,1)),...
+ 	};
+ 
+-
+ % validate elastic loading solutions against the Spada benchmark. {{{ 
+ if validation 
+ 	spada_solutions = load('spada_elastic_loading_deg_h_l_k'); 
+Index: ../trunk-jpl/test/NightlyRun/test2084.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2084.py	(revision 26358)
+@@ -1,21 +1,24 @@
+ #Test Name: GiaCaron
+-#Forward Love number solution for a viscoelastic earth,
+-#model M3 - L70 - V01 from Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M.,
+-#Martinec, Z., Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A.
+-#and King, M. A. (2011), A benchmark study for glacial isostatic
+-#adjustment codes. Geophysical Journal International,
+-#185: 106 - 132. doi:10.1111 / j.1365 - 246X.2011.04952.x
++# Forward Love number solution for a viscoelastic earth, model M3-L70-V01 from 
++# Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M., Martinec, Z., 
++# Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A. and King, M. A. 
++# (2011), A benchmark study for glacial isostatic adjustment codes. Geophysical 
++# Journal International, 185: 106--132. doi:10.1111/j.1365-246X.2011.04952.x
+ 
++import numpy as np
++
++from generic import generic
++from materials import *
++from MatlabFuncs import *
+ from model import *
+-from socket import gethostname
+ from solve import *
+-from numpy import *
+-from generic import generic
+-from materials import *
+ 
+ md = model()
+-md.cluster = generic('name', gethostname(), 'np', 1)
++md.cluster = generic('name', oshostname(), 'np', 1)
+ 
++# Set validation=1 for comparing against the Spada benchark
++validation = 0
++
+ md.materials = materials('litho')
+ md.miscellaneous.name = 'FourierLoveTest'
+ md.groundingline.migration = 'None'
+@@ -32,29 +35,61 @@
+                                 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.lame_lambda = np.array(md.materials.lame_mu) * 0 + 5e17
+ md.materials.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(-1, 1)
+-md.materials.isburgers = np.zeros((md.materials.numlayers, 1))
++md.materials.rheologymodel = np.zeros((md.materials.numlayers, 1))
++md.materials.burgers_mu = md.materials.lame_mu / 3
++md.materials.burgers_viscosity = md.materials.viscosity / 10
++md.materials.ebm_alpha = np.ones((md.materials.numlayers, 1)) * 0.9
++md.materials.ebm_delta = np.ones((md.materials.numlayers, 1)) * 0.2
++md.materials.ebm_taul = np.ones((md.materials.numlayers, 1)) * 54 * 60 # 54 min
++md.materials.ebm_tauh = np.ones((md.materials.numlayers, 1)) * 18.6 * cst / 1e3 # 18.6 yr
++#setlitho2prem(md.materials)
+ 
+ md.love.allow_layer_deletion = 1
+-md.love.frequencies = (np.array([0]) * 2 * pi).reshape(-1, 1) / cst
++md.love.frequencies = (np.array([0]) * 2 * np.pi).reshape(-1, 1) / cst
+ md.love.nfreq = len(md.love.frequencies)
++md.love.sh_nmin = 1
+ md.love.sh_nmax = 256
++md.love.underflow_tol = 1e-20
++md.love.Gravitational_Constant = 6.6732e-11
++md.love.integration_steps_per_layer = 200
+ 
+-md.materials.burgers_mu = md.materials.lame_mu
+-md.materials.burgers_viscosity = md.materials.viscosity
++md.love.istemporal = 1
++md.love.n_temporal_iterations = 8
++#md.love.time = np.logspace(-4, 5, 2).reshape(-1, 1) * cst
++md.love.time = np.logspace(-1, 2, 50).reshape(-1, 1) * cst
++md.love.love_kernels = 1
++if md.love.istemporal:
++    md.love = md.love.build_frequencies_from_time
+ 
+ md = solve(md, 'lv')
+ 
++ht2 = md.results.LoveSolution.LoveHr
++lt2 = md.results.LoveSolution.LoveLr
++kt2 = md.results.LoveSolution.LoveKr
++t = md.love.time / cst * 1e3
++
+ #Fields and tolerances to track changes
+ #loading love numbers
+ field_names = ['LoveH_loading_elastic', 'LoveK_loading_elastic', 'LoveL_loading_elastic']
+-field_tolerances = [4.3e-9, 4.3e-9, 4.3e-9]
+-field_values = [np.array(md.results.LoveSolution.LoveHr)[:, 0],
+-                np.array(md.results.LoveSolution.LoveKr)[:, 0],
+-                np.array(md.results.LoveSolution.LoveLr)[:, 0]]
++field_tolerances = [2.0e-8, 2.0e-8, 2.0e-8]
++field_values = [
++    np.array(md.results.LoveSolution.LoveHr)[:, 0],
++    np.array(md.results.LoveSolution.LoveKr)[:, 0],
++    np.array(md.results.LoveSolution.LoveLr)[:, 0]
++]
+ 
+-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
++# Validate elastic loading solutions against the Spada benchmark {{{
++
++# TODO:
++# - Implement read from file and comparison
++# - Implement plot
++#
++
++#}}}
++
++md.love.frequencies = (np.array([1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1, -1]) * 2 * np.np.pi).reshape(-1, 1) / cst
+ md.love.nfreq = len(md.love.frequencies)
+ md.love.sh_nmax = 256
+ md.materials.burgers_mu = md.materials.lame_mu
+@@ -63,37 +98,48 @@
+ 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_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.frequencies = ((np.array([0, 1e-3, 1e-2, 1e-1, 1, -1e-3, -1e-2, -1e-1, -1]) * 2 * np.pi).reshape(-1, 1) / cst)
+ md.love.nfreq = len(md.love.frequencies)
+-
+ md = solve(md, 'lv')
+ 
++# Validate elastic tidal solutions against the Spada benchmark #{{{
++
++# TODO:
++# - Implement read from file and comparison
++# - Implement plot
++#
++
++#}}}
++
+ #tidal love numbers, check
+ field_names += ['LoveH_tidal_elastic', 'LoveK_tidal_elastic', 'LoveL_tidal_elastic', 'LoveH_tidal_realpart', 'LoveK_tidal_realpart', 'LoveL_tidal_realpart', 'LoveH_tidal_imagpart', 'LoveK_tidal_imagpart', 'LoveL_tidal_imagpart']
+ field_tolerances += [8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6, 8e-6]
+-field_values += [np.array(md.results.LoveSolution.LoveHr)[:, 0],
+-                 np.array(md.results.LoveSolution.LoveKr)[:, 0],
+-                 np.array(md.results.LoveSolution.LoveLr)[:, 0],
+-                 np.array(md.results.LoveSolution.LoveHr)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveKr)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveLr)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveHi)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveKi)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveLi)[:, 1:]]
++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
++# Many layers PREM-based model
+ #data = load('../Data/PREM_500layers')
+ #md.love.sh_nmin = 1
+ #md.materials.radius = data(2:end - 2, 1)
+@@ -114,7 +160,7 @@
+ #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.materials.rheologymodel = md.materials.issolid * 0
+ #md.love.forcing_type = 11
+ #md.materials.numlayers = len(md.materials.viscosity)
+ #md = solve(md, 'lv')
+@@ -132,8 +178,8 @@
+ #       (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.
+ 
++# 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,
+@@ -167,25 +213,34 @@
+ 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.materials.rheologymodel = md.materials.issolid * 0
+ md.love.forcing_type = 11
+ md.love.sh_nmin = 1
+ md.love.sh_nmax = 100
+-
+ md = solve(md, 'lv')
+-
+-md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, -1e-3, -1e-2,
+-                                 -1]) * 2 * pi).reshape(-1, 1) / cst
++md.love.frequencies = (np.array([0, 1e-3, 1e-2, 1, -1e-3, -1e-2, -1]) * 2 * np.pi).reshape(-1, 1) / cst
+ md.love.nfreq = len(md.love.frequencies)
+ 
+-field_names += ['LoveH_loadingVSS96_elastic', 'LoveK_loadingVSS96_elastic', 'LoveL_loadingVSS96_elastic', 'LoveH_loadingVSS96_realpart', 'LoveK_loadingVSS96_realpart', 'LoveL_loadingVSS96_realpart', 'LoveH_loadingVSS96_imagpart', 'LoveK_loadingVSS96_imagpart', 'LoveL_loadingVSS96_imagpart']
++field_names += [
++    'LoveH_loadingVSS96_elastic',
++    'LoveK_loadingVSS96_elastic',
++    'LoveL_loadingVSS96_elastic',
++    'LoveH_loadingVSS96_realpart',
++    'LoveK_loadingVSS96_realpart',
++    'LoveL_loadingVSS96_realpart',
++    'LoveH_loadingVSS96_imagpart',
++    'LoveK_loadingVSS96_imagpart',
++    'LoveL_loadingVSS96_imagpart'
++]
+ field_tolerances += [2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6, 2e-6]
+-field_values += [np.array(md.results.LoveSolution.LoveHr)[:, 0],
+-                 np.array(md.results.LoveSolution.LoveKr)[:, 0],
+-                 np.array(md.results.LoveSolution.LoveLr)[:, 0],
+-                 np.array(md.results.LoveSolution.LoveHr)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveKr)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveLr)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveHi)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveKi)[:, 1:],
+-                 np.array(md.results.LoveSolution.LoveLi)[:, 1:]]
++field_values += [
++    np.array(md.results.LoveSolution.LoveHr)[:, 0],
++    np.array(md.results.LoveSolution.LoveKr)[:, 0],
++    np.array(md.results.LoveSolution.LoveLr)[:, 0],
++    np.array(md.results.LoveSolution.LoveHr)[:, 1:],
++    np.array(md.results.LoveSolution.LoveKr)[:, 1:],
++    np.array(md.results.LoveSolution.LoveLr)[:, 1:],
++    np.array(md.results.LoveSolution.LoveHi)[:, 1:],
++    np.array(md.results.LoveSolution.LoveKi)[:, 1:],
++    np.array(md.results.LoveSolution.LoveLi)[:, 1:]
++]
+Index: ../trunk-jpl/test/NightlyRun/test2090.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2090.m	(revision 26358)
+@@ -2,8 +2,7 @@
+ 
+ %mesh earth:
+ md=model;
+-load ../Data/SlcTestMesh.mat;
+-md.mesh=SlcMesh; %700 km resolution mesh
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.);
+ 
+ %Geometry for the bed, arbitrary thickness of 1000: 
+ md.geometry.bed=-ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test2101.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2101.m	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2101.m	(revision 26358)
+@@ -3,7 +3,7 @@
+ 
+ %mesh earth: 
+ md=model; 
+-md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',1000);
++md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700);
+ 
+ % define load 
+ md.esa.deltathickness=zeros(md.mesh.numberofelements,1);
+Index: ../trunk-jpl/test/NightlyRun/test2101.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2101.py	(revision 26357)
++++ ../trunk-jpl/test/NightlyRun/test2101.py	(revision 26358)
+@@ -14,7 +14,7 @@
+ 
+ #mesh earth:
+ md = model()
+-md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 1000)
++md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700)
+ 
+ #define load
+ md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
+Index: ../trunk-jpl/test/Par/SquareSheetConstrained.py
+===================================================================
+--- ../trunk-jpl/test/Par/SquareSheetConstrained.py	(revision 26357)
++++ ../trunk-jpl/test/Par/SquareSheetConstrained.py	(revision 26358)
+@@ -1,23 +1,23 @@
++import inspect
+ import os.path
+ import numpy as np
+-import inspect
+-from verbose import verbose
++from arch import *
+ from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
+ from paterson import paterson
+ from SetIceSheetBC import SetIceSheetBC
+-from arch import *
++from verbose import verbose
+ 
+ #Start defining model parameters here
+ 
+-#Geometry
+-hmin = 300.
+-hmax = 1000.
++# Geometry
++hmin = 300.0
++hmax = 1000.0
+ ymin = np.min(md.mesh.y)
+ ymax = np.max(md.mesh.y)
+ 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.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness + 20.0
+ md.geometry.bed = md.geometry.base
+ md.geometry.surface = md.geometry.base + md.geometry.thickness
+ 
+@@ -34,9 +34,9 @@
+ md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
+ 
+ #Materials
+-md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
++md.initialization.temperature = (273.0 - 20.0) * np.ones((md.mesh.numberofvertices))
+ md.materials.rheology_B = paterson(md.initialization.temperature)
+-md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
++md.materials.rheology_n = 3.0 * np.ones((md.mesh.numberofelements))
+ 
+ #Calving
+ md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
+@@ -43,14 +43,14 @@
+ 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.ocean_levelset < 0.)[0]] = 0.
++md.friction.coefficient = 20.0 * np.ones((md.mesh.numberofvertices))
++md.friction.coefficient[np.where(md.mask.ocean_levelset < 0.0)[0]] = 0.0
+ md.friction.p = np.ones((md.mesh.numberofelements))
+ md.friction.q = np.ones((md.mesh.numberofelements))
+ 
+ #Numerical parameters
+-md.masstransport.stabilization = 1.
+-md.thermal.stabilization = 1.
++md.masstransport.stabilization = 1.0
++md.thermal.stabilization = 1.0
+ md.verbose = verbose(0)
+ md.settings.waitonlock = 30
+ md.stressbalance.restol = 0.05
+@@ -57,8 +57,8 @@
+ 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.timestepping.time_step = 1.0
++md.timestepping.final_time = 3.0
+ md.groundingline.migration = 'None'
+ 
+ #Boundary conditions:
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26357)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26358)
+@@ -85,5 +85,5 @@
+ # NOTE:
+ # - Excluding 2006 until it can be debugged (file I/O)
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2006 2051 2052 2053 2084 2085 2424 2425]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2006 2051 2052 2053 2084 2085 2424 2425"
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26357)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26358)
+@@ -85,10 +85,7 @@
+ # See documentation in test/NightlyRun/runme.* for more information.
+ #
+ # NOTE:
+-# - Tests 2002, 2003, 2005, 2010, 2101, and 2021 are excluded as Gmsh produces 
+-# different-sized meshes on macOS and Linux for 3d objects (archives are 
+-# generated on macOS).
+ # - Excluding 2006 until it can be debugged (PETSc crash)
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2005 2006 2007 2010 2011 2021 2051 2052 2053 2084 2085 2101 2424 2425"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2006 2007 2051 2052 2053 2084 2085 2424 2425]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2006 2007 2051 2052 2053 2084 2085 2424 2425"
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26357)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26358)
+@@ -29,7 +29,7 @@
+ #
+ LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+ LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+-MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2002,2003,2005,2006,2010,2020,2021,2051,2052,2053,2101,2102,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
++MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2004,2006,2007,2011,2051,2052,2053,2084,2085,2424,2425,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ MATLAB_PATH="/usr/local/MATLAB/R2019b"
+ 
+ ## Environment
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26357)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26358)
+@@ -29,7 +29,7 @@
+ #
+ LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+ LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+-PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2002 2003 2005 2006 2010 2020 2021 2051 2052 2053 2101 2102 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
++PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2004 2006 2007 2051 2052 2053 2084 2085 2424 2425 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ 
+ ## Environment
+ #
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26358)
+@@ -21,6 +21,18 @@
+ 					error('constructor not supported');
+ 			end
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
++			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
++			fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
++			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
++			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
++			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
++			disp(sprintf('%51s  0: Arithmetic (default)',' '));
++			disp(sprintf('%51s  1: Geometric',' '));
++			disp(sprintf('%51s  2: Harmonic',' '));
++			fielddisplay(self,'requested_outputs','additional outputs requested');
++		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 
+ 			self.accumulation=project3d(md,'vector',self.accumulation,'type','node');
+@@ -37,15 +49,15 @@
+ 
+ 			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
+ 
+ 		end % }}}
+@@ -65,18 +77,6 @@
+ 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+ 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('	  surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
+-			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
+-			fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
+-			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
+-			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+-			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+-			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+-			disp(sprintf('%51s  1: Geometric',' '));
+-			disp(sprintf('%51s  2: Harmonic',' '));
+-			fielddisplay(self,'requested_outputs','additional outputs requested');
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			yts=md.constants.yts;
+@@ -91,7 +91,7 @@
+ 			outputs = self.requested_outputs;
+ 			pos  = find(ismember(outputs,'default'));
+ 			if ~isempty(pos),
+-				outputs(pos) = [];			       %remove 'default' from outputs
++				outputs(pos) = [];                            %remove 'default' from outputs
+ 				outputs	 = [outputs defaultoutputs(self,md)]; %add defaults
+ 			end
+ 			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26358)
+@@ -20,6 +20,7 @@
+         self.steps_per_step = 1
+         self.averaging = 0
+         self.requested_outputs = []
++        self.isclimatology = np.nan
+ 
+         nargs = len(args)
+         if nargs == 0:
+@@ -29,7 +30,7 @@
+     # }}}
+ 
+     def __repr__(self):  # {{{
+-        s = '   surface forcings parameters (SMB = accumulation-runoff-evaporation):\n'
++        s = '   surface forcings parameters (SMB=accumulation-runoff-evaporation) :\n'
+         s += '{}\n'.format(fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
+         s += '{}\n'.format(fielddisplay(self, 'runoff', 'amount of ice melt lost from the ice column [m/yr ice eq]'))
+         s += '{}\n'.format(fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
+@@ -43,9 +44,9 @@
+     # }}}
+ 
+     def extrude(self, md):  # {{{
+-        self.mass_balance = project3d(md, 'vector', self.accumulation, 'type', 'node')
+-        self.mass_balance = project3d(md, 'vector', self.runoff, 'type', 'node')
+-        self.mass_balance = project3d(md, 'vector', self.evaporation, 'type', 'node')
++        self.accumulation = project3d(md, 'vector', self.accumulation, 'type', 'node')
++        self.runoff = project3d(md, 'vector', self.runoff, 'type', 'node')
++        self.evaporation = project3d(md, 'vector', self.evaporation, 'type', 'node')
+         return self
+     # }}}
+ 
+@@ -56,14 +57,13 @@
+     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")
++            print('      no SMB.accumulation specified: values set as zero')
++        if np.all(np.isnan(self.evaporation)):
++            self.evaporation = np.zeros((md.mesh.numberofvertices))
++            print("      no SMB.evaporation specified: values set as zero")
+         if np.all(np.isnan(self.runoff)):
+             self.runoff = np.zeros((md.mesh.numberofvertices))
+             print("      no SMB.runoff specified: values set as zero")
+-
+-        if np.all(np.isnan(self.evaporation)):
+-            self.evaporation = np.zeros((md.mesh.numberofvertices))
+-            print("      no SMB.evaporation specified: values set as zero")
+         return self
+     # }}}
+ 
+@@ -78,7 +78,7 @@
+             md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
+-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
++        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
+         return md
+     # }}}
+ 
+@@ -86,12 +86,12 @@
+         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', yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoff', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoff', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
+-    #process requested outputs
++        # Process requested outputs
+         outputs = self.requested_outputs
+         indices = [i for i, x in enumerate(outputs) if x == 'default']
+         if len(indices) > 0:
+Index: ../trunk-jpl/src/m/classes/SMBgemb.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26358)
+@@ -7,31 +7,32 @@
+ 
+ 
+ class SMBgemb(object):
+-    """
+-    SMBgemb Class definition
++    """SMBGEMB class definition
+ 
+-       Usage:
+-          SMB = SMBgemb()
++    Usage:
++        SMB = SMBgemb()
+     """
+ 
+     def __init__(self, *args):  # {{{
+-        #each one of these properties is a transient forcing to the GEMB model, loaded from meteorological data derived
+-        #from an automatic weather stations (AWS). Each property is therefore a matrix, of size (numberofvertices x number
+-        #of time steps. )
++        """Each one of these properties is a transient forcing to the GEMB 
++        model, loaded from meteorological data derived from an automatic 
++        weather stations (AWS). Each property is therefore a matrix, of size 
++        (numberofvertices x number of time steps.
++        """
+ 
+         #solution choices
+-        #check these:
+-        #self.isgraingrowth = 0
+-        #self.issmbgradients = 0
+-        #isalbedo
+-        #isshortwave
+-        #isthermal
+-        #isaccumulation
+-        #ismelt
+-        #isdensification
+-        #isturbulentflux
++        self.isgraingrowth
++        self.isalbedo
++        self.isshortwave
++        self.isthermal
++        self.isaccumulation
++        self.ismelt
++        self.isdensification
++        self.isturbulentflux
++        self.isconstrainsurfaceT
++        self.isclimatology = np.nan
+ 
+-        #inputs:
++        # Inputs
+         self.Ta                     = np.nan    # 2 m air temperature, in Kelvin
+         self.V                      = np.nan    # wind speed (m/s-1)
+         self.dswrf                  = np.nan    # downward shortwave radiation flux [W/m^2]
+@@ -39,6 +40,7 @@
+         self.P                      = np.nan    # precipitation [mm w.e. / m^2]
+         self.eAir                   = np.nan    # screen level vapor pressure [Pa]
+         self.pAir                   = np.nan    # surface pressure [Pa]
++
+         self.Tmean                  = np.nan    # mean annual temperature [K]
+         self.Vmean                  = np.nan    # mean annual wind velocity [m s-1]
+         self.C                      = np.nan    # mean annual snow accumulation [kg m-2 yr-1]
+@@ -45,8 +47,8 @@
+         self.Tz                     = np.nan    # height above ground at which temperature (T) was sampled [m]
+         self.Vz                     = np.nan    # height above ground at which wind (V) was sampled [m]
+ 
+-        #optional inputs:
+-        self.aValue                 = np.nan    # Albedo forcing at every element.  Used only if aIdx == 0, or density exceeds adThresh
++        # Optional inputs
++        self.aValue                 = np.nan    # Albedo forcing at every element. Used only if aIdx == 0, or density exceeds adThresh.
+         self.teValue                = np.nan    # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
+ 
+         # Initialization of snow properties
+@@ -53,7 +55,7 @@
+         self.Dzini                  = np.nan    # cell depth (m)
+         self.Dini                   = np.nan    # snow density (kg m-3)
+         self.Reini                  = np.nan    # effective grain size (mm)
+-        self.Gdnini                 = np.nan    # grain dricity (0-1)
++        self.Gdnini                 = np.nan    # grain dendricity (0-1)
+         self.Gspini                 = np.nan    # grain sphericity (0-1)
+         self.ECini                  = np.nan    # evaporation/condensation (kg m-2)
+         self.Wini                   = np.nan    # Water content (kg m-2)
+@@ -62,47 +64,49 @@
+         self.Tini                   = np.nan    # snow temperature (K)
+         self.Sizeini                = np.nan    # Number of layers
+ 
+-        #settings:
++        # Settings
+         self.aIdx                   = np.nan    # method for calculating albedo and subsurface absorption (default is 1)
+-            # 0: direct input from aValue parameter
+-            # 1: effective grain radius [Gardner & Sharp, 2009]
+-            # 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
+-            # 3: density and cloud amount [Greuell & Konzelmann, 1994]
+-            # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
++        # 0: direct input from aValue parameter
++        # 1: effective grain radius [Gardner & Sharp, 2009]
++        # 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
++        # 3: density and cloud amount [Greuell & Konzelmann, 1994]
++        # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+ 
+-        self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)) 
++        self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002))
++
+         self.denIdx                 = np.nan    # densification model to use (default is 2):
+-            # 1 = emperical model of Herron and Langway (1980)
+-            # 2 = semi-emperical model of Anthern et al. (2010)
+-            # 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
+-            # 4 = DO NOT USE: emperical model of Li and Zwally (2004)
+-            # 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
+-            # 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
+-            # 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
++        # 1 = emperical model of Herron and Langway (1980)
++        # 2 = semi-emperical model of Anthern et al. (2010)
++        # 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
++        # 4 = DO NOT USE: emperical model of Li and Zwally (2004)
++        # 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
++        # 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
++        # 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
+ 
+         self.dsnowIdx               = np.nan    # model for fresh snow accumulation density (default is 1):
+-            # 0 = Original GEMB value, 150 kg/m^3
+-            # 1 = Antarctica value of fresh snow density, 350 kg/m^3
+-            # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
+-            # 3 = Antarctica model of Kaspers et al. (2004)
+-            # 4 = Greenland model of Kuipers Munneke et al. (2015)
++        # 0 = Original GEMB value, 150 kg/m^3
++        # 1 = Antarctica value of fresh snow density, 350 kg/m^3
++        # 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)
++        # 3 = Antarctica model of Kaspers et al. (2004)
++        # 4 = Greenland model of Kuipers Munneke et al. (2015)
+ 
+         self.zTop                   = np.nan    # depth over which grid length is constant at the top of the snopack (default 10) [m]
+         self.dzTop                  = np.nan    # initial top vertical grid spacing (default .05) [m]
+         self.dzMin                  = np.nan    # initial min vertical allowable grid spacing (default dzMin/2) [m]
++
+         self.zY                     = np.nan    # strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
+         self.zMax                   = np.nan    # initial max model depth (default is min(thickness, 250)) [m]
+         self.zMin                   = np.nan    # initial min model depth (default is min(thickness, 130)) [m]
+         self.outputFreq             = np.nan    # output frequency in days (default is monthly, 30)
+ 
+-        #specific albedo parameters:
+-        #Method 1
+-        dswdiffrf                   = np.nan    #downward diffusive shortwave radiation flux [W/m^2]
+-        szaValue                    = np.nan    #Solar Zenith Angle [degree]
+-        cotValue                    = np.nan    #Cloud Optical Thickness
+-        ccsnowValue                 = np.nan    #concentration of light absorbing carbon for snow [ppm1]
+-        cciceValue                  = np.nan    #concentration of light absorbing carbon for ice [ppm1]
+-        #Method 1 and 2:
++        # Specific albedo parameters
++        # Method 1
++        self.dswdiffrf              = np.nan    # downward diffusive shortwave radiation flux [W/m^2]
++        self.szaValue               = np.nan    # Solar Zenith Angle [degree]
++        self.cotValue               = np.nan    # Cloud Optical Thickness
++        self.ccsnowValue            = np.nan    # concentration of light absorbing carbon for snow [ppm1]
++        self.cciceValue             = np.nan    # concentration of light absorbing carbon for ice [ppm1]
++        # Method 1 and 2
+         self.aSnow                  = np.nan    # new snow albedo (0.64 - 0.89)
+         self.aIce                   = np.nan    # range 0.27-0.58 for old snow
+         #Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
+@@ -115,10 +119,10 @@
+         # or else apply direct input value from aValue, allowing albedo to be altered.
+         # Default value is rho water (1023 kg m-3).
+ 
+-        #densities:
++        # Densities
+         self.InitDensityScaling     = np.nan    # initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
+ 
+-        #thermo:
++        # Thermal
+         self.ThermoDeltaTScaling    = np.nan    # scaling factor to multiply the thermal diffusion timestep (delta t)
+ 
+         self.steps_per_step         = 1
+@@ -125,19 +129,19 @@
+         self.averaging              = 0
+         self.requested_outputs      = []
+ 
+-        #Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM.
++        #Several fields are missing from the standard GEMB model, which are 
++        #captured intrinsically by ISSM.
+         #dateN: that's the last row of the above fields.
+         #dt:    included in dateN. Not an input.
+         #elev:  this is taken from the ISSM surface itself.
+ 
+         nargin = len(args)
+-        if nargin:
+-            if nargin == 2:
+-                mesh = args[0]
+-                geometry = args[1]
+-                self.setdefaultparameters(mesh, geometry)
+-            else:
+-                raise Exception('constructor not supported: need mesh and geometry to set defaults')
++        if nargin == 2:
++            mesh = args[0]
++            geometry = args[1]
++            self.setdefaultparameters(mesh, geometry)
++        else:
++            raise Exception('constructor not supported: need mesh and geometry to set defaults')
+         #}}}
+ 
+     def __repr__(self):  # {{{
+@@ -144,100 +148,100 @@
+         #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, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'V', 'wind speed (m s-1)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'dswdiffrf', 'downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'dlwrf', 'downward longwave radiation flux [W/m^2]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'P', 'precipitation [mm w.e. / m^2]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'eAir', 'screen level vapor pressure [Pa]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'pAir', 'surface pressure [Pa]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Tmean', 'mean annual temperature [K]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'C', 'mean annual snow accumulation [kg m-2 yr-1]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Vmean', 'mean annual temperature [m s-1] (default 10 m/s)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Tz', 'height above ground at which temperature (T) was sampled [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Vz', 'height above ground at which wind (V) eas sampled [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'zTop', 'depth over which grid length is constant at the top of the snopack (default 10) [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'dzTop', 'initial top vertical grid spacing (default .05) [m] '))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'dzMin', 'initial min vertical allowable grid spacing (default dzMin/2) [m] '))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'zMax', 'initial max model depth (default is min(thickness, 500)) [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'zMin', 'initial min model depth (default is min(thickness, 30)) [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'zY', 'strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'InitDensityScaling', ['initial scaling factor multiplying the density of ice', 'which describes the density of the snowpack.']))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'ThermoDeltaTScaling', 'scaling factor to multiply the thermal diffusion timestep (delta t)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'outputFreq', 'output frequency in days (default is monthly, 30)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'adThresh', 'Apply aIdx method to all areas with densities below this value, ', 'or else apply direct input value from aValue, allowing albedo to be altered.'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'aIdx', ['method for calculating albedo and subsurface absorption (default is 1)',
+-                                                                 '0: direct input from aValue parameter',
+-                                                                 '1: effective grain radius [Gardner & Sharp, 2009]',
+-                                                                 '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',
+-                                                                 '3: density and cloud amount [Greuell & Konzelmann, 1994]',
+-                                                                 '4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
+-        #snow properties init
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Dini', 'Initial snow density when restart [kg m-3]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Reini', 'Initial grain size when restart [mm]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Gdnini', 'Initial grain dricity when restart [-]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Gspini', 'Initial grain sphericity when restart [-]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'ECini', 'Initial evaporation/condensation when restart [kg m-2]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Wini', 'Initial snow water content when restart [kg m-2]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Aini', 'Initial albedo when restart [-]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Adiffini', 'Initial diffusive radiation albedo when restart (default to 1) [-]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Tini', 'Initial snow temperature when restart [K]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [-]'))
++        s = '   surface forcings for SMB GEMB model :\n'
++        s += '{}\n'.format(fielddisplay(self, 'isgraingrowth', 'run grain growth module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'isalbedo', 'run albedo module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'isshortwave', 'run short wave module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'isthermal', 'run thermal module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'isaccumulation', 'run accumulation module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'ismelt', 'run melting  module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'isdensification', 'run densification module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'isturbulentflux', 'run turbulant heat fluxes module (default true)'))
++        s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change'))
++        s += '{}\n'.format(fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
++        s += '{}\n'.format(fielddisplay(self, 'V', 'wind speed (m s-1)'))
++        s += '{}\n'.format(fielddisplay(self, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'dswdiffrf', 'downward diffusive portion of shortwave radiation flux (default to 0) [W/m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'dlwrf', 'downward longwave radiation flux [W/m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'P', 'precipitation [mm w.e. / m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'eAir', 'screen level vapor pressure [Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'pAir', 'surface pressure [Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'Tmean', 'mean annual temperature [K]'))
++        s += '{}\n'.format(fielddisplay(self, 'C', 'mean annual snow accumulation [kg m-2 yr-1]'))
++        s += '{}\n'.format(fielddisplay(self, 'Vmean', 'mean annual temperature [m s-1] (default 10 m/s)'))
++        s += '{}\n'.format(fielddisplay(self, 'Tz', 'height above ground at which temperature (T) was sampled [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'Vz', 'height above ground at which wind (V) eas sampled [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'zTop', 'depth over which grid length is constant at the top of the snopack (default 10) [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'dzTop', 'initial top vertical grid spacing (default .05) [m] '))
++        s += '{}\n'.format(fielddisplay(self, 'dzMin', 'initial min vertical allowable grid spacing (default dzMin/2) [m] '))
++        s += '{}\n'.format(fielddisplay(self, 'zMax', 'initial max model depth (default is min(thickness, 500)) [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'zMin', 'initial min model depth (default is min(thickness, 30)) [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'zY', 'strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]'))
++        s += '{}\n'.format(fielddisplay(self, 'InitDensityScaling', ['initial scaling factor multiplying the density of ice', 'which describes the density of the snowpack.']))
++        s += '{}\n'.format(fielddisplay(self, 'ThermoDeltaTScaling', 'scaling factor to multiply the thermal diffusion timestep (delta t)'))
++        s += '{}\n'.format(fielddisplay(self, 'outputFreq', 'output frequency in days (default is monthly, 30)'))
++        s += '{}\n'.format(fielddisplay(self, 'adThresh', 'Apply aIdx method to all areas with densities below this value, ', 'or else apply direct input value from aValue, allowing albedo to be altered.'))
++        s += '{}\n'.format(fielddisplay(self, 'aIdx', ['method for calculating albedo and subsurface absorption (default is 1)',
++            '0: direct input from aValue parameter',
++            '1: effective grain radius [Gardner & Sharp, 2009]',
++            '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',
++            '3: density and cloud amount [Greuell & Konzelmann, 1994]',
++            '4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
++        s += '{}\n'.format(fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
+ 
+-        #additional albedo parameters:
+-        string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element'))
++        # Snow properties init
++        s += '{}\n'.format(fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]'))
++        s += '{}\n'.format(fielddisplay(self, 'Dini', 'Initial snow density when restart [kg m-3]'))
++        s += '{}\n'.format(fielddisplay(self, 'Reini', 'Initial grain size when restart [mm]'))
++        s += '{}\n'.format(fielddisplay(self, 'Gdnini', 'Initial grain dricity when restart [-]'))
++        s += '{}\n'.format(fielddisplay(self, 'Gspini', 'Initial grain sphericity when restart [-]'))
++        s += '{}\n'.format(fielddisplay(self, 'ECini', 'Initial evaporation/condensation when restart [kg m-2]'))
++        s += '{}\n'.format(fielddisplay(self, 'Wini', 'Initial snow water content when restart [kg m-2]'))
++        s += '{}\n'.format(fielddisplay(self, 'Aini', 'Initial albedo when restart [-]'))
++        s += '{}\n'.format(fielddisplay(self, 'Adiffini', 'Initial diffusive radiation albedo when restart (default to 1) [-]'))
++        s += '{}\n'.format(fielddisplay(self, 'Tini', 'Initial snow temperature when restart [K]'))
++        s += '{}\n'.format(fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [-]'))
++
++        # Additional albedo parameters
++        s += '{}\n'.format(fielddisplay(self, 'aValue', 'Albedo forcing at every element'))
+         if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
+-            string = "%s\n%s" % (string, fielddisplay(self, 'aSnow', 'new snow albedo (0.64 - 0.89)'))
+-            string = "%s\n%s" % (string, fielddisplay(self, 'aIce', 'albedo of ice (0.27-0.58)'))
++            s += '{}\n'.format(fielddisplay(self, 'aSnow', 'new snow albedo (0.64 - 0.89)'))
++            s += '{}\n'.format(fielddisplay(self, 'aIce', 'albedo of ice (0.27-0.58)'))
+             if self.aIdx == 1:
+-                string = "%s\n%s" % (string, fielddisplay(self,'szaValue','Solar Zenith Angle [degree]'))
+-                string = "%s\n%s" % (string, fielddisplay(self,'cotValue','Cloud Optical Thickness'))
+-                string = "%s\n%s" % (string, fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]'))
+-                string = "%s\n%s" % (string, fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]'))
+-
++                s += '{}\n'.format(fielddisplay(self,'szaValue','Solar Zenith Angle [degree]'))
++                s += '{}\n'.format(fielddisplay(self,'cotValue','Cloud Optical Thickness'))
++                s += '{}\n'.format(fielddisplay(self,'ccsnowValue','concentration of light absorbing carbon for snow [ppm1]'))
++                s += '{}\n'.format(fielddisplay(self,'cciceValue','concentration of light absorbing carbon for snow [ppm1]'))
+         elif self.aIdx == 3:
+-            string = "%s\n%s" % (string, fielddisplay(self, 'cldFrac', 'average cloud amount'))
++            s += '{}\n'.format(fielddisplay(self, 'cldFrac', 'average cloud amount'))
+         elif self.aIdx == 4:
+-            string = "%s\n%s" % (string, fielddisplay(self, 't0wet', 'time scale for wet snow (15-21.9) [d]'))
+-            string = "%s\n%s" % (string, fielddisplay(self, 't0dry', 'warm snow timescale (30) [d]'))
+-            string = "%s\n%s" % (string, fielddisplay(self, 'K', 'time scale temperature coef. (7) [d]'))
++            s += '{}\n'.format(fielddisplay(self, 't0wet', 'time scale for wet snow (15-21.9) [d]'))
++            s += '{}\n'.format(fielddisplay(self, 't0dry', 'warm snow timescale (30) [d]'))
++            s += '{}\n'.format(fielddisplay(self, 'K', 'time scale temperature coef. (7) [d]'))
+ 
+-        string = "%s\n%s" % (string, fielddisplay(self, 'swIdx', 'apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'denIdx', ['densification model to use (default is 2):',
+-                                                                   '1 = emperical model of Herron and Langway (1980)',
+-                                                                   '2 = semi-emperical model of Anthern et al. (2010)',
+-                                                                   '3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
+-                                                                   '4 = DO NOT USE: emperical model of Li and Zwally (2004)',
+-                                                                   '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
+-                                                                   '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
+-                                                                   '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'dsnowIdx', ['model for fresh snow accumulation density (default is 1):',
+-                                                                     '0 = Original GEMB value, 150 kg/m^3',
+-                                                                     '1 = Antarctica value of fresh snow density, 350 kg/m^3',
+-                                                                     '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',
+-                                                                     '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
+-                                                                     '4 = Greenland model of Kuipers Munneke et al. (2015)']))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
+-        string = "%s\n\t\t%s" % (string, '1: Geometric')
+-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
+-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+-        return string
++        s += '{}\n'.format(fielddisplay(self, 'swIdx', 'apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002)]'))
++        s += '{}\n'.format(fielddisplay(self, 'denIdx', ['densification model to use (default is 2):',
++            '1 = emperical model of Herron and Langway (1980)',
++            '2 = semi-emperical model of Anthern et al. (2010)',
++            '3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
++            '4 = DO NOT USE: emperical model of Li and Zwally (2004)',
++            '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
++            '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
++            '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
++        s += '{}\n'.format(fielddisplay(self, 'dsnowIdx', ['model for fresh snow accumulation density (default is 1):',
++            '0 = Original GEMB value, 150 kg/m^3',
++            '1 = Antarctica value of fresh snow density, 350 kg/m^3',
++            '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2018)',
++            '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
++            '4 = Greenland model of Kuipers Munneke et al. (2015)']))
++
++        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
++        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
++        s += '\t\t{}\n'.format('0: Arithmetic (default)')
++        s += '\t\t{}\n'.format('1: Geometric')
++        s += '\t\t{}\n'.format('2: Harmonic')
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
++        return s
+     #}}}
+ 
+     def extrude(self, md):  # {{{
+@@ -244,7 +248,7 @@
+         self.Ta = project3d(md, 'vector', self.Ta, 'type', 'element')
+         self.V = project3d(md, 'vector', self.V, 'type', 'element')
+         self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'element')
+-        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'element')
++        self.dslrf = project3d(md, 'vector', self.dslrf, 'type', 'element')
+         self.P = project3d(md, 'vector', self.P, 'type', 'element')
+         self.eAir = project3d(md, 'vector', self.eAir, 'type', 'element')
+         self.pAir = project3d(md, 'vector', self.pAir, 'type', 'element')
+@@ -269,6 +273,7 @@
+             self.Adiffini=project3d(md,'vector',self.Adiffini,'type','element');
+         if not np.isnan(self.Tini):
+             self.Tini=project3d(md,'vector',self.Tini,'type','element');
++
+         if not np.isnan(self.dswdiffrf):
+             self.dswdiffrf=project3d(md,'vector',self.dswdiffrf,'type','element');
+         if not np.isnan(self.szaValue):
+@@ -294,7 +299,6 @@
+ 
+     def setdefaultparameters(self, mesh, geometry):  # {{{
+         self.isgraingrowth = 1
+-        self.issmbgradients = 0
+         self.isalbedo = 1
+         self.isshortwave = 1
+         self.isthermal = 1
+@@ -309,7 +313,7 @@
+         self.denIdx = 2
+         self.dsnowIdx = 1
+         self.zTop = 10 * np.ones((mesh.numberofelements,))
+-        self.dzTop = .05 * np.ones((mesh.numberofelements,))
++        self.dzTop = 0.05 * np.ones((mesh.numberofelements,))
+         self.dzMin = self.dzTop / 2
+         self.InitDensityScaling = 1.0
+         self.ThermoDeltaTScaling = 1 / 11.0
+@@ -321,7 +325,7 @@
+         self.zY = 1.025 * np.ones((mesh.numberofelements,))
+         self.outputFreq = 30
+ 
+-        #additional albedo parameters
++        # Additional albedo parameters
+         self.aSnow = 0.85
+         self.aIce = 0.48
+         self.cldFrac = 0.1
+@@ -346,11 +350,15 @@
+         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.Aini = 0.0 * np.ones((mesh.numberofelements, 2))
+         self.Adiffini = np.ones((mesh.numberofelements, 2))
+         self.Tini = 273.15 * np.ones((mesh.numberofelements, 2))
+-#       /!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
+-#       If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
++        #       /!\ Default value of Tini must be equal to Tmean but don't know 
++        #           Tmean yet (computed when atmospheric forcings are 
++        #           interpolated on mesh).
++        #           If initialization without restart, this value will be 
++        #           overwritten when snow parameters are retrieved in 
++        #           Element.cpp
+         self.Sizeini = 2 * np.ones((mesh.numberofelements,))
+     #}}}
+ 
+@@ -357,7 +365,6 @@
+     def checkconsistency(self, md, solution, analyses):    # {{{
+ 
+         md = checkfield(md, 'fieldname', 'smb.isgraingrowth', 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'smb.issmbgradients', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.isalbedo', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.isshortwave', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.isthermal', 'values', [0, 1])
+@@ -397,7 +404,9 @@
+         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)):
++        if self.aIdx == 0:
++            md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
++        elif isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
+             md = checkfield(md, 'fieldname', 'smb.aSnow', 'NaN', 1, 'Inf', 1, '> = ', .64, '< = ', .89)
+             md = checkfield(md, 'fieldname', 'smb.aIce', 'NaN', 1, 'Inf', 1, '> = ', .27, '< = ', .58)
+             if self.aIdx == 1:
+@@ -405,9 +414,6 @@
+                 md = checkfield(md,'fieldname','smb.cotValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
+                 md = checkfield(md,'fieldname','smb.ccsnowValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
+                 md = checkfield(md,'fieldname','smb.cciceValue','timeseries',1,'NaN',1,'Inf',1,'>=',0)
+-
+-        elif self.aIdx == 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:
+@@ -415,7 +421,7 @@
+             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:
++        # 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')
+@@ -431,7 +437,6 @@
+         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', 'issmbgradients', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isalbedo', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isshortwave', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isthermal', 'format', 'Boolean')
+@@ -440,6 +445,7 @@
+         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', 'isconstrainsurfaceT', 'format', 'Boolean')
++
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+@@ -497,7 +503,7 @@
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Sizeini', 'format', 'IntMat', 'mattype', 2)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
+-        #figure out dt from forcings:
++        # Figure out dt from forcings
+         if (np.any(self.P[-1] - self.Ta[-1] != 0) | np.any(self.V[-1] - self.Ta[-1] != 0) | np.any(self.dswrf[-1] - self.Ta[-1] != 0) | np.any(self.dlwrf[-1] - self.Ta[-1] != 0) | np.any(self.eAir[-1] - self.Ta[-1] != 0) | np.any(self.pAir[-1] - self.Ta[-1] != 0)):
+             raise IOError('All GEMB forcings (Ta, P, V, dswrf, dlwrf, eAir, pAir) must have the same time steps in the final row!')
+ 
+@@ -516,7 +522,7 @@
+         if ((np.ndim(self.cciceValue)>1) & np.any(self.cciceValue[-1] - self.Ta[-1] != 0)):
+             raise IOError('If GEMB forcing cciceValue is transient, it must have the same time steps as input Ta in the final row!')
+ 
+-        time = self.Ta[-1]  #assume all forcings are on the same time step
++        time = self.Ta[-1]  # Assume all forcings are on the same time step
+         dtime = np.diff(time, n=1, axis=0)
+         dt = min(dtime)
+ 
+@@ -524,9 +530,9 @@
+ 
+         # 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)
++            raise IOError('smb_dt/dt = {}. The number of SMB time steps in one transient core time step has to be an an integer'.format(md.timestepping.time_step / dt))
+ 
+-        #process requested outputs
++        # Process requested outputs
+         outputs = self.requested_outputs
+         indices = [i for i, x in enumerate(outputs) if x == 'default']
+         if len(indices) > 0:
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26358)
+@@ -1,39 +1,47 @@
++import numpy as np
++
++from checkfield import *
+ from fielddisplay import fielddisplay
+-from checkfield import *
+ from project3d import *
+ from WriteData import *
+ 
+ 
+ class SMBmeltcomponents(object):
+-    """
+-    SMBmeltcomponents Class definition
++    """SMBMELTCOMPONENTS lass definition
+ 
+-       Usage:
+-          SMBmeltcomponents = SMBmeltcomponents();
++    Usage:
++        SMBmeltcomponents = SMBmeltcomponents();
+     """
+ 
+     def __init__(self):  # {{{
+-        self.accumulation = float('NaN')
+-        self.runoff = float('NaN')
+-        self.evaporation = float('NaN')
++        self.accumulation = np.nan
++        self.evaporation = np.nan
++        self.melt = np.nan
++        self.refreeze = np.nan
+         self.steps_per_step = 1
+         self.averaging = 0
+         self.requested_outputs = []
++        self.isclimatology = np.nan
++
++        if len(args) == 0:
++            pass
++        else:
++            error('constructor not supported')
+     #}}}
+ 
+     def __repr__(self):  # {{{
+-        string = "   surface forcings parameters with melt (SMB = accumulation-evaporation-melt+refreeze) :"
+-        string = "%s\n%s" % (string, fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'melt', 'amount of ice melt in the ice column [m/yr ice eq]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'refreeze', 'amount of ice melt refrozen in the ice column [m/yr ice eq]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
+-        string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)')
+-        string = "%s\n\t\t%s" % (string, '1: Geometric')
+-        string = "%s\n\t\t%s" % (string, '2: Harmonic')
+-        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+-        return string
++        s = '   surface forcings parameters with melt (SMB = accumulation-evaporation-melt+refreeze) :\n'
++        s += '{}\n'.format(fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
++        s += '{}\n'.format(fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
++        s += '{}\n'.format(fielddisplay(self, 'melt', 'amount of ice melt in the ice column [m/yr ice eq]'))
++        s += '{}\n'.format(fielddisplay(self, 'refreeze', 'amount of ice melt refrozen in the ice column [m/yr ice eq]'))
++        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
++        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
++        s += '\t\t{}\n'.format('0: Arithmetic (default)')
++        s += '\t\t{}\n'.format('1: Geometric')
++        s += '\t\t{}\n'.format('2: Harmonic')
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
++        return s
+     #}}}
+ 
+     def extrude(self, md):  # {{{
+@@ -51,50 +59,50 @@
+     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")
++            print("      no smb.accumulation specified: values set as zero")
+ 
+         if np.all(np.isnan(self.evaporation)):
+             self.evaporation = np.zeros((md.mesh.numberofvertices))
+-            print("      no SMB.evaporation specified: values set as zero")
++            print("      no smb.evaporation specified: values set as zero")
+ 
++        if np.all(np.isnan(self.refreeze)):
++            self.refreeze = np.zeros((md.mesh.numberofvertices))
++            print("      no smb.refreeze specified: values set as zero")
++
+         if np.all(np.isnan(self.melt)):
+             self.melt = np.zeros((md.mesh.numberofvertices))
+-            print("      no SMB.melt specified: values set as zero")
++            print("      no smb.melt specified: values set as zero")
+ 
+-        if np.all(np.isnan(self.refreeze)):
+-            self.refreeze = np.zeros((md.mesh.numberofvertices))
+-            print("      no SMB.refreeze specified: values set as zero")
+-
+         return self
+     #}}}
+ 
+-    def checkconsistency(self, md, solution, analyses):    # {{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         if 'MasstransportAnalysis' in analyses:
+             md = checkfield(md, 'fieldname', 'smb.accumulation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
++            md = checkfield(md, 'fieldname', 'smb.evaporation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
++            md = checkfield(md, 'fieldname', 'smb.refreeze', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+             md = checkfield(md, 'fieldname', 'smb.melt', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+-            md = checkfield(md, 'fieldname', 'smb.refreeze', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+ 
+         if 'BalancethicknessAnalysis' in analyses:
+             md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
++            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
++            md = checkfield(md, 'fieldname', 'smb.refreeze', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+             md = checkfield(md, 'fieldname', 'smb.melt', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+-            md = checkfield(md, 'fieldname', 'smb.refreeze', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+-            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+ 
+         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
+-        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
++        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
+         return md
+     # }}}
+-    def marshall(self, prefix, md, fid):    # {{{
++    def marshall(self, prefix, md, fid):  # {{{
+ 
+         yts = md.constants.yts
+ 
+         WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 3, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'melt', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'refreeze', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accumulation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'evaporation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'melt', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'refreeze', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1 / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
+ 
+@@ -105,5 +113,4 @@
+             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: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 26358)
+@@ -40,7 +40,7 @@
+ 
+     def checkconsistency(self, md, solution, analyses):  #{{{
+         # Early return
+-        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (md.transient.isoceantransport == 0):
++        if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (not md.transient.isoceantransport):
+             return md
+         md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1)
+         md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+@@ -55,7 +55,7 @@
+     def marshall(self, prefix, md, fid):   #{{{
+         yts = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'yts', yts)  # mattype 2, because we are sending a GMSL value identical everywhere on each element.
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'timeserieslength', 2, 'yts', yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify DSL at vertex locations.
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)  # mattype 1 because we specify bottom pressure at vertex locations.
+     # }}}
+@@ -67,6 +67,8 @@
+     #}}}
+ 
+     def initialize(self, md):  #{{{
++        print('sdasa')
++        exit()
+         if np.isnan(self.global_average_thermosteric_sea_level):
+             self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
+             print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
+Index: ../trunk-jpl/src/m/classes/levelset.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/levelset.m	(revision 26358)
+@@ -8,9 +8,9 @@
+ 		stabilization		= 0;
+ 		spclevelset			= NaN;
+ 		reinit_frequency	= 5;
+-		kill_icebergs     = 0;
+-		migration_max       = 0.;
+-		fe                = 'P1';
++		kill_icebergs		= 0;
++		migration_max		= 0.;
++		fe					= 'P1';
+ 	end
+ 	methods
+ 		function self = levelset(varargin) % {{{
+@@ -31,6 +31,15 @@
+ 					error('constructor not supported');
+ 			end
+ 		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   Level-set parameters:'));
++			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
++			fielddisplay(self,'spclevelset','Levelset constraints (NaN means no constraint)');
++			fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized');
++			fielddisplay(self,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
++			fielddisplay(self,'migration_max','maximum allowed migration rate (m/a)');
++			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2''');
++		end % }}}
+ 		function self = extrude(self,md) % {{{
+ 
+ 			self.spclevelset=project3d(md,'vector',self.spclevelset,'type','node');
+@@ -41,7 +50,7 @@
+ 			self.stabilization    = 1;
+ 			self.reinit_frequency = 5;
+ 			self.kill_icebergs    = 1;
+-			self.migration_max      = 1e12; % No need for general cases, unless specified
++			self.migration_max    = 1e12; % No need for general cases, unless specified
+ 
+ 			%Linear elements by default
+ 			self.fe='P1';
+@@ -57,21 +66,12 @@
+ 			md = checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
+ 			md = checkfield(md,'fieldname','levelset.fe','values',{'P1','P2'});
+ 		end % }}}
+-		function disp(self) % {{{
+-			disp(sprintf('   Level-set parameters:'));
+-			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding');
+-			fielddisplay(self,'spclevelset','Levelset constraints (NaN means no constraint)');
+-			fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized');
+-			fielddisplay(self,'kill_icebergs','remove floating icebergs to prevent rigid body motions (1: true, 0: false)');
+-			fielddisplay(self,'migration_max','maximum allowed migration rate (m/a)');
+-			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2''');
+-		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			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',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','kill_icebergs','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','migration_max','format','Double','scale',1./yts);
+Index: ../trunk-jpl/src/m/classes/levelset.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/levelset.py	(revision 26358)
+@@ -1,55 +1,49 @@
++import numpy as np
++
++from checkfield import checkfield
+ from fielddisplay import fielddisplay
+ from project3d import project3d
+-from checkfield import checkfield
+ from WriteData import WriteData
+ 
+ 
+ class levelset(object):
+-    """
+-    LEVELSET class definition
++    """LEVELSET class definition
+ 
+-       Usage:
+-          levelset = levelset()
++    Usage:
++        levelset = levelset()
+     """
+ 
+     def __init__(self):  # {{{
+-
+         self.stabilization = 0
+-        self.spclevelset = float('NaN')
+-        self.reinit_frequency = 0
++        self.spclevelset = np.nan
++        self.reinit_frequency = 5
+         self.kill_icebergs = 0
+-        self.migration_max = 0.
++        self.migration_max = 0
+         self.fe = 'P1'
+ 
+-    #set defaults
++        # Set defaults
+         self.setdefaultparameters()
+-
+     #}}}
+     def __repr__(self):  # {{{
+-        string = '   Level - set parameters:'
+-        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'spclevelset', 'levelset constraints (NaN means no constraint)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'reinit_frequency', 'Amount of time steps after which the levelset function in re-initialized'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'kill_icebergs', 'remove floating icebergs to prevent rigid body motions (1: true, 0: false)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'migration_max', 'maximum allowed migration rate (m / a)'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'fe', 'Finite Element type: ''P1'' (default), or ''P2'''))
++        s = '   Level-set parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding'))
++        s += '{}\n'.format(fielddisplay(self, 'spclevelset', 'Levelset constraints (NaN means no constraint)'))
++        s += '{}\n'.format(fielddisplay(self, 'reinit_frequency', 'Amount of time steps after which the levelset function in re-initialized'))
++        s += '{}\n'.format(fielddisplay(self, 'kill_icebergs', 'remove floating icebergs to prevent rigid body motions (1: true, 0: false)'))
++        s += '{}\n'.format(fielddisplay(self, 'migration_max', 'maximum allowed migration rate (m/a)'))
++        s += '{}\n'.format(fielddisplay(self, 'fe', 'Finite Element type: \'P1\' (default), or \'P2\''))
+ 
+-        return string
++        return s
+     #}}}
+ 
+-    def extrude(self, md):  # {{{
+-        self.spclevelset = project3d(md, 'vector', self.spclevelset, 'type', 'node')
+-        return self
+-    #}}}
+-
+     def setdefaultparameters(self):  # {{{
+-        #stabilization = 1 by default
++        # Stabilization = 1 by default
+         self.stabilization = 1
+         self.reinit_frequency = 5
+         self.kill_icebergs = 1
+         self.migration_max = 1e12 # No need for general cases, unless specified
+ 
+-    #Linear elements by default
++        # Linear elements by default
+         self.fe = 'P1'
+ 
+         return self
+@@ -56,7 +50,7 @@
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        #Early return
++        # Early return
+         if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
+             return md
+ 
+@@ -69,6 +63,11 @@
+         return md
+     # }}}
+ 
++    def extrude(self, md):  # {{{
++        self.spclevelset = project3d(md, 'vector', self.spclevelset, 'type', 'node')
++        return self
++    #}}}
++
+     def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+ 
+@@ -76,6 +75,6 @@
+         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', 'migration_max', 'format', 'Double', 'scale', 1. / yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'migration_max', 'format', 'Double', 'scale', 1 / yts)
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'fe', 'format', 'String')
+     # }}}
+Index: ../trunk-jpl/src/m/classes/matdamageice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26358)
+@@ -5,8 +5,7 @@
+ 
+ 
+ class matdamageice(object):
+-    """
+-    MATICE class definition
++    """MATICE class definition
+ 
+        Usage:
+           matdamagice = matdamageice()
+@@ -13,52 +12,48 @@
+     """
+ 
+     def __init__(self):  # {{{
+-        self.rho_ice = 0.
+-        self.rho_water = 0.
+-        self.rho_freshwater = 0.
+-        self.mu_water = 0.
+-        self.heatcapacity = 0.
+-        self.latentheat = 0.
+-        self.thermalconductivity = 0.
+-        self.temperateiceconductivity = 0.
++        self.rho_ice = 0
++        self.rho_water = 0
++        self.rho_freshwater = 0
++        self.mu_water = 0
++        self.heatcapacity = 0
++        self.latentheat = 0
++        self.thermalconductivity = 0
++        self.temperateiceconductivity = 0
+         self.effectiveconductivity_averaging = 0
+-        self.meltingpoint = 0.
+-        self.beta = 0.
+-        self.mixed_layer_capacity = 0.
+-        self.thermal_exchange_velocity = 0.
+-        self.rheology_B = float('NaN')
+-        self.rheology_n = float('NaN')
++        self.meltingpoint = 0
++        self.beta = 0
++        self.mixed_layer_capacity = 0
++        self.thermal_exchange_velocity = 0
++        self.rheology_B = np.nan
++        self.rheology_n = np.nan
+         self.rheology_law = ''
+ 
+         #SLC
+-        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
++        self.earth_density = 0
+ 
+         self.setdefaultparameters()
+     #}}}
+ 
+     def __repr__(self):  # {{{
+-        # TODO:
+-        # - Convert all formatting to calls to <string>.format (see any 
+-        #   already converted <class>.__repr__ method for examples)
+-        #
+-        string = "   Materials:"
+-        string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg / m^3]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s / m^2]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J / kg / K]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W / m / K]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W / m / K]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J / m^3]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K / Pa]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W / kg / K]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m / s]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1 / n)]"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
+-        string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "Mantle density [kg / m^ - 3]"))
++        s = '   Materials:\n'
++        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [N s/m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
++        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
++        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/ kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\' or \'LliboutryDuval\''))
++        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg m^-3]'))
+         return string
+     #}}}
+ 
+@@ -69,38 +64,38 @@
+     #}}}
+ 
+     def setdefaultparameters(self):  # {{{
+-        #ice density (kg / m^3)
+-        self.rho_ice = 917.
+-        #ocean water density (kg / m^3)
+-        self.rho_water = 1023.
+-        #fresh water density (kg / m^3)
+-        self.rho_freshwater = 1000.
+-        #water viscosity (N.s / m^2)
++        # Ice density (kg/m^3)
++        self.rho_ice = 917.0
++        # Ocean water density (kg/m^3)
++        self.rho_water = 1023.0
++        # Fresh water density (kg/m^3)
++        self.rho_freshwater = 1000.0
++        # Water viscosity (N.s/m^2)
+         self.mu_water = 0.001787
+-        #ice heat capacity cp (J / kg / K)
+-        self.heatcapacity = 2093.
+-        #ice latent heat of fusion L (J / kg)
+-        self.latentheat = 3.34e5
+-        #ice thermal conductivity (W / m / K)
++        # Ice heat capacity cp (J/kg/K)
++        self.heatcapacity = 2093.0
++        # Ice latent heat of fusion L (J/kg)
++        self.latentheat = 3.34 * pow(10, 5)
++        # Ice thermal conductivity (W/m/K)
+         self.thermalconductivity = 2.4
+-        #temperate ice thermal conductivity (W / m / K)
++        # Temperate ice thermal conductivity (W/m/K)
+         self.temperateiceconductivity = 0.24
+-        #computation of effective conductivity
++        # Computation of effective conductivity
+         self.effectiveconductivity_averaging = 1
+-        #the melting point of ice at 1 atmosphere of pressure in K
++        # The melting point of ice at 1 atmosphere of pressure in K
+         self.meltingpoint = 273.15
+-        #rate of change of melting point with pressure (K / Pa)
+-        self.beta = 9.8e-8
+-        #mixed layer (ice-water interface) heat capacity (J / kg / K)
+-        self.mixed_layer_capacity = 3974.
+-        #thermal exchange velocity (ice-water interface) (m / s)
++        # Rate of change of melting point with pressure (K/Pa)
++        self.beta = 9.8 * pow(10, -8)
++        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
++        self.mixed_layer_capacity = 3974.0
++        # Thermal exchange velocity (ice-water interface) (m/s)
+         self.thermal_exchange_velocity = 1.00e-4
+-        #Rheology law: what is the temperature dependence of B with T
+-        #available: none, paterson and arrhenius
++        # Rheology law: what is the temperature dependence of B with T 
++        # available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+ 
+-        #SLC
+-        self.earth_density = 5512  #average density of the Earth, (kg / m^3)
++        # SLC
++        self.earth_density = 5512  # average density of the Earth (kg/m^3)
+         return self
+     #}}}
+ 
+Index: ../trunk-jpl/src/m/classes/matice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/matice.py	(revision 26358)
+@@ -13,87 +13,87 @@
+             matice = matice()
+     """
+ 
+-    def __init__(self): #{{{
+-        self.rho_ice = 0.
+-        self.rho_water = 0.
+-        self.rho_freshwater = 0.
+-        self.mu_water = 0.
+-        self.heatcapacity = 0.
+-        self.latentheat = 0.
+-        self.thermalconductivity = 0.
+-        self.temperateiceconductivity = 0.
++    def __init__(self):  # {{{
++        self.rho_ice = 0
++        self.rho_water = 0
++        self.rho_freshwater = 0
++        self.mu_water = 0
++        self.heatcapacity = 0
++        self.latentheat = 0
++        self.thermalconductivity = 0
++        self.temperateiceconductivity = 0
+         self.effectiveconductivity_averaging = 0
+-        self.meltingpoint = 0.
+-        self.beta = 0.
+-        self.mixed_layer_capacity = 0.
+-        self.thermal_exchange_velocity = 0.
++        self.meltingpoint = 0
++        self.beta = 0
++        self.mixed_layer_capacity = 0
++        self.thermal_exchange_velocity = 0
+         self.rheology_B = np.nan
+         self.rheology_n = np.nan
+         self.rheology_law = ''
+ 
+-        #slc
++        # SLC
+         self.earth_density = 0
++
+         self.setdefaultparameters()
+-    #}}}
++    # }}}
+ 
+-    def __repr__(self): #{{{
+-        s = "   Materials:"
+-        s = "%s\n%s" % (s, fielddisplay(self, "rho_ice", "ice density [kg/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rho_water", "water density [kg/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rho_freshwater", "fresh water density [kg/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mu_water", "water viscosity [Ns/m^2]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "heatcapacity", "heat capacity [J/kg/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W/m/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W/m/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "latentheat", "latent heat of fusion [J/m^3]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "beta", "rate of change of melting point with pressure [K/Pa]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W/kg/K]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m/s]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'"))
+-        s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]"))
+-
++    def __repr__(self):  # {{{
++        s = '   Materials:\n'
++        s += '{}\n'.format(fielddisplay(self, 'rho_ice', 'ice density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_water', 'water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'rho_freshwater', 'fresh water density [kg/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'mu_water', 'water viscosity [Ns/m^2]'))
++        s += '{}\n'.format(fielddisplay(self, 'heatcapacity', 'heat capacity [J/kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermalconductivity', 'ice thermal conductivity [W/m/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W/m/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'effectiveconductivity_averaging', 'computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)'))
++        s += '{}\n'.format(fielddisplay(self, 'meltingpoint', 'melting point of ice at 1atm in K'))
++        s += '{}\n'.format(fielddisplay(self, 'latentheat', 'latent heat of fusion [J/m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta', 'rate of change of melting point with pressure [K/Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'mixed_layer_capacity', 'mixed layer capacity [W/kg/K]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermal_exchange_velocity', 'thermal exchange velocity [m/s]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_B', 'flow law parameter [Pa s^(1/n)]'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_n', 'Glen\'s flow law exponent'))
++        s += '{}\n'.format(fielddisplay(self, 'rheology_law', 'law for the temperature dependance of the rheology: \'None\', \'BuddJacka\', \'Cuffey\', \'CuffeyTemperate\', \'Paterson\', \'Arrhenius\', \'LliboutryDuval\', \'NyeCO2\', or \'NyeH2O\''))
++        s += '{}\n'.format(fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]'))
+         return s
+-    #}}}
++    # }}}
+ 
+-    def extrude(self, md): #{{{
++    def extrude(self, md):  # {{{
+         self.rheology_B = project3d(md, 'vector', self.rheology_B, 'type', 'node')
+         self.rheology_n = project3d(md, 'vector', self.rheology_n, 'type', 'element')
+         return self
+-    #}}}
++    # }}}
+ 
+-    def setdefaultparameters(self): #{{{
+-        #ice density (kg/m^3)
+-        self.rho_ice = 917.
+-        #ocean water density (kg/m^3)
+-        self.rho_water = 1023.
+-        #fresh water density (kg/m^3)
+-        self.rho_freshwater = 1000.
+-        #water viscosity (N.s/m^2)
++    def setdefaultparameters(self):  # {{{
++        # Ice density (kg/m^3)
++        self.rho_ice = 917.0
++        # Ocean water density (kg/m^3)
++        self.rho_water = 1023.0
++        # Fresh water density (kg/m^3)
++        self.rho_freshwater = 1000.0
++        # Water viscosity (N.s/m^2)
+         self.mu_water = 0.001787
+-        #ice heat capacity cp (J/kg/K)
+-        self.heatcapacity = 2093.
+-        #ice latent heat of fusion L (J/kg)
+-        self.latentheat = 3.34e5
+-        #ice thermal conductivity (W/m/K)
++        # Ice heat capacity cp (J/kg/K)
++        self.heatcapacity = 2093.0
++        # Ice latent heat of fusion L (J/kg)
++        self.latentheat = 3.34 * pow(10, 5)
++        # Ice thermal conductivity (W/m/K)
+         self.thermalconductivity = 2.4
+-        #temperate ice thermal conductivity (W/m/K)
++        # Temperate ice thermal conductivity (W/m/K)
+         self.temperateiceconductivity = 0.24
+-        #computation of effective conductivity
++        # Computation of effective conductivity
+         self.effectiveconductivity_averaging = 1
+-        #the melting point of ice at 1 atmosphere of pressure in K
++        # The melting point of ice at 1 atmosphere of pressure in K
+         self.meltingpoint = 273.15
+-        #rate of change of melting point with pressure (K/Pa)
+-        self.beta = 9.8e-8
+-        #mixed layer (ice-water interface) heat capacity (J/kg/K)
+-        self.mixed_layer_capacity = 3974.
+-        #thermal exchange velocity (ice-water interface) (m/s)
+-        self.thermal_exchange_velocity = 1.00e-4
+-        #Rheology law: what is the temperature dependence of B with T
+-        #available: none, paterson and arrhenius
++        # Rate of change of melting point with pressure (K/Pa)
++        self.beta = 9.8 * pow(10, -8)
++        # Mixed layer (ice-water interface) heat capacity (J/kg/K)
++        self.mixed_layer_capacity = 3974.0
++        # Thermal exchange velocity (ice-water interface) (m/s)
++        self.thermal_exchange_velocity = 1.00 * pow(10, -4)
++        # Rheology law: what is the temperature dependence of B with T
++        # available: none, paterson and arrhenius
+         self.rheology_law = 'Paterson'
+ 
+         # Rheology for ice
+@@ -102,9 +102,9 @@
+ 
+         # SLR
+         self.earth_density = 5512  # average density of the Earth, (kg/m^3)
+-    #}}}
++    # }}}
+ 
+-    def checkconsistency(self, md, solution, analyses): #{{{
++    def checkconsistency(self, md, solution, analyses):  # {{{
+         if solution == 'TransientSolution' and md.transient.isslc:
+             md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
+         else:
+@@ -115,12 +115,12 @@
+             md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'universal', 1, 'NaN', 1, 'Inf', 1)
+             md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'universal',1, 'NaN', 1, 'Inf', 1)
+             md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O'])
+-            md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
++            md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
+ 
+         return md
+-    #}}}
++    # }}}
+ 
+-    def marshall(self, prefix, md, fid): #{{{
++    def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 3, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+@@ -135,8 +135,15 @@
+         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)
++        # NOTE: We first have to check if we have a NumPy array here
++        if ((len(np.shape(self.rheology_B)) == 1 and (np.shape(self.rheology_B)[0] == md.mesh.numberofvertices or np.shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1)) or (len(np.shape(self.rheology_B)) == 2 and np.shape(self.rheology_B)[0] == md.mesh.numberofelements and np.shape(self.rheology_B)[1] > 1)):
++            mattype = 1
++            tsl = md.mesh.numberofvertices
++        else:
++            mattype = 2
++            tsl = md.mesh.numberofelements
++        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', mattype, 'timeserieslength', tsl + 1, 'yts', md.constants.yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
+         WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
+         WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
+-    #}}}
++    # }}}
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26357)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26358)
+@@ -234,7 +234,7 @@
+ 			disp(sprintf('%19s: %-22s -- %s','masstransport'   ,['[1x1 ' class(self.masstransport) ']'],'parameters for masstransport solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','thermal'         ,['[1x1 ' class(self.thermal) ']'],'parameters for thermal solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','steadystate'     ,['[1x1 ' class(self.steadystate) ']'],'parameters for steadystate solution'));
+-			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parHwoameters for transient solution'));
++			disp(sprintf('%19s: %-22s -- %s','transient'       ,['[1x1 ' class(self.transient) ']'],'parameters for transient solution'));
+ 			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
+ 			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
+ 			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
+Index: ../trunk-jpl/src/m/classes/stressbalance.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.py	(revision 26357)
++++ ../trunk-jpl/src/m/classes/stressbalance.py	(revision 26358)
+@@ -17,29 +17,30 @@
+     """
+ 
+     def __init__(self):  # {{{
+-        self.spcvx = float('NaN')
+-        self.spcvy = float('NaN')
+-        self.spcvz = float('NaN')
++        self.spcvx = np.nan
++        self.spcvy = np.nan
++        self.spcvz = np.nan
+         self.restol = 0
+         self.reltol = 0
+         self.abstol = 0
+         self.isnewton = 0
+         self.FSreconditioning = 0
+-        self.icefront = float('NaN')
++        self.icefront = np.nan
+         self.maxiter = 0
+         self.shelf_dampening = 0
+-        self.vertex_pairing = float('NaN')
+-        self.penalty_factor = float('NaN')
+-        self.rift_penalty_lock = float('NaN')
++        self.vertex_pairing = np.nan
++        self.penalty_factor = np.nan
++        self.rift_penalty_lock = np.nan
+         self.rift_penalty_threshold = 0
+-        self.referential = float('NaN')
+-        self.loadingforce = float('NaN')
++        self.referential = np.nan
++        self.loadingforce = np.nan
+         self.requested_outputs = []
+ 
+-    #set defaults
++        # Set defaults
+         self.setdefaultparameters()
+ 
+-    #}}}
++    # }}}
++
+     def __repr__(self):  # {{{
+         s = '   StressBalance solution parameters:\n'
+         s += '      Convergence criteria:\n'
+@@ -46,27 +47,27 @@
+         s += '{}\n'.format(fielddisplay(self, 'restol', 'mechanical equilibrium residual convergence criterion'))
+         s += '{}\n'.format(fielddisplay(self, 'reltol', 'velocity relative convergence criterion, NaN: not applied'))
+         s += '{}\n'.format(fielddisplay(self, 'abstol', 'velocity absolute convergence criterion, NaN: not applied'))
+-        s += '{}\n'.format(fielddisplay(self, 'isnewton', "0: Picard's fixed point, 1: Newton's method, 2: hybrid"))
++        s += '{}\n'.format(fielddisplay(self, 'isnewton', '0: Picard\'s fixed point, 1: Newton\'s method, 2: hybrid'))
+         s += '{}\n'.format(fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
+         s += '      boundary conditions:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'spcvx', 'x - axis velocity constraint (NaN means no constraint) [m / yr]'))
+-        s += '{}\n'.format(fielddisplay(self, 'spcvy', 'y - axis velocity constraint (NaN means no constraint) [m / yr]'))
+-        s += '{}\n'.format(fielddisplay(self, 'spcvz', 'z - axis velocity constraint (NaN means no constraint) [m / yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'spcvx', 'x-axis velocity constraint (NaN means no constraint) [m / yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'spcvy', 'y-axis velocity constraint (NaN means no constraint) [m / yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'spcvz', 'z-axis velocity constraint (NaN means no constraint) [m / yr]'))
+         s += '{}\n'.format(fielddisplay(self, 'icefront', 'segments on ice front list (last column 0: Air, 1: Water, 2: Ice'))
+-        s = "%s\n%s" % (s, '\n      Rift options:')
++        s += '      Rift options:\n'
+         s += '{}\n'.format(fielddisplay(self, 'rift_penalty_threshold', 'threshold for instability of mechanical constraints'))
+         s += '{}\n'.format(fielddisplay(self, 'rift_penalty_lock', 'number of iterations before rift penalties are locked'))
+         s += '      Penalty options:\n'
+-        s += '{}\n'.format(fielddisplay(self, 'penalty_factor', 'offset used by penalties: penalty = Kmax * 1.0**offset'))
++        s += '{}\n'.format(fielddisplay(self, 'penalty_factor', 'offset used by penalties: penalty = Kmax * 10^offset'))
+         s += '{}\n'.format(fielddisplay(self, 'vertex_pairing', 'pairs of vertices that are penalized'))
+         s += '      Other:\n'
+         s += '{}\n'.format(fielddisplay(self, 'shelf_dampening', 'use dampening for floating ice ? Only for FS model'))
+         s += '{}\n'.format(fielddisplay(self, 'FSreconditioning', 'multiplier for incompressibility equation. Only for FS model'))
+         s += '{}\n'.format(fielddisplay(self, 'referential', 'local referential'))
+-        s += '{}\n'.format(fielddisplay(self, 'loadingforce', 'loading force applied on each point [N / m^3]'))
++        s += '{}\n'.format(fielddisplay(self, 'loadingforce', 'loading force applied on each point [N/m^3]'))
+         s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+         return s
+-    #}}}
++    # }}}
+ 
+     def extrude(self, md):  # {{{
+         self.spcvx = project3d(md, 'vector', self.spcvx, 'type', 'node')
+@@ -76,29 +77,35 @@
+         self.loadingforce = project3d(md, 'vector', self.loadingforce, 'type', 'node')
+ 
+         return self
+-    #}}}
++    # }}}
+ 
+     def setdefaultparameters(self):  # {{{
+-        #maximum of non - linear iterations.
++        # Maximum of non-linear iterations
+         self.maxiter = 100
+-        #Convergence criterion: absolute, relative and residual
+-        self.restol = 1.0e-4
++
++        # Convergence criterion: absolute, relative and residual
++        self.restol = pow(10, -4)
+         self.reltol = 0.01
+         self.abstol = 10
+-        self.FSreconditioning = 10**13
++
++        self.FSreconditioning = pow(10, 13)
+         self.shelf_dampening = 0
+-        #Penalty factor applied kappa = max(stiffness matrix) * 1.0**penalty_factor
++
++        # Penalty factor applied kappa = max(stiffness matrix) * 1.0^penalty_factor
+         self.penalty_factor = 3
+-        #Stop the iterations of rift if below a threshold
++
++        # Stop the iterations of rift if below a threshold
+         self.rift_penalty_threshold = 0
+-        #in some solutions, it might be needed to stop a run when only
+-        #a few constraints remain unstable. For thermal computation, this
+-        #parameter is often used.
++
++        # In some solutions, it might be needed to stop a run when only a few 
++        # constraints remain unstable. For thermal computation, this parameter 
++        # is often used.
+         self.rift_penalty_lock = 10
+-        #output default:
++
++        # Output default
+         self.requested_outputs = ['default']
+         return self
+-    #}}}
++    # }}}
+ 
+     def defaultoutputs(self, md):  # {{{
+         if md.mesh.dimension() == 3:
+@@ -106,7 +113,7 @@
+         else:
+             list = ['Vx', 'Vy', 'Vel', 'Pressure']
+         return list
+-    #}}}
++    # }}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         # Early return
+@@ -130,15 +137,15 @@
+         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
++        # Singular solution
+         #        if ~any((~isnan(md.stressbalance.spcvx) + ~isnan(md.stressbalance.spcvy)) == 2),
+         if not np.any(np.logical_and(np.logical_not(np.isnan(md.stressbalance.spcvx)), np.logical_not(np.isnan(md.stressbalance.spcvy)))):
+             print("\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n")
+-        #CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
++        # CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
+         #        if any(sum(isnan(md.stressbalance.referential), 2)~=0 & sum(isnan(md.stressbalance.referential), 2)~=6),
+         if np.any(np.logical_and(np.sum(np.isnan(md.stressbalance.referential), axis=1) != 0, np.sum(np.isnan(md.stressbalance.referential), axis=1) != 6)):
+             md.checkmessage("Each line of stressbalance.referential should contain either only NaN values or no NaN values")
+-        #CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
++        # CHECK THAT THE TWO VECTORS PROVIDED ARE ORTHOGONAL
+         #        if any(sum(isnan(md.stressbalance.referential), 2) == 0),
+         if np.any(np.sum(np.isnan(md.stressbalance.referential), axis=1) == 0):
+             pos = [i for i, item in enumerate(np.sum(np.isnan(md.stressbalance.referential), axis=1)) if item == 0]
+@@ -148,7 +155,7 @@
+             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
++        # CHECK THAT NO rotation specified for FS Grounded ice at base
+         if m.strcmp(md.mesh.domaintype(), '3D') and md.flowequation.isFS:
+             pos = np.nonzero(np.logical_and(md.mask.ocean_levelset, md.mesh.vertexonbase))
+             if np.any(np.logical_not(np.isnan(md.stressbalance.referential[pos, :]))):
+Index: ../trunk-jpl/src/m/coordsystems/ll2xy.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26357)
++++ ../trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26358)
+@@ -2,20 +2,19 @@
+ 
+ 
+ def ll2xy(lat, lon, sgn=-1, central_meridian=0, standard_parallel=71):
+-    '''
+-    LL2XY - converts lat lon to polar stereographic
++    """LL2XY - converts lat lon to polar stereographic
+ 
+-   Converts from geodetic latitude and longitude to Polar
+-   Stereographic (X, Y) coordinates for the polar regions.
+-   Author: Michael P. Schodlok, December 2003 (map2ll)
++    Converts from geodetic latitude and longitude to Polar
++    Stereographic (X, Y) coordinates for the polar regions.
++    Author: Michael P. Schodlok, December 2003 (map2ll)
+ 
+-   Usage:
+-      x, y = ll2xy(lat, lon, sgn)
+-      x, y = ll2xy(lat, lon, sgn, central_meridian, standard_parallel)
++    Usage:
++        x, y = ll2xy(lat, lon, sgn)
++        x, y = ll2xy(lat, lon, sgn, central_meridian, standard_parallel)
+ 
+- - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
+- 						   -1 : south latitude (default is mer = 0  lat = 71)
+-    '''
++    - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
++    						   -1 : south latitude (default is mer = 0  lat = 71)
++    """
+ 
+     assert sgn == 1 or sgn == -1, 'error: sgn should be either 1 or -1'
+ 
+@@ -32,9 +31,9 @@
+     # Conversion constant from degrees to radians
+     #cde = 57.29577951
+     # Radius of the earth in meters
+-    re = 6378.273 * 10**3
++    re = 6378.273 * pow(10, 3)
+     # Eccentricity of the Hughes ellipsoid squared
+-    ex2 = .006693883
++    ex2 = 0.006693883
+     # Eccentricity of the Hughes ellipsoid
+     ex = np.sqrt(ex2)
+ 
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26357)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26358)
+@@ -196,7 +196,6 @@
+ 	mesh.y=radius*cosd(mesh.lat).*sind(mesh.long);
+ 	mesh.z=radius*sind(mesh.lat);
+ 
+-
+ 	%erase files:
+ 	system('rm -rf sphere.geo sphere.msh sphere.pos');
+ 
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26357)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26358)
+@@ -81,25 +81,25 @@
+     elif gmshmajorversion == 4:
+         curvename = 'Curve Loop'
+ 
+-    fid.write('%s(13) = {2, 8, -10};\n' % curvename)
++    fid.write('%s(13) = {2,8,-10};\n' % curvename)
+     fid.write('Surface(14) = {13};\n')
+-    fid.write('%s(15) = {10, 3, 7};\n' % curvename)
++    fid.write('%s(15) = {10,3,7};\n' % curvename)
+     fid.write('Surface(16) = {15};\n')
+-    fid.write('%s(17) = {-8, -9, 1};\n' % curvename)
++    fid.write('%s(17) = {-8,-9,1};\n' % curvename)
+     fid.write('Surface(18) = {17};\n')
+-    fid.write('%s(19) = {-11, -2, 5};\n' % curvename)
++    fid.write('%s(19) = {-11,-2,5};\n' % curvename)
+     fid.write('Surface(20) = {19};\n')
+-    fid.write('%s(21) = {-5, -12, -1};\n' % curvename)
++    fid.write('%s(21) = {-5,-12,-1};\n' % curvename)
+     fid.write('Surface(22) = {21};\n')
+-    fid.write('%s(23) = {-3, 11, 6};\n' % curvename)
++    fid.write('%s(23) = {-3,11,6};\n' % curvename)
+     fid.write('Surface(24) = {23};\n')
+-    fid.write('%s(25) = {-7, 4, 9};\n' % curvename)
++    fid.write('%s(25) = {-7,4,9};\n' % curvename)
+     fid.write('Surface(26) = {25};\n')
+-    fid.write('%s(27) = {-4, 12, -6};\n' % curvename)
++    fid.write('%s(27) = {-4,12,-6};\n' % curvename)
+     fid.write('Surface(28) = {27};\n')
+-    fid.write('Surface Loop(29) = {28, 26, 16, 14, 20, 24, 22, 18};\n')
++    fid.write('Surface Loop(29) = {28,26,16,14,20,24,22,18};\n')
+     fid.write('Volume(30) = {29};\n')
+-    fid.write('Physical Surface(1) = {28, 26, 16, 14, 20, 24, 22, 18};\n')
++    fid.write('Physical Surface(1) = {28,26,16,14,20,24,22,18};\n')
+     fid.write('Physical Volume(2) = 30;\n')
+     fid.close()
+     #}}}
+@@ -111,14 +111,14 @@
+         # Create .pos file with existing mesh and refining metric:  {{{
+         fid = open('sphere.pos', 'w')
+ 
+-        fid.write('View "background mesh" [;\n')
++        fid.write('View "background mesh" {;\n')
+         for i in range(meshini.numberofelements):
+-            fid.write('ST(%g, %g, %g, %g, %g, %g, %g, %g, %g)[%g, %g, %g];\n',
+-                      meshini.x(meshini.elements(i, 0)), meshini.y(meshini.elements(i, 0)), meshini.z(meshini.elements(i, 0)),
+-                      meshini.x(meshini.elements(i, 1)), meshini.y(meshini.elements(i, 1)), meshini.z(meshini.elements(i, 1)),
+-                      meshini.x(meshini.elements(i, 2)), meshini.y(meshini.elements(i, 2)), meshini.z(meshini.elements(i, 2)),
+-                      metric(meshini.elements(i, 0)), metric(meshini.elements(i, 1)), metric(meshini.elements(i, 2)))
+-        fid.write('];\n')
++            fid.write('ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g};\n',
++                meshini.x(meshini.elements(i, 0)), 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()
+         #}}}
+ 
+@@ -181,11 +181,24 @@
+     fid.close()
+     #}}}
+ 
+-    #figure out other fields in mesh3dsurface:
+-    mesh.r = np.sqrt(mesh.x**2 + mesh.y**2 + mesh.z**2)
+-    mesh.lat = np.arcsin(mesh.z / mesh.r) / np.pi * 180
+-    mesh.long = np.arctan2(mesh.y, mesh.x) / np.pi * 180
++    # A little technicality here. The mesh is not exactly on the sphere. We 
++    # create lat,long coordiantes, and reproject onto an exact sphere.
++    mesh.r = np.sqrt(mesh.x ** 2 + mesh.y ** 2 + mesh.z ** 2)
+ 
++    # Make sure we don't have south and north pole
++    pos = np.where(np.logical_and.reduce((mesh.x == 0, mesh.y == 0)))[0]
++    mesh.lat = asind(mesh.z / mesh.r)
++    mesh.long = atan2d(mesh.y, mesh.x)
++    pos = np.where(mesh.lat == 90)[0]
++    mesh.lat[pos] = 90 - 0.01
++    pos = np.where(mesh.lat == -90)[0]
++    mesh.lat[pos] = -90 + 0.01
++
++    mesh.r = radius * np.ones((mesh.numberofvertices, ))
++    mesh.x = radius * cosd(mesh.lat) * cosd(mesh.long)
++    mesh.y = radius * cosd(mesh.lat) * sind(mesh.long)
++    mesh.z = radius * sind(mesh.lat)
++
+     # Erase files
+     subprocess.call('rm -rf sphere.geo sphere.msh sphere.pos', shell=True)
+ 
+Index: ../trunk-jpl/src/m/solve/marshall.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/marshall.m	(revision 26357)
++++ ../trunk-jpl/src/m/solve/marshall.m	(revision 26358)
+@@ -43,10 +43,10 @@
+ %close file
+ st=fclose(fid);
+ 
+-% Uncomment the following to make a copy of the binary input file for debugging 
+-% purposes (can be fed into scripts/BinRead.py).
+-% copyfile([md.miscellaneous.name '.bin'], [md.miscellaneous.name '.m.bin'])
+-
+ if st==-1,
+ 	error(['marshall error message: could not close file ' [md.miscellaneous.name '.bin']]);
+ end
++
++% Uncomment the following to make a copy of the binary input file for debugging 
++% purposes (can be fed into scripts/BinRead.py).
++copyfile([md.miscellaneous.name '.bin'], [md.miscellaneous.name '.m.bin'])
+Index: ../trunk-jpl/src/m/solve/marshall.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/marshall.py	(revision 26357)
++++ ../trunk-jpl/src/m/solve/marshall.py	(revision 26358)
+@@ -16,7 +16,7 @@
+     if md.verbose.solution:
+         print("marshalling file {}.bin".format(md.miscellaneous.name))
+ 
+-    #open file for binary writing
++    # Open file for binary writing
+     try:
+         fid = open(md.miscellaneous.name + '.bin', 'wb')
+     except IOError as e:
+@@ -25,17 +25,17 @@
+     fields = md.properties()
+     fields.sort() # sort fields so that comparison of binary files is easier
+     for field in fields:
+-        #Some properties do not need to be marshalled
++        # Some properties do not need to be marshalled
+         if field in ['results', 'radaroverlay', 'toolkits', 'cluster', 'private']:
+             continue
+ 
+-        #Check that current field is an object
++        # Check that current field is an object
+         if not hasattr(getattr(md, field), 'marshall'):
+             raise TypeError("field '{}' is not an object.".format(field))
+ 
+-        #Marshall current object
+-        #print "marshalling %s ..." % field #Uncomment for debugging
+-        exec("md.{}.marshall('md.{}', md, fid)".format(field, field))
++        # Marshall current object
++        #print('marshalling {} ...'.format(field) # Uncomment for debugging
++        exec('md.{}.marshall(\'md.{}\', md, fid)'.format(field, field))
+ 
+     #Last, write "md.EOF" to make sure that the binary file is not corrupt
+     WriteData(fid, 'XXX', 'name', 'md.EOF', 'data', True, 'format', 'Boolean')
+@@ -44,10 +44,10 @@
+     try:
+         fid.close()
+ 
+-        # Uncomment the following to make a copy of the binary input file for 
+-        # debugging purposes (can be fed into scripts/BinRead.py).
+-        # copy_cmd = "cp {}.bin {}.py.bin".format(md.miscellaneous.name, md.miscellaneous.name)
+-        # subprocess.call(copy_cmd, shell=True)
++    except IOError as e:
++        print('marshall error message: could not close file \'{}.bin\' due to:'.format(md.miscellaneous.name), e)
+ 
+-    except IOError as e:
+-        print("marshall error message: could not close file '{}.bin' due to:".format(md.miscellaneous.name), e)
++    # Uncomment the following to make a copy of the binary input file for 
++    # debugging purposes (can be fed into scripts/BinRead.py).
++    copy_cmd = 'cp {}.bin {}.py.bin'.format(md.miscellaneous.name, md.miscellaneous.name)
++    subprocess.call(copy_cmd, shell=True)
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26357)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26358)
+@@ -79,7 +79,7 @@
+     try:
+         fid = open(filename, 'rb')
+     except IOError as e:
+-        raise IOError("parseresultsfromdisk error message: could not open {} for binary reading".format(filename))
++        raise IOError('parseresultsfromdisk error message: could not open {} for binary reading'.format(filename))
+ 
+     # Collect all results in a list
+     allresults = []
+@@ -126,11 +126,11 @@
+         field = ReadData(fid, md)
+     """
+ 
+-    #read field
++    # Read field
+     try:
+         length = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+         fieldname = struct.unpack('{}s'.format(length), fid.read(length))[0][:-1]
+-        fieldname = fieldname.decode()  #strings are binaries when stored so need to be converted back
++        fieldname = fieldname.decode() # strings are binaries when stored so need to be converted back
+         time = struct.unpack('d', fid.read(struct.calcsize('d')))[0]
+         step = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+         datatype = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+@@ -144,7 +144,7 @@
+ 
+         elif datatype == 3:
+             N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+-    #field = transpose(fread(fid, [N M], 'double'))
++            #field = transpose(fread(fid, [N M], 'double'))
+             field = np.zeros(shape=(M, N), dtype=float)
+             for i in range(M):
+                 field[i, :] = struct.unpack('{}d'.format(N), fid.read(N * struct.calcsize('d')))
+@@ -151,15 +151,15 @@
+ 
+         elif datatype == 4:
+             N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+-    # field = transpose(fread(fid, [N M], 'int'))
++            #field = transpose(fread(fid, [N M], 'int'))
+             field = np.zeros(shape=(M, N), dtype=int)
+             for i in range(M):
+                 field[i, :] = struct.unpack('{}i'.format(N), fid.read(N * struct.calcsize('i')))
+ 
+         else:
+-            raise TypeError("cannot read data of datatype {}".format(datatype))
++            raise TypeError('cannot read data of datatype {}'.format(datatype))
+ 
+-        #Process units here FIXME: this should not be done here!
++        # Process units here FIXME: this should not be done here!
+         yts = md.constants.yts
+         if fieldname == 'BalancethicknessThickeningRate':
+             field = field * yts
+@@ -192,23 +192,23 @@
+         elif fieldname == 'BasalforcingsFloatingiceMeltingRate':
+             field = field * yts
+         elif fieldname == 'TotalFloatingBmb':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'TotalFloatingBmbScaled':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'TotalGroundedBmb':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'TotalGroundedBmbScaled':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'TotalSmb':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'TotalSmbScaled':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'GroundinglineMassFlux':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'IcefrontMassFlux':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'IcefrontMassFluxLevelset':
+-            field = field / 10.**12 * yts  #(GigaTon/year)
++            field = field / pow(10.0, 12) * yts # (GigaTon/year)
+         elif fieldname == 'SmbMassBalance':
+             field = field * yts
+         elif fieldname == 'SmbPrecipitation':
Index: /issm/oecreview/Archive/25834-26739/ISSM-26358-26359.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26358-26359.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26358-26359.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/src/m/classes/SMBgemb.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26358)
++++ ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26359)
+@@ -21,15 +21,15 @@
+         """
+ 
+         #solution choices
+-        self.isgraingrowth
+-        self.isalbedo
+-        self.isshortwave
+-        self.isthermal
+-        self.isaccumulation
+-        self.ismelt
+-        self.isdensification
+-        self.isturbulentflux
+-        self.isconstrainsurfaceT
++        self.isgraingrowth = 0
++        self.isalbedo = 0
++        self.isshortwave = 0
++        self.isthermal = 0
++        self.isaccumulation = 0
++        self.ismelt = 0
++        self.isdensification = 0
++        self.isturbulentflux = 0
++        self.isconstrainsurfaceT = 0
+         self.isclimatology = np.nan
+ 
+         # Inputs
+Index: ../trunk-jpl/src/m/classes/dsl.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/dsl.py	(revision 26358)
++++ ../trunk-jpl/src/m/classes/dsl.py	(revision 26359)
+@@ -67,8 +67,6 @@
+     #}}}
+ 
+     def initialize(self, md):  #{{{
+-        print('sdasa')
+-        exit()
+         if np.isnan(self.global_average_thermosteric_sea_level):
+             self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
+             print('      no dsl.global_average_thermosteric_sea_level specified: transient values set at zero')
+Index: ../trunk-jpl/src/m/classes/matdamageice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26358)
++++ ../trunk-jpl/src/m/classes/matdamageice.py	(revision 26359)
+@@ -1,3 +1,5 @@
++import numpy as np
++
+ from fielddisplay import fielddisplay
+ from project3d import project3d
+ from checkfield import checkfield
Index: /issm/oecreview/Archive/25834-26739/ISSM-26359-26360.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26359-26360.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26359-26360.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26359)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 26360)
+@@ -13,7 +13,7 @@
+         SMBmeltcomponents = SMBmeltcomponents();
+     """
+ 
+-    def __init__(self):  # {{{
++    def __init__(self, *args):  # {{{
+         self.accumulation = np.nan
+         self.evaporation = np.nan
+         self.melt = np.nan
Index: /issm/oecreview/Archive/25834-26739/ISSM-26360-26361.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26360-26361.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26360-26361.diff	(revision 26740)
@@ -0,0 +1,133 @@
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26360)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh	(revision 26361)
+@@ -29,7 +29,7 @@
+ #
+ LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+ LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+-MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2004,2006,2007,2011,2051,2052,2053,2084,2085,2424,2425,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
++MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2002,2003,2004,2006,2007,2008,2010,2011,2021,2051,2052,2053,2084,2085,2090,2101,2424,2425,3001:3200,3201,3202,3300,3480,3481,4001,4002,4003]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ MATLAB_PATH="/usr/local/MATLAB/R2019b"
+ 
+ ## Environment
+Index: ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh
+===================================================================
+--- ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26360)
++++ ../trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh	(revision 26361)
+@@ -29,7 +29,7 @@
+ #
+ LIBGFORTRAN="/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0" # Important that this is the library itself
+ LIBGFORTRAN_DIST="${ISSM_DIR}/lib/libgfortran.so.5" # Important the file name matches the SONAME entry in the binaries and other shared libraries which link to it
+-PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2004 2006 2007 2051 2052 2053 2084 2085 2424 2425 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
++PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2002 2003 2004 2005 2006 2007 2008 2010 2011 2021 2051 2052 2053 2084 2085 2090 2101 2424 2425 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
+ 
+ ## Environment
+ #
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26360)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 26361)
+@@ -38,12 +38,20 @@
+ 	%create .geo file:  {{{
+ 	fid=fopen('sphere.geo','w');
+ 
++	% NOTE:
++	% - The default format in Gmsh 3 is "msh2". Rather than conditionally 
++	% modifying our parsing scheme for Gmsh 4, for now, we simply set the 
++	% 'Mesh.MshFileVersion' option.
++	% - Decreasing the value of the 'Mesh.RandomFactor' option leads to an 
++	% equal number of nodes and elements being produced under macOS and Linux 
++	% at certain resolutions using certain meshing algorithms.
++	%
+ 	fprintf(fid,'Mesh.Algorithm = 1;\n'); % MeshAdapt
++	fprintf(fid,'Mesh.MshFileVersion = 2;\n');
+ 	fprintf(fid,'Mesh.RandomFactor = 1e-10;\n');
+ 	if  exist(options,'refine'),
+ 		fprintf(fid,'Mesh.Algorithm = 7;\n'); % BAMG
+ 		fprintf(fid,'Mesh.CharacteristicLengthFromPoints = 0;\n');
+-		fprintf(fid,'Mesh.SmoothRatio = 3;\n');
+ 		if gmshmajorversion == 3,
+ 			fprintf(fid,'Mesh.RemeshAlgorithm = 1;\n');
+ 		end
+@@ -122,15 +130,10 @@
+ 	end
+ 
+ 	% Call gmsh
+-	%
+-	% NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
+-	%		modifying our parsing scheme for Gmsh 4, for now, we simply set the 
+-	%		"-format" option.
+-	%
+ 	if  exist(options,'refine'),
+-		system(['gmsh -tol 1e-8 -2 -format msh2 sphere.geo -bgm sphere.pos']);
++		system(['gmsh -2 sphere.geo -bgm sphere.pos']);
+ 	else
+-		system(['gmsh -tol 1e-8 -2 -format msh2 sphere.geo']);
++		system(['gmsh -2 sphere.geo']);
+ 	end
+ 
+ 	%import mesh:  {{{
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26360)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26361)
+@@ -86,6 +86,9 @@
+ #
+ # NOTE:
+ # - Excluding 2006 until it can be debugged (PETSc crash)
++# - Tests 2002, 2003, 2005, 2008, 2010, 2011, 2021, 2090, and 2101, are 
++#   excluded as Gmsh produces different meshes on macOS and Linux for (archives 
++#   are generated on macOS).
+ #
+-MATLAB_NROPTIONS="'benchmark','slc','exclude',[2004 2006 2007 2051 2052 2053 2084 2085 2424 2425]"
+-PYTHON_NROPTIONS="--benchmark slc --exclude 2004 2006 2007 2051 2052 2053 2084 2085 2424 2425"
++MATLAB_NROPTIONS="'benchmark','slc','exclude',[2002 2003 2004 2005 2006 2007 2008 2010 2011 2021 2051 2052 2053 2084 2085 2090 2101 2424 2425]"
++PYTHON_NROPTIONS="--benchmark slc --exclude 2002 2003 2004 2005 2006 2007 2008 2010 2011 2021 2051 2052 2053 2084 2085 2090 2101 2424 2425"
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26360)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26361)
+@@ -46,12 +46,22 @@
+     # Create .geo file:  {{{
+     fid = open('sphere.geo', 'w')
+ 
++    # Call gmsh
++    #
++    # NOTE:
++    # - The default format in Gmsh 3 is "msh2". Rather than conditionally 
++    # modifying our parsing scheme for Gmsh 4, for now, we simply set the 
++    # 'Mesh.MshFileVersion' option.
++    # - Decreasing the value of the 'Mesh.RandomFactor' option leads to an 
++    # equal number of nodes and elements being produced under macOS and Linux 
++    # at certain resolutions using certain meshing algorithms.
++    #
+     fid.write('Mesh.Algorithm = 1;\n') # MeshAdapt
++    fid.write('Mesh.MshFileVersion = 2;\n')
+     fid.write('Mesh.RandomFactor = 1e-10;\n')
+     if options.exist('refine'):
+         fid.write('Mesh.Algorithm = 7;\n') # BAMG
+         fid.write('Mesh.CharacteristicLengthFromPoints = 0;\n')
+-        fid.write('Mesh.SmoothRatio = 3;\n')
+         if gmshmajorversion == 3:
+             fid.write('Mesh.RemeshAlgorithm = 1;\n')
+     fid.write('resolution = %g;\n' % resolution)
+@@ -122,16 +132,10 @@
+         fid.close()
+         #}}}
+ 
+-    # Call gmsh
+-    #
+-    # NOTE: The default format in Gmsh 3 is "msh2". Rather than conditionally 
+-    #       modifying our parsing scheme for Gmsh 4, for now, we simply set the 
+-    #       "-format" option.
+-    #
+     if options.exist('refine'):
+-        subprocess.call('gmsh -tol 1e-8 -2 -format msh2 sphere.geo -bgm sphere.pos', shell=True)
++        subprocess.call('gmsh -2 sphere.geo -bgm sphere.pos', shell=True)
+     else:
+-        subprocess.call('gmsh -tol 1e-8 -2 -format msh2 sphere.geo', shell=True)
++        subprocess.call('gmsh -2 sphere.geo', shell=True)
+ 
+     # Import mesh  {{{
+     fid = open('sphere.msh', 'r')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26361-26362.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26361-26362.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26361-26362.diff	(revision 26740)
@@ -0,0 +1,165 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 26361)
++++ ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 26362)
+@@ -176,6 +176,15 @@
+ 			this->values[row] = values_in[i];
+ 		}
+ 	}
++	else if(interp_in==P0Enum && this->interpolation==P0Enum){
++		_assert_(this->N==1);
++		for(int i=0;i<numindices;i++){
++			int row = indices[i];
++			_assert_(row>=0);
++			_assert_(row<this->M);
++			this->values[row] = values_in[i];
++		}
++	}
+ 	else if(this->interpolation!=P1Enum && interp_in==P1Enum){
+ 		this->Reset(interp_in);
+ 		for(int i=0;i<numindices;i++){
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26361)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26362)
+@@ -1186,6 +1186,8 @@
+ 	int      domaintype;
+ 	Element* basalelement;
+ 
++	if(control_interp==P0Enum) _error_("cannot require regularization for P0 controls");
++
+ 	/*Get basal element*/
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+ 	switch(domaintype){
+@@ -1375,6 +1377,8 @@
+ 	/*Intermediaries*/
+ 	int      domaintype;
+ 
++	if(control_interp==P0Enum) _error_("cannot require regularization for P0 controls");
++
+ 	/*Get basal element*/
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+ 	switch(domaintype){
+@@ -1439,6 +1443,7 @@
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Get basal element*/
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+@@ -1501,6 +1506,7 @@
+ void           AdjointHorizAnalysis::GradientJBHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Get domaintype*/
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+@@ -1578,6 +1584,7 @@
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+ 	Element* basalelement;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Get basal element*/
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+@@ -1660,6 +1667,7 @@
+ 
+ 	/*return if floating (gradient is 0)*/
+ 	if(element->IsAllFloating()) return;
++	if(control_interp==P0Enum) _error_("cannot require regularization for P0 controls");
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+@@ -1754,6 +1762,7 @@
+ 	/*return if floating or not on bed (gradient is 0)*/
+ 	if(element->IsAllFloating()) return;
+ 	if(!element->IsOnBase()) return;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Intermediaries*/
+ 	int        domaintype,dim;
+@@ -1933,13 +1942,31 @@
+ 		element->NodalFunctionsP1(basis,gauss);
+ 
+ 		/*Build gradient vector (actually -dJ/dD): */
+-		for(int i=0;i<numvertices;i++){
+-			if(domaintype!=Domain2DverticalEnum) ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
+-			else ge[i]+=-2.*drag*dalpha2dk*(lambda*vx)*Jdet*gauss->weight*basis[i];
+-			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		if(control_interp==P1Enum){
++			for(int i=0;i<numvertices;i++){
++				if(domaintype!=Domain2DverticalEnum) ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
++				else ge[i]+=-2.*drag*dalpha2dk*(lambda*vx)*Jdet*gauss->weight*basis[i];
++				_assert_(!xIsNan<IssmDouble>(ge[i]));
++			}
+ 		}
++		else if(control_interp==P0Enum){
++			if(domaintype!=Domain2DverticalEnum) ge[0]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight;
++			else ge[0]+=-2.*drag*dalpha2dk*(lambda*vx)*Jdet*gauss->weight;
++			_assert_(!xIsNan<IssmDouble>(ge[0]));
++		}
++		else{
++			_error_("not supported");
++		}
+ 	}
+-	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++	if(control_interp==P1Enum){
++		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++	}
++	else if(control_interp==P0Enum){
++		gradient->SetValue(vertexpidlist[0],ge[0],ADD_VAL);
++	}
++	else{
++		_error_("not supported");
++	}
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list_base);
+@@ -2072,6 +2099,7 @@
+ 	/*return if floating or not on bed (gradient is 0)*/
+ 	if(element->IsAllFloating()) return;
+ 	if(!element->IsOnBase()) return;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Intermediaries*/
+ 	int        domaintype,dim;
+@@ -2170,6 +2198,7 @@
+ 	/*return if floating or not on bed (gradient is 0)*/
+ 	if(element->IsAllFloating()) return;
+ 	if(!element->IsOnBase()) return;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble Jdet,weight;
+@@ -2240,6 +2269,7 @@
+ 
+ 	/*return if floating (gradient is 0)*/
+ 	if(element->IsAllFloating()) return;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+@@ -2365,6 +2395,7 @@
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+ 	Element* basalelement;
++	if(control_interp!=P1Enum) _error_("not implemented yet...");
+ 
+ 	/*Get basal element*/
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26361)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26362)
+@@ -219,6 +219,9 @@
+ 
+ 	/*Call inputs method*/
+ 	switch(interpolation_enum){
++		case P0Enum:
++			control_input->SetControl(interpolation_enum,1,&this->lid,values,values_min,values_max);
++			break;
+ 		case P1Enum:
+ 			control_input->SetControl(interpolation_enum,NUMVERTICES,&vertexlids[0],values,values_min,values_max);
+ 			break;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26362-26363.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26362-26363.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26362-26363.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 26362)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 26363)
+@@ -248,10 +248,8 @@
+ 	for(int i=1;i<num_controls;i++) scalar=min(scalar,scalar_list[i]/norm_list[i]);
+ 
+ 	/*Constrain Gradient*/
+-	for(int i=0;i<num_controls;i++){
+-		for(int j=0;j<numvertices;j++){
+-			G[i*numvertices+j] = scalar*G[i*numvertices+j];
+-		}
++	for(int i=0;i<nsize;i++){
++		G[i] = scalar*G[i];
+ 	}
+ 
+ 	for(long i=0;i<nsize;i++){
Index: /issm/oecreview/Archive/25834-26739/ISSM-26363-26364.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26363-26364.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26363-26364.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26363)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26364)
+@@ -938,10 +938,17 @@
+ 			numberofvertices1 = md.mesh.numberofvertices;
+ 			numberofelements1 = md.mesh.numberofelements;
+ 			nbv2 = md2.mesh.numberofvertices;
++
+ 			%Create transformation vectors
+ 			nbedges = size(edges,1);
+ 			Pelem = sparse(1:4*nbe,repmat([1:nbe],1,4),ones(4*nbe,1),4*nbe,nbe);
+ 			Pnode = sparse([1:nbv,repmat([nbv+1:nbv+nbedges],1,2)],[1:nbv edges(:)'],[ones(nbv,1);1/2*ones(2*nbedges,1)],md2.mesh.numberofvertices,nbv);
++
++			%Deal with mesh
++			if numel(md.mesh.scale_factor)==md.mesh.numberofvertices
++				md2.mesh.scale_factor=Pnode*md.mesh.scale_factor;
++			end
++
+ 			%loop over model fields
+ 			model_fields=setxor(fields(md),{'mesh'});
+ 			%remove mesh from this field
+Index: ../trunk-jpl/src/m/classes/taoinversion.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/taoinversion.m	(revision 26363)
++++ ../trunk-jpl/src/m/classes/taoinversion.m	(revision 26364)
+@@ -113,8 +113,8 @@
+ 
+ 			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
+ 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
+-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
++			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
++			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
+ 
+ 			if strcmp(solution,'BalancethicknessSolution')
+ 				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
+Index: ../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversion.m	(revision 26363)
++++ ../trunk-jpl/src/m/classes/inversion.m	(revision 26364)
+@@ -98,8 +98,8 @@
+ 			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',supportedcostfunctions());
+ 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
+-			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
+-			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
++			md = checkfield(md,'fieldname','inversion.min_parameters','size',[NaN num_controls]);
++			md = checkfield(md,'fieldname','inversion.max_parameters','size',[NaN num_controls]);
+ 
+ 			%Only SSA, HO and FS are supported right now
+ 			if strcmp(solution,'StressbalanceSolution')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26364-26365.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26364-26365.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26364-26365.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/m/solve/marshall.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/marshall.m	(revision 26364)
++++ ../trunk-jpl/src/m/solve/marshall.m	(revision 26365)
+@@ -49,4 +49,4 @@
+ 
+ % Uncomment the following to make a copy of the binary input file for debugging 
+ % purposes (can be fed into scripts/BinRead.py).
+-copyfile([md.miscellaneous.name '.bin'], [md.miscellaneous.name '.m.bin'])
++% copyfile([md.miscellaneous.name '.bin'], [md.miscellaneous.name '.m.bin'])
+Index: ../trunk-jpl/src/m/solve/marshall.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/marshall.py	(revision 26364)
++++ ../trunk-jpl/src/m/solve/marshall.py	(revision 26365)
+@@ -49,5 +49,5 @@
+ 
+     # Uncomment the following to make a copy of the binary input file for 
+     # debugging purposes (can be fed into scripts/BinRead.py).
+-    copy_cmd = 'cp {}.bin {}.py.bin'.format(md.miscellaneous.name, md.miscellaneous.name)
+-    subprocess.call(copy_cmd, shell=True)
++    # copy_cmd = 'cp {}.bin {}.py.bin'.format(md.miscellaneous.name, md.miscellaneous.name)
++    # subprocess.call(copy_cmd, shell=True)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26365-26366.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26365-26366.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26365-26366.diff	(revision 26740)
@@ -0,0 +1,85 @@
+Index: ../trunk-jpl/externalpackages/mplapack/install-0-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/mplapack/install-0-linux.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/mplapack/install-0-linux.sh	(revision 26366)
+@@ -0,0 +1,73 @@
++#!/bin/bash
++set -eu
++
++##
++# Source code and installation guidelines available at,
++#
++#	https://github.com/nakatamaho/mplapack
++#
++# Note that original website (for MPACK) at,
++#
++#	http://mplapack.sourceforge.net
++#
++# is not maintained.
++#
++
++## Constants
++#
++VER="0.9.3"
++
++PREFIX="${ISSM_DIR}/externalpackages/mplapack/install" # Set to location where external package should be installed
++
++## Environment
++#
++export CC=gcc
++export CXX=g++
++export FC=gfortran
++export F77=gfortran
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/mplapack-${VER}.tar.gz" "mplapack-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf mplapack-${VER}.tar.gz
++
++# Move source to 'src' directory
++mv mplapack-${VER}/* src
++rm -rf mplapack-${VER}
++
++# Configure
++cd src
++pushd mplapack/debug
++bash gen.Makefile.am.sh
++popd
++autoreconf -ivf
++./configure \
++	--prefix="${PREFIX}" \
++	--disable-static \
++	--enable-fast-install=yes \
++	--disable-dependency-tracking \
++	--enable-debug=yes \
++	--enable-fortranwrapper=yes \
++	--enable-gmp=yes \
++	--enable-mpfr=yes \
++	--enable-qd=yes \
++	--enable-dd=yes \
++	--enable-double=yes \
++	--enable-_Float128=yes \
++	--enable-_Float64x=yes \
++	--with-external-blas="-L${BLAS_ROOT}/lib -lfblas" \
++	--with-external-lapack="-L${LAPACK_ROOT}/lib -lflapack"
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/mplapack/install-0-linux.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26366-26367.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26366-26367.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26366-26367.diff	(revision 26740)
@@ -0,0 +1,381 @@
+Index: ../trunk-jpl/src/m/modules/CoordTransform.m
+===================================================================
+--- ../trunk-jpl/src/m/modules/CoordTransform.m	(revision 26366)
++++ ../trunk-jpl/src/m/modules/CoordTransform.m	(revision 26367)
+@@ -9,18 +9,20 @@
+ %   projin,projout: input/output projection string (PROJ)
+ %
+ %   Example of Projections:
+-%      
++%
+ %   lat/lon = '+init=epsg:4326'
+ %   lat/lon = '+proj=longlat +datum=WGS84'
+-%   
++%
+ %   ll2xy default equivalent (uses with Hugues Ellispoid S)
+ %   Greenland = '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs'
+ %   Antarctica = '+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs'
+ %   Bamber Greenland = '+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs'
+ %
+-%   for latitude/longitude, x is longitude and y latitude and the angles are in rad
++%   For latitude/longitude, x is longitude and y latitude and the angles are in 
++%   rad
+ %
+-%   This function will only work of PROJ has been installed in externalpackages
++%   This function will only work if PROJ has been installed and --with-proj-dir 
++%   option has been set to its location in ISSM configuration
+ 
+ % Check usage
+ if nargin~=4
+Index: ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.h	(revision 26366)
++++ ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.h	(revision 26367)
+@@ -16,15 +16,11 @@
+ #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+ #endif
+ 
+-#ifdef _HAVE_JAVASCRIPT_MODULES_
+-#undef _DO_NOT_LOAD_GLOBALS_ /*only module where this needs to be undefined, so as to 
+-							   not include IssmComm several times in the javascript Modle construct.*/
+-#endif
+-
+ /*Header files: */
+ #include "../bindings.h"
++#include "../../c/main/globals.h"
++#include "../../c/modules/modules.h"
+ #include "../../c/shared/shared.h"
+-#include "../../c/shared/io/io.h"
+ 
+ #undef __FUNCT__ 
+ #define __FUNCT__  "CoordTransform"
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 26366)
++++ ../trunk-jpl/etc/environment.sh	(revision 26367)
+@@ -506,6 +506,7 @@
+ PROJ_ROOT="${ISSM_EXT_DIR}/proj/install"
+ if [ -d "${PROJ_ROOT}" ]; then
+ 	export PROJ_ROOT # Used in installation of GDAL
++	path_append "${PROJ_ROOT}/bin"
+ 	dyld_library_path_append "${PROJ_ROOT}/lib"
+ 	ld_library_path_append "${PROJ_ROOT}/lib"
+ fi
+Index: ../trunk-jpl/externalpackages/proj/install-8.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/proj/install-8.sh	(revision 26367)
+@@ -0,0 +1,44 @@
++#!/bin/bash
++set -eu
++
++
++# Constants
++#
++VER="8.1.0"
++
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
++## Environment
++#
++export CC=mpicc
++export CXX=mpicxx
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf proj-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv proj-${VER}/* src
++rm -rf proj-${VER}
++
++# Configure
++cd src
++./configure \
++	--prefix="${PREFIX}" \
++	--disable-dependency-tracking \
++	--enable-fast-install
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-8.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26366)
++++ ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26367)
+@@ -3,37 +3,75 @@
+  */
+ 
+ /*Header files*/
++#include <proj.h>
++
+ #include "./CoordinateSystemTransformx.h"
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
+-#include <proj_api.h>
+ 
+ void CoordinateSystemTransformx(double** px_dest,double** py_dest,double* x_src,double* y_src,int size,const char* str_src,const char* str_dst){
+ 
+-#if !defined(_HAVE_PROJ_)
+-	_error_("proj not installed");
++/*
++	NOTE:
++	- Compilation of this module is fenced in Makefile.am, so we do not 
++	have to check again if _HAVE_PROJ_ is defined
++	- As of at least PROJ 8, version macros are defined,
++
++		https://proj.org/development/reference/macros.html
++*/
++#if !defined(PROJ_VERSION_MAJOR) || !PROJ_AT_LEAST_VERSION(8, 0, 0)
++	_error_("PROJ major version >= 8 required");
+ #else
++	/*
++	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
++	projection described by str_src to the projection described by str_dest.
+ 
++	NOTE:
++	- API types and calls have been migrated from PROJ 4 to PROJ 6. See SVN 
++	revision history for changes.
++
++	Sources:
++	- https://proj.org/development/migration.html
++	- https://www.gaia-gis.it/fossil/libspatialite/wiki?name=PROJ.6
++
++	TODO:
++	- Because transformations are done in place, we could save memory and time 
++	by simply passing in x_src and y_src and removing the px_dest and py_dest 
++	parameters entirely?
++	*/
++
+ 	/*Allocate output and initialize values as src*/
+ 	_assert_(size>0);
+ 	double* x_dest = xNew<double>(size);
+ 	double* y_dest = xNew<double>(size);
++
+ 	for(int i=0;i<size;i++){
+ 		x_dest[i] = x_src[i];
+ 		y_dest[i] = y_src[i];
+ 	}
+ 
+-	/*Create proj.4 projection objects for src and dst*/
+-	projPJ pj_src  = pj_init_plus(str_src);
+-	projPJ pj_dst  = pj_init_plus(str_dst);
+-	if(!pj_src) _error_("Failed to initialize PROJ with source projection \""    <<str_src<<"\"\n");
+-	if(!pj_dst) _error_("Failed to initialize PROJ with destination projection\""<<str_dst<<"\"\n");
++	PJ *P;
++	size_t sx = sizeof(double);
++	size_t sy = sizeof(double);
++	size_t nx = size;
++	size_t ny = size;
+ 
+-	/*Perform transformation*/
+-	int p = pj_transform(pj_src,pj_dst,size,1,x_dest,y_dest,NULL);
+-	if(p!=0) _error_("Reprojection failed, PROJ error code: "<<p<<"\n");
++	P = proj_create_crs_to_crs(PJ_DEFAULT_CTX,str_src,str_dst,NULL);
+ 
++	if ( 0 == P ) {
++		proj_destroy(P);
++		_error_("failed to initialize CRS transformation object");
++	}
++
++	int p = proj_trans_generic(P, PJ_FWD, x_dest, sx, nx, y_dest, sy, ny, 0, 0, 0, 0, 0, 0);
++
++	if ( 0 == p ){
++		proj_destroy(P);
++		_error_("no successful transformations");
++	}
++
++	proj_destroy(P);
++
+ 	/*Output : */
+ 	*px_dest=x_dest;
+ 	*py_dest=y_dest;
+Index: ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26366)
++++ ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26367)
+@@ -2,70 +2,110 @@
+  * CoordTransform: mesh a domain using an .exp file
+  */
+ 
++/*Header files*/
++#include <proj.h>
++
+ #include "./CoordTransform.h"
+-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
+-#include <proj_api.h>
+ 
+-void CoordTransformUsage(void){/*{{{*/
+-	_printf_(" type help CoordTransform\n");
+-}/*}}}*/
+-WRAPPER(CoordTransform_python){
+-	
+-	/*intermediary: */
+-	double *xin     = NULL;
+-   double *yin     = NULL;
+-   char   *projin  = NULL;
+-   char   *projout = NULL;
+-   int     M,N;
+-   int     test1,test2;
++/*
++	NOTE:
++	- Compilation of this module is fenced in Makefile.am, so we do not 
++	have to check again if _HAVE_PROJ_ is defined
++	- As of at least PROJ 8, version macros are defined,
+ 
+-	printf("%i %i %i %i\n",NLHS,nlhs,NRHS,nrhs);
++		https://proj.org/development/reference/macros.html
++*/
++#if !defined(PROJ_VERSION_MAJOR)
++	_error_("PROJ major version >= 8 required");
++#else
++	/*
++	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
++	projection described by str_src to the projection described by str_dest.
+ 
+-	/*Boot module: */
+-	MODULEBOOT();
++	NOTE:
++	- API types and calls have been migrated from PROJ 4 to PROJ 6. See SVN 
++	revision history for changes.
+ 
+-	/*checks on arguments: */
+-	CHECKARGUMENTS(NLHS,NRHS,&CoordTransformUsage);
++	Sources:
++	- https://proj.org/development/migration.html
++	- https://www.gaia-gis.it/fossil/libspatialite/wiki?name=PROJ.6
++	*/
+ 
+-	/*Fetch data needed for meshing: */
+-	FetchData(&xin,&M,&N,XIN);
+-   FetchData(&yin,&test1,&test2,YIN);
+-   if(!M*N)     _error_("no coordinate provided");
+-   if(test1!=M) _error_("x and y do not have the same size");
+-   if(test2!=N) _error_("x and y do not have the same size");
+-   FetchData(&projin,PROJIN);
+-   FetchData(&projout,PROJOUT);
++	void CoordTransformUsage(void){/*{{{*/
++		_printf_(" type help CoordTransform\n");
++	}/*}}}*/
++	WRAPPER(CoordTransform_python){
++		/*intermediary: */
++		double *xin     = NULL;
++		double *yin     = NULL;
++		char   *projin  = NULL;
++		char   *projout = NULL;
++		int     M,N;
++		int     test1,test2;
+ 
+-	/*Initialize output*/
+-	double* xout = xNew<double>(M*N);
+-	double* yout = xNew<double>(M*N);
++		/*Boot module: */
++		MODULEBOOT();
+ 
+-	/*Initialize projections*/
+-	projPJ pj_src = pj_init_plus(projin);
+-	projPJ pj_dst = pj_init_plus(projout);
+-	if(!pj_src) _error_("Failed to initialize PROJ with source projection\n");
+-	if(!pj_dst) _error_("Failed to initialize PROJ with destination projection\n");
++		/*checks on arguments: */
++		CHECKARGUMENTS(NLHS,NRHS,&CoordTransformUsage);
+ 
+-	/*Transform coordinates*/
+-	int p = pj_transform(pj_src,pj_dst,M*N,1,xout,yout,NULL);
+-	if(p!=0){
+-		_error_("PROJ failed with error code: "<<p);
+-	}
++		/*Fetch data needed for meshing: */
++		FetchData(&xin,&M,&N,XIN);
++		FetchData(&yin,&test1,&test2,YIN);
++		if(!M*N)     _error_("no coordinate provided");
++		if(test1!=M) _error_("x and y do not have the same size");
++		if(test2!=N) _error_("x and y do not have the same size");
++		FetchData(&projin,PROJIN);
++		FetchData(&projout,PROJOUT);
+ 
+-	/*write outputs: */
+-	WriteData(XOUT,xout,M,N);
+-	WriteData(YOUT,yout,M,N);
++		/*Calculate size once*/
++		int size = M*N;
+ 
+-	/*Clean-up and return*/
+-   mxFree(projin);
+-   mxFree(projout);
+-	xDelete<double>(xin);
+-	xDelete<double>(yin);
+-	xDelete<double>(xout);
+-	xDelete<double>(yout);
+-	xDelete<char>(projin);
+-	xDelete<char>(projout);
++		/*Initialize output*/
++		double* xout = xNew<double>(size);
++		double* yout = xNew<double>(size);
+ 
+-	/*end module: */
+-	MODULEEND();
+-}
++		for(int i=0;i<size;i++){
++			xout[i] = xin[i];
++			yout[i] = yin[i];
++		}
++
++		PJ *P;
++		size_t sx = sizeof(double);
++		size_t sy = sizeof(double);
++		size_t nx = size;
++		size_t ny = size;
++
++		P = proj_create_crs_to_crs(PJ_DEFAULT_CTX,projin,projout,NULL);
++
++		if ( 0 == P ) {
++			proj_destroy(P);
++			_error_("failed to initialize CRS transformation object");
++		}
++
++		int p = proj_trans_generic(P, PJ_FWD, xout, sx, nx, yout, sy, ny, 0, 0, 0, 0, 0, 0);
++
++		if ( 0 == p ){
++			proj_destroy(P);
++			_error_("no successful transformations");
++		}
++
++		proj_destroy(P);
++
++		/*write outputs: */
++		WriteData(XOUT,xout,M,N);
++		WriteData(YOUT,yout,M,N);
++
++		/*Clean-up and return*/
++		xDelete<double>(xin);
++		xDelete<double>(yin);
++		xDelete<double>(xout);
++		xDelete<double>(yout);
++		xDelete<char>(projin);
++		xDelete<char>(projout);
++
++		/*end module: */
++		MODULEEND();
++	}
++
++#endif
Index: /issm/oecreview/Archive/25834-26739/ISSM-26367-26368.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26367-26368.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26367-26368.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26367)
++++ ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26368)
+@@ -15,7 +15,7 @@
+ 
+ 		https://proj.org/development/reference/macros.html
+ */
+-#if !defined(PROJ_VERSION_MAJOR)
++#if !defined(PROJ_VERSION_MAJOR) || !PROJ_AT_LEAST_VERSION(8, 0, 0)
+ 	_error_("PROJ major version >= 8 required");
+ #else
+ 	/*
Index: /issm/oecreview/Archive/25834-26739/ISSM-26368-26369.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26368-26369.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26368-26369.diff	(revision 26740)
@@ -0,0 +1,902 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 26368)
++++ ../trunk-jpl/etc/environment.sh	(revision 26369)
+@@ -503,6 +503,12 @@
+ 	ld_library_path_append "${SQLITE_ROOT}/lib"
+ fi
+ 
++LIBTIFF_ROOT="${ISSM_EXT_SHARED_DIR}/libtiff/install"
++if [ -d "${LIBTIFF_ROOT}" ]; then
++	dyld_library_path_append "${LIBTIFF_ROOT}/install/libtiff"
++	ld_library_path_append "${LIBTIFF_ROOT}/install/libtiff"
++fi
++
+ PROJ_ROOT="${ISSM_EXT_DIR}/proj/install"
+ if [ -d "${PROJ_ROOT}" ]; then
+ 	export PROJ_ROOT # Used in installation of GDAL
+Index: ../trunk-jpl/externalpackages/libtiff/install-4-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/libtiff/install-4-mac.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/libtiff/install-4-mac.sh	(revision 26369)
+@@ -0,0 +1,45 @@
++#!/bin/bash
++set -eu
++
++
++# NOTE:
++# - This installation script should work equally well under Linux. If your 
++#	Linux distribution does not include libtiff, please,
++#		- copy this file to install-4-linux.sh
++#		- verify that it successfully compiles and installs libtiff
++#		- commit the new script (including any modifications) to the repo
++#
++
++# Constants
++#
++VER="4.2.0"
++
++PREFIX="${ISSM_EXT_SHARED_DIR}/libtiff/install" # Set to location where external package should be installed
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtiff-v${VER}.tar.gz" "libtiff-v${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf libtiff-v${VER}.tar.gz
++
++# Move source into 'src' directory
++mv libtiff-v${VER}/* src
++rm -rf libtiff-v${VER}
++
++# Configure
++cd src
++cmake -S . -B ${PREFIX}
++cd ${PREFIX}
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/libtiff/install-4-mac.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh	(revision 26368)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh	(nonexistent)
+@@ -1,59 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# Constants
+-#
+-VER="6.2.1"
+-
+-PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+-
+-## Environment
+-#
+-export CC=mpicc
+-export CXX=mpicxx
+-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
+-#		requires,
+-#
+-#			SQLITE3_LIBS="-lsqlite3".
+-#
+-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
+-#		with,
+-#
+-#			`apt-get install sqlite3 libsqlite3-dev`
+-#
+-export SQLITE3_LIBS="-lsqlite3"
+-
+-# Cleanup
+-rm -rf ${PREFIX} src
+-mkdir -p ${PREFIX} src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf proj-${VER}.tar.gz
+-
+-# Move source into 'src' directory
+-mv proj-${VER}/* src
+-rm -rf proj-${VER}
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--disable-dependency-tracking \
+-	--enable-fast-install \
+-	--disable-shared
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make check
+-	make install
+-else
+-	make -j $1
+-	mack -j $1 check
+-	make -j $1 install
+-fi
+-
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-6.2-static-with_tests.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-static.sh	(revision 26368)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-static.sh	(nonexistent)
+@@ -1,56 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# Constants
+-#
+-VER="6.2.1"
+-
+-PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+-
+-## Environment
+-#
+-export CC=mpicc
+-export CXX=mpicxx
+-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
+-#		requires,
+-#
+-#			SQLITE3_LIBS="-lsqlite3".
+-#
+-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
+-#		with,
+-#
+-#			`apt-get install sqlite3 libsqlite3-dev`
+-#
+-export SQLITE3_LIBS="-lsqlite3"
+-
+-# Cleanup
+-rm -rf ${PREFIX} src
+-mkdir -p ${PREFIX} src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf proj-${VER}.tar.gz
+-
+-# Move source into 'src' directory
+-mv proj-${VER}/* src
+-rm -rf proj-${VER}
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--disable-dependency-tracking \
+-	--enable-fast-install \
+-	--disable-shared
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-6.2-static.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install-6.2.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2.sh	(revision 26368)
++++ ../trunk-jpl/externalpackages/proj/install-6.2.sh	(nonexistent)
+@@ -1,55 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# Constants
+-#
+-VER="6.2.1"
+-
+-PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+-
+-## Environment
+-#
+-export CC=mpicc
+-export CXX=mpicxx
+-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
+-#		requires,
+-#
+-#			SQLITE3_LIBS="-lsqlite3".
+-#
+-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
+-#		with,
+-#
+-#			`apt-get install sqlite3 libsqlite3-dev`
+-#
+-export SQLITE3_LIBS="-lsqlite3"
+-
+-# Cleanup
+-rm -rf ${PREFIX} src
+-mkdir -p ${PREFIX} src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf proj-${VER}.tar.gz
+-
+-# Move source into 'src' directory
+-mv proj-${VER}/* src
+-rm -rf proj-${VER}
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--disable-dependency-tracking \
+-	--enable-fast-install
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-6.2.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh	(revision 26368)
++++ ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh	(nonexistent)
+@@ -1,57 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-
+-# Constants
+-#
+-VER="6.2.1"
+-
+-PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+-
+-## Environment
+-#
+-export CC=mpicc
+-export CXX=mpicxx
+-# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
+-#		requires,
+-#
+-#			SQLITE3_LIBS="-lsqlite3".
+-#
+-#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
+-#		with,
+-#
+-#			`apt-get install sqlite3 libsqlite3-dev`
+-#
+-export SQLITE3_LIBS="-lsqlite3"
+-
+-# Cleanup
+-rm -rf ${PREFIX} src
+-mkdir -p ${PREFIX} src
+-
+-# Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
+-
+-# Unpack source
+-tar -zxvf proj-${VER}.tar.gz
+-
+-# Move source into 'src' directory
+-mv proj-${VER}/* src
+-rm -rf proj-${VER}
+-
+-# Configure
+-cd src
+-./configure \
+-	--prefix="${PREFIX}" \
+-	--disable-dependency-tracking \
+-	--enable-fast-install
+-
+-# Compile and install
+-if [ $# -eq 0 ]; then
+-	make
+-	make check
+-	make install
+-else
+-	make -j $1
+-	mack -j $1 check
+-	make -j $1 install
+-fi
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-6.2-with_tests.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 26368)
++++ ../trunk-jpl/jenkins/aws-amazon_linux-solid_earth	(revision 26369)
+@@ -21,8 +21,9 @@
+ 	--with-mumps-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-hdf5-dir=${ISSM_DIR}/externalpackages/petsc/install \
+ 	--with-petsc-dir=${ISSM_DIR}/externalpackages/petsc/install \
+-	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+-	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install
++	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
++	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install
+ '
+ 
+ #-------------------#
+@@ -40,7 +41,7 @@
+ 	boost			install-1.7-linux.sh
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+-	proj			install-6.2.sh
++	proj			install-8.sh
+ 	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab	(revision 26368)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-matlab	(revision 26369)
+@@ -30,6 +30,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -48,7 +49,7 @@
+ 	dakota		install-6.2-linux-static.sh
+ 	curl		install-7-linux-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+-	proj		install-6.2-static.sh
++	proj		install-8-static.sh
+ 	gdal		install-3-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux-static.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 26368)
++++ ../trunk-jpl/jenkins/ross-debian_linux-binaries-python	(revision 26369)
+@@ -30,6 +30,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -48,7 +49,7 @@
+ 	dakota		install-6.2-linux-static.sh
+ 	curl		install-7-linux-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+-	proj		install-6.2-static.sh
++	proj		install-8-static.sh
+ 	gdal		install-3-python-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux-static.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 26368)
++++ ../trunk-jpl/jenkins/ross-debian_linux-dakota	(revision 26369)
+@@ -28,6 +28,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -47,7 +48,7 @@
+ 	dakota			install-6.2-linux.sh
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+-	proj			install-6.2.sh
++	proj			install-8.sh
+ 	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 26368)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full	(revision 26369)
+@@ -29,6 +29,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -48,7 +49,7 @@
+ 	dakota		install-6.2-linux.sh
+ 	curl		install-7-linux.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 26368)
++++ ../trunk-jpl/jenkins/ross-debian_linux-full-valgrind	(revision 26369)
+@@ -29,6 +29,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -48,7 +49,7 @@
+ 	dakota		install-6.2-linux.sh
+ 	curl		install-7-linux.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-python
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 26368)
++++ ../trunk-jpl/jenkins/ross-debian_linux-python	(revision 26369)
+@@ -23,6 +23,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -42,7 +43,7 @@
+ 	dakota		install-6.2-linux.sh
+ 	curl		install-7-linux.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-linux.sh
+Index: ../trunk-jpl/jenkins/ross-debian_linux-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26368)
++++ ../trunk-jpl/jenkins/ross-debian_linux-solid_earth	(revision 26369)
+@@ -26,6 +26,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -45,7 +46,7 @@
+ 	dakota			install-6.2-linux.sh
+ 	curl			install-7-linux.sh
+ 	netcdf			install-4.7-parallel.sh
+-	proj			install-6.2.sh
++	proj			install-8.sh
+ 	gdal			install-3-python.sh
+ 	gshhg			install.sh
+ 	gmt				install-6-linux.sh
+Index: ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh	(revision 26369)
+@@ -0,0 +1,49 @@
++#!/bin/bash
++set -eu
++
++
++# Constants
++#
++VER="8.1.0"
++
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
++## Environment
++#
++export CC=mpicc
++export CXX=mpicxx
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf proj-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv proj-${VER}/* src
++rm -rf proj-${VER}
++
++# Configure
++cd src
++./configure \
++	--prefix="${PREFIX}" \
++	--disable-dependency-tracking \
++	--enable-fast-install \
++	--disable-shared \
++	--disable-libtiff
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make check
++	make install
++else
++	make -j $1
++	mack -j $1 check
++	make -j $1 install
++fi
++
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install-8-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-static.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/proj/install-8-static.sh	(revision 26369)
+@@ -0,0 +1,46 @@
++#!/bin/bash
++set -eu
++
++
++# Constants
++#
++VER="8.1.0"
++
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
++## Environment
++#
++export CC=mpicc
++export CXX=mpicxx
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf proj-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv proj-${VER}/* src
++rm -rf proj-${VER}
++
++# Configure
++cd src
++./configure \
++	--prefix="${PREFIX}" \
++	--disable-dependency-tracking \
++	--enable-fast-install \
++	--disable-shared \
++	--disable-libtiff
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-8-static.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh	(revision 26369)
+@@ -0,0 +1,47 @@
++#!/bin/bash
++set -eu
++
++
++# Constants
++#
++VER="8.1.0"
++
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++
++## Environment
++#
++export CC=mpicc
++export CXX=mpicxx
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf proj-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv proj-${VER}/* src
++rm -rf proj-${VER}
++
++# Configure
++cd src
++./configure \
++	--prefix="${PREFIX}" \
++	--disable-dependency-tracking \
++	--enable-fast-install \
++	--disable-libtiff
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make check
++	make install
++else
++	make -j $1
++	mack -j $1 check
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/proj/install-8.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8.sh	(revision 26368)
++++ ../trunk-jpl/externalpackages/proj/install-8.sh	(revision 26369)
+@@ -32,7 +32,8 @@
+ ./configure \
+ 	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+-	--enable-fast-install
++	--enable-fast-install \
++	--disable-libtiff
+ 
+ # Compile and install
+ if [ $# -eq 0 ]; then
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 26369)
+@@ -31,6 +31,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -50,7 +51,7 @@
+ 	dakota		install-6.2-mac-static.sh
+ 	curl		install-7-mac-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+-	proj		install-6.2-static.sh
++	proj		install-8-static.sh
+ 	gdal		install-3-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac-static.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 26369)
+@@ -29,6 +29,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -48,7 +49,7 @@
+ 	dakota		install-6.2-mac-static.sh
+ 	curl		install-7-mac-static.sh
+ 	netcdf		install-4.7-parallel-static.sh
+-	proj		install-6.2-static.sh
++	proj		install-8-static.sh
+ 	gdal		install-3-python-static.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac-static.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26369)
+@@ -26,6 +26,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -46,7 +47,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26369)
+@@ -28,6 +28,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -47,7 +48,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26369)
+@@ -29,6 +29,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -48,7 +49,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26369)
+@@ -29,6 +29,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -48,7 +49,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26369)
+@@ -23,6 +23,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -43,7 +44,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26369)
+@@ -26,6 +26,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -46,7 +47,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26368)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26369)
+@@ -26,6 +26,7 @@
+ 	--with-gsl-dir=${ISSM_DIR}/externalpackages/gsl/install \
+ 	--with-boost-dir=${ISSM_DIR}/externalpackages/boost/install \
+ 	--with-dakota-dir=${ISSM_DIR}/externalpackages/dakota/install \
++	--with-proj-dir=${ISSM_DIR}/externalpackages/proj/install \
+ 	--with-triangle-dir=${ISSM_DIR}/externalpackages/triangle/install \
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+@@ -46,7 +47,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-6.2.sh
++	proj		install-8.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26369-26370.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26369-26370.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26369-26370.diff	(revision 26740)
@@ -0,0 +1,108 @@
+Index: ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp	(revision 26369)
++++ ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp	(revision 26370)
+@@ -17,12 +17,12 @@
+ 	return;
+ }
+ /*}}}*/
+-SpcDynamic::SpcDynamic(int spc_id,int spc_nodeid, int spc_dof,int spc_analysis_type){/*{{{*/
++SpcDynamic::SpcDynamic(int spc_id,int spc_nodeid, int spc_dof,IssmDouble value_in,int spc_analysis_type){/*{{{*/
+ 
+ 	id           = spc_id;
+ 	nodeid        = spc_nodeid;
+ 	dof           = spc_dof;
+-	value         = 0;
++	value         = value_in;
+ 	analysis_type = spc_analysis_type;
+ 	isset         = false;
+ 	penalty       = false;
+Index: ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h	(revision 26369)
++++ ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.h	(revision 26370)
+@@ -25,7 +25,7 @@
+ 
+ 		/*SpcDynamic constructors, destructors*/
+ 		SpcDynamic();
+-		SpcDynamic(int id_in,int nodeid, int dof,int analysis_type);
++		SpcDynamic(int id_in,int nodeid, int dof,IssmDouble value_in,int analysis_type);
+ 		~SpcDynamic();
+ 
+ 		/*Object virtual functions definitions*/
+Index: ../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 26369)
++++ ../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 26370)
+@@ -665,7 +665,7 @@
+ 				for(i=0;i<iomodel->numberofvertices;i++){
+ 					if((iomodel->my_vertices[i])){
+ 						if (!xIsNan<IssmDouble>(spcdata[i])){
+-							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
++							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,spcdata[i],analysis_type));
+ 							count++;
+ 						}
+ 					}
+@@ -675,21 +675,18 @@
+ 				for(i=0;i<iomodel->numberofvertices;i++){
+ 					if((iomodel->my_vertices[i])){
+ 						if (!xIsNan<IssmDouble>(spcdata[i])){
+-							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
++							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,spcdata[i],analysis_type));
+ 							count++;
+ 						}
+ 					}
+ 				}
+-				for(i=0;i<iomodel->numberofedges;i++){
+-					if(iomodel->edges[i*3+2]==2){
+-						if(iomodel->my_edges[i]){
+-							v1 = iomodel->edges[3*i+0]-1;
+-							v2 = iomodel->edges[3*i+1]-1;
+-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+-								constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+i+1,
+-												dof,analysis_type));
+-								count++;
+-							}
++				for(i=0;i<iomodel->numberofverticaledges;i++){
++					if(iomodel->my_vedges[i]){
++						v1 = iomodel->verticaledges[2*i+0]-1;
++						v2 = iomodel->verticaledges[2*i+1]-1;
++						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
++							constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+i+1,dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
++							count++;
+ 						}
+ 					}
+ 				}
+@@ -698,21 +695,21 @@
+ 				for(i=0;i<iomodel->numberofvertices;i++){
+ 					if((iomodel->my_vertices[i])){
+ 						if (!xIsNan<IssmDouble>(spcdata[i])){
+-							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
++							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,spcdata[i],analysis_type));
+ 							count++;
+ 						}
+ 					}
+ 				}
+-				for(i=0;i<iomodel->numberofedges;i++){
+-					if(iomodel->edges[i*3+2]==2){
+-						if(iomodel->my_edges[i]){
+-							v1 = iomodel->edges[3*i+0]-1;
+-							v2 = iomodel->edges[3*i+1]-1;
+-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+-								constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+2*i+1,dof,analysis_type));
+-								constraints->AddObject(new SpcDynamic(count+2,iomodel->numberofvertices+2*i+2,dof,analysis_type));
+-								count=count+2;
+-							}
++				for(i=0;i<iomodel->numberofverticaledges;i++){
++					if(iomodel->my_vedges[i]){
++						v1 = iomodel->verticaledges[2*i+0]-1;
++						v2 = iomodel->verticaledges[2*i+1]-1;
++						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
++							constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+2*i+1,
++											dof,2./3.*spcdata[v1]+1./3.*spcdata[v2],analysis_type));
++							constraints->AddObject(new SpcDynamic(count+2,iomodel->numberofvertices+2*i+2,
++											dof,1./3.*spcdata[v1]+2./3.*spcdata[v2],analysis_type));
++							count=count+2;
+ 						}
+ 					}
+ 				}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26370-26371.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26370-26371.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26370-26371.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26370)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26371)
+@@ -385,7 +385,7 @@
+ 					xDelete<IssmDouble>(values);
+ 				}
+ 				else if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==SIAApproximationEnum){
+-					constraints->AddObject(new SpcDynamic(count+1,i+1,0,StressbalanceAnalysisEnum));
++					constraints->AddObject(new SpcDynamic(count+1,i+1,0,0.,StressbalanceAnalysisEnum));
+ 					count++;
+ 				}
+ 
+@@ -408,7 +408,7 @@
+ 					xDelete<IssmDouble>(values);
+ 				}
+ 				else if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==SIAApproximationEnum){
+-					constraints->AddObject(new SpcDynamic(count+1,i+1,1,StressbalanceAnalysisEnum));
++					constraints->AddObject(new SpcDynamic(count+1,i+1,1,0.,StressbalanceAnalysisEnum));
+ 					count++;
+ 				}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26371-26372.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26371-26372.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26371-26372.diff	(revision 26740)
@@ -0,0 +1,44 @@
+Index: ../trunk-jpl/src/m/interp/averaging.py
+===================================================================
+--- ../trunk-jpl/src/m/interp/averaging.py	(revision 26371)
++++ ../trunk-jpl/src/m/interp/averaging.py	(revision 26372)
+@@ -28,10 +28,10 @@
+         temperature = averaging(md, md.initialization.temperature, 1, 1)
+     """
+ 
+-    if len(data) != md.mesh.numberofelements and len(data) != md.mesh.numberofvertices:
++    if (len(data) != md.mesh.numberofelements) & (len(data) != md.mesh.numberofvertices):
+         raise Exception('averaging error message: data not supported yet')
+-    if md.mesh.dimension() == 3 and layer != 0:
+-        if layer <= 0 or layer > md.mesh.numberoflayers:
++    if (md.mesh.dimension() == 3) & (layer != 0):
++        if (layer <= 0) | (layer > md.mesh.numberoflayers):
+             raise ValueError('layer should be between 1 and md.mesh.numberoflayers')
+     else:
+         layer = 0
+@@ -39,7 +39,7 @@
+     # Initialization
+     if layer == 0:
+         weights = np.zeros(md.mesh.numberofvertices, )
+-        data = data.flatten(1)
++        data = np.asarray(data).flatten()
+     else:
+         weights = np.zeros(md.mesh.numberofvertices2d, )
+         data = data[(layer - 1) * md.mesh.numberofvertices2d + 1:layer * md.mesh.numberofvertices2d, :]
+@@ -66,7 +66,7 @@
+         areas = GetAreas(index, md.mesh.x2d, md.mesh.y2d)
+ 
+     index = index - 1  # Python indexes from zero
+-    line = index.flatten(1)
++    line = index.flatten()
+     areas = np.vstack(areas).reshape(-1, )
+     summation = 1. / rep * np.ones(rep, )
+     linesize = rep * numberofelements
+@@ -90,6 +90,6 @@
+         average_node = csc_matrix(average_node)
+ 
+     # Return output as a full matrix (C code does not like sparse matrices)
+-    average = np.asarray(average_node.todense()).reshape(-1, )
++    average = np.expand_dims(np.asarray(average_node.todense()).reshape(-1, ),axis=1)
+ 
+     return average
Index: /issm/oecreview/Archive/25834-26739/ISSM-26372-26373.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26372-26373.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26372-26373.diff	(revision 26740)
@@ -0,0 +1,29 @@
+Index: ../trunk-jpl/src/m/classes/organizer.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/organizer.py	(revision 26372)
++++ ../trunk-jpl/src/m/classes/organizer.py	(revision 26373)
+@@ -116,7 +116,7 @@
+             md = loadmodel(path2)
+             return md
+ 
+-    #If we are here, the model has not been found. Try trunk prefix if provided
++        #If we are here, the model has not been found. Try trunk prefix if provided
+         if self.trunkprefix:
+             path2 = os.path.join(self.repository, self.trunkprefix + string)
+             if not os.path.exists(path2):
+@@ -152,13 +152,13 @@
+                 print(("   prefix: %s" % self.prefix))
+             print(("   step  #%i : %s" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
+ 
+-    #Ok, now if _currentstep is a member of steps, return true
++        #Ok, now if _currentstep is a member of steps, return true
+         if self._currentstep in self.requestedsteps:
+             print(("\n   step  #%i : %s\n" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
+             bool = True
+ 
+             #last check: is this step locked?
+-            s = self.steps[self._currentstep].string
++				s = self.steps[self._currentstep - 1]['string']
+             if len(s) > 7:
+                 if s[-6:] == 'Locked':
+                     raise Exception('organizer: you are trying to run a locked step! Unlock it first!')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26373-26374.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26373-26374.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26373-26374.diff	(revision 26740)
@@ -0,0 +1,286 @@
+Index: ../trunk-jpl/src/m/exp/contourlevelzero.py
+===================================================================
+--- ../trunk-jpl/src/m/exp/contourlevelzero.py	(nonexistent)
++++ ../trunk-jpl/src/m/exp/contourlevelzero.py	(revision 26374)
+@@ -0,0 +1,237 @@
++import os.path
++import numpy as np
++from collections import OrderedDict
++
++def contourlevelzero(md,mask,level):
++    """CONTOURLEVELZERO - figure out the zero level (or offset thereof, specified by the level value)
++                       of a vectorial mask, and vectorialize it into an exp or shp compatible structure.
++    
++       Usage:
++          contours=contourlevelzero(md,mask,level)
++    
++       See also: PLOT_CONTOUR
++    """
++    
++    #process data 
++    if md.mesh.dimension()==3:
++        x = md.mesh.x2d
++        y = md.mesh.y2d
++        z=md.mesh.z
++        index=md.mesh.elements2d-1
++    else:
++        x=md.mesh.x
++        y=md.mesh.y
++        index=md.mesh.elements-1
++        z=np.zeros((md.mesh.numberofvertices,1))
++        
++    if len(mask)==0:
++        raise OSError("mask provided is empty")
++    
++    if md.mesh.dimension()==3:
++        if len(mask)!=md.mesh.numberofvertices2d: 
++            raise OSError("mask provided should be specified at the vertices of the mesh")
++    else:
++        if len(mask)!=md.mesh.numberofvertices:
++            raise OSError("mask provided should be specified at the vertices of the mesh")
++        
++    #initialization of some variables
++    numberofelements=np.size(index,0)
++    elementslist=np.c_[0:numberofelements]
++    c=[]
++    h=[]
++    
++    #get unique edges in mesh
++    #1: list of edges
++    edges=np.vstack((np.vstack((index[:,(0,1)],index[:,(1,2)])),index[:,(2,0)]))
++
++    #2: find unique edges
++    [edges,J]=np.unique(np.sort(edges,1),axis=0,return_inverse=True)
++    #3: unique edge numbers
++    vec=J
++    #4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
++    #   the same edge number)
++    edges_tria=np.hstack((np.hstack((vec[elementslist],vec[elementslist+numberofelements])),vec[elementslist+2*numberofelements]))
++    
++    #segments [nodes1 nodes2]
++    Seg1=index[:,(0,1)]
++    Seg2=index[:,(1,2)]
++    Seg3=index[:,(2,0)]
++    
++    #segment numbers [1;4;6;...]
++    Seg1_num=edges_tria[:,0]
++    Seg2_num=edges_tria[:,1]
++    Seg3_num=edges_tria[:,2]
++    
++    #value of data on each tips of the segments
++    Data1=mask[Seg1]
++    Data2=mask[Seg2]
++    Data3=mask[Seg3]
++    
++    #get the ranges for each segment
++    Range1=np.sort(Data1,1)
++    Range2=np.sort(Data2,1)
++    Range3=np.sort(Data3,1)
++    
++    #find the segments that contain this value
++    pos1=(Range1[:,0]<level) & (Range1[:,1]>=level)
++    pos2=(Range2[:,0]<level) & (Range2[:,1]>=level)
++    pos3=(Range3[:,0]<level) & (Range3[:,1]>=level)
++    
++    #get elements
++    poselem12=(pos1) & (pos2)
++    poselem13=(pos1) & (pos3)
++    poselem23=(pos2) & (pos3)
++    poselem=np.where((poselem12) | (poselem13) | (poselem23))
++    poselem=poselem[0]
++    numelems=len(poselem)
++    
++    #if no element has been flagged, skip to the next level
++    if numelems==0:
++        raise Exception('contourlevelzero warning message: no elements found with corresponding level value in mask')
++        contours=[]
++        return contours
++    
++    #go through the elements and build the coordinates for each segment (1 by element)
++    x1=np.zeros((numelems,1))
++    x2=np.zeros((numelems,1))
++    y1=np.zeros((numelems,1))
++    y2=np.zeros((numelems,1))
++    z1=np.zeros((numelems,1))
++    z2=np.zeros((numelems,1))
++    
++    edge_l=np.zeros((numelems,2))
++    
++    for j in range(0,numelems):
++        
++        with np.errstate(divide='ignore', invalid='ignore'):
++            weight1=np.divide(level-Data1[poselem[j],0],Data1[poselem[j],1]-Data1[poselem[j],0])
++            weight2=np.divide(level-Data2[poselem[j],0],Data2[poselem[j],1]-Data2[poselem[j],0])
++            weight3=np.divide(level-Data3[poselem[j],0],Data3[poselem[j],1]-Data3[poselem[j],0])
++        
++        if poselem12[poselem[j]]==True:
++            
++            x1[j]=x[Seg1[poselem[j],0]]+weight1*[x[Seg1[poselem[j],1]]-x[Seg1[poselem[j],0]]]
++            x2[j]=x[Seg2[poselem[j],0]]+weight2*[x[Seg2[poselem[j],1]]-x[Seg2[poselem[j],0]]]
++            y1[j]=y[Seg1[poselem[j],0]]+weight1*[y[Seg1[poselem[j],1]]-y[Seg1[poselem[j],0]]]
++            y2[j]=y[Seg2[poselem[j],0]]+weight2*[y[Seg2[poselem[j],1]]-y[Seg2[poselem[j],0]]]
++            z1[j]=z[Seg1[poselem[j],0]]+weight1*[z[Seg1[poselem[j],1]]-z[Seg1[poselem[j],0]]]
++            z2[j]=z[Seg2[poselem[j],0]]+weight2*[z[Seg2[poselem[j],1]]-z[Seg2[poselem[j],0]]]
++            
++            edge_l[j,0]=Seg1_num[poselem[j]]
++            edge_l[j,1]=Seg2_num[poselem[j]]
++        elif poselem13[poselem[j]]==True:
++            
++            x1[j]=x[Seg1[poselem[j],0]]+weight1*[x[Seg1[poselem[j],1]]-x[Seg1[poselem[j],0]]]
++            x2[j]=x[Seg3[poselem[j],0]]+weight3*[x[Seg3[poselem[j],1]]-x[Seg3[poselem[j],0]]]
++            y1[j]=y[Seg1[poselem[j],0]]+weight1*[y[Seg1[poselem[j],1]]-y[Seg1[poselem[j],0]]]
++            y2[j]=y[Seg3[poselem[j],0]]+weight3*[y[Seg3[poselem[j],1]]-y[Seg3[poselem[j],0]]]
++            z1[j]=z[Seg1[poselem[j],0]]+weight1*[z[Seg1[poselem[j],1]]-z[Seg1[poselem[j],0]]]
++            z2[j]=z[Seg3[poselem[j],0]]+weight3*[z[Seg3[poselem[j],1]]-z[Seg3[poselem[j],0]]]
++            
++            edge_l[j,0]=Seg1_num[poselem[j]]
++            edge_l[j,1]=Seg3_num[poselem[j]]
++        elif poselem23[poselem[j]]==True:
++            
++            x1[j]=x[Seg2[poselem[j],0]]+weight2*[x[Seg2[poselem[j],1]]-x[Seg2[poselem[j],0]]]
++            x2[j]=x[Seg3[poselem[j],0]]+weight3*[x[Seg3[poselem[j],1]]-x[Seg3[poselem[j],0]]]
++            y1[j]=y[Seg2[poselem[j],0]]+weight2*[y[Seg2[poselem[j],1]]-y[Seg2[poselem[j],0]]]
++            y2[j]=y[Seg3[poselem[j],0]]+weight3*[y[Seg3[poselem[j],1]]-y[Seg3[poselem[j],0]]]
++            z1[j]=z[Seg2[poselem[j],0]]+weight2*[z[Seg2[poselem[j],1]]-z[Seg2[poselem[j],0]]]
++            z2[j]=z[Seg3[poselem[j],0]]+weight3*[z[Seg3[poselem[j],1]]-z[Seg3[poselem[j],0]]]
++
++            edge_l[j,0]=Seg2_num[poselem[j]]
++            edge_l[j,1]=Seg3_num[poselem[j]]
++
++        #else:
++	    #it shoud not go here
++            
++    #now that we have the segments, we must try to connect them...
++    
++    #loop over the subcontours
++    contours=[]
++    
++    while len(edge_l)>0:
++        
++        #take the right edge of the second segment and connect it to the next segments if any
++        e1=edge_l[0,0]
++        e2=edge_l[0,1]
++        xc=np.vstack((x1[0],x2[0]))
++        yc=np.vstack((y1[0],y2[0]))
++        zc=np.vstack((z1[0],z2[0]))
++        #erase the lines corresponding to this edge
++        edge_l=np.delete(edge_l,0,axis=0)
++        x1=np.delete(x1,0,axis=0)
++        x2=np.delete(x2,0,axis=0)
++        y1=np.delete(y1,0,axis=0)
++        y2=np.delete(y2,0,axis=0)
++        z1=np.delete(z1,0,axis=0)
++        z2=np.delete(z2,0,axis=0)
++        pos1=np.where(edge_l==e1)
++        
++        while len(pos1[0])>0:
++            
++            if np.all(pos1[1]==0):
++                xc=np.vstack((x2[pos1[0]],xc))
++                yc=np.vstack((y2[pos1[0]],yc))
++                zc=np.vstack((z2[pos1[0]],zc))
++                #next edge:
++                e1=edge_l[pos1[0],1]
++            else:
++                xc=np.vstack((x1[pos1[0]],xc))
++                yc=np.vstack((y1[pos1[0]],yc))
++                zc=np.vstack((z1[pos1[0]],zc))
++                #next edge:
++                e1=edge_l[pos1[0],0]
++                
++            #erase the lines of this
++            edge_l=np.delete(edge_l,pos1[0],axis=0)
++            x1=np.delete(x1,pos1[0],axis=0)
++            x2=np.delete(x2,pos1[0],axis=0)
++            y1=np.delete(y1,pos1[0],axis=0)
++            y2=np.delete(y2,pos1[0],axis=0)
++            z1=np.delete(z1,pos1[0],axis=0)
++            z2=np.delete(z2,pos1[0],axis=0)
++            #next connection
++            pos1=np.where(edge_l==e1)
++            
++        #same thing the other way (to the right)
++        pos2=np.where(edge_l==e2)
++
++        while len(pos2[0])>0:
++            
++            if np.all(pos2[1]==0):
++                xc=np.vstack((xc,x2[pos2[0]]))
++                yc=np.vstack((yc,y2[pos2[0]]))
++                zc=np.vstack((zc,z2[pos2[0]]))
++                #next edge:
++                e2=edge_l[pos2[0],1]
++            else:
++                xc=np.vstack((xc,x1[pos2[0]]))
++                yc=np.vstack((yc,y1[pos2[0]]))
++                zc=np.vstack((zc,z1[pos2[0]]))
++                #next edge:
++                e2=edge_l[pos2[0],0]
++                
++            #erase the lines of this
++            edge_l=np.delete(edge_l,pos2[0],axis=0)
++            x1=np.delete(x1,pos2[0],axis=0)
++            x2=np.delete(x2,pos2[0],axis=0)
++            y1=np.delete(y1,pos2[0],axis=0)
++            y2=np.delete(y2,pos2[0],axis=0)
++            z1=np.delete(z1,pos2[0],axis=0)
++            z2=np.delete(z2,pos2[0],axis=0)
++            #next connection
++            pos2=np.where(edge_l==e2)
++            
++        #save xc,yc contour: 
++        newcontour = OrderedDict()
++        newcontour['nods'] = np.size(xc)
++        newcontour['density'] = 1 
++        newcontour['closed'] = 0
++        newcontour['x'] = np.ma.filled(xc.astype(float), np.nan)
++        newcontour['y'] = np.ma.filled(yc.astype(float), np.nan)
++        newcontour['z'] = np.ma.filled(zc.astype(float), np.nan)
++        newcontour['name'] = ''
++        contours.append(newcontour)
++        
++    return contours
+Index: ../trunk-jpl/src/m/parameterization/reinitializelevelset.py
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/reinitializelevelset.py	(nonexistent)
++++ ../trunk-jpl/src/m/parameterization/reinitializelevelset.py	(revision 26374)
+@@ -0,0 +1,39 @@
++import numpy as np
++from model import model
++from contourlevelzero import *
++from ExpToLevelSet import *
++
++def reinitializelevelset(md,levelset):
++    """REINITIALIZELEVELSET - reinitialize levelset as a signed distance function
++
++    Usage:
++       levelsetnew = reinitializelevelset(md,levelset)
++    """
++    
++    # if md is 3d, levelset should be projected on a 2d mesh 
++    if len(levelset) == 0:
++        raise IOError("levelset provided is empty")
++    
++    if md.mesh.dimension() == 3:
++        if len(levelset)!=md.mesh.numberofvertices2d:
++            raise IOError("levelset provided should be specified at the 2d vertices of the mesh")
++        else:
++            if len(levelset)!=md.mesh.numberofvertices:
++                raise IOError("levelset provided should be specified at the vertices of the mesh")
++            
++    #First: extract segments
++    contours=contourlevelzero(md,levelset,0)
++    
++    #Now, make this a distance field (might not be closed)
++    levelsetnew=np.abs(ExpToLevelSet(md.mesh.x,md.mesh.y,contours)).T # levelsetnew comes on the 3d vertices, if mesh is 3d
++    
++    #Finally, change sign
++    pos=np.where(levelset<0) # if mesh is 3d, it refers to the vertices on the base
++    if md.mesh.dimension()==3:
++        for i in range(md.mesh.numberoflayers):
++            pos3d=pos[0]+i*md.mesh.numberofvertices2d
++            levelsetnew[pos3d]=-levelsetnew[pos3d]
++    else:
++        levelsetnew[pos[0]]=-1*levelsetnew[pos[0]]
++        
++    return levelsetnew
Index: /issm/oecreview/Archive/25834-26739/ISSM-26374-26375.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26374-26375.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26374-26375.diff	(revision 26740)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/m/modules/ExpToLevelSet.py
+===================================================================
+--- ../trunk-jpl/src/m/modules/ExpToLevelSet.py	(revision 26374)
++++ ../trunk-jpl/src/m/modules/ExpToLevelSet.py	(revision 26375)
+@@ -1,3 +1,4 @@
++from ExpToLevelSet_python import ExpToLevelSet_python
+ from helpers import fileparts
+ from shpread import shpread
+ 
+@@ -22,7 +23,7 @@
+     to work as intended (see src/m/modules/ExpToLevelSet.m)
+     """
+ 
+-    if isinstance(contourname, basestring):
++    if isinstance(contourname, str):
+         path, name, ext = fileparts(contourname)
+         if ext == '.shp':
+             #read contour from shapefile
Index: /issm/oecreview/Archive/25834-26739/ISSM-26375-26376.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26375-26376.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26375-26376.diff	(revision 26740)
@@ -0,0 +1,79 @@
+Index: ../trunk-jpl/src/m/interp/averaging.m
+===================================================================
+--- ../trunk-jpl/src/m/interp/averaging.m	(revision 26375)
++++ ../trunk-jpl/src/m/interp/averaging.m	(revision 26376)
+@@ -72,7 +72,7 @@
+ summation=1/rep*ones(rep,1);
+ linesize=rep*numberofelements;
+ 
+-%update weights that holds the volume of all the element holding the node i
++%update weights that hold the volume of all the element holding the node i
+ weights=sparse(line,ones(linesize,1),repmat(areas,rep,1),numberofnodes,1);
+ 
+ %initialization
+Index: ../trunk-jpl/src/m/interp/averaging.py
+===================================================================
+--- ../trunk-jpl/src/m/interp/averaging.py	(revision 26375)
++++ ../trunk-jpl/src/m/interp/averaging.py	(revision 26376)
+@@ -38,11 +38,11 @@
+ 
+     # Initialization
+     if layer == 0:
+-        weights = np.zeros(md.mesh.numberofvertices, )
++        weights = np.zeros((md.mesh.numberofvertices, ))
+         data = np.asarray(data).flatten()
+     else:
+-        weights = np.zeros(md.mesh.numberofvertices2d, )
+-        data = data[(layer - 1) * md.mesh.numberofvertices2d + 1:layer * md.mesh.numberofvertices2d, :]
++        weights = np.zeros((md.mesh.numberofvertices2d, ))
++        data = data[(layer - 1) * md.mesh.numberofvertices2d + 1:layer * md.mesh.numberofvertices2d - 1, :]
+ 
+     # Load some variables (it is much faster if the variables are loaded from md once for all)
+     if layer == 0:
+@@ -55,7 +55,7 @@
+         numberofelements = md.mesh.numberofelements2d
+ 
+     # Build some variables
+-    if md.mesh.dimension() == 3 and layer == 0:
++    if (md.mesh.dimension() == 3) & (layer == 0):
+         rep = 6
+         areas = GetAreas(index, md.mesh.x, md.mesh.y, md.mesh.z)
+     elif md.mesh.dimension() == 2:
+@@ -66,18 +66,18 @@
+         areas = GetAreas(index, md.mesh.x2d, md.mesh.y2d)
+ 
+     index = index - 1  # Python indexes from zero
+-    line = index.flatten()
++    line=index.T.flatten()
+     areas = np.vstack(areas).reshape(-1, )
+-    summation = 1. / rep * np.ones(rep, )
++    summation = 1. / rep * np.ones((rep,1) )
+     linesize = rep * numberofelements
+ 
+-    # Update weights that holds the volume of all the element holding the node i
+-    weights = csc_matrix((np.tile(areas, (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
++    # Update weights that hold the volume of all the element holding the node i
++    weights = csc_matrix((np.tile(areas, (1, rep)).reshape(-1,), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+ 
+     # Initialization
+     if len(data) == numberofelements:
+-        average_node = csc_matrix((np.tile(areas * data, (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+-        average_node = average_node / weights
++        average_node = csc_matrix((np.tile(np.multiply(areas,data), (1, rep)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
++        average_node = np.divide(average_node,weights)
+         average_node = csc_matrix(average_node)
+     else:
+         average_node = csc_matrix(data.reshape(-1, 1))
+@@ -84,9 +84,9 @@
+ 
+     # Loop over iteration
+     for i in np.arange(1, iterations + 1):
+-        average_el = np.asarray(np.dot(average_node.todense()[index].reshape(numberofelements, rep), np.vstack(summation))).reshape(-1, )
+-        average_node = csc_matrix((np.tile(areas * average_el.reshape(-1), (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+-        average_node = average_node / weights
++        average_el = np.asarray(average_node.todense()[index].reshape(numberofelements, rep)*summation).reshape(-1, )
++        average_node = csc_matrix((np.tile(np.multiply(areas,average_el.reshape(-1)), (1, rep)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
++        average_node = np.divide(average_node,weights)
+         average_node = csc_matrix(average_node)
+ 
+     # Return output as a full matrix (C code does not like sparse matrices)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26376-26377.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26376-26377.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26376-26377.diff	(revision 26740)
@@ -0,0 +1,202 @@
+Index: ../trunk-jpl/src/wrappers/javascript/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26376)
++++ ../trunk-jpl/src/wrappers/javascript/Makefile.am	(revision 26377)
+@@ -66,7 +66,7 @@
+ #}}}
+ # Module sources and dependencies {{{
+ if !WINDOWS
+-libISSMJavascript_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(MPILIB) $(PETSCLIB) $(MKLLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB) 
++libISSMJavascript_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(MPILIB) $(PETSCLIB) $(MKLLIB) $(GSLLIB) $(MATHLIB)
+ endif
+ 
+ if STANDALONE_LIBRARIES
+@@ -75,7 +75,7 @@
+ endif
+ 
+ if !WINDOWS
+-libISSMApi_la_LIBADD = $(MPILIB) $(PETSCLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB) $(MEXLIB)
++libISSMApi_la_LIBADD = $(MPILIB) $(PETSCLIB) $(GSLLIB) $(MATHLIB) $(MEXLIB)
+ endif
+ 
+ if STANDALONE_LIBRARIES
+Index: ../trunk-jpl/src/wrappers/python/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26376)
++++ ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 26377)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@
++AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @PARMETISINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @CODIPACKINCL@ @PROJINCL@
+ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+@@ -100,7 +100,7 @@
+ AM_CXXFLAGS += $(CXXOPTFLAGS)
+ #}}}
+ # Module sources and dependencies {{{
+-libISSMPython_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB)
++libISSMPython_la_LIBADD = ./../../c/libISSMCore.la ./../../c/libISSMModules.la $(PETSCLIB) $(HDF5LIB) $(MPILIB) $(NEOPZLIB) $(MKLLIB) $(GSLLIB) $(MATHLIB)
+ 
+ if STANDALONE_LIBRARIES
+ libISSMPython_la_LDFLAGS = -static
+@@ -108,61 +108,61 @@
+ deps += $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(CHACOLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
+ endif
+ 
+-libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB) $(MATHLIB)
++libISSMApi_la_LIBADD = $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(MATHLIB)
+ 
+ BamgConvertMesh_python_la_SOURCES = ../BamgConvertMesh/BamgConvertMesh.cpp
+ BamgConvertMesh_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgConvertMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++BamgConvertMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ BamgMesher_python_la_SOURCES = ../BamgMesher/BamgMesher.cpp
+ BamgMesher_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgMesher_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++BamgMesher_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ BamgTriangulate_python_la_SOURCES = ../BamgTriangulate/BamgTriangulate.cpp
+ BamgTriangulate_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-BamgTriangulate_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++BamgTriangulate_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ if CHACO
+ Chaco_python_la_SOURCES = ../Chaco/Chaco.cpp
+ Chaco_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Chaco_python_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++Chaco_python_la_LIBADD = ${deps} $(CHACOLIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ endif
+ 
+ ContourToMesh_python_la_SOURCES = ../ContourToMesh/ContourToMesh.cpp
+ ContourToMesh_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++ContourToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ ContourToNodes_python_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp
+ ContourToNodes_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ContourToNodes_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++ContourToNodes_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ ElementConnectivity_python_la_SOURCES = ../ElementConnectivity/ElementConnectivity.cpp
+ ElementConnectivity_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ElementConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++ElementConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ ExpToLevelSet_python_la_SOURCES = ../ExpToLevelSet/ExpToLevelSet.cpp
+ ExpToLevelSet_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ExpToLevelSet_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB) $(NEOPZLIB)
++ExpToLevelSet_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(NEOPZLIB)
+ 
+ InterpFromMesh2d_python_la_SOURCES = ../InterpFromMesh2d/InterpFromMesh2d.cpp
+ InterpFromMesh2d_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++InterpFromMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ InterpFromGridToMesh_python_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp
+ InterpFromGridToMesh_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromGridToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++InterpFromGridToMesh_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ InterpFromMeshToGrid_python_la_SOURCES = ../InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
+ InterpFromMeshToGrid_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToGrid_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++InterpFromMeshToGrid_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ InterpFromMeshToMesh2d_python_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
+ InterpFromMeshToMesh2d_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJ4LIB)
++InterpFromMeshToMesh2d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB)
+ 
+ InterpFromMeshToMesh3d_python_la_SOURCES = ../InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
+ InterpFromMeshToMesh3d_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-InterpFromMeshToMesh3d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB) $(PROJ4LIB)
++InterpFromMeshToMesh3d_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(MULTITHREADINGLIB) $(GSLLIB)
+ 
+ IssmConfig_python_la_SOURCES = ../IssmConfig/IssmConfig.cpp
+ IssmConfig_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+@@ -170,21 +170,21 @@
+ 
+ MeshPartition_python_la_SOURCES = ../MeshPartition/MeshPartition.cpp
+ MeshPartition_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshPartition_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(METISLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++MeshPartition_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(METISLIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ MeshProfileIntersection_python_la_SOURCES = ../MeshProfileIntersection/MeshProfileIntersection.cpp
+ MeshProfileIntersection_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-MeshProfileIntersection_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++MeshProfileIntersection_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ NodeConnectivity_python_la_SOURCES = ../NodeConnectivity/NodeConnectivity.cpp
+ NodeConnectivity_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-NodeConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++NodeConnectivity_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ Triangle_python_la_SOURCES = ../Triangle/Triangle.cpp
+ Triangle_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-Triangle_python_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++Triangle_python_la_LIBADD = ${deps} $(TRIANGLELIB) $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ 
+ ProcessRifts_python_la_SOURCES = ../ProcessRifts/ProcessRifts.cpp
+ ProcessRifts_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+-ProcessRifts_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB) $(PROJ4LIB)
++ProcessRifts_python_la_LIBADD = ${deps} $(PETSCLIB) $(HDF5LIB) $(BLASLAPACKLIB) $(MPILIB) $(NEOPZLIB) $(GSLLIB)
+ #}}}
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26376)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26377)
+@@ -816,7 +816,11 @@
+ 			AC_MSG_ERROR([Python.h not found! Please locate this file and contact ISSM developers via forum or email.]);
+ 		fi
+ 		AC_MSG_RESULT([found])
+-		if ls ${PYTHON_ROOT}/lib/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
++		if ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
++			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}m"
++		elif ls ${PYTHON_ROOT}/lib/x86_64-linux-gnu/libpython${PYTHON_VERSION}.* 1> /dev/null 2>&1; then
++			PYTHONLIB="-L${PYTHON_ROOT}/lib/x86_64-linux-gnu -lpython${PYTHON_VERSION}"
++		elif ls ${PYTHON_ROOT}/lib/libpython${PYTHON_VERSION}m.* 1> /dev/null 2>&1; then
+ 			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}m"
+ 		else
+ 			PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}"
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26376)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26377)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @PARMETISINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @PARMETISINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@ @PROJINCL@
+ AM_FCFLAGS = @SEMICINCL@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+@@ -363,10 +363,10 @@
+ 	./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp \
+ 	./modules/ModelProcessorx/Dakota/UpdateElementsAndMaterialsDakota.cpp \
+ 	./cores/dakota_core.cpp
+-if SYSTEM_HAS_FMEMOPEN
++# if SYSTEM_HAS_FMEMOPEN
+ issm_sources += ./modules/QmuStatisticsx/QmuStatisticsx.cpp
++# endif
+ endif
+-endif
+ #}}}
+ # PETSc sources {{{
+ if PETSC
+@@ -710,7 +710,7 @@
+ 
+ if !WINDOWS
+ if !STANDALONE_LIBRARIES
+-libISSMCore_la_LIBADD = $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(OSLIBS)
++libISSMCore_la_LIBADD = $(CHACOLIB) $(DAKOTALIB) $(PETSCLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(PARMETISLIB) $(METISLIB) $(HDF5LIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(SUPERLULIB) $(SPOOLESLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(SCOTCHLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(GSLLIB) $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJLIB) $(OSLIBS)
+ if FORTRAN
+ libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
+ endif
+@@ -815,7 +815,7 @@
+ endif
+ 
+ # Standard libraries
+-LDADD = ./libISSMCore.la 
++LDADD = ./libISSMCore.la
+ 
+ if !MSYS2
+ LDADD += ./libISSMOverload.la
Index: /issm/oecreview/Archive/25834-26739/ISSM-26377-26378.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26377-26378.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26377-26378.diff	(revision 26740)
@@ -0,0 +1,115 @@
+Index: ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh	(revision 26377)
++++ ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh	(revision 26378)
+@@ -6,7 +6,7 @@
+ #
+ VER="8.1.0"
+ 
+-PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++PREFIX="${ISSM_EXT_STATIC_DIR}/proj/install" # Set to location where external package should be installed
+ 
+ ## Environment
+ #
+@@ -13,6 +13,17 @@
+ export CC=mpicc
+ export CXX=mpicxx
+ 
++# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
++# requires,
++#
++#	SQLITE3_LIBS="-lsqlite3".
++#
++# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
++#
++#	`apt-get install sqlite3 libsqlite3-dev`
++#
++export SQLITE3_LIBS="-lsqlite3"
++
+ # Cleanup
+ rm -rf ${PREFIX} src
+ mkdir -p ${PREFIX} src
+Index: ../trunk-jpl/externalpackages/proj/install-8-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-static.sh	(revision 26377)
++++ ../trunk-jpl/externalpackages/proj/install-8-static.sh	(revision 26378)
+@@ -6,7 +6,7 @@
+ #
+ VER="8.1.0"
+ 
+-PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++PREFIX="${ISSM_EXT_STATIC_DIR}/proj/install" # Set to location where external package should be installed
+ 
+ ## Environment
+ #
+@@ -13,6 +13,17 @@
+ export CC=mpicc
+ export CXX=mpicxx
+ 
++# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
++# requires,
++#
++#	SQLITE3_LIBS="-lsqlite3".
++#
++# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
++#
++#	`apt-get install sqlite3 libsqlite3-dev`
++#
++export SQLITE3_LIBS="-lsqlite3"
++
+ # Cleanup
+ rm -rf ${PREFIX} src
+ mkdir -p ${PREFIX} src
+Index: ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh	(revision 26377)
++++ ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh	(revision 26378)
+@@ -6,7 +6,7 @@
+ #
+ VER="8.1.0"
+ 
+-PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
++PREFIX="${ISSM_EXT_SHARED_DIR}/proj/install" # Set to location where external package should be installed
+ 
+ ## Environment
+ #
+@@ -13,6 +13,17 @@
+ export CC=mpicc
+ export CXX=mpicxx
+ 
++# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
++# requires,
++#
++#	SQLITE3_LIBS="-lsqlite3".
++#
++# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
++#
++#	`apt-get install sqlite3 libsqlite3-dev`
++#
++export SQLITE3_LIBS="-lsqlite3"
++
+ # Cleanup
+ rm -rf ${PREFIX} src
+ mkdir -p ${PREFIX} src
+Index: ../trunk-jpl/externalpackages/proj/install-8.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8.sh	(revision 26377)
++++ ../trunk-jpl/externalpackages/proj/install-8.sh	(revision 26378)
+@@ -13,6 +13,17 @@
+ export CC=mpicc
+ export CXX=mpicxx
+ 
++# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently 
++# requires,
++#
++#	SQLITE3_LIBS="-lsqlite3".
++#
++# On Ubuntu Linux, install the SQLite3 binary, libraries and headers with,
++#
++#	`apt-get install sqlite3 libsqlite3-dev`
++#
++export SQLITE3_LIBS="-lsqlite3"
++
+ # Cleanup
+ rm -rf ${PREFIX} src
+ mkdir -p ${PREFIX} src
Index: /issm/oecreview/Archive/25834-26739/ISSM-26378-26379.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26378-26379.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26378-26379.diff	(revision 26740)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.15-mac-arm.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.15-mac-arm.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.15-mac-arm.sh	(revision 26379)
+@@ -0,0 +1,56 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++VER="3.15.2"
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf install src
++mkdir install src
++
++# Move source to 'src' directory
++mv petsc-${VER}/* src/
++rm -rf petsc-${VER}
++
++# Configure
++#
++# NOTE:
++# - Added -fallow-argument-mismatch to FFLAGS in order to clear,
++#
++#		error: The Fortran compiler gfortran will not compile files that call 
++#		the same routine with arguments of different types.
++#
++#	for gfortran 10 or later (may need to remove it for earlier versions).
++# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
++#	(may need to remove it for earlier versions not using the C99 standard).
++#
++cd src
++./config/configure.py \
++	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
++	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--CFLAGS="-Wno-error=implicit-function-declaration" \
++	--FFLAGS="-fallow-argument-mismatch" \
++	--LDFLAGS="-Wl,-no_compact_unwind" \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-pic=1 \
++	--download-fblaslapack=1 \
++	--download-mpich=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-scalapack=1 \
++	--download-mumps=1 \
++	--download-zlib=1 
++
++# Compile and install
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.15-mac-arm.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26379-26380.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26379-26380.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26379-26380.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26379)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26380)
+@@ -363,10 +363,10 @@
+ 	./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp \
+ 	./modules/ModelProcessorx/Dakota/UpdateElementsAndMaterialsDakota.cpp \
+ 	./cores/dakota_core.cpp
+-# if SYSTEM_HAS_FMEMOPEN
++if SYSTEM_HAS_FMEMOPEN
+ issm_sources += ./modules/QmuStatisticsx/QmuStatisticsx.cpp
+-# endif
+ endif
++endif
+ #}}}
+ # PETSc sources {{{
+ if PETSC
Index: /issm/oecreview/Archive/25834-26739/ISSM-26380-26381.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26380-26381.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26380-26381.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh	(revision 26380)
++++ ../trunk-jpl/externalpackages/proj/install-8-static-with_tests.sh	(revision 26381)
+@@ -45,7 +45,7 @@
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+ 	--disable-shared \
+-	--disable-libtiff
++	--disable-tiff
+ 
+ # Compile and install
+ if [ $# -eq 0 ]; then
+Index: ../trunk-jpl/externalpackages/proj/install-8-static.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-static.sh	(revision 26380)
++++ ../trunk-jpl/externalpackages/proj/install-8-static.sh	(revision 26381)
+@@ -45,7 +45,7 @@
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+ 	--disable-shared \
+-	--disable-libtiff
++	--disable-tiff
+ 
+ # Compile and install
+ if [ $# -eq 0 ]; then
+Index: ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh	(revision 26380)
++++ ../trunk-jpl/externalpackages/proj/install-8-with_tests.sh	(revision 26381)
+@@ -44,7 +44,7 @@
+ 	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+-	--disable-libtiff
++	--disable-tiff
+ 
+ # Compile and install
+ if [ $# -eq 0 ]; then
+Index: ../trunk-jpl/externalpackages/proj/install-8.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-8.sh	(revision 26380)
++++ ../trunk-jpl/externalpackages/proj/install-8.sh	(revision 26381)
+@@ -44,7 +44,7 @@
+ 	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+ 	--enable-fast-install \
+-	--disable-libtiff
++	--disable-tiff
+ 
+ # Compile and install
+ if [ $# -eq 0 ]; then
Index: /issm/oecreview/Archive/25834-26739/ISSM-26381-26382.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26381-26382.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26381-26382.diff	(revision 26740)
@@ -0,0 +1,284 @@
+Index: ../trunk-jpl/src/m/plot/colormaps/turbo.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/colormaps/turbo.m	(nonexistent)
++++ ../trunk-jpl/src/m/plot/colormaps/turbo.m	(revision 26382)
+@@ -0,0 +1,279 @@
++function map = turbo(m)
++%TURBO   Turbo colormap.
++%   TURBO(M) returns an M-by-3 matrix containing the turbo colormap, a
++%   variant of the jet colormap that is more perceptually uniform.
++%
++%   See also JET, COLORMAP.
++%	 
++%		Daniel Fortunato (2021). turbo (https://www.mathworks.com/matlabcentral/fileexchange/74662-turbo), MATLAB Central File Exchange. Retrieved August 4, 2021. 
++%
++%	more info: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html
++%
++if nargin < 1
++   f = get(groot,'CurrentFigure');
++   if isempty(f)
++      m = size(get(groot,'DefaultFigureColormap'),1);
++   else
++      m = size(f.Colormap,1);
++   end
++end
++values = [
++     0.18995, 0.07176, 0.23217;
++     0.19483, 0.08339, 0.26149;
++     0.19956, 0.09498, 0.29024;
++     0.20415, 0.10652, 0.31844;
++     0.20860, 0.11802, 0.34607;
++     0.21291, 0.12947, 0.37314;
++     0.21708, 0.14087, 0.39964;
++     0.22111, 0.15223, 0.42558;
++     0.22500, 0.16354, 0.45096;
++     0.22875, 0.17481, 0.47578;
++     0.23236, 0.18603, 0.50004;
++     0.23582, 0.19720, 0.52373;
++     0.23915, 0.20833, 0.54686;
++     0.24234, 0.21941, 0.56942;
++     0.24539, 0.23044, 0.59142;
++     0.24830, 0.24143, 0.61286;
++     0.25107, 0.25237, 0.63374;
++     0.25369, 0.26327, 0.65406;
++     0.25618, 0.27412, 0.67381;
++     0.25853, 0.28492, 0.69300;
++     0.26074, 0.29568, 0.71162;
++     0.26280, 0.30639, 0.72968;
++     0.26473, 0.31706, 0.74718;
++     0.26652, 0.32768, 0.76412;
++     0.26816, 0.33825, 0.78050;
++     0.26967, 0.34878, 0.79631;
++     0.27103, 0.35926, 0.81156;
++     0.27226, 0.36970, 0.82624;
++     0.27334, 0.38008, 0.84037;
++     0.27429, 0.39043, 0.85393;
++     0.27509, 0.40072, 0.86692;
++     0.27576, 0.41097, 0.87936;
++     0.27628, 0.42118, 0.89123;
++     0.27667, 0.43134, 0.90254;
++     0.27691, 0.44145, 0.91328;
++     0.27701, 0.45152, 0.92347;
++     0.27698, 0.46153, 0.93309;
++     0.27680, 0.47151, 0.94214;
++     0.27648, 0.48144, 0.95064;
++     0.27603, 0.49132, 0.95857;
++     0.27543, 0.50115, 0.96594;
++     0.27469, 0.51094, 0.97275;
++     0.27381, 0.52069, 0.97899;
++     0.27273, 0.53040, 0.98461;
++     0.27106, 0.54015, 0.98930;
++     0.26878, 0.54995, 0.99303;
++     0.26592, 0.55979, 0.99583;
++     0.26252, 0.56967, 0.99773;
++     0.25862, 0.57958, 0.99876;
++     0.25425, 0.58950, 0.99896;
++     0.24946, 0.59943, 0.99835;
++     0.24427, 0.60937, 0.99697;
++     0.23874, 0.61931, 0.99485;
++     0.23288, 0.62923, 0.99202;
++     0.22676, 0.63913, 0.98851;
++     0.22039, 0.64901, 0.98436;
++     0.21382, 0.65886, 0.97959;
++     0.20708, 0.66866, 0.97423;
++     0.20021, 0.67842, 0.96833;
++     0.19326, 0.68812, 0.96190;
++     0.18625, 0.69775, 0.95498;
++     0.17923, 0.70732, 0.94761;
++     0.17223, 0.71680, 0.93981;
++     0.16529, 0.72620, 0.93161;
++     0.15844, 0.73551, 0.92305;
++     0.15173, 0.74472, 0.91416;
++     0.14519, 0.75381, 0.90496;
++     0.13886, 0.76279, 0.89550;
++     0.13278, 0.77165, 0.88580;
++     0.12698, 0.78037, 0.87590;
++     0.12151, 0.78896, 0.86581;
++     0.11639, 0.79740, 0.85559;
++     0.11167, 0.80569, 0.84525;
++     0.10738, 0.81381, 0.83484;
++     0.10357, 0.82177, 0.82437;
++     0.10026, 0.82955, 0.81389;
++     0.09750, 0.83714, 0.80342;
++     0.09532, 0.84455, 0.79299;
++     0.09377, 0.85175, 0.78264;
++     0.09287, 0.85875, 0.77240;
++     0.09267, 0.86554, 0.76230;
++     0.09320, 0.87211, 0.75237;
++     0.09451, 0.87844, 0.74265;
++     0.09662, 0.88454, 0.73316;
++     0.09958, 0.89040, 0.72393;
++     0.10342, 0.89600, 0.71500;
++     0.10815, 0.90142, 0.70599;
++     0.11374, 0.90673, 0.69651;
++     0.12014, 0.91193, 0.68660;
++     0.12733, 0.91701, 0.67627;
++     0.13526, 0.92197, 0.66556;
++     0.14391, 0.92680, 0.65448;
++     0.15323, 0.93151, 0.64308;
++     0.16319, 0.93609, 0.63137;
++     0.17377, 0.94053, 0.61938;
++     0.18491, 0.94484, 0.60713;
++     0.19659, 0.94901, 0.59466;
++     0.20877, 0.95304, 0.58199;
++     0.22142, 0.95692, 0.56914;
++     0.23449, 0.96065, 0.55614;
++     0.24797, 0.96423, 0.54303;
++     0.26180, 0.96765, 0.52981;
++     0.27597, 0.97092, 0.51653;
++     0.29042, 0.97403, 0.50321;
++     0.30513, 0.97697, 0.48987;
++     0.32006, 0.97974, 0.47654;
++     0.33517, 0.98234, 0.46325;
++     0.35043, 0.98477, 0.45002;
++     0.36581, 0.98702, 0.43688;
++     0.38127, 0.98909, 0.42386;
++     0.39678, 0.99098, 0.41098;
++     0.41229, 0.99268, 0.39826;
++     0.42778, 0.99419, 0.38575;
++     0.44321, 0.99551, 0.37345;
++     0.45854, 0.99663, 0.36140;
++     0.47375, 0.99755, 0.34963;
++     0.48879, 0.99828, 0.33816;
++     0.50362, 0.99879, 0.32701;
++     0.51822, 0.99910, 0.31622;
++     0.53255, 0.99919, 0.30581;
++     0.54658, 0.99907, 0.29581;
++     0.56026, 0.99873, 0.28623;
++     0.57357, 0.99817, 0.27712;
++     0.58646, 0.99739, 0.26849;
++     0.59891, 0.99638, 0.26038;
++     0.61088, 0.99514, 0.25280;
++     0.62233, 0.99366, 0.24579;
++     0.63323, 0.99195, 0.23937;
++     0.64362, 0.98999, 0.23356;
++     0.65394, 0.98775, 0.22835;
++     0.66428, 0.98524, 0.22370;
++     0.67462, 0.98246, 0.21960;
++     0.68494, 0.97941, 0.21602;
++     0.69525, 0.97610, 0.21294;
++     0.70553, 0.97255, 0.21032;
++     0.71577, 0.96875, 0.20815;
++     0.72596, 0.96470, 0.20640;
++     0.73610, 0.96043, 0.20504;
++     0.74617, 0.95593, 0.20406;
++     0.75617, 0.95121, 0.20343;
++     0.76608, 0.94627, 0.20311;
++     0.77591, 0.94113, 0.20310;
++     0.78563, 0.93579, 0.20336;
++     0.79524, 0.93025, 0.20386;
++     0.80473, 0.92452, 0.20459;
++     0.81410, 0.91861, 0.20552;
++     0.82333, 0.91253, 0.20663;
++     0.83241, 0.90627, 0.20788;
++     0.84133, 0.89986, 0.20926;
++     0.85010, 0.89328, 0.21074;
++     0.85868, 0.88655, 0.21230;
++     0.86709, 0.87968, 0.21391;
++     0.87530, 0.87267, 0.21555;
++     0.88331, 0.86553, 0.21719;
++     0.89112, 0.85826, 0.21880;
++     0.89870, 0.85087, 0.22038;
++     0.90605, 0.84337, 0.22188;
++     0.91317, 0.83576, 0.22328;
++     0.92004, 0.82806, 0.22456;
++     0.92666, 0.82025, 0.22570;
++     0.93301, 0.81236, 0.22667;
++     0.93909, 0.80439, 0.22744;
++     0.94489, 0.79634, 0.22800;
++     0.95039, 0.78823, 0.22831;
++     0.95560, 0.78005, 0.22836;
++     0.96049, 0.77181, 0.22811;
++     0.96507, 0.76352, 0.22754;
++     0.96931, 0.75519, 0.22663;
++     0.97323, 0.74682, 0.22536;
++     0.97679, 0.73842, 0.22369;
++     0.98000, 0.73000, 0.22161;
++     0.98289, 0.72140, 0.21918;
++     0.98549, 0.71250, 0.21650;
++     0.98781, 0.70330, 0.21358;
++     0.98986, 0.69382, 0.21043;
++     0.99163, 0.68408, 0.20706;
++     0.99314, 0.67408, 0.20348;
++     0.99438, 0.66386, 0.19971;
++     0.99535, 0.65341, 0.19577;
++     0.99607, 0.64277, 0.19165;
++     0.99654, 0.63193, 0.18738;
++     0.99675, 0.62093, 0.18297;
++     0.99672, 0.60977, 0.17842;
++     0.99644, 0.59846, 0.17376;
++     0.99593, 0.58703, 0.16899;
++     0.99517, 0.57549, 0.16412;
++     0.99419, 0.56386, 0.15918;
++     0.99297, 0.55214, 0.15417;
++     0.99153, 0.54036, 0.14910;
++     0.98987, 0.52854, 0.14398;
++     0.98799, 0.51667, 0.13883;
++     0.98590, 0.50479, 0.13367;
++     0.98360, 0.49291, 0.12849;
++     0.98108, 0.48104, 0.12332;
++     0.97837, 0.46920, 0.11817;
++     0.97545, 0.45740, 0.11305;
++     0.97234, 0.44565, 0.10797;
++     0.96904, 0.43399, 0.10294;
++     0.96555, 0.42241, 0.09798;
++     0.96187, 0.41093, 0.09310;
++     0.95801, 0.39958, 0.08831;
++     0.95398, 0.38836, 0.08362;
++     0.94977, 0.37729, 0.07905;
++     0.94538, 0.36638, 0.07461;
++     0.94084, 0.35566, 0.07031;
++     0.93612, 0.34513, 0.06616;
++     0.93125, 0.33482, 0.06218;
++     0.92623, 0.32473, 0.05837;
++     0.92105, 0.31489, 0.05475;
++     0.91572, 0.30530, 0.05134;
++     0.91024, 0.29599, 0.04814;
++     0.90463, 0.28696, 0.04516;
++     0.89888, 0.27824, 0.04243;
++     0.89298, 0.26981, 0.03993;
++     0.88691, 0.26152, 0.03753;
++     0.88066, 0.25334, 0.03521;
++     0.87422, 0.24526, 0.03297;
++     0.86760, 0.23730, 0.03082;
++     0.86079, 0.22945, 0.02875;
++     0.85380, 0.22170, 0.02677;
++     0.84662, 0.21407, 0.02487;
++     0.83926, 0.20654, 0.02305;
++     0.83172, 0.19912, 0.02131;
++     0.82399, 0.19182, 0.01966;
++     0.81608, 0.18462, 0.01809;
++     0.80799, 0.17753, 0.01660;
++     0.79971, 0.17055, 0.01520;
++     0.79125, 0.16368, 0.01387;
++     0.78260, 0.15693, 0.01264;
++     0.77377, 0.15028, 0.01148;
++     0.76476, 0.14374, 0.01041;
++     0.75556, 0.13731, 0.00942;
++     0.74617, 0.13098, 0.00851;
++     0.73661, 0.12477, 0.00769;
++     0.72686, 0.11867, 0.00695;
++     0.71692, 0.11268, 0.00629;
++     0.70680, 0.10680, 0.00571;
++     0.69650, 0.10102, 0.00522;
++     0.68602, 0.09536, 0.00481;
++     0.67535, 0.08980, 0.00449;
++     0.66449, 0.08436, 0.00424;
++     0.65345, 0.07902, 0.00408;
++     0.64223, 0.07380, 0.00401;
++     0.63082, 0.06868, 0.00401;
++     0.61923, 0.06367, 0.00410;
++     0.60746, 0.05878, 0.00427;
++     0.59550, 0.05399, 0.00453;
++     0.58336, 0.04931, 0.00486;
++     0.57103, 0.04474, 0.00529;
++     0.55852, 0.04028, 0.00579;
++     0.54583, 0.03593, 0.00638;
++     0.53295, 0.03169, 0.00705;
++     0.51989, 0.02756, 0.00780;
++     0.50664, 0.02354, 0.00863;
++     0.49321, 0.01963, 0.00955;
++     0.47960, 0.01583, 0.01055];
++P = size(values,1);
++map = interp1(1:P, values, linspace(1,P,m), 'linear');
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26382-26383.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26382-26383.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26382-26383.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/src/m/solvers/asmoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmoptions.py	(revision 26382)
++++ ../trunk-jpl/src/m/solvers/asmoptions.py	(revision 26383)
+@@ -1,6 +1,6 @@
++from collections import OrderedDict
+ from pairoptions import pairoptions
+ 
+-
+ def asmoptions(*args):
+     #ASMOPTIONS - return ASM petsc options
+     #
+@@ -34,4 +34,9 @@
+         if not found:
+             #this option did not exist, add it:
+             options.append([arg1, arg2])
+-    return options
++
++    asmoptions = OrderedDict()
++    for j in range(len(options)):
++        asmoptions[options[j][0]]=options[j][1]
++
++    return asmoptions
Index: /issm/oecreview/Archive/25834-26739/ISSM-26383-26384.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26383-26384.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26383-26384.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26383)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26384)
+@@ -939,7 +939,7 @@
+ 	dnl ESMF libraries and header files
+ 	if test "x${HAVE_ESMF}" == "xyes"; then
+ 		ESMFINCL="-I${ESMF_ROOT}/include"
+-		ESMFLIB="-L${ESMF_ROOT}/lib -lesmf"
++		ESMFLIB="-L${ESMF_ROOT}/lib/libO/Linux.gfortran.64.mpich.default/ -lesmf"
+ 		AC_DEFINE([_HAVE_ESMF_], [1], [with ESMF in ISSM src])
+ 		AC_SUBST([ESMFINCL])
+ 		AC_SUBST([ESMFLIB])
+@@ -1762,6 +1762,7 @@
+ 		AC_DEFINE([_HAVE_SHAPELIB_], [1], [with shapelib in ISSM src])
+ 		AC_SUBST([SHAPELIBINCL])
+ 		AC_SUBST([SHAPELIBLIB])
++		AM_CONDITIONAL([SHP], [test "x${HAVE_SHAPELIB}" == "xyes"])
+ 	fi
+ 	dnl }}}
+ 	dnl ScaLAPACK{{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26384-26385.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26384-26385.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26384-26385.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26384)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26385)
+@@ -78,7 +78,7 @@
+ if KRIGING
+ lib_LTLIBRARIES += Kriging_matlab.la
+ endif
+-if KML
++if SHP
+ lib_LTLIBRARIES += ShpRead_matlab.la
+ endif
+ if PROJ
Index: /issm/oecreview/Archive/25834-26739/ISSM-26385-26386.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26385-26386.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26385-26386.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/src/m/modules/ShpRead.m
+===================================================================
+--- ../trunk-jpl/src/m/modules/ShpRead.m	(revision 26385)
++++ ../trunk-jpl/src/m/modules/ShpRead.m	(revision 26386)
+@@ -1,14 +1,13 @@
+-function ShpRead(filename);
++function structout = ShpRead(filename);
+ %	SHPREAD - Read shapefile
+ %	
+ %	   This module reads shapefiles and converts them to matlab/python structures
+ %	
+ %	   Usage:
+-%	      ShpRead(filename);
+-%	      filexp:      file name of exp file to be written
++%	      structout = ShpRead(filename);
+ %	
+ %	   Examples:
+-%	      ShpRead('file.shp');
++%	      structout = ShpRead('file.shp');
+ 
+ % Check usage
+ if nargin~=1
+@@ -17,4 +16,4 @@
+ end
+ 
+ % Call mex module
+-ShpRead_matlab(filename);
++structout = ShpRead_matlab(filename);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26386-26387.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26386-26387.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26386-26387.diff	(revision 26740)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/wrappers/ShpRead/ShpRead.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/ShpRead/ShpRead.cpp	(revision 26386)
++++ ../trunk-jpl/src/wrappers/ShpRead/ShpRead.cpp	(revision 26387)
+@@ -66,11 +66,14 @@
+ 		Contour<double> *contour = NULL;
+ 
+ 		switch(psShape->nSHPType){
++			case SHPT_POINTZ:
++				contour=new Contour<double>(0,psShape->nVertices,psShape->padfX,psShape->padfY,false);
++				break;
+ 			case SHPT_ARC:
+ 				contour=new Contour<double>(0,psShape->nVertices,psShape->padfX,psShape->padfY,false);
+ 				break;
+ 			default:
+-				_printf_("Shape type "<<SHPTypeName(psShape->nSHPType)<<"not supported yet, skipping...\n");
++				_printf_("Shape type "<<SHPTypeName(psShape->nSHPType)<<" not supported yet, skipping...\n");
+ 		}
+ 
+ 		/*Add to contours and clean up*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26387-26388.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26387-26388.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26387-26388.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 26387)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 26388)
+@@ -35,7 +35,7 @@
+ 	for(int i = 0;i<nummodels;i++) nodes[i]       = new Nodes();
+ 
+ 	/*Partition Elements and Nodes*/
+-	ElementsAndVerticesPartitioning(iomodel);
++	if (iomodel->numberofelements > 0) ElementsAndVerticesPartitioning(iomodel);
+ 
+ 	/*Create elements, vertices and materials, independent of analysis_enum: */
+ 	CreateElements(elements,iomodel,nummodels);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26388-26389.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26388-26389.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26388-26389.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/stressbalance.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.py	(revision 26388)
++++ ../trunk-jpl/src/m/classes/stressbalance.py	(revision 26389)
+@@ -139,7 +139,7 @@
+             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)))):
++        if (not np.any(np.logical_or(np.logical_not(np.isnan(md.stressbalance.spcvx)), np.logical_not(np.isnan(md.stressbalance.spcvy))))) & (not np.any(md.mask.ocean_levelset>0)):
+             print("\n !!! Warning: no spc applied, model might not be well posed if no basal friction is applied, check for solution crash\n")
+         # CHECK THAT EACH LINES CONTAINS ONLY NAN VALUES OR NO NAN VALUES
+         #        if any(sum(isnan(md.stressbalance.referential), 2)~=0 & sum(isnan(md.stressbalance.referential), 2)~=6),
Index: /issm/oecreview/Archive/25834-26739/ISSM-26389-26390.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26389-26390.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26389-26390.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/src/m/classes/organizer.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/organizer.py	(revision 26389)
++++ ../trunk-jpl/src/m/classes/organizer.py	(revision 26390)
+@@ -8,7 +8,7 @@
+ #hack to keep python 2 compatipility
+ try:
+     #py3 import
+-    from dbm.ndbm import whichdb
++    import dbm
+ except ImportError:
+     #py2 import
+     from whichdb import whichdb
+@@ -109,10 +109,10 @@
+         path2 = os.path.join(self.repository, string)
+ 
+         #figure out if the model is there, otherwise, we have to use the default path supplied by user.
+-        if whichdb(path1):
++        if dbm.whichdb(path1):
+             md = loadmodel(path1)
+             return md
+-        elif whichdb(path2):
++        elif dbm.whichdb(path2):
+             md = loadmodel(path2)
+             return md
+ 
+@@ -158,7 +158,7 @@
+             bool = True
+ 
+             #last check: is this step locked?
+-				s = self.steps[self._currentstep - 1]['string']
++            s = self.steps[self._currentstep - 1]['string']
+             if len(s) > 7:
+                 if s[-6:] == 'Locked':
+                     raise Exception('organizer: you are trying to run a locked step! Unlock it first!')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26390-26391.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26390-26391.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26390-26391.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/matice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.py	(revision 26390)
++++ ../trunk-jpl/src/m/classes/matice.py	(revision 26391)
+@@ -136,7 +136,7 @@
+         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')
+         # NOTE: We first have to check if we have a NumPy array here
+-        if ((len(np.shape(self.rheology_B)) == 1 and (np.shape(self.rheology_B)[0] == md.mesh.numberofvertices or np.shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1)) or (len(np.shape(self.rheology_B)) == 2 and np.shape(self.rheology_B)[0] == md.mesh.numberofelements and np.shape(self.rheology_B)[1] > 1)):
++        if (((np.shape(self.rheology_B)[0] == md.mesh.numberofvertices) or (np.shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1)) or ((len(np.shape(self.rheology_B)) == 2) and (np.shape(self.rheology_B)[0] == md.mesh.numberofelements) and (np.shape(self.rheology_B)[1] > 1))):
+             mattype = 1
+             tsl = md.mesh.numberofvertices
+         else:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26391-26392.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26391-26392.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26391-26392.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26391)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26392)
+@@ -1762,8 +1762,8 @@
+ 		AC_DEFINE([_HAVE_SHAPELIB_], [1], [with shapelib in ISSM src])
+ 		AC_SUBST([SHAPELIBINCL])
+ 		AC_SUBST([SHAPELIBLIB])
+-		AM_CONDITIONAL([SHP], [test "x${HAVE_SHAPELIB}" == "xyes"])
+ 	fi
++	AM_CONDITIONAL([SHP], [test "x${HAVE_SHAPELIB}" == "xyes"])
+ 	dnl }}}
+ 	dnl ScaLAPACK{{{
+ 	dnl NOTE: User should supply path to root directory or libraries, but not both
Index: /issm/oecreview/Archive/25834-26739/ISSM-26392-26393.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26392-26393.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26392-26393.diff	(revision 26740)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/externalpackages/m1qn3/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/m1qn3/install.sh	(revision 26392)
++++ ../trunk-jpl/externalpackages/m1qn3/install.sh	(revision 26393)
+@@ -1,7 +1,6 @@
+ #!/bin/bash
+ set -eu
+ 
+-
+ ## Constants
+ #
+ VER=3.3
+@@ -22,6 +21,10 @@
+ mv m1qn3-${VER}-distrib/* src
+ rm -rf m1qn3-${VER}-distrib
+ 
++#patch
++#patch -u -b src/src/m1qn3.f -i patch/m1qn3.f.patch
++patch src/src/m1qn3.f patch/m1qn3.f.patch
++
+ if which ifort >/dev/null; then
+ 	FC="ifort"
+ else
+Index: ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch	(nonexistent)
++++ ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch	(revision 26393)
+@@ -0,0 +1,11 @@
++--- src/src/m1qn3.f	2009-10-20 06:39:35.000000000 -0400
+++++ m1qn3.f	2021-08-13 14:44:30.276019165 -0400
++@@ -802,7 +802,7 @@
++      &        "  iter  simul  stepsize            f                |g|",
++      &        "       |g|/|g0|"
++           write(io,
++-     &        '(1x,i5,2x,i5,2x,1pd8.2,2x,d21.14,2x,d11.5,2x,d10.4)')
+++     &        '(1x,i5,2x,i5,2x,1pd9.2,2x,d21.14,2x,d12.5,2x,d11.4)')
++      &        niter, isim, t, f, gnorm, eps1
++       endif
++       if (impres.ge.5) write (io,940) eps1
+Index: ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig
+===================================================================
+--- ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig	(nonexistent)
++++ ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig	(revision 26393)
+@@ -0,0 +1,4 @@
++805c805
++<      &        '(1x,i5,2x,i5,2x,1pd9.2,2x,d21.14,2x,d12.5,2x,d11.4)')
++---
++>      &        '(1x,i5,2x,i5,2x,1pd8.2,2x,d21.14,2x,d11.5,2x,d10.4)')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26393-26394.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26393-26394.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26393-26394.diff	(revision 26740)
@@ -0,0 +1,9 @@
+Index: ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig
+===================================================================
+--- ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig	(revision 26393)
++++ ../trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig	(nonexistent)
+@@ -1,4 +0,0 @@
+-805c805
+-<      &        '(1x,i5,2x,i5,2x,1pd9.2,2x,d21.14,2x,d12.5,2x,d11.4)')
+----
+->      &        '(1x,i5,2x,i5,2x,1pd8.2,2x,d21.14,2x,d11.5,2x,d10.4)')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26394-26395.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26394-26395.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26394-26395.diff	(revision 26740)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 26394)
++++ ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 26395)
+@@ -165,8 +165,8 @@
+     snwmf=snowfac*0.001;
+     smf=icefac*0.001;
+   }
+-  snwmf=0.95*snwmf;
+-  smf=0.95*smf;
++  //snwmf=0.95*snwmf;
++  //smf=0.95*smf;
+ 
+   /*****  compute PDD ablation and refreezing *****/
+   pddt = pdd *365;
+Index: ../trunk-jpl/test/Archives/Archive236.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive237.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive245.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive247.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26395-26396.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26395-26396.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26395-26396.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/test/Archives/Archive238.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive239.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive240.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26396-26397.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26396-26397.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26396-26397.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/clusters/discover.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26396)
++++ ../trunk-jpl/src/m/classes/clusters/discover.py	(revision 26397)
+@@ -134,7 +134,7 @@
+         fid.write('#SBATCH -e {}.errlog \n'.format(modelname))
+         fid.write('#SBATCH -n {} \n'.format(self.nprocs()))
+         fid.write('#SBATCH -N {} \n'.format(self.numnodes))
+-        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(floor(self.time / 3600), floor(self.time % 3600) / 60))
++        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(int(floor(self.time / 3600)), int(floor(self.time % 3600) / 60)))
+         fid.write('#SBATCH -A {} \n\n'.format(self.grouplist))
+         if (self.email.find('@')>-1):
+             fid.write('#SBATCH --mail-user={} \n'.format(self.email))
Index: /issm/oecreview/Archive/25834-26739/ISSM-26397-26398.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26397-26398.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26397-26398.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/coordsystems/ll2xy.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26397)
++++ ../trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26398)
+@@ -56,7 +56,7 @@
+ 
+     cnt1 = np.nonzero(latitude >= np.pi / 2.)[0]
+ 
+-    if cnt1:
++    if len(cnt1)>0:
+         x[cnt1, 0] = 0.0
+         y[cnt1, 0] = 0.0
+     return x, y
Index: /issm/oecreview/Archive/25834-26739/ISSM-26398-26399.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26398-26399.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26398-26399.diff	(revision 26740)
@@ -0,0 +1,41 @@
+Index: ../trunk-jpl/src/m/plot/subplotmodel.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/subplotmodel.m	(revision 26398)
++++ ../trunk-jpl/src/m/plot/subplotmodel.m	(revision 26399)
+@@ -4,6 +4,22 @@
+ %   Usage:
+ %      h=subplotmodel(nlines,ncols,i,options)
+ 
++box=getfieldvalue(options,'box','off');
++if strcmpi(box,'on'),
++	visible='on';
++else
++	visible='off';
++end
++
++%Do we specify axes?
++if exist(options,'axes')
++	ax = getfieldvalue(options,'axes');
++	ha = axes('Units','normalized', ...
++		'Position',ax,'XTickLabel','','YTickLabel','',...
++		'Visible',visible,'box',box);
++	return
++end
++
+ %Regular subplot
+ if ~exist(options,'tightsubplot')
+ 	if exist(options,'asymsubplot')
+@@ -24,13 +40,6 @@
+ width  = (1-sum(hmargin)-(ncols-1)*gap(2))/ncols;
+ ymin   = 1-vmargin(2)-height; 
+ 
+-box=getfieldvalue(options,'box','off');
+-if strcmpi(box,'on'),
+-	visible='on';
+-else
+-	visible='off';
+-end
+-
+ for i = 1:nlines
+ 	xmin = hmargin(1);
+ 	for j = 1:ncols
Index: /issm/oecreview/Archive/25834-26739/ISSM-26399-26400.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26399-26400.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26399-26400.diff	(revision 26740)
@@ -0,0 +1,55 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh	(revision 26400)
+@@ -0,0 +1,43 @@
++#!/bin/bash
++set -eu
++
++## Constants
++VER="3.15.3"
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf install src
++mkdir install src
++
++# Move source to 'src' directory
++mv petsc-${VER}/* src/
++rm -rf petsc-${VER}
++
++cd src
++./config/configure.py \
++        COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
++		  --with-make-np=20 \
++        --with-blas-lapack-dir=$MKL_ROOT \
++        --with-mpi-dir="/optnfs/el7/mpich/3.3-intel19.3/" \
++        --known-mpi-shared-libraries=1 \
++        --known-mpi-long-double=1 \
++        --known-mpi-int64_t=1 \
++        --known-mpi-c-double-complex=1 \
++        --with-debugging=0 \
++        --with-valgrind=0 \
++        --with-x=0 \
++        --with-ssl=0 \
++        --with-pic=1 \
++        --download-metis=1 \
++        --download-parmetis=1 \
++        --download-scalapack=1 \
++        --download-mumps=1
++
++# Compile and install
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26400-26401.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26400-26401.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26400-26401.diff	(revision 26740)
@@ -0,0 +1,66 @@
+Index: ../trunk-jpl/src/m/coordsystems/ll2xy.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26400)
++++ ../trunk-jpl/src/m/coordsystems/ll2xy.py	(revision 26401)
+@@ -1,7 +1,7 @@
+ import numpy as np
+ 
+ 
+-def ll2xy(lat, lon, sgn=-1, central_meridian=0, standard_parallel=71):
++def ll2xy(lat, lon, sgn, *args):
+     """LL2XY - converts lat lon to polar stereographic
+ 
+     Converts from geodetic latitude and longitude to Polar
+@@ -15,19 +15,32 @@
+     - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
+     						   -1 : south latitude (default is mer = 0  lat = 71)
+     """
+-
+     assert sgn == 1 or sgn == -1, 'error: sgn should be either 1 or -1'
+-
+-    #Get central_meridian and standard_parallel depending on hemisphere
+-    if sgn == 1:
+-        delta = 45
+-        slat = 70
+-        print('        ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70N Meridian: 45)')
++	 
++	 # Get central_meridian and standard_parallel depending on hemisphere
++    if len(args) == 2:
++       delta = args[0]
++       slat = args[1]
++    elif len(args) == 0:
++       if sgn == 1:
++          delta = 45.
++          slat = 70.
++          print('        ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70degN Meridian: 45deg)')
++       elif sgn == -1:
++          delta = 0.
++          slat = 71.
++          print('        ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71degS Meridian: 0deg)')
++       else:
++          raise ValueError('sgn should be either 1 or -1')
+     else:
+-        delta = central_meridian
+-        slat = standard_parallel
+-        print('        ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71S Meridian: 0)')
++       raise Exception('bad usage: type "help(ll2xy)" for details')
+ 
++    # if lat, lon passed as lists, convert to np.arrays
++    if type(lat) != "np.ndarray":
++       lat = np.array(lat)
++    if type(lon) != "np.ndarray":
++       lon = np.array(lon)
++
+     # Conversion constant from degrees to radians
+     #cde = 57.29577951
+     # Radius of the earth in meters
+@@ -57,6 +70,7 @@
+     cnt1 = np.nonzero(latitude >= np.pi / 2.)[0]
+ 
+     if len(cnt1)>0:
+-        x[cnt1, 0] = 0.0
+-        y[cnt1, 0] = 0.0
++        x[cnt1] = 0.0
++        y[cnt1] = 0.0
++
+     return x, y
Index: /issm/oecreview/Archive/25834-26739/ISSM-26401-26402.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26401-26402.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26401-26402.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/test/Archives/Archive247.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test247.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test247.m	(revision 26401)
++++ ../trunk-jpl/test/NightlyRun/test247.m	(revision 26402)
+@@ -1,5 +1,5 @@
+ %Test Name: SquareShelfTranIspddIsdeltaO18pdNoInterpSSA2d
+-md=triangle(model(),'../Exp/Square.exp',60000.);
++md=triangle(model(),'../Exp/Square.exp',180000.);
+ md=setmask(md,'all','');
+ md=parameterize(md,'../Par/SquareShelf.par');
+ 
+Index: ../trunk-jpl/test/NightlyRun/test247.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test247.py	(revision 26401)
++++ ../trunk-jpl/test/NightlyRun/test247.py	(revision 26402)
+@@ -12,7 +12,7 @@
+ 
+ from SMBpddSicopolis import *
+ 
+-md = triangle(model(), '../Exp/Square.exp', 60000.)
++md = triangle(model(), '../Exp/Square.exp', 180000.)
+ md = setmask(md, 'all', '')
+ md = parameterize(md, '../Par/SquareShelf.py')
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26402-26403.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26402-26403.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26402-26403.diff	(revision 26740)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26402)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26403)
+@@ -88,7 +88,7 @@
+ 	md.solidearth.lovenumbers = lovenumbers('maxdeg',10000);
+ 	md.solidearth.settings.reltol=NaN;
+ 	md.solidearth.settings.abstol=1e-3;
+-	md.solidearth.settings.computesealevelchange=1;
++	md.solidearth.settings.sealevelloading=1;
+ 	md.solidearth.settings.isgrd=1;
+ 	md.solidearth.settings.grdmodel=1;
+ 	md.solidearth.settings.maxiter=10; 
+@@ -114,7 +114,7 @@
+ 	disp('   Step 4: Solve Slr solver');
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+-	md.solidearth.settings.rigid=1;
++	md.solidearth.settings.viscous=0;
+ 	md.solidearth.settings.elastic=1;
+ 	md.solidearth.settings.rotation=1;
+ 
+@@ -206,8 +206,8 @@
+ 
+ 	% masstransport evalulates diff between the successive times, so we should cumsum. 
+ 	num_time = size(ice_load,2); 
+-	md.masstransport.spcthickness = [md.geometry.thickness + ice_load];
+-	md.masstransport.spcthickness(md.mesh.numberofvertices+1,:)=[0:num_time-1]; 
++	md.masstransport.spcthickness = [repmat(md.geometry.thickness,1,size(ice_load,2)) + ice_load];
++	md.masstransport.spcthickness =[ md.masstransport.spcthickness; 0:num_time-1]; 
+ 
+ 	%Physics 
+ 	md.transient.issmb=0;
+@@ -216,7 +216,7 @@
+ 	md.transient.ismasstransport=1;
+ 	md.transient.isslc=1;
+ 
+-	md.solidearth.settings.rigid=1;
++	md.solidearth.settings.viscous=0;
+ 	md.solidearth.settings.elastic=1;
+ 	md.solidearth.settings.rotation=1;
+ 	
Index: /issm/oecreview/Archive/25834-26739/ISSM-26403-26404.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26403-26404.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26403-26404.diff	(revision 26740)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/examples/SlrGRACE/runme.m
+===================================================================
+--- ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26403)
++++ ../trunk-jpl/examples/SlrGRACE/runme.m	(revision 26404)
+@@ -115,6 +115,7 @@
+ 	md = loadmodel('./Models/SlrGRACE_Parameterization');
+ 
+ 	md.solidearth.settings.viscous=0;
++	md.solidearth.settings.selfattraction=1;
+ 	md.solidearth.settings.elastic=1;
+ 	md.solidearth.settings.rotation=1;
+ 
+@@ -217,6 +218,7 @@
+ 	md.transient.isslc=1;
+ 
+ 	md.solidearth.settings.viscous=0;
++	md.solidearth.settings.selfattraction=1;
+ 	md.solidearth.settings.elastic=1;
+ 	md.solidearth.settings.rotation=1;
+ 	
Index: /issm/oecreview/Archive/25834-26739/ISSM-26404-26405.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26404-26405.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26404-26405.diff	(revision 26740)
@@ -0,0 +1,61 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh	(revision 26405)
+@@ -0,0 +1,49 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++VER="3.15.0"
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.15.0.tar.gz' 'petsc-3.15.0.tar.gz'
++
++# Unpack source
++tar -zxvf petsc-3.15.0.tar.gz
++
++# Cleanup
++rm -rf install src
++mkdir install src
++
++# Move source to $PETSC_DIR
++mv petsc-3.15.0/* src/
++rm -rf petsc-3.15.0
++
++
++# Configure
++#
++# NOTE: Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables; look for CONFIGURE_OPTIONS
++#
++cd src
++./config/configure.py \
++	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
++	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	--with-cc=icc --with-cxx=icpc --with-fc=ifort --with-f77=ifort\
++	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
++	--with-blas-lapack-dir="/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/" \
++	--known-mpi-shared-libraries=1 \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-batch=1  \
++	--with-shared-libraries=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-mumps=1 \
++	--download-scalapack=1
++
++# Compile and install
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26405-26406.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26405-26406.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26405-26406.diff	(revision 26740)
@@ -0,0 +1,27 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26405)
++++ ../trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 26406)
+@@ -10,7 +10,9 @@
+ PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+ 
+ # Download source
+-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz' 'petsc-${VER}.tar.gz'
++echo "OK1 ($ISSM_DIR)"
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++echo OK2
+ 
+ # Unpack source
+ tar -zxvf petsc-${VER}.tar.gz
+Index: ../trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh	(revision 26405)
++++ ../trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh	(revision 26406)
+@@ -31,6 +31,7 @@
+ 	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+ 	--with-cc=icc --with-cxx=icpc --with-fc=ifort --with-f77=ifort\
+ 	-COPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -CXXOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" -FOPTFLAGS="-g -O3 -axCORE-AVX2,AVX -xSSE4.2" \
++	--with-make-np=10 \
+ 	--with-blas-lapack-dir="/nasa/intel/Compiler/2016.2.181/compilers_and_libraries_2016.2.181/linux/mkl/" \
+ 	--known-mpi-shared-libraries=1 \
+ 	--with-debugging=0 \
Index: /issm/oecreview/Archive/25834-26739/ISSM-26406-26407.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26406-26407.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26406-26407.diff	(revision 26740)
@@ -0,0 +1,27 @@
+Index: ../trunk-jpl/src/m/classes/matice.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/matice.py	(revision 26406)
++++ ../trunk-jpl/src/m/classes/matice.py	(revision 26407)
+@@ -136,7 +136,7 @@
+         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')
+         # NOTE: We first have to check if we have a NumPy array here
+-        if (((np.shape(self.rheology_B)[0] == md.mesh.numberofvertices) or (np.shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1)) or ((len(np.shape(self.rheology_B)) == 2) and (np.shape(self.rheology_B)[0] == md.mesh.numberofelements) and (np.shape(self.rheology_B)[1] > 1))):
++        if np.size(self.rheology_B)==1 or (((np.shape(self.rheology_B)[0] == md.mesh.numberofvertices) or (np.shape(self.rheology_B)[0] == md.mesh.numberofvertices + 1)) or ((len(np.shape(self.rheology_B)) == 2) and (np.shape(self.rheology_B)[0] == md.mesh.numberofelements) and (np.shape(self.rheology_B)[1] > 1))):
+             mattype = 1
+             tsl = md.mesh.numberofvertices
+         else:
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26406)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26407)
+@@ -27,7 +27,8 @@
+     subproc_args = 'gmsh -info 2>&1 | command grep \'Version\' | sed -e \'s/Version[[:blank:]]*:[[:blank:]]//\' | cut -d \'.\' -f1'
+     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+     outs, errs = subproc.communicate()
+-    if errs != '':
++
++    if ((not isinstance(errs,bytes)) & (errs != '')) or (isinstance(errs,bytes) & (errs.decode() != '')):
+         raise Exception('gmshplanet: call to gmsh failed: {}'.format(errs))
+     gmshmajorversion = int(outs)
+     if gmshmajorversion not in [3, 4]:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26407-26408.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26407-26408.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26407-26408.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.m	(revision 26407)
++++ ../trunk-jpl/test/NightlyRun/runme.m	(revision 26408)
+@@ -90,7 +90,7 @@
+ list_ids=[];
+ for i=1:numel(flist),
+ 	fname=flist(i).name;
+-	if (contains(fname,'.')), %Before split, check that file name contains '.'
++	if (any(fname,'.')), %Before split, check that file name contains '.'
+ 		ftokens=string(split(fname,'.')); %Tokenize file name on '.'
+ 		if (regexp(ftokens{1},'^test[0-9]+$') &... %Basename must start with 'test' and end with a number
+ 			strcmp(ftokens{end},'m') ... %Extension (less '.') must be 'm'
Index: /issm/oecreview/Archive/25834-26739/ISSM-26408-26409.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26408-26409.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26408-26409.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.m	(revision 26408)
++++ ../trunk-jpl/test/NightlyRun/runme.m	(revision 26409)
+@@ -90,8 +90,8 @@
+ list_ids=[];
+ for i=1:numel(flist),
+ 	fname=flist(i).name;
+-	if (any(fname,'.')), %Before split, check that file name contains '.'
+-		ftokens=string(split(fname,'.')); %Tokenize file name on '.'
++	if (any(fname=='.')), %Before split, check that file name contains '.'
++		ftokens=strsplit(fname,'.'); %Tokenize file name on '.'
+ 		if (regexp(ftokens{1},'^test[0-9]+$') &... %Basename must start with 'test' and end with a number
+ 			strcmp(ftokens{end},'m') ... %Extension (less '.') must be 'm'
+ 		),
Index: /issm/oecreview/Archive/25834-26739/ISSM-26409-26410.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26409-26410.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26409-26410.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py
+===================================================================
+--- ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26409)
++++ ../trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 26410)
+@@ -122,13 +122,13 @@
+         # Create .pos file with existing mesh and refining metric:  {{{
+         fid = open('sphere.pos', 'w')
+ 
+-        fid.write('View "background mesh" {;\n')
++        fid.write('View "background mesh" {\n')
+         for i in range(meshini.numberofelements):
+-            fid.write('ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g};\n',
+-                meshini.x(meshini.elements(i, 0)), meshini.y(meshini.elements(i, 0)), meshini.z(meshini.elements(i, 0)),
+-                meshini.x(meshini.elements(i, 1)), meshini.y(meshini.elements(i, 1)), meshini.z(meshini.elements(i, 1)),
+-                meshini.x(meshini.elements(i, 2)), meshini.y(meshini.elements(i, 2)), meshini.z(meshini.elements(i, 2)),
+-                metric(meshini.elements(i, 0)), metric(meshini.elements(i, 1)), metric(meshini.elements(i, 2)))
++            fid.write('ST(%g,%g,%g,%g,%g,%g,%g,%g,%g){%g,%g,%g};\n'
++                % (meshini.x[meshini.elements[i, 0]-1], meshini.y[meshini.elements[i, 0]-1], meshini.z[meshini.elements[i, 0]-1],
++                meshini.x[meshini.elements[i, 1]-1], meshini.y[meshini.elements[i, 1]-1], meshini.z[meshini.elements[i, 1]-1],
++                meshini.x[meshini.elements[i, 2]-1], meshini.y[meshini.elements[i, 2]-1], meshini.z[meshini.elements[i, 2]-1],
++                metric[meshini.elements[i, 0]-1], metric[meshini.elements[i, 1]-1], metric[meshini.elements[i, 2]-1]))
+         fid.write('};\n')
+         fid.close()
+         #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26410-26411.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26410-26411.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26410-26411.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26410)
++++ ../trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 26411)
+@@ -92,7 +92,6 @@
+ 	ElementMatrix* Ke     = basalelement->NewElementMatrix();
+ 	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*    dbasis = xNew<IssmDouble>(dim*numnodes);
+-	IssmDouble*    Bprime = xNew<IssmDouble>(dim*numnodes);
+ 	IssmDouble     D[2][2] = {0.};
+ 
+ 	/*Retrieve all inputs and parameters*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26411-26412.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26411-26412.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26411-26412.diff	(revision 26740)
@@ -0,0 +1,62 @@
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26411)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 26412)
+@@ -163,16 +163,16 @@
+ 	/* Compute Toc and Soc weighted avg (boxes 0 to n-1) */
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element=xDynamicCast<Element*>(object);
++
++		/*Check whether we should continue*/
+ 		if(!element->IsOnBase()) continue;
+-		Element* basalelement = element->SpawnBasalElement();
+-		if(!basalelement->IsIceInElement() || !basalelement->IsAllFloating()){
+-			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+-			continue;
+-		}
++		if(!element->IsIceInElement() || !element->IsAllFloating()) continue;
+ 		int el_boxid;
+-		basalelement->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
++		element->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+ 		if(el_boxid!=boxid) continue;
+ 
++		Element* basalelement = element->SpawnBasalElement();
++
+ 		Input* tocs_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanTempEnum); _assert_(tocs_input); 
+ 		Input* socs_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanSalinityEnum); _assert_(socs_input);
+ 
+@@ -184,6 +184,7 @@
+ 		area=basalelement->GetHorizontalSurfaceArea();
+ 		toc_weighted_avg[basinid]+=toc*area;
+ 		soc_weighted_avg[basinid]+=soc*area;
++
+ 		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	}
+ 
+@@ -206,13 +207,15 @@
+ 		overturning_weighted_avg=xNewZeroInit<IssmDouble>(num_basins);
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element=xDynamicCast<Element*>(object);
++
++			/*Check whether we should continue or not*/
+ 			if(!element->IsOnBase()) continue;
+-			Element* basalelement = element->SpawnBasalElement();
+-			if(!basalelement->IsIceInElement() || !basalelement->IsAllFloating()) continue;
++			if(!element->IsIceInElement() || !element->IsAllFloating()) continue;
+ 			int el_boxid;
+-			basalelement->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
++			element->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+ 			if(el_boxid!=boxid) continue;
+ 
++			Element* basalelement = element->SpawnBasalElement();
+ 	     	Input* overturnings_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanOverturningEnum); _assert_(overturnings_input);
+ 
+ 			basalelement->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
+@@ -222,6 +225,7 @@
+ 			area=basalelement->GetHorizontalSurfaceArea();
+ 			overturning_weighted_avg[basinid]+=overturning*area;
+ 			basalelement->FindParam(&domaintype,DomainTypeEnum);
++
+ 			if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 		}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26412-26413.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26412-26413.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26412-26413.diff	(revision 26740)
@@ -0,0 +1,60 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh	(revision 26413)
+@@ -0,0 +1,48 @@
++#!/bin/bash
++set -eu
++
++
++## Constants
++#
++VER="3.15.3"
++
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf ${PREFIX} ${PETSC_DIR}
++mkdir ${PETSC_DIR}
++
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* ${PETSC_DIR}
++rm -rf petsc-${VER}
++
++# Configure
++cd ${PETSC_DIR}
++./config/configure.py \
++	--with-cc=icc --with-cxx=icpc --with-fc=ifort \
++	--prefix="${PREFIX}" \
++	--PETSC_DIR="${PETSC_DIR}" \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-pic=1 \
++	--download-fblaslapack=1 \
++	--download-mpich=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-scalapack=1 \
++	--download-mumps=1 \
++	--download-zlib=1 \
++	--download-hdf5=1
++
++# Compile and install
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26413-26414.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26413-26414.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26413-26414.diff	(revision 26740)
@@ -0,0 +1,46 @@
+Index: ../trunk-jpl/externalpackages/codipack/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/codipack/install.sh	(revision 26413)
++++ ../trunk-jpl/externalpackages/codipack/install.sh	(revision 26414)
+@@ -4,10 +4,10 @@
+ VER=1.8
+ 
+ # Cleanup from previous installation
+-rm -rf src CoDiPack-$VER.tar.gz
++rm -rf install CoDiPack-$VER.tar.gz
+ 
+ #Download development version
+-svn co https://github.com/SciCompKL/CoDiPack.git/trunk src
++svn co https://github.com/SciCompKL/CoDiPack.git/trunk install
+ 
+ ## Download source
+ #$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/CoDiPack-${VER}.tar.gz" "CoDiPack-${VER}.tar.gz"
+Index: ../trunk-jpl/externalpackages/medipack/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/medipack/install.sh	(revision 26413)
++++ ../trunk-jpl/externalpackages/medipack/install.sh	(revision 26414)
+@@ -2,7 +2,7 @@
+ set -eu
+ 
+ #Some cleanup
+-rm -rf src
++rm -rf install
+ 
+ #Download development version
+-svn co https://github.com/SciCompKL/MeDiPack/trunk src
++svn co https://github.com/SciCompKL/MeDiPack/trunk install
+Index: ../trunk-jpl/jenkins/ross-debian_linux-codipack
+===================================================================
+--- ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 26413)
++++ ../trunk-jpl/jenkins/ross-debian_linux-codipack	(revision 26414)
+@@ -27,8 +27,8 @@
+ 	--with-chaco-dir=${ISSM_DIR}/externalpackages/chaco/install \
+ 	--with-m1qn3-dir=${ISSM_DIR}/externalpackages/m1qn3/install \
+ 	--with-semic-dir=${ISSM_DIR}/externalpackages/semic/install \
+-	--with-medipack-dir="${ISSM_DIR}/externalpackages/medipack/src" \
+-	--with-codipack-dir="${ISSM_DIR}/externalpackages/codipack/src" \
++	--with-medipack-dir="${ISSM_DIR}/externalpackages/medipack/install" \
++	--with-codipack-dir="${ISSM_DIR}/externalpackages/codipack/install" \
+ '
+ 
+ #-------------------#
Index: /issm/oecreview/Archive/25834-26739/ISSM-26414-26415.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26414-26415.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26414-26415.diff	(revision 26740)
@@ -0,0 +1,97 @@
+Index: ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26414)
++++ ../trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp	(revision 26415)
+@@ -3,25 +3,19 @@
+  */
+ 
+ /*Header files*/
+-#include <proj.h>
+-
+ #include "./CoordinateSystemTransformx.h"
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
++#include <proj.h>
+ 
+ void CoordinateSystemTransformx(double** px_dest,double** py_dest,double* x_src,double* y_src,int size,const char* str_src,const char* str_dst){
+ 
+ /*
+-	NOTE:
+-	- Compilation of this module is fenced in Makefile.am, so we do not 
+-	have to check again if _HAVE_PROJ_ is defined
+-	- As of at least PROJ 8, version macros are defined,
+-
+-		https://proj.org/development/reference/macros.html
++NOTE:
++- Compilation of this module is fenced in Makefile.am, so we do not have to 
++check again if _HAVE_PROJ_ is defined
+ */
+-#if !defined(PROJ_VERSION_MAJOR) || !PROJ_AT_LEAST_VERSION(8, 0, 0)
+-	_error_("PROJ major version >= 8 required");
+-#else
++#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR >= 6
+ 	/*
+ 	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
+ 	projection described by str_src to the projection described by str_dest.
+@@ -75,5 +69,7 @@
+ 	/*Output : */
+ 	*px_dest=x_dest;
+ 	*py_dest=y_dest;
++#else
++	_error_("PROJ version >= 6 required");
+ #endif
+ }
+Index: ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26414)
++++ ../trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp	(revision 26415)
+@@ -3,21 +3,15 @@
+  */
+ 
+ /*Header files*/
++#include "./CoordTransform.h"
+ #include <proj.h>
+ 
+-#include "./CoordTransform.h"
+-
+ /*
+-	NOTE:
+-	- Compilation of this module is fenced in Makefile.am, so we do not 
+-	have to check again if _HAVE_PROJ_ is defined
+-	- As of at least PROJ 8, version macros are defined,
+-
+-		https://proj.org/development/reference/macros.html
++NOTE:
++- Compilation of this module is fenced in Makefile.am, so we do not have to 
++check again if _HAVE_PROJ_ is defined
+ */
+-#if !defined(PROJ_VERSION_MAJOR) || !PROJ_AT_LEAST_VERSION(8, 0, 0)
+-	_error_("PROJ major version >= 8 required");
+-#else
++#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR >= 6
+ 	/*
+ 	Converts an array of longitude (x_src) and array of latitude (y_src) in the 
+ 	projection described by str_src to the projection described by str_dest.
+@@ -107,5 +101,6 @@
+ 		/*end module: */
+ 		MODULEEND();
+ 	}
+-
++#else
++	_error_("PROJ version >= 6 required");
+ #endif
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26414)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 26415)
+@@ -193,8 +193,10 @@
+ ContourToNodes_matlab_la_SOURCES = ../ContourToNodes/ContourToNodes.cpp
+ ContourToNodes_matlab_la_LIBADD = ${deps}
+ 
++if PROJ
+ CoordTransform_matlab_la_SOURCES = ../CoordTransform/CoordTransform.cpp
+ CoordTransform_matlab_la_LIBADD = ${deps}
++endif
+ 
+ DistanceToMaskBoundary_matlab_la_SOURCES = ../DistanceToMaskBoundary/DistanceToMaskBoundary.cpp
+ DistanceToMaskBoundary_matlab_la_LIBADD = ${deps}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26415-26416.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26415-26416.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26415-26416.diff	(revision 26740)
@@ -0,0 +1,67 @@
+Index: ../trunk-jpl/externalpackages/proj/install-6.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/proj/install-6.sh	(revision 26416)
+@@ -0,0 +1,55 @@
++#!/bin/bash
++set -eu
++
++
++# Constants
++#
++VER="6.2.1"
++
++PREFIX="${ISSM_EXT_SHARED_DIR}/proj/install" # Set to location where external package should be installed
++
++## Environment
++#
++export CC=mpicc
++export CXX=mpicxx
++# NOTE: On macOS, SQLite3 should be installed by default, but PROJ currently
++#		requires,
++#
++#			SQLITE3_LIBS="-lsqlite3".
++#
++#		On Ubuntu Linux, install the SQLite3 binary, libraries and headers
++#		with,
++#
++#			`apt-get install sqlite3 libsqlite3-dev`
++#
++export SQLITE3_LIBS="-lsqlite3"
++
++# Cleanup
++rm -rf ${PREFIX} src
++mkdir -p ${PREFIX} src
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/proj-${VER}.tar.gz" "proj-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf proj-${VER}.tar.gz
++
++# Move source into 'src' directory
++mv proj-${VER}/* src
++rm -rf proj-${VER}
++
++# Configure
++cd src
++./configure \
++	--prefix="${PREFIX}" \
++	--disable-dependency-tracking \
++	--enable-fast-install
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/proj/install-6.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26416-26417.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26416-26417.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26416-26417.diff	(revision 26740)
@@ -0,0 +1,85 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26416)
++++ ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26417)
+@@ -1,3 +1,7 @@
++# TODO: Change PROJ installation script to latest version once Jenkins macOS 
++#		build node has been upgraded.
++#
++
+ #--------------------#
+ # ISSM Configuration #
+ #--------------------#
+@@ -47,7 +51,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-8.sh
++	proj		install-6.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26416)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26417)
+@@ -1,4 +1,8 @@
+ # NOTE: Same configuration as pine_island-mac-full
++#
++# TODO: Change PROJ installation script to latest version once Jenkins macOS 
++#		build node has been upgraded.
++#
+ 
+ #--------------------#
+ # ISSM Configuration #
+@@ -48,7 +52,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-8.sh
++	proj		install-6.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26416)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26417)
+@@ -1,3 +1,7 @@
++# TODO: Change PROJ installation script to latest version once Jenkins macOS 
++#		build node has been upgraded.
++#
++
+ #--------------------#
+ # ISSM Configuration #
+ #--------------------#
+@@ -47,7 +51,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-8.sh
++	proj		install-6.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26416)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26417)
+@@ -1,3 +1,7 @@
++# TODO: Change PROJ installation script to latest version once Jenkins macOS 
++#		build node has been upgraded.
++#
++
+ #--------------------#
+ # ISSM Configuration #
+ #--------------------#
+@@ -47,7 +51,7 @@
+ 	dakota		install-6.2-mac.sh
+ 	curl		install-7-mac.sh
+ 	netcdf		install-4.7-parallel.sh
+-	proj		install-8.sh
++	proj		install-6.sh
+ 	gdal		install-3-python.sh
+ 	gshhg		install.sh
+ 	gmt			install-6-mac.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26417-26418.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26417-26418.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26417-26418.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/externalpackages/proj/install-6.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/proj/install-6.sh	(revision 26417)
++++ ../trunk-jpl/externalpackages/proj/install-6.sh	(revision 26418)
+@@ -6,7 +6,7 @@
+ #
+ VER="6.2.1"
+ 
+-PREFIX="${ISSM_EXT_SHARED_DIR}/proj/install" # Set to location where external package should be installed
++PREFIX="${ISSM_DIR}/externalpackages/proj/install" # Set to location where external package should be installed
+ 
+ ## Environment
+ #
+@@ -43,7 +43,8 @@
+ ./configure \
+ 	--prefix="${PREFIX}" \
+ 	--disable-dependency-tracking \
+-	--enable-fast-install
++	--enable-fast-install \
++	--disable-tiff
+ 
+ # Compile and install
+ if [ $# -eq 0 ]; then
Index: /issm/oecreview/Archive/25834-26739/ISSM-26418-26419.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26418-26419.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26418-26419.diff	(revision 26740)
@@ -0,0 +1,227 @@
+Index: ../trunk-jpl/src/m/classes/clusters/smce_eis.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/smce_eis.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/clusters/smce_eis.py	(revision 26419)
+@@ -0,0 +1,222 @@
++import subprocess
++
++try:
++    from smce_eis_settings import smce_eis_settings
++except ImportError:
++    print('You need smce_eis_settings.py to proceed, check presence and sys.path')
++from fielddisplay import fielddisplay
++from helpers import *
++from IssmConfig import IssmConfig
++from issmscpin import issmscpin
++from issmscpout import issmscpout
++from issmssh import issmssh
++from MatlabFuncs import *
++from pairoptions import pairoptions
++from QueueRequirements import QueueRequirements
++
++class smce_eis(object):
++    """SMCE_EIS cluster class definition
++
++    Usage:
++        cluster = smce_eis()
++        cluster = smce_eis('np', 3)
++        cluster = smce_eis('np', 3, 'login', 'username')
++    """
++
++    def __init__(self, *args):  # {{{
++        self.name = oshostname()
++        self.login = ''
++        self.modules = []
++        self.numnodes = 20
++        self.cpuspernode = 8
++        self.port = 0
++        self.queue = 'general'
++        self.time = 12 * 60 * 60
++        self.processor = 'west'
++        self.srcpath = '/shared/issm/issm/trunk-jpl'
++        self.codepath = '/shared/issm/issm/trunk-jpl/bin'
++        self.executionpath = ''
++        self.grouplist = ''
++        self.interactive = 0
++        self.bbftp = 0
++        self.numstreams = 8
++        self.hyperthreading = 0
++        self.email = ''
++
++        # Use provided options to change fields
++        options = pairoptions(*args)
++
++        # Initialize cluster using user settings if provided
++        try:
++            self = smce_eis_settings(self)
++        except NameError:
++            print('smce_eis_settings.py not found, using default settings')
++
++        # OK get other fields
++        self = options.AssignObjectFields(self)
++    # }}}
++
++    def __repr__(self):  # {{{
++        # Display the object
++        s = 'class smce_eis object\n'
++        s += '    name: {}\n'.format(self.name)
++        s += '    login: {}\n'.format(self.login)
++        s += '    modules: {}\n'.format(strjoin(self.modules, ', '))
++        s += '    numnodes: {}\n'.format(self.numnodes)
++        s += '    cpuspernode: {}\n'.format(self.cpuspernode)
++        s += '    np: {}\n'.format(self.nprocs())
++        s += '    port: {}\n'.format(self.port)
++        s += '    queue: {}\n'.format(self.queue)
++        s += '    time: {}\n'.format(self.time)
++        s += '    processor: {}\n'.format(self.processor)
++        s += '    srcpath: {}\n'.format(self.srcpath)
++        s += '    codepath: {}\n'.format(self.codepath)
++        s += '    executionpath: {}\n'.format(self.executionpath)
++        s += '    grouplist: {}\n'.format(self.grouplist)
++        s += '    interactive: {}\n'.format(self.interactive)
++        s += '    bbftp: {}\n'.format(self.bbftp)
++        s += '    numstreams: {}\n'.format(self.numstreams)
++        s += '    hyperthreading: {}\n'.format(self.hyperthreading)
++        return s
++    # }}}
++
++    def nprocs(self):  # {{{
++        return self.numnodes * self.cpuspernode
++    # }}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        queuedict = {'long': [24 * 60 * 60, 560],
++                     'allnccs': [12 * 60 * 60, 6000],
++                     'debug': [1 * 60 * 60, 532]}
++        QueueRequirements(queuedict, self.queue, self.nprocs(), self.time)
++
++        # Now, check cluster.cpuspernode according to processor type
++        if self.processor == 'sand':
++            if self.cpuspernode > 16 or self.cpuspernode < 1:
++                md = md.checkmessage('cpuspernode should be between 1 and 16 for \'sand\' processors in hyperthreading mode')
++        elif self.processor == 'hasw':
++            if self.cpuspernode > 28 or self.cpuspernode < 1:
++                md = md.checkmessage('cpuspernode should be between 1 and 28 for \'hasw\' processors in hyperthreading mode')
++        else:
++            md = md.checkmessage('unknown processor type, should be \'sand\' or \'hasw\'')
++
++        # Miscellaneous
++        if not self.login:
++            md = md.checkmessage('login empty')
++        if not self.codepath:
++            md = md.checkmessage('codepath empty')
++        if not self.executionpath:
++            md = md.checkmessage('executionpath empty')
++
++        return self
++    # }}}
++
++    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
++        if isgprof:
++            print('gprof not supported by cluster, ignoring...')
++
++        executable = 'issm.exe'
++        if isdakota:
++            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
++            version = float(str(version[0]))
++            if version >= 6:
++                executable = 'issm_dakota.exe'
++        if isoceancoupling:
++            executable = 'issm_ocean.exe'
++
++        # Write queuing script
++        fid = open(modelname + '.queue', 'w')
++
++        fid.write('#!/bin/bash\n')
++        fid.write('#SBATCH -J {} \n'.format(modelname))
++        fid.write('#SBATCH --qos={} \n'.format(self.queue))
++        fid.write('#SBATCH -o {}.outlog \n'.format(modelname))
++        fid.write('#SBATCH -e {}.errlog \n'.format(modelname))
++        fid.write('#SBATCH -n {} \n'.format(self.nprocs()))
++        fid.write('#SBATCH -N {} \n'.format(self.numnodes))
++        fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(int(floor(self.time / 3600)), int(floor(self.time % 3600) / 60)))
++        fid.write('#SBATCH -A {} \n\n'.format(self.grouplist))
++        if (self.email.find('@')>-1):
++            fid.write('#SBATCH --mail-user={} \n'.format(self.email))
++            fid.write('#SBATCH --mail-type=end \n\n')
++        # fid.write('. /usr/share/modules/init/bash\n\n')
++        # for i in range(len(self.modules)):
++        #     fid.write('module load {}\n'.format(self.modules[i]))
++        fid.write('export MPI_GROUP_MAX=64\n\n')
++        fid.write('export MPI_UNBUFFERED_STDIO=true\n\n')
++        fid.write('export PATH="$PATH:."\n\n')
++        fid.write('export ISSM_DIR="{}"\n'.format(self.srcpath)) # FIXME
++        fid.write('source $ISSM_DIR/etc/environment.sh\n') # FIXME
++        fid.write('cd {}/{}/\n\n'.format(self.executionpath, dirname))
++
++        fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
++
++        if not io_gather: # concatenate the output files
++            fid.write('cat {}.outbin.* > {}.outbin'.format(modelname, modelname))
++        fid.close()
++
++        # In interactive mode, create a run file, and errlog and outlog file
++        if self.interactive:
++            fid = open(modelname + '.run', 'w')
++            if not isvalgrind:
++                fid.write('mpiexec -np {} {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
++            else:
++                fid.write('mpiexec -np {} valgrind --leak-check=full {}/{} {} {}/{} {}\n'.format(self.nprocs(), self.codepath, executable, solution, self.executionpath, dirname, modelname))
++            if not io_gather: # concatenate the output files
++                fid.write('cat {}.outbin.* > {}.outbin'.format(modelname, modelname))
++            fid.close()
++            fid = open(modelname + '.errlog', 'w') # TODO: Change this to system call (touch <file>)?
++            fid.close()
++            fid = open(modelname + '.outlog', 'w') # TODO: Change this to system call (touch <file>)?
++            fid.close()
++    # }}}
++
++    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
++        # Compress the files into one zip
++        compressstring = 'tar -zcf {}.tar.gz'.format(dirname)
++        for file in filelist:
++            compressstring += ' {}'.format(file)
++        if self.interactive:
++            compressstring += ' {}.run {}.errlog {}.outlog'.format(modelname, modelname, modelname)
++        subprocess.call(compressstring, shell=True)
++
++        print('uploading input file and queueing script')
++        if self.interactive:
++            directory = '{}/Interactive{}'.format(self.executionpath, self.interactive)
++        else:
++            directory = self.executionpath
++
++        if self.bbftp:
++            issmbbftpout(self.name, directory, self.login, self.port, self.numstreams, '{}.tar.gz'.format(dirname))
++        else:
++            issmscpout(self.name, directory, self.login, self.port, ['{}.tar.gz'.format(dirname)])
++    # }}}
++
++    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
++        if self.interactive:
++            if not isempty(restart):
++                launchcommand = 'cd {}/Interactive{}'.format(self.executionpath, self.interactive)
++            else:
++                launchcommand = 'cd {}/Interactive{} && tar -zxf {}.tar.gz'.format(self.executionpath, self.interactive, dirname)
++        else:
++            if not isempty(restart):
++                launchcommand = 'cd {} && cd {} && sbatch {}.queue'.format(self.executionpath, dirname, modelname)
++            else:
++                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz && sbatch {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
++
++        print('launching solution sequence on remote cluster')
++        issmssh(self.name, self.login, self.port, launchcommand)
++    # }}}
++
++    def Download(self, dirname, filelist):  # {{{
++        # Copy files from cluster to current directory
++        if self.interactive:
++            directory = '{}/Interactive{}'.format(self.executionpath, self.interactive)
++        else:
++            directory = '{}/{}/'.format(self.executionpath, dirname)
++
++        if self.bbftp:
++            issmbbftpin(self.name, self.login, self.port, self.numstreams, directory, filelist)
++        else:
++            issmscpin(self.name, self.login, self.port, directory, filelist)
++    # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26419-26420.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26419-26420.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26419-26420.diff	(revision 26740)
@@ -0,0 +1,183 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26419)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26420)
+@@ -214,10 +214,6 @@
+ 	ElementMatrix* Ke       = basalelement->NewElementMatrix();
+ 	IssmDouble*    basis    = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*    dbasis   = xNew<IssmDouble>(2*numnodes);
+-	IssmDouble*    Bprime = NULL;
+-	if(stabilization==2){
+-		Bprime   = xNew<IssmDouble>(dim*numnodes);
+-	}
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+@@ -224,6 +220,8 @@
+ 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	basalelement->FindParam(&migrationmax,MigrationMaxEnum);
+ 
++	h = element->CharacteristicLength();
++
+ 	Input* mf_vx_input        = NULL;
+ 	Input* mf_vy_input        = NULL;
+ 
+@@ -290,7 +288,7 @@
+ 		vel=sqrt(vel)+1.e-14;
+ 		switch(stabilization){
+ 			case 0:
+-				// no stabilization, do nothing
++				/*Nothing to be done*/
+ 				break;
+ 			case 1:
+ 				/* Artificial Diffusion */
+@@ -308,18 +306,44 @@
+ 			case 2:
+ 				  {
+ 					/* Streamline Upwinding */
+-					basalelement->ElementSizes(&hx,&hy,&hz);
+-					h=sqrt( pow(hx*w[0]/vel,2) + pow(hy*w[1]/vel,2) );
++					mf_vx_input->GetInputAverage(&w[0]);
++					mf_vy_input->GetInputAverage(&w[1]);
++					vel=sqrt(w[0]*w[0]+w[1]*w[1])+1.e-8;
++					IssmDouble tau=h/(2*vel);
+ 					for(int i=0;i<numnodes;i++){
+ 						for(int j=0;j<numnodes;j++){
+-							Ke->values[i*numnodes+j] += D_scalar*h/(2.*vel)*(
+-										dbasis[0*numnodes+i] *(w[0]*w[0]*dbasis[0*numnodes+j] + w[0]*w[1]*dbasis[1*numnodes+j]) +
+-										dbasis[1*numnodes+i] *(w[1]*w[0]*dbasis[0*numnodes+j] + w[1]*w[1]*dbasis[1*numnodes+j]) 
+-										);
++							Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(
++										w[0]*dbasis[0*numnodes+i]+w[1]*dbasis[1*numnodes+i])*(w[0]*dbasis[0*numnodes+j]+w[1]*dbasis[1*numnodes+j]);
+ 						}
+ 					}
+ 				  }
+ 				break;
++			case 5:{
++				/*SUPG*/
++				mf_vx_input->GetInputAverage(&w[0]);
++				mf_vy_input->GetInputAverage(&w[1]);
++				vel=sqrt(w[0]*w[0]+w[1]*w[1])+1.e-8;
++				IssmPDouble xi=1.;
++				IssmDouble  tau=xi*h/(2*vel);
++
++				IssmDouble vx,vy;
++				vx = w[0]; vy = w[1];
++				/*Mass matrix - part 2*/
++				for(int i=0;i<numnodes;i++){
++					for(int j=0;j<numnodes;j++){
++						Ke->values[i*numnodes+j]+=gauss->weight*Jdet*tau*basis[j]*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i]);
++					}
++				}
++
++				/*Advection matrix - part 2, A*/
++				for(int i=0;i<numnodes;i++){
++					for(int j=0;j<numnodes;j++){
++						Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(vx*dbasis[0*numnodes+j]+vy*dbasis[1*numnodes+j])*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i]);
++					}
++				}
++
++				break;
++			}
+ 			default:
+ 				_error_("unknown type of stabilization in LevelsetAnalysis.cpp");
+ 		}
+@@ -329,7 +353,6 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	xDelete<IssmDouble>(dbasis);
+-	xDelete<IssmDouble>(Bprime);
+ 	delete gauss;
+ 	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	return Ke;
+@@ -340,7 +363,7 @@
+ 	Element* basalelement = element->SpawnBasalElement();
+ 
+ 	/*Intermediaries */
+-	int domaintype;
++	int         domaintype,stabilization;
+ 	IssmDouble  Jdet,dt;
+ 	IssmDouble  lsf;
+ 	IssmDouble* xyz_list = NULL;
+@@ -347,38 +370,59 @@
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
++	basalelement->FindParam(&stabilization,MasstransportStabilizationEnum);
+ 
+ 	/*Initialize Element vector*/
+ 	ElementVector* pe = basalelement->NewElementVector();
+-	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
++	basalelement->FindParam(&dt,TimesteppingTimeStepEnum); _assert_(dt>0.);
+ 
+-	if(dt!=0.){
+-		/*Initialize basis vector*/
+-		IssmDouble*    basis = xNew<IssmDouble>(numnodes);
++	/*Initialize basis vector*/
++	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
++	IssmDouble*    dbasis = NULL;
++	if(stabilization==5) dbasis= xNew<IssmDouble>(2*numnodes);
+ 
+-		/*Retrieve all inputs and parameters*/
+-		basalelement->GetVerticesCoordinates(&xyz_list);
+-		Input* levelset_input  = basalelement->GetInput(MaskIceLevelsetEnum); _assert_(levelset_input);
++	/*Retrieve all inputs and parameters*/
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	Input* levelset_input = basalelement->GetInput(MaskIceLevelsetEnum); _assert_(levelset_input);
++	Input* mf_vx_input    = basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
++	Input* mf_vy_input    = basalelement->GetInput(MovingFrontalVyEnum); _assert_(mf_vy_input);
+ 
+-		/* Start  looping on the number of gaussian points: */
+-		Gauss* gauss=basalelement->NewGauss(2);
+-		while(gauss->next()){
+-			basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+-			basalelement->NodalFunctions(basis,gauss);
++	IssmDouble h=element->CharacteristicLength();
+ 
+-			/* old function value */
+-			levelset_input->GetInputValue(&lsf,gauss);
+-			for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*lsf*basis[i];
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(2);
++	while(gauss->next()){
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctions(basis,gauss);
++
++		/* old function value */
++		levelset_input->GetInputValue(&lsf,gauss);
++		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*lsf*basis[i];
++
++		if(stabilization==5){ /*SUPG*/
++         IssmDouble vx,vy,vel;
++			basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++			mf_vx_input->GetInputAverage(&vx);
++			mf_vy_input->GetInputAverage(&vy);
++			vel=sqrt(vx*vx+vy*vy)+1.e-8;
++			IssmPDouble xi=1;
++			IssmDouble  tau=xi*h/(2*vel);
++
++			/*Force vector - part 2*/
++			for(int i=0;i<numnodes;i++){
++				pe->values[i]+=Jdet*gauss->weight*lsf*(tau*vx*dbasis[0*numnodes+i]+tau*vy*dbasis[1*numnodes+i]);
++			}
+ 		}
+-
+-		/*Clean up and return*/
+-		xDelete<IssmDouble>(xyz_list);
+-		xDelete<IssmDouble>(basis);
+-		basalelement->FindParam(&domaintype,DomainTypeEnum);
+-		if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+-		delete gauss;
+ 	}
+ 
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++   xDelete<IssmDouble>(dbasis);
++	basalelement->FindParam(&domaintype,DomainTypeEnum);
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++	delete gauss;
++
+ 	return pe;
+ }/*}}}*/
+ IssmDouble     LevelsetAnalysis::GetDistanceToStraight(IssmDouble* q, IssmDouble* s0, IssmDouble* s1){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26420-26421.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26420-26421.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26420-26421.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/m/classes/levelset.js
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.js	(revision 26420)
++++ ../trunk-jpl/src/m/classes/levelset.js	(revision 26421)
+@@ -40,7 +40,7 @@
+ 		if (solution!='TransientSolution' | md.trans.ismovingfront==0) return;
+ 
+ 		checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
+-		checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2]);
++		checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2,5]);
+ 		checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0, 1]);
+ 		checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
+ 		checkfield(md,'fieldname','levelset.fe','values',['P1','P2']);
+Index: ../trunk-jpl/src/m/classes/levelset.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.m	(revision 26420)
++++ ../trunk-jpl/src/m/classes/levelset.m	(revision 26421)
+@@ -61,7 +61,7 @@
+ 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+ 
+ 			md = checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
+-			md = checkfield(md,'fieldname','levelset.stabilization','values',[0 1 2]);
++			md = checkfield(md,'fieldname','levelset.stabilization','values',[0 1 2 5]);
+ 			md = checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0 1]);
+ 			md = checkfield(md,'fieldname','levelset.migration_max','numel',1,'NaN',1,'Inf',1,'>',0);
+ 			md = checkfield(md,'fieldname','levelset.fe','values',{'P1','P2'});
+Index: ../trunk-jpl/src/m/classes/levelset.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/levelset.py	(revision 26420)
++++ ../trunk-jpl/src/m/classes/levelset.py	(revision 26421)
+@@ -55,7 +55,7 @@
+             return md
+ 
+         md = checkfield(md, 'fieldname', 'levelset.spclevelset', 'Inf', 1, 'timeseries', 1)
+-        md = checkfield(md, 'fieldname', 'levelset.stabilization', 'numel', [1], 'values', [0, 1, 2])
++        md = checkfield(md, 'fieldname', 'levelset.stabilization', 'numel', [1], 'values', [0, 1, 2, 5])
+         md = checkfield(md, 'fieldname', 'levelset.kill_icebergs', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'levelset.migration_max', 'numel', [1], 'NaN', 1, 'Inf', 1, '>', 0)
+         md = checkfield(md, 'fieldname', 'levelset.fe', 'values', ['P1', 'P2'])
Index: /issm/oecreview/Archive/25834-26739/ISSM-26421-26422.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26421-26422.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26421-26422.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive801.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26422-26423.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26422-26423.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26422-26423.diff	(revision 26740)
@@ -0,0 +1,55 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26422)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26423)
+@@ -220,7 +220,7 @@
+ 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	basalelement->FindParam(&migrationmax,MigrationMaxEnum);
+ 
+-	h = element->CharacteristicLength();
++	h = basalelement->CharacteristicLength();
+ 
+ 	Input* mf_vx_input        = NULL;
+ 	Input* mf_vy_input        = NULL;
+@@ -387,7 +387,7 @@
+ 	Input* mf_vx_input    = basalelement->GetInput(MovingFrontalVxEnum); _assert_(mf_vx_input);
+ 	Input* mf_vy_input    = basalelement->GetInput(MovingFrontalVyEnum); _assert_(mf_vy_input);
+ 
+-	IssmDouble h=element->CharacteristicLength();
++	IssmDouble h=basalelement->CharacteristicLength();
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=basalelement->NewGauss(2);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26422)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26423)
+@@ -1877,6 +1877,10 @@
+ 
+ 	/*Start looping on Gaussian points*/
+ 	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_front,3);
++    
++    double time;
++    element->FindParam(&time,TimeEnum);
++    
+ 	while(gauss->next()){
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		sealevel_input->GetInputValue(&sealevel,gauss);
+@@ -1889,6 +1893,17 @@
+ 		water_pressure = 1.0/2.0*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
+ 		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
+ 		pressure = ice_pressure + water_pressure;
++        
++        /*double alpha = 0.1/2*(1+sin(2*pi*time/(365*24*3600)))'*/
++        /*double alpha = 0.01/2*(1+sin(2*pi*time/(365*24*3600)))'*/
++        /*double alpha = 0.05/2*(1+sin(2*pi*time/(365*24*3600)))'*/
++        
++        if(base<sealevel){
++        double alpha = 0*0.02/2*(1+sin(2*PI*time/(365*24*3600)));
++		  alpha = 0.1;
++        pressure = ice_pressure -( 0.5*rho_ice*gravity*pow(alpha*thickness,2) + 0.5*rho_water*gravity*base*base-0.5*rho_ice*rho_ice/rho_water*gravity*pow(alpha*thickness,2));
++		  //pressure = ice_pressure + 0.5*rho_ice*gravity*pow(alpha*thickness,2) + 0.5*rho_water*gravity*(surface_under_water*surface_under_water - base_under_water*base_under_water)-0.5*rho_ice*rho_ice/rho_water*gravity*pow(alpha*thickness,2);
++		  }
+ 
+ 		for(int i=0;i<numnodes;i++){
+ 			pe->values[dim*i+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i];
Index: /issm/oecreview/Archive/25834-26739/ISSM-26423-26424.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26423-26424.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26423-26424.diff	(revision 26740)
@@ -0,0 +1,33 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26423)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26424)
+@@ -1877,10 +1877,6 @@
+ 
+ 	/*Start looping on Gaussian points*/
+ 	Gauss* gauss=element->NewGauss(xyz_list,xyz_list_front,3);
+-    
+-    double time;
+-    element->FindParam(&time,TimeEnum);
+-    
+ 	while(gauss->next()){
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		sealevel_input->GetInputValue(&sealevel,gauss);
+@@ -1893,17 +1889,6 @@
+ 		water_pressure = 1.0/2.0*gravity*rho_water*(surface_under_water*surface_under_water - base_under_water*base_under_water);
+ 		ice_pressure   = 1.0/2.0*gravity*rho_ice*thickness*thickness;
+ 		pressure = ice_pressure + water_pressure;
+-        
+-        /*double alpha = 0.1/2*(1+sin(2*pi*time/(365*24*3600)))'*/
+-        /*double alpha = 0.01/2*(1+sin(2*pi*time/(365*24*3600)))'*/
+-        /*double alpha = 0.05/2*(1+sin(2*pi*time/(365*24*3600)))'*/
+-        
+-        if(base<sealevel){
+-        double alpha = 0*0.02/2*(1+sin(2*PI*time/(365*24*3600)));
+-		  alpha = 0.1;
+-        pressure = ice_pressure -( 0.5*rho_ice*gravity*pow(alpha*thickness,2) + 0.5*rho_water*gravity*base*base-0.5*rho_ice*rho_ice/rho_water*gravity*pow(alpha*thickness,2));
+-		  //pressure = ice_pressure + 0.5*rho_ice*gravity*pow(alpha*thickness,2) + 0.5*rho_water*gravity*(surface_under_water*surface_under_water - base_under_water*base_under_water)-0.5*rho_ice*rho_ice/rho_water*gravity*pow(alpha*thickness,2);
+-		  }
+ 
+ 		for(int i=0;i<numnodes;i++){
+ 			pe->values[dim*i+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i];
Index: /issm/oecreview/Archive/25834-26739/ISSM-26424-26425.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26424-26425.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26424-26425.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive805.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26425-26426.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26425-26426.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26425-26426.diff	(revision 26740)
@@ -0,0 +1,224 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-matlab	(revision 26426)
+@@ -18,7 +18,7 @@
+ 	--enable-standalone-libraries \
+ 	--disable-dependency-tracking \
+ 	--with-matlab-dir=${MATLAB_PATH} \
+-	--with-fortran-lib="/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.2.0/libgcc.a" \
++	--with-fortran-lib="/usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.3.0/libgcc.a" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-binaries-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-binaries-python	(revision 26426)
+@@ -16,7 +16,7 @@
+ 	--disable-dependency-tracking \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.2.0/libgcc.a" \
++	--with-fortran-lib="/usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libgfortran.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/libquadmath.a /usr/local/Cellar/gcc/10.3.0/lib/gcc/10/gcc/x86_64-apple-darwin15/10.3.0/libgcc.a" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+Index: ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26426)
+@@ -17,7 +17,7 @@
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include  \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -42,7 +42,7 @@
+ EXTERNALPACKAGES="
+ 	autotools		install-mac.sh
+ 	cmake			install.sh
+-	petsc			install-3.12-mac.sh
++	petsc			install-3.14-mac.sh
+ 	gsl				install.sh
+ 	triangle		install-mac.sh
+ 	adjoinablempi	install-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-basic
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26426)
+@@ -11,7 +11,7 @@
+ 	--enable-debugging \
+ 	--with-numthreads=4 \
+ 	--with-matlab-dir=${MATLAB_PATH} \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -34,7 +34,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	triangle	install-mac.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26426)
+@@ -17,7 +17,7 @@
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -45,7 +45,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26426)
+@@ -19,7 +19,7 @@
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -46,7 +46,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26426)
+@@ -16,7 +16,7 @@
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -43,7 +43,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26426)
+@@ -16,7 +16,7 @@
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -43,7 +43,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26426)
+@@ -10,7 +10,7 @@
+ 	--with-numthreads=4 \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -38,7 +38,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26426)
+@@ -17,7 +17,7 @@
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -45,7 +45,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26425)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26426)
+@@ -17,7 +17,7 @@
+ 	--with-matlab-dir=${MATLAB_PATH} \
+ 	--with-python-dir=/System/Library/Frameworks/Python.framework/Versions/2.7 \
+ 	--with-python-numpy-dir=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy \
+-	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10 -lgfortran" \
++	--with-fortran-lib="-L/usr/local/Cellar/gcc/10.3.0/lib/gcc/10 -lgfortran" \
+ 	--with-mpi-include=${ISSM_DIR}/externalpackages/petsc/install/include \
+ 	--with-mpi-libflags="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lmpi -lmpicxx -lmpifort" \
+ 	--with-blas-lapack-dir=${ISSM_DIR}/externalpackages/petsc/install \
+@@ -45,7 +45,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.12-mac.sh
++	petsc		install-3.14-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26426-26427.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26426-26427.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26426-26427.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/externalpackages/autotools/install-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-linux.sh	(revision 26426)
++++ ../trunk-jpl/externalpackages/autotools/install-linux.sh	(revision 26427)
+@@ -7,7 +7,7 @@
+ AUTOCONF_VER="2.69"
+ AUTOMAKE_VER="1.16.1"
+ LIBTOOL_VER="2.4.2"
+-M4_VER="1.4.18"
++M4_VER="1.4.19"
+ 
+ PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+ 
+Index: ../trunk-jpl/externalpackages/autotools/install-mac.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-mac.sh	(revision 26426)
++++ ../trunk-jpl/externalpackages/autotools/install-mac.sh	(revision 26427)
+@@ -7,7 +7,7 @@
+ AUTOCONF_VER="2.69"
+ AUTOMAKE_VER="1.16.1"
+ LIBTOOL_VER="2.4.2"
+-M4_VER="1.4.18"
++M4_VER="1.4.19"
+ 
+ PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+ 
+Index: ../trunk-jpl/externalpackages/autotools/install-win.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install-win.sh	(revision 26426)
++++ ../trunk-jpl/externalpackages/autotools/install-win.sh	(revision 26427)
+@@ -8,7 +8,7 @@
+ AUTOMAKE_MIN_VER="1.16"
+ AUTOMAKE_VER="${AUTOMAKE_MIN_VER}.1"
+ LIBTOOL_VER="2.4.2"
+-M4_VER="1.4.18"
++M4_VER="1.4.19"
+ 
+ PREFIX="${ISSM_DIR}/externalpackages/autotools/install" # Set to location where external package should be installed
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26427-26428.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26427-26428.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26427-26428.diff	(revision 26740)
@@ -0,0 +1,104 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-adolc-ampion	(revision 26428)
+@@ -42,7 +42,7 @@
+ EXTERNALPACKAGES="
+ 	autotools		install-mac.sh
+ 	cmake			install.sh
+-	petsc			install-3.14-mac.sh
++	petsc			install-3.12-mac.sh
+ 	gsl				install.sh
+ 	triangle		install-mac.sh
+ 	adjoinablempi	install-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-basic
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26428)
+@@ -34,7 +34,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	triangle	install-mac.sh
+ 	chaco		install.sh
+ 	m1qn3		install.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-dakota
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-dakota	(revision 26428)
+@@ -45,7 +45,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-examples
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-examples	(revision 26428)
+@@ -46,7 +46,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-full	(revision 26428)
+@@ -43,7 +43,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-full-valgrind
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-full-valgrind	(revision 26428)
+@@ -43,7 +43,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-python
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-python	(revision 26428)
+@@ -38,7 +38,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26427)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth-lambert	(revision 26428)
+@@ -45,7 +45,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26428-26429.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26428-26429.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26428-26429.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive801.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26429-26430.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26429-26430.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26429-26430.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-solid_earth
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26429)
++++ ../trunk-jpl/jenkins/pine_island-mac-solid_earth	(revision 26430)
+@@ -45,7 +45,7 @@
+ EXTERNALPACKAGES="
+ 	autotools	install-mac.sh
+ 	cmake		install.sh
+-	petsc		install-3.14-mac.sh
++	petsc		install-3.12-mac.sh
+ 	gsl			install.sh
+ 	boost		install-1.7-mac.sh
+ 	dakota		install-6.2-mac.sh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26430-26431.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26430-26431.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26430-26431.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/test/MITgcm/build.sh
+===================================================================
+--- ../trunk-jpl/test/MITgcm/build.sh	(revision 26430)
++++ ../trunk-jpl/test/MITgcm/build.sh	(revision 26431)
+@@ -23,11 +23,18 @@
+ 
+ #create MITgcm makefile for this run, if needed
+ if [ ! -f Makefile ]; then
+-    if [ $hostname == "pleiades" ]; then 
+-	$modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $modelpath/../MITgcm/install
+-    else
+-	$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
+-    fi
++	case $hostname in
++		"pleiades")
++			$modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $modelpath/../MITgcm/install
++			;;
++		"babylon")
++			$modelpath/../MITgcm/install/tools/genmake2 -of $modelpath/../MITgcm/install/tools/build_options/linux_amd64_ifort -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
++			export LD_LIBRARY_PATH="$ISSM_DIR/externalpackages/petsc/install/lib:/dartfs-hpc/admin/opt/el7/intel/compilers_and_libraries_2019.3.199/linux/compiler/lib/intel64:$ISSM_DIR/externalpackages/triangle/install/lib"
++			;;
++		*)
++			$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
++			;;
++	esac
+ fi
+ 
+ #create MITgcm code links for this run, if needed
+@@ -34,5 +41,4 @@
+ if [ ! -f BUILD_INFO.h ]; then
+     make depend
+ fi
+-
+-make -j 4
++make -j 4 &> Makefile.log
Index: /issm/oecreview/Archive/25834-26739/ISSM-26431-26432.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26431-26432.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26431-26432.diff	(revision 26740)
@@ -0,0 +1,442 @@
+Index: ../trunk-jpl/src/c/cores/ad_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/ad_core.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/cores/ad_core.cpp	(revision 26432)
+@@ -325,7 +325,7 @@
+ 			if(VerboseAutodiff())_printf0_("   start CoDiPack ad core\n");
+ 
+ 			/*First, stop tracing: */
+-			auto& tape_codi = IssmDouble::getGlobalTape();
++			auto& tape_codi = IssmDouble::getTape();
+ 			tape_codi.setPassive();
+ 
+ 			if(VerboseAutodiff()){ /*{{{*/
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26432)
+@@ -74,7 +74,7 @@
+ 		 * - ADOL-C variant sets a garbage collection parameter for its tape
+ 		 * -> These parameters are not read for the CoDiPack ISSM version!
+ 		 */
+-		auto& tape_codi = IssmDouble::getGlobalTape();
++		auto& tape_codi = IssmDouble::getTape();
+ 		tape_codi.setActive();
+ 		#if _AD_TAPE_ALLOC_
+ 		//alloc_profiler.Tag(StartInit, true);
+@@ -87,7 +87,7 @@
+ 		}
+ 		/*
+ 		std::stringstream out_s;
+-		IssmDouble::getGlobalTape().printStatistics(out_s);
++		IssmDouble::getTape().printStatistics(out_s);
+ 		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
+ 		*/
+ 		//alloc_profiler.Tag(FinishInit, true);
+@@ -152,13 +152,13 @@
+ 		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
+ 		#endif
+ 		std::stringstream out_s;
+-		IssmDouble::getGlobalTape().printStatistics(out_s);
++		IssmDouble::getTape().printStatistics(out_s);
+ 		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
+ 		#endif
+ 	} /*}}}*/
+ 
+ 	#elif defined(_HAVE_CODIPACK_)
+-	auto& tape_codi = IssmDouble::getGlobalTape();
++	auto& tape_codi = IssmDouble::getTape();
+ 	tape_codi.setPassive();
+ 	if(VerboseAutodiff()){
+ 		int my_rank=IssmComm::GetRank();
+@@ -238,13 +238,13 @@
+ 		}
+ 	}
+ 	#elif defined(_HAVE_CODIPACK_)
+-	auto& tape_codi = IssmDouble::getGlobalTape();
++	auto& tape_codi = IssmDouble::getTape();
+ 	codi_global.input_indices.clear();
+ 	if(my_rank==0){
+ 		for (int i=0;i<intn;i++) {
+ 			aX[i]=X[i];
+ 			tape_codi.registerInput(aX[i]);
+-			codi_global.input_indices.push_back(aX[i].getGradientData());
++			codi_global.input_indices.push_back(aX[i].getIdentifier());
+ 		}
+ 	}
+ 	#else
+@@ -284,7 +284,7 @@
+ 			#if defined(_HAVE_CODIPACK_)
+ 			tape_codi.registerOutput(output_value);
+ 			dependents[i] = output_value.getValue();
+-			codi_global.output_indices.push_back(output_value.getGradientData());
++			codi_global.output_indices.push_back(output_value.getIdentifier());
+ 
+ 			#elif defined(_HAVE_ADOLC_)
+ 			output_value>>=dependents[i];
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26432)
+@@ -373,7 +373,7 @@
+ 	delete hdl_countdoubles;
+ 
+ 	/*Start tracing*/
+-	auto& tape_codi = IssmDouble::getGlobalTape();
++	auto& tape_codi = IssmDouble::getTape();
+ 	tape_codi.setActive();
+ 
+ 	/*Reverse dependent (f)*/
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26432)
+@@ -74,7 +74,7 @@
+ 	this->double_count = 0;
+ 	this->identifiers  = identifiers_in;
+ 	this->size_max         = size_max_in;
+-	this->tape_codi    = &(IssmDouble::getGlobalTape());
++	this->tape_codi    = &(IssmDouble::getTape());
+ }/*}}}*/
+ void RegisterInputFunctor::Echo(void){/*{{{*/
+ 	printf("RegisterInputFunctor Echo:\n");
+@@ -83,7 +83,7 @@
+ void RegisterInputFunctor::call(IssmDouble & value){/*{{{*/
+ 	_assert_(this->double_count<size_max);
+ 	this->tape_codi->registerInput(value);
+-	this->identifiers[this->double_count] = value.getGradientData();
++	this->identifiers[this->double_count] = value.getIdentifier();
+ 	this->double_count++;
+ }/*}}}*/
+ void RegisterInputFunctor::call(IssmDouble* & value,int size){/*{{{*/
+@@ -91,7 +91,7 @@
+ 		for(int i=0;i<size;i++){
+ 			_assert_(this->double_count<size_max);
+ 			this->tape_codi->registerInput(value[i]);
+-			this->identifiers[this->double_count] = value[i].getGradientData();
++			this->identifiers[this->double_count] = value[i].getIdentifier();
+ 			this->double_count++;
+ 		}
+ 	}
+@@ -99,7 +99,7 @@
+ 
+ RegisterOutputFunctor::RegisterOutputFunctor(void) : MarshallHandle(AD_REGISTEROUTPUT){/*{{{*/
+ 	this->double_count = 0;
+-	this->tape_codi    = &(IssmDouble::getGlobalTape());
++	this->tape_codi    = &(IssmDouble::getTape());
+ }/*}}}*/
+ void RegisterOutputFunctor::Echo(void){/*{{{*/
+ 	printf("RegisterOutputFunctor Echo:\n");
+@@ -120,7 +120,7 @@
+ 
+ SetAdjointFunctor::SetAdjointFunctor(double* adjoint_in,int size_max_in) : MarshallHandle(AD_SETADJOINT){/*{{{*/
+ 	this->double_count = 0;
+-	this->tape_codi    = &(IssmDouble::getGlobalTape());
++	this->tape_codi    = &(IssmDouble::getTape());
+ 	this->adjoint      = adjoint_in;
+ 	this->size_max     = size_max_in;
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 26431)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 26432)
+@@ -127,7 +127,7 @@
+ 		int  double_count;
+ 		int *identifiers;
+ 		int  size_max;
+-		IssmDouble::TapeType *tape_codi;
++		IssmDouble::Tape *tape_codi;
+ 
+ 	public:
+ 		RegisterInputFunctor(int* identifiers_in,int size_max_in);
+@@ -141,7 +141,7 @@
+ 
+ 	private:
+ 		int   double_count;
+-		IssmDouble::TapeType* tape_codi;
++		IssmDouble::Tape* tape_codi;
+ 
+ 	public:
+ 		RegisterOutputFunctor(void);
+@@ -156,7 +156,7 @@
+ 	private:
+ 		int                   double_count;
+ 		int                   size_max;
+-		IssmDouble::TapeType* tape_codi;
++		IssmDouble::Tape* tape_codi;
+ 		double*               adjoint;
+ 
+ 	public:
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 26431)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 26432)
+@@ -30,9 +30,11 @@
+ 			//#define TOOL CoDiPackTool<IssmDouble>
+ 			//#define AMPI_ADOUBLE TOOL::MPI_TYPE
+ 			//
++			//#include <codi/externals/codiMpiTypes.hpp>
++			//using MpiTypes = CoDiMpiTypes<IssmDouble>;
+ 			/*New implementation*/
+-			#include <codi/externals/codiMpiTypes.hpp>
+-			using MpiTypes = CoDiMpiTypes<IssmDouble>;
++			#include <codi/tools/mpi/codiMpiTypes.hpp>
++         using MpiTypes = codi::CoDiMpiTypes<IssmDouble>;
+ 			extern MpiTypes* mpiTypes;
+ 			#define AMPI_ADOUBLE mpiTypes->MPI_TYPE
+ 			#elif defined(_HAVE_ADOLC_)
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26432)
+@@ -2306,7 +2306,7 @@
+ 			dependents=xNew<IssmPDouble>(num_dependents);
+ 
+ 			#if defined(_HAVE_CODIPACK_)
+-			auto& tape_codi = IssmDouble::getGlobalTape();
++			auto& tape_codi = IssmDouble::getTape();
+ 			#endif
+ 
+ 			/*Go through our dependent variables, and compute the response:*/
+@@ -2318,7 +2318,7 @@
+ 					#if defined(_HAVE_CODIPACK_)
+ 						tape_codi.registerOutput(output_value);
+ 						dependents[i] = output_value.getValue();
+-						codi_global.output_indices.push_back(output_value.getGradientData());
++						codi_global.output_indices.push_back(output_value.getIdentifier());
+ 					#else
+ 						output_value>>=dependents[i];
+ 					#endif
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26432)
+@@ -2064,9 +2064,9 @@
+ 			} else {
+ 				scalar=pscalar;
+ 			}
+-			auto& tape_codi = IssmDouble::getGlobalTape();
++			auto& tape_codi = IssmDouble::getTape();
+ 			tape_codi.registerInput(scalar);
+-			codi_global.input_indices.push_back(scalar.getGradientData());
++			codi_global.input_indices.push_back(scalar.getIdentifier());
+ 		#else
+ 			if(X){
+ 				scalar<<=X[Xcount];
+@@ -2137,12 +2137,12 @@
+ 			  If we have been supplied an X vector, use it instead of what we just read: */
+ 			#if defined(_HAVE_CODIPACK_)
+ 				// FIXME codi here we just assign instead of using "operator <<="
+-				auto& tape_codi = IssmDouble::getGlobalTape();
++				auto& tape_codi = IssmDouble::getTape();
+ 				if(X){
+ 					for (int i=0;i<M*N;i++) {
+ 						matrix[i]=X[Xcount+i];
+ 						tape_codi.registerInput(matrix[i]);
+-						codi_global.input_indices.push_back(matrix[i].getGradientData());
++						codi_global.input_indices.push_back(matrix[i].getIdentifier());
+ 					}
+ 				}
+ 				else{
+@@ -2149,7 +2149,7 @@
+ 					for (int i=0;i<M*N;i++) {
+ 						matrix[i]=buffer[i];
+ 						tape_codi.registerInput(matrix[i]);
+-						codi_global.input_indices.push_back(matrix[i].getGradientData());
++						codi_global.input_indices.push_back(matrix[i].getIdentifier());
+ 					}
+ 				}
+ 			#else /*ADOLC*/
+@@ -2962,7 +2962,7 @@
+ 		 * - ADOL-C variant sets a garbage collection parameter for its tape
+ 		 * -> These parameters are not read for the CoDiPack ISSM version!
+ 		 */
+-		auto& tape_codi = IssmDouble::getGlobalTape();
++		auto& tape_codi = IssmDouble::getTape();
+ 		tape_codi.setActive();
+ 		#if _AD_TAPE_ALLOC_
+ 		//alloc_profiler.Tag(StartInit, true);
+@@ -2975,7 +2975,7 @@
+ 		}
+ 		/*
+ 		std::stringstream out_s;
+-		IssmDouble::getGlobalTape().printStatistics(out_s);
++		IssmDouble::getTape().printStatistics(out_s);
+ 		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
+ 		*/
+ 		tape_codi.reset();
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 26432)
+@@ -49,7 +49,7 @@
+ 		 * - ADOL-C variant sets a garbage collection parameter for its tape
+ 		 * -> These parameters are not read for the CoDiPack ISSM version!
+ 		 */
+-		auto& tape_codi = IssmDouble::getGlobalTape();
++		auto& tape_codi = IssmDouble::getTape();
+ 		tape_codi.setActive();
+ 		#if _AD_TAPE_ALLOC_
+ 		//alloc_profiler.Tag(StartInit, true);
+@@ -62,7 +62,7 @@
+ 		}
+ 		/*
+ 		std::stringstream out_s;
+-		IssmDouble::getGlobalTape().printStatistics(out_s);
++		IssmDouble::getTape().printStatistics(out_s);
+ 		_printf0_("StartTrace::Tape Statistics	   : TapeAlloc count=[" << codi_allocn << "]\n" << out_s.str());
+ 		*/
+ 		#endif
+@@ -126,13 +126,13 @@
+ 		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
+ 		#endif
+ 		std::stringstream out_s;
+-		IssmDouble::getGlobalTape().printStatistics(out_s);
++		IssmDouble::getTape().printStatistics(out_s);
+ 		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
+ 		#endif
+ 	} /*}}}*/
+ 
+ 	#elif defined(_HAVE_CODIPACK_)
+-	auto& tape_codi = IssmDouble::getGlobalTape();
++	auto& tape_codi = IssmDouble::getTape();
+ 	tape_codi.setPassive();
+ 	if(VerboseAutodiff()){
+ 		int my_rank=IssmComm::GetRank();
+@@ -189,13 +189,13 @@
+ 	#elif defined(_HAVE_CODIPACK_)
+ 	simul_starttrace2(femmodel);
+ 	IssmDouble* aX=xNew<IssmDouble>(n);
+-	auto& tape_codi = IssmDouble::getGlobalTape();
++	auto& tape_codi = IssmDouble::getTape();
+ 	codi_global.input_indices.clear();
+ 	if(my_rank==0){
+ 		for (int i=0;i<n;i++) {
+ 			aX[i]=X0[i];
+ 			tape_codi.registerInput(aX[i]);
+-			codi_global.input_indices.push_back(aX[i].getGradientData());
++			codi_global.input_indices.push_back(aX[i].getIdentifier());
+ 		}
+ 	}
+ 	SetControlInputsFromVectorx(femmodel,aX);
+@@ -229,7 +229,7 @@
+ 		if(my_rank==0) {
+ 			tape_codi.registerOutput(output_value);
+ 			dependents[i] = output_value.getValue();
+-			codi_global.output_indices.push_back(output_value.getGradientData());
++			codi_global.output_indices.push_back(output_value.getIdentifier());
+ 			J+=output_value;
+ 		}
+ 	}
+Index: ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26431)
++++ ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26432)
+@@ -34,7 +34,7 @@
+ template<typename Real, typename Data>
+ inline void getVectorGradData(const Real* vec, Data* dataVec, int n) {
+   for(int i = 0; i < n; ++i) {
+-    dataVec[i]=vec[i].getGradientData();
++    dataVec[i]=vec[i].getIdentifier();
+   }
+ }
+ 
+@@ -42,7 +42,7 @@
+ inline void getVectorPrimalAndGradData(const Real* vec, Passive* pasVec, Data* dataVec, int n) {
+   for(int i = 0; i < n; ++i) {
+     pasVec[i]=vec[i].getValue();
+-    dataVec[i]=vec[i].getGradientData();
++    dataVec[i]=vec[i].getIdentifier();
+   }
+ }
+ 
+@@ -49,16 +49,16 @@
+ template<typename Real, typename Passive, typename Data>
+ inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) {
+   pas=value.getValue();
+-  data=value.getGradientData();
++  data=value.getIdentifier();
+ }
+ 
+ template<typename Real, typename Data>
+ inline void registerVector(Real* vec, Data* dataVec, int n) {
+-  typename Real::TapeType& tape = Real::getGlobalTape();
++  typename Real::TapeType& tape = Real::getTape();
+ 
+   for(int i = 0; i < n; ++i) {
+     tape.registerInput(vec[i]);
+-    dataVec[i]=vec[i].getGradientData();
++    dataVec[i]=vec[i].getIdentifier();
+   }
+ }
+ 
+Index: ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26432)
+@@ -257,8 +257,8 @@
+ 
+ 	/*recast data_in and tape*/
+ 	codi::DataStore* data = (codi::DataStore*)data_in;
+-	//IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
+-	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++	//IssmDouble::Tape& tape = (IssmDouble::Tape&)tape_in;
++	IssmDouble::Tape& tape = IssmDouble::getTape();
+ 
+   IssmDouble::Real* valueATrans;
+   IssmDouble::GradientData* indexATrans;
+@@ -276,10 +276,10 @@
+ 
+ 
+   // create the adjoint vector for x and reset the adjoint values on the tape
+-  IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
++  IssmDouble::Gradient* adjX = xNew<IssmDouble::Gradient>(n);
+   getVectorAdjoint(tape, indexX, adjX, n);
+ 
+-  IssmDouble::GradientValue* sol  = xNew<IssmDouble::GradientValue>(n);
++  IssmDouble::Gradient* sol  = xNew<IssmDouble::Gradient>(n);
+   SolverxSeq(sol, valueATrans, adjX, n);
+ 
+   updateVectorAdjoint(tape, indexB, sol, n);
+@@ -323,7 +323,7 @@
+ }
+ /*}}}*/
+ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+-  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++  IssmDouble::Tape& tape = IssmDouble::getTape();
+   codi::DataStore* dataHandler = NULL;
+ 
+   if(tape.isActive()) {
+Index: ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26431)
++++ ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26432)
+@@ -488,8 +488,8 @@
+ 
+ 	/*recast data_in and tape*/
+   codi::DataStore* data = (codi::DataStore*)data_in;
+-  //IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
+-  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++  //IssmDouble::Tape& tape = (IssmDouble::Tape&)tape_in;
++  IssmDouble::Tape& tape = IssmDouble::getTape();
+ 
+ 
+   IssmDouble::Real* valueATrans;
+@@ -517,7 +517,7 @@
+   data->getData(parameters);
+ 
+   // create the adjoint vector for x and reset the adjoint values on the tape
+-  IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
++  IssmDouble::Gradient* adjX = xNew<IssmDouble::Gradient>(n);
+   getVectorAdjoint(tape, indexX, adjX, n);
+ 
+   MumpsSolve(n, nnz, local_nnz, irnATrans, jcnATrans, valueATrans, adjX, parameters);
+@@ -580,7 +580,7 @@
+ }
+ /*}}}*/
+ void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc,IssmDouble *a_loc,IssmDouble *rhs,Parameters* parameters){/*{{{*/
+-  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++  IssmDouble::Tape& tape = IssmDouble::getTape();
+   codi::DataStore* dataHandler = NULL;
+ 
+   if(tape.isActive()) {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26432-26433.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26432-26433.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26432-26433.diff	(revision 26740)
@@ -0,0 +1,259 @@
+Index: ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26432)
++++ ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26433)
+@@ -54,7 +54,7 @@
+ 
+ template<typename Real, typename Data>
+ inline void registerVector(Real* vec, Data* dataVec, int n) {
+-  typename Real::TapeType& tape = Real::getTape();
++  typename Real::Tape& tape = Real::getTape();
+ 
+   for(int i = 0; i < n; ++i) {
+     tape.registerInput(vec[i]);
+Index: ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26432)
++++ ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26433)
+@@ -484,21 +484,21 @@
+ #endif
+ 
+ #ifdef _HAVE_CODIPACK_
+-void MumpsSolve_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
++using Tape = typename IssmDouble::Tape;
++using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
+ 
++void MumpsSolve_codi_b(Tape* tape, void* data_in, AccessInterface* ra) {/*{{{*/
++
+ 	/*recast data_in and tape*/
+-  codi::DataStore* data = (codi::DataStore*)data_in;
+-  //IssmDouble::Tape& tape = (IssmDouble::Tape&)tape_in;
+-  IssmDouble::Tape& tape = IssmDouble::getTape();
++  codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
+ 
+-
+   IssmDouble::Real* valueATrans;
+-  IssmDouble::GradientData* indexATrans;
++  IssmDouble::Identifier* indexATrans;
+   int* irnATrans;
+   int* jcnATrans;
+-  IssmDouble::GradientData* indexB;
++  IssmDouble::Identifier* indexB;
+   IssmDouble::Real* valueX;
+-  IssmDouble::GradientData* indexX;
++  IssmDouble::Identifier* indexX;
+   int n;
+   int nnz;
+   int local_nnz;
+@@ -518,12 +518,12 @@
+ 
+   // create the adjoint vector for x and reset the adjoint values on the tape
+   IssmDouble::Gradient* adjX = xNew<IssmDouble::Gradient>(n);
+-  getVectorAdjoint(tape, indexX, adjX, n);
++  getVectorAdjoint(*tape, indexX, adjX, n);
+ 
+   MumpsSolve(n, nnz, local_nnz, irnATrans, jcnATrans, valueATrans, adjX, parameters);
+   // adjX contains now the solution
+ 
+-  updateVectorAdjoint(tape, indexB, adjX, n);
++  updateVectorAdjoint(*tape, indexB, adjX, n);
+ 
+   // bcast dp_y (the solution of the forward system)
+   ISSM_MPI_Bcast(valueX,n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
+@@ -533,24 +533,24 @@
+   for(int i=0; i<local_nnz; ++i) {
+     // we access the transposed matrix here because we stored the indices in a transposed way
+     // -1 is substracted because jcn and irn are stored with fortran indexing
+-    updateAdjoint(tape, indexATrans[i], -adjX[jcnATrans[i]-1]*valueX[irnATrans[i]-1]);
++    updateAdjoint(*tape, indexATrans[i], -adjX[jcnATrans[i]-1]*valueX[irnATrans[i]-1]);
+   }
+ 
+   xDelete(adjX);
+ }
+ /*}}}*/
+-void MumpsSolve_codi_delete(void* tape_in,void* data_in) {/*{{{*/
++void MumpsSolve_codi_delete(Tape* tape,void* data_in) {/*{{{*/
+ 
+ 	/*recast data_in*/
+-	codi::DataStore* data = (codi::DataStore*)data_in;
++	codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
+ 
+   IssmDouble::Real* valueATrans;
+-  IssmDouble::GradientData* indexATrans;
++  IssmDouble::Identifier* indexATrans;
+   int* irnATrans;
+   int* jcnATrans;
+-  IssmDouble::GradientData* indexB;
++  IssmDouble::Identifier* indexB;
+   IssmDouble::Real* valueX;
+-  IssmDouble::GradientData* indexX;
++  IssmDouble::Identifier* indexX;
+   int n;
+   int nnz;
+   int local_nnz;
+@@ -581,14 +581,14 @@
+ /*}}}*/
+ void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc,IssmDouble *a_loc,IssmDouble *rhs,Parameters* parameters){/*{{{*/
+   IssmDouble::Tape& tape = IssmDouble::getTape();
+-  codi::DataStore* dataHandler = NULL;
++  codi::ExternalFunctionUserData* dataHandler = NULL;
+ 
+   if(tape.isActive()) {
+-    dataHandler = new codi::DataStore();
++    dataHandler = new codi::ExternalFunctionUserData();
+ 
+     // create the index and double vector for the matrix
+     IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(local_nnz);
+-    IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(local_nnz);
++    IssmDouble::Identifier* indexATrans = xNew<IssmDouble::Identifier>(local_nnz);
+     int* irnATrans = xNew<int>(local_nnz);
+     int* jcnATrans = xNew<int>(local_nnz);
+ 
+@@ -600,7 +600,7 @@
+     }
+ 
+     // create the index vector for a (primal values are not needed for a)
+-    IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
++    IssmDouble::Identifier* indexB = xNew<IssmDouble::Identifier>(n);
+     getVectorGradData(rhs, indexB, n);
+ 
+     dataHandler->addData(valueATrans);
+@@ -625,7 +625,7 @@
+ 
+   if(tape.isActive()) {
+     // create the index vector X and register x as active variables
+-    IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
++    IssmDouble::Identifier* indexX = xNew<IssmDouble::Identifier>(n);
+     registerVector(rhs, indexX, n);
+ 
+     dataHandler->addData(valueB); // contains the values from x
+@@ -637,8 +637,7 @@
+     dataHandler->addData(local_nnz);
+     dataHandler->addData(parameters); // we assume here that parameters is still intact when the reverse run is called
+ 
+-	 //tape.pushExternalFunction(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
+-    tape.pushExternalFunctionHandle(&MumpsSolve_codi_b,(void*)dataHandler, &MumpsSolve_codi_delete);
++	 tape.pushExternalFunction(codi::ExternalFunction<Tape>::create(&MumpsSolve_codi_b,(void*)dataHandler, &MumpsSolve_codi_delete));
+   }
+   else{
+     // if the tape is active valueB is stored in the dataHandler and deleted in the reverse sweep
+Index: ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26432)
++++ ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26433)
+@@ -253,18 +253,18 @@
+ #endif
+ 
+ #ifdef _HAVE_CODIPACK_
+-void SolverxSeq_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
++using Tape = typename IssmDouble::Tape;
++using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
++void SolverxSeq_codi_b(Tape* tape,void* data_in, AccessInterface* ra) {/*{{{*/
+ 
+ 	/*recast data_in and tape*/
+-	codi::DataStore* data = (codi::DataStore*)data_in;
+-	//IssmDouble::Tape& tape = (IssmDouble::Tape&)tape_in;
+-	IssmDouble::Tape& tape = IssmDouble::getTape();
++	codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
+ 
+   IssmDouble::Real* valueATrans;
+-  IssmDouble::GradientData* indexATrans;
+-  IssmDouble::GradientData* indexB;
++  IssmDouble::Identifier* indexATrans;
++  IssmDouble::Identifier* indexB;
+   IssmDouble::Real* valueX;
+-  IssmDouble::GradientData* indexX;
++  IssmDouble::Identifier* indexX;
+   int n;
+ 
+   data->getData(valueATrans);
+@@ -274,19 +274,18 @@
+   data->getData(indexX);
+   data->getData(n);
+ 
+-
+   // create the adjoint vector for x and reset the adjoint values on the tape
+   IssmDouble::Gradient* adjX = xNew<IssmDouble::Gradient>(n);
+-  getVectorAdjoint(tape, indexX, adjX, n);
++  getVectorAdjoint(*tape, indexX, adjX, n);
+ 
+   IssmDouble::Gradient* sol  = xNew<IssmDouble::Gradient>(n);
+   SolverxSeq(sol, valueATrans, adjX, n);
+ 
+-  updateVectorAdjoint(tape, indexB, sol, n);
++  updateVectorAdjoint(*tape, indexB, sol, n);
+   for(int i=0; i<n; ++i) {
+     for (int j=0; j<n; ++j) {
+       // we access the transposed matrix here because we stored the indices in a transposed way
+-      updateAdjoint(tape, indexATrans[i*n+j], -sol[j]*valueX[i]);
++      updateAdjoint(*tape, indexATrans[i*n+j], -sol[j]*valueX[i]);
+     }
+   }
+ 
+@@ -294,16 +293,16 @@
+   xDelete(adjX);
+ }
+ /*}}}*/
+-void SolverxSeq_codi_delete(void* tape_in,void* data_in) {/*{{{*/
++void SolverxSeq_codi_delete(Tape* tape,void* data_in) {/*{{{*/
+ 
+ 	/*recast data_in*/
+-	codi::DataStore* data = (codi::DataStore*)data_in;
++	codi::ExternalFunctionUserData* data = (codi::ExternalFunctionUserData*)data_in;
+ 
+   IssmDouble::Real* valueATrans;
+-  IssmDouble::GradientData* indexATrans;
+-  IssmDouble::GradientData* indexB;
++  IssmDouble::Identifier* indexATrans;
++  IssmDouble::Identifier* indexB;
+   IssmDouble::Real* valueX;
+-  IssmDouble::GradientData* indexX;
++  IssmDouble::Identifier* indexX;
+   int n;
+ 
+   data->getData(valueATrans);
+@@ -324,14 +323,14 @@
+ /*}}}*/
+ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
+   IssmDouble::Tape& tape = IssmDouble::getTape();
+-  codi::DataStore* dataHandler = NULL;
++  codi::ExternalFunctionUserData* dataHandler = NULL;
+ 
+   if(tape.isActive()) {
+-    dataHandler = new codi::DataStore();
++    dataHandler = new codi::ExternalFunctionUserData();
+ 
+     // create the index vector and the double data for A and B
+     IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(n*n);
+-    IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(n*n);
++    IssmDouble::Identifier* indexATrans = xNew<IssmDouble::Identifier>(n*n);
+ 
+     // read the data for matrix in a transposed fashion
+ 	  for (int i=0; i<n; ++i) {
+@@ -341,7 +340,7 @@
+     }
+ 
+     // read the data from B (primal values are not required vor B
+-    IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
++    IssmDouble::Identifier* indexB = xNew<IssmDouble::Identifier>(n);
+     getVectorGradData(B, indexB, n);
+ 
+     dataHandler->addData(valueATrans);
+@@ -365,7 +364,7 @@
+ 
+   if(tape.isActive()) {
+     // create the index vector X and register x as active variables
+-    IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
++    IssmDouble::Identifier* indexX = xNew<IssmDouble::Identifier>(n);
+     registerVector(X, indexX, n);
+ 
+     dataHandler->addData(valueX);
+@@ -374,7 +373,7 @@
+     // store other arguments
+     dataHandler->addData(n);
+ 
+-    tape.pushExternalFunctionHandle(&SolverxSeq_codi_b, dataHandler, &SolverxSeq_codi_delete);
++	 tape.pushExternalFunction(codi::ExternalFunction<Tape>::create(&SolverxSeq_codi_b,(void*)dataHandler, &SolverxSeq_codi_delete));
+   }
+   else{
+     // if the tape is active valueX is stored in the dataHandler and deleted in the reverse sweep
Index: /issm/oecreview/Archive/25834-26739/ISSM-26433-26434.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26433-26434.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26433-26434.diff	(revision 26740)
@@ -0,0 +1,41 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26433)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26434)
+@@ -320,14 +320,13 @@
+ 				break;
+ 			case 5:{
+ 				/*SUPG*/
+-				mf_vx_input->GetInputAverage(&w[0]);
+-				mf_vy_input->GetInputAverage(&w[1]);
+-				vel=sqrt(w[0]*w[0]+w[1]*w[1])+1.e-8;
++				IssmDouble vx,vy;
++				mf_vx_input->GetInputAverage(&vx);
++				mf_vy_input->GetInputAverage(&vy);
++				vel=sqrt(vx*vx+vy*vy)+1.e-8;
+ 				IssmPDouble xi=1.;
+ 				IssmDouble  tau=xi*h/(2*vel);
+ 
+-				IssmDouble vx,vy;
+-				vx = w[0]; vy = w[1];
+ 				/*Mass matrix - part 2*/
+ 				for(int i=0;i<numnodes;i++){
+ 					for(int j=0;j<numnodes;j++){
+@@ -370,7 +369,7 @@
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+-	basalelement->FindParam(&stabilization,MasstransportStabilizationEnum);
++	basalelement->FindParam(&stabilization,LevelsetStabilizationEnum);
+ 
+ 	/*Initialize Element vector*/
+ 	ElementVector* pe = basalelement->NewElementVector();
+@@ -405,7 +404,7 @@
+ 			mf_vx_input->GetInputAverage(&vx);
+ 			mf_vy_input->GetInputAverage(&vy);
+ 			vel=sqrt(vx*vx+vy*vy)+1.e-8;
+-			IssmPDouble xi=1;
++			IssmPDouble xi=1.;
+ 			IssmDouble  tau=xi*h/(2*vel);
+ 
+ 			/*Force vector - part 2*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26434-26435.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26434-26435.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26434-26435.diff	(revision 26740)
@@ -0,0 +1,252 @@
+Index: ../trunk-jpl/src/m/classes/clusters/smce_eis.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/smce_eis.py	(revision 26434)
++++ ../trunk-jpl/src/m/classes/clusters/smce_eis.py	(revision 26435)
+@@ -1,3 +1,5 @@
++import os
++import shutil
+ import subprocess
+ 
+ try:
+@@ -7,12 +9,9 @@
+ from fielddisplay import fielddisplay
+ from helpers import *
+ from IssmConfig import IssmConfig
+-from issmscpin import issmscpin
+-from issmscpout import issmscpout
+ from issmssh import issmssh
+ from MatlabFuncs import *
+ from pairoptions import pairoptions
+-from QueueRequirements import QueueRequirements
+ 
+ class smce_eis(object):
+     """SMCE_EIS cluster class definition
+@@ -24,22 +23,20 @@
+     """
+ 
+     def __init__(self, *args):  # {{{
+-        self.name = oshostname()
+-        self.login = ''
++        self.name = '52.54.75.45'
++        self.login = 'jdquinn1'
++        self.idfile = '~/.ssh/smce-aws-eis-pilot'
+         self.modules = []
+-        self.numnodes = 20
+-        self.cpuspernode = 8
++        self.numnodes = 8
++        self.cpuspernode = 1
+         self.port = 0
+-        self.queue = 'general'
+         self.time = 12 * 60 * 60
+-        self.processor = 'west'
++        self.processor = 'skylake'
+         self.srcpath = '/shared/issm/issm/trunk-jpl'
+         self.codepath = '/shared/issm/issm/trunk-jpl/bin'
+-        self.executionpath = ''
+-        self.grouplist = ''
++        self.executionpath = '/home/jdquinn1/issm-exec'
+         self.interactive = 0
+-        self.bbftp = 0
+-        self.numstreams = 8
++        self.numstreams = 1
+         self.hyperthreading = 0
+         self.email = ''
+ 
+@@ -61,20 +58,18 @@
+         s = 'class smce_eis object\n'
+         s += '    name: {}\n'.format(self.name)
+         s += '    login: {}\n'.format(self.login)
++        s += '    idfile: {}\n'.format(self.idfile)
+         s += '    modules: {}\n'.format(strjoin(self.modules, ', '))
+         s += '    numnodes: {}\n'.format(self.numnodes)
+         s += '    cpuspernode: {}\n'.format(self.cpuspernode)
+         s += '    np: {}\n'.format(self.nprocs())
+         s += '    port: {}\n'.format(self.port)
+-        s += '    queue: {}\n'.format(self.queue)
+         s += '    time: {}\n'.format(self.time)
+         s += '    processor: {}\n'.format(self.processor)
+         s += '    srcpath: {}\n'.format(self.srcpath)
+         s += '    codepath: {}\n'.format(self.codepath)
+         s += '    executionpath: {}\n'.format(self.executionpath)
+-        s += '    grouplist: {}\n'.format(self.grouplist)
+         s += '    interactive: {}\n'.format(self.interactive)
+-        s += '    bbftp: {}\n'.format(self.bbftp)
+         s += '    numstreams: {}\n'.format(self.numstreams)
+         s += '    hyperthreading: {}\n'.format(self.hyperthreading)
+         return s
+@@ -85,24 +80,18 @@
+     # }}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        queuedict = {'long': [24 * 60 * 60, 560],
+-                     'allnccs': [12 * 60 * 60, 6000],
+-                     'debug': [1 * 60 * 60, 532]}
+-        QueueRequirements(queuedict, self.queue, self.nprocs(), self.time)
+-
+         # Now, check cluster.cpuspernode according to processor type
+-        if self.processor == 'sand':
+-            if self.cpuspernode > 16 or self.cpuspernode < 1:
+-                md = md.checkmessage('cpuspernode should be between 1 and 16 for \'sand\' processors in hyperthreading mode')
+-        elif self.processor == 'hasw':
+-            if self.cpuspernode > 28 or self.cpuspernode < 1:
+-                md = md.checkmessage('cpuspernode should be between 1 and 28 for \'hasw\' processors in hyperthreading mode')
++        if self.processor == 'skylake':
++            if self.cpuspernode > 14 or self.cpuspernode < 1:
++                md = md.checkmessage('cpuspernode should be between 1 and 14 for \'skyw\' processors in hyperthreading mode')
+         else:
+-            md = md.checkmessage('unknown processor type, should be \'sand\' or \'hasw\'')
++            md = md.checkmessage('unknown processor type, should be \'skylake\'')
+ 
+         # Miscellaneous
+         if not self.login:
+             md = md.checkmessage('login empty')
++        if self.port:
++            md = md.checkmessage('port must be set to 0 as we do not have an SSH tunnel')
+         if not self.codepath:
+             md = md.checkmessage('codepath empty')
+         if not self.executionpath:
+@@ -128,24 +117,31 @@
+         fid = open(modelname + '.queue', 'w')
+ 
+         fid.write('#!/bin/bash\n')
++        fid.write('#SBATCH --partition=hpc-spot \n')
+         fid.write('#SBATCH -J {} \n'.format(modelname))
+-        fid.write('#SBATCH --qos={} \n'.format(self.queue))
+         fid.write('#SBATCH -o {}.outlog \n'.format(modelname))
+         fid.write('#SBATCH -e {}.errlog \n'.format(modelname))
+-        fid.write('#SBATCH -n {} \n'.format(self.nprocs()))
+-        fid.write('#SBATCH -N {} \n'.format(self.numnodes))
++        fid.write('#SBATCH --nodes={} \n'.format(self.numnodes))
++        fid.write('#SBATCH --ntasks-per-node={} \n'.format(self.cpuspernode))
++        fid.write('#SBATCH --cpus-per-task={} \n'.format(self.numstreams))
+         fid.write('#SBATCH -t {:02d}:{:02d}:00 \n'.format(int(floor(self.time / 3600)), int(floor(self.time % 3600) / 60)))
+-        fid.write('#SBATCH -A {} \n\n'.format(self.grouplist))
+         if (self.email.find('@')>-1):
+             fid.write('#SBATCH --mail-user={} \n'.format(self.email))
+-            fid.write('#SBATCH --mail-type=end \n\n')
+-        # fid.write('. /usr/share/modules/init/bash\n\n')
++            fid.write('#SBATCH --mail-type=BEGIN,END,FAIL \n\n')
+         # for i in range(len(self.modules)):
+         #     fid.write('module load {}\n'.format(self.modules[i]))
+         fid.write('export MPI_GROUP_MAX=64\n\n')
+         fid.write('export MPI_UNBUFFERED_STDIO=true\n\n')
++        fid.write('export PATH="$PATH:/opt/slurm/bin"\n') # TODO: Figure out how to add this to PATH by sourcing environment script
+         fid.write('export PATH="$PATH:."\n\n')
+         fid.write('export ISSM_DIR="{}"\n'.format(self.srcpath)) # FIXME
++        fid.write('export HYDRA_HOST_FILE={}/{}/'.format(self.executionpath, dirname))
++        fid.write('${USER}-hydranodes-sj:${SLURM_JOB_ID}\n')
++        #fid.write('source /usr/share/modules/init/bash\n')
++        #fid.write('source /efs/spack-justin/share/spack/setup-env.sh\n')
++        #fid.write('module load gcc-9.3.0-gcc-9.3.0-ug2hqa3\n')
++        fid.write('touch ${HYDRA_HOST_FILE}\n')
++        fid.write('/efs/mrilee/snodelist/build/snodelist -m -f "%h%[:]c" >> ${HYDRA_HOST_FILE}\n')
+         fid.write('source $ISSM_DIR/etc/environment.sh\n') # FIXME
+         fid.write('cd {}/{}/\n\n'.format(self.executionpath, dirname))
+ 
+@@ -186,10 +182,9 @@
+         else:
+             directory = self.executionpath
+ 
+-        if self.bbftp:
+-            issmbbftpout(self.name, directory, self.login, self.port, self.numstreams, '{}.tar.gz'.format(dirname))
+-        else:
+-            issmscpout(self.name, directory, self.login, self.port, ['{}.tar.gz'.format(dirname)])
++        # NOTE: Replacement for issmscpout(self.name, directory, self.login, self.port, ['{}.tar.gz'.format(dirname)])
++        copystring = 'cp {}.tar.gz /efs/issm-tmp/'.format(dirname, dirname)
++        subprocess.call(copystring, shell=True)
+     # }}}
+ 
+     def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+@@ -200,23 +195,22 @@
+                 launchcommand = 'cd {}/Interactive{} && tar -zxf {}.tar.gz'.format(self.executionpath, self.interactive, dirname)
+         else:
+             if not isempty(restart):
+-                launchcommand = 'cd {} && cd {} && sbatch {}.queue'.format(self.executionpath, dirname, modelname)
++                launchcommand = 'cd {} && cd {} && /opt/slurm/bin/sbatch {}.queue'.format(self.executionpath, dirname, modelname)
+             else:
+-                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./ && tar -zxf {}.tar.gz && sbatch {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
++                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && cp /efs/issm-tmp/{}.tar.gz ./ && tar -zxf {}.tar.gz && /opt/slurm/bin/sbatch {}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+ 
+         print('launching solution sequence on remote cluster')
+-        issmssh(self.name, self.login, self.port, launchcommand)
++
++        # NOTE: Replacement for issmssh(self.name, self.login, self.port, launchcommand)
++        subprocess.call('ssh -l {} -i {} {} "{}"'.format(self.login, self.idfile, self.name, launchcommand), shell=True)
+     # }}}
+ 
+     def Download(self, dirname, filelist):  # {{{
+         # Copy files from cluster to current directory
+-        if self.interactive:
+-            directory = '{}/Interactive{}'.format(self.executionpath, self.interactive)
+-        else:
+-            directory = '{}/{}/'.format(self.executionpath, dirname)
+-
+-        if self.bbftp:
+-            issmbbftpin(self.name, self.login, self.port, self.numstreams, directory, filelist)
+-        else:
+-            issmscpin(self.name, self.login, self.port, directory, filelist)
++    
++        # NOTE: Replacement for issmscpin(self.name, self.login, self.port, directory, filelist)
++        directory = '{}/{}/'.format(self.executionpath, dirname)
++        fileliststr = "'{" + ','.join([str(x) for x in filelist]) + "}'"
++        downloadcommand = 'scp -T -i {} {}@{}:{} {}/.'.format(self.idfile, self.login, self.name, os.path.join(directory, fileliststr), os.getcwd())
++        subprocess.call(downloadcommand, shell=True) 
+     # }}}
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26434)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26435)
+@@ -168,7 +168,7 @@
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("thermal", "[%s %s]" % ("1x1", obj.thermal.__class__.__name__), "parameters for thermal solution"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("steadystate", "[%s %s]" % ("1x1", obj.steadystate.__class__.__name__), "parameters for steadystate solution"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("transient", "[%s %s]" % ("1x1", obj.transient.__class__.__name__), "parameters for transient solution"))
+-        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("levelset", "[%s %s]" % ("1x1", obj.levelset.__class__.__name__), "parameters for moving boundaries (level - set method)"))
++        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("levelset", "[%s %s]" % ("1x1", obj.levelset.__class__.__name__), "parameters for moving boundaries (level-set method)"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("calving", "[%s %s]" % ("1x1", obj.calving.__class__.__name__), "parameters for calving"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("frontalforcings", "[%s %s]" % ("1x1", obj.frontalforcings.__class__.__name__), "parameters for frontalforcings"))
+         s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("esa", "[%s %s]" % ("1x1", obj.esa.__class__.__name__), "parameters for elastic adjustment solution"))
+Index: ../trunk-jpl/src/m/solve/waitonlock.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26434)
++++ ../trunk-jpl/src/m/solve/waitonlock.py	(revision 26435)
+@@ -52,17 +52,21 @@
+ 
+     # Prepare command if the job is not running on the local machine
+     if not strcmpi(oshostname(), cluster.name):
+-        login = cluster.login
+-        port = 0
+-        if isprop(cluster, 'port'):
+-            port = cluster.port
+-        if port:
+-            command = 'ssh -l {} -p {} localhost "[ -f {} ] && [ -f {} ]" 2>/dev/null'.format(login, port, lockfilename, logfilename)
+-        elif cluster.name == 'cloud':
++        if cluster.name == 'cloud':
+             command = '[ -f {} ] && [ -f {} ] 2>/dev/null'.format(lockfilename, logfilename)
+             command = '{} sshmaster {} --user {} \'{}\''.format(starcluster(), cluster.name, cluster.login, command)
+         else:
+-            command = 'ssh -l {} {} "[ -f {} ] && [ -f {} ]" 2>/dev/null'.format(login, cluster.name, lockfilename, logfilename)
++            command = 'ssh -l {}'.format(cluster.login)
++            if isprop(cluster, 'idfile') and cluster.idfile != '':
++                command += ' -i {}'.format(cluster.idfile)
++            port = 0
++            if isprop(cluster, 'port'):
++                port = cluster.port
++            if port: # Check if port is non-zero
++                command += ' -p {} localhost'.format(port)
++            else:
++                command += ' {}'.format(cluster.name)
++            command += ' "[ -f {} ] && [ -f {} ]" 2>/dev/null'.format(lockfilename, logfilename)
+ 
+     while not ispresent and elapsedtime < timelimit:
+         if strcmpi(oshostname(), cluster.name):
+@@ -80,8 +84,8 @@
+             # TODO: Debug the following check under Linux (exits after first iteration with errs = "b")
+             # UPDATE: Works in testing under Debian Linux system. Leaving comment for now so that it is easier to backtrace this issue if someone else encounters it.
+             #
+-            if errs != '':
+-                raise Exception('waitonlock: check for existence of files failed: {}'.format(errs))
++            #if errs != '':
++            #    raise Exception('waitonlock: check for existence of files failed: {}'.format(errs))
+             ispresent = not subproc.returncode
+             if ispresent:
+                 print('')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26435-26436.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26435-26436.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26435-26436.diff	(revision 26740)
@@ -0,0 +1,33 @@
+Index: ../trunk-jpl/externalpackages/muq/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/muq/install.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/muq/install.sh	(revision 26436)
+@@ -0,0 +1,21 @@
++#!/bin/bash
++set -eu
++
++# Cleanup from previous installation
++rm -rf install 
++
++#Download development version
++git clone https://bitbucket.org/mituq/muq2 install
++
++#configure
++cd install
++cmake -DCMAKE_INSTALL_PREFIX="${ISSM_DIR}/externalpackages/muq/install"
++
++# Compile and install
++if [ $# -eq 0 ]; then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
+
+Property changes on: ../trunk-jpl/externalpackages/muq/install.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26436-26437.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26436-26437.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26436-26437.diff	(revision 26740)
@@ -0,0 +1,444 @@
+Index: ../trunk-jpl/test/Archives/Archive127.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive127.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive128.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive128.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive129.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive129.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test127.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test127.m	(revision 26437)
+@@ -0,0 +1,50 @@
++%Test Name: SquareShelfConstrainedStressMLHO2d
++md=triangle(model(),'../Exp/Square.exp',50000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',2);
++
++%output
++%FIXME compute the stress components for MLHO
++md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
++%md.stressbalance.requested_outputs={'default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
++md.outputdefinition.definitions={...
++	massfluxatgate('name','MassFlux1','profilename',['../Exp/MassFlux1.exp'],'definitionstring','Outputdefinition1'),...
++	massfluxatgate('name','MassFlux2','profilename',['../Exp/MassFlux2.exp'],'definitionstring','Outputdefinition2'),...
++	massfluxatgate('name','MassFlux3','profilename',['../Exp/MassFlux3.exp'],'definitionstring','Outputdefinition3'),...
++	massfluxatgate('name','MassFlux4','profilename',['../Exp/MassFlux4.exp'],'definitionstring','Outputdefinition4'),...
++	massfluxatgate('name','MassFlux5','profilename',['../Exp/MassFlux5.exp'],'definitionstring','Outputdefinition5'),...
++	massfluxatgate('name','MassFlux6','profilename',['../Exp/MassFlux6.exp'],'definitionstring','Outputdefinition6')...
++	};
++
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase',...
++	'MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
++	%'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy',...
++field_tolerances={3e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13 };
++	%$2e-13,1e-13,2e-13,...
++field_values={...
++	(md.results.StressbalanceSolution.Vx),...
++	(md.results.StressbalanceSolution.Vy),...
++	(md.results.StressbalanceSolution.Vel),...
++	(md.results.StressbalanceSolution.Pressure),...
++	(md.results.StressbalanceSolution.VxSurface),...
++	(md.results.StressbalanceSolution.VySurface),...
++	(md.results.StressbalanceSolution.VxShear),...
++	(md.results.StressbalanceSolution.VyShear),...
++	(md.results.StressbalanceSolution.VxBase),...
++	(md.results.StressbalanceSolution.VyBase),...
++	(md.results.StressbalanceSolution.MassFlux1),...
++	(md.results.StressbalanceSolution.MassFlux2),...
++	(md.results.StressbalanceSolution.MassFlux3),...
++	(md.results.StressbalanceSolution.MassFlux4),...
++	(md.results.StressbalanceSolution.MassFlux5),...
++	(md.results.StressbalanceSolution.MassFlux6)...
++	};
++	%(md.results.StressbalanceSolution.DeviatoricStressxx),...
++	%(md.results.StressbalanceSolution.DeviatoricStressyy),...
++	%(md.results.StressbalanceSolution.DeviatoricStressxy),...
+Index: ../trunk-jpl/test/NightlyRun/test127.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test127.py	(revision 26437)
+@@ -0,0 +1,56 @@
++#Test Name: SquareShelfConstrainedStressMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from massfluxatgate import massfluxatgate
++from generic import generic
++
++md = triangle(model(), '../Exp/Square.exp', 50000)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelfConstrained.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 2)
++#outputs
++#FIXME compute the stress components for MLHO
++md.stressbalance.requested_outputs = ['default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
++#md.stressbalance.requested_outputs = ['default', 'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
++md.outputdefinition.definitions = [massfluxatgate('name', 'MassFlux1', 'profilename', '../Exp/MassFlux1.exp', 'definitionstring', 'Outputdefinition1'),
++                                   massfluxatgate('name', 'MassFlux2', 'profilename', '../Exp/MassFlux2.exp', 'definitionstring', 'Outputdefinition2'),
++                                   massfluxatgate('name', 'MassFlux3', 'profilename', '../Exp/MassFlux3.exp', 'definitionstring', 'Outputdefinition3'),
++                                   massfluxatgate('name', 'MassFlux4', 'profilename', '../Exp/MassFlux4.exp', 'definitionstring', 'Outputdefinition4'),
++                                   massfluxatgate('name', 'MassFlux5', 'profilename', '../Exp/MassFlux5.exp', 'definitionstring', 'Outputdefinition5'),
++                                   massfluxatgate('name', 'MassFlux6', 'profilename', '../Exp/MassFlux6.exp', 'definitionstring', 'Outputdefinition6')]
++
++md = solve(md, 'Stressbalance')
++
++#Fields and tolerances to track changes
++field_names = ['Vx', 'Vy', 'Vel', 'Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase',
++               'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
++               #'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy',
++field_tolerances = [3e-13, 1e-13, 1e-13, 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
++                    2e-13, 1e-13, 2e-13,
++                    1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.VxSurface,
++                md.results.StressbalanceSolution.VySurface,
++                md.results.StressbalanceSolution.VxShear,
++                md.results.StressbalanceSolution.VyShear,
++                md.results.StressbalanceSolution.VxBase,
++                md.results.StressbalanceSolution.VyBase,
++                md.results.StressbalanceSolution.MassFlux1,
++                md.results.StressbalanceSolution.MassFlux2,
++                md.results.StressbalanceSolution.MassFlux3,
++                md.results.StressbalanceSolution.MassFlux4,
++                md.results.StressbalanceSolution.MassFlux5,
++                md.results.StressbalanceSolution.MassFlux6]
++                #md.results.StressbalanceSolution.DeviatoricStressxx,
++                #md.results.StressbalanceSolution.DeviatoricStressyy,
++                #md.results.StressbalanceSolution.DeviatoricStressxy,
+Index: ../trunk-jpl/test/NightlyRun/test128.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test128.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test128.m	(revision 26437)
+@@ -0,0 +1,61 @@
++%Test Name: SquareShelfConstrainedTranMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'IceVolume','VxShear','VyShear','VxBase','VyBase','VxSurface','VySurface'};
++
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','VxShear1','VyShear1','VxBase1','VyBase1','VxSurface1','VySurface1','Bed1','Surface1','Thickness1','Volume1',...
++						'Vx2','Vy2','Vel2','Pressure2','VxShear2','VyShear2','VxBase2','VyBase2','VxSurface2','VySurface2','Bed2','Surface2','Thickness2','Volume2',...
++						'Vx3','Vy3','Vel3','Pressure3','VxShear3','VyShear3','VxBase3','VyBase3','VxSurface3','VySurface3','Bed3','Surface3','Thickness3','Volume3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).VxShear),...
++	(md.results.TransientSolution(1).VyShear),...
++	(md.results.TransientSolution(1).VxBase),...
++	(md.results.TransientSolution(1).VyBase),...
++	(md.results.TransientSolution(1).VxSurface),...
++	(md.results.TransientSolution(1).VySurface),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).IceVolume),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).VxShear),...
++	(md.results.TransientSolution(2).VyShear),...
++	(md.results.TransientSolution(2).VxBase),...
++	(md.results.TransientSolution(2).VyBase),...
++	(md.results.TransientSolution(2).VxSurface),...
++	(md.results.TransientSolution(2).VySurface),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).IceVolume),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).VxShear),...
++	(md.results.TransientSolution(3).VyShear),...
++	(md.results.TransientSolution(3).VxBase),...
++	(md.results.TransientSolution(3).VyBase),...
++	(md.results.TransientSolution(3).VxSurface),...
++	(md.results.TransientSolution(3).VySurface),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).IceVolume),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test128.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test128.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test128.py	(revision 26437)
+@@ -0,0 +1,68 @@
++#Test Name: SquareShelfConstrainedTranMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 150000)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelfConstrained.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['IceVolume','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase']
++
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'VxShear1', 'VyShear1', 'VxBase1', 'VyBase1', 'VxSurface1', 'VySurface1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 
++            'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'VxShear2', 'VyShear2', 'VxBase2', 'VyBase2', 'VxSurface2', 'VySurface2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 
++            'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'VxShear3', 'VyShear3', 'VxBase3', 'VyBase3', 'VxSurface3', 'VySurface3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Vel,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].VxShear,
++                md.results.TransientSolution[0].VyShear,
++                md.results.TransientSolution[0].VxBase,
++                md.results.TransientSolution[0].VyBase,
++                md.results.TransientSolution[0].VxSurface,
++                md.results.TransientSolution[0].VySurface,
++                md.results.TransientSolution[0].Base,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[0].IceVolume,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Vel,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].VxShear,
++                md.results.TransientSolution[1].VyShear,
++                md.results.TransientSolution[1].VxBase,
++                md.results.TransientSolution[1].VyBase,
++                md.results.TransientSolution[1].VxSurface,
++                md.results.TransientSolution[1].VySurface,
++                md.results.TransientSolution[1].Base,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[1].IceVolume,
++                md.results.TransientSolution[2].Vx,
++                md.results.TransientSolution[2].Vy,
++                md.results.TransientSolution[2].Vel,
++                md.results.TransientSolution[2].Pressure,
++                md.results.TransientSolution[2].VxShear,
++                md.results.TransientSolution[2].VyShear,
++                md.results.TransientSolution[2].VxBase,
++                md.results.TransientSolution[2].VyBase,
++                md.results.TransientSolution[2].VxSurface,
++                md.results.TransientSolution[2].VySurface,
++                md.results.TransientSolution[2].Base,
++                md.results.TransientSolution[2].Surface,
++                md.results.TransientSolution[2].Thickness,
++                md.results.TransientSolution[2].IceVolume]
+Index: ../trunk-jpl/test/NightlyRun/test129.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test129.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test129.m	(revision 26437)
+@@ -0,0 +1,69 @@
++%Test Name: SquareShelfConstrainedRestartTranMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',1);
++md.transient.requested_outputs={'IceVolume','TotalSmb','VxShear','VyShear','VxBase','VyBase','VxSurface','VySurface'};
++
++md.verbose=verbose('solution',true);
++md.settings.checkpoint_frequency=4;
++
++% time steps and resolution
++md.timestepping.final_time=19;
++md.settings.output_frequency=2;
++
++md=solve(md,'Transient');
++md2=solve(md,'Transient','restart',1);
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','VxShear1','VyShear1','VxBase1','VyBase1','VxSurface1','VySurface1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1',...
++						'Vx2','Vy2','Vel2','VxShear2','VyShear2','VxBase2','VyBase2','VxSurface2','VySurface2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2',...
++						'Vx3','Vy3','Vel3','VxShear3','VyShear3','VxBase3','VyBase3','VxSurface3','VySurface3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(7).Vx)-(md2.results.TransientSolution(7).Vx),...
++	(md.results.TransientSolution(7).Vy)-(md2.results.TransientSolution(7).Vy),...
++	(md.results.TransientSolution(7).Vel)-(md2.results.TransientSolution(7).Vel),...
++	(md.results.TransientSolution(7).VxShear)-(md2.results.TransientSolution(7).VxShear),...
++	(md.results.TransientSolution(7).VyShear)-(md2.results.TransientSolution(7).VyShear),...
++	(md.results.TransientSolution(7).VxBase)-(md2.results.TransientSolution(7).VxBase),...
++	(md.results.TransientSolution(7).VyBase)-(md2.results.TransientSolution(7).VyBase),...
++	(md.results.TransientSolution(7).VxSurface)-(md2.results.TransientSolution(7).VxSurface),...
++	(md.results.TransientSolution(7).VySurface)-(md2.results.TransientSolution(7).VySurface),...
++	(md.results.TransientSolution(7).TotalSmb)-(md2.results.TransientSolution(7).TotalSmb),...
++	(md.results.TransientSolution(7).Base)-(md2.results.TransientSolution(7).Base),...
++	(md.results.TransientSolution(7).Surface)-(md2.results.TransientSolution(7).Surface),...
++	(md.results.TransientSolution(7).Thickness)-(md2.results.TransientSolution(7).Thickness),...
++	(md.results.TransientSolution(7).IceVolume)-(md2.results.TransientSolution(7).IceVolume),...
++	(md.results.TransientSolution(8).Vx)-(md2.results.TransientSolution(8).Vx),...
++	(md.results.TransientSolution(8).Vy)-(md2.results.TransientSolution(8).Vy),...
++	(md.results.TransientSolution(8).Vel)-(md2.results.TransientSolution(8).Vel),...
++	(md.results.TransientSolution(8).VxShear)-(md2.results.TransientSolution(8).VxShear),...
++	(md.results.TransientSolution(8).VyShear)-(md2.results.TransientSolution(8).VyShear),...
++	(md.results.TransientSolution(8).VxBase)-(md2.results.TransientSolution(8).VxBase),...
++	(md.results.TransientSolution(8).VyBase)-(md2.results.TransientSolution(8).VyBase),...
++	(md.results.TransientSolution(8).VxSurface)-(md2.results.TransientSolution(8).VxSurface),...
++	(md.results.TransientSolution(8).VySurface)-(md2.results.TransientSolution(8).VySurface),...
++	(md.results.TransientSolution(8).TotalSmb)-(md2.results.TransientSolution(8).TotalSmb),...
++	(md.results.TransientSolution(8).Base)-(md2.results.TransientSolution(8).Base),...
++	(md.results.TransientSolution(8).Surface)-(md2.results.TransientSolution(8).Surface),...
++	(md.results.TransientSolution(8).Thickness)-(md2.results.TransientSolution(8).Thickness),...
++	(md.results.TransientSolution(8).IceVolume)-(md2.results.TransientSolution(8).IceVolume),...
++	(md.results.TransientSolution(9).Vx)-(md2.results.TransientSolution(9).Vx),...
++	(md.results.TransientSolution(9).Vy)-(md2.results.TransientSolution(9).Vy),...
++	(md.results.TransientSolution(9).Vel)-(md2.results.TransientSolution(9).Vel),...
++	(md.results.TransientSolution(9).VxShear)-(md2.results.TransientSolution(9).VxShear),...
++	(md.results.TransientSolution(9).VyShear)-(md2.results.TransientSolution(9).VyShear),...
++	(md.results.TransientSolution(9).VxBase)-(md2.results.TransientSolution(9).VxBase),...
++	(md.results.TransientSolution(9).VyBase)-(md2.results.TransientSolution(9).VyBase),...
++	(md.results.TransientSolution(9).VxSurface)-(md2.results.TransientSolution(9).VxSurface),...
++	(md.results.TransientSolution(9).VySurface)-(md2.results.TransientSolution(9).VySurface),...
++	(md.results.TransientSolution(9).TotalSmb)-(md2.results.TransientSolution(9).TotalSmb),...
++	(md.results.TransientSolution(9).Base)-(md2.results.TransientSolution(9).Base),...
++	(md.results.TransientSolution(9).Surface)-(md2.results.TransientSolution(9).Surface),...
++	(md.results.TransientSolution(9).Thickness)-(md2.results.TransientSolution(9).Thickness),...
++	(md.results.TransientSolution(9).IceVolume)-(md2.results.TransientSolution(9).IceVolume),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test129.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test129.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test129.py	(revision 26437)
+@@ -0,0 +1,77 @@
++#Test Name: SquareShelfConstrainedRestartTranMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from generic import generic
++import copy
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelfConstrained.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 1)
++md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'VxShear','VyShear','VxBase','VyBase','VxSurface','VySurface']
++
++md.verbose = verbose('solution', 1)
++md.settings.checkpoint_frequency = 4
++
++# time steps and resolution
++md.timestepping.final_time = 19
++md.settings.output_frequency = 2
++
++md = solve(md, 'Transient')
++md2 = copy.deepcopy(md)
++md = solve(md, 'Transient', 'restart', 1)
++
++#Fields and tolerances to track changes
++field_names = ['Vx1', 'Vy1', 'Vel1', 'VxShear1','VyShear1','VxBase1','VyBase1','VxSurface1','VySurface1', 'TotalSmb1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 'Vx2', 'Vy2', 'Vel2', 'VxShear2','VyShear2','VxBase2','VyBase2','VxSurface2','VySurface2','TotalSmb2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 'Vx3', 'Vy3', 'Vel3', 'VxShear3','VyShear3','VxBase3','VyBase3','VxSurface3','VySurface3','TotalSmb3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md2.results.TransientSolution[6].Vx - md.results.TransientSolution[6].Vx,
++                md2.results.TransientSolution[6].Vy - md.results.TransientSolution[6].Vy,
++                md2.results.TransientSolution[6].Vel - md.results.TransientSolution[6].Vel,
++                md2.results.TransientSolution[6].VxShear - md.results.TransientSolution[6].VxShear,
++                md2.results.TransientSolution[6].VyShear - md.results.TransientSolution[6].VyShear,
++                md2.results.TransientSolution[6].VxBase - md.results.TransientSolution[6].VxBase,
++                md2.results.TransientSolution[6].VyBase - md.results.TransientSolution[6].VyBase,
++                md2.results.TransientSolution[6].VxSurface - md.results.TransientSolution[6].VxSurface,
++                md2.results.TransientSolution[6].VySurface - md.results.TransientSolution[6].VySurface,
++                md2.results.TransientSolution[6].TotalSmb - md.results.TransientSolution[6].TotalSmb,
++                md2.results.TransientSolution[6].Base - md.results.TransientSolution[6].Base,
++                md2.results.TransientSolution[6].Surface - md.results.TransientSolution[6].Surface,
++                md2.results.TransientSolution[6].Thickness - md.results.TransientSolution[6].Thickness,
++                md2.results.TransientSolution[6].IceVolume - md.results.TransientSolution[6].IceVolume,
++                md2.results.TransientSolution[7].Vx - md.results.TransientSolution[7].Vx,
++                md2.results.TransientSolution[7].Vy - md.results.TransientSolution[7].Vy,
++                md2.results.TransientSolution[7].Vel - md.results.TransientSolution[7].Vel,
++                md2.results.TransientSolution[7].VxShear - md.results.TransientSolution[7].VxShear,
++                md2.results.TransientSolution[7].VyShear - md.results.TransientSolution[7].VyShear,
++                md2.results.TransientSolution[7].VxBase - md.results.TransientSolution[7].VxBase,
++                md2.results.TransientSolution[7].VyBase - md.results.TransientSolution[7].VyBase,
++                md2.results.TransientSolution[7].VxSurface - md.results.TransientSolution[7].VxSurface,
++                md2.results.TransientSolution[7].VySurface - md.results.TransientSolution[7].VySurface,
++                md2.results.TransientSolution[7].TotalSmb - md.results.TransientSolution[7].TotalSmb,
++                md2.results.TransientSolution[7].Base - md.results.TransientSolution[7].Base,
++                md2.results.TransientSolution[7].Surface - md.results.TransientSolution[7].Surface,
++                md2.results.TransientSolution[7].Thickness - md.results.TransientSolution[7].Thickness,
++                md2.results.TransientSolution[7].IceVolume - md.results.TransientSolution[7].IceVolume,
++                md2.results.TransientSolution[8].Vx - md.results.TransientSolution[8].Vx,
++                md2.results.TransientSolution[8].Vy - md.results.TransientSolution[8].Vy,
++                md2.results.TransientSolution[8].Vel - md.results.TransientSolution[8].Vel,
++                md2.results.TransientSolution[8].VxShear - md.results.TransientSolution[8].VxShear,
++                md2.results.TransientSolution[8].VyShear - md.results.TransientSolution[8].VyShear,
++                md2.results.TransientSolution[8].VxBase - md.results.TransientSolution[8].VxBase,
++                md2.results.TransientSolution[8].VyBase - md.results.TransientSolution[8].VyBase,
++                md2.results.TransientSolution[8].VxSurface - md.results.TransientSolution[8].VxSurface,
++                md2.results.TransientSolution[8].VySurface - md.results.TransientSolution[8].VySurface,
++                md2.results.TransientSolution[8].TotalSmb - md.results.TransientSolution[8].TotalSmb,
++                md2.results.TransientSolution[8].Base - md.results.TransientSolution[8].Base,
++                md2.results.TransientSolution[8].Surface - md.results.TransientSolution[8].Surface,
++                md2.results.TransientSolution[8].Thickness - md.results.TransientSolution[8].Thickness,
++                md2.results.TransientSolution[8].IceVolume - md.results.TransientSolution[8].IceVolume]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26437-26438.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26437-26438.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26437-26438.diff	(revision 26740)
@@ -0,0 +1,380 @@
+Index: ../trunk-jpl/test/Archives/Archive248.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive248.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive249.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive249.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive254.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive254.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test248.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test248.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test248.m	(revision 26438)
+@@ -0,0 +1,24 @@
++%Test Name: SquareShelfStressMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.StressbalanceSolution.Vx),...
++	(md.results.StressbalanceSolution.Vy),...
++	(md.results.StressbalanceSolution.Vel),...
++	(md.results.StressbalanceSolution.Pressure),...
++	(md.results.StressbalanceSolution.VxSurface),...
++	(md.results.StressbalanceSolution.VySurface),...
++	(md.results.StressbalanceSolution.VxShear),...
++	(md.results.StressbalanceSolution.VyShear),...
++	(md.results.StressbalanceSolution.VxBase),...
++	(md.results.StressbalanceSolution.VyBase),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test248.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test248.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test248.py	(revision 26438)
+@@ -0,0 +1,32 @@
++#Test Name: SquareShelfStressMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++from ContourToMesh import *
++
++md = triangle(model(), '../Exp/Square.exp', 150000)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = solve(md, 'Stressbalance')
++
++#Fields and tolerances to track changes
++field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.VxSurface,
++                md.results.StressbalanceSolution.VySurface, 
++                md.results.StressbalanceSolution.VxShear,
++                md.results.StressbalanceSolution.VyShear, 
++                md.results.StressbalanceSolution.VxBase,
++                md.results.StressbalanceSolution.VyBase]
+Index: ../trunk-jpl/test/NightlyRun/test249.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test249.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test249.m	(revision 26438)
+@@ -0,0 +1,46 @@
++%Test Name: SquareShelfTranMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','FloatingArea','GroundedArea','TotalGroundedBmb','TotalFloatingBmb'};
++md.basalforcings.floatingice_melting_rate(:)=1;
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','TotalGroundedBmb1','TotalFloatingBmb1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','TotalGroundedBmb2','TotalFloatingBmb2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','TotalGroundedBmb3','TotalFloatingBmb3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).TotalGroundedBmb),...
++	(md.results.TransientSolution(3).TotalFloatingBmb),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test249.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test249.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test249.py	(revision 26438)
+@@ -0,0 +1,62 @@
++#Test Name: SquareShelfTranMLHO2d
++
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from generic import generic
++
++md = triangle(model(), '../Exp/Square.exp', 150000)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelf.py')
++md.basalforcings.floatingice_melting_rate[:] = 1.
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'FloatingArea', 'GroundedArea', 'TotalFloatingBmb', 'TotalGroundedBmb']
++md = solve(md, 'Transient')
++
++
++# Fields and tolerances to track changes
++
++field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
++               'Bed1', 'Surface1', 'Thickness1', 'TotalGroundedBmb1', 'TotalFloatingBmb1',
++               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
++               'Bed2', 'Surface2', 'Thickness2', 'TotalGroundedBmb2', 'TotalFloatingBmb2',
++               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
++               'Bed3', 'Surface3', 'Thickness3', 'TotalGroundedBmb3', 'TotalFloatingBmb3']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Vel,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].Base,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[0].TotalGroundedBmb,
++                md.results.TransientSolution[0].TotalFloatingBmb,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Vel,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].Base,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[1].TotalGroundedBmb,
++                md.results.TransientSolution[1].TotalFloatingBmb,
++                md.results.TransientSolution[2].Vx,
++                md.results.TransientSolution[2].Vy,
++                md.results.TransientSolution[2].Vel,
++                md.results.TransientSolution[2].Pressure,
++                md.results.TransientSolution[2].Base,
++                md.results.TransientSolution[2].Surface,
++                md.results.TransientSolution[2].Thickness,
++                md.results.TransientSolution[2].TotalGroundedBmb,
++                md.results.TransientSolution[2].TotalFloatingBmb]
+Index: ../trunk-jpl/test/NightlyRun/test254.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test254.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test254.m	(revision 26438)
+@@ -0,0 +1,72 @@
++%Test Name: SquareShelfConstrainedMLHO
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++%redo the parameter file for this special shelf. 
++%constant thickness, constrained (vy=0) flow into an icefront, 
++%from 0 m/yr at the grounding line.
++
++%tighten
++md.stressbalance.restol=10^-4;
++
++%needed later
++ymin=min(md.mesh.y);
++ymax=max(md.mesh.y);
++xmin=min(md.mesh.x);
++xmax=max(md.mesh.x);
++
++di=md.materials.rho_ice/md.materials.rho_water;
++
++h=1000;
++md.geometry.thickness=h*ones(md.mesh.numberofvertices,1);
++md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
++md.geometry.surface=md.geometry.base+md.geometry.thickness;
++
++%Initial velocity and pressure
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.vz=zeros(md.mesh.numberofvertices,1);
++md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
++
++%Materials
++md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++
++%Boundary conditions:
++md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++
++%constrain flanks to 0 normal velocity
++pos=find(md.mesh.x==xmin | md.mesh.x==xmax);
++md.stressbalance.spcvx(pos)=0;
++md.stressbalance.spcvz(pos)=NaN;
++
++%constrain grounding line to 0 velocity
++pos=find(md.mesh.y==ymin);
++md.stressbalance.spcvx(pos)=0;
++md.stressbalance.spcvy(pos)=0;
++
++%icefront
++nodeonicefront=zeros(md.mesh.numberofvertices,1);
++pos=find(md.mesh.y==ymax); nodeonicefront(pos)=1;
++md.mask.ice_levelset=-1+nodeonicefront;
++
++md.stressbalance.requested_outputs={'default','VySurface','VyShear','VyBase'};
++md=solve(md,'Stressbalance');
++
++%create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
++%ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3;
++%vy_c=ey_c.*md.mesh.y*md.constants.yts;
++
++%Fields and tolerances to track changes
++field_names     ={'Vy','VySurface','VyShear','VyBase'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13};
++field_values={(md.results.StressbalanceSolution.Vy),...
++					(md.results.StressbalanceSolution.VySurface),...
++					(md.results.StressbalanceSolution.VyShear),...
++					(md.results.StressbalanceSolution.VyBase)};
+Index: ../trunk-jpl/test/NightlyRun/test254.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test254.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test254.py	(revision 26438)
+@@ -0,0 +1,81 @@
++#Test Name: SquareShelfConstrainedMLHO
++from model import *
++from socket import gethostname
++import numpy as np
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from paterson import *
++from solve import *
++from generic import generic
++
++md = triangle(model(), '../Exp/Square.exp', 150000)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++
++# redo the parameter file for this special shelf.
++# constant thickness, constrained (vy = 0) flow into an icefront,
++# from 0 m / yr at the grounding line.
++
++# tighten
++md.stressbalance.restol = 1e-4
++
++# needed later
++ymin = min(md.mesh.y)
++ymax = max(md.mesh.y)
++xmin = min(md.mesh.x)
++xmax = max(md.mesh.x)
++
++di = md.materials.rho_ice / md.materials.rho_water
++
++h = 1000.
++md.geometry.thickness = h * np.ones((md.mesh.numberofvertices))
++md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
++md.geometry.surface = md.geometry.base + md.geometry.thickness
++
++# Initial velocity and pressure
++md.initialization.vx = np.zeros((md.mesh.numberofvertices))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices))
++md.initialization.vz = np.zeros((md.mesh.numberofvertices))
++md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
++
++# Materials
++md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
++md.materials.rheology_B = paterson(md.initialization.temperature)
++md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
++
++# Boundary conditions:
++md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
++md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
++md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
++
++# constrain flanks to 0 normal velocity
++pos = np.where(np.logical_or(md.mesh.x == xmin, md.mesh.x == xmax))
++md.stressbalance.spcvx[pos] = 0
++md.stressbalance.spcvz[pos] = np.nan
++
++# constrain grounding line to 0 velocity
++pos = np.where(md.mesh.y == ymin)
++md.stressbalance.spcvx[pos] = 0
++md.stressbalance.spcvy[pos] = 0
++
++# icefront
++nodeonicefront = np.zeros(md.mesh.numberofvertices)
++pos = np.where(md.mesh.y == ymax)
++nodeonicefront[pos] = 1
++md.mask.ice_levelset = -1 + nodeonicefront
++
++md.stressbalance.requested_outputs = ['default', 'VySurface', 'VyShear', 'VyBase']
++md = solve(md, 'Stressbalance')
++
++# create analytical solution: strain rate is constant = ((rho_ice * g * h) / 4B)^3 (Paterson, 4th Edition, page 292.
++# ey_c=(md.materials.rho_ice * md.constants.g * (1 - di) * md.geometry.thickness. / (4 * md.materials.rheology_B)).^3
++# vy_c = ey_c. * md.mesh.y * md.constants.yts
++
++# Fields and tolerances to track changes
++field_names = ['Vy', 'VySurface', 'VyShear', 'VyBase']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Vy, md.results.StressbalanceSolution.VySurface, md.results.StressbalanceSolution.VyShear, md.results.StressbalanceSolution.VyBase]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26438-26439.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26438-26439.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26438-26439.diff	(revision 26740)
@@ -0,0 +1,976 @@
+Index: ../trunk-jpl/test/Archives/Archive255.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive255.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive256.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive256.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive330.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive330.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive332.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive332.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive446.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive446.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive448.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive448.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive449.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive449.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test255.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test255.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test255.m	(revision 26439)
+@@ -0,0 +1,35 @@
++%Test Name: SquareShelfStressMLHO2dTransientIncrHydro
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.masstransport.hydrostatic_adjustment='Incremental';
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test255.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test255.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test255.py	(revision 26439)
+@@ -0,0 +1,52 @@
++#Test Name: SquareShelfStressMLHO2dTransientIncrHydro
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.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]
+Index: ../trunk-jpl/test/NightlyRun/test256.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test256.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test256.m	(revision 26439)
+@@ -0,0 +1,36 @@
++%Test Name: SquareShelfStressMLHO2dTransientIncrNonHydro
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.geometry.base=md.geometry.base+50.; md.geometry.surface=md.geometry.surface+50.;
++md.cluster=generic('name',oshostname(),'np',1);
++md.masstransport.hydrostatic_adjustment='Incremental';
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test256.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test256.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test256.py	(revision 26439)
+@@ -0,0 +1,54 @@
++#Test Name: SquareShelfStressMLHO2dTransientIncrNonHydro
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.geometry.base = md.geometry.base + 50.
++md.geometry.surface = md.geometry.surface + 50.
++md.cluster = generic('name', gethostname(), 'np', 1)
++md.masstransport.hydrostatic_adjustment = 'Incremental'
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
++               'Bed1', 'Surface1', 'Thickness1',
++               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
++               'Bed2', 'Surface2', 'Thickness2',
++               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
++               'Bed3', 'Surface3', 'Thickness3']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-13, 1e-13, 1e-13]
++field_values = [md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Vel,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].Base,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Vel,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].Base,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[2].Vx,
++                md.results.TransientSolution[2].Vy,
++                md.results.TransientSolution[2].Vel,
++                md.results.TransientSolution[2].Pressure,
++                md.results.TransientSolution[2].Base,
++                md.results.TransientSolution[2].Surface,
++                md.results.TransientSolution[2].Thickness]
+Index: ../trunk-jpl/test/NightlyRun/test330.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test330.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test330.m	(revision 26439)
+@@ -0,0 +1,24 @@
++%Test Name: SquareSheetConstrainedStressMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.StressbalanceSolution.Vx),...
++	(md.results.StressbalanceSolution.Vy),...
++	(md.results.StressbalanceSolution.Vel),...
++	(md.results.StressbalanceSolution.Pressure),...
++	(md.results.StressbalanceSolution.VxSurface),...
++	(md.results.StressbalanceSolution.VySurface),...
++	(md.results.StressbalanceSolution.VxShear),...
++	(md.results.StressbalanceSolution.VyShear),...
++	(md.results.StressbalanceSolution.VxBase),...
++	(md.results.StressbalanceSolution.VyBase),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test330.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test330.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test330.py	(revision 26439)
+@@ -0,0 +1,31 @@
++#Test Name: SquareSheetConstrainedStressMLHO2d
++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, '', '')
++md = parameterize(md, '../Par/SquareSheetConstrained.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = solve(md, 'Stressbalance')
++
++#Fields and tolerances to track changes
++field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.VxSurface,
++                md.results.StressbalanceSolution.VySurface,
++                md.results.StressbalanceSolution.VxShear,
++                md.results.StressbalanceSolution.VyShear,
++                md.results.StressbalanceSolution.VxBase,
++                md.results.StressbalanceSolution.VyBase]
+Index: ../trunk-jpl/test/NightlyRun/test332.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test332.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test332.m	(revision 26439)
+@@ -0,0 +1,39 @@
++%Test Name: SquareSheetConstrainedTranMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
++field_tolerances={...
++	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,1e-13,1e-13,2e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test332.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test332.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test332.py	(revision 26439)
+@@ -0,0 +1,43 @@
++#Test Name: SquareSheetConstrainedTranMLHO2d
++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, '', '')
++md = parameterize(md, '../Par/SquareSheetConstrained.py')
++md = setflowequation(md, 'MLHO', '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]
+Index: ../trunk-jpl/test/NightlyRun/test446.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test446.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test446.m	(revision 26439)
+@@ -0,0 +1,25 @@
++%Test Name: SquareSheetShelfStressMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++   (md.results.StressbalanceSolution.Vx),...
++   (md.results.StressbalanceSolution.Vy),...
++   (md.results.StressbalanceSolution.Vel),...
++   (md.results.StressbalanceSolution.Pressure),...
++   (md.results.StressbalanceSolution.VxSurface),...
++   (md.results.StressbalanceSolution.VySurface),...
++   (md.results.StressbalanceSolution.VxShear),...
++   (md.results.StressbalanceSolution.VyShear),...
++   (md.results.StressbalanceSolution.VxBase),...
++   (md.results.StressbalanceSolution.VyBase),...
++   };
++
+Index: ../trunk-jpl/test/NightlyRun/test446.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test446.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test446.py	(revision 26439)
+@@ -0,0 +1,31 @@
++#Test Name: SquareSheetShelfStressMLHO2d
++from model import *
++from socket import gethostname
++
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = solve(md, 'Stressbalance')
++
++#Fields and tolerances to track changes
++field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.VxSurface,
++                md.results.StressbalanceSolution.VySurface,
++                md.results.StressbalanceSolution.VxShear,
++                md.results.StressbalanceSolution.VyShear,
++                md.results.StressbalanceSolution.VxBase,
++                md.results.StressbalanceSolution.VyBase]
+Index: ../trunk-jpl/test/NightlyRun/test447.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test447.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test447.m	(revision 26439)
+@@ -0,0 +1,68 @@
++%Test Name: SquareSheetShelfTranMLHO2d
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.geometry.bed=md.geometry.base;
++pos=find(md.mask.ocean_levelset<0);
++md.geometry.bed(pos)=md.geometry.base(pos)-10;
++md.friction=frictioncoulomb();
++md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.coefficientcoulomb=0.02*ones(md.mesh.numberofvertices,1);
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names={...
++	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2',...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3'...
++};
++field_tolerances={...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).GroundedArea),...
++	(md.results.TransientSolution(1).FloatingArea),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).GroundedArea),...
++	(md.results.TransientSolution(2).FloatingArea),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).GroundedArea),...
++	(md.results.TransientSolution(3).FloatingArea),...
++	(md.results.TransientSolution(3).TotalFloatingBmb),...
++	(md.results.TransientSolution(3).TotalGroundedBmb),...
++	(md.results.TransientSolution(3).TotalSmb),...
++};
+Index: ../trunk-jpl/test/NightlyRun/test447.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test447.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test447.py	(revision 26439)
+@@ -0,0 +1,79 @@
++#Test Name: SquareSheetShelfTranMLHO2d
++import numpy as np
++from model import *
++from socket import gethostname
++
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from frictioncoulomb import frictioncoulomb
++
++md = triangle(model(), '../Exp/Square.exp', 150000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md.geometry.bed = copy.deepcopy(md.geometry.base)
++pos = np.nonzero(md.mask.ocean_levelset < 0.)
++md.geometry.bed[pos] = md.geometry.bed[pos] - 10
++md.friction = frictioncoulomb()
++md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
++md.friction.p = 1 * np.ones(md.mesh.numberofelements)
++md.friction.q = 1 * np.ones(md.mesh.numberofelements)
++md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
++    'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
++]
++field_tolerances = [
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++]
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Pressure,
++    md.results.TransientSolution[0].Base,
++    md.results.TransientSolution[0].Surface,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].GroundedArea,
++    md.results.TransientSolution[0].FloatingArea,
++    md.results.TransientSolution[0].TotalFloatingBmb,
++    md.results.TransientSolution[0].TotalGroundedBmb,
++    md.results.TransientSolution[0].TotalSmb,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Pressure,
++    md.results.TransientSolution[1].Base,
++    md.results.TransientSolution[1].Surface,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].GroundedArea,
++    md.results.TransientSolution[1].FloatingArea,
++    md.results.TransientSolution[1].TotalFloatingBmb,
++    md.results.TransientSolution[1].TotalGroundedBmb,
++    md.results.TransientSolution[1].TotalSmb,
++    md.results.TransientSolution[2].Vx,
++    md.results.TransientSolution[2].Vy,
++    md.results.TransientSolution[2].Vel,
++    md.results.TransientSolution[2].Pressure,
++    md.results.TransientSolution[2].Base,
++    md.results.TransientSolution[2].Surface,
++    md.results.TransientSolution[2].Thickness,
++    md.results.TransientSolution[2].GroundedArea,
++    md.results.TransientSolution[2].FloatingArea,
++    md.results.TransientSolution[2].TotalFloatingBmb,
++    md.results.TransientSolution[2].TotalGroundedBmb,
++    md.results.TransientSolution[2].TotalSmb
++]
+Index: ../trunk-jpl/test/NightlyRun/test448.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test448.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test448.m	(revision 26439)
+@@ -0,0 +1,53 @@
++%Test Name: RoundSheetShelfGLMigrationMLHO2d
++radius=1.e6;
++shelfextent=2.e5;
++
++md=roundmesh(model(),radius,50000.);
++%fix center node to 0,0
++rad=sqrt(md.mesh.x.^2+md.mesh.y.^2);
++pos=find(rad==min(rad));
++md.mesh.x(pos)=0.; md.mesh.y(pos)=0.; %the closest node to the center is changed to be exactly at the center
++xelem=mean(md.mesh.x(md.mesh.elements),2);
++yelem=mean(md.mesh.y(md.mesh.elements),2);
++rad=sqrt(xelem.^2+yelem.^2);
++flags=zeros(md.mesh.numberofelements,1);
++pos=find(rad>=(radius-shelfextent));
++flags(pos)=1;
++md=setmask(md,flags,''); 
++md=parameterize(md,'../Par/RoundSheetShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.transient.isthermal=0;
++md.transient.ismasstransport=0;
++md.transient.issmb=1;
++md.transient.isstressbalance=1;
++md.transient.isgroundingline=1;
++
++%test different grounding line dynamics.
++md.groundingline.migration='AggressiveMigration';
++md=solve(md,'Transient');
++element_on_iceshelf_agressive=(md.results.TransientSolution.MaskOceanLevelset);
++vel_agressive=(md.results.TransientSolution.Vel);
++
++md.groundingline.migration='SoftMigration';
++md=solve(md,'Transient');
++element_on_iceshelf_soft=(md.results.TransientSolution.MaskOceanLevelset);
++vel_soft=(md.results.TransientSolution.Vel);
++
++md.mask.ocean_levelset=md.geometry.thickness + md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
++md.groundingline.migration='SubelementMigration';
++md.groundingline.friction_interpolation='SubelementFriction1';
++md=solve(md,'Transient');
++element_on_iceshelf_subelement=(md.results.TransientSolution.MaskOceanLevelset);
++vel_subelement=(md.results.TransientSolution.Vel);
++
++md.groundingline.friction_interpolation='SubelementFriction2';
++md=solve(md,'Transient');
++element_on_iceshelf_subelement2=(md.results.TransientSolution.MaskOceanLevelset);
++vel_subelement2=(md.results.TransientSolution.Vel);
++
++%Fields and tolerances to track changes
++field_names     ={'ElementOnIceShelfAggressive','VelAggressive','ElementOnIceShelfSoft','VelSoft','ElementOnIceShelfSubelement','VelSubelement','ElementOnIceShelfSubelement2','VelSubelement2'};
++field_tolerances={1e-13,2e-12,1e-13,2e-12,1e-13,3e-12,1e-13,2e-12};
++field_values={element_on_iceshelf_agressive,vel_agressive,element_on_iceshelf_soft,vel_soft,element_on_iceshelf_subelement,vel_subelement,element_on_iceshelf_subelement2,vel_subelement2};
+Index: ../trunk-jpl/test/NightlyRun/test448.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test448.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test448.py	(revision 26439)
+@@ -0,0 +1,64 @@
++#Test Name: RoundSheetShelfGLMigrationMLHO2d
++import numpy as np
++from model import *
++from socket import gethostname
++from roundmesh import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++radius = 1.e6
++shelfextent = 2.e5
++
++md = roundmesh(model(), radius, 50000.)
++#fix center node to 0, 0
++rad = np.sqrt(md.mesh.x**2 + md.mesh.y**2)
++pos = np.argmin(rad)
++md.mesh.x[pos] = 0.
++md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
++xelem = np.mean(md.mesh.x[md.mesh.elements - 1], axis=1)
++yelem = np.mean(md.mesh.y[md.mesh.elements - 1], axis=1)
++rad = np.sqrt(xelem**2 + yelem**2)
++flags = np.zeros(md.mesh.numberofelements)
++pos = np.nonzero(rad >= (radius - shelfextent))
++flags[pos] = 1
++md = setmask(md, flags, '')
++md = parameterize(md, '../Par/RoundSheetShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++
++md.transient.isthermal = False
++md.transient.ismasstransport = False
++md.transient.issmb = True
++md.transient.isstressbalance = True
++md.transient.isgroundingline = True
++
++#test different grounding line dynamics.
++md.groundingline.migration = 'AggressiveMigration'
++md = solve(md, 'Transient')
++element_on_iceshelf_agressive = md.results.TransientSolution[0].MaskOceanLevelset
++vel_agressive = md.results.TransientSolution[0].Vel
++
++md.groundingline.migration = 'SoftMigration'
++md = solve(md, 'Transient')
++element_on_iceshelf_soft = md.results.TransientSolution[0].MaskOceanLevelset
++vel_soft = md.results.TransientSolution[0].Vel
++
++md.mask.ocean_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
++md.groundingline.migration = 'SubelementMigration'
++md.groundingline.friction_interpolation = 'SubelementFriction1'
++md = solve(md, 'Transient')
++element_on_iceshelf_subelement = md.results.TransientSolution[0].MaskOceanLevelset
++vel_subelement = md.results.TransientSolution[0].Vel
++
++md.groundingline.friction_interpolation = 'SubelementFriction2'
++md = solve(md, 'Transient')
++element_on_iceshelf_subelement2 = md.results.TransientSolution[0].MaskOceanLevelset
++vel_subelement2 = md.results.TransientSolution[0].Vel
++
++#Fields and tolerances to track changes
++field_names = ['ElementOnIceShelfAggressive', 'VelAggressive', 'ElementOnIceShelfSoft', 'VelSoft', 'ElementOnIceShelfSubelement', 'VelSubelement', 'ElementOnIceShelfSubelement2', 'VelSubelement2']
++field_tolerances = [1e-13, 2e-13, 1e-13, 2e-13, 1e-13, 2e-13, 1e-13, 2e-13]
++field_values = [element_on_iceshelf_agressive, vel_agressive, element_on_iceshelf_soft, vel_soft, element_on_iceshelf_subelement, vel_subelement, element_on_iceshelf_subelement2, vel_subelement2]
+Index: ../trunk-jpl/test/NightlyRun/test449.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test449.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test449.m	(revision 26439)
+@@ -0,0 +1,81 @@
++%Test Name: MISMIP3DMLHO
++md=triangle(model(),'../Exp/Square.exp',100000.);
++md=setmask(md,'../Exp/SquareShelf.exp','');
++md=parameterize(md,'../Par/SquareSheetShelf.par');
++md.initialization.vx(:)=1.;
++md.initialization.vy(:)=1.;
++md.geometry.thickness(:)=500-md.mesh.x/10000;
++md.geometry.bed =-100-md.mesh.x/1000;
++md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
++md.mask.ocean_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
++pos=find(md.mask.ocean_levelset>=0);
++md.geometry.base(pos)=md.geometry.bed(pos);
++md.geometry.surface=md.geometry.base+md.geometry.thickness;
++md=setflowequation(md,'MLHO','all');
++
++%Boundary conditions:
++md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
++md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
++md.stressbalance.spcvx(:)=NaN;
++md.stressbalance.spcvy(:)=NaN;
++md.stressbalance.spcvz(:)=NaN;
++pos=find((md.mesh.y<1000000.1 & md.mesh.y>999999.9) | (md.mesh.y<0.1 & md.mesh.y>-0.1));
++md.stressbalance.spcvy(pos)=0;
++pos2=find(md.mesh.x<0.1 & md.mesh.x>-0.1);
++md.stressbalance.spcvx(pos2)=0;
++md.stressbalance.spcvy(pos2)=0;
++
++md.materials.rheology_B=1/((10^-25)^(1/3))*ones(md.mesh.numberofvertices,1);
++md.materials.rheology_law='None';
++md.friction.coefficient(:)=sqrt(10^7)*ones(md.mesh.numberofvertices,1);
++md.friction.p=3*ones(md.mesh.numberofelements,1);
++md.smb.mass_balance(:)=1;
++md.basalforcings.groundedice_melting_rate(:)=0;
++md.basalforcings.floatingice_melting_rate(:)=30;
++md.transient.isthermal=0;
++md.transient.isstressbalance=1;
++md.transient.isgroundingline=1;
++md.transient.ismasstransport=1;
++md.transient.issmb=1;
++md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
++md.groundingline.migration='SubelementMigration';
++md.groundingline.melt_interpolation='SubelementMelt1';
++md.timestepping.final_time=30;
++md.timestepping.time_step=10;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',...
++	'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',...
++	'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3'};
++field_tolerances={2e-11,5e-12,2e-11,1e-11,5e-10,1e-08,1e-13,1e-13,...
++	3e-11,3e-11,9e-10,7e-11,1e-09,5e-08,1e-10,1e-13,...
++	1e-10,3e-11,1e-10,7e-11,1e-09,5e-08,1e-10,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).MaskOceanLevelset),...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).MaskOceanLevelset),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).MaskOceanLevelset),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test449.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test449.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test449.py	(revision 26439)
+@@ -0,0 +1,93 @@
++#Test Name: MISMIP3DMLHO
++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', 100000.)
++md = setmask(md, '../Exp/SquareShelf.exp', '')
++md = parameterize(md, '../Par/SquareSheetShelf.py')
++md.initialization.vx[:] = 1.
++md.initialization.vy[:] = 1.
++md.geometry.thickness[:] = 500. - md.mesh.x / 10000.
++md.geometry.bed = -100. - md.mesh.x / 1000.
++md.geometry.base = -md.geometry.thickness * md.materials.rho_ice / md.materials.rho_water
++md.mask.ocean_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
++pos = np.where(md.mask.ocean_levelset >= 0.)
++md.geometry.base[pos] = md.geometry.bed[pos]
++md.geometry.surface = md.geometry.base + md.geometry.thickness
++md = setflowequation(md, 'MLHO', 'all')
++
++#Boundary conditions:
++md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
++md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
++md.stressbalance.spcvx[:] = float('NaN')
++md.stressbalance.spcvy[:] = float('NaN')
++md.stressbalance.spcvz[:] = float('NaN')
++posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
++posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
++pos = np.unique(np.concatenate((posA, posB)))
++md.stressbalance.spcvy[pos] = 0.
++pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
++md.stressbalance.spcvx[pos2] = 0.
++md.stressbalance.spcvy[pos2] = 0.
++
++md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
++md.materials.rheology_law = 'None'
++md.friction.coefficient[:] = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices, ))
++md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
++md.smb.mass_balance[:] = 1.
++md.basalforcings.groundedice_melting_rate[:] = 0.
++md.basalforcings.floatingice_melting_rate[:] = 30.
++md.transient.isthermal = 0
++md.transient.isstressbalance = 1
++md.transient.isgroundingline = 1
++md.transient.ismasstransport = 1
++md.transient.issmb = 1
++md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
++md.groundingline.migration = 'SubelementMigration'
++md.groundingline.melt_interpolation = 'SubelementMelt1'
++md.timestepping.final_time = 30
++md.timestepping.time_step = 10
++
++md.cluster = generic('name', gethostname(), 'np', 3)
++md = solve(md, 'Transient')
++#print md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate
++#print md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate
++#print md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate
++
++#Fields and tolerances to track changes
++field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'Vx1', 'Vy1', 'Pressure1', 'FloatingiceMeltingrate1',
++               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'Vx2', 'Vy2', 'Pressure2', 'FloatingiceMeltingrate2',
++               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'Vx3', 'Vy3', 'Pressure3', 'FloatingiceMeltingrate3']
++field_tolerances = [2e-11, 5e-12, 2e-11, 1e-11, 5e-10, 1e-08, 1e-13, 1e-13,
++                    3e-11, 3e-11, 9e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13,
++                    1e-10, 3e-11, 1e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13]
++field_values = [md.results.TransientSolution[0].Base,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[0].MaskOceanLevelset,
++                md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
++                md.results.TransientSolution[1].Base,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[1].MaskOceanLevelset,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
++                md.results.TransientSolution[2].Base,
++                md.results.TransientSolution[2].Surface,
++                md.results.TransientSolution[2].Thickness,
++                md.results.TransientSolution[2].MaskOceanLevelset,
++                md.results.TransientSolution[2].Vx,
++                md.results.TransientSolution[2].Vy,
++                md.results.TransientSolution[2].Pressure,
++                md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate]
+Index: ../trunk-jpl/test/Archives/Archive447.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive447.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26439-26440.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26439-26440.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26439-26440.diff	(revision 26740)
@@ -0,0 +1,669 @@
+Index: ../trunk-jpl/test/Archives/Archive810.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive810.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive811.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive811.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive812.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive812.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test518.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test518.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test518.m	(revision 26440)
+@@ -0,0 +1,25 @@
++%Test Name: PigStressMLHO2d
++md=triangle(model(),'../Exp/Pig.exp',20000.);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++   (md.results.StressbalanceSolution.Vx),...
++   (md.results.StressbalanceSolution.Vy),...
++   (md.results.StressbalanceSolution.Vel),...
++   (md.results.StressbalanceSolution.Pressure),...
++   (md.results.StressbalanceSolution.VxSurface),...
++   (md.results.StressbalanceSolution.VySurface),...
++   (md.results.StressbalanceSolution.VxShear),...
++   (md.results.StressbalanceSolution.VyShear),...
++   (md.results.StressbalanceSolution.VxBase),...
++   (md.results.StressbalanceSolution.VyBase),...
++   };
++
+Index: ../trunk-jpl/test/NightlyRun/test518.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test518.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test518.py	(revision 26440)
+@@ -0,0 +1,31 @@
++#Test Name: PigStressMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Pig.exp', 20000.)
++md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
++md = parameterize(md, '../Par/Pig.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = solve(md, 'Stressbalance')
++
++#Fields and tolerances to track changes
++field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.VxSurface,
++                md.results.StressbalanceSolution.VySurface,
++                md.results.StressbalanceSolution.VxShear,
++                md.results.StressbalanceSolution.VyShear,
++                md.results.StressbalanceSolution.VxBase,
++                md.results.StressbalanceSolution.VyBase]
+Index: ../trunk-jpl/test/NightlyRun/test519.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test519.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test519.m	(revision 26440)
+@@ -0,0 +1,53 @@
++%Test Name: PigTranMLHO2d
++md=triangle(model(),'../Exp/Pig.exp',20000.);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.geometry.bed=md.geometry.base;
++[md.mesh.lat,md.mesh.long] = xy2ll(md.mesh.x,md.mesh.y,-1);
++md.mesh.scale_factor=0.9*ones(md.mesh.numberofvertices,1);
++md.transient.requested_outputs={'default','IceVolume','IceVolumeScaled','GroundedArea','GroundedAreaScaled','FloatingArea','FloatingAreaScaled','TotalSmb','TotalSmbScaled','TotalFloatingBmb','TotalFloatingBmbScaled'};
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','IceVolume1','IceVolumeScaled1','GroundedArea1','GroundedAreaScaled1','FloatingArea1','FloatingAreaScaled1','TotalSmb1','TotalSmbScaled1','TotalFloatingBmb1','TotalFloatingBmbScaled1',...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','IceVolume2','IceVolumeScaled2','GroundedArea2','GroundedAreaScaled2','FloatingArea2','FloatingAreaScaled2','TotalSmb2','TotalSmbScaled2','TotalFloatingBmb2','TotalFloatingBmbScaled2'};
++field_tolerances={1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).IceVolume),...
++	(md.results.TransientSolution(1).IceVolumeScaled),...
++	(md.results.TransientSolution(1).GroundedArea),...
++	(md.results.TransientSolution(1).GroundedAreaScaled),...
++	(md.results.TransientSolution(1).FloatingArea),...
++	(md.results.TransientSolution(1).FloatingAreaScaled),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(1).TotalSmbScaled),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
++	(md.results.TransientSolution(1).TotalFloatingBmbScaled),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).IceVolume),...
++	(md.results.TransientSolution(2).IceVolumeScaled),...
++	(md.results.TransientSolution(2).GroundedArea),...
++	(md.results.TransientSolution(2).GroundedAreaScaled),...
++	(md.results.TransientSolution(2).FloatingArea),...
++	(md.results.TransientSolution(2).FloatingAreaScaled),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(2).TotalSmbScaled),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
++	(md.results.TransientSolution(2).TotalFloatingBmbScaled),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test519.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test519.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test519.py	(revision 26440)
+@@ -0,0 +1,82 @@
++#Test Name: PigTranMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Pig.exp', 20000.)
++md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
++md = parameterize(md, '../Par/Pig.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.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]
+Index: ../trunk-jpl/test/NightlyRun/test810.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test810.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test810.m	(revision 26440)
+@@ -0,0 +1,48 @@
++%Test Name: ValleyGlacierLevelsetMLHO2d
++md=triangle(model(),'../Exp/Square.exp',50000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/ValleyGlacierShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.levelset.stabilization=2;
++md.cluster=generic('name',oshostname(),'np',3);
++
++%Transient;
++md.transient.isstressbalance=1;
++md.transient.ismovingfront=1;
++md.transient.ismasstransport=1;
++md.transient.issmb=1;
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',...
++		'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',...
++		'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3'};
++field_tolerances={1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,...
++		1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,...
++		1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12};
++field_values={...
++	md.results.TransientSolution(1).Vx,...
++	md.results.TransientSolution(1).Vy,...
++	md.results.TransientSolution(1).Vel,...
++	md.results.TransientSolution(1).Pressure,...
++	md.results.TransientSolution(1).Thickness,...
++	md.results.TransientSolution(1).Surface,...
++	md.results.TransientSolution(1).MaskIceLevelset,...
++	md.results.TransientSolution(2).Vx,...
++	md.results.TransientSolution(2).Vy,...
++	md.results.TransientSolution(2).Vel,...
++	md.results.TransientSolution(2).Pressure,...
++	md.results.TransientSolution(2).Thickness,...
++	md.results.TransientSolution(2).Surface,...
++	md.results.TransientSolution(2).MaskIceLevelset,...
++	md.results.TransientSolution(3).Vx,...
++	md.results.TransientSolution(3).Vy,...
++	md.results.TransientSolution(3).Vel,...
++	md.results.TransientSolution(3).Pressure,...
++	md.results.TransientSolution(3).Thickness,...
++	md.results.TransientSolution(3).Surface,...
++	md.results.TransientSolution(3).MaskIceLevelset,...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test810.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test810.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test810.py	(revision 26440)
+@@ -0,0 +1,54 @@
++#Test Name: ValleyGlacierLevelsetMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++md = triangle(model(), '../Exp/Square.exp', 50000)
++md = setmask(md, '', '')
++md = parameterize(md, '../Par/ValleyGlacierShelf.py')
++md.levelset.stabilization = 2
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', gethostname(), 'np', 3)
++
++#Transient
++md.transient.isstressbalance = True
++md.transient.ismovingfront = True
++md.transient.ismasstransport = True
++md.transient.issmb = True
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1',
++               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2',
++               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
++field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12,
++                    1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12,
++                    1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12]
++field_values = [md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Vel,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].MaskIceLevelset,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Vel,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].MaskIceLevelset,
++                md.results.TransientSolution[2].Vx,
++                md.results.TransientSolution[2].Vy,
++                md.results.TransientSolution[2].Vel,
++                md.results.TransientSolution[2].Pressure,
++                md.results.TransientSolution[2].Thickness,
++                md.results.TransientSolution[2].Surface,
++                md.results.TransientSolution[2].MaskIceLevelset]
+Index: ../trunk-jpl/test/NightlyRun/test811.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test811.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test811.m	(revision 26440)
+@@ -0,0 +1,51 @@
++%Test Name: ValleyGlacierLevelsetCalvingMLHO2d
++md=triangle(model(),'../Exp/Square.exp',50000);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/ValleyGlacierShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++%Transient
++md.transient.isstressbalance=1;
++md.transient.ismasstransport=1;
++md.transient.issmb=1;
++md.transient.isthermal=0;
++md.transient.isgroundingline=1;
++md.transient.ismovingfront=1;
++
++md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
++md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 1e10;
++
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',...
++		'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',...
++		'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++		2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,...
++		2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	md.results.TransientSolution(1).Vx,...
++	md.results.TransientSolution(1).Vy,...
++	md.results.TransientSolution(1).Vel,...
++	md.results.TransientSolution(1).Pressure,...
++	md.results.TransientSolution(1).Thickness,...
++	md.results.TransientSolution(1).Surface,...
++	md.results.TransientSolution(1).MaskIceLevelset,...
++	md.results.TransientSolution(2).Vx,...
++	md.results.TransientSolution(2).Vy,...
++	md.results.TransientSolution(2).Vel,...
++	md.results.TransientSolution(2).Pressure,...
++	md.results.TransientSolution(2).Thickness,...
++	md.results.TransientSolution(2).Surface,...
++	md.results.TransientSolution(2).MaskIceLevelset,...
++	md.results.TransientSolution(3).Vx,...
++	md.results.TransientSolution(3).Vy,...
++	md.results.TransientSolution(3).Vel,...
++	md.results.TransientSolution(3).Pressure,...
++	md.results.TransientSolution(3).Thickness,...
++	md.results.TransientSolution(3).Surface,...
++	md.results.TransientSolution(3).MaskIceLevelset,...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test811.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test811.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test811.py	(revision 26440)
+@@ -0,0 +1,59 @@
++#Test Name: ValleyGlacierLevelsetCalvingMLHO2d
++import numpy as np
++from MatlabFuncs import oshostname
++from model import *
++from parameterize import *
++from setflowequation import *
++from setmask import *
++from solve import *
++from triangle import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 50000)
++md = setmask(md, '', '')
++md = parameterize(md, '../Par/ValleyGlacierShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', oshostname(), 'np', 3)
++
++#Transient
++md.transient.isstressbalance = True
++md.transient.ismasstransport = True
++md.transient.issmb = True
++md.transient.isthermal = False
++md.transient.isgroundingline = True
++md.transient.ismovingfront = True
++
++md.calving.calvingrate = 1000. * np.ones((md.mesh.numberofvertices))
++md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
++md.levelset.migration_max = 1e10
++
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1',
++               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2',
++               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Vel,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].MaskIceLevelset,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Vel,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].MaskIceLevelset,
++                md.results.TransientSolution[2].Vx,
++                md.results.TransientSolution[2].Vy,
++                md.results.TransientSolution[2].Vel,
++                md.results.TransientSolution[2].Pressure,
++                md.results.TransientSolution[2].Thickness,
++                md.results.TransientSolution[2].Surface,
++                md.results.TransientSolution[2].MaskIceLevelset]
+Index: ../trunk-jpl/test/NightlyRun/test812.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test812.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test812.m	(revision 26440)
+@@ -0,0 +1,77 @@
++%Test Name: SquareShelfLevelsetCalvingMLHO2dLevermann
++md=triangle(model(),'../Exp/Square.exp',50000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'MLHO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++%Do not kill ice bergs as all is floating
++md.levelset.kill_icebergs=0;
++
++x = md.mesh.x;
++xmin = min(x);
++xmax = max(x);
++Lx = (xmax-xmin);
++alpha = 2./3.;
++md.mask.ice_levelset = ((x - alpha*Lx)>0) - ((x - alpha*Lx)<0);
++
++md.timestepping.time_step=10;
++md.timestepping.final_time=30;
++
++%Transient
++md.transient.isstressbalance=1;
++md.transient.ismasstransport=1;
++md.transient.issmb=1;
++md.transient.isthermal=0;
++md.transient.isgroundingline=0;
++md.transient.ismovingfront=1;
++
++md.calving=calvinglevermann();
++md.calving.coeff=4.89e13*ones(md.mesh.numberofvertices,1);
++md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
++md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 1e8;
++
++md.transient.requested_outputs={'default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate'};
++
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','StrainRateparallel1','StrainRateperpendicular1','CalvingCalvingrate1'...
++		'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','StrainRateparallel2','StrainRateperpendicular2','CalvingCalvingrate2'...
++		'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','StrainRateparallel3','StrainRateperpendicular3','CalvingCalvingrate3'};
++field_tolerances={1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,...
++		2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,...
++		2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,5e-11,5e-11,5e-11};
++field_values={...
++	md.results.TransientSolution(1).Vx,...
++	md.results.TransientSolution(1).Vy,...
++	md.results.TransientSolution(1).Vel,...
++	md.results.TransientSolution(1).Pressure,...
++	md.results.TransientSolution(1).Thickness,...
++	md.results.TransientSolution(1).Surface,...
++	md.results.TransientSolution(1).MaskIceLevelset,...
++	md.results.TransientSolution(1).StrainRateparallel,...
++	md.results.TransientSolution(1).StrainRateperpendicular,...
++	md.results.TransientSolution(1).CalvingCalvingrate,...
++	md.results.TransientSolution(2).Vx,...
++	md.results.TransientSolution(2).Vy,...
++	md.results.TransientSolution(2).Vel,...
++	md.results.TransientSolution(2).Pressure,...
++	md.results.TransientSolution(2).Thickness,...
++	md.results.TransientSolution(2).Surface,...
++	md.results.TransientSolution(2).MaskIceLevelset,...
++	md.results.TransientSolution(2).StrainRateparallel,...
++	md.results.TransientSolution(2).StrainRateperpendicular,...
++	md.results.TransientSolution(2).CalvingCalvingrate,...
++	md.results.TransientSolution(3).Vx,...
++	md.results.TransientSolution(3).Vy,...
++	md.results.TransientSolution(3).Vel,...
++	md.results.TransientSolution(3).Pressure,...
++	md.results.TransientSolution(3).Thickness,...
++	md.results.TransientSolution(3).Surface,...
++	md.results.TransientSolution(3).MaskIceLevelset,...
++	md.results.TransientSolution(3).StrainRateparallel,...
++	md.results.TransientSolution(3).StrainRateperpendicular,...
++	md.results.TransientSolution(3).CalvingCalvingrate,...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test812.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test812.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test812.py	(revision 26440)
+@@ -0,0 +1,84 @@
++#Test Name: SquareShelfLevelsetCalvingMLHO2dLevermann
++import numpy as np
++from MatlabFuncs import oshostname
++from model import *
++from parameterize import *
++from setflowequation import *
++from setmask import *
++from solve import *
++from triangle import *
++
++md = triangle(model(), '../Exp/Square.exp', 50000.)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.cluster = generic('name', oshostname(), 'np', 3)
++
++x = md.mesh.x
++xmin = min(x)
++xmax = max(x)
++Lx = (xmax - xmin)
++alpha = 2. / 3.
++md.mask.ice_levelset = np.float_((x - alpha * Lx) > 0) - np.float_((x - alpha * Lx) < 0)
++
++#Do not kill ice bergs as all is floating
++md.levelset.kill_icebergs = 0
++
++md.timestepping.time_step = 10
++md.timestepping.final_time = 30
++
++#Transient
++md.transient.isstressbalance = True
++md.transient.ismasstransport = True
++md.transient.issmb = True
++md.transient.isthermal = False
++md.transient.isgroundingline = False
++md.transient.ismovingfront = True
++
++md.calving = calvinglevermann()
++md.calving.coeff = 4.89e13 * np.ones((md.mesh.numberofvertices))
++md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
++md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
++md.levelset.migration_max = 1e8
++
++md.transient.requested_outputs = ['default', 'StrainRateparallel', 'StrainRateperpendicular', 'Calvingratex', 'Calvingratey', 'CalvingCalvingrate']
++
++md = solve(md, 'Transient')
++
++#Fields and tolerances to track changes
++field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1', 'StrainRateparallel1', 'StrainRateperpendicular1', 'CalvingCalvingrate1',
++               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2', 'StrainRateparallel2', 'StrainRateperpendicular2', 'CalvingCalvingrate2',
++               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3', 'StrainRateparallel3', 'StrainRateperpendicular3', 'CalvingCalvingrate3']
++field_tolerances = [1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
++                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
++                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 5e-11, 5e-11, 1e-11]
++field_values = [md.results.TransientSolution[0].Vx,
++                md.results.TransientSolution[0].Vy,
++                md.results.TransientSolution[0].Vel,
++                md.results.TransientSolution[0].Pressure,
++                md.results.TransientSolution[0].Thickness,
++                md.results.TransientSolution[0].Surface,
++                md.results.TransientSolution[0].MaskIceLevelset,
++                md.results.TransientSolution[0].StrainRateparallel,
++                md.results.TransientSolution[0].StrainRateperpendicular,
++                md.results.TransientSolution[0].CalvingCalvingrate,
++                md.results.TransientSolution[1].Vx,
++                md.results.TransientSolution[1].Vy,
++                md.results.TransientSolution[1].Vel,
++                md.results.TransientSolution[1].Pressure,
++                md.results.TransientSolution[1].Thickness,
++                md.results.TransientSolution[1].Surface,
++                md.results.TransientSolution[1].MaskIceLevelset,
++                md.results.TransientSolution[1].StrainRateparallel,
++                md.results.TransientSolution[1].StrainRateperpendicular,
++                md.results.TransientSolution[1].CalvingCalvingrate,
++                md.results.TransientSolution[2].Vx,
++                md.results.TransientSolution[2].Vy,
++                md.results.TransientSolution[2].Vel,
++                md.results.TransientSolution[2].Pressure,
++                md.results.TransientSolution[2].Thickness,
++                md.results.TransientSolution[2].Surface,
++                md.results.TransientSolution[2].MaskIceLevelset,
++                md.results.TransientSolution[2].StrainRateparallel,
++                md.results.TransientSolution[2].StrainRateperpendicular,
++                md.results.TransientSolution[2].CalvingCalvingrate]
+Index: ../trunk-jpl/test/Archives/Archive518.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive518.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive519.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive519.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26440-26441.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26440-26441.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26440-26441.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26440)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 26441)
+@@ -236,6 +236,10 @@
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'VySurface'),
+ 		field = field*yts;
++	elseif strcmp(fieldname,'VxAverage'),
++		field = field*yts;
++	elseif strcmp(fieldname,'VyAverage'),
++		field = field*yts;
+ 	elseif strcmp(fieldname,'BasalforcingsGroundediceMeltingRate'),
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'BasalforcingsFloatingiceMeltingRate'),
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26440)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.py	(revision 26441)
+@@ -187,6 +187,10 @@
+             field = field * yts
+         elif fieldname == 'VySurface':
+             field = field * yts
++        elif fieldname == 'VxAverage':
++            field = field * yts
++        elif fieldname == 'VyAverage':
++            field = field * yts
+         elif fieldname == 'BasalforcingsGroundediceMeltingRate':
+             field = field * yts
+         elif fieldname == 'BasalforcingsFloatingiceMeltingRate':
Index: /issm/oecreview/Archive/25834-26739/ISSM-26441-26442.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26441-26442.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26441-26442.diff	(revision 26740)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/test/Archives/Archive447.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive518.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive519.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26441)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26442)
+@@ -2914,8 +2914,8 @@
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
+ 	Input* surface_input  = element->GetInput(SurfaceEnum);   _assert_(surface_input);
+-	Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input); //vertically integrated vx
+-	Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input); //vertically integrated vy
++	//Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input); //vertically integrated vx
++	//Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input); //vertically integrated vy
+ 	Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input); 
+ 	Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
+ 	Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input); //shear vx at the surface 
+@@ -3143,6 +3143,10 @@
+ 		water_pressure_sh = gravity*rho_water*( -b*b/2 - (s*thickness/(n+2))*(1-pow(s/thickness,n+2)) + (thickness*thickness/(n+3))*(1-pow(s/thickness,n+3)) );
+ 		ice_pressure_sh   = gravity*rho_ice*thickness*thickness*(n+1)/(2*(n+3));
+ 		pressure_sh = ice_pressure_sh + water_pressure_sh;
++		if (b>0) {
++			pressure = ice_pressure;
++			pressure_sh = ice_pressure_sh;
++		}
+ 
+ 		for (int i=0;i<numnodes;i++){
+ 			pe->values[i*4+0]+= pressure*Jdet*gauss->weight*normal[0]*basis[i]; // F1
+@@ -3275,6 +3279,9 @@
+    for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+ 		vx[i]=vbx[i]+vshx[i]*(n[i]+1)/(n[i]+2);
+ 		vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2);
++		// HOTFIX: set surface velocity to VxEnum and VyEnum
++	//	vx[i]=vbx[i]+vshx[i];
++	//	vy[i]=vby[i]+vshy[i];
+ 	}
+ 		
+ 	/*Get Vz and compute vel (vertically averaged vel)*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26442-26443.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26442-26443.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26442-26443.diff	(revision 26740)
@@ -0,0 +1,106 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26442)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26443)
+@@ -404,12 +404,12 @@
+ void       Tria::CalvingCrevasseDepth(){/*{{{*/
+ 
+ 	IssmDouble  calvingrate[NUMVERTICES];
+-	IssmDouble  vx,vy,vel;
++	IssmDouble  vx,vy;
+ 	IssmDouble  water_height, bed,Ho,thickness,surface;
+ 	IssmDouble  surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal;
+-	IssmDouble  B, strainparallel, straineffective,n;
++	IssmDouble  strainparallel, straineffective,B,n;
+ 	IssmDouble  s_xx,s_xy,s_yy,s1,s2,stmp;
+-	int crevasse_opening_stress;
++	int         crevasse_opening_stress;
+ 
+ 	/*retrieve the type of crevasse_opening_stress*/
+ 	this->parameters->FindParam(&crevasse_opening_stress,CalvingCrevasseDepthEnum);
+@@ -441,8 +441,7 @@
+ 		H_input->GetInputValue(&thickness,&gauss);
+ 		bed_input->GetInputValue(&bed,&gauss);
+ 		surface_input->GetInputValue(&surface,&gauss);
+-		strainrateparallel_input->GetInputValue(&strainparallel,&gauss);
+-		strainrateeffective_input->GetInputValue(&straineffective,&gauss);
++
+ 		vx_input->GetInputValue(&vx,&gauss);
+ 		vy_input->GetInputValue(&vy,&gauss);
+ 		waterheight_input->GetInputValue(&water_height,&gauss);
+@@ -449,43 +448,47 @@
+ 		s_xx_input->GetInputValue(&s_xx,&gauss);
+ 		s_xy_input->GetInputValue(&s_xy,&gauss);
+ 		s_yy_input->GetInputValue(&s_yy,&gauss);
+-		B_input->GetInputValue(&B,&gauss);
+-		n_input->GetInputValue(&n,&gauss);
+ 
+-		vel=sqrt(vx*vx+vy*vy)+1.e-14;
+-
+-		s1=(s_xx+s_yy)/2.+sqrt(pow((s_xx-s_yy)/2.,2)+pow(s_xy,2));
+-		s2=(s_xx+s_yy)/2.-sqrt(pow((s_xx-s_yy)/2.,2)+pow(s_xy,2));
+-		if(fabs(s2)>fabs(s1)){stmp=s2; s2=s1; s1=stmp;}
+-
+-		Ho = thickness - (rho_seawater/rho_ice) * (-bed);
+-		if(Ho<0.)  Ho=0.;
+-
+-		if(crevasse_opening_stress==0){		/*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/
+-			surface_crevasse[iv] = B * strainparallel * pow(straineffective, ((1 / n)-1)) / (rho_ice * constant_g);
+-			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (B * strainparallel * pow(straineffective,((1/n)-1)) / (rho_ice*constant_g) - Ho);
++      /*Get longitudinal or maximum Eigen stress*/
++		if(crevasse_opening_stress==0){
++         /*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/
++			strainrateparallel_input->GetInputValue(&strainparallel,&gauss);
++			strainrateeffective_input->GetInputValue(&straineffective,&gauss);
++			B_input->GetInputValue(&B,&gauss);
++			n_input->GetInputValue(&n,&gauss);
++         s1 =  B * strainparallel * pow(straineffective, (1./n)-1);
+ 		}
+-		else if(crevasse_opening_stress==1){	 /*Benn2017,Todd2018: maximum principal stress */
+-			surface_crevasse[iv] = s1 / (rho_ice*constant_g);
+-			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (s1/ (rho_ice*constant_g)-Ho);
++		else if(crevasse_opening_stress==1){
++         /*Benn2017,Todd2018: maximum principal stress */
++			Matrix2x2Eigen(&s1,&s2,NULL,NULL,s_xx,s_xy,s_yy);
++			if(fabs(s2)>fabs(s1)){
++            stmp=s2; s2=s1; s1=stmp;
++         }
+ 		}
++      else{
++         _error_("not supported");
++      }
+ 
+-		/* some constraints */
+-		if (surface_crevasse[iv]<0.) {
++      /*Surface crevasse: sigma'_xx - rho_i g d + rho_fw g d_w = 0*/
++      surface_crevasse[iv] = s1 / (rho_ice*constant_g) + (rho_freshwater/rho_ice)*water_height;
++		if(surface_crevasse[iv]<0.){
+ 			surface_crevasse[iv]=0.;
+ 			water_height = 0.;
+ 		}
+-		if (basal_crevasse[iv]<0.) basal_crevasse[iv]=0.;
+-		if (bed>0.) basal_crevasse[iv] = 0.;
+ 
+-		//if (surface_crevasse[iv]<water_height){
+-		//	water_height = surface_crevasse[iv];
+-		//}
++      /*Basal crevasse: sigma'_xx - rho_i g (H-d) - rho_w g (b+d) = 0*/
++      if(bed>0.){
++         basal_crevasse[iv] = 0.;
++      }
++      else{
++         Ho = thickness - (rho_seawater/rho_ice) * (-bed);
++         if(Ho<0.)  Ho=0.;
++         basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (s1/ (rho_ice*constant_g)-Ho);
++         if(basal_crevasse[iv]<0.) basal_crevasse[iv]=0.;
++      }
+ 
+-		/* 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 */
+-
++      /*Total crevasse depth (surface + basal)*/
++		crevasse_depth[iv]   = surface_crevasse[iv] + basal_crevasse[iv];
+ 	}
+ 
+ 	this->AddInput(SurfaceCrevasseEnum,&surface_crevasse[0],P1DGEnum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26443-26444.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26443-26444.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26443-26444.diff	(revision 26740)
@@ -0,0 +1,99 @@
+Index: ../trunk-jpl/src/m/classes/calvingcrevassedepth.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/calvingcrevassedepth.py	(revision 26443)
++++ ../trunk-jpl/src/m/classes/calvingcrevassedepth.py	(revision 26444)
+@@ -13,26 +13,24 @@
+ 
+     def __init__(self):  # {{{
+         self.crevasse_opening_stress = 1
+-        self.water_height = 0
++        self.crevasse_threshold      = 1.
++        self.water_height            = 0.
+ 
+         #self.setdefaultparameters() # Uncomment if/when setdefaultparameters is used
+     #}}}
+-
+     def __repr__(self):  # {{{
+         s = '   Calving Pi parameters:'
+         s += '{}\n'.format(fielddisplay(self, 'crevasse_opening_stress', '0: stress only in the ice-flow direction, 1: max principal'))
++        s += '{}\n'.format(fielddisplay(self, 'crevasse_threshold', 'ratio of full thickness to calve (e.g. 0.75 is for 75% of the total ice thickness)'))
+         s += '{}\n'.format(fielddisplay(self, 'water_height', 'water height in the crevasse [m]'))
+         return s
+     #}}}
+-
+     def setdefaultparameters(self):  # {{{
+         return self
+     #}}}
+-
+     def extrude(self, md):  # {{{
+         return self
+     #}}}
+-
+     def checkconsistency(self, md, solution, analyses):  # {{{
+         #Early return
+         if solution != 'TransientSolution' or not md.transient.ismovingfront:
+@@ -39,14 +37,15 @@
+             return md
+ 
+         md = checkfield(md, 'fieldname', 'calving.crevasse_opening_stress', 'numel', [1], 'values', [0,1])
++        md = checkfield(md, 'fieldname', 'calving.crevasse_threshold', 'numel', [1], '>', 0., '<=', 1.)
+         md = checkfield(md, 'fieldname', 'calving.water_height', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0) 
+ 
+         return md
+     # }}}
+-
+     def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+         WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 6, 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'crevasse_opening_stress', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'crevasse_threshold', 'format', 'Double')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'water_height', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+     # }}}
+Index: ../trunk-jpl/src/m/classes/calvingcrevassedepth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/calvingcrevassedepth.m	(revision 26443)
++++ ../trunk-jpl/src/m/classes/calvingcrevassedepth.m	(revision 26444)
+@@ -5,7 +5,8 @@
+ 
+ classdef calvingcrevassedepth
+ 	properties (SetAccess=public) 
+-		crevasse_opening_stress=1.;
++		crevasse_opening_stress=1;
++		crevasse_threshold     =1.;
+ 		water_height = 0.;
+ 	end
+ 	methods
+@@ -31,8 +32,9 @@
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 			
+-			self.water_height = 0.;
+-			crevasse_opening_stress=1.;
++			crevasse_threshold      = 1.;
++			crevasse_opening_stress = 1;
++         self.water_height       = 0.;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 			%Early return
+@@ -39,11 +41,13 @@
+ 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+ 
+ 			md = checkfield(md,'fieldname','calving.crevasse_opening_stress','numel',[1],'values',[0,1]);
++         md = checkfield(md,'fieldname','calving.crevasse_threshold','numel',[1],'values',[0,1]);
+ 			md = checkfield(md,'fieldname','calving.water_height','NaN',1,'Inf',1,'timeseries',1,'>=',0);
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   Calving Pi parameters:'));
+ 			fielddisplay(self,'crevasse_opening_stress','0: stress only in the ice-flow direction, 1: max principal');
++			fielddisplay(self,'crevasse_threshold','ratio of full thickness to calve (e.g. 0.75 is for 75% of the total ice thickness)');
+ 			fielddisplay(self,'water_height','water height in the crevasse [m]');
+ 
+ 		end % }}}
+@@ -51,6 +55,7 @@
+ 			yts=md.constants.yts;
+ 			WriteData(fid,prefix,'name','md.calving.law','data',6,'format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','crevasse_opening_stress','format','Integer');
++         WriteData(fid,prefix,'object',self,'fieldname','crevasse_threshold','format','Double');
+ 			WriteData(fid,prefix,'object',self,'fieldname','water_height','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 		end % }}}
+ 	end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26444-26445.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26444-26445.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26444-26445.diff	(revision 26740)
@@ -0,0 +1,560 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26444)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26445)
+@@ -100,6 +100,7 @@
+ syn keyword cConstant BasalforcingsUpperwaterElevationEnum
+ syn keyword cConstant BasalforcingsUpperwaterMeltingRateEnum
+ syn keyword cConstant CalvingCrevasseDepthEnum
++syn keyword cConstant CalvingCrevasseThresholdEnum
+ syn keyword cConstant CalvingHeightAboveFloatationEnum
+ syn keyword cConstant CalvingLawEnum
+ syn keyword cConstant CalvingMinthicknessEnum
+@@ -365,6 +366,9 @@
+ syn keyword cConstant SolidearthSettingsElasticEnum
+ syn keyword cConstant SolidearthSettingsViscousEnum
+ syn keyword cConstant SealevelchangeGeometryDoneEnum
++syn keyword cConstant SealevelchangeViscousNumStepsEnum
++syn keyword cConstant SealevelchangeViscousTimesEnum
++syn keyword cConstant SealevelchangeViscousIndexEnum
+ syn keyword cConstant RotationalEquatorialMoiEnum
+ syn keyword cConstant TidalLoveHEnum
+ syn keyword cConstant TidalLoveKEnum
+@@ -375,9 +379,9 @@
+ syn keyword cConstant LoadLoveLEnum
+ syn keyword cConstant LoveTimeFreqEnum
+ syn keyword cConstant LoveIsTimeEnum
+-syn keyword cConstant SealevelchangeGRigidEnum
++syn keyword cConstant SealevelchangeGSelfAttractionEnum
+ syn keyword cConstant SealevelchangeGViscoElasticEnum
+-syn keyword cConstant SolidearthSettingsComputesealevelchangeEnum
++syn keyword cConstant SolidearthSettingsSealevelLoadingEnum
+ syn keyword cConstant SolidearthSettingsGRDEnum
+ syn keyword cConstant SolidearthSettingsRunFrequencyEnum
+ syn keyword cConstant SolidearthSettingsTimeAccEnum
+@@ -384,12 +388,14 @@
+ syn keyword cConstant SealevelchangeHViscoElasticEnum
+ syn keyword cConstant SolidearthSettingsHorizEnum
+ syn keyword cConstant SolidearthSettingsMaxiterEnum
++syn keyword cConstant SolidearthSettingsGrdOceanEnum
+ syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
+ syn keyword cConstant RotationalPolarMoiEnum
+ syn keyword cConstant SolidearthSettingsReltolEnum
+ syn keyword cConstant SealevelchangeRequestedOutputsEnum
+-syn keyword cConstant SolidearthSettingsRigidEnum
++syn keyword cConstant SolidearthSettingsSelfAttractionEnum
+ syn keyword cConstant SolidearthSettingsRotationEnum
++syn keyword cConstant SolidearthSettingsMaxSHCoeffEnum
+ syn keyword cConstant SealevelchangeRunCountEnum
+ syn keyword cConstant SealevelchangeTransitionsEnum
+ syn keyword cConstant SealevelchangeUViscoElasticEnum
+@@ -401,9 +407,6 @@
+ syn keyword cConstant SettingsSbCouplingFrequencyEnum
+ syn keyword cConstant SettingsSolverResidueThresholdEnum
+ syn keyword cConstant SettingsWaitonlockEnum
+-syn keyword cConstant StackNumStepsEnum
+-syn keyword cConstant StackTimesEnum
+-syn keyword cConstant StackIndexEnum
+ syn keyword cConstant SmbAIceEnum
+ syn keyword cConstant SmbAIdxEnum
+ syn keyword cConstant SmbASnowEnum
+@@ -834,6 +837,10 @@
+ syn keyword cConstant SealevelchangeGUsubelHydroEnum
+ syn keyword cConstant SealevelchangeGEsubelHydroEnum
+ syn keyword cConstant SealevelchangeGNsubelHydroEnum
++syn keyword cConstant SealevelchangeViscousRSLEnum
++syn keyword cConstant SealevelchangeViscousUEnum
++syn keyword cConstant SealevelchangeViscousNEnum
++syn keyword cConstant SealevelchangeViscousEEnum
+ syn keyword cConstant SedimentHeadEnum
+ syn keyword cConstant SedimentHeadOldEnum
+ syn keyword cConstant SedimentHeadSubstepEnum
+@@ -954,11 +961,6 @@
+ syn keyword cConstant SolidearthExternalDisplacementNorthRateEnum
+ syn keyword cConstant SolidearthExternalDisplacementUpRateEnum
+ syn keyword cConstant SolidearthExternalGeoidRateEnum
+-syn keyword cConstant SolidearthExternalBarystaticSeaLevelRateEnum
+-syn keyword cConstant StackRSLEnum
+-syn keyword cConstant StackUEnum
+-syn keyword cConstant StackNEnum
+-syn keyword cConstant StackEEnum
+ syn keyword cConstant StrainRateeffectiveEnum
+ syn keyword cConstant StrainRateparallelEnum
+ syn keyword cConstant StrainRateperpendicularEnum
+@@ -1430,6 +1432,7 @@
+ syn keyword cConstant SealevelInertiaTensorXZEnum
+ syn keyword cConstant SealevelInertiaTensorYZEnum
+ syn keyword cConstant SealevelInertiaTensorZZEnum
++syn keyword cConstant SealevelchangePolarMotionEnum
+ syn keyword cConstant SealevelNmotionEnum
+ syn keyword cConstant SealevelUmotionEnum
+ syn keyword cConstant SealevelchangeAnalysisEnum
+@@ -1529,6 +1532,7 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
++syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1535,8 +1539,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DatasetInput
+ syn keyword cType DataSetParam
+-syn keyword cType DatasetInput
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1549,8 +1553,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType Elements
+ syn keyword cType ElementVector
+-syn keyword cType Elements
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1557,11 +1561,12 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1577,6 +1582,7 @@
+ 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
+@@ -1587,6 +1593,7 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
++syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1599,8 +1606,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType Options
+ syn keyword cType OptionUtilities
+-syn keyword cType Options
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1614,13 +1621,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType Riftfront
+ syn keyword cType RiftStruct
+-syn keyword cType Riftfront
+ syn keyword cType SealevelGeometry
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType Segment
+ syn keyword cType SegRef
+-syn keyword cType Segment
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1639,10 +1646,6 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26444)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26445)
+@@ -94,6 +94,7 @@
+ 	BasalforcingsUpperwaterElevationEnum,
+ 	BasalforcingsUpperwaterMeltingRateEnum,
+ 	CalvingCrevasseDepthEnum,
++	CalvingCrevasseThresholdEnum,
+ 	CalvingHeightAboveFloatationEnum,
+ 	CalvingLawEnum,
+ 	CalvingMinthicknessEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26444)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26445)
+@@ -102,6 +102,7 @@
+ 		case BasalforcingsUpperwaterElevationEnum : return "BasalforcingsUpperwaterElevation";
+ 		case BasalforcingsUpperwaterMeltingRateEnum : return "BasalforcingsUpperwaterMeltingRate";
+ 		case CalvingCrevasseDepthEnum : return "CalvingCrevasseDepth";
++		case CalvingCrevasseThresholdEnum : return "CalvingCrevasseThreshold";
+ 		case CalvingHeightAboveFloatationEnum : return "CalvingHeightAboveFloatation";
+ 		case CalvingLawEnum : return "CalvingLaw";
+ 		case CalvingMinthicknessEnum : return "CalvingMinthickness";
+@@ -367,6 +368,9 @@
+ 		case SolidearthSettingsElasticEnum : return "SolidearthSettingsElastic";
+ 		case SolidearthSettingsViscousEnum : return "SolidearthSettingsViscous";
+ 		case SealevelchangeGeometryDoneEnum : return "SealevelchangeGeometryDone";
++		case SealevelchangeViscousNumStepsEnum : return "SealevelchangeViscousNumSteps";
++		case SealevelchangeViscousTimesEnum : return "SealevelchangeViscousTimes";
++		case SealevelchangeViscousIndexEnum : return "SealevelchangeViscousIndex";
+ 		case RotationalEquatorialMoiEnum : return "RotationalEquatorialMoi";
+ 		case TidalLoveHEnum : return "TidalLoveH";
+ 		case TidalLoveKEnum : return "TidalLoveK";
+@@ -386,6 +390,7 @@
+ 		case SealevelchangeHViscoElasticEnum : return "SealevelchangeHViscoElastic";
+ 		case SolidearthSettingsHorizEnum : return "SolidearthSettingsHoriz";
+ 		case SolidearthSettingsMaxiterEnum : return "SolidearthSettingsMaxiter";
++		case SolidearthSettingsGrdOceanEnum : return "SolidearthSettingsGrdOcean";
+ 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
+ 		case RotationalPolarMoiEnum : return "RotationalPolarMoi";
+ 		case SolidearthSettingsReltolEnum : return "SolidearthSettingsReltol";
+@@ -392,6 +397,7 @@
+ 		case SealevelchangeRequestedOutputsEnum : return "SealevelchangeRequestedOutputs";
+ 		case SolidearthSettingsSelfAttractionEnum : return "SolidearthSettingsSelfAttraction";
+ 		case SolidearthSettingsRotationEnum : return "SolidearthSettingsRotation";
++		case SolidearthSettingsMaxSHCoeffEnum : return "SolidearthSettingsMaxSHCoeff";
+ 		case SealevelchangeRunCountEnum : return "SealevelchangeRunCount";
+ 		case SealevelchangeTransitionsEnum : return "SealevelchangeTransitions";
+ 		case SealevelchangeUViscoElasticEnum : return "SealevelchangeUViscoElastic";
+@@ -403,9 +409,6 @@
+ 		case SettingsSbCouplingFrequencyEnum : return "SettingsSbCouplingFrequency";
+ 		case SettingsSolverResidueThresholdEnum : return "SettingsSolverResidueThreshold";
+ 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
+-		case SealevelchangeViscousNumStepsEnum : return "SealevelchangeViscousNumSteps";
+-		case SealevelchangeViscousTimesEnum : return "SealevelchangeViscousTimes";
+-		case SealevelchangeViscousIndexEnum : return "SealevelchangeViscousIndex";
+ 		case SmbAIceEnum : return "SmbAIce";
+ 		case SmbAIdxEnum : return "SmbAIdx";
+ 		case SmbASnowEnum : return "SmbASnow";
+@@ -836,6 +839,10 @@
+ 		case SealevelchangeGUsubelHydroEnum : return "SealevelchangeGUsubelHydro";
+ 		case SealevelchangeGEsubelHydroEnum : return "SealevelchangeGEsubelHydro";
+ 		case SealevelchangeGNsubelHydroEnum : return "SealevelchangeGNsubelHydro";
++		case SealevelchangeViscousRSLEnum : return "SealevelchangeViscousRSL";
++		case SealevelchangeViscousUEnum : return "SealevelchangeViscousU";
++		case SealevelchangeViscousNEnum : return "SealevelchangeViscousN";
++		case SealevelchangeViscousEEnum : return "SealevelchangeViscousE";
+ 		case SedimentHeadEnum : return "SedimentHead";
+ 		case SedimentHeadOldEnum : return "SedimentHeadOld";
+ 		case SedimentHeadSubstepEnum : return "SedimentHeadSubstep";
+@@ -956,10 +963,6 @@
+ 		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
+ 		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+ 		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
+-		case SealevelchangeViscousRSLEnum : return "SealevelchangeViscousRSL";
+-		case SealevelchangeViscousUEnum : return "SealevelchangeViscousU";
+-		case SealevelchangeViscousNEnum : return "SealevelchangeViscousN";
+-		case SealevelchangeViscousEEnum : return "SealevelchangeViscousE";
+ 		case StrainRateeffectiveEnum : return "StrainRateeffective";
+ 		case StrainRateparallelEnum : return "StrainRateparallel";
+ 		case StrainRateperpendicularEnum : return "StrainRateperpendicular";
+@@ -1431,6 +1434,7 @@
+ 		case SealevelInertiaTensorXZEnum : return "SealevelInertiaTensorXZ";
+ 		case SealevelInertiaTensorYZEnum : return "SealevelInertiaTensorYZ";
+ 		case SealevelInertiaTensorZZEnum : return "SealevelInertiaTensorZZ";
++		case SealevelchangePolarMotionEnum : return "SealevelchangePolarMotion";
+ 		case SealevelNmotionEnum : return "SealevelNmotion";
+ 		case SealevelUmotionEnum : return "SealevelUmotion";
+ 		case SealevelchangeAnalysisEnum : return "SealevelchangeAnalysis";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26444)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26445)
+@@ -102,6 +102,7 @@
+ 	      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,"CalvingCrevasseThreshold")==0) return CalvingCrevasseThresholdEnum;
+ 	      else if (strcmp(name,"CalvingHeightAboveFloatation")==0) return CalvingHeightAboveFloatationEnum;
+ 	      else if (strcmp(name,"CalvingLaw")==0) return CalvingLawEnum;
+ 	      else if (strcmp(name,"CalvingMinthickness")==0) return CalvingMinthicknessEnum;
+@@ -135,11 +136,11 @@
+ 	      else if (strcmp(name,"DamageLaw")==0) return DamageLawEnum;
+ 	      else if (strcmp(name,"DamageMaxDamage")==0) return DamageMaxDamageEnum;
+ 	      else if (strcmp(name,"DamageStabilization")==0) return DamageStabilizationEnum;
+-	      else if (strcmp(name,"DamageStressThreshold")==0) return DamageStressThresholdEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"DamageStressUBound")==0) return DamageStressUBoundEnum;
++	      if (strcmp(name,"DamageStressThreshold")==0) return DamageStressThresholdEnum;
++	      else if (strcmp(name,"DamageStressUBound")==0) return DamageStressUBoundEnum;
+ 	      else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
+ 	      else if (strcmp(name,"DomainDimension")==0) return DomainDimensionEnum;
+ 	      else if (strcmp(name,"DomainType")==0) return DomainTypeEnum;
+@@ -258,11 +259,11 @@
+ 	      else if (strcmp(name,"LevelsetKillIcebergs")==0) return LevelsetKillIcebergsEnum;
+ 	      else if (strcmp(name,"LevelsetReinitFrequency")==0) return LevelsetReinitFrequencyEnum;
+ 	      else if (strcmp(name,"LevelsetStabilization")==0) return LevelsetStabilizationEnum;
+-	      else if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
++	      if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
++	      else if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
+ 	      else if (strcmp(name,"LoveCoreMantleBoundary")==0) return LoveCoreMantleBoundaryEnum;
+ 	      else if (strcmp(name,"LoveEarthMass")==0) return LoveEarthMassEnum;
+ 	      else if (strcmp(name,"LoveForcingType")==0) return LoveForcingTypeEnum;
+@@ -373,19 +374,22 @@
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsViscous")==0) return SolidearthSettingsViscousEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
++	      else if (strcmp(name,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
++	      else if (strcmp(name,"SealevelchangeViscousTimes")==0) return SealevelchangeViscousTimesEnum;
++	      else if (strcmp(name,"SealevelchangeViscousIndex")==0) return SealevelchangeViscousIndexEnum;
+ 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
+ 	      else if (strcmp(name,"TidalLoveH")==0) return TidalLoveHEnum;
+ 	      else if (strcmp(name,"TidalLoveK")==0) return TidalLoveKEnum;
+ 	      else if (strcmp(name,"TidalLoveL")==0) return TidalLoveLEnum;
+ 	      else if (strcmp(name,"TidalLoveK2Secular")==0) return TidalLoveK2SecularEnum;
+-	      else if (strcmp(name,"LoadLoveH")==0) return LoadLoveHEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"LoadLoveH")==0) return LoadLoveHEnum;
+ 	      else if (strcmp(name,"LoadLoveK")==0) return LoadLoveKEnum;
+ 	      else if (strcmp(name,"LoadLoveL")==0) return LoadLoveLEnum;
+ 	      else if (strcmp(name,"LoveTimeFreq")==0) return LoveTimeFreqEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"LoveIsTime")==0) return LoveIsTimeEnum;
++	      else if (strcmp(name,"LoveIsTime")==0) return LoveIsTimeEnum;
+ 	      else if (strcmp(name,"SealevelchangeGSelfAttraction")==0) return SealevelchangeGSelfAttractionEnum;
+ 	      else if (strcmp(name,"SealevelchangeGViscoElastic")==0) return SealevelchangeGViscoElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsSealevelLoading")==0) return SolidearthSettingsSealevelLoadingEnum;
+@@ -395,6 +399,7 @@
+ 	      else if (strcmp(name,"SealevelchangeHViscoElastic")==0) return SealevelchangeHViscoElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsHoriz")==0) return SolidearthSettingsHorizEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsMaxiter")==0) return SolidearthSettingsMaxiterEnum;
++	      else if (strcmp(name,"SolidearthSettingsGrdOcean")==0) return SolidearthSettingsGrdOceanEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+@@ -401,6 +406,7 @@
+ 	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsSelfAttraction")==0) return SolidearthSettingsSelfAttractionEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsRotation")==0) return SolidearthSettingsRotationEnum;
++	      else if (strcmp(name,"SolidearthSettingsMaxSHCoeff")==0) return SolidearthSettingsMaxSHCoeffEnum;
+ 	      else if (strcmp(name,"SealevelchangeRunCount")==0) return SealevelchangeRunCountEnum;
+ 	      else if (strcmp(name,"SealevelchangeTransitions")==0) return SealevelchangeTransitionsEnum;
+ 	      else if (strcmp(name,"SealevelchangeUViscoElastic")==0) return SealevelchangeUViscoElasticEnum;
+@@ -412,9 +418,6 @@
+ 	      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,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousTimes")==0) return SealevelchangeViscousTimesEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousIndex")==0) return SealevelchangeViscousIndexEnum;
+ 	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
+ 	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
+ 	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
+@@ -502,13 +505,13 @@
+ 	      else if (strcmp(name,"ThermalWatercolumnUpperlimit")==0) return ThermalWatercolumnUpperlimitEnum;
+ 	      else if (strcmp(name,"Time")==0) return TimeEnum;
+ 	      else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum;
+-	      else if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
+-	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
+-	      else if (strcmp(name,"TimesteppingInterpForcing")==0) return TimesteppingInterpForcingEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
++	      if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
++	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
++	      else if (strcmp(name,"TimesteppingInterpForcing")==0) return TimesteppingInterpForcingEnum;
++	      else if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
+ 	      else if (strcmp(name,"TimesteppingStartTime")==0) return TimesteppingStartTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
+ 	      else if (strcmp(name,"TimesteppingTimeStepMax")==0) return TimesteppingTimeStepMaxEnum;
+@@ -625,13 +628,13 @@
+ 	      else if (strcmp(name,"StrOld")==0) return StrOldEnum;
+ 	      else if (strcmp(name,"Str")==0) return StrEnum;
+ 	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
+-	      else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
+-	      else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
+-	      else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
++	      if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
++	      else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
++	      else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum;
++	      else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
+ 	      else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum;
+ 	      else if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum;
+ 	      else if (strcmp(name,"DeviatoricStress1")==0) return DeviatoricStress1Enum;
+@@ -748,13 +751,13 @@
+ 	      else if (strcmp(name,"MaterialsRheologyEbar")==0) return MaterialsRheologyEbarEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyEc")==0) return MaterialsRheologyEcEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyEcbar")==0) return MaterialsRheologyEcbarEnum;
+-	      else if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
+-	      else if (strcmp(name,"MaterialsRheologyEsbar")==0) return MaterialsRheologyEsbarEnum;
+-	      else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"MeshScaleFactor")==0) return MeshScaleFactorEnum;
++	      if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
++	      else if (strcmp(name,"MaterialsRheologyEsbar")==0) return MaterialsRheologyEsbarEnum;
++	      else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
++	      else if (strcmp(name,"MeshScaleFactor")==0) return MeshScaleFactorEnum;
+ 	      else if (strcmp(name,"MeshVertexonbase")==0) return MeshVertexonbaseEnum;
+ 	      else if (strcmp(name,"MeshVertexonboundary")==0) return MeshVertexonboundaryEnum;
+ 	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
+@@ -854,6 +857,10 @@
+ 	      else if (strcmp(name,"SealevelchangeGUsubelHydro")==0) return SealevelchangeGUsubelHydroEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelHydro")==0) return SealevelchangeGEsubelHydroEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelHydro")==0) return SealevelchangeGNsubelHydroEnum;
++	      else if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
++	      else if (strcmp(name,"SealevelchangeViscousU")==0) return SealevelchangeViscousUEnum;
++	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
++	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+ 	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
+ 	      else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
+ 	      else if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum;
+@@ -867,7 +874,10 @@
+ 	      else if (strcmp(name,"SmbAccumulatedMelt")==0) return SmbAccumulatedMeltEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedPrecipitation")==0) return SmbAccumulatedPrecipitationEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedRain")==0) return SmbAccumulatedRainEnum;
+-	      else if (strcmp(name,"SmbAccumulatedRefreeze")==0) return SmbAccumulatedRefreezeEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SmbAccumulatedRefreeze")==0) return SmbAccumulatedRefreezeEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedRunoff")==0) return SmbAccumulatedRunoffEnum;
+ 	      else if (strcmp(name,"SmbA")==0) return SmbAEnum;
+ 	      else if (strcmp(name,"SmbAdiff")==0) return SmbAdiffEnum;
+@@ -874,10 +884,7 @@
+ 	      else if (strcmp(name,"SmbAValue")==0) return SmbAValueEnum;
+ 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
+ 	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
++	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
+ 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+ 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+ 	      else if (strcmp(name,"SmbBNeg")==0) return SmbBNegEnum;
+@@ -977,10 +984,6 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousU")==0) return SealevelchangeViscousUEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+@@ -994,12 +997,12 @@
+ 	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+ 	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
+ 	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
+-	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+-	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
++	      if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
++	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
++	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+ 	      else if (strcmp(name,"SurfaceAbsMisfit")==0) return SurfaceAbsMisfitEnum;
+ 	      else if (strcmp(name,"SurfaceAbsVelMisfit")==0) return SurfaceAbsVelMisfitEnum;
+ 	      else if (strcmp(name,"Area")==0) return AreaEnum;
+@@ -1117,12 +1120,12 @@
+ 	      else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum;
+ 	      else if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
+ 	      else if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
+-	      else if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
+-	      else if (strcmp(name,"Outputdefinition63")==0) return Outputdefinition63Enum;
+          else stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
++	      if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
++	      else if (strcmp(name,"Outputdefinition63")==0) return Outputdefinition63Enum;
++	      else if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
+ 	      else if (strcmp(name,"Outputdefinition65")==0) return Outputdefinition65Enum;
+ 	      else if (strcmp(name,"Outputdefinition66")==0) return Outputdefinition66Enum;
+ 	      else if (strcmp(name,"Outputdefinition67")==0) return Outputdefinition67Enum;
+@@ -1240,12 +1243,12 @@
+ 	      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 stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"Element")==0) return ElementEnum;
++	      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;
+@@ -1363,12 +1366,12 @@
+ 	      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,"Mathydro")==0) return MathydroEnum;
+          else stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
++	      if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
++	      else if (strcmp(name,"Mathydro")==0) return MathydroEnum;
++	      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;
+@@ -1464,6 +1467,7 @@
+ 	      else if (strcmp(name,"SealevelInertiaTensorXZ")==0) return SealevelInertiaTensorXZEnum;
+ 	      else if (strcmp(name,"SealevelInertiaTensorYZ")==0) return SealevelInertiaTensorYZEnum;
+ 	      else if (strcmp(name,"SealevelInertiaTensorZZ")==0) return SealevelInertiaTensorZZEnum;
++	      else if (strcmp(name,"SealevelchangePolarMotion")==0) return SealevelchangePolarMotionEnum;
+ 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
+ 	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
+ 	      else if (strcmp(name,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
+@@ -1485,13 +1489,13 @@
+ 	      else if (strcmp(name,"StatisticsSolution")==0) return StatisticsSolutionEnum;
+ 	      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;
+-	      else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
+          else stage=13;
+    }
+    if(stage==13){
+-	      if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
++	      if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
++	      else if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
++	      else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
++	      else if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
+ 	      else if (strcmp(name,"StressbalanceVerticalAnalysis")==0) return StressbalanceVerticalAnalysisEnum;
+ 	      else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
+ 	      else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26445-26446.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26445-26446.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26445-26446.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 26445)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 26446)
+@@ -26,11 +26,11 @@
+         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.augmented_lagrangian_r = 1
++        self.augmented_lagrangian_rhop = 1
++        self.augmented_lagrangian_rlambda = 1
++        self.augmented_lagrangian_rholambda = 1
++        self.XTH_theta = 0
+         self.vertex_equation = np.nan
+         self.element_equation = np.nan
+         self.borderSSA = np.nan
+@@ -106,8 +106,11 @@
+         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])
++            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [1, 2, 4])
++            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [1, 2, 4])
++        elif m.strcmp(md.mesh.domaintype(), '3Dsurface'):
++            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', np.arange(1, 2 + 1))
++            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(1, 2 + 1))
+         elif m.strcmp(md.mesh.domaintype(), '2Dvertical'):
+             md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [2, 5, 6])
+             md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [2, 5, 6])
+@@ -116,6 +119,7 @@
+             md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(0, 9 + 1))
+         else:
+             raise RuntimeError('Case not supported yet')
++
+         if not (self.isSIA or self.isSSA or self.isL1L2 or self.isMLHO or self.isHO or self.isFS):
+             md.checkmessage("no element types set for this model")
+         if 'StressbalanceSIAAnalysis' in analyses:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26446-26447.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26446-26447.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26446-26447.diff	(revision 26740)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic
+===================================================================
+--- ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26446)
++++ ../trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic	(revision 26447)
+@@ -63,9 +63,9 @@
+ # See documentation in test/NightlyRun/runme.* for more information
+ #
+ # NOTE:
+-# - test125 and test126 are skipped because restart is not yet implemented for 
+-#   Windows (under MSYS2)
++# - Tests 125, 126, and 129 are skipped because restart is not yet implemented 
++#	for Windows (under MSYS2)
+ # - test701 is skipped because it uses full Stokes equations
+ #
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126,435,701,702,703]"
++MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),125,126,129,435,701,702,703]"
+ PYTHON_NROPTIONS=""
Index: /issm/oecreview/Archive/25834-26739/ISSM-26447-26448.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26447-26448.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26447-26448.diff	(revision 26740)
@@ -0,0 +1,115 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26447)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26448)
+@@ -515,9 +515,8 @@
+ 			delete gauss;
+ 		}
+ 	}
++   else if(calvinglaw==CalvingHabEnum){
+ 
+-	if(calvinglaw==CalvingHabEnum){
+-
+ 		/*Get the fraction of the flotation thickness at the terminus*/
+ 		InputDuplicatex(femmodel,MaskIceLevelsetEnum,DistanceToCalvingfrontEnum);
+ 		femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum);
+@@ -558,11 +557,9 @@
+ 			delete gauss;
+ 		}
+ 	}
++   else if(calvinglaw==CalvingCrevasseDepthEnum){
+ 
+-	if(calvinglaw==CalvingCrevasseDepthEnum){
+-
+-		int                 nflipped,local_nflipped;
+-		Vector<IssmDouble>* vec_constraint_nodes = NULL;
++		int   nflipped,local_nflipped;
+ 		IssmDouble* constraint_nodes = NULL;
+ 
+ 		/*Get the DistanceToCalvingfront*/
+@@ -570,17 +567,20 @@
+ 		femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum);
+ 
+ 		/*Vector of size number of nodes*/
+-		vec_constraint_nodes=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes());
++      int numnodes      = femmodel->nodes->NumberOfNodes();
++      int localmasters  = femmodel->nodes->NumberOfNodesLocal();
++      Vector<IssmDouble>* vec_constraint_nodes = vec_constraint_nodes=new Vector<IssmDouble>(localmasters,numnodes);
+ 
+ 		for(Object* & object : femmodel->elements->objects){
+-			Element* element               = xDynamicCast<Element*>(object);
+-			int      numnodes              = element->GetNumberOfNodes();
+-			Gauss*   gauss                 = element->NewGauss();
+-			Input*   crevassedepth_input   = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
+-			Input*   bed_input             = element->GetInput(BedEnum); _assert_(bed_input);
++			Element* element   = xDynamicCast<Element*>(object);
++			int      numnodes  = element->GetNumberOfNodes();
++			Gauss*   gauss     = element->NewGauss();
++
++			Input*   crevassedepth_input    = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
++			Input*   bed_input              = element->GetInput(BedEnum); _assert_(bed_input);
+ 			Input*   surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
+-			Input*   thickness_input       = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+-			Input*   surface_input         = element->GetInput(SurfaceEnum); _assert_(surface_input);
++			Input*   thickness_input        = element->GetInput(ThicknessEnum); _assert_(thickness_input);
++			Input*   surface_input          = element->GetInput(SurfaceEnum); _assert_(surface_input);
+ 
+ 			/*First, look at ice front and figure out if any of the nodes will be calved*/
+ 			if(element->IsIcefront()){
+@@ -605,15 +605,16 @@
+ 
+ 		/*Assemble vector and serialize: */
+ 		vec_constraint_nodes->Assemble();
+-		constraint_nodes=vec_constraint_nodes->ToMPISerial();
++      femmodel->GetLocalVectorWithClonesNodes(&constraint_nodes,vec_constraint_nodes);
+ 
+ 		nflipped=1;
+ 		while(nflipped){
+ 			local_nflipped=0;
+ 			for(Object* & object : femmodel->elements->objects){
+-				Element* element                = xDynamicCast<Element*>(object);
+-				int      numnodes               = element->GetNumberOfNodes();
+-				Gauss*   gauss                  = element->NewGauss();
++				Element* element  = xDynamicCast<Element*>(object);
++				int      numnodes = element->GetNumberOfNodes();
++				Gauss*   gauss    = element->NewGauss();
++
+ 				Input*   levelset_input         = element->GetInput(DistanceToCalvingfrontEnum); _assert_(levelset_input);
+ 				Input*   crevassedepth_input    = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
+ 				Input*   bed_input              = element->GetInput(BedEnum); _assert_(bed_input);
+@@ -625,7 +626,7 @@
+ 				bool isconnected = false;
+ 				for(int in=0;in<numnodes;in++){
+ 					Node* node=element->GetNode(in);
+-					if(constraint_nodes[node->Pid()]==1.){
++					if(constraint_nodes[node->Lid()]==1.){
+ 						isconnected = true;
+ 						break;
+ 					}
+@@ -643,7 +644,7 @@
+ 						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->Pid()]==0.){
++						if((surface_crevasse-surface>0. || crevassedepth-thickness>0.) && bed<0. && levelset>-300. && levelset<0. && constraint_nodes[node->Lid()]==0.){
+ 							local_nflipped++;
+ 							vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
+ 						}
+@@ -658,7 +659,7 @@
+ 			/*Assemble and serialize flag vector*/
+ 			vec_constraint_nodes->Assemble();
+ 			xDelete<IssmDouble>(constraint_nodes);
+-			constraint_nodes=vec_constraint_nodes->ToMPISerial();
++         femmodel->GetLocalVectorWithClonesNodes(&constraint_nodes,vec_constraint_nodes);
+ 		}
+ 		/*Free ressources:*/
+ 		delete vec_constraint_nodes;
+@@ -674,7 +675,7 @@
+ 				Node* node=element->GetNode(in);
+ 				if(!node->IsActive()) continue;
+ 
+-				if(constraint_nodes[node->Pid()]>0.){
++				if(constraint_nodes[node->Lid()]>0.){
+ 					node->ApplyConstraint(0,+1.);
+ 				}
+ 				else {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26448-26449.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26448-26449.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26448-26449.diff	(revision 26740)
@@ -0,0 +1,227 @@
+Index: ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(nonexistent)
++++ ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26449)
+@@ -0,0 +1,222 @@
++#include "SHELFICE_OPTIONS.h"
++#ifdef ALLOW_STREAMICE
++# include "STREAMICE_OPTIONS.h"
++#endif
++
++C--   File shelfice_step_icemass.F:
++C--    Contents:
++C--    o SHELFICE_STEP_ICEMASS
++C--    o SHELFICE_NETMASSFLUX_SURF
++
++C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
++CBOP
++C !ROUTINE: SHELFICE_STEP_ICEMASS
++
++C !INTERFACE: ==========================================================
++      SUBROUTINE SHELFICE_STEP_ICEMASS(
++     I                        myTime, myIter, myThid )
++
++C !DESCRIPTION:
++C Serves as a "stub" for ice dynamics
++C will later be used to
++
++C !USES: ===============================================================
++      IMPLICIT NONE
++#include "SIZE.h"
++#include "EEPARAMS.h"
++#include "PARAMS.h"
++#include "GRID.h"
++#include "SHELFICE.h"
++#ifdef ALLOW_STREAMICE
++# include "STREAMICE.h"
++#endif
++
++C     !INPUT/OUTPUT PARAMETERS:
++C     myTime      :: current time in simulation
++C     myIter      :: current iteration number insimulation
++C     myThid      :: my thread Id number
++      _RL  myTime
++      INTEGER myIter
++      INTEGER myThid
++CEOP
++
++#ifdef ALLOW_SHELFICE
++C !LOCAL VARIABLES : ====================================================
++C     i,j, bi,bj  :: loop indices
++      INTEGER bi,bj,i,j
++
++      IF ( SHELFICEMassStepping ) THEN
++
++       IF (useStreamIce) THEN
++
++#ifdef ALLOW_STREAMICE
++        DO bj = myByLo(myThid), myByHi(myThid)
++         DO bi = myBxLo(myThid), myBxHi(myThid)
++          DO j=1-OLy,sNy+OLy-1
++           DO i=1-OLx+1,sNx+OLx-1
++            IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
++     &           streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
++             shelficeMass(i,j,bi,bj) =
++     &        H_streamice(i,j,bi,bj) * streamice_density
++            ENDIF
++           ENDDO
++          ENDDO
++         ENDDO
++        ENDDO
++#endif /* ALLOW_STREAMICE */
++
++       ELSE
++
++        DO bj = myByLo(myThid), myByHi(myThid)
++         DO bi = myBxLo(myThid), myBxHi(myThid)
++
++           IF ( .NOT.SHELFICEDynMassOnly ) THEN
++            DO j=1-OLy,sNy+OLy
++             DO i=1-OLx,sNx+OLx
++              shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
++     &              + shelfIceFreshWaterFlux(i,j,bi,bj)*deltaT
++             ENDDO
++            ENDDO
++           ENDIF
++
++           DO j=1-OLy,sNy+OLy
++            DO i=1-OLx,sNx+OLx
++              shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
++     &              + shelfIceMassDynTendency(i,j,bi,bj)*deltaT
++            ENDDO
++           ENDDO
++
++C--    quick fix to prevent ice-shelf mass to become negative
++           DO j=1-OLy,sNy+OLy
++            DO i=1-OLx,sNx+OLx
++              shelficeMass(i,j,bi,bj) =
++     &              MAX( shelficeMass(i,j,bi,bj), zeroRL )
++            ENDDO
++           ENDDO
++
++         ENDDO
++        ENDDO
++       ENDIF
++
++       _EXCH_XY_RL( shelficeMass, myThid )
++
++      ENDIF
++
++#ifdef ALLOW_DIAGNOSTICS
++      IF (useDiagnostics) THEN
++        CALL DIAGNOSTICS_FILL( shelficeMass, 'SHI_mass',
++     I                         0, 1, 0, 1, 1, myThid )
++      ENDIF
++#endif /* ALLOW_DIAGNOSTICS */
++#endif /* ALLOW_SHELFICE */
++
++      RETURN
++      END
++
++C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
++CBOP
++C !ROUTINE: SHELFICE_NETMASSFLUX_SURF
++
++C !INTERFACE: ==========================================================
++      SUBROUTINE SHELFICE_NETMASSFLUX_SURF(
++     O                        shelfIceNetMassFlux,
++     I                        myTime, myIter, myThid )
++
++C !DESCRIPTION:
++C compute the net mass flux implied by S/R SHELFICE_STEP_MASS
++
++C !USES: ===============================================================
++      IMPLICIT NONE
++#include "SIZE.h"
++#include "EEPARAMS.h"
++#include "PARAMS.h"
++#include "GRID.h"
++#include "SHELFICE.h"
++#ifdef ALLOW_STREAMICE
++# include "STREAMICE.h"
++#endif
++#include "DYNVARS.h"
++
++C     !INPUT/OUTPUT PARAMETERS:
++C     myTime      :: current time in simulation
++C     myIter      :: current iteration number insimulation
++C     myThid      :: my thread Id number
++      _RL  myTime
++      INTEGER myIter
++      INTEGER myThid
++C     net mass flux in m^3/s
++      _RL shelfIceNetMassFlux
++CEOP
++
++#ifdef ALLOW_SHELFICE
++C !LOCAL VARIABLES : ====================================================
++C     i,j, bi,bj  :: loop indices
++      INTEGER bi,bj,i,j
++      _RL shelfIceNetMassFluxTile(nSx,nSy)
++
++      shelfIceNetMassFlux = 0. _d 0
++
++      IF ( SHELFICEMassStepping ) THEN
++
++       IF (useStreamIce) THEN
++
++#ifdef ALLOW_STREAMICE
++        DO bj = myByLo(myThid), myByHi(myThid)
++         DO bi = myBxLo(myThid), myBxHi(myThid)
++          shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
++          DO j=1,sNy
++           DO i=1,sNx
++            IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
++     &           streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
++C--   this assumes that the change in H_streamice include the melting flux
++CML             shelfIceNetMassFluxTile(bi,bj) =
++CML     &              shelfIceNetMassFluxTile(bi,bj)
++CML     &            +(H_streamice(i,j,bi,bj)-H_streamice_prev(i,j,bi,bj))
++CML     &            /deltaT * streamice_density * mass2rUnit
++CML     &            * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
++            ENDIF
++           ENDDO
++          ENDDO
++         ENDDO
++        ENDDO
++#endif /* ALLOW_STREAMICE */
++
++       ELSE
++
++        DO bj = myByLo(myThid), myByHi(myThid)
++         DO bi = myBxLo(myThid), myBxHi(myThid)
++          shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
++          DO j=1,sNy
++           DO i=1,sNx
++C--   Flux of new ice will raise the sea level
++            shelfIceNetMassFluxTile(bi,bj) =
++     &             shelfIceNetMassFluxTile(bi,bj)
++     &           + shelfIceMassDynTendency(i,j,bi,bj)
++     &           * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
++            IF ( .NOT.SHELFICEDynMassOnly ) THEN
++C--   Freshwater flux by thermodynamic processes. In the case of
++C     melting this will be negative (positive upward) so it will reduce
++C     the amount of added ice mass. The same freshwater flux is added
++C     to the ocean in EmPmR and will raise the sea level, so that this
++C     contribution is canceled.
++             shelfIceNetMassFluxTile(bi,bj) =
++     &              shelfIceNetMassFluxTile(bi,bj)
++     &            + shelfIceFreshWaterFlux(i,j,bi,bj)
++     &            * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
++            ENDIF
++           ENDDO
++          ENDDO
++         ENDDO
++        ENDDO
++
++       ENDIF
++
++       CALL GLOBAL_SUM_TILE_RL( shelficeNetMassFluxTile,
++     &      shelficeNetMassFlux, myThid )
++
++      ENDIF
++
++#endif /* ALLOW_SHELFICE */
++
++      RETURN
++      END
Index: /issm/oecreview/Archive/25834-26739/ISSM-26449-26450.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26449-26450.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26449-26450.diff	(revision 26740)
@@ -0,0 +1,131 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26449)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26450)
+@@ -124,6 +124,7 @@
+ 			break;
+ 		case CalvingCrevasseDepthEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.calving.crevasse_opening_stress",CalvingCrevasseDepthEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.calving.crevasse_threshold",CalvingCrevasseThresholdEnum));
+ 			break;
+ 		case CalvingDev2Enum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.calving.height_above_floatation",CalvingHeightAboveFloatationEnum));
+@@ -471,19 +472,14 @@
+ void           LevelsetAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 
+ 	/*Intermediaries*/
+-	int         calvinglaw;
+-	IssmDouble  min_thickness,thickness,hab_fraction;
+-	IssmDouble	crevassedepth,surface_crevasse,surface,critical_fraction;
+-	IssmDouble  rho_ice,rho_water;
+-	IssmDouble  bed,water_depth;
+-	IssmDouble  levelset,sealevel;
+-
++	int  calvinglaw;
+ 	femmodel->parameters->FindParam(&calvinglaw,CalvingLawEnum);
+ 
+ 	if(calvinglaw==CalvingMinthicknessEnum || calvinglaw==CalvingVonmisesEnum){
+ 
+-		/*Get minimum thickness threshold*/
+-		femmodel->parameters->FindParam(&min_thickness,CalvingMinthicknessEnum);
++		/*Intermediaries*/
++		IssmDouble thickness,bed,sealevel;
++		IssmDouble min_thickness = femmodel->parameters->FindParam(CalvingMinthicknessEnum);
+ 
+ 		/*Loop over all elements of this partition*/
+ 		for(Object* & object : femmodel->elements->objects){
+@@ -517,6 +513,9 @@
+ 	}
+    else if(calvinglaw==CalvingHabEnum){
+ 
++		/*Intermediaries*/
++		IssmDouble  thickness,water_depth,levelset,hab_fraction;
++
+ 		/*Get the fraction of the flotation thickness at the terminus*/
+ 		InputDuplicatex(femmodel,MaskIceLevelsetEnum,DistanceToCalvingfrontEnum);
+ 		femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum);
+@@ -525,8 +524,8 @@
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element  = xDynamicCast<Element*>(object);
+ 
+-			rho_ice = element->FindParam(MaterialsRhoIceEnum);
+-			rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
++			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
++			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+ 
+ 			int      numnodes           = element->GetNumberOfNodes();
+ 			Gauss*   gauss              = element->NewGauss();
+@@ -559,7 +558,9 @@
+ 	}
+    else if(calvinglaw==CalvingCrevasseDepthEnum){
+ 
+-		int   nflipped,local_nflipped;
++		/*Intermediaries*/
++		IssmDouble  levelset,crevassedepth,bed,surface_crevasse,thickness,surface;
++		int         nflipped,local_nflipped;
+ 		IssmDouble* constraint_nodes = NULL;
+ 
+ 		/*Get the DistanceToCalvingfront*/
+@@ -571,6 +572,8 @@
+       int localmasters  = femmodel->nodes->NumberOfNodesLocal();
+       Vector<IssmDouble>* vec_constraint_nodes = vec_constraint_nodes=new Vector<IssmDouble>(localmasters,numnodes);
+ 
++      IssmDouble crevasse_threshold = femmodel->parameters->FindParam(CalvingCrevasseThresholdEnum);
++
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element   = xDynamicCast<Element*>(object);
+ 			int      numnodes  = element->GetNumberOfNodes();
+@@ -595,7 +598,7 @@
+ 					thickness_input->GetInputValue(&thickness,gauss);
+ 					surface_input->GetInputValue(&surface,gauss);
+ 
+-					if((surface_crevasse-surface>0. || crevassedepth-thickness>0.) && bed<0.){
++					if((surface_crevasse>surface || crevassedepth>crevasse_threshold*thickness) && bed<0.){
+ 						vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
+ 					}
+ 				}
+@@ -615,12 +618,12 @@
+ 				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);
++				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*/
+ 				bool isconnected = false;
+@@ -644,7 +647,7 @@
+ 						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->Lid()]==0.){
++                  if((surface_crevasse>surface || crevassedepth>crevasse_threshold*thickness) && bed<0. && levelset>-300. && levelset<0. && constraint_nodes[node->Lid()]==0.){
+ 							local_nflipped++;
+ 							vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
+ 						}
+@@ -654,7 +657,7 @@
+ 
+ 			/*Count how many new nodes were found*/
+ 			ISSM_MPI_Allreduce(&local_nflipped,&nflipped,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
+-			//_printf0_("Found "<<nflipped<<" to flip\n");
++			_printf0_("Found "<<nflipped<<" to flip\n");
+ 
+ 			/*Assemble and serialize flag vector*/
+ 			vec_constraint_nodes->Assemble();
+@@ -661,6 +664,7 @@
+ 			xDelete<IssmDouble>(constraint_nodes);
+          femmodel->GetLocalVectorWithClonesNodes(&constraint_nodes,vec_constraint_nodes);
+ 		}
++
+ 		/*Free ressources:*/
+ 		delete vec_constraint_nodes;
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26450-26451.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26450-26451.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26450-26451.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/calvingcrevassedepth.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/calvingcrevassedepth.m	(revision 26450)
++++ ../trunk-jpl/src/m/classes/calvingcrevassedepth.m	(revision 26451)
+@@ -41,7 +41,7 @@
+ 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+ 
+ 			md = checkfield(md,'fieldname','calving.crevasse_opening_stress','numel',[1],'values',[0,1]);
+-         md = checkfield(md,'fieldname','calving.crevasse_threshold','numel',[1],'values',[0,1]);
++         md = checkfield(md,'fieldname','calving.crevasse_threshold','numel',[1],'>',0,'<=',1);
+ 			md = checkfield(md,'fieldname','calving.water_height','NaN',1,'Inf',1,'timeseries',1,'>=',0);
+ 		end % }}}
+ 		function disp(self) % {{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26451-26452.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26451-26452.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26451-26452.diff	(revision 26740)
@@ -0,0 +1,123 @@
+Index: ../trunk-jpl/test/MITgcm/code_4003/SHELFICE_OPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/SHELFICE_OPTIONS.h	(revision 26451)
++++ ../trunk-jpl/test/MITgcm/code_4003/SHELFICE_OPTIONS.h	(revision 26452)
+@@ -15,18 +15,17 @@
+ C     Package-specific Options & Macros go here
+ 
+ C     allow code for simple ISOMIP thermodynamics
+-!#define ALLOW_ISOMIP_TD
++#undef ALLOW_ISOMIP_TD
+ 
+ C     allow friction velocity-dependent transfer coefficient
+ C     following Holland and Jenkins, JPO, 1999
+ #define SHI_ALLOW_GAMMAFRICT
+-C     in uStar expression, use wet-point method to average velocity
+-C     at grid-cell center
+-!#define SHI_USTAR_WETPOINT
+ 
++C     allow (vertical) remeshing whenever ocean top thickness factor
++C     exceeds thresholds
+ #define ALLOW_SHELFICE_REMESHING
+-#define SHI_USTAR_TOPDR
+-#undef ALLOW_SHELFICE_GROUNDED_ICE
++C     and allow to print message to STDOUT when this happens
++#define SHELFICE_REMESH_PRINT
+ 
+ #endif /* ALLOW_SHELFICE */
+ #endif /* SHELFICE_OPTIONS_H */
+Index: ../trunk-jpl/test/MITgcm/code_4003/packages.conf
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/packages.conf	(revision 26451)
++++ ../trunk-jpl/test/MITgcm/code_4003/packages.conf	(revision 26452)
+@@ -1,5 +1,4 @@
+ gfd
+ shelfice
+-streamice
+ obcs
+ diagnostics
+Index: ../trunk-jpl/test/MITgcm/coupling_rules.txt
+===================================================================
+--- ../trunk-jpl/test/MITgcm/coupling_rules.txt	(revision 26451)
++++ ../trunk-jpl/test/MITgcm/coupling_rules.txt	(revision 26452)
+@@ -10,6 +10,8 @@
+ xC                     Nx*Ny       Real*8  10001005
+ yC                     Nx*Ny       Real*8  10001006
+ IceBase                Nx*Ny       Real*8  10001007
++    (in m, 0 is sea level, negative is below sea level, 9999 is no ice,
++     use density 917 kg/m^3)
+ OceanMelt              Nx*Ny       Real*8  10001008
+ 
+ >>>> INITIALIZATION FROM SCRATCH
+Index: ../trunk-jpl/test/MITgcm/input_4003/data.shelfice
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data.shelfice	(nonexistent)
++++ ../trunk-jpl/test/MITgcm/input_4003/data.shelfice	(revision 26452)
+@@ -0,0 +1,20 @@
++# ===================================
++# | Parameters for SHELFICE package |
++# ===================================
++ &SHELFICE_PARM01
++ SHELFICEconserve = .TRUE.,
++ SHELFICEuseGammaFrict = .TRUE.,
++ SHELFICEDragQuadratic = 0.0015,
++ shiCdrag = 0.0015,
++ SHELFICEselectDragQuadr= 2,
++ SHELFICEMassStepping = .TRUE.,
++#--
++ SHELFICEremeshFrequency = 600.0,
++#- need to satisfy: splitThrs > 1 + mergeThrs / Sdz
++#       with: Sdz = min{ delR(k+1)/delR(k) }_[k=1:Nr-1]
++ SHELFICEsplitThreshold = 1.12,
++ SHELFICEmergeThreshold = 0.10,
++#--
++ SHELFICEtopoFile='icetopo.bin',
++ SHELFICEwriteState = .TRUE.,
++ &
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26451)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26452)
+@@ -3,6 +3,7 @@
+ %
+ %Script control parameters
+ steps=1:11;
++steps=1:5;
+ final_time=1/365;
+ 
+ %To download and recompile MITgcm from scratch:
+Index: ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26451)
++++ ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26452)
+@@ -44,6 +44,8 @@
+ C !LOCAL VARIABLES : ====================================================
+ C     i,j, bi,bj  :: loop indices
+       INTEGER bi,bj,i,j
++      _RL  issm_density
++      issm_density = 917.
+ 
+       IF ( SHELFICEMassStepping ) THEN
+ 
+@@ -65,6 +67,21 @@
+         ENDDO
+ #endif /* ALLOW_STREAMICE */
+ 
++       ELSEIF (useCoupler)
++
++#ifdef ALLOW_CPL_ISSM
++        DO bj = myByLo(myThid), myByHi(myThid)
++         DO bi = myBxLo(myThid), myBxHi(myThid)
++          DO j=1-OLy,sNy+OLy-1
++           DO i=1-OLx+1,sNx+OLx-1
++             shelficeMass(i,j,bi,bj) =
++     &        R_shelfIce(i,j,bi,bj) * issm_density
++           ENDDO
++          ENDDO
++         ENDDO
++        ENDDO
++#endif /* ALLOW_CPL_ISSM */
++
+        ELSE
+ 
+         DO bj = myByLo(myThid), myByHi(myThid)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26452-26453.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26452-26453.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26452-26453.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26452)
++++ ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26453)
+@@ -67,7 +67,7 @@
+         ENDDO
+ #endif /* ALLOW_STREAMICE */
+ 
+-       ELSEIF (useCoupler)
++       ELSEIF (useCoupler) THEN
+ 
+ #ifdef ALLOW_CPL_ISSM
+         DO bj = myByLo(myThid), myByHi(myThid)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26453-26454.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26453-26454.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26453-26454.diff	(revision 26740)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/test/NightlyRun/test4002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4002.m	(revision 26453)
++++ ../trunk-jpl/test/NightlyRun/test4002.m	(revision 26454)
+@@ -547,7 +547,7 @@
+     %timestepping:
+     md.timestepping.final_time=final_time;
+     md.timestepping.time_step=time_step;
+-    md.transient.isgroundingline=1;
++    md.transient.isgroundingline=0;
+     md.transient.isthermal=0;
+     md.groundingline.migration='SubelementMigration';
+     md.groundingline.melt_interpolation='SubelementMelt2';
+@@ -659,7 +659,7 @@
+     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.isgroundingline=0;
+     md.transient.isthermal=0;
+     md.groundingline.migration='SubelementMigration';
+     md.groundingline.melt_interpolation='SubelementMelt2';
+@@ -998,7 +998,7 @@
+         % }}}
+ 
+     md.transient.isoceancoupling=1;
+-    md.transient.isgroundingline=1;
++    md.transient.isgroundingline=0;
+     md.groundingline.migration='None';
+     md.groundingline.melt_interpolation='SubelementMelt2';
+     md.groundingline.friction_interpolation='SubelementFriction2';
Index: /issm/oecreview/Archive/25834-26739/ISSM-26454-26455.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26454-26455.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26454-26455.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/basalforcingsismip6.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcingsismip6.m	(revision 26454)
++++ ../trunk-jpl/src/m/classes/basalforcingsismip6.m	(revision 26455)
+@@ -58,7 +58,7 @@
+ 			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.delta_t','NaN',1,'Inf',1,'numel',md.basalforcings.num_basins,'size',[1,md.basalforcings.num_basins]);
+ 			md = checkfield(md,'fieldname','basalforcings.islocal','values',[0 1]);
+ 			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'>=',0,'timeseries',1);
+ 			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26455-26456.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26455-26456.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26455-26456.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/test/NightlyRun/test4002.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4002.m	(revision 26455)
++++ ../trunk-jpl/test/NightlyRun/test4002.m	(revision 26456)
+@@ -824,6 +824,7 @@
+ 
+         md.timestepping.start_time=t;
+         md.timestepping.final_time=t+time_step;;
++		  md.transient.requested_outputs={'default','MaskOceanLevelset'};
+         md=solve(md,'Transient');
+ 
+         base=md.results.TransientSolution(end).Base;
+@@ -1003,8 +1004,9 @@
+     md.groundingline.melt_interpolation='SubelementMelt2';
+     md.groundingline.friction_interpolation='SubelementFriction2';
+     md.timestepping.coupling_time=time_step;
+-   md.timestepping.time_step=time_step;
++    md.timestepping.time_step=time_step;
+     md.timestepping.final_time=final_time-time_step;
++	 md.transient.requested_outputs={'default','MaskOceanLevelset'};
+     md.cluster.npocean=nPx*nPy;
+     md.cluster.np=2;
+     md.cluster.executionpath=[pwd '/run'];
Index: /issm/oecreview/Archive/25834-26739/ISSM-26456-26457.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26456-26457.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26456-26457.diff	(revision 26740)
@@ -0,0 +1,360 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 26456)
++++ ../trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp	(revision 26457)
+@@ -60,14 +60,26 @@
+ 
+ 	/*Retrieve all inputs we will be needing: */
+ 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
+-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
++	Input* vx_input     = NULL;
++	Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);	_assert_(vxobs_input);
+ 	Input* vy_input     = NULL;
+ 	Input* vyobs_input  = NULL;
+-	if(numcomponents==2){
+-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
+-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
++
++	/*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
++	if (domaintype == Domain2DhorizontalEnum) {
++		vx_input = topelement->GetInput(VxSurfaceEnum);					_assert_(vx_input);
++		if(numcomponents==2){
++			vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
++			vyobs_input =topelement->GetInput(InversionVyObsEnum);	_assert_(vyobs_input);
++		}
+ 	}
++	else {
++		vx_input = topelement->GetInput(VxEnum);							_assert_(vx_input);
++		if(numcomponents==2){
++			vy_input    =topelement->GetInput(VyEnum);					_assert_(vy_input);
++			vyobs_input =topelement->GetInput(InversionVyObsEnum);	_assert_(vyobs_input);
++		}
++	}
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=topelement->NewGauss(2);
+Index: ../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 26456)
++++ ../trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp	(revision 26457)
+@@ -68,14 +68,26 @@
+ 	/*Retrieve all inputs we will be needing: */
+ 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+ 	Input* S_input      = topelement->GetInput(SurfaceAreaEnum);     _assert_(S_input);
+-	Input* vx_input     = topelement->GetInput(VxEnum);              _assert_(vx_input);
+-	Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);  _assert_(vxobs_input);
+-	Input* vy_input     = NULL;
+-	Input* vyobs_input  = NULL;
+-	if(numcomponents==2){
+-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
+-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
++   Input* vx_input     = NULL;
++   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum); _assert_(vxobs_input);
++   Input* vy_input     = NULL;
++   Input* vyobs_input  = NULL;
++
++   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
++   if (domaintype == Domain2DhorizontalEnum) {
++      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
+ 	}
++   else {
++      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
++   }
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=topelement->NewGauss(3);
+Index: ../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 26456)
++++ ../trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp	(revision 26457)
+@@ -62,14 +62,26 @@
+ 
+ 	/*Retrieve all inputs we will be needing: */
+ 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
+-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
+-	Input* vy_input     = NULL;
+-	Input* vyobs_input  = NULL;
+-	if(numcomponents==2){
+-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
+-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
++   Input* vx_input     = NULL;
++   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);   _assert_(vxobs_input);
++   Input* vy_input     = NULL;
++   Input* vyobs_input  = NULL;
++
++   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
++   if (domaintype == Domain2DhorizontalEnum) {
++      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
+ 	}
++   else {
++      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
++   }
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=topelement->NewGauss(4);
+Index: ../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 26456)
++++ ../trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp	(revision 26457)
+@@ -62,14 +62,26 @@
+ 
+ 	/*Retrieve all inputs we will be needing: */
+ 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
+-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
+-	Input* vy_input     = NULL;
+-	Input* vyobs_input  = NULL;
+-	if(numcomponents==2){
+-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
+-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
++   Input* vx_input     = NULL;
++   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);   _assert_(vxobs_input);
++   Input* vy_input     = NULL;
++   Input* vyobs_input  = NULL;
++
++   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
++   if (domaintype == Domain2DhorizontalEnum) {
++      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
+ 	}
++   else {
++      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
++   }
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=topelement->NewGauss(4);
+Index: ../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 26456)
++++ ../trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp	(revision 26457)
+@@ -62,14 +62,26 @@
+ 
+ 	/*Retrieve all inputs we will be needing: */
+ 	DatasetInput* weights_input=topelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-	Input* vx_input     =topelement->GetInput(VxEnum);                                 _assert_(vx_input);
+-	Input* vxobs_input  =topelement->GetInput(InversionVxObsEnum);                     _assert_(vxobs_input);
+-	Input* vy_input     = NULL;
+-	Input* vyobs_input  = NULL;
+-	if(numcomponents==2){
+-		vy_input    =topelement->GetInput(VyEnum);              _assert_(vy_input);
+-		vyobs_input =topelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
++   Input* vx_input     = NULL;
++   Input* vxobs_input  = topelement->GetInput(InversionVxObsEnum);   _assert_(vxobs_input);
++   Input* vy_input     = NULL;
++   Input* vyobs_input  = NULL;
++
++   /*Read SurfaceEnum from 2D models:SSA, L1L2, MLHO*/
++   if (domaintype == Domain2DhorizontalEnum) {
++      vx_input = topelement->GetInput(VxSurfaceEnum);             _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VySurfaceEnum);        _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
+ 	}
++   else {
++      vx_input = topelement->GetInput(VxEnum);                    _assert_(vx_input);
++      if(numcomponents==2){
++         vy_input    =topelement->GetInput(VyEnum);               _assert_(vy_input);
++         vyobs_input =topelement->GetInput(InversionVyObsEnum);   _assert_(vyobs_input);
++      }
++   }
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=topelement->NewGauss(4);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26456)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26457)
+@@ -791,8 +791,12 @@
+ 		/*itapopo FIXME applying the same initialization for shear vx and shear vy for now*/
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxShearEnum,0.);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyShearEnum,0.);
++	}
++   if(iomodel->domaintype==Domain2DhorizontalEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum,0.);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxSurfaceEnum,0.);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VySurfaceEnum,0.);
+ 	}
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcex",LoadingforceXEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.stressbalance.loadingforcey",LoadingforceYEnum);
+@@ -2119,10 +2123,17 @@
+ 	}
+ 
+ 	/*Add vx and vy as inputs to the tria element: */
++	/*Also add surface vx and vy for the misfit, and base vx and vy for friction*/
+ 	element->AddBasalInput(VxEnum,vx,element->GetElementType());
+-	if(dim==2)element->AddBasalInput(VyEnum,vy,element->GetElementType());
++	element->AddBasalInput(VxSurfaceEnum,vx,element->GetElementType());
++	element->AddBasalInput(VxBaseEnum,vx,element->GetElementType());
++	if(dim==2) {
++		element->AddBasalInput(VyEnum,vy,element->GetElementType());
++		element->AddBasalInput(VySurfaceEnum,vy,element->GetElementType());
++		element->AddBasalInput(VyBaseEnum,vy,element->GetElementType());
++	}
+ 	element->AddBasalInput(VelEnum,vel,element->GetElementType());
+-
++	
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(vel);
+ 	xDelete<IssmDouble>(vz);
+@@ -2723,6 +2734,12 @@
+ 	element->AddBasalInput(VyEnum,vy,element->GetElementType());
+ 	element->AddBasalInput(VelEnum,vel,element->GetElementType());
+ 
++	/*Also add surface vx and vy for the misfit, and base vx and vy for friction*/
++	element->AddBasalInput(VxSurfaceEnum,vx,element->GetElementType());
++	element->AddBasalInput(VySurfaceEnum,vy,element->GetElementType());
++	element->AddBasalInput(VxBaseEnum,vx,element->GetElementType());
++	element->AddBasalInput(VyBaseEnum,vy,element->GetElementType());
++
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(vel);
+ 	xDelete<IssmDouble>(vz);
+@@ -2788,7 +2805,7 @@
+ 	Input* gllevelset_input = NULL;
+ 
+ 	/*build friction object, used later on: */
+-	Friction* friction=new Friction(element,dim,true);
++	Friction* friction=new Friction(element, dim);
+ 
+ 	/*Recover portion of element that is grounded*/
+ 	if(!(friction_style==SubelementFriction2Enum)) phi=element->GetGroundedPortion(xyz_list);
+@@ -3279,9 +3296,6 @@
+    for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+ 		vx[i]=vbx[i]+vshx[i]*(n[i]+1)/(n[i]+2);
+ 		vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2);
+-		// HOTFIX: set surface velocity to VxEnum and VyEnum
+-	//	vx[i]=vbx[i]+vshx[i];
+-	//	vy[i]=vby[i]+vshy[i];
+ 	}
+ 		
+ 	/*Get Vz and compute vel (vertically averaged vel)*/
+@@ -3473,7 +3487,8 @@
+ 	Input* gllevelset_input = NULL;
+ 
+ 	/*build friction object, used later on: */
+-	Friction* friction=new Friction(element,dim==3?2:1);
++	/*dim=4 is special for HO, which is actually 2.5D*/
++	Friction* friction=new Friction(element,dim==3?4:1);
+ 
+ 	/*Recover portion of element that is grounded*/
+ 	if(!(friction_style==SubelementFriction2Enum)) phi=element->GetGroundedPortion(xyz_list_base);
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26456)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26457)
+@@ -19,15 +19,12 @@
+ 	this->element=NULL;
+ 	this->dim=0;
+ 	this->law=0;
+-	this->isMLHO=false;
+-
+ }
+ /*}}}*/
+-Friction::Friction(Element* element_in,int dim_in,bool isMLHO_in){/*{{{*/
++Friction::Friction(Element* element_in,int dim_in){/*{{{*/
+ 
+ 	this->element=element_in;
+ 	this->dim=dim_in;
+-	this->isMLHO=isMLHO_in;
+ 	element_in->FindParam(&this->law,FrictionLawEnum);
+ }
+ /*}}}*/
+@@ -858,8 +855,6 @@
+ 	/*diverse*/
+ 	IssmDouble vx,vy,vz,vmag;
+ 	
+-	if(this->isMLHO) _assert_(dim==2);
+-
+ 	switch(dim){
+ 		case 1:
+ 			element->GetInputValue(&vx,gauss,VxEnum);
+@@ -866,14 +861,8 @@
+ 			vmag=sqrt(vx*vx);
+ 			break;
+ 		case 2:
+-			if(this->isMLHO){
+-				element->GetInputValue(&vx,gauss,VxBaseEnum);
+-				element->GetInputValue(&vy,gauss,VyBaseEnum);
+-			}
+-			else{
+-				element->GetInputValue(&vx,gauss,VxEnum);
+-				element->GetInputValue(&vy,gauss,VyEnum);
+-			}		
++			element->GetInputValue(&vx,gauss,VxBaseEnum);
++			element->GetInputValue(&vy,gauss,VyBaseEnum);
+ 			vmag=sqrt(vx*vx+vy*vy);
+ 			break;
+ 		case 3:
+@@ -882,6 +871,12 @@
+ 			element->GetInputValue(&vz,gauss,VzEnum);
+ 			vmag=sqrt(vx*vx+vy*vy+vz*vz);
+ 			break;
++		case 4:
++			/* This is for HO 3D case, since it requires the horizontal velocities */
++			element->GetInputValue(&vx,gauss,VxEnum);
++			element->GetInputValue(&vy,gauss,VyEnum);
++			vmag=sqrt(vx*vx+vy*vy);
++			break;
+ 		default:
+ 			_error_("not supported");
+ 	}
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26456)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26457)
+@@ -16,11 +16,10 @@
+ 		Element* element;
+ 		int      dim;
+ 		int      law;
+-		bool		isMLHO=false;
+ 
+ 		/*methods: */
+ 		Friction();
+-		Friction(Element* element_in,int dim_in,bool isMLHO=0);
++		Friction(Element* element_in,int dim_in);
+ 		~Friction();
+ 
+ 		void  Echo(void);
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26456)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26457)
+@@ -535,7 +535,11 @@
+ 	AdjointEnum,
+ 	AdjointpEnum,
+ 	AdjointxEnum,
++	AdjointxBaseEnum,
++	AdjointxShearEnum,
+ 	AdjointyEnum,
++	AdjointyBaseEnum,
++	AdjointyShearEnum,
+ 	AdjointzEnum,
+ 	AirEnum,
+ 	ApproximationEnum,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26457-26458.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26457-26458.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26457-26458.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26457)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26458)
+@@ -143,9 +143,16 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.hydrology.moulin_input",HydrologyMoulinInputEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",HydrologySheetThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.hydraulic_potential",HydraulicPotentialEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+-	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+-	iomodel->FindConstant(&frictionlaw,"md.friction.law");
++	if iomodel->domaintype==Domain2DhorizontalEnum){
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum);
++		iomodel->FindConstant(&frictionlaw,"md.friction.law");
++	}
++	else{
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
++		iomodel->FindConstant(&frictionlaw,"md.friction.law");
++	}
+ 
+ 	/*Friction law variables*/
+ 	switch(frictionlaw){
Index: /issm/oecreview/Archive/25834-26739/ISSM-26458-26459.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26458-26459.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26458-26459.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26458)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26459)
+@@ -143,7 +143,7 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.hydrology.moulin_input",HydrologyMoulinInputEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",HydrologySheetThicknessEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.hydraulic_potential",HydraulicPotentialEnum);
+-	if iomodel->domaintype==Domain2DhorizontalEnum){
++	if(iomodel->domaintype==Domain2DhorizontalEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum);
+ 		iomodel->FindConstant(&frictionlaw,"md.friction.law");
Index: /issm/oecreview/Archive/25834-26739/ISSM-26459-26460.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26459-26460.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26459-26460.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26459)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26460)
+@@ -359,8 +359,8 @@
+ 	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* vx_input     = element->GetInput(VxBaseEnum);_assert_(vx_input);
++	Input* vy_input     = element->GetInput(VyBaseEnum);_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);
+@@ -494,8 +494,8 @@
+ 	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* vx_input = element->GetInput(VxBaseEnum);_assert_(vx_input);
++	Input* vy_input = element->GetInput(VyBaseEnum);_assert_(vy_input);
+ 	Input* H_input  = element->GetInput(ThicknessEnum); _assert_(H_input);
+ 	Input* b_input  = element->GetInput(BedEnum); _assert_(b_input);
+ 	Input* hold_input  = element->GetInput(HydrologySheetThicknessOldEnum);_assert_(hold_input);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26460-26461.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26460-26461.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26460-26461.diff	(revision 26740)
@@ -0,0 +1,55 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26460)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26461)
+@@ -560,7 +560,6 @@
+ 
+ 		/*Intermediaries*/
+ 		IssmDouble  levelset,crevassedepth,bed,surface_crevasse,thickness,surface;
+-		int         nflipped,local_nflipped;
+ 		IssmDouble* constraint_nodes = NULL;
+ 
+ 		/*Get the DistanceToCalvingfront*/
+@@ -572,8 +571,11 @@
+       int localmasters  = femmodel->nodes->NumberOfNodesLocal();
+       Vector<IssmDouble>* vec_constraint_nodes = vec_constraint_nodes=new Vector<IssmDouble>(localmasters,numnodes);
+ 
+-      IssmDouble crevasse_threshold = femmodel->parameters->FindParam(CalvingCrevasseThresholdEnum);
++		IssmDouble crevasse_threshold = femmodel->parameters->FindParam(CalvingCrevasseThresholdEnum);
++		IssmDouble mig_max            = femmodel->parameters->FindParam(MigrationMaxEnum);
++		IssmDouble dt                 = femmodel->parameters->FindParam(TimesteppingTimeStepEnum);
+ 
++
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element   = xDynamicCast<Element*>(object);
+ 			int      numnodes  = element->GetNumberOfNodes();
+@@ -610,9 +612,9 @@
+ 		vec_constraint_nodes->Assemble();
+       femmodel->GetLocalVectorWithClonesNodes(&constraint_nodes,vec_constraint_nodes);
+ 
+-		nflipped=1;
++		int nflipped=1;
+ 		while(nflipped){
+-			local_nflipped=0;
++			int local_nflipped=0;
+ 			for(Object* & object : femmodel->elements->objects){
+ 				Element* element  = xDynamicCast<Element*>(object);
+ 				int      numnodes = element->GetNumberOfNodes();
+@@ -629,7 +631,7 @@
+ 				bool isconnected = false;
+ 				for(int in=0;in<numnodes;in++){
+ 					Node* node=element->GetNode(in);
+-					if(constraint_nodes[node->Lid()]==1.){
++					if(constraint_nodes[node->Lid()]>0.){
+ 						isconnected = true;
+ 						break;
+ 					}
+@@ -647,7 +649,7 @@
+ 						thickness_input->GetInputValue(&thickness,gauss);
+ 						surface_input->GetInputValue(&surface,gauss);
+ 
+-                  if((surface_crevasse>surface || crevassedepth>crevasse_threshold*thickness) && bed<0. && levelset>-300. && levelset<0. && constraint_nodes[node->Lid()]==0.){
++                  if((surface_crevasse>surface || crevassedepth>crevasse_threshold*thickness) && bed<0. && levelset<0. && levelset>-mig_max*dt && constraint_nodes[node->Lid()]==0.){
+ 							local_nflipped++;
+ 							vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
+ 						}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26461-26462.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26461-26462.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26461-26462.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive809.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26462-26463.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26462-26463.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26462-26463.diff	(revision 26740)
@@ -0,0 +1,359 @@
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26462)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 26463)
+@@ -408,12 +408,9 @@
+ 	Input* enthalpy_input       = element->GetInput(enthalpy_enum);                   _assert_(enthalpy_input);
+ 	Input* pressure_input       = element->GetInput(PressureEnum);                    _assert_(pressure_input);
+ 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
+-	Input* vx_input             = element->GetInput(VxEnum);                          _assert_(vx_input);
+-	Input* vy_input             = element->GetInput(VyEnum);                          _assert_(vy_input);
+-	Input* vz_input             = element->GetInput(VzEnum);                          _assert_(vz_input);
+ 
+ 	/*Build friction element, needed later: */
+-	Friction* friction=new Friction(element,dim);
++	Friction* friction=new Friction(element,3);
+ 
+ 	/******** MELTING RATES  ************************************//*{{{*/
+ 	element->NormalBase(&normal_base[0],xyz_list_base);
+@@ -469,7 +466,7 @@
+ 
+ 			/*basal friction*/
+ 			friction->GetAlpha2(&alpha2,gauss);
+-			vx_input->GetInputValue(&vx,gauss);		vy_input->GetInputValue(&vy,gauss);		vz_input->GetInputValue(&vz,gauss);
++			friction->GetBasalSlidingSpeeds(&vx, &vy, &vz, gauss);
+ 			basalfriction=alpha2*(vx*vx + vy*vy + vz*vz);
+ 			geothermalflux_input->GetInputValue(&geothermalflux,gauss);
+ 			/* -Mb= Fb-(q-q_geo)/((1-w)*L*rho), and (1-w)*rho=rho_ice, cf Aschwanden 2012, eqs.1, 2, 66*/
+@@ -946,9 +943,6 @@
+ 	element->GetInputValue(&converged,ConvergedEnum);
+ 	if(dt==0. && !converged) enthalpy_enum=EnthalpyPicardEnum; // use enthalpy from last iteration
+ 	else enthalpy_enum=EnthalpyEnum; // use enthalpy from last time step
+-	Input* vx_input             = element->GetInput(VxEnum);                          _assert_(vx_input);
+-	Input* vy_input             = element->GetInput(VyEnum);                          _assert_(vy_input);
+-	Input* vz_input             = element->GetInput(VzEnum);                          _assert_(vz_input);
+ 	Input* enthalpy_input		 = element->GetInput(enthalpy_enum);					 _assert_(enthalpy_input);
+ 	Input* pressure_input		 = element->GetInput(PressureEnum);							 _assert_(pressure_input);
+ 	Input* watercolumn_input	 = element->GetInput(WatercolumnEnum);							 _assert_(watercolumn_input);
+@@ -987,9 +981,7 @@
+ 				// although one node might have become temperate. So keep heat flux switched on.
+ 				geothermalflux_input->GetInputValue(&geothermalflux,gauss);
+ 				friction->GetAlpha2(&alpha2,gauss);
+-				vx_input->GetInputValue(&vx,gauss);
+-				vy_input->GetInputValue(&vy,gauss);
+-				vz_input->GetInputValue(&vz,gauss);
++				friction->GetBasalSlidingSpeeds(&vx, &vy, &vz, gauss);
+ 				basalfriction=alpha2*(vx*vx+vy*vy+vz*vz);
+ 				heatflux=(basalfriction+geothermalflux)/(rho_ice);
+ 				scalar=gauss->weight*Jdet*heatflux;
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26462)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26463)
+@@ -359,8 +359,6 @@
+ 	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(VxBaseEnum);_assert_(vx_input);
+-	Input* vy_input     = element->GetInput(VyBaseEnum);_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);
+@@ -382,8 +380,6 @@
+ 		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);
+@@ -394,6 +390,7 @@
+ 		H_input->GetInputValue(&H,gauss);
+ 
+ 		/*Get basal velocity*/
++		friction->GetBasalSlidingSpeeds(&vx, &vy ,gauss);
+ 		ub = sqrt(vx*vx + vy*vy);
+ 
+ 		/*Compute cavity opening w*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26462)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26463)
+@@ -118,6 +118,10 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.hydrology.neumannflux",HydrologyNeumannfluxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
++	if(iomodel->domaintype==Domain2DhorizontalEnum){
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum);
++		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum);
++	}
+ 	iomodel->FindConstant(&frictionlaw,"md.friction.law");
+ 
+ 	/*Friction law variables*/
+@@ -253,8 +257,6 @@
+ 	Input* B_input              = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+ 	Input* n_input              = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+ 	Input* englacial_input      = element->GetInput(HydrologyEnglacialInputEnum);    _assert_(englacial_input);
+-	Input* vx_input             = element->GetInput(VxEnum);                         _assert_(vx_input);
+-	Input* vy_input             = element->GetInput(VyEnum);                         _assert_(vy_input);
+ 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
+ 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
+    Input* headold_input        = element->GetInput(HydrologyHeadOldEnum);           _assert_(headold_input);
+@@ -286,8 +288,6 @@
+ 		englacial_input->GetInputValue(&ieb,gauss);
+ 		lr_input->GetInputValue(&lr,gauss);
+ 		br_input->GetInputValue(&br,gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+       headold_input->GetInputValue(&head_old,gauss);
+ 
+ 		/*Get ice A parameter*/
+@@ -303,8 +303,7 @@
+ 
+ 		/*Compute frictional heat flux*/
+ 		friction->GetAlpha2(&alpha2,gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+ 		frictionheat=alpha2*(vx*vx+vy*vy);
+ 
+ 		/*Get water and ice pressures*/
+@@ -493,8 +492,6 @@
+ 	Input* base_input           = element->GetInput(BaseEnum);                       _assert_(base_input);
+ 	Input* B_input              = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+ 	Input* n_input              = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+-	Input* vx_input             = element->GetInput(VxEnum);                         _assert_(vx_input);
+-	Input* vy_input             = element->GetInput(VyEnum);                         _assert_(vy_input);
+ 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
+ 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
+ 
+@@ -522,8 +519,6 @@
+ 		head_input->GetInputDerivativeValue(&dh[0],xyz_list,gauss);
+ 		lr_input->GetInputValue(&lr,gauss);
+ 		br_input->GetInputValue(&br,gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+ 
+ 		/*Get ice A parameter*/
+ 		B_input->GetInputValue(&B,gauss);
+@@ -538,8 +533,7 @@
+ 
+ 		/*Compute frictional heat flux*/
+ 		friction->GetAlpha2(&alpha2,gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+ 		frictionheat=alpha2*(vx*vx+vy*vy);
+ 
+ 		/*Get water and ice pressures*/
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26462)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26463)
+@@ -3488,7 +3488,7 @@
+ 
+ 	/*build friction object, used later on: */
+ 	/*dim=4 is special for HO, which is actually 2.5D*/
+-	Friction* friction=new Friction(element,dim==3?4:1);
++	Friction* friction=new Friction(element,dim==3?2.5:1);
+ 
+ 	/*Recover portion of element that is grounded*/
+ 	if(!(friction_style==SubelementFriction2Enum)) phi=element->GetGroundedPortion(xyz_list_base);
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26462)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26463)
+@@ -17,15 +17,75 @@
+ /*Constructors/destructors*/
+ Friction::Friction(){/*{{{*/
+ 	this->element=NULL;
+-	this->dim=0;
+ 	this->law=0;
++	this->apply_dim = 1;
++	this->domaintype=-1;
++	this->vx_input=NULL;
++	this->vy_input=NULL;
++	this->vz_input=NULL;
+ }
+ /*}}}*/
+-Friction::Friction(Element* element_in,int dim_in){/*{{{*/
++Friction::Friction(Element* element_in){/*{{{*/
++	/* Determine the dimension according to the domain type automatically. 
++	 * There are exceptions, e.g. HO, which needs the user to specify the dimension used in Friciton.*/
++	this->element=element_in;
+ 
++	/* Load necessary parameters */
++	element_in->FindParam(&this->law,FrictionLawEnum);
++	element_in->FindParam(&this->domaintype,DomainTypeEnum);
++	
++	/* Load VxBase and VyBase for this special case */
++	switch(this->domaintype){
++		case Domain2DhorizontalEnum: 
++			this->apply_dim = 2;
++			this->vx_input = element_in->GetInput(VxBaseEnum);			_assert_(this->vx_input); 
++			this->vy_input = element_in->GetInput(VyBaseEnum);			_assert_(this->vy_input);
++			this->vz_input = NULL;
++			break;
++      case Domain2DverticalEnum:
++			this->apply_dim = 2;
++			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
++			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
++			this->vz_input = NULL;
++			break;
++      case Domain3DEnum:           
++			this->apply_dim = 3;
++			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
++			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
++			this->vz_input = element_in->GetInput(VzEnum);				_assert_(this->vz_input);
++			break;
++      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++}
++/*}}}*/
++Friction::Friction(Element* element_in, double dim){/*{{{*/
++
+ 	this->element=element_in;
+-	this->dim=dim_in;
++	this->apply_dim = dim;
++
++	/* Load necessary parameters */
+ 	element_in->FindParam(&this->law,FrictionLawEnum);
++	element_in->FindParam(&this->domaintype,DomainTypeEnum);
++	
++	/* Load VxBase and VyBase for this special case */
++	switch(this->domaintype){
++		case Domain2DhorizontalEnum: 
++			this->vx_input = element_in->GetInput(VxBaseEnum);			_assert_(this->vx_input); 
++			this->vy_input = element_in->GetInput(VyBaseEnum);			_assert_(this->vy_input);
++			this->vz_input = NULL;
++			break;
++      case Domain2DverticalEnum:
++			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
++			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
++			this->vz_input = NULL;
++			break;
++      case Domain3DEnum:           
++			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
++			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
++			this->vz_input = element_in->GetInput(VzEnum);				_assert_(this->vz_input);
++			break;
++      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
+ }
+ /*}}}*/
+ Friction::~Friction(){/*{{{*/
+@@ -35,7 +95,7 @@
+ /*methods: */
+ void Friction::Echo(void){/*{{{*/
+ 	_printf_("Friction:\n");
+-	_printf_("   dim: " << this->dim<< "\n");
++	_printf_("   Domain type: " << this->domaintype<< "\n");
+ }
+ /*}}}*/
+ void Friction::GetAlphaComplement(IssmDouble* palpha_complement, Gauss* gauss){/*{{{*/
+@@ -854,33 +914,45 @@
+ 
+ 	/*diverse*/
+ 	IssmDouble vx,vy,vz,vmag;
++
++	this->vx_input->GetInputValue(&vx, gauss);
++	this->vy_input->GetInputValue(&vy, gauss);
++
++	if ((this->vz_input == NULL) || (this->apply_dim<3)) vz = 0.0;
++	else this->vz_input->GetInputValue(&vz, gauss);
+ 	
+-	switch(dim){
+-		case 1:
+-			element->GetInputValue(&vx,gauss,VxEnum);
+-			vmag=sqrt(vx*vx);
+-			break;
+-		case 2:
+-			element->GetInputValue(&vx,gauss,VxBaseEnum);
+-			element->GetInputValue(&vy,gauss,VyBaseEnum);
+-			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;
+-		case 4:
+-			/* This is for HO 3D case, since it requires the horizontal velocities */
+-			element->GetInputValue(&vx,gauss,VxEnum);
+-			element->GetInputValue(&vy,gauss,VyEnum);
+-			vmag=sqrt(vx*vx+vy*vy);
+-			break;
+-		default:
+-			_error_("not supported");
+-	}
++	if (this->apply_dim<2) vy = 0.0;
+ 
++	vmag = sqrt(vx*vx+vy*vy+vz*vz);
+ 	return vmag;
++}/*}}}*/
++void Friction::GetBasalSlidingSpeeds(IssmDouble* pvx, Gauss* gauss){/*{{{*/
+ 
++	this->vx_input->GetInputValue(pvx, gauss);
++	/*Checks*/
++	_assert_(!xIsNan<IssmDouble>(*pvx));
++	_assert_(!xIsInf<IssmDouble>(*pvx));
+ }/*}}}*/
++void Friction::GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, Gauss* gauss){/*{{{*/
++
++	this->vx_input->GetInputValue(pvx, gauss);
++	this->vy_input->GetInputValue(pvy, gauss);
++	/*Checks*/
++	_assert_(!xIsNan<IssmDouble>(*pvx));
++	_assert_(!xIsInf<IssmDouble>(*pvx));
++	_assert_(!xIsNan<IssmDouble>(*pvy));
++	_assert_(!xIsInf<IssmDouble>(*pvy));
++}/*}}}*/
++void Friction::GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, IssmDouble* pvz, Gauss* gauss){/*{{{*/
++
++	this->vx_input->GetInputValue(pvx, gauss);
++	this->vy_input->GetInputValue(pvy, gauss);
++	this->vz_input->GetInputValue(pvz, gauss);
++	/*Checks*/
++	_assert_(!xIsNan<IssmDouble>(*pvx));
++	_assert_(!xIsInf<IssmDouble>(*pvx));
++	_assert_(!xIsNan<IssmDouble>(*pvy));
++	_assert_(!xIsInf<IssmDouble>(*pvy));
++	_assert_(!xIsNan<IssmDouble>(*pvz));
++	_assert_(!xIsInf<IssmDouble>(*pvz));
++}/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26462)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26463)
+@@ -14,12 +14,17 @@
+ 
+ 	public:
+ 		Element* element;
+-		int      dim;
+ 		int      law;
++		int      domaintype;
++		double	apply_dim;
++		Input*	vx_input;
++		Input*	vy_input;
++		Input*	vz_input;
+ 
+ 		/*methods: */
+ 		Friction();
+-		Friction(Element* element_in,int dim_in);
++		Friction(Element* element_in);
++		Friction(Element* element_in, double dim);
+ 		~Friction();
+ 
+ 		void  Echo(void);
+@@ -46,6 +51,9 @@
+ 
+ 		IssmDouble EffectivePressure(Gauss* gauss);
+ 		IssmDouble VelMag(Gauss* gauss);
++		void GetBasalSlidingSpeeds(IssmDouble* pvx, Gauss* gauss);
++		void GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, Gauss* gauss);
++		void GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, IssmDouble* pvz, Gauss* gauss);
+ };
+ 
+ #endif  /* _FRICTION_H_ */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26463-26464.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26463-26464.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26463-26464.diff	(revision 26740)
@@ -0,0 +1,156 @@
+Index: ../trunk-jpl/test/Archives/Archive809.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26463)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26464)
+@@ -28,6 +28,7 @@
+ /*Element macros*/
+ #define NUMVERTICES   3
+ #define NUMVERTICES1D 2
++//#define ISMICI        1
+ 
+ /*Constructors/destructor/copy*/
+ Tria::Tria(int tria_id,int tria_sid,int tria_lid,IoModel* iomodel,int nummodels)/*{{{*/
+@@ -405,12 +406,27 @@
+ 
+ 	IssmDouble  calvingrate[NUMVERTICES];
+ 	IssmDouble  vx,vy;
+-	IssmDouble  water_height, bed,Ho,thickness,surface;
++	IssmDouble  water_height, bed,Hab,thickness,surface;
+ 	IssmDouble  surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal;
+ 	IssmDouble  strainparallel, straineffective,B,n;
+ 	IssmDouble  s_xx,s_xy,s_yy,s1,s2,stmp;
+ 	int         crevasse_opening_stress;
+ 
++
++	/*reset if no ice in element*/
++	if(!this->IsIceInElement()){
++		for(int i=0;i<NUMVERTICES;i++){
++			surface_crevasse[i] = 0.;
++			basal_crevasse[i] = 0.;
++			crevasse_depth[i] = 0.;
++		}
++		this->AddInput(SurfaceCrevasseEnum,&surface_crevasse[0],P1DGEnum);
++		this->AddInput(BasalCrevasseEnum,&basal_crevasse[0],P1DGEnum);
++		this->AddInput(CrevasseDepthEnum,&crevasse_depth[0],P1DGEnum);
++		return;
++	}
++
++
+ 	/*retrieve the type of crevasse_opening_stress*/
+ 	this->parameters->FindParam(&crevasse_opening_stress,CalvingCrevasseDepthEnum);
+ 
+@@ -461,9 +477,7 @@
+ 		else if(crevasse_opening_stress==1){
+          /*Benn2017,Todd2018: maximum principal stress */
+ 			Matrix2x2Eigen(&s1,&s2,NULL,NULL,s_xx,s_xy,s_yy);
+-			if(fabs(s2)>fabs(s1)){
+-            stmp=s2; s2=s1; s1=stmp;
+-         }
++			s1 = max(0.,max(s1,s2));
+ 		}
+       else{
+          _error_("not supported");
+@@ -470,7 +484,7 @@
+       }
+ 
+       /*Surface crevasse: sigma'_xx - rho_i g d + rho_fw g d_w = 0*/
+-      surface_crevasse[iv] = s1 / (rho_ice*constant_g) + (rho_freshwater/rho_ice)*water_height;
++      surface_crevasse[iv] = 2*s1 / (rho_ice*constant_g) + (rho_freshwater/rho_ice)*water_height;
+ 		if(surface_crevasse[iv]<0.){
+ 			surface_crevasse[iv]=0.;
+ 			water_height = 0.;
+@@ -481,9 +495,9 @@
+          basal_crevasse[iv] = 0.;
+       }
+       else{
+-         Ho = thickness - (rho_seawater/rho_ice) * (-bed);
+-         if(Ho<0.)  Ho=0.;
+-         basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (s1/ (rho_ice*constant_g)-Ho);
++         Hab = thickness - (rho_seawater/rho_ice) * (-bed);
++         if(Hab<0.)  Hab=0.;
++         basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (2*s1/ (rho_ice*constant_g)-Hab);
+          if(basal_crevasse[iv]<0.) basal_crevasse[iv]=0.;
+       }
+ 
+@@ -4322,6 +4336,7 @@
+ 		movingfrontvy[iv] = w[1];		
+ 	}
+ 
++	#ifdef MICI
+ 	/**************************************  MICI  START ************************************/
+ 	/*MICI from Crawford et al. 2021:
+ 	 * Tice = 20C; Bf  ->  I = 3.7e-16; α = 6.9
+@@ -4330,32 +4345,47 @@
+ 	 * Tice = 10C; Bn  ->  I = 6.9e-17; α = 7.3
+ 	 * Tice = 5C;  Bn  ->  I = 1.9e-16; α = 7.3
+ 	 */
+-	//Input* surface_input = this->GetInput(SurfaceEnum); _assert_(surface_input);
+-	//Input* bed_input     = this->GetInput(BedEnum);     _assert_(bed_input);
+-	//Input* ls_input      = this->GetInput(MaskIceLevelsetEnum);   _assert_(ls_input);
+-	//IssmDouble Hc,bed,ls;
+-	//for(int iv=0;iv<NUMVERTICES;iv++){
+-	//	gauss.GaussVertex(iv);
++	Input* surface_input = this->GetInput(SurfaceEnum); _assert_(surface_input);
++	Input* bed_input     = this->GetInput(BedEnum);     _assert_(bed_input);
++	Input* ls_input      = this->GetInput(MaskIceLevelsetEnum);   _assert_(ls_input);
++	IssmDouble Hc,bed,ls;
++	for(int iv=0;iv<NUMVERTICES;iv++){
++		gauss.GaussVertex(iv);
+ 
+-	//	surface_input->GetInputValue(&Hc,&gauss);
+-	//	bed_input->GetInputValue(&bed,&gauss);
+-	//	ls_input->GetInputValue(&ls,&gauss);
++		surface_input->GetInputValue(&Hc,&gauss);
++		bed_input->GetInputValue(&bed,&gauss);
++		ls_input->GetInputValue(&ls,&gauss);
+ 
+-	//	if(Hc>135. && bed<0. && fabs(ls)<100.e3){
++		/*Do we assume that the calving front does not move?*/
++		//movingfrontvx[iv] = 0.;
++		//movingfrontvy[iv] = 0.;
+ 
+-	//		lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
+-	//		norm_dlsf=0.;
+-	//		for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
+-	//		norm_dlsf=sqrt(norm_dlsf);
++		//if(Hc>80. && bed<0. && fabs(ls)<100.e3){ //Pollard & De Conto
++		if(Hc>135. && bed<0. && fabs(ls)<100.e3){ // Crawford et all
+ 
+-	//		/*5C Bn (worst case scenario)*/
+-	//		IssmDouble I     = 1.9e-16;
+-	//		IssmDouble alpha = 7.3;
+-	//		IssmDouble C = I*pow(Hc,alpha)/(24*3600.); /*convert from m/day to m/s*/
+-	//		movingfrontvx[iv] = -C*dlsf[0]/norm_dlsf;
+-	//		movingfrontvy[iv] = -C*dlsf[1]/norm_dlsf;
+-	//	}
+-	//}
++			lsf_slopex_input->GetInputValue(&dlsf[0],&gauss);
++			norm_dlsf=0.;
++			for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++			norm_dlsf=sqrt(norm_dlsf);
++
++			/*use vel direction instead of LSF*/
++			vx_input->GetInputValue(&v[0],&gauss);
++			vy_input->GetInputValue(&v[1],&gauss);
++			vel=sqrt(v[0]*v[0] + v[1]*v[1]);
++			norm_dlsf = max(vel,1.e-10);
++			dlsf[0] = v[0];
++			dlsf[1] = v[1];
++
++			/*5C Bn (worst case scenario)*/
++			IssmDouble I     = 1.9e-16;
++			IssmDouble alpha = 7.3;
++			IssmDouble C = min(2000.,I*pow(Hc,alpha))/(24*3600.); /*convert from m/day to m/s*/
++			//IssmDouble C = (min(max(Hc,80.),100.) - 80.)/20. * 10./(24*3600.); /*Original MICI! convert from m/day to m/s*/
++			movingfrontvx[iv] = -C*dlsf[0]/norm_dlsf;
++			movingfrontvy[iv] = -C*dlsf[1]/norm_dlsf;
++		}
++	}
++	#endif
+ 	/**************************************  END MICI  *************************************/
+ 
+ 	/*Add input*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26464-26465.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26464-26465.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26464-26465.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26464)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26465)
+@@ -13,8 +13,8 @@
+ void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 	int finiteelement;
+ 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
+-	//IoModelToDynamicConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+-	IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
++	IoModelToDynamicConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
++	//IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+ }
+ /*}}}*/
+ void LevelsetAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+@@ -618,7 +618,6 @@
+ 			for(Object* & object : femmodel->elements->objects){
+ 				Element* element  = xDynamicCast<Element*>(object);
+ 				int      numnodes = element->GetNumberOfNodes();
+-				Gauss*   gauss    = element->NewGauss();
+ 
+ 				Input *levelset_input         = element->GetInput(DistanceToCalvingfrontEnum); _assert_(levelset_input);
+ 				Input *crevassedepth_input    = element->GetInput(CrevasseDepthEnum);          _assert_(crevassedepth_input);
+@@ -639,6 +638,7 @@
+ 
+ 				/*Check status if connected*/
+ 				if(isconnected){
++					Gauss* gauss = element->NewGauss();
+ 					for(int in=0;in<numnodes;in++){
+ 						gauss->GaussNode(element->GetElementType(),in);
+ 						Node* node=element->GetNode(in);
+@@ -654,6 +654,7 @@
+ 							vec_constraint_nodes->SetValue(node->Pid(),1.0,INS_VAL);
+ 						}
+ 					}
++					delete gauss;
+ 				}
+ 			}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26465-26466.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26465-26466.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26465-26466.diff	(revision 26740)
@@ -0,0 +1,83 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26465)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26466)
+@@ -18,7 +18,7 @@
+ Friction::Friction(){/*{{{*/
+ 	this->element=NULL;
+ 	this->law=0;
+-	this->apply_dim = 1;
++	this->apply_dim = 1.;
+ 	this->domaintype=-1;
+ 	this->vx_input=NULL;
+ 	this->vy_input=NULL;
+@@ -37,19 +37,19 @@
+ 	/* Load VxBase and VyBase for this special case */
+ 	switch(this->domaintype){
+ 		case Domain2DhorizontalEnum: 
+-			this->apply_dim = 2;
++			this->apply_dim = 2.;
+ 			this->vx_input = element_in->GetInput(VxBaseEnum);			_assert_(this->vx_input); 
+ 			this->vy_input = element_in->GetInput(VyBaseEnum);			_assert_(this->vy_input);
+ 			this->vz_input = NULL;
+ 			break;
+       case Domain2DverticalEnum:
+-			this->apply_dim = 2;
++			this->apply_dim = 2.;
+ 			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
+ 			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
+ 			this->vz_input = NULL;
+ 			break;
+       case Domain3DEnum:           
+-			this->apply_dim = 3;
++			this->apply_dim = 3.;
+ 			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
+ 			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
+ 			this->vz_input = element_in->GetInput(VzEnum);				_assert_(this->vz_input);
+@@ -58,7 +58,7 @@
+ 	}
+ }
+ /*}}}*/
+-Friction::Friction(Element* element_in, double dim){/*{{{*/
++Friction::Friction(Element* element_in,IssmDouble dim){/*{{{*/
+ 
+ 	this->element=element_in;
+ 	this->apply_dim = dim;
+@@ -918,10 +918,10 @@
+ 	this->vx_input->GetInputValue(&vx, gauss);
+ 	this->vy_input->GetInputValue(&vy, gauss);
+ 
+-	if ((this->vz_input == NULL) || (this->apply_dim<3)) vz = 0.0;
++	if ((this->vz_input == NULL) || (this->apply_dim<3.)) vz = 0.0;
+ 	else this->vz_input->GetInputValue(&vz, gauss);
+ 	
+-	if (this->apply_dim<2) vy = 0.0;
++	if (this->apply_dim<2.) vy = 0.0;
+ 
+ 	vmag = sqrt(vx*vx+vy*vy+vz*vz);
+ 	return vmag;
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26465)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26466)
+@@ -13,13 +13,13 @@
+ class Friction{
+ 
+ 	public:
+-		Element* element;
+-		int      law;
+-		int      domaintype;
+-		double	apply_dim;
+-		Input*	vx_input;
+-		Input*	vy_input;
+-		Input*	vz_input;
++		Element    *element;
++		int         law;
++		int         domaintype;
++		IssmDouble  apply_dim;
++		Input      *vx_input;
++		Input      *vy_input;
++		Input      *vz_input;
+ 
+ 		/*methods: */
+ 		Friction();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26466-26467.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26466-26467.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26466-26467.diff	(revision 26740)
@@ -0,0 +1,436 @@
+Index: ../trunk-jpl/src/jl/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/exp.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/exp.jl	(revision 26467)
+@@ -0,0 +1,136 @@
++
++#exp object definition, constructor, and disp
++mutable struct ExpStruct #{{{
++	name::String
++	nods::Int32
++	density::Float64
++	x::Vector{Float64}
++   y::Vector{Float64}
++	closed::Bool
++end  #}}}
++function ExpStruct() #{{{
++	return ExpStruct("",0, 0., Vector{Float64}(undef,0), Vector{Float64}(undef,0), false)
++end# }}}
++function Base.show(io::IO, exp::ExpStruct)# {{{
++
++	compact = get(io, :compact, false)
++
++	println(io,"ExpStruct:")
++	for name in fieldnames(typeof(exp))
++		a=getfield(exp,name)
++		print(io,"   $(name) = ")
++		if !isempty(a)
++			if compact && eltype(a)<:Number && length(a)>3
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,a)
++			end
++		else
++			println(io,"empty")
++		end
++	end
++end# }}}
++
++#methods
++#expread {{{
++"""
++	EXPREAD - read a file exp and build a Structure
++
++	This function reads an *.exp* and builds a structure containing the fields x
++	and y corresponding to the coordinates, one for the filename of the exp
++	file, for the density, for the nodes, and a field 'closed' to indicate if the
++	domain is closed.
++
++	Usage:
++		exp=expread(filename)
++
++# Examples:
++```julia-repl
++julia> exp=expread('domainoutline.exp')
++```
++
++# Arguments:
++- filename: the ARGUS file to read
++"""
++function expread(filename::String)
++
++	#initialize output
++	contours = Vector{ExpStruct}(undef, 0)
++
++	#open file
++	f = open(filename, "r") do f
++
++		#initialize some variables
++		nprof = 0
++		line = 1
++
++		while !eof(f)
++
++			#read first line
++			A = readline(f); line += 1
++
++			#if isempty, go to the next line and try again
++			if isempty(A)
++				continue
++			else
++				#initialize new profile
++				nprof += 1 
++				exp = ExpStruct();
++			end
++
++			#extract profile name
++			if A[1:8]!="## Name:"
++				println("line $(line): $(A)")
++				error("Unexpected exp file formatting") 
++			end
++			if length(A)>8
++				exp.name = A[9:end]
++			end
++
++			#read Icon
++			A = readline(f); line += 1
++			if A[1:8]!="## Icon:" error("Unexpected exp file formatting") end
++
++			#read Info
++			A = readline(f); line += 1
++			if A[1:20]!="# Points Count Value"
++				println("line $(line): $(A)")
++				error("Unexpected exp file formatting") 
++			end
++
++			#Reads number of nods and density
++			A = readline(f); line += 1
++			A = parse.(Float64, split(A))
++			if length(A) != 2 error("Unexpected exp file formatting") end
++			exp.nods = A[1]; exp.density = A[2]
++
++			#Allocate arrays
++			if exp.nods<=0 error("Unexpected exp file formatting") end
++			exp.x = Vector{Float64}(undef,exp.nods)
++			exp.y = Vector{Float64}(undef,exp.nods)
++
++			#Read coordinates
++			A = readline(f); line += 1
++			if A[1:13]!="# X pos Y pos" error("Unexpected exp file formatting") end
++			for i in 1:exp.nods
++				A = readline(f); line += 1
++				A = parse.(Float64, split(A))
++				if length(A) != 2 error("Unexpected exp file formatting") end
++				if any(isnan.(A)) error("NaNs found in coordinate") end
++				exp.x[i] = A[1]; exp.y[i] = A[2]
++			end
++
++			#check if closed
++			if exp.nods>1 && exp.x[1]==exp.x[end] && exp.y[1]==exp.y[end]
++				exp.closed = true
++			else
++				exp.closed = false
++			end
++
++			#add profile to list
++			push!(contours, exp)
++		end
++	end
++
++	return contours
++end# }}}
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26467)
+@@ -0,0 +1,109 @@
++abstract type AbstractMesh end
++
++struct Mesh2dTriangle <: AbstractMesh
++	numberofvertices::Int32
++	numberofelements::Int32
++	x::Vector{Float64}
++	y::Vector{Float64}
++	elements::Matrix{Int32}
++end
++
++struct Mesh3dPrism{T} <: AbstractMesh
++	numberofvertices::Int32
++	numberofelements::Int32
++	numberoflayers::Int32
++	x::Vector{Float64}
++	y::Vector{Float64}
++	z::Vector{Float64}
++	elements::Matrix{Int32}
++end
++
++struct Geometry
++	surface::Vector{Float64}
++	base::Vector{Float64}
++	thickness::Vector{Float64}
++	bed::Vector{Float64}
++end
++
++function configure(;
++        MeshType = Mesh2dTriangle,
++		  meshnbv = 0,
++		  meshnbe = 0,
++        meshx = [NaN],
++        meshy = [NaN],
++		  meshel = [0],
++        GeometryType = Geometry,
++		  geos = [NaN],
++		  geob1 = [NaN],
++		  geoh = [NaN],
++		  geob2 = [NaN],
++    )
++
++	mesh = MeshType(meshnbv,meshnbe,meshx,meshy,meshel)
++	geometry = Geometry(geos,geob1,geoh,geob2)
++
++    return (mesh = mesh, geometry = geometry)
++end
++
++solve(model::NamedTuple) = solve(model.mesh, model.geometry)
++
++function solve(mesh::Mesh2dTriangle, geometry::Geometry)
++    println("Solving with triangular mesh, ... data, ...")
++    # do something
++end
++function solve(mesh::Mesh3dPrism, geometry::Geometry)
++    println("Solving with rectangular mesh, ... data, ...")
++    # do something
++end
++
++# Probably actually want something more like:
++# function solve(mesh::AbstractMesh, data::AbstractDataset)
++#     do_something_with_mesh(mesh) # This will dispatch
++#     do_something_with_data(data) # This will dispatch
++#     # do something
++# end
++
++function remake(model::NamedTuple;
++        MeshType = typeof(model.mesh),
++		  meshnbv = model.mesh.nbv,
++		  meshnbe = model.mesh.nbe,
++        meshx = model.mesh.x,
++        meshy = model.mesh.y,
++		  meshel = model.mesh.elements,
++        surface = model.geometry.surface,
++        base = model.geometry.base,
++		  thickness = model.geometry.thickness,
++		  bed = model.geometry.bed,
++    )
++
++    mesh = MeshType(meshnbv, meshnbe, meshx, meshy, meshel)
++	 geometry = geometry(surface, base, thickness, bed)
++
++    return (mesh = mesh, geometry = geometry)
++end
++
++function remesh(model::NamedTuple;
++        MeshType = Mesh2dTriangle,
++        meshx = rand(1000),
++        meshy = rand(1000)
++    )
++
++    new_mesh = MeshType(meshx, meshy)
++    return (mesh = new_mesh, data = model.data)
++end
++
++## --- Try it out
++
++# Just use default parameters
++model = configure()
++solve(model)
++## --- Try it out
++
++# Actually specify some relevant parameters
++model = configure(
++    MeshType = Mesh3dPrism,
++    foo = rand(10000),
++    bar = rand(1000,1000),
++    baz = randn(1000,1000)
++)
++solve(model)
+Index: ../trunk-jpl/src/jl/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/triangle.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/triangle.jl	(revision 26467)
+@@ -0,0 +1,176 @@
++#see https://github.com/JuliaGeometry/Triangulate.jl/blob/master/src/plot.jl
++
++#Class Triangle's triangulateio
++mutable struct CTriangulateIO #{{{
++
++    pointlist :: Ptr{Cdouble}
++    pointattributelist :: Ptr{Cdouble}
++    pointmarkerlist :: Ptr{Cint}
++    numberofpoints :: Cint
++    numberofpointattributes :: Cint
++    
++    trianglelist :: Ptr{Cint}
++    triangleattributelist :: Ptr{Cdouble}
++    trianglearealist :: Ptr{Cdouble}
++    neighborlist :: Ptr{Cint}
++    numberoftriangles :: Cint
++    numberofcorners :: Cint
++    numberoftriangleattributes :: Cint
++    
++    segmentlist :: Ptr{Cint}
++    segmentmarkerlist :: Ptr{Cint}
++    numberofsegments :: Cint
++
++    holelist :: Ptr{Cdouble}
++    numberofholes :: Cint
++
++    regionlist :: Ptr{Cdouble}
++    numberofregions :: Cint
++
++    edgelist :: Ptr{Cint}
++    edgemarkerlist :: Ptr{Cint}
++    normlist :: Ptr{Cdouble}
++    numberofedges :: Cint
++ end  #}}}
++function CTriangulateIO() #{{{
++	return CTriangulateIO(C_NULL, C_NULL, C_NULL, 0, 0,
++								 C_NULL, C_NULL, C_NULL, C_NULL, 0, 0, 0,
++								 C_NULL, C_NULL, 0,
++								 C_NULL, 0,
++								 C_NULL, 0,
++								 C_NULL, C_NULL, C_NULL, 0)
++end# }}}
++function Base.show(io::IO, tio::CTriangulateIO)# {{{
++	println(io,"CTriangulateIO(")
++	for name in fieldnames(typeof(tio))
++		a=getfield(tio,name)
++		print(io,"$(name) = ")
++		println(io,a)
++	end
++	println(io,")")
++end# }}}
++
++using Printf, PyPlot
++"""
++TRIANGLE - create model mesh using the triangle package
++
++	This function creates a model mesh using Triangle and a domain outline, to
++	within a certain resolution
++#Arguments
++ - md is a model tuple
++ - domainname is the name of an Argus domain outline file
++ - resolution:  is a characteristic length for the mesh (same unit as the domain outline unit)
++
++# Usage:
++ - md=triangle(md,domainname,resolution)
++# Examples:
++ - md=triangle(md,'DomainOutline.exp',1000);
++ - md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
++"""
++function triangle(domainname::String,resolution::Float64) #{{{
++
++	#read input file
++	contours = expread(domainname)
++	area     = resolution^2
++
++	#Initialize i/o structures
++	ctio_in  = CTriangulateIO();
++	ctio_out = CTriangulateIO();
++	vor_out  = CTriangulateIO();
++
++	#Construct input structure
++	numberofpoints   = 0
++	numberofsegments = 0
++	for i in 1:length(contours)
++		numberofpoints   += contours[i].nods-1
++		numberofsegments += contours[i].nods-1
++	end
++	numberofpointattributes = 1
++
++	pointlist=Array{Cdouble,2}(undef,2,numberofpoints)
++	count = 0
++	for i in 1:length(contours)
++		nods = contours[i].nods
++		pointlist[1,count+1:count+nods-1] = contours[i].x[1:end-1]
++		pointlist[2,count+1:count+nods-1] = contours[i].y[1:end-1]
++		count += (nods-1)
++	end
++	pointattributelist=Array{Cdouble,1}(undef,numberofpoints)
++	pointmarkerlist=Array{Cint,1}(undef,numberofpoints)
++	for i in 1:numberofpoints
++		pointmarkerlist[i]=0
++		pointattributelist[i]=0.
++	end
++
++	counter=0;
++   backcounter=0;
++	segmentlist=Array{Cint,2}(undef,2,numberofsegments)
++	segmentmarkerlist=Array{Cint,1}(undef,numberofsegments)
++	segmentmarkerlist[:].=0
++	for i in 1:length(contours)
++		nods = contours[i].nods
++		segmentlist[1,counter+1:counter+nods-2] = collect(counter+0:counter+nods-3)
++		segmentlist[2,counter+1:counter+nods-2] = collect(counter+1:counter+nods-2)
++		counter+=nods-2
++		#close profile
++		segmentlist[1,counter+1]=counter
++		segmentlist[2,counter+1]=backcounter
++		counter+=1
++		backcounter=counter
++	end
++
++	numberofregions = 0
++	numberofholes = length(contours)-1
++	holelist = Array{Cdouble,2}(undef,2,numberofholes)
++	if numberofholes>0
++		 for i in 2:length(contours)
++			 xA=contours[i].x[1]; xB=contours[i].x[end-1]
++			 yA=contours[i].y[1]; yB=contours[i].y[end-1]
++			 xC=(xA+xB)/2;        yC=(yA+yB)/2;
++			 xD=xC+tan(10. /180. *pi)*(yC-yA);
++			 yD=yC+tan(10. /180. *pi)*(xA-xC);
++			 xE=xC-tan(10. /180. *pi)*(yC-yA);
++			 yE=yC-tan(10. /180. *pi)*(xA-xC);
++			 holelist[1,i-1] = xD
++			 holelist[2,i-1] = yD
++		 end
++	end
++
++	#based on this, prepare input structure
++	ctio_in.numberofpoints = numberofpoints
++	ctio_in.pointlist=pointer(pointlist)
++	ctio_in.numberofpointattributes=numberofpointattributes
++	ctio_in.pointattributelist=pointer(pointattributelist)
++	ctio_in.pointmarkerlist=pointer(pointmarkerlist)
++	ctio_in.numberofsegments=numberofsegments
++	ctio_in.segmentlist=pointer(segmentlist)
++	ctio_in.segmentmarkerlist = pointer(segmentmarkerlist)
++	ctio_in.numberofholes=numberofholes
++	ctio_in.holelist=pointer(holelist)
++	ctio_in.numberofregions=0
++
++	#Call triangle using ISSM's default options
++	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
++	#rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
++	rc=ccall( (:triangulate,"libtriangle"),
++				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
++				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
++	println("number of elements: ",ctio_out.numberoftriangles)
++
++	#post process output
++	numberofvertices = ctio_out.numberofpoints
++	numberofelements = ctio_out.numberoftriangles
++	points           = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
++	elements         = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
++
++	#plot
++	clf()
++	fig = matplotlib[:pyplot][:figure]("2D Mesh Plot", figsize = (10,10))
++	ax = matplotlib[:pyplot][:axes]()
++	ax[:set_aspect]("equal")
++	tri = ax[:triplot](points[:,1], points[:,2], elements.-1)
++	setp(tri, linestyle = "-", linewidth = 1.5, marker = "None", markersize = 5., color = "blue")
++
++	fig[:canvas][:draw]()
++	
++end#}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26467-26468.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26467-26468.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26467-26468.diff	(revision 26740)
@@ -0,0 +1,3451 @@
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 26468)
+@@ -70,7 +70,6 @@
+ 		element->SetElementInput(inputs,DamageFEnum,0.);
+ 	}
+ 
+-
+ 	/*What input do I need to run my damage evolution model?*/
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 26468)
+@@ -534,7 +534,6 @@
+ 
+ 	int iseplthickcomp;
+ 
+-
+ 	/*Skip if we don't want to compute thicknesses*/
+ 	femmodel->parameters->FindParam(&iseplthickcomp,HydrologydcEplThickCompEnum);
+ 	if(iseplthickcomp==0) return;
+@@ -558,7 +557,6 @@
+ 	femmodel->parameters->FindParam(&gravity,ConstantsGEnum);
+ 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+ 
+-
+ 	for(Object* & object : femmodel->elements->objects){
+       Element* element = xDynamicCast<Element*>(object);
+ 
+Index: ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 26468)
+@@ -561,7 +561,7 @@
+ 
+ 	/*Skip if water or ice shelf element*/
+ 	if(element->IsAllFloating()) return;
+-	
++
+ 	/*Intermediary*/
+ 	IssmDouble phi_0, phi_m, p_i;
+ 	IssmDouble H,b,phi;
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 26468)
+@@ -306,7 +306,7 @@
+ 
+ 	/*Add input to the element: */
+ 	element->AddInput(WatercolumnEnum,watercolumn,element->GetElementType());
+-	
++
+ 	/*Also update the hydrological loads for the sealevel core: */
+ 	IssmDouble* oldwatercolumn      = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* deltawatercolumn = xNew<IssmDouble>(numnodes);
+Index: ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp	(revision 26468)
+@@ -41,7 +41,6 @@
+ 	iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaTwsEnum,P1Enum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum);
+ 
+-
+ }/*}}}*/
+ void HydrologyTwsAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+@@ -84,7 +83,7 @@
+ 
+ 	int numnodes = element->GetNumberOfNodes();
+ 	IssmDouble* watercolumn = xNew<IssmDouble>(numnodes);
+-	
++
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(int i=0;i<numnodes;i++){
+ 		watercolumn[i]=solution[doflist[i]];
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26468)
+@@ -233,7 +233,6 @@
+ 	iomodel->FindConstant(&grdmodel,"md.solidearth.settings.grdmodel");
+ 	if(grdmodel==IvinsEnum) inputs->SetTransientInput(TransientAccumulatedDeltaIceThicknessEnum,NULL,0);
+ 
+-
+ }/*}}}*/
+ void MasstransportAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+@@ -815,7 +814,7 @@
+ 		element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 		element->FindParam(&count,SealevelchangeRunCountEnum);
+ 	}
+-		
++
+ 	/*Fetch dof list and allocate solution vector*/
+ 	int *doflist = NULL;
+ 	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -911,7 +910,6 @@
+ 	/*Add input to the element: */
+ 	element->AddBasalInput(SurfaceEnum,newsurface,P1Enum);
+ 	element->AddBasalInput(BaseEnum,newbase,P1Enum);
+-	
+ 
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(newthickness);
+Index: ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp	(revision 26468)
+@@ -61,7 +61,6 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.dsl",DslEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.str",StrEnum);
+ 
+-
+ }/*}}}*/
+ void OceantransportAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+@@ -74,7 +73,7 @@
+ 	if(dslmodel==2){
+ 		IssmDouble modelid; 
+ 		int nummodels;
+-		
++
+ 		/*create double param, not int param, because Dakota will be updating it as 
+ 		 * a double potentially: */
+ 		iomodel->FetchData(&modelid,"md.dsl.modelid");
+Index: ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp	(revision 26468)
+@@ -48,14 +48,13 @@
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.displacementup",SolidearthExternalDisplacementUpRateEnum);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.geoid",SolidearthExternalGeoidRateEnum);
+ 
+-
+ 		/*Resolve Mmes using the modelid, if necessary:*/
+ 		if (inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){
+ 			int modelid;
+-			
++
+ 			/*retrieve model id: */
+ 			iomodel->FetchData(&modelid,"md.solidearth.external.modelid");
+-		
++
+ 			/*replace dataset of forcings with only one, the modelid'th:*/
+ 			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum);
+ 			MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum);
+@@ -74,7 +73,6 @@
+ 	iomodel->ConstantToInput(inputs,elements,0.,DeltaIceThicknessEnum,P1Enum);
+ 	iomodel->ConstantToInput(inputs,elements,0.,DeltaBottomPressureEnum,P1Enum);
+ 
+-
+ }/*}}}*/
+ void SealevelchangeAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+@@ -181,7 +179,7 @@
+ 		parameters->AddObject(new DoubleMatParam(CumBslcIcePartitionEnum,bslcice_partition,npartice,1));
+ 		xDelete<IssmDouble>(partitionice);
+ 	}
+-	
++
+ 	iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro");
+ 	parameters->AddObject(new IntParam(SolidearthNpartHydroEnum,nparthydro));
+ 	if(nparthydro){
+@@ -207,7 +205,7 @@
+ 	ToolkitsOptionsFromAnalysis(parameters,SealevelchangeAnalysisEnum); //this is requested by the BarystaticContributions class inner vectors.
+ 	BarystaticContributions* barystaticcontributions=new BarystaticContributions(iomodel);
+ 	parameters->AddObject(new GenericParam<BarystaticContributions*>(barystaticcontributions,BarystaticContributionsEnum));
+-	
++
+ 	/*Deal with external multi-model ensembles: {{{*/
+ 	if(isexternal){
+ 		iomodel->FetchData(&externalnature,"md.solidearth.external.nature");
+@@ -424,8 +422,6 @@
+ 			xDelete<int>(recvcounts);
+ 			xDelete<int>(displs);
+ 
+-			
+-
+ 			/*Avoid singularity at 0: */
+ 			G_gravi[0]=G_gravi[1];
+ 			if(elastic){
+@@ -436,8 +432,6 @@
+ 				}
+ 			}
+ 
+-			
+-
+ 			/*Reinterpolate viscoelastic green kernels onto a regular gridded time 
+ 			 *with steps equal to timeacc:*/
+ 			if(viscous){
+@@ -483,7 +477,7 @@
+ 						if(horiz)H_viscoelastic_interpolated[timeindex]=(1-lincoeff)*H_viscoelastic[timepreindex]+lincoeff*H_viscoelastic[timepreindex+1];
+ 					}
+ 				}
+-						
++
+ 			}
+ 			else if(elastic){
+ 				nt=1; //in elastic, or if we run only selfattraction, we need only one step
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26468)
+@@ -117,7 +117,6 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum);
+ 	#endif
+ 
+-
+ 	/*Add basal forcings to compute melt rate*/
+ 	int basalforcing_model;
+ 	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
+@@ -582,7 +581,6 @@
+ 		}
+ 	}
+ 
+-
+ 	#ifdef INWOOVZ
+ 	IssmDouble*  thickness = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*  base	     = xNew<IssmDouble>(numnodes);
+@@ -624,7 +622,6 @@
+ 	xDelete<IssmDouble>(thickness);
+ 	#endif
+ 
+-
+ 	/*Now Compute vel*/
+ 	for(i=0;i<numnodes;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
+ 
+Index: ../trunk-jpl/src/c/classes/AmrBamg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/AmrBamg.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/AmrBamg.cpp	(revision 26468)
+@@ -85,7 +85,7 @@
+ 
+ /*Methods*/
+ void AmrBamg::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/
+-	
++
+ 	/*Delete previous mesh and keep the entire mesh*/
+ 	if(this->elementslist) xDelete<int>(this->elementslist);
+ 	if(this->x) xDelete<IssmDouble>(this->x);
+@@ -98,7 +98,7 @@
+ 	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;
+@@ -127,7 +127,7 @@
+ 	delete Th;
+ }/*}}}*/
+ void AmrBamg::ExecuteRefinementBamg(IssmDouble* field,IssmDouble* hmaxVertices,int** pdatalist,IssmDouble** pxylist,int** pelementslist){/*{{{*/
+-	
++
+ 	/*Intermediaries*/
+ 	BamgGeom* geomout=new BamgGeom();
+ 	BamgMesh* meshout=new BamgMesh();
+@@ -141,7 +141,7 @@
+ 	/*Prepare field for metric*/
+ 	this->options->field			 = field;
+ 	this->options->hmaxVertices = hmaxVertices;
+-	
++
+ 	/*remesh*/
+ 	if(this->previousmesh){
+ 		this->options->fieldSize[0]			= this->previousmesh->VerticesSize[0];
+Index: ../trunk-jpl/src/c/classes/AmrNeopz.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/AmrNeopz.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/AmrNeopz.cpp	(revision 26468)
+@@ -136,7 +136,7 @@
+ 
+ /*Mesh refinement methods*/
+ void AmrNeopz::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/
+-   
++
+    /*Delete previous mesh and keep the entire mesh*/
+    if(this->elementslist) xDelete<int>(this->elementslist);
+    if(this->x) xDelete<IssmDouble>(this->x);
+@@ -149,7 +149,7 @@
+    this->numberofelements  = *numberofelements_in;
+ }/*}}}*/
+ void AmrNeopz::GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices_out,int* numberofelements_out){/*{{{*/
+-   
++
+    /*Get the entire mesh*/
+    *elementslist_out    = this->elementslist;
+    *x_out               = this->x;
+@@ -393,7 +393,7 @@
+ 		if(sons.size()>4) type++; //if neighbour's level is > element level+1
+ 		if(type>1) break;
+ 	}
+-	
++
+ 	/*Verify and return*/
+ 	if(type>1) type=2;
+ 
+@@ -415,7 +415,7 @@
+ 	if(verbose) _printf_("\ttotal: ");
+ 
+ 	count=1;
+-	
++
+ 	while(count>0){
+ 		count=0;
+ 		nelem=gmesh->NElements();//must keep here
+@@ -437,7 +437,7 @@
+ 					if(type==2) break;
+ 				}
+ 			}
+-			
++
+ 			/*refine the element if requested*/
+ 			if(type==2){gmesh->Element(i)->Divide(sons);	count++;}
+ 		}
+@@ -925,7 +925,7 @@
+ 	TPZPersistenceManager::OpenRead(fathermeshfile);
+ 	this->fathermesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile());
+ 	TPZPersistenceManager::CloseRead();
+-	
++
+ 	TPZPersistenceManager::OpenRead(previousmeshfile);
+ 	this->previousmesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile());
+    TPZPersistenceManager::CloseRead();
+@@ -932,23 +932,23 @@
+ 
+ 	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;
+@@ -981,7 +981,7 @@
+ 			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++) {
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.cpp	(revision 26468)
+@@ -65,7 +65,7 @@
+ IssmDouble BarystaticContributions::Total(){ /*{{{*/
+ 
+ 	IssmDouble  sumice,sumhydro,sumocean;
+-	
++
+ 	ice->Assemble();
+ 	hydro->Assemble();
+ 	ocean->Assemble();
+@@ -89,7 +89,6 @@
+ 	cumhydro->Sum(&sumhydro);
+ 	cumocean->Sum(&sumocean);
+ 
+-
+ 	return sumice+sumhydro+sumocean;
+ 
+ } /*}}}*/
+@@ -99,10 +98,9 @@
+ 	cumocean->AXPY(ocean,1);
+ 	cumhydro->AXPY(hydro,1);
+ 
+-
+ } /*}}}*/
+ void BarystaticContributions::Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue){ /*{{{*/
+-	
++
+ 	int id;
+ 	if(nice){
+ 		id=reCast<int>(pice[eid]);
+@@ -127,16 +125,14 @@
+ 	else{
+ 		ocean->SetValue(0,oceanvalue,ADD_VAL);
+ 	}
+-		
+ 
+ } /*}}}*/
+ void BarystaticContributions::Reset(){ /*{{{*/
+ 
+-
+ 	ice->Set(0.);
+ 	hydro->Set(0.);
+ 	ocean->Set(0.);
+-	
++
+ } /*}}}*/
+ void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp	(revision 26468)
+@@ -95,7 +95,6 @@
+ /*}}}*/
+ IssmDouble Cfsurfacelogvel::Response(FemModel* femmodel){/*{{{*/
+ 
+-
+ 	/*recover time parameters: */
+ 	IssmDouble time;
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+Index: ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp	(revision 26468)
+@@ -123,7 +123,7 @@
+ 		/*compute responses: */
+ 		if(VerboseQmu()) _printf0_("compute dakota responses:\n");
+ 		femmodel->DakotaResponsesx(responses,responses_descriptors,numresponsedescriptors,numFns);
+-		
++
+ 		/*Output results for this iteration: */
+ 		if(VerboseQmu()) _printf0_("output results for this iteration: \n");
+ 		OutputResultsx(femmodel);
+Index: ../trunk-jpl/src/c/classes/GrdLoads.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/GrdLoads.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/GrdLoads.cpp	(revision 26468)
+@@ -18,7 +18,6 @@
+ /*Object constructors and destructor*/
+ GrdLoads::GrdLoads(int nel,SealevelGeometry* slgeom){ /*{{{*/
+ 
+-
+ 	vloads=new Vector<IssmDouble>(nel);
+ 	for (int i=0;i<SLGEOM_NUMLOADS;i++) vsubloads[i]=new Vector<IssmDouble>(slgeom->nbar[i]);
+ 
+@@ -27,7 +26,6 @@
+ 
+ 	vsubsealevelloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]);
+ 
+-
+ }; /*}}}*/
+ GrdLoads::~GrdLoads(){ /*{{{*/
+ 
+@@ -50,7 +48,7 @@
+ 	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+ 		vsubloads[i]->Assemble();
+ 	}
+-	
++
+ 	loads=vloads->ToMPISerial();
+ 	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+ 		subloads[i]=vsubloads[i]->ToMPISerial();
+@@ -64,7 +62,7 @@
+ 
+ } /*}}}*/
+ void GrdLoads::BroadcastSealevelLoads(void){ /*{{{*/
+-	
++
+ 	sealevelloads=vsealevelloads->ToMPISerial();
+ 	subsealevelloads=vsubsealevelloads->ToMPISerial();
+ 
+Index: ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 26468)
+@@ -222,7 +222,6 @@
+ 	//	transient_input->AddTimeInput(gradient_in,time);
+ 	//}
+ 
+-
+ 	//NEW??
+ 	//this->gradient->SetInput(interp,numindices,indices,values_in);
+ }
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 26468)
+@@ -390,7 +390,6 @@
+ /*}}}*/
+ PentaInput* TransientInput::GetPentaInput(int offset){/*{{{*/
+ 
+-
+ 	/*Check offset*/
+ 	if(offset<0 || offset>this->numtimesteps-1){
+ 		_error_("Cannot return input for offset "<<offset);
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26468)
+@@ -611,10 +611,10 @@
+ 				/*we are going to error out, still try and get informatoin for the user:*/
+ 				record_name=xNew<char>(record_name_size+1);
+ 				record_name[record_name_size]='\0';
+-				
++
+ 				/*Read record_name: */
+ 				if(fread(record_name,record_name_size*sizeof(char),1,fid)!=0){};
+-				
++
+ 				_error_("error while looking in binary file. String \"" << record_name << "\" is a string of size "<<record_name_size);
+ 			}
+ 
+@@ -1837,7 +1837,6 @@
+ 				N=pN[i];
+ 				matrix=array[i];
+ 
+-				
+ 				//initialize transient input dataset:
+ 				TransientInput* transientinput=inputs->SetDatasetTransientInput(input_enum,i, times,N);
+ 				for(Object* & object : elements->objects){
+@@ -1850,7 +1849,6 @@
+ 					int        *vertexlids = xNew<int>(numvertices);
+ 					int        *vertexsids = xNew<int>(numvertices);
+ 
+-
+ 					/*Recover vertices ids needed to initialize inputs*/
+ 					_assert_(this->elements);
+ 					for(int k=0;k<numvertices;k++){
+@@ -1917,7 +1915,7 @@
+ 
+ 					}
+ 					else _error_("FetchDataToInput error message: row size of MatArray elements should be either numberofelements (+1) or numberofvertices (+1)");
+-					
++
+ 					xDelete<int>(vertexlids);
+ 					xDelete<int>(vertexsids);
+ 				}
+Index: ../trunk-jpl/src/c/classes/Node.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Node.cpp	(revision 26468)
+@@ -653,7 +653,7 @@
+ 			}
+ 		}
+ 		ug->SetValues(ssize,indices,values,INS_VAL);
+-		
++
+ 		xDelete<IssmDouble>(values);
+ 		xDelete<int>(indices);
+ 	}
+@@ -661,7 +661,6 @@
+ /*}}}*/
+ void Node::VecReduce(Vector<IssmDouble>* uf, IssmDouble* local_ug,int* indices_ug){/*{{{*/
+ 
+-
+ 	/*Only perform operation if not clone*/
+ 	if(this->IsClone()) return;
+ 
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.cpp	(revision 26468)
+@@ -68,7 +68,6 @@
+ 	bool fromlocalsize=true;
+ 	int lower_row;
+ 
+-
+ 	for (int i=0;i<SLGEOM_NUMLOADS;i++){
+ 		subelementmapping[i]=xNew<int>(localnel);
+ 		GetOwnershipBoundariesFromRange(&lower_row,&dummy,nsubel[i],IssmComm::GetComm());
+@@ -106,10 +105,9 @@
+ 
+ 	/*Also, we'll need the barycentre associated areas:*/
+ 
+-
+ } /*}}}*/
+ int SealevelGeometry::GEnum(int l){ /*{{{*/
+-	
++
+ 	int output = -1;
+ 	switch(l){
+ 		case SLGEOM_OCEAN: output=SealevelchangeGsubelOceanEnum; break;
+@@ -121,7 +119,7 @@
+ 
+ } /*}}}*/
+ int SealevelGeometry::GUEnum(int l){ /*{{{*/
+-	
++
+ 	int output = -1;
+ 	switch(l){
+ 		case SLGEOM_OCEAN: output=SealevelchangeGUsubelOceanEnum; break;
+@@ -133,7 +131,7 @@
+ 
+ } /*}}}*/
+ int SealevelGeometry::GNEnum(int l){ /*{{{*/
+-	
++
+ 	int output = -1;
+ 	switch(l){
+ 		case SLGEOM_OCEAN: output=SealevelchangeGNsubelOceanEnum; break;
+@@ -145,7 +143,7 @@
+ 	return output;
+ } /*}}}*/
+ int SealevelGeometry::GEEnum(int l){ /*{{{*/
+-	
++
+ 	int output = -1;
+ 	switch(l){
+ 		case SLGEOM_OCEAN: output=SealevelchangeGEsubelOceanEnum; break;
+Index: ../trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp	(revision 26468)
+@@ -27,7 +27,7 @@
+ 		default:
+ 			break;
+ 	}
+-	
++
+ 	/*Assign output pointer:*/
+ 	*psolutioncore=solutioncore;
+ 
+Index: ../trunk-jpl/src/c/cores/adjointstressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/adjointstressbalance_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/adjointstressbalance_core.cpp	(revision 26468)
+@@ -27,7 +27,7 @@
+ 	/*Compute velocities*/
+ 	if(VerboseSolution()) _printf0_("   computing velocities\n");
+ 	femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+-	
++
+ 	bool is_schur_cg_solver = false;
+ 	#ifdef _HAVE_PETSC_
+ 	int solver_type;
+Index: ../trunk-jpl/src/c/cores/balancethickness_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/balancethickness_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/balancethickness_core.cpp	(revision 26468)
+@@ -11,7 +11,6 @@
+ 
+ void balancethickness_core(FemModel* femmodel){
+ 
+-
+ 	/*recover parameters: */
+ 	bool save_results;
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 26468)
+@@ -142,7 +142,7 @@
+ 
+ 	/*Update control input*/
+ 	SetControlInputsFromVectorx(femmodel,X);
+-	
++
+ 	/*solve forward: */
+ 	switch(solution_type){
+ 		case SteadystateSolutionEnum:
+@@ -151,7 +151,7 @@
+ 			break;
+ 		case StressbalanceSolutionEnum:{
+ 			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+-			
++
+ 			bool is_schur_cg_solver = false;
+ 			#ifdef _HAVE_PETSC_
+ 			int solver_type;
+@@ -158,7 +158,7 @@
+ 			PetscOptionsDetermineSolverType(&solver_type);
+ 			if(solver_type==FSSolverEnum) is_schur_cg_solver = true;
+ 			#endif
+-			
++
+ 			if(is_schur_cg_solver){
+ 			 solutionsequence_schurcg(femmodel);
+ 			}else{
+Index: ../trunk-jpl/src/c/cores/dakota_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/dakota_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/dakota_core.cpp	(revision 26468)
+@@ -226,7 +226,7 @@
+ 	/*output for this core:*/
+ 	if(VerboseQmu()) _printf0_("outputing results for this core:\n");
+ 	OutputResultsx(femmodel);
+-	
++
+ 	/*Free ressources:*/
+ 	DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors);
+ 
+Index: ../trunk-jpl/src/c/cores/esa_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/esa_core.cpp	(revision 26468)
+@@ -113,7 +113,7 @@
+ 		delete U_y; 
+ 		if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
+ 	}
+-	
++
+ 	/*End profiler*/
+ 	femmodel->profiler->Stop(ESACORE);
+ 
+Index: ../trunk-jpl/src/c/cores/love_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/love_core.cpp	(revision 26468)
+@@ -19,7 +19,7 @@
+ 		IssmDouble* EarthMass; 
+ 		int nyi; 
+ 		int starting_layer;
+-		
++
+ 		LoveVariables(){  /*{{{*/
+ 			g0=0;
+ 			r0=0;
+@@ -244,7 +244,7 @@
+ 	femmodel->parameters->FindParam(&mu0,LoveMu0Enum);
+ 	femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum);
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+-	
++
+ 	g0=vars->g0;
+ 	r0=vars->r0;
+ 	starting_layer=vars->starting_layer;
+@@ -391,7 +391,6 @@
+ 			   fgr=4.0*PI*GG*ro*ra/g0;
+ 			   fn=(deg*(deg+1.0));
+ 
+-
+ 			   if(issolid==1){
+ 			   ny = 6;
+ 
+@@ -651,7 +650,6 @@
+ 		xmin=matlitho->radius[i]/ra;
+ 		xmax=(matlitho->radius[i+1])/ra;
+ 
+-
+ 		if (matlitho->issolid[i]){
+ 			ny = 6;
+ 			is = 0;
+@@ -662,7 +660,6 @@
+ 			one= -1.0;
+ 		}
+ 
+-
+ 		for (int j = 0;j<ny;j++){
+ 			for (int k=0;k<6;k++){ystart[k]=0.0;}
+ 			ystart[j]= 1.0;
+@@ -679,7 +676,6 @@
+ 			}
+ 		}
+ 
+-
+ 		// Boundary Condition matrix - solid regions
+ 		if (matlitho->issolid[i]){
+ 			one = -1.0;
+@@ -711,7 +707,6 @@
+ 		ici = ici+1;
+ 	}
+ 
+-
+ 	//-- Internal sphere: integration starts here rather than r=0 for numerical reasons
+ 	Innersphere_boundaryconditions<doubletype>(yi, starting_layer, deg, omega, femmodel, matlitho,vars);
+ 
+@@ -855,9 +850,9 @@
+ 		int nrhs=1; // number of right hand size columns
+ 
+ 		allgesv<doubletype>(&nyi, &nrhs, yilocal, &lda, ipiv, rhslocal, &ldb, &info);
+-		
++
+ 		xDelete<int>(ipiv);
+-		
++
+ 		if(VerboseModule() && info!=0){ 
+ 			_printf0_("love core warning in DGESV : LAPACK linear equation solver couldn't resolve the system");
+ 			_printf_("i j yi[i+nyi*j] rhs[i]");
+@@ -972,7 +967,7 @@
+ 	int         numlayers  = matlitho->numlayers;
+ 	IssmDouble* r          = matlitho->radius;
+ 	IssmDouble  r1,r2,ro, GG;
+-	
++
+ 	/*outputs:*/
+ 	IssmDouble* EarthMass=NULL;
+ 	IssmDouble  g0,r0;
+@@ -996,7 +991,7 @@
+ 	r0=r[numlayers];
+ 	nyi=6*(numlayers+1);
+ 	starting_layer=0;
+-	
++
+ 	return new LoveVariables(EarthMass,g0,r0,nyi,starting_layer);
+ 
+ } /*}}}*/
+@@ -1018,7 +1013,7 @@
+ 	doubletype*  LoveKf = NULL;
+ 	doubletype*  LoveHf = NULL;
+ 	doubletype*  LoveLf = NULL;
+-	
++
+ 	doubletype*  LoveKernels= NULL;
+ 	LoveVariables* vars=NULL;
+ 	doubletype* yi_prefactor=NULL;
+@@ -1051,7 +1046,6 @@
+ 	femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum);
+ 	femmodel->parameters->FindParam(&complex_computation,LoveComplexComputationEnum);
+ 
+-
+ 	/*Initialize three love matrices: geoid, vertical and horizontal displacement (real and imaginary parts) */
+ 	LoveKf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
+ 	LoveHf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1));
+@@ -1097,11 +1091,9 @@
+ 		}
+ 	}
+ 
+-
+ 	xDelete<doubletype>(yi);
+ 	xDelete<doubletype>(yi_righthandside);
+ 
+-
+ 	//Temporal love numbers
+ 	if (istemporal && !complex_computation){
+ 
+@@ -1144,7 +1136,7 @@
+ 		xDelete<IssmDouble>(LoveHtDouble);
+ 		xDelete<IssmDouble>(LoveKtDouble);
+ 		xDelete<IssmDouble>(LoveLtDouble);
+-	
++
+ 		/*Add into external results, no need to downcast, we can handle complexes/quad precision: */
+ 		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKrEnum,LoveKt,sh_nmax+1,nt,0,0));
+ 		femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveHrEnum,LoveHt,sh_nmax+1,nt,0,0));
+@@ -1225,7 +1217,6 @@
+ 	//		matlitho->burgers_viscosity, matlitho->burgers_mu, matlitho->density, matlitho->rheologymodel, matlitho->issolid //matlitho inputs
+ 	//		);
+ 
+-
+ 	/*Only when love_kernels is on*/
+ 	//if (love_kernels==1) {
+ 		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsEnum,LoveKernelsr,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+@@ -1232,7 +1223,6 @@
+ 		//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0));
+ 	//}
+ 
+-
+ 	/*Add love matrices to results:*/
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKrEnum,LoveKr,sh_nmax+1,nfreq,0,0));
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHrEnum,LoveHr,sh_nmax+1,nfreq,0,0));
+@@ -1241,8 +1231,6 @@
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHi,sh_nmax+1,nfreq,0,0));
+ 	//femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLi,sh_nmax+1,nfreq,0,0));
+ 
+-
+-
+ 	//xDelete<IssmDouble>(LoveKr);
+ 	//xDelete<IssmDouble>(LoveHr);
+ 	//xDelete<IssmDouble>(LoveLr);
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 26468)
+@@ -76,7 +76,7 @@
+ 			//}
+ 		}
+ 		SolidEarthIceUpdates(femmodel);
+-		
++
+ 		femmodel->parameters->SetParam(ThicknessEnum,InputToExtrudeEnum);
+ 		extrudefrombase_core(femmodel);
+ 		femmodel->parameters->SetParam(BaseEnum,InputToExtrudeEnum);
+@@ -83,7 +83,7 @@
+ 		extrudefrombase_core(femmodel);
+ 		femmodel->parameters->SetParam(SurfaceEnum,InputToExtrudeEnum);
+ 		extrudefrombase_core(femmodel);
+-		
++
+ 	}
+ 
+ 	if(save_results){
+@@ -111,7 +111,7 @@
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+-	
++
+ 	/*early return?:*/
+ 	if(!isgrd)return;
+ 
+Index: ../trunk-jpl/src/c/cores/movingfront_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/movingfront_core.cpp	(revision 26468)
+@@ -10,7 +10,7 @@
+ #include "../modules/modules.h"
+ 
+ void movingfront_core(FemModel* femmodel){
+-	
++
+ 	/*Start profiler*/
+ 	femmodel->profiler->Start(MOVINGFRONTCORE);
+ 
+@@ -47,7 +47,6 @@
+ 		}
+ 	}
+ 
+-
+ 	/* start the work from here */
+ 	if(VerboseSolution()) _printf0_("   computing calving and undercutting\n");
+ 	Calvingx(femmodel);
+Index: ../trunk-jpl/src/c/cores/oceantransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/oceantransport_core.cpp	(revision 26468)
+@@ -50,7 +50,7 @@
+ 
+ 	/*profiler*/
+ 	femmodel->profiler->Stop(OCEANTRANSPORTCORE);
+-	
++
+ 	/*free ressources:*/
+ 	delete ug;
+ 
+@@ -68,7 +68,7 @@
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+-	
++
+ 	/*early return?:*/
+ 	if(!isgrd)return;
+ 
+Index: ../trunk-jpl/src/c/cores/sealevelchange_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/sealevelchange_core.cpp	(revision 26468)
+@@ -8,7 +8,6 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-
+ #include "./cores.h"
+ #include "../toolkits/toolkits.h"
+ #include "../classes/classes.h"
+@@ -43,7 +42,7 @@
+ 
+ 	/*Retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-	
++
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("   computing sea level change\n");
+ 
+@@ -52,7 +51,7 @@
+ 
+ 	/*run geometry core: */
+ 	slgeom=sealevelchange_geometry(femmodel);
+-	
++
+ 	/*any external forcings?:*/
+ 	solidearthexternal_core(femmodel);
+ 
+@@ -96,7 +95,7 @@
+ 	int horiz=0;
+ 	int modelid=-1;
+ 	int  isexternal=0;
+- 
++
+ 	/*parameters: */
+ 	IssmDouble          dt;
+ 
+@@ -104,7 +103,7 @@
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	femmodel->parameters->FindParam(&isexternal,SolidearthIsExternalEnum); 
+-	
++
+ 	/*Early return:*/
+ 	if (!isexternal)return;
+ 
+@@ -118,7 +117,7 @@
+ 		GetVectorFromInputsx(&bedrockeast,femmodel,BedEastEnum,VertexSIdEnum);
+ 		GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum);
+ 	}
+-	
++
+ 	GetVectorFromInputsx(&geoid_rate,femmodel,SolidearthExternalGeoidRateEnum,VertexSIdEnum);
+ 	GetVectorFromInputsx(&bedrock_rate,femmodel,SolidearthExternalDisplacementUpRateEnum,VertexSIdEnum);
+ 	if(horiz){
+@@ -155,7 +154,7 @@
+ 
+ 	/*Be very careful here, everything is well thought through, do not remove 
+ 	 * without taking big risks:*/
+-	
++
+ 	/*parameters:*/
+ 	int  iscoupling;
+ 	int  modelid,earthid;
+@@ -198,7 +197,7 @@
+ 
+ 	/*transer loads from basins to Earth for grd core computations. :*/
+ 	if(iscoupling){
+-	
++
+ 		/*transfer ice thickness change load from basins to earth: */
+ 		TransferForcing(femmodel,DeltaIceThicknessEnum);
+ 		TransferForcing(femmodel,DeltaBottomPressureEnum);
+@@ -212,7 +211,7 @@
+ 			TransferSealevel(femmodel,BedNorthEnum);
+ 		}
+ 	}
+-	
++
+ }; /*}}}*/
+ void              grd_core(FemModel* femmodel, SealevelGeometry* slgeom) { /*{{{*/
+ 
+@@ -221,7 +220,7 @@
+ 	BarystaticContributions* barycontrib=NULL;
+ 	GenericParam<BarystaticContributions*>* barycontribparam=NULL;
+ 	IssmDouble polarmotionvector[3]={0};
+-	
++
+ 	GrdLoads*              loads=NULL;
+ 	Vector<IssmDouble>*    oldsealevelloads=NULL;
+ 	Vector<IssmDouble>*    oceanareas=NULL;
+@@ -303,7 +302,7 @@
+ 	sealevelpercpu=xNewZeroInit<IssmDouble>(femmodel->vertices->Size());
+ 
+ 	if(VerboseSolution()) _printf0_("	  starting  GRD convolutions\n");
+-	
++
+ 	/*update viscous RSL:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+@@ -340,7 +339,7 @@
+ 			Element* element = xDynamicCast<Element*>(object);
+ 			element->SealevelchangeConvolution(sealevelpercpu, loads , polarmotionvector,slgeom);
+ 		}
+-		
++
+ 		/*retrieve sea level average  and ocean area:*/
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element = xDynamicCast<Element*>(object);
+@@ -348,7 +347,7 @@
+ 		}
+ 
+ 		loads->AssembleSealevelLoads();
+-	
++
+ 		/*compute ocean areas:*/
+ 		if(!loads->sealevelloads){ //first time in the loop
+ 			oceanareas->Assemble(); 
+@@ -356,7 +355,7 @@
+ 			oceanareas->Sum(&totaloceanarea); _assert_(totaloceanarea>0.);
+ 			if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2
+ 		}
+-	
++
+ 		//Conserve ocean mass: 
+ 		oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, totaloceanarea);
+ 		ConserveOceanMass(femmodel,loads,barycontrib->Total()/totaloceanarea - oceanaverage,slgeom);
+@@ -376,7 +375,7 @@
+ 	}
+ 
+ 	deformation:
+-	
++
+ 	if(VerboseSolution()) _printf0_("	  deformation GRD convolutions\n");
+ 
+ 	/*convolve loads and sea level loads to get the deformation:*/
+@@ -402,7 +401,7 @@
+ 			subelementoceanareas->Assemble();
+ 			oceanareas->Sum(&totaloceanarea); _assert_(totaloceanarea>0.);
+ 			if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2
+-				
++
+ 			//Conserve ocean mass
+ 			//Note that here we create sea-level loads but they will not generate GRD as we have already run all the convolutions
+ 			oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, totaloceanarea);
+@@ -453,7 +452,7 @@
+ 	/*early return if we have no ocean transport:*/
+ 	femmodel->parameters->FindParam(&isocean,TransientIsoceantransportEnum);
+ 	if(!isocean)return;
+-	
++
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing steric and dynamic sea level change\n");
+ 
+@@ -476,7 +475,7 @@
+ 
+ 	femmodel->parameters->SetParam(cumgmtslc,CumGmtslcEnum);
+ 	femmodel->parameters->SetParam(cumgmslc,CumGmslcEnum);
+-	
++
+ 	/*Outputs some metrics:*/
+ 	femmodel->parameters->FindParam(&step,StepEnum);
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+@@ -495,7 +494,7 @@
+ }
+ /*}}}*/
+ void              coupleroutput_core(FemModel* femmodel){  /*{{{*/
+-	
++
+ 	/*parameters:*/
+ 	int iscoupling;
+ 	int horiz=0;
+@@ -503,7 +502,7 @@
+ 	/*retrieve more parameters:*/
+ 	femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum);
+ 	femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-		
++
+ 	if(iscoupling){
+ 		/*transfer sea level back to ice caps:*/
+ 		TransferSealevel(femmodel,SealevelEnum);
+@@ -521,7 +520,7 @@
+ 	Vector<IssmDouble> *beduprate= NULL; 
+ 	IssmDouble          *xx     = NULL;
+ 	IssmDouble          *yy     = NULL;
+-	
++
+ 	if(VerboseSolution()) _printf0_("	  computing vertical deformation using Ivins model. \n");
+ 
+ 	/*find size of vectors:*/
+@@ -540,7 +539,7 @@
+ 	/*initialize vectors:*/
+ 	bedup = new Vector<IssmDouble>(gsize);
+ 	beduprate = new Vector<IssmDouble>(gsize);
+-	
++
+ 	/*retrieve geometric information: */
+ 	VertexCoordinatesx(&xx,&yy,NULL,femmodel->vertices); 
+ 
+@@ -580,7 +579,7 @@
+ 	/*retrieve parameters:*/
+ 	femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
+ 	nel=femmodel->elements->NumberOfElements();
+-		
++
+ 	/*early return?:*/
+ 	if(grdmodel==IvinsEnum) return;
+ 
+@@ -601,7 +600,6 @@
+ 	femmodel->parameters->AddObject(new DoubleVecParam(ZzeEnum,zze,nel));
+ 	femmodel->parameters->AddObject(new DoubleVecParam(AreaeEnum,areae,nel));
+ 
+-
+ 	#ifdef _ISSM_DEBUG_
+ 	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,XxeEnum,xxe,nel,1,1,1));
+ 	femmodel->results->AddResult(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,YyeEnum,yye,nel,1,1,1));
+@@ -611,7 +609,6 @@
+ 
+ 	return;
+ 
+-
+ }/*}}}*/
+ SealevelGeometry* sealevelchange_geometry(FemModel* femmodel) {  /*{{{*/
+ 
+@@ -637,24 +634,22 @@
+ 	femmodel->parameters->FindParam(&yye,&nel,YyeEnum);
+ 	femmodel->parameters->FindParam(&zze,&nel,ZzeEnum);
+ 	femmodel->parameters->FindParam(&areae,&nel,AreaeEnum);
+-	
++
+ 	/*initialize SealevelloadMasks structure: */
+ 	slgeom=new SealevelGeometry(femmodel->elements->Size(),femmodel->vertices->Size());
+-	
++
+ 	/*Verbose: */
+ 	if(VerboseSolution()) _printf0_("	  computing sea level geometrical kernel and weight updates.\n");
+-	
+-	
++
+ 	/*Run sealevel geometry routine for elements with full loading:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+ 		element->SealevelchangeGeometryCentroidLoads(slgeom,xxe,yye,zze,areae);
+ 	}
+-	
++
+ 	/*Initialize fractional loading mapping: */
+ 	slgeom->InitializeMappingsAndBarycentres();
+ 
+-	
+ 	/*Run sealevel geometry routine for elements with fractional loading:*/
+ 	for(Object* & object : femmodel->elements->objects){
+ 		Element*   element=xDynamicCast<Element*>(object);
+@@ -670,7 +665,6 @@
+ 		element->SealevelchangeGeometrySubElementKernel(slgeom);
+ 	}
+ 
+-
+ 	femmodel->parameters->AddObject(new DoubleVecParam(XxeEnum,xxe,nel));
+ 	femmodel->parameters->AddObject(new DoubleVecParam(YyeEnum,yye,nel));
+ 	femmodel->parameters->AddObject(new DoubleVecParam(ZzeEnum,zze,nel));
+@@ -737,12 +731,12 @@
+ 
+ 	vsealevelloadsvolume->PointwiseMult(loads->vsealevelloads,oceanareas);
+ 	vsubsealevelloadsvolume->PointwiseMult(loads->vsubsealevelloads,suboceanareas);
+-	
++
+ 	vsealevelloadsvolume->Sum(&sealevelloadsaverage);
+ 	vsubsealevelloadsvolume->Sum(&subsealevelloadsaverage);
+ 	delete vsealevelloadsvolume; 
+ 	delete vsubsealevelloadsvolume; 
+-	
++
+ 	return (sealevelloadsaverage+subsealevelloadsaverage)/totaloceanarea;
+ } /*}}}*/
+ void PolarMotion(IssmDouble* polarmotionvector, FemModel* femmodel,GrdLoads* loads, SealevelGeometry* slgeom){ /*{{{*/
+@@ -757,7 +751,7 @@
+ 	IssmDouble  moi_e, moi_p;
+ 	IssmDouble	m1, m2, m3;
+ 	bool rotation=false;
+-	
++
+ 	/*early return?:*/
+ 	femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+ 	if(!rotation)return;
+@@ -785,10 +779,10 @@
+ 
+ 	ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+ 	ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	
++
+ 	ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+ 	ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	
++
+ 	ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+ 	ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 
+@@ -816,14 +810,13 @@
+ 
+ 	int* indices=xNew<int>(nel);
+ 	for(int i=0;i<nel;i++)indices[i]=i;
+-	
++
+ 	Vector<IssmDouble>* vloadcopy=new Vector<IssmDouble>(nel);
+ 	IssmDouble* loadcopy=xNew<IssmDouble>(nel);
+-	
++
+ 	vloadcopy->SetValues(nel,indices,load,INS_VAL);
+ 	vloadcopy->Assemble();
+ 
+-
+ 	if(subload){
+ 		for (int i=0;i<femmodel->elements->Size();i++){
+ 			if (slgeom->issubelement[loadtype][i]){
+Index: ../trunk-jpl/src/c/main/esmfbinders.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/esmfbinders.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/main/esmfbinders.cpp	(revision 26468)
+@@ -114,7 +114,7 @@
+ 						/*Recover surface from the ISSM element: */
+ 						Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input);
+ 						surface_input->GetInputAverage(&surface);
+-			
++
+ 						*(issmoutputs+f*numberofelements+i) = surface;
+ 
+ 						}
+Index: ../trunk-jpl/src/c/main/issm.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/issm.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/main/issm.cpp	(revision 26468)
+@@ -14,7 +14,7 @@
+ 
+ 	/*Initialize femmodel from arguments provided command line: */
+ 	FemModel *femmodel = new FemModel(argc,argv,comm_init);
+-	
++
+ 	/*Need to know we are firing up from ISSM main, not a coupler driver like issm_slcp or issm_ocean:*/
+ 	femmodel->parameters->AddObject(new IntParam(IsSlcCouplingEnum,0));
+ 
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 26468)
+@@ -27,8 +27,6 @@
+ 	}
+ }
+ 
+-
+-
+ void InputUpdateFromConstantx(FemModel* femmodel,IssmDouble constant, int name){
+ 
+ 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
+@@ -83,7 +81,6 @@
+ 	}
+ 	else _error_("InputUpdateFromConstantx error message: type not supported yet!");
+ 
+-	
+ }
+ void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,bool constant, int name){
+ 
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 26468)
+@@ -48,7 +48,6 @@
+ 
+ 		descriptor=variables_descriptors[i];
+ 
+-
+ 		/*From descriptor, figure out if the variable is scaled, indexed, distributed or just a simple variable: */
+ 		if (strncmp(descriptor,"scaled_",7)==0){
+ 			/*we are skipping these for now.*/
+@@ -166,7 +165,6 @@
+ 			_printf0_("\n");
+ 		}
+ 
+-
+ 		if (femmodel->inputs->GetInputObjectEnum(MasstransportSpcthicknessEnum)==DatasetInputEnum)
+ 			MmeToInput(femmodel,distributed_values,variable_partition,npart,MasstransportSpcthicknessEnum, P0Enum);
+ 
+@@ -285,5 +283,4 @@
+ 			break;
+ 	}
+ 
+-
+ } /*}}}*/
+Index: ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp	(revision 26468)
+@@ -7,7 +7,6 @@
+ #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+ #endif
+ 
+-
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../classes/classes.h"
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 26468)
+@@ -288,7 +288,6 @@
+ 			}
+ 			N_all[i] = N;
+ 
+-
+ 			for(Object* & object : elements->objects){
+ 				Element* element=xDynamicCast<Element*>(object);
+ 				element->ControlInputCreate(independent,independents_min,independents_max,inputs,iomodel,M,N,1.,input_enum,i+1);
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 26468)
+@@ -716,7 +716,7 @@
+ 				xDelete<int>(cost_functions_weights_M);
+ 				xDelete<int>(cost_functions_weights_N);
+ 				xDelete<IssmDouble*>(cost_functions_weights);
+-			
++
+ 			/*}}}*/
+ 			}
+ 			else if (output_definition_enums[i]==RadarEnum){		
+Index: ../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp	(revision 26468)
+@@ -24,7 +24,6 @@
+ 	int         solutiontype;
+ 	char*       solutiontypestring      = NULL;
+ 
+-
+ 	/*recover my_rank:*/
+ 	my_rank=IssmComm::GetRank();
+ 
+@@ -70,7 +69,7 @@
+ 				bool statistics=false;
+ 				char* root=NULL;
+ 				char* modelname=NULL;
+-				
++
+ 				femmodel->parameters->FindParam(&currEvalId,QmuCurrEvalIdEnum);
+ 				femmodel->parameters->FindParam(&statistics,QmuStatisticsEnum);
+ 
+Index: ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp	(revision 26468)
+@@ -19,7 +19,7 @@
+ 	char*       sfield    = NULL;
+ 	IssmDouble* dmatfield = NULL; 
+ 	int*        imatfield = NULL; 
+-			
++
+ 	//type of the returned field: 
+ 	int type;
+ 	int found=0;
+@@ -108,7 +108,7 @@
+ 	int nbins;
+ 	int range,lower_row,upper_row;
+ 	int nfilesperdirectory;
+-	
++
+ 	/*intermediary:*/
+ 	IssmDouble* doublemat=NULL;
+ 	int         doublematsize;
+@@ -236,7 +236,7 @@
+ 			fseek(fid,0,SEEK_SET);
+ 			char* field=fields[f];
+ 			meanxtype[f]=readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[0]);
+-			
++
+ 			if(meanxtype[f]==1){
+ 				meanxsize[f]=1;
+ 				IssmDouble timemean=0;
+@@ -245,7 +245,7 @@
+ 					readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[j]);
+ 					timemean+=scalar/nsteps;
+ 				}
+-					
++
+ 				/*Figure out max and min of time means: */
+ 				if(i==(lower_row+1)){
+ 					maxmeans[f]=xNewZeroInit<IssmDouble>(1); 
+@@ -333,7 +333,7 @@
+ 
+ 				IssmDouble*  allmax=xNew<IssmDouble>(size);
+ 				IssmDouble*  allmin=xNew<IssmDouble>(size);
+-				
++
+ 				ISSM_MPI_Allreduce(maxx,allmax,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MAX,IssmComm::GetComm());
+ 				ISSM_MPI_Allreduce(minx,allmin,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MIN,IssmComm::GetComm());
+ 
+@@ -343,7 +343,7 @@
+ 			}
+ 		} /*}}}*/
+ 	}
+-	
++
+ 	/*Now do the same for the time mean fields:*/
+ 	for (int f=0;f<nfields;f++){
+ 		if (meanxtype[f]==1){ /*deal with scalars {{{*/
+@@ -376,7 +376,6 @@
+ 			ISSM_MPI_Allreduce(maxx,allmax,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MAX,IssmComm::GetComm());
+ 			ISSM_MPI_Allreduce(minx,allmin,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MIN,IssmComm::GetComm());
+ 
+-			
+ 			/*Store for later use in histogram computation:*/
+ 			maxmeans[f]=allmax;
+ 			minmeans[f]=allmin;
+@@ -487,7 +486,7 @@
+ 			fseek(fid,0,SEEK_SET);
+ 			char* field=fields[f];
+ 			meanxtype[f]=readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[0]);
+-			
++
+ 			if(meanxtype[f]==1){
+ 				IssmDouble timemean=0;
+ 				fseek(fid,0,SEEK_SET);
+@@ -495,7 +494,7 @@
+ 					readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[j]);
+ 					timemean+=scalar/nsteps;
+ 				}
+-					
++
+ 				/*Figure out max and min of time means: */
+ 				if(i==(lower_row+1)){
+ 					IssmDouble* localhistogram=xNewZeroInit<IssmDouble>(nbins); 
+@@ -530,7 +529,7 @@
+ 					IssmDouble* localhistogram=xNewZeroInit<IssmDouble>(doublematsize*nbins);
+ 					IssmDouble* ma=maxmeans[f];
+ 					IssmDouble* mi=minmeans[f];
+-					
++
+ 					for (int k=0;k<doublematsize;k++){
+ 						IssmDouble scalar=timemean[k];
+ 						int index=(scalar-mi[k])/(ma[k]-mi[k])*nbins; if (index==nbins)index=nbins-1;
+@@ -540,11 +539,11 @@
+ 					timehistogram[f]=localhistogram;
+ 				}
+ 				else{
+-					
++
+ 					IssmDouble* localhistogram=timehistogram[f];
+ 					IssmDouble* ma=maxmeans[f];
+ 					IssmDouble* mi=minmeans[f];
+-					
++
+ 					for (int k=0;k<doublematsize;k++){
+ 						IssmDouble scalar=timemean[k];
+ 						int index=(scalar-mi[k])/(ma[k]-mi[k])*nbins; if (index==nbins)index=nbins-1;
+@@ -599,7 +598,7 @@
+ 				/*we are broadcasting double arrays:*/
+ 				IssmDouble* histo=histogram[counter];
+ 				IssmDouble* allhisto=xNew<IssmDouble>(size*nbins);
+-				
++
+ 				ISSM_MPI_Allreduce(histo,allhisto,size*nbins,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+ 				xDelete<IssmDouble>(histo);
+ 
+@@ -619,7 +618,7 @@
+ 		} /*}}}*/
+ 	}
+ 	_printf0_("Start aggregating time mean histogram:\n");
+-	
++
+ 	/*Now do the same for the time mean fields:*/
+ 	for (int f=0;f<nfields;f++){
+ 		if (meanxtype[f]==1){ /*deal with scalars {{{*/
+@@ -683,7 +682,7 @@
+ 	int nfields;
+ 	int range,lower_row,upper_row;
+ 	int nfilesperdirectory;
+-	
++
+ 	/*intermediary:*/
+ 	IssmDouble* doublemat=NULL;
+ 	int         doublematsize;
+@@ -805,7 +804,7 @@
+ 				}
+ 			}
+ 		}
+-		
++
+ 		/*Deal with time mean: */
+ 		for (int f=0;f<nfields;f++){
+ 			char* field=fields[f];
+@@ -916,7 +915,7 @@
+ 
+ 				IssmDouble*  sumx=xNew<IssmDouble>(size);
+ 				IssmDouble*  sumx2=xNew<IssmDouble>(size);
+-				
++
+ 				ISSM_MPI_Reduce(x,sumx,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
+ 				ISSM_MPI_Reduce(x2,sumx2,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
+ 
+@@ -979,7 +978,7 @@
+ 
+ 			IssmDouble*  sumx=xNew<IssmDouble>(size);
+ 			IssmDouble*  sumx2=xNew<IssmDouble>(size);
+-				
++
+ 			ISSM_MPI_Reduce(x,sumx,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
+ 			ISSM_MPI_Reduce(x2,sumx2,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
+ 
+@@ -1020,7 +1019,7 @@
+ 	int nfilesperdirectory;
+ 	int* indices=NULL;
+ 	int  nindices;
+-	
++
+ 	/*intermediary:*/
+ 	IssmDouble* doublemat=NULL;
+ 	int         doublematsize;
+@@ -1142,7 +1141,7 @@
+ 				/*add to results:*/
+ 				if(my_rank==0){
+ 					char fieldname[1000];
+-					
++
+ 					sprintf(fieldname,"%s%s",fields[f],"Samples");
+ 					results->AddResult(new GenericExternalResult<IssmPDouble*>(results->Size()+1,fieldname,allx,nsamples,1,j+1,0));
+ 				}
+@@ -1151,9 +1150,9 @@
+ 				/*we are broadcasting double arrays:*/
+ 				x=xs[counter];
+ 				allx=xNew<IssmDouble>(nsamples*nindices);
+-				
++
+ 				MPI_Gather(x, range*nindices, ISSM_MPI_PDOUBLE,allx, range*nindices, ISSM_MPI_PDOUBLE, 0, IssmComm::GetComm());
+-				
++
+ 				/*add to results:*/
+ 				if(my_rank==0){
+ 					char fieldname[1000];
+@@ -1182,7 +1181,7 @@
+ 	if (color==MPI_UNDEFINED)return 0;
+ 
+ 	FemModel* femmodel=new FemModel();
+-	
++
+ 	/*Some parameters that will allow us to use the OutputResultsx module:*/
+ 	parameters->AddObject(new BoolParam(QmuIsdakotaEnum,false));
+ 	parameters->AddObject(new BoolParam(SettingsIoGatherEnum,true));
+@@ -1326,10 +1325,10 @@
+ 		/*Initialize parameters and results:*/
+ 		results   = new Results();
+ 		parameters=new Parameters();
+-		
++
+ 		//solution type: 
+ 		parameters->AddObject(new IntParam(SolutionTypeEnum,StatisticsSolutionEnum));
+-	
++
+ 		//root  directory
+ 		directory=xNew<char>(strlen(argv[2])+1);
+ 		xMemCpy<char>(directory,argv[2],strlen(argv[2])+1);
+@@ -1358,7 +1357,6 @@
+ 		else color=0;
+ 		ISSM_MPI_Comm_split(ISSM_MPI_COMM_WORLD,color, my_rank, &statcomm);
+ 
+-
+ 		iomodel->FindConstant(&numstatistics,"md.qmu.statistics.numstatistics");
+ 		for (int i=1;i<=numstatistics;i++){
+ 
+@@ -1366,7 +1364,7 @@
+ 			char* model=NULL;
+ 			int   nsamples;
+ 			_printf0_("Dealing with qmu statistical computation #" << i << "\n");
+-		
++
+ 			sprintf(string,"md.qmu.statistics.method(%i).name",i);
+ 			iomodel->FindConstant(&name,string);
+ 
+@@ -1390,7 +1388,7 @@
+ 				sprintf(string,"md.qmu.statistics.method(%i).indices",i);
+ 				iomodel->FetchData(&indices,&dummy,&nindices,string);
+ 				parameters->AddObject(new IntVecParam(IndicesEnum,indices,nindices));
+-		
++
+ 				ComputeSampleSeries(parameters,results,color,statcomm);
+ 			}
+ 			else if (strcmp(name,"MeanVariance")==0){
+@@ -1409,7 +1407,7 @@
+ 
+ 	/*output results:*/
+ 	OutputStatistics(parameters,results,color,statcomm);
+-	
++
+ 	/*all meet here: */
+ 	ISSM_MPI_Barrier(ISSM_MPI_COMM_WORLD); _printf0_("Output file.\n");
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26468)
+@@ -1617,7 +1617,7 @@
+ 	}
+ 
+ 	//// MELT, PERCOLATION AND REFREEZE
+-	
++
+ 	// initialize refreeze, runoff, flxDn and dW vectors [kg]
+ 	IssmDouble* F = xNewZeroInit<IssmDouble>(n);
+ 
+@@ -1706,7 +1706,7 @@
+ 			if (d[i] >= dPHC-Dtol){
+ 				for(int l=i;(l<n && d[l]>=dPHC-Dtol);l++) depthice=depthice+dz[l];
+ 			}
+-			
++
+ 			// break loop if there is no meltwater and if depth is > mw_depth
+ 			if (fabs(inM) < Wtol && i > X){
+ 				break;
+Index: ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 26468)
+@@ -31,7 +31,7 @@
+   IssmDouble beta2 = 7.28;		// 8 mm IE/(d*deg C),  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
+   IssmDouble Pmax = 0.6;
+   IssmDouble inv_twelve=1./12.; 
+-  
++
+   sconv=(rho_water/rho_ice);		//rhow_rain/rhoi
+ 
+   /* FIXME betas shoud be user input */
+@@ -90,7 +90,7 @@
+ 	 IssmDouble coeff4= 4.66e-04;		// fifth-order
+ 	 IssmDouble coeff5=3.8e-05;		// polynomial
+ 	 IssmDouble coeff6=6.0e-07;		// fit
+-   
++
+ 	 if(tstar>=temp_rain)
+ 	  frac_solid = 0.0;
+ 	 else if(tstar<=temp_snow)
+@@ -99,7 +99,7 @@
+ 		 frac_solid=coeff1+tstar*(coeff2
+ 					 +tstar*(coeff3+tstar*(coeff4+tstar*(coeff5+tstar*coeff6))));
+ 	 }
+-	 
++
+ 	 snowfall=snowfall+precip_star*frac_solid*inv_twelve;
+   } 
+   /* end of seasonal loop */ 
+@@ -107,7 +107,7 @@
+   rainfall=precip-snowfall;
+   if(snowfall<0.0) snowfall=0.0;   // correction of
+   if(rainfall<0.0) rainfall=0.0;   // negative values
+-   
++
+   if(rainfall<=(Pmax*snowfall)){
+ 	  if((rainfall+beta1*pdd)<=(Pmax*snowfall)) {
+ 		  smelt_star = rainfall+beta1*pdd;
+@@ -125,7 +125,7 @@
+ 	  smelt      = beta2*pdd;
+ 	  runoff     = smelt+rainfall-Pmax*snowfall;
+   }
+-   
++
+   saccu = precip;	
+ 
+   /* asign output*/
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 26468)
+@@ -75,7 +75,7 @@
+ 		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,Kff,pf,uf,old_uf,eps_res,eps_rel,eps_abs);
+@@ -97,7 +97,7 @@
+ 				else converged=false;
+ 			}
+ 		}
+-		
++
+ 		/*Increase count: */
+ 		count++;
+ 		if(converged==true){
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 26468)
+@@ -32,7 +32,6 @@
+ 	PetscViewer				viewer;					/* Viewer for troubleshooting */
+ 	IssmPDouble				t1,t2;					/* Time measurement for bottleneck analysis */
+ 
+-	
+ 	double tmp1,tmp2,tmp3;
+ 	int tmpi;
+ 	double tmp4,tmp5,tmp6,tmp7;
+@@ -39,8 +38,6 @@
+ 
+ 	int noIt;
+ 
+-
+-
+ 	int precond = 0;
+ 
+ 	#if PETSC_VERSION_LT(3,2,0)
+@@ -49,7 +46,6 @@
+ 	PetscBool flag,flg;
+ 	#endif
+ 
+-
+ 	char ksp_type[50];
+ 	char pc_type[50];
+ 	int maxiter;
+@@ -70,7 +66,6 @@
+ 	PetscOptionsGetInt(NULL,PETSC_NULL,"-max_iter",&maxiter,NULL);
+ 	#endif
+ 
+-	
+ 	if(precond){
+ 		_printf0_("Running WITH preconditioner\n");
+ 	}else{
+@@ -77,10 +72,9 @@
+ 		_printf0_("Running WITHOUT preconditioner\n");
+ 	}
+ 
+-
+ 	/*Initialize output*/
+ 	Vector<IssmDouble>* out_uf=new Vector<IssmDouble>(uf0);
+-	
++
+ 	/* Extract block matrices from the saddle point matrix */
+ 	/* [ A   B ] = Kff
+     * [ B^T I ]
+@@ -96,7 +90,7 @@
+ 	MatGetSubMatrix(Kff,isv,isp,MAT_INITIAL_MATRIX,&B);
+ 	MatGetSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT);
+ 	#endif
+-	
++
+ 	/* Extract preconditioner matrix on the pressure space*/
+ 	#if PETSC_VERSION_GT(3,8,0)
+ 	MatCreateSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP);
+@@ -104,7 +98,6 @@
+ 	MatGetSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP);
+ 	#endif
+ 
+-
+ 	/* Get number of velocity / pressure nodes */
+ 	MatGetSize(B,&nu,&np);
+ 
+@@ -117,7 +110,6 @@
+ 	VecGetSubVector(out_uf->pvector->vector,isv,&uold);
+ 	VecGetSubVector(out_uf->pvector->vector,isp,&p);
+ 
+-
+ 	/* Set up intermediaries */
+ 	VecDuplicate(uold,&f1);VecSet(f1,0.0);
+ 	VecDuplicate(p,&f2);VecSet(f2,0.0);
+@@ -132,7 +124,7 @@
+ 	VecDuplicate(p,&gold);VecSet(gold,0.0);
+ 	VecDuplicate(p,&wnew);VecSet(wnew,0.0);
+ 	VecDuplicate(uold,&chi);VecSet(chi,0.0);
+-	
++
+ 	/* Get global RHS (for each block sub-problem respectively)*/
+ 	VecGetSubVector(pf,isv,&f1);
+ 	VecGetSubVector(pf,isp,&f2);
+@@ -142,7 +134,7 @@
+ 	/* Generate initial value for the velocity from the pressure */
+ 	/* a(u0,v) = f1(v)-b(p0,v)  i.e.  Au0 = F1-Bp0 */
+ 	/* u0 = u_DIR on \Gamma_DIR */
+-	
++
+ 	/* Create KSP context */
+ 	KSPCreate(IssmComm::GetComm(),&kspu);
+ 	#if PETSC_VERSION_GE(3,5,0)
+@@ -173,16 +165,14 @@
+ 	}else{
+ 		_error_("Suggested KSP method not implemented yet!\n");
+ 	}
+-	
++
+ 	KSPSetInitialGuessNonzero(kspu,PETSC_TRUE);
+-	
++
+ 	/*Strong rel. residual tolerance needed when solving for the velocity update. 
+ 	 * This is because ISSM uses the dimensional equations, so the initial guess chi = 0
+ 	 * results in a very high initial residual (~ 1e19)*/
+ 	KSPSetTolerances(kspu,ELLTOL,PETSC_DEFAULT,PETSC_DEFAULT,maxiter); //maxiter
+ 
+-
+-
+ 	KSPGetPC(kspu,&pcu);
+ 	if (strcmp(pc_type,"bjacobi")==0){
+ 		PCSetType(pcu,PCBJACOBI);
+@@ -209,7 +199,6 @@
+ 	}
+ 	KSPSetUp(kspu);
+ 
+-	
+ 	/* Create RHS */
+ 	/* RHS = F1-B * pold */
+ 	VecScale(p,-1.);MatMultAdd(B,p,f1,rhsu);VecScale(p,-1.);
+@@ -226,19 +215,15 @@
+ 		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);
+@@ -248,19 +233,15 @@
+ 	_printf0_("||BTu_00 - f2||_euc: " << tmp6 <<"\n");
+ 	}
+ 
+-
+-
+ 	/* Set up u_new */
+ 	VecDuplicate(uold,&unew);VecCopy(uold,unew);
+ 	VecAssemblyBegin(unew);VecAssemblyEnd(unew);
+ 
+-
+-
+ 	/* ------------------------------------------------------------- */
+ 
+ 	/*Get initial residual*/
+ 	/*(1/mu(x) * g0, q) = b(q,u0) - (f2,q)  i.e.  IP * g0 = BT * u0 - F2*/
+-	
++
+ 	/* Create KSP context */
+ 	KSPCreate(IssmComm::GetComm(),&kspip);
+ 	#if PETSC_VERSION_GE(3,5,0)
+@@ -268,17 +249,15 @@
+ 	#else
+ 	KSPSetOperators(kspip,IP,IP,DIFFERENT_NONZERO_PATTERN);
+ 	#endif
+-	
++
+ 	/* Create RHS */
+ 	/* RHS = BT * uold - F2 */
+ 	VecScale(uold,-1.);MatMultAdd(BT,uold,f2,rhsp);VecScale(uold,-1.);
+ 
+-
+ 	/* Set KSP & PC options */
+ 	KSPSetType(kspip,KSPGMRES);
+ 	KSPSetInitialGuessNonzero(kspip,PETSC_TRUE);
+-	
+-	
++
+ 	KSPGetPC(kspip,&pcp);
+ 	PCSetType(pcp,PCJACOBI);
+ 	/* Note: Systems in the pressure space are cheap, so we can afford a good tolerance */
+@@ -293,16 +272,12 @@
+ 		VecNorm(tmpp,NORM_2,&tmp4);
+ 	}
+ 
+-
+-
+ 	/* Go solve */
+ 	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);
+@@ -311,13 +286,11 @@
+ 	_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*/
+ 	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)
+ 	{
+@@ -326,7 +299,6 @@
+ 	VecDuplicate(gold,&gnew);VecCopy(gold,gnew);
+ 	VecAssemblyBegin(gnew);VecAssemblyEnd(gnew);
+ 
+-
+ 	/* ------------------------------------------------------------ */
+ 
+ 	/*Set initial search direction*/
+@@ -334,7 +306,6 @@
+ 	VecDuplicate(gold,&wold);VecCopy(gold,wold);
+ 	VecAssemblyBegin(wold);VecAssemblyEnd(wold);
+ 
+-
+ 	/* Count number of iterations */
+ 	int count = 0;
+ 
+@@ -350,65 +321,53 @@
+ 		/*chim_DIR = 0*/
+ 		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");
+ 		}
+ 
+-
+ 		/* ---------------------------------------------------------- */
+ 
+-
+ 		/*Set step size*/
+ 		/*rhom = [(wm)^T * IP^-1 * (BT * um - F2)]/[(wm)^T * IP^-1 * BT * chim]*/
+ 		MatMult(IP,gold,tmpp);
+ 		VecDot(tmpp,wold,&rho);
+-		
++
+ 		MatMult(BT,chi,tmpp);
+ 		VecDot(tmpp,wold,&tmpScalar);
+ 		rho = rho/tmpScalar;
+ 
+-
+ 		/* ---------------------------------------------------------- */
+ 
+-
+ 		/*Pressure update*/
+ 		/*p(m+1) = pm + rhom * wm*/
+ 		VecAXPY(p,-1.*rho,wold);
+ 
+-
+ 		/*Velocity update*/
+ 		/*u(m+1) = um - rhom * chim*/
+ 		VecWAXPY(unew,rho,chi,uold);
+ 		VecNorm(unew,NORM_2,&tmpScalar);
+ 
+-
+ 		if (VerboseConvergence())
+ 		{
+ 		VecScale(p,-1.);MatMultAdd(B,p,f1,rhsu);VecScale(p,-1.);
+@@ -421,8 +380,6 @@
+ 		_printf0_("Incompressibility norm: " << tmp7 <<"\n");
+ 		}
+ 
+-
+-
+ 		/* ---------------------------------------------------------- */
+ 
+ 		/*Residual update*/
+@@ -431,13 +388,11 @@
+ 		MatMult(IP,gold,tmpp2);
+ 		VecWAXPY(rhsp,-1.*rho,tmpp,tmpp2);
+ 		KSPSolve(kspip,rhsp,gnew);
+-		
+ 
+-
+ 		/* ---------------------------------------------------------- */
+ 
+ 		MatMult(IP,gnew,tmpp);
+-		
++
+ 		VecDot(tmpp,gnew,&gamma);
+ 		rnorm = sqrt(gamma);
+ 
+@@ -453,7 +408,7 @@
+ 		}else{
+ 			_printf0_("L2-Norm g: "<< rnorm << "\n");
+ 		}
+-	
++
+ 		/*Break prematurely if solver doesn't reach desired tolerance in reasonable time frame*/
+ 		if(count > 10./TOL)   
+ 		{ 
+@@ -460,11 +415,9 @@
+ 		 _printf0_("Ended after " << ceil(5./TOL) << " CG iterations\n");
+ 		 break;
+ 		}
+-	
+ 
+ 		/* ---------------------------------------------------------- */
+ 
+-
+ 		/*Directional update*/
+ 		MatMult(IP,gold,tmpp);
+ 		VecDot(tmpp,gold,&tmpScalar);
+@@ -474,7 +427,7 @@
+ 
+ 		/* Assign new to old iterates */
+ 		VecCopy(wnew,wold);VecCopy(gnew,gold);VecCopy(unew,uold);
+-		
++
+ 		count++;
+ 	}
+ 	}
+@@ -486,12 +439,11 @@
+ 	/*return output pointer*/
+ 	*puf=out_uf;
+ 
+-
+ 	/* Cleanup */
+ 	KSPDestroy(&kspu);KSPDestroy(&kspip);
+ 
+ 	MatDestroy(&A);MatDestroy(&B);MatDestroy(&BT);MatDestroy(&IP);
+-	
++
+ 	VecDestroy(&p);VecDestroy(&uold);VecDestroy(&unew);VecDestroy(&rhsu);VecDestroy(&rhsp);
+ 	VecDestroy(&gold);VecDestroy(&gnew);VecDestroy(&wold);VecDestroy(&wnew);VecDestroy(&chi);
+ 	VecDestroy(&tmpp);VecDestroy(&tmpu);VecDestroy(&f1);VecDestroy(&f2);
+@@ -521,7 +473,6 @@
+ 	int n_u,n_p;
+ 	double rnorm1, rnorm2;
+ 
+-
+ 	if(VerboseModule()) _printf0_("   checking convergence\n");
+ 
+ 	/*If uf is NULL in input, f-set is nil, model is fully constrained, therefore converged from 
+@@ -547,7 +498,7 @@
+ 	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*/
+ 		MatGetSize(B,&n_u,&n_p);
+ 
+@@ -559,7 +510,6 @@
+ 
+ 		VecGetSubVector(uf->pvector->vector,isv,&u);
+ 		VecGetSubVector(uf->pvector->vector,isp,&p);
+-		
+ 
+ 		/*Extract values of the RHS corresponding to the first/second block*/
+ 		VecDuplicate(u,&f1);VecSet(f1,1.0);
+@@ -572,16 +522,14 @@
+ 		VecDuplicate(u,&tmp);VecSet(tmp,1.0);
+ 		VecDuplicate(p,&res2);VecSet(res2,1.0);
+ 
+-
+ 	/*Display solver caracteristics*/
+ 	if (VerboseConvergence()){
+-		
++
+ 		/*Calculate res1 = A*u + B*p - f1*/
+ 		VecScale(f1,-1.);MatMultAdd(A,u,f1,tmp);MatMultAdd(B,p,tmp,res1);VecScale(f1,-1.);
+ 		/*Calculate res2 = B^T * u - f2*/
+ 		VecScale(f2,-1.);MatMultAdd(BT,u,f2,res2);VecScale(f2,-1.);
+ 
+-
+ 		/*compute norm(res1), norm(res2), norm(F) and residue*/
+ 		VecNorm(res1,NORM_2,&rnorm1);VecNorm(res2,NORM_2,&rnorm2);
+ 		nKUF=sqrt(rnorm1*rnorm1 + rnorm2*rnorm2);
+@@ -596,11 +544,10 @@
+ 	/*clean up*/
+ 	VecRestoreSubVector(uf->pvector->vector,isv,&u);
+ 	VecRestoreSubVector(uf->pvector->vector,isp,&p);
+-	
++
+ 	/*Extract values corresponding to velocity/pressure on the old solution*/
+ 	VecGetSubVector(old_uf->pvector->vector,isv,&uold);
+ 	VecGetSubVector(old_uf->pvector->vector,isp,&pold);
+-		
+ 
+ 	/*Force equilibrium (Mandatory)*/
+ 
+@@ -608,7 +555,7 @@
+ 	VecScale(f1,-1.);MatMultAdd(A,uold,f1,tmp);MatMultAdd(B,pold,tmp,res1);VecScale(f1,-1.);
+ 	/*Calculate res2 = B^T * uold - f2*/
+ 	VecScale(f2,-1.);MatMultAdd(BT,uold,f2,res2);VecScale(f2,-1.);
+-	
++
+ 	/*compute norm(res1), norm(res2), norm(F) and residue*/
+ 	VecNorm(res1,NORM_2,&rnorm1);VecNorm(res2,NORM_2,&rnorm2);
+ 	nKUoldF=sqrt(rnorm1*rnorm1 + rnorm2*rnorm2);
+@@ -625,9 +572,7 @@
+ 	VecDestroy(&res1);VecDestroy(&res2);VecDestroy(&tmp);
+ 	VecRestoreSubVector(old_uf->pvector->vector,isv,&uold);
+ 	VecRestoreSubVector(old_uf->pvector->vector,isp,&pold);
+-	
+ 
+-
+ 	//print
+ 	if(res<eps_res){
+ 		if(VerboseConvergence()) _printf0_(setw(50)<<left<<"   mechanical equilibrium convergence criterion"<<res*100<< " < "<<eps_res*100<<" %\n");
+@@ -720,7 +665,7 @@
+ 	int size;
+ 	int  count=0;
+ 	bool converged=false;
+-	
++
+ 	/*Start non-linear iteration using input velocity: */
+ 	GetSolutionFromInputsx(&ug,femmodel);
+ 	Reducevectorgtofx(&uf, ug, femmodel->nodes,femmodel->parameters);
+@@ -728,7 +673,7 @@
+ 	/*Update once again the solution to make sure that vx and vxold are similar*/
+ 	InputUpdateFromConstantx(femmodel,converged,ConvergedEnum);
+ 	InputUpdateFromSolutionx(femmodel,ug);
+-	
++
+ 	for(;;){
+ 
+ 		/*save pointer to old velocity*/
+@@ -746,9 +691,9 @@
+ 		#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)
+ 		{
+@@ -759,7 +704,7 @@
+ 				delete Ie;
+ 			}
+ 		}else{
+-			
++
+ 			for(Object* & object : femmodel->elements->objects){
+ 				Element* element2=xDynamicCast<Element*>(object);
+ 				ElementMatrix* Ie2 = analysis->CreatePressureMassMatrix(element2);
+@@ -768,9 +713,8 @@
+ 			}
+ 		}
+ 
+-	   		
+ 		delete analysis;
+-	
++
+ 		/*Obtain index sets for velocity and pressure components */
+ 		IS isv = NULL;
+ 		IS isp = NULL;
+@@ -784,12 +728,10 @@
+ 		#endif
+ 		Kff->Assemble();
+ 
+-	
+ 		/*Solve*/
+ 		femmodel->profiler->Start(SOLVER);
+ 		_assert_(Kff->type==PetscMatType); 
+ 
+-
+ 		SchurCGSolver(&uf,
+ 					Kff->pmatrix->matrix,
+ 					pf->pvector->vector,
+Index: ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp	(revision 26468)
+@@ -11,4 +11,3 @@
+ #else
+ #error "Cannot compile without MeDiPack and AdjointMpi"
+ #endif
+-
+Index: ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26468)
+@@ -317,7 +317,7 @@
+   xDelete(indexB);
+   xDelete(valueX);
+   xDelete(indexX);
+- 
++
+   delete data;
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26468)
+@@ -149,7 +149,7 @@
+ 	return Ke;
+ }/*}}}*/
+ ElementMatrix* AdjointHorizAnalysis::CreateKMatrixHO(Element* element){/*{{{*/
+-	
++
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26468)
+@@ -575,7 +575,6 @@
+ 		IssmDouble mig_max            = femmodel->parameters->FindParam(MigrationMaxEnum);
+ 		IssmDouble dt                 = femmodel->parameters->FindParam(TimesteppingTimeStepEnum);
+ 
+-
+ 		for(Object* & object : femmodel->elements->objects){
+ 			Element* element   = xDynamicCast<Element*>(object);
+ 			int      numnodes  = element->GetNumberOfNodes();
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26468)
+@@ -231,7 +231,6 @@
+ 	iomodel->FindConstant(&smbslices,"md.smb.steps_per_step");
+ 	parameters->AddObject(new IntParam(SmbStepsPerStepEnum,smbslices));
+ 
+-
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.smb.averaging",SmbAveragingEnum));
+ 
+ 	switch(smb_model){
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26468)
+@@ -1108,7 +1108,6 @@
+ 		if(solver_type==FSSolverEnum) is_schur_cg_solver = true;
+ 		#endif
+ 
+-
+ 		if(is_schur_cg_solver)
+ 		 solutionsequence_schurcg(femmodel);
+ 		else if (fe_FS==XTaylorHoodEnum)
+@@ -2095,7 +2094,7 @@
+ 
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+-	
++
+ 	/*Transform solution in Cartesian Space*/
+ 	if(dim==2) basalelement->TransformSolutionCoord(&values[0],XYEnum);
+ 
+@@ -2133,7 +2132,7 @@
+ 		element->AddBasalInput(VyBaseEnum,vy,element->GetElementType());
+ 	}
+ 	element->AddBasalInput(VelEnum,vel,element->GetElementType());
+-	
++
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(vel);
+ 	xDelete<IssmDouble>(vz);
+@@ -2753,9 +2752,9 @@
+ 
+ /*MLHO*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+-	
++
+ 	//_error_("Mono Layer Higher-Order called, not fully tested. If you are sure of using it, comment this line.");
+-	
++
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
+ 	/*compute all stiffness matrices for this element*/
+@@ -2817,7 +2816,7 @@
+ 	else{
+ 		gauss = element->NewGauss(2);
+ 	}
+-	
++
+ 	/* Start  looping on the number of gaussian points: */
+ 	while(gauss->next()){
+ 
+@@ -2850,7 +2849,6 @@
+ 	xDelete<IssmDouble>(basis);
+ 	return Ke;
+ 
+-
+ 	//itapopo OLD - testing above
+ 	/*Intermediaries*/
+ 	//int      domaintype;
+@@ -2872,7 +2870,7 @@
+ 	//Element* basalelement = element->SpawnBasalElement();
+ 	//ElementMatrix* Ke    = basalelement->NewElementMatrix(MLHOApproximationEnum);
+ 	ElementMatrix* KeSSA = CreateKMatrixSSAFriction(basalelement); //only to get K11 and K33
+-	
++
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	//int numnodes = basalelement->GetNumberOfNodes();
+ 
+@@ -2968,7 +2966,7 @@
+ 				Ke->values[ (4*i+0)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[1]*thickness*(
+                      2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+                      )*(n+1)/(n+2);//K14
+-				
++
+ 				Ke->values[(4*i+1)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[1]*thickness*(
+ 							4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*(n+1)/(n+2);//K21
+@@ -2984,7 +2982,7 @@
+ 				Ke->values[(4*i+1)*2*2*numnodes+4*j+3] += gauss->weight*Jdet*viscosity[2]*thickness*(
+ 							2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i]
+ 							)*2*pow(n+1,2)/((2*n+3)*(n+2));//K24
+-				
++
+ 				Ke->values[(4*i+2)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[0]*thickness*(
+ 							2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i]
+ 							);//K31
+@@ -3016,7 +3014,7 @@
+ 			}
+ 		}
+ 	}
+- 
++
+ 	/*Transform Coordinate System*/
+ 	//basalelement->TransformStiffnessMatrixCoord(Ke,XYMLHOEnum);
+ 
+@@ -3050,7 +3048,7 @@
+ 			break;
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+-	
++
+ 	/*compute all load vectors for this element*/
+ 	ElementVector* pe1=CreatePVectorMLHODrivingStress(basalelement);
+ 	ElementVector* pe2=CreatePVectorMLHOFront(basalelement);
+@@ -3091,7 +3089,7 @@
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+ 		n_input->GetInputValue(&n,gauss);
+-		
++
+ 		for(int i=0;i<numnodes;i++){// per node: vx (basal vx), vshx, vy (basal vy), vshy
+ 			pe->values[i*4+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1
+ 			pe->values[i*4+1]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]*(n+1)/(n+2); //F2
+@@ -3149,7 +3147,7 @@
+ 		sealevel_input->GetInputValue(&sealevel,gauss);
+ 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
+ 		element->NodalFunctions(basis,gauss);
+-		
++
+ 		b = base-sealevel; // ice base shifted by the sea level
+ 		s = thickness+b;   // ice surface shifted by the sea level
+ 		/*Vertically integrated pressure - SSA type*/
+@@ -3248,7 +3246,7 @@
+ 	IssmDouble* vz        = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vel       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* n			 = xNew<IssmDouble>(numnodes);
+-	
++
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+ 
+@@ -3282,11 +3280,11 @@
+ 	/*Add vx and vy as inputs to the tria element (shear velocities): */
+ 	element->AddBasalInput(VxShearEnum,vshx,element->GetElementType());
+ 	element->AddBasalInput(VyShearEnum,vshy,element->GetElementType());
+-	
++
+ 	/*Add vx and vy as inputs to the tria element (base velocities): */
+ 	element->AddBasalInput(VxBaseEnum,vbx,element->GetElementType());
+ 	element->AddBasalInput(VyBaseEnum,vby,element->GetElementType());
+-	
++
+ 	/*Add vx and vy as inputs to the tria element (surface velocities): */
+ 	element->AddBasalInput(VxSurfaceEnum,vsx,element->GetElementType());
+ 	element->AddBasalInput(VySurfaceEnum,vsy,element->GetElementType());
+@@ -3297,7 +3295,7 @@
+ 		vx[i]=vbx[i]+vshx[i]*(n[i]+1)/(n[i]+2);
+ 		vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2);
+ 	}
+-		
++
+ 	/*Get Vz and compute vel (vertically averaged vel)*/
+ 	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.); 
+ 	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 
+@@ -3371,7 +3369,7 @@
+ 	}
+ 
+ 	solution->SetValues(numdof,doflist,values,INS_VAL);
+-	
++
+ 	/*Free ressources:*/
+ 	delete gauss;
+ 	xDelete<IssmDouble>(values);
+@@ -4405,7 +4403,6 @@
+ 	Input* vz_input = NULL;
+ 	if(dim==3){vz_input=element->GetInput(VzEnum); _assert_(vz_input);}
+ 
+-
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss = element->NewGauss(5);
+ 	while(gauss->next()){
+@@ -4414,7 +4411,6 @@
+ 		element->NodalFunctionsPressure(pbasis,gauss);
+ 		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
+ 
+-
+ 		if(dim==3 || dim==2){
+ 			/*Pressure mass matrix*/
+ 			for(int k=0;k<pnumnodes;k++){
+@@ -5484,7 +5480,7 @@
+ 		element->NodalFunctionsDerivativesVelocity(vdbasis,xyz_list,gauss);
+ 		element->NodalFunctionsPressure(pbasis,gauss);
+ 		element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
+-		
++
+ 		for(int i=0;i<vnumnodes;i++){
+ 			for(int j=0;j<vnumnodes;j++){
+ 				for (int d=0; d<dim; d++) {
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26468)
+@@ -1286,7 +1286,6 @@
+ /*}}}*/
+ void       Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum,int type){/*{{{*/
+ 
+-
+ 	switch(type){
+ 		case ElementSIdEnum:{
+          IssmDouble  value;
+@@ -1679,10 +1678,10 @@
+ 			IssmDouble* times = xNew<IssmDouble>(N);
+ 			if(M==1)times[0]=0;
+ 			if(M==2)for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+-			
++
+ 			inputs->SetTransientInput(vector_enum,times,N);
+ 			TransientInput* transientinput = inputs->GetTransientInput(vector_enum);
+-		
++
+ 			for(int t=0;t<N;t++){
+ 				value=vector[t]; //values are on the first line, times are on the second line
+ 				switch(this->ObjectEnum()){
+@@ -3261,7 +3260,6 @@
+ 			_error_("Input type \""<<EnumToStringx(this->inputs->GetInputObjectEnum(output_enum))<<"\" not supported yet (While trying to return "<<EnumToStringx(output_enum)<<")");
+ 	}
+ 
+-
+ 	/*Assign output pointer*/
+ 
+ 	return;
+@@ -3323,8 +3321,6 @@
+ 				case P1Enum:{
+ 					const int NUM_VERTICES = this->GetNumberOfVertices();
+ 
+-
+-
+ 					this->GetVerticesSidList(&sidlist[0]);
+ 					this->GetVerticesConnectivityList(&connectivity[0]);
+ 					this->GetInputListOnVertices(&values[0],output_enum);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26468)
+@@ -1939,7 +1939,6 @@
+ 		_error_("case not possible");
+ 	}
+ 
+-
+ 	/*Some checks in debugging mode*/
+ 	_assert_(s1>=0 && s1<=1.);
+ 	_assert_(s2>=0 && s2<=1.);
+@@ -2055,7 +2054,6 @@
+ 		_error_("case not possible");
+ 	}
+ 
+-
+ 	/*Some checks in debugging mode*/
+ 	_assert_(s1>=0 && s1<=1.);
+ 	_assert_(s2>=0 && s2<=1.);
+@@ -2376,7 +2374,6 @@
+ 	if(start==-1 && !IsOnBase())    return;
+ 	if(start==+1 && !IsOnSurface()) return;
+ 
+-
+ 	/*Get original input*/
+ 	Input* input = this->GetInput(enum_type);
+ 	if(input->ObjectEnum()!=PentaInputEnum) _error_("not supported yet");
+@@ -2737,7 +2734,7 @@
+ 	IssmDouble  movingfrontvx[NUMVERTICES];
+ 	IssmDouble  movingfrontvy[NUMVERTICES];
+ 	IssmDouble  vel;
+-	
++
+ 	/* Get node coordinates and dof list: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 
+@@ -4032,7 +4029,6 @@
+ 		_error_("case not possible");
+ 	}
+ 
+-
+ 	/*Some checks in debugging mode*/
+ 	_assert_(s1>=0 && s1<=1.);
+ 	_assert_(s2>=0 && s2<=1.);
+@@ -4147,7 +4143,6 @@
+ 		_error_("case not possible");
+ 	}
+ 
+-
+ 	/*Some checks in debugging mode*/
+ 	_assert_(s1>=0 && s1<=1.);
+ 	_assert_(s2>=0 && s2<=1.);
+@@ -4898,7 +4893,6 @@
+ 	}
+ 	else if(type==TransientInputEnum){
+ 
+-
+ 		IssmDouble* steps=NULL;
+ 		int nsteps;
+ 		TransientInput* transientinput = NULL;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26468)
+@@ -322,7 +322,6 @@
+ 	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: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 
+@@ -337,8 +336,6 @@
+ 	Input* n_input  = this->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+ 	Input* sl_input  = this->GetInput(SealevelEnum); _assert_(sl_input);
+ 
+-
+-
+ 	/* Start looping on the number of vertices: */
+ 	GaussTria gauss;
+ 	for(int iv=0;iv<NUMVERTICES;iv++){
+@@ -412,7 +409,6 @@
+ 	IssmDouble  s_xx,s_xy,s_yy,s1,s2,stmp;
+ 	int         crevasse_opening_stress;
+ 
+-
+ 	/*reset if no ice in element*/
+ 	if(!this->IsIceInElement()){
+ 		for(int i=0;i<NUMVERTICES;i++){
+@@ -426,7 +422,6 @@
+ 		return;
+ 	}
+ 
+-
+ 	/*retrieve the type of crevasse_opening_stress*/
+ 	this->parameters->FindParam(&crevasse_opening_stress,CalvingCrevasseDepthEnum);
+ 
+@@ -1320,7 +1315,7 @@
+ 		vze->SetValue(this->sid,ze,INS_VAL);
+ 		area=this->GetAreaSpherical();
+ 		vareae->SetValue(this->sid,area,INS_VAL);
+-		
++
+ 		/*in addition, put in in the inputs:*/
+ 		this->inputs->SetDoubleInput(AreaEnum,this->lid,area);
+ 	}
+@@ -1349,7 +1344,7 @@
+ 	vlonge->SetValue(this->sid,longe,INS_VAL);
+ 	vlate->SetValue(this->sid,late,INS_VAL);
+ 	vareae->SetValue(this->sid,area,INS_VAL);
+-		
++
+ 	return;
+ }
+ /*}}}*/
+@@ -1765,7 +1760,7 @@
+ }
+ /*}}}*/
+ void       Tria::GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){/*{{{*/
+-	
++
+ 	/*Computeportion of the element that is grounded*/
+ 	bool               trapezeisnegative=true; //default value
+ 	int                point;
+@@ -1776,7 +1771,7 @@
+ 	Gauss* gauss=NULL;
+ 	IssmDouble loadweights_g[NUMVERTICES];
+ 	IssmDouble total_weight=0;
+-	
++
+ 	_assert_(!xIsNan<IssmDouble>(gl[0]));
+ 	_assert_(!xIsNan<IssmDouble>(gl[1]));
+ 	_assert_(!xIsNan<IssmDouble>(gl[2]));
+@@ -1819,11 +1814,10 @@
+ 	}
+ 	if(trapezeisnegative) phi=1-f1*f2;
+ 	else phi=f1*f2;
+-	
+ 
+ 	/*Compute weights:*/
+ 	gauss = this->NewGauss(point,f1,f2,trapezeisnegative,2); 
+-	
++
+ 	total_weight=0;
+ 	for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
+ 	while(gauss->next()){
+@@ -1847,7 +1841,7 @@
+ }
+ /*}}}*/
+ IssmDouble Tria::GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){/*{{{*/
+-	
++
+ 	IssmDouble x1,y1,z1,x2,y2,z2,x3,y3,z3;
+ 	IssmDouble arc12,arc23,arc31,semi_peri,excess;
+ 	IssmDouble lat1,lat2,lat3;
+@@ -1928,7 +1922,7 @@
+ 	int  point1;
+ 	IssmDouble levelset[NUMVERTICES];
+ 	IssmDouble planetradius;
+-	
++
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+ 
+ 	//figure out if we are flipping the levelsets: 
+@@ -1939,7 +1933,7 @@
+ 	//figure out area where we have loads
+ 	Element::GetInputListOnVertices(&levelset[0],levelsetenum);
+ 	if(flip1)for(int i=0;i<NUMVERTICES;i++)levelset[i]=-levelset[i];
+-	
++
+ 	//compute sea level load weights
+ 	this->GetFractionGeometry(loadweights,&phi,&point1,&fraction1,&fraction2,&istrapeze1,levelset);
+ 
+@@ -1951,7 +1945,6 @@
+ } /*}}}*/
+ void       Tria::GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelset1enum, int levelset2enum){ /*{{{*/
+ 
+-
+ 	bool istrapeze1, istrapeze2;
+ 	IssmDouble phi1,phi2, d,e,f,g,h1,h2;
+ 	int point1, point2,  i0,i1,i2,j0,j1,j2;
+@@ -2018,7 +2011,6 @@
+ 		return;
+ 	}
+ 
+-
+ 	//If everyone is negative, no need to calculate any fraction
+ 	if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0 && levelset2[0]<=0 && levelset2[1]<=0 && levelset2[2]<=0) {
+ 		for (int i=0;i<NUMVERTICES;i++) loadweights[i]=1.0/NUMVERTICES;
+@@ -2027,11 +2019,10 @@
+ 		*plongbar=longe;
+ 		return;
+ 	}
+-	
++
+ 	/*recover planet radius:*/
+ 	this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum);
+ 
+-
+ 	//If just one levelset is all negative, just take the partitioning of the other, no interaction between them
+ 	if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0) {
+ 		this->GetFractionGeometry(loadweights,&phi2,&point2,&f,&g,&istrapeze2,levelset2);
+@@ -2046,11 +2037,9 @@
+ 		return;
+ 	}
+ 
+-
+ 	this->GetFractionGeometry(&weights1[0],&phi1,&point1,&d,&e,&istrapeze1,levelset1);
+ 	this->GetFractionGeometry(&weights2[0],&phi2,&point2,&f,&g,&istrapeze2,levelset2);
+ 
+-
+ 	//Early return if levelsets are not independent
+ 	if (istrapeze1==istrapeze2 && point1==point2 && phi1==phi2){
+ 		//the two levelsets are redundant: levelset1 = positivescalar * levelset2
+@@ -2068,7 +2057,6 @@
+ 		return;
+ 	}
+ 
+-	
+ 	::GetVerticesCoordinates(&xyz0[0][0],vertices,NUMVERTICES); // initial triangle
+ 
+ 	//Let our element be triangle ABC with:
+@@ -2117,7 +2105,6 @@
+ 		h2= (d*(f+e-1))/(g*(e-d) +f*d);
+ 	}
+ 
+-
+ 	//interpolant weights of each point. Any field F[0,1,2] provided at the original vertices [0,1,2] will be equal on point k to sum_i (F[i] * w[k][i])
+ 	w[0][0]=1; //A
+ 	w[1][1]=1; //B
+@@ -2226,7 +2213,7 @@
+ 					area3=g*(1.0-f);
+ 				} /*}}}*/
+ 			}
+-			
++
+ 		}/*}}}*/
+ 		else{ /*{{{*/
+ 			if (d<=f && e>=g){  /*{{{*/
+@@ -2497,7 +2484,7 @@
+ 	*pxyz_front=xyz_front;
+ }/*}}}*/
+ Input*    Tria::GetInput(int inputenum){/*{{{*/
+-		
++
+ 	/*Get Input from dataset*/
+ 	if(this->iscollapsed){
+ 		PentaInput* input = this->inputs->GetPentaInput(inputenum);
+@@ -4080,7 +4067,7 @@
+ 	IssmDouble  movingfrontvx[NUMVERTICES];
+ 	IssmDouble  movingfrontvy[NUMVERTICES];
+ 	IssmDouble  vel;
+-	
++
+ 	/* Get node coordinates and dof list: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 
+@@ -4331,7 +4318,7 @@
+ 				_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+ 		}
+ 		for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i];
+-				
++
+ 		movingfrontvx[iv] = w[0];
+ 		movingfrontvy[iv] = w[1];		
+ 	}
+@@ -6146,7 +6133,7 @@
+ 	IssmDouble yts;
+ 	this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
+ 	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+-	
++
+ 	/*recover gia solution parameters: */
+ 	int cross_section_shape;
+ 	this->parameters->FindParam(&cross_section_shape,SolidearthSettingsCrossSectionShapeEnum);
+@@ -6157,7 +6144,7 @@
+ 
+ 	/*recover material parameters: */
+ 	IssmDouble rho_ice                   = FindParam(MaterialsRhoIceEnum);
+-	
++
+ 	/*recover mantle and lithosphere material properties:*/
+ 	int numlayers=litho->numlayers;
+ 
+@@ -6179,7 +6166,6 @@
+ 	int         numtimes;
+ 	this->GetInputAveragesUpToCurrentTime(TransientAccumulatedDeltaIceThicknessEnum,&hes,&times,&numtimes,currenttime);
+ 
+-
+ 	/*pull area of this Tria: */
+ 	IssmDouble area=this->GetArea();
+ 
+@@ -6273,7 +6259,7 @@
+ 	IssmDouble* U_viscoelastic_precomputed=NULL;
+ 	IssmDouble* H_viscoelastic_precomputed=NULL;
+ 	#endif
+-	
++
+ 	/*viscoelastic green function:*/
+ 	int index;
+ 	int M;
+@@ -6341,7 +6327,7 @@
+ 	if(computeelastic){
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter);
+ 		parameter->GetParameterValueByPointer((IssmDouble**)&G_viscoelastic_precomputed,NULL);
+-		
++
+ 		parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUViscoElasticEnum)); _assert_(parameter);
+ 		parameter->GetParameterValueByPointer((IssmDouble**)&U_viscoelastic_precomputed,NULL);
+ 
+@@ -6372,7 +6358,6 @@
+ 		nt=1; //in elastic, or if we run only selfattraction, we need only one step
+ 	}
+ 
+-
+ 	constant=3/rho_earth/planetarea;
+ 
+ 	G=xNewZeroInit<IssmDouble>(3*nel*nt);
+@@ -6392,7 +6377,7 @@
+ 			/*recover info for this element and vertex:*/
+ 			IssmDouble late= asin(zze[e]/sqrt( pow(xxe[e],2.0)+ pow(yye[e],2.0)+ pow(zze[e],2.0)));
+ 			IssmDouble longe= atan2(yye[e],xxe[e]);
+-			
++
+ 			lati=latitude[i];
+ 			longi=longitude[i];
+ 
+@@ -6403,13 +6388,11 @@
+ 			index=reCast<int,IssmDouble>(doubleindex); //truncates doubleindex to integer part
+ 			_assert_(index>=0 && index<M);
+ 
+-
+ 			lincoef=doubleindex-index; //where between index and index+1 is alpha
+ 			if (index==M-1){ //avoids out of bound case
+ 				index-=1;
+ 				lincoef=1;
+ 			}
+-			
+ 
+ 			if(horiz){
+ 				/*Compute azimuths, both north and east components: */
+@@ -6590,7 +6573,7 @@
+ 
+ 	/* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 
+ 	 * At the same time, we'll tag the elements that are fractionally only inside a mask*/
+-	
++
+ 	IssmDouble loadweights[3]={0};
+ 	IssmDouble area;
+ 	IssmDouble loadweightsocean[3]; //to keep memory of these loads, no need to recompute for bottom pressure.
+@@ -6609,7 +6592,7 @@
+ 
+ 	/*constants:*/
+ 	IssmDouble constant=0;
+-	
++
+ 	/*recover parameters:*/
+ 	this->parameters->FindParam(&computeice,TransientIsmasstransportEnum);
+ 	this->parameters->FindParam(&computebp,TransientIsoceantransportEnum);
+@@ -6670,7 +6653,7 @@
+ 		slgeom->issubelement[SLGEOM_OCEAN][this->lid]=true;
+ 		slgeom->nsubel[SLGEOM_OCEAN]++;
+ 	}
+-		
++
+ 	/*early return if we are not on an ice sheet , and we are not requesting 
+ 	 *hydrology or bottom pressure loads :*/
+ 	if(!computebp && !computehydro){
+@@ -6747,7 +6730,7 @@
+ 			return;
+ 		}
+ 	}
+-	
++
+ 	/*Deal with ice loads if we are on grounded ice:*/
+ 	if(isice && !isoceanonly && computeice){
+ 		if(isiceonly && !isocean){
+@@ -6790,7 +6773,7 @@
+ 			slgeom->nsubel[SLGEOM_WATER]++;
+ 		}
+ 	}
+-	
++
+ }
+ /*}}}*/
+ void       Tria::SealevelchangeGeometrySubElementLoads(SealevelGeometry* slgeom, IssmDouble* areae){ /*{{{*/
+@@ -6797,7 +6780,7 @@
+ 
+ 	/* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 
+ 	 * At the same time, we'll tag the elements that are fractionally only inside a mask*/
+-	
++
+ 	IssmDouble loadweights[3]={0};
+ 	IssmDouble area,loadarea;
+ 	IssmDouble loadareaocean;
+@@ -6807,7 +6790,7 @@
+ 	IssmDouble longbar=slgeom->longe[this->lid];
+ 	IssmDouble constant;
+ 	IssmDouble nanconstant=NAN;
+-	
++
+ 	/*get vertex and area information:*/
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 	area=areae[this->sid];
+@@ -6820,10 +6803,10 @@
+ 	this->AddInput(SealevelBarystaticOceanLatbarEnum,&latbar,P0Enum); 
+ 	this->AddInput(SealevelBarystaticOceanLongbarEnum,&longbar,P0Enum); 
+ 	#endif
+-	
++
+ 	if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+ 		int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+-		
++
+ 		this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweightsocean[0],&loadareaocean,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, MaskOceanLevelsetEnum);
+ 		slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=loadareaocean;
+ 		slgeom->vareae_subel[SLGEOM_OCEAN]->SetValue(intj,loadareaocean,INS_VAL);
+@@ -6884,13 +6867,13 @@
+ 		this->AddInput(SealevelBarystaticHydroMaskEnum,&constant,P0Enum);
+ 		this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum);
+ 		this->AddInput(SealevelBarystaticHydroAreaEnum,&loadarea,P0Enum);
+-		
++
+ 		this->AddInput(SealevelBarystaticHydroLatbarEnum,&latbar,P0Enum); 
+ 		this->AddInput(SealevelBarystaticHydroLongbarEnum,&longbar,P0Enum); 
+ 
+ 		#endif
+ 	}
+-	
++
+ }
+ /*}}}*/
+ void       Tria::SealevelchangeGeometrySubElementKernel(SealevelGeometry* slgeom){ /*{{{*/
+@@ -6926,7 +6909,7 @@
+ 	IssmDouble** GNsubel=NULL;
+ 	IssmDouble** GEsubel=NULL;
+ 	#endif
+-	
++
+ 	/*viscoelastic green function:*/
+ 	int index;
+ 	int M;
+@@ -7009,7 +6992,7 @@
+ 			GEsubel=xNew<IssmDouble*>(SLGEOM_NUMLOADS);
+ 		}
+ 	}
+-	
++
+ 	//Allocate: 
+ 	for(int l=0;l<SLGEOM_NUMLOADS;l++){
+ 		int nbar=slgeom->nbar[l];
+@@ -7132,7 +7115,7 @@
+ }
+ /*}}}*/
+ void       Tria::SealevelchangeUpdateViscousFields(){ /*{{{*/
+-	
++
+ 	/*Inputs:*/
+ 	IssmDouble* viscousRSL=NULL;
+ 	IssmDouble* viscousU=NULL;
+@@ -7147,12 +7130,12 @@
+ 	IssmDouble  currenttime;
+ 	IssmDouble  lincoeff=0;
+ 	int horiz;
+-		
++
+ 	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+-	
++
+ 	if(viscous){
+ 		this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+-		
++
+ 		this->parameters->FindParam(&viscousnumsteps,SealevelchangeViscousNumStepsEnum);
+ 		this->parameters->FindParam(&viscoustimes,NULL,SealevelchangeViscousTimesEnum);
+ 		this->parameters->FindParam(&viscousindex,SealevelchangeViscousIndexEnum);
+@@ -7165,7 +7148,6 @@
+ 			this->inputs->GetArrayPtr(SealevelchangeViscousEEnum,this->lid,&viscousE,&dummy);
+ 		}
+ 
+-
+ 		bool foundtime=false;
+ 		int offset=1;
+ 		lincoeff=0;
+@@ -7193,7 +7175,6 @@
+ 		}
+ 		viscousindex=newindex+offset;
+ 
+-		
+ 		this->parameters->SetParam(viscousindex,SealevelchangeViscousIndexEnum);
+ 		this->parameters->SetParam(viscoustimes,viscousnumsteps,SealevelchangeViscousTimesEnum);
+ 
+@@ -7201,7 +7182,6 @@
+ 		xDelete<IssmDouble>(viscoustimes);
+ 	}
+ 
+-
+ }
+ /*}}}*/
+ void       Tria::SealevelchangeBarystaticLoads(GrdLoads* loads,  BarystaticContributions* barycontrib, SealevelGeometry* slgeom){ /*{{{*/
+@@ -7253,11 +7233,11 @@
+ 	bslcice =   -slgeom->LoadArea[SLGEOM_ICE][this->lid]*Iavg;
+ 	bslchydro = -slgeom->LoadArea[SLGEOM_WATER][this->lid]*Wavg;
+ 	bslcbp =    -slgeom->LoadArea[SLGEOM_OCEAN][this->lid]*BPavg;
+-	
++
+ 	_assert_(!xIsNan<IssmDouble>(bslcice));
+ 	_assert_(!xIsNan<IssmDouble>(bslchydro));
+ 	_assert_(!xIsNan<IssmDouble>(bslcbp));
+-	
++
+ 	/*Plug values into subelement load vector:*/
+ 	if(slgeom->issubelement[SLGEOM_ICE][this->lid]){
+ 		int intj=slgeom->subelementmapping[SLGEOM_ICE][this->lid];
+@@ -7288,7 +7268,7 @@
+ 	IssmDouble* G=NULL;
+ 	IssmDouble* Gsub[SLGEOM_NUMLOADS];
+ 	bool computefuture=false;
+-	
++
+ 	bool sal = false;
+ 	bool viscous = false;
+ 	bool rotation= false;
+@@ -7298,7 +7278,7 @@
+ 	IssmDouble Grotm1[3];
+ 	IssmDouble Grotm2[3];
+ 	IssmDouble Grotm3[3];
+-		
++
+ 	this->parameters->FindParam(&sal,SolidearthSettingsSelfAttractionEnum);
+ 	this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum);
+ 	this->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum);
+@@ -7317,7 +7297,7 @@
+ 		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
+ 		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
+ 		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
+-		
++
+ 		for(int i=0;i<NUMVERTICES;i++){
+ 			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+ 				sealevelpercpu[this->vertices[i]->lid]+=Grotm1[i]*polarmotionvector[0]+Grotm2[i]*polarmotionvector[1]+Grotm3[i]*polarmotionvector[2];
+@@ -7332,7 +7312,7 @@
+ 	IssmDouble oceanaverage=0;
+ 	IssmDouble oceanarea=0;
+ 	IssmDouble rho_water;
+-	
++
+ 	this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum);
+ 
+ 	/*retrieve ocean average and area:*/
+@@ -7352,7 +7332,6 @@
+ 	}
+ 	else loads->vsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL);
+ 
+-
+ 	/*add ocean area into a global oceanareas vector:*/
+ 	if(!loads->sealevelloads){
+ 		oceanareas->SetValue(this->sid,oceanarea,INS_VAL);
+@@ -7361,7 +7340,7 @@
+ 			subelementoceanareas->SetValue(intj,oceanarea,INS_VAL);
+ 		}
+ 	}
+-	
++
+ 	return;
+ } /*}}}*/
+ void       Tria::SealevelchangeDeformationConvolution(IssmDouble* sealevelpercpu, GrdLoads* loads, IssmDouble* polarmotionvector,SealevelGeometry* slgeom){ /*{{{*/
+@@ -7408,8 +7387,7 @@
+ 	this->parameters->FindParam(&elastic,SolidearthSettingsElasticEnum);
+ 	this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum);
+ 	this->parameters->FindParam(&planethasocean,SolidearthSettingsGrdOceanEnum);
+-	
+-		
++
+ 	if(sal){
+ 
+ 		this->inputs->GetArrayPtr(SealevelchangeGEnum,this->lid,&G,&size);
+@@ -7449,7 +7427,7 @@
+ 		Element::GetInputListOnVertices(&Grotm1[0],SealevelGrotm1Enum);
+ 		Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum);
+ 		Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum);
+-		
++
+ 		for(int i=0;i<NUMVERTICES;i++){
+ 			if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+ 				RSLGrd[i]+=Grotm1[i]*polarmotionvector[0]+Grotm2[i]*polarmotionvector[1]+Grotm3[i]*polarmotionvector[2];
+@@ -7460,7 +7438,7 @@
+ 			Element::GetInputListOnVertices(&GUrotm1[0],SealevelGUrotm1Enum);
+ 			Element::GetInputListOnVertices(&GUrotm2[0],SealevelGUrotm2Enum);
+ 			Element::GetInputListOnVertices(&GUrotm3[0],SealevelGUrotm3Enum);
+-		
++
+ 			for(int i=0;i<NUMVERTICES;i++){
+ 				if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+ 					UGrd[i]+=GUrotm1[i]*polarmotionvector[0]+GUrotm2[i]*polarmotionvector[1]+GUrotm3[i]*polarmotionvector[2];
+@@ -7473,7 +7451,7 @@
+ 				Element::GetInputListOnVertices(&GErotm1[0],SealevelGErotm1Enum);
+ 				Element::GetInputListOnVertices(&GErotm2[0],SealevelGErotm2Enum);
+ 				Element::GetInputListOnVertices(&GErotm3[0],SealevelGErotm3Enum);
+-		
++
+ 				for(int i=0;i<NUMVERTICES;i++){
+ 					if(slgeom->lids[this->vertices[i]->lid]==this->lid){
+ 						NGrd[i]+=GNrotm1[i]*polarmotionvector[0]+GNrotm2[i]*polarmotionvector[1]+GNrotm3[i]*polarmotionvector[2];
+@@ -7494,7 +7472,7 @@
+ 
+ 	/*Create geoid: */
+ 	for(int i=0;i<NUMVERTICES;i++)SealevelGrd[i]=UGrd[i]+RSLGrd[i];
+-	
++
+ 	/*Create inputs*/
+ 	this->AddInput(SealevelGRDEnum,SealevelGrd,P1Enum);
+ 	this->AddInput(BedGRDEnum,UGrd,P1Enum);
+@@ -7503,7 +7481,6 @@
+ 		this->AddInput(BedEastGRDEnum,EGrd,P1Enum);
+ 	}
+ 
+-
+ } /*}}}*/
+ void       Tria::SealevelchangeGxL(IssmDouble* grdfieldout, IssmDouble* G, IssmDouble** Gsub, GrdLoads* loads, SealevelGeometry* slgeom, int nel, bool percpu, int viscousenum, bool computefuture) { /*{{{*/
+ 
+@@ -7576,7 +7553,7 @@
+ 			}
+ 		}
+ 	}
+-	
++
+ 	if(computeviscous){
+ 		IssmDouble* grdfieldinterp=NULL;
+ 		IssmDouble* viscoustimes=NULL;
+@@ -7645,10 +7622,9 @@
+ 		for(i=0;i<NUMVERTICES;i++) grdfieldout[i]=grdfield[i*nt+0];
+ 	}
+ 
+-
+ } /*}}}*/
+ void       Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){/*{{{*/
+-		
++
+ 	IssmDouble S=0;
+ 
+ 	/*Compute area of element:*/
+@@ -7662,11 +7638,10 @@
+ 	late=slgeom->late[this->lid]/180*M_PI;
+ 	longe=slgeom->longe[this->lid]/180*M_PI;
+ 
+-
+ 	/*recover total load: */
+ 	if(loads->loads) S+=loads->loads[this->Sid()];
+ 	if(loads->sealevelloads) S+=loads->sealevelloads[this->Sid()];
+-	
++
+ 	/* Perturbation terms for moment of inertia (moi_list):
+ 	 * computed analytically (see Wu & Peltier, eqs 10 & 32)
+ 	 * also consistent with my GMD formulation!
+@@ -7678,7 +7653,7 @@
+ 	return;
+ }/*}}}*/
+ void       Tria::SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* grdloads,  SealevelGeometry* slgeom){/*{{{*/
+-		
++
+ 	IssmDouble  SA=0;
+ 	IssmDouble* loads=NULL;
+ 	IssmDouble* sealevelloads=NULL;
+@@ -7690,7 +7665,7 @@
+ 	/*recover parameters: */
+ 	this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum);
+ 	this->parameters->FindParam(&re,SolidearthPlanetRadiusEnum);
+-	
++
+ 	/*Initalize:*/
+ 	for(int i=0;i<3;i++)dI_list[i]=0;
+ 
+@@ -7722,7 +7697,7 @@
+ 	return;
+ }/*}}}*/
+ void       Tria::SealevelchangeShift(GrdLoads* loads,  IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/
+-	
++
+ 	if(slgeom->isoceanin[this->lid]){
+ 		if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){
+ 			int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid];
+@@ -7731,7 +7706,6 @@
+ 		else loads->vsealevelloads->SetValue(this->sid,offset,ADD_VAL);
+ 	}
+ 
+-
+ } /*}}}*/
+ #endif
+ 
+@@ -7740,7 +7714,7 @@
+ 
+ 	int interp;
+ 	int type;
+-	
++
+ 	/*Branch according to whether we have a transient or not input: */
+ 	type=this->inputs->GetInputObjectEnum(name);
+ 	if(type==TriaInputEnum){
+@@ -7749,7 +7723,7 @@
+ 		TriaInput* triainput2 = this->inputs->GetTriaInput(DummyEnum);
+ 		this->InputServe(triainput);
+ 		interp=triainput->GetInterpolation();
+-		
++
+ 		if (interp==P0Enum){
+ 			/*Update the value if this element belongs to the partition: */
+ 			if(partition[this->Sid()]!=-1){
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26468)
+@@ -243,7 +243,6 @@
+ 	/*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){/*{{{*/
+ 
+@@ -2354,7 +2353,6 @@
+ 	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];
+@@ -2361,7 +2359,6 @@
+ 		output_enum   = StringToEnumx(output_string,false);
+ 		isvec         = false;
+ 
+-
+ 		/*If string is not an enum, it is defined in output definitions*/
+ 		if(output_enum<0){
+ 			double_result = OutputDefinitionsResponsex(this,output_string);
+@@ -2481,7 +2478,6 @@
+ 					}
+ 					break;
+ 
+-
+ 				   /*Default is always Vector */
+ 					default:
+ 
+@@ -3657,7 +3653,6 @@
+ 		}
+ 	}
+ 
+-
+ 	/*Cleanup*/
+ 	xDelete<IssmDouble>(P0inputs);
+ 	xDelete<IssmDouble>(newP0inputs);
+@@ -4812,7 +4807,6 @@
+ 	serial_active=active->ToMPISerial();
+ 	delete active;
+ 
+-
+ 	/*Update node activation accordingly*/
+ 	int         counter  = 0; //this is probably not acurate but we are only interested in positivity
+ 	Element*    basalelement=NULL;
+@@ -5446,7 +5440,6 @@
+ 	int vid,v1,v2,v3;
+ 	bool refine;
+ 
+-
+ 	/*Fill variables*/
+ 	switch(errorestimator_type){
+ 		case ThicknessErrorEstimatorEnum:
+@@ -5535,7 +5528,6 @@
+ 
+ 	//itapopo esse metodo pode ser deletado
+ 
+-
+ 	/*Here, "zero level set" means grounding line or ice front, depending on the level set type*/
+ 	/*pverticedistance is the minimal vertice distance to the grounding line or ice front*/
+ 	if(levelset_type!=MaskOceanLevelsetEnum && levelset_type!=MaskIceLevelsetEnum){
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26468)
+@@ -33,7 +33,7 @@
+ 	/* Load necessary parameters */
+ 	element_in->FindParam(&this->law,FrictionLawEnum);
+ 	element_in->FindParam(&this->domaintype,DomainTypeEnum);
+-	
++
+ 	/* Load VxBase and VyBase for this special case */
+ 	switch(this->domaintype){
+ 		case Domain2DhorizontalEnum: 
+@@ -66,7 +66,7 @@
+ 	/* Load necessary parameters */
+ 	element_in->FindParam(&this->law,FrictionLawEnum);
+ 	element_in->FindParam(&this->domaintype,DomainTypeEnum);
+-	
++
+ 	/* Load VxBase and VyBase for this special case */
+ 	switch(this->domaintype){
+ 		case Domain2DhorizontalEnum: 
+@@ -120,7 +120,6 @@
+ 			_error_("not supported");
+ 	}
+ 
+-
+ 	/*Checks*/
+ 	_assert_(!xIsNan<IssmDouble>(*palpha_complement));
+ 	_assert_(!xIsInf<IssmDouble>(*palpha_complement));
+@@ -277,7 +276,7 @@
+ 	/*Check to prevent dividing by zero if vmag==0*/
+ 	if(vmag==0. && (1./m-1.)<0.) alpha_complement=0.;
+ 	else alpha_complement= pow(vmag, 1.0/m-1.);
+-	
++
+ 	/*Assign output pointers:*/
+ 	*palpha_complement=alpha_complement;
+ }/*}}}*/
+@@ -522,7 +521,6 @@
+ 	Tpmp = element->TMeltingPoint(pressure);
+ 	deltaT = T-Tpmp;
+ 
+-
+ 	/*Compute gamma*/
+ 	element->parameters->FindParam(&time,TimeEnum);
+ 	element->parameters->FindParam(&gamma,FrictionGammaEnum);
+@@ -920,7 +918,7 @@
+ 
+ 	if ((this->vz_input == NULL) || (this->apply_dim<3.)) vz = 0.0;
+ 	else this->vz_input->GetInputValue(&vz, gauss);
+-	
++
+ 	if (this->apply_dim<2.) vy = 0.0;
+ 
+ 	vmag = sqrt(vx*vx+vy*vy+vz*vz);
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26468)
+@@ -751,7 +751,7 @@
+ 	GaussSeg* gauss_seg=new GaussSeg(order);
+ 	//IssmDouble eps_eff_averaged=0;
+ 	while(gauss_seg->next()){
+-		
++
+ 		/*Compute zeta for gauss_seg point (0=surface, 1=base)*/
+ 		zeta=0.5*(gauss_seg->coord1+1);	
+ 
+@@ -772,7 +772,7 @@
+ 		f[1]=(1-pow(zeta,n+1));
+ 		f[2]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
+ 		f[3]=((n+1)/H)*pow(zeta,n) * ((n+1)/H)*pow(zeta,n);
+-	
++
+ 		F[0]=H;
+ 		F[1]=H*(n+1)/(n+2);
+ 		F[2]=2*H*(n+1)*(n+1)/( (2*n+3)*(n+2) );
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26468)
+@@ -46,17 +46,16 @@
+ 		/*solid earth considerations:*/
+ 		SolidEarthWaterUpdates(femmodel);
+ 
+-
+ 	}
+ 	/*Using the Tws based Model*/
+ 	if (hydrology_model==HydrologyTwsEnum){
+ 		if(VerboseSolution()) _printf0_("   computing water column\n");
+-	
++
+ 		femmodel->SetCurrentConfiguration(HydrologyTwsAnalysisEnum);
+-		
++
+ 		/*save current tws  before updating:*/
+ 		InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
+-	
++
+ 		/*grab tws from the hydrology.spcwatercolumn field input and update 
+ 		 * the solution with it:*/
+ 		Vector<IssmDouble>*  ug  = NULL;
+@@ -67,7 +66,7 @@
+ 		SolidEarthWaterUpdates(femmodel);
+ 
+ 		delete ug;
+-	
++
+ 	}
+ 
+ 	/*Using the double continuum model*/
+@@ -240,7 +239,7 @@
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+ 	femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
+ 	femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
+-	
++
+ 	/*early return?:*/
+ 	if(!isgrd)return;
+ 
+Index: ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26468)
+@@ -11,7 +11,7 @@
+ 	/*Recover melt_parameterization*/
+ 	int melt_parameterization;
+ 	femmodel->parameters->FindParam(&melt_parameterization,FrontalForcingsParamEnum);
+-	
++
+ 	/*Calculate melting rate*/
+ 	switch(melt_parameterization){
+ 		case FrontalForcingsDefaultEnum:
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26467)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26468)
+@@ -89,7 +89,7 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceancoupling",TransientIsoceancouplingEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.amr_frequency",TransientAmrFrequencyEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.issampling",TransientIssamplingEnum));
+-		
++
+ 		/*For stress balance only*/
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isFS",FlowequationIsFSEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.rift_penalty_threshold",StressbalanceRiftPenaltyThresholdEnum));
Index: /issm/oecreview/Archive/25834-26739/ISSM-26468-26469.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26468-26469.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26468-26469.diff	(revision 26740)
@@ -0,0 +1,654 @@
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 26468)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 26469)
+@@ -9,7 +9,7 @@
+ #include "./Analysis.h"
+ 
+ class ExtrapolationAnalysis: public Analysis{
+-	
++
+  public:
+ 	/*Model processing*/
+ 	void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+Index: ../trunk-jpl/src/c/classes/AmrBamg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/AmrBamg.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/AmrBamg.h	(revision 26469)
+@@ -27,10 +27,9 @@
+ 		IssmDouble deviatoricerror_groupthreshold;
+ 		IssmDouble deviatoricerror_maximum;
+ 
+-
+ 		/* Constructor, destructor etc*/
+ 		AmrBamg();
+-		
++
+ 		~AmrBamg();
+ 
+ 		/*General methods*/
+@@ -39,10 +38,10 @@
+ 		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;
+ 		BamgMesh* fathermesh;
+Index: ../trunk-jpl/src/c/classes/BarystaticContributions.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/BarystaticContributions.h	(revision 26469)
+@@ -30,7 +30,7 @@
+ 		Vector<IssmDouble>* cumocean;  //cumulated contributions to every ocean partition
+ 		int                 nocean; //number of ocean partitions 
+ 		IssmDouble*         pocean; //ocean partition (nel)
+- 
++
+ 		/*BarystaticContributions constructors, destructors :*/
+ 		BarystaticContributions(IoModel* iomodel );
+ 		~BarystaticContributions();
+Index: ../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h	(revision 26469)
+@@ -20,14 +20,14 @@
+ 		char*       name;
+ 		int         weights_enum;
+ 		bool			timepassedflag;
+-		
++
+ 		IssmDouble  misfit; //value carried over in time.
+-		
++
+ 		/*Cfdragcoeffabsgrad constructors, destructors :*/
+ 		Cfdragcoeffabsgrad();
+ 		Cfdragcoeffabsgrad(char* in_name, int in_definitionenum, int in_weights_enum,  bool timepassedflag);
+ 		~Cfdragcoeffabsgrad();
+-		
++
+ 		/*Object virtual function resolutoin: */
+ 		Object* copy();
+ 		void DeepEcho(void);
+@@ -35,7 +35,7 @@
+ 		int Id(void);
+ 		void Marshall(MarshallHandle* marshallhandle);
+ 		int ObjectEnum(void);
+-		
++
+ 		/*Definition virtual function resolutoin: */
+ 		int DefinitionEnum();
+ 		char* Name();
+Index: ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Cflevelsetmisfit.h	(revision 26469)
+@@ -23,14 +23,14 @@
+ 		int         weights_enum;
+ 		IssmDouble	datatime;
+ 		bool			timepassedflag;
+-		
++
+ 		IssmDouble  misfit; //value carried over in time.
+-		
++
+ 		/*Cflevelsetmisfit constructors, destructors :*/
+ 		Cflevelsetmisfit();
+ 		Cflevelsetmisfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, int in_weights_enum, IssmDouble in_datatime, bool timepassedflag);
+ 		~Cflevelsetmisfit();
+-		
++
+ 		/*Object virtual function resolutoin: */
+ 		Object* copy();
+ 		void DeepEcho(void);
+@@ -38,7 +38,7 @@
+ 		int Id(void);
+ 		void Marshall(MarshallHandle* marshallhandle);
+ 		int ObjectEnum(void);
+-		
++
+ 		/*Definition virtual function resolutoin: */
+ 		int DefinitionEnum();
+ 		char* Name();
+Index: ../trunk-jpl/src/c/classes/Cfsurfacelogvel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfsurfacelogvel.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Cfsurfacelogvel.h	(revision 26469)
+@@ -20,14 +20,14 @@
+ 		char*       name;
+ 		IssmDouble	datatime;
+ 		bool			timepassedflag;
+-		
++
+ 		IssmDouble  misfit; //value carried over in time.
+-		
++
+ 		/*Cfsurfacelogvel constructors, destructors :*/
+ 		Cfsurfacelogvel();
+ 		Cfsurfacelogvel(char* in_name, int in_definitionenum, IssmDouble in_datatime, bool timepassedflag);
+ 		~Cfsurfacelogvel();
+-		
++
+ 		/*Object virtual function resolutoin: */
+ 		Object* copy();
+ 		void DeepEcho(void);
+@@ -35,7 +35,7 @@
+ 		int Id(void);
+ 		void Marshall(MarshallHandle* marshallhandle);
+ 		int ObjectEnum(void);
+-		
++
+ 		/*Definition virtual function resolutoin: */
+ 		int DefinitionEnum();
+ 		char* Name();
+Index: ../trunk-jpl/src/c/classes/Cfsurfacesquare.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfsurfacesquare.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Cfsurfacesquare.h	(revision 26469)
+@@ -25,14 +25,14 @@
+ 		int         weights_enum;
+ 		IssmDouble	datatime;
+ 		bool			timepassedflag;
+-		
++
+ 		IssmDouble  misfit; //value carried over in time.
+-		
++
+ 		/*Cfsurfacesquare constructors, destructors :*/
+ 		Cfsurfacesquare();
+ 		Cfsurfacesquare(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, int in_weights_enum, IssmDouble in_datatime, bool timepassedflag);
+ 		~Cfsurfacesquare();
+-		
++
+ 		/*Object virtual function resolutoin: */
+ 		Object* copy();
+ 		void DeepEcho(void);
+@@ -40,7 +40,7 @@
+ 		int Id(void);
+ 		void Marshall(MarshallHandle* marshallhandle);
+ 		int ObjectEnum(void);
+-		
++
+ 		/*Definition virtual function resolutoin: */
+ 		int DefinitionEnum();
+ 		char* Name();
+Index: ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.h	(revision 26469)
+@@ -28,7 +28,6 @@
+ #endif
+ /*}}}*/
+ 
+-
+ #if !defined(_WRAPPERS_) && defined(_HAVE_DAKOTA_) && _DAKOTA_MAJOR_ >= 6
+ 
+ #include <DirectApplicInterface.hpp>
+@@ -36,7 +35,7 @@
+ 
+ namespace SIM {
+ 	class IssmParallelDirectApplicInterface: public Dakota::DirectApplicInterface{
+-      
++
+ 		private: 
+ 			FemModel* femmodel_init;
+ 		public:
+Index: ../trunk-jpl/src/c/classes/Elements/ElementHook.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 26469)
+@@ -22,7 +22,7 @@
+ 		ElementHook(int in_numanalyses,int material_id,int numvertices,IoModel* iomodel);
+ 		~ElementHook();
+ 		void Marshall(MarshallHandle* marshallhandle);
+-		
++
+ 		void DeepEcho();
+ 		void Echo();
+ 		void InitHookNeighbors(int* element_ids);               //3d only
+Index: ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 26469)
+@@ -605,7 +605,6 @@
+ }  /*}}}*/
+ template <> inline void GenericExternalResult<IssmPDouble*>::Transpose(void){/*{{{*/
+ 
+-
+ 	/*Perform transpose only if we have a matrix*/
+ 	if(M>1 && N>1){
+ 		IssmPDouble* temp=xNew<IssmPDouble>(M*N);
+@@ -623,8 +622,6 @@
+ 	this->N = this->M;
+ 	this->M = temp2;
+ 
+-
+-
+ } /*}}}*/
+ 
+ 	/*Specific instantiations for IssmDouble*: */
+Index: ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Inputs/DatasetInput.h	(revision 26469)
+@@ -19,7 +19,7 @@
+ 		int            *ids;
+ 		int             numberofelements_local;
+ 		int             numberofvertices_local;
+-		
++
+ 	public:
+ 		int GetNumIds() const {return this->numids;};
+ 		/*DatasetInput constructors, destructors: {{{*/
+Index: ../trunk-jpl/src/c/classes/Masscon.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Masscon.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Masscon.h	(revision 26469)
+@@ -23,7 +23,7 @@
+ 		char*       name;
+ 		IssmDouble* levelset;
+ 		int         M;
+-		
++
+ 		/*Masscon constructors, destructors :*/
+ 		Masscon(){/*{{{*/
+ 
+@@ -100,7 +100,6 @@
+ 			 IssmDouble mass_t=0.;
+ 			 IssmDouble all_mass_t=0.;
+ 
+-
+ 			 for(i=0;i<femmodel->elements->Size();i++){
+ 				 Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
+ 				 mass_t+=element->Masscon(this->levelset);
+@@ -108,7 +107,7 @@
+ 
+ 			 ISSM_MPI_Allreduce ( (void*)&mass_t,(void*)&all_mass_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+ 			 mass_t=all_mass_t;
+-			 
++
+ 			 return mass_t;
+ 		 }
+ 			/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Massconaxpby.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Massconaxpby.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Massconaxpby.h	(revision 26469)
+@@ -25,7 +25,7 @@
+ 		char*       namey;
+ 		IssmDouble  alpha;
+ 		IssmDouble  beta;
+-		
++
+ 		/*Massconaxpby constructors, destructors :*/
+ 		Massconaxpby(){/*{{{*/
+ 
+@@ -46,7 +46,7 @@
+ 
+ 			this->namex   = xNew<char>(strlen(in_namex)+1);
+ 			xMemCpy<char>(this->namex,in_namex,strlen(in_namex)+1);
+-			
++
+ 			this->namey   = xNew<char>(strlen(in_namey)+1);
+ 			xMemCpy<char>(this->namey,in_namey,strlen(in_namey)+1);
+ 
+Index: ../trunk-jpl/src/c/classes/Massfluxatgate.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Massfluxatgate.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Massfluxatgate.h	(revision 26469)
+@@ -41,7 +41,7 @@
+ 		}
+ 		/*}}}*/
+ 		Massfluxatgate(char* in_name, int in_definitionenum, int in_numsegments, doubletype* in_segments) {/*{{{*/
+-			
++
+ 			int i;
+ 
+ 			this->definitionenum=in_definitionenum;
+@@ -82,7 +82,7 @@
+ 				this->x2=xNew<doubletype>(this->numsegments); xMemCpy<doubletype>(this->x2,in_x2,this->numsegments);
+ 				this->y2=xNew<doubletype>(this->numsegments); xMemCpy<doubletype>(this->y2,in_y2,this->numsegments);
+ 				this->elements=xNew<int>(this->numsegments); xMemCpy<int>(this->elements,in_elements,this->numsegments);
+-				
++
+ 			}
+ 		}
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Misfit.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Misfit.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Misfit.h	(revision 26469)
+@@ -23,15 +23,15 @@
+ 		int         observation_enum;
+ 		char*       timeinterpolation;
+ 		int         weights_enum;
+-		
++
+ 		int         lock; // if lock is on, we just return the value stored in "misfit".  this is used so we don't compute misfit past the final_time
+ 		IssmDouble  misfit; //value carried over in time.
+-		
++
+ 		/*Misfit constructors, destructors :*/
+ 		Misfit();
+ 		Misfit(char* in_name, int in_definitionenum, int in_model_enum, int in_observation_enum, char* in_timeinterpolation, int in_local, int in_weights_enum);
+ 		~Misfit();
+-		
++
+ 		/*Object virtual function resolutoin: */
+ 		Object* copy();
+ 		void DeepEcho(void);
+@@ -39,7 +39,7 @@
+ 		int Id(void);
+ 		void Marshall(MarshallHandle* marshallhandle);
+ 		int ObjectEnum(void);
+-		
++
+ 		/*Definition virtual function resolutoin: */
+ 		int DefinitionEnum();
+ 		char* Name();
+Index: ../trunk-jpl/src/c/classes/Numberedcostfunction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Numberedcostfunction.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Numberedcostfunction.h	(revision 26469)
+@@ -9,7 +9,6 @@
+ #include "./Definition.h"
+ #include "./FemModel.h"
+ 
+-
+ IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);
+ 
+ class Numberedcostfunction: public Object, public Definition{
+Index: ../trunk-jpl/src/c/classes/Options/Option.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Options/Option.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Options/Option.h	(revision 26469)
+@@ -27,7 +27,6 @@
+ 		void          Marshall(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
+ 		int           ObjectEnum(){return OptionEnum;};
+ 
+-
+ 		/*virtual functions: */
+ 		virtual char* Name()=0;
+ 
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 26469)
+@@ -37,7 +37,6 @@
+ #define EPLUpdate				24 /*Profiling MPISerial */
+ #define MAXPROFSIZE			25 /*Used to initialize static arrays*/
+ 
+-
+ class Profiler: public Object{
+ 
+ 	public:
+Index: ../trunk-jpl/src/c/classes/Radar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Radar.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Radar.h	(revision 26469)
+@@ -17,12 +17,12 @@
+ 	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);
+@@ -30,7 +30,7 @@
+ 		int  Id(void);
+ 		void Marshall(MarshallHandle* marshallhandle);
+ 		int ObjectEnum(void);
+-		
++
+ 		/*Definition virtual function resolutoin: */
+ 		int DefinitionEnum();
+ 		char* Name();
+Index: ../trunk-jpl/src/c/classes/SealevelGeometry.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/SealevelGeometry.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/SealevelGeometry.h	(revision 26469)
+@@ -35,7 +35,7 @@
+ 		int         nsubel[SLGEOM_NUMLOADS];
+ 		int         nbar[SLGEOM_NUMLOADS];
+ 		int*        lids; 
+-		
++
+ 		SealevelGeometry(int localnel,int localnods);
+ 		~SealevelGeometry();
+ 		void InitializeMappingsAndBarycentres(void);
+Index: ../trunk-jpl/src/c/classes/kriging/Covertree.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Covertree.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/kriging/Covertree.h	(revision 26469)
+@@ -94,7 +94,6 @@
+ 	 */
+ 	bool isValidTree() const;
+ 
+-
+ 	/**
+ 	 * Remove point p from the cover tree. If p is not present in the tree,
+ 	 * it will remain unchanged. Otherwise, this will remove exactly one
+Index: ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 26469)
+@@ -28,7 +28,6 @@
+ 		void Marshall(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
+ 		int   ObjectEnum(){_error_("Not implemented yet");};
+ 
+-
+ 		/*Variogram functions*/
+ 		double Covariance(double deltax,double deltay);
+ 		double SemiVariogram(double deltax,double deltay);
+Index: ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 26469)
+@@ -28,7 +28,6 @@
+ 		void Marshall(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
+ 		int   ObjectEnum(){_error_("Not implemented yet");};
+ 
+-
+ 		/*Variogram functions*/
+ 		double Covariance(double deltax,double deltay);
+ 		double SemiVariogram(double deltax,double deltay);
+Index: ../trunk-jpl/src/c/classes/kriging/Quadtree.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 26469)
+@@ -32,7 +32,6 @@
+ 				void    Marshall(MarshallHandle* marshallhandle){ _error_("not implemented yet!");};
+ 				int     ObjectEnum(){_error_("not implemented yet"); };
+ 
+-
+ 				/*Methods*/
+ 				int          IsWithinRange(double  x,double y,double range);
+ 				void         RangeSearch(int *indices,int *pnobs,double x,double y,double range);
+Index: ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 26469)
+@@ -28,7 +28,6 @@
+ 		void  Marshall(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
+ 		int   ObjectEnum(){_error_("Not implemented yet");};
+ 
+-
+ 		/*Variogram functions*/
+ 		double Covariance(double deltax,double deltay);
+ 		double SemiVariogram(double deltax,double deltay);
+Index: ../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 26468)
++++ ../trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h	(revision 26469)
+@@ -5,7 +5,6 @@
+ #ifndef _CONSTRAINTSSTATELOCAL_H
+ #define _CONSTRAINTSSTATELOCAL_H
+ 
+-
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+ #else
+Index: ../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 26468)
++++ ../trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h	(revision 26469)
+@@ -14,5 +14,4 @@
+ void	GetVectoronBaseFromInputsx(IssmDouble** pvector,FemModel* femmodel,int name,int type);
+ void  GetVectorFromInputsx(IssmDouble** pvector,int* pvector_size, FemModel* femmodel,int name);
+ 
+-
+ #endif  /* _GETVECTORFROMINPUTSXX_H */
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 26468)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h	(revision 26469)
+@@ -12,5 +12,4 @@
+ void  MmeToInput(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,int rootenum, int interpolationenum);
+ void InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name);
+ 
+-
+ #endif  /* _INPUTUPDATEFROMDAKOTAXX_H */
+Index: ../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 26468)
++++ ../trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h	(revision 26469)
+@@ -25,7 +25,6 @@
+ 	int* index2d=NULL;
+ 	int  count=0;
+ 
+-
+ 	switch(meshelementtype){
+ 		case TriaEnum:
+ 		case TetraEnum:
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 26468)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 26469)
+@@ -89,7 +89,7 @@
+ 		}
+ 		/*}}}*/
+ 		void Init(int Min,int Nin){/*{{{*/
+-			
++
+ 			this->buckets=new DataSet();
+ 
+ 			this->M=Min;
+@@ -287,7 +287,7 @@
+ 					counter=counters_perrow[row]++;
+ 				}
+ 			}
+-					
++
+ 			/*Plug into matrix: */
+ 			for(int i=0;i<this->m;i++) this->matrix[i]->SetValues(numvalues_perrow[i],cols_perrow[i],values_perrow[i],mods_perrow[i]);
+ 
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 26468)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 26469)
+@@ -444,7 +444,6 @@
+ 			comm=IssmComm::GetComm();
+ 			num_procs=IssmComm::GetSize();
+ 
+-
+ 			/*Allocate: */
+ // AD performance is sensitive to calls to ensurecontiguous.
+ // Providing "t" will cause ensurecontiguous to be called.
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26468)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26469)
+@@ -333,6 +333,6 @@
+ 			*pvalue=value;
+ 		}
+ 		/*}}}*/
+-		
++
+ };
+ #endif //#ifndef _ISSM_SEQ_VEC_H_
+Index: ../trunk-jpl/src/c/toolkits/issm/SparseRow.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/SparseRow.h	(revision 26468)
++++ ../trunk-jpl/src/c/toolkits/issm/SparseRow.h	(revision 26469)
+@@ -18,7 +18,7 @@
+ 		int         ncols; //number of non-zeros 
+ 		int*        indices;
+ 		doubletype* values;
+-		
++
+ 		/*SparseRow constructors, destructors*/
+ 		SparseRow(){ /*{{{*/
+ 			 M=0;
+@@ -27,7 +27,7 @@
+ 			 values=NULL;
+ 		} /*}}}*/
+ 		SparseRow(int in_M){/*{{{*/
+-			
++
+ 			M=in_M;
+ 			ncols=0;
+ 			indices=NULL;
+@@ -86,7 +86,7 @@
+ 			/*Allocate and fill: */
+ 			indices=xNew<int>(ncols); _assert_(indices);
+ 			values=xNewZeroInit<doubletype>(ncols);  _assert_(values);
+-			
++
+ 			count=0;
+ 			for(i=0;i<numvalues;i++){
+ 				if(cols[i]>=0){
+@@ -95,7 +95,7 @@
+ 					count++;
+ 				}
+ 			}
+-		
++
+ 			if(count!=ncols)_error_("counter problem during set values operations");
+ 		} /*}}}*/
+ 		doubletype Norm(NormMode mode){ /*{{{*/
+@@ -131,7 +131,7 @@
+ 			for(i=0;i<ncols;i++){
+ 				mult+=values[i]*X[indices[i]];
+ 			}
+-			
++
+ 			return mult;
+ 		}
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26468)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26469)
+@@ -215,7 +215,6 @@
+ 		IssmDouble         EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure);
+ 		IssmDouble         PureIceEnthalpy(IssmDouble pressure);
+ 
+-
+ 		/*Virtual functions*/
+ 		virtual void       AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum){_error_("not implemented");};
+ 		virtual void       AddInput(int input_enum, IssmDouble* values, int interpolation_enum){_error_("not implemented");};
+Index: ../trunk-jpl/src/c/shared/Matrix/matrix.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 26468)
++++ ../trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 26469)
+@@ -24,7 +24,7 @@
+ void Matrix4x4Invert(IssmDouble* Ainv, IssmDouble* A);
+ void Matrix4x4Determinant(IssmDouble* Adet,IssmDouble* A);
+ void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B);
+- 
++
+ void newcell(IssmDouble** pcell, IssmDouble newvalue, bool top, int m);
+ IssmDouble  cellsum(IssmDouble* cell, int m);
+ void celldelete(IssmDouble** pcell, int m, int* indices, int nind);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26469-26470.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26469-26470.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26469-26470.diff	(revision 26740)
@@ -0,0 +1,66 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26469)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26470)
+@@ -58,34 +58,12 @@
+ 	}
+ }
+ /*}}}*/
+-Friction::Friction(Element* element_in,IssmDouble dim){/*{{{*/
+-
+-	this->element=element_in;
++Friction::Friction(Element* element_in,int dim) : Friction(element_in) {/*{{{*/
++	this->apply_dim = reCast<IssmDouble>(dim);
++}
++/*}}}*/
++Friction::Friction(Element* element_in,IssmDouble dim) : Friction(element_in) {/*{{{*/
+ 	this->apply_dim = dim;
+-
+-	/* Load necessary parameters */
+-	element_in->FindParam(&this->law,FrictionLawEnum);
+-	element_in->FindParam(&this->domaintype,DomainTypeEnum);
+-
+-	/* Load VxBase and VyBase for this special case */
+-	switch(this->domaintype){
+-		case Domain2DhorizontalEnum: 
+-			this->vx_input = element_in->GetInput(VxBaseEnum);			_assert_(this->vx_input); 
+-			this->vy_input = element_in->GetInput(VyBaseEnum);			_assert_(this->vy_input);
+-			this->vz_input = NULL;
+-			break;
+-      case Domain2DverticalEnum:
+-			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
+-			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
+-			this->vz_input = NULL;
+-			break;
+-      case Domain3DEnum:           
+-			this->vx_input = element_in->GetInput(VxEnum);				_assert_(this->vx_input);
+-			this->vy_input = element_in->GetInput(VyEnum);				_assert_(this->vy_input);
+-			this->vz_input = element_in->GetInput(VzEnum);				_assert_(this->vz_input);
+-			break;
+-      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-	}
+ }
+ /*}}}*/
+ Friction::~Friction(){/*{{{*/
+@@ -92,6 +70,7 @@
+ }
+ /*}}}*/
+ 
++
+ /*methods: */
+ void Friction::Echo(void){/*{{{*/
+ 	_printf_("Friction:\n");
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26469)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26470)
+@@ -24,7 +24,8 @@
+ 		/*methods: */
+ 		Friction();
+ 		Friction(Element* element_in);
+-		Friction(Element* element_in, double dim);
++		Friction(Element* element_in, int dim);
++		Friction(Element* element_in, IssmDouble dim);
+ 		~Friction();
+ 
+ 		void  Echo(void);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26470-26471.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26470-26471.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26470-26471.diff	(revision 26740)
@@ -0,0 +1,184 @@
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26470)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26471)
+@@ -1,6 +1,8 @@
++using Printf
++
++#Define classes used by model struct
+ abstract type AbstractMesh end
+-
+-struct Mesh2dTriangle <: AbstractMesh
++mutable struct Mesh2dTriangle <: AbstractMesh
+ 	numberofvertices::Int32
+ 	numberofelements::Int32
+ 	x::Vector{Float64}
+@@ -7,8 +9,10 @@
+ 	y::Vector{Float64}
+ 	elements::Matrix{Int32}
+ end
+-
+-struct Mesh3dPrism{T} <: AbstractMesh
++function Mesh2dTriangle() #{{{
++	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int32}(undef, 0, 0))
++end# }}}
++mutable struct Mesh3dPrism{T} <: AbstractMesh
+ 	numberofvertices::Int32
+ 	numberofelements::Int32
+ 	numberoflayers::Int32
+@@ -17,45 +21,36 @@
+ 	z::Vector{Float64}
+ 	elements::Matrix{Int32}
+ end
+-
+-struct Geometry
++function Mesh3dPrism() #{{{
++	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int32}(undef, 0, 0))
++end# }}}
++mutable struct Geometry
+ 	surface::Vector{Float64}
+ 	base::Vector{Float64}
+ 	thickness::Vector{Float64}
+ 	bed::Vector{Float64}
+ end
++function Geometry() #{{{
++	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
+ 
+-function configure(;
+-        MeshType = Mesh2dTriangle,
+-		  meshnbv = 0,
+-		  meshnbe = 0,
+-        meshx = [NaN],
+-        meshy = [NaN],
+-		  meshel = [0],
+-        GeometryType = Geometry,
+-		  geos = [NaN],
+-		  geob1 = [NaN],
+-		  geoh = [NaN],
+-		  geob2 = [NaN],
+-    )
++mutable struct model
++	mesh::AbstractMesh
++	geometry::Geometry
++end
++function model() #{{{
++	return model(Mesh2dTriangle(),Geometry())
++end#}}}
++function Base.show(io::IO, md::model)# {{{
+ 
+-	mesh = MeshType(meshnbv,meshnbe,meshx,meshy,meshel)
+-	geometry = Geometry(geos,geob1,geoh,geob2)
++	compact = get(io, :compact, false)
+ 
+-    return (mesh = mesh, geometry = geometry)
+-end
++	println(io,"Model:")
++	@printf "%19s: %-22s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
++	@printf "%19s: %-22s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
+ 
+-solve(model::NamedTuple) = solve(model.mesh, model.geometry)
++end# }}}
+ 
+-function solve(mesh::Mesh2dTriangle, geometry::Geometry)
+-    println("Solving with triangular mesh, ... data, ...")
+-    # do something
+-end
+-function solve(mesh::Mesh3dPrism, geometry::Geometry)
+-    println("Solving with rectangular mesh, ... data, ...")
+-    # do something
+-end
+-
+ # Probably actually want something more like:
+ # function solve(mesh::AbstractMesh, data::AbstractDataset)
+ #     do_something_with_mesh(mesh) # This will dispatch
+@@ -62,48 +57,3 @@
+ #     do_something_with_data(data) # This will dispatch
+ #     # do something
+ # end
+-
+-function remake(model::NamedTuple;
+-        MeshType = typeof(model.mesh),
+-		  meshnbv = model.mesh.nbv,
+-		  meshnbe = model.mesh.nbe,
+-        meshx = model.mesh.x,
+-        meshy = model.mesh.y,
+-		  meshel = model.mesh.elements,
+-        surface = model.geometry.surface,
+-        base = model.geometry.base,
+-		  thickness = model.geometry.thickness,
+-		  bed = model.geometry.bed,
+-    )
+-
+-    mesh = MeshType(meshnbv, meshnbe, meshx, meshy, meshel)
+-	 geometry = geometry(surface, base, thickness, bed)
+-
+-    return (mesh = mesh, geometry = geometry)
+-end
+-
+-function remesh(model::NamedTuple;
+-        MeshType = Mesh2dTriangle,
+-        meshx = rand(1000),
+-        meshy = rand(1000)
+-    )
+-
+-    new_mesh = MeshType(meshx, meshy)
+-    return (mesh = new_mesh, data = model.data)
+-end
+-
+-## --- Try it out
+-
+-# Just use default parameters
+-model = configure()
+-solve(model)
+-## --- Try it out
+-
+-# Actually specify some relevant parameters
+-model = configure(
+-    MeshType = Mesh3dPrism,
+-    foo = rand(10000),
+-    bar = rand(1000,1000),
+-    baz = randn(1000,1000)
+-)
+-solve(model)
+Index: ../trunk-jpl/src/jl/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/triangle.jl	(revision 26470)
++++ ../trunk-jpl/src/jl/triangle.jl	(revision 26471)
+@@ -1,4 +1,5 @@
+ #see https://github.com/JuliaGeometry/Triangulate.jl/blob/master/src/plot.jl
++#see https://github.com/JuliaGeometry/MeshViz.jl/blob/master/src/simplemesh.jl
+ 
+ #Class Triangle's triangulateio
+ mutable struct CTriangulateIO #{{{
+@@ -51,6 +52,7 @@
+ end# }}}
+ 
+ using Printf, PyPlot
++using GLMakie
+ """
+ TRIANGLE - create model mesh using the triangle package
+ 
+@@ -165,12 +167,15 @@
+ 
+ 	#plot
+ 	clf()
+-	fig = matplotlib[:pyplot][:figure]("2D Mesh Plot", figsize = (10,10))
+-	ax = matplotlib[:pyplot][:axes]()
+-	ax[:set_aspect]("equal")
+-	tri = ax[:triplot](points[:,1], points[:,2], elements.-1)
+-	setp(tri, linestyle = "-", linewidth = 1.5, marker = "None", markersize = 5., color = "blue")
+-
+-	fig[:canvas][:draw]()
++	if false
++		poly(points, elements, strokewidth=1, shading=false,transparency=true)
++	else
++		fig = matplotlib[:pyplot][:figure]("2D Mesh Plot", figsize = (10,10))
++		ax = matplotlib[:pyplot][:axes]()
++		ax[:set_aspect]("equal")
++		tri = ax[:triplot](points[:,1], points[:,2], elements.-1)
++		setp(tri, linestyle = "-", linewidth = 1.5, marker = "None", markersize = 5., color = "blue")
++		fig[:canvas][:draw]()
++	end
+ 	
+ end#}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26471-26472.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26471-26472.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26471-26472.diff	(revision 26740)
@@ -0,0 +1,140 @@
+Index: ../trunk-jpl/src/jl/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/exp.jl	(revision 26471)
++++ ../trunk-jpl/src/jl/exp.jl	(revision 26472)
+@@ -93,7 +93,7 @@
+ 
+ 			#read Info
+ 			A = readline(f); line += 1
+-			if A[1:20]!="# Points Count Value"
++			if A[1:14]!="# Points Count"
+ 				println("line $(line): $(A)")
+ 				error("Unexpected exp file formatting") 
+ 			end
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26471)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26472)
+@@ -33,13 +33,21 @@
+ function Geometry() #{{{
+ 	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+ end# }}}
++mutable struct Mask
++	ocean_levelset::Vector{Float64}
++	ice_levelset::Vector{Float64}
++end
++function Mask() #{{{
++	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
+ 
+ mutable struct model
+ 	mesh::AbstractMesh
+ 	geometry::Geometry
++	mask::Mask
+ end
+ function model() #{{{
+-	return model(Mesh2dTriangle(),Geometry())
++	return model( Mesh2dTriangle(), Geometry(), Mask())
+ end#}}}
+ function Base.show(io::IO, md::model)# {{{
+ 
+@@ -48,6 +56,7 @@
+ 	println(io,"Model:")
+ 	@printf "%19s: %-22s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
+ 	@printf "%19s: %-22s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
++	@printf "%19s: %-22s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+ 
+ end# }}}
+ 
+Index: ../trunk-jpl/src/jl/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/plotmodel.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/plotmodel.jl	(revision 26472)
+@@ -0,0 +1,23 @@
++
++#import ColorSchemes.leonardo
++#include("issm.jl")
++
++using GLMakie
++
++function plotmodel(md::model)
++
++	elementcolor = :yellow
++	vertexcolor  = :black
++	facetcolor   = :blue
++	showvertices = true
++	showfacets   = true
++
++	scene = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = elementcolor)
++
++	if showvertices
++		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
++	end
++
++
++	return scene
++end
+Index: ../trunk-jpl/src/jl/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/triangle.jl	(revision 26471)
++++ ../trunk-jpl/src/jl/triangle.jl	(revision 26472)
+@@ -1,5 +1,3 @@
+-#see https://github.com/JuliaGeometry/Triangulate.jl/blob/master/src/plot.jl
+-#see https://github.com/JuliaGeometry/MeshViz.jl/blob/master/src/simplemesh.jl
+ 
+ #Class Triangle's triangulateio
+ mutable struct CTriangulateIO #{{{
+@@ -51,8 +49,10 @@
+ 	println(io,")")
+ end# }}}
+ 
+-using Printf, PyPlot
+-using GLMakie
++using Printf #needed for sprintf
++include("issm.jl")
++include("exp.jl")
++
+ """
+ TRIANGLE - create model mesh using the triangle package
+ 
+@@ -69,7 +69,7 @@
+  - md=triangle(md,'DomainOutline.exp',1000);
+  - md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
+ """
+-function triangle(domainname::String,resolution::Float64) #{{{
++function triangle(md::model,domainname::String,resolution::Float64) #{{{
+ 
+ 	#read input file
+ 	contours = expread(domainname)
+@@ -160,22 +160,14 @@
+ 	println("number of elements: ",ctio_out.numberoftriangles)
+ 
+ 	#post process output
+-	numberofvertices = ctio_out.numberofpoints
+-	numberofelements = ctio_out.numberoftriangles
+-	points           = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
+-	elements         = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
++	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
++	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
++	md.mesh = Mesh2dTriangle()
++	md.mesh.numberofvertices = ctio_out.numberofpoints
++	md.mesh.numberofelements = ctio_out.numberoftriangles
++	md.mesh.x                = points[:,1]
++	md.mesh.y                = points[:,2]
++	md.mesh.elements         = triangles
+ 
+-	#plot
+-	clf()
+-	if false
+-		poly(points, elements, strokewidth=1, shading=false,transparency=true)
+-	else
+-		fig = matplotlib[:pyplot][:figure]("2D Mesh Plot", figsize = (10,10))
+-		ax = matplotlib[:pyplot][:axes]()
+-		ax[:set_aspect]("equal")
+-		tri = ax[:triplot](points[:,1], points[:,2], elements.-1)
+-		setp(tri, linestyle = "-", linewidth = 1.5, marker = "None", markersize = 5., color = "blue")
+-		fig[:canvas][:draw]()
+-	end
+-	
++   return md
+ end#}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26472-26473.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26472-26473.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26472-26473.diff	(revision 26740)
@@ -0,0 +1,67 @@
+Index: ../trunk-jpl/src/jl/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/exp.jl	(revision 26472)
++++ ../trunk-jpl/src/jl/exp.jl	(revision 26473)
+@@ -1,3 +1,4 @@
++#for exptool, look into this http://juliaplots.org/MakieReferenceImages/gallery//mouse_picking/index.html
+ 
+ #exp object definition, constructor, and disp
+ mutable struct ExpStruct #{{{
+Index: ../trunk-jpl/src/jl/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/plotmodel.jl	(revision 26472)
++++ ../trunk-jpl/src/jl/plotmodel.jl	(revision 26473)
+@@ -1,23 +1,45 @@
++import ColorSchemes.jet
+ 
+-#import ColorSchemes.leonardo
+-#include("issm.jl")
+-
+ using GLMakie
+ 
+-function plotmodel(md::model)
++function plotmodel(md::model,data)
+ 
+-	elementcolor = :yellow
+ 	vertexcolor  = :black
+ 	facetcolor   = :blue
+ 	showvertices = true
+ 	showfacets   = true
+ 
+-	scene = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = elementcolor)
++	if data isa AbstractVector
+ 
++		if length(data)==md.mesh.numberofelements
++			# vector of polygons
++			x = md.mesh.x
++			y = md.mesh.y
++			index = md.mesh.elements
++			ps = [Makie.GeometryBasics.Polygon([Point2(x[index[i,1]], y[index[i,1]]), Point2(x[index[i,2]], y[index[i,2]]), Point2(x[index[i,3]], y[index[i,3]])])
++					for i in 1:md.mesh.numberofelements]
++
++			fig, ax, h = Makie.poly(ps, color = data, colormap = jet)
++
++			#Add colorbar
++			Colorbar(fig[1, 2], limits = (minimum(data), maximum(data)), colormap = jet)
++		elseif length(data)==md.mesh.numberofvertices
++			fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
++
++			#Add colorbar
++			Colorbar(fig[1, 2], h, width=25)
++		else
++			error("data of size "*string(length(data))*" not supported yet!")
++		end
++	else
++		# default to single color
++		@assert length(data)==1
++		fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
++	end
++
+ 	if showvertices
+ 		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
+ 	end
+ 
+-
+-	return scene
++	return fig
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26473-26474.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26473-26474.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26473-26474.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/coordsystems/ll2xy.m
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/ll2xy.m	(revision 26473)
++++ ../trunk-jpl/src/m/coordsystems/ll2xy.m	(revision 26474)
+@@ -35,7 +35,7 @@
+ end
+ 
+ if nargout~=3 & nargout~=2,
+-	help xy2ll
++	help ll2xy
+ 	error('bad usage');
+ end
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26474-26475.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26474-26475.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26474-26475.diff	(revision 26740)
@@ -0,0 +1,49 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26474)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26475)
+@@ -509,7 +509,7 @@
+ 					S_input->GetInputValue(&S,gauss);
+ 					for(i=0;i<vnumnodes;i++){
+ 						if (domaintype!=Domain2DverticalEnum){
+-							scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
++							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+ 							dux=scale*(vxobs-vx);
+ 							duy=scale*(vyobs-vy);
+ 							pe->values[i*3+0]+=dux*weight*Jdet*gauss->weight*vbasis[i]; 
+@@ -516,7 +516,7 @@
+ 							pe->values[i*3+1]+=duy*weight*Jdet*gauss->weight*vbasis[i]; 
+ 						}
+ 						else{
+-							scale=1./(S*2*fabs(vx-vxobs)+epsvel);
++							scale=1./(S*fabs(vx-vxobs)+epsvel);
+ 							dux=scale*(vxobs-vx);
+ 							pe->values[i*2+0]+=dux*weight*Jdet*gauss->weight*vbasis[i]; 
+ 						}
+@@ -745,7 +745,7 @@
+ 					S_input->GetInputValue(&S,gauss);
+ 					for(i=0;i<numnodes;i++){
+ 						if(domaintype!=Domain2DverticalEnum){
+-							scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
++							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+ 							dux=scale*(vxobs-vx);
+ 							duy=scale*(vyobs-vy);
+ 							pe->values[i*2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -997,7 +997,7 @@
+ 					S_input->GetInputValue(&S,gauss);
+ 					for(i=0;i<numnodes;i++){
+ 						if(domaintype!=Domain2DverticalEnum){
+-							scale=1./(S*2*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
++							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
+ 							dux=scale*(vxobs-vx);
+ 							duy=scale*(vyobs-vy);
+ 							pe->values[i*2+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+@@ -1004,7 +1004,7 @@
+ 							pe->values[i*2+1]+=duy*weight*Jdet*gauss->weight*basis[i]; 
+ 						}
+ 						else{
+-							scale=1./(S*2*fabs(vx-vxobs)+epsvel);
++							scale=1./(S*fabs(vx-vxobs)+epsvel);
+ 							dux=scale*(vxobs-vx);
+ 							pe->values[i]+=dux*weight*Jdet*gauss->weight*basis[i]; 
+ 						}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26475-26476.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26475-26476.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26475-26476.diff	(revision 26740)
@@ -0,0 +1,10 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26475)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26476)
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @PARMETISINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@ @PROJINCL@
++AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @TRIANGLEINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @PARMETISINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJINCL@ @ESMFINCL@ @PROJINCL@
+ AM_FCFLAGS = @SEMICINCL@
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
Index: /issm/oecreview/Archive/25834-26739/ISSM-26476-26477.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26476-26477.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26476-26477.diff	(revision 26740)
@@ -0,0 +1,964 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26476)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26477)
+@@ -186,6 +186,7 @@
+ 	./shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp \
+ 	./shared/Elements/DrainageFunctionWaterfraction.cpp \
+ 	./shared/Elements/EstarComponents.cpp \
++	./shared/Random/random.cpp \
+ 	./shared/String/DescriptorIndex.cpp \
+ 	./toolkits/issm/IssmToolkitUtils.cpp \
+ 	./toolkits/issm/IssmSolver.cpp \
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26477)
+@@ -178,6 +178,9 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.b_max",SmbBMaxEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.b_min",SmbBMinEnum);
+ 			break;
++		case SMBautoregressionEnum:
++         iomodel->FetchDataToInput(inputs,elements,"md.smb.basin_id",SmbBasinsIdEnum);
++         break;
+ 		case SMBhenningEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.smbref",SmbSmbrefEnum,0.);
+ 			break;
+@@ -374,6 +377,9 @@
+ 		case SMBgradientselaEnum:
+ 			/*Nothing to add to parameters*/
+ 			break;
++		case SMBautoregressionEnum:
++         /*Nothing to add to parameters*/
++         break;
+ 		case SMBhenningEnum:
+ 			/*Nothing to add to parameters*/
+ 			break;
+@@ -466,6 +472,10 @@
+ 			if(VerboseSolution())_printf0_("	call smb gradients ela module\n");
+ 			SmbGradientsElax(femmodel);
+ 			break;
++		case SMBautoregressionEnum:
++         if(VerboseSolution())_printf0_("    call smb autoregression module\n");
++         Smbautoregressionx(femmodel);
++         break;
+ 		case SMBhenningEnum:
+ 			if(VerboseSolution())_printf0_("  call smb Henning module\n");
+ 			SmbHenningx(femmodel);
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26476)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26477)
+@@ -12,6 +12,8 @@
+ void SmbForcingx(FemModel* femmodel);
+ void SmbGradientsx(FemModel* femmodel);
+ void SmbGradientsElax(FemModel* femmodel);
++void SmbautoregressionInitx(FemModel* femmodel);
++void Smbautoregressionx(FemModel* femmodel);
+ void Delta18oParameterizationx(FemModel* femmodel);
+ void MungsmtpParameterizationx(FemModel* femmodel);
+ void Delta18opdParameterizationx(FemModel* femmodel);
+Index: ../trunk-jpl/src/c/shared/Matrix/matrix.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 26476)
++++ ../trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 26477)
+@@ -30,4 +30,5 @@
+ void celldelete(IssmDouble** pcell, int m, int* indices, int nind);
+ void cellsplit(IssmDouble** pcell, int m, int i,IssmDouble scale);
+ void cellecho(int numcells, int m, ...);
++void CholeskyRealPositiveDefinite(IssmDouble* Lchol, IssmDouble* A, int ndim);
+ #endif //ifndef _MATRIXUTILS_H_
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26477)
+@@ -3573,6 +3573,72 @@
+ 
+ }
+ /*}}}*/
++void       Element::SmbautoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin){/*{{{*/
++	const int numvertices = this->GetNumberOfVertices();
++	int         basinid;
++	IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin; //initialize scalars 
++	IssmDouble* phi_basin               = xNew<IssmDouble>(arorder);
++   IssmDouble* smbspin                 = xNew<IssmDouble>(numvertices*arorder);
++	this->GetInputValue(&basinid,SmbBasinsIdEnum);
++	for(int ii{0};ii<arorder;ii++){phi_basin[ii] = phi[basinid*arorder+ii];}
++	beta0_basin   = beta0[basinid];
++	beta1_basin   = beta1[basinid];
++	for(int jj{0};jj<nspin;jj++){	
++		tspin = starttime-((nspin-jj)*tstep_ar); //current time in spin-up loop
++      noisespin_basin = noisespin[jj*numbasins+basinid];
++      IssmDouble* oldsmbspin = xNewZeroInit<IssmDouble>(numvertices*arorder);
++      for(int ii{0};ii<numvertices*arorder;ii++){oldsmbspin[ii]=smbspin[ii];} //copy smbspin in oldsmbspin
++      for(int v=0;v<numvertices;v++){
++         double autoregressionterm{0.0};
++         for(int ii{0};ii<arorder;ii++){autoregressionterm += phi_basin[ii]*smbspin[v+ii*numvertices];}
++         smbspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm+noisespin_basin; //compute newest values in smbspin
++      }
++      for(int ii{0};ii<(arorder-1)*numvertices;ii++){smbspin[ii+numvertices]=oldsmbspin[ii];} //correct older values in smbspin
++      xDelete<IssmDouble>(oldsmbspin); //cleanup
++	}
++	this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,smbspin,numvertices*arorder);//save spin-up autoregression values
++   xDelete<IssmDouble>(smbspin); //cleanup
++   xDelete<IssmDouble>(phi_basin); //cleanup
++}/*}}}*/
++void       Element::Smbautoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms){/*{{{*/
++	const int numvertices = this->GetNumberOfVertices();
++	int         basinid,M,N;
++	IssmDouble  beta0_basin,beta1_basin,noise_basin; //initialize scalars 
++	IssmDouble* phi_basin               = xNew<IssmDouble>(arorder);
++   IssmDouble* smblist                 = xNew<IssmDouble>(numvertices);
++	IssmDouble* smbvaluesautoregression = NULL; //array for past SMB values that we are about to retrieve
++	this->GetInputValue(&basinid,SmbBasinsIdEnum);
++	for(int ii{0};ii<arorder;ii++){phi_basin[ii] = phi[basinid*arorder+ii];}
++	beta0_basin   = beta0[basinid];
++	beta1_basin   = beta1[basinid];
++	noise_basin   = noiseterms[basinid]; //note that noiseterms is computed at every timestep
++	this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&smbvaluesautoregression,&M); //get array of past SMB values to compute AR model
++	/*If not AR model timestep: take the old SMB values*/
++	if(isstepforar==false){
++		//VV do something with the lapse rate here if needed (12Oct2021)
++      for(int ii{0};ii<numvertices;ii++){smblist[ii]=smbvaluesautoregression[ii];}
++	}
++	/*If AR model timestep: compute SMB values on vertices from AR*/
++	else{
++		for(int v=0;v<numvertices;v++){
++			double autoregressionterm{0.0};
++			for(int ii{0};ii<arorder;ii++){autoregressionterm += phi_basin[ii]*smbvaluesautoregression[v+ii*numvertices];} //compute autoregressive term
++			smblist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin; //stochastic SMB value
++		}
++		/*Update autoregression smb values*/
++		IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
++		for(int ii{0};ii<numvertices;ii++){temparray[ii] = smblist[ii];} //first store newly computed smb values
++		for(int ii{0};ii<(arorder-1)*numvertices;ii++){temparray[ii+numvertices] = smbvaluesautoregression[ii];} //second shift older smb values
++		this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); //save updated autoregression values
++		xDelete<IssmDouble>(temparray); //cleanup
++	}
++	/*Add input to element*/
++	this->AddInput(SmbMassBalanceEnum,smblist,P1Enum);
++	/*Cleanup*/
++	xDelete<IssmDouble>(phi_basin);
++	xDelete<IssmDouble>(smblist);
++	xDelete<IssmDouble>(smbvaluesautoregression);
++}/*}}}*/
+ void       Element::SmbGemb(IssmDouble timeinputs, int count){/*{{{*/
+ 
+ 	/*only compute SMB at the surface: */
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26476)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26477)
+@@ -175,6 +175,8 @@
+ 		void               SetIntInput(Inputs* inputs,int enum_in,int value);
+ 		void               SmbSemic();
+ 		int                Sid();
++		void               SmbautoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin);
++		void               Smbautoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms);
+ 		void               SmbGemb(IssmDouble timeinputs, int count);
+ 		void               StrainRateESA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               StrainRateFS(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26477)
+@@ -395,6 +395,25 @@
+ 		case SMBgradientscomponentsEnum:
+ 			/*Nothing to add*/
+ 			break;
++		case SMBautoregressionEnum:
++         /*Add parameters that are not in standard nbvertices format*/
++         parameters->AddObject(iomodel->CopyConstantObject("md.smb.num_basins",SmbNumBasinsEnum));
++         parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_order",SmbAutoregressiveOrderEnum));
++         parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_initialtime",SmbAutoregressionInitialTimeEnum));
++         parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_timestep",SmbAutoregressionTimestepEnum));
++         iomodel->FetchData(&transparam,&M,&N,"md.smb.beta0");
++         parameters->AddObject(new DoubleVecParam(SmbBeta0Enum,transparam,N));
++         xDelete<IssmDouble>(transparam);
++         iomodel->FetchData(&transparam,&M,&N,"md.smb.beta1");
++         parameters->AddObject(new DoubleVecParam(SmbBeta1Enum,transparam,N));
++         xDelete<IssmDouble>(transparam);
++         iomodel->FetchData(&transparam,&M,&N,"md.smb.phi");
++         parameters->AddObject(new DoubleMatParam(SmbPhiEnum,transparam,M,N));
++         xDelete<IssmDouble>(transparam);
++         iomodel->FetchData(&transparam,&M,&N,"md.smb.covmat");
++         parameters->AddObject(new DoubleMatParam(SmbCovmatEnum,transparam,M,N));
++         xDelete<IssmDouble>(transparam);
++         break;
+ 		case SMBgembEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIce",SmbAIceEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aSnow",SmbASnowEnum));
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26477)
+@@ -7,6 +7,7 @@
+ #include "../../toolkits/toolkits.h"
+ #include "../modules.h"
+ #include "../../classes/Inputs/TransientInput.h"
++#include "../../shared/Random/random.h"
+ 
+ void SmbForcingx(FemModel* femmodel){/*{{{*/
+ 
+@@ -144,6 +145,86 @@
+ 	}
+ 
+ }/*}}}*/
++void SmbautoregressionInitx(FemModel* femmodel){/*{{{*/
++	/*Initialization step of Smbautoregressionx*/
++	int M,N,Nphi,arorder,numbasins;
++	IssmDouble starttime,tstep_ar,tinit_ar;
++	IssmDouble* beta0    = xNew<IssmDouble>(numbasins);
++	IssmDouble* beta1    = xNew<IssmDouble>(numbasins);
++	IssmDouble* phi      = xNew<IssmDouble>(numbasins*arorder);
++	IssmDouble* covmat   = xNew<IssmDouble>(numbasins*numbasins);
++	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
++   femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
++	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
++	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
++	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
++	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
++	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
++	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
++	femmodel->parameters->FindParam(&covmat,&M,&N,SmbCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
++	/*AR model spin-up*/
++	int nspin{2*arorder+5}; //number of spin-up steps to be executed
++	IssmDouble* noisespin = xNewZeroInit<IssmDouble>(numbasins*nspin); //sample of basin-specific noise at each spinup step
++	for(int ii{0};ii<nspin;ii++){
++		IssmDouble* temparray = xNew<IssmDouble>(numbasins);
++		multivariateNormal(&temparray,numbasins,0.0,covmat);
++		for(int jj{0};jj<numbasins;jj++){noisespin[ii*numbasins+jj]=temparray[jj];}
++		xDelete<IssmDouble>(temparray);
++	}
++	/*Initialize SmbValuesAutoregressionEnum*/
++	for(Object* &object:femmodel->elements->objects){
++      Element* element      = xDynamicCast<Element*>(object); //generate element object
++		element->SmbautoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,noisespin);
++	}
++	/*Cleanup*/
++	xDelete<IssmDouble>(beta0);
++	xDelete<IssmDouble>(beta1);
++	xDelete<IssmDouble>(phi);
++	xDelete<IssmDouble>(noisespin);
++	xDelete<IssmDouble>(covmat);
++}/*}}}*/
++void Smbautoregressionx(FemModel* femmodel){/*{{{*/
++	/*Get time parameters*/
++	IssmDouble time,dt,starttime,tstep_ar;
++	femmodel->parameters->FindParam(&time,TimeEnum);
++	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
++   femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
++	/*Initialize module at first time step*/
++	if(time<=starttime+dt){SmbautoregressionInitx(femmodel);}
++	/*Determine if this is a time step for the AR model*/
++	bool isstepforar{false};
++   if((std::fmod(time,tstep_ar)<std::fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt){isstepforar = true;}
++	/*Load parameters*/
++	int M,N,Nphi,arorder,numbasins;
++	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
++	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
++	IssmDouble tinit_ar;
++	IssmDouble* beta0                = xNew<IssmDouble>(numbasins);
++	IssmDouble* beta1                = xNew<IssmDouble>(numbasins);
++	IssmDouble* phi                  = xNew<IssmDouble>(numbasins*arorder);
++	IssmDouble* noiseterms           = xNew<IssmDouble>(numbasins);
++	IssmDouble* covmat               = xNew<IssmDouble>(numbasins*numbasins);
++	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
++	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
++	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
++	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
++	femmodel->parameters->FindParam(&covmat,&M,&N,SmbCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
++	IssmDouble telapsed_ar = time-tinit_ar; //time elapsed with respect to AR model initial time
++	/*Before looping through elements: compute noise term specific to each basin from covmat*/
++	multivariateNormal(&noiseterms,numbasins,0.0,covmat);
++	/*Loop over each element to compute SMB at vertices*/
++	for(Object* &object:femmodel->elements->objects){
++		Element* element      = xDynamicCast<Element*>(object); //generate element object
++		element->Smbautoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms);
++	}
++	/*Cleanup*/
++	xDelete<IssmDouble>(beta0);
++	xDelete<IssmDouble>(beta1);
++	xDelete<IssmDouble>(phi);
++	xDelete<IssmDouble>(noiseterms);
++	xDelete<IssmDouble>(covmat);
++}/*}}}*/
+ void Delta18oParameterizationx(FemModel* femmodel){/*{{{*/
+ 
+ 	for(Object* & object : femmodel->elements->objects){
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26476)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26477)
+@@ -408,7 +408,13 @@
+ 	SmbAccugradEnum,
+ 	SmbAccurefEnum,
+ 	SmbAdThreshEnum,
++	SmbAutoregressionInitialTimeEnum,
++   SmbAutoregressionTimestepEnum,
++   SmbAutoregressiveOrderEnum,
+ 	SmbAveragingEnum,
++	SmbBeta0Enum,
++   SmbBeta1Enum,
++   SmbCovmatEnum,
+ 	SmbDesfacEnum,
+ 	SmbDpermilEnum,
+ 	SmbDsnowIdxEnum,
+@@ -437,8 +443,10 @@
+ 	SmbIsthermalEnum,
+ 	SmbIsturbulentfluxEnum,
+ 	SmbKEnum,
++	SmbNumBasinsEnum,
+ 	SmbNumRequestedOutputsEnum,
+ 	SmbPfacEnum,
++	SmbPhiEnum,
+ 	SmbRdlEnum,
+ 	SmbRequestedOutputsEnum,
+ 	SmbRlapsEnum,
+@@ -862,6 +870,7 @@
+ 	SmbAccumulationEnum,
+ 	SmbAdiffiniEnum,
+ 	SmbAiniEnum,
++	SmbBasinsIdEnum,
+ 	SmbBMaxEnum,
+ 	SmbBMinEnum,
+ 	SmbBNegEnum,
+@@ -948,6 +957,7 @@
+ 	SmbTiniEnum,
+ 	SmbTmeanEnum,
+ 	SmbTzEnum,
++	SmbValuesAutoregressionEnum,
+ 	SmbVEnum,
+ 	SmbVmeanEnum,
+ 	SmbVzEnum,
+@@ -1413,6 +1423,7 @@
+ 	SamplingAnalysisEnum,
+ 	SamplingSolutionEnum,
+ 	SIAApproximationEnum,
++	SMBautoregressionEnum,
+ 	SMBcomponentsEnum,
+ 	SMBd18opddEnum,
+ 	SMBforcingEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26477)
+@@ -416,7 +416,13 @@
+ 		case SmbAccugradEnum : return "SmbAccugrad";
+ 		case SmbAccurefEnum : return "SmbAccuref";
+ 		case SmbAdThreshEnum : return "SmbAdThresh";
++		case SmbAutoregressionInitialTimeEnum : return "SmbAutoregressionInitialTime";
++		case SmbAutoregressionTimestepEnum : return "SmbAutoregressionTimestep";
++		case SmbAutoregressiveOrderEnum : return "SmbAutoregressiveOrder";
+ 		case SmbAveragingEnum : return "SmbAveraging";
++		case SmbBeta0Enum : return "SmbBeta0";
++		case SmbBeta1Enum : return "SmbBeta1";
++		case SmbCovmatEnum : return "SmbCovmat";
+ 		case SmbDesfacEnum : return "SmbDesfac";
+ 		case SmbDpermilEnum : return "SmbDpermil";
+ 		case SmbDsnowIdxEnum : return "SmbDsnowIdx";
+@@ -445,8 +451,10 @@
+ 		case SmbIsthermalEnum : return "SmbIsthermal";
+ 		case SmbIsturbulentfluxEnum : return "SmbIsturbulentflux";
+ 		case SmbKEnum : return "SmbK";
++		case SmbNumBasinsEnum : return "SmbNumBasins";
+ 		case SmbNumRequestedOutputsEnum : return "SmbNumRequestedOutputs";
+ 		case SmbPfacEnum : return "SmbPfac";
++		case SmbPhiEnum : return "SmbPhi";
+ 		case SmbRdlEnum : return "SmbRdl";
+ 		case SmbRequestedOutputsEnum : return "SmbRequestedOutputs";
+ 		case SmbRlapsEnum : return "SmbRlaps";
+@@ -541,7 +549,11 @@
+ 		case AdjointEnum : return "Adjoint";
+ 		case AdjointpEnum : return "Adjointp";
+ 		case AdjointxEnum : return "Adjointx";
++		case AdjointxBaseEnum : return "AdjointxBase";
++		case AdjointxShearEnum : return "AdjointxShear";
+ 		case AdjointyEnum : return "Adjointy";
++		case AdjointyBaseEnum : return "AdjointyBase";
++		case AdjointyShearEnum : return "AdjointyShear";
+ 		case AdjointzEnum : return "Adjointz";
+ 		case AirEnum : return "Air";
+ 		case ApproximationEnum : return "Approximation";
+@@ -864,6 +876,7 @@
+ 		case SmbAccumulationEnum : return "SmbAccumulation";
+ 		case SmbAdiffiniEnum : return "SmbAdiffini";
+ 		case SmbAiniEnum : return "SmbAini";
++		case SmbBasinsIdEnum : return "SmbBasinsId";
+ 		case SmbBMaxEnum : return "SmbBMax";
+ 		case SmbBMinEnum : return "SmbBMin";
+ 		case SmbBNegEnum : return "SmbBNeg";
+@@ -949,6 +962,7 @@
+ 		case SmbTiniEnum : return "SmbTini";
+ 		case SmbTmeanEnum : return "SmbTmean";
+ 		case SmbTzEnum : return "SmbTz";
++		case SmbValuesAutoregressionEnum : return "SmbValuesAutoregression";
+ 		case SmbVEnum : return "SmbV";
+ 		case SmbVmeanEnum : return "SmbVmean";
+ 		case SmbVzEnum : return "SmbVz";
+@@ -1412,6 +1426,7 @@
+ 		case SamplingAnalysisEnum : return "SamplingAnalysis";
+ 		case SamplingSolutionEnum : return "SamplingSolution";
+ 		case SIAApproximationEnum : return "SIAApproximation";
++		case SMBautoregressionEnum : return "SMBautoregression";
+ 		case SMBcomponentsEnum : return "SMBcomponents";
+ 		case SMBd18opddEnum : return "SMBd18opdd";
+ 		case SMBforcingEnum : return "SMBforcing";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26477)
+@@ -425,7 +425,13 @@
+ 	      else if (strcmp(name,"SmbAccugrad")==0) return SmbAccugradEnum;
+ 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
+ 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
++	      else if (strcmp(name,"SmbAutoregressionInitialTime")==0) return SmbAutoregressionInitialTimeEnum;
++	      else if (strcmp(name,"SmbAutoregressionTimestep")==0) return SmbAutoregressionTimestepEnum;
++	      else if (strcmp(name,"SmbAutoregressiveOrder")==0) return SmbAutoregressiveOrderEnum;
+ 	      else if (strcmp(name,"SmbAveraging")==0) return SmbAveragingEnum;
++	      else if (strcmp(name,"SmbBeta0")==0) return SmbBeta0Enum;
++	      else if (strcmp(name,"SmbBeta1")==0) return SmbBeta1Enum;
++	      else if (strcmp(name,"SmbCovmat")==0) return SmbCovmatEnum;
+ 	      else if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
+ 	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
+ 	      else if (strcmp(name,"SmbDsnowIdx")==0) return SmbDsnowIdxEnum;
+@@ -454,8 +460,10 @@
+ 	      else if (strcmp(name,"SmbIsthermal")==0) return SmbIsthermalEnum;
+ 	      else if (strcmp(name,"SmbIsturbulentflux")==0) return SmbIsturbulentfluxEnum;
+ 	      else if (strcmp(name,"SmbK")==0) return SmbKEnum;
++	      else if (strcmp(name,"SmbNumBasins")==0) return SmbNumBasinsEnum;
+ 	      else if (strcmp(name,"SmbNumRequestedOutputs")==0) return SmbNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
++	      else if (strcmp(name,"SmbPhi")==0) return SmbPhiEnum;
+ 	      else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
+ 	      else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+@@ -497,7 +505,10 @@
+ 	      else if (strcmp(name,"ThermalMaxiter")==0) return ThermalMaxiterEnum;
+ 	      else if (strcmp(name,"ThermalNumRequestedOutputs")==0) return ThermalNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
+-	      else if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
+ 	      else if (strcmp(name,"ThermalPenaltyThreshold")==0) return ThermalPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"ThermalReltol")==0) return ThermalReltolEnum;
+ 	      else if (strcmp(name,"ThermalRequestedOutputs")==0) return ThermalRequestedOutputsEnum;
+@@ -505,10 +516,7 @@
+ 	      else if (strcmp(name,"ThermalWatercolumnUpperlimit")==0) return ThermalWatercolumnUpperlimitEnum;
+ 	      else if (strcmp(name,"Time")==0) return TimeEnum;
+ 	      else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
++	      else if (strcmp(name,"TimesteppingCouplingTime")==0) return TimesteppingCouplingTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
+ 	      else if (strcmp(name,"TimesteppingInterpForcing")==0) return TimesteppingInterpForcingEnum;
+ 	      else if (strcmp(name,"TimesteppingCycleForcing")==0) return TimesteppingCycleForcingEnum;
+@@ -553,7 +561,11 @@
+ 	      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,"AdjointxBase")==0) return AdjointxBaseEnum;
++	      else if (strcmp(name,"AdjointxShear")==0) return AdjointxShearEnum;
+ 	      else if (strcmp(name,"Adjointy")==0) return AdjointyEnum;
++	      else if (strcmp(name,"AdjointyBase")==0) return AdjointyBaseEnum;
++	      else if (strcmp(name,"AdjointyShear")==0) return AdjointyShearEnum;
+ 	      else if (strcmp(name,"Adjointz")==0) return AdjointzEnum;
+ 	      else if (strcmp(name,"Air")==0) return AirEnum;
+ 	      else if (strcmp(name,"Approximation")==0) return ApproximationEnum;
+@@ -616,7 +628,10 @@
+ 	      else if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
+ 	      else if (strcmp(name,"DamageDbarOld")==0) return DamageDbarOldEnum;
+ 	      else if (strcmp(name,"DamageF")==0) return DamageFEnum;
+-	      else if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
+ 	      else if (strcmp(name,"DepthBelowSurface")==0) return DepthBelowSurfaceEnum;
+ 	      else if (strcmp(name,"DeltaIceThickness")==0) return DeltaIceThicknessEnum;
+ 	      else if (strcmp(name,"DeltaTws")==0) return DeltaTwsEnum;
+@@ -628,10 +643,7 @@
+ 	      else if (strcmp(name,"StrOld")==0) return StrOldEnum;
+ 	      else if (strcmp(name,"Str")==0) return StrEnum;
+ 	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
++	      else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
+ 	      else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
+ 	      else if (strcmp(name,"DeviatoricStressxz")==0) return DeviatoricStressxzEnum;
+ 	      else if (strcmp(name,"DeviatoricStressyy")==0) return DeviatoricStressyyEnum;
+@@ -739,7 +751,10 @@
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
+ 	      else if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum;
+ 	      else if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
+-	      else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
+ 	      else if (strcmp(name,"LoadingforceZ")==0) return LoadingforceZEnum;
+ 	      else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum;
+ 	      else if (strcmp(name,"MaskIceLevelset")==0) return MaskIceLevelsetEnum;
+@@ -751,10 +766,7 @@
+ 	      else if (strcmp(name,"MaterialsRheologyEbar")==0) return MaterialsRheologyEbarEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyEc")==0) return MaterialsRheologyEcEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyEcbar")==0) return MaterialsRheologyEcbarEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
++	      else if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyEsbar")==0) return MaterialsRheologyEsbarEnum;
+ 	      else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
+ 	      else if (strcmp(name,"MeshScaleFactor")==0) return MeshScaleFactorEnum;
+@@ -862,7 +874,10 @@
+ 	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+ 	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
+-	      else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      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;
+@@ -874,10 +889,7 @@
+ 	      else if (strcmp(name,"SmbAccumulatedMelt")==0) return SmbAccumulatedMeltEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedPrecipitation")==0) return SmbAccumulatedPrecipitationEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedRain")==0) return SmbAccumulatedRainEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SmbAccumulatedRefreeze")==0) return SmbAccumulatedRefreezeEnum;
++	      else if (strcmp(name,"SmbAccumulatedRefreeze")==0) return SmbAccumulatedRefreezeEnum;
+ 	      else if (strcmp(name,"SmbAccumulatedRunoff")==0) return SmbAccumulatedRunoffEnum;
+ 	      else if (strcmp(name,"SmbA")==0) return SmbAEnum;
+ 	      else if (strcmp(name,"SmbAdiff")==0) return SmbAdiffEnum;
+@@ -885,6 +897,7 @@
+ 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
+ 	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
+ 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
++	      else if (strcmp(name,"SmbBasinsId")==0) return SmbBasinsIdEnum;
+ 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+ 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+ 	      else if (strcmp(name,"SmbBNeg")==0) return SmbBNegEnum;
+@@ -970,6 +983,7 @@
+ 	      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,"SmbValuesAutoregression")==0) return SmbValuesAutoregressionEnum;
+ 	      else if (strcmp(name,"SmbV")==0) return SmbVEnum;
+ 	      else if (strcmp(name,"SmbVmean")==0) return SmbVmeanEnum;
+ 	      else if (strcmp(name,"SmbVz")==0) return SmbVzEnum;
+@@ -983,7 +997,10 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+-	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+@@ -997,10 +1014,7 @@
+ 	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+ 	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
+ 	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
++	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+ 	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+ 	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+ 	      else if (strcmp(name,"SurfaceAbsMisfit")==0) return SurfaceAbsMisfitEnum;
+@@ -1106,7 +1120,10 @@
+ 	      else if (strcmp(name,"Outputdefinition47")==0) return Outputdefinition47Enum;
+ 	      else if (strcmp(name,"Outputdefinition48")==0) return Outputdefinition48Enum;
+ 	      else if (strcmp(name,"Outputdefinition49")==0) return Outputdefinition49Enum;
+-	      else if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
+ 	      else if (strcmp(name,"Outputdefinition50")==0) return Outputdefinition50Enum;
+ 	      else if (strcmp(name,"Outputdefinition51")==0) return Outputdefinition51Enum;
+ 	      else if (strcmp(name,"Outputdefinition52")==0) return Outputdefinition52Enum;
+@@ -1120,10 +1137,7 @@
+ 	      else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum;
+ 	      else if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
+ 	      else if (strcmp(name,"Outputdefinition61")==0) return Outputdefinition61Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
++	      else if (strcmp(name,"Outputdefinition62")==0) return Outputdefinition62Enum;
+ 	      else if (strcmp(name,"Outputdefinition63")==0) return Outputdefinition63Enum;
+ 	      else if (strcmp(name,"Outputdefinition64")==0) return Outputdefinition64Enum;
+ 	      else if (strcmp(name,"Outputdefinition65")==0) return Outputdefinition65Enum;
+@@ -1229,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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;
+@@ -1243,10 +1260,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
++	      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;
+@@ -1352,7 +1366,10 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      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;
+@@ -1366,10 +1383,7 @@
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
++	      else if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
+ 	      else if (strcmp(name,"Mathydro")==0) return MathydroEnum;
+ 	      else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
+ 	      else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
+@@ -1445,6 +1459,7 @@
+ 	      else if (strcmp(name,"SamplingAnalysis")==0) return SamplingAnalysisEnum;
+ 	      else if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
+ 	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
++	      else if (strcmp(name,"SMBautoregression")==0) return SMBautoregressionEnum;
+ 	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+ 	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
+ 	      else if (strcmp(name,"SMBforcing")==0) return SMBforcingEnum;
+@@ -1474,7 +1489,10 @@
+ 	      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=13;
++   }
++   if(stage==13){
++	      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,"SmbAnalysis")==0) return SmbAnalysisEnum;
+@@ -1489,10 +1507,7 @@
+ 	      else if (strcmp(name,"StatisticsSolution")==0) return StatisticsSolutionEnum;
+ 	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
+ 	      else if (strcmp(name,"StressIntensityFactor")==0) return StressIntensityFactorEnum;
+-         else stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
++	      else if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
+ 	      else if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
+ 	      else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
+ 	      else if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
+Index: ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26477)
+@@ -672,3 +672,19 @@
+ 	xDelete<IssmDouble*>(celllist);
+ 
+ } /*}}}*/
++void CholeskyRealPositiveDefinite(IssmDouble* Lchol, IssmDouble* A, int ndim) { /*{{{*/
++   /*CholeskyRealPositiveDefinite   computes lower triangular matrix of the Cholesky decomposition of A
++   Follows the Cholesky–Banachiewicz algorithm
++   Lchol should point to an IssmDouble* of same dimensions as A*/
++   for(int ii{0};ii<(ndim*ndim);ii++){Lchol[ii]=0;}; //ensure zero-initialization
++   for(int ii{0};ii<ndim;ii++){
++                for(int jj{0};jj<=ii;jj++){
++                        double sum{0.0};
++                        for(int kk{0};kk<jj;kk++) {
++                                sum += Lchol[ii*ndim+kk]*Lchol[jj*ndim+kk];
++                        }
++                        if(ii==jj){Lchol[ii*ndim+jj] = sqrt(A[ii*ndim+jj]-sum);}
++                        else{Lchol[ii*ndim+jj] = 1/Lchol[jj*ndim+jj] * (A[ii*ndim+jj]-sum);}
++                }
++        }
++} /*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/random.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26477)
+@@ -0,0 +1,62 @@
++/*!\file: random
++ * \brief random number generating functions
++ */ 
++
++/*Headers*/
++/*{{{*/
++#include <stdio.h>
++#include <sys/types.h>
++#include <math.h>
++#include <float.h>    /*  DBL_EPSILON  */
++#include <chrono>
++#include <cstdarg>
++#include <iostream>
++#include <random>
++
++#include "../Matrix/matrix.h"
++#include "../Exceptions/exceptions.h"
++#include "../MemOps/MemOps.h"
++#include "../io/io.h"
++/*}}}*/
++
++void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev) { /*{{{*/
++	/*univariateNormal	generates a random value follwoing Normal distribution*/
++	unsigned seed = std::chrono::steady_clock::now().time_since_epoch().count(); //random seed using time_since_epoch
++   std::default_random_engine generator(seed); //generator of random numbers
++   std::normal_distribution<double> normdistri(mean,sdev); //Normal probability distribution
++	double tfunc;
++	*prand = normdistri(generator);
++} /*}}}*/
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix) { /*{{{*/
++   IssmDouble* sampleStandardNormal     = xNew<IssmDouble>(dim);
++   IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
++   IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
++   for(int ii{0};ii<dim;ii++){univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);}
++   CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
++   for(int ii{0};ii<dim;ii++){ //matrix by vector multiplication
++      double sum{0.0};
++      for(int jj{0};jj<dim;jj++){sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];} //entry-by-entry multiplication along matrix row
++      sampleMultivariateNormal[ii] = mean+sum; //assign value
++   }
++   *prand = sampleMultivariateNormal;
++   xDelete<IssmDouble>(sampleStandardNormal);
++   xDelete<IssmDouble>(Lchol);
++} /*}}}*/
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix) { /*{{{*/
++	IssmDouble* sampleStandardNormal     = xNew<IssmDouble>(dim);
++	IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
++	IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
++	for(int ii{0};ii<dim;ii++){univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);}
++	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
++	for(int ii{0};ii<dim;ii++){ //matrix by vector multiplication
++		double sum{0.0};
++      for(int jj{0};jj<dim;jj++){sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];} //entry-by-entry multiplication along matrix row
++      sampleMultivariateNormal[ii] = mean[ii]+sum; //assign value
++	}
++	*prand = sampleMultivariateNormal;
++	xDelete<IssmDouble>(sampleStandardNormal);
++	xDelete<IssmDouble>(Lchol);
++} /*}}}*/
++
++
++
+
+Property changes on: ../trunk-jpl/src/c/shared/Random/random.cpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/shared/Random/random.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.h	(nonexistent)
++++ ../trunk-jpl/src/c/shared/Random/random.h	(revision 26477)
+@@ -0,0 +1,12 @@
++/*!\file: random.h
++ * \brief prototypes for random.h
++ */ 
++
++#ifndef _RANDOM_H_
++#define _RANDOM_H_
++
++void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev);
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix);
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix);
++
++#endif //ifndef _RANDOM_H_
+
+Property changes on: ../trunk-jpl/src/c/shared/Random/random.h
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26476)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26477)
+@@ -240,6 +240,7 @@
+ 		case 10: return SMBpddSicopolisEnum;
+ 		case 11: return SMBgradientscomponentsEnum;
+ 		case 12: return SMBsemicEnum;	
++		case 55: return SMBautoregressionEnum;
+ 		default: _error_("Marshalled SMB code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+Index: ../trunk-jpl/src/m/classes/SMBautoregression.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBautoregression.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/SMBautoregression.m	(revision 26477)
+@@ -0,0 +1,130 @@
++%SMBautoregression Class definition
++%
++%   Usage:
++%      SMBautoregression=SMBautoregression();
++
++classdef SMBautoregression
++	properties (SetAccess=public)
++		num_basins        = 0;
++		beta0             = NaN;
++		beta1             = NaN;
++		ar_order          = 0;
++		ar_initialtime    = 0;
++		ar_timestep       = 0;
++		phi               = NaN;
++		covmat            = NaN;	
++		basin_id          = NaN;	
++		steps_per_step    = 1;
++		averaging         = 0;
++		requested_outputs = {};
++	end
++	methods
++		function self = SMBautoregression(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = extrude(self,md) % {{{
++			%Nothing for now
++		end % }}}
++		function list = defaultoutputs(self,md) % {{{
++			list = {''};
++		end % }}}
++		function self = initialize(self,md) % {{{
++			if isnan(self.beta1)
++				self.beta1 = zeros(1,self.num_basins); %no trend in SMB
++				disp('      smb.beta1 (trend) not specified: value set to 0');
++			end
++			if (self.ar_order==0)
++				self.ar_order = 1; %dummy 1 value for autoregression
++				self.phi      = zeros(self.num_basins,self.ar_order); %autoregression coefficients all set to 0 
++				disp('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0');	
++			end
++			if (self.ar_initialtime==0)
++				self.ar_initialtime = md.timestepping.start_time; %autoregression model has no prescribed initial time
++				disp('      smb.ar_initialtime (initial time in the autoregressive model parameterization) not specified: set to md.timestepping.start_time');	
++			end
++			if (self.ar_timestep==0)
++				self.ar_timestep = md.timestepping.time_step; %autoregression model has no prescribed time step
++				disp('      smb.ar_timestep (timestep of autoregressive model) not specified: set to md.timestepping.time_step');	
++			end
++			if isnan(self.phi)
++				self.phi = zeros(self.num_basins,self.ar_order); %autoregression model of order 0 
++				disp('      smb.phi (lag coefficients) not specified: order of autoregressive model set to 0');
++			end
++			if isnan(self.covmat)
++				self.covmat = 1e-21*eye(self.num_basins); %no stochasticity and no covariance
++				disp('      smb.covmat not specified: stochasticity set to 0');
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++			self.ar_order    = 0.0; %autoregression model of order 0 
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			if ismember('MasstransportAnalysis',analyses),
++				md = checkfield(md,'fieldname','smb.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
++				md = checkfield(md,'fieldname','smb.basin_id','Inf',1,'>=',0,'<=',md.smb.num_basins,'size',[md.mesh.numberofelements,1]);
++				md = checkfield(md,'fieldname','smb.beta0','NaN',1,'Inf',1,'size',[1,md.smb.num_basins],'numel',md.smb.num_basins); %scheme fails if passed as column vector
++				md = checkfield(md,'fieldname','smb.beta1','NaN',1,'Inf',1,'size',[1,md.smb.num_basins],'numel',md.smb.num_basins); %scheme fails if passed as column vector
++				md = checkfield(md,'fieldname','smb.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
++				md = checkfield(md,'fieldname','smb.ar_initialtime','numel',1,'NaN',1,'Inf',1); 
++				md = checkfield(md,'fieldname','smb.ar_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %autoregression time step cannot be finer than ISSM timestep
++				md = checkfield(md,'fieldname','smb.phi','NaN',1,'Inf',1,'size',[md.smb.num_basins,md.smb.ar_order]);
++				md = checkfield(md,'fieldname','smb.covmat','NaN',1,'Inf',1,'size',[md.smb.num_basins,md.smb.num_basins]);
++			end
++			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
++			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
++			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   surface forcings parameters:'));
++			fielddisplay(self,'num_basins','number of different basins [unitless]');
++			fielddisplay(self,'basin_id','basin number assigned to each element [unitless]');
++			fielddisplay(self,'beta0','basin-specific intercept values [m ice eq./yr]');
++			fielddisplay(self,'beta1','basin-specific trend values [m ice eq. yr^(-2)]');
++			fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
++			fielddisplay(self,'ar_initialtime','initial time assumed in the autoregressive model parameterization [yr]');
++			fielddisplay(self,'ar_timestep','time resolution of the autoregressive model [yr]');
++			fielddisplay(self,'phi','basin-specific vectors of lag coefficients [unitless]');
++			fielddisplay(self,'covmat','inter-basin covariance matrix for multivariate normal noise at each time step [m^2 ice eq. yr^(-2)]');
++			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
++			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
++			disp(sprintf('%51s  0: Arithmetic (default)',' '));
++			disp(sprintf('%51s  1: Geometric',' '));
++			disp(sprintf('%51s  2: Harmonic',' '));
++			fielddisplay(self,'requested_outputs','additional outputs requested');
++
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++
++			yts=md.constants.yts;
++
++			WriteData(fid,prefix,'name','md.smb.model','data',55,'format','Integer');
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','num_basins','format','Integer');
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_order','format','Integer');
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_initialtime','format','Double','scale',yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_timestep','format','Double','scale',yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','basin_id','data',self.basin_id-1,'name','md.smb.basin_id','format','IntMat','mattype',2); %0-indexed
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta0','format','DoubleMat','name','md.smb.beta0','scale',1./yts,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta1','format','DoubleMat','name','md.smb.beta1','scale',1./(yts^2),'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','phi','format','DoubleMat','name','md.smb.phi','yts',md.constants.yts); 
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','covmat','format','DoubleMat','name','md.smb.covmat','scale',1./(yts^2),'yts',md.constants.yts);
++			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
++			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
++
++			%process requested outputs
++			outputs = self.requested_outputs;
++			pos  = find(ismember(outputs,'default'));
++			if ~isempty(pos),
++				outputs(pos) = [];                         %remove 'default' from outputs
++				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
++			end
++			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
++
++		end % }}}
++	end
++end
+
+Property changes on: ../trunk-jpl/src/m/classes/SMBautoregression.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26477-26478.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26477-26478.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26477-26478.diff	(revision 26740)
@@ -0,0 +1,1444 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26477)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 26478)
+@@ -51,6 +51,10 @@
+ 			return CreateKMatrixHO(element);
+ 		case FSApproximationEnum: 
+ 			return CreateKMatrixFS(element);
++      case MLHOApproximationEnum:
++		// a more accurate option, but integrate in the vertical direction numerically.
++		//	return CreateKMatrixMLHOVerticalIntergrated(element);
++			return CreateKMatrixMLHO(element);
+ 		case NoneApproximationEnum:
+ 			return NULL;
+ 		default:
+@@ -215,6 +219,279 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	return Ke;
+ }/*}}}*/
++ElementMatrix* AdjointHorizAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
++
++	/* Check if ice in element */
++	if(!element->IsIceInElement()) return NULL;
++
++	/*Intermediaries */
++	bool        incomplete_adjoint;
++	IssmDouble  Jdet,mu_prime,n,thickness,mu,effmu;
++	IssmDouble *xyz_list = NULL;
++	IssmDouble  viscosity[9]; //9 mu for different integrand
++   int			domaintype;
++	int			dim=2;
++
++	IssmDouble  eb1i,eb1j,esh1i,esh1j,eb2i,eb2j,esh2i,esh2j;
++	IssmDouble  epsilon[5],epsilonbase[5],epsilonshear[5];/* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble  e1b[2], e2b[2], e1sh[2], e2sh[2];
++	IssmDouble  vxshear, vyshear;
++
++   Element* basalelement;
++
++   /*Get basal element*/
++   element->FindParam(&domaintype,DomainTypeEnum);
++   switch(domaintype){
++      case Domain2DhorizontalEnum:
++         basalelement = element;
++         break;
++      case Domain3DEnum: case Domain2DverticalEnum:
++         _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++         break;
++      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++   }
++	/*Fetch number of nodes and dof for this finite element*/
++   int numnodes = basalelement->GetNumberOfNodes();
++   IssmDouble* dbasis = xNew<IssmDouble>(2*numnodes); // like SSA
++   IssmDouble* basis  = xNew<IssmDouble>(numnodes); // like SSA
++
++	/*Initialize Jacobian with regular HO (first part of the Gateau derivative)*/
++	element->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
++	StressbalanceAnalysis* analysis = new StressbalanceAnalysis();
++	ElementMatrix* Ke=analysis->CreateKMatrix(basalelement);
++	delete analysis;
++	if(incomplete_adjoint) return Ke;
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
++   Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input); //vertically integrated vx
++   Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input); //vertically integrated vy
++   Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input);
++   Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
++   Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input);
++   Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input);
++   Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
++   Input* n_input        = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
++
++	/* Start  looping on the number of gaussian points: */
++   Gauss* gauss      = element->NewGauss(5);
++   Gauss* gauss_base = basalelement->NewGauss();
++   while(gauss->next()){
++      gauss->SynchronizeGaussBase(gauss_base);
++
++      element->JacobianDeterminant(&Jdet,xyz_list,gauss_base);
++      basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
++      basalelement->NodalFunctions(basis, gauss_base);
++
++      thickness_input->GetInputValue(&thickness, gauss);
++      n_input->GetInputValue(&n,gauss);
++
++      vxshear_input->GetInputValue(&vxshear,gauss);
++      vyshear_input->GetInputValue(&vyshear,gauss);
++
++		element->material->ViscosityMLHOAdjoint(&viscosity[0],dim,xyz_list,gauss,vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input);
++
++		effmu = 2.0*(1-n)/2.0/n;
++
++		element->StrainRateHO(&epsilonbase[0],xyz_list,gauss,vxbase_input, vybase_input);
++		element->StrainRateHO(&epsilonshear[0],xyz_list,gauss,vxshear_input, vyshear_input);
++
++		e1b[0] = 2*epsilonbase[0]+epsilonbase[1];		e1b[1] = epsilonbase[2];
++		e2b[1] = epsilonbase[0]+2*epsilonbase[1];		e2b[0] = epsilonbase[2];
++
++		e1sh[0] = 2*epsilonshear[0]+epsilonshear[1];		e1sh[1] = epsilonshear[2];
++		e2sh[1] = epsilonshear[0]+2*epsilonshear[1];		e2sh[0] = epsilonshear[2];
++
++		for(int i=0;i<numnodes;i++){
++			for(int j=0;j<numnodes;j++){
++				eb1i = e1b[0]*dbasis[0*numnodes+i]+e1b[1]*dbasis[1*numnodes+i];
++				eb1j = e1b[0]*dbasis[0*numnodes+j]+e1b[1]*dbasis[1*numnodes+j];
++				eb2i = e2b[0]*dbasis[0*numnodes+i]+e2b[1]*dbasis[1*numnodes+i];
++				eb2j = e2b[0]*dbasis[0*numnodes+j]+e2b[1]*dbasis[1*numnodes+j];
++            esh1i = e1sh[0]*dbasis[0*numnodes+i]+e1sh[1]*dbasis[1*numnodes+i];
++            esh1j = e1sh[0]*dbasis[0*numnodes+j]+e1sh[1]*dbasis[1*numnodes+j];
++            esh2i = e2sh[0]*dbasis[0*numnodes+i]+e2sh[1]*dbasis[1*numnodes+i];
++            esh2j = e2sh[0]*dbasis[0*numnodes+j]+e2sh[1]*dbasis[1*numnodes+j];
++
++				Ke->values[4*numnodes*(4*i+0)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb1j*eb1i+viscosity[1]*(esh1j*eb1i+eb1j*esh1i)+viscosity[2]*esh1j*esh1i);
++				Ke->values[4*numnodes*(4*i+1)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb1i+viscosity[2]*(esh1j*eb1i+eb1j*esh1i)+viscosity[4]*esh1j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb1j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh1j*basis[i]);
++				Ke->values[4*numnodes*(4*i+2)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb1j*eb2i+viscosity[1]*(esh1j*eb2i+eb1j*esh2i)+viscosity[2]*esh1j*esh2i);
++				Ke->values[4*numnodes*(4*i+3)+4*j+0]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb2i+viscosity[2]*(esh1j*eb2i+eb1j*esh2i)+viscosity[4]*esh1j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb1j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh1j*basis[i]);
++
++				Ke->values[4*numnodes*(4*i+0)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb1i+viscosity[2]*(esh1j*eb1i+eb1j*esh1i)+viscosity[4]*esh1j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb1i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh1i*basis[j]);
++				Ke->values[4*numnodes*(4*i+1)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb1j*eb1i+viscosity[4]*(esh1j*eb1i+eb1j*esh1i)+viscosity[5]*esh1j*esh1i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*(eb1i*basis[j]+eb1j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*(esh1i*basis[j]+esh1j*basis[i])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vxshear*vxshear*basis[j]*basis[i]);
++				Ke->values[4*numnodes*(4*i+2)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb1j*eb2i+viscosity[2]*(esh1j*eb2i+eb1j*esh2i)+viscosity[4]*esh1j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb2i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh2i*basis[j]);
++				Ke->values[4*numnodes*(4*i+3)+4*j+1]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb1j*eb2i+viscosity[4]*(esh1j*eb2i+eb1j*esh2i)+viscosity[5]*esh1j*esh2i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*(vxshear*eb2i*basis[j]+vyshear*eb1j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*(vxshear*esh2i*basis[j]+vyshear*esh1j*basis[i])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vxshear*vyshear*basis[j]*basis[i]);
++				
++
++				Ke->values[4*numnodes*(4*i+0)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb2j*eb1i+viscosity[1]*(esh2j*eb1i+eb2j*esh1i)+viscosity[2]*esh2j*esh1i);
++				Ke->values[4*numnodes*(4*i+1)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb1i+viscosity[2]*(esh2j*eb1i+eb2j*esh1i)+viscosity[4]*esh2j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*eb2j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vxshear*esh2j*basis[i]);
++				Ke->values[4*numnodes*(4*i+2)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[0]*eb2j*eb2i+viscosity[1]*(esh2j*eb2i+eb2j*esh2i)+viscosity[2]*esh2j*esh2i);
++				Ke->values[4*numnodes*(4*i+3)+4*j+2]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb2i+viscosity[2]*(esh2j*eb2i+eb2j*esh2i)+viscosity[4]*esh2j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb2j*basis[i]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh2j*basis[i]);
++
++
++				Ke->values[4*numnodes*(4*i+0)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb1i+viscosity[2]*(esh2j*eb1i+eb2j*esh1i)+viscosity[4]*esh2j*esh1i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb1i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh1i*basis[j]);
++				Ke->values[4*numnodes*(4*i+1)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb2j*eb1i+viscosity[4]*(esh2j*eb1i+eb2j*esh1i)+viscosity[5]*esh2j*esh1i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*(vyshear*eb1i*basis[j]+vxshear*eb2j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*(vxshear*esh2j*basis[i]+vyshear*esh1i*basis[j])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vxshear*vxshear*basis[j]*basis[i]);
++				Ke->values[4*numnodes*(4*i+2)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[1]*eb2j*eb2i+viscosity[2]*(esh2j*eb2i+eb2j*esh2i)+viscosity[4]*esh2j*esh2i+viscosity[3]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*eb2i*basis[j]+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*esh2i*basis[j]);
++				Ke->values[4*numnodes*(4*i+3)+4*j+3]+=gauss->weight*Jdet*effmu*(viscosity[2]*eb2j*eb2i+viscosity[4]*(esh2j*eb2i+eb2j*esh2i)+viscosity[5]*esh2j*esh2i+viscosity[6]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*(eb2i*basis[j]+eb1j*basis[i])+viscosity[7]*(n+1)*(n+1)/2.0/thickness/thickness*vyshear*(esh2i*basis[j]+esh1j*basis[i])+viscosity[8]*(n+1)*(n+1)*(n+1)*(n+1)/4.0/thickness/thickness/thickness/thickness*vyshear*vyshear*basis[j]*basis[i]);
++			}
++		}
++	}
++
++	/*Transform Coordinate System*/
++	/*element->TransformStiffnessMatrixCoord(Ke,XYEnum);*/
++
++   /*Clean up and return*/
++   delete gauss;
++   delete gauss_base;
++   if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++   xDelete<IssmDouble>(xyz_list);
++   xDelete<IssmDouble>(dbasis);
++   xDelete<IssmDouble>(basis);
++   return Ke;
++}/*}}}*/
++ElementMatrix* AdjointHorizAnalysis::CreateKMatrixMLHOVerticalIntergrated(Element* element){/*{{{*/
++
++	/* Check if ice in element */
++	if(!element->IsIceInElement()) return NULL;
++
++	/*Intermediaries */
++	bool        incomplete_adjoint;
++	IssmDouble  Jdet,mu_prime,n,thickness,mu,effmu;
++	IssmDouble *xyz_list = NULL;
++	IssmDouble	zeta, epsilon_eff;
++   int			domaintype;
++	int			dim=2;
++
++	IssmDouble  e1phi1i, e1phi1j, e2phi1i, e2phi1j, e1phi2i, e1phi2j, e2phi2i, e2phi2j;
++	IssmDouble  epsilon[5];/* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble	e1[3],e2[3];
++
++   Element* basalelement;
++
++   /*Get basal element*/
++   element->FindParam(&domaintype,DomainTypeEnum);
++   switch(domaintype){
++      case Domain2DhorizontalEnum:
++         basalelement = element;
++         break;
++      case Domain3DEnum: case Domain2DverticalEnum:
++         _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++         break;
++      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++   }
++	/*Fetch number of nodes and dof for this finite element*/
++   int numnodes = basalelement->GetNumberOfNodes();
++   IssmDouble* dbasis = xNew<IssmDouble>(2*numnodes); // like SSA
++   IssmDouble* basis  = xNew<IssmDouble>(numnodes); // like SSA
++
++	/*Initialize Jacobian with regular HO (first part of the Gateau derivative)*/
++	element->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
++	StressbalanceAnalysis* analysis = new StressbalanceAnalysis();
++	ElementMatrix* Ke=analysis->CreateKMatrix(basalelement);
++	delete analysis;
++	if(incomplete_adjoint) return Ke;
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
++   Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input);
++   Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
++   Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input);
++   Input* vyshear_input  = element->GetInput(VyShearEnum);   _assert_(vyshear_input);
++   Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
++   Input* n_input        = element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
++
++	/* Start  looping on the number of gaussian points: */
++   Gauss* gauss      = element->NewGauss(10);
++   Gauss* gauss_base = basalelement->NewGauss();
++	
++	GaussSeg* gauss_seg=new GaussSeg(5);
++
++   while(gauss->next()){
++      gauss->SynchronizeGaussBase(gauss_base);
++
++      element->JacobianDeterminant(&Jdet,xyz_list,gauss_base);
++      basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
++      basalelement->NodalFunctions(basis, gauss_base);
++
++      thickness_input->GetInputValue(&thickness, gauss);
++      n_input->GetInputValue(&n,gauss);
++
++		effmu = 2*(1-n)/2.0/n;
++
++		/* Get the integration in the vertical direction */
++		gauss_seg->Reset();
++		while(gauss_seg->next()){
++			/*Compute zeta for gauss_seg point (0=surface, 1=base)*/
++	      zeta=0.5*(gauss_seg->coord1+1);
++
++		   /* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy (for a given zeta)*/
++			element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
++                  vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
++			epsilon_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2]
++                    +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
++
++			/*Get viscosity at zeta*/
++			element->material->GetViscosity(&mu,epsilon_eff,gauss);
++			/*the adjoint viscosity with zeta dependent term*/
++			mu = mu /epsilon_eff/epsilon_eff;
++
++			e1[0] = 2.0*epsilon[0]+epsilon[1];
++			e1[1] = epsilon[2];
++			e1[2] = epsilon[3];
++	
++			e2[0] = epsilon[2];
++			e2[1] = epsilon[0]+2.0*epsilon[1];
++			e2[2] = epsilon[4];
++
++			for(int i=0;i<numnodes;i++){
++				for(int j=0;j<numnodes;j++){
++					e1phi1i = e1[0]*dbasis[0*numnodes+i]+e1[1]*dbasis[1*numnodes+i];
++					e2phi1i = e2[0]*dbasis[0*numnodes+i]+e2[1]*dbasis[1*numnodes+i];
++					e1phi1j = e1[0]*dbasis[0*numnodes+j]+e1[1]*dbasis[1*numnodes+j];
++					e2phi1j = e2[0]*dbasis[0*numnodes+j]+e2[1]*dbasis[1*numnodes+j];
++	
++					e1phi2i = (1-pow(zeta, n+1))*(e1[0]*dbasis[0*numnodes+i]+e1[1]*dbasis[1*numnodes+i])+(n+1)/thickness*pow(zeta, n)*e1[2]*basis[i];
++					e2phi2i = (1-pow(zeta, n+1))*(e2[0]*dbasis[0*numnodes+i]+e2[1]*dbasis[1*numnodes+i])+(n+1)/thickness*pow(zeta, n)*e2[2]*basis[i];
++					e1phi2j = (1-pow(zeta, n+1))*(e1[0]*dbasis[0*numnodes+j]+e1[1]*dbasis[1*numnodes+j])+(n+1)/thickness*pow(zeta, n)*e1[2]*basis[j];
++					e2phi2j = (1-pow(zeta, n+1))*(e2[0]*dbasis[0*numnodes+j]+e2[1]*dbasis[1*numnodes+j])+(n+1)/thickness*pow(zeta, n)*e2[2]*basis[j];
++
++					Ke->values[4*numnodes*(4*i+0)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e1phi1j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+1)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e1phi1j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+2)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e1phi1j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+3)+4*j+0]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e1phi1j*thickness*0.5*gauss_seg->weight;
++					
++					Ke->values[4*numnodes*(4*i+0)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e1phi2j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+1)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e1phi2j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+2)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e1phi2j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+3)+4*j+1]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e1phi2j*thickness*0.5*gauss_seg->weight;
++					
++					Ke->values[4*numnodes*(4*i+0)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e2phi1j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+1)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e2phi1j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+2)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e2phi1j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+3)+4*j+2]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e2phi1j*thickness*0.5*gauss_seg->weight;
++
++					Ke->values[4*numnodes*(4*i+0)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e1phi1i*e2phi2j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+1)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e1phi2i*e2phi2j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+2)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e2phi1i*e2phi2j*thickness*0.5*gauss_seg->weight;
++					Ke->values[4*numnodes*(4*i+3)+4*j+3]+=gauss->weight*Jdet*effmu*mu*e2phi2i*e2phi2j*thickness*0.5*gauss_seg->weight;
++				}
++			}
++		}
++	}
++	/*Transform Coordinate System*/
++	/*element->TransformStiffnessMatrixCoord(Ke,XYEnum);*/
++
++   /*Clean up and return*/
++   delete gauss;
++   delete gauss_base;
++	delete gauss_seg;
++   if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++   xDelete<IssmDouble>(xyz_list);
++   xDelete<IssmDouble>(dbasis);
++   xDelete<IssmDouble>(basis);
++   return Ke;
++}/*}}}*/
+ ElementMatrix* AdjointHorizAnalysis::CreateKMatrixL1L2(Element* element){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -334,6 +611,8 @@
+ 			return CreatePVectorHO(element);
+ 		case FSApproximationEnum: 
+ 			return CreatePVectorFS(element);
++      case MLHOApproximationEnum:
++			return CreatePVectorMLHO(element);
+ 		case NoneApproximationEnum:
+ 			return NULL;
+ 		default:
+@@ -819,6 +1098,261 @@
+ 	return pe;
+ 
+ }/*}}}*/
++ElementVector* AdjointHorizAnalysis::CreatePVectorMLHO(Element* element){/*{{{*/
++
++	/*Intermediaries*/
++	int      domaintype;
++	Element* basalelement;
++
++	/* Check if ice in element */
++	if(!element->IsIceInElement()) return NULL;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return NULL;
++			basalelement = element->SpawnBasalElement();
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return NULL;
++			basalelement = element->SpawnBasalElement(true);
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries */
++	int         num_responses,i;
++	IssmDouble  Jdet,obs_velocity_mag,velocity_mag;
++	IssmDouble  vx,vy,vxobs,vyobs,dux,duy,weight;
++	IssmDouble scalex,scaley,scale,S,thickness,n;
++	int        *responses = NULL;
++	IssmDouble *xyz_list  = NULL;
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = basalelement->GetNumberOfNodes();
++
++	/*Initialize Element vector and vectors*/
++	ElementVector* pe    = basalelement->NewElementVector(MLHOApproximationEnum);
++	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
++
++	/*Retrieve all inputs and parameters*/
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	basalelement->FindParam(&responses,NULL,InversionCostFunctionsEnum);
++	DatasetInput* weights_input = basalelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++	Input* vx_input      = basalelement->GetInput(VxSurfaceEnum);                                        _assert_(vx_input);
++	Input* vxobs_input   = basalelement->GetInput(InversionVxObsEnum);                                   _assert_(vxobs_input);
++   Input* thickness_input=basalelement->GetInput(ThicknessEnum);													  _assert_(thickness_input);
++   Input*     n_input        =element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
++	Input* vy_input=NULL;
++	Input* vyobs_input=NULL;
++	if(domaintype!=Domain2DverticalEnum){
++		vy_input      = basalelement->GetInput(VySurfaceEnum);       _assert_(vy_input);
++		vyobs_input   = basalelement->GetInput(InversionVyObsEnum);  _assert_(vyobs_input);
++	}
++	IssmDouble epsvel  = 2.220446049250313e-16;
++	IssmDouble meanvel = 3.170979198376458e-05; /*1000 m/yr*/
++
++	/*Get Surface if required by one response*/
++	Input* S_input = NULL;
++	for(int resp=0;resp<num_responses;resp++){
++		if(responses[resp]==SurfaceAverageVelMisfitEnum){
++			S_input = element->GetInput(SurfaceAreaEnum);  _assert_(S_input); break;
++		}
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(4);
++	while(gauss->next()){
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctions(basis, gauss);
++      
++		thickness_input->GetInputValue(&thickness,gauss);
++      n_input->GetInputValue(&n,gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		if(domaintype!=Domain2DverticalEnum){
++			vy_input->GetInputValue(&vy,gauss);
++			vyobs_input->GetInputValue(&vyobs,gauss);
++		}
++		/*Loop over all requested responses*/
++		for(int resp=0;resp<num_responses;resp++){
++			weights_input->GetInputValue(&weight,gauss,responses[resp]);
++
++			switch(responses[resp]){
++				case SurfaceAbsVelMisfitEnum:
++					/*
++					 *      1  [           2              2 ]
++					 * J = --- | (u - u   )  +  (v - v   )  |
++					 *      2  [       obs            obs   ]
++					 *
++					 *        dJ
++					 * DU = - -- = (u   - u )
++					 *        du     obs
++					 */
++					for(i=0;i<numnodes;i++){
++						if(domaintype!=Domain2DverticalEnum){
++							dux=vxobs-vx;
++							duy=vyobs-vy;
++							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++						}
++						else {
++							_error_("2D vertical is not implemented for MLHO");
++						}
++					}
++					break;
++				case SurfaceRelVelMisfitEnum:
++					/*
++					 *      1  [     \bar{v}^2             2   \bar{v}^2              2 ]
++					 * J = --- | -------------  (u - u   ) + -------------  (v - v   )  |
++					 *      2  [  (u   + eps)^2       obs    (v   + eps)^2       obs    ]
++					 *              obs                        obs                      
++					 *
++					 *        dJ     \bar{v}^2
++					 * DU = - -- = ------------- (u   - u )
++					 *        du   (u   + eps)^2    obs
++					 *               obs
++					 */
++					for(i=0;i<numnodes;i++){
++						if(domaintype!=Domain2DverticalEnum){
++							scalex=pow(meanvel/(vxobs+epsvel),2); if(vxobs==0)scalex=0;
++							scaley=pow(meanvel/(vyobs+epsvel),2); if(vyobs==0)scaley=0;
++							dux=scalex*(vxobs-vx);
++							duy=scaley*(vyobs-vy);
++							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
++						}
++						else{
++							_error_("2D vertical is not implemented for MLHO");
++						}
++					}
++					break;
++				case SurfaceLogVelMisfitEnum:
++					/*
++					 *                 [        vel + eps     ] 2
++					 * J = 4 \bar{v}^2 | log ( -----------  ) |  
++					 *                 [       vel   + eps    ]
++					 *                            obs
++					 *
++					 *        dJ                 2 * log(...)
++					 * DU = - -- = - 4 \bar{v}^2 -------------  u
++					 *        du                 vel^2 + eps
++					 *            
++					 */
++					for(i=0;i<numnodes;i++){
++						if(domaintype!=Domain2DverticalEnum){
++							velocity_mag    =sqrt(pow(vx,   2)+pow(vy,   2))+epsvel;
++							obs_velocity_mag=sqrt(pow(vxobs,2)+pow(vyobs,2))+epsvel;
++							scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
++							dux=scale*vx;
++							duy=scale*vy;
++							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i];
++							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
++						}
++						else{
++							_error_("2D vertical is not implemented for MLHO");
++						}
++					}
++					break;
++				case SurfaceAverageVelMisfitEnum:
++					/*
++					 *      1                    2              2
++					 * J = ---  sqrt(  (u - u   )  +  (v - v   )  )
++					 *      S                obs            obs
++					 *
++					 *        dJ      1       1 
++					 * DU = - -- = - --- ----------- * 2 (u - u   )
++					 *        du      S  2 sqrt(...)           obs
++					 */
++					S_input->GetInputValue(&S,gauss);
++					for(i=0;i<numnodes;i++){
++						if(domaintype!=Domain2DverticalEnum){
++							scale=1./(S*sqrt(pow(vx-vxobs,2)+pow(vy-vyobs,2))+epsvel);
++							dux=scale*(vxobs-vx);
++							duy=scale*(vyobs-vy);
++							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i];
++							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
++						}
++						else{
++							_error_("2D vertical is not implemented for MLHO");
++						}
++					}
++					break;
++				case SurfaceLogVxVyMisfitEnum:
++					/*
++					 *      1            [        |u| + eps     2          |v| + eps     2  ]
++					 * J = --- \bar{v}^2 | log ( -----------  )   +  log ( -----------  )   |  
++					 *      2            [       |u    |+ eps              |v    |+ eps     ]
++					 *                              obs                       obs
++					 *        dJ                              1      u                             1
++					 * DU = - -- = - \bar{v}^2 log(u...) --------- ----  ~ - \bar{v}^2 log(u...) ------
++					 *        du                         |u| + eps  |u|                           u + eps
++					 */
++					for(i=0;i<numnodes;i++){
++						if(domaintype!=Domain2DverticalEnum){
++							dux = - meanvel*meanvel * log((fabs(vx)+epsvel)/(fabs(vxobs)+epsvel)) / (vx+epsvel);
++							duy = - meanvel*meanvel * log((fabs(vy)+epsvel)/(fabs(vyobs)+epsvel)) / (vy+epsvel);
++							pe->values[i*4+0]+=dux*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+1]+=dux*weight*Jdet*gauss->weight*basis[i];
++							pe->values[i*4+2]+=duy*weight*Jdet*gauss->weight*basis[i]; 
++							pe->values[i*4+3]+=duy*weight*Jdet*gauss->weight*basis[i];
++						}
++						else{
++							_error_("2D vertical is not implemented for MLHO");
++						}
++					}
++					break;
++				case DragCoefficientAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case ThicknessAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case ThicknessAlongGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case ThicknessAcrossGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case RheologyBbarAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case RheologyBAbsGradientEnum:
++					/*Nothing in P vector*/
++					break;
++				case RheologyBInitialguessMisfitEnum:
++					/*Nothing in P vector*/
++					break;
++				default:
++					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++			}
++		}
++	}
++
++	/*Transform coordinate system*/
++	//if(domaintype!=Domain2DverticalEnum)	basalelement->TransformLoadVectorCoord(pe,XYEnum);
++	/*Clean up and return*/
++	xDelete<int>(responses);
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++	delete gauss;
++	return pe;
++}/*}}}*/
+ ElementVector* AdjointHorizAnalysis::CreatePVectorSSA(Element* element){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -1128,6 +1662,7 @@
+ 				case SSAApproximationEnum: GradientJDragSSA(element,gradient,control_interp,control_index); break;
+ 				case L1L2ApproximationEnum:GradientJDragL1L2(element,gradient,control_interp,control_index); break;
+ 				case HOApproximationEnum:  GradientJDragHO( element,gradient,control_interp,control_index); break;
++				case MLHOApproximationEnum:  GradientJDragMLHO( element,gradient,control_interp,control_index); break;
+ 				case FSApproximationEnum:  GradientJDragFS( element,gradient,control_interp,control_index); break;
+ 				case NoneApproximationEnum: /*Gradient is 0*/                    break;
+ 				default: _error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+@@ -1148,6 +1683,7 @@
+ 				case SSAApproximationEnum: GradientJBbarSSA(element,gradient,control_interp,control_index); break;
+ 				case L1L2ApproximationEnum:GradientJBbarL1L2(element,gradient,control_interp,control_index); break;
+ 				case HOApproximationEnum:  GradientJBbarHO( element,gradient,control_interp,control_index); break;
++				case MLHOApproximationEnum:  GradientJBbarMLHO( element,gradient,control_interp,control_index); break;
+ 				case FSApproximationEnum:  GradientJBbarFS( element,gradient,control_interp,control_index); break;
+ 				case NoneApproximationEnum: /*Gradient is 0*/                    break;
+ 				default: _error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+@@ -1157,6 +1693,7 @@
+ 			switch(approximation){
+ 				case SSAApproximationEnum: GradientJBSSA(element,gradient,control_interp,control_index); break;
+ 				case HOApproximationEnum:  GradientJBHO( element,gradient,control_interp,control_index); break;
++			//	case MLHOApproximationEnum:  GradientJBMLHO( element,gradient,control_interp,control_index); break;
+ 				case FSApproximationEnum:  GradientJBFS( element,gradient,control_interp,control_index); break;
+ 				case NoneApproximationEnum: /*Gradient is 0*/                    break;
+ 				default: _error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+@@ -1266,6 +1803,134 @@
+ 	/*WARNING: We use SSA as an estimate for now*/
+ 	this->GradientJBbarSSA(element,gradient,control_interp,control_index);
+ }/*}}}*/
++void           AdjointHorizAnalysis::GradientJBbarMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
++
++   if(control_interp!=P1Enum) _error_("not implemented yet...");
++	/*Intermediaries*/
++	int      domaintype,dim;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			dim          = 2;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 1;
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement(true);
++			dim          = 2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble thickness,dmudB,n;
++	IssmDouble dvx[3],dvy[3],dadjbx[3],dadjby[3],dadjshx[3],dadjshy[3]; 
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = basalelement->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++	IssmDouble  zeta;
++   IssmDouble  e1[3],e2[3], phishx[3], phishy[3];
++   IssmDouble  epsilon[5];/* epsilon=[exx,eyy,exy,exz,eyz];*/
++	IssmDouble  adjshx, adjshy;
++
++	/*Retrieve all inputs we will be needing: */
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* thickness_input	= basalelement->GetInput(ThicknessEnum);					_assert_(thickness_input);
++   Input* n_input				= basalelement->GetInput(MaterialsRheologyNEnum);		_assert_(n_input);
++   Input* vxbase_input		= basalelement->GetInput(VxBaseEnum);						_assert_(vxbase_input);
++   Input* vybase_input		= basalelement->GetInput(VyBaseEnum);						_assert_(vybase_input);
++   Input* vxshear_input		= basalelement->GetInput(VxShearEnum);						_assert_(vxshear_input);
++   Input* vyshear_input		= basalelement->GetInput(VyShearEnum);						_assert_(vyshear_input);
++
++	Input* adjointbx_input	= basalelement->GetInput(AdjointxBaseEnum);				_assert_(adjointbx_input);
++	Input* adjointby_input	= basalelement->GetInput(AdjointyBaseEnum);				_assert_(adjointby_input);
++	Input* adjointshx_input	= basalelement->GetInput(AdjointxShearEnum);				_assert_(adjointshx_input);
++	Input* adjointshy_input	= basalelement->GetInput(AdjointyShearEnum);				_assert_(adjointshy_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(5);
++   GaussSeg* gauss_seg=new GaussSeg(2);
++
++	while(gauss->next()){
++
++		thickness_input->GetInputValue(&thickness,gauss);
++	   n_input->GetInputValue(&n,gauss);
++		adjointbx_input->GetInputDerivativeValue(&dadjbx[0],xyz_list,gauss);
++		adjointby_input->GetInputDerivativeValue(&dadjby[0],xyz_list,gauss);
++		adjointshx_input->GetInputDerivativeValue(&dadjshx[0],xyz_list,gauss);
++		adjointshy_input->GetInputDerivativeValue(&dadjshy[0],xyz_list,gauss);
++		adjointshx_input->GetInputValue(&adjshx, gauss);
++		adjointshy_input->GetInputValue(&adjshy, gauss);
++		
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctionsP1(basis,gauss);
++
++	   /* Get the integration in the vertical direction */
++      gauss_seg->Reset();
++      while(gauss_seg->next()){
++			zeta=0.5*(gauss_seg->coord1+1);
++
++			basalelement->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
++                  vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
++
++			basalelement->dViscositydBMLHO(&dmudB,dim,xyz_list,gauss,vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
++
++			e1[0] = 2.0*epsilon[0]+epsilon[1];
++         e1[1] = epsilon[2];
++         e1[2] = epsilon[3];
++
++         e2[0] = epsilon[2];
++         e2[1] = epsilon[0]+2.0*epsilon[1];
++         e2[2] = epsilon[4];
++
++			phishx[0] = dadjbx[0] + (1-pow(zeta, n+1))*dadjshx[0];
++			phishx[1] = dadjbx[1] + (1-pow(zeta, n+1))*dadjshx[1];
++			phishx[2] = (n+1)/thickness*pow(zeta, n)*adjshx;
++			phishy[0] = dadjby[0] + (1-pow(zeta, n+1))*dadjshy[0];
++			phishy[1] = dadjby[1] + (1-pow(zeta, n+1))*dadjshy[1];
++			phishy[2] = (n+1)/thickness*pow(zeta, n)*adjshy;
++
++			/*Build gradient vector (actually -dJ/dB): */
++			for(int i=0;i<numvertices;i++){
++				for (int j=0;j<3;j++){
++					ge[i]+=(-dmudB)*2*(e1[j]*phishx[j]+e2[j]*phishy[j])*Jdet*gauss->weight*basis[i]*thickness*0.5*gauss_seg->weight;
++					_assert_(!xIsNan<IssmDouble>(ge[i]));
++				}
++			}
++		}
++	}
++	if(control_interp==P1Enum){
++		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++	}
++	else{
++		_error_("not supported");
++	}
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	delete gauss_seg;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++}/*}}}*/
+ void           AdjointHorizAnalysis::GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -1579,6 +2244,9 @@
+ 	xDelete<int>(vertexpidlist);
+ 	delete gauss;
+ }/*}}}*/
++void           AdjointHorizAnalysis::GradientJBMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
++	_error_("not implemented yet...");
++}/*}}}*/
+ void           AdjointHorizAnalysis::GradientJBSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -1976,6 +2644,124 @@
+ 	delete gauss;
+ 	delete friction;
+ }/*}}}*/
++void           AdjointHorizAnalysis::GradientJDragMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
++
++	/*return if floating (gradient is 0)*/
++	if(element->IsAllFloating()) return;
++
++	/*Intermediaries*/
++	int      domaintype,dim;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			dim          = 2;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 1;
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble drag,dalpha2dk;
++	IssmDouble vx,vy,lambda,mu;
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = basalelement->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Build friction element, needed later: */
++	Friction* friction=new Friction(basalelement,dim);
++
++	/*Retrieve all inputs we will be needing: */
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* vx_input        = basalelement->GetInput(VxBaseEnum);                   _assert_(vx_input);
++	Input* vy_input        = basalelement->GetInput(VyBaseEnum);                   _assert_(vy_input);
++	Input* adjointx_input  = basalelement->GetInput(AdjointxBaseEnum);             _assert_(adjointx_input);
++	Input* adjointy_input  = basalelement->GetInput(AdjointyBaseEnum);             _assert_(adjointy_input);
++
++	/* get the friction law: 1- Budd, 11-Schoof*/
++	int frictionlaw;element->FindParam(&frictionlaw, FrictionLawEnum);
++	Input* dragcoeff_input = NULL;
++	switch(frictionlaw) {
++		case 1:
++			dragcoeff_input = basalelement->GetInput(FrictionCoefficientEnum); _assert_(dragcoeff_input);
++			break;
++		case 2:
++		case 11:
++			dragcoeff_input = basalelement->GetInput(FrictionCEnum); _assert_(dragcoeff_input);
++			break;
++		default:
++			_error_("Friction law "<< frictionlaw <<" not supported in the inversion.");
++	}
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(4);
++	while(gauss->next()){
++
++		adjointx_input->GetInputValue(&lambda, gauss);
++		adjointy_input->GetInputValue(&mu, gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		dragcoeff_input->GetInputValue(&drag, gauss);
++
++		friction->GetAlphaComplement(&dalpha2dk,gauss);
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctionsP1(basis,gauss);
++
++		/*Build gradient vector (actually -dJ/dD): */
++		if(control_interp==P1Enum){
++			for(int i=0;i<numvertices;i++){
++				ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
++				_assert_(!xIsNan<IssmDouble>(ge[i]));
++			}
++		}
++		else if(control_interp==P0Enum){
++			ge[0]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight;
++			_assert_(!xIsNan<IssmDouble>(ge[0]));
++		}
++		else{
++			_error_("not supported");
++		}
++	}
++	if(control_interp==P1Enum){
++		gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++	}
++	else if(control_interp==P0Enum){
++		gradient->SetValue(vertexpidlist[0],ge[0],ADD_VAL);
++	}
++	else{
++		_error_("not supported");
++	}
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	delete friction;
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
++}/*}}}*/
+ void           AdjointHorizAnalysis::GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
+ 
+ 	/*return if floating (gradient is 0)*/
+@@ -2479,6 +3265,9 @@
+ 	if(approximation==FSApproximationEnum || approximation==NoneApproximationEnum){
+ 		InputUpdateFromSolutionFS(solution,element);
+ 	}
++	else if (approximation==MLHOApproximationEnum) {
++		InputUpdateFromSolutionMLHO(solution, element);
++	}
+ 	else{
+ 		InputUpdateFromSolutionHoriz(solution,element);
+ 	}
+@@ -2624,6 +3413,79 @@
+ 	xDelete<IssmDouble>(lambday);
+ 	xDelete<int>(doflist);
+ }/*}}}*/
++void           AdjointHorizAnalysis::InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element){/*{{{*/
++	int  i;
++	int* doflist=NULL;
++
++	int    domaintype;
++	element->FindParam(&domaintype,DomainTypeEnum);
++	if (domaintype!=Domain2DhorizontalEnum) _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = element->GetNumberOfNodes();
++	int numdof = numnodes * 4;
++
++	/*Fetch dof list and allocate solution vectors*/
++	element->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum);
++	IssmDouble* values  = xNew<IssmDouble>(numdof);
++	IssmDouble* lambdax = xNew<IssmDouble>(numnodes);
++	IssmDouble* lambday = xNew<IssmDouble>(numnodes);
++	IssmDouble* lambdabx = xNew<IssmDouble>(numnodes);
++	IssmDouble* lambdaby = xNew<IssmDouble>(numnodes);
++	IssmDouble* lambdashx = xNew<IssmDouble>(numnodes);
++	IssmDouble* lambdashy = xNew<IssmDouble>(numnodes);
++	IssmDouble* n			 = xNew<IssmDouble>(numnodes);
++
++	/*Use the dof list to index into the solution vector: */
++	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
++
++	/*Transform solution in Cartesian Space*/
++	if(domaintype!=Domain2DverticalEnum)	element->TransformSolutionCoord(&values[0],XYEnum);
++
++	element->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum,0.);
++
++	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
++	for(i=0;i<numnodes;i++){
++		lambdabx[i] =values[i*4+0];
++		lambdashx[i]=values[i*4+1];
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(lambdabx[i])) _error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(lambdabx[i])) _error_("Inf found in solution vector");
++		if(xIsNan<IssmDouble>(lambdashx[i])) _error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(lambdashx[i])) _error_("Inf found in solution vector");
++		/* adjoint for the surface velocity */
++		lambdax[i] = lambdabx[i] + lambdashx[i]*(n[i]+1)/(n[i]+2);
++
++		lambdaby[i] =values[i*4+2];
++		lambdashy[i]=values[i*4+3];
++		/*Check solution*/
++		if(xIsNan<IssmDouble>(lambdaby[i])) _error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(lambdaby[i])) _error_("Inf found in solution vector");
++		if(xIsNan<IssmDouble>(lambdashy[i])) _error_("NaN found in solution vector");
++		if(xIsInf<IssmDouble>(lambdashy[i])) _error_("Inf found in solution vector");
++		/* adjoint for the surface velocity */
++		lambday[i] = lambdaby[i] + lambdashy[i]*(n[i]+1)/(n[i]+2);
++	}
++
++	/*Add vx and vy as inputs to the tria element: */
++	element->AddInput(AdjointxBaseEnum,lambdabx,element->GetElementType());
++	element->AddInput(AdjointyBaseEnum,lambdaby,element->GetElementType());
++	element->AddInput(AdjointxShearEnum,lambdashx,element->GetElementType());
++	element->AddInput(AdjointyShearEnum,lambdashy,element->GetElementType());
++
++	element->AddInput(AdjointxEnum,lambdax,element->GetElementType());
++	element->AddInput(AdjointyEnum,lambday,element->GetElementType());
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(values);
++	xDelete<IssmDouble>(lambdax);
++	xDelete<IssmDouble>(lambday);
++	xDelete<IssmDouble>(lambdabx);
++	xDelete<IssmDouble>(lambdaby);
++	xDelete<IssmDouble>(lambdashx);
++	xDelete<IssmDouble>(lambdashy);
++	xDelete<int>(doflist);
++}/*}}}*/
+ void           AdjointHorizAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+ 	return;
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 26477)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 26478)
+@@ -27,6 +27,8 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementMatrix* CreateKMatrixFS(Element* element);
+ 		ElementMatrix* CreateKMatrixHO(Element* element);
++		ElementMatrix* CreateKMatrixMLHO(Element* element);
++		ElementMatrix* CreateKMatrixMLHOVerticalIntergrated(Element* element);
+ 		ElementMatrix* CreateKMatrixL1L2(Element* element);
+ 		ElementMatrix* CreateKMatrixSSA(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+@@ -33,6 +35,7 @@
+ 		ElementVector* CreatePVectorFS(Element* element);
+ 		ElementVector* CreatePVectorL1L2(Element* element);
+ 		ElementVector* CreatePVectorHO(Element* element);
++		ElementVector* CreatePVectorMLHO(Element* element);
+ 		ElementVector* CreatePVectorSSA(Element* element);
+ 		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+ 		void           GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index);
+@@ -41,15 +44,18 @@
+ 		void           GradientJBinitial(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJBbarL1L2(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJBbarHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
++		void           GradientJBbarMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJBFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJBGradient(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJBHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
++		void           GradientJBMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJBSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJDragFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJDragL1L2(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJDragHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
++		void           GradientJDragMLHO(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJDragHydroFS(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+ 		void           GradientJDragHydroL1L2(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index);
+@@ -59,6 +65,7 @@
+ 		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void           InputUpdateFromSolutionFS(IssmDouble* solution,Element* element);
+ 		void           InputUpdateFromSolutionHoriz(IssmDouble* solution,Element* element);
++		void           InputUpdateFromSolutionMLHO(IssmDouble* solution,Element* element);
+ 		void           UpdateConstraints(FemModel* femmodel);
+ };
+ #endif
+Index: ../trunk-jpl/src/c/classes/Materials/Material.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 26478)
+@@ -51,6 +51,7 @@
+ 		virtual void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
+ 		virtual void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
+ 		virtual void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input)=0;
++		virtual void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input)=0;
+ 		virtual void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf)=0;
+ 		virtual void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
+ 		virtual void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble epseff)=0;
+Index: ../trunk-jpl/src/c/classes/Materials/Matestar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matestar.cpp	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Materials/Matestar.cpp	(revision 26478)
+@@ -569,6 +569,9 @@
+ void  Matestar::ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
++void  Matestar::ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
+ void  Matestar::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matestar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Materials/Matestar.h	(revision 26478)
+@@ -76,6 +76,7 @@
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
++		void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
+ 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
+ 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble eps_eff);
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 26478)
+@@ -761,9 +761,10 @@
+ 		epsilon_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2] 
+ 						  +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
+ 
+-		/*Get viscosity at zeta - FIXME for now Bbar*/
+-		this->GetViscosityBar(&mu,epsilon_eff,gauss);
+-
++		/*Get viscosity at zeta */
++//?? need to use Bar for the current inversion
++//    this->GetViscosity(&mu,epsilon_eff,gauss);
++		this->GetViscosityBar(&mu, epsilon_eff,gauss);
+ 		thickness_input->GetInputValue(&H, gauss);
+       n_input->GetInputValue(&n,gauss);
+ 
+@@ -795,6 +796,74 @@
+ 	/*Clean up*/
+ 	delete gauss_seg;
+ }/*}}}*/
++void  Matice::ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){/*{{{*/
++
++	/* To compute the additional 5 terms in the viscosity appear in the adjoint equation*/
++	/*Intermediaries*/
++	IssmDouble epsilon[5];	/* epsilon=[exx,eyy,exy,exz,eyz]; */
++	IssmDouble epsilon_eff;
++	IssmDouble zeta,H,n;
++	IssmDouble f[9],F[9];
++	IssmDouble mubar[9];
++	IssmDouble mu;
++	int order=10; 
++
++	for(int i=0;i<9;++i) mubar[i]=0;
++
++	GaussSeg* gauss_seg=new GaussSeg(order);
++	//IssmDouble eps_eff_averaged=0;
++	while(gauss_seg->next()){
++		
++		/*Compute zeta for gauss_seg point (0=surface, 1=base)*/
++		zeta=0.5*(gauss_seg->coord1+1);	
++
++		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy (for a given zeta)*/
++		element->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
++						vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
++		epsilon_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2] 
++						  +  epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1]);
++
++		this->GetViscosity(&mu,epsilon_eff,gauss);
++		/*the adjoint viscosity with zeta dependent term*/
++		mu = mu /epsilon_eff/epsilon_eff;
++
++		thickness_input->GetInputValue(&H, gauss);
++      n_input->GetInputValue(&n,gauss);
++
++		/*Compute fi and Fi at zeta*/
++		f[0]=1;
++		f[1]=(1-pow(zeta,n+1));
++		f[2]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
++		f[3]=pow(zeta,2*n); // NOTE: this is different from the forward formulation
++		f[4]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
++		f[5]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*(1-pow(zeta,n+1));
++		f[6]=(1-pow(zeta,n+1))*pow(zeta,2*n);
++		f[7]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1))*pow(zeta,2*n);
++		f[8]=pow(zeta,4*n);
++
++	
++		F[0]=H;
++		F[1]=H*(n+1)/(n+2);
++		F[2]=2*H*(n+1)*(n+1)/( (2*n+3)*(n+2) );
++		F[3]=H/(2*n+1);
++		F[4]=6*H*(n+1)*(n+1)*(n+1)/( (n+2)*(2*n+3)*(3*n+4) );
++		F[5]=24*H*(n+1)*(n+1)*(n+1)*(n+1)/( (n+2)*(2*n+3)*(3*n+4)*(4*n+5) );
++		F[6]=H*(n+1)/( (2*n+1)*(3*n+2) );
++		F[7]=2*H*(n+1)*(n+1)/( (2*n+1)*(3*n+2)*(4*n+3) );
++		F[8]=H/(4*n+1);
++
++		/*Sum the viscosity*/
++		for(int i=0;i<9;i++) {
++			mubar[i]+=(H/2)*gauss_seg->weight*mu*f[i];
++		}
++	}//while
++
++	/*Assign output pointer*/
++	for(int i=0;i<9;i++) pviscosity[i]=mubar[i];
++
++	/*Clean up*/
++	delete gauss_seg;
++}/*}}}*/
+ void  Matice::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
+ 	/*Compute the L1L2 viscosity
+ 	 *
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 26478)
+@@ -78,6 +78,7 @@
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
++		void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input);
+ 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf);
+ 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		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");};
+Index: ../trunk-jpl/src/c/classes/Materials/Matlitho.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Materials/Matlitho.h	(revision 26478)
+@@ -72,6 +72,7 @@
+ 		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
+ 		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
+ 		void       ViscosityMLHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){_error_("not supported");};
++		void       ViscosityMLHOAdjoint(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vxshear_input,Input* vyshear_input,Input* thickness_input,Input* n_input){_error_("not supported");};
+ 		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf){_error_("not supported");};
+ 		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
+ 		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble epseff){_error_("not supported");};
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 26477)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 26478)
+@@ -187,6 +187,7 @@
+ 	_error_("not implemented yet...");
+ 	/*}}}*/
+ 	#elif defined(_HAVE_CODIPACK_)
++	/*{{{*/
+ 	simul_starttrace2(femmodel);
+ 	IssmDouble* aX=xNew<IssmDouble>(n);
+ 	auto& tape_codi = IssmDouble::getTape();
+@@ -251,7 +252,7 @@
+ 
+ 	/*Clear tape*/
+ 	tape_codi.reset();
+-
++/*}}}*/
+ 	#else
+ 	/*{{{*/
+ 	void (*adjointcore)(FemModel*)  = NULL;
+Index: ../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversion.m	(revision 26477)
++++ ../trunk-jpl/src/m/classes/inversion.m	(revision 26478)
+@@ -103,8 +103,8 @@
+ 
+ 			%Only SSA, HO and FS are supported right now
+ 			if strcmp(solution,'StressbalanceSolution')
+-				if ~(md.flowequation.isSSA || md.flowequation.isHO || md.flowequation.isFS || md.flowequation.isL1L2),
+-					md = checkmessage(md,['inversion can only be performed for SSA, HO or FS ice flow models']);
++				if ~(md.flowequation.isSSA || md.flowequation.isMLHO || md.flowequation.isHO || md.flowequation.isFS || md.flowequation.isL1L2),
++					md = checkmessage(md,['inversion can only be performed for SSA, MLHO, HO or FS ice flow models']);
+ 				end
+ 			end
+ 			if strcmp(solution,'BalancethicknessSolution')
+Index: ../trunk-jpl/test/Archives/Archive333.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive333.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive334.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive334.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test333.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test333.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test333.m	(revision 26478)
+@@ -0,0 +1,34 @@
++%Test Name: SquareSheetConstrainedCMDragMLHO
++md=triangle(model(),'../Exp/Square.exp',200000.);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'MLHO','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'FrictionCoefficient'};
++md.inversion.min_parameters=1.*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=200.*ones(md.mesh.numberofvertices,1);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=[102  501];
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2); md.inversion.cost_functions_coefficients(:,2)=2.*10^-7;
++md.inversion.gradient_scaling=3.*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy'};
++field_tolerances={1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.StressbalanceSolution.Gradient1),...
++	(md.results.StressbalanceSolution.J),...
++	(md.results.StressbalanceSolution.FrictionCoefficient),...
++	(md.results.StressbalanceSolution.Pressure),...
++	(md.results.StressbalanceSolution.Vel),...
++	(md.results.StressbalanceSolution.Vx),...
++	(md.results.StressbalanceSolution.Vy)
++};
+Index: ../trunk-jpl/test/NightlyRun/test333.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test333.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test333.py	(revision 26478)
+@@ -0,0 +1,45 @@
++#Test Name: SquareSheetConstrainedCMDragMLHO
++import numpy as np
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 200000.)
++md = setmask(md, '', '')
++md = parameterize(md, '../Par/SquareSheetConstrained.py')
++md = setflowequation(md, 'MLHO', 'all')
++
++#control parameters
++
++md.inversion.iscontrol = 1
++md.inversion.control_parameters = ['FrictionCoefficient']
++md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
++md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
++md.inversion.nsteps = 2
++md.inversion.cost_functions = [102, 501]
++md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
++md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
++md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
++md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
++md.inversion.step_threshold = 0.3 * np.ones(md.inversion.nsteps)
++md.inversion.vx_obs = md.initialization.vx
++md.inversion.vy_obs = md.initialization.vy
++
++md.cluster = generic('name', gethostname(), 'np', 3)
++md = solve(md, 'Stressbalance')
++
++#Fields and tolerances to track changes
++field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
++field_tolerances = [1e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Gradient1,
++                md.results.StressbalanceSolution.J,
++                md.results.StressbalanceSolution.FrictionCoefficient,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy]
+Index: ../trunk-jpl/test/NightlyRun/test334.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test334.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test334.m	(revision 26478)
+@@ -0,0 +1,35 @@
++%Test Name: SquareShelfCMBMLHO
++md=triangle(model(),'../Exp/Square.exp',200000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'MLHO','all');
++
++%control parameters
++md.inversion.iscontrol=1;
++md.inversion.control_parameters={'MaterialsRheologyBbar'};
++md.inversion.min_parameters=10^6*ones(md.mesh.numberofvertices,1);
++md.inversion.max_parameters=2*10^9*ones(md.mesh.numberofvertices,1);
++md.inversion.nsteps=2;
++md.inversion.cost_functions=101;
++md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,1);
++md.inversion.gradient_scaling=10^7*ones(md.inversion.nsteps,1);
++md.inversion.maxiter_per_step=2*ones(md.inversion.nsteps,1);
++md.inversion.step_threshold=0.3*ones(md.inversion.nsteps,1);
++md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
++md.verbose.control=true;
++
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++field_names     ={'Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.StressbalanceSolution.Gradient1),...
++	(md.results.StressbalanceSolution.J),...
++	(md.results.StressbalanceSolution.MaterialsRheologyBbar),...
++	(md.results.StressbalanceSolution.Pressure),...
++	(md.results.StressbalanceSolution.Vel),...
++	(md.results.StressbalanceSolution.Vx),...
++	(md.results.StressbalanceSolution.Vy)
++};
+Index: ../trunk-jpl/test/NightlyRun/test334.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test334.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test334.py	(revision 26478)
+@@ -0,0 +1,47 @@
++#Test Name: SquareShelfCMBMLHO
++from model import *
++from socket import gethostname
++import numpy as np
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from generic import generic
++
++md = triangle(model(), '../Exp/Square.exp', 200000)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelf.py')
++md = setflowequation(md, 'MLHO', 'all')
++
++# control parameters
++
++md.inversion.iscontrol = 1
++md.inversion.control_parameters = ['MaterialsRheologyBbar']
++md.inversion.min_parameters = 1.0e6 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
++md.inversion.max_parameters = 2.0e9 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
++md.inversion.nsteps = 2
++md.inversion.cost_functions = [101]
++md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
++md.inversion.gradient_scaling = 1.0e7 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
++md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
++md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
++md.inversion.vx_obs = md.initialization.vx
++md.inversion.vy_obs = md.initialization.vy
++
++
++md.cluster = generic('name', gethostname(), 'np', 3)
++md = solve(md, 'Stressbalance')
++
++
++# Fields and tolerances to track changes
++
++field_names = ['Gradient', 'Misfits', 'MaterialsRheologyBbar', 'Pressure', 'Vel', 'Vx', 'Vy']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Gradient1,
++                md.results.StressbalanceSolution.J,
++                md.results.StressbalanceSolution.MaterialsRheologyBbar,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy]
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26478)
+@@ -815,6 +815,35 @@
+ 
+ }
+ /*}}}*/
++void       Element::dViscositydBMLHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input, Input* vxshear_input ,Input* vyshear_input,Input* thickness_input,Input* n_input, IssmDouble zeta){/*{{{*/
++
++	/*Intermediaries*/
++	int materialstype;
++	IssmDouble dmudB;
++	IssmDouble epsilon[5];/* epsilon=[exx,eyy,exy,exy,exz,eyz];    */
++	IssmDouble eps_eff;
++	IssmDouble eps0=1.e-27;
++
++	/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
++   this->StrainRateMLHO(&epsilon[0],xyz_list,gauss,
++				vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input,zeta);
++   eps_eff=sqrt(epsilon[0]*epsilon[0] + epsilon[1]*epsilon[1] + epsilon[2]*epsilon[2]
++				+ epsilon[3]*epsilon[3] + epsilon[4]*epsilon[4] + epsilon[0]*epsilon[1] + eps0*eps0);
++
++	/*Get viscosity*/
++	materialstype=this->material->ObjectEnum();
++	switch(materialstype){
++		case MaticeEnum:
++			material->GetViscosity_B(&dmudB,eps_eff,gauss);
++			break;
++		default: _error_("not supported");
++	}
++
++	/*Assign output pointer*/
++	*pdmudB=dmudB;
++
++}
++/*}}}*/
+ void       Element::dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
+ 
+ 	/*Intermediaries*/
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26477)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26478)
+@@ -80,6 +80,7 @@
+ 		void               dViscositydBFS(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
+ 		void               dViscositydBHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
++		void               dViscositydBMLHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vxbase_input,Input* vybase_input, Input* vxshear_input ,Input* vyshear_input,Input* thickness_input,Input* n_input, IssmDouble zeta);
+ 		void               dViscositydDSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               Echo();
+ 		void               FindParam(bool* pvalue,int paramenum);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26478-26479.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26478-26479.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26478-26479.diff	(revision 26740)
@@ -0,0 +1,254 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26478)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26479)
+@@ -3603,41 +3603,56 @@
+ }
+ /*}}}*/
+ void       Element::SmbautoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin){/*{{{*/
++
+ 	const int numvertices = this->GetNumberOfVertices();
+ 	int         basinid;
+ 	IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin; //initialize scalars 
+-	IssmDouble* phi_basin               = xNew<IssmDouble>(arorder);
+-   IssmDouble* smbspin                 = xNew<IssmDouble>(numvertices*arorder);
++	IssmDouble* phi_basin   = xNew<IssmDouble>(arorder);
++   IssmDouble* smbspin     = xNew<IssmDouble>(numvertices*arorder);
++
++	/*Get Basin ID*/
+ 	this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-	for(int ii{0};ii<arorder;ii++){phi_basin[ii] = phi[basinid*arorder+ii];}
++
++	for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii];
++
+ 	beta0_basin   = beta0[basinid];
+ 	beta1_basin   = beta1[basinid];
+-	for(int jj{0};jj<nspin;jj++){	
++	for(int jj=0;jj<nspin;jj++){	
+ 		tspin = starttime-((nspin-jj)*tstep_ar); //current time in spin-up loop
+       noisespin_basin = noisespin[jj*numbasins+basinid];
+-      IssmDouble* oldsmbspin = xNewZeroInit<IssmDouble>(numvertices*arorder);
+-      for(int ii{0};ii<numvertices*arorder;ii++){oldsmbspin[ii]=smbspin[ii];} //copy smbspin in oldsmbspin
++      IssmDouble* oldsmbspin = xNew<IssmDouble>(numvertices*arorder);
++      for(int ii=0;ii<numvertices*arorder;ii++) oldsmbspin[ii]=smbspin[ii]; //copy smbspin in oldsmbspin
++
+       for(int v=0;v<numvertices;v++){
+-         double autoregressionterm{0.0};
+-         for(int ii{0};ii<arorder;ii++){autoregressionterm += phi_basin[ii]*smbspin[v+ii*numvertices];}
++         IssmDouble autoregressionterm = 0.;
++         for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*smbspin[v+ii*numvertices];
+          smbspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm+noisespin_basin; //compute newest values in smbspin
+       }
+-      for(int ii{0};ii<(arorder-1)*numvertices;ii++){smbspin[ii+numvertices]=oldsmbspin[ii];} //correct older values in smbspin
+-      xDelete<IssmDouble>(oldsmbspin); //cleanup
++
++		/*correct older values in smbspin*/
++      for(int ii=0;ii<(arorder-1)*numvertices;ii++){
++			smbspin[ii+numvertices]=oldsmbspin[ii];
++		} 
++
++      xDelete<IssmDouble>(oldsmbspin); 
+ 	}
+-	this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,smbspin,numvertices*arorder);//save spin-up autoregression values
+-   xDelete<IssmDouble>(smbspin); //cleanup
+-   xDelete<IssmDouble>(phi_basin); //cleanup
++	this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,smbspin,numvertices*arorder);
++
++	/*Cleanup and return*/
++   xDelete<IssmDouble>(smbspin); 
++   xDelete<IssmDouble>(phi_basin);
+ }/*}}}*/
+ void       Element::Smbautoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms){/*{{{*/
+ 	const int numvertices = this->GetNumberOfVertices();
+ 	int         basinid,M,N;
+ 	IssmDouble  beta0_basin,beta1_basin,noise_basin; //initialize scalars 
+-	IssmDouble* phi_basin               = xNew<IssmDouble>(arorder);
+-   IssmDouble* smblist                 = xNew<IssmDouble>(numvertices);
++	IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
++   IssmDouble* smblist    = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* smbvaluesautoregression = NULL; //array for past SMB values that we are about to retrieve
++
+ 	this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-	for(int ii{0};ii<arorder;ii++){phi_basin[ii] = phi[basinid*arorder+ii];}
++
++	for(int ii=0;ii<arorder;ii++){phi_basin[ii] = phi[basinid*arorder+ii];}
+ 	beta0_basin   = beta0[basinid];
+ 	beta1_basin   = beta1[basinid];
+ 	noise_basin   = noiseterms[basinid]; //note that noiseterms is computed at every timestep
+@@ -3645,24 +3660,33 @@
+ 	/*If not AR model timestep: take the old SMB values*/
+ 	if(isstepforar==false){
+ 		//VV do something with the lapse rate here if needed (12Oct2021)
+-      for(int ii{0};ii<numvertices;ii++){smblist[ii]=smbvaluesautoregression[ii];}
++      for(int ii=0;ii<numvertices;ii++){smblist[ii]=smbvaluesautoregression[ii];}
+ 	}
+ 	/*If AR model timestep: compute SMB values on vertices from AR*/
+ 	else{
+ 		for(int v=0;v<numvertices;v++){
+-			double autoregressionterm{0.0};
+-			for(int ii{0};ii<arorder;ii++){autoregressionterm += phi_basin[ii]*smbvaluesautoregression[v+ii*numvertices];} //compute autoregressive term
+-			smblist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin; //stochastic SMB value
++
++			/*compute autoregressive term*/
++			IssmDouble autoregressionterm=0.;
++			for(int ii=0;ii<arorder;ii++){
++				autoregressionterm += phi_basin[ii]*smbvaluesautoregression[v+ii*numvertices];
++			}
++
++			/*stochastic SMB value*/
++			smblist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin;
+ 		}
+ 		/*Update autoregression smb values*/
+ 		IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+-		for(int ii{0};ii<numvertices;ii++){temparray[ii] = smblist[ii];} //first store newly computed smb values
+-		for(int ii{0};ii<(arorder-1)*numvertices;ii++){temparray[ii+numvertices] = smbvaluesautoregression[ii];} //second shift older smb values
++		for(int ii=0;ii<numvertices;ii++) temparray[ii] = smblist[ii]; //first store newly computed smb values
++		for(int ii=0;ii<(arorder-1)*numvertices;ii++){
++			temparray[ii+numvertices] = smbvaluesautoregression[ii];
++		} //second shift older smb values
+ 		this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); //save updated autoregression values
+ 		xDelete<IssmDouble>(temparray); //cleanup
+ 	}
+ 	/*Add input to element*/
+ 	this->AddInput(SmbMassBalanceEnum,smblist,P1Enum);
++
+ 	/*Cleanup*/
+ 	xDelete<IssmDouble>(phi_basin);
+ 	xDelete<IssmDouble>(smblist);
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26478)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26479)
+@@ -2,6 +2,7 @@
+  * \brief: calculates SMB
+  */
+ 
++#include <config.h>
+ #include "./SurfaceMassBalancex.h"
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+@@ -194,7 +195,13 @@
+ 	if(time<=starttime+dt){SmbautoregressionInitx(femmodel);}
+ 	/*Determine if this is a time step for the AR model*/
+ 	bool isstepforar{false};
+-   if((std::fmod(time,tstep_ar)<std::fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt){isstepforar = true;}
++
++	#ifndef _HAVE_AD_
++   if((fmod(time,tstep_ar)<fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt){isstepforar = true;}
++	#else
++	_error_("not implemented yet");
++	#endif
++
+ 	/*Load parameters*/
+ 	int M,N,Nphi,arorder,numbasins;
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+Index: ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26478)
++++ ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26479)
+@@ -676,15 +676,22 @@
+    /*CholeskyRealPositiveDefinite   computes lower triangular matrix of the Cholesky decomposition of A
+    Follows the Cholesky–Banachiewicz algorithm
+    Lchol should point to an IssmDouble* of same dimensions as A*/
+-   for(int ii{0};ii<(ndim*ndim);ii++){Lchol[ii]=0;}; //ensure zero-initialization
+-   for(int ii{0};ii<ndim;ii++){
+-                for(int jj{0};jj<=ii;jj++){
+-                        double sum{0.0};
+-                        for(int kk{0};kk<jj;kk++) {
+-                                sum += Lchol[ii*ndim+kk]*Lchol[jj*ndim+kk];
+-                        }
+-                        if(ii==jj){Lchol[ii*ndim+jj] = sqrt(A[ii*ndim+jj]-sum);}
+-                        else{Lchol[ii*ndim+jj] = 1/Lchol[jj*ndim+jj] * (A[ii*ndim+jj]-sum);}
+-                }
+-        }
++
++	/*ensure zero-initialization*/
++	for(int ii=0;ii<(ndim*ndim);ii++) Lchol[ii]=0;;
++
++	for(int ii=0;ii<ndim;ii++){
++		for(int jj{0};jj<=ii;jj++){
++			IssmDouble sum=0.;
++			for(int kk{0};kk<jj;kk++){
++				sum += Lchol[ii*ndim+kk]*Lchol[jj*ndim+kk];
++			}
++			if(ii==jj){
++				Lchol[ii*ndim+jj] = sqrt(A[ii*ndim+jj]-sum);
++			}
++			else{
++				Lchol[ii*ndim+jj] = 1./Lchol[jj*ndim+jj] * (A[ii*ndim+jj]-sum);
++			}
++		}
++	}
+ } /*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/random.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26478)
++++ ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26479)
+@@ -19,42 +19,51 @@
+ #include "../io/io.h"
+ /*}}}*/
+ 
+-void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev) { /*{{{*/
++void univariateNormal(IssmPDouble* prand, IssmPDouble mean, IssmPDouble sdev) { /*{{{*/
+ 	/*univariateNormal	generates a random value follwoing Normal distribution*/
+ 	unsigned seed = std::chrono::steady_clock::now().time_since_epoch().count(); //random seed using time_since_epoch
+    std::default_random_engine generator(seed); //generator of random numbers
+-   std::normal_distribution<double> normdistri(mean,sdev); //Normal probability distribution
+-	double tfunc;
++   std::normal_distribution<IssmPDouble> normdistri(mean,sdev); //Normal probability distribution
+ 	*prand = normdistri(generator);
+ } /*}}}*/
+ void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix) { /*{{{*/
+-   IssmDouble* sampleStandardNormal     = xNew<IssmDouble>(dim);
++   IssmPDouble* sampleStandardNormal     = xNew<IssmPDouble>(dim);
+    IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+    IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+-   for(int ii{0};ii<dim;ii++){univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);}
++
++   for(int ii=0;ii<dim;ii++){univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);}
+    CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+-   for(int ii{0};ii<dim;ii++){ //matrix by vector multiplication
+-      double sum{0.0};
+-      for(int jj{0};jj<dim;jj++){sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];} //entry-by-entry multiplication along matrix row
+-      sampleMultivariateNormal[ii] = mean+sum; //assign value
++   for(int ii=0;ii<dim;ii++){ //matrix by vector multiplication
++      /*entry-by-entry multiplication along matrix row*/
++      IssmDouble sum=0.;
++      for(int jj{0};jj<dim;jj++){
++         sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];
++      }
++      sampleMultivariateNormal[ii] = mean+sum;
+    }
++
++   /*Assign output pointer and cleanup*/
+    *prand = sampleMultivariateNormal;
+-   xDelete<IssmDouble>(sampleStandardNormal);
++   xDelete<IssmPDouble>(sampleStandardNormal);
+    xDelete<IssmDouble>(Lchol);
+ } /*}}}*/
+ void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix) { /*{{{*/
+-	IssmDouble* sampleStandardNormal     = xNew<IssmDouble>(dim);
++	IssmPDouble* sampleStandardNormal     = xNew<IssmPDouble>(dim);
+ 	IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+ 	IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+-	for(int ii{0};ii<dim;ii++){univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);}
++	for(int ii=0;ii<dim;ii++) univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);
++
+ 	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+-	for(int ii{0};ii<dim;ii++){ //matrix by vector multiplication
+-		double sum{0.0};
+-      for(int jj{0};jj<dim;jj++){sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];} //entry-by-entry multiplication along matrix row
++
++	for(int ii=0;ii<dim;ii++){ //matrix by vector multiplication
++		IssmDouble sum = 0.;
++      for(int jj=0.;jj<dim;jj++){
++			sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];
++		}
+       sampleMultivariateNormal[ii] = mean[ii]+sum; //assign value
+ 	}
+ 	*prand = sampleMultivariateNormal;
+-	xDelete<IssmDouble>(sampleStandardNormal);
++	xDelete<IssmPDouble>(sampleStandardNormal);
+ 	xDelete<IssmDouble>(Lchol);
+ } /*}}}*/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26479-26480.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26479-26480.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26479-26480.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/classes/inversion.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversion.py	(revision 26479)
++++ ../trunk-jpl/src/m/classes/inversion.py	(revision 26480)
+@@ -137,8 +137,8 @@
+ 
+         # Only SSA, HO and FS are supported right now
+         if solution == 'StressbalanceSolution':
+-            if not (md.flowequation.isSSA or md.flowequation.isHO or md.flowequation.isFS or md.flowequation.isL1L2):
+-                md.checkmessage("'inversion can only be performed for SSA, HO or FS ice flow models")
++            if not (md.flowequation.isSSA or md.flowequation.isMLHO or md.flowequation.isHO or md.flowequation.isFS or md.flowequation.isL1L2):
++                md.checkmessage("'inversion can only be performed for SSA, MLHO, HO or FS ice flow models")
+         if solution == 'BalancethicknessSolution':
+             md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+         elif solution == 'BalancethicknessSoftSolution':
Index: /issm/oecreview/Archive/25834-26739/ISSM-26480-26481.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26480-26481.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26480-26481.diff	(revision 26740)
@@ -0,0 +1,41 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26480)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26481)
+@@ -207,24 +207,29 @@
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+ 	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+ 	IssmDouble tinit_ar;
+-	IssmDouble* beta0                = xNew<IssmDouble>(numbasins);
+-	IssmDouble* beta1                = xNew<IssmDouble>(numbasins);
+-	IssmDouble* phi                  = xNew<IssmDouble>(numbasins*arorder);
+-	IssmDouble* noiseterms           = xNew<IssmDouble>(numbasins);
+-	IssmDouble* covmat               = xNew<IssmDouble>(numbasins*numbasins);
++	IssmDouble* beta0      = xNew<IssmDouble>(numbasins);
++	IssmDouble* beta1      = xNew<IssmDouble>(numbasins);
++	IssmDouble* phi        = xNew<IssmDouble>(numbasins*arorder);
++	IssmDouble* noiseterms = xNew<IssmDouble>(numbasins);
++	IssmDouble* covmat     = xNew<IssmDouble>(numbasins*numbasins);
+ 	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+ 	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 	femmodel->parameters->FindParam(&covmat,&M,&N,SmbCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
+-	IssmDouble telapsed_ar = time-tinit_ar; //time elapsed with respect to AR model initial time
++
++	/*time elapsed with respect to AR model initial time*/
++	IssmDouble telapsed_ar = time-tinit_ar; 
++
+ 	/*Before looping through elements: compute noise term specific to each basin from covmat*/
+ 	multivariateNormal(&noiseterms,numbasins,0.0,covmat);
++
+ 	/*Loop over each element to compute SMB at vertices*/
+ 	for(Object* &object:femmodel->elements->objects){
+-		Element* element      = xDynamicCast<Element*>(object); //generate element object
++		Element* element = xDynamicCast<Element*>(object);
+ 		element->Smbautoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms);
+ 	}
++
+ 	/*Cleanup*/
+ 	xDelete<IssmDouble>(beta0);
+ 	xDelete<IssmDouble>(beta1);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26481-26482.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26481-26482.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26481-26482.diff	(revision 26740)
@@ -0,0 +1,353 @@
+Index: ../trunk-jpl/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp	(revision 26481)
++++ ../trunk-jpl/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp	(revision 26482)
+@@ -59,10 +59,10 @@
+ 		ISSM_MPI_Bcast(&oceantime,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 		femmodel->parameters->SetParam(oceangridnxsize,OceanGridNxEnum);
+ 		femmodel->parameters->SetParam(oceangridnysize,OceanGridNyEnum);
++		oceangridx=xNew<IssmDouble>(ngrids_ocean);
++		oceangridy=xNew<IssmDouble>(ngrids_ocean);
+ 		if(my_rank==0){
+-			oceangridx = xNew<IssmDouble>(ngrids_ocean);
+ 			ISSM_MPI_Recv(oceangridx,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001005,tomitgcmcomm,&status);
+-			oceangridy = xNew<IssmDouble>(ngrids_ocean);
+ 			ISSM_MPI_Recv(oceangridy,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001006,tomitgcmcomm,&status);
+ 
+ 			/*Exchange varying parameters for the initialization*/
+@@ -69,10 +69,7 @@
+ 			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);
+Index: ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26481)
++++ ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 26482)
+@@ -678,20 +678,15 @@
+    Lchol should point to an IssmDouble* of same dimensions as A*/
+ 
+ 	/*ensure zero-initialization*/
+-	for(int ii=0;ii<(ndim*ndim);ii++) Lchol[ii]=0;;
++	for(int i=0;i<(ndim*ndim);i++) Lchol[i]=0;;
+ 
+-	for(int ii=0;ii<ndim;ii++){
+-		for(int jj{0};jj<=ii;jj++){
++	for(int i=0;i<ndim;i++){
++		for(int j=0;j<=i;j++){
+ 			IssmDouble sum=0.;
+-			for(int kk{0};kk<jj;kk++){
+-				sum += Lchol[ii*ndim+kk]*Lchol[jj*ndim+kk];
+-			}
+-			if(ii==jj){
+-				Lchol[ii*ndim+jj] = sqrt(A[ii*ndim+jj]-sum);
+-			}
+-			else{
+-				Lchol[ii*ndim+jj] = 1./Lchol[jj*ndim+jj] * (A[ii*ndim+jj]-sum);
+-			}
++			for(int k=0;k<j;k++) sum += Lchol[i*ndim+k]*Lchol[j*ndim+k];
++			
++			if(i==j) Lchol[i*ndim+j] = sqrt(A[i*ndim+j]-sum);
++			else Lchol[i*ndim+j]     = 1./Lchol[j*ndim+j] * (A[i*ndim+j]-sum);
+ 		}
+ 	}
+ } /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26481)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26482)
+@@ -3606,33 +3606,31 @@
+ 
+ 	const int numvertices = this->GetNumberOfVertices();
+ 	int         basinid;
+-	IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin; //initialize scalars 
++	IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin;  
+ 	IssmDouble* phi_basin   = xNew<IssmDouble>(arorder);
+    IssmDouble* smbspin     = xNew<IssmDouble>(numvertices*arorder);
+ 
+-	/*Get Basin ID*/
++	/*Get Basin ID and Basin coefficients*/
+ 	this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-
+-	for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii];
+-
++	for(int i=0;i<arorder;i++) phi_basin[i] = phi[basinid*arorder+i];
+ 	beta0_basin   = beta0[basinid];
+ 	beta1_basin   = beta1[basinid];
+-	for(int jj=0;jj<nspin;jj++){	
+-		tspin = starttime-((nspin-jj)*tstep_ar); //current time in spin-up loop
+-      noisespin_basin = noisespin[jj*numbasins+basinid];
++
++	/*Loop over number of spin-up steps for all vertices*/	
++	for(int j=0;j<nspin;j++){	
++		tspin = starttime-((nspin-j)*tstep_ar); 
++      noisespin_basin = noisespin[j*numbasins+basinid];
+       IssmDouble* oldsmbspin = xNew<IssmDouble>(numvertices*arorder);
+-      for(int ii=0;ii<numvertices*arorder;ii++) oldsmbspin[ii]=smbspin[ii]; //copy smbspin in oldsmbspin
++      for(int i=0;i<numvertices*arorder;i++) oldsmbspin[i]=smbspin[i]; 
+ 
+       for(int v=0;v<numvertices;v++){
+          IssmDouble autoregressionterm = 0.;
+-         for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*smbspin[v+ii*numvertices];
++         for(int i=0;i<arorder;i++) autoregressionterm += phi_basin[i]*smbspin[v+i*numvertices];
+          smbspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm+noisespin_basin; //compute newest values in smbspin
+       }
+ 
+-		/*correct older values in smbspin*/
+-      for(int ii=0;ii<(arorder-1)*numvertices;ii++){
+-			smbspin[ii+numvertices]=oldsmbspin[ii];
+-		} 
++		/*Correct older values in smbspin*/
++      for(int i=0;i<(arorder-1)*numvertices;i++) smbspin[i+numvertices]=oldsmbspin[i]; 
+ 
+       xDelete<IssmDouble>(oldsmbspin); 
+ 	}
+@@ -3643,46 +3641,45 @@
+    xDelete<IssmDouble>(phi_basin);
+ }/*}}}*/
+ void       Element::Smbautoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms){/*{{{*/
++	
+ 	const int numvertices = this->GetNumberOfVertices();
+ 	int         basinid,M,N;
+-	IssmDouble  beta0_basin,beta1_basin,noise_basin; //initialize scalars 
++	IssmDouble  beta0_basin,beta1_basin,noise_basin;  
+ 	IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
+    IssmDouble* smblist    = xNew<IssmDouble>(numvertices);
+-	IssmDouble* smbvaluesautoregression = NULL; //array for past SMB values that we are about to retrieve
++	IssmDouble* smbvaluesautoregression = NULL;
+ 
++	/*Get Basin ID and Basin coefficients*/
+ 	this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-
+-	for(int ii=0;ii<arorder;ii++){phi_basin[ii] = phi[basinid*arorder+ii];}
++	for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii]; 
+ 	beta0_basin   = beta0[basinid];
+ 	beta1_basin   = beta1[basinid];
+-	noise_basin   = noiseterms[basinid]; //note that noiseterms is computed at every timestep
+-	this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&smbvaluesautoregression,&M); //get array of past SMB values to compute AR model
++	noise_basin   = noiseterms[basinid]; 
++	this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&smbvaluesautoregression,&M);
++
+ 	/*If not AR model timestep: take the old SMB values*/
+ 	if(isstepforar==false){
+-		//VV do something with the lapse rate here if needed (12Oct2021)
+-      for(int ii=0;ii<numvertices;ii++){smblist[ii]=smbvaluesautoregression[ii];}
++		/*VV do something with the lapse rate here if needed (12Oct2021)*/
++      for(int i=0;i<numvertices;i++) smblist[i]=smbvaluesautoregression[i]; 
+ 	}
+ 	/*If AR model timestep: compute SMB values on vertices from AR*/
+ 	else{
+ 		for(int v=0;v<numvertices;v++){
+ 
+-			/*compute autoregressive term*/
++			/*Compute autoregressive term*/
+ 			IssmDouble autoregressionterm=0.;
+-			for(int ii=0;ii<arorder;ii++){
+-				autoregressionterm += phi_basin[ii]*smbvaluesautoregression[v+ii*numvertices];
+-			}
++			for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*smbvaluesautoregression[v+ii*numvertices];
+ 
+-			/*stochastic SMB value*/
++			/*Stochastic SMB value*/
+ 			smblist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin;
+ 		}
+ 		/*Update autoregression smb values*/
+ 		IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+-		for(int ii=0;ii<numvertices;ii++) temparray[ii] = smblist[ii]; //first store newly computed smb values
+-		for(int ii=0;ii<(arorder-1)*numvertices;ii++){
+-			temparray[ii+numvertices] = smbvaluesautoregression[ii];
+-		} //second shift older smb values
+-		this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); //save updated autoregression values
+-		xDelete<IssmDouble>(temparray); //cleanup
++		/*Assign newest values and shift older values*/
++		for(int i=0;i<numvertices;i++) temparray[i] = smblist[i]; 
++		for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = smbvaluesautoregression[i];
++		this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); 
++		xDelete<IssmDouble>(temparray);
+ 	}
+ 	/*Add input to element*/
+ 	this->AddInput(SmbMassBalanceEnum,smblist,P1Enum);
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26481)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26482)
+@@ -147,9 +147,12 @@
+ 
+ }/*}}}*/
+ void SmbautoregressionInitx(FemModel* femmodel){/*{{{*/
++	
+ 	/*Initialization step of Smbautoregressionx*/
+-	int M,N,Nphi,arorder,numbasins;
++	int M,N,Nphi,arorder,numbasins,my_rank;
+ 	IssmDouble starttime,tstep_ar,tinit_ar;
++	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
++	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+ 	IssmDouble* beta0    = xNew<IssmDouble>(numbasins);
+ 	IssmDouble* beta1    = xNew<IssmDouble>(numbasins);
+ 	IssmDouble* phi      = xNew<IssmDouble>(numbasins*arorder);
+@@ -157,26 +160,31 @@
+ 	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+    femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
+ 	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+-	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+-	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+ 	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 	femmodel->parameters->FindParam(&covmat,&M,&N,SmbCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
++	
+ 	/*AR model spin-up*/
+-	int nspin{2*arorder+5}; //number of spin-up steps to be executed
+-	IssmDouble* noisespin = xNewZeroInit<IssmDouble>(numbasins*nspin); //sample of basin-specific noise at each spinup step
+-	for(int ii{0};ii<nspin;ii++){
+-		IssmDouble* temparray = xNew<IssmDouble>(numbasins);
+-		multivariateNormal(&temparray,numbasins,0.0,covmat);
+-		for(int jj{0};jj<numbasins;jj++){noisespin[ii*numbasins+jj]=temparray[jj];}
+-		xDelete<IssmDouble>(temparray);
++	int nspin{2*arorder+5}; 
++	IssmDouble* noisespin = xNewZeroInit<IssmDouble>(numbasins*nspin); 
++	my_rank=IssmComm::GetRank();
++	if(my_rank==0){
++		for(int i=0;i<nspin;i++){
++			IssmDouble* temparray = xNew<IssmDouble>(numbasins);
++			multivariateNormal(&temparray,numbasins,0.0,covmat);
++			for(int j=0;j<numbasins;j++){noisespin[i*numbasins+j]=temparray[j];}
++			xDelete<IssmDouble>(temparray);
++		}
+ 	}
++	ISSM_MPI_Bcast(noisespin,numbasins*nspin,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	
+ 	/*Initialize SmbValuesAutoregressionEnum*/
+ 	for(Object* &object:femmodel->elements->objects){
+       Element* element      = xDynamicCast<Element*>(object); //generate element object
+ 		element->SmbautoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,noisespin);
+ 	}
++	
+ 	/*Cleanup*/
+ 	xDelete<IssmDouble>(beta0);
+ 	xDelete<IssmDouble>(beta1);
+@@ -191,19 +199,20 @@
+ 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+ 	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+    femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
++
+ 	/*Initialize module at first time step*/
+ 	if(time<=starttime+dt){SmbautoregressionInitx(femmodel);}
+ 	/*Determine if this is a time step for the AR model*/
+-	bool isstepforar{false};
++	bool isstepforar = false;
+ 
+ 	#ifndef _HAVE_AD_
+-   if((fmod(time,tstep_ar)<fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt){isstepforar = true;}
++   if((fmod(time,tstep_ar)<fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt) isstepforar = true;
+ 	#else
+ 	_error_("not implemented yet");
+ 	#endif
+ 
+ 	/*Load parameters*/
+-	int M,N,Nphi,arorder,numbasins;
++	int M,N,Nphi,arorder,numbasins,my_rank;
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+ 	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+ 	IssmDouble tinit_ar;
+@@ -218,11 +227,15 @@
+ 	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 	femmodel->parameters->FindParam(&covmat,&M,&N,SmbCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
+ 
+-	/*time elapsed with respect to AR model initial time*/
++	/*Time elapsed with respect to AR model initial time*/
+ 	IssmDouble telapsed_ar = time-tinit_ar; 
+ 
+ 	/*Before looping through elements: compute noise term specific to each basin from covmat*/
+-	multivariateNormal(&noiseterms,numbasins,0.0,covmat);
++	my_rank=IssmComm::GetRank();
++	if(my_rank==0){
++		multivariateNormal(&noiseterms,numbasins,0.0,covmat);
++	}
++	ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 
+ 	/*Loop over each element to compute SMB at vertices*/
+ 	for(Object* &object:femmodel->elements->objects){
+Index: ../trunk-jpl/src/c/shared/Random/random.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26481)
++++ ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26482)
+@@ -20,26 +20,29 @@
+ /*}}}*/
+ 
+ void univariateNormal(IssmPDouble* prand, IssmPDouble mean, IssmPDouble sdev) { /*{{{*/
+-	/*univariateNormal	generates a random value follwoing Normal distribution*/
+-	unsigned seed = std::chrono::steady_clock::now().time_since_epoch().count(); //random seed using time_since_epoch
+-   std::default_random_engine generator(seed); //generator of random numbers
+-   std::normal_distribution<IssmPDouble> normdistri(mean,sdev); //Normal probability distribution
++
++	/*Random seed using time_since_epoch*/
++	unsigned seed = std::chrono::steady_clock::now().time_since_epoch().count(); 
++   std::default_random_engine generator(seed);
++	/*Normal Probability Distribution*/
++   std::normal_distribution<IssmPDouble> normdistri(mean,sdev); 
+ 	*prand = normdistri(generator);
+ } /*}}}*/
+ void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix) { /*{{{*/
+-   IssmPDouble* sampleStandardNormal     = xNew<IssmPDouble>(dim);
++   
++	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+    IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+    IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+ 
+-   for(int ii=0;ii<dim;ii++){univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);}
++   for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0); 
+    CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+-   for(int ii=0;ii<dim;ii++){ //matrix by vector multiplication
+-      /*entry-by-entry multiplication along matrix row*/
++   
++	/*Matrix by vector multiplication*/
++	for(int i=0;i<dim;i++){ 
++      /*Entry-by-entry multiplication along matrix row*/
+       IssmDouble sum=0.;
+-      for(int jj{0};jj<dim;jj++){
+-         sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];
+-      }
+-      sampleMultivariateNormal[ii] = mean+sum;
++      for(int j=0;j<dim;j++) sum += sampleStandardNormal[j]*Lchol[i*dim+j]; 
++      sampleMultivariateNormal[i] = mean+sum;
+    }
+ 
+    /*Assign output pointer and cleanup*/
+@@ -48,20 +51,22 @@
+    xDelete<IssmDouble>(Lchol);
+ } /*}}}*/
+ void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix) { /*{{{*/
+-	IssmPDouble* sampleStandardNormal     = xNew<IssmPDouble>(dim);
++	
++	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+ 	IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+ 	IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+-	for(int ii=0;ii<dim;ii++) univariateNormal(&(sampleStandardNormal[ii]),0.0,1.0);
++	for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0);
+ 
+ 	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+ 
+-	for(int ii=0;ii<dim;ii++){ //matrix by vector multiplication
++	/*Matrix by vector multiplication*/
++	for(int i=0;i<dim;i++){
+ 		IssmDouble sum = 0.;
+-      for(int jj=0.;jj<dim;jj++){
+-			sum += sampleStandardNormal[jj]*Lchol[ii*dim+jj];
+-		}
+-      sampleMultivariateNormal[ii] = mean[ii]+sum; //assign value
++      for(int j=0;j<dim;j++) sum += sampleStandardNormal[j]*Lchol[i*dim+j]; 
++      sampleMultivariateNormal[i] = mean[i]+sum;
+ 	}
++   
++	/*Assign output pointer and cleanup*/
+ 	*prand = sampleMultivariateNormal;
+ 	xDelete<IssmPDouble>(sampleStandardNormal);
+ 	xDelete<IssmDouble>(Lchol);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26482-26483.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26482-26483.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26482-26483.diff	(revision 26740)
@@ -0,0 +1,426 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26482)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26483)
+@@ -398,6 +398,7 @@
+ 		case SMBautoregressionEnum:
+          /*Add parameters that are not in standard nbvertices format*/
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.num_basins",SmbNumBasinsEnum));
++         parameters->AddObject(iomodel->CopyConstantObject("md.smb.randomflag",SmbRandomflagEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_order",SmbAutoregressiveOrderEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_initialtime",SmbAutoregressionInitialTimeEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_timestep",SmbAutoregressionTimestepEnum));
+Index: ../trunk-jpl/src/c/shared/Random/random.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26482)
++++ ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26483)
+@@ -19,23 +19,27 @@
+ #include "../io/io.h"
+ /*}}}*/
+ 
+-void univariateNormal(IssmPDouble* prand, IssmPDouble mean, IssmPDouble sdev) { /*{{{*/
++void univariateNormal(IssmPDouble* prand, IssmPDouble mean, IssmPDouble sdev, int seedfixed=-1) { /*{{{*/
+ 
++	unsigned seed;
+ 	/*Random seed using time_since_epoch*/
+-	unsigned seed = std::chrono::steady_clock::now().time_since_epoch().count(); 
+-   std::default_random_engine generator(seed);
++	if(seedfixed==-1) seed = std::chrono::steady_clock::now().time_since_epoch().count(); 
++	/*Seed fixed by input argument*/
++	else seed = seedfixed;
++	std::default_random_engine generator(seed);
+ 	/*Normal Probability Distribution*/
+    std::normal_distribution<IssmPDouble> normdistri(mean,sdev); 
+ 	*prand = normdistri(generator);
+ } /*}}}*/
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix) { /*{{{*/
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seedfixed=-1) { /*{{{*/
+    
+ 	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+    IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+    IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+ 
+-   for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0); 
+-   CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
++	/*True randomness if seedfixed==-1, otherwise random seed is fixed at seedfixed*/
++	for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0,seedfixed); 
++	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+    
+ 	/*Matrix by vector multiplication*/
+ 	for(int i=0;i<dim;i++){ 
+@@ -50,13 +54,14 @@
+    xDelete<IssmPDouble>(sampleStandardNormal);
+    xDelete<IssmDouble>(Lchol);
+ } /*}}}*/
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix) { /*{{{*/
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seedfixed=-1) { /*{{{*/
+ 	
+ 	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+ 	IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+ 	IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+-	for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0);
+ 
++	/*True randomness if seedfixed==-1, otherwise random seed is fixed at seedfixed*/
++	for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0,seedfixed); 
+ 	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+ 
+ 	/*Matrix by vector multiplication*/
+Index: ../trunk-jpl/src/c/shared/Random/random.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.h	(revision 26482)
++++ ../trunk-jpl/src/c/shared/Random/random.h	(revision 26483)
+@@ -5,8 +5,8 @@
+ #ifndef _RANDOM_H_
+ #define _RANDOM_H_
+ 
+-void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev);
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix);
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix);
++void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev, int seedfixed=-1);
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seedfixed=-1);
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seedfixed=-1);
+ 
+ #endif //ifndef _RANDOM_H_
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26482)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26483)
+@@ -3608,7 +3608,7 @@
+ 	int         basinid;
+ 	IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin;  
+ 	IssmDouble* phi_basin   = xNew<IssmDouble>(arorder);
+-   IssmDouble* smbspin     = xNew<IssmDouble>(numvertices*arorder);
++   IssmDouble* smbspin     = xNewZeroInit<IssmDouble>(numvertices*arorder);
+ 
+ 	/*Get Basin ID and Basin coefficients*/
+ 	this->GetInputValue(&basinid,SmbBasinsIdEnum);
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26482)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26483)
+@@ -170,9 +170,15 @@
+ 	IssmDouble* noisespin = xNewZeroInit<IssmDouble>(numbasins*nspin); 
+ 	my_rank=IssmComm::GetRank();
+ 	if(my_rank==0){
++		bool randomflag{};
++		femmodel->parameters->FindParam(&randomflag,SmbRandomflagEnum);
++		int fixedseed;
+ 		for(int i=0;i<nspin;i++){
+ 			IssmDouble* temparray = xNew<IssmDouble>(numbasins);
+-			multivariateNormal(&temparray,numbasins,0.0,covmat);
++			/*Determine whether random seed is fixed to for loop step (randomflag==false) or random seed truly random (randomflag==true)*/
++			if(randomflag) fixedseed=-1;
++			else fixedseed = i;
++			multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
+ 			for(int j=0;j<numbasins;j++){noisespin[i*numbasins+j]=temparray[j];}
+ 			xDelete<IssmDouble>(temparray);
+ 		}
+@@ -193,6 +199,7 @@
+ 	xDelete<IssmDouble>(covmat);
+ }/*}}}*/
+ void Smbautoregressionx(FemModel* femmodel){/*{{{*/
++
+ 	/*Get time parameters*/
+ 	IssmDouble time,dt,starttime,tstep_ar;
+ 	femmodel->parameters->FindParam(&time,TimeEnum);
+@@ -233,7 +240,14 @@
+ 	/*Before looping through elements: compute noise term specific to each basin from covmat*/
+ 	my_rank=IssmComm::GetRank();
+ 	if(my_rank==0){
+-		multivariateNormal(&noiseterms,numbasins,0.0,covmat);
++		bool randomflag{};
++		femmodel->parameters->FindParam(&randomflag,SmbRandomflagEnum);
++		_printf_("randomflag: "<<randomflag<<'\n');
++		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
++		int fixedseed;
++		if(randomflag) fixedseed=-1;
++		else fixedseed = static_cast<int>((time-starttime)/dt);
++		multivariateNormal(&noiseterms,numbasins,0.0,covmat,fixedseed);
+ 	}
+ 	ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26482)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26483)
+@@ -414,7 +414,13 @@
+ syn keyword cConstant SmbAccugradEnum
+ syn keyword cConstant SmbAccurefEnum
+ syn keyword cConstant SmbAdThreshEnum
++syn keyword cConstant SmbAutoregressionInitialTimeEnum
++syn keyword cConstant SmbAutoregressionTimestepEnum
++syn keyword cConstant SmbAutoregressiveOrderEnum
+ syn keyword cConstant SmbAveragingEnum
++syn keyword cConstant SmbBeta0Enum
++syn keyword cConstant SmbBeta1Enum
++syn keyword cConstant SmbCovmatEnum
+ syn keyword cConstant SmbDesfacEnum
+ syn keyword cConstant SmbDpermilEnum
+ syn keyword cConstant SmbDsnowIdxEnum
+@@ -443,8 +449,11 @@
+ syn keyword cConstant SmbIsthermalEnum
+ syn keyword cConstant SmbIsturbulentfluxEnum
+ syn keyword cConstant SmbKEnum
++syn keyword cConstant SmbNumBasinsEnum
+ syn keyword cConstant SmbNumRequestedOutputsEnum
+ syn keyword cConstant SmbPfacEnum
++syn keyword cConstant SmbPhiEnum
++syn keyword cConstant SmbRandomflagEnum
+ syn keyword cConstant SmbRdlEnum
+ syn keyword cConstant SmbRequestedOutputsEnum
+ syn keyword cConstant SmbRlapsEnum
+@@ -539,7 +548,11 @@
+ syn keyword cConstant AdjointEnum
+ syn keyword cConstant AdjointpEnum
+ syn keyword cConstant AdjointxEnum
++syn keyword cConstant AdjointxBaseEnum
++syn keyword cConstant AdjointxShearEnum
+ syn keyword cConstant AdjointyEnum
++syn keyword cConstant AdjointyBaseEnum
++syn keyword cConstant AdjointyShearEnum
+ syn keyword cConstant AdjointzEnum
+ syn keyword cConstant AirEnum
+ syn keyword cConstant ApproximationEnum
+@@ -862,6 +875,7 @@
+ syn keyword cConstant SmbAccumulationEnum
+ syn keyword cConstant SmbAdiffiniEnum
+ syn keyword cConstant SmbAiniEnum
++syn keyword cConstant SmbBasinsIdEnum
+ syn keyword cConstant SmbBMaxEnum
+ syn keyword cConstant SmbBMinEnum
+ syn keyword cConstant SmbBNegEnum
+@@ -947,6 +961,7 @@
+ syn keyword cConstant SmbTiniEnum
+ syn keyword cConstant SmbTmeanEnum
+ syn keyword cConstant SmbTzEnum
++syn keyword cConstant SmbValuesAutoregressionEnum
+ syn keyword cConstant SmbVEnum
+ syn keyword cConstant SmbVmeanEnum
+ syn keyword cConstant SmbVzEnum
+@@ -1410,6 +1425,7 @@
+ syn keyword cConstant SamplingAnalysisEnum
+ syn keyword cConstant SamplingSolutionEnum
+ syn keyword cConstant SIAApproximationEnum
++syn keyword cConstant SMBautoregressionEnum
+ syn keyword cConstant SMBcomponentsEnum
+ syn keyword cConstant SMBd18opddEnum
+ syn keyword cConstant SMBforcingEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26482)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26483)
+@@ -447,6 +447,7 @@
+ 	SmbNumRequestedOutputsEnum,
+ 	SmbPfacEnum,
+ 	SmbPhiEnum,
++	SmbRandomflagEnum,
+ 	SmbRdlEnum,
+ 	SmbRequestedOutputsEnum,
+ 	SmbRlapsEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26482)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26483)
+@@ -455,6 +455,7 @@
+ 		case SmbNumRequestedOutputsEnum : return "SmbNumRequestedOutputs";
+ 		case SmbPfacEnum : return "SmbPfac";
+ 		case SmbPhiEnum : return "SmbPhi";
++		case SmbRandomflagEnum : return "SmbRandomflag";
+ 		case SmbRdlEnum : return "SmbRdl";
+ 		case SmbRequestedOutputsEnum : return "SmbRequestedOutputs";
+ 		case SmbRlapsEnum : return "SmbRlaps";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26482)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26483)
+@@ -464,6 +464,7 @@
+ 	      else if (strcmp(name,"SmbNumRequestedOutputs")==0) return SmbNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
+ 	      else if (strcmp(name,"SmbPhi")==0) return SmbPhiEnum;
++	      else if (strcmp(name,"SmbRandomflag")==0) return SmbRandomflagEnum;
+ 	      else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
+ 	      else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+@@ -504,11 +505,11 @@
+ 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
+ 	      else if (strcmp(name,"ThermalMaxiter")==0) return ThermalMaxiterEnum;
+ 	      else if (strcmp(name,"ThermalNumRequestedOutputs")==0) return ThermalNumRequestedOutputsEnum;
+-	      else if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
++	      if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
++	      else if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
+ 	      else if (strcmp(name,"ThermalPenaltyThreshold")==0) return ThermalPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"ThermalReltol")==0) return ThermalReltolEnum;
+ 	      else if (strcmp(name,"ThermalRequestedOutputs")==0) return ThermalRequestedOutputsEnum;
+@@ -627,11 +628,11 @@
+ 	      else if (strcmp(name,"DamageDOld")==0) return DamageDOldEnum;
+ 	      else if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
+ 	      else if (strcmp(name,"DamageDbarOld")==0) return DamageDbarOldEnum;
+-	      else if (strcmp(name,"DamageF")==0) return DamageFEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
++	      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,"DeltaIceThickness")==0) return DeltaIceThicknessEnum;
+ 	      else if (strcmp(name,"DeltaTws")==0) return DeltaTwsEnum;
+@@ -750,11 +751,11 @@
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
+ 	      else if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum;
+-	      else if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
++	      if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
++	      else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
+ 	      else if (strcmp(name,"LoadingforceZ")==0) return LoadingforceZEnum;
+ 	      else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum;
+ 	      else if (strcmp(name,"MaskIceLevelset")==0) return MaskIceLevelsetEnum;
+@@ -873,11 +874,11 @@
+ 	      else if (strcmp(name,"SealevelchangeViscousU")==0) return SealevelchangeViscousUEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+-	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
++	      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;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+-	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
++	      if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
++	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+@@ -1119,11 +1120,11 @@
+ 	      else if (strcmp(name,"Outputdefinition46")==0) return Outputdefinition46Enum;
+ 	      else if (strcmp(name,"Outputdefinition47")==0) return Outputdefinition47Enum;
+ 	      else if (strcmp(name,"Outputdefinition48")==0) return Outputdefinition48Enum;
+-	      else if (strcmp(name,"Outputdefinition49")==0) return Outputdefinition49Enum;
+          else stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
++	      if (strcmp(name,"Outputdefinition49")==0) return Outputdefinition49Enum;
++	      else if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
+ 	      else if (strcmp(name,"Outputdefinition50")==0) return Outputdefinition50Enum;
+ 	      else if (strcmp(name,"Outputdefinition51")==0) return Outputdefinition51Enum;
+ 	      else if (strcmp(name,"Outputdefinition52")==0) return Outputdefinition52Enum;
+@@ -1242,11 +1243,11 @@
+ 	      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 stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"DefaultAnalysis")==0) return DefaultAnalysisEnum;
++	      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;
+@@ -1365,11 +1366,11 @@
+ 	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"MINI")==0) return MINIEnum;
++	      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;
+@@ -1488,11 +1489,11 @@
+ 	      else if (strcmp(name,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
+ 	      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 stage=13;
+    }
+    if(stage==13){
+-	      if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum;
++	      if (strcmp(name,"Segment")==0) return SegmentEnum;
++	      else 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,"SmbAnalysis")==0) return SmbAnalysisEnum;
+Index: ../trunk-jpl/src/m/classes/SMBautoregression.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBautoregression.m	(revision 26482)
++++ ../trunk-jpl/src/m/classes/SMBautoregression.m	(revision 26483)
+@@ -13,7 +13,8 @@
+ 		ar_timestep       = 0;
+ 		phi               = NaN;
+ 		covmat            = NaN;	
+-		basin_id          = NaN;	
++		basin_id          = NaN;
++		randomflag        = 1;
+ 		steps_per_step    = 1;
+ 		averaging         = 0;
+ 		requested_outputs = {};
+@@ -61,9 +62,10 @@
+ 			end
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+-			self.ar_order    = 0.0; %autoregression model of order 0 
++			self.ar_order    = 0.0; %autoregression model of order 0
++			self.randomflag  = 1;
+ 		end % }}}
+-		function md = checkconsistency(self,md,solution,analyses) % {{{
++		function md = checkconsistency(self,md,solution,analyses) 
+ 
+ 			if ismember('MasstransportAnalysis',analyses),
+ 				md = checkfield(md,'fieldname','smb.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
+@@ -75,11 +77,12 @@
+ 				md = checkfield(md,'fieldname','smb.ar_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %autoregression time step cannot be finer than ISSM timestep
+ 				md = checkfield(md,'fieldname','smb.phi','NaN',1,'Inf',1,'size',[md.smb.num_basins,md.smb.ar_order]);
+ 				md = checkfield(md,'fieldname','smb.covmat','NaN',1,'Inf',1,'size',[md.smb.num_basins,md.smb.num_basins]);
++				md = checkfield(md,'fieldname','smb.randomflag','numel',[1],'values',[0 1]);
+ 			end
+ 			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+ 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+ 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+-		end % }}}
++		end 
+ 		function disp(self) % {{{
+ 			disp(sprintf('   surface forcings parameters:'));
+ 			fielddisplay(self,'num_basins','number of different basins [unitless]');
+@@ -91,6 +94,7 @@
+ 			fielddisplay(self,'ar_timestep','time resolution of the autoregressive model [yr]');
+ 			fielddisplay(self,'phi','basin-specific vectors of lag coefficients [unitless]');
+ 			fielddisplay(self,'covmat','inter-basin covariance matrix for multivariate normal noise at each time step [m^2 ice eq. yr^(-2)]');
++			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+ 			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+ 			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+@@ -113,6 +117,7 @@
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta1','format','DoubleMat','name','md.smb.beta1','scale',1./(yts^2),'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','phi','format','DoubleMat','name','md.smb.phi','yts',md.constants.yts); 
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','covmat','format','DoubleMat','name','md.smb.covmat','scale',1./(yts^2),'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','randomflag','format','Boolean');
+ 			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+ 			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26483-26484.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26483-26484.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26483-26484.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26483)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26484)
+@@ -246,7 +246,7 @@
+ 		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+ 		int fixedseed;
+ 		if(randomflag) fixedseed=-1;
+-		else fixedseed = static_cast<int>((time-starttime)/dt);
++		else fixedseed =  reCast<int>((time-starttime)/dt);
+ 		multivariateNormal(&noiseterms,numbasins,0.0,covmat,fixedseed);
+ 	}
+ 	ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
Index: /issm/oecreview/Archive/25834-26739/ISSM-26484-26485.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26484-26485.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26484-26485.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26484)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26485)
+@@ -246,7 +246,7 @@
+ 		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+ 		int fixedseed;
+ 		if(randomflag) fixedseed=-1;
+-		else fixedseed =  reCast<int>((time-starttime)/dt);
++		else fixedseed =  reCast<int,IssmDouble>((time-starttime)/dt);
+ 		multivariateNormal(&noiseterms,numbasins,0.0,covmat,fixedseed);
+ 	}
+ 	ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
Index: /issm/oecreview/Archive/25834-26739/ISSM-26485-26486.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26485-26486.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26485-26486.diff	(revision 26740)
@@ -0,0 +1,229 @@
+Index: ../trunk-jpl/src/m/classes/SMBautoregression.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBautoregression.m	(revision 26485)
++++ ../trunk-jpl/src/m/classes/SMBautoregression.m	(revision 26486)
+@@ -12,7 +12,7 @@
+ 		ar_initialtime    = 0;
+ 		ar_timestep       = 0;
+ 		phi               = NaN;
+-		covmat            = NaN;	
++		covmat            = NaN;
+ 		basin_id          = NaN;
+ 		randomflag        = 1;
+ 		steps_per_step    = 1;
+@@ -42,15 +42,15 @@
+ 			if (self.ar_order==0)
+ 				self.ar_order = 1; %dummy 1 value for autoregression
+ 				self.phi      = zeros(self.num_basins,self.ar_order); %autoregression coefficients all set to 0 
+-				disp('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0');	
++				disp('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0');
+ 			end
+ 			if (self.ar_initialtime==0)
+ 				self.ar_initialtime = md.timestepping.start_time; %autoregression model has no prescribed initial time
+-				disp('      smb.ar_initialtime (initial time in the autoregressive model parameterization) not specified: set to md.timestepping.start_time');	
++				disp('      smb.ar_initialtime (initial time in the autoregressive model parameterization) not specified: set to md.timestepping.start_time');
+ 			end
+ 			if (self.ar_timestep==0)
+ 				self.ar_timestep = md.timestepping.time_step; %autoregression model has no prescribed time step
+-				disp('      smb.ar_timestep (timestep of autoregressive model) not specified: set to md.timestepping.time_step');	
++				disp('      smb.ar_timestep (timestep of autoregressive model) not specified: set to md.timestepping.time_step');
+ 			end
+ 			if isnan(self.phi)
+ 				self.phi = zeros(self.num_basins,self.ar_order); %autoregression model of order 0 
+@@ -113,13 +113,13 @@
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_initialtime','format','Double','scale',yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ar_timestep','format','Double','scale',yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','basin_id','data',self.basin_id-1,'name','md.smb.basin_id','format','IntMat','mattype',2); %0-indexed
+-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta0','format','DoubleMat','name','md.smb.beta0','scale',1./yts,'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta1','format','DoubleMat','name','md.smb.beta1','scale',1./(yts^2),'yts',md.constants.yts);
+-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','phi','format','DoubleMat','name','md.smb.phi','yts',md.constants.yts); 
+-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','covmat','format','DoubleMat','name','md.smb.covmat','scale',1./(yts^2),'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta0','format','DoubleMat','name','md.smb.beta0','scale',1./yts,'yts',yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta1','format','DoubleMat','name','md.smb.beta1','scale',1./(yts^2),'yts',yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','phi','format','DoubleMat','name','md.smb.phi','yts',yts); 
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','covmat','format','DoubleMat','name','md.smb.covmat','scale',1./(yts^2),'yts',yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','randomflag','format','Boolean');
+-			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+-			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
++			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
+ 
+ 			%process requested outputs
+ 			outputs = self.requested_outputs;
+Index: ../trunk-jpl/src/m/classes/SMBautoregression.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBautoregression.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/SMBautoregression.py	(revision 26486)
+@@ -0,0 +1,138 @@
++import numpy as np
++
++from checkfield import *
++from fielddisplay import fielddisplay
++from project3d import *
++from WriteData import *
++
++
++class SMBcomponents(object):
++    """SMBAUTOREGRESSION class definition
++
++    Usage:
++        SMBautoregression = SMBautoregression()
++    """
++
++    def __init__(self, *args):  # {{{
++        self.num_basins = 0
++        self.beta0 = np.nan
++        self.beta1 = np.nan
++        self.ar_order = 0
++        self.ar_initialtime = 0
++        self.ar_timestep = 0
++        self.phi = np.nan
++        self.covmat = np.nan
++        self.basin_id = np.nan
++        self.randomflag = 1
++        self.steps_per_step = 1
++        self.averaging = 0
++        self.requested_outputs = []
++
++        nargs = len(args)
++        if nargs == 0:
++            self.setdefaultparameters()
++        else:
++            raise Exception('constructor not supported')
++    # }}}
++
++    def __repr__(self):  # {{{
++        s = '   surface forcings parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
++        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta0', 'basin-specific intercept values [m ice eq./yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta1', 'basin-specific trend values [m ice eq. yr^(-2)]'))
++        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
++        s += '{}\n'.format(fielddisplay(self, 'ar_initialtime', 'initial time assumed in the autoregressive model parameterization [yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'ar_timestep', 'time resolution of the autoregressive model [yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'phi', 'basin-specific vectors of lag coefficients [unitless]'))
++        s += '{}\n'.format(fielddisplay(self, 'covmat', 'inter-basin covariance matrix for multivariate normal noise at each time step [m^2 ice eq. yr^(-2)]'))
++        s += '{}\n'.format(fielddisplay(self, 'randomflag', 'whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)'))
++        s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
++        s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
++        s += '\t\t{}\n'.format('0: Arithmetic (default)')
++        s += '\t\t{}\n'.format('1: Geometric')
++        s += '\t\t{}\n'.format('2: Harmonic')
++        s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
++        return s
++    # }}}
++
++    def setdefaultparameters(self): #{{{
++        self.ar_order = 0.0 # Autoregression model of order 0
++        self.randomflag = 1
++    # }}}
++
++    def extrude(self, md):  # {{{
++        return self # Nothing for now
++    # }}}
++
++    def defaultoutputs(self, md):  # {{{
++        return []
++    # }}}
++
++    def initialize(self, md):  # {{{
++        if np.all(np.isnan(self.beta1)):
++            self.beta1 = np.zeros((1, self.num_basins)) # No trend in SMB
++            print('      smb.beta1 (trend) not specified: value set to 0')
++        if self.ar_order == 0:
++            self.ar_order = 1 # Dummy 1 value for autoregression
++            self.phi = np.zeros((self.num_basins, self.ar_order)) # Autorgression coefficients all set to 0
++            print('      smb.ar_order (order of autoregressive model) not specified: order of autoregressive model set to 0')
++        if self.ar_initialtime == 0:
++            self.ar_initialtime = md.timestepping.start_time # Autoregression model has no prescribed initial time
++            print('      smb.ar_initialtime (initial time in the autoregressive model parameterization) not specified: set to md.timestepping.start_time')
++        if self.ar_timestep == 0:
++            self.ar_timestep = md.timestepping.time_step # Autoregression model has no prescribed time step
++            print('      smb.ar_timestep (timestep of autoregressive model) not specified: set to md.timestepping.time_step')
++        if np.all(np.isnan(self.phi)):
++            self.phi = np.zeros((self.num_basins, self.ar_order)) # Autoregression model of order 0
++            print('      smb.phi (lag coefficients) not specified: order of autoregressive model set to 0')
++        if np.all(np.isnan(self.covmat)):
++            self.covmat = 1e-21 * np.eye(self.num_basins) # No stochasticity and no covariance
++            print('      smb.covmat not specified: stochasticity set to 0')
++        return self
++    # }}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        if 'MasstransportAnalysis' in analyses:
++            md = checkfield(md, 'fieldname', 'smb.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
++            md = checkfield(md, 'fieldname', 'smb.basin_id', 'Inf', 1, '>=', 0, '<=', md.smb.num_basins, 'size', [md.mesh.numberofelements])
++            md = checkfield(md, 'fieldname', 'smb.beta0', 'NaN', 1, 'Inf', 1, 'size', [1, md.smb.num_basins], 'numel', md.smb.num_basins) # Scheme fails if passed as column vector
++            md = checkfield(md, 'fieldname', 'smb.beta1', 'NaN', 1, 'Inf', 1, 'size', [1, md.smb.num_basins], 'numel', md.smb.num_basins) # Scheme fails if passed as column vector
++            md = checkfield(md, 'fieldname', 'smb.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
++            md = checkfield(md, 'fieldname', 'smb.ar_initialtime', 'numel', 1, 'NaN', 1, 'Inf', 1)
++            md = checkfield(md, 'fieldname', 'smb.ar_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
++            md = checkfield(md, 'fieldname', 'smb.phi', 'NaN', 1, 'Inf', 1, 'size', [md.smb.num_basins, md.smb.ar_order])
++            md = checkfield(md, 'fieldname', 'smb.covmat', 'NaN', 1, 'Inf', 1, 'size', [md.smb.num_basins, md.smb.num_basins])
++            md = checkfield(md, 'fieldname', 'smb.randomflag', 'numel', [1], 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
++        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
++        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
++        return md
++    # }}}
++
++    def marshall(self, prefix, md, fid):  # {{{
++        yts = md.constants.yts
++
++        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 55, 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'num_basins', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ar_order', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ar_initialtime', 'format', 'Double', 'scale', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ar_timestep', 'format', 'Double', 'scale', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'basin_id', 'data', self.basin_id, 'name', 'md.smb.basin_id', 'format', 'IntMat', 'mattype', 2) # 0-indexed
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'beta0', 'format', 'DoubleMat', 'name', 'md.smb.beta0', 'scale', 1 / yts, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'beta1', 'format', 'DoubleMat', 'name', 'md.smb.beta1', 'scale', 1 / (yts ** 2), 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'phi', 'format', 'DoubleMat', 'name', 'md.smb.phi', 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'covmat', 'format', 'DoubleMat', 'name', 'md.smb.covmat', 'scale', 1 / (yts ** 2), 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'randomflag', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
++
++        # Process requested outputs
++        outputs = self.requested_outputs
++        indices = [i for i, x in enumerate(outputs) if x == 'default']
++        if len(indices) > 0:
++            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
++            outputs = outputscopy
++        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
++
++    # }}}
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26485)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 26486)
+@@ -82,9 +82,9 @@
+ 			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);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+ 			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+ 			WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer');
+ 			%process requested outputs
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26485)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 26486)
+@@ -60,10 +60,10 @@
+             print('      no SMB.accumulation specified: values set as zero')
+         if np.all(np.isnan(self.evaporation)):
+             self.evaporation = np.zeros((md.mesh.numberofvertices))
+-            print("      no SMB.evaporation specified: values set as zero")
++            print('      no SMB.evaporation specified: values set as zero')
+         if np.all(np.isnan(self.runoff)):
+             self.runoff = np.zeros((md.mesh.numberofvertices))
+-            print("      no SMB.runoff specified: values set as zero")
++            print('      no SMB.runoff specified: values set as zero')
+         return self
+     # }}}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26486-26487.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26486-26487.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26486-26487.diff	(revision 26740)
@@ -0,0 +1,578 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26486)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26487)
+@@ -4718,62 +4718,6 @@
+ 
+ }
+ /*}}}*/
+-void       Tria::RignotMeltParameterization(){/*{{{*/
+-
+-   IssmDouble A, B, alpha, beta;
+-	IssmDouble bed,qsg,qsg_basin,TF,yts;
+-	int numbasins;
+-	IssmDouble basinid[NUMVERTICES];
+-	IssmDouble* basin_icefront_area=NULL;
+-
+-	/* Coefficients */
+-	A    = 3e-4;
+-	B    = 0.15;
+-	alpha = 0.39;
+-	beta = 1.18;
+-
+-	/*Get inputs*/
+-	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
+-	Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);		 _assert_(qsg_input);
+-	Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
+-	Element::GetInputListOnVertices(&basinid[0],FrontalForcingsBasinIdEnum);
+-
+-	this->FindParam(&yts, ConstantsYtsEnum);
+-	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+-	this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
+-
+-	IssmDouble meltrates[NUMVERTICES];  //frontal melt-rate
+-
+-	/* Start looping on the number of vertices: */
+-	GaussTria gauss;
+-	for(int iv=0;iv<NUMVERTICES;iv++){
+-		gauss.GaussVertex(iv);
+-
+-		/* Get variables */
+-		bed_input->GetInputValue(&bed,&gauss);
+-		qsg_input->GetInputValue(&qsg,&gauss);
+-		TF_input->GetInputValue(&TF,&gauss);
+-
+-		if(basin_icefront_area[reCast<int>(basinid[iv])-1]==0.) meltrates[iv]=0.;
+-		else{
+-			/* change the unit of qsg (m^3/d -> m/d) with ice front area */
+-			qsg_basin=qsg/basin_icefront_area[reCast<int>(basinid[iv])-1];
+-
+-			/* calculate melt rates */
+-			meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
+-		}
+-
+-		if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
+-		if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
+-	}
+-
+-	/*Add input*/
+-	this->AddInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum);
+-
+-	/*Cleanup and return*/
+-	xDelete<IssmDouble>(basin_icefront_area);
+-}
+-/*}}}*/
+ void       Tria::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int M, int N){/*{{{*/
+ 
+ 	IssmDouble  values[NUMVERTICES];
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26486)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 26487)
+@@ -131,7 +131,6 @@
+ 		void        ResetFSBasalBoundaryCondition(void);
+ 		void        ResetHooks();
+ 		void        ResetLevelsetFromSegmentlist(IssmDouble* segments,int numsegments);
+-		void        RignotMeltParameterization();
+ 		void        SetElementInput(int enum_in,IssmDouble value);
+ 		void        SetElementInput(int enum_in,IssmDouble value,int type);
+ 		void        SetElementInput(Inputs* inputs,int enum_in,IssmDouble value);
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26486)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26487)
+@@ -1601,36 +1601,29 @@
+ }/*}}}*/
+ void FemModel::IcefrontAreax(){/*{{{*/
+ 
+-	int numvertices      = 6;
+-	int numbasins;
+-	IssmDouble* BasinId   = xNew<IssmDouble>(numvertices);
++	int numbasins,BasinId;
+ 	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+-	IssmDouble* basin_icefront_area           = xNewZeroInit<IssmDouble>(numbasins);
++	IssmDouble* basin_icefront_area = xNewZeroInit<IssmDouble>(numbasins);
+ 
+-	for(int basin=1;basin<numbasins+1;basin++){
++	for(int basin=0;basin<numbasins;basin++){
+ 		IssmDouble local_icefront_area = 0;
+ 		IssmDouble total_icefront_area;
+ 
++		/*Add contribution of each element to icefront area of the basin*/
+ 		for(Object* & object : this->elements->objects){
+ 			Element* element= xDynamicCast<Element*>(object);
+-			element->GetInputListOnVertices(BasinId,FrontalForcingsBasinIdEnum);
+-			for(int j=0;j<numvertices;j++){
+-				if(BasinId[j]==basin){
+-					local_icefront_area+=element->GetIcefrontArea();
+-					break;
+-				}
+-			}
++			element->GetInputValue(&BasinId,FrontalForcingsBasinIdEnum);
++			if(BasinId==basin) local_icefront_area+=element->GetIcefrontArea();
+ 		}
+ 		ISSM_MPI_Reduce(&local_icefront_area,&total_icefront_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
+ 		ISSM_MPI_Bcast(&total_icefront_area,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 
+-		basin_icefront_area[basin-1]=total_icefront_area;
++		basin_icefront_area[basin]=total_icefront_area;
+ 	}
+-
++	
+ 	this->parameters->AddObject(new DoubleVecParam(FrontalForcingsBasinIcefrontAreaEnum,basin_icefront_area,numbasins));
+ 
+ 	xDelete<IssmDouble>(basin_icefront_area);
+-	xDelete<IssmDouble>(BasinId);
+ }/*}}}*/
+ void FemModel::IcefrontMassFluxx(IssmDouble* pM, bool scaled){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26486)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26487)
+@@ -92,7 +92,7 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.meltingrate",CalvingMeltingrateEnum);
+ 			break;
+ 		case FrontalForcingsRignotEnum:
+-			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.basin",FrontalForcingsBasinIdEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.basin_id",FrontalForcingsBasinIdEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
+ 			break;
+@@ -140,7 +140,7 @@
+ 		case FrontalForcingsDefaultEnum:
+ 			break;
+ 		case FrontalForcingsRignotEnum:
+-			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.numberofbasins",FrontalForcingsNumberofBasinsEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.num_basins",FrontalForcingsNumberofBasinsEnum));
+ 			break;
+ 		default:
+ 			_error_("Frontal forcings "<<EnumToStringx(melt_parameterization)<<" not supported yet");
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26486)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26487)
+@@ -3377,6 +3377,61 @@
+ 	}
+ 
+ } /*}}}*/
++void       Element::RignotMeltParameterization(){/*{{{*/
++
++	const int numvertices = this->GetNumberOfVertices();
++   IssmDouble A, B, alpha, beta;
++   IssmDouble bed,qsg,qsg_basin,TF,yts;
++   int numbasins,basinid;
++   IssmDouble* basin_icefront_area=NULL;
++
++   /* Coefficients */
++   A    = 3e-4;
++   B    = 0.15;
++   alpha = 0.39;
++   beta = 1.18;
++
++   /*Get inputs*/
++	this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
++	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
++   Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);     _assert_(qsg_input);
++   Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
++
++	this->FindParam(&yts, ConstantsYtsEnum);
++   this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
++   this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
++   IssmDouble meltrates[numvertices];  
++
++   /* Start looping on the number of vertices: */
++   GaussTria gauss;
++   for(int iv=0;iv<numvertices;iv++){
++      gauss.GaussVertex(iv);
++
++      /* Get variables */
++      bed_input->GetInputValue(&bed,&gauss);
++      qsg_input->GetInputValue(&qsg,&gauss);
++      TF_input->GetInputValue(&TF,&gauss);
++
++      if(basin_icefront_area[basinid]==0.) meltrates[iv]=0.;
++      else{
++         /* change the unit of qsg (m^3/d -> m/d) with ice front area */
++         qsg_basin=qsg/basin_icefront_area[basinid];
++
++         /* calculate melt rates */
++         meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
++      }
++
++      if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
++      if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
++   }
++
++   /*Add input*/
++   this->AddInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum);
++
++   /*Cleanup and return*/
++   xDelete<IssmDouble>(basin_icefront_area);
++}
++/*}}}*/
+ void       Element::SetBoolInput(Inputs* inputs,int enum_in,bool value){/*{{{*/
+ 
+ 	_assert_(inputs);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26486)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26487)
+@@ -166,6 +166,7 @@
+ 		void               PicoComputeBasalMelt();
+ 		void               PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac);
+ 		void               PositiveDegreeDaySicopolis(bool isfirnwarming);
++		void               RignotMeltParameterization();
+ 		void               ResultInterpolation(int* pinterpolation,int*nodesperelement,int* parray_size, int output_enum);
+ 		void               ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum);
+ 		void               ResultToMatrix(IssmDouble* values,int ncols,int output_enum);
+@@ -344,7 +345,6 @@
+ 		virtual void       ReduceMatrices(ElementMatrix* Ke,ElementVector* pe)=0;
+ 		virtual void       ResetFSBasalBoundaryCondition()=0;
+ 		virtual void       ResetHooks()=0;
+-		virtual void       RignotMeltParameterization(void){_error_("not implemented yet");};
+ 		virtual void       SetElementInput(int enum_in,IssmDouble value){_error_("not implemented yet");};
+ 		virtual void       SetElementInput(int enum_in,IssmDouble value, int type)=0;
+ 		virtual void       SetElementInput(Inputs* inputs,int enum_in,IssmDouble values){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26486)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26487)
+@@ -3403,66 +3403,6 @@
+ 
+ }
+ /*}}}*/
+-void       Penta::RignotMeltParameterization(){/*{{{*/
+-
+-	if(!this->IsOnBase()) return;
+-
+-	IssmDouble A, B, alpha, beta;
+-	IssmDouble bed,qsg,qsg_basin,TF,yts;
+-	int numbasins;
+-	IssmDouble basinid[NUMVERTICES];
+-	IssmDouble* basin_icefront_area=NULL;
+-
+-	/* Coefficients */
+-	A    = 3e-4;
+-	B    = 0.15;
+-	alpha = 0.39;
+-	beta = 1.18;
+-
+-	/*Get inputs*/
+-	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
+-	Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);		 _assert_(qsg_input);
+-	Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
+-	Element::GetInputListOnVertices(&basinid[0],FrontalForcingsBasinIdEnum);
+-
+-	this->FindParam(&yts, ConstantsYtsEnum);
+-	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+-	this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
+-
+-	IssmDouble meltrates[NUMVERTICES2D];  //frontal melt-rate
+-
+-	/* Start looping on the number of vertices: */
+-	GaussPenta gauss;
+-	for(int iv=0;iv<NUMVERTICES2D;iv++){
+-		gauss.GaussVertex(iv);
+-
+-		/* Get variables */
+-		bed_input->GetInputValue(&bed,&gauss);
+-		qsg_input->GetInputValue(&qsg,&gauss);
+-		TF_input->GetInputValue(&TF,&gauss);
+-
+-		if(basinid[iv]==0 || basin_icefront_area[reCast<int>(basinid[iv])-1]==0.) meltrates[iv]=0.;
+-		else{
+-			/* change the unit of qsg (m^3/d -> m/d) with ice front area */
+-			qsg_basin=qsg/basin_icefront_area[reCast<int>(basinid[iv])-1];
+-
+-			/* calculate melt rates */
+-			meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
+-		}
+-
+-		if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
+-		if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
+-	}
+-
+-	/*Add input*/
+-	this->AddInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum);
+-
+-	this->InputExtrude(CalvingMeltingrateEnum,-1);
+-
+-	/*Cleanup and return*/
+-	xDelete<IssmDouble>(basin_icefront_area);
+-}
+-/*}}}*/
+ void       Penta::SetElementInput(int enum_in,IssmDouble value){/*{{{*/
+ 
+ 	this->SetElementInput(this->inputs,enum_in,value);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26486)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26487)
+@@ -170,7 +170,6 @@
+ 		void           ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
+ 		void           ResetFSBasalBoundaryCondition(void);
+ 		void           ResetHooks();
+-		void				RignotMeltParameterization();
+ 		void           SetElementInput(int enum_in,IssmDouble value);
+ 		void           SetElementInput(int enum_in,IssmDouble value,int type){_error_("not implemented yet");};
+ 		void           SetElementInput(Inputs* inputs,int enum_in,IssmDouble value);
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26486)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26487)
+@@ -242,7 +242,6 @@
+ 	if(my_rank==0){
+ 		bool randomflag{};
+ 		femmodel->parameters->FindParam(&randomflag,SmbRandomflagEnum);
+-		_printf_("randomflag: "<<randomflag<<'\n');
+ 		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+ 		int fixedseed;
+ 		if(randomflag) fixedseed=-1;
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignot.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignot.m	(revision 26486)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignot.m	(revision 26487)
+@@ -5,10 +5,10 @@
+ 
+ classdef frontalforcingsrignot
+ 	properties (SetAccess=public) 
+-		basin= NaN;
+-		numberofbasins=0;
+-		subglacial_discharge= NaN;
+-		thermalforcing=NaN;
++		basin_id             = NaN;
++		num_basins           = 0;
++		subglacial_discharge = NaN;
++		thermalforcing       = NaN;
+ 	end
+ 	methods
+ 		function self = frontalforcingsrignot(varargin) % {{{
+@@ -34,17 +34,17 @@
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
+-			basin=NaN;
+-			numberofbasins=0;
+-			subglacial_discharge=NaN;
+-			thermalforcing=NaN;
++			basin_id             = NaN;
++			num_basins           = 0;
++			subglacial_discharge = NaN;
++			thermalforcing       = NaN;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 			%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.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
++			md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
+ 			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','frontalforcings.thermalforcing','nan',1,'Inf',1,'timeseries',1);
+ 
+@@ -51,15 +51,15 @@
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   Frontalforcings parameters:'));
+-			fielddisplay(self,'basin','basin ID for vertices');
+-			fielddisplay(self,'numberofbasins', 'number of basins');
++			fielddisplay(self,'basin_id','basin ID for elements');
++			fielddisplay(self,'num_basins', 'number of basins');
+ 			fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m/d]');
+ 			fielddisplay(self,'thermalforcing','thermal forcing [∘C]');
+ 		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','basin_id','data',self.basin_id-1,'name','md.frontalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
++			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'fieldname','thermalforcing','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+ 		end % }}}
+Index: ../trunk-jpl/test/Archives/Archive257.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive257.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/Archives/Archive542.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive542.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26487)
+@@ -0,0 +1,69 @@
++%Test Name: SquareShelfSMBautoregression
++md=triangle(model(),'../Exp/Square.exp',80000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.transient.requested_outputs={'default','IceVolume','SmbMassBalance',};
++
++ymax = max(md.mesh.y);
++xmax = max(md.mesh.x);
++%Generate basin IDs for 3 basins
++idbasin      = zeros(md.mesh.numberofelements,1);
++iid1         = find(md.mesh.y>=2/3*ymax);
++iid2         = intersect(find(md.mesh.y<2/3*ymax),find(md.mesh.x>=1/3*xmax));
++iid3         = intersect(find(md.mesh.y<2/3*ymax),find(md.mesh.x<1/3*xmax));
++for ii=1:md.mesh.numberofelements
++    for vertex=1:3
++        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
++            idbasin(ii) = 1;
++        end
++    end
++    if idbasin(ii)==0 %no vertex was found in basin 1
++        for vertex=1:3
++            if any(iid2==md.mesh.elements(ii,vertex)) %one vertex in basin 2
++                idbasin(ii) = 2;
++            end
++        end
++    end
++    if idbasin(ii)==0 %no vertex was found in basin 1 and 2
++        idbasin(ii) = 3;
++    end
++end
++
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Thickness1','Volume1','SmbMassBalance1','Vx2','Vy2','Vel2','Thickness2','Volume2','SmbMassBalance2','Vx3','Vy3','Vel3','Thickness3','Volume3','SmbMassBalance3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
++						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13...
++						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).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).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).IceVolume),...
++    (md.results.TransientSolution(2).SmbMassBalance),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).IceVolume),...
++    (md.results.TransientSolution(3).SmbMassBalance),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test542.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test542.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test542.m	(revision 26487)
+@@ -0,0 +1,83 @@
++%Test Name: PigTranFrontalforcingsrignot
++md=triangle(model(),'../Exp/Pig.exp',10000.);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=setflowequation(md,'SSA','all');
++md.timestepping.time_step=2;
++md.timestepping.final_time=50;
++
++%separate domain in 2 basins
++idbasin = zeros(md.mesh.numberofelements,1);
++iid1    = find(md.mesh.y>=mean(md.mesh.y));
++for ii=1:md.mesh.numberofelements
++    for vertex=1:3
++        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
++            idbasin(ii) = 1;
++        end
++    end
++    if idbasin(ii)==0 %no vertex was found in basin 1
++        idbasin(ii) = 2;
++    end
++end
++
++%calving and frontalforcings parameters
++md.mask.ice_levelset = 1e4*(md.mask.ice_levelset + 0.5);
++md.calving=calvingvonmises();
++md.frontalforcings=frontalforcingsrignot();
++md.frontalforcings.num_basins = 2;
++md.frontalforcings.basin_id = idbasin;
++md.frontalforcings.subglacial_discharge = 0.1*ones(md.mesh.numberofvertices,1);
++md.frontalforcings.thermalforcing = 0.5*ones(md.mesh.numberofvertices,1);
++for elem=1:md.mesh.numberofelements
++    if idbasin(elem)==2
++        md.frontalforcings.thermalforcing(md.mesh.elements(elem,1:3)) = 1.5;
++    end
++end
++md.transient.ismovingfront = 1;
++md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 1e10;
++
++md.transient.requested_outputs = {'default','CalvingMeltingrate'};
++md.cluster=generic('name',oshostname(),'np',2);
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names ={...
++   'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1', 'CalvingMeltingrate1',...
++   'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2', 'CalvingMeltingrate2',...
++   'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10', 'CalvingMeltingrate10',...
++   };
++field_tolerances={...
++   1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,1e-9,...
++   2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,1e-9,...
++   2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-9,...
++   };
++field_values={...
++   (md.results.TransientSolution(1).Vx),...
++   (md.results.TransientSolution(1).Vy),...
++   (md.results.TransientSolution(1).Vel),...
++   (md.results.TransientSolution(1).Pressure),...
++   (md.results.TransientSolution(1).Base),...
++   (md.results.TransientSolution(1).Surface),...
++   (md.results.TransientSolution(1).Thickness),...
++   (md.results.TransientSolution(1).CalvingMeltingrate),...
++   (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(2).CalvingMeltingrate),...
++   (md.results.TransientSolution(10).Vx),...
++   (md.results.TransientSolution(10).Vy),...
++   (md.results.TransientSolution(10).Vel),...
++   (md.results.TransientSolution(10).Pressure),...
++   (md.results.TransientSolution(10).Base),...
++   (md.results.TransientSolution(10).Surface),...
++   (md.results.TransientSolution(10).Thickness),...
++   (md.results.TransientSolution(10).MaskIceLevelset),...
++   (md.results.TransientSolution(10).CalvingMeltingrate),...
++   };
Index: /issm/oecreview/Archive/25834-26739/ISSM-26487-26488.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26487-26488.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26487-26488.diff	(revision 26740)
@@ -0,0 +1,295 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26487)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26488)
+@@ -708,6 +708,10 @@
+ syn keyword cConstant HydrologyDrainageRateEnum
+ syn keyword cConstant HydrologyEnglacialInputEnum
+ syn keyword cConstant HydrologyGapHeightEnum
++syn keyword cConstant HydrologyGapHeightXEnum
++syn keyword cConstant HydrologyGapHeightXXEnum
++syn keyword cConstant HydrologyGapHeightYEnum
++syn keyword cConstant HydrologyGapHeightYYEnum
+ syn keyword cConstant HydrologyHeadEnum
+ syn keyword cConstant HydrologyHeadOldEnum
+ syn keyword cConstant HydrologyMoulinInputEnum
+@@ -1548,7 +1552,6 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
+-syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1555,8 +1558,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DataSetParam
+ syn keyword cType DatasetInput
+-syn keyword cType DataSetParam
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1569,8 +1572,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType ElementVector
+ syn keyword cType Elements
+-syn keyword cType ElementVector
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1577,12 +1580,11 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1598,7 +1600,6 @@
+ 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
+@@ -1609,7 +1610,6 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
+-syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1622,8 +1622,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType OptionUtilities
+ syn keyword cType Options
+-syn keyword cType OptionUtilities
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1637,13 +1637,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType RiftStruct
+ syn keyword cType Riftfront
+-syn keyword cType RiftStruct
+ syn keyword cType SealevelGeometry
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType SegRef
+ syn keyword cType Segment
+-syn keyword cType SegRef
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1662,6 +1662,10 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26487)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26488)
+@@ -704,6 +704,10 @@
+    HydrologyDrainageRateEnum,
+    HydrologyEnglacialInputEnum,
+ 	HydrologyGapHeightEnum,
++	HydrologyGapHeightXEnum,
++	HydrologyGapHeightXXEnum,
++	HydrologyGapHeightYEnum,
++	HydrologyGapHeightYYEnum,
+ 	HydrologyHeadEnum,
+ 	HydrologyHeadOldEnum,
+ 	HydrologyMoulinInputEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26487)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26488)
+@@ -710,6 +710,10 @@
+ 		case HydrologyDrainageRateEnum : return "HydrologyDrainageRate";
+ 		case HydrologyEnglacialInputEnum : return "HydrologyEnglacialInput";
+ 		case HydrologyGapHeightEnum : return "HydrologyGapHeight";
++		case HydrologyGapHeightXEnum : return "HydrologyGapHeightX";
++		case HydrologyGapHeightXXEnum : return "HydrologyGapHeightXX";
++		case HydrologyGapHeightYEnum : return "HydrologyGapHeightY";
++		case HydrologyGapHeightYYEnum : return "HydrologyGapHeightYY";
+ 		case HydrologyHeadEnum : return "HydrologyHead";
+ 		case HydrologyHeadOldEnum : return "HydrologyHeadOld";
+ 		case HydrologyMoulinInputEnum : return "HydrologyMoulinInput";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26487)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26488)
+@@ -725,6 +725,10 @@
+ 	      else if (strcmp(name,"HydrologyDrainageRate")==0) return HydrologyDrainageRateEnum;
+ 	      else if (strcmp(name,"HydrologyEnglacialInput")==0) return HydrologyEnglacialInputEnum;
+ 	      else if (strcmp(name,"HydrologyGapHeight")==0) return HydrologyGapHeightEnum;
++	      else if (strcmp(name,"HydrologyGapHeightX")==0) return HydrologyGapHeightXEnum;
++	      else if (strcmp(name,"HydrologyGapHeightXX")==0) return HydrologyGapHeightXXEnum;
++	      else if (strcmp(name,"HydrologyGapHeightY")==0) return HydrologyGapHeightYEnum;
++	      else if (strcmp(name,"HydrologyGapHeightYY")==0) return HydrologyGapHeightYYEnum;
+ 	      else if (strcmp(name,"HydrologyHead")==0) return HydrologyHeadEnum;
+ 	      else if (strcmp(name,"HydrologyHeadOld")==0) return HydrologyHeadOldEnum;
+ 	      else if (strcmp(name,"HydrologyMoulinInput")==0) return HydrologyMoulinInputEnum;
+@@ -747,14 +751,14 @@
+ 	      else if (strcmp(name,"InversionThicknessObs")==0) return InversionThicknessObsEnum;
+ 	      else if (strcmp(name,"InversionVelObs")==0) return InversionVelObsEnum;
+ 	      else if (strcmp(name,"InversionVxObs")==0) return InversionVxObsEnum;
+-	      else if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
+ 	      else if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
++	      else if (strcmp(name,"LoadingforceX")==0) return LoadingforceXEnum;
+ 	      else if (strcmp(name,"LoadingforceY")==0) return LoadingforceYEnum;
+ 	      else if (strcmp(name,"LoadingforceZ")==0) return LoadingforceZEnum;
+ 	      else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum;
+@@ -870,14 +874,14 @@
+ 	      else if (strcmp(name,"SealevelchangeGUsubelHydro")==0) return SealevelchangeGUsubelHydroEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelHydro")==0) return SealevelchangeGEsubelHydroEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelHydro")==0) return SealevelchangeGNsubelHydroEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousU")==0) return SealevelchangeViscousUEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
++	      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;
+@@ -993,14 +997,14 @@
+ 	      else if (strcmp(name,"SmbWini")==0) return SmbWiniEnum;
+ 	      else if (strcmp(name,"SmbZMax")==0) return SmbZMaxEnum;
+ 	      else if (strcmp(name,"SmbZMin")==0) return SmbZMinEnum;
+-	      else if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
+ 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
++	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+@@ -1116,14 +1120,14 @@
+ 	      else if (strcmp(name,"Outputdefinition42")==0) return Outputdefinition42Enum;
+ 	      else if (strcmp(name,"Outputdefinition43")==0) return Outputdefinition43Enum;
+ 	      else if (strcmp(name,"Outputdefinition44")==0) return Outputdefinition44Enum;
+-	      else if (strcmp(name,"Outputdefinition45")==0) return Outputdefinition45Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition45")==0) return Outputdefinition45Enum;
+ 	      else if (strcmp(name,"Outputdefinition46")==0) return Outputdefinition46Enum;
+ 	      else if (strcmp(name,"Outputdefinition47")==0) return Outputdefinition47Enum;
+ 	      else if (strcmp(name,"Outputdefinition48")==0) return Outputdefinition48Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition49")==0) return Outputdefinition49Enum;
++	      else if (strcmp(name,"Outputdefinition49")==0) return Outputdefinition49Enum;
+ 	      else if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
+ 	      else if (strcmp(name,"Outputdefinition50")==0) return Outputdefinition50Enum;
+ 	      else if (strcmp(name,"Outputdefinition51")==0) return Outputdefinition51Enum;
+@@ -1239,14 +1243,14 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
++	      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;
+@@ -1362,14 +1366,14 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"LoveSolution")==0) return LoveSolutionEnum;
++	      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;
+@@ -1485,14 +1489,14 @@
+ 	      else if (strcmp(name,"SealevelInertiaTensorZZ")==0) return SealevelInertiaTensorZZEnum;
+ 	      else if (strcmp(name,"SealevelchangePolarMotion")==0) return SealevelchangePolarMotionEnum;
+ 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
+-	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
++         else stage=13;
++   }
++   if(stage==13){
++	      if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
+ 	      else if (strcmp(name,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
+ 	      else if (strcmp(name,"Seg")==0) return SegEnum;
+ 	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
+-         else stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"Segment")==0) return SegmentEnum;
++	      else if (strcmp(name,"Segment")==0) return SegmentEnum;
+ 	      else if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum;
+ 	      else if (strcmp(name,"Separate")==0) return SeparateEnum;
+ 	      else if (strcmp(name,"Seq")==0) return SeqEnum;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26488-26489.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26488-26489.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26488-26489.diff	(revision 26740)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26488)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 26489)
+@@ -166,6 +166,10 @@
+ 		case BedSlopeYEnum:     input2 = basalelement->GetInput(BaseEnum);     _assert_(input2); break;
+ 		case BaseSlopeXEnum:    input2 = basalelement->GetInput(BaseEnum);    _assert_(input2); break;
+ 		case BaseSlopeYEnum:    input2 = basalelement->GetInput(BaseEnum);    _assert_(input2); break;
++		case HydrologyGapHeightXEnum:    input2 = basalelement->GetInput(HydrologyGapHeightEnum);  _assert_(input2); break;
++		case HydrologyGapHeightXXEnum:   input2 = basalelement->GetInput(HydrologyGapHeightXEnum); _assert_(input2); break;
++		case HydrologyGapHeightYEnum:    input2 = basalelement->GetInput(HydrologyGapHeightEnum);  _assert_(input2); break;
++		case HydrologyGapHeightYYEnum:   input2 = basalelement->GetInput(HydrologyGapHeightYEnum); _assert_(input2); break;
+ 		case LevelsetfunctionSlopeXEnum: input2 = basalelement->GetInput(MaskIceLevelsetEnum);     _assert_(input2); break;
+ 		case LevelsetfunctionSlopeYEnum: input2 = basalelement->GetInput(MaskIceLevelsetEnum);     _assert_(input2); break;
+ 		default: input = element->GetInput(input_enum);
+@@ -180,9 +184,16 @@
+ 
+ 		if(input2) input2->GetInputDerivativeValue(&slopes[0],xyz_list,gauss);
+ 		switch(input_enum){
+-			case SurfaceSlopeXEnum: case BedSlopeXEnum: case BaseSlopeXEnum: case LevelsetfunctionSlopeXEnum: value = slopes[0]; break;
+-			case SurfaceSlopeYEnum: case BedSlopeYEnum: case BaseSlopeYEnum: case LevelsetfunctionSlopeYEnum: value = slopes[1]; break;
+-			default: input->GetInputValue(&value,gauss);
++			case SurfaceSlopeXEnum: case BedSlopeXEnum: case BaseSlopeXEnum: case LevelsetfunctionSlopeXEnum: 
++			case HydrologyGapHeightXEnum: case HydrologyGapHeightXXEnum:
++				value = slopes[0];
++				break;
++			case SurfaceSlopeYEnum: case BedSlopeYEnum: case BaseSlopeYEnum: case LevelsetfunctionSlopeYEnum: 
++			case HydrologyGapHeightYEnum: case HydrologyGapHeightYYEnum:
++				value = slopes[1];
++				break;
++			default:
++				input->GetInputValue(&value,gauss);
+ 		}
+ 
+ 		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*value*basis[i];
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26488)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26489)
+@@ -170,9 +170,24 @@
+ 
+ 	/*Using the SHAKTI model*/
+ 	else if (hydrology_model==HydrologyshaktiEnum){
++
++		/*Get second derivatives of gap height*/
++		femmodel->SetCurrentConfiguration(L2ProjectionBaseAnalysisEnum);
++		femmodel->parameters->SetParam(HydrologyGapHeightXEnum,InputToL2ProjectEnum);
++		solutionsequence_linear(femmodel);
++		femmodel->parameters->SetParam(HydrologyGapHeightYEnum,InputToL2ProjectEnum);
++		solutionsequence_linear(femmodel);
++		femmodel->parameters->SetParam(HydrologyGapHeightXXEnum,InputToL2ProjectEnum);
++		solutionsequence_linear(femmodel);
++		femmodel->parameters->SetParam(HydrologyGapHeightYYEnum,InputToL2ProjectEnum);
++		solutionsequence_linear(femmodel);
++
++		/*Get new head*/
+ 		femmodel->SetCurrentConfiguration(HydrologyShaktiAnalysisEnum);
+ 		InputDuplicatex(femmodel,HydrologyHeadEnum,HydrologyHeadOldEnum);
+ 		solutionsequence_shakti_nonlinear(femmodel);
++
++		/*Update Gap Height*/
+ 		if(VerboseSolution()) _printf0_("   updating gap height\n");
+ 		HydrologyShaktiAnalysis* analysis = new HydrologyShaktiAnalysis();
+ 		analysis->UpdateGapHeight(femmodel);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26489-26490.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26489-26490.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26489-26490.diff	(revision 26740)
@@ -0,0 +1,228 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26489)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26490)
+@@ -180,6 +180,7 @@
+ 	/*Intermediaries */
+ 	IssmDouble Jdet;
+ 	IssmDouble* xyz_list = NULL;
++	IssmDouble  gap,bed,thickness,head,g,rho_ice,rho_water,A,B,n,head_old;/***/
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+@@ -200,6 +201,18 @@
+ 	element->FindParam(&storage,HydrologyStorageEnum);
+ 	element->FindParam(&dt,TimesteppingTimeStepEnum);
+ 
++        /***Get all inputs and parameters*/
++        element->FindParam(&rho_water,MaterialsRhoFreshwaterEnum);
++        element->FindParam(&rho_ice,MaterialsRhoIceEnum);
++        element->FindParam(&g,ConstantsGEnum);
++        Input* B_input = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
++        Input* n_input = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
++        Input* gap_input = element->GetInput(HydrologyGapHeightEnum);         _assert_(gap_input);
++        Input* thickness_input = element->GetInput(ThicknessEnum);                  _assert_(thickness_input);
++        Input* head_input = element->GetInput(HydrologyHeadEnum);              _assert_(head_input);
++        Input* base_input = element->GetInput(BaseEnum);                      _assert_(base_input);
++	Input* head_old_input = element->GetInput(HydrologyHeadOldEnum);	_assert_(head_old_input);
++
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGauss(1);
+ 	while(gauss->next()){
+@@ -208,10 +221,33 @@
+ 		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+ 		element->NodalFunctions(basis,gauss);
+ 
++		/***/
++                base_input->GetInputValue(&bed,gauss);
++                thickness_input->GetInputValue(&thickness,gauss);
++                gap_input->GetInputValue(&gap,gauss);
++                head_input->GetInputValue(&head,gauss);
++  		head_old_input->GetInputValue(&head_old,gauss);
++
++                /***Get ice A parameter*/
++                B_input->GetInputValue(&B,gauss);
++                n_input->GetInputValue(&n,gauss);
++                A=pow(B,-n);
++
++                /***Get water and ice pressures*/
++                IssmDouble pressure_ice   = rho_ice*g*thickness;    _assert_(pressure_ice>0.);
++                IssmDouble pressure_water = rho_water*g*(head-bed);
++                if(pressure_water>pressure_ice) pressure_water = pressure_ice;
++
++                /***Get water pressure from previous time step to use in lagged creep term*/
++                IssmDouble pressure_water_old = rho_water*g*(head_old-bed);
++                if(pressure_water_old>pressure_ice) pressure_water_old = pressure_ice;
++
++
+ 		for(int i=0;i<numnodes;i++){
+ 			for(int j=0;j<numnodes;j++){
+ 				Ke->values[i*numnodes+j] += conductivity*gauss->weight*Jdet*(dbasis[0*numnodes+i]*dbasis[0*numnodes+j] + dbasis[1*numnodes+i]*dbasis[1*numnodes+j])
+-				  + gauss->weight*Jdet*storage/dt*basis[i]*basis[j];
++				  + gauss->weight*Jdet*storage/dt*basis[i]*basis[j]
++                			+gauss->weight*Jdet*A*(n)*(pow(fabs(pressure_ice-pressure_water),(n-1))*rho_water*g)*gap*basis[i]*basis[j];
+ 			}
+ 		}
+ 	}
+@@ -231,10 +267,11 @@
+ 	/*Intermediaries */
+ 	IssmDouble  Jdet,meltrate,G,dh[2],B,A,n;
+ 	IssmDouble  gap,bed,thickness,head,ieb,head_old;
+-	IssmDouble  lr,br,vx,vy,beta;
++	IssmDouble  lr,br,vx,vy,beta,lc;
+ 	IssmDouble  alpha2,frictionheat;
+    IssmDouble  PMPheat,dpressure_water[2],dbed[2];	
+ 	IssmDouble* xyz_list = NULL;
++        IssmDouble dgap[2]; /***/
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+@@ -260,6 +297,8 @@
+ 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
+ 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
+    Input* headold_input        = element->GetInput(HydrologyHeadOldEnum);           _assert_(headold_input);
++//	Input* dgapxx_input	    = element->GetInput(HydrologyGapXXEnum); /***/
++//	Input* dgapyy_input	    = element->GetInput(HydrologyGapYYEnum); /***/
+ 
+ 	/*Get conductivity from inputs*/
+ 	IssmDouble conductivity = GetConductivity(element);
+@@ -288,7 +327,7 @@
+ 		englacial_input->GetInputValue(&ieb,gauss);
+ 		lr_input->GetInputValue(&lr,gauss);
+ 		br_input->GetInputValue(&br,gauss);
+-      headold_input->GetInputValue(&head_old,gauss);
++                headold_input->GetInputValue(&head_old,gauss);
+ 
+ 		/*Get ice A parameter*/
+ 		B_input->GetInputValue(&B,gauss);
+@@ -301,6 +340,14 @@
+ 		else
+ 		 beta = 0.;
+ 
++		/* TEST Compute lc term */
++//		if(gap<br)
++//		 lc = gap*(1-(br-gap)/br);
++//		else
++		 lc = gap; 
++//                lc=gap*tanh(pow(gap,3)/pow(br,3));
++//		lc=pow(gap,2)/lr;
++
+ 		/*Compute frictional heat flux*/
+ 		friction->GetAlpha2(&alpha2,gauss);
+ 		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+@@ -323,14 +370,37 @@
+    	meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1])-PMPheat);
+ 		_assert_(meltrate>0.);
+ 
+-		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+-		 (
+-		  meltrate*(1/rho_water-1/rho_ice)
+-		  +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice - pressure_water)*gap
+-		  -beta*sqrt(vx*vx+vy*vy)
+-		  +ieb
+-		  +storage*head_old/dt
+-		  )*basis[i];     	
++
++//		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
++//		 (
++//		  meltrate*(1/rho_water-1/rho_ice)
++//		  +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice - pressure_water)*gap
++//		  -beta*sqrt(vx*vx+vy*vy)
++//		  +ieb
++//		  +storage*head_old/dt
++//		  )*basis[i];     
++
++		 /* With weighted creep term*/
++                 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
++                  (
++                   meltrate*(1/rho_water-1/rho_ice)
++                   +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
++                   +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
++                   -beta*sqrt(vx*vx+vy*vy)
++                   +ieb
++                   +storage*head_old/dt
++                   )*basis[i];
++
++	
++//                 /*Test with linear creep rate*/
++ //                for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
++  //                (
++   //                meltrate*(1/rho_water-1/rho_ice)
++    //               +(pressure_ice - pressure_water)*gap/pow(10,13)
++     //              -beta*sqrt(vx*vx+vy*vy)
++      //             +ieb
++       //            +storage*head_old/dt
++        //           )*basis[i];
+ 	}
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list);
+@@ -381,15 +451,15 @@
+ 	for(int i=0;i<numnodes;i++){
+ 		values[i]=solution[doflist[i]];
+ 
+-		/*make sure that p_water<p_ice ->  h<rho_i H/rho_w + zb*/
+-		if(values[i]>rho_ice*thickness[i]/rho_water+bed[i]){
+-			values[i] = rho_ice*thickness[i]/rho_water+bed[i];
+-		}
++		/*overburden cap: make sure that p_water<p_ice ->  h<rho_i H/rho_w + zb*/
++//		if(values[i]>rho_ice*thickness[i]/rho_water+bed[i]){
++//			values[i] = rho_ice*thickness[i]/rho_water+bed[i];
++//		}
+ 
+ 		/*Make sure that negative pressure is not allowed*/
+-  //    if(values[i]<bed[i]){
+-	//		values[i] = bed[i];
+-	//	}
++//      if(values[i]<bed[i]){
++//			values[i] = bed[i];
++//		}
+ 
+ 		/*Under-relaxation*/
+ 	   values[i] = head_old[i] - relaxation*(head_old[i]-values[i]);
+@@ -471,7 +541,7 @@
+ 	IssmDouble newgap = 0.;
+ 	IssmDouble  Jdet,meltrate,G,dh[2],B,A,n,dt;
+ 	IssmDouble  gap,bed,thickness,head;
+-	IssmDouble  lr,br,vx,vy,beta;
++	IssmDouble  lr,br,vx,vy,beta,lc;
+ 	IssmDouble  alpha2,frictionheat;
+ 	IssmDouble* xyz_list = NULL;
+    IssmDouble  dpressure_water[2],dbed[2],PMPheat;
+@@ -531,6 +601,14 @@
+ 		else
+ 		 beta = 0.;
+ 
++		/* TEST Compute lc term*/
++//		if(gap<br)
++//		 lc = gap*(1-(br-gap)/br);
++//		else
++		 lc = gap;
++//               lc=gap*tanh(pow(gap,3)/pow(br,3)); 
++//		lc = pow(gap,2)/lr;
++
+ 		/*Compute frictional heat flux*/
+ 		friction->GetAlpha2(&alpha2,gauss);
+ 		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+@@ -554,6 +632,22 @@
+ 					-A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*gap
+ 					+beta*sqrt(vx*vx+vy*vy)
+ 					));
++
++		/* TEST with gap height "diffusivity" for melting walls - not yet completed*/
++//                newgap += gauss->weight*Jdet*(gap+dt*(
++//                                         meltrate/rho_ice
++//                                         -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
++//                                         +beta*sqrt(vx*vx+vy*vy)
++//					 +(meltrate*gap/rho_ice*(dgapxx+dgapyy))
++//                                         ));
++
++
++                 /*TEST with linear creep rate*/
++//                 newgap += gauss->weight*Jdet*(gap+dt*(
++ //                                        meltrate/rho_ice
++  //                                       -(pressure_ice-pressure_water)*gap/pow(10,13)
++   //                                      +beta*sqrt(vx*vx+vy*vy)
++    //                                     ));
+ 		totalweights +=gauss->weight*Jdet;
+ 
+ 		/* Compute basal water flux */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26490-26491.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26490-26491.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26490-26491.diff	(revision 26740)
@@ -0,0 +1,130 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26490)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26491)
+@@ -271,7 +271,8 @@
+ 	IssmDouble  alpha2,frictionheat;
+    IssmDouble  PMPheat,dpressure_water[2],dbed[2];	
+ 	IssmDouble* xyz_list = NULL;
+-        IssmDouble dgap[2]; /***/
++        IssmDouble dgapxx; /***/
++	IssmDouble dgapyy; /***/
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+@@ -297,8 +298,8 @@
+ 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
+ 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
+    Input* headold_input        = element->GetInput(HydrologyHeadOldEnum);           _assert_(headold_input);
+-//	Input* dgapxx_input	    = element->GetInput(HydrologyGapXXEnum); /***/
+-//	Input* dgapyy_input	    = element->GetInput(HydrologyGapYYEnum); /***/
++	Input* dgapxx_input	    = element->GetInput(HydrologyGapHeightXXEnum); /***/
++	Input* dgapyy_input	    = element->GetInput(HydrologyGapHeightYYEnum); /***/
+ 
+ 	/*Get conductivity from inputs*/
+ 	IssmDouble conductivity = GetConductivity(element);
+@@ -328,6 +329,8 @@
+ 		lr_input->GetInputValue(&lr,gauss);
+ 		br_input->GetInputValue(&br,gauss);
+                 headold_input->GetInputValue(&head_old,gauss);
++		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
++		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
+ 
+ 		/*Get ice A parameter*/
+ 		B_input->GetInputValue(&B,gauss);
+@@ -381,16 +384,28 @@
+ //		  )*basis[i];     
+ 
+ 		 /* With weighted creep term*/
+-                 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+-                  (
+-                   meltrate*(1/rho_water-1/rho_ice)
+-                   +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
+-                   +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
+-                   -beta*sqrt(vx*vx+vy*vy)
+-                   +ieb
+-                   +storage*head_old/dt
+-                   )*basis[i];
++//                 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
++ //                 (
++  //                 meltrate*(1/rho_water-1/rho_ice)
++   //                +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
++    //               +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
++     //              -beta*sqrt(vx*vx+vy*vy)
++      //             +ieb
++       //            +storage*head_old/dt
++        //           )*basis[i];
+ 
++                 /* With weighted creep term*/
++                  for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
++                   (
++                    meltrate*(1/rho_water-1/rho_ice)
++                    +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
++                    +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
++                    -beta*sqrt(vx*vx+vy*vy)
++                    +ieb
++                    +storage*head_old/dt
++		    +meltrate*gap/rho_ice*(dgapxx+dgapyy)
++                    )*basis[i];
++
+ 	
+ //                 /*Test with linear creep rate*/
+  //                for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+@@ -547,6 +562,8 @@
+    IssmDouble  dpressure_water[2],dbed[2],PMPheat;
+ 	IssmDouble q = 0.;
+    IssmDouble channelization = 0.;
++	IssmDouble dgapxx; /***/
++	IssmDouble dgapyy; /***/
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+@@ -564,6 +581,8 @@
+ 	Input* n_input              = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+ 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
+ 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
++        Input* dgapxx_input         = element->GetInput(HydrologyGapHeightXXEnum); /***/
++        Input* dgapyy_input         = element->GetInput(HydrologyGapHeightYYEnum); /***/
+ 
+ 	/*Get conductivity from inputs*/
+ 	IssmDouble conductivity = GetConductivity(element);
+@@ -589,6 +608,8 @@
+ 		head_input->GetInputDerivativeValue(&dh[0],xyz_list,gauss);
+ 		lr_input->GetInputValue(&lr,gauss);
+ 		br_input->GetInputValue(&br,gauss);
++		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
++		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
+ 
+ 		/*Get ice A parameter*/
+ 		B_input->GetInputValue(&B,gauss);
+@@ -627,19 +648,19 @@
+ 		meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1])-PMPheat);
+ 		_assert_(meltrate>0.);
+ 
+-		newgap += gauss->weight*Jdet*(gap+dt*(
+-					meltrate/rho_ice
+-					-A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*gap
+-					+beta*sqrt(vx*vx+vy*vy)
+-					));
++//		newgap += gauss->weight*Jdet*(gap+dt*(
++//					meltrate/rho_ice
++//					-A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*gap
++//					+beta*sqrt(vx*vx+vy*vy)
++//					));
+ 
+ 		/* TEST with gap height "diffusivity" for melting walls - not yet completed*/
+-//                newgap += gauss->weight*Jdet*(gap+dt*(
+-//                                         meltrate/rho_ice
+-//                                         -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
+-//                                         +beta*sqrt(vx*vx+vy*vy)
+-//					 +(meltrate*gap/rho_ice*(dgapxx+dgapyy))
+-//                                         ));
++                newgap += gauss->weight*Jdet*(gap+dt*(
++                                         meltrate/rho_ice
++                                         -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
++                                         +beta*sqrt(vx*vx+vy*vy)
++					 +(meltrate*gap/rho_ice*(dgapxx+dgapyy))
++                                         ));
+ 
+ 
+                  /*TEST with linear creep rate*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26491-26492.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26491-26492.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26491-26492.diff	(revision 26740)
@@ -0,0 +1,148 @@
+Index: ../trunk-jpl/src/jl/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/plotmodel.jl	(revision 26491)
++++ ../trunk-jpl/src/jl/plotmodel.jl	(revision 26492)
+@@ -27,7 +27,7 @@
+ 			fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+ 
+ 			#Add colorbar
+-			Colorbar(fig[1, 2], h, width=25)
++			#Colorbar(fig[1, 2], h, width=25)
+ 		else
+ 			error("data of size "*string(length(data))*" not supported yet!")
+ 		end
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26491)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26492)
+@@ -12,6 +12,19 @@
+ function Mesh2dTriangle() #{{{
+ 	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int32}(undef, 0, 0))
+ end# }}}
++function Base.show(io::IO, this::Mesh2dTriangle)# {{{
++
++	println(io,typeof(this),":")
++	for name in fieldnames(typeof(this))
++		a=getfield(this,name)
++		print(io,"   $(name) = ")
++		if !isempty(a)
++			println(io, typeof(a), " of size ", size(a))
++		else
++			println(io,"empty")
++		end
++	end
++end# }}}
+ mutable struct Mesh3dPrism{T} <: AbstractMesh
+ 	numberofvertices::Int32
+ 	numberofelements::Int32
+@@ -40,14 +53,44 @@
+ function Mask() #{{{
+ 	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+ end# }}}
++mutable struct Initialization
++	vx::Vector{Float64}
++	vy::Vector{Float64}
++end
++function Initialization() #{{{
++	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++mutable struct Materials
++	rho_ice::Float64
++	rho_water::Float64
++	rho_freshwater::Float64
++	mu_water::Float64
++	heatcapacity::Float64
++	latentheat::Float64
++	thermalconductivity::Float64
++	temperateiceconductivity::Float64
++	effectiveconductivity_averaging::Int32
++	meltingpoint::Float64
++	beta::Float64
++	mixed_layer_capacity::Float64
++	thermal_exchange_velocity::Float64
++	rheology_B::Vector{Float64}
++	rheology_n::Vector{Float64}
++	rheology_law::String
++end
++function Materials() #{{{
++	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
++end# }}}
+ 
+ mutable struct model
+ 	mesh::AbstractMesh
+ 	geometry::Geometry
+ 	mask::Mask
++	materials::Materials
++	initialization::Initialization
+ end
+ function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask())
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization())
+ end#}}}
+ function Base.show(io::IO, md::model)# {{{
+ 
+@@ -57,12 +100,58 @@
+ 	@printf "%19s: %-22s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
+ 	@printf "%19s: %-22s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
+ 	@printf "%19s: %-22s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
++	@printf "%19s: %-22s -- %s\n" "materials" typeof(md.materials) "material properties"
++	@printf "%19s: %-22s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+ 
+ end# }}}
+ 
+-# Probably actually want something more like:
+-# function solve(mesh::AbstractMesh, data::AbstractDataset)
+-#     do_something_with_mesh(mesh) # This will dispatch
+-#     do_something_with_data(data) # This will dispatch
+-#     # do something
+-# end
++#utils
++function issmdir() #{{{
++	issmdir = ENV["ISSM_DIR"]
++
++	if isempty(issmdir)
++		error("Could not determine the location of ISSM")
++	else
++		return issmdir
++	end
++end#}}}
++function archread(filename::String,variablename::String) #{{{
++
++	#initialize variables
++	found = false
++
++	#open file
++	output = open(filename, "r") do f
++
++		while !eof(f)
++			reclen  = bswap(read(f, Int32))
++			rectype = bswap(read(f, Int32))
++			if rectype!=1
++				error("Expected variable of type string")
++			else
++				fieldname_length = bswap(read(f, Int32))
++				field_name = String(read(f, fieldname_length))
++			end
++			rec_length = bswap(read(f, Int32))
++			field_type = bswap(read(f, Int32))
++			if field_type==2
++				data = bswap(read(f, Float64))
++			elseif field_type==3
++				rows = bswap(read(f, Int32))
++				cols = bswap(read(f, Int32))
++				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
++				data .= ntoh.(data)
++				data = reshape(data, (rows,cols))
++			else
++				error("Error: Encountered invalid field type when reading data.")
++			end
++
++			if field_name == variablename
++				found = true
++				return data
++			end
++		end
++	end
++
++	return output
++end# }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26492-26493.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26492-26493.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26492-26493.diff	(revision 26740)
@@ -0,0 +1,120 @@
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignot.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignot.m	(revision 26492)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignot.m	(revision 26493)
+@@ -45,8 +45,8 @@
+ 
+ 			md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
+ 			md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
+-			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
+-			md = checkfield(md,'fieldname','frontalforcings.thermalforcing','nan',1,'Inf',1,'timeseries',1);
++			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) % {{{
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignot.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignot.py	(revision 26492)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignot.py	(revision 26493)
+@@ -1,3 +1,5 @@
++import numpy as np
++
+ from checkfield import checkfield
+ from WriteData import WriteData
+ from fielddisplay import fielddisplay
+@@ -4,60 +6,63 @@
+ 
+ 
+ class frontalforcingsrignot(object):
+-    """
+-    FRONTAL FORCINGS Rignot class definition
++    """FRONTAL FORCINGS Rignot class definition
+ 
+-       Usage:
+-          frontalforcingsrignot = frontalforcingsrignot()
++    Usage:
++        frontalforcingsrignot = frontalforcingsrignot()
+     """
+ 
+-    def __init__(self):  # {{{
+-        self.basin = float('NaN')
+-        self.numberofbasins = 0.
+-        self.subglacial_discharge = float('NaN')
+-        self.thermalforcing = float('NaN')
++    def __init__(self, *args):  # {{{
++        self.basin_id = np.nan
++        self.num_basins = 0
++        self.subglacial_discharge = np.nan
++        self.thermalforcing = np.nan
+ 
+-    #set defaults
+-        self.setdefaultparameters()
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            error('constructor not supported')
+ 
+     #}}}
+ 
+     def __repr__(self):  # {{{
+-        string = '   Frontalforcings parameters:'
+-        string = "%s\n%s" % (string, fielddisplay(self, 'basin', 'basin ID for vertices'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'numberofbasins', 'number of basins'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m / d]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'thermalforcing', 'thermal forcing [C]'))
+-
+-        return string
++        s = '   Frontalforcings parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin ID for elements'))
++        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of basins'))
++        s += '{}\n'.format(fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m/d]'))
++        s += '{}\n'.format(fielddisplay(self, 'thermalforcing', 'thermal forcing [∘C]'))
++        return s
+     #}}}
+ 
+-    def extrude(self, md):  # {{{
++    def setdefaultparameters(self): # {{{
++        self.basin_id = np.nan
++        self.num_basins = 0
++        self.subglacial_discharge = np.nan
++        self.thermalforcing = np.nan
++
+         return self
+     #}}}
+ 
+-    def setdefaultparameters(self):  # {{{
+-
++    def extrude(self, md):  # {{{
+         return self
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        #Early return
++        # Early return
+         if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
+             return md
+ 
+-        md = checkfield(md, 'fieldname', 'frontalforcings.basin', '>', 0, 'nan', 1, 'Inf', 1)
+-        md = checkfield(md, 'fieldname', 'frontalforcings.numberofbasins', 'numel', [1])
+-        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'nan', 1, 'Inf', 1, 'timeseries', 1)
+-        md = checkfield(md, 'fieldname', 'frontalforcings.thermalforcing', 'nan', 1, 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'frontalforcings.num_basins', 'numel', [1], 'NaN', 1, 'Inf', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'frontalforcings.basin_id', 'Inf', 1, '>=', 0, '<=', md.frontalforcings.num_basins, 'size', [md.mesh.numberofelements])
++        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'frontalforcings.thermalforcing', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+         return md
+     # }}}
+ 
+     def marshall(self, prefix, md, fid):  # {{{
+         WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 2, 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'basin', 'format', 'DoubleMat', 'mattype', 1)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofbasins', 'format', 'Integer')
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1)
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'thermalforcing', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1)
+-
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'basin_id', 'data', self.basin_id, 'name', 'md.frontalforcings.basin_id', 'format', 'IntMat', 'mattype', 2) # 0-indexed
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'num_basins', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'thermalforcing', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+     # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26493-26494.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26493-26494.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26493-26494.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive350.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26494-26495.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26494-26495.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26494-26495.diff	(revision 26740)
@@ -0,0 +1,1289 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26494)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26495)
+@@ -92,10 +92,13 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.meltingrate",CalvingMeltingrateEnum);
+ 			break;
+ 		case FrontalForcingsRignotEnum:
+-			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.basin_id",FrontalForcingsBasinIdEnum);
+-			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
+-			iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
+-			break;
++         /*Retrieve thermal forcing only in the case of non-autoregressive FrontalForcingsRignot*/
++         iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
++         /* Do not break here, still retrieve basin_ID,subglacial_discharge, etc.*/
++      case FrontalForcingsRignotAutoregressionEnum:
++         iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.basin_id",FrontalForcingsBasinIdEnum);
++         iomodel->FetchDataToInput(inputs,elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
++         break;	
+ 		default:
+ 			_error_("Frontal forcings"<<EnumToStringx(melt_parameterization)<<" not supported yet");
+ 	}
+@@ -136,9 +139,30 @@
+ 	/*Get frontal melt parameters*/
+ 	int melt_parameterization;
+ 	iomodel->FindConstant(&melt_parameterization,"md.frontalforcings.parameterization");
++	int M,N;
++	IssmDouble* transparam = NULL;
+ 	switch(melt_parameterization){
+ 		case FrontalForcingsDefaultEnum:
+ 			break;
++		case FrontalForcingsRignotAutoregressionEnum:
++			/*Retrieve autoregressive parameters*/
++			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.randomflag",FrontalForcingsRandomflagEnum));
++         parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_order",FrontalForcingsAutoregressiveOrderEnum));
++         parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_initialtime",FrontalForcingsAutoregressionInitialTimeEnum));
++         parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_timestep",FrontalForcingsAutoregressionTimestepEnum));
++			iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.beta0");
++         parameters->AddObject(new DoubleVecParam(FrontalForcingsBeta0Enum,transparam,N));
++         xDelete<IssmDouble>(transparam);
++         iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.beta1");
++         parameters->AddObject(new DoubleVecParam(FrontalForcingsBeta1Enum,transparam,N));
++         xDelete<IssmDouble>(transparam);
++         iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.phi");
++         parameters->AddObject(new DoubleMatParam(FrontalForcingsPhiEnum,transparam,M,N));
++         xDelete<IssmDouble>(transparam);
++         iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.covmat");
++         parameters->AddObject(new DoubleMatParam(FrontalForcingsCovmatEnum,transparam,M,N));
++         xDelete<IssmDouble>(transparam);
++			/*Do not break here, generic FrontalForcingsRignot parameters still to be retrieved*/
+ 		case FrontalForcingsRignotEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.num_basins",FrontalForcingsNumberofBasinsEnum));
+ 			break;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26494)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26495)
+@@ -59,6 +59,102 @@
+ 	}
+ 	return false;
+ }/*}}}*/
++void       Element::AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin,int enum_type){/*{{{*/
++
++	const int numvertices = this->GetNumberOfVertices();
++   int         basinid;
++   IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin;  
++   IssmDouble* phi_basin   = xNew<IssmDouble>(arorder);
++   IssmDouble* varspin     = xNewZeroInit<IssmDouble>(numvertices*arorder);
++
++   /*Get Basin ID and Basin coefficients*/
++	if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
++   for(int i=0;i<arorder;i++) phi_basin[i] = phi[basinid*arorder+i];
++   beta0_basin   = beta0[basinid];
++   beta1_basin   = beta1[basinid];
++
++   /*Loop over number of spin-up steps for all vertices*/   
++   for(int j=0;j<nspin;j++){  
++      tspin = starttime-((nspin-j)*tstep_ar); 
++      noisespin_basin = noisespin[j*numbasins+basinid];
++      IssmDouble* oldvarspin = xNew<IssmDouble>(numvertices*arorder);
++      for(int i=0;i<numvertices*arorder;i++) oldvarspin[i]=varspin[i];
++
++      for(int v=0;v<numvertices;v++){
++         IssmDouble autoregressionterm = 0.;
++         for(int i=0;i<arorder;i++) autoregressionterm += phi_basin[i]*varspin[v+i*numvertices];
++         varspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm+noisespin_basin;
++      }
++
++      /*Adjustt older values in varspin*/
++      for(int i=0;i<(arorder-1)*numvertices;i++) varspin[i+numvertices]=oldvarspin[i]; 
++
++      xDelete<IssmDouble>(oldvarspin); 
++   }
++	if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,varspin,numvertices*arorder);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,varspin,numvertices*arorder);
++
++ 
++   /*Cleanup and return*/
++   xDelete<IssmDouble>(varspin); 
++   xDelete<IssmDouble>(phi_basin);
++}/*}}}*/
++void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type){/*{{{*/
++   
++   const int numvertices = this->GetNumberOfVertices();
++   int         basinid,M,N;
++   IssmDouble  beta0_basin,beta1_basin,noise_basin;  
++   IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
++   IssmDouble* varlist     = xNew<IssmDouble>(numvertices);
++   IssmDouble* valuesautoregression = NULL;
++
++   /*Get Basin ID and Basin coefficients*/
++   if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
++   for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii]; 
++   beta0_basin   = beta0[basinid];
++   beta1_basin   = beta1[basinid];
++   noise_basin   = noiseterms[basinid];
++   if(enum_type==SMBautoregressionEnum)                   this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->GetArray(ThermalforcingValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
++
++   /*If not AR model timestep: take the old values of variable*/
++   if(isstepforar==false){
++      for(int i=0;i<numvertices;i++) varlist[i]=valuesautoregression[i];
++   }
++   /*If AR model timestep: compute variable values on vertices from AR*/
++   else{
++      for(int v=0;v<numvertices;v++){
++
++         /*Compute autoregressive term*/
++         IssmDouble autoregressionterm=0.;
++         for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*valuesautoregression[v+ii*numvertices];
++
++         /*Stochastic variable value*/
++         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin;
++      }
++      /*Update autoregression TF values*/
++      IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
++      /*Assign newest values and shift older values*/
++      for(int i=0;i<numvertices;i++) temparray[i] = varlist[i]; 
++      for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = valuesautoregression[i];
++      if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); 
++      if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); 
++      xDelete<IssmDouble>(temparray);
++   }
++   
++	//if(this->lid==55){_printf_("varlist: "<<varlist[0]<<"  "<<varlist[1]<<"  "<<varlist[2]<<"  "<<"noise_basin: "<<noise_basin<<"  "<<'\n');}
++
++	/*Add input to element*/
++   if(enum_type==SMBautoregressionEnum)                   this->AddInput(SmbMassBalanceEnum,varlist,P1Enum);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->AddInput(FrontalForcingsThermalForcingEnum,varlist,P1Enum);
++
++   /*Cleanup*/
++   xDelete<IssmDouble>(phi_basin);
++   xDelete<IssmDouble>(varlist);
++   xDelete<IssmDouble>(valuesautoregression);
++}/*}}}*/
+ void       Element::ComputeLambdaS(){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -3657,93 +3753,6 @@
+ 
+ }
+ /*}}}*/
+-void       Element::SmbautoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin){/*{{{*/
+-
+-	const int numvertices = this->GetNumberOfVertices();
+-	int         basinid;
+-	IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin;  
+-	IssmDouble* phi_basin   = xNew<IssmDouble>(arorder);
+-   IssmDouble* smbspin     = xNewZeroInit<IssmDouble>(numvertices*arorder);
+-
+-	/*Get Basin ID and Basin coefficients*/
+-	this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-	for(int i=0;i<arorder;i++) phi_basin[i] = phi[basinid*arorder+i];
+-	beta0_basin   = beta0[basinid];
+-	beta1_basin   = beta1[basinid];
+-
+-	/*Loop over number of spin-up steps for all vertices*/	
+-	for(int j=0;j<nspin;j++){	
+-		tspin = starttime-((nspin-j)*tstep_ar); 
+-      noisespin_basin = noisespin[j*numbasins+basinid];
+-      IssmDouble* oldsmbspin = xNew<IssmDouble>(numvertices*arorder);
+-      for(int i=0;i<numvertices*arorder;i++) oldsmbspin[i]=smbspin[i]; 
+-
+-      for(int v=0;v<numvertices;v++){
+-         IssmDouble autoregressionterm = 0.;
+-         for(int i=0;i<arorder;i++) autoregressionterm += phi_basin[i]*smbspin[v+i*numvertices];
+-         smbspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm+noisespin_basin; //compute newest values in smbspin
+-      }
+-
+-		/*Correct older values in smbspin*/
+-      for(int i=0;i<(arorder-1)*numvertices;i++) smbspin[i+numvertices]=oldsmbspin[i]; 
+-
+-      xDelete<IssmDouble>(oldsmbspin); 
+-	}
+-	this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,smbspin,numvertices*arorder);
+-
+-	/*Cleanup and return*/
+-   xDelete<IssmDouble>(smbspin); 
+-   xDelete<IssmDouble>(phi_basin);
+-}/*}}}*/
+-void       Element::Smbautoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms){/*{{{*/
+-	
+-	const int numvertices = this->GetNumberOfVertices();
+-	int         basinid,M,N;
+-	IssmDouble  beta0_basin,beta1_basin,noise_basin;  
+-	IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
+-   IssmDouble* smblist    = xNew<IssmDouble>(numvertices);
+-	IssmDouble* smbvaluesautoregression = NULL;
+-
+-	/*Get Basin ID and Basin coefficients*/
+-	this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-	for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii]; 
+-	beta0_basin   = beta0[basinid];
+-	beta1_basin   = beta1[basinid];
+-	noise_basin   = noiseterms[basinid]; 
+-	this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&smbvaluesautoregression,&M);
+-
+-	/*If not AR model timestep: take the old SMB values*/
+-	if(isstepforar==false){
+-		/*VV do something with the lapse rate here if needed (12Oct2021)*/
+-      for(int i=0;i<numvertices;i++) smblist[i]=smbvaluesautoregression[i]; 
+-	}
+-	/*If AR model timestep: compute SMB values on vertices from AR*/
+-	else{
+-		for(int v=0;v<numvertices;v++){
+-
+-			/*Compute autoregressive term*/
+-			IssmDouble autoregressionterm=0.;
+-			for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*smbvaluesautoregression[v+ii*numvertices];
+-
+-			/*Stochastic SMB value*/
+-			smblist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin;
+-		}
+-		/*Update autoregression smb values*/
+-		IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+-		/*Assign newest values and shift older values*/
+-		for(int i=0;i<numvertices;i++) temparray[i] = smblist[i]; 
+-		for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = smbvaluesautoregression[i];
+-		this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); 
+-		xDelete<IssmDouble>(temparray);
+-	}
+-	/*Add input to element*/
+-	this->AddInput(SmbMassBalanceEnum,smblist,P1Enum);
+-
+-	/*Cleanup*/
+-	xDelete<IssmDouble>(phi_basin);
+-	xDelete<IssmDouble>(smblist);
+-	xDelete<IssmDouble>(smbvaluesautoregression);
+-}/*}}}*/
+ void       Element::SmbGemb(IssmDouble timeinputs, int count){/*{{{*/
+ 
+ 	/*only compute SMB at the surface: */
+Index: ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26494)
++++ ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26495)
+@@ -5,8 +5,9 @@
+ #include "./FrontalForcingsx.h"
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
++#include "../../shared/Random/random.h"
+ 
+-void FrontalForcingsx(FemModel* femmodel){
++void FrontalForcingsx(FemModel* femmodel){/*{{{*/
+ 
+ 	/*Recover melt_parameterization*/
+ 	int melt_parameterization;
+@@ -16,6 +17,9 @@
+ 	switch(melt_parameterization){
+ 		case FrontalForcingsDefaultEnum:
+ 			break;
++		case FrontalForcingsRignotAutoregressionEnum:
++			Thermalforcingautoregressionx(femmodel);
++			/*Do not break here, call IcefrontAreax(),RignotMeltParameterizationx()*/
+ 		case FrontalForcingsRignotEnum:
+ 			femmodel->IcefrontAreax();
+ 			femmodel->RignotMeltParameterizationx();
+@@ -23,4 +27,125 @@
+ 		default:
+ 			_error_("Frontal forcings "<<EnumToStringx(melt_parameterization)<<" not supported yet");
+ 	}
+-}
++}/*}}}*/
++void ThermalforcingautoregressionInitx(FemModel* femmodel){/*{{{*/
++
++   /*Initialization step of Thermalforcingautoregressionx*/
++   int M,N,Nphi,arorder,numbasins,my_rank;
++   IssmDouble starttime,tstep_ar,tinit_ar;
++   femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
++   femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
++   IssmDouble* beta0    = NULL;
++   IssmDouble* beta1    = NULL;
++   IssmDouble* phi      = NULL;
++   IssmDouble* covmat   = NULL;
++   femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
++   femmodel->parameters->FindParam(&tstep_ar,FrontalForcingsAutoregressionTimestepEnum);
++   femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
++   femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
++   femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
++   femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
++   femmodel->parameters->FindParam(&covmat,&M,&N,FrontalForcingsCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
++
++   /*AR model spin-up*/
++   int nspin{2*arorder+5};
++   IssmDouble* noisespin = xNewZeroInit<IssmDouble>(numbasins*nspin);
++   my_rank=IssmComm::GetRank();
++   if(my_rank==0){
++      bool randomflag{};
++      femmodel->parameters->FindParam(&randomflag,FrontalForcingsRandomflagEnum);
++      int fixedseed;
++      for(int i=0;i<nspin;i++){
++         IssmDouble* temparray = NULL;
++         /*Determine whether random seed is fixed to for loop step (randomflag==false) or random seed truly random (randomflag==true)*/
++         if(randomflag) fixedseed=-1;
++         else fixedseed = i;
++         multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
++         for(int j=0;j<numbasins;j++){noisespin[i*numbasins+j]=temparray[j];}
++         xDelete<IssmDouble>(temparray);
++      }
++   }
++   ISSM_MPI_Bcast(noisespin,numbasins*nspin,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++
++   /*Initialize ThermalforcingValuesAutoregressionEnum*/
++   for(Object* &object:femmodel->elements->objects){
++      Element* element      = xDynamicCast<Element*>(object); //generate element object
++      element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,noisespin,FrontalForcingsRignotAutoregressionEnum);
++   }
++
++   /*Cleanup*/
++   xDelete<IssmDouble>(beta0);
++   xDelete<IssmDouble>(beta1);
++   xDelete<IssmDouble>(phi);
++   xDelete<IssmDouble>(noisespin);
++   xDelete<IssmDouble>(covmat);
++}/*}}}*/
++void Thermalforcingautoregressionx(FemModel* femmodel){/*{{{*/
++
++   /*Get time parameters*/
++   IssmDouble time,dt,starttime,tstep_ar;
++   femmodel->parameters->FindParam(&time,TimeEnum);
++   femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++   femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
++   femmodel->parameters->FindParam(&tstep_ar,FrontalForcingsAutoregressionTimestepEnum);
++
++   /*Initialize module at first time step*/
++   if(time<=starttime+dt){ThermalforcingautoregressionInitx(femmodel);}
++   /*Determine if this is a time step for the AR model*/
++   bool isstepforar = false;
++
++   #ifndef _HAVE_AD_
++   if((fmod(time,tstep_ar)<fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt) isstepforar = true;
++   #else
++   _error_("not implemented yet");
++   #endif
++
++   /*Load parameters*/
++   int M,N,Nphi,arorder,numbasins,my_rank;
++   femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
++   femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
++   IssmDouble tinit_ar;
++   IssmDouble* beta0      = NULL;
++   IssmDouble* beta1      = NULL;
++   IssmDouble* phi        = NULL;
++   IssmDouble* covmat     = NULL;
++   IssmDouble* noiseterms = xNew<IssmDouble>(numbasins);
++   femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
++   femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
++   femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
++   femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
++   femmodel->parameters->FindParam(&covmat,&M,&N,FrontalForcingsCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
++
++   /*Time elapsed with respect to AR model initial time*/
++   IssmDouble telapsed_ar = time-tinit_ar;
++
++   /*Before looping through elements: compute noise term specific to each basin from covmat*/
++   my_rank=IssmComm::GetRank();
++   if(my_rank==0){
++      bool randomflag{};
++      femmodel->parameters->FindParam(&randomflag,FrontalForcingsRandomflagEnum);
++      /*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
++      int fixedseed;
++      if(randomflag) fixedseed=-1;
++      else fixedseed = reCast<int,IssmDouble>((time-starttime)/dt);
++		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
++      IssmDouble* temparray = NULL;
++      multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
++      for(int i=0;i<numbasins;i++) noiseterms[i]=temparray[i];
++      xDelete<IssmDouble>(temparray);
++   }
++   ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++
++   /*Loop over each element to compute SMB at vertices*/
++   for(Object* &object:femmodel->elements->objects){
++      Element* element = xDynamicCast<Element*>(object);
++      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,FrontalForcingsRignotAutoregressionEnum);
++   }
++
++   /*Cleanup*/
++   xDelete<IssmDouble>(beta0);
++   xDelete<IssmDouble>(beta1);
++   xDelete<IssmDouble>(phi);
++   xDelete<IssmDouble>(noiseterms);
++   xDelete<IssmDouble>(covmat);
++}/*}}}*/
+Index: ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.h	(revision 26494)
++++ ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.h	(revision 26495)
+@@ -6,5 +6,7 @@
+ 
+ /* local prototypes: */
+ void FrontalForcingsx(FemModel* femmodel);
++void ThermalforcingautoregressionInitx(FemModel* femmodel);
++void Thermalforcingautoregressionx(FemModel* femmodel);
+ 
+ #endif
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26494)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26495)
+@@ -153,10 +153,10 @@
+ 	IssmDouble starttime,tstep_ar,tinit_ar;
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+ 	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+-	IssmDouble* beta0    = xNew<IssmDouble>(numbasins);
+-	IssmDouble* beta1    = xNew<IssmDouble>(numbasins);
+-	IssmDouble* phi      = xNew<IssmDouble>(numbasins*arorder);
+-	IssmDouble* covmat   = xNew<IssmDouble>(numbasins*numbasins);
++	IssmDouble* beta0    = NULL; 
++	IssmDouble* beta1    = NULL;
++	IssmDouble* phi      = NULL;
++	IssmDouble* covmat   = NULL;
+ 	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+    femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
+ 	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+@@ -174,7 +174,8 @@
+ 		femmodel->parameters->FindParam(&randomflag,SmbRandomflagEnum);
+ 		int fixedseed;
+ 		for(int i=0;i<nspin;i++){
+-			IssmDouble* temparray = xNew<IssmDouble>(numbasins);
++			//IssmDouble* temparray = xNew<IssmDouble>(numbasins);
++			IssmDouble* temparray = NULL;
+ 			/*Determine whether random seed is fixed to for loop step (randomflag==false) or random seed truly random (randomflag==true)*/
+ 			if(randomflag) fixedseed=-1;
+ 			else fixedseed = i;
+@@ -188,7 +189,7 @@
+ 	/*Initialize SmbValuesAutoregressionEnum*/
+ 	for(Object* &object:femmodel->elements->objects){
+       Element* element      = xDynamicCast<Element*>(object); //generate element object
+-		element->SmbautoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,noisespin);
++		element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,noisespin,SMBautoregressionEnum);
+ 	}
+ 	
+ 	/*Cleanup*/
+@@ -223,11 +224,11 @@
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+ 	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+ 	IssmDouble tinit_ar;
+-	IssmDouble* beta0      = xNew<IssmDouble>(numbasins);
+-	IssmDouble* beta1      = xNew<IssmDouble>(numbasins);
+-	IssmDouble* phi        = xNew<IssmDouble>(numbasins*arorder);
++	IssmDouble* beta0      = NULL; 
++	IssmDouble* beta1      = NULL;
++	IssmDouble* phi        = NULL;
++	IssmDouble* covmat     = NULL;
+ 	IssmDouble* noiseterms = xNew<IssmDouble>(numbasins);
+-	IssmDouble* covmat     = xNew<IssmDouble>(numbasins*numbasins);
+ 	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+ 	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+@@ -246,7 +247,11 @@
+ 		int fixedseed;
+ 		if(randomflag) fixedseed=-1;
+ 		else fixedseed =  reCast<int,IssmDouble>((time-starttime)/dt);
+-		multivariateNormal(&noiseterms,numbasins,0.0,covmat,fixedseed);
++		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/	
++		IssmDouble* temparray = NULL;
++		multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
++		for(int i=0;i<numbasins;i++) noiseterms[i]=temparray[i];
++		xDelete<IssmDouble>(temparray);
+ 	}
+ 	ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+ 
+@@ -253,7 +258,7 @@
+ 	/*Loop over each element to compute SMB at vertices*/
+ 	for(Object* &object:femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->Smbautoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms);
++		element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,SMBautoregressionEnum);
+ 	}
+ 
+ 	/*Cleanup*/
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26494)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26495)
+@@ -176,8 +176,16 @@
+ syn keyword cConstant FrictionThresholdSpeedEnum
+ syn keyword cConstant FrictionVoidRatioEnum
+ syn keyword cConstant FrontalForcingsBasinIcefrontAreaEnum
++syn keyword cConstant FrontalForcingsAutoregressionInitialTimeEnum
++syn keyword cConstant FrontalForcingsAutoregressionTimestepEnum
++syn keyword cConstant FrontalForcingsAutoregressiveOrderEnum
++syn keyword cConstant FrontalForcingsBeta0Enum
++syn keyword cConstant FrontalForcingsBeta1Enum
++syn keyword cConstant FrontalForcingsCovmatEnum
+ syn keyword cConstant FrontalForcingsNumberofBasinsEnum
+ syn keyword cConstant FrontalForcingsParamEnum
++syn keyword cConstant FrontalForcingsPhiEnum
++syn keyword cConstant FrontalForcingsRandomflagEnum
+ syn keyword cConstant GrdModelEnum
+ syn keyword cConstant GroundinglineFrictionInterpolationEnum
+ syn keyword cConstant GroundinglineMeltInterpolationEnum
+@@ -1015,6 +1023,7 @@
+ syn keyword cConstant TemperaturePDDEnum
+ syn keyword cConstant TemperaturePicardEnum
+ syn keyword cConstant TemperatureSEMICEnum
++syn keyword cConstant ThermalforcingValuesAutoregressionEnum
+ syn keyword cConstant ThermalSpctemperatureEnum
+ syn keyword cConstant ThicknessAbsGradientEnum
+ syn keyword cConstant ThicknessAbsMisfitEnum
+@@ -1261,6 +1270,7 @@
+ syn keyword cConstant FreeSurfaceTopAnalysisEnum
+ syn keyword cConstant FrontalForcingsDefaultEnum
+ syn keyword cConstant FrontalForcingsRignotEnum
++syn keyword cConstant FrontalForcingsRignotAutoregressionEnum
+ syn keyword cConstant FsetEnum
+ syn keyword cConstant FullMeltOnPartiallyFloatingEnum
+ syn keyword cConstant GLheightadvectionAnalysisEnum
+@@ -1552,6 +1562,7 @@
+ syn keyword cType Cfsurfacelogvel
+ syn keyword cType Cfsurfacesquare
+ syn keyword cType Channel
++syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+@@ -1558,8 +1569,8 @@
+ syn keyword cType Contours
+ syn keyword cType ControlInput
+ syn keyword cType Covertree
++syn keyword cType DatasetInput
+ syn keyword cType DataSetParam
+-syn keyword cType DatasetInput
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DoubleInput
+@@ -1572,8 +1583,8 @@
+ syn keyword cType ElementHook
+ syn keyword cType ElementInput
+ syn keyword cType ElementMatrix
++syn keyword cType Elements
+ syn keyword cType ElementVector
+-syn keyword cType Elements
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+@@ -1580,11 +1591,12 @@
+ 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 GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -1600,6 +1612,7 @@
+ 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
+@@ -1610,6 +1623,7 @@
+ syn keyword cType Matestar
+ syn keyword cType Matice
+ syn keyword cType Matlitho
++syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Moulin
+@@ -1622,8 +1636,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType Options
+ syn keyword cType OptionUtilities
+-syn keyword cType Options
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -1637,13 +1651,13 @@
+ syn keyword cType Radar
+ syn keyword cType Regionaloutput
+ syn keyword cType Results
++syn keyword cType Riftfront
+ syn keyword cType RiftStruct
+-syn keyword cType Riftfront
+ syn keyword cType SealevelGeometry
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType Segment
+ syn keyword cType SegRef
+-syn keyword cType Segment
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -1662,10 +1676,6 @@
+ 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
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26494)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26495)
+@@ -170,8 +170,16 @@
+ 	FrictionThresholdSpeedEnum,
+ 	FrictionVoidRatioEnum,
+ 	FrontalForcingsBasinIcefrontAreaEnum,
++	FrontalForcingsAutoregressionInitialTimeEnum,
++   FrontalForcingsAutoregressionTimestepEnum,
++   FrontalForcingsAutoregressiveOrderEnum,
++	FrontalForcingsBeta0Enum,
++   FrontalForcingsBeta1Enum,
++   FrontalForcingsCovmatEnum,
+ 	FrontalForcingsNumberofBasinsEnum,
+ 	FrontalForcingsParamEnum,
++   FrontalForcingsPhiEnum,
++	FrontalForcingsRandomflagEnum,
+ 	GrdModelEnum,
+ 	GroundinglineFrictionInterpolationEnum,
+ 	GroundinglineMeltInterpolationEnum,
+@@ -1012,6 +1020,7 @@
+ 	TemperaturePDDEnum,
+ 	TemperaturePicardEnum,
+ 	TemperatureSEMICEnum,
++	ThermalforcingValuesAutoregressionEnum,	
+ 	ThermalSpctemperatureEnum,
+ 	ThicknessAbsGradientEnum,
+ 	ThicknessAbsMisfitEnum,
+@@ -1260,6 +1269,7 @@
+ 	FreeSurfaceTopAnalysisEnum,
+ 	FrontalForcingsDefaultEnum,
+ 	FrontalForcingsRignotEnum,
++	FrontalForcingsRignotAutoregressionEnum,
+ 	FsetEnum,
+ 	FullMeltOnPartiallyFloatingEnum,
+ 	GLheightadvectionAnalysisEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26494)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26495)
+@@ -178,8 +178,16 @@
+ 		case FrictionThresholdSpeedEnum : return "FrictionThresholdSpeed";
+ 		case FrictionVoidRatioEnum : return "FrictionVoidRatio";
+ 		case FrontalForcingsBasinIcefrontAreaEnum : return "FrontalForcingsBasinIcefrontArea";
++		case FrontalForcingsAutoregressionInitialTimeEnum : return "FrontalForcingsAutoregressionInitialTime";
++		case FrontalForcingsAutoregressionTimestepEnum : return "FrontalForcingsAutoregressionTimestep";
++		case FrontalForcingsAutoregressiveOrderEnum : return "FrontalForcingsAutoregressiveOrder";
++		case FrontalForcingsBeta0Enum : return "FrontalForcingsBeta0";
++		case FrontalForcingsBeta1Enum : return "FrontalForcingsBeta1";
++		case FrontalForcingsCovmatEnum : return "FrontalForcingsCovmat";
+ 		case FrontalForcingsNumberofBasinsEnum : return "FrontalForcingsNumberofBasins";
+ 		case FrontalForcingsParamEnum : return "FrontalForcingsParam";
++		case FrontalForcingsPhiEnum : return "FrontalForcingsPhi";
++		case FrontalForcingsRandomflagEnum : return "FrontalForcingsRandomflag";
+ 		case GrdModelEnum : return "GrdModel";
+ 		case GroundinglineFrictionInterpolationEnum : return "GroundinglineFrictionInterpolation";
+ 		case GroundinglineMeltInterpolationEnum : return "GroundinglineMeltInterpolation";
+@@ -1017,6 +1025,7 @@
+ 		case TemperaturePDDEnum : return "TemperaturePDD";
+ 		case TemperaturePicardEnum : return "TemperaturePicard";
+ 		case TemperatureSEMICEnum : return "TemperatureSEMIC";
++		case ThermalforcingValuesAutoregressionEnum : return "ThermalforcingValuesAutoregression";
+ 		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
+ 		case ThicknessAbsGradientEnum : return "ThicknessAbsGradient";
+ 		case ThicknessAbsMisfitEnum : return "ThicknessAbsMisfit";
+@@ -1263,6 +1272,7 @@
+ 		case FreeSurfaceTopAnalysisEnum : return "FreeSurfaceTopAnalysis";
+ 		case FrontalForcingsDefaultEnum : return "FrontalForcingsDefault";
+ 		case FrontalForcingsRignotEnum : return "FrontalForcingsRignot";
++		case FrontalForcingsRignotAutoregressionEnum : return "FrontalForcingsRignotAutoregression";
+ 		case FsetEnum : return "Fset";
+ 		case FullMeltOnPartiallyFloatingEnum : return "FullMeltOnPartiallyFloating";
+ 		case GLheightadvectionAnalysisEnum : return "GLheightadvectionAnalysis";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26494)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26495)
+@@ -181,8 +181,16 @@
+ 	      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,"FrontalForcingsAutoregressionInitialTime")==0) return FrontalForcingsAutoregressionInitialTimeEnum;
++	      else if (strcmp(name,"FrontalForcingsAutoregressionTimestep")==0) return FrontalForcingsAutoregressionTimestepEnum;
++	      else if (strcmp(name,"FrontalForcingsAutoregressiveOrder")==0) return FrontalForcingsAutoregressiveOrderEnum;
++	      else if (strcmp(name,"FrontalForcingsBeta0")==0) return FrontalForcingsBeta0Enum;
++	      else if (strcmp(name,"FrontalForcingsBeta1")==0) return FrontalForcingsBeta1Enum;
++	      else if (strcmp(name,"FrontalForcingsCovmat")==0) return FrontalForcingsCovmatEnum;
+ 	      else if (strcmp(name,"FrontalForcingsNumberofBasins")==0) return FrontalForcingsNumberofBasinsEnum;
+ 	      else if (strcmp(name,"FrontalForcingsParam")==0) return FrontalForcingsParamEnum;
++	      else if (strcmp(name,"FrontalForcingsPhi")==0) return FrontalForcingsPhiEnum;
++	      else if (strcmp(name,"FrontalForcingsRandomflag")==0) return FrontalForcingsRandomflagEnum;
+ 	      else if (strcmp(name,"GrdModel")==0) return GrdModelEnum;
+ 	      else if (strcmp(name,"GroundinglineFrictionInterpolation")==0) return GroundinglineFrictionInterpolationEnum;
+ 	      else if (strcmp(name,"GroundinglineMeltInterpolation")==0) return GroundinglineMeltInterpolationEnum;
+@@ -251,7 +259,10 @@
+ 	      else if (strcmp(name,"InversionMaxsteps")==0) return InversionMaxstepsEnum;
+ 	      else if (strcmp(name,"InversionNsteps")==0) return InversionNstepsEnum;
+ 	      else if (strcmp(name,"InversionNumControlParameters")==0) return InversionNumControlParametersEnum;
+-	      else if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
++         else stage=3;
++   }
++   if(stage==3){
++	      if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
+ 	      else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
+ 	      else if (strcmp(name,"InversionType")==0) return InversionTypeEnum;
+ 	      else if (strcmp(name,"Ivins")==0) return IvinsEnum;
+@@ -259,10 +270,7 @@
+ 	      else if (strcmp(name,"LevelsetKillIcebergs")==0) return LevelsetKillIcebergsEnum;
+ 	      else if (strcmp(name,"LevelsetReinitFrequency")==0) return LevelsetReinitFrequencyEnum;
+ 	      else if (strcmp(name,"LevelsetStabilization")==0) return LevelsetStabilizationEnum;
+-         else stage=3;
+-   }
+-   if(stage==3){
+-	      if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
++	      else if (strcmp(name,"LockFileName")==0) return LockFileNameEnum;
+ 	      else if (strcmp(name,"LoveAllowLayerDeletion")==0) return LoveAllowLayerDeletionEnum;
+ 	      else if (strcmp(name,"LoveCoreMantleBoundary")==0) return LoveCoreMantleBoundaryEnum;
+ 	      else if (strcmp(name,"LoveEarthMass")==0) return LoveEarthMassEnum;
+@@ -374,7 +382,10 @@
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsViscous")==0) return SolidearthSettingsViscousEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousTimes")==0) return SealevelchangeViscousTimesEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousIndex")==0) return SealevelchangeViscousIndexEnum;
+ 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
+@@ -382,10 +393,7 @@
+ 	      else if (strcmp(name,"TidalLoveK")==0) return TidalLoveKEnum;
+ 	      else if (strcmp(name,"TidalLoveL")==0) return TidalLoveLEnum;
+ 	      else if (strcmp(name,"TidalLoveK2Secular")==0) return TidalLoveK2SecularEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"LoadLoveH")==0) return LoadLoveHEnum;
++	      else if (strcmp(name,"LoadLoveH")==0) return LoadLoveHEnum;
+ 	      else if (strcmp(name,"LoadLoveK")==0) return LoadLoveKEnum;
+ 	      else if (strcmp(name,"LoadLoveL")==0) return LoadLoveLEnum;
+ 	      else if (strcmp(name,"LoveTimeFreq")==0) return LoveTimeFreqEnum;
+@@ -497,7 +505,10 @@
+ 	      else if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum;
+ 	      else if (strcmp(name,"StressbalanceReltol")==0) return StressbalanceReltolEnum;
+ 	      else if (strcmp(name,"StressbalanceRequestedOutputs")==0) return StressbalanceRequestedOutputsEnum;
+-	      else if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
+ 	      else if (strcmp(name,"StressbalanceRiftPenaltyThreshold")==0) return StressbalanceRiftPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
+ 	      else if (strcmp(name,"ThermalIsdrainicecolumn")==0) return ThermalIsdrainicecolumnEnum;
+@@ -505,10 +516,7 @@
+ 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
+ 	      else if (strcmp(name,"ThermalMaxiter")==0) return ThermalMaxiterEnum;
+ 	      else if (strcmp(name,"ThermalNumRequestedOutputs")==0) return ThermalNumRequestedOutputsEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
++	      else if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
+ 	      else if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
+ 	      else if (strcmp(name,"ThermalPenaltyThreshold")==0) return ThermalPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"ThermalReltol")==0) return ThermalReltolEnum;
+@@ -620,7 +628,10 @@
+ 	      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,"CalvingFluxLevelset")==0) return CalvingFluxLevelsetEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      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;
+@@ -628,10 +639,7 @@
+ 	      else if (strcmp(name,"DamageDOld")==0) return DamageDOldEnum;
+ 	      else if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
+ 	      else if (strcmp(name,"DamageDbarOld")==0) return DamageDbarOldEnum;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"DamageF")==0) return DamageFEnum;
++	      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,"DeltaIceThickness")==0) return DeltaIceThicknessEnum;
+@@ -743,7 +751,10 @@
+ 	      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,"Ice")==0) return IceEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"Ice")==0) return IceEnum;
+ 	      else if (strcmp(name,"IceMaskNodeActivation")==0) return IceMaskNodeActivationEnum;
+ 	      else if (strcmp(name,"Input")==0) return InputEnum;
+ 	      else if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
+@@ -751,10 +762,7 @@
+ 	      else if (strcmp(name,"InversionThicknessObs")==0) return InversionThicknessObsEnum;
+ 	      else if (strcmp(name,"InversionVelObs")==0) return InversionVelObsEnum;
+ 	      else if (strcmp(name,"InversionVxObs")==0) return InversionVxObsEnum;
+-         else stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
++	      else if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeX")==0) return LevelsetfunctionSlopeXEnum;
+ 	      else if (strcmp(name,"LevelsetfunctionSlopeY")==0) return LevelsetfunctionSlopeYEnum;
+ 	      else if (strcmp(name,"LevelsetObservation")==0) return LevelsetObservationEnum;
+@@ -866,7 +874,10 @@
+ 	      else if (strcmp(name,"SealevelchangeGUsubelOcean")==0) return SealevelchangeGUsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelOcean")==0) return SealevelchangeGEsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelOcean")==0) return SealevelchangeGNsubelOceanEnum;
+-	      else if (strcmp(name,"SealevelchangeGsubelIce")==0) return SealevelchangeGsubelIceEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SealevelchangeGsubelIce")==0) return SealevelchangeGsubelIceEnum;
+ 	      else if (strcmp(name,"SealevelchangeGUsubelIce")==0) return SealevelchangeGUsubelIceEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelIce")==0) return SealevelchangeGEsubelIceEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelIce")==0) return SealevelchangeGNsubelIceEnum;
+@@ -874,10 +885,7 @@
+ 	      else if (strcmp(name,"SealevelchangeGUsubelHydro")==0) return SealevelchangeGUsubelHydroEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelHydro")==0) return SealevelchangeGEsubelHydroEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelHydro")==0) return SealevelchangeGNsubelHydroEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
++	      else if (strcmp(name,"SealevelchangeViscousRSL")==0) return SealevelchangeViscousRSLEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousU")==0) return SealevelchangeViscousUEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousN")==0) return SealevelchangeViscousNEnum;
+ 	      else if (strcmp(name,"SealevelchangeViscousE")==0) return SealevelchangeViscousEEnum;
+@@ -989,7 +997,10 @@
+ 	      else if (strcmp(name,"SmbTmean")==0) return SmbTmeanEnum;
+ 	      else if (strcmp(name,"SmbTz")==0) return SmbTzEnum;
+ 	      else if (strcmp(name,"SmbValuesAutoregression")==0) return SmbValuesAutoregressionEnum;
+-	      else if (strcmp(name,"SmbV")==0) return SmbVEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      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;
+@@ -997,10 +1008,7 @@
+ 	      else if (strcmp(name,"SmbWini")==0) return SmbWiniEnum;
+ 	      else if (strcmp(name,"SmbZMax")==0) return SmbZMaxEnum;
+ 	      else if (strcmp(name,"SmbZMin")==0) return SmbZMinEnum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
++	      else if (strcmp(name,"SmbZTop")==0) return SmbZTopEnum;
+ 	      else if (strcmp(name,"SmbZY")==0) return SmbZYEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementEastRate")==0) return SolidearthExternalDisplacementEastRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+@@ -1041,6 +1049,7 @@
+ 	      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,"ThermalforcingValuesAutoregression")==0) return ThermalforcingValuesAutoregressionEnum;
+ 	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
+ 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+ 	      else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum;
+@@ -1111,7 +1120,10 @@
+ 	      else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
+ 	      else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
+ 	      else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum;
+-	      else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
+ 	      else if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum;
+ 	      else if (strcmp(name,"Outputdefinition39")==0) return Outputdefinition39Enum;
+ 	      else if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
+@@ -1120,10 +1132,7 @@
+ 	      else if (strcmp(name,"Outputdefinition42")==0) return Outputdefinition42Enum;
+ 	      else if (strcmp(name,"Outputdefinition43")==0) return Outputdefinition43Enum;
+ 	      else if (strcmp(name,"Outputdefinition44")==0) return Outputdefinition44Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition45")==0) return Outputdefinition45Enum;
++	      else if (strcmp(name,"Outputdefinition45")==0) return Outputdefinition45Enum;
+ 	      else if (strcmp(name,"Outputdefinition46")==0) return Outputdefinition46Enum;
+ 	      else if (strcmp(name,"Outputdefinition47")==0) return Outputdefinition47Enum;
+ 	      else if (strcmp(name,"Outputdefinition48")==0) return Outputdefinition48Enum;
+@@ -1234,7 +1243,10 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      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;
+@@ -1243,10 +1255,7 @@
+ 	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"DamageEvolutionAnalysis")==0) return DamageEvolutionAnalysisEnum;
++	      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;
+@@ -1293,6 +1302,7 @@
+ 	      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,"FrontalForcingsRignotAutoregression")==0) return FrontalForcingsRignotAutoregressionEnum;
+ 	      else if (strcmp(name,"Fset")==0) return FsetEnum;
+ 	      else if (strcmp(name,"FullMeltOnPartiallyFloating")==0) return FullMeltOnPartiallyFloatingEnum;
+ 	      else if (strcmp(name,"GLheightadvectionAnalysis")==0) return GLheightadvectionAnalysisEnum;
+@@ -1356,7 +1366,10 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      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;
+@@ -1366,10 +1379,7 @@
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"LoveKi")==0) return LoveKiEnum;
++	      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;
+@@ -1479,7 +1489,10 @@
+ 	      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 stage=13;
++   }
++   if(stage==13){
++	      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;
+@@ -1489,10 +1502,7 @@
+ 	      else if (strcmp(name,"SealevelInertiaTensorZZ")==0) return SealevelInertiaTensorZZEnum;
+ 	      else if (strcmp(name,"SealevelchangePolarMotion")==0) return SealevelchangePolarMotionEnum;
+ 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
+-         else stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
++	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
+ 	      else if (strcmp(name,"SealevelchangeAnalysis")==0) return SealevelchangeAnalysisEnum;
+ 	      else if (strcmp(name,"Seg")==0) return SegEnum;
+ 	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26494)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 26495)
+@@ -273,6 +273,7 @@
+ 	switch(enum_in){
+ 		case 1: return FrontalForcingsDefaultEnum;
+ 		case 2: return FrontalForcingsRignotEnum;
++		case 55: return FrontalForcingsRignotAutoregressionEnum;
+ 		default: _error_("Marshalled Frontalforcings code \""<<enum_in<<"\" not supported yet");
+ 	}
+ }/*}}}*/
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m	(revision 26495)
+@@ -0,0 +1,98 @@
++%FRONTAL FORCINGS rignot autoregression class definition
++%
++%   Usage:
++%      frontalforcingsrignotautoregression=frontalforcingsrignotautoregression();
++
++classdef frontalforcingsrignotautoregression
++	properties (SetAccess=public) 
++		num_basins           = 0;
++      beta0                = NaN;
++      beta1                = NaN;
++      ar_order             = 0;
++      ar_initialtime       = 0;
++      ar_timestep          = 0;
++      phi                  = NaN;
++      covmat               = NaN;
++      basin_id             = NaN;
++      randomflag           = 1;
++		subglacial_discharge = NaN;
++	end
++	methods
++		function self = frontalforcingsrignot(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				case 1
++					inputstruct=varargin{1};
++					list1 = properties('frontalforcingsrignotautoregression');
++					list2 = fieldnames(inputstruct);
++					for i=1:length(list1)
++						fieldname = list1{i};
++						if ismember(fieldname,list2),
++							self.(fieldname) = inputstruct.(fieldname);
++						end
++					end
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = extrude(self,md) % {{{
++		    % nothing for now
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++
++			basin_id             = NaN;
++			num_basins           = 0;
++			subglacial_discharge = NaN;
++			self.ar_order        = 0.0; %autoregression model of order 0
++         self.randomflag      = 1;
++
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++			%Early return
++			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
++
++			md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
++         md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
++			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
++			md = checkfield(md,'fieldname','frontalforcings.beta0','NaN',1,'Inf',1,'size',[1,md.frontalforcings.num_basins],'numel',md.frontalforcings.num_basins); 
++         md = checkfield(md,'fieldname','frontalforcings.beta1','NaN',1,'Inf',1,'size',[1,md.frontalforcings.num_basins],'numel',md.frontalforcings.num_basins); 
++         md = checkfield(md,'fieldname','frontalforcings.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
++         md = checkfield(md,'fieldname','frontalforcings.ar_initialtime','numel',1,'NaN',1,'Inf',1);
++         md = checkfield(md,'fieldname','frontalforcings.ar_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %autoregression time step cannot be finer than ISSM timestep
++			md = checkfield(md,'fieldname','frontalforcings.phi','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.ar_order]);
++         md = checkfield(md,'fieldname','frontalforcings.covmat','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.num_basins]);
++         md = checkfield(md,'fieldname','frontalforcings.randomflag','numel',[1],'values',[0 1]);
++
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   Frontalforcings parameters:'));
++			fielddisplay(self,'num_basins','number of different basins [unitless]');
++         fielddisplay(self,'basin_id','basin number assigned to each element [unitless]');
++         fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m/d]');
++         fielddisplay(self,'beta0','basin-specific intercept values [∘C]');
++         fielddisplay(self,'beta1','basin-specific trend values [∘C yr^(-1)]');
++         fielddisplay(self,'ar_order','order of the autoregressive model [unitless]');
++         fielddisplay(self,'ar_initialtime','initial time assumed in the autoregressive model parameterization [yr]');
++         fielddisplay(self,'ar_timestep','time resolution of the autoregressive model [yr]');
++         fielddisplay(self,'phi','basin-specific vectors of lag coefficients [unitless]');
++         fielddisplay(self,'covmat','inter-basin covariance matrix for multivariate normal noise at each time step [∘C^2]');
++         fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++			yts=md.constants.yts;
++			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',55,'format','Integer');
++			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','num_basins','format','Integer');
++			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_order','format','Integer');
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_initialtime','format','Double','scale',yts);
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_timestep','format','Double','scale',yts);
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','basin_id','data',self.basin_id-1,'name','md.frontalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta0','format','DoubleMat','name','md.frontalforcings.beta0');
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta1','format','DoubleMat','name','md.frontalforcings.beta1','scale',1./yts,'yts',md.constants.yts);
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','phi','format','DoubleMat','name','md.frontalforcings.phi','yts',md.constants.yts);
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','covmat','format','DoubleMat','name','md.frontalforcings.covmat');
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','randomflag','format','Boolean');
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/test/Archives/Archive257.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive542.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive543.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive543.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(revision 26494)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26495)
+@@ -31,6 +31,22 @@
+     end
+ end
+ 
++%SMB parameters
++md.timestepping.start_time = 0;
++md.timestepping.time_step  = 1;
++md.timestepping.final_time = 5;
++md.smb                = SMBautoregression();
++md.smb.num_basins     = 3; %number of basins
++md.smb.basin_id       = idbasin; %prescribe basin ID number to elements
++md.smb.beta0          = [0.5,1.2,1.5]; %intercept values of SMB in basins [m ice eq./yr]
++md.smb.beta1          = [0.0,0.01,-0.01]; %trend values of SMB in basins [m ice eq./yr^2]
++md.smb.ar_initialtime = md.timestepping.start_time;
++md.smb.ar_order       = 4;
++md.smb.ar_timestep    = 2.0; %timestep of the autoregressive model [yr]
++md.smb.phi            = [[0.2,0.1,0.05,0.01];[0.4,0.2,-0.2,0.1];[0.4,-0.4,0.1,-0.1]];
++md.smb.covmat         = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]];
++md.smb.randomflag     = 0; %fixed random seeds
++
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test542.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test542.m	(revision 26494)
++++ ../trunk-jpl/test/NightlyRun/test542.m	(revision 26495)
+@@ -8,7 +8,7 @@
+ 
+ %separate domain in 2 basins
+ idbasin = zeros(md.mesh.numberofelements,1);
+-iid1    = find(md.mesh.y>=mean(md.mesh.y));
++iid1    = find(md.mesh.x<=-1.6e6);
+ for ii=1:md.mesh.numberofelements
+     for vertex=1:3
+         if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26495)
+@@ -0,0 +1,87 @@
++%Test Name: PigTranFrontalforcingsrignotautoregression
++md=triangle(model(),'../Exp/Pig.exp',10000.);
++md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
++md=parameterize(md,'../Par/Pig.par');
++md=setflowequation(md,'SSA','all');
++md.timestepping.start_time = 0;
++md.timestepping.time_step  = 1;
++md.timestepping.final_time = 25;
++
++%separate domain in 2 basins
++idbasin = zeros(md.mesh.numberofelements,1);
++iid1    = find(md.mesh.x<=-1.6e6);
++for ii=1:md.mesh.numberofelements
++    for vertex=1:3
++        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
++            idbasin(ii) = 1;
++        end
++    end
++    if idbasin(ii)==0 %no vertex was found in basin 1
++        idbasin(ii) = 2;
++    end
++end
++
++%calving and frontalforcings parameters
++md.mask.ice_levelset = 1e4*(md.mask.ice_levelset + 0.5);
++md.calving=calvingvonmises();
++md.frontalforcings=frontalforcingsrignotautoregression();
++md.frontalforcings.num_basins = 2;
++md.frontalforcings.basin_id = idbasin;
++md.frontalforcings.subglacial_discharge = 0.1*ones(md.mesh.numberofvertices,1);
++md.frontalforcings.beta0                = [0.05,0.01]; %intercept values of TF in basins [C]
++md.frontalforcings.beta1                = [0.001,0.0001]; %trend values of TF in basins [C/yr]
++md.frontalforcings.ar_initialtime       = md.timestepping.start_time; %initial time in the AR model parameterization [yr]
++md.frontalforcings.ar_order             = 4;
++md.frontalforcings.ar_timestep          = 2; %timestep of the autoregressive model [yr]
++md.frontalforcings.phi                  = [[0.1,-0.1,0.01,-0.01];[0.2,-0.2,0.1,0.0]]; %autoregressive parameters
++md.frontalforcings.covmat               = 1e-4*[[1.5,0.5];[0.5,0.4]];
++md.frontalforcings.randomflag           = 0;
++
++md.transient.ismovingfront = 1;
++md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 1e10;
++
++md.transient.requested_outputs = {'default','CalvingMeltingrate'};
++md.cluster=generic('name',oshostname(),'np',2);
++md=solve(md,'Transient');
++
++%Fields and tolerances to track changes
++field_names ={...
++   'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1', 'CalvingMeltingrate1',...
++   'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2', 'CalvingMeltingrate2',...
++   'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10', 'CalvingMeltingrate10',...
++   };
++field_tolerances={...
++   1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,1e-9,...
++   2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,1e-9,...
++   2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-9,...
++   };
++field_values={...
++   (md.results.TransientSolution(1).Vx),...
++   (md.results.TransientSolution(1).Vy),...
++   (md.results.TransientSolution(1).Vel),...
++   (md.results.TransientSolution(1).Pressure),...
++   (md.results.TransientSolution(1).Base),...
++   (md.results.TransientSolution(1).Surface),...
++   (md.results.TransientSolution(1).Thickness),...
++   (md.results.TransientSolution(1).CalvingMeltingrate),...
++   (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(2).CalvingMeltingrate),...
++   (md.results.TransientSolution(10).Vx),...
++   (md.results.TransientSolution(10).Vy),...
++   (md.results.TransientSolution(10).Vel),...
++   (md.results.TransientSolution(10).Pressure),...
++   (md.results.TransientSolution(10).Base),...
++   (md.results.TransientSolution(10).Surface),...
++   (md.results.TransientSolution(10).Thickness),...
++   (md.results.TransientSolution(10).MaskIceLevelset),...
++   (md.results.TransientSolution(10).CalvingMeltingrate),...
++   };
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26494)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26495)
+@@ -67,6 +67,8 @@
+ 		/*bool               AllActive(void);*/
+ 		/*bool               AnyActive(void);*/
+ 		bool               AnyFSet(void);
++		void					 AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin,int enum_type);
++      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type);
+ 		void               ComputeLambdaS(void);
+ 		void               ComputeNewDamage();
+ 		void               ComputeStrainRate();
+@@ -177,8 +179,6 @@
+ 		void               SetIntInput(Inputs* inputs,int enum_in,int value);
+ 		void               SmbSemic();
+ 		int                Sid();
+-		void               SmbautoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin);
+-		void               Smbautoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms);
+ 		void               SmbGemb(IssmDouble timeinputs, int count);
+ 		void               StrainRateESA(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		void               StrainRateFS(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26495-26496.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26495-26496.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26495-26496.diff	(revision 26740)
@@ -0,0 +1,58 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.16-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.16-linux.sh	(nonexistent)
++++ ../trunk-jpl/externalpackages/petsc/install-3.16-linux.sh	(revision 26496)
+@@ -0,0 +1,46 @@
++#!/bin/bash
++set -eu
++
++## Constants
++VER="3.16.0"
++
++PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
++PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
++
++# Download source
++$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
++
++# Unpack source
++tar -zxvf petsc-${VER}.tar.gz
++
++# Cleanup
++rm -rf install src
++mkdir install src
++
++# Move source to $PETSC_DIR
++mv petsc-${VER}/* src/
++rm -rf petsc-${VER}
++
++# Configure
++cd src
++./config/configure.py \
++	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
++	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
++	-COPTFLAGS="-g -O2" -CXXOPTFLAGS="-g -O2" -FOPTFLAGS="-g -O2" \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-x=0 \
++	--with-ssl=0 \
++	--with-pic=1 \
++	--download-fblaslapack=1 \
++	--download-mpich=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-scalapack=1 \
++	--download-mumps=1 \
++	--download-zlib=1 \
++	--download-hdf5=1
++
++# Compile and install
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.16-linux.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26496-26497.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26496-26497.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26496-26497.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26496)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26497)
+@@ -403,7 +403,7 @@
+                     -beta*sqrt(vx*vx+vy*vy)
+                     +ieb
+                     +storage*head_old/dt
+-		    +meltrate*gap/rho_ice*(dgapxx+dgapyy)
++		    +pow(1,-5)*(dgapxx+dgapyy)
+                     )*basis[i];
+ 
+ 	
+@@ -659,8 +659,8 @@
+                                          meltrate/rho_ice
+                                          -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
+                                          +beta*sqrt(vx*vx+vy*vy)
+-					 +(meltrate*gap/rho_ice*(dgapxx+dgapyy))
+-                                         ));
++					 +pow(1,-5)*(dgapxx+dgapyy))
++                                         );
+ 
+ 
+                  /*TEST with linear creep rate*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26497-26498.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26497-26498.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26497-26498.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive350.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26498-26499.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26498-26499.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26498-26499.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26498)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26499)
+@@ -403,7 +403,7 @@
+                     -beta*sqrt(vx*vx+vy*vy)
+                     +ieb
+                     +storage*head_old/dt
+-		    +pow(1,-5)*(dgapxx+dgapyy)
++		    +1.e-5*(dgapxx+dgapyy)
+                     )*basis[i];
+ 
+ 	
+@@ -659,7 +659,7 @@
+                                          meltrate/rho_ice
+                                          -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
+                                          +beta*sqrt(vx*vx+vy*vy)
+-					 +pow(1,-5)*(dgapxx+dgapyy))
++					 +1.e-5*(dgapxx+dgapyy))
+                                          );
+ 
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26499-26500.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26499-26500.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26499-26500.diff	(revision 26740)
@@ -0,0 +1,2070 @@
+Index: ../trunk-jpl/src/jl/issmenums.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issmenums.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/issmenums.jl	(revision 26500)
+@@ -0,0 +1,1544 @@
++@enum IssmEnum begin
++	ParametersSTARTEnum
++	#Parameters{{{
++	AdolcParamEnum
++	AmrDeviatoricErrorGroupThresholdEnum
++	AmrDeviatoricErrorMaximumEnum
++	AmrDeviatoricErrorResolutionEnum
++	AmrDeviatoricErrorThresholdEnum
++	AmrErrEnum
++	AmrFieldEnum
++	AmrGradationEnum
++	AmrGroundingLineDistanceEnum
++	AmrGroundingLineResolutionEnum
++	AmrHmaxEnum
++	AmrHminEnum
++	AmrIceFrontDistanceEnum
++	AmrIceFrontResolutionEnum
++	AmrKeepMetricEnum
++	AmrLagEnum
++	AmrLevelMaxEnum
++	AmrRestartEnum
++	AmrThicknessErrorGroupThresholdEnum
++	AmrThicknessErrorMaximumEnum
++	AmrThicknessErrorResolutionEnum
++	AmrThicknessErrorThresholdEnum
++	AmrTypeEnum
++	AnalysisCounterEnum
++	AnalysisTypeEnum
++	AugmentedLagrangianREnum
++	AugmentedLagrangianRholambdaEnum
++	AugmentedLagrangianRhopEnum
++	AugmentedLagrangianRlambdaEnum
++	AugmentedLagrangianThetaEnum
++	AutodiffCbufsizeEnum
++	AutodiffDependentObjectsEnum
++	AutodiffDriverEnum
++	AutodiffFosForwardIndexEnum
++	AutodiffFosReverseIndexEnum
++	AutodiffFovForwardIndicesEnum
++	AutodiffGcTriggerMaxSizeEnum
++	AutodiffGcTriggerRatioEnum
++	AutodiffIsautodiffEnum
++	AutodiffLbufsizeEnum
++	AutodiffNumDependentsEnum
++	AutodiffNumIndependentsEnum
++	AutodiffObufsizeEnum
++	AutodiffTapeAllocEnum
++	AutodiffTbufsizeEnum
++	AutodiffXpEnum
++	BalancethicknessStabilizationEnum
++	BarystaticContributionsEnum
++	BasalforcingsBottomplumedepthEnum
++	BasalforcingsCrustthicknessEnum
++	BasalforcingsDeepwaterElevationEnum
++	BasalforcingsDeepwaterMeltingRateEnum
++	BasalforcingsDtbgEnum
++	BasalforcingsEnum
++	BasalforcingsIsmip6AverageTfEnum
++	BasalforcingsIsmip6BasinAreaEnum
++	BasalforcingsIsmip6DeltaTEnum
++	BasalforcingsIsmip6Gamma0Enum
++	BasalforcingsIsmip6IsLocalEnum
++	BasalforcingsIsmip6NumBasinsEnum
++	BasalforcingsIsmip6TfDepthsEnum
++	BasalforcingsLowercrustheatEnum
++	BasalforcingsMantleconductivityEnum
++	BasalforcingsNusseltEnum
++	BasalforcingsPicoAverageOverturningEnum
++	BasalforcingsPicoAverageSalinityEnum
++	BasalforcingsPicoAverageTemperatureEnum
++	BasalforcingsPicoBoxAreaEnum
++	BasalforcingsPicoFarOceansalinityEnum
++	BasalforcingsPicoFarOceantemperatureEnum
++	BasalforcingsPicoGammaTEnum
++	BasalforcingsPicoIsplumeEnum
++	BasalforcingsPicoMaxboxcountEnum
++	BasalforcingsPicoNumBasinsEnum
++	BasalforcingsPlumeradiusEnum
++	BasalforcingsPlumexEnum
++	BasalforcingsPlumeyEnum
++	BasalforcingsThresholdThicknessEnum
++	BasalforcingsTopplumedepthEnum
++	BasalforcingsUppercrustheatEnum
++	BasalforcingsUppercrustthicknessEnum
++	BasalforcingsUpperdepthMeltEnum
++	BasalforcingsUpperwaterElevationEnum
++	BasalforcingsUpperwaterMeltingRateEnum
++	CalvingCrevasseDepthEnum
++	CalvingCrevasseThresholdEnum
++	CalvingHeightAboveFloatationEnum
++	CalvingLawEnum
++	CalvingMinthicknessEnum
++	ConfigurationTypeEnum
++	ConstantsGEnum
++	ConstantsNewtonGravityEnum
++	ConstantsReferencetemperatureEnum
++	ConstantsYtsEnum
++	ControlInputSizeMEnum
++	ControlInputSizeNEnum
++	ControlInputInterpolationEnum
++	CumBslcEnum
++	CumBslcIceEnum
++	CumBslcHydroEnum
++	CumBslcOceanEnum
++	CumBslcIcePartitionEnum
++	CumBslcHydroPartitionEnum
++	CumBslcOceanPartitionEnum
++	CumGmtslcEnum
++	CumGmslcEnum
++	DamageC1Enum
++	DamageC2Enum
++	DamageC3Enum
++	DamageC4Enum
++	DamageEnum
++	DamageEquivStressEnum
++	DamageEvolutionNumRequestedOutputsEnum
++	DamageEvolutionRequestedOutputsEnum
++	DamageHealingEnum
++	DamageKappaEnum
++	DamageLawEnum
++	DamageMaxDamageEnum
++	DamageStabilizationEnum
++	DamageStressThresholdEnum
++	DamageStressUBoundEnum
++	DebugProfilingEnum
++	DomainDimensionEnum
++	DomainTypeEnum
++	DslModelEnum
++	DslModelidEnum
++	DslNummodelsEnum
++	SolidearthIsExternalEnum
++	SolidearthExternalNatureEnum
++	SolidearthExternalModelidEnum
++	SolidearthExternalNummodelsEnum
++	SolidearthSettingsComputeBpGrdEnum
++	EarthIdEnum
++	ElasticEnum
++	EplZigZagCounterEnum
++	EsaHElasticEnum
++	EsaHemisphereEnum
++	EsaRequestedOutputsEnum
++	EsaUElasticEnum
++	ExtrapolationVariableEnum
++	FemModelCommEnum
++	FieldsEnum
++	FlowequationFeFSEnum
++	FlowequationIsFSEnum
++	FlowequationIsHOEnum
++	FlowequationIsL1L2Enum
++	FlowequationIsMLHOEnum
++	FlowequationIsSIAEnum
++	FlowequationIsSSAEnum
++	FlowequationIsNitscheEnum
++	FeFSNitscheGammaEnum
++	FrictionCouplingEnum
++	FrictionDeltaEnum
++	FrictionEffectivePressureLimitEnum
++	FrictionFEnum
++	FrictionGammaEnum
++	FrictionLawEnum
++	FrictionPseudoplasticityExponentEnum
++	FrictionThresholdSpeedEnum
++	FrictionVoidRatioEnum
++	FrontalForcingsBasinIcefrontAreaEnum
++	FrontalForcingsNumberofBasinsEnum
++	FrontalForcingsParamEnum
++	GrdModelEnum
++	GroundinglineFrictionInterpolationEnum
++	GroundinglineMeltInterpolationEnum
++	GroundinglineMigrationEnum
++	HydrologyAveragingEnum
++	HydrologyCavitySpacingEnum
++	HydrologyChannelConductivityEnum
++	HydrologyChannelSheetWidthEnum
++	HydrologyEnglacialVoidRatioEnum
++	HydrologyIschannelsEnum
++	HydrologyMeltFlagEnum
++	HydrologyModelEnum
++	HydrologyNumRequestedOutputsEnum
++	HydrologyPressureMeltCoefficientEnum
++	HydrologyRelaxationEnum
++	HydrologyRequestedOutputsEnum
++	HydrologySedimentKmaxEnum
++	HydrologyStepsPerStepEnum
++	HydrologyStorageEnum
++	HydrologydcEplColapseThicknessEnum
++	HydrologydcEplConductivityEnum
++	HydrologydcEplInitialThicknessEnum
++	HydrologydcEplLayerCompressibilityEnum
++	HydrologydcEplMaxThicknessEnum
++	HydrologydcEplPoreWaterMassEnum
++	HydrologydcEplThickCompEnum
++	HydrologydcEplflipLockEnum
++	HydrologydcIsefficientlayerEnum
++	HydrologydcLeakageFactorEnum
++	HydrologydcMaxIterEnum
++	HydrologydcPenaltyFactorEnum
++	HydrologydcPenaltyLockEnum
++	HydrologydcRelTolEnum
++	HydrologydcSedimentlimitEnum
++	HydrologydcSedimentlimitFlagEnum
++	HydrologydcSedimentLayerCompressibilityEnum
++	HydrologydcSedimentPoreWaterMassEnum
++	HydrologydcSedimentPorosityEnum
++	HydrologydcSedimentThicknessEnum
++	HydrologydcTransferFlagEnum
++	HydrologydcUnconfinedFlagEnum
++	HydrologyshreveStabilizationEnum
++	IcecapToEarthCommEnum
++	IndexEnum
++	InputFileNameEnum
++	DirectoryNameEnum
++	IndicesEnum
++	InputToDepthaverageInEnum
++	InputToDepthaverageOutEnum
++	InputToExtrudeEnum
++	InputToL2ProjectEnum
++	InputToSmoothEnum
++	InversionAlgorithmEnum
++	InversionControlParametersEnum
++	InversionControlScalingFactorsEnum
++	InversionCostFunctionsEnum
++	InversionDxminEnum
++	InversionGatolEnum
++	InversionGradientScalingEnum
++	InversionGrtolEnum
++	InversionGttolEnum
++	InversionIncompleteAdjointEnum
++	InversionIscontrolEnum
++	InversionMaxiterEnum
++	InversionMaxiterPerStepEnum
++	InversionMaxstepsEnum
++	InversionNstepsEnum
++	InversionNumControlParametersEnum
++	InversionNumCostFunctionsEnum
++	InversionStepThresholdEnum
++	InversionTypeEnum
++	IvinsEnum
++	IsSlcCouplingEnum
++	LevelsetKillIcebergsEnum
++	LevelsetReinitFrequencyEnum
++	LevelsetStabilizationEnum
++	LockFileNameEnum
++	LoveAllowLayerDeletionEnum
++	LoveCoreMantleBoundaryEnum
++	LoveEarthMassEnum
++	LoveForcingTypeEnum
++	LoveFrequenciesEnum
++	LoveIsTemporalEnum
++	LoveG0Enum
++	LoveGravitationalConstantEnum
++	LoveInnerCoreBoundaryEnum
++	LoveComplexComputationEnum
++	LoveIntStepsPerLayerEnum
++	LoveKernelsEnum
++	LoveMu0Enum
++	LoveNfreqEnum
++	LoveNTemporalIterationsEnum
++	LoveNYiEquationsEnum
++	LoveR0Enum
++	LoveShNmaxEnum
++	LoveShNminEnum
++	LoveStartingLayerEnum
++	LoveUnderflowTolEnum
++	MassFluxSegmentsEnum
++	MassFluxSegmentsPresentEnum
++	MasstransportHydrostaticAdjustmentEnum
++	MasstransportIsfreesurfaceEnum
++	MasstransportMinThicknessEnum
++	MasstransportNumRequestedOutputsEnum
++	MasstransportPenaltyFactorEnum
++	MasstransportRequestedOutputsEnum
++	MasstransportStabilizationEnum
++	MaterialsBetaEnum
++	MaterialsEarthDensityEnum
++	MaterialsEffectiveconductivityAveragingEnum
++	MaterialsHeatcapacityEnum
++	MaterialsLatentheatEnum
++	MaterialsMeltingpointEnum
++	MaterialsMixedLayerCapacityEnum
++	MaterialsMuWaterEnum
++	MaterialsRheologyLawEnum
++	MaterialsRhoFreshwaterEnum
++	MaterialsRhoIceEnum
++	MaterialsRhoSeawaterEnum
++	MaterialsTemperateiceconductivityEnum
++	MaterialsThermalExchangeVelocityEnum
++	MaterialsThermalconductivityEnum
++	MeltingOffsetEnum
++	MeshAverageVertexConnectivityEnum
++	MeshElementtypeEnum
++	MeshNumberoflayersEnum
++	MeshNumberofverticesEnum
++	MeshNumberofelementsEnum
++	MigrationMaxEnum
++	ModelIdEnum
++	NbinsEnum
++	NodesEnum
++	NumModelsEnum
++	OceanGridNxEnum
++	OceanGridNyEnum
++	OceanGridXEnum
++	OceanGridYEnum
++	OutputBufferPointerEnum
++	OutputBufferSizePointerEnum
++	OutputFileNameEnum
++	OutputFilePointerEnum
++	OutputdefinitionEnum
++	QmuErrNameEnum
++	QmuInNameEnum
++	QmuIsdakotaEnum
++	QmuOutNameEnum
++	QmuOutputEnum
++	QmuCurrEvalIdEnum
++	QmuNsampleEnum
++	QmuResponsedescriptorsEnum
++	QmuVariableDescriptorsEnum
++	QmuVariablePartitionsEnum
++	QmuVariablePartitionsNpartEnum
++	QmuVariablePartitionsNtEnum
++	QmuResponsePartitionsEnum
++	QmuResponsePartitionsNpartEnum
++	QmuStatisticsEnum
++	QmuNumstatisticsEnum
++	QmuNdirectoriesEnum
++	QmuNfilesPerDirectoryEnum
++	QmuStatisticsMethodEnum
++	QmuMethodsEnum
++	RestartFileNameEnum
++	ResultsEnum
++	RootPathEnum
++	ModelnameEnum
++	SamplingAlphaEnum
++	SamplingPhiEnum
++	SamplingNumRequestedOutputsEnum
++	SamplingRequestedOutputsEnum
++	SamplingRobinEnum
++	SamplingSeedEnum
++	SamplingTauEnum
++	SaveResultsEnum
++	SolidearthPartitionIceEnum
++	SolidearthPartitionHydroEnum
++	SolidearthPartitionOceanEnum
++	SolidearthNpartIceEnum
++	SolidearthNpartOceanEnum
++	SolidearthNpartHydroEnum
++	SolidearthPlanetRadiusEnum
++	SolidearthPlanetAreaEnum
++	SolidearthSettingsAbstolEnum
++	SolidearthSettingsCrossSectionShapeEnum
++	RotationalAngularVelocityEnum
++	SolidearthSettingsElasticEnum
++	SolidearthSettingsViscousEnum
++	SealevelchangeGeometryDoneEnum
++	SealevelchangeViscousNumStepsEnum
++	SealevelchangeViscousTimesEnum
++	SealevelchangeViscousIndexEnum
++	RotationalEquatorialMoiEnum
++	TidalLoveHEnum
++	TidalLoveKEnum
++	TidalLoveLEnum
++	TidalLoveK2SecularEnum
++	LoadLoveHEnum
++	LoadLoveKEnum
++	LoadLoveLEnum
++	LoveTimeFreqEnum
++	LoveIsTimeEnum
++	SealevelchangeGSelfAttractionEnum
++	SealevelchangeGViscoElasticEnum
++	SolidearthSettingsSealevelLoadingEnum
++	SolidearthSettingsGRDEnum
++	SolidearthSettingsRunFrequencyEnum
++	SolidearthSettingsTimeAccEnum
++	SealevelchangeHViscoElasticEnum
++	SolidearthSettingsHorizEnum
++	SolidearthSettingsMaxiterEnum
++	SolidearthSettingsGrdOceanEnum
++	SolidearthSettingsOceanAreaScalingEnum
++	RotationalPolarMoiEnum
++	SolidearthSettingsReltolEnum
++	SealevelchangeRequestedOutputsEnum
++	SolidearthSettingsSelfAttractionEnum
++	SolidearthSettingsRotationEnum
++	SolidearthSettingsMaxSHCoeffEnum
++	SealevelchangeRunCountEnum
++	SealevelchangeTransitionsEnum
++	SealevelchangeUViscoElasticEnum
++	SettingsIoGatherEnum
++	SettingsNumResultsOnNodesEnum
++	SettingsOutputFrequencyEnum
++	SettingsCheckpointFrequencyEnum
++	SettingsResultsOnNodesEnum
++	SettingsSbCouplingFrequencyEnum
++	SettingsSolverResidueThresholdEnum
++	SettingsWaitonlockEnum
++	SmbAIceEnum
++	SmbAIdxEnum
++	SmbASnowEnum
++	SmbAccualtiEnum
++	SmbAccugradEnum
++	SmbAccurefEnum
++	SmbAdThreshEnum
++	SmbAutoregressionInitialTimeEnum
++	SmbAutoregressionTimestepEnum
++	SmbAutoregressiveOrderEnum
++	SmbAveragingEnum
++	SmbBeta0Enum
++	SmbBeta1Enum
++	SmbCovmatEnum
++	SmbDesfacEnum
++	SmbDpermilEnum
++	SmbDsnowIdxEnum
++	SmbCldFracEnum
++	SmbDelta18oEnum
++	SmbDelta18oSurfaceEnum
++	SmbDenIdxEnum
++	SmbDtEnum
++	SmbEnum
++	SmbFEnum
++	SmbInitDensityScalingEnum
++	SmbIsaccumulationEnum
++	SmbIsalbedoEnum
++	SmbIsconstrainsurfaceTEnum
++	SmbIsd18opdEnum
++	SmbIsdelta18oEnum
++	SmbIsdensificationEnum
++	SmbIsfirnwarmingEnum
++	SmbIsgraingrowthEnum
++	SmbIsmeltEnum
++	SmbIsmungsmEnum
++	SmbIsprecipscaledEnum
++	SmbIssetpddfacEnum
++	SmbIsshortwaveEnum
++	SmbIstemperaturescaledEnum
++	SmbIsthermalEnum
++	SmbIsturbulentfluxEnum
++	SmbKEnum
++	SmbNumBasinsEnum
++	SmbNumRequestedOutputsEnum
++	SmbPfacEnum
++	SmbPhiEnum
++	SmbRandomflagEnum
++	SmbRdlEnum
++	SmbRequestedOutputsEnum
++	SmbRlapsEnum
++	SmbRlapslgmEnum
++	SmbRunoffaltiEnum
++	SmbRunoffgradEnum
++	SmbRunoffrefEnum
++	SmbSealevEnum
++	SmbStepsPerStepEnum
++	SmbSwIdxEnum
++	SmbT0dryEnum
++	SmbT0wetEnum
++	SmbTdiffEnum
++	SmbThermoDeltaTScalingEnum
++	SmbTemperaturesReconstructedYearsEnum
++	SmbPrecipitationsReconstructedYearsEnum
++	SmoothThicknessMultiplierEnum
++	SolutionTypeEnum
++	SteadystateMaxiterEnum
++	SteadystateNumRequestedOutputsEnum
++	SteadystateReltolEnum
++	SteadystateRequestedOutputsEnum
++	StepEnum
++	StepsEnum
++	StressbalanceAbstolEnum
++	StressbalanceFSreconditioningEnum
++	StressbalanceIsnewtonEnum
++	StressbalanceMaxiterEnum
++	StressbalanceNumRequestedOutputsEnum
++	StressbalancePenaltyFactorEnum
++	StressbalanceReltolEnum
++	StressbalanceRequestedOutputsEnum
++	StressbalanceRestolEnum
++	StressbalanceRiftPenaltyThresholdEnum
++	StressbalanceShelfDampeningEnum
++	ThermalIsdrainicecolumnEnum
++	ThermalIsdynamicbasalspcEnum
++	ThermalIsenthalpyEnum
++	ThermalMaxiterEnum
++	ThermalNumRequestedOutputsEnum
++	ThermalPenaltyFactorEnum
++	ThermalPenaltyLockEnum
++	ThermalPenaltyThresholdEnum
++	ThermalReltolEnum
++	ThermalRequestedOutputsEnum
++	ThermalStabilizationEnum
++	ThermalWatercolumnUpperlimitEnum
++	TimeEnum
++	TimesteppingCflCoefficientEnum
++	TimesteppingCouplingTimeEnum
++	TimesteppingFinalTimeEnum
++	TimesteppingInterpForcingEnum
++	TimesteppingCycleForcingEnum
++	TimesteppingStartTimeEnum
++	TimesteppingTimeStepEnum
++	TimesteppingTimeStepMaxEnum
++	TimesteppingTimeStepMinEnum
++	TimesteppingTypeEnum
++	ToMITgcmCommEnum
++	ToolkitsFileNameEnum
++	ToolkitsOptionsAnalysesEnum
++	ToolkitsOptionsStringsEnum
++	ToolkitsTypesEnum
++	TransientAmrFrequencyEnum
++	TransientIsdamageevolutionEnum
++	TransientIsesaEnum
++	TransientIsgiaEnum
++	TransientIsgroundinglineEnum
++	TransientIshydrologyEnum
++	TransientIsmasstransportEnum 
++	TransientIsoceantransportEnum
++	TransientIsmovingfrontEnum
++	TransientIsoceancouplingEnum
++	TransientIssamplingEnum
++	TransientIsslcEnum
++	TransientIssmbEnum
++	TransientIsstressbalanceEnum
++	TransientIsthermalEnum
++	TransientNumRequestedOutputsEnum
++	TransientRequestedOutputsEnum
++	VelocityEnum
++	XxeEnum
++	YyeEnum
++	ZzeEnum
++	AreaeEnum
++	WorldCommEnum
++	#}}}
++	ParametersENDEnum
++	InputsSTARTEnum
++	#Inputs{{{
++	AccumulatedDeltaBottomPressureEnum
++	AccumulatedDeltaIceThicknessEnum
++	AccumulatedDeltaTwsEnum
++	AdjointEnum
++	AdjointpEnum
++	AdjointxEnum
++	AdjointxBaseEnum
++	AdjointxShearEnum
++	AdjointyEnum
++	AdjointyBaseEnum
++	AdjointyShearEnum
++	AdjointzEnum
++	AirEnum
++	ApproximationEnum
++	BalancethicknessMisfitEnum
++	BalancethicknessOmega0Enum
++	BalancethicknessOmegaEnum
++	BalancethicknessSpcthicknessEnum
++	BalancethicknessThickeningRateEnum
++	BasalCrevasseEnum
++	BasalforcingsFloatingiceMeltingRateEnum
++	BasalforcingsGeothermalfluxEnum
++	BasalforcingsGroundediceMeltingRateEnum
++	BasalforcingsPerturbationMeltingRateEnum
++	BasalforcingsIsmip6BasinIdEnum
++	BasalforcingsIsmip6TfEnum
++	BasalforcingsIsmip6TfShelfEnum
++	BasalforcingsIsmip6MeltAnomalyEnum
++	BasalforcingsMeltrateFactorEnum
++	BasalforcingsOceanSalinityEnum
++	BasalforcingsOceanTempEnum
++	BasalforcingsPicoBasinIdEnum
++	BasalforcingsPicoBoxIdEnum
++	BasalforcingsPicoOverturningCoeffEnum
++	BasalforcingsPicoSubShelfOceanOverturningEnum
++	BasalforcingsPicoSubShelfOceanSalinityEnum
++	BasalforcingsPicoSubShelfOceanTempEnum
++	BasalStressxEnum
++	BasalStressyEnum
++	BasalStressEnum
++	BaseEnum
++	BaseOldEnum
++	BaseSlopeXEnum
++	BaseSlopeYEnum
++	BedEnum
++	BedGRDEnum
++	BedEastEnum
++	BedEastGRDEnum
++	BedNorthEnum
++	BedNorthGRDEnum
++	BedSlopeXEnum
++	BedSlopeYEnum
++	BottomPressureEnum
++	BottomPressureOldEnum
++	CalvingCalvingrateEnum
++	CalvingHabFractionEnum
++	CalvingMeltingrateEnum
++	CalvingStressThresholdFloatingiceEnum
++	CalvingStressThresholdGroundediceEnum
++	CalvinglevermannCoeffEnum
++	CalvingratexAverageEnum
++	CalvingratexEnum
++	CalvingrateyAverageEnum
++	CalvingrateyEnum
++	CalvingFluxLevelsetEnum
++	CalvingMeltingFluxLevelsetEnum
++	ConvergedEnum
++	CrevasseDepthEnum
++	DamageDEnum
++	DamageDOldEnum
++	DamageDbarEnum
++	DamageDbarOldEnum
++	DamageFEnum
++	DegreeOfChannelizationEnum
++	DepthBelowSurfaceEnum
++	DeltaIceThicknessEnum
++	DeltaTwsEnum
++	DeltaBottomPressureEnum
++	DeltaDslEnum
++	DslOldEnum
++	DslEnum
++	DeltaStrEnum
++	StrOldEnum
++	StrEnum
++	DeviatoricStresseffectiveEnum
++	DeviatoricStressxxEnum
++	DeviatoricStressxyEnum
++	DeviatoricStressxzEnum
++	DeviatoricStressyyEnum
++	DeviatoricStressyzEnum
++	DeviatoricStresszzEnum
++	DeviatoricStress1Enum
++	DeviatoricStress2Enum
++	DistanceToCalvingfrontEnum
++	DistanceToGroundinglineEnum
++	Domain2DhorizontalEnum
++	Domain2DverticalEnum
++	Domain3DEnum
++	DragCoefficientAbsGradientEnum
++	DrivingStressXEnum
++	DrivingStressYEnum
++	DummyEnum
++	EffectivePressureEnum
++	EffectivePressureSubstepEnum
++	EffectivePressureTransientEnum
++	EnthalpyEnum
++	EnthalpyPicardEnum
++	EplHeadEnum
++	EplHeadOldEnum
++	EplHeadSlopeXEnum
++	EplHeadSlopeYEnum
++	EplHeadSubstepEnum
++	EplHeadTransientEnum
++	EsaEmotionEnum
++	EsaNmotionEnum
++	EsaRotationrateEnum
++	EsaStrainratexxEnum
++	EsaStrainratexyEnum
++	EsaStrainrateyyEnum
++	EsaUmotionEnum
++	EsaXmotionEnum
++	EsaYmotionEnum
++	EtaDiffEnum
++	FlowequationBorderFSEnum
++	FrictionAsEnum
++	FrictionCEnum
++	FrictionCmaxEnum
++	FrictionCoefficientEnum
++	FrictionCoefficientcoulombEnum
++	FrictionEffectivePressureEnum
++	FrictionMEnum
++	FrictionPEnum
++	FrictionPressureAdjustedTemperatureEnum
++	FrictionQEnum
++	FrictionSedimentCompressibilityCoefficientEnum
++	FrictionTillFrictionAngleEnum
++	FrictionWaterLayerEnum
++	FrictionfEnum
++	FrontalForcingsBasinIdEnum
++	FrontalForcingsSubglacialDischargeEnum
++	FrontalForcingsThermalForcingEnum
++	GeometryHydrostaticRatioEnum
++	NGiaEnum
++	NGiaRateEnum
++	UGiaEnum
++	UGiaRateEnum
++	GradientEnum
++	GroundinglineHeightEnum
++	HydraulicPotentialEnum
++	HydraulicPotentialOldEnum
++	HydrologyBasalFluxEnum
++	HydrologyBumpHeightEnum
++	HydrologyBumpSpacingEnum
++	HydrologydcBasalMoulinInputEnum
++	HydrologydcEplThicknessEnum
++	HydrologydcEplThicknessOldEnum
++	HydrologydcEplThicknessSubstepEnum
++	HydrologydcEplThicknessTransientEnum
++	HydrologydcMaskEplactiveEltEnum
++	HydrologydcMaskEplactiveNodeEnum
++	HydrologydcMaskThawedEltEnum
++	HydrologydcMaskThawedNodeEnum
++	HydrologydcSedimentTransmitivityEnum
++	HydrologyDrainageRateEnum
++	HydrologyEnglacialInputEnum
++	HydrologyGapHeightEnum
++	HydrologyGapHeightXEnum
++	HydrologyGapHeightXXEnum
++	HydrologyGapHeightYEnum
++	HydrologyGapHeightYYEnum
++	HydrologyHeadEnum
++	HydrologyHeadOldEnum
++	HydrologyMoulinInputEnum
++	HydrologyNeumannfluxEnum
++	HydrologyReynoldsEnum
++	HydrologySheetConductivityEnum
++	HydrologySheetThicknessEnum
++	HydrologySheetThicknessOldEnum
++	HydrologyTwsEnum
++	HydrologyTwsSpcEnum
++	HydrologyTwsAnalysisEnum
++	HydrologyWatercolumnMaxEnum
++	HydrologyWaterVxEnum
++	HydrologyWaterVyEnum
++	IceEnum
++	IceMaskNodeActivationEnum
++	InputEnum
++	InversionCostFunctionsCoefficientsEnum
++	InversionSurfaceObsEnum
++	InversionThicknessObsEnum
++	InversionVelObsEnum
++	InversionVxObsEnum
++	InversionVyObsEnum
++	LevelsetfunctionSlopeXEnum
++	LevelsetfunctionSlopeYEnum
++	LevelsetObservationEnum
++	LoadingforceXEnum
++	LoadingforceYEnum
++	LoadingforceZEnum
++	MaskOceanLevelsetEnum
++	MaskIceLevelsetEnum
++	MaskIceRefLevelsetEnum
++	MasstransportSpcthicknessEnum
++	MaterialsRheologyBEnum
++	MaterialsRheologyBbarEnum
++	MaterialsRheologyEEnum
++	MaterialsRheologyEbarEnum
++	MaterialsRheologyEcEnum
++	MaterialsRheologyEcbarEnum
++	MaterialsRheologyEsEnum
++	MaterialsRheologyEsbarEnum
++	MaterialsRheologyNEnum
++	MeshScaleFactorEnum
++	MeshVertexonbaseEnum
++	MeshVertexonboundaryEnum
++	MeshVertexonsurfaceEnum
++	MisfitEnum
++	MovingFrontalVxEnum
++	MovingFrontalVyEnum
++	NeumannfluxEnum
++	NewDamageEnum
++	NodeEnum
++	OmegaAbsGradientEnum
++	OceantransportSpcbottompressureEnum
++	OceantransportSpcstrEnum
++	OceantransportSpcdslEnum
++	P0Enum
++	P1Enum
++	PartitioningEnum
++	PressureEnum
++	RadarEnum
++	RadarAttenuationMacGregorEnum
++	RadarAttenuationWolffEnum
++	RadarIcePeriodEnum
++	RadarPowerMacGregorEnum
++	RadarPowerWolffEnum
++	RheologyBAbsGradientEnum
++	RheologyBInitialguessEnum
++	RheologyBInitialguessMisfitEnum
++	RheologyBbarAbsGradientEnum
++	SampleEnum
++	SamplingBetaEnum
++	SamplingKappaEnum
++	SealevelEnum
++	SealevelGRDEnum
++	SealevelBarystaticMaskEnum
++	SealevelBarystaticIceMaskEnum
++	SealevelBarystaticIceWeightsEnum
++	SealevelBarystaticIceAreaEnum
++	SealevelBarystaticIceLatbarEnum
++	SealevelBarystaticIceLongbarEnum
++	SealevelBarystaticIceLoadEnum
++	SealevelBarystaticHydroMaskEnum
++	SealevelBarystaticHydroWeightsEnum
++	SealevelBarystaticHydroAreaEnum
++	SealevelBarystaticHydroLatbarEnum
++	SealevelBarystaticHydroLongbarEnum
++	SealevelBarystaticHydroLoadEnum
++	SealevelBarystaticBpMaskEnum
++	SealevelBarystaticBpWeightsEnum
++	SealevelBarystaticBpAreaEnum
++	SealevelBarystaticBpLoadEnum
++	SealevelBarystaticOceanMaskEnum
++	SealevelBarystaticOceanWeightsEnum
++	SealevelBarystaticOceanAreaEnum
++	SealevelBarystaticOceanLatbarEnum
++	SealevelBarystaticOceanLongbarEnum
++	SealevelBarystaticOceanLoadEnum
++	SealevelNEsaEnum
++	SealevelNEsaRateEnum
++	SealevelRSLEnum
++	BslcEnum
++	BslcIceEnum
++	BslcHydroEnum
++	BslcOceanEnum
++	BslcRateEnum
++	GmtslcEnum
++	SealevelGrotm1Enum
++	SealevelGrotm2Enum
++	SealevelGrotm3Enum
++	SealevelGUrotm1Enum
++	SealevelGUrotm2Enum
++	SealevelGUrotm3Enum
++	SealevelGNrotm1Enum
++	SealevelGNrotm2Enum
++	SealevelGNrotm3Enum
++	SealevelGErotm1Enum
++	SealevelGErotm2Enum
++	SealevelGErotm3Enum
++	SealevelRSLBarystaticEnum
++	SealevelRSLRateEnum
++	SealevelUGrdEnum
++	SealevelNGrdEnum
++	SealevelUEastEsaEnum
++	SealevelUNorthEsaEnum
++	SealevelchangeIndicesEnum
++	SealevelchangeGEnum
++	SealevelchangeGUEnum
++	SealevelchangeGEEnum
++	SealevelchangeGNEnum
++	SealevelchangeGsubelOceanEnum
++	SealevelchangeGUsubelOceanEnum
++	SealevelchangeGEsubelOceanEnum
++	SealevelchangeGNsubelOceanEnum
++	SealevelchangeGsubelIceEnum
++	SealevelchangeGUsubelIceEnum
++	SealevelchangeGEsubelIceEnum
++	SealevelchangeGNsubelIceEnum
++	SealevelchangeGsubelHydroEnum
++	SealevelchangeGUsubelHydroEnum
++	SealevelchangeGEsubelHydroEnum
++	SealevelchangeGNsubelHydroEnum
++	SealevelchangeViscousRSLEnum
++	SealevelchangeViscousUEnum
++	SealevelchangeViscousNEnum
++	SealevelchangeViscousEEnum
++	SedimentHeadEnum
++	SedimentHeadOldEnum
++	SedimentHeadSubstepEnum
++	SedimentHeadTransientEnum
++	SedimentHeadResidualEnum
++	SedimentHeadStackedEnum
++	SigmaNNEnum
++	SigmaVMEnum
++	SmbAccumulatedECEnum
++	SmbAccumulatedMassBalanceEnum
++	SmbAccumulatedMeltEnum
++	SmbAccumulatedPrecipitationEnum
++	SmbAccumulatedRainEnum
++	SmbAccumulatedRefreezeEnum
++	SmbAccumulatedRunoffEnum
++	SmbAEnum
++	SmbAdiffEnum
++	SmbAValueEnum
++	SmbAccumulationEnum
++	SmbAdiffiniEnum
++	SmbAiniEnum
++	SmbBasinsIdEnum
++	SmbBMaxEnum
++	SmbBMinEnum
++	SmbBNegEnum
++	SmbBPosEnum
++	SmbCEnum
++	SmbCcsnowValueEnum
++	SmbCciceValueEnum
++	SmbCotValueEnum
++	SmbDEnum
++	SmbDailyairdensityEnum
++	SmbDailyairhumidityEnum
++	SmbDailydlradiationEnum
++	SmbDailydsradiationEnum
++	SmbDailypressureEnum
++	SmbDailyrainfallEnum
++	SmbDailysnowfallEnum
++	SmbDailytemperatureEnum
++	SmbDailywindspeedEnum
++	SmbDiniEnum
++	SmbDlwrfEnum
++	SmbDswrfEnum
++	SmbDswdiffrfEnum
++	SmbDzAddEnum
++	SmbDzEnum
++	SmbDzMinEnum
++	SmbDzTopEnum
++	SmbDziniEnum
++	SmbEAirEnum
++	SmbECEnum
++	SmbECDtEnum
++	SmbECiniEnum
++	SmbElaEnum
++	SmbEvaporationEnum
++	SmbFACEnum
++	SmbGdnEnum
++	SmbGdniniEnum
++	SmbGspEnum
++	SmbGspiniEnum
++	SmbHrefEnum
++	SmbIsInitializedEnum
++	SmbMAddEnum
++	SmbMassBalanceEnum
++	SmbMassBalanceSubstepEnum
++	SmbMassBalanceTransientEnum
++	SmbMeanLHFEnum
++	SmbMeanSHFEnum
++	SmbMeanULWEnum
++	SmbMeltEnum
++	SmbMInitnum
++	SmbMonthlytemperaturesEnum
++	SmbMSurfEnum
++	SmbNetLWEnum
++	SmbNetSWEnum
++	SmbPAirEnum
++	SmbPEnum
++	SmbPddfacIceEnum
++	SmbPddfacSnowEnum
++	SmbPrecipitationEnum
++	SmbPrecipitationsAnomalyEnum
++	SmbPrecipitationsLgmEnum
++	SmbPrecipitationsPresentdayEnum
++	SmbPrecipitationsReconstructedEnum
++	SmbRainEnum
++	SmbReEnum
++	SmbRefreezeEnum
++	SmbReiniEnum
++	SmbRunoffEnum
++	SmbRunoffSubstepEnum
++	SmbRunoffTransientEnum
++	SmbS0gcmEnum
++	SmbS0pEnum
++	SmbS0tEnum
++	SmbSizeiniEnum
++	SmbSmbCorrEnum
++	SmbSmbrefEnum
++	SmbSzaValueEnum
++	SmbTEnum
++	SmbTaEnum
++	SmbTeValueEnum
++	SmbTemperaturesAnomalyEnum
++	SmbTemperaturesLgmEnum
++	SmbTemperaturesPresentdayEnum
++	SmbTemperaturesReconstructedEnum
++	SmbTiniEnum
++	SmbTmeanEnum
++	SmbTzEnum
++	SmbValuesAutoregressionEnum
++	SmbVEnum
++	SmbVmeanEnum
++	SmbVzEnum
++	SmbWEnum
++	SmbWAddEnum
++	SmbWiniEnum
++	SmbZMaxEnum
++	SmbZMinEnum
++	SmbZTopEnum
++	SmbZYEnum
++	SolidearthExternalDisplacementEastRateEnum
++	SolidearthExternalDisplacementNorthRateEnum
++	SolidearthExternalDisplacementUpRateEnum
++	SolidearthExternalGeoidRateEnum
++	StrainRateeffectiveEnum
++	StrainRateparallelEnum
++	StrainRateperpendicularEnum
++	StrainRatexxEnum
++	StrainRatexyEnum
++	StrainRatexzEnum
++	StrainRateyyEnum
++	StrainRateyzEnum
++	StrainRatezzEnum
++	StressMaxPrincipalEnum
++	StressTensorxxEnum
++	StressTensorxyEnum
++	StressTensorxzEnum
++	StressTensoryyEnum
++	StressTensoryzEnum
++	StressTensorzzEnum
++	SurfaceAbsMisfitEnum
++	SurfaceAbsVelMisfitEnum
++	AreaEnum
++	SealevelAreaEnum
++	SurfaceAreaEnum
++	SurfaceAverageVelMisfitEnum
++	SurfaceCrevasseEnum
++	SurfaceEnum
++	SurfaceOldEnum
++	SurfaceLogVelMisfitEnum
++	SurfaceLogVxVyMisfitEnum
++	SurfaceObservationEnum
++	SurfaceRelVelMisfitEnum
++	SurfaceSlopeXEnum
++	SurfaceSlopeYEnum
++	TemperatureEnum
++	TemperaturePDDEnum
++	TemperaturePicardEnum
++	TemperatureSEMICEnum
++	ThermalSpctemperatureEnum
++	ThicknessAbsGradientEnum
++	ThicknessAbsMisfitEnum
++	ThicknessAcrossGradientEnum
++	ThicknessAlongGradientEnum
++	ThicknessEnum
++	ThicknessOldEnum
++	ThicknessPositiveEnum
++	ThicknessResidualEnum
++	TransientAccumulatedDeltaIceThicknessEnum
++	VelEnum
++	VxAverageEnum
++	VxBaseEnum
++	VxEnum
++	VxMeshEnum
++	VxObsEnum
++	VxShearEnum
++	VxSurfaceEnum
++	VyAverageEnum
++	VyBaseEnum
++	VyEnum
++	VyMeshEnum
++	VyObsEnum
++	VyShearEnum
++	VySurfaceEnum
++	VzEnum
++	VzFSEnum
++	VzHOEnum
++	VzMeshEnum
++	VzSSAEnum
++	WaterColumnOldEnum
++	WatercolumnEnum
++	WaterfractionDrainageEnum
++	WaterfractionDrainageIntegratedEnum
++	WaterfractionEnum
++	WaterheightEnum
++	WeightsLevelsetObservationEnum
++	WeightsSurfaceObservationEnum
++	OldAccumulatedDeltaBottomPressureEnum
++	OldAccumulatedDeltaIceThicknessEnum
++	OldAccumulatedDeltaTwsEnum
++	Outputdefinition1Enum
++	Outputdefinition10Enum
++	Outputdefinition11Enum
++	Outputdefinition12Enum
++	Outputdefinition13Enum
++	Outputdefinition14Enum
++	Outputdefinition15Enum
++	Outputdefinition16Enum
++	Outputdefinition17Enum
++	Outputdefinition18Enum
++	Outputdefinition19Enum
++	Outputdefinition20Enum
++	Outputdefinition21Enum
++	Outputdefinition22Enum
++	Outputdefinition23Enum
++	Outputdefinition24Enum
++	Outputdefinition25Enum
++	Outputdefinition26Enum
++	Outputdefinition27Enum
++	Outputdefinition28Enum
++	Outputdefinition29Enum
++	Outputdefinition2Enum
++	Outputdefinition30Enum
++	Outputdefinition31Enum
++	Outputdefinition32Enum
++	Outputdefinition33Enum
++	Outputdefinition34Enum
++	Outputdefinition35Enum
++	Outputdefinition36Enum
++	Outputdefinition37Enum
++	Outputdefinition38Enum
++	Outputdefinition39Enum
++	Outputdefinition3Enum
++	Outputdefinition40Enum
++	Outputdefinition41Enum
++	Outputdefinition42Enum
++	Outputdefinition43Enum
++	Outputdefinition44Enum
++	Outputdefinition45Enum
++	Outputdefinition46Enum
++	Outputdefinition47Enum
++	Outputdefinition48Enum
++	Outputdefinition49Enum
++	Outputdefinition4Enum
++	Outputdefinition50Enum
++	Outputdefinition51Enum
++	Outputdefinition52Enum
++	Outputdefinition53Enum
++	Outputdefinition54Enum
++	Outputdefinition55Enum
++	Outputdefinition56Enum
++	Outputdefinition57Enum
++	Outputdefinition58Enum
++	Outputdefinition59Enum
++	Outputdefinition5Enum
++	Outputdefinition60Enum
++	Outputdefinition61Enum
++	Outputdefinition62Enum
++	Outputdefinition63Enum
++	Outputdefinition64Enum
++	Outputdefinition65Enum
++	Outputdefinition66Enum
++	Outputdefinition67Enum
++	Outputdefinition68Enum
++	Outputdefinition69Enum
++	Outputdefinition6Enum
++	Outputdefinition70Enum
++	Outputdefinition71Enum
++	Outputdefinition72Enum
++	Outputdefinition73Enum
++	Outputdefinition74Enum
++	Outputdefinition75Enum
++	Outputdefinition76Enum
++	Outputdefinition77Enum
++	Outputdefinition78Enum
++	Outputdefinition79Enum
++	Outputdefinition7Enum
++	Outputdefinition80Enum
++	Outputdefinition81Enum
++	Outputdefinition82Enum
++	Outputdefinition83Enum
++	Outputdefinition84Enum
++	Outputdefinition85Enum
++	Outputdefinition86Enum
++	Outputdefinition87Enum
++	Outputdefinition88Enum
++	Outputdefinition89Enum
++	Outputdefinition8Enum
++	Outputdefinition90Enum
++	Outputdefinition91Enum
++	Outputdefinition92Enum
++	Outputdefinition93Enum
++	Outputdefinition94Enum
++	Outputdefinition95Enum
++	Outputdefinition96Enum
++	Outputdefinition97Enum
++	Outputdefinition98Enum
++	Outputdefinition99Enum
++	Outputdefinition9Enum
++	Outputdefinition100Enum
++	#}}}
++	InputsENDEnum
++	#Other{{{
++	AbsoluteEnum
++	AdaptiveTimesteppingEnum
++	AdjointBalancethickness2AnalysisEnum
++	AdjointBalancethicknessAnalysisEnum
++	AdjointHorizAnalysisEnum
++	AggressiveMigrationEnum
++	AmrBamgEnum
++	AmrNeopzEnum
++	AndroidFrictionCoefficientEnum
++	ArrheniusEnum
++	AutodiffJacobianEnum
++	Balancethickness2AnalysisEnum
++	Balancethickness2SolutionEnum
++	BalancethicknessAnalysisEnum
++	BalancethicknessApparentMassbalanceEnum
++	BalancethicknessSoftAnalysisEnum
++	BalancethicknessSoftSolutionEnum
++	BalancethicknessSolutionEnum
++	BalancevelocityAnalysisEnum
++	BalancevelocitySolutionEnum
++	BasalforcingsIsmip6Enum
++	BasalforcingsPicoEnum
++	BeckmannGoosseFloatingMeltRateEnum
++	BedSlopeSolutionEnum
++	BoolExternalResultEnum
++	BoolInputEnum
++	IntInputEnum
++	DoubleInputEnum
++	BoolParamEnum
++	BoundaryEnum
++	BuddJackaEnum
++	CalvingDev2Enum
++	CalvingHabEnum
++	CalvingLevermannEnum
++	CalvingVonmisesEnum
++	CfdragcoeffabsgradEnum
++	CfsurfacelogvelEnum
++	CfsurfacesquareEnum
++	CflevelsetmisfitEnum
++	ChannelEnum
++	ChannelAreaEnum
++	ChannelAreaOldEnum
++	ChannelDischargeEnum
++	ClosedEnum
++	ColinearEnum
++	ConstraintsEnum
++	ContactEnum
++	ContourEnum
++	ContoursEnum
++	ControlInputEnum
++	ControlInputGradEnum
++	ControlInputMaxsEnum
++	ControlInputMinsEnum
++	ControlInputValuesEnum
++	CrouzeixRaviartEnum
++	CuffeyEnum
++	CuffeyTemperateEnum
++	DamageEvolutionAnalysisEnum
++	DamageEvolutionSolutionEnum
++	DataSetEnum
++	DataSetParamEnum
++	DatasetInputEnum
++	DefaultAnalysisEnum
++	DefaultCalvingEnum
++	DenseEnum
++	DependentObjectEnum
++	DepthAverageAnalysisEnum
++	DeviatoricStressErrorEstimatorEnum
++	DivergenceEnum
++	Domain3DsurfaceEnum
++	DoubleArrayInputEnum
++	ArrayInputEnum
++	DoubleExternalResultEnum
++	DoubleMatArrayParamEnum
++	DoubleMatExternalResultEnum
++	DoubleMatParamEnum
++	DoubleParamEnum
++	DoubleVecParamEnum
++	ElementEnum
++	ElementHookEnum
++	ElementSIdEnum
++	EnthalpyAnalysisEnum
++	EsaAnalysisEnum
++	EsaSolutionEnum
++	EsaTransitionsEnum
++	ExternalResultEnum
++	ExtrapolationAnalysisEnum
++	ExtrudeFromBaseAnalysisEnum
++	ExtrudeFromTopAnalysisEnum
++	FSApproximationEnum
++	FSSolverEnum
++	FSpressureEnum
++	FSvelocityEnum
++	FemModelEnum
++	FileParamEnum
++	FixedTimesteppingEnum
++	FloatingAreaEnum
++	FloatingAreaScaledEnum
++	FloatingMeltRateEnum
++	FreeEnum
++	FreeSurfaceBaseAnalysisEnum
++	FreeSurfaceTopAnalysisEnum
++	FrontalForcingsDefaultEnum
++	FrontalForcingsRignotEnum
++	FsetEnum
++	FullMeltOnPartiallyFloatingEnum
++	GLheightadvectionAnalysisEnum
++	GaussPentaEnum
++	GaussSegEnum
++	GaussTetraEnum
++	GaussTriaEnum
++	GenericOptionEnum
++	GenericParamEnum
++	GenericExternalResultEnum
++	Gradient1Enum
++	Gradient2Enum
++	Gradient3Enum
++	Gradient4Enum
++	GroundedAreaEnum
++	GroundedAreaScaledEnum
++	GroundingOnlyEnum
++	GroundinglineMassFluxEnum
++	GsetEnum
++	GslEnum
++	HOApproximationEnum
++	HOFSApproximationEnum
++	HookEnum
++	HydrologyDCEfficientAnalysisEnum
++	HydrologyDCInefficientAnalysisEnum
++	HydrologyGlaDSAnalysisEnum
++	HydrologyGlaDSEnum
++	HydrologyPismAnalysisEnum
++	HydrologyShaktiAnalysisEnum
++	HydrologyShreveAnalysisEnum
++	HydrologySolutionEnum
++	HydrologydcEnum
++	HydrologypismEnum
++	HydrologyshaktiEnum
++	HydrologyshreveEnum
++	IceMassEnum
++	IceMassScaledEnum
++	IceVolumeAboveFloatationEnum
++	IceVolumeAboveFloatationScaledEnum
++	IceVolumeEnum
++	IceVolumeScaledEnum
++	IcefrontMassFluxEnum
++	IcefrontMassFluxLevelsetEnum
++	IncrementalEnum
++	IndexedEnum
++	IntExternalResultEnum
++	ElementInputEnum
++	IntMatExternalResultEnum
++	IntMatParamEnum
++	IntParamEnum
++	IntVecParamEnum
++	InputsEnum
++	InternalEnum
++	IntersectEnum
++	InversionVzObsEnum
++	JEnum
++	L1L2ApproximationEnum
++	MLHOApproximationEnum
++	L2ProjectionBaseAnalysisEnum
++	L2ProjectionEPLAnalysisEnum
++	LACrouzeixRaviartEnum
++	LATaylorHoodEnum
++	LambdaSEnum
++	LevelsetAnalysisEnum
++	LevelsetfunctionPicardEnum
++	LinearFloatingMeltRateEnum
++	LliboutryDuvalEnum
++	LoadsEnum
++	LoveAnalysisEnum
++	LoveHiEnum
++	LoveHrEnum
++	LoveKernelsImagEnum
++	LoveKernelsRealEnum
++	LoveKiEnum
++	LoveKrEnum
++	LoveLiEnum
++	LoveLrEnum
++	LoveSolutionEnum
++	MINIEnum
++	MINIcondensedEnum
++	MantlePlumeGeothermalFluxEnum
++	MassFluxEnum
++	MassconEnum
++	MassconaxpbyEnum
++	MassfluxatgateEnum
++	MasstransportAnalysisEnum
++	MasstransportSolutionEnum
++	MatdamageiceEnum
++	MatenhancediceEnum
++	MaterialsEnum
++	MatestarEnum
++	MaticeEnum
++	MatlithoEnum
++	MathydroEnum
++	MatrixParamEnum
++	MaxAbsVxEnum
++	MaxAbsVyEnum
++	MaxAbsVzEnum
++	MaxDivergenceEnum
++	MaxVelEnum
++	MaxVxEnum
++	MaxVyEnum
++	MaxVzEnum
++	MelangeEnum
++	MeltingAnalysisEnum
++	MeshElementsEnum
++	MeshXEnum
++	MeshYEnum
++	MinVelEnum
++	MinVxEnum
++	MinVyEnum
++	MinVzEnum
++	MismipFloatingMeltRateEnum
++	MoulinEnum
++	MpiDenseEnum
++	MpiEnum
++	MpiSparseEnum
++	MumpsEnum
++	NoFrictionOnPartiallyFloatingEnum
++	NoMeltOnPartiallyFloatingEnum
++	NodalEnum
++	NodalvalueEnum
++	NodeSIdEnum
++	NoneApproximationEnum
++	NoneEnum
++	NumberedcostfunctionEnum
++	NyeCO2Enum
++	NyeH2OEnum
++	NumericalfluxEnum
++	OceantransportAnalysisEnum
++	OceantransportSolutionEnum
++	OldGradientEnum
++	OneLayerP4zEnum
++	OpenEnum
++	OptionEnum
++	ParamEnum
++	ParametersEnum
++	P0ArrayEnum
++	P0DGEnum
++	P1DGEnum
++	P1P1Enum
++	P1P1GLSEnum
++	P1bubbleEnum
++	P1bubblecondensedEnum
++	P1xP2Enum
++	P1xP3Enum
++	P1xP4Enum
++	P2Enum
++	P2bubbleEnum
++	P2bubblecondensedEnum
++	P2xP1Enum
++	P2xP4Enum
++	PatersonEnum
++	PengridEnum
++	PenpairEnum
++	PentaEnum
++	PentaInputEnum
++	ProfilerEnum
++	ProfilingCurrentFlopsEnum
++	ProfilingCurrentMemEnum
++	ProfilingSolutionTimeEnum
++	RegionaloutputEnum
++	RegularEnum
++	RecoveryAnalysisEnum
++	RiftfrontEnum
++	SamplingAnalysisEnum
++	SamplingSolutionEnum
++	SIAApproximationEnum
++	SMBautoregressionEnum
++	SMBcomponentsEnum
++	SMBd18opddEnum
++	SMBforcingEnum
++	SMBgcmEnum
++	SMBgembEnum
++	SMBgradientsEnum
++	SMBgradientscomponentsEnum
++	SMBgradientselaEnum
++	SMBhenningEnum
++	SMBmeltcomponentsEnum
++	SMBpddEnum
++	SMBpddSicopolisEnum
++	SMBsemicEnum
++	SSAApproximationEnum
++	SSAFSApproximationEnum
++	SSAHOApproximationEnum
++	ScaledEnum
++	SealevelAbsoluteEnum
++	SealevelEmotionEnum
++	SealevelInertiaTensorXZEnum
++	SealevelInertiaTensorYZEnum
++	SealevelInertiaTensorZZEnum
++	SealevelchangePolarMotionEnum
++	SealevelNmotionEnum
++	SealevelUmotionEnum
++	SealevelchangeAnalysisEnum
++	SegEnum
++	SegInputEnum
++	SegmentEnum
++	SegmentRiftfrontEnum
++	SeparateEnum
++	SeqEnum
++	SmbAnalysisEnum
++	SmbSolutionEnum
++	SmoothAnalysisEnum
++	SoftMigrationEnum
++	SpatialLinearFloatingMeltRateEnum
++	SpcDynamicEnum
++	SpcStaticEnum
++	SpcTransientEnum
++	SsetEnum
++	StatisticsSolutionEnum
++	SteadystateSolutionEnum
++	StressIntensityFactorEnum
++	StressbalanceAnalysisEnum
++	StressbalanceConvergenceNumStepsEnum
++	StressbalanceSIAAnalysisEnum
++	StressbalanceSolutionEnum
++	StressbalanceVerticalAnalysisEnum
++	StringArrayParamEnum
++	StringExternalResultEnum
++	StringParamEnum
++	SubelementFriction1Enum
++	SubelementFriction2Enum
++	SubelementMelt1Enum
++	SubelementMelt2Enum
++	SubelementMigrationEnum
++	SurfaceSlopeSolutionEnum
++	TaylorHoodEnum
++	TetraEnum
++	TetraInputEnum
++	ThermalAnalysisEnum
++	ThermalSolutionEnum
++	ThicknessErrorEstimatorEnum
++	TotalCalvingFluxLevelsetEnum
++	TotalCalvingMeltingFluxLevelsetEnum
++	TotalFloatingBmbEnum
++	TotalFloatingBmbScaledEnum
++	TotalGroundedBmbEnum
++	TotalGroundedBmbScaledEnum
++	TotalSmbEnum
++	TotalSmbScaledEnum
++	TransientArrayParamEnum
++	TransientInputEnum
++	TransientParamEnum
++	TransientSolutionEnum
++	TriaEnum
++	TriaInputEnum
++	UzawaPressureAnalysisEnum
++	VectorParamEnum
++	VertexEnum
++	VertexLIdEnum
++	VertexPIdEnum
++	VertexSIdEnum
++	VerticesEnum
++	ViscousHeatingEnum
++	WaterEnum
++	XTaylorHoodEnum
++	XYEnum
++	XYZEnum
++	#}}}
++	MaximumNumberOfDefinitionsEnum
++end
++
++function EnumToString(enum::IssmEnum)
++
++	#Make dictionnary from enums
++	inst = instances(IssmEnum)
++	syms = Symbol.(inst)
++	enumdic = Dict(zip(inst, syms))
++
++	return enumdic[enum]
++end
++
++function EnumToString(enum::Int64)
++	return EnumToString(IssmEnum(enum))
++end
++
++function StringToEnum(string::String)
++
++	#Make dictionnary from enums
++	inst = instances(IssmEnum)
++	syms = Symbol.(inst)
++	enumdic = Dict(zip(syms, inst))
++
++	return enumdic[Symbol(string)]
++end
++
++function StringToEnumInt(string::String)
++	return Integer(StringToEnum(string))
++end
+Index: ../trunk-jpl/src/jl/parameterization.jl
+===================================================================
+--- ../trunk-jpl/src/jl/parameterization.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/parameterization.jl	(revision 26500)
+@@ -0,0 +1,55 @@
++include("issm.jl")
++include("exp.jl")
++
++# setmask {{{
++"""
++SETMASK - establish boundaries between grounded and floating ice.
++
++   By default, ice is considered grounded. The contour floatingicename defines nodes 
++   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
++   that are grounded (ie: ice rises, islands, etc ...)
++   All input files are in the Argus format (extension .exp).
++
++   Usage:
++      md=setmask(md,floatingicename,groundedicename)
++
++   Examples:
++      md=setmask(md,'all','');
++      md=setmask(md,'Iceshelves.exp','Islands.exp');
++"""
++function setmask(md::model,floatingicename::String,groundedicename::String)
++
++	elementonfloatingice = FlagElements( md, floatingicename);
++	elementongroundedice = FlagElements( md, groundedicename);
++
++	elementonfloatingice = convert( Array{Float64}, (elementonfloatingice.>0) .&  (elementongroundedice.==0.))
++	elementongroundedice = convert( Array{Float64}, elementonfloatingice.==0.)
++
++	vertexonfloatingice=zeros(md.mesh.numberofvertices)
++	vertexongroundedice=zeros(md.mesh.numberofvertices)
++
++	vertexongroundedice[md.mesh.elements[findall(elementongroundedice.>0),:]] .= 1.
++	vertexonfloatingice[findall(vertexongroundedice.==0.)] .= 1.
++
++	#define levelsets
++	md.mask.ocean_levelset = vertexongroundedice
++	md.mask.ocean_levelset[findall(vertexongroundedice .==0.)] .= -1.
++	md.mask.ice_levelset = -1*ones(md.mesh.numberofvertices)
++
++	return md
++end
++#}}}
++# FlagElements {{{
++function FlagElements(md::model,region::String)
++
++	if isempty(region)
++		flags = zeros(md.mesh.numberofelements)
++	elseif region == "all"
++		flags = ones(md.mesh.numberofelements)
++	else
++		flags = InContour(md.mesh.x,md.mesh.y,region);
++	end
++
++	return flags
++end
++#}}}
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26500)
+@@ -0,0 +1,38 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("triangle.jl")
++include("parameterization.jl")
++include("solve.jl")
++
++md = model()
++md = triangle(md,"../../test/Exp/Square.exp",180000.)
++md = setmask(md,"all","")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base .-10
++
++#Initial velocity
++x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
++md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++
++md.stressbalance.restol=0.05
++md.stressbalance.reltol=0.05
++md.stressbalance.abstol=NaN
++
++md=solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test101.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/triangle.jl	(revision 26499)
++++ ../trunk-jpl/src/jl/triangle.jl	(revision 26500)
+@@ -153,11 +153,10 @@
+ 
+ 	#Call triangle using ISSM's default options
+ 	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
+-	#rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
+-	rc=ccall( (:triangulate,"libtriangle"),
++	#rc=ccall( (:triangulate,"libtriangle"),
++	rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
+ 				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
+ 				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
+-	println("number of elements: ",ctio_out.numberoftriangles)
+ 
+ 	#post process output
+ 	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26499)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26500)
+@@ -60,6 +60,17 @@
+ function Initialization() #{{{
+ 	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+ end# }}}
++mutable struct Stressbalance
++	spcvx::Vector{Float64}
++	spcvy::Vector{Float64}
++	restol::Float64
++	reltol::Float64
++	abstol::Float64
++	maxiter::Int32
++end
++function Stressbalance() #{{{
++	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 0., 0., 0., 0)
++end# }}}
+ mutable struct Materials
+ 	rho_ice::Float64
+ 	rho_water::Float64
+@@ -88,9 +99,10 @@
+ 	mask::Mask
+ 	materials::Materials
+ 	initialization::Initialization
++	stressbalance::Stressbalance
+ end
+ function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization())
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance())
+ end#}}}
+ function Base.show(io::IO, md::model)# {{{
+ 
+@@ -102,6 +114,7 @@
+ 	@printf "%19s: %-22s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+ 	@printf "%19s: %-22s -- %s\n" "materials" typeof(md.materials) "material properties"
+ 	@printf "%19s: %-22s -- %s\n" "initialization" typeof(md.initialization) "initial state"
++	@printf "%19s: %-22s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
+ 
+ end# }}}
+ 
+@@ -142,6 +155,10 @@
+ 				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
+ 				data .= ntoh.(data)
+ 				data = reshape(data, (rows,cols))
++				data = collect(data)
++				if cols == 1
++					data = vec(data)
++				end
+ 			else
+ 				error("Error: Encountered invalid field type when reading data.")
+ 			end
+@@ -155,3 +172,57 @@
+ 
+ 	return output
+ end# }}}
++function InterpFromMeshToMesh2d(index::Array,x::Vector,y::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
++	#prepare input arrays
++	nods = Cint(length(x))
++	nels = Cint(size(index,1))
++	nods_interp = Cint(length(xout))
++	Cindex=Array{Cint,1}(undef,length(index))
++	for i in 1:size(index,1)
++		for j in 1:3
++			Cindex[(i-1)*3+j] = Int32(index[i,j])
++		end
++	end
++	Cx    = Array{Cdouble,1}(undef,nods)
++	Cy    = Array{Cdouble,1}(undef,nods)
++	Cdata = Array{Cdouble,1}(undef,nods)
++	for i in 1:nods
++		Cx[i]    = x[i]
++		Cy[i]    = y[i]
++		Cdata[i] = data[i]
++	end
++	Cxout = Array{Cdouble,1}(undef,nods_interp)
++	Cyout = Array{Cdouble,1}(undef,nods_interp)
++	for i in 1:nods_interp
++		Cxout[i] = xout[i]
++		Cyout[i] = yout[i]
++	end
++
++	Cdataout = Vector{Float64}(undef,nods_interp)
++
++	#This is not working....
++	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
++				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
++				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
++				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
++
++	#Process output
++	dataout = Vector{Float64}(undef,nods_interp)
++	for i in 1:nods_interp
++		dataout[i] = Cdataout[i]
++	end
++
++	return dataout
++end #}}}
++function solve(md::model,solution::String) #{{{
++
++	if solution=="sb" || solution=="Stressbalance"
++		solutionstring = "StressbalanceSolution"
++	else
++		error("solutionstring "*solution*" not supported!");
++	end
++
++	IssmCore(md)
++
++	return md
++end #}}}
+Index: ../trunk-jpl/src/jl/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve.jl	(revision 26500)
+@@ -0,0 +1,277 @@
++include("issm.jl")
++include("issmenums.jl")
++
++#define classes first
++abstract type Parameter end
++struct DoubleParam <: Parameter #{{{
++	enum::IssmEnum
++	value::Float64
++end# }}}
++struct IntParam <: Parameter #{{{
++	enum::IssmEnum
++	value::Int64
++end# }}}
++mutable struct Parameters #{{{
++	lookup::Dict{IssmEnum,Parameter}
++end# }}}
++function AddParam(parameters::Parameters,value::Float64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = DoubleParam(enum,value)
++
++end#}}}
++function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = IntParam(enum,value)
++
++end#}}}
++
++abstract type Input end
++struct BoolInput <: Input#{{{
++	enum::IssmEnum
++	values::Matrix{Bool}
++end# }}}
++struct IntInput <: Input#{{{
++	enum::IssmEnum
++	values::Matrix{Int32}
++end# }}}
++struct ElementInput <: Input#{{{
++	enum::IssmEnum
++	interp::IssmEnum
++	values::Vector{Float64}
++end# }}}
++mutable struct Inputs #{{{
++	numberofelements::Int32
++	numberofvertices::Int32
++	lookup::Dict{IssmEnum,Input}
++end# }}}
++function SetInput(inputs::Inputs,enum::IssmEnum,index::Int32,value::Bool) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofelements > 0
++		input = BoolInput(enum,zeros(Bool,inputs.numberofelements))
++		inputs.lookup[enum] = BoolInput(enum,zeros(Bool,inputs.numberofelements))
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=BoolInput error("not consistent") end
++
++	#set value
++	@assert index>0 && index<=inputs.numberofelements
++	input.values[index] = value
++end#}}}
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int32,value::Float64) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofelements > 0
++		if interp==P0Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements))
++		elseif interp==P1Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
++		else
++			error("not supported yet")
++		end
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=ElementInput error("input type not consistent") end
++	if interp!=input.interp        error("input interpolations not consistent") end
++
++	#set value
++	input.values[index] = value
++end#}}}
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int32},values::Vector{Float64}) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofvertices>0
++		if interp==P1Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
++		else
++			error("not supported yet")
++		end
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=ElementInput error("input type not consistent") end
++	if interp!=input.interp        error("input interpolations not consistent") end
++
++	#set value
++	input.values[indices] = values
++end#}}}
++
++mutable struct Node #{{{
++	id::Int32
++	sid::Int32
++	indexingupdate::Bool
++	gsize::Int32
++	gdoflist::Vector{Int32}
++	fdoflist::Vector{Int32}
++	sdoflist::Vector{Int32}
++	svalues::Vector{Float64}
++end# }}}
++struct Constraint #{{{
++	id::Int32
++	nodeid::Int32
++	dof::Int8
++	value::Float64
++end# }}}
++mutable struct Vertex#{{{
++	sid::Int32
++	x::Float64
++	y::Float64
++end# }}}
++mutable struct Tria #{{{
++	sid::Int32
++	pid::Int32
++	#vertexids::Int64[3]
++	#vertices::Vertex[3]
++	vertexids::Vector{Int32}
++	vertices::Vector{Vertex}
++	nodes::Vector{Node}
++	parameters::Parameters
++	inputs::Inputs
++end# }}}
++mutable struct FemModel #{{{
++	elements::Vector{Tria}
++	vertices::Vector{Vertex}
++	nodes::Vector{Node}
++	parameters::Vector{Parameter}
++	inputs::Inputs
++	constraints::Vector{Constraint}
++	#loads::Vector{Loads}
++end#}}}
++struct GaussTria #{{{
++	numgauss::Int32
++	weights::Vector{Float64}
++	coords1::Vector{Float64}
++	coords2::Vector{Float64}
++	coords3::Vector{Float64}
++end #}}}
++function GaussTria(order::Int32) #{{{
++
++	#=Gauss quadrature points for the triangle.
++	Higher-order points from D.A. Dunavant, "High Degree Efficient
++	Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
++	Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.=#
++
++	if(order==1)
++		npoints = 1
++		weights = [1.732050807568877]
++		coords1 = [0.333333333333333]
++		coords2 = [0.333333333333333]
++		coords3 = [0.333333333333333]
++	elseif(order==2)
++		weights = [0.577350269189625, 0.577350269189625, 0.577350269189625]
++		coords1 = [0.666666666666667, 0.166666666666667, 0.166666666666667]
++		coords2 = [0.166666666666667, 0.666666666666667, 0.166666666666667]
++		coords3 = [0.166666666666667, 0.166666666666667, 0.666666666666667]
++	elseif(order==3)
++		npoints=4
++		weights = [-0.974278579257493, 0.902109795608790, 0.902109795608790, 0.902109795608790]
++		coords1 = [0.333333333333333, 0.600000000000000, 0.200000000000000, 0.200000000000000]
++		coords2 = [0.333333333333333, 0.200000000000000, 0.600000000000000, 0.200000000000000]
++		coords3 = [0.333333333333333, 0.200000000000000, 0.200000000000000, 0.600000000000000]
++	else
++		error("order ",order," not supported yet");
++	end
++
++	return GaussTria(npoints,weights,coords1,coords2,coords3)
++end# }}}
++
++#Modules
++function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
++	for i in 1:length(elements)
++		InputCreate(elements[i],inputs,data,enum)
++	end
++end#}}}
++function IssmCore(md::model) #{{{
++	
++	#Construct FemModel
++	femmodel=ModelProcessor(md)
++
++	#Solve
++	Stressbalance(femmodel)
++
++	#then what??
++
++end# }}}
++function ModelProcessor(md::model) #{{{
++
++	#Initialize structures
++	elements   = Vector{Tria}(undef,0)
++	vertices   = Vector{Vertex}(undef,0)
++	parameters = Parameters(Dict{IssmEnum,Parameter}())
++	inputs     = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
++
++	#Create  elements, vertices and materials (independent of the analysis)
++	CreateElements(elements,md)
++	CreateVertices(vertices,md)
++	CreateParameters(parameters,md)
++	CreateInputs(inputs,elements,md)
++
++	#Now create analysis specific data structure
++	StressbalanceUpdateParameters(parameters,md)
++end# }}}
++function CreateElements(elements::Vector{Tria},md::model) #{{{
++
++	#Make sure elements is currently empty
++	@assert length(elements)==0
++
++	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
++	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
++	tempvertices = Vector{Vertex}(undef,0)
++	tempnodes    = Vector{Node}(undef,0)
++
++	count = 0
++	for i in 1:md.mesh.numberofelements
++		push!(elements,Tria(i,count,md.mesh.elements[i,:],tempvertices,tempnodes,tempparams,tempinputs))
++	end
++
++end# }}}
++function CreateVertices(vertices::Vector{Vertex},md::model) #{{{
++
++	#Make sure vertices is currently empty
++	@assert length(vertices)==0
++
++	#Get data from md
++	x = md.mesh.x
++	y = md.mesh.y
++
++	count = 0
++	for i in 1:md.mesh.numberofvertices
++		push!(vertices,Vertex(i,x[i],y[i]))
++	end
++
++end# }}}
++function CreateParameters(parameters::Parameters,md::model) #{{{
++
++	#Get data from md
++	AddParam(parameters,md.materials.rho_ice,MaterialsRhoIceEnum)
++	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
++	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
++end# }}}
++function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
++
++	#Only assume we have Matice for now
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum);
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum);
++end# }}}
++
++#Element functions
++function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
++	if size(data,1)==inputs.numberofelements
++		SetTriaInput(inputs,enum,P0Enum,element.sid,data[element.sid])
++	elseif size(data,1)==inputs.numberofvertices
++		SetTriaInput(inputs,enum,P1Enum,element.vertexids,data[element.vertexids])
++	else
++		error("size ",size(data,1)," not supported yet");
++	end
++end #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26500-26501.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26500-26501.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26500-26501.diff	(revision 26740)
@@ -0,0 +1,416 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26500)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26501)
+@@ -342,6 +342,7 @@
+ 		virtual int        NumberofNodesVelocity(void)=0;
+ 		virtual void       PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
+ 		virtual int        PressureInterpolation()=0;
++      virtual void       Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){_error_("not implemented yet");};
+ 		virtual void       ReduceMatrices(ElementMatrix* Ke,ElementVector* pe)=0;
+ 		virtual void       ResetFSBasalBoundaryCondition()=0;
+ 		virtual void       ResetHooks()=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26500)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26501)
+@@ -167,6 +167,7 @@
+ 		int            NumberofNodesVelocity(void);
+ 		void           PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
+ 		int            PressureInterpolation();
++      void           Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s);
+ 		void           ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
+ 		void           ResetFSBasalBoundaryCondition(void);
+ 		void           ResetHooks();
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26500)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26501)
+@@ -787,10 +787,15 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxEnum,0.);
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum,0.);
++	/*MLHO*/
+ 	if(isMLHO){
+-		/*itapopo FIXME applying the same initialization for shear vx and shear vy for now*/
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxShearEnum,0.);
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyShearEnum,0.);
++		/*3D MLHO also need to have VxBase and VyBase for reconstruting Vx and Vy*/
++		if (iomodel->domaintype==Domain3DEnum) {
++			iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
++			iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyBaseEnum,0.);
++		}
+ 	}
+    if(iomodel->domaintype==Domain2DhorizontalEnum){
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.vx",VxBaseEnum,0.);
+@@ -2753,16 +2758,33 @@
+ /*MLHO*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/
+ 
+-	//_error_("Mono Layer Higher-Order called, not fully tested. If you are sure of using it, comment this line.");
+-
+ 	/* Check if ice in element */
+ 	if(!element->IsIceInElement()) return NULL;
++
++	/*Intermediaries*/
++	int      domaintype;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			break;
++		case Domain3DEnum: 
++			if(!element->IsOnBase()) return NULL;
++			basalelement = element->SpawnBasalElement(true);
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
+ 	/*compute all stiffness matrices for this element*/
+-	ElementMatrix* Ke1=CreateKMatrixMLHOViscous(element);
+-	ElementMatrix* Ke2=CreateKMatrixMLHOFriction(element);
++	ElementMatrix* Ke1=CreateKMatrixMLHOViscous(basalelement);
++	ElementMatrix* Ke2=CreateKMatrixMLHOFriction(basalelement);
+ 	ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
+ 
+ 	/*clean-up and return*/
++	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete Ke1;
+ 	delete Ke2;
+ 	return Ke;
+@@ -2848,80 +2870,23 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	return Ke;
+-
+-	//itapopo OLD - testing above
+-	/*Intermediaries*/
+-	//int      domaintype;
+-   Element* basalelement;
+-
+-   /*Get basal element*/
+-   element->FindParam(&domaintype,DomainTypeEnum);
+-   switch(domaintype){
+-      case Domain2DhorizontalEnum:
+-         basalelement = element;
+-         break;
+-      case Domain3DEnum: case Domain2DverticalEnum:
+-          _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-			//basalelement = element->SpawnBasalElement();
+-         break;
+-      default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-   }
+-
+-	//Element* basalelement = element->SpawnBasalElement();
+-	//ElementMatrix* Ke    = basalelement->NewElementMatrix(MLHOApproximationEnum);
+-	ElementMatrix* KeSSA = CreateKMatrixSSAFriction(basalelement); //only to get K11 and K33
+-
+-	/*Fetch number of nodes and dof for this finite element*/
+-	//int numnodes = basalelement->GetNumberOfNodes();
+-
+-	for(int i=0;i<numnodes;i++){
+-      for(int j=0;j<numnodes;j++){
+-         Ke->values[(4*i+0)*2*2*numnodes+4*j+0] = KeSSA->values[2*i*2*numnodes+2*j]; //K11
+-         Ke->values[(4*i+2)*2*2*numnodes+4*j+2] = KeSSA->values[(2*i+1)*2*numnodes+2*j+1]; //K33
+-      }  
+-   }
+-
+-	KeSSA->Echo();
+-	Ke->Echo();
+-	_error_("mesh ");
+-
+-	/*Transform Coordinate System*/
+-	//basalelement->TransformStiffnessMatrixCoord(Ke,XYMLHOEnum);
+-
+-	/*clean-up and return*/
+-	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+-	delete KeSSA;
+-	return Ke;
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOViscous(Element* element){/*{{{*/
+ 
++	/* Check if ice in element */
++	if(!element->IsIceInElement()) return NULL;
++
+ 	/*Intermediaries*/
+ 	IssmDouble  viscosity[4],Jdet,thickness,n;
+ 	IssmDouble *xyz_list = NULL;
+ 	int      domaintype;
+-	Element* basalelement;
++	int dim=2;
+ 
+-	/*Get basal element*/
+-	element->FindParam(&domaintype,DomainTypeEnum);
+-	switch(domaintype){
+-		case Domain2DhorizontalEnum:
+-			basalelement = element;
+-			break;
+-		case Domain3DEnum: case Domain2DverticalEnum:
+-			_error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-			//basalelement = element->GetBasalElement()->SpawnBasalElement(true);
+-			break;
+-		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-	}
+-
+-	/*Get element on base*/
+-	//Element* basalelement = element->GetBasalElement()->SpawnBasalElement(true);
+-
+ 	/*Fetch number of nodes and dof for this finite element*/
+-	int numnodes = basalelement->GetNumberOfNodes();
++	int numnodes = element->GetNumberOfNodes();
+ 
+ 	/*Initialize Element matrix and vectors*/
+-	ElementMatrix* Ke     = basalelement->NewElementMatrix(MLHOApproximationEnum);
++	ElementMatrix* Ke     = element->NewElementMatrix(MLHOApproximationEnum);
+ 	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes); // like SSA
+ 	IssmDouble*    basis  = xNew<IssmDouble>(numnodes); // like SSA
+ 
+@@ -2929,8 +2894,6 @@
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	Input* thickness_input= element->GetInput(ThicknessEnum); _assert_(thickness_input);
+ 	Input* surface_input  = element->GetInput(SurfaceEnum);   _assert_(surface_input);
+-	//Input* vx_input       = element->GetInput(VxEnum);        _assert_(vx_input); //vertically integrated vx
+-	//Input* vy_input       = element->GetInput(VyEnum);        _assert_(vy_input); //vertically integrated vy
+ 	Input* vxbase_input   = element->GetInput(VxBaseEnum);    _assert_(vxbase_input); 
+ 	Input* vybase_input   = element->GetInput(VyBaseEnum);    _assert_(vybase_input);
+ 	Input* vxshear_input  = element->GetInput(VxShearEnum);   _assert_(vxshear_input); //shear vx at the surface 
+@@ -2939,17 +2902,14 @@
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss      = element->NewGauss(2);
+-	Gauss* gauss_base = basalelement->NewGauss();
+ 	while(gauss->next()){
+-		gauss->SynchronizeGaussBase(gauss_base);
+ 
+-		element->JacobianDeterminant(&Jdet,xyz_list,gauss_base);
+-		basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss_base);
+-		basalelement->NodalFunctions(basis, gauss_base);
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++		element->NodalFunctions(basis, gauss);
+ 
+ 		thickness_input->GetInputValue(&thickness, gauss);
+ 		n_input->GetInputValue(&n,gauss);
+-		int dim=2;//itapopo
+ 		element->material->ViscosityMLHO(&viscosity[0],dim,xyz_list,gauss,vxbase_input,vybase_input,vxshear_input,vyshear_input,thickness_input,n_input);
+ 
+ 		for(int i=0;i<numnodes;i++){//shape functions on tria element
+@@ -3020,8 +2980,6 @@
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
+-	delete gauss_base;
+-	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(dbasis);
+ 	xDelete<IssmDouble>(basis);
+@@ -3195,19 +3153,23 @@
+ 	IssmDouble* thickness = xNew<IssmDouble>(numvertices);
+ 	IssmDouble* surface   = xNew<IssmDouble>(numvertices);
+ 
+-	element->FindParam(&dim,DomainDimensionEnum);
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+ 	rho_ice =element->FindParam(MaterialsRhoIceEnum);
+ 	g       =element->FindParam(ConstantsGEnum);
+-	if(dim==2){
+-		element->GetInputListOnVertices(thickness,ThicknessEnum);
+-		for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*thickness[i];
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			element->GetInputListOnVertices(thickness,ThicknessEnum);
++			for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*thickness[i];
++			dim=2;
++			break;
++		case Domain3DEnum:
++			element->GetVerticesCoordinates(&xyz_list);
++			element->GetInputListOnVertices(surface,SurfaceEnum);
++			for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i*3+2]);
++			dim=2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+-	else{
+-		element->GetVerticesCoordinates(&xyz_list);
+-		element->GetInputListOnVertices(surface,SurfaceEnum);
+-		for(i=0;i<numvertices;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i*3+2]);
+-	}
+ 	element->AddInput(PressureEnum,pressure,P1Enum);
+ 	xDelete<IssmDouble>(pressure);
+ 	xDelete<IssmDouble>(thickness);
+@@ -3216,24 +3178,21 @@
+ 	/*Get basal element*/
+ 	switch(domaintype){
+ 		case Domain2DhorizontalEnum:
+-			// itapopo FIXME use basalelement or element only here
+ 			basalelement = element;
+ 			break;
+ 		case Domain3DEnum:
+-			_error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-			//if(!element->IsOnBase()){xDelete<IssmDouble>(xyz_list); return;}
+-			//basalelement=element->SpawnBasalElement();
+-			//break;
++			if(!element->IsOnBase()){xDelete<IssmDouble>(xyz_list); return;}
++			basalelement=element->SpawnBasalElement();
++			break;
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+-	int numdof   = numnodes*4; //4 DOFs per node
++	int numdof   = numnodes*dim*2; //2xdim DOFs per node
+ 
+ 	/*Fetch dof list and allocate solution vectors*/
+ 	basalelement->GetDofListLocal(&doflist,MLHOApproximationEnum,GsetEnum); 
+-	//basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+ 	IssmDouble* values    = xNew<IssmDouble>(numdof);
+ 	IssmDouble* vbx       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vby       = xNew<IssmDouble>(numnodes);
+@@ -3246,18 +3205,14 @@
+ 	IssmDouble* vz        = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* vel       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* n			 = xNew<IssmDouble>(numnodes);
++	IssmDouble* H			 = xNew<IssmDouble>(numnodes);
++	IssmDouble* s			 = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Use the dof list to index into the solution vector: */
+ 	for(i=0;i<numdof;i++) values[i]=solution[doflist[i]];
+ 
+-	//std::cout<<"MLHO  ********  Element ID="<<element->Id()<<"\n";
+-	//for(i=0;i<numdof;i++){
+-	//	std::cout<<values[i]*31536000<<"\n";
+-	//}
+-
+ 	/*Transform solution in Cartesian Space*/
+-	basalelement->TransformSolutionCoord(&values[0],XYEnum);
+-	//basalelement->FindParam(&domaintype,DomainTypeEnum);
++	if(dim==2) basalelement->TransformSolutionCoord(&values[0],XYEnum);
+ 
+    /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
+    for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+@@ -3291,19 +3246,29 @@
+ 
+ 	/*Compute the vertically averaged velocities on each node*/
+ 	basalelement->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum,0.); 
+-   for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
+-		vx[i]=vbx[i]+vshx[i]*(n[i]+1)/(n[i]+2);
+-		vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2);
+-	}
+ 
+-	/*Get Vz and compute vel (vertically averaged vel)*/
+-	basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.); 
+-	for(i=0;i<numnodes;i++) vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i] + vz[i]*vz[i]); 
++	/* Reconstruct vx, vy and vz solutions for 3D problem
++	 * Add vx and vy as inputs to the tria element (vertically averaged velocities): */
+ 
+-	/*Add vx and vy as inputs to the tria element (vertically averaged velocities): */
+-	element->AddBasalInput(VxEnum,vx,element->GetElementType());
+-	element->AddBasalInput(VyEnum,vy,element->GetElementType());
+-	element->AddBasalInput(VelEnum,vel,element->GetElementType()); 
++   switch(domaintype){
++      case Domain2DhorizontalEnum:
++			for(i=0;i<numnodes;i++){ //numnodes of the 2D mesh in which the MLHO is written
++				vx[i]=vbx[i]+vshx[i]*(n[i]+1)/(n[i]+2);
++				vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2);
++				vel[i]=sqrt(vx[i]*vx[i] + vy[i]*vy[i]); 
++			}
++			element->AddBasalInput(VxEnum,vx,element->GetElementType());
++			element->AddBasalInput(VyEnum,vy,element->GetElementType());
++			element->AddBasalInput(VelEnum,vel,element->GetElementType()); 
++         break;
++      case Domain3DEnum:
++		   basalelement->GetInputListOnNodes(&H[0],ThicknessEnum,0.);
++		   basalelement->GetInputListOnNodes(&s[0],SurfaceEnum,0.);
++			element->Recover3DMLHOInput(VxEnum, numnodes, vbx, vshx, n, H, s);
++			element->Recover3DMLHOInput(VyEnum, numnodes, vby, vshy, n, H, s);
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
+ 
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(vel);
+@@ -3319,6 +3284,8 @@
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(n);
++	xDelete<IssmDouble>(s);
++	xDelete<IssmDouble>(H);
+ 	xDelete<int>(doflist);
+ 	if(basalelement->IsSpawnedElement()){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+@@ -3332,7 +3299,8 @@
+ 	element->FindParam(&domaintype,DomainTypeEnum);
+ 	switch(domaintype){
+ 		case Domain2DhorizontalEnum: dim = 2; dofpernode = 4; break;
+-		case Domain2DverticalEnum: case Domain3DEnum: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); break;
++		case Domain3DEnum: dim = 2; dofpernode = 4; break;
++		case Domain2DverticalEnum: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); break;
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+ 
+@@ -3360,12 +3328,12 @@
+ 		/*Recover vx and vy*/
+ 		vxbase_input->GetInputValue(&vbx,gauss);	//base vx
+ 		vxshear_input->GetInputValue(&vshx,gauss);//shear vx
+-		values[i*4+0]=vbx;  //base vx
+-		values[i*4+1]=vshx; //shear vx
++		values[i*dofpernode+0]=vbx;  //base vx
++		values[i*dofpernode+1]=vshx; //shear vx
+ 		vybase_input->GetInputValue(&vby,gauss);	//base vy
+ 		vyshear_input->GetInputValue(&vshy,gauss);//shear vy
+-		values[i*4+2]=vby; //base vy
+-		values[i*4+3]=vshy;//shear vy  
++		values[i*dofpernode+2]=vby; //base vy
++		values[i*dofpernode+3]=vshy;//shear vy  
+ 	}
+ 
+ 	solution->SetValues(numdof,doflist,values,INS_VAL);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26500)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26501)
+@@ -181,6 +181,41 @@
+ 
+ }
+ /*}}}*/
++void       Penta::Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){/*{{{*/
++   /* Recover the velocity acording to v=vb+(1-\zeta^{n+1})vsh, where \zeta=(s-z)/H
++    * The variables vb, vsh, n, H and s are all from the 2D horizontal mesh(Tria), with "numnodes" DOFs
++    * To project to penta the DOFs are doubled in size
++    *
++    */
++   _assert_(this->inputs);
++   if(!IsOnBase()) return;
++   else{
++      if(targetVel_enum==VxEnum || targetVel_enum==VyEnum){
++         IssmDouble vel[NUMVERTICES];
++         IssmDouble* xyz_list;
++         Penta* penta = this;
++         _assert_(NUMVERTICES-2*numnodes==0);
++
++         for(;;){
++            penta->GetVerticesCoordinates(&xyz_list);
++            for(int i=0;i<numnodes;i++) {
++               vel[i] = vb[i] + vsh[i]*(1.0-pow((s[i]-xyz_list[i*3+2])/H[i], (n[i]+1)));
++               vel[i+NUMVERTICES2D] = vb[i] + vsh[i]*(1-pow((s[i]-xyz_list[(i+NUMVERTICES2D)*3+2])/H[i], (n[i]+1)));
++            }
++
++            /*Add to the bottom side of the element*/
++            penta->AddInput(targetVel_enum,&vel[0],P1Enum);
++            if (penta->IsOnSurface()) break;
++            penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id);
++         }
++
++         xDelete<IssmDouble>(xyz_list);
++      }
++      else _error_("not implemented yet");
++   }
++
++}
++/*}}}*/
+ void       Penta::AddInput(int input_enum,IssmDouble* values, int interpolation_enum){/*{{{*/
+ 
+ 	/**/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26501-26502.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26501-26502.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26501-26502.diff	(revision 26740)
@@ -0,0 +1,82 @@
+Index: ../trunk-jpl/test/NightlyRun/test335.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test335.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test335.m	(revision 26502)
+@@ -0,0 +1,28 @@
++%Test Name: SquareSheetConstrainedStressMLHO3d
++md=triangle(model(),'../Exp/Square.exp',200000.);
++md=setmask(md,'','');
++md=parameterize(md,'../Par/SquareSheetConstrained.par');
++md=setflowequation(md,'MLHO','all');
++md = extrude(md, 5, 1);
++md.cluster=generic('name',oshostname(),'np',3);
++md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=solve(md,'Stressbalance');
++
++%Fields and tolerances to track changes
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.StressbalanceSolution.Vx),...
++	(md.results.StressbalanceSolution.Vy),...
++	(md.results.StressbalanceSolution.Vz),...
++	(md.results.StressbalanceSolution.Vel),...
++	(md.results.StressbalanceSolution.Pressure),...
++	(md.results.StressbalanceSolution.VxSurface),...
++	(md.results.StressbalanceSolution.VySurface),...
++	(md.results.StressbalanceSolution.VxShear),...
++	(md.results.StressbalanceSolution.VyShear),...
++	(md.results.StressbalanceSolution.VxBase),...
++	(md.results.StressbalanceSolution.VyBase),...
++	};
++
+Index: ../trunk-jpl/test/NightlyRun/test335.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test335.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test335.py	(revision 26502)
+@@ -0,0 +1,33 @@
++#Test Name: SquareSheetConstrainedStressMLHO2d
++from model import *
++from socket import gethostname
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 200000.)
++md = setmask(md, '', '')
++md = parameterize(md, '../Par/SquareSheetConstrained.py')
++md = setflowequation(md, 'MLHO', 'all')
++md.extrude(5, 1.)
++md.cluster = generic('name', gethostname(), 'np', 3)
++md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = solve(md, 'Stressbalance')
++
++#Fields and tolerances to track changes
++field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++field_values = [md.results.StressbalanceSolution.Vx,
++                md.results.StressbalanceSolution.Vy,
++                md.results.StressbalanceSolution.Vz,
++                md.results.StressbalanceSolution.Vel,
++                md.results.StressbalanceSolution.Pressure,
++                md.results.StressbalanceSolution.VxSurface,
++                md.results.StressbalanceSolution.VySurface,
++                md.results.StressbalanceSolution.VxShear,
++                md.results.StressbalanceSolution.VyShear,
++                md.results.StressbalanceSolution.VxBase,
++                md.results.StressbalanceSolution.VyBase]
+Index: ../trunk-jpl/test/Archives/Archive335.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive335.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26502-26503.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26502-26503.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26502-26503.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26502)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26503)
+@@ -2791,7 +2791,7 @@
+ }/*}}}*/
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHOFriction(Element* element){/*{{{*/
+ 
+-	if(!element->IsOnBase() || element->IsAllFloating()) return NULL;
++	if(element->IsAllFloating()) return NULL;
+ 
+ 	/*Intermediaries*/
+ 	int         dim,domaintype;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26502)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26503)
+@@ -192,7 +192,7 @@
+    else{
+       if(targetVel_enum==VxEnum || targetVel_enum==VyEnum){
+          IssmDouble vel[NUMVERTICES];
+-         IssmDouble* xyz_list;
++         IssmDouble* xyz_list = NULL;
+          Penta* penta = this;
+          _assert_(NUMVERTICES-2*numnodes==0);
+ 
+@@ -202,6 +202,7 @@
+                vel[i] = vb[i] + vsh[i]*(1.0-pow((s[i]-xyz_list[i*3+2])/H[i], (n[i]+1)));
+                vel[i+NUMVERTICES2D] = vb[i] + vsh[i]*(1-pow((s[i]-xyz_list[(i+NUMVERTICES2D)*3+2])/H[i], (n[i]+1)));
+             }
++				xDelete<IssmDouble>(xyz_list);
+ 
+             /*Add to the bottom side of the element*/
+             penta->AddInput(targetVel_enum,&vel[0],P1Enum);
+@@ -208,8 +209,6 @@
+             if (penta->IsOnSurface()) break;
+             penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id);
+          }
+-
+-         xDelete<IssmDouble>(xyz_list);
+       }
+       else _error_("not implemented yet");
+    }
Index: /issm/oecreview/Archive/25834-26739/ISSM-26503-26504.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26503-26504.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26503-26504.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive335.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26504-26505.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26504-26505.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26504-26505.diff	(revision 26740)
@@ -0,0 +1,14290 @@
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/autoload/LaTeXtoUnicode.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/autoload/LaTeXtoUnicode.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/autoload/LaTeXtoUnicode.vim	(revision 26505)
+@@ -0,0 +1,755 @@
++""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++" Support for LaTex-to-Unicode conversion as in the Julia REPL "
++""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++
++function! s:L2U_Setup()
++
++  call s:L2U_SetupGlobal()
++
++  " Keep track of whether LaTeX-to-Unicode is activated
++  " (used when filetype changes)
++  let b:l2u_enabled = get(b:, "l2u_enabled", 0)
++  let b:l2u_autodetect_enable = get(b:, "l2u_autodetect_enable", 1)
++
++  " Did we install the L2U tab/as-you-type/keymap... mappings?
++  let b:l2u_tab_set = get(b:, "l2u_tab_set", 0)
++  let b:l2u_cmdtab_set = get(b:, "l2u_cmdtab_set", 0)
++  let b:l2u_autosub_set = get(b:, "l2u_autosub_set", 0)
++  let b:l2u_keymap_set = get(b:, "l2u_keymap_set", 0)
++
++  " Following are some flags used to pass information between the function which
++  " attempts the LaTeX-to-Unicode completion and the fallback function
++
++  " Was a (possibly partial) completion found?
++  let b:l2u_found_completion = 0
++  " Is the cursor just after a single backslash
++  let b:l2u_singlebslash = 0
++  " Are we in the middle of a L2U tab completion?
++  let b:l2u_tab_completing = 0
++  " Are we calling the tab fallback?
++  let b:l2u_in_fallback = 0
++
++endfunction
++
++function! s:L2U_SetupGlobal()
++
++  " Initialization of global and script-local variables
++  " is only performed once
++  if get(g:, "l2u_did_global_setup", 0)
++    return
++  endif
++
++  let g:l2u_did_global_setup = 1
++
++  let g:l2u_symbols_dict = julia_latex_symbols#get_dict()
++
++  call s:L2U_deprecated_options()
++
++  if v:version < 704
++      let g:latex_to_unicode_tab = "off"
++      let g:latex_to_unicode_auto = 0
++  endif
++
++  " YouCompleteMe and neocomplcache/neocomplete/deoplete plug-ins do not work well
++  " with LaTeX symbols suggestions
++  if exists("g:loaded_youcompleteme") ||
++        \ exists("g:loaded_neocomplcache") ||
++        \ exists("g:loaded_neocomplete") ||
++        \ exists("g:loaded_deoplete")
++    let g:latex_to_unicode_suggestions = 0
++  endif
++
++  " Forcibly get out of completion mode: feed
++  " this string with feedkeys(s:l2u_esc_sequence, 'n')
++  let s:l2u_esc_sequence = " \b"
++
++  " Trigger for the previous mapping of <Tab>
++  let s:l2u_fallback_trigger = "\u0091L2UFallbackTab"
++
++  " Trigger for the previous mapping of <CR>
++  let s:l2u_fallback_trigger_cr = "\u0091L2UFallbackCR"
++
++endfunction
++
++" Each time the filetype changes, we may need to enable or
++" disable the LaTeX-to-Unicode functionality
++function! LaTeXtoUnicode#Refresh()
++  call s:L2U_Setup()
++
++  " skip if manually overridden
++  if !b:l2u_autodetect_enable
++    return ''
++  endif
++
++  " by default, LaTeX-to-Unicode is only active on julia files
++  let file_types = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types", "julia"))
++  let file_types_blacklist = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types_blacklist", "$^"))
++
++  if match(&filetype, file_types) < 0 || match(&filetype, file_types_blacklist) >= 0
++    if b:l2u_enabled
++      call LaTeXtoUnicode#Disable(1)
++    else
++      return ''
++    endif
++  elseif !b:l2u_enabled
++    call LaTeXtoUnicode#Enable(1)
++  endif
++endfunction
++
++function! LaTeXtoUnicode#Enable(...)
++  let auto_set = a:0 > 0 ? a:1 : 0
++
++  if b:l2u_enabled
++    return ''
++  end
++
++  call s:L2U_ResetLastCompletionInfo()
++
++  let b:l2u_enabled = 1
++  let b:l2u_autodetect_enable = auto_set
++
++  " If we're editing the first file upon opening vim, this will only init the
++  " command line mode mapping, and the full initialization will be performed by
++  " the autocmd triggered by InsertEnter, defined in /ftdetect.vim.
++  " Otherwise, if we're opening a file from within a running vim session, this
++  " will actually initialize all the LaTeX-to-Unicode substitutions.
++  call LaTeXtoUnicode#Init()
++  return ''
++endfunction
++
++function! LaTeXtoUnicode#Disable(...)
++  let auto_set = a:0 > 0 ? a:1 : 0
++  if !b:l2u_enabled
++    return ''
++  endif
++  let b:l2u_enabled = 0
++  let b:l2u_autodetect_enable = auto_set
++  call LaTeXtoUnicode#Init()
++  return ''
++endfunction
++
++" Translate old options to their new equivalents
++function! s:L2U_deprecated_options()
++  for [new, old] in [["latex_to_unicode_tab",         "julia_latex_to_unicode"],
++                 \   ["latex_to_unicode_auto",        "julia_auto_latex_to_unicode"],
++                 \   ["latex_to_unicode_suggestions", "julia_latex_suggestions_enabled"],
++                 \   ["latex_to_unicode_eager",       "julia_latex_to_unicode_eager"]]
++    if !has_key(g:, new) && has_key(g:, old)
++      exec "let g:" . new . " = g:" . old
++    endif
++  endfor
++
++  if has_key(g:, "latex_to_unicode_tab")
++    if g:latex_to_unicode_tab is# 1
++      let g:latex_to_unicode_tab = "on"
++    elseif g:latex_to_unicode_tab is# 0
++      let g:latex_to_unicode_tab = "off"
++    endif
++  endif
++endfunction
++
++function! s:L2U_file_type_regex(ft)
++  if type(a:ft) == 3
++    let file_types = "\\%(" . join(a:ft, "\\|") . "\\)"
++  elseif type(a:ft) == 1
++    let file_types = a:ft
++  else
++    echoerr "invalid file_type specification"
++  endif
++  return "^" . file_types . "$"
++endfunction
++
++" Some data used to keep track of the previous completion attempt.
++" Used to detect
++" 1) if we just attempted the same completion, or
++" 2) if backspace was just pressed while completing
++" This function initializes and resets the required info
++
++function! s:L2U_ResetLastCompletionInfo()
++  let b:l2u_completed_once = 0
++  let b:l2u_bs_while_completing = 0
++  let b:l2u_last_compl = {
++        \ 'line': '',
++        \ 'col0': -1,
++        \ 'col1': -1,
++        \ }
++endfunction
++
++" This function only detects whether an exact match is found for a LaTeX
++" symbol in front of the cursor
++function! s:L2U_ismatch()
++  let col1 = col('.')
++  let l = getline('.')
++  let col0 = match(l[0:col1-2], '\\[^[:space:]\\]\+$')
++  if col0 == -1
++    return 0
++  endif
++  let base = l[col0:col1-2]
++  return has_key(g:l2u_symbols_dict, base)
++endfunction
++
++" Helper function to sort suggestion entries
++function! s:L2U_partmatches_sort(p1, p2)
++  return a:p1.word > a:p2.word ? 1 : a:p1.word < a:p2.word ? -1 : 0
++endfunction
++
++" Helper function to fix display of Unicode compose characters
++" in the suggestions menu (they are displayed on top of '◌')
++function! s:L2U_fix_compose_chars(uni)
++  let u = matchstr(a:uni, '^.')
++  let isc = ("\u0300" <= u && u <= "\u036F") ||
++          \ ("\u1DC0" <= u && u <= "\u1DFF") ||
++          \ ("\u20D0" <= u && u <= "\u20FF") ||
++          \ ("\uFE20" <= u && u <= "\uFE2F")
++  return isc ? "\u25CC" . a:uni : a:uni
++endfunction
++
++" Helper function to find the longest common prefix among
++" partial completion matches (used when suggestions are disabled
++" and in command line mode)
++function! s:L2U_longest_common_prefix(partmatches)
++  let common = a:partmatches[0]
++  for i in range(1, len(a:partmatches)-1)
++    let p = a:partmatches[i]
++    if len(p) < len(common)
++      let common = common[0 : len(p)-1]
++    endif
++    for j in range(1, len(common)-1)
++      if p[j] != common[j]
++        let common = common[0 : j-1]
++        break
++      endif
++    endfor
++  endfor
++  return common
++endfunction
++
++" Completion function. Besides the usual two-stage completefunc behaviour,
++" it has the following peculiar features:
++"  *) keeps track of the previous completion attempt
++"  *) sets some info to be used by the fallback function
++"  *) either returns a list of completions if a partial match is found, or a
++"     Unicode char if an exact match is found
++"  *) forces its way out of completion mode through a hack in some cases
++function! LaTeXtoUnicode#completefunc(findstart, base)
++  if a:findstart
++    " first stage
++    " avoid infinite loop if the fallback happens to call completion
++    if b:l2u_in_fallback
++      let b:l2u_in_fallback = 0
++      return -3
++    endif
++    " make sure that the options are still set
++    " (it may happen that <C-X><C-U> itself triggers the fallback before
++    " restarting, thus reseetting them; this happens when the prompt is
++    " waiting for ^U^N^P during a partial completion)
++    call s:L2U_SetCompleteopt()
++    " setup the cleanup/fallback operations when we're done
++    call s:L2U_InsertCompleteDoneAutocommand()
++    call s:L2U_InsertInsertLeaveAutocommand()
++    " set info for the callback
++    let b:l2u_found_completion = 1
++    " analyse current line
++    let col1 = col('.')
++    let l = getline('.')
++    let col0 = match(l[0:col1-2], '\\[^[:space:]\\]\+$')
++    " compare with previous completion attempt
++    let b:l2u_bs_while_completing = 0
++    let b:l2u_completed_once = 0
++    if col0 == b:l2u_last_compl['col0']
++      let prevl = b:l2u_last_compl['line']
++      if col1 == b:l2u_last_compl['col1'] && l ==# prevl
++        let b:l2u_completed_once = 1
++      elseif col1 == b:l2u_last_compl['col1'] - 1 && l ==# prevl[0 : col1-2] . prevl[col1 : -1]
++        let b:l2u_bs_while_completing = 1
++      endif
++    endif
++    " store completion info for next attempt
++    let b:l2u_last_compl['col0'] = col0
++    let b:l2u_last_compl['col1'] = col1
++    let b:l2u_last_compl['line'] = l
++    " is the cursor right after a backslash?
++    let b:l2u_singlebslash = (match(l[0:col1-2], '\\$') >= 0)
++    " completion not found
++    if col0 == -1
++      let b:l2u_found_completion = 0
++      call feedkeys(s:l2u_esc_sequence, 'n')
++      let col0 = -2
++    endif
++    return col0
++  else
++    " read settings (eager mode is implicit when suggestions are disabled)
++    let suggestions = get(g:, "latex_to_unicode_suggestions", 1)
++    let eager = get(g:, "latex_to_unicode_eager", 1) || !suggestions
++    " search for matches
++    let partmatches = []
++    let exact_match = 0
++    for k in keys(g:l2u_symbols_dict)
++      if k ==# a:base
++        let exact_match = 1
++      endif
++      if len(k) >= len(a:base) && k[0 : len(a:base)-1] ==# a:base
++        let menu = s:L2U_fix_compose_chars(g:l2u_symbols_dict[k])
++        if suggestions
++          call add(partmatches, {'word': k, 'menu': menu})
++        else
++          call add(partmatches, k)
++        endif
++      endif
++    endfor
++    " exact matches are replaced with Unicode
++    " exceptions:
++    "  *) we reached an exact match by pressing backspace while completing
++    "  *) the exact match is one among many, and the eager setting is
++    "     disabled, and it's the first time this completion is attempted
++    if exact_match && !b:l2u_bs_while_completing && (len(partmatches) == 1 || eager || b:l2u_completed_once)
++      " the completion is successful: reset the last completion info...
++      call s:L2U_ResetLastCompletionInfo()
++      " ...force our way out of completion mode...
++      call feedkeys(s:l2u_esc_sequence, 'n')
++      " ...return the Unicode symbol
++      return [g:l2u_symbols_dict[a:base]]
++    endif
++    if !empty(partmatches)
++      " here, only partial matches were found; either keep just the longest
++      " common prefix, or pass them on
++      if !suggestions
++        let partmatches = [s:L2U_longest_common_prefix(partmatches)]
++      else
++        call sort(partmatches, "s:L2U_partmatches_sort")
++      endif
++    endif
++    if empty(partmatches)
++      call feedkeys(s:l2u_esc_sequence, 'n')
++      let b:l2u_found_completion = 0
++    endif
++    return partmatches
++  endif
++endfunction
++
++function! LaTeXtoUnicode#PutLiteral(k)
++  call feedkeys(a:k, 'ni')
++  return ''
++endfunction
++
++function! LaTeXtoUnicode#PutLiteralCR()
++  call feedkeys('
++', 'ni')
++  return ''
++endfunction
++
++" Function which saves the current insert-mode mapping of a key sequence `s`
++" and associates it with another key sequence `k` (e.g. stores the current
++" <Tab> mapping into the Fallback trigger).
++" It returns the previous maparg dictionary, so that the previous mapping can
++" be reinstated if needed.
++function! s:L2U_SetFallbackMapping(s, k)
++  let mmdict = maparg(a:s, 'i', 0, 1)
++  if empty(mmdict)
++    exe 'inoremap <buffer> ' . a:k . ' ' . a:s
++    return mmdict
++  endif
++  let rhs = mmdict["rhs"]
++  if rhs =~# '^<Plug>L2U'
++    return mmdict
++  endif
++  let pre = '<buffer>'
++  let pre = pre . (mmdict["silent"] ? '<silent>' : '')
++  let pre = pre . (mmdict["expr"] ? '<expr>' : '')
++  if mmdict["noremap"]
++    let cmd = 'inoremap '
++  else
++    let cmd = 'imap '
++    " This is a nasty hack used to prevent infinite recursion. It's not a
++    " general solution. Also, it doesn't work with <CR> since that stops
++    " parsing of the <C-R>=... expression, so we need to special-case it.
++    " Also, if the original mapping was intended to be recursive, this
++    " will break it.
++    if a:s != "<CR>"
++      let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteral('" . a:s . "')\<CR>", 'g')
++    else
++      let rhs = substitute(rhs, '\c' . a:s, "\<C-R>=LaTeXtoUnicode#PutLiteralCR()\<CR>", 'g')
++    endif
++    " Make the mapping silent even if it wasn't originally
++    if !mmdict["silent"]
++      let pre = pre . '<silent>'
++    endif
++  endif
++  exe cmd . pre . ' ' . a:k . ' ' . rhs
++  return mmdict
++endfunction
++
++" Reinstate a mapping from the maparg dict returned by SetFallbackMapping
++" (only if buffer-local, since otherwise it should still be available)
++function! s:L2U_ReinstateMapping(mmdict)
++  if empty(a:mmdict) || !a:mmdict["buffer"]
++    return ''
++  endif
++  let lhs = a:mmdict["lhs"]
++  let rhs = a:mmdict["rhs"]
++  if rhs =~# '^<Plug>L2U'
++    return ''
++  endif
++  let pre = '<buffer>'
++  let pre = pre . (a:mmdict["silent"] ? '<silent>' : '')
++  let pre = pre . (a:mmdict["expr"] ? '<expr>' : '')
++  let cmd = a:mmdict["noremap"] ? 'inoremap ' : 'imap '
++  exe cmd . pre . ' ' . lhs . ' ' . rhs
++endfunction
++
++" This is the function which is mapped to <Tab>
++function! LaTeXtoUnicode#Tab()
++  " the <Tab> is passed through to the fallback mapping if the completion
++  " menu is present, and it hasn't been raised by the L2U tab, and there
++  " isn't an exact match before the cursor
++  if pumvisible() && !b:l2u_tab_completing && !s:L2U_ismatch()
++    call feedkeys(s:l2u_fallback_trigger)
++    return ''
++  endif
++  " ensure that we start completion with some reasonable options
++  call s:L2U_SetCompleteopt()
++  " reset the in_fallback info
++  let b:l2u_in_fallback = 0
++  let b:l2u_tab_completing = 1
++  " invoke completion; failure to perform LaTeX-to-Unicode completion is
++  " handled by the CompleteDone autocommand.
++  call feedkeys("\<C-X>\<C-U>", 'n')
++  return ""
++endfunction
++
++" This function is called at every CompleteDone event, and is meant to handle
++" the failures of LaTeX-to-Unicode completion by calling a fallback
++function! LaTeXtoUnicode#FallbackCallback()
++  call s:L2U_RemoveCompleteDoneAutocommand()
++  call s:L2U_RestoreCompleteopt()
++  if !b:l2u_tab_completing
++    " completion was not initiated by L2U, nothing to do
++    return
++  endif
++  " at this point L2U tab completion is over
++  let b:l2u_tab_completing = 0
++  " if the completion was successful do nothing
++  if b:l2u_found_completion == 1 || b:l2u_singlebslash == 1
++    return
++  endif
++  " fallback
++  let b:l2u_in_fallback = 1
++  call feedkeys(s:l2u_fallback_trigger)
++  return
++endfunction
++
++" This is the function that performs the substitution in command-line mode
++function! LaTeXtoUnicode#CmdTab(trigger)
++  " first stage
++  " analyse command line
++  let col1 = getcmdpos() - 1
++  let l = getcmdline()
++  let col0 = match(l[0:col1-1], '\\[^[:space:]\\]\+$')
++  let b:l2u_singlebslash = (match(l[0:col1-1], '\\$') >= 0)
++  " completion not found
++  if col0 == -1
++    if a:trigger == &wildchar
++      call feedkeys(nr2char(a:trigger), 'nt') " fall-back to the default wildchar
++    elseif a:trigger == char2nr("\<S-Tab>")
++      call feedkeys("\<S-Tab>", 'nt') " fall-back to the default <S-Tab>
++    endif
++    return ''
++  endif
++  let base = l[col0 : col1-1]
++  " search for matches
++  let partmatches = []
++  let exact_match = 0
++  for k in keys(g:l2u_symbols_dict)
++    if k ==# base
++      let exact_match = 1
++      break
++    elseif len(k) >= len(base) && k[0 : len(base)-1] ==# base
++      call add(partmatches, k)
++    endif
++  endfor
++  if !exact_match && len(partmatches) == 0
++    " no matches, call fallbacks
++    if a:trigger == &wildchar
++      call feedkeys(nr2char(a:trigger), 'nt') " fall-back to the default wildchar
++    elseif a:trigger == char2nr("\<S-Tab>")
++      call feedkeys("\<S-Tab>", 'nt') " fall-back to the default <S-Tab>
++    endif
++  elseif exact_match
++    " exact matches are replaced with Unicode
++    let unicode = g:l2u_symbols_dict[base]
++    call feedkeys(repeat("\b", len(base)) . unicode, 'nt')
++  else
++    " no exact match: complete with the longest common prefix
++    let common = s:L2U_longest_common_prefix(partmatches)
++    call feedkeys(common[len(base):], 'nt')
++  endif
++  return ''
++endfunction
++
++function! s:L2U_SetCompleteopt()
++  " temporary change completeopt to use settings which make sense
++  " for L2U
++  let backup_new = 0
++  if !exists('b:l2u_backup_completeopt')
++    let b:l2u_backup_completeopt = &completeopt
++    let backup_new = 1
++  endif
++  noautocmd set completeopt+=longest
++  noautocmd set completeopt-=noinsert
++  noautocmd set completeopt-=noselect
++  noautocmd set completeopt-=menuone
++  if backup_new
++    let b:l2u_modified_completeopt = &completeopt
++  endif
++endfunction
++
++function! s:L2U_RestoreCompleteopt()
++  " restore completeopt, but only if nothing else has
++  " messed with it in the meanwhile
++  if exists('b:l2u_backup_completeopt')
++    if exists('b:l2u_modified_completeopt')
++      if &completeopt ==# b:l2u_modified_completeopt
++        noautocmd let &completeopt = b:l2u_backup_completeopt
++      endif
++      unlet b:l2u_modified_completeopt
++    endif
++    unlet b:l2u_backup_completeopt
++  endif
++endfunction
++
++function! s:L2U_InsertCompleteDoneAutocommand()
++  augroup L2UCompleteDone
++    autocmd! * <buffer>
++    " Every time a L2U completion finishes, the fallback may be invoked
++    autocmd CompleteDone <buffer> call LaTeXtoUnicode#FallbackCallback()
++  augroup END
++endfunction
++
++function! s:L2U_RemoveCompleteDoneAutocommand()
++  augroup L2UCompleteDone
++    autocmd! * <buffer>
++  augroup END
++endfunction
++
++function s:L2U_InsertLeaveClenup()
++    call s:L2U_ResetLastCompletionInfo()
++    augroup L2UInsertLeave
++      autocmd! * <buffer>
++    augroup END
++endfunction
++
++function! s:L2U_InsertInsertLeaveAutocommand()
++  augroup L2UInsertLeave
++    autocmd! * <buffer>
++    autocmd InsertLeave <buffer> call s:L2U_InsertLeaveClenup()
++  augroup END
++endfunction
++
++" Setup the L2U tab mapping
++function! s:L2U_SetTab(wait_insert_enter)
++  let opt_do_cmdtab = index(["on", "command", "cmd"], get(g:, "latex_to_unicode_tab", "on")) != -1
++  let opt_do_instab = index(["on", "insert", "ins"], get(g:, "latex_to_unicode_tab", "on")) != -1
++  if !b:l2u_cmdtab_set && opt_do_cmdtab && b:l2u_enabled
++    let b:l2u_cmdtab_keys = get(g:, "latex_to_unicode_cmd_mapping", ['<Tab>','<S-Tab>'])
++    if type(b:l2u_cmdtab_keys) != type([]) " avoid using v:t_list for backward compatibility
++      let b:l2u_cmdtab_keys = [b:l2u_cmdtab_keys]
++    endif
++    for k in b:l2u_cmdtab_keys
++      exec 'let trigger = char2nr("'.(k[0] == '<' ? '\' : '').k.'")'
++      exec 'cnoremap <buffer><expr> '.k.' LaTeXtoUnicode#CmdTab('.trigger.')'
++    endfor
++    let b:l2u_cmdtab_set = 1
++  endif
++  if b:l2u_tab_set
++    return
++  endif
++  " g:did_insert_enter is set from an autocommand in ftdetect
++  if a:wait_insert_enter && !get(g:, "did_insert_enter", 0)
++    return
++  endif
++  if !opt_do_instab || !b:l2u_enabled
++    return
++  endif
++
++  " Backup the previous completefunc (the check is probably not really needed)
++  if get(b:, "l2u_prev_completefunc", "") != "LaTeXtoUnicode#completefunc"
++    let b:l2u_prev_completefunc = &completefunc
++  endif
++  setlocal completefunc=LaTeXtoUnicode#completefunc
++
++  let b:l2u_prev_map_tab = s:L2U_SetFallbackMapping('<Tab>', s:l2u_fallback_trigger)
++  imap <buffer> <Tab> <Plug>L2UTab
++  inoremap <buffer><expr> <Plug>L2UTab LaTeXtoUnicode#Tab()
++
++  let b:l2u_tab_set = 1
++endfunction
++
++" Revert the LaTeX-to-Unicode tab mapping settings
++function! s:L2U_UnsetTab()
++  if b:l2u_cmdtab_set
++    for k in b:l2u_cmdtab_keys
++      exec 'cunmap <buffer> '.k
++    endfor
++    let b:l2u_cmdtab_set = 0
++  endif
++  if !b:l2u_tab_set
++    return
++  endif
++  exec "setlocal completefunc=" . get(b:, "l2u_prev_completefunc", "")
++  iunmap <buffer> <Tab>
++  if empty(maparg("<Tab>", "i"))
++    call s:L2U_ReinstateMapping(b:l2u_prev_map_tab)
++  endif
++  iunmap <buffer> <Plug>L2UTab
++  exe 'iunmap <buffer> ' . s:l2u_fallback_trigger
++  let b:l2u_tab_set = 0
++endfunction
++
++" Function which looks for viable LaTeX-to-Unicode supstitutions as you type
++function! LaTeXtoUnicode#AutoSub(...)
++  " avoid recursive calls
++  if get(b:, "l2u_in_autosub", 0)
++    return ''
++  endif
++  let vc = a:0 == 0 ? v:char : a:1
++  " for some reason function keys seem to be passed as characters 149 (F1-F12)
++  " or 186 (F13-F37, these are entered with shift/ctrl). In such cases, we
++  " can't really do any better than giving up.
++  if char2nr(vc) == 149 || char2nr(vc) == 186
++    return ''
++  endif
++  let b:l2u_in_autosub = 1
++  let col1 = col('.')
++  let lnum = line('.')
++  if col1 == 1
++    if a:0 > 1
++      call feedkeys(a:2, 'mi')
++    endif
++    let b:l2u_in_autosub = 0
++    return ''
++  endif
++  let bs = (vc != "\n")
++  let l = getline(lnum)[0 : col1-1-bs] . v:char
++  let col0 = match(l, '\\\%([_^]\?[A-Za-z]\+\%' . col1 . 'c\%([^A-Za-z]\|$\)\|[_^]\%([0-9()=+-]\)\%' . col1 .'c\%(.\|$\)\)')
++  if col0 == -1
++    if a:0 > 1
++      call feedkeys(a:2, 'mi')
++    endif
++    let b:l2u_in_autosub = 0
++    return ''
++  endif
++  let base = l[col0 : col1-1-bs]
++  let unicode = get(g:l2u_symbols_dict, base, '')
++  if empty(unicode)
++    if a:0 > 1
++      call feedkeys(a:2, 'mi')
++    endif
++    let b:l2u_in_autosub = 0
++    return ''
++  endif
++
++  " perform the substitution, wrapping it in undo breakpoints so that
++  " we can revert it as a whole
++  " at the end, reset the l2u_in_autosub variable without leaving insert mode
++  " the 'i' mode is the only one that works correctly when executing macros
++  " the 'n' mode is to avoid user-defined mappings of \b, <C-G> and <C-\><C-O>
++  call feedkeys("\<C-G>u" .
++             \  repeat("\b", len(base) + bs) . unicode . vc . s:l2u_esc_sequence .
++             \  "\<C-G>u" .
++             \  "\<C-\>\<C-O>:let b:l2u_in_autosub = 0\<CR>",
++             \  'ni')
++  return ''
++endfunction
++
++" Setup the auto as-you-type LaTeX-to-Unicode substitution
++function! s:L2U_SetAutoSub(wait_insert_enter)
++  if b:l2u_autosub_set
++    return
++  endif
++  " g:did_insert_enter is set from an autocommand in ftdetect
++  if a:wait_insert_enter && !get(g:, "did_insert_enter", 0)
++    return
++  endif
++  if !get(g:, "latex_to_unicode_auto", 0) || !b:l2u_enabled
++    return
++  endif
++  " Viable substitutions are searched at every character insertion via the
++  " autocmd InsertCharPre. The <Enter> key does not seem to be catched in
++  " this way though, so we use a mapping for that case.
++
++  let b:l2u_prev_map_cr = s:L2U_SetFallbackMapping('<CR>', s:l2u_fallback_trigger_cr)
++  imap <buffer> <CR> <Plug>L2UAutoSub
++  exec 'inoremap <buffer><expr> <Plug>L2UAutoSub LaTeXtoUnicode#AutoSub("\n", "' . s:l2u_fallback_trigger_cr . '")'
++
++  augroup L2UAutoSub
++    autocmd! * <buffer>
++    autocmd InsertCharPre <buffer> call LaTeXtoUnicode#AutoSub()
++  augroup END
++
++  let b:l2u_autosub_set = 1
++endfunction
++
++" Revert the auto LaTeX-to-Unicode settings
++function! s:L2U_UnsetAutoSub()
++  if !b:l2u_autosub_set
++    return
++  endif
++
++  iunmap <buffer> <CR>
++  if empty(maparg("<CR>", "i"))
++    call s:L2U_ReinstateMapping(b:l2u_prev_map_cr)
++  endif
++  iunmap <buffer> <Plug>L2UAutoSub
++  exe 'iunmap <buffer> ' . s:l2u_fallback_trigger_cr
++  augroup L2UAutoSub
++    autocmd! * <buffer>
++  augroup END
++  let b:l2u_autosub_set = 0
++endfunction
++
++function! s:L2U_SetKeymap()
++  if !b:l2u_keymap_set && get(g:, "latex_to_unicode_keymap", 0) && b:l2u_enabled
++    setlocal keymap=latex2unicode
++    let b:l2u_keymap_set = 1
++  endif
++endfunction
++
++function! s:L2U_UnsetKeymap()
++  if !b:l2u_keymap_set
++    return
++  endif
++  setlocal keymap=
++  let b:l2u_keymap_set = 0
++endfunction
++
++" Initialization. Can be used to re-init when global settings have changed.
++function! LaTeXtoUnicode#Init(...)
++  let wait_insert_enter = a:0 > 0 ? a:1 : 1
++
++  if !wait_insert_enter
++    augroup L2UInit
++      autocmd!
++    augroup END
++  endif
++
++  call s:L2U_UnsetTab()
++  call s:L2U_UnsetAutoSub()
++  call s:L2U_UnsetKeymap()
++
++  call s:L2U_SetTab(wait_insert_enter)
++  call s:L2U_SetAutoSub(wait_insert_enter)
++  call s:L2U_SetKeymap()
++  return ''
++endfunction
++
++function! LaTeXtoUnicode#Toggle()
++  call s:L2U_Setup()
++  if b:l2u_enabled
++    call LaTeXtoUnicode#Disable()
++    echo "LaTeX-to-Unicode disabled"
++  else
++    call LaTeXtoUnicode#Enable()
++    echo "LaTeX-to-Unicode enabled"
++  endif
++  return ''
++endfunction
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/autoload/generate_latex_symbols_table.jl
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/autoload/generate_latex_symbols_table.jl	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/autoload/generate_latex_symbols_table.jl	(revision 26505)
+@@ -0,0 +1,17 @@
++#!/bin/env julia
++
++const filename = "julia_latex_symbols"
++const funcname = "get_dict"
++
++open("$filename.vim","w") do f
++    println(f, "\" This file is autogenerated from the script '$(basename(Base.source_path()))'")
++    println(f, "\" The symbols are based on Julia version $VERSION\n")
++    println(f, "scriptencoding utf-8\n")
++    println(f, "function! $filename#$funcname()\n",
++               "  return {\n",
++               "    \\ ",
++               join([string("'", latex, "': '", unicode, "'") for (latex,unicode) in sort!(vcat(collect(REPL.REPLCompletions.latex_symbols),collect(REPL.REPLCompletions.emoji_symbols)), by=x->x[2])],
++                    ",\n    \\ "),
++               "}")
++    println(f, "endfunction")
++end
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia/doc.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia/doc.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia/doc.vim	(revision 26505)
+@@ -0,0 +1,242 @@
++" path to the julia binary to communicate with
++if has('win32') || has('win64')
++  if exists('g:julia#doc#juliapath')
++    " use assigned g:julia#doc#juliapath
++  elseif executable('julia')
++    " use julia command in PATH
++    let g:julia#doc#juliapath = 'julia'
++  else
++    " search julia binary in the default installation paths
++    let pathlist = sort(glob($LOCALAPPDATA . '\Julia-*\bin\julia.exe', 1, 1))
++    let g:julia#doc#juliapath = get(pathlist, -1, 'julia')
++  endif
++else
++  let g:julia#doc#juliapath = get(g:, 'julia#doc#juliapath', 'julia')
++endif
++
++function! s:version() abort
++  let VERSION = {'major': 0, 'minor': 0}
++  if !executable(g:julia#doc#juliapath)
++    return VERSION
++  endif
++
++  let cmd = printf('%s -v', g:julia#doc#juliapath)
++  let output = system(cmd)
++  let versionstr = matchstr(output, '\C^julia version \zs\d\+\.\d\+\ze')
++  let [major, minor] = map(split(versionstr, '\.'), 'str2nr(v:val)')
++  let VERSION.major = major
++  let VERSION.minor = minor
++  return VERSION
++endfunction
++
++let s:VERSION = s:version()
++let s:NODOCPATTERN = '\C\VNo documentation found.'
++
++function! julia#doc#lookup(keyword, ...) abort
++  let juliapath = get(a:000, 0, g:julia#doc#juliapath)
++  let keyword = escape(a:keyword, '"\')
++  let cmd = printf('%s --compile=min --optimize=0 -E "@doc %s"', juliapath, keyword)
++  return systemlist(cmd)
++endfunction
++
++function! julia#doc#open(keyword) abort
++  if empty(a:keyword)
++    call s:warn('Not an appropriate keyword.')
++    return
++  endif
++
++  if !executable(g:julia#doc#juliapath)
++    call s:warn('%s command is not executable', g:julia#doc#juliapath)
++    return
++  endif
++
++  let doc = julia#doc#lookup(a:keyword, g:julia#doc#juliapath)
++  if empty(doc) || match(doc[0], s:NODOCPATTERN) > -1
++    call s:warn('No documentation found for "%s".', a:keyword)
++    return
++  endif
++
++  " workaround for * and ? since a buffername cannot include them
++  let keyword = a:keyword
++  let keyword = substitute(keyword, '\*', ':asterisk:', 'g')
++  let keyword = substitute(keyword, '?', ':question:', 'g')
++  let buffername = printf('juliadoc: %s', keyword)
++
++  call s:write_to_preview_window(doc, "juliadoc", buffername)
++
++  call filter(s:HELPHISTORY, 'v:val isnot# a:keyword')
++  call add(s:HELPHISTORY, a:keyword)
++endfunction
++
++function! s:write_to_preview_window(content, ftype, buffername)
++  " Are we in the preview window from the outset? If not, best to close any
++  " preview windows that might exist.
++  let pvw = &previewwindow
++  if !pvw
++    silent! pclose!
++  endif
++  execute "silent! pedit +setlocal\\ nobuflisted\\ noswapfile\\"
++        \ "buftype=nofile\\ bufhidden=wipe" a:buffername
++  silent! wincmd P
++  if &previewwindow
++    setlocal modifiable noreadonly
++    silent! %delete _
++    call append(0, a:content)
++    silent! $delete _
++    normal! ggj
++    setlocal nomodified readonly nomodifiable
++    execute "setfiletype" a:ftype
++    " Only return to a normal window if we didn't start in a preview window.
++    if !pvw
++      silent! wincmd p
++    endif
++  else
++    " We couldn't make it to the preview window, so as a fallback we dump the
++    " contents in the status area.
++    echo join(a:content, "\n")
++  endif
++endfunction
++
++function! s:warn(...) abort
++  if a:0 == 0
++    return
++  endif
++
++  echohl WarningMsg
++  try
++    if a:0 == 1
++      echo a:1
++    else
++      echo call('printf', a:000)
++    endif
++  finally
++    echohl None
++  endtry
++endfunction
++
++
++
++let s:KEYWORDPATTERN = '\m@\?\h\k*!\?'
++
++" This function is called in normal mode or visual mode.
++function! julia#doc#keywordprg(word) abort
++  if a:word is# ''
++    return
++  endif
++
++  let word = s:unfnameescape(a:word)
++  if word is# expand('<cword>')
++    " 'K' in normal mode
++    " NOTE: Because ! and @ is not in 'iskeyword' option, this func ignore
++    "       the argument to recognize keywords like "@time" and "push!"
++    let view = winsaveview()
++    let lnum = line('.')
++    let tail = searchpos(s:KEYWORDPATTERN, 'ce', lnum)
++    let head = searchpos(s:KEYWORDPATTERN, 'bc', lnum)
++    call winrestview(view)
++    if head == [0, 0] || tail == [0, 0]
++      return
++    else
++      let start = head[1] - 1
++      let end = tail[1] - 1
++      let word = getline(lnum)[start : end]
++    endif
++  endif
++  call julia#doc#open(word)
++endfunction
++
++if exists('+shellslash')
++  let s:ESCAPEDCHARS = " \t\n\"#%'*<?`|"
++else
++  let s:ESCAPEDCHARS = " \t\n*?[{`$\\%#'\"|!<"
++endif
++let s:FNAMEESCAPEPATTERN = '\\\ze[' . escape(s:ESCAPEDCHARS, ']^-\') . ']'
++
++" this function reproduces an original string escaped by fnameescape()
++function! s:unfnameescape(str) abort
++  if a:str is# ''
++    return ''
++  endif
++
++  " NOTE: We cannot determine the original string if a:str starts from '\-',
++  "       '\+' or '\>' because fnameescape('-') ==# fnameescape('\-').
++  if a:str is# '\-'
++    " Remove escape anyway.
++    return '-'
++  endif
++
++  if a:str =~# '^\\[+>]'
++    let str = a:str[1:]
++  else
++    let str = a:str
++  endif
++  return substitute(str, s:FNAMEESCAPEPATTERN, '', 'g')
++endfunction
++
++
++
++let s:HELPPROMPT = 'help?> '
++let s:HELPHISTORY = []
++
++function! julia#doc#prompt() abort
++  let inputhist = s:savehistory('input')
++  echohl MoreMsg
++  try
++    call s:restorehistory('input', s:HELPHISTORY)
++    let keyword = input(s:HELPPROMPT, '', 'customlist,julia#doc#complete')
++
++    " Clear the last prompt
++    normal! :
++  finally
++    echohl None
++    call s:restorehistory('input', inputhist)
++  endtry
++
++  if empty(keyword)
++    return
++  endif
++
++  call julia#doc#open(keyword)
++endfunction
++
++function! s:savehistory(name) abort
++  if histnr(a:name) == -1
++    return []
++  endif
++
++  let history = []
++  for i in range(1, histnr(a:name))
++    let item = histget(a:name, i)
++    if !empty(item)
++      call add(history, item)
++    endif
++  endfor
++  return history
++endfunction
++
++function! s:restorehistory(name, history) abort
++  call histdel(a:name)
++  for item in a:history
++    call histadd(a:name, item)
++  endfor
++endfunction
++
++
++
++if s:VERSION.major == 0 && s:VERSION.minor <= 6
++  let s:REPL_SEARCH = 'Base.Docs.repl_search'
++else
++  let s:REPL_SEARCH = 'import REPL.repl_search; repl_search'
++endif
++
++function! julia#doc#complete(ArgLead, CmdLine, CursorPos) abort
++  return s:likely(a:ArgLead)
++endfunction
++
++function! s:likely(str) abort
++  " escape twice
++  let str = escape(escape(a:str, '"\'), '"\')
++  let cmd = printf('%s --compile=min --optimize=0 -E "%s(\"%s\")"', g:julia#doc#juliapath, s:REPL_SEARCH, str)
++  let output = systemlist(cmd)
++  return split(matchstr(output[0], '\C^search: \zs.*'))
++endfunction
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia.vim	(revision 26505)
+@@ -0,0 +1,166 @@
++function! julia#set_syntax_version(jvers)
++  echo "The julia#set_syntax_version function is deprecated"
++endfunction
++
++function! julia#toggle_deprecated_syntax()
++  echo "The julia#toggle_deprecated_syntax function is deprecated"
++endfunction
++
++if exists("loaded_matchit")
++
++function! julia#toggle_function_blockassign()
++    let sav_pos = getcurpos()
++    let l = getline('.')
++    let c = match(l, '\C\m\<function\s\+.\+(')
++    if c != -1
++        return julia#function_block2assign()
++    endif
++    let c = match(l, '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*=\s*')
++    if c == -1
++        echohl WarningMsg | echo "Not on a function definition or assignment line" | echohl None
++        return
++    endif
++    return julia#function_assign2block()
++endfunction
++
++function! julia#function_block2assign()
++    let sav_pos = getcurpos()
++    let l = getline('.')
++    let c = match(l, '\C\m\<function\s\+.\+(')
++    if c == -1
++        echohl WarningMsg | echo "Not on a function definition line" | echohl None
++        return
++    endif
++    let fpos = copy(sav_pos)
++    let fpos[2] = c+1
++    call setpos('.', fpos)
++    normal %
++    if line('.') != fpos[1]+2 || match(getline('.'), '\C\m^\s*end\s*$') == -1
++        echohl WarningMsg | echo "Only works with 3-lines functions" | echohl None
++        call setpos('.', sav_pos)
++        return
++    endif
++    call setpos('.', fpos)
++    normal! f(
++    normal %
++    while line('.') == fpos[1] && match(l[col('.')-1:], '\C\m)(') == 0
++        normal! l
++        normal %
++    endwhile
++    if line('.') != fpos[1] || match(l[(col('.')-1):], '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*$') != 0
++        echohl WarningMsg | echo "Unrecognized function definition format" | echohl None
++        call setpos('.', sav_pos)
++        return
++    endif
++
++    call setpos('.', fpos)
++    normal! dwA = J
++    if match(getline('.')[(col('.')-1):], '\C\mreturn\>') == 0
++        normal! dw
++    endif
++    if match(getline('.')[(col('.')-1):], '\C\m\s*$') == 0
++        normal! F=C= nothing
++    endif
++    normal! jddk^
++    return
++endfunction
++
++function! julia#function_assign2block()
++    let sav_pos = getcurpos()
++    let l = getline('.')
++    let c = match(l, '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*=\s*')
++    if c == -1
++        echohl WarningMsg | echo "Not on a function assignment-definition line" | echohl None
++        return
++    endif
++    normal ^
++    while match(l[(col('.')-1):], '\%(\S\+\.\)*@') == 0
++        normal! W
++    endwhile
++    normal! ifunction 
++    let l = getline('.')
++    let c = match(l, '\C\m)\%(::\S\+\)\?\%(\s\+where\s\+.*\)\?\s*\zs=\s*')
++    let eqpos = copy(sav_pos)
++    let eqpos[2] = c+1
++    call setpos('.', eqpos)
++    normal! cw
++oend
++    normal %
++    s/\s*$// | noh
++    return
++endfunction
++
++
++let s:nonid_chars = "\U01-\U07" . "\U0E-\U1F" .
++      \             "\"#$'(,.:;=?@`\\U5B{" .
++      \             "\U80-\UA1" . "\UA7\UA8\UAB\UAD\UAF\UB4" . "\UB6-\UB8" . "\UBB\UBF"
++
++let s:nonidS_chars = "[:space:])\\U5D}" . s:nonid_chars
++
++" the following excludes '!' since it can be used as an identifier,
++" and '$' since it can be used in interpolations
++" note that \U2D is '-'
++let s:uniop_chars = "+\\U2D~¬√∛∜"
++
++let s:binop_chars = "=+\\U2D*/\\%÷^&|⊻<>≤≥≡≠≢∈∉⋅×∪∩⊆⊈⊂⊄⊊←→∋∌⊕⊖⊞⊟∘∧⊗⊘↑↓∨⊠±"
++
++" the following is a list of all remainig valid operator chars,
++" but it's more efficient when expressed with ranges (see below)
++" let s:binop_chars_extra = "↔↚↛↠↣↦↮⇎⇏⇒⇔⇴⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿⟵⟶⟷⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤌⤍⤎⤏⤐⤑⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥊⥋⥎⥐⥒⥓⥖⥗⥚⥛⥞⥟⥢⥤⥦⥧⥨⥩⥪⥫⥬⥭⥰⧴⬱⬰⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌￩￫" .
++"       \                   "∝∊∍∥∦∷∺∻∽∾≁≃≄≅≆≇≈≉≊≋≌≍≎≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≣≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊃⊅⊇⊉⊋⊏⊐⊑⊒⊜⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⋍⋐⋑⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⟈⟉⟒⦷⧀⧁⧡⧣⧤⧥⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫷⫸⫹⫺⊢⊣" .
++"       \                   "⊔∓∔∸≂≏⊎⊽⋎⋓⧺⧻⨈⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨹⨺⩁⩂⩅⩊⩌⩏⩐⩒⩔⩖⩗⩛⩝⩡⩢⩣" .
++"       \                   "⊙⊚⊛⊡⊓∗∙∤⅋≀⊼⋄⋆⋇⋉⋊⋋⋌⋏⋒⟑⦸⦼⦾⦿⧶⧷⨇⨰⨱⨲⨳⨴⨵⨶⨷⨸⨻⨼⨽⩀⩃⩄⩋⩍⩎⩑⩓⩕⩘⩚⩜⩞⩟⩠⫛⊍▷⨝⟕⟖⟗" .
++"       \                   "⇵⟰⟱⤈⤉⤊⤋⤒⤓⥉⥌⥍⥏⥑⥔⥕⥘⥙⥜⥝⥠⥡⥣⥥⥮⥯￪￬"
++
++" same as above, but with character ranges, for performance
++let s:binop_chars_extra = "\\U214B\\U2190-\\U2194\\U219A\\U219B\\U21A0\\U21A3\\U21A6\\U21AE\\U21CE\\U21CF\\U21D2\\U21D4\\U21F4-\\U21FF\\U2208-\\U220D\\U2213\\U2214\\U2217-\\U2219\\U221D\\U2224-\\U222A\\U2237\\U2238\\U223A\\U223B\\U223D\\U223E\\U2240-\\U228B\\U228D-\\U229C\\U229E-\\U22A3\\U22A9\\U22AC\\U22AE\\U22B0-\\U22B7\\U22BB-\\U22BD\\U22C4-\\U22C7\\U22C9-\\U22D3\\U22D5-\\U22ED\\U22F2-\\U22FF\\U25B7\\U27C8\\U27C9\\U27D1\\U27D2\\U27D5-\\U27D7\\U27F0\\U27F1\\U27F5-\\U27F7\\U27F7\\U27F9-\\U27FF\\U2900-\\U2918\\U291D-\\U2920\\U2944-\\U2970\\U29B7\\U29B8\\U29BC\\U29BE-\\U29C1\\U29E1\\U29E3-\\U29E5\\U29F4\\U29F6\\U29F7\\U29FA\\U29FB\\U2A07\\U2A08\\U2A1D\\U2A22-\\U2A2E\\U2A30-\\U2A3D\\U2A40-\\U2A45\\U2A4A-\\U2A58\\U2A5A-\\U2A63\\U2A66\\U2A67\\U2A6A-\\U2AD9\\U2ADB\\U2AF7-\\U2AFA\\U2B30-\\U2B44\\U2B47-\\U2B4C\\UFFE9-\\UFFEC"
++
++" a Julia identifier, sort of
++let s:idregex = '[^' . s:nonidS_chars . '0-9!' . s:uniop_chars . s:binop_chars . '][^' . s:nonidS_chars . s:uniop_chars . s:binop_chars . s:binop_chars_extra . ']*'
++
++let s:operators = '\%(' . '\.\%([-+*/^÷%|&!]\|//\|\\\|<<\|>>>\?\)\?=' .
++      \           '\|'  . '[:$<>]=\|||\|&&\||>\|<|\|<:\|:>\|::\|<<\|>>>\?\|//\|[-=]>\|\.\{3\}' .
++      \           '\|'  . '[' . s:uniop_chars . '!$]' .
++      \           '\|'  . '\.\?[' . s:binop_chars . s:binop_chars_extra . ']' .
++      \           '\)'
++
++function! julia#idundercursor()
++    " TODO...
++    let w = expand('<cword>')
++    " let [l,c] = [line('.'),col('.')]
++    " let ll = getline(l)
++    return w
++endfunction
++
++function! julia#gotodefinition()
++    let w = julia#idundercursor()
++    if empty(w)
++        return ''
++    endif
++    let [l,c] = [line('.'),col('.')]
++    let st = map(synstack(l,c), 'synIDattr(v:val, "name")')
++    let n = len(st)
++    if n > 0 && st[-1] =~# '^julia\%(\%(Range\|Ternary\|CTrans\)\?Operator\|\%(Possible\)\?SymbolS\?\|\%(Bl\|Rep\)\?Keyword\|Conditional\|ParDelim\|Char\|Colon\|Typedef\|Number\|Float\|Const\%(Generic\|Bool\)\|ComplexUnit\|\%(Special\|\%(Octal\|Hex\)Escape\)Char\|UniChar\%(Small\|Large\)\|Comment[LM]\|Todo\|Semicolon\)$'
++        return ''
++    endif
++
++    let comprehension = 0
++    let indollar = 0
++    for i in range(n-1, 0, -1)
++        if st[i] =~# '^juliaDollar\%(Var\|Par\|SqBra\)$'
++            let indollar = 1
++        endif
++        if !indollar && st[i] =~# '^julia\%(\a*String\|QuotedParBlockS\?\)$'
++            return ''
++        endif
++        if st[i] =~# '^julia\%(ParBlock\%(InRange\)\?\|SqBraBlock\|\%(Dollar\|StringVars\)\%(Par\|SqBra\)\)$'
++            let comprehension = 1
++        endif
++    endfor
++
++    let s1 = search('\C\<' . w . '\s*=[^=]', 'bcWzs')
++
++    return
++endfunction
++
++endif
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia_blocks.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia_blocks.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia_blocks.vim	(revision 26505)
+@@ -0,0 +1,794 @@
++" Facilities for moving around Julia blocks (e.g. if/end, function/end etc.)
++" (AKA a collection of horrible hacks)
++
++let s:default_mappings = {
++  \  "moveblock_n" : "]]",
++  \  "moveblock_N" : "][",
++  \  "moveblock_p" : "[[",
++  \  "moveblock_P" : "[]",
++  \
++  \  "move_n" : "]j",
++  \  "move_N" : "]J",
++  \  "move_p" : "[j",
++  \  "move_P" : "[J",
++  \
++  \  "select_a" : "aj",
++  \  "select_i" : "ij",
++  \
++  \  "whereami" : "",
++  \  }
++
++function! s:getmapchars(function)
++  if exists("g:julia_blocks_mappings") && has_key(g:julia_blocks_mappings, a:function)
++    return s:escape(g:julia_blocks_mappings[a:function])
++  else
++    return s:escape(s:default_mappings[a:function])
++  endif
++endfunction
++
++function! s:map_move(function, toend, backwards)
++  let chars = s:getmapchars(a:function)
++  if empty(chars)
++    return
++  endif
++  let fn = "julia_blocks#" . a:function
++  let lhs = "<buffer> <nowait> <silent> " . chars . " "
++  let cnt = ":<C-U>let b:jlblk_count=v:count1"
++  exe "nnoremap " . lhs . cnt
++    \ . " <Bar> call " . fn . "()<CR>"
++  exe "onoremap " . lhs . cnt
++    \ . "<CR><Esc>:call julia_blocks#owrapper_move(v:operator, \"" . fn . "\", " . a:toend . ", " . a:backwards . ")<CR>"
++  exe "xnoremap " . lhs . cnt
++    \ . "<CR>gv<Esc>:call julia_blocks#vwrapper_move(\"" . fn . "\")<CR>"
++  let b:jlblk_mapped[a:function] = 1
++endfunction
++
++function! julia_blocks#owrapper_move(oper, function, toend, backwards)
++  let F = function(a:function)
++
++  let save_redraw = &lazyredraw
++  let save_select = &selection
++
++  let restore_cmds = "\<Esc>"
++    \ . ":let &l:selection = \"" . save_select . "\"\<CR>"
++    \ . ":let &l:lazyredraw = " . save_redraw . "\<CR>"
++    \ . ":\<BS>"
++
++  setlocal lazyredraw
++
++  let start_pos = getpos('.')
++  let b:jlblk_abort_calls_esc = 0
++  call F()
++  let b:jlblk_abort_calls_esc = 1
++  let end_pos = getpos('.')
++  if start_pos == end_pos
++    call feedkeys(restore_cmds, 'n')
++  endif
++
++  let &l:selection = "inclusive"
++  if a:backwards || !a:toend
++    let &l:selection = "exclusive"
++  endif
++  if a:toend && a:backwards
++    let end_pos[2] += 1
++  endif
++
++  if s:compare_pos(start_pos, end_pos) > 0
++    let [start_pos, end_pos] = [end_pos, start_pos]
++  endif
++
++  call setpos("'<", start_pos)
++  call setpos("'>", end_pos)
++
++  " NOTE: the 'c' operator behaves differently, for mysterious reasons. We
++  "       simulate it with 'd' followed by 'i' instead
++  call feedkeys("gv" . (a:oper == "c" ? "d" : a:oper) . restore_cmds . (a:oper == "c" ? "i" : ""), 'n')
++endfunction
++
++function! julia_blocks#vwrapper_move(function)
++  let F = function(a:function)
++
++  let s = getpos('.')
++  let b1 = getpos("'<")
++  let b2 = getpos("'>")
++
++  let b = b1 == s ? b2 : b1
++  call setpos('.', s)
++  let b:jlblk_abort_calls_esc = 0
++  call F()
++  let b:jlblk_abort_calls_esc = 1
++  let e = getpos('.')
++  call setpos('.', b)
++  exe "normal " . visualmode()
++  call setpos('.', e)
++endfunction
++
++function! s:unmap(function)
++  if !get(b:jlblk_mapped, a:function, 0)
++    return
++  endif
++  let chars = s:getmapchars(a:function)
++  if empty(chars)
++    " shouldn't happen
++    return
++  endif
++  let mapids = a:function =~# "^move" ? ["n", "x", "o"] :
++	\      a:function =~# "^select" ? ["x", "o"] :
++	\      ["n"]
++  let fn = "julia_blocks#" . a:function
++  let cmd = "<buffer> " . chars
++  for m in mapids
++    exe m . "unmap " . cmd
++  endfor
++  let b:jlblk_mapped[a:function] = 0
++endfunction
++
++function! s:escape(chars)
++  let c = a:chars
++  let c = substitute(c, '|', '<Bar>', 'g')
++  return c
++endfunction
++
++function! s:map_select(function)
++  let chars = s:getmapchars(a:function)
++  if empty(chars)
++    return
++  endif
++  let fn = "julia_blocks#" . a:function
++  let lhs = "<buffer> <nowait> <silent> " . chars . " "
++  let cnt = ":<C-U>let b:jlblk_inwrapper=1<CR>:let b:jlblk_count=max([v:prevcount,1])<CR>"
++  exe "onoremap " . lhs . "<Esc>" . cnt
++    \ . ":call julia_blocks#owrapper_select(v:operator, \"" . fn . "\")<CR>"
++  exe "xnoremap " . lhs . cnt
++    \ . ":call julia_blocks#vwrapper_select(\"" . fn . "\")<CR>"
++  let b:jlblk_mapped[a:function] = 1
++endfunction
++
++function! julia_blocks#owrapper_select(oper, function) ", toend, backwards)
++  let F = function(a:function)
++
++  let save_redraw = &lazyredraw
++  let save_select = &selection
++
++  let restore_cmds = "\<Esc>"
++    \ . ":let &l:selection = \"" . save_select . "\"\<CR>"
++    \ . ":let &l:lazyredraw = " . save_redraw . "\<CR>"
++    \ . ":\<BS>"
++
++  setlocal lazyredraw
++
++  let b:jlblk_abort_calls_esc = 0
++  let retF = F()
++  let b:jlblk_abort_calls_esc = 1
++  if empty(retF)
++    let b:jlblk_inwrapper = 0
++    call feedkeys(restore_cmds, 'n')
++    return
++  end
++  let [start_pos, end_pos] = retF
++
++  if start_pos == end_pos
++    call feedkeys(restore_cmds, 'n')
++  endif
++
++  let &l:selection = "inclusive"
++
++  call setpos("'<", start_pos)
++  call setpos("'>", end_pos)
++
++  let b:jlblk_inwrapper = 0
++  " NOTE: the 'c' operator behaves differently, for mysterious reasons. We
++  "       simulate it with 'd' followed by 'i' instead
++  call feedkeys("gv" . (a:oper == "c" ? "d" : a:oper) . restore_cmds . (a:oper == "c" ? "i" : ""), 'n')
++endfunction
++
++function! julia_blocks#vwrapper_select(function)
++  let F = function(a:function)
++
++  let b:jlblk_abort_calls_esc = 0
++  let retF = F()
++  let b:jlblk_abort_calls_esc = 1
++  if empty(retF)
++    let b:jlblk_inwrapper = 0
++    return
++  end
++  let [start_pos, end_pos] = retF
++  call setpos("'<", start_pos)
++  call setpos("'>", end_pos)
++  normal! gv
++  let b:jlblk_inwrapper = 0
++endfunction
++
++function! s:map_aux(function)
++  let chars = s:getmapchars(a:function)
++  if empty(chars)
++    return
++  endif
++  let fn = "julia_blocks#" . a:function
++  let lhs = "<buffer> <nowait> <silent> " . chars . " "
++  exe "nnoremap " . lhs . ":<C-U>echo " . fn . "()<CR>"
++  let b:jlblk_mapped[a:function] = 1
++endfunction
++
++let s:julia_blocks_functions = {
++      \  "moveblock_N": [1, 0],
++      \  "moveblock_n": [0, 0],
++      \  "moveblock_p": [0, 1],
++      \  "moveblock_P": [1, 1],
++      \
++      \  "move_N": [1, 0],
++      \  "move_n": [0, 0],
++      \  "move_p": [0, 1],
++      \  "move_P": [1, 1],
++      \
++      \  "select_a": [],
++      \  "select_i": [],
++      \
++      \  "whereami": [],
++      \  }
++
++function! julia_blocks#init_mappings()
++  let b:jlblk_mapped = {}
++  for f in keys(s:julia_blocks_functions)
++    if f =~# "^move"
++      let [te, bw] = s:julia_blocks_functions[f]
++      call s:map_move(f, te, bw)
++    elseif f =~# "^select"
++      call s:map_select(f)
++    else
++      call s:map_aux(f)
++    endif
++  endfor
++  call julia_blocks#select_reset()
++  augroup JuliaBlocks
++    au!
++    au InsertEnter <buffer> call julia_blocks#select_reset()
++    au CursorMoved <buffer> call s:cursor_moved()
++  augroup END
++
++  " we would need some autocmd event associated with exiting from
++  " visual mode, but there isn't any, so we resort to this crude
++  " hack
++  " ACTUALLY this creates more problems than it solves, so the crude hack
++  " is just disabled
++  "vnoremap <buffer><silent><unique> <Esc> <Esc>:call julia_blocks#select_reset()<CR>
++endfunction
++
++function! julia_blocks#remove_mappings()
++  if exists("b:jlblk_mapped")
++    for f in keys(s:julia_blocks_functions)
++      call s:unmap(f)
++    endfor
++  endif
++  unlet! b:jlblk_save_pos b:jlblk_view b:jlblk_count b:jlblk_abort_calls_esc
++  unlet! b:jlblk_inwrapper b:jlblk_did_select b:jlblk_doing_select
++  unlet! b:jlblk_last_start_pos b:jlblk_last_end_pos b:jlblk_last_mode
++  augroup JuliaBlocks
++    au!
++  augroup END
++  augroup! JuliaBlocks
++  let md = maparg("<Esc>", "x", 0, 1)
++  if !empty(md) && md["buffer"]
++    vunmap <buffer> <Esc>
++  endif
++endfunction
++
++function! s:restore_view()
++  "redraw! " would ensure correct behaviour, but is annoying
++  let pos = getpos('.')
++  if pos == b:jlblk_save_pos
++    call winrestview(b:jlblk_view)
++    return
++  endif
++  let oldtopline = b:jlblk_view["topline"]
++  let newtopline = winsaveview()["topline"]
++  let l = pos[1]
++  if l >= oldtopline + &l:scrolloff && l <= oldtopline + winheight(0) - 1 - &l:scrolloff
++    if newtopline > oldtopline
++      exe ":normal! " . (newtopline - oldtopline) . "\<C-Y>"
++    elseif newtopline < oldtopline
++      exe ":normal! " . (oldtopline - newtopline) . "\<C-E>"
++    endif
++  " these reduce the scrolling to the minimum (which is maybe not
++  " standard ViM behaviour?)
++  elseif newtopline < oldtopline && (l - newtopline - &l:scrolloff) > 0
++    exe ":normal! " . (l - newtopline - &l:scrolloff) . "\<C-E>"
++  elseif newtopline > oldtopline && (newtopline + &l:scrolloff - l) > 0
++    exe ":normal! " . (l - newtopline - &l:scrolloff) . "\<C-E>"
++  endif
++  call setpos('.', pos) " make sure we didn't screw up
++                        " (since winsaveview may not be up to date)
++endfunction
++
++function! s:abort()
++  call setpos('.', b:jlblk_save_pos)
++  call s:restore_view()
++  if get(b:, "jlblk_abort_calls_esc", 1)
++    call feedkeys("\<Esc>", 'n')
++  endif
++  return 0
++endfunction
++
++function! s:set_mark_tick(...)
++  " This could be a one-liner:
++  "   call setpos("''", b:jlblk_save_pos)
++  " but we want to append to the jumplist,
++  " which setpos doesn't do
++  let p = getpos('.')
++  call setpos('.', b:jlblk_save_pos)
++  normal! m'
++  call setpos('.', p)
++endfunction
++
++function! s:get_save_pos(...)
++  if !exists("b:jlblk_save_pos") || (a:0 == 0) || (a:0 > 0 && a:1)
++    let b:jlblk_save_pos = getpos('.')
++  endif
++  let b:jlblk_view = winsaveview()
++endfunction
++
++function! s:on_end()
++  return getline('.')[col('.')-1] =~# '\k' && expand("<cword>") =~# b:julia_end_keywords
++endfunction
++
++function! s:on_begin()
++  let [l,c] = [line('.'), col('.')]
++  normal! ^
++  let patt = '\%<'.(c+1).'c\(' . b:julia_begin_keywordsm . '\)\%>'.(c-1).'c'
++  let n = search(patt, 'Wnc', l)
++  call cursor(l, c)
++  return n > 0
++endfunction
++
++function! s:matchit()
++  let lkj = exists(":lockjumps") == 2 ? "lockjumps " : ""
++  exe lkj . "normal %"
++endfunction
++
++function! s:move_before_begin()
++  call search(b:julia_begin_keywordsm, 'Wbc')
++  normal! h
++endfunction
++
++function! s:cycle_until_end()
++  let pos = getpos('.')
++  while !s:on_end()
++    call s:matchit()
++    let c = 0
++    if getpos('.') == pos || c > 1000
++      " shouldn't happen, but let's avoid infinite loops anyway
++      return 0
++    endif
++    let c += 1
++  endwhile
++  return 1
++endfunction
++
++function! s:moveto_block_delim(toend, backwards, ...)
++  let pattern = a:toend ? b:julia_end_keywords : b:julia_begin_keywordsm
++  let flags = a:backwards ? 'Wb' : 'W'
++  let cnt = a:0 > 0 ? a:1 : b:jlblk_count
++  if !a:toend && a:backwards && s:on_begin()
++    call s:move_before_begin()
++  endif
++  let ret = 0
++  for c in range(cnt)
++    if a:toend && a:backwards && s:on_end()
++      normal! l
++      normal! bh
++    endif
++    while 1
++      let searchret = search(pattern, flags)
++      if !searchret
++	return ret
++      endif
++      exe "let skip = " . b:match_skip
++      if !skip
++	let ret = 1
++	break
++      endif
++    endwhile
++  endfor
++  return ret
++endfunction
++
++function! s:compare_pos(pos1, pos2)
++  if a:pos1[1] < a:pos2[1]
++    return -1
++  elseif a:pos1[1] > a:pos2[1]
++    return 1
++  elseif a:pos1[2] < a:pos2[2]
++    return -1
++  elseif a:pos1[2] > a:pos2[2]
++    return 1
++  else
++    return 0
++  endif
++endfunction
++
++function! julia_blocks#move_N()
++  call s:get_save_pos()
++
++  let ret = s:moveto_block_delim(1, 0)
++  if !ret
++    return s:abort()
++  endif
++
++  normal! e
++  call s:set_mark_tick()
++
++  return 1
++endfunction
++
++function! julia_blocks#move_n()
++  call s:get_save_pos()
++
++  let ret = s:moveto_block_delim(0, 0)
++  if !ret
++    return s:abort()
++  endif
++
++  call s:set_mark_tick()
++
++  return 1
++endfunction
++
++function! julia_blocks#move_p()
++  call s:get_save_pos()
++
++  let ret = s:moveto_block_delim(0, 1)
++  if !ret
++    return s:abort()
++  endif
++
++  call s:set_mark_tick()
++
++  return 1
++endfunction
++
++function! julia_blocks#move_P()
++  call s:get_save_pos()
++
++  let ret = s:moveto_block_delim(1, 1)
++  if !ret
++    return s:abort()
++  endif
++
++  normal! e
++  call s:set_mark_tick()
++
++  return 1
++endfunction
++
++function! s:moveto_currentblock_end()
++  let flags = 'W'
++  if s:on_end()
++    let flags .= 'c'
++    " NOTE: using "normal! lb" fails at the end of the file (?!)
++    normal! l
++    normal! b
++  endif
++
++  let ret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip)
++  if ret <= 0
++    return s:abort()
++  endif
++
++  normal! e
++  return 1
++endfunction
++
++function! julia_blocks#moveblock_N()
++  call s:get_save_pos()
++
++  let ret = 0
++  for c in range(b:jlblk_count)
++    let last_seen_pos = getpos('.')
++    if s:on_end()
++      normal! hel
++      let save_pos = getpos('.')
++      let ret_start = s:moveto_block_delim(0, 0, 1)
++      let start1_pos = ret_start ? getpos('.') : [0,0,0,0]
++      call setpos('.', save_pos)
++      if s:on_end()
++	normal! h
++      endif
++      let ret_end = s:moveto_block_delim(1, 0, 1)
++      let end1_pos = ret_end ? getpos('.')  : [0,0,0,0]
++
++      if ret_start && (!ret_end || s:compare_pos(start1_pos, end1_pos) < 0)
++	call setpos('.', start1_pos)
++      else
++	call setpos('.', save_pos)
++      endif
++    endif
++
++    let moveret = s:moveto_currentblock_end()
++    if !moveret && c == 0
++      let moveret = s:moveto_block_delim(0, 0, 1) && s:cycle_until_end()
++      if moveret
++        normal! e
++      endif
++    endif
++    if !moveret
++      call setpos('.', last_seen_pos)
++      break
++    endif
++
++    let ret = 1
++  endfor
++  if !ret
++    return s:abort()
++  endif
++
++  call s:set_mark_tick()
++
++  return 1
++endfunction
++
++function! julia_blocks#moveblock_n()
++  call s:get_save_pos()
++
++  let ret = 0
++  for c in range(b:jlblk_count)
++    let last_seen_pos = getpos('.')
++
++    call s:moveto_currentblock_end()
++    if s:moveto_block_delim(0, 0, 1)
++      let ret = 1
++    else
++      call setpos('.', last_seen_pos)
++      break
++    endif
++  endfor
++
++  if !ret
++    return s:abort()
++  endif
++
++  call s:set_mark_tick()
++
++  return 1
++endfunction
++
++function! julia_blocks#moveblock_p()
++  call s:get_save_pos()
++
++  let ret = 0
++  for c in range(b:jlblk_count)
++    let last_seen_pos = getpos('.')
++    if s:on_begin()
++      call s:move_before_begin()
++      if s:on_end()
++	normal! l
++      endif
++      let save_pos = getpos('.')
++      let ret_start = s:moveto_block_delim(0, 1, 1)
++      let start1_pos = ret_start ? getpos('.') : [0,0,0,0]
++      call setpos('.', save_pos)
++      let ret_end = s:moveto_block_delim(1, 1, 1)
++      let end1_pos = ret_end ? getpos('.') : [0,0,0,0]
++
++      if ret_end && (!ret_start || s:compare_pos(start1_pos, end1_pos) < 0)
++	call setpos('.', end1_pos)
++      else
++	call setpos('.', save_pos)
++      endif
++    endif
++
++    let moveret = s:moveto_currentblock_end()
++    if !moveret && c == 0
++      let moveret = s:moveto_block_delim(1, 1, 1)
++    endif
++    if !moveret
++      call setpos('.', last_seen_pos)
++      break
++    endif
++
++    call s:matchit()
++    let ret = 1
++  endfor
++  if !ret
++    return s:abort()
++  endif
++
++  call s:set_mark_tick()
++  call s:restore_view()
++
++  return 1
++endfunction
++
++function! julia_blocks#moveblock_P()
++  call s:get_save_pos()
++
++  let ret = 0
++  for c in range(b:jlblk_count)
++    let last_seen_pos = getpos('.')
++
++    call s:moveto_currentblock_end()
++    if s:on_end()
++      call s:matchit()
++    endif
++
++    if s:moveto_block_delim(1, 1, 1)
++      " NOTE: normal! he does not work unless &whichwrap inlcudes h
++      normal! h
++      normal! e
++      let ret = 1
++    else
++      call setpos('.', last_seen_pos)
++    endif
++  endfor
++
++  if !ret
++    return s:abort()
++  endif
++
++  call s:set_mark_tick()
++  call s:restore_view()
++
++  return 1
++endfunction
++
++function! julia_blocks#whereami()
++  let b:jlblk_count = v:count1
++  let save_redraw = &lazyredraw
++  setlocal lazyredraw
++  let pos = getpos('.')
++  let ret = julia_blocks#select_a('w')
++  if empty(ret)
++    call setpos('.', pos)
++    let &l:lazyredraw = save_redraw
++    return ""
++  end
++  let [start_pos, end_pos] = ret
++  let m = getline(start_pos[1])[start_pos[2]-1:]
++
++  " If cursor_moved was not forced from select_a, we force it now
++  " (TODO: this is *really* ugly)
++  if end_pos != pos
++    call s:cursor_moved(1)
++  endif
++  call setpos('.', pos)
++  call s:restore_view()
++  let &l:lazyredraw = save_redraw
++  return m
++endfunction
++
++" Block text objects
++
++function! s:find_block(current_mode)
++
++  let flags = 'W'
++
++  if b:jlblk_did_select
++    call setpos('.', b:jlblk_last_start_pos)
++    if !s:cycle_until_end()
++      return s:abort()
++    endif
++    if !(a:current_mode[0] == 'a' && a:current_mode == b:jlblk_last_mode)
++      let flags .= 'c'
++    endif
++  elseif s:on_end()
++    let flags .= 'c'
++    " NOTE: using "normal! lb" fails at the end of the file (?!)
++    normal! l
++    normal! b
++  endif
++  let searchret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip)
++  if searchret <= 0
++    if !b:jlblk_did_select
++      return s:abort()
++    else
++     call setpos('.', b:jlblk_last_end_pos)
++    endif
++  endif
++
++  let end_pos = getpos('.')
++  " Jump to match
++  call s:matchit()
++  let start_pos = getpos('.')
++
++  let b:jlblk_last_start_pos = copy(start_pos)
++  let b:jlblk_last_end_pos = copy(end_pos)
++
++  return [start_pos, end_pos]
++endfunction
++
++function! s:repeated_find(ai_mode)
++  let repeat = b:jlblk_count + (a:ai_mode == 'i' && v:count1 > 1 ? 1 : 0)
++  for c in range(repeat)
++    let current_mode = (c < repeat - 1 ? 'a' : a:ai_mode)
++    let ret_find_block = s:find_block(current_mode)
++    if empty(ret_find_block)
++      return 0
++    endif
++    let [start_pos, end_pos] = ret_find_block
++    call setpos('.', end_pos)
++    let b:jlblk_last_mode = current_mode
++    if c < repeat - 1
++      let b:jlblk_doing_select = 0
++      let b:jlblk_did_select = 1
++    endif
++  endfor
++  return [start_pos, end_pos]
++endfunction
++
++function! julia_blocks#select_a(...)
++  let mode_flag = a:0 > 0 ? a:1 : ''
++  call s:get_save_pos(!b:jlblk_did_select)
++  let current_pos = getpos('.')
++  let ret_find_block = s:repeated_find('a' . mode_flag)
++  if empty(ret_find_block)
++    return 0
++  endif
++  let [start_pos, end_pos] = ret_find_block
++
++  call setpos('.', end_pos)
++  normal! e
++  let end_pos = getpos('.')
++
++  let b:jlblk_doing_select = 1
++
++  " CursorMove is only triggered if end_pos
++  " end_pos is different than the staring position;
++  " so when starting from the 'd' in 'end' we need to
++  " force it
++  if current_pos == end_pos
++    call s:cursor_moved(1)
++  endif
++
++  call s:set_mark_tick()
++  return [start_pos, end_pos]
++endfunction
++
++function! julia_blocks#select_i()
++  call s:get_save_pos(!b:jlblk_did_select)
++  let current_pos = getpos('.')
++  let ret_find_block = s:repeated_find('i')
++  if empty(ret_find_block)
++    return 0
++  endif
++  let [start_pos, end_pos] = ret_find_block
++
++  if end_pos[1] <= start_pos[1]+1
++    return s:abort()
++  endif
++
++  call setpos('.', end_pos)
++
++  let b:jlblk_doing_select = 1
++
++  let start_pos[1] += 1
++  call setpos('.', start_pos)
++  normal! ^
++  let start_pos = getpos('.')
++  let end_pos[1] -= 1
++  let end_pos[2] = len(getline(end_pos[1]))
++
++  " CursorMove is only triggered if end_pos
++  " end_pos is different than the staring position;
++  " so when starting from the 'd' in 'end' we need to
++  " force it
++  if current_pos == end_pos
++    call s:cursor_moved(1)
++  endif
++
++  call s:set_mark_tick()
++  return [start_pos, end_pos]
++endfunction
++
++function julia_blocks#select_reset()
++  let b:jlblk_did_select = 0
++  let b:jlblk_doing_select = 0
++  let b:jlblk_inwrapper = 0
++  let b:jlblk_last_mode = ""
++endfunction
++
++function! s:cursor_moved(...)
++  if b:jlblk_inwrapper && !(a:0 > 0 && a:1)
++    return
++  endif
++  let b:jlblk_did_select = b:jlblk_doing_select
++  let b:jlblk_doing_select = 0
++endfunction
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia_latex_symbols.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia_latex_symbols.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/autoload/julia_latex_symbols.vim	(revision 26505)
+@@ -0,0 +1,3332 @@
++" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
++" The symbols are based on Julia version 1.5.0-DEV.67
++
++scriptencoding utf-8
++
++function! julia_latex_symbols#get_dict()
++  return {
++    \ '\exclamdown': '¡',
++    \ '\sterling': '£',
++    \ '\yen': '¥',
++    \ '\brokenbar': '¦',
++    \ '\S': '§',
++    \ '\copyright': '©',
++    \ '\:copyright:': '©',
++    \ '\ordfeminine': 'ª',
++    \ '\neg': '¬',
++    \ '\circledR': '®',
++    \ '\:registered:': '®',
++    \ '\highminus': '¯',
++    \ '\degree': '°',
++    \ '\pm': '±',
++    \ '\^2': '²',
++    \ '\^3': '³',
++    \ '\P': '¶',
++    \ '\cdotp': '·',
++    \ '\^1': '¹',
++    \ '\ordmasculine': 'º',
++    \ '\1/4': '¼',
++    \ '\1/2': '½',
++    \ '\3/4': '¾',
++    \ '\questiondown': '¿',
++    \ '\AA': 'Å',
++    \ '\AE': 'Æ',
++    \ '\DH': 'Ð',
++    \ '\times': '×',
++    \ '\O': 'Ø',
++    \ '\TH': 'Þ',
++    \ '\ss': 'ß',
++    \ '\aa': 'å',
++    \ '\ae': 'æ',
++    \ '\eth': 'ð',
++    \ '\dh': 'ð',
++    \ '\div': '÷',
++    \ '\o': 'ø',
++    \ '\th': 'þ',
++    \ '\DJ': 'Đ',
++    \ '\dj': 'đ',
++    \ '\hbar': 'ħ',
++    \ '\imath': 'ı',
++    \ '\L': 'Ł',
++    \ '\l': 'ł',
++    \ '\NG': 'Ŋ',
++    \ '\ng': 'ŋ',
++    \ '\OE': 'Œ',
++    \ '\oe': 'œ',
++    \ '\hvlig': 'ƕ',
++    \ '\nrleg': 'ƞ',
++    \ '\Zbar': 'Ƶ',
++    \ '\doublepipe': 'ǂ',
++    \ '\jmath': 'ȷ',
++    \ '\trna': 'ɐ',
++    \ '\trnsa': 'ɒ',
++    \ '\openo': 'ɔ',
++    \ '\rtld': 'ɖ',
++    \ '\schwa': 'ə',
++    \ '\pgamma': 'ɣ',
++    \ '\pbgam': 'ɤ',
++    \ '\trnh': 'ɥ',
++    \ '\btdl': 'ɬ',
++    \ '\rtll': 'ɭ',
++    \ '\trnm': 'ɯ',
++    \ '\trnmlr': 'ɰ',
++    \ '\ltlmr': 'ɱ',
++    \ '\ltln': 'ɲ',
++    \ '\rtln': 'ɳ',
++    \ '\clomeg': 'ɷ',
++    \ '\ltphi': 'ɸ',
++    \ '\trnr': 'ɹ',
++    \ '\trnrl': 'ɺ',
++    \ '\rttrnr': 'ɻ',
++    \ '\rl': 'ɼ',
++    \ '\rtlr': 'ɽ',
++    \ '\fhr': 'ɾ',
++    \ '\rtls': 'ʂ',
++    \ '\esh': 'ʃ',
++    \ '\trnt': 'ʇ',
++    \ '\rtlt': 'ʈ',
++    \ '\pupsil': 'ʊ',
++    \ '\pscrv': 'ʋ',
++    \ '\invv': 'ʌ',
++    \ '\invw': 'ʍ',
++    \ '\trny': 'ʎ',
++    \ '\rtlz': 'ʐ',
++    \ '\yogh': 'ʒ',
++    \ '\glst': 'ʔ',
++    \ '\reglst': 'ʕ',
++    \ '\inglst': 'ʖ',
++    \ '\turnk': 'ʞ',
++    \ '\dyogh': 'ʤ',
++    \ '\tesh': 'ʧ',
++    \ '\^h': 'ʰ',
++    \ '\^j': 'ʲ',
++    \ '\^r': 'ʳ',
++    \ '\^w': 'ʷ',
++    \ '\^y': 'ʸ',
++    \ '\rasp': 'ʼ',
++    \ '\verts': 'ˈ',
++    \ '\verti': 'ˌ',
++    \ '\lmrk': 'ː',
++    \ '\hlmrk': 'ˑ',
++    \ '\sbrhr': '˒',
++    \ '\sblhr': '˓',
++    \ '\rais': '˔',
++    \ '\low': '˕',
++    \ '\u': '˘',
++    \ '\tildelow': '˜',
++    \ '\^l': 'ˡ',
++    \ '\^s': 'ˢ',
++    \ '\^x': 'ˣ',
++    \ '\grave': '̀',
++    \ '\acute': '́',
++    \ '\hat': '̂',
++    \ '\tilde': '̃',
++    \ '\bar': '̄',
++    \ '\overbar': '̅',
++    \ '\breve': '̆',
++    \ '\dot': '̇',
++    \ '\ddot': '̈',
++    \ '\ovhook': '̉',
++    \ '\ocirc': '̊',
++    \ '\H': '̋',
++    \ '\check': '̌',
++    \ '\candra': '̐',
++    \ '\oturnedcomma': '̒',
++    \ '\ocommatopright': '̕',
++    \ '\droang': '̚',
++    \ '\palh': '̡',
++    \ '\rh': '̢',
++    \ '\c': '̧',
++    \ '\k': '̨',
++    \ '\sbbrg': '̪',
++    \ '\wideutilde': '̰',
++    \ '\underbar': '̲',
++    \ '\strike': '̶',
++    \ '\sout': '̶',
++    \ '\not': '̸',
++    \ '\underleftrightarrow': '͍',
++    \ '\Alpha': 'Α',
++    \ '\Beta': 'Β',
++    \ '\Gamma': 'Γ',
++    \ '\Delta': 'Δ',
++    \ '\Epsilon': 'Ε',
++    \ '\Zeta': 'Ζ',
++    \ '\Eta': 'Η',
++    \ '\Theta': 'Θ',
++    \ '\Iota': 'Ι',
++    \ '\Kappa': 'Κ',
++    \ '\Lambda': 'Λ',
++    \ '\upMu': 'Μ',
++    \ '\upNu': 'Ν',
++    \ '\Xi': 'Ξ',
++    \ '\upOmicron': 'Ο',
++    \ '\Pi': 'Π',
++    \ '\Rho': 'Ρ',
++    \ '\Sigma': 'Σ',
++    \ '\Tau': 'Τ',
++    \ '\Upsilon': 'Υ',
++    \ '\Phi': 'Φ',
++    \ '\Chi': 'Χ',
++    \ '\Psi': 'Ψ',
++    \ '\Omega': 'Ω',
++    \ '\alpha': 'α',
++    \ '\beta': 'β',
++    \ '\gamma': 'γ',
++    \ '\delta': 'δ',
++    \ '\upepsilon': 'ε',
++    \ '\varepsilon': 'ε',
++    \ '\zeta': 'ζ',
++    \ '\eta': 'η',
++    \ '\theta': 'θ',
++    \ '\iota': 'ι',
++    \ '\kappa': 'κ',
++    \ '\lambda': 'λ',
++    \ '\mu': 'μ',
++    \ '\nu': 'ν',
++    \ '\xi': 'ξ',
++    \ '\upomicron': 'ο',
++    \ '\pi': 'π',
++    \ '\rho': 'ρ',
++    \ '\varsigma': 'ς',
++    \ '\sigma': 'σ',
++    \ '\tau': 'τ',
++    \ '\upsilon': 'υ',
++    \ '\varphi': 'φ',
++    \ '\chi': 'χ',
++    \ '\psi': 'ψ',
++    \ '\omega': 'ω',
++    \ '\upvarbeta': 'ϐ',
++    \ '\vartheta': 'ϑ',
++    \ '\phi': 'ϕ',
++    \ '\varpi': 'ϖ',
++    \ '\upoldKoppa': 'Ϙ',
++    \ '\upoldkoppa': 'ϙ',
++    \ '\Stigma': 'Ϛ',
++    \ '\upstigma': 'ϛ',
++    \ '\Digamma': 'Ϝ',
++    \ '\digamma': 'ϝ',
++    \ '\Koppa': 'Ϟ',
++    \ '\upkoppa': 'ϟ',
++    \ '\Sampi': 'Ϡ',
++    \ '\upsampi': 'ϡ',
++    \ '\varkappa': 'ϰ',
++    \ '\varrho': 'ϱ',
++    \ '\varTheta': 'ϴ',
++    \ '\epsilon': 'ϵ',
++    \ '\backepsilon': '϶',
++    \ '\^A': 'ᴬ',
++    \ '\^B': 'ᴮ',
++    \ '\^D': 'ᴰ',
++    \ '\^E': 'ᴱ',
++    \ '\^G': 'ᴳ',
++    \ '\^H': 'ᴴ',
++    \ '\^I': 'ᴵ',
++    \ '\^J': 'ᴶ',
++    \ '\^K': 'ᴷ',
++    \ '\^L': 'ᴸ',
++    \ '\^M': 'ᴹ',
++    \ '\^N': 'ᴺ',
++    \ '\^O': 'ᴼ',
++    \ '\^P': 'ᴾ',
++    \ '\^R': 'ᴿ',
++    \ '\^T': 'ᵀ',
++    \ '\^U': 'ᵁ',
++    \ '\^W': 'ᵂ',
++    \ '\^a': 'ᵃ',
++    \ '\^alpha': 'ᵅ',
++    \ '\^b': 'ᵇ',
++    \ '\^d': 'ᵈ',
++    \ '\^e': 'ᵉ',
++    \ '\^epsilon': 'ᵋ',
++    \ '\^g': 'ᵍ',
++    \ '\^k': 'ᵏ',
++    \ '\^m': 'ᵐ',
++    \ '\^o': 'ᵒ',
++    \ '\^p': 'ᵖ',
++    \ '\^t': 'ᵗ',
++    \ '\^u': 'ᵘ',
++    \ '\^v': 'ᵛ',
++    \ '\^beta': 'ᵝ',
++    \ '\^gamma': 'ᵞ',
++    \ '\^delta': 'ᵟ',
++    \ '\^phi': 'ᵠ',
++    \ '\^chi': 'ᵡ',
++    \ '\_i': 'ᵢ',
++    \ '\_r': 'ᵣ',
++    \ '\_u': 'ᵤ',
++    \ '\_v': 'ᵥ',
++    \ '\_beta': 'ᵦ',
++    \ '\_gamma': 'ᵧ',
++    \ '\_rho': 'ᵨ',
++    \ '\_phi': 'ᵩ',
++    \ '\_chi': 'ᵪ',
++    \ '\^c': 'ᶜ',
++    \ '\^f': 'ᶠ',
++    \ '\^iota': 'ᶥ',
++    \ '\^Phi': 'ᶲ',
++    \ '\^z': 'ᶻ',
++    \ '\^theta': 'ᶿ',
++    \ '\enspace': ' ',
++    \ '\quad': ' ',
++    \ '\thickspace': ' ',
++    \ '\thinspace': ' ',
++    \ '\hspace': ' ',
++    \ '\endash': '–',
++    \ '\emdash': '—',
++    \ '\Vert': '‖',
++    \ '\lq': '‘',
++    \ '\rq': '’',
++    \ '\reapos': '‛',
++    \ '\quotedblleft': '“',
++    \ '\quotedblright': '”',
++    \ '\dagger': '†',
++    \ '\ddagger': '‡',
++    \ '\bullet': '•',
++    \ '\dots': '…',
++    \ '\ldots': '…',
++    \ '\perthousand': '‰',
++    \ '\pertenthousand': '‱',
++    \ '\prime': '′',
++    \ '\pprime': '″',
++    \ '\ppprime': '‴',
++    \ '\backprime': '‵',
++    \ '\backpprime': '‶',
++    \ '\backppprime': '‷',
++    \ '\guilsinglleft': '‹',
++    \ '\guilsinglright': '›',
++    \ '\:bangbang:': '‼',
++    \ '\tieconcat': '⁀',
++    \ '\:interrobang:': '⁉',
++    \ '\pppprime': '⁗',
++    \ '\tricolon': '⁝',
++    \ '\nolinebreak': '⁠',
++    \ '\^0': '⁰',
++    \ '\^i': 'ⁱ',
++    \ '\^4': '⁴',
++    \ '\^5': '⁵',
++    \ '\^6': '⁶',
++    \ '\^7': '⁷',
++    \ '\^8': '⁸',
++    \ '\^9': '⁹',
++    \ '\^+': '⁺',
++    \ '\^-': '⁻',
++    \ '\^=': '⁼',
++    \ '\^(': '⁽',
++    \ '\^)': '⁾',
++    \ '\^n': 'ⁿ',
++    \ '\_0': '₀',
++    \ '\_1': '₁',
++    \ '\_2': '₂',
++    \ '\_3': '₃',
++    \ '\_4': '₄',
++    \ '\_5': '₅',
++    \ '\_6': '₆',
++    \ '\_7': '₇',
++    \ '\_8': '₈',
++    \ '\_9': '₉',
++    \ '\_+': '₊',
++    \ '\_-': '₋',
++    \ '\_=': '₌',
++    \ '\_(': '₍',
++    \ '\_)': '₎',
++    \ '\_a': 'ₐ',
++    \ '\_e': 'ₑ',
++    \ '\_o': 'ₒ',
++    \ '\_x': 'ₓ',
++    \ '\_schwa': 'ₔ',
++    \ '\_h': 'ₕ',
++    \ '\_k': 'ₖ',
++    \ '\_l': 'ₗ',
++    \ '\_m': 'ₘ',
++    \ '\_n': 'ₙ',
++    \ '\_p': 'ₚ',
++    \ '\_s': 'ₛ',
++    \ '\_t': 'ₜ',
++    \ '\pes': '₧',
++    \ '\euro': '€',
++    \ '\leftharpoonaccent': '⃐',
++    \ '\rightharpoonaccent': '⃑',
++    \ '\vertoverlay': '⃒',
++    \ '\overleftarrow': '⃖',
++    \ '\vec': '⃗',
++    \ '\dddot': '⃛',
++    \ '\ddddot': '⃜',
++    \ '\enclosecircle': '⃝',
++    \ '\enclosesquare': '⃞',
++    \ '\enclosediamond': '⃟',
++    \ '\overleftrightarrow': '⃡',
++    \ '\enclosetriangle': '⃤',
++    \ '\annuity': '⃧',
++    \ '\threeunderdot': '⃨',
++    \ '\widebridgeabove': '⃩',
++    \ '\underrightharpoondown': '⃬',
++    \ '\underleftharpoondown': '⃭',
++    \ '\underleftarrow': '⃮',
++    \ '\underrightarrow': '⃯',
++    \ '\asteraccent': '⃰',
++    \ '\bbC': 'ℂ',
++    \ '\eulermascheroni': 'ℇ',
++    \ '\scrg': 'ℊ',
++    \ '\scrH': 'ℋ',
++    \ '\frakH': 'ℌ',
++    \ '\bbH': 'ℍ',
++    \ '\planck': 'ℎ',
++    \ '\hslash': 'ℏ',
++    \ '\scrI': 'ℐ',
++    \ '\Im': 'ℑ',
++    \ '\scrL': 'ℒ',
++    \ '\ell': 'ℓ',
++    \ '\bbN': 'ℕ',
++    \ '\numero': '№',
++    \ '\wp': '℘',
++    \ '\bbP': 'ℙ',
++    \ '\bbQ': 'ℚ',
++    \ '\scrR': 'ℛ',
++    \ '\Re': 'ℜ',
++    \ '\bbR': 'ℝ',
++    \ '\xrat': '℞',
++    \ '\trademark': '™',
++    \ '\:tm:': '™',
++    \ '\bbZ': 'ℤ',
++    \ '\ohm': 'Ω',
++    \ '\mho': '℧',
++    \ '\frakZ': 'ℨ',
++    \ '\turnediota': '℩',
++    \ '\Angstrom': 'Å',
++    \ '\scrB': 'ℬ',
++    \ '\frakC': 'ℭ',
++    \ '\scre': 'ℯ',
++    \ '\euler': 'ℯ',
++    \ '\scrE': 'ℰ',
++    \ '\scrF': 'ℱ',
++    \ '\Finv': 'Ⅎ',
++    \ '\scrM': 'ℳ',
++    \ '\scro': 'ℴ',
++    \ '\aleph': 'ℵ',
++    \ '\beth': 'ℶ',
++    \ '\gimel': 'ℷ',
++    \ '\daleth': 'ℸ',
++    \ '\:information_source:': 'ℹ',
++    \ '\bbpi': 'ℼ',
++    \ '\bbgamma': 'ℽ',
++    \ '\bbGamma': 'ℾ',
++    \ '\bbPi': 'ℿ',
++    \ '\bbsum': '⅀',
++    \ '\Game': '⅁',
++    \ '\sansLturned': '⅂',
++    \ '\sansLmirrored': '⅃',
++    \ '\Yup': '⅄',
++    \ '\bbiD': 'ⅅ',
++    \ '\bbid': 'ⅆ',
++    \ '\bbie': 'ⅇ',
++    \ '\bbii': 'ⅈ',
++    \ '\bbij': 'ⅉ',
++    \ '\PropertyLine': '⅊',
++    \ '\upand': '⅋',
++    \ '\1/7': '⅐',
++    \ '\1/9': '⅑',
++    \ '\1/10': '⅒',
++    \ '\1/3': '⅓',
++    \ '\2/3': '⅔',
++    \ '\1/5': '⅕',
++    \ '\2/5': '⅖',
++    \ '\3/5': '⅗',
++    \ '\4/5': '⅘',
++    \ '\1/6': '⅙',
++    \ '\5/6': '⅚',
++    \ '\1/8': '⅛',
++    \ '\3/8': '⅜',
++    \ '\5/8': '⅝',
++    \ '\7/8': '⅞',
++    \ '\1/': '⅟',
++    \ '\0/3': '↉',
++    \ '\leftarrow': '←',
++    \ '\uparrow': '↑',
++    \ '\to': '→',
++    \ '\rightarrow': '→',
++    \ '\downarrow': '↓',
++    \ '\leftrightarrow': '↔',
++    \ '\:left_right_arrow:': '↔',
++    \ '\updownarrow': '↕',
++    \ '\:arrow_up_down:': '↕',
++    \ '\nwarrow': '↖',
++    \ '\:arrow_upper_left:': '↖',
++    \ '\nearrow': '↗',
++    \ '\:arrow_upper_right:': '↗',
++    \ '\searrow': '↘',
++    \ '\:arrow_lower_right:': '↘',
++    \ '\swarrow': '↙',
++    \ '\:arrow_lower_left:': '↙',
++    \ '\nleftarrow': '↚',
++    \ '\nrightarrow': '↛',
++    \ '\leftwavearrow': '↜',
++    \ '\rightwavearrow': '↝',
++    \ '\twoheadleftarrow': '↞',
++    \ '\twoheaduparrow': '↟',
++    \ '\twoheadrightarrow': '↠',
++    \ '\twoheaddownarrow': '↡',
++    \ '\leftarrowtail': '↢',
++    \ '\rightarrowtail': '↣',
++    \ '\mapsfrom': '↤',
++    \ '\mapsup': '↥',
++    \ '\mapsto': '↦',
++    \ '\mapsdown': '↧',
++    \ '\updownarrowbar': '↨',
++    \ '\hookleftarrow': '↩',
++    \ '\:leftwards_arrow_with_hook:': '↩',
++    \ '\hookrightarrow': '↪',
++    \ '\:arrow_right_hook:': '↪',
++    \ '\looparrowleft': '↫',
++    \ '\looparrowright': '↬',
++    \ '\leftrightsquigarrow': '↭',
++    \ '\nleftrightarrow': '↮',
++    \ '\downzigzagarrow': '↯',
++    \ '\Lsh': '↰',
++    \ '\Rsh': '↱',
++    \ '\Ldsh': '↲',
++    \ '\Rdsh': '↳',
++    \ '\linefeed': '↴',
++    \ '\carriagereturn': '↵',
++    \ '\curvearrowleft': '↶',
++    \ '\curvearrowright': '↷',
++    \ '\barovernorthwestarrow': '↸',
++    \ '\barleftarrowrightarrowbar': '↹',
++    \ '\circlearrowleft': '↺',
++    \ '\circlearrowright': '↻',
++    \ '\leftharpoonup': '↼',
++    \ '\leftharpoondown': '↽',
++    \ '\upharpoonright': '↾',
++    \ '\upharpoonleft': '↿',
++    \ '\rightharpoonup': '⇀',
++    \ '\rightharpoondown': '⇁',
++    \ '\downharpoonright': '⇂',
++    \ '\downharpoonleft': '⇃',
++    \ '\rightleftarrows': '⇄',
++    \ '\dblarrowupdown': '⇅',
++    \ '\leftrightarrows': '⇆',
++    \ '\leftleftarrows': '⇇',
++    \ '\upuparrows': '⇈',
++    \ '\rightrightarrows': '⇉',
++    \ '\downdownarrows': '⇊',
++    \ '\leftrightharpoons': '⇋',
++    \ '\rightleftharpoons': '⇌',
++    \ '\nLeftarrow': '⇍',
++    \ '\nLeftrightarrow': '⇎',
++    \ '\nRightarrow': '⇏',
++    \ '\Leftarrow': '⇐',
++    \ '\Uparrow': '⇑',
++    \ '\Rightarrow': '⇒',
++    \ '\Downarrow': '⇓',
++    \ '\Leftrightarrow': '⇔',
++    \ '\Updownarrow': '⇕',
++    \ '\Nwarrow': '⇖',
++    \ '\Nearrow': '⇗',
++    \ '\Searrow': '⇘',
++    \ '\Swarrow': '⇙',
++    \ '\Lleftarrow': '⇚',
++    \ '\Rrightarrow': '⇛',
++    \ '\leftsquigarrow': '⇜',
++    \ '\rightsquigarrow': '⇝',
++    \ '\nHuparrow': '⇞',
++    \ '\nHdownarrow': '⇟',
++    \ '\leftdasharrow': '⇠',
++    \ '\updasharrow': '⇡',
++    \ '\rightdasharrow': '⇢',
++    \ '\downdasharrow': '⇣',
++    \ '\barleftarrow': '⇤',
++    \ '\rightarrowbar': '⇥',
++    \ '\leftwhitearrow': '⇦',
++    \ '\upwhitearrow': '⇧',
++    \ '\rightwhitearrow': '⇨',
++    \ '\downwhitearrow': '⇩',
++    \ '\whitearrowupfrombar': '⇪',
++    \ '\circleonrightarrow': '⇴',
++    \ '\DownArrowUpArrow': '⇵',
++    \ '\rightthreearrows': '⇶',
++    \ '\nvleftarrow': '⇷',
++    \ '\nvrightarrow': '⇸',
++    \ '\nvleftrightarrow': '⇹',
++    \ '\nVleftarrow': '⇺',
++    \ '\nVrightarrow': '⇻',
++    \ '\nVleftrightarrow': '⇼',
++    \ '\leftarrowtriangle': '⇽',
++    \ '\rightarrowtriangle': '⇾',
++    \ '\leftrightarrowtriangle': '⇿',
++    \ '\forall': '∀',
++    \ '\complement': '∁',
++    \ '\partial': '∂',
++    \ '\exists': '∃',
++    \ '\nexists': '∄',
++    \ '\varnothing': '∅',
++    \ '\emptyset': '∅',
++    \ '\increment': '∆',
++    \ '\del': '∇',
++    \ '\nabla': '∇',
++    \ '\in': '∈',
++    \ '\notin': '∉',
++    \ '\smallin': '∊',
++    \ '\ni': '∋',
++    \ '\nni': '∌',
++    \ '\smallni': '∍',
++    \ '\QED': '∎',
++    \ '\prod': '∏',
++    \ '\coprod': '∐',
++    \ '\sum': '∑',
++    \ '\minus': '−',
++    \ '\mp': '∓',
++    \ '\dotplus': '∔',
++    \ '\setminus': '∖',
++    \ '\ast': '∗',
++    \ '\circ': '∘',
++    \ '\vysmblkcircle': '∙',
++    \ '\surd': '√',
++    \ '\sqrt': '√',
++    \ '\cbrt': '∛',
++    \ '\fourthroot': '∜',
++    \ '\propto': '∝',
++    \ '\infty': '∞',
++    \ '\rightangle': '∟',
++    \ '\angle': '∠',
++    \ '\measuredangle': '∡',
++    \ '\sphericalangle': '∢',
++    \ '\mid': '∣',
++    \ '\nmid': '∤',
++    \ '\parallel': '∥',
++    \ '\nparallel': '∦',
++    \ '\wedge': '∧',
++    \ '\vee': '∨',
++    \ '\cap': '∩',
++    \ '\cup': '∪',
++    \ '\int': '∫',
++    \ '\iint': '∬',
++    \ '\iiint': '∭',
++    \ '\oint': '∮',
++    \ '\oiint': '∯',
++    \ '\oiiint': '∰',
++    \ '\clwintegral': '∱',
++    \ '\varointclockwise': '∲',
++    \ '\ointctrclockwise': '∳',
++    \ '\therefore': '∴',
++    \ '\because': '∵',
++    \ '\Colon': '∷',
++    \ '\dotminus': '∸',
++    \ '\dotsminusdots': '∺',
++    \ '\kernelcontraction': '∻',
++    \ '\sim': '∼',
++    \ '\backsim': '∽',
++    \ '\lazysinv': '∾',
++    \ '\sinewave': '∿',
++    \ '\wr': '≀',
++    \ '\nsim': '≁',
++    \ '\eqsim': '≂',
++    \ '\neqsim': '≂̸',
++    \ '\simeq': '≃',
++    \ '\nsime': '≄',
++    \ '\cong': '≅',
++    \ '\approxnotequal': '≆',
++    \ '\ncong': '≇',
++    \ '\approx': '≈',
++    \ '\napprox': '≉',
++    \ '\approxeq': '≊',
++    \ '\tildetrpl': '≋',
++    \ '\allequal': '≌',
++    \ '\asymp': '≍',
++    \ '\Bumpeq': '≎',
++    \ '\nBumpeq': '≎̸',
++    \ '\bumpeq': '≏',
++    \ '\nbumpeq': '≏̸',
++    \ '\doteq': '≐',
++    \ '\Doteq': '≑',
++    \ '\fallingdotseq': '≒',
++    \ '\risingdotseq': '≓',
++    \ '\coloneq': '≔',
++    \ '\eqcolon': '≕',
++    \ '\eqcirc': '≖',
++    \ '\circeq': '≗',
++    \ '\arceq': '≘',
++    \ '\wedgeq': '≙',
++    \ '\veeeq': '≚',
++    \ '\starequal': '≛',
++    \ '\triangleq': '≜',
++    \ '\eqdef': '≝',
++    \ '\measeq': '≞',
++    \ '\questeq': '≟',
++    \ '\ne': '≠',
++    \ '\equiv': '≡',
++    \ '\nequiv': '≢',
++    \ '\Equiv': '≣',
++    \ '\le': '≤',
++    \ '\leq': '≤',
++    \ '\ge': '≥',
++    \ '\geq': '≥',
++    \ '\leqq': '≦',
++    \ '\geqq': '≧',
++    \ '\lneqq': '≨',
++    \ '\lvertneqq': '≨︀',
++    \ '\gneqq': '≩',
++    \ '\gvertneqq': '≩︀',
++    \ '\ll': '≪',
++    \ '\NotLessLess': '≪̸',
++    \ '\gg': '≫',
++    \ '\NotGreaterGreater': '≫̸',
++    \ '\between': '≬',
++    \ '\nasymp': '≭',
++    \ '\nless': '≮',
++    \ '\ngtr': '≯',
++    \ '\nleq': '≰',
++    \ '\ngeq': '≱',
++    \ '\lesssim': '≲',
++    \ '\gtrsim': '≳',
++    \ '\nlesssim': '≴',
++    \ '\ngtrsim': '≵',
++    \ '\lessgtr': '≶',
++    \ '\gtrless': '≷',
++    \ '\notlessgreater': '≸',
++    \ '\notgreaterless': '≹',
++    \ '\prec': '≺',
++    \ '\succ': '≻',
++    \ '\preccurlyeq': '≼',
++    \ '\succcurlyeq': '≽',
++    \ '\precsim': '≾',
++    \ '\nprecsim': '≾̸',
++    \ '\succsim': '≿',
++    \ '\nsuccsim': '≿̸',
++    \ '\nprec': '⊀',
++    \ '\nsucc': '⊁',
++    \ '\subset': '⊂',
++    \ '\supset': '⊃',
++    \ '\nsubset': '⊄',
++    \ '\nsupset': '⊅',
++    \ '\subseteq': '⊆',
++    \ '\supseteq': '⊇',
++    \ '\nsubseteq': '⊈',
++    \ '\nsupseteq': '⊉',
++    \ '\subsetneq': '⊊',
++    \ '\varsubsetneqq': '⊊︀',
++    \ '\supsetneq': '⊋',
++    \ '\varsupsetneq': '⊋︀',
++    \ '\cupdot': '⊍',
++    \ '\uplus': '⊎',
++    \ '\sqsubset': '⊏',
++    \ '\NotSquareSubset': '⊏̸',
++    \ '\sqsupset': '⊐',
++    \ '\NotSquareSuperset': '⊐̸',
++    \ '\sqsubseteq': '⊑',
++    \ '\sqsupseteq': '⊒',
++    \ '\sqcap': '⊓',
++    \ '\sqcup': '⊔',
++    \ '\oplus': '⊕',
++    \ '\ominus': '⊖',
++    \ '\otimes': '⊗',
++    \ '\oslash': '⊘',
++    \ '\odot': '⊙',
++    \ '\circledcirc': '⊚',
++    \ '\circledast': '⊛',
++    \ '\circledequal': '⊜',
++    \ '\circleddash': '⊝',
++    \ '\boxplus': '⊞',
++    \ '\boxminus': '⊟',
++    \ '\boxtimes': '⊠',
++    \ '\boxdot': '⊡',
++    \ '\vdash': '⊢',
++    \ '\dashv': '⊣',
++    \ '\top': '⊤',
++    \ '\bot': '⊥',
++    \ '\models': '⊧',
++    \ '\vDash': '⊨',
++    \ '\Vdash': '⊩',
++    \ '\Vvdash': '⊪',
++    \ '\VDash': '⊫',
++    \ '\nvdash': '⊬',
++    \ '\nvDash': '⊭',
++    \ '\nVdash': '⊮',
++    \ '\nVDash': '⊯',
++    \ '\prurel': '⊰',
++    \ '\scurel': '⊱',
++    \ '\vartriangleleft': '⊲',
++    \ '\vartriangleright': '⊳',
++    \ '\trianglelefteq': '⊴',
++    \ '\trianglerighteq': '⊵',
++    \ '\original': '⊶',
++    \ '\image': '⊷',
++    \ '\multimap': '⊸',
++    \ '\hermitconjmatrix': '⊹',
++    \ '\intercal': '⊺',
++    \ '\veebar': '⊻',
++    \ '\xor': '⊻',
++    \ '\barwedge': '⊼',
++    \ '\barvee': '⊽',
++    \ '\rightanglearc': '⊾',
++    \ '\varlrtriangle': '⊿',
++    \ '\bigwedge': '⋀',
++    \ '\bigvee': '⋁',
++    \ '\bigcap': '⋂',
++    \ '\bigcup': '⋃',
++    \ '\diamond': '⋄',
++    \ '\cdot': '⋅',
++    \ '\star': '⋆',
++    \ '\divideontimes': '⋇',
++    \ '\bowtie': '⋈',
++    \ '\ltimes': '⋉',
++    \ '\rtimes': '⋊',
++    \ '\leftthreetimes': '⋋',
++    \ '\rightthreetimes': '⋌',
++    \ '\backsimeq': '⋍',
++    \ '\curlyvee': '⋎',
++    \ '\curlywedge': '⋏',
++    \ '\Subset': '⋐',
++    \ '\Supset': '⋑',
++    \ '\Cap': '⋒',
++    \ '\Cup': '⋓',
++    \ '\pitchfork': '⋔',
++    \ '\equalparallel': '⋕',
++    \ '\lessdot': '⋖',
++    \ '\gtrdot': '⋗',
++    \ '\verymuchless': '⋘',
++    \ '\ggg': '⋙',
++    \ '\lesseqgtr': '⋚',
++    \ '\gtreqless': '⋛',
++    \ '\eqless': '⋜',
++    \ '\eqgtr': '⋝',
++    \ '\curlyeqprec': '⋞',
++    \ '\curlyeqsucc': '⋟',
++    \ '\npreccurlyeq': '⋠',
++    \ '\nsucccurlyeq': '⋡',
++    \ '\nsqsubseteq': '⋢',
++    \ '\nsqsupseteq': '⋣',
++    \ '\sqsubsetneq': '⋤',
++    \ '\sqspne': '⋥',
++    \ '\lnsim': '⋦',
++    \ '\gnsim': '⋧',
++    \ '\precnsim': '⋨',
++    \ '\succnsim': '⋩',
++    \ '\ntriangleleft': '⋪',
++    \ '\ntriangleright': '⋫',
++    \ '\ntrianglelefteq': '⋬',
++    \ '\ntrianglerighteq': '⋭',
++    \ '\vdots': '⋮',
++    \ '\cdots': '⋯',
++    \ '\adots': '⋰',
++    \ '\ddots': '⋱',
++    \ '\disin': '⋲',
++    \ '\varisins': '⋳',
++    \ '\isins': '⋴',
++    \ '\isindot': '⋵',
++    \ '\varisinobar': '⋶',
++    \ '\isinobar': '⋷',
++    \ '\isinvb': '⋸',
++    \ '\isinE': '⋹',
++    \ '\nisd': '⋺',
++    \ '\varnis': '⋻',
++    \ '\nis': '⋼',
++    \ '\varniobar': '⋽',
++    \ '\niobar': '⋾',
++    \ '\bagmember': '⋿',
++    \ '\diameter': '⌀',
++    \ '\house': '⌂',
++    \ '\varbarwedge': '⌅',
++    \ '\vardoublebarwedge': '⌆',
++    \ '\lceil': '⌈',
++    \ '\rceil': '⌉',
++    \ '\lfloor': '⌊',
++    \ '\rfloor': '⌋',
++    \ '\invnot': '⌐',
++    \ '\sqlozenge': '⌑',
++    \ '\profline': '⌒',
++    \ '\profsurf': '⌓',
++    \ '\recorder': '⌕',
++    \ '\viewdata': '⌗',
++    \ '\turnednot': '⌙',
++    \ '\:watch:': '⌚',
++    \ '\:hourglass:': '⌛',
++    \ '\ulcorner': '⌜',
++    \ '\urcorner': '⌝',
++    \ '\llcorner': '⌞',
++    \ '\lrcorner': '⌟',
++    \ '\frown': '⌢',
++    \ '\smile': '⌣',
++    \ '\varhexagonlrbonds': '⌬',
++    \ '\conictaper': '⌲',
++    \ '\topbot': '⌶',
++    \ '\obar': '⌽',
++    \ '\notslash': '⌿',
++    \ '\notbackslash': '⍀',
++    \ '\boxupcaret': '⍓',
++    \ '\boxquestion': '⍰',
++    \ '\hexagon': '⎔',
++    \ '\dlcorn': '⎣',
++    \ '\lmoustache': '⎰',
++    \ '\rmoustache': '⎱',
++    \ '\overbracket': '⎴',
++    \ '\underbracket': '⎵',
++    \ '\bbrktbrk': '⎶',
++    \ '\sqrtbottom': '⎷',
++    \ '\lvboxline': '⎸',
++    \ '\rvboxline': '⎹',
++    \ '\varcarriagereturn': '⏎',
++    \ '\overbrace': '⏞',
++    \ '\underbrace': '⏟',
++    \ '\trapezium': '⏢',
++    \ '\benzenr': '⏣',
++    \ '\strns': '⏤',
++    \ '\fltns': '⏥',
++    \ '\accurrent': '⏦',
++    \ '\elinters': '⏧',
++    \ '\:fast_forward:': '⏩',
++    \ '\:rewind:': '⏪',
++    \ '\:arrow_double_up:': '⏫',
++    \ '\:arrow_double_down:': '⏬',
++    \ '\:alarm_clock:': '⏰',
++    \ '\:hourglass_flowing_sand:': '⏳',
++    \ '\blanksymbol': '␢',
++    \ '\visiblespace': '␣',
++    \ '\:m:': 'Ⓜ',
++    \ '\circledS': 'Ⓢ',
++    \ '\dshfnc': '┆',
++    \ '\sqfnw': '┙',
++    \ '\diagup': '╱',
++    \ '\diagdown': '╲',
++    \ '\blockuphalf': '▀',
++    \ '\blocklowhalf': '▄',
++    \ '\blockfull': '█',
++    \ '\blocklefthalf': '▌',
++    \ '\blockrighthalf': '▐',
++    \ '\blockqtrshaded': '░',
++    \ '\blockhalfshaded': '▒',
++    \ '\blockthreeqtrshaded': '▓',
++    \ '\blacksquare': '■',
++    \ '\square': '□',
++    \ '\squoval': '▢',
++    \ '\blackinwhitesquare': '▣',
++    \ '\squarehfill': '▤',
++    \ '\squarevfill': '▥',
++    \ '\squarehvfill': '▦',
++    \ '\squarenwsefill': '▧',
++    \ '\squareneswfill': '▨',
++    \ '\squarecrossfill': '▩',
++    \ '\smblksquare': '▪',
++    \ '\:black_small_square:': '▪',
++    \ '\smwhtsquare': '▫',
++    \ '\:white_small_square:': '▫',
++    \ '\hrectangleblack': '▬',
++    \ '\hrectangle': '▭',
++    \ '\vrectangleblack': '▮',
++    \ '\vrecto': '▯',
++    \ '\parallelogramblack': '▰',
++    \ '\parallelogram': '▱',
++    \ '\bigblacktriangleup': '▲',
++    \ '\bigtriangleup': '△',
++    \ '\blacktriangle': '▴',
++    \ '\vartriangle': '▵',
++    \ '\blacktriangleright': '▶',
++    \ '\:arrow_forward:': '▶',
++    \ '\triangleright': '▷',
++    \ '\smallblacktriangleright': '▸',
++    \ '\smalltriangleright': '▹',
++    \ '\blackpointerright': '►',
++    \ '\whitepointerright': '▻',
++    \ '\bigblacktriangledown': '▼',
++    \ '\bigtriangledown': '▽',
++    \ '\blacktriangledown': '▾',
++    \ '\triangledown': '▿',
++    \ '\blacktriangleleft': '◀',
++    \ '\:arrow_backward:': '◀',
++    \ '\triangleleft': '◁',
++    \ '\smallblacktriangleleft': '◂',
++    \ '\smalltriangleleft': '◃',
++    \ '\blackpointerleft': '◄',
++    \ '\whitepointerleft': '◅',
++    \ '\mdlgblkdiamond': '◆',
++    \ '\mdlgwhtdiamond': '◇',
++    \ '\blackinwhitediamond': '◈',
++    \ '\fisheye': '◉',
++    \ '\lozenge': '◊',
++    \ '\bigcirc': '○',
++    \ '\dottedcircle': '◌',
++    \ '\circlevertfill': '◍',
++    \ '\bullseye': '◎',
++    \ '\mdlgblkcircle': '●',
++    \ '\cirfl': '◐',
++    \ '\cirfr': '◑',
++    \ '\cirfb': '◒',
++    \ '\circletophalfblack': '◓',
++    \ '\circleurquadblack': '◔',
++    \ '\blackcircleulquadwhite': '◕',
++    \ '\blacklefthalfcircle': '◖',
++    \ '\blackrighthalfcircle': '◗',
++    \ '\rvbull': '◘',
++    \ '\inversewhitecircle': '◙',
++    \ '\invwhiteupperhalfcircle': '◚',
++    \ '\invwhitelowerhalfcircle': '◛',
++    \ '\ularc': '◜',
++    \ '\urarc': '◝',
++    \ '\lrarc': '◞',
++    \ '\llarc': '◟',
++    \ '\topsemicircle': '◠',
++    \ '\botsemicircle': '◡',
++    \ '\lrblacktriangle': '◢',
++    \ '\llblacktriangle': '◣',
++    \ '\ulblacktriangle': '◤',
++    \ '\urblacktriangle': '◥',
++    \ '\smwhtcircle': '◦',
++    \ '\sqfl': '◧',
++    \ '\sqfr': '◨',
++    \ '\squareulblack': '◩',
++    \ '\sqfse': '◪',
++    \ '\boxbar': '◫',
++    \ '\trianglecdot': '◬',
++    \ '\triangleleftblack': '◭',
++    \ '\trianglerightblack': '◮',
++    \ '\lgwhtcircle': '◯',
++    \ '\squareulquad': '◰',
++    \ '\squarellquad': '◱',
++    \ '\squarelrquad': '◲',
++    \ '\squareurquad': '◳',
++    \ '\circleulquad': '◴',
++    \ '\circlellquad': '◵',
++    \ '\circlelrquad': '◶',
++    \ '\circleurquad': '◷',
++    \ '\ultriangle': '◸',
++    \ '\urtriangle': '◹',
++    \ '\lltriangle': '◺',
++    \ '\mdwhtsquare': '◻',
++    \ '\:white_medium_square:': '◻',
++    \ '\mdblksquare': '◼',
++    \ '\:black_medium_square:': '◼',
++    \ '\mdsmwhtsquare': '◽',
++    \ '\:white_medium_small_square:': '◽',
++    \ '\mdsmblksquare': '◾',
++    \ '\:black_medium_small_square:': '◾',
++    \ '\lrtriangle': '◿',
++    \ '\:sunny:': '☀',
++    \ '\:cloud:': '☁',
++    \ '\bigstar': '★',
++    \ '\bigwhitestar': '☆',
++    \ '\astrosun': '☉',
++    \ '\:phone:': '☎',
++    \ '\:ballot_box_with_check:': '☑',
++    \ '\:umbrella:': '☔',
++    \ '\:coffee:': '☕',
++    \ '\:point_up:': '☝',
++    \ '\danger': '☡',
++    \ '\:relaxed:': '☺',
++    \ '\blacksmiley': '☻',
++    \ '\sun': '☼',
++    \ '\rightmoon': '☽',
++    \ '\leftmoon': '☾',
++    \ '\mercury': '☿',
++    \ '\venus': '♀',
++    \ '\female': '♀',
++    \ '\male': '♂',
++    \ '\mars': '♂',
++    \ '\jupiter': '♃',
++    \ '\saturn': '♄',
++    \ '\uranus': '♅',
++    \ '\neptune': '♆',
++    \ '\pluto': '♇',
++    \ '\aries': '♈',
++    \ '\:aries:': '♈',
++    \ '\taurus': '♉',
++    \ '\:taurus:': '♉',
++    \ '\gemini': '♊',
++    \ '\:gemini:': '♊',
++    \ '\cancer': '♋',
++    \ '\:cancer:': '♋',
++    \ '\leo': '♌',
++    \ '\:leo:': '♌',
++    \ '\virgo': '♍',
++    \ '\:virgo:': '♍',
++    \ '\libra': '♎',
++    \ '\:libra:': '♎',
++    \ '\scorpio': '♏',
++    \ '\:scorpius:': '♏',
++    \ '\sagittarius': '♐',
++    \ '\:sagittarius:': '♐',
++    \ '\capricornus': '♑',
++    \ '\:capricorn:': '♑',
++    \ '\aquarius': '♒',
++    \ '\:aquarius:': '♒',
++    \ '\pisces': '♓',
++    \ '\:pisces:': '♓',
++    \ '\spadesuit': '♠',
++    \ '\:spades:': '♠',
++    \ '\heartsuit': '♡',
++    \ '\diamondsuit': '♢',
++    \ '\clubsuit': '♣',
++    \ '\:clubs:': '♣',
++    \ '\varspadesuit': '♤',
++    \ '\varheartsuit': '♥',
++    \ '\:hearts:': '♥',
++    \ '\vardiamondsuit': '♦',
++    \ '\:diamonds:': '♦',
++    \ '\varclubsuit': '♧',
++    \ '\:hotsprings:': '♨',
++    \ '\quarternote': '♩',
++    \ '\eighthnote': '♪',
++    \ '\twonotes': '♫',
++    \ '\flat': '♭',
++    \ '\natural': '♮',
++    \ '\sharp': '♯',
++    \ '\:recycle:': '♻',
++    \ '\acidfree': '♾',
++    \ '\:wheelchair:': '♿',
++    \ '\dicei': '⚀',
++    \ '\diceii': '⚁',
++    \ '\diceiii': '⚂',
++    \ '\diceiv': '⚃',
++    \ '\dicev': '⚄',
++    \ '\dicevi': '⚅',
++    \ '\circledrightdot': '⚆',
++    \ '\circledtwodots': '⚇',
++    \ '\blackcircledrightdot': '⚈',
++    \ '\blackcircledtwodots': '⚉',
++    \ '\:anchor:': '⚓',
++    \ '\:warning:': '⚠',
++    \ '\:zap:': '⚡',
++    \ '\hermaphrodite': '⚥',
++    \ '\mdwhtcircle': '⚪',
++    \ '\:white_circle:': '⚪',
++    \ '\mdblkcircle': '⚫',
++    \ '\:black_circle:': '⚫',
++    \ '\mdsmwhtcircle': '⚬',
++    \ '\neuter': '⚲',
++    \ '\:soccer:': '⚽',
++    \ '\:baseball:': '⚾',
++    \ '\:snowman:': '⛄',
++    \ '\:partly_sunny:': '⛅',
++    \ '\:ophiuchus:': '⛎',
++    \ '\:no_entry:': '⛔',
++    \ '\:church:': '⛪',
++    \ '\:fountain:': '⛲',
++    \ '\:golf:': '⛳',
++    \ '\:boat:': '⛵',
++    \ '\:tent:': '⛺',
++    \ '\:fuelpump:': '⛽',
++    \ '\:scissors:': '✂',
++    \ '\:white_check_mark:': '✅',
++    \ '\:airplane:': '✈',
++    \ '\:email:': '✉',
++    \ '\:fist:': '✊',
++    \ '\:hand:': '✋',
++    \ '\:v:': '✌',
++    \ '\:pencil2:': '✏',
++    \ '\:black_nib:': '✒',
++    \ '\checkmark': '✓',
++    \ '\:heavy_check_mark:': '✔',
++    \ '\:heavy_multiplication_x:': '✖',
++    \ '\maltese': '✠',
++    \ '\:sparkles:': '✨',
++    \ '\circledstar': '✪',
++    \ '\:eight_spoked_asterisk:': '✳',
++    \ '\:eight_pointed_black_star:': '✴',
++    \ '\varstar': '✶',
++    \ '\dingasterisk': '✽',
++    \ '\:snowflake:': '❄',
++    \ '\:sparkle:': '❇',
++    \ '\:x:': '❌',
++    \ '\:negative_squared_cross_mark:': '❎',
++    \ '\:question:': '❓',
++    \ '\:grey_question:': '❔',
++    \ '\:grey_exclamation:': '❕',
++    \ '\:exclamation:': '❗',
++    \ '\:heart:': '❤',
++    \ '\:heavy_plus_sign:': '➕',
++    \ '\:heavy_minus_sign:': '➖',
++    \ '\:heavy_division_sign:': '➗',
++    \ '\draftingarrow': '➛',
++    \ '\:arrow_right:': '➡',
++    \ '\:curly_loop:': '➰',
++    \ '\:loop:': '➿',
++    \ '\threedangle': '⟀',
++    \ '\whiteinwhitetriangle': '⟁',
++    \ '\perp': '⟂',
++    \ '\bsolhsub': '⟈',
++    \ '\suphsol': '⟉',
++    \ '\wedgedot': '⟑',
++    \ '\upin': '⟒',
++    \ '\leftouterjoin': '⟕',
++    \ '\rightouterjoin': '⟖',
++    \ '\fullouterjoin': '⟗',
++    \ '\bigbot': '⟘',
++    \ '\bigtop': '⟙',
++    \ '\llbracket': '⟦',
++    \ '\openbracketleft': '⟦',
++    \ '\openbracketright': '⟧',
++    \ '\rrbracket': '⟧',
++    \ '\langle': '⟨',
++    \ '\rangle': '⟩',
++    \ '\UUparrow': '⟰',
++    \ '\DDownarrow': '⟱',
++    \ '\longleftarrow': '⟵',
++    \ '\longrightarrow': '⟶',
++    \ '\longleftrightarrow': '⟷',
++    \ '\impliedby': '⟸',
++    \ '\Longleftarrow': '⟸',
++    \ '\implies': '⟹',
++    \ '\Longrightarrow': '⟹',
++    \ '\Longleftrightarrow': '⟺',
++    \ '\iff': '⟺',
++    \ '\longmapsfrom': '⟻',
++    \ '\longmapsto': '⟼',
++    \ '\Longmapsfrom': '⟽',
++    \ '\Longmapsto': '⟾',
++    \ '\longrightsquigarrow': '⟿',
++    \ '\nvtwoheadrightarrow': '⤀',
++    \ '\nVtwoheadrightarrow': '⤁',
++    \ '\nvLeftarrow': '⤂',
++    \ '\nvRightarrow': '⤃',
++    \ '\nvLeftrightarrow': '⤄',
++    \ '\twoheadmapsto': '⤅',
++    \ '\Mapsfrom': '⤆',
++    \ '\Mapsto': '⤇',
++    \ '\downarrowbarred': '⤈',
++    \ '\uparrowbarred': '⤉',
++    \ '\Uuparrow': '⤊',
++    \ '\Ddownarrow': '⤋',
++    \ '\leftbkarrow': '⤌',
++    \ '\bkarow': '⤍',
++    \ '\leftdbkarrow': '⤎',
++    \ '\dbkarow': '⤏',
++    \ '\drbkarrow': '⤐',
++    \ '\rightdotarrow': '⤑',
++    \ '\UpArrowBar': '⤒',
++    \ '\DownArrowBar': '⤓',
++    \ '\nvrightarrowtail': '⤔',
++    \ '\nVrightarrowtail': '⤕',
++    \ '\twoheadrightarrowtail': '⤖',
++    \ '\nvtwoheadrightarrowtail': '⤗',
++    \ '\nVtwoheadrightarrowtail': '⤘',
++    \ '\diamondleftarrow': '⤝',
++    \ '\rightarrowdiamond': '⤞',
++    \ '\diamondleftarrowbar': '⤟',
++    \ '\barrightarrowdiamond': '⤠',
++    \ '\hksearow': '⤥',
++    \ '\hkswarow': '⤦',
++    \ '\tona': '⤧',
++    \ '\toea': '⤨',
++    \ '\tosa': '⤩',
++    \ '\towa': '⤪',
++    \ '\rdiagovfdiag': '⤫',
++    \ '\fdiagovrdiag': '⤬',
++    \ '\seovnearrow': '⤭',
++    \ '\neovsearrow': '⤮',
++    \ '\fdiagovnearrow': '⤯',
++    \ '\rdiagovsearrow': '⤰',
++    \ '\neovnwarrow': '⤱',
++    \ '\nwovnearrow': '⤲',
++    \ '\:arrow_heading_up:': '⤴',
++    \ '\:arrow_heading_down:': '⤵',
++    \ '\Rlarr': '⥂',
++    \ '\rLarr': '⥄',
++    \ '\rightarrowplus': '⥅',
++    \ '\leftarrowplus': '⥆',
++    \ '\rarrx': '⥇',
++    \ '\leftrightarrowcircle': '⥈',
++    \ '\twoheaduparrowcircle': '⥉',
++    \ '\leftrightharpoonupdown': '⥊',
++    \ '\leftrightharpoondownup': '⥋',
++    \ '\updownharpoonrightleft': '⥌',
++    \ '\updownharpoonleftright': '⥍',
++    \ '\LeftRightVector': '⥎',
++    \ '\RightUpDownVector': '⥏',
++    \ '\DownLeftRightVector': '⥐',
++    \ '\LeftUpDownVector': '⥑',
++    \ '\LeftVectorBar': '⥒',
++    \ '\RightVectorBar': '⥓',
++    \ '\RightUpVectorBar': '⥔',
++    \ '\RightDownVectorBar': '⥕',
++    \ '\DownLeftVectorBar': '⥖',
++    \ '\DownRightVectorBar': '⥗',
++    \ '\LeftUpVectorBar': '⥘',
++    \ '\LeftDownVectorBar': '⥙',
++    \ '\LeftTeeVector': '⥚',
++    \ '\RightTeeVector': '⥛',
++    \ '\RightUpTeeVector': '⥜',
++    \ '\RightDownTeeVector': '⥝',
++    \ '\DownLeftTeeVector': '⥞',
++    \ '\DownRightTeeVector': '⥟',
++    \ '\LeftUpTeeVector': '⥠',
++    \ '\LeftDownTeeVector': '⥡',
++    \ '\leftharpoonsupdown': '⥢',
++    \ '\upharpoonsleftright': '⥣',
++    \ '\rightharpoonsupdown': '⥤',
++    \ '\downharpoonsleftright': '⥥',
++    \ '\leftrightharpoonsup': '⥦',
++    \ '\leftrightharpoonsdown': '⥧',
++    \ '\rightleftharpoonsup': '⥨',
++    \ '\rightleftharpoonsdown': '⥩',
++    \ '\leftharpoonupdash': '⥪',
++    \ '\dashleftharpoondown': '⥫',
++    \ '\rightharpoonupdash': '⥬',
++    \ '\dashrightharpoondown': '⥭',
++    \ '\UpEquilibrium': '⥮',
++    \ '\ReverseUpEquilibrium': '⥯',
++    \ '\RoundImplies': '⥰',
++    \ '\Vvert': '⦀',
++    \ '\Elroang': '⦆',
++    \ '\ddfnc': '⦙',
++    \ '\measuredangleleft': '⦛',
++    \ '\Angle': '⦜',
++    \ '\rightanglemdot': '⦝',
++    \ '\angles': '⦞',
++    \ '\angdnr': '⦟',
++    \ '\lpargt': '⦠',
++    \ '\sphericalangleup': '⦡',
++    \ '\turnangle': '⦢',
++    \ '\revangle': '⦣',
++    \ '\angleubar': '⦤',
++    \ '\revangleubar': '⦥',
++    \ '\wideangledown': '⦦',
++    \ '\wideangleup': '⦧',
++    \ '\measanglerutone': '⦨',
++    \ '\measanglelutonw': '⦩',
++    \ '\measanglerdtose': '⦪',
++    \ '\measangleldtosw': '⦫',
++    \ '\measangleurtone': '⦬',
++    \ '\measangleultonw': '⦭',
++    \ '\measangledrtose': '⦮',
++    \ '\measangledltosw': '⦯',
++    \ '\revemptyset': '⦰',
++    \ '\emptysetobar': '⦱',
++    \ '\emptysetocirc': '⦲',
++    \ '\emptysetoarr': '⦳',
++    \ '\emptysetoarrl': '⦴',
++    \ '\circledparallel': '⦷',
++    \ '\obslash': '⦸',
++    \ '\odotslashdot': '⦼',
++    \ '\circledwhitebullet': '⦾',
++    \ '\circledbullet': '⦿',
++    \ '\olessthan': '⧀',
++    \ '\ogreaterthan': '⧁',
++    \ '\boxdiag': '⧄',
++    \ '\boxbslash': '⧅',
++    \ '\boxast': '⧆',
++    \ '\boxcircle': '⧇',
++    \ '\Lap': '⧊',
++    \ '\defas': '⧋',
++    \ '\LeftTriangleBar': '⧏',
++    \ '\NotLeftTriangleBar': '⧏̸',
++    \ '\RightTriangleBar': '⧐',
++    \ '\NotRightTriangleBar': '⧐̸',
++    \ '\dualmap': '⧟',
++    \ '\lrtriangleeq': '⧡',
++    \ '\shuffle': '⧢',
++    \ '\eparsl': '⧣',
++    \ '\smeparsl': '⧤',
++    \ '\eqvparsl': '⧥',
++    \ '\blacklozenge': '⧫',
++    \ '\RuleDelayed': '⧴',
++    \ '\dsol': '⧶',
++    \ '\rsolbar': '⧷',
++    \ '\doubleplus': '⧺',
++    \ '\tripleplus': '⧻',
++    \ '\bigodot': '⨀',
++    \ '\bigoplus': '⨁',
++    \ '\bigotimes': '⨂',
++    \ '\bigcupdot': '⨃',
++    \ '\biguplus': '⨄',
++    \ '\bigsqcap': '⨅',
++    \ '\bigsqcup': '⨆',
++    \ '\conjquant': '⨇',
++    \ '\disjquant': '⨈',
++    \ '\bigtimes': '⨉',
++    \ '\modtwosum': '⨊',
++    \ '\sumint': '⨋',
++    \ '\iiiint': '⨌',
++    \ '\intbar': '⨍',
++    \ '\intBar': '⨎',
++    \ '\clockoint': '⨏',
++    \ '\cirfnint': '⨐',
++    \ '\awint': '⨑',
++    \ '\rppolint': '⨒',
++    \ '\scpolint': '⨓',
++    \ '\npolint': '⨔',
++    \ '\pointint': '⨕',
++    \ '\sqrint': '⨖',
++    \ '\intx': '⨘',
++    \ '\intcap': '⨙',
++    \ '\intcup': '⨚',
++    \ '\upint': '⨛',
++    \ '\lowint': '⨜',
++    \ '\Join': '⨝',
++    \ '\join': '⨝',
++    \ '\ringplus': '⨢',
++    \ '\plushat': '⨣',
++    \ '\simplus': '⨤',
++    \ '\plusdot': '⨥',
++    \ '\plussim': '⨦',
++    \ '\plussubtwo': '⨧',
++    \ '\plustrif': '⨨',
++    \ '\commaminus': '⨩',
++    \ '\minusdot': '⨪',
++    \ '\minusfdots': '⨫',
++    \ '\minusrdots': '⨬',
++    \ '\opluslhrim': '⨭',
++    \ '\oplusrhrim': '⨮',
++    \ '\Times': '⨯',
++    \ '\dottimes': '⨰',
++    \ '\timesbar': '⨱',
++    \ '\btimes': '⨲',
++    \ '\smashtimes': '⨳',
++    \ '\otimeslhrim': '⨴',
++    \ '\otimesrhrim': '⨵',
++    \ '\otimeshat': '⨶',
++    \ '\Otimes': '⨷',
++    \ '\odiv': '⨸',
++    \ '\triangleplus': '⨹',
++    \ '\triangleminus': '⨺',
++    \ '\triangletimes': '⨻',
++    \ '\intprod': '⨼',
++    \ '\intprodr': '⨽',
++    \ '\amalg': '⨿',
++    \ '\capdot': '⩀',
++    \ '\uminus': '⩁',
++    \ '\barcup': '⩂',
++    \ '\barcap': '⩃',
++    \ '\capwedge': '⩄',
++    \ '\cupvee': '⩅',
++    \ '\twocups': '⩊',
++    \ '\twocaps': '⩋',
++    \ '\closedvarcup': '⩌',
++    \ '\closedvarcap': '⩍',
++    \ '\Sqcap': '⩎',
++    \ '\Sqcup': '⩏',
++    \ '\closedvarcupsmashprod': '⩐',
++    \ '\wedgeodot': '⩑',
++    \ '\veeodot': '⩒',
++    \ '\And': '⩓',
++    \ '\Or': '⩔',
++    \ '\wedgeonwedge': '⩕',
++    \ '\ElOr': '⩖',
++    \ '\bigslopedvee': '⩗',
++    \ '\bigslopedwedge': '⩘',
++    \ '\wedgemidvert': '⩚',
++    \ '\veemidvert': '⩛',
++    \ '\midbarwedge': '⩜',
++    \ '\midbarvee': '⩝',
++    \ '\perspcorrespond': '⩞',
++    \ '\minhat': '⩟',
++    \ '\wedgedoublebar': '⩠',
++    \ '\varveebar': '⩡',
++    \ '\doublebarvee': '⩢',
++    \ '\veedoublebar': '⩣',
++    \ '\eqdot': '⩦',
++    \ '\dotequiv': '⩧',
++    \ '\dotsim': '⩪',
++    \ '\simrdots': '⩫',
++    \ '\simminussim': '⩬',
++    \ '\congdot': '⩭',
++    \ '\asteq': '⩮',
++    \ '\hatapprox': '⩯',
++    \ '\approxeqq': '⩰',
++    \ '\eqqplus': '⩱',
++    \ '\pluseqq': '⩲',
++    \ '\eqqsim': '⩳',
++    \ '\Coloneq': '⩴',
++    \ '\Equal': '⩵',
++    \ '\eqeqeq': '⩶',
++    \ '\ddotseq': '⩷',
++    \ '\equivDD': '⩸',
++    \ '\ltcir': '⩹',
++    \ '\gtcir': '⩺',
++    \ '\ltquest': '⩻',
++    \ '\gtquest': '⩼',
++    \ '\leqslant': '⩽',
++    \ '\nleqslant': '⩽̸',
++    \ '\geqslant': '⩾',
++    \ '\ngeqslant': '⩾̸',
++    \ '\lesdot': '⩿',
++    \ '\gesdot': '⪀',
++    \ '\lesdoto': '⪁',
++    \ '\gesdoto': '⪂',
++    \ '\lesdotor': '⪃',
++    \ '\gesdotol': '⪄',
++    \ '\lessapprox': '⪅',
++    \ '\gtrapprox': '⪆',
++    \ '\lneq': '⪇',
++    \ '\gneq': '⪈',
++    \ '\lnapprox': '⪉',
++    \ '\gnapprox': '⪊',
++    \ '\lesseqqgtr': '⪋',
++    \ '\gtreqqless': '⪌',
++    \ '\lsime': '⪍',
++    \ '\gsime': '⪎',
++    \ '\lsimg': '⪏',
++    \ '\gsiml': '⪐',
++    \ '\lgE': '⪑',
++    \ '\glE': '⪒',
++    \ '\lesges': '⪓',
++    \ '\gesles': '⪔',
++    \ '\eqslantless': '⪕',
++    \ '\eqslantgtr': '⪖',
++    \ '\elsdot': '⪗',
++    \ '\egsdot': '⪘',
++    \ '\eqqless': '⪙',
++    \ '\eqqgtr': '⪚',
++    \ '\eqqslantless': '⪛',
++    \ '\eqqslantgtr': '⪜',
++    \ '\simless': '⪝',
++    \ '\simgtr': '⪞',
++    \ '\simlE': '⪟',
++    \ '\simgE': '⪠',
++    \ '\NestedLessLess': '⪡',
++    \ '\NotNestedLessLess': '⪡̸',
++    \ '\NestedGreaterGreater': '⪢',
++    \ '\NotNestedGreaterGreater': '⪢̸',
++    \ '\partialmeetcontraction': '⪣',
++    \ '\glj': '⪤',
++    \ '\gla': '⪥',
++    \ '\ltcc': '⪦',
++    \ '\gtcc': '⪧',
++    \ '\lescc': '⪨',
++    \ '\gescc': '⪩',
++    \ '\smt': '⪪',
++    \ '\lat': '⪫',
++    \ '\smte': '⪬',
++    \ '\late': '⪭',
++    \ '\bumpeqq': '⪮',
++    \ '\preceq': '⪯',
++    \ '\npreceq': '⪯̸',
++    \ '\succeq': '⪰',
++    \ '\nsucceq': '⪰̸',
++    \ '\precneq': '⪱',
++    \ '\succneq': '⪲',
++    \ '\preceqq': '⪳',
++    \ '\succeqq': '⪴',
++    \ '\precneqq': '⪵',
++    \ '\succneqq': '⪶',
++    \ '\precapprox': '⪷',
++    \ '\succapprox': '⪸',
++    \ '\precnapprox': '⪹',
++    \ '\succnapprox': '⪺',
++    \ '\Prec': '⪻',
++    \ '\Succ': '⪼',
++    \ '\subsetdot': '⪽',
++    \ '\supsetdot': '⪾',
++    \ '\subsetplus': '⪿',
++    \ '\supsetplus': '⫀',
++    \ '\submult': '⫁',
++    \ '\supmult': '⫂',
++    \ '\subedot': '⫃',
++    \ '\supedot': '⫄',
++    \ '\subseteqq': '⫅',
++    \ '\nsubseteqq': '⫅̸',
++    \ '\supseteqq': '⫆',
++    \ '\nsupseteqq': '⫆̸',
++    \ '\subsim': '⫇',
++    \ '\supsim': '⫈',
++    \ '\subsetapprox': '⫉',
++    \ '\supsetapprox': '⫊',
++    \ '\subsetneqq': '⫋',
++    \ '\supsetneqq': '⫌',
++    \ '\lsqhook': '⫍',
++    \ '\rsqhook': '⫎',
++    \ '\csub': '⫏',
++    \ '\csup': '⫐',
++    \ '\csube': '⫑',
++    \ '\csupe': '⫒',
++    \ '\subsup': '⫓',
++    \ '\supsub': '⫔',
++    \ '\subsub': '⫕',
++    \ '\supsup': '⫖',
++    \ '\suphsub': '⫗',
++    \ '\supdsub': '⫘',
++    \ '\forkv': '⫙',
++    \ '\mlcp': '⫛',
++    \ '\forks': '⫝̸',
++    \ '\forksnot': '⫝',
++    \ '\dashV': '⫣',
++    \ '\Dashv': '⫤',
++    \ '\interleave': '⫴',
++    \ '\tdcol': '⫶',
++    \ '\lllnest': '⫷',
++    \ '\gggnest': '⫸',
++    \ '\leqqslant': '⫹',
++    \ '\geqqslant': '⫺',
++    \ '\:arrow_left:': '⬅',
++    \ '\:arrow_up:': '⬆',
++    \ '\:arrow_down:': '⬇',
++    \ '\squaretopblack': '⬒',
++    \ '\squarebotblack': '⬓',
++    \ '\squareurblack': '⬔',
++    \ '\squarellblack': '⬕',
++    \ '\diamondleftblack': '⬖',
++    \ '\diamondrightblack': '⬗',
++    \ '\diamondtopblack': '⬘',
++    \ '\diamondbotblack': '⬙',
++    \ '\dottedsquare': '⬚',
++    \ '\lgblksquare': '⬛',
++    \ '\:black_large_square:': '⬛',
++    \ '\lgwhtsquare': '⬜',
++    \ '\:white_large_square:': '⬜',
++    \ '\vysmblksquare': '⬝',
++    \ '\vysmwhtsquare': '⬞',
++    \ '\pentagonblack': '⬟',
++    \ '\pentagon': '⬠',
++    \ '\varhexagon': '⬡',
++    \ '\varhexagonblack': '⬢',
++    \ '\hexagonblack': '⬣',
++    \ '\lgblkcircle': '⬤',
++    \ '\mdblkdiamond': '⬥',
++    \ '\mdwhtdiamond': '⬦',
++    \ '\mdblklozenge': '⬧',
++    \ '\mdwhtlozenge': '⬨',
++    \ '\smblkdiamond': '⬩',
++    \ '\smblklozenge': '⬪',
++    \ '\smwhtlozenge': '⬫',
++    \ '\blkhorzoval': '⬬',
++    \ '\whthorzoval': '⬭',
++    \ '\blkvertoval': '⬮',
++    \ '\whtvertoval': '⬯',
++    \ '\circleonleftarrow': '⬰',
++    \ '\leftthreearrows': '⬱',
++    \ '\leftarrowonoplus': '⬲',
++    \ '\longleftsquigarrow': '⬳',
++    \ '\nvtwoheadleftarrow': '⬴',
++    \ '\nVtwoheadleftarrow': '⬵',
++    \ '\twoheadmapsfrom': '⬶',
++    \ '\twoheadleftdbkarrow': '⬷',
++    \ '\leftdotarrow': '⬸',
++    \ '\nvleftarrowtail': '⬹',
++    \ '\nVleftarrowtail': '⬺',
++    \ '\twoheadleftarrowtail': '⬻',
++    \ '\nvtwoheadleftarrowtail': '⬼',
++    \ '\nVtwoheadleftarrowtail': '⬽',
++    \ '\leftarrowx': '⬾',
++    \ '\leftcurvedarrow': '⬿',
++    \ '\equalleftarrow': '⭀',
++    \ '\bsimilarleftarrow': '⭁',
++    \ '\leftarrowbackapprox': '⭂',
++    \ '\rightarrowgtr': '⭃',
++    \ '\rightarrowsupset': '⭄',
++    \ '\LLeftarrow': '⭅',
++    \ '\RRightarrow': '⭆',
++    \ '\bsimilarrightarrow': '⭇',
++    \ '\rightarrowbackapprox': '⭈',
++    \ '\similarleftarrow': '⭉',
++    \ '\leftarrowapprox': '⭊',
++    \ '\leftarrowbsimilar': '⭋',
++    \ '\rightarrowbsimilar': '⭌',
++    \ '\medwhitestar': '⭐',
++    \ '\:star:': '⭐',
++    \ '\medblackstar': '⭑',
++    \ '\smwhitestar': '⭒',
++    \ '\rightpentagonblack': '⭓',
++    \ '\rightpentagon': '⭔',
++    \ '\:o:': '⭕',
++    \ '\_j': 'ⱼ',
++    \ '\^V': 'ⱽ',
++    \ '\postalmark': '〒',
++    \ '\:wavy_dash:': '〰',
++    \ '\:part_alternation_mark:': '〽',
++    \ '\:congratulations:': '㊗',
++    \ '\:secret:': '㊙',
++    \ '\bfA': '𝐀',
++    \ '\bfB': '𝐁',
++    \ '\bfC': '𝐂',
++    \ '\bfD': '𝐃',
++    \ '\bfE': '𝐄',
++    \ '\bfF': '𝐅',
++    \ '\bfG': '𝐆',
++    \ '\bfH': '𝐇',
++    \ '\bfI': '𝐈',
++    \ '\bfJ': '𝐉',
++    \ '\bfK': '𝐊',
++    \ '\bfL': '𝐋',
++    \ '\bfM': '𝐌',
++    \ '\bfN': '𝐍',
++    \ '\bfO': '𝐎',
++    \ '\bfP': '𝐏',
++    \ '\bfQ': '𝐐',
++    \ '\bfR': '𝐑',
++    \ '\bfS': '𝐒',
++    \ '\bfT': '𝐓',
++    \ '\bfU': '𝐔',
++    \ '\bfV': '𝐕',
++    \ '\bfW': '𝐖',
++    \ '\bfX': '𝐗',
++    \ '\bfY': '𝐘',
++    \ '\bfZ': '𝐙',
++    \ '\bfa': '𝐚',
++    \ '\bfb': '𝐛',
++    \ '\bfc': '𝐜',
++    \ '\bfd': '𝐝',
++    \ '\bfe': '𝐞',
++    \ '\bff': '𝐟',
++    \ '\bfg': '𝐠',
++    \ '\bfh': '𝐡',
++    \ '\bfi': '𝐢',
++    \ '\bfj': '𝐣',
++    \ '\bfk': '𝐤',
++    \ '\bfl': '𝐥',
++    \ '\bfm': '𝐦',
++    \ '\bfn': '𝐧',
++    \ '\bfo': '𝐨',
++    \ '\bfp': '𝐩',
++    \ '\bfq': '𝐪',
++    \ '\bfr': '𝐫',
++    \ '\bfs': '𝐬',
++    \ '\bft': '𝐭',
++    \ '\bfu': '𝐮',
++    \ '\bfv': '𝐯',
++    \ '\bfw': '𝐰',
++    \ '\bfx': '𝐱',
++    \ '\bfy': '𝐲',
++    \ '\bfz': '𝐳',
++    \ '\itA': '𝐴',
++    \ '\itB': '𝐵',
++    \ '\itC': '𝐶',
++    \ '\itD': '𝐷',
++    \ '\itE': '𝐸',
++    \ '\itF': '𝐹',
++    \ '\itG': '𝐺',
++    \ '\itH': '𝐻',
++    \ '\itI': '𝐼',
++    \ '\itJ': '𝐽',
++    \ '\itK': '𝐾',
++    \ '\itL': '𝐿',
++    \ '\itM': '𝑀',
++    \ '\itN': '𝑁',
++    \ '\itO': '𝑂',
++    \ '\itP': '𝑃',
++    \ '\itQ': '𝑄',
++    \ '\itR': '𝑅',
++    \ '\itS': '𝑆',
++    \ '\itT': '𝑇',
++    \ '\itU': '𝑈',
++    \ '\itV': '𝑉',
++    \ '\itW': '𝑊',
++    \ '\itX': '𝑋',
++    \ '\itY': '𝑌',
++    \ '\itZ': '𝑍',
++    \ '\ita': '𝑎',
++    \ '\itb': '𝑏',
++    \ '\itc': '𝑐',
++    \ '\itd': '𝑑',
++    \ '\ite': '𝑒',
++    \ '\itf': '𝑓',
++    \ '\itg': '𝑔',
++    \ '\iti': '𝑖',
++    \ '\itj': '𝑗',
++    \ '\itk': '𝑘',
++    \ '\itl': '𝑙',
++    \ '\itm': '𝑚',
++    \ '\itn': '𝑛',
++    \ '\ito': '𝑜',
++    \ '\itp': '𝑝',
++    \ '\itq': '𝑞',
++    \ '\itr': '𝑟',
++    \ '\its': '𝑠',
++    \ '\itt': '𝑡',
++    \ '\itu': '𝑢',
++    \ '\itv': '𝑣',
++    \ '\itw': '𝑤',
++    \ '\itx': '𝑥',
++    \ '\ity': '𝑦',
++    \ '\itz': '𝑧',
++    \ '\biA': '𝑨',
++    \ '\biB': '𝑩',
++    \ '\biC': '𝑪',
++    \ '\biD': '𝑫',
++    \ '\biE': '𝑬',
++    \ '\biF': '𝑭',
++    \ '\biG': '𝑮',
++    \ '\biH': '𝑯',
++    \ '\biI': '𝑰',
++    \ '\biJ': '𝑱',
++    \ '\biK': '𝑲',
++    \ '\biL': '𝑳',
++    \ '\biM': '𝑴',
++    \ '\biN': '𝑵',
++    \ '\biO': '𝑶',
++    \ '\biP': '𝑷',
++    \ '\biQ': '𝑸',
++    \ '\biR': '𝑹',
++    \ '\biS': '𝑺',
++    \ '\biT': '𝑻',
++    \ '\biU': '𝑼',
++    \ '\biV': '𝑽',
++    \ '\biW': '𝑾',
++    \ '\biX': '𝑿',
++    \ '\biY': '𝒀',
++    \ '\biZ': '𝒁',
++    \ '\bia': '𝒂',
++    \ '\bib': '𝒃',
++    \ '\bic': '𝒄',
++    \ '\bid': '𝒅',
++    \ '\bie': '𝒆',
++    \ '\bif': '𝒇',
++    \ '\big': '𝒈',
++    \ '\bih': '𝒉',
++    \ '\bii': '𝒊',
++    \ '\bij': '𝒋',
++    \ '\bik': '𝒌',
++    \ '\bil': '𝒍',
++    \ '\bim': '𝒎',
++    \ '\bin': '𝒏',
++    \ '\bio': '𝒐',
++    \ '\bip': '𝒑',
++    \ '\biq': '𝒒',
++    \ '\bir': '𝒓',
++    \ '\bis': '𝒔',
++    \ '\bit': '𝒕',
++    \ '\biu': '𝒖',
++    \ '\biv': '𝒗',
++    \ '\biw': '𝒘',
++    \ '\bix': '𝒙',
++    \ '\biy': '𝒚',
++    \ '\biz': '𝒛',
++    \ '\scrA': '𝒜',
++    \ '\scrC': '𝒞',
++    \ '\scrD': '𝒟',
++    \ '\scrG': '𝒢',
++    \ '\scrJ': '𝒥',
++    \ '\scrK': '𝒦',
++    \ '\scrN': '𝒩',
++    \ '\scrO': '𝒪',
++    \ '\scrP': '𝒫',
++    \ '\scrQ': '𝒬',
++    \ '\scrS': '𝒮',
++    \ '\scrT': '𝒯',
++    \ '\scrU': '𝒰',
++    \ '\scrV': '𝒱',
++    \ '\scrW': '𝒲',
++    \ '\scrX': '𝒳',
++    \ '\scrY': '𝒴',
++    \ '\scrZ': '𝒵',
++    \ '\scra': '𝒶',
++    \ '\scrb': '𝒷',
++    \ '\scrc': '𝒸',
++    \ '\scrd': '𝒹',
++    \ '\scrf': '𝒻',
++    \ '\scrh': '𝒽',
++    \ '\scri': '𝒾',
++    \ '\scrj': '𝒿',
++    \ '\scrk': '𝓀',
++    \ '\scrl': '𝓁',
++    \ '\scrm': '𝓂',
++    \ '\scrn': '𝓃',
++    \ '\scrp': '𝓅',
++    \ '\scrq': '𝓆',
++    \ '\scrr': '𝓇',
++    \ '\scrs': '𝓈',
++    \ '\scrt': '𝓉',
++    \ '\scru': '𝓊',
++    \ '\scrv': '𝓋',
++    \ '\scrw': '𝓌',
++    \ '\scrx': '𝓍',
++    \ '\scry': '𝓎',
++    \ '\scrz': '𝓏',
++    \ '\bscrA': '𝓐',
++    \ '\bscrB': '𝓑',
++    \ '\bscrC': '𝓒',
++    \ '\bscrD': '𝓓',
++    \ '\bscrE': '𝓔',
++    \ '\bscrF': '𝓕',
++    \ '\bscrG': '𝓖',
++    \ '\bscrH': '𝓗',
++    \ '\bscrI': '𝓘',
++    \ '\bscrJ': '𝓙',
++    \ '\bscrK': '𝓚',
++    \ '\bscrL': '𝓛',
++    \ '\bscrM': '𝓜',
++    \ '\bscrN': '𝓝',
++    \ '\bscrO': '𝓞',
++    \ '\bscrP': '𝓟',
++    \ '\bscrQ': '𝓠',
++    \ '\bscrR': '𝓡',
++    \ '\bscrS': '𝓢',
++    \ '\bscrT': '𝓣',
++    \ '\bscrU': '𝓤',
++    \ '\bscrV': '𝓥',
++    \ '\bscrW': '𝓦',
++    \ '\bscrX': '𝓧',
++    \ '\bscrY': '𝓨',
++    \ '\bscrZ': '𝓩',
++    \ '\bscra': '𝓪',
++    \ '\bscrb': '𝓫',
++    \ '\bscrc': '𝓬',
++    \ '\bscrd': '𝓭',
++    \ '\bscre': '𝓮',
++    \ '\bscrf': '𝓯',
++    \ '\bscrg': '𝓰',
++    \ '\bscrh': '𝓱',
++    \ '\bscri': '𝓲',
++    \ '\bscrj': '𝓳',
++    \ '\bscrk': '𝓴',
++    \ '\bscrl': '𝓵',
++    \ '\bscrm': '𝓶',
++    \ '\bscrn': '𝓷',
++    \ '\bscro': '𝓸',
++    \ '\bscrp': '𝓹',
++    \ '\bscrq': '𝓺',
++    \ '\bscrr': '𝓻',
++    \ '\bscrs': '𝓼',
++    \ '\bscrt': '𝓽',
++    \ '\bscru': '𝓾',
++    \ '\bscrv': '𝓿',
++    \ '\bscrw': '𝔀',
++    \ '\bscrx': '𝔁',
++    \ '\bscry': '𝔂',
++    \ '\bscrz': '𝔃',
++    \ '\frakA': '𝔄',
++    \ '\frakB': '𝔅',
++    \ '\frakD': '𝔇',
++    \ '\frakE': '𝔈',
++    \ '\frakF': '𝔉',
++    \ '\frakG': '𝔊',
++    \ '\frakJ': '𝔍',
++    \ '\frakK': '𝔎',
++    \ '\frakL': '𝔏',
++    \ '\frakM': '𝔐',
++    \ '\frakN': '𝔑',
++    \ '\frakO': '𝔒',
++    \ '\frakP': '𝔓',
++    \ '\frakQ': '𝔔',
++    \ '\frakS': '𝔖',
++    \ '\frakT': '𝔗',
++    \ '\frakU': '𝔘',
++    \ '\frakV': '𝔙',
++    \ '\frakW': '𝔚',
++    \ '\frakX': '𝔛',
++    \ '\frakY': '𝔜',
++    \ '\fraka': '𝔞',
++    \ '\frakb': '𝔟',
++    \ '\frakc': '𝔠',
++    \ '\frakd': '𝔡',
++    \ '\frake': '𝔢',
++    \ '\frakf': '𝔣',
++    \ '\frakg': '𝔤',
++    \ '\frakh': '𝔥',
++    \ '\fraki': '𝔦',
++    \ '\frakj': '𝔧',
++    \ '\frakk': '𝔨',
++    \ '\frakl': '𝔩',
++    \ '\frakm': '𝔪',
++    \ '\frakn': '𝔫',
++    \ '\frako': '𝔬',
++    \ '\frakp': '𝔭',
++    \ '\frakq': '𝔮',
++    \ '\frakr': '𝔯',
++    \ '\fraks': '𝔰',
++    \ '\frakt': '𝔱',
++    \ '\fraku': '𝔲',
++    \ '\frakv': '𝔳',
++    \ '\frakw': '𝔴',
++    \ '\frakx': '𝔵',
++    \ '\fraky': '𝔶',
++    \ '\frakz': '𝔷',
++    \ '\bbA': '𝔸',
++    \ '\bbB': '𝔹',
++    \ '\bbD': '𝔻',
++    \ '\bbE': '𝔼',
++    \ '\bbF': '𝔽',
++    \ '\bbG': '𝔾',
++    \ '\bbI': '𝕀',
++    \ '\bbJ': '𝕁',
++    \ '\bbK': '𝕂',
++    \ '\bbL': '𝕃',
++    \ '\bbM': '𝕄',
++    \ '\bbO': '𝕆',
++    \ '\bbS': '𝕊',
++    \ '\bbT': '𝕋',
++    \ '\bbU': '𝕌',
++    \ '\bbV': '𝕍',
++    \ '\bbW': '𝕎',
++    \ '\bbX': '𝕏',
++    \ '\bbY': '𝕐',
++    \ '\bba': '𝕒',
++    \ '\bbb': '𝕓',
++    \ '\bbc': '𝕔',
++    \ '\bbd': '𝕕',
++    \ '\bbe': '𝕖',
++    \ '\bbf': '𝕗',
++    \ '\bbg': '𝕘',
++    \ '\bbh': '𝕙',
++    \ '\bbi': '𝕚',
++    \ '\bbj': '𝕛',
++    \ '\bbk': '𝕜',
++    \ '\bbl': '𝕝',
++    \ '\bbm': '𝕞',
++    \ '\bbn': '𝕟',
++    \ '\bbo': '𝕠',
++    \ '\bbp': '𝕡',
++    \ '\bbq': '𝕢',
++    \ '\bbr': '𝕣',
++    \ '\bbs': '𝕤',
++    \ '\bbt': '𝕥',
++    \ '\bbu': '𝕦',
++    \ '\bbv': '𝕧',
++    \ '\bbw': '𝕨',
++    \ '\bbx': '𝕩',
++    \ '\bby': '𝕪',
++    \ '\bbz': '𝕫',
++    \ '\bfrakA': '𝕬',
++    \ '\bfrakB': '𝕭',
++    \ '\bfrakC': '𝕮',
++    \ '\bfrakD': '𝕯',
++    \ '\bfrakE': '𝕰',
++    \ '\bfrakF': '𝕱',
++    \ '\bfrakG': '𝕲',
++    \ '\bfrakH': '𝕳',
++    \ '\bfrakI': '𝕴',
++    \ '\bfrakJ': '𝕵',
++    \ '\bfrakK': '𝕶',
++    \ '\bfrakL': '𝕷',
++    \ '\bfrakM': '𝕸',
++    \ '\bfrakN': '𝕹',
++    \ '\bfrakO': '𝕺',
++    \ '\bfrakP': '𝕻',
++    \ '\bfrakQ': '𝕼',
++    \ '\bfrakR': '𝕽',
++    \ '\bfrakS': '𝕾',
++    \ '\bfrakT': '𝕿',
++    \ '\bfrakU': '𝖀',
++    \ '\bfrakV': '𝖁',
++    \ '\bfrakW': '𝖂',
++    \ '\bfrakX': '𝖃',
++    \ '\bfrakY': '𝖄',
++    \ '\bfrakZ': '𝖅',
++    \ '\bfraka': '𝖆',
++    \ '\bfrakb': '𝖇',
++    \ '\bfrakc': '𝖈',
++    \ '\bfrakd': '𝖉',
++    \ '\bfrake': '𝖊',
++    \ '\bfrakf': '𝖋',
++    \ '\bfrakg': '𝖌',
++    \ '\bfrakh': '𝖍',
++    \ '\bfraki': '𝖎',
++    \ '\bfrakj': '𝖏',
++    \ '\bfrakk': '𝖐',
++    \ '\bfrakl': '𝖑',
++    \ '\bfrakm': '𝖒',
++    \ '\bfrakn': '𝖓',
++    \ '\bfrako': '𝖔',
++    \ '\bfrakp': '𝖕',
++    \ '\bfrakq': '𝖖',
++    \ '\bfrakr': '𝖗',
++    \ '\bfraks': '𝖘',
++    \ '\bfrakt': '𝖙',
++    \ '\bfraku': '𝖚',
++    \ '\bfrakv': '𝖛',
++    \ '\bfrakw': '𝖜',
++    \ '\bfrakx': '𝖝',
++    \ '\bfraky': '𝖞',
++    \ '\bfrakz': '𝖟',
++    \ '\sansA': '𝖠',
++    \ '\sansB': '𝖡',
++    \ '\sansC': '𝖢',
++    \ '\sansD': '𝖣',
++    \ '\sansE': '𝖤',
++    \ '\sansF': '𝖥',
++    \ '\sansG': '𝖦',
++    \ '\sansH': '𝖧',
++    \ '\sansI': '𝖨',
++    \ '\sansJ': '𝖩',
++    \ '\sansK': '𝖪',
++    \ '\sansL': '𝖫',
++    \ '\sansM': '𝖬',
++    \ '\sansN': '𝖭',
++    \ '\sansO': '𝖮',
++    \ '\sansP': '𝖯',
++    \ '\sansQ': '𝖰',
++    \ '\sansR': '𝖱',
++    \ '\sansS': '𝖲',
++    \ '\sansT': '𝖳',
++    \ '\sansU': '𝖴',
++    \ '\sansV': '𝖵',
++    \ '\sansW': '𝖶',
++    \ '\sansX': '𝖷',
++    \ '\sansY': '𝖸',
++    \ '\sansZ': '𝖹',
++    \ '\sansa': '𝖺',
++    \ '\sansb': '𝖻',
++    \ '\sansc': '𝖼',
++    \ '\sansd': '𝖽',
++    \ '\sanse': '𝖾',
++    \ '\sansf': '𝖿',
++    \ '\sansg': '𝗀',
++    \ '\sansh': '𝗁',
++    \ '\sansi': '𝗂',
++    \ '\sansj': '𝗃',
++    \ '\sansk': '𝗄',
++    \ '\sansl': '𝗅',
++    \ '\sansm': '𝗆',
++    \ '\sansn': '𝗇',
++    \ '\sanso': '𝗈',
++    \ '\sansp': '𝗉',
++    \ '\sansq': '𝗊',
++    \ '\sansr': '𝗋',
++    \ '\sanss': '𝗌',
++    \ '\sanst': '𝗍',
++    \ '\sansu': '𝗎',
++    \ '\sansv': '𝗏',
++    \ '\sansw': '𝗐',
++    \ '\sansx': '𝗑',
++    \ '\sansy': '𝗒',
++    \ '\sansz': '𝗓',
++    \ '\bsansA': '𝗔',
++    \ '\bsansB': '𝗕',
++    \ '\bsansC': '𝗖',
++    \ '\bsansD': '𝗗',
++    \ '\bsansE': '𝗘',
++    \ '\bsansF': '𝗙',
++    \ '\bsansG': '𝗚',
++    \ '\bsansH': '𝗛',
++    \ '\bsansI': '𝗜',
++    \ '\bsansJ': '𝗝',
++    \ '\bsansK': '𝗞',
++    \ '\bsansL': '𝗟',
++    \ '\bsansM': '𝗠',
++    \ '\bsansN': '𝗡',
++    \ '\bsansO': '𝗢',
++    \ '\bsansP': '𝗣',
++    \ '\bsansQ': '𝗤',
++    \ '\bsansR': '𝗥',
++    \ '\bsansS': '𝗦',
++    \ '\bsansT': '𝗧',
++    \ '\bsansU': '𝗨',
++    \ '\bsansV': '𝗩',
++    \ '\bsansW': '𝗪',
++    \ '\bsansX': '𝗫',
++    \ '\bsansY': '𝗬',
++    \ '\bsansZ': '𝗭',
++    \ '\bsansa': '𝗮',
++    \ '\bsansb': '𝗯',
++    \ '\bsansc': '𝗰',
++    \ '\bsansd': '𝗱',
++    \ '\bsanse': '𝗲',
++    \ '\bsansf': '𝗳',
++    \ '\bsansg': '𝗴',
++    \ '\bsansh': '𝗵',
++    \ '\bsansi': '𝗶',
++    \ '\bsansj': '𝗷',
++    \ '\bsansk': '𝗸',
++    \ '\bsansl': '𝗹',
++    \ '\bsansm': '𝗺',
++    \ '\bsansn': '𝗻',
++    \ '\bsanso': '𝗼',
++    \ '\bsansp': '𝗽',
++    \ '\bsansq': '𝗾',
++    \ '\bsansr': '𝗿',
++    \ '\bsanss': '𝘀',
++    \ '\bsanst': '𝘁',
++    \ '\bsansu': '𝘂',
++    \ '\bsansv': '𝘃',
++    \ '\bsansw': '𝘄',
++    \ '\bsansx': '𝘅',
++    \ '\bsansy': '𝘆',
++    \ '\bsansz': '𝘇',
++    \ '\isansA': '𝘈',
++    \ '\isansB': '𝘉',
++    \ '\isansC': '𝘊',
++    \ '\isansD': '𝘋',
++    \ '\isansE': '𝘌',
++    \ '\isansF': '𝘍',
++    \ '\isansG': '𝘎',
++    \ '\isansH': '𝘏',
++    \ '\isansI': '𝘐',
++    \ '\isansJ': '𝘑',
++    \ '\isansK': '𝘒',
++    \ '\isansL': '𝘓',
++    \ '\isansM': '𝘔',
++    \ '\isansN': '𝘕',
++    \ '\isansO': '𝘖',
++    \ '\isansP': '𝘗',
++    \ '\isansQ': '𝘘',
++    \ '\isansR': '𝘙',
++    \ '\isansS': '𝘚',
++    \ '\isansT': '𝘛',
++    \ '\isansU': '𝘜',
++    \ '\isansV': '𝘝',
++    \ '\isansW': '𝘞',
++    \ '\isansX': '𝘟',
++    \ '\isansY': '𝘠',
++    \ '\isansZ': '𝘡',
++    \ '\isansa': '𝘢',
++    \ '\isansb': '𝘣',
++    \ '\isansc': '𝘤',
++    \ '\isansd': '𝘥',
++    \ '\isanse': '𝘦',
++    \ '\isansf': '𝘧',
++    \ '\isansg': '𝘨',
++    \ '\isansh': '𝘩',
++    \ '\isansi': '𝘪',
++    \ '\isansj': '𝘫',
++    \ '\isansk': '𝘬',
++    \ '\isansl': '𝘭',
++    \ '\isansm': '𝘮',
++    \ '\isansn': '𝘯',
++    \ '\isanso': '𝘰',
++    \ '\isansp': '𝘱',
++    \ '\isansq': '𝘲',
++    \ '\isansr': '𝘳',
++    \ '\isanss': '𝘴',
++    \ '\isanst': '𝘵',
++    \ '\isansu': '𝘶',
++    \ '\isansv': '𝘷',
++    \ '\isansw': '𝘸',
++    \ '\isansx': '𝘹',
++    \ '\isansy': '𝘺',
++    \ '\isansz': '𝘻',
++    \ '\bisansA': '𝘼',
++    \ '\bisansB': '𝘽',
++    \ '\bisansC': '𝘾',
++    \ '\bisansD': '𝘿',
++    \ '\bisansE': '𝙀',
++    \ '\bisansF': '𝙁',
++    \ '\bisansG': '𝙂',
++    \ '\bisansH': '𝙃',
++    \ '\bisansI': '𝙄',
++    \ '\bisansJ': '𝙅',
++    \ '\bisansK': '𝙆',
++    \ '\bisansL': '𝙇',
++    \ '\bisansM': '𝙈',
++    \ '\bisansN': '𝙉',
++    \ '\bisansO': '𝙊',
++    \ '\bisansP': '𝙋',
++    \ '\bisansQ': '𝙌',
++    \ '\bisansR': '𝙍',
++    \ '\bisansS': '𝙎',
++    \ '\bisansT': '𝙏',
++    \ '\bisansU': '𝙐',
++    \ '\bisansV': '𝙑',
++    \ '\bisansW': '𝙒',
++    \ '\bisansX': '𝙓',
++    \ '\bisansY': '𝙔',
++    \ '\bisansZ': '𝙕',
++    \ '\bisansa': '𝙖',
++    \ '\bisansb': '𝙗',
++    \ '\bisansc': '𝙘',
++    \ '\bisansd': '𝙙',
++    \ '\bisanse': '𝙚',
++    \ '\bisansf': '𝙛',
++    \ '\bisansg': '𝙜',
++    \ '\bisansh': '𝙝',
++    \ '\bisansi': '𝙞',
++    \ '\bisansj': '𝙟',
++    \ '\bisansk': '𝙠',
++    \ '\bisansl': '𝙡',
++    \ '\bisansm': '𝙢',
++    \ '\bisansn': '𝙣',
++    \ '\bisanso': '𝙤',
++    \ '\bisansp': '𝙥',
++    \ '\bisansq': '𝙦',
++    \ '\bisansr': '𝙧',
++    \ '\bisanss': '𝙨',
++    \ '\bisanst': '𝙩',
++    \ '\bisansu': '𝙪',
++    \ '\bisansv': '𝙫',
++    \ '\bisansw': '𝙬',
++    \ '\bisansx': '𝙭',
++    \ '\bisansy': '𝙮',
++    \ '\bisansz': '𝙯',
++    \ '\ttA': '𝙰',
++    \ '\ttB': '𝙱',
++    \ '\ttC': '𝙲',
++    \ '\ttD': '𝙳',
++    \ '\ttE': '𝙴',
++    \ '\ttF': '𝙵',
++    \ '\ttG': '𝙶',
++    \ '\ttH': '𝙷',
++    \ '\ttI': '𝙸',
++    \ '\ttJ': '𝙹',
++    \ '\ttK': '𝙺',
++    \ '\ttL': '𝙻',
++    \ '\ttM': '𝙼',
++    \ '\ttN': '𝙽',
++    \ '\ttO': '𝙾',
++    \ '\ttP': '𝙿',
++    \ '\ttQ': '𝚀',
++    \ '\ttR': '𝚁',
++    \ '\ttS': '𝚂',
++    \ '\ttT': '𝚃',
++    \ '\ttU': '𝚄',
++    \ '\ttV': '𝚅',
++    \ '\ttW': '𝚆',
++    \ '\ttX': '𝚇',
++    \ '\ttY': '𝚈',
++    \ '\ttZ': '𝚉',
++    \ '\tta': '𝚊',
++    \ '\ttb': '𝚋',
++    \ '\ttc': '𝚌',
++    \ '\ttd': '𝚍',
++    \ '\tte': '𝚎',
++    \ '\ttf': '𝚏',
++    \ '\ttg': '𝚐',
++    \ '\tth': '𝚑',
++    \ '\tti': '𝚒',
++    \ '\ttj': '𝚓',
++    \ '\ttk': '𝚔',
++    \ '\ttl': '𝚕',
++    \ '\ttm': '𝚖',
++    \ '\ttn': '𝚗',
++    \ '\tto': '𝚘',
++    \ '\ttp': '𝚙',
++    \ '\ttq': '𝚚',
++    \ '\ttr': '𝚛',
++    \ '\tts': '𝚜',
++    \ '\ttt': '𝚝',
++    \ '\ttu': '𝚞',
++    \ '\ttv': '𝚟',
++    \ '\ttw': '𝚠',
++    \ '\ttx': '𝚡',
++    \ '\tty': '𝚢',
++    \ '\ttz': '𝚣',
++    \ '\itimath': '𝚤',
++    \ '\itjmath': '𝚥',
++    \ '\bfAlpha': '𝚨',
++    \ '\bfBeta': '𝚩',
++    \ '\bfGamma': '𝚪',
++    \ '\bfDelta': '𝚫',
++    \ '\bfEpsilon': '𝚬',
++    \ '\bfZeta': '𝚭',
++    \ '\bfEta': '𝚮',
++    \ '\bfTheta': '𝚯',
++    \ '\bfIota': '𝚰',
++    \ '\bfKappa': '𝚱',
++    \ '\bfLambda': '𝚲',
++    \ '\bfMu': '𝚳',
++    \ '\bfNu': '𝚴',
++    \ '\bfXi': '𝚵',
++    \ '\bfOmicron': '𝚶',
++    \ '\bfPi': '𝚷',
++    \ '\bfRho': '𝚸',
++    \ '\bfvarTheta': '𝚹',
++    \ '\bfSigma': '𝚺',
++    \ '\bfTau': '𝚻',
++    \ '\bfUpsilon': '𝚼',
++    \ '\bfPhi': '𝚽',
++    \ '\bfChi': '𝚾',
++    \ '\bfPsi': '𝚿',
++    \ '\bfOmega': '𝛀',
++    \ '\bfnabla': '𝛁',
++    \ '\bfalpha': '𝛂',
++    \ '\bfbeta': '𝛃',
++    \ '\bfgamma': '𝛄',
++    \ '\bfdelta': '𝛅',
++    \ '\bfepsilon': '𝛆',
++    \ '\bfzeta': '𝛇',
++    \ '\bfeta': '𝛈',
++    \ '\bftheta': '𝛉',
++    \ '\bfiota': '𝛊',
++    \ '\bfkappa': '𝛋',
++    \ '\bflambda': '𝛌',
++    \ '\bfmu': '𝛍',
++    \ '\bfnu': '𝛎',
++    \ '\bfxi': '𝛏',
++    \ '\bfomicron': '𝛐',
++    \ '\bfpi': '𝛑',
++    \ '\bfrho': '𝛒',
++    \ '\bfvarsigma': '𝛓',
++    \ '\bfsigma': '𝛔',
++    \ '\bftau': '𝛕',
++    \ '\bfupsilon': '𝛖',
++    \ '\bfvarphi': '𝛗',
++    \ '\bfchi': '𝛘',
++    \ '\bfpsi': '𝛙',
++    \ '\bfomega': '𝛚',
++    \ '\bfpartial': '𝛛',
++    \ '\bfvarepsilon': '𝛜',
++    \ '\bfvartheta': '𝛝',
++    \ '\bfvarkappa': '𝛞',
++    \ '\bfphi': '𝛟',
++    \ '\bfvarrho': '𝛠',
++    \ '\bfvarpi': '𝛡',
++    \ '\itAlpha': '𝛢',
++    \ '\itBeta': '𝛣',
++    \ '\itGamma': '𝛤',
++    \ '\itDelta': '𝛥',
++    \ '\itEpsilon': '𝛦',
++    \ '\itZeta': '𝛧',
++    \ '\itEta': '𝛨',
++    \ '\itTheta': '𝛩',
++    \ '\itIota': '𝛪',
++    \ '\itKappa': '𝛫',
++    \ '\itLambda': '𝛬',
++    \ '\itMu': '𝛭',
++    \ '\itNu': '𝛮',
++    \ '\itXi': '𝛯',
++    \ '\itOmicron': '𝛰',
++    \ '\itPi': '𝛱',
++    \ '\itRho': '𝛲',
++    \ '\itvarTheta': '𝛳',
++    \ '\itSigma': '𝛴',
++    \ '\itTau': '𝛵',
++    \ '\itUpsilon': '𝛶',
++    \ '\itPhi': '𝛷',
++    \ '\itChi': '𝛸',
++    \ '\itPsi': '𝛹',
++    \ '\itOmega': '𝛺',
++    \ '\itnabla': '𝛻',
++    \ '\italpha': '𝛼',
++    \ '\itbeta': '𝛽',
++    \ '\itgamma': '𝛾',
++    \ '\itdelta': '𝛿',
++    \ '\itepsilon': '𝜀',
++    \ '\itzeta': '𝜁',
++    \ '\iteta': '𝜂',
++    \ '\ittheta': '𝜃',
++    \ '\itiota': '𝜄',
++    \ '\itkappa': '𝜅',
++    \ '\itlambda': '𝜆',
++    \ '\itmu': '𝜇',
++    \ '\itnu': '𝜈',
++    \ '\itxi': '𝜉',
++    \ '\itomicron': '𝜊',
++    \ '\itpi': '𝜋',
++    \ '\itrho': '𝜌',
++    \ '\itvarsigma': '𝜍',
++    \ '\itsigma': '𝜎',
++    \ '\ittau': '𝜏',
++    \ '\itupsilon': '𝜐',
++    \ '\itphi': '𝜑',
++    \ '\itchi': '𝜒',
++    \ '\itpsi': '𝜓',
++    \ '\itomega': '𝜔',
++    \ '\itpartial': '𝜕',
++    \ '\itvarepsilon': '𝜖',
++    \ '\itvartheta': '𝜗',
++    \ '\itvarkappa': '𝜘',
++    \ '\itvarphi': '𝜙',
++    \ '\itvarrho': '𝜚',
++    \ '\itvarpi': '𝜛',
++    \ '\biAlpha': '𝜜',
++    \ '\biBeta': '𝜝',
++    \ '\biGamma': '𝜞',
++    \ '\biDelta': '𝜟',
++    \ '\biEpsilon': '𝜠',
++    \ '\biZeta': '𝜡',
++    \ '\biEta': '𝜢',
++    \ '\biTheta': '𝜣',
++    \ '\biIota': '𝜤',
++    \ '\biKappa': '𝜥',
++    \ '\biLambda': '𝜦',
++    \ '\biMu': '𝜧',
++    \ '\biNu': '𝜨',
++    \ '\biXi': '𝜩',
++    \ '\biOmicron': '𝜪',
++    \ '\biPi': '𝜫',
++    \ '\biRho': '𝜬',
++    \ '\bivarTheta': '𝜭',
++    \ '\biSigma': '𝜮',
++    \ '\biTau': '𝜯',
++    \ '\biUpsilon': '𝜰',
++    \ '\biPhi': '𝜱',
++    \ '\biChi': '𝜲',
++    \ '\biPsi': '𝜳',
++    \ '\biOmega': '𝜴',
++    \ '\binabla': '𝜵',
++    \ '\bialpha': '𝜶',
++    \ '\bibeta': '𝜷',
++    \ '\bigamma': '𝜸',
++    \ '\bidelta': '𝜹',
++    \ '\biepsilon': '𝜺',
++    \ '\bizeta': '𝜻',
++    \ '\bieta': '𝜼',
++    \ '\bitheta': '𝜽',
++    \ '\biiota': '𝜾',
++    \ '\bikappa': '𝜿',
++    \ '\bilambda': '𝝀',
++    \ '\bimu': '𝝁',
++    \ '\binu': '𝝂',
++    \ '\bixi': '𝝃',
++    \ '\biomicron': '𝝄',
++    \ '\bipi': '𝝅',
++    \ '\birho': '𝝆',
++    \ '\bivarsigma': '𝝇',
++    \ '\bisigma': '𝝈',
++    \ '\bitau': '𝝉',
++    \ '\biupsilon': '𝝊',
++    \ '\biphi': '𝝋',
++    \ '\bichi': '𝝌',
++    \ '\bipsi': '𝝍',
++    \ '\biomega': '𝝎',
++    \ '\bipartial': '𝝏',
++    \ '\bivarepsilon': '𝝐',
++    \ '\bivartheta': '𝝑',
++    \ '\bivarkappa': '𝝒',
++    \ '\bivarphi': '𝝓',
++    \ '\bivarrho': '𝝔',
++    \ '\bivarpi': '𝝕',
++    \ '\bsansAlpha': '𝝖',
++    \ '\bsansBeta': '𝝗',
++    \ '\bsansGamma': '𝝘',
++    \ '\bsansDelta': '𝝙',
++    \ '\bsansEpsilon': '𝝚',
++    \ '\bsansZeta': '𝝛',
++    \ '\bsansEta': '𝝜',
++    \ '\bsansTheta': '𝝝',
++    \ '\bsansIota': '𝝞',
++    \ '\bsansKappa': '𝝟',
++    \ '\bsansLambda': '𝝠',
++    \ '\bsansMu': '𝝡',
++    \ '\bsansNu': '𝝢',
++    \ '\bsansXi': '𝝣',
++    \ '\bsansOmicron': '𝝤',
++    \ '\bsansPi': '𝝥',
++    \ '\bsansRho': '𝝦',
++    \ '\bsansvarTheta': '𝝧',
++    \ '\bsansSigma': '𝝨',
++    \ '\bsansTau': '𝝩',
++    \ '\bsansUpsilon': '𝝪',
++    \ '\bsansPhi': '𝝫',
++    \ '\bsansChi': '𝝬',
++    \ '\bsansPsi': '𝝭',
++    \ '\bsansOmega': '𝝮',
++    \ '\bsansnabla': '𝝯',
++    \ '\bsansalpha': '𝝰',
++    \ '\bsansbeta': '𝝱',
++    \ '\bsansgamma': '𝝲',
++    \ '\bsansdelta': '𝝳',
++    \ '\bsansepsilon': '𝝴',
++    \ '\bsanszeta': '𝝵',
++    \ '\bsanseta': '𝝶',
++    \ '\bsanstheta': '𝝷',
++    \ '\bsansiota': '𝝸',
++    \ '\bsanskappa': '𝝹',
++    \ '\bsanslambda': '𝝺',
++    \ '\bsansmu': '𝝻',
++    \ '\bsansnu': '𝝼',
++    \ '\bsansxi': '𝝽',
++    \ '\bsansomicron': '𝝾',
++    \ '\bsanspi': '𝝿',
++    \ '\bsansrho': '𝞀',
++    \ '\bsansvarsigma': '𝞁',
++    \ '\bsanssigma': '𝞂',
++    \ '\bsanstau': '𝞃',
++    \ '\bsansupsilon': '𝞄',
++    \ '\bsansphi': '𝞅',
++    \ '\bsanschi': '𝞆',
++    \ '\bsanspsi': '𝞇',
++    \ '\bsansomega': '𝞈',
++    \ '\bsanspartial': '𝞉',
++    \ '\bsansvarepsilon': '𝞊',
++    \ '\bsansvartheta': '𝞋',
++    \ '\bsansvarkappa': '𝞌',
++    \ '\bsansvarphi': '𝞍',
++    \ '\bsansvarrho': '𝞎',
++    \ '\bsansvarpi': '𝞏',
++    \ '\bisansAlpha': '𝞐',
++    \ '\bisansBeta': '𝞑',
++    \ '\bisansGamma': '𝞒',
++    \ '\bisansDelta': '𝞓',
++    \ '\bisansEpsilon': '𝞔',
++    \ '\bisansZeta': '𝞕',
++    \ '\bisansEta': '𝞖',
++    \ '\bisansTheta': '𝞗',
++    \ '\bisansIota': '𝞘',
++    \ '\bisansKappa': '𝞙',
++    \ '\bisansLambda': '𝞚',
++    \ '\bisansMu': '𝞛',
++    \ '\bisansNu': '𝞜',
++    \ '\bisansXi': '𝞝',
++    \ '\bisansOmicron': '𝞞',
++    \ '\bisansPi': '𝞟',
++    \ '\bisansRho': '𝞠',
++    \ '\bisansvarTheta': '𝞡',
++    \ '\bisansSigma': '𝞢',
++    \ '\bisansTau': '𝞣',
++    \ '\bisansUpsilon': '𝞤',
++    \ '\bisansPhi': '𝞥',
++    \ '\bisansChi': '𝞦',
++    \ '\bisansPsi': '𝞧',
++    \ '\bisansOmega': '𝞨',
++    \ '\bisansnabla': '𝞩',
++    \ '\bisansalpha': '𝞪',
++    \ '\bisansbeta': '𝞫',
++    \ '\bisansgamma': '𝞬',
++    \ '\bisansdelta': '𝞭',
++    \ '\bisansepsilon': '𝞮',
++    \ '\bisanszeta': '𝞯',
++    \ '\bisanseta': '𝞰',
++    \ '\bisanstheta': '𝞱',
++    \ '\bisansiota': '𝞲',
++    \ '\bisanskappa': '𝞳',
++    \ '\bisanslambda': '𝞴',
++    \ '\bisansmu': '𝞵',
++    \ '\bisansnu': '𝞶',
++    \ '\bisansxi': '𝞷',
++    \ '\bisansomicron': '𝞸',
++    \ '\bisanspi': '𝞹',
++    \ '\bisansrho': '𝞺',
++    \ '\bisansvarsigma': '𝞻',
++    \ '\bisanssigma': '𝞼',
++    \ '\bisanstau': '𝞽',
++    \ '\bisansupsilon': '𝞾',
++    \ '\bisansphi': '𝞿',
++    \ '\bisanschi': '𝟀',
++    \ '\bisanspsi': '𝟁',
++    \ '\bisansomega': '𝟂',
++    \ '\bisanspartial': '𝟃',
++    \ '\bisansvarepsilon': '𝟄',
++    \ '\bisansvartheta': '𝟅',
++    \ '\bisansvarkappa': '𝟆',
++    \ '\bisansvarphi': '𝟇',
++    \ '\bisansvarrho': '𝟈',
++    \ '\bisansvarpi': '𝟉',
++    \ '\bfDigamma': '𝟊',
++    \ '\bfdigamma': '𝟋',
++    \ '\bfzero': '𝟎',
++    \ '\bfone': '𝟏',
++    \ '\bftwo': '𝟐',
++    \ '\bfthree': '𝟑',
++    \ '\bffour': '𝟒',
++    \ '\bffive': '𝟓',
++    \ '\bfsix': '𝟔',
++    \ '\bfseven': '𝟕',
++    \ '\bfeight': '𝟖',
++    \ '\bfnine': '𝟗',
++    \ '\bbzero': '𝟘',
++    \ '\bbone': '𝟙',
++    \ '\bbtwo': '𝟚',
++    \ '\bbthree': '𝟛',
++    \ '\bbfour': '𝟜',
++    \ '\bbfive': '𝟝',
++    \ '\bbsix': '𝟞',
++    \ '\bbseven': '𝟟',
++    \ '\bbeight': '𝟠',
++    \ '\bbnine': '𝟡',
++    \ '\sanszero': '𝟢',
++    \ '\sansone': '𝟣',
++    \ '\sanstwo': '𝟤',
++    \ '\sansthree': '𝟥',
++    \ '\sansfour': '𝟦',
++    \ '\sansfive': '𝟧',
++    \ '\sanssix': '𝟨',
++    \ '\sansseven': '𝟩',
++    \ '\sanseight': '𝟪',
++    \ '\sansnine': '𝟫',
++    \ '\bsanszero': '𝟬',
++    \ '\bsansone': '𝟭',
++    \ '\bsanstwo': '𝟮',
++    \ '\bsansthree': '𝟯',
++    \ '\bsansfour': '𝟰',
++    \ '\bsansfive': '𝟱',
++    \ '\bsanssix': '𝟲',
++    \ '\bsansseven': '𝟳',
++    \ '\bsanseight': '𝟴',
++    \ '\bsansnine': '𝟵',
++    \ '\ttzero': '𝟶',
++    \ '\ttone': '𝟷',
++    \ '\tttwo': '𝟸',
++    \ '\ttthree': '𝟹',
++    \ '\ttfour': '𝟺',
++    \ '\ttfive': '𝟻',
++    \ '\ttsix': '𝟼',
++    \ '\ttseven': '𝟽',
++    \ '\tteight': '𝟾',
++    \ '\ttnine': '𝟿',
++    \ '\:mahjong:': '🀄',
++    \ '\:black_joker:': '🃏',
++    \ '\:a:': '🅰',
++    \ '\:b:': '🅱',
++    \ '\:o2:': '🅾',
++    \ '\:parking:': '🅿',
++    \ '\:ab:': '🆎',
++    \ '\:cl:': '🆑',
++    \ '\:cool:': '🆒',
++    \ '\:free:': '🆓',
++    \ '\:id:': '🆔',
++    \ '\:new:': '🆕',
++    \ '\:ng:': '🆖',
++    \ '\:ok:': '🆗',
++    \ '\:sos:': '🆘',
++    \ '\:up:': '🆙',
++    \ '\:vs:': '🆚',
++    \ '\:koko:': '🈁',
++    \ '\:sa:': '🈂',
++    \ '\:u7121:': '🈚',
++    \ '\:u6307:': '🈯',
++    \ '\:u7981:': '🈲',
++    \ '\:u7a7a:': '🈳',
++    \ '\:u5408:': '🈴',
++    \ '\:u6e80:': '🈵',
++    \ '\:u6709:': '🈶',
++    \ '\:u6708:': '🈷',
++    \ '\:u7533:': '🈸',
++    \ '\:u5272:': '🈹',
++    \ '\:u55b6:': '🈺',
++    \ '\:ideograph_advantage:': '🉐',
++    \ '\:accept:': '🉑',
++    \ '\:cyclone:': '🌀',
++    \ '\:foggy:': '🌁',
++    \ '\:closed_umbrella:': '🌂',
++    \ '\:night_with_stars:': '🌃',
++    \ '\:sunrise_over_mountains:': '🌄',
++    \ '\:sunrise:': '🌅',
++    \ '\:city_sunset:': '🌆',
++    \ '\:city_sunrise:': '🌇',
++    \ '\:rainbow:': '🌈',
++    \ '\:bridge_at_night:': '🌉',
++    \ '\:ocean:': '🌊',
++    \ '\:volcano:': '🌋',
++    \ '\:milky_way:': '🌌',
++    \ '\:earth_africa:': '🌍',
++    \ '\:earth_americas:': '🌎',
++    \ '\:earth_asia:': '🌏',
++    \ '\:globe_with_meridians:': '🌐',
++    \ '\:new_moon:': '🌑',
++    \ '\:waxing_crescent_moon:': '🌒',
++    \ '\:first_quarter_moon:': '🌓',
++    \ '\:moon:': '🌔',
++    \ '\:full_moon:': '🌕',
++    \ '\:waning_gibbous_moon:': '🌖',
++    \ '\:last_quarter_moon:': '🌗',
++    \ '\:waning_crescent_moon:': '🌘',
++    \ '\:crescent_moon:': '🌙',
++    \ '\:new_moon_with_face:': '🌚',
++    \ '\:first_quarter_moon_with_face:': '🌛',
++    \ '\:last_quarter_moon_with_face:': '🌜',
++    \ '\:full_moon_with_face:': '🌝',
++    \ '\:sun_with_face:': '🌞',
++    \ '\:star2:': '🌟',
++    \ '\:stars:': '🌠',
++    \ '\:chestnut:': '🌰',
++    \ '\:seedling:': '🌱',
++    \ '\:evergreen_tree:': '🌲',
++    \ '\:deciduous_tree:': '🌳',
++    \ '\:palm_tree:': '🌴',
++    \ '\:cactus:': '🌵',
++    \ '\:tulip:': '🌷',
++    \ '\:cherry_blossom:': '🌸',
++    \ '\:rose:': '🌹',
++    \ '\:hibiscus:': '🌺',
++    \ '\:sunflower:': '🌻',
++    \ '\:blossom:': '🌼',
++    \ '\:corn:': '🌽',
++    \ '\:ear_of_rice:': '🌾',
++    \ '\:herb:': '🌿',
++    \ '\:four_leaf_clover:': '🍀',
++    \ '\:maple_leaf:': '🍁',
++    \ '\:fallen_leaf:': '🍂',
++    \ '\:leaves:': '🍃',
++    \ '\:mushroom:': '🍄',
++    \ '\:tomato:': '🍅',
++    \ '\:eggplant:': '🍆',
++    \ '\:grapes:': '🍇',
++    \ '\:melon:': '🍈',
++    \ '\:watermelon:': '🍉',
++    \ '\:tangerine:': '🍊',
++    \ '\:lemon:': '🍋',
++    \ '\:banana:': '🍌',
++    \ '\:pineapple:': '🍍',
++    \ '\:apple:': '🍎',
++    \ '\:green_apple:': '🍏',
++    \ '\:pear:': '🍐',
++    \ '\:peach:': '🍑',
++    \ '\:cherries:': '🍒',
++    \ '\:strawberry:': '🍓',
++    \ '\:hamburger:': '🍔',
++    \ '\:pizza:': '🍕',
++    \ '\:meat_on_bone:': '🍖',
++    \ '\:poultry_leg:': '🍗',
++    \ '\:rice_cracker:': '🍘',
++    \ '\:rice_ball:': '🍙',
++    \ '\:rice:': '🍚',
++    \ '\:curry:': '🍛',
++    \ '\:ramen:': '🍜',
++    \ '\:spaghetti:': '🍝',
++    \ '\:bread:': '🍞',
++    \ '\:fries:': '🍟',
++    \ '\:sweet_potato:': '🍠',
++    \ '\:dango:': '🍡',
++    \ '\:oden:': '🍢',
++    \ '\:sushi:': '🍣',
++    \ '\:fried_shrimp:': '🍤',
++    \ '\:fish_cake:': '🍥',
++    \ '\:icecream:': '🍦',
++    \ '\:shaved_ice:': '🍧',
++    \ '\:ice_cream:': '🍨',
++    \ '\:doughnut:': '🍩',
++    \ '\:cookie:': '🍪',
++    \ '\:chocolate_bar:': '🍫',
++    \ '\:candy:': '🍬',
++    \ '\:lollipop:': '🍭',
++    \ '\:custard:': '🍮',
++    \ '\:honey_pot:': '🍯',
++    \ '\:cake:': '🍰',
++    \ '\:bento:': '🍱',
++    \ '\:stew:': '🍲',
++    \ '\:egg:': '🍳',
++    \ '\:fork_and_knife:': '🍴',
++    \ '\:tea:': '🍵',
++    \ '\:sake:': '🍶',
++    \ '\:wine_glass:': '🍷',
++    \ '\:cocktail:': '🍸',
++    \ '\:tropical_drink:': '🍹',
++    \ '\:beer:': '🍺',
++    \ '\:beers:': '🍻',
++    \ '\:baby_bottle:': '🍼',
++    \ '\:ribbon:': '🎀',
++    \ '\:gift:': '🎁',
++    \ '\:birthday:': '🎂',
++    \ '\:jack_o_lantern:': '🎃',
++    \ '\:christmas_tree:': '🎄',
++    \ '\:santa:': '🎅',
++    \ '\:fireworks:': '🎆',
++    \ '\:sparkler:': '🎇',
++    \ '\:balloon:': '🎈',
++    \ '\:tada:': '🎉',
++    \ '\:confetti_ball:': '🎊',
++    \ '\:tanabata_tree:': '🎋',
++    \ '\:crossed_flags:': '🎌',
++    \ '\:bamboo:': '🎍',
++    \ '\:dolls:': '🎎',
++    \ '\:flags:': '🎏',
++    \ '\:wind_chime:': '🎐',
++    \ '\:rice_scene:': '🎑',
++    \ '\:school_satchel:': '🎒',
++    \ '\:mortar_board:': '🎓',
++    \ '\:carousel_horse:': '🎠',
++    \ '\:ferris_wheel:': '🎡',
++    \ '\:roller_coaster:': '🎢',
++    \ '\:fishing_pole_and_fish:': '🎣',
++    \ '\:microphone:': '🎤',
++    \ '\:movie_camera:': '🎥',
++    \ '\:cinema:': '🎦',
++    \ '\:headphones:': '🎧',
++    \ '\:art:': '🎨',
++    \ '\:tophat:': '🎩',
++    \ '\:circus_tent:': '🎪',
++    \ '\:ticket:': '🎫',
++    \ '\:clapper:': '🎬',
++    \ '\:performing_arts:': '🎭',
++    \ '\:video_game:': '🎮',
++    \ '\:dart:': '🎯',
++    \ '\:slot_machine:': '🎰',
++    \ '\:8ball:': '🎱',
++    \ '\:game_die:': '🎲',
++    \ '\:bowling:': '🎳',
++    \ '\:flower_playing_cards:': '🎴',
++    \ '\:musical_note:': '🎵',
++    \ '\:notes:': '🎶',
++    \ '\:saxophone:': '🎷',
++    \ '\:guitar:': '🎸',
++    \ '\:musical_keyboard:': '🎹',
++    \ '\:trumpet:': '🎺',
++    \ '\:violin:': '🎻',
++    \ '\:musical_score:': '🎼',
++    \ '\:running_shirt_with_sash:': '🎽',
++    \ '\:tennis:': '🎾',
++    \ '\:ski:': '🎿',
++    \ '\:basketball:': '🏀',
++    \ '\:checkered_flag:': '🏁',
++    \ '\:snowboarder:': '🏂',
++    \ '\:runner:': '🏃',
++    \ '\:surfer:': '🏄',
++    \ '\:trophy:': '🏆',
++    \ '\:horse_racing:': '🏇',
++    \ '\:football:': '🏈',
++    \ '\:rugby_football:': '🏉',
++    \ '\:swimmer:': '🏊',
++    \ '\:house:': '🏠',
++    \ '\:house_with_garden:': '🏡',
++    \ '\:office:': '🏢',
++    \ '\:post_office:': '🏣',
++    \ '\:european_post_office:': '🏤',
++    \ '\:hospital:': '🏥',
++    \ '\:bank:': '🏦',
++    \ '\:atm:': '🏧',
++    \ '\:hotel:': '🏨',
++    \ '\:love_hotel:': '🏩',
++    \ '\:convenience_store:': '🏪',
++    \ '\:school:': '🏫',
++    \ '\:department_store:': '🏬',
++    \ '\:factory:': '🏭',
++    \ '\:izakaya_lantern:': '🏮',
++    \ '\:japanese_castle:': '🏯',
++    \ '\:european_castle:': '🏰',
++    \ '\:skin-tone-2:': '🏻',
++    \ '\:skin-tone-3:': '🏼',
++    \ '\:skin-tone-4:': '🏽',
++    \ '\:skin-tone-5:': '🏾',
++    \ '\:skin-tone-6:': '🏿',
++    \ '\:rat:': '🐀',
++    \ '\:mouse2:': '🐁',
++    \ '\:ox:': '🐂',
++    \ '\:water_buffalo:': '🐃',
++    \ '\:cow2:': '🐄',
++    \ '\:tiger2:': '🐅',
++    \ '\:leopard:': '🐆',
++    \ '\:rabbit2:': '🐇',
++    \ '\:cat2:': '🐈',
++    \ '\:dragon:': '🐉',
++    \ '\:crocodile:': '🐊',
++    \ '\:whale2:': '🐋',
++    \ '\:snail:': '🐌',
++    \ '\:snake:': '🐍',
++    \ '\:racehorse:': '🐎',
++    \ '\:ram:': '🐏',
++    \ '\:goat:': '🐐',
++    \ '\:sheep:': '🐑',
++    \ '\:monkey:': '🐒',
++    \ '\:rooster:': '🐓',
++    \ '\:chicken:': '🐔',
++    \ '\:dog2:': '🐕',
++    \ '\:pig2:': '🐖',
++    \ '\:boar:': '🐗',
++    \ '\:elephant:': '🐘',
++    \ '\:octopus:': '🐙',
++    \ '\:shell:': '🐚',
++    \ '\:bug:': '🐛',
++    \ '\:ant:': '🐜',
++    \ '\:bee:': '🐝',
++    \ '\:beetle:': '🐞',
++    \ '\:fish:': '🐟',
++    \ '\:tropical_fish:': '🐠',
++    \ '\:blowfish:': '🐡',
++    \ '\:turtle:': '🐢',
++    \ '\:hatching_chick:': '🐣',
++    \ '\:baby_chick:': '🐤',
++    \ '\:hatched_chick:': '🐥',
++    \ '\:bird:': '🐦',
++    \ '\:penguin:': '🐧',
++    \ '\:koala:': '🐨',
++    \ '\:poodle:': '🐩',
++    \ '\:dromedary_camel:': '🐪',
++    \ '\:camel:': '🐫',
++    \ '\:dolphin:': '🐬',
++    \ '\:mouse:': '🐭',
++    \ '\:cow:': '🐮',
++    \ '\:tiger:': '🐯',
++    \ '\:rabbit:': '🐰',
++    \ '\:cat:': '🐱',
++    \ '\:dragon_face:': '🐲',
++    \ '\:whale:': '🐳',
++    \ '\:horse:': '🐴',
++    \ '\:monkey_face:': '🐵',
++    \ '\:dog:': '🐶',
++    \ '\:pig:': '🐷',
++    \ '\:frog:': '🐸',
++    \ '\:hamster:': '🐹',
++    \ '\:wolf:': '🐺',
++    \ '\:bear:': '🐻',
++    \ '\:panda_face:': '🐼',
++    \ '\:pig_nose:': '🐽',
++    \ '\:feet:': '🐾',
++    \ '\:eyes:': '👀',
++    \ '\:ear:': '👂',
++    \ '\:nose:': '👃',
++    \ '\:lips:': '👄',
++    \ '\:tongue:': '👅',
++    \ '\:point_up_2:': '👆',
++    \ '\:point_down:': '👇',
++    \ '\:point_left:': '👈',
++    \ '\:point_right:': '👉',
++    \ '\:facepunch:': '👊',
++    \ '\:wave:': '👋',
++    \ '\:ok_hand:': '👌',
++    \ '\:+1:': '👍',
++    \ '\:-1:': '👎',
++    \ '\:clap:': '👏',
++    \ '\:open_hands:': '👐',
++    \ '\:crown:': '👑',
++    \ '\:womans_hat:': '👒',
++    \ '\:eyeglasses:': '👓',
++    \ '\:necktie:': '👔',
++    \ '\:shirt:': '👕',
++    \ '\:jeans:': '👖',
++    \ '\:dress:': '👗',
++    \ '\:kimono:': '👘',
++    \ '\:bikini:': '👙',
++    \ '\:womans_clothes:': '👚',
++    \ '\:purse:': '👛',
++    \ '\:handbag:': '👜',
++    \ '\:pouch:': '👝',
++    \ '\:mans_shoe:': '👞',
++    \ '\:athletic_shoe:': '👟',
++    \ '\:high_heel:': '👠',
++    \ '\:sandal:': '👡',
++    \ '\:boot:': '👢',
++    \ '\:footprints:': '👣',
++    \ '\:bust_in_silhouette:': '👤',
++    \ '\:busts_in_silhouette:': '👥',
++    \ '\:boy:': '👦',
++    \ '\:girl:': '👧',
++    \ '\:man:': '👨',
++    \ '\:woman:': '👩',
++    \ '\:family:': '👪',
++    \ '\:couple:': '👫',
++    \ '\:two_men_holding_hands:': '👬',
++    \ '\:two_women_holding_hands:': '👭',
++    \ '\:cop:': '👮',
++    \ '\:dancers:': '👯',
++    \ '\:bride_with_veil:': '👰',
++    \ '\:person_with_blond_hair:': '👱',
++    \ '\:man_with_gua_pi_mao:': '👲',
++    \ '\:man_with_turban:': '👳',
++    \ '\:older_man:': '👴',
++    \ '\:older_woman:': '👵',
++    \ '\:baby:': '👶',
++    \ '\:construction_worker:': '👷',
++    \ '\:princess:': '👸',
++    \ '\:japanese_ogre:': '👹',
++    \ '\:japanese_goblin:': '👺',
++    \ '\:ghost:': '👻',
++    \ '\:angel:': '👼',
++    \ '\:alien:': '👽',
++    \ '\:space_invader:': '👾',
++    \ '\:imp:': '👿',
++    \ '\:skull:': '💀',
++    \ '\:information_desk_person:': '💁',
++    \ '\:guardsman:': '💂',
++    \ '\:dancer:': '💃',
++    \ '\:lipstick:': '💄',
++    \ '\:nail_care:': '💅',
++    \ '\:massage:': '💆',
++    \ '\:haircut:': '💇',
++    \ '\:barber:': '💈',
++    \ '\:syringe:': '💉',
++    \ '\:pill:': '💊',
++    \ '\:kiss:': '💋',
++    \ '\:love_letter:': '💌',
++    \ '\:ring:': '💍',
++    \ '\:gem:': '💎',
++    \ '\:couplekiss:': '💏',
++    \ '\:bouquet:': '💐',
++    \ '\:couple_with_heart:': '💑',
++    \ '\:wedding:': '💒',
++    \ '\:heartbeat:': '💓',
++    \ '\:broken_heart:': '💔',
++    \ '\:two_hearts:': '💕',
++    \ '\:sparkling_heart:': '💖',
++    \ '\:heartpulse:': '💗',
++    \ '\:cupid:': '💘',
++    \ '\:blue_heart:': '💙',
++    \ '\:green_heart:': '💚',
++    \ '\:yellow_heart:': '💛',
++    \ '\:purple_heart:': '💜',
++    \ '\:gift_heart:': '💝',
++    \ '\:revolving_hearts:': '💞',
++    \ '\:heart_decoration:': '💟',
++    \ '\:diamond_shape_with_a_dot_inside:': '💠',
++    \ '\:bulb:': '💡',
++    \ '\:anger:': '💢',
++    \ '\:bomb:': '💣',
++    \ '\:zzz:': '💤',
++    \ '\:boom:': '💥',
++    \ '\:sweat_drops:': '💦',
++    \ '\:droplet:': '💧',
++    \ '\:dash:': '💨',
++    \ '\:hankey:': '💩',
++    \ '\:muscle:': '💪',
++    \ '\:dizzy:': '💫',
++    \ '\:speech_balloon:': '💬',
++    \ '\:thought_balloon:': '💭',
++    \ '\:white_flower:': '💮',
++    \ '\:100:': '💯',
++    \ '\:moneybag:': '💰',
++    \ '\:currency_exchange:': '💱',
++    \ '\:heavy_dollar_sign:': '💲',
++    \ '\:credit_card:': '💳',
++    \ '\:yen:': '💴',
++    \ '\:dollar:': '💵',
++    \ '\:euro:': '💶',
++    \ '\:pound:': '💷',
++    \ '\:money_with_wings:': '💸',
++    \ '\:chart:': '💹',
++    \ '\:seat:': '💺',
++    \ '\:computer:': '💻',
++    \ '\:briefcase:': '💼',
++    \ '\:minidisc:': '💽',
++    \ '\:floppy_disk:': '💾',
++    \ '\:cd:': '💿',
++    \ '\:dvd:': '📀',
++    \ '\:file_folder:': '📁',
++    \ '\:open_file_folder:': '📂',
++    \ '\:page_with_curl:': '📃',
++    \ '\:page_facing_up:': '📄',
++    \ '\:date:': '📅',
++    \ '\:calendar:': '📆',
++    \ '\:card_index:': '📇',
++    \ '\:chart_with_upwards_trend:': '📈',
++    \ '\:chart_with_downwards_trend:': '📉',
++    \ '\:bar_chart:': '📊',
++    \ '\:clipboard:': '📋',
++    \ '\:pushpin:': '📌',
++    \ '\:round_pushpin:': '📍',
++    \ '\:paperclip:': '📎',
++    \ '\:straight_ruler:': '📏',
++    \ '\:triangular_ruler:': '📐',
++    \ '\:bookmark_tabs:': '📑',
++    \ '\:ledger:': '📒',
++    \ '\:notebook:': '📓',
++    \ '\:notebook_with_decorative_cover:': '📔',
++    \ '\:closed_book:': '📕',
++    \ '\:book:': '📖',
++    \ '\:green_book:': '📗',
++    \ '\:blue_book:': '📘',
++    \ '\:orange_book:': '📙',
++    \ '\:books:': '📚',
++    \ '\:name_badge:': '📛',
++    \ '\:scroll:': '📜',
++    \ '\:memo:': '📝',
++    \ '\:telephone_receiver:': '📞',
++    \ '\:pager:': '📟',
++    \ '\:fax:': '📠',
++    \ '\:satellite:': '📡',
++    \ '\:loudspeaker:': '📢',
++    \ '\:mega:': '📣',
++    \ '\:outbox_tray:': '📤',
++    \ '\:inbox_tray:': '📥',
++    \ '\:package:': '📦',
++    \ '\:e-mail:': '📧',
++    \ '\:incoming_envelope:': '📨',
++    \ '\:envelope_with_arrow:': '📩',
++    \ '\:mailbox_closed:': '📪',
++    \ '\:mailbox:': '📫',
++    \ '\:mailbox_with_mail:': '📬',
++    \ '\:mailbox_with_no_mail:': '📭',
++    \ '\:postbox:': '📮',
++    \ '\:postal_horn:': '📯',
++    \ '\:newspaper:': '📰',
++    \ '\:iphone:': '📱',
++    \ '\:calling:': '📲',
++    \ '\:vibration_mode:': '📳',
++    \ '\:mobile_phone_off:': '📴',
++    \ '\:no_mobile_phones:': '📵',
++    \ '\:signal_strength:': '📶',
++    \ '\:camera:': '📷',
++    \ '\:video_camera:': '📹',
++    \ '\:tv:': '📺',
++    \ '\:radio:': '📻',
++    \ '\:vhs:': '📼',
++    \ '\:twisted_rightwards_arrows:': '🔀',
++    \ '\:repeat:': '🔁',
++    \ '\:repeat_one:': '🔂',
++    \ '\:arrows_clockwise:': '🔃',
++    \ '\:arrows_counterclockwise:': '🔄',
++    \ '\:low_brightness:': '🔅',
++    \ '\:high_brightness:': '🔆',
++    \ '\:mute:': '🔇',
++    \ '\:speaker:': '🔈',
++    \ '\:sound:': '🔉',
++    \ '\:loud_sound:': '🔊',
++    \ '\:battery:': '🔋',
++    \ '\:electric_plug:': '🔌',
++    \ '\:mag:': '🔍',
++    \ '\:mag_right:': '🔎',
++    \ '\:lock_with_ink_pen:': '🔏',
++    \ '\:closed_lock_with_key:': '🔐',
++    \ '\:key:': '🔑',
++    \ '\:lock:': '🔒',
++    \ '\:unlock:': '🔓',
++    \ '\:bell:': '🔔',
++    \ '\:no_bell:': '🔕',
++    \ '\:bookmark:': '🔖',
++    \ '\:link:': '🔗',
++    \ '\:radio_button:': '🔘',
++    \ '\:back:': '🔙',
++    \ '\:end:': '🔚',
++    \ '\:on:': '🔛',
++    \ '\:soon:': '🔜',
++    \ '\:top:': '🔝',
++    \ '\:underage:': '🔞',
++    \ '\:keycap_ten:': '🔟',
++    \ '\:capital_abcd:': '🔠',
++    \ '\:abcd:': '🔡',
++    \ '\:1234:': '🔢',
++    \ '\:symbols:': '🔣',
++    \ '\:abc:': '🔤',
++    \ '\:fire:': '🔥',
++    \ '\:flashlight:': '🔦',
++    \ '\:wrench:': '🔧',
++    \ '\:hammer:': '🔨',
++    \ '\:nut_and_bolt:': '🔩',
++    \ '\:hocho:': '🔪',
++    \ '\:gun:': '🔫',
++    \ '\:microscope:': '🔬',
++    \ '\:telescope:': '🔭',
++    \ '\:crystal_ball:': '🔮',
++    \ '\:six_pointed_star:': '🔯',
++    \ '\:beginner:': '🔰',
++    \ '\:trident:': '🔱',
++    \ '\:black_square_button:': '🔲',
++    \ '\:white_square_button:': '🔳',
++    \ '\:red_circle:': '🔴',
++    \ '\:large_blue_circle:': '🔵',
++    \ '\:large_orange_diamond:': '🔶',
++    \ '\:large_blue_diamond:': '🔷',
++    \ '\:small_orange_diamond:': '🔸',
++    \ '\:small_blue_diamond:': '🔹',
++    \ '\:small_red_triangle:': '🔺',
++    \ '\:small_red_triangle_down:': '🔻',
++    \ '\:arrow_up_small:': '🔼',
++    \ '\:arrow_down_small:': '🔽',
++    \ '\:clock1:': '🕐',
++    \ '\:clock2:': '🕑',
++    \ '\:clock3:': '🕒',
++    \ '\:clock4:': '🕓',
++    \ '\:clock5:': '🕔',
++    \ '\:clock6:': '🕕',
++    \ '\:clock7:': '🕖',
++    \ '\:clock8:': '🕗',
++    \ '\:clock9:': '🕘',
++    \ '\:clock10:': '🕙',
++    \ '\:clock11:': '🕚',
++    \ '\:clock12:': '🕛',
++    \ '\:clock130:': '🕜',
++    \ '\:clock230:': '🕝',
++    \ '\:clock330:': '🕞',
++    \ '\:clock430:': '🕟',
++    \ '\:clock530:': '🕠',
++    \ '\:clock630:': '🕡',
++    \ '\:clock730:': '🕢',
++    \ '\:clock830:': '🕣',
++    \ '\:clock930:': '🕤',
++    \ '\:clock1030:': '🕥',
++    \ '\:clock1130:': '🕦',
++    \ '\:clock1230:': '🕧',
++    \ '\:mount_fuji:': '🗻',
++    \ '\:tokyo_tower:': '🗼',
++    \ '\:statue_of_liberty:': '🗽',
++    \ '\:japan:': '🗾',
++    \ '\:moyai:': '🗿',
++    \ '\:grinning:': '😀',
++    \ '\:grin:': '😁',
++    \ '\:joy:': '😂',
++    \ '\:smiley:': '😃',
++    \ '\:smile:': '😄',
++    \ '\:sweat_smile:': '😅',
++    \ '\:laughing:': '😆',
++    \ '\:innocent:': '😇',
++    \ '\:smiling_imp:': '😈',
++    \ '\:wink:': '😉',
++    \ '\:blush:': '😊',
++    \ '\:yum:': '😋',
++    \ '\:relieved:': '😌',
++    \ '\:heart_eyes:': '😍',
++    \ '\:sunglasses:': '😎',
++    \ '\:smirk:': '😏',
++    \ '\:neutral_face:': '😐',
++    \ '\:expressionless:': '😑',
++    \ '\:unamused:': '😒',
++    \ '\:sweat:': '😓',
++    \ '\:pensive:': '😔',
++    \ '\:confused:': '😕',
++    \ '\:confounded:': '😖',
++    \ '\:kissing:': '😗',
++    \ '\:kissing_heart:': '😘',
++    \ '\:kissing_smiling_eyes:': '😙',
++    \ '\:kissing_closed_eyes:': '😚',
++    \ '\:stuck_out_tongue:': '😛',
++    \ '\:stuck_out_tongue_winking_eye:': '😜',
++    \ '\:stuck_out_tongue_closed_eyes:': '😝',
++    \ '\:disappointed:': '😞',
++    \ '\:worried:': '😟',
++    \ '\:angry:': '😠',
++    \ '\:rage:': '😡',
++    \ '\:cry:': '😢',
++    \ '\:persevere:': '😣',
++    \ '\:triumph:': '😤',
++    \ '\:disappointed_relieved:': '😥',
++    \ '\:frowning:': '😦',
++    \ '\:anguished:': '😧',
++    \ '\:fearful:': '😨',
++    \ '\:weary:': '😩',
++    \ '\:sleepy:': '😪',
++    \ '\:tired_face:': '😫',
++    \ '\:grimacing:': '😬',
++    \ '\:sob:': '😭',
++    \ '\:open_mouth:': '😮',
++    \ '\:hushed:': '😯',
++    \ '\:cold_sweat:': '😰',
++    \ '\:scream:': '😱',
++    \ '\:astonished:': '😲',
++    \ '\:flushed:': '😳',
++    \ '\:sleeping:': '😴',
++    \ '\:dizzy_face:': '😵',
++    \ '\:no_mouth:': '😶',
++    \ '\:mask:': '😷',
++    \ '\:smile_cat:': '😸',
++    \ '\:joy_cat:': '😹',
++    \ '\:smiley_cat:': '😺',
++    \ '\:heart_eyes_cat:': '😻',
++    \ '\:smirk_cat:': '😼',
++    \ '\:kissing_cat:': '😽',
++    \ '\:pouting_cat:': '😾',
++    \ '\:crying_cat_face:': '😿',
++    \ '\:scream_cat:': '🙀',
++    \ '\:no_good:': '🙅',
++    \ '\:ok_woman:': '🙆',
++    \ '\:bow:': '🙇',
++    \ '\:see_no_evil:': '🙈',
++    \ '\:hear_no_evil:': '🙉',
++    \ '\:speak_no_evil:': '🙊',
++    \ '\:raising_hand:': '🙋',
++    \ '\:raised_hands:': '🙌',
++    \ '\:person_frowning:': '🙍',
++    \ '\:person_with_pouting_face:': '🙎',
++    \ '\:pray:': '🙏',
++    \ '\:rocket:': '🚀',
++    \ '\:helicopter:': '🚁',
++    \ '\:steam_locomotive:': '🚂',
++    \ '\:railway_car:': '🚃',
++    \ '\:bullettrain_side:': '🚄',
++    \ '\:bullettrain_front:': '🚅',
++    \ '\:train2:': '🚆',
++    \ '\:metro:': '🚇',
++    \ '\:light_rail:': '🚈',
++    \ '\:station:': '🚉',
++    \ '\:tram:': '🚊',
++    \ '\:train:': '🚋',
++    \ '\:bus:': '🚌',
++    \ '\:oncoming_bus:': '🚍',
++    \ '\:trolleybus:': '🚎',
++    \ '\:busstop:': '🚏',
++    \ '\:minibus:': '🚐',
++    \ '\:ambulance:': '🚑',
++    \ '\:fire_engine:': '🚒',
++    \ '\:police_car:': '🚓',
++    \ '\:oncoming_police_car:': '🚔',
++    \ '\:taxi:': '🚕',
++    \ '\:oncoming_taxi:': '🚖',
++    \ '\:car:': '🚗',
++    \ '\:oncoming_automobile:': '🚘',
++    \ '\:blue_car:': '🚙',
++    \ '\:truck:': '🚚',
++    \ '\:articulated_lorry:': '🚛',
++    \ '\:tractor:': '🚜',
++    \ '\:monorail:': '🚝',
++    \ '\:mountain_railway:': '🚞',
++    \ '\:suspension_railway:': '🚟',
++    \ '\:mountain_cableway:': '🚠',
++    \ '\:aerial_tramway:': '🚡',
++    \ '\:ship:': '🚢',
++    \ '\:rowboat:': '🚣',
++    \ '\:speedboat:': '🚤',
++    \ '\:traffic_light:': '🚥',
++    \ '\:vertical_traffic_light:': '🚦',
++    \ '\:construction:': '🚧',
++    \ '\:rotating_light:': '🚨',
++    \ '\:triangular_flag_on_post:': '🚩',
++    \ '\:door:': '🚪',
++    \ '\:no_entry_sign:': '🚫',
++    \ '\:smoking:': '🚬',
++    \ '\:no_smoking:': '🚭',
++    \ '\:put_litter_in_its_place:': '🚮',
++    \ '\:do_not_litter:': '🚯',
++    \ '\:potable_water:': '🚰',
++    \ '\:non-potable_water:': '🚱',
++    \ '\:bike:': '🚲',
++    \ '\:no_bicycles:': '🚳',
++    \ '\:bicyclist:': '🚴',
++    \ '\:mountain_bicyclist:': '🚵',
++    \ '\:walking:': '🚶',
++    \ '\:no_pedestrians:': '🚷',
++    \ '\:children_crossing:': '🚸',
++    \ '\:mens:': '🚹',
++    \ '\:womens:': '🚺',
++    \ '\:restroom:': '🚻',
++    \ '\:baby_symbol:': '🚼',
++    \ '\:toilet:': '🚽',
++    \ '\:wc:': '🚾',
++    \ '\:shower:': '🚿',
++    \ '\:bath:': '🛀',
++    \ '\:bathtub:': '🛁',
++    \ '\:passport_control:': '🛂',
++    \ '\:customs:': '🛃',
++    \ '\:baggage_claim:': '🛄',
++    \ '\:left_luggage:': '🛅'}
++endfunction
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/doc/generate_latex_symbols_table.jl
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/doc/generate_latex_symbols_table.jl	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/doc/generate_latex_symbols_table.jl	(revision 26505)
+@@ -0,0 +1,111 @@
++#!/bin/env julia
++
++const filename = "julia-vim-L2U-table"
++
++# Keeping this from an old revision, just in case:
++# Combining chars ranges, as obtained from https://en.wikipedia.org/wiki/Combining_character:
++# ('\u0300' ≤ u ≤ '\u036F') ||
++# ('\u1AB0' ≤ u ≤ '\u1AFF') ||
++# ('\u1DC0' ≤ u ≤ '\u1DFF') ||
++# ('\u20D0' ≤ u ≤ '\u20FF') ||
++# ('\uFE20' ≤ u ≤ '\uFE2F')
++
++# Most of this code is copy-pasted and slightly adapted from here:
++# JULIA_HOME/doc/src/manual/unicode-input.md
++# except that instead of producing Markdown we want to generate a vim
++# documentation file.
++#
++# Note that this requires to run `make docs` from the julia source root directory to download
++# the UnicodeData.txt file.
++
++function tab_completions(symbols...)
++    completions = Dict{String, Vector{String}}()
++    for each in symbols, (k, v) in each
++        completions[v] = push!(get!(completions, v, String[]), k)
++    end
++    return completions
++end
++
++function unicode_data()
++    file = normpath(Sys.BINDIR, "..", "..", "doc", "UnicodeData.txt")
++    names = Dict{UInt32, String}()
++    open(file) do unidata
++        for line in readlines(unidata)
++            id, name, desc = split(line, ";")[[1, 2, 11]]
++            codepoint = parse(UInt32, "0x$id")
++            names[codepoint] = (name == "" ? desc : desc == "" ? name : "$name / $desc")
++        end
++    end
++    return names
++end
++
++# Prepend a dotted circle ('◌' i.e. '\u25CC') to combining characters
++function fix_combining_chars(char)
++    cat = Base.Unicode.category_code(char)
++    return string(cat == 6 || cat == 8 ? "◌" : "", char)
++end
++
++function table_entries(completions, unicode_dict)
++    code = String[]
++    unicode = String[]
++    latex = String[]
++    desc = String[]
++
++    for (chars, inputs) in sort!(collect(completions), by = first)
++        code_points, unicode_names, characters = String[], String[], String[]
++        for char in chars
++            push!(code_points, "U+$(uppercase(string(UInt32(char), base = 16, pad = 5)))")
++            push!(unicode_names, get(unicode_dict, UInt32(char), "(No Unicode name)"))
++            push!(characters, isempty(characters) ? fix_combining_chars(char) : "$char")
++        end
++        push!(code, join(code_points, " + "))
++        push!(unicode, join(characters))
++        push!(latex, replace(join(inputs, ", "), "\\\\" => "\\"))
++        push!(desc, join(unicode_names, " + "))
++    end
++    return code, unicode, latex, desc
++end
++
++open("$filename.txt","w") do f
++    print(f, """
++        $filename.txt  LaTeX-to-Unicode reference table
++
++        ===================================================================
++        LATEX-TO-UNICODE REFERENCE TABLE    *L2U-ref* *julia-vim-L2U-reference*
++
++          Note: This file is autogenerated from the script '$(basename(Base.source_path()))'
++          The symbols are based on the documentation of Julia version $VERSION
++          See |julia-vim| for the LaTeX-to-Unicode manual.
++
++        """)
++
++    col_headers = ["Code point(s)", "Character(s)", "Tab completion sequence(s)", "Unicode name(s)"]
++
++    code, unicode, latex, desc =
++        table_entries(
++            tab_completions(
++                REPL.REPLCompletions.latex_symbols,
++                REPL.REPLCompletions.emoji_symbols
++                ),
++            unicode_data()
++            )
++
++    cw = max(length(col_headers[1]), maximum(map(length, code)))
++    uw = max(length(col_headers[2]), maximum(map(length, unicode)))
++    lw = max(length(col_headers[3]), maximum(map(length, latex)))
++    dw = max(length(col_headers[4]), maximum(map(length, desc)))
++
++    print_padded(c, u, l, d) = println(f, rpad(c, cw), " ", rpad(u, uw), " ", rpad(l, lw), " ", d)
++
++    print_padded(col_headers[1:3]..., col_headers[4] * "~")
++    print_padded("-"^cw, "-"^uw, "-"^lw, "-"^dw)
++
++    for (c, u, l, d) in zip(code, unicode, latex, desc)
++        print_padded(c, u, l, d)
++    end
++    print_padded("-"^cw, "-"^uw, "-"^lw, "-"^dw)
++
++    println(f)
++    println(f, "  vim", # separated to avoid an error from vim which otherwise tries to parse this line
++               ":tw=$(cw+uw+lw+dw+3):et:ft=help:norl:")
++end
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U-table.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U-table.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U-table.txt	(revision 26505)
+@@ -0,0 +1,3278 @@
++julia-vim-L2U-table.txt  LaTeX-to-Unicode reference table
++
++===================================================================
++LATEX-TO-UNICODE REFERENCE TABLE    *L2U-ref* *julia-vim-L2U-reference*
++
++  Note: This file is autogenerated from the script 'generate_latex_symbols_table.jl'
++  The symbols are based on the documentation of Julia version 1.5.0-DEV.67
++  See |julia-vim| for the LaTeX-to-Unicode manual.
++
++Code point(s)     Character(s) Tab completion sequence(s)                   Unicode name(s)~
++----------------- ------------ -------------------------------------------- --------------------------------------------------------------------------------------------------------
++U+000A1           ¡            \exclamdown                                  INVERTED EXCLAMATION MARK
++U+000A3           £            \sterling                                    POUND SIGN
++U+000A5           ¥            \yen                                         YEN SIGN
++U+000A6           ¦            \brokenbar                                   BROKEN BAR / BROKEN VERTICAL BAR
++U+000A7           §            \S                                           SECTION SIGN
++U+000A9           ©            \copyright, \:copyright:                     COPYRIGHT SIGN
++U+000AA           ª            \ordfeminine                                 FEMININE ORDINAL INDICATOR
++U+000AC           ¬            \neg                                         NOT SIGN
++U+000AE           ®            \circledR, \:registered:                     REGISTERED SIGN / REGISTERED TRADE MARK SIGN
++U+000AF           ¯            \highminus                                   MACRON / SPACING MACRON
++U+000B0           °            \degree                                      DEGREE SIGN
++U+000B1           ±            \pm                                          PLUS-MINUS SIGN / PLUS-OR-MINUS SIGN
++U+000B2           ²            \^2                                          SUPERSCRIPT TWO / SUPERSCRIPT DIGIT TWO
++U+000B3           ³            \^3                                          SUPERSCRIPT THREE / SUPERSCRIPT DIGIT THREE
++U+000B6           ¶            \P                                           PILCROW SIGN / PARAGRAPH SIGN
++U+000B7           ·            \cdotp                                       MIDDLE DOT
++U+000B9           ¹            \^1                                          SUPERSCRIPT ONE / SUPERSCRIPT DIGIT ONE
++U+000BA           º            \ordmasculine                                MASCULINE ORDINAL INDICATOR
++U+000BC           ¼            \1/4                                         VULGAR FRACTION ONE QUARTER / FRACTION ONE QUARTER
++U+000BD           ½            \1/2                                         VULGAR FRACTION ONE HALF / FRACTION ONE HALF
++U+000BE           ¾            \3/4                                         VULGAR FRACTION THREE QUARTERS / FRACTION THREE QUARTERS
++U+000BF           ¿            \questiondown                                INVERTED QUESTION MARK
++U+000C5           Å            \AA                                          LATIN CAPITAL LETTER A WITH RING ABOVE / LATIN CAPITAL LETTER A RING
++U+000C6           Æ            \AE                                          LATIN CAPITAL LETTER AE / LATIN CAPITAL LETTER A E
++U+000D0           Ð            \DH                                          LATIN CAPITAL LETTER ETH
++U+000D7           ×            \times                                       MULTIPLICATION SIGN
++U+000D8           Ø            \O                                           LATIN CAPITAL LETTER O WITH STROKE / LATIN CAPITAL LETTER O SLASH
++U+000DE           Þ            \TH                                          LATIN CAPITAL LETTER THORN
++U+000DF           ß            \ss                                          LATIN SMALL LETTER SHARP S
++U+000E5           å            \aa                                          LATIN SMALL LETTER A WITH RING ABOVE / LATIN SMALL LETTER A RING
++U+000E6           æ            \ae                                          LATIN SMALL LETTER AE / LATIN SMALL LETTER A E
++U+000F0           ð            \eth, \dh                                    LATIN SMALL LETTER ETH
++U+000F7           ÷            \div                                         DIVISION SIGN
++U+000F8           ø            \o                                           LATIN SMALL LETTER O WITH STROKE / LATIN SMALL LETTER O SLASH
++U+000FE           þ            \th                                          LATIN SMALL LETTER THORN
++U+00110           Đ            \DJ                                          LATIN CAPITAL LETTER D WITH STROKE / LATIN CAPITAL LETTER D BAR
++U+00111           đ            \dj                                          LATIN SMALL LETTER D WITH STROKE / LATIN SMALL LETTER D BAR
++U+00127           ħ            \hbar                                        LATIN SMALL LETTER H WITH STROKE / LATIN SMALL LETTER H BAR
++U+00131           ı            \imath                                       LATIN SMALL LETTER DOTLESS I
++U+00141           Ł            \L                                           LATIN CAPITAL LETTER L WITH STROKE / LATIN CAPITAL LETTER L SLASH
++U+00142           ł            \l                                           LATIN SMALL LETTER L WITH STROKE / LATIN SMALL LETTER L SLASH
++U+0014A           Ŋ            \NG                                          LATIN CAPITAL LETTER ENG
++U+0014B           ŋ            \ng                                          LATIN SMALL LETTER ENG
++U+00152           Œ            \OE                                          LATIN CAPITAL LIGATURE OE / LATIN CAPITAL LETTER O E
++U+00153           œ            \oe                                          LATIN SMALL LIGATURE OE / LATIN SMALL LETTER O E
++U+00195           ƕ            \hvlig                                       LATIN SMALL LETTER HV / LATIN SMALL LETTER H V
++U+0019E           ƞ            \nrleg                                       LATIN SMALL LETTER N WITH LONG RIGHT LEG
++U+001B5           Ƶ            \Zbar                                        LATIN CAPITAL LETTER Z WITH STROKE / LATIN CAPITAL LETTER Z BAR
++U+001C2           ǂ            \doublepipe                                  LATIN LETTER ALVEOLAR CLICK / LATIN LETTER PIPE DOUBLE BAR
++U+00237           ȷ            \jmath                                       LATIN SMALL LETTER DOTLESS J
++U+00250           ɐ            \trna                                        LATIN SMALL LETTER TURNED A
++U+00252           ɒ            \trnsa                                       LATIN SMALL LETTER TURNED ALPHA / LATIN SMALL LETTER TURNED SCRIPT A
++U+00254           ɔ            \openo                                       LATIN SMALL LETTER OPEN O
++U+00256           ɖ            \rtld                                        LATIN SMALL LETTER D WITH TAIL / LATIN SMALL LETTER D RETROFLEX HOOK
++U+00259           ə            \schwa                                       LATIN SMALL LETTER SCHWA
++U+00263           ɣ            \pgamma                                      LATIN SMALL LETTER GAMMA
++U+00264           ɤ            \pbgam                                       LATIN SMALL LETTER RAMS HORN / LATIN SMALL LETTER BABY GAMMA
++U+00265           ɥ            \trnh                                        LATIN SMALL LETTER TURNED H
++U+0026C           ɬ            \btdl                                        LATIN SMALL LETTER L WITH BELT / LATIN SMALL LETTER L BELT
++U+0026D           ɭ            \rtll                                        LATIN SMALL LETTER L WITH RETROFLEX HOOK / LATIN SMALL LETTER L RETROFLEX HOOK
++U+0026F           ɯ            \trnm                                        LATIN SMALL LETTER TURNED M
++U+00270           ɰ            \trnmlr                                      LATIN SMALL LETTER TURNED M WITH LONG LEG
++U+00271           ɱ            \ltlmr                                       LATIN SMALL LETTER M WITH HOOK / LATIN SMALL LETTER M HOOK
++U+00272           ɲ            \ltln                                        LATIN SMALL LETTER N WITH LEFT HOOK / LATIN SMALL LETTER N HOOK
++U+00273           ɳ            \rtln                                        LATIN SMALL LETTER N WITH RETROFLEX HOOK / LATIN SMALL LETTER N RETROFLEX HOOK
++U+00277           ɷ            \clomeg                                      LATIN SMALL LETTER CLOSED OMEGA
++U+00278           ɸ            \ltphi                                       LATIN SMALL LETTER PHI
++U+00279           ɹ            \trnr                                        LATIN SMALL LETTER TURNED R
++U+0027A           ɺ            \trnrl                                       LATIN SMALL LETTER TURNED R WITH LONG LEG
++U+0027B           ɻ            \rttrnr                                      LATIN SMALL LETTER TURNED R WITH HOOK / LATIN SMALL LETTER TURNED R HOOK
++U+0027C           ɼ            \rl                                          LATIN SMALL LETTER R WITH LONG LEG
++U+0027D           ɽ            \rtlr                                        LATIN SMALL LETTER R WITH TAIL / LATIN SMALL LETTER R HOOK
++U+0027E           ɾ            \fhr                                         LATIN SMALL LETTER R WITH FISHHOOK / LATIN SMALL LETTER FISHHOOK R
++U+00282           ʂ            \rtls                                        LATIN SMALL LETTER S WITH HOOK / LATIN SMALL LETTER S HOOK
++U+00283           ʃ            \esh                                         LATIN SMALL LETTER ESH
++U+00287           ʇ            \trnt                                        LATIN SMALL LETTER TURNED T
++U+00288           ʈ            \rtlt                                        LATIN SMALL LETTER T WITH RETROFLEX HOOK / LATIN SMALL LETTER T RETROFLEX HOOK
++U+0028A           ʊ            \pupsil                                      LATIN SMALL LETTER UPSILON
++U+0028B           ʋ            \pscrv                                       LATIN SMALL LETTER V WITH HOOK / LATIN SMALL LETTER SCRIPT V
++U+0028C           ʌ            \invv                                        LATIN SMALL LETTER TURNED V
++U+0028D           ʍ            \invw                                        LATIN SMALL LETTER TURNED W
++U+0028E           ʎ            \trny                                        LATIN SMALL LETTER TURNED Y
++U+00290           ʐ            \rtlz                                        LATIN SMALL LETTER Z WITH RETROFLEX HOOK / LATIN SMALL LETTER Z RETROFLEX HOOK
++U+00292           ʒ            \yogh                                        LATIN SMALL LETTER EZH / LATIN SMALL LETTER YOGH
++U+00294           ʔ            \glst                                        LATIN LETTER GLOTTAL STOP
++U+00295           ʕ            \reglst                                      LATIN LETTER PHARYNGEAL VOICED FRICATIVE / LATIN LETTER REVERSED GLOTTAL STOP
++U+00296           ʖ            \inglst                                      LATIN LETTER INVERTED GLOTTAL STOP
++U+0029E           ʞ            \turnk                                       LATIN SMALL LETTER TURNED K
++U+002A4           ʤ            \dyogh                                       LATIN SMALL LETTER DEZH DIGRAPH / LATIN SMALL LETTER D YOGH
++U+002A7           ʧ            \tesh                                        LATIN SMALL LETTER TESH DIGRAPH / LATIN SMALL LETTER T ESH
++U+002B0           ʰ            \^h                                          MODIFIER LETTER SMALL H
++U+002B2           ʲ            \^j                                          MODIFIER LETTER SMALL J
++U+002B3           ʳ            \^r                                          MODIFIER LETTER SMALL R
++U+002B7           ʷ            \^w                                          MODIFIER LETTER SMALL W
++U+002B8           ʸ            \^y                                          MODIFIER LETTER SMALL Y
++U+002BC           ʼ            \rasp                                        MODIFIER LETTER APOSTROPHE
++U+002C8           ˈ            \verts                                       MODIFIER LETTER VERTICAL LINE
++U+002CC           ˌ            \verti                                       MODIFIER LETTER LOW VERTICAL LINE
++U+002D0           ː            \lmrk                                        MODIFIER LETTER TRIANGULAR COLON
++U+002D1           ˑ            \hlmrk                                       MODIFIER LETTER HALF TRIANGULAR COLON
++U+002D2           ˒            \sbrhr                                       MODIFIER LETTER CENTRED RIGHT HALF RING / MODIFIER LETTER CENTERED RIGHT HALF RING
++U+002D3           ˓            \sblhr                                       MODIFIER LETTER CENTRED LEFT HALF RING / MODIFIER LETTER CENTERED LEFT HALF RING
++U+002D4           ˔            \rais                                        MODIFIER LETTER UP TACK
++U+002D5           ˕            \low                                         MODIFIER LETTER DOWN TACK
++U+002D8           ˘            \u                                           BREVE / SPACING BREVE
++U+002DC           ˜            \tildelow                                    SMALL TILDE / SPACING TILDE
++U+002E1           ˡ            \^l                                          MODIFIER LETTER SMALL L
++U+002E2           ˢ            \^s                                          MODIFIER LETTER SMALL S
++U+002E3           ˣ            \^x                                          MODIFIER LETTER SMALL X
++U+00300           ◌̀           \grave                                       COMBINING GRAVE ACCENT / NON-SPACING GRAVE
++U+00301           ◌́           \acute                                       COMBINING ACUTE ACCENT / NON-SPACING ACUTE
++U+00302           ◌̂           \hat                                         COMBINING CIRCUMFLEX ACCENT / NON-SPACING CIRCUMFLEX
++U+00303           ◌̃           \tilde                                       COMBINING TILDE / NON-SPACING TILDE
++U+00304           ◌̄           \bar                                         COMBINING MACRON / NON-SPACING MACRON
++U+00305           ◌̅           \overbar                                     COMBINING OVERLINE / NON-SPACING OVERSCORE
++U+00306           ◌̆           \breve                                       COMBINING BREVE / NON-SPACING BREVE
++U+00307           ◌̇           \dot                                         COMBINING DOT ABOVE / NON-SPACING DOT ABOVE
++U+00308           ◌̈           \ddot                                        COMBINING DIAERESIS / NON-SPACING DIAERESIS
++U+00309           ◌̉           \ovhook                                      COMBINING HOOK ABOVE / NON-SPACING HOOK ABOVE
++U+0030A           ◌̊           \ocirc                                       COMBINING RING ABOVE / NON-SPACING RING ABOVE
++U+0030B           ◌̋           \H                                           COMBINING DOUBLE ACUTE ACCENT / NON-SPACING DOUBLE ACUTE
++U+0030C           ◌̌           \check                                       COMBINING CARON / NON-SPACING HACEK
++U+00310           ◌̐           \candra                                      COMBINING CANDRABINDU / NON-SPACING CANDRABINDU
++U+00312           ◌̒           \oturnedcomma                                COMBINING TURNED COMMA ABOVE / NON-SPACING TURNED COMMA ABOVE
++U+00315           ◌̕           \ocommatopright                              COMBINING COMMA ABOVE RIGHT / NON-SPACING COMMA ABOVE RIGHT
++U+0031A           ◌̚           \droang                                      COMBINING LEFT ANGLE ABOVE / NON-SPACING LEFT ANGLE ABOVE
++U+00321           ◌̡           \palh                                        COMBINING PALATALIZED HOOK BELOW / NON-SPACING PALATALIZED HOOK BELOW
++U+00322           ◌̢           \rh                                          COMBINING RETROFLEX HOOK BELOW / NON-SPACING RETROFLEX HOOK BELOW
++U+00327           ◌̧           \c                                           COMBINING CEDILLA / NON-SPACING CEDILLA
++U+00328           ◌̨           \k                                           COMBINING OGONEK / NON-SPACING OGONEK
++U+0032A           ◌̪           \sbbrg                                       COMBINING BRIDGE BELOW / NON-SPACING BRIDGE BELOW
++U+00330           ◌̰           \wideutilde                                  COMBINING TILDE BELOW / NON-SPACING TILDE BELOW
++U+00332           ◌̲           \underbar                                    COMBINING LOW LINE / NON-SPACING UNDERSCORE
++U+00336           ◌̶           \strike, \sout                               COMBINING LONG STROKE OVERLAY / NON-SPACING LONG BAR OVERLAY
++U+00338           ◌̸           \not                                         COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+0034D           ◌͍           \underleftrightarrow                         COMBINING LEFT RIGHT ARROW BELOW
++U+00391           Α            \Alpha                                       GREEK CAPITAL LETTER ALPHA
++U+00392           Β            \Beta                                        GREEK CAPITAL LETTER BETA
++U+00393           Γ            \Gamma                                       GREEK CAPITAL LETTER GAMMA
++U+00394           Δ            \Delta                                       GREEK CAPITAL LETTER DELTA
++U+00395           Ε            \Epsilon                                     GREEK CAPITAL LETTER EPSILON
++U+00396           Ζ            \Zeta                                        GREEK CAPITAL LETTER ZETA
++U+00397           Η            \Eta                                         GREEK CAPITAL LETTER ETA
++U+00398           Θ            \Theta                                       GREEK CAPITAL LETTER THETA
++U+00399           Ι            \Iota                                        GREEK CAPITAL LETTER IOTA
++U+0039A           Κ            \Kappa                                       GREEK CAPITAL LETTER KAPPA
++U+0039B           Λ            \Lambda                                      GREEK CAPITAL LETTER LAMDA / GREEK CAPITAL LETTER LAMBDA
++U+0039C           Μ            \upMu                                        GREEK CAPITAL LETTER MU
++U+0039D           Ν            \upNu                                        GREEK CAPITAL LETTER NU
++U+0039E           Ξ            \Xi                                          GREEK CAPITAL LETTER XI
++U+0039F           Ο            \upOmicron                                   GREEK CAPITAL LETTER OMICRON
++U+003A0           Π            \Pi                                          GREEK CAPITAL LETTER PI
++U+003A1           Ρ            \Rho                                         GREEK CAPITAL LETTER RHO
++U+003A3           Σ            \Sigma                                       GREEK CAPITAL LETTER SIGMA
++U+003A4           Τ            \Tau                                         GREEK CAPITAL LETTER TAU
++U+003A5           Υ            \Upsilon                                     GREEK CAPITAL LETTER UPSILON
++U+003A6           Φ            \Phi                                         GREEK CAPITAL LETTER PHI
++U+003A7           Χ            \Chi                                         GREEK CAPITAL LETTER CHI
++U+003A8           Ψ            \Psi                                         GREEK CAPITAL LETTER PSI
++U+003A9           Ω            \Omega                                       GREEK CAPITAL LETTER OMEGA
++U+003B1           α            \alpha                                       GREEK SMALL LETTER ALPHA
++U+003B2           β            \beta                                        GREEK SMALL LETTER BETA
++U+003B3           γ            \gamma                                       GREEK SMALL LETTER GAMMA
++U+003B4           δ            \delta                                       GREEK SMALL LETTER DELTA
++U+003B5           ε            \upepsilon, \varepsilon                      GREEK SMALL LETTER EPSILON
++U+003B6           ζ            \zeta                                        GREEK SMALL LETTER ZETA
++U+003B7           η            \eta                                         GREEK SMALL LETTER ETA
++U+003B8           θ            \theta                                       GREEK SMALL LETTER THETA
++U+003B9           ι            \iota                                        GREEK SMALL LETTER IOTA
++U+003BA           κ            \kappa                                       GREEK SMALL LETTER KAPPA
++U+003BB           λ            \lambda                                      GREEK SMALL LETTER LAMDA / GREEK SMALL LETTER LAMBDA
++U+003BC           μ            \mu                                          GREEK SMALL LETTER MU
++U+003BD           ν            \nu                                          GREEK SMALL LETTER NU
++U+003BE           ξ            \xi                                          GREEK SMALL LETTER XI
++U+003BF           ο            \upomicron                                   GREEK SMALL LETTER OMICRON
++U+003C0           π            \pi                                          GREEK SMALL LETTER PI
++U+003C1           ρ            \rho                                         GREEK SMALL LETTER RHO
++U+003C2           ς            \varsigma                                    GREEK SMALL LETTER FINAL SIGMA
++U+003C3           σ            \sigma                                       GREEK SMALL LETTER SIGMA
++U+003C4           τ            \tau                                         GREEK SMALL LETTER TAU
++U+003C5           υ            \upsilon                                     GREEK SMALL LETTER UPSILON
++U+003C6           φ            \varphi                                      GREEK SMALL LETTER PHI
++U+003C7           χ            \chi                                         GREEK SMALL LETTER CHI
++U+003C8           ψ            \psi                                         GREEK SMALL LETTER PSI
++U+003C9           ω            \omega                                       GREEK SMALL LETTER OMEGA
++U+003D0           ϐ            \upvarbeta                                   GREEK BETA SYMBOL / GREEK SMALL LETTER CURLED BETA
++U+003D1           ϑ            \vartheta                                    GREEK THETA SYMBOL / GREEK SMALL LETTER SCRIPT THETA
++U+003D5           ϕ            \phi                                         GREEK PHI SYMBOL / GREEK SMALL LETTER SCRIPT PHI
++U+003D6           ϖ            \varpi                                       GREEK PI SYMBOL / GREEK SMALL LETTER OMEGA PI
++U+003D8           Ϙ            \upoldKoppa                                  GREEK LETTER ARCHAIC KOPPA
++U+003D9           ϙ            \upoldkoppa                                  GREEK SMALL LETTER ARCHAIC KOPPA
++U+003DA           Ϛ            \Stigma                                      GREEK LETTER STIGMA / GREEK CAPITAL LETTER STIGMA
++U+003DB           ϛ            \upstigma                                    GREEK SMALL LETTER STIGMA
++U+003DC           Ϝ            \Digamma                                     GREEK LETTER DIGAMMA / GREEK CAPITAL LETTER DIGAMMA
++U+003DD           ϝ            \digamma                                     GREEK SMALL LETTER DIGAMMA
++U+003DE           Ϟ            \Koppa                                       GREEK LETTER KOPPA / GREEK CAPITAL LETTER KOPPA
++U+003DF           ϟ            \upkoppa                                     GREEK SMALL LETTER KOPPA
++U+003E0           Ϡ            \Sampi                                       GREEK LETTER SAMPI / GREEK CAPITAL LETTER SAMPI
++U+003E1           ϡ            \upsampi                                     GREEK SMALL LETTER SAMPI
++U+003F0           ϰ            \varkappa                                    GREEK KAPPA SYMBOL / GREEK SMALL LETTER SCRIPT KAPPA
++U+003F1           ϱ            \varrho                                      GREEK RHO SYMBOL / GREEK SMALL LETTER TAILED RHO
++U+003F4           ϴ            \varTheta                                    GREEK CAPITAL THETA SYMBOL
++U+003F5           ϵ            \epsilon                                     GREEK LUNATE EPSILON SYMBOL
++U+003F6           ϶            \backepsilon                                 GREEK REVERSED LUNATE EPSILON SYMBOL
++U+01D2C           ᴬ            \^A                                          MODIFIER LETTER CAPITAL A
++U+01D2E           ᴮ            \^B                                          MODIFIER LETTER CAPITAL B
++U+01D30           ᴰ            \^D                                          MODIFIER LETTER CAPITAL D
++U+01D31           ᴱ            \^E                                          MODIFIER LETTER CAPITAL E
++U+01D33           ᴳ            \^G                                          MODIFIER LETTER CAPITAL G
++U+01D34           ᴴ            \^H                                          MODIFIER LETTER CAPITAL H
++U+01D35           ᴵ            \^I                                          MODIFIER LETTER CAPITAL I
++U+01D36           ᴶ            \^J                                          MODIFIER LETTER CAPITAL J
++U+01D37           ᴷ            \^K                                          MODIFIER LETTER CAPITAL K
++U+01D38           ᴸ            \^L                                          MODIFIER LETTER CAPITAL L
++U+01D39           ᴹ            \^M                                          MODIFIER LETTER CAPITAL M
++U+01D3A           ᴺ            \^N                                          MODIFIER LETTER CAPITAL N
++U+01D3C           ᴼ            \^O                                          MODIFIER LETTER CAPITAL O
++U+01D3E           ᴾ            \^P                                          MODIFIER LETTER CAPITAL P
++U+01D3F           ᴿ            \^R                                          MODIFIER LETTER CAPITAL R
++U+01D40           ᵀ            \^T                                          MODIFIER LETTER CAPITAL T
++U+01D41           ᵁ            \^U                                          MODIFIER LETTER CAPITAL U
++U+01D42           ᵂ            \^W                                          MODIFIER LETTER CAPITAL W
++U+01D43           ᵃ            \^a                                          MODIFIER LETTER SMALL A
++U+01D45           ᵅ            \^alpha                                      MODIFIER LETTER SMALL ALPHA
++U+01D47           ᵇ            \^b                                          MODIFIER LETTER SMALL B
++U+01D48           ᵈ            \^d                                          MODIFIER LETTER SMALL D
++U+01D49           ᵉ            \^e                                          MODIFIER LETTER SMALL E
++U+01D4B           ᵋ            \^epsilon                                    MODIFIER LETTER SMALL OPEN E
++U+01D4D           ᵍ            \^g                                          MODIFIER LETTER SMALL G
++U+01D4F           ᵏ            \^k                                          MODIFIER LETTER SMALL K
++U+01D50           ᵐ            \^m                                          MODIFIER LETTER SMALL M
++U+01D52           ᵒ            \^o                                          MODIFIER LETTER SMALL O
++U+01D56           ᵖ            \^p                                          MODIFIER LETTER SMALL P
++U+01D57           ᵗ            \^t                                          MODIFIER LETTER SMALL T
++U+01D58           ᵘ            \^u                                          MODIFIER LETTER SMALL U
++U+01D5B           ᵛ            \^v                                          MODIFIER LETTER SMALL V
++U+01D5D           ᵝ            \^beta                                       MODIFIER LETTER SMALL BETA
++U+01D5E           ᵞ            \^gamma                                      MODIFIER LETTER SMALL GREEK GAMMA
++U+01D5F           ᵟ            \^delta                                      MODIFIER LETTER SMALL DELTA
++U+01D60           ᵠ            \^phi                                        MODIFIER LETTER SMALL GREEK PHI
++U+01D61           ᵡ            \^chi                                        MODIFIER LETTER SMALL CHI
++U+01D62           ᵢ            \_i                                          LATIN SUBSCRIPT SMALL LETTER I
++U+01D63           ᵣ            \_r                                          LATIN SUBSCRIPT SMALL LETTER R
++U+01D64           ᵤ            \_u                                          LATIN SUBSCRIPT SMALL LETTER U
++U+01D65           ᵥ            \_v                                          LATIN SUBSCRIPT SMALL LETTER V
++U+01D66           ᵦ            \_beta                                       GREEK SUBSCRIPT SMALL LETTER BETA
++U+01D67           ᵧ            \_gamma                                      GREEK SUBSCRIPT SMALL LETTER GAMMA
++U+01D68           ᵨ            \_rho                                        GREEK SUBSCRIPT SMALL LETTER RHO
++U+01D69           ᵩ            \_phi                                        GREEK SUBSCRIPT SMALL LETTER PHI
++U+01D6A           ᵪ            \_chi                                        GREEK SUBSCRIPT SMALL LETTER CHI
++U+01D9C           ᶜ            \^c                                          MODIFIER LETTER SMALL C
++U+01DA0           ᶠ            \^f                                          MODIFIER LETTER SMALL F
++U+01DA5           ᶥ            \^iota                                       MODIFIER LETTER SMALL IOTA
++U+01DB2           ᶲ            \^Phi                                        MODIFIER LETTER SMALL PHI
++U+01DBB           ᶻ            \^z                                          MODIFIER LETTER SMALL Z
++U+01DBF           ᶿ            \^theta                                      MODIFIER LETTER SMALL THETA
++U+02002                        \enspace                                     EN SPACE
++U+02003                        \quad                                        EM SPACE
++U+02005                        \thickspace                                  FOUR-PER-EM SPACE
++U+02009                        \thinspace                                   THIN SPACE
++U+0200A                        \hspace                                      HAIR SPACE
++U+02013           –            \endash                                      EN DASH
++U+02014           —            \emdash                                      EM DASH
++U+02016           ‖            \Vert                                        DOUBLE VERTICAL LINE / DOUBLE VERTICAL BAR
++U+02018           ‘            \lq                                          LEFT SINGLE QUOTATION MARK / SINGLE TURNED COMMA QUOTATION MARK
++U+02019           ’            \rq                                          RIGHT SINGLE QUOTATION MARK / SINGLE COMMA QUOTATION MARK
++U+0201B           ‛            \reapos                                      SINGLE HIGH-REVERSED-9 QUOTATION MARK / SINGLE REVERSED COMMA QUOTATION MARK
++U+0201C           “            \quotedblleft                                LEFT DOUBLE QUOTATION MARK / DOUBLE TURNED COMMA QUOTATION MARK
++U+0201D           ”            \quotedblright                               RIGHT DOUBLE QUOTATION MARK / DOUBLE COMMA QUOTATION MARK
++U+02020           †            \dagger                                      DAGGER
++U+02021           ‡            \ddagger                                     DOUBLE DAGGER
++U+02022           •            \bullet                                      BULLET
++U+02026           …            \dots, \ldots                                HORIZONTAL ELLIPSIS
++U+02030           ‰            \perthousand                                 PER MILLE SIGN
++U+02031           ‱            \pertenthousand                              PER TEN THOUSAND SIGN
++U+02032           ′            \prime                                       PRIME
++U+02033           ″            \pprime                                      DOUBLE PRIME
++U+02034           ‴            \ppprime                                     TRIPLE PRIME
++U+02035           ‵            \backprime                                   REVERSED PRIME
++U+02036           ‶            \backpprime                                  REVERSED DOUBLE PRIME
++U+02037           ‷            \backppprime                                 REVERSED TRIPLE PRIME
++U+02039           ‹            \guilsinglleft                               SINGLE LEFT-POINTING ANGLE QUOTATION MARK / LEFT POINTING SINGLE GUILLEMET
++U+0203A           ›            \guilsinglright                              SINGLE RIGHT-POINTING ANGLE QUOTATION MARK / RIGHT POINTING SINGLE GUILLEMET
++U+0203C           ‼            \:bangbang:                                  DOUBLE EXCLAMATION MARK
++U+02040           ⁀            \tieconcat                                   CHARACTER TIE
++U+02049           ⁉            \:interrobang:                               EXCLAMATION QUESTION MARK
++U+02057           ⁗            \pppprime                                    QUADRUPLE PRIME
++U+0205D           ⁝            \tricolon                                    TRICOLON
++U+02060           ⁠            \nolinebreak                                 WORD JOINER
++U+02070           ⁰            \^0                                          SUPERSCRIPT ZERO / SUPERSCRIPT DIGIT ZERO
++U+02071           ⁱ            \^i                                          SUPERSCRIPT LATIN SMALL LETTER I
++U+02074           ⁴            \^4                                          SUPERSCRIPT FOUR / SUPERSCRIPT DIGIT FOUR
++U+02075           ⁵            \^5                                          SUPERSCRIPT FIVE / SUPERSCRIPT DIGIT FIVE
++U+02076           ⁶            \^6                                          SUPERSCRIPT SIX / SUPERSCRIPT DIGIT SIX
++U+02077           ⁷            \^7                                          SUPERSCRIPT SEVEN / SUPERSCRIPT DIGIT SEVEN
++U+02078           ⁸            \^8                                          SUPERSCRIPT EIGHT / SUPERSCRIPT DIGIT EIGHT
++U+02079           ⁹            \^9                                          SUPERSCRIPT NINE / SUPERSCRIPT DIGIT NINE
++U+0207A           ⁺            \^+                                          SUPERSCRIPT PLUS SIGN
++U+0207B           ⁻            \^-                                          SUPERSCRIPT MINUS / SUPERSCRIPT HYPHEN-MINUS
++U+0207C           ⁼            \^=                                          SUPERSCRIPT EQUALS SIGN
++U+0207D           ⁽            \^(                                          SUPERSCRIPT LEFT PARENTHESIS / SUPERSCRIPT OPENING PARENTHESIS
++U+0207E           ⁾            \^)                                          SUPERSCRIPT RIGHT PARENTHESIS / SUPERSCRIPT CLOSING PARENTHESIS
++U+0207F           ⁿ            \^n                                          SUPERSCRIPT LATIN SMALL LETTER N
++U+02080           ₀            \_0                                          SUBSCRIPT ZERO / SUBSCRIPT DIGIT ZERO
++U+02081           ₁            \_1                                          SUBSCRIPT ONE / SUBSCRIPT DIGIT ONE
++U+02082           ₂            \_2                                          SUBSCRIPT TWO / SUBSCRIPT DIGIT TWO
++U+02083           ₃            \_3                                          SUBSCRIPT THREE / SUBSCRIPT DIGIT THREE
++U+02084           ₄            \_4                                          SUBSCRIPT FOUR / SUBSCRIPT DIGIT FOUR
++U+02085           ₅            \_5                                          SUBSCRIPT FIVE / SUBSCRIPT DIGIT FIVE
++U+02086           ₆            \_6                                          SUBSCRIPT SIX / SUBSCRIPT DIGIT SIX
++U+02087           ₇            \_7                                          SUBSCRIPT SEVEN / SUBSCRIPT DIGIT SEVEN
++U+02088           ₈            \_8                                          SUBSCRIPT EIGHT / SUBSCRIPT DIGIT EIGHT
++U+02089           ₉            \_9                                          SUBSCRIPT NINE / SUBSCRIPT DIGIT NINE
++U+0208A           ₊            \_+                                          SUBSCRIPT PLUS SIGN
++U+0208B           ₋            \_-                                          SUBSCRIPT MINUS / SUBSCRIPT HYPHEN-MINUS
++U+0208C           ₌            \_=                                          SUBSCRIPT EQUALS SIGN
++U+0208D           ₍            \_(                                          SUBSCRIPT LEFT PARENTHESIS / SUBSCRIPT OPENING PARENTHESIS
++U+0208E           ₎            \_)                                          SUBSCRIPT RIGHT PARENTHESIS / SUBSCRIPT CLOSING PARENTHESIS
++U+02090           ₐ            \_a                                          LATIN SUBSCRIPT SMALL LETTER A
++U+02091           ₑ            \_e                                          LATIN SUBSCRIPT SMALL LETTER E
++U+02092           ₒ            \_o                                          LATIN SUBSCRIPT SMALL LETTER O
++U+02093           ₓ            \_x                                          LATIN SUBSCRIPT SMALL LETTER X
++U+02094           ₔ            \_schwa                                      LATIN SUBSCRIPT SMALL LETTER SCHWA
++U+02095           ₕ            \_h                                          LATIN SUBSCRIPT SMALL LETTER H
++U+02096           ₖ            \_k                                          LATIN SUBSCRIPT SMALL LETTER K
++U+02097           ₗ            \_l                                          LATIN SUBSCRIPT SMALL LETTER L
++U+02098           ₘ            \_m                                          LATIN SUBSCRIPT SMALL LETTER M
++U+02099           ₙ            \_n                                          LATIN SUBSCRIPT SMALL LETTER N
++U+0209A           ₚ            \_p                                          LATIN SUBSCRIPT SMALL LETTER P
++U+0209B           ₛ            \_s                                          LATIN SUBSCRIPT SMALL LETTER S
++U+0209C           ₜ            \_t                                          LATIN SUBSCRIPT SMALL LETTER T
++U+020A7           ₧            \pes                                         PESETA SIGN
++U+020AC           €            \euro                                        EURO SIGN
++U+020D0           ◌⃐           \leftharpoonaccent                           COMBINING LEFT HARPOON ABOVE / NON-SPACING LEFT HARPOON ABOVE
++U+020D1           ◌⃑           \rightharpoonaccent                          COMBINING RIGHT HARPOON ABOVE / NON-SPACING RIGHT HARPOON ABOVE
++U+020D2           ◌⃒           \vertoverlay                                 COMBINING LONG VERTICAL LINE OVERLAY / NON-SPACING LONG VERTICAL BAR OVERLAY
++U+020D6           ◌⃖           \overleftarrow                               COMBINING LEFT ARROW ABOVE / NON-SPACING LEFT ARROW ABOVE
++U+020D7           ◌⃗           \vec                                         COMBINING RIGHT ARROW ABOVE / NON-SPACING RIGHT ARROW ABOVE
++U+020DB           ◌⃛           \dddot                                       COMBINING THREE DOTS ABOVE / NON-SPACING THREE DOTS ABOVE
++U+020DC           ◌⃜           \ddddot                                      COMBINING FOUR DOTS ABOVE / NON-SPACING FOUR DOTS ABOVE
++U+020DD           ◌⃝           \enclosecircle                               COMBINING ENCLOSING CIRCLE / ENCLOSING CIRCLE
++U+020DE           ◌⃞           \enclosesquare                               COMBINING ENCLOSING SQUARE / ENCLOSING SQUARE
++U+020DF           ◌⃟           \enclosediamond                              COMBINING ENCLOSING DIAMOND / ENCLOSING DIAMOND
++U+020E1           ◌⃡           \overleftrightarrow                          COMBINING LEFT RIGHT ARROW ABOVE / NON-SPACING LEFT RIGHT ARROW ABOVE
++U+020E4           ◌⃤           \enclosetriangle                             COMBINING ENCLOSING UPWARD POINTING TRIANGLE
++U+020E7           ◌⃧           \annuity                                     COMBINING ANNUITY SYMBOL
++U+020E8           ◌⃨           \threeunderdot                               COMBINING TRIPLE UNDERDOT
++U+020E9           ◌⃩           \widebridgeabove                             COMBINING WIDE BRIDGE ABOVE
++U+020EC           ◌⃬           \underrightharpoondown                       COMBINING RIGHTWARDS HARPOON WITH BARB DOWNWARDS
++U+020ED           ◌⃭           \underleftharpoondown                        COMBINING LEFTWARDS HARPOON WITH BARB DOWNWARDS
++U+020EE           ◌⃮           \underleftarrow                              COMBINING LEFT ARROW BELOW
++U+020EF           ◌⃯           \underrightarrow                             COMBINING RIGHT ARROW BELOW
++U+020F0           ◌⃰           \asteraccent                                 COMBINING ASTERISK ABOVE
++U+02102           ℂ            \bbC                                         DOUBLE-STRUCK CAPITAL C / DOUBLE-STRUCK C
++U+02107           ℇ            \eulermascheroni                             EULER CONSTANT / EULERS
++U+0210A           ℊ            \scrg                                        SCRIPT SMALL G
++U+0210B           ℋ            \scrH                                        SCRIPT CAPITAL H / SCRIPT H
++U+0210C           ℌ            \frakH                                       BLACK-LETTER CAPITAL H / BLACK-LETTER H
++U+0210D           ℍ            \bbH                                         DOUBLE-STRUCK CAPITAL H / DOUBLE-STRUCK H
++U+0210E           ℎ            \planck                                      PLANCK CONSTANT
++U+0210F           ℏ            \hslash                                      PLANCK CONSTANT OVER TWO PI / PLANCK CONSTANT OVER 2 PI
++U+02110           ℐ            \scrI                                        SCRIPT CAPITAL I / SCRIPT I
++U+02111           ℑ            \Im                                          BLACK-LETTER CAPITAL I / BLACK-LETTER I
++U+02112           ℒ            \scrL                                        SCRIPT CAPITAL L / SCRIPT L
++U+02113           ℓ            \ell                                         SCRIPT SMALL L
++U+02115           ℕ            \bbN                                         DOUBLE-STRUCK CAPITAL N / DOUBLE-STRUCK N
++U+02116           №            \numero                                      NUMERO SIGN / NUMERO
++U+02118           ℘            \wp                                          SCRIPT CAPITAL P / SCRIPT P
++U+02119           ℙ            \bbP                                         DOUBLE-STRUCK CAPITAL P / DOUBLE-STRUCK P
++U+0211A           ℚ            \bbQ                                         DOUBLE-STRUCK CAPITAL Q / DOUBLE-STRUCK Q
++U+0211B           ℛ            \scrR                                        SCRIPT CAPITAL R / SCRIPT R
++U+0211C           ℜ            \Re                                          BLACK-LETTER CAPITAL R / BLACK-LETTER R
++U+0211D           ℝ            \bbR                                         DOUBLE-STRUCK CAPITAL R / DOUBLE-STRUCK R
++U+0211E           ℞            \xrat                                        PRESCRIPTION TAKE
++U+02122           ™            \trademark, \:tm:                            TRADE MARK SIGN / TRADEMARK
++U+02124           ℤ            \bbZ                                         DOUBLE-STRUCK CAPITAL Z / DOUBLE-STRUCK Z
++U+02126           Ω            \ohm                                         OHM SIGN / OHM
++U+02127           ℧            \mho                                         INVERTED OHM SIGN / MHO
++U+02128           ℨ            \frakZ                                       BLACK-LETTER CAPITAL Z / BLACK-LETTER Z
++U+02129           ℩            \turnediota                                  TURNED GREEK SMALL LETTER IOTA
++U+0212B           Å            \Angstrom                                    ANGSTROM SIGN / ANGSTROM UNIT
++U+0212C           ℬ            \scrB                                        SCRIPT CAPITAL B / SCRIPT B
++U+0212D           ℭ            \frakC                                       BLACK-LETTER CAPITAL C / BLACK-LETTER C
++U+0212F           ℯ            \scre, \euler                                SCRIPT SMALL E
++U+02130           ℰ            \scrE                                        SCRIPT CAPITAL E / SCRIPT E
++U+02131           ℱ            \scrF                                        SCRIPT CAPITAL F / SCRIPT F
++U+02132           Ⅎ            \Finv                                        TURNED CAPITAL F / TURNED F
++U+02133           ℳ            \scrM                                        SCRIPT CAPITAL M / SCRIPT M
++U+02134           ℴ            \scro                                        SCRIPT SMALL O
++U+02135           ℵ            \aleph                                       ALEF SYMBOL / FIRST TRANSFINITE CARDINAL
++U+02136           ℶ            \beth                                        BET SYMBOL / SECOND TRANSFINITE CARDINAL
++U+02137           ℷ            \gimel                                       GIMEL SYMBOL / THIRD TRANSFINITE CARDINAL
++U+02138           ℸ            \daleth                                      DALET SYMBOL / FOURTH TRANSFINITE CARDINAL
++U+02139           ℹ            \:information_source:                        INFORMATION SOURCE
++U+0213C           ℼ            \bbpi                                        DOUBLE-STRUCK SMALL PI
++U+0213D           ℽ            \bbgamma                                     DOUBLE-STRUCK SMALL GAMMA
++U+0213E           ℾ            \bbGamma                                     DOUBLE-STRUCK CAPITAL GAMMA
++U+0213F           ℿ            \bbPi                                        DOUBLE-STRUCK CAPITAL PI
++U+02140           ⅀            \bbsum                                       DOUBLE-STRUCK N-ARY SUMMATION
++U+02141           ⅁            \Game                                        TURNED SANS-SERIF CAPITAL G
++U+02142           ⅂            \sansLturned                                 TURNED SANS-SERIF CAPITAL L
++U+02143           ⅃            \sansLmirrored                               REVERSED SANS-SERIF CAPITAL L
++U+02144           ⅄            \Yup                                         TURNED SANS-SERIF CAPITAL Y
++U+02145           ⅅ            \bbiD                                        DOUBLE-STRUCK ITALIC CAPITAL D
++U+02146           ⅆ            \bbid                                        DOUBLE-STRUCK ITALIC SMALL D
++U+02147           ⅇ            \bbie                                        DOUBLE-STRUCK ITALIC SMALL E
++U+02148           ⅈ            \bbii                                        DOUBLE-STRUCK ITALIC SMALL I
++U+02149           ⅉ            \bbij                                        DOUBLE-STRUCK ITALIC SMALL J
++U+0214A           ⅊            \PropertyLine                                PROPERTY LINE
++U+0214B           ⅋            \upand                                       TURNED AMPERSAND
++U+02150           ⅐            \1/7                                         VULGAR FRACTION ONE SEVENTH
++U+02151           ⅑            \1/9                                         VULGAR FRACTION ONE NINTH
++U+02152           ⅒            \1/10                                        VULGAR FRACTION ONE TENTH
++U+02153           ⅓            \1/3                                         VULGAR FRACTION ONE THIRD / FRACTION ONE THIRD
++U+02154           ⅔            \2/3                                         VULGAR FRACTION TWO THIRDS / FRACTION TWO THIRDS
++U+02155           ⅕            \1/5                                         VULGAR FRACTION ONE FIFTH / FRACTION ONE FIFTH
++U+02156           ⅖            \2/5                                         VULGAR FRACTION TWO FIFTHS / FRACTION TWO FIFTHS
++U+02157           ⅗            \3/5                                         VULGAR FRACTION THREE FIFTHS / FRACTION THREE FIFTHS
++U+02158           ⅘            \4/5                                         VULGAR FRACTION FOUR FIFTHS / FRACTION FOUR FIFTHS
++U+02159           ⅙            \1/6                                         VULGAR FRACTION ONE SIXTH / FRACTION ONE SIXTH
++U+0215A           ⅚            \5/6                                         VULGAR FRACTION FIVE SIXTHS / FRACTION FIVE SIXTHS
++U+0215B           ⅛            \1/8                                         VULGAR FRACTION ONE EIGHTH / FRACTION ONE EIGHTH
++U+0215C           ⅜            \3/8                                         VULGAR FRACTION THREE EIGHTHS / FRACTION THREE EIGHTHS
++U+0215D           ⅝            \5/8                                         VULGAR FRACTION FIVE EIGHTHS / FRACTION FIVE EIGHTHS
++U+0215E           ⅞            \7/8                                         VULGAR FRACTION SEVEN EIGHTHS / FRACTION SEVEN EIGHTHS
++U+0215F           ⅟            \1/                                          FRACTION NUMERATOR ONE
++U+02189           ↉            \0/3                                         VULGAR FRACTION ZERO THIRDS
++U+02190           ←            \leftarrow                                   LEFTWARDS ARROW / LEFT ARROW
++U+02191           ↑            \uparrow                                     UPWARDS ARROW / UP ARROW
++U+02192           →            \to, \rightarrow                             RIGHTWARDS ARROW / RIGHT ARROW
++U+02193           ↓            \downarrow                                   DOWNWARDS ARROW / DOWN ARROW
++U+02194           ↔            \leftrightarrow, \:left_right_arrow:         LEFT RIGHT ARROW
++U+02195           ↕            \updownarrow, \:arrow_up_down:               UP DOWN ARROW
++U+02196           ↖            \nwarrow, \:arrow_upper_left:                NORTH WEST ARROW / UPPER LEFT ARROW
++U+02197           ↗            \nearrow, \:arrow_upper_right:               NORTH EAST ARROW / UPPER RIGHT ARROW
++U+02198           ↘            \searrow, \:arrow_lower_right:               SOUTH EAST ARROW / LOWER RIGHT ARROW
++U+02199           ↙            \swarrow, \:arrow_lower_left:                SOUTH WEST ARROW / LOWER LEFT ARROW
++U+0219A           ↚            \nleftarrow                                  LEFTWARDS ARROW WITH STROKE / LEFT ARROW WITH STROKE
++U+0219B           ↛            \nrightarrow                                 RIGHTWARDS ARROW WITH STROKE / RIGHT ARROW WITH STROKE
++U+0219C           ↜            \leftwavearrow                               LEFTWARDS WAVE ARROW / LEFT WAVE ARROW
++U+0219D           ↝            \rightwavearrow                              RIGHTWARDS WAVE ARROW / RIGHT WAVE ARROW
++U+0219E           ↞            \twoheadleftarrow                            LEFTWARDS TWO HEADED ARROW / LEFT TWO HEADED ARROW
++U+0219F           ↟            \twoheaduparrow                              UPWARDS TWO HEADED ARROW / UP TWO HEADED ARROW
++U+021A0           ↠            \twoheadrightarrow                           RIGHTWARDS TWO HEADED ARROW / RIGHT TWO HEADED ARROW
++U+021A1           ↡            \twoheaddownarrow                            DOWNWARDS TWO HEADED ARROW / DOWN TWO HEADED ARROW
++U+021A2           ↢            \leftarrowtail                               LEFTWARDS ARROW WITH TAIL / LEFT ARROW WITH TAIL
++U+021A3           ↣            \rightarrowtail                              RIGHTWARDS ARROW WITH TAIL / RIGHT ARROW WITH TAIL
++U+021A4           ↤            \mapsfrom                                    LEFTWARDS ARROW FROM BAR / LEFT ARROW FROM BAR
++U+021A5           ↥            \mapsup                                      UPWARDS ARROW FROM BAR / UP ARROW FROM BAR
++U+021A6           ↦            \mapsto                                      RIGHTWARDS ARROW FROM BAR / RIGHT ARROW FROM BAR
++U+021A7           ↧            \mapsdown                                    DOWNWARDS ARROW FROM BAR / DOWN ARROW FROM BAR
++U+021A8           ↨            \updownarrowbar                              UP DOWN ARROW WITH BASE
++U+021A9           ↩            \hookleftarrow, \:leftwards_arrow_with_hook: LEFTWARDS ARROW WITH HOOK / LEFT ARROW WITH HOOK
++U+021AA           ↪            \hookrightarrow, \:arrow_right_hook:         RIGHTWARDS ARROW WITH HOOK / RIGHT ARROW WITH HOOK
++U+021AB           ↫            \looparrowleft                               LEFTWARDS ARROW WITH LOOP / LEFT ARROW WITH LOOP
++U+021AC           ↬            \looparrowright                              RIGHTWARDS ARROW WITH LOOP / RIGHT ARROW WITH LOOP
++U+021AD           ↭            \leftrightsquigarrow                         LEFT RIGHT WAVE ARROW
++U+021AE           ↮            \nleftrightarrow                             LEFT RIGHT ARROW WITH STROKE
++U+021AF           ↯            \downzigzagarrow                             DOWNWARDS ZIGZAG ARROW / DOWN ZIGZAG ARROW
++U+021B0           ↰            \Lsh                                         UPWARDS ARROW WITH TIP LEFTWARDS / UP ARROW WITH TIP LEFT
++U+021B1           ↱            \Rsh                                         UPWARDS ARROW WITH TIP RIGHTWARDS / UP ARROW WITH TIP RIGHT
++U+021B2           ↲            \Ldsh                                        DOWNWARDS ARROW WITH TIP LEFTWARDS / DOWN ARROW WITH TIP LEFT
++U+021B3           ↳            \Rdsh                                        DOWNWARDS ARROW WITH TIP RIGHTWARDS / DOWN ARROW WITH TIP RIGHT
++U+021B4           ↴            \linefeed                                    RIGHTWARDS ARROW WITH CORNER DOWNWARDS / RIGHT ARROW WITH CORNER DOWN
++U+021B5           ↵            \carriagereturn                              DOWNWARDS ARROW WITH CORNER LEFTWARDS / DOWN ARROW WITH CORNER LEFT
++U+021B6           ↶            \curvearrowleft                              ANTICLOCKWISE TOP SEMICIRCLE ARROW
++U+021B7           ↷            \curvearrowright                             CLOCKWISE TOP SEMICIRCLE ARROW
++U+021B8           ↸            \barovernorthwestarrow                       NORTH WEST ARROW TO LONG BAR / UPPER LEFT ARROW TO LONG BAR
++U+021B9           ↹            \barleftarrowrightarrowbar                   LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR / LEFT ARROW TO BAR OVER RIGHT ARROW TO BAR
++U+021BA           ↺            \circlearrowleft                             ANTICLOCKWISE OPEN CIRCLE ARROW
++U+021BB           ↻            \circlearrowright                            CLOCKWISE OPEN CIRCLE ARROW
++U+021BC           ↼            \leftharpoonup                               LEFTWARDS HARPOON WITH BARB UPWARDS / LEFT HARPOON WITH BARB UP
++U+021BD           ↽            \leftharpoondown                             LEFTWARDS HARPOON WITH BARB DOWNWARDS / LEFT HARPOON WITH BARB DOWN
++U+021BE           ↾            \upharpoonright                              UPWARDS HARPOON WITH BARB RIGHTWARDS / UP HARPOON WITH BARB RIGHT
++U+021BF           ↿            \upharpoonleft                               UPWARDS HARPOON WITH BARB LEFTWARDS / UP HARPOON WITH BARB LEFT
++U+021C0           ⇀            \rightharpoonup                              RIGHTWARDS HARPOON WITH BARB UPWARDS / RIGHT HARPOON WITH BARB UP
++U+021C1           ⇁            \rightharpoondown                            RIGHTWARDS HARPOON WITH BARB DOWNWARDS / RIGHT HARPOON WITH BARB DOWN
++U+021C2           ⇂            \downharpoonright                            DOWNWARDS HARPOON WITH BARB RIGHTWARDS / DOWN HARPOON WITH BARB RIGHT
++U+021C3           ⇃            \downharpoonleft                             DOWNWARDS HARPOON WITH BARB LEFTWARDS / DOWN HARPOON WITH BARB LEFT
++U+021C4           ⇄            \rightleftarrows                             RIGHTWARDS ARROW OVER LEFTWARDS ARROW / RIGHT ARROW OVER LEFT ARROW
++U+021C5           ⇅            \dblarrowupdown                              UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW / UP ARROW LEFT OF DOWN ARROW
++U+021C6           ⇆            \leftrightarrows                             LEFTWARDS ARROW OVER RIGHTWARDS ARROW / LEFT ARROW OVER RIGHT ARROW
++U+021C7           ⇇            \leftleftarrows                              LEFTWARDS PAIRED ARROWS / LEFT PAIRED ARROWS
++U+021C8           ⇈            \upuparrows                                  UPWARDS PAIRED ARROWS / UP PAIRED ARROWS
++U+021C9           ⇉            \rightrightarrows                            RIGHTWARDS PAIRED ARROWS / RIGHT PAIRED ARROWS
++U+021CA           ⇊            \downdownarrows                              DOWNWARDS PAIRED ARROWS / DOWN PAIRED ARROWS
++U+021CB           ⇋            \leftrightharpoons                           LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON / LEFT HARPOON OVER RIGHT HARPOON
++U+021CC           ⇌            \rightleftharpoons                           RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON / RIGHT HARPOON OVER LEFT HARPOON
++U+021CD           ⇍            \nLeftarrow                                  LEFTWARDS DOUBLE ARROW WITH STROKE / LEFT DOUBLE ARROW WITH STROKE
++U+021CE           ⇎            \nLeftrightarrow                             LEFT RIGHT DOUBLE ARROW WITH STROKE
++U+021CF           ⇏            \nRightarrow                                 RIGHTWARDS DOUBLE ARROW WITH STROKE / RIGHT DOUBLE ARROW WITH STROKE
++U+021D0           ⇐            \Leftarrow                                   LEFTWARDS DOUBLE ARROW / LEFT DOUBLE ARROW
++U+021D1           ⇑            \Uparrow                                     UPWARDS DOUBLE ARROW / UP DOUBLE ARROW
++U+021D2           ⇒            \Rightarrow                                  RIGHTWARDS DOUBLE ARROW / RIGHT DOUBLE ARROW
++U+021D3           ⇓            \Downarrow                                   DOWNWARDS DOUBLE ARROW / DOWN DOUBLE ARROW
++U+021D4           ⇔            \Leftrightarrow                              LEFT RIGHT DOUBLE ARROW
++U+021D5           ⇕            \Updownarrow                                 UP DOWN DOUBLE ARROW
++U+021D6           ⇖            \Nwarrow                                     NORTH WEST DOUBLE ARROW / UPPER LEFT DOUBLE ARROW
++U+021D7           ⇗            \Nearrow                                     NORTH EAST DOUBLE ARROW / UPPER RIGHT DOUBLE ARROW
++U+021D8           ⇘            \Searrow                                     SOUTH EAST DOUBLE ARROW / LOWER RIGHT DOUBLE ARROW
++U+021D9           ⇙            \Swarrow                                     SOUTH WEST DOUBLE ARROW / LOWER LEFT DOUBLE ARROW
++U+021DA           ⇚            \Lleftarrow                                  LEFTWARDS TRIPLE ARROW / LEFT TRIPLE ARROW
++U+021DB           ⇛            \Rrightarrow                                 RIGHTWARDS TRIPLE ARROW / RIGHT TRIPLE ARROW
++U+021DC           ⇜            \leftsquigarrow                              LEFTWARDS SQUIGGLE ARROW / LEFT SQUIGGLE ARROW
++U+021DD           ⇝            \rightsquigarrow                             RIGHTWARDS SQUIGGLE ARROW / RIGHT SQUIGGLE ARROW
++U+021DE           ⇞            \nHuparrow                                   UPWARDS ARROW WITH DOUBLE STROKE / UP ARROW WITH DOUBLE STROKE
++U+021DF           ⇟            \nHdownarrow                                 DOWNWARDS ARROW WITH DOUBLE STROKE / DOWN ARROW WITH DOUBLE STROKE
++U+021E0           ⇠            \leftdasharrow                               LEFTWARDS DASHED ARROW / LEFT DASHED ARROW
++U+021E1           ⇡            \updasharrow                                 UPWARDS DASHED ARROW / UP DASHED ARROW
++U+021E2           ⇢            \rightdasharrow                              RIGHTWARDS DASHED ARROW / RIGHT DASHED ARROW
++U+021E3           ⇣            \downdasharrow                               DOWNWARDS DASHED ARROW / DOWN DASHED ARROW
++U+021E4           ⇤            \barleftarrow                                LEFTWARDS ARROW TO BAR / LEFT ARROW TO BAR
++U+021E5           ⇥            \rightarrowbar                               RIGHTWARDS ARROW TO BAR / RIGHT ARROW TO BAR
++U+021E6           ⇦            \leftwhitearrow                              LEFTWARDS WHITE ARROW / WHITE LEFT ARROW
++U+021E7           ⇧            \upwhitearrow                                UPWARDS WHITE ARROW / WHITE UP ARROW
++U+021E8           ⇨            \rightwhitearrow                             RIGHTWARDS WHITE ARROW / WHITE RIGHT ARROW
++U+021E9           ⇩            \downwhitearrow                              DOWNWARDS WHITE ARROW / WHITE DOWN ARROW
++U+021EA           ⇪            \whitearrowupfrombar                         UPWARDS WHITE ARROW FROM BAR / WHITE UP ARROW FROM BAR
++U+021F4           ⇴            \circleonrightarrow                          RIGHT ARROW WITH SMALL CIRCLE
++U+021F5           ⇵            \DownArrowUpArrow                            DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
++U+021F6           ⇶            \rightthreearrows                            THREE RIGHTWARDS ARROWS
++U+021F7           ⇷            \nvleftarrow                                 LEFTWARDS ARROW WITH VERTICAL STROKE
++U+021F8           ⇸            \nvrightarrow                                RIGHTWARDS ARROW WITH VERTICAL STROKE
++U+021F9           ⇹            \nvleftrightarrow                            LEFT RIGHT ARROW WITH VERTICAL STROKE
++U+021FA           ⇺            \nVleftarrow                                 LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
++U+021FB           ⇻            \nVrightarrow                                RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
++U+021FC           ⇼            \nVleftrightarrow                            LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE
++U+021FD           ⇽            \leftarrowtriangle                           LEFTWARDS OPEN-HEADED ARROW
++U+021FE           ⇾            \rightarrowtriangle                          RIGHTWARDS OPEN-HEADED ARROW
++U+021FF           ⇿            \leftrightarrowtriangle                      LEFT RIGHT OPEN-HEADED ARROW
++U+02200           ∀            \forall                                      FOR ALL
++U+02201           ∁            \complement                                  COMPLEMENT
++U+02202           ∂            \partial                                     PARTIAL DIFFERENTIAL
++U+02203           ∃            \exists                                      THERE EXISTS
++U+02204           ∄            \nexists                                     THERE DOES NOT EXIST
++U+02205           ∅            \varnothing, \emptyset                       EMPTY SET
++U+02206           ∆            \increment                                   INCREMENT
++U+02207           ∇            \del, \nabla                                 NABLA
++U+02208           ∈            \in                                          ELEMENT OF
++U+02209           ∉            \notin                                       NOT AN ELEMENT OF
++U+0220A           ∊            \smallin                                     SMALL ELEMENT OF
++U+0220B           ∋            \ni                                          CONTAINS AS MEMBER
++U+0220C           ∌            \nni                                         DOES NOT CONTAIN AS MEMBER
++U+0220D           ∍            \smallni                                     SMALL CONTAINS AS MEMBER
++U+0220E           ∎            \QED                                         END OF PROOF
++U+0220F           ∏            \prod                                        N-ARY PRODUCT
++U+02210           ∐            \coprod                                      N-ARY COPRODUCT
++U+02211           ∑            \sum                                         N-ARY SUMMATION
++U+02212           −            \minus                                       MINUS SIGN
++U+02213           ∓            \mp                                          MINUS-OR-PLUS SIGN
++U+02214           ∔            \dotplus                                     DOT PLUS
++U+02216           ∖            \setminus                                    SET MINUS
++U+02217           ∗            \ast                                         ASTERISK OPERATOR
++U+02218           ∘            \circ                                        RING OPERATOR
++U+02219           ∙            \vysmblkcircle                               BULLET OPERATOR
++U+0221A           √            \surd, \sqrt                                 SQUARE ROOT
++U+0221B           ∛            \cbrt                                        CUBE ROOT
++U+0221C           ∜            \fourthroot                                  FOURTH ROOT
++U+0221D           ∝            \propto                                      PROPORTIONAL TO
++U+0221E           ∞            \infty                                       INFINITY
++U+0221F           ∟            \rightangle                                  RIGHT ANGLE
++U+02220           ∠            \angle                                       ANGLE
++U+02221           ∡            \measuredangle                               MEASURED ANGLE
++U+02222           ∢            \sphericalangle                              SPHERICAL ANGLE
++U+02223           ∣            \mid                                         DIVIDES
++U+02224           ∤            \nmid                                        DOES NOT DIVIDE
++U+02225           ∥            \parallel                                    PARALLEL TO
++U+02226           ∦            \nparallel                                   NOT PARALLEL TO
++U+02227           ∧            \wedge                                       LOGICAL AND
++U+02228           ∨            \vee                                         LOGICAL OR
++U+02229           ∩            \cap                                         INTERSECTION
++U+0222A           ∪            \cup                                         UNION
++U+0222B           ∫            \int                                         INTEGRAL
++U+0222C           ∬            \iint                                        DOUBLE INTEGRAL
++U+0222D           ∭            \iiint                                       TRIPLE INTEGRAL
++U+0222E           ∮            \oint                                        CONTOUR INTEGRAL
++U+0222F           ∯            \oiint                                       SURFACE INTEGRAL
++U+02230           ∰            \oiiint                                      VOLUME INTEGRAL
++U+02231           ∱            \clwintegral                                 CLOCKWISE INTEGRAL
++U+02232           ∲            \varointclockwise                            CLOCKWISE CONTOUR INTEGRAL
++U+02233           ∳            \ointctrclockwise                            ANTICLOCKWISE CONTOUR INTEGRAL
++U+02234           ∴            \therefore                                   THEREFORE
++U+02235           ∵            \because                                     BECAUSE
++U+02237           ∷            \Colon                                       PROPORTION
++U+02238           ∸            \dotminus                                    DOT MINUS
++U+0223A           ∺            \dotsminusdots                               GEOMETRIC PROPORTION
++U+0223B           ∻            \kernelcontraction                           HOMOTHETIC
++U+0223C           ∼            \sim                                         TILDE OPERATOR
++U+0223D           ∽            \backsim                                     REVERSED TILDE
++U+0223E           ∾            \lazysinv                                    INVERTED LAZY S
++U+0223F           ∿            \sinewave                                    SINE WAVE
++U+02240           ≀            \wr                                          WREATH PRODUCT
++U+02241           ≁            \nsim                                        NOT TILDE
++U+02242           ≂            \eqsim                                       MINUS TILDE
++U+02242 + U+00338 ≂̸           \neqsim                                      MINUS TILDE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02243           ≃            \simeq                                       ASYMPTOTICALLY EQUAL TO
++U+02244           ≄            \nsime                                       NOT ASYMPTOTICALLY EQUAL TO
++U+02245           ≅            \cong                                        APPROXIMATELY EQUAL TO
++U+02246           ≆            \approxnotequal                              APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
++U+02247           ≇            \ncong                                       NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
++U+02248           ≈            \approx                                      ALMOST EQUAL TO
++U+02249           ≉            \napprox                                     NOT ALMOST EQUAL TO
++U+0224A           ≊            \approxeq                                    ALMOST EQUAL OR EQUAL TO
++U+0224B           ≋            \tildetrpl                                   TRIPLE TILDE
++U+0224C           ≌            \allequal                                    ALL EQUAL TO
++U+0224D           ≍            \asymp                                       EQUIVALENT TO
++U+0224E           ≎            \Bumpeq                                      GEOMETRICALLY EQUIVALENT TO
++U+0224E + U+00338 ≎̸           \nBumpeq                                     GEOMETRICALLY EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+0224F           ≏            \bumpeq                                      DIFFERENCE BETWEEN
++U+0224F + U+00338 ≏̸           \nbumpeq                                     DIFFERENCE BETWEEN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02250           ≐            \doteq                                       APPROACHES THE LIMIT
++U+02251           ≑            \Doteq                                       GEOMETRICALLY EQUAL TO
++U+02252           ≒            \fallingdotseq                               APPROXIMATELY EQUAL TO OR THE IMAGE OF
++U+02253           ≓            \risingdotseq                                IMAGE OF OR APPROXIMATELY EQUAL TO
++U+02254           ≔            \coloneq                                     COLON EQUALS / COLON EQUAL
++U+02255           ≕            \eqcolon                                     EQUALS COLON / EQUAL COLON
++U+02256           ≖            \eqcirc                                      RING IN EQUAL TO
++U+02257           ≗            \circeq                                      RING EQUAL TO
++U+02258           ≘            \arceq                                       CORRESPONDS TO
++U+02259           ≙            \wedgeq                                      ESTIMATES
++U+0225A           ≚            \veeeq                                       EQUIANGULAR TO
++U+0225B           ≛            \starequal                                   STAR EQUALS
++U+0225C           ≜            \triangleq                                   DELTA EQUAL TO
++U+0225D           ≝            \eqdef                                       EQUAL TO BY DEFINITION
++U+0225E           ≞            \measeq                                      MEASURED BY
++U+0225F           ≟            \questeq                                     QUESTIONED EQUAL TO
++U+02260           ≠            \ne                                          NOT EQUAL TO
++U+02261           ≡            \equiv                                       IDENTICAL TO
++U+02262           ≢            \nequiv                                      NOT IDENTICAL TO
++U+02263           ≣            \Equiv                                       STRICTLY EQUIVALENT TO
++U+02264           ≤            \le, \leq                                    LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
++U+02265           ≥            \ge, \geq                                    GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
++U+02266           ≦            \leqq                                        LESS-THAN OVER EQUAL TO / LESS THAN OVER EQUAL TO
++U+02267           ≧            \geqq                                        GREATER-THAN OVER EQUAL TO / GREATER THAN OVER EQUAL TO
++U+02268           ≨            \lneqq                                       LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO
++U+02268 + U+0FE00 ≨︀           \lvertneqq                                   LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
++U+02269           ≩            \gneqq                                       GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO
++U+02269 + U+0FE00 ≩︀           \gvertneqq                                   GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
++U+0226A           ≪            \ll                                          MUCH LESS-THAN / MUCH LESS THAN
++U+0226A + U+00338 ≪̸           \NotLessLess                                 MUCH LESS-THAN / MUCH LESS THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+0226B           ≫            \gg                                          MUCH GREATER-THAN / MUCH GREATER THAN
++U+0226B + U+00338 ≫̸           \NotGreaterGreater                           MUCH GREATER-THAN / MUCH GREATER THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+0226C           ≬            \between                                     BETWEEN
++U+0226D           ≭            \nasymp                                      NOT EQUIVALENT TO
++U+0226E           ≮            \nless                                       NOT LESS-THAN / NOT LESS THAN
++U+0226F           ≯            \ngtr                                        NOT GREATER-THAN / NOT GREATER THAN
++U+02270           ≰            \nleq                                        NEITHER LESS-THAN NOR EQUAL TO / NEITHER LESS THAN NOR EQUAL TO
++U+02271           ≱            \ngeq                                        NEITHER GREATER-THAN NOR EQUAL TO / NEITHER GREATER THAN NOR EQUAL TO
++U+02272           ≲            \lesssim                                     LESS-THAN OR EQUIVALENT TO / LESS THAN OR EQUIVALENT TO
++U+02273           ≳            \gtrsim                                      GREATER-THAN OR EQUIVALENT TO / GREATER THAN OR EQUIVALENT TO
++U+02274           ≴            \nlesssim                                    NEITHER LESS-THAN NOR EQUIVALENT TO / NEITHER LESS THAN NOR EQUIVALENT TO
++U+02275           ≵            \ngtrsim                                     NEITHER GREATER-THAN NOR EQUIVALENT TO / NEITHER GREATER THAN NOR EQUIVALENT TO
++U+02276           ≶            \lessgtr                                     LESS-THAN OR GREATER-THAN / LESS THAN OR GREATER THAN
++U+02277           ≷            \gtrless                                     GREATER-THAN OR LESS-THAN / GREATER THAN OR LESS THAN
++U+02278           ≸            \notlessgreater                              NEITHER LESS-THAN NOR GREATER-THAN / NEITHER LESS THAN NOR GREATER THAN
++U+02279           ≹            \notgreaterless                              NEITHER GREATER-THAN NOR LESS-THAN / NEITHER GREATER THAN NOR LESS THAN
++U+0227A           ≺            \prec                                        PRECEDES
++U+0227B           ≻            \succ                                        SUCCEEDS
++U+0227C           ≼            \preccurlyeq                                 PRECEDES OR EQUAL TO
++U+0227D           ≽            \succcurlyeq                                 SUCCEEDS OR EQUAL TO
++U+0227E           ≾            \precsim                                     PRECEDES OR EQUIVALENT TO
++U+0227E + U+00338 ≾̸           \nprecsim                                    PRECEDES OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+0227F           ≿            \succsim                                     SUCCEEDS OR EQUIVALENT TO
++U+0227F + U+00338 ≿̸           \nsuccsim                                    SUCCEEDS OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02280           ⊀            \nprec                                       DOES NOT PRECEDE
++U+02281           ⊁            \nsucc                                       DOES NOT SUCCEED
++U+02282           ⊂            \subset                                      SUBSET OF
++U+02283           ⊃            \supset                                      SUPERSET OF
++U+02284           ⊄            \nsubset                                     NOT A SUBSET OF
++U+02285           ⊅            \nsupset                                     NOT A SUPERSET OF
++U+02286           ⊆            \subseteq                                    SUBSET OF OR EQUAL TO
++U+02287           ⊇            \supseteq                                    SUPERSET OF OR EQUAL TO
++U+02288           ⊈            \nsubseteq                                   NEITHER A SUBSET OF NOR EQUAL TO
++U+02289           ⊉            \nsupseteq                                   NEITHER A SUPERSET OF NOR EQUAL TO
++U+0228A           ⊊            \subsetneq                                   SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO
++U+0228A + U+0FE00 ⊊︀           \varsubsetneqq                               SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
++U+0228B           ⊋            \supsetneq                                   SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO
++U+0228B + U+0FE00 ⊋︀           \varsupsetneq                                SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
++U+0228D           ⊍            \cupdot                                      MULTISET MULTIPLICATION
++U+0228E           ⊎            \uplus                                       MULTISET UNION
++U+0228F           ⊏            \sqsubset                                    SQUARE IMAGE OF
++U+0228F + U+00338 ⊏̸           \NotSquareSubset                             SQUARE IMAGE OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02290           ⊐            \sqsupset                                    SQUARE ORIGINAL OF
++U+02290 + U+00338 ⊐̸           \NotSquareSuperset                           SQUARE ORIGINAL OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02291           ⊑            \sqsubseteq                                  SQUARE IMAGE OF OR EQUAL TO
++U+02292           ⊒            \sqsupseteq                                  SQUARE ORIGINAL OF OR EQUAL TO
++U+02293           ⊓            \sqcap                                       SQUARE CAP
++U+02294           ⊔            \sqcup                                       SQUARE CUP
++U+02295           ⊕            \oplus                                       CIRCLED PLUS
++U+02296           ⊖            \ominus                                      CIRCLED MINUS
++U+02297           ⊗            \otimes                                      CIRCLED TIMES
++U+02298           ⊘            \oslash                                      CIRCLED DIVISION SLASH
++U+02299           ⊙            \odot                                        CIRCLED DOT OPERATOR
++U+0229A           ⊚            \circledcirc                                 CIRCLED RING OPERATOR
++U+0229B           ⊛            \circledast                                  CIRCLED ASTERISK OPERATOR
++U+0229C           ⊜            \circledequal                                CIRCLED EQUALS
++U+0229D           ⊝            \circleddash                                 CIRCLED DASH
++U+0229E           ⊞            \boxplus                                     SQUARED PLUS
++U+0229F           ⊟            \boxminus                                    SQUARED MINUS
++U+022A0           ⊠            \boxtimes                                    SQUARED TIMES
++U+022A1           ⊡            \boxdot                                      SQUARED DOT OPERATOR
++U+022A2           ⊢            \vdash                                       RIGHT TACK
++U+022A3           ⊣            \dashv                                       LEFT TACK
++U+022A4           ⊤            \top                                         DOWN TACK
++U+022A5           ⊥            \bot                                         UP TACK
++U+022A7           ⊧            \models                                      MODELS
++U+022A8           ⊨            \vDash                                       TRUE
++U+022A9           ⊩            \Vdash                                       FORCES
++U+022AA           ⊪            \Vvdash                                      TRIPLE VERTICAL BAR RIGHT TURNSTILE
++U+022AB           ⊫            \VDash                                       DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
++U+022AC           ⊬            \nvdash                                      DOES NOT PROVE
++U+022AD           ⊭            \nvDash                                      NOT TRUE
++U+022AE           ⊮            \nVdash                                      DOES NOT FORCE
++U+022AF           ⊯            \nVDash                                      NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
++U+022B0           ⊰            \prurel                                      PRECEDES UNDER RELATION
++U+022B1           ⊱            \scurel                                      SUCCEEDS UNDER RELATION
++U+022B2           ⊲            \vartriangleleft                             NORMAL SUBGROUP OF
++U+022B3           ⊳            \vartriangleright                            CONTAINS AS NORMAL SUBGROUP
++U+022B4           ⊴            \trianglelefteq                              NORMAL SUBGROUP OF OR EQUAL TO
++U+022B5           ⊵            \trianglerighteq                             CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
++U+022B6           ⊶            \original                                    ORIGINAL OF
++U+022B7           ⊷            \image                                       IMAGE OF
++U+022B8           ⊸            \multimap                                    MULTIMAP
++U+022B9           ⊹            \hermitconjmatrix                            HERMITIAN CONJUGATE MATRIX
++U+022BA           ⊺            \intercal                                    INTERCALATE
++U+022BB           ⊻            \veebar, \xor                                XOR
++U+022BC           ⊼            \barwedge                                    NAND
++U+022BD           ⊽            \barvee                                      NOR
++U+022BE           ⊾            \rightanglearc                               RIGHT ANGLE WITH ARC
++U+022BF           ⊿            \varlrtriangle                               RIGHT TRIANGLE
++U+022C0           ⋀            \bigwedge                                    N-ARY LOGICAL AND
++U+022C1           ⋁            \bigvee                                      N-ARY LOGICAL OR
++U+022C2           ⋂            \bigcap                                      N-ARY INTERSECTION
++U+022C3           ⋃            \bigcup                                      N-ARY UNION
++U+022C4           ⋄            \diamond                                     DIAMOND OPERATOR
++U+022C5           ⋅            \cdot                                        DOT OPERATOR
++U+022C6           ⋆            \star                                        STAR OPERATOR
++U+022C7           ⋇            \divideontimes                               DIVISION TIMES
++U+022C8           ⋈            \bowtie                                      BOWTIE
++U+022C9           ⋉            \ltimes                                      LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
++U+022CA           ⋊            \rtimes                                      RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
++U+022CB           ⋋            \leftthreetimes                              LEFT SEMIDIRECT PRODUCT
++U+022CC           ⋌            \rightthreetimes                             RIGHT SEMIDIRECT PRODUCT
++U+022CD           ⋍            \backsimeq                                   REVERSED TILDE EQUALS
++U+022CE           ⋎            \curlyvee                                    CURLY LOGICAL OR
++U+022CF           ⋏            \curlywedge                                  CURLY LOGICAL AND
++U+022D0           ⋐            \Subset                                      DOUBLE SUBSET
++U+022D1           ⋑            \Supset                                      DOUBLE SUPERSET
++U+022D2           ⋒            \Cap                                         DOUBLE INTERSECTION
++U+022D3           ⋓            \Cup                                         DOUBLE UNION
++U+022D4           ⋔            \pitchfork                                   PITCHFORK
++U+022D5           ⋕            \equalparallel                               EQUAL AND PARALLEL TO
++U+022D6           ⋖            \lessdot                                     LESS-THAN WITH DOT / LESS THAN WITH DOT
++U+022D7           ⋗            \gtrdot                                      GREATER-THAN WITH DOT / GREATER THAN WITH DOT
++U+022D8           ⋘            \verymuchless                                VERY MUCH LESS-THAN / VERY MUCH LESS THAN
++U+022D9           ⋙            \ggg                                         VERY MUCH GREATER-THAN / VERY MUCH GREATER THAN
++U+022DA           ⋚            \lesseqgtr                                   LESS-THAN EQUAL TO OR GREATER-THAN / LESS THAN EQUAL TO OR GREATER THAN
++U+022DB           ⋛            \gtreqless                                   GREATER-THAN EQUAL TO OR LESS-THAN / GREATER THAN EQUAL TO OR LESS THAN
++U+022DC           ⋜            \eqless                                      EQUAL TO OR LESS-THAN / EQUAL TO OR LESS THAN
++U+022DD           ⋝            \eqgtr                                       EQUAL TO OR GREATER-THAN / EQUAL TO OR GREATER THAN
++U+022DE           ⋞            \curlyeqprec                                 EQUAL TO OR PRECEDES
++U+022DF           ⋟            \curlyeqsucc                                 EQUAL TO OR SUCCEEDS
++U+022E0           ⋠            \npreccurlyeq                                DOES NOT PRECEDE OR EQUAL
++U+022E1           ⋡            \nsucccurlyeq                                DOES NOT SUCCEED OR EQUAL
++U+022E2           ⋢            \nsqsubseteq                                 NOT SQUARE IMAGE OF OR EQUAL TO
++U+022E3           ⋣            \nsqsupseteq                                 NOT SQUARE ORIGINAL OF OR EQUAL TO
++U+022E4           ⋤            \sqsubsetneq                                 SQUARE IMAGE OF OR NOT EQUAL TO
++U+022E5           ⋥            \sqspne                                      SQUARE ORIGINAL OF OR NOT EQUAL TO
++U+022E6           ⋦            \lnsim                                       LESS-THAN BUT NOT EQUIVALENT TO / LESS THAN BUT NOT EQUIVALENT TO
++U+022E7           ⋧            \gnsim                                       GREATER-THAN BUT NOT EQUIVALENT TO / GREATER THAN BUT NOT EQUIVALENT TO
++U+022E8           ⋨            \precnsim                                    PRECEDES BUT NOT EQUIVALENT TO
++U+022E9           ⋩            \succnsim                                    SUCCEEDS BUT NOT EQUIVALENT TO
++U+022EA           ⋪            \ntriangleleft                               NOT NORMAL SUBGROUP OF
++U+022EB           ⋫            \ntriangleright                              DOES NOT CONTAIN AS NORMAL SUBGROUP
++U+022EC           ⋬            \ntrianglelefteq                             NOT NORMAL SUBGROUP OF OR EQUAL TO
++U+022ED           ⋭            \ntrianglerighteq                            DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
++U+022EE           ⋮            \vdots                                       VERTICAL ELLIPSIS
++U+022EF           ⋯            \cdots                                       MIDLINE HORIZONTAL ELLIPSIS
++U+022F0           ⋰            \adots                                       UP RIGHT DIAGONAL ELLIPSIS
++U+022F1           ⋱            \ddots                                       DOWN RIGHT DIAGONAL ELLIPSIS
++U+022F2           ⋲            \disin                                       ELEMENT OF WITH LONG HORIZONTAL STROKE
++U+022F3           ⋳            \varisins                                    ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++U+022F4           ⋴            \isins                                       SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++U+022F5           ⋵            \isindot                                     ELEMENT OF WITH DOT ABOVE
++U+022F6           ⋶            \varisinobar                                 ELEMENT OF WITH OVERBAR
++U+022F7           ⋷            \isinobar                                    SMALL ELEMENT OF WITH OVERBAR
++U+022F8           ⋸            \isinvb                                      ELEMENT OF WITH UNDERBAR
++U+022F9           ⋹            \isinE                                       ELEMENT OF WITH TWO HORIZONTAL STROKES
++U+022FA           ⋺            \nisd                                        CONTAINS WITH LONG HORIZONTAL STROKE
++U+022FB           ⋻            \varnis                                      CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++U+022FC           ⋼            \nis                                         SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++U+022FD           ⋽            \varniobar                                   CONTAINS WITH OVERBAR
++U+022FE           ⋾            \niobar                                      SMALL CONTAINS WITH OVERBAR
++U+022FF           ⋿            \bagmember                                   Z NOTATION BAG MEMBERSHIP
++U+02300           ⌀            \diameter                                    DIAMETER SIGN
++U+02302           ⌂            \house                                       HOUSE
++U+02305           ⌅            \varbarwedge                                 PROJECTIVE
++U+02306           ⌆            \vardoublebarwedge                           PERSPECTIVE
++U+02308           ⌈            \lceil                                       LEFT CEILING
++U+02309           ⌉            \rceil                                       RIGHT CEILING
++U+0230A           ⌊            \lfloor                                      LEFT FLOOR
++U+0230B           ⌋            \rfloor                                      RIGHT FLOOR
++U+02310           ⌐            \invnot                                      REVERSED NOT SIGN
++U+02311           ⌑            \sqlozenge                                   SQUARE LOZENGE
++U+02312           ⌒            \profline                                    ARC
++U+02313           ⌓            \profsurf                                    SEGMENT
++U+02315           ⌕            \recorder                                    TELEPHONE RECORDER
++U+02317           ⌗            \viewdata                                    VIEWDATA SQUARE
++U+02319           ⌙            \turnednot                                   TURNED NOT SIGN
++U+0231A           ⌚            \:watch:                                     WATCH
++U+0231B           ⌛            \:hourglass:                                 HOURGLASS
++U+0231C           ⌜            \ulcorner                                    TOP LEFT CORNER
++U+0231D           ⌝            \urcorner                                    TOP RIGHT CORNER
++U+0231E           ⌞            \llcorner                                    BOTTOM LEFT CORNER
++U+0231F           ⌟            \lrcorner                                    BOTTOM RIGHT CORNER
++U+02322           ⌢            \frown                                       FROWN
++U+02323           ⌣            \smile                                       SMILE
++U+0232C           ⌬            \varhexagonlrbonds                           BENZENE RING
++U+02332           ⌲            \conictaper                                  CONICAL TAPER
++U+02336           ⌶            \topbot                                      APL FUNCTIONAL SYMBOL I-BEAM
++U+0233D           ⌽            \obar                                        APL FUNCTIONAL SYMBOL CIRCLE STILE
++U+0233F           ⌿            \notslash                                    APL FUNCTIONAL SYMBOL SLASH BAR
++U+02340           ⍀            \notbackslash                                APL FUNCTIONAL SYMBOL BACKSLASH BAR
++U+02353           ⍓            \boxupcaret                                  APL FUNCTIONAL SYMBOL QUAD UP CARET
++U+02370           ⍰            \boxquestion                                 APL FUNCTIONAL SYMBOL QUAD QUESTION
++U+02394           ⎔            \hexagon                                     SOFTWARE-FUNCTION SYMBOL
++U+023A3           ⎣            \dlcorn                                      LEFT SQUARE BRACKET LOWER CORNER
++U+023B0           ⎰            \lmoustache                                  UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION
++U+023B1           ⎱            \rmoustache                                  UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION
++U+023B4           ⎴            \overbracket                                 TOP SQUARE BRACKET
++U+023B5           ⎵            \underbracket                                BOTTOM SQUARE BRACKET
++U+023B6           ⎶            \bbrktbrk                                    BOTTOM SQUARE BRACKET OVER TOP SQUARE BRACKET
++U+023B7           ⎷            \sqrtbottom                                  RADICAL SYMBOL BOTTOM
++U+023B8           ⎸            \lvboxline                                   LEFT VERTICAL BOX LINE
++U+023B9           ⎹            \rvboxline                                   RIGHT VERTICAL BOX LINE
++U+023CE           ⏎            \varcarriagereturn                           RETURN SYMBOL
++U+023DE           ⏞            \overbrace                                   TOP CURLY BRACKET
++U+023DF           ⏟            \underbrace                                  BOTTOM CURLY BRACKET
++U+023E2           ⏢            \trapezium                                   WHITE TRAPEZIUM
++U+023E3           ⏣            \benzenr                                     BENZENE RING WITH CIRCLE
++U+023E4           ⏤            \strns                                       STRAIGHTNESS
++U+023E5           ⏥            \fltns                                       FLATNESS
++U+023E6           ⏦            \accurrent                                   AC CURRENT
++U+023E7           ⏧            \elinters                                    ELECTRICAL INTERSECTION
++U+023E9           ⏩            \:fast_forward:                              BLACK RIGHT-POINTING DOUBLE TRIANGLE
++U+023EA           ⏪            \:rewind:                                    BLACK LEFT-POINTING DOUBLE TRIANGLE
++U+023EB           ⏫            \:arrow_double_up:                           BLACK UP-POINTING DOUBLE TRIANGLE
++U+023EC           ⏬            \:arrow_double_down:                         BLACK DOWN-POINTING DOUBLE TRIANGLE
++U+023F0           ⏰            \:alarm_clock:                               ALARM CLOCK
++U+023F3           ⏳            \:hourglass_flowing_sand:                    HOURGLASS WITH FLOWING SAND
++U+02422           ␢            \blanksymbol                                 BLANK SYMBOL / BLANK
++U+02423           ␣            \visiblespace                                OPEN BOX
++U+024C2           Ⓜ            \:m:                                         CIRCLED LATIN CAPITAL LETTER M
++U+024C8           Ⓢ            \circledS                                    CIRCLED LATIN CAPITAL LETTER S
++U+02506           ┆            \dshfnc                                      BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL / FORMS LIGHT TRIPLE DASH VERTICAL
++U+02519           ┙            \sqfnw                                       BOX DRAWINGS UP LIGHT AND LEFT HEAVY / FORMS UP LIGHT AND LEFT HEAVY
++U+02571           ╱            \diagup                                      BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT / FORMS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
++U+02572           ╲            \diagdown                                    BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT / FORMS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
++U+02580           ▀            \blockuphalf                                 UPPER HALF BLOCK
++U+02584           ▄            \blocklowhalf                                LOWER HALF BLOCK
++U+02588           █            \blockfull                                   FULL BLOCK
++U+0258C           ▌            \blocklefthalf                               LEFT HALF BLOCK
++U+02590           ▐            \blockrighthalf                              RIGHT HALF BLOCK
++U+02591           ░            \blockqtrshaded                              LIGHT SHADE
++U+02592           ▒            \blockhalfshaded                             MEDIUM SHADE
++U+02593           ▓            \blockthreeqtrshaded                         DARK SHADE
++U+025A0           ■            \blacksquare                                 BLACK SQUARE
++U+025A1           □            \square                                      WHITE SQUARE
++U+025A2           ▢            \squoval                                     WHITE SQUARE WITH ROUNDED CORNERS
++U+025A3           ▣            \blackinwhitesquare                          WHITE SQUARE CONTAINING BLACK SMALL SQUARE
++U+025A4           ▤            \squarehfill                                 SQUARE WITH HORIZONTAL FILL
++U+025A5           ▥            \squarevfill                                 SQUARE WITH VERTICAL FILL
++U+025A6           ▦            \squarehvfill                                SQUARE WITH ORTHOGONAL CROSSHATCH FILL
++U+025A7           ▧            \squarenwsefill                              SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL
++U+025A8           ▨            \squareneswfill                              SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL
++U+025A9           ▩            \squarecrossfill                             SQUARE WITH DIAGONAL CROSSHATCH FILL
++U+025AA           ▪            \smblksquare, \:black_small_square:          BLACK SMALL SQUARE
++U+025AB           ▫            \smwhtsquare, \:white_small_square:          WHITE SMALL SQUARE
++U+025AC           ▬            \hrectangleblack                             BLACK RECTANGLE
++U+025AD           ▭            \hrectangle                                  WHITE RECTANGLE
++U+025AE           ▮            \vrectangleblack                             BLACK VERTICAL RECTANGLE
++U+025AF           ▯            \vrecto                                      WHITE VERTICAL RECTANGLE
++U+025B0           ▰            \parallelogramblack                          BLACK PARALLELOGRAM
++U+025B1           ▱            \parallelogram                               WHITE PARALLELOGRAM
++U+025B2           ▲            \bigblacktriangleup                          BLACK UP-POINTING TRIANGLE / BLACK UP POINTING TRIANGLE
++U+025B3           △            \bigtriangleup                               WHITE UP-POINTING TRIANGLE / WHITE UP POINTING TRIANGLE
++U+025B4           ▴            \blacktriangle                               BLACK UP-POINTING SMALL TRIANGLE / BLACK UP POINTING SMALL TRIANGLE
++U+025B5           ▵            \vartriangle                                 WHITE UP-POINTING SMALL TRIANGLE / WHITE UP POINTING SMALL TRIANGLE
++U+025B6           ▶            \blacktriangleright, \:arrow_forward:        BLACK RIGHT-POINTING TRIANGLE / BLACK RIGHT POINTING TRIANGLE
++U+025B7           ▷            \triangleright                               WHITE RIGHT-POINTING TRIANGLE / WHITE RIGHT POINTING TRIANGLE
++U+025B8           ▸            \smallblacktriangleright                     BLACK RIGHT-POINTING SMALL TRIANGLE / BLACK RIGHT POINTING SMALL TRIANGLE
++U+025B9           ▹            \smalltriangleright                          WHITE RIGHT-POINTING SMALL TRIANGLE / WHITE RIGHT POINTING SMALL TRIANGLE
++U+025BA           ►            \blackpointerright                           BLACK RIGHT-POINTING POINTER / BLACK RIGHT POINTING POINTER
++U+025BB           ▻            \whitepointerright                           WHITE RIGHT-POINTING POINTER / WHITE RIGHT POINTING POINTER
++U+025BC           ▼            \bigblacktriangledown                        BLACK DOWN-POINTING TRIANGLE / BLACK DOWN POINTING TRIANGLE
++U+025BD           ▽            \bigtriangledown                             WHITE DOWN-POINTING TRIANGLE / WHITE DOWN POINTING TRIANGLE
++U+025BE           ▾            \blacktriangledown                           BLACK DOWN-POINTING SMALL TRIANGLE / BLACK DOWN POINTING SMALL TRIANGLE
++U+025BF           ▿            \triangledown                                WHITE DOWN-POINTING SMALL TRIANGLE / WHITE DOWN POINTING SMALL TRIANGLE
++U+025C0           ◀            \blacktriangleleft, \:arrow_backward:        BLACK LEFT-POINTING TRIANGLE / BLACK LEFT POINTING TRIANGLE
++U+025C1           ◁            \triangleleft                                WHITE LEFT-POINTING TRIANGLE / WHITE LEFT POINTING TRIANGLE
++U+025C2           ◂            \smallblacktriangleleft                      BLACK LEFT-POINTING SMALL TRIANGLE / BLACK LEFT POINTING SMALL TRIANGLE
++U+025C3           ◃            \smalltriangleleft                           WHITE LEFT-POINTING SMALL TRIANGLE / WHITE LEFT POINTING SMALL TRIANGLE
++U+025C4           ◄            \blackpointerleft                            BLACK LEFT-POINTING POINTER / BLACK LEFT POINTING POINTER
++U+025C5           ◅            \whitepointerleft                            WHITE LEFT-POINTING POINTER / WHITE LEFT POINTING POINTER
++U+025C6           ◆            \mdlgblkdiamond                              BLACK DIAMOND
++U+025C7           ◇            \mdlgwhtdiamond                              WHITE DIAMOND
++U+025C8           ◈            \blackinwhitediamond                         WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND
++U+025C9           ◉            \fisheye                                     FISHEYE
++U+025CA           ◊            \lozenge                                     LOZENGE
++U+025CB           ○            \bigcirc                                     WHITE CIRCLE
++U+025CC           ◌            \dottedcircle                                DOTTED CIRCLE
++U+025CD           ◍            \circlevertfill                              CIRCLE WITH VERTICAL FILL
++U+025CE           ◎            \bullseye                                    BULLSEYE
++U+025CF           ●            \mdlgblkcircle                               BLACK CIRCLE
++U+025D0           ◐            \cirfl                                       CIRCLE WITH LEFT HALF BLACK
++U+025D1           ◑            \cirfr                                       CIRCLE WITH RIGHT HALF BLACK
++U+025D2           ◒            \cirfb                                       CIRCLE WITH LOWER HALF BLACK
++U+025D3           ◓            \circletophalfblack                          CIRCLE WITH UPPER HALF BLACK
++U+025D4           ◔            \circleurquadblack                           CIRCLE WITH UPPER RIGHT QUADRANT BLACK
++U+025D5           ◕            \blackcircleulquadwhite                      CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK
++U+025D6           ◖            \blacklefthalfcircle                         LEFT HALF BLACK CIRCLE
++U+025D7           ◗            \blackrighthalfcircle                        RIGHT HALF BLACK CIRCLE
++U+025D8           ◘            \rvbull                                      INVERSE BULLET
++U+025D9           ◙            \inversewhitecircle                          INVERSE WHITE CIRCLE
++U+025DA           ◚            \invwhiteupperhalfcircle                     UPPER HALF INVERSE WHITE CIRCLE
++U+025DB           ◛            \invwhitelowerhalfcircle                     LOWER HALF INVERSE WHITE CIRCLE
++U+025DC           ◜            \ularc                                       UPPER LEFT QUADRANT CIRCULAR ARC
++U+025DD           ◝            \urarc                                       UPPER RIGHT QUADRANT CIRCULAR ARC
++U+025DE           ◞            \lrarc                                       LOWER RIGHT QUADRANT CIRCULAR ARC
++U+025DF           ◟            \llarc                                       LOWER LEFT QUADRANT CIRCULAR ARC
++U+025E0           ◠            \topsemicircle                               UPPER HALF CIRCLE
++U+025E1           ◡            \botsemicircle                               LOWER HALF CIRCLE
++U+025E2           ◢            \lrblacktriangle                             BLACK LOWER RIGHT TRIANGLE
++U+025E3           ◣            \llblacktriangle                             BLACK LOWER LEFT TRIANGLE
++U+025E4           ◤            \ulblacktriangle                             BLACK UPPER LEFT TRIANGLE
++U+025E5           ◥            \urblacktriangle                             BLACK UPPER RIGHT TRIANGLE
++U+025E6           ◦            \smwhtcircle                                 WHITE BULLET
++U+025E7           ◧            \sqfl                                        SQUARE WITH LEFT HALF BLACK
++U+025E8           ◨            \sqfr                                        SQUARE WITH RIGHT HALF BLACK
++U+025E9           ◩            \squareulblack                               SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK
++U+025EA           ◪            \sqfse                                       SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK
++U+025EB           ◫            \boxbar                                      WHITE SQUARE WITH VERTICAL BISECTING LINE
++U+025EC           ◬            \trianglecdot                                WHITE UP-POINTING TRIANGLE WITH DOT / WHITE UP POINTING TRIANGLE WITH DOT
++U+025ED           ◭            \triangleleftblack                           UP-POINTING TRIANGLE WITH LEFT HALF BLACK / UP POINTING TRIANGLE WITH LEFT HALF BLACK
++U+025EE           ◮            \trianglerightblack                          UP-POINTING TRIANGLE WITH RIGHT HALF BLACK / UP POINTING TRIANGLE WITH RIGHT HALF BLACK
++U+025EF           ◯            \lgwhtcircle                                 LARGE CIRCLE
++U+025F0           ◰            \squareulquad                                WHITE SQUARE WITH UPPER LEFT QUADRANT
++U+025F1           ◱            \squarellquad                                WHITE SQUARE WITH LOWER LEFT QUADRANT
++U+025F2           ◲            \squarelrquad                                WHITE SQUARE WITH LOWER RIGHT QUADRANT
++U+025F3           ◳            \squareurquad                                WHITE SQUARE WITH UPPER RIGHT QUADRANT
++U+025F4           ◴            \circleulquad                                WHITE CIRCLE WITH UPPER LEFT QUADRANT
++U+025F5           ◵            \circlellquad                                WHITE CIRCLE WITH LOWER LEFT QUADRANT
++U+025F6           ◶            \circlelrquad                                WHITE CIRCLE WITH LOWER RIGHT QUADRANT
++U+025F7           ◷            \circleurquad                                WHITE CIRCLE WITH UPPER RIGHT QUADRANT
++U+025F8           ◸            \ultriangle                                  UPPER LEFT TRIANGLE
++U+025F9           ◹            \urtriangle                                  UPPER RIGHT TRIANGLE
++U+025FA           ◺            \lltriangle                                  LOWER LEFT TRIANGLE
++U+025FB           ◻            \mdwhtsquare, \:white_medium_square:         WHITE MEDIUM SQUARE
++U+025FC           ◼            \mdblksquare, \:black_medium_square:         BLACK MEDIUM SQUARE
++U+025FD           ◽            \mdsmwhtsquare, \:white_medium_small_square: WHITE MEDIUM SMALL SQUARE
++U+025FE           ◾            \mdsmblksquare, \:black_medium_small_square: BLACK MEDIUM SMALL SQUARE
++U+025FF           ◿            \lrtriangle                                  LOWER RIGHT TRIANGLE
++U+02600           ☀            \:sunny:                                     BLACK SUN WITH RAYS
++U+02601           ☁            \:cloud:                                     CLOUD
++U+02605           ★            \bigstar                                     BLACK STAR
++U+02606           ☆            \bigwhitestar                                WHITE STAR
++U+02609           ☉            \astrosun                                    SUN
++U+0260E           ☎            \:phone:                                     BLACK TELEPHONE
++U+02611           ☑            \:ballot_box_with_check:                     BALLOT BOX WITH CHECK
++U+02614           ☔            \:umbrella:                                  UMBRELLA WITH RAIN DROPS
++U+02615           ☕            \:coffee:                                    HOT BEVERAGE
++U+0261D           ☝            \:point_up:                                  WHITE UP POINTING INDEX
++U+02621           ☡            \danger                                      CAUTION SIGN
++U+0263A           ☺            \:relaxed:                                   WHITE SMILING FACE
++U+0263B           ☻            \blacksmiley                                 BLACK SMILING FACE
++U+0263C           ☼            \sun                                         WHITE SUN WITH RAYS
++U+0263D           ☽            \rightmoon                                   FIRST QUARTER MOON
++U+0263E           ☾            \leftmoon                                    LAST QUARTER MOON
++U+0263F           ☿            \mercury                                     MERCURY
++U+02640           ♀            \venus, \female                              FEMALE SIGN
++U+02642           ♂            \male, \mars                                 MALE SIGN
++U+02643           ♃            \jupiter                                     JUPITER
++U+02644           ♄            \saturn                                      SATURN
++U+02645           ♅            \uranus                                      URANUS
++U+02646           ♆            \neptune                                     NEPTUNE
++U+02647           ♇            \pluto                                       PLUTO
++U+02648           ♈            \aries, \:aries:                             ARIES
++U+02649           ♉            \taurus, \:taurus:                           TAURUS
++U+0264A           ♊            \gemini, \:gemini:                           GEMINI
++U+0264B           ♋            \cancer, \:cancer:                           CANCER
++U+0264C           ♌            \leo, \:leo:                                 LEO
++U+0264D           ♍            \virgo, \:virgo:                             VIRGO
++U+0264E           ♎            \libra, \:libra:                             LIBRA
++U+0264F           ♏            \scorpio, \:scorpius:                        SCORPIUS
++U+02650           ♐            \sagittarius, \:sagittarius:                 SAGITTARIUS
++U+02651           ♑            \capricornus, \:capricorn:                   CAPRICORN
++U+02652           ♒            \aquarius, \:aquarius:                       AQUARIUS
++U+02653           ♓            \pisces, \:pisces:                           PISCES
++U+02660           ♠            \spadesuit, \:spades:                        BLACK SPADE SUIT
++U+02661           ♡            \heartsuit                                   WHITE HEART SUIT
++U+02662           ♢            \diamondsuit                                 WHITE DIAMOND SUIT
++U+02663           ♣            \clubsuit, \:clubs:                          BLACK CLUB SUIT
++U+02664           ♤            \varspadesuit                                WHITE SPADE SUIT
++U+02665           ♥            \varheartsuit, \:hearts:                     BLACK HEART SUIT
++U+02666           ♦            \vardiamondsuit, \:diamonds:                 BLACK DIAMOND SUIT
++U+02667           ♧            \varclubsuit                                 WHITE CLUB SUIT
++U+02668           ♨            \:hotsprings:                                HOT SPRINGS
++U+02669           ♩            \quarternote                                 QUARTER NOTE
++U+0266A           ♪            \eighthnote                                  EIGHTH NOTE
++U+0266B           ♫            \twonotes                                    BEAMED EIGHTH NOTES / BARRED EIGHTH NOTES
++U+0266D           ♭            \flat                                        MUSIC FLAT SIGN / FLAT
++U+0266E           ♮            \natural                                     MUSIC NATURAL SIGN / NATURAL
++U+0266F           ♯            \sharp                                       MUSIC SHARP SIGN / SHARP
++U+0267B           ♻            \:recycle:                                   BLACK UNIVERSAL RECYCLING SYMBOL
++U+0267E           ♾            \acidfree                                    PERMANENT PAPER SIGN
++U+0267F           ♿            \:wheelchair:                                WHEELCHAIR SYMBOL
++U+02680           ⚀            \dicei                                       DIE FACE-1
++U+02681           ⚁            \diceii                                      DIE FACE-2
++U+02682           ⚂            \diceiii                                     DIE FACE-3
++U+02683           ⚃            \diceiv                                      DIE FACE-4
++U+02684           ⚄            \dicev                                       DIE FACE-5
++U+02685           ⚅            \dicevi                                      DIE FACE-6
++U+02686           ⚆            \circledrightdot                             WHITE CIRCLE WITH DOT RIGHT
++U+02687           ⚇            \circledtwodots                              WHITE CIRCLE WITH TWO DOTS
++U+02688           ⚈            \blackcircledrightdot                        BLACK CIRCLE WITH WHITE DOT RIGHT
++U+02689           ⚉            \blackcircledtwodots                         BLACK CIRCLE WITH TWO WHITE DOTS
++U+02693           ⚓            \:anchor:                                    ANCHOR
++U+026A0           ⚠            \:warning:                                   WARNING SIGN
++U+026A1           ⚡            \:zap:                                       HIGH VOLTAGE SIGN
++U+026A5           ⚥            \hermaphrodite                               MALE AND FEMALE SIGN
++U+026AA           ⚪            \mdwhtcircle, \:white_circle:                MEDIUM WHITE CIRCLE
++U+026AB           ⚫            \mdblkcircle, \:black_circle:                MEDIUM BLACK CIRCLE
++U+026AC           ⚬            \mdsmwhtcircle                               MEDIUM SMALL WHITE CIRCLE
++U+026B2           ⚲            \neuter                                      NEUTER
++U+026BD           ⚽            \:soccer:                                    SOCCER BALL
++U+026BE           ⚾            \:baseball:                                  BASEBALL
++U+026C4           ⛄            \:snowman:                                   SNOWMAN WITHOUT SNOW
++U+026C5           ⛅            \:partly_sunny:                              SUN BEHIND CLOUD
++U+026CE           ⛎            \:ophiuchus:                                 OPHIUCHUS
++U+026D4           ⛔            \:no_entry:                                  NO ENTRY
++U+026EA           ⛪            \:church:                                    CHURCH
++U+026F2           ⛲            \:fountain:                                  FOUNTAIN
++U+026F3           ⛳            \:golf:                                      FLAG IN HOLE
++U+026F5           ⛵            \:boat:                                      SAILBOAT
++U+026FA           ⛺            \:tent:                                      TENT
++U+026FD           ⛽            \:fuelpump:                                  FUEL PUMP
++U+02702           ✂            \:scissors:                                  BLACK SCISSORS
++U+02705           ✅            \:white_check_mark:                          WHITE HEAVY CHECK MARK
++U+02708           ✈            \:airplane:                                  AIRPLANE
++U+02709           ✉            \:email:                                     ENVELOPE
++U+0270A           ✊            \:fist:                                      RAISED FIST
++U+0270B           ✋            \:hand:                                      RAISED HAND
++U+0270C           ✌            \:v:                                         VICTORY HAND
++U+0270F           ✏            \:pencil2:                                   PENCIL
++U+02712           ✒            \:black_nib:                                 BLACK NIB
++U+02713           ✓            \checkmark                                   CHECK MARK
++U+02714           ✔            \:heavy_check_mark:                          HEAVY CHECK MARK
++U+02716           ✖            \:heavy_multiplication_x:                    HEAVY MULTIPLICATION X
++U+02720           ✠            \maltese                                     MALTESE CROSS
++U+02728           ✨            \:sparkles:                                  SPARKLES
++U+0272A           ✪            \circledstar                                 CIRCLED WHITE STAR
++U+02733           ✳            \:eight_spoked_asterisk:                     EIGHT SPOKED ASTERISK
++U+02734           ✴            \:eight_pointed_black_star:                  EIGHT POINTED BLACK STAR
++U+02736           ✶            \varstar                                     SIX POINTED BLACK STAR
++U+0273D           ✽            \dingasterisk                                HEAVY TEARDROP-SPOKED ASTERISK
++U+02744           ❄            \:snowflake:                                 SNOWFLAKE
++U+02747           ❇            \:sparkle:                                   SPARKLE
++U+0274C           ❌            \:x:                                         CROSS MARK
++U+0274E           ❎            \:negative_squared_cross_mark:               NEGATIVE SQUARED CROSS MARK
++U+02753           ❓            \:question:                                  BLACK QUESTION MARK ORNAMENT
++U+02754           ❔            \:grey_question:                             WHITE QUESTION MARK ORNAMENT
++U+02755           ❕            \:grey_exclamation:                          WHITE EXCLAMATION MARK ORNAMENT
++U+02757           ❗            \:exclamation:                               HEAVY EXCLAMATION MARK SYMBOL
++U+02764           ❤            \:heart:                                     HEAVY BLACK HEART
++U+02795           ➕            \:heavy_plus_sign:                           HEAVY PLUS SIGN
++U+02796           ➖            \:heavy_minus_sign:                          HEAVY MINUS SIGN
++U+02797           ➗            \:heavy_division_sign:                       HEAVY DIVISION SIGN
++U+0279B           ➛            \draftingarrow                               DRAFTING POINT RIGHTWARDS ARROW / DRAFTING POINT RIGHT ARROW
++U+027A1           ➡            \:arrow_right:                               BLACK RIGHTWARDS ARROW / BLACK RIGHT ARROW
++U+027B0           ➰            \:curly_loop:                                CURLY LOOP
++U+027BF           ➿            \:loop:                                      DOUBLE CURLY LOOP
++U+027C0           ⟀            \threedangle                                 THREE DIMENSIONAL ANGLE
++U+027C1           ⟁            \whiteinwhitetriangle                        WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE
++U+027C2           ⟂            \perp                                        PERPENDICULAR
++U+027C8           ⟈            \bsolhsub                                    REVERSE SOLIDUS PRECEDING SUBSET
++U+027C9           ⟉            \suphsol                                     SUPERSET PRECEDING SOLIDUS
++U+027D1           ⟑            \wedgedot                                    AND WITH DOT
++U+027D2           ⟒            \upin                                        ELEMENT OF OPENING UPWARDS
++U+027D5           ⟕            \leftouterjoin                               LEFT OUTER JOIN
++U+027D6           ⟖            \rightouterjoin                              RIGHT OUTER JOIN
++U+027D7           ⟗            \fullouterjoin                               FULL OUTER JOIN
++U+027D8           ⟘            \bigbot                                      LARGE UP TACK
++U+027D9           ⟙            \bigtop                                      LARGE DOWN TACK
++U+027E6           ⟦            \llbracket, \openbracketleft                 MATHEMATICAL LEFT WHITE SQUARE BRACKET
++U+027E7           ⟧            \openbracketright, \rrbracket                MATHEMATICAL RIGHT WHITE SQUARE BRACKET
++U+027E8           ⟨            \langle                                      MATHEMATICAL LEFT ANGLE BRACKET
++U+027E9           ⟩            \rangle                                      MATHEMATICAL RIGHT ANGLE BRACKET
++U+027F0           ⟰            \UUparrow                                    UPWARDS QUADRUPLE ARROW
++U+027F1           ⟱            \DDownarrow                                  DOWNWARDS QUADRUPLE ARROW
++U+027F5           ⟵            \longleftarrow                               LONG LEFTWARDS ARROW
++U+027F6           ⟶            \longrightarrow                              LONG RIGHTWARDS ARROW
++U+027F7           ⟷            \longleftrightarrow                          LONG LEFT RIGHT ARROW
++U+027F8           ⟸            \impliedby, \Longleftarrow                   LONG LEFTWARDS DOUBLE ARROW
++U+027F9           ⟹            \implies, \Longrightarrow                    LONG RIGHTWARDS DOUBLE ARROW
++U+027FA           ⟺            \Longleftrightarrow, \iff                    LONG LEFT RIGHT DOUBLE ARROW
++U+027FB           ⟻            \longmapsfrom                                LONG LEFTWARDS ARROW FROM BAR
++U+027FC           ⟼            \longmapsto                                  LONG RIGHTWARDS ARROW FROM BAR
++U+027FD           ⟽            \Longmapsfrom                                LONG LEFTWARDS DOUBLE ARROW FROM BAR
++U+027FE           ⟾            \Longmapsto                                  LONG RIGHTWARDS DOUBLE ARROW FROM BAR
++U+027FF           ⟿            \longrightsquigarrow                         LONG RIGHTWARDS SQUIGGLE ARROW
++U+02900           ⤀            \nvtwoheadrightarrow                         RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
++U+02901           ⤁            \nVtwoheadrightarrow                         RIGHTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
++U+02902           ⤂            \nvLeftarrow                                 LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE
++U+02903           ⤃            \nvRightarrow                                RIGHTWARDS DOUBLE ARROW WITH VERTICAL STROKE
++U+02904           ⤄            \nvLeftrightarrow                            LEFT RIGHT DOUBLE ARROW WITH VERTICAL STROKE
++U+02905           ⤅            \twoheadmapsto                               RIGHTWARDS TWO-HEADED ARROW FROM BAR
++U+02906           ⤆            \Mapsfrom                                    LEFTWARDS DOUBLE ARROW FROM BAR
++U+02907           ⤇            \Mapsto                                      RIGHTWARDS DOUBLE ARROW FROM BAR
++U+02908           ⤈            \downarrowbarred                             DOWNWARDS ARROW WITH HORIZONTAL STROKE
++U+02909           ⤉            \uparrowbarred                               UPWARDS ARROW WITH HORIZONTAL STROKE
++U+0290A           ⤊            \Uuparrow                                    UPWARDS TRIPLE ARROW
++U+0290B           ⤋            \Ddownarrow                                  DOWNWARDS TRIPLE ARROW
++U+0290C           ⤌            \leftbkarrow                                 LEFTWARDS DOUBLE DASH ARROW
++U+0290D           ⤍            \bkarow                                      RIGHTWARDS DOUBLE DASH ARROW
++U+0290E           ⤎            \leftdbkarrow                                LEFTWARDS TRIPLE DASH ARROW
++U+0290F           ⤏            \dbkarow                                     RIGHTWARDS TRIPLE DASH ARROW
++U+02910           ⤐            \drbkarrow                                   RIGHTWARDS TWO-HEADED TRIPLE DASH ARROW
++U+02911           ⤑            \rightdotarrow                               RIGHTWARDS ARROW WITH DOTTED STEM
++U+02912           ⤒            \UpArrowBar                                  UPWARDS ARROW TO BAR
++U+02913           ⤓            \DownArrowBar                                DOWNWARDS ARROW TO BAR
++U+02914           ⤔            \nvrightarrowtail                            RIGHTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
++U+02915           ⤕            \nVrightarrowtail                            RIGHTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++U+02916           ⤖            \twoheadrightarrowtail                       RIGHTWARDS TWO-HEADED ARROW WITH TAIL
++U+02917           ⤗            \nvtwoheadrightarrowtail                     RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
++U+02918           ⤘            \nVtwoheadrightarrowtail                     RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++U+0291D           ⤝            \diamondleftarrow                            LEFTWARDS ARROW TO BLACK DIAMOND
++U+0291E           ⤞            \rightarrowdiamond                           RIGHTWARDS ARROW TO BLACK DIAMOND
++U+0291F           ⤟            \diamondleftarrowbar                         LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND
++U+02920           ⤠            \barrightarrowdiamond                        RIGHTWARDS ARROW FROM BAR TO BLACK DIAMOND
++U+02925           ⤥            \hksearow                                    SOUTH EAST ARROW WITH HOOK
++U+02926           ⤦            \hkswarow                                    SOUTH WEST ARROW WITH HOOK
++U+02927           ⤧            \tona                                        NORTH WEST ARROW AND NORTH EAST ARROW
++U+02928           ⤨            \toea                                        NORTH EAST ARROW AND SOUTH EAST ARROW
++U+02929           ⤩            \tosa                                        SOUTH EAST ARROW AND SOUTH WEST ARROW
++U+0292A           ⤪            \towa                                        SOUTH WEST ARROW AND NORTH WEST ARROW
++U+0292B           ⤫            \rdiagovfdiag                                RISING DIAGONAL CROSSING FALLING DIAGONAL
++U+0292C           ⤬            \fdiagovrdiag                                FALLING DIAGONAL CROSSING RISING DIAGONAL
++U+0292D           ⤭            \seovnearrow                                 SOUTH EAST ARROW CROSSING NORTH EAST ARROW
++U+0292E           ⤮            \neovsearrow                                 NORTH EAST ARROW CROSSING SOUTH EAST ARROW
++U+0292F           ⤯            \fdiagovnearrow                              FALLING DIAGONAL CROSSING NORTH EAST ARROW
++U+02930           ⤰            \rdiagovsearrow                              RISING DIAGONAL CROSSING SOUTH EAST ARROW
++U+02931           ⤱            \neovnwarrow                                 NORTH EAST ARROW CROSSING NORTH WEST ARROW
++U+02932           ⤲            \nwovnearrow                                 NORTH WEST ARROW CROSSING NORTH EAST ARROW
++U+02934           ⤴            \:arrow_heading_up:                          ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS
++U+02935           ⤵            \:arrow_heading_down:                        ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS
++U+02942           ⥂            \Rlarr                                       RIGHTWARDS ARROW ABOVE SHORT LEFTWARDS ARROW
++U+02944           ⥄            \rLarr                                       SHORT RIGHTWARDS ARROW ABOVE LEFTWARDS ARROW
++U+02945           ⥅            \rightarrowplus                              RIGHTWARDS ARROW WITH PLUS BELOW
++U+02946           ⥆            \leftarrowplus                               LEFTWARDS ARROW WITH PLUS BELOW
++U+02947           ⥇            \rarrx                                       RIGHTWARDS ARROW THROUGH X
++U+02948           ⥈            \leftrightarrowcircle                        LEFT RIGHT ARROW THROUGH SMALL CIRCLE
++U+02949           ⥉            \twoheaduparrowcircle                        UPWARDS TWO-HEADED ARROW FROM SMALL CIRCLE
++U+0294A           ⥊            \leftrightharpoonupdown                      LEFT BARB UP RIGHT BARB DOWN HARPOON
++U+0294B           ⥋            \leftrightharpoondownup                      LEFT BARB DOWN RIGHT BARB UP HARPOON
++U+0294C           ⥌            \updownharpoonrightleft                      UP BARB RIGHT DOWN BARB LEFT HARPOON
++U+0294D           ⥍            \updownharpoonleftright                      UP BARB LEFT DOWN BARB RIGHT HARPOON
++U+0294E           ⥎            \LeftRightVector                             LEFT BARB UP RIGHT BARB UP HARPOON
++U+0294F           ⥏            \RightUpDownVector                           UP BARB RIGHT DOWN BARB RIGHT HARPOON
++U+02950           ⥐            \DownLeftRightVector                         LEFT BARB DOWN RIGHT BARB DOWN HARPOON
++U+02951           ⥑            \LeftUpDownVector                            UP BARB LEFT DOWN BARB LEFT HARPOON
++U+02952           ⥒            \LeftVectorBar                               LEFTWARDS HARPOON WITH BARB UP TO BAR
++U+02953           ⥓            \RightVectorBar                              RIGHTWARDS HARPOON WITH BARB UP TO BAR
++U+02954           ⥔            \RightUpVectorBar                            UPWARDS HARPOON WITH BARB RIGHT TO BAR
++U+02955           ⥕            \RightDownVectorBar                          DOWNWARDS HARPOON WITH BARB RIGHT TO BAR
++U+02956           ⥖            \DownLeftVectorBar                           LEFTWARDS HARPOON WITH BARB DOWN TO BAR
++U+02957           ⥗            \DownRightVectorBar                          RIGHTWARDS HARPOON WITH BARB DOWN TO BAR
++U+02958           ⥘            \LeftUpVectorBar                             UPWARDS HARPOON WITH BARB LEFT TO BAR
++U+02959           ⥙            \LeftDownVectorBar                           DOWNWARDS HARPOON WITH BARB LEFT TO BAR
++U+0295A           ⥚            \LeftTeeVector                               LEFTWARDS HARPOON WITH BARB UP FROM BAR
++U+0295B           ⥛            \RightTeeVector                              RIGHTWARDS HARPOON WITH BARB UP FROM BAR
++U+0295C           ⥜            \RightUpTeeVector                            UPWARDS HARPOON WITH BARB RIGHT FROM BAR
++U+0295D           ⥝            \RightDownTeeVector                          DOWNWARDS HARPOON WITH BARB RIGHT FROM BAR
++U+0295E           ⥞            \DownLeftTeeVector                           LEFTWARDS HARPOON WITH BARB DOWN FROM BAR
++U+0295F           ⥟            \DownRightTeeVector                          RIGHTWARDS HARPOON WITH BARB DOWN FROM BAR
++U+02960           ⥠            \LeftUpTeeVector                             UPWARDS HARPOON WITH BARB LEFT FROM BAR
++U+02961           ⥡            \LeftDownTeeVector                           DOWNWARDS HARPOON WITH BARB LEFT FROM BAR
++U+02962           ⥢            \leftharpoonsupdown                          LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN
++U+02963           ⥣            \upharpoonsleftright                         UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
++U+02964           ⥤            \rightharpoonsupdown                         RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
++U+02965           ⥥            \downharpoonsleftright                       DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
++U+02966           ⥦            \leftrightharpoonsup                         LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB UP
++U+02967           ⥧            \leftrightharpoonsdown                       LEFTWARDS HARPOON WITH BARB DOWN ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
++U+02968           ⥨            \rightleftharpoonsup                         RIGHTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB UP
++U+02969           ⥩            \rightleftharpoonsdown                       RIGHTWARDS HARPOON WITH BARB DOWN ABOVE LEFTWARDS HARPOON WITH BARB DOWN
++U+0296A           ⥪            \leftharpoonupdash                           LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
++U+0296B           ⥫            \dashleftharpoondown                         LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
++U+0296C           ⥬            \rightharpoonupdash                          RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
++U+0296D           ⥭            \dashrightharpoondown                        RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
++U+0296E           ⥮            \UpEquilibrium                               UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
++U+0296F           ⥯            \ReverseUpEquilibrium                        DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
++U+02970           ⥰            \RoundImplies                                RIGHT DOUBLE ARROW WITH ROUNDED HEAD
++U+02980           ⦀            \Vvert                                       TRIPLE VERTICAL BAR DELIMITER
++U+02986           ⦆            \Elroang                                     RIGHT WHITE PARENTHESIS
++U+02999           ⦙            \ddfnc                                       DOTTED FENCE
++U+0299B           ⦛            \measuredangleleft                           MEASURED ANGLE OPENING LEFT
++U+0299C           ⦜            \Angle                                       RIGHT ANGLE VARIANT WITH SQUARE
++U+0299D           ⦝            \rightanglemdot                              MEASURED RIGHT ANGLE WITH DOT
++U+0299E           ⦞            \angles                                      ANGLE WITH S INSIDE
++U+0299F           ⦟            \angdnr                                      ACUTE ANGLE
++U+029A0           ⦠            \lpargt                                      SPHERICAL ANGLE OPENING LEFT
++U+029A1           ⦡            \sphericalangleup                            SPHERICAL ANGLE OPENING UP
++U+029A2           ⦢            \turnangle                                   TURNED ANGLE
++U+029A3           ⦣            \revangle                                    REVERSED ANGLE
++U+029A4           ⦤            \angleubar                                   ANGLE WITH UNDERBAR
++U+029A5           ⦥            \revangleubar                                REVERSED ANGLE WITH UNDERBAR
++U+029A6           ⦦            \wideangledown                               OBLIQUE ANGLE OPENING UP
++U+029A7           ⦧            \wideangleup                                 OBLIQUE ANGLE OPENING DOWN
++U+029A8           ⦨            \measanglerutone                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT
++U+029A9           ⦩            \measanglelutonw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND LEFT
++U+029AA           ⦪            \measanglerdtose                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT
++U+029AB           ⦫            \measangleldtosw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND LEFT
++U+029AC           ⦬            \measangleurtone                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP
++U+029AD           ⦭            \measangleultonw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND UP
++U+029AE           ⦮            \measangledrtose                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND DOWN
++U+029AF           ⦯            \measangledltosw                             MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND DOWN
++U+029B0           ⦰            \revemptyset                                 REVERSED EMPTY SET
++U+029B1           ⦱            \emptysetobar                                EMPTY SET WITH OVERBAR
++U+029B2           ⦲            \emptysetocirc                               EMPTY SET WITH SMALL CIRCLE ABOVE
++U+029B3           ⦳            \emptysetoarr                                EMPTY SET WITH RIGHT ARROW ABOVE
++U+029B4           ⦴            \emptysetoarrl                               EMPTY SET WITH LEFT ARROW ABOVE
++U+029B7           ⦷            \circledparallel                             CIRCLED PARALLEL
++U+029B8           ⦸            \obslash                                     CIRCLED REVERSE SOLIDUS
++U+029BC           ⦼            \odotslashdot                                CIRCLED ANTICLOCKWISE-ROTATED DIVISION SIGN
++U+029BE           ⦾            \circledwhitebullet                          CIRCLED WHITE BULLET
++U+029BF           ⦿            \circledbullet                               CIRCLED BULLET
++U+029C0           ⧀            \olessthan                                   CIRCLED LESS-THAN
++U+029C1           ⧁            \ogreaterthan                                CIRCLED GREATER-THAN
++U+029C4           ⧄            \boxdiag                                     SQUARED RISING DIAGONAL SLASH
++U+029C5           ⧅            \boxbslash                                   SQUARED FALLING DIAGONAL SLASH
++U+029C6           ⧆            \boxast                                      SQUARED ASTERISK
++U+029C7           ⧇            \boxcircle                                   SQUARED SMALL CIRCLE
++U+029CA           ⧊            \Lap                                         TRIANGLE WITH DOT ABOVE
++U+029CB           ⧋            \defas                                       TRIANGLE WITH UNDERBAR
++U+029CF           ⧏            \LeftTriangleBar                             LEFT TRIANGLE BESIDE VERTICAL BAR
++U+029CF + U+00338 ⧏̸           \NotLeftTriangleBar                          LEFT TRIANGLE BESIDE VERTICAL BAR + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+029D0           ⧐            \RightTriangleBar                            VERTICAL BAR BESIDE RIGHT TRIANGLE
++U+029D0 + U+00338 ⧐̸           \NotRightTriangleBar                         VERTICAL BAR BESIDE RIGHT TRIANGLE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+029DF           ⧟            \dualmap                                     DOUBLE-ENDED MULTIMAP
++U+029E1           ⧡            \lrtriangleeq                                INCREASES AS
++U+029E2           ⧢            \shuffle                                     SHUFFLE PRODUCT
++U+029E3           ⧣            \eparsl                                      EQUALS SIGN AND SLANTED PARALLEL
++U+029E4           ⧤            \smeparsl                                    EQUALS SIGN AND SLANTED PARALLEL WITH TILDE ABOVE
++U+029E5           ⧥            \eqvparsl                                    IDENTICAL TO AND SLANTED PARALLEL
++U+029EB           ⧫            \blacklozenge                                BLACK LOZENGE
++U+029F4           ⧴            \RuleDelayed                                 RULE-DELAYED
++U+029F6           ⧶            \dsol                                        SOLIDUS WITH OVERBAR
++U+029F7           ⧷            \rsolbar                                     REVERSE SOLIDUS WITH HORIZONTAL STROKE
++U+029FA           ⧺            \doubleplus                                  DOUBLE PLUS
++U+029FB           ⧻            \tripleplus                                  TRIPLE PLUS
++U+02A00           ⨀            \bigodot                                     N-ARY CIRCLED DOT OPERATOR
++U+02A01           ⨁            \bigoplus                                    N-ARY CIRCLED PLUS OPERATOR
++U+02A02           ⨂            \bigotimes                                   N-ARY CIRCLED TIMES OPERATOR
++U+02A03           ⨃            \bigcupdot                                   N-ARY UNION OPERATOR WITH DOT
++U+02A04           ⨄            \biguplus                                    N-ARY UNION OPERATOR WITH PLUS
++U+02A05           ⨅            \bigsqcap                                    N-ARY SQUARE INTERSECTION OPERATOR
++U+02A06           ⨆            \bigsqcup                                    N-ARY SQUARE UNION OPERATOR
++U+02A07           ⨇            \conjquant                                   TWO LOGICAL AND OPERATOR
++U+02A08           ⨈            \disjquant                                   TWO LOGICAL OR OPERATOR
++U+02A09           ⨉            \bigtimes                                    N-ARY TIMES OPERATOR
++U+02A0A           ⨊            \modtwosum                                   MODULO TWO SUM
++U+02A0B           ⨋            \sumint                                      SUMMATION WITH INTEGRAL
++U+02A0C           ⨌            \iiiint                                      QUADRUPLE INTEGRAL OPERATOR
++U+02A0D           ⨍            \intbar                                      FINITE PART INTEGRAL
++U+02A0E           ⨎            \intBar                                      INTEGRAL WITH DOUBLE STROKE
++U+02A0F           ⨏            \clockoint                                   INTEGRAL AVERAGE WITH SLASH
++U+02A10           ⨐            \cirfnint                                    CIRCULATION FUNCTION
++U+02A11           ⨑            \awint                                       ANTICLOCKWISE INTEGRATION
++U+02A12           ⨒            \rppolint                                    LINE INTEGRATION WITH RECTANGULAR PATH AROUND POLE
++U+02A13           ⨓            \scpolint                                    LINE INTEGRATION WITH SEMICIRCULAR PATH AROUND POLE
++U+02A14           ⨔            \npolint                                     LINE INTEGRATION NOT INCLUDING THE POLE
++U+02A15           ⨕            \pointint                                    INTEGRAL AROUND A POINT OPERATOR
++U+02A16           ⨖            \sqrint                                      QUATERNION INTEGRAL OPERATOR
++U+02A18           ⨘            \intx                                        INTEGRAL WITH TIMES SIGN
++U+02A19           ⨙            \intcap                                      INTEGRAL WITH INTERSECTION
++U+02A1A           ⨚            \intcup                                      INTEGRAL WITH UNION
++U+02A1B           ⨛            \upint                                       INTEGRAL WITH OVERBAR
++U+02A1C           ⨜            \lowint                                      INTEGRAL WITH UNDERBAR
++U+02A1D           ⨝            \Join, \join                                 JOIN
++U+02A22           ⨢            \ringplus                                    PLUS SIGN WITH SMALL CIRCLE ABOVE
++U+02A23           ⨣            \plushat                                     PLUS SIGN WITH CIRCUMFLEX ACCENT ABOVE
++U+02A24           ⨤            \simplus                                     PLUS SIGN WITH TILDE ABOVE
++U+02A25           ⨥            \plusdot                                     PLUS SIGN WITH DOT BELOW
++U+02A26           ⨦            \plussim                                     PLUS SIGN WITH TILDE BELOW
++U+02A27           ⨧            \plussubtwo                                  PLUS SIGN WITH SUBSCRIPT TWO
++U+02A28           ⨨            \plustrif                                    PLUS SIGN WITH BLACK TRIANGLE
++U+02A29           ⨩            \commaminus                                  MINUS SIGN WITH COMMA ABOVE
++U+02A2A           ⨪            \minusdot                                    MINUS SIGN WITH DOT BELOW
++U+02A2B           ⨫            \minusfdots                                  MINUS SIGN WITH FALLING DOTS
++U+02A2C           ⨬            \minusrdots                                  MINUS SIGN WITH RISING DOTS
++U+02A2D           ⨭            \opluslhrim                                  PLUS SIGN IN LEFT HALF CIRCLE
++U+02A2E           ⨮            \oplusrhrim                                  PLUS SIGN IN RIGHT HALF CIRCLE
++U+02A2F           ⨯            \Times                                       VECTOR OR CROSS PRODUCT
++U+02A30           ⨰            \dottimes                                    MULTIPLICATION SIGN WITH DOT ABOVE
++U+02A31           ⨱            \timesbar                                    MULTIPLICATION SIGN WITH UNDERBAR
++U+02A32           ⨲            \btimes                                      SEMIDIRECT PRODUCT WITH BOTTOM CLOSED
++U+02A33           ⨳            \smashtimes                                  SMASH PRODUCT
++U+02A34           ⨴            \otimeslhrim                                 MULTIPLICATION SIGN IN LEFT HALF CIRCLE
++U+02A35           ⨵            \otimesrhrim                                 MULTIPLICATION SIGN IN RIGHT HALF CIRCLE
++U+02A36           ⨶            \otimeshat                                   CIRCLED MULTIPLICATION SIGN WITH CIRCUMFLEX ACCENT
++U+02A37           ⨷            \Otimes                                      MULTIPLICATION SIGN IN DOUBLE CIRCLE
++U+02A38           ⨸            \odiv                                        CIRCLED DIVISION SIGN
++U+02A39           ⨹            \triangleplus                                PLUS SIGN IN TRIANGLE
++U+02A3A           ⨺            \triangleminus                               MINUS SIGN IN TRIANGLE
++U+02A3B           ⨻            \triangletimes                               MULTIPLICATION SIGN IN TRIANGLE
++U+02A3C           ⨼            \intprod                                     INTERIOR PRODUCT
++U+02A3D           ⨽            \intprodr                                    RIGHTHAND INTERIOR PRODUCT
++U+02A3F           ⨿            \amalg                                       AMALGAMATION OR COPRODUCT
++U+02A40           ⩀            \capdot                                      INTERSECTION WITH DOT
++U+02A41           ⩁            \uminus                                      UNION WITH MINUS SIGN
++U+02A42           ⩂            \barcup                                      UNION WITH OVERBAR
++U+02A43           ⩃            \barcap                                      INTERSECTION WITH OVERBAR
++U+02A44           ⩄            \capwedge                                    INTERSECTION WITH LOGICAL AND
++U+02A45           ⩅            \cupvee                                      UNION WITH LOGICAL OR
++U+02A4A           ⩊            \twocups                                     UNION BESIDE AND JOINED WITH UNION
++U+02A4B           ⩋            \twocaps                                     INTERSECTION BESIDE AND JOINED WITH INTERSECTION
++U+02A4C           ⩌            \closedvarcup                                CLOSED UNION WITH SERIFS
++U+02A4D           ⩍            \closedvarcap                                CLOSED INTERSECTION WITH SERIFS
++U+02A4E           ⩎            \Sqcap                                       DOUBLE SQUARE INTERSECTION
++U+02A4F           ⩏            \Sqcup                                       DOUBLE SQUARE UNION
++U+02A50           ⩐            \closedvarcupsmashprod                       CLOSED UNION WITH SERIFS AND SMASH PRODUCT
++U+02A51           ⩑            \wedgeodot                                   LOGICAL AND WITH DOT ABOVE
++U+02A52           ⩒            \veeodot                                     LOGICAL OR WITH DOT ABOVE
++U+02A53           ⩓            \And                                         DOUBLE LOGICAL AND
++U+02A54           ⩔            \Or                                          DOUBLE LOGICAL OR
++U+02A55           ⩕            \wedgeonwedge                                TWO INTERSECTING LOGICAL AND
++U+02A56           ⩖            \ElOr                                        TWO INTERSECTING LOGICAL OR
++U+02A57           ⩗            \bigslopedvee                                SLOPING LARGE OR
++U+02A58           ⩘            \bigslopedwedge                              SLOPING LARGE AND
++U+02A5A           ⩚            \wedgemidvert                                LOGICAL AND WITH MIDDLE STEM
++U+02A5B           ⩛            \veemidvert                                  LOGICAL OR WITH MIDDLE STEM
++U+02A5C           ⩜            \midbarwedge                                 LOGICAL AND WITH HORIZONTAL DASH
++U+02A5D           ⩝            \midbarvee                                   LOGICAL OR WITH HORIZONTAL DASH
++U+02A5E           ⩞            \perspcorrespond                             LOGICAL AND WITH DOUBLE OVERBAR
++U+02A5F           ⩟            \minhat                                      LOGICAL AND WITH UNDERBAR
++U+02A60           ⩠            \wedgedoublebar                              LOGICAL AND WITH DOUBLE UNDERBAR
++U+02A61           ⩡            \varveebar                                   SMALL VEE WITH UNDERBAR
++U+02A62           ⩢            \doublebarvee                                LOGICAL OR WITH DOUBLE OVERBAR
++U+02A63           ⩣            \veedoublebar                                LOGICAL OR WITH DOUBLE UNDERBAR
++U+02A66           ⩦            \eqdot                                       EQUALS SIGN WITH DOT BELOW
++U+02A67           ⩧            \dotequiv                                    IDENTICAL WITH DOT ABOVE
++U+02A6A           ⩪            \dotsim                                      TILDE OPERATOR WITH DOT ABOVE
++U+02A6B           ⩫            \simrdots                                    TILDE OPERATOR WITH RISING DOTS
++U+02A6C           ⩬            \simminussim                                 SIMILAR MINUS SIMILAR
++U+02A6D           ⩭            \congdot                                     CONGRUENT WITH DOT ABOVE
++U+02A6E           ⩮            \asteq                                       EQUALS WITH ASTERISK
++U+02A6F           ⩯            \hatapprox                                   ALMOST EQUAL TO WITH CIRCUMFLEX ACCENT
++U+02A70           ⩰            \approxeqq                                   APPROXIMATELY EQUAL OR EQUAL TO
++U+02A71           ⩱            \eqqplus                                     EQUALS SIGN ABOVE PLUS SIGN
++U+02A72           ⩲            \pluseqq                                     PLUS SIGN ABOVE EQUALS SIGN
++U+02A73           ⩳            \eqqsim                                      EQUALS SIGN ABOVE TILDE OPERATOR
++U+02A74           ⩴            \Coloneq                                     DOUBLE COLON EQUAL
++U+02A75           ⩵            \Equal                                       TWO CONSECUTIVE EQUALS SIGNS
++U+02A76           ⩶            \eqeqeq                                      THREE CONSECUTIVE EQUALS SIGNS
++U+02A77           ⩷            \ddotseq                                     EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
++U+02A78           ⩸            \equivDD                                     EQUIVALENT WITH FOUR DOTS ABOVE
++U+02A79           ⩹            \ltcir                                       LESS-THAN WITH CIRCLE INSIDE
++U+02A7A           ⩺            \gtcir                                       GREATER-THAN WITH CIRCLE INSIDE
++U+02A7B           ⩻            \ltquest                                     LESS-THAN WITH QUESTION MARK ABOVE
++U+02A7C           ⩼            \gtquest                                     GREATER-THAN WITH QUESTION MARK ABOVE
++U+02A7D           ⩽            \leqslant                                    LESS-THAN OR SLANTED EQUAL TO
++U+02A7D + U+00338 ⩽̸           \nleqslant                                   LESS-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02A7E           ⩾            \geqslant                                    GREATER-THAN OR SLANTED EQUAL TO
++U+02A7E + U+00338 ⩾̸           \ngeqslant                                   GREATER-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02A7F           ⩿            \lesdot                                      LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
++U+02A80           ⪀            \gesdot                                      GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
++U+02A81           ⪁            \lesdoto                                     LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
++U+02A82           ⪂            \gesdoto                                     GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
++U+02A83           ⪃            \lesdotor                                    LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT
++U+02A84           ⪄            \gesdotol                                    GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT
++U+02A85           ⪅            \lessapprox                                  LESS-THAN OR APPROXIMATE
++U+02A86           ⪆            \gtrapprox                                   GREATER-THAN OR APPROXIMATE
++U+02A87           ⪇            \lneq                                        LESS-THAN AND SINGLE-LINE NOT EQUAL TO
++U+02A88           ⪈            \gneq                                        GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
++U+02A89           ⪉            \lnapprox                                    LESS-THAN AND NOT APPROXIMATE
++U+02A8A           ⪊            \gnapprox                                    GREATER-THAN AND NOT APPROXIMATE
++U+02A8B           ⪋            \lesseqqgtr                                  LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
++U+02A8C           ⪌            \gtreqqless                                  GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
++U+02A8D           ⪍            \lsime                                       LESS-THAN ABOVE SIMILAR OR EQUAL
++U+02A8E           ⪎            \gsime                                       GREATER-THAN ABOVE SIMILAR OR EQUAL
++U+02A8F           ⪏            \lsimg                                       LESS-THAN ABOVE SIMILAR ABOVE GREATER-THAN
++U+02A90           ⪐            \gsiml                                       GREATER-THAN ABOVE SIMILAR ABOVE LESS-THAN
++U+02A91           ⪑            \lgE                                         LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL
++U+02A92           ⪒            \glE                                         GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL
++U+02A93           ⪓            \lesges                                      LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL
++U+02A94           ⪔            \gesles                                      GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL
++U+02A95           ⪕            \eqslantless                                 SLANTED EQUAL TO OR LESS-THAN
++U+02A96           ⪖            \eqslantgtr                                  SLANTED EQUAL TO OR GREATER-THAN
++U+02A97           ⪗            \elsdot                                      SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE
++U+02A98           ⪘            \egsdot                                      SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE
++U+02A99           ⪙            \eqqless                                     DOUBLE-LINE EQUAL TO OR LESS-THAN
++U+02A9A           ⪚            \eqqgtr                                      DOUBLE-LINE EQUAL TO OR GREATER-THAN
++U+02A9B           ⪛            \eqqslantless                                DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN
++U+02A9C           ⪜            \eqqslantgtr                                 DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN
++U+02A9D           ⪝            \simless                                     SIMILAR OR LESS-THAN
++U+02A9E           ⪞            \simgtr                                      SIMILAR OR GREATER-THAN
++U+02A9F           ⪟            \simlE                                       SIMILAR ABOVE LESS-THAN ABOVE EQUALS SIGN
++U+02AA0           ⪠            \simgE                                       SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN
++U+02AA1           ⪡            \NestedLessLess                              DOUBLE NESTED LESS-THAN
++U+02AA1 + U+00338 ⪡̸           \NotNestedLessLess                           DOUBLE NESTED LESS-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02AA2           ⪢            \NestedGreaterGreater                        DOUBLE NESTED GREATER-THAN
++U+02AA2 + U+00338 ⪢̸           \NotNestedGreaterGreater                     DOUBLE NESTED GREATER-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02AA3           ⪣            \partialmeetcontraction                      DOUBLE NESTED LESS-THAN WITH UNDERBAR
++U+02AA4           ⪤            \glj                                         GREATER-THAN OVERLAPPING LESS-THAN
++U+02AA5           ⪥            \gla                                         GREATER-THAN BESIDE LESS-THAN
++U+02AA6           ⪦            \ltcc                                        LESS-THAN CLOSED BY CURVE
++U+02AA7           ⪧            \gtcc                                        GREATER-THAN CLOSED BY CURVE
++U+02AA8           ⪨            \lescc                                       LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
++U+02AA9           ⪩            \gescc                                       GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
++U+02AAA           ⪪            \smt                                         SMALLER THAN
++U+02AAB           ⪫            \lat                                         LARGER THAN
++U+02AAC           ⪬            \smte                                        SMALLER THAN OR EQUAL TO
++U+02AAD           ⪭            \late                                        LARGER THAN OR EQUAL TO
++U+02AAE           ⪮            \bumpeqq                                     EQUALS SIGN WITH BUMPY ABOVE
++U+02AAF           ⪯            \preceq                                      PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
++U+02AAF + U+00338 ⪯̸           \npreceq                                     PRECEDES ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02AB0           ⪰            \succeq                                      SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
++U+02AB0 + U+00338 ⪰̸           \nsucceq                                     SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02AB1           ⪱            \precneq                                     PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO
++U+02AB2           ⪲            \succneq                                     SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
++U+02AB3           ⪳            \preceqq                                     PRECEDES ABOVE EQUALS SIGN
++U+02AB4           ⪴            \succeqq                                     SUCCEEDS ABOVE EQUALS SIGN
++U+02AB5           ⪵            \precneqq                                    PRECEDES ABOVE NOT EQUAL TO
++U+02AB6           ⪶            \succneqq                                    SUCCEEDS ABOVE NOT EQUAL TO
++U+02AB7           ⪷            \precapprox                                  PRECEDES ABOVE ALMOST EQUAL TO
++U+02AB8           ⪸            \succapprox                                  SUCCEEDS ABOVE ALMOST EQUAL TO
++U+02AB9           ⪹            \precnapprox                                 PRECEDES ABOVE NOT ALMOST EQUAL TO
++U+02ABA           ⪺            \succnapprox                                 SUCCEEDS ABOVE NOT ALMOST EQUAL TO
++U+02ABB           ⪻            \Prec                                        DOUBLE PRECEDES
++U+02ABC           ⪼            \Succ                                        DOUBLE SUCCEEDS
++U+02ABD           ⪽            \subsetdot                                   SUBSET WITH DOT
++U+02ABE           ⪾            \supsetdot                                   SUPERSET WITH DOT
++U+02ABF           ⪿            \subsetplus                                  SUBSET WITH PLUS SIGN BELOW
++U+02AC0           ⫀            \supsetplus                                  SUPERSET WITH PLUS SIGN BELOW
++U+02AC1           ⫁            \submult                                     SUBSET WITH MULTIPLICATION SIGN BELOW
++U+02AC2           ⫂            \supmult                                     SUPERSET WITH MULTIPLICATION SIGN BELOW
++U+02AC3           ⫃            \subedot                                     SUBSET OF OR EQUAL TO WITH DOT ABOVE
++U+02AC4           ⫄            \supedot                                     SUPERSET OF OR EQUAL TO WITH DOT ABOVE
++U+02AC5           ⫅            \subseteqq                                   SUBSET OF ABOVE EQUALS SIGN
++U+02AC5 + U+00338 ⫅̸           \nsubseteqq                                  SUBSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02AC6           ⫆            \supseteqq                                   SUPERSET OF ABOVE EQUALS SIGN
++U+02AC6 + U+00338 ⫆̸           \nsupseteqq                                  SUPERSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++U+02AC7           ⫇            \subsim                                      SUBSET OF ABOVE TILDE OPERATOR
++U+02AC8           ⫈            \supsim                                      SUPERSET OF ABOVE TILDE OPERATOR
++U+02AC9           ⫉            \subsetapprox                                SUBSET OF ABOVE ALMOST EQUAL TO
++U+02ACA           ⫊            \supsetapprox                                SUPERSET OF ABOVE ALMOST EQUAL TO
++U+02ACB           ⫋            \subsetneqq                                  SUBSET OF ABOVE NOT EQUAL TO
++U+02ACC           ⫌            \supsetneqq                                  SUPERSET OF ABOVE NOT EQUAL TO
++U+02ACD           ⫍            \lsqhook                                     SQUARE LEFT OPEN BOX OPERATOR
++U+02ACE           ⫎            \rsqhook                                     SQUARE RIGHT OPEN BOX OPERATOR
++U+02ACF           ⫏            \csub                                        CLOSED SUBSET
++U+02AD0           ⫐            \csup                                        CLOSED SUPERSET
++U+02AD1           ⫑            \csube                                       CLOSED SUBSET OR EQUAL TO
++U+02AD2           ⫒            \csupe                                       CLOSED SUPERSET OR EQUAL TO
++U+02AD3           ⫓            \subsup                                      SUBSET ABOVE SUPERSET
++U+02AD4           ⫔            \supsub                                      SUPERSET ABOVE SUBSET
++U+02AD5           ⫕            \subsub                                      SUBSET ABOVE SUBSET
++U+02AD6           ⫖            \supsup                                      SUPERSET ABOVE SUPERSET
++U+02AD7           ⫗            \suphsub                                     SUPERSET BESIDE SUBSET
++U+02AD8           ⫘            \supdsub                                     SUPERSET BESIDE AND JOINED BY DASH WITH SUBSET
++U+02AD9           ⫙            \forkv                                       ELEMENT OF OPENING DOWNWARDS
++U+02ADB           ⫛            \mlcp                                        TRANSVERSAL INTERSECTION
++U+02ADC           ⫝̸            \forks                                       FORKING
++U+02ADD           ⫝            \forksnot                                    NONFORKING
++U+02AE3           ⫣            \dashV                                       DOUBLE VERTICAL BAR LEFT TURNSTILE
++U+02AE4           ⫤            \Dashv                                       VERTICAL BAR DOUBLE LEFT TURNSTILE
++U+02AF4           ⫴            \interleave                                  TRIPLE VERTICAL BAR BINARY RELATION
++U+02AF6           ⫶            \tdcol                                       TRIPLE COLON OPERATOR
++U+02AF7           ⫷            \lllnest                                     TRIPLE NESTED LESS-THAN
++U+02AF8           ⫸            \gggnest                                     TRIPLE NESTED GREATER-THAN
++U+02AF9           ⫹            \leqqslant                                   DOUBLE-LINE SLANTED LESS-THAN OR EQUAL TO
++U+02AFA           ⫺            \geqqslant                                   DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO
++U+02B05           ⬅            \:arrow_left:                                LEFTWARDS BLACK ARROW
++U+02B06           ⬆            \:arrow_up:                                  UPWARDS BLACK ARROW
++U+02B07           ⬇            \:arrow_down:                                DOWNWARDS BLACK ARROW
++U+02B12           ⬒            \squaretopblack                              SQUARE WITH TOP HALF BLACK
++U+02B13           ⬓            \squarebotblack                              SQUARE WITH BOTTOM HALF BLACK
++U+02B14           ⬔            \squareurblack                               SQUARE WITH UPPER RIGHT DIAGONAL HALF BLACK
++U+02B15           ⬕            \squarellblack                               SQUARE WITH LOWER LEFT DIAGONAL HALF BLACK
++U+02B16           ⬖            \diamondleftblack                            DIAMOND WITH LEFT HALF BLACK
++U+02B17           ⬗            \diamondrightblack                           DIAMOND WITH RIGHT HALF BLACK
++U+02B18           ⬘            \diamondtopblack                             DIAMOND WITH TOP HALF BLACK
++U+02B19           ⬙            \diamondbotblack                             DIAMOND WITH BOTTOM HALF BLACK
++U+02B1A           ⬚            \dottedsquare                                DOTTED SQUARE
++U+02B1B           ⬛            \lgblksquare, \:black_large_square:          BLACK LARGE SQUARE
++U+02B1C           ⬜            \lgwhtsquare, \:white_large_square:          WHITE LARGE SQUARE
++U+02B1D           ⬝            \vysmblksquare                               BLACK VERY SMALL SQUARE
++U+02B1E           ⬞            \vysmwhtsquare                               WHITE VERY SMALL SQUARE
++U+02B1F           ⬟            \pentagonblack                               BLACK PENTAGON
++U+02B20           ⬠            \pentagon                                    WHITE PENTAGON
++U+02B21           ⬡            \varhexagon                                  WHITE HEXAGON
++U+02B22           ⬢            \varhexagonblack                             BLACK HEXAGON
++U+02B23           ⬣            \hexagonblack                                HORIZONTAL BLACK HEXAGON
++U+02B24           ⬤            \lgblkcircle                                 BLACK LARGE CIRCLE
++U+02B25           ⬥            \mdblkdiamond                                BLACK MEDIUM DIAMOND
++U+02B26           ⬦            \mdwhtdiamond                                WHITE MEDIUM DIAMOND
++U+02B27           ⬧            \mdblklozenge                                BLACK MEDIUM LOZENGE
++U+02B28           ⬨            \mdwhtlozenge                                WHITE MEDIUM LOZENGE
++U+02B29           ⬩            \smblkdiamond                                BLACK SMALL DIAMOND
++U+02B2A           ⬪            \smblklozenge                                BLACK SMALL LOZENGE
++U+02B2B           ⬫            \smwhtlozenge                                WHITE SMALL LOZENGE
++U+02B2C           ⬬            \blkhorzoval                                 BLACK HORIZONTAL ELLIPSE
++U+02B2D           ⬭            \whthorzoval                                 WHITE HORIZONTAL ELLIPSE
++U+02B2E           ⬮            \blkvertoval                                 BLACK VERTICAL ELLIPSE
++U+02B2F           ⬯            \whtvertoval                                 WHITE VERTICAL ELLIPSE
++U+02B30           ⬰            \circleonleftarrow                           LEFT ARROW WITH SMALL CIRCLE
++U+02B31           ⬱            \leftthreearrows                             THREE LEFTWARDS ARROWS
++U+02B32           ⬲            \leftarrowonoplus                            LEFT ARROW WITH CIRCLED PLUS
++U+02B33           ⬳            \longleftsquigarrow                          LONG LEFTWARDS SQUIGGLE ARROW
++U+02B34           ⬴            \nvtwoheadleftarrow                          LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
++U+02B35           ⬵            \nVtwoheadleftarrow                          LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
++U+02B36           ⬶            \twoheadmapsfrom                             LEFTWARDS TWO-HEADED ARROW FROM BAR
++U+02B37           ⬷            \twoheadleftdbkarrow                         LEFTWARDS TWO-HEADED TRIPLE DASH ARROW
++U+02B38           ⬸            \leftdotarrow                                LEFTWARDS ARROW WITH DOTTED STEM
++U+02B39           ⬹            \nvleftarrowtail                             LEFTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
++U+02B3A           ⬺            \nVleftarrowtail                             LEFTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++U+02B3B           ⬻            \twoheadleftarrowtail                        LEFTWARDS TWO-HEADED ARROW WITH TAIL
++U+02B3C           ⬼            \nvtwoheadleftarrowtail                      LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
++U+02B3D           ⬽            \nVtwoheadleftarrowtail                      LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++U+02B3E           ⬾            \leftarrowx                                  LEFTWARDS ARROW THROUGH X
++U+02B3F           ⬿            \leftcurvedarrow                             WAVE ARROW POINTING DIRECTLY LEFT
++U+02B40           ⭀            \equalleftarrow                              EQUALS SIGN ABOVE LEFTWARDS ARROW
++U+02B41           ⭁            \bsimilarleftarrow                           REVERSE TILDE OPERATOR ABOVE LEFTWARDS ARROW
++U+02B42           ⭂            \leftarrowbackapprox                         LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
++U+02B43           ⭃            \rightarrowgtr                               RIGHTWARDS ARROW THROUGH GREATER-THAN
++U+02B44           ⭄            \rightarrowsupset                            RIGHTWARDS ARROW THROUGH SUPERSET
++U+02B45           ⭅            \LLeftarrow                                  LEFTWARDS QUADRUPLE ARROW
++U+02B46           ⭆            \RRightarrow                                 RIGHTWARDS QUADRUPLE ARROW
++U+02B47           ⭇            \bsimilarrightarrow                          REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW
++U+02B48           ⭈            \rightarrowbackapprox                        RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
++U+02B49           ⭉            \similarleftarrow                            TILDE OPERATOR ABOVE LEFTWARDS ARROW
++U+02B4A           ⭊            \leftarrowapprox                             LEFTWARDS ARROW ABOVE ALMOST EQUAL TO
++U+02B4B           ⭋            \leftarrowbsimilar                           LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
++U+02B4C           ⭌            \rightarrowbsimilar                          RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
++U+02B50           ⭐            \medwhitestar, \:star:                       WHITE MEDIUM STAR
++U+02B51           ⭑            \medblackstar                                BLACK SMALL STAR
++U+02B52           ⭒            \smwhitestar                                 WHITE SMALL STAR
++U+02B53           ⭓            \rightpentagonblack                          BLACK RIGHT-POINTING PENTAGON
++U+02B54           ⭔            \rightpentagon                               WHITE RIGHT-POINTING PENTAGON
++U+02B55           ⭕            \:o:                                         HEAVY LARGE CIRCLE
++U+02C7C           ⱼ            \_j                                          LATIN SUBSCRIPT SMALL LETTER J
++U+02C7D           ⱽ            \^V                                          MODIFIER LETTER CAPITAL V
++U+03012           〒            \postalmark                                  POSTAL MARK
++U+03030           〰            \:wavy_dash:                                 WAVY DASH
++U+0303D           〽            \:part_alternation_mark:                     PART ALTERNATION MARK
++U+03297           ㊗            \:congratulations:                           CIRCLED IDEOGRAPH CONGRATULATION
++U+03299           ㊙            \:secret:                                    CIRCLED IDEOGRAPH SECRET
++U+1D400           𝐀            \bfA                                         MATHEMATICAL BOLD CAPITAL A
++U+1D401           𝐁            \bfB                                         MATHEMATICAL BOLD CAPITAL B
++U+1D402           𝐂            \bfC                                         MATHEMATICAL BOLD CAPITAL C
++U+1D403           𝐃            \bfD                                         MATHEMATICAL BOLD CAPITAL D
++U+1D404           𝐄            \bfE                                         MATHEMATICAL BOLD CAPITAL E
++U+1D405           𝐅            \bfF                                         MATHEMATICAL BOLD CAPITAL F
++U+1D406           𝐆            \bfG                                         MATHEMATICAL BOLD CAPITAL G
++U+1D407           𝐇            \bfH                                         MATHEMATICAL BOLD CAPITAL H
++U+1D408           𝐈            \bfI                                         MATHEMATICAL BOLD CAPITAL I
++U+1D409           𝐉            \bfJ                                         MATHEMATICAL BOLD CAPITAL J
++U+1D40A           𝐊            \bfK                                         MATHEMATICAL BOLD CAPITAL K
++U+1D40B           𝐋            \bfL                                         MATHEMATICAL BOLD CAPITAL L
++U+1D40C           𝐌            \bfM                                         MATHEMATICAL BOLD CAPITAL M
++U+1D40D           𝐍            \bfN                                         MATHEMATICAL BOLD CAPITAL N
++U+1D40E           𝐎            \bfO                                         MATHEMATICAL BOLD CAPITAL O
++U+1D40F           𝐏            \bfP                                         MATHEMATICAL BOLD CAPITAL P
++U+1D410           𝐐            \bfQ                                         MATHEMATICAL BOLD CAPITAL Q
++U+1D411           𝐑            \bfR                                         MATHEMATICAL BOLD CAPITAL R
++U+1D412           𝐒            \bfS                                         MATHEMATICAL BOLD CAPITAL S
++U+1D413           𝐓            \bfT                                         MATHEMATICAL BOLD CAPITAL T
++U+1D414           𝐔            \bfU                                         MATHEMATICAL BOLD CAPITAL U
++U+1D415           𝐕            \bfV                                         MATHEMATICAL BOLD CAPITAL V
++U+1D416           𝐖            \bfW                                         MATHEMATICAL BOLD CAPITAL W
++U+1D417           𝐗            \bfX                                         MATHEMATICAL BOLD CAPITAL X
++U+1D418           𝐘            \bfY                                         MATHEMATICAL BOLD CAPITAL Y
++U+1D419           𝐙            \bfZ                                         MATHEMATICAL BOLD CAPITAL Z
++U+1D41A           𝐚            \bfa                                         MATHEMATICAL BOLD SMALL A
++U+1D41B           𝐛            \bfb                                         MATHEMATICAL BOLD SMALL B
++U+1D41C           𝐜            \bfc                                         MATHEMATICAL BOLD SMALL C
++U+1D41D           𝐝            \bfd                                         MATHEMATICAL BOLD SMALL D
++U+1D41E           𝐞            \bfe                                         MATHEMATICAL BOLD SMALL E
++U+1D41F           𝐟            \bff                                         MATHEMATICAL BOLD SMALL F
++U+1D420           𝐠            \bfg                                         MATHEMATICAL BOLD SMALL G
++U+1D421           𝐡            \bfh                                         MATHEMATICAL BOLD SMALL H
++U+1D422           𝐢            \bfi                                         MATHEMATICAL BOLD SMALL I
++U+1D423           𝐣            \bfj                                         MATHEMATICAL BOLD SMALL J
++U+1D424           𝐤            \bfk                                         MATHEMATICAL BOLD SMALL K
++U+1D425           𝐥            \bfl                                         MATHEMATICAL BOLD SMALL L
++U+1D426           𝐦            \bfm                                         MATHEMATICAL BOLD SMALL M
++U+1D427           𝐧            \bfn                                         MATHEMATICAL BOLD SMALL N
++U+1D428           𝐨            \bfo                                         MATHEMATICAL BOLD SMALL O
++U+1D429           𝐩            \bfp                                         MATHEMATICAL BOLD SMALL P
++U+1D42A           𝐪            \bfq                                         MATHEMATICAL BOLD SMALL Q
++U+1D42B           𝐫            \bfr                                         MATHEMATICAL BOLD SMALL R
++U+1D42C           𝐬            \bfs                                         MATHEMATICAL BOLD SMALL S
++U+1D42D           𝐭            \bft                                         MATHEMATICAL BOLD SMALL T
++U+1D42E           𝐮            \bfu                                         MATHEMATICAL BOLD SMALL U
++U+1D42F           𝐯            \bfv                                         MATHEMATICAL BOLD SMALL V
++U+1D430           𝐰            \bfw                                         MATHEMATICAL BOLD SMALL W
++U+1D431           𝐱            \bfx                                         MATHEMATICAL BOLD SMALL X
++U+1D432           𝐲            \bfy                                         MATHEMATICAL BOLD SMALL Y
++U+1D433           𝐳            \bfz                                         MATHEMATICAL BOLD SMALL Z
++U+1D434           𝐴            \itA                                         MATHEMATICAL ITALIC CAPITAL A
++U+1D435           𝐵            \itB                                         MATHEMATICAL ITALIC CAPITAL B
++U+1D436           𝐶            \itC                                         MATHEMATICAL ITALIC CAPITAL C
++U+1D437           𝐷            \itD                                         MATHEMATICAL ITALIC CAPITAL D
++U+1D438           𝐸            \itE                                         MATHEMATICAL ITALIC CAPITAL E
++U+1D439           𝐹            \itF                                         MATHEMATICAL ITALIC CAPITAL F
++U+1D43A           𝐺            \itG                                         MATHEMATICAL ITALIC CAPITAL G
++U+1D43B           𝐻            \itH                                         MATHEMATICAL ITALIC CAPITAL H
++U+1D43C           𝐼            \itI                                         MATHEMATICAL ITALIC CAPITAL I
++U+1D43D           𝐽            \itJ                                         MATHEMATICAL ITALIC CAPITAL J
++U+1D43E           𝐾            \itK                                         MATHEMATICAL ITALIC CAPITAL K
++U+1D43F           𝐿            \itL                                         MATHEMATICAL ITALIC CAPITAL L
++U+1D440           𝑀            \itM                                         MATHEMATICAL ITALIC CAPITAL M
++U+1D441           𝑁            \itN                                         MATHEMATICAL ITALIC CAPITAL N
++U+1D442           𝑂            \itO                                         MATHEMATICAL ITALIC CAPITAL O
++U+1D443           𝑃            \itP                                         MATHEMATICAL ITALIC CAPITAL P
++U+1D444           𝑄            \itQ                                         MATHEMATICAL ITALIC CAPITAL Q
++U+1D445           𝑅            \itR                                         MATHEMATICAL ITALIC CAPITAL R
++U+1D446           𝑆            \itS                                         MATHEMATICAL ITALIC CAPITAL S
++U+1D447           𝑇            \itT                                         MATHEMATICAL ITALIC CAPITAL T
++U+1D448           𝑈            \itU                                         MATHEMATICAL ITALIC CAPITAL U
++U+1D449           𝑉            \itV                                         MATHEMATICAL ITALIC CAPITAL V
++U+1D44A           𝑊            \itW                                         MATHEMATICAL ITALIC CAPITAL W
++U+1D44B           𝑋            \itX                                         MATHEMATICAL ITALIC CAPITAL X
++U+1D44C           𝑌            \itY                                         MATHEMATICAL ITALIC CAPITAL Y
++U+1D44D           𝑍            \itZ                                         MATHEMATICAL ITALIC CAPITAL Z
++U+1D44E           𝑎            \ita                                         MATHEMATICAL ITALIC SMALL A
++U+1D44F           𝑏            \itb                                         MATHEMATICAL ITALIC SMALL B
++U+1D450           𝑐            \itc                                         MATHEMATICAL ITALIC SMALL C
++U+1D451           𝑑            \itd                                         MATHEMATICAL ITALIC SMALL D
++U+1D452           𝑒            \ite                                         MATHEMATICAL ITALIC SMALL E
++U+1D453           𝑓            \itf                                         MATHEMATICAL ITALIC SMALL F
++U+1D454           𝑔            \itg                                         MATHEMATICAL ITALIC SMALL G
++U+1D456           𝑖            \iti                                         MATHEMATICAL ITALIC SMALL I
++U+1D457           𝑗            \itj                                         MATHEMATICAL ITALIC SMALL J
++U+1D458           𝑘            \itk                                         MATHEMATICAL ITALIC SMALL K
++U+1D459           𝑙            \itl                                         MATHEMATICAL ITALIC SMALL L
++U+1D45A           𝑚            \itm                                         MATHEMATICAL ITALIC SMALL M
++U+1D45B           𝑛            \itn                                         MATHEMATICAL ITALIC SMALL N
++U+1D45C           𝑜            \ito                                         MATHEMATICAL ITALIC SMALL O
++U+1D45D           𝑝            \itp                                         MATHEMATICAL ITALIC SMALL P
++U+1D45E           𝑞            \itq                                         MATHEMATICAL ITALIC SMALL Q
++U+1D45F           𝑟            \itr                                         MATHEMATICAL ITALIC SMALL R
++U+1D460           𝑠            \its                                         MATHEMATICAL ITALIC SMALL S
++U+1D461           𝑡            \itt                                         MATHEMATICAL ITALIC SMALL T
++U+1D462           𝑢            \itu                                         MATHEMATICAL ITALIC SMALL U
++U+1D463           𝑣            \itv                                         MATHEMATICAL ITALIC SMALL V
++U+1D464           𝑤            \itw                                         MATHEMATICAL ITALIC SMALL W
++U+1D465           𝑥            \itx                                         MATHEMATICAL ITALIC SMALL X
++U+1D466           𝑦            \ity                                         MATHEMATICAL ITALIC SMALL Y
++U+1D467           𝑧            \itz                                         MATHEMATICAL ITALIC SMALL Z
++U+1D468           𝑨            \biA                                         MATHEMATICAL BOLD ITALIC CAPITAL A
++U+1D469           𝑩            \biB                                         MATHEMATICAL BOLD ITALIC CAPITAL B
++U+1D46A           𝑪            \biC                                         MATHEMATICAL BOLD ITALIC CAPITAL C
++U+1D46B           𝑫            \biD                                         MATHEMATICAL BOLD ITALIC CAPITAL D
++U+1D46C           𝑬            \biE                                         MATHEMATICAL BOLD ITALIC CAPITAL E
++U+1D46D           𝑭            \biF                                         MATHEMATICAL BOLD ITALIC CAPITAL F
++U+1D46E           𝑮            \biG                                         MATHEMATICAL BOLD ITALIC CAPITAL G
++U+1D46F           𝑯            \biH                                         MATHEMATICAL BOLD ITALIC CAPITAL H
++U+1D470           𝑰            \biI                                         MATHEMATICAL BOLD ITALIC CAPITAL I
++U+1D471           𝑱            \biJ                                         MATHEMATICAL BOLD ITALIC CAPITAL J
++U+1D472           𝑲            \biK                                         MATHEMATICAL BOLD ITALIC CAPITAL K
++U+1D473           𝑳            \biL                                         MATHEMATICAL BOLD ITALIC CAPITAL L
++U+1D474           𝑴            \biM                                         MATHEMATICAL BOLD ITALIC CAPITAL M
++U+1D475           𝑵            \biN                                         MATHEMATICAL BOLD ITALIC CAPITAL N
++U+1D476           𝑶            \biO                                         MATHEMATICAL BOLD ITALIC CAPITAL O
++U+1D477           𝑷            \biP                                         MATHEMATICAL BOLD ITALIC CAPITAL P
++U+1D478           𝑸            \biQ                                         MATHEMATICAL BOLD ITALIC CAPITAL Q
++U+1D479           𝑹            \biR                                         MATHEMATICAL BOLD ITALIC CAPITAL R
++U+1D47A           𝑺            \biS                                         MATHEMATICAL BOLD ITALIC CAPITAL S
++U+1D47B           𝑻            \biT                                         MATHEMATICAL BOLD ITALIC CAPITAL T
++U+1D47C           𝑼            \biU                                         MATHEMATICAL BOLD ITALIC CAPITAL U
++U+1D47D           𝑽            \biV                                         MATHEMATICAL BOLD ITALIC CAPITAL V
++U+1D47E           𝑾            \biW                                         MATHEMATICAL BOLD ITALIC CAPITAL W
++U+1D47F           𝑿            \biX                                         MATHEMATICAL BOLD ITALIC CAPITAL X
++U+1D480           𝒀            \biY                                         MATHEMATICAL BOLD ITALIC CAPITAL Y
++U+1D481           𝒁            \biZ                                         MATHEMATICAL BOLD ITALIC CAPITAL Z
++U+1D482           𝒂            \bia                                         MATHEMATICAL BOLD ITALIC SMALL A
++U+1D483           𝒃            \bib                                         MATHEMATICAL BOLD ITALIC SMALL B
++U+1D484           𝒄            \bic                                         MATHEMATICAL BOLD ITALIC SMALL C
++U+1D485           𝒅            \bid                                         MATHEMATICAL BOLD ITALIC SMALL D
++U+1D486           𝒆            \bie                                         MATHEMATICAL BOLD ITALIC SMALL E
++U+1D487           𝒇            \bif                                         MATHEMATICAL BOLD ITALIC SMALL F
++U+1D488           𝒈            \big                                         MATHEMATICAL BOLD ITALIC SMALL G
++U+1D489           𝒉            \bih                                         MATHEMATICAL BOLD ITALIC SMALL H
++U+1D48A           𝒊            \bii                                         MATHEMATICAL BOLD ITALIC SMALL I
++U+1D48B           𝒋            \bij                                         MATHEMATICAL BOLD ITALIC SMALL J
++U+1D48C           𝒌            \bik                                         MATHEMATICAL BOLD ITALIC SMALL K
++U+1D48D           𝒍            \bil                                         MATHEMATICAL BOLD ITALIC SMALL L
++U+1D48E           𝒎            \bim                                         MATHEMATICAL BOLD ITALIC SMALL M
++U+1D48F           𝒏            \bin                                         MATHEMATICAL BOLD ITALIC SMALL N
++U+1D490           𝒐            \bio                                         MATHEMATICAL BOLD ITALIC SMALL O
++U+1D491           𝒑            \bip                                         MATHEMATICAL BOLD ITALIC SMALL P
++U+1D492           𝒒            \biq                                         MATHEMATICAL BOLD ITALIC SMALL Q
++U+1D493           𝒓            \bir                                         MATHEMATICAL BOLD ITALIC SMALL R
++U+1D494           𝒔            \bis                                         MATHEMATICAL BOLD ITALIC SMALL S
++U+1D495           𝒕            \bit                                         MATHEMATICAL BOLD ITALIC SMALL T
++U+1D496           𝒖            \biu                                         MATHEMATICAL BOLD ITALIC SMALL U
++U+1D497           𝒗            \biv                                         MATHEMATICAL BOLD ITALIC SMALL V
++U+1D498           𝒘            \biw                                         MATHEMATICAL BOLD ITALIC SMALL W
++U+1D499           𝒙            \bix                                         MATHEMATICAL BOLD ITALIC SMALL X
++U+1D49A           𝒚            \biy                                         MATHEMATICAL BOLD ITALIC SMALL Y
++U+1D49B           𝒛            \biz                                         MATHEMATICAL BOLD ITALIC SMALL Z
++U+1D49C           𝒜            \scrA                                        MATHEMATICAL SCRIPT CAPITAL A
++U+1D49E           𝒞            \scrC                                        MATHEMATICAL SCRIPT CAPITAL C
++U+1D49F           𝒟            \scrD                                        MATHEMATICAL SCRIPT CAPITAL D
++U+1D4A2           𝒢            \scrG                                        MATHEMATICAL SCRIPT CAPITAL G
++U+1D4A5           𝒥            \scrJ                                        MATHEMATICAL SCRIPT CAPITAL J
++U+1D4A6           𝒦            \scrK                                        MATHEMATICAL SCRIPT CAPITAL K
++U+1D4A9           𝒩            \scrN                                        MATHEMATICAL SCRIPT CAPITAL N
++U+1D4AA           𝒪            \scrO                                        MATHEMATICAL SCRIPT CAPITAL O
++U+1D4AB           𝒫            \scrP                                        MATHEMATICAL SCRIPT CAPITAL P
++U+1D4AC           𝒬            \scrQ                                        MATHEMATICAL SCRIPT CAPITAL Q
++U+1D4AE           𝒮            \scrS                                        MATHEMATICAL SCRIPT CAPITAL S
++U+1D4AF           𝒯            \scrT                                        MATHEMATICAL SCRIPT CAPITAL T
++U+1D4B0           𝒰            \scrU                                        MATHEMATICAL SCRIPT CAPITAL U
++U+1D4B1           𝒱            \scrV                                        MATHEMATICAL SCRIPT CAPITAL V
++U+1D4B2           𝒲            \scrW                                        MATHEMATICAL SCRIPT CAPITAL W
++U+1D4B3           𝒳            \scrX                                        MATHEMATICAL SCRIPT CAPITAL X
++U+1D4B4           𝒴            \scrY                                        MATHEMATICAL SCRIPT CAPITAL Y
++U+1D4B5           𝒵            \scrZ                                        MATHEMATICAL SCRIPT CAPITAL Z
++U+1D4B6           𝒶            \scra                                        MATHEMATICAL SCRIPT SMALL A
++U+1D4B7           𝒷            \scrb                                        MATHEMATICAL SCRIPT SMALL B
++U+1D4B8           𝒸            \scrc                                        MATHEMATICAL SCRIPT SMALL C
++U+1D4B9           𝒹            \scrd                                        MATHEMATICAL SCRIPT SMALL D
++U+1D4BB           𝒻            \scrf                                        MATHEMATICAL SCRIPT SMALL F
++U+1D4BD           𝒽            \scrh                                        MATHEMATICAL SCRIPT SMALL H
++U+1D4BE           𝒾            \scri                                        MATHEMATICAL SCRIPT SMALL I
++U+1D4BF           𝒿            \scrj                                        MATHEMATICAL SCRIPT SMALL J
++U+1D4C0           𝓀            \scrk                                        MATHEMATICAL SCRIPT SMALL K
++U+1D4C1           𝓁            \scrl                                        MATHEMATICAL SCRIPT SMALL L
++U+1D4C2           𝓂            \scrm                                        MATHEMATICAL SCRIPT SMALL M
++U+1D4C3           𝓃            \scrn                                        MATHEMATICAL SCRIPT SMALL N
++U+1D4C5           𝓅            \scrp                                        MATHEMATICAL SCRIPT SMALL P
++U+1D4C6           𝓆            \scrq                                        MATHEMATICAL SCRIPT SMALL Q
++U+1D4C7           𝓇            \scrr                                        MATHEMATICAL SCRIPT SMALL R
++U+1D4C8           𝓈            \scrs                                        MATHEMATICAL SCRIPT SMALL S
++U+1D4C9           𝓉            \scrt                                        MATHEMATICAL SCRIPT SMALL T
++U+1D4CA           𝓊            \scru                                        MATHEMATICAL SCRIPT SMALL U
++U+1D4CB           𝓋            \scrv                                        MATHEMATICAL SCRIPT SMALL V
++U+1D4CC           𝓌            \scrw                                        MATHEMATICAL SCRIPT SMALL W
++U+1D4CD           𝓍            \scrx                                        MATHEMATICAL SCRIPT SMALL X
++U+1D4CE           𝓎            \scry                                        MATHEMATICAL SCRIPT SMALL Y
++U+1D4CF           𝓏            \scrz                                        MATHEMATICAL SCRIPT SMALL Z
++U+1D4D0           𝓐            \bscrA                                       MATHEMATICAL BOLD SCRIPT CAPITAL A
++U+1D4D1           𝓑            \bscrB                                       MATHEMATICAL BOLD SCRIPT CAPITAL B
++U+1D4D2           𝓒            \bscrC                                       MATHEMATICAL BOLD SCRIPT CAPITAL C
++U+1D4D3           𝓓            \bscrD                                       MATHEMATICAL BOLD SCRIPT CAPITAL D
++U+1D4D4           𝓔            \bscrE                                       MATHEMATICAL BOLD SCRIPT CAPITAL E
++U+1D4D5           𝓕            \bscrF                                       MATHEMATICAL BOLD SCRIPT CAPITAL F
++U+1D4D6           𝓖            \bscrG                                       MATHEMATICAL BOLD SCRIPT CAPITAL G
++U+1D4D7           𝓗            \bscrH                                       MATHEMATICAL BOLD SCRIPT CAPITAL H
++U+1D4D8           𝓘            \bscrI                                       MATHEMATICAL BOLD SCRIPT CAPITAL I
++U+1D4D9           𝓙            \bscrJ                                       MATHEMATICAL BOLD SCRIPT CAPITAL J
++U+1D4DA           𝓚            \bscrK                                       MATHEMATICAL BOLD SCRIPT CAPITAL K
++U+1D4DB           𝓛            \bscrL                                       MATHEMATICAL BOLD SCRIPT CAPITAL L
++U+1D4DC           𝓜            \bscrM                                       MATHEMATICAL BOLD SCRIPT CAPITAL M
++U+1D4DD           𝓝            \bscrN                                       MATHEMATICAL BOLD SCRIPT CAPITAL N
++U+1D4DE           𝓞            \bscrO                                       MATHEMATICAL BOLD SCRIPT CAPITAL O
++U+1D4DF           𝓟            \bscrP                                       MATHEMATICAL BOLD SCRIPT CAPITAL P
++U+1D4E0           𝓠            \bscrQ                                       MATHEMATICAL BOLD SCRIPT CAPITAL Q
++U+1D4E1           𝓡            \bscrR                                       MATHEMATICAL BOLD SCRIPT CAPITAL R
++U+1D4E2           𝓢            \bscrS                                       MATHEMATICAL BOLD SCRIPT CAPITAL S
++U+1D4E3           𝓣            \bscrT                                       MATHEMATICAL BOLD SCRIPT CAPITAL T
++U+1D4E4           𝓤            \bscrU                                       MATHEMATICAL BOLD SCRIPT CAPITAL U
++U+1D4E5           𝓥            \bscrV                                       MATHEMATICAL BOLD SCRIPT CAPITAL V
++U+1D4E6           𝓦            \bscrW                                       MATHEMATICAL BOLD SCRIPT CAPITAL W
++U+1D4E7           𝓧            \bscrX                                       MATHEMATICAL BOLD SCRIPT CAPITAL X
++U+1D4E8           𝓨            \bscrY                                       MATHEMATICAL BOLD SCRIPT CAPITAL Y
++U+1D4E9           𝓩            \bscrZ                                       MATHEMATICAL BOLD SCRIPT CAPITAL Z
++U+1D4EA           𝓪            \bscra                                       MATHEMATICAL BOLD SCRIPT SMALL A
++U+1D4EB           𝓫            \bscrb                                       MATHEMATICAL BOLD SCRIPT SMALL B
++U+1D4EC           𝓬            \bscrc                                       MATHEMATICAL BOLD SCRIPT SMALL C
++U+1D4ED           𝓭            \bscrd                                       MATHEMATICAL BOLD SCRIPT SMALL D
++U+1D4EE           𝓮            \bscre                                       MATHEMATICAL BOLD SCRIPT SMALL E
++U+1D4EF           𝓯            \bscrf                                       MATHEMATICAL BOLD SCRIPT SMALL F
++U+1D4F0           𝓰            \bscrg                                       MATHEMATICAL BOLD SCRIPT SMALL G
++U+1D4F1           𝓱            \bscrh                                       MATHEMATICAL BOLD SCRIPT SMALL H
++U+1D4F2           𝓲            \bscri                                       MATHEMATICAL BOLD SCRIPT SMALL I
++U+1D4F3           𝓳            \bscrj                                       MATHEMATICAL BOLD SCRIPT SMALL J
++U+1D4F4           𝓴            \bscrk                                       MATHEMATICAL BOLD SCRIPT SMALL K
++U+1D4F5           𝓵            \bscrl                                       MATHEMATICAL BOLD SCRIPT SMALL L
++U+1D4F6           𝓶            \bscrm                                       MATHEMATICAL BOLD SCRIPT SMALL M
++U+1D4F7           𝓷            \bscrn                                       MATHEMATICAL BOLD SCRIPT SMALL N
++U+1D4F8           𝓸            \bscro                                       MATHEMATICAL BOLD SCRIPT SMALL O
++U+1D4F9           𝓹            \bscrp                                       MATHEMATICAL BOLD SCRIPT SMALL P
++U+1D4FA           𝓺            \bscrq                                       MATHEMATICAL BOLD SCRIPT SMALL Q
++U+1D4FB           𝓻            \bscrr                                       MATHEMATICAL BOLD SCRIPT SMALL R
++U+1D4FC           𝓼            \bscrs                                       MATHEMATICAL BOLD SCRIPT SMALL S
++U+1D4FD           𝓽            \bscrt                                       MATHEMATICAL BOLD SCRIPT SMALL T
++U+1D4FE           𝓾            \bscru                                       MATHEMATICAL BOLD SCRIPT SMALL U
++U+1D4FF           𝓿            \bscrv                                       MATHEMATICAL BOLD SCRIPT SMALL V
++U+1D500           𝔀            \bscrw                                       MATHEMATICAL BOLD SCRIPT SMALL W
++U+1D501           𝔁            \bscrx                                       MATHEMATICAL BOLD SCRIPT SMALL X
++U+1D502           𝔂            \bscry                                       MATHEMATICAL BOLD SCRIPT SMALL Y
++U+1D503           𝔃            \bscrz                                       MATHEMATICAL BOLD SCRIPT SMALL Z
++U+1D504           𝔄            \frakA                                       MATHEMATICAL FRAKTUR CAPITAL A
++U+1D505           𝔅            \frakB                                       MATHEMATICAL FRAKTUR CAPITAL B
++U+1D507           𝔇            \frakD                                       MATHEMATICAL FRAKTUR CAPITAL D
++U+1D508           𝔈            \frakE                                       MATHEMATICAL FRAKTUR CAPITAL E
++U+1D509           𝔉            \frakF                                       MATHEMATICAL FRAKTUR CAPITAL F
++U+1D50A           𝔊            \frakG                                       MATHEMATICAL FRAKTUR CAPITAL G
++U+1D50D           𝔍            \frakJ                                       MATHEMATICAL FRAKTUR CAPITAL J
++U+1D50E           𝔎            \frakK                                       MATHEMATICAL FRAKTUR CAPITAL K
++U+1D50F           𝔏            \frakL                                       MATHEMATICAL FRAKTUR CAPITAL L
++U+1D510           𝔐            \frakM                                       MATHEMATICAL FRAKTUR CAPITAL M
++U+1D511           𝔑            \frakN                                       MATHEMATICAL FRAKTUR CAPITAL N
++U+1D512           𝔒            \frakO                                       MATHEMATICAL FRAKTUR CAPITAL O
++U+1D513           𝔓            \frakP                                       MATHEMATICAL FRAKTUR CAPITAL P
++U+1D514           𝔔            \frakQ                                       MATHEMATICAL FRAKTUR CAPITAL Q
++U+1D516           𝔖            \frakS                                       MATHEMATICAL FRAKTUR CAPITAL S
++U+1D517           𝔗            \frakT                                       MATHEMATICAL FRAKTUR CAPITAL T
++U+1D518           𝔘            \frakU                                       MATHEMATICAL FRAKTUR CAPITAL U
++U+1D519           𝔙            \frakV                                       MATHEMATICAL FRAKTUR CAPITAL V
++U+1D51A           𝔚            \frakW                                       MATHEMATICAL FRAKTUR CAPITAL W
++U+1D51B           𝔛            \frakX                                       MATHEMATICAL FRAKTUR CAPITAL X
++U+1D51C           𝔜            \frakY                                       MATHEMATICAL FRAKTUR CAPITAL Y
++U+1D51E           𝔞            \fraka                                       MATHEMATICAL FRAKTUR SMALL A
++U+1D51F           𝔟            \frakb                                       MATHEMATICAL FRAKTUR SMALL B
++U+1D520           𝔠            \frakc                                       MATHEMATICAL FRAKTUR SMALL C
++U+1D521           𝔡            \frakd                                       MATHEMATICAL FRAKTUR SMALL D
++U+1D522           𝔢            \frake                                       MATHEMATICAL FRAKTUR SMALL E
++U+1D523           𝔣            \frakf                                       MATHEMATICAL FRAKTUR SMALL F
++U+1D524           𝔤            \frakg                                       MATHEMATICAL FRAKTUR SMALL G
++U+1D525           𝔥            \frakh                                       MATHEMATICAL FRAKTUR SMALL H
++U+1D526           𝔦            \fraki                                       MATHEMATICAL FRAKTUR SMALL I
++U+1D527           𝔧            \frakj                                       MATHEMATICAL FRAKTUR SMALL J
++U+1D528           𝔨            \frakk                                       MATHEMATICAL FRAKTUR SMALL K
++U+1D529           𝔩            \frakl                                       MATHEMATICAL FRAKTUR SMALL L
++U+1D52A           𝔪            \frakm                                       MATHEMATICAL FRAKTUR SMALL M
++U+1D52B           𝔫            \frakn                                       MATHEMATICAL FRAKTUR SMALL N
++U+1D52C           𝔬            \frako                                       MATHEMATICAL FRAKTUR SMALL O
++U+1D52D           𝔭            \frakp                                       MATHEMATICAL FRAKTUR SMALL P
++U+1D52E           𝔮            \frakq                                       MATHEMATICAL FRAKTUR SMALL Q
++U+1D52F           𝔯            \frakr                                       MATHEMATICAL FRAKTUR SMALL R
++U+1D530           𝔰            \fraks                                       MATHEMATICAL FRAKTUR SMALL S
++U+1D531           𝔱            \frakt                                       MATHEMATICAL FRAKTUR SMALL T
++U+1D532           𝔲            \fraku                                       MATHEMATICAL FRAKTUR SMALL U
++U+1D533           𝔳            \frakv                                       MATHEMATICAL FRAKTUR SMALL V
++U+1D534           𝔴            \frakw                                       MATHEMATICAL FRAKTUR SMALL W
++U+1D535           𝔵            \frakx                                       MATHEMATICAL FRAKTUR SMALL X
++U+1D536           𝔶            \fraky                                       MATHEMATICAL FRAKTUR SMALL Y
++U+1D537           𝔷            \frakz                                       MATHEMATICAL FRAKTUR SMALL Z
++U+1D538           𝔸            \bbA                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL A
++U+1D539           𝔹            \bbB                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL B
++U+1D53B           𝔻            \bbD                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL D
++U+1D53C           𝔼            \bbE                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL E
++U+1D53D           𝔽            \bbF                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL F
++U+1D53E           𝔾            \bbG                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL G
++U+1D540           𝕀            \bbI                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL I
++U+1D541           𝕁            \bbJ                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL J
++U+1D542           𝕂            \bbK                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL K
++U+1D543           𝕃            \bbL                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL L
++U+1D544           𝕄            \bbM                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL M
++U+1D546           𝕆            \bbO                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL O
++U+1D54A           𝕊            \bbS                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL S
++U+1D54B           𝕋            \bbT                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL T
++U+1D54C           𝕌            \bbU                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL U
++U+1D54D           𝕍            \bbV                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL V
++U+1D54E           𝕎            \bbW                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL W
++U+1D54F           𝕏            \bbX                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL X
++U+1D550           𝕐            \bbY                                         MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
++U+1D552           𝕒            \bba                                         MATHEMATICAL DOUBLE-STRUCK SMALL A
++U+1D553           𝕓            \bbb                                         MATHEMATICAL DOUBLE-STRUCK SMALL B
++U+1D554           𝕔            \bbc                                         MATHEMATICAL DOUBLE-STRUCK SMALL C
++U+1D555           𝕕            \bbd                                         MATHEMATICAL DOUBLE-STRUCK SMALL D
++U+1D556           𝕖            \bbe                                         MATHEMATICAL DOUBLE-STRUCK SMALL E
++U+1D557           𝕗            \bbf                                         MATHEMATICAL DOUBLE-STRUCK SMALL F
++U+1D558           𝕘            \bbg                                         MATHEMATICAL DOUBLE-STRUCK SMALL G
++U+1D559           𝕙            \bbh                                         MATHEMATICAL DOUBLE-STRUCK SMALL H
++U+1D55A           𝕚            \bbi                                         MATHEMATICAL DOUBLE-STRUCK SMALL I
++U+1D55B           𝕛            \bbj                                         MATHEMATICAL DOUBLE-STRUCK SMALL J
++U+1D55C           𝕜            \bbk                                         MATHEMATICAL DOUBLE-STRUCK SMALL K
++U+1D55D           𝕝            \bbl                                         MATHEMATICAL DOUBLE-STRUCK SMALL L
++U+1D55E           𝕞            \bbm                                         MATHEMATICAL DOUBLE-STRUCK SMALL M
++U+1D55F           𝕟            \bbn                                         MATHEMATICAL DOUBLE-STRUCK SMALL N
++U+1D560           𝕠            \bbo                                         MATHEMATICAL DOUBLE-STRUCK SMALL O
++U+1D561           𝕡            \bbp                                         MATHEMATICAL DOUBLE-STRUCK SMALL P
++U+1D562           𝕢            \bbq                                         MATHEMATICAL DOUBLE-STRUCK SMALL Q
++U+1D563           𝕣            \bbr                                         MATHEMATICAL DOUBLE-STRUCK SMALL R
++U+1D564           𝕤            \bbs                                         MATHEMATICAL DOUBLE-STRUCK SMALL S
++U+1D565           𝕥            \bbt                                         MATHEMATICAL DOUBLE-STRUCK SMALL T
++U+1D566           𝕦            \bbu                                         MATHEMATICAL DOUBLE-STRUCK SMALL U
++U+1D567           𝕧            \bbv                                         MATHEMATICAL DOUBLE-STRUCK SMALL V
++U+1D568           𝕨            \bbw                                         MATHEMATICAL DOUBLE-STRUCK SMALL W
++U+1D569           𝕩            \bbx                                         MATHEMATICAL DOUBLE-STRUCK SMALL X
++U+1D56A           𝕪            \bby                                         MATHEMATICAL DOUBLE-STRUCK SMALL Y
++U+1D56B           𝕫            \bbz                                         MATHEMATICAL DOUBLE-STRUCK SMALL Z
++U+1D56C           𝕬            \bfrakA                                      MATHEMATICAL BOLD FRAKTUR CAPITAL A
++U+1D56D           𝕭            \bfrakB                                      MATHEMATICAL BOLD FRAKTUR CAPITAL B
++U+1D56E           𝕮            \bfrakC                                      MATHEMATICAL BOLD FRAKTUR CAPITAL C
++U+1D56F           𝕯            \bfrakD                                      MATHEMATICAL BOLD FRAKTUR CAPITAL D
++U+1D570           𝕰            \bfrakE                                      MATHEMATICAL BOLD FRAKTUR CAPITAL E
++U+1D571           𝕱            \bfrakF                                      MATHEMATICAL BOLD FRAKTUR CAPITAL F
++U+1D572           𝕲            \bfrakG                                      MATHEMATICAL BOLD FRAKTUR CAPITAL G
++U+1D573           𝕳            \bfrakH                                      MATHEMATICAL BOLD FRAKTUR CAPITAL H
++U+1D574           𝕴            \bfrakI                                      MATHEMATICAL BOLD FRAKTUR CAPITAL I
++U+1D575           𝕵            \bfrakJ                                      MATHEMATICAL BOLD FRAKTUR CAPITAL J
++U+1D576           𝕶            \bfrakK                                      MATHEMATICAL BOLD FRAKTUR CAPITAL K
++U+1D577           𝕷            \bfrakL                                      MATHEMATICAL BOLD FRAKTUR CAPITAL L
++U+1D578           𝕸            \bfrakM                                      MATHEMATICAL BOLD FRAKTUR CAPITAL M
++U+1D579           𝕹            \bfrakN                                      MATHEMATICAL BOLD FRAKTUR CAPITAL N
++U+1D57A           𝕺            \bfrakO                                      MATHEMATICAL BOLD FRAKTUR CAPITAL O
++U+1D57B           𝕻            \bfrakP                                      MATHEMATICAL BOLD FRAKTUR CAPITAL P
++U+1D57C           𝕼            \bfrakQ                                      MATHEMATICAL BOLD FRAKTUR CAPITAL Q
++U+1D57D           𝕽            \bfrakR                                      MATHEMATICAL BOLD FRAKTUR CAPITAL R
++U+1D57E           𝕾            \bfrakS                                      MATHEMATICAL BOLD FRAKTUR CAPITAL S
++U+1D57F           𝕿            \bfrakT                                      MATHEMATICAL BOLD FRAKTUR CAPITAL T
++U+1D580           𝖀            \bfrakU                                      MATHEMATICAL BOLD FRAKTUR CAPITAL U
++U+1D581           𝖁            \bfrakV                                      MATHEMATICAL BOLD FRAKTUR CAPITAL V
++U+1D582           𝖂            \bfrakW                                      MATHEMATICAL BOLD FRAKTUR CAPITAL W
++U+1D583           𝖃            \bfrakX                                      MATHEMATICAL BOLD FRAKTUR CAPITAL X
++U+1D584           𝖄            \bfrakY                                      MATHEMATICAL BOLD FRAKTUR CAPITAL Y
++U+1D585           𝖅            \bfrakZ                                      MATHEMATICAL BOLD FRAKTUR CAPITAL Z
++U+1D586           𝖆            \bfraka                                      MATHEMATICAL BOLD FRAKTUR SMALL A
++U+1D587           𝖇            \bfrakb                                      MATHEMATICAL BOLD FRAKTUR SMALL B
++U+1D588           𝖈            \bfrakc                                      MATHEMATICAL BOLD FRAKTUR SMALL C
++U+1D589           𝖉            \bfrakd                                      MATHEMATICAL BOLD FRAKTUR SMALL D
++U+1D58A           𝖊            \bfrake                                      MATHEMATICAL BOLD FRAKTUR SMALL E
++U+1D58B           𝖋            \bfrakf                                      MATHEMATICAL BOLD FRAKTUR SMALL F
++U+1D58C           𝖌            \bfrakg                                      MATHEMATICAL BOLD FRAKTUR SMALL G
++U+1D58D           𝖍            \bfrakh                                      MATHEMATICAL BOLD FRAKTUR SMALL H
++U+1D58E           𝖎            \bfraki                                      MATHEMATICAL BOLD FRAKTUR SMALL I
++U+1D58F           𝖏            \bfrakj                                      MATHEMATICAL BOLD FRAKTUR SMALL J
++U+1D590           𝖐            \bfrakk                                      MATHEMATICAL BOLD FRAKTUR SMALL K
++U+1D591           𝖑            \bfrakl                                      MATHEMATICAL BOLD FRAKTUR SMALL L
++U+1D592           𝖒            \bfrakm                                      MATHEMATICAL BOLD FRAKTUR SMALL M
++U+1D593           𝖓            \bfrakn                                      MATHEMATICAL BOLD FRAKTUR SMALL N
++U+1D594           𝖔            \bfrako                                      MATHEMATICAL BOLD FRAKTUR SMALL O
++U+1D595           𝖕            \bfrakp                                      MATHEMATICAL BOLD FRAKTUR SMALL P
++U+1D596           𝖖            \bfrakq                                      MATHEMATICAL BOLD FRAKTUR SMALL Q
++U+1D597           𝖗            \bfrakr                                      MATHEMATICAL BOLD FRAKTUR SMALL R
++U+1D598           𝖘            \bfraks                                      MATHEMATICAL BOLD FRAKTUR SMALL S
++U+1D599           𝖙            \bfrakt                                      MATHEMATICAL BOLD FRAKTUR SMALL T
++U+1D59A           𝖚            \bfraku                                      MATHEMATICAL BOLD FRAKTUR SMALL U
++U+1D59B           𝖛            \bfrakv                                      MATHEMATICAL BOLD FRAKTUR SMALL V
++U+1D59C           𝖜            \bfrakw                                      MATHEMATICAL BOLD FRAKTUR SMALL W
++U+1D59D           𝖝            \bfrakx                                      MATHEMATICAL BOLD FRAKTUR SMALL X
++U+1D59E           𝖞            \bfraky                                      MATHEMATICAL BOLD FRAKTUR SMALL Y
++U+1D59F           𝖟            \bfrakz                                      MATHEMATICAL BOLD FRAKTUR SMALL Z
++U+1D5A0           𝖠            \sansA                                       MATHEMATICAL SANS-SERIF CAPITAL A
++U+1D5A1           𝖡            \sansB                                       MATHEMATICAL SANS-SERIF CAPITAL B
++U+1D5A2           𝖢            \sansC                                       MATHEMATICAL SANS-SERIF CAPITAL C
++U+1D5A3           𝖣            \sansD                                       MATHEMATICAL SANS-SERIF CAPITAL D
++U+1D5A4           𝖤            \sansE                                       MATHEMATICAL SANS-SERIF CAPITAL E
++U+1D5A5           𝖥            \sansF                                       MATHEMATICAL SANS-SERIF CAPITAL F
++U+1D5A6           𝖦            \sansG                                       MATHEMATICAL SANS-SERIF CAPITAL G
++U+1D5A7           𝖧            \sansH                                       MATHEMATICAL SANS-SERIF CAPITAL H
++U+1D5A8           𝖨            \sansI                                       MATHEMATICAL SANS-SERIF CAPITAL I
++U+1D5A9           𝖩            \sansJ                                       MATHEMATICAL SANS-SERIF CAPITAL J
++U+1D5AA           𝖪            \sansK                                       MATHEMATICAL SANS-SERIF CAPITAL K
++U+1D5AB           𝖫            \sansL                                       MATHEMATICAL SANS-SERIF CAPITAL L
++U+1D5AC           𝖬            \sansM                                       MATHEMATICAL SANS-SERIF CAPITAL M
++U+1D5AD           𝖭            \sansN                                       MATHEMATICAL SANS-SERIF CAPITAL N
++U+1D5AE           𝖮            \sansO                                       MATHEMATICAL SANS-SERIF CAPITAL O
++U+1D5AF           𝖯            \sansP                                       MATHEMATICAL SANS-SERIF CAPITAL P
++U+1D5B0           𝖰            \sansQ                                       MATHEMATICAL SANS-SERIF CAPITAL Q
++U+1D5B1           𝖱            \sansR                                       MATHEMATICAL SANS-SERIF CAPITAL R
++U+1D5B2           𝖲            \sansS                                       MATHEMATICAL SANS-SERIF CAPITAL S
++U+1D5B3           𝖳            \sansT                                       MATHEMATICAL SANS-SERIF CAPITAL T
++U+1D5B4           𝖴            \sansU                                       MATHEMATICAL SANS-SERIF CAPITAL U
++U+1D5B5           𝖵            \sansV                                       MATHEMATICAL SANS-SERIF CAPITAL V
++U+1D5B6           𝖶            \sansW                                       MATHEMATICAL SANS-SERIF CAPITAL W
++U+1D5B7           𝖷            \sansX                                       MATHEMATICAL SANS-SERIF CAPITAL X
++U+1D5B8           𝖸            \sansY                                       MATHEMATICAL SANS-SERIF CAPITAL Y
++U+1D5B9           𝖹            \sansZ                                       MATHEMATICAL SANS-SERIF CAPITAL Z
++U+1D5BA           𝖺            \sansa                                       MATHEMATICAL SANS-SERIF SMALL A
++U+1D5BB           𝖻            \sansb                                       MATHEMATICAL SANS-SERIF SMALL B
++U+1D5BC           𝖼            \sansc                                       MATHEMATICAL SANS-SERIF SMALL C
++U+1D5BD           𝖽            \sansd                                       MATHEMATICAL SANS-SERIF SMALL D
++U+1D5BE           𝖾            \sanse                                       MATHEMATICAL SANS-SERIF SMALL E
++U+1D5BF           𝖿            \sansf                                       MATHEMATICAL SANS-SERIF SMALL F
++U+1D5C0           𝗀            \sansg                                       MATHEMATICAL SANS-SERIF SMALL G
++U+1D5C1           𝗁            \sansh                                       MATHEMATICAL SANS-SERIF SMALL H
++U+1D5C2           𝗂            \sansi                                       MATHEMATICAL SANS-SERIF SMALL I
++U+1D5C3           𝗃            \sansj                                       MATHEMATICAL SANS-SERIF SMALL J
++U+1D5C4           𝗄            \sansk                                       MATHEMATICAL SANS-SERIF SMALL K
++U+1D5C5           𝗅            \sansl                                       MATHEMATICAL SANS-SERIF SMALL L
++U+1D5C6           𝗆            \sansm                                       MATHEMATICAL SANS-SERIF SMALL M
++U+1D5C7           𝗇            \sansn                                       MATHEMATICAL SANS-SERIF SMALL N
++U+1D5C8           𝗈            \sanso                                       MATHEMATICAL SANS-SERIF SMALL O
++U+1D5C9           𝗉            \sansp                                       MATHEMATICAL SANS-SERIF SMALL P
++U+1D5CA           𝗊            \sansq                                       MATHEMATICAL SANS-SERIF SMALL Q
++U+1D5CB           𝗋            \sansr                                       MATHEMATICAL SANS-SERIF SMALL R
++U+1D5CC           𝗌            \sanss                                       MATHEMATICAL SANS-SERIF SMALL S
++U+1D5CD           𝗍            \sanst                                       MATHEMATICAL SANS-SERIF SMALL T
++U+1D5CE           𝗎            \sansu                                       MATHEMATICAL SANS-SERIF SMALL U
++U+1D5CF           𝗏            \sansv                                       MATHEMATICAL SANS-SERIF SMALL V
++U+1D5D0           𝗐            \sansw                                       MATHEMATICAL SANS-SERIF SMALL W
++U+1D5D1           𝗑            \sansx                                       MATHEMATICAL SANS-SERIF SMALL X
++U+1D5D2           𝗒            \sansy                                       MATHEMATICAL SANS-SERIF SMALL Y
++U+1D5D3           𝗓            \sansz                                       MATHEMATICAL SANS-SERIF SMALL Z
++U+1D5D4           𝗔            \bsansA                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL A
++U+1D5D5           𝗕            \bsansB                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL B
++U+1D5D6           𝗖            \bsansC                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL C
++U+1D5D7           𝗗            \bsansD                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL D
++U+1D5D8           𝗘            \bsansE                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL E
++U+1D5D9           𝗙            \bsansF                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL F
++U+1D5DA           𝗚            \bsansG                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL G
++U+1D5DB           𝗛            \bsansH                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL H
++U+1D5DC           𝗜            \bsansI                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL I
++U+1D5DD           𝗝            \bsansJ                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL J
++U+1D5DE           𝗞            \bsansK                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL K
++U+1D5DF           𝗟            \bsansL                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL L
++U+1D5E0           𝗠            \bsansM                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL M
++U+1D5E1           𝗡            \bsansN                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL N
++U+1D5E2           𝗢            \bsansO                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL O
++U+1D5E3           𝗣            \bsansP                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL P
++U+1D5E4           𝗤            \bsansQ                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL Q
++U+1D5E5           𝗥            \bsansR                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL R
++U+1D5E6           𝗦            \bsansS                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL S
++U+1D5E7           𝗧            \bsansT                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL T
++U+1D5E8           𝗨            \bsansU                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL U
++U+1D5E9           𝗩            \bsansV                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL V
++U+1D5EA           𝗪            \bsansW                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL W
++U+1D5EB           𝗫            \bsansX                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL X
++U+1D5EC           𝗬            \bsansY                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL Y
++U+1D5ED           𝗭            \bsansZ                                      MATHEMATICAL SANS-SERIF BOLD CAPITAL Z
++U+1D5EE           𝗮            \bsansa                                      MATHEMATICAL SANS-SERIF BOLD SMALL A
++U+1D5EF           𝗯            \bsansb                                      MATHEMATICAL SANS-SERIF BOLD SMALL B
++U+1D5F0           𝗰            \bsansc                                      MATHEMATICAL SANS-SERIF BOLD SMALL C
++U+1D5F1           𝗱            \bsansd                                      MATHEMATICAL SANS-SERIF BOLD SMALL D
++U+1D5F2           𝗲            \bsanse                                      MATHEMATICAL SANS-SERIF BOLD SMALL E
++U+1D5F3           𝗳            \bsansf                                      MATHEMATICAL SANS-SERIF BOLD SMALL F
++U+1D5F4           𝗴            \bsansg                                      MATHEMATICAL SANS-SERIF BOLD SMALL G
++U+1D5F5           𝗵            \bsansh                                      MATHEMATICAL SANS-SERIF BOLD SMALL H
++U+1D5F6           𝗶            \bsansi                                      MATHEMATICAL SANS-SERIF BOLD SMALL I
++U+1D5F7           𝗷            \bsansj                                      MATHEMATICAL SANS-SERIF BOLD SMALL J
++U+1D5F8           𝗸            \bsansk                                      MATHEMATICAL SANS-SERIF BOLD SMALL K
++U+1D5F9           𝗹            \bsansl                                      MATHEMATICAL SANS-SERIF BOLD SMALL L
++U+1D5FA           𝗺            \bsansm                                      MATHEMATICAL SANS-SERIF BOLD SMALL M
++U+1D5FB           𝗻            \bsansn                                      MATHEMATICAL SANS-SERIF BOLD SMALL N
++U+1D5FC           𝗼            \bsanso                                      MATHEMATICAL SANS-SERIF BOLD SMALL O
++U+1D5FD           𝗽            \bsansp                                      MATHEMATICAL SANS-SERIF BOLD SMALL P
++U+1D5FE           𝗾            \bsansq                                      MATHEMATICAL SANS-SERIF BOLD SMALL Q
++U+1D5FF           𝗿            \bsansr                                      MATHEMATICAL SANS-SERIF BOLD SMALL R
++U+1D600           𝘀            \bsanss                                      MATHEMATICAL SANS-SERIF BOLD SMALL S
++U+1D601           𝘁            \bsanst                                      MATHEMATICAL SANS-SERIF BOLD SMALL T
++U+1D602           𝘂            \bsansu                                      MATHEMATICAL SANS-SERIF BOLD SMALL U
++U+1D603           𝘃            \bsansv                                      MATHEMATICAL SANS-SERIF BOLD SMALL V
++U+1D604           𝘄            \bsansw                                      MATHEMATICAL SANS-SERIF BOLD SMALL W
++U+1D605           𝘅            \bsansx                                      MATHEMATICAL SANS-SERIF BOLD SMALL X
++U+1D606           𝘆            \bsansy                                      MATHEMATICAL SANS-SERIF BOLD SMALL Y
++U+1D607           𝘇            \bsansz                                      MATHEMATICAL SANS-SERIF BOLD SMALL Z
++U+1D608           𝘈            \isansA                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL A
++U+1D609           𝘉            \isansB                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL B
++U+1D60A           𝘊            \isansC                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL C
++U+1D60B           𝘋            \isansD                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL D
++U+1D60C           𝘌            \isansE                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL E
++U+1D60D           𝘍            \isansF                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL F
++U+1D60E           𝘎            \isansG                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL G
++U+1D60F           𝘏            \isansH                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL H
++U+1D610           𝘐            \isansI                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL I
++U+1D611           𝘑            \isansJ                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL J
++U+1D612           𝘒            \isansK                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL K
++U+1D613           𝘓            \isansL                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL L
++U+1D614           𝘔            \isansM                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL M
++U+1D615           𝘕            \isansN                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL N
++U+1D616           𝘖            \isansO                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL O
++U+1D617           𝘗            \isansP                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL P
++U+1D618           𝘘            \isansQ                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL Q
++U+1D619           𝘙            \isansR                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL R
++U+1D61A           𝘚            \isansS                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL S
++U+1D61B           𝘛            \isansT                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL T
++U+1D61C           𝘜            \isansU                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL U
++U+1D61D           𝘝            \isansV                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL V
++U+1D61E           𝘞            \isansW                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL W
++U+1D61F           𝘟            \isansX                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL X
++U+1D620           𝘠            \isansY                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL Y
++U+1D621           𝘡            \isansZ                                      MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z
++U+1D622           𝘢            \isansa                                      MATHEMATICAL SANS-SERIF ITALIC SMALL A
++U+1D623           𝘣            \isansb                                      MATHEMATICAL SANS-SERIF ITALIC SMALL B
++U+1D624           𝘤            \isansc                                      MATHEMATICAL SANS-SERIF ITALIC SMALL C
++U+1D625           𝘥            \isansd                                      MATHEMATICAL SANS-SERIF ITALIC SMALL D
++U+1D626           𝘦            \isanse                                      MATHEMATICAL SANS-SERIF ITALIC SMALL E
++U+1D627           𝘧            \isansf                                      MATHEMATICAL SANS-SERIF ITALIC SMALL F
++U+1D628           𝘨            \isansg                                      MATHEMATICAL SANS-SERIF ITALIC SMALL G
++U+1D629           𝘩            \isansh                                      MATHEMATICAL SANS-SERIF ITALIC SMALL H
++U+1D62A           𝘪            \isansi                                      MATHEMATICAL SANS-SERIF ITALIC SMALL I
++U+1D62B           𝘫            \isansj                                      MATHEMATICAL SANS-SERIF ITALIC SMALL J
++U+1D62C           𝘬            \isansk                                      MATHEMATICAL SANS-SERIF ITALIC SMALL K
++U+1D62D           𝘭            \isansl                                      MATHEMATICAL SANS-SERIF ITALIC SMALL L
++U+1D62E           𝘮            \isansm                                      MATHEMATICAL SANS-SERIF ITALIC SMALL M
++U+1D62F           𝘯            \isansn                                      MATHEMATICAL SANS-SERIF ITALIC SMALL N
++U+1D630           𝘰            \isanso                                      MATHEMATICAL SANS-SERIF ITALIC SMALL O
++U+1D631           𝘱            \isansp                                      MATHEMATICAL SANS-SERIF ITALIC SMALL P
++U+1D632           𝘲            \isansq                                      MATHEMATICAL SANS-SERIF ITALIC SMALL Q
++U+1D633           𝘳            \isansr                                      MATHEMATICAL SANS-SERIF ITALIC SMALL R
++U+1D634           𝘴            \isanss                                      MATHEMATICAL SANS-SERIF ITALIC SMALL S
++U+1D635           𝘵            \isanst                                      MATHEMATICAL SANS-SERIF ITALIC SMALL T
++U+1D636           𝘶            \isansu                                      MATHEMATICAL SANS-SERIF ITALIC SMALL U
++U+1D637           𝘷            \isansv                                      MATHEMATICAL SANS-SERIF ITALIC SMALL V
++U+1D638           𝘸            \isansw                                      MATHEMATICAL SANS-SERIF ITALIC SMALL W
++U+1D639           𝘹            \isansx                                      MATHEMATICAL SANS-SERIF ITALIC SMALL X
++U+1D63A           𝘺            \isansy                                      MATHEMATICAL SANS-SERIF ITALIC SMALL Y
++U+1D63B           𝘻            \isansz                                      MATHEMATICAL SANS-SERIF ITALIC SMALL Z
++U+1D63C           𝘼            \bisansA                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A
++U+1D63D           𝘽            \bisansB                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B
++U+1D63E           𝘾            \bisansC                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C
++U+1D63F           𝘿            \bisansD                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D
++U+1D640           𝙀            \bisansE                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E
++U+1D641           𝙁            \bisansF                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL F
++U+1D642           𝙂            \bisansG                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G
++U+1D643           𝙃            \bisansH                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL H
++U+1D644           𝙄            \bisansI                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I
++U+1D645           𝙅            \bisansJ                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL J
++U+1D646           𝙆            \bisansK                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K
++U+1D647           𝙇            \bisansL                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L
++U+1D648           𝙈            \bisansM                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M
++U+1D649           𝙉            \bisansN                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N
++U+1D64A           𝙊            \bisansO                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O
++U+1D64B           𝙋            \bisansP                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P
++U+1D64C           𝙌            \bisansQ                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Q
++U+1D64D           𝙍            \bisansR                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R
++U+1D64E           𝙎            \bisansS                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S
++U+1D64F           𝙏            \bisansT                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T
++U+1D650           𝙐            \bisansU                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U
++U+1D651           𝙑            \bisansV                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL V
++U+1D652           𝙒            \bisansW                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL W
++U+1D653           𝙓            \bisansX                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X
++U+1D654           𝙔            \bisansY                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Y
++U+1D655           𝙕            \bisansZ                                     MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z
++U+1D656           𝙖            \bisansa                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A
++U+1D657           𝙗            \bisansb                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B
++U+1D658           𝙘            \bisansc                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C
++U+1D659           𝙙            \bisansd                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D
++U+1D65A           𝙚            \bisanse                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E
++U+1D65B           𝙛            \bisansf                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL F
++U+1D65C           𝙜            \bisansg                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G
++U+1D65D           𝙝            \bisansh                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL H
++U+1D65E           𝙞            \bisansi                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I
++U+1D65F           𝙟            \bisansj                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J
++U+1D660           𝙠            \bisansk                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K
++U+1D661           𝙡            \bisansl                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L
++U+1D662           𝙢            \bisansm                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M
++U+1D663           𝙣            \bisansn                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N
++U+1D664           𝙤            \bisanso                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O
++U+1D665           𝙥            \bisansp                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P
++U+1D666           𝙦            \bisansq                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Q
++U+1D667           𝙧            \bisansr                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R
++U+1D668           𝙨            \bisanss                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S
++U+1D669           𝙩            \bisanst                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T
++U+1D66A           𝙪            \bisansu                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U
++U+1D66B           𝙫            \bisansv                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V
++U+1D66C           𝙬            \bisansw                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL W
++U+1D66D           𝙭            \bisansx                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X
++U+1D66E           𝙮            \bisansy                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y
++U+1D66F           𝙯            \bisansz                                     MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z
++U+1D670           𝙰            \ttA                                         MATHEMATICAL MONOSPACE CAPITAL A
++U+1D671           𝙱            \ttB                                         MATHEMATICAL MONOSPACE CAPITAL B
++U+1D672           𝙲            \ttC                                         MATHEMATICAL MONOSPACE CAPITAL C
++U+1D673           𝙳            \ttD                                         MATHEMATICAL MONOSPACE CAPITAL D
++U+1D674           𝙴            \ttE                                         MATHEMATICAL MONOSPACE CAPITAL E
++U+1D675           𝙵            \ttF                                         MATHEMATICAL MONOSPACE CAPITAL F
++U+1D676           𝙶            \ttG                                         MATHEMATICAL MONOSPACE CAPITAL G
++U+1D677           𝙷            \ttH                                         MATHEMATICAL MONOSPACE CAPITAL H
++U+1D678           𝙸            \ttI                                         MATHEMATICAL MONOSPACE CAPITAL I
++U+1D679           𝙹            \ttJ                                         MATHEMATICAL MONOSPACE CAPITAL J
++U+1D67A           𝙺            \ttK                                         MATHEMATICAL MONOSPACE CAPITAL K
++U+1D67B           𝙻            \ttL                                         MATHEMATICAL MONOSPACE CAPITAL L
++U+1D67C           𝙼            \ttM                                         MATHEMATICAL MONOSPACE CAPITAL M
++U+1D67D           𝙽            \ttN                                         MATHEMATICAL MONOSPACE CAPITAL N
++U+1D67E           𝙾            \ttO                                         MATHEMATICAL MONOSPACE CAPITAL O
++U+1D67F           𝙿            \ttP                                         MATHEMATICAL MONOSPACE CAPITAL P
++U+1D680           𝚀            \ttQ                                         MATHEMATICAL MONOSPACE CAPITAL Q
++U+1D681           𝚁            \ttR                                         MATHEMATICAL MONOSPACE CAPITAL R
++U+1D682           𝚂            \ttS                                         MATHEMATICAL MONOSPACE CAPITAL S
++U+1D683           𝚃            \ttT                                         MATHEMATICAL MONOSPACE CAPITAL T
++U+1D684           𝚄            \ttU                                         MATHEMATICAL MONOSPACE CAPITAL U
++U+1D685           𝚅            \ttV                                         MATHEMATICAL MONOSPACE CAPITAL V
++U+1D686           𝚆            \ttW                                         MATHEMATICAL MONOSPACE CAPITAL W
++U+1D687           𝚇            \ttX                                         MATHEMATICAL MONOSPACE CAPITAL X
++U+1D688           𝚈            \ttY                                         MATHEMATICAL MONOSPACE CAPITAL Y
++U+1D689           𝚉            \ttZ                                         MATHEMATICAL MONOSPACE CAPITAL Z
++U+1D68A           𝚊            \tta                                         MATHEMATICAL MONOSPACE SMALL A
++U+1D68B           𝚋            \ttb                                         MATHEMATICAL MONOSPACE SMALL B
++U+1D68C           𝚌            \ttc                                         MATHEMATICAL MONOSPACE SMALL C
++U+1D68D           𝚍            \ttd                                         MATHEMATICAL MONOSPACE SMALL D
++U+1D68E           𝚎            \tte                                         MATHEMATICAL MONOSPACE SMALL E
++U+1D68F           𝚏            \ttf                                         MATHEMATICAL MONOSPACE SMALL F
++U+1D690           𝚐            \ttg                                         MATHEMATICAL MONOSPACE SMALL G
++U+1D691           𝚑            \tth                                         MATHEMATICAL MONOSPACE SMALL H
++U+1D692           𝚒            \tti                                         MATHEMATICAL MONOSPACE SMALL I
++U+1D693           𝚓            \ttj                                         MATHEMATICAL MONOSPACE SMALL J
++U+1D694           𝚔            \ttk                                         MATHEMATICAL MONOSPACE SMALL K
++U+1D695           𝚕            \ttl                                         MATHEMATICAL MONOSPACE SMALL L
++U+1D696           𝚖            \ttm                                         MATHEMATICAL MONOSPACE SMALL M
++U+1D697           𝚗            \ttn                                         MATHEMATICAL MONOSPACE SMALL N
++U+1D698           𝚘            \tto                                         MATHEMATICAL MONOSPACE SMALL O
++U+1D699           𝚙            \ttp                                         MATHEMATICAL MONOSPACE SMALL P
++U+1D69A           𝚚            \ttq                                         MATHEMATICAL MONOSPACE SMALL Q
++U+1D69B           𝚛            \ttr                                         MATHEMATICAL MONOSPACE SMALL R
++U+1D69C           𝚜            \tts                                         MATHEMATICAL MONOSPACE SMALL S
++U+1D69D           𝚝            \ttt                                         MATHEMATICAL MONOSPACE SMALL T
++U+1D69E           𝚞            \ttu                                         MATHEMATICAL MONOSPACE SMALL U
++U+1D69F           𝚟            \ttv                                         MATHEMATICAL MONOSPACE SMALL V
++U+1D6A0           𝚠            \ttw                                         MATHEMATICAL MONOSPACE SMALL W
++U+1D6A1           𝚡            \ttx                                         MATHEMATICAL MONOSPACE SMALL X
++U+1D6A2           𝚢            \tty                                         MATHEMATICAL MONOSPACE SMALL Y
++U+1D6A3           𝚣            \ttz                                         MATHEMATICAL MONOSPACE SMALL Z
++U+1D6A4           𝚤            \itimath                                     MATHEMATICAL ITALIC SMALL DOTLESS I
++U+1D6A5           𝚥            \itjmath                                     MATHEMATICAL ITALIC SMALL DOTLESS J
++U+1D6A8           𝚨            \bfAlpha                                     MATHEMATICAL BOLD CAPITAL ALPHA
++U+1D6A9           𝚩            \bfBeta                                      MATHEMATICAL BOLD CAPITAL BETA
++U+1D6AA           𝚪            \bfGamma                                     MATHEMATICAL BOLD CAPITAL GAMMA
++U+1D6AB           𝚫            \bfDelta                                     MATHEMATICAL BOLD CAPITAL DELTA
++U+1D6AC           𝚬            \bfEpsilon                                   MATHEMATICAL BOLD CAPITAL EPSILON
++U+1D6AD           𝚭            \bfZeta                                      MATHEMATICAL BOLD CAPITAL ZETA
++U+1D6AE           𝚮            \bfEta                                       MATHEMATICAL BOLD CAPITAL ETA
++U+1D6AF           𝚯            \bfTheta                                     MATHEMATICAL BOLD CAPITAL THETA
++U+1D6B0           𝚰            \bfIota                                      MATHEMATICAL BOLD CAPITAL IOTA
++U+1D6B1           𝚱            \bfKappa                                     MATHEMATICAL BOLD CAPITAL KAPPA
++U+1D6B2           𝚲            \bfLambda                                    MATHEMATICAL BOLD CAPITAL LAMDA
++U+1D6B3           𝚳            \bfMu                                        MATHEMATICAL BOLD CAPITAL MU
++U+1D6B4           𝚴            \bfNu                                        MATHEMATICAL BOLD CAPITAL NU
++U+1D6B5           𝚵            \bfXi                                        MATHEMATICAL BOLD CAPITAL XI
++U+1D6B6           𝚶            \bfOmicron                                   MATHEMATICAL BOLD CAPITAL OMICRON
++U+1D6B7           𝚷            \bfPi                                        MATHEMATICAL BOLD CAPITAL PI
++U+1D6B8           𝚸            \bfRho                                       MATHEMATICAL BOLD CAPITAL RHO
++U+1D6B9           𝚹            \bfvarTheta                                  MATHEMATICAL BOLD CAPITAL THETA SYMBOL
++U+1D6BA           𝚺            \bfSigma                                     MATHEMATICAL BOLD CAPITAL SIGMA
++U+1D6BB           𝚻            \bfTau                                       MATHEMATICAL BOLD CAPITAL TAU
++U+1D6BC           𝚼            \bfUpsilon                                   MATHEMATICAL BOLD CAPITAL UPSILON
++U+1D6BD           𝚽            \bfPhi                                       MATHEMATICAL BOLD CAPITAL PHI
++U+1D6BE           𝚾            \bfChi                                       MATHEMATICAL BOLD CAPITAL CHI
++U+1D6BF           𝚿            \bfPsi                                       MATHEMATICAL BOLD CAPITAL PSI
++U+1D6C0           𝛀            \bfOmega                                     MATHEMATICAL BOLD CAPITAL OMEGA
++U+1D6C1           𝛁            \bfnabla                                     MATHEMATICAL BOLD NABLA
++U+1D6C2           𝛂            \bfalpha                                     MATHEMATICAL BOLD SMALL ALPHA
++U+1D6C3           𝛃            \bfbeta                                      MATHEMATICAL BOLD SMALL BETA
++U+1D6C4           𝛄            \bfgamma                                     MATHEMATICAL BOLD SMALL GAMMA
++U+1D6C5           𝛅            \bfdelta                                     MATHEMATICAL BOLD SMALL DELTA
++U+1D6C6           𝛆            \bfepsilon                                   MATHEMATICAL BOLD SMALL EPSILON
++U+1D6C7           𝛇            \bfzeta                                      MATHEMATICAL BOLD SMALL ZETA
++U+1D6C8           𝛈            \bfeta                                       MATHEMATICAL BOLD SMALL ETA
++U+1D6C9           𝛉            \bftheta                                     MATHEMATICAL BOLD SMALL THETA
++U+1D6CA           𝛊            \bfiota                                      MATHEMATICAL BOLD SMALL IOTA
++U+1D6CB           𝛋            \bfkappa                                     MATHEMATICAL BOLD SMALL KAPPA
++U+1D6CC           𝛌            \bflambda                                    MATHEMATICAL BOLD SMALL LAMDA
++U+1D6CD           𝛍            \bfmu                                        MATHEMATICAL BOLD SMALL MU
++U+1D6CE           𝛎            \bfnu                                        MATHEMATICAL BOLD SMALL NU
++U+1D6CF           𝛏            \bfxi                                        MATHEMATICAL BOLD SMALL XI
++U+1D6D0           𝛐            \bfomicron                                   MATHEMATICAL BOLD SMALL OMICRON
++U+1D6D1           𝛑            \bfpi                                        MATHEMATICAL BOLD SMALL PI
++U+1D6D2           𝛒            \bfrho                                       MATHEMATICAL BOLD SMALL RHO
++U+1D6D3           𝛓            \bfvarsigma                                  MATHEMATICAL BOLD SMALL FINAL SIGMA
++U+1D6D4           𝛔            \bfsigma                                     MATHEMATICAL BOLD SMALL SIGMA
++U+1D6D5           𝛕            \bftau                                       MATHEMATICAL BOLD SMALL TAU
++U+1D6D6           𝛖            \bfupsilon                                   MATHEMATICAL BOLD SMALL UPSILON
++U+1D6D7           𝛗            \bfvarphi                                    MATHEMATICAL BOLD SMALL PHI
++U+1D6D8           𝛘            \bfchi                                       MATHEMATICAL BOLD SMALL CHI
++U+1D6D9           𝛙            \bfpsi                                       MATHEMATICAL BOLD SMALL PSI
++U+1D6DA           𝛚            \bfomega                                     MATHEMATICAL BOLD SMALL OMEGA
++U+1D6DB           𝛛            \bfpartial                                   MATHEMATICAL BOLD PARTIAL DIFFERENTIAL
++U+1D6DC           𝛜            \bfvarepsilon                                MATHEMATICAL BOLD EPSILON SYMBOL
++U+1D6DD           𝛝            \bfvartheta                                  MATHEMATICAL BOLD THETA SYMBOL
++U+1D6DE           𝛞            \bfvarkappa                                  MATHEMATICAL BOLD KAPPA SYMBOL
++U+1D6DF           𝛟            \bfphi                                       MATHEMATICAL BOLD PHI SYMBOL
++U+1D6E0           𝛠            \bfvarrho                                    MATHEMATICAL BOLD RHO SYMBOL
++U+1D6E1           𝛡            \bfvarpi                                     MATHEMATICAL BOLD PI SYMBOL
++U+1D6E2           𝛢            \itAlpha                                     MATHEMATICAL ITALIC CAPITAL ALPHA
++U+1D6E3           𝛣            \itBeta                                      MATHEMATICAL ITALIC CAPITAL BETA
++U+1D6E4           𝛤            \itGamma                                     MATHEMATICAL ITALIC CAPITAL GAMMA
++U+1D6E5           𝛥            \itDelta                                     MATHEMATICAL ITALIC CAPITAL DELTA
++U+1D6E6           𝛦            \itEpsilon                                   MATHEMATICAL ITALIC CAPITAL EPSILON
++U+1D6E7           𝛧            \itZeta                                      MATHEMATICAL ITALIC CAPITAL ZETA
++U+1D6E8           𝛨            \itEta                                       MATHEMATICAL ITALIC CAPITAL ETA
++U+1D6E9           𝛩            \itTheta                                     MATHEMATICAL ITALIC CAPITAL THETA
++U+1D6EA           𝛪            \itIota                                      MATHEMATICAL ITALIC CAPITAL IOTA
++U+1D6EB           𝛫            \itKappa                                     MATHEMATICAL ITALIC CAPITAL KAPPA
++U+1D6EC           𝛬            \itLambda                                    MATHEMATICAL ITALIC CAPITAL LAMDA
++U+1D6ED           𝛭            \itMu                                        MATHEMATICAL ITALIC CAPITAL MU
++U+1D6EE           𝛮            \itNu                                        MATHEMATICAL ITALIC CAPITAL NU
++U+1D6EF           𝛯            \itXi                                        MATHEMATICAL ITALIC CAPITAL XI
++U+1D6F0           𝛰            \itOmicron                                   MATHEMATICAL ITALIC CAPITAL OMICRON
++U+1D6F1           𝛱            \itPi                                        MATHEMATICAL ITALIC CAPITAL PI
++U+1D6F2           𝛲            \itRho                                       MATHEMATICAL ITALIC CAPITAL RHO
++U+1D6F3           𝛳            \itvarTheta                                  MATHEMATICAL ITALIC CAPITAL THETA SYMBOL
++U+1D6F4           𝛴            \itSigma                                     MATHEMATICAL ITALIC CAPITAL SIGMA
++U+1D6F5           𝛵            \itTau                                       MATHEMATICAL ITALIC CAPITAL TAU
++U+1D6F6           𝛶            \itUpsilon                                   MATHEMATICAL ITALIC CAPITAL UPSILON
++U+1D6F7           𝛷            \itPhi                                       MATHEMATICAL ITALIC CAPITAL PHI
++U+1D6F8           𝛸            \itChi                                       MATHEMATICAL ITALIC CAPITAL CHI
++U+1D6F9           𝛹            \itPsi                                       MATHEMATICAL ITALIC CAPITAL PSI
++U+1D6FA           𝛺            \itOmega                                     MATHEMATICAL ITALIC CAPITAL OMEGA
++U+1D6FB           𝛻            \itnabla                                     MATHEMATICAL ITALIC NABLA
++U+1D6FC           𝛼            \italpha                                     MATHEMATICAL ITALIC SMALL ALPHA
++U+1D6FD           𝛽            \itbeta                                      MATHEMATICAL ITALIC SMALL BETA
++U+1D6FE           𝛾            \itgamma                                     MATHEMATICAL ITALIC SMALL GAMMA
++U+1D6FF           𝛿            \itdelta                                     MATHEMATICAL ITALIC SMALL DELTA
++U+1D700           𝜀            \itepsilon                                   MATHEMATICAL ITALIC SMALL EPSILON
++U+1D701           𝜁            \itzeta                                      MATHEMATICAL ITALIC SMALL ZETA
++U+1D702           𝜂            \iteta                                       MATHEMATICAL ITALIC SMALL ETA
++U+1D703           𝜃            \ittheta                                     MATHEMATICAL ITALIC SMALL THETA
++U+1D704           𝜄            \itiota                                      MATHEMATICAL ITALIC SMALL IOTA
++U+1D705           𝜅            \itkappa                                     MATHEMATICAL ITALIC SMALL KAPPA
++U+1D706           𝜆            \itlambda                                    MATHEMATICAL ITALIC SMALL LAMDA
++U+1D707           𝜇            \itmu                                        MATHEMATICAL ITALIC SMALL MU
++U+1D708           𝜈            \itnu                                        MATHEMATICAL ITALIC SMALL NU
++U+1D709           𝜉            \itxi                                        MATHEMATICAL ITALIC SMALL XI
++U+1D70A           𝜊            \itomicron                                   MATHEMATICAL ITALIC SMALL OMICRON
++U+1D70B           𝜋            \itpi                                        MATHEMATICAL ITALIC SMALL PI
++U+1D70C           𝜌            \itrho                                       MATHEMATICAL ITALIC SMALL RHO
++U+1D70D           𝜍            \itvarsigma                                  MATHEMATICAL ITALIC SMALL FINAL SIGMA
++U+1D70E           𝜎            \itsigma                                     MATHEMATICAL ITALIC SMALL SIGMA
++U+1D70F           𝜏            \ittau                                       MATHEMATICAL ITALIC SMALL TAU
++U+1D710           𝜐            \itupsilon                                   MATHEMATICAL ITALIC SMALL UPSILON
++U+1D711           𝜑            \itphi                                       MATHEMATICAL ITALIC SMALL PHI
++U+1D712           𝜒            \itchi                                       MATHEMATICAL ITALIC SMALL CHI
++U+1D713           𝜓            \itpsi                                       MATHEMATICAL ITALIC SMALL PSI
++U+1D714           𝜔            \itomega                                     MATHEMATICAL ITALIC SMALL OMEGA
++U+1D715           𝜕            \itpartial                                   MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL
++U+1D716           𝜖            \itvarepsilon                                MATHEMATICAL ITALIC EPSILON SYMBOL
++U+1D717           𝜗            \itvartheta                                  MATHEMATICAL ITALIC THETA SYMBOL
++U+1D718           𝜘            \itvarkappa                                  MATHEMATICAL ITALIC KAPPA SYMBOL
++U+1D719           𝜙            \itvarphi                                    MATHEMATICAL ITALIC PHI SYMBOL
++U+1D71A           𝜚            \itvarrho                                    MATHEMATICAL ITALIC RHO SYMBOL
++U+1D71B           𝜛            \itvarpi                                     MATHEMATICAL ITALIC PI SYMBOL
++U+1D71C           𝜜            \biAlpha                                     MATHEMATICAL BOLD ITALIC CAPITAL ALPHA
++U+1D71D           𝜝            \biBeta                                      MATHEMATICAL BOLD ITALIC CAPITAL BETA
++U+1D71E           𝜞            \biGamma                                     MATHEMATICAL BOLD ITALIC CAPITAL GAMMA
++U+1D71F           𝜟            \biDelta                                     MATHEMATICAL BOLD ITALIC CAPITAL DELTA
++U+1D720           𝜠            \biEpsilon                                   MATHEMATICAL BOLD ITALIC CAPITAL EPSILON
++U+1D721           𝜡            \biZeta                                      MATHEMATICAL BOLD ITALIC CAPITAL ZETA
++U+1D722           𝜢            \biEta                                       MATHEMATICAL BOLD ITALIC CAPITAL ETA
++U+1D723           𝜣            \biTheta                                     MATHEMATICAL BOLD ITALIC CAPITAL THETA
++U+1D724           𝜤            \biIota                                      MATHEMATICAL BOLD ITALIC CAPITAL IOTA
++U+1D725           𝜥            \biKappa                                     MATHEMATICAL BOLD ITALIC CAPITAL KAPPA
++U+1D726           𝜦            \biLambda                                    MATHEMATICAL BOLD ITALIC CAPITAL LAMDA
++U+1D727           𝜧            \biMu                                        MATHEMATICAL BOLD ITALIC CAPITAL MU
++U+1D728           𝜨            \biNu                                        MATHEMATICAL BOLD ITALIC CAPITAL NU
++U+1D729           𝜩            \biXi                                        MATHEMATICAL BOLD ITALIC CAPITAL XI
++U+1D72A           𝜪            \biOmicron                                   MATHEMATICAL BOLD ITALIC CAPITAL OMICRON
++U+1D72B           𝜫            \biPi                                        MATHEMATICAL BOLD ITALIC CAPITAL PI
++U+1D72C           𝜬            \biRho                                       MATHEMATICAL BOLD ITALIC CAPITAL RHO
++U+1D72D           𝜭            \bivarTheta                                  MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL
++U+1D72E           𝜮            \biSigma                                     MATHEMATICAL BOLD ITALIC CAPITAL SIGMA
++U+1D72F           𝜯            \biTau                                       MATHEMATICAL BOLD ITALIC CAPITAL TAU
++U+1D730           𝜰            \biUpsilon                                   MATHEMATICAL BOLD ITALIC CAPITAL UPSILON
++U+1D731           𝜱            \biPhi                                       MATHEMATICAL BOLD ITALIC CAPITAL PHI
++U+1D732           𝜲            \biChi                                       MATHEMATICAL BOLD ITALIC CAPITAL CHI
++U+1D733           𝜳            \biPsi                                       MATHEMATICAL BOLD ITALIC CAPITAL PSI
++U+1D734           𝜴            \biOmega                                     MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
++U+1D735           𝜵            \binabla                                     MATHEMATICAL BOLD ITALIC NABLA
++U+1D736           𝜶            \bialpha                                     MATHEMATICAL BOLD ITALIC SMALL ALPHA
++U+1D737           𝜷            \bibeta                                      MATHEMATICAL BOLD ITALIC SMALL BETA
++U+1D738           𝜸            \bigamma                                     MATHEMATICAL BOLD ITALIC SMALL GAMMA
++U+1D739           𝜹            \bidelta                                     MATHEMATICAL BOLD ITALIC SMALL DELTA
++U+1D73A           𝜺            \biepsilon                                   MATHEMATICAL BOLD ITALIC SMALL EPSILON
++U+1D73B           𝜻            \bizeta                                      MATHEMATICAL BOLD ITALIC SMALL ZETA
++U+1D73C           𝜼            \bieta                                       MATHEMATICAL BOLD ITALIC SMALL ETA
++U+1D73D           𝜽            \bitheta                                     MATHEMATICAL BOLD ITALIC SMALL THETA
++U+1D73E           𝜾            \biiota                                      MATHEMATICAL BOLD ITALIC SMALL IOTA
++U+1D73F           𝜿            \bikappa                                     MATHEMATICAL BOLD ITALIC SMALL KAPPA
++U+1D740           𝝀            \bilambda                                    MATHEMATICAL BOLD ITALIC SMALL LAMDA
++U+1D741           𝝁            \bimu                                        MATHEMATICAL BOLD ITALIC SMALL MU
++U+1D742           𝝂            \binu                                        MATHEMATICAL BOLD ITALIC SMALL NU
++U+1D743           𝝃            \bixi                                        MATHEMATICAL BOLD ITALIC SMALL XI
++U+1D744           𝝄            \biomicron                                   MATHEMATICAL BOLD ITALIC SMALL OMICRON
++U+1D745           𝝅            \bipi                                        MATHEMATICAL BOLD ITALIC SMALL PI
++U+1D746           𝝆            \birho                                       MATHEMATICAL BOLD ITALIC SMALL RHO
++U+1D747           𝝇            \bivarsigma                                  MATHEMATICAL BOLD ITALIC SMALL FINAL SIGMA
++U+1D748           𝝈            \bisigma                                     MATHEMATICAL BOLD ITALIC SMALL SIGMA
++U+1D749           𝝉            \bitau                                       MATHEMATICAL BOLD ITALIC SMALL TAU
++U+1D74A           𝝊            \biupsilon                                   MATHEMATICAL BOLD ITALIC SMALL UPSILON
++U+1D74B           𝝋            \biphi                                       MATHEMATICAL BOLD ITALIC SMALL PHI
++U+1D74C           𝝌            \bichi                                       MATHEMATICAL BOLD ITALIC SMALL CHI
++U+1D74D           𝝍            \bipsi                                       MATHEMATICAL BOLD ITALIC SMALL PSI
++U+1D74E           𝝎            \biomega                                     MATHEMATICAL BOLD ITALIC SMALL OMEGA
++U+1D74F           𝝏            \bipartial                                   MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL
++U+1D750           𝝐            \bivarepsilon                                MATHEMATICAL BOLD ITALIC EPSILON SYMBOL
++U+1D751           𝝑            \bivartheta                                  MATHEMATICAL BOLD ITALIC THETA SYMBOL
++U+1D752           𝝒            \bivarkappa                                  MATHEMATICAL BOLD ITALIC KAPPA SYMBOL
++U+1D753           𝝓            \bivarphi                                    MATHEMATICAL BOLD ITALIC PHI SYMBOL
++U+1D754           𝝔            \bivarrho                                    MATHEMATICAL BOLD ITALIC RHO SYMBOL
++U+1D755           𝝕            \bivarpi                                     MATHEMATICAL BOLD ITALIC PI SYMBOL
++U+1D756           𝝖            \bsansAlpha                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA
++U+1D757           𝝗            \bsansBeta                                   MATHEMATICAL SANS-SERIF BOLD CAPITAL BETA
++U+1D758           𝝘            \bsansGamma                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL GAMMA
++U+1D759           𝝙            \bsansDelta                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL DELTA
++U+1D75A           𝝚            \bsansEpsilon                                MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON
++U+1D75B           𝝛            \bsansZeta                                   MATHEMATICAL SANS-SERIF BOLD CAPITAL ZETA
++U+1D75C           𝝜            \bsansEta                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL ETA
++U+1D75D           𝝝            \bsansTheta                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA
++U+1D75E           𝝞            \bsansIota                                   MATHEMATICAL SANS-SERIF BOLD CAPITAL IOTA
++U+1D75F           𝝟            \bsansKappa                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL KAPPA
++U+1D760           𝝠            \bsansLambda                                 MATHEMATICAL SANS-SERIF BOLD CAPITAL LAMDA
++U+1D761           𝝡            \bsansMu                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL MU
++U+1D762           𝝢            \bsansNu                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL NU
++U+1D763           𝝣            \bsansXi                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL XI
++U+1D764           𝝤            \bsansOmicron                                MATHEMATICAL SANS-SERIF BOLD CAPITAL OMICRON
++U+1D765           𝝥            \bsansPi                                     MATHEMATICAL SANS-SERIF BOLD CAPITAL PI
++U+1D766           𝝦            \bsansRho                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL RHO
++U+1D767           𝝧            \bsansvarTheta                               MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL
++U+1D768           𝝨            \bsansSigma                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL SIGMA
++U+1D769           𝝩            \bsansTau                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL TAU
++U+1D76A           𝝪            \bsansUpsilon                                MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON
++U+1D76B           𝝫            \bsansPhi                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL PHI
++U+1D76C           𝝬            \bsansChi                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI
++U+1D76D           𝝭            \bsansPsi                                    MATHEMATICAL SANS-SERIF BOLD CAPITAL PSI
++U+1D76E           𝝮            \bsansOmega                                  MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
++U+1D76F           𝝯            \bsansnabla                                  MATHEMATICAL SANS-SERIF BOLD NABLA
++U+1D770           𝝰            \bsansalpha                                  MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA
++U+1D771           𝝱            \bsansbeta                                   MATHEMATICAL SANS-SERIF BOLD SMALL BETA
++U+1D772           𝝲            \bsansgamma                                  MATHEMATICAL SANS-SERIF BOLD SMALL GAMMA
++U+1D773           𝝳            \bsansdelta                                  MATHEMATICAL SANS-SERIF BOLD SMALL DELTA
++U+1D774           𝝴            \bsansepsilon                                MATHEMATICAL SANS-SERIF BOLD SMALL EPSILON
++U+1D775           𝝵            \bsanszeta                                   MATHEMATICAL SANS-SERIF BOLD SMALL ZETA
++U+1D776           𝝶            \bsanseta                                    MATHEMATICAL SANS-SERIF BOLD SMALL ETA
++U+1D777           𝝷            \bsanstheta                                  MATHEMATICAL SANS-SERIF BOLD SMALL THETA
++U+1D778           𝝸            \bsansiota                                   MATHEMATICAL SANS-SERIF BOLD SMALL IOTA
++U+1D779           𝝹            \bsanskappa                                  MATHEMATICAL SANS-SERIF BOLD SMALL KAPPA
++U+1D77A           𝝺            \bsanslambda                                 MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA
++U+1D77B           𝝻            \bsansmu                                     MATHEMATICAL SANS-SERIF BOLD SMALL MU
++U+1D77C           𝝼            \bsansnu                                     MATHEMATICAL SANS-SERIF BOLD SMALL NU
++U+1D77D           𝝽            \bsansxi                                     MATHEMATICAL SANS-SERIF BOLD SMALL XI
++U+1D77E           𝝾            \bsansomicron                                MATHEMATICAL SANS-SERIF BOLD SMALL OMICRON
++U+1D77F           𝝿            \bsanspi                                     MATHEMATICAL SANS-SERIF BOLD SMALL PI
++U+1D780           𝞀            \bsansrho                                    MATHEMATICAL SANS-SERIF BOLD SMALL RHO
++U+1D781           𝞁            \bsansvarsigma                               MATHEMATICAL SANS-SERIF BOLD SMALL FINAL SIGMA
++U+1D782           𝞂            \bsanssigma                                  MATHEMATICAL SANS-SERIF BOLD SMALL SIGMA
++U+1D783           𝞃            \bsanstau                                    MATHEMATICAL SANS-SERIF BOLD SMALL TAU
++U+1D784           𝞄            \bsansupsilon                                MATHEMATICAL SANS-SERIF BOLD SMALL UPSILON
++U+1D785           𝞅            \bsansphi                                    MATHEMATICAL SANS-SERIF BOLD SMALL PHI
++U+1D786           𝞆            \bsanschi                                    MATHEMATICAL SANS-SERIF BOLD SMALL CHI
++U+1D787           𝞇            \bsanspsi                                    MATHEMATICAL SANS-SERIF BOLD SMALL PSI
++U+1D788           𝞈            \bsansomega                                  MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
++U+1D789           𝞉            \bsanspartial                                MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL
++U+1D78A           𝞊            \bsansvarepsilon                             MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL
++U+1D78B           𝞋            \bsansvartheta                               MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL
++U+1D78C           𝞌            \bsansvarkappa                               MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL
++U+1D78D           𝞍            \bsansvarphi                                 MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL
++U+1D78E           𝞎            \bsansvarrho                                 MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL
++U+1D78F           𝞏            \bsansvarpi                                  MATHEMATICAL SANS-SERIF BOLD PI SYMBOL
++U+1D790           𝞐            \bisansAlpha                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA
++U+1D791           𝞑            \bisansBeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL BETA
++U+1D792           𝞒            \bisansGamma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL GAMMA
++U+1D793           𝞓            \bisansDelta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL DELTA
++U+1D794           𝞔            \bisansEpsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL EPSILON
++U+1D795           𝞕            \bisansZeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ZETA
++U+1D796           𝞖            \bisansEta                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ETA
++U+1D797           𝞗            \bisansTheta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA
++U+1D798           𝞘            \bisansIota                                  MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL IOTA
++U+1D799           𝞙            \bisansKappa                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL KAPPA
++U+1D79A           𝞚            \bisansLambda                                MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA
++U+1D79B           𝞛            \bisansMu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU
++U+1D79C           𝞜            \bisansNu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL NU
++U+1D79D           𝞝            \bisansXi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL XI
++U+1D79E           𝞞            \bisansOmicron                               MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMICRON
++U+1D79F           𝞟            \bisansPi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI
++U+1D7A0           𝞠            \bisansRho                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL RHO
++U+1D7A1           𝞡            \bisansvarTheta                              MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL
++U+1D7A2           𝞢            \bisansSigma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL SIGMA
++U+1D7A3           𝞣            \bisansTau                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL TAU
++U+1D7A4           𝞤            \bisansUpsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL UPSILON
++U+1D7A5           𝞥            \bisansPhi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI
++U+1D7A6           𝞦            \bisansChi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL CHI
++U+1D7A7           𝞧            \bisansPsi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PSI
++U+1D7A8           𝞨            \bisansOmega                                 MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
++U+1D7A9           𝞩            \bisansnabla                                 MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA
++U+1D7AA           𝞪            \bisansalpha                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA
++U+1D7AB           𝞫            \bisansbeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL BETA
++U+1D7AC           𝞬            \bisansgamma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL GAMMA
++U+1D7AD           𝞭            \bisansdelta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL DELTA
++U+1D7AE           𝞮            \bisansepsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL EPSILON
++U+1D7AF           𝞯            \bisanszeta                                  MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA
++U+1D7B0           𝞰            \bisanseta                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ETA
++U+1D7B1           𝞱            \bisanstheta                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL THETA
++U+1D7B2           𝞲            \bisansiota                                  MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL IOTA
++U+1D7B3           𝞳            \bisanskappa                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL KAPPA
++U+1D7B4           𝞴            \bisanslambda                                MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMDA
++U+1D7B5           𝞵            \bisansmu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU
++U+1D7B6           𝞶            \bisansnu                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL NU
++U+1D7B7           𝞷            \bisansxi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL XI
++U+1D7B8           𝞸            \bisansomicron                               MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMICRON
++U+1D7B9           𝞹            \bisanspi                                    MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI
++U+1D7BA           𝞺            \bisansrho                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL RHO
++U+1D7BB           𝞻            \bisansvarsigma                              MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL FINAL SIGMA
++U+1D7BC           𝞼            \bisanssigma                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL SIGMA
++U+1D7BD           𝞽            \bisanstau                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL TAU
++U+1D7BE           𝞾            \bisansupsilon                               MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON
++U+1D7BF           𝞿            \bisansphi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PHI
++U+1D7C0           𝟀            \bisanschi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI
++U+1D7C1           𝟁            \bisanspsi                                   MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PSI
++U+1D7C2           𝟂            \bisansomega                                 MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
++U+1D7C3           𝟃            \bisanspartial                               MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
++U+1D7C4           𝟄            \bisansvarepsilon                            MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL
++U+1D7C5           𝟅            \bisansvartheta                              MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL
++U+1D7C6           𝟆            \bisansvarkappa                              MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL
++U+1D7C7           𝟇            \bisansvarphi                                MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL
++U+1D7C8           𝟈            \bisansvarrho                                MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL
++U+1D7C9           𝟉            \bisansvarpi                                 MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
++U+1D7CA           𝟊            \bfDigamma                                   MATHEMATICAL BOLD CAPITAL DIGAMMA
++U+1D7CB           𝟋            \bfdigamma                                   MATHEMATICAL BOLD SMALL DIGAMMA
++U+1D7CE           𝟎            \bfzero                                      MATHEMATICAL BOLD DIGIT ZERO
++U+1D7CF           𝟏            \bfone                                       MATHEMATICAL BOLD DIGIT ONE
++U+1D7D0           𝟐            \bftwo                                       MATHEMATICAL BOLD DIGIT TWO
++U+1D7D1           𝟑            \bfthree                                     MATHEMATICAL BOLD DIGIT THREE
++U+1D7D2           𝟒            \bffour                                      MATHEMATICAL BOLD DIGIT FOUR
++U+1D7D3           𝟓            \bffive                                      MATHEMATICAL BOLD DIGIT FIVE
++U+1D7D4           𝟔            \bfsix                                       MATHEMATICAL BOLD DIGIT SIX
++U+1D7D5           𝟕            \bfseven                                     MATHEMATICAL BOLD DIGIT SEVEN
++U+1D7D6           𝟖            \bfeight                                     MATHEMATICAL BOLD DIGIT EIGHT
++U+1D7D7           𝟗            \bfnine                                      MATHEMATICAL BOLD DIGIT NINE
++U+1D7D8           𝟘            \bbzero                                      MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO
++U+1D7D9           𝟙            \bbone                                       MATHEMATICAL DOUBLE-STRUCK DIGIT ONE
++U+1D7DA           𝟚            \bbtwo                                       MATHEMATICAL DOUBLE-STRUCK DIGIT TWO
++U+1D7DB           𝟛            \bbthree                                     MATHEMATICAL DOUBLE-STRUCK DIGIT THREE
++U+1D7DC           𝟜            \bbfour                                      MATHEMATICAL DOUBLE-STRUCK DIGIT FOUR
++U+1D7DD           𝟝            \bbfive                                      MATHEMATICAL DOUBLE-STRUCK DIGIT FIVE
++U+1D7DE           𝟞            \bbsix                                       MATHEMATICAL DOUBLE-STRUCK DIGIT SIX
++U+1D7DF           𝟟            \bbseven                                     MATHEMATICAL DOUBLE-STRUCK DIGIT SEVEN
++U+1D7E0           𝟠            \bbeight                                     MATHEMATICAL DOUBLE-STRUCK DIGIT EIGHT
++U+1D7E1           𝟡            \bbnine                                      MATHEMATICAL DOUBLE-STRUCK DIGIT NINE
++U+1D7E2           𝟢            \sanszero                                    MATHEMATICAL SANS-SERIF DIGIT ZERO
++U+1D7E3           𝟣            \sansone                                     MATHEMATICAL SANS-SERIF DIGIT ONE
++U+1D7E4           𝟤            \sanstwo                                     MATHEMATICAL SANS-SERIF DIGIT TWO
++U+1D7E5           𝟥            \sansthree                                   MATHEMATICAL SANS-SERIF DIGIT THREE
++U+1D7E6           𝟦            \sansfour                                    MATHEMATICAL SANS-SERIF DIGIT FOUR
++U+1D7E7           𝟧            \sansfive                                    MATHEMATICAL SANS-SERIF DIGIT FIVE
++U+1D7E8           𝟨            \sanssix                                     MATHEMATICAL SANS-SERIF DIGIT SIX
++U+1D7E9           𝟩            \sansseven                                   MATHEMATICAL SANS-SERIF DIGIT SEVEN
++U+1D7EA           𝟪            \sanseight                                   MATHEMATICAL SANS-SERIF DIGIT EIGHT
++U+1D7EB           𝟫            \sansnine                                    MATHEMATICAL SANS-SERIF DIGIT NINE
++U+1D7EC           𝟬            \bsanszero                                   MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO
++U+1D7ED           𝟭            \bsansone                                    MATHEMATICAL SANS-SERIF BOLD DIGIT ONE
++U+1D7EE           𝟮            \bsanstwo                                    MATHEMATICAL SANS-SERIF BOLD DIGIT TWO
++U+1D7EF           𝟯            \bsansthree                                  MATHEMATICAL SANS-SERIF BOLD DIGIT THREE
++U+1D7F0           𝟰            \bsansfour                                   MATHEMATICAL SANS-SERIF BOLD DIGIT FOUR
++U+1D7F1           𝟱            \bsansfive                                   MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE
++U+1D7F2           𝟲            \bsanssix                                    MATHEMATICAL SANS-SERIF BOLD DIGIT SIX
++U+1D7F3           𝟳            \bsansseven                                  MATHEMATICAL SANS-SERIF BOLD DIGIT SEVEN
++U+1D7F4           𝟴            \bsanseight                                  MATHEMATICAL SANS-SERIF BOLD DIGIT EIGHT
++U+1D7F5           𝟵            \bsansnine                                   MATHEMATICAL SANS-SERIF BOLD DIGIT NINE
++U+1D7F6           𝟶            \ttzero                                      MATHEMATICAL MONOSPACE DIGIT ZERO
++U+1D7F7           𝟷            \ttone                                       MATHEMATICAL MONOSPACE DIGIT ONE
++U+1D7F8           𝟸            \tttwo                                       MATHEMATICAL MONOSPACE DIGIT TWO
++U+1D7F9           𝟹            \ttthree                                     MATHEMATICAL MONOSPACE DIGIT THREE
++U+1D7FA           𝟺            \ttfour                                      MATHEMATICAL MONOSPACE DIGIT FOUR
++U+1D7FB           𝟻            \ttfive                                      MATHEMATICAL MONOSPACE DIGIT FIVE
++U+1D7FC           𝟼            \ttsix                                       MATHEMATICAL MONOSPACE DIGIT SIX
++U+1D7FD           𝟽            \ttseven                                     MATHEMATICAL MONOSPACE DIGIT SEVEN
++U+1D7FE           𝟾            \tteight                                     MATHEMATICAL MONOSPACE DIGIT EIGHT
++U+1D7FF           𝟿            \ttnine                                      MATHEMATICAL MONOSPACE DIGIT NINE
++U+1F004           🀄            \:mahjong:                                   MAHJONG TILE RED DRAGON
++U+1F0CF           🃏            \:black_joker:                               PLAYING CARD BLACK JOKER
++U+1F170           🅰            \:a:                                         NEGATIVE SQUARED LATIN CAPITAL LETTER A
++U+1F171           🅱            \:b:                                         NEGATIVE SQUARED LATIN CAPITAL LETTER B
++U+1F17E           🅾            \:o2:                                        NEGATIVE SQUARED LATIN CAPITAL LETTER O
++U+1F17F           🅿            \:parking:                                   NEGATIVE SQUARED LATIN CAPITAL LETTER P
++U+1F18E           🆎            \:ab:                                        NEGATIVE SQUARED AB
++U+1F191           🆑            \:cl:                                        SQUARED CL
++U+1F192           🆒            \:cool:                                      SQUARED COOL
++U+1F193           🆓            \:free:                                      SQUARED FREE
++U+1F194           🆔            \:id:                                        SQUARED ID
++U+1F195           🆕            \:new:                                       SQUARED NEW
++U+1F196           🆖            \:ng:                                        SQUARED NG
++U+1F197           🆗            \:ok:                                        SQUARED OK
++U+1F198           🆘            \:sos:                                       SQUARED SOS
++U+1F199           🆙            \:up:                                        SQUARED UP WITH EXCLAMATION MARK
++U+1F19A           🆚            \:vs:                                        SQUARED VS
++U+1F201           🈁            \:koko:                                      SQUARED KATAKANA KOKO
++U+1F202           🈂            \:sa:                                        SQUARED KATAKANA SA
++U+1F21A           🈚            \:u7121:                                     SQUARED CJK UNIFIED IDEOGRAPH-7121
++U+1F22F           🈯            \:u6307:                                     SQUARED CJK UNIFIED IDEOGRAPH-6307
++U+1F232           🈲            \:u7981:                                     SQUARED CJK UNIFIED IDEOGRAPH-7981
++U+1F233           🈳            \:u7a7a:                                     SQUARED CJK UNIFIED IDEOGRAPH-7A7A
++U+1F234           🈴            \:u5408:                                     SQUARED CJK UNIFIED IDEOGRAPH-5408
++U+1F235           🈵            \:u6e80:                                     SQUARED CJK UNIFIED IDEOGRAPH-6E80
++U+1F236           🈶            \:u6709:                                     SQUARED CJK UNIFIED IDEOGRAPH-6709
++U+1F237           🈷            \:u6708:                                     SQUARED CJK UNIFIED IDEOGRAPH-6708
++U+1F238           🈸            \:u7533:                                     SQUARED CJK UNIFIED IDEOGRAPH-7533
++U+1F239           🈹            \:u5272:                                     SQUARED CJK UNIFIED IDEOGRAPH-5272
++U+1F23A           🈺            \:u55b6:                                     SQUARED CJK UNIFIED IDEOGRAPH-55B6
++U+1F250           🉐            \:ideograph_advantage:                       CIRCLED IDEOGRAPH ADVANTAGE
++U+1F251           🉑            \:accept:                                    CIRCLED IDEOGRAPH ACCEPT
++U+1F300           🌀            \:cyclone:                                   CYCLONE
++U+1F301           🌁            \:foggy:                                     FOGGY
++U+1F302           🌂            \:closed_umbrella:                           CLOSED UMBRELLA
++U+1F303           🌃            \:night_with_stars:                          NIGHT WITH STARS
++U+1F304           🌄            \:sunrise_over_mountains:                    SUNRISE OVER MOUNTAINS
++U+1F305           🌅            \:sunrise:                                   SUNRISE
++U+1F306           🌆            \:city_sunset:                               CITYSCAPE AT DUSK
++U+1F307           🌇            \:city_sunrise:                              SUNSET OVER BUILDINGS
++U+1F308           🌈            \:rainbow:                                   RAINBOW
++U+1F309           🌉            \:bridge_at_night:                           BRIDGE AT NIGHT
++U+1F30A           🌊            \:ocean:                                     WATER WAVE
++U+1F30B           🌋            \:volcano:                                   VOLCANO
++U+1F30C           🌌            \:milky_way:                                 MILKY WAY
++U+1F30D           🌍            \:earth_africa:                              EARTH GLOBE EUROPE-AFRICA
++U+1F30E           🌎            \:earth_americas:                            EARTH GLOBE AMERICAS
++U+1F30F           🌏            \:earth_asia:                                EARTH GLOBE ASIA-AUSTRALIA
++U+1F310           🌐            \:globe_with_meridians:                      GLOBE WITH MERIDIANS
++U+1F311           🌑            \:new_moon:                                  NEW MOON SYMBOL
++U+1F312           🌒            \:waxing_crescent_moon:                      WAXING CRESCENT MOON SYMBOL
++U+1F313           🌓            \:first_quarter_moon:                        FIRST QUARTER MOON SYMBOL
++U+1F314           🌔            \:moon:                                      WAXING GIBBOUS MOON SYMBOL
++U+1F315           🌕            \:full_moon:                                 FULL MOON SYMBOL
++U+1F316           🌖            \:waning_gibbous_moon:                       WANING GIBBOUS MOON SYMBOL
++U+1F317           🌗            \:last_quarter_moon:                         LAST QUARTER MOON SYMBOL
++U+1F318           🌘            \:waning_crescent_moon:                      WANING CRESCENT MOON SYMBOL
++U+1F319           🌙            \:crescent_moon:                             CRESCENT MOON
++U+1F31A           🌚            \:new_moon_with_face:                        NEW MOON WITH FACE
++U+1F31B           🌛            \:first_quarter_moon_with_face:              FIRST QUARTER MOON WITH FACE
++U+1F31C           🌜            \:last_quarter_moon_with_face:               LAST QUARTER MOON WITH FACE
++U+1F31D           🌝            \:full_moon_with_face:                       FULL MOON WITH FACE
++U+1F31E           🌞            \:sun_with_face:                             SUN WITH FACE
++U+1F31F           🌟            \:star2:                                     GLOWING STAR
++U+1F320           🌠            \:stars:                                     SHOOTING STAR
++U+1F330           🌰            \:chestnut:                                  CHESTNUT
++U+1F331           🌱            \:seedling:                                  SEEDLING
++U+1F332           🌲            \:evergreen_tree:                            EVERGREEN TREE
++U+1F333           🌳            \:deciduous_tree:                            DECIDUOUS TREE
++U+1F334           🌴            \:palm_tree:                                 PALM TREE
++U+1F335           🌵            \:cactus:                                    CACTUS
++U+1F337           🌷            \:tulip:                                     TULIP
++U+1F338           🌸            \:cherry_blossom:                            CHERRY BLOSSOM
++U+1F339           🌹            \:rose:                                      ROSE
++U+1F33A           🌺            \:hibiscus:                                  HIBISCUS
++U+1F33B           🌻            \:sunflower:                                 SUNFLOWER
++U+1F33C           🌼            \:blossom:                                   BLOSSOM
++U+1F33D           🌽            \:corn:                                      EAR OF MAIZE
++U+1F33E           🌾            \:ear_of_rice:                               EAR OF RICE
++U+1F33F           🌿            \:herb:                                      HERB
++U+1F340           🍀            \:four_leaf_clover:                          FOUR LEAF CLOVER
++U+1F341           🍁            \:maple_leaf:                                MAPLE LEAF
++U+1F342           🍂            \:fallen_leaf:                               FALLEN LEAF
++U+1F343           🍃            \:leaves:                                    LEAF FLUTTERING IN WIND
++U+1F344           🍄            \:mushroom:                                  MUSHROOM
++U+1F345           🍅            \:tomato:                                    TOMATO
++U+1F346           🍆            \:eggplant:                                  AUBERGINE
++U+1F347           🍇            \:grapes:                                    GRAPES
++U+1F348           🍈            \:melon:                                     MELON
++U+1F349           🍉            \:watermelon:                                WATERMELON
++U+1F34A           🍊            \:tangerine:                                 TANGERINE
++U+1F34B           🍋            \:lemon:                                     LEMON
++U+1F34C           🍌            \:banana:                                    BANANA
++U+1F34D           🍍            \:pineapple:                                 PINEAPPLE
++U+1F34E           🍎            \:apple:                                     RED APPLE
++U+1F34F           🍏            \:green_apple:                               GREEN APPLE
++U+1F350           🍐            \:pear:                                      PEAR
++U+1F351           🍑            \:peach:                                     PEACH
++U+1F352           🍒            \:cherries:                                  CHERRIES
++U+1F353           🍓            \:strawberry:                                STRAWBERRY
++U+1F354           🍔            \:hamburger:                                 HAMBURGER
++U+1F355           🍕            \:pizza:                                     SLICE OF PIZZA
++U+1F356           🍖            \:meat_on_bone:                              MEAT ON BONE
++U+1F357           🍗            \:poultry_leg:                               POULTRY LEG
++U+1F358           🍘            \:rice_cracker:                              RICE CRACKER
++U+1F359           🍙            \:rice_ball:                                 RICE BALL
++U+1F35A           🍚            \:rice:                                      COOKED RICE
++U+1F35B           🍛            \:curry:                                     CURRY AND RICE
++U+1F35C           🍜            \:ramen:                                     STEAMING BOWL
++U+1F35D           🍝            \:spaghetti:                                 SPAGHETTI
++U+1F35E           🍞            \:bread:                                     BREAD
++U+1F35F           🍟            \:fries:                                     FRENCH FRIES
++U+1F360           🍠            \:sweet_potato:                              ROASTED SWEET POTATO
++U+1F361           🍡            \:dango:                                     DANGO
++U+1F362           🍢            \:oden:                                      ODEN
++U+1F363           🍣            \:sushi:                                     SUSHI
++U+1F364           🍤            \:fried_shrimp:                              FRIED SHRIMP
++U+1F365           🍥            \:fish_cake:                                 FISH CAKE WITH SWIRL DESIGN
++U+1F366           🍦            \:icecream:                                  SOFT ICE CREAM
++U+1F367           🍧            \:shaved_ice:                                SHAVED ICE
++U+1F368           🍨            \:ice_cream:                                 ICE CREAM
++U+1F369           🍩            \:doughnut:                                  DOUGHNUT
++U+1F36A           🍪            \:cookie:                                    COOKIE
++U+1F36B           🍫            \:chocolate_bar:                             CHOCOLATE BAR
++U+1F36C           🍬            \:candy:                                     CANDY
++U+1F36D           🍭            \:lollipop:                                  LOLLIPOP
++U+1F36E           🍮            \:custard:                                   CUSTARD
++U+1F36F           🍯            \:honey_pot:                                 HONEY POT
++U+1F370           🍰            \:cake:                                      SHORTCAKE
++U+1F371           🍱            \:bento:                                     BENTO BOX
++U+1F372           🍲            \:stew:                                      POT OF FOOD
++U+1F373           🍳            \:egg:                                       COOKING
++U+1F374           🍴            \:fork_and_knife:                            FORK AND KNIFE
++U+1F375           🍵            \:tea:                                       TEACUP WITHOUT HANDLE
++U+1F376           🍶            \:sake:                                      SAKE BOTTLE AND CUP
++U+1F377           🍷            \:wine_glass:                                WINE GLASS
++U+1F378           🍸            \:cocktail:                                  COCKTAIL GLASS
++U+1F379           🍹            \:tropical_drink:                            TROPICAL DRINK
++U+1F37A           🍺            \:beer:                                      BEER MUG
++U+1F37B           🍻            \:beers:                                     CLINKING BEER MUGS
++U+1F37C           🍼            \:baby_bottle:                               BABY BOTTLE
++U+1F380           🎀            \:ribbon:                                    RIBBON
++U+1F381           🎁            \:gift:                                      WRAPPED PRESENT
++U+1F382           🎂            \:birthday:                                  BIRTHDAY CAKE
++U+1F383           🎃            \:jack_o_lantern:                            JACK-O-LANTERN
++U+1F384           🎄            \:christmas_tree:                            CHRISTMAS TREE
++U+1F385           🎅            \:santa:                                     FATHER CHRISTMAS
++U+1F386           🎆            \:fireworks:                                 FIREWORKS
++U+1F387           🎇            \:sparkler:                                  FIREWORK SPARKLER
++U+1F388           🎈            \:balloon:                                   BALLOON
++U+1F389           🎉            \:tada:                                      PARTY POPPER
++U+1F38A           🎊            \:confetti_ball:                             CONFETTI BALL
++U+1F38B           🎋            \:tanabata_tree:                             TANABATA TREE
++U+1F38C           🎌            \:crossed_flags:                             CROSSED FLAGS
++U+1F38D           🎍            \:bamboo:                                    PINE DECORATION
++U+1F38E           🎎            \:dolls:                                     JAPANESE DOLLS
++U+1F38F           🎏            \:flags:                                     CARP STREAMER
++U+1F390           🎐            \:wind_chime:                                WIND CHIME
++U+1F391           🎑            \:rice_scene:                                MOON VIEWING CEREMONY
++U+1F392           🎒            \:school_satchel:                            SCHOOL SATCHEL
++U+1F393           🎓            \:mortar_board:                              GRADUATION CAP
++U+1F3A0           🎠            \:carousel_horse:                            CAROUSEL HORSE
++U+1F3A1           🎡            \:ferris_wheel:                              FERRIS WHEEL
++U+1F3A2           🎢            \:roller_coaster:                            ROLLER COASTER
++U+1F3A3           🎣            \:fishing_pole_and_fish:                     FISHING POLE AND FISH
++U+1F3A4           🎤            \:microphone:                                MICROPHONE
++U+1F3A5           🎥            \:movie_camera:                              MOVIE CAMERA
++U+1F3A6           🎦            \:cinema:                                    CINEMA
++U+1F3A7           🎧            \:headphones:                                HEADPHONE
++U+1F3A8           🎨            \:art:                                       ARTIST PALETTE
++U+1F3A9           🎩            \:tophat:                                    TOP HAT
++U+1F3AA           🎪            \:circus_tent:                               CIRCUS TENT
++U+1F3AB           🎫            \:ticket:                                    TICKET
++U+1F3AC           🎬            \:clapper:                                   CLAPPER BOARD
++U+1F3AD           🎭            \:performing_arts:                           PERFORMING ARTS
++U+1F3AE           🎮            \:video_game:                                VIDEO GAME
++U+1F3AF           🎯            \:dart:                                      DIRECT HIT
++U+1F3B0           🎰            \:slot_machine:                              SLOT MACHINE
++U+1F3B1           🎱            \:8ball:                                     BILLIARDS
++U+1F3B2           🎲            \:game_die:                                  GAME DIE
++U+1F3B3           🎳            \:bowling:                                   BOWLING
++U+1F3B4           🎴            \:flower_playing_cards:                      FLOWER PLAYING CARDS
++U+1F3B5           🎵            \:musical_note:                              MUSICAL NOTE
++U+1F3B6           🎶            \:notes:                                     MULTIPLE MUSICAL NOTES
++U+1F3B7           🎷            \:saxophone:                                 SAXOPHONE
++U+1F3B8           🎸            \:guitar:                                    GUITAR
++U+1F3B9           🎹            \:musical_keyboard:                          MUSICAL KEYBOARD
++U+1F3BA           🎺            \:trumpet:                                   TRUMPET
++U+1F3BB           🎻            \:violin:                                    VIOLIN
++U+1F3BC           🎼            \:musical_score:                             MUSICAL SCORE
++U+1F3BD           🎽            \:running_shirt_with_sash:                   RUNNING SHIRT WITH SASH
++U+1F3BE           🎾            \:tennis:                                    TENNIS RACQUET AND BALL
++U+1F3BF           🎿            \:ski:                                       SKI AND SKI BOOT
++U+1F3C0           🏀            \:basketball:                                BASKETBALL AND HOOP
++U+1F3C1           🏁            \:checkered_flag:                            CHEQUERED FLAG
++U+1F3C2           🏂            \:snowboarder:                               SNOWBOARDER
++U+1F3C3           🏃            \:runner:                                    RUNNER
++U+1F3C4           🏄            \:surfer:                                    SURFER
++U+1F3C6           🏆            \:trophy:                                    TROPHY
++U+1F3C7           🏇            \:horse_racing:                              HORSE RACING
++U+1F3C8           🏈            \:football:                                  AMERICAN FOOTBALL
++U+1F3C9           🏉            \:rugby_football:                            RUGBY FOOTBALL
++U+1F3CA           🏊            \:swimmer:                                   SWIMMER
++U+1F3E0           🏠            \:house:                                     HOUSE BUILDING
++U+1F3E1           🏡            \:house_with_garden:                         HOUSE WITH GARDEN
++U+1F3E2           🏢            \:office:                                    OFFICE BUILDING
++U+1F3E3           🏣            \:post_office:                               JAPANESE POST OFFICE
++U+1F3E4           🏤            \:european_post_office:                      EUROPEAN POST OFFICE
++U+1F3E5           🏥            \:hospital:                                  HOSPITAL
++U+1F3E6           🏦            \:bank:                                      BANK
++U+1F3E7           🏧            \:atm:                                       AUTOMATED TELLER MACHINE
++U+1F3E8           🏨            \:hotel:                                     HOTEL
++U+1F3E9           🏩            \:love_hotel:                                LOVE HOTEL
++U+1F3EA           🏪            \:convenience_store:                         CONVENIENCE STORE
++U+1F3EB           🏫            \:school:                                    SCHOOL
++U+1F3EC           🏬            \:department_store:                          DEPARTMENT STORE
++U+1F3ED           🏭            \:factory:                                   FACTORY
++U+1F3EE           🏮            \:izakaya_lantern:                           IZAKAYA LANTERN
++U+1F3EF           🏯            \:japanese_castle:                           JAPANESE CASTLE
++U+1F3F0           🏰            \:european_castle:                           EUROPEAN CASTLE
++U+1F3FB           🏻            \:skin-tone-2:                               EMOJI MODIFIER FITZPATRICK TYPE-1-2
++U+1F3FC           🏼            \:skin-tone-3:                               EMOJI MODIFIER FITZPATRICK TYPE-3
++U+1F3FD           🏽            \:skin-tone-4:                               EMOJI MODIFIER FITZPATRICK TYPE-4
++U+1F3FE           🏾            \:skin-tone-5:                               EMOJI MODIFIER FITZPATRICK TYPE-5
++U+1F3FF           🏿            \:skin-tone-6:                               EMOJI MODIFIER FITZPATRICK TYPE-6
++U+1F400           🐀            \:rat:                                       RAT
++U+1F401           🐁            \:mouse2:                                    MOUSE
++U+1F402           🐂            \:ox:                                        OX
++U+1F403           🐃            \:water_buffalo:                             WATER BUFFALO
++U+1F404           🐄            \:cow2:                                      COW
++U+1F405           🐅            \:tiger2:                                    TIGER
++U+1F406           🐆            \:leopard:                                   LEOPARD
++U+1F407           🐇            \:rabbit2:                                   RABBIT
++U+1F408           🐈            \:cat2:                                      CAT
++U+1F409           🐉            \:dragon:                                    DRAGON
++U+1F40A           🐊            \:crocodile:                                 CROCODILE
++U+1F40B           🐋            \:whale2:                                    WHALE
++U+1F40C           🐌            \:snail:                                     SNAIL
++U+1F40D           🐍            \:snake:                                     SNAKE
++U+1F40E           🐎            \:racehorse:                                 HORSE
++U+1F40F           🐏            \:ram:                                       RAM
++U+1F410           🐐            \:goat:                                      GOAT
++U+1F411           🐑            \:sheep:                                     SHEEP
++U+1F412           🐒            \:monkey:                                    MONKEY
++U+1F413           🐓            \:rooster:                                   ROOSTER
++U+1F414           🐔            \:chicken:                                   CHICKEN
++U+1F415           🐕            \:dog2:                                      DOG
++U+1F416           🐖            \:pig2:                                      PIG
++U+1F417           🐗            \:boar:                                      BOAR
++U+1F418           🐘            \:elephant:                                  ELEPHANT
++U+1F419           🐙            \:octopus:                                   OCTOPUS
++U+1F41A           🐚            \:shell:                                     SPIRAL SHELL
++U+1F41B           🐛            \:bug:                                       BUG
++U+1F41C           🐜            \:ant:                                       ANT
++U+1F41D           🐝            \:bee:                                       HONEYBEE
++U+1F41E           🐞            \:beetle:                                    LADY BEETLE
++U+1F41F           🐟            \:fish:                                      FISH
++U+1F420           🐠            \:tropical_fish:                             TROPICAL FISH
++U+1F421           🐡            \:blowfish:                                  BLOWFISH
++U+1F422           🐢            \:turtle:                                    TURTLE
++U+1F423           🐣            \:hatching_chick:                            HATCHING CHICK
++U+1F424           🐤            \:baby_chick:                                BABY CHICK
++U+1F425           🐥            \:hatched_chick:                             FRONT-FACING BABY CHICK
++U+1F426           🐦            \:bird:                                      BIRD
++U+1F427           🐧            \:penguin:                                   PENGUIN
++U+1F428           🐨            \:koala:                                     KOALA
++U+1F429           🐩            \:poodle:                                    POODLE
++U+1F42A           🐪            \:dromedary_camel:                           DROMEDARY CAMEL
++U+1F42B           🐫            \:camel:                                     BACTRIAN CAMEL
++U+1F42C           🐬            \:dolphin:                                   DOLPHIN
++U+1F42D           🐭            \:mouse:                                     MOUSE FACE
++U+1F42E           🐮            \:cow:                                       COW FACE
++U+1F42F           🐯            \:tiger:                                     TIGER FACE
++U+1F430           🐰            \:rabbit:                                    RABBIT FACE
++U+1F431           🐱            \:cat:                                       CAT FACE
++U+1F432           🐲            \:dragon_face:                               DRAGON FACE
++U+1F433           🐳            \:whale:                                     SPOUTING WHALE
++U+1F434           🐴            \:horse:                                     HORSE FACE
++U+1F435           🐵            \:monkey_face:                               MONKEY FACE
++U+1F436           🐶            \:dog:                                       DOG FACE
++U+1F437           🐷            \:pig:                                       PIG FACE
++U+1F438           🐸            \:frog:                                      FROG FACE
++U+1F439           🐹            \:hamster:                                   HAMSTER FACE
++U+1F43A           🐺            \:wolf:                                      WOLF FACE
++U+1F43B           🐻            \:bear:                                      BEAR FACE
++U+1F43C           🐼            \:panda_face:                                PANDA FACE
++U+1F43D           🐽            \:pig_nose:                                  PIG NOSE
++U+1F43E           🐾            \:feet:                                      PAW PRINTS
++U+1F440           👀            \:eyes:                                      EYES
++U+1F442           👂            \:ear:                                       EAR
++U+1F443           👃            \:nose:                                      NOSE
++U+1F444           👄            \:lips:                                      MOUTH
++U+1F445           👅            \:tongue:                                    TONGUE
++U+1F446           👆            \:point_up_2:                                WHITE UP POINTING BACKHAND INDEX
++U+1F447           👇            \:point_down:                                WHITE DOWN POINTING BACKHAND INDEX
++U+1F448           👈            \:point_left:                                WHITE LEFT POINTING BACKHAND INDEX
++U+1F449           👉            \:point_right:                               WHITE RIGHT POINTING BACKHAND INDEX
++U+1F44A           👊            \:facepunch:                                 FISTED HAND SIGN
++U+1F44B           👋            \:wave:                                      WAVING HAND SIGN
++U+1F44C           👌            \:ok_hand:                                   OK HAND SIGN
++U+1F44D           👍            \:+1:                                        THUMBS UP SIGN
++U+1F44E           👎            \:-1:                                        THUMBS DOWN SIGN
++U+1F44F           👏            \:clap:                                      CLAPPING HANDS SIGN
++U+1F450           👐            \:open_hands:                                OPEN HANDS SIGN
++U+1F451           👑            \:crown:                                     CROWN
++U+1F452           👒            \:womans_hat:                                WOMANS HAT
++U+1F453           👓            \:eyeglasses:                                EYEGLASSES
++U+1F454           👔            \:necktie:                                   NECKTIE
++U+1F455           👕            \:shirt:                                     T-SHIRT
++U+1F456           👖            \:jeans:                                     JEANS
++U+1F457           👗            \:dress:                                     DRESS
++U+1F458           👘            \:kimono:                                    KIMONO
++U+1F459           👙            \:bikini:                                    BIKINI
++U+1F45A           👚            \:womans_clothes:                            WOMANS CLOTHES
++U+1F45B           👛            \:purse:                                     PURSE
++U+1F45C           👜            \:handbag:                                   HANDBAG
++U+1F45D           👝            \:pouch:                                     POUCH
++U+1F45E           👞            \:mans_shoe:                                 MANS SHOE
++U+1F45F           👟            \:athletic_shoe:                             ATHLETIC SHOE
++U+1F460           👠            \:high_heel:                                 HIGH-HEELED SHOE
++U+1F461           👡            \:sandal:                                    WOMANS SANDAL
++U+1F462           👢            \:boot:                                      WOMANS BOOTS
++U+1F463           👣            \:footprints:                                FOOTPRINTS
++U+1F464           👤            \:bust_in_silhouette:                        BUST IN SILHOUETTE
++U+1F465           👥            \:busts_in_silhouette:                       BUSTS IN SILHOUETTE
++U+1F466           👦            \:boy:                                       BOY
++U+1F467           👧            \:girl:                                      GIRL
++U+1F468           👨            \:man:                                       MAN
++U+1F469           👩            \:woman:                                     WOMAN
++U+1F46A           👪            \:family:                                    FAMILY
++U+1F46B           👫            \:couple:                                    MAN AND WOMAN HOLDING HANDS
++U+1F46C           👬            \:two_men_holding_hands:                     TWO MEN HOLDING HANDS
++U+1F46D           👭            \:two_women_holding_hands:                   TWO WOMEN HOLDING HANDS
++U+1F46E           👮            \:cop:                                       POLICE OFFICER
++U+1F46F           👯            \:dancers:                                   WOMAN WITH BUNNY EARS
++U+1F470           👰            \:bride_with_veil:                           BRIDE WITH VEIL
++U+1F471           👱            \:person_with_blond_hair:                    PERSON WITH BLOND HAIR
++U+1F472           👲            \:man_with_gua_pi_mao:                       MAN WITH GUA PI MAO
++U+1F473           👳            \:man_with_turban:                           MAN WITH TURBAN
++U+1F474           👴            \:older_man:                                 OLDER MAN
++U+1F475           👵            \:older_woman:                               OLDER WOMAN
++U+1F476           👶            \:baby:                                      BABY
++U+1F477           👷            \:construction_worker:                       CONSTRUCTION WORKER
++U+1F478           👸            \:princess:                                  PRINCESS
++U+1F479           👹            \:japanese_ogre:                             JAPANESE OGRE
++U+1F47A           👺            \:japanese_goblin:                           JAPANESE GOBLIN
++U+1F47B           👻            \:ghost:                                     GHOST
++U+1F47C           👼            \:angel:                                     BABY ANGEL
++U+1F47D           👽            \:alien:                                     EXTRATERRESTRIAL ALIEN
++U+1F47E           👾            \:space_invader:                             ALIEN MONSTER
++U+1F47F           👿            \:imp:                                       IMP
++U+1F480           💀            \:skull:                                     SKULL
++U+1F481           💁            \:information_desk_person:                   INFORMATION DESK PERSON
++U+1F482           💂            \:guardsman:                                 GUARDSMAN
++U+1F483           💃            \:dancer:                                    DANCER
++U+1F484           💄            \:lipstick:                                  LIPSTICK
++U+1F485           💅            \:nail_care:                                 NAIL POLISH
++U+1F486           💆            \:massage:                                   FACE MASSAGE
++U+1F487           💇            \:haircut:                                   HAIRCUT
++U+1F488           💈            \:barber:                                    BARBER POLE
++U+1F489           💉            \:syringe:                                   SYRINGE
++U+1F48A           💊            \:pill:                                      PILL
++U+1F48B           💋            \:kiss:                                      KISS MARK
++U+1F48C           💌            \:love_letter:                               LOVE LETTER
++U+1F48D           💍            \:ring:                                      RING
++U+1F48E           💎            \:gem:                                       GEM STONE
++U+1F48F           💏            \:couplekiss:                                KISS
++U+1F490           💐            \:bouquet:                                   BOUQUET
++U+1F491           💑            \:couple_with_heart:                         COUPLE WITH HEART
++U+1F492           💒            \:wedding:                                   WEDDING
++U+1F493           💓            \:heartbeat:                                 BEATING HEART
++U+1F494           💔            \:broken_heart:                              BROKEN HEART
++U+1F495           💕            \:two_hearts:                                TWO HEARTS
++U+1F496           💖            \:sparkling_heart:                           SPARKLING HEART
++U+1F497           💗            \:heartpulse:                                GROWING HEART
++U+1F498           💘            \:cupid:                                     HEART WITH ARROW
++U+1F499           💙            \:blue_heart:                                BLUE HEART
++U+1F49A           💚            \:green_heart:                               GREEN HEART
++U+1F49B           💛            \:yellow_heart:                              YELLOW HEART
++U+1F49C           💜            \:purple_heart:                              PURPLE HEART
++U+1F49D           💝            \:gift_heart:                                HEART WITH RIBBON
++U+1F49E           💞            \:revolving_hearts:                          REVOLVING HEARTS
++U+1F49F           💟            \:heart_decoration:                          HEART DECORATION
++U+1F4A0           💠            \:diamond_shape_with_a_dot_inside:           DIAMOND SHAPE WITH A DOT INSIDE
++U+1F4A1           💡            \:bulb:                                      ELECTRIC LIGHT BULB
++U+1F4A2           💢            \:anger:                                     ANGER SYMBOL
++U+1F4A3           💣            \:bomb:                                      BOMB
++U+1F4A4           💤            \:zzz:                                       SLEEPING SYMBOL
++U+1F4A5           💥            \:boom:                                      COLLISION SYMBOL
++U+1F4A6           💦            \:sweat_drops:                               SPLASHING SWEAT SYMBOL
++U+1F4A7           💧            \:droplet:                                   DROPLET
++U+1F4A8           💨            \:dash:                                      DASH SYMBOL
++U+1F4A9           💩            \:hankey:                                    PILE OF POO
++U+1F4AA           💪            \:muscle:                                    FLEXED BICEPS
++U+1F4AB           💫            \:dizzy:                                     DIZZY SYMBOL
++U+1F4AC           💬            \:speech_balloon:                            SPEECH BALLOON
++U+1F4AD           💭            \:thought_balloon:                           THOUGHT BALLOON
++U+1F4AE           💮            \:white_flower:                              WHITE FLOWER
++U+1F4AF           💯            \:100:                                       HUNDRED POINTS SYMBOL
++U+1F4B0           💰            \:moneybag:                                  MONEY BAG
++U+1F4B1           💱            \:currency_exchange:                         CURRENCY EXCHANGE
++U+1F4B2           💲            \:heavy_dollar_sign:                         HEAVY DOLLAR SIGN
++U+1F4B3           💳            \:credit_card:                               CREDIT CARD
++U+1F4B4           💴            \:yen:                                       BANKNOTE WITH YEN SIGN
++U+1F4B5           💵            \:dollar:                                    BANKNOTE WITH DOLLAR SIGN
++U+1F4B6           💶            \:euro:                                      BANKNOTE WITH EURO SIGN
++U+1F4B7           💷            \:pound:                                     BANKNOTE WITH POUND SIGN
++U+1F4B8           💸            \:money_with_wings:                          MONEY WITH WINGS
++U+1F4B9           💹            \:chart:                                     CHART WITH UPWARDS TREND AND YEN SIGN
++U+1F4BA           💺            \:seat:                                      SEAT
++U+1F4BB           💻            \:computer:                                  PERSONAL COMPUTER
++U+1F4BC           💼            \:briefcase:                                 BRIEFCASE
++U+1F4BD           💽            \:minidisc:                                  MINIDISC
++U+1F4BE           💾            \:floppy_disk:                               FLOPPY DISK
++U+1F4BF           💿            \:cd:                                        OPTICAL DISC
++U+1F4C0           📀            \:dvd:                                       DVD
++U+1F4C1           📁            \:file_folder:                               FILE FOLDER
++U+1F4C2           📂            \:open_file_folder:                          OPEN FILE FOLDER
++U+1F4C3           📃            \:page_with_curl:                            PAGE WITH CURL
++U+1F4C4           📄            \:page_facing_up:                            PAGE FACING UP
++U+1F4C5           📅            \:date:                                      CALENDAR
++U+1F4C6           📆            \:calendar:                                  TEAR-OFF CALENDAR
++U+1F4C7           📇            \:card_index:                                CARD INDEX
++U+1F4C8           📈            \:chart_with_upwards_trend:                  CHART WITH UPWARDS TREND
++U+1F4C9           📉            \:chart_with_downwards_trend:                CHART WITH DOWNWARDS TREND
++U+1F4CA           📊            \:bar_chart:                                 BAR CHART
++U+1F4CB           📋            \:clipboard:                                 CLIPBOARD
++U+1F4CC           📌            \:pushpin:                                   PUSHPIN
++U+1F4CD           📍            \:round_pushpin:                             ROUND PUSHPIN
++U+1F4CE           📎            \:paperclip:                                 PAPERCLIP
++U+1F4CF           📏            \:straight_ruler:                            STRAIGHT RULER
++U+1F4D0           📐            \:triangular_ruler:                          TRIANGULAR RULER
++U+1F4D1           📑            \:bookmark_tabs:                             BOOKMARK TABS
++U+1F4D2           📒            \:ledger:                                    LEDGER
++U+1F4D3           📓            \:notebook:                                  NOTEBOOK
++U+1F4D4           📔            \:notebook_with_decorative_cover:            NOTEBOOK WITH DECORATIVE COVER
++U+1F4D5           📕            \:closed_book:                               CLOSED BOOK
++U+1F4D6           📖            \:book:                                      OPEN BOOK
++U+1F4D7           📗            \:green_book:                                GREEN BOOK
++U+1F4D8           📘            \:blue_book:                                 BLUE BOOK
++U+1F4D9           📙            \:orange_book:                               ORANGE BOOK
++U+1F4DA           📚            \:books:                                     BOOKS
++U+1F4DB           📛            \:name_badge:                                NAME BADGE
++U+1F4DC           📜            \:scroll:                                    SCROLL
++U+1F4DD           📝            \:memo:                                      MEMO
++U+1F4DE           📞            \:telephone_receiver:                        TELEPHONE RECEIVER
++U+1F4DF           📟            \:pager:                                     PAGER
++U+1F4E0           📠            \:fax:                                       FAX MACHINE
++U+1F4E1           📡            \:satellite:                                 SATELLITE ANTENNA
++U+1F4E2           📢            \:loudspeaker:                               PUBLIC ADDRESS LOUDSPEAKER
++U+1F4E3           📣            \:mega:                                      CHEERING MEGAPHONE
++U+1F4E4           📤            \:outbox_tray:                               OUTBOX TRAY
++U+1F4E5           📥            \:inbox_tray:                                INBOX TRAY
++U+1F4E6           📦            \:package:                                   PACKAGE
++U+1F4E7           📧            \:e-mail:                                    E-MAIL SYMBOL
++U+1F4E8           📨            \:incoming_envelope:                         INCOMING ENVELOPE
++U+1F4E9           📩            \:envelope_with_arrow:                       ENVELOPE WITH DOWNWARDS ARROW ABOVE
++U+1F4EA           📪            \:mailbox_closed:                            CLOSED MAILBOX WITH LOWERED FLAG
++U+1F4EB           📫            \:mailbox:                                   CLOSED MAILBOX WITH RAISED FLAG
++U+1F4EC           📬            \:mailbox_with_mail:                         OPEN MAILBOX WITH RAISED FLAG
++U+1F4ED           📭            \:mailbox_with_no_mail:                      OPEN MAILBOX WITH LOWERED FLAG
++U+1F4EE           📮            \:postbox:                                   POSTBOX
++U+1F4EF           📯            \:postal_horn:                               POSTAL HORN
++U+1F4F0           📰            \:newspaper:                                 NEWSPAPER
++U+1F4F1           📱            \:iphone:                                    MOBILE PHONE
++U+1F4F2           📲            \:calling:                                   MOBILE PHONE WITH RIGHTWARDS ARROW AT LEFT
++U+1F4F3           📳            \:vibration_mode:                            VIBRATION MODE
++U+1F4F4           📴            \:mobile_phone_off:                          MOBILE PHONE OFF
++U+1F4F5           📵            \:no_mobile_phones:                          NO MOBILE PHONES
++U+1F4F6           📶            \:signal_strength:                           ANTENNA WITH BARS
++U+1F4F7           📷            \:camera:                                    CAMERA
++U+1F4F9           📹            \:video_camera:                              VIDEO CAMERA
++U+1F4FA           📺            \:tv:                                        TELEVISION
++U+1F4FB           📻            \:radio:                                     RADIO
++U+1F4FC           📼            \:vhs:                                       VIDEOCASSETTE
++U+1F500           🔀            \:twisted_rightwards_arrows:                 TWISTED RIGHTWARDS ARROWS
++U+1F501           🔁            \:repeat:                                    CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS
++U+1F502           🔂            \:repeat_one:                                CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS WITH CIRCLED ONE OVERLAY
++U+1F503           🔃            \:arrows_clockwise:                          CLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS
++U+1F504           🔄            \:arrows_counterclockwise:                   ANTICLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS
++U+1F505           🔅            \:low_brightness:                            LOW BRIGHTNESS SYMBOL
++U+1F506           🔆            \:high_brightness:                           HIGH BRIGHTNESS SYMBOL
++U+1F507           🔇            \:mute:                                      SPEAKER WITH CANCELLATION STROKE
++U+1F508           🔈            \:speaker:                                   SPEAKER
++U+1F509           🔉            \:sound:                                     SPEAKER WITH ONE SOUND WAVE
++U+1F50A           🔊            \:loud_sound:                                SPEAKER WITH THREE SOUND WAVES
++U+1F50B           🔋            \:battery:                                   BATTERY
++U+1F50C           🔌            \:electric_plug:                             ELECTRIC PLUG
++U+1F50D           🔍            \:mag:                                       LEFT-POINTING MAGNIFYING GLASS
++U+1F50E           🔎            \:mag_right:                                 RIGHT-POINTING MAGNIFYING GLASS
++U+1F50F           🔏            \:lock_with_ink_pen:                         LOCK WITH INK PEN
++U+1F510           🔐            \:closed_lock_with_key:                      CLOSED LOCK WITH KEY
++U+1F511           🔑            \:key:                                       KEY
++U+1F512           🔒            \:lock:                                      LOCK
++U+1F513           🔓            \:unlock:                                    OPEN LOCK
++U+1F514           🔔            \:bell:                                      BELL
++U+1F515           🔕            \:no_bell:                                   BELL WITH CANCELLATION STROKE
++U+1F516           🔖            \:bookmark:                                  BOOKMARK
++U+1F517           🔗            \:link:                                      LINK SYMBOL
++U+1F518           🔘            \:radio_button:                              RADIO BUTTON
++U+1F519           🔙            \:back:                                      BACK WITH LEFTWARDS ARROW ABOVE
++U+1F51A           🔚            \:end:                                       END WITH LEFTWARDS ARROW ABOVE
++U+1F51B           🔛            \:on:                                        ON WITH EXCLAMATION MARK WITH LEFT RIGHT ARROW ABOVE
++U+1F51C           🔜            \:soon:                                      SOON WITH RIGHTWARDS ARROW ABOVE
++U+1F51D           🔝            \:top:                                       TOP WITH UPWARDS ARROW ABOVE
++U+1F51E           🔞            \:underage:                                  NO ONE UNDER EIGHTEEN SYMBOL
++U+1F51F           🔟            \:keycap_ten:                                KEYCAP TEN
++U+1F520           🔠            \:capital_abcd:                              INPUT SYMBOL FOR LATIN CAPITAL LETTERS
++U+1F521           🔡            \:abcd:                                      INPUT SYMBOL FOR LATIN SMALL LETTERS
++U+1F522           🔢            \:1234:                                      INPUT SYMBOL FOR NUMBERS
++U+1F523           🔣            \:symbols:                                   INPUT SYMBOL FOR SYMBOLS
++U+1F524           🔤            \:abc:                                       INPUT SYMBOL FOR LATIN LETTERS
++U+1F525           🔥            \:fire:                                      FIRE
++U+1F526           🔦            \:flashlight:                                ELECTRIC TORCH
++U+1F527           🔧            \:wrench:                                    WRENCH
++U+1F528           🔨            \:hammer:                                    HAMMER
++U+1F529           🔩            \:nut_and_bolt:                              NUT AND BOLT
++U+1F52A           🔪            \:hocho:                                     HOCHO
++U+1F52B           🔫            \:gun:                                       PISTOL
++U+1F52C           🔬            \:microscope:                                MICROSCOPE
++U+1F52D           🔭            \:telescope:                                 TELESCOPE
++U+1F52E           🔮            \:crystal_ball:                              CRYSTAL BALL
++U+1F52F           🔯            \:six_pointed_star:                          SIX POINTED STAR WITH MIDDLE DOT
++U+1F530           🔰            \:beginner:                                  JAPANESE SYMBOL FOR BEGINNER
++U+1F531           🔱            \:trident:                                   TRIDENT EMBLEM
++U+1F532           🔲            \:black_square_button:                       BLACK SQUARE BUTTON
++U+1F533           🔳            \:white_square_button:                       WHITE SQUARE BUTTON
++U+1F534           🔴            \:red_circle:                                LARGE RED CIRCLE
++U+1F535           🔵            \:large_blue_circle:                         LARGE BLUE CIRCLE
++U+1F536           🔶            \:large_orange_diamond:                      LARGE ORANGE DIAMOND
++U+1F537           🔷            \:large_blue_diamond:                        LARGE BLUE DIAMOND
++U+1F538           🔸            \:small_orange_diamond:                      SMALL ORANGE DIAMOND
++U+1F539           🔹            \:small_blue_diamond:                        SMALL BLUE DIAMOND
++U+1F53A           🔺            \:small_red_triangle:                        UP-POINTING RED TRIANGLE
++U+1F53B           🔻            \:small_red_triangle_down:                   DOWN-POINTING RED TRIANGLE
++U+1F53C           🔼            \:arrow_up_small:                            UP-POINTING SMALL RED TRIANGLE
++U+1F53D           🔽            \:arrow_down_small:                          DOWN-POINTING SMALL RED TRIANGLE
++U+1F550           🕐            \:clock1:                                    CLOCK FACE ONE OCLOCK
++U+1F551           🕑            \:clock2:                                    CLOCK FACE TWO OCLOCK
++U+1F552           🕒            \:clock3:                                    CLOCK FACE THREE OCLOCK
++U+1F553           🕓            \:clock4:                                    CLOCK FACE FOUR OCLOCK
++U+1F554           🕔            \:clock5:                                    CLOCK FACE FIVE OCLOCK
++U+1F555           🕕            \:clock6:                                    CLOCK FACE SIX OCLOCK
++U+1F556           🕖            \:clock7:                                    CLOCK FACE SEVEN OCLOCK
++U+1F557           🕗            \:clock8:                                    CLOCK FACE EIGHT OCLOCK
++U+1F558           🕘            \:clock9:                                    CLOCK FACE NINE OCLOCK
++U+1F559           🕙            \:clock10:                                   CLOCK FACE TEN OCLOCK
++U+1F55A           🕚            \:clock11:                                   CLOCK FACE ELEVEN OCLOCK
++U+1F55B           🕛            \:clock12:                                   CLOCK FACE TWELVE OCLOCK
++U+1F55C           🕜            \:clock130:                                  CLOCK FACE ONE-THIRTY
++U+1F55D           🕝            \:clock230:                                  CLOCK FACE TWO-THIRTY
++U+1F55E           🕞            \:clock330:                                  CLOCK FACE THREE-THIRTY
++U+1F55F           🕟            \:clock430:                                  CLOCK FACE FOUR-THIRTY
++U+1F560           🕠            \:clock530:                                  CLOCK FACE FIVE-THIRTY
++U+1F561           🕡            \:clock630:                                  CLOCK FACE SIX-THIRTY
++U+1F562           🕢            \:clock730:                                  CLOCK FACE SEVEN-THIRTY
++U+1F563           🕣            \:clock830:                                  CLOCK FACE EIGHT-THIRTY
++U+1F564           🕤            \:clock930:                                  CLOCK FACE NINE-THIRTY
++U+1F565           🕥            \:clock1030:                                 CLOCK FACE TEN-THIRTY
++U+1F566           🕦            \:clock1130:                                 CLOCK FACE ELEVEN-THIRTY
++U+1F567           🕧            \:clock1230:                                 CLOCK FACE TWELVE-THIRTY
++U+1F5FB           🗻            \:mount_fuji:                                MOUNT FUJI
++U+1F5FC           🗼            \:tokyo_tower:                               TOKYO TOWER
++U+1F5FD           🗽            \:statue_of_liberty:                         STATUE OF LIBERTY
++U+1F5FE           🗾            \:japan:                                     SILHOUETTE OF JAPAN
++U+1F5FF           🗿            \:moyai:                                     MOYAI
++U+1F600           😀            \:grinning:                                  GRINNING FACE
++U+1F601           😁            \:grin:                                      GRINNING FACE WITH SMILING EYES
++U+1F602           😂            \:joy:                                       FACE WITH TEARS OF JOY
++U+1F603           😃            \:smiley:                                    SMILING FACE WITH OPEN MOUTH
++U+1F604           😄            \:smile:                                     SMILING FACE WITH OPEN MOUTH AND SMILING EYES
++U+1F605           😅            \:sweat_smile:                               SMILING FACE WITH OPEN MOUTH AND COLD SWEAT
++U+1F606           😆            \:laughing:                                  SMILING FACE WITH OPEN MOUTH AND TIGHTLY-CLOSED EYES
++U+1F607           😇            \:innocent:                                  SMILING FACE WITH HALO
++U+1F608           😈            \:smiling_imp:                               SMILING FACE WITH HORNS
++U+1F609           😉            \:wink:                                      WINKING FACE
++U+1F60A           😊            \:blush:                                     SMILING FACE WITH SMILING EYES
++U+1F60B           😋            \:yum:                                       FACE SAVOURING DELICIOUS FOOD
++U+1F60C           😌            \:relieved:                                  RELIEVED FACE
++U+1F60D           😍            \:heart_eyes:                                SMILING FACE WITH HEART-SHAPED EYES
++U+1F60E           😎            \:sunglasses:                                SMILING FACE WITH SUNGLASSES
++U+1F60F           😏            \:smirk:                                     SMIRKING FACE
++U+1F610           😐            \:neutral_face:                              NEUTRAL FACE
++U+1F611           😑            \:expressionless:                            EXPRESSIONLESS FACE
++U+1F612           😒            \:unamused:                                  UNAMUSED FACE
++U+1F613           😓            \:sweat:                                     FACE WITH COLD SWEAT
++U+1F614           😔            \:pensive:                                   PENSIVE FACE
++U+1F615           😕            \:confused:                                  CONFUSED FACE
++U+1F616           😖            \:confounded:                                CONFOUNDED FACE
++U+1F617           😗            \:kissing:                                   KISSING FACE
++U+1F618           😘            \:kissing_heart:                             FACE THROWING A KISS
++U+1F619           😙            \:kissing_smiling_eyes:                      KISSING FACE WITH SMILING EYES
++U+1F61A           😚            \:kissing_closed_eyes:                       KISSING FACE WITH CLOSED EYES
++U+1F61B           😛            \:stuck_out_tongue:                          FACE WITH STUCK-OUT TONGUE
++U+1F61C           😜            \:stuck_out_tongue_winking_eye:              FACE WITH STUCK-OUT TONGUE AND WINKING EYE
++U+1F61D           😝            \:stuck_out_tongue_closed_eyes:              FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES
++U+1F61E           😞            \:disappointed:                              DISAPPOINTED FACE
++U+1F61F           😟            \:worried:                                   WORRIED FACE
++U+1F620           😠            \:angry:                                     ANGRY FACE
++U+1F621           😡            \:rage:                                      POUTING FACE
++U+1F622           😢            \:cry:                                       CRYING FACE
++U+1F623           😣            \:persevere:                                 PERSEVERING FACE
++U+1F624           😤            \:triumph:                                   FACE WITH LOOK OF TRIUMPH
++U+1F625           😥            \:disappointed_relieved:                     DISAPPOINTED BUT RELIEVED FACE
++U+1F626           😦            \:frowning:                                  FROWNING FACE WITH OPEN MOUTH
++U+1F627           😧            \:anguished:                                 ANGUISHED FACE
++U+1F628           😨            \:fearful:                                   FEARFUL FACE
++U+1F629           😩            \:weary:                                     WEARY FACE
++U+1F62A           😪            \:sleepy:                                    SLEEPY FACE
++U+1F62B           😫            \:tired_face:                                TIRED FACE
++U+1F62C           😬            \:grimacing:                                 GRIMACING FACE
++U+1F62D           😭            \:sob:                                       LOUDLY CRYING FACE
++U+1F62E           😮            \:open_mouth:                                FACE WITH OPEN MOUTH
++U+1F62F           😯            \:hushed:                                    HUSHED FACE
++U+1F630           😰            \:cold_sweat:                                FACE WITH OPEN MOUTH AND COLD SWEAT
++U+1F631           😱            \:scream:                                    FACE SCREAMING IN FEAR
++U+1F632           😲            \:astonished:                                ASTONISHED FACE
++U+1F633           😳            \:flushed:                                   FLUSHED FACE
++U+1F634           😴            \:sleeping:                                  SLEEPING FACE
++U+1F635           😵            \:dizzy_face:                                DIZZY FACE
++U+1F636           😶            \:no_mouth:                                  FACE WITHOUT MOUTH
++U+1F637           😷            \:mask:                                      FACE WITH MEDICAL MASK
++U+1F638           😸            \:smile_cat:                                 GRINNING CAT FACE WITH SMILING EYES
++U+1F639           😹            \:joy_cat:                                   CAT FACE WITH TEARS OF JOY
++U+1F63A           😺            \:smiley_cat:                                SMILING CAT FACE WITH OPEN MOUTH
++U+1F63B           😻            \:heart_eyes_cat:                            SMILING CAT FACE WITH HEART-SHAPED EYES
++U+1F63C           😼            \:smirk_cat:                                 CAT FACE WITH WRY SMILE
++U+1F63D           😽            \:kissing_cat:                               KISSING CAT FACE WITH CLOSED EYES
++U+1F63E           😾            \:pouting_cat:                               POUTING CAT FACE
++U+1F63F           😿            \:crying_cat_face:                           CRYING CAT FACE
++U+1F640           🙀            \:scream_cat:                                WEARY CAT FACE
++U+1F645           🙅            \:no_good:                                   FACE WITH NO GOOD GESTURE
++U+1F646           🙆            \:ok_woman:                                  FACE WITH OK GESTURE
++U+1F647           🙇            \:bow:                                       PERSON BOWING DEEPLY
++U+1F648           🙈            \:see_no_evil:                               SEE-NO-EVIL MONKEY
++U+1F649           🙉            \:hear_no_evil:                              HEAR-NO-EVIL MONKEY
++U+1F64A           🙊            \:speak_no_evil:                             SPEAK-NO-EVIL MONKEY
++U+1F64B           🙋            \:raising_hand:                              HAPPY PERSON RAISING ONE HAND
++U+1F64C           🙌            \:raised_hands:                              PERSON RAISING BOTH HANDS IN CELEBRATION
++U+1F64D           🙍            \:person_frowning:                           PERSON FROWNING
++U+1F64E           🙎            \:person_with_pouting_face:                  PERSON WITH POUTING FACE
++U+1F64F           🙏            \:pray:                                      PERSON WITH FOLDED HANDS
++U+1F680           🚀            \:rocket:                                    ROCKET
++U+1F681           🚁            \:helicopter:                                HELICOPTER
++U+1F682           🚂            \:steam_locomotive:                          STEAM LOCOMOTIVE
++U+1F683           🚃            \:railway_car:                               RAILWAY CAR
++U+1F684           🚄            \:bullettrain_side:                          HIGH-SPEED TRAIN
++U+1F685           🚅            \:bullettrain_front:                         HIGH-SPEED TRAIN WITH BULLET NOSE
++U+1F686           🚆            \:train2:                                    TRAIN
++U+1F687           🚇            \:metro:                                     METRO
++U+1F688           🚈            \:light_rail:                                LIGHT RAIL
++U+1F689           🚉            \:station:                                   STATION
++U+1F68A           🚊            \:tram:                                      TRAM
++U+1F68B           🚋            \:train:                                     TRAM CAR
++U+1F68C           🚌            \:bus:                                       BUS
++U+1F68D           🚍            \:oncoming_bus:                              ONCOMING BUS
++U+1F68E           🚎            \:trolleybus:                                TROLLEYBUS
++U+1F68F           🚏            \:busstop:                                   BUS STOP
++U+1F690           🚐            \:minibus:                                   MINIBUS
++U+1F691           🚑            \:ambulance:                                 AMBULANCE
++U+1F692           🚒            \:fire_engine:                               FIRE ENGINE
++U+1F693           🚓            \:police_car:                                POLICE CAR
++U+1F694           🚔            \:oncoming_police_car:                       ONCOMING POLICE CAR
++U+1F695           🚕            \:taxi:                                      TAXI
++U+1F696           🚖            \:oncoming_taxi:                             ONCOMING TAXI
++U+1F697           🚗            \:car:                                       AUTOMOBILE
++U+1F698           🚘            \:oncoming_automobile:                       ONCOMING AUTOMOBILE
++U+1F699           🚙            \:blue_car:                                  RECREATIONAL VEHICLE
++U+1F69A           🚚            \:truck:                                     DELIVERY TRUCK
++U+1F69B           🚛            \:articulated_lorry:                         ARTICULATED LORRY
++U+1F69C           🚜            \:tractor:                                   TRACTOR
++U+1F69D           🚝            \:monorail:                                  MONORAIL
++U+1F69E           🚞            \:mountain_railway:                          MOUNTAIN RAILWAY
++U+1F69F           🚟            \:suspension_railway:                        SUSPENSION RAILWAY
++U+1F6A0           🚠            \:mountain_cableway:                         MOUNTAIN CABLEWAY
++U+1F6A1           🚡            \:aerial_tramway:                            AERIAL TRAMWAY
++U+1F6A2           🚢            \:ship:                                      SHIP
++U+1F6A3           🚣            \:rowboat:                                   ROWBOAT
++U+1F6A4           🚤            \:speedboat:                                 SPEEDBOAT
++U+1F6A5           🚥            \:traffic_light:                             HORIZONTAL TRAFFIC LIGHT
++U+1F6A6           🚦            \:vertical_traffic_light:                    VERTICAL TRAFFIC LIGHT
++U+1F6A7           🚧            \:construction:                              CONSTRUCTION SIGN
++U+1F6A8           🚨            \:rotating_light:                            POLICE CARS REVOLVING LIGHT
++U+1F6A9           🚩            \:triangular_flag_on_post:                   TRIANGULAR FLAG ON POST
++U+1F6AA           🚪            \:door:                                      DOOR
++U+1F6AB           🚫            \:no_entry_sign:                             NO ENTRY SIGN
++U+1F6AC           🚬            \:smoking:                                   SMOKING SYMBOL
++U+1F6AD           🚭            \:no_smoking:                                NO SMOKING SYMBOL
++U+1F6AE           🚮            \:put_litter_in_its_place:                   PUT LITTER IN ITS PLACE SYMBOL
++U+1F6AF           🚯            \:do_not_litter:                             DO NOT LITTER SYMBOL
++U+1F6B0           🚰            \:potable_water:                             POTABLE WATER SYMBOL
++U+1F6B1           🚱            \:non-potable_water:                         NON-POTABLE WATER SYMBOL
++U+1F6B2           🚲            \:bike:                                      BICYCLE
++U+1F6B3           🚳            \:no_bicycles:                               NO BICYCLES
++U+1F6B4           🚴            \:bicyclist:                                 BICYCLIST
++U+1F6B5           🚵            \:mountain_bicyclist:                        MOUNTAIN BICYCLIST
++U+1F6B6           🚶            \:walking:                                   PEDESTRIAN
++U+1F6B7           🚷            \:no_pedestrians:                            NO PEDESTRIANS
++U+1F6B8           🚸            \:children_crossing:                         CHILDREN CROSSING
++U+1F6B9           🚹            \:mens:                                      MENS SYMBOL
++U+1F6BA           🚺            \:womens:                                    WOMENS SYMBOL
++U+1F6BB           🚻            \:restroom:                                  RESTROOM
++U+1F6BC           🚼            \:baby_symbol:                               BABY SYMBOL
++U+1F6BD           🚽            \:toilet:                                    TOILET
++U+1F6BE           🚾            \:wc:                                        WATER CLOSET
++U+1F6BF           🚿            \:shower:                                    SHOWER
++U+1F6C0           🛀            \:bath:                                      BATH
++U+1F6C1           🛁            \:bathtub:                                   BATHTUB
++U+1F6C2           🛂            \:passport_control:                          PASSPORT CONTROL
++U+1F6C3           🛃            \:customs:                                   CUSTOMS
++U+1F6C4           🛄            \:baggage_claim:                             BAGGAGE CLAIM
++U+1F6C5           🛅            \:left_luggage:                              LEFT LUGGAGE
++----------------- ------------ -------------------------------------------- --------------------------------------------------------------------------------------------------------
++
++  vim:tw=180:et:ft=help:norl:
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U.txt	(revision 26505)
+@@ -0,0 +1,410 @@
++*julia-vim-L2U.txt*  Support for LaTeX-to-Unicode substitutions
++
++Author:  Carlo Baldassi <carlobaldassi@gmail.com>
++License: MIT license  {{{
++    Permission is hereby granted, free of charge, to any person obtaining
++    a copy of this software and associated documentation files (the
++    "Software"), to deal in the Software without restriction, including
++    without limitation the rights to use, copy, modify, merge, publish,
++    distribute, sublicense, and/or sell copies of the Software, and to
++    permit persons to whom the Software is furnished to do so, subject to
++    the following conditions:
++    The above copyright notice and this permission notice shall be included
++    in all copies or substantial portions of the Software.
++
++    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++}}}
++CONTENTS					*julia-vim-L2U*
++
++LaTeX-to-Unicode substitutions      |julia-vim-L2U-introdction|
++  Via Tab key                       |julia-vim-L2U-tab|
++  As you type                       |julia-vim-L2U-as-you-type|
++  Via Keymap                        |julia-vim-L2U-keymap|
++  On different file types           |julia-vim-L2U-file-types|
++  Enabling and disabling            |julia-vim-L2U-enable-disable|
++Variables                           |julia-vim-L2U-variables|
++Functions                           |julia-vim-L2U-functions|
++
++==============================================================================
++LATEX TO UNICODE                              *julia-vim-L2U-introduction*
++
++In the Julia REPL, entering a LaTeX-like sequence such as `\alpha` and pressing
++the <Tab> key substitutes it with a Unicode character such as `α`. The Julia
++REPL also provides partial completions, and suggestions for possible
++completions upon repeated pressing of the <Tab> key. Emojis are also
++available, with their names written between colons, e.g. `\:interrobang:`
++produces `⁉`.
++
++See |julia-vim-L2U-reference| for the complete table of substitutions.
++
++This Vim plug-in also provides the functionality needed to convert LaTeX
++input sequences into Unicode characters. There are 3 different methods
++available:
++
++  1. The default one is the most similar to the Julia one: substitutions are
++     triggered by pressing the <Tab> key; if a partial match is found a list
++     of suggested completions is presented in a menu together with their
++     Unicode counterpart. The exact behaviour of this feature can be
++     customized, see |julia-vim-L2U-tab|.
++
++  2. The second one substitutes symbols on the fly as you type, but only in
++     |Insert| mode. See |julia-vim-L2U-as-you-type|.
++
++  3. The third is based on |keymap|. It also substitutes as-you-type, but it
++     doesn't show you the full LaTeX sequence as you're typing it, and there
++     is a time-out. Its main advantage over the previous one is that can be
++     used in more circumstances, e.g. in |Command-line| mode or when searching
++     for a character with |f| or |t|, as explained in |language-mapping|. See
++     |julia-vim-L2U-keymap|.
++
++All of these methods are independent and can be used together without issues.
++
++The default configuration is to use the first method, and it's only active
++when editing Julia files. It only works in |Insert| and |Command-line| modes.
++
++It is possible to enable it with other file types, see
++|julia-vim-L2U-file-types|, and it can be even turned on/off on the fly
++regardless of the file type, see |julia-vim-L2U-enable-disable|.
++
++In |Command-line| mode, e.g. when searching with the |/| or |?| commands, the
++default behavior is very similar to the default |Insert| mode behavior, but
++slightly more limited, see |julia-vim-L2U-cmdmode|.
++
++These features only work as described with Vim version 7.4 or higher. Tab
++completion can still be made available on lower Vim versions, see
++|julia-vim-L2U-workaround|. The keymap mode might work but it hasn't been
++tested.
++
++See |julia-vim| for the general reference about the other features of the
++julia-vim plug-in.
++
++------------------------------------------------------------------------------
++LATEX TO UNICODE VIA TAB KEY                            *julia-vim-L2U-tab*
++
++Substitution of LaTeX sequences when pressing the <Tab> key (in |Insert| mode or
++in |Command-line| modes) is active by default. Use |g:latex_to_unicode_tab| to
++control it.
++
++When this feature is active, the julia-vim plug-in creates a mapping for the
++<Tab> key (in |Insert| mode) which takes precedence on any previously defined
++mapping assigned to it, such that when the <Tab> key is pressed the plug-in
++looks for potential LaTeX symbol matches before the cursor, and if it fails to
++find anything of interest it will fall-back to the previous mapping for <Tab>
++(with default Vim settings, this means it will insert a literal <Tab>; but if
++you have defined some other behavior for that key, e.g. by installing another
++plug-in such as supertab (https://github.com/ervandew/supertab) than that will
++be used).
++
++For example, entering this text in a file:
++>
++    1 + \alpha
++<
++and then pressing <Tab>, results in:
++>
++    1 + α
++<
++
++This feature is associated with 'completefunc' completion, and therefore can
++always be accessed via CTRL-X CTRL-U, even when |g:latex_to_unicode_tab| is
++off.
++
++A literal <Tab> key can always be entered by using CTRL-V before <Tab> (see
++|i_CTRL-V|).
++
++Partial sequence recognition triggers auto-completion (performed as if the
++`longest` setting was used in 'completeopt') and shows a menu of suggestions
++together with their corresponding Unicode symbol (provided the `menu` setting
++is included in 'completeopt', and more then one match is found). So for
++example, entering `\al` and pressing <Tab> will result in the following list:
++>
++    +-------------+
++    | \aleph    ℵ |
++    | \allequal ≌ |
++    | \alpha    α |
++    +-------------+
++>
++Then, pressing `p` will reduce the list to `\alpha`, pressing <Tab> will
++complete it and pressing <Tab> again will perform the substitution.
++
++The completion menu can be disbled, and this will happen automatically if a
++plug-in which is known to be incompatible with this feature is detected: see
++|g:latex_to_unicode_suggestions|.
++
++Some LaTeX sequences can be valid both as they are and as partial matches for
++other sequences, e.g. `\ne` is associated with `≠`, but it is also a partial
++match for `\nequiv` (`≢`). By default, if <Tab> finds an exact match it performs
++the substitution, but this can be controlled by the |g:latex_to_unicode_eager|
++setting.
++
++Command-line mode                                      *julia-vim-L2U-cmdmode*
++
++In |Command-line| mode, the behavior is largely the same except that both
++<Tab> and <S-Tab> are mapped by default, and the functionality is slightly
++more limited. No suggestions are shown for partial completions. Pre-existing
++user-defined mappings of <Tab> are overridden. In order to avoid that, the
++completion can be mapped onto a defferent key combination, see
++|g:latex_to_unicode_cmd_mapping|. When using <Tab>, if no matches are found
++the behavior falls back to the standard Vim command-line completion.
++
++Vim versions lower than 7.4                     *julia-vim-L2U-workaround*
++
++The <Tab> key remapping is not performed by default with Vim versions lower
++than 7.4. However, the functionality is still available via user-defined
++completion, which is accessible by the CTRL-X CTRL-U key combination. You
++can map some other key combination to this by adding something like
++>
++  inoremap <C-Tab> <C-X><C-U>
++<
++in your |.vimrc| file. If you'd map <Tab> directly, then you'd need to use
++CTRL-V <Tab> to insert a literal <Tab>.
++
++The settings |g:latex_to_unicode_eager| and |g:latex_to_unicode_suggestions|
++are still meaningful in this case.
++
++------------------------------------------------------------------------------
++LATEX TO UNICODE AS YOU TYPE                    *julia-vim-L2U-as-you-type*
++
++This feature is disabled by default, see |g:latex_to_unicode_auto|, and it is
++only available with Vim version 7.4 or higher. It consists in substituting
++valid LaTeX sequences with Unicode symbols automatically as the typing
++progresses, as soon as the sequences is unambiguously complete. For example,
++when typing:
++>
++    \chi\^2 = 1
++<
++The result is
++>
++    χ² = 1
++<
++The `\chi` is substituted right when the second backslash is entered, and the
++`\^2` is substituted when the following space is entered, before the equal
++sign.
++
++This feature does not currently work with emojis.
++
++This feature does not interfere with the <Tab> based substitution.
++
++------------------------------------------------------------------------------
++LATEX TO UNICODE VIA KEYMAP                          *julia-vim-L2U-keymap*
++
++This method is somewhat similar to the as-you-type one described above, but it
++uses |keymap| to generate the mappings. This has the advantage that it works
++in more circumstances, e.g. in |Command-line| mode or when searching within a
++line with |f| or |t| (since it uses |language-mapping| underneath). It can
++also be easily turned on or off like any other keymap (see |i_CTRL-^| and
++|c_CTRL-^|). Like the as-you-type feature, it doesn't work with emojis.
++The disadvantage is that you don't see the whole sequence as you're typing
++it, and you can't fix mistakes with backspace, for example.
++Another difference is that there is a |timeout| like for any other mapping.
++
++In order to use this method, set |g:latex_to_unicode_keymap| to `1`.
++You can use it in parallel with the other methods, they don't interfere. For
++example, typing a partial sequence and pressing <Tab> still triggers
++completions and suggestions if |g:latex_to_unicode_tab| is active.
++
++When this feature is active, in insert or replace mode you'll see `(L2U)` in
++the mode indicator. If you use this feature, and you use a GUI, it may also
++be useful to set |lCursor|.
++
++------------------------------------------------------------------------------
++LATEX TO UNICODE ON DIFFERENT FILE TYPES         *julia-vim-L2U-file-types*
++
++By default, the LaTeX-to-Unicode substitutions are only active when editing
++Julia files. However, you can use the variable |g:latex_to_unicode_file_types|
++to specify for which file types this feature is active by default. The
++variable must be set to a string containing a |pattern| (a regular expression)
++which matches the desired file types, or to a list of such patterns. For
++example, to activate the feature on all file types by default, you could put
++this in your |.vimrc| file:
++>
++    let g:latex_to_unicode_file_types = ".*"
++<
++To make it active only on, say, Julia and Lisp files, you could use:
++>
++    let g:latex_to_unicode_file_types = ["julia", "lisp"]
++<
++
++Another option, |g:latex_to_unicode_file_types_blacklist|, can be used to
++exclude certain file types. For example, if you'd wish to enable the feature
++in all cases except for Python and untyped files, you would use:
++>
++    let g:latex_to_unicode_file_types = ".*"
++    let g:latex_to_unicode_file_types_blacklist = ["python", ""]
++<
++
++NOTE: enabling the functionality will override the |'completefunc'| setting,
++which can be undesirable, and interfere with plug-ins for different file types.
++In any case, the previous |'completefunc'| setting is restored when the
++functionality is disabled, see |julia-vim-L2U-enable-disable|.
++
++------------------------------------------------------------------------------
++ENABLING AND DISABLING LATEX TO UNICODE      *julia-vim-L2U-enable-disable*
++
++The LaTeX-to-Unicode functionality can be enabled or disabled at any time,
++regardless of the |'filetype'| of the file you're editing, using the functions
++|LaTeXtoUnicode#Enable()|, |LaTeXtoUnicode#Disable()|, |LaTeXtoUnicode#Toggle()|.
++For example, you could use a mapping like:
++>
++    noremap <expr> <F7> LaTeXtoUnicode#Toggle()
++    noremap! <expr> <F7> LaTeXtoUnicode#Toggle()
++<
++and then use the <F7> key to quickly switch the functionality on and off as
++needed (see |noremap| and |noremap!|).
++
++NOTE: these functions are different from the variables |g:latex_to_unicode_tab|,
++|g:latex_to_unicode_auto| and |g:latex_to_unicode_keymap|: the functions
++enable/disable the functionality as a whole, while the variables control
++individual features (tab, auto and keymap substitution).
++
++==============================================================================
++VARIABLES                                         *julia-vim-L2U-variables*
++
++                                                   *g:latex_to_unicode_tab*
++g:latex_to_unicode_tab
++
++                A string that determines whether to map LaTeX-to-Unicode
++                substitution to the <Tab> key while in |Insert| and |Command-line|
++                modes, see |julia-vim-L2U-tab|. If unspecified, it is `"on"`,
++                meaning it is active in both insert and command-line modes.
++                You can set it to the value `"command"` or `"cmd"` to only
++                activate it in command-line mode. Or you can set it to
++                `"insert"` or `"ins"` to only have the insert mode mapping. Set it
++                to `"off"` or any other value to disable this feature entirely.
++                So for example you can disable the feature for insert mode by
++                adding the line
++>
++                    let g:latex_to_unicode_tab = "command"
++<
++                in your |.vimrc| file. You can change this setting at any moment
++                while editing, but you need to invoke |LaTeXtoUnicode#Init()|
++                for the change to take effect.
++
++                                           *g:latex_to_unicode_suggestions*
++g:latex_to_unicode_suggestions
++
++                Determines whether the <Tab> key mapping produces suggestions
++                for partial matches. By default, this is set to `1` (active),
++                unless a plug-in which is known to be incompatible with it is
++                detected. Currently, known incompatible plug-ins are
++                YouCompleteMe (https://github.com/Valloric/YouCompleteMe),
++                neocomplcache (https://github.com/Shougo/neocomplcache.vim),
++                neocomplete (https://github.com/Shougo/neocomplete.vim) and
++                deoplete (https://github.com/Shougo/deoplete.nvim),
++
++                This variable can be set at any time, changes will immediately
++                take effect.
++
++                                                 *g:latex_to_unicode_eager*
++g:latex_to_unicode_eager
++
++                Determines whether the <Tab> key mapping performs the
++                substitution immediately upon finding an exact match. By
++                default this setting is set to `1` (active), so that e.g. typing
++                `\ne` and pressing the <Tab> key triggers the substitution. If
++                this variable is set to `0`, an exact match which is also a
++                possible partial match to some other sequence triggers the
++                suggestions menu first, but another <Tab> forces the
++                substitution, so that e.g. typing `\ne` and then <Tab>
++                produces a list with `\ne`, `\neg`, `\nequiv` etc., and
++                pressing <Tab> again performs the substitution.
++
++                This variable can be set at any time, changes will immediately
++                take effect. When |g:latex_to_unicode_suggestions| is `0`,
++                this setting has no effect (it's like if it was always on).
++
++                                                  *g:latex_to_unicode_auto*
++g:latex_to_unicode_auto
++
++                Determines whether to activate LaTeX-to-Unicode substitution
++                on the fly as you type (in |Insert| mode), see
++                |julia-vim-L2U-as-you-type|. If unspecified, it is `0` (off).
++                You can enable the feature by default by inserting the line
++>
++                    let g:latex_to_unicode_auto = 1
++<
++                in your |.vimrc| file. You can change this setting at any
++                moment while editing, but you need to invoke
++                |LaTeXtoUnicode#Init()| for the change to take effect.
++
++
++                                                *g:latex_to_unicode_keymap*
++g:latex_to_unicode_keymap
++
++                Determines whether to activate the |keymap|-based
++                LaTeX-to-Unicode substitutions, see |julia-vim-L2U-keymap|.
++                If unspecified, it is `0` (off). You can enable the feature by
++                default by inserting the line
++>
++                    let g:latex_to_unicode_keymap = 1
++<
++                in your |.vimrc| file. You can change this setting at any
++                moment while editing, but you need to invoke
++                |LaTeXtoUnicode#Init()| for the change to take effect.
++
++                                            *g:latex_to_unicode_file_types*
++g:latex_to_unicode_file_types
++
++                Contains a |pattern|, or a list of patterns, which are matched
++                against the |'filetype'| to determine when to enable the
++                LaTeX-to-Unicode functionality, see |julia-vim-L2U-file-types|.
++                By default, its value is `"julia"`. The patterns provided must
++                match the whole filetype name. See also
++                |g:latex_to_unicode_file_types_blacklist|.
++
++                                  *g:latex_to_unicode_file_types_blacklist*
++g:latex_to_unicode_file_types_blacklist
++
++                Same as |g:latex_to_unicode_file_types|, but acts in reverse:
++                it disables the LaTeX-to-Unicode functionality when the
++                |'filetype'| matches the provided pattern (or any of the
++                patterns if a list is provided). By default, it contains an
++                unmatchable pattern, i.e. it is effectively disabled.
++
++                                           *g:latex_to_unicode_cmd_mapping*
++g:latex_to_unicode_cmd_mapping
++
++                Specifies the mapping (or list of mappings) for the
++                substitution in |Command-line| mode. By default, it is
++                `['<Tab>', '<S-Tab>']`, but it can be changed to avoid
++                overriding other user-defined mappings, e.g. to `'<S-Tab>'`
++                (if your terminal suppoorts it) or `'<C-\><Tab>'`.
++                The `'<Tab>'` (or to be more precise the |wildchar| key) and
++                `'<S-Tab>'` mappings are special in that they fall back to
++                performing default Vim completions in case no suitable
++                substitutions are found.
++
++==============================================================================
++FUNCTIONS                                         *julia-vim-L2U-functions*
++
++                                                    *LaTeXtoUnicode#Init()*
++LaTeXtoUnicode#Init()
++
++                Initialize or re-initialize the LaTeX-to-Unicode substitutions
++                (see |julia-vim-L2U-introduction|). Must be invoked after
++                changing |g:latex_to_unicode_tab| or |g:latex_to_unicode_auto|
++                to make the changes take effect.
++
++                                                  *LaTeXtoUnicode#Enable()*
++                                                 *LaTeXtoUnicode#Disable()*
++                                                  *LaTeXtoUnicode#Toggle()*
++LaTeXtoUnicode#Enable()
++LaTeXtoUnicode#Disable()
++LaTeXtoUnicode#Toggle()
++
++                These functions enable/disable/toggle the LaTeX-to-Unicode
++                functionality, regardless of the |'filetype'| specified in
++                |g:latex_to_unicode_file_types| and
++                |g:latex_to_unicode_file_types_blacklist|. See
++                |julia-vim-L2U-enable-disable|. Note that LaTeXtoUnicode#Enable()
++                will override the |'completefunc'| definition, if present.
++                However, LaTeXtoUnicode#Disable() will restore it.
++                These functions implicitly invoke |LaTeXtoUnicode#Init()|.
++
++
++ vim:tw=78:et:ft=help:norl:
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim.txt
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim.txt	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim.txt	(revision 26505)
+@@ -0,0 +1,505 @@
++*julia-vim.txt*  Support for Julia in Vim
++
++Author:  Carlo Baldassi <carlobaldassi@gmail.com>
++License: MIT license  {{{
++    Permission is hereby granted, free of charge, to any person obtaining
++    a copy of this software and associated documentation files (the
++    "Software"), to deal in the Software without restriction, including
++    without limitation the rights to use, copy, modify, merge, publish,
++    distribute, sublicense, and/or sell copies of the Software, and to
++    permit persons to whom the Software is furnished to do so, subject to
++    the following conditions:
++    The above copyright notice and this permission notice shall be included
++    in all copies or substantial portions of the Software.
++
++    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
++    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
++    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
++    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++}}}
++
++CONTENTS					*julia-vim*
++
++Introduction	                    |julia-vim-introduction|
++Block-wise movements/objects        |julia-vim-blocks|
++  Keyword-oriented movements        |julia-vim-blocks-move|
++  Block-oriented movements          |julia-vim-blocks-moveblock|
++  Block text objects                |julia-vim-blocks-objects|
++  Variables                         |julia-vim-blocks-variables|
++Referring to documents              |julia-vim-doc|
++Extras                              |julia-vim-extras|
++Customizations                      |julia-vim-options|
++Extra syntax colors                 |julia-vim-extra-colors|
++About                               |julia-vim-about|
++
++==============================================================================
++INTRODUCTION                                       *julia-vim-introduction*
++
++The julia-vim plug-in provides:
++  - basic support for editing Julia files (automatic filetype detection,
++    indentation, syntax highlighting)
++  - support for the |matchit| plugin
++  - support for Julia block-wise movements (i.e. jumping around between
++    Julia blocks like if/end, function/end etc.) and block text-objects
++  - facilities for conversion of LaTeX entries to Unicode symbols which mimic
++    and extend what the Julia REPL and the IJulia notebook interface do.
++    Optionally, this functionality can be used with all file types, not
++    just Julia files. See |julia-vim-L2U|.
++  - a keymapping |K| to refer julia documents.
++
++This help file documents: 1) the block-wise movements and objects, how they
++work and what variables can be used to enable/disable/tweak them; 2) The
++documentation lookup facility; 3) Some extra functions and customization
++options.
++The LaTeX-to-Unicode facilities are documented in |julia-vim-L2U|.
++
++==============================================================================
++BLOCK-WISE MOVEMENTS AND BLOCK TEXT OBJECTS              *julia-vim-blocks*
++
++In Julia, all blocks start with a keyword (`module`, `function`, `if`, `for`,
++`while`, `type`, etc.) and end with the `end` keyword.
++
++This plug-in adds support for the |matchit| plugin, such that pressing |%| while
++on a block keyword will jump to the other keywords pertaining to the same
++block. For example, if the cursor is at the beginning of the following code:
++>
++    if a == 1
++      if b > 0
++        println("yes")
++      end
++    else
++      println("no")
++    end
++<
++then pressing |%| will jump to the `else` keyword, pressing it again will jump
++to `end`, and pressing it again will go back to the first `if`.
++
++Note that the matchit plugin is normally distributed with ViM, but it is
++disabled by default. To enable it, add this line to your |.vimrc| file:
++>
++    runtime macros/matchit.vim
++<
++The julia-vim plug-in also adds commands to jump around block keywords in
++normal, operator-pending and visual modes (see |vim-modes|). These are somehow
++similar to the |]]| and |]m| mappings when used in C and Java files,
++respectively, but are more powerful. These commands also require that the
++matchit plugin is enabled.
++
++There are two families of block movements, keyword-oriented (see
++|julia-vim-blocks-move|) and block-oriented (see
++|julia-vim-blocks-moveblock|).
++
++Finally, this plug-in also adds block |text-objects| special mappings, so that
++whole blocks can be manipulated as a whole when in visual mode or
++operator-pending mode, see |julia-vim-blocks-objects|.
++
++The block movements and block objects mappings can be collectively disabled,
++see |g:julia_blocks|, and customized, see |g:julia_blocks_mappings|.
++
++NOTE: in all cases, macros at the beginning of a block are considered as part
++of the block itself. For example, in this code:
++>
++    @inbounds for i = 1:5
++      s += v[i]
++    end
++<
++the block begins at `@inbounds`.
++
++------------------------------------------------------------------------------
++KEYWORD-ORIENTED MOVEMENTS                          *julia-vim-blocks-move*
++
++These movements jump to the following/preceding block keyword, and they
++differentiate between begin keywords and end keywords. Some block keywords can
++also be used outside blocks (e.g. `for` in comprehensions, or `end` within
++indexing expressions): these instances are ignored by these commands.
++
++The following movements are provided:
++
++                                      *julia_]j* *julia_]J* *julia_[j* *julia_[J*
++move_n : jumps to the next begin keyword. By default, it is mapped to `]j`.
++move_N : jumps to the next end keyword. By default, it is mapped to `]J`.
++move_p : jumps to the preceding begin keyword. By default, it is mapped to `[j`.
++move_P : jumps to the preceding end keyword. By default, it is mapped to `[J`.
++
++Use |g:julia_blocks_mappings| to customize the mappings.
++
++------------------------------------------------------------------------------
++BLOCK-ORIENTED MOVEMENTS                       *julia-vim-blocks-moveblock*
++
++These movements are like keyword-oriented movements (|julia-vim-blocks-move|),
++except that they ignore nested blocks within the block where the cursor is.
++For example, given the following code (with line annotations):
++>
++    1  while true
++    2    a += 1
++    3    if a > 5
++    4      break
++    5    end
++    6  end
++    7  if b == 2
++    8    return
++    9  end
++<
++if the cursor is on line 2, these movements will ignore the inner
++`if/end` block (lines 3 to 5). You would then be able to jump directly
++to lines 1 (with `[[`), 6 (with `][`), 7 (with `]]`), or 9 (with `2][`).
++
++The following movements are provided:
++
++                                      *julia_]]* *julia_][* *julia_[[* *julia_[]*
++moveblock_n : gets out from the current block (if any) and jumps to the next
++              begin keyword. (Similar to |w| for word movements.) By default,
++              it is mapped to `]]`.
++moveblock_N : jumps to the end of the current block, if any. If the cursor is
++              already at the end of a block, jumps to the end of the following
++              block at the same level of the current one, or at the end of the
++              enclosing block. (Similar to |e| for word movements.) By
++              default, it is mapped to `][`.
++moveblock_p : jumps to the beginning of the current block, if any. If the
++              cursor is already at the beginning of a block, jumps to the
++              beginning of the preceding block at the same level of the
++              current one, or at the beginning of the enclosing block.
++              (Similar to |b| for word movements.) By default, it is mapped to
++              `[[`.
++moveblock_P : gets out from the current block (if any) and jumps to the
++              preceding end keyword. (Similar to |ge| for word movements.)
++              By default, it is mapped to `[]`.
++
++Use |g:julia_blocks_mappings| to customize the mappings.
++
++------------------------------------------------------------------------------
++BLOCK TEXT OBJECTS                               *julia-vim-blocks-objects*
++
++The julia-vim plug-in extends the ViM |text-objects| by defining special
++mappings which allow to operate on blocks as a whole when in visual mode
++or operator-pending mode. The default mappings use `aj` and `ij` to refer to
++these objects.
++For example, given the following code (with line annotations):
++>
++    1  while true
++    2    a += 1
++    3    if a > 5
++    4      break
++    5    end
++    6  end
++<
++if the cursor is on `break` on line 4, pressing `vaj` will select the whole
++inner `if` block (lines 3 to 5), and pressing `aj` again will select the whole
++`while` block (lines 1 to 6). The same effect could have been obtained with a
++counter, i.e. using `v2aj`. If the cursor were initially on line 2, the whole
++`while` block would have been selected with the first `vaj`. Using `daj` would
++delete a block, `caj` would delete it and leave ViM in insert mode, `=aj`
++would indent it, etc.
++Starting from line 2, pressing `vij` wuold only select the inner part of the
++`while` block (lines 2 to 5).
++
++The following mappings are provided:
++
++                                                        *julia_aj* *julia_ij*
++select_a : the block which contains the cursor, including its delimiters.
++           By default, this is mapped to `aj`. Repeated application (e.g.
++           `vajaj`) selects the enclosing blocks. A counter can be used to
++           the same effect as repetition (e.g. `v2aj`).
++select_i : same as select_a, but only selects the lines included between the
++           delimiters. Thus, this does not work with single-line blocks.
++           By default, this is mapped to `ij`. Repeated application (e.g.
++           `vijij`) has no effect, but using a counter has the same effect as
++           using "select_a" and then selecting the inner part of the outermost
++           block. For example, with the default mappings, `v3ij` is the same as
++           `v3ajij`, or `vajajajij`.
++
++Use |g:julia_blocks_mappings| to customize the mappings.
++
++The following auxiliary function is only mapped to normal mode:
++
++                                                           *julia_whereami*
++whereami : this mapping prints the first line of the current block on the
++           command line. If invoked repeatedly, or if given a count, it prints
++           the first line of the enclosing blocks, like `select_a`. If followed
++           by `select_a`, the selection, or operation, will refer to the last
++           block printed. By default, it is not mapped to any key, but a
++           mapping can be easily provided in |g:julia_blocks_mappings|. It is
++           possible to obtain the string, instead of having it printed, by
++           calling the function `julia_blocks#whereami()`. In such case, use
++           the function `julia_blocks#select_reset()` to reset the block
++           nesting level.
++
++------------------------------------------------------------------------------
++VARIABLES                                      *julia-vim-blocks-variables*
++
++                                                           *g:julia_blocks*
++g:julia_blocks
++
++                Determines whether to map block-wise movements and objects. If
++                unspecified, it is on. You can disable the feature by default
++                by inserting the line
++>
++                    let g:julia_blocks = 0
++<
++                in your |.vimrc| file.
++
++                                                  *g:julia_blocks_mappings*
++g:julia_blocks_mappings
++
++                Custom mapping for block-wise movements. This must be a |dict|
++                associating movements to key combinations. Use empty strings
++                to disable individual mappings. The following is equivalent
++                to the default mappings (see |julia-vim-blocks-moveblock|,
++                |julia-vim-blocks-move| and |julia-vim-blocks-objects|):
++>
++                  let g:julia_blocks_mappings = {
++                    \  "move_n" : "]j",
++                    \  "move_N" : "]J",
++                    \  "move_p" : "[j",
++                    \  "move_P" : "[J",
++                    \
++                    \  "moveblock_n" : "]]",
++                    \  "moveblock_N" : "][",
++                    \  "moveblock_p" : "[[",
++                    \  "moveblock_P" : "[]",
++                    \
++                    \  "select_a" : "aj",
++                    \  "select_i" : "ij",
++                    \
++                    \  "whereami" : "",
++                    \  }
++<
++                You can change individual mappings by writing something like
++                this in your |.vimrc| file:
++>
++                  let g:julia_blocks_mappings = {
++                    \  "move_N"   : "]n",
++                    \  "move_P"   : "[n",
++                    \  "whereami" : "<Leader>j",
++                    \  }
++<
++                Or you can disable individual mappings by writing something like
++                this in your |.vimrc| file:
++>
++                  let g:julia_blocks_mappings = {
++                    \  "moveblock_n" : "",
++                    \  "moveblock_p" : "",
++                    \  }
++<
++                All unspecified entries keep their default value.
++
++
++==============================================================================
++REFERRING TO DOCUMENTATION                                  *julia-vim-doc*
++
++                                                              *julia-vim-K*
++K
++        Look up documentation for the keyword under the cursor. If found,
++        a preview window with the documentation is opened.
++
++        This also works for keywords within the opened preview window,
++        allowing effortless browsing of the documentation.
++
++        (This is not really a key mapping, but uses the built-in
++        |keywordprg|-mechanism in vim; see |K| if you're curious).
++
++
++                                                   *<Plug>(JuliaDocPrompt)*
++<Plug>(JuliaDocPrompt)
++        Open a prompt for keyword documentation lookup. If you don't use |?|
++        for backward search, you can use the following to make `?` work like
++        in the Julia REPL:
++>
++        autocmd FileType julia nmap <buffer> ? <Plug>(JuliaDocPrompt)
++<
++        Apply |:augroup| as needed.
++
++
++                                                                *:JuliaDoc*
++:JuliaDoc {keyword}
++        Look up documentation for {keyword}.
++
++
++==============================================================================
++EXTRAS                                                   *julia-vim-extras*
++
++
++                                        *julia#toggle_function_blockassign*
++                                        *julia#function_block2assign*
++                                        *julia#function_assign2block*
++julia#toggle_function_blockassign()
++julia#function_block2assign()
++julia#function_assign2block()
++
++                These functions allow to transform function definitions
++                between block format and assignment format. For example,
++                these two definitions are equivalent:
++>
++                function test(x, y)
++                    x + 2y
++                end
++
++                test(x, y) = x + 2y
++<
++                You can use the function `julia#toggle_function_blockassign()`
++                to switch between the two forms (the cursor needs to be on the
++                first line of the block form). This functionality requires
++                that the |matchit| plugin is loaded. Only three-line function
++                blocks like the one in the example are recognized. When
++                changing the block form into the assignment form, `return`
++                statements are removed; if the result is empty, `nothing` is
++                substituted. Leading macros (e.g. `@inline` or `@compat`) are
++                recognized and preserved by the transformation.
++
++                In order to make this functionality practical, it is advisable
++                to map it to some key combination, e.g.:
++>
++                noremap <Leader>fb :call julia#toggle_function_blockassign()<CR>
++<
++
++==============================================================================
++CUSTOMIZATIONS                                          *julia-vim-options*
++
++The following options allows customizing some aspects of the plugin.
++
++                                             *g:julia_spellcheck_docstrings*
++g:julia_spellcheck_docstrings
++
++                Determines whether to enable spell-checking for docstrings,
++                i.e. triple quoted strings that start in the first column. See
++                |spell|. Default: on (set to `1`).
++
++                                               *g:julia_spellcheck_strings*
++g:julia_spellcheck_strings
++
++                Determines whether to enable spell-checking for all strings.
++                See |spell|. Default: off (set to `0`).
++
++                                              *g:julia_spellcheck_comments*
++g:julia_spellcheck_comments
++
++                Determines whether to enable spell-checking for comments. See
++                |spell|. Default: on (set to `1`).
++
++                                              *g:julia_highlight_operators*
++g:julia_highlight_operators
++
++                Determines whether to apply syntax highlighting to operators.
++                Default: on (set to `1`).
++
++                                              *g:julia_indent_align_import*
++g:julia_indent_align_import
++
++                In a multi-line import/using/export statment, the lines after
++                the first one use some special alignment rules by default,
++                e.g.:
++>
++                import X: one,
++                          two,
++                          three
++                export four,
++                       five,
++                       six
++<
++                When `g:julia_indent_align_import` is `0` instead, the usual
++                indentation is used:
++>
++                import X: one,
++                    two,
++                    three
++                export four,
++                    five,
++                    six
++
++                                              *g:julia_indent_align_brackets*
++g:julia_indent_align_brackets
++
++                In a multi-line bracketed expression (except for function
++                arguments, see |g:julia_indent_align_funcargs|), the lines
++                after the first one use some special alignment rules by
++                default, e.g.:
++>
++                matrix = [1 2 3;
++                          4 5 6]
++                tpl = (
++                       abc = Dict(a=>1,
++                                  b=>2),
++                       def = [1 2;
++                              3 4],
++                       xyz = SubArray{eltype(P),
++                                      N, P, I,
++                                      false}
++                      )
++<
++                When `g:julia_indent_align_brackets` is `0` instead, an extra
++                indent is used:
++>
++                matrix = [1 2 3;
++                    4 5 6]
++                tpl = (
++                    abc = Dict(a=>1,
++                        b=>2),
++                    def = [1 2;
++                        3 4],
++                    xyz = SubArray{eltype(P),
++                        N, P, I,
++                        false}
++                )
++<
++
++                                              *g:julia_indent_align_funcargs*
++g:julia_indent_align_funcargs
++
++                In a function definition, when the arguments span multiple
++                lines, the lines after the first one get an extra indentation
++                step by default, e.g.:
++>
++                function functionanme(
++                        arg1, arg2,
++                        arg3, arg4
++                    )
++                    # function body
++                end
++<
++                By setting `g:julia_indent_align_funcargs` to `1`, the
++                arguments are aligned to the bracket instead (they work as any
++                other bracket with the default value of
++                |g:julia_indent_align_brackets|):
++>
++                function functionanme(arg1, arg2,
++                                      arg3, arg4
++                                     )
++                    # function body
++                end
++<
++==============================================================================
++EXTRA SYNTAX COLORS                                *julia-vim-extra-colors*
++
++Some syntax elements are recognized but not highlighted by default:
++
++  juliaParDelim       parentheses
++  juliaSemicolon      semicolons
++  juliaComma          commas
++  juliaFunctionCall   function calls
++
++In order to highlight them, just use the |hi| command in your configuration
++file. To use existing highlight groups (see |group-name|), you can do e.g.:
++>
++  hi link juliaParDelim Delimiter
++  hi link juliaSemicolon Operator
++  hi link juliaFunctionCall Identifier
++<
++
++The above will use the colors specified by your colorscheme, if defined.
++If you want to define a color manually instead, you can use something like
++this:
++>
++  hi juliaFunctionCall guifg=#AB5033 ctermfg=Red
++<
++
++==============================================================================
++ABOUT                                                     *julia-vim-about*
++
++Grab the latest version or report a bug on GitHub:
++
++http://github.com/JuliaEditorSupport/julia-vim
++
++ vim:tw=78:et:ft=help:norl:
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/ftdetect/julia.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/ftdetect/julia.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/ftdetect/julia.vim	(revision 26505)
+@@ -0,0 +1,34 @@
++if v:version < 704
++  " NOTE: this line fixes an issue with the default system-wide lisp ftplugin
++  "       which didn't define b:undo_ftplugin on older Vim versions
++  "       (*.jl files are recognized as lisp)
++  autocmd BufRead,BufNewFile *.jl    let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
++endif
++
++autocmd BufRead,BufNewFile *.jl      set filetype=julia
++
++autocmd FileType *                   call LaTeXtoUnicode#Refresh()
++autocmd BufNew *                     call LaTeXtoUnicode#Refresh()
++autocmd BufEnter *                   call LaTeXtoUnicode#Refresh()
++autocmd CmdwinEnter *                call LaTeXtoUnicode#Refresh()
++
++" This autocommand is used to postpone the first initialization of LaTeXtoUnicode as much as possible,
++" by calling LaTeXtoUnicode#SetTab and LaTeXtoUnicode#SetAutoSub only at InsertEnter or later
++function! s:L2UTrigger()
++  augroup L2UInit
++    autocmd!
++    autocmd InsertEnter *            let g:did_insert_enter = 1 | call LaTeXtoUnicode#Init(0)
++  augroup END
++endfunction
++autocmd BufEnter *                   call s:L2UTrigger()
++
++function! s:HighlightJuliaMarkdown()
++  if !exists('g:markdown_fenced_languages')
++    let g:markdown_fenced_languages = []
++  endif
++  if index(g:markdown_fenced_languages, 'julia') == -1
++    call add(g:markdown_fenced_languages, 'julia')
++  endif
++endfunction
++autocmd BufRead,BufNewFile *.jmd     call s:HighlightJuliaMarkdown()
++autocmd BufRead,BufNewFile *.jmd     set filetype=markdown
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/ftplugin/julia.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/ftplugin/julia.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/ftplugin/julia.vim	(revision 26505)
+@@ -0,0 +1,114 @@
++" Vim filetype plugin file
++" Language:	Julia
++" Maintainer:	Carlo Baldassi <carlobaldassi@gmail.com>
++" Last Change:	2014 may 29
++
++if exists("b:did_ftplugin")
++  finish
++endif
++let b:did_ftplugin = 1
++
++let s:save_cpo = &cpo
++set cpo&vim
++
++setlocal include=^\\s*\\%(reload\\\|include\\)\\>
++setlocal suffixesadd=.jl
++setlocal comments=:#
++setlocal commentstring=#=%s=#
++setlocal cinoptions+=#1
++setlocal define=^\\s*macro\\>
++setlocal fo-=t fo+=croql
++
++let b:julia_vim_loaded = 1
++
++let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
++      \ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< completefunc<"
++      \ . " | unlet! b:commentary_format"
++      \ . " | unlet! b:smartcomment_force_linemode"
++      \ . " | unlet! b:julia_vim_loaded"
++
++" MatchIt plugin support
++if exists("loaded_matchit")
++  let b:match_ignorecase = 0
++
++  " note: begin_keywords must contain all blocks, in order
++  " for nested-structures-skipping to work properly
++  " note: 'mutable struct' and 'struct' are defined separately because
++  " using \? puts the cursor on 'struct' instead of 'mutable' for some reason
++  let b:julia_begin_keywords = '\%(\.\s*\|@\)\@<!\<\%(function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|let\|do\|\%(bare\)\?module\|quote\|if\|for\|while\|try\)\>'
++  " note: the following regex not only recognizes macros, but also local/global keywords.
++  " the purpose is recognizing things like `@inline myfunction()`
++  " or `global myfunction(...)` etc, for matchit and block movement functionality
++  let s:macro_regex = '\%(@\%([#(]\@!\S\)\+\|\<\%(local\|global\)\)\s\+'
++  let s:nomacro = '\%(' . s:macro_regex . '\)\@<!'
++  let s:yesmacro = s:nomacro . '\%('. s:macro_regex . '\)\+'
++  let b:julia_begin_keywordsm = '\%(' . s:yesmacro . b:julia_begin_keywords . '\)\|'
++        \ . '\%(' . s:nomacro . b:julia_begin_keywords . '\)'
++  let b:julia_end_keywords = '\<end\>'
++
++  " note: this function relies heavily on the syntax file
++  function! JuliaGetMatchWords()
++    let [l,c] = [line('.'),col('.')]
++    let attr = synIDattr(synID(l, c, 1),"name")
++    let c1 = c
++    while attr == 'juliaMacro' || expand('<cword>') =~# '\<\%(global\|local\)\>'
++      normal! W
++      if line('.') > l || col('.') == c1
++        call cursor(l, c)
++        return ''
++      endif
++      let attr = synIDattr(synID(l, col('.'), 1),"name")
++      let c1 = col('.')
++    endwhile
++    call cursor(l, c)
++    if attr == 'juliaConditional'
++      return b:julia_begin_keywordsm . ':\<\%(elseif\|else\)\>:' . b:julia_end_keywords
++    elseif attr =~# '\<\%(juliaRepeat\|juliaRepKeyword\)\>'
++      return b:julia_begin_keywordsm . ':\<\%(break\|continue\)\>:' . b:julia_end_keywords
++    elseif attr == 'juliaBlKeyword'
++      return b:julia_begin_keywordsm . ':' . b:julia_end_keywords
++    elseif attr == 'juliaException'
++      return b:julia_begin_keywordsm . ':\<\%(catch\|finally\)\>:' . b:julia_end_keywords
++    endif
++    return '\<\>:\<\>'
++  endfunction
++
++  let b:match_words = 'JuliaGetMatchWords()'
++
++  " we need to skip everything within comments, strings and
++  " the 'begin' and 'end' keywords when they are used as a range rather than as
++  " the delimiter of a block
++  let b:match_skip = 'synIDattr(synID(line("."),col("."),0),"name") =~# '
++        \ . '"\\<julia\\%(Comprehension\\%(For\\|If\\)\\|RangeKeyword\\|Comment\\%([LM]\\|Delim\\)\\|\\%([bs]\\|Shell\\|Printf\\|Doc\\)\\?String\\|StringPrefixed\\|DocStringM\\(Raw\\)\\?\\|RegEx\\|SymbolS\\?\\|Dotted\\)\\>"'
++
++  let b:undo_ftplugin = b:undo_ftplugin
++        \ . " | unlet! b:match_words b:match_skip b:match_ignorecase"
++        \ . " | unlet! b:julia_begin_keywords b:julia_end_keywords"
++        \ . " | delfunction JuliaGetMatchWords"
++
++  if get(g:, "julia_blocks", 1)
++    call julia_blocks#init_mappings()
++    let b:undo_ftplugin .= " | call julia_blocks#remove_mappings()"
++  endif
++
++endif
++
++" Some plugin-specific tweaks for commenting
++let b:commentary_format = "# %s"           " for tpope/vim-commentary
++let b:smartcomment_force_linemode = 1      " for carlobaldassi/vim-smartcomment
++
++if has("gui_win32")
++  let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
++  let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
++endif
++
++" Lookup documents
++nnoremap <silent><buffer> <Plug>(JuliaDocPrompt) :<C-u>call julia#doc#prompt()<CR>
++command! -nargs=1 -buffer -complete=customlist,julia#doc#complete JuliaDoc call julia#doc#open(<q-args>)
++command! -nargs=1 -buffer JuliaDocKeywordprg call julia#doc#keywordprg(<q-args>)
++setlocal keywordprg=:JuliaDocKeywordprg
++let b:undo_ftplugin .= " | setlocal keywordprg<"
++let b:undo_ftplugin .= " | delcommand JuliaDoc | delcommand JuliaDocKeywordprg"
++
++let &cpo = s:save_cpo
++unlet s:save_cpo
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/ftplugin/juliadoc.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/ftplugin/juliadoc.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/ftplugin/juliadoc.vim	(revision 26505)
+@@ -0,0 +1,30 @@
++" Vim filetype plugin file
++" Language: Julia document
++
++if exists("b:did_ftplugin")
++  finish
++endif
++let b:did_ftplugin = 1
++
++let s:save_cpo = &cpo
++set cpo&vim
++
++setlocal conceallevel=2
++setlocal concealcursor=nc
++setlocal wrap
++
++if !exists('b:undo_ftplugin')
++  let b:undo_ftplugin = ''
++endif
++let b:undo_ftplugin .= 'setlocal conceallevel< concealcursor< wrap<'
++
++" Lookup documents
++nnoremap <silent><buffer> <Plug>(JuliaDocPrompt) :<C-u>call julia#doc#prompt()<CR>
++command! -nargs=1 -buffer -complete=customlist,julia#doc#complete JuliaDoc call julia#doc#open(<q-args>)
++command! -nargs=1 -buffer JuliaDocKeywordprg call julia#doc#keywordprg(<q-args>)
++setlocal keywordprg=:JuliaDocKeywordprg
++let b:undo_ftplugin .= " | setlocal keywordprg<"
++let b:undo_ftplugin .= " | delcommand JuliaDoc | delcommand JuliaDocKeywordprg"
++
++let &cpo = s:save_cpo
++unlet s:save_cpo
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/indent/julia.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/indent/julia.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/indent/julia.vim	(revision 26505)
+@@ -0,0 +1,490 @@
++" Vim indent file
++" Language:	Julia
++" Maintainer:	Carlo Baldassi <carlobaldassi@gmail.com>
++" Last Change:	2016 jun 16
++" Notes:        originally based on Bram Molenaar's indent file for vim
++
++setlocal autoindent
++
++setlocal indentexpr=GetJuliaIndent()
++setlocal indentkeys+==end,=else,=catch,=finally,),],}
++setlocal indentkeys-=0#
++setlocal indentkeys-=:
++setlocal indentkeys-=0{
++setlocal indentkeys-=0}
++setlocal nosmartindent
++
++" Only define the function once.
++if exists("*GetJuliaIndent")
++  finish
++endif
++
++let s:skipPatternsBasic = '\<julia\%(Comment\%([LM]\|Delim\)\)\>'
++let s:skipPatterns = '\<julia\%(Comprehension\%(For\|If\)\|RangeKeyword\|Comment\%([LM]\|Delim\)\|\%([bs]\|Shell\|Printf\|Doc\)\?String\|StringPrefixed\|DocStringM\(Raw\)\?\|RegEx\|SymbolS\?\|Macro\|Dotted\)\>'
++
++function JuliaMatch(lnum, str, regex, st, ...)
++  let s = a:st
++  let e = a:0 > 0 ? a:1 : -1
++  let basic_skip = a:0 > 1 ? a:2 : 'all'
++  let skip = basic_skip ==# 'basic' ? s:skipPatternsBasic : s:skipPatterns
++  while 1
++    let f = match(a:str, '\C' . a:regex, s)
++    if e >= 0 && f >= e
++      return -1
++    endif
++    if f >= 0
++      let attr = synIDattr(synID(a:lnum,f+1,1),"name")
++      let attrT = synIDattr(synID(a:lnum,f+1,0),"name")
++      if attr =~# skip || attrT =~# skip
++        let s = f+1
++        continue
++      endif
++    endif
++    break
++  endwhile
++  return f
++endfunction
++
++function GetJuliaNestingStruct(lnum, ...)
++  " Auxiliary function to inspect the block structure of a line
++  let line = getline(a:lnum)
++  let s = a:0 > 0 ? a:1 : 0
++  let e = a:0 > 1 ? a:2 : -1
++  let blocks_stack = []
++  let num_closed_blocks = 0
++  while 1
++    let fb = JuliaMatch(a:lnum, line, '\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|let\|\%(bare\)\?module\|quote\|do\)\>', s, e)
++    let fe = JuliaMatch(a:lnum, line, '\<end\>', s, e)
++
++    if fb < 0 && fe < 0
++      " No blocks found
++      break
++    end
++
++    if fb >= 0 && (fb < fe || fe < 0)
++      " The first occurrence is an opening block keyword
++      " Note: some keywords (elseif,else,catch,finally) are both
++      "       closing blocks and opening new ones
++
++      let i = JuliaMatch(a:lnum, line, '\<if\>', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        call add(blocks_stack, 'if')
++        continue
++      endif
++      let i = JuliaMatch(a:lnum, line, '\<elseif\>', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        if len(blocks_stack) > 0 && blocks_stack[-1] == 'if'
++          let blocks_stack[-1] = 'elseif'
++        elseif (len(blocks_stack) > 0 && blocks_stack[-1] != 'elseif') || len(blocks_stack) == 0
++          call add(blocks_stack, 'elseif')
++          let num_closed_blocks += 1
++        endif
++        continue
++      endif
++      let i = JuliaMatch(a:lnum, line, '\<else\>', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(else\)\=if\>'
++          let blocks_stack[-1] = 'else'
++        else
++          call add(blocks_stack, 'else')
++          let num_closed_blocks += 1
++        endif
++        continue
++      endif
++
++      let i = JuliaMatch(a:lnum, line, '\<try\>', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        call add(blocks_stack, 'try')
++        continue
++      endif
++      let i = JuliaMatch(a:lnum, line, '\<catch\>', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        if len(blocks_stack) > 0 && blocks_stack[-1] == 'try'
++          let blocks_stack[-1] = 'catch'
++        else
++          call add(blocks_stack, 'catch')
++          let num_closed_blocks += 1
++        endif
++        continue
++      endif
++      let i = JuliaMatch(a:lnum, line, '\<finally\>', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        if len(blocks_stack) > 0 && (blocks_stack[-1] == 'try' || blocks_stack[-1] == 'catch')
++          let blocks_stack[-1] = 'finally'
++        else
++          call add(blocks_stack, 'finally')
++          let num_closed_blocks += 1
++        endif
++        continue
++      endif
++
++      let i = JuliaMatch(a:lnum, line, '\<\%(bare\)\?module\>', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        if i == 0
++          call add(blocks_stack, 'col1module')
++        else
++          call add(blocks_stack, 'other')
++        endif
++        continue
++      endif
++
++      let i = JuliaMatch(a:lnum, line, '\<\%(while\|for\|function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|let\|quote\|do\)\>', s)
++      if i >= 0 && i == fb
++        if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1
++          let s = i+11
++        else
++          let s = i+1
++        endif
++        call add(blocks_stack, 'other')
++        continue
++      endif
++
++      " Note: it should be impossible to get here
++      break
++
++    else
++      " The first occurrence is an 'end'
++
++      let s = fe+1
++      if len(blocks_stack) == 0
++        let num_closed_blocks += 1
++      else
++        call remove(blocks_stack, -1)
++      endif
++      continue
++
++    endif
++
++    " Note: it should be impossible to get here
++    break
++  endwhile
++  let num_open_blocks = len(blocks_stack) - count(blocks_stack, 'col1module')
++  return [num_open_blocks, num_closed_blocks]
++endfunction
++
++function GetJuliaNestingBrackets(lnum, c)
++  " Auxiliary function to inspect the brackets structure of a line
++  let line = getline(a:lnum)[0 : (a:c - 1)]
++  let s = 0
++  let brackets_stack = []
++  let last_closed_bracket = -1
++  while 1
++    let fb = JuliaMatch(a:lnum, line, '[([{]', s)
++    let fe = JuliaMatch(a:lnum, line, '[])}]', s)
++
++    if fb < 0 && fe < 0
++      " No brackets found
++      break
++    end
++
++    if fb >= 0 && (fb < fe || fe < 0)
++      " The first occurrence is an opening bracket
++
++      let i = JuliaMatch(a:lnum, line, '(', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        call add(brackets_stack, ['par',i])
++        continue
++      endif
++
++      let i = JuliaMatch(a:lnum, line, '\[', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        call add(brackets_stack, ['sqbra',i])
++        continue
++      endif
++
++      let i = JuliaMatch(a:lnum, line, '{', s)
++      if i >= 0 && i == fb
++        let s = i+1
++        call add(brackets_stack, ['curbra',i])
++        continue
++      endif
++
++      " Note: it should be impossible to get here
++      break
++
++    else
++      " The first occurrence is a closing bracket
++
++      let i = JuliaMatch(a:lnum, line, ')', s)
++      if i >= 0 && i == fe
++        let s = i+1
++        if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'par'
++          call remove(brackets_stack, -1)
++        else
++          let last_closed_bracket = i + 1
++        endif
++        continue
++      endif
++
++      let i = JuliaMatch(a:lnum, line, ']', s)
++      if i >= 0 && i == fe
++        let s = i+1
++        if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'sqbra'
++          call remove(brackets_stack, -1)
++        else
++          let last_closed_bracket = i + 1
++        endif
++        continue
++      endif
++
++      let i = JuliaMatch(a:lnum, line, '}', s)
++      if i >= 0 && i == fe
++        let s = i+1
++        if len(brackets_stack) > 0 && brackets_stack[-1][0] == 'curbra'
++          call remove(brackets_stack, -1)
++        else
++          let last_closed_bracket = i + 1
++        endif
++        continue
++      endif
++
++      " Note: it should be impossible to get here
++      break
++
++    endif
++
++    " Note: it should be impossible to get here
++    break
++  endwhile
++  let first_open_bracket = -1
++  let last_open_bracket = -1
++  let infuncargs = 0
++  if len(brackets_stack) > 0
++    let first_open_bracket = brackets_stack[0][1]
++    let last_open_bracket = brackets_stack[-1][1]
++    if brackets_stack[-1][0] == 'par' && IsFunctionArgPar(a:lnum, last_open_bracket+1)
++      let infuncargs = 1
++    endif
++  endif
++  return [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs]
++endfunction
++
++let s:bracketBlocks = '\<julia\%(\%(\%(Printf\)\?Par\|SqBra\%(Idx\)\?\|CurBra\)Block\|ParBlockInRange\|StringVars\%(Par\|SqBra\|CurBra\)\|Dollar\%(Par\|SqBra\)\|QuotedParBlockS\?\)\>'
++
++function IsInBrackets(lnum, c)
++  let stack = map(synstack(a:lnum, a:c), 'synIDattr(v:val, "name")')
++  call filter(stack, 'v:val =~# s:bracketBlocks')
++  return len(stack) > 0
++endfunction
++
++function IsInDocString(lnum)
++  let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
++  call filter(stack, 'v:val =~# "\\<juliaDocString\\(Delim\\|M\\\(Raw\\)\\?\\)\\?\\>"')
++  return len(stack) > 0
++endfunction
++
++function IsInContinuationImportLine(lnum)
++  let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
++  call filter(stack, 'v:val =~# "\\<juliaImportLine\\>"')
++  if len(stack) == 0
++    return 0
++  endif
++  return JuliaMatch(a:lnum, getline(a:lnum), '\<\%(import\|using\|export\)\>', indent(a:lnum)) == -1
++endfunction
++
++function IsFunctionArgPar(lnum, c)
++  if a:c == 0
++    return 0
++  endif
++  let stack = map(synstack(a:lnum, a:c-1), 'synIDattr(v:val, "name")')
++  return len(stack) >= 2 && stack[-2] ==# 'juliaFunctionDef'
++endfunction
++
++function JumpToMatch(lnum, last_closed_bracket)
++  " we use the % command to skip back (tries to ues matchit if possible,
++  " otherwise resorts to vim's default, which is buggy but better than
++  " nothing)
++  call cursor(a:lnum, a:last_closed_bracket)
++  let percmap = maparg("%", "n") 
++  if exists("g:loaded_matchit") && percmap =~# 'Match\%(it\|_wrapper\)'
++    normal %
++  else
++    normal! %
++  end
++endfunction
++
++" Auxiliary function to find a line which does not start in the middle of a
++" multiline bracketed expression, to be used as reference for block
++" indentation.
++function LastBlockIndent(lnum)
++  let lnum = a:lnum
++  let ind = 0
++  while lnum > 0
++    let ind = indent(lnum)
++    if ind == 0
++      return [lnum, 0]
++    endif
++    if !IsInBrackets(lnum, 1)
++      break
++    endif
++    let lnum = prevnonblank(lnum - 1)
++  endwhile
++  return [max([lnum,1]), ind]
++endfunction
++
++function GetJuliaIndent()
++  " Do not alter doctrings indentation
++  if IsInDocString(v:lnum)
++    return -1
++  endif
++
++  " Find a non-blank line above the current line.
++  let lnum = prevnonblank(v:lnum - 1)
++
++  " At the start of the file use zero indent.
++  if lnum == 0
++    return 0
++  endif
++
++  let ind = -1
++  let st = -1
++  let lim = -1
++
++  " Multiline bracketed expressions take precedence
++  let align_brackets = get(g:, "julia_indent_align_brackets", 1)
++  let align_funcargs = get(g:, "julia_indent_align_funcargs", 0)
++  let c = len(getline(lnum)) + 1
++  while IsInBrackets(lnum, c)
++    let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
++
++    " First scenario: the previous line has a hanging open bracket:
++    " set the indentation to match the opening bracket (plus an extra space)
++    " unless we're in a function arguments list or alignment is disabled, in
++    " which case we just add an extra indent
++    if last_open_bracket != -1
++      if (!infuncargs && align_brackets) || (infuncargs && align_funcargs)
++        let st = last_open_bracket
++        let ind = virtcol([lnum, st + 1])
++      else
++        let ind = indent(lnum) + shiftwidth()
++      endif
++
++    " Second scenario: some multiline bracketed expression was closed in the
++    " previous line. But since we know we are still in a bracketed expression,
++    " we need to find the line where the bracket was opened
++    elseif last_closed_bracket != -1
++      call JumpToMatch(lnum, last_closed_bracket)
++      if line(".") == lnum
++        " something wrong here, give up
++        let ind = indent(lnum)
++      else
++        let lnum = line(".")
++        let c = col(".") - 1
++        if c == 0
++          " uhm, give up
++          let ind = 0
++        else
++          " we skipped a bracket set, keep searching for an opening bracket
++          let lim = c
++          continue
++        endif
++      endif
++
++    " Third scenario: nothing special: keep the indentation
++    else
++      let ind = indent(lnum)
++    endif
++
++    " Does the current line start with a closing bracket? Then depending on
++    " the situation we align it with the opening one, or we let the rest of
++    " the code figure it out (the case in which we're closing a function
++    " argument list is special-cased)
++    if JuliaMatch(v:lnum, getline(v:lnum), '[])}]', indent(v:lnum)) == indent(v:lnum) && ind > 0
++      if !align_brackets && !align_funcargs
++        call JumpToMatch(v:lnum, indent(v:lnum))
++        return indent(line("."))
++      elseif (align_brackets && getline(v:lnum)[indent(v:lnum)] != ')') || align_funcargs
++        return ind - 1
++      else " must be a ')' and align_brackets==1 and align_funcargs==0
++        call JumpToMatch(v:lnum, indent(v:lnum))
++        if IsFunctionArgPar(line("."), col("."))
++          let ind = -1
++        else
++          return ind - 1
++        endif
++      endif
++    endif
++
++    break
++  endwhile
++
++  if ind == -1
++    " We are not in a multiline bracketed expression. Thus we look for a
++    " previous line to use as a reference
++    let [lnum,ind] = LastBlockIndent(lnum)
++    let c = len(getline(lnum)) + 1
++    if IsInBrackets(lnum, c)
++      let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
++      let lim = first_open_bracket
++    endif
++  end
++
++  " Analyse the reference line
++  let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(lnum, st, lim)
++  " Increase indentation for each newly opened block in the reference line
++  let ind += shiftwidth() * num_open_blocks
++
++  " Analyse the current line
++  let [num_open_blocks, num_closed_blocks] = GetJuliaNestingStruct(v:lnum)
++  " Decrease indentation for each closed block in the current line
++  let ind -= shiftwidth() * num_closed_blocks
++
++  " Additional special case: multiline import/using/export statements
++
++  let prevline = getline(lnum)
++  " Are we in a multiline import/using/export statement, right below the
++  " opening line?
++  if IsInContinuationImportLine(v:lnum) && !IsInContinuationImportLine(lnum)
++    if get(g:, 'julia_indent_align_import', 1)
++      " if the opening line has a colon followed by non-comments, use it as
++      " reference point
++      let cind = JuliaMatch(lnum, prevline, ':', indent(lnum), lim)
++      if cind >= 0
++        let nonwhiteind = JuliaMatch(lnum, prevline, '\S', cind+1, -1, 'basic')
++        if nonwhiteind >= 0
++          " return match(prevline, '\S', cind+1) " a bit overkill...
++          return cind + 2
++        endif
++      else
++        " if the opening line is not a naked import/using/export statement, use
++        " it as reference
++        let iind = JuliaMatch(lnum, prevline, '\<import\|using\|export\>', indent(lnum), lim)
++        if iind >= 0
++          " assuming whitespace after using... so no `using(XYZ)` please!
++          let nonwhiteind = JuliaMatch(lnum, prevline, '\S', iind+6, -1, 'basic')
++          if nonwhiteind >= 0
++            return match(prevline, '\S', iind+6)
++          endif
++        endif
++      endif
++    endif
++    let ind += shiftwidth()
++
++  " Or did we just close a multiline import/using/export statement?
++  elseif !IsInContinuationImportLine(v:lnum) && IsInContinuationImportLine(lnum)
++    " find the starting line of the statement
++    let ilnum = 0
++    for iln in range(lnum-1, 1, -1)
++      if !IsInContinuationImportLine(iln)
++        let ilnum = iln
++        break
++      endif
++    endfor
++    if ilnum == 0
++      " something went horribly wrong, give up
++      let ind = indent(lnum)
++    endif
++    let ind = indent(ilnum)
++  endif
++
++  return ind
++endfunction
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/keymap/generate_L2U_keymap.jl
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/keymap/generate_L2U_keymap.jl	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/keymap/generate_L2U_keymap.jl	(revision 26505)
+@@ -0,0 +1,137 @@
++#!/bin/env julia
++
++import REPL
++
++const filename = "latex2unicode_utf-8"
++const include_emoji = false # set this to true if you want to keymap empjis as well
++
++# We want to avoid situations in which the user types e.g. \delt and pauses,
++# and the result is "∇t" because "\del" gets recognized and then there is some leftover "t".
++# This allows us to get completions with <Tab> for example.
++function fix_completions(completions::Dict{String,String})
++    allinputs = sort!(collect(keys(completions)))
++    new_completions = copy(completions)
++
++    for input in allinputs
++        chars = completions[input]
++        l = length(input)
++        longer = filter(x->startswith(x, input)&&length(x)>l, allinputs)
++        n = length(longer)
++        n == 0 && continue
++        new_completions[input * "<Tab>"] = chars
++        for other in longer
++            add = other[1:(l+1)]
++            get!(new_completions, add, add)
++        end
++    end
++    return new_completions
++end
++
++function unicode_data()
++    file = normpath(Sys.BINDIR, "..", "..", "doc", "UnicodeData.txt")
++    names = Dict{UInt32, String}()
++    open(file) do unidata
++        for line in readlines(unidata)
++            id, name, desc = split(line, ";")[[1, 2, 11]]
++            codepoint = parse(UInt32, "0x$id")
++            names[codepoint] = (name == "" ? desc : desc == "" ? name : "$name / $desc")
++        end
++    end
++    return names
++end
++
++# Prepend a dotted circle ('◌' i.e. '\u25CC') to combining characters
++function fix_combining_chars(char)
++    cat = Base.Unicode.category_code(char)
++    return string(cat == 6 || cat == 8 ? "◌" : "", char)
++end
++
++function table_entries(completions::Dict{String,String}, unicode_dict)
++    latex = String[]
++    code = String[]
++    unicode = String[]
++    desc = String[]
++
++    for (input, chars) in sort!(collect(completions))
++        code_points, unicode_names, characters = String[], String[], String[]
++        if startswith(chars, "\\")
++            push!(code_points, replace(chars, "\\" => "\\\\"))
++            push!(unicode_names, "(Incomplete sequence)")
++            push!(characters, "")
++        else
++            for char in chars
++                push!(code_points, "<char-0x$(uppercase(string(UInt32(char), base = 16, pad = 5)))>")
++                push!(unicode_names, get(unicode_dict, UInt32(char), "(No Unicode name)"))
++                push!(characters, isempty(characters) ? fix_combining_chars(char) : "$char")
++            end
++        end
++        push!(latex, replace(input, "\\"=>"\\\\"))
++        push!(code, join(code_points))
++        push!(unicode, join(characters))
++        push!(desc, join(unicode_names, " + "))
++    end
++    return latex, code, unicode, desc
++end
++
++open("$filename.vim","w") do f
++    print(f, """
++        " This file is autogenerated from the script '$(basename(Base.source_path()))'
++        " The symbols are based on Julia version $VERSION
++        " The full generating script can be found in the comments at the bottom of this file,
++        " and it can be extracted with:
++        "
++        "     \$ grep '^\">' $filename.vim | cut -c4- > '$(basename(Base.source_path()))'
++        "
++        " To produce this keymap file you need to have Julia compilied from source, and
++        " to run `make deps` inside Julia's `doc` directory.
++        " Then you can run:
++        "
++        "     \$ julia $(basename(Base.source_path()))
++        "
++
++        scriptencoding utf-8
++
++        let b:keymap_name = "L2U"
++        loadkeymap
++
++        """)
++
++    col_headers = ["\" Tab completion sequence", "Code point", "Character", "Unicode name"]
++
++    orig_completions = include_emoji ? merge(
++                REPL.REPLCompletions.latex_symbols,
++                REPL.REPLCompletions.emoji_symbols
++                ) :
++                REPL.REPLCompletions.latex_symbols
++
++    latex, code, unicode, desc =
++        table_entries(
++            fix_completions(orig_completions),
++            unicode_data()
++            )
++
++    lw = max(length(col_headers[3]), maximum(map(length, latex)))
++    cw = max(length(col_headers[1]), maximum(map(length, code)))
++    uw = max(length(col_headers[2]), maximum(map(length, unicode)))
++    dw = max(length(col_headers[4]), maximum(map(length, desc)))
++
++    print_padded(l, c, u, d) = println(f, rpad(l, lw), " ", rpad(c, cw), " \" ", rpad(u, uw), " : ", d)
++
++    print_padded(col_headers...)
++    print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
++
++    for (l, c, u, d) in zip(latex, code, unicode, desc)
++        print_padded(l, c, u, d)
++    end
++    print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
++
++    print(f, """
++
++        " Below here is the script that was used to produce this file.
++
++        """)
++    for l in readlines(Base.source_path())
++        println(f, "\"> ", l)
++    end
++    println(f)
++end
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/keymap/latex2unicode_utf-8.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/keymap/latex2unicode_utf-8.vim	(nonexistent)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/keymap/latex2unicode_utf-8.vim	(revision 26505)
+@@ -0,0 +1,3662 @@
++" This file is autogenerated from the script 'generate_L2U_keymap.jl'
++" The symbols are based on Julia version 1.7.0-DEV.390
++" The full generating script can be found in the comments at the bottom of this file,
++" and it can be extracted with:
++"
++"     $ grep '^">' latex2unicode_utf-8.vim | cut -c4- > 'generate_L2U_keymap.jl'
++"
++" To produce this keymap file you need to have Julia compilied from source, and
++" to run `make deps` inside Julia's `doc` directory.
++" Then you can run:
++"
++"     $ julia generate_L2U_keymap.jl
++"
++
++scriptencoding utf-8
++
++let b:keymap_name = "L2U"
++loadkeymap
++
++" Tab completion sequence   Code point                   " Character  : Unicode name
++" ------------------------- ---------------------------- " ---------- : --------------------------------------------------------------------------------------------------------
++\\0/3                       <char-0x02189>               " ↉          : VULGAR FRACTION ZERO THIRDS
++\\1/                        <char-0x0215F>               " ⅟          : FRACTION NUMERATOR ONE
++\\1/1                       \\1/1                        "            : (Incomplete sequence)
++\\1/10                      <char-0x02152>               " ⅒          : VULGAR FRACTION ONE TENTH
++\\1/2                       <char-0x000BD>               " ½          : VULGAR FRACTION ONE HALF / FRACTION ONE HALF
++\\1/3                       <char-0x02153>               " ⅓          : VULGAR FRACTION ONE THIRD / FRACTION ONE THIRD
++\\1/4                       <char-0x000BC>               " ¼          : VULGAR FRACTION ONE QUARTER / FRACTION ONE QUARTER
++\\1/5                       <char-0x02155>               " ⅕          : VULGAR FRACTION ONE FIFTH / FRACTION ONE FIFTH
++\\1/6                       <char-0x02159>               " ⅙          : VULGAR FRACTION ONE SIXTH / FRACTION ONE SIXTH
++\\1/7                       <char-0x02150>               " ⅐          : VULGAR FRACTION ONE SEVENTH
++\\1/8                       <char-0x0215B>               " ⅛          : VULGAR FRACTION ONE EIGHTH / FRACTION ONE EIGHTH
++\\1/9                       <char-0x02151>               " ⅑          : VULGAR FRACTION ONE NINTH
++\\1/<Tab>                   <char-0x0215F>               " ⅟          : FRACTION NUMERATOR ONE
++\\2/3                       <char-0x02154>               " ⅔          : VULGAR FRACTION TWO THIRDS / FRACTION TWO THIRDS
++\\2/5                       <char-0x02156>               " ⅖          : VULGAR FRACTION TWO FIFTHS / FRACTION TWO FIFTHS
++\\3/4                       <char-0x000BE>               " ¾          : VULGAR FRACTION THREE QUARTERS / FRACTION THREE QUARTERS
++\\3/5                       <char-0x02157>               " ⅗          : VULGAR FRACTION THREE FIFTHS / FRACTION THREE FIFTHS
++\\3/8                       <char-0x0215C>               " ⅜          : VULGAR FRACTION THREE EIGHTHS / FRACTION THREE EIGHTHS
++\\4/5                       <char-0x02158>               " ⅘          : VULGAR FRACTION FOUR FIFTHS / FRACTION FOUR FIFTHS
++\\5/6                       <char-0x0215A>               " ⅚          : VULGAR FRACTION FIVE SIXTHS / FRACTION FIVE SIXTHS
++\\5/8                       <char-0x0215D>               " ⅝          : VULGAR FRACTION FIVE EIGHTHS / FRACTION FIVE EIGHTHS
++\\7/8                       <char-0x0215E>               " ⅞          : VULGAR FRACTION SEVEN EIGHTHS / FRACTION SEVEN EIGHTHS
++\\AA                        <char-0x000C5>               " Å          : LATIN CAPITAL LETTER A WITH RING ABOVE / LATIN CAPITAL LETTER A RING
++\\AE                        <char-0x000C6>               " Æ          : LATIN CAPITAL LETTER AE / LATIN CAPITAL LETTER A E
++\\Alpha                     <char-0x00391>               " Α          : GREEK CAPITAL LETTER ALPHA
++\\And                       <char-0x02A53>               " ⩓          : DOUBLE LOGICAL AND
++\\Angle                     <char-0x0299C>               " ⦜          : RIGHT ANGLE VARIANT WITH SQUARE
++\\Angstrom                  <char-0x0212B>               " Å          : ANGSTROM SIGN / ANGSTROM UNIT
++\\Beta                      <char-0x00392>               " Β          : GREEK CAPITAL LETTER BETA
++\\Bot                       <char-0x02AEB>               " ⫫          : DOUBLE UP TACK
++\\Bumpeq                    <char-0x0224E>               " ≎          : GEOMETRICALLY EQUIVALENT TO
++\\Cap                       <char-0x022D2>               " ⋒          : DOUBLE INTERSECTION
++\\Chi                       <char-0x003A7>               " Χ          : GREEK CAPITAL LETTER CHI
++\\Colon                     <char-0x02237>               " ∷          : PROPORTION
++\\Colon<Tab>                <char-0x02237>               " ∷          : PROPORTION
++\\Colone                    \\Colone                     "            : (Incomplete sequence)
++\\Coloneq                   <char-0x02A74>               " ⩴          : DOUBLE COLON EQUAL
++\\Cup                       <char-0x022D3>               " ⋓          : DOUBLE UNION
++\\DDownarrow                <char-0x027F1>               " ⟱          : DOWNWARDS QUADRUPLE ARROW
++\\DH                        <char-0x000D0>               " Ð          : LATIN CAPITAL LETTER ETH
++\\DJ                        <char-0x00110>               " Đ          : LATIN CAPITAL LETTER D WITH STROKE / LATIN CAPITAL LETTER D BAR
++\\Dashv                     <char-0x02AE4>               " ⫤          : VERTICAL BAR DOUBLE LEFT TURNSTILE
++\\Ddownarrow                <char-0x0290B>               " ⤋          : DOWNWARDS TRIPLE ARROW
++\\Delta                     <char-0x00394>               " Δ          : GREEK CAPITAL LETTER DELTA
++\\Digamma                   <char-0x003DC>               " Ϝ          : GREEK LETTER DIGAMMA / GREEK CAPITAL LETTER DIGAMMA
++\\Doteq                     <char-0x02251>               " ≑          : GEOMETRICALLY EQUAL TO
++\\DownArrowBar              <char-0x02913>               " ⤓          : DOWNWARDS ARROW TO BAR
++\\DownArrowUpArrow          <char-0x021F5>               " ⇵          : DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
++\\DownLeftRightVector       <char-0x02950>               " ⥐          : LEFT BARB DOWN RIGHT BARB DOWN HARPOON
++\\DownLeftTeeVector         <char-0x0295E>               " ⥞          : LEFTWARDS HARPOON WITH BARB DOWN FROM BAR
++\\DownLeftVectorBar         <char-0x02956>               " ⥖          : LEFTWARDS HARPOON WITH BARB DOWN TO BAR
++\\DownRightTeeVector        <char-0x0295F>               " ⥟          : RIGHTWARDS HARPOON WITH BARB DOWN FROM BAR
++\\DownRightVectorBar        <char-0x02957>               " ⥗          : RIGHTWARDS HARPOON WITH BARB DOWN TO BAR
++\\Downarrow                 <char-0x021D3>               " ⇓          : DOWNWARDS DOUBLE ARROW / DOWN DOUBLE ARROW
++\\ElOr                      <char-0x02A56>               " ⩖          : TWO INTERSECTING LOGICAL OR
++\\Elroang                   <char-0x02986>               " ⦆          : RIGHT WHITE PARENTHESIS
++\\Epsilon                   <char-0x00395>               " Ε          : GREEK CAPITAL LETTER EPSILON
++\\Equal                     <char-0x02A75>               " ⩵          : TWO CONSECUTIVE EQUALS SIGNS
++\\Equiv                     <char-0x02263>               " ≣          : STRICTLY EQUIVALENT TO
++\\Eta                       <char-0x00397>               " Η          : GREEK CAPITAL LETTER ETA
++\\Finv                      <char-0x02132>               " Ⅎ          : TURNED CAPITAL F / TURNED F
++\\Game                      <char-0x02141>               " ⅁          : TURNED SANS-SERIF CAPITAL G
++\\Gamma                     <char-0x00393>               " Γ          : GREEK CAPITAL LETTER GAMMA
++\\H                         <char-0x0030B>               " ◌̋         : COMBINING DOUBLE ACUTE ACCENT / NON-SPACING DOUBLE ACUTE
++\\Im                        <char-0x02111>               " ℑ          : BLACK-LETTER CAPITAL I / BLACK-LETTER I
++\\Iota                      <char-0x00399>               " Ι          : GREEK CAPITAL LETTER IOTA
++\\Kappa                     <char-0x0039A>               " Κ          : GREEK CAPITAL LETTER KAPPA
++\\Koppa                     <char-0x003DE>               " Ϟ          : GREEK LETTER KOPPA / GREEK CAPITAL LETTER KOPPA
++\\L                         <char-0x00141>               " Ł          : LATIN CAPITAL LETTER L WITH STROKE / LATIN CAPITAL LETTER L SLASH
++\\L<Tab>                    <char-0x00141>               " Ł          : LATIN CAPITAL LETTER L WITH STROKE / LATIN CAPITAL LETTER L SLASH
++\\LL                        \\LL                         "            : (Incomplete sequence)
++\\LLeftarrow                <char-0x02B45>               " ⭅          : LEFTWARDS QUADRUPLE ARROW
++\\La                        \\La                         "            : (Incomplete sequence)
++\\Lambda                    <char-0x0039B>               " Λ          : GREEK CAPITAL LETTER LAMDA / GREEK CAPITAL LETTER LAMBDA
++\\Lap                       <char-0x029CA>               " ⧊          : TRIANGLE WITH DOT ABOVE
++\\Ld                        \\Ld                         "            : (Incomplete sequence)
++\\Ldsh                      <char-0x021B2>               " ↲          : DOWNWARDS ARROW WITH TIP LEFTWARDS / DOWN ARROW WITH TIP LEFT
++\\Le                        \\Le                         "            : (Incomplete sequence)
++\\LeftDownTeeVector         <char-0x02961>               " ⥡          : DOWNWARDS HARPOON WITH BARB LEFT FROM BAR
++\\LeftDownVectorBar         <char-0x02959>               " ⥙          : DOWNWARDS HARPOON WITH BARB LEFT TO BAR
++\\LeftRightVector           <char-0x0294E>               " ⥎          : LEFT BARB UP RIGHT BARB UP HARPOON
++\\LeftTeeVector             <char-0x0295A>               " ⥚          : LEFTWARDS HARPOON WITH BARB UP FROM BAR
++\\LeftTriangleBar           <char-0x029CF>               " ⧏          : LEFT TRIANGLE BESIDE VERTICAL BAR
++\\LeftUpDownVector          <char-0x02951>               " ⥑          : UP BARB LEFT DOWN BARB LEFT HARPOON
++\\LeftUpTeeVector           <char-0x02960>               " ⥠          : UPWARDS HARPOON WITH BARB LEFT FROM BAR
++\\LeftUpVectorBar           <char-0x02958>               " ⥘          : UPWARDS HARPOON WITH BARB LEFT TO BAR
++\\LeftVectorBar             <char-0x02952>               " ⥒          : LEFTWARDS HARPOON WITH BARB UP TO BAR
++\\Leftarrow                 <char-0x021D0>               " ⇐          : LEFTWARDS DOUBLE ARROW / LEFT DOUBLE ARROW
++\\Leftrightarrow            <char-0x021D4>               " ⇔          : LEFT RIGHT DOUBLE ARROW
++\\Ll                        \\Ll                         "            : (Incomplete sequence)
++\\Lleftarrow                <char-0x021DA>               " ⇚          : LEFTWARDS TRIPLE ARROW / LEFT TRIPLE ARROW
++\\Lo                        \\Lo                         "            : (Incomplete sequence)
++\\Longleftarrow             <char-0x027F8>               " ⟸          : LONG LEFTWARDS DOUBLE ARROW
++\\Longleftrightarrow        <char-0x027FA>               " ⟺          : LONG LEFT RIGHT DOUBLE ARROW
++\\Longmapsfrom              <char-0x027FD>               " ⟽          : LONG LEFTWARDS DOUBLE ARROW FROM BAR
++\\Longmapsto                <char-0x027FE>               " ⟾          : LONG RIGHTWARDS DOUBLE ARROW FROM BAR
++\\Longrightarrow            <char-0x027F9>               " ⟹          : LONG RIGHTWARDS DOUBLE ARROW
++\\Ls                        \\Ls                         "            : (Incomplete sequence)
++\\Lsh                       <char-0x021B0>               " ↰          : UPWARDS ARROW WITH TIP LEFTWARDS / UP ARROW WITH TIP LEFT
++\\Mapsfrom                  <char-0x02906>               " ⤆          : LEFTWARDS DOUBLE ARROW FROM BAR
++\\Mapsto                    <char-0x02907>               " ⤇          : RIGHTWARDS DOUBLE ARROW FROM BAR
++\\NG                        <char-0x0014A>               " Ŋ          : LATIN CAPITAL LETTER ENG
++\\Nearrow                   <char-0x021D7>               " ⇗          : NORTH EAST DOUBLE ARROW / UPPER RIGHT DOUBLE ARROW
++\\NestedGreaterGreater      <char-0x02AA2>               " ⪢          : DOUBLE NESTED GREATER-THAN
++\\NestedLessLess            <char-0x02AA1>               " ⪡          : DOUBLE NESTED LESS-THAN
++\\NotGreaterGreater         <char-0x0226B><char-0x00338> " ≫̸         : MUCH GREATER-THAN / MUCH GREATER THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\NotLeftTriangleBar        <char-0x029CF><char-0x00338> " ⧏̸         : LEFT TRIANGLE BESIDE VERTICAL BAR + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\NotLessLess               <char-0x0226A><char-0x00338> " ≪̸         : MUCH LESS-THAN / MUCH LESS THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\NotNestedGreaterGreater   <char-0x02AA2><char-0x00338> " ⪢̸         : DOUBLE NESTED GREATER-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\NotNestedLessLess         <char-0x02AA1><char-0x00338> " ⪡̸         : DOUBLE NESTED LESS-THAN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\NotRightTriangleBar       <char-0x029D0><char-0x00338> " ⧐̸         : VERTICAL BAR BESIDE RIGHT TRIANGLE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\NotSquareSubset           <char-0x0228F><char-0x00338> " ⊏̸         : SQUARE IMAGE OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\NotSquareSuperset         <char-0x02290><char-0x00338> " ⊐̸         : SQUARE ORIGINAL OF + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\Nwarrow                   <char-0x021D6>               " ⇖          : NORTH WEST DOUBLE ARROW / UPPER LEFT DOUBLE ARROW
++\\O                         <char-0x000D8>               " Ø          : LATIN CAPITAL LETTER O WITH STROKE / LATIN CAPITAL LETTER O SLASH
++\\O<Tab>                    <char-0x000D8>               " Ø          : LATIN CAPITAL LETTER O WITH STROKE / LATIN CAPITAL LETTER O SLASH
++\\OE                        <char-0x00152>               " Œ          : LATIN CAPITAL LIGATURE OE / LATIN CAPITAL LETTER O E
++\\Om                        \\Om                         "            : (Incomplete sequence)
++\\Omega                     <char-0x003A9>               " Ω          : GREEK CAPITAL LETTER OMEGA
++\\Or                        <char-0x02A54>               " ⩔          : DOUBLE LOGICAL OR
++\\Ot                        \\Ot                         "            : (Incomplete sequence)
++\\Otimes                    <char-0x02A37>               " ⨷          : MULTIPLICATION SIGN IN DOUBLE CIRCLE
++\\P                         <char-0x000B6>               " ¶          : PILCROW SIGN / PARAGRAPH SIGN
++\\P<Tab>                    <char-0x000B6>               " ¶          : PILCROW SIGN / PARAGRAPH SIGN
++\\Ph                        \\Ph                         "            : (Incomplete sequence)
++\\Phi                       <char-0x003A6>               " Φ          : GREEK CAPITAL LETTER PHI
++\\Pi                        <char-0x003A0>               " Π          : GREEK CAPITAL LETTER PI
++\\Pr                        \\Pr                         "            : (Incomplete sequence)
++\\Prec                      <char-0x02ABB>               " ⪻          : DOUBLE PRECEDES
++\\PropertyLine              <char-0x0214A>               " ⅊          : PROPERTY LINE
++\\Ps                        \\Ps                         "            : (Incomplete sequence)
++\\Psi                       <char-0x003A8>               " Ψ          : GREEK CAPITAL LETTER PSI
++\\QED                       <char-0x0220E>               " ∎          : END OF PROOF
++\\RRightarrow               <char-0x02B46>               " ⭆          : RIGHTWARDS QUADRUPLE ARROW
++\\Rdsh                      <char-0x021B3>               " ↳          : DOWNWARDS ARROW WITH TIP RIGHTWARDS / DOWN ARROW WITH TIP RIGHT
++\\Re                        <char-0x0211C>               " ℜ          : BLACK-LETTER CAPITAL R / BLACK-LETTER R
++\\Re<Tab>                   <char-0x0211C>               " ℜ          : BLACK-LETTER CAPITAL R / BLACK-LETTER R
++\\Rev                       \\Rev                        "            : (Incomplete sequence)
++\\ReverseUpEquilibrium      <char-0x0296F>               " ⥯          : DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
++\\Rho                       <char-0x003A1>               " Ρ          : GREEK CAPITAL LETTER RHO
++\\RightDownTeeVector        <char-0x0295D>               " ⥝          : DOWNWARDS HARPOON WITH BARB RIGHT FROM BAR
++\\RightDownVectorBar        <char-0x02955>               " ⥕          : DOWNWARDS HARPOON WITH BARB RIGHT TO BAR
++\\RightTeeVector            <char-0x0295B>               " ⥛          : RIGHTWARDS HARPOON WITH BARB UP FROM BAR
++\\RightTriangleBar          <char-0x029D0>               " ⧐          : VERTICAL BAR BESIDE RIGHT TRIANGLE
++\\RightUpDownVector         <char-0x0294F>               " ⥏          : UP BARB RIGHT DOWN BARB RIGHT HARPOON
++\\RightUpTeeVector          <char-0x0295C>               " ⥜          : UPWARDS HARPOON WITH BARB RIGHT FROM BAR
++\\RightUpVectorBar          <char-0x02954>               " ⥔          : UPWARDS HARPOON WITH BARB RIGHT TO BAR
++\\RightVectorBar            <char-0x02953>               " ⥓          : RIGHTWARDS HARPOON WITH BARB UP TO BAR
++\\Rightarrow                <char-0x021D2>               " ⇒          : RIGHTWARDS DOUBLE ARROW / RIGHT DOUBLE ARROW
++\\Rlarr                     <char-0x02942>               " ⥂          : RIGHTWARDS ARROW ABOVE SHORT LEFTWARDS ARROW
++\\RoundImplies              <char-0x02970>               " ⥰          : RIGHT DOUBLE ARROW WITH ROUNDED HEAD
++\\Rrightarrow               <char-0x021DB>               " ⇛          : RIGHTWARDS TRIPLE ARROW / RIGHT TRIPLE ARROW
++\\Rsh                       <char-0x021B1>               " ↱          : UPWARDS ARROW WITH TIP RIGHTWARDS / UP ARROW WITH TIP RIGHT
++\\RuleDelayed               <char-0x029F4>               " ⧴          : RULE-DELAYED
++\\S                         <char-0x000A7>               " §          : SECTION SIGN
++\\S<Tab>                    <char-0x000A7>               " §          : SECTION SIGN
++\\Sa                        \\Sa                         "            : (Incomplete sequence)
++\\Sampi                     <char-0x003E0>               " Ϡ          : GREEK LETTER SAMPI / GREEK CAPITAL LETTER SAMPI
++\\Se                        \\Se                         "            : (Incomplete sequence)
++\\Searrow                   <char-0x021D8>               " ⇘          : SOUTH EAST DOUBLE ARROW / LOWER RIGHT DOUBLE ARROW
++\\Si                        \\Si                         "            : (Incomplete sequence)
++\\Sigma                     <char-0x003A3>               " Σ          : GREEK CAPITAL LETTER SIGMA
++\\Sq                        \\Sq                         "            : (Incomplete sequence)
++\\Sqcap                     <char-0x02A4E>               " ⩎          : DOUBLE SQUARE INTERSECTION
++\\Sqcup                     <char-0x02A4F>               " ⩏          : DOUBLE SQUARE UNION
++\\St                        \\St                         "            : (Incomplete sequence)
++\\Stigma                    <char-0x003DA>               " Ϛ          : GREEK LETTER STIGMA / GREEK CAPITAL LETTER STIGMA
++\\Su                        \\Su                         "            : (Incomplete sequence)
++\\Subset                    <char-0x022D0>               " ⋐          : DOUBLE SUBSET
++\\Succ                      <char-0x02ABC>               " ⪼          : DOUBLE SUCCEEDS
++\\Supset                    <char-0x022D1>               " ⋑          : DOUBLE SUPERSET
++\\Sw                        \\Sw                         "            : (Incomplete sequence)
++\\Swarrow                   <char-0x021D9>               " ⇙          : SOUTH WEST DOUBLE ARROW / LOWER LEFT DOUBLE ARROW
++\\TH                        <char-0x000DE>               " Þ          : LATIN CAPITAL LETTER THORN
++\\Tau                       <char-0x003A4>               " Τ          : GREEK CAPITAL LETTER TAU
++\\Theta                     <char-0x00398>               " Θ          : GREEK CAPITAL LETTER THETA
++\\Times                     <char-0x02A2F>               " ⨯          : VECTOR OR CROSS PRODUCT
++\\Top                       <char-0x02AEA>               " ⫪          : DOUBLE DOWN TACK
++\\UUparrow                  <char-0x027F0>               " ⟰          : UPWARDS QUADRUPLE ARROW
++\\UpArrowBar                <char-0x02912>               " ⤒          : UPWARDS ARROW TO BAR
++\\UpEquilibrium             <char-0x0296E>               " ⥮          : UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
++\\Uparrow                   <char-0x021D1>               " ⇑          : UPWARDS DOUBLE ARROW / UP DOUBLE ARROW
++\\Updownarrow               <char-0x021D5>               " ⇕          : UP DOWN DOUBLE ARROW
++\\Upsilon                   <char-0x003A5>               " Υ          : GREEK CAPITAL LETTER UPSILON
++\\Uuparrow                  <char-0x0290A>               " ⤊          : UPWARDS TRIPLE ARROW
++\\VDash                     <char-0x022AB>               " ⊫          : DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
++\\Vdash                     <char-0x022A9>               " ⊩          : FORCES
++\\Vert                      <char-0x02016>               " ‖          : DOUBLE VERTICAL LINE / DOUBLE VERTICAL BAR
++\\Vvdash                    <char-0x022AA>               " ⊪          : TRIPLE VERTICAL BAR RIGHT TURNSTILE
++\\Vvert                     <char-0x02980>               " ⦀          : TRIPLE VERTICAL BAR DELIMITER
++\\Xi                        <char-0x0039E>               " Ξ          : GREEK CAPITAL LETTER XI
++\\Yup                       <char-0x02144>               " ⅄          : TURNED SANS-SERIF CAPITAL Y
++\\Zbar                      <char-0x001B5>               " Ƶ          : LATIN CAPITAL LETTER Z WITH STROKE / LATIN CAPITAL LETTER Z BAR
++\\Zeta                      <char-0x00396>               " Ζ          : GREEK CAPITAL LETTER ZETA
++\\^!                        <char-0x0A71D>               " ꜝ          : MODIFIER LETTER RAISED EXCLAMATION MARK
++\\^(                        <char-0x0207D>               " ⁽          : SUPERSCRIPT LEFT PARENTHESIS / SUPERSCRIPT OPENING PARENTHESIS
++\\^)                        <char-0x0207E>               " ⁾          : SUPERSCRIPT RIGHT PARENTHESIS / SUPERSCRIPT CLOSING PARENTHESIS
++\\^+                        <char-0x0207A>               " ⁺          : SUPERSCRIPT PLUS SIGN
++\\^-                        <char-0x0207B>               " ⁻          : SUPERSCRIPT MINUS / SUPERSCRIPT HYPHEN-MINUS
++\\^0                        <char-0x02070>               " ⁰          : SUPERSCRIPT ZERO / SUPERSCRIPT DIGIT ZERO
++\\^1                        <char-0x000B9>               " ¹          : SUPERSCRIPT ONE / SUPERSCRIPT DIGIT ONE
++\\^2                        <char-0x000B2>               " ²          : SUPERSCRIPT TWO / SUPERSCRIPT DIGIT TWO
++\\^3                        <char-0x000B3>               " ³          : SUPERSCRIPT THREE / SUPERSCRIPT DIGIT THREE
++\\^4                        <char-0x02074>               " ⁴          : SUPERSCRIPT FOUR / SUPERSCRIPT DIGIT FOUR
++\\^5                        <char-0x02075>               " ⁵          : SUPERSCRIPT FIVE / SUPERSCRIPT DIGIT FIVE
++\\^6                        <char-0x02076>               " ⁶          : SUPERSCRIPT SIX / SUPERSCRIPT DIGIT SIX
++\\^7                        <char-0x02077>               " ⁷          : SUPERSCRIPT SEVEN / SUPERSCRIPT DIGIT SEVEN
++\\^8                        <char-0x02078>               " ⁸          : SUPERSCRIPT EIGHT / SUPERSCRIPT DIGIT EIGHT
++\\^9                        <char-0x02079>               " ⁹          : SUPERSCRIPT NINE / SUPERSCRIPT DIGIT NINE
++\\^=                        <char-0x0207C>               " ⁼          : SUPERSCRIPT EQUALS SIGN
++\\^A                        <char-0x01D2C>               " ᴬ          : MODIFIER LETTER CAPITAL A
++\\^B                        <char-0x01D2E>               " ᴮ          : MODIFIER LETTER CAPITAL B
++\\^D                        <char-0x01D30>               " ᴰ          : MODIFIER LETTER CAPITAL D
++\\^E                        <char-0x01D31>               " ᴱ          : MODIFIER LETTER CAPITAL E
++\\^G                        <char-0x01D33>               " ᴳ          : MODIFIER LETTER CAPITAL G
++\\^H                        <char-0x01D34>               " ᴴ          : MODIFIER LETTER CAPITAL H
++\\^I                        <char-0x01D35>               " ᴵ          : MODIFIER LETTER CAPITAL I
++\\^J                        <char-0x01D36>               " ᴶ          : MODIFIER LETTER CAPITAL J
++\\^K                        <char-0x01D37>               " ᴷ          : MODIFIER LETTER CAPITAL K
++\\^L                        <char-0x01D38>               " ᴸ          : MODIFIER LETTER CAPITAL L
++\\^M                        <char-0x01D39>               " ᴹ          : MODIFIER LETTER CAPITAL M
++\\^N                        <char-0x01D3A>               " ᴺ          : MODIFIER LETTER CAPITAL N
++\\^O                        <char-0x01D3C>               " ᴼ          : MODIFIER LETTER CAPITAL O
++\\^P                        <char-0x01D3E>               " ᴾ          : MODIFIER LETTER CAPITAL P
++\\^R                        <char-0x01D3F>               " ᴿ          : MODIFIER LETTER CAPITAL R
++\\^T                        <char-0x01D40>               " ᵀ          : MODIFIER LETTER CAPITAL T
++\\^U                        <char-0x01D41>               " ᵁ          : MODIFIER LETTER CAPITAL U
++\\^V                        <char-0x02C7D>               " ⱽ          : MODIFIER LETTER CAPITAL V
++\\^W                        <char-0x01D42>               " ᵂ          : MODIFIER LETTER CAPITAL W
++\\^a                        <char-0x01D43>               " ᵃ          : MODIFIER LETTER SMALL A
++\\^a<Tab>                   <char-0x01D43>               " ᵃ          : MODIFIER LETTER SMALL A
++\\^al                       \\^al                        "            : (Incomplete sequence)
++\\^alpha                    <char-0x01D45>               " ᵅ          : MODIFIER LETTER SMALL ALPHA
++\\^b                        <char-0x01D47>               " ᵇ          : MODIFIER LETTER SMALL B
++\\^b<Tab>                   <char-0x01D47>               " ᵇ          : MODIFIER LETTER SMALL B
++\\^be                       \\^be                        "            : (Incomplete sequence)
++\\^beta                     <char-0x01D5D>               " ᵝ          : MODIFIER LETTER SMALL BETA
++\\^c                        <char-0x01D9C>               " ᶜ          : MODIFIER LETTER SMALL C
++\\^c<Tab>                   <char-0x01D9C>               " ᶜ          : MODIFIER LETTER SMALL C
++\\^ch                       \\^ch                        "            : (Incomplete sequence)
++\\^chi                      <char-0x01D61>               " ᵡ          : MODIFIER LETTER SMALL CHI
++\\^d                        <char-0x01D48>               " ᵈ          : MODIFIER LETTER SMALL D
++\\^d<Tab>                   <char-0x01D48>               " ᵈ          : MODIFIER LETTER SMALL D
++\\^de                       \\^de                        "            : (Incomplete sequence)
++\\^delta                    <char-0x01D5F>               " ᵟ          : MODIFIER LETTER SMALL DELTA
++\\^do                       \\^do                        "            : (Incomplete sequence)
++\\^downarrow                <char-0x0A71C>               " ꜜ          : MODIFIER LETTER RAISED DOWN ARROW
++\\^e                        <char-0x01D49>               " ᵉ          : MODIFIER LETTER SMALL E
++\\^e<Tab>                   <char-0x01D49>               " ᵉ          : MODIFIER LETTER SMALL E
++\\^ep                       \\^ep                        "            : (Incomplete sequence)
++\\^epsilon                  <char-0x01D4B>               " ᵋ          : MODIFIER LETTER SMALL OPEN E
++\\^f                        <char-0x01DA0>               " ᶠ          : MODIFIER LETTER SMALL F
++\\^g                        <char-0x01D4D>               " ᵍ          : MODIFIER LETTER SMALL G
++\\^g<Tab>                   <char-0x01D4D>               " ᵍ          : MODIFIER LETTER SMALL G
++\\^ga                       \\^ga                        "            : (Incomplete sequence)
++\\^gamma                    <char-0x01D5E>               " ᵞ          : MODIFIER LETTER SMALL GREEK GAMMA
++\\^h                        <char-0x002B0>               " ʰ          : MODIFIER LETTER SMALL H
++\\^i                        <char-0x02071>               " ⁱ          : SUPERSCRIPT LATIN SMALL LETTER I
++\\^i<Tab>                   <char-0x02071>               " ⁱ          : SUPERSCRIPT LATIN SMALL LETTER I
++\\^io                       \\^io                        "            : (Incomplete sequence)
++\\^iota                     <char-0x01DA5>               " ᶥ          : MODIFIER LETTER SMALL IOTA
++\\^j                        <char-0x002B2>               " ʲ          : MODIFIER LETTER SMALL J
++\\^k                        <char-0x01D4F>               " ᵏ          : MODIFIER LETTER SMALL K
++\\^l                        <char-0x002E1>               " ˡ          : MODIFIER LETTER SMALL L
++\\^l<Tab>                   <char-0x002E1>               " ˡ          : MODIFIER LETTER SMALL L
++\\^lt                       \\^lt                        "            : (Incomplete sequence)
++\\^ltphi                    <char-0x01DB2>               " ᶲ          : MODIFIER LETTER SMALL PHI
++\\^m                        <char-0x01D50>               " ᵐ          : MODIFIER LETTER SMALL M
++\\^n                        <char-0x0207F>               " ⁿ          : SUPERSCRIPT LATIN SMALL LETTER N
++\\^o                        <char-0x01D52>               " ᵒ          : MODIFIER LETTER SMALL O
++\\^p                        <char-0x01D56>               " ᵖ          : MODIFIER LETTER SMALL P
++\\^p<Tab>                   <char-0x01D56>               " ᵖ          : MODIFIER LETTER SMALL P
++\\^ph                       \\^ph                        "            : (Incomplete sequence)
++\\^phi                      <char-0x01D60>               " ᵠ          : MODIFIER LETTER SMALL GREEK PHI
++\\^r                        <char-0x002B3>               " ʳ          : MODIFIER LETTER SMALL R
++\\^s                        <char-0x002E2>               " ˢ          : MODIFIER LETTER SMALL S
++\\^t                        <char-0x01D57>               " ᵗ          : MODIFIER LETTER SMALL T
++\\^t<Tab>                   <char-0x01D57>               " ᵗ          : MODIFIER LETTER SMALL T
++\\^th                       \\^th                        "            : (Incomplete sequence)
++\\^theta                    <char-0x01DBF>               " ᶿ          : MODIFIER LETTER SMALL THETA
++\\^u                        <char-0x01D58>               " ᵘ          : MODIFIER LETTER SMALL U
++\\^u<Tab>                   <char-0x01D58>               " ᵘ          : MODIFIER LETTER SMALL U
++\\^up                       \\^up                        "            : (Incomplete sequence)
++\\^uparrow                  <char-0x0A71B>               " ꜛ          : MODIFIER LETTER RAISED UP ARROW
++\\^v                        <char-0x01D5B>               " ᵛ          : MODIFIER LETTER SMALL V
++\\^w                        <char-0x002B7>               " ʷ          : MODIFIER LETTER SMALL W
++\\^x                        <char-0x002E3>               " ˣ          : MODIFIER LETTER SMALL X
++\\^y                        <char-0x002B8>               " ʸ          : MODIFIER LETTER SMALL Y
++\\^z                        <char-0x01DBB>               " ᶻ          : MODIFIER LETTER SMALL Z
++\\_(                        <char-0x0208D>               " ₍          : SUBSCRIPT LEFT PARENTHESIS / SUBSCRIPT OPENING PARENTHESIS
++\\_)                        <char-0x0208E>               " ₎          : SUBSCRIPT RIGHT PARENTHESIS / SUBSCRIPT CLOSING PARENTHESIS
++\\_+                        <char-0x0208A>               " ₊          : SUBSCRIPT PLUS SIGN
++\\_-                        <char-0x0208B>               " ₋          : SUBSCRIPT MINUS / SUBSCRIPT HYPHEN-MINUS
++\\_0                        <char-0x02080>               " ₀          : SUBSCRIPT ZERO / SUBSCRIPT DIGIT ZERO
++\\_1                        <char-0x02081>               " ₁          : SUBSCRIPT ONE / SUBSCRIPT DIGIT ONE
++\\_2                        <char-0x02082>               " ₂          : SUBSCRIPT TWO / SUBSCRIPT DIGIT TWO
++\\_3                        <char-0x02083>               " ₃          : SUBSCRIPT THREE / SUBSCRIPT DIGIT THREE
++\\_4                        <char-0x02084>               " ₄          : SUBSCRIPT FOUR / SUBSCRIPT DIGIT FOUR
++\\_5                        <char-0x02085>               " ₅          : SUBSCRIPT FIVE / SUBSCRIPT DIGIT FIVE
++\\_6                        <char-0x02086>               " ₆          : SUBSCRIPT SIX / SUBSCRIPT DIGIT SIX
++\\_7                        <char-0x02087>               " ₇          : SUBSCRIPT SEVEN / SUBSCRIPT DIGIT SEVEN
++\\_8                        <char-0x02088>               " ₈          : SUBSCRIPT EIGHT / SUBSCRIPT DIGIT EIGHT
++\\_9                        <char-0x02089>               " ₉          : SUBSCRIPT NINE / SUBSCRIPT DIGIT NINE
++\\_=                        <char-0x0208C>               " ₌          : SUBSCRIPT EQUALS SIGN
++\\_a                        <char-0x02090>               " ₐ          : LATIN SUBSCRIPT SMALL LETTER A
++\\_beta                     <char-0x01D66>               " ᵦ          : GREEK SUBSCRIPT SMALL LETTER BETA
++\\_chi                      <char-0x01D6A>               " ᵪ          : GREEK SUBSCRIPT SMALL LETTER CHI
++\\_e                        <char-0x02091>               " ₑ          : LATIN SUBSCRIPT SMALL LETTER E
++\\_gamma                    <char-0x01D67>               " ᵧ          : GREEK SUBSCRIPT SMALL LETTER GAMMA
++\\_h                        <char-0x02095>               " ₕ          : LATIN SUBSCRIPT SMALL LETTER H
++\\_i                        <char-0x01D62>               " ᵢ          : LATIN SUBSCRIPT SMALL LETTER I
++\\_j                        <char-0x02C7C>               " ⱼ          : LATIN SUBSCRIPT SMALL LETTER J
++\\_k                        <char-0x02096>               " ₖ          : LATIN SUBSCRIPT SMALL LETTER K
++\\_l                        <char-0x02097>               " ₗ          : LATIN SUBSCRIPT SMALL LETTER L
++\\_m                        <char-0x02098>               " ₘ          : LATIN SUBSCRIPT SMALL LETTER M
++\\_n                        <char-0x02099>               " ₙ          : LATIN SUBSCRIPT SMALL LETTER N
++\\_o                        <char-0x02092>               " ₒ          : LATIN SUBSCRIPT SMALL LETTER O
++\\_p                        <char-0x0209A>               " ₚ          : LATIN SUBSCRIPT SMALL LETTER P
++\\_p<Tab>                   <char-0x0209A>               " ₚ          : LATIN SUBSCRIPT SMALL LETTER P
++\\_ph                       \\_ph                        "            : (Incomplete sequence)
++\\_phi                      <char-0x01D69>               " ᵩ          : GREEK SUBSCRIPT SMALL LETTER PHI
++\\_r                        <char-0x01D63>               " ᵣ          : LATIN SUBSCRIPT SMALL LETTER R
++\\_r<Tab>                   <char-0x01D63>               " ᵣ          : LATIN SUBSCRIPT SMALL LETTER R
++\\_rh                       \\_rh                        "            : (Incomplete sequence)
++\\_rho                      <char-0x01D68>               " ᵨ          : GREEK SUBSCRIPT SMALL LETTER RHO
++\\_s                        <char-0x0209B>               " ₛ          : LATIN SUBSCRIPT SMALL LETTER S
++\\_s<Tab>                   <char-0x0209B>               " ₛ          : LATIN SUBSCRIPT SMALL LETTER S
++\\_sc                       \\_sc                        "            : (Incomplete sequence)
++\\_schwa                    <char-0x02094>               " ₔ          : LATIN SUBSCRIPT SMALL LETTER SCHWA
++\\_t                        <char-0x0209C>               " ₜ          : LATIN SUBSCRIPT SMALL LETTER T
++\\_u                        <char-0x01D64>               " ᵤ          : LATIN SUBSCRIPT SMALL LETTER U
++\\_v                        <char-0x01D65>               " ᵥ          : LATIN SUBSCRIPT SMALL LETTER V
++\\_x                        <char-0x02093>               " ₓ          : LATIN SUBSCRIPT SMALL LETTER X
++\\aa                        <char-0x000E5>               " å          : LATIN SMALL LETTER A WITH RING ABOVE / LATIN SMALL LETTER A RING
++\\accurrent                 <char-0x023E6>               " ⏦          : AC CURRENT
++\\acidfree                  <char-0x0267E>               " ♾          : PERMANENT PAPER SIGN
++\\acute                     <char-0x00301>               " ◌́         : COMBINING ACUTE ACCENT / NON-SPACING ACUTE
++\\adots                     <char-0x022F0>               " ⋰          : UP RIGHT DIAGONAL ELLIPSIS
++\\ae                        <char-0x000E6>               " æ          : LATIN SMALL LETTER AE / LATIN SMALL LETTER A E
++\\aleph                     <char-0x02135>               " ℵ          : ALEF SYMBOL / FIRST TRANSFINITE CARDINAL
++\\allequal                  <char-0x0224C>               " ≌          : ALL EQUAL TO
++\\alpha                     <char-0x003B1>               " α          : GREEK SMALL LETTER ALPHA
++\\amalg                     <char-0x02A3F>               " ⨿          : AMALGAMATION OR COPRODUCT
++\\angdnr                    <char-0x0299F>               " ⦟          : ACUTE ANGLE
++\\angle                     <char-0x02220>               " ∠          : ANGLE
++\\angle<Tab>                <char-0x02220>               " ∠          : ANGLE
++\\angles                    <char-0x0299E>               " ⦞          : ANGLE WITH S INSIDE
++\\angleu                    \\angleu                     "            : (Incomplete sequence)
++\\angleubar                 <char-0x029A4>               " ⦤          : ANGLE WITH UNDERBAR
++\\annuity                   <char-0x020E7>               " ◌⃧         : COMBINING ANNUITY SYMBOL
++\\approx                    <char-0x02248>               " ≈          : ALMOST EQUAL TO
++\\approx<Tab>               <char-0x02248>               " ≈          : ALMOST EQUAL TO
++\\approxe                   \\approxe                    "            : (Incomplete sequence)
++\\approxeq                  <char-0x0224A>               " ≊          : ALMOST EQUAL OR EQUAL TO
++\\approxeq<Tab>             <char-0x0224A>               " ≊          : ALMOST EQUAL OR EQUAL TO
++\\approxeqq                 <char-0x02A70>               " ⩰          : APPROXIMATELY EQUAL OR EQUAL TO
++\\approxn                   \\approxn                    "            : (Incomplete sequence)
++\\approxnotequal            <char-0x02246>               " ≆          : APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
++\\aquarius                  <char-0x02652>               " ♒          : AQUARIUS
++\\arceq                     <char-0x02258>               " ≘          : CORRESPONDS TO
++\\aries                     <char-0x02648>               " ♈          : ARIES
++\\ast                       <char-0x02217>               " ∗          : ASTERISK OPERATOR
++\\ast<Tab>                  <char-0x02217>               " ∗          : ASTERISK OPERATOR
++\\aste                      \\aste                       "            : (Incomplete sequence)
++\\asteq                     <char-0x02A6E>               " ⩮          : EQUALS WITH ASTERISK
++\\asteraccent               <char-0x020F0>               " ◌⃰         : COMBINING ASTERISK ABOVE
++\\astr                      \\astr                       "            : (Incomplete sequence)
++\\astrosun                  <char-0x02609>               " ☉          : SUN
++\\asymp                     <char-0x0224D>               " ≍          : EQUIVALENT TO
++\\awint                     <char-0x02A11>               " ⨑          : ANTICLOCKWISE INTEGRATION
++\\backepsilon               <char-0x003F6>               " ϶          : GREEK REVERSED LUNATE EPSILON SYMBOL
++\\backppprime               <char-0x02037>               " ‷          : REVERSED TRIPLE PRIME
++\\backpprime                <char-0x02036>               " ‶          : REVERSED DOUBLE PRIME
++\\backprime                 <char-0x02035>               " ‵          : REVERSED PRIME
++\\backsim                   <char-0x0223D>               " ∽          : REVERSED TILDE
++\\backsim<Tab>              <char-0x0223D>               " ∽          : REVERSED TILDE
++\\backsime                  \\backsime                   "            : (Incomplete sequence)
++\\backsimeq                 <char-0x022CD>               " ⋍          : REVERSED TILDE EQUALS
++\\bagmember                 <char-0x022FF>               " ⋿          : Z NOTATION BAG MEMBERSHIP
++\\bar                       <char-0x00304>               " ◌̄         : COMBINING MACRON / NON-SPACING MACRON
++\\bar<Tab>                  <char-0x00304>               " ◌̄         : COMBINING MACRON / NON-SPACING MACRON
++\\barc                      \\barc                       "            : (Incomplete sequence)
++\\barcap                    <char-0x02A43>               " ⩃          : INTERSECTION WITH OVERBAR
++\\barcup                    <char-0x02A42>               " ⩂          : UNION WITH OVERBAR
++\\barl                      \\barl                       "            : (Incomplete sequence)
++\\barleftarrow              <char-0x021E4>               " ⇤          : LEFTWARDS ARROW TO BAR / LEFT ARROW TO BAR
++\\barleftarrow<Tab>         <char-0x021E4>               " ⇤          : LEFTWARDS ARROW TO BAR / LEFT ARROW TO BAR
++\\barleftarrowr             \\barleftarrowr              "            : (Incomplete sequence)
++\\barleftarrowrightarrowbar <char-0x021B9>               " ↹          : LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR / LEFT ARROW TO BAR OVER RIGHT ARROW TO BAR
++\\baro                      \\baro                       "            : (Incomplete sequence)
++\\barovernorthwestarrow     <char-0x021B8>               " ↸          : NORTH WEST ARROW TO LONG BAR / UPPER LEFT ARROW TO LONG BAR
++\\barr                      \\barr                       "            : (Incomplete sequence)
++\\barrightarrowdiamond      <char-0x02920>               " ⤠          : RIGHTWARDS ARROW FROM BAR TO BLACK DIAMOND
++\\barv                      \\barv                       "            : (Incomplete sequence)
++\\barvee                    <char-0x022BD>               " ⊽          : NOR
++\\barw                      \\barw                       "            : (Incomplete sequence)
++\\barwedge                  <char-0x022BC>               " ⊼          : NAND
++\\bbA                       <char-0x1D538>               " 𝔸          : MATHEMATICAL DOUBLE-STRUCK CAPITAL A
++\\bbB                       <char-0x1D539>               " 𝔹          : MATHEMATICAL DOUBLE-STRUCK CAPITAL B
++\\bbC                       <char-0x02102>               " ℂ          : DOUBLE-STRUCK CAPITAL C / DOUBLE-STRUCK C
++\\bbD                       <char-0x1D53B>               " 𝔻          : MATHEMATICAL DOUBLE-STRUCK CAPITAL D
++\\bbE                       <char-0x1D53C>               " 𝔼          : MATHEMATICAL DOUBLE-STRUCK CAPITAL E
++\\bbF                       <char-0x1D53D>               " 𝔽          : MATHEMATICAL DOUBLE-STRUCK CAPITAL F
++\\bbG                       <char-0x1D53E>               " 𝔾          : MATHEMATICAL DOUBLE-STRUCK CAPITAL G
++\\bbG<Tab>                  <char-0x1D53E>               " 𝔾          : MATHEMATICAL DOUBLE-STRUCK CAPITAL G
++\\bbGa                      \\bbGa                       "            : (Incomplete sequence)
++\\bbGamma                   <char-0x0213E>               " ℾ          : DOUBLE-STRUCK CAPITAL GAMMA
++\\bbH                       <char-0x0210D>               " ℍ          : DOUBLE-STRUCK CAPITAL H / DOUBLE-STRUCK H
++\\bbI                       <char-0x1D540>               " 𝕀          : MATHEMATICAL DOUBLE-STRUCK CAPITAL I
++\\bbJ                       <char-0x1D541>               " 𝕁          : MATHEMATICAL DOUBLE-STRUCK CAPITAL J
++\\bbK                       <char-0x1D542>               " 𝕂          : MATHEMATICAL DOUBLE-STRUCK CAPITAL K
++\\bbL                       <char-0x1D543>               " 𝕃          : MATHEMATICAL DOUBLE-STRUCK CAPITAL L
++\\bbM                       <char-0x1D544>               " 𝕄          : MATHEMATICAL DOUBLE-STRUCK CAPITAL M
++\\bbN                       <char-0x02115>               " ℕ          : DOUBLE-STRUCK CAPITAL N / DOUBLE-STRUCK N
++\\bbO                       <char-0x1D546>               " 𝕆          : MATHEMATICAL DOUBLE-STRUCK CAPITAL O
++\\bbP                       <char-0x02119>               " ℙ          : DOUBLE-STRUCK CAPITAL P / DOUBLE-STRUCK P
++\\bbP<Tab>                  <char-0x02119>               " ℙ          : DOUBLE-STRUCK CAPITAL P / DOUBLE-STRUCK P
++\\bbPi                      <char-0x0213F>               " ℿ          : DOUBLE-STRUCK CAPITAL PI
++\\bbQ                       <char-0x0211A>               " ℚ          : DOUBLE-STRUCK CAPITAL Q / DOUBLE-STRUCK Q
++\\bbR                       <char-0x0211D>               " ℝ          : DOUBLE-STRUCK CAPITAL R / DOUBLE-STRUCK R
++\\bbS                       <char-0x1D54A>               " 𝕊          : MATHEMATICAL DOUBLE-STRUCK CAPITAL S
++\\bbT                       <char-0x1D54B>               " 𝕋          : MATHEMATICAL DOUBLE-STRUCK CAPITAL T
++\\bbU                       <char-0x1D54C>               " 𝕌          : MATHEMATICAL DOUBLE-STRUCK CAPITAL U
++\\bbV                       <char-0x1D54D>               " 𝕍          : MATHEMATICAL DOUBLE-STRUCK CAPITAL V
++\\bbW                       <char-0x1D54E>               " 𝕎          : MATHEMATICAL DOUBLE-STRUCK CAPITAL W
++\\bbX                       <char-0x1D54F>               " 𝕏          : MATHEMATICAL DOUBLE-STRUCK CAPITAL X
++\\bbY                       <char-0x1D550>               " 𝕐          : MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
++\\bbZ                       <char-0x02124>               " ℤ          : DOUBLE-STRUCK CAPITAL Z / DOUBLE-STRUCK Z
++\\bba                       <char-0x1D552>               " 𝕒          : MATHEMATICAL DOUBLE-STRUCK SMALL A
++\\bbb                       <char-0x1D553>               " 𝕓          : MATHEMATICAL DOUBLE-STRUCK SMALL B
++\\bbc                       <char-0x1D554>               " 𝕔          : MATHEMATICAL DOUBLE-STRUCK SMALL C
++\\bbd                       <char-0x1D555>               " 𝕕          : MATHEMATICAL DOUBLE-STRUCK SMALL D
++\\bbe                       <char-0x1D556>               " 𝕖          : MATHEMATICAL DOUBLE-STRUCK SMALL E
++\\bbe<Tab>                  <char-0x1D556>               " 𝕖          : MATHEMATICAL DOUBLE-STRUCK SMALL E
++\\bbei                      \\bbei                       "            : (Incomplete sequence)
++\\bbeight                   <char-0x1D7E0>               " 𝟠          : MATHEMATICAL DOUBLE-STRUCK DIGIT EIGHT
++\\bbf                       <char-0x1D557>               " 𝕗          : MATHEMATICAL DOUBLE-STRUCK SMALL F
++\\bbf<Tab>                  <char-0x1D557>               " 𝕗          : MATHEMATICAL DOUBLE-STRUCK SMALL F
++\\bbfi                      \\bbfi                       "            : (Incomplete sequence)
++\\bbfive                    <char-0x1D7DD>               " 𝟝          : MATHEMATICAL DOUBLE-STRUCK DIGIT FIVE
++\\bbfo                      \\bbfo                       "            : (Incomplete sequence)
++\\bbfour                    <char-0x1D7DC>               " 𝟜          : MATHEMATICAL DOUBLE-STRUCK DIGIT FOUR
++\\bbg                       <char-0x1D558>               " 𝕘          : MATHEMATICAL DOUBLE-STRUCK SMALL G
++\\bbg<Tab>                  <char-0x1D558>               " 𝕘          : MATHEMATICAL DOUBLE-STRUCK SMALL G
++\\bbga                      \\bbga                       "            : (Incomplete sequence)
++\\bbgamma                   <char-0x0213D>               " ℽ          : DOUBLE-STRUCK SMALL GAMMA
++\\bbh                       <char-0x1D559>               " 𝕙          : MATHEMATICAL DOUBLE-STRUCK SMALL H
++\\bbi                       <char-0x1D55A>               " 𝕚          : MATHEMATICAL DOUBLE-STRUCK SMALL I
++\\bbi<Tab>                  <char-0x1D55A>               " 𝕚          : MATHEMATICAL DOUBLE-STRUCK SMALL I
++\\bbiD                      <char-0x02145>               " ⅅ          : DOUBLE-STRUCK ITALIC CAPITAL D
++\\bbid                      <char-0x02146>               " ⅆ          : DOUBLE-STRUCK ITALIC SMALL D
++\\bbie                      <char-0x02147>               " ⅇ          : DOUBLE-STRUCK ITALIC SMALL E
++\\bbii                      <char-0x02148>               " ⅈ          : DOUBLE-STRUCK ITALIC SMALL I
++\\bbij                      <char-0x02149>               " ⅉ          : DOUBLE-STRUCK ITALIC SMALL J
++\\bbj                       <char-0x1D55B>               " 𝕛          : MATHEMATICAL DOUBLE-STRUCK SMALL J
++\\bbk                       <char-0x1D55C>               " 𝕜          : MATHEMATICAL DOUBLE-STRUCK SMALL K
++\\bbl                       <char-0x1D55D>               " 𝕝          : MATHEMATICAL DOUBLE-STRUCK SMALL L
++\\bbm                       <char-0x1D55E>               " 𝕞          : MATHEMATICAL DOUBLE-STRUCK SMALL M
++\\bbn                       <char-0x1D55F>               " 𝕟          : MATHEMATICAL DOUBLE-STRUCK SMALL N
++\\bbn<Tab>                  <char-0x1D55F>               " 𝕟          : MATHEMATICAL DOUBLE-STRUCK SMALL N
++\\bbni                      \\bbni                       "            : (Incomplete sequence)
++\\bbnine                    <char-0x1D7E1>               " 𝟡          : MATHEMATICAL DOUBLE-STRUCK DIGIT NINE
++\\bbo                       <char-0x1D560>               " 𝕠          : MATHEMATICAL DOUBLE-STRUCK SMALL O
++\\bbo<Tab>                  <char-0x1D560>               " 𝕠          : MATHEMATICAL DOUBLE-STRUCK SMALL O
++\\bbon                      \\bbon                       "            : (Incomplete sequence)
++\\bbone                     <char-0x1D7D9>               " 𝟙          : MATHEMATICAL DOUBLE-STRUCK DIGIT ONE
++\\bbp                       <char-0x1D561>               " 𝕡          : MATHEMATICAL DOUBLE-STRUCK SMALL P
++\\bbp<Tab>                  <char-0x1D561>               " 𝕡          : MATHEMATICAL DOUBLE-STRUCK SMALL P
++\\bbpi                      <char-0x0213C>               " ℼ          : DOUBLE-STRUCK SMALL PI
++\\bbq                       <char-0x1D562>               " 𝕢          : MATHEMATICAL DOUBLE-STRUCK SMALL Q
++\\bbr                       <char-0x1D563>               " 𝕣          : MATHEMATICAL DOUBLE-STRUCK SMALL R
++\\bbr<Tab>                  <char-0x1D563>               " 𝕣          : MATHEMATICAL DOUBLE-STRUCK SMALL R
++\\bbrk                      \\bbrk                       "            : (Incomplete sequence)
++\\bbrktbrk                  <char-0x023B6>               " ⎶          : BOTTOM SQUARE BRACKET OVER TOP SQUARE BRACKET
++\\bbs                       <char-0x1D564>               " 𝕤          : MATHEMATICAL DOUBLE-STRUCK SMALL S
++\\bbs<Tab>                  <char-0x1D564>               " 𝕤          : MATHEMATICAL DOUBLE-STRUCK SMALL S
++\\bbse                      \\bbse                       "            : (Incomplete sequence)
++\\bbsemi                    <char-0x02A1F>               " ⨟          : Z NOTATION SCHEMA COMPOSITION
++\\bbseven                   <char-0x1D7DF>               " 𝟟          : MATHEMATICAL DOUBLE-STRUCK DIGIT SEVEN
++\\bbsi                      \\bbsi                       "            : (Incomplete sequence)
++\\bbsix                     <char-0x1D7DE>               " 𝟞          : MATHEMATICAL DOUBLE-STRUCK DIGIT SIX
++\\bbsu                      \\bbsu                       "            : (Incomplete sequence)
++\\bbsum                     <char-0x02140>               " ⅀          : DOUBLE-STRUCK N-ARY SUMMATION
++\\bbt                       <char-0x1D565>               " 𝕥          : MATHEMATICAL DOUBLE-STRUCK SMALL T
++\\bbt<Tab>                  <char-0x1D565>               " 𝕥          : MATHEMATICAL DOUBLE-STRUCK SMALL T
++\\bbth                      \\bbth                       "            : (Incomplete sequence)
++\\bbthree                   <char-0x1D7DB>               " 𝟛          : MATHEMATICAL DOUBLE-STRUCK DIGIT THREE
++\\bbtw                      \\bbtw                       "            : (Incomplete sequence)
++\\bbtwo                     <char-0x1D7DA>               " 𝟚          : MATHEMATICAL DOUBLE-STRUCK DIGIT TWO
++\\bbu                       <char-0x1D566>               " 𝕦          : MATHEMATICAL DOUBLE-STRUCK SMALL U
++\\bbv                       <char-0x1D567>               " 𝕧          : MATHEMATICAL DOUBLE-STRUCK SMALL V
++\\bbw                       <char-0x1D568>               " 𝕨          : MATHEMATICAL DOUBLE-STRUCK SMALL W
++\\bbx                       <char-0x1D569>               " 𝕩          : MATHEMATICAL DOUBLE-STRUCK SMALL X
++\\bby                       <char-0x1D56A>               " 𝕪          : MATHEMATICAL DOUBLE-STRUCK SMALL Y
++\\bbz                       <char-0x1D56B>               " 𝕫          : MATHEMATICAL DOUBLE-STRUCK SMALL Z
++\\bbz<Tab>                  <char-0x1D56B>               " 𝕫          : MATHEMATICAL DOUBLE-STRUCK SMALL Z
++\\bbze                      \\bbze                       "            : (Incomplete sequence)
++\\bbzero                    <char-0x1D7D8>               " 𝟘          : MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO
++\\because                   <char-0x02235>               " ∵          : BECAUSE
++\\benzenr                   <char-0x023E3>               " ⏣          : BENZENE RING WITH CIRCLE
++\\beta                      <char-0x003B2>               " β          : GREEK SMALL LETTER BETA
++\\beth                      <char-0x02136>               " ℶ          : BET SYMBOL / SECOND TRANSFINITE CARDINAL
++\\between                   <char-0x0226C>               " ≬          : BETWEEN
++\\bfA                       <char-0x1D400>               " 𝐀          : MATHEMATICAL BOLD CAPITAL A
++\\bfA<Tab>                  <char-0x1D400>               " 𝐀          : MATHEMATICAL BOLD CAPITAL A
++\\bfAl                      \\bfAl                       "            : (Incomplete sequence)
++\\bfAlpha                   <char-0x1D6A8>               " 𝚨          : MATHEMATICAL BOLD CAPITAL ALPHA
++\\bfB                       <char-0x1D401>               " 𝐁          : MATHEMATICAL BOLD CAPITAL B
++\\bfB<Tab>                  <char-0x1D401>               " 𝐁          : MATHEMATICAL BOLD CAPITAL B
++\\bfBe                      \\bfBe                       "            : (Incomplete sequence)
++\\bfBeta                    <char-0x1D6A9>               " 𝚩          : MATHEMATICAL BOLD CAPITAL BETA
++\\bfC                       <char-0x1D402>               " 𝐂          : MATHEMATICAL BOLD CAPITAL C
++\\bfC<Tab>                  <char-0x1D402>               " 𝐂          : MATHEMATICAL BOLD CAPITAL C
++\\bfCh                      \\bfCh                       "            : (Incomplete sequence)
++\\bfChi                     <char-0x1D6BE>               " 𝚾          : MATHEMATICAL BOLD CAPITAL CHI
++\\bfD                       <char-0x1D403>               " 𝐃          : MATHEMATICAL BOLD CAPITAL D
++\\bfD<Tab>                  <char-0x1D403>               " 𝐃          : MATHEMATICAL BOLD CAPITAL D
++\\bfDe                      \\bfDe                       "            : (Incomplete sequence)
++\\bfDelta                   <char-0x1D6AB>               " 𝚫          : MATHEMATICAL BOLD CAPITAL DELTA
++\\bfDi                      \\bfDi                       "            : (Incomplete sequence)
++\\bfDigamma                 <char-0x1D7CA>               " 𝟊          : MATHEMATICAL BOLD CAPITAL DIGAMMA
++\\bfE                       <char-0x1D404>               " 𝐄          : MATHEMATICAL BOLD CAPITAL E
++\\bfE<Tab>                  <char-0x1D404>               " 𝐄          : MATHEMATICAL BOLD CAPITAL E
++\\bfEp                      \\bfEp                       "            : (Incomplete sequence)
++\\bfEpsilon                 <char-0x1D6AC>               " 𝚬          : MATHEMATICAL BOLD CAPITAL EPSILON
++\\bfEt                      \\bfEt                       "            : (Incomplete sequence)
++\\bfEta                     <char-0x1D6AE>               " 𝚮          : MATHEMATICAL BOLD CAPITAL ETA
++\\bfF                       <char-0x1D405>               " 𝐅          : MATHEMATICAL BOLD CAPITAL F
++\\bfG                       <char-0x1D406>               " 𝐆          : MATHEMATICAL BOLD CAPITAL G
++\\bfG<Tab>                  <char-0x1D406>               " 𝐆          : MATHEMATICAL BOLD CAPITAL G
++\\bfGa                      \\bfGa                       "            : (Incomplete sequence)
++\\bfGamma                   <char-0x1D6AA>               " 𝚪          : MATHEMATICAL BOLD CAPITAL GAMMA
++\\bfH                       <char-0x1D407>               " 𝐇          : MATHEMATICAL BOLD CAPITAL H
++\\bfI                       <char-0x1D408>               " 𝐈          : MATHEMATICAL BOLD CAPITAL I
++\\bfI<Tab>                  <char-0x1D408>               " 𝐈          : MATHEMATICAL BOLD CAPITAL I
++\\bfIo                      \\bfIo                       "            : (Incomplete sequence)
++\\bfIota                    <char-0x1D6B0>               " 𝚰          : MATHEMATICAL BOLD CAPITAL IOTA
++\\bfJ                       <char-0x1D409>               " 𝐉          : MATHEMATICAL BOLD CAPITAL J
++\\bfK                       <char-0x1D40A>               " 𝐊          : MATHEMATICAL BOLD CAPITAL K
++\\bfK<Tab>                  <char-0x1D40A>               " 𝐊          : MATHEMATICAL BOLD CAPITAL K
++\\bfKa                      \\bfKa                       "            : (Incomplete sequence)
++\\bfKappa                   <char-0x1D6B1>               " 𝚱          : MATHEMATICAL BOLD CAPITAL KAPPA
++\\bfL                       <char-0x1D40B>               " 𝐋          : MATHEMATICAL BOLD CAPITAL L
++\\bfL<Tab>                  <char-0x1D40B>               " 𝐋          : MATHEMATICAL BOLD CAPITAL L
++\\bfLa                      \\bfLa                       "            : (Incomplete sequence)
++\\bfLambda                  <char-0x1D6B2>               " 𝚲          : MATHEMATICAL BOLD CAPITAL LAMDA
++\\bfM                       <char-0x1D40C>               " 𝐌          : MATHEMATICAL BOLD CAPITAL M
++\\bfM<Tab>                  <char-0x1D40C>               " 𝐌          : MATHEMATICAL BOLD CAPITAL M
++\\bfMu                      <char-0x1D6B3>               " 𝚳          : MATHEMATICAL BOLD CAPITAL MU
++\\bfN                       <char-0x1D40D>               " 𝐍          : MATHEMATICAL BOLD CAPITAL N
++\\bfN<Tab>                  <char-0x1D40D>               " 𝐍          : MATHEMATICAL BOLD CAPITAL N
++\\bfNu                      <char-0x1D6B4>               " 𝚴          : MATHEMATICAL BOLD CAPITAL NU
++\\bfO                       <char-0x1D40E>               " 𝐎          : MATHEMATICAL BOLD CAPITAL O
++\\bfO<Tab>                  <char-0x1D40E>               " 𝐎          : MATHEMATICAL BOLD CAPITAL O
++\\bfOm                      \\bfOm                       "            : (Incomplete sequence)
++\\bfOmega                   <char-0x1D6C0>               " 𝛀          : MATHEMATICAL BOLD CAPITAL OMEGA
++\\bfOmicron                 <char-0x1D6B6>               " 𝚶          : MATHEMATICAL BOLD CAPITAL OMICRON
++\\bfP                       <char-0x1D40F>               " 𝐏          : MATHEMATICAL BOLD CAPITAL P
++\\bfP<Tab>                  <char-0x1D40F>               " 𝐏          : MATHEMATICAL BOLD CAPITAL P
++\\bfPh                      \\bfPh                       "            : (Incomplete sequence)
++\\bfPhi                     <char-0x1D6BD>               " 𝚽          : MATHEMATICAL BOLD CAPITAL PHI
++\\bfPi                      <char-0x1D6B7>               " 𝚷          : MATHEMATICAL BOLD CAPITAL PI
++\\bfPs                      \\bfPs                       "            : (Incomplete sequence)
++\\bfPsi                     <char-0x1D6BF>               " 𝚿          : MATHEMATICAL BOLD CAPITAL PSI
++\\bfQ                       <char-0x1D410>               " 𝐐          : MATHEMATICAL BOLD CAPITAL Q
++\\bfR                       <char-0x1D411>               " 𝐑          : MATHEMATICAL BOLD CAPITAL R
++\\bfR<Tab>                  <char-0x1D411>               " 𝐑          : MATHEMATICAL BOLD CAPITAL R
++\\bfRh                      \\bfRh                       "            : (Incomplete sequence)
++\\bfRho                     <char-0x1D6B8>               " 𝚸          : MATHEMATICAL BOLD CAPITAL RHO
++\\bfS                       <char-0x1D412>               " 𝐒          : MATHEMATICAL BOLD CAPITAL S
++\\bfS<Tab>                  <char-0x1D412>               " 𝐒          : MATHEMATICAL BOLD CAPITAL S
++\\bfSi                      \\bfSi                       "            : (Incomplete sequence)
++\\bfSigma                   <char-0x1D6BA>               " 𝚺          : MATHEMATICAL BOLD CAPITAL SIGMA
++\\bfT                       <char-0x1D413>               " 𝐓          : MATHEMATICAL BOLD CAPITAL T
++\\bfT<Tab>                  <char-0x1D413>               " 𝐓          : MATHEMATICAL BOLD CAPITAL T
++\\bfTa                      \\bfTa                       "            : (Incomplete sequence)
++\\bfTau                     <char-0x1D6BB>               " 𝚻          : MATHEMATICAL BOLD CAPITAL TAU
++\\bfTh                      \\bfTh                       "            : (Incomplete sequence)
++\\bfTheta                   <char-0x1D6AF>               " 𝚯          : MATHEMATICAL BOLD CAPITAL THETA
++\\bfU                       <char-0x1D414>               " 𝐔          : MATHEMATICAL BOLD CAPITAL U
++\\bfU<Tab>                  <char-0x1D414>               " 𝐔          : MATHEMATICAL BOLD CAPITAL U
++\\bfUp                      \\bfUp                       "            : (Incomplete sequence)
++\\bfUpsilon                 <char-0x1D6BC>               " 𝚼          : MATHEMATICAL BOLD CAPITAL UPSILON
++\\bfV                       <char-0x1D415>               " 𝐕          : MATHEMATICAL BOLD CAPITAL V
++\\bfW                       <char-0x1D416>               " 𝐖          : MATHEMATICAL BOLD CAPITAL W
++\\bfX                       <char-0x1D417>               " 𝐗          : MATHEMATICAL BOLD CAPITAL X
++\\bfX<Tab>                  <char-0x1D417>               " 𝐗          : MATHEMATICAL BOLD CAPITAL X
++\\bfXi                      <char-0x1D6B5>               " 𝚵          : MATHEMATICAL BOLD CAPITAL XI
++\\bfY                       <char-0x1D418>               " 𝐘          : MATHEMATICAL BOLD CAPITAL Y
++\\bfZ                       <char-0x1D419>               " 𝐙          : MATHEMATICAL BOLD CAPITAL Z
++\\bfZ<Tab>                  <char-0x1D419>               " 𝐙          : MATHEMATICAL BOLD CAPITAL Z
++\\bfZe                      \\bfZe                       "            : (Incomplete sequence)
++\\bfZeta                    <char-0x1D6AD>               " 𝚭          : MATHEMATICAL BOLD CAPITAL ZETA
++\\bfa                       <char-0x1D41A>               " 𝐚          : MATHEMATICAL BOLD SMALL A
++\\bfa<Tab>                  <char-0x1D41A>               " 𝐚          : MATHEMATICAL BOLD SMALL A
++\\bfal                      \\bfal                       "            : (Incomplete sequence)
++\\bfalpha                   <char-0x1D6C2>               " 𝛂          : MATHEMATICAL BOLD SMALL ALPHA
++\\bfb                       <char-0x1D41B>               " 𝐛          : MATHEMATICAL BOLD SMALL B
++\\bfb<Tab>                  <char-0x1D41B>               " 𝐛          : MATHEMATICAL BOLD SMALL B
++\\bfbe                      \\bfbe                       "            : (Incomplete sequence)
++\\bfbeta                    <char-0x1D6C3>               " 𝛃          : MATHEMATICAL BOLD SMALL BETA
++\\bfc                       <char-0x1D41C>               " 𝐜          : MATHEMATICAL BOLD SMALL C
++\\bfc<Tab>                  <char-0x1D41C>               " 𝐜          : MATHEMATICAL BOLD SMALL C
++\\bfch                      \\bfch                       "            : (Incomplete sequence)
++\\bfchi                     <char-0x1D6D8>               " 𝛘          : MATHEMATICAL BOLD SMALL CHI
++\\bfd                       <char-0x1D41D>               " 𝐝          : MATHEMATICAL BOLD SMALL D
++\\bfd<Tab>                  <char-0x1D41D>               " 𝐝          : MATHEMATICAL BOLD SMALL D
++\\bfde                      \\bfde                       "            : (Incomplete sequence)
++\\bfdelta                   <char-0x1D6C5>               " 𝛅          : MATHEMATICAL BOLD SMALL DELTA
++\\bfdi                      \\bfdi                       "            : (Incomplete sequence)
++\\bfdigamma                 <char-0x1D7CB>               " 𝟋          : MATHEMATICAL BOLD SMALL DIGAMMA
++\\bfe                       <char-0x1D41E>               " 𝐞          : MATHEMATICAL BOLD SMALL E
++\\bfe<Tab>                  <char-0x1D41E>               " 𝐞          : MATHEMATICAL BOLD SMALL E
++\\bfei                      \\bfei                       "            : (Incomplete sequence)
++\\bfeight                   <char-0x1D7D6>               " 𝟖          : MATHEMATICAL BOLD DIGIT EIGHT
++\\bfep                      \\bfep                       "            : (Incomplete sequence)
++\\bfepsilon                 <char-0x1D6DC>               " 𝛜          : MATHEMATICAL BOLD EPSILON SYMBOL
++\\bfet                      \\bfet                       "            : (Incomplete sequence)
++\\bfeta                     <char-0x1D6C8>               " 𝛈          : MATHEMATICAL BOLD SMALL ETA
++\\bff                       <char-0x1D41F>               " 𝐟          : MATHEMATICAL BOLD SMALL F
++\\bff<Tab>                  <char-0x1D41F>               " 𝐟          : MATHEMATICAL BOLD SMALL F
++\\bffi                      \\bffi                       "            : (Incomplete sequence)
++\\bffive                    <char-0x1D7D3>               " 𝟓          : MATHEMATICAL BOLD DIGIT FIVE
++\\bffo                      \\bffo                       "            : (Incomplete sequence)
++\\bffour                    <char-0x1D7D2>               " 𝟒          : MATHEMATICAL BOLD DIGIT FOUR
++\\bfg                       <char-0x1D420>               " 𝐠          : MATHEMATICAL BOLD SMALL G
++\\bfg<Tab>                  <char-0x1D420>               " 𝐠          : MATHEMATICAL BOLD SMALL G
++\\bfga                      \\bfga                       "            : (Incomplete sequence)
++\\bfgamma                   <char-0x1D6C4>               " 𝛄          : MATHEMATICAL BOLD SMALL GAMMA
++\\bfh                       <char-0x1D421>               " 𝐡          : MATHEMATICAL BOLD SMALL H
++\\bfi                       <char-0x1D422>               " 𝐢          : MATHEMATICAL BOLD SMALL I
++\\bfi<Tab>                  <char-0x1D422>               " 𝐢          : MATHEMATICAL BOLD SMALL I
++\\bfio                      \\bfio                       "            : (Incomplete sequence)
++\\bfiota                    <char-0x1D6CA>               " 𝛊          : MATHEMATICAL BOLD SMALL IOTA
++\\bfj                       <char-0x1D423>               " 𝐣          : MATHEMATICAL BOLD SMALL J
++\\bfk                       <char-0x1D424>               " 𝐤          : MATHEMATICAL BOLD SMALL K
++\\bfk<Tab>                  <char-0x1D424>               " 𝐤          : MATHEMATICAL BOLD SMALL K
++\\bfka                      \\bfka                       "            : (Incomplete sequence)
++\\bfkappa                   <char-0x1D6CB>               " 𝛋          : MATHEMATICAL BOLD SMALL KAPPA
++\\bfl                       <char-0x1D425>               " 𝐥          : MATHEMATICAL BOLD SMALL L
++\\bfl<Tab>                  <char-0x1D425>               " 𝐥          : MATHEMATICAL BOLD SMALL L
++\\bfla                      \\bfla                       "            : (Incomplete sequence)
++\\bflambda                  <char-0x1D6CC>               " 𝛌          : MATHEMATICAL BOLD SMALL LAMDA
++\\bfm                       <char-0x1D426>               " 𝐦          : MATHEMATICAL BOLD SMALL M
++\\bfm<Tab>                  <char-0x1D426>               " 𝐦          : MATHEMATICAL BOLD SMALL M
++\\bfmu                      <char-0x1D6CD>               " 𝛍          : MATHEMATICAL BOLD SMALL MU
++\\bfn                       <char-0x1D427>               " 𝐧          : MATHEMATICAL BOLD SMALL N
++\\bfn<Tab>                  <char-0x1D427>               " 𝐧          : MATHEMATICAL BOLD SMALL N
++\\bfna                      \\bfna                       "            : (Incomplete sequence)
++\\bfnabla                   <char-0x1D6C1>               " 𝛁          : MATHEMATICAL BOLD NABLA
++\\bfni                      \\bfni                       "            : (Incomplete sequence)
++\\bfnine                    <char-0x1D7D7>               " 𝟗          : MATHEMATICAL BOLD DIGIT NINE
++\\bfnu                      <char-0x1D6CE>               " 𝛎          : MATHEMATICAL BOLD SMALL NU
++\\bfo                       <char-0x1D428>               " 𝐨          : MATHEMATICAL BOLD SMALL O
++\\bfo<Tab>                  <char-0x1D428>               " 𝐨          : MATHEMATICAL BOLD SMALL O
++\\bfom                      \\bfom                       "            : (Incomplete sequence)
++\\bfomega                   <char-0x1D6DA>               " 𝛚          : MATHEMATICAL BOLD SMALL OMEGA
++\\bfomicron                 <char-0x1D6D0>               " 𝛐          : MATHEMATICAL BOLD SMALL OMICRON
++\\bfon                      \\bfon                       "            : (Incomplete sequence)
++\\bfone                     <char-0x1D7CF>               " 𝟏          : MATHEMATICAL BOLD DIGIT ONE
++\\bfp                       <char-0x1D429>               " 𝐩          : MATHEMATICAL BOLD SMALL P
++\\bfp<Tab>                  <char-0x1D429>               " 𝐩          : MATHEMATICAL BOLD SMALL P
++\\bfpa                      \\bfpa                       "            : (Incomplete sequence)
++\\bfpartial                 <char-0x1D6DB>               " 𝛛          : MATHEMATICAL BOLD PARTIAL DIFFERENTIAL
++\\bfph                      \\bfph                       "            : (Incomplete sequence)
++\\bfphi                     <char-0x1D6DF>               " 𝛟          : MATHEMATICAL BOLD PHI SYMBOL
++\\bfpi                      <char-0x1D6D1>               " 𝛑          : MATHEMATICAL BOLD SMALL PI
++\\bfps                      \\bfps                       "            : (Incomplete sequence)
++\\bfpsi                     <char-0x1D6D9>               " 𝛙          : MATHEMATICAL BOLD SMALL PSI
++\\bfq                       <char-0x1D42A>               " 𝐪          : MATHEMATICAL BOLD SMALL Q
++\\bfr                       <char-0x1D42B>               " 𝐫          : MATHEMATICAL BOLD SMALL R
++\\bfr<Tab>                  <char-0x1D42B>               " 𝐫          : MATHEMATICAL BOLD SMALL R
++\\bfra                      \\bfra                       "            : (Incomplete sequence)
++\\bfrakA                    <char-0x1D56C>               " 𝕬          : MATHEMATICAL BOLD FRAKTUR CAPITAL A
++\\bfrakB                    <char-0x1D56D>               " 𝕭          : MATHEMATICAL BOLD FRAKTUR CAPITAL B
++\\bfrakC                    <char-0x1D56E>               " 𝕮          : MATHEMATICAL BOLD FRAKTUR CAPITAL C
++\\bfrakD                    <char-0x1D56F>               " 𝕯          : MATHEMATICAL BOLD FRAKTUR CAPITAL D
++\\bfrakE                    <char-0x1D570>               " 𝕰          : MATHEMATICAL BOLD FRAKTUR CAPITAL E
++\\bfrakF                    <char-0x1D571>               " 𝕱          : MATHEMATICAL BOLD FRAKTUR CAPITAL F
++\\bfrakG                    <char-0x1D572>               " 𝕲          : MATHEMATICAL BOLD FRAKTUR CAPITAL G
++\\bfrakH                    <char-0x1D573>               " 𝕳          : MATHEMATICAL BOLD FRAKTUR CAPITAL H
++\\bfrakI                    <char-0x1D574>               " 𝕴          : MATHEMATICAL BOLD FRAKTUR CAPITAL I
++\\bfrakJ                    <char-0x1D575>               " 𝕵          : MATHEMATICAL BOLD FRAKTUR CAPITAL J
++\\bfrakK                    <char-0x1D576>               " 𝕶          : MATHEMATICAL BOLD FRAKTUR CAPITAL K
++\\bfrakL                    <char-0x1D577>               " 𝕷          : MATHEMATICAL BOLD FRAKTUR CAPITAL L
++\\bfrakM                    <char-0x1D578>               " 𝕸          : MATHEMATICAL BOLD FRAKTUR CAPITAL M
++\\bfrakN                    <char-0x1D579>               " 𝕹          : MATHEMATICAL BOLD FRAKTUR CAPITAL N
++\\bfrakO                    <char-0x1D57A>               " 𝕺          : MATHEMATICAL BOLD FRAKTUR CAPITAL O
++\\bfrakP                    <char-0x1D57B>               " 𝕻          : MATHEMATICAL BOLD FRAKTUR CAPITAL P
++\\bfrakQ                    <char-0x1D57C>               " 𝕼          : MATHEMATICAL BOLD FRAKTUR CAPITAL Q
++\\bfrakR                    <char-0x1D57D>               " 𝕽          : MATHEMATICAL BOLD FRAKTUR CAPITAL R
++\\bfrakS                    <char-0x1D57E>               " 𝕾          : MATHEMATICAL BOLD FRAKTUR CAPITAL S
++\\bfrakT                    <char-0x1D57F>               " 𝕿          : MATHEMATICAL BOLD FRAKTUR CAPITAL T
++\\bfrakU                    <char-0x1D580>               " 𝖀          : MATHEMATICAL BOLD FRAKTUR CAPITAL U
++\\bfrakV                    <char-0x1D581>               " 𝖁          : MATHEMATICAL BOLD FRAKTUR CAPITAL V
++\\bfrakW                    <char-0x1D582>               " 𝖂          : MATHEMATICAL BOLD FRAKTUR CAPITAL W
++\\bfrakX                    <char-0x1D583>               " 𝖃          : MATHEMATICAL BOLD FRAKTUR CAPITAL X
++\\bfrakY                    <char-0x1D584>               " 𝖄          : MATHEMATICAL BOLD FRAKTUR CAPITAL Y
++\\bfrakZ                    <char-0x1D585>               " 𝖅          : MATHEMATICAL BOLD FRAKTUR CAPITAL Z
++\\bfraka                    <char-0x1D586>               " 𝖆          : MATHEMATICAL BOLD FRAKTUR SMALL A
++\\bfrakb                    <char-0x1D587>               " 𝖇          : MATHEMATICAL BOLD FRAKTUR SMALL B
++\\bfrakc                    <char-0x1D588>               " 𝖈          : MATHEMATICAL BOLD FRAKTUR SMALL C
++\\bfrakd                    <char-0x1D589>               " 𝖉          : MATHEMATICAL BOLD FRAKTUR SMALL D
++\\bfrake                    <char-0x1D58A>               " 𝖊          : MATHEMATICAL BOLD FRAKTUR SMALL E
++\\bfrakf                    <char-0x1D58B>               " 𝖋          : MATHEMATICAL BOLD FRAKTUR SMALL F
++\\bfrakg                    <char-0x1D58C>               " 𝖌          : MATHEMATICAL BOLD FRAKTUR SMALL G
++\\bfrakh                    <char-0x1D58D>               " 𝖍          : MATHEMATICAL BOLD FRAKTUR SMALL H
++\\bfraki                    <char-0x1D58E>               " 𝖎          : MATHEMATICAL BOLD FRAKTUR SMALL I
++\\bfrakj                    <char-0x1D58F>               " 𝖏          : MATHEMATICAL BOLD FRAKTUR SMALL J
++\\bfrakk                    <char-0x1D590>               " 𝖐          : MATHEMATICAL BOLD FRAKTUR SMALL K
++\\bfrakl                    <char-0x1D591>               " 𝖑          : MATHEMATICAL BOLD FRAKTUR SMALL L
++\\bfrakm                    <char-0x1D592>               " 𝖒          : MATHEMATICAL BOLD FRAKTUR SMALL M
++\\bfrakn                    <char-0x1D593>               " 𝖓          : MATHEMATICAL BOLD FRAKTUR SMALL N
++\\bfrako                    <char-0x1D594>               " 𝖔          : MATHEMATICAL BOLD FRAKTUR SMALL O
++\\bfrakp                    <char-0x1D595>               " 𝖕          : MATHEMATICAL BOLD FRAKTUR SMALL P
++\\bfrakq                    <char-0x1D596>               " 𝖖          : MATHEMATICAL BOLD FRAKTUR SMALL Q
++\\bfrakr                    <char-0x1D597>               " 𝖗          : MATHEMATICAL BOLD FRAKTUR SMALL R
++\\bfraks                    <char-0x1D598>               " 𝖘          : MATHEMATICAL BOLD FRAKTUR SMALL S
++\\bfrakt                    <char-0x1D599>               " 𝖙          : MATHEMATICAL BOLD FRAKTUR SMALL T
++\\bfraku                    <char-0x1D59A>               " 𝖚          : MATHEMATICAL BOLD FRAKTUR SMALL U
++\\bfrakv                    <char-0x1D59B>               " 𝖛          : MATHEMATICAL BOLD FRAKTUR SMALL V
++\\bfrakw                    <char-0x1D59C>               " 𝖜          : MATHEMATICAL BOLD FRAKTUR SMALL W
++\\bfrakx                    <char-0x1D59D>               " 𝖝          : MATHEMATICAL BOLD FRAKTUR SMALL X
++\\bfraky                    <char-0x1D59E>               " 𝖞          : MATHEMATICAL BOLD FRAKTUR SMALL Y
++\\bfrakz                    <char-0x1D59F>               " 𝖟          : MATHEMATICAL BOLD FRAKTUR SMALL Z
++\\bfrh                      \\bfrh                       "            : (Incomplete sequence)
++\\bfrho                     <char-0x1D6D2>               " 𝛒          : MATHEMATICAL BOLD SMALL RHO
++\\bfs                       <char-0x1D42C>               " 𝐬          : MATHEMATICAL BOLD SMALL S
++\\bfs<Tab>                  <char-0x1D42C>               " 𝐬          : MATHEMATICAL BOLD SMALL S
++\\bfse                      \\bfse                       "            : (Incomplete sequence)
++\\bfseven                   <char-0x1D7D5>               " 𝟕          : MATHEMATICAL BOLD DIGIT SEVEN
++\\bfsi                      \\bfsi                       "            : (Incomplete sequence)
++\\bfsigma                   <char-0x1D6D4>               " 𝛔          : MATHEMATICAL BOLD SMALL SIGMA
++\\bfsix                     <char-0x1D7D4>               " 𝟔          : MATHEMATICAL BOLD DIGIT SIX
++\\bft                       <char-0x1D42D>               " 𝐭          : MATHEMATICAL BOLD SMALL T
++\\bft<Tab>                  <char-0x1D42D>               " 𝐭          : MATHEMATICAL BOLD SMALL T
++\\bfta                      \\bfta                       "            : (Incomplete sequence)
++\\bftau                     <char-0x1D6D5>               " 𝛕          : MATHEMATICAL BOLD SMALL TAU
++\\bfth                      \\bfth                       "            : (Incomplete sequence)
++\\bftheta                   <char-0x1D6C9>               " 𝛉          : MATHEMATICAL BOLD SMALL THETA
++\\bfthree                   <char-0x1D7D1>               " 𝟑          : MATHEMATICAL BOLD DIGIT THREE
++\\bftw                      \\bftw                       "            : (Incomplete sequence)
++\\bftwo                     <char-0x1D7D0>               " 𝟐          : MATHEMATICAL BOLD DIGIT TWO
++\\bfu                       <char-0x1D42E>               " 𝐮          : MATHEMATICAL BOLD SMALL U
++\\bfu<Tab>                  <char-0x1D42E>               " 𝐮          : MATHEMATICAL BOLD SMALL U
++\\bfup                      \\bfup                       "            : (Incomplete sequence)
++\\bfupsilon                 <char-0x1D6D6>               " 𝛖          : MATHEMATICAL BOLD SMALL UPSILON
++\\bfv                       <char-0x1D42F>               " 𝐯          : MATHEMATICAL BOLD SMALL V
++\\bfv<Tab>                  <char-0x1D42F>               " 𝐯          : MATHEMATICAL BOLD SMALL V
++\\bfva                      \\bfva                       "            : (Incomplete sequence)
++\\bfvarTheta                <char-0x1D6B9>               " 𝚹          : MATHEMATICAL BOLD CAPITAL THETA SYMBOL
++\\bfvarepsilon              <char-0x1D6C6>               " 𝛆          : MATHEMATICAL BOLD SMALL EPSILON
++\\bfvarkappa                <char-0x1D6DE>               " 𝛞          : MATHEMATICAL BOLD KAPPA SYMBOL
++\\bfvarphi                  <char-0x1D6D7>               " 𝛗          : MATHEMATICAL BOLD SMALL PHI
++\\bfvarpi                   <char-0x1D6E1>               " 𝛡          : MATHEMATICAL BOLD PI SYMBOL
++\\bfvarrho                  <char-0x1D6E0>               " 𝛠          : MATHEMATICAL BOLD RHO SYMBOL
++\\bfvarsigma                <char-0x1D6D3>               " 𝛓          : MATHEMATICAL BOLD SMALL FINAL SIGMA
++\\bfvartheta                <char-0x1D6DD>               " 𝛝          : MATHEMATICAL BOLD THETA SYMBOL
++\\bfw                       <char-0x1D430>               " 𝐰          : MATHEMATICAL BOLD SMALL W
++\\bfx                       <char-0x1D431>               " 𝐱          : MATHEMATICAL BOLD SMALL X
++\\bfx<Tab>                  <char-0x1D431>               " 𝐱          : MATHEMATICAL BOLD SMALL X
++\\bfxi                      <char-0x1D6CF>               " 𝛏          : MATHEMATICAL BOLD SMALL XI
++\\bfy                       <char-0x1D432>               " 𝐲          : MATHEMATICAL BOLD SMALL Y
++\\bfz                       <char-0x1D433>               " 𝐳          : MATHEMATICAL BOLD SMALL Z
++\\bfz<Tab>                  <char-0x1D433>               " 𝐳          : MATHEMATICAL BOLD SMALL Z
++\\bfze                      \\bfze                       "            : (Incomplete sequence)
++\\bfzero                    <char-0x1D7CE>               " 𝟎          : MATHEMATICAL BOLD DIGIT ZERO
++\\bfzeta                    <char-0x1D6C7>               " 𝛇          : MATHEMATICAL BOLD SMALL ZETA
++\\biA                       <char-0x1D468>               " 𝑨          : MATHEMATICAL BOLD ITALIC CAPITAL A
++\\biA<Tab>                  <char-0x1D468>               " 𝑨          : MATHEMATICAL BOLD ITALIC CAPITAL A
++\\biAl                      \\biAl                       "            : (Incomplete sequence)
++\\biAlpha                   <char-0x1D71C>               " 𝜜          : MATHEMATICAL BOLD ITALIC CAPITAL ALPHA
++\\biB                       <char-0x1D469>               " 𝑩          : MATHEMATICAL BOLD ITALIC CAPITAL B
++\\biB<Tab>                  <char-0x1D469>               " 𝑩          : MATHEMATICAL BOLD ITALIC CAPITAL B
++\\biBe                      \\biBe                       "            : (Incomplete sequence)
++\\biBeta                    <char-0x1D71D>               " 𝜝          : MATHEMATICAL BOLD ITALIC CAPITAL BETA
++\\biC                       <char-0x1D46A>               " 𝑪          : MATHEMATICAL BOLD ITALIC CAPITAL C
++\\biC<Tab>                  <char-0x1D46A>               " 𝑪          : MATHEMATICAL BOLD ITALIC CAPITAL C
++\\biCh                      \\biCh                       "            : (Incomplete sequence)
++\\biChi                     <char-0x1D732>               " 𝜲          : MATHEMATICAL BOLD ITALIC CAPITAL CHI
++\\biD                       <char-0x1D46B>               " 𝑫          : MATHEMATICAL BOLD ITALIC CAPITAL D
++\\biD<Tab>                  <char-0x1D46B>               " 𝑫          : MATHEMATICAL BOLD ITALIC CAPITAL D
++\\biDe                      \\biDe                       "            : (Incomplete sequence)
++\\biDelta                   <char-0x1D71F>               " 𝜟          : MATHEMATICAL BOLD ITALIC CAPITAL DELTA
++\\biE                       <char-0x1D46C>               " 𝑬          : MATHEMATICAL BOLD ITALIC CAPITAL E
++\\biE<Tab>                  <char-0x1D46C>               " 𝑬          : MATHEMATICAL BOLD ITALIC CAPITAL E
++\\biEp                      \\biEp                       "            : (Incomplete sequence)
++\\biEpsilon                 <char-0x1D720>               " 𝜠          : MATHEMATICAL BOLD ITALIC CAPITAL EPSILON
++\\biEt                      \\biEt                       "            : (Incomplete sequence)
++\\biEta                     <char-0x1D722>               " 𝜢          : MATHEMATICAL BOLD ITALIC CAPITAL ETA
++\\biF                       <char-0x1D46D>               " 𝑭          : MATHEMATICAL BOLD ITALIC CAPITAL F
++\\biG                       <char-0x1D46E>               " 𝑮          : MATHEMATICAL BOLD ITALIC CAPITAL G
++\\biG<Tab>                  <char-0x1D46E>               " 𝑮          : MATHEMATICAL BOLD ITALIC CAPITAL G
++\\biGa                      \\biGa                       "            : (Incomplete sequence)
++\\biGamma                   <char-0x1D71E>               " 𝜞          : MATHEMATICAL BOLD ITALIC CAPITAL GAMMA
++\\biH                       <char-0x1D46F>               " 𝑯          : MATHEMATICAL BOLD ITALIC CAPITAL H
++\\biI                       <char-0x1D470>               " 𝑰          : MATHEMATICAL BOLD ITALIC CAPITAL I
++\\biI<Tab>                  <char-0x1D470>               " 𝑰          : MATHEMATICAL BOLD ITALIC CAPITAL I
++\\biIo                      \\biIo                       "            : (Incomplete sequence)
++\\biIota                    <char-0x1D724>               " 𝜤          : MATHEMATICAL BOLD ITALIC CAPITAL IOTA
++\\biJ                       <char-0x1D471>               " 𝑱          : MATHEMATICAL BOLD ITALIC CAPITAL J
++\\biK                       <char-0x1D472>               " 𝑲          : MATHEMATICAL BOLD ITALIC CAPITAL K
++\\biK<Tab>                  <char-0x1D472>               " 𝑲          : MATHEMATICAL BOLD ITALIC CAPITAL K
++\\biKa                      \\biKa                       "            : (Incomplete sequence)
++\\biKappa                   <char-0x1D725>               " 𝜥          : MATHEMATICAL BOLD ITALIC CAPITAL KAPPA
++\\biL                       <char-0x1D473>               " 𝑳          : MATHEMATICAL BOLD ITALIC CAPITAL L
++\\biL<Tab>                  <char-0x1D473>               " 𝑳          : MATHEMATICAL BOLD ITALIC CAPITAL L
++\\biLa                      \\biLa                       "            : (Incomplete sequence)
++\\biLambda                  <char-0x1D726>               " 𝜦          : MATHEMATICAL BOLD ITALIC CAPITAL LAMDA
++\\biM                       <char-0x1D474>               " 𝑴          : MATHEMATICAL BOLD ITALIC CAPITAL M
++\\biM<Tab>                  <char-0x1D474>               " 𝑴          : MATHEMATICAL BOLD ITALIC CAPITAL M
++\\biMu                      <char-0x1D727>               " 𝜧          : MATHEMATICAL BOLD ITALIC CAPITAL MU
++\\biN                       <char-0x1D475>               " 𝑵          : MATHEMATICAL BOLD ITALIC CAPITAL N
++\\biN<Tab>                  <char-0x1D475>               " 𝑵          : MATHEMATICAL BOLD ITALIC CAPITAL N
++\\biNu                      <char-0x1D728>               " 𝜨          : MATHEMATICAL BOLD ITALIC CAPITAL NU
++\\biO                       <char-0x1D476>               " 𝑶          : MATHEMATICAL BOLD ITALIC CAPITAL O
++\\biO<Tab>                  <char-0x1D476>               " 𝑶          : MATHEMATICAL BOLD ITALIC CAPITAL O
++\\biOm                      \\biOm                       "            : (Incomplete sequence)
++\\biOmega                   <char-0x1D734>               " 𝜴          : MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
++\\biOmicron                 <char-0x1D72A>               " 𝜪          : MATHEMATICAL BOLD ITALIC CAPITAL OMICRON
++\\biP                       <char-0x1D477>               " 𝑷          : MATHEMATICAL BOLD ITALIC CAPITAL P
++\\biP<Tab>                  <char-0x1D477>               " 𝑷          : MATHEMATICAL BOLD ITALIC CAPITAL P
++\\biPh                      \\biPh                       "            : (Incomplete sequence)
++\\biPhi                     <char-0x1D731>               " 𝜱          : MATHEMATICAL BOLD ITALIC CAPITAL PHI
++\\biPi                      <char-0x1D72B>               " 𝜫          : MATHEMATICAL BOLD ITALIC CAPITAL PI
++\\biPs                      \\biPs                       "            : (Incomplete sequence)
++\\biPsi                     <char-0x1D733>               " 𝜳          : MATHEMATICAL BOLD ITALIC CAPITAL PSI
++\\biQ                       <char-0x1D478>               " 𝑸          : MATHEMATICAL BOLD ITALIC CAPITAL Q
++\\biR                       <char-0x1D479>               " 𝑹          : MATHEMATICAL BOLD ITALIC CAPITAL R
++\\biR<Tab>                  <char-0x1D479>               " 𝑹          : MATHEMATICAL BOLD ITALIC CAPITAL R
++\\biRh                      \\biRh                       "            : (Incomplete sequence)
++\\biRho                     <char-0x1D72C>               " 𝜬          : MATHEMATICAL BOLD ITALIC CAPITAL RHO
++\\biS                       <char-0x1D47A>               " 𝑺          : MATHEMATICAL BOLD ITALIC CAPITAL S
++\\biS<Tab>                  <char-0x1D47A>               " 𝑺          : MATHEMATICAL BOLD ITALIC CAPITAL S
++\\biSi                      \\biSi                       "            : (Incomplete sequence)
++\\biSigma                   <char-0x1D72E>               " 𝜮          : MATHEMATICAL BOLD ITALIC CAPITAL SIGMA
++\\biT                       <char-0x1D47B>               " 𝑻          : MATHEMATICAL BOLD ITALIC CAPITAL T
++\\biT<Tab>                  <char-0x1D47B>               " 𝑻          : MATHEMATICAL BOLD ITALIC CAPITAL T
++\\biTa                      \\biTa                       "            : (Incomplete sequence)
++\\biTau                     <char-0x1D72F>               " 𝜯          : MATHEMATICAL BOLD ITALIC CAPITAL TAU
++\\biTh                      \\biTh                       "            : (Incomplete sequence)
++\\biTheta                   <char-0x1D723>               " 𝜣          : MATHEMATICAL BOLD ITALIC CAPITAL THETA
++\\biU                       <char-0x1D47C>               " 𝑼          : MATHEMATICAL BOLD ITALIC CAPITAL U
++\\biU<Tab>                  <char-0x1D47C>               " 𝑼          : MATHEMATICAL BOLD ITALIC CAPITAL U
++\\biUp                      \\biUp                       "            : (Incomplete sequence)
++\\biUpsilon                 <char-0x1D730>               " 𝜰          : MATHEMATICAL BOLD ITALIC CAPITAL UPSILON
++\\biV                       <char-0x1D47D>               " 𝑽          : MATHEMATICAL BOLD ITALIC CAPITAL V
++\\biW                       <char-0x1D47E>               " 𝑾          : MATHEMATICAL BOLD ITALIC CAPITAL W
++\\biX                       <char-0x1D47F>               " 𝑿          : MATHEMATICAL BOLD ITALIC CAPITAL X
++\\biX<Tab>                  <char-0x1D47F>               " 𝑿          : MATHEMATICAL BOLD ITALIC CAPITAL X
++\\biXi                      <char-0x1D729>               " 𝜩          : MATHEMATICAL BOLD ITALIC CAPITAL XI
++\\biY                       <char-0x1D480>               " 𝒀          : MATHEMATICAL BOLD ITALIC CAPITAL Y
++\\biZ                       <char-0x1D481>               " 𝒁          : MATHEMATICAL BOLD ITALIC CAPITAL Z
++\\biZ<Tab>                  <char-0x1D481>               " 𝒁          : MATHEMATICAL BOLD ITALIC CAPITAL Z
++\\biZe                      \\biZe                       "            : (Incomplete sequence)
++\\biZeta                    <char-0x1D721>               " 𝜡          : MATHEMATICAL BOLD ITALIC CAPITAL ZETA
++\\bia                       <char-0x1D482>               " 𝒂          : MATHEMATICAL BOLD ITALIC SMALL A
++\\bia<Tab>                  <char-0x1D482>               " 𝒂          : MATHEMATICAL BOLD ITALIC SMALL A
++\\bial                      \\bial                       "            : (Incomplete sequence)
++\\bialpha                   <char-0x1D736>               " 𝜶          : MATHEMATICAL BOLD ITALIC SMALL ALPHA
++\\bib                       <char-0x1D483>               " 𝒃          : MATHEMATICAL BOLD ITALIC SMALL B
++\\bib<Tab>                  <char-0x1D483>               " 𝒃          : MATHEMATICAL BOLD ITALIC SMALL B
++\\bibe                      \\bibe                       "            : (Incomplete sequence)
++\\bibeta                    <char-0x1D737>               " 𝜷          : MATHEMATICAL BOLD ITALIC SMALL BETA
++\\bic                       <char-0x1D484>               " 𝒄          : MATHEMATICAL BOLD ITALIC SMALL C
++\\bic<Tab>                  <char-0x1D484>               " 𝒄          : MATHEMATICAL BOLD ITALIC SMALL C
++\\bich                      \\bich                       "            : (Incomplete sequence)
++\\bichi                     <char-0x1D74C>               " 𝝌          : MATHEMATICAL BOLD ITALIC SMALL CHI
++\\bid                       <char-0x1D485>               " 𝒅          : MATHEMATICAL BOLD ITALIC SMALL D
++\\bid<Tab>                  <char-0x1D485>               " 𝒅          : MATHEMATICAL BOLD ITALIC SMALL D
++\\bide                      \\bide                       "            : (Incomplete sequence)
++\\bidelta                   <char-0x1D739>               " 𝜹          : MATHEMATICAL BOLD ITALIC SMALL DELTA
++\\bie                       <char-0x1D486>               " 𝒆          : MATHEMATICAL BOLD ITALIC SMALL E
++\\bie<Tab>                  <char-0x1D486>               " 𝒆          : MATHEMATICAL BOLD ITALIC SMALL E
++\\biep                      \\biep                       "            : (Incomplete sequence)
++\\biepsilon                 <char-0x1D750>               " 𝝐          : MATHEMATICAL BOLD ITALIC EPSILON SYMBOL
++\\biet                      \\biet                       "            : (Incomplete sequence)
++\\bieta                     <char-0x1D73C>               " 𝜼          : MATHEMATICAL BOLD ITALIC SMALL ETA
++\\bif                       <char-0x1D487>               " 𝒇          : MATHEMATICAL BOLD ITALIC SMALL F
++\\big                       <char-0x1D488>               " 𝒈          : MATHEMATICAL BOLD ITALIC SMALL G
++\\big<Tab>                  <char-0x1D488>               " 𝒈          : MATHEMATICAL BOLD ITALIC SMALL G
++\\biga                      \\biga                       "            : (Incomplete sequence)
++\\bigamma                   <char-0x1D738>               " 𝜸          : MATHEMATICAL BOLD ITALIC SMALL GAMMA
++\\bigb                      \\bigb                       "            : (Incomplete sequence)
++\\bigblacktriangledown      <char-0x025BC>               " ▼          : BLACK DOWN-POINTING TRIANGLE / BLACK DOWN POINTING TRIANGLE
++\\bigblacktriangleup        <char-0x025B2>               " ▲          : BLACK UP-POINTING TRIANGLE / BLACK UP POINTING TRIANGLE
++\\bigbot                    <char-0x027D8>               " ⟘          : LARGE UP TACK
++\\bigc                      \\bigc                       "            : (Incomplete sequence)
++\\bigcap                    <char-0x022C2>               " ⋂          : N-ARY INTERSECTION
++\\bigcirc                   <char-0x025CB>               " ○          : WHITE CIRCLE
++\\bigcup                    <char-0x022C3>               " ⋃          : N-ARY UNION
++\\bigcup<Tab>               <char-0x022C3>               " ⋃          : N-ARY UNION
++\\bigcupd                   \\bigcupd                    "            : (Incomplete sequence)
++\\bigcupdot                 <char-0x02A03>               " ⨃          : N-ARY UNION OPERATOR WITH DOT
++\\bigo                      \\bigo                       "            : (Incomplete sequence)
++\\bigodot                   <char-0x02A00>               " ⨀          : N-ARY CIRCLED DOT OPERATOR
++\\bigoplus                  <char-0x02A01>               " ⨁          : N-ARY CIRCLED PLUS OPERATOR
++\\bigotimes                 <char-0x02A02>               " ⨂          : N-ARY CIRCLED TIMES OPERATOR
++\\bigs                      \\bigs                       "            : (Incomplete sequence)
++\\bigslopedvee              <char-0x02A57>               " ⩗          : SLOPING LARGE OR
++\\bigslopedwedge            <char-0x02A58>               " ⩘          : SLOPING LARGE AND
++\\bigsqcap                  <char-0x02A05>               " ⨅          : N-ARY SQUARE INTERSECTION OPERATOR
++\\bigsqcup                  <char-0x02A06>               " ⨆          : N-ARY SQUARE UNION OPERATOR
++\\bigstar                   <char-0x02605>               " ★          : BLACK STAR
++\\bigt                      \\bigt                       "            : (Incomplete sequence)
++\\bigtimes                  <char-0x02A09>               " ⨉          : N-ARY TIMES OPERATOR
++\\bigtop                    <char-0x027D9>               " ⟙          : LARGE DOWN TACK
++\\bigtriangledown           <char-0x025BD>               " ▽          : WHITE DOWN-POINTING TRIANGLE / WHITE DOWN POINTING TRIANGLE
++\\bigtriangleup             <char-0x025B3>               " △          : WHITE UP-POINTING TRIANGLE / WHITE UP POINTING TRIANGLE
++\\bigu                      \\bigu                       "            : (Incomplete sequence)
++\\biguplus                  <char-0x02A04>               " ⨄          : N-ARY UNION OPERATOR WITH PLUS
++\\bigv                      \\bigv                       "            : (Incomplete sequence)
++\\bigvee                    <char-0x022C1>               " ⋁          : N-ARY LOGICAL OR
++\\bigw                      \\bigw                       "            : (Incomplete sequence)
++\\bigwedge                  <char-0x022C0>               " ⋀          : N-ARY LOGICAL AND
++\\bigwhitestar              <char-0x02606>               " ☆          : WHITE STAR
++\\bih                       <char-0x1D489>               " 𝒉          : MATHEMATICAL BOLD ITALIC SMALL H
++\\bii                       <char-0x1D48A>               " 𝒊          : MATHEMATICAL BOLD ITALIC SMALL I
++\\bii<Tab>                  <char-0x1D48A>               " 𝒊          : MATHEMATICAL BOLD ITALIC SMALL I
++\\biio                      \\biio                       "            : (Incomplete sequence)
++\\biiota                    <char-0x1D73E>               " 𝜾          : MATHEMATICAL BOLD ITALIC SMALL IOTA
++\\bij                       <char-0x1D48B>               " 𝒋          : MATHEMATICAL BOLD ITALIC SMALL J
++\\bik                       <char-0x1D48C>               " 𝒌          : MATHEMATICAL BOLD ITALIC SMALL K
++\\bik<Tab>                  <char-0x1D48C>               " 𝒌          : MATHEMATICAL BOLD ITALIC SMALL K
++\\bika                      \\bika                       "            : (Incomplete sequence)
++\\bikappa                   <char-0x1D73F>               " 𝜿          : MATHEMATICAL BOLD ITALIC SMALL KAPPA
++\\bil                       <char-0x1D48D>               " 𝒍          : MATHEMATICAL BOLD ITALIC SMALL L
++\\bil<Tab>                  <char-0x1D48D>               " 𝒍          : MATHEMATICAL BOLD ITALIC SMALL L
++\\bila                      \\bila                       "            : (Incomplete sequence)
++\\bilambda                  <char-0x1D740>               " 𝝀          : MATHEMATICAL BOLD ITALIC SMALL LAMDA
++\\bim                       <char-0x1D48E>               " 𝒎          : MATHEMATICAL BOLD ITALIC SMALL M
++\\bim<Tab>                  <char-0x1D48E>               " 𝒎          : MATHEMATICAL BOLD ITALIC SMALL M
++\\bimu                      <char-0x1D741>               " 𝝁          : MATHEMATICAL BOLD ITALIC SMALL MU
++\\bin                       <char-0x1D48F>               " 𝒏          : MATHEMATICAL BOLD ITALIC SMALL N
++\\bin<Tab>                  <char-0x1D48F>               " 𝒏          : MATHEMATICAL BOLD ITALIC SMALL N
++\\bina                      \\bina                       "            : (Incomplete sequence)
++\\binabla                   <char-0x1D735>               " 𝜵          : MATHEMATICAL BOLD ITALIC NABLA
++\\binu                      <char-0x1D742>               " 𝝂          : MATHEMATICAL BOLD ITALIC SMALL NU
++\\bio                       <char-0x1D490>               " 𝒐          : MATHEMATICAL BOLD ITALIC SMALL O
++\\bio<Tab>                  <char-0x1D490>               " 𝒐          : MATHEMATICAL BOLD ITALIC SMALL O
++\\biom                      \\biom                       "            : (Incomplete sequence)
++\\biomega                   <char-0x1D74E>               " 𝝎          : MATHEMATICAL BOLD ITALIC SMALL OMEGA
++\\biomicron                 <char-0x1D744>               " 𝝄          : MATHEMATICAL BOLD ITALIC SMALL OMICRON
++\\bip                       <char-0x1D491>               " 𝒑          : MATHEMATICAL BOLD ITALIC SMALL P
++\\bip<Tab>                  <char-0x1D491>               " 𝒑          : MATHEMATICAL BOLD ITALIC SMALL P
++\\bipa                      \\bipa                       "            : (Incomplete sequence)
++\\bipartial                 <char-0x1D74F>               " 𝝏          : MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL
++\\biph                      \\biph                       "            : (Incomplete sequence)
++\\biphi                     <char-0x1D753>               " 𝝓          : MATHEMATICAL BOLD ITALIC PHI SYMBOL
++\\bipi                      <char-0x1D745>               " 𝝅          : MATHEMATICAL BOLD ITALIC SMALL PI
++\\bips                      \\bips                       "            : (Incomplete sequence)
++\\bipsi                     <char-0x1D74D>               " 𝝍          : MATHEMATICAL BOLD ITALIC SMALL PSI
++\\biq                       <char-0x1D492>               " 𝒒          : MATHEMATICAL BOLD ITALIC SMALL Q
++\\bir                       <char-0x1D493>               " 𝒓          : MATHEMATICAL BOLD ITALIC SMALL R
++\\bir<Tab>                  <char-0x1D493>               " 𝒓          : MATHEMATICAL BOLD ITALIC SMALL R
++\\birh                      \\birh                       "            : (Incomplete sequence)
++\\birho                     <char-0x1D746>               " 𝝆          : MATHEMATICAL BOLD ITALIC SMALL RHO
++\\bis                       <char-0x1D494>               " 𝒔          : MATHEMATICAL BOLD ITALIC SMALL S
++\\bis<Tab>                  <char-0x1D494>               " 𝒔          : MATHEMATICAL BOLD ITALIC SMALL S
++\\bisa                      \\bisa                       "            : (Incomplete sequence)
++\\bisansA                   <char-0x1D63C>               " 𝘼          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A
++\\bisansA<Tab>              <char-0x1D63C>               " 𝘼          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A
++\\bisansAl                  \\bisansAl                   "            : (Incomplete sequence)
++\\bisansAlpha               <char-0x1D790>               " 𝞐          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA
++\\bisansB                   <char-0x1D63D>               " 𝘽          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B
++\\bisansB<Tab>              <char-0x1D63D>               " 𝘽          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL B
++\\bisansBe                  \\bisansBe                   "            : (Incomplete sequence)
++\\bisansBeta                <char-0x1D791>               " 𝞑          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL BETA
++\\bisansC                   <char-0x1D63E>               " 𝘾          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C
++\\bisansC<Tab>              <char-0x1D63E>               " 𝘾          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL C
++\\bisansCh                  \\bisansCh                   "            : (Incomplete sequence)
++\\bisansChi                 <char-0x1D7A6>               " 𝞦          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL CHI
++\\bisansD                   <char-0x1D63F>               " 𝘿          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D
++\\bisansD<Tab>              <char-0x1D63F>               " 𝘿          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL D
++\\bisansDe                  \\bisansDe                   "            : (Incomplete sequence)
++\\bisansDelta               <char-0x1D793>               " 𝞓          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL DELTA
++\\bisansE                   <char-0x1D640>               " 𝙀          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E
++\\bisansE<Tab>              <char-0x1D640>               " 𝙀          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL E
++\\bisansEp                  \\bisansEp                   "            : (Incomplete sequence)
++\\bisansEpsilon             <char-0x1D794>               " 𝞔          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL EPSILON
++\\bisansEt                  \\bisansEt                   "            : (Incomplete sequence)
++\\bisansEta                 <char-0x1D796>               " 𝞖          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ETA
++\\bisansF                   <char-0x1D641>               " 𝙁          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL F
++\\bisansG                   <char-0x1D642>               " 𝙂          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G
++\\bisansG<Tab>              <char-0x1D642>               " 𝙂          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL G
++\\bisansGa                  \\bisansGa                   "            : (Incomplete sequence)
++\\bisansGamma               <char-0x1D792>               " 𝞒          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL GAMMA
++\\bisansH                   <char-0x1D643>               " 𝙃          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL H
++\\bisansI                   <char-0x1D644>               " 𝙄          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I
++\\bisansI<Tab>              <char-0x1D644>               " 𝙄          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I
++\\bisansIo                  \\bisansIo                   "            : (Incomplete sequence)
++\\bisansIota                <char-0x1D798>               " 𝞘          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL IOTA
++\\bisansJ                   <char-0x1D645>               " 𝙅          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL J
++\\bisansK                   <char-0x1D646>               " 𝙆          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K
++\\bisansK<Tab>              <char-0x1D646>               " 𝙆          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL K
++\\bisansKa                  \\bisansKa                   "            : (Incomplete sequence)
++\\bisansKappa               <char-0x1D799>               " 𝞙          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL KAPPA
++\\bisansL                   <char-0x1D647>               " 𝙇          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L
++\\bisansL<Tab>              <char-0x1D647>               " 𝙇          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL L
++\\bisansLa                  \\bisansLa                   "            : (Incomplete sequence)
++\\bisansLambda              <char-0x1D79A>               " 𝞚          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL LAMDA
++\\bisansM                   <char-0x1D648>               " 𝙈          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M
++\\bisansM<Tab>              <char-0x1D648>               " 𝙈          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL M
++\\bisansMu                  <char-0x1D79B>               " 𝞛          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL MU
++\\bisansN                   <char-0x1D649>               " 𝙉          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N
++\\bisansN<Tab>              <char-0x1D649>               " 𝙉          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL N
++\\bisansNu                  <char-0x1D79C>               " 𝞜          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL NU
++\\bisansO                   <char-0x1D64A>               " 𝙊          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O
++\\bisansO<Tab>              <char-0x1D64A>               " 𝙊          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL O
++\\bisansOm                  \\bisansOm                   "            : (Incomplete sequence)
++\\bisansOmega               <char-0x1D7A8>               " 𝞨          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
++\\bisansOmicron             <char-0x1D79E>               " 𝞞          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMICRON
++\\bisansP                   <char-0x1D64B>               " 𝙋          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P
++\\bisansP<Tab>              <char-0x1D64B>               " 𝙋          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL P
++\\bisansPh                  \\bisansPh                   "            : (Incomplete sequence)
++\\bisansPhi                 <char-0x1D7A5>               " 𝞥          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PHI
++\\bisansPi                  <char-0x1D79F>               " 𝞟          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PI
++\\bisansPs                  \\bisansPs                   "            : (Incomplete sequence)
++\\bisansPsi                 <char-0x1D7A7>               " 𝞧          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL PSI
++\\bisansQ                   <char-0x1D64C>               " 𝙌          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Q
++\\bisansR                   <char-0x1D64D>               " 𝙍          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R
++\\bisansR<Tab>              <char-0x1D64D>               " 𝙍          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL R
++\\bisansRh                  \\bisansRh                   "            : (Incomplete sequence)
++\\bisansRho                 <char-0x1D7A0>               " 𝞠          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL RHO
++\\bisansS                   <char-0x1D64E>               " 𝙎          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S
++\\bisansS<Tab>              <char-0x1D64E>               " 𝙎          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL S
++\\bisansSi                  \\bisansSi                   "            : (Incomplete sequence)
++\\bisansSigma               <char-0x1D7A2>               " 𝞢          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL SIGMA
++\\bisansT                   <char-0x1D64F>               " 𝙏          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T
++\\bisansT<Tab>              <char-0x1D64F>               " 𝙏          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL T
++\\bisansTa                  \\bisansTa                   "            : (Incomplete sequence)
++\\bisansTau                 <char-0x1D7A3>               " 𝞣          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL TAU
++\\bisansTh                  \\bisansTh                   "            : (Incomplete sequence)
++\\bisansTheta               <char-0x1D797>               " 𝞗          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA
++\\bisansU                   <char-0x1D650>               " 𝙐          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U
++\\bisansU<Tab>              <char-0x1D650>               " 𝙐          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL U
++\\bisansUp                  \\bisansUp                   "            : (Incomplete sequence)
++\\bisansUpsilon             <char-0x1D7A4>               " 𝞤          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL UPSILON
++\\bisansV                   <char-0x1D651>               " 𝙑          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL V
++\\bisansW                   <char-0x1D652>               " 𝙒          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL W
++\\bisansX                   <char-0x1D653>               " 𝙓          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X
++\\bisansX<Tab>              <char-0x1D653>               " 𝙓          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL X
++\\bisansXi                  <char-0x1D79D>               " 𝞝          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL XI
++\\bisansY                   <char-0x1D654>               " 𝙔          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Y
++\\bisansZ                   <char-0x1D655>               " 𝙕          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z
++\\bisansZ<Tab>              <char-0x1D655>               " 𝙕          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z
++\\bisansZe                  \\bisansZe                   "            : (Incomplete sequence)
++\\bisansZeta                <char-0x1D795>               " 𝞕          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ZETA
++\\bisansa                   <char-0x1D656>               " 𝙖          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A
++\\bisansa<Tab>              <char-0x1D656>               " 𝙖          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A
++\\bisansal                  \\bisansal                   "            : (Incomplete sequence)
++\\bisansalpha               <char-0x1D7AA>               " 𝞪          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA
++\\bisansb                   <char-0x1D657>               " 𝙗          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B
++\\bisansb<Tab>              <char-0x1D657>               " 𝙗          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL B
++\\bisansbe                  \\bisansbe                   "            : (Incomplete sequence)
++\\bisansbeta                <char-0x1D7AB>               " 𝞫          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL BETA
++\\bisansc                   <char-0x1D658>               " 𝙘          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C
++\\bisansc<Tab>              <char-0x1D658>               " 𝙘          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL C
++\\bisansch                  \\bisansch                   "            : (Incomplete sequence)
++\\bisanschi                 <char-0x1D7C0>               " 𝟀          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL CHI
++\\bisansd                   <char-0x1D659>               " 𝙙          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D
++\\bisansd<Tab>              <char-0x1D659>               " 𝙙          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL D
++\\bisansde                  \\bisansde                   "            : (Incomplete sequence)
++\\bisansdelta               <char-0x1D7AD>               " 𝞭          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL DELTA
++\\bisanse                   <char-0x1D65A>               " 𝙚          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E
++\\bisanse<Tab>              <char-0x1D65A>               " 𝙚          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL E
++\\bisansep                  \\bisansep                   "            : (Incomplete sequence)
++\\bisansepsilon             <char-0x1D7C4>               " 𝟄          : MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL
++\\bisanset                  \\bisanset                   "            : (Incomplete sequence)
++\\bisanseta                 <char-0x1D7B0>               " 𝞰          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ETA
++\\bisansf                   <char-0x1D65B>               " 𝙛          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL F
++\\bisansg                   <char-0x1D65C>               " 𝙜          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G
++\\bisansg<Tab>              <char-0x1D65C>               " 𝙜          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL G
++\\bisansga                  \\bisansga                   "            : (Incomplete sequence)
++\\bisansgamma               <char-0x1D7AC>               " 𝞬          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL GAMMA
++\\bisansh                   <char-0x1D65D>               " 𝙝          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL H
++\\bisansi                   <char-0x1D65E>               " 𝙞          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I
++\\bisansi<Tab>              <char-0x1D65E>               " 𝙞          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL I
++\\bisansio                  \\bisansio                   "            : (Incomplete sequence)
++\\bisansiota                <char-0x1D7B2>               " 𝞲          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL IOTA
++\\bisansj                   <char-0x1D65F>               " 𝙟          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL J
++\\bisansk                   <char-0x1D660>               " 𝙠          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K
++\\bisansk<Tab>              <char-0x1D660>               " 𝙠          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL K
++\\bisanska                  \\bisanska                   "            : (Incomplete sequence)
++\\bisanskappa               <char-0x1D7B3>               " 𝞳          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL KAPPA
++\\bisansl                   <char-0x1D661>               " 𝙡          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L
++\\bisansl<Tab>              <char-0x1D661>               " 𝙡          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL L
++\\bisansla                  \\bisansla                   "            : (Incomplete sequence)
++\\bisanslambda              <char-0x1D7B4>               " 𝞴          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMDA
++\\bisansm                   <char-0x1D662>               " 𝙢          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M
++\\bisansm<Tab>              <char-0x1D662>               " 𝙢          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL M
++\\bisansmu                  <char-0x1D7B5>               " 𝞵          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL MU
++\\bisansn                   <char-0x1D663>               " 𝙣          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N
++\\bisansn<Tab>              <char-0x1D663>               " 𝙣          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL N
++\\bisansna                  \\bisansna                   "            : (Incomplete sequence)
++\\bisansnabla               <char-0x1D7A9>               " 𝞩          : MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA
++\\bisansnu                  <char-0x1D7B6>               " 𝞶          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL NU
++\\bisanso                   <char-0x1D664>               " 𝙤          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O
++\\bisanso<Tab>              <char-0x1D664>               " 𝙤          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL O
++\\bisansom                  \\bisansom                   "            : (Incomplete sequence)
++\\bisansomega               <char-0x1D7C2>               " 𝟂          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
++\\bisansomicron             <char-0x1D7B8>               " 𝞸          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMICRON
++\\bisansp                   <char-0x1D665>               " 𝙥          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P
++\\bisansp<Tab>              <char-0x1D665>               " 𝙥          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL P
++\\bisanspa                  \\bisanspa                   "            : (Incomplete sequence)
++\\bisanspartial             <char-0x1D7C3>               " 𝟃          : MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
++\\bisansph                  \\bisansph                   "            : (Incomplete sequence)
++\\bisansphi                 <char-0x1D7C7>               " 𝟇          : MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL
++\\bisanspi                  <char-0x1D7B9>               " 𝞹          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PI
++\\bisansps                  \\bisansps                   "            : (Incomplete sequence)
++\\bisanspsi                 <char-0x1D7C1>               " 𝟁          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PSI
++\\bisansq                   <char-0x1D666>               " 𝙦          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Q
++\\bisansr                   <char-0x1D667>               " 𝙧          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R
++\\bisansr<Tab>              <char-0x1D667>               " 𝙧          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL R
++\\bisansrh                  \\bisansrh                   "            : (Incomplete sequence)
++\\bisansrho                 <char-0x1D7BA>               " 𝞺          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL RHO
++\\bisanss                   <char-0x1D668>               " 𝙨          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S
++\\bisanss<Tab>              <char-0x1D668>               " 𝙨          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL S
++\\bisanssi                  \\bisanssi                   "            : (Incomplete sequence)
++\\bisanssigma               <char-0x1D7BC>               " 𝞼          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL SIGMA
++\\bisanst                   <char-0x1D669>               " 𝙩          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T
++\\bisanst<Tab>              <char-0x1D669>               " 𝙩          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL T
++\\bisansta                  \\bisansta                   "            : (Incomplete sequence)
++\\bisanstau                 <char-0x1D7BD>               " 𝞽          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL TAU
++\\bisansth                  \\bisansth                   "            : (Incomplete sequence)
++\\bisanstheta               <char-0x1D7B1>               " 𝞱          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL THETA
++\\bisansu                   <char-0x1D66A>               " 𝙪          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U
++\\bisansu<Tab>              <char-0x1D66A>               " 𝙪          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL U
++\\bisansup                  \\bisansup                   "            : (Incomplete sequence)
++\\bisansupsilon             <char-0x1D7BE>               " 𝞾          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL UPSILON
++\\bisansv                   <char-0x1D66B>               " 𝙫          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V
++\\bisansv<Tab>              <char-0x1D66B>               " 𝙫          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL V
++\\bisansva                  \\bisansva                   "            : (Incomplete sequence)
++\\bisansvarTheta            <char-0x1D7A1>               " 𝞡          : MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL
++\\bisansvarepsilon          <char-0x1D7AE>               " 𝞮          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL EPSILON
++\\bisansvarkappa            <char-0x1D7C6>               " 𝟆          : MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL
++\\bisansvarphi              <char-0x1D7BF>               " 𝞿          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL PHI
++\\bisansvarpi               <char-0x1D7C9>               " 𝟉          : MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
++\\bisansvarrho              <char-0x1D7C8>               " 𝟈          : MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL
++\\bisansvarsigma            <char-0x1D7BB>               " 𝞻          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL FINAL SIGMA
++\\bisansvartheta            <char-0x1D7C5>               " 𝟅          : MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL
++\\bisansw                   <char-0x1D66C>               " 𝙬          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL W
++\\bisansx                   <char-0x1D66D>               " 𝙭          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X
++\\bisansx<Tab>              <char-0x1D66D>               " 𝙭          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL X
++\\bisansxi                  <char-0x1D7B7>               " 𝞷          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL XI
++\\bisansy                   <char-0x1D66E>               " 𝙮          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Y
++\\bisansz                   <char-0x1D66F>               " 𝙯          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z
++\\bisansz<Tab>              <char-0x1D66F>               " 𝙯          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z
++\\bisansze                  \\bisansze                   "            : (Incomplete sequence)
++\\bisanszeta                <char-0x1D7AF>               " 𝞯          : MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ZETA
++\\bisi                      \\bisi                       "            : (Incomplete sequence)
++\\bisigma                   <char-0x1D748>               " 𝝈          : MATHEMATICAL BOLD ITALIC SMALL SIGMA
++\\bit                       <char-0x1D495>               " 𝒕          : MATHEMATICAL BOLD ITALIC SMALL T
++\\bit<Tab>                  <char-0x1D495>               " 𝒕          : MATHEMATICAL BOLD ITALIC SMALL T
++\\bita                      \\bita                       "            : (Incomplete sequence)
++\\bitau                     <char-0x1D749>               " 𝝉          : MATHEMATICAL BOLD ITALIC SMALL TAU
++\\bith                      \\bith                       "            : (Incomplete sequence)
++\\bitheta                   <char-0x1D73D>               " 𝜽          : MATHEMATICAL BOLD ITALIC SMALL THETA
++\\biu                       <char-0x1D496>               " 𝒖          : MATHEMATICAL BOLD ITALIC SMALL U
++\\biu<Tab>                  <char-0x1D496>               " 𝒖          : MATHEMATICAL BOLD ITALIC SMALL U
++\\biup                      \\biup                       "            : (Incomplete sequence)
++\\biupsilon                 <char-0x1D74A>               " 𝝊          : MATHEMATICAL BOLD ITALIC SMALL UPSILON
++\\biv                       <char-0x1D497>               " 𝒗          : MATHEMATICAL BOLD ITALIC SMALL V
++\\biv<Tab>                  <char-0x1D497>               " 𝒗          : MATHEMATICAL BOLD ITALIC SMALL V
++\\biva                      \\biva                       "            : (Incomplete sequence)
++\\bivarTheta                <char-0x1D72D>               " 𝜭          : MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL
++\\bivarepsilon              <char-0x1D73A>               " 𝜺          : MATHEMATICAL BOLD ITALIC SMALL EPSILON
++\\bivarkappa                <char-0x1D752>               " 𝝒          : MATHEMATICAL BOLD ITALIC KAPPA SYMBOL
++\\bivarphi                  <char-0x1D74B>               " 𝝋          : MATHEMATICAL BOLD ITALIC SMALL PHI
++\\bivarpi                   <char-0x1D755>               " 𝝕          : MATHEMATICAL BOLD ITALIC PI SYMBOL
++\\bivarrho                  <char-0x1D754>               " 𝝔          : MATHEMATICAL BOLD ITALIC RHO SYMBOL
++\\bivarsigma                <char-0x1D747>               " 𝝇          : MATHEMATICAL BOLD ITALIC SMALL FINAL SIGMA
++\\bivartheta                <char-0x1D751>               " 𝝑          : MATHEMATICAL BOLD ITALIC THETA SYMBOL
++\\biw                       <char-0x1D498>               " 𝒘          : MATHEMATICAL BOLD ITALIC SMALL W
++\\bix                       <char-0x1D499>               " 𝒙          : MATHEMATICAL BOLD ITALIC SMALL X
++\\bix<Tab>                  <char-0x1D499>               " 𝒙          : MATHEMATICAL BOLD ITALIC SMALL X
++\\bixi                      <char-0x1D743>               " 𝝃          : MATHEMATICAL BOLD ITALIC SMALL XI
++\\biy                       <char-0x1D49A>               " 𝒚          : MATHEMATICAL BOLD ITALIC SMALL Y
++\\biz                       <char-0x1D49B>               " 𝒛          : MATHEMATICAL BOLD ITALIC SMALL Z
++\\biz<Tab>                  <char-0x1D49B>               " 𝒛          : MATHEMATICAL BOLD ITALIC SMALL Z
++\\bize                      \\bize                       "            : (Incomplete sequence)
++\\bizeta                    <char-0x1D73B>               " 𝜻          : MATHEMATICAL BOLD ITALIC SMALL ZETA
++\\bkarow                    <char-0x0290D>               " ⤍          : RIGHTWARDS DOUBLE DASH ARROW
++\\blackcircledrightdot      <char-0x02688>               " ⚈          : BLACK CIRCLE WITH WHITE DOT RIGHT
++\\blackcircledtwodots       <char-0x02689>               " ⚉          : BLACK CIRCLE WITH TWO WHITE DOTS
++\\blackcircleulquadwhite    <char-0x025D5>               " ◕          : CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK
++\\blackinwhitediamond       <char-0x025C8>               " ◈          : WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND
++\\blackinwhitesquare        <char-0x025A3>               " ▣          : WHITE SQUARE CONTAINING BLACK SMALL SQUARE
++\\blacklefthalfcircle       <char-0x025D6>               " ◖          : LEFT HALF BLACK CIRCLE
++\\blacklozenge              <char-0x029EB>               " ⧫          : BLACK LOZENGE
++\\blackpointerleft          <char-0x025C4>               " ◄          : BLACK LEFT-POINTING POINTER / BLACK LEFT POINTING POINTER
++\\blackpointerright         <char-0x025BA>               " ►          : BLACK RIGHT-POINTING POINTER / BLACK RIGHT POINTING POINTER
++\\blackrighthalfcircle      <char-0x025D7>               " ◗          : RIGHT HALF BLACK CIRCLE
++\\blacksmiley               <char-0x0263B>               " ☻          : BLACK SMILING FACE
++\\blacksquare               <char-0x025A0>               " ■          : BLACK SQUARE
++\\blacktriangle             <char-0x025B4>               " ▴          : BLACK UP-POINTING SMALL TRIANGLE / BLACK UP POINTING SMALL TRIANGLE
++\\blacktriangle<Tab>        <char-0x025B4>               " ▴          : BLACK UP-POINTING SMALL TRIANGLE / BLACK UP POINTING SMALL TRIANGLE
++\\blacktriangled            \\blacktriangled             "            : (Incomplete sequence)
++\\blacktriangledown         <char-0x025BE>               " ▾          : BLACK DOWN-POINTING SMALL TRIANGLE / BLACK DOWN POINTING SMALL TRIANGLE
++\\blacktrianglel            \\blacktrianglel             "            : (Incomplete sequence)
++\\blacktriangleleft         <char-0x025C0>               " ◀          : BLACK LEFT-POINTING TRIANGLE / BLACK LEFT POINTING TRIANGLE
++\\blacktriangler            \\blacktriangler             "            : (Incomplete sequence)
++\\blacktriangleright        <char-0x025B6>               " ▶          : BLACK RIGHT-POINTING TRIANGLE / BLACK RIGHT POINTING TRIANGLE
++\\blanksymbol               <char-0x02422>               " ␢          : BLANK SYMBOL / BLANK
++\\blkhorzoval               <char-0x02B2C>               " ⬬          : BLACK HORIZONTAL ELLIPSE
++\\blkvertoval               <char-0x02B2E>               " ⬮          : BLACK VERTICAL ELLIPSE
++\\blockfull                 <char-0x02588>               " █          : FULL BLOCK
++\\blockhalfshaded           <char-0x02592>               " ▒          : MEDIUM SHADE
++\\blocklefthalf             <char-0x0258C>               " ▌          : LEFT HALF BLOCK
++\\blocklowhalf              <char-0x02584>               " ▄          : LOWER HALF BLOCK
++\\blockqtrshaded            <char-0x02591>               " ░          : LIGHT SHADE
++\\blockrighthalf            <char-0x02590>               " ▐          : RIGHT HALF BLOCK
++\\blockthreeqtrshaded       <char-0x02593>               " ▓          : DARK SHADE
++\\blockuphalf               <char-0x02580>               " ▀          : UPPER HALF BLOCK
++\\bot                       <char-0x022A5>               " ⊥          : UP TACK
++\\bot<Tab>                  <char-0x022A5>               " ⊥          : UP TACK
++\\bots                      \\bots                       "            : (Incomplete sequence)
++\\botsemicircle             <char-0x025E1>               " ◡          : LOWER HALF CIRCLE
++\\bowtie                    <char-0x022C8>               " ⋈          : BOWTIE
++\\boxast                    <char-0x029C6>               " ⧆          : SQUARED ASTERISK
++\\boxbar                    <char-0x025EB>               " ◫          : WHITE SQUARE WITH VERTICAL BISECTING LINE
++\\boxbslash                 <char-0x029C5>               " ⧅          : SQUARED FALLING DIAGONAL SLASH
++\\boxcircle                 <char-0x029C7>               " ⧇          : SQUARED SMALL CIRCLE
++\\boxdiag                   <char-0x029C4>               " ⧄          : SQUARED RISING DIAGONAL SLASH
++\\boxdot                    <char-0x022A1>               " ⊡          : SQUARED DOT OPERATOR
++\\boxminus                  <char-0x0229F>               " ⊟          : SQUARED MINUS
++\\boxplus                   <char-0x0229E>               " ⊞          : SQUARED PLUS
++\\boxquestion               <char-0x02370>               " ⍰          : APL FUNCTIONAL SYMBOL QUAD QUESTION
++\\boxtimes                  <char-0x022A0>               " ⊠          : SQUARED TIMES
++\\boxupcaret                <char-0x02353>               " ⍓          : APL FUNCTIONAL SYMBOL QUAD UP CARET
++\\breve                     <char-0x00306>               " ◌̆         : COMBINING BREVE / NON-SPACING BREVE
++\\brokenbar                 <char-0x000A6>               " ¦          : BROKEN BAR / BROKEN VERTICAL BAR
++\\bsansA                    <char-0x1D5D4>               " 𝗔          : MATHEMATICAL SANS-SERIF BOLD CAPITAL A
++\\bsansA<Tab>               <char-0x1D5D4>               " 𝗔          : MATHEMATICAL SANS-SERIF BOLD CAPITAL A
++\\bsansAl                   \\bsansAl                    "            : (Incomplete sequence)
++\\bsansAlpha                <char-0x1D756>               " 𝝖          : MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA
++\\bsansB                    <char-0x1D5D5>               " 𝗕          : MATHEMATICAL SANS-SERIF BOLD CAPITAL B
++\\bsansB<Tab>               <char-0x1D5D5>               " 𝗕          : MATHEMATICAL SANS-SERIF BOLD CAPITAL B
++\\bsansBe                   \\bsansBe                    "            : (Incomplete sequence)
++\\bsansBeta                 <char-0x1D757>               " 𝝗          : MATHEMATICAL SANS-SERIF BOLD CAPITAL BETA
++\\bsansC                    <char-0x1D5D6>               " 𝗖          : MATHEMATICAL SANS-SERIF BOLD CAPITAL C
++\\bsansC<Tab>               <char-0x1D5D6>               " 𝗖          : MATHEMATICAL SANS-SERIF BOLD CAPITAL C
++\\bsansCh                   \\bsansCh                    "            : (Incomplete sequence)
++\\bsansChi                  <char-0x1D76C>               " 𝝬          : MATHEMATICAL SANS-SERIF BOLD CAPITAL CHI
++\\bsansD                    <char-0x1D5D7>               " 𝗗          : MATHEMATICAL SANS-SERIF BOLD CAPITAL D
++\\bsansD<Tab>               <char-0x1D5D7>               " 𝗗          : MATHEMATICAL SANS-SERIF BOLD CAPITAL D
++\\bsansDe                   \\bsansDe                    "            : (Incomplete sequence)
++\\bsansDelta                <char-0x1D759>               " 𝝙          : MATHEMATICAL SANS-SERIF BOLD CAPITAL DELTA
++\\bsansE                    <char-0x1D5D8>               " 𝗘          : MATHEMATICAL SANS-SERIF BOLD CAPITAL E
++\\bsansE<Tab>               <char-0x1D5D8>               " 𝗘          : MATHEMATICAL SANS-SERIF BOLD CAPITAL E
++\\bsansEp                   \\bsansEp                    "            : (Incomplete sequence)
++\\bsansEpsilon              <char-0x1D75A>               " 𝝚          : MATHEMATICAL SANS-SERIF BOLD CAPITAL EPSILON
++\\bsansEt                   \\bsansEt                    "            : (Incomplete sequence)
++\\bsansEta                  <char-0x1D75C>               " 𝝜          : MATHEMATICAL SANS-SERIF BOLD CAPITAL ETA
++\\bsansF                    <char-0x1D5D9>               " 𝗙          : MATHEMATICAL SANS-SERIF BOLD CAPITAL F
++\\bsansG                    <char-0x1D5DA>               " 𝗚          : MATHEMATICAL SANS-SERIF BOLD CAPITAL G
++\\bsansG<Tab>               <char-0x1D5DA>               " 𝗚          : MATHEMATICAL SANS-SERIF BOLD CAPITAL G
++\\bsansGa                   \\bsansGa                    "            : (Incomplete sequence)
++\\bsansGamma                <char-0x1D758>               " 𝝘          : MATHEMATICAL SANS-SERIF BOLD CAPITAL GAMMA
++\\bsansH                    <char-0x1D5DB>               " 𝗛          : MATHEMATICAL SANS-SERIF BOLD CAPITAL H
++\\bsansI                    <char-0x1D5DC>               " 𝗜          : MATHEMATICAL SANS-SERIF BOLD CAPITAL I
++\\bsansI<Tab>               <char-0x1D5DC>               " 𝗜          : MATHEMATICAL SANS-SERIF BOLD CAPITAL I
++\\bsansIo                   \\bsansIo                    "            : (Incomplete sequence)
++\\bsansIota                 <char-0x1D75E>               " 𝝞          : MATHEMATICAL SANS-SERIF BOLD CAPITAL IOTA
++\\bsansJ                    <char-0x1D5DD>               " 𝗝          : MATHEMATICAL SANS-SERIF BOLD CAPITAL J
++\\bsansK                    <char-0x1D5DE>               " 𝗞          : MATHEMATICAL SANS-SERIF BOLD CAPITAL K
++\\bsansK<Tab>               <char-0x1D5DE>               " 𝗞          : MATHEMATICAL SANS-SERIF BOLD CAPITAL K
++\\bsansKa                   \\bsansKa                    "            : (Incomplete sequence)
++\\bsansKappa                <char-0x1D75F>               " 𝝟          : MATHEMATICAL SANS-SERIF BOLD CAPITAL KAPPA
++\\bsansL                    <char-0x1D5DF>               " 𝗟          : MATHEMATICAL SANS-SERIF BOLD CAPITAL L
++\\bsansL<Tab>               <char-0x1D5DF>               " 𝗟          : MATHEMATICAL SANS-SERIF BOLD CAPITAL L
++\\bsansLa                   \\bsansLa                    "            : (Incomplete sequence)
++\\bsansLambda               <char-0x1D760>               " 𝝠          : MATHEMATICAL SANS-SERIF BOLD CAPITAL LAMDA
++\\bsansM                    <char-0x1D5E0>               " 𝗠          : MATHEMATICAL SANS-SERIF BOLD CAPITAL M
++\\bsansM<Tab>               <char-0x1D5E0>               " 𝗠          : MATHEMATICAL SANS-SERIF BOLD CAPITAL M
++\\bsansMu                   <char-0x1D761>               " 𝝡          : MATHEMATICAL SANS-SERIF BOLD CAPITAL MU
++\\bsansN                    <char-0x1D5E1>               " 𝗡          : MATHEMATICAL SANS-SERIF BOLD CAPITAL N
++\\bsansN<Tab>               <char-0x1D5E1>               " 𝗡          : MATHEMATICAL SANS-SERIF BOLD CAPITAL N
++\\bsansNu                   <char-0x1D762>               " 𝝢          : MATHEMATICAL SANS-SERIF BOLD CAPITAL NU
++\\bsansO                    <char-0x1D5E2>               " 𝗢          : MATHEMATICAL SANS-SERIF BOLD CAPITAL O
++\\bsansO<Tab>               <char-0x1D5E2>               " 𝗢          : MATHEMATICAL SANS-SERIF BOLD CAPITAL O
++\\bsansOm                   \\bsansOm                    "            : (Incomplete sequence)
++\\bsansOmega                <char-0x1D76E>               " 𝝮          : MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
++\\bsansOmicron              <char-0x1D764>               " 𝝤          : MATHEMATICAL SANS-SERIF BOLD CAPITAL OMICRON
++\\bsansP                    <char-0x1D5E3>               " 𝗣          : MATHEMATICAL SANS-SERIF BOLD CAPITAL P
++\\bsansP<Tab>               <char-0x1D5E3>               " 𝗣          : MATHEMATICAL SANS-SERIF BOLD CAPITAL P
++\\bsansPh                   \\bsansPh                    "            : (Incomplete sequence)
++\\bsansPhi                  <char-0x1D76B>               " 𝝫          : MATHEMATICAL SANS-SERIF BOLD CAPITAL PHI
++\\bsansPi                   <char-0x1D765>               " 𝝥          : MATHEMATICAL SANS-SERIF BOLD CAPITAL PI
++\\bsansPs                   \\bsansPs                    "            : (Incomplete sequence)
++\\bsansPsi                  <char-0x1D76D>               " 𝝭          : MATHEMATICAL SANS-SERIF BOLD CAPITAL PSI
++\\bsansQ                    <char-0x1D5E4>               " 𝗤          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Q
++\\bsansR                    <char-0x1D5E5>               " 𝗥          : MATHEMATICAL SANS-SERIF BOLD CAPITAL R
++\\bsansR<Tab>               <char-0x1D5E5>               " 𝗥          : MATHEMATICAL SANS-SERIF BOLD CAPITAL R
++\\bsansRh                   \\bsansRh                    "            : (Incomplete sequence)
++\\bsansRho                  <char-0x1D766>               " 𝝦          : MATHEMATICAL SANS-SERIF BOLD CAPITAL RHO
++\\bsansS                    <char-0x1D5E6>               " 𝗦          : MATHEMATICAL SANS-SERIF BOLD CAPITAL S
++\\bsansS<Tab>               <char-0x1D5E6>               " 𝗦          : MATHEMATICAL SANS-SERIF BOLD CAPITAL S
++\\bsansSi                   \\bsansSi                    "            : (Incomplete sequence)
++\\bsansSigma                <char-0x1D768>               " 𝝨          : MATHEMATICAL SANS-SERIF BOLD CAPITAL SIGMA
++\\bsansT                    <char-0x1D5E7>               " 𝗧          : MATHEMATICAL SANS-SERIF BOLD CAPITAL T
++\\bsansT<Tab>               <char-0x1D5E7>               " 𝗧          : MATHEMATICAL SANS-SERIF BOLD CAPITAL T
++\\bsansTa                   \\bsansTa                    "            : (Incomplete sequence)
++\\bsansTau                  <char-0x1D769>               " 𝝩          : MATHEMATICAL SANS-SERIF BOLD CAPITAL TAU
++\\bsansTh                   \\bsansTh                    "            : (Incomplete sequence)
++\\bsansTheta                <char-0x1D75D>               " 𝝝          : MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA
++\\bsansU                    <char-0x1D5E8>               " 𝗨          : MATHEMATICAL SANS-SERIF BOLD CAPITAL U
++\\bsansU<Tab>               <char-0x1D5E8>               " 𝗨          : MATHEMATICAL SANS-SERIF BOLD CAPITAL U
++\\bsansUp                   \\bsansUp                    "            : (Incomplete sequence)
++\\bsansUpsilon              <char-0x1D76A>               " 𝝪          : MATHEMATICAL SANS-SERIF BOLD CAPITAL UPSILON
++\\bsansV                    <char-0x1D5E9>               " 𝗩          : MATHEMATICAL SANS-SERIF BOLD CAPITAL V
++\\bsansW                    <char-0x1D5EA>               " 𝗪          : MATHEMATICAL SANS-SERIF BOLD CAPITAL W
++\\bsansX                    <char-0x1D5EB>               " 𝗫          : MATHEMATICAL SANS-SERIF BOLD CAPITAL X
++\\bsansX<Tab>               <char-0x1D5EB>               " 𝗫          : MATHEMATICAL SANS-SERIF BOLD CAPITAL X
++\\bsansXi                   <char-0x1D763>               " 𝝣          : MATHEMATICAL SANS-SERIF BOLD CAPITAL XI
++\\bsansY                    <char-0x1D5EC>               " 𝗬          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Y
++\\bsansZ                    <char-0x1D5ED>               " 𝗭          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Z
++\\bsansZ<Tab>               <char-0x1D5ED>               " 𝗭          : MATHEMATICAL SANS-SERIF BOLD CAPITAL Z
++\\bsansZe                   \\bsansZe                    "            : (Incomplete sequence)
++\\bsansZeta                 <char-0x1D75B>               " 𝝛          : MATHEMATICAL SANS-SERIF BOLD CAPITAL ZETA
++\\bsansa                    <char-0x1D5EE>               " 𝗮          : MATHEMATICAL SANS-SERIF BOLD SMALL A
++\\bsansa<Tab>               <char-0x1D5EE>               " 𝗮          : MATHEMATICAL SANS-SERIF BOLD SMALL A
++\\bsansal                   \\bsansal                    "            : (Incomplete sequence)
++\\bsansalpha                <char-0x1D770>               " 𝝰          : MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA
++\\bsansb                    <char-0x1D5EF>               " 𝗯          : MATHEMATICAL SANS-SERIF BOLD SMALL B
++\\bsansb<Tab>               <char-0x1D5EF>               " 𝗯          : MATHEMATICAL SANS-SERIF BOLD SMALL B
++\\bsansbe                   \\bsansbe                    "            : (Incomplete sequence)
++\\bsansbeta                 <char-0x1D771>               " 𝝱          : MATHEMATICAL SANS-SERIF BOLD SMALL BETA
++\\bsansc                    <char-0x1D5F0>               " 𝗰          : MATHEMATICAL SANS-SERIF BOLD SMALL C
++\\bsansc<Tab>               <char-0x1D5F0>               " 𝗰          : MATHEMATICAL SANS-SERIF BOLD SMALL C
++\\bsansch                   \\bsansch                    "            : (Incomplete sequence)
++\\bsanschi                  <char-0x1D786>               " 𝞆          : MATHEMATICAL SANS-SERIF BOLD SMALL CHI
++\\bsansd                    <char-0x1D5F1>               " 𝗱          : MATHEMATICAL SANS-SERIF BOLD SMALL D
++\\bsansd<Tab>               <char-0x1D5F1>               " 𝗱          : MATHEMATICAL SANS-SERIF BOLD SMALL D
++\\bsansde                   \\bsansde                    "            : (Incomplete sequence)
++\\bsansdelta                <char-0x1D773>               " 𝝳          : MATHEMATICAL SANS-SERIF BOLD SMALL DELTA
++\\bsanse                    <char-0x1D5F2>               " 𝗲          : MATHEMATICAL SANS-SERIF BOLD SMALL E
++\\bsanse<Tab>               <char-0x1D5F2>               " 𝗲          : MATHEMATICAL SANS-SERIF BOLD SMALL E
++\\bsansei                   \\bsansei                    "            : (Incomplete sequence)
++\\bsanseight                <char-0x1D7F4>               " 𝟴          : MATHEMATICAL SANS-SERIF BOLD DIGIT EIGHT
++\\bsansep                   \\bsansep                    "            : (Incomplete sequence)
++\\bsansepsilon              <char-0x1D78A>               " 𝞊          : MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL
++\\bsanset                   \\bsanset                    "            : (Incomplete sequence)
++\\bsanseta                  <char-0x1D776>               " 𝝶          : MATHEMATICAL SANS-SERIF BOLD SMALL ETA
++\\bsansf                    <char-0x1D5F3>               " 𝗳          : MATHEMATICAL SANS-SERIF BOLD SMALL F
++\\bsansf<Tab>               <char-0x1D5F3>               " 𝗳          : MATHEMATICAL SANS-SERIF BOLD SMALL F
++\\bsansfi                   \\bsansfi                    "            : (Incomplete sequence)
++\\bsansfive                 <char-0x1D7F1>               " 𝟱          : MATHEMATICAL SANS-SERIF BOLD DIGIT FIVE
++\\bsansfo                   \\bsansfo                    "            : (Incomplete sequence)
++\\bsansfour                 <char-0x1D7F0>               " 𝟰          : MATHEMATICAL SANS-SERIF BOLD DIGIT FOUR
++\\bsansg                    <char-0x1D5F4>               " 𝗴          : MATHEMATICAL SANS-SERIF BOLD SMALL G
++\\bsansg<Tab>               <char-0x1D5F4>               " 𝗴          : MATHEMATICAL SANS-SERIF BOLD SMALL G
++\\bsansga                   \\bsansga                    "            : (Incomplete sequence)
++\\bsansgamma                <char-0x1D772>               " 𝝲          : MATHEMATICAL SANS-SERIF BOLD SMALL GAMMA
++\\bsansh                    <char-0x1D5F5>               " 𝗵          : MATHEMATICAL SANS-SERIF BOLD SMALL H
++\\bsansi                    <char-0x1D5F6>               " 𝗶          : MATHEMATICAL SANS-SERIF BOLD SMALL I
++\\bsansi<Tab>               <char-0x1D5F6>               " 𝗶          : MATHEMATICAL SANS-SERIF BOLD SMALL I
++\\bsansio                   \\bsansio                    "            : (Incomplete sequence)
++\\bsansiota                 <char-0x1D778>               " 𝝸          : MATHEMATICAL SANS-SERIF BOLD SMALL IOTA
++\\bsansj                    <char-0x1D5F7>               " 𝗷          : MATHEMATICAL SANS-SERIF BOLD SMALL J
++\\bsansk                    <char-0x1D5F8>               " 𝗸          : MATHEMATICAL SANS-SERIF BOLD SMALL K
++\\bsansk<Tab>               <char-0x1D5F8>               " 𝗸          : MATHEMATICAL SANS-SERIF BOLD SMALL K
++\\bsanska                   \\bsanska                    "            : (Incomplete sequence)
++\\bsanskappa                <char-0x1D779>               " 𝝹          : MATHEMATICAL SANS-SERIF BOLD SMALL KAPPA
++\\bsansl                    <char-0x1D5F9>               " 𝗹          : MATHEMATICAL SANS-SERIF BOLD SMALL L
++\\bsansl<Tab>               <char-0x1D5F9>               " 𝗹          : MATHEMATICAL SANS-SERIF BOLD SMALL L
++\\bsansla                   \\bsansla                    "            : (Incomplete sequence)
++\\bsanslambda               <char-0x1D77A>               " 𝝺          : MATHEMATICAL SANS-SERIF BOLD SMALL LAMDA
++\\bsansm                    <char-0x1D5FA>               " 𝗺          : MATHEMATICAL SANS-SERIF BOLD SMALL M
++\\bsansm<Tab>               <char-0x1D5FA>               " 𝗺          : MATHEMATICAL SANS-SERIF BOLD SMALL M
++\\bsansmu                   <char-0x1D77B>               " 𝝻          : MATHEMATICAL SANS-SERIF BOLD SMALL MU
++\\bsansn                    <char-0x1D5FB>               " 𝗻          : MATHEMATICAL SANS-SERIF BOLD SMALL N
++\\bsansn<Tab>               <char-0x1D5FB>               " 𝗻          : MATHEMATICAL SANS-SERIF BOLD SMALL N
++\\bsansna                   \\bsansna                    "            : (Incomplete sequence)
++\\bsansnabla                <char-0x1D76F>               " 𝝯          : MATHEMATICAL SANS-SERIF BOLD NABLA
++\\bsansni                   \\bsansni                    "            : (Incomplete sequence)
++\\bsansnine                 <char-0x1D7F5>               " 𝟵          : MATHEMATICAL SANS-SERIF BOLD DIGIT NINE
++\\bsansnu                   <char-0x1D77C>               " 𝝼          : MATHEMATICAL SANS-SERIF BOLD SMALL NU
++\\bsanso                    <char-0x1D5FC>               " 𝗼          : MATHEMATICAL SANS-SERIF BOLD SMALL O
++\\bsanso<Tab>               <char-0x1D5FC>               " 𝗼          : MATHEMATICAL SANS-SERIF BOLD SMALL O
++\\bsansom                   \\bsansom                    "            : (Incomplete sequence)
++\\bsansomega                <char-0x1D788>               " 𝞈          : MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
++\\bsansomicron              <char-0x1D77E>               " 𝝾          : MATHEMATICAL SANS-SERIF BOLD SMALL OMICRON
++\\bsanson                   \\bsanson                    "            : (Incomplete sequence)
++\\bsansone                  <char-0x1D7ED>               " 𝟭          : MATHEMATICAL SANS-SERIF BOLD DIGIT ONE
++\\bsansp                    <char-0x1D5FD>               " 𝗽          : MATHEMATICAL SANS-SERIF BOLD SMALL P
++\\bsansp<Tab>               <char-0x1D5FD>               " 𝗽          : MATHEMATICAL SANS-SERIF BOLD SMALL P
++\\bsanspa                   \\bsanspa                    "            : (Incomplete sequence)
++\\bsanspartial              <char-0x1D789>               " 𝞉          : MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL
++\\bsansph                   \\bsansph                    "            : (Incomplete sequence)
++\\bsansphi                  <char-0x1D78D>               " 𝞍          : MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL
++\\bsanspi                   <char-0x1D77F>               " 𝝿          : MATHEMATICAL SANS-SERIF BOLD SMALL PI
++\\bsansps                   \\bsansps                    "            : (Incomplete sequence)
++\\bsanspsi                  <char-0x1D787>               " 𝞇          : MATHEMATICAL SANS-SERIF BOLD SMALL PSI
++\\bsansq                    <char-0x1D5FE>               " 𝗾          : MATHEMATICAL SANS-SERIF BOLD SMALL Q
++\\bsansr                    <char-0x1D5FF>               " 𝗿          : MATHEMATICAL SANS-SERIF BOLD SMALL R
++\\bsansr<Tab>               <char-0x1D5FF>               " 𝗿          : MATHEMATICAL SANS-SERIF BOLD SMALL R
++\\bsansrh                   \\bsansrh                    "            : (Incomplete sequence)
++\\bsansrho                  <char-0x1D780>               " 𝞀          : MATHEMATICAL SANS-SERIF BOLD SMALL RHO
++\\bsanss                    <char-0x1D600>               " 𝘀          : MATHEMATICAL SANS-SERIF BOLD SMALL S
++\\bsanss<Tab>               <char-0x1D600>               " 𝘀          : MATHEMATICAL SANS-SERIF BOLD SMALL S
++\\bsansse                   \\bsansse                    "            : (Incomplete sequence)
++\\bsansseven                <char-0x1D7F3>               " 𝟳          : MATHEMATICAL SANS-SERIF BOLD DIGIT SEVEN
++\\bsanssi                   \\bsanssi                    "            : (Incomplete sequence)
++\\bsanssigma                <char-0x1D782>               " 𝞂          : MATHEMATICAL SANS-SERIF BOLD SMALL SIGMA
++\\bsanssix                  <char-0x1D7F2>               " 𝟲          : MATHEMATICAL SANS-SERIF BOLD DIGIT SIX
++\\bsanst                    <char-0x1D601>               " 𝘁          : MATHEMATICAL SANS-SERIF BOLD SMALL T
++\\bsanst<Tab>               <char-0x1D601>               " 𝘁          : MATHEMATICAL SANS-SERIF BOLD SMALL T
++\\bsansta                   \\bsansta                    "            : (Incomplete sequence)
++\\bsanstau                  <char-0x1D783>               " 𝞃          : MATHEMATICAL SANS-SERIF BOLD SMALL TAU
++\\bsansth                   \\bsansth                    "            : (Incomplete sequence)
++\\bsanstheta                <char-0x1D777>               " 𝝷          : MATHEMATICAL SANS-SERIF BOLD SMALL THETA
++\\bsansthree                <char-0x1D7EF>               " 𝟯          : MATHEMATICAL SANS-SERIF BOLD DIGIT THREE
++\\bsanstw                   \\bsanstw                    "            : (Incomplete sequence)
++\\bsanstwo                  <char-0x1D7EE>               " 𝟮          : MATHEMATICAL SANS-SERIF BOLD DIGIT TWO
++\\bsansu                    <char-0x1D602>               " 𝘂          : MATHEMATICAL SANS-SERIF BOLD SMALL U
++\\bsansu<Tab>               <char-0x1D602>               " 𝘂          : MATHEMATICAL SANS-SERIF BOLD SMALL U
++\\bsansup                   \\bsansup                    "            : (Incomplete sequence)
++\\bsansupsilon              <char-0x1D784>               " 𝞄          : MATHEMATICAL SANS-SERIF BOLD SMALL UPSILON
++\\bsansv                    <char-0x1D603>               " 𝘃          : MATHEMATICAL SANS-SERIF BOLD SMALL V
++\\bsansv<Tab>               <char-0x1D603>               " 𝘃          : MATHEMATICAL SANS-SERIF BOLD SMALL V
++\\bsansva                   \\bsansva                    "            : (Incomplete sequence)
++\\bsansvarTheta             <char-0x1D767>               " 𝝧          : MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL
++\\bsansvarepsilon           <char-0x1D774>               " 𝝴          : MATHEMATICAL SANS-SERIF BOLD SMALL EPSILON
++\\bsansvarkappa             <char-0x1D78C>               " 𝞌          : MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL
++\\bsansvarphi               <char-0x1D785>               " 𝞅          : MATHEMATICAL SANS-SERIF BOLD SMALL PHI
++\\bsansvarpi                <char-0x1D78F>               " 𝞏          : MATHEMATICAL SANS-SERIF BOLD PI SYMBOL
++\\bsansvarrho               <char-0x1D78E>               " 𝞎          : MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL
++\\bsansvarsigma             <char-0x1D781>               " 𝞁          : MATHEMATICAL SANS-SERIF BOLD SMALL FINAL SIGMA
++\\bsansvartheta             <char-0x1D78B>               " 𝞋          : MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL
++\\bsansw                    <char-0x1D604>               " 𝘄          : MATHEMATICAL SANS-SERIF BOLD SMALL W
++\\bsansx                    <char-0x1D605>               " 𝘅          : MATHEMATICAL SANS-SERIF BOLD SMALL X
++\\bsansx<Tab>               <char-0x1D605>               " 𝘅          : MATHEMATICAL SANS-SERIF BOLD SMALL X
++\\bsansxi                   <char-0x1D77D>               " 𝝽          : MATHEMATICAL SANS-SERIF BOLD SMALL XI
++\\bsansy                    <char-0x1D606>               " 𝘆          : MATHEMATICAL SANS-SERIF BOLD SMALL Y
++\\bsansz                    <char-0x1D607>               " 𝘇          : MATHEMATICAL SANS-SERIF BOLD SMALL Z
++\\bsansz<Tab>               <char-0x1D607>               " 𝘇          : MATHEMATICAL SANS-SERIF BOLD SMALL Z
++\\bsansze                   \\bsansze                    "            : (Incomplete sequence)
++\\bsanszero                 <char-0x1D7EC>               " 𝟬          : MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO
++\\bsanszeta                 <char-0x1D775>               " 𝝵          : MATHEMATICAL SANS-SERIF BOLD SMALL ZETA
++\\bscrA                     <char-0x1D4D0>               " 𝓐          : MATHEMATICAL BOLD SCRIPT CAPITAL A
++\\bscrB                     <char-0x1D4D1>               " 𝓑          : MATHEMATICAL BOLD SCRIPT CAPITAL B
++\\bscrC                     <char-0x1D4D2>               " 𝓒          : MATHEMATICAL BOLD SCRIPT CAPITAL C
++\\bscrD                     <char-0x1D4D3>               " 𝓓          : MATHEMATICAL BOLD SCRIPT CAPITAL D
++\\bscrE                     <char-0x1D4D4>               " 𝓔          : MATHEMATICAL BOLD SCRIPT CAPITAL E
++\\bscrF                     <char-0x1D4D5>               " 𝓕          : MATHEMATICAL BOLD SCRIPT CAPITAL F
++\\bscrG                     <char-0x1D4D6>               " 𝓖          : MATHEMATICAL BOLD SCRIPT CAPITAL G
++\\bscrH                     <char-0x1D4D7>               " 𝓗          : MATHEMATICAL BOLD SCRIPT CAPITAL H
++\\bscrI                     <char-0x1D4D8>               " 𝓘          : MATHEMATICAL BOLD SCRIPT CAPITAL I
++\\bscrJ                     <char-0x1D4D9>               " 𝓙          : MATHEMATICAL BOLD SCRIPT CAPITAL J
++\\bscrK                     <char-0x1D4DA>               " 𝓚          : MATHEMATICAL BOLD SCRIPT CAPITAL K
++\\bscrL                     <char-0x1D4DB>               " 𝓛          : MATHEMATICAL BOLD SCRIPT CAPITAL L
++\\bscrM                     <char-0x1D4DC>               " 𝓜          : MATHEMATICAL BOLD SCRIPT CAPITAL M
++\\bscrN                     <char-0x1D4DD>               " 𝓝          : MATHEMATICAL BOLD SCRIPT CAPITAL N
++\\bscrO                     <char-0x1D4DE>               " 𝓞          : MATHEMATICAL BOLD SCRIPT CAPITAL O
++\\bscrP                     <char-0x1D4DF>               " 𝓟          : MATHEMATICAL BOLD SCRIPT CAPITAL P
++\\bscrQ                     <char-0x1D4E0>               " 𝓠          : MATHEMATICAL BOLD SCRIPT CAPITAL Q
++\\bscrR                     <char-0x1D4E1>               " 𝓡          : MATHEMATICAL BOLD SCRIPT CAPITAL R
++\\bscrS                     <char-0x1D4E2>               " 𝓢          : MATHEMATICAL BOLD SCRIPT CAPITAL S
++\\bscrT                     <char-0x1D4E3>               " 𝓣          : MATHEMATICAL BOLD SCRIPT CAPITAL T
++\\bscrU                     <char-0x1D4E4>               " 𝓤          : MATHEMATICAL BOLD SCRIPT CAPITAL U
++\\bscrV                     <char-0x1D4E5>               " 𝓥          : MATHEMATICAL BOLD SCRIPT CAPITAL V
++\\bscrW                     <char-0x1D4E6>               " 𝓦          : MATHEMATICAL BOLD SCRIPT CAPITAL W
++\\bscrX                     <char-0x1D4E7>               " 𝓧          : MATHEMATICAL BOLD SCRIPT CAPITAL X
++\\bscrY                     <char-0x1D4E8>               " 𝓨          : MATHEMATICAL BOLD SCRIPT CAPITAL Y
++\\bscrZ                     <char-0x1D4E9>               " 𝓩          : MATHEMATICAL BOLD SCRIPT CAPITAL Z
++\\bscra                     <char-0x1D4EA>               " 𝓪          : MATHEMATICAL BOLD SCRIPT SMALL A
++\\bscrb                     <char-0x1D4EB>               " 𝓫          : MATHEMATICAL BOLD SCRIPT SMALL B
++\\bscrc                     <char-0x1D4EC>               " 𝓬          : MATHEMATICAL BOLD SCRIPT SMALL C
++\\bscrd                     <char-0x1D4ED>               " 𝓭          : MATHEMATICAL BOLD SCRIPT SMALL D
++\\bscre                     <char-0x1D4EE>               " 𝓮          : MATHEMATICAL BOLD SCRIPT SMALL E
++\\bscrf                     <char-0x1D4EF>               " 𝓯          : MATHEMATICAL BOLD SCRIPT SMALL F
++\\bscrg                     <char-0x1D4F0>               " 𝓰          : MATHEMATICAL BOLD SCRIPT SMALL G
++\\bscrh                     <char-0x1D4F1>               " 𝓱          : MATHEMATICAL BOLD SCRIPT SMALL H
++\\bscri                     <char-0x1D4F2>               " 𝓲          : MATHEMATICAL BOLD SCRIPT SMALL I
++\\bscrj                     <char-0x1D4F3>               " 𝓳          : MATHEMATICAL BOLD SCRIPT SMALL J
++\\bscrk                     <char-0x1D4F4>               " 𝓴          : MATHEMATICAL BOLD SCRIPT SMALL K
++\\bscrl                     <char-0x1D4F5>               " 𝓵          : MATHEMATICAL BOLD SCRIPT SMALL L
++\\bscrm                     <char-0x1D4F6>               " 𝓶          : MATHEMATICAL BOLD SCRIPT SMALL M
++\\bscrn                     <char-0x1D4F7>               " 𝓷          : MATHEMATICAL BOLD SCRIPT SMALL N
++\\bscro                     <char-0x1D4F8>               " 𝓸          : MATHEMATICAL BOLD SCRIPT SMALL O
++\\bscrp                     <char-0x1D4F9>               " 𝓹          : MATHEMATICAL BOLD SCRIPT SMALL P
++\\bscrq                     <char-0x1D4FA>               " 𝓺          : MATHEMATICAL BOLD SCRIPT SMALL Q
++\\bscrr                     <char-0x1D4FB>               " 𝓻          : MATHEMATICAL BOLD SCRIPT SMALL R
++\\bscrs                     <char-0x1D4FC>               " 𝓼          : MATHEMATICAL BOLD SCRIPT SMALL S
++\\bscrt                     <char-0x1D4FD>               " 𝓽          : MATHEMATICAL BOLD SCRIPT SMALL T
++\\bscru                     <char-0x1D4FE>               " 𝓾          : MATHEMATICAL BOLD SCRIPT SMALL U
++\\bscrv                     <char-0x1D4FF>               " 𝓿          : MATHEMATICAL BOLD SCRIPT SMALL V
++\\bscrw                     <char-0x1D500>               " 𝔀          : MATHEMATICAL BOLD SCRIPT SMALL W
++\\bscrx                     <char-0x1D501>               " 𝔁          : MATHEMATICAL BOLD SCRIPT SMALL X
++\\bscry                     <char-0x1D502>               " 𝔂          : MATHEMATICAL BOLD SCRIPT SMALL Y
++\\bscrz                     <char-0x1D503>               " 𝔃          : MATHEMATICAL BOLD SCRIPT SMALL Z
++\\bsimilarleftarrow         <char-0x02B41>               " ⭁          : REVERSE TILDE OPERATOR ABOVE LEFTWARDS ARROW
++\\bsimilarrightarrow        <char-0x02B47>               " ⭇          : REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW
++\\bsolhsub                  <char-0x027C8>               " ⟈          : REVERSE SOLIDUS PRECEDING SUBSET
++\\btdl                      <char-0x0026C>               " ɬ          : LATIN SMALL LETTER L WITH BELT / LATIN SMALL LETTER L BELT
++\\btimes                    <char-0x02A32>               " ⨲          : SEMIDIRECT PRODUCT WITH BOTTOM CLOSED
++\\bullet                    <char-0x02022>               " •          : BULLET
++\\bullseye                  <char-0x025CE>               " ◎          : BULLSEYE
++\\bumpeq                    <char-0x0224F>               " ≏          : DIFFERENCE BETWEEN
++\\bumpeq<Tab>               <char-0x0224F>               " ≏          : DIFFERENCE BETWEEN
++\\bumpeqq                   <char-0x02AAE>               " ⪮          : EQUALS SIGN WITH BUMPY ABOVE
++\\c                         <char-0x00327>               " ◌̧         : COMBINING CEDILLA / NON-SPACING CEDILLA
++\\c<Tab>                    <char-0x00327>               " ◌̧         : COMBINING CEDILLA / NON-SPACING CEDILLA
++\\ca                        \\ca                         "            : (Incomplete sequence)
++\\cancer                    <char-0x0264B>               " ♋          : CANCER
++\\candra                    <char-0x00310>               " ◌̐         : COMBINING CANDRABINDU / NON-SPACING CANDRABINDU
++\\cap                       <char-0x02229>               " ∩          : INTERSECTION
++\\cap<Tab>                  <char-0x02229>               " ∩          : INTERSECTION
++\\capd                      \\capd                       "            : (Incomplete sequence)
++\\capdot                    <char-0x02A40>               " ⩀          : INTERSECTION WITH DOT
++\\capr                      \\capr                       "            : (Incomplete sequence)
++\\capricornus               <char-0x02651>               " ♑          : CAPRICORN
++\\capw                      \\capw                       "            : (Incomplete sequence)
++\\capwedge                  <char-0x02A44>               " ⩄          : INTERSECTION WITH LOGICAL AND
++\\carriagereturn            <char-0x021B5>               " ↵          : DOWNWARDS ARROW WITH CORNER LEFTWARDS / DOWN ARROW WITH CORNER LEFT
++\\cb                        \\cb                         "            : (Incomplete sequence)
++\\cbrt                      <char-0x0221B>               " ∛          : CUBE ROOT
++\\cd                        \\cd                         "            : (Incomplete sequence)
++\\cdot                      <char-0x022C5>               " ⋅          : DOT OPERATOR
++\\cdot<Tab>                 <char-0x022C5>               " ⋅          : DOT OPERATOR
++\\cdotp                     <char-0x000B7>               " ·          : MIDDLE DOT
++\\cdots                     <char-0x022EF>               " ⋯          : MIDLINE HORIZONTAL ELLIPSIS
++\\ch                        \\ch                         "            : (Incomplete sequence)
++\\check                     <char-0x0030C>               " ◌̌         : COMBINING CARON / NON-SPACING HACEK
++\\check<Tab>                <char-0x0030C>               " ◌̌         : COMBINING CARON / NON-SPACING HACEK
++\\checkm                    \\checkm                     "            : (Incomplete sequence)
++\\checkmark                 <char-0x02713>               " ✓          : CHECK MARK
++\\chi                       <char-0x003C7>               " χ          : GREEK SMALL LETTER CHI
++\\ci                        \\ci                         "            : (Incomplete sequence)
++\\circ                      <char-0x02218>               " ∘          : RING OPERATOR
++\\circ<Tab>                 <char-0x02218>               " ∘          : RING OPERATOR
++\\circe                     \\circe                      "            : (Incomplete sequence)
++\\circeq                    <char-0x02257>               " ≗          : RING EQUAL TO
++\\circl                     \\circl                      "            : (Incomplete sequence)
++\\circlearrowleft           <char-0x021BA>               " ↺          : ANTICLOCKWISE OPEN CIRCLE ARROW
++\\circlearrowright          <char-0x021BB>               " ↻          : CLOCKWISE OPEN CIRCLE ARROW
++\\circledR                  <char-0x000AE>               " ®          : REGISTERED SIGN / REGISTERED TRADE MARK SIGN
++\\circledS                  <char-0x024C8>               " Ⓢ          : CIRCLED LATIN CAPITAL LETTER S
++\\circledast                <char-0x0229B>               " ⊛          : CIRCLED ASTERISK OPERATOR
++\\circledbullet             <char-0x029BF>               " ⦿          : CIRCLED BULLET
++\\circledcirc               <char-0x0229A>               " ⊚          : CIRCLED RING OPERATOR
++\\circleddash               <char-0x0229D>               " ⊝          : CIRCLED DASH
++\\circledequal              <char-0x0229C>               " ⊜          : CIRCLED EQUALS
++\\circledparallel           <char-0x029B7>               " ⦷          : CIRCLED PARALLEL
++\\circledrightdot           <char-0x02686>               " ⚆          : WHITE CIRCLE WITH DOT RIGHT
++\\circledstar               <char-0x0272A>               " ✪          : CIRCLED WHITE STAR
++\\circledtwodots            <char-0x02687>               " ⚇          : WHITE CIRCLE WITH TWO DOTS
++\\circledwhitebullet        <char-0x029BE>               " ⦾          : CIRCLED WHITE BULLET
++\\circlellquad              <char-0x025F5>               " ◵          : WHITE CIRCLE WITH LOWER LEFT QUADRANT
++\\circlelrquad              <char-0x025F6>               " ◶          : WHITE CIRCLE WITH LOWER RIGHT QUADRANT
++\\circleonleftarrow         <char-0x02B30>               " ⬰          : LEFT ARROW WITH SMALL CIRCLE
++\\circleonrightarrow        <char-0x021F4>               " ⇴          : RIGHT ARROW WITH SMALL CIRCLE
++\\circletophalfblack        <char-0x025D3>               " ◓          : CIRCLE WITH UPPER HALF BLACK
++\\circleulquad              <char-0x025F4>               " ◴          : WHITE CIRCLE WITH UPPER LEFT QUADRANT
++\\circleurquad              <char-0x025F7>               " ◷          : WHITE CIRCLE WITH UPPER RIGHT QUADRANT
++\\circleurquad<Tab>         <char-0x025F7>               " ◷          : WHITE CIRCLE WITH UPPER RIGHT QUADRANT
++\\circleurquadb             \\circleurquadb              "            : (Incomplete sequence)
++\\circleurquadblack         <char-0x025D4>               " ◔          : CIRCLE WITH UPPER RIGHT QUADRANT BLACK
++\\circlevertfill            <char-0x025CD>               " ◍          : CIRCLE WITH VERTICAL FILL
++\\cirfb                     <char-0x025D2>               " ◒          : CIRCLE WITH LOWER HALF BLACK
++\\cirfl                     <char-0x025D0>               " ◐          : CIRCLE WITH LEFT HALF BLACK
++\\cirfnint                  <char-0x02A10>               " ⨐          : CIRCULATION FUNCTION
++\\cirfr                     <char-0x025D1>               " ◑          : CIRCLE WITH RIGHT HALF BLACK
++\\cl                        \\cl                         "            : (Incomplete sequence)
++\\clockoint                 <char-0x02A0F>               " ⨏          : INTEGRAL AVERAGE WITH SLASH
++\\clomeg                    <char-0x00277>               " ɷ          : LATIN SMALL LETTER CLOSED OMEGA
++\\closedvarcap              <char-0x02A4D>               " ⩍          : CLOSED INTERSECTION WITH SERIFS
++\\closedvarcup              <char-0x02A4C>               " ⩌          : CLOSED UNION WITH SERIFS
++\\closedvarcup<Tab>         <char-0x02A4C>               " ⩌          : CLOSED UNION WITH SERIFS
++\\closedvarcups             \\closedvarcups              "            : (Incomplete sequence)
++\\closedvarcupsmashprod     <char-0x02A50>               " ⩐          : CLOSED UNION WITH SERIFS AND SMASH PRODUCT
++\\clubsuit                  <char-0x02663>               " ♣          : BLACK CLUB SUIT
++\\clwintegral               <char-0x02231>               " ∱          : CLOCKWISE INTEGRAL
++\\co                        \\co                         "            : (Incomplete sequence)
++\\coloneq                   <char-0x02254>               " ≔          : COLON EQUALS / COLON EQUAL
++\\commaminus                <char-0x02A29>               " ⨩          : MINUS SIGN WITH COMMA ABOVE
++\\complement                <char-0x02201>               " ∁          : COMPLEMENT
++\\cong                      <char-0x02245>               " ≅          : APPROXIMATELY EQUAL TO
++\\cong<Tab>                 <char-0x02245>               " ≅          : APPROXIMATELY EQUAL TO
++\\congd                     \\congd                      "            : (Incomplete sequence)
++\\congdot                   <char-0x02A6D>               " ⩭          : CONGRUENT WITH DOT ABOVE
++\\conictaper                <char-0x02332>               " ⌲          : CONICAL TAPER
++\\conjquant                 <char-0x02A07>               " ⨇          : TWO LOGICAL AND OPERATOR
++\\coprod                    <char-0x02210>               " ∐          : N-ARY COPRODUCT
++\\copyright                 <char-0x000A9>               " ©          : COPYRIGHT SIGN
++\\cs                        \\cs                         "            : (Incomplete sequence)
++\\csub                      <char-0x02ACF>               " ⫏          : CLOSED SUBSET
++\\csub<Tab>                 <char-0x02ACF>               " ⫏          : CLOSED SUBSET
++\\csube                     <char-0x02AD1>               " ⫑          : CLOSED SUBSET OR EQUAL TO
++\\csup                      <char-0x02AD0>               " ⫐          : CLOSED SUPERSET
++\\csup<Tab>                 <char-0x02AD0>               " ⫐          : CLOSED SUPERSET
++\\csupe                     <char-0x02AD2>               " ⫒          : CLOSED SUPERSET OR EQUAL TO
++\\cu                        \\cu                         "            : (Incomplete sequence)
++\\cup                       <char-0x0222A>               " ∪          : UNION
++\\cup<Tab>                  <char-0x0222A>               " ∪          : UNION
++\\cupd                      \\cupd                       "            : (Incomplete sequence)
++\\cupdot                    <char-0x0228D>               " ⊍          : MULTISET MULTIPLICATION
++\\cupv                      \\cupv                       "            : (Incomplete sequence)
++\\cupvee                    <char-0x02A45>               " ⩅          : UNION WITH LOGICAL OR
++\\curlyeqprec               <char-0x022DE>               " ⋞          : EQUAL TO OR PRECEDES
++\\curlyeqsucc               <char-0x022DF>               " ⋟          : EQUAL TO OR SUCCEEDS
++\\curlyvee                  <char-0x022CE>               " ⋎          : CURLY LOGICAL OR
++\\curlywedge                <char-0x022CF>               " ⋏          : CURLY LOGICAL AND
++\\curvearrowleft            <char-0x021B6>               " ↶          : ANTICLOCKWISE TOP SEMICIRCLE ARROW
++\\curvearrowright           <char-0x021B7>               " ↷          : CLOCKWISE TOP SEMICIRCLE ARROW
++\\dagger                    <char-0x02020>               " †          : DAGGER
++\\daleth                    <char-0x02138>               " ℸ          : DALET SYMBOL / FOURTH TRANSFINITE CARDINAL
++\\danger                    <char-0x02621>               " ☡          : CAUTION SIGN
++\\dashV                     <char-0x02AE3>               " ⫣          : DOUBLE VERTICAL BAR LEFT TURNSTILE
++\\dashleftharpoondown       <char-0x0296B>               " ⥫          : LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
++\\dashrightharpoondown      <char-0x0296D>               " ⥭          : RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH
++\\dashv                     <char-0x022A3>               " ⊣          : LEFT TACK
++\\dbkarow                   <char-0x0290F>               " ⤏          : RIGHTWARDS TRIPLE DASH ARROW
++\\dblarrowupdown            <char-0x021C5>               " ⇅          : UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW / UP ARROW LEFT OF DOWN ARROW
++\\ddagger                   <char-0x02021>               " ‡          : DOUBLE DAGGER
++\\ddddot                    <char-0x020DC>               " ◌⃜         : COMBINING FOUR DOTS ABOVE / NON-SPACING FOUR DOTS ABOVE
++\\dddot                     <char-0x020DB>               " ◌⃛         : COMBINING THREE DOTS ABOVE / NON-SPACING THREE DOTS ABOVE
++\\ddfnc                     <char-0x02999>               " ⦙          : DOTTED FENCE
++\\ddot                      <char-0x00308>               " ◌̈         : COMBINING DIAERESIS / NON-SPACING DIAERESIS
++\\ddot<Tab>                 <char-0x00308>               " ◌̈         : COMBINING DIAERESIS / NON-SPACING DIAERESIS
++\\ddots                     <char-0x022F1>               " ⋱          : DOWN RIGHT DIAGONAL ELLIPSIS
++\\ddots<Tab>                <char-0x022F1>               " ⋱          : DOWN RIGHT DIAGONAL ELLIPSIS
++\\ddotse                    \\ddotse                     "            : (Incomplete sequence)
++\\ddotseq                   <char-0x02A77>               " ⩷          : EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
++\\defas                     <char-0x029CB>               " ⧋          : TRIANGLE WITH UNDERBAR
++\\degree                    <char-0x000B0>               " °          : DEGREE SIGN
++\\del                       <char-0x02207>               " ∇          : NABLA
++\\del<Tab>                  <char-0x02207>               " ∇          : NABLA
++\\delt                      \\delt                       "            : (Incomplete sequence)
++\\delta                     <char-0x003B4>               " δ          : GREEK SMALL LETTER DELTA
++\\dh                        <char-0x000F0>               " ð          : LATIN SMALL LETTER ETH
++\\diagdown                  <char-0x02572>               " ╲          : BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT / FORMS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
++\\diagup                    <char-0x02571>               " ╱          : BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT / FORMS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
++\\diameter                  <char-0x02300>               " ⌀          : DIAMETER SIGN
++\\diamond                   <char-0x022C4>               " ⋄          : DIAMOND OPERATOR
++\\diamond<Tab>              <char-0x022C4>               " ⋄          : DIAMOND OPERATOR
++\\diamondb                  \\diamondb                   "            : (Incomplete sequence)
++\\diamondbotblack           <char-0x02B19>               " ⬙          : DIAMOND WITH BOTTOM HALF BLACK
++\\diamondl                  \\diamondl                   "            : (Incomplete sequence)
++\\diamondleftarrow          <char-0x0291D>               " ⤝          : LEFTWARDS ARROW TO BLACK DIAMOND
++\\diamondleftarrow<Tab>     <char-0x0291D>               " ⤝          : LEFTWARDS ARROW TO BLACK DIAMOND
++\\diamondleftarrowb         \\diamondleftarrowb          "            : (Incomplete sequence)
++\\diamondleftarrowbar       <char-0x0291F>               " ⤟          : LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND
++\\diamondleftblack          <char-0x02B16>               " ⬖          : DIAMOND WITH LEFT HALF BLACK
++\\diamondr                  \\diamondr                   "            : (Incomplete sequence)
++\\diamondrightblack         <char-0x02B17>               " ⬗          : DIAMOND WITH RIGHT HALF BLACK
++\\diamonds                  \\diamonds                   "            : (Incomplete sequence)
++\\diamondsuit               <char-0x02662>               " ♢          : WHITE DIAMOND SUIT
++\\diamondt                  \\diamondt                   "            : (Incomplete sequence)
++\\diamondtopblack           <char-0x02B18>               " ⬘          : DIAMOND WITH TOP HALF BLACK
++\\dicei                     <char-0x02680>               " ⚀          : DIE FACE-1
++\\dicei<Tab>                <char-0x02680>               " ⚀          : DIE FACE-1
++\\diceii                    <char-0x02681>               " ⚁          : DIE FACE-2
++\\diceii<Tab>               <char-0x02681>               " ⚁          : DIE FACE-2
++\\diceiii                   <char-0x02682>               " ⚂          : DIE FACE-3
++\\diceiv                    <char-0x02683>               " ⚃          : DIE FACE-4
++\\dicev                     <char-0x02684>               " ⚄          : DIE FACE-5
++\\dicev<Tab>                <char-0x02684>               " ⚄          : DIE FACE-5
++\\dicevi                    <char-0x02685>               " ⚅          : DIE FACE-6
++\\digamma                   <char-0x003DD>               " ϝ          : GREEK SMALL LETTER DIGAMMA
++\\dingasterisk              <char-0x0273D>               " ✽          : HEAVY TEARDROP-SPOKED ASTERISK
++\\disin                     <char-0x022F2>               " ⋲          : ELEMENT OF WITH LONG HORIZONTAL STROKE
++\\disjquant                 <char-0x02A08>               " ⨈          : TWO LOGICAL OR OPERATOR
++\\div                       <char-0x000F7>               " ÷          : DIVISION SIGN
++\\div<Tab>                  <char-0x000F7>               " ÷          : DIVISION SIGN
++\\divi                      \\divi                       "            : (Incomplete sequence)
++\\divideontimes             <char-0x022C7>               " ⋇          : DIVISION TIMES
++\\dj                        <char-0x00111>               " đ          : LATIN SMALL LETTER D WITH STROKE / LATIN SMALL LETTER D BAR
++\\dlcorn                    <char-0x023A3>               " ⎣          : LEFT SQUARE BRACKET LOWER CORNER
++\\dot                       <char-0x00307>               " ◌̇         : COMBINING DOT ABOVE / NON-SPACING DOT ABOVE
++\\dot<Tab>                  <char-0x00307>               " ◌̇         : COMBINING DOT ABOVE / NON-SPACING DOT ABOVE
++\\dote                      \\dote                       "            : (Incomplete sequence)
++\\doteq                     <char-0x02250>               " ≐          : APPROACHES THE LIMIT
++\\doteq<Tab>                <char-0x02250>               " ≐          : APPROACHES THE LIMIT
++\\dotequ                    \\dotequ                     "            : (Incomplete sequence)
++\\dotequiv                  <char-0x02A67>               " ⩧          : IDENTICAL WITH DOT ABOVE
++\\dotm                      \\dotm                       "            : (Incomplete sequence)
++\\dotminus                  <char-0x02238>               " ∸          : DOT MINUS
++\\dotp                      \\dotp                       "            : (Incomplete sequence)
++\\dotplus                   <char-0x02214>               " ∔          : DOT PLUS
++\\dots                      <char-0x02026>               " …          : HORIZONTAL ELLIPSIS
++\\dots<Tab>                 <char-0x02026>               " …          : HORIZONTAL ELLIPSIS
++\\dotsi                     \\dotsi                      "            : (Incomplete sequence)
++\\dotsim                    <char-0x02A6A>               " ⩪          : TILDE OPERATOR WITH DOT ABOVE
++\\dotsm                     \\dotsm                      "            : (Incomplete sequence)
++\\dotsminusdots             <char-0x0223A>               " ∺          : GEOMETRIC PROPORTION
++\\dott                      \\dott                       "            : (Incomplete sequence)
++\\dottedcircle              <char-0x025CC>               " ◌          : DOTTED CIRCLE
++\\dottedsquare              <char-0x02B1A>               " ⬚          : DOTTED SQUARE
++\\dottimes                  <char-0x02A30>               " ⨰          : MULTIPLICATION SIGN WITH DOT ABOVE
++\\doublebarvee              <char-0x02A62>               " ⩢          : LOGICAL OR WITH DOUBLE OVERBAR
++\\doublepipe                <char-0x001C2>               " ǂ          : LATIN LETTER ALVEOLAR CLICK / LATIN LETTER PIPE DOUBLE BAR
++\\doubleplus                <char-0x029FA>               " ⧺          : DOUBLE PLUS
++\\downarrow                 <char-0x02193>               " ↓          : DOWNWARDS ARROW / DOWN ARROW
++\\downarrow<Tab>            <char-0x02193>               " ↓          : DOWNWARDS ARROW / DOWN ARROW
++\\downarrowb                \\downarrowb                 "            : (Incomplete sequence)
++\\downarrowbarred           <char-0x02908>               " ⤈          : DOWNWARDS ARROW WITH HORIZONTAL STROKE
++\\downdasharrow             <char-0x021E3>               " ⇣          : DOWNWARDS DASHED ARROW / DOWN DASHED ARROW
++\\downdownarrows            <char-0x021CA>               " ⇊          : DOWNWARDS PAIRED ARROWS / DOWN PAIRED ARROWS
++\\downharpoonleft           <char-0x021C3>               " ⇃          : DOWNWARDS HARPOON WITH BARB LEFTWARDS / DOWN HARPOON WITH BARB LEFT
++\\downharpoonright          <char-0x021C2>               " ⇂          : DOWNWARDS HARPOON WITH BARB RIGHTWARDS / DOWN HARPOON WITH BARB RIGHT
++\\downharpoonsleftright     <char-0x02965>               " ⥥          : DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT
++\\downvDash                 <char-0x02AEA>               " ⫪          : DOUBLE DOWN TACK
++\\downwhitearrow            <char-0x021E9>               " ⇩          : DOWNWARDS WHITE ARROW / WHITE DOWN ARROW
++\\downzigzagarrow           <char-0x021AF>               " ↯          : DOWNWARDS ZIGZAG ARROW / DOWN ZIGZAG ARROW
++\\draftingarrow             <char-0x0279B>               " ➛          : DRAFTING POINT RIGHTWARDS ARROW / DRAFTING POINT RIGHT ARROW
++\\drbkarrow                 <char-0x02910>               " ⤐          : RIGHTWARDS TWO-HEADED TRIPLE DASH ARROW
++\\droang                    <char-0x0031A>               " ◌̚         : COMBINING LEFT ANGLE ABOVE / NON-SPACING LEFT ANGLE ABOVE
++\\dshfnc                    <char-0x02506>               " ┆          : BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL / FORMS LIGHT TRIPLE DASH VERTICAL
++\\dsol                      <char-0x029F6>               " ⧶          : SOLIDUS WITH OVERBAR
++\\dualmap                   <char-0x029DF>               " ⧟          : DOUBLE-ENDED MULTIMAP
++\\dyogh                     <char-0x002A4>               " ʤ          : LATIN SMALL LETTER DEZH DIGRAPH / LATIN SMALL LETTER D YOGH
++\\egsdot                    <char-0x02A98>               " ⪘          : SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE
++\\eighthnote                <char-0x0266A>               " ♪          : EIGHTH NOTE
++\\elinters                  <char-0x023E7>               " ⏧          : ELECTRICAL INTERSECTION
++\\ell                       <char-0x02113>               " ℓ          : SCRIPT SMALL L
++\\elsdot                    <char-0x02A97>               " ⪗          : SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE
++\\emdash                    <char-0x02014>               " —          : EM DASH
++\\emptyset                  <char-0x02205>               " ∅          : EMPTY SET
++\\emptyset<Tab>             <char-0x02205>               " ∅          : EMPTY SET
++\\emptyseto                 \\emptyseto                  "            : (Incomplete sequence)
++\\emptysetoarr              <char-0x029B3>               " ⦳          : EMPTY SET WITH RIGHT ARROW ABOVE
++\\emptysetoarr<Tab>         <char-0x029B3>               " ⦳          : EMPTY SET WITH RIGHT ARROW ABOVE
++\\emptysetoarrl             <char-0x029B4>               " ⦴          : EMPTY SET WITH LEFT ARROW ABOVE
++\\emptysetobar              <char-0x029B1>               " ⦱          : EMPTY SET WITH OVERBAR
++\\emptysetocirc             <char-0x029B2>               " ⦲          : EMPTY SET WITH SMALL CIRCLE ABOVE
++\\enclosecircle             <char-0x020DD>               " ◌⃝         : COMBINING ENCLOSING CIRCLE / ENCLOSING CIRCLE
++\\enclosediamond            <char-0x020DF>               " ◌⃟         : COMBINING ENCLOSING DIAMOND / ENCLOSING DIAMOND
++\\enclosesquare             <char-0x020DE>               " ◌⃞         : COMBINING ENCLOSING SQUARE / ENCLOSING SQUARE
++\\enclosetriangle           <char-0x020E4>               " ◌⃤         : COMBINING ENCLOSING UPWARD POINTING TRIANGLE
++\\endash                    <char-0x02013>               " –          : EN DASH
++\\enspace                   <char-0x02002>               "            : EN SPACE
++\\eparsl                    <char-0x029E3>               " ⧣          : EQUALS SIGN AND SLANTED PARALLEL
++\\epsilon                   <char-0x003F5>               " ϵ          : GREEK LUNATE EPSILON SYMBOL
++\\eqcirc                    <char-0x02256>               " ≖          : RING IN EQUAL TO
++\\eqcolon                   <char-0x02255>               " ≕          : EQUALS COLON / EQUAL COLON
++\\eqdef                     <char-0x0225D>               " ≝          : EQUAL TO BY DEFINITION
++\\eqdot                     <char-0x02A66>               " ⩦          : EQUALS SIGN WITH DOT BELOW
++\\eqeqeq                    <char-0x02A76>               " ⩶          : THREE CONSECUTIVE EQUALS SIGNS
++\\eqgtr                     <char-0x022DD>               " ⋝          : EQUAL TO OR GREATER-THAN / EQUAL TO OR GREATER THAN
++\\eqless                    <char-0x022DC>               " ⋜          : EQUAL TO OR LESS-THAN / EQUAL TO OR LESS THAN
++\\eqqgtr                    <char-0x02A9A>               " ⪚          : DOUBLE-LINE EQUAL TO OR GREATER-THAN
++\\eqqless                   <char-0x02A99>               " ⪙          : DOUBLE-LINE EQUAL TO OR LESS-THAN
++\\eqqplus                   <char-0x02A71>               " ⩱          : EQUALS SIGN ABOVE PLUS SIGN
++\\eqqsim                    <char-0x02A73>               " ⩳          : EQUALS SIGN ABOVE TILDE OPERATOR
++\\eqqslantgtr               <char-0x02A9C>               " ⪜          : DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN
++\\eqqslantless              <char-0x02A9B>               " ⪛          : DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN
++\\eqsim                     <char-0x02242>               " ≂          : MINUS TILDE
++\\eqslantgtr                <char-0x02A96>               " ⪖          : SLANTED EQUAL TO OR GREATER-THAN
++\\eqslantless               <char-0x02A95>               " ⪕          : SLANTED EQUAL TO OR LESS-THAN
++\\equalleftarrow            <char-0x02B40>               " ⭀          : EQUALS SIGN ABOVE LEFTWARDS ARROW
++\\equalparallel             <char-0x022D5>               " ⋕          : EQUAL AND PARALLEL TO
++\\equiv                     <char-0x02261>               " ≡          : IDENTICAL TO
++\\equiv<Tab>                <char-0x02261>               " ≡          : IDENTICAL TO
++\\equivD                    \\equivD                     "            : (Incomplete sequence)
++\\equivDD                   <char-0x02A78>               " ⩸          : EQUIVALENT WITH FOUR DOTS ABOVE
++\\eqvparsl                  <char-0x029E5>               " ⧥          : IDENTICAL TO AND SLANTED PARALLEL
++\\esh                       <char-0x00283>               " ʃ          : LATIN SMALL LETTER ESH
++\\eta                       <char-0x003B7>               " η          : GREEK SMALL LETTER ETA
++\\eth                       <char-0x000F0>               " ð          : LATIN SMALL LETTER ETH
++\\euler                     <char-0x0212F>               " ℯ          : SCRIPT SMALL E
++\\euler<Tab>                <char-0x0212F>               " ℯ          : SCRIPT SMALL E
++\\eulerm                    \\eulerm                     "            : (Incomplete sequence)
++\\eulermascheroni           <char-0x02107>               " ℇ          : EULER CONSTANT / EULERS
++\\euro                      <char-0x020AC>               " €          : EURO SIGN
++\\exclamdown                <char-0x000A1>               " ¡          : INVERTED EXCLAMATION MARK
++\\exists                    <char-0x02203>               " ∃          : THERE EXISTS
++\\fallingdotseq             <char-0x02252>               " ≒          : APPROXIMATELY EQUAL TO OR THE IMAGE OF
++\\fdiagovnearrow            <char-0x0292F>               " ⤯          : FALLING DIAGONAL CROSSING NORTH EAST ARROW
++\\fdiagovrdiag              <char-0x0292C>               " ⤬          : FALLING DIAGONAL CROSSING RISING DIAGONAL
++\\female                    <char-0x02640>               " ♀          : FEMALE SIGN
++\\fhr                       <char-0x0027E>               " ɾ          : LATIN SMALL LETTER R WITH FISHHOOK / LATIN SMALL LETTER FISHHOOK R
++\\fisheye                   <char-0x025C9>               " ◉          : FISHEYE
++\\flat                      <char-0x0266D>               " ♭          : MUSIC FLAT SIGN / FLAT
++\\fltns                     <char-0x023E5>               " ⏥          : FLATNESS
++\\forall                    <char-0x02200>               " ∀          : FOR ALL
++\\forks                     <char-0x02ADC>               " ⫝̸          : FORKING
++\\forks<Tab>                <char-0x02ADC>               " ⫝̸          : FORKING
++\\forksn                    \\forksn                     "            : (Incomplete sequence)
++\\forksnot                  <char-0x02ADD>               " ⫝          : NONFORKING
++\\forkv                     <char-0x02AD9>               " ⫙          : ELEMENT OF OPENING DOWNWARDS
++\\fourthroot                <char-0x0221C>               " ∜          : FOURTH ROOT
++\\frakA                     <char-0x1D504>               " 𝔄          : MATHEMATICAL FRAKTUR CAPITAL A
++\\frakB                     <char-0x1D505>               " 𝔅          : MATHEMATICAL FRAKTUR CAPITAL B
++\\frakC                     <char-0x0212D>               " ℭ          : BLACK-LETTER CAPITAL C / BLACK-LETTER C
++\\frakD                     <char-0x1D507>               " 𝔇          : MATHEMATICAL FRAKTUR CAPITAL D
++\\frakE                     <char-0x1D508>               " 𝔈          : MATHEMATICAL FRAKTUR CAPITAL E
++\\frakF                     <char-0x1D509>               " 𝔉          : MATHEMATICAL FRAKTUR CAPITAL F
++\\frakG                     <char-0x1D50A>               " 𝔊          : MATHEMATICAL FRAKTUR CAPITAL G
++\\frakH                     <char-0x0210C>               " ℌ          : BLACK-LETTER CAPITAL H / BLACK-LETTER H
++\\frakI                     <char-0x02111>               " ℑ          : BLACK-LETTER CAPITAL I / BLACK-LETTER I
++\\frakJ                     <char-0x1D50D>               " 𝔍          : MATHEMATICAL FRAKTUR CAPITAL J
++\\frakK                     <char-0x1D50E>               " 𝔎          : MATHEMATICAL FRAKTUR CAPITAL K
++\\frakL                     <char-0x1D50F>               " 𝔏          : MATHEMATICAL FRAKTUR CAPITAL L
++\\frakM                     <char-0x1D510>               " 𝔐          : MATHEMATICAL FRAKTUR CAPITAL M
++\\frakN                     <char-0x1D511>               " 𝔑          : MATHEMATICAL FRAKTUR CAPITAL N
++\\frakO                     <char-0x1D512>               " 𝔒          : MATHEMATICAL FRAKTUR CAPITAL O
++\\frakP                     <char-0x1D513>               " 𝔓          : MATHEMATICAL FRAKTUR CAPITAL P
++\\frakQ                     <char-0x1D514>               " 𝔔          : MATHEMATICAL FRAKTUR CAPITAL Q
++\\frakR                     <char-0x0211C>               " ℜ          : BLACK-LETTER CAPITAL R / BLACK-LETTER R
++\\frakS                     <char-0x1D516>               " 𝔖          : MATHEMATICAL FRAKTUR CAPITAL S
++\\frakT                     <char-0x1D517>               " 𝔗          : MATHEMATICAL FRAKTUR CAPITAL T
++\\frakU                     <char-0x1D518>               " 𝔘          : MATHEMATICAL FRAKTUR CAPITAL U
++\\frakV                     <char-0x1D519>               " 𝔙          : MATHEMATICAL FRAKTUR CAPITAL V
++\\frakW                     <char-0x1D51A>               " 𝔚          : MATHEMATICAL FRAKTUR CAPITAL W
++\\frakX                     <char-0x1D51B>               " 𝔛          : MATHEMATICAL FRAKTUR CAPITAL X
++\\frakY                     <char-0x1D51C>               " 𝔜          : MATHEMATICAL FRAKTUR CAPITAL Y
++\\frakZ                     <char-0x02128>               " ℨ          : BLACK-LETTER CAPITAL Z / BLACK-LETTER Z
++\\fraka                     <char-0x1D51E>               " 𝔞          : MATHEMATICAL FRAKTUR SMALL A
++\\frakb                     <char-0x1D51F>               " 𝔟          : MATHEMATICAL FRAKTUR SMALL B
++\\frakc                     <char-0x1D520>               " 𝔠          : MATHEMATICAL FRAKTUR SMALL C
++\\frakd                     <char-0x1D521>               " 𝔡          : MATHEMATICAL FRAKTUR SMALL D
++\\frake                     <char-0x1D522>               " 𝔢          : MATHEMATICAL FRAKTUR SMALL E
++\\frakf                     <char-0x1D523>               " 𝔣          : MATHEMATICAL FRAKTUR SMALL F
++\\frakg                     <char-0x1D524>               " 𝔤          : MATHEMATICAL FRAKTUR SMALL G
++\\frakh                     <char-0x1D525>               " 𝔥          : MATHEMATICAL FRAKTUR SMALL H
++\\fraki                     <char-0x1D526>               " 𝔦          : MATHEMATICAL FRAKTUR SMALL I
++\\frakj                     <char-0x1D527>               " 𝔧          : MATHEMATICAL FRAKTUR SMALL J
++\\frakk                     <char-0x1D528>               " 𝔨          : MATHEMATICAL FRAKTUR SMALL K
++\\frakl                     <char-0x1D529>               " 𝔩          : MATHEMATICAL FRAKTUR SMALL L
++\\frakm                     <char-0x1D52A>               " 𝔪          : MATHEMATICAL FRAKTUR SMALL M
++\\frakn                     <char-0x1D52B>               " 𝔫          : MATHEMATICAL FRAKTUR SMALL N
++\\frako                     <char-0x1D52C>               " 𝔬          : MATHEMATICAL FRAKTUR SMALL O
++\\frakp                     <char-0x1D52D>               " 𝔭          : MATHEMATICAL FRAKTUR SMALL P
++\\frakq                     <char-0x1D52E>               " 𝔮          : MATHEMATICAL FRAKTUR SMALL Q
++\\frakr                     <char-0x1D52F>               " 𝔯          : MATHEMATICAL FRAKTUR SMALL R
++\\fraks                     <char-0x1D530>               " 𝔰          : MATHEMATICAL FRAKTUR SMALL S
++\\frakt                     <char-0x1D531>               " 𝔱          : MATHEMATICAL FRAKTUR SMALL T
++\\fraku                     <char-0x1D532>               " 𝔲          : MATHEMATICAL FRAKTUR SMALL U
++\\frakv                     <char-0x1D533>               " 𝔳          : MATHEMATICAL FRAKTUR SMALL V
++\\frakw                     <char-0x1D534>               " 𝔴          : MATHEMATICAL FRAKTUR SMALL W
++\\frakx                     <char-0x1D535>               " 𝔵          : MATHEMATICAL FRAKTUR SMALL X
++\\fraky                     <char-0x1D536>               " 𝔶          : MATHEMATICAL FRAKTUR SMALL Y
++\\frakz                     <char-0x1D537>               " 𝔷          : MATHEMATICAL FRAKTUR SMALL Z
++\\frown                     <char-0x02322>               " ⌢          : FROWN
++\\fullouterjoin             <char-0x027D7>               " ⟗          : FULL OUTER JOIN
++\\gamma                     <char-0x003B3>               " γ          : GREEK SMALL LETTER GAMMA
++\\ge                        <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
++\\ge<Tab>                   <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
++\\gem                       \\gem                        "            : (Incomplete sequence)
++\\gemini                    <char-0x0264A>               " ♊          : GEMINI
++\\geq                       <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
++\\geq<Tab>                  <char-0x02265>               " ≥          : GREATER-THAN OR EQUAL TO / GREATER THAN OR EQUAL TO
++\\geqq                      <char-0x02267>               " ≧          : GREATER-THAN OVER EQUAL TO / GREATER THAN OVER EQUAL TO
++\\geqq<Tab>                 <char-0x02267>               " ≧          : GREATER-THAN OVER EQUAL TO / GREATER THAN OVER EQUAL TO
++\\geqqs                     \\geqqs                      "            : (Incomplete sequence)
++\\geqqslant                 <char-0x02AFA>               " ⫺          : DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO
++\\geqs                      \\geqs                       "            : (Incomplete sequence)
++\\geqslant                  <char-0x02A7E>               " ⩾          : GREATER-THAN OR SLANTED EQUAL TO
++\\ges                       \\ges                        "            : (Incomplete sequence)
++\\gescc                     <char-0x02AA9>               " ⪩          : GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
++\\gesdot                    <char-0x02A80>               " ⪀          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
++\\gesdot<Tab>               <char-0x02A80>               " ⪀          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
++\\gesdoto                   <char-0x02A82>               " ⪂          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
++\\gesdoto<Tab>              <char-0x02A82>               " ⪂          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
++\\gesdotol                  <char-0x02A84>               " ⪄          : GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT
++\\gesles                    <char-0x02A94>               " ⪔          : GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL
++\\gg                        <char-0x0226B>               " ≫          : MUCH GREATER-THAN / MUCH GREATER THAN
++\\gg<Tab>                   <char-0x0226B>               " ≫          : MUCH GREATER-THAN / MUCH GREATER THAN
++\\ggg                       <char-0x022D9>               " ⋙          : VERY MUCH GREATER-THAN / VERY MUCH GREATER THAN
++\\ggg<Tab>                  <char-0x022D9>               " ⋙          : VERY MUCH GREATER-THAN / VERY MUCH GREATER THAN
++\\gggn                      \\gggn                       "            : (Incomplete sequence)
++\\gggnest                   <char-0x02AF8>               " ⫸          : TRIPLE NESTED GREATER-THAN
++\\gimel                     <char-0x02137>               " ℷ          : GIMEL SYMBOL / THIRD TRANSFINITE CARDINAL
++\\glE                       <char-0x02A92>               " ⪒          : GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL
++\\gla                       <char-0x02AA5>               " ⪥          : GREATER-THAN BESIDE LESS-THAN
++\\glj                       <char-0x02AA4>               " ⪤          : GREATER-THAN OVERLAPPING LESS-THAN
++\\glst                      <char-0x00294>               " ʔ          : LATIN LETTER GLOTTAL STOP
++\\gnapprox                  <char-0x02A8A>               " ⪊          : GREATER-THAN AND NOT APPROXIMATE
++\\gneq                      <char-0x02A88>               " ⪈          : GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
++\\gneq<Tab>                 <char-0x02A88>               " ⪈          : GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
++\\gneqq                     <char-0x02269>               " ≩          : GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO
++\\gnsim                     <char-0x022E7>               " ⋧          : GREATER-THAN BUT NOT EQUIVALENT TO / GREATER THAN BUT NOT EQUIVALENT TO
++\\grave                     <char-0x00300>               " ◌̀         : COMBINING GRAVE ACCENT / NON-SPACING GRAVE
++\\gsime                     <char-0x02A8E>               " ⪎          : GREATER-THAN ABOVE SIMILAR OR EQUAL
++\\gsiml                     <char-0x02A90>               " ⪐          : GREATER-THAN ABOVE SIMILAR ABOVE LESS-THAN
++\\gtcc                      <char-0x02AA7>               " ⪧          : GREATER-THAN CLOSED BY CURVE
++\\gtcir                     <char-0x02A7A>               " ⩺          : GREATER-THAN WITH CIRCLE INSIDE
++\\gtquest                   <char-0x02A7C>               " ⩼          : GREATER-THAN WITH QUESTION MARK ABOVE
++\\gtrapprox                 <char-0x02A86>               " ⪆          : GREATER-THAN OR APPROXIMATE
++\\gtrdot                    <char-0x022D7>               " ⋗          : GREATER-THAN WITH DOT / GREATER THAN WITH DOT
++\\gtreqless                 <char-0x022DB>               " ⋛          : GREATER-THAN EQUAL TO OR LESS-THAN / GREATER THAN EQUAL TO OR LESS THAN
++\\gtreqqless                <char-0x02A8C>               " ⪌          : GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
++\\gtrless                   <char-0x02277>               " ≷          : GREATER-THAN OR LESS-THAN / GREATER THAN OR LESS THAN
++\\gtrsim                    <char-0x02273>               " ≳          : GREATER-THAN OR EQUIVALENT TO / GREATER THAN OR EQUIVALENT TO
++\\guilsinglleft             <char-0x02039>               " ‹          : SINGLE LEFT-POINTING ANGLE QUOTATION MARK / LEFT POINTING SINGLE GUILLEMET
++\\guilsinglright            <char-0x0203A>               " ›          : SINGLE RIGHT-POINTING ANGLE QUOTATION MARK / RIGHT POINTING SINGLE GUILLEMET
++\\gvertneqq                 <char-0x02269><char-0x0FE00> " ≩︀         : GREATER-THAN BUT NOT EQUAL TO / GREATER THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
++\\hat                       <char-0x00302>               " ◌̂         : COMBINING CIRCUMFLEX ACCENT / NON-SPACING CIRCUMFLEX
++\\hat<Tab>                  <char-0x00302>               " ◌̂         : COMBINING CIRCUMFLEX ACCENT / NON-SPACING CIRCUMFLEX
++\\hata                      \\hata                       "            : (Incomplete sequence)
++\\hatapprox                 <char-0x02A6F>               " ⩯          : ALMOST EQUAL TO WITH CIRCUMFLEX ACCENT
++\\hbar                      <char-0x00127>               " ħ          : LATIN SMALL LETTER H WITH STROKE / LATIN SMALL LETTER H BAR
++\\heartsuit                 <char-0x02661>               " ♡          : WHITE HEART SUIT
++\\hermaphrodite             <char-0x026A5>               " ⚥          : MALE AND FEMALE SIGN
++\\hermitconjmatrix          <char-0x022B9>               " ⊹          : HERMITIAN CONJUGATE MATRIX
++\\hexagon                   <char-0x02394>               " ⎔          : SOFTWARE-FUNCTION SYMBOL
++\\hexagon<Tab>              <char-0x02394>               " ⎔          : SOFTWARE-FUNCTION SYMBOL
++\\hexagonb                  \\hexagonb                   "            : (Incomplete sequence)
++\\hexagonblack              <char-0x02B23>               " ⬣          : HORIZONTAL BLACK HEXAGON
++\\highminus                 <char-0x000AF>               " ¯          : MACRON / SPACING MACRON
++\\hksearow                  <char-0x02925>               " ⤥          : SOUTH EAST ARROW WITH HOOK
++\\hkswarow                  <char-0x02926>               " ⤦          : SOUTH WEST ARROW WITH HOOK
++\\hlmrk                     <char-0x002D1>               " ˑ          : MODIFIER LETTER HALF TRIANGULAR COLON
++\\hookleftarrow             <char-0x021A9>               " ↩          : LEFTWARDS ARROW WITH HOOK / LEFT ARROW WITH HOOK
++\\hookrightarrow            <char-0x021AA>               " ↪          : RIGHTWARDS ARROW WITH HOOK / RIGHT ARROW WITH HOOK
++\\house                     <char-0x02302>               " ⌂          : HOUSE
++\\hrectangle                <char-0x025AD>               " ▭          : WHITE RECTANGLE
++\\hrectangle<Tab>           <char-0x025AD>               " ▭          : WHITE RECTANGLE
++\\hrectangleb               \\hrectangleb                "            : (Incomplete sequence)
++\\hrectangleblack           <char-0x025AC>               " ▬          : BLACK RECTANGLE
++\\hslash                    <char-0x0210F>               " ℏ          : PLANCK CONSTANT OVER TWO PI / PLANCK CONSTANT OVER 2 PI
++\\hspace                    <char-0x0200A>               "            : HAIR SPACE
++\\hvlig                     <char-0x00195>               " ƕ          : LATIN SMALL LETTER HV / LATIN SMALL LETTER H V
++\\iff                       <char-0x027FA>               " ⟺          : LONG LEFT RIGHT DOUBLE ARROW
++\\iiiint                    <char-0x02A0C>               " ⨌          : QUADRUPLE INTEGRAL OPERATOR
++\\iiint                     <char-0x0222D>               " ∭          : TRIPLE INTEGRAL
++\\iint                      <char-0x0222C>               " ∬          : DOUBLE INTEGRAL
++\\image                     <char-0x022B7>               " ⊷          : IMAGE OF
++\\imath                     <char-0x00131>               " ı          : LATIN SMALL LETTER DOTLESS I
++\\impliedby                 <char-0x027F8>               " ⟸          : LONG LEFTWARDS DOUBLE ARROW
++\\implies                   <char-0x027F9>               " ⟹          : LONG RIGHTWARDS DOUBLE ARROW
++\\in                        <char-0x02208>               " ∈          : ELEMENT OF
++\\in<Tab>                   <char-0x02208>               " ∈          : ELEMENT OF
++\\inc                       \\inc                        "            : (Incomplete sequence)
++\\increment                 <char-0x02206>               " ∆          : INCREMENT
++\\ind                       \\ind                        "            : (Incomplete sequence)
++\\indep                     <char-0x02AEB>               " ⫫          : DOUBLE UP TACK
++\\inf                       \\inf                        "            : (Incomplete sequence)
++\\infty                     <char-0x0221E>               " ∞          : INFINITY
++\\ing                       \\ing                        "            : (Incomplete sequence)
++\\inglst                    <char-0x00296>               " ʖ          : LATIN LETTER INVERTED GLOTTAL STOP
++\\int                       <char-0x0222B>               " ∫          : INTEGRAL
++\\int<Tab>                  <char-0x0222B>               " ∫          : INTEGRAL
++\\intB                      \\intB                       "            : (Incomplete sequence)
++\\intBar                    <char-0x02A0E>               " ⨎          : INTEGRAL WITH DOUBLE STROKE
++\\intb                      \\intb                       "            : (Incomplete sequence)
++\\intbar                    <char-0x02A0D>               " ⨍          : FINITE PART INTEGRAL
++\\intc                      \\intc                       "            : (Incomplete sequence)
++\\intcap                    <char-0x02A19>               " ⨙          : INTEGRAL WITH INTERSECTION
++\\intcup                    <char-0x02A1A>               " ⨚          : INTEGRAL WITH UNION
++\\inte                      \\inte                       "            : (Incomplete sequence)
++\\intercal                  <char-0x022BA>               " ⊺          : INTERCALATE
++\\interleave                <char-0x02AF4>               " ⫴          : TRIPLE VERTICAL BAR BINARY RELATION
++\\intp                      \\intp                       "            : (Incomplete sequence)
++\\intprod                   <char-0x02A3C>               " ⨼          : INTERIOR PRODUCT
++\\intprod<Tab>              <char-0x02A3C>               " ⨼          : INTERIOR PRODUCT
++\\intprodr                  <char-0x02A3D>               " ⨽          : RIGHTHAND INTERIOR PRODUCT
++\\intx                      <char-0x02A18>               " ⨘          : INTEGRAL WITH TIMES SIGN
++\\inv                       \\inv                        "            : (Incomplete sequence)
++\\inversewhitecircle        <char-0x025D9>               " ◙          : INVERSE WHITE CIRCLE
++\\invnot                    <char-0x02310>               " ⌐          : REVERSED NOT SIGN
++\\invv                      <char-0x0028C>               " ʌ          : LATIN SMALL LETTER TURNED V
++\\invw                      <char-0x0028D>               " ʍ          : LATIN SMALL LETTER TURNED W
++\\invw<Tab>                 <char-0x0028D>               " ʍ          : LATIN SMALL LETTER TURNED W
++\\invwh                     \\invwh                      "            : (Incomplete sequence)
++\\invwhitelowerhalfcircle   <char-0x025DB>               " ◛          : LOWER HALF INVERSE WHITE CIRCLE
++\\invwhiteupperhalfcircle   <char-0x025DA>               " ◚          : UPPER HALF INVERSE WHITE CIRCLE
++\\iota                      <char-0x003B9>               " ι          : GREEK SMALL LETTER IOTA
++\\isansA                    <char-0x1D608>               " 𝘈          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL A
++\\isansB                    <char-0x1D609>               " 𝘉          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL B
++\\isansC                    <char-0x1D60A>               " 𝘊          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL C
++\\isansD                    <char-0x1D60B>               " 𝘋          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL D
++\\isansE                    <char-0x1D60C>               " 𝘌          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL E
++\\isansF                    <char-0x1D60D>               " 𝘍          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL F
++\\isansG                    <char-0x1D60E>               " 𝘎          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL G
++\\isansH                    <char-0x1D60F>               " 𝘏          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL H
++\\isansI                    <char-0x1D610>               " 𝘐          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL I
++\\isansJ                    <char-0x1D611>               " 𝘑          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL J
++\\isansK                    <char-0x1D612>               " 𝘒          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL K
++\\isansL                    <char-0x1D613>               " 𝘓          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL L
++\\isansM                    <char-0x1D614>               " 𝘔          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL M
++\\isansN                    <char-0x1D615>               " 𝘕          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL N
++\\isansO                    <char-0x1D616>               " 𝘖          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL O
++\\isansP                    <char-0x1D617>               " 𝘗          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL P
++\\isansQ                    <char-0x1D618>               " 𝘘          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL Q
++\\isansR                    <char-0x1D619>               " 𝘙          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL R
++\\isansS                    <char-0x1D61A>               " 𝘚          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL S
++\\isansT                    <char-0x1D61B>               " 𝘛          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL T
++\\isansU                    <char-0x1D61C>               " 𝘜          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL U
++\\isansV                    <char-0x1D61D>               " 𝘝          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL V
++\\isansW                    <char-0x1D61E>               " 𝘞          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL W
++\\isansX                    <char-0x1D61F>               " 𝘟          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL X
++\\isansY                    <char-0x1D620>               " 𝘠          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL Y
++\\isansZ                    <char-0x1D621>               " 𝘡          : MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z
++\\isansa                    <char-0x1D622>               " 𝘢          : MATHEMATICAL SANS-SERIF ITALIC SMALL A
++\\isansb                    <char-0x1D623>               " 𝘣          : MATHEMATICAL SANS-SERIF ITALIC SMALL B
++\\isansc                    <char-0x1D624>               " 𝘤          : MATHEMATICAL SANS-SERIF ITALIC SMALL C
++\\isansd                    <char-0x1D625>               " 𝘥          : MATHEMATICAL SANS-SERIF ITALIC SMALL D
++\\isanse                    <char-0x1D626>               " 𝘦          : MATHEMATICAL SANS-SERIF ITALIC SMALL E
++\\isansf                    <char-0x1D627>               " 𝘧          : MATHEMATICAL SANS-SERIF ITALIC SMALL F
++\\isansg                    <char-0x1D628>               " 𝘨          : MATHEMATICAL SANS-SERIF ITALIC SMALL G
++\\isansh                    <char-0x1D629>               " 𝘩          : MATHEMATICAL SANS-SERIF ITALIC SMALL H
++\\isansi                    <char-0x1D62A>               " 𝘪          : MATHEMATICAL SANS-SERIF ITALIC SMALL I
++\\isansj                    <char-0x1D62B>               " 𝘫          : MATHEMATICAL SANS-SERIF ITALIC SMALL J
++\\isansk                    <char-0x1D62C>               " 𝘬          : MATHEMATICAL SANS-SERIF ITALIC SMALL K
++\\isansl                    <char-0x1D62D>               " 𝘭          : MATHEMATICAL SANS-SERIF ITALIC SMALL L
++\\isansm                    <char-0x1D62E>               " 𝘮          : MATHEMATICAL SANS-SERIF ITALIC SMALL M
++\\isansn                    <char-0x1D62F>               " 𝘯          : MATHEMATICAL SANS-SERIF ITALIC SMALL N
++\\isanso                    <char-0x1D630>               " 𝘰          : MATHEMATICAL SANS-SERIF ITALIC SMALL O
++\\isansp                    <char-0x1D631>               " 𝘱          : MATHEMATICAL SANS-SERIF ITALIC SMALL P
++\\isansq                    <char-0x1D632>               " 𝘲          : MATHEMATICAL SANS-SERIF ITALIC SMALL Q
++\\isansr                    <char-0x1D633>               " 𝘳          : MATHEMATICAL SANS-SERIF ITALIC SMALL R
++\\isanss                    <char-0x1D634>               " 𝘴          : MATHEMATICAL SANS-SERIF ITALIC SMALL S
++\\isanst                    <char-0x1D635>               " 𝘵          : MATHEMATICAL SANS-SERIF ITALIC SMALL T
++\\isansu                    <char-0x1D636>               " 𝘶          : MATHEMATICAL SANS-SERIF ITALIC SMALL U
++\\isansv                    <char-0x1D637>               " 𝘷          : MATHEMATICAL SANS-SERIF ITALIC SMALL V
++\\isansw                    <char-0x1D638>               " 𝘸          : MATHEMATICAL SANS-SERIF ITALIC SMALL W
++\\isansx                    <char-0x1D639>               " 𝘹          : MATHEMATICAL SANS-SERIF ITALIC SMALL X
++\\isansy                    <char-0x1D63A>               " 𝘺          : MATHEMATICAL SANS-SERIF ITALIC SMALL Y
++\\isansz                    <char-0x1D63B>               " 𝘻          : MATHEMATICAL SANS-SERIF ITALIC SMALL Z
++\\isinE                     <char-0x022F9>               " ⋹          : ELEMENT OF WITH TWO HORIZONTAL STROKES
++\\isindot                   <char-0x022F5>               " ⋵          : ELEMENT OF WITH DOT ABOVE
++\\isinobar                  <char-0x022F7>               " ⋷          : SMALL ELEMENT OF WITH OVERBAR
++\\isins                     <char-0x022F4>               " ⋴          : SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++\\isinvb                    <char-0x022F8>               " ⋸          : ELEMENT OF WITH UNDERBAR
++\\itA                       <char-0x1D434>               " 𝐴          : MATHEMATICAL ITALIC CAPITAL A
++\\itA<Tab>                  <char-0x1D434>               " 𝐴          : MATHEMATICAL ITALIC CAPITAL A
++\\itAl                      \\itAl                       "            : (Incomplete sequence)
++\\itAlpha                   <char-0x1D6E2>               " 𝛢          : MATHEMATICAL ITALIC CAPITAL ALPHA
++\\itB                       <char-0x1D435>               " 𝐵          : MATHEMATICAL ITALIC CAPITAL B
++\\itB<Tab>                  <char-0x1D435>               " 𝐵          : MATHEMATICAL ITALIC CAPITAL B
++\\itBe                      \\itBe                       "            : (Incomplete sequence)
++\\itBeta                    <char-0x1D6E3>               " 𝛣          : MATHEMATICAL ITALIC CAPITAL BETA
++\\itC                       <char-0x1D436>               " 𝐶          : MATHEMATICAL ITALIC CAPITAL C
++\\itC<Tab>                  <char-0x1D436>               " 𝐶          : MATHEMATICAL ITALIC CAPITAL C
++\\itCh                      \\itCh                       "            : (Incomplete sequence)
++\\itChi                     <char-0x1D6F8>               " 𝛸          : MATHEMATICAL ITALIC CAPITAL CHI
++\\itD                       <char-0x1D437>               " 𝐷          : MATHEMATICAL ITALIC CAPITAL D
++\\itD<Tab>                  <char-0x1D437>               " 𝐷          : MATHEMATICAL ITALIC CAPITAL D
++\\itDe                      \\itDe                       "            : (Incomplete sequence)
++\\itDelta                   <char-0x1D6E5>               " 𝛥          : MATHEMATICAL ITALIC CAPITAL DELTA
++\\itE                       <char-0x1D438>               " 𝐸          : MATHEMATICAL ITALIC CAPITAL E
++\\itE<Tab>                  <char-0x1D438>               " 𝐸          : MATHEMATICAL ITALIC CAPITAL E
++\\itEp                      \\itEp                       "            : (Incomplete sequence)
++\\itEpsilon                 <char-0x1D6E6>               " 𝛦          : MATHEMATICAL ITALIC CAPITAL EPSILON
++\\itEt                      \\itEt                       "            : (Incomplete sequence)
++\\itEta                     <char-0x1D6E8>               " 𝛨          : MATHEMATICAL ITALIC CAPITAL ETA
++\\itF                       <char-0x1D439>               " 𝐹          : MATHEMATICAL ITALIC CAPITAL F
++\\itG                       <char-0x1D43A>               " 𝐺          : MATHEMATICAL ITALIC CAPITAL G
++\\itG<Tab>                  <char-0x1D43A>               " 𝐺          : MATHEMATICAL ITALIC CAPITAL G
++\\itGa                      \\itGa                       "            : (Incomplete sequence)
++\\itGamma                   <char-0x1D6E4>               " 𝛤          : MATHEMATICAL ITALIC CAPITAL GAMMA
++\\itH                       <char-0x1D43B>               " 𝐻          : MATHEMATICAL ITALIC CAPITAL H
++\\itI                       <char-0x1D43C>               " 𝐼          : MATHEMATICAL ITALIC CAPITAL I
++\\itI<Tab>                  <char-0x1D43C>               " 𝐼          : MATHEMATICAL ITALIC CAPITAL I
++\\itIo                      \\itIo                       "            : (Incomplete sequence)
++\\itIota                    <char-0x1D6EA>               " 𝛪          : MATHEMATICAL ITALIC CAPITAL IOTA
++\\itJ                       <char-0x1D43D>               " 𝐽          : MATHEMATICAL ITALIC CAPITAL J
++\\itK                       <char-0x1D43E>               " 𝐾          : MATHEMATICAL ITALIC CAPITAL K
++\\itK<Tab>                  <char-0x1D43E>               " 𝐾          : MATHEMATICAL ITALIC CAPITAL K
++\\itKa                      \\itKa                       "            : (Incomplete sequence)
++\\itKappa                   <char-0x1D6EB>               " 𝛫          : MATHEMATICAL ITALIC CAPITAL KAPPA
++\\itL                       <char-0x1D43F>               " 𝐿          : MATHEMATICAL ITALIC CAPITAL L
++\\itL<Tab>                  <char-0x1D43F>               " 𝐿          : MATHEMATICAL ITALIC CAPITAL L
++\\itLa                      \\itLa                       "            : (Incomplete sequence)
++\\itLambda                  <char-0x1D6EC>               " 𝛬          : MATHEMATICAL ITALIC CAPITAL LAMDA
++\\itM                       <char-0x1D440>               " 𝑀          : MATHEMATICAL ITALIC CAPITAL M
++\\itM<Tab>                  <char-0x1D440>               " 𝑀          : MATHEMATICAL ITALIC CAPITAL M
++\\itMu                      <char-0x1D6ED>               " 𝛭          : MATHEMATICAL ITALIC CAPITAL MU
++\\itN                       <char-0x1D441>               " 𝑁          : MATHEMATICAL ITALIC CAPITAL N
++\\itN<Tab>                  <char-0x1D441>               " 𝑁          : MATHEMATICAL ITALIC CAPITAL N
++\\itNu                      <char-0x1D6EE>               " 𝛮          : MATHEMATICAL ITALIC CAPITAL NU
++\\itO                       <char-0x1D442>               " 𝑂          : MATHEMATICAL ITALIC CAPITAL O
++\\itO<Tab>                  <char-0x1D442>               " 𝑂          : MATHEMATICAL ITALIC CAPITAL O
++\\itOm                      \\itOm                       "            : (Incomplete sequence)
++\\itOmega                   <char-0x1D6FA>               " 𝛺          : MATHEMATICAL ITALIC CAPITAL OMEGA
++\\itOmicron                 <char-0x1D6F0>               " 𝛰          : MATHEMATICAL ITALIC CAPITAL OMICRON
++\\itP                       <char-0x1D443>               " 𝑃          : MATHEMATICAL ITALIC CAPITAL P
++\\itP<Tab>                  <char-0x1D443>               " 𝑃          : MATHEMATICAL ITALIC CAPITAL P
++\\itPh                      \\itPh                       "            : (Incomplete sequence)
++\\itPhi                     <char-0x1D6F7>               " 𝛷          : MATHEMATICAL ITALIC CAPITAL PHI
++\\itPi                      <char-0x1D6F1>               " 𝛱          : MATHEMATICAL ITALIC CAPITAL PI
++\\itPs                      \\itPs                       "            : (Incomplete sequence)
++\\itPsi                     <char-0x1D6F9>               " 𝛹          : MATHEMATICAL ITALIC CAPITAL PSI
++\\itQ                       <char-0x1D444>               " 𝑄          : MATHEMATICAL ITALIC CAPITAL Q
++\\itR                       <char-0x1D445>               " 𝑅          : MATHEMATICAL ITALIC CAPITAL R
++\\itR<Tab>                  <char-0x1D445>               " 𝑅          : MATHEMATICAL ITALIC CAPITAL R
++\\itRh                      \\itRh                       "            : (Incomplete sequence)
++\\itRho                     <char-0x1D6F2>               " 𝛲          : MATHEMATICAL ITALIC CAPITAL RHO
++\\itS                       <char-0x1D446>               " 𝑆          : MATHEMATICAL ITALIC CAPITAL S
++\\itS<Tab>                  <char-0x1D446>               " 𝑆          : MATHEMATICAL ITALIC CAPITAL S
++\\itSi                      \\itSi                       "            : (Incomplete sequence)
++\\itSigma                   <char-0x1D6F4>               " 𝛴          : MATHEMATICAL ITALIC CAPITAL SIGMA
++\\itT                       <char-0x1D447>               " 𝑇          : MATHEMATICAL ITALIC CAPITAL T
++\\itT<Tab>                  <char-0x1D447>               " 𝑇          : MATHEMATICAL ITALIC CAPITAL T
++\\itTa                      \\itTa                       "            : (Incomplete sequence)
++\\itTau                     <char-0x1D6F5>               " 𝛵          : MATHEMATICAL ITALIC CAPITAL TAU
++\\itTh                      \\itTh                       "            : (Incomplete sequence)
++\\itTheta                   <char-0x1D6E9>               " 𝛩          : MATHEMATICAL ITALIC CAPITAL THETA
++\\itU                       <char-0x1D448>               " 𝑈          : MATHEMATICAL ITALIC CAPITAL U
++\\itU<Tab>                  <char-0x1D448>               " 𝑈          : MATHEMATICAL ITALIC CAPITAL U
++\\itUp                      \\itUp                       "            : (Incomplete sequence)
++\\itUpsilon                 <char-0x1D6F6>               " 𝛶          : MATHEMATICAL ITALIC CAPITAL UPSILON
++\\itV                       <char-0x1D449>               " 𝑉          : MATHEMATICAL ITALIC CAPITAL V
++\\itW                       <char-0x1D44A>               " 𝑊          : MATHEMATICAL ITALIC CAPITAL W
++\\itX                       <char-0x1D44B>               " 𝑋          : MATHEMATICAL ITALIC CAPITAL X
++\\itX<Tab>                  <char-0x1D44B>               " 𝑋          : MATHEMATICAL ITALIC CAPITAL X
++\\itXi                      <char-0x1D6EF>               " 𝛯          : MATHEMATICAL ITALIC CAPITAL XI
++\\itY                       <char-0x1D44C>               " 𝑌          : MATHEMATICAL ITALIC CAPITAL Y
++\\itZ                       <char-0x1D44D>               " 𝑍          : MATHEMATICAL ITALIC CAPITAL Z
++\\itZ<Tab>                  <char-0x1D44D>               " 𝑍          : MATHEMATICAL ITALIC CAPITAL Z
++\\itZe                      \\itZe                       "            : (Incomplete sequence)
++\\itZeta                    <char-0x1D6E7>               " 𝛧          : MATHEMATICAL ITALIC CAPITAL ZETA
++\\ita                       <char-0x1D44E>               " 𝑎          : MATHEMATICAL ITALIC SMALL A
++\\ita<Tab>                  <char-0x1D44E>               " 𝑎          : MATHEMATICAL ITALIC SMALL A
++\\ital                      \\ital                       "            : (Incomplete sequence)
++\\italpha                   <char-0x1D6FC>               " 𝛼          : MATHEMATICAL ITALIC SMALL ALPHA
++\\itb                       <char-0x1D44F>               " 𝑏          : MATHEMATICAL ITALIC SMALL B
++\\itb<Tab>                  <char-0x1D44F>               " 𝑏          : MATHEMATICAL ITALIC SMALL B
++\\itbe                      \\itbe                       "            : (Incomplete sequence)
++\\itbeta                    <char-0x1D6FD>               " 𝛽          : MATHEMATICAL ITALIC SMALL BETA
++\\itc                       <char-0x1D450>               " 𝑐          : MATHEMATICAL ITALIC SMALL C
++\\itc<Tab>                  <char-0x1D450>               " 𝑐          : MATHEMATICAL ITALIC SMALL C
++\\itch                      \\itch                       "            : (Incomplete sequence)
++\\itchi                     <char-0x1D712>               " 𝜒          : MATHEMATICAL ITALIC SMALL CHI
++\\itd                       <char-0x1D451>               " 𝑑          : MATHEMATICAL ITALIC SMALL D
++\\itd<Tab>                  <char-0x1D451>               " 𝑑          : MATHEMATICAL ITALIC SMALL D
++\\itde                      \\itde                       "            : (Incomplete sequence)
++\\itdelta                   <char-0x1D6FF>               " 𝛿          : MATHEMATICAL ITALIC SMALL DELTA
++\\ite                       <char-0x1D452>               " 𝑒          : MATHEMATICAL ITALIC SMALL E
++\\ite<Tab>                  <char-0x1D452>               " 𝑒          : MATHEMATICAL ITALIC SMALL E
++\\itep                      \\itep                       "            : (Incomplete sequence)
++\\itepsilon                 <char-0x1D716>               " 𝜖          : MATHEMATICAL ITALIC EPSILON SYMBOL
++\\itet                      \\itet                       "            : (Incomplete sequence)
++\\iteta                     <char-0x1D702>               " 𝜂          : MATHEMATICAL ITALIC SMALL ETA
++\\itf                       <char-0x1D453>               " 𝑓          : MATHEMATICAL ITALIC SMALL F
++\\itg                       <char-0x1D454>               " 𝑔          : MATHEMATICAL ITALIC SMALL G
++\\itg<Tab>                  <char-0x1D454>               " 𝑔          : MATHEMATICAL ITALIC SMALL G
++\\itga                      \\itga                       "            : (Incomplete sequence)
++\\itgamma                   <char-0x1D6FE>               " 𝛾          : MATHEMATICAL ITALIC SMALL GAMMA
++\\ith                       <char-0x0210E>               " ℎ          : PLANCK CONSTANT
++\\iti                       <char-0x1D456>               " 𝑖          : MATHEMATICAL ITALIC SMALL I
++\\iti<Tab>                  <char-0x1D456>               " 𝑖          : MATHEMATICAL ITALIC SMALL I
++\\itim                      \\itim                       "            : (Incomplete sequence)
++\\itimath                   <char-0x1D6A4>               " 𝚤          : MATHEMATICAL ITALIC SMALL DOTLESS I
++\\itio                      \\itio                       "            : (Incomplete sequence)
++\\itiota                    <char-0x1D704>               " 𝜄          : MATHEMATICAL ITALIC SMALL IOTA
++\\itj                       <char-0x1D457>               " 𝑗          : MATHEMATICAL ITALIC SMALL J
++\\itj<Tab>                  <char-0x1D457>               " 𝑗          : MATHEMATICAL ITALIC SMALL J
++\\itjm                      \\itjm                       "            : (Incomplete sequence)
++\\itjmath                   <char-0x1D6A5>               " 𝚥          : MATHEMATICAL ITALIC SMALL DOTLESS J
++\\itk                       <char-0x1D458>               " 𝑘          : MATHEMATICAL ITALIC SMALL K
++\\itk<Tab>                  <char-0x1D458>               " 𝑘          : MATHEMATICAL ITALIC SMALL K
++\\itka                      \\itka                       "            : (Incomplete sequence)
++\\itkappa                   <char-0x1D705>               " 𝜅          : MATHEMATICAL ITALIC SMALL KAPPA
++\\itl                       <char-0x1D459>               " 𝑙          : MATHEMATICAL ITALIC SMALL L
++\\itl<Tab>                  <char-0x1D459>               " 𝑙          : MATHEMATICAL ITALIC SMALL L
++\\itla                      \\itla                       "            : (Incomplete sequence)
++\\itlambda                  <char-0x1D706>               " 𝜆          : MATHEMATICAL ITALIC SMALL LAMDA
++\\itm                       <char-0x1D45A>               " 𝑚          : MATHEMATICAL ITALIC SMALL M
++\\itm<Tab>                  <char-0x1D45A>               " 𝑚          : MATHEMATICAL ITALIC SMALL M
++\\itmu                      <char-0x1D707>               " 𝜇          : MATHEMATICAL ITALIC SMALL MU
++\\itn                       <char-0x1D45B>               " 𝑛          : MATHEMATICAL ITALIC SMALL N
++\\itn<Tab>                  <char-0x1D45B>               " 𝑛          : MATHEMATICAL ITALIC SMALL N
++\\itna                      \\itna                       "            : (Incomplete sequence)
++\\itnabla                   <char-0x1D6FB>               " 𝛻          : MATHEMATICAL ITALIC NABLA
++\\itnu                      <char-0x1D708>               " 𝜈          : MATHEMATICAL ITALIC SMALL NU
++\\ito                       <char-0x1D45C>               " 𝑜          : MATHEMATICAL ITALIC SMALL O
++\\ito<Tab>                  <char-0x1D45C>               " 𝑜          : MATHEMATICAL ITALIC SMALL O
++\\itom                      \\itom                       "            : (Incomplete sequence)
++\\itomega                   <char-0x1D714>               " 𝜔          : MATHEMATICAL ITALIC SMALL OMEGA
++\\itomicron                 <char-0x1D70A>               " 𝜊          : MATHEMATICAL ITALIC SMALL OMICRON
++\\itp                       <char-0x1D45D>               " 𝑝          : MATHEMATICAL ITALIC SMALL P
++\\itp<Tab>                  <char-0x1D45D>               " 𝑝          : MATHEMATICAL ITALIC SMALL P
++\\itpa                      \\itpa                       "            : (Incomplete sequence)
++\\itpartial                 <char-0x1D715>               " 𝜕          : MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL
++\\itph                      \\itph                       "            : (Incomplete sequence)
++\\itphi                     <char-0x1D719>               " 𝜙          : MATHEMATICAL ITALIC PHI SYMBOL
++\\itpi                      <char-0x1D70B>               " 𝜋          : MATHEMATICAL ITALIC SMALL PI
++\\itps                      \\itps                       "            : (Incomplete sequence)
++\\itpsi                     <char-0x1D713>               " 𝜓          : MATHEMATICAL ITALIC SMALL PSI
++\\itq                       <char-0x1D45E>               " 𝑞          : MATHEMATICAL ITALIC SMALL Q
++\\itr                       <char-0x1D45F>               " 𝑟          : MATHEMATICAL ITALIC SMALL R
++\\itr<Tab>                  <char-0x1D45F>               " 𝑟          : MATHEMATICAL ITALIC SMALL R
++\\itrh                      \\itrh                       "            : (Incomplete sequence)
++\\itrho                     <char-0x1D70C>               " 𝜌          : MATHEMATICAL ITALIC SMALL RHO
++\\its                       <char-0x1D460>               " 𝑠          : MATHEMATICAL ITALIC SMALL S
++\\its<Tab>                  <char-0x1D460>               " 𝑠          : MATHEMATICAL ITALIC SMALL S
++\\itsi                      \\itsi                       "            : (Incomplete sequence)
++\\itsigma                   <char-0x1D70E>               " 𝜎          : MATHEMATICAL ITALIC SMALL SIGMA
++\\itt                       <char-0x1D461>               " 𝑡          : MATHEMATICAL ITALIC SMALL T
++\\itt<Tab>                  <char-0x1D461>               " 𝑡          : MATHEMATICAL ITALIC SMALL T
++\\itta                      \\itta                       "            : (Incomplete sequence)
++\\ittau                     <char-0x1D70F>               " 𝜏          : MATHEMATICAL ITALIC SMALL TAU
++\\itth                      \\itth                       "            : (Incomplete sequence)
++\\ittheta                   <char-0x1D703>               " 𝜃          : MATHEMATICAL ITALIC SMALL THETA
++\\itu                       <char-0x1D462>               " 𝑢          : MATHEMATICAL ITALIC SMALL U
++\\itu<Tab>                  <char-0x1D462>               " 𝑢          : MATHEMATICAL ITALIC SMALL U
++\\itup                      \\itup                       "            : (Incomplete sequence)
++\\itupsilon                 <char-0x1D710>               " 𝜐          : MATHEMATICAL ITALIC SMALL UPSILON
++\\itv                       <char-0x1D463>               " 𝑣          : MATHEMATICAL ITALIC SMALL V
++\\itv<Tab>                  <char-0x1D463>               " 𝑣          : MATHEMATICAL ITALIC SMALL V
++\\itva                      \\itva                       "            : (Incomplete sequence)
++\\itvarTheta                <char-0x1D6F3>               " 𝛳          : MATHEMATICAL ITALIC CAPITAL THETA SYMBOL
++\\itvarepsilon              <char-0x1D700>               " 𝜀          : MATHEMATICAL ITALIC SMALL EPSILON
++\\itvarkappa                <char-0x1D718>               " 𝜘          : MATHEMATICAL ITALIC KAPPA SYMBOL
++\\itvarphi                  <char-0x1D711>               " 𝜑          : MATHEMATICAL ITALIC SMALL PHI
++\\itvarpi                   <char-0x1D71B>               " 𝜛          : MATHEMATICAL ITALIC PI SYMBOL
++\\itvarrho                  <char-0x1D71A>               " 𝜚          : MATHEMATICAL ITALIC RHO SYMBOL
++\\itvarsigma                <char-0x1D70D>               " 𝜍          : MATHEMATICAL ITALIC SMALL FINAL SIGMA
++\\itvartheta                <char-0x1D717>               " 𝜗          : MATHEMATICAL ITALIC THETA SYMBOL
++\\itw                       <char-0x1D464>               " 𝑤          : MATHEMATICAL ITALIC SMALL W
++\\itx                       <char-0x1D465>               " 𝑥          : MATHEMATICAL ITALIC SMALL X
++\\itx<Tab>                  <char-0x1D465>               " 𝑥          : MATHEMATICAL ITALIC SMALL X
++\\itxi                      <char-0x1D709>               " 𝜉          : MATHEMATICAL ITALIC SMALL XI
++\\ity                       <char-0x1D466>               " 𝑦          : MATHEMATICAL ITALIC SMALL Y
++\\itz                       <char-0x1D467>               " 𝑧          : MATHEMATICAL ITALIC SMALL Z
++\\itz<Tab>                  <char-0x1D467>               " 𝑧          : MATHEMATICAL ITALIC SMALL Z
++\\itze                      \\itze                       "            : (Incomplete sequence)
++\\itzeta                    <char-0x1D701>               " 𝜁          : MATHEMATICAL ITALIC SMALL ZETA
++\\jmath                     <char-0x00237>               " ȷ          : LATIN SMALL LETTER DOTLESS J
++\\join                      <char-0x02A1D>               " ⨝          : JOIN
++\\jupiter                   <char-0x02643>               " ♃          : JUPITER
++\\k                         <char-0x00328>               " ◌̨         : COMBINING OGONEK / NON-SPACING OGONEK
++\\k<Tab>                    <char-0x00328>               " ◌̨         : COMBINING OGONEK / NON-SPACING OGONEK
++\\ka                        \\ka                         "            : (Incomplete sequence)
++\\kappa                     <char-0x003BA>               " κ          : GREEK SMALL LETTER KAPPA
++\\ke                        \\ke                         "            : (Incomplete sequence)
++\\kernelcontraction         <char-0x0223B>               " ∻          : HOMOTHETIC
++\\l                         <char-0x00142>               " ł          : LATIN SMALL LETTER L WITH STROKE / LATIN SMALL LETTER L SLASH
++\\l<Tab>                    <char-0x00142>               " ł          : LATIN SMALL LETTER L WITH STROKE / LATIN SMALL LETTER L SLASH
++\\la                        \\la                         "            : (Incomplete sequence)
++\\lambda                    <char-0x003BB>               " λ          : GREEK SMALL LETTER LAMDA / GREEK SMALL LETTER LAMBDA
++\\langle                    <char-0x027E8>               " ⟨          : MATHEMATICAL LEFT ANGLE BRACKET
++\\lat                       <char-0x02AAB>               " ⪫          : LARGER THAN
++\\lat<Tab>                  <char-0x02AAB>               " ⪫          : LARGER THAN
++\\late                      <char-0x02AAD>               " ⪭          : LARGER THAN OR EQUAL TO
++\\lazysinv                  <char-0x0223E>               " ∾          : INVERTED LAZY S
++\\lc                        \\lc                         "            : (Incomplete sequence)
++\\lceil                     <char-0x02308>               " ⌈          : LEFT CEILING
++\\ld                        \\ld                         "            : (Incomplete sequence)
++\\ldots                     <char-0x02026>               " …          : HORIZONTAL ELLIPSIS
++\\ldq                       <char-0x0201C>               " “          : LEFT DOUBLE QUOTATION MARK / DOUBLE TURNED COMMA QUOTATION MARK
++\\le                        <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
++\\le<Tab>                   <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
++\\lef                       \\lef                        "            : (Incomplete sequence)
++\\leftarrow                 <char-0x02190>               " ←          : LEFTWARDS ARROW / LEFT ARROW
++\\leftarrow<Tab>            <char-0x02190>               " ←          : LEFTWARDS ARROW / LEFT ARROW
++\\leftarrowa                \\leftarrowa                 "            : (Incomplete sequence)
++\\leftarrowapprox           <char-0x02B4A>               " ⭊          : LEFTWARDS ARROW ABOVE ALMOST EQUAL TO
++\\leftarrowb                \\leftarrowb                 "            : (Incomplete sequence)
++\\leftarrowbackapprox       <char-0x02B42>               " ⭂          : LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
++\\leftarrowbsimilar         <char-0x02B4B>               " ⭋          : LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
++\\leftarrowo                \\leftarrowo                 "            : (Incomplete sequence)
++\\leftarrowonoplus          <char-0x02B32>               " ⬲          : LEFT ARROW WITH CIRCLED PLUS
++\\leftarrowp                \\leftarrowp                 "            : (Incomplete sequence)
++\\leftarrowplus             <char-0x02946>               " ⥆          : LEFTWARDS ARROW WITH PLUS BELOW
++\\leftarrowt                \\leftarrowt                 "            : (Incomplete sequence)
++\\leftarrowtail             <char-0x021A2>               " ↢          : LEFTWARDS ARROW WITH TAIL / LEFT ARROW WITH TAIL
++\\leftarrowtriangle         <char-0x021FD>               " ⇽          : LEFTWARDS OPEN-HEADED ARROW
++\\leftarrowx                <char-0x02B3E>               " ⬾          : LEFTWARDS ARROW THROUGH X
++\\leftbkarrow               <char-0x0290C>               " ⤌          : LEFTWARDS DOUBLE DASH ARROW
++\\leftcurvedarrow           <char-0x02B3F>               " ⬿          : WAVE ARROW POINTING DIRECTLY LEFT
++\\leftdasharrow             <char-0x021E0>               " ⇠          : LEFTWARDS DASHED ARROW / LEFT DASHED ARROW
++\\leftdbkarrow              <char-0x0290E>               " ⤎          : LEFTWARDS TRIPLE DASH ARROW
++\\leftdotarrow              <char-0x02B38>               " ⬸          : LEFTWARDS ARROW WITH DOTTED STEM
++\\leftharpoonaccent         <char-0x020D0>               " ◌⃐         : COMBINING LEFT HARPOON ABOVE / NON-SPACING LEFT HARPOON ABOVE
++\\leftharpoondown           <char-0x021BD>               " ↽          : LEFTWARDS HARPOON WITH BARB DOWNWARDS / LEFT HARPOON WITH BARB DOWN
++\\leftharpoonsupdown        <char-0x02962>               " ⥢          : LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN
++\\leftharpoonup             <char-0x021BC>               " ↼          : LEFTWARDS HARPOON WITH BARB UPWARDS / LEFT HARPOON WITH BARB UP
++\\leftharpoonup<Tab>        <char-0x021BC>               " ↼          : LEFTWARDS HARPOON WITH BARB UPWARDS / LEFT HARPOON WITH BARB UP
++\\leftharpoonupd            \\leftharpoonupd             "            : (Incomplete sequence)
++\\leftharpoonupdash         <char-0x0296A>               " ⥪          : LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
++\\leftleftarrows            <char-0x021C7>               " ⇇          : LEFTWARDS PAIRED ARROWS / LEFT PAIRED ARROWS
++\\leftmoon                  <char-0x0263E>               " ☾          : LAST QUARTER MOON
++\\leftouterjoin             <char-0x027D5>               " ⟕          : LEFT OUTER JOIN
++\\leftrightarrow            <char-0x02194>               " ↔          : LEFT RIGHT ARROW
++\\leftrightarrow<Tab>       <char-0x02194>               " ↔          : LEFT RIGHT ARROW
++\\leftrightarrowc           \\leftrightarrowc            "            : (Incomplete sequence)
++\\leftrightarrowcircle      <char-0x02948>               " ⥈          : LEFT RIGHT ARROW THROUGH SMALL CIRCLE
++\\leftrightarrows           <char-0x021C6>               " ⇆          : LEFTWARDS ARROW OVER RIGHTWARDS ARROW / LEFT ARROW OVER RIGHT ARROW
++\\leftrightarrowt           \\leftrightarrowt            "            : (Incomplete sequence)
++\\leftrightarrowtriangle    <char-0x021FF>               " ⇿          : LEFT RIGHT OPEN-HEADED ARROW
++\\leftrightharpoondownup    <char-0x0294B>               " ⥋          : LEFT BARB DOWN RIGHT BARB UP HARPOON
++\\leftrightharpoons         <char-0x021CB>               " ⇋          : LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON / LEFT HARPOON OVER RIGHT HARPOON
++\\leftrightharpoons<Tab>    <char-0x021CB>               " ⇋          : LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON / LEFT HARPOON OVER RIGHT HARPOON
++\\leftrightharpoonsd        \\leftrightharpoonsd         "            : (Incomplete sequence)
++\\leftrightharpoonsdown     <char-0x02967>               " ⥧          : LEFTWARDS HARPOON WITH BARB DOWN ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
++\\leftrightharpoonsu        \\leftrightharpoonsu         "            : (Incomplete sequence)
++\\leftrightharpoonsup       <char-0x02966>               " ⥦          : LEFTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB UP
++\\leftrightharpoonupdown    <char-0x0294A>               " ⥊          : LEFT BARB UP RIGHT BARB DOWN HARPOON
++\\leftrightsquigarrow       <char-0x021AD>               " ↭          : LEFT RIGHT WAVE ARROW
++\\leftsquigarrow            <char-0x021DC>               " ⇜          : LEFTWARDS SQUIGGLE ARROW / LEFT SQUIGGLE ARROW
++\\leftthreearrows           <char-0x02B31>               " ⬱          : THREE LEFTWARDS ARROWS
++\\leftthreetimes            <char-0x022CB>               " ⋋          : LEFT SEMIDIRECT PRODUCT
++\\leftwavearrow             <char-0x0219C>               " ↜          : LEFTWARDS WAVE ARROW / LEFT WAVE ARROW
++\\leftwhitearrow            <char-0x021E6>               " ⇦          : LEFTWARDS WHITE ARROW / WHITE LEFT ARROW
++\\leo                       <char-0x0264C>               " ♌          : LEO
++\\leq                       <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
++\\leq<Tab>                  <char-0x02264>               " ≤          : LESS-THAN OR EQUAL TO / LESS THAN OR EQUAL TO
++\\leqq                      <char-0x02266>               " ≦          : LESS-THAN OVER EQUAL TO / LESS THAN OVER EQUAL TO
++\\leqq<Tab>                 <char-0x02266>               " ≦          : LESS-THAN OVER EQUAL TO / LESS THAN OVER EQUAL TO
++\\leqqs                     \\leqqs                      "            : (Incomplete sequence)
++\\leqqslant                 <char-0x02AF9>               " ⫹          : DOUBLE-LINE SLANTED LESS-THAN OR EQUAL TO
++\\leqs                      \\leqs                       "            : (Incomplete sequence)
++\\leqslant                  <char-0x02A7D>               " ⩽          : LESS-THAN OR SLANTED EQUAL TO
++\\les                       \\les                        "            : (Incomplete sequence)
++\\lescc                     <char-0x02AA8>               " ⪨          : LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
++\\lesdot                    <char-0x02A7F>               " ⩿          : LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
++\\lesdot<Tab>               <char-0x02A7F>               " ⩿          : LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
++\\lesdoto                   <char-0x02A81>               " ⪁          : LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
++\\lesdoto<Tab>              <char-0x02A81>               " ⪁          : LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
++\\lesdotor                  <char-0x02A83>               " ⪃          : LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT
++\\lesges                    <char-0x02A93>               " ⪓          : LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL
++\\lessapprox                <char-0x02A85>               " ⪅          : LESS-THAN OR APPROXIMATE
++\\lessdot                   <char-0x022D6>               " ⋖          : LESS-THAN WITH DOT / LESS THAN WITH DOT
++\\lesseqgtr                 <char-0x022DA>               " ⋚          : LESS-THAN EQUAL TO OR GREATER-THAN / LESS THAN EQUAL TO OR GREATER THAN
++\\lesseqqgtr                <char-0x02A8B>               " ⪋          : LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
++\\lessgtr                   <char-0x02276>               " ≶          : LESS-THAN OR GREATER-THAN / LESS THAN OR GREATER THAN
++\\lesssim                   <char-0x02272>               " ≲          : LESS-THAN OR EQUIVALENT TO / LESS THAN OR EQUIVALENT TO
++\\lf                        \\lf                         "            : (Incomplete sequence)
++\\lfloor                    <char-0x0230A>               " ⌊          : LEFT FLOOR
++\\lg                        \\lg                         "            : (Incomplete sequence)
++\\lgE                       <char-0x02A91>               " ⪑          : LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL
++\\lgblkcircle               <char-0x02B24>               " ⬤          : BLACK LARGE CIRCLE
++\\lgblksquare               <char-0x02B1B>               " ⬛          : BLACK LARGE SQUARE
++\\lgwhtcircle               <char-0x025EF>               " ◯          : LARGE CIRCLE
++\\lgwhtsquare               <char-0x02B1C>               " ⬜          : WHITE LARGE SQUARE
++\\li                        \\li                         "            : (Incomplete sequence)
++\\libra                     <char-0x0264E>               " ♎          : LIBRA
++\\linefeed                  <char-0x021B4>               " ↴          : RIGHTWARDS ARROW WITH CORNER DOWNWARDS / RIGHT ARROW WITH CORNER DOWN
++\\ll                        <char-0x0226A>               " ≪          : MUCH LESS-THAN / MUCH LESS THAN
++\\ll<Tab>                   <char-0x0226A>               " ≪          : MUCH LESS-THAN / MUCH LESS THAN
++\\lla                       \\lla                        "            : (Incomplete sequence)
++\\llarc                     <char-0x025DF>               " ◟          : LOWER LEFT QUADRANT CIRCULAR ARC
++\\llb                       \\llb                        "            : (Incomplete sequence)
++\\llblacktriangle           <char-0x025E3>               " ◣          : BLACK LOWER LEFT TRIANGLE
++\\llbracket                 <char-0x027E6>               " ⟦          : MATHEMATICAL LEFT WHITE SQUARE BRACKET
++\\llc                       \\llc                        "            : (Incomplete sequence)
++\\llcorner                  <char-0x0231E>               " ⌞          : BOTTOM LEFT CORNER
++\\lll                       \\lll                        "            : (Incomplete sequence)
++\\lllnest                   <char-0x02AF7>               " ⫷          : TRIPLE NESTED LESS-THAN
++\\llt                       \\llt                        "            : (Incomplete sequence)
++\\lltriangle                <char-0x025FA>               " ◺          : LOWER LEFT TRIANGLE
++\\lm                        \\lm                         "            : (Incomplete sequence)
++\\lmoustache                <char-0x023B0>               " ⎰          : UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION
++\\lmrk                      <char-0x002D0>               " ː          : MODIFIER LETTER TRIANGULAR COLON
++\\ln                        \\ln                         "            : (Incomplete sequence)
++\\lnapprox                  <char-0x02A89>               " ⪉          : LESS-THAN AND NOT APPROXIMATE
++\\lneq                      <char-0x02A87>               " ⪇          : LESS-THAN AND SINGLE-LINE NOT EQUAL TO
++\\lneq<Tab>                 <char-0x02A87>               " ⪇          : LESS-THAN AND SINGLE-LINE NOT EQUAL TO
++\\lneqq                     <char-0x02268>               " ≨          : LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO
++\\lnsim                     <char-0x022E6>               " ⋦          : LESS-THAN BUT NOT EQUIVALENT TO / LESS THAN BUT NOT EQUIVALENT TO
++\\lo                        \\lo                         "            : (Incomplete sequence)
++\\longleftarrow             <char-0x027F5>               " ⟵          : LONG LEFTWARDS ARROW
++\\longleftrightarrow        <char-0x027F7>               " ⟷          : LONG LEFT RIGHT ARROW
++\\longleftsquigarrow        <char-0x02B33>               " ⬳          : LONG LEFTWARDS SQUIGGLE ARROW
++\\longmapsfrom              <char-0x027FB>               " ⟻          : LONG LEFTWARDS ARROW FROM BAR
++\\longmapsto                <char-0x027FC>               " ⟼          : LONG RIGHTWARDS ARROW FROM BAR
++\\longrightarrow            <char-0x027F6>               " ⟶          : LONG RIGHTWARDS ARROW
++\\longrightsquigarrow       <char-0x027FF>               " ⟿          : LONG RIGHTWARDS SQUIGGLE ARROW
++\\looparrowleft             <char-0x021AB>               " ↫          : LEFTWARDS ARROW WITH LOOP / LEFT ARROW WITH LOOP
++\\looparrowright            <char-0x021AC>               " ↬          : RIGHTWARDS ARROW WITH LOOP / RIGHT ARROW WITH LOOP
++\\low                       <char-0x002D5>               " ˕          : MODIFIER LETTER DOWN TACK
++\\low<Tab>                  <char-0x002D5>               " ˕          : MODIFIER LETTER DOWN TACK
++\\lowi                      \\lowi                       "            : (Incomplete sequence)
++\\lowint                    <char-0x02A1C>               " ⨜          : INTEGRAL WITH UNDERBAR
++\\lozenge                   <char-0x025CA>               " ◊          : LOZENGE
++\\lp                        \\lp                         "            : (Incomplete sequence)
++\\lpargt                    <char-0x029A0>               " ⦠          : SPHERICAL ANGLE OPENING LEFT
++\\lq                        <char-0x02018>               " ‘          : LEFT SINGLE QUOTATION MARK / SINGLE TURNED COMMA QUOTATION MARK
++\\lr                        \\lr                         "            : (Incomplete sequence)
++\\lrarc                     <char-0x025DE>               " ◞          : LOWER RIGHT QUADRANT CIRCULAR ARC
++\\lrblacktriangle           <char-0x025E2>               " ◢          : BLACK LOWER RIGHT TRIANGLE
++\\lrcorner                  <char-0x0231F>               " ⌟          : BOTTOM RIGHT CORNER
++\\lrtriangle                <char-0x025FF>               " ◿          : LOWER RIGHT TRIANGLE
++\\lrtriangle<Tab>           <char-0x025FF>               " ◿          : LOWER RIGHT TRIANGLE
++\\lrtrianglee               \\lrtrianglee                "            : (Incomplete sequence)
++\\lrtriangleeq              <char-0x029E1>               " ⧡          : INCREASES AS
++\\ls                        \\ls                         "            : (Incomplete sequence)
++\\lsime                     <char-0x02A8D>               " ⪍          : LESS-THAN ABOVE SIMILAR OR EQUAL
++\\lsimg                     <char-0x02A8F>               " ⪏          : LESS-THAN ABOVE SIMILAR ABOVE GREATER-THAN
++\\lsqhook                   <char-0x02ACD>               " ⫍          : SQUARE LEFT OPEN BOX OPERATOR
++\\lt                        \\lt                         "            : (Incomplete sequence)
++\\ltcc                      <char-0x02AA6>               " ⪦          : LESS-THAN CLOSED BY CURVE
++\\ltcir                     <char-0x02A79>               " ⩹          : LESS-THAN WITH CIRCLE INSIDE
++\\ltimes                    <char-0x022C9>               " ⋉          : LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
++\\ltlmr                     <char-0x00271>               " ɱ          : LATIN SMALL LETTER M WITH HOOK / LATIN SMALL LETTER M HOOK
++\\ltln                      <char-0x00272>               " ɲ          : LATIN SMALL LETTER N WITH LEFT HOOK / LATIN SMALL LETTER N HOOK
++\\ltphi                     <char-0x00278>               " ɸ          : LATIN SMALL LETTER PHI
++\\ltquest                   <char-0x02A7B>               " ⩻          : LESS-THAN WITH QUESTION MARK ABOVE
++\\lv                        \\lv                         "            : (Incomplete sequence)
++\\lvboxline                 <char-0x023B8>               " ⎸          : LEFT VERTICAL BOX LINE
++\\lvertneqq                 <char-0x02268><char-0x0FE00> " ≨︀         : LESS-THAN BUT NOT EQUAL TO / LESS THAN BUT NOT EQUAL TO + VARIATION SELECTOR-1
++\\male                      <char-0x02642>               " ♂          : MALE SIGN
++\\maltese                   <char-0x02720>               " ✠          : MALTESE CROSS
++\\mapsdown                  <char-0x021A7>               " ↧          : DOWNWARDS ARROW FROM BAR / DOWN ARROW FROM BAR
++\\mapsfrom                  <char-0x021A4>               " ↤          : LEFTWARDS ARROW FROM BAR / LEFT ARROW FROM BAR
++\\mapsto                    <char-0x021A6>               " ↦          : RIGHTWARDS ARROW FROM BAR / RIGHT ARROW FROM BAR
++\\mapsup                    <char-0x021A5>               " ↥          : UPWARDS ARROW FROM BAR / UP ARROW FROM BAR
++\\mars                      <char-0x02642>               " ♂          : MALE SIGN
++\\mdblkcircle               <char-0x026AB>               " ⚫          : MEDIUM BLACK CIRCLE
++\\mdblkdiamond              <char-0x02B25>               " ⬥          : BLACK MEDIUM DIAMOND
++\\mdblklozenge              <char-0x02B27>               " ⬧          : BLACK MEDIUM LOZENGE
++\\mdblksquare               <char-0x025FC>               " ◼          : BLACK MEDIUM SQUARE
++\\mdlgblkcircle             <char-0x025CF>               " ●          : BLACK CIRCLE
++\\mdlgblkdiamond            <char-0x025C6>               " ◆          : BLACK DIAMOND
++\\mdlgwhtdiamond            <char-0x025C7>               " ◇          : WHITE DIAMOND
++\\mdsmblksquare             <char-0x025FE>               " ◾          : BLACK MEDIUM SMALL SQUARE
++\\mdsmwhtcircle             <char-0x026AC>               " ⚬          : MEDIUM SMALL WHITE CIRCLE
++\\mdsmwhtsquare             <char-0x025FD>               " ◽          : WHITE MEDIUM SMALL SQUARE
++\\mdwhtcircle               <char-0x026AA>               " ⚪          : MEDIUM WHITE CIRCLE
++\\mdwhtdiamond              <char-0x02B26>               " ⬦          : WHITE MEDIUM DIAMOND
++\\mdwhtlozenge              <char-0x02B28>               " ⬨          : WHITE MEDIUM LOZENGE
++\\mdwhtsquare               <char-0x025FB>               " ◻          : WHITE MEDIUM SQUARE
++\\measangledltosw           <char-0x029AF>               " ⦯          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND DOWN
++\\measangledrtose           <char-0x029AE>               " ⦮          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND DOWN
++\\measangleldtosw           <char-0x029AB>               " ⦫          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND LEFT
++\\measanglelutonw           <char-0x029A9>               " ⦩          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND LEFT
++\\measanglerdtose           <char-0x029AA>               " ⦪          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING DOWN AND RIGHT
++\\measanglerutone           <char-0x029A8>               " ⦨          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING UP AND RIGHT
++\\measangleultonw           <char-0x029AD>               " ⦭          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING LEFT AND UP
++\\measangleurtone           <char-0x029AC>               " ⦬          : MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW POINTING RIGHT AND UP
++\\measeq                    <char-0x0225E>               " ≞          : MEASURED BY
++\\measuredangle             <char-0x02221>               " ∡          : MEASURED ANGLE
++\\measuredangle<Tab>        <char-0x02221>               " ∡          : MEASURED ANGLE
++\\measuredanglel            \\measuredanglel             "            : (Incomplete sequence)
++\\measuredangleleft         <char-0x0299B>               " ⦛          : MEASURED ANGLE OPENING LEFT
++\\medblackstar              <char-0x02B51>               " ⭑          : BLACK SMALL STAR
++\\medwhitestar              <char-0x02B50>               " ⭐          : WHITE MEDIUM STAR
++\\mercury                   <char-0x0263F>               " ☿          : MERCURY
++\\mho                       <char-0x02127>               " ℧          : INVERTED OHM SIGN / MHO
++\\mid                       <char-0x02223>               " ∣          : DIVIDES
++\\mid<Tab>                  <char-0x02223>               " ∣          : DIVIDES
++\\midb                      \\midb                       "            : (Incomplete sequence)
++\\midbarvee                 <char-0x02A5D>               " ⩝          : LOGICAL OR WITH HORIZONTAL DASH
++\\midbarwedge               <char-0x02A5C>               " ⩜          : LOGICAL AND WITH HORIZONTAL DASH
++\\minhat                    <char-0x02A5F>               " ⩟          : LOGICAL AND WITH UNDERBAR
++\\minus                     <char-0x02212>               " −          : MINUS SIGN
++\\minus<Tab>                <char-0x02212>               " −          : MINUS SIGN
++\\minusd                    \\minusd                     "            : (Incomplete sequence)
++\\minusdot                  <char-0x02A2A>               " ⨪          : MINUS SIGN WITH DOT BELOW
++\\minusf                    \\minusf                     "            : (Incomplete sequence)
++\\minusfdots                <char-0x02A2B>               " ⨫          : MINUS SIGN WITH FALLING DOTS
++\\minusr                    \\minusr                     "            : (Incomplete sequence)
++\\minusrdots                <char-0x02A2C>               " ⨬          : MINUS SIGN WITH RISING DOTS
++\\mlcp                      <char-0x02ADB>               " ⫛          : TRANSVERSAL INTERSECTION
++\\models                    <char-0x022A7>               " ⊧          : MODELS
++\\modtwosum                 <char-0x02A0A>               " ⨊          : MODULO TWO SUM
++\\mp                        <char-0x02213>               " ∓          : MINUS-OR-PLUS SIGN
++\\mu                        <char-0x003BC>               " μ          : GREEK SMALL LETTER MU
++\\mu<Tab>                   <char-0x003BC>               " μ          : GREEK SMALL LETTER MU
++\\mul                       \\mul                        "            : (Incomplete sequence)
++\\multimap                  <char-0x022B8>               " ⊸          : MULTIMAP
++\\nBumpeq                   <char-0x0224E><char-0x00338> " ≎̸         : GEOMETRICALLY EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nHdownarrow               <char-0x021DF>               " ⇟          : DOWNWARDS ARROW WITH DOUBLE STROKE / DOWN ARROW WITH DOUBLE STROKE
++\\nHuparrow                 <char-0x021DE>               " ⇞          : UPWARDS ARROW WITH DOUBLE STROKE / UP ARROW WITH DOUBLE STROKE
++\\nLeftarrow                <char-0x021CD>               " ⇍          : LEFTWARDS DOUBLE ARROW WITH STROKE / LEFT DOUBLE ARROW WITH STROKE
++\\nLeftrightarrow           <char-0x021CE>               " ⇎          : LEFT RIGHT DOUBLE ARROW WITH STROKE
++\\nRightarrow               <char-0x021CF>               " ⇏          : RIGHTWARDS DOUBLE ARROW WITH STROKE / RIGHT DOUBLE ARROW WITH STROKE
++\\nVDash                    <char-0x022AF>               " ⊯          : NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
++\\nVdash                    <char-0x022AE>               " ⊮          : DOES NOT FORCE
++\\nVleftarrow               <char-0x021FA>               " ⇺          : LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
++\\nVleftarrow<Tab>          <char-0x021FA>               " ⇺          : LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
++\\nVleftarrowt              \\nVleftarrowt               "            : (Incomplete sequence)
++\\nVleftarrowtail           <char-0x02B3A>               " ⬺          : LEFTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++\\nVleftrightarrow          <char-0x021FC>               " ⇼          : LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE
++\\nVrightarrow              <char-0x021FB>               " ⇻          : RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
++\\nVrightarrow<Tab>         <char-0x021FB>               " ⇻          : RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
++\\nVrightarrowt             \\nVrightarrowt              "            : (Incomplete sequence)
++\\nVrightarrowtail          <char-0x02915>               " ⤕          : RIGHTWARDS ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++\\nVtwoheadleftarrow        <char-0x02B35>               " ⬵          : LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
++\\nVtwoheadleftarrow<Tab>   <char-0x02B35>               " ⬵          : LEFTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
++\\nVtwoheadleftarrowt       \\nVtwoheadleftarrowt        "            : (Incomplete sequence)
++\\nVtwoheadleftarrowtail    <char-0x02B3D>               " ⬽          : LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++\\nVtwoheadrightarrow       <char-0x02901>               " ⤁          : RIGHTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
++\\nVtwoheadrightarrow<Tab>  <char-0x02901>               " ⤁          : RIGHTWARDS TWO-HEADED ARROW WITH DOUBLE VERTICAL STROKE
++\\nVtwoheadrightarrowt      \\nVtwoheadrightarrowt       "            : (Incomplete sequence)
++\\nVtwoheadrightarrowtail   <char-0x02918>               " ⤘          : RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH DOUBLE VERTICAL STROKE
++\\nabla                     <char-0x02207>               " ∇          : NABLA
++\\napprox                   <char-0x02249>               " ≉          : NOT ALMOST EQUAL TO
++\\nasymp                    <char-0x0226D>               " ≭          : NOT EQUIVALENT TO
++\\natural                   <char-0x0266E>               " ♮          : MUSIC NATURAL SIGN / NATURAL
++\\nbumpeq                   <char-0x0224F><char-0x00338> " ≏̸         : DIFFERENCE BETWEEN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\ncong                     <char-0x02247>               " ≇          : NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
++\\ne                        <char-0x02260>               " ≠          : NOT EQUAL TO
++\\ne<Tab>                   <char-0x02260>               " ≠          : NOT EQUAL TO
++\\nea                       \\nea                        "            : (Incomplete sequence)
++\\nearrow                   <char-0x02197>               " ↗          : NORTH EAST ARROW / UPPER RIGHT ARROW
++\\neg                       <char-0x000AC>               " ¬          : NOT SIGN
++\\neo                       \\neo                        "            : (Incomplete sequence)
++\\neovnwarrow               <char-0x02931>               " ⤱          : NORTH EAST ARROW CROSSING NORTH WEST ARROW
++\\neovsearrow               <char-0x0292E>               " ⤮          : NORTH EAST ARROW CROSSING SOUTH EAST ARROW
++\\nep                       \\nep                        "            : (Incomplete sequence)
++\\neptune                   <char-0x02646>               " ♆          : NEPTUNE
++\\neq                       \\neq                        "            : (Incomplete sequence)
++\\neqsim                    <char-0x02242><char-0x00338> " ≂̸         : MINUS TILDE + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nequiv                    <char-0x02262>               " ≢          : NOT IDENTICAL TO
++\\neu                       \\neu                        "            : (Incomplete sequence)
++\\neuter                    <char-0x026B2>               " ⚲          : NEUTER
++\\nex                       \\nex                        "            : (Incomplete sequence)
++\\nexists                   <char-0x02204>               " ∄          : THERE DOES NOT EXIST
++\\ng                        <char-0x0014B>               " ŋ          : LATIN SMALL LETTER ENG
++\\ng<Tab>                   <char-0x0014B>               " ŋ          : LATIN SMALL LETTER ENG
++\\nge                       \\nge                        "            : (Incomplete sequence)
++\\ngeq                      <char-0x02271>               " ≱          : NEITHER GREATER-THAN NOR EQUAL TO / NEITHER GREATER THAN NOR EQUAL TO
++\\ngeq<Tab>                 <char-0x02271>               " ≱          : NEITHER GREATER-THAN NOR EQUAL TO / NEITHER GREATER THAN NOR EQUAL TO
++\\ngeqs                     \\ngeqs                      "            : (Incomplete sequence)
++\\ngeqslant                 <char-0x02A7E><char-0x00338> " ⩾̸         : GREATER-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\ngt                       \\ngt                        "            : (Incomplete sequence)
++\\ngtr                      <char-0x0226F>               " ≯          : NOT GREATER-THAN / NOT GREATER THAN
++\\ngtr<Tab>                 <char-0x0226F>               " ≯          : NOT GREATER-THAN / NOT GREATER THAN
++\\ngtrs                     \\ngtrs                      "            : (Incomplete sequence)
++\\ngtrsim                   <char-0x02275>               " ≵          : NEITHER GREATER-THAN NOR EQUIVALENT TO / NEITHER GREATER THAN NOR EQUIVALENT TO
++\\ni                        <char-0x0220B>               " ∋          : CONTAINS AS MEMBER
++\\ni<Tab>                   <char-0x0220B>               " ∋          : CONTAINS AS MEMBER
++\\nio                       \\nio                        "            : (Incomplete sequence)
++\\niobar                    <char-0x022FE>               " ⋾          : SMALL CONTAINS WITH OVERBAR
++\\nis                       <char-0x022FC>               " ⋼          : SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++\\nis<Tab>                  <char-0x022FC>               " ⋼          : SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++\\nisd                      <char-0x022FA>               " ⋺          : CONTAINS WITH LONG HORIZONTAL STROKE
++\\nleftarrow                <char-0x0219A>               " ↚          : LEFTWARDS ARROW WITH STROKE / LEFT ARROW WITH STROKE
++\\nleftrightarrow           <char-0x021AE>               " ↮          : LEFT RIGHT ARROW WITH STROKE
++\\nleq                      <char-0x02270>               " ≰          : NEITHER LESS-THAN NOR EQUAL TO / NEITHER LESS THAN NOR EQUAL TO
++\\nleq<Tab>                 <char-0x02270>               " ≰          : NEITHER LESS-THAN NOR EQUAL TO / NEITHER LESS THAN NOR EQUAL TO
++\\nleqs                     \\nleqs                      "            : (Incomplete sequence)
++\\nleqslant                 <char-0x02A7D><char-0x00338> " ⩽̸         : LESS-THAN OR SLANTED EQUAL TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nless                     <char-0x0226E>               " ≮          : NOT LESS-THAN / NOT LESS THAN
++\\nless<Tab>                <char-0x0226E>               " ≮          : NOT LESS-THAN / NOT LESS THAN
++\\nlesss                    \\nlesss                     "            : (Incomplete sequence)
++\\nlesssim                  <char-0x02274>               " ≴          : NEITHER LESS-THAN NOR EQUIVALENT TO / NEITHER LESS THAN NOR EQUIVALENT TO
++\\nmid                      <char-0x02224>               " ∤          : DOES NOT DIVIDE
++\\nni                       <char-0x0220C>               " ∌          : DOES NOT CONTAIN AS MEMBER
++\\nolinebreak               <char-0x02060>               " ⁠          : WORD JOINER
++\\not                       <char-0x00338>               " ◌̸         : COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\not<Tab>                  <char-0x00338>               " ◌̸         : COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\notb                      \\notb                       "            : (Incomplete sequence)
++\\notbackslash              <char-0x02340>               " ⍀          : APL FUNCTIONAL SYMBOL BACKSLASH BAR
++\\notg                      \\notg                       "            : (Incomplete sequence)
++\\notgreaterless            <char-0x02279>               " ≹          : NEITHER GREATER-THAN NOR LESS-THAN / NEITHER GREATER THAN NOR LESS THAN
++\\noti                      \\noti                       "            : (Incomplete sequence)
++\\notin                     <char-0x02209>               " ∉          : NOT AN ELEMENT OF
++\\notl                      \\notl                       "            : (Incomplete sequence)
++\\notlessgreater            <char-0x02278>               " ≸          : NEITHER LESS-THAN NOR GREATER-THAN / NEITHER LESS THAN NOR GREATER THAN
++\\nots                      \\nots                       "            : (Incomplete sequence)
++\\notslash                  <char-0x0233F>               " ⌿          : APL FUNCTIONAL SYMBOL SLASH BAR
++\\nparallel                 <char-0x02226>               " ∦          : NOT PARALLEL TO
++\\npolint                   <char-0x02A14>               " ⨔          : LINE INTEGRATION NOT INCLUDING THE POLE
++\\nprec                     <char-0x02280>               " ⊀          : DOES NOT PRECEDE
++\\nprec<Tab>                <char-0x02280>               " ⊀          : DOES NOT PRECEDE
++\\nprecc                    \\nprecc                     "            : (Incomplete sequence)
++\\npreccurlyeq              <char-0x022E0>               " ⋠          : DOES NOT PRECEDE OR EQUAL
++\\nprece                    \\nprece                     "            : (Incomplete sequence)
++\\npreceq                   <char-0x02AAF><char-0x00338> " ⪯̸         : PRECEDES ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nprecs                    \\nprecs                     "            : (Incomplete sequence)
++\\nprecsim                  <char-0x0227E><char-0x00338> " ≾̸         : PRECEDES OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nrightarrow               <char-0x0219B>               " ↛          : RIGHTWARDS ARROW WITH STROKE / RIGHT ARROW WITH STROKE
++\\nrleg                     <char-0x0019E>               " ƞ          : LATIN SMALL LETTER N WITH LONG RIGHT LEG
++\\nsim                      <char-0x02241>               " ≁          : NOT TILDE
++\\nsim<Tab>                 <char-0x02241>               " ≁          : NOT TILDE
++\\nsime                     <char-0x02244>               " ≄          : NOT ASYMPTOTICALLY EQUAL TO
++\\nsqsubseteq               <char-0x022E2>               " ⋢          : NOT SQUARE IMAGE OF OR EQUAL TO
++\\nsqsupseteq               <char-0x022E3>               " ⋣          : NOT SQUARE ORIGINAL OF OR EQUAL TO
++\\nsubset                   <char-0x02284>               " ⊄          : NOT A SUBSET OF
++\\nsubset<Tab>              <char-0x02284>               " ⊄          : NOT A SUBSET OF
++\\nsubsete                  \\nsubsete                   "            : (Incomplete sequence)
++\\nsubseteq                 <char-0x02288>               " ⊈          : NEITHER A SUBSET OF NOR EQUAL TO
++\\nsubseteq<Tab>            <char-0x02288>               " ⊈          : NEITHER A SUBSET OF NOR EQUAL TO
++\\nsubseteqq                <char-0x02AC5><char-0x00338> " ⫅̸         : SUBSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nsucc                     <char-0x02281>               " ⊁          : DOES NOT SUCCEED
++\\nsucc<Tab>                <char-0x02281>               " ⊁          : DOES NOT SUCCEED
++\\nsuccc                    \\nsuccc                     "            : (Incomplete sequence)
++\\nsucccurlyeq              <char-0x022E1>               " ⋡          : DOES NOT SUCCEED OR EQUAL
++\\nsucce                    \\nsucce                     "            : (Incomplete sequence)
++\\nsucceq                   <char-0x02AB0><char-0x00338> " ⪰̸         : SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nsuccs                    \\nsuccs                     "            : (Incomplete sequence)
++\\nsuccsim                  <char-0x0227F><char-0x00338> " ≿̸         : SUCCEEDS OR EQUIVALENT TO + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\nsupset                   <char-0x02285>               " ⊅          : NOT A SUPERSET OF
++\\nsupset<Tab>              <char-0x02285>               " ⊅          : NOT A SUPERSET OF
++\\nsupsete                  \\nsupsete                   "            : (Incomplete sequence)
++\\nsupseteq                 <char-0x02289>               " ⊉          : NEITHER A SUPERSET OF NOR EQUAL TO
++\\nsupseteq<Tab>            <char-0x02289>               " ⊉          : NEITHER A SUPERSET OF NOR EQUAL TO
++\\nsupseteqq                <char-0x02AC6><char-0x00338> " ⫆̸         : SUPERSET OF ABOVE EQUALS SIGN + COMBINING LONG SOLIDUS OVERLAY / NON-SPACING LONG SLASH OVERLAY
++\\ntriangleleft             <char-0x022EA>               " ⋪          : NOT NORMAL SUBGROUP OF
++\\ntriangleleft<Tab>        <char-0x022EA>               " ⋪          : NOT NORMAL SUBGROUP OF
++\\ntrianglelefte            \\ntrianglelefte             "            : (Incomplete sequence)
++\\ntrianglelefteq           <char-0x022EC>               " ⋬          : NOT NORMAL SUBGROUP OF OR EQUAL TO
++\\ntriangleright            <char-0x022EB>               " ⋫          : DOES NOT CONTAIN AS NORMAL SUBGROUP
++\\ntriangleright<Tab>       <char-0x022EB>               " ⋫          : DOES NOT CONTAIN AS NORMAL SUBGROUP
++\\ntrianglerighte           \\ntrianglerighte            "            : (Incomplete sequence)
++\\ntrianglerighteq          <char-0x022ED>               " ⋭          : DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
++\\nu                        <char-0x003BD>               " ν          : GREEK SMALL LETTER NU
++\\nu<Tab>                   <char-0x003BD>               " ν          : GREEK SMALL LETTER NU
++\\num                       \\num                        "            : (Incomplete sequence)
++\\numero                    <char-0x02116>               " №          : NUMERO SIGN / NUMERO
++\\nvDash                    <char-0x022AD>               " ⊭          : NOT TRUE
++\\nvLeftarrow               <char-0x02902>               " ⤂          : LEFTWARDS DOUBLE ARROW WITH VERTICAL STROKE
++\\nvLeftrightarrow          <char-0x02904>               " ⤄          : LEFT RIGHT DOUBLE ARROW WITH VERTICAL STROKE
++\\nvRightarrow              <char-0x02903>               " ⤃          : RIGHTWARDS DOUBLE ARROW WITH VERTICAL STROKE
++\\nvdash                    <char-0x022AC>               " ⊬          : DOES NOT PROVE
++\\nvleftarrow               <char-0x021F7>               " ⇷          : LEFTWARDS ARROW WITH VERTICAL STROKE
++\\nvleftarrow<Tab>          <char-0x021F7>               " ⇷          : LEFTWARDS ARROW WITH VERTICAL STROKE
++\\nvleftarrowt              \\nvleftarrowt               "            : (Incomplete sequence)
++\\nvleftarrowtail           <char-0x02B39>               " ⬹          : LEFTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
++\\nvleftrightarrow          <char-0x021F9>               " ⇹          : LEFT RIGHT ARROW WITH VERTICAL STROKE
++\\nvrightarrow              <char-0x021F8>               " ⇸          : RIGHTWARDS ARROW WITH VERTICAL STROKE
++\\nvrightarrow<Tab>         <char-0x021F8>               " ⇸          : RIGHTWARDS ARROW WITH VERTICAL STROKE
++\\nvrightarrowt             \\nvrightarrowt              "            : (Incomplete sequence)
++\\nvrightarrowtail          <char-0x02914>               " ⤔          : RIGHTWARDS ARROW WITH TAIL WITH VERTICAL STROKE
++\\nvtwoheadleftarrow        <char-0x02B34>               " ⬴          : LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
++\\nvtwoheadleftarrow<Tab>   <char-0x02B34>               " ⬴          : LEFTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
++\\nvtwoheadleftarrowt       \\nvtwoheadleftarrowt        "            : (Incomplete sequence)
++\\nvtwoheadleftarrowtail    <char-0x02B3C>               " ⬼          : LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
++\\nvtwoheadrightarrow       <char-0x02900>               " ⤀          : RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
++\\nvtwoheadrightarrow<Tab>  <char-0x02900>               " ⤀          : RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE
++\\nvtwoheadrightarrowt      \\nvtwoheadrightarrowt       "            : (Incomplete sequence)
++\\nvtwoheadrightarrowtail   <char-0x02917>               " ⤗          : RIGHTWARDS TWO-HEADED ARROW WITH TAIL WITH VERTICAL STROKE
++\\nwarrow                   <char-0x02196>               " ↖          : NORTH WEST ARROW / UPPER LEFT ARROW
++\\nwovnearrow               <char-0x02932>               " ⤲          : NORTH WEST ARROW CROSSING NORTH EAST ARROW
++\\o                         <char-0x000F8>               " ø          : LATIN SMALL LETTER O WITH STROKE / LATIN SMALL LETTER O SLASH
++\\o<Tab>                    <char-0x000F8>               " ø          : LATIN SMALL LETTER O WITH STROKE / LATIN SMALL LETTER O SLASH
++\\ob                        \\ob                         "            : (Incomplete sequence)
++\\obar                      <char-0x0233D>               " ⌽          : APL FUNCTIONAL SYMBOL CIRCLE STILE
++\\obslash                   <char-0x029B8>               " ⦸          : CIRCLED REVERSE SOLIDUS
++\\oc                        \\oc                         "            : (Incomplete sequence)
++\\ocirc                     <char-0x0030A>               " ◌̊         : COMBINING RING ABOVE / NON-SPACING RING ABOVE
++\\ocommatopright            <char-0x00315>               " ◌̕         : COMBINING COMMA ABOVE RIGHT / NON-SPACING COMMA ABOVE RIGHT
++\\od                        \\od                         "            : (Incomplete sequence)
++\\odiv                      <char-0x02A38>               " ⨸          : CIRCLED DIVISION SIGN
++\\odot                      <char-0x02299>               " ⊙          : CIRCLED DOT OPERATOR
++\\odot<Tab>                 <char-0x02299>               " ⊙          : CIRCLED DOT OPERATOR
++\\odots                     \\odots                      "            : (Incomplete sequence)
++\\odotslashdot              <char-0x029BC>               " ⦼          : CIRCLED ANTICLOCKWISE-ROTATED DIVISION SIGN
++\\oe                        <char-0x00153>               " œ          : LATIN SMALL LIGATURE OE / LATIN SMALL LETTER O E
++\\og                        \\og                         "            : (Incomplete sequence)
++\\ogreaterthan              <char-0x029C1>               " ⧁          : CIRCLED GREATER-THAN
++\\oh                        \\oh                         "            : (Incomplete sequence)
++\\ohm                       <char-0x02126>               " Ω          : OHM SIGN / OHM
++\\oi                        \\oi                         "            : (Incomplete sequence)
++\\oiiint                    <char-0x02230>               " ∰          : VOLUME INTEGRAL
++\\oiint                     <char-0x0222F>               " ∯          : SURFACE INTEGRAL
++\\oint                      <char-0x0222E>               " ∮          : CONTOUR INTEGRAL
++\\oint<Tab>                 <char-0x0222E>               " ∮          : CONTOUR INTEGRAL
++\\ointc                     \\ointc                      "            : (Incomplete sequence)
++\\ointctrclockwise          <char-0x02233>               " ∳          : ANTICLOCKWISE CONTOUR INTEGRAL
++\\ol                        \\ol                         "            : (Incomplete sequence)
++\\olessthan                 <char-0x029C0>               " ⧀          : CIRCLED LESS-THAN
++\\om                        \\om                         "            : (Incomplete sequence)
++\\omega                     <char-0x003C9>               " ω          : GREEK SMALL LETTER OMEGA
++\\ominus                    <char-0x02296>               " ⊖          : CIRCLED MINUS
++\\op                        \\op                         "            : (Incomplete sequence)
++\\openbracketleft           <char-0x027E6>               " ⟦          : MATHEMATICAL LEFT WHITE SQUARE BRACKET
++\\openbracketright          <char-0x027E7>               " ⟧          : MATHEMATICAL RIGHT WHITE SQUARE BRACKET
++\\openo                     <char-0x00254>               " ɔ          : LATIN SMALL LETTER OPEN O
++\\oplus                     <char-0x02295>               " ⊕          : CIRCLED PLUS
++\\oplus<Tab>                <char-0x02295>               " ⊕          : CIRCLED PLUS
++\\oplusl                    \\oplusl                     "            : (Incomplete sequence)
++\\opluslhrim                <char-0x02A2D>               " ⨭          : PLUS SIGN IN LEFT HALF CIRCLE
++\\oplusr                    \\oplusr                     "            : (Incomplete sequence)
++\\oplusrhrim                <char-0x02A2E>               " ⨮          : PLUS SIGN IN RIGHT HALF CIRCLE
++\\or                        \\or                         "            : (Incomplete sequence)
++\\ordfeminine               <char-0x000AA>               " ª          : FEMININE ORDINAL INDICATOR
++\\ordmasculine              <char-0x000BA>               " º          : MASCULINE ORDINAL INDICATOR
++\\original                  <char-0x022B6>               " ⊶          : ORIGINAL OF
++\\os                        \\os                         "            : (Incomplete sequence)
++\\oslash                    <char-0x02298>               " ⊘          : CIRCLED DIVISION SLASH
++\\ot                        \\ot                         "            : (Incomplete sequence)
++\\otimes                    <char-0x02297>               " ⊗          : CIRCLED TIMES
++\\otimes<Tab>               <char-0x02297>               " ⊗          : CIRCLED TIMES
++\\otimesh                   \\otimesh                    "            : (Incomplete sequence)
++\\otimeshat                 <char-0x02A36>               " ⨶          : CIRCLED MULTIPLICATION SIGN WITH CIRCUMFLEX ACCENT
++\\otimesl                   \\otimesl                    "            : (Incomplete sequence)
++\\otimeslhrim               <char-0x02A34>               " ⨴          : MULTIPLICATION SIGN IN LEFT HALF CIRCLE
++\\otimesr                   \\otimesr                    "            : (Incomplete sequence)
++\\otimesrhrim               <char-0x02A35>               " ⨵          : MULTIPLICATION SIGN IN RIGHT HALF CIRCLE
++\\oturnedcomma              <char-0x00312>               " ◌̒         : COMBINING TURNED COMMA ABOVE / NON-SPACING TURNED COMMA ABOVE
++\\ov                        \\ov                         "            : (Incomplete sequence)
++\\overbar                   <char-0x00305>               " ◌̅         : COMBINING OVERLINE / NON-SPACING OVERSCORE
++\\overbrace                 <char-0x023DE>               " ⏞          : TOP CURLY BRACKET
++\\overbracket               <char-0x023B4>               " ⎴          : TOP SQUARE BRACKET
++\\overleftarrow             <char-0x020D6>               " ◌⃖         : COMBINING LEFT ARROW ABOVE / NON-SPACING LEFT ARROW ABOVE
++\\overleftrightarrow        <char-0x020E1>               " ◌⃡         : COMBINING LEFT RIGHT ARROW ABOVE / NON-SPACING LEFT RIGHT ARROW ABOVE
++\\ovhook                    <char-0x00309>               " ◌̉         : COMBINING HOOK ABOVE / NON-SPACING HOOK ABOVE
++\\palh                      <char-0x00321>               " ◌̡         : COMBINING PALATALIZED HOOK BELOW / NON-SPACING PALATALIZED HOOK BELOW
++\\parallel                  <char-0x02225>               " ∥          : PARALLEL TO
++\\parallel<Tab>             <char-0x02225>               " ∥          : PARALLEL TO
++\\parallelo                 \\parallelo                  "            : (Incomplete sequence)
++\\parallelogram             <char-0x025B1>               " ▱          : WHITE PARALLELOGRAM
++\\parallelogram<Tab>        <char-0x025B1>               " ▱          : WHITE PARALLELOGRAM
++\\parallelogramb            \\parallelogramb             "            : (Incomplete sequence)
++\\parallelogramblack        <char-0x025B0>               " ▰          : BLACK PARALLELOGRAM
++\\partial                   <char-0x02202>               " ∂          : PARTIAL DIFFERENTIAL
++\\partial<Tab>              <char-0x02202>               " ∂          : PARTIAL DIFFERENTIAL
++\\partialm                  \\partialm                   "            : (Incomplete sequence)
++\\partialmeetcontraction    <char-0x02AA3>               " ⪣          : DOUBLE NESTED LESS-THAN WITH UNDERBAR
++\\pbgam                     <char-0x00264>               " ɤ          : LATIN SMALL LETTER RAMS HORN / LATIN SMALL LETTER BABY GAMMA
++\\pentagon                  <char-0x02B20>               " ⬠          : WHITE PENTAGON
++\\pentagon<Tab>             <char-0x02B20>               " ⬠          : WHITE PENTAGON
++\\pentagonb                 \\pentagonb                  "            : (Incomplete sequence)
++\\pentagonblack             <char-0x02B1F>               " ⬟          : BLACK PENTAGON
++\\perp                      <char-0x027C2>               " ⟂          : PERPENDICULAR
++\\perspcorrespond           <char-0x02A5E>               " ⩞          : LOGICAL AND WITH DOUBLE OVERBAR
++\\pertenthousand            <char-0x02031>               " ‱          : PER TEN THOUSAND SIGN
++\\perthousand               <char-0x02030>               " ‰          : PER MILLE SIGN
++\\pes                       <char-0x020A7>               " ₧          : PESETA SIGN
++\\pgamma                    <char-0x00263>               " ɣ          : LATIN SMALL LETTER GAMMA
++\\phi                       <char-0x003D5>               " ϕ          : GREEK PHI SYMBOL / GREEK SMALL LETTER SCRIPT PHI
++\\pi                        <char-0x003C0>               " π          : GREEK SMALL LETTER PI
++\\pi<Tab>                   <char-0x003C0>               " π          : GREEK SMALL LETTER PI
++\\pis                       \\pis                        "            : (Incomplete sequence)
++\\pisces                    <char-0x02653>               " ♓          : PISCES
++\\pit                       \\pit                        "            : (Incomplete sequence)
++\\pitchfork                 <char-0x022D4>               " ⋔          : PITCHFORK
++\\planck                    <char-0x0210E>               " ℎ          : PLANCK CONSTANT
++\\plusdot                   <char-0x02A25>               " ⨥          : PLUS SIGN WITH DOT BELOW
++\\pluseqq                   <char-0x02A72>               " ⩲          : PLUS SIGN ABOVE EQUALS SIGN
++\\plushat                   <char-0x02A23>               " ⨣          : PLUS SIGN WITH CIRCUMFLEX ACCENT ABOVE
++\\plussim                   <char-0x02A26>               " ⨦          : PLUS SIGN WITH TILDE BELOW
++\\plussubtwo                <char-0x02A27>               " ⨧          : PLUS SIGN WITH SUBSCRIPT TWO
++\\plustrif                  <char-0x02A28>               " ⨨          : PLUS SIGN WITH BLACK TRIANGLE
++\\pluto                     <char-0x02647>               " ♇          : PLUTO
++\\pm                        <char-0x000B1>               " ±          : PLUS-MINUS SIGN / PLUS-OR-MINUS SIGN
++\\pointint                  <char-0x02A15>               " ⨕          : INTEGRAL AROUND A POINT OPERATOR
++\\postalmark                <char-0x03012>               " 〒          : POSTAL MARK
++\\pppprime                  <char-0x02057>               " ⁗          : QUADRUPLE PRIME
++\\ppprime                   <char-0x02034>               " ‴          : TRIPLE PRIME
++\\pprime                    <char-0x02033>               " ″          : DOUBLE PRIME
++\\prec                      <char-0x0227A>               " ≺          : PRECEDES
++\\prec<Tab>                 <char-0x0227A>               " ≺          : PRECEDES
++\\preca                     \\preca                      "            : (Incomplete sequence)
++\\precapprox                <char-0x02AB7>               " ⪷          : PRECEDES ABOVE ALMOST EQUAL TO
++\\precc                     \\precc                      "            : (Incomplete sequence)
++\\preccurlyeq               <char-0x0227C>               " ≼          : PRECEDES OR EQUAL TO
++\\prece                     \\prece                      "            : (Incomplete sequence)
++\\preceq                    <char-0x02AAF>               " ⪯          : PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
++\\preceq<Tab>               <char-0x02AAF>               " ⪯          : PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
++\\preceqq                   <char-0x02AB3>               " ⪳          : PRECEDES ABOVE EQUALS SIGN
++\\precn                     \\precn                      "            : (Incomplete sequence)
++\\precnapprox               <char-0x02AB9>               " ⪹          : PRECEDES ABOVE NOT ALMOST EQUAL TO
++\\precneq                   <char-0x02AB1>               " ⪱          : PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO
++\\precneq<Tab>              <char-0x02AB1>               " ⪱          : PRECEDES ABOVE SINGLE-LINE NOT EQUAL TO
++\\precneqq                  <char-0x02AB5>               " ⪵          : PRECEDES ABOVE NOT EQUAL TO
++\\precnsim                  <char-0x022E8>               " ⋨          : PRECEDES BUT NOT EQUIVALENT TO
++\\precs                     \\precs                      "            : (Incomplete sequence)
++\\precsim                   <char-0x0227E>               " ≾          : PRECEDES OR EQUIVALENT TO
++\\prime                     <char-0x02032>               " ′          : PRIME
++\\prod                      <char-0x0220F>               " ∏          : N-ARY PRODUCT
++\\profline                  <char-0x02312>               " ⌒          : ARC
++\\profsurf                  <char-0x02313>               " ⌓          : SEGMENT
++\\propto                    <char-0x0221D>               " ∝          : PROPORTIONAL TO
++\\prurel                    <char-0x022B0>               " ⊰          : PRECEDES UNDER RELATION
++\\pscrv                     <char-0x0028B>               " ʋ          : LATIN SMALL LETTER V WITH HOOK / LATIN SMALL LETTER SCRIPT V
++\\psi                       <char-0x003C8>               " ψ          : GREEK SMALL LETTER PSI
++\\pupsil                    <char-0x0028A>               " ʊ          : LATIN SMALL LETTER UPSILON
++\\quad                      <char-0x02003>               "            : EM SPACE
++\\quarternote               <char-0x02669>               " ♩          : QUARTER NOTE
++\\questeq                   <char-0x0225F>               " ≟          : QUESTIONED EQUAL TO
++\\questiondown              <char-0x000BF>               " ¿          : INVERTED QUESTION MARK
++\\rLarr                     <char-0x02944>               " ⥄          : SHORT RIGHTWARDS ARROW ABOVE LEFTWARDS ARROW
++\\rais                      <char-0x002D4>               " ˔          : MODIFIER LETTER UP TACK
++\\rangle                    <char-0x027E9>               " ⟩          : MATHEMATICAL RIGHT ANGLE BRACKET
++\\rarrx                     <char-0x02947>               " ⥇          : RIGHTWARDS ARROW THROUGH X
++\\rasp                      <char-0x002BC>               " ʼ          : MODIFIER LETTER APOSTROPHE
++\\rceil                     <char-0x02309>               " ⌉          : RIGHT CEILING
++\\rdiagovfdiag              <char-0x0292B>               " ⤫          : RISING DIAGONAL CROSSING FALLING DIAGONAL
++\\rdiagovsearrow            <char-0x02930>               " ⤰          : RISING DIAGONAL CROSSING SOUTH EAST ARROW
++\\rdq                       <char-0x0201D>               " ”          : RIGHT DOUBLE QUOTATION MARK / DOUBLE COMMA QUOTATION MARK
++\\reapos                    <char-0x0201B>               " ‛          : SINGLE HIGH-REVERSED-9 QUOTATION MARK / SINGLE REVERSED COMMA QUOTATION MARK
++\\recorder                  <char-0x02315>               " ⌕          : TELEPHONE RECORDER
++\\reglst                    <char-0x00295>               " ʕ          : LATIN LETTER PHARYNGEAL VOICED FRICATIVE / LATIN LETTER REVERSED GLOTTAL STOP
++\\revangle                  <char-0x029A3>               " ⦣          : REVERSED ANGLE
++\\revangle<Tab>             <char-0x029A3>               " ⦣          : REVERSED ANGLE
++\\revangleu                 \\revangleu                  "            : (Incomplete sequence)
++\\revangleubar              <char-0x029A5>               " ⦥          : REVERSED ANGLE WITH UNDERBAR
++\\revemptyset               <char-0x029B0>               " ⦰          : REVERSED EMPTY SET
++\\rfloor                    <char-0x0230B>               " ⌋          : RIGHT FLOOR
++\\rh                        <char-0x00322>               " ◌̢         : COMBINING RETROFLEX HOOK BELOW / NON-SPACING RETROFLEX HOOK BELOW
++\\rh<Tab>                   <char-0x00322>               " ◌̢         : COMBINING RETROFLEX HOOK BELOW / NON-SPACING RETROFLEX HOOK BELOW
++\\rho                       <char-0x003C1>               " ρ          : GREEK SMALL LETTER RHO
++\\rightangle                <char-0x0221F>               " ∟          : RIGHT ANGLE
++\\rightangle<Tab>           <char-0x0221F>               " ∟          : RIGHT ANGLE
++\\rightanglea               \\rightanglea                "            : (Incomplete sequence)
++\\rightanglearc             <char-0x022BE>               " ⊾          : RIGHT ANGLE WITH ARC
++\\rightanglem               \\rightanglem                "            : (Incomplete sequence)
++\\rightanglemdot            <char-0x0299D>               " ⦝          : MEASURED RIGHT ANGLE WITH DOT
++\\rightarrow                <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
++\\rightarrow<Tab>           <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
++\\rightarrowb               \\rightarrowb                "            : (Incomplete sequence)
++\\rightarrowbackapprox      <char-0x02B48>               " ⭈          : RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO
++\\rightarrowbar             <char-0x021E5>               " ⇥          : RIGHTWARDS ARROW TO BAR / RIGHT ARROW TO BAR
++\\rightarrowbsimilar        <char-0x02B4C>               " ⭌          : RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
++\\rightarrowd               \\rightarrowd                "            : (Incomplete sequence)
++\\rightarrowdiamond         <char-0x0291E>               " ⤞          : RIGHTWARDS ARROW TO BLACK DIAMOND
++\\rightarrowg               \\rightarrowg                "            : (Incomplete sequence)
++\\rightarrowgtr             <char-0x02B43>               " ⭃          : RIGHTWARDS ARROW THROUGH GREATER-THAN
++\\rightarrowp               \\rightarrowp                "            : (Incomplete sequence)
++\\rightarrowplus            <char-0x02945>               " ⥅          : RIGHTWARDS ARROW WITH PLUS BELOW
++\\rightarrows               \\rightarrows                "            : (Incomplete sequence)
++\\rightarrowsupset          <char-0x02B44>               " ⭄          : RIGHTWARDS ARROW THROUGH SUPERSET
++\\rightarrowt               \\rightarrowt                "            : (Incomplete sequence)
++\\rightarrowtail            <char-0x021A3>               " ↣          : RIGHTWARDS ARROW WITH TAIL / RIGHT ARROW WITH TAIL
++\\rightarrowtriangle        <char-0x021FE>               " ⇾          : RIGHTWARDS OPEN-HEADED ARROW
++\\rightdasharrow            <char-0x021E2>               " ⇢          : RIGHTWARDS DASHED ARROW / RIGHT DASHED ARROW
++\\rightdotarrow             <char-0x02911>               " ⤑          : RIGHTWARDS ARROW WITH DOTTED STEM
++\\rightharpoonaccent        <char-0x020D1>               " ◌⃑         : COMBINING RIGHT HARPOON ABOVE / NON-SPACING RIGHT HARPOON ABOVE
++\\rightharpoondown          <char-0x021C1>               " ⇁          : RIGHTWARDS HARPOON WITH BARB DOWNWARDS / RIGHT HARPOON WITH BARB DOWN
++\\rightharpoonsupdown       <char-0x02964>               " ⥤          : RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN
++\\rightharpoonup            <char-0x021C0>               " ⇀          : RIGHTWARDS HARPOON WITH BARB UPWARDS / RIGHT HARPOON WITH BARB UP
++\\rightharpoonup<Tab>       <char-0x021C0>               " ⇀          : RIGHTWARDS HARPOON WITH BARB UPWARDS / RIGHT HARPOON WITH BARB UP
++\\rightharpoonupd           \\rightharpoonupd            "            : (Incomplete sequence)
++\\rightharpoonupdash        <char-0x0296C>               " ⥬          : RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH
++\\rightleftarrows           <char-0x021C4>               " ⇄          : RIGHTWARDS ARROW OVER LEFTWARDS ARROW / RIGHT ARROW OVER LEFT ARROW
++\\rightleftharpoons         <char-0x021CC>               " ⇌          : RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON / RIGHT HARPOON OVER LEFT HARPOON
++\\rightleftharpoons<Tab>    <char-0x021CC>               " ⇌          : RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON / RIGHT HARPOON OVER LEFT HARPOON
++\\rightleftharpoonsd        \\rightleftharpoonsd         "            : (Incomplete sequence)
++\\rightleftharpoonsdown     <char-0x02969>               " ⥩          : RIGHTWARDS HARPOON WITH BARB DOWN ABOVE LEFTWARDS HARPOON WITH BARB DOWN
++\\rightleftharpoonsu        \\rightleftharpoonsu         "            : (Incomplete sequence)
++\\rightleftharpoonsup       <char-0x02968>               " ⥨          : RIGHTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB UP
++\\rightmoon                 <char-0x0263D>               " ☽          : FIRST QUARTER MOON
++\\rightouterjoin            <char-0x027D6>               " ⟖          : RIGHT OUTER JOIN
++\\rightpentagon             <char-0x02B54>               " ⭔          : WHITE RIGHT-POINTING PENTAGON
++\\rightpentagon<Tab>        <char-0x02B54>               " ⭔          : WHITE RIGHT-POINTING PENTAGON
++\\rightpentagonb            \\rightpentagonb             "            : (Incomplete sequence)
++\\rightpentagonblack        <char-0x02B53>               " ⭓          : BLACK RIGHT-POINTING PENTAGON
++\\rightrightarrows          <char-0x021C9>               " ⇉          : RIGHTWARDS PAIRED ARROWS / RIGHT PAIRED ARROWS
++\\rightsquigarrow           <char-0x021DD>               " ⇝          : RIGHTWARDS SQUIGGLE ARROW / RIGHT SQUIGGLE ARROW
++\\rightthreearrows          <char-0x021F6>               " ⇶          : THREE RIGHTWARDS ARROWS
++\\rightthreetimes           <char-0x022CC>               " ⋌          : RIGHT SEMIDIRECT PRODUCT
++\\rightwavearrow            <char-0x0219D>               " ↝          : RIGHTWARDS WAVE ARROW / RIGHT WAVE ARROW
++\\rightwhitearrow           <char-0x021E8>               " ⇨          : RIGHTWARDS WHITE ARROW / WHITE RIGHT ARROW
++\\ringplus                  <char-0x02A22>               " ⨢          : PLUS SIGN WITH SMALL CIRCLE ABOVE
++\\risingdotseq              <char-0x02253>               " ≓          : IMAGE OF OR APPROXIMATELY EQUAL TO
++\\rl                        <char-0x0027C>               " ɼ          : LATIN SMALL LETTER R WITH LONG LEG
++\\rmoustache                <char-0x023B1>               " ⎱          : UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION
++\\rppolint                  <char-0x02A12>               " ⨒          : LINE INTEGRATION WITH RECTANGULAR PATH AROUND POLE
++\\rq                        <char-0x02019>               " ’          : RIGHT SINGLE QUOTATION MARK / SINGLE COMMA QUOTATION MARK
++\\rrbracket                 <char-0x027E7>               " ⟧          : MATHEMATICAL RIGHT WHITE SQUARE BRACKET
++\\rsolbar                   <char-0x029F7>               " ⧷          : REVERSE SOLIDUS WITH HORIZONTAL STROKE
++\\rsqhook                   <char-0x02ACE>               " ⫎          : SQUARE RIGHT OPEN BOX OPERATOR
++\\rtimes                    <char-0x022CA>               " ⋊          : RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
++\\rtld                      <char-0x00256>               " ɖ          : LATIN SMALL LETTER D WITH TAIL / LATIN SMALL LETTER D RETROFLEX HOOK
++\\rtll                      <char-0x0026D>               " ɭ          : LATIN SMALL LETTER L WITH RETROFLEX HOOK / LATIN SMALL LETTER L RETROFLEX HOOK
++\\rtln                      <char-0x00273>               " ɳ          : LATIN SMALL LETTER N WITH RETROFLEX HOOK / LATIN SMALL LETTER N RETROFLEX HOOK
++\\rtlr                      <char-0x0027D>               " ɽ          : LATIN SMALL LETTER R WITH TAIL / LATIN SMALL LETTER R HOOK
++\\rtls                      <char-0x00282>               " ʂ          : LATIN SMALL LETTER S WITH HOOK / LATIN SMALL LETTER S HOOK
++\\rtlt                      <char-0x00288>               " ʈ          : LATIN SMALL LETTER T WITH RETROFLEX HOOK / LATIN SMALL LETTER T RETROFLEX HOOK
++\\rtlz                      <char-0x00290>               " ʐ          : LATIN SMALL LETTER Z WITH RETROFLEX HOOK / LATIN SMALL LETTER Z RETROFLEX HOOK
++\\rttrnr                    <char-0x0027B>               " ɻ          : LATIN SMALL LETTER TURNED R WITH HOOK / LATIN SMALL LETTER TURNED R HOOK
++\\rvboxline                 <char-0x023B9>               " ⎹          : RIGHT VERTICAL BOX LINE
++\\rvbull                    <char-0x025D8>               " ◘          : INVERSE BULLET
++\\sagittarius               <char-0x02650>               " ♐          : SAGITTARIUS
++\\sansA                     <char-0x1D5A0>               " 𝖠          : MATHEMATICAL SANS-SERIF CAPITAL A
++\\sansB                     <char-0x1D5A1>               " 𝖡          : MATHEMATICAL SANS-SERIF CAPITAL B
++\\sansC                     <char-0x1D5A2>               " 𝖢          : MATHEMATICAL SANS-SERIF CAPITAL C
++\\sansD                     <char-0x1D5A3>               " 𝖣          : MATHEMATICAL SANS-SERIF CAPITAL D
++\\sansE                     <char-0x1D5A4>               " 𝖤          : MATHEMATICAL SANS-SERIF CAPITAL E
++\\sansF                     <char-0x1D5A5>               " 𝖥          : MATHEMATICAL SANS-SERIF CAPITAL F
++\\sansG                     <char-0x1D5A6>               " 𝖦          : MATHEMATICAL SANS-SERIF CAPITAL G
++\\sansH                     <char-0x1D5A7>               " 𝖧          : MATHEMATICAL SANS-SERIF CAPITAL H
++\\sansI                     <char-0x1D5A8>               " 𝖨          : MATHEMATICAL SANS-SERIF CAPITAL I
++\\sansJ                     <char-0x1D5A9>               " 𝖩          : MATHEMATICAL SANS-SERIF CAPITAL J
++\\sansK                     <char-0x1D5AA>               " 𝖪          : MATHEMATICAL SANS-SERIF CAPITAL K
++\\sansL                     <char-0x1D5AB>               " 𝖫          : MATHEMATICAL SANS-SERIF CAPITAL L
++\\sansL<Tab>                <char-0x1D5AB>               " 𝖫          : MATHEMATICAL SANS-SERIF CAPITAL L
++\\sansLm                    \\sansLm                     "            : (Incomplete sequence)
++\\sansLmirrored             <char-0x02143>               " ⅃          : REVERSED SANS-SERIF CAPITAL L
++\\sansLt                    \\sansLt                     "            : (Incomplete sequence)
++\\sansLturned               <char-0x02142>               " ⅂          : TURNED SANS-SERIF CAPITAL L
++\\sansM                     <char-0x1D5AC>               " 𝖬          : MATHEMATICAL SANS-SERIF CAPITAL M
++\\sansN                     <char-0x1D5AD>               " 𝖭          : MATHEMATICAL SANS-SERIF CAPITAL N
++\\sansO                     <char-0x1D5AE>               " 𝖮          : MATHEMATICAL SANS-SERIF CAPITAL O
++\\sansP                     <char-0x1D5AF>               " 𝖯          : MATHEMATICAL SANS-SERIF CAPITAL P
++\\sansQ                     <char-0x1D5B0>               " 𝖰          : MATHEMATICAL SANS-SERIF CAPITAL Q
++\\sansR                     <char-0x1D5B1>               " 𝖱          : MATHEMATICAL SANS-SERIF CAPITAL R
++\\sansS                     <char-0x1D5B2>               " 𝖲          : MATHEMATICAL SANS-SERIF CAPITAL S
++\\sansT                     <char-0x1D5B3>               " 𝖳          : MATHEMATICAL SANS-SERIF CAPITAL T
++\\sansU                     <char-0x1D5B4>               " 𝖴          : MATHEMATICAL SANS-SERIF CAPITAL U
++\\sansV                     <char-0x1D5B5>               " 𝖵          : MATHEMATICAL SANS-SERIF CAPITAL V
++\\sansW                     <char-0x1D5B6>               " 𝖶          : MATHEMATICAL SANS-SERIF CAPITAL W
++\\sansX                     <char-0x1D5B7>               " 𝖷          : MATHEMATICAL SANS-SERIF CAPITAL X
++\\sansY                     <char-0x1D5B8>               " 𝖸          : MATHEMATICAL SANS-SERIF CAPITAL Y
++\\sansZ                     <char-0x1D5B9>               " 𝖹          : MATHEMATICAL SANS-SERIF CAPITAL Z
++\\sansa                     <char-0x1D5BA>               " 𝖺          : MATHEMATICAL SANS-SERIF SMALL A
++\\sansb                     <char-0x1D5BB>               " 𝖻          : MATHEMATICAL SANS-SERIF SMALL B
++\\sansc                     <char-0x1D5BC>               " 𝖼          : MATHEMATICAL SANS-SERIF SMALL C
++\\sansd                     <char-0x1D5BD>               " 𝖽          : MATHEMATICAL SANS-SERIF SMALL D
++\\sanse                     <char-0x1D5BE>               " 𝖾          : MATHEMATICAL SANS-SERIF SMALL E
++\\sanse<Tab>                <char-0x1D5BE>               " 𝖾          : MATHEMATICAL SANS-SERIF SMALL E
++\\sansei                    \\sansei                     "            : (Incomplete sequence)
++\\sanseight                 <char-0x1D7EA>               " 𝟪          : MATHEMATICAL SANS-SERIF DIGIT EIGHT
++\\sansf                     <char-0x1D5BF>               " 𝖿          : MATHEMATICAL SANS-SERIF SMALL F
++\\sansf<Tab>                <char-0x1D5BF>               " 𝖿          : MATHEMATICAL SANS-SERIF SMALL F
++\\sansfi                    \\sansfi                     "            : (Incomplete sequence)
++\\sansfive                  <char-0x1D7E7>               " 𝟧          : MATHEMATICAL SANS-SERIF DIGIT FIVE
++\\sansfo                    \\sansfo                     "            : (Incomplete sequence)
++\\sansfour                  <char-0x1D7E6>               " 𝟦          : MATHEMATICAL SANS-SERIF DIGIT FOUR
++\\sansg                     <char-0x1D5C0>               " 𝗀          : MATHEMATICAL SANS-SERIF SMALL G
++\\sansh                     <char-0x1D5C1>               " 𝗁          : MATHEMATICAL SANS-SERIF SMALL H
++\\sansi                     <char-0x1D5C2>               " 𝗂          : MATHEMATICAL SANS-SERIF SMALL I
++\\sansj                     <char-0x1D5C3>               " 𝗃          : MATHEMATICAL SANS-SERIF SMALL J
++\\sansk                     <char-0x1D5C4>               " 𝗄          : MATHEMATICAL SANS-SERIF SMALL K
++\\sansl                     <char-0x1D5C5>               " 𝗅          : MATHEMATICAL SANS-SERIF SMALL L
++\\sansm                     <char-0x1D5C6>               " 𝗆          : MATHEMATICAL SANS-SERIF SMALL M
++\\sansn                     <char-0x1D5C7>               " 𝗇          : MATHEMATICAL SANS-SERIF SMALL N
++\\sansn<Tab>                <char-0x1D5C7>               " 𝗇          : MATHEMATICAL SANS-SERIF SMALL N
++\\sansni                    \\sansni                     "            : (Incomplete sequence)
++\\sansnine                  <char-0x1D7EB>               " 𝟫          : MATHEMATICAL SANS-SERIF DIGIT NINE
++\\sanso                     <char-0x1D5C8>               " 𝗈          : MATHEMATICAL SANS-SERIF SMALL O
++\\sanso<Tab>                <char-0x1D5C8>               " 𝗈          : MATHEMATICAL SANS-SERIF SMALL O
++\\sanson                    \\sanson                     "            : (Incomplete sequence)
++\\sansone                   <char-0x1D7E3>               " 𝟣          : MATHEMATICAL SANS-SERIF DIGIT ONE
++\\sansp                     <char-0x1D5C9>               " 𝗉          : MATHEMATICAL SANS-SERIF SMALL P
++\\sansq                     <char-0x1D5CA>               " 𝗊          : MATHEMATICAL SANS-SERIF SMALL Q
++\\sansr                     <char-0x1D5CB>               " 𝗋          : MATHEMATICAL SANS-SERIF SMALL R
++\\sanss                     <char-0x1D5CC>               " 𝗌          : MATHEMATICAL SANS-SERIF SMALL S
++\\sanss<Tab>                <char-0x1D5CC>               " 𝗌          : MATHEMATICAL SANS-SERIF SMALL S
++\\sansse                    \\sansse                     "            : (Incomplete sequence)
++\\sansseven                 <char-0x1D7E9>               " 𝟩          : MATHEMATICAL SANS-SERIF DIGIT SEVEN
++\\sanssi                    \\sanssi                     "            : (Incomplete sequence)
++\\sanssix                   <char-0x1D7E8>               " 𝟨          : MATHEMATICAL SANS-SERIF DIGIT SIX
++\\sanst                     <char-0x1D5CD>               " 𝗍          : MATHEMATICAL SANS-SERIF SMALL T
++\\sanst<Tab>                <char-0x1D5CD>               " 𝗍          : MATHEMATICAL SANS-SERIF SMALL T
++\\sansth                    \\sansth                     "            : (Incomplete sequence)
++\\sansthree                 <char-0x1D7E5>               " 𝟥          : MATHEMATICAL SANS-SERIF DIGIT THREE
++\\sanstw                    \\sanstw                     "            : (Incomplete sequence)
++\\sanstwo                   <char-0x1D7E4>               " 𝟤          : MATHEMATICAL SANS-SERIF DIGIT TWO
++\\sansu                     <char-0x1D5CE>               " 𝗎          : MATHEMATICAL SANS-SERIF SMALL U
++\\sansv                     <char-0x1D5CF>               " 𝗏          : MATHEMATICAL SANS-SERIF SMALL V
++\\sansw                     <char-0x1D5D0>               " 𝗐          : MATHEMATICAL SANS-SERIF SMALL W
++\\sansx                     <char-0x1D5D1>               " 𝗑          : MATHEMATICAL SANS-SERIF SMALL X
++\\sansy                     <char-0x1D5D2>               " 𝗒          : MATHEMATICAL SANS-SERIF SMALL Y
++\\sansz                     <char-0x1D5D3>               " 𝗓          : MATHEMATICAL SANS-SERIF SMALL Z
++\\sansz<Tab>                <char-0x1D5D3>               " 𝗓          : MATHEMATICAL SANS-SERIF SMALL Z
++\\sansze                    \\sansze                     "            : (Incomplete sequence)
++\\sanszero                  <char-0x1D7E2>               " 𝟢          : MATHEMATICAL SANS-SERIF DIGIT ZERO
++\\saturn                    <char-0x02644>               " ♄          : SATURN
++\\sbbrg                     <char-0x0032A>               " ◌̪         : COMBINING BRIDGE BELOW / NON-SPACING BRIDGE BELOW
++\\sblhr                     <char-0x002D3>               " ˓          : MODIFIER LETTER CENTRED LEFT HALF RING / MODIFIER LETTER CENTERED LEFT HALF RING
++\\sbrhr                     <char-0x002D2>               " ˒          : MODIFIER LETTER CENTRED RIGHT HALF RING / MODIFIER LETTER CENTERED RIGHT HALF RING
++\\schwa                     <char-0x00259>               " ə          : LATIN SMALL LETTER SCHWA
++\\scorpio                   <char-0x0264F>               " ♏          : SCORPIUS
++\\scpolint                  <char-0x02A13>               " ⨓          : LINE INTEGRATION WITH SEMICIRCULAR PATH AROUND POLE
++\\scrA                      <char-0x1D49C>               " 𝒜          : MATHEMATICAL SCRIPT CAPITAL A
++\\scrB                      <char-0x0212C>               " ℬ          : SCRIPT CAPITAL B / SCRIPT B
++\\scrC                      <char-0x1D49E>               " 𝒞          : MATHEMATICAL SCRIPT CAPITAL C
++\\scrD                      <char-0x1D49F>               " 𝒟          : MATHEMATICAL SCRIPT CAPITAL D
++\\scrE                      <char-0x02130>               " ℰ          : SCRIPT CAPITAL E / SCRIPT E
++\\scrF                      <char-0x02131>               " ℱ          : SCRIPT CAPITAL F / SCRIPT F
++\\scrG                      <char-0x1D4A2>               " 𝒢          : MATHEMATICAL SCRIPT CAPITAL G
++\\scrH                      <char-0x0210B>               " ℋ          : SCRIPT CAPITAL H / SCRIPT H
++\\scrI                      <char-0x02110>               " ℐ          : SCRIPT CAPITAL I / SCRIPT I
++\\scrJ                      <char-0x1D4A5>               " 𝒥          : MATHEMATICAL SCRIPT CAPITAL J
++\\scrK                      <char-0x1D4A6>               " 𝒦          : MATHEMATICAL SCRIPT CAPITAL K
++\\scrL                      <char-0x02112>               " ℒ          : SCRIPT CAPITAL L / SCRIPT L
++\\scrM                      <char-0x02133>               " ℳ          : SCRIPT CAPITAL M / SCRIPT M
++\\scrN                      <char-0x1D4A9>               " 𝒩          : MATHEMATICAL SCRIPT CAPITAL N
++\\scrO                      <char-0x1D4AA>               " 𝒪          : MATHEMATICAL SCRIPT CAPITAL O
++\\scrP                      <char-0x1D4AB>               " 𝒫          : MATHEMATICAL SCRIPT CAPITAL P
++\\scrQ                      <char-0x1D4AC>               " 𝒬          : MATHEMATICAL SCRIPT CAPITAL Q
++\\scrR                      <char-0x0211B>               " ℛ          : SCRIPT CAPITAL R / SCRIPT R
++\\scrS                      <char-0x1D4AE>               " 𝒮          : MATHEMATICAL SCRIPT CAPITAL S
++\\scrT                      <char-0x1D4AF>               " 𝒯          : MATHEMATICAL SCRIPT CAPITAL T
++\\scrU                      <char-0x1D4B0>               " 𝒰          : MATHEMATICAL SCRIPT CAPITAL U
++\\scrV                      <char-0x1D4B1>               " 𝒱          : MATHEMATICAL SCRIPT CAPITAL V
++\\scrW                      <char-0x1D4B2>               " 𝒲          : MATHEMATICAL SCRIPT CAPITAL W
++\\scrX                      <char-0x1D4B3>               " 𝒳          : MATHEMATICAL SCRIPT CAPITAL X
++\\scrY                      <char-0x1D4B4>               " 𝒴          : MATHEMATICAL SCRIPT CAPITAL Y
++\\scrZ                      <char-0x1D4B5>               " 𝒵          : MATHEMATICAL SCRIPT CAPITAL Z
++\\scra                      <char-0x1D4B6>               " 𝒶          : MATHEMATICAL SCRIPT SMALL A
++\\scrb                      <char-0x1D4B7>               " 𝒷          : MATHEMATICAL SCRIPT SMALL B
++\\scrc                      <char-0x1D4B8>               " 𝒸          : MATHEMATICAL SCRIPT SMALL C
++\\scrd                      <char-0x1D4B9>               " 𝒹          : MATHEMATICAL SCRIPT SMALL D
++\\scre                      <char-0x0212F>               " ℯ          : SCRIPT SMALL E
++\\scrf                      <char-0x1D4BB>               " 𝒻          : MATHEMATICAL SCRIPT SMALL F
++\\scrg                      <char-0x0210A>               " ℊ          : SCRIPT SMALL G
++\\scrh                      <char-0x1D4BD>               " 𝒽          : MATHEMATICAL SCRIPT SMALL H
++\\scri                      <char-0x1D4BE>               " 𝒾          : MATHEMATICAL SCRIPT SMALL I
++\\scrj                      <char-0x1D4BF>               " 𝒿          : MATHEMATICAL SCRIPT SMALL J
++\\scrk                      <char-0x1D4C0>               " 𝓀          : MATHEMATICAL SCRIPT SMALL K
++\\scrl                      <char-0x1D4C1>               " 𝓁          : MATHEMATICAL SCRIPT SMALL L
++\\scrm                      <char-0x1D4C2>               " 𝓂          : MATHEMATICAL SCRIPT SMALL M
++\\scrn                      <char-0x1D4C3>               " 𝓃          : MATHEMATICAL SCRIPT SMALL N
++\\scro                      <char-0x02134>               " ℴ          : SCRIPT SMALL O
++\\scrp                      <char-0x1D4C5>               " 𝓅          : MATHEMATICAL SCRIPT SMALL P
++\\scrq                      <char-0x1D4C6>               " 𝓆          : MATHEMATICAL SCRIPT SMALL Q
++\\scrr                      <char-0x1D4C7>               " 𝓇          : MATHEMATICAL SCRIPT SMALL R
++\\scrs                      <char-0x1D4C8>               " 𝓈          : MATHEMATICAL SCRIPT SMALL S
++\\scrt                      <char-0x1D4C9>               " 𝓉          : MATHEMATICAL SCRIPT SMALL T
++\\scru                      <char-0x1D4CA>               " 𝓊          : MATHEMATICAL SCRIPT SMALL U
++\\scrv                      <char-0x1D4CB>               " 𝓋          : MATHEMATICAL SCRIPT SMALL V
++\\scrw                      <char-0x1D4CC>               " 𝓌          : MATHEMATICAL SCRIPT SMALL W
++\\scrx                      <char-0x1D4CD>               " 𝓍          : MATHEMATICAL SCRIPT SMALL X
++\\scry                      <char-0x1D4CE>               " 𝓎          : MATHEMATICAL SCRIPT SMALL Y
++\\scrz                      <char-0x1D4CF>               " 𝓏          : MATHEMATICAL SCRIPT SMALL Z
++\\scurel                    <char-0x022B1>               " ⊱          : SUCCEEDS UNDER RELATION
++\\searrow                   <char-0x02198>               " ↘          : SOUTH EAST ARROW / LOWER RIGHT ARROW
++\\seovnearrow               <char-0x0292D>               " ⤭          : SOUTH EAST ARROW CROSSING NORTH EAST ARROW
++\\setminus                  <char-0x02216>               " ∖          : SET MINUS
++\\sharp                     <char-0x0266F>               " ♯          : MUSIC SHARP SIGN / SHARP
++\\shuffle                   <char-0x029E2>               " ⧢          : SHUFFLE PRODUCT
++\\sigma                     <char-0x003C3>               " σ          : GREEK SMALL LETTER SIGMA
++\\sim                       <char-0x0223C>               " ∼          : TILDE OPERATOR
++\\sim<Tab>                  <char-0x0223C>               " ∼          : TILDE OPERATOR
++\\sime                      \\sime                       "            : (Incomplete sequence)
++\\simeq                     <char-0x02243>               " ≃          : ASYMPTOTICALLY EQUAL TO
++\\simg                      \\simg                       "            : (Incomplete sequence)
++\\simgE                     <char-0x02AA0>               " ⪠          : SIMILAR ABOVE GREATER-THAN ABOVE EQUALS SIGN
++\\simgtr                    <char-0x02A9E>               " ⪞          : SIMILAR OR GREATER-THAN
++\\simi                      \\simi                       "            : (Incomplete sequence)
++\\similarleftarrow          <char-0x02B49>               " ⭉          : TILDE OPERATOR ABOVE LEFTWARDS ARROW
++\\siml                      \\siml                       "            : (Incomplete sequence)
++\\simlE                     <char-0x02A9F>               " ⪟          : SIMILAR ABOVE LESS-THAN ABOVE EQUALS SIGN
++\\simless                   <char-0x02A9D>               " ⪝          : SIMILAR OR LESS-THAN
++\\simm                      \\simm                       "            : (Incomplete sequence)
++\\simminussim               <char-0x02A6C>               " ⩬          : SIMILAR MINUS SIMILAR
++\\simp                      \\simp                       "            : (Incomplete sequence)
++\\simplus                   <char-0x02A24>               " ⨤          : PLUS SIGN WITH TILDE ABOVE
++\\simr                      \\simr                       "            : (Incomplete sequence)
++\\simrdots                  <char-0x02A6B>               " ⩫          : TILDE OPERATOR WITH RISING DOTS
++\\sinewave                  <char-0x0223F>               " ∿          : SINE WAVE
++\\smallblacktriangleleft    <char-0x025C2>               " ◂          : BLACK LEFT-POINTING SMALL TRIANGLE / BLACK LEFT POINTING SMALL TRIANGLE
++\\smallblacktriangleright   <char-0x025B8>               " ▸          : BLACK RIGHT-POINTING SMALL TRIANGLE / BLACK RIGHT POINTING SMALL TRIANGLE
++\\smallin                   <char-0x0220A>               " ∊          : SMALL ELEMENT OF
++\\smallni                   <char-0x0220D>               " ∍          : SMALL CONTAINS AS MEMBER
++\\smalltriangleleft         <char-0x025C3>               " ◃          : WHITE LEFT-POINTING SMALL TRIANGLE / WHITE LEFT POINTING SMALL TRIANGLE
++\\smalltriangleright        <char-0x025B9>               " ▹          : WHITE RIGHT-POINTING SMALL TRIANGLE / WHITE RIGHT POINTING SMALL TRIANGLE
++\\smashtimes                <char-0x02A33>               " ⨳          : SMASH PRODUCT
++\\smblkdiamond              <char-0x02B29>               " ⬩          : BLACK SMALL DIAMOND
++\\smblklozenge              <char-0x02B2A>               " ⬪          : BLACK SMALL LOZENGE
++\\smblksquare               <char-0x025AA>               " ▪          : BLACK SMALL SQUARE
++\\smeparsl                  <char-0x029E4>               " ⧤          : EQUALS SIGN AND SLANTED PARALLEL WITH TILDE ABOVE
++\\smile                     <char-0x02323>               " ⌣          : SMILE
++\\smt                       <char-0x02AAA>               " ⪪          : SMALLER THAN
++\\smt<Tab>                  <char-0x02AAA>               " ⪪          : SMALLER THAN
++\\smte                      <char-0x02AAC>               " ⪬          : SMALLER THAN OR EQUAL TO
++\\smwhitestar               <char-0x02B52>               " ⭒          : WHITE SMALL STAR
++\\smwhtcircle               <char-0x025E6>               " ◦          : WHITE BULLET
++\\smwhtlozenge              <char-0x02B2B>               " ⬫          : WHITE SMALL LOZENGE
++\\smwhtsquare               <char-0x025AB>               " ▫          : WHITE SMALL SQUARE
++\\sout                      <char-0x00336>               " ◌̶         : COMBINING LONG STROKE OVERLAY / NON-SPACING LONG BAR OVERLAY
++\\spadesuit                 <char-0x02660>               " ♠          : BLACK SPADE SUIT
++\\sphericalangle            <char-0x02222>               " ∢          : SPHERICAL ANGLE
++\\sphericalangle<Tab>       <char-0x02222>               " ∢          : SPHERICAL ANGLE
++\\sphericalangleu           \\sphericalangleu            "            : (Incomplete sequence)
++\\sphericalangleup          <char-0x029A1>               " ⦡          : SPHERICAL ANGLE OPENING UP
++\\sqcap                     <char-0x02293>               " ⊓          : SQUARE CAP
++\\sqcup                     <char-0x02294>               " ⊔          : SQUARE CUP
++\\sqfl                      <char-0x025E7>               " ◧          : SQUARE WITH LEFT HALF BLACK
++\\sqfnw                     <char-0x02519>               " ┙          : BOX DRAWINGS UP LIGHT AND LEFT HEAVY / FORMS UP LIGHT AND LEFT HEAVY
++\\sqfr                      <char-0x025E8>               " ◨          : SQUARE WITH RIGHT HALF BLACK
++\\sqfse                     <char-0x025EA>               " ◪          : SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK
++\\sqlozenge                 <char-0x02311>               " ⌑          : SQUARE LOZENGE
++\\sqrint                    <char-0x02A16>               " ⨖          : QUATERNION INTEGRAL OPERATOR
++\\sqrt                      <char-0x0221A>               " √          : SQUARE ROOT
++\\sqrt<Tab>                 <char-0x0221A>               " √          : SQUARE ROOT
++\\sqrtb                     \\sqrtb                      "            : (Incomplete sequence)
++\\sqrtbottom                <char-0x023B7>               " ⎷          : RADICAL SYMBOL BOTTOM
++\\sqspne                    <char-0x022E5>               " ⋥          : SQUARE ORIGINAL OF OR NOT EQUAL TO
++\\sqsubset                  <char-0x0228F>               " ⊏          : SQUARE IMAGE OF
++\\sqsubset<Tab>             <char-0x0228F>               " ⊏          : SQUARE IMAGE OF
++\\sqsubsete                 \\sqsubsete                  "            : (Incomplete sequence)
++\\sqsubseteq                <char-0x02291>               " ⊑          : SQUARE IMAGE OF OR EQUAL TO
++\\sqsubsetn                 \\sqsubsetn                  "            : (Incomplete sequence)
++\\sqsubsetneq               <char-0x022E4>               " ⋤          : SQUARE IMAGE OF OR NOT EQUAL TO
++\\sqsupset                  <char-0x02290>               " ⊐          : SQUARE ORIGINAL OF
++\\sqsupset<Tab>             <char-0x02290>               " ⊐          : SQUARE ORIGINAL OF
++\\sqsupsete                 \\sqsupsete                  "            : (Incomplete sequence)
++\\sqsupseteq                <char-0x02292>               " ⊒          : SQUARE ORIGINAL OF OR EQUAL TO
++\\square                    <char-0x025A1>               " □          : WHITE SQUARE
++\\square<Tab>               <char-0x025A1>               " □          : WHITE SQUARE
++\\squareb                   \\squareb                    "            : (Incomplete sequence)
++\\squarebotblack            <char-0x02B13>               " ⬓          : SQUARE WITH BOTTOM HALF BLACK
++\\squarec                   \\squarec                    "            : (Incomplete sequence)
++\\squarecrossfill           <char-0x025A9>               " ▩          : SQUARE WITH DIAGONAL CROSSHATCH FILL
++\\squareh                   \\squareh                    "            : (Incomplete sequence)
++\\squarehfill               <char-0x025A4>               " ▤          : SQUARE WITH HORIZONTAL FILL
++\\squarehvfill              <char-0x025A6>               " ▦          : SQUARE WITH ORTHOGONAL CROSSHATCH FILL
++\\squarel                   \\squarel                    "            : (Incomplete sequence)
++\\squarellblack             <char-0x02B15>               " ⬕          : SQUARE WITH LOWER LEFT DIAGONAL HALF BLACK
++\\squarellquad              <char-0x025F1>               " ◱          : WHITE SQUARE WITH LOWER LEFT QUADRANT
++\\squarelrquad              <char-0x025F2>               " ◲          : WHITE SQUARE WITH LOWER RIGHT QUADRANT
++\\squaren                   \\squaren                    "            : (Incomplete sequence)
++\\squareneswfill            <char-0x025A8>               " ▨          : SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL
++\\squarenwsefill            <char-0x025A7>               " ▧          : SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL
++\\squaret                   \\squaret                    "            : (Incomplete sequence)
++\\squaretopblack            <char-0x02B12>               " ⬒          : SQUARE WITH TOP HALF BLACK
++\\squareu                   \\squareu                    "            : (Incomplete sequence)
++\\squareulblack             <char-0x025E9>               " ◩          : SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK
++\\squareulquad              <char-0x025F0>               " ◰          : WHITE SQUARE WITH UPPER LEFT QUADRANT
++\\squareurblack             <char-0x02B14>               " ⬔          : SQUARE WITH UPPER RIGHT DIAGONAL HALF BLACK
++\\squareurquad              <char-0x025F3>               " ◳          : WHITE SQUARE WITH UPPER RIGHT QUADRANT
++\\squarev                   \\squarev                    "            : (Incomplete sequence)
++\\squarevfill               <char-0x025A5>               " ▥          : SQUARE WITH VERTICAL FILL
++\\squoval                   <char-0x025A2>               " ▢          : WHITE SQUARE WITH ROUNDED CORNERS
++\\ss                        <char-0x000DF>               " ß          : LATIN SMALL LETTER SHARP S
++\\star                      <char-0x022C6>               " ⋆          : STAR OPERATOR
++\\star<Tab>                 <char-0x022C6>               " ⋆          : STAR OPERATOR
++\\stare                     \\stare                      "            : (Incomplete sequence)
++\\starequal                 <char-0x0225B>               " ≛          : STAR EQUALS
++\\sterling                  <char-0x000A3>               " £          : POUND SIGN
++\\strike                    <char-0x00336>               " ◌̶         : COMBINING LONG STROKE OVERLAY / NON-SPACING LONG BAR OVERLAY
++\\strns                     <char-0x023E4>               " ⏤          : STRAIGHTNESS
++\\subedot                   <char-0x02AC3>               " ⫃          : SUBSET OF OR EQUAL TO WITH DOT ABOVE
++\\submult                   <char-0x02AC1>               " ⫁          : SUBSET WITH MULTIPLICATION SIGN BELOW
++\\subset                    <char-0x02282>               " ⊂          : SUBSET OF
++\\subset<Tab>               <char-0x02282>               " ⊂          : SUBSET OF
++\\subseta                   \\subseta                    "            : (Incomplete sequence)
++\\subsetapprox              <char-0x02AC9>               " ⫉          : SUBSET OF ABOVE ALMOST EQUAL TO
++\\subsetd                   \\subsetd                    "            : (Incomplete sequence)
++\\subsetdot                 <char-0x02ABD>               " ⪽          : SUBSET WITH DOT
++\\subsete                   \\subsete                    "            : (Incomplete sequence)
++\\subseteq                  <char-0x02286>               " ⊆          : SUBSET OF OR EQUAL TO
++\\subseteq<Tab>             <char-0x02286>               " ⊆          : SUBSET OF OR EQUAL TO
++\\subseteqq                 <char-0x02AC5>               " ⫅          : SUBSET OF ABOVE EQUALS SIGN
++\\subsetn                   \\subsetn                    "            : (Incomplete sequence)
++\\subsetneq                 <char-0x0228A>               " ⊊          : SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO
++\\subsetneq<Tab>            <char-0x0228A>               " ⊊          : SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO
++\\subsetneqq                <char-0x02ACB>               " ⫋          : SUBSET OF ABOVE NOT EQUAL TO
++\\subsetp                   \\subsetp                    "            : (Incomplete sequence)
++\\subsetplus                <char-0x02ABF>               " ⪿          : SUBSET WITH PLUS SIGN BELOW
++\\subsim                    <char-0x02AC7>               " ⫇          : SUBSET OF ABOVE TILDE OPERATOR
++\\subsub                    <char-0x02AD5>               " ⫕          : SUBSET ABOVE SUBSET
++\\subsup                    <char-0x02AD3>               " ⫓          : SUBSET ABOVE SUPERSET
++\\succ                      <char-0x0227B>               " ≻          : SUCCEEDS
++\\succ<Tab>                 <char-0x0227B>               " ≻          : SUCCEEDS
++\\succa                     \\succa                      "            : (Incomplete sequence)
++\\succapprox                <char-0x02AB8>               " ⪸          : SUCCEEDS ABOVE ALMOST EQUAL TO
++\\succc                     \\succc                      "            : (Incomplete sequence)
++\\succcurlyeq               <char-0x0227D>               " ≽          : SUCCEEDS OR EQUAL TO
++\\succe                     \\succe                      "            : (Incomplete sequence)
++\\succeq                    <char-0x02AB0>               " ⪰          : SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
++\\succeq<Tab>               <char-0x02AB0>               " ⪰          : SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
++\\succeqq                   <char-0x02AB4>               " ⪴          : SUCCEEDS ABOVE EQUALS SIGN
++\\succn                     \\succn                      "            : (Incomplete sequence)
++\\succnapprox               <char-0x02ABA>               " ⪺          : SUCCEEDS ABOVE NOT ALMOST EQUAL TO
++\\succneq                   <char-0x02AB2>               " ⪲          : SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
++\\succneq<Tab>              <char-0x02AB2>               " ⪲          : SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO
++\\succneqq                  <char-0x02AB6>               " ⪶          : SUCCEEDS ABOVE NOT EQUAL TO
++\\succnsim                  <char-0x022E9>               " ⋩          : SUCCEEDS BUT NOT EQUIVALENT TO
++\\succs                     \\succs                      "            : (Incomplete sequence)
++\\succsim                   <char-0x0227F>               " ≿          : SUCCEEDS OR EQUIVALENT TO
++\\sum                       <char-0x02211>               " ∑          : N-ARY SUMMATION
++\\sum<Tab>                  <char-0x02211>               " ∑          : N-ARY SUMMATION
++\\sumi                      \\sumi                       "            : (Incomplete sequence)
++\\sumint                    <char-0x02A0B>               " ⨋          : SUMMATION WITH INTEGRAL
++\\sun                       <char-0x0263C>               " ☼          : WHITE SUN WITH RAYS
++\\supdsub                   <char-0x02AD8>               " ⫘          : SUPERSET BESIDE AND JOINED BY DASH WITH SUBSET
++\\supedot                   <char-0x02AC4>               " ⫄          : SUPERSET OF OR EQUAL TO WITH DOT ABOVE
++\\suphsol                   <char-0x027C9>               " ⟉          : SUPERSET PRECEDING SOLIDUS
++\\suphsub                   <char-0x02AD7>               " ⫗          : SUPERSET BESIDE SUBSET
++\\supmult                   <char-0x02AC2>               " ⫂          : SUPERSET WITH MULTIPLICATION SIGN BELOW
++\\supset                    <char-0x02283>               " ⊃          : SUPERSET OF
++\\supset<Tab>               <char-0x02283>               " ⊃          : SUPERSET OF
++\\supseta                   \\supseta                    "            : (Incomplete sequence)
++\\supsetapprox              <char-0x02ACA>               " ⫊          : SUPERSET OF ABOVE ALMOST EQUAL TO
++\\supsetd                   \\supsetd                    "            : (Incomplete sequence)
++\\supsetdot                 <char-0x02ABE>               " ⪾          : SUPERSET WITH DOT
++\\supsete                   \\supsete                    "            : (Incomplete sequence)
++\\supseteq                  <char-0x02287>               " ⊇          : SUPERSET OF OR EQUAL TO
++\\supseteq<Tab>             <char-0x02287>               " ⊇          : SUPERSET OF OR EQUAL TO
++\\supseteqq                 <char-0x02AC6>               " ⫆          : SUPERSET OF ABOVE EQUALS SIGN
++\\supsetn                   \\supsetn                    "            : (Incomplete sequence)
++\\supsetneq                 <char-0x0228B>               " ⊋          : SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO
++\\supsetneq<Tab>            <char-0x0228B>               " ⊋          : SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO
++\\supsetneqq                <char-0x02ACC>               " ⫌          : SUPERSET OF ABOVE NOT EQUAL TO
++\\supsetp                   \\supsetp                    "            : (Incomplete sequence)
++\\supsetplus                <char-0x02AC0>               " ⫀          : SUPERSET WITH PLUS SIGN BELOW
++\\supsim                    <char-0x02AC8>               " ⫈          : SUPERSET OF ABOVE TILDE OPERATOR
++\\supsub                    <char-0x02AD4>               " ⫔          : SUPERSET ABOVE SUBSET
++\\supsup                    <char-0x02AD6>               " ⫖          : SUPERSET ABOVE SUPERSET
++\\surd                      <char-0x0221A>               " √          : SQUARE ROOT
++\\swarrow                   <char-0x02199>               " ↙          : SOUTH WEST ARROW / LOWER LEFT ARROW
++\\tau                       <char-0x003C4>               " τ          : GREEK SMALL LETTER TAU
++\\tau<Tab>                  <char-0x003C4>               " τ          : GREEK SMALL LETTER TAU
++\\taur                      \\taur                       "            : (Incomplete sequence)
++\\taurus                    <char-0x02649>               " ♉          : TAURUS
++\\tdcol                     <char-0x02AF6>               " ⫶          : TRIPLE COLON OPERATOR
++\\tesh                      <char-0x002A7>               " ʧ          : LATIN SMALL LETTER TESH DIGRAPH / LATIN SMALL LETTER T ESH
++\\th                        <char-0x000FE>               " þ          : LATIN SMALL LETTER THORN
++\\th<Tab>                   <char-0x000FE>               " þ          : LATIN SMALL LETTER THORN
++\\the                       \\the                        "            : (Incomplete sequence)
++\\therefore                 <char-0x02234>               " ∴          : THEREFORE
++\\theta                     <char-0x003B8>               " θ          : GREEK SMALL LETTER THETA
++\\thi                       \\thi                        "            : (Incomplete sequence)
++\\thickspace                <char-0x02005>               "            : FOUR-PER-EM SPACE
++\\thinspace                 <char-0x02009>               "            : THIN SPACE
++\\thr                       \\thr                        "            : (Incomplete sequence)
++\\threedangle               <char-0x027C0>               " ⟀          : THREE DIMENSIONAL ANGLE
++\\threeunderdot             <char-0x020E8>               " ◌⃨         : COMBINING TRIPLE UNDERDOT
++\\tieconcat                 <char-0x02040>               " ⁀          : CHARACTER TIE
++\\tilde                     <char-0x00303>               " ◌̃         : COMBINING TILDE / NON-SPACING TILDE
++\\tilde<Tab>                <char-0x00303>               " ◌̃         : COMBINING TILDE / NON-SPACING TILDE
++\\tildel                    \\tildel                     "            : (Incomplete sequence)
++\\tildelow                  <char-0x002DC>               " ˜          : SMALL TILDE / SPACING TILDE
++\\tildet                    \\tildet                     "            : (Incomplete sequence)
++\\tildetrpl                 <char-0x0224B>               " ≋          : TRIPLE TILDE
++\\times                     <char-0x000D7>               " ×          : MULTIPLICATION SIGN
++\\times<Tab>                <char-0x000D7>               " ×          : MULTIPLICATION SIGN
++\\timesb                    \\timesb                     "            : (Incomplete sequence)
++\\timesbar                  <char-0x02A31>               " ⨱          : MULTIPLICATION SIGN WITH UNDERBAR
++\\to                        <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
++\\to<Tab>                   <char-0x02192>               " →          : RIGHTWARDS ARROW / RIGHT ARROW
++\\toe                       \\toe                        "            : (Incomplete sequence)
++\\toea                      <char-0x02928>               " ⤨          : NORTH EAST ARROW AND SOUTH EAST ARROW
++\\ton                       \\ton                        "            : (Incomplete sequence)
++\\tona                      <char-0x02927>               " ⤧          : NORTH WEST ARROW AND NORTH EAST ARROW
++\\top                       <char-0x022A4>               " ⊤          : DOWN TACK
++\\top<Tab>                  <char-0x022A4>               " ⊤          : DOWN TACK
++\\topb                      \\topb                       "            : (Incomplete sequence)
++\\topbot                    <char-0x02336>               " ⌶          : APL FUNCTIONAL SYMBOL I-BEAM
++\\tops                      \\tops                       "            : (Incomplete sequence)
++\\topsemicircle             <char-0x025E0>               " ◠          : UPPER HALF CIRCLE
++\\tos                       \\tos                        "            : (Incomplete sequence)
++\\tosa                      <char-0x02929>               " ⤩          : SOUTH EAST ARROW AND SOUTH WEST ARROW
++\\tow                       \\tow                        "            : (Incomplete sequence)
++\\towa                      <char-0x0292A>               " ⤪          : SOUTH WEST ARROW AND NORTH WEST ARROW
++\\trademark                 <char-0x02122>               " ™          : TRADE MARK SIGN / TRADEMARK
++\\trapezium                 <char-0x023E2>               " ⏢          : WHITE TRAPEZIUM
++\\trianglecdot              <char-0x025EC>               " ◬          : WHITE UP-POINTING TRIANGLE WITH DOT / WHITE UP POINTING TRIANGLE WITH DOT
++\\triangledown              <char-0x025BF>               " ▿          : WHITE DOWN-POINTING SMALL TRIANGLE / WHITE DOWN POINTING SMALL TRIANGLE
++\\triangleleft              <char-0x025C1>               " ◁          : WHITE LEFT-POINTING TRIANGLE / WHITE LEFT POINTING TRIANGLE
++\\triangleleft<Tab>         <char-0x025C1>               " ◁          : WHITE LEFT-POINTING TRIANGLE / WHITE LEFT POINTING TRIANGLE
++\\triangleleftb             \\triangleleftb              "            : (Incomplete sequence)
++\\triangleleftblack         <char-0x025ED>               " ◭          : UP-POINTING TRIANGLE WITH LEFT HALF BLACK / UP POINTING TRIANGLE WITH LEFT HALF BLACK
++\\trianglelefte             \\trianglelefte              "            : (Incomplete sequence)
++\\trianglelefteq            <char-0x022B4>               " ⊴          : NORMAL SUBGROUP OF OR EQUAL TO
++\\triangleminus             <char-0x02A3A>               " ⨺          : MINUS SIGN IN TRIANGLE
++\\triangleplus              <char-0x02A39>               " ⨹          : PLUS SIGN IN TRIANGLE
++\\triangleq                 <char-0x0225C>               " ≜          : DELTA EQUAL TO
++\\triangleright             <char-0x025B7>               " ▷          : WHITE RIGHT-POINTING TRIANGLE / WHITE RIGHT POINTING TRIANGLE
++\\triangleright<Tab>        <char-0x025B7>               " ▷          : WHITE RIGHT-POINTING TRIANGLE / WHITE RIGHT POINTING TRIANGLE
++\\trianglerightb            \\trianglerightb             "            : (Incomplete sequence)
++\\trianglerightblack        <char-0x025EE>               " ◮          : UP-POINTING TRIANGLE WITH RIGHT HALF BLACK / UP POINTING TRIANGLE WITH RIGHT HALF BLACK
++\\trianglerighte            \\trianglerighte             "            : (Incomplete sequence)
++\\trianglerighteq           <char-0x022B5>               " ⊵          : CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
++\\triangletimes             <char-0x02A3B>               " ⨻          : MULTIPLICATION SIGN IN TRIANGLE
++\\tricolon                  <char-0x0205D>               " ⁝          : TRICOLON
++\\tripleplus                <char-0x029FB>               " ⧻          : TRIPLE PLUS
++\\trna                      <char-0x00250>               " ɐ          : LATIN SMALL LETTER TURNED A
++\\trnh                      <char-0x00265>               " ɥ          : LATIN SMALL LETTER TURNED H
++\\trnm                      <char-0x0026F>               " ɯ          : LATIN SMALL LETTER TURNED M
++\\trnm<Tab>                 <char-0x0026F>               " ɯ          : LATIN SMALL LETTER TURNED M
++\\trnml                     \\trnml                      "            : (Incomplete sequence)
++\\trnmlr                    <char-0x00270>               " ɰ          : LATIN SMALL LETTER TURNED M WITH LONG LEG
++\\trnr                      <char-0x00279>               " ɹ          : LATIN SMALL LETTER TURNED R
++\\trnr<Tab>                 <char-0x00279>               " ɹ          : LATIN SMALL LETTER TURNED R
++\\trnrl                     <char-0x0027A>               " ɺ          : LATIN SMALL LETTER TURNED R WITH LONG LEG
++\\trnsa                     <char-0x00252>               " ɒ          : LATIN SMALL LETTER TURNED ALPHA / LATIN SMALL LETTER TURNED SCRIPT A
++\\trnt                      <char-0x00287>               " ʇ          : LATIN SMALL LETTER TURNED T
++\\trny                      <char-0x0028E>               " ʎ          : LATIN SMALL LETTER TURNED Y
++\\ttA                       <char-0x1D670>               " 𝙰          : MATHEMATICAL MONOSPACE CAPITAL A
++\\ttB                       <char-0x1D671>               " 𝙱          : MATHEMATICAL MONOSPACE CAPITAL B
++\\ttC                       <char-0x1D672>               " 𝙲          : MATHEMATICAL MONOSPACE CAPITAL C
++\\ttD                       <char-0x1D673>               " 𝙳          : MATHEMATICAL MONOSPACE CAPITAL D
++\\ttE                       <char-0x1D674>               " 𝙴          : MATHEMATICAL MONOSPACE CAPITAL E
++\\ttF                       <char-0x1D675>               " 𝙵          : MATHEMATICAL MONOSPACE CAPITAL F
++\\ttG                       <char-0x1D676>               " 𝙶          : MATHEMATICAL MONOSPACE CAPITAL G
++\\ttH                       <char-0x1D677>               " 𝙷          : MATHEMATICAL MONOSPACE CAPITAL H
++\\ttI                       <char-0x1D678>               " 𝙸          : MATHEMATICAL MONOSPACE CAPITAL I
++\\ttJ                       <char-0x1D679>               " 𝙹          : MATHEMATICAL MONOSPACE CAPITAL J
++\\ttK                       <char-0x1D67A>               " 𝙺          : MATHEMATICAL MONOSPACE CAPITAL K
++\\ttL                       <char-0x1D67B>               " 𝙻          : MATHEMATICAL MONOSPACE CAPITAL L
++\\ttM                       <char-0x1D67C>               " 𝙼          : MATHEMATICAL MONOSPACE CAPITAL M
++\\ttN                       <char-0x1D67D>               " 𝙽          : MATHEMATICAL MONOSPACE CAPITAL N
++\\ttO                       <char-0x1D67E>               " 𝙾          : MATHEMATICAL MONOSPACE CAPITAL O
++\\ttP                       <char-0x1D67F>               " 𝙿          : MATHEMATICAL MONOSPACE CAPITAL P
++\\ttQ                       <char-0x1D680>               " 𝚀          : MATHEMATICAL MONOSPACE CAPITAL Q
++\\ttR                       <char-0x1D681>               " 𝚁          : MATHEMATICAL MONOSPACE CAPITAL R
++\\ttS                       <char-0x1D682>               " 𝚂          : MATHEMATICAL MONOSPACE CAPITAL S
++\\ttT                       <char-0x1D683>               " 𝚃          : MATHEMATICAL MONOSPACE CAPITAL T
++\\ttU                       <char-0x1D684>               " 𝚄          : MATHEMATICAL MONOSPACE CAPITAL U
++\\ttV                       <char-0x1D685>               " 𝚅          : MATHEMATICAL MONOSPACE CAPITAL V
++\\ttW                       <char-0x1D686>               " 𝚆          : MATHEMATICAL MONOSPACE CAPITAL W
++\\ttX                       <char-0x1D687>               " 𝚇          : MATHEMATICAL MONOSPACE CAPITAL X
++\\ttY                       <char-0x1D688>               " 𝚈          : MATHEMATICAL MONOSPACE CAPITAL Y
++\\ttZ                       <char-0x1D689>               " 𝚉          : MATHEMATICAL MONOSPACE CAPITAL Z
++\\tta                       <char-0x1D68A>               " 𝚊          : MATHEMATICAL MONOSPACE SMALL A
++\\ttb                       <char-0x1D68B>               " 𝚋          : MATHEMATICAL MONOSPACE SMALL B
++\\ttc                       <char-0x1D68C>               " 𝚌          : MATHEMATICAL MONOSPACE SMALL C
++\\ttd                       <char-0x1D68D>               " 𝚍          : MATHEMATICAL MONOSPACE SMALL D
++\\tte                       <char-0x1D68E>               " 𝚎          : MATHEMATICAL MONOSPACE SMALL E
++\\tte<Tab>                  <char-0x1D68E>               " 𝚎          : MATHEMATICAL MONOSPACE SMALL E
++\\ttei                      \\ttei                       "            : (Incomplete sequence)
++\\tteight                   <char-0x1D7FE>               " 𝟾          : MATHEMATICAL MONOSPACE DIGIT EIGHT
++\\ttf                       <char-0x1D68F>               " 𝚏          : MATHEMATICAL MONOSPACE SMALL F
++\\ttf<Tab>                  <char-0x1D68F>               " 𝚏          : MATHEMATICAL MONOSPACE SMALL F
++\\ttfi                      \\ttfi                       "            : (Incomplete sequence)
++\\ttfive                    <char-0x1D7FB>               " 𝟻          : MATHEMATICAL MONOSPACE DIGIT FIVE
++\\ttfo                      \\ttfo                       "            : (Incomplete sequence)
++\\ttfour                    <char-0x1D7FA>               " 𝟺          : MATHEMATICAL MONOSPACE DIGIT FOUR
++\\ttg                       <char-0x1D690>               " 𝚐          : MATHEMATICAL MONOSPACE SMALL G
++\\tth                       <char-0x1D691>               " 𝚑          : MATHEMATICAL MONOSPACE SMALL H
++\\tti                       <char-0x1D692>               " 𝚒          : MATHEMATICAL MONOSPACE SMALL I
++\\ttj                       <char-0x1D693>               " 𝚓          : MATHEMATICAL MONOSPACE SMALL J
++\\ttk                       <char-0x1D694>               " 𝚔          : MATHEMATICAL MONOSPACE SMALL K
++\\ttl                       <char-0x1D695>               " 𝚕          : MATHEMATICAL MONOSPACE SMALL L
++\\ttm                       <char-0x1D696>               " 𝚖          : MATHEMATICAL MONOSPACE SMALL M
++\\ttn                       <char-0x1D697>               " 𝚗          : MATHEMATICAL MONOSPACE SMALL N
++\\ttn<Tab>                  <char-0x1D697>               " 𝚗          : MATHEMATICAL MONOSPACE SMALL N
++\\ttni                      \\ttni                       "            : (Incomplete sequence)
++\\ttnine                    <char-0x1D7FF>               " 𝟿          : MATHEMATICAL MONOSPACE DIGIT NINE
++\\tto                       <char-0x1D698>               " 𝚘          : MATHEMATICAL MONOSPACE SMALL O
++\\tto<Tab>                  <char-0x1D698>               " 𝚘          : MATHEMATICAL MONOSPACE SMALL O
++\\tton                      \\tton                       "            : (Incomplete sequence)
++\\ttone                     <char-0x1D7F7>               " 𝟷          : MATHEMATICAL MONOSPACE DIGIT ONE
++\\ttp                       <char-0x1D699>               " 𝚙          : MATHEMATICAL MONOSPACE SMALL P
++\\ttq                       <char-0x1D69A>               " 𝚚          : MATHEMATICAL MONOSPACE SMALL Q
++\\ttr                       <char-0x1D69B>               " 𝚛          : MATHEMATICAL MONOSPACE SMALL R
++\\tts                       <char-0x1D69C>               " 𝚜          : MATHEMATICAL MONOSPACE SMALL S
++\\tts<Tab>                  <char-0x1D69C>               " 𝚜          : MATHEMATICAL MONOSPACE SMALL S
++\\ttse                      \\ttse                       "            : (Incomplete sequence)
++\\ttseven                   <char-0x1D7FD>               " 𝟽          : MATHEMATICAL MONOSPACE DIGIT SEVEN
++\\ttsi                      \\ttsi                       "            : (Incomplete sequence)
++\\ttsix                     <char-0x1D7FC>               " 𝟼          : MATHEMATICAL MONOSPACE DIGIT SIX
++\\ttt                       <char-0x1D69D>               " 𝚝          : MATHEMATICAL MONOSPACE SMALL T
++\\ttt<Tab>                  <char-0x1D69D>               " 𝚝          : MATHEMATICAL MONOSPACE SMALL T
++\\ttth                      \\ttth                       "            : (Incomplete sequence)
++\\ttthree                   <char-0x1D7F9>               " 𝟹          : MATHEMATICAL MONOSPACE DIGIT THREE
++\\tttw                      \\tttw                       "            : (Incomplete sequence)
++\\tttwo                     <char-0x1D7F8>               " 𝟸          : MATHEMATICAL MONOSPACE DIGIT TWO
++\\ttu                       <char-0x1D69E>               " 𝚞          : MATHEMATICAL MONOSPACE SMALL U
++\\ttv                       <char-0x1D69F>               " 𝚟          : MATHEMATICAL MONOSPACE SMALL V
++\\ttw                       <char-0x1D6A0>               " 𝚠          : MATHEMATICAL MONOSPACE SMALL W
++\\ttx                       <char-0x1D6A1>               " 𝚡          : MATHEMATICAL MONOSPACE SMALL X
++\\tty                       <char-0x1D6A2>               " 𝚢          : MATHEMATICAL MONOSPACE SMALL Y
++\\ttz                       <char-0x1D6A3>               " 𝚣          : MATHEMATICAL MONOSPACE SMALL Z
++\\ttz<Tab>                  <char-0x1D6A3>               " 𝚣          : MATHEMATICAL MONOSPACE SMALL Z
++\\ttze                      \\ttze                       "            : (Incomplete sequence)
++\\ttzero                    <char-0x1D7F6>               " 𝟶          : MATHEMATICAL MONOSPACE DIGIT ZERO
++\\turnangle                 <char-0x029A2>               " ⦢          : TURNED ANGLE
++\\turnediota                <char-0x02129>               " ℩          : TURNED GREEK SMALL LETTER IOTA
++\\turnednot                 <char-0x02319>               " ⌙          : TURNED NOT SIGN
++\\turnk                     <char-0x0029E>               " ʞ          : LATIN SMALL LETTER TURNED K
++\\twocaps                   <char-0x02A4B>               " ⩋          : INTERSECTION BESIDE AND JOINED WITH INTERSECTION
++\\twocups                   <char-0x02A4A>               " ⩊          : UNION BESIDE AND JOINED WITH UNION
++\\twoheaddownarrow          <char-0x021A1>               " ↡          : DOWNWARDS TWO HEADED ARROW / DOWN TWO HEADED ARROW
++\\twoheadleftarrow          <char-0x0219E>               " ↞          : LEFTWARDS TWO HEADED ARROW / LEFT TWO HEADED ARROW
++\\twoheadleftarrow<Tab>     <char-0x0219E>               " ↞          : LEFTWARDS TWO HEADED ARROW / LEFT TWO HEADED ARROW
++\\twoheadleftarrowt         \\twoheadleftarrowt          "            : (Incomplete sequence)
++\\twoheadleftarrowtail      <char-0x02B3B>               " ⬻          : LEFTWARDS TWO-HEADED ARROW WITH TAIL
++\\twoheadleftdbkarrow       <char-0x02B37>               " ⬷          : LEFTWARDS TWO-HEADED TRIPLE DASH ARROW
++\\twoheadmapsfrom           <char-0x02B36>               " ⬶          : LEFTWARDS TWO-HEADED ARROW FROM BAR
++\\twoheadmapsto             <char-0x02905>               " ⤅          : RIGHTWARDS TWO-HEADED ARROW FROM BAR
++\\twoheadrightarrow         <char-0x021A0>               " ↠          : RIGHTWARDS TWO HEADED ARROW / RIGHT TWO HEADED ARROW
++\\twoheadrightarrow<Tab>    <char-0x021A0>               " ↠          : RIGHTWARDS TWO HEADED ARROW / RIGHT TWO HEADED ARROW
++\\twoheadrightarrowt        \\twoheadrightarrowt         "            : (Incomplete sequence)
++\\twoheadrightarrowtail     <char-0x02916>               " ⤖          : RIGHTWARDS TWO-HEADED ARROW WITH TAIL
++\\twoheaduparrow            <char-0x0219F>               " ↟          : UPWARDS TWO HEADED ARROW / UP TWO HEADED ARROW
++\\twoheaduparrow<Tab>       <char-0x0219F>               " ↟          : UPWARDS TWO HEADED ARROW / UP TWO HEADED ARROW
++\\twoheaduparrowc           \\twoheaduparrowc            "            : (Incomplete sequence)
++\\twoheaduparrowcircle      <char-0x02949>               " ⥉          : UPWARDS TWO-HEADED ARROW FROM SMALL CIRCLE
++\\twonotes                  <char-0x0266B>               " ♫          : BEAMED EIGHTH NOTES / BARRED EIGHTH NOTES
++\\u                         <char-0x002D8>               " ˘          : BREVE / SPACING BREVE
++\\u<Tab>                    <char-0x002D8>               " ˘          : BREVE / SPACING BREVE
++\\ul                        \\ul                         "            : (Incomplete sequence)
++\\ularc                     <char-0x025DC>               " ◜          : UPPER LEFT QUADRANT CIRCULAR ARC
++\\ulblacktriangle           <char-0x025E4>               " ◤          : BLACK UPPER LEFT TRIANGLE
++\\ulcorner                  <char-0x0231C>               " ⌜          : TOP LEFT CORNER
++\\ultriangle                <char-0x025F8>               " ◸          : UPPER LEFT TRIANGLE
++\\um                        \\um                         "            : (Incomplete sequence)
++\\uminus                    <char-0x02A41>               " ⩁          : UNION WITH MINUS SIGN
++\\un                        \\un                         "            : (Incomplete sequence)
++\\underbar                  <char-0x00332>               " ◌̲         : COMBINING LOW LINE / NON-SPACING UNDERSCORE
++\\underbrace                <char-0x023DF>               " ⏟          : BOTTOM CURLY BRACKET
++\\underbracket              <char-0x023B5>               " ⎵          : BOTTOM SQUARE BRACKET
++\\underleftarrow            <char-0x020EE>               " ◌⃮         : COMBINING LEFT ARROW BELOW
++\\underleftharpoondown      <char-0x020ED>               " ◌⃭         : COMBINING LEFTWARDS HARPOON WITH BARB DOWNWARDS
++\\underleftrightarrow       <char-0x0034D>               " ◌͍         : COMBINING LEFT RIGHT ARROW BELOW
++\\underrightarrow           <char-0x020EF>               " ◌⃯         : COMBINING RIGHT ARROW BELOW
++\\underrightharpoondown     <char-0x020EC>               " ◌⃬         : COMBINING RIGHTWARDS HARPOON WITH BARB DOWNWARDS
++\\up                        \\up                         "            : (Incomplete sequence)
++\\upMu                      <char-0x0039C>               " Μ          : GREEK CAPITAL LETTER MU
++\\upNu                      <char-0x0039D>               " Ν          : GREEK CAPITAL LETTER NU
++\\upOmicron                 <char-0x0039F>               " Ο          : GREEK CAPITAL LETTER OMICRON
++\\upand                     <char-0x0214B>               " ⅋          : TURNED AMPERSAND
++\\uparrow                   <char-0x02191>               " ↑          : UPWARDS ARROW / UP ARROW
++\\uparrow<Tab>              <char-0x02191>               " ↑          : UPWARDS ARROW / UP ARROW
++\\uparrowb                  \\uparrowb                   "            : (Incomplete sequence)
++\\uparrowbarred             <char-0x02909>               " ⤉          : UPWARDS ARROW WITH HORIZONTAL STROKE
++\\updasharrow               <char-0x021E1>               " ⇡          : UPWARDS DASHED ARROW / UP DASHED ARROW
++\\updownarrow               <char-0x02195>               " ↕          : UP DOWN ARROW
++\\updownarrow<Tab>          <char-0x02195>               " ↕          : UP DOWN ARROW
++\\updownarrowb              \\updownarrowb               "            : (Incomplete sequence)
++\\updownarrowbar            <char-0x021A8>               " ↨          : UP DOWN ARROW WITH BASE
++\\updownharpoonleftright    <char-0x0294D>               " ⥍          : UP BARB LEFT DOWN BARB RIGHT HARPOON
++\\updownharpoonrightleft    <char-0x0294C>               " ⥌          : UP BARB RIGHT DOWN BARB LEFT HARPOON
++\\upepsilon                 <char-0x003B5>               " ε          : GREEK SMALL LETTER EPSILON
++\\upharpoonleft             <char-0x021BF>               " ↿          : UPWARDS HARPOON WITH BARB LEFTWARDS / UP HARPOON WITH BARB LEFT
++\\upharpoonright            <char-0x021BE>               " ↾          : UPWARDS HARPOON WITH BARB RIGHTWARDS / UP HARPOON WITH BARB RIGHT
++\\upharpoonsleftright       <char-0x02963>               " ⥣          : UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT
++\\upin                      <char-0x027D2>               " ⟒          : ELEMENT OF OPENING UPWARDS
++\\upin<Tab>                 <char-0x027D2>               " ⟒          : ELEMENT OF OPENING UPWARDS
++\\upint                     <char-0x02A1B>               " ⨛          : INTEGRAL WITH OVERBAR
++\\upkoppa                   <char-0x003DF>               " ϟ          : GREEK SMALL LETTER KOPPA
++\\uplus                     <char-0x0228E>               " ⊎          : MULTISET UNION
++\\upoldKoppa                <char-0x003D8>               " Ϙ          : GREEK LETTER ARCHAIC KOPPA
++\\upoldkoppa                <char-0x003D9>               " ϙ          : GREEK SMALL LETTER ARCHAIC KOPPA
++\\upomicron                 <char-0x003BF>               " ο          : GREEK SMALL LETTER OMICRON
++\\upsampi                   <char-0x003E1>               " ϡ          : GREEK SMALL LETTER SAMPI
++\\upsilon                   <char-0x003C5>               " υ          : GREEK SMALL LETTER UPSILON
++\\upstigma                  <char-0x003DB>               " ϛ          : GREEK SMALL LETTER STIGMA
++\\upuparrows                <char-0x021C8>               " ⇈          : UPWARDS PAIRED ARROWS / UP PAIRED ARROWS
++\\upvDash                   <char-0x02AEB>               " ⫫          : DOUBLE UP TACK
++\\upvarbeta                 <char-0x003D0>               " ϐ          : GREEK BETA SYMBOL / GREEK SMALL LETTER CURLED BETA
++\\upwhitearrow              <char-0x021E7>               " ⇧          : UPWARDS WHITE ARROW / WHITE UP ARROW
++\\ur                        \\ur                         "            : (Incomplete sequence)
++\\uranus                    <char-0x02645>               " ♅          : URANUS
++\\urarc                     <char-0x025DD>               " ◝          : UPPER RIGHT QUADRANT CIRCULAR ARC
++\\urblacktriangle           <char-0x025E5>               " ◥          : BLACK UPPER RIGHT TRIANGLE
++\\urcorner                  <char-0x0231D>               " ⌝          : TOP RIGHT CORNER
++\\urtriangle                <char-0x025F9>               " ◹          : UPPER RIGHT TRIANGLE
++\\vDash                     <char-0x022A8>               " ⊨          : TRUE
++\\varTheta                  <char-0x003F4>               " ϴ          : GREEK CAPITAL THETA SYMBOL
++\\varbarwedge               <char-0x02305>               " ⌅          : PROJECTIVE
++\\varcarriagereturn         <char-0x023CE>               " ⏎          : RETURN SYMBOL
++\\varclubsuit               <char-0x02667>               " ♧          : WHITE CLUB SUIT
++\\vardiamondsuit            <char-0x02666>               " ♦          : BLACK DIAMOND SUIT
++\\vardoublebarwedge         <char-0x02306>               " ⌆          : PERSPECTIVE
++\\varepsilon                <char-0x003B5>               " ε          : GREEK SMALL LETTER EPSILON
++\\varheartsuit              <char-0x02665>               " ♥          : BLACK HEART SUIT
++\\varhexagon                <char-0x02B21>               " ⬡          : WHITE HEXAGON
++\\varhexagon<Tab>           <char-0x02B21>               " ⬡          : WHITE HEXAGON
++\\varhexagonb               \\varhexagonb                "            : (Incomplete sequence)
++\\varhexagonblack           <char-0x02B22>               " ⬢          : BLACK HEXAGON
++\\varhexagonl               \\varhexagonl                "            : (Incomplete sequence)
++\\varhexagonlrbonds         <char-0x0232C>               " ⌬          : BENZENE RING
++\\varisinobar               <char-0x022F6>               " ⋶          : ELEMENT OF WITH OVERBAR
++\\varisins                  <char-0x022F3>               " ⋳          : ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++\\varkappa                  <char-0x003F0>               " ϰ          : GREEK KAPPA SYMBOL / GREEK SMALL LETTER SCRIPT KAPPA
++\\varlrtriangle             <char-0x022BF>               " ⊿          : RIGHT TRIANGLE
++\\varniobar                 <char-0x022FD>               " ⋽          : CONTAINS WITH OVERBAR
++\\varnis                    <char-0x022FB>               " ⋻          : CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
++\\varnothing                <char-0x02205>               " ∅          : EMPTY SET
++\\varointclockwise          <char-0x02232>               " ∲          : CLOCKWISE CONTOUR INTEGRAL
++\\varphi                    <char-0x003C6>               " φ          : GREEK SMALL LETTER PHI
++\\varpi                     <char-0x003D6>               " ϖ          : GREEK PI SYMBOL / GREEK SMALL LETTER OMEGA PI
++\\varrho                    <char-0x003F1>               " ϱ          : GREEK RHO SYMBOL / GREEK SMALL LETTER TAILED RHO
++\\varsigma                  <char-0x003C2>               " ς          : GREEK SMALL LETTER FINAL SIGMA
++\\varspadesuit              <char-0x02664>               " ♤          : WHITE SPADE SUIT
++\\varstar                   <char-0x02736>               " ✶          : SIX POINTED BLACK STAR
++\\varsubsetneqq             <char-0x0228A><char-0x0FE00> " ⊊︀         : SUBSET OF WITH NOT EQUAL TO / SUBSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
++\\varsupsetneq              <char-0x0228B><char-0x0FE00> " ⊋︀         : SUPERSET OF WITH NOT EQUAL TO / SUPERSET OF OR NOT EQUAL TO + VARIATION SELECTOR-1
++\\vartheta                  <char-0x003D1>               " ϑ          : GREEK THETA SYMBOL / GREEK SMALL LETTER SCRIPT THETA
++\\vartriangle               <char-0x025B5>               " ▵          : WHITE UP-POINTING SMALL TRIANGLE / WHITE UP POINTING SMALL TRIANGLE
++\\vartriangle<Tab>          <char-0x025B5>               " ▵          : WHITE UP-POINTING SMALL TRIANGLE / WHITE UP POINTING SMALL TRIANGLE
++\\vartrianglel              \\vartrianglel               "            : (Incomplete sequence)
++\\vartriangleleft           <char-0x022B2>               " ⊲          : NORMAL SUBGROUP OF
++\\vartriangler              \\vartriangler               "            : (Incomplete sequence)
++\\vartriangleright          <char-0x022B3>               " ⊳          : CONTAINS AS NORMAL SUBGROUP
++\\varveebar                 <char-0x02A61>               " ⩡          : SMALL VEE WITH UNDERBAR
++\\vdash                     <char-0x022A2>               " ⊢          : RIGHT TACK
++\\vdots                     <char-0x022EE>               " ⋮          : VERTICAL ELLIPSIS
++\\vec                       <char-0x020D7>               " ◌⃗         : COMBINING RIGHT ARROW ABOVE / NON-SPACING RIGHT ARROW ABOVE
++\\vee                       <char-0x02228>               " ∨          : LOGICAL OR
++\\vee<Tab>                  <char-0x02228>               " ∨          : LOGICAL OR
++\\veeb                      \\veeb                       "            : (Incomplete sequence)
++\\veebar                    <char-0x022BB>               " ⊻          : XOR
++\\veed                      \\veed                       "            : (Incomplete sequence)
++\\veedoublebar              <char-0x02A63>               " ⩣          : LOGICAL OR WITH DOUBLE UNDERBAR
++\\veee                      \\veee                       "            : (Incomplete sequence)
++\\veeeq                     <char-0x0225A>               " ≚          : EQUIANGULAR TO
++\\veem                      \\veem                       "            : (Incomplete sequence)
++\\veemidvert                <char-0x02A5B>               " ⩛          : LOGICAL OR WITH MIDDLE STEM
++\\veeo                      \\veeo                       "            : (Incomplete sequence)
++\\veeodot                   <char-0x02A52>               " ⩒          : LOGICAL OR WITH DOT ABOVE
++\\venus                     <char-0x02640>               " ♀          : FEMALE SIGN
++\\verti                     <char-0x002CC>               " ˌ          : MODIFIER LETTER LOW VERTICAL LINE
++\\vertoverlay               <char-0x020D2>               " ◌⃒         : COMBINING LONG VERTICAL LINE OVERLAY / NON-SPACING LONG VERTICAL BAR OVERLAY
++\\verts                     <char-0x002C8>               " ˈ          : MODIFIER LETTER VERTICAL LINE
++\\verymuchless              <char-0x022D8>               " ⋘          : VERY MUCH LESS-THAN / VERY MUCH LESS THAN
++\\viewdata                  <char-0x02317>               " ⌗          : VIEWDATA SQUARE
++\\virgo                     <char-0x0264D>               " ♍          : VIRGO
++\\visiblespace              <char-0x02423>               " ␣          : OPEN BOX
++\\vrectangleblack           <char-0x025AE>               " ▮          : BLACK VERTICAL RECTANGLE
++\\vrecto                    <char-0x025AF>               " ▯          : WHITE VERTICAL RECTANGLE
++\\vysmblkcircle             <char-0x02219>               " ∙          : BULLET OPERATOR
++\\vysmblksquare             <char-0x02B1D>               " ⬝          : BLACK VERY SMALL SQUARE
++\\vysmwhtsquare             <char-0x02B1E>               " ⬞          : WHITE VERY SMALL SQUARE
++\\wedge                     <char-0x02227>               " ∧          : LOGICAL AND
++\\wedge<Tab>                <char-0x02227>               " ∧          : LOGICAL AND
++\\wedged                    \\wedged                     "            : (Incomplete sequence)
++\\wedgedot                  <char-0x027D1>               " ⟑          : AND WITH DOT
++\\wedgedoublebar            <char-0x02A60>               " ⩠          : LOGICAL AND WITH DOUBLE UNDERBAR
++\\wedgem                    \\wedgem                     "            : (Incomplete sequence)
++\\wedgemidvert              <char-0x02A5A>               " ⩚          : LOGICAL AND WITH MIDDLE STEM
++\\wedgeo                    \\wedgeo                     "            : (Incomplete sequence)
++\\wedgeodot                 <char-0x02A51>               " ⩑          : LOGICAL AND WITH DOT ABOVE
++\\wedgeonwedge              <char-0x02A55>               " ⩕          : TWO INTERSECTING LOGICAL AND
++\\wedgeq                    <char-0x02259>               " ≙          : ESTIMATES
++\\whitearrowupfrombar       <char-0x021EA>               " ⇪          : UPWARDS WHITE ARROW FROM BAR / WHITE UP ARROW FROM BAR
++\\whiteinwhitetriangle      <char-0x027C1>               " ⟁          : WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE
++\\whitepointerleft          <char-0x025C5>               " ◅          : WHITE LEFT-POINTING POINTER / WHITE LEFT POINTING POINTER
++\\whitepointerright         <char-0x025BB>               " ▻          : WHITE RIGHT-POINTING POINTER / WHITE RIGHT POINTING POINTER
++\\whthorzoval               <char-0x02B2D>               " ⬭          : WHITE HORIZONTAL ELLIPSE
++\\whtvertoval               <char-0x02B2F>               " ⬯          : WHITE VERTICAL ELLIPSE
++\\wideangledown             <char-0x029A6>               " ⦦          : OBLIQUE ANGLE OPENING UP
++\\wideangleup               <char-0x029A7>               " ⦧          : OBLIQUE ANGLE OPENING DOWN
++\\widebridgeabove           <char-0x020E9>               " ◌⃩         : COMBINING WIDE BRIDGE ABOVE
++\\wideutilde                <char-0x00330>               " ◌̰         : COMBINING TILDE BELOW / NON-SPACING TILDE BELOW
++\\wp                        <char-0x02118>               " ℘          : SCRIPT CAPITAL P / SCRIPT P
++\\wr                        <char-0x02240>               " ≀          : WREATH PRODUCT
++\\xi                        <char-0x003BE>               " ξ          : GREEK SMALL LETTER XI
++\\xor                       <char-0x022BB>               " ⊻          : XOR
++\\xrat                      <char-0x0211E>               " ℞          : PRESCRIPTION TAKE
++\\yen                       <char-0x000A5>               " ¥          : YEN SIGN
++\\yogh                      <char-0x00292>               " ʒ          : LATIN SMALL LETTER EZH / LATIN SMALL LETTER YOGH
++\\zeta                      <char-0x003B6>               " ζ          : GREEK SMALL LETTER ZETA
++" ------------------------- ---------------------------- " ---------- : --------------------------------------------------------------------------------------------------------
++
++" Below here is the script that was used to produce this file.
++
++"> #!/bin/env julia
++"> 
++"> import REPL
++"> 
++"> const filename = "latex2unicode_utf-8"
++"> const include_emoji = false # set this to true if you want to keymap empjis as well
++"> 
++"> # We want to avoid situations in which the user types e.g. \delt and pauses,
++"> # and the result is "∇t" because "\del" gets recognized and then there is some leftover "t".
++"> # This allows us to get completions with <Tab> for example.
++"> function fix_completions(completions::Dict{String,String})
++">     allinputs = sort!(collect(keys(completions)))
++">     new_completions = copy(completions)
++"> 
++">     for input in allinputs
++">         chars = completions[input]
++">         l = length(input)
++">         longer = filter(x->startswith(x, input)&&length(x)>l, allinputs)
++">         n = length(longer)
++">         n == 0 && continue
++">         new_completions[input * "<Tab>"] = chars
++">         for other in longer
++">             add = other[1:(l+1)]
++">             get!(new_completions, add, add)
++">         end
++">     end
++">     return new_completions
++"> end
++"> 
++"> function unicode_data()
++">     file = normpath(Sys.BINDIR, "..", "..", "doc", "UnicodeData.txt")
++">     names = Dict{UInt32, String}()
++">     open(file) do unidata
++">         for line in readlines(unidata)
++">             id, name, desc = split(line, ";")[[1, 2, 11]]
++">             codepoint = parse(UInt32, "0x$id")
++">             names[codepoint] = (name == "" ? desc : desc == "" ? name : "$name / $desc")
++">         end
++">     end
++">     return names
++"> end
++"> 
++"> # Prepend a dotted circle ('◌' i.e. '\u25CC') to combining characters
++"> function fix_combining_chars(char)
++">     cat = Base.Unicode.category_code(char)
++">     return string(cat == 6 || cat == 8 ? "◌" : "", char)
++"> end
++"> 
++"> function table_entries(completions::Dict{String,String}, unicode_dict)
++">     latex = String[]
++">     code = String[]
++">     unicode = String[]
++">     desc = String[]
++"> 
++">     for (input, chars) in sort!(collect(completions))
++">         code_points, unicode_names, characters = String[], String[], String[]
++">         if startswith(chars, "\\")
++">             push!(code_points, replace(chars, "\\" => "\\\\"))
++">             push!(unicode_names, "(Incomplete sequence)")
++">             push!(characters, "")
++">         else
++">             for char in chars
++">                 push!(code_points, "<char-0x$(uppercase(string(UInt32(char), base = 16, pad = 5)))>")
++">                 push!(unicode_names, get(unicode_dict, UInt32(char), "(No Unicode name)"))
++">                 push!(characters, isempty(characters) ? fix_combining_chars(char) : "$char")
++">             end
++">         end
++">         push!(latex, replace(input, "\\"=>"\\\\"))
++">         push!(code, join(code_points))
++">         push!(unicode, join(characters))
++">         push!(desc, join(unicode_names, " + "))
++">     end
++">     return latex, code, unicode, desc
++"> end
++"> 
++"> open("$filename.vim","w") do f
++">     print(f, """
++">         " This file is autogenerated from the script '$(basename(Base.source_path()))'
++">         " The symbols are based on Julia version $VERSION
++">         " The full generating script can be found in the comments at the bottom of this file,
++">         " and it can be extracted with:
++">         "
++">         "     \$ grep '^\">' $filename.vim | cut -c4- > '$(basename(Base.source_path()))'
++">         "
++">         " To produce this keymap file you need to have Julia compilied from source, and
++">         " to run `make deps` inside Julia's `doc` directory.
++">         " Then you can run:
++">         "
++">         "     \$ julia $(basename(Base.source_path()))
++">         "
++"> 
++">         scriptencoding utf-8
++"> 
++">         let b:keymap_name = "L2U"
++">         loadkeymap
++"> 
++">         """)
++"> 
++">     col_headers = ["\" Tab completion sequence", "Code point", "Character", "Unicode name"]
++"> 
++">     orig_completions = include_emoji ? merge(
++">                 REPL.REPLCompletions.latex_symbols,
++">                 REPL.REPLCompletions.emoji_symbols
++">                 ) :
++">                 REPL.REPLCompletions.latex_symbols
++"> 
++">     latex, code, unicode, desc =
++">         table_entries(
++">             fix_completions(orig_completions),
++">             unicode_data()
++">             )
++"> 
++">     lw = max(length(col_headers[3]), maximum(map(length, latex)))
++">     cw = max(length(col_headers[1]), maximum(map(length, code)))
++">     uw = max(length(col_headers[2]), maximum(map(length, unicode)))
++">     dw = max(length(col_headers[4]), maximum(map(length, desc)))
++"> 
++">     print_padded(l, c, u, d) = println(f, rpad(l, lw), " ", rpad(c, cw), " \" ", rpad(u, uw), " : ", d)
++"> 
++">     print_padded(col_headers...)
++">     print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
++"> 
++">     for (l, c, u, d) in zip(latex, code, unicode, desc)
++">         print_padded(l, c, u, d)
++">     end
++">     print_padded("\" " * "-"^(lw-2), "-"^cw, "-"^uw, "-"^dw)
++"> 
++">     print(f, """
++"> 
++">         " Below here is the script that was used to produce this file.
++"> 
++">         """)
++">     for l in readlines(Base.source_path())
++">         println(f, "\"> ", l)
++">     end
++">     println(f)
++"> end
++
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim	(revision 26504)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim	(revision 26505)
+@@ -9,6 +9,9 @@
+   finish
+ endif
+ 
++let s:cpo_save = &cpo
++set cpo&vim
++
+ if version < 704
+   " this is used to disable regex syntax like `\@3<='
+   " on older vim versions
+@@ -36,9 +39,9 @@
+ " It doesn't include a few characters (spaces and all closing parentheses)
+ " because those may or may not be valid in the lookbehind on a case-by-case
+ " basis.
+-let s:nonid_chars = '\U00-\U08' . '\U0A-\U1F' .
+-      \             '\U21-\U28' . '\U2A-\U2F' . '\U3A-\U40' . '\U5B-\U5E' . '\U60' . '\U7B\U7C' .
+-      \             '\U7E-\UA1' . '\UA7\UA8' . '\UAB-\UAD' . '\UAF\UB1\UB4' . '\UB6-\UB8' . '\UBB\UBF' . '\UD7\UF7'
++let s:nonid_chars = '\U00-\U08' . '\U0A-\U1F'
++      \           . '\U21-\U28' . '\U2A-\U2F' . '\U3A-\U40' . '\U5B-\U5E' . '\U60' . '\U7B\U7C'
++      \           . '\U7E-\UA1' . '\UA7\UA8' . '\UAB-\UAD' . '\UAF\UB1\UB4' . '\UB6-\UB8' . '\UBB\UBF' . '\UD7\UF7'
+ 
+ " The complete list
+ let s:nonidS_chars = '[:space:])\U5D}' . s:nonid_chars
+@@ -56,10 +59,10 @@
+ let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC'
+ 
+ " Full operators regex
+-let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?=' .
+-      \           '\|'  . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?' .
+-      \           '\|'  . '\.\?[!' . s:op_chars . s:op_chars_wc . ']' .
+-      \           '\)'
++let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?='
++      \         . '\|'  . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?'
++      \         . '\|'  . '\.\?[!' . s:op_chars . s:op_chars_wc . ']'
++      \         . '\)'
+ 
+ 
+ " Characters that can be used to start an identifier. Above \UBF we don't
+@@ -243,11 +246,11 @@
+ let s:bin_regex = '0b[01]\%(_\?[01]\)*\%(\>\|im\>\|\ze[^01]\)'
+ let s:oct_regex = '0o\o\%(_\?\o\)*\%(\>\|im\>\|\ze\O\)'
+ 
+-let s:int_regex = '\%(' . s:hex_regex .
+-      \           '\|'  . s:bin_regex .
+-      \           '\|'  . s:oct_regex .
+-      \           '\|'  . s:dec_regex .
+-      \           '\)'
++let s:int_regex = '\%(' . s:hex_regex
++      \         . '\|'  . s:bin_regex
++      \         . '\|'  . s:oct_regex
++      \         . '\|'  . s:dec_regex
++      \         . '\)'
+ 
+ "floating point regexes
+ "  starting with a dot, optional exponent
+@@ -263,12 +266,12 @@
+ "  starting with a digit
+ let s:hexfloat_regex2 = '0x\x\%(_\?\x\)*\%\(\.\%\(\x\%(_\?\x\)*\)\?\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
+ 
+-let s:float_regex = '\%(' . s:float_regex3 .
+-      \             '\|'  . s:float_regex2 .
+-      \             '\|'  . s:float_regex1 .
+-      \             '\|'  . s:hexfloat_regex2 .
+-      \             '\|'  . s:hexfloat_regex1 .
+-      \             '\)'
++let s:float_regex = '\%(' . s:float_regex3
++      \           . '\|'  . s:float_regex2
++      \           . '\|'  . s:float_regex1
++      \           . '\|'  . s:hexfloat_regex2
++      \           . '\|'  . s:hexfloat_regex1
++      \           . '\)'
+ 
+ exec 'syntax match   juliaNumber	contained "' . s:int_regex . '" contains=juliaComplexUnit'
+ exec 'syntax match   juliaFloat		contained "' . s:float_regex . '" contains=juliaComplexUnit'
+@@ -379,6 +382,14 @@
+ syntax region  juliaCommentM		matchgroup=juliaCommentDelim fold start="#=\ze\%([^#]\|$\)" end="=#" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
+ syntax keyword juliaTodo		contained TODO FIXME XXX
+ 
++"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++"ISSM special syntax                                                                                             "
++let enumfile=$ISSM_DIR."/src/c/shared/Enum/Enumjl.vim"
++if filereadable(enumfile)
++   exec 'source ' . enumfile
++endif
++"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++
+ " detect an end-of-line with only whitespace or comments before it
+ let s:eol = '\s*\%(\%(\%(#=\%(=#\@!\|[^=]\|\n\)\{-}=#\)\s*\)\+\)\?\%(#=\@!.*\)\?\n'
+ 
+@@ -541,3 +552,6 @@
+ syntax sync fromstart
+ 
+ let b:current_syntax = "julia"
++
++let &cpo = s:cpo_save
++unlet s:cpo_save
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim	(revision 26504)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim	(revision 26505)
+@@ -5,6 +5,9 @@
+   finish
+ endif
+ 
++let s:cpo_save = &cpo
++set cpo&vim
++
+ syntax sync fromstart
+ 
+ syntax region juliadocCode matchgroup=juliadocCodeDelimiter start="`" end="`" concealends display oneline
+@@ -63,3 +66,6 @@
+ highlight default link juliadocAdmonitionsTitle Title
+ 
+ let b:current_syntax = "juliadoc"
++
++let &cpo = s:cpo_save
++unlet s:cpo_save
+Index: ../trunk-jpl/externalpackages/vim/addons/vimrc
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vimrc	(revision 26504)
++++ ../trunk-jpl/externalpackages/vim/addons/vimrc	(revision 26505)
+@@ -213,6 +213,7 @@
+ au BufRead,BufNewFile *.c*,*.h iabbr <silent> ER  _error_("");<Left><Left><Left><C-R>=Eatchar('\s')<CR>
+ au BufRead,BufNewFile *.py     iabbr <silent> ER  raise NameError('')<Left><Left><C-R>=Eatchar('\s')<CR>
+ au BufRead,BufNewFile *.m      iabbr <silent> ER  error('');<Left><Left><Left><C-R>=Eatchar('\s')<CR>
++au BufRead,BufNewFile *.jl     iabbr <silent> ER  error("")<Left><Left><C-R>=Eatchar('\s')<CR>
+ au BufRead,BufNewFile *.c*     ab VV VecView(ug,PETSC_VIEWER_STDOUT_WORLD);
+ au BufRead,BufNewFile *.c*,*.h ab AS _assert_();<Left><Left><C-R>=Eatchar('\s')<CR>
+ au BufRead,BufNewFile *.c*,*.h iab <expr> p0  "printf(\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);"
Index: /issm/oecreview/Archive/25834-26739/ISSM-26505-26506.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26505-26506.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26505-26506.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/test/NightlyRun/test134.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test134.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test134.m	(revision 26506)
+@@ -0,0 +1,17 @@
++%Test Name: SquareShelfConstrainedSampling
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md = md.sampling.setparameters(md,2e5,1);
++md.sampling.seed = 100;
++md.cluster=generic('name',oshostname(),'np',1);
++md=solve(md,'smp');
++
++plotmodel(md,'data',md.results.SamplingSolution.Sample,'data','mesh');
++
++%Fields and tolerances to track changes
++field_names     ={'Sample'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.SamplingSolution.Sample),...
++	};
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26506-26507.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26506-26507.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26506-26507.diff	(revision 26740)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive134.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26507-26508.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26507-26508.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26507-26508.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-basic
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26507)
++++ ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26508)
+@@ -67,7 +67,10 @@
+ # See documentation in test/NightlyRun/runme.* for more information
+ #
+ # NOTE:
++# - Tests 257 and 543 are currently excluded on macOS as they rely on random 
++#	number generation, which is platform-dependent in its current 
++#	implementation
+ # - test701 is skipped because it uses full Stokes equations
+ #
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),435,701,702,703]"
++MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),257,435,543,701,702,703]"
+ PYTHON_NROPTIONS=""
Index: /issm/oecreview/Archive/25834-26739/ISSM-26508-26509.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26508-26509.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26508-26509.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test134.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test134.m	(revision 26508)
++++ ../trunk-jpl/test/NightlyRun/test134.m	(revision 26509)
+@@ -7,8 +7,6 @@
+ md.cluster=generic('name',oshostname(),'np',1);
+ md=solve(md,'smp');
+ 
+-plotmodel(md,'data',md.results.SamplingSolution.Sample,'data','mesh');
+-
+ %Fields and tolerances to track changes
+ field_names     ={'Sample'};
+ field_tolerances={1e-13};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26509-26510.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26509-26510.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26509-26510.diff	(revision 26740)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26509)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26510)
+@@ -394,7 +394,7 @@
+        //            +storage*head_old/dt
+         //           )*basis[i];
+ 
+-                 /* With weighted creep term*/
++                 /* With weighted creep term */
+                   for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+                    (
+                     meltrate*(1/rho_water-1/rho_ice)
+@@ -403,9 +403,21 @@
+                     -beta*sqrt(vx*vx+vy*vy)
+                     +ieb
+                     +storage*head_old/dt
+-		    +1.e-5*(dgapxx+dgapyy)
+                     )*basis[i];
+ 
++                /* Test with experimental diffusivity term*/
++//                   for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
++ //                   (
++  //                   meltrate*(1/rho_water-1/rho_ice)
++   //                  +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
++    //                 +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
++     //                -beta*sqrt(vx*vx+vy*vy)
++      //               +ieb
++       //              +storage*head_old/dt
++        //             +0.e-5*(dgapxx+dgapyy)
++         //            )*basis[i];
++
++
+ 	
+ //                 /*Test with linear creep rate*/
+  //                for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+@@ -648,19 +660,19 @@
+ 		meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1])-PMPheat);
+ 		_assert_(meltrate>0.);
+ 
+-//		newgap += gauss->weight*Jdet*(gap+dt*(
+-//					meltrate/rho_ice
+-//					-A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*gap
+-//					+beta*sqrt(vx*vx+vy*vy)
+-//					));
++		newgap += gauss->weight*Jdet*(gap+dt*(
++					meltrate/rho_ice
++					-A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*gap
++					+beta*sqrt(vx*vx+vy*vy)
++					));
+ 
+-		/* TEST with gap height "diffusivity" for melting walls - not yet completed*/
+-                newgap += gauss->weight*Jdet*(gap+dt*(
+-                                         meltrate/rho_ice
+-                                         -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
+-                                         +beta*sqrt(vx*vx+vy*vy)
+-					 +1.e-5*(dgapxx+dgapyy))
+-                                         );
++		/* TEST with experimental gap height "diffusivity" for melting walls */
++//                newgap += gauss->weight*Jdet*(gap+dt*(
++ //                                        meltrate/rho_ice
++  //                                       -A*pow(fabs(pressure_ice-pressure_water),n-1)*(pressure_ice-pressure_water)*lc
++   //                                      +beta*sqrt(vx*vx+vy*vy)
++//					 +0.e-5*(dgapxx+dgapyy))
++ //                                        );
+ 
+ 
+                  /*TEST with linear creep rate*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26510-26511.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26510-26511.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26510-26511.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive350.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26511-26512.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26511-26512.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26511-26512.diff	(revision 26740)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26511)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26512)
+@@ -26,7 +26,8 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	std::default_random_engine generator(seed);
++	//std::default_random_engine generator(seed);
++	std::mt19937 generator(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26512-26513.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26512-26513.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26512-26513.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive134.arch
+___________________________________________________________________
+Deleted: svn:mime-type
+## -1 +0,0 ##
+-application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test134.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test134.m	(revision 26512)
++++ ../trunk-jpl/test/NightlyRun/test134.m	(nonexistent)
+@@ -1,15 +0,0 @@
+-%Test Name: SquareShelfConstrainedSampling
+-md=triangle(model(),'../Exp/Square.exp',150000.);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md = md.sampling.setparameters(md,2e5,1);
+-md.sampling.seed = 100;
+-md.cluster=generic('name',oshostname(),'np',1);
+-md=solve(md,'smp');
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Sample'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.SamplingSolution.Sample),...
+-	};
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26513-26514.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26513-26514.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26513-26514.diff	(revision 26740)
@@ -0,0 +1,74 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26513)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26514)
+@@ -9,13 +9,45 @@
+ #include "../analyses/analyses.h"
+ #include <random>
+ 
++#undef M_PI
++#define M_PI 3.141592653589793238462643
++
++double lcg(long long* seed){/*{{{*/
++
++
++	int N = 5;
++	long long M = 1LL<<32;
++	long long a = 1812433253;
++	long long c = 1;
++
++	for(int i=0;i<N;i++){
++		*seed = a * *seed + c;
++		*seed = *seed%M;
++	}
++
++  return ((double) *seed) / ((double) M);
++
++}
++
++double BoxMuller(long long* pseed){
++
++	double u1 = lcg(pseed);
++	double u2 = lcg(pseed);
++
++	double R = sqrt(-2*log(u1));
++	double theta = 2*M_PI*u2;
++
++	return R*cos(theta);
++
++}
++
+ void GaussianVector(Vector<IssmDouble>* ppf,int seed){/*{{{*/
+ 
++
+ 	/*Intermediaries*/
+ 	double      rdnumber;
+ 
+-	/*Define random number generator*/
+-	std::normal_distribution<double> distribution(0.0,1.0);  // Define probability distribution as the standard normal distribution
++	/*Define seed*/
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -26,9 +58,10 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	//std::default_random_engine generator(seed);
+-	std::mt19937 generator(seed);
+ 
++	long long seedbis;
++ 	seedbis  = (long long) seed;
++
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+ 	ppf->GetLocalVector(&local_vector,&local_indices);
+@@ -36,7 +69,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution(generator);
++		rdnumber = BoxMuller(&seedbis);
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26514-26515.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26514-26515.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26514-26515.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/test/NightlyRun/test134.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test134.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test134.m	(revision 26515)
+@@ -0,0 +1,15 @@
++%Test Name: SquareShelfConstrainedSampling
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md = md.sampling.setparameters(md,2e5,1);
++md.sampling.seed = 100;
++md.cluster=generic('name',oshostname(),'np',1);
++md=solve(md,'smp');
++
++%Fields and tolerances to track changes
++field_names     ={'Sample'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.SamplingSolution.Sample),...
++	};
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26515-26516.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26515-26516.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26515-26516.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive124.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26516-26517.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26516-26517.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26516-26517.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/test/NightlyRun/test134.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test134.m	(revision 26516)
++++ ../trunk-jpl/test/NightlyRun/test134.m	(nonexistent)
+@@ -1,15 +0,0 @@
+-%Test Name: SquareShelfConstrainedSampling
+-md=triangle(model(),'../Exp/Square.exp',150000.);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelfConstrained.par');
+-md = md.sampling.setparameters(md,2e5,1);
+-md.sampling.seed = 100;
+-md.cluster=generic('name',oshostname(),'np',1);
+-md=solve(md,'smp');
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Sample'};
+-field_tolerances={1e-13};
+-field_values={...
+-	(md.results.SamplingSolution.Sample),...
+-	};
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26517-26518.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26517-26518.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26517-26518.diff	(revision 26740)
@@ -0,0 +1,347 @@
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26517)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26518)
+@@ -3,14 +3,14 @@
+ #Define classes used by model struct
+ abstract type AbstractMesh end
+ mutable struct Mesh2dTriangle <: AbstractMesh
+-	numberofvertices::Int32
+-	numberofelements::Int32
++	numberofvertices::Int64
++	numberofelements::Int64
+ 	x::Vector{Float64}
+ 	y::Vector{Float64}
+-	elements::Matrix{Int32}
++	elements::Matrix{Int64}
+ end
+ function Mesh2dTriangle() #{{{
+-	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int32}(undef, 0, 0))
++	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0))
+ end# }}}
+ function Base.show(io::IO, this::Mesh2dTriangle)# {{{
+ 
+@@ -26,16 +26,16 @@
+ 	end
+ end# }}}
+ mutable struct Mesh3dPrism{T} <: AbstractMesh
+-	numberofvertices::Int32
+-	numberofelements::Int32
+-	numberoflayers::Int32
++	numberofvertices::Int64
++	numberofelements::Int64
++	numberoflayers::Int64
+ 	x::Vector{Float64}
+ 	y::Vector{Float64}
+ 	z::Vector{Float64}
+-	elements::Matrix{Int32}
++	elements::Matrix{Int64}
+ end
+ function Mesh3dPrism() #{{{
+-	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int32}(undef, 0, 0))
++	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0))
+ end# }}}
+ mutable struct Geometry
+ 	surface::Vector{Float64}
+@@ -66,11 +66,18 @@
+ 	restol::Float64
+ 	reltol::Float64
+ 	abstol::Float64
+-	maxiter::Int32
++	maxiter::Int64
+ end
+ function Stressbalance() #{{{
+ 	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 0., 0., 0., 0)
+ end# }}}
++mutable struct Constants
++	g::Float64
++	yts::Float64
++end
++function Constants() #{{{
++	return Constants( 9.81,  365*24*3600.)
++end# }}}
+ mutable struct Materials
+ 	rho_ice::Float64
+ 	rho_water::Float64
+@@ -80,7 +87,7 @@
+ 	latentheat::Float64
+ 	thermalconductivity::Float64
+ 	temperateiceconductivity::Float64
+-	effectiveconductivity_averaging::Int32
++	effectiveconductivity_averaging::Int64
+ 	meltingpoint::Float64
+ 	beta::Float64
+ 	mixed_layer_capacity::Float64
+@@ -100,9 +107,10 @@
+ 	materials::Materials
+ 	initialization::Initialization
+ 	stressbalance::Stressbalance
++	constants::Constants
+ end
+ function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance())
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants())
+ end#}}}
+ function Base.show(io::IO, md::model)# {{{
+ 
+@@ -115,6 +123,7 @@
+ 	@printf "%19s: %-22s -- %s\n" "materials" typeof(md.materials) "material properties"
+ 	@printf "%19s: %-22s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+ 	@printf "%19s: %-22s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
++	@printf "%19s: %-22s -- %s\n" "constants" typeof(md.constants) "physical constants"
+ 
+ end# }}}
+ 
+Index: ../trunk-jpl/src/jl/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve.jl	(revision 26517)
++++ ../trunk-jpl/src/jl/solve.jl	(revision 26518)
+@@ -24,7 +24,12 @@
+ 	parameters.lookup[enum] = IntParam(enum,value)
+ 
+ end#}}}
++function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
+ 
++	parameters.lookup[enum] = IntParam(enum,value)
++
++end#}}}
++
+ abstract type Input end
+ struct BoolInput <: Input#{{{
+ 	enum::IssmEnum
+@@ -32,7 +37,7 @@
+ end# }}}
+ struct IntInput <: Input#{{{
+ 	enum::IssmEnum
+-	values::Matrix{Int32}
++	values::Matrix{Int64}
+ end# }}}
+ struct ElementInput <: Input#{{{
+ 	enum::IssmEnum
+@@ -40,11 +45,11 @@
+ 	values::Vector{Float64}
+ end# }}}
+ mutable struct Inputs #{{{
+-	numberofelements::Int32
+-	numberofvertices::Int32
++	numberofelements::Int64
++	numberofvertices::Int64
+ 	lookup::Dict{IssmEnum,Input}
+ end# }}}
+-function SetInput(inputs::Inputs,enum::IssmEnum,index::Int32,value::Bool) #{{{
++function SetInput(inputs::Inputs,enum::IssmEnum,index::Int64,value::Bool) #{{{
+ 
+ 	#Does this input exist
+ 	if !haskey(inputs.lookup,enum)
+@@ -62,7 +67,7 @@
+ 	@assert index>0 && index<=inputs.numberofelements
+ 	input.values[index] = value
+ end#}}}
+-function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int32,value::Float64) #{{{
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int64,value::Float64) #{{{
+ 
+ 	#Does this input exist
+ 	if !haskey(inputs.lookup,enum)
+@@ -85,7 +90,7 @@
+ 	#set value
+ 	input.values[index] = value
+ end#}}}
+-function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int32},values::Vector{Float64}) #{{{
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int64},values::Vector{Float64}) #{{{
+ 
+ 	#Does this input exist
+ 	if !haskey(inputs.lookup,enum)
+@@ -108,33 +113,34 @@
+ end#}}}
+ 
+ mutable struct Node #{{{
+-	id::Int32
+-	sid::Int32
++	id::Int64
++	sid::Int64
+ 	indexingupdate::Bool
+-	gsize::Int32
+-	gdoflist::Vector{Int32}
+-	fdoflist::Vector{Int32}
+-	sdoflist::Vector{Int32}
++	gsize::Int64
++	gdoflist::Vector{Int64}
++	fdoflist::Vector{Int64}
++	sdoflist::Vector{Int64}
+ 	svalues::Vector{Float64}
+ end# }}}
+ struct Constraint #{{{
+-	id::Int32
+-	nodeid::Int32
++	id::Int64
++	nodeid::Int64
+ 	dof::Int8
+ 	value::Float64
+ end# }}}
+ mutable struct Vertex#{{{
+-	sid::Int32
++	sid::Int64
+ 	x::Float64
+ 	y::Float64
+ end# }}}
+ mutable struct Tria #{{{
+-	sid::Int32
+-	pid::Int32
++	sid::Int64
++	pid::Int64
+ 	#vertexids::Int64[3]
+ 	#vertices::Vertex[3]
+-	vertexids::Vector{Int32}
++	vertexids::Vector{Int64}
+ 	vertices::Vector{Vertex}
++	nodeids::Vector{Int64}
+ 	nodes::Vector{Node}
+ 	parameters::Parameters
+ 	inputs::Inputs
+@@ -143,19 +149,19 @@
+ 	elements::Vector{Tria}
+ 	vertices::Vector{Vertex}
+ 	nodes::Vector{Node}
+-	parameters::Vector{Parameter}
++	parameters::Parameters
+ 	inputs::Inputs
+ 	constraints::Vector{Constraint}
+ 	#loads::Vector{Loads}
+ end#}}}
+ struct GaussTria #{{{
+-	numgauss::Int32
++	numgauss::Int64
+ 	weights::Vector{Float64}
+ 	coords1::Vector{Float64}
+ 	coords2::Vector{Float64}
+ 	coords3::Vector{Float64}
+ end #}}}
+-function GaussTria(order::Int32) #{{{
++function GaussTria(order::Int64) #{{{
+ 
+ 	#=Gauss quadrature points for the triangle.
+ 	Higher-order points from D.A. Dunavant, "High Degree Efficient
+@@ -186,6 +192,10 @@
+ 	return GaussTria(npoints,weights,coords1,coords2,coords3)
+ end# }}}
+ 
++abstract type Analysis end
++struct StressbalanceAnalysis#{{{
++end #}}}
++
+ #Modules
+ function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
+ 	for i in 1:length(elements)
+@@ -198,6 +208,7 @@
+ 	femmodel=ModelProcessor(md)
+ 
+ 	#Solve
++	error("not there yet")
+ 	Stressbalance(femmodel)
+ 
+ 	#then what??
+@@ -206,10 +217,12 @@
+ function ModelProcessor(md::model) #{{{
+ 
+ 	#Initialize structures
+-	elements   = Vector{Tria}(undef,0)
+-	vertices   = Vector{Vertex}(undef,0)
+-	parameters = Parameters(Dict{IssmEnum,Parameter}())
+-	inputs     = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
++	elements    = Vector{Tria}(undef,0)
++	vertices    = Vector{Vertex}(undef,0)
++	nodes       = Vector{Node}(undef,0)
++	constraints = Vector{Constraint}(undef,0)
++	parameters  = Parameters(Dict{IssmEnum,Parameter}())
++	inputs      = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
+ 
+ 	#Create  elements, vertices and materials (independent of the analysis)
+ 	CreateElements(elements,md)
+@@ -218,7 +231,14 @@
+ 	CreateInputs(inputs,elements,md)
+ 
+ 	#Now create analysis specific data structure
+-	StressbalanceUpdateParameters(parameters,md)
++	analysis = StressbalanceAnalysis()
++	UpdateParameters(analysis,parameters,md)
++	CreateNodes(analysis,nodes,md)
++	UpdateElements(analysis,elements,inputs,md)
++	CreateConstraints(analysis,constraints,md)
++
++	#Build FemModel
++	return FemModel(elements,vertices,nodes,parameters,inputs,constraints)
+ end# }}}
+ function CreateElements(elements::Vector{Tria},md::model) #{{{
+ 
+@@ -232,7 +252,7 @@
+ 
+ 	count = 0
+ 	for i in 1:md.mesh.numberofelements
+-		push!(elements,Tria(i,count,md.mesh.elements[i,:],tempvertices,tempnodes,tempparams,tempinputs))
++		push!(elements,Tria(i,count,md.mesh.elements[i,:],tempvertices,Vector{Int64}(undef,0),tempnodes,tempparams,tempinputs))
+ 	end
+ 
+ end# }}}
+@@ -261,10 +281,44 @@
+ function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
+ 
+ 	#Only assume we have Matice for now
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum);
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum);
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
+ end# }}}
+ 
++#Analyses
++function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
++	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
++	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
++	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
++	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
++end#}}}
++function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
++
++	numdof = 2
++	for i in 1:md.mesh.numberofvertices
++		push!(nodes,Node(i,i,true,numdof,Vector{Int64}(undef,numdof), Vector{Int64}(undef,numdof), Vector{Int64}(undef,numdof), zeros(numdof)))
++	end
++end#}}}
++function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
++
++	#Provide node indices to element
++	for i in 1:md.mesh.numberofvertices
++		Update(elements[i],inputs,i,md,P1Enum)
++	end
++
++	#Add necessary inputs to perform this analysis
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
++
++end#}}}
++function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
++	error("stop")
++end#}}}
++
+ #Element functions
+ function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
+ 	if size(data,1)==inputs.numberofelements
+@@ -275,3 +329,15 @@
+ 		error("size ",size(data,1)," not supported yet");
+ 	end
+ end #}}}
++function Update(element::Tria,inputs::Inputs,index::Int64,md::model,finiteelement::IssmEnum) #{{{
++
++	if finiteelement==P1Enum
++		numnodes = 3
++		element.nodeids    = Vector{Int64}(undef,numnodes)
++		element.nodeids[1] = md.mesh.elements[index,1]
++		element.nodeids[2] = md.mesh.elements[index,2]
++		element.nodeids[3] = md.mesh.elements[index,3]
++	else
++		error("not supported yet")
++	end
++end #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26518-26519.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26518-26519.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26518-26519.diff	(revision 26740)
@@ -0,0 +1,6994 @@
+Index: ../trunk-jpl/src/m/plot/colormaps/cmocean.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/colormaps/cmocean.m	(nonexistent)
++++ ../trunk-jpl/src/m/plot/colormaps/cmocean.m	(revision 26519)
+@@ -0,0 +1,6989 @@
++function cmap = cmocean(ColormapName,varargin) 
++% cmocean returns perceptually-uniform colormaps created by Kristen Thyng. 
++% 
++%% Syntax 
++% 
++%  cmocean 
++%  cmap = cmocean('ColormapName') 
++%  cmap = cmocean('-ColormapName') 
++%  cmap = cmocean(...,NLevels)
++%  cmap = cmocean(...,'pivot',PivotValue) 
++%  cmap = cmocean(...,'negative') 
++%  cmocean(...)
++% 
++%% Description 
++% 
++% cmocean without any inputs displays the options for colormaps. 
++% 
++% cmap = cmocean('ColormapName') returns a 256x3 colormap. ColormapName can be any of 
++% of the following: 
++% 
++%          SEQUENTIAL:                DIVERGING: 
++%          'thermal'                  'balance'
++%          'haline'                   'delta'
++%          'solar'                    'curl'
++%          'ice'                      'diff'
++%          'gray'                     'tarn'
++%          'oxy' 
++%          'deep'                     CONSTANT LIGHTNESS:
++%          'dense'                    'phase'
++%          'algae'                
++%          'matter'                   OTHER:
++%          'turbid'                   'topo'
++%          'speed'                    
++%          'amp'
++%          'tempo'
++%          'rain'
++%
++% cmap = cmocean('-ColormapName') a minus sign preceeding any ColormapName flips the
++% order of the colormap. 
++%
++% cmap = cmocean(...,NLevels) specifies a number of levels in the colormap.  Default
++% value is 256. 
++%
++% cmap = cmocean(...,'pivot',PivotValue) centers a diverging colormap such that white 
++% corresponds to a given value and maximum extents are set using current caxis limits. 
++% If no PivotValue is set, 0 is assumed. Early versions of this function used 'zero'
++% as the syntax for 'pivot',0 and the old syntax is still supported. 
++%
++% cmap = cmocean(...,'negative') inverts the lightness profile of the colormap. This can be 
++% useful particularly for divergent colormaps if the default white point of divergence
++% gets lost in a white background. 
++% 
++% cmocean(...) without any outputs sets the current colormap to the current axes.  
++% 
++%% Examples 
++% Using this sample plot: 
++% 
++%   imagesc(peaks(1000)+1)
++%   colorbar
++% 
++% Set the colormap to 'algae': 
++% 
++%   cmocean('algae') 
++% 
++% Same as above, but with an inverted algae colormap: 
++% 
++%   cmocean('-algae')
++% 
++% Set the colormap to a 12-level 'solar': 
++% 
++%   cmocean('solar',12)
++% 
++% Get the RGB values of a 5-level thermal colormap: 
++% 
++%   RGB = cmocean('thermal',5)
++% 
++% Some of those values are below zero and others are above. If this dataset represents
++% anomalies, perhaps a diverging colormap is more appropriate: 
++% 
++%   cmocean('balance') 
++% 
++% It's unlikely that 1.7776 is an interesting value about which the data values 
++% diverge.  If you want to center the colormap on zero using the current color 
++% axis limits, simply include the 'pivot' option:  
++% 
++%   cmocean('balance','pivot',0) 
++%
++%% Author Info 
++% This function was written by Chad A. Greene of the Institute for Geophysics at the 
++% University of Texas at Austin (UTIG), June 2016, using colormaps created by Kristen
++% Thyng of Texas A&M University, Department of Oceanography. More information on the
++% cmocean project can be found at http://matplotlib.org/cmocean/. 
++% 
++%% Citing this colormap: 
++% If you find an occasion to cite these colormaps for any reason, or if you just want
++% some nice beach reading, check out the following paper from the journal Oceanography: 
++% 
++% Thyng, K.M., C.A. Greene, R.D. Hetland, H.M. Zimmerle, and S.F. DiMarco. 2016. True 
++% colors of oceanography: Guidelines for effective and accurate colormap selection. 
++% Oceanography 29(3):9?13, http://dx.doi.org/10.5670/oceanog.2016.66.
++% 
++% See also colormap and caxis.  
++
++%% Display colormap options: 
++
++if nargin==0
++   figure('menubar','none','numbertitle','off','Name','cmocean options:')
++   
++   if license('test','image_toolbox')
++      imshow(imread('cmocean.png')); 
++   else
++      axes('pos',[0 0 1 1])
++      image(imread('cmocean.png')); 
++      axis image off
++   end
++   
++   return
++end
++%% Error checks: 
++
++assert(isnumeric(ColormapName)==0,'Input error: ColormapName must be a string.') 
++
++%% Set defaults: 
++
++NLevels = 256; 
++autopivot = false; 
++PivotValue = 0; 
++InvertedColormap = false; 
++
++%% Parse inputs: 
++
++% Does user want to flip the colormap direction? 
++dash = regexp(ColormapName,'-'); 
++if any(dash) 
++   InvertedColormap = true; 
++   ColormapName(dash) = []; 
++end
++
++% Forgive the British: 
++if strncmpi(ColormapName,'grey',4)
++   ColormapName = 'gray'; 
++end
++
++% Does the user want a "negative" version of the colormap (with an inverted lightness profile)? 
++tmp = strncmpi(varargin,'negative',3); 
++if any(tmp) 
++   negativeColormap = true; 
++   varargin = varargin(~tmp); 
++else
++   negativeColormap = false; 
++end
++
++% Does the user want to center a diverging colormap on a specific value? 
++% This parsing support original 'zero' syntax and current 'pivot' syntax. 
++ tmp = strncmpi(varargin,'pivot',3) | strncmpi(varargin,'zero',3); % Thanks to Phelype Oleinik for this suggestion. 
++ if any(tmp) 
++   autopivot = true; 
++   try
++      if isscalar(varargin{find(tmp)+1})
++         PivotValue = varargin{find(tmp)+1}; 
++         tmp(find(tmp)+1) = 1; 
++      end
++   end
++   varargin = varargin(~tmp); 
++end
++
++% Has user requested a specific number of levels? 
++tmp = isscalar(varargin); 
++if any(tmp) 
++   NLevels = varargin{tmp}; 
++end
++
++
++%% Load RGB values and interpolate to NLevels: 
++
++cmap = cmoceanRawRGB(ColormapName); % a subfunction provided below with RGB values of all maps. 
++
++if negativeColormap
++   
++   % Convert RGB to LAB colorspace: 
++   LAB = colorspace('RGB->LAB',cmap); 
++
++   % Operate on the lightness profile: 
++   L = LAB(:,1); 
++
++   % Flip the lightness profile and set the lowest point to black:
++   L = max(L) - L; 
++
++   % Stretch the lightness profile to make the lightest bits 95% white. (Going 100% white
++   % would make the ends of a divergent profile impossible to distinguish.)
++   L = L*(95/max(L)); 
++
++   % Make a new LAB matrix: 
++   LAB = [L LAB(:,2:3)]; 
++   
++   % Convert LAB back to RGB: 
++   cmap = colorspace('LAB->RGB',LAB); 
++end
++
++%% Invert the colormap if requested by user: 
++
++if InvertedColormap
++   cmap = flipud(cmap); 
++end
++
++%% Adjust values to current caxis limits? 
++
++if autopivot
++   clim = caxis; 
++   assert(PivotValue>=clim(1) & PivotValue<=clim(2),'Error: pivot value must be within the current color axis limits.') 
++   maxval = max(abs(clim-PivotValue)); 
++   cmap = interp1(linspace(-maxval,maxval,size(cmap,1))+PivotValue, cmap, linspace(clim(1),clim(2),size(cmap,1)),'linear');
++end
++
++%% Interpolate if necessary: 
++
++if NLevels~=size(cmap,1)
++   cmap = interp1(1:size(cmap,1), cmap, linspace(1,size(cmap,1),NLevels),'linear');
++end
++
++%% Clean up 
++
++if nargout==0
++   colormap(gca,cmap) 
++   clear cmap  
++end
++
++
++
++%%  S U B F U N C T I O N S 
++
++
++function RGB = cmoceanRawRGB(cmapName) 
++
++
++switch lower(cmapName(1:3))
++   case {'dee'} 
++      RGB = [9.928371765383620096e-01 9.943734553013935384e-01 8.001361955494933342e-01
++9.849374457410008388e-01 9.913545172197536504e-01 7.953271573982337861e-01
++9.770418482420034634e-01 9.883418276673759939e-01 7.905717472557142189e-01
++9.691488355955474310e-01 9.853357520972024775e-01 7.858697059005903540e-01
++9.612382061888059548e-01 9.823439661710483550e-01 7.812181455049906909e-01
++9.533233708513803029e-01 9.793607550577946297e-01 7.766197776697654209e-01
++9.454069776374501854e-01 9.763847481120443428e-01 7.720753845210462929e-01
++9.374799177499437697e-01 9.734191074102575003e-01 7.675843461643131471e-01
++9.295353395208965086e-01 9.704660061861888343e-01 7.631467470398153319e-01
++9.215850348376466439e-01 9.675205198521025229e-01 7.587646801057830181e-01
++9.136274030668488644e-01 9.645828701859077148e-01 7.544386825530340346e-01
++9.056514559384564178e-01 9.616567079910524063e-01 7.501688017241657791e-01
++8.976569922484586295e-01 9.587415918264282633e-01 7.459562027416458685e-01
++8.896512126622908578e-01 9.558344072358454513e-01 7.418023698547455691e-01
++8.816325974742758032e-01 9.529352564923027069e-01 7.377082218108865774e-01
++8.735986658557798323e-01 9.500445573198598170e-01 7.336747582572585857e-01
++8.655355018678880796e-01 9.471666805105979359e-01 7.297031220835451526e-01
++8.574559441871676402e-01 9.442965454208677167e-01 7.257948454644865821e-01
++8.493586413080321806e-01 9.414341108550433601e-01 7.219511807036801398e-01
++8.412422934868647451e-01 9.385792958890862847e-01 7.181734629573161000e-01
++8.331056602292961077e-01 9.357319779845385543e-01 7.144631077114116380e-01
++8.249438571064254822e-01 9.328932140048489252e-01 7.108218561594963347e-01
++8.167536485550084269e-01 9.300634438432798801e-01 7.072516022427790539e-01
++8.085407925860420564e-01 9.272401607530683654e-01 7.037535913222745521e-01
++8.003043988510905038e-01 9.244230580301131539e-01 7.003294929842703853e-01
++7.920436855303579771e-01 9.216117772405966191e-01 6.969810377273069069e-01
++7.837579923068553889e-01 9.188059058340631857e-01 6.937100117646464170e-01
++7.754467945117471395e-01 9.160049747102424478e-01 6.905182510191696377e-01
++7.671097184662585278e-01 9.132084557727712104e-01 6.874076341947011892e-01
++7.587465580267132026e-01 9.104157595099175992e-01 6.843800748081978469e-01
++7.503572923166539343e-01 9.076262326497597233e-01 6.814375120698907828e-01
++7.419421046029871514e-01 9.048391559449654453e-01 6.785819005039074314e-01
++7.335014022414247936e-01 9.020537421501462205e-01 6.758151982106467281e-01
++7.250358375800118882e-01 8.992691342626382145e-01 6.731393536848668813e-01
++7.165463296678448168e-01 8.964844041051395207e-01 6.705562911206142118e-01
++7.080340865696405084e-01 8.936985513356989763e-01 6.680678941563225059e-01
++6.995006280355556827e-01 8.909105029766873907e-01 6.656759880411459163e-01
++6.909478082204841831e-01 8.881191135591984809e-01 6.633823202371271766e-01
++6.823778380886152961e-01 8.853231659823359578e-01 6.611885395113676900e-01
++6.737933070789577927e-01 8.825213731875580780e-01 6.590961736178440056e-01
++6.651972035471812594e-01 8.797123807461469935e-01 6.571066057195337207e-01
++6.565929334411800822e-01 8.768947704523611941e-01 6.552210497573525139e-01
++6.479843366143701600e-01 8.740670650055498703e-01 6.534405250319036407e-01
++6.393757001353049807e-01 8.712277338509245572e-01 6.517658303256151919e-01
++6.307693113306602761e-01 8.683757593089920235e-01 6.501986071208971651e-01
++6.221681809999368706e-01 8.655099786991408140e-01 6.487403091120448329e-01
++6.135828162115329887e-01 8.626276255310663110e-01 6.473888753222819537e-01
++6.050194699551968425e-01 8.597270135144634562e-01 6.461439080647282118e-01
++5.964848373853082197e-01 8.568064537576968176e-01 6.450046593443751197e-01
++5.879840953182007279e-01 8.538646600753627691e-01 6.439710905713145195e-01
++5.795218127572832056e-01 8.509005270271372545e-01 6.430435569229606685e-01
++5.711115213696185133e-01 8.479112775740021979e-01 6.422171169895777298e-01
++5.627614837100215484e-01 8.448953489705807174e-01 6.414893854468299850e-01
++5.544783665092802849e-01 8.418515860497588488e-01 6.408587965640016870e-01
++5.462695843545278818e-01 8.387787842708503971e-01 6.403232223573597226e-01
++5.381481232862911357e-01 8.356748924828519831e-01 6.398763669277579558e-01
++5.301228248165350543e-01 8.325387580839158641e-01 6.395142187190840932e-01
++5.221997330825246530e-01 8.293697946738645133e-01 6.392346216632595057e-01
++5.143908532894702068e-01 8.261665755050031645e-01 6.390304309659169402e-01
++5.067050118087177424e-01 8.229283397233977393e-01 6.388963162980869637e-01
++4.991495064662723746e-01 8.196546689563362076e-01 6.388277739100475250e-01
++4.917330703220189059e-01 8.163450533427777378e-01 6.388184799685107107e-01
++4.844633050708381794e-01 8.129992646664957467e-01 6.388624455765857801e-01
++4.773469739538908629e-01 8.096172922533247940e-01 6.389538165444101914e-01
++4.703904182695624603e-01 8.061992786917829834e-01 6.390864379965265352e-01
++4.635986539031755060e-01 8.027456073395251579e-01 6.392548734619343254e-01
++4.569766618393767410e-01 7.992567478306369377e-01 6.394529319719780558e-01
++4.505287643111087204e-01 7.957333261733031682e-01 6.396742566585853496e-01
++4.442569334258392177e-01 7.921762343010834151e-01 6.399148201157260907e-01
++4.381634653667463852e-01 7.885863788123392837e-01 6.401694292235835526e-01
++4.322513883314121341e-01 7.849647158245569578e-01 6.404304190942151642e-01
++4.265195639210723755e-01 7.813124732411278472e-01 6.406960731925235297e-01
++4.209679602144861810e-01 7.776308288475485275e-01 6.409622276506293792e-01
++4.155968407812616339e-01 7.739210344346504344e-01 6.412227317683711902e-01
++4.104045242070183952e-01 7.701844253858858291e-01 6.414742347181462412e-01
++4.053883482522956383e-01 7.664223146281371468e-01 6.417151578859574546e-01
++4.005459328058830759e-01 7.626360316845265386e-01 6.419424749255564500e-01
++3.958750262046074608e-01 7.588270315806920907e-01 6.421508285001665817e-01
++3.913718273240804346e-01 7.549966666219802836e-01 6.423387337484185444e-01
++3.870322615152646528e-01 7.511462095764531721e-01 6.425055472082883412e-01
++3.828523536620307977e-01 7.472769743775978801e-01 6.426493131526664904e-01
++3.788278449989629926e-01 7.433902546660990929e-01 6.427683061328856029e-01
++3.749542811367644335e-01 7.394876286687900313e-01 6.428573615340694714e-01
++3.712266123106295335e-01 7.355700686179795778e-01 6.429189618774799886e-01
++3.676399929257251897e-01 7.316387718079003788e-01 6.429520487195032885e-01
++3.641894512092864744e-01 7.276949011320993366e-01 6.429557270674552960e-01
++3.608699207518579755e-01 7.237395816489646805e-01 6.429292709767442382e-01
++3.576762479926827720e-01 7.197739138067411613e-01 6.428719883285997083e-01
++3.546027248366774298e-01 7.157992458648064771e-01 6.427810759039616073e-01
++3.516446005650431528e-01 7.118162697085735902e-01 6.426589560156208414e-01
++3.487967412412643076e-01 7.078259414050183107e-01 6.425054728664090220e-01
++3.460540467004642462e-01 7.038291754672099110e-01 6.423205839967465192e-01
++3.434114694865876838e-01 6.998268449671132263e-01 6.421043512357870187e-01
++3.408640318201912600e-01 6.958197818437616977e-01 6.418569321473704958e-01
++3.384068406811324148e-01 6.918087773726725453e-01 6.415785719753461791e-01
++3.360351011011302735e-01 6.877945827659479594e-01 6.412695960850323118e-01
++3.337441277691141628e-01 6.837779098758932639e-01 6.409304028912300444e-01
++3.315291322901112725e-01 6.797595093162658308e-01 6.405610222271946874e-01
++3.293855731203558790e-01 6.757400463409192204e-01 6.401618521317685717e-01
++3.273095072934468774e-01 6.717199943156246800e-01 6.397341828681051279e-01
++3.252967835603527980e-01 6.676999151191671533e-01 6.392786349130804568e-01
++3.233433949344308722e-01 6.636803359579184214e-01 6.387958727683986648e-01
++3.214454825944703664e-01 6.596617502568347113e-01 6.382866005148117861e-01
++3.195993388733257556e-01 6.556446185422359907e-01 6.377515576836865208e-01
++3.178014094235615539e-01 6.516293693095515094e-01 6.371915154212616228e-01
++3.160482946464280851e-01 6.476163998706647718e-01 6.366072729215248582e-01
++3.143367504654775990e-01 6.436060771766987099e-01 6.359996541044424800e-01
++3.126636885203824545e-01 6.395987386132337971e-01 6.353695045172913503e-01
++3.110261758511674857e-01 6.355946927658273626e-01 6.347176884379418516e-01
++3.094214341373541788e-01 6.315942201545601264e-01 6.340450861601970578e-01
++3.078468385510386152e-01 6.275975739369872297e-01 6.333525914425652825e-01
++3.062999162775806861e-01 6.236049805794583456e-01 6.326411091031564071e-01
++3.047783447524610168e-01 6.196166404972232034e-01 6.319115527447410896e-01
++3.032799496578738041e-01 6.156327286641396501e-01 6.311648425953061414e-01
++3.018027027180503197e-01 6.116533951930802626e-01 6.304019034507418739e-01
++3.003447193279823457e-01 6.076787658883653354e-01 6.296236627075371128e-01
++2.989042560461285802e-01 6.037089427717098333e-01 6.288310484745529561e-01
++2.974797079780254205e-01 5.997440045832753697e-01 6.280249877540684533e-01
++2.960696060742640245e-01 5.957840072594756675e-01 6.272064046833601969e-01
++2.946726143633343065e-01 5.918289843891730850e-01 6.263762188290394883e-01
++2.932875271368584058e-01 5.878789476499071132e-01 6.255353435272825724e-01
++2.919132661023912667e-01 5.839338872257091584e-01 6.246846842638799080e-01
++2.905488775167375803e-01 5.799937722079637759e-01 6.238251370887518688e-01
++2.891935293105973304e-01 5.760585509806988025e-01 6.229575870601862242e-01
++2.878465082138687570e-01 5.721281515915097593e-01 6.220829067145717817e-01
++2.865071747347951447e-01 5.682024945496734203e-01 6.212019079466474247e-01
++2.851749861947763254e-01 5.642814857106783766e-01 6.203153697409601319e-01
++2.838497050469647731e-01 5.603649539888247988e-01 6.194242689076802089e-01
++2.825310677598035780e-01 5.564527485481920444e-01 6.185294158631611250e-01
++2.812189151446758406e-01 5.525446999518639490e-01 6.176316008625786225e-01
++2.799131896111074491e-01 5.486406204645675189e-01 6.167315925457064196e-01
++2.786139324558262742e-01 5.447403043452749838e-01 6.158301364812402978e-01
++2.773212811865227168e-01 5.408435281299215358e-01 6.149279537054621603e-01
++2.760354668808263079e-01 5.369500509042623992e-01 6.140257392505246159e-01
++2.747568115804877587e-01 5.330596145668072827e-01 6.131241606570347891e-01
++2.734857257205313141e-01 5.291719440816851083e-01 6.122238564648385672e-01
++2.722227055926091377e-01 5.252867477212617153e-01 6.113254346750160995e-01
++2.709683308416185876e-01 5.214037172983150281e-01 6.104294711750373192e-01
++2.697232619941725140e-01 5.175225283875982685e-01 6.095365081178055755e-01
++2.684882380171457750e-01 5.136428405367017280e-01 6.086470522439324515e-01
++2.672640739041831637e-01 5.097642974662250914e-01 6.077615731349965689e-01
++2.660516582874621339e-01 5.058865272594796902e-01 6.068805013837572648e-01
++2.648519510715739433e-01 5.020091425421505660e-01 6.060042266652778675e-01
++2.636659810857353015e-01 4.981317406526836744e-01 6.051330956906521008e-01
++2.624948437498288434e-01 4.942539038045714039e-01 6.042674100224807443e-01
++2.613396987489819967e-01 4.903751992421883643e-01 6.034074237284018372e-01
++2.602017811880152354e-01 4.864951750164123179e-01 6.025533553474511361e-01
++2.590825816132030779e-01 4.826133005480903182e-01 6.017055804809932074e-01
++2.579832374637801018e-01 4.787291639776031782e-01 6.008639770499764055e-01
++2.569051367797046126e-01 4.748422758923547815e-01 6.000285749995881712e-01
++2.558497193309375306e-01 4.709521329962904068e-01 5.991993407256713811e-01
++2.548184740794410263e-01 4.670582183399953347e-01 5.983761730113198452e-01
++2.538129365659009817e-01 4.631600015854966945e-01 5.975588985257048735e-01
++2.528346862021874641e-01 4.592569393176054171e-01 5.967472668238706923e-01
++2.518853434473967146e-01 4.553484754161292725e-01 5.959409447786497838e-01
++2.509665668417216944e-01 4.514340415062205181e-01 5.951395103673859932e-01
++2.500800498681828299e-01 4.475130575075850214e-01 5.943424457267542094e-01
++2.492275176071283571e-01 4.435849323073600692e-01 5.935491293785424283e-01
++2.484107231427581941e-01 4.396490645862106139e-01 5.927588275177814170e-01
++2.476314436738927260e-01 4.357048438328084417e-01 5.919706842419948378e-01
++2.468914762732849488e-01 4.317516515883728090e-01 5.911837105866416531e-01
++2.461926332303804310e-01 4.277888629705645096e-01 5.903967722170088139e-01
++2.455367369014649914e-01 4.238158485348740845e-01 5.896085756110598375e-01
++2.449256139784778408e-01 4.198319765418777605e-01 5.888176525512366366e-01
++2.443611399380560822e-01 4.158365980702596332e-01 5.880223891276964432e-01
++2.438461792188084676e-01 4.118287207942545325e-01 5.872218507211212080e-01
++2.433817108226277726e-01 4.078080077755985022e-01 5.864131553289283483e-01
++2.429695407602900925e-01 4.037738393736669540e-01 5.855939512690606641e-01
++2.426114394907277760e-01 3.997256137994158465e-01 5.847615988448080504e-01
++2.423091294682429564e-01 3.956627542073260506e-01 5.839131390484204598e-01
++2.420642707838099872e-01 3.915847171721096864e-01 5.830452587571144374e-01
++2.418784445905285962e-01 3.874910027793410650e-01 5.821542521747482546e-01
++2.417531339648231747e-01 3.833811665857123074e-01 5.812359783131098023e-01
++2.416897018162703636e-01 3.792548337300427064e-01 5.802858143751018494e-01
++2.416907565718227624e-01 3.751112253980636857e-01 5.792995847596160708e-01
++2.417595622535183009e-01 3.709493751547713325e-01 5.782729391945388153e-01
++2.418940089237943680e-01 3.667702659833258494e-01 5.771972660307567171e-01
++2.420946965383475313e-01 3.625739944720036134e-01 5.760653956197256953e-01
++2.423619198524908369e-01 3.583608468185064400e-01 5.748693688323588402e-01
++2.426978313653707087e-01 3.541305556383861908e-01 5.736016010478480753e-01
++2.431056167697961956e-01 3.498826161637011989e-01 5.722540340252517677e-01
++2.435790408918375727e-01 3.456199709880173332e-01 5.708127541670769967e-01
++2.441164681518231960e-01 3.413441041408621368e-01 5.692658625959313712e-01
++2.447220255685461088e-01 3.370546900675063240e-01 5.676029832475817383e-01
++2.453897790312707938e-01 3.327551263503047418e-01 5.658082210414479007e-01
++2.461121481740833894e-01 3.284495884603169102e-01 5.638648470620498676e-01
++2.468912126448456479e-01 3.241391993124722593e-01 5.617586120246663706e-01
++2.477157002362878613e-01 3.198299095156284522e-01 5.594704462476630669e-01
++2.485761162021524751e-01 3.155272777788998839e-01 5.569822129976372826e-01
++2.494682375867288693e-01 3.112353605277175528e-01 5.542766318947622839e-01
++2.503729202057394798e-01 3.069632816204772574e-01 5.513352372309007210e-01
++2.512817651002536290e-01 3.027167370222472731e-01 5.481422664464320471e-01
++2.521753740527091225e-01 2.985048904754492582e-01 5.446839245346258851e-01
++2.530378388279626023e-01 2.943355684042912035e-01 5.409499814033098541e-01
++2.538514672799476179e-01 2.902167617845944347e-01 5.369345375383627328e-01
++2.545978636988186494e-01 2.861560770732184955e-01 5.326370186681820273e-01
++2.552597334794323158e-01 2.821600341185547811e-01 5.280624026249696179e-01
++2.558254018044066047e-01 2.782328077909240194e-01 5.232189983935346955e-01
++2.562737222001675308e-01 2.743799915974786674e-01 5.181261586082565040e-01
++2.566051651711689918e-01 2.706008890121900934e-01 5.127963599343589030e-01
++2.568071232679735028e-01 2.668971447705413280e-01 5.072541841677337127e-01
++2.568729082739400482e-01 2.632680806498599591e-01 5.015251413221865073e-01
++2.568088786232387566e-01 2.597098435540172168e-01 4.956253550777797723e-01
++2.566151212870083631e-01 2.562195453869526296e-01 4.895770754997314511e-01
++2.562879598478859378e-01 2.527944349049762174e-01 4.834087259028412853e-01
++2.558322794870629413e-01 2.494300496133808887e-01 4.771399728195321877e-01
++2.552572079534596305e-01 2.461214417402471932e-01 4.707834286138410929e-01
++2.545675711557803811e-01 2.428643843006248471e-01 4.643557571030281772e-01
++2.537686502971923108e-01 2.396546885092911139e-01 4.578718126285494239e-01
++2.528659964243425984e-01 2.364882912834416206e-01 4.513446141213755536e-01
++2.518652755598765891e-01 2.333613180085921113e-01 4.447853910070804773e-01
++2.507721436866522935e-01 2.302701237479483076e-01 4.382036814126420432e-01
++2.495921493408267966e-01 2.272113165747541852e-01 4.316074651476269897e-01
++2.483306606950595463e-01 2.241817667402334346e-01 4.250033167249620547e-01
++2.469928136315570621e-01 2.211786051187170643e-01 4.183965667275956202e-01
++2.455817950644241798e-01 2.181991605590304917e-01 4.117955160707330586e-01
++2.440963016438912891e-01 2.152407079180826410e-01 4.052187485307188752e-01
++2.425474613143962510e-01 2.123011804696942062e-01 3.986531809377649171e-01
++2.409394174709658110e-01 2.093786088479052676e-01 3.921004515047561423e-01
++2.392760085101002243e-01 2.064712127546999287e-01 3.855616338648150121e-01
++2.375559510487991743e-01 2.035768990151702318e-01 3.790513023869773179e-01
++2.357791582066215419e-01 2.006936504843463420e-01 3.725810406048237766e-01
++2.339566833930070699e-01 1.978208439176197264e-01 3.661282774694271658e-01
++2.320913707908846546e-01 1.949572807641995476e-01 3.596924727656225507e-01
++2.301734316844865069e-01 1.921000566693645550e-01 3.533131710447778295e-01
++2.282155151615900546e-01 1.892493734782149939e-01 3.469585312854190362e-01
++2.262221013532286218e-01 1.864046213456004575e-01 3.406203233993785884e-01
++2.241821302892643142e-01 1.835626593748518609e-01 3.343431537784405938e-01
++2.221083620693462546e-01 1.807243380946543521e-01 3.280900612914751102e-01
++2.200027865362182422e-01 1.778889096627078448e-01 3.218593457818205161e-01
++2.178554139765243036e-01 1.750533261852178779e-01 3.156932341101472139e-01
++2.156819223383368844e-01 1.722195412332822306e-01 3.095395593647118360e-01
++2.134730781003147948e-01 1.693846918206770857e-01 3.034377234324792671e-01
++2.112350828916275125e-01 1.665490510713014960e-01 2.973690772834624574e-01
++2.089702734855372057e-01 1.637121940546225618e-01 2.913286801723345421e-01
++2.066728560428846562e-01 1.608719311731062473e-01 2.853437530392856081e-01
++2.043551063834350701e-01 1.580301135357929931e-01 2.793689192405632293e-01
++2.020028382233076125e-01 1.551826890051333785e-01 2.734655011163185101e-01
++1.996333580091984583e-01 1.523327614839000976e-01 2.675659276139747411e-01
++1.972319620276792862e-01 1.494761585027865047e-01 2.617344119314569673e-01
++1.948137533226730334e-01 1.466155558553730864e-01 2.559107021731873988e-01
++1.923665760685599468e-01 1.437473901381048913e-01 2.501489823140411461e-01
++1.899031789417767457e-01 1.408738040042367690e-01 2.443975812138057813e-01
++1.874125186315797886e-01 1.379915476831030108e-01 2.387062880680187460e-01
++1.849071752981109873e-01 1.351026683367795023e-01 2.330231779340583564e-01
++1.823751828761793481e-01 1.322038111876145949e-01 2.274020989868827392e-01
++1.798308834661569988e-01 1.292972741720705698e-01 2.217828373102059270e-01
++1.772595702951434704e-01 1.263792859047284667e-01 2.162309361702130506e-01
++1.746769766714075522e-01 1.234522307754042925e-01 2.106797904214151584e-01
++1.720703275074147443e-01 1.205129174047056828e-01 2.051860710532931176e-01
++1.694509066570421274e-01 1.175626362090423926e-01 1.997023294326863430e-01
++1.668117590877864764e-01 1.145994139402238821e-01 1.942594655847655616e-01
++1.641571774416621943e-01 1.116231764992316466e-01 1.888399155026514453e-01
++1.614878059346168959e-01 1.086331782717616379e-01 1.834416540200605461e-01
++1.587995102818766935e-01 1.056281331759973130e-01 1.780821476813713722e-01
++1.561019746507273376e-01 1.026082525875711138e-01 1.727215696232307918e-01]; 
++
++   case 'mat' 
++      RGB = [9.942936149611202312e-01 9.303277953232079733e-01 6.910969022498407721e-01
++9.938034737629607429e-01 9.248067799917484288e-01 6.856470896792071779e-01
++9.932915386396504731e-01 9.192993747690529904e-01 6.802308895677181555e-01
++9.927922245331627371e-01 9.137917294903226129e-01 6.748329403835298113e-01
++9.922937701498860674e-01 9.082882194233706796e-01 6.694590190525575579e-01
++9.917843550306121303e-01 9.027933977435592672e-01 6.641148019075449049e-01
++9.912962746539998315e-01 8.972938428980343772e-01 6.587860434151366906e-01
++9.907825925330567829e-01 8.918085346471608110e-01 6.534941055176841651e-01
++9.902949549053171596e-01 8.863158938146130650e-01 6.482161486636766057e-01
++9.897868190815676259e-01 8.808350065840212517e-01 6.429731121246738956e-01
++9.892857473867685547e-01 8.753541152485579957e-01 6.377529594546893499e-01
++9.887800796370288525e-01 8.698778821960219121e-01 6.325610007226144527e-01
++9.882646997282734658e-01 8.644083076900085372e-01 6.273995656371403884e-01
++9.877584964502673648e-01 8.589369989413550011e-01 6.222606017222616082e-01
++9.872280289134517384e-01 8.534782966339129473e-01 6.171585665698279266e-01
++9.867183884350317902e-01 8.480122040334344691e-01 6.120742768604477968e-01
++9.861766767190066618e-01 8.425618846460892764e-01 6.070302342911766402e-01
++9.856563017997251874e-01 8.371033300354000506e-01 6.020039838864913451e-01
++9.851070454224936102e-01 8.316588814371468352e-01 5.970165676525449605e-01
++9.845690242211674326e-01 8.262101763023093071e-01 5.920513492549713819e-01
++9.840096682146298734e-01 8.207718909127237339e-01 5.871217557569952117e-01
++9.834535848293927129e-01 8.153324961500217904e-01 5.822177451775890633e-01
++9.828817074848651414e-01 8.099006555998068402e-01 5.773470477348076058e-01
++9.823072425148250408e-01 8.044699893992296458e-01 5.725043678439867278e-01
++9.817205500240108185e-01 7.990448613324698801e-01 5.676935526547516320e-01
++9.811274651130897917e-01 7.936222997819741831e-01 5.629123141708799460e-01
++9.805237822250761903e-01 7.882041368744077126e-01 5.581623151179201381e-01
++9.799119019116716567e-01 7.827890166019746410e-01 5.534426550185235216e-01
++9.792891597791347769e-01 7.773780574795166043e-01 5.487543863553446810e-01
++9.786583517021393286e-01 7.719696800001862869e-01 5.440965033742034551e-01
++9.780145739702225116e-01 7.665661517278330450e-01 5.394708896034823287e-01
++9.773647283145959763e-01 7.611637891820339785e-01 5.348750765091280224e-01
++9.766980163585675667e-01 7.557679109997390565e-01 5.303130790083464552e-01
++9.760290252537030531e-01 7.503708130006796484e-01 5.257797515465254534e-01
++9.753375433133614214e-01 7.449828010040938642e-01 5.212823917018596376e-01
++9.746492807368433153e-01 7.395902023503717615e-01 5.168121142252199984e-01
++9.739312415395592337e-01 7.342102748450782812e-01 5.123804929986149892e-01
++9.732235441351503313e-01 7.288214038955377339e-01 5.079740009039053206e-01
++9.724836441494412176e-01 7.234462681298939879e-01 5.036071894033782304e-01
++9.717498445504565430e-01 7.180638747370174935e-01 4.992675340324776445e-01
++9.709912116410467364e-01 7.126909352035095679e-01 4.949654270232705655e-01
++9.702261620325377534e-01 7.073170976907954266e-01 4.906951514278061199e-01
++9.694484453171449134e-01 7.019455954348422511e-01 4.864590138179895606e-01
++9.686504017535663147e-01 6.965805969226914751e-01 4.822596297437949375e-01
++9.678531538881393059e-01 6.912098001765796251e-01 4.780909555078191597e-01
++9.670272977476158660e-01 6.858499112812684873e-01 4.739621016861336744e-01
++9.662030356838596790e-01 6.804831678592252464e-01 4.698646253054341027e-01
++9.653577621840926382e-01 6.751225363106635458e-01 4.658054627874114728e-01
++9.644956606754987449e-01 6.697653999656224544e-01 4.617837747090557943e-01
++9.636302007256901669e-01 6.644033993552483919e-01 4.577964421810854501e-01
++9.627382975013459854e-01 6.590502602174439506e-01 4.538500459526182973e-01
++9.618419029037778012e-01 6.536923650498338567e-01 4.499394348167297664e-01
++9.609293304705296412e-01 6.483365953124501369e-01 4.460681718992942080e-01
++9.599915754015638791e-01 6.429884241455728899e-01 4.422388634417756537e-01
++9.590555927894280908e-01 6.376305748866927248e-01 4.384459238793448344e-01
++9.580962561892508722e-01 6.322786777663680358e-01 4.346957499886874854e-01
++9.571138853949342495e-01 6.269324224641481536e-01 4.309887354294504314e-01
++9.561315297025726467e-01 6.215764963092997863e-01 4.273209635732272416e-01
++9.551250405128054455e-01 6.162263913356859080e-01 4.236980325915365997e-01
++9.540950546856811210e-01 6.108815734129118269e-01 4.201203681538954182e-01
++9.530626716897264705e-01 6.055275479248746207e-01 4.165851980241140895e-01
++9.520078397406573911e-01 6.001775213709300560e-01 4.130968208871531600e-01
++9.509298744158470873e-01 5.948318045431840728e-01 4.096560342134981103e-01
++9.498400194890849191e-01 5.894823244090308112e-01 4.062621760942275451e-01
++9.487347976692349638e-01 5.841311256224190895e-01 4.029168199567615405e-01
++9.476064491016543689e-01 5.787834319880815759e-01 3.996218296412110127e-01
++9.464553073333200617e-01 5.734388133376047136e-01 3.963780340202668340e-01
++9.452939757532162757e-01 5.680877777926379713e-01 3.931855149232086899e-01
++9.441119180634874875e-01 5.627376402983688131e-01 3.900463532360756713e-01
++9.429065439155045469e-01 5.573900694724827076e-01 3.869617715840133476e-01
++9.416779791961638058e-01 5.520447400757862999e-01 3.839328326459904850e-01
++9.404312902807343555e-01 5.466974929733746658e-01 3.809606687756254551e-01
++9.391670109637508812e-01 5.413475099598963336e-01 3.780467610439202097e-01
++9.378784499903906058e-01 5.359996531278976573e-01 3.751924384200013285e-01
++9.365655059652620018e-01 5.306537435419416138e-01 3.723989770682498146e-01
++9.352280123612883855e-01 5.253096443760549850e-01 3.696677100588824927e-01
++9.338657357609021492e-01 5.199672647340076725e-01 3.670000247302842578e-01
++9.324834513518638346e-01 5.146223341056469502e-01 3.643980039003675286e-01
++9.310764112648535207e-01 5.092783920261573227e-01 3.618628439391275986e-01
++9.296425700359164379e-01 5.039368520229430271e-01 3.593958605013685692e-01
++9.281814529069224440e-01 4.985978383651590851e-01 3.569985751712403399e-01
++9.266925163734759385e-01 4.932615377693159719e-01 3.546725399001493528e-01
++9.251751483021848355e-01 4.879282029910456120e-01 3.524193303048753223e-01
++9.236286685007274455e-01 4.825981562592266960e-01 3.502405381564949738e-01
++9.220523297832619036e-01 4.772717924986036864e-01 3.481377630517493160e-01
++9.204453195710341484e-01 4.719495822836188847e-01 3.461126032707011468e-01
++9.188067620643404210e-01 4.666320744633321582e-01 3.441666458384411431e-01
++9.171357210169962526e-01 4.613198983953663013e-01 3.423014558239780292e-01
++9.154312031382285664e-01 4.560137657258883093e-01 3.405185649261683878e-01
++9.136921621394280546e-01 4.507144716528461159e-01 3.388194594142976412e-01
++9.119175034344646491e-01 4.454228956112940563e-01 3.372055675093833527e-01
++9.101060894923883593e-01 4.401400013227078634e-01 3.356782463109665438e-01
++9.082567458304244834e-01 4.348668361548626016e-01 3.342387683926176800e-01
++9.063682676234201541e-01 4.296045297451883127e-01 3.328883082070119848e-01
++9.044394268935215253e-01 4.243542918485532223e-01 3.316279284576256203e-01
++9.024689802311073317e-01 4.191174093801583456e-01 3.304585666082093254e-01
++9.004556769853120368e-01 4.138952426354805536e-01 3.293810217125931472e-01
++8.983982678499889962e-01 4.086892206819806583e-01 3.283959417554291327e-01
++8.962955137593517918e-01 4.035008359311561543e-01 3.275038116986458414e-01
++8.941481104554649395e-01 3.983293983456084875e-01 3.267070561329722400e-01
++8.919536525149722728e-01 3.931778253066712803e-01 3.260048269152195366e-01
++8.897101199351982181e-01 3.880487567649602565e-01 3.253961697320843505e-01
++8.874163795567694413e-01 3.829439054205242554e-01 3.248807846244438635e-01
++8.850713585473568568e-01 3.778650063033766049e-01 3.244581619630766411e-01
++8.826755435924777959e-01 3.728118797277990004e-01 3.241299144458608672e-01
++8.802274289557096010e-01 3.677869127615048805e-01 3.238946418203613176e-01
++8.777249655021830410e-01 3.627933891756242590e-01 3.237493930733041925e-01
++8.751673985732256744e-01 3.578330531078428023e-01 3.236927558288430484e-01
++8.725555139394461923e-01 3.529055754992642124e-01 3.237261048951861064e-01
++8.698877548666956727e-01 3.480139364384642886e-01 3.238460395212981457e-01
++8.671629330678980452e-01 3.431608117920707524e-01 3.240490255671465425e-01
++8.643813155550574834e-01 3.383468700732272794e-01 3.243343280815126350e-01
++8.615430100192384977e-01 3.335730372253879472e-01 3.247007528957156497e-01
++8.586467469801843944e-01 3.288425164717434512e-01 3.251427866013465451e-01
++8.556930023091509074e-01 3.241559097884965657e-01 3.256590726700412941e-01
++8.526821206317460877e-01 3.195140519652634459e-01 3.262477399527137223e-01
++8.496135249080434271e-01 3.149194771604064691e-01 3.269031319055852869e-01
++8.464880691147448344e-01 3.103723490573296884e-01 3.276240607685041994e-01
++8.433059903582461603e-01 3.058739837233550030e-01 3.284066774658670473e-01
++8.400675201697129779e-01 3.014258630212182100e-01 3.292462412802209526e-01
++8.367737994501905918e-01 2.970277335155548926e-01 3.301419279880662416e-01
++8.334250817653976462e-01 2.926812202808505847e-01 3.310879308798391207e-01
++8.300223167271181257e-01 2.883865925403408248e-01 3.320815261966803544e-01
++8.265664528479066409e-01 2.841441353717970020e-01 3.331197789552536870e-01
++8.230582869411739999e-01 2.799545862699168719e-01 3.341980671944378423e-01
++8.194989991910379690e-01 2.758177426460852733e-01 3.353144156579274116e-01
++8.158895345625488682e-01 2.717340841090945536e-01 3.364643892127716640e-01
++8.122310472907531276e-01 2.677035350490168386e-01 3.376451421817873721e-01
++8.085246874446361254e-01 2.637260312682816465e-01 3.388536188130562565e-01
++8.047716060121338222e-01 2.598015433395364782e-01 3.400863817867416095e-01
++8.009730135703670983e-01 2.559297758719957794e-01 3.413409259751189473e-01
++7.971300939112275774e-01 2.521105612652171368e-01 3.426140174094376434e-01
++7.932440533013958017e-01 2.483435687707094552e-01 3.439030220163640239e-01
++7.893160890135294538e-01 2.446284526280468330e-01 3.452052771464595993e-01
++7.853473877765537736e-01 2.409648192333603833e-01 3.465182972816244766e-01
++7.813391260814397388e-01 2.373522835108513029e-01 3.478394483472491694e-01
++7.772924488739767490e-01 2.337903640474600642e-01 3.491667244042649942e-01
++7.732084983091196406e-01 2.302786572731657100e-01 3.504975234338518764e-01
++7.690883651827444822e-01 2.268166676306541119e-01 3.518300145036632465e-01
++7.649331213342656088e-01 2.234039396519906795e-01 3.531621316810459876e-01
++7.607438261029081383e-01 2.200400345294166726e-01 3.544916653625779235e-01
++7.565214435019435024e-01 2.167244640001846911e-01 3.558173116773682421e-01
++7.522670051172567485e-01 2.134568325306841485e-01 3.571365659018996275e-01
++7.479813874637180060e-01 2.102366867865238520e-01 3.584483801868486030e-01
++7.436655059621508634e-01 2.070636399021255625e-01 3.597509060488300325e-01
++7.393202434785964838e-01 2.039373173302497233e-01 3.610423849932817841e-01
++7.349463482724380992e-01 2.008573725915569486e-01 3.623219106278985358e-01
++7.305447136853985279e-01 1.978234802458921360e-01 3.635871804824805653e-01
++7.261159828724578214e-01 1.948353685346151387e-01 3.648375781480875379e-01
++7.216608959662019762e-01 1.918927853792166127e-01 3.660715129191122186e-01
++7.171801670483409774e-01 1.889955002148961394e-01 3.672874263418225982e-01
++7.126743300531552805e-01 1.861433788319636073e-01 3.684846837309949108e-01
++7.081441223914051175e-01 1.833362215388179839e-01 3.696612595209343710e-01
++7.035900061356136215e-01 1.805739799909275023e-01 3.708165722616917348e-01
++6.990125222046897902e-01 1.778565964180273684e-01 3.719494030784631367e-01
++6.944122804123707970e-01 1.751839824866724127e-01 3.730580800830735622e-01
++6.897896069146784992e-01 1.725562544195547443e-01 3.741422132560422997e-01
++6.851450759297335047e-01 1.699733803139570343e-01 3.752000809033200213e-01
++6.804790620490438480e-01 1.674354838987148208e-01 3.762308077572429355e-01
++6.757918752796293616e-01 1.649427652357627616e-01 3.772336599439788940e-01
++6.710841190288990843e-01 1.624951923227635209e-01 3.782065903997158807e-01
++6.663559221262009835e-01 1.600931455660249692e-01 3.791494395940231965e-01
++6.616076837858697601e-01 1.577367904785384745e-01 3.800608417430486607e-01
++6.568398281175149567e-01 1.554262673949660112e-01 3.809393122355112515e-01
++6.520524648278914759e-01 1.531620260338200923e-01 3.817844598609113071e-01
++6.472460502131879290e-01 1.509441834093387669e-01 3.825945806932325444e-01
++6.424208086222070735e-01 1.487730846896873349e-01 3.833687631504908433e-01
++6.375768667154826375e-01 1.466491860640934397e-01 3.841063458261376740e-01
++6.327147719614083510e-01 1.445724818775720732e-01 3.848052877974663111e-01
++6.278345360543612363e-01 1.425435417995506715e-01 3.854652342077181104e-01
++6.229363449371848604e-01 1.405627442689544315e-01 3.860852182514847852e-01
++6.180208267587814497e-01 1.386299275595349323e-01 3.866630046493146899e-01
++6.130878172636732293e-01 1.367458410848005068e-01 3.871986373954375282e-01
++6.081376300127646628e-01 1.349106539902725221e-01 3.876907660008953038e-01
++6.031708343692542273e-01 1.331241752511138077e-01 3.881374204452801013e-01
++5.981872594198538451e-01 1.313871076769131119e-01 3.885385758335542783e-01
++5.931872993271581906e-01 1.296994119208923768e-01 3.888927420384044042e-01
++5.881715194167826954e-01 1.280607661499650052e-01 3.891980996789912162e-01
++5.831397292746328676e-01 1.264718001616958465e-01 3.894546477166113685e-01
++5.780923809284296278e-01 1.249322477491876249e-01 3.896608882675748342e-01
++5.730301484941315859e-01 1.234414650841386962e-01 3.898149438393606059e-01
++5.679527785339369972e-01 1.220000281824430710e-01 3.899169825800337663e-01
++5.628606992123619257e-01 1.206075179177948653e-01 3.899657247446918218e-01
++5.577549128735556083e-01 1.192626131188577743e-01 3.899588733885684388e-01
++5.526350045348186191e-01 1.179659461688005728e-01 3.898969895870120772e-01
++5.475013145908723677e-01 1.167170132781017999e-01 3.897791516609607765e-01
++5.423552229242829537e-01 1.155136939391362971e-01 3.896026927627281311e-01
++5.371963110518728213e-01 1.143564329775472455e-01 3.893682721938278024e-01
++5.320248625085529648e-01 1.132445825251853777e-01 3.890752921818558807e-01
++5.268418790923193873e-01 1.121763322989662304e-01 3.887220732362928199e-01
++5.216480344214139420e-01 1.111502746625857019e-01 3.883076350820581779e-01
++5.164430850451627864e-01 1.101663332257847294e-01 3.878324664548168932e-01
++5.112275102681053118e-01 1.092232673876926685e-01 3.872959651352503863e-01
++5.060029073959358970e-01 1.083180273650512782e-01 3.866960834588916152e-01
++5.007692304925555060e-01 1.074500336043514026e-01 3.860332364294135066e-01
++4.955265944792267008e-01 1.066184092659498428e-01 3.853076049214476662e-01
++4.902755524910634155e-01 1.058215397414334347e-01 3.845188368245686661e-01
++4.850176459901380244e-01 1.050561979453382144e-01 3.836654992000479436e-01
++4.797532909040905236e-01 1.043208730187463462e-01 3.827476922012114091e-01
++4.744823785889252243e-01 1.036148463575309320e-01 3.817661365680148355e-01
++4.692055171112920475e-01 1.029362343090417242e-01 3.807207588669155873e-01
++4.639233255037821801e-01 1.022831037225876705e-01 3.796115541526619008e-01
++4.586377341242697248e-01 1.016514176559336347e-01 3.784373263419291700e-01
++4.533486056644123185e-01 1.010403969450098804e-01 3.771990792167705386e-01
++4.480561070398016432e-01 1.004487677966155457e-01 3.758974928385367953e-01
++4.427608762820601784e-01 9.987450133495995308e-02 3.745328419993724234e-01
++4.374635532679027050e-01 9.931556251859710582e-02 3.731054660236349796e-01
++4.321647778868571432e-01 9.876991822512792840e-02 3.716157670899542520e-01
++4.268658599998730319e-01 9.823449013050672418e-02 3.700637078536853086e-01
++4.215676735765455097e-01 9.770690573986753891e-02 3.684497084664269395e-01
++4.162699168504104819e-01 9.718665004270135577e-02 3.667750666255454317e-01
++4.109731987208080639e-01 9.667179308527124038e-02 3.650404160810349907e-01
++4.056781184785120398e-01 9.616044175324228727e-02 3.632464399813756240e-01
++4.003852641200214557e-01 9.565074509543119996e-02 3.613938677771775798e-01
++3.950952107257716950e-01 9.514089908082037916e-02 3.594834719896101149e-01
++3.898085189133677075e-01 9.462915077538672226e-02 3.575160648711968037e-01
++3.845257333758309581e-01 9.411380193352703039e-02 3.554924949866632988e-01
++3.792473815136121473e-01 9.359321200643175298e-02 3.534136437413167853e-01
++3.739739721678181361e-01 9.306580057655630678e-02 3.512804218838474490e-01
++3.687059944607640194e-01 9.253004923332719400e-02 3.490937660095801975e-01
++3.634439167485821742e-01 9.198450291035600856e-02 3.468546350890427399e-01
++3.581881856892511484e-01 9.142777070873894796e-02 3.445640070453340198e-01
++3.529392254280559471e-01 9.085852623447668308e-02 3.422228754021731101e-01
++3.476974369011708865e-01 9.027550748073234765e-02 3.398322460227614084e-01
++3.424631972568040195e-01 8.967751628755202264e-02 3.373931339577017074e-01
++3.372368593921474811e-01 8.906341741289613978e-02 3.349065604182628331e-01
++3.320187516032832020e-01 8.843213724940904297e-02 3.323735498892629314e-01
++3.268091773441717529e-01 8.778266222136388297e-02 3.297951273938287686e-01
++3.216084150899517491e-01 8.711403689571997622e-02 3.271723159202782338e-01
++3.164167182989683913e-01 8.642536184028648538e-02 3.245061340194448363e-01
++3.112343154672587153e-01 8.571579126067202514e-02 3.217975935788711661e-01
++3.060614102686342042e-01 8.498453044606019136e-02 3.190476977785482449e-01
++3.008981817730306263e-01 8.423083305194795090e-02 3.162574392312175187e-01
++2.957447847354051640e-01 8.345399824589613824e-02 3.134277983087430108e-01
++2.906013499472219208e-01 8.265336774002721154e-02 3.105597416546946876e-01
++2.854679846423482936e-01 8.182832273165288606e-02 3.076542208820723934e-01
++2.803477329331294232e-01 8.097431979192776241e-02 3.047120362305891783e-01
++2.752380681858879186e-01 8.009433346301736423e-02 3.017343316299965217e-01
++2.701389341759609652e-01 7.918798082745703848e-02 2.987220235093637766e-01
++2.650503484302856316e-01 7.825477700181371343e-02 2.956760032243300196e-01
++2.599723067663477494e-01 7.729426121855428877e-02 2.925971426566268407e-01
++2.549047838884308526e-01 7.630599343423161152e-02 2.894862939132400448e-01
++2.498493147092451516e-01 7.528752506190716787e-02 2.863443687052725228e-01
++2.448074110283037785e-01 7.423648337865965119e-02 2.831723508316192905e-01
++2.397761080979832760e-01 7.315619369923848092e-02 2.799709378403843485e-01
++2.347552980534894362e-01 7.204627593897616755e-02 2.767409087277542534e-01
++2.297448542911243452e-01 7.090635374932227619e-02 2.734830227534650882e-01
++2.247460435545195478e-01 6.973430487024689928e-02 2.701981884636781017e-01
++2.197617914493367186e-01 6.852599251980440176e-02 2.668875888727837431e-01
++2.147876871428340828e-01 6.728630515821912295e-02 2.635514822299450111e-01
++2.098235281541684927e-01 6.601485651366462148e-02 2.601905585020159450e-01
++2.048690954628696881e-01 6.471124480576789795e-02 2.568054914489818485e-01
++1.999302337340111424e-01 6.336777961956377436e-02 2.533980282310328569e-01
++1.950016002461211762e-01 6.199020593164828591e-02 2.499680455203335816e-01
++1.900821894571196047e-01 6.057894133574073109e-02 2.465160535124999996e-01
++1.851717128353368158e-01 5.913348735199071976e-02 2.430426744218359136e-01];
++
++   case 'alg'
++      RGB = [8.429022637670927631e-01 9.769128443086748659e-01 8.146495714674897304e-01
++8.379898654100343958e-01 9.732407342044756549e-01 8.088430556678033456e-01
++8.330792003033266058e-01 9.695822214541992556e-01 8.030532648620265501e-01
++8.281700574948731575e-01 9.659372187629376993e-01 7.972802422761141594e-01
++8.232591263824388106e-01 9.623071583180456967e-01 7.915177499867750432e-01
++8.183491723383330418e-01 9.586904682961984170e-01 7.857720506350698297e-01
++8.134400361234097598e-01 9.550870346415619716e-01 7.800433040617480440e-01
++8.085287334688994187e-01 9.514980955891142456e-01 7.743261813916382241e-01
++8.036173420648491383e-01 9.479224436104144447e-01 7.686253533397395810e-01
++7.987060409170214648e-01 9.443598003220095016e-01 7.629416545120045745e-01
++7.937925122347354590e-01 9.408110588423104215e-01 7.572712382873506565e-01
++7.888774721308737803e-01 9.372756747279427092e-01 7.516160461408240012e-01
++7.839617672758154576e-01 9.337530574201664546e-01 7.459781551153893409e-01
++7.790441380861869991e-01 9.302435915337518013e-01 7.403557861728765621e-01
++7.741231638352710220e-01 9.267477183327949009e-01 7.347469917710997001e-01
++7.692007373711554630e-01 9.232643756857683570e-01 7.291556698393132363e-01
++7.642766080322838107e-01 9.197934849334901131e-01 7.235818576277038838e-01
++7.593478268473826676e-01 9.163361556599034508e-01 7.180210830197953920e-01
++7.544162681443719043e-01 9.128913482866579665e-01 7.124771068936172069e-01
++7.494821658995169944e-01 9.094587642780913583e-01 7.069508171108205286e-01
++7.445446445348200548e-01 9.060385878865820919e-01 7.014412864903698530e-01
++7.396014349798241128e-01 9.026315871837650162e-01 6.959454639490867400e-01
++7.346547940498792117e-01 8.992365867115311717e-01 6.904675150024160990e-01
++7.297044319156630321e-01 8.958535131435325649e-01 6.850074822882207259e-01
++7.247490312042899063e-01 8.924827183233180472e-01 6.795638773235905816e-01
++7.197871536503424039e-01 8.891245874731169563e-01 6.741351421211713157e-01
++7.148205906315451275e-01 8.857781679670407859e-01 6.687245323963695309e-01
++7.098490222489788337e-01 8.824433898084057537e-01 6.633320978710508520e-01
++7.048715598638584101e-01 8.791204089748886341e-01 6.579571019276890809e-01
++6.998858807424097606e-01 8.758099421807559182e-01 6.525968888447420957e-01
++6.948941393454671767e-01 8.725109084606608167e-01 6.472550946180131159e-01
++6.898959788510803381e-01 8.692232412884600690e-01 6.419317800561787912e-01
++6.848910317118895863e-01 8.659468751996841629e-01 6.366270089015387823e-01
++6.798769490247473790e-01 8.626825033431277934e-01 6.313382981547220885e-01
++6.748542718513756977e-01 8.594296871845804597e-01 6.260670342676678546e-01
++6.698236059410382914e-01 8.561879728828601932e-01 6.208146206652157550e-01
++6.647845365512859983e-01 8.529572984927470403e-01 6.155811388293935815e-01
++6.597366350463846896e-01 8.497376032066983331e-01 6.103666749315915796e-01
++6.546778498073401176e-01 8.465294186026240952e-01 6.051694131498632778e-01
++6.496081377794251654e-01 8.433325185775547572e-01 5.999900369339508099e-01
++6.445282101635998462e-01 8.401464057748564418e-01 5.948300803069692666e-01
++6.394375788791967219e-01 8.369710226136972686e-01 5.896896565661723377e-01
++6.343357381511850468e-01 8.338063126244976697e-01 5.845688863102624921e-01
++6.292221635729954299e-01 8.306522204479636073e-01 5.794678980553558123e-01
++6.240950633957039750e-01 8.275091254279797193e-01 5.743855059995368606e-01
++6.189539477625067843e-01 8.243769361676358542e-01 5.693220109772474391e-01
++6.137994351057367570e-01 8.212551782044565929e-01 5.642788688985792556e-01
++6.086309233573077293e-01 8.181437984076060932e-01 5.592562516207922885e-01
++6.034477870757418705e-01 8.150427445292480755e-01 5.542543429870632199e-01
++5.982493762730075604e-01 8.119519651518264380e-01 5.492733398149425295e-01
++5.930350151926494506e-01 8.088714096235919415e-01 5.443134529660692555e-01
++5.878040010377325597e-01 8.058010279811619325e-01 5.393749085029397872e-01
++5.825556026472022975e-01 8.027407708577772860e-01 5.344579489389233995e-01
++5.772876663840377232e-01 7.996910315164064142e-01 5.295616097386441901e-01
++5.720007307801391327e-01 7.966513294788654109e-01 5.246873967172444031e-01
++5.666941554135628278e-01 7.936215585273497242e-01 5.198357685218710778e-01
++5.613670944828393905e-01 7.906016675911841096e-01 5.150070514423125134e-01
++5.560186672658552487e-01 7.875916053777574088e-01 5.102015958622602154e-01
++5.506479565076832783e-01 7.845913201632197520e-01 5.054197781680845880e-01
++5.452540067541281621e-01 7.816007595558720489e-01 5.006620028015225099e-01
++5.398358226320055797e-01 7.786198702294978569e-01 4.959287044657145205e-01
++5.343923670778303325e-01 7.756485976236309199e-01 4.912203504944597232e-01
++5.289225595174025241e-01 7.726868856074639025e-01 4.865374433949326005e-01
++5.234252739997397041e-01 7.697346761037856533e-01 4.818805235744546001e-01
++5.178993372898965664e-01 7.667919086690104802e-01 4.772501722621809717e-01
++5.123435269266533032e-01 7.638585200249727869e-01 4.726470146367432457e-01
++5.067565692524964582e-01 7.609344435378136984e-01 4.680717231709499715e-01
++5.011371374253174027e-01 7.580196086388175658e-01 4.635250212045694540e-01
++4.954838494233231860e-01 7.551139401816627794e-01 4.590076867559155782e-01
++4.897952660572904571e-01 7.522173577300403924e-01 4.545205565824696481e-01
++4.840681573071378696e-01 7.493302232220337977e-01 4.500635797773255287e-01
++4.783013360124501179e-01 7.464523294656015828e-01 4.456380221845723244e-01
++4.724940506024824516e-01 7.435833409938815697e-01 4.412454477696442501e-01
++4.666445818616462016e-01 7.407231498818752646e-01 4.368869875723455642e-01
++4.607511431720994755e-01 7.378716377692448036e-01 4.325638579641650772e-01
++4.548118791551377105e-01 7.350286745174200442e-01 4.282773665493129212e-01
++4.488246916697360978e-01 7.321941577075956609e-01 4.240288438198308585e-01
++4.427816707495262905e-01 7.293693063882581429e-01 4.198173776667764034e-01
++4.366861225292572590e-01 7.265526435148784712e-01 4.156470546985623349e-01
++4.305358706593315765e-01 7.237439753686812915e-01 4.115196426107185501e-01
++4.243286683688641259e-01 7.209430867475091764e-01 4.074370373866784134e-01
++4.180533691692684961e-01 7.181516616727471325e-01 4.033983548745580516e-01
++4.117152151566086937e-01 7.153676995586070175e-01 3.994086748894248862e-01
++4.053120447326638009e-01 7.125908305255362896e-01 3.954704830581987074e-01
++3.988310338161633051e-01 7.098228382481286403e-01 3.915835586978753668e-01
++3.922773504125326993e-01 7.070616628058336017e-01 3.877531715317056316e-01
++3.856453036392904488e-01 7.043074656954597668e-01 3.839816779215288745e-01
++3.789264219900637110e-01 7.015608428874934299e-01 3.802713204645660205e-01
++3.721249180146385394e-01 6.988198403254852753e-01 3.766273561291236249e-01
++3.652256292309092323e-01 6.960861432527269965e-01 3.730515342232093579e-01
++3.582353316782660446e-01 6.933572072574926137e-01 3.695499404331015203e-01
++3.511405088327756996e-01 6.906341612001636321e-01 3.661256768699447939e-01
++3.439420657842418572e-01 6.879154082481935273e-01 3.627843734908121065e-01
++3.366376245587633931e-01 6.851998988322398620e-01 3.595313212824273741e-01
++3.292131284244469436e-01 6.824884139177085363e-01 3.563714602024023459e-01
++3.216744583078648412e-01 6.797783170101999728e-01 3.533114882245381727e-01
++3.140172671350762723e-01 6.770686201449667152e-01 3.503575531959788325e-01
++3.062375560076174841e-01 6.743581777161754554e-01 3.475162179105460436e-01
++2.983302406892556213e-01 6.716458949569478198e-01 3.447945234485624288e-01
++2.903003733928296581e-01 6.689291557488895590e-01 3.421993121220623379e-01
++2.821497842888552321e-01 6.662058429849556651e-01 3.397373505300674279e-01
++2.738829008222237738e-01 6.634735172067438569e-01 3.374150438308454736e-01
++2.655071740281889081e-01 6.607294316207971141e-01 3.352380978850171278e-01
++2.570334211300853156e-01 6.579705722659228151e-01 3.332111341597794874e-01
++2.484760249031935930e-01 6.551937268253881230e-01 3.313372827145077970e-01
++2.398529309513116603e-01 6.523955825377709683e-01 3.296177905380952566e-01
++2.311841779376898609e-01 6.495729702230954583e-01 3.280520259104468539e-01
++2.224959725553208312e-01 6.467225401811796948e-01 3.266360450956267703e-01
++2.138146081063950210e-01 6.438414682793780486e-01 3.253637783252084081e-01
++2.051671661243615885e-01 6.409273967897467505e-01 3.242268145630948784e-01
++1.965805108315318850e-01 6.379785280095539024e-01 3.232146947371194456e-01
++1.880802465071397533e-01 6.349936851788878789e-01 3.223153652533572999e-01
++1.796913740541281890e-01 6.319722298814686168e-01 3.215149361924393712e-01
++1.714330705005376321e-01 6.289143429606669500e-01 3.208003886075819211e-01
++1.633223574014183166e-01 6.258206603139722102e-01 3.201583938437198018e-01
++1.553730387230779220e-01 6.226922583196569105e-01 3.195761743639152774e-01
++1.475958738836526396e-01 6.195305528827301789e-01 3.190418452926268023e-01
++1.399989467346693939e-01 6.163371978378411331e-01 3.185446364378627382e-01
++1.325881576814804952e-01 6.131139916341550311e-01 3.180750084472180883e-01
++1.253677831749437921e-01 6.098627973272553460e-01 3.176246802424351201e-01
++1.183415125249481503e-01 6.065854884488630638e-01 3.171858497741395500e-01
++1.115126074344926499e-01 6.032839586583695901e-01 3.167505890039074568e-01
++1.048819394515066727e-01 5.999599650973242992e-01 3.163157773881625778e-01
++9.845229630728663528e-02 5.966151576836506987e-01 3.158774289651596345e-01
++9.222723505152297108e-02 5.932511684885474201e-01 3.154305788787992171e-01
++8.620976681204781111e-02 5.898696713297170158e-01 3.149695047280966498e-01
++8.040588003861268152e-02 5.864717566016173222e-01 3.144963594445834287e-01
++7.481986998062370442e-02 5.830590393336594346e-01 3.140045327658092522e-01
++6.946029534260433902e-02 5.796325615836696032e-01 3.134943864901328370e-01
++6.433627993915527754e-02 5.761934589668912254e-01 3.129640951373787172e-01
++5.945721644433194647e-02 5.727428791151661924e-01 3.124113492075187293e-01
++5.483676528890226581e-02 5.692816942618841303e-01 3.118359557718813901e-01
++5.049036852106828649e-02 5.658107385911853582e-01 3.112374314935371089e-01
++4.642777154917742538e-02 5.623311839573432724e-01 3.106124662721929663e-01
++4.267873894906259319e-02 5.588431316231524670e-01 3.099653177208470112e-01
++3.923368215696795835e-02 5.553481890828847467e-01 3.092892996314257625e-01
++3.621581017331615415e-02 5.518464055245291267e-01 3.085882846661225365e-01
++3.367174260746116921e-02 5.483382191382968340e-01 3.078629031746034084e-01
++3.155357134880961562e-02 5.448249609075901390e-01 3.071084590117025281e-01
++2.984163194432063598e-02 5.413067537046710731e-01 3.063273483583937029e-01
++2.851433193286296089e-02 5.377838583018560437e-01 3.055207233916585885e-01
++2.754542481457317171e-02 5.342567759013212569e-01 3.046882377538095987e-01
++2.689570440508957244e-02 5.307265908415563782e-01 3.038266898313282116e-01
++2.655111347348209846e-02 5.271933424208224972e-01 3.029380668195990611e-01
++2.649479114279441189e-02 5.236572235511334217e-01 3.020233215230865298e-01
++2.670582470265941977e-02 5.201186270434556835e-01 3.010823500978198064e-01
++2.716440603849906016e-02 5.165779238412415708e-01 3.001150958048797168e-01
++2.785177445187870041e-02 5.130354641701924123e-01 2.991215440838268513e-01
++2.874507672231698188e-02 5.094917938725799234e-01 2.981008701035369746e-01
++2.982666070550293522e-02 5.059472607886396078e-01 2.970530677865693692e-01
++3.108771284944302979e-02 5.024018586614166226e-01 2.959794192966550552e-01
++3.251322799624088711e-02 4.988558619272636663e-01 2.948800270305382831e-01
++3.408899261646199802e-02 4.953095294092992318e-01 2.937550173740440806e-01
++3.580154506882658044e-02 4.917631050765793321e-01 2.926045381193648209e-01
++3.763813815230969417e-02 4.882168187516792712e-01 2.914287561365453416e-01
++3.958670383768114059e-02 4.846708867690439626e-01 2.902278552740369943e-01
++4.160606223970295808e-02 4.811255125865287474e-01 2.890020344652265427e-01
++4.364369199371629510e-02 4.775808873526497522e-01 2.877515060197786689e-01
++4.569661527765144643e-02 4.740371904320783147e-01 2.864764940804359616e-01
++4.775452753988133209e-02 4.704945898919368763e-01 2.851772332276043542e-01
++4.980869291606532939e-02 4.669532429514431926e-01 2.838539672156359384e-01
++5.185173623572528895e-02 4.634132963974310626e-01 2.825069478261687528e-01
++5.387745614388812082e-02 4.598748869682287022e-01 2.811364338252513306e-01
++5.588065991543698235e-02 4.563381417083428038e-01 2.797426900122344517e-01
++5.785701915204972262e-02 4.528031782963246044e-01 2.783259863495758379e-01
++5.979876706363549538e-02 4.492703547749640758e-01 2.768859613477449022e-01
++6.170040530833437870e-02 4.457399494079358759e-01 2.754224910913550817e-01
++6.356556527046725025e-02 4.422117069661303246e-01 2.739367706711952621e-01
++6.539233256679152784e-02 4.386857116546215574e-01 2.724290903132413622e-01
++6.717918154984042767e-02 4.351620395957427334e-01 2.708997417620619963e-01
++6.892491848697404611e-02 4.316407590421982854e-01 2.693490177429860299e-01
++7.062863315353248850e-02 4.281219305768591554e-01 2.677772114552923188e-01
++7.228965757688332605e-02 4.246056073010452958e-01 2.661846160919238424e-01
++7.389641781918890318e-02 4.210926586635973523e-01 2.645697649893180015e-01
++7.545434928417493747e-02 4.175827498520321979e-01 2.629338431200398118e-01
++7.696833442757364252e-02 4.140755522595082616e-01 2.612779353323396725e-01
++7.843838726966873010e-02 4.105710916270851607e-01 2.596023362544704338e-01
++7.986463095393955824e-02 4.070693869948522892e-01 2.579073383225120586e-01
++8.124183059024486786e-02 4.035709045576263421e-01 2.561923603053372633e-01
++8.256190184629638718e-02 4.000763929725326684e-01 2.544563479235497083e-01
++8.383876927413885793e-02 3.965847495529768452e-01 2.527017537470714892e-01
++8.507286345646175585e-02 3.930959685837552287e-01 2.509288633450958983e-01
++8.626466273198904466e-02 3.896100382985579480e-01 2.491379583258400143e-01
++8.739775523971837767e-02 3.861285039195596069e-01 2.473266151547285352e-01
++8.848513420336723279e-02 3.826502629618194207e-01 2.454971009362341139e-01
++8.953167205157094855e-02 3.791748988832845391e-01 2.436503732426347768e-01
++9.053797836732038751e-02 3.757023773832682267e-01 2.417867000353674523e-01
++9.148554097617969671e-02 3.722345634210443843e-01 2.399033173203807268e-01
++9.239032630846283345e-02 3.687699624551818989e-01 2.380029261610703828e-01
++9.325665476520708652e-02 3.653081665793141419e-01 2.360863630636709232e-01
++9.407947178296760526e-02 3.618497205076261491e-01 2.341529827160940824e-01
++9.484677589858042657e-02 3.583959460277540421e-01 2.322010660237076030e-01
++9.557752330564703303e-02 3.549448939617083076e-01 2.302337247418529409e-01
++9.627239441888107985e-02 3.514964944168565975e-01 2.282511932335974936e-01
++9.690948221035081134e-02 3.480532009152630946e-01 2.262502344543431132e-01
++9.750943240499498899e-02 3.446127832007709890e-01 2.242341737774653510e-01
++9.807545896746669434e-02 3.411748780303069384e-01 2.222036193428468254e-01
++9.858840445742730885e-02 3.377417205454144589e-01 2.201557955312036796e-01
++9.906254148928930747e-02 3.343117038364873950e-01 2.180929998845686502e-01
++9.950470237088998582e-02 3.308840188006390015e-01 2.160163648855405460e-01
++9.989442828501457483e-02 3.274611474658599142e-01 2.139229716850828411e-01
++1.002478051840671458e-01 3.240411780581063939e-01 2.118153315535568071e-01
++1.005711171338506127e-01 3.206233202298787721e-01 2.096944585359068469e-01
++1.008389569492894877e-01 3.172107795653626439e-01 2.075567848977897256e-01
++1.010766013830992904e-01 3.138003866895044958e-01 2.054060788674454963e-01
++1.012797610659880443e-01 3.103926683916618523e-01 2.032418103374508123e-01
++1.014336128495174072e-01 3.069895754355959072e-01 2.010620024754192769e-01
++1.015604574719611575e-01 3.035881742672912331e-01 1.988698806638831140e-01
++1.016439043068387282e-01 3.001906378105418383e-01 1.966632618336682237e-01
++1.016900146818882356e-01 2.967961587009928515e-01 1.944430867217927517e-01
++1.017093270307037889e-01 2.934032641989809398e-01 1.922108533595217328e-01
++1.016765444870794677e-01 2.900154576395235773e-01 1.899632762562097343e-01
++1.016196069311545991e-01 2.866288210415605109e-01 1.877041478451552947e-01
++1.015219485974463154e-01 2.832456655164396486e-01 1.854313688320031739e-01
++1.013890307775781596e-01 2.798651977505757227e-01 1.831457349733398854e-01
++1.012281681325793714e-01 2.764863132581988348e-01 1.808482324484150805e-01
++1.010210261960676481e-01 2.731116796865848406e-01 1.785366459436490416e-01
++1.007923256501605802e-01 2.697375956289435606e-01 1.762140933897481665e-01
++1.005175174628768486e-01 2.663676978648497062e-01 1.738776494133498218e-01
++1.002173006867299876e-01 2.629988175863644528e-01 1.715298624270491512e-01
++9.988042668340707531e-02 2.596326158562400344e-01 1.691694475105532114e-01
++9.951032875855422843e-02 2.562685171837931764e-01 1.667968626726523129e-01
++9.911165965335702599e-02 2.529057275734052368e-01 1.644126697900448464e-01
++9.867326641808749077e-02 2.495459516150641543e-01 1.620156747879235859e-01
++9.821309319240137392e-02 2.461862546952748865e-01 1.596078670948603284e-01
++9.770793688346479655e-02 2.428303047023268602e-01 1.571867977376794623e-01
++9.718522833757223256e-02 2.394735637952865592e-01 1.547553696066038820e-01
++9.661611889067361902e-02 2.361206836681891130e-01 1.523106424045232721e-01
++9.602890382911671852e-02 2.327668939738092857e-01 1.498554790261657776e-01
++9.539953637497836092e-02 2.294161153913850115e-01 1.473875249443533098e-01
++9.474917991081285851e-02 2.260646807246796119e-01 1.449088125658586357e-01
++9.405984876891312907e-02 2.227155420665202223e-01 1.424176598027472040e-01
++9.334764966575742617e-02 2.193658224428529091e-01 1.399155213806154985e-01
++9.259864172169812724e-02 2.160178161752643877e-01 1.374011522998845325e-01
++9.182582886012352619e-02 2.126691252719348779e-01 1.348756437215534176e-01
++9.101741805439966804e-02 2.093216946605545581e-01 1.323379906767623293e-01
++9.018514688041953664e-02 2.059732968223858540e-01 1.297890966546490499e-01
++8.931758876675888192e-02 2.026258321763433345e-01 1.272280374767779110e-01
++8.842693764273418244e-02 1.992769388914110706e-01 1.246556670387520271e-01
++8.750046390510707317e-02 1.959287732623697376e-01 1.220710201130164874e-01
++8.655243027600306727e-02 1.925785390204607095e-01 1.194750015988692016e-01
++8.556724308545121671e-02 1.892289432653286863e-01 1.168665204409958802e-01
++8.456273936118519075e-02 1.858764606951441301e-01 1.142465958957942507e-01
++8.351900544036733320e-02 1.825246377933723574e-01 1.116139631166048474e-01
++8.245885447713624528e-02 1.791689319540810954e-01 1.089697819472404405e-01
++8.135669872091313981e-02 1.758140104483569555e-01 1.063126024658284652e-01
++8.023864908973366017e-02 1.724546122292074379e-01 1.036435837789304870e-01
++7.908112723260085630e-02 1.690950585274078044e-01 1.009615075211427460e-01
++7.790439520871850210e-02 1.657311325223233545e-01 9.826708487284271931e-02
++7.669293821383046939e-02 1.623656063191788734e-01 9.555954478117026363e-02
++7.545752224924831553e-02 1.589960594221086487e-01 9.283909520333205601e-02
++7.419260617097681032e-02 1.556232855365611012e-01 9.010535811327979872e-02
++7.289843379575938753e-02 1.522469176001574609e-01 8.735814807810177163e-02
++7.158041455970551303e-02 1.488655123209624287e-01 8.459734502497687214e-02
++7.022733114464504989e-02 1.454810031009998728e-01 8.182251708486179553e-02
++6.885643403782271132e-02 1.420894601159049808e-01 7.903362825094448207e-02]; 
++
++   case 'den' 
++      RGB = [9.022021640633741679e-01 9.441797977915000750e-01 9.438027309131502562e-01
++8.954445384876381642e-01 9.409578903665054561e-01 9.410648759794842944e-01
++8.886855788874895579e-01 9.377403820634679921e-01 9.384098650760986926e-01
++8.819275100483495722e-01 9.345262546442011375e-01 9.358372814047579702e-01
++8.751724774625697645e-01 9.313145521613219735e-01 9.333465385891809296e-01
++8.684225465562396273e-01 9.281043788756372370e-01 9.309368983040341439e-01
++8.616797015669134252e-01 9.248948973050555855e-01 9.286074874996731454e-01
++8.549458444869071361e-01 9.216853262599870034e-01 9.263573151615366319e-01
++8.482227943572994144e-01 9.184749387758168737e-01 9.241852885114790750e-01
++8.415122870990738857e-01 9.152630598938195083e-01 9.220902285443438595e-01
++8.348159759916423672e-01 9.120490642716416740e-01 9.200708847923535494e-01
++8.281354328507813944e-01 9.088323736256948004e-01 9.181259492188009741e-01
++8.214721499137223049e-01 9.056124540224106401e-01 9.162540691578000551e-01
++8.148275424063925465e-01 9.023888130447765832e-01 9.144538592359539031e-01
++8.082029517444304645e-01 8.991609968660188024e-01 9.127239122325879750e-01
++8.015996493038702875e-01 8.959285872646755022e-01 9.110628088561002480e-01
++7.950188742001107478e-01 8.926911903474541443e-01 9.094690972400388818e-01
++7.884617893745216044e-01 8.894484461080551796e-01 9.079413399350437786e-01
++7.819294709222469608e-01 8.862000288332800846e-01 9.064781367807944745e-01
++7.754229463217646723e-01 8.829456358148736195e-01 9.050781031537078469e-01
++7.689431984424601740e-01 8.796849849240929720e-01 9.037398757679527828e-01
++7.624911712284807574e-01 8.764178119047121296e-01 9.024621162700895427e-01
++7.560677754202349554e-01 8.731438677954835859e-01 9.012435140344750018e-01
++7.496738942657009686e-01 8.698629164913183054e-01 9.000827882281617898e-01
++7.433103891809360597e-01 8.665747324492172332e-01 8.989786892140232410e-01
++7.369781053261772463e-01 8.632790985421132657e-01 8.979299993594229701e-01
++7.306778770702586634e-01 8.599758040613866283e-01 8.969355333152028154e-01
++7.244105333220340892e-01 8.566646428667109570e-01 8.959941378263615031e-01
++7.181769027125698424e-01 8.533454116802825506e-01 8.951046911317568355e-01
++7.119778186163850942e-01 8.500179085211370111e-01 8.942661020057923738e-01
++7.058142285268640403e-01 8.466819129479339345e-01 8.934771781429077242e-01
++6.996868754737947116e-01 8.433372425635760061e-01 8.927370216147950677e-01
++6.935966262281186845e-01 8.399836925869731408e-01 8.920446369253884900e-01
++6.875443783072674453e-01 8.366210531289836050e-01 8.913990435590287698e-01
++6.815310569542375463e-01 8.332491095447560614e-01 8.907992825434407624e-01
++6.755576190661271019e-01 8.298676415986731003e-01 8.902444142113377090e-01
++6.696250569512002260e-01 8.264764227239829175e-01 8.897335158509319664e-01
++6.637344019158556430e-01 8.230752193711802223e-01 8.892656792634947571e-01
++6.578867276821276366e-01 8.196637904396377738e-01 8.888400082431817673e-01
++6.520831536351689994e-01 8.162418867874922102e-01 8.884556159917510465e-01
++6.463248478988037338e-01 8.128092508153051954e-01 8.881116224784991742e-01
++6.406130302355731443e-01 8.093656161195516008e-01 8.878071517537653445e-01
++6.349489747657169891e-01 8.059107072125802906e-01 8.875413292226665973e-01
++6.293340124974293737e-01 8.024442393062223289e-01 8.873132788842952312e-01
++6.237695336583948258e-01 7.989659181568090629e-01 8.871221205404720145e-01
++6.182569898160699129e-01 7.954754399699002221e-01 8.869669669772310971e-01
++6.127978529026838483e-01 7.919724939438572697e-01 8.868470036964815062e-01
++6.073937143892588209e-01 7.884567552174953642e-01 8.867613059311603152e-01
++6.020462362204239692e-01 7.849278896215748924e-01 8.867089225926839680e-01
++5.967571335484213035e-01 7.813855546115021644e-01 8.866889106706612456e-01
++5.915281898823177009e-01 7.778293984625483937e-01 8.867003055015370006e-01
++5.863612575196054388e-01 7.742590605302298590e-01 8.867421178165009188e-01
++5.812582575983973321e-01 7.706741715732086107e-01 8.868133307743576443e-01
++5.762211797340099917e-01 7.670743541409147381e-01 8.869128969829140896e-01
++5.712520812007981785e-01 7.634592230284988901e-01 8.870397355132993988e-01
++5.663530856178774497e-01 7.598283858019500014e-01 8.871927289126763094e-01
++5.615263810949739920e-01 7.561814433965411419e-01 8.873707202219829338e-01
++5.567742177930775638e-01 7.525179907919229416e-01 8.875725100066919060e-01
++5.520989048532665144e-01 7.488376177673574663e-01 8.877968534100384446e-01
++5.475028066465008614e-01 7.451399097406838923e-01 8.880424572398104566e-01
++5.429883038774732107e-01 7.414244411965056347e-01 8.883081102246548344e-01
++5.385578037806126872e-01 7.376907727350942023e-01 8.885926739767254778e-01
++5.342139074650678054e-01 7.339384990781333551e-01 8.888943435724941944e-01
++5.299591516928192636e-01 7.301671976158840005e-01 8.892116013883853975e-01
++5.257960979209626018e-01 7.263764470411206986e-01 8.895428673545512366e-01
++5.217273234975481344e-01 7.225658287807643632e-01 8.898864965652431014e-01
++5.177554119038457747e-01 7.187349285333118898e-01 8.902407770595432979e-01
++5.138829420298184347e-01 7.148833379130644650e-01 8.906039278005388748e-01
++5.101124764807559719e-01 7.110106562012711295e-01 8.909740968830553998e-01
++5.064465489258500597e-01 7.071164922032951994e-01 8.913493600019622987e-01
++5.028876505140544850e-01 7.032004662097455228e-01 8.917277192147863296e-01
++4.994382152582386714e-01 6.992621674331673809e-01 8.921074350832908229e-01
++4.961006347215984325e-01 6.953012224940204877e-01 8.924864661543192579e-01
++4.928771955532800786e-01 6.913173542206699773e-01 8.928621485317782547e-01
++4.897700668589555772e-01 6.873102514205022828e-01 8.932321753875414050e-01
++4.867812943786045676e-01 6.832796259123631311e-01 8.935941653626673364e-01
++4.839127827295982009e-01 6.792252150037093594e-01 8.939456639464463672e-01
++4.811662774244846452e-01 6.751467840099739659e-01 8.942841454160184167e-01
++4.785433468471342322e-01 6.710441287994942661e-01 8.946070153685665716e-01
++4.760453643890875663e-01 6.669170783452496032e-01 8.949116138746746607e-01
++4.736736428294658352e-01 6.627653768113491717e-01 8.951957859716279664e-01
++4.714290262412598742e-01 6.585890168305761350e-01 8.954562723025643045e-01
++4.693121574935592011e-01 6.543879757664989860e-01 8.956900818434682110e-01
++4.673234528945732769e-01 6.501622438680934035e-01 8.958943277799077398e-01
++4.654630534005658737e-01 6.459118568983728270e-01 8.960660842179661856e-01
++4.637308126788352580e-01 6.416368981971656282e-01 8.962023935259622043e-01
++4.621262870085202645e-01 6.373375005637914592e-01 8.963002743257548754e-01
++4.606487857322991153e-01 6.330138155630400387e-01 8.963568414436460241e-01
++4.592973162762510886e-01 6.286660463835676005e-01 8.963691878774373567e-01
++4.580703339287382492e-01 6.242945769689846047e-01 8.963339924500021150e-01
++4.569661322748618804e-01 6.198997574323485971e-01 8.962482674873512023e-01
++4.559826907629682125e-01 6.154819930493959923e-01 8.961090514006179175e-01
++4.551176793504218554e-01 6.110417444047528956e-01 8.959134196000665407e-01
++4.543684658154031886e-01 6.065795271800727972e-01 8.956584955889488331e-01
++4.537321103072295414e-01 6.020959187639063348e-01 8.953414439077735931e-01
++4.532053056792195167e-01 5.975915899334859338e-01 8.949594061016020730e-01
++4.527845804849874312e-01 5.930672153918072897e-01 8.945097368602321630e-01
++4.524662055084718859e-01 5.885235252040261766e-01 8.939898705469653262e-01
++4.522462243009037208e-01 5.839612972830612314e-01 8.933973456284665104e-01
++4.521204742039108271e-01 5.793813548677185787e-01 8.927298144348156939e-01
++4.520846088132207119e-01 5.747845636677534342e-01 8.919850523005500298e-01
++4.521340640278729839e-01 5.701718535137081378e-01 8.911609204213972735e-01
++4.522636556547669495e-01 5.655443967339887079e-01 8.902550664458118712e-01
++4.524690821672368579e-01 5.609029696513448959e-01 8.892660746141660688e-01
++4.527455061379137002e-01 5.562485728577384325e-01 8.881923021329055645e-01
++4.530880320659124716e-01 5.515822303923638703e-01 8.870322627966300555e-01
++4.534917310405354729e-01 5.469049855617650335e-01 8.857846304506885593e-01
++4.539516647179116515e-01 5.422178966900855768e-01 8.844482413776627583e-01
++4.544629083695410077e-01 5.375220328430567740e-01 8.830220956021650469e-01
++4.550204443687518308e-01 5.328185230036192044e-01 8.815052933071011454e-01
++4.556185611092698484e-01 5.281088097066267695e-01 8.798967638851667994e-01
++4.562534204266542326e-01 5.233935859930700651e-01 8.781964868264527935e-01
++4.569203709084596610e-01 5.186739169401044514e-01 8.764041195297782583e-01
++4.576148706477833339e-01 5.139508576774439730e-01 8.745194730542404926e-01
++4.583325010790182952e-01 5.092254498718804534e-01 8.725425074817807491e-01
++4.590689790493137079e-01 5.044987184411230396e-01 8.704733265502938577e-01
++4.598201671313326133e-01 4.997716685175846441e-01 8.683121716406742019e-01
++4.605820822069772169e-01 4.950452826784434435e-01 8.660594152048119998e-01
++4.613509023726869995e-01 4.903205184540396222e-01 8.637155537234258995e-01
++4.621229722350553293e-01 4.855983061224402042e-01 8.612812002829223212e-01
++4.628948066804312034e-01 4.808795467939734336e-01 8.587570768592888149e-01
++4.636621617804746465e-01 4.761655004408036906e-01 8.561438461496413410e-01
++4.644228483348319947e-01 4.714566096078480206e-01 8.534426324219575033e-01
++4.651739386269664878e-01 4.667536635703780079e-01 8.506544391441875907e-01
++4.659126485884828583e-01 4.620574294334566789e-01 8.477803402103136765e-01
++4.666363628095652749e-01 4.573686402108441684e-01 8.448214774526084936e-01
++4.673426313321316639e-01 4.526879945693308982e-01 8.417790529251527598e-01
++4.680291657078233247e-01 4.480161567955825430e-01 8.386543213914651185e-01
++4.686938344285310198e-01 4.433537569692765912e-01 8.354485830591045215e-01
++4.693346578320167217e-01 4.387013913255956021e-01 8.321631765974399908e-01
++4.699498025791529199e-01 4.340596227897761117e-01 8.287994724682681280e-01
++4.705375757926853475e-01 4.294289816663295900e-01 8.253588665927664714e-01
++4.710964189403291091e-01 4.248099664657251084e-01 8.218427743723751844e-01
++4.716249015377835252e-01 4.202030448517347638e-01 8.182526250758133113e-01
++4.721217147398471536e-01 4.156086546932221681e-01 8.145898565994108553e-01
++4.725856648806062155e-01 4.110272052049120939e-01 8.108559106034937125e-01
++4.730156670165072685e-01 4.064590781625461724e-01 8.070522280235292722e-01
++4.734107385193607187e-01 4.019046291787961578e-01 8.031802449512829289e-01
++4.737699927598160721e-01 3.973641890273297284e-01 7.992413888782301523e-01
++4.740926329157582608e-01 3.928380650035104282e-01 7.952370752909331264e-01
++4.743779459344564242e-01 3.883265423112774450e-01 7.911687046060347228e-01
++4.746252966720311828e-01 3.838298854668622528e-01 7.870376594308572393e-01
++4.748341222291213026e-01 3.793483397110574140e-01 7.828453021343189100e-01
++4.750039264972926722e-01 3.748821324227855634e-01 7.785929727119723642e-01
++4.751342749269319987e-01 3.704314745277388354e-01 7.742819869283568135e-01
++4.752247895239137265e-01 3.659965618967846446e-01 7.699136347195338903e-01
++4.752751440794077964e-01 3.615775767297375043e-01 7.654891788385849161e-01
++4.752846577346016566e-01 3.571748688576533159e-01 7.610100397104845316e-01
++4.752531583445195884e-01 3.527885695695618384e-01 7.564774234071200976e-01
++4.751807975405666906e-01 3.484186721552497978e-01 7.518923528283415481e-01
++4.750674206653115461e-01 3.440653140404167365e-01 7.472559685686853692e-01
++4.749129042193905303e-01 3.397286256677667371e-01 7.425693796885003417e-01
++4.747171524182526858e-01 3.354087317676910929e-01 7.378336635067138660e-01
++4.744800939620510971e-01 3.311057526021228270e-01 7.330498655303070432e-01
++4.742016790105380575e-01 3.268198051821941674e-01 7.282189995072744226e-01
++4.738818763543148349e-01 3.225510044607445836e-01 7.233420475907058611e-01
++4.735206707734627707e-01 3.182994645010271961e-01 7.184199606025195584e-01
++4.731180605743212086e-01 3.140652996233325722e-01 7.134536583862346459e-01
++4.726740552951489982e-01 3.098486255314443216e-01 7.084440302390293542e-01
++4.721886735713431427e-01 3.056495604211318384e-01 7.033919354141809910e-01
++4.716613727297020442e-01 3.014684828248803128e-01 6.982986813805610593e-01
++4.710926963645384880e-01 2.973052870266812420e-01 6.931646771793222861e-01
++4.704828136289659901e-01 2.931600441838846383e-01 6.879905802658634606e-01
++4.698317639381846544e-01 2.890328918495519428e-01 6.827771264871377310e-01
++4.691395866583317198e-01 2.849239757466777712e-01 6.775250248474340431e-01
++4.684063197381936328e-01 2.808334508365700755e-01 6.722349583426855402e-01
++4.676319984415455155e-01 2.767614823885942155e-01 6.669075848245407112e-01
++4.668166541724163010e-01 2.727082470546194348e-01 6.615435378909206854e-01
++4.659603133859185342e-01 2.686739339515746283e-01 6.561434278004181220e-01
++4.650628643816827057e-01 2.646588038897796924e-01 6.507079958832593380e-01
++4.641242580497152992e-01 2.606631006122758221e-01 6.452378997676680994e-01
++4.631447877428095938e-01 2.566869305701654502e-01 6.397333527350717031e-01
++4.621244494694312643e-01 2.527305449360881529e-01 6.341948722101476976e-01
++4.610632293393826520e-01 2.487942133948352064e-01 6.286229575018943416e-01
++4.599611028558598380e-01 2.448782253548376642e-01 6.230180909006084455e-01
++4.588180342503813125e-01 2.409828911918876493e-01 6.173807387973655469e-01
++4.576339758554896497e-01 2.371085435285009702e-01 6.117113528277585699e-01
++4.564088675103588622e-01 2.332555385522245284e-01 6.060103710422047874e-01
++4.551426114844220883e-01 2.294242672454404608e-01 6.002782575500510420e-01
++4.538352109035017068e-01 2.256151009415963693e-01 5.945152849064858636e-01
++4.524865766439374881e-01 2.218284716492017750e-01 5.887218272221994564e-01
++4.510965881023942248e-01 2.180648477346619485e-01 5.828982757017970862e-01
++4.496651090864017264e-01 2.143247287775243981e-01 5.770450152504881247e-01
++4.481919873439485502e-01 2.106086471651167358e-01 5.711624259770210488e-01
++4.466770541000937844e-01 2.069171697362102713e-01 5.652508847626541710e-01
++4.451201235978615167e-01 2.032508994724643858e-01 5.593107669047254760e-01
++4.435210649059648236e-01 1.996104535682982628e-01 5.533422989220041499e-01
++4.418797550887742509e-01 1.959964848006353622e-01 5.473456323671032075e-01
++4.401958303868417355e-01 1.924097603751145913e-01 5.413213827196030614e-01
++4.384690252866834115e-01 1.888510510844303159e-01 5.352699392743940354e-01
++4.366990547337928352e-01 1.853211730457038908e-01 5.291917009058230148e-01
++4.348856137062026561e-01 1.818209895007495414e-01 5.230870785018020275e-01
++4.330283767917184612e-01 1.783514125901697334e-01 5.169564975681201213e-01
++4.311269977716754020e-01 1.749134050778043403e-01 5.108004010215621005e-01
++4.291811092153304252e-01 1.715079819968361174e-01 5.046192521919092844e-01
++4.271904344659923636e-01 1.681361967924985268e-01 4.984132106571174670e-01
++4.251546522673581574e-01 1.647991755952243342e-01 4.921824740309181379e-01
++4.230731286286127379e-01 1.614981359784699588e-01 4.859281380753826540e-01
++4.209454004136206628e-01 1.582343200442791198e-01 4.796507952549767251e-01
++4.187709818950797191e-01 1.550090272321758555e-01 4.733510791258234707e-01
++4.165493646911141434e-01 1.518236143519533232e-01 4.670296690947607909e-01
++4.142800178080069395e-01 1.486794951032471834e-01 4.606872955350938548e-01
++4.119623878145514673e-01 1.455781389789607694e-01 4.543247452773370720e-01
++4.095958991778662628e-01 1.425210694369028197e-01 4.479428674896456797e-01
++4.071799547953330878e-01 1.395098612110991787e-01 4.415425799574690391e-01
++4.047139367624922324e-01 1.365461366216895456e-01 4.351248757648299992e-01
++4.021972936019284628e-01 1.336316105494000928e-01 4.286903779176353124e-01
++3.996293630849273582e-01 1.307680150350410408e-01 4.222401836338272596e-01
++3.970093606178293211e-01 1.279570274853844003e-01 4.157761120045768699e-01
++3.943365976380542870e-01 1.252003942696350014e-01 4.092995513119635498e-01
++3.916103749033576498e-01 1.224998688123591362e-01 4.028120041341317625e-01
++3.888299858840064682e-01 1.198571984110099742e-01 3.963150954999720699e-01
++3.859947208059889556e-01 1.172741089547249538e-01 3.898105809973525515e-01
++3.831038714159066827e-01 1.147522874417901684e-01 3.833003546699703667e-01
++3.801567365353383798e-01 1.122933622374599760e-01 3.767864564999491295e-01
++3.771526284658990869e-01 1.098988810729940035e-01 3.702710792321893263e-01
++3.740908802950018708e-01 1.075702868621947472e-01 3.637565742534386581e-01
++3.709708541354928557e-01 1.053088915040240603e-01 3.572454561957943420e-01
++3.677919503089708275e-01 1.031158479486348478e-01 3.507404058933542013e-01
++3.645536174519507511e-01 1.009921209275927434e-01 3.442442712851704334e-01
++3.612553634855836804e-01 9.893845688361260771e-02 3.377600658314386384e-01
++3.578967673433453012e-01 9.695535377529579391e-02 3.312909639976103771e-01
++3.544774912975176551e-01 9.504303157033086591e-02 3.248402933678479765e-01
++3.509972936657820841e-01 9.320140436662560646e-02 3.184115229802063629e-01
++3.474560416161082133e-01 9.143005518316707492e-02 3.120082475359999274e-01
++3.438537237247893397e-01 8.972821452832538403e-02 3.056341672288407363e-01
++3.401904735486728781e-01 8.809468358171337887e-02 2.992931815755145442e-01
++3.364665724714709372e-01 8.652789261304066892e-02 2.929892038941975252e-01
++3.326824502647063309e-01 8.502592614588003195e-02 2.867260839053818455e-01
++3.288387024976534012e-01 8.358647051086640078e-02 2.805076847277695462e-01
++3.249360934730275985e-01 8.220683878873383255e-02 2.743378151941179288e-01
++3.209755584101655623e-01 8.088399100741089365e-02 2.682201871550352612e-01
++3.169582022236226426e-01 7.961456284429593855e-02 2.621583713198606391e-01
++3.128852946012805614e-01 7.839490235071094881e-02 2.561557528820557206e-01
++3.087582612248004899e-01 7.722111381434071387e-02 2.502154883125917717e-01
++3.045786711401687885e-01 7.608910749927882966e-02 2.443404647714875755e-01
++3.003482204670568367e-01 7.499465368295166190e-02 2.385332635717280492e-01
++2.960687128198414286e-01 7.393343917254721620e-02 2.327961290245241788e-01
++2.917420369856660312e-01 7.290112435224016529e-02 2.271309438018545013e-01
++2.873701425511966390e-01 7.189339879884681928e-02 2.215392116816457535e-01
++2.829550142767416343e-01 7.090603360902006380e-02 2.160220482113159313e-01
++2.784999277173711985e-01 6.993210653137302280e-02 2.105832735994622174e-01
++2.740068130913843047e-01 6.896804327168698512e-02 2.052225548327365479e-01
++2.694770905593398824e-01 6.801140076763184661e-02 1.999383122503714527e-01
++2.649127155611373241e-01 6.705861363954487842e-02 1.947301490341072916e-01
++2.603155555465970217e-01 6.610638194498252851e-02 1.895973275559961757e-01
++2.556873713350471533e-01 6.515168315524647036e-02 1.845388003264406274e-01
++2.510311382384792789e-01 6.418928564209233634e-02 1.795555007506528800e-01
++2.463515264850693609e-01 6.321115386076697762e-02 1.746505568409140452e-01
++2.416465428487372114e-01 6.222162722501616700e-02 1.698160042316500806e-01
++2.369174512696113344e-01 6.121879219616855466e-02 1.650498029374760922e-01
++2.321653556071113234e-01 6.020099184329732317e-02 1.603497740495725687e-01
++2.273975644358762205e-01 5.915624173942467950e-02 1.557218456563352615e-01
++2.226121431237116921e-01 5.808842465569693386e-02 1.511590815358170026e-01
++2.178074381899826051e-01 5.700049790743180050e-02 1.466558187034970040e-01
++2.129839422000848193e-01 5.589168645699472276e-02 1.422095068240733784e-01]; 
++
++   case 'bal' 
++      RGB = [9.317630180115785143e-02 1.111733294776027225e-01 2.615123885530547532e-01
++9.697151501690241815e-02 1.168702109792841837e-01 2.730963071061036085e-01
++1.009688451686782534e-01 1.223931506799195018e-01 2.849103610759459171e-01
++1.049927013864766501e-01 1.278243708004132007e-01 2.968738052891420898e-01
++1.089874020283561201e-01 1.331935038256579495e-01 3.089538370897204067e-01
++1.129223008178065757e-01 1.385131449459734432e-01 3.211528356563003173e-01
++1.167787372671460905e-01 1.437907235567953967e-01 3.334763137669404798e-01
++1.205463368759411846e-01 1.490330498991488395e-01 3.459192712822865556e-01
++1.242159653236002137e-01 1.542448960991174289e-01 3.584824902114073786e-01
++1.277778433781233958e-01 1.594292997650425259e-01 3.711737182907450250e-01
++1.312243830518974863e-01 1.645899274655008293e-01 3.839938980982077199e-01
++1.345490385720651272e-01 1.697307784244891371e-01 3.969402498465131601e-01
++1.377440294143187915e-01 1.748552489081271477e-01 4.100132193954066917e-01
++1.407996250839473606e-01 1.799660943911219058e-01 4.232173781877683894e-01
++1.437072840727513789e-01 1.850671827584920992e-01 4.365502201613832844e-01
++1.464560785040432134e-01 1.901619264187031366e-01 4.500130967746718835e-01
++1.490348239402249919e-01 1.952544786288682443e-01 4.636036238706138235e-01
++1.514309258266629821e-01 2.003493745808981319e-01 4.773185296806868871e-01
++1.536266468153191511e-01 2.054503782969492598e-01 4.911623505831314018e-01
++1.556073044691906326e-01 2.105638989188344801e-01 5.051241984185815825e-01
++1.573534941852142433e-01 2.156962129560367203e-01 5.191977165014443063e-01
++1.588411077773489166e-01 2.208540630983729658e-01 5.333780986311171812e-01
++1.600396310676128475e-01 2.260448054488821412e-01 5.476626851250718797e-01
++1.609205321230856855e-01 2.312792188936386995e-01 5.620307968352061812e-01
++1.614455266589641669e-01 2.365687572657042548e-01 5.764661948566720540e-01
++1.615687582201552897e-01 2.419271731798259828e-01 5.909472809712390529e-01
++1.612352769386722617e-01 2.473711867632350236e-01 6.054446786315181850e-01
++1.603793369556453796e-01 2.529213001868846900e-01 6.199179403497330210e-01
++1.589165703217830516e-01 2.586022090180682964e-01 6.343183928801525706e-01
++1.567387388150081051e-01 2.644444177118183137e-01 6.485832602021305293e-01
++1.537422741701028883e-01 2.704875236386605764e-01 6.625942914402649375e-01
++1.497539850217274870e-01 2.767772906869140348e-01 6.762428866538948702e-01
++1.446190280141932405e-01 2.833703371099008383e-01 6.893303155405390292e-01
++1.381506719438430897e-01 2.903290266080994497e-01 7.016166706228140759e-01
++1.301937481102784511e-01 2.977137475582261605e-01 7.127928058673724809e-01
++1.207056294812082625e-01 3.055623316038361126e-01 7.225101391519437311e-01
++1.098226938414934850e-01 3.138651882979107688e-01 7.304694442052537262e-01
++9.795843445627248902e-02 3.225431024585883599e-01 7.365271649499161022e-01
++8.570023827886968926e-02 3.314661612751826358e-01 7.407718073497575606e-01
++7.367688675533522191e-02 3.404967458048910878e-01 7.434693436710165804e-01
++6.252232597310111717e-02 3.495197377754474255e-01 7.449562973790243570e-01
++5.283258403911513662e-02 3.584600781237165523e-01 7.455451847703780111e-01
++4.520938539971628561e-02 3.672749347230809258e-01 7.454889092261348660e-01
++4.023631323597558207e-02 3.759418522020857023e-01 7.449841371058433248e-01
++3.831576485736640919e-02 3.844536826035842014e-01 7.441746283479093726e-01
++3.948349528027724625e-02 3.928137536670130436e-01 7.431581338661337188e-01
++4.345843888396401511e-02 4.010237097170425424e-01 7.420243047032398787e-01
++4.962431895510652918e-02 4.090953160508887798e-01 7.408166831290733390e-01
++5.739800117053886486e-02 4.170346954168047682e-01 7.395877539875740370e-01
++6.626017539288729663e-02 4.248521500099918247e-01 7.383650122111450331e-01
++7.582789138192139178e-02 4.325572249230948407e-01 7.371697936237424642e-01
++8.583710398799437868e-02 4.401583433039914506e-01 7.360206802189788178e-01
++9.611023898027164225e-02 4.476635745571445613e-01 7.349312516211791158e-01
++1.065303883460570755e-01 4.550804241299538089e-01 7.339117735870001047e-01
++1.170216465020320479e-01 4.624159111924117660e-01 7.329693696980987827e-01
++1.275357983203295742e-01 4.696767197731893662e-01 7.321074968220891988e-01
++1.380432121650685962e-01 4.768686794858796318e-01 7.313295149248254523e-01
++1.485266661140711986e-01 4.839970747487774561e-01 7.306374469250058734e-01
++1.589774367328510296e-01 4.910666599003393196e-01 7.300322634722052895e-01
++1.693927097070233589e-01 4.980816767007848478e-01 7.295140990156090410e-01
++1.797738575018875684e-01 5.050458714090990675e-01 7.290824177866462863e-01
++1.901252883653588299e-01 5.119625097219066001e-01 7.287361439246872186e-01
++2.004536741991692628e-01 5.188343886055641896e-01 7.284737667569484154e-01
++2.107674308545827713e-01 5.256638445778923918e-01 7.282934299212738827e-01
++2.210763664417479957e-01 5.324527583974503209e-01 7.281930113726282627e-01
++2.313914398990180310e-01 5.392025564688637251e-01 7.281702001646749300e-01
++2.417245888287989919e-01 5.459142096302009861e-01 7.282225751002735503e-01
++2.520885959217774586e-01 5.525882304010224511e-01 7.283476897674903139e-01
++2.624969693582706598e-01 5.592246702775622857e-01 7.285431679898072277e-01
++2.729638158446638374e-01 5.658231192947545951e-01 7.288068131774058100e-01
++2.835036864649327915e-01 5.723827108458280355e-01 7.291367343046032401e-01
++2.941313761905648416e-01 5.789021356407471064e-01 7.295314900628433463e-01
++3.048616586033888742e-01 5.853796696249742304e-01 7.299902509334000866e-01
++3.157089391891977348e-01 5.918132215225327952e-01 7.305129762764809298e-01
++3.266868146870496870e-01 5.982004061606387424e-01 7.311005998876300982e-01
++3.378075337747806772e-01 6.045386495071959354e-01 7.317552128195412564e-01
++3.490818000871770965e-01 6.108253115449155946e-01 7.324796800093837934e-01
++3.605169723334935572e-01 6.170578982409773428e-01 7.332792190500567742e-01
++3.721163789840524760e-01 6.232343167456089184e-01 7.341612307067191256e-01
++3.838798790902256397e-01 6.293530561660979350e-01 7.351337469132933622e-01
++3.958028137607393915e-01 6.354134382185918639e-01 7.362060213183361235e-01
++4.078755353103907799e-01 6.414158575290970221e-01 7.373884640869047269e-01
++4.200825599604326444e-01 6.473620651543986471e-01 7.386930839012650907e-01
++4.324066537782813580e-01 6.532548504780409937e-01 7.401294470548486215e-01
++4.448270147115060968e-01 6.590982595876608841e-01 7.417069328868316491e-01
++4.573210929073768805e-01 6.648973878622411737e-01 7.434335263117878290e-01
++4.698658823662555939e-01 6.706581495075844002e-01 7.453153847182404368e-01
++4.824391638200489774e-01 6.763869948243975694e-01 7.473565606883062484e-01
++4.950205546820442004e-01 6.820906132919950515e-01 7.495589040396917202e-01
++5.075922656244505893e-01 6.877756591216436233e-01 7.519221394187723950e-01
++5.201395209800695474e-01 6.934485275105084501e-01 7.544440922042097153e-01
++5.326506556783058288e-01 6.991151975856019218e-01 7.571210204550441469e-01
++5.451151059190834092e-01 7.047815278674717243e-01 7.599492971931861574e-01
++5.575181558550945660e-01 7.104543187762520917e-01 7.629291415211207905e-01
++5.698635397781144363e-01 7.161365136199150383e-01 7.660488334775965580e-01
++5.821485860154738123e-01 7.218322109491160932e-01 7.693023567855580280e-01
++5.943602368020499682e-01 7.275477994362923306e-01 7.726916325476315128e-01
++6.065080899095934841e-01 7.332844479726540188e-01 7.762041114816310428e-01
++6.185864665812587093e-01 7.390466790641196937e-01 7.798383670352863062e-01
++6.305963554035781682e-01 7.448373397672364282e-01 7.835892177406345027e-01
++6.425403291413834816e-01 7.506587685331359561e-01 7.874510644025978223e-01
++6.544185977825304201e-01 7.565137308188258913e-01 7.914204294842384080e-01
++6.662315287143806275e-01 7.624048800378464552e-01 7.954941819359623301e-01
++6.779850393157120791e-01 7.683332855369554570e-01 7.996659972294575258e-01
++6.896755013217630292e-01 7.743024253591546113e-01 8.039360994237751967e-01
++7.013107513266423343e-01 7.803126348729136907e-01 8.082975524678305268e-01
++7.128885314512861671e-01 7.863668558670167119e-01 8.127502175082055302e-01
++7.244112448085553435e-01 7.924667152464015540e-01 8.172911293271547528e-01
++7.358836989688380958e-01 7.986130654557248576e-01 8.219158971644889844e-01
++7.473044386446877629e-01 8.048084510111997991e-01 8.266243361574353576e-01
++7.586759860087319840e-01 8.110542493572184819e-01 8.314137476978961105e-01
++7.700007022560961811e-01 8.173518180665149124e-01 8.362815657919246970e-01
++7.812789490175476859e-01 8.237030526155880716e-01 8.412265533654796901e-01
++7.925116214732782494e-01 8.301096652946458043e-01 8.462470956714009951e-01
++8.036997510351909790e-01 8.365733017623517842e-01 8.513414099007207136e-01
++8.148431081888104499e-01 8.430959697406819053e-01 8.565084542610862384e-01
++8.259421593641688153e-01 8.496794646156250463e-01 8.617465433522450979e-01
++8.369967539127278755e-01 8.563257710703112702e-01 8.670541605111352634e-01
++8.480038340013845710e-01 8.630377874332209043e-01 8.724315628924932398e-01
++8.589628398368314155e-01 8.698176873531217046e-01 8.778768407867350021e-01
++8.698718779534676537e-01 8.766681056859056964e-01 8.833884311630415542e-01
++8.807225950585577667e-01 8.835937613774932364e-01 8.889689808541467730e-01
++8.915125639987498962e-01 8.905976582376062822e-01 8.946157932523199907e-01
++9.022321856472953483e-01 8.976851819173250480e-01 9.003303399902121695e-01
++9.128629530771473766e-01 9.048646775143293075e-01 9.061201920398328502e-01
++9.233906674988954233e-01 9.121434538185491103e-01 9.119872701021832784e-01
++9.337690699519377580e-01 9.195389121458987791e-01 9.179604265763980919e-01
++9.438768578707728008e-01 9.270905817099515112e-01 9.241478407896098757e-01
++9.450241336950316873e-01 9.267273985243987822e-01 9.232017297254778709e-01
++9.401771503305338396e-01 9.175010969420787088e-01 9.127353023021862466e-01
++9.357788176131993652e-01 9.081849602977229985e-01 9.019958970504049489e-01
++9.316195516453253944e-01 8.988455936080792519e-01 8.911247259869568005e-01
++9.276366903952597553e-01 8.895015346080178409e-01 8.801625091446737548e-01
++9.237963723082156520e-01 8.801619939913720714e-01 8.691306632065185500e-01
++9.200767818087643990e-01 8.708323115565800299e-01 8.580426479951916985e-01
++9.164622665155582881e-01 8.615158650696722598e-01 8.469079246742292622e-01
++9.129409700010679973e-01 8.522148302070590153e-01 8.357335125969563849e-01
++9.095033897880691054e-01 8.429306461313940124e-01 8.245249535921664874e-01
++9.061413505699446036e-01 8.336643536120030840e-01 8.132870275157044748e-01
++9.028482401464246188e-01 8.244164969479621519e-01 8.020234992942889551e-01
++8.996183458250350817e-01 8.151873435674267254e-01 7.907375926293952473e-01
++8.964464017336835067e-01 8.059770371403549571e-01 7.794323253122593664e-01
++8.933280984986637918e-01 7.967854062668440207e-01 7.681100636805964221e-01
++8.902585423162623357e-01 7.876125240246927284e-01 7.567737971546929510e-01
++8.872341531517662361e-01 7.784580066111700392e-01 7.454255275413548265e-01
++8.842515223931736168e-01 7.693214239645329577e-01 7.340672060990318659e-01
++8.813075692568397290e-01 7.602022354826803996e-01 7.227005864751234743e-01
++8.783989821496545058e-01 7.511000050313838550e-01 7.113277185683902770e-01
++8.755220238171187441e-01 7.420144833045193566e-01 6.999511354610528091e-01
++8.726749843514796101e-01 7.329446408023255755e-01 6.885716411869530207e-01
++8.698547215416584377e-01 7.238900130170270453e-01 6.771913952144653637e-01
++8.670596624933959440e-01 7.148495108503407636e-01 6.658111988100340328e-01
++8.642855405275950975e-01 7.058231520382152180e-01 6.544344321908397433e-01
++8.615312235931757989e-01 6.968096810882964398e-01 6.430616521710770250e-01
++8.587945613193220806e-01 6.878082471826545419e-01 6.316944172411573799e-01
++8.560737697641845889e-01 6.788178389092562881e-01 6.203340096274330140e-01
++8.533647514077651319e-01 6.698384520573987810e-01 6.089840337795546787e-01
++8.506671813652186831e-01 6.608684511065675560e-01 5.976445430267850467e-01
++8.479803760976425409e-01 6.519062997089123401e-01 5.863159553827915760e-01
++8.452992890124730874e-01 6.429524288345007665e-01 5.750030931030669645e-01
++8.426233261680482478e-01 6.340052727647743636e-01 5.637064935396088883e-01
++8.399526706457652869e-01 6.250628349958033958e-01 5.524259435430849408e-01
++8.372823606159069953e-01 6.161255232979981900e-01 5.411665126797099434e-01
++8.346115013722664733e-01 6.071918418882036317e-01 5.299292934604437066e-01
++8.319416971332159738e-01 5.982589838531851001e-01 5.187128588454869016e-01
++8.292658393187906096e-01 5.893284247613858051e-01 5.075248627530006829e-01
++8.265865191963318592e-01 5.803968068112989043e-01 4.963630791145096643e-01
++8.239007716165898110e-01 5.714634777707676694e-01 4.852311209906218226e-01
++8.212047236427109098e-01 5.625283035002011101e-01 4.741337367172645534e-01
++8.185028441784485409e-01 5.535866371885466153e-01 4.630669974760600605e-01
++8.157857974447502158e-01 5.446412013022012832e-01 4.520417208585162938e-01
++8.130598755024439628e-01 5.356861530869529986e-01 4.410523109242584505e-01
++8.103157295614864530e-01 5.267242547499885186e-01 4.301100025814295069e-01
++8.075600763067809496e-01 5.177491168092126506e-01 4.192090517728162546e-01
++8.047829983640772955e-01 5.087638530967844019e-01 4.083617627821872209e-01
++8.019913643823087801e-01 4.997616265469864705e-01 3.975626288212918968e-01
++7.991776069093209367e-01 4.907441098507538402e-01 3.868219510427612362e-01
++7.963412506983238437e-01 4.817086347924898759e-01 3.761426799347312722e-01
++7.934853391750592566e-01 4.726500967551418020e-01 3.655242898980974875e-01
++7.906020861628313412e-01 4.635701843716890092e-01 3.549783159786080722e-01
++7.876922078438237662e-01 4.544650164439674178e-01 3.445075235304189132e-01
++7.847584433242353885e-01 4.453290095612297272e-01 3.341130019968927001e-01
++7.817943763481589592e-01 4.361626378195018194e-01 3.238062118505327658e-01
++7.787986023472407426e-01 4.269628178617235204e-01 3.135938243777520174e-01
++7.757700306772615795e-01 4.177259860608659170e-01 3.034828822113839197e-01
++7.727073763310282617e-01 4.084484227667745659e-01 2.934814547614346680e-01
++7.696090956246998127e-01 3.991262801626034307e-01 2.835988305456279002e-01
++7.664733140591651894e-01 3.897556205902359405e-01 2.738457322824414675e-01
++7.632977462662783319e-01 3.803324674237734127e-01 2.642345539395078435e-01
++7.600796083228246180e-01 3.708528707479538111e-01 2.547796171102231777e-01
++7.568155232311498670e-01 3.613129902046505748e-01 2.454974414736316723e-01
++7.535014210471865370e-01 3.517091973617619272e-01 2.364070204678299647e-01
++7.501324359996863755e-01 3.420381997805444496e-01 2.275300884680255264e-01
++7.467083678923864820e-01 3.322917332197801166e-01 2.188868097223075626e-01
++7.432206214135255173e-01 3.224689513722865386e-01 2.105072965395320406e-01
++7.396626352495903056e-01 3.125667176366879740e-01 2.024226257801388651e-01
++7.360276592028781595e-01 3.025817058357924139e-01 1.946669682951213953e-01
++7.323075054306246168e-01 2.925115926125090304e-01 1.872788656593587786e-01
++7.284886793139783157e-01 2.823599622393618280e-01 1.803025816545419935e-01
++7.245597795551689257e-01 2.721283507524605572e-01 1.737830391183990686e-01
++7.205052554891407945e-01 2.618237699935750395e-01 1.677681078164939554e-01
++7.163077524522897255e-01 2.514568470079543427e-01 1.623050371038979034e-01
++7.119477511381474555e-01 2.410431671523047270e-01 1.574376915741905747e-01
++7.074046106878864038e-01 2.306029576903746436e-01 1.532027782639572566e-01
++7.026577763956233236e-01 2.201603247696940491e-01 1.496264194674281345e-01
++6.976856380676357272e-01 2.097462458983016809e-01 1.467193374830310926e-01
++6.924700993857928477e-01 1.993923480969033712e-01 1.444757571309586708e-01
++6.869956304794752056e-01 1.891326217641629281e-01 1.428720296451389260e-01
++6.812509389222788370e-01 1.790005719286615893e-01 1.418684919672574540e-01
++6.752290404511711586e-01 1.690283951735306323e-01 1.414126182563193168e-01
++6.689272347019628029e-01 1.592460113853382819e-01 1.414436246187784352e-01
++6.623462930327670417e-01 1.496814992323431404e-01 1.418966965532167945e-01
++6.554894621920681619e-01 1.403622590219790744e-01 1.427060758527507467e-01
++6.483618361407726960e-01 1.313154491044398742e-01 1.438093776439538507e-01
++6.409690900196458596e-01 1.225708994915949840e-01 1.451466621124405387e-01
++6.333171868548845840e-01 1.141616381299322275e-01 1.466635532234118466e-01
++6.254117682555888624e-01 1.061263207405454406e-01 1.483083323541042609e-01
++6.172580943089347461e-01 9.850955940169045522e-02 1.500342818055006577e-01
++6.088612137441752337e-01 9.136271116346880716e-02 1.517946748017894032e-01
++6.002260075568476294e-01 8.474268845605749390e-02 1.535471889644061949e-01
++5.913580665313180607e-01 7.870937974751122945e-02 1.552475962263118736e-01
++5.822640724597829553e-01 7.332110668924821106e-02 1.568528524628541587e-01
++5.729523242155735163e-01 6.862870182587510470e-02 1.583209522546889236e-01
++5.634337248699358147e-01 6.466696013382158825e-02 1.596097119552595534e-01
++5.537224099506778963e-01 6.144626935987178989e-02 1.606779590153868675e-01
++5.438351395676241928e-01 5.894914800814857886e-02 1.614895452047331870e-01
++5.337912133736735232e-01 5.712858102881844535e-02 1.620138116792186611e-01
++5.236119994512118403e-01 5.591095129374230172e-02 1.622265257547594042e-01
++5.133214710039554207e-01 5.519900277454217047e-02 1.621082697921440163e-01
++5.029415119053961547e-01 5.489268743951671026e-02 1.616521201270082198e-01
++4.924920560465744224e-01 5.489497800522934179e-02 1.608594568967110505e-01
++4.819970419875420631e-01 5.509874164212420766e-02 1.597294678457327477e-01
++4.714685312956432006e-01 5.543752958786138385e-02 1.582803570073196830e-01
++4.609298385556733768e-01 5.581817450175154821e-02 1.565161535498545142e-01
++4.503882306974699712e-01 5.620093240974462917e-02 1.544603609580012249e-01
++4.398550445667638309e-01 5.653967482715421822e-02 1.521296397207116124e-01
++4.293395854267749168e-01 5.679892905513854451e-02 1.495413040881575784e-01
++4.188488052114383020e-01 5.695351275720081374e-02 1.467131019928892832e-01
++4.083874753510262079e-01 5.698679735961746651e-02 1.436626150429021476e-01
++3.979584206972520133e-01 5.688899115379054960e-02 1.404067946849407167e-01
++3.875661805934746962e-01 5.664744510513378128e-02 1.369596232193354413e-01
++3.772162562473511671e-01 5.624858727791105101e-02 1.333332882463785507e-01
++3.669009710312429173e-01 5.571027577451325569e-02 1.295456315830630090e-01
++3.566289201162299305e-01 5.501236188184371184e-02 1.256041268313332904e-01
++3.463946141954395985e-01 5.416713051157899528e-02 1.215221064681567403e-01
++3.362018241761821069e-01 5.316577293008726418e-02 1.173074037138401304e-01
++3.260424402261492549e-01 5.202497987647033972e-02 1.129713889339670624e-01
++3.159278573165507087e-01 5.071934147936141973e-02 1.085175153831856448e-01
++3.058440467352613878e-01 4.927677960771512794e-02 1.039569210271578392e-01
++2.957906289005873823e-01 4.769542811326495796e-02 9.929501197500162357e-02
++2.857761694878986902e-01 4.595516903310007534e-02 9.453469664208309642e-02
++2.757883929056377248e-01 4.407729543414404955e-02 8.968329380554104779e-02
++2.658251433737037206e-01 4.206161274965801444e-02 8.474472186508703875e-02
++2.558840557281191197e-01 3.990046570244704105e-02 7.972236454569985031e-02
++2.459622220783502511e-01 3.762595141506584057e-02 7.461913567560218841e-02
++2.360563646646140490e-01 3.529747994604028744e-02 6.943744239412558139e-02]; 
++
++   case 'gra'
++      RGB = [5.119113838889112324e-07 2.052270195661655352e-06 5.982577941045682640e-06
++2.598440803609315740e-04 2.625944024536107477e-04 2.770622839605119624e-04
++8.656156394278343835e-04 8.570638031131799393e-04 8.794207369001087564e-04
++1.769403238430108027e-03 1.740368058158140796e-03 1.768607096399604827e-03
++2.949472160671299040e-03 2.891903379202926793e-03 2.924180394823831797e-03
++4.392323531342203803e-03 4.298904740810657703e-03 4.333431047933433700e-03
++6.088553115957890012e-03 5.952519318106651129e-03 5.987527380406317858e-03
++8.031191715623246449e-03 7.846222922619310730e-03 7.879950296964649201e-03
++1.021487523527209347e-02 9.975026089550139557e-03 1.000570608701620810e-02
++1.263537226121889262e-02 1.233502163300135256e-02 1.236087717148891089e-02
++1.528929074309834900e-02 1.492310361152201538e-02 1.494234288239030227e-02
++1.817388406754013447e-02 1.773678153559082871e-02 1.774759483393608533e-02
++2.128691657088564032e-02 2.077405157770592994e-02 2.077460893832101113e-02
++2.462656669738432988e-02 2.403330390048570228e-02 2.402175331762853791e-02
++2.819135511163322477e-02 2.751325392935317568e-02 2.748772001065160481e-02
++3.198008997843642537e-02 3.121289009539909495e-02 3.117147304311678954e-02
++3.599182442355883943e-02 3.513143325966101155e-02 3.507220810044759524e-02
++4.022582286584987926e-02 3.926830463975648777e-02 3.918932064337803806e-02
++4.449007920559793633e-02 4.350122490641009781e-02 4.340640025397465157e-02
++4.870367428407672977e-02 4.767846692745423415e-02 4.756790269604229543e-02
++5.287362099388332598e-02 5.181334368492381687e-02 5.168705396373681621e-02
++5.700314746954803641e-02 5.590901252301124641e-02 5.576700147480036923e-02
++6.109513723484618491e-02 5.996829329212761267e-02 5.981055680351737153e-02
++6.515218007540821143e-02 6.399371820125457355e-02 6.382024521975740439e-02
++6.917661353844734018e-02 6.798757248509634810e-02 6.779834611081525519e-02
++7.317055710313111194e-02 7.195192788781537563e-02 7.174692627103734788e-02
++7.713594055593872567e-02 7.588867046670466632e-02 7.566786755046528423e-02
++8.107452773767656606e-02 7.979952385914274027e-02 7.956288999694530184e-02
++8.498793655960165672e-02 8.368606889245686076e-02 8.343357136470588853e-02
++8.887765598636060416e-02 8.754976022063193364e-02 8.728136366834671200e-02
++9.274506053351619372e-02 9.139194052486757092e-02 9.110760731542752455e-02
++9.659142271361736976e-02 9.521385270343013518e-02 9.491354324016601507e-02
++1.004179237775132127e-01 9.901665039071003149e-02 9.870032337586748250e-02
++1.042256630300536779e-01 1.028014070791676282e-01 1.024690197379714285e-01
++1.080156659465895397e-01 1.065691240661386929e-01 1.062206323382679229e-01
++1.117888912751462127e-01 1.103207374067532442e-01 1.099560961104033285e-01
++1.155462372762081913e-01 1.140571240219185878e-01 1.136762869947187948e-01
++1.192885472257254331e-01 1.177791070845015386e-01 1.173820273048238605e-01
++1.230166142857740674e-01 1.214874607860790545e-01 1.210740904776794746e-01
++1.267311858301593541e-01 1.251829145698133972e-01 1.247532052922631640e-01
++1.304329672982797728e-01 1.288661569013136721e-01 1.284200596282795426e-01
++1.341226256391360172e-01 1.325378386381312334e-01 1.320753038252369949e-01
++1.378007923979476801e-01 1.361985760492960551e-01 1.357195536930293212e-01
++1.414680664900422602e-01 1.398489535286627783e-01 1.393533932175645418e-01
++1.451250167001958413e-01 1.434895260394738747e-01 1.429773769986621423e-01
++1.487721839401931478e-01 1.471208213222370831e-01 1.465920324521616802e-01
++1.524100832928171334e-01 1.507433418935591463e-01 1.501978618037517477e-01
++1.560392058666605075e-01 1.543575668598215767e-01 1.537953438982961329e-01
++1.596600204829017322e-01 1.579639535664100758e-01 1.573849358452757696e-01
++1.632729752124383871e-01 1.615629391005102000e-01 1.609670745182808227e-01
++1.668784987794287578e-01 1.651549416631863942e-01 1.645421779242018656e-01
++1.704770018452845537e-01 1.687403618244931736e-01 1.681106464558155544e-01
++1.740688781854339839e-01 1.723195836736857167e-01 1.716728640397789662e-01
++1.776545057697057339e-01 1.758929758751424655e-01 1.752291991906090307e-01
++1.812342477558830656e-01 1.794608926393625181e-01 1.787800059799695696e-01
++1.848084534049017069e-01 1.830236746173136975e-01 1.823256249295160947e-01
++1.883774589251684672e-01 1.865816497254700890e-01 1.858663838346062414e-01
++1.919415882526751271e-01 1.901351339080520064e-01 1.894025985253704192e-01
++1.955011537728245652e-01 1.936844318422726863e-01 1.929345735709248333e-01
++1.990564569892651070e-01 1.972298375917654889e-01 1.964626029318853884e-01
++2.026077891444517665e-01 2.007716352128197101e-01 1.999869705657932872e-01
++2.061554317961845073e-01 2.043100993175656077e-01 2.035079509895849070e-01
++2.096996573539102737e-01 2.078454955978322194e-01 2.070258098028130989e-01
++2.132407295782156598e-01 2.113780813130166081e-01 2.105408041749530779e-01
++2.167789040465809003e-01 2.149081057449790388e-01 2.140531832997963901e-01
++2.203144285881817321e-01 2.184358106226793050e-01 2.175631888196422614e-01
++2.238475436902406246e-01 2.219614305190086845e-01 2.210710552217338698e-01
++2.273784828782031697e-01 2.254851932220399702e-01 2.245770102091559361e-01
++2.309074730717983193e-01 2.290073200827110744e-01 2.280812750482046902e-01
++2.344347349188553031e-01 2.325280263407684678e-01 2.315840648940526436e-01
++2.379604831085705419e-01 2.360475214306362868e-01 2.350855890963675088e-01
++2.414849266657837501e-01 2.395660092687221798e-01 2.385860514863973880e-01
++2.450082692276646656e-01 2.430836885235431177e-01 2.420856506468980207e-01
++2.485307093041047577e-01 2.466007528699289408e-01 2.455845801661603045e-01
++2.520524405229936926e-01 2.501173912284589962e-01 2.490830288772885037e-01
++2.555736518614571962e-01 2.536337879911821358e-01 2.525811810837814142e-01
++2.590945278640408023e-01 2.571501232345917431e-01 2.560792167723802693e-01
++2.626152488487566439e-01 2.606665729207388593e-01 2.595773118140702884e-01
++2.661359911018202906e-01 2.641833090872994227e-01 2.630756381540483857e-01
++2.696569270618426883e-01 2.677005000273448010e-01 2.665743639914045504e-01
++2.731782254941877985e-01 2.712183104595063399e-01 2.700736539492059607e-01
++2.767000516561451962e-01 2.747369016891675342e-01 2.735736692356186550e-01
++2.802225674535130939e-01 2.782564317612734595e-01 2.770745677966527931e-01
++2.837459315891543987e-01 2.817770556052956454e-01 2.805765044610715742e-01
++2.872702997040328943e-01 2.852989251728569320e-01 2.840796310779650780e-01
++2.907958245112020612e-01 2.888221895684777163e-01 2.875840966474506044e-01
++2.943226559231933992e-01 2.923469951738719153e-01 2.910900474449292785e-01
++2.978509411732042089e-01 2.958734857661936557e-01 2.945976271392962698e-01
++3.013808249304671394e-01 2.994018026306028979e-01 2.981069769054734420e-01
++3.049124494101519978e-01 3.029320846674894985e-01 3.016182355316066044e-01
++3.084459544781194551e-01 3.064644684946828401e-01 3.051315395212462755e-01
++3.119814777508492787e-01 3.099990885449340761e-01 3.086470231908091666e-01
++3.155191546907993305e-01 3.135360771589531526e-01 3.121648187625948867e-01
++3.190591186974824911e-01 3.170755646742604017e-01 3.156850564536164416e-01
++3.226015011944919908e-01 3.206176795100827426e-01 3.192078645604823350e-01
++3.261464317127154011e-01 3.241625482485306353e-01 3.227333695405575908e-01
++3.296940379699381807e-01 3.277102957122579041e-01 3.262616960896098095e-01
++3.332444459470546017e-01 3.312610450388014383e-01 3.297929672161359349e-01
++3.367977799610606948e-01 3.348149177517827924e-01 3.333273043125560831e-01
++3.403541627350049614e-01 3.383720338291492657e-01 3.368648272234392449e-01
++3.439137154650676598e-01 3.419325117686051185e-01 3.404056543109294508e-01
++3.474765578849234871e-01 3.454964686503906313e-01 3.439499025175156155e-01
++3.510428083275172195e-01 3.490640201975497847e-01 3.474976874262884485e-01
++3.546125837844137374e-01 3.526352808338130695e-01 3.510491233188203775e-01
++3.581859999628214664e-01 3.562103637392293742e-01 3.546043232307861115e-01
++3.617631713404313443e-01 3.597893809036549762e-01 3.581633990054478578e-01
++3.653442112181757850e-01 3.633724431782132114e-01 3.617264613451083854e-01
++3.689292317710045621e-01 3.669596603248330147e-01 3.652936198606414053e-01
++3.725183440967992365e-01 3.705511410639528158e-01 3.688649831191926354e-01
++3.761116582634963512e-01 3.741469931204933763e-01 3.724406586901452543e-01
++3.797092833545231416e-01 3.777473232681791138e-01 3.760207531894346200e-01
++3.833113275126273645e-01 3.813522373722905701e-01 3.796053723222968523e-01
++3.869178979821737419e-01 3.849618404309278485e-01 3.831946209245254420e-01
++3.905291011499888443e-01 3.885762366148534097e-01 3.867886030023093280e-01
++3.941450425848224692e-01 3.921955293059884440e-01 3.903874217707223315e-01
++3.977658270754869663e-01 3.958198211346236617e-01 3.939911796909281172e-01
++4.013915586677523906e-01 3.994492140154045079e-01 3.975999785061617997e-01
++4.050223407000290154e-01 4.030838091821594138e-01 4.012139192765472040e-01
++4.086582758379366798e-01 4.067237072216087768e-01 4.048331024128048461e-01
++4.122994661077632461e-01 4.103690081060247796e-01 4.084576277089013163e-01
++4.159460129289094255e-01 4.140198112248798523e-01 4.120875943736929670e-01
++4.195980171453375096e-01 4.176762154155350126e-01 4.157231010616072031e-01
++4.232555790560795228e-01 4.213383189930122175e-01 4.193642459024058966e-01
++4.269187984448540862e-01 4.250062197788932461e-01 4.230111265300784962e-01
++4.305877746088247471e-01 4.286800151293829186e-01 4.266638401108986955e-01
++4.342626063865396291e-01 4.323598019625811695e-01 4.303224833706847940e-01
++4.379433921850948153e-01 4.360456767849914539e-01 4.339871526213026076e-01
++4.416302300065532149e-01 4.397377357173059553e-01 4.376579437864426825e-01
++4.453232174736505011e-01 4.434360745195019549e-01 4.413349524267043966e-01
++4.490224518548273092e-01 4.471407886152713451e-01 4.450182737640205333e-01
++4.527280300886077913e-01 4.508519731158264210e-01 4.487080027054508036e-01
++4.564400488073677153e-01 4.545697228430990999e-01 4.524042338663719076e-01
++4.601586043605019882e-01 4.582941323523668786e-01 4.561070615930931660e-01
++4.638837928370361241e-01 4.620252959543280080e-01 4.598165799849223689e-01
++4.676157100876950357e-01 4.657633077366521435e-01 4.635328829157047692e-01
++4.713544517464566819e-01 4.695082615850322827e-01 4.672560640548638067e-01
++4.751001132516106673e-01 4.732602512037566433e-01 4.709862168879611066e-01
++4.788527898663595406e-01 4.770193701358209082e-01 4.747234347367983998e-01
++4.826125766989533550e-01 4.807857117826079274e-01 4.784678107790839019e-01
++4.863795687224105602e-01 4.845593694231487558e-01 4.822194380676812497e-01
++4.901538607938191183e-01 4.883404362329857862e-01 4.859784095494587564e-01
++4.939355476732588124e-01 4.921290053026548539e-01 4.897448180837610798e-01
++4.977247240423329777e-01 4.959251696558080735e-01 4.935187564605149624e-01
++5.015214845223622264e-01 4.997290222669866222e-01 4.973003174179899122e-01
++5.053259236922266195e-01 5.035406560790653963e-01 5.010895936602286493e-01
++5.091381361058908706e-01 5.073601640203813101e-01 5.048866778741611938e-01
++5.129582163096103598e-01 5.111876390215642774e-01 5.086916627464180829e-01
++5.167862588588553185e-01 5.150231740320770912e-01 5.125046409798591496e-01
++5.206223583349409711e-01 5.188668620364874640e-01 5.163257053098251337e-01
++5.244666093614033242e-01 5.227187960704765546e-01 5.201549485201331091e-01
++5.283191066201067265e-01 5.265790692366016934e-01 5.239924634588227770e-01
++5.321799448671195032e-01 5.304477747198240722e-01 5.278383430536651710e-01
++5.360492189483508918e-01 5.343250058028127247e-01 5.316926803274503177e-01
++5.399270238149752599e-01 5.382108558810341226e-01 5.355555684130592908e-01
++5.438134545386418273e-01 5.421054184776434859e-01 5.394271005683370923e-01
++5.477086063264958726e-01 5.460087872581790291e-01 5.433073701907695785e-01
++5.516125745359978794e-01 5.499210560450835672e-01 5.471964708319829729e-01
++5.555254546895829204e-01 5.538423188320419355e-01 5.510944962120672974e-01
++5.594473424891353019e-01 5.577726697981703063e-01 5.550015402337400428e-01
++5.633783338303157695e-01 5.617122033220391941e-01 5.589176969963529640e-01
++5.673185248167353922e-01 5.656610139955613459e-01 5.628430608097579890e-01
++5.712680117739895591e-01 5.696191966377359694e-01 5.667777262080311296e-01
++5.752268912635538634e-01 5.735868463082712809e-01 5.707217879630733792e-01
++5.791952600965620812e-01 5.775640583210815970e-01 5.746753410980864896e-01
++5.831732153474624702e-01 5.815509282576770689e-01 5.786384809009386121e-01
++5.871608543675723713e-01 5.855475519804423934e-01 5.826113029374229146e-01
++5.911582747985197894e-01 5.895540256458231543e-01 5.865939030644199415e-01
++5.951655745855983781e-01 5.935704457174205695e-01 5.905863774429681579e-01
++5.991828519910353812e-01 5.975969089789966437e-01 5.945888225512460101e-01
++6.032102056071760865e-01 6.016335125474120415e-01 5.986013351974859287e-01
++6.072477343695864560e-01 6.056803538854835800e-01 6.026240125328050645e-01
++6.112955375701087934e-01 6.097375308147855444e-01 6.066569520639827351e-01
++6.153537148698353665e-01 6.138051415283823919e-01 6.107002516661682590e-01
++6.194223663120388412e-01 6.178832846035217097e-01 6.147540095955469353e-01
++6.235015923350435418e-01 6.219720590142719940e-01 6.188183245019491796e-01
++6.275914937850678443e-01 6.260715641441202406e-01 6.228932954414247991e-01
++6.316921719290113924e-01 6.301818997985384474e-01 6.269790218887789646e-01
++6.358037284672281020e-01 6.343031662175184771e-01 6.310756037500810933e-01
++6.399262655462556459e-01 6.384354640880801623e-01 6.351831413751425348e-01
++6.440598857715362779e-01 6.425788945567643129e-01 6.393017355699824877e-01
++6.482046922201168959e-01 6.467335592421092905e-01 6.434314876092731561e-01
++6.523607884533356716e-01 6.508995602471195907e-01 6.475724992487805753e-01
++6.565282785295067924e-01 6.550770001717296509e-01 6.517248727377952244e-01
++6.607072670166060924e-01 6.592659821252698782e-01 6.558887108315696324e-01
++6.648978590049534620e-01 6.634666097389374517e-01 6.600641168037573170e-01
++6.691001601199109139e-01 6.676789871782776720e-01 6.642511944588598283e-01
++6.733142765345891956e-01 6.719032191556818523e-01 6.684500481446935538e-01
++6.775403149825812710e-01 6.761394109429005317e-01 6.726607827648712901e-01
++6.817783827707052380e-01 6.803876683835863304e-01 6.768835037913099040e-01
++6.860285877917917663e-01 6.846480979058627847e-01 6.811183172767648619e-01
++6.902910385374814162e-01 6.889208065349254895e-01 6.853653298673966221e-01
++6.945658441110833525e-01 6.932059019056816540e-01 6.896246488153768839e-01
++6.988531142404552643e-01 6.975034922754330680e-01 6.938963819915323628e-01
++7.031529592909376847e-01 7.018136865365992572e-01 6.981806378980350836e-01
++7.074654902783347188e-01 7.061365942294985931e-01 7.024775256811436330e-01
++7.117908188819498383e-01 7.104723255551799177e-01 7.067871551439977029e-01
++7.161290574576848478e-01 7.148209913883080135e-01 7.111096367594695877e-01
++7.204803190511824829e-01 7.191827032901243477e-01 7.154450816830777438e-01
++7.248447174110647095e-01 7.235575735214593296e-01 7.197936017659686270e-01
++7.292223670022126569e-01 7.279457150558282796e-01 7.241553095679664764e-01
++7.336133830191388094e-01 7.323472415925961210e-01 7.285303183706990371e-01
++7.380178813994349163e-01 7.367622675702208968e-01 7.329187421908015532e-01
++7.424359788373007252e-01 7.411909081795812204e-01 7.373206957932009198e-01
++7.468677927971572039e-01 7.456332793773956524e-01 7.417362947044913168e-01
++7.513134415273599043e-01 7.500894978997243445e-01 7.461656552263956632e-01
++7.557730440739957034e-01 7.545596812755732685e-01 7.506088944493225501e-01
++7.602467202947890135e-01 7.590439478405959228e-01 7.550661302660249818e-01
++7.647345908731115749e-01 7.635424167508956250e-01 7.595374813853584817e-01
++7.692367773320856195e-01 7.680552079969388268e-01 7.640230673461460009e-01
++7.737534020488213704e-01 7.725824424175786742e-01 7.685230085311559600e-01
++7.782845882687531303e-01 7.771242417141914771e-01 7.730374261811926440e-01
++7.828304601200990476e-01 7.816807284649387455e-01 7.775664424093062799e-01
++7.873911426284513349e-01 7.862520261391466869e-01 7.821101802151280147e-01
++7.919667617314893882e-01 7.908382591118159333e-01 7.866687634993275724e-01
++7.965574442938269106e-01 7.954395526782646053e-01 7.912423170782062476e-01
++8.011633181219949273e-01 8.000560330689072686e-01 7.958309666984236808e-01
++8.057845119795647992e-01 8.046878274641713347e-01 8.004348390518634115e-01
++8.104211556024298879e-01 8.093350640095594573e-01 8.050540617906442042e-01
++8.150733797142104553e-01 8.139978718308641392e-01 8.096887635422753693e-01
++8.197413160418366429e-01 8.186763810495288896e-01 8.143390739249705135e-01
++8.244250973312831077e-01 8.233707227981730270e-01 8.190051235631107263e-01
++8.291248573634558694e-01 8.280810292362735803e-01 8.236870441028736334e-01
++8.338407309702662307e-01 8.328074335660153871e-01 8.283849682280266524e-01
++8.385728540508587958e-01 8.375500700483110572e-01 8.330990296758882252e-01
++8.433213635880250081e-01 8.423090740189962400e-01 8.378293632534637991e-01
++8.480863976647909919e-01 8.470845819052075232e-01 8.425761048537626641e-01
++8.528680954812019044e-01 8.518767312419356363e-01 8.473393914722943121e-01
++8.576665973712844782e-01 8.566856606887783832e-01 8.521193612237554227e-01
++8.624820448202135115e-01 8.615115100468785370e-01 8.569161533589082502e-01
++8.673145804816755344e-01 8.663544202760624646e-01 8.617299082816555211e-01
++8.721643481954295396e-01 8.712145335121869172e-01 8.665607675663183906e-01
++8.770314930050886471e-01 8.760919930846851056e-01 8.714088739751210122e-01
++8.819161611761232589e-01 8.809869435343266053e-01 8.762743714758871594e-01
++8.868185002140476225e-01 8.858995306312075213e-01 8.811574052599523421e-01
++8.917386588828791760e-01 8.908299013929442678e-01 8.860581217602967463e-01
++8.966767872237935144e-01 8.957782041031091547e-01 8.909766686699112093e-01
++9.016330365740294894e-01 9.007445883298949019e-01 8.959131949603859058e-01
++9.066075595860336733e-01 9.057292049450164084e-01 9.008678509007446156e-01
++9.116005102468445198e-01 9.107322061428585469e-01 9.058407880765154685e-01
++9.166120438977335416e-01 9.157537454598729809e-01 9.108321594090563744e-01
++9.216423172541110542e-01 9.207939777942257820e-01 9.158421191751267010e-01
++9.266914884256760576e-01 9.258530594257129431e-01 9.208708230267246275e-01
++9.317597169368545540e-01 9.309311480359353519e-01 9.259184280111854015e-01
++9.368471637474911073e-01 9.360284027287524289e-01 9.309850925915528208e-01
++9.419539912738585929e-01 9.411449840510025533e-01 9.360709766672253851e-01
++9.470803634098973189e-01 9.462810540135232484e-01 9.411762415948876637e-01
++9.522264455488126389e-01 9.514367761124457035e-01 9.463010502097274346e-01
++9.573924046049070435e-01 9.566123153508007126e-01 9.514455668469502525e-01
++9.625784090357906164e-01 9.618078382604079435e-01 9.566099573635956643e-01
++9.677846288648154216e-01 9.670235129241012695e-01 9.617943891606574036e-01
++9.730112357039150117e-01 9.722595089982409844e-01 9.669990312055217752e-01
++9.782584027767170509e-01 9.775159977355695196e-01 9.722240540547290033e-01
++9.835263049420009951e-01 9.827931520083860173e-01 9.774696298770532144e-01
++9.888151187175039381e-01 9.880911463320615207e-01 9.827359324769276983e-01
++9.941250223040635214e-01 9.934101568888956679e-01 9.880231373182063459e-01
++9.994561956101176703e-01 9.987503615523224410e-01 9.933314215482736964e-01]; 
++
++   case 'oxy' 
++      RGB = [2.503217690585841648e-01 2.046237300762866404e-02 1.966891524096342492e-02
++2.555648459031592545e-01 2.111591456205731687e-02 2.090007960568026485e-02
++2.608015512876060149e-01 2.176436656689777205e-02 2.215967228611414111e-02
++2.660446264484087608e-01 2.238303577293145399e-02 2.344016212259009482e-02
++2.712886712210940687e-01 2.298148595687718801e-02 2.474301784763054818e-02
++2.765326364024714989e-01 2.356133594445880552e-02 2.606762144216200061e-02
++2.817861616671273883e-01 2.410204070052599998e-02 2.740685289115278589e-02
++2.870367982396965223e-01 2.462864448899236905e-02 2.876669328790133415e-02
++2.922964729271802509e-01 2.511521382538545177e-02 3.013810573921637051e-02
++2.975597737008193189e-01 2.557236440082744783e-02 3.152275139605174165e-02
++3.028221259572578816e-01 2.600980779972315513e-02 3.292220687889551439e-02
++3.080989498969098905e-01 2.639179365308667174e-02 3.432344572619091400e-02
++3.133766829953620880e-01 2.674829090811269017e-02 3.573422597599480721e-02
++3.186553157006936643e-01 2.707912721943054463e-02 3.715280555634475207e-02
++3.239494929539773471e-01 2.734824710730623595e-02 3.856493364156053649e-02
++3.292456607259481305e-01 2.758740066123798601e-02 3.997915613902540410e-02
++3.345444278514146941e-01 2.779482795061332528e-02 4.137064065412290187e-02
++3.398547648028715784e-01 2.794706430858015858e-02 4.271748371599067701e-02
++3.451724938219263294e-01 2.805368502448264342e-02 4.402857557145471029e-02
++3.504942702458693216e-01 2.812284384388611183e-02 4.530588662285887219e-02
++3.558206849295221796e-01 2.815263330374409914e-02 4.654771396733792949e-02
++3.611591248942810362e-01 2.812226066677377817e-02 4.774545304821291997e-02
++3.665053860525750440e-01 2.804229091411641200e-02 4.890135088859193929e-02
++3.718571787846235432e-01 2.791864422174392124e-02 5.001583572284549334e-02
++3.772149143594046850e-01 2.774987601297047857e-02 5.108646119902058441e-02
++3.825789453973626464e-01 2.753471831366087474e-02 5.211053476335369278e-02
++3.879495474114582620e-01 2.727215754453635524e-02 5.308509691226611510e-02
++3.933299882018631566e-01 2.695211659028963827e-02 5.400332569218738860e-02
++3.987172740322774689e-01 2.658339014111724477e-02 5.486495007360833037e-02
++4.041100983203390062e-01 2.617015416328878283e-02 5.566751194225177252e-02
++4.095080947848049324e-01 2.571397721177636972e-02 5.640694245975855919e-02
++4.149106638808665037e-01 2.521741655377478589e-02 5.707880838445476140e-02
++4.203169224276966931e-01 2.468426285194311523e-02 5.767829102284769555e-02
++4.257256449760880579e-01 2.411983059354547848e-02 5.820016787208186909e-02
++4.311355423694091527e-01 2.353014014799948567e-02 5.863827924234723404e-02
++4.365491859863961932e-01 2.290868330200904537e-02 5.897909145270988779e-02
++4.419598927187284310e-01 2.228071155950197418e-02 5.922145534252384186e-02
++4.473641324377782280e-01 2.166211126655111924e-02 5.935827807305734533e-02
++4.527575481284770720e-01 2.107281505394200879e-02 5.938213194820316648e-02
++4.581418547792654450e-01 2.051270615727579169e-02 5.927134198778213209e-02
++4.635070947573724509e-01 2.002404746597910568e-02 5.902266227273281901e-02
++4.688449749746688711e-01 1.964556257714445905e-02 5.862776439317262528e-02
++4.741516624279997205e-01 1.940234058919213661e-02 5.806380572763907705e-02
++4.794118268811014549e-01 1.936335100061424216e-02 5.733101890860898414e-02
++4.846131761746131361e-01 1.958983233892800865e-02 5.642063175373675937e-02
++4.897434510076072445e-01 2.014613479230887780e-02 5.532001973850570603e-02
++4.947824246224634126e-01 2.112807697320261829e-02 5.404462487713374702e-02
++4.997137287427875774e-01 2.261949505617124809e-02 5.260678769207213085e-02
++5.045221796142561610e-01 2.470021881498402766e-02 5.103037173727244941e-02
++5.091962933960687554e-01 2.743497840685808764e-02 4.934858848197953146e-02
++5.137301598248652512e-01 3.086487576009750225e-02 4.759930860912273826e-02
++5.181239197849397682e-01 3.500462903556054994e-02 4.582042542223261489e-02
++5.223830134996687580e-01 3.984501254619848137e-02 4.404711326285257883e-02
++5.265167824786487483e-01 4.511655072324017440e-02 4.230178743284147141e-02
++5.305361428192386652e-01 5.056764255442364880e-02 4.059909753035081253e-02
++5.344521625028915146e-01 5.613230116634507910e-02 3.893707769140806324e-02
++5.382767330694612218e-01 6.174820344635036790e-02 3.738224682749225619e-02
++5.420185347623404093e-01 6.738177887118912412e-02 3.591446197845812871e-02
++5.456872157339706098e-01 7.300021292187203192e-02 3.454024418762975668e-02
++5.492896320812740152e-01 7.858770433534650879e-02 3.324672306620826689e-02
++5.528333528391162766e-01 8.412806121949528704e-02 3.203530971705802199e-02
++5.563218795889670609e-01 8.962115486157959388e-02 3.088637914922974861e-02
++5.597632862141976862e-01 9.505189218342754987e-02 2.981373160271517594e-02
++5.631590542003003241e-01 1.004271762153811642e-01 2.879663766133408118e-02
++3.124295956605860902e-01 3.104471192643529220e-01 3.090926227255514358e-01
++3.153354478588585863e-01 3.133524060708574033e-01 3.119821443435121244e-01
++3.182430598922476594e-01 3.162596157133579222e-01 3.148735451052371292e-01
++3.211522197125276645e-01 3.191685075353222212e-01 3.177665914743306730e-01
++3.240629875467020971e-01 3.220791403920337248e-01 3.206613422482794129e-01
++3.269754230998080380e-01 3.249915726322321063e-01 3.235578557174154657e-01
++3.298895855632509311e-01 3.279058621062435619e-01 3.264561896730452384e-01
++3.328058950511413872e-01 3.308224519789740858e-01 3.293567801282767382e-01
++3.357242465615515870e-01 3.337412216005199994e-01 3.322595102624680830e-01
++3.386445426634580036e-01 3.366620612448586458e-01 3.351642734426954484e-01
++3.415668398051758814e-01 3.395850261019035532e-01 3.380711247962143173e-01
++3.444911940093728364e-01 3.425101709489803414e-01 3.409801190370675417e-01
++3.474177171638533901e-01 3.454376095238633759e-01 3.438913688818530656e-01
++3.503469833885533569e-01 3.483679413950338533e-01 3.468054653691610145e-01
++3.532785135690075240e-01 3.513006555881026949e-01 3.497219068304560641e-01
++3.562123614381408343e-01 3.542358046622061107e-01 3.526407457578920046e-01
++3.591485803768168505e-01 3.571734408356729285e-01 3.555620343021813068e-01
++3.620872234195166572e-01 3.601136159915630519e-01 3.584858242781328586e-01
++3.650286939883333193e-01 3.630567477596149395e-01 3.614125280750120628e-01
++3.679730835603966521e-01 3.660029262684281748e-01 3.643422355711175009e-01
++3.709200935456273829e-01 3.689518358458999114e-01 3.672746363207957110e-01
++3.738697751287151094e-01 3.719035265860498596e-01 3.702097803460631664e-01
++3.768221792091647204e-01 3.748580483073254976e-01 3.731477173927215119e-01
++3.797773564061294738e-01 3.778154505573166899e-01 3.760884969350717366e-01
++3.827360799167192629e-01 3.807765314450937688e-01 3.790329075084533650e-01
++3.856977984917309143e-01 3.837407150183698712e-01 3.819803814059496427e-01
++3.886624779865983093e-01 3.867079629882915204e-01 3.849308813833784426e-01
++3.916301675373726754e-01 3.896783234711069799e-01 3.878844554799001365e-01
++3.946009160512599645e-01 3.926518443624523180e-01 3.908411515134125325e-01
++3.975750328941100031e-01 3.956288421370338648e-01 3.938012827103044011e-01
++4.005529526089701697e-01 3.986097611264988183e-01 3.967652888788774646e-01
++4.035341133137877456e-01 4.015940188237794861e-01 3.997325949836182390e-01
++4.065185627017746106e-01 4.045816619557017213e-01 4.027032476697736119e-01
++4.095063482817839495e-01 4.075727370718815190e-01 4.056772934047228052e-01
++4.124975173818349883e-01 4.105672905481647095e-01 4.086547784814160145e-01
++4.154927954346919750e-01 4.135660647292051517e-01 4.116364375734101744e-01
++4.184918779167747238e-01 4.165687434984514104e-01 4.146219586956935155e-01
++4.214945204326190908e-01 4.195750736283389015e-01 4.176110918403175276e-01
++4.245007693662425363e-01 4.225851005893354051e-01 4.206038823909587498e-01
++4.275106709591262044e-01 4.255988697155072553e-01 4.236003755942250870e-01
++4.305243725018209622e-01 4.286165297439478161e-01 4.266007190310782127e-01
++4.335427826643468152e-01 4.316390076472571558e-01 4.296058306451354114e-01
++4.365650183856102373e-01 4.346653972573469860e-01 4.326148141166248351e-01
++4.395911251655309493e-01 4.376957432004656146e-01 4.356277139803868548e-01
++4.426211483952462444e-01 4.407300899994052723e-01 4.386445746671270296e-01
++4.456551333598003373e-01 4.437684820761266802e-01 4.416654405060406741e-01
++4.486936890393982691e-01 4.468115388000440946e-01 4.446909251918003680e-01
++4.517368917688296959e-01 4.498593352768152642e-01 4.477211036271617761e-01
++4.547842258698517881e-01 4.529113434703738172e-01 4.507554532964671012e-01
++4.578357360933586473e-01 4.559676072973268823e-01 4.537940180195341733e-01
++4.608914671138729657e-01 4.590281706024677000e-01 4.568368415436758201e-01
++4.639514635319542113e-01 4.620930771611265198e-01 4.598839675460500431e-01
++4.670168649608225642e-01 4.651634846458155281e-01 4.629365433533288998e-01
++4.700867768827386439e-01 4.682384803878612001e-01 4.659936652121621781e-01
++4.731611215843889440e-01 4.713179837040911146e-01 4.690552534918061012e-01
++4.762399433154002049e-01 4.744020380433919271e-01 4.721213515388643089e-01
++4.793232862779120418e-01 4.774906868110462277e-01 4.751920026556298859e-01
++4.824115798157278534e-01 4.805843644813184157e-01 4.782676377512943278e-01
++4.855054065192261903e-01 4.836836604074202794e-01 4.813488413805353527e-01
++4.886039206405141666e-01 4.867877139846760737e-01 4.844347609063475724e-01
++4.917071661727567822e-01 4.898965684306006430e-01 4.875254394390606261e-01
++4.948151870857158130e-01 4.930102669426385531e-01 4.906209200682110083e-01
++4.979280273277140179e-01 4.961288527000837223e-01 4.937212458644600344e-01
++5.010466910650995809e-01 4.992533419227356273e-01 4.968274246952877893e-01
++5.041707018503041038e-01 5.023832495766817896e-01 4.999389760567756191e-01
++5.072996974715958673e-01 5.055182071194114224e-01 5.030555348110034020e-01
++5.104337218186610903e-01 5.086582576893806662e-01 5.061771439834861219e-01
++5.135728187816994694e-01 5.118034444283539042e-01 5.093038466023047661e-01
++5.167171776492902602e-01 5.149539576128636664e-01 5.124358316223290855e-01
++5.198680090904711504e-01 5.181110205469275920e-01 5.155743126495593298e-01
++5.230240786607408543e-01 5.212733823701987124e-01 5.187180494068470704e-01
++5.261854303107180719e-01 5.244410863000215084e-01 5.218670849934367029e-01
++5.293521080119285571e-01 5.276141755769954145e-01 5.250214625310645200e-01
++5.325241557584816654e-01 5.307926934666159502e-01 5.281812251655980672e-01
++5.357023822572596350e-01 5.339774558564434059e-01 5.313471825523317094e-01
++5.388868512651764364e-01 5.371685253040656693e-01 5.345193971027960567e-01
++5.420768564731617278e-01 5.403651867966881017e-01 5.376971597230371103e-01
++5.452724420645790326e-01 5.435674838014370458e-01 5.408805137559964393e-01
++5.484736522643940404e-01 5.467754598289500390e-01 5.440695025873386603e-01
++5.516805313407564526e-01 5.499891584349245743e-01 5.472641696469991990e-01
++5.548945759211054707e-01 5.532100885206570062e-01 5.504660124980879088e-01
++5.581145670784500856e-01 5.564370183489838473e-01 5.536738091851505228e-01
++5.613403945534086725e-01 5.596698355312789142e-01 5.568874483927889196e-01
++5.645721029241054234e-01 5.629085839430609806e-01 5.601069738660463537e-01
++5.678097368298002934e-01 5.661533075224889355e-01 5.633324294117918463e-01
++5.710538502837967378e-01 5.694045636227955676e-01 5.665643684189753948e-01
++5.743051694640114446e-01 5.726630826009092567e-01 5.698035160864106663e-01
++5.775625831679842559e-01 5.759277431077964859e-01 5.730487596836393305e-01
++5.808261364437535823e-01 5.791985894982362160e-01 5.763001434292895908e-01
++5.840958744176996120e-01 5.824756662065079249e-01 5.795577116206488411e-01
++5.873718422959868235e-01 5.857590177478061433e-01 5.828215086350755358e-01
++5.906553283643478647e-01 5.890499401540877367e-01 5.860928212875072818e-01
++5.939456863496749284e-01 5.923477811162676243e-01 5.893710023062436187e-01
++5.972424456095442036e-01 5.956520656886060694e-01 5.926555803959596691e-01
++6.005456518693509382e-01 5.989628389111977258e-01 5.959466004538667150e-01
++6.038553509508688411e-01 6.022801459213279474e-01 5.992441074734932149e-01
++6.071717820521228548e-01 6.056042263837068118e-01 6.025483395942317077e-01
++6.104964593110322468e-01 6.089366020846007643e-01 6.058608080471198365e-01
++6.138278031916972743e-01 6.122756828005896379e-01 6.091799341380006449e-01
++6.171658601273857236e-01 6.156215142843693977e-01 6.125057634705911580e-01
++6.205106766639508775e-01 6.189741424017308757e-01 6.158383417607966592e-01
++6.238622994612079697e-01 6.223336131329110232e-01 6.191777148380593898e-01
++6.272217495526114517e-01 6.257009516987572795e-01 6.225249009896979269e-01
++6.305890773753839440e-01 6.290762073460191006e-01 6.258799493857725160e-01
++6.339633886626701020e-01 6.324584802535679895e-01 6.292419666367617959e-01
++6.373447307909330117e-01 6.358478171202772700e-01 6.326109992853028441e-01
++6.407331512665517259e-01 6.392442647751326312e-01 6.359870940032011921e-01
++6.441286977271819536e-01 6.426478701785689474e-01 6.393702975927646470e-01
++6.475332468520634821e-01 6.460605168712778568e-01 6.427624810073024886e-01
++6.509452405110124351e-01 6.494806387834576311e-01 6.461620890521664329e-01
++6.543645413031805580e-01 6.529080970404893547e-01 6.495689839578402403e-01
++6.577911976868459076e-01 6.563429394235856806e-01 6.529832133417282636e-01
++6.612252582674151835e-01 6.597852138609858752e-01 6.564048249672772561e-01
++6.646674156910871156e-01 6.632356145596635111e-01 6.598345085785605191e-01
++6.681185471134806209e-01 6.666950204492557708e-01 6.632731374913205524e-01
++6.715772676011302345e-01 6.701620407069336371e-01 6.667193303275074090e-01
++6.750436266693425891e-01 6.736367241694728447e-01 6.701731357532019207e-01
++6.785176739964410286e-01 6.771191198362991326e-01 6.736346025961090778e-01
++6.819994594251277409e-01 6.806092768708275065e-01 6.771037798468937385e-01
++6.854905830673579947e-01 6.841087989309356798e-01 6.805822608627878356e-01
++6.889902152593658791e-01 6.876168527353629933e-01 6.840692180364433828e-01
++6.924977753545575876e-01 6.911328551431065170e-01 6.875640721906080000e-01
++6.960133142099522718e-01 6.946568563288202380e-01 6.910668733210059145e-01
++6.995368828630013081e-01 6.981889066469423311e-01 6.945776716020720665e-01
++7.030687808865530020e-01 7.017293055249038680e-01 6.980967646835468665e-01
++7.066108508007371558e-01 7.052798983395075494e-01 7.016259863087929149e-01
++7.101611448678148975e-01 7.088387320594561336e-01 7.051633961675597417e-01
++7.137197152305658765e-01 7.124058581399919099e-01 7.087090455286524371e-01
++7.172866142285043711e-01 7.159813282321918493e-01 7.122629858555886706e-01
++7.208618943992978201e-01 7.195651941843620447e-01 7.158252688079900228e-01
++7.244468165907456125e-01 7.231587179839266133e-01 7.193971485631489582e-01
++7.280414152493157598e-01 7.267619329076518975e-01 7.229786584068481625e-01
++7.316445953770737143e-01 7.303737413779746168e-01 7.265687078387530473e-01
++7.352564107249326408e-01 7.339941964502680882e-01 7.301673497187975981e-01
++7.388769152586618372e-01 7.376233513935839259e-01 7.337746371194190376e-01
++7.425061631603386836e-01 7.412612596920828967e-01 7.373906233269835742e-01
++7.461464606086873896e-01 7.449102288687008411e-01 7.410176017144567417e-01
++7.497958701755464972e-01 7.485683184324932737e-01 7.446536440345916663e-01
++7.534542299137884092e-01 7.522353655092588465e-01 7.482985885600491605e-01
++7.571215953297079082e-01 7.559114248995535412e-01 7.519524898864893281e-01
++7.607980221631284179e-01 7.595965516360115855e-01 7.556154028404162837e-01
++7.644843645869688897e-01 7.632915995427993483e-01 7.592881761602847668e-01
++7.681816678947460675e-01 7.669976132758333787e-01 7.629718483168250742e-01
++7.718882453269261257e-01 7.707129043795911683e-01 7.666647413348012252e-01
++7.756041540460802963e-01 7.744375293002100369e-01 7.703669114468018053e-01
++7.793294514661021077e-01 7.781715447334471847e-01 7.740784151337410934e-01
++7.830641952537596984e-01 7.819150076262105786e-01 7.777993091263859515e-01
++7.868103454866590685e-01 7.856698771694257122e-01 7.815315409597441976e-01
++7.905668625004234062e-01 7.894351125938581237e-01 7.852740763344663311e-01
++7.943330461869060333e-01 7.932100130488932699e-01 7.890262187563090723e-01
++7.981089557544192026e-01 7.969946370120729595e-01 7.927880264788568221e-01
++8.018946506826831744e-01 8.007890432303661488e-01 7.965595580237599949e-01
++8.056905050124041345e-01 8.045936048548131270e-01 8.003411844486416626e-01
++8.094987355104209525e-01 8.084105365473570615e-01 8.041351074326460457e-01
++8.133169785258600459e-01 8.122374748676888245e-01 8.079389777476483347e-01
++8.171452951864401903e-01 8.160744801984102237e-01 8.117528555427496739e-01
++8.209837469106039398e-01 8.199216132106035282e-01 8.155768012541027012e-01
++8.248323954092128263e-01 8.237789348655052413e-01 8.194108756065791033e-01
++8.286927840915763177e-01 8.276479863786950775e-01 8.232566109078919281e-01
++8.325649270796637857e-01 8.315287807573953360e-01 8.271140202815062681e-01
++8.364475027756378411e-01 8.354199968604651971e-01 8.309817904707684777e-01
++8.403405746677916621e-01 8.393216974124767527e-01 8.348599839552471868e-01
++8.442442065571257315e-01 8.432339454481773133e-01 8.387486635231791166e-01
++8.481584625591254145e-01 8.471568043142441162e-01 8.426478922732166810e-01
++8.520861550384412064e-01 8.510930816852287917e-01 8.465604617719046932e-01
++8.560249024716682920e-01 8.550403982451367790e-01 8.504840066608007065e-01
++8.599745194151316996e-01 8.589985681043337262e-01 8.544183422480284840e-01
++8.639350718981159138e-01 8.629676565074151373e-01 8.583635335210283435e-01
++8.679066262857828562e-01 8.669477290320206642e-01 8.623196457986929131e-01
++8.718902314626645333e-01 8.709398320337272681e-01 8.662877195686166099e-01
++8.758871280259100667e-01 8.749452028944590953e-01 8.702689853121506891e-01
++8.798952803818768098e-01 8.789618087644507360e-01 8.742614219551688715e-01
++8.839147569330807475e-01 8.829897172412359829e-01 8.782650968268708169e-01
++8.879456264404302912e-01 8.870289962776199966e-01 8.822800776100528930e-01
++8.919879580252079165e-01 8.910797141836338531e-01 8.863064323430556168e-01
++8.960441427301344408e-01 8.951442561280015253e-01 8.903465328361804820e-01
++9.001128904953542564e-01 8.992213337528862649e-01 8.943990982004267343e-01
++9.041933650584489390e-01 9.033101118731188262e-01 8.984632980967039995e-01
++9.082856377297909845e-01 9.074106609684426950e-01 9.025392027229122149e-01
++9.123897802040108473e-01 9.115230518994157372e-01 9.066268826559935601e-01
++9.165062601210144377e-01 9.156477504829055869e-01 9.107268012198581619e-01
++9.206377372962850636e-01 9.197874089604549663e-01 9.148415959800745290e-01
++9.247813586963474775e-01 9.239391805138976732e-01 9.189684361991556916e-01
++9.289371983431667923e-01 9.281031383100254439e-01 9.231073947496013510e-01
++9.331053306682361992e-01 9.322793559214043180e-01 9.272585449078167841e-01
++9.372858305148153990e-01 9.364679073285836486e-01 9.314219603563131944e-01
++9.414805849385761150e-01 9.406706735323028257e-01 9.355995118038626934e-01
++9.456895815303881792e-01 9.448876411191396985e-01 9.397911860891489111e-01
++9.499112324285693409e-01 9.491172259914930631e-01 9.439954080097928690e-01
++9.541456149743491322e-01 9.533595046046891008e-01 9.482122537117517735e-01
++9.583928069476742584e-01 9.576145538486544595e-01 9.524417997736036590e-01
++9.626528865695892501e-01 9.618824510502640424e-01 9.566841232088870717e-01
++9.717386353800526733e-01 9.973777600608618732e-01 4.115658643585359822e-01
++9.662006602777347686e-01 9.937266459819259490e-01 4.023251811958163393e-01
++9.607627521945550919e-01 9.900572267174857499e-01 3.929085929665734889e-01
++9.554415272451376451e-01 9.863634202187735456e-01 3.833020851902597670e-01
++9.502559385734440367e-01 9.826387048868144847e-01 3.734797610708937010e-01
++9.452247574758879667e-01 9.788787426033022099e-01 3.633572044040755400e-01
++9.403922547690045652e-01 9.750651532690909340e-01 3.529658674736868007e-01
++9.358012781940933111e-01 9.711846436929117976e-01 3.422125309180296115e-01
++9.315219006576069827e-01 9.672115998149192206e-01 3.310553617148976335e-01
++9.276515136764329483e-01 9.631091768055900504e-01 3.194750358456411865e-01
++9.243262891934023173e-01 9.588257749438183764e-01 3.074483567011621621e-01
++9.217020058646493430e-01 9.542951650631289473e-01 2.951579532336194300e-01
++9.198887370469149838e-01 9.494613758630886524e-01 2.829933059330041467e-01
++9.188014423728452229e-01 9.443342663663614189e-01 2.716012421636955776e-01
++9.181820869339853974e-01 9.389970698605141219e-01 2.614202290916152749e-01
++9.177841550998647735e-01 9.335426933786861170e-01 2.524800001657211412e-01
++9.174401026070885257e-01 9.280407871647589069e-01 2.446155106635521936e-01
++9.170895513231805962e-01 9.225221346800714928e-01 2.375965624445583457e-01
++9.167020828694254497e-01 9.170043397013648567e-01 2.312467382449614473e-01
++9.162674970718558409e-01 9.114958340077099486e-01 2.254318760810480882e-01
++9.157691900066246005e-01 9.060063912564605415e-01 2.200571360818813216e-01
++9.152197058922081352e-01 9.005338027659569589e-01 2.150417998700874245e-01
++9.146241645334555193e-01 8.950779708690549397e-01 2.103289435929298068e-01
++9.139711070576973517e-01 8.896449914470077047e-01 2.058761237663177535e-01
++9.132755157040669536e-01 8.842301350859270714e-01 2.016464740967732761e-01
++9.125407126803214419e-01 8.788330083046588248e-01 1.976125145460150279e-01
++9.117530169460994482e-01 8.734600806229881886e-01 1.937497985711440218e-01
++9.109311963239964394e-01 8.681043338417845368e-01 1.900403276536027364e-01
++9.100752049629435847e-01 8.627663273889324413e-01 1.864683841517677521e-01
++9.091854095601151764e-01 8.574463833033296734e-01 1.830203816986048226e-01
++9.082549005100644113e-01 8.521478984780772592e-01 1.796821188488442467e-01
++9.072929210165844305e-01 8.468673217860986924e-01 1.764454502969030336e-01
++9.063013792870692198e-01 8.416041433916346959e-01 1.733019473598792493e-01
++9.052811273728736952e-01 8.363582655293054779e-01 1.702439219249277103e-01
++9.042330703505969680e-01 8.311295331123278451e-01 1.672645945644082588e-01
++9.031581378443196417e-01 8.259177493137719317e-01 1.643579680291452627e-01
++9.020572628789119696e-01 8.207226877358885231e-01 1.615187200622499042e-01
++9.009313663687085194e-01 8.155441018959304067e-01 1.587421124067343314e-01
++8.997813459322432372e-01 8.103817325993176723e-01 1.560239134014781981e-01
++8.986080680213675009e-01 8.052353136482993667e-01 1.533603319950107013e-01
++8.974123625824063089e-01 8.001045762385368132e-01 1.507479613684808151e-01
++8.961950196441476058e-01 7.949892523212133133e-01 1.481837306596257842e-01
++8.949567873642767513e-01 7.898890771497076857e-01 1.456648635287154658e-01
++8.936983711718720080e-01 7.848037911839249592e-01 1.431888425141153720e-01
++8.924204337256359532e-01 7.797331414892141321e-01 1.407533782964209279e-01
++8.911216151255343387e-01 7.746778361440714855e-01 1.383548030403051743e-01
++8.898020181760183389e-01 7.696378889985142635e-01 1.359906608477614021e-01
++8.884645911096110682e-01 7.646119206511362565e-01 1.336610605915157513e-01
++8.871098774237282658e-01 7.595996914637694886e-01 1.313644302926826601e-01
++8.857383791003278217e-01 7.546009727066200767e-01 1.290993233143932217e-01
++8.843505587935225343e-01 7.496155463925207041e-01 1.268644048815629477e-01
++8.829468419986222782e-01 7.446432050409976799e-01 1.246584402943621550e-01
++8.815249085514379468e-01 7.396851204434677918e-01 1.224776444651401730e-01
++8.800852120157934833e-01 7.347410842227017902e-01 1.203208501022957344e-01
++8.786308879175975806e-01 7.298095076593623665e-01 1.181897480034229675e-01
++8.771622516330287445e-01 7.248902111580254326e-01 1.160834456649006141e-01
++8.756795889485279316e-01 7.199830249122411985e-01 1.140011085329386831e-01
++8.741818688473920185e-01 7.150884618420272343e-01 1.119405415999485953e-01
++8.726664701310860028e-01 7.102078845126149620e-01 1.098977185964423176e-01
++8.711380365425036576e-01 7.053388457490094021e-01 1.078767213026572136e-01
++8.695967618761146767e-01 7.004812035381728919e-01 1.058769266693721234e-01
++8.680428176626151515e-01 6.956348241211850469e-01 1.038977462027144416e-01
++8.664728647912948167e-01 6.908014665312249836e-01 1.019343675562955354e-01
++8.648889520799001307e-01 6.859800077414488495e-01 9.998838514326469085e-02];
++
++   case 'sol' 
++      RGB = [2.014250997833959556e-01 7.730778455372402935e-02 9.342024025258441333e-02
++2.062319592710875060e-01 7.906207768979725548e-02 9.541606071998920413e-02
++2.110428892884436691e-01 8.079536357043612393e-02 9.737846202556904585e-02
++2.158580822956807643e-01 8.250806203226229707e-02 9.930725029816905858e-02
++2.206777103783343352e-01 8.420058748958639261e-02 1.012022063667477878e-01
++2.255019582885565144e-01 8.587332122435217818e-02 1.030630633154644982e-01
++2.303310909623697555e-01 8.752655129320324745e-02 1.048894558390352783e-01
++2.351651244914957362e-01 8.916077192669072393e-02 1.066811567589351084e-01
++2.400041538413338893e-01 9.077639059472936145e-02 1.084378476867565166e-01
++2.448482542469172518e-01 9.237381813988079782e-02 1.101591880324293282e-01
++2.496974811012195872e-01 9.395347052392380438e-02 1.118448155598189275e-01
++2.545518697677066067e-01 9.551577058896976169e-02 1.134943469265998206e-01
++2.594114353201673606e-01 9.706114983944272301e-02 1.151073782157037984e-01
++2.642761722125430146e-01 9.859005025060077476e-02 1.166834854654446307e-01
++2.691460538812255332e-01 1.001029261086328892e-01 1.182222252052740896e-01
++2.740210322821139965e-01 1.016002458867145131e-01 1.197231350040377507e-01
++2.789010373645949281e-01 1.030824941607314804e-01 1.211857340375411263e-01
++2.837859764845531707e-01 1.045501735676682975e-01 1.226095236822268009e-01
++2.886757337585150185e-01 1.060038068088898222e-01 1.239939881417738143e-01
++2.935705596266552364e-01 1.074435592047325860e-01 1.253382180210721730e-01
++2.984708123016127645e-01 1.088694832683588798e-01 1.266411225341654012e-01
++3.033754705455499190e-01 1.102829776040219478e-01 1.279029157767591629e-01
++3.082843160981594277e-01 1.116846670615513903e-01 1.291230138435368602e-01
++3.131971029671865581e-01 1.130752078289798124e-01 1.303008196341493008e-01
++3.181135564546491157e-01 1.144552897453308959e-01 1.314357238709698839e-01
++3.230337594016901570e-01 1.158252511924781902e-01 1.325266762725714476e-01
++3.279584359813157990e-01 1.171847867104950369e-01 1.335718110238658662e-01
++3.328858414856893377e-01 1.185360731157172887e-01 1.345719725768937669e-01
++3.378155708245871303e-01 1.198799635036237599e-01 1.355265097514237183e-01
++3.427471842250678358e-01 1.212173573516503733e-01 1.364347662233350855e-01
++3.476817676568914606e-01 1.225476080130979417e-01 1.372941239039429107e-01
++3.526179187878998866e-01 1.238726093833323050e-01 1.381049156392651633e-01
++3.575544570498519481e-01 1.251940557912539775e-01 1.388672386602565201e-01
++3.624908511464776661e-01 1.265129959708437557e-01 1.395803418854749678e-01
++3.674287950126607916e-01 1.278281902872998865e-01 1.402403192837867185e-01
++3.723652245912653647e-01 1.291433283978542790e-01 1.408496559025098349e-01
++3.772994043575393919e-01 1.304597230378949646e-01 1.414077190879147183e-01
++3.822328244976108125e-01 1.317763828069311027e-01 1.419104659088263887e-01
++3.871627501840784191e-01 1.330967329073056149e-01 1.423599677282273157e-01
++3.920880611619059208e-01 1.344225444091708133e-01 1.427559829693639537e-01
++3.970102845366911826e-01 1.357528321160993978e-01 1.430939047058796265e-01
++4.019257908029647552e-01 1.370920335458912787e-01 1.433773252895977068e-01
++4.068349561616130816e-01 1.384404082220755672e-01 1.436033049025308150e-01
++4.117365731263126216e-01 1.397998954736640875e-01 1.437714012378476514e-01
++4.166285955020519460e-01 1.411733354490503911e-01 1.438826947863026673e-01
++4.215115464927484679e-01 1.425608842716513391e-01 1.439334793454142836e-01
++4.263818625509953053e-01 1.439670074541691269e-01 1.439276912848104217e-01
++4.312408181144407604e-01 1.453911021832318962e-01 1.438598606513883382e-01
++4.360843175580979003e-01 1.468382080621888075e-01 1.437352070106750757e-01
++4.409133399041038626e-01 1.483080544589621963e-01 1.435484892033262738e-01
++4.457240620502335715e-01 1.498053889889406909e-01 1.433047202671754727e-01
++4.505169861034231116e-01 1.513304477119505886e-01 1.429993558897900696e-01
++4.552886678338638471e-01 1.528875528172430887e-01 1.426369447211624508e-01
++4.600387072749128614e-01 1.544778583065680166e-01 1.422148901612839134e-01
++4.647645669051368444e-01 1.561046932382532393e-01 1.417359354431781127e-01
++4.694647696847664142e-01 1.577702615986552870e-01 1.412003046328143552e-01
++4.741377460736882488e-01 1.594768244179092798e-01 1.406085235372486197e-01
++4.787811635810699795e-01 1.612273475797827982e-01 1.399635953741071304e-01
++4.833940392196432456e-01 1.630233960258756498e-01 1.392646788568434324e-01
++4.879740080405346458e-01 1.648678210719416448e-01 1.385155272254653958e-01
++4.925195693223419213e-01 1.667625387560449646e-01 1.377175480485133274e-01
++4.970292850743541213e-01 1.687093212494573113e-01 1.368722045288005285e-01
++5.015013418271374590e-01 1.707101850535491239e-01 1.359828524777431658e-01
++5.059344608615837791e-01 1.727665378729273671e-01 1.350513348829507354e-01
++5.103272555076001638e-01 1.748797680652766917e-01 1.340804814887887886e-01
++5.146784999821305551e-01 1.770509926066398676e-01 1.330731030668735604e-01
++5.189871207659747521e-01 1.792810660321904059e-01 1.320320170625302603e-01
++5.232521628013230286e-01 1.815706081303557207e-01 1.309602397868673829e-01
++5.274729145399480457e-01 1.839199144444812750e-01 1.298602350351042156e-01
++5.316485781433754054e-01 1.863291944433481395e-01 1.287360215107217765e-01
++5.357788119794710813e-01 1.887982003317690283e-01 1.275896151617726404e-01
++5.398632980453529351e-01 1.913265486380361924e-01 1.264236887032485768e-01
++5.439016755531911329e-01 1.939137144580994065e-01 1.252427388260835273e-01
++5.478941342086204314e-01 1.965587857098634594e-01 1.240472431523338970e-01
++5.518406011876045847e-01 1.992608233247842864e-01 1.228416287224595171e-01
++5.557413604777560190e-01 2.020186434106095441e-01 1.216276788300265921e-01
++5.595967825163993270e-01 2.048309740311727856e-01 1.204067641590413351e-01
++5.634071785471536087e-01 2.076963248023981912e-01 1.191839172318373274e-01
++5.671732069794859221e-01 2.106133447776186718e-01 1.179569341314256059e-01
++5.708953502475510033e-01 2.135801749668952421e-01 1.167331750031382620e-01
++5.745743340603017835e-01 2.165955297740416174e-01 1.155086834950974917e-01
++5.782108774062354462e-01 2.196573476346848075e-01 1.142903383669127693e-01
++5.818056681759461446e-01 2.227643917275112795e-01 1.130745297734544186e-01
++5.853596324247829497e-01 2.259144368785390156e-01 1.118679346243981187e-01
++5.888733531729506421e-01 2.291064977832514282e-01 1.106657061174652901e-01
++5.923480147332496060e-01 2.323380142637169188e-01 1.094762267036840098e-01
++5.957840241257977842e-01 2.356083643285451501e-01 1.082930207415330470e-01
++5.991826510896112179e-01 2.389150535758420846e-01 1.071233989765111305e-01
++6.025444033584952397e-01 2.422572079085022478e-01 1.059638000704014038e-01
++6.058701491001592387e-01 2.456332409492081315e-01 1.048158025498839019e-01
++6.091610396494541169e-01 2.490411636600449730e-01 1.036832083023569995e-01
++6.124172967183565408e-01 2.524805655496659695e-01 1.025613962727195683e-01
++6.156402174450263942e-01 2.559493015306805175e-01 1.014554136320146294e-01
++6.188304674185852727e-01 2.594462946423264360e-01 1.003647858381197522e-01
++6.219883549579363624e-01 2.629709881912258296e-01 9.928701461787994842e-02
++6.251150949354874475e-01 2.665215196417168309e-01 9.822607331815666476e-02
++6.282114705640686747e-01 2.700967151118268128e-01 9.718275325572381385e-02
++6.312775931157122988e-01 2.736963322450938207e-01 9.615407260814298751e-02
++6.343140968307461325e-01 2.773194022482146082e-01 9.514062524056160486e-02
++6.373225940474543938e-01 2.809637253536654833e-01 9.414820920814792604e-02
++6.403029049301643960e-01 2.846294803262617856e-01 9.317287627515624671e-02
++6.432554503146770131e-01 2.883160464262430889e-01 9.221435672465166933e-02
++6.461807870545831500e-01 2.920226445998113096e-01 9.127322088316058846e-02
++6.490798649799141007e-01 2.957480457349839220e-01 9.035190862912848009e-02
++6.519534890851086395e-01 2.994912417888541123e-01 8.945207804511770555e-02
++6.548014840508611378e-01 3.032523985397311828e-01 8.857115779395227650e-02
++6.576243271404891289e-01 3.070309030666096284e-01 8.770973119670061324e-02
++6.604224780876138956e-01 3.108261780844247535e-01 8.686839073952234980e-02
++6.631963792788750922e-01 3.146376804982159436e-01 8.604773901491818977e-02
++6.659464950830153995e-01 3.184648571182398524e-01 8.524854019761693436e-02
++6.686740068110078594e-01 3.223063950997894223e-01 8.447431908919650345e-02
++6.713784685540787889e-01 3.261627733896342862e-01 8.372242463404078183e-02
++6.740602498156743616e-01 3.300335755312562847e-01 8.299350184989945367e-02
++6.767197045307955516e-01 3.339184117562906673e-01 8.228820834254704786e-02
++6.793571714405546302e-01 3.378169176731946055e-01 8.160721412236313088e-02
++6.819729744807380145e-01 3.417287529939577184e-01 8.095120122856311329e-02
++6.845674231809769639e-01 3.456536003014257785e-01 8.032086315939043764e-02
++6.871408130714994345e-01 3.495911638591582271e-01 7.971690410726239850e-02
++6.896934260947393813e-01 3.535411684651399988e-01 7.914003799874758105e-02
++6.922255310194272981e-01 3.575033583501715517e-01 7.859098734029026923e-02
++6.947373838550107150e-01 3.614774961213378379e-01 7.807048187183049381e-02
++6.972292282645524697e-01 3.654633617505798626e-01 7.757925703187978916e-02
++6.997012959744630667e-01 3.694607516080961052e-01 7.711805223920600860e-02
++7.021538071796381564e-01 3.734694775400307920e-01 7.668760899803153674e-02
++7.045869709427744487e-01 3.774893659897066711e-01 7.628866883556534306e-02
++7.070009855867870341e-01 3.815202571614760840e-01 7.592197108269088668e-02
++7.093960390794303850e-01 3.855620042261392877e-01 7.558825051079040569e-02
++7.117723094093527658e-01 3.896144725667428643e-01 7.528823483980665032e-02
++7.141299649529336824e-01 3.936775390635336991e-01 7.502264213486334321e-02
++7.164691648313716854e-01 3.977510914167320943e-01 7.479217811087204848e-02
++7.187900592575979797e-01 4.018350275057843701e-01 7.459753336661339995e-02
++7.210927898726463559e-01 4.059292547837213827e-01 7.443938057163165811e-02
++7.233774900712311995e-01 4.100336897052239138e-01 7.431837163097509968e-02
++7.256442853163093121e-01 4.141482571870220286e-01 7.423513485418420377e-02
++7.278932934424962031e-01 4.182728900992377374e-01 7.419027215599127700e-02
++7.301246249482277184e-01 4.224075287863344741e-01 7.418435631686179366e-02
++7.323383832766364732e-01 4.265521206163164214e-01 7.421792833176479864e-02
++7.345353882716817440e-01 4.307060349567022883e-01 7.429319537753659164e-02
++7.367156646423576039e-01 4.348693003618859243e-01 7.441039153688730479e-02
++7.388787494489402752e-01 4.390423308641819844e-01 7.456862859096566321e-02
++7.410247212778052761e-01 4.432250991934941209e-01 7.476828631581519669e-02
++7.431536528151155840e-01 4.474175832571065103e-01 7.500970147240951236e-02
++7.452656110665121236e-01 4.516197658271001170e-01 7.529316628527241151e-02
++7.473606575657232298e-01 4.558316342481479322e-01 7.561892717684162712e-02
++7.494388485722311977e-01 4.600531801646510766e-01 7.598718377039928584e-02
++7.515014494005359813e-01 4.642834853101814319e-01 7.640057068894035019e-02
++7.535482386381918696e-01 4.685227724793568638e-01 7.685851802683341116e-02
++7.555784292647326206e-01 4.727716755322179387e-01 7.735934440269953694e-02
++7.575920584303713623e-01 4.770302023787819645e-01 7.790304647924226056e-02
++7.595891587998102601e-01 4.812983641144596425e-01 7.848957351759905388e-02
++7.615697586917992146e-01 4.855761748409669898e-01 7.911882810663906085e-02
++7.635351559772435293e-01 4.898627402128037933e-01 7.979298836587264687e-02
++7.654855818523200739e-01 4.941579525945941076e-01 8.051210547168902165e-02
++7.674196884953543574e-01 4.984628195279873775e-01 8.127340285315723389e-02
++7.693374880099380642e-01 5.027773670563000508e-01 8.207659805554132215e-02
++7.712389886872909051e-01 5.071016234993879213e-01 8.292136945254757752e-02
++7.731249880551478437e-01 5.114350748098054344e-01 8.380866202872513937e-02
++7.749971634096607387e-01 5.157766247025432627e-01 8.474069791771285387e-02
++7.768531656759695148e-01 5.201279334240793695e-01 8.571310136491594456e-02
++7.786929885023088360e-01 5.244890387928055064e-01 8.672540635712724932e-02
++7.805166220614638828e-01 5.288599804136482341e-01 8.777711918476124864e-02
++7.823261306937436821e-01 5.332394286426104246e-01 8.887078595429290240e-02
++7.841211261331867410e-01 5.376277019226174403e-01 9.000512625428583324e-02
++7.859000063657322066e-01 5.420258982280999893e-01 9.117718483670700369e-02
++7.876627478111991598e-01 5.464340650106903619e-01 9.238637445837943885e-02
++7.894103755328435446e-01 5.508515783238705499e-01 9.363351104642655964e-02
++7.911449489936349666e-01 5.552771776345648558e-01 9.492063714767667859e-02
++7.928634178435132185e-01 5.597128604871853819e-01 9.624295938665472505e-02
++7.945657449982463927e-01 5.641586812836011378e-01 9.759983714409603550e-02
++7.962529317489702718e-01 5.686140495102688375e-01 9.899190462101559174e-02
++7.979274645055595139e-01 5.730774789890704657e-01 1.004214627980108965e-01
++7.995858497679293464e-01 5.775511834408552092e-01 1.018835148330231588e-01
++8.012280368308171141e-01 5.820352236202099849e-01 1.033774013447087969e-01
++8.028560740659145267e-01 5.865283957952628358e-01 1.049048199319871921e-01
++8.044707409966546097e-01 5.910302911313597418e-01 1.064658666440542745e-01
++8.060691629501393063e-01 5.955426815778210869e-01 1.080566579062864629e-01
++8.076512751425731773e-01 6.000656338781130694e-01 1.096765425113208070e-01
++8.092212933019986565e-01 6.045967120149606799e-01 1.113292481825315650e-01
++8.107760556043207556e-01 6.091378327200270837e-01 1.130107512069984665e-01
++8.123144185459451050e-01 6.136896959567099685e-01 1.147193037693588491e-01
++8.138381395305365196e-01 6.182513237945769236e-01 1.164560306092000397e-01
++8.153492559398581863e-01 6.228216087115111543e-01 1.182221687055251269e-01
++8.168438497700267753e-01 6.274028329685673588e-01 1.200133807424188237e-01
++8.183218295752512361e-01 6.319950736315883555e-01 1.218290715633482957e-01
++8.197890431479778472e-01 6.365951069307501653e-01 1.236738150663118929e-01
++8.212397496268510899e-01 6.412061948148843893e-01 1.255419007966243339e-01
++8.226736710596913582e-01 6.458285162251576894e-01 1.274326125224898576e-01
++8.240954168836683857e-01 6.504595882304867738e-01 1.293492244766023536e-01
++8.255020135816337756e-01 6.551010940717902908e-01 1.312886736975442947e-01
++8.268916161790003105e-01 6.597540661653059635e-01 1.332490015865780419e-01
++8.282680782241739204e-01 6.644164751020815718e-01 1.352327076170389830e-01
++8.296302321797530688e-01 6.690890043064162684e-01 1.372383190289331867e-01
++8.309751426979781197e-01 6.737732479628292248e-01 1.392631732853782667e-01
++8.323064093623322446e-01 6.784673500649637257e-01 1.413094448639914957e-01
++8.336236702662669362e-01 6.831715585604193341e-01 1.433763438952303237e-01
++8.349233956754664732e-01 6.878877450853391196e-01 1.454609632889922177e-01
++8.362094522088989734e-01 6.926139541357441143e-01 1.475655370255327115e-01
++8.374812451634525701e-01 6.973505478666088830e-01 1.496891818583828970e-01
++8.387351652304512184e-01 7.020993985062000675e-01 1.518291366884736149e-01
++8.399758860500933233e-01 7.068581852631129481e-01 1.539880238042938276e-01
++8.412015039419409312e-01 7.116279196951651453e-01 1.561642027825314583e-01
++8.424088634362330019e-01 7.164102051502189150e-01 1.583553901645263495e-01
++8.436040043728154636e-01 7.212020966440341185e-01 1.605648786739153067e-01
++8.447825998855326146e-01 7.260057762544317450e-01 1.627897017014220959e-01
++8.459425004297633777e-01 7.308223161702667170e-01 1.650283355910636407e-01
++8.470916909310660659e-01 7.356478948636396842e-01 1.672849872513207936e-01
++8.482222682093125687e-01 7.404863725972353761e-01 1.695548732398838021e-01
++8.493354922705429466e-01 7.453371669715372905e-01 1.718384513727829743e-01
++8.504363950839656239e-01 7.501979378252857655e-01 1.741381147288197651e-01
++8.515178010463546610e-01 7.550721145067320617e-01 1.764497766633903175e-01
++8.525841071331127230e-01 7.599576641399760080e-01 1.787754909642916834e-01
++8.536351063891680635e-01 7.648547324583224727e-01 1.811148665949305070e-01
++8.546660216706046809e-01 7.697655561558608417e-01 1.834652953721074564e-01
++8.556846647048813592e-01 7.746865865799383855e-01 1.858303883039418847e-01
++8.566843283862169978e-01 7.796209322090990046e-01 1.882066457578640828e-01
++8.576654697805085048e-01 7.845684046728831351e-01 1.905941213680029112e-01
++8.586333372669123776e-01 7.895266856020336510e-01 1.929950487363375766e-01
++8.595800514528921799e-01 7.944993343355386539e-01 1.954056082908571246e-01
++8.605118919067250571e-01 7.994835879345245644e-01 1.978284835821235155e-01
++8.614257659190140970e-01 8.044808542070145396e-01 2.002621028413892890e-01
++8.623187318174559968e-01 8.094924397675259398e-01 2.027050514589471275e-01
++8.631990866135879070e-01 8.145147714844941378e-01 2.051607456378260474e-01
++8.640570316077024193e-01 8.195521241156307202e-01 2.076248627732380503e-01
++8.648985892446832136e-01 8.246019286985761809e-01 2.100998205615737802e-01
++8.657217542057287218e-01 8.296650789343075205e-01 2.125846498551076103e-01
++8.665227359996962031e-01 8.347431960854363453e-01 2.150777232526754901e-01
++8.673102956545263309e-01 8.398326248425269647e-01 2.175824369796515168e-01
++8.680739840584389411e-01 8.449377672354075886e-01 2.200945521598048904e-01
++8.688209397597312922e-01 8.500556721057834775e-01 2.226167862486261861e-01
++8.695475257414353454e-01 8.551878730451877297e-01 2.251476450914057237e-01
++8.702518466222823879e-01 8.603351573784762119e-01 2.276863618988967386e-01
++8.709403456886846140e-01 8.654949292658645765e-01 2.302352780671254040e-01
++8.716032871795772463e-01 8.706711460791707324e-01 2.327907403748207260e-01
++8.722504095804027857e-01 8.758599106230183784e-01 2.353562666294088945e-01
++8.728735089177709350e-01 8.810645242778994968e-01 2.379288443348342996e-01
++8.734755480931443161e-01 8.862838169179700909e-01 2.405095194908647427e-01
++8.740576468844427627e-01 8.915173698391286594e-01 2.430986533749082690e-01
++8.746134519571161503e-01 8.967676725126847437e-01 2.456940353088591378e-01
++8.751533192048812637e-01 9.020307187484648548e-01 2.482992135687792645e-01
++8.756648875509137619e-01 9.073112946820588443e-01 2.509099777331614822e-01
++8.761579961220332669e-01 9.126056308170312770e-01 2.535296558873600947e-01
++8.766251762717257590e-01 9.179165870428791507e-01 2.561557673694155324e-01
++8.770689942806796369e-01 9.232431892037369359e-01 2.587891932203917889e-01
++8.774903570045399226e-01 9.285851079338152125e-01 2.614302497362179234e-01
++8.778834706355089779e-01 9.339444999568264905e-01 2.640771174844134261e-01
++8.782575035190057777e-01 9.393179743031147000e-01 2.667327577149610218e-01
++8.785999460636340075e-01 9.447101339348284998e-01 2.693932729818908633e-01
++8.789235199162210854e-01 9.501163253664915986e-01 2.720626987422674059e-01
++8.792160143882136181e-01 9.555409855460589297e-01 2.747373107314689533e-01
++8.794851333774609259e-01 9.609813222108515296e-01 2.774195521504189688e-01
++8.797259382267708094e-01 9.664391027363387066e-01 2.801079938733134767e-01
++8.799388863582034981e-01 9.719141474258771174e-01 2.828028665891310078e-01
++8.801261631980005218e-01 9.774056784469543624e-01 2.855049064351531940e-01
++8.802811281654138176e-01 9.829160047653974219e-01 2.882122575277183407e-01
++8.804129372223431504e-01 9.884419266545670935e-01 2.909276978215925569e-01
++8.805080058500511786e-01 9.939881188401472611e-01 2.936474048368232226e-01]; 
++
++   case 'pha' 
++      RGB = [6.583083928922510708e-01 4.699391690315133929e-01 4.941288203988051381e-02
++6.643374189373471017e-01 4.662019008569991407e-01 5.766473450402211792e-02
++6.702086925052345157e-01 4.624801381219734719e-01 6.534560309537773559e-02
++6.760429905334627287e-01 4.586983759956768103e-01 7.273174322210870790e-02
++6.817522846284524984e-01 4.549140651836585669e-01 7.979261956680192003e-02
++6.874028047282801923e-01 4.510841669914616436e-01 8.667102950867147659e-02
++6.929504980948593129e-01 4.472389296506211198e-01 9.335868960148416273e-02
++6.984261912087648128e-01 4.433576785927097474e-01 9.992839268327721736e-02
++7.038122981036579739e-01 4.394532762349419586e-01 1.063871045640915336e-01
++7.091206923190102041e-01 4.355176525107516405e-01 1.127717449252612913e-01
++7.143452449012380745e-01 4.315557562030358230e-01 1.190934789448820086e-01
++7.194928861674689813e-01 4.275627171694253437e-01 1.253760590955056708e-01
++7.245561927479047259e-01 4.235446971269447580e-01 1.316232516304018385e-01
++7.295489482895208821e-01 4.194909849233816046e-01 1.378630483492892522e-01
++7.344517242247444733e-01 4.154177405103107734e-01 1.440803933719045082e-01
++7.392949550641365608e-01 4.112997327023164562e-01 1.503221736968965161e-01
++7.440383351241327547e-01 4.071715772870146410e-01 1.565433461845777419e-01
++7.487369523694534790e-01 4.029851907815384382e-01 1.628228161295872112e-01
++7.533231937521204236e-01 3.988010690198531272e-01 1.690756638056752914e-01
++7.578808294584169492e-01 3.945424511336589335e-01 1.754217924072464518e-01
++7.623326022156785564e-01 3.902809567197497165e-01 1.817591538530497208e-01
++7.667320478995347521e-01 3.859654943537603744e-01 1.881681875043557384e-01
++7.710524721820763983e-01 3.816214148216601210e-01 1.946153193576832252e-01
++7.752952778457107286e-01 3.772473246523442292e-01 2.011065208945331251e-01
++7.794866593781552000e-01 3.728150850100374614e-01 2.076872953652798559e-01
++7.835853362619955575e-01 3.683677247727679127e-01 2.142973641992331202e-01
++7.876376313731141554e-01 3.638539950288945946e-01 2.210164757476915653e-01
++7.916113385801130109e-01 3.593080404226161040e-01 2.277974012097270795e-01
++7.955060552511121763e-01 3.547298979176854994e-01 2.346435260251332755e-01
++7.993539838133075781e-01 3.500795929482780067e-01 2.416183193481767355e-01
++8.031167084780931331e-01 3.454015163918872089e-01 2.486589162182153978e-01
++8.068103261859892461e-01 3.406745225101673324e-01 2.558007514596662979e-01
++8.104452043001210138e-01 3.358824841311982556e-01 2.630722168071251699e-01
++8.139968010634672790e-01 3.310553831960054150e-01 2.704318260711638389e-01
++8.174768947816700715e-01 3.261752637674419919e-01 2.779109619017897659e-01
++8.208941481936247175e-01 3.212262889577221503e-01 2.855384604486080891e-01
++8.242271261613036692e-01 3.162361985850312696e-01 2.932761677775464482e-01
++8.274766137520660481e-01 3.112015433453460544e-01 3.011338788484150264e-01
++8.306639856730879679e-01 3.060845940504859919e-01 3.091757851828964565e-01
++8.337630658888238733e-01 3.009224359536462057e-01 3.173492086215453090e-01
++8.367728587568070697e-01 2.957134612590129330e-01 3.256619937531243236e-01
++8.396969301670653696e-01 2.904472328682123905e-01 3.341366497709652439e-01
++8.425387334318170662e-01 2.851115076990556330e-01 3.427996193346179443e-01
++8.452829693062083871e-01 2.797291658336165110e-01 3.516207809735176215e-01
++8.479270414576970394e-01 2.743004518168249417e-01 3.606068061808916925e-01
++8.504679257105771661e-01 2.688262350691851821e-01 3.697639476988339724e-01
++8.529105574510703613e-01 2.632885874038991547e-01 3.791311611530527870e-01
++8.552420044048544279e-01 2.577088839643039142e-01 3.886821696092926381e-01
++8.574567263211506640e-01 2.520936658861107627e-01 3.984160108673813205e-01
++8.595502320723124035e-01 2.464473708549377862e-01 4.083362533435646036e-01
++8.615176695665305306e-01 2.407756349505418836e-01 4.184455712413106543e-01
++8.633539245616504987e-01 2.350852138633325872e-01 4.287460573240959860e-01
++8.650568452189218993e-01 2.293728768111193417e-01 4.392600781097817930e-01
++8.666160631462880293e-01 2.236630759123471868e-01 4.499612660389528673e-01
++8.680257787196800079e-01 2.179678524813165597e-01 4.608475800597766070e-01
++8.692800281403405549e-01 2.123013227323138907e-01 4.719155444862356830e-01
++8.703727414475561641e-01 2.066798807505955682e-01 4.831601540690036445e-01
++8.712978068076887572e-01 2.011223984119477337e-01 4.945747939602412324e-01
++8.720491402648608004e-01 1.956504128743852822e-01 5.061511790861612514e-01
++8.726207597696474805e-01 1.902882889012951495e-01 5.178793172539123413e-01
++8.730068619526127893e-01 1.850633392111822872e-01 5.297474998646168887e-01
++8.732018998073337590e-01 1.800058813906028066e-01 5.417423233741458510e-01
++8.732006592202997686e-01 1.751492049740893675e-01 5.538487436526324803e-01
++8.729983321570818910e-01 1.705294177324829519e-01 5.660501641838993070e-01
++8.725905843033689990e-01 1.661851370964102237e-01 5.783285576821829421e-01
++8.719736126526835829e-01 1.621569796196943858e-01 5.906646606873059424e-01
++8.711441430703839028e-01 1.584866680756561452e-01 6.030388085538075371e-01
++8.700996606911847175e-01 1.552168662477456385e-01 6.154284378630663355e-01
++8.688382315166471859e-01 1.523889228568965915e-01 6.278117548576560569e-01
++8.673585803491290491e-01 1.500419870434277214e-01 6.401665059420836856e-01
++8.656600953609360216e-01 1.482114935188816873e-01 6.524702171100530412e-01
++8.637428203708292784e-01 1.469276207331668138e-01 6.647004334019646077e-01
++8.616074355850228406e-01 1.462138565700954185e-01 6.768349518289993316e-01
++8.592552279602999610e-01 1.460858181738819150e-01 6.888520417478360969e-01
++8.566880526588371847e-01 1.465504601378146143e-01 7.007306474947510022e-01
++8.539082940810565070e-01 1.476057634824317899e-01 7.124505416663439172e-01
++8.509188132430276497e-01 1.492409439214724132e-01 7.239924974090546916e-01
++8.477228732160004832e-01 1.514371672020923265e-01 7.353384896921373315e-01
++8.443240935674275471e-01 1.541686506679828816e-01 7.464717393223647690e-01
++8.407263939629991967e-01 1.574040314553000475e-01 7.573767829039294019e-01
++8.369339386719339968e-01 1.611078555520196187e-01 7.680395184197363889e-01
++8.329510832270686782e-01 1.652420527841307607e-01 7.784472273410004695e-01
++8.287823240288615390e-01 1.697672910052525075e-01 7.885885755886976600e-01
++8.244322514509230260e-01 1.746441391323516057e-01 7.984535959358352031e-01
++8.199055067926670493e-01 1.798340046929527702e-01 8.080336545530442116e-01
++8.152067432395495583e-01 1.852998414406232253e-01 8.173214043862717659e-01
++8.103405908369269994e-01 1.910066437572490727e-01 8.263107279415592421e-01
++8.053117579051806141e-01 1.969216010609510237e-01 8.349964504885767358e-01
++8.001246695316600599e-01 2.030146524204510805e-01 8.433748621071933682e-01
++7.947836730093801316e-01 2.092582614636481764e-01 8.514431956464665330e-01
++7.892930180385833161e-01 2.156273737159832282e-01 8.591995655348122485e-01
++7.836568069717744223e-01 2.220993550443281506e-01 8.666429444356050782e-01
++7.778789796122015376e-01 2.286538551089048465e-01 8.737730828797295457e-01
++7.719633002465959848e-01 2.352726496465096795e-01 8.805904299224873721e-01
++7.659133466040326521e-01 2.419394735315277267e-01 8.870960555269299386e-01
++7.597325004651533931e-01 2.486398530394249295e-01 8.932915751926430170e-01
++7.534239396834068181e-01 2.553609429642716422e-01 8.991790771963389384e-01
++7.469906314200031039e-01 2.620913721366889826e-01 9.047610526867282399e-01
++7.404353264352245834e-01 2.688210993418901351e-01 9.100403287788533246e-01
++7.337605543192734503e-01 2.755412805372748908e-01 9.150200047193097763e-01
++7.269686195850667554e-01 2.822441475132592692e-01 9.197033911407090923e-01
++7.200615985827201193e-01 2.889228976436723495e-01 9.240939523881464002e-01
++7.130413372306516617e-01 2.955715940634778272e-01 9.281952518796100504e-01
++7.059094495911268918e-01 3.021850754377659598e-01 9.320109004535763741e-01
++6.986673173487639721e-01 3.087588744057577217e-01 9.355445076582962205e-01
++6.913160902792203633e-01 3.152891437666022756e-01 9.387996359465969887e-01
++6.838566878221142842e-01 3.217725894980000279e-01 9.417797577558794098e-01
++6.762898018976056802e-01 3.282064097483991527e-01 9.444882154741288671e-01
++6.686159011300095711e-01 3.345882390078672719e-01 9.469281843183131597e-01
++6.608352366648267973e-01 3.409160967342457216e-01 9.491026381806494383e-01
++6.529478497874137144e-01 3.471883397852293385e-01 9.510143185305323099e-01
++6.449535815726188392e-01 3.534036180803885596e-01 9.526657064947888776e-01
++6.368520848146350666e-01 3.595608329884161236e-01 9.540589982761437104e-01
++6.286428385050449874e-01 3.656590980031973470e-01 9.551960841088614762e-01
++6.203251651440072623e-01 3.716977013375789007e-01 9.560785309910512231e-01
++6.118982511841425387e-01 3.776760701263490727e-01 9.567075694743777392e-01
++6.033611709179768079e-01 3.835937359904362243e-01 9.570840848332117234e-01
++5.947129141266446206e-01 3.894503017735960748e-01 9.572086129751365968e-01
++5.859524178083830304e-01 3.952454093215529429e-01 9.570813414919564499e-01
++5.770786022984990549e-01 4.009787082326203289e-01 9.567021162826109260e-01
++5.680904120756430364e-01 4.066498255689147689e-01 9.560704542043091392e-01
++5.589868615201727398e-01 4.122583365789312393e-01 9.551855622225308151e-01
++5.497670858464057675e-01 4.178037365457583641e-01 9.540463635305430623e-01
++5.404303973688802110e-01 4.232854139404694238e-01 9.526515310905910860e-01
++5.309763471805271084e-01 4.287026251268353794e-01 9.509995290068892215e-01
++5.214047922154096959e-01 4.340544709302417981e-01 9.490886620701871612e-01
++5.117159675380545947e-01 4.393398754490472347e-01 9.469171337096092822e-01
++5.019105635439048418e-01 4.445575675481795996e-01 9.444831124449268867e-01
++4.919898075708288299e-01 4.497060655293146358e-01 9.417848067474301477e-01
++4.819555492105473404e-01 4.547836655159373520e-01 9.388205479873396042e-01
++4.718103483745911819e-01 4.597884341201938230e-01 9.355888808698555881e-01
++4.615575649166388517e-01 4.647182059669867082e-01 9.320886604427106592e-01
++4.511980082251949020e-01 4.695721776839077433e-01 9.283178636903177683e-01
++4.407385246316099514e-01 4.743468819302843476e-01 9.242766906682317041e-01
++4.301872191964954406e-01 4.790386406828319177e-01 9.199661970019400448e-01
++4.195516590423077341e-01 4.836443962749994996e-01 9.153875906397229700e-01
++4.088406331006777528e-01 4.881609386110861704e-01 9.105429315654867128e-01
++3.980642083018061106e-01 4.925849423947825101e-01 9.054352272162426996e-01
++3.872337717548847147e-01 4.969130108713233906e-01 9.000685170373873278e-01
++3.763620564988861550e-01 5.011417254753421924e-01 8.944479427537497251e-01
++3.654612663762428770e-01 5.052684034325813922e-01 8.885787674719856089e-01
++3.545465439790672080e-01 5.092897968880314430e-01 8.824681923036010733e-01
++3.436377931849474154e-01 5.132015795889635079e-01 8.761266360928694485e-01
++3.327530939137686161e-01 5.170008198204416594e-01 8.695640864822369309e-01
++3.219116583925260011e-01 5.206848733578030020e-01 8.627916585616799416e-01
++3.111337198622898259e-01 5.242514414427805747e-01 8.558215206665023000e-01
++3.004403986093719392e-01 5.276986238157412856e-01 8.486667948769511804e-01
++2.898532566310526581e-01 5.310250549915590534e-01 8.413412305522999235e-01
++2.793961594244663282e-01 5.342293148180886631e-01 8.338605094653681604e-01
++2.690918119759744820e-01 5.373109871573702456e-01 8.262398418700288572e-01
++2.589630009926549015e-01 5.402702010433201307e-01 8.184947475296583397e-01
++2.490323931623479869e-01 5.431076290262466522e-01 8.106408952154365855e-01
++2.393222899575573326e-01 5.458244839403564308e-01 8.026939223701164972e-01
++2.298566351816503373e-01 5.484218890000336355e-01 7.946712158983202379e-01
++2.206551002944838191e-01 5.509024141956824216e-01 7.865870626923798792e-01
++2.117364094415158937e-01 5.532690129113547739e-01 7.784553296976853831e-01
++2.031184306485467883e-01 5.555248911915373622e-01 7.702897347110843063e-01
++1.948172015035146420e-01 5.576736467032974431e-01 7.621031776295352778e-01
++1.868465966290397962e-01 5.597192229650957973e-01 7.539076339343501187e-01
++1.792179884783634825e-01 5.616658613090964591e-01 7.457140662049784874e-01
++1.719421959020442647e-01 5.635174702399022850e-01 7.375349843171632447e-01
++1.650229512673002386e-01 5.652791533635259658e-01 7.293775439873284583e-01
++1.584611602813638387e-01 5.669560017699032395e-01 7.212481886261494779e-01
++1.522549918213680353e-01 5.685529672520610589e-01 7.131532051881548373e-01
++1.463987618681510117e-01 5.700750569206646245e-01 7.050976866560473288e-01
++1.408828405908224835e-01 5.715272914520931336e-01 6.970855353349069139e-01
++1.356936625367466953e-01 5.729146658465781305e-01 6.891194758268863740e-01
++1.308138525417579801e-01 5.742421127377883572e-01 6.812010763134157543e-01
++1.262224734293325157e-01 5.755144682058210837e-01 6.733307769330967307e-01
++1.218953938035638729e-01 5.767364399826563348e-01 6.655079242329828837e-01
++1.178065439715534068e-01 5.779123523036159282e-01 6.577323260140637284e-01
++1.139261298009009160e-01 5.790467957802227783e-01 6.499998366451625875e-01
++1.102234782385779766e-01 5.801439808367224726e-01 6.423063681141680803e-01
++1.066673235183970281e-01 5.812078215483343913e-01 6.346473314887408623e-01
++1.032263067644274834e-01 5.822419757773840132e-01 6.270172879951815270e-01
++9.986970116659238395e-02 5.832498248631478033e-01 6.194100074982554771e-01
++9.656813269866712512e-02 5.842344549012296051e-01 6.118185305845139643e-01
++9.329429206118067253e-02 5.851986396650793454e-01 6.042352341768219004e-01
++9.002364276931534848e-02 5.861448252640329981e-01 5.966519005456781821e-01
++8.673514013646366205e-02 5.870751166646858143e-01 5.890597894857422245e-01
++8.341198598223345528e-02 5.879912662222103181e-01 5.814497133016774955e-01
++8.004245400348602990e-02 5.888946643728962815e-01 5.738121141059205899e-01
++7.662083060590932360e-02 5.897863326271246542e-01 5.661371427838456372e-01
++7.314852485397654869e-02 5.906669189727291602e-01 5.584147388414824054e-01
++6.963540714651897390e-02 5.915366957529474279e-01 5.506347102299997687e-01
++6.610143501147561218e-02 5.923955600227664986e-01 5.427868121514007882e-01
++6.257860760091599195e-02 5.932430363153763375e-01 5.348608238014407323e-01
++5.911303759975024968e-02 5.940783314685343930e-01 5.268461376019544229e-01
++5.576765010285392871e-02 5.949002975004614724e-01 5.187321979872163702e-01
++5.262510565424809855e-02 5.957073200832398996e-01 5.105097808257538228e-01
++4.978880680939656161e-02 5.964975038111670624e-01 5.021693595319391967e-01
++4.738319269394732774e-02 5.972686215557058143e-01 4.937017361708459506e-01
++4.555066847662456869e-02 5.980181252952141424e-01 4.850980867717663014e-01
++4.444396189302631667e-02 5.987431566697054564e-01 4.763500004038906943e-01
++4.421322948900235222e-02 5.994405566877633040e-01 4.674495124401222834e-01
++4.498917867710291313e-02 6.001068740129568146e-01 4.583891327826852824e-01
++4.686604485069371245e-02 6.007383712762072170e-01 4.491618701849053319e-01
++4.988979024235475762e-02 6.013310288983726437e-01 4.397612541729841729e-01
++5.405573006313083712e-02 6.018805543938667846e-01 4.301812015738862294e-01
++5.932208540209162745e-02 6.023828876312081748e-01 4.204054325617814780e-01
++6.560773880422715587e-02 6.028325831369402144e-01 4.104377156032376628e-01
++7.281962363892094392e-02 6.032244155970721833e-01 4.002736262351211383e-01
++8.086176781346332554e-02 6.035528335053932381e-01 3.899094149354802585e-01
++8.964365767756551917e-02 6.038119404209635332e-01 3.793420777858104165e-01
++9.908952486975769469e-02 6.039955435016706176e-01 3.685641184021282157e-01
++1.091461686387718844e-01 6.040969460876761676e-01 3.575579876882719055e-01
++1.197411868235576382e-01 6.041085844094219448e-01 3.463409605502589250e-01
++1.308274635712054768e-01 6.040228036354146068e-01 3.349141605174003056e-01
++1.423800347596975990e-01 6.038311914501962585e-01 3.232669997463486489e-01
++1.543847008629261053e-01 6.035242532835117801e-01 3.113882295486853913e-01
++1.667909278439370091e-01 6.030930063069259717e-01 2.993102878563658198e-01
++1.795975741928860503e-01 6.025266800569213377e-01 2.870237044475537069e-01
++1.927996570161342460e-01 6.018136381688595771e-01 2.745296424849442141e-01
++2.063446461864067438e-01 6.009446614046377588e-01 2.618794002040416569e-01
++2.202728729725795254e-01 5.999042993738278318e-01 2.490425136645111337e-01
++2.344983329249494819e-01 5.986859114745567423e-01 2.361102156981361166e-01
++2.490441577314199684e-01 5.972745984023483112e-01 2.230778046167814499e-01
++2.638200588853058526e-01 5.956665601719514092e-01 2.100467332369221340e-01
++2.788103972435367339e-01 5.938520960352462463e-01 1.970548426870546432e-01
++2.939149436021079032e-01 5.918334783865150106e-01 1.842162055743405413e-01
++3.090633958032663053e-01 5.896130197890373514e-01 1.716194213262129398e-01
++3.241557701146778325e-01 5.872013194176191053e-01 1.593775348465770181e-01
++3.391058987925449908e-01 5.846116417760637285e-01 1.475901239657965436e-01
++3.537962403050050608e-01 5.818679304916246631e-01 1.363773405186440579e-01
++3.681790539934771678e-01 5.789861015095073560e-01 1.258005415905540103e-01
++3.821596573789931561e-01 5.759951191731197406e-01 1.159503977992311363e-01
++3.957282445230750900e-01 5.729092809436007183e-01 1.068503820674790161e-01
++4.088192648913888116e-01 5.697572697905517458e-01 9.855521202608327758e-02
++4.214810649035653500e-01 5.665415862717396722e-01 9.104002246571415990e-02
++4.336495334558000403e-01 5.632929561600926727e-01 8.434116239111955071e-02
++4.453890783516751273e-01 5.600085906382493706e-01 7.841305443909030171e-02
++4.567242130853677584e-01 5.566942951475172263e-01 7.322913012508130981e-02
++4.676501707681009479e-01 5.533637269053324204e-01 6.876762134759795142e-02
++4.781913781821610088e-01 5.500213008191600084e-01 6.498435721988443659e-02
++4.883968612384750885e-01 5.466619506976900800e-01 6.182162837413415074e-02
++4.982892398787829857e-01 5.432873953595327432e-01 5.922725775013665955e-02
++5.078911374422868663e-01 5.398982668933685058e-01 5.714465998451528223e-02
++5.172247456455653092e-01 5.364942872197172585e-01 5.551476288204022086e-02
++5.263115025893324583e-01 5.330744300746458331e-01 5.427792556635833293e-02
++5.351718645250624906e-01 5.296370658817842747e-01 5.337566853443905662e-02
++5.438251536372012973e-01 5.261800887043684982e-01 5.275207547378853862e-02
++5.522894663786476199e-01 5.227010255649303661e-01 5.235479075452074277e-02
++5.605816294780567866e-01 5.191971290183284848e-01 5.213559944466891055e-02
++5.687171933168381210e-01 5.156654540879882509e-01 5.205062439450063722e-02
++5.767104547724090091e-01 5.121029206313181259e-01 5.206020204364426168e-02
++5.845745037500035268e-01 5.085063619725217476e-01 5.212850674796504907e-02
++5.923212894447653643e-01 5.048725602928031408e-01 5.222298774900729218e-02
++5.999617038945115333e-01 5.011982688438658684e-01 5.231366903560310394e-02
++6.075056816322426112e-01 4.974802205790658793e-01 5.237234455720112675e-02
++6.149623152735116394e-01 4.937151222923196747e-01 5.237168182411356537e-02
++6.223399877334323538e-01 4.898996328220020513e-01 5.228422613133864444e-02
++6.296465225194588511e-01 4.860303233135512824e-01 5.208127381405584094e-02
++6.368893542334475022e-01 4.821036169426133333e-01 5.173155232549151578e-02
++6.440757220432393737e-01 4.781157049081125598e-01 5.119960076823739520e-02
++6.512128893528150719e-01 4.740624350126631525e-01 5.044367478760234530e-02
++6.583083928921535932e-01 4.699391690315524728e-01 4.941288204103298082e-02];
++
++   case 'hal' 
++      RGB = [1.629529545569048110e-01 9.521591660747855124e-02 4.225729247643043585e-01
++1.648101130638113809e-01 9.635115909727909322e-02 4.318459659833655540e-01
++1.666161667445505146e-01 9.744967053737302320e-02 4.412064832719169161e-01
++1.683662394047173716e-01 9.851521320092249123e-02 4.506510991070378780e-01
++1.700547063176806595e-01 9.955275459284393391e-02 4.601751103492678907e-01
++1.716750780810941956e-01 1.005687314559364776e-01 4.697722208210775574e-01
++1.732198670017069397e-01 1.015713570251385311e-01 4.794342308257477092e-01
++1.746804342417165035e-01 1.025709733421875103e-01 4.891506793097686878e-01
++1.760433654254164593e-01 1.035658402770499587e-01 4.989416012077843576e-01
++1.772982333235153807e-01 1.045802467658180357e-01 5.087715885336102639e-01
++1.784322966250933284e-01 1.056380265564063059e-01 5.186108302832771466e-01
++1.794226692010022772e-01 1.067416562108134404e-01 5.284836071020164727e-01
++1.802542327126359922e-01 1.079356346679062328e-01 5.383245681077661882e-01
++1.808975365813079994e-01 1.092386640641496154e-01 5.481352134375515606e-01
++1.813298273265454008e-01 1.107042924622455293e-01 5.578435355461390799e-01
++1.815069308605478937e-01 1.123613365530294061e-01 5.674471854200233700e-01
++1.813959559086370799e-01 1.142804413027345978e-01 5.768505865319291104e-01
++1.809499433760710929e-01 1.165251530113385336e-01 5.859821014031293407e-01
++1.801166524094891808e-01 1.191682999758127970e-01 5.947494236872948870e-01
++1.788419557731087683e-01 1.222886104999623413e-01 6.030366129604394221e-01
++1.770751344832933727e-01 1.259620672997293078e-01 6.107077426144936760e-01
++1.747764954226868062e-01 1.302486445940692350e-01 6.176174300439590814e-01
++1.719255883800615836e-01 1.351768519397535118e-01 6.236290832033221099e-01
++1.685302279919113078e-01 1.407308818346016399e-01 6.286357211183263294e-01
++1.646373543798159977e-01 1.468433194330099889e-01 6.325796572366660930e-01
++1.603141656593721487e-01 1.534074847391770635e-01 6.354701889106297852e-01
++1.556539455727427579e-01 1.602911795924207572e-01 6.373742153046678682e-01
++1.507373567977903506e-01 1.673688895313445446e-01 6.383989700654711941e-01
++1.456427577979826360e-01 1.745293312408868480e-01 6.386687569056349600e-01
++1.404368075255880977e-01 1.816841459042554952e-01 6.383089542091028301e-01
++1.351726504089350855e-01 1.887688275072176014e-01 6.374350053971095109e-01
++1.298906561807787186e-01 1.957398580438490798e-01 6.361469852044080442e-01
++1.246205125693149729e-01 2.025703385486158914e-01 6.345282558695404251e-01
++1.193859004780570554e-01 2.092446623034395214e-01 6.326478270215730726e-01
++1.142294912197052703e-01 2.157456284251405010e-01 6.305768690676523125e-01
++1.091404911375367659e-01 2.220831206181900774e-01 6.283455167242665285e-01
++1.041438584244326337e-01 2.282546518282705383e-01 6.259979600528258192e-01
++9.926304855671816418e-02 2.342609767388125763e-01 6.235717761795677161e-01
++9.449512580805050077e-02 2.401139958170242505e-01 6.210816676451920149e-01
++8.986951574154733446e-02 2.458147193889331228e-01 6.185591936304666305e-01
++8.539285840535987271e-02 2.513729453557033144e-01 6.160166295227810229e-01
++8.106756674391193962e-02 2.567997050291829786e-01 6.134596708213713168e-01
++7.694418932732069449e-02 2.620915612909199277e-01 6.109238301118911085e-01
++7.300703739422578775e-02 2.672655035330154250e-01 6.083965011432549419e-01
++6.927650669442811382e-02 2.723273008096985248e-01 6.058873223830183452e-01
++6.578801445169751849e-02 2.772789491245566951e-01 6.034141752438300088e-01
++6.255595479554787453e-02 2.821282390686886132e-01 6.009787922718963227e-01
++5.959205181913470456e-02 2.868831717247524726e-01 5.985797542127682114e-01
++5.691772151374491912e-02 2.915488716281217640e-01 5.962214962176209943e-01
++5.455347307306369214e-02 2.961302536799313989e-01 5.939076044300871660e-01
++5.251889627870443694e-02 3.006318409387543356e-01 5.916414807294642086e-01
++5.083877347247430650e-02 3.050562292020492783e-01 5.894315315373579445e-01
++4.951454037014189208e-02 3.094102218220906031e-01 5.872714908845412252e-01
++4.855490408104565919e-02 3.136977658751046727e-01 5.851627302038014955e-01
++4.796369156225028380e-02 3.179225992994973993e-01 5.831062484926557987e-01
++4.773946305380068894e-02 3.220882581897950847e-01 5.811027291021745311e-01
++4.787545181415154422e-02 3.261980852298422273e-01 5.791525884087008746e-01
++4.835984720504159923e-02 3.302552388254387794e-01 5.772560174768572860e-01
++4.917638757411300215e-02 3.342627026038174076e-01 5.754130176762238813e-01
++5.030518671680884318e-02 3.382232950310170572e-01 5.736234310853615126e-01
++5.172369283691292258e-02 3.421396789632700219e-01 5.718869664041401624e-01
++5.340767549062541003e-02 3.460143709989857430e-01 5.702032209969470911e-01
++5.533215100674954839e-02 3.498497505368459159e-01 5.685716996038682192e-01
++5.747218306369886870e-02 3.536480684754851334e-01 5.669918301827847618e-01
++5.980352430527090951e-02 3.574114555130643578e-01 5.654629772812437283e-01
++6.230309069250609261e-02 3.611419300223894235e-01 5.639844532816007394e-01
++6.494927925026378057e-02 3.648414054902228698e-01 5.625555278152573058e-01
++6.772215122553368327e-02 3.685116975190721456e-01 5.611754356007422340e-01
++7.060350747784929770e-02 3.721545303967777607e-01 5.598433829250933913e-01
++7.357840396611611822e-02 3.757710087912914942e-01 5.585612898846836760e-01
++7.663101364217325684e-02 3.793629991309988569e-01 5.573268773673928367e-01
++7.974739830752586300e-02 3.829322364932883360e-01 5.561380319387883020e-01
++8.291580548873803136e-02 3.864801413799028307e-01 5.549938581786431069e-01
++8.612580955679122185e-02 3.900080689665953448e-01 5.538934528024703763e-01
++8.936817980172057085e-02 3.935173134989205512e-01 5.528359060062189023e-01
++9.263475301781654014e-02 3.970091123550867351e-01 5.518203023495191761e-01
++9.591831391237073956e-02 4.004846497947374129e-01 5.508457212473490960e-01
++9.921323508992196949e-02 4.039446967979293257e-01 5.499133654313189679e-01
++1.025139614653171327e-01 4.073902646845309894e-01 5.490228475752887416e-01
++1.058144853522852702e-01 4.108228877965505177e-01 5.481703859285301794e-01
++1.091104131658914012e-01 4.142435690118807523e-01 5.473550236322454188e-01
++1.123978495089298091e-01 4.176532725696484594e-01 5.465757987301745890e-01
++1.156733362160069500e-01 4.210529263321469151e-01 5.458317432175192607e-01
++1.189341701380315364e-01 4.244432161011251203e-01 5.451231873866256850e-01
++1.221781892974011241e-01 4.278246691926565481e-01 5.444513010684173260e-01
++1.254018943745988379e-01 4.311987106338182607e-01 5.438113725374379426e-01
++1.286031296249826039e-01 4.345661396549306832e-01 5.432023919026625070e-01
++1.317799711665625373e-01 4.379277275711909168e-01 5.426233385794481112e-01
++1.349307019221451520e-01 4.412842189714309415e-01 5.420731800699918335e-01
++1.380549051543558114e-01 4.446356900078314855e-01 5.415550926551251365e-01
++1.411501069188544899e-01 4.479834819017672332e-01 5.410638066180113448e-01
++1.442150210041465985e-01 4.513283116704150388e-01 5.405979268760919831e-01
++1.472485820103837661e-01 4.546708245755168298e-01 5.401563599016087069e-01
++1.502499341655997578e-01 4.580115969309521140e-01 5.397383042732707414e-01
++1.532192022679761678e-01 4.613507130792227628e-01 5.393460827274304537e-01
++1.561545863558880531e-01 4.646893652629560667e-01 5.389744586257710912e-01
++1.590554825896313418e-01 4.680281092699005163e-01 5.386222668134232894e-01
++1.619213854747377779e-01 4.713674796485894380e-01 5.382883230992108192e-01
++1.647524478987731911e-01 4.747077026242289555e-01 5.379733478625169374e-01
++1.675482630437002962e-01 4.780493319379570116e-01 5.376757027790604049e-01
++1.703080688452488778e-01 4.813931150452205876e-01 5.373922894579649112e-01
++1.730317245949949956e-01 4.847395013664480001e-01 5.371218460871988176e-01
++1.757193664968157432e-01 4.880888303994977417e-01 5.368636833242294015e-01
++1.783716503259393793e-01 4.914412289641479359e-01 5.366183612997760255e-01
++1.809878167761821144e-01 4.947975030047193079e-01 5.363817525707026412e-01
++1.835680719416625251e-01 4.981580161432020426e-01 5.361525222751042374e-01
++1.861127112291278973e-01 5.015231101060642072e-01 5.359293193132266264e-01
++1.886230405888700001e-01 5.048927132825591357e-01 5.357133548543864254e-01
++1.910985251486422565e-01 5.082675669534003626e-01 5.355003101591436776e-01
++1.935397227717326196e-01 5.116479477164066481e-01 5.352887824024628038e-01
++1.959472883340568350e-01 5.150341080561433582e-01 5.350773667248226451e-01
++1.983227076664061950e-01 5.184259856373716335e-01 5.348665525352744865e-01
++2.006660342507454731e-01 5.218241099237964642e-01 5.346528031121534630e-01
++2.029781360478647434e-01 5.252286912572143862e-01 5.344345169358406533e-01
++2.052600444742044838e-01 5.286398903414566419e-01 5.342102605335536936e-01
++2.075134652380221101e-01 5.320576287402744020e-01 5.339799959048032729e-01
++2.097389494614402272e-01 5.354822793223580346e-01 5.337406085215398166e-01
++2.119377691272176234e-01 5.389139515314046447e-01 5.334905459074957834e-01
++2.141113437844118228e-01 5.423527133674995726e-01 5.332283775266504211e-01
++2.162615771757636085e-01 5.457984712571943842e-01 5.329535750363618707e-01
++2.183895286205785324e-01 5.492514494924778390e-01 5.326634150194080597e-01
++2.204969036245257863e-01 5.527116487772890663e-01 5.323564832742772035e-01
++2.225855272635121618e-01 5.561790393438251767e-01 5.320314302436226495e-01
++2.246573660062902156e-01 5.596535532346759156e-01 5.316870266023980829e-01
++2.267141352300188206e-01 5.631352211554988552e-01 5.313212748929951879e-01
++2.287579175696445311e-01 5.666239548700177098e-01 5.309328290550865415e-01
++2.307908679682200148e-01 5.701196510565367248e-01 5.305203252817071169e-01
++2.328150701112509102e-01 5.736222405040750649e-01 5.300820599240353426e-01
++2.348328561421904603e-01 5.771315766359990107e-01 5.296167282704775658e-01
++2.368466495707550745e-01 5.806474896434283828e-01 5.291230766564496424e-01
++2.388588283644081933e-01 5.841698333340915594e-01 5.285995915811123602e-01
++2.408716822240541400e-01 5.876984999166237067e-01 5.280443921862176815e-01
++2.428880608722543410e-01 5.912331932277818947e-01 5.274567814051942527e-01
++2.449106759672304290e-01 5.947736703172152861e-01 5.268356212312692577e-01
++2.469420290965465559e-01 5.983197676291379663e-01 5.261791312000029253e-01
++2.489846702882144713e-01 6.018713111492172141e-01 5.254854952988164962e-01
++2.510418446331669773e-01 6.054278820406324702e-01 5.247545535679302153e-01
++2.531164830585315162e-01 6.089891735215487989e-01 5.239852980594518206e-01
++2.552111567013787274e-01 6.125550130731924892e-01 5.231756545447472373e-01
++2.573286340449815746e-01 6.161251617120727664e-01 5.223239185167128928e-01
++2.594724447386158594e-01 6.196990932330638246e-01 5.214304767886038805e-01
++2.616456589963800927e-01 6.232764459181282524e-01 5.204944566826074093e-01
++2.638509342960791981e-01 6.268570181766053295e-01 5.195136536074571598e-01
++2.660910828965943331e-01 6.304405546707460006e-01 5.184861377534477622e-01
++2.683698467163787016e-01 6.340264147511259774e-01 5.174130230514244477e-01
++2.706903509949471487e-01 6.376141889650659422e-01 5.162935692788781505e-01
++2.730554221838172868e-01 6.412035896296301996e-01 5.151259285643695618e-01
++2.754676310512871873e-01 6.447944545228798674e-01 5.139069764892589820e-01
++2.779309010023177096e-01 6.483859905965968506e-01 5.126390269795514376e-01
++2.804483318408275694e-01 6.519777450281342146e-01 5.113214639163841113e-01
++2.830229969716622218e-01 6.555692556652558123e-01 5.099537040511894492e-01
++2.856569925022096612e-01 6.591606030439277619e-01 5.085297306531970651e-01
++2.883543502639873135e-01 6.627507929293073863e-01 5.070537569679475220e-01
++2.911180907975667309e-01 6.663393219020087299e-01 5.055253556302098383e-01
++2.939511790083492726e-01 6.699256847308838747e-01 5.039440536705714901e-01
++2.968562131418951422e-01 6.735096490751359966e-01 5.023062065413991251e-01
++2.998362114418811064e-01 6.770906951012128916e-01 5.006109626120457401e-01
++3.028943961763405635e-01 6.806680059292820051e-01 4.988609220555944579e-01
++3.060335830069556007e-01 6.842410278074210206e-01 4.970557164988521071e-01
++3.092565373453909361e-01 6.878091952372648032e-01 4.951950035800954386e-01
++3.125659486948474952e-01 6.913723055472413836e-01 4.932732004330610542e-01
++3.159647522698377231e-01 6.949295261702347348e-01 4.912927476409480465e-01
++3.194556489243873809e-01 6.984800979280558764e-01 4.892553378582480961e-01
++3.230412442793148542e-01 7.020233920397538352e-01 4.871607422199746851e-01
++3.267240985578743762e-01 7.055587631720373620e-01 4.850087606010107799e-01
++3.305070751488592418e-01 7.090857414439620809e-01 4.827955626459811689e-01
++3.343929739199408280e-01 7.126036449951604901e-01 4.805201317683439055e-01
++3.383839618515475101e-01 7.161115318028217214e-01 4.781864627637871235e-01
++3.424824761777380822e-01 7.196086676710338192e-01 4.757945201032026117e-01
++3.466909265050957534e-01 7.230942938245445983e-01 4.733443136156250675e-01
++3.510117003671430203e-01 7.265676248366644829e-01 4.708359034900377327e-01
++3.554477481971078934e-01 7.300279237012574640e-01 4.682667163182038794e-01
++3.600022066505755847e-01 7.334743741555846963e-01 4.656343331651458528e-01
++3.646764457841936702e-01 7.369059239634064840e-01 4.629441295765394648e-01
++3.694728210602395979e-01 7.403216514270205550e-01 4.601965063235068931e-01
++3.743936915522128039e-01 7.437205957454258165e-01 4.573919681273960758e-01
++3.794414259131371203e-01 7.471017539541063845e-01 4.545311394783269621e-01
++3.846184079557829483e-01 7.504640777072076885e-01 4.516147832933739559e-01
++3.899270416022538321e-01 7.538064699246833644e-01 4.486438228496626990e-01
++3.953697549145612777e-01 7.571277813375660859e-01 4.456193674826627871e-01
++4.009508646485598904e-01 7.604267477869489644e-01 4.425380639654961090e-01
++4.066714019599443342e-01 7.637021069222051928e-01 4.394056497009877216e-01
++4.125334807152798988e-01 7.669525443587899005e-01 4.362249727525224774e-01
++4.185395667527040398e-01 7.701766751192415938e-01 4.329983295596441795e-01
++4.246921350385852723e-01 7.733730477083216037e-01 4.297284080553480656e-01
++4.309936593663836191e-01 7.765401418648604226e-01 4.264183470604332449e-01
++4.374465975304094312e-01 7.796763669997491819e-01 4.230718037095967943e-01
++4.440533711015541840e-01 7.827800615723168320e-01 4.196930295353452078e-01
++4.508163388346139722e-01 7.858494937119429036e-01 4.162869557148224930e-01
++4.577377626480225170e-01 7.888828634531382944e-01 4.128592877810690620e-01
++4.648197650471433406e-01 7.918783070193569085e-01 4.094166097874233912e-01
++4.720642768256655963e-01 7.948339036614172626e-01 4.059664974607166132e-01
++4.794729738954752185e-01 7.977476856267914362e-01 4.025176392507668344e-01
++4.870472021865835388e-01 8.006176519006481529e-01 3.990799633442549399e-01
++4.947878897554374711e-01 8.034417864099652196e-01 3.956647676266520364e-01
++5.026954455748450235e-01 8.062180814071850943e-01 3.922848482216537147e-01
++5.107722312752203120e-01 8.089441566688712060e-01 3.889513459863399025e-01
++5.190175807229889804e-01 8.116180108735555621e-01 3.856804341377490508e-01
++5.274270476594079549e-01 8.142382455983395717e-01 3.824934902796895964e-01
++5.359974387485314518e-01 8.168032862890818313e-01 3.794106529717772847e-01
++5.447242959015131669e-01 8.193118012377970105e-01 3.764539238160731771e-01
++5.536017493685388979e-01 8.217627673204914718e-01 3.736470734604069865e-01
++5.626223858732353200e-01 8.241555398979113489e-01 3.710154595070918049e-01
++5.717801732913297963e-01 8.264893011624766528e-01 3.685830453573430421e-01
++5.810619798273547465e-01 8.287648131945639651e-01 3.663798607459672341e-01
++5.904522695833789303e-01 8.309836316507100973e-01 3.644363382969363352e-01
++5.999363056699199559e-01 8.331474672067843423e-01 3.627802030453921023e-01
++6.094978370184862548e-01 8.352587020450518152e-01 3.614380620192426119e-01
++6.191178753985615568e-01 8.373207419267220120e-01 3.604354982890065617e-01
++6.287753075069072439e-01 8.393379672623436649e-01 3.597956834322972863e-01
++6.384515865712356852e-01 8.413146218129586851e-01 3.595361765343614291e-01
++6.481275660781142811e-01 8.432555569199260415e-01 3.596707668706327632e-01
++6.577845458065525452e-01 8.451659780810962808e-01 3.602086612732601778e-01
++6.674047070379289792e-01 8.470513147981415525e-01 3.611542742755425861e-01
++6.769617561788032756e-01 8.489198363378159806e-01 3.625096347273936148e-01
++6.864487597795673191e-01 8.507748949282539774e-01 3.642665641101618390e-01
++6.958544314564799604e-01 8.526212799355240568e-01 3.664154684319869681e-01
++7.051685608468114541e-01 8.544637256207057163e-01 3.689436786046771388e-01
++7.143830272263600456e-01 8.563065614925247093e-01 3.718358172740615641e-01
++7.234917624309317175e-01 8.581536540348341235e-01 3.750744951817871486e-01
++7.324906484647774052e-01 8.600083717860309562e-01 3.786409937540124448e-01
++7.413773645706981386e-01 8.618735721244006331e-01 3.825158976261986421e-01
++7.501511992657796668e-01 8.637516069265696039e-01 3.866796514151401021e-01
++7.588128421172509741e-01 8.656443435632366068e-01 3.911130257986148440e-01
++7.673641682613402404e-01 8.675531974405399360e-01 3.957974875667232828e-01
++7.758080262912036007e-01 8.694791724028596569e-01 4.007154759905482422e-01
++7.841480375461038488e-01 8.714229056785223193e-01 4.058505933213660266e-01
++7.923777293356836227e-01 8.733886508286130557e-01 4.111824877427081026e-01
++8.004976303968860396e-01 8.753781889640523950e-01 4.166935560611597644e-01
++8.085242857272323391e-01 8.773871783186646400e-01 4.223760515178233144e-01
++8.164630734789560806e-01 8.794151844938148388e-01 4.282186311869483064e-01
++8.243194501554683695e-01 8.814616081475756815e-01 4.342112747863317024e-01
++8.320860387263339097e-01 8.835308362945183402e-01 4.403358497380424619e-01
++8.397544323444476877e-01 8.856278479633188372e-01 4.465723185371322512e-01
++8.473543986252204396e-01 8.877421380157632935e-01 4.529306634208433713e-01
++8.548913210362114601e-01 8.898726582646793171e-01 4.594053245849991085e-01
++8.623409541601502193e-01 8.920307544658760968e-01 4.659650403812060637e-01
++8.697191661117472661e-01 8.942111604773197442e-01 4.726125804953009157e-01
++8.770479480763140323e-01 8.964055876253053112e-01 4.793596015320920611e-01
++8.843061388708378656e-01 8.986242192828276520e-01 4.861771826919926709e-01
++8.914967901846199139e-01 9.008669432468144889e-01 4.930589607663434237e-01
++8.986506618699680038e-01 9.031210853874221955e-01 5.000298200873778409e-01
++9.057328617844134788e-01 9.054032588350297006e-01 5.070444917818385244e-01
++9.127681739145864226e-01 9.077032841253237505e-01 5.141229319104883011e-01
++9.197719823668246697e-01 9.100148294768658497e-01 5.212774789419143406e-01
++9.266999503758117651e-01 9.123594905222979223e-01 5.284479861571415027e-01
++9.336093927737403320e-01 9.147111822755604749e-01 5.356989519972219504e-01
++9.404610328906413130e-01 9.170893351552455997e-01 5.429753047678268496e-01
++9.472803518326599059e-01 9.194825361628593541e-01 5.503044468166357062e-01
++9.540659681238262690e-01 9.218921210725944393e-01 5.576799909240343078e-01
++9.608049809199471492e-01 9.243252266483533708e-01 5.650790057480892248e-01
++9.675287370768704820e-01 9.267668902399696096e-01 5.725413863443260531e-01
++9.741967269037244970e-01 9.292382142036349491e-01 5.800041593344547053e-01
++9.808627042040826138e-01 9.317124815536732552e-01 5.875425838151492330e-01
++9.874684104099172854e-01 9.342202886448683907e-01 5.950648878797101249e-01
++9.940805805099582892e-01 9.367275819156850591e-01 6.026699962989522374e-01]; 
++
++   case 'spe' 
++      RGB = [9.996253193176977137e-01 9.913711226010460953e-01 8.041012438578545307e-01
++9.969312990878144154e-01 9.865865913107011442e-01 7.958196545688069889e-01
++9.942533588637104680e-01 9.818135789307643746e-01 7.875317815897165952e-01
++9.915896776086415842e-01 9.770525904709529419e-01 7.792374356109948996e-01
++9.889384786221749879e-01 9.723041153469224041e-01 7.709364896057565586e-01
++9.862980251266783016e-01 9.675686302753326862e-01 7.626288656679628408e-01
++9.836666169060123144e-01 9.628466015967408476e-01 7.543145233681930462e-01
++9.810425876106124710e-01 9.581384871880828102e-01 7.459934495167190871e-01
++9.784237290846492519e-01 9.534448589527805273e-01 7.376670490866494845e-01
++9.758091741853186507e-01 9.487660072025493330e-01 7.293335612360094533e-01
++9.731976797213667263e-01 9.441023023821585314e-01 7.209921595340745837e-01
++9.705876565172376624e-01 9.394541905537218129e-01 7.126429103405369503e-01
++9.679775344953384097e-01 9.348221172710475813e-01 7.042858810456844587e-01
++9.653657609756586266e-01 9.302065285603877687e-01 6.959211353452218196e-01
++9.627508763245108403e-01 9.256078555762781157e-01 6.875485248304887831e-01
++9.601317913231469658e-01 9.210264571207541495e-01 6.791669211618720503e-01
++9.575068348330096901e-01 9.164628209777989643e-01 6.707767168399573210e-01
++9.548744491996995487e-01 9.119174176425877132e-01 6.623780173986024700e-01
++9.522330808045905703e-01 9.073907239128325974e-01 6.539709177027834830e-01
++9.495811770290348841e-01 9.028832240271246201e-01 6.455555018977681137e-01
++9.469171829214290126e-01 8.983954108674836458e-01 6.371318441574638225e-01
++9.442402190659517913e-01 8.939276490907958062e-01 6.286979645113369708e-01
++9.415486437855169477e-01 8.894804711503382366e-01 6.202539985663386712e-01
++9.388403761261178149e-01 8.850545069722992597e-01 6.118014161078325630e-01
++9.361137658947894513e-01 8.806503085987659185e-01 6.033403762527677072e-01
++9.333671427931780062e-01 8.762684428171652051e-01 5.948710444843188228e-01
++9.305988122871574619e-01 8.719094924143574454e-01 5.863935979844183688e-01
++9.278070514355759579e-01 8.675740573997056115e-01 5.779082318269497254e-01
++9.249901047433721768e-01 8.632627561697012730e-01 5.694151660419812799e-01
++9.221469800733509414e-01 8.589760860685742294e-01 5.609116482547054083e-01
++9.192753048560652340e-01 8.547148108589553983e-01 5.523997440377725887e-01
++9.163728560349155838e-01 8.504796735679325259e-01 5.438810466983201586e-01
++9.134376867190158178e-01 8.462713800742609482e-01 5.353560484875481418e-01
++9.104678046010745707e-01 8.420906570028113824e-01 5.268253096213930675e-01
++9.074611700430375016e-01 8.379382516634488187e-01 5.182894693241438810e-01
++9.044156948810763152e-01 8.338149316350844664e-01 5.097492574011085464e-01
++9.013292420875533839e-01 8.297214839374013051e-01 5.012055062134753713e-01
++8.981996264328737656e-01 8.256587137313211588e-01 4.926591628979440363e-01
++8.950246162923013449e-01 8.216274424893472705e-01 4.841113016411668357e-01
++8.918019367410795484e-01 8.176285055788921063e-01 4.755631357855747976e-01
++8.885292740744069606e-01 8.136627492060259925e-01 4.670160295098501613e-01
++8.852042818763621312e-01 8.097310266740884721e-01 4.584715087957387802e-01
++8.818245887426444662e-01 8.058341939216442373e-01 4.499312713647861117e-01
++8.783878077356160885e-01 8.019731043176190344e-01 4.413971952459587733e-01
++8.748915476159051519e-01 7.981486027081815537e-01 4.328713456201330745e-01
++8.713334258529761289e-01 7.943615187300834268e-01 4.243559795823733105e-01
++8.677110833677242896e-01 7.906126594284177411e-01 4.158535484698712703e-01
++8.640222009043423412e-01 7.869028012426558805e-01 4.073666974243692063e-01
++8.602645168678531018e-01 7.832326814525909509e-01 3.988982618942717440e-01
++8.564358463998196225e-01 7.796029892044549214e-01 3.904512608343593816e-01
++8.525341014005127782e-01 7.760143562656642846e-01 3.820288864300384613e-01
++8.485573111443696082e-01 7.724673476829161389e-01 3.736344902575098326e-01
++8.445036430802366212e-01 7.689624525410815314e-01 3.652715658890242079e-01
++8.403714233625397823e-01 7.655000750378188057e-01 3.569437280604416673e-01
++8.361591566273345322e-01 7.620805260995172636e-01 3.486546886323707573e-01
++8.318655445115968883e-01 7.587040157667198637e-01 3.404082296912668837e-01
++8.274895024172935765e-01 7.553706465705579687e-01 3.322081742472747790e-01
++8.230301740454328829e-01 7.520804081054507373e-01 3.240583550855133943e-01
++8.184868212302832680e-01 7.488332616294635091e-01 3.159617825674137515e-01
++8.138590110822148116e-01 7.456289896604103573e-01 3.079221377655331771e-01
++8.091468181242912339e-01 7.424670871619818424e-01 2.999443469091602199e-01
++8.043504122379883103e-01 7.393470563716729727e-01 2.920319686576324791e-01
++7.994702184716161453e-01 7.362682828578653860e-01 2.841884012704181672e-01
++7.945069109411802000e-01 7.332300399833050486e-01 2.764168555307422448e-01
++7.894614033518293494e-01 7.302314948629916591e-01 2.687203309843908539e-01
++7.843348364120679150e-01 7.272717156577747089e-01 2.611015959667907227e-01
++7.791285260147496894e-01 7.243496994364320152e-01 2.535630684860531447e-01
++7.738440801480908071e-01 7.214643092911102729e-01 2.461071963221510561e-01
++7.684833208817296590e-01 7.186143199358207001e-01 2.387362039122769009e-01
++7.630481315977482026e-01 7.157984953860191402e-01 2.314517734491695622e-01
++7.575405230514773436e-01 7.130155515836559266e-01 2.242553190375982108e-01
++7.519626112766101267e-01 7.102641669372077304e-01 2.171479941172158035e-01
++7.463165956980535309e-01 7.075429925763011552e-01 2.101307026608347228e-01
++7.406047378440419049e-01 7.048506621488696000e-01 2.032041138079452858e-01
++7.348297350913484127e-01 7.021856197788983733e-01 1.963692968886621149e-01
++7.289936844492124202e-01 6.995466025992004289e-01 1.896260481458106884e-01
++7.230988483362374986e-01 6.969322773880018973e-01 1.829743149302962002e-01
++7.171475322086006132e-01 6.943412998823550453e-01 1.764139943240976283e-01
++7.111420143928013360e-01 6.917723467781027313e-01 1.699448658068684892e-01
++7.050845338608371371e-01 6.892241206236302542e-01 1.635666199792324693e-01
++6.989772797030316953e-01 6.866953538838792559e-01 1.572788888364401172e-01
++6.928223822517928232e-01 6.841848122132092591e-01 1.510812776309110872e-01
++6.866220524799201419e-01 6.816912363109779438e-01 1.449735254345622115e-01
++6.803786701652846380e-01 6.792133090629258740e-01 1.389555620195359609e-01
++6.740936196655853418e-01 6.767501306945983286e-01 1.330266252977832520e-01
++6.677687244983904202e-01 6.743006234739316040e-01 1.271865644636745452e-01
++6.614057275351008514e-01 6.718637487365417549e-01 1.214353970802317662e-01
++6.550062900453353931e-01 6.694385066322930955e-01 1.157733573283348805e-01
++6.485719915801509972e-01 6.670239355272904458e-01 1.102009495253571669e-01
++6.421043305819508218e-01 6.646191111168818777e-01 1.047190080781650323e-01
++6.356047256163376291e-01 6.622231453008022850e-01 9.932876523540395963e-02
++6.290745171295046845e-01 6.598351848668921882e-01 9.403192821288078318e-02
++6.225149696438274649e-01 6.574544100249212208e-01 8.883076747185855715e-02
++6.159272743135092432e-01 6.550800328272597950e-01 8.372821811088401733e-02
++6.093126663293514378e-01 6.527112545185101977e-01 7.872799706657532259e-02
++6.026723170612737768e-01 6.503473055396404856e-01 7.383469856963406630e-02
++5.960069280976730832e-01 6.479875866853281874e-01 6.905400752442764079e-02
++5.893174254692321590e-01 6.456314203776034599e-01 6.439287527349069062e-02
++5.826046784844106652e-01 6.432781520370909334e-01 5.985968924725062340e-02
++5.758695032242261425e-01 6.409271483905801814e-01 5.546448455059219823e-02
++5.691126660872921628e-01 6.385777958070207871e-01 5.121916775709036557e-02
++5.623348873683923221e-01 6.362294986703330713e-01 4.713774156788400754e-02
++5.555368448583254404e-01 6.338816777957024806e-01 4.323651096469569716e-02
++5.487191774565705060e-01 6.315337688945173999e-01 3.952487864258176498e-02
++5.418824887917018662e-01 6.291852210919098853e-01 3.612051121019213551e-02
++5.350273508472259687e-01 6.268354954999130202e-01 3.311399967360150604e-02
++5.281543075929241438e-01 6.244840638484698836e-01 3.049096132752013993e-02
++5.212638786236020172e-01 6.221304071760309640e-01 2.823775650583685778e-02
++5.143565628087404251e-01 6.197740145810481938e-01 2.634144880489198981e-02
++5.074328419576341620e-01 6.174143820354919265e-01 2.478976657062584646e-02
++5.004931845054064743e-01 6.150510112614009373e-01 2.357106560875196072e-02
++4.935380492257968599e-01 6.126834086714986194e-01 2.267429306479169446e-02
++4.865677337149327264e-01 6.103111278318402722e-01 2.208918519158591109e-02
++4.795827833081557912e-01 6.079336535225863258e-01 2.180564619063158835e-02
++4.725836555273193462e-01 6.055504983495709759e-01 2.181419194008693205e-02
++4.655708088649732068e-01 6.031611773523495312e-01 2.210580170001537684e-02
++4.585447116306416437e-01 6.007652058968021569e-01 2.267187969798983502e-02
++4.515058459835388782e-01 5.983620990282547680e-01 2.350422445657735990e-02
++4.444547120266517104e-01 5.959513709030562767e-01 2.459499875403014374e-02
++4.373918319618326778e-01 5.935325343022211930e-01 2.593670014651517156e-02
++4.303177543037495223e-01 5.911051002310937497e-01 2.752213198538535840e-02
++4.232330581488202292e-01 5.886685776092354105e-01 2.934437486930205341e-02
++4.161383574931313278e-01 5.862224730549979723e-01 3.139675847884770832e-02
++4.090343055913983616e-01 5.837662907693373926e-01 3.367283375013734037e-02
++4.019215993467592507e-01 5.812995325235387201e-01 3.616634535426579283e-02
++3.948009837190709082e-01 5.788216977554323517e-01 3.887120446073646235e-02
++3.876732561372571162e-01 5.763322837785355146e-01 4.174672181203834681e-02
++3.805386564470196742e-01 5.738309171411589693e-01 4.468566878513501733e-02
++3.733986391498164137e-01 5.713169711328536238e-01 4.768049787246867594e-02
++3.662542351622480874e-01 5.687899279044026368e-01 5.071835758395210753e-02
++3.591065040473656045e-01 5.662492786415918022e-01 5.378828392041421630e-02
++3.519565800474088735e-01 5.636945152858550134e-01 5.688085721725138350e-02
++3.448056760545124555e-01 5.611251315161035480e-01 5.998797256299469999e-02
++3.376550874229136134e-01 5.585406238589376571e-01 6.310263770132876204e-02
++3.305061956006355439e-01 5.559404929241524851e-01 6.621879773242350664e-02
++3.233604715607960034e-01 5.533242447607230607e-01 6.933118466356372189e-02
++3.162194790161148017e-01 5.506913923265978061e-01 7.243518928216058361e-02
++3.090846039651472532e-01 5.480415027343880086e-01 7.552721746757809496e-02
++3.019574288899705139e-01 5.453741321890830385e-01 7.860394456462099777e-02
++2.948403194287022577e-01 5.426887379559618418e-01 8.166128713902018332e-02
++2.877352499045566225e-01 5.399848761881764769e-01 8.469633286585029341e-02
++2.806442994214729536e-01 5.372621189537871711e-01 8.770643445761908130e-02
++2.735696535538801322e-01 5.345200561570193631e-01 9.068916512095565041e-02
++2.665136059049172390e-01 5.317582974656462902e-01 9.364228167891575083e-02
++2.594785595977833204e-01 5.289764742223507232e-01 9.656369418956520234e-02
++2.524670287821700332e-01 5.261742413169625543e-01 9.945144107016240520e-02
++2.454813557062531792e-01 5.233513142453691813e-01 1.023041162767710510e-01
++2.385245828710040317e-01 5.205073603004944927e-01 1.051194831525161522e-01
++2.315996737216303170e-01 5.176421037021866622e-01 1.078956959800008442e-01
++2.247096070811669399e-01 5.147553123030387257e-01 1.106311405318080310e-01
++2.178574824667257048e-01 5.118467857547527311e-01 1.133242655958566492e-01
++2.110465244393363582e-01 5.089163566221597268e-01 1.159735773093806543e-01
++2.042800881777394606e-01 5.059638913007615812e-01 1.185776351459725819e-01
++1.975616665475327660e-01 5.029892907239723598e-01 1.211350492651094846e-01
++1.908950317685597087e-01 4.999924798399172921e-01 1.236442618572499708e-01
++1.842839642352289697e-01 4.969734333710090213e-01 1.261039978961912833e-01
++1.777324020667393756e-01 4.939321620495928378e-01 1.285130506256617899e-01
++1.712444848635372441e-01 4.908687102327232155e-01 1.308702368677320538e-01
++1.648245567449286297e-01 4.877831568788963401e-01 1.331744245804179216e-01
++1.584771896665797541e-01 4.846756148389082530e-01 1.354245338303780855e-01
++1.522072108246106115e-01 4.815462299379932865e-01 1.376195378692431359e-01
++1.460197345452351747e-01 4.783951798632230523e-01 1.397584642177332193e-01
++1.399204939260773328e-01 4.752226638142488802e-01 1.418397751955981501e-01
++1.339151022806790436e-01 4.720289313790105301e-01 1.438629155677119409e-01
++1.280096392738992173e-01 4.688142535267130762e-01 1.458273227721058329e-01
++1.222107627052576584e-01 4.655789223639808516e-01 1.477322650340249788e-01
++1.165256528622910237e-01 4.623232537320298152e-01 1.495770677617926092e-01
++1.109620746853187123e-01 4.590475853271560047e-01 1.513611132825743999e-01
++1.055284430115649430e-01 4.557522747771929894e-01 1.530838402977779955e-01
++1.002338888313226428e-01 4.524376976954341267e-01 1.547447430577089666e-01
++9.508832342249537439e-02 4.491042457325262194e-01 1.563433702619193288e-01
++9.010250937510871916e-02 4.457523324675090604e-01 1.578790892676192326e-01
++8.528801833375249108e-02 4.423823989146767888e-01 1.593510674113139958e-01
++8.065727940861416867e-02 4.389948528858526600e-01 1.607597457256386420e-01
++7.622371216564308161e-02 4.355901307746828932e-01 1.621048834368656322e-01
++7.200158271604989446e-02 4.321686757028083692e-01 1.633862841279137557e-01
++6.800589086138220107e-02 4.287309359317861834e-01 1.646037933778843332e-01
++6.425218103335716968e-02 4.252773633715483670e-01 1.657572962977645059e-01
++6.075626148835750612e-02 4.218084121914437157e-01 1.668467149892300661e-01
++5.753381975108700502e-02 4.183245375382101949e-01 1.678720059529140995e-01
++5.459992971435845971e-02 4.148261943636451510e-01 1.688331574715942474e-01
++5.196845773512390881e-02 4.113138363632788397e-01 1.697301869925023354e-01
++4.965139124510086627e-02 4.077879150260529384e-01 1.705631385315065085e-01
++4.765813208284918473e-02 4.042488787938245398e-01 1.713320801202671551e-01
++4.599481449154869256e-02 4.006971723285012166e-01 1.720371013157572515e-01
++4.466371969486728627e-02 3.971332358837184051e-01 1.726783107897287561e-01
++4.366274483561478209e-02 3.935575133766276990e-01 1.732557671739120286e-01
++4.298497468310508857e-02 3.899704687794856572e-01 1.737693705957654433e-01
++4.262017645185838671e-02 3.863724827023667929e-01 1.742196255705478480e-01
++4.255352467768171859e-02 3.827639728113220174e-01 1.746066936456434071e-01
++4.276673184831410873e-02 3.791453506945430818e-01 1.749307448926006592e-01
++4.323878239983177524e-02 3.755170217599948512e-01 1.751919563188165385e-01
++4.394675081101364483e-02 3.718793851987791665e-01 1.753905104335057585e-01
++4.486662442701292580e-02 3.682328340080037177e-01 1.755265939730583369e-01
++4.597406436707644067e-02 3.645777550668193867e-01 1.756003967899375517e-01
++4.724505801823831314e-02 3.609145292591857124e-01 1.756121109084000098e-01
++4.865643856140024898e-02 3.572435316368365310e-01 1.755619297495205344e-01
++5.018626632042253594e-02 3.535651316158259783e-01 1.754500475272437465e-01
++5.181408104443557122e-02 3.498796931999255677e-01 1.752766588164567374e-01
++5.352104295989750654e-02 3.461875752240315962e-01 1.750419582933170903e-01
++5.528998425553303259e-02 3.424891316106106198e-01 1.747461406473147794e-01
++5.710539287663336100e-02 3.387847116320403806e-01 1.743894006636908245e-01
++5.895334846203271334e-02 3.350746601715560713e-01 1.739719334739151524e-01
++6.082142709649813322e-02 3.313593179753057116e-01 1.734939349708606859e-01
++6.269858808390260663e-02 3.276390218878380001e-01 1.729556023841174184e-01
++6.457505267241087088e-02 3.239141050631572094e-01 1.723571350094970367e-01
++6.644218183629055363e-02 3.201848971432968427e-01 1.716987350852014205e-01
++6.829235792686130790e-02 3.164517243962254311e-01 1.709806088053268391e-01
++7.011887323479765177e-02 3.127149098048046527e-01 1.702029674593475428e-01
++7.191582719453681882e-02 3.089747730984767071e-01 1.693660286839586415e-01
++7.367740139700959534e-02 3.052317018390342529e-01 1.684698187582648887e-01
++7.539908659075802988e-02 3.014860094828903936e-01 1.675145933863426417e-01
++7.707730571895973770e-02 2.977379606831319081e-01 1.665007348086736949e-01
++7.870852955781817983e-02 2.939878648964006636e-01 1.654284970811750188e-01
++8.028965953863020921e-02 2.902360278178472974e-01 1.642981478645798299e-01
++8.181797774419891089e-02 2.864827509313960796e-01 1.631099700093367744e-01
++8.329110360766753263e-02 2.827283309501391617e-01 1.618642630930951787e-01
++8.470695659424687385e-02 2.789730591425138573e-01 1.605613448745624727e-01
++8.606372418387428502e-02 2.752172205414125661e-01 1.592015526248838075e-01
++8.735983452008261319e-02 2.714610930351273321e-01 1.577852442954886525e-01
++8.859393314120664331e-02 2.677049463410028363e-01 1.563127994796906506e-01
++8.976486326081492551e-02 2.639490408648579312e-01 1.547846201243904263e-01
++9.087164911293293956e-02 2.601936264515474218e-01 1.532011309481255412e-01
++9.191348192284298779e-02 2.564389410344570241e-01 1.515627795225681362e-01
++9.288704312629730842e-02 2.526856315239155992e-01 1.498693699931691048e-01
++9.379283018859288501e-02 2.489337717503207204e-01 1.481216905842226428e-01
++9.463163644057562274e-02 2.451833792964967507e-01 1.463205652098015508e-01
++9.540318566942779244e-02 2.414346401225993533e-01 1.444665315338557743e-01
++9.610732643393554708e-02 2.376877206774311024e-01 1.425601463139360425e-01
++9.674402718144511915e-02 2.339427661170380146e-01 1.406019829499289553e-01
++9.731337192794831115e-02 2.301998985206034631e-01 1.385926284969124511e-01
++9.781527030012060475e-02 2.264592671684997338e-01 1.365326231802845014e-01
++9.824358966693200190e-02 2.227221381992704474e-01 1.344213498047777955e-01
++9.860476008591259611e-02 2.189874851640599696e-01 1.322606854144605382e-01
++9.889926458171927059e-02 2.152553323101172311e-01 1.300512525669721697e-01
++9.912768720083675600e-02 2.115256719866073221e-01 1.277936680974917916e-01
++9.929070945217863264e-02 2.077984630697710111e-01 1.254885372707029156e-01
++9.938536693535210409e-02 2.040743841747782450e-01 1.231359093599569132e-01
++9.940987528000957973e-02 2.003539028956775048e-01 1.207361104943659447e-01
++9.937074432198822471e-02 1.966357733029605592e-01 1.182905659078862248e-01
++9.926899950314096999e-02 1.929198155529378012e-01 1.157998086675786908e-01
++9.910574746809375224e-02 1.892058087816931022e-01 1.132643300609986470e-01
++9.887273365069987330e-02 1.854955476839638961e-01 1.106837415179452166e-01
++9.857702759168757156e-02 1.817875303344013982e-01 1.080592207487474365e-01
++9.822269753736714848e-02 1.780808239249605796e-01 1.053914161709541830e-01
++9.781113633355650872e-02 1.743750377566490040e-01 1.026806351620476176e-01
++9.733238005935909709e-02 1.706723687329834982e-01 9.992670564763897478e-02
++9.679537330416121410e-02 1.669706979907544520e-01 9.713043093317094701e-02
++9.620476860769888727e-02 1.632687911401897729e-01 9.429209466525781402e-02
++9.555840111219859878e-02 1.595669718044100127e-01 9.141177435708905397e-02
++9.484851695793727888e-02 1.558669291806107915e-01 8.848983773912671991e-02
++9.408911153954402362e-02 1.521650578561620781e-01 8.552628708305054506e-02
++9.328192094338655371e-02 1.484606091474970080e-01 8.252094903627574252e-02
++9.241015243151923242e-02 1.447574737795673805e-01 7.947496936453349314e-02
++9.149313879389489590e-02 1.410504572025015335e-01 7.638732537156053826e-02
++9.053276383981978537e-02 1.373386075843833487e-01 7.325761429945673586e-02]; 
++
++   case 'the' 
++      RGB = [1.555601333154079877e-02 1.382442454646408414e-01 2.018108864558305071e-01
++1.620183633850513089e-02 1.410507428866217272e-01 2.089765125440807836e-01
++1.685648942708358952e-02 1.438270143621834252e-01 2.162386804476043589e-01
++1.752640064782528401e-02 1.465717250667996630e-01 2.235996996833259920e-01
++1.821871873545745021e-02 1.492834638238061673e-01 2.310618693528040390e-01
++1.894137836902154426e-02 1.519607349643580241e-01 2.386274839825403005e-01
++1.969967580211434005e-02 1.546014513385217670e-01 2.463049741539924953e-01
++2.050331512714091350e-02 1.572037794856419868e-01 2.540971092002056730e-01
++2.136720981691051999e-02 1.597664500864496573e-01 2.619991459036808412e-01
++2.230340677460975612e-02 1.622875536944013708e-01 2.700132114112391291e-01
++2.332520459934065912e-02 1.647650548255009395e-01 2.781413941166567261e-01
++2.444727823684482437e-02 1.671967824349823439e-01 2.863857270216258466e-01
++2.568581629165060318e-02 1.695804203313354408e-01 2.947481661145329168e-01
++2.705867185137392564e-02 1.719134976584987262e-01 3.032305630924797546e-01
++2.858552764394725262e-02 1.741933796245943022e-01 3.118346316168387755e-01
++3.028807626872338093e-02 1.764172587161002559e-01 3.205619061457981589e-01
++3.219021609777513587e-02 1.785821467123839268e-01 3.294136922283489310e-01
++3.431826321592867240e-02 1.806848679100377109e-01 3.383910069732901649e-01
++3.670117943457189280e-02 1.827220540829147533e-01 3.474945082255425644e-01
++3.937081594703384368e-02 1.846901418460877020e-01 3.567244107935257369e-01
++4.230474116360182640e-02 1.865853732643254770e-01 3.660803878810173217e-01
++4.544128431656369732e-02 1.884038007524381497e-01 3.755614556934170345e-01
++4.879889459256544354e-02 1.901412975600472455e-01 3.851658390246698871e-01
++5.238564999909287728e-02 1.917935754201579024e-01 3.948908155057742619e-01
++5.620896927989652708e-02 1.933562112707872260e-01 4.047325361348014794e-01
++6.027560971317643540e-02 1.948246853300575621e-01 4.146858197468099028e-01
++6.459519137924149557e-02 1.961877478810097886e-01 4.247714594384868758e-01
++6.917293885235362150e-02 1.974458334676339466e-01 4.349572770994127868e-01
++7.401397924875777190e-02 1.985943734629224688e-01 4.452322549865626589e-01
++7.912632580773251711e-02 1.996251445642635014e-01 4.555965555444902448e-01
++8.452074659970570947e-02 2.005284212595413451e-01 4.660508732253974551e-01
++9.019392390291772199e-02 2.013079448693051998e-01 4.765478779135125520e-01
++9.616430834359415702e-02 2.019472529514862447e-01 4.871044455010897223e-01
++1.024253987466881288e-01 2.024520213616345932e-01 4.976646226688278829e-01
++1.089944270249512126e-01 2.028088855832538839e-01 5.082270885561682716e-01
++1.158597351626668159e-01 2.030273547727350913e-01 5.187245256305992314e-01
++1.230424263443430921e-01 2.030937970306834206e-01 5.291483757425788914e-01
++1.305276694613609623e-01 2.030217816424806365e-01 5.394201195013325068e-01
++1.383099125215292158e-01 2.028195613734770086e-01 5.494767764101642360e-01
++1.463797060150685281e-01 2.025001769277504637e-01 5.592461312000727158e-01
++1.547186326280874380e-01 2.020850680852618320e-01 5.686422620965899677e-01
++1.632970499077517346e-01 2.016054641193363861e-01 5.775676861911989146e-01
++1.720728231749732162e-01 2.011027291278179585e-01 5.859183845130113699e-01
++1.809917622181062835e-01 2.006270524284321510e-01 5.935918186078640302e-01
++1.899902199574210471e-01 2.002341583564870575e-01 6.004970669758479263e-01
++1.989997441940680178e-01 1.999802927301375655e-01 6.065651516258429021e-01
++2.079529779081165097e-01 1.999164256738651391e-01 6.117570630961892686e-01
++2.167895160216459782e-01 2.000830340237900185e-01 6.160673924886361785e-01
++2.254604257150365498e-01 2.005067081654643424e-01 6.195227918364496489e-01
++2.339306302023402284e-01 2.011991984057693306e-01 6.221760825969698816e-01
++2.421790683949211487e-01 2.021587162723321729e-01 6.240979346009031259e-01
++2.501971277034634733e-01 2.033727314506766359e-01 6.253682433520739714e-01
++2.579861074778473928e-01 2.048213417591974728e-01 6.260687943604991146e-01
++2.655544225081862275e-01 2.064804694302365684e-01 6.262779744769025880e-01
++2.729150389729214088e-01 2.083244557603688429e-01 6.260675767301320249e-01
++2.800833915559314269e-01 2.103279194298604549e-01 6.255013265069014894e-01
++2.870675074033041674e-01 2.124691386407265292e-01 6.246420009551492125e-01
++2.938851360627945386e-01 2.147254304183257023e-01 6.235380183242871244e-01
++3.005577213461362307e-01 2.170756514619715527e-01 6.222251903623999825e-01
++3.070843773107185259e-01 2.195059802015210115e-01 6.207554984633752992e-01
++3.134916285549604886e-01 2.219983100391352271e-01 6.191452159520036691e-01
++3.197798380866583856e-01 2.245420356602937373e-01 6.174343435010863912e-01
++3.259695527216341926e-01 2.271241237863139140e-01 6.156329324235468858e-01
++3.320579089479565038e-01 2.297373625924510887e-01 6.137771467682858750e-01
++3.380660052498126178e-01 2.323715331127139128e-01 6.118660583919267593e-01
++3.439917420525137604e-01 2.350215076527270575e-01 6.099280657295180763e-01
++3.498460685618723365e-01 2.376808945869600675e-01 6.079694872801727490e-01
++3.556384580181179977e-01 2.403444043084654869e-01 6.059953497614897211e-01
++3.613686295558476425e-01 2.430089153836439420e-01 6.040241385974032262e-01
++3.670434468015162932e-01 2.456707832167414618e-01 6.020607616318822686e-01
++3.726708785615932551e-01 2.483266964722255499e-01 6.001059364008434205e-01
++3.782547954216434749e-01 2.509743622345630976e-01 5.981656274234778969e-01
++3.837960822688916696e-01 2.536122834643630419e-01 5.962498766549472196e-01
++3.892988345534371120e-01 2.562387736058999166e-01 5.943618049976240325e-01
++3.947690991030736729e-01 2.588520700720948198e-01 5.924996351953921714e-01
++4.002098946086877773e-01 2.614510659770345469e-01 5.906660913059953444e-01
++4.056240909379103532e-01 2.640348396856425084e-01 5.888633104220148962e-01
++4.110144223076953041e-01 2.666026246434279878e-01 5.870929096766683841e-01
++4.163832172801885667e-01 2.691538344975527575e-01 5.853565951388559618e-01
++4.217313231007376317e-01 2.716882525666767800e-01 5.836583632684495537e-01
++4.270634345309600177e-01 2.742050306264073312e-01 5.819941042354170868e-01
++4.323818104897113601e-01 2.767038027770706843e-01 5.803639256565888971e-01
++4.376886243188534142e-01 2.791842625143060586e-01 5.787676418773346487e-01
++4.429859696643737577e-01 2.816461519867726748e-01 5.772048027503156042e-01
++4.482758654902720408e-01 2.840892531259122666e-01 5.756747186760452495e-01
++4.535602602863915700e-01 2.865133804028727749e-01 5.741764823913096949e-01
++4.588410355259065487e-01 2.889183750000149931e-01 5.727089879419176022e-01
++4.641200084236148382e-01 2.913041002126984247e-01 5.712709472315609105e-01
++4.693989340425177015e-01 2.936704379215548943e-01 5.698609044983501404e-01
++4.746795067933508583e-01 2.960172859965477521e-01 5.684772490345112450e-01
++4.799633613697112389e-01 2.983445565121622955e-01 5.671182264323321176e-01
++4.852520731601697723e-01 3.006521746683436525e-01 5.657819486102849682e-01
++4.905471581781303825e-01 3.029400783247205298e-01 5.644664028469250638e-01
++4.958500725502145712e-01 3.052082180664184574e-01 5.631694600262432404e-01
++5.011622116043696895e-01 3.074565577287760587e-01 5.618888822762294621e-01
++5.064849085998188727e-01 3.096850753156841218e-01 5.606223301621769961e-01
++5.118194331420761189e-01 3.118937642524056697e-01 5.593673695773668797e-01
++5.171669893275794294e-01 3.140826349187781363e-01 5.581214784559522801e-01
++5.225287136638799845e-01 3.162517164128481606e-01 5.568820534159194535e-01
++5.279056728126164666e-01 3.184010584984696690e-01 5.556464164236831760e-01
++5.332988612036093645e-01 3.205307336933521101e-01 5.544118215561065766e-01
++5.387091985692399332e-01 3.226408394566178117e-01 5.531754619204082291e-01
++5.441375274486375258e-01 3.247315004373090841e-01 5.519344767774559957e-01
++5.495846107110635703e-01 3.268028707475315597e-01 5.506859588994191812e-01
++5.550511291471261766e-01 3.288551362262008837e-01 5.494269621786239677e-01
++5.605376791749926424e-01 3.308885166617086537e-01 5.481545094908906179e-01
++5.660447559653561944e-01 3.329032737201366166e-01 5.468656290966650291e-01
++5.715723572408055730e-01 3.348998704862335973e-01 5.455581199822507887e-01
++5.771213104289429907e-01 3.368784486432290226e-01 5.442280104688511644e-01
++5.826918609018115758e-01 3.388393806259411556e-01 5.428722728323092106e-01
++5.882841610050709713e-01 3.407830824811499126e-01 5.414878910241607279e-01
++5.938982692324897839e-01 3.427100153754324974e-01 5.400718694374621043e-01
++5.995341497366565298e-01 3.446206869260000083e-01 5.386212416598933350e-01
++6.051916721861749782e-01 3.465156523493675422e-01 5.371330791454219655e-01
++6.108706119725975103e-01 3.483955154267821541e-01 5.356044997333838653e-01
++6.165706507631435462e-01 3.502609292895154658e-01 5.340326759432469927e-01
++6.222913773881607602e-01 3.521125970311436149e-01 5.324148429745680922e-01
++6.280322890453092777e-01 3.539512721578863541e-01 5.307483063447554494e-01
++6.337927927958686425e-01 3.557777588917046541e-01 5.290304491020394462e-01
++6.395721854014132512e-01 3.575929224264804973e-01 5.272587829694529438e-01
++6.453697498455218673e-01 3.593976455700171879e-01 5.254307632896803026e-01
++6.511846984697030605e-01 3.611928549527803622e-01 5.235439096149940852e-01
++6.570160963803246545e-01 3.629795579684892415e-01 5.215959730192853971e-01
++6.628629283562820218e-01 3.647588132682739737e-01 5.195848109675399451e-01
++6.687241012633005077e-01 3.665317306708469891e-01 5.175083912494201632e-01
++6.745984464659754432e-01 3.682994710922303794e-01 5.153647953022981731e-01
++6.804847221871188623e-01 3.700632465224873990e-01 5.131522209386339961e-01
++6.863816157645579175e-01 3.718243200760849021e-01 5.108689845040222943e-01
++6.922877457570544291e-01 3.735840061411623281e-01 5.085135225034096429e-01
++6.982016638532075881e-01 3.753436706510840937e-01 5.060843927435032530e-01
++7.041218565401857754e-01 3.771047314992945210e-01 5.035802750493091340e-01
++7.100468845018954589e-01 3.788685911907690995e-01 5.009996451582281463e-01
++7.159752518731292703e-01 3.806367017978663503e-01 4.983410633235164089e-01
++7.219050254760910335e-01 3.824107548202065887e-01 4.956041045679995816e-01
++7.278344332015346252e-01 3.841923879692217270e-01 4.927879483140180095e-01
++7.337616407032357957e-01 3.859832960516177969e-01 4.898918977085310877e-01
++7.396847510296571393e-01 3.877852324461281697e-01 4.869153794944616753e-01
++7.456018038508585022e-01 3.896000107579556393e-01 4.838579440403712462e-01
++7.515107742785041012e-01 3.914295066368485010e-01 4.807192656291401911e-01
++7.574095712835625660e-01 3.932756597383701980e-01 4.774991431076147097e-01
++7.632960357235062387e-01 3.951404758009958162e-01 4.741975009994948143e-01
++7.691679379984673881e-01 3.970260288041012053e-01 4.708143911830061090e-01
++7.750229753641669772e-01 3.989344631636088656e-01 4.673499952331199858e-01
++7.808587689384376418e-01 4.008679959130103665e-01 4.638046275250513051e-01
++7.866728604480874854e-01 4.028289188075652172e-01 4.601787391913814695e-01
++7.924627087737056153e-01 4.048196002786729752e-01 4.564729230191116316e-01
++7.982256863620216247e-01 4.068424871537119070e-01 4.526879193650572009e-01
++8.039590755885861473e-01 4.089001060440320967e-01 4.488246231577860956e-01
++8.096600651680347926e-01 4.109950642903736351e-01 4.448840920414381395e-01
++8.153258420561760866e-01 4.131300072582320126e-01 4.408672005707100494e-01
++8.209533846301936277e-01 4.153077124896901728e-01 4.367753702901882029e-01
++8.265394587133882975e-01 4.175310847974926798e-01 4.326106584748535266e-01
++8.320808476618816174e-01 4.198030498289601065e-01 4.283748912056176694e-01
++8.375742298072511582e-01 4.221266063894242304e-01 4.240701127101388912e-01
++8.430161781421201539e-01 4.245048216497959159e-01 4.196985997897492715e-01
++8.484031611801808870e-01 4.269408247931844591e-01 4.152628771038663902e-01
++8.537315452228415591e-01 4.294377989032187592e-01 4.107657331305429871e-01
++8.589975982777037222e-01 4.319989708985695898e-01 4.062102365684474026e-01
++8.641974958823694930e-01 4.346275993272235572e-01 4.015997528869852951e-01
++8.693273290890853877e-01 4.373269598520185819e-01 3.969379606684441675e-01
++8.743831148591909574e-01 4.401003282876529976e-01 3.922288673203608855e-01
++8.793608090992056647e-01 4.429509610905758565e-01 3.874768236699652202e-01
++8.842563225402819693e-01 4.458820732584555802e-01 3.826865368883226592e-01
++8.890655396175203284e-01 4.488968136663485375e-01 3.778630811333164030e-01
++8.937843693689974112e-01 4.519982404973394430e-01 3.730116014425700621e-01
++8.984086715918495614e-01 4.551892900487020666e-01 3.681382748140558103e-01
++9.029343899688814234e-01 4.584727367754222738e-01 3.632494215164466245e-01
++9.073575586033109097e-01 4.618511663085561048e-01 3.583516614288673741e-01
++9.116743277656134126e-01 4.653269421603676848e-01 3.534519722899168159e-01
++9.158809992051784032e-01 4.689021723136149178e-01 3.485576699619067353e-01
++9.199740625655835613e-01 4.725786767270368505e-01 3.436763818638891022e-01
++9.239502320744639174e-01 4.763579567194722864e-01 3.388160133952918263e-01
++9.278064825504417357e-01 4.802411672570275347e-01 3.339847073943023048e-01
++9.315400836682339314e-01 4.842290931875970483e-01 3.291907969273191181e-01
++9.351486313601243827e-01 4.883221304365225612e-01 3.244427519772630775e-01
++9.386300752174523421e-01 4.925202730905588466e-01 3.197491208755643965e-01
++9.419827407976890665e-01 4.968231071526066356e-01 3.151184675888816233e-01
++9.452053458453827384e-01 5.012298115494860928e-01 3.105593062092800172e-01
++9.482970095990234105e-01 5.057391667267315816e-01 3.060800341879720277e-01
++9.512572545755481057e-01 5.103495708806106146e-01 3.016888659817511531e-01
++9.540860004899643920e-01 5.150590635745326828e-01 2.973937688352701891e-01
++9.567835502644689294e-01 5.198653561843505910e-01 2.932024023936338208e-01
++9.593505683914355098e-01 5.247658683349885056e-01 2.891220637265379811e-01
++9.617880522174245828e-01 5.297577692490467172e-01 2.851596391521897811e-01
++9.640972969908582213e-01 5.348380227429672118e-01 2.813215639873033469e-01
++9.662798557460373639e-01 5.400034344900018768e-01 2.776137910349112392e-01
++9.683374952663609259e-01 5.452507001277228094e-01 2.740417682745930894e-01
++9.702721494708056449e-01 5.505764528210163045e-01 2.706104258619907443e-01
++9.720889605050128113e-01 5.559744240639272750e-01 2.673323057285149629e-01
++9.737882391976736551e-01 5.614431075234689317e-01 2.642051375197135843e-01
++9.753722517954447335e-01 5.669791681305653697e-01 2.612321043607351290e-01
++9.768433321430202154e-01 5.725792962307277856e-01 2.584161030939570725e-01
++9.782037550763590383e-01 5.782403184217296266e-01 2.557595328984585970e-01
++9.794556966363962003e-01 5.839592236834146854e-01 2.532643241222839459e-01
++9.806011989875685897e-01 5.897331838357899869e-01 2.509319710696591987e-01
++9.816445119805891073e-01 5.955576445021050214e-01 2.487674614053176358e-01
++9.825957966513861885e-01 6.014235301335163486e-01 2.467838886220111161e-01
++9.834484089207010671e-01 6.073354334336248384e-01 2.449669167474177733e-01
++9.842037798764916579e-01 6.132913094304376367e-01 2.433164315861336413e-01
++9.848630901763529844e-01 6.192893396808167861e-01 2.418320393357376030e-01
++9.854335855591603854e-01 6.253232095344845032e-01 2.405207443125048083e-01
++9.859266054527725531e-01 6.313839151833324781e-01 2.393924955683320310e-01
++9.863290788081210403e-01 6.374805817839866995e-01 2.384285005271009616e-01
++9.866412575432023102e-01 6.436122274808632193e-01 2.376272705850792089e-01
++9.868743031654042541e-01 6.497702193582076680e-01 2.369977788720153966e-01
++9.870387195949218428e-01 6.559468364085242476e-01 2.365460008515470891e-01
++9.871160198111447182e-01 6.621544902577213287e-01 2.362516434857291903e-01
++9.871054832314208882e-01 6.683929123881801049e-01 2.361125093170109435e-01
++9.870452158568817635e-01 6.746361467497961062e-01 2.361551640855951706e-01
++9.869008071972434903e-01 6.809069196703931848e-01 2.363489608363473771e-01
++9.866692878063002548e-01 6.872064512263130753e-01 2.366900769944741967e-01
++9.863929517876753872e-01 6.935072010148546351e-01 2.372025181179537867e-01
++9.860358081545986808e-01 6.998320059248218650e-01 2.378591308273384497e-01
++9.855936903889445100e-01 7.061828277187244263e-01 2.386553467137359497e-01
++9.851166760681809853e-01 7.125285611733751523e-01 2.396137846497558566e-01
++9.845515404596055786e-01 7.189016348706930293e-01 2.407027465239837682e-01
++9.839219208542443473e-01 7.252873073536283410e-01 2.419304971970357987e-01
++9.832411577231264799e-01 7.316776102841332508e-01 2.432981102176038357e-01
++9.824686360853925882e-01 7.380960010628512258e-01 2.447853973017022899e-01
++9.816675490572134288e-01 7.445058075421049359e-01 2.464118597749720974e-01
++9.807811261674898029e-01 7.509394073137781733e-01 2.481527624504580309e-01
++9.798377198237012697e-01 7.573804700508821597e-01 2.500137146942527089e-01
++9.788392654586509645e-01 7.638279008720277874e-01 2.519905378906656113e-01
++9.777574675384567149e-01 7.702969047505190403e-01 2.540716600569991046e-01
++9.766479350869351483e-01 7.767573771217611833e-01 2.562664070834250185e-01
++9.754356977304895482e-01 7.832491288133777152e-01 2.585534361426328198e-01
++9.742107025732685832e-01 7.897246981741067318e-01 2.609472103669700505e-01
++9.728835679779427315e-01 7.962305102434532600e-01 2.634261983272434549e-01
++9.715297353896644728e-01 8.027276438790406088e-01 2.659994820979044161e-01
++9.700861348373609472e-01 8.092479763321948072e-01 2.686528986078252079e-01
++9.686057099481873989e-01 8.157648637457888263e-01 2.713899293880046582e-01
++9.670430691608270513e-01 8.223006128282058791e-01 2.742007328066633498e-01
++9.654377156641301694e-01 8.288358297838601674e-01 2.770858440538391254e-01
++9.637524161478506768e-01 8.353882936883590959e-01 2.800376262549509332e-01
++9.620231537308009395e-01 8.419407901977008502e-01 2.830554448577937698e-01
++9.602104885023859948e-01 8.485116373841136150e-01 2.861325388392048086e-01
++9.583576301078738924e-01 8.550807238511934916e-01 2.892681513706822360e-01
++9.564117528707279936e-01 8.616719638797333269e-01 2.924557053792812833e-01
++9.544348419615947821e-01 8.682572954460299197e-01 2.956947937778980906e-01
++9.523487086523741985e-01 8.748712522095133393e-01 2.989788164145827376e-01
++9.502464564071694264e-01 8.814728114137494464e-01 3.023077648025994102e-01
++9.480141307284709606e-01 8.881110895508603775e-01 3.056751963404329420e-01
++9.457819798963852387e-01 8.947301765899248194e-01 3.090811208408512645e-01
++9.434198646152930356e-01 9.013849121338212145e-01 3.125200216900483885e-01
++9.410286159691669816e-01 9.080328518084608280e-01 3.159906396320988908e-01
++9.385331275251967975e-01 9.147047487143539213e-01 3.194893313796646206e-01
++9.359711083432949996e-01 9.213848126149789541e-01 3.230138415459749002e-01
++9.333375985220991877e-01 9.280748341844049509e-01 3.265615469169362850e-01
++9.305915654403119630e-01 9.347905093445134650e-01 3.301299810381577715e-01
++9.278142496620381818e-01 9.414998557883345054e-01 3.337168327083647745e-01
++9.248899165263079203e-01 9.482470197415310276e-01 3.373199677733378365e-01
++9.219411401959984875e-01 9.549849147932994997e-01 3.409370492608514991e-01
++9.188613878011584468e-01 9.617532494963948464e-01 3.445662997232426528e-01
++9.156931782520092433e-01 9.685354904254356301e-01 3.482056900726151483e-01
++9.124490701578419349e-01 9.753266872784461805e-01 3.518533597970244786e-01
++9.090418416674036495e-01 9.821574063216705897e-01 3.555078064299531104e-01]; 
++
++   case 'tur' 
++      RGB = [9.128247827303703765e-01 9.639053479101408195e-01 6.723488894068933019e-01
++9.105541439463002984e-01 9.592872094872512134e-01 6.663907644186453094e-01
++9.082861583229014935e-01 9.546805250318116665e-01 6.604691147501789983e-01
++9.060452334346256187e-01 9.500783067250512248e-01 6.545538618591559832e-01
++9.038150489008132116e-01 9.454849862587190179e-01 6.486649327173524826e-01
++9.016037749037892901e-01 9.408980925645457072e-01 6.427923205892623892e-01
++8.994100526612220925e-01 9.363178430715828338e-01 6.369376634451241470e-01
++8.972283335855062436e-01 9.317456838096750404e-01 6.311075587918794083e-01
++8.950696728809198754e-01 9.271782394664687121e-01 6.252888115672152747e-01
++8.929173737868275618e-01 9.226202315494650419e-01 6.195011901939884158e-01
++8.907923116926522722e-01 9.180653547565199579e-01 6.137200788543796248e-01
++8.886692522817520867e-01 9.135209242332905655e-01 6.079750370293484085e-01
++8.865762636352767512e-01 9.089784066893161762e-01 6.022333770048255985e-01
++8.844822115233714754e-01 9.044469910654970857e-01 5.965311430834745465e-01
++8.824197090505849772e-01 8.999166548769963470e-01 5.908308404756164034e-01
++8.803543805345617201e-01 8.953977033216384829e-01 5.851717778972109762e-01
++8.783207074075700671e-01 8.908794045328807254e-01 5.795148392301145979e-01
++8.762837291194094380e-01 8.863723903264537629e-01 5.738994936029852001e-01
++8.742771906432560414e-01 8.818660105043367725e-01 5.682879912596860983e-01
++8.722681388310039585e-01 8.773704198332279436e-01 5.627170493987142530e-01
++8.702869566172963811e-01 8.728758815872331711e-01 5.571531747195710427e-01
++8.683053185700908561e-01 8.683912265313378231e-01 5.516275115467151879e-01
++8.663476627856837586e-01 8.639084851022803546e-01 5.461135394992869818e-01
++8.643928371591906856e-01 8.594343049131268897e-01 5.406342206369587622e-01
++8.624568202066339451e-01 8.549633517080399425e-01 5.351725180271732496e-01
++8.605281096749168857e-01 8.504992167172934492e-01 5.297408107341389227e-01
++8.586117879987910095e-01 8.460400804193519697e-01 5.243338350869022335e-01
++8.567083921128474389e-01 8.415855961633933457e-01 5.189512185545770429e-01
++8.548097683783190126e-01 8.371383437933764826e-01 5.136015164012288636e-01
++8.529307767408889074e-01 8.326931553267608033e-01 5.082696912104300857e-01
++8.510506087990278301e-01 8.282569318779919865e-01 5.029770800265680464e-01
++8.491921882796159560e-01 8.238216896030918779e-01 4.977007922336022516e-01
++8.473354714528938958e-01 8.193941476796476886e-01 4.924611248003303854e-01
++8.454893810507302376e-01 8.149710832043290942e-01 4.872494055687389136e-01
++8.436548921629284381e-01 8.105519834307682858e-01 4.820650051378080891e-01
++8.418197380538857688e-01 8.061410299518165790e-01 4.769199747107543685e-01
++8.400053197367541857e-01 8.017304745289870471e-01 4.717941759727964368e-01
++8.381909179373602248e-01 7.973275360052080041e-01 4.667076177307682427e-01
++8.363830265089613469e-01 7.929297607375542789e-01 4.616544156277210820e-01
++8.345877920103869085e-01 7.885347495856604993e-01 4.566293264683093933e-01
++8.327919089080556558e-01 7.841472126590459668e-01 4.516448413369297810e-01
++8.310063135234079246e-01 7.797629900031863848e-01 4.466914503101058753e-01
++8.292275089883606176e-01 7.753832051359705879e-01 4.417727747802380756e-01
++8.274479714210091208e-01 7.710105395274703399e-01 4.368957512003675547e-01
++8.256785592470122781e-01 7.666407630966191045e-01 4.320514550589309999e-01
++8.239135967944541949e-01 7.622758578672201857e-01 4.272453035219374029e-01
++8.221475640634913207e-01 7.579178098056661428e-01 4.224823211006376589e-01
++8.203879070453153899e-01 7.535636173491093714e-01 4.177568735562176006e-01
++8.186335117171099629e-01 7.492135470811618347e-01 4.130705335781763021e-01
++8.168774297351566460e-01 7.448701849739395309e-01 4.084293549358841147e-01
++8.151208269598283485e-01 7.405329639445877854e-01 4.038328842986566580e-01
++8.133730042127403914e-01 7.361980289394938204e-01 3.992747817294182155e-01
++8.116225817355652294e-01 7.318697849631130570e-01 3.947642928691043052e-01
++8.098694933912269356e-01 7.275481580762414024e-01 3.903019868836329342e-01
++8.081161421647475862e-01 7.232320558774254504e-01 3.858867812020280175e-01
++8.063663538470418057e-01 7.189197605534187741e-01 3.815168716651668457e-01
++8.046125622407066524e-01 7.146142683294098852e-01 3.771981838442269308e-01
++8.028545343811845925e-01 7.103155798131343124e-01 3.729315169481128289e-01
++8.010919901003339394e-01 7.060237163039633224e-01 3.687177325408004802e-01
++7.993300055097595225e-01 7.017364019961147559e-01 3.645545873969476269e-01
++7.975634994838864955e-01 6.974556802865253813e-01 3.604460667960328046e-01
++7.957906047709230046e-01 6.931822615073386373e-01 3.563940392198953200e-01
++7.940108757837693876e-01 6.889162546167795220e-01 3.523995277667577586e-01
++7.922238209776574225e-01 6.846577925964051348e-01 3.484635956840971271e-01
++7.904293753935112132e-01 6.804068218754933950e-01 3.445871200261476641e-01
++7.886299371669703850e-01 6.761621751401072355e-01 3.407699499113064912e-01
++7.868208547545553211e-01 6.719258532155115704e-01 3.370151794848580962e-01
++7.850015016585555339e-01 6.676980777850795024e-01 3.333239143922641090e-01
++7.831712152651345571e-01 6.634790940463787257e-01 3.296972647086952590e-01
++7.813292995863233559e-01 6.592691702526117803e-01 3.261363364073748827e-01
++7.794750283869652518e-01 6.550685970372218669e-01 3.226422224503434077e-01
++7.776076486673221266e-01 6.508776865233487641e-01 3.192159935965748763e-01
++7.757263844650232887e-01 6.466967712234903409e-01 3.158586890319579621e-01
++7.738304409335882150e-01 6.425262027384857078e-01 3.125713069333992955e-01
++7.719190086491207747e-01 6.383663502685200664e-01 3.093547950848793415e-01
++7.699919228068800026e-01 6.342172763144198200e-01 3.062099646060428282e-01
++7.680475840592058123e-01 6.300797563557358760e-01 3.031377731717001534e-01
++7.660850744742599971e-01 6.259542495514858196e-01 3.001389551573931946e-01
++7.641036016288820232e-01 6.218411653176698639e-01 2.972141439455896483e-01
++7.621023798026289597e-01 6.177409214840726692e-01 2.943638837738908332e-01
++7.600806343242360041e-01 6.136539422033919777e-01 2.915886230831420400e-01
++7.580376057793873912e-01 6.095806558220696614e-01 2.888887086342720734e-01
++7.559725540291885038e-01 6.055214927394206859e-01 2.862643804685457427e-01
++7.538847619930633126e-01 6.014768832813116584e-01 2.837157677714013393e-01
++7.517735391550399715e-01 5.974472556137478962e-01 2.812428856843471325e-01
++7.496385821697367779e-01 5.934328401156596655e-01 2.788457594157026098e-01
++7.474790247249349928e-01 5.894341791373612915e-01 2.765241346674250367e-01
++7.452941571551999766e-01 5.854517449359323278e-01 2.742776443121395791e-01
++7.430834135426160891e-01 5.814859431780246002e-01 2.721058338160937673e-01
++7.408462686359136296e-01 5.775371675495697410e-01 2.700081319859798934e-01
++7.385822390693008721e-01 5.736057983656746018e-01 2.679838537450121017e-01
++7.362908841899132861e-01 5.696922013455091305e-01 2.660322037116858995e-01
++7.339718065076965559e-01 5.657967265562297010e-01 2.641522805055408485e-01
++7.316246517864810617e-01 5.619197075270785380e-01 2.623430816971141777e-01
++7.292491087989990683e-01 5.580614605321673194e-01 2.606035093141773062e-01
++7.268449087719649482e-01 5.542222840379915638e-01 2.589323758133949549e-01
++7.244119971505563749e-01 5.504023530996886571e-01 2.573286095051418587e-01
++7.219503397818252122e-01 5.466018316756788842e-01 2.557911025974954899e-01
++7.194594088198653647e-01 5.428211930643935812e-01 2.543180251101427314e-01
++7.169390970998404944e-01 5.390606612983260826e-01 2.529078914226555730e-01
++7.143893337983732161e-01 5.353204418367376594e-01 2.515591605975798783e-01
++7.118100825627617922e-01 5.316007218689121627e-01 2.502702433238302993e-01
++7.092013395547599464e-01 5.279016707079033921e-01 2.490395087311264022e-01
++7.065632761648270588e-01 5.242233436125348645e-01 2.478655721838471937e-01
++7.038960056028840118e-01 5.205658319141027723e-01 2.467469222620103930e-01
++7.011993601253575514e-01 5.169294192806536126e-01 2.456813814978507926e-01
++6.984734491802424561e-01 5.133142072042380377e-01 2.446672141412145063e-01
++6.957184043559518916e-01 5.097202822466132544e-01 2.437026738057547215e-01
++6.929343773945654261e-01 5.061477167394171639e-01 2.427860085204449625e-01
++6.901216982990902027e-01 5.025964514073363310e-01 2.419159412674971588e-01
++6.872804633072713276e-01 4.990665929836670123e-01 2.410905423858894503e-01
++6.844107686966893755e-01 4.955582518851005536e-01 2.403077709414531138e-01
++6.815128311469199618e-01 4.920714492259936068e-01 2.395658950635757289e-01
++6.785868785067301623e-01 4.886061954699182919e-01 2.388631970725307307e-01
++6.756332326667190413e-01 4.851624213327032087e-01 2.381983436213906957e-01
++6.726521288960277678e-01 4.817401209176369048e-01 2.375696985886235346e-01
++6.696437188359446457e-01 4.783393588339723279e-01 2.369751854422654791e-01
++6.666082635296274317e-01 4.749601080715157297e-01 2.364131671114735878e-01
++6.635460289039749604e-01 4.716023339061982678e-01 2.358820311548202042e-01
++6.604573673748913576e-01 4.682659130292578520e-01 2.353807610155446706e-01
++6.573424797961275878e-01 4.649508592384817285e-01 2.349074379402631418e-01
++6.542016086091390070e-01 4.616571492422122946e-01 2.344603126221481149e-01
++6.510350327978842166e-01 4.583847209004847101e-01 2.340378795902509079e-01
++6.478430515953373936e-01 4.551334824230311438e-01 2.336388774485689268e-01
++6.446259633611755024e-01 4.519033296020167900e-01 2.332622032236857934e-01
++6.413839940492124247e-01 4.486942500114745047e-01 2.329058642884746511e-01
++6.381174276440877424e-01 4.455061586981217681e-01 2.325684660088059297e-01
++6.348265500932614991e-01 4.423389620941622913e-01 2.322486831842977550e-01
++6.315116605695774155e-01 4.391925158791953887e-01 2.319458531661305334e-01
++6.281730104223729461e-01 4.360667833034455043e-01 2.316579279478628295e-01
++6.248108867019236401e-01 4.329616581049553492e-01 2.313836187886625928e-01
++6.214255770673621226e-01 4.298770280576157399e-01 2.311216752923600515e-01
++6.180173538237878628e-01 4.268127440894281532e-01 2.308715541128374960e-01
++6.145865084649400067e-01 4.237687269357882092e-01 2.306313089541623396e-01
++6.111333338376842006e-01 4.207448478787260138e-01 2.303997483300764260e-01
++6.076581198732585731e-01 4.177409699743503957e-01 2.301757903742778777e-01
++6.041611292458852756e-01 4.147569442408376994e-01 2.299587629276800271e-01
++6.006426901866908086e-01 4.117926430199113641e-01 2.297469460659757323e-01
++5.971031071270087587e-01 4.088479120598013661e-01 2.295392371763493311e-01
++5.935426680352169360e-01 4.059225898260850895e-01 2.293347588094398759e-01
++5.899616653081597439e-01 4.030165124281641087e-01 2.291325734316880802e-01
++5.863604503326285133e-01 4.001295067793814719e-01 2.289312648345211421e-01
++5.827393462725786177e-01 3.972613890222796984e-01 2.287298138873416486e-01
++5.790986411902667719e-01 3.944119738157387811e-01 2.285275119372468522e-01
++5.754386920094946012e-01 3.915810608797961612e-01 2.283231701874827158e-01
++5.717598595710956522e-01 3.887684389212705538e-01 2.281156877135243621e-01
++5.680624888217489232e-01 3.859738913687448258e-01 2.279041499218198430e-01
++5.643468987836690598e-01 3.831972016166527162e-01 2.276878398717704366e-01
++5.606135014398240246e-01 3.804381236067138072e-01 2.274655664744977823e-01
++5.568626686009898741e-01 3.776964124183660454e-01 2.272364567122592827e-01
++5.530947703612836275e-01 3.749718169415875435e-01 2.269997025952595338e-01
++5.493102061694418170e-01 3.722640707136085636e-01 2.267544107214977123e-01
++5.455093844474366849e-01 3.695728971647626593e-01 2.264997151134776621e-01
++5.416927086216569709e-01 3.668980144097471752e-01 2.262348350480499204e-01
++5.378606217947595747e-01 3.642391205981750923e-01 2.259588836659274236e-01
++5.340135354481294616e-01 3.615959178208362768e-01 2.256711679956127647e-01
++5.301518754638107067e-01 3.589680973433583278e-01 2.253709864348782954e-01
++5.262761094769513592e-01 3.563553292394111560e-01 2.250575362145477709e-01
++5.223867172868102982e-01 3.537572724565644089e-01 2.247300369556790578e-01
++5.184841017313481792e-01 3.511736091955309780e-01 2.243880288453043437e-01
++5.145687147834636654e-01 3.486039985632924942e-01 2.240309158662728284e-01
++5.106411440519553757e-01 3.460480410893026493e-01 2.236577184811773256e-01
++5.067017881423235837e-01 3.435054056903972253e-01 2.232681227570667559e-01
++5.027510796252681047e-01 3.409757445575836710e-01 2.228617265136721426e-01
++4.987895070653633467e-01 3.384586834157125024e-01 2.224379910665530979e-01
++4.948177548651969127e-01 3.359537625951555251e-01 2.219958720410014630e-01
++4.908360971463728295e-01 3.334606870942352086e-01 2.215355358785864315e-01
++4.868450056329213793e-01 3.309790783774143597e-01 2.210565950309411609e-01
++4.828450375686827445e-01 3.285085184570587513e-01 2.205584694191147777e-01
++4.788368359138705510e-01 3.260485487451708631e-01 2.200404115431305319e-01
++4.748206472212548879e-01 3.235988770790072522e-01 2.195027100981302715e-01
++4.707969362808618885e-01 3.211591169778729160e-01 2.189450971836008897e-01
++4.667662693795122109e-01 3.187288356425135860e-01 2.183670869460304087e-01
++4.627293116701075015e-01 3.163075541790801304e-01 2.177680072916463594e-01
++4.586862340695841422e-01 3.138950081558932736e-01 2.171483462825098965e-01
++4.546374811311343911e-01 3.114908131915107847e-01 2.165079490118044792e-01
++4.505834924512453488e-01 3.090945859801553230e-01 2.158466824363790559e-01
++4.465251651502277208e-01 3.067057384379430762e-01 2.151634647284257906e-01
++4.424624800332205288e-01 3.043240886593481798e-01 2.144591818414338102e-01
++4.383958498551490668e-01 3.019492632236420726e-01 2.137337799541155214e-01
++4.343256784780819557e-01 2.995808923379119637e-01 2.129872269867968959e-01
++4.302525491830334059e-01 2.972185251864662980e-01 2.122191462426318287e-01
++4.261769801706936645e-01 2.948617395754311588e-01 2.114293130588631442e-01
++4.220990387565126678e-01 2.925103169029278360e-01 2.106183606559913768e-01
++4.180190866768337399e-01 2.901639064725308748e-01 2.097863381928281035e-01
++4.139374748855114139e-01 2.878221627482029921e-01 2.089333114395358071e-01
++4.098546564000305481e-01 2.854846942476605975e-01 2.080591616116443943e-01
++4.057712419033978057e-01 2.831510381788182595e-01 2.071635039021454405e-01
++4.016871580256169971e-01 2.808210427866469350e-01 2.062471500335373853e-01
++3.976027082875563945e-01 2.784943860456884357e-01 2.053102247884384113e-01
++3.935181846712299536e-01 2.761707517515646915e-01 2.043528642900468983e-01
++3.894338675796663596e-01 2.738498295626687340e-01 2.033752150347126197e-01
++3.853501485284500094e-01 2.715312592611229259e-01 2.023772355615125473e-01
++3.812675049241057712e-01 2.692146423201499661e-01 2.013587500039031863e-01
++3.771858334106182320e-01 2.668998447434733912e-01 2.003204988638387918e-01
++3.731053664536302938e-01 2.645865804728991244e-01 1.992626621753412208e-01
++3.690263252725575205e-01 2.622745690957888343e-01 1.981854256387428070e-01
++3.649489199677356521e-01 2.599635357439662453e-01 1.970889798104242807e-01
++3.608733496668369289e-01 2.576532109746325627e-01 1.959735193223784977e-01
++3.567998026886545215e-01 2.553433306346174492e-01 1.948392421320772061e-01
++3.527288062385475209e-01 2.530334781151396539e-01 1.936858449182176090e-01
++3.486601920186409020e-01 2.507235512004114542e-01 1.925140265725779620e-01
++3.445940882588859333e-01 2.484133136793199026e-01 1.913240314183973223e-01
++3.405306410460574029e-01 2.461025213487854080e-01 1.901160637330516767e-01
++3.364699867832531277e-01 2.437909343510991644e-01 1.888903276956251931e-01
++3.324122524192171801e-01 2.414783169649092898e-01 1.876470268273142949e-01
++3.283575556825768516e-01 2.391644373879673879e-01 1.863863634598928731e-01
++3.243060053196711312e-01 2.368490675124892975e-01 1.851085382313104599e-01
++3.202577013347079893e-01 2.345319826939236685e-01 1.838137496073975197e-01
++3.162127352310978301e-01 2.322129615138344705e-01 1.825021934285724068e-01
++3.121713481873937823e-01 2.298917159046080516e-01 1.811738589048320913e-01
++3.081335147958294551e-01 2.275680750195018809e-01 1.798290697596431065e-01
++3.040992288572926250e-01 2.252418581754896398e-01 1.784681064582642751e-01
++3.000685503066236048e-01 2.229128543385760497e-01 1.770911493801810288e-01
++2.960415318405872354e-01 2.205808544095470558e-01 1.756983743063298686e-01
++2.920182191423447704e-01 2.182456509647304199e-01 1.742899520962044868e-01
++2.879986511013646333e-01 2.159070379936562922e-01 1.728660483803914072e-01
++2.839828600283449411e-01 2.135648106336759944e-01 1.714268232671206371e-01
++2.799708718647850314e-01 2.112187649015158653e-01 1.699724310614039724e-01
++2.759627063869375951e-01 2.088686974216710790e-01 1.685030199953476415e-01
++2.719583774039363577e-01 2.065144051514603007e-01 1.670187319682087390e-01
++2.679578929499804030e-01 2.041556851024882158e-01 1.655197022947889340e-01
++2.639612554705231817e-01 2.017923340581795344e-01 1.640060594607524180e-01
++2.599684620025124460e-01 1.994241482869618665e-01 1.624779248834790635e-01
++2.559795043487851918e-01 1.970509232505948671e-01 1.609354126770728421e-01
++2.519943692468365470e-01 1.946724533070429697e-01 1.593786294201690046e-01
++2.480130385322499298e-01 1.922885314071993146e-01 1.578076739252100846e-01
++2.440354892972040890e-01 1.898989487846577950e-01 1.562226370078938775e-01
++2.400616940445691738e-01 1.875034946376172018e-01 1.546236012555405048e-01
++2.360916208382524140e-01 1.851019558018774935e-01 1.530106407931814128e-01
++2.321252334505864434e-01 1.826941164137449169e-01 1.513838210462468969e-01
++2.281624915077672400e-01 1.802797575614995262e-01 1.497431984988283338e-01
++2.242033506345226801e-01 1.778586569239049842e-01 1.480888204466117852e-01
++2.202477625994911925e-01 1.754305883940150690e-01 1.464207247437575854e-01
++2.162956754630863121e-01 1.729953216862958332e-01 1.447389395432186476e-01
++2.123470337300349953e-01 1.705526219247719688e-01 1.430434830302904636e-01
++2.084017785092666109e-01 1.681022492095620435e-01 1.413343631495822261e-01
++2.044598476844710633e-01 1.656439581587243193e-01 1.396115773261282222e-01
++2.005211760994463077e-01 1.631774974218037078e-01 1.378751121820577796e-01
++1.965856988864305155e-01 1.607026079587815515e-01 1.361249399201315824e-01
++1.926533421135208923e-01 1.582190261881047944e-01 1.343610282823611279e-01
++1.887240316449029232e-01 1.557264800392861304e-01 1.325833310557416600e-01
++1.847976928565723820e-01 1.532246885529702785e-01 1.307917884786300444e-01
++1.808742494403644818e-01 1.507133617751950094e-01 1.289863286797117148e-01
++1.769536238533599426e-01 1.481921999716426241e-01 1.271668674796427312e-01
++1.730357378708484994e-01 1.456608927537091369e-01 1.253333082519507424e-01
++1.691205132766324948e-01 1.431191180966186194e-01 1.234855418704042807e-01
++1.652078727370975830e-01 1.405665412234658185e-01 1.216234467798024410e-01
++1.612977409237918991e-01 1.380028133201234297e-01 1.197468892401933882e-01
++1.573900459762036241e-01 1.354275700331004917e-01 1.178557238119506412e-01
++1.534847214366352741e-01 1.328404296837557008e-01 1.159497941721605863e-01
++1.495817088501062986e-01 1.302409911046356894e-01 1.140289343827514401e-01
++1.456809613162400874e-01 1.276288309622561901e-01 1.120929707687035870e-01
++1.417824484273444985e-01 1.250035003675231404e-01 1.101417246101454861e-01
++1.378861632611661503e-01 1.223645204774909678e-01 1.081750159008208478e-01
++1.339921324751868759e-01 1.197113766395997425e-01 1.061926684632616136e-01]; 
++
++   case 'del'
++      RGB = [6.597738601379860013e-02 1.238600499381984077e-01 2.494811599712867811e-01
++6.865757658541371544e-02 1.266324956800233548e-01 2.555762447808356264e-01
++7.132312021900141796e-02 1.293951489111998809e-01 2.616639066260320057e-01
++7.396584278365506138e-02 1.321405798946303223e-01 2.677947952348482819e-01
++7.658629323761953489e-02 1.348691618055914976e-01 2.739690401973952083e-01
++7.919241629978698849e-02 1.375884267331394517e-01 2.801420635219376565e-01
++8.176925318412744947e-02 1.402841919021537431e-01 2.864049855987979565e-01
++8.433406612792618273e-02 1.429731754896261531e-01 2.926562894753481636e-01
++8.687299291862357609e-02 1.456421509856402619e-01 2.989801852647154812e-01
++8.939564312621503528e-02 1.483008215820366127e-01 3.053194113218902772e-01
++9.189721302857964402e-02 1.509448355999061520e-01 3.117030007960572280e-01
++9.437767086491094526e-02 1.535746031892240571e-01 3.181307112978130625e-01
++9.684032408298676176e-02 1.561940161218882128e-01 3.245815662969073756e-01
++9.927796547462605647e-02 1.587964393005784070e-01 3.310975577575396844e-01
++1.016993930631445442e-01 1.613915446377360008e-01 3.376235806086802516e-01
++1.040929763606517067e-01 1.639684016677392386e-01 3.442267209045115073e-01
++1.064700341792961802e-01 1.665394889067980111e-01 3.508360219569039429e-01
++1.088176547667218386e-01 1.690928617928972866e-01 3.575240510639015601e-01
++1.111462403295262191e-01 1.716403013777595965e-01 3.642247640300367850e-01
++1.134452622240499642e-01 1.741726760902385374e-01 3.709940519253031033e-01
++1.157201477866866002e-01 1.766970342921256598e-01 3.777940670973845005e-01
++1.179671104159276951e-01 1.792114205608784372e-01 3.846393215051533421e-01
++1.201817230210445731e-01 1.817136143480379551e-01 3.915459113873127617e-01
++1.223722204783651013e-01 1.842136886386882277e-01 3.984598273467554463e-01
++1.245183567208241193e-01 1.866951930885134003e-01 4.054791326498645709e-01
++1.266365389448252943e-01 1.891762365105242871e-01 4.125046892271796994e-01
++1.287143460345438750e-01 1.916485918438771141e-01 4.195883119105888182e-01
++1.307469548160320461e-01 1.941117894471887095e-01 4.267380618771365319e-01
++1.327408430973604225e-01 1.965752427165133320e-01 4.339060811804626439e-01
++1.346828243039070450e-01 1.990323873082787132e-01 4.411366760117488295e-01
++1.365667394636138066e-01 2.014836986376687955e-01 4.484350095699139449e-01
++1.383960163689361422e-01 2.039374403932631141e-01 4.557622019510663702e-01
++1.401636755967774206e-01 2.063944663974329741e-01 4.631231418544201062e-01
++1.418540865672596740e-01 2.088512567417482035e-01 4.705504424282677678e-01
++1.434598643146114128e-01 2.113116730887077965e-01 4.780359058662089766e-01
++1.449764155851626657e-01 2.137823044275377615e-01 4.855569960092488979e-01
++1.463910004146321830e-01 2.162663403203769485e-01 4.931143386027379560e-01
++1.476886377469379952e-01 2.187680022007208458e-01 5.007063827574367298e-01
++1.488517278855215897e-01 2.212928540992544768e-01 5.083284550145572567e-01
++1.498596541692162332e-01 2.238481772327865493e-01 5.159715446979967757e-01
++1.506883975687731414e-01 2.264434023743985280e-01 5.236207927150543506e-01
++1.513102256748371788e-01 2.290905757285599531e-01 5.312536911875026524e-01
++1.516842522456439690e-01 2.318030303219635324e-01 5.388545690381982833e-01
++1.517570170754133085e-01 2.345981922008114062e-01 5.464014367414956608e-01
++1.515076197810979464e-01 2.375036749636269540e-01 5.537960248334482527e-01
++1.508527167578624095e-01 2.405440732043884755e-01 5.610095372512794443e-01
++1.497779955302820376e-01 2.437529689807156341e-01 5.679039092169722025e-01
++1.482412957217069116e-01 2.471597695361844038e-01 5.743778793359424206e-01
++1.462677401356168583e-01 2.507850610764148502e-01 5.802953371129300209e-01
++1.439355627545357286e-01 2.546290083660951442e-01 5.855507465326762473e-01
++1.413540769625598603e-01 2.586695514989866829e-01 5.901033497204623002e-01
++1.386407864858154870e-01 2.628687111034194723e-01 5.939785160116007878e-01
++1.358917366388572578e-01 2.671843825843605580e-01 5.972486725556511722e-01
++1.331956301615234428e-01 2.715742302472205494e-01 6.000063534918327335e-01
++1.305811350178066321e-01 2.760102973743540078e-01 6.023428893290788677e-01
++1.280671927186234904e-01 2.804711462805791200e-01 6.043358297286517411e-01
++1.256919911974779258e-01 2.849349146429925872e-01 6.060559435528747319e-01
++1.234353694092780451e-01 2.893960415099317007e-01 6.075503879105464966e-01
++1.213123684738988406e-01 2.938438245262708359e-01 6.088643085732736715e-01
++1.193314037280503725e-01 2.982710543730990871e-01 6.100344852684282948e-01
++1.174733533629070403e-01 3.026784028742006138e-01 6.110815570440700784e-01
++1.157410513288365805e-01 3.070626658343806881e-01 6.120282423760157187e-01
++1.141526088065836497e-01 3.114180400183615416e-01 6.129002396427197796e-01
++1.126916634208409429e-01 3.157472412451859389e-01 6.137061650582799066e-01
++1.113553786510952659e-01 3.200503527841166984e-01 6.144572065766925606e-01
++1.101437722183151724e-01 3.243271585465217766e-01 6.151637952792941011e-01
++1.090564770800171446e-01 3.285777842283311712e-01 6.158346267162948529e-01
++1.080928143315710299e-01 3.328026048887181565e-01 6.164769721944358682e-01
++1.072518450875257212e-01 3.370021743369620570e-01 6.170969325182951160e-01
++1.065324069530126649e-01 3.411771714425693713e-01 6.176996445247795453e-01
++1.059331395146229648e-01 3.453283595087877078e-01 6.182894491232916456e-01
++1.054525023039967757e-01 3.494565556897754055e-01 6.188700280655170527e-01
++1.050887878891080540e-01 3.535626081054415448e-01 6.194445153697799578e-01
++1.048401320993113395e-01 3.576473788404232468e-01 6.200155882238653771e-01
++1.047045228648097182e-01 3.617117314301156461e-01 6.205855412748909616e-01
++1.046798087267215294e-01 3.657565217601439489e-01 6.211563474636030424e-01
++1.047637077327939481e-01 3.697825915556448573e-01 6.217297079493111500e-01
++1.049538171612311999e-01 3.737907638293131996e-01 6.223070931774267178e-01
++1.052476243004594747e-01 3.777818398051627224e-01 6.228897767433481114e-01
++1.056425183464732021e-01 3.817565969485811617e-01 6.234788633863599383e-01
++1.061358033549051061e-01 3.857157878203879009e-01 6.240753121902191669e-01
++1.067247120960378159e-01 3.896601395393941014e-01 6.246799558608577829e-01
++1.074064206019045564e-01 3.935903536891926513e-01 6.252935167860671495e-01
++1.081780631610760601e-01 3.975071065441324047e-01 6.259166204489629015e-01
++1.090367475038964695e-01 4.014110495195324368e-01 6.265498066600397875e-01
++1.099820192670150909e-01 4.053023125398828030e-01 6.271951607472914247e-01
++1.110081883132479630e-01 4.091820642340333603e-01 6.278512759575444191e-01
++1.121122195896028517e-01 4.130509161123952500e-01 6.285183732165030568e-01
++1.132912658654391114e-01 4.169094262530252948e-01 6.291967191746730137e-01
++1.145425291517750410e-01 4.207581307564207673e-01 6.298865324820219769e-01
++1.158632717089364272e-01 4.245975446528400532e-01 6.305879875238334931e-01
++1.172508261265178542e-01 4.284281627655473490e-01 6.313012175820684746e-01
++1.187026044305651562e-01 4.322504605241775932e-01 6.320263175158151725e-01
++1.202170218035645832e-01 4.360647043028175740e-01 6.327640308933485391e-01
++1.217903323311140817e-01 4.398716102802121553e-01 6.335133964865322653e-01
++1.234201965028123016e-01 4.436716084893622125e-01 6.342743647718233069e-01
++1.251044458168622253e-01 4.474650989352985664e-01 6.350469034989063566e-01
++1.268410231661077081e-01 4.512524653607909442e-01 6.358309517935993860e-01
++1.286279862353579828e-01 4.550340757553759663e-01 6.366264210299322768e-01
++1.304635102569667859e-01 4.588102828035847680e-01 6.374331955697576380e-01
++1.323456332495375476e-01 4.625814799269595823e-01 6.382509181299536039e-01
++1.342726301857550264e-01 4.663480223415985004e-01 6.390792893119938700e-01
++1.362431133778941039e-01 4.701102048314840798e-01 6.399181612927934415e-01
++1.382557801777440920e-01 4.738683163523436659e-01 6.407673303740510917e-01
++1.403094518927116008e-01 4.776226319622609018e-01 6.416265687705522414e-01
++1.424030742552521711e-01 4.813734129303259279e-01 6.424956248215036858e-01
++1.445357177858233311e-01 4.851209067888150872e-01 6.433742231671184530e-01
++1.467060787915918652e-01 4.888654617396300250e-01 6.442615910488664888e-01
++1.489131851676200047e-01 4.926073688646966375e-01 6.451570946472290347e-01
++1.511571091366653297e-01 4.963466938037996434e-01 6.460609578935421204e-01
++1.534374568113274773e-01 5.000836224936368035e-01 6.469728308538383876e-01
++1.557539606313337044e-01 5.038183265492227614e-01 6.478923408808500151e-01
++1.581064802328551455e-01 5.075509629447428894e-01 6.488190927082100323e-01
++1.604950035510952222e-01 5.112816736254882644e-01 6.497526685562985405e-01
++1.629196481906860228e-01 5.150105850470044766e-01 6.506926282565553832e-01
++1.653806563676609720e-01 5.187378093247897448e-01 6.516385018000171447e-01
++1.678770878978581016e-01 5.224637768298545648e-01 6.525882706071722827e-01
++1.704107945748090658e-01 5.261882349061756114e-01 6.535428899563763272e-01
++1.729824594318147002e-01 5.299112360468477556e-01 6.545018545237717422e-01
++1.755929057918094727e-01 5.336328137580849118e-01 6.554646382342502742e-01
++1.782431006664247641e-01 5.373529815601206794e-01 6.564306947203235598e-01
++1.809341585475496006e-01 5.410717318764055594e-01 6.573994578824640111e-01
++1.836673455941881250e-01 5.447890348032889962e-01 6.583703425703313350e-01
++1.864440842101210971e-01 5.485048367520860557e-01 6.593427454071065785e-01
++1.892659579998643982e-01 5.522190589552509188e-01 6.603160457822994100e-01
++1.921347170798090864e-01 5.559315958284012371e-01 6.612896070418273764e-01
++1.950522837092731887e-01 5.596423131801995243e-01 6.622627779079297561e-01
++1.980207581910957138e-01 5.633510462626485360e-01 6.632348941655241692e-01
++2.010424249735310309e-01 5.670575976553166031e-01 6.642052806559789468e-01
++2.041197588637720939e-01 5.707617349784390726e-01 6.651732536238323945e-01
++2.072554312381834074e-01 5.744631884318825987e-01 6.661381234667468343e-01
++2.104523161046616408e-01 5.781616481597345869e-01 6.670991979438091191e-01
++2.137134958380619842e-01 5.818567614439515978e-01 6.680557859020190836e-01
++2.170422663699277943e-01 5.855481297352551628e-01 6.690072015853253395e-01
++2.204421415686979580e-01 5.892353055354571101e-01 6.699527695945174388e-01
++2.239168564955728025e-01 5.929177891529354705e-01 6.708918305694538953e-01
++2.274703691651913662e-01 5.965950253621812305e-01 6.718237476670261277e-01
++2.311068603787596043e-01 6.002664000095238039e-01 6.727479139084245885e-01
++2.348307311320150803e-01 6.039312366204897531e-01 6.736637604671461554e-01
++2.386465970323070063e-01 6.075887930799791503e-01 6.745707659639463838e-01
++2.425592790908820962e-01 6.112382584746600678e-01 6.754684668258670310e-01
++2.465737901908315322e-01 6.148787502077949219e-01 6.763564687525340791e-01
++2.506953164731830497e-01 6.185093115199363778e-01 6.772344593131256474e-01
++2.549296306833234715e-01 6.221293277287609502e-01 6.780979140255732895e-01
++2.592822774336291380e-01 6.257372346725570411e-01 6.789506539234843041e-01
++2.637588638514070660e-01 6.293318265564150638e-01 6.797927409484227912e-01
++2.683650223312705752e-01 6.329118213522958447e-01 6.806243803889014954e-01
++2.731063499524681304e-01 6.364758627686015746e-01 6.814459485792905280e-01
++2.779906740187598757e-01 6.400228375684388071e-01 6.822520389699539001e-01
++2.830218658907085461e-01 6.435508363165360901e-01 6.830490580497422526e-01
++2.882048880496008714e-01 6.470582889109053326e-01 6.838383084593062655e-01
++2.935458083139746988e-01 6.505436502020417455e-01 6.846186591669699562e-01
++2.990503892938236596e-01 6.540052313531840023e-01 6.853899295935115266e-01
++3.047196724248331101e-01 6.574412743642752410e-01 6.861585944188198782e-01
++3.105583191416750322e-01 6.608501423712110912e-01 6.869242652383956704e-01
++3.165691502323280671e-01 6.642301693361829518e-01 6.876887756715628353e-01
++3.227495057337754214e-01 6.675799504508616034e-01 6.884592417367911832e-01
++3.291028263869451576e-01 6.708979305506697077e-01 6.892345854413708395e-01
++3.356230778965553774e-01 6.741831128414313978e-01 6.900227469259155866e-01
++3.423073210907732200e-01 6.774345078849072221e-01 6.908268664523685709e-01
++3.491497562850178760e-01 6.806514618485436374e-01 6.916515776970183493e-01
++3.561412724149042863e-01 6.838337923407922236e-01 6.925029303903535993e-01
++3.632736859780383298e-01 6.869814453814443445e-01 6.933849146347551562e-01
++3.705348353526126681e-01 6.900949744532235419e-01 6.943034006383217438e-01
++3.779122643387600178e-01 6.931752240960002975e-01 6.952632699407041983e-01
++3.853938489959773395e-01 6.962232375904670034e-01 6.962682692318554745e-01
++3.929633165309669440e-01 6.992408157519413026e-01 6.973239952904880523e-01
++4.006094014150666793e-01 7.022293785228771457e-01 6.984322280579721154e-01
++4.083159356621580693e-01 7.051912169731731073e-01 6.995972410351208870e-01
++4.160701459275524816e-01 7.081283984755933902e-01 7.008208963157127602e-01
++4.238620058191452378e-01 7.110427636723841704e-01 7.021034222566255867e-01
++4.316725578542053299e-01 7.139377080072604187e-01 7.034496090272048807e-01
++4.394994714751406240e-01 7.168142170649683953e-01 7.048555730206492731e-01
++4.473284906527433269e-01 7.196752689920701274e-01 7.063236640655090604e-01
++4.551495147015194864e-01 7.225233370762427221e-01 7.078541344797719681e-01
++4.629611457318438261e-01 7.253594732048370686e-01 7.094433480260243785e-01
++4.707534852399093972e-01 7.281862590349524877e-01 7.110918876863899785e-01
++4.785169352473264692e-01 7.310063519486531547e-01 7.128002486509635860e-01
++4.862541175206331334e-01 7.338201861642941193e-01 7.145637643240034809e-01
++4.939610178122765816e-01 7.366294113512334985e-01 7.163810048013540266e-01
++5.016310591672418218e-01 7.394362226143922356e-01 7.182517850494093414e-01
++5.092596479997313352e-01 7.422424836790947333e-01 7.201752147893440981e-01
++5.168502920324100636e-01 7.450484101459822206e-01 7.221473089909000720e-01
++5.244013381888714687e-01 7.478552285559243451e-01 7.241664310755349110e-01
++5.319115488689606375e-01 7.506640750099188297e-01 7.262309445597783242e-01
++5.393800515498496928e-01 7.534759997433319034e-01 7.283392250016084146e-01
++5.468044438041703703e-01 7.562923850920999502e-01 7.304903735115424457e-01
++5.541839357415714318e-01 7.591142604468823496e-01 7.326829886087474764e-01
++5.615214997302344635e-01 7.619417788590748808e-01 7.349143832677361710e-01
++5.688172658612942190e-01 7.647756983657992835e-01 7.371830791535139982e-01
++5.760715228891868378e-01 7.676167208435804579e-01 7.394876421854478243e-01
++5.832846906737159109e-01 7.704654971547720832e-01 7.418266842236616032e-01
++5.904572957555410673e-01 7.733226320830066669e-01 7.441988638633715292e-01
++5.975899498408560051e-01 7.761886890212207346e-01 7.466028864742004778e-01
++6.046833309596043593e-01 7.790641943891402077e-01 7.490375036038013912e-01
++6.117381670592270115e-01 7.819496417678519773e-01 7.515015118481881418e-01
++6.187552218007135174e-01 7.848454957475322624e-01 7.539937512752844517e-01
++6.257352823331345792e-01 7.877521954909707524e-01 7.565131034734732252e-01
++6.326791488358145532e-01 7.906701580203755464e-01 7.590584892833606157e-01
++6.395876256322543529e-01 7.935997812385013894e-01 7.616288662585695146e-01
++6.464615136961924247e-01 7.965414466975205832e-01 7.642232258900538699e-01
++6.533016043869401823e-01 7.994955221304983484e-01 7.668405906180205678e-01
++6.601086742679306285e-01 8.024623637610888149e-01 7.694800106460160105e-01
++6.668834808789664281e-01 8.054423184071207720e-01 7.721405605628438584e-01
++6.736267593487160754e-01 8.084357253933542875e-01 7.748213357696444037e-01
++6.803392197495884419e-01 8.114429182878516444e-01 7.775214487015286169e-01
++6.870215451120499361e-01 8.144642264752101068e-01 7.802400248254467430e-01
++6.936743900300211818e-01 8.174999765783720340e-01 7.829761983884004906e-01
++7.002974950415432609e-01 8.205507454139520096e-01 7.857294359175189813e-01
++7.068916498938800919e-01 8.236168074562510988e-01 7.884988108515800231e-01
++7.134582338528936418e-01 8.266982574818713125e-01 7.912831565844938853e-01
++7.199978016303433259e-01 8.297954164160811219e-01 7.940815874530331442e-01
++7.265108777000938156e-01 8.329086081072485381e-01 7.968932005645313899e-01
++7.329979578454549616e-01 8.360381599792610086e-01 7.997170690214260302e-01
++7.394595112267420278e-01 8.391844035374615984e-01 8.025522344938926800e-01
++7.458959830242087863e-01 8.423476747120355324e-01 8.053976990501692246e-01
++7.523077977331221744e-01 8.455283140156318877e-01 8.082524161470656665e-01
++7.586951667693938584e-01 8.487267253083131680e-01 8.111153620935316333e-01
++7.650577483984875027e-01 8.519434804026106978e-01 8.139856782226038145e-01
++7.713970926011407547e-01 8.551785852225586293e-01 8.168616329686009259e-01
++7.777135915287802792e-01 8.584323939893921951e-01 8.197418712821458175e-01
++7.840076454752769042e-01 8.617052627327101977e-01 8.226249282969148036e-01
++7.902796732960170045e-01 8.649975472537146937e-01 8.255092131742095551e-01
++7.965301248451132077e-01 8.683096003971411125e-01 8.283929915814087774e-01
++8.027594957590121760e-01 8.716417684881572203e-01 8.312743668855639978e-01
++8.089680559912207913e-01 8.749944751017242339e-01 8.341514052269850543e-01
++8.151567019468018982e-01 8.783679611555336164e-01 8.370217075803022544e-01
++8.213264334358614249e-01 8.817624446744987132e-01 8.398826380716230000e-01
++8.274781243204414327e-01 8.851781910186152791e-01 8.427314427493727278e-01
++8.336128134834004388e-01 8.886154231077250110e-01 8.455651044543932571e-01
++8.397317396975054749e-01 8.920743090766621863e-01 8.483803273271105505e-01
++8.458363795503203164e-01 8.955549480225133419e-01 8.511735264537213519e-01
++8.519285410708211659e-01 8.990573377468378258e-01 8.539407899678711500e-01
++8.580104271310651232e-01 9.025813506938162867e-01 8.566778627755414766e-01
++8.640844411003687497e-01 9.061267859275130565e-01 8.593803204948170515e-01
++8.701533853242351402e-01 9.096933004913555498e-01 8.620435066748899366e-01
++8.762204735799774546e-01 9.132803958502141439e-01 8.646625969293003644e-01
++8.822893382459134903e-01 9.168874047650978909e-01 8.672326784644417419e-01
++8.883640160698558219e-01 9.205134840158590848e-01 8.697488518860556628e-01
++8.944490897569347121e-01 9.241575627749747390e-01 8.722061884634622064e-01
++9.005494862654843669e-01 9.278183935417740891e-01 8.745999527261957285e-01
++9.066697518672085510e-01 9.314947526919318266e-01 8.769263428234910229e-01
++9.128147816848455331e-01 9.351852279261616552e-01 8.791818556054207257e-01
++9.189893388971293042e-01 9.388883614412766310e-01 8.813636793355511534e-01
++9.251978653035416444e-01 9.426027146413026303e-01 8.834697874077058755e-01
++9.314442876100802460e-01 9.463269403919151168e-01 8.854989876415102490e-01
++9.377318363007438595e-01 9.500598571817585603e-01 8.874509187201842231e-01
++9.440634086681402026e-01 9.538003778631106711e-01 8.893253867710815275e-01
++9.504401533195278029e-01 9.575479274112385086e-01 8.911237616446540111e-01
++9.568622268534309194e-01 9.613022612892393459e-01 8.928479377657454474e-01
++9.633289971376283178e-01 9.650634347497447640e-01 8.944999044139121391e-01
++9.698388693863758681e-01 9.688318688917866295e-01 8.960818313086871267e-01
++9.763893802744164629e-01 9.726083363283349881e-01 8.975959074248138769e-01
++9.829773205072419584e-01 9.763939321161484441e-01 8.990442065973827113e-01
++9.895988716426143972e-01 9.801900344288262401e-01 9.004285886132605832e-01
++9.962497442478134291e-01 9.839982596313375796e-01 9.017506391251587372e-01
++9.996253193176977137e-01 9.913711226010460953e-01 8.041012438578545307e-01
++9.969312990878144154e-01 9.865865913107011442e-01 7.958196545688069889e-01
++9.942533588637104680e-01 9.818135789307643746e-01 7.875317815897165952e-01
++9.915896776086415842e-01 9.770525904709529419e-01 7.792374356109948996e-01
++9.889384786221749879e-01 9.723041153469224041e-01 7.709364896057565586e-01
++9.862980251266783016e-01 9.675686302753326862e-01 7.626288656679628408e-01
++9.836666169060123144e-01 9.628466015967408476e-01 7.543145233681930462e-01
++9.810425876106124710e-01 9.581384871880828102e-01 7.459934495167190871e-01
++9.784237290846492519e-01 9.534448589527805273e-01 7.376670490866494845e-01
++9.758091741853186507e-01 9.487660072025493330e-01 7.293335612360094533e-01
++9.731976797213667263e-01 9.441023023821585314e-01 7.209921595340745837e-01
++9.705876565172376624e-01 9.394541905537218129e-01 7.126429103405369503e-01
++9.679775344953384097e-01 9.348221172710475813e-01 7.042858810456844587e-01
++9.653657609756586266e-01 9.302065285603877687e-01 6.959211353452218196e-01
++9.627508763245108403e-01 9.256078555762781157e-01 6.875485248304887831e-01
++9.601317913231469658e-01 9.210264571207541495e-01 6.791669211618720503e-01
++9.575068348330096901e-01 9.164628209777989643e-01 6.707767168399573210e-01
++9.548744491996995487e-01 9.119174176425877132e-01 6.623780173986024700e-01
++9.522330808045905703e-01 9.073907239128325974e-01 6.539709177027834830e-01
++9.495811770290348841e-01 9.028832240271246201e-01 6.455555018977681137e-01
++9.469171829214290126e-01 8.983954108674836458e-01 6.371318441574638225e-01
++9.442402190659517913e-01 8.939276490907958062e-01 6.286979645113369708e-01
++9.415486437855169477e-01 8.894804711503382366e-01 6.202539985663386712e-01
++9.388403761261178149e-01 8.850545069722992597e-01 6.118014161078325630e-01
++9.361137658947894513e-01 8.806503085987659185e-01 6.033403762527677072e-01
++9.333671427931780062e-01 8.762684428171652051e-01 5.948710444843188228e-01
++9.305988122871574619e-01 8.719094924143574454e-01 5.863935979844183688e-01
++9.278070514355759579e-01 8.675740573997056115e-01 5.779082318269497254e-01
++9.249901047433721768e-01 8.632627561697012730e-01 5.694151660419812799e-01
++9.221469800733509414e-01 8.589760860685742294e-01 5.609116482547054083e-01
++9.192753048560652340e-01 8.547148108589553983e-01 5.523997440377725887e-01
++9.163728560349155838e-01 8.504796735679325259e-01 5.438810466983201586e-01
++9.134376867190158178e-01 8.462713800742609482e-01 5.353560484875481418e-01
++9.104678046010745707e-01 8.420906570028113824e-01 5.268253096213930675e-01
++9.074611700430375016e-01 8.379382516634488187e-01 5.182894693241438810e-01
++9.044156948810763152e-01 8.338149316350844664e-01 5.097492574011085464e-01
++9.013292420875533839e-01 8.297214839374013051e-01 5.012055062134753713e-01
++8.981996264328737656e-01 8.256587137313211588e-01 4.926591628979440363e-01
++8.950246162923013449e-01 8.216274424893472705e-01 4.841113016411668357e-01
++8.918019367410795484e-01 8.176285055788921063e-01 4.755631357855747976e-01
++8.885292740744069606e-01 8.136627492060259925e-01 4.670160295098501613e-01
++8.852042818763621312e-01 8.097310266740884721e-01 4.584715087957387802e-01
++8.818245887426444662e-01 8.058341939216442373e-01 4.499312713647861117e-01
++8.783878077356160885e-01 8.019731043176190344e-01 4.413971952459587733e-01
++8.748915476159051519e-01 7.981486027081815537e-01 4.328713456201330745e-01
++8.713334258529761289e-01 7.943615187300834268e-01 4.243559795823733105e-01
++8.677110833677242896e-01 7.906126594284177411e-01 4.158535484698712703e-01
++8.640222009043423412e-01 7.869028012426558805e-01 4.073666974243692063e-01
++8.602645168678531018e-01 7.832326814525909509e-01 3.988982618942717440e-01
++8.564358463998196225e-01 7.796029892044549214e-01 3.904512608343593816e-01
++8.525341014005127782e-01 7.760143562656642846e-01 3.820288864300384613e-01
++8.485573111443696082e-01 7.724673476829161389e-01 3.736344902575098326e-01
++8.445036430802366212e-01 7.689624525410815314e-01 3.652715658890242079e-01
++8.403714233625397823e-01 7.655000750378188057e-01 3.569437280604416673e-01
++8.361591566273345322e-01 7.620805260995172636e-01 3.486546886323707573e-01
++8.318655445115968883e-01 7.587040157667198637e-01 3.404082296912668837e-01
++8.274895024172935765e-01 7.553706465705579687e-01 3.322081742472747790e-01
++8.230301740454328829e-01 7.520804081054507373e-01 3.240583550855133943e-01
++8.184868212302832680e-01 7.488332616294635091e-01 3.159617825674137515e-01
++8.138590110822148116e-01 7.456289896604103573e-01 3.079221377655331771e-01
++8.091468181242912339e-01 7.424670871619818424e-01 2.999443469091602199e-01
++8.043504122379883103e-01 7.393470563716729727e-01 2.920319686576324791e-01
++7.994702184716161453e-01 7.362682828578653860e-01 2.841884012704181672e-01
++7.945069109411802000e-01 7.332300399833050486e-01 2.764168555307422448e-01
++7.894614033518293494e-01 7.302314948629916591e-01 2.687203309843908539e-01
++7.843348364120679150e-01 7.272717156577747089e-01 2.611015959667907227e-01
++7.791285260147496894e-01 7.243496994364320152e-01 2.535630684860531447e-01
++7.738440801480908071e-01 7.214643092911102729e-01 2.461071963221510561e-01
++7.684833208817296590e-01 7.186143199358207001e-01 2.387362039122769009e-01
++7.630481315977482026e-01 7.157984953860191402e-01 2.314517734491695622e-01
++7.575405230514773436e-01 7.130155515836559266e-01 2.242553190375982108e-01
++7.519626112766101267e-01 7.102641669372077304e-01 2.171479941172158035e-01
++7.463165956980535309e-01 7.075429925763011552e-01 2.101307026608347228e-01
++7.406047378440419049e-01 7.048506621488696000e-01 2.032041138079452858e-01
++7.348297350913484127e-01 7.021856197788983733e-01 1.963692968886621149e-01
++7.289936844492124202e-01 6.995466025992004289e-01 1.896260481458106884e-01
++7.230988483362374986e-01 6.969322773880018973e-01 1.829743149302962002e-01
++7.171475322086006132e-01 6.943412998823550453e-01 1.764139943240976283e-01
++7.111420143928013360e-01 6.917723467781027313e-01 1.699448658068684892e-01
++7.050845338608371371e-01 6.892241206236302542e-01 1.635666199792324693e-01
++6.989772797030316953e-01 6.866953538838792559e-01 1.572788888364401172e-01
++6.928223822517928232e-01 6.841848122132092591e-01 1.510812776309110872e-01
++6.866220524799201419e-01 6.816912363109779438e-01 1.449735254345622115e-01
++6.803786701652846380e-01 6.792133090629258740e-01 1.389555620195359609e-01
++6.740936196655853418e-01 6.767501306945983286e-01 1.330266252977832520e-01
++6.677687244983904202e-01 6.743006234739316040e-01 1.271865644636745452e-01
++6.614057275351008514e-01 6.718637487365417549e-01 1.214353970802317662e-01
++6.550062900453353931e-01 6.694385066322930955e-01 1.157733573283348805e-01
++6.485719915801509972e-01 6.670239355272904458e-01 1.102009495253571669e-01
++6.421043305819508218e-01 6.646191111168818777e-01 1.047190080781650323e-01
++6.356047256163376291e-01 6.622231453008022850e-01 9.932876523540395963e-02
++6.290745171295046845e-01 6.598351848668921882e-01 9.403192821288078318e-02
++6.225149696438274649e-01 6.574544100249212208e-01 8.883076747185855715e-02
++6.159272743135092432e-01 6.550800328272597950e-01 8.372821811088401733e-02
++6.093126663293514378e-01 6.527112545185101977e-01 7.872799706657532259e-02
++6.026723170612737768e-01 6.503473055396404856e-01 7.383469856963406630e-02
++5.960069280976730832e-01 6.479875866853281874e-01 6.905400752442764079e-02
++5.893174254692321590e-01 6.456314203776034599e-01 6.439287527349069062e-02
++5.826046784844106652e-01 6.432781520370909334e-01 5.985968924725062340e-02
++5.758695032242261425e-01 6.409271483905801814e-01 5.546448455059219823e-02
++5.691126660872921628e-01 6.385777958070207871e-01 5.121916775709036557e-02
++5.623348873683923221e-01 6.362294986703330713e-01 4.713774156788400754e-02
++5.555368448583254404e-01 6.338816777957024806e-01 4.323651096469569716e-02
++5.487191774565705060e-01 6.315337688945173999e-01 3.952487864258176498e-02
++5.418824887917018662e-01 6.291852210919098853e-01 3.612051121019213551e-02
++5.350273508472259687e-01 6.268354954999130202e-01 3.311399967360150604e-02
++5.281543075929241438e-01 6.244840638484698836e-01 3.049096132752013993e-02
++5.212638786236020172e-01 6.221304071760309640e-01 2.823775650583685778e-02
++5.143565628087404251e-01 6.197740145810481938e-01 2.634144880489198981e-02
++5.074328419576341620e-01 6.174143820354919265e-01 2.478976657062584646e-02
++5.004931845054064743e-01 6.150510112614009373e-01 2.357106560875196072e-02
++4.935380492257968599e-01 6.126834086714986194e-01 2.267429306479169446e-02
++4.865677337149327264e-01 6.103111278318402722e-01 2.208918519158591109e-02
++4.795827833081557912e-01 6.079336535225863258e-01 2.180564619063158835e-02
++4.725836555273193462e-01 6.055504983495709759e-01 2.181419194008693205e-02
++4.655708088649732068e-01 6.031611773523495312e-01 2.210580170001537684e-02
++4.585447116306416437e-01 6.007652058968021569e-01 2.267187969798983502e-02
++4.515058459835388782e-01 5.983620990282547680e-01 2.350422445657735990e-02
++4.444547120266517104e-01 5.959513709030562767e-01 2.459499875403014374e-02
++4.373918319618326778e-01 5.935325343022211930e-01 2.593670014651517156e-02
++4.303177543037495223e-01 5.911051002310937497e-01 2.752213198538535840e-02
++4.232330581488202292e-01 5.886685776092354105e-01 2.934437486930205341e-02
++4.161383574931313278e-01 5.862224730549979723e-01 3.139675847884770832e-02
++4.090343055913983616e-01 5.837662907693373926e-01 3.367283375013734037e-02
++4.019215993467592507e-01 5.812995325235387201e-01 3.616634535426579283e-02
++3.948009837190709082e-01 5.788216977554323517e-01 3.887120446073646235e-02
++3.876732561372571162e-01 5.763322837785355146e-01 4.174672181203834681e-02
++3.805386564470196742e-01 5.738309171411589693e-01 4.468566878513501733e-02
++3.733986391498164137e-01 5.713169711328536238e-01 4.768049787246867594e-02
++3.662542351622480874e-01 5.687899279044026368e-01 5.071835758395210753e-02
++3.591065040473656045e-01 5.662492786415918022e-01 5.378828392041421630e-02
++3.519565800474088735e-01 5.636945152858550134e-01 5.688085721725138350e-02
++3.448056760545124555e-01 5.611251315161035480e-01 5.998797256299469999e-02
++3.376550874229136134e-01 5.585406238589376571e-01 6.310263770132876204e-02
++3.305061956006355439e-01 5.559404929241524851e-01 6.621879773242350664e-02
++3.233604715607960034e-01 5.533242447607230607e-01 6.933118466356372189e-02
++3.162194790161148017e-01 5.506913923265978061e-01 7.243518928216058361e-02
++3.090846039651472532e-01 5.480415027343880086e-01 7.552721746757809496e-02
++3.019574288899705139e-01 5.453741321890830385e-01 7.860394456462099777e-02
++2.948403194287022577e-01 5.426887379559618418e-01 8.166128713902018332e-02
++2.877352499045566225e-01 5.399848761881764769e-01 8.469633286585029341e-02
++2.806442994214729536e-01 5.372621189537871711e-01 8.770643445761908130e-02
++2.735696535538801322e-01 5.345200561570193631e-01 9.068916512095565041e-02
++2.665136059049172390e-01 5.317582974656462902e-01 9.364228167891575083e-02
++2.594785595977833204e-01 5.289764742223507232e-01 9.656369418956520234e-02
++2.524670287821700332e-01 5.261742413169625543e-01 9.945144107016240520e-02
++2.454813557062531792e-01 5.233513142453691813e-01 1.023041162767710510e-01
++2.385245828710040317e-01 5.205073603004944927e-01 1.051194831525161522e-01
++2.315996737216303170e-01 5.176421037021866622e-01 1.078956959800008442e-01
++2.247096070811669399e-01 5.147553123030387257e-01 1.106311405318080310e-01
++2.178574824667257048e-01 5.118467857547527311e-01 1.133242655958566492e-01
++2.110465244393363582e-01 5.089163566221597268e-01 1.159735773093806543e-01
++2.042800881777394606e-01 5.059638913007615812e-01 1.185776351459725819e-01
++1.975616665475327660e-01 5.029892907239723598e-01 1.211350492651094846e-01
++1.908950317685597087e-01 4.999924798399172921e-01 1.236442618572499708e-01
++1.842839642352289697e-01 4.969734333710090213e-01 1.261039978961912833e-01
++1.777324020667393756e-01 4.939321620495928378e-01 1.285130506256617899e-01
++1.712444848635372441e-01 4.908687102327232155e-01 1.308702368677320538e-01
++1.648245567449286297e-01 4.877831568788963401e-01 1.331744245804179216e-01
++1.584771896665797541e-01 4.846756148389082530e-01 1.354245338303780855e-01
++1.522072108246106115e-01 4.815462299379932865e-01 1.376195378692431359e-01
++1.460197345452351747e-01 4.783951798632230523e-01 1.397584642177332193e-01
++1.399204939260773328e-01 4.752226638142488802e-01 1.418397751955981501e-01
++1.339151022806790436e-01 4.720289313790105301e-01 1.438629155677119409e-01
++1.280096392738992173e-01 4.688142535267130762e-01 1.458273227721058329e-01
++1.222107627052576584e-01 4.655789223639808516e-01 1.477322650340249788e-01
++1.165256528622910237e-01 4.623232537320298152e-01 1.495770677617926092e-01
++1.109620746853187123e-01 4.590475853271560047e-01 1.513611132825743999e-01
++1.055284430115649430e-01 4.557522747771929894e-01 1.530838402977779955e-01
++1.002338888313226428e-01 4.524376976954341267e-01 1.547447430577089666e-01
++9.508832342249537439e-02 4.491042457325262194e-01 1.563433702619193288e-01
++9.010250937510871916e-02 4.457523324675090604e-01 1.578790892676192326e-01
++8.528801833375249108e-02 4.423823989146767888e-01 1.593510674113139958e-01
++8.065727940861416867e-02 4.389948528858526600e-01 1.607597457256386420e-01
++7.622371216564308161e-02 4.355901307746828932e-01 1.621048834368656322e-01
++7.200158271604989446e-02 4.321686757028083692e-01 1.633862841279137557e-01
++6.800589086138220107e-02 4.287309359317861834e-01 1.646037933778843332e-01
++6.425218103335716968e-02 4.252773633715483670e-01 1.657572962977645059e-01
++6.075626148835750612e-02 4.218084121914437157e-01 1.668467149892300661e-01
++5.753381975108700502e-02 4.183245375382101949e-01 1.678720059529140995e-01
++5.459992971435845971e-02 4.148261943636451510e-01 1.688331574715942474e-01
++5.196845773512390881e-02 4.113138363632788397e-01 1.697301869925023354e-01
++4.965139124510086627e-02 4.077879150260529384e-01 1.705631385315065085e-01
++4.765813208284918473e-02 4.042488787938245398e-01 1.713320801202671551e-01
++4.599481449154869256e-02 4.006971723285012166e-01 1.720371013157572515e-01
++4.466371969486728627e-02 3.971332358837184051e-01 1.726783107897287561e-01
++4.366274483561478209e-02 3.935575133766276990e-01 1.732557671739120286e-01
++4.298497468310508857e-02 3.899704687794856572e-01 1.737693705957654433e-01
++4.262017645185838671e-02 3.863724827023667929e-01 1.742196255705478480e-01
++4.255352467768171859e-02 3.827639728113220174e-01 1.746066936456434071e-01
++4.276673184831410873e-02 3.791453506945430818e-01 1.749307448926006592e-01
++4.323878239983177524e-02 3.755170217599948512e-01 1.751919563188165385e-01
++4.394675081101364483e-02 3.718793851987791665e-01 1.753905104335057585e-01
++4.486662442701292580e-02 3.682328340080037177e-01 1.755265939730583369e-01
++4.597406436707644067e-02 3.645777550668193867e-01 1.756003967899375517e-01
++4.724505801823831314e-02 3.609145292591857124e-01 1.756121109084000098e-01
++4.865643856140024898e-02 3.572435316368365310e-01 1.755619297495205344e-01
++5.018626632042253594e-02 3.535651316158259783e-01 1.754500475272437465e-01
++5.181408104443557122e-02 3.498796931999255677e-01 1.752766588164567374e-01
++5.352104295989750654e-02 3.461875752240315962e-01 1.750419582933170903e-01
++5.528998425553303259e-02 3.424891316106106198e-01 1.747461406473147794e-01
++5.710539287663336100e-02 3.387847116320403806e-01 1.743894006636908245e-01
++5.895334846203271334e-02 3.350746601715560713e-01 1.739719334739151524e-01
++6.082142709649813322e-02 3.313593179753057116e-01 1.734939349708606859e-01
++6.269858808390260663e-02 3.276390218878380001e-01 1.729556023841174184e-01
++6.457505267241087088e-02 3.239141050631572094e-01 1.723571350094970367e-01
++6.644218183629055363e-02 3.201848971432968427e-01 1.716987350852014205e-01
++6.829235792686130790e-02 3.164517243962254311e-01 1.709806088053268391e-01
++7.011887323479765177e-02 3.127149098048046527e-01 1.702029674593475428e-01
++7.191582719453681882e-02 3.089747730984767071e-01 1.693660286839586415e-01
++7.367740139700959534e-02 3.052317018390342529e-01 1.684698187582648887e-01
++7.539908659075802988e-02 3.014860094828903936e-01 1.675145933863426417e-01
++7.707730571895973770e-02 2.977379606831319081e-01 1.665007348086736949e-01
++7.870852955781817983e-02 2.939878648964006636e-01 1.654284970811750188e-01
++8.028965953863020921e-02 2.902360278178472974e-01 1.642981478645798299e-01
++8.181797774419891089e-02 2.864827509313960796e-01 1.631099700093367744e-01
++8.329110360766753263e-02 2.827283309501391617e-01 1.618642630930951787e-01
++8.470695659424687385e-02 2.789730591425138573e-01 1.605613448745624727e-01
++8.606372418387428502e-02 2.752172205414125661e-01 1.592015526248838075e-01
++8.735983452008261319e-02 2.714610930351273321e-01 1.577852442954886525e-01
++8.859393314120664331e-02 2.677049463410028363e-01 1.563127994796906506e-01
++8.976486326081492551e-02 2.639490408648579312e-01 1.547846201243904263e-01
++9.087164911293293956e-02 2.601936264515474218e-01 1.532011309481255412e-01
++9.191348192284298779e-02 2.564389410344570241e-01 1.515627795225681362e-01
++9.288704312629730842e-02 2.526856315239155992e-01 1.498693699931691048e-01
++9.379283018859288501e-02 2.489337717503207204e-01 1.481216905842226428e-01
++9.463163644057562274e-02 2.451833792964967507e-01 1.463205652098015508e-01
++9.540318566942779244e-02 2.414346401225993533e-01 1.444665315338557743e-01
++9.610732643393554708e-02 2.376877206774311024e-01 1.425601463139360425e-01
++9.674402718144511915e-02 2.339427661170380146e-01 1.406019829499289553e-01
++9.731337192794831115e-02 2.301998985206034631e-01 1.385926284969124511e-01
++9.781527030012060475e-02 2.264592671684997338e-01 1.365326231802845014e-01
++9.824358966693200190e-02 2.227221381992704474e-01 1.344213498047777955e-01
++9.860476008591259611e-02 2.189874851640599696e-01 1.322606854144605382e-01
++9.889926458171927059e-02 2.152553323101172311e-01 1.300512525669721697e-01
++9.912768720083675600e-02 2.115256719866073221e-01 1.277936680974917916e-01
++9.929070945217863264e-02 2.077984630697710111e-01 1.254885372707029156e-01
++9.938536693535210409e-02 2.040743841747782450e-01 1.231359093599569132e-01
++9.940987528000957973e-02 2.003539028956775048e-01 1.207361104943659447e-01
++9.937074432198822471e-02 1.966357733029605592e-01 1.182905659078862248e-01
++9.926899950314096999e-02 1.929198155529378012e-01 1.157998086675786908e-01
++9.910574746809375224e-02 1.892058087816931022e-01 1.132643300609986470e-01
++9.887273365069987330e-02 1.854955476839638961e-01 1.106837415179452166e-01
++9.857702759168757156e-02 1.817875303344013982e-01 1.080592207487474365e-01
++9.822269753736714848e-02 1.780808239249605796e-01 1.053914161709541830e-01
++9.781113633355650872e-02 1.743750377566490040e-01 1.026806351620476176e-01
++9.733238005935909709e-02 1.706723687329834982e-01 9.992670564763897478e-02
++9.679537330416121410e-02 1.669706979907544520e-01 9.713043093317094701e-02
++9.620476860769888727e-02 1.632687911401897729e-01 9.429209466525781402e-02
++9.555840111219859878e-02 1.595669718044100127e-01 9.141177435708905397e-02
++9.484851695793727888e-02 1.558669291806107915e-01 8.848983773912671991e-02
++9.408911153954402362e-02 1.521650578561620781e-01 8.552628708305054506e-02
++9.328192094338655371e-02 1.484606091474970080e-01 8.252094903627574252e-02
++9.241015243151923242e-02 1.447574737795673805e-01 7.947496936453349314e-02
++9.149313879389489590e-02 1.410504572025015335e-01 7.638732537156053826e-02
++9.053276383981978537e-02 1.373386075843833487e-01 7.325761429945673586e-02];
++
++   case 'cur'
++      RGB = [8.225559928700268419e-02 1.149244079727295142e-01 2.647901677800857390e-01
++8.312616532498406929e-02 1.190383729463048712e-01 2.668628892216621806e-01
++8.400180885962132971e-02 1.231074880892656653e-01 2.689526699064171411e-01
++8.487294239495335457e-02 1.271387529060027943e-01 2.710541708402016137e-01
++8.574385298640457842e-02 1.311333174761502018e-01 2.731691209373900975e-01
++8.661249189260347703e-02 1.350944971238551839e-01 2.752961432065319514e-01
++8.747533041314431435e-02 1.390258052165279645e-01 2.774332852121961235e-01
++8.833858505105957049e-02 1.429270910011002649e-01 2.795831537842536352e-01
++8.919012906146844832e-02 1.468043594975814992e-01 2.817400195447572475e-01
++9.004099984169053328e-02 1.506555099870153513e-01 2.839086654207542693e-01
++9.088231952195491292e-02 1.544850037627045203e-01 2.860850125083750362e-01
++9.171714479257989105e-02 1.582931942356169963e-01 2.882702798507874586e-01
++9.254607948203208423e-02 1.620811665705463311e-01 2.904645825457518593e-01
++9.336173420340779239e-02 1.658523274558137695e-01 2.926648040593683997e-01
++9.417284157369981701e-02 1.696050767223750977e-01 2.948744162588470830e-01
++9.496899572502048859e-02 1.733434725855039771e-01 2.970892156823352059e-01
++9.575619444438937533e-02 1.770666290075273708e-01 2.993115284087380368e-01
++9.653316478613682694e-02 1.807757562460599599e-01 3.015407883893915231e-01
++9.729328810023782359e-02 1.844734436312414905e-01 3.037745103921251633e-01
++9.804493118338306057e-02 1.881580898967480098e-01 3.060157402408537064e-01
++9.877832247043097369e-02 1.918329889556127654e-01 3.082609202522414993e-01
++9.949803783218733044e-02 1.954975058870322413e-01 3.105116763778897337e-01
++1.002054858430543316e-01 1.991518634625495388e-01 3.127684262427183892e-01
++1.008900241588315538e-01 2.027992883367119026e-01 3.150275553737127421e-01
++1.015620277820400430e-01 2.064376400065636719e-01 3.172925125709148420e-01
++1.022150454689789434e-01 2.100689913462399083e-01 3.195611195376787395e-01
++1.028468845169810686e-01 2.136942776676366007e-01 3.218326666201724029e-01
++1.034637486817424901e-01 2.173124203806320875e-01 3.241090419310820314e-01
++1.040556247342821483e-01 2.209261472703716311e-01 3.263871052200472134e-01
++1.046272664909374817e-01 2.245346804307608024e-01 3.286682704446855507e-01
++1.051814556007013568e-01 2.281377376539149293e-01 3.309532535866355762e-01
++1.057055066316897329e-01 2.317384538919968207e-01 3.332383062494437276e-01
++1.062093640276061124e-01 2.353348932541681759e-01 3.355262248019345583e-01
++1.066927192498384747e-01 2.389274243968986799e-01 3.378167764830257158e-01
++1.071428862568302165e-01 2.425189920877232619e-01 3.401063918909076889e-01
++1.075713140889580088e-01 2.461073946949010050e-01 3.423980926413837667e-01
++1.079763885418836000e-01 2.496932209057829977e-01 3.446912766824791197e-01
++1.083460004297124302e-01 2.532791299120676354e-01 3.469826761312421182e-01
++1.086913329090623825e-01 2.568630402753477870e-01 3.492750549670107785e-01
++1.090116287119651528e-01 2.604453159192556266e-01 3.515680214913912693e-01
++1.092932808921200649e-01 2.640287615628073015e-01 3.538580573547516761e-01
++1.095478763802813504e-01 2.676112773022403801e-01 3.561478615212890775e-01
++1.097748910210358808e-01 2.711931376089152246e-01 3.584370856671010852e-01
++1.099635342633853707e-01 2.747764822051754763e-01 3.607229892872333421e-01
++1.101198294511886444e-01 2.783603021914852760e-01 3.630068099573608986e-01
++1.102460152182262176e-01 2.819443225282238785e-01 3.652888319764409086e-01
++1.103361572207214036e-01 2.855297163446686715e-01 3.675674754730824945e-01
++1.103867349279119559e-01 2.891171759115234718e-01 3.698417464033080804e-01
++1.104047114339987423e-01 2.927055780381122019e-01 3.721129484539063559e-01
++1.103893448894039397e-01 2.962951553198432397e-01 3.743806401368951486e-01
++1.103290785873510815e-01 2.998879083652261635e-01 3.766420819050353419e-01
++1.102317288825286901e-01 3.034825829921489193e-01 3.788986922133656954e-01
++1.100986315611906241e-01 3.070790351009552999e-01 3.811504545068737926e-01
++1.099286556573810802e-01 3.106775192369479188e-01 3.833968205472055302e-01
++1.097092559883022234e-01 3.142800415550652815e-01 3.856349205402823110e-01
++1.094518269158459012e-01 3.178848431435130073e-01 3.878667847148202785e-01
++1.091556968975302966e-01 3.214920812428978536e-01 3.900919340676701208e-01
++1.088202096165073185e-01 3.251019032868823211e-01 3.923098843692563453e-01
++1.084337294201929702e-01 3.287160421828903556e-01 3.945179917556369542e-01
++1.080052802278752000e-01 3.323331728550899533e-01 3.967176863054378000e-01
++1.075355258379605550e-01 3.359532282299735328e-01 3.989087127976621017e-01
++1.070239159802940931e-01 3.395763147211236510e-01 4.010905648833596460e-01
++1.064666158592602885e-01 3.432029795356145718e-01 4.032620996037361571e-01
++1.058582376509708545e-01 3.468339423292918222e-01 4.054218838433404359e-01
++1.052065591856250482e-01 3.504681464569319171e-01 4.075709632165070984e-01
++1.045112201334900126e-01 3.541056562885774861e-01 4.097088092956981398e-01
++1.037719209811681642e-01 3.577465259466254266e-01 4.118348877541359032e-01
++1.029884320307208612e-01 3.613907991323849767e-01 4.139486582680417803e-01
++1.021513134274243950e-01 3.650396452261166491e-01 4.160478671051655586e-01
++1.012689167529539358e-01 3.686920150348446112e-01 4.181335233490640069e-01
++1.003423119365809690e-01 3.723477936835040136e-01 4.202052548968338574e-01
++9.937169919107982641e-02 3.760069784468507703e-01 4.222625006231348066e-01
++9.835741884413440328e-02 3.796695548525758634e-01 4.243046936775203282e-01
++9.729997123759509536e-02 3.833354963232004087e-01 4.263312615677605777e-01
++9.620003933222870396e-02 3.870047637840662302e-01 4.283416262899890081e-01
++9.505172587236093706e-02 3.906780327832828914e-01 4.303339883746660766e-01
++9.386233813144639893e-02 3.943545459798681874e-01 4.323088724355508838e-01
++9.263427266200571775e-02 3.980341179549674036e-01 4.342658626828024837e-01
++9.136927887187012987e-02 4.017166535612498035e-01 4.362043674792987491e-01
++9.006945702453716951e-02 4.054020428715323643e-01 4.381237915805220595e-01
++8.873730500447504776e-02 4.090901606132017476e-01 4.400235366709063789e-01
++8.737577058920215078e-02 4.127808655736769361e-01 4.419030019956885491e-01
++8.598830961259482097e-02 4.164739999785817548e-01 4.437615850971945997e-01
++8.457895032121595658e-02 4.201693888446985103e-01 4.455986826648858368e-01
++8.315236408743081897e-02 4.238668393102046350e-01 4.474136915088433031e-01
++8.171394242970148047e-02 4.275661399451892164e-01 4.492060096666721791e-01
++8.026987997778653461e-02 4.312670600459782566e-01 4.509750376540915817e-01
++7.882726258105521300e-02 4.349693489173894201e-01 4.527201798696426915e-01
++7.739415915996109008e-02 4.386727351476746306e-01 4.544408461640829233e-01
++7.597971511267428979e-02 4.423769258816079852e-01 4.561364535850265800e-01
++7.459424408415230023e-02 4.460816060979165276e-01 4.578064283072901808e-01
++7.324931366840245484e-02 4.497864378980456768e-01 4.594502077591564038e-01
++7.195781915786156335e-02 4.534910598140922677e-01 4.610672429543411499e-01
++7.073403782879061907e-02 4.571950861446216208e-01 4.626570010388615928e-01
++6.959365457471067273e-02 4.608981063279830592e-01 4.642189680611767399e-01
++6.855374817251533304e-02 4.645996843636931994e-01 4.657526519729214276e-01
++6.763272639280798471e-02 4.682993582933911436e-01 4.672575858662252890e-01
++6.685019795786503738e-02 4.719966397538147285e-01 4.687333314519904204e-01
++6.622677049492370349e-02 4.756910136151853430e-01 4.701794827815656830e-01
++6.577673858968982601e-02 4.793824370720338179e-01 4.715941633832017588e-01
++6.552566064603559948e-02 4.830700650743400826e-01 4.729777438223161101e-01
++6.549820807888259711e-02 4.867530881918184504e-01 4.743305399824718216e-01
++6.571558023976076246e-02 4.904308747270616498e-01 4.756523204648347991e-01
++6.619782080433814220e-02 4.941027658684106760e-01 4.769429100625798834e-01
++6.696293828126623215e-02 4.977680989992983585e-01 4.782021118153178540e-01
++6.801610562745827315e-02 5.014269919387287500e-01 4.794267081520149909e-01
++6.938287907938911481e-02 5.050778255979795350e-01 4.806197953737798012e-01
++7.107372065756567547e-02 5.087198306495862576e-01 4.817814896929000779e-01
++7.309574065371191032e-02 5.123522156200341904e-01 4.829119931483520367e-01
++7.544312997722565917e-02 5.159750173542567708e-01 4.840076729265158639e-01
++7.812721320542403980e-02 5.195865216476734938e-01 4.850725749743695636e-01
++8.114572394888117102e-02 5.231858403590214923e-01 4.861073630469811557e-01
++8.448832972524200624e-02 5.267726392289812098e-01 4.871097239159773440e-01
++8.815110303261089464e-02 5.303457163263245455e-01 4.880817131293228583e-01
++9.212706115366336990e-02 5.339038791645212001e-01 4.890257976801760109e-01
++9.640117372078826907e-02 5.374467824904106683e-01 4.899392661237967350e-01
++1.009651127375016111e-01 5.409730397620680087e-01 4.908260102866368046e-01
++1.058058868411170528e-01 5.444817357603629615e-01 4.916873206428047927e-01
++1.109091719419828259e-01 5.479722539284174188e-01 4.925220286879308795e-01
++1.162631754482068569e-01 5.514432364311973034e-01 4.933355557142476422e-01
++1.218535592637135234e-01 5.548942058020517321e-01 4.941256571865651481e-01
++1.276672732366210816e-01 5.583239554235875923e-01 4.948978636889357907e-01
++1.336912106530599997e-01 5.617318570854707982e-01 4.956519172255148820e-01
++1.399119531735926458e-01 5.651170059000043544e-01 4.963918396953513335e-01
++1.463171276735238113e-01 5.684787369209851615e-01 4.971190242696297834e-01
++1.528937099908951325e-01 5.718163393279495077e-01 4.978371217540351057e-01
++1.596300036906863895e-01 5.751292412901443107e-01 4.985481743532478860e-01
++1.665133003434038084e-01 5.784169089899582339e-01 4.992561455145328453e-01
++1.735328783097749850e-01 5.816789154432452369e-01 4.999631315071642601e-01
++1.806761031013389140e-01 5.849149331180006905e-01 5.006736479698321585e-01
++1.879334378838529440e-01 5.881246912104457492e-01 5.013896313522919757e-01
++1.952924636272905801e-01 5.913080959200207598e-01 5.021159025525618880e-01
++2.027443124327554802e-01 5.944650539898058694e-01 5.028546409645925364e-01
++2.102776619158149840e-01 5.975956842983582984e-01 5.036102222376415138e-01
++2.178835011739876371e-01 6.007001216855215597e-01 5.043855354959408954e-01
++2.255521696872271886e-01 6.037786523436265984e-01 5.051841613954050070e-01
++2.332749143253212143e-01 6.068316286127126702e-01 5.060092633925864503e-01
++2.410430130087069522e-01 6.098595200479223211e-01 5.068641518721540562e-01
++2.488489441844971561e-01 6.128628192186393875e-01 5.077515718650474907e-01
++2.566840197606024554e-01 6.158422311486778655e-01 5.086750547256451149e-01
++2.645425291505308918e-01 6.187983086880044503e-01 5.096365792929340444e-01
++2.724162323640093031e-01 6.217319406932720893e-01 5.106395912364674050e-01
++2.803003746086680792e-01 6.246437759477415641e-01 5.116857725517640620e-01
++2.881881143962810587e-01 6.275347641630057982e-01 5.127779478270290126e-01
++2.960748324121407205e-01 6.304057046767445049e-01 5.139178767894679867e-01
++3.039555214161791530e-01 6.332575133378499643e-01 5.151075596956975478e-01
++3.118254758119217707e-01 6.360911463304157465e-01 5.163488722475468862e-01
++3.196814435511296515e-01 6.389074409416231060e-01 5.176430585409529384e-01
++3.275188103490194735e-01 6.417074699067215615e-01 5.189919719540163623e-01
++3.353355552299603914e-01 6.444920106677175520e-01 5.203963563323180663e-01
++3.431277348645550562e-01 6.472621506436356809e-01 5.218577640245062321e-01
++3.508936232465371674e-01 6.500187029053001719e-01 5.233768303957324619e-01
++3.586308928051362699e-01 6.527625972609284455e-01 5.249544352005411918e-01
++3.663368289249827603e-01 6.554948605761221625e-01 5.265915743478537525e-01
++3.740119682194762429e-01 6.582160193662682790e-01 5.282880419647097980e-01
++3.816510562742471135e-01 6.609275747235534570e-01 5.300456830101799577e-01
++3.892580517875900981e-01 6.636294950347043642e-01 5.318631054022345817e-01
++3.968261890078971788e-01 6.663236061846555813e-01 5.337425455110953454e-01
++4.043593499172888350e-01 6.690098785171258999e-01 5.356826761355167887e-01
++4.118554481683104340e-01 6.716893377862352965e-01 5.376841277217632165e-01
++4.193119538935562440e-01 6.743631277083362852e-01 5.397475699351562684e-01
++4.267325988888523436e-01 6.770311866202418649e-01 5.418718349209995511e-01
++4.341129901223799714e-01 6.796950319734580415e-01 5.440580596655568701e-01
++4.414547339722453279e-01 6.823550079810395408e-01 5.463056567639269501e-01
++4.487598229028739172e-01 6.850113432670585922e-01 5.486140038956078824e-01
++4.560240745098563253e-01 6.876655632831355502e-01 5.509839689679422170e-01
++4.632498634530364812e-01 6.903178139102768007e-01 5.534147775766539157e-01
++4.704389351347622594e-01 6.929683367461523247e-01 5.559058726658481220e-01
++4.775890398856753039e-01 6.956182556045346077e-01 5.584575291026864230e-01
++4.846997162615552246e-01 6.982683108816961637e-01 5.610695620964348818e-01
++4.917741270603506742e-01 7.009183842407572529e-01 5.637411222277634026e-01
++4.988124547076915882e-01 7.035690215604037956e-01 5.664719533702552434e-01
++5.058115298480653221e-01 7.062215879970826782e-01 5.692622613027222833e-01
++5.127738759690677606e-01 7.088760718122417703e-01 5.721113127309581659e-01
++5.197010257328686933e-01 7.115326679134365007e-01 5.750185876848199484e-01
++5.265932673521412921e-01 7.141918646847531527e-01 5.779837442967735717e-01
++5.334494816269396145e-01 7.168545129510710545e-01 5.810065526719623286e-01
++5.402690647877386176e-01 7.195213413684249382e-01 5.840866494502513495e-01
++5.470548736207613283e-01 7.221921468817737999e-01 5.872233804977959881e-01
++5.538072551957783363e-01 7.248673679611095100e-01 5.904163410524770894e-01
++5.605265661533928023e-01 7.275474322700724583e-01 5.936651120515976654e-01
++5.672131712764029166e-01 7.302327570205698892e-01 5.969692609600730782e-01
++5.738649923321349489e-01 7.329244536181049874e-01 6.003283620189617809e-01
++5.804845702488933279e-01 7.356223182652517067e-01 6.037418650719156288e-01
++5.870727421002424062e-01 7.383266077479672118e-01 6.072092971993915400e-01
++5.936298933201957784e-01 7.410376988478269977e-01 6.107301851240671819e-01
++6.001564124519274124e-01 7.437559595200373685e-01 6.143040456187923715e-01
++6.066526905401021796e-01 7.464817491552263595e-01 6.179303860708607044e-01
++6.131191206125891080e-01 7.492154188267443615e-01 6.216087050224498034e-01
++6.195560972423146406e-01 7.519573115237726535e-01 6.253384926911926822e-01
++6.259635861936422296e-01 7.547078996712067722e-01 6.291191822939783407e-01
++6.323414409254812796e-01 7.574676913865331374e-01 6.329501570682624090e-01
++6.386911927456534466e-01 7.602366470910791874e-01 6.368310037415121361e-01
++6.450132383997043695e-01 7.630150778921287458e-01 6.407611911364364810e-01
++6.513079749051275957e-01 7.658032878094622742e-01 6.447401822997557153e-01
++6.575757994324034073e-01 7.686015739346664377e-01 6.487674349657708284e-01
++6.638171092147175933e-01 7.714102265818907345e-01 6.528424020163275943e-01
++6.700323014813579503e-01 7.742295294309987641e-01 6.569645319377305226e-01
++6.762217734101813038e-01 7.770597596640953508e-01 6.611332692747456941e-01
++6.823859220949484161e-01 7.799011880964143995e-01 6.653480550814426797e-01
++6.885251445237092760e-01 7.827540793025653532e-01 6.696083273682165160e-01
++6.946398375648411561e-01 7.856186917391158042e-01 6.739135215439332471e-01
++7.007303979576740005e-01 7.884952778644843674e-01 6.782630708517513041e-01
++7.067972223051004477e-01 7.913840842570615264e-01 6.826564067967675342e-01
++7.128407070658809852e-01 7.942853517324697243e-01 6.870929595632513376e-01
++7.188612485448663270e-01 7.971993154607720511e-01 6.915721584188375681e-01
++7.248592428796667431e-01 8.001262050844080154e-01 6.960934321026465144e-01
++7.308350860228653989e-01 8.030662448375227580e-01 7.006562091939169123e-01
++7.367891737192681090e-01 8.060196536672460388e-01 7.052599184573171698e-01
++7.427219014782563411e-01 8.089866453573647531e-01 7.099039891607071828e-01
++7.486327256130643759e-01 8.119678017125729896e-01 7.145873998348200029e-01
++7.545223076817887398e-01 8.149632306197714948e-01 7.193096566367255251e-01
++7.603915796412942241e-01 8.179729213555224643e-01 7.240704295566047222e-01
++7.662409381414175824e-01 8.209970689783633313e-01 7.288691437189614986e-01
++7.720707796269933310e-01 8.240358639329949941e-01 7.337052258319404219e-01
++7.778815003305534770e-01 8.270894921786368092e-01 7.385781042557458820e-01
++7.836734962813408645e-01 8.301581353160575327e-01 7.434872090029538416e-01
++7.894471633387081244e-01 8.332419707110174656e-01 7.484319716624078245e-01
++7.952028972601549173e-01 8.363411716110775718e-01 7.534118252377455249e-01
++8.009401766621723207e-01 8.394563042330350777e-01 7.584255820860429376e-01
++8.066584706735069332e-01 8.425879497641356464e-01 7.634719632765348818e-01
++8.123599093553812711e-01 8.457355276105180675e-01 7.685515296147656938e-01
++8.180448941186928558e-01 8.488991950022984900e-01 7.736637090147417961e-01
++8.237138279483190439e-01 8.520791051833870311e-01 7.788079287668441264e-01
++8.293671160911614271e-01 8.552754073408689317e-01 7.839836146965878383e-01
++8.350048677827189847e-01 8.584883831868801440e-01 7.891899443847590900e-01
++8.406246724049463159e-01 8.617194786977677712e-01 7.944239257301034529e-01
++8.462299834685677036e-01 8.649674562084326279e-01 7.996873827745283325e-01
++8.518212329614019973e-01 8.682324447773152043e-01 8.049797193798620132e-01
++8.573988637074910768e-01 8.715145671024431273e-01 8.103003320898716222e-01
++8.629633327895804840e-01 8.748139384163003962e-01 8.156486084917724533e-01
++8.685112937853189941e-01 8.781325055194139084e-01 8.210202040569095638e-01
++8.740469282893844616e-01 8.814686228402575097e-01 8.264178662740626624e-01
++8.795708463666609411e-01 8.848223352046364898e-01 8.318410153090299852e-01
++8.850836254841629724e-01 8.881937049832523412e-01 8.372889893254339411e-01
++8.905836610629007666e-01 8.915838848352710677e-01 8.427587078675609078e-01
++8.960718329388820402e-01 8.949928217018373600e-01 8.482495190363266158e-01
++9.015509263802756745e-01 8.984195016922670307e-01 8.537628451897162352e-01
++9.070218374764418279e-01 9.018638497314315217e-01 8.592980228813623667e-01
++9.124832972967743538e-01 9.053269113370198129e-01 8.648517190341429295e-01
++9.179365336943248188e-01 9.088084827838653901e-01 8.704232606428425889e-01
++9.233851804191220980e-01 9.123071100087158936e-01 8.760148319228351355e-01
++9.288308811012930821e-01 9.158223472192428272e-01 8.816263177427966502e-01
++9.342716413123769437e-01 9.193556495997508016e-01 8.872531405900644375e-01
++9.397124373542273812e-01 9.229047657151164819e-01 8.928998260600508052e-01
++9.451563753217823161e-01 9.264682865796181055e-01 8.985697730985615639e-01
++9.506035559047821826e-01 9.300461763422669392e-01 9.042646579991682199e-01
++9.560531046363628382e-01 9.336385357088663461e-01 9.099886803187530182e-01
++9.615066616129493982e-01 9.372434217616608665e-01 9.157560566822336989e-01
++9.669573847273637002e-01 9.408624710997687268e-01 9.215795307640300971e-01
++9.723870692594612786e-01 9.445024597948724621e-01 9.274670258562995873e-01
++9.777785730890226068e-01 9.481687534308861354e-01 9.334364948680430318e-01
++9.831050718338244510e-01 9.518727670560837018e-01 9.394860306213083101e-01
++9.883417388454437402e-01 9.556282921109976458e-01 9.455836323325411685e-01
++9.934918422996558141e-01 9.594375624216472387e-01 9.516983192548315040e-01
++9.985763296811461798e-01 9.632965417140263442e-01 9.577895036430327247e-01
++9.942114721489739848e-01 9.649414783718816002e-01 9.591713509300946461e-01
++9.916915526798163460e-01 9.600677293546330260e-01 9.527406681900515428e-01
++9.892073759214962125e-01 9.552017644060696311e-01 9.462702365737246657e-01
++9.867719407557972167e-01 9.503380654950176476e-01 9.397586228881678050e-01
++9.843739071729306067e-01 9.454788135288768602e-01 9.332265558186634280e-01
++9.820182926871906526e-01 9.406217084851765664e-01 9.266730991029579201e-01
++9.797019478013845317e-01 9.357670195072623764e-01 9.201050706729160256e-01
++9.774207980730996725e-01 9.309154126689619391e-01 9.135293740478817037e-01
++9.751815609868391688e-01 9.260643851639969171e-01 9.069399044850446900e-01
++9.729704910473376822e-01 9.212176417076594070e-01 9.003536220502811327e-01
++9.708034919455280631e-01 9.163699401531895106e-01 8.937532865598888376e-01
++9.686635749176782939e-01 9.115260705110270756e-01 8.871590238431372732e-01
++9.665594650012595546e-01 9.066829842770773862e-01 8.805615104307024099e-01
++9.644872784946666444e-01 9.018415117599095643e-01 8.739656672915365743e-01
++9.624420742140847862e-01 8.970028582796596428e-01 8.673774626543144795e-01
++9.604345584612016262e-01 8.921632903093835720e-01 8.607852860310053478e-01
++9.584498054598472594e-01 8.873272041947983801e-01 8.542061390733795001e-01
++9.564989754176022041e-01 8.824906944948268661e-01 8.476279025304513937e-01
++9.545749598026603833e-01 8.776557062005478915e-01 8.410587414202306267e-01
++9.526745457712032517e-01 8.728229738617154787e-01 8.345024009748316374e-01
++9.508087846256844111e-01 8.679885222040847337e-01 8.279470532549256800e-01
++9.489631025192423186e-01 8.631568397645421609e-01 8.214088147188137734e-01
++9.471457599180185261e-01 8.583248540920686009e-01 8.148789280451533834e-01
++9.453550305765402451e-01 8.534927996091392632e-01 8.083595091982623826e-01
++9.435830323389927665e-01 8.486630445127123501e-01 8.018591800395635794e-01
++9.418425662160879730e-01 8.438308651791852633e-01 7.953645386207840451e-01
++9.401224124677813876e-01 8.389997911592477209e-01 7.888877269212305476e-01
++9.384205871436177571e-01 8.341702205035793627e-01 7.824309818729748844e-01
++9.367501034134483318e-01 8.293372224294222050e-01 7.759809608693934990e-01
++9.350962812812430025e-01 8.245056601392387607e-01 7.695531958095181979e-01
++9.334610667718560295e-01 8.196745424298020888e-01 7.631458380069808811e-01
++9.318539060108851357e-01 8.148400979617762552e-01 7.567494905851217535e-01
++9.302622555140654947e-01 8.100065567310004155e-01 7.503772218901773039e-01
++9.286876056094349741e-01 8.051730724177085241e-01 7.440277117015546837e-01
++9.271395831502474705e-01 8.003357056772891776e-01 7.376916134646933632e-01
++9.256059253327618697e-01 7.954987025858116789e-01 7.313814866564718464e-01
++9.240863437601837260e-01 7.906618776065421628e-01 7.250978248201844778e-01
++9.225925658427436282e-01 7.858203843156221780e-01 7.188294627149656169e-01
++9.211126169365579930e-01 7.809784744974170856e-01 7.125884635347393692e-01
++9.196455684792974594e-01 7.761362045971830215e-01 7.063759865046427278e-01
++9.181979022265810420e-01 7.712906810954774928e-01 7.001861662941214481e-01
++9.167672001571998130e-01 7.664424894801199484e-01 6.940217357022171463e-01
++9.153481567945904729e-01 7.615934195093969628e-01 6.878880649909780987e-01
++9.139404639768551331e-01 7.567432836340363123e-01 6.817857667786046960e-01
++9.125539294301500126e-01 7.518876928783747582e-01 6.757062380855892725e-01
++9.111780957235272593e-01 7.470305845086899765e-01 6.696595752391263368e-01
++9.098122501649290594e-01 7.421719339914916169e-01 6.636468136699643638e-01
++9.084563128768237128e-01 7.373114504136536462e-01 6.576684342801734084e-01
++9.071185731273107011e-01 7.324452193667679856e-01 6.517176237314421527e-01
++9.057893354554222842e-01 7.275770233727173464e-01 6.458034937673092779e-01
++9.044682125236334080e-01 7.227067015228565428e-01 6.399268508324190696e-01
++9.031548045364521382e-01 7.178340969900336432e-01 6.340885324865254136e-01
++9.018536281154535539e-01 7.129568373829493488e-01 6.282852974032566706e-01
++9.005618093543485969e-01 7.080758191596225881e-01 6.225202235043866272e-01
++8.992759701121831872e-01 7.031922144373208283e-01 6.167967177972875081e-01
++8.979956379512032960e-01 6.983059000713781606e-01 6.111157531581823399e-01
++8.967203212860314077e-01 6.934167616666734313e-01 6.054783383481375791e-01
++8.954526708976771054e-01 6.885231926405954717e-01 5.998830635410449252e-01
++8.941915566016080952e-01 6.836253365962329243e-01 5.943315847613384051e-01
++8.929334172678807802e-01 6.787245284319090022e-01 5.888273795844850556e-01
++8.916776705242244194e-01 6.738207055230612808e-01 5.833715948784413685e-01
++8.904237095992360018e-01 6.689138192653601989e-01 5.779654133729836829e-01
++8.891709022410747565e-01 6.640038362746348843e-01 5.726100532447696567e-01
++8.879187220887899690e-01 6.590906724758603952e-01 5.673066752652388134e-01
++8.866700510547862457e-01 6.541724962989774461e-01 5.620541403257021118e-01
++8.854200814778028228e-01 6.492513861023391231e-01 5.568566631651752363e-01
++8.841680786914359880e-01 6.443273831269403784e-01 5.517155748042765762e-01
++8.829132805112128723e-01 6.394005490891804255e-01 5.466322335097351104e-01
++8.816548969914349554e-01 6.344709672901969189e-01 5.416080224154796730e-01
++8.803921103664992254e-01 6.295387436822825755e-01 5.366443467601184070e-01
++8.791240751896489680e-01 6.246040078804957485e-01 5.317426307330340718e-01
++8.778499186810901911e-01 6.196669141071349252e-01 5.269043139249947050e-01
++8.765687412960717628e-01 6.147276420564155019e-01 5.221308473833028430e-01
++8.752796175219744734e-01 6.097863976665317542e-01 5.174236892760738504e-01
++8.739815969115529715e-01 6.048434137862945814e-01 5.127843001752147023e-01
++8.726737941588253999e-01 5.998988989392898263e-01 5.082140946168248741e-01
++8.713557496267209102e-01 5.949528226638209905e-01 5.037142772058214035e-01
++8.700256052408116281e-01 5.900059904309469250e-01 4.992866995883939452e-01
++8.686823445912698061e-01 5.850587401058766623e-01 4.949327569364067592e-01
++8.673249354213553586e-01 5.801114372307474287e-01 4.906538189940125583e-01
++8.659523319452930856e-01 5.751644748762787529e-01 4.864512237593011101e-01
++8.645634773771747605e-01 5.702182733234352208e-01 4.823262709991545383e-01
++8.631573066573615671e-01 5.652732795695735168e-01 4.782802156484906031e-01
++8.617327493598900823e-01 5.603299666552966629e-01 4.743142611496265482e-01
++8.602887327613949475e-01 5.553888328102728478e-01 4.704295527914130193e-01
++8.588244189007790963e-01 5.504502458314576296e-01 4.666271134383851993e-01
++8.573388771464994784e-01 5.455146532392860514e-01 4.629079425847138496e-01
++8.558307110590109845e-01 5.405828402802138610e-01 4.592730689337449212e-01
++8.542988567054966564e-01 5.356554029582069054e-01 4.557233480219839428e-01
++8.527422657992969057e-01 5.307329553519699594e-01 4.522595444303549317e-01
++8.511599092771463537e-01 5.258161276783985816e-01 4.488823265086418490e-01
++8.495507808257551918e-01 5.209055642285482790e-01 4.455922615760174454e-01
++8.479139003246871642e-01 5.160019211927755478e-01 4.423898116530999292e-01
++8.462483171732270160e-01 5.111058643932878676e-01 4.392753297751230135e-01
++8.445531134701587117e-01 5.062180669436533442e-01 4.362490569289804720e-01
++8.428274070171406507e-01 5.013392068558483183e-01 4.333111196492664408e-01
++8.410703541185753362e-01 4.964699646160714575e-01 4.304615283001137493e-01
++8.392811521535089581e-01 4.916110207509353791e-01 4.277001760608312164e-01
++8.374593644075595256e-01 4.867627987429819503e-01 4.250269048992098009e-01
++8.356043139975503076e-01 4.819259312622626301e-01 4.224414243859783702e-01
++8.337148868611683472e-01 4.771014353948369036e-01 4.199431953989596344e-01
++8.317904658009995789e-01 4.722899701137897588e-01 4.175316375108732991e-01
++8.298304844983901418e-01 4.674921821164159108e-01 4.152060584430907197e-01
++8.278344282915189867e-01 4.627087037890093568e-01 4.129656573155296440e-01
++8.258018346451376779e-01 4.579401513029328075e-01 4.108095284678619508e-01
++8.237322933175019735e-01 4.531871228543432051e-01 4.087366658020525345e-01
++8.216256878784896633e-01 4.484499819155622347e-01 4.067461112065531847e-01
++8.194815690724320811e-01 4.437294051177347876e-01 4.048366204140803060e-01
++8.172995050178583076e-01 4.390260854893064946e-01 4.030068099238640067e-01
++8.150792968857805132e-01 4.343405321271661679e-01 4.012553165972070901e-01
++8.128207950280410543e-01 4.296732294003547947e-01 3.995807052170325946e-01
++8.105238975108269850e-01 4.250246362540385792e-01 3.979814747698801614e-01
++8.081885484630557670e-01 4.203951856851556590e-01 3.964560648094507256e-01
++8.058148470586988799e-01 4.157851737769109879e-01 3.950029765120905423e-01
++8.034026962411985329e-01 4.111951046689115152e-01 3.936204324142628108e-01
++8.009521378981909745e-01 4.066253627118514569e-01 3.923066947182650144e-01
++7.984632874676697023e-01 4.020762706733001512e-01 3.910600267933756480e-01
++7.959362958998934534e-01 3.975481251157440554e-01 3.898786646276527490e-01
++7.933713473226599033e-01 3.930411968130258504e-01 3.887608225579017307e-01
++7.907686574783574507e-01 3.885557303926693296e-01 3.877046999689159890e-01
++7.881284544156301752e-01 3.840919640902587529e-01 3.867084595587381712e-01
++7.854510012103226302e-01 3.796501032751679605e-01 3.857702673246294345e-01
++7.827365958532629397e-01 3.752303177293505598e-01 3.848883050999601374e-01
++7.799855573279415033e-01 3.708327552306592834e-01 3.840607581802352732e-01
++7.771982233463431422e-01 3.664575425267851405e-01 3.832858192234025463e-01
++7.743749481448563010e-01 3.621047863617611329e-01 3.825616918198675998e-01
++7.715160518337467188e-01 3.577746368683014655e-01 3.818864831434901075e-01
++7.686219524815265380e-01 3.534671195520193154e-01 3.812584982442814296e-01
++7.656930517948008497e-01 3.491822750013692245e-01 3.806760122706670524e-01
++7.627297518608332494e-01 3.449201381780978570e-01 3.801373059981723590e-01
++7.597324610418284552e-01 3.406807299395016586e-01 3.796406843015277532e-01
++7.567015922742318379e-01 3.364640582281425152e-01 3.791844777860022275e-01
++7.536375467881040180e-01 3.322701411099439062e-01 3.787669970190922220e-01
++7.505407196227874556e-01 3.280990002753491619e-01 3.783865433211569540e-01
++7.474115712082280982e-01 3.239505493622616417e-01 3.780416634360889150e-01
++7.442505183508412170e-01 3.198247550352249502e-01 3.777308063416947026e-01
++7.410579750279425726e-01 3.157215772518807695e-01 3.774524509829353947e-01
++7.378343512384677449e-01 3.116409704467773545e-01 3.772051064266770948e-01
++7.345800519344474200e-01 3.075828847103421748e-01 3.769873118279194468e-01
++7.312954622460766663e-01 3.035472925968438762e-01 3.767975677519167510e-01
++7.279809779377566237e-01 2.995341347142527755e-01 3.766344783074295766e-01
++7.246370003939071047e-01 2.955433232127043786e-01 3.764967560209065978e-01
++7.212639047983969709e-01 2.915748020657008555e-01 3.763830604225979481e-01
++7.178620569041518351e-01 2.876285169108695472e-01 3.762920784118068407e-01
++7.144318123927204667e-01 2.837044162122266955e-01 3.762225233422813453e-01
++7.109735162895217675e-01 2.798024524280844916e-01 3.761731340017399616e-01
++7.074875003639726767e-01 2.759225885803616163e-01 3.761426556123988463e-01
++7.039740902088845731e-01 2.720647802144139371e-01 3.761299015349165442e-01
++7.004335983291459788e-01 2.682289908573779469e-01 3.761337091569335600e-01
++6.968663212773178461e-01 2.644152012227610760e-01 3.761529095527339495e-01
++6.932725426766019883e-01 2.606234021780075572e-01 3.761863526116585033e-01
++6.896525329109274294e-01 2.568535960113472738e-01 3.762329055321002591e-01
++6.860065488492232966e-01 2.531057977294109973e-01 3.762914512548127810e-01
++6.823348363761195801e-01 2.493800214422073891e-01 3.763609500820121467e-01
++6.786376242649662105e-01 2.456763038128263466e-01 3.764403535110733556e-01
++6.749151231751110425e-01 2.419947210999891518e-01 3.765285264384131692e-01
++6.711675324616499516e-01 2.383353539955441192e-01 3.766243994612780699e-01
++6.673950369964636309e-01 2.346983031289386346e-01 3.767269100578239382e-01
++6.635978070649097837e-01 2.310836906390836831e-01 3.768350007100279009e-01
++6.597759982863891093e-01 2.274916618065601082e-01 3.769476169820946132e-01
++6.559297473209481089e-01 2.239223513030393353e-01 3.770639116649144307e-01
++6.520591754729223588e-01 2.203759654266244650e-01 3.771828077558652681e-01
++6.481643941443696599e-01 2.168527541906234979e-01 3.773031206968150975e-01
++6.442454984979625321e-01 2.133529749202845993e-01 3.774237883397635329e-01
++6.403025689859566105e-01 2.098769174022531714e-01 3.775437410683403772e-01
++6.363356714241054091e-01 2.064249059420060206e-01 3.776618996147099727e-01
++6.323448551853009247e-01 2.029972985879547887e-01 3.777771986896097389e-01
++6.283301122985771592e-01 1.995944416686266654e-01 3.778890664877021521e-01
++6.242914965761068302e-01 1.962168403108488501e-01 3.779958773221168133e-01
++6.202290151835444521e-01 1.928649814733044143e-01 3.780964890449534654e-01
++6.161426615427991749e-01 1.895393981082279800e-01 3.781897379927290359e-01
++6.120324156302930918e-01 1.862406715933664081e-01 3.782744366000001524e-01
++6.078982443238682976e-01 1.829694341941491276e-01 3.783493709986866516e-01
++6.037399990506459035e-01 1.797263486622488471e-01 3.784140428470601503e-01
++5.995576965897967403e-01 1.765121975913181707e-01 3.784665259488561584e-01
++5.953512720943007208e-01 1.733277858871770660e-01 3.785054621982753553e-01
++5.911206437729070728e-01 1.701739770998706713e-01 3.785295035265708874e-01
++5.868657195674668037e-01 1.670516976788867514e-01 3.785372630540221883e-01
++5.825863435035250060e-01 1.639619511220119508e-01 3.785276019365447775e-01
++5.782823203682633251e-01 1.609058321765788335e-01 3.784994295515334839e-01
++5.739536466014196758e-01 1.578844538430557720e-01 3.784505787767488694e-01
++5.696001981012460691e-01 1.548990153349074916e-01 3.783794775494400686e-01
++5.652218458222221242e-01 1.519507861175737884e-01 3.782845039525286057e-01
++5.608184279263467298e-01 1.490411220014642157e-01 3.781641038386275300e-01
++5.563896048179566289e-01 1.461715605343842650e-01 3.780173288805740439e-01
++5.519354537512982661e-01 1.433434802585686063e-01 3.778414852793369194e-01
++5.474558435278772395e-01 1.405584279152288785e-01 3.776347269993366451e-01
++5.429506470730138812e-01 1.378180135121435668e-01 3.773951523619960002e-01
++5.384196501144510316e-01 1.351239813932839096e-01 3.771211030874267456e-01
++5.338626135422905872e-01 1.324781762459926737e-01 3.768109124380045194e-01
++5.292796498492590151e-01 1.298822067930652524e-01 3.764618033826110377e-01
++5.246706783487381509e-01 1.273378756852094063e-01 3.760716446399895441e-01
++5.200356363922209457e-01 1.248470120733735367e-01 3.756382551974452033e-01
++5.153742367301422656e-01 1.224117140591406694e-01 3.751600258018771838e-01
++5.106866581816573714e-01 1.200336468026920456e-01 3.746341300161435961e-01
++5.059729862980435477e-01 1.177145617740232852e-01 3.740580772636119544e-01
++5.012332745984564575e-01 1.154562389937715539e-01 3.734295174784395543e-01
++4.964674957217509177e-01 1.132605442683873864e-01 3.727463195168757570e-01
++4.916758190194626121e-01 1.111290906599490258e-01 3.720059818290880060e-01
++4.868585609140311798e-01 1.090632523851999269e-01 3.712058226357082269e-01
++4.820159589014604840e-01 1.070644243738244350e-01 3.703434438399521023e-01
++4.771482837998479165e-01 1.051338742417683159e-01 3.694164970204523168e-01
++4.722559296975721854e-01 1.032725993184717139e-01 3.684225499867860298e-01
++4.673393879073711177e-01 1.014813305146687883e-01 3.673591735272957459e-01
++4.623991454541829804e-01 9.976065343840129218e-02 3.662241176536292220e-01
++4.574358041489324234e-01 9.811082191626963045e-02 3.650151416090168244e-01
++4.524502157463570762e-01 9.653152558968838837e-02 3.637298817526759542e-01
++4.474429556959144683e-01 9.502266265951053725e-02 3.623665563347658880e-01
++4.424148033564082039e-01 9.358361785401031474e-02 3.609233190012756665e-01
++4.373666093617918915e-01 9.221344371517425920e-02 3.593984619211612608e-01
++4.323000061476657274e-01 9.090969474799345806e-02 3.577897503619592023e-01
++4.272154852828886629e-01 8.967151542383772211e-02 3.560963875772367726e-01
++4.221140984792258188e-01 8.849693359303587026e-02 3.543172112905775273e-01
++4.169969758462759302e-01 8.738362154375492463e-02 3.524512375858371849e-01
++4.118658301965831270e-01 8.632803919827600203e-02 3.504973239811765007e-01
++4.067221669675408213e-01 8.532676500724681312e-02 3.484548346345710534e-01
++4.015666852977432533e-01 8.437757766440442952e-02 3.463238990387739746e-01
++3.964007130297593218e-01 8.347701754004596686e-02 3.441044235724556866e-01
++3.912256097683191602e-01 8.262141527259461715e-02 3.417965388380971303e-01
++3.860430941874281596e-01 8.180633277581816909e-02 3.394004639140563162e-01
++3.808555339288969832e-01 8.102605665725876039e-02 3.369164884312597086e-01
++3.756631594887540060e-01 8.027857713191724476e-02 3.343459517649038371e-01
++3.704673590324250032e-01 7.955977986332424257e-02 3.316898655204278401e-01
++3.652695090362573227e-01 7.886552703397090025e-02 3.289494343067977944e-01
++3.600709660701238435e-01 7.819169210462800779e-02 3.261260438198446687e-01
++3.548730588141333908e-01 7.753419260275734581e-02 3.232212473818363851e-01
++3.496770804198256477e-01 7.688902041627435069e-02 3.202367511798585031e-01
++3.444853557545813350e-01 7.625034119537774102e-02 3.171743822649770728e-01
++3.392982604990861795e-01 7.561586038621423422e-02 3.140362188799208365e-01
++3.341166082970875029e-01 7.498254313274954619e-02 3.108243324765390669e-01
++3.289414559917514524e-01 7.434697155739058982e-02 3.075408588184366798e-01
++3.237737954171283072e-01 7.370590341662106026e-02 3.041879989569576392e-01
++3.186145498482620964e-01 7.305628171756148315e-02 3.007680026557595920e-01
++3.134645711821229530e-01 7.239524117563511663e-02 2.972831523530131137e-01
++3.083246378402036969e-01 7.172011173017686647e-02 2.937357478389135412e-01
++3.031954533707552635e-01 7.102841937235576664e-02 2.901280917978547591e-01
++2.980776457172774063e-01 7.031788456468926474e-02 2.864624763353166292e-01
++2.929717671102379239e-01 6.958641854495320467e-02 2.827411705802333475e-01
++2.878782945311796904e-01 6.883211781082057557e-02 2.789664094251954607e-01
++2.827976306923836725e-01 6.805325707674123037e-02 2.751403834400568682e-01
++2.777301054710668571e-01 6.724828098296936618e-02 2.712652299698696257e-01
++2.726759777346169922e-01 6.641579481976991883e-02 2.673430254060571443e-01
++2.676354374924288515e-01 6.555455450916861104e-02 2.633757786005420098e-01
++2.626097591395918363e-01 6.466149844681601255e-02 2.593660533804174051e-01
++2.575992689989206608e-01 6.373522644476575794e-02 2.553159580518031269e-01
++2.526028775756383737e-01 6.277674824557366584e-02 2.512267303676423147e-01
++2.476205211412589313e-01 6.178532806314660647e-02 2.471000835041496368e-01
++2.426520784951842757e-01 6.076032925135082391e-02 2.429376426307544024e-01
++2.376973739685813714e-01 5.970120319443159712e-02 2.387409437758167274e-01
++2.327561803770203386e-01 5.860747847771281133e-02 2.345114333677875140e-01
++2.278285229664566147e-01 5.747825339035907838e-02 2.302506881609430733e-01
++2.229180662380075839e-01 5.630663136815370479e-02 2.259630047830259447e-01
++2.180204522985965676e-01 5.509893160286010588e-02 2.216467626153181270e-01
++2.131352588343927157e-01 5.385491895770589538e-02 2.173030574920574165e-01
++2.082620235717315138e-01 5.257438772048273617e-02 2.129328977906284059e-01
++2.034002463374002811e-01 5.125715285178860520e-02 2.085372063771265272e-01]; 
++
++   case 'amp' 
++      RGB = [9.463470914425774483e-01 9.290101343908121478e-01 9.257532417012246384e-01
++9.437115115548888600e-01 9.244624965319422349e-01 9.206701514370421169e-01
++9.413263164430620833e-01 9.198473615841167295e-01 9.154240958990897958e-01
++9.390547090113202655e-01 9.152093965940418796e-01 9.101090387889319011e-01
++9.368634575300728295e-01 9.105592179043572321e-01 9.047473920040983719e-01
++9.347358946162058757e-01 9.059020202913443676e-01 8.993502288257003707e-01
++9.326614522721177192e-01 9.012410121503533489e-01 8.939244930449518067e-01
++9.306333250978273686e-01 8.965781745298962990e-01 8.884745648022901454e-01
++9.286461606427048876e-01 8.919150224616214651e-01 8.830038737434344753e-01
++9.266960476646858291e-01 8.872526027444326280e-01 8.775148739503740858e-01
++9.247795820079757201e-01 8.825918040419664656e-01 8.720097084454925263e-01
++9.228944807039246578e-01 8.779331456742857087e-01 8.664897344910690302e-01
++9.210380342808240917e-01 8.732773006486703737e-01 8.609566713320465636e-01
++9.192087851735465387e-01 8.686245228987975464e-01 8.554113284148980867e-01
++9.174048150925064871e-01 8.639752297661511538e-01 8.498548926033711037e-01
++9.156244455582711606e-01 8.593297631172468476e-01 8.442883976261035262e-01
++9.138671371679708555e-01 8.546880756641417332e-01 8.387120160257571788e-01
++9.121305737300281491e-01 8.500507404321120397e-01 8.331273220967562176e-01
++9.104149075499773369e-01 8.454174764656698926e-01 8.275339791691540547e-01
++9.087182868982504047e-01 8.407887046755945226e-01 8.219332381316957203e-01
++9.070398066265998871e-01 8.361645202367321561e-01 8.163256242481420344e-01
++9.053796160871283583e-01 8.315446471258203243e-01 8.107108259382036497e-01
++9.037352419915254398e-01 8.269297416714002091e-01 8.050906531516163200e-01
++9.021080083908009639e-01 8.223191128622155954e-01 7.994638601040017223e-01
++9.004956244333240933e-01 8.177133605075642686e-01 7.938321412777887831e-01
++8.988977241110835958e-01 8.131124010808855607e-01 7.881956419539296599e-01
++8.973148627806266653e-01 8.085158161746068828e-01 7.825537446961500221e-01
++8.957442417382828204e-01 8.039244072828748422e-01 7.769086245337948338e-01
++8.941881096565635900e-01 7.993371392915321616e-01 7.712582600059587623e-01
++8.926437234223070227e-01 7.947548018176209261e-01 7.656048088583016220e-01
++8.911109613594879741e-01 7.901772295732085727e-01 7.599482475326526654e-01
++8.895909134152744091e-01 7.856038035950861920e-01 7.542875143411862382e-01
++8.880802871606852111e-01 7.810355387672826000e-01 7.486252986030703660e-01
++8.865819248532246233e-01 7.764711589075004028e-01 7.429590373479496579e-01
++8.850930260657449145e-01 7.719115034698935673e-01 7.372910251414285243e-01
++8.836131402967402071e-01 7.673565360639147404e-01 7.316215502737657417e-01
++8.821444223454562028e-01 7.628052217660783452e-01 7.259486135652994943e-01
++8.806827953756125593e-01 7.582589101067193083e-01 7.202756895379377466e-01
++8.792311851397603961e-01 7.537162649935950087e-01 7.146000961578288235e-01
++8.777875677079440830e-01 7.491778548550656058e-01 7.089235227883947665e-01
++8.763501988878248383e-01 7.446441541668697983e-01 7.032474436364752890e-01
++8.749232756241082098e-01 7.401133023432254765e-01 6.975679937396324082e-01
++8.735014600514631189e-01 7.355871888710872053e-01 6.918898915870100863e-01
++8.720870217729678187e-01 7.310647072768980959e-01 6.862110066741609060e-01
++8.706800348126626510e-01 7.265456103843925817e-01 6.805311805702053407e-01
++8.692770022519556994e-01 7.220310948598716028e-01 6.748535454654478460e-01
++8.678827146915726320e-01 7.175190094979648769e-01 6.691736166956238074e-01
++8.664927921052477666e-01 7.130109157552886323e-01 6.634953613259193528e-01
++8.651068719926267025e-01 7.085067580022798017e-01 6.578190657407729791e-01
++8.637289803901067042e-01 7.040046558915140640e-01 6.521408976142408775e-01
++8.623534679961476490e-01 6.995067341461493893e-01 6.464660893001026309e-01
++8.609830606578612322e-01 6.950116457163946215e-01 6.407920274183934728e-01
++8.596180478330472940e-01 6.905190440208218705e-01 6.351183727606340979e-01
++8.582544825018789680e-01 6.860303869186620274e-01 6.294488360238388314e-01
++8.568970944227636277e-01 6.815434400545420379e-01 6.237788543057761759e-01
++8.555425925651013452e-01 6.770593865574592307e-01 6.181115291897923969e-01
++8.541886800910097888e-01 6.725790118919016125e-01 6.124490539806487499e-01
++8.528418735895523239e-01 6.680992506239646911e-01 6.067850786519378703e-01
++8.514956700712879023e-01 6.636227191543088155e-01 6.011258775897345696e-01
++8.501500355486913962e-01 6.591492264653023847e-01 5.954714806881288292e-01
++8.488106382652110815e-01 6.546760150904927800e-01 5.898162979999663769e-01
++8.474706581846417341e-01 6.502059048227525340e-01 5.841670108646530579e-01
++8.461313452075343022e-01 6.457381204225883797e-01 5.785223911431566224e-01
++8.447969154607379849e-01 6.412705018379197819e-01 5.728782339090506825e-01
++8.434612056654142709e-01 6.368056357299208825e-01 5.672406638938772838e-01
++8.421258352164873173e-01 6.323425572542190620e-01 5.616080798917625350e-01
++8.407944708783339216e-01 6.278793105389963713e-01 5.559767932481035624e-01
++8.394611847956942041e-01 6.234184331258648681e-01 5.503527766345649441e-01
++8.381273683455257029e-01 6.189590462186138620e-01 5.447346560426542528e-01
++8.367972635859407537e-01 6.144988712509784623e-01 5.391181340824646728e-01
++8.354646463246349075e-01 6.100406459813725313e-01 5.335095625632335636e-01
++8.341299717058989760e-01 6.055839279215072812e-01 5.279085280772741751e-01
++8.327994021627661558e-01 6.011254425561419756e-01 5.223087380798424606e-01
++8.314657754399900069e-01 5.966684488411785336e-01 5.167175843922774403e-01
++8.301288592609736838e-01 5.922128365915518833e-01 5.111353769747372100e-01
++8.287951011685089631e-01 5.877551092176589442e-01 5.055554913593263144e-01
++8.274588476811213233e-01 5.832978393600145584e-01 4.999838390239015884e-01
++8.261188250087038165e-01 5.788414339387950580e-01 4.944218283197156505e-01
++8.247786369803286055e-01 5.743837798031475872e-01 4.888657757771856516e-01
++8.234381838800088893e-01 5.699246359812502050e-01 4.833158537977020885e-01
++8.220935149852323098e-01 5.654657957469002572e-01 4.777762994077761616e-01
++8.207444566974767541e-01 5.610071021581608530e-01 4.722474096096786478e-01
++8.193981033425531413e-01 5.565444762341525964e-01 4.667217962382390062e-01
++8.180472685091408902e-01 5.520814646564632389e-01 4.612071590527028753e-01
++8.166916431769154494e-01 5.476179715812223847e-01 4.557039631596026541e-01
++8.153328745786677656e-01 5.431528161626910656e-01 4.502105997079735578e-01
++8.139743540529152943e-01 5.386837997184832361e-01 4.447235925743368568e-01
++8.126106579688792131e-01 5.342136249170785778e-01 4.392488743242201066e-01
++8.112416585089723409e-01 5.297420805368263652e-01 4.337867573467541482e-01
++8.098689150112462487e-01 5.252679783528519941e-01 4.283357546423488538e-01
++8.084956135344389949e-01 5.207891399756702233e-01 4.228926326123328416e-01
++8.071166424763304148e-01 5.163081809730883931e-01 4.174630770396351442e-01
++8.057318945579315939e-01 5.118248549122679236e-01 4.120474263101407963e-01
++8.043412708255589516e-01 5.073389039757838503e-01 4.066460228640024210e-01
++8.029498733805645605e-01 5.028469116894594970e-01 4.012536130705923743e-01
++8.015531888402489535e-01 4.983512104818560995e-01 3.958753217358975118e-01
++8.001502657810105612e-01 4.938520308181937879e-01 3.905124577505094119e-01
++7.987410157112331266e-01 4.893490771437783438e-01 3.851654167818974739e-01
++7.973253554907255847e-01 4.848420416222078422e-01 3.798346066585175373e-01
++7.959075773999774173e-01 4.803278114438007118e-01 3.745157291750967898e-01
++7.944838857609586302e-01 4.758083650556605426e-01 3.692132449197628175e-01
++7.930533836294737515e-01 4.712838795689627269e-01 3.639285059842314873e-01
++7.916159847493996482e-01 4.667540085796573757e-01 3.586620124504662499e-01
++7.901716040813833164e-01 4.622183930878590030e-01 3.534142884263108408e-01
++7.887201567691978221e-01 4.576766614569128255e-01 3.481858850345221357e-01
++7.872638957915846225e-01 4.531268310219068174e-01 3.429748729037092048e-01
++7.858016971109998972e-01 4.485691650403910713e-01 3.377829921447058070e-01
++7.843319196766078694e-01 4.440043051111859929e-01 3.326125640359084423e-01
++7.828544529945841157e-01 4.394318439857143876e-01 3.274643000606006771e-01
++7.813691807701973469e-01 4.348513628187685720e-01 3.223389566893520852e-01
++7.798759793897394044e-01 4.302624315207902450e-01 3.172373399087716761e-01
++7.783747162977331380e-01 4.256646092089760858e-01 3.121603100704657408e-01
++7.768652482649208713e-01 4.210574447687118194e-01 3.071087870719240720e-01
++7.753474195428932125e-01 4.164404775377301138e-01 3.020837558793280642e-01
++7.738210599017090185e-01 4.118132381262810671e-01 2.970862723999735389e-01
++7.722859825475274498e-01 4.071752493875019363e-01 2.921174697090146433e-01
++7.707419819180442166e-01 4.025260275530667675e-01 2.871785646313976814e-01
++7.691888313545882649e-01 3.978650835500125438e-01 2.822708646751007633e-01
++7.676262806509283054e-01 3.931919245154482101e-01 2.773957753058901021e-01
++7.660540534803422785e-01 3.885060555265225091e-01 2.725548075466420750e-01
++7.644718447042359033e-01 3.838069815635994364e-01 2.677495858756240299e-01
++7.628793175676447103e-01 3.790942097250059595e-01 2.629818563878072446e-01
++7.612761007893139586e-01 3.743672517119065457e-01 2.582534951710902527e-01
++7.596617855567490141e-01 3.696256266018116965e-01 2.535665168349998111e-01
++7.580359224396768791e-01 3.648688639288839575e-01 2.489230831128432242e-01
++7.563980182387591844e-01 3.600965070884658559e-01 2.443255114391649219e-01
++7.547475327902162245e-01 3.553081170821107415e-01 2.397762833825934359e-01
++7.530838757510928128e-01 3.505032766177708092e-01 2.352780527895846907e-01
++7.514064033944252152e-01 3.456815945775675858e-01 2.308336534671754370e-01
++7.497144154482878742e-01 3.408427108627715696e-01 2.264461062026797977e-01
++7.480093931719870026e-01 3.359841374696425076e-01 2.221167453210010634e-01
++7.462904219476443890e-01 3.311055722690471881e-01 2.178492138304993775e-01
++7.445546708594931173e-01 3.262086086142511610e-01 2.136488350090644528e-01
++7.428011522578348291e-01 3.212930797652773784e-01 2.095194932063288440e-01
++7.410289292300998865e-01 3.163587556773898579e-01 2.054651883130465539e-01
++7.392422371017411953e-01 3.113999367010875097e-01 2.014864526930904010e-01
++7.374344355234756510e-01 3.064221768888288899e-01 1.975919663992890540e-01
++7.356041908206575330e-01 3.014256456718681365e-01 1.937864841719280640e-01
++7.337546411878117514e-01 2.964055318272263428e-01 1.900722381207737011e-01
++7.318814451569350954e-01 2.913651536558918287e-01 1.864564514321402355e-01
++7.299813549163196580e-01 2.863068267986909055e-01 1.829454454677189867e-01
++7.280589696708802405e-01 2.812237436541007995e-01 1.795417572234761505e-01
++7.261058295804370122e-01 2.761243371138519809e-01 1.762545002124356330e-01
++7.241247102013246284e-01 2.710038520778982329e-01 1.730875525793737491e-01
++7.221106804386585587e-01 2.658668602953934146e-01 1.700480125370592843e-01
++7.200637636280236009e-01 2.607119201605753722e-01 1.671411340183387162e-01
++7.179797241720924372e-01 2.555430923618877692e-01 1.643731951674216596e-01
++7.158585660201038925e-01 2.503590497486887223e-01 1.617494125495184398e-01
++7.136946458601574061e-01 2.451661844345556784e-01 1.592752687470095629e-01
++7.114894074734618989e-01 2.399613853901303440e-01 1.569555549892431845e-01
++7.092368038757341786e-01 2.347521795395665634e-01 1.547943364998323190e-01
++7.069352804131667778e-01 2.295401028324536297e-01 1.527950884695459255e-01
++7.045831993890990796e-01 2.243269505217069248e-01 1.509608633015488421e-01
++7.021764206472544956e-01 2.191186683316911910e-01 1.492928085088980894e-01
++6.997128684389145592e-01 2.139184608731344861e-01 1.477916611410667047e-01
++6.971911916356166028e-01 2.087286324898059431e-01 1.464577951274126655e-01
++6.946080256946649545e-01 2.035552197097931226e-01 1.452888805599515110e-01
++6.919615635162069678e-01 1.984021504802455094e-01 1.442823442764895880e-01
++6.892502621260994111e-01 1.932732898312458647e-01 1.434346916240710201e-01
++6.864728173440260983e-01 1.881724668500568132e-01 1.427415573021981465e-01
++6.836276497375878280e-01 1.831044861638990162e-01 1.421968539256191488e-01
++6.807138936899735926e-01 1.780732451543534933e-01 1.417942947939738185e-01
++6.777309286205458472e-01 1.730825547177755885e-01 1.415269568275668299e-01
++6.746783856387729150e-01 1.681360921159456845e-01 1.413874528291547972e-01
++6.715560313350845689e-01 1.632376302346780217e-01 1.413677792054587046e-01
++6.683639211377226941e-01 1.583906644890515358e-01 1.414598772073469568e-01
++6.651023056640176234e-01 1.535985670708633066e-01 1.416556412086291405e-01
++6.617715794982882427e-01 1.488646699200451562e-01 1.419469640184388703e-01
++6.583721731985413550e-01 1.441925388486675619e-01 1.423253876471278490e-01
++6.549047613747174257e-01 1.395853626420375526e-01 1.427832909133252004e-01
++6.513700233144809060e-01 1.350465677963595956e-01 1.433130440041158193e-01
++6.477686724727176326e-01 1.305797355595543496e-01 1.439072462489923432e-01
++6.441014028993071738e-01 1.261888040474711814e-01 1.445583185074540422e-01
++6.403689740006455189e-01 1.218777495533199251e-01 1.452593821489098769e-01
++6.365721433135939078e-01 1.176507620626412731e-01 1.460041387809807023e-01
++6.327116135602410818e-01 1.135124987936143026e-01 1.467862349801432043e-01
++6.287880597206695343e-01 1.094681045314993273e-01 1.475989566519263774e-01
++6.248021600743940418e-01 1.055229431116234684e-01 1.484364140781085362e-01
++6.207545450778898521e-01 1.016827736772349666e-01 1.492933020681679601e-01
++6.166458126074587653e-01 9.795388132578869422e-02 1.501640386258630555e-01
++6.124766416655831325e-01 9.434293988806133346e-02 1.510418818628477822e-01
++6.082475860694411818e-01 9.085689252672626837e-02 1.519224424106922766e-01
++6.039592307964848361e-01 8.750309254173271878e-02 1.528005492303129986e-01
++5.996123270243045589e-01 8.428892340087804080e-02 1.536699242631612283e-01
++5.952075850399283219e-01 8.122188415501030434e-02 1.545253736600938343e-01
++5.907456431322212209e-01 7.830966313722748096e-02 1.553624952709374007e-01
++5.862275380722600238e-01 7.555913263658070589e-02 1.561749022891834038e-01
++5.816543085194019191e-01 7.297679500504322680e-02 1.569571524895727321e-01
++5.770267606447557762e-01 7.056924923284621509e-02 1.577054842373717958e-01
++5.723466647463710810e-01 6.834024207619035507e-02 1.584124407437495219e-01
++5.676151929412465158e-01 6.629402087598951221e-02 1.590741634973840690e-01
++5.628336935771917071e-01 6.443348056543876656e-02 1.596865619581833706e-01
++5.580050003714496221e-01 6.275633232081309631e-02 1.602413164863800144e-01
++5.531297300263749994e-01 6.126496600367018625e-02 1.607383872225261745e-01
++5.482116402359448193e-01 5.995167246350390639e-02 1.611686284256901580e-01
++5.432516061451815315e-01 5.881547808076787592e-02 1.615323341086055964e-01
++5.382535120903690906e-01 5.784532671126727671e-02 1.618221724924289173e-01
++5.332186175206464762e-01 5.703660923770780683e-02 1.620384025483199708e-01
++5.281513818389996784e-01 5.637398150597446728e-02 1.621742451273615881e-01
++5.230520756324539278e-01 5.585383743496476899e-02 1.622329744665089168e-01
++5.179273401770114749e-01 5.545235617321788574e-02 1.622049347095048388e-01
++5.127760391281988017e-01 5.516900039838320419e-02 1.620968226308776017e-01
++5.076034324141470711e-01 5.498326606891081741e-02 1.619030677004743290e-01
++5.024122108869354397e-01 5.488240340299161552e-02 1.616236282627719067e-01
++4.972028565812885437e-01 5.486041454189729411e-02 1.612621553479370584e-01
++4.919800125101927990e-01 5.489873490341760226e-02 1.608156853259256336e-01
++4.867469976088732442e-01 5.498319810891529741e-02 1.602839538682285792e-01
++4.815035401048063934e-01 5.511074616505500651e-02 1.596718589083305773e-01
++4.762519241645499224e-01 5.527092475320084103e-02 1.589804323039821221e-01
++4.709943156232950234e-01 5.545404644646995812e-02 1.582109529908402590e-01
++4.657362887691403608e-01 5.564106402926658618e-02 1.573608184133624133e-01
++4.604760106385220042e-01 5.583489737898188893e-02 1.564363997859181399e-01
++4.552150906427448462e-01 5.602873466021515009e-02 1.554396278095509509e-01
++4.499550509587917912e-01 5.621638605393316362e-02 1.543724780354263082e-01
++4.446972616844994119e-01 5.639243657216582578e-02 1.532370205267698793e-01
++4.394429409822757093e-01 5.655220574247237647e-02 1.520353945457279254e-01
++4.341931570608791313e-01 5.669170022106548995e-02 1.507697850177304177e-01
++4.289488317782668703e-01 5.680756188500035025e-02 1.494424009624717165e-01
++4.237107456338875533e-01 5.689701352302534848e-02 1.480554560097830374e-01
++4.184795439135307604e-01 5.695780383827742793e-02 1.466111510548973595e-01
++4.132557437526688804e-01 5.698815310778364979e-02 1.451116590521219496e-01
++4.080397418937663501e-01 5.698670052046273665e-02 1.435591118993865545e-01
++4.028318229277383922e-01 5.695245393890951274e-02 1.419555893285963655e-01
++3.976321678282654926e-01 5.688474259913823411e-02 1.403031096878759043e-01
++3.924408626085833518e-01 5.678317307342812398e-02 1.386036224809996942e-01
++3.872615129675306966e-01 5.663896210711539397e-02 1.368568732654815434e-01
++3.820928251575063661e-01 5.645532265747305739e-02 1.350656214594591342e-01
++3.769329700865952648e-01 5.623657775378711893e-02 1.332326547817182794e-01
++3.717817181595340914e-01 5.598316066775241989e-02 1.313596470261583493e-01
++3.666387821359218258e-01 5.569561666867810928e-02 1.294481844724836295e-01
++3.615063297404105258e-01 5.536890534251808632e-02 1.274985831214487109e-01
++3.563880603817025094e-01 5.499475479736596478e-02 1.255105734342905621e-01
++3.512776042297060530e-01 5.458755525687735560e-02 1.234884411194991649e-01
++3.461744793988128510e-01 5.414817693699586904e-02 1.214334602338749125e-01
++3.410813090262644343e-01 5.367068674831452363e-02 1.193455923090092352e-01
++3.360026615292399654e-01 5.314516420281268499e-02 1.172242123426087412e-01
++3.309302966511110111e-01 5.258939733233552322e-02 1.150735180048746420e-01
++3.258636162106021694e-01 5.200433045735335796e-02 1.128944817728364247e-01
++3.208133832347068171e-01 5.136699574271335472e-02 1.106843415414836551e-01
++3.157696216592825178e-01 5.069836482305852682e-02 1.084473347788683095e-01
++3.107301266925714400e-01 5.000263599039595636e-02 1.061847548036680688e-01
++3.057061331880795430e-01 4.925629172594595678e-02 1.038940386221758327e-01
++3.006879268630521240e-01 4.847913366710451116e-02 1.015787046192155041e-01
++2.956726217207689689e-01 4.767654364208809975e-02 9.923998323658683729e-02
++2.906746306466351792e-01 4.681900231021129261e-02 9.687492161154248604e-02
++2.856782002647242358e-01 4.593789236755790178e-02 9.448789214269404102e-02
++2.806890017083342181e-01 4.502128372335665457e-02 9.207800935320636926e-02
++2.757102955542003464e-01 4.406225179606895054e-02 8.964513100796869804e-02
++2.707312541226000180e-01 4.308157177910076213e-02 8.719176105781661912e-02
++2.657667372933599781e-01 4.204947038025994704e-02 8.471559044612611555e-02
++2.608025053402583393e-01 4.099314121499578883e-02 8.221947676879418077e-02
++2.558451747035172530e-01 3.989182795135969711e-02 7.970262452812598708e-02
++2.508938137991353901e-01 3.876029441108298085e-02 7.716551375026653448e-02
++2.459428063629143790e-01 3.762148549775875400e-02 7.460911056507216199e-02
++2.410021600694670640e-01 3.645746689804394564e-02 7.203245689473128377e-02
++2.360563646646140490e-01 3.529747994604028744e-02 6.943744239412558139e-02]; 
++
++   case 'tem' 
++      RGB = [9.985763296811461798e-01 9.632965417140263442e-01 9.577895036430327247e-01
++9.934918422996558141e-01 9.594375624216472387e-01 9.516983192548315040e-01
++9.883417388454437402e-01 9.556282921109976458e-01 9.455836323325411685e-01
++9.831050718338244510e-01 9.518727670560837018e-01 9.394860306213083101e-01
++9.777785730890226068e-01 9.481687534308861354e-01 9.334364948680430318e-01
++9.723870692594612786e-01 9.445024597948724621e-01 9.274670258562995873e-01
++9.669573847273637002e-01 9.408624710997687268e-01 9.215795307640300971e-01
++9.615066616129493982e-01 9.372434217616608665e-01 9.157560566822336989e-01
++9.560531046363628382e-01 9.336385357088663461e-01 9.099886803187530182e-01
++9.506035559047821826e-01 9.300461763422669392e-01 9.042646579991682199e-01
++9.451563753217823161e-01 9.264682865796181055e-01 8.985697730985615639e-01
++9.397124373542273812e-01 9.229047657151164819e-01 8.928998260600508052e-01
++9.342716413123769437e-01 9.193556495997508016e-01 8.872531405900644375e-01
++9.288308811012930821e-01 9.158223472192428272e-01 8.816263177427966502e-01
++9.233851804191220980e-01 9.123071100087158936e-01 8.760148319228351355e-01
++9.179365336943248188e-01 9.088084827838653901e-01 8.704232606428425889e-01
++9.124832972967743538e-01 9.053269113370198129e-01 8.648517190341429295e-01
++9.070218374764418279e-01 9.018638497314315217e-01 8.592980228813623667e-01
++9.015509263802756745e-01 8.984195016922670307e-01 8.537628451897162352e-01
++8.960718329388820402e-01 8.949928217018373600e-01 8.482495190363266158e-01
++8.905836610629007666e-01 8.915838848352710677e-01 8.427587078675609078e-01
++8.850836254841629724e-01 8.881937049832523412e-01 8.372889893254339411e-01
++8.795708463666609411e-01 8.848223352046364898e-01 8.318410153090299852e-01
++8.740469282893844616e-01 8.814686228402575097e-01 8.264178662740626624e-01
++8.685112937853189941e-01 8.781325055194139084e-01 8.210202040569095638e-01
++8.629633327895804840e-01 8.748139384163003962e-01 8.156486084917724533e-01
++8.573988637074910768e-01 8.715145671024431273e-01 8.103003320898716222e-01
++8.518212329614019973e-01 8.682324447773152043e-01 8.049797193798620132e-01
++8.462299834685677036e-01 8.649674562084326279e-01 7.996873827745283325e-01
++8.406246724049463159e-01 8.617194786977677712e-01 7.944239257301034529e-01
++8.350048677827189847e-01 8.584883831868801440e-01 7.891899443847590900e-01
++8.293671160911614271e-01 8.552754073408689317e-01 7.839836146965878383e-01
++8.237138279483190439e-01 8.520791051833870311e-01 7.788079287668441264e-01
++8.180448941186928558e-01 8.488991950022984900e-01 7.736637090147417961e-01
++8.123599093553812711e-01 8.457355276105180675e-01 7.685515296147656938e-01
++8.066584706735069332e-01 8.425879497641356464e-01 7.634719632765348818e-01
++8.009401766621723207e-01 8.394563042330350777e-01 7.584255820860429376e-01
++7.952028972601549173e-01 8.363411716110775718e-01 7.534118252377455249e-01
++7.894471633387081244e-01 8.332419707110174656e-01 7.484319716624078245e-01
++7.836734962813408645e-01 8.301581353160575327e-01 7.434872090029538416e-01
++7.778815003305534770e-01 8.270894921786368092e-01 7.385781042557458820e-01
++7.720707796269933310e-01 8.240358639329949941e-01 7.337052258319404219e-01
++7.662409381414175824e-01 8.209970689783633313e-01 7.288691437189614986e-01
++7.603915796412942241e-01 8.179729213555224643e-01 7.240704295566047222e-01
++7.545223076817887398e-01 8.149632306197714948e-01 7.193096566367255251e-01
++7.486327256130643759e-01 8.119678017125729896e-01 7.145873998348200029e-01
++7.427219014782563411e-01 8.089866453573647531e-01 7.099039891607071828e-01
++7.367891737192681090e-01 8.060196536672460388e-01 7.052599184573171698e-01
++7.308350860228653989e-01 8.030662448375227580e-01 7.006562091939169123e-01
++7.248592428796667431e-01 8.001262050844080154e-01 6.960934321026465144e-01
++7.188612485448663270e-01 7.971993154607720511e-01 6.915721584188375681e-01
++7.128407070658809852e-01 7.942853517324697243e-01 6.870929595632513376e-01
++7.067972223051004477e-01 7.913840842570615264e-01 6.826564067967675342e-01
++7.007303979576740005e-01 7.884952778644843674e-01 6.782630708517513041e-01
++6.946398375648411561e-01 7.856186917391158042e-01 6.739135215439332471e-01
++6.885251445237092760e-01 7.827540793025653532e-01 6.696083273682165160e-01
++6.823859220949484161e-01 7.799011880964143995e-01 6.653480550814426797e-01
++6.762217734101813038e-01 7.770597596640953508e-01 6.611332692747456941e-01
++6.700323014813579503e-01 7.742295294309987641e-01 6.569645319377305226e-01
++6.638171092147175933e-01 7.714102265818907345e-01 6.528424020163275943e-01
++6.575757994324034073e-01 7.686015739346664377e-01 6.487674349657708284e-01
++6.513079749051275957e-01 7.658032878094622742e-01 6.447401822997557153e-01
++6.450132383997043695e-01 7.630150778921287458e-01 6.407611911364364810e-01
++6.386911927456534466e-01 7.602366470910791874e-01 6.368310037415121361e-01
++6.323414409254812796e-01 7.574676913865331374e-01 6.329501570682624090e-01
++6.259635861936422296e-01 7.547078996712067722e-01 6.291191822939783407e-01
++6.195560972423146406e-01 7.519573115237726535e-01 6.253384926911926822e-01
++6.131191206125891080e-01 7.492154188267443615e-01 6.216087050224498034e-01
++6.066526905401021796e-01 7.464817491552263595e-01 6.179303860708607044e-01
++6.001564124519274124e-01 7.437559595200373685e-01 6.143040456187923715e-01
++5.936298933201957784e-01 7.410376988478269977e-01 6.107301851240671819e-01
++5.870727421002424062e-01 7.383266077479672118e-01 6.072092971993915400e-01
++5.804845702488933279e-01 7.356223182652517067e-01 6.037418650719156288e-01
++5.738649923321349489e-01 7.329244536181049874e-01 6.003283620189617809e-01
++5.672131712764029166e-01 7.302327570205698892e-01 5.969692609600730782e-01
++5.605265661533928023e-01 7.275474322700724583e-01 5.936651120515976654e-01
++5.538072551957783363e-01 7.248673679611095100e-01 5.904163410524770894e-01
++5.470548736207613283e-01 7.221921468817737999e-01 5.872233804977959881e-01
++5.402690647877386176e-01 7.195213413684249382e-01 5.840866494502513495e-01
++5.334494816269396145e-01 7.168545129510710545e-01 5.810065526719623286e-01
++5.265932673521412921e-01 7.141918646847531527e-01 5.779837442967735717e-01
++5.197010257328686933e-01 7.115326679134365007e-01 5.750185876848199484e-01
++5.127738759690677606e-01 7.088760718122417703e-01 5.721113127309581659e-01
++5.058115298480653221e-01 7.062215879970826782e-01 5.692622613027222833e-01
++4.988124547076915882e-01 7.035690215604037956e-01 5.664719533702552434e-01
++4.917741270603506742e-01 7.009183842407572529e-01 5.637411222277634026e-01
++4.846997162615552246e-01 6.982683108816961637e-01 5.610695620964348818e-01
++4.775890398856753039e-01 6.956182556045346077e-01 5.584575291026864230e-01
++4.704389351347622594e-01 6.929683367461523247e-01 5.559058726658481220e-01
++4.632498634530364812e-01 6.903178139102768007e-01 5.534147775766539157e-01
++4.560240745098563253e-01 6.876655632831355502e-01 5.509839689679422170e-01
++4.487598229028739172e-01 6.850113432670585922e-01 5.486140038956078824e-01
++4.414547339722453279e-01 6.823550079810395408e-01 5.463056567639269501e-01
++4.341129901223799714e-01 6.796950319734580415e-01 5.440580596655568701e-01
++4.267325988888523436e-01 6.770311866202418649e-01 5.418718349209995511e-01
++4.193119538935562440e-01 6.743631277083362852e-01 5.397475699351562684e-01
++4.118554481683104340e-01 6.716893377862352965e-01 5.376841277217632165e-01
++4.043593499172888350e-01 6.690098785171258999e-01 5.356826761355167887e-01
++3.968261890078971788e-01 6.663236061846555813e-01 5.337425455110953454e-01
++3.892580517875900981e-01 6.636294950347043642e-01 5.318631054022345817e-01
++3.816510562742471135e-01 6.609275747235534570e-01 5.300456830101799577e-01
++3.740119682194762429e-01 6.582160193662682790e-01 5.282880419647097980e-01
++3.663368289249827603e-01 6.554948605761221625e-01 5.265915743478537525e-01
++3.586308928051362699e-01 6.527625972609284455e-01 5.249544352005411918e-01
++3.508936232465371674e-01 6.500187029053001719e-01 5.233768303957324619e-01
++3.431277348645550562e-01 6.472621506436356809e-01 5.218577640245062321e-01
++3.353355552299603914e-01 6.444920106677175520e-01 5.203963563323180663e-01
++3.275188103490194735e-01 6.417074699067215615e-01 5.189919719540163623e-01
++3.196814435511296515e-01 6.389074409416231060e-01 5.176430585409529384e-01
++3.118254758119217707e-01 6.360911463304157465e-01 5.163488722475468862e-01
++3.039555214161791530e-01 6.332575133378499643e-01 5.151075596956975478e-01
++2.960748324121407205e-01 6.304057046767445049e-01 5.139178767894679867e-01
++2.881881143962810587e-01 6.275347641630057982e-01 5.127779478270290126e-01
++2.803003746086680792e-01 6.246437759477415641e-01 5.116857725517640620e-01
++2.724162323640093031e-01 6.217319406932720893e-01 5.106395912364674050e-01
++2.645425291505308918e-01 6.187983086880044503e-01 5.096365792929340444e-01
++2.566840197606024554e-01 6.158422311486778655e-01 5.086750547256451149e-01
++2.488489441844971561e-01 6.128628192186393875e-01 5.077515718650474907e-01
++2.410430130087069522e-01 6.098595200479223211e-01 5.068641518721540562e-01
++2.332749143253212143e-01 6.068316286127126702e-01 5.060092633925864503e-01
++2.255521696872271886e-01 6.037786523436265984e-01 5.051841613954050070e-01
++2.178835011739876371e-01 6.007001216855215597e-01 5.043855354959408954e-01
++2.102776619158149840e-01 5.975956842983582984e-01 5.036102222376415138e-01
++2.027443124327554802e-01 5.944650539898058694e-01 5.028546409645925364e-01
++1.952924636272905801e-01 5.913080959200207598e-01 5.021159025525618880e-01
++1.879334378838529440e-01 5.881246912104457492e-01 5.013896313522919757e-01
++1.806761031013389140e-01 5.849149331180006905e-01 5.006736479698321585e-01
++1.735328783097749850e-01 5.816789154432452369e-01 4.999631315071642601e-01
++1.665133003434038084e-01 5.784169089899582339e-01 4.992561455145328453e-01
++1.596300036906863895e-01 5.751292412901443107e-01 4.985481743532478860e-01
++1.528937099908951325e-01 5.718163393279495077e-01 4.978371217540351057e-01
++1.463171276735238113e-01 5.684787369209851615e-01 4.971190242696297834e-01
++1.399119531735926458e-01 5.651170059000043544e-01 4.963918396953513335e-01
++1.336912106530599997e-01 5.617318570854707982e-01 4.956519172255148820e-01
++1.276672732366210816e-01 5.583239554235875923e-01 4.948978636889357907e-01
++1.218535592637135234e-01 5.548942058020517321e-01 4.941256571865651481e-01
++1.162631754482068569e-01 5.514432364311973034e-01 4.933355557142476422e-01
++1.109091719419828259e-01 5.479722539284174188e-01 4.925220286879308795e-01
++1.058058868411170528e-01 5.444817357603629615e-01 4.916873206428047927e-01
++1.009651127375016111e-01 5.409730397620680087e-01 4.908260102866368046e-01
++9.640117372078826907e-02 5.374467824904106683e-01 4.899392661237967350e-01
++9.212706115366336990e-02 5.339038791645212001e-01 4.890257976801760109e-01
++8.815110303261089464e-02 5.303457163263245455e-01 4.880817131293228583e-01
++8.448832972524200624e-02 5.267726392289812098e-01 4.871097239159773440e-01
++8.114572394888117102e-02 5.231858403590214923e-01 4.861073630469811557e-01
++7.812721320542403980e-02 5.195865216476734938e-01 4.850725749743695636e-01
++7.544312997722565917e-02 5.159750173542567708e-01 4.840076729265158639e-01
++7.309574065371191032e-02 5.123522156200341904e-01 4.829119931483520367e-01
++7.107372065756567547e-02 5.087198306495862576e-01 4.817814896929000779e-01
++6.938287907938911481e-02 5.050778255979795350e-01 4.806197953737798012e-01
++6.801610562745827315e-02 5.014269919387287500e-01 4.794267081520149909e-01
++6.696293828126623215e-02 4.977680989992983585e-01 4.782021118153178540e-01
++6.619782080433814220e-02 4.941027658684106760e-01 4.769429100625798834e-01
++6.571558023976076246e-02 4.904308747270616498e-01 4.756523204648347991e-01
++6.549820807888259711e-02 4.867530881918184504e-01 4.743305399824718216e-01
++6.552566064603559948e-02 4.830700650743400826e-01 4.729777438223161101e-01
++6.577673858968982601e-02 4.793824370720338179e-01 4.715941633832017588e-01
++6.622677049492370349e-02 4.756910136151853430e-01 4.701794827815656830e-01
++6.685019795786503738e-02 4.719966397538147285e-01 4.687333314519904204e-01
++6.763272639280798471e-02 4.682993582933911436e-01 4.672575858662252890e-01
++6.855374817251533304e-02 4.645996843636931994e-01 4.657526519729214276e-01
++6.959365457471067273e-02 4.608981063279830592e-01 4.642189680611767399e-01
++7.073403782879061907e-02 4.571950861446216208e-01 4.626570010388615928e-01
++7.195781915786156335e-02 4.534910598140922677e-01 4.610672429543411499e-01
++7.324931366840245484e-02 4.497864378980456768e-01 4.594502077591564038e-01
++7.459424408415230023e-02 4.460816060979165276e-01 4.578064283072901808e-01
++7.597971511267428979e-02 4.423769258816079852e-01 4.561364535850265800e-01
++7.739415915996109008e-02 4.386727351476746306e-01 4.544408461640829233e-01
++7.882726258105521300e-02 4.349693489173894201e-01 4.527201798696426915e-01
++8.026987997778653461e-02 4.312670600459782566e-01 4.509750376540915817e-01
++8.171394242970148047e-02 4.275661399451892164e-01 4.492060096666721791e-01
++8.315236408743081897e-02 4.238668393102046350e-01 4.474136915088433031e-01
++8.457895032121595658e-02 4.201693888446985103e-01 4.455986826648858368e-01
++8.598830961259482097e-02 4.164739999785817548e-01 4.437615850971945997e-01
++8.737577058920215078e-02 4.127808655736769361e-01 4.419030019956885491e-01
++8.873730500447504776e-02 4.090901606132017476e-01 4.400235366709063789e-01
++9.006945702453716951e-02 4.054020428715323643e-01 4.381237915805220595e-01
++9.136927887187012987e-02 4.017166535612498035e-01 4.362043674792987491e-01
++9.263427266200571775e-02 3.980341179549674036e-01 4.342658626828024837e-01
++9.386233813144639893e-02 3.943545459798681874e-01 4.323088724355508838e-01
++9.505172587236093706e-02 3.906780327832828914e-01 4.303339883746660766e-01
++9.620003933222870396e-02 3.870047637840662302e-01 4.283416262899890081e-01
++9.729997123759509536e-02 3.833354963232004087e-01 4.263312615677605777e-01
++9.835741884413440328e-02 3.796695548525758634e-01 4.243046936775203282e-01
++9.937169919107982641e-02 3.760069784468507703e-01 4.222625006231348066e-01
++1.003423119365809690e-01 3.723477936835040136e-01 4.202052548968338574e-01
++1.012689167529539358e-01 3.686920150348446112e-01 4.181335233490640069e-01
++1.021513134274243950e-01 3.650396452261166491e-01 4.160478671051655586e-01
++1.029884320307208612e-01 3.613907991323849767e-01 4.139486582680417803e-01
++1.037719209811681642e-01 3.577465259466254266e-01 4.118348877541359032e-01
++1.045112201334900126e-01 3.541056562885774861e-01 4.097088092956981398e-01
++1.052065591856250482e-01 3.504681464569319171e-01 4.075709632165070984e-01
++1.058582376509708545e-01 3.468339423292918222e-01 4.054218838433404359e-01
++1.064666158592602885e-01 3.432029795356145718e-01 4.032620996037361571e-01
++1.070239159802940931e-01 3.395763147211236510e-01 4.010905648833596460e-01
++1.075355258379605550e-01 3.359532282299735328e-01 3.989087127976621017e-01
++1.080052802278752000e-01 3.323331728550899533e-01 3.967176863054378000e-01
++1.084337294201929702e-01 3.287160421828903556e-01 3.945179917556369542e-01
++1.088202096165073185e-01 3.251019032868823211e-01 3.923098843692563453e-01
++1.091556968975302966e-01 3.214920812428978536e-01 3.900919340676701208e-01
++1.094518269158459012e-01 3.178848431435130073e-01 3.878667847148202785e-01
++1.097092559883022234e-01 3.142800415550652815e-01 3.856349205402823110e-01
++1.099286556573810802e-01 3.106775192369479188e-01 3.833968205472055302e-01
++1.100986315611906241e-01 3.070790351009552999e-01 3.811504545068737926e-01
++1.102317288825286901e-01 3.034825829921489193e-01 3.788986922133656954e-01
++1.103290785873510815e-01 2.998879083652261635e-01 3.766420819050353419e-01
++1.103893448894039397e-01 2.962951553198432397e-01 3.743806401368951486e-01
++1.104047114339987423e-01 2.927055780381122019e-01 3.721129484539063559e-01
++1.103867349279119559e-01 2.891171759115234718e-01 3.698417464033080804e-01
++1.103361572207214036e-01 2.855297163446686715e-01 3.675674754730824945e-01
++1.102460152182262176e-01 2.819443225282238785e-01 3.652888319764409086e-01
++1.101198294511886444e-01 2.783603021914852760e-01 3.630068099573608986e-01
++1.099635342633853707e-01 2.747764822051754763e-01 3.607229892872333421e-01
++1.097748910210358808e-01 2.711931376089152246e-01 3.584370856671010852e-01
++1.095478763802813504e-01 2.676112773022403801e-01 3.561478615212890775e-01
++1.092932808921200649e-01 2.640287615628073015e-01 3.538580573547516761e-01
++1.090116287119651528e-01 2.604453159192556266e-01 3.515680214913912693e-01
++1.086913329090623825e-01 2.568630402753477870e-01 3.492750549670107785e-01
++1.083460004297124302e-01 2.532791299120676354e-01 3.469826761312421182e-01
++1.079763885418836000e-01 2.496932209057829977e-01 3.446912766824791197e-01
++1.075713140889580088e-01 2.461073946949010050e-01 3.423980926413837667e-01
++1.071428862568302165e-01 2.425189920877232619e-01 3.401063918909076889e-01
++1.066927192498384747e-01 2.389274243968986799e-01 3.378167764830257158e-01
++1.062093640276061124e-01 2.353348932541681759e-01 3.355262248019345583e-01
++1.057055066316897329e-01 2.317384538919968207e-01 3.332383062494437276e-01
++1.051814556007013568e-01 2.281377376539149293e-01 3.309532535866355762e-01
++1.046272664909374817e-01 2.245346804307608024e-01 3.286682704446855507e-01
++1.040556247342821483e-01 2.209261472703716311e-01 3.263871052200472134e-01
++1.034637486817424901e-01 2.173124203806320875e-01 3.241090419310820314e-01
++1.028468845169810686e-01 2.136942776676366007e-01 3.218326666201724029e-01
++1.022150454689789434e-01 2.100689913462399083e-01 3.195611195376787395e-01
++1.015620277820400430e-01 2.064376400065636719e-01 3.172925125709148420e-01
++1.008900241588315538e-01 2.027992883367119026e-01 3.150275553737127421e-01
++1.002054858430543316e-01 1.991518634625495388e-01 3.127684262427183892e-01
++9.949803783218733044e-02 1.954975058870322413e-01 3.105116763778897337e-01
++9.877832247043097369e-02 1.918329889556127654e-01 3.082609202522414993e-01
++9.804493118338306057e-02 1.881580898967480098e-01 3.060157402408537064e-01
++9.729328810023782359e-02 1.844734436312414905e-01 3.037745103921251633e-01
++9.653316478613682694e-02 1.807757562460599599e-01 3.015407883893915231e-01
++9.575619444438937533e-02 1.770666290075273708e-01 2.993115284087380368e-01
++9.496899572502048859e-02 1.733434725855039771e-01 2.970892156823352059e-01
++9.417284157369981701e-02 1.696050767223750977e-01 2.948744162588470830e-01
++9.336173420340779239e-02 1.658523274558137695e-01 2.926648040593683997e-01
++9.254607948203208423e-02 1.620811665705463311e-01 2.904645825457518593e-01
++9.171714479257989105e-02 1.582931942356169963e-01 2.882702798507874586e-01
++9.088231952195491292e-02 1.544850037627045203e-01 2.860850125083750362e-01
++9.004099984169053328e-02 1.506555099870153513e-01 2.839086654207542693e-01
++8.919012906146844832e-02 1.468043594975814992e-01 2.817400195447572475e-01
++8.833858505105957049e-02 1.429270910011002649e-01 2.795831537842536352e-01
++8.747533041314431435e-02 1.390258052165279645e-01 2.774332852121961235e-01
++8.661249189260347703e-02 1.350944971238551839e-01 2.752961432065319514e-01
++8.574385298640457842e-02 1.311333174761502018e-01 2.731691209373900975e-01
++8.487294239495335457e-02 1.271387529060027943e-01 2.710541708402016137e-01
++8.400180885962132971e-02 1.231074880892656653e-01 2.689526699064171411e-01
++8.312616532498406929e-02 1.190383729463048712e-01 2.668628892216621806e-01
++8.225559928700268419e-02 1.149244079727295142e-01 2.647901677800857390e-01]; 
++
++   case 'ice'
++      RGB = [1.531167435543729846e-02 2.252059388699531942e-02 7.272873735907764425e-02
++1.800549591959003243e-02 2.544551608389769570e-02 7.841879116825511975e-02
++2.090133006203173313e-02 2.852652245071044673e-02 8.407771577420969367e-02
++2.399818650587986005e-02 3.176264327218273481e-02 8.970750416351327972e-02
++2.729775749004114890e-02 3.514909496851363613e-02 9.532647230499821656e-02
++3.080428146052393429e-02 3.867708164670261017e-02 1.009662673440025749e-01
++3.450984373415445089e-02 4.229955636714784889e-02 1.065828165743578915e-01
++3.841359784116892689e-02 4.587404239998996852e-02 1.121776340643418912e-01
++4.245789616397358662e-02 4.939963679832150983e-02 1.177960773094180458e-01
++4.645777532344794875e-02 5.288489849108807955e-02 1.234176036286754041e-01
++5.041621762087678676e-02 5.633788824565918313e-02 1.290216830927681801e-01
++5.433779516873311205e-02 5.975737503280462853e-02 1.346239246672657763e-01
++5.823000255128838593e-02 6.313585840823013329e-02 1.402651739202840087e-01
++6.208647351275981691e-02 6.648865889594307577e-02 1.458921724026617794e-01
++6.590890827576056932e-02 6.981759532833076154e-02 1.515056185497818952e-01
++6.970669712558172360e-02 7.310909804078333241e-02 1.571701055775910905e-01
++7.347360805650121618e-02 7.637815581467355397e-02 1.628308265129313204e-01
++7.720982185882321880e-02 7.962820406611839652e-02 1.684800394051645944e-01
++8.092190572547824923e-02 8.284856571837034833e-02 1.741697304708636207e-01
++8.460722520622676601e-02 8.604719820880801784e-02 1.798725773914293391e-01
++8.826407983557263415e-02 8.923087230589588081e-02 1.855652548242135713e-01
++9.189748856643911723e-02 9.238991627825218766e-02 1.912953251540190358e-01
++9.550605637353798416e-02 9.552936548231369396e-02 1.970466344723810770e-01
++9.908760199831237458e-02 9.865735598928837558e-02 2.027885080271309981e-01
++1.026464276979975609e-01 1.017632832609889626e-01 2.085729006866037794e-01
++1.061807481293115807e-01 1.048533987828409453e-01 2.143771619600378098e-01
++1.096889023760894977e-01 1.079351702016392300e-01 2.201721871249775475e-01
++1.131748168296289048e-01 1.109951338044804781e-01 2.260236443434878173e-01
++1.166355654717963208e-01 1.140448383112346031e-01 2.318836318580280165e-01
++1.200706770784045196e-01 1.170883693387409774e-01 2.377372345137335197e-01
++1.234831126917021182e-01 1.201095785266100835e-01 2.436640854600494177e-01
++1.268694769189046001e-01 1.231271973707054601e-01 2.495809234356071160e-01
++1.302307935855599175e-01 1.261348273230401829e-01 2.555217697948003464e-01
++1.335669536543798996e-01 1.291293381943951213e-01 2.615060473838256017e-01
++1.368768735891793542e-01 1.321228390190112012e-01 2.674792268238664894e-01
++1.401607222303006828e-01 1.351007751267265800e-01 2.735164638309879881e-01
++1.434177197831119077e-01 1.380764808543884503e-01 2.795564348972031099e-01
++1.466474902267766722e-01 1.410468359199091026e-01 2.856183790033576808e-01
++1.498489657362017669e-01 1.440082826282148287e-01 2.917246687573430419e-01
++1.530229361070791771e-01 1.469729643095797900e-01 2.978170527656492372e-01
++1.561658891044421793e-01 1.499237839873007738e-01 3.039884751881400948e-01
++1.592803696822101267e-01 1.528796824181726244e-01 3.101441051875748478e-01
++1.623627513097627983e-01 1.558287612260276789e-01 3.163512211275710251e-01
++1.654142439360292427e-01 1.587796212856360245e-01 3.225680108254420086e-01
++1.684327965090609003e-01 1.617293084063355368e-01 3.288148930781844004e-01
++1.714174532656698446e-01 1.646790560305917694e-01 3.350897686326997915e-01
++1.743682562241114509e-01 1.676319105902342177e-01 3.413798820958920399e-01
++1.772818953778146633e-01 1.705846382439054620e-01 3.477088809140311265e-01
++1.801603634233710782e-01 1.735435075165488450e-01 3.540447583078508709e-01
++1.829984949769703495e-01 1.765034834295459432e-01 3.604229741636628126e-01
++1.857993799242090571e-01 1.794715454820642320e-01 3.668060399217007994e-01
++1.885572370561371114e-01 1.824432159549585208e-01 3.732275719698777694e-01
++1.912746410827655397e-01 1.854240146696699842e-01 3.796579628109393312e-01
++1.939472187446417972e-01 1.884119984733164943e-01 3.861158710011389772e-01
++1.965746218202921169e-01 1.914094687319768118e-01 3.925922579541862301e-01
++1.991567237202455654e-01 1.944185425759841768e-01 3.990785276243757895e-01
++2.016870280617926170e-01 1.974370231299186207e-01 4.055979452145534458e-01
++2.041733231959791395e-01 2.004720971993999568e-01 4.121034638774260794e-01
++2.065989175964332847e-01 2.035163285945146838e-01 4.186611530978023854e-01
++2.089769981124778853e-01 2.065792251897101139e-01 4.252032229400294350e-01
++2.112968541690966595e-01 2.096575161864902004e-01 4.317649751357993670e-01
++2.135580062034990179e-01 2.127534028876823524e-01 4.383374070580626225e-01
++2.157654857120719361e-01 2.158705959834085197e-01 4.448946358553702574e-01
++2.179027467031688925e-01 2.190056896370822792e-01 4.514821666358075913e-01
++2.199801557481101399e-01 2.221640817576028826e-01 4.580565150394946827e-01
++2.219970327313536274e-01 2.253470663668500351e-01 4.646129330923238210e-01
++2.239359400161920477e-01 2.285528452407099564e-01 4.711900504070519191e-01
++2.258093253298022463e-01 2.317859657097744996e-01 4.777445723729306093e-01
++2.276150386234590539e-01 2.350474802331274371e-01 4.842749179389621017e-01
++2.293411129842480300e-01 2.383375691596468227e-01 4.908001225098672093e-01
++2.309905102772738528e-01 2.416584626823640725e-01 4.973037406011600603e-01
++2.325653899945122616e-01 2.450118207268658921e-01 5.037733153263704855e-01
++2.340634217066668299e-01 2.483988011172711396e-01 5.102061969115925244e-01
++2.354739391855478203e-01 2.518205609488499142e-01 5.166133649735229483e-01
++2.368010268106580107e-01 2.552786891057904350e-01 5.229787612622226467e-01
++2.380459056014049835e-01 2.587743537954566575e-01 5.292929958163873350e-01
++2.392069166726323859e-01 2.623086175634496420e-01 5.355517448643010159e-01
++2.402826487140223288e-01 2.658824888638082751e-01 5.417502762699162311e-01
++2.412690379036540600e-01 2.694971451746652202e-01 5.478870668064361737e-01
++2.421646534827242569e-01 2.731536075359688454e-01 5.539567283353189486e-01
++2.429737663975502504e-01 2.768521950965758815e-01 5.599478852923390759e-01
++2.436964271327693443e-01 2.805934002738960653e-01 5.658549936523274981e-01
++2.443331406488099544e-01 2.843775500649446952e-01 5.716723986670918523e-01
++2.448849019911867875e-01 2.882047861966390290e-01 5.773944132373918237e-01
++2.453532261044997220e-01 2.920750479307156477e-01 5.830154006066263772e-01
++2.457401707423141346e-01 2.959880581924350662e-01 5.885298594478888257e-01
++2.460483514874983180e-01 2.999433136125404520e-01 5.939325092217595525e-01
++2.462809480744551638e-01 3.039400789577370587e-01 5.992183735671519074e-01
++2.464417014302806019e-01 3.079773862803035778e-01 6.043828594654379049e-01
++2.465349011179689409e-01 3.120540389489538935e-01 6.094218299971551067e-01
++2.465653631589233563e-01 3.161686205399514837e-01 6.143316686920637926e-01
++2.465383985194727345e-01 3.203195083804638021e-01 6.191093337508785099e-01
++2.464597728499572371e-01 3.245048913568406301e-01 6.237524007769893464e-01
++2.463356583484295759e-01 3.287227914401089635e-01 6.282590930787467220e-01
++2.461725788681820570e-01 3.329710882494058555e-01 6.326282990625464731e-01
++2.459773495859159942e-01 3.372475458788758984e-01 6.368595767065934332e-01
++2.457570126857825388e-01 3.415498411593856920e-01 6.409531455573861392e-01
++2.455187705883344895e-01 3.458755925146314025e-01 6.449098671004442895e-01
++2.452699182619971774e-01 3.502223885999685149e-01 6.487312147029243858e-01
++2.450177761015216449e-01 3.545878159769456084e-01 6.524192345935843074e-01
++2.447696247503935441e-01 3.589694851701816236e-01 6.559764995268344556e-01
++2.445326430925611194e-01 3.633650545677170052e-01 6.594060568707836856e-01
++2.443138504548736933e-01 3.677722517524962265e-01 6.627113728687089589e-01
++2.441200538578628954e-01 3.721888919827969766e-01 6.658962747586536501e-01
++2.439578009410017234e-01 3.766128936655925852e-01 6.689648923098728828e-01
++2.438333389800677597e-01 3.810422907829071337e-01 6.719216001624749302e-01
++2.437527166088169217e-01 3.854752048525493247e-01 6.747709927211151815e-01
++2.437215868067584834e-01 3.899098965838322384e-01 6.775178104933975431e-01
++2.437449691034339061e-01 3.943448306666547665e-01 6.801668228779059744e-01
++2.438275942988586409e-01 3.987785785872524635e-01 6.827228592773180171e-01
++2.439737834704199804e-01 4.032098481987659855e-01 6.851907482426946583e-01
++2.441874434968405727e-01 4.076374812199010655e-01 6.875752826204606372e-01
++2.444720671645514987e-01 4.120604493040472271e-01 6.898811893971661391e-01
++2.448307373736109405e-01 4.164778489638755743e-01 6.921131040949622948e-01
++2.452661349520961487e-01 4.208888956165576789e-01 6.942755494834951246e-01
++2.457805495927352646e-01 4.252929169900244166e-01 6.963729183108620102e-01
++2.463758934401020784e-01 4.296893461032649797e-01 6.984094597147249006e-01
++2.470537168787759197e-01 4.340777140051458871e-01 7.003892689515083259e-01
++2.478152261001809742e-01 4.384576424279668649e-01 7.023162800736911793e-01
++2.486613020564674703e-01 4.428288364849563008e-01 7.041942611893784454e-01
++2.495925204424470634e-01 4.471910775158167151e-01 7.060268119517866259e-01
++2.506091723801374682e-01 4.515442161617032046e-01 7.078173629464002969e-01
++2.517112855138260996e-01 4.558881657309074575e-01 7.095691766682096224e-01
++2.528986452564736531e-01 4.602228958990267071e-01 7.112853498087290394e-01
++2.541708159598920491e-01 4.645484267725444316e-01 7.129688166009963135e-01
++2.555271618114321464e-01 4.688648233323279846e-01 7.146223529992972168e-01
++2.569668672886404326e-01 4.731721902633665988e-01 7.162485814980906751e-01
++2.584889570301312500e-01 4.774706671689665227e-01 7.178499764208978728e-01
++2.600923150060586719e-01 4.817604241612176152e-01 7.194288695343957762e-01
++2.617757028946650633e-01 4.860416578147523370e-01 7.209874558653309728e-01
++2.635377775926647237e-01 4.903145874672710236e-01 7.225277996180770046e-01
++2.653771078065290112e-01 4.945794518478790480e-01 7.240518401086443179e-01
++2.672921896891591875e-01 4.988365060127348261e-01 7.255613976468211490e-01
++2.692814615020625024e-01 5.030860185666778950e-01 7.270581793119333947e-01
++2.713433172968592322e-01 5.073282691492603247e-01 7.285437845796602918e-01
++2.734761196220429347e-01 5.115635461637654258e-01 7.300197107675363561e-01
++2.756782112712242161e-01 5.157921447283394523e-01 7.314873582754417569e-01
++2.779479260979498267e-01 5.200143648290899145e-01 7.329480356046209621e-01
++2.802835989294344965e-01 5.242305096559424227e-01 7.344029641448335255e-01
++2.826835746175559994e-01 5.284408841030631132e-01 7.358532827242095786e-01
++2.851462162701056124e-01 5.326457934167407871e-01 7.373000519204292447e-01
++2.876699127088762631e-01 5.368455419747276691e-01 7.387442581351216786e-01
++2.902530852036724895e-01 5.410404321821302709e-01 7.401868174359758079e-01
++2.928941935330091062e-01 5.452307634699987693e-01 7.416285791730816701e-01
++2.955917414230262996e-01 5.494168313837994866e-01 7.430703293775968721e-01
++2.983442814164117829e-01 5.535989267498891975e-01 7.445127939520038707e-01
++3.011504192226619470e-01 5.577773349090259236e-01 7.459566416621068452e-01
++3.040088176001567444e-01 5.619523350067550105e-01 7.474024869415085703e-01
++3.069181998192390681e-01 5.661241993312904341e-01 7.488508925197547850e-01
++3.098773527540035766e-01 5.702931926901545490e-01 7.503023718855809099e-01
++3.128851296485514188e-01 5.744595718174968502e-01 7.517573915968616127e-01
++3.159404526017212111e-01 5.786235848045079289e-01 7.532163734489466522e-01
++3.190423148119757579e-01 5.827854705458642703e-01 7.546796965130810886e-01
++3.221897826221614136e-01 5.869454581955374506e-01 7.561476990566410317e-01
++3.253819974015382255e-01 5.911037666256608869e-01 7.576206803568952264e-01
++3.286181773003176154e-01 5.952606038824642676e-01 7.590989024200323065e-01
++3.318976189096972118e-01 5.994161666335501293e-01 7.605825916172537227e-01
++3.352196988582024639e-01 6.035706396009887786e-01 7.620719402498039585e-01
++3.385838753729217276e-01 6.077241949749224714e-01 7.635671080549891743e-01
++3.419896898320652912e-01 6.118769918024981047e-01 7.650682236654324786e-01
++3.454367683330621941e-01 6.160291753470886755e-01 7.665753860341149029e-01
++3.489248232981658759e-01 6.201808764128988738e-01 7.680886658381395060e-01
++3.524536551372777216e-01 6.243322106301375518e-01 7.696081068746097875e-01
++3.560231539852872773e-01 6.284832776960781464e-01 7.711337274625911231e-01
++3.596333015286877766e-01 6.326341605674558055e-01 7.726655218657797475e-01
++3.632841729334435055e-01 6.367849245998262742e-01 7.742034617512983941e-01
++3.669759388831845826e-01 6.409356166297031088e-01 7.757474977008770312e-01
++3.707088677332940896e-01 6.450862639955934341e-01 7.772975607916928764e-01
++3.744833277827505080e-01 6.492368734944050646e-01 7.788535642652039126e-01
++3.782997896612683153e-01 6.533874302701627723e-01 7.804154053034927374e-01
++3.821588288242804832e-01 6.575378966326091978e-01 7.819829669338883571e-01
++3.860611281425825880e-01 6.616882108040403887e-01 7.835561200839490370e-01
++3.900074788490647260e-01 6.658383310313947812e-01 7.851343555476577585e-01
++3.939988161696960089e-01 6.699882294160507401e-01 7.867167620565498343e-01
++3.980361943268375668e-01 6.741376428249236108e-01 7.883041180552029514e-01
++4.021207666563880734e-01 6.782863970632155848e-01 7.898962603978111341e-01
++4.062538088695973326e-01 6.824342860499125196e-01 7.914930279577012673e-01
++4.104367215482290221e-01 6.865810701317770492e-01 7.930942653099937178e-01
++4.146710323688317379e-01 6.907264743609855540e-01 7.946998267750712275e-01
++4.189583979456862339e-01 6.948701867544626598e-01 7.963095808534970121e-01
++4.233007615496491849e-01 6.990119462600449252e-01 7.979223720379219342e-01
++4.277003131396773239e-01 7.031514402219964932e-01 7.995369318160842065e-01
++4.321588772737992579e-01 7.072880516513097016e-01 8.011551464379941256e-01
++4.366786594847170133e-01 7.114212963902242226e-01 8.027769966740599950e-01
++4.412619934972313862e-01 7.155506445548852623e-01 8.044025095123854552e-01
++4.459117519235324401e-01 7.196756076604832186e-01 8.060302209280784114e-01
++4.506310977664646500e-01 7.237956107627850910e-01 8.076586979980320269e-01
++4.554220533607292176e-01 7.279097909870729799e-01 8.092910180447286939e-01
++4.602874296132978826e-01 7.320174174690982083e-01 8.109274975540664565e-01
++4.652312929955615961e-01 7.361178015074247849e-01 8.125654680881110314e-01
++4.702567132124945704e-01 7.402100378643735601e-01 8.142058631482380626e-01
++4.753658389170350440e-01 7.442931579112735951e-01 8.158518248191980460e-01
++4.805629989896973986e-01 7.483662565565446512e-01 8.175014285494428545e-01
++4.858519412014848382e-01 7.524283052190463561e-01 8.191547180510726500e-01
++4.912340123610521858e-01 7.564782715855419282e-01 8.208164230788980165e-01
++4.967149567998503934e-01 7.605150334733405959e-01 8.224828836016547795e-01
++5.022958597070651399e-01 7.645375459922270078e-01 8.241590313627700226e-01
++5.079798024989584659e-01 7.685447202464326111e-01 8.258458806918314021e-01
++5.137703056538149848e-01 7.725354056237694333e-01 8.275437918161917539e-01
++5.196672668780889515e-01 7.765087356564679411e-01 8.292580362563429786e-01
++5.256748803701343231e-01 7.804635126371105569e-01 8.309874864714956733e-01
++5.317909415132198170e-01 7.843991695298314637e-01 8.327389435984492438e-01
++5.380183963455860141e-01 7.883146743347385632e-01 8.345120959574837682e-01
++5.443539980151446134e-01 7.922097498034269547e-01 8.363133084981756449e-01
++5.507978944105677011e-01 7.960838061951434064e-01 8.381442735434428970e-01
++5.573464847507825226e-01 7.999368256977259506e-01 8.400099169225816453e-01
++5.639964685183691540e-01 8.037688733081099768e-01 8.419139099857662067e-01
++5.707439504576503619e-01 8.075802108116317823e-01 8.438596871365160457e-01
++5.775827793152761291e-01 8.113715803382598457e-01 8.458518352418533670e-01
++5.845080419432422403e-01 8.151436572177973572e-01 8.478930504633812593e-01
++5.915124079987543748e-01 8.188976525325087907e-01 8.499872730184475644e-01
++5.985892343607183141e-01 8.226347979507546704e-01 8.521371651406997039e-01
++6.057310635784716180e-01 8.263566000070049489e-01 8.543453938014868854e-01
++6.129312041392928068e-01 8.300645419348708920e-01 8.566135671784518291e-01
++6.201810118833709362e-01 8.337606033851390208e-01 8.589441737734759830e-01
++6.274752226888651307e-01 8.374461999354567698e-01 8.613371235909390577e-01
++6.348052546879014990e-01 8.411235111538640785e-01 8.637941988526561810e-01
++6.421662450761786989e-01 8.447940336859747212e-01 8.663146822269915948e-01
++6.495514829538971968e-01 8.484597208451428729e-01 8.688988750843767983e-01
++6.569557263949438175e-01 8.521222755106645508e-01 8.715461474797051578e-01
++6.643745794481599187e-01 8.557832593714448377e-01 8.742554091588357057e-01
++6.718027324561179903e-01 8.594444859176019191e-01 8.770260761340837874e-01
++6.792376399817107169e-01 8.631071655185147407e-01 8.798561771298264444e-01
++6.866744996748753715e-01 8.667730629390760777e-01 8.827449654904524490e-01
++6.941118238786820882e-01 8.704431765687035139e-01 8.856901351703097003e-01
++7.015458707010223671e-01 8.741190620646153153e-01 8.886905723641257415e-01
++7.089754732757992395e-01 8.778016574148082007e-01 8.917440383282461136e-01
++7.163982330943452492e-01 8.814922113687924110e-01 8.948489665590808606e-01
++7.238129051546876580e-01 8.851916892315870866e-01 8.980033539675886800e-01
++7.312183003174410612e-01 8.889010427774228784e-01 9.012052612065797330e-01
++7.386131643998257168e-01 8.926212432189428725e-01 9.044528466250297827e-01
++7.459969493141647146e-01 8.963530775374040083e-01 9.077440285167398537e-01
++7.533688986576650981e-01 9.000973872698678768e-01 9.110768604175860652e-01
++7.607282142588290830e-01 9.038550280130126513e-01 9.144494382489702922e-01
++7.680754104857114850e-01 9.076264985347726189e-01 9.178593407704264129e-01
++7.754086380463782735e-01 9.114129489376284754e-01 9.213050832886523489e-01
++7.827298656902449414e-01 9.152144780056820084e-01 9.247836307542580681e-01
++7.900362445563153813e-01 9.190325332798994218e-01 9.282937907772289554e-01
++7.973305798287271262e-01 9.228669845876559252e-01 9.318320585938411060e-01
++8.046093603619434154e-01 9.267195025159972177e-01 9.353972761089011101e-01
++8.118762521869845594e-01 9.305897288106829146e-01 9.389853083637165199e-01
++8.191262403047088192e-01 9.344798221317863751e-01 9.425952041745783161e-01
++8.263649511242520118e-01 9.383888950299160703e-01 9.462215400179357916e-01
++8.335857899787124659e-01 9.423196480542496145e-01 9.498633823775902707e-01
++8.407925617377357552e-01 9.462718000641171523e-01 9.535152044674145566e-01
++8.479820749115867251e-01 9.502471776949116267e-01 9.571737430642662803e-01
++8.551509499643907830e-01 9.542477482079624318e-01 9.608352118692636834e-01
++8.623025919332756306e-01 9.582735696851335527e-01 9.644920284238761576e-01
++8.694298092423108359e-01 9.623279528450340292e-01 9.681401921277593692e-01
++8.765283703934805271e-01 9.664134798374283131e-01 9.717733036205912223e-01
++8.835932645286533882e-01 9.705331352089504593e-01 9.753839343072715495e-01
++8.906174074108087479e-01 9.746907136098538205e-01 9.789640951138071090e-01
++8.975917485137434593e-01 9.788908041054119602e-01 9.825051528035059212e-01
++9.045013427138774986e-01 9.831399005223971921e-01 9.860005773650694083e-01
++9.113300542301955298e-01 9.874449459956177177e-01 9.894442642623689776e-01
++9.180592960081255249e-01 9.918135358838490179e-01 9.928328638314803944e-01]; 
++
++   case 'rai' % rain
++      RGB = [9.345899218079473103e-01 9.308468535401923649e-01 9.527121598234155053e-01
++9.317427384147130009e-01 9.265559169859566291e-01 9.461412847112190549e-01
++9.288323151212234396e-01 9.222903185306413620e-01 9.397258851930316848e-01
++9.259014656554976908e-01 9.180422099085187027e-01 9.333811647328228434e-01
++9.229490910874459386e-01 9.138118271011793636e-01 9.271087656276950639e-01
++9.199777474389575493e-01 9.095987388769878335e-01 9.209029155030628022e-01
++9.169834318717224875e-01 9.054037550731951489e-01 9.147707495523473842e-01
++9.139687227512254264e-01 9.012264798371935060e-01 9.087060404880972220e-01
++9.109285940266572679e-01 8.970679577253415360e-01 9.027176878689184836e-01
++9.078584183128727281e-01 8.929291295619988800e-01 8.968142426813552337e-01
++9.047531063535361184e-01 8.888107271516731966e-01 8.910081776220351024e-01
++9.016111241776750829e-01 8.847109979588536621e-01 8.853222084733923802e-01
++8.984773600020180551e-01 8.806072441106347348e-01 8.798005863890318023e-01
++8.957156578807984326e-01 8.763733055795923654e-01 8.742439953591307766e-01
++8.934429895784954390e-01 8.720376849990935098e-01 8.679132827136474271e-01
++8.911862289430210193e-01 8.677553071034195264e-01 8.611451293770118198e-01
++8.889359451831089221e-01 8.635014856893418189e-01 8.542095914675652546e-01
++8.867116938006094351e-01 8.592609509355686459e-01 8.471741066544885568e-01
++8.845266087736632921e-01 8.550269405833543779e-01 8.400488385945689140e-01
++8.823737459191345334e-01 8.507991274319443020e-01 8.328611900775441113e-01
++8.802551767793974635e-01 8.465759973509723313e-01 8.256144073735601774e-01
++8.781723156295014876e-01 8.423565112404021171e-01 8.183096182593350143e-01
++8.761185057025142608e-01 8.381415609718929627e-01 8.109618862038079357e-01
++8.740930473614691998e-01 8.339308508975332712e-01 8.035739688319240015e-01
++8.720952068860511330e-01 8.297241543120810192e-01 7.961481162736230299e-01
++8.701280658536796331e-01 8.255204305809771270e-01 7.886787238448926818e-01
++8.681860361945246130e-01 8.213205960844648379e-01 7.811769076946536439e-01
++8.662688819092574377e-01 8.171244030607883735e-01 7.736431720476375506e-01
++8.643746025935312716e-01 8.129320197586197283e-01 7.660813810727764572e-01
++8.625034879855904002e-01 8.087431068747142904e-01 7.584907829855329631e-01
++8.606546147206539654e-01 8.045576097831967921e-01 7.508729509413730741e-01
++8.588266729702948021e-01 8.003755742930238615e-01 7.432301838409289818e-01
++8.569623869913148839e-01 7.962191366375533930e-01 7.355859431728856146e-01
++8.550504938518290743e-01 7.920970771858082404e-01 7.278998746292554278e-01
++8.530849581648412006e-01 7.880123772917803082e-01 7.201683837184543746e-01
++8.510553489556228479e-01 7.839691860217244956e-01 7.123959661845170599e-01
++8.489330228346508855e-01 7.799787143731991002e-01 7.045972788504087925e-01
++8.467217087867040526e-01 7.760402896946996254e-01 6.967642500138357953e-01
++8.444094675146763818e-01 7.721590919106836592e-01 6.888992560450724056e-01
++8.419826946126204303e-01 7.683408791881058963e-01 6.810067521686843373e-01
++8.393858369850137890e-01 7.646065720377731578e-01 6.731281946153443441e-01
++8.366346261960659891e-01 7.609512703952114876e-01 6.652451363576846743e-01
++8.336844747046829873e-01 7.573915193569474846e-01 6.573955009267002936e-01
++8.305100496696308232e-01 7.539367518776275423e-01 6.496025429014220531e-01
++8.270795595522559829e-01 7.505979386186598656e-01 6.419039537235261550e-01
++8.233795339766563082e-01 7.473786068829111340e-01 6.343290132703457429e-01
++8.193527781515338448e-01 7.442973494709732574e-01 6.269543660928612594e-01
++8.150187381418861898e-01 7.413436869430644061e-01 6.197992186956774452e-01
++8.103671933740643762e-01 7.385171999523609809e-01 6.129154791955783166e-01
++8.053792270659873020e-01 7.358201042585071905e-01 6.063662921639977332e-01
++8.001091487009975856e-01 7.332281055474541009e-01 6.001460682932164836e-01
++7.945789023747689139e-01 7.307291829728559396e-01 5.942715305031909256e-01
++7.888006960769626819e-01 7.283155171589156263e-01 5.887591680450797726e-01
++7.828500773466386953e-01 7.259575374530320424e-01 5.835578074632412626e-01
++7.767061505166655833e-01 7.236609437130246958e-01 5.786949863565322705e-01
++7.704515166608618681e-01 7.213952841209190225e-01 5.740985082128049477e-01
++7.640735967706561160e-01 7.191644341873529855e-01 5.697767469661422224e-01
++7.576101573082332230e-01 7.169548408227417458e-01 5.656900597267850994e-01
++7.510868163729491620e-01 7.147576249864890929e-01 5.618076267722970085e-01
++7.445073291928260284e-01 7.125716412063957117e-01 5.581177337866775057e-01
++7.378726341804960898e-01 7.103967525656292858e-01 5.546105609434751615e-01
++7.312079622811540336e-01 7.082247740235839695e-01 5.512528292120718598e-01
++7.245223864166319139e-01 7.060527915800670629e-01 5.480303444985812344e-01
++7.178179126910454455e-01 7.038807344069457628e-01 5.449299707841194218e-01
++7.111005957174848513e-01 7.017068393561574080e-01 5.419396078954504814e-01
++7.043748082863551252e-01 6.995299965106114293e-01 5.390480504976655762e-01
++6.976428841540770476e-01 6.973498542230505137e-01 5.362451349156007741e-01
++6.909082389019516324e-01 6.951656049847189101e-01 5.335213672589386169e-01
++6.841729694681116802e-01 6.929769158960692454e-01 5.308681129719833303e-01
++6.774389689374403778e-01 6.907834967201277321e-01 5.282774232028493167e-01
++6.707084440130518521e-01 6.885849153944831880e-01 5.257418638258782861e-01
++6.639830918601468124e-01 6.863809064730829190e-01 5.232546086946955333e-01
++6.572628938239016838e-01 6.841717926007404582e-01 5.208097057295569821e-01
++6.505310175956583452e-01 6.819627798840676158e-01 5.184181252103758908e-01
++6.438052208637921048e-01 6.797486679084566719e-01 5.160591646972285673e-01
++6.370832823378153043e-01 6.775304469295674314e-01 5.137285370282342889e-01
++6.303705085075785863e-01 6.753064791862326555e-01 5.114205507376848869e-01
++6.236618961603839217e-01 6.730786409287115024e-01 5.091324121853675333e-01
++6.169335288716588650e-01 6.708537547863058226e-01 5.068827462564762243e-01
++6.102104324218552422e-01 6.686246254359063945e-01 5.046462757174120517e-01
++6.034898306929903367e-01 6.663922665431509795e-01 5.024201930501221991e-01
++5.967676345670763771e-01 6.641578140003113750e-01 5.002054482667135371e-01
++5.900234330755329548e-01 6.619267690502547152e-01 4.980175294001410458e-01
++5.832786395653163369e-01 6.596933136673572839e-01 4.958328661006338733e-01
++5.765340663187056292e-01 6.574571405303393234e-01 4.936489952759946509e-01
++5.697582662671993869e-01 6.552266499575032377e-01 4.914884851056534054e-01
++5.629730101905379147e-01 6.529958318145387963e-01 4.893302200215370878e-01
++5.561847270851512093e-01 6.507627829419350141e-01 4.871678208383450337e-01
++5.493551097307179942e-01 6.485375215149538075e-01 4.850265872147694890e-01
++5.425256305514831734e-01 6.463076874918682879e-01 4.828887171920029364e-01
++5.356612977693596678e-01 6.440835181737865067e-01 4.807599721985225671e-01
++5.287922197832997107e-01 6.418536560641270317e-01 4.786600904179345028e-01
++5.218850344197893953e-01 6.396291731218471943e-01 4.765733407479101902e-01
++5.149376539505706729e-01 6.374099915253575999e-01 4.745006244225868364e-01
++5.079766080089844760e-01 6.351862479551418916e-01 4.724595195428232253e-01
++5.009755431565769968e-01 6.329662155198152451e-01 4.704378162646060679e-01
++4.939285311779693655e-01 6.307509252620584483e-01 4.684356727521749586e-01
++4.868490205117793068e-01 6.285349533886431805e-01 4.664642845323079823e-01
++4.797346535241335252e-01 6.263183759111613513e-01 4.645235778249863778e-01
++4.725684462540446495e-01 6.241056609282084056e-01 4.626084796977160685e-01
++4.653487483821732718e-01 6.218962626011749206e-01 4.607211778296827487e-01
++4.580958304602617548e-01 6.196828431511897106e-01 4.588752179328909331e-01
++4.507924598809112671e-01 6.174698402959368781e-01 4.570641185207933721e-01
++4.434287999890613730e-01 6.152589986197224414e-01 4.552877084880677105e-01
++4.360045483020283386e-01 6.130492733714320019e-01 4.535480340189612103e-01
++4.285254867993349426e-01 6.108377350391323013e-01 4.518515677783579432e-01
++4.209986373257934011e-01 6.086212623350139017e-01 4.502044135688367255e-01
++4.134050226321455135e-01 6.064040523424363283e-01 4.486012173551829352e-01
++4.057442294957287476e-01 6.041849412176459877e-01 4.470442374703665345e-01
++3.980103804981384719e-01 6.019638983605486438e-01 4.455375274544488007e-01
++3.902063406549050040e-01 5.997389567937310151e-01 4.440824403586798308e-01
++3.823330219069303038e-01 5.975084478594807624e-01 4.426827692274404313e-01
++3.743994820234466392e-01 5.952685939479632760e-01 4.413464089373288490e-01
++3.663895342858319859e-01 5.930221303804210642e-01 4.400695063624517345e-01
++3.583027331816978078e-01 5.907676584219552218e-01 4.388545840675231458e-01
++3.501387968837356146e-01 5.885037242420276815e-01 4.377041322664636525e-01
++3.418974318117430355e-01 5.862288538856508247e-01 4.366206692939140765e-01
++3.335788357145262895e-01 5.839414671596280249e-01 4.356065575056938810e-01
++3.251833166933908448e-01 5.816399536413853211e-01 4.346641338993996184e-01
++3.167127839080131069e-01 5.793224392963164382e-01 4.337951239114763990e-01
++3.081690890879107969e-01 5.769870856598143805e-01 4.330012470667766733e-01
++2.995554017471688812e-01 5.746318865559506550e-01 4.322836619258556556e-01
++2.908749326626684506e-01 5.722548869131893756e-01 4.316434590630243706e-01
++2.821317603555529852e-01 5.698540727656976612e-01 4.310813189213763552e-01
++2.733327132702973450e-01 5.674271544637526921e-01 4.305966557525391369e-01
++2.644844543662756564e-01 5.649720080402284017e-01 4.301888298931589305e-01
++2.555934335426425785e-01 5.624866759386734083e-01 4.298572085857526592e-01
++2.466705752105852745e-01 5.599688410786282100e-01 4.295989836123562111e-01
++2.377250969065505815e-01 5.574166090031631438e-01 4.294119794031988069e-01
++2.287974288505327247e-01 5.548237349096721838e-01 4.292976581628650257e-01
++2.198778468774868489e-01 5.521921840191843511e-01 4.292473634163982976e-01
++2.109782428379559649e-01 5.495207384038700571e-01 4.292558006274433957e-01
++2.021129920761091103e-01 5.468081421831656463e-01 4.293174959448664008e-01
++1.932970840289524594e-01 5.440534055393755342e-01 4.294264526279761851e-01
++1.845458994968318112e-01 5.412558313792091846e-01 4.295762645205056240e-01
++1.758747242186788073e-01 5.384150471574241648e-01 4.297604082769522771e-01
++1.672992650076766952e-01 5.355309682751767664e-01 4.299719066013750202e-01
++1.588637533307953875e-01 5.326007152638789766e-01 4.302077664091210063e-01
++1.505683016211286918e-01 5.296267950764182997e-01 4.304586487604788458e-01
++1.424122559523727238e-01 5.266116064108816719e-01 4.307170632116699704e-01
++1.344085890794944338e-01 5.235562755642496624e-01 4.309766346935359205e-01
++1.265690627070247265e-01 5.204621553185740934e-01 4.312317121888489257e-01
++1.189042023704675322e-01 5.173307669769749984e-01 4.314776038001592595e-01
++1.114246335252623010e-01 5.141637863856259871e-01 4.317091179175960858e-01
++1.041396630107440102e-01 5.109629971472293697e-01 4.319221604647225932e-01
++9.705780332103111641e-02 5.077302369436778040e-01 4.321134999997184867e-01
++9.018737534593762595e-02 5.044674058535019157e-01 4.322799148264460101e-01
++8.353621797943017180e-02 5.011764305824176757e-01 4.324186435951988816e-01
++7.711177607780977938e-02 4.978592446938872595e-01 4.325273326417442554e-01
++7.092118659398483071e-02 4.945177606318418850e-01 4.326041097483195319e-01
++6.497112946544478240e-02 4.911539160136639270e-01 4.326469613219918742e-01
++5.926836252985791947e-02 4.877695081001428012e-01 4.326551664213393877e-01
++5.381952845223608034e-02 4.843663141865421351e-01 4.326279059471102584e-01
++4.863121397792258965e-02 4.809460446320443228e-01 4.325646545440974822e-01
++4.370962682231178259e-02 4.775103648435110038e-01 4.324649641775900610e-01
++3.905112341714592900e-02 4.740608794693825234e-01 4.323285604649402813e-01
++3.496888770654411893e-02 4.705940487017962748e-01 4.321582669839647561e-01
++3.143475353593022659e-02 4.671148853349996188e-01 4.319569510186779815e-01
++2.822939081579376591e-02 4.636310861634273528e-01 4.317228454236091695e-01
++2.532316922257733458e-02 4.601429344885760719e-01 4.314611817794063997e-01
++2.271621196496529868e-02 4.566502451321696188e-01 4.311704916368828688e-01
++2.041021909707332535e-02 4.531526976651161776e-01 4.308500436842361836e-01
++1.840750332198089895e-02 4.496499166924270985e-01 4.304993286811824582e-01
++1.672948316457980103e-02 4.461408970806849950e-01 4.301165746135667267e-01
++1.538958862814012937e-02 4.426249994353490536e-01 4.296990539873294934e-01
++1.435413070644788770e-02 4.391028750771387434e-01 4.292495981309878972e-01
++1.362474263231045098e-02 4.355741563391084537e-01 4.287674174473046218e-01
++1.320277209836126682e-02 4.320384817616971795e-01 4.282516463471394697e-01
++1.308981022524788491e-02 4.284954582700414294e-01 4.277015087056333931e-01
++1.328604261598065328e-02 4.249447744648222614e-01 4.271158498149437155e-01
++1.379162556189269216e-02 4.213861028127094399e-01 4.264935743343106211e-01
++1.460601943539846688e-02 4.178191447440461337e-01 4.258334705527410113e-01
++1.572829683901560624e-02 4.142436086986017174e-01 4.251343095806048300e-01
++1.715690277980158954e-02 4.106592256461835122e-01 4.243947975574930975e-01
++1.888987211594707338e-02 4.070657340951429060e-01 4.236136390627659454e-01
++2.092392860184388512e-02 4.034629389123669529e-01 4.227893563025114654e-01
++2.325551642690237841e-02 3.998506428553240677e-01 4.219205349032726371e-01
++2.587976864011615197e-02 3.962287140215077774e-01 4.210056239775798459e-01
++2.879190433075056593e-02 3.925969951003727698e-01 4.200432223313694258e-01
++3.198535565039070661e-02 3.889554251322902556e-01 4.190317351172953564e-01
++3.545196060096311025e-02 3.853040266354982313e-01 4.179694561300110189e-01
++3.918323414610008770e-02 3.816428245764514893e-01 4.168548033419602339e-01
++4.307413522281567514e-02 3.779718375548203335e-01 4.156863315515785251e-01
++4.697176598438539824e-02 3.742911911603020725e-01 4.144624688814931845e-01
++5.086969232374114608e-02 3.706011159074634187e-01 4.131815676575790186e-01
++5.475506718563923764e-02 3.669018229746837667e-01 4.118421970922833131e-01
++5.861718450656796392e-02 3.631935427420149298e-01 4.104430479071176641e-01
++6.244486447080809660e-02 3.594767157385404532e-01 4.089825820635137332e-01
++6.623026614707036575e-02 3.557516605834906143e-01 4.074596950461942813e-01
++6.998642301215993178e-02 3.520178004091850665e-01 4.058682797037249657e-01
++7.368349105094931795e-02 3.482766831924774542e-01 4.042119944889063232e-01
++7.731558236370641990e-02 3.445288253637411868e-01 4.024900881431115462e-01
++8.087676210173380675e-02 3.407748586458358986e-01 4.007018083483494530e-01
++8.436223121714692130e-02 3.370153951525706182e-01 3.988466436336530196e-01
++8.776750670667690657e-02 3.332510976549885595e-01 3.969242240138116662e-01
++9.108869400118912996e-02 3.294826406371675898e-01 3.949343703704463748e-01
++9.432201977980475549e-02 3.257107550258697137e-01 3.928770441587735585e-01
++9.746469555428810549e-02 3.219361155964274857e-01 3.907524596946260753e-01
++1.005137065660947904e-01 3.181594785366577693e-01 3.885609392070024093e-01
++1.034667829102825787e-01 3.143815541170876804e-01 3.863030299565164416e-01
++1.063234262084384596e-01 3.106029224571804637e-01 3.839789892033815266e-01
++1.090886774331554510e-01 3.068237947954853828e-01 3.815863917579840892e-01
++1.117516829166099457e-01 3.030455295972052654e-01 3.791303642957770670e-01
++1.143116567201993838e-01 2.992687663919490482e-01 3.766121406045498943e-01
++1.167670145114603486e-01 2.954942819265780063e-01 3.740330281243106070e-01
++1.191180972380510850e-01 2.917225736922783308e-01 3.713945692144456912e-01
++1.213648735453208283e-01 2.879541937006656616e-01 3.686983734293431958e-01
++1.235072626972245069e-01 2.841897016932966036e-01 3.659461400710485868e-01
++1.255450172977832790e-01 2.804296856157670326e-01 3.631396556775801088e-01
++1.274793353662031781e-01 2.766744826581494787e-01 3.602808188600382100e-01
++1.293108779906596839e-01 2.729245043006408022e-01 3.573715653564341621e-01
++1.310404714307908669e-01 2.691801184313953876e-01 3.544138839210129732e-01
++1.326690608188904053e-01 2.654416544155482338e-01 3.514098053356367601e-01
++1.341977870856449484e-01 2.617093858425083575e-01 3.483613905337877847e-01
++1.356276601953987637e-01 2.579835900091309586e-01 3.452707288070074876e-01
++1.369600353052619901e-01 2.542644558590421155e-01 3.421399178935836116e-01
++1.381965371841252788e-01 2.505520924183904374e-01 3.389710465513224302e-01
++1.393387446776407912e-01 2.468465884786986142e-01 3.357661977904279893e-01
++1.403881322096931505e-01 2.431480256484742086e-01 3.325274517113971373e-01
++1.413463644264434660e-01 2.394564173026069165e-01 3.292568607367298839e-01
++1.422150204492807768e-01 2.357717647764656088e-01 3.259564633033559256e-01
++1.430241411872627821e-01 2.320878753057155075e-01 3.226241875019154048e-01
++1.437206808568328997e-01 2.284105260214233102e-01 3.193108148264102164e-01
++1.443167183567656553e-01 2.247376722352139033e-01 3.160160321612740519e-01
++1.448172234122950819e-01 2.210687136739122871e-01 3.127401980544551319e-01
++1.452270337553944191e-01 2.174029799543943375e-01 3.094836465796388381e-01
++1.455503303753529210e-01 2.137398650159642033e-01 3.062467330039463920e-01
++1.457916124736327868e-01 2.100785929129088681e-01 3.030297495827782850e-01
++1.459553844105018761e-01 2.064182886269750883e-01 2.998329600953320573e-01
++1.460450738341802501e-01 2.027582683855788659e-01 2.966566757283218836e-01
++1.460639705951699008e-01 1.990978105534875198e-01 2.935011720342979302e-01
++1.460132039806032178e-01 1.954367333080272440e-01 2.903667875231270012e-01
++1.458975819392981654e-01 1.917737643090239308e-01 2.872535927880979223e-01
++1.457218019293262112e-01 1.881075422549224607e-01 2.841616643549851884e-01
++1.454887645921259243e-01 1.844371298576089335e-01 2.810911343097461934e-01
++1.452032543446299950e-01 1.807609202544633309e-01 2.780420590388025248e-01
++1.448676044101755434e-01 1.770779511005421691e-01 2.750145417929056313e-01
++1.444780219943526678e-01 1.733892008568175547e-01 2.720086027887532176e-01
++1.440413431328422811e-01 1.696921848838350289e-01 2.690241039839223469e-01
++1.435643975093518765e-01 1.659841914110155581e-01 2.660610427935709565e-01
++1.430436238988290198e-01 1.622659427289601941e-01 2.631191819624335571e-01
++1.424820569142489501e-01 1.585358695252926109e-01 2.601982981359077240e-01
++1.418869430340855831e-01 1.547906985932924473e-01 2.572984244859990999e-01
++1.412504255878399562e-01 1.510326235840303566e-01 2.544186879929528633e-01
++1.405847553781910952e-01 1.472562100690701925e-01 2.515594367076940396e-01
++1.398866955406879442e-01 1.434617145934828086e-01 2.487199683062358835e-01
++1.391555552990901834e-01 1.396484041206631221e-01 2.458995874149805250e-01
++1.383972370289156262e-01 1.358126929549585971e-01 2.430982825013351944e-01
++1.376119899169210015e-01 1.319530974585303440e-01 2.403154706816485464e-01
++1.368012914537950486e-01 1.280674462139133607e-01 2.375506853082148262e-01
++1.359688085852648887e-01 1.241523347647442155e-01 2.348038243218179000e-01
++1.351079666263714507e-01 1.202088638287985289e-01 2.320731097859522474e-01
++1.342294527149119343e-01 1.162298274455028368e-01 2.293596493763065958e-01
++1.333340174081290574e-01 1.122121767595207487e-01 2.266630565550546428e-01
++1.324249399956005380e-01 1.081511805079039545e-01 2.239835024348004189e-01
++1.315721561940036699e-01 1.040055590640546201e-01 2.213363669373892839e-01];
++
++   case {'dem','top'} % dem or topo
++      RGB = [1.561019746507273376e-01 1.026082525875711138e-01 1.727215696232307918e-01
++1.614878059346168959e-01 1.086331782717616379e-01 1.834416540200605461e-01
++1.668117590877864764e-01 1.145994139402238821e-01 1.942594655847655616e-01
++1.720703275074147443e-01 1.205129174047056828e-01 2.051860710532931176e-01
++1.772595702951434704e-01 1.263792859047284667e-01 2.162309361702130506e-01
++1.823751828761793481e-01 1.322038111876145949e-01 2.274020989868827392e-01
++1.874125186315797886e-01 1.379915476831030108e-01 2.387062880680187460e-01
++1.923665760685599468e-01 1.437473901381048913e-01 2.501489823140411461e-01
++1.972319620276792862e-01 1.494761585027865047e-01 2.617344119314569673e-01
++2.020028382233076125e-01 1.551826890051333785e-01 2.734655011163185101e-01
++2.066728560428846562e-01 1.608719311731062473e-01 2.853437530392856081e-01
++2.112350828916275125e-01 1.665490510713014960e-01 2.973690772834624574e-01
++2.156819223383368844e-01 1.722195412332822306e-01 3.095395593647118360e-01
++2.200027865362182422e-01 1.778889096627078448e-01 3.218593457818205161e-01
++2.241821302892643142e-01 1.835626593748518609e-01 3.343431537784405938e-01
++2.282155151615900546e-01 1.892493734782149939e-01 3.469585312854190362e-01
++2.320913707908846546e-01 1.949572807641995476e-01 3.596924727656225507e-01
++2.357791582066215419e-01 2.006936504843463420e-01 3.725810406048237766e-01
++2.392760085101002243e-01 2.064712127546999287e-01 3.855616338648150121e-01
++2.425474613143962510e-01 2.123011804696942062e-01 3.986531809377649171e-01
++2.455817950644241798e-01 2.181991605590304917e-01 4.117955160707330586e-01
++2.483306606950595463e-01 2.241817667402334346e-01 4.250033167249620547e-01
++2.507721436866522935e-01 2.302701237479483076e-01 4.382036814126420432e-01
++2.528659964243425984e-01 2.364882912834416206e-01 4.513446141213755536e-01
++2.545675711557803811e-01 2.428643843006248471e-01 4.643557571030281772e-01
++2.558322794870629413e-01 2.494300496133808887e-01 4.771399728195321877e-01
++2.566151212870083631e-01 2.562195453869526296e-01 4.895770754997314511e-01
++2.568729082739400482e-01 2.632680806498599591e-01 5.015251413221865073e-01
++2.566051651711689918e-01 2.706008890121900934e-01 5.127963599343589030e-01
++2.558254018044066047e-01 2.782328077909240194e-01 5.232189983935346955e-01
++2.545978636988186494e-01 2.861560770732184955e-01 5.326370186681820273e-01
++2.530378388279626023e-01 2.943355684042912035e-01 5.409499814033098541e-01
++2.512817651002536290e-01 3.027167370222472731e-01 5.481422664464320471e-01
++2.494682375867288693e-01 3.112353605277175528e-01 5.542766318947622839e-01
++2.477157002362878613e-01 3.198299095156284522e-01 5.594704462476630669e-01
++2.461121481740833894e-01 3.284495884603169102e-01 5.638648470620498676e-01
++2.447220255685461088e-01 3.370546900675063240e-01 5.676029832475817383e-01
++2.435790408918375727e-01 3.456199709880173332e-01 5.708127541670769967e-01
++2.426978313653707087e-01 3.541305556383861908e-01 5.736016010478480753e-01
++2.420946965383475313e-01 3.625739944720036134e-01 5.760653956197256953e-01
++2.417595622535183009e-01 3.709493751547713325e-01 5.782729391945388153e-01
++2.416897018162703636e-01 3.792548337300427064e-01 5.802858143751018494e-01
++2.418784445905285962e-01 3.874910027793410650e-01 5.821542521747482546e-01
++2.423091294682429564e-01 3.956627542073260506e-01 5.839131390484204598e-01
++2.429695407602900925e-01 4.037738393736669540e-01 5.855939512690606641e-01
++2.438461792188084676e-01 4.118287207942545325e-01 5.872218507211212080e-01
++2.449256139784778408e-01 4.198319765418777605e-01 5.888176525512366366e-01
++2.461926332303804310e-01 4.277888629705645096e-01 5.903967722170088139e-01
++2.476314436738927260e-01 4.357048438328084417e-01 5.919706842419948378e-01
++2.492275176071283571e-01 4.435849323073600692e-01 5.935491293785424283e-01
++2.509665668417216944e-01 4.514340415062205181e-01 5.951395103673859932e-01
++2.528346862021874641e-01 4.592569393176054171e-01 5.967472668238706923e-01
++2.548184740794410263e-01 4.670582183399953347e-01 5.983761730113198452e-01
++2.569051367797046126e-01 4.748422758923547815e-01 6.000285749995881712e-01
++2.590825816132030779e-01 4.826133005480903182e-01 6.017055804809932074e-01
++2.613396987489819967e-01 4.903751992421883643e-01 6.034074237284018372e-01
++2.636659810857353015e-01 4.981317406526836744e-01 6.051330956906521008e-01
++2.660516582874621339e-01 5.058865272594796902e-01 6.068805013837572648e-01
++2.684882380171457750e-01 5.136428405367017280e-01 6.086470522439324515e-01
++2.709683308416185876e-01 5.214037172983150281e-01 6.104294711750373192e-01
++2.734857257205313141e-01 5.291719440816851083e-01 6.122238564648385672e-01
++2.760354668808263079e-01 5.369500509042623992e-01 6.140257392505246159e-01
++2.786139324558262742e-01 5.447403043452749838e-01 6.158301364812402978e-01
++2.812189151446758406e-01 5.525446999518639490e-01 6.176316008625786225e-01
++2.838497050469647731e-01 5.603649539888247988e-01 6.194242689076802089e-01
++2.865071747347951447e-01 5.682024945496734203e-01 6.212019079466474247e-01
++2.891935293105973304e-01 5.760585509806988025e-01 6.229575870601862242e-01
++2.919132661023912667e-01 5.839338872257091584e-01 6.246846842638799080e-01
++2.946726143633343065e-01 5.918289843891730850e-01 6.263762188290394883e-01
++2.974797079780254205e-01 5.997440045832753697e-01 6.280249877540684533e-01
++3.003447193279823457e-01 6.076787658883653354e-01 6.296236627075371128e-01
++3.032799496578738041e-01 6.156327286641396501e-01 6.311648425953061414e-01
++3.062999162775806861e-01 6.236049805794583456e-01 6.326411091031564071e-01
++3.094214341373541788e-01 6.315942201545601264e-01 6.340450861601970578e-01
++3.126636885203824545e-01 6.395987386132337971e-01 6.353695045172913503e-01
++3.160482946464280851e-01 6.476163998706647718e-01 6.366072729215248582e-01
++3.195993388733257556e-01 6.556446185422359907e-01 6.377515576836865208e-01
++3.233433949344308722e-01 6.636803359579184214e-01 6.387958727683986648e-01
++3.273095072934468774e-01 6.717199943156246800e-01 6.397341828681051279e-01
++3.315291322901112725e-01 6.797595093162658308e-01 6.405610222271946874e-01
++3.360351011011302735e-01 6.877945827659479594e-01 6.412695960850323118e-01
++3.408640318201912600e-01 6.958197818437616977e-01 6.418569321473704958e-01
++3.460540467004642462e-01 7.038291754672099110e-01 6.423205839967465192e-01
++3.516446005650431528e-01 7.118162697085735902e-01 6.426589560156208414e-01
++3.576762479926827720e-01 7.197739138067411613e-01 6.428719883285997083e-01
++3.641894512092864744e-01 7.276949011320993366e-01 6.429557270674552960e-01
++3.712266123106295335e-01 7.355700686179795778e-01 6.429189618774799886e-01
++3.788278449989629926e-01 7.433902546660990929e-01 6.427683061328856029e-01
++3.870322615152646528e-01 7.511462095764531721e-01 6.425055472082883412e-01
++3.958750262046074608e-01 7.588270315806920907e-01 6.421508285001665817e-01
++4.053883482522956383e-01 7.664223146281371468e-01 6.417151578859574546e-01
++4.155968407812616339e-01 7.739210344346504344e-01 6.412227317683711902e-01
++4.265195639210723755e-01 7.813124732411278472e-01 6.406960731925235297e-01
++4.381634653667463852e-01 7.885863788123392837e-01 6.401694292235835526e-01
++4.505287643111087204e-01 7.957333261733031682e-01 6.396742566585853496e-01
++4.635986539031755060e-01 8.027456073395251579e-01 6.392548734619343254e-01
++4.773469739538908629e-01 8.096172922533247940e-01 6.389538165444101914e-01
++4.917330703220189059e-01 8.163450533427777378e-01 6.388184799685107107e-01
++5.067050118087177424e-01 8.229283397233977393e-01 6.388963162980869637e-01
++5.221997330825246530e-01 8.293697946738645133e-01 6.392346216632595057e-01
++5.381481232862911357e-01 8.356748924828519831e-01 6.398763669277579558e-01
++5.544783665092802849e-01 8.418515860497588488e-01 6.408587965640016870e-01
++5.711115213696185133e-01 8.479112775740021979e-01 6.422171169895777298e-01
++5.879840953182007279e-01 8.538646600753627691e-01 6.439710905713145195e-01
++6.050194699551968425e-01 8.597270135144634562e-01 6.461439080647282118e-01
++6.221681809999368706e-01 8.655099786991408140e-01 6.487403091120448329e-01
++6.393757001353049807e-01 8.712277338509245572e-01 6.517658303256151919e-01
++6.565929334411800822e-01 8.768947704523611941e-01 6.552210497573525139e-01
++6.737933070789577927e-01 8.825213731875580780e-01 6.590961736178440056e-01
++6.909478082204841831e-01 8.881191135591984809e-01 6.633823202371271766e-01
++7.080340865696405084e-01 8.936985513356989763e-01 6.680678941563225059e-01
++7.250358375800118882e-01 8.992691342626382145e-01 6.731393536848668813e-01
++7.419421046029871514e-01 9.048391559449654453e-01 6.785819005039074314e-01
++7.587465580267132026e-01 9.104157595099175992e-01 6.843800748081978469e-01
++7.754467945117471395e-01 9.160049747102424478e-01 6.905182510191696377e-01
++7.920436855303579771e-01 9.216117772405966191e-01 6.969810377273069069e-01
++8.085407925860420564e-01 9.272401607530683654e-01 7.037535913222745521e-01
++8.249438571064254822e-01 9.328932140048489252e-01 7.108218561594963347e-01
++8.412422934868647451e-01 9.385792958890862847e-01 7.181734629573161000e-01
++8.574559441871676402e-01 9.442965454208677167e-01 7.257948454644865821e-01
++8.735986658557798323e-01 9.500445573198598170e-01 7.336747582572585857e-01
++8.896512126622908578e-01 9.558344072358454513e-01 7.418023698547455691e-01
++9.056514559384564178e-01 9.616567079910524063e-01 7.501688017241657791e-01
++9.215850348376466439e-01 9.675205198521025229e-01 7.587646801057830181e-01
++9.374799177499437697e-01 9.734191074102575003e-01 7.675843461643131471e-01
++9.533233708513803029e-01 9.793607550577946297e-01 7.766197776697654209e-01
++9.691488355955474310e-01 9.853357520972024775e-01 7.858697059005903540e-01
++9.849374457410008388e-01 9.913545172197536504e-01 7.953271573982337861e-01
++5.237510688652501772e-02 1.452546228317073418e-01 7.751950190923809214e-02
++5.622628551680566161e-02 1.523457500722602831e-01 8.040279400454641845e-02
++6.007072166263575236e-02 1.593963705834963718e-01 8.324827330002768089e-02
++6.385205670255669763e-02 1.664232541404700172e-01 8.599651952193751447e-02
++6.756460338718012215e-02 1.734310951493893138e-01 8.864073081078854832e-02
++7.121409992638502717e-02 1.804216402085259963e-01 9.118655316732873772e-02
++7.479859509186639888e-02 1.873981595163995706e-01 9.363114185870033412e-02
++7.832196854697648369e-02 1.943623428359516903e-01 9.597819921125996800e-02
++8.178249510428708957e-02 2.013169715395964343e-01 9.822505767280115263e-02
++8.518219102467458614e-02 2.082637805063026204e-01 1.003733079455831900e-01
++8.852454157738801066e-02 2.152040105951080751e-01 1.024263253707545229e-01
++9.181013978863614144e-02 2.221394247672267563e-01 1.043841327744766678e-01
++9.503809838243432173e-02 2.290719902760253168e-01 1.062449430282469132e-01
++9.821010670676499910e-02 2.360029705984670323e-01 1.080100113958255836e-01
++1.013286574784400540e-01 2.429333482333665417e-01 1.096815914631605327e-01
++1.043934471701543076e-01 2.498646410896294690e-01 1.112585290437959340e-01
++1.074478296880792549e-01 2.567911108934768372e-01 1.127437202480449374e-01
++1.106260709129789077e-01 2.636946096457899458e-01 1.140997527427590474e-01
++1.139531706355643714e-01 2.705743606077580798e-01 1.152896296272559462e-01
++1.174768136636618332e-01 2.774250521408649361e-01 1.162908535730605153e-01
++1.213000971217181034e-01 2.842316842811704602e-01 1.170941428738193346e-01
++1.255340801183247312e-01 2.909784812573655843e-01 1.176678790007481823e-01
++1.303876420091158728e-01 2.976323416853482451e-01 1.179910028329904936e-01
++1.361775080109454139e-01 3.041399107394244794e-01 1.180416347026809198e-01
++1.434815209152097981e-01 3.103930959766884601e-01 1.179050440739785321e-01
++1.530522840464018097e-01 3.162194219215394564e-01 1.180658427800789778e-01
++1.647443020935283886e-01 3.215541086259602332e-01 1.195833209716834211e-01
++1.771224001134716619e-01 3.266051714744359624e-01 1.228383029974784990e-01
++1.893186680349762951e-01 3.315543486926041949e-01 1.273271390832197980e-01
++2.011470216295637714e-01 3.364693524047602802e-01 1.325809211223410999e-01
++2.126201126913634942e-01 3.413717760208538898e-01 1.383257062913032798e-01
++2.237814929443558420e-01 3.462703085838705896e-01 1.444001987716135027e-01
++2.346826504126838242e-01 3.511667839317458850e-01 1.507119862068962424e-01
++2.453653984352425765e-01 3.560619397292786315e-01 1.572020472843533856e-01
++2.558610883411705506e-01 3.609568875025493395e-01 1.638280010474283122e-01
++2.662540618029768935e-01 3.658464720551902194e-01 1.703646574946249270e-01
++2.766375890957337713e-01 3.707202928157689592e-01 1.766042606681927363e-01
++2.870120792807265286e-01 3.755815421723879277e-01 1.825448147300349488e-01
++2.973798701367175723e-01 3.804331662296118188e-01 1.881754975600970214e-01
++3.077385714853347887e-01 3.852782482569529487e-01 1.935061166107706343e-01
++3.180883154404229307e-01 3.901193934855016199e-01 1.985393196990216658e-01
++3.284295845809043213e-01 3.949589033692603168e-01 2.032788009798182638e-01
++3.387636524478269684e-01 3.997986013442899611e-01 2.077297610727937283e-01
++3.490920713533000597e-01 4.046399832445768951e-01 2.118988339848660862e-01
++3.594164000962936090e-01 4.094843090462684243e-01 2.157940430809284771e-01
++3.697392907451491073e-01 4.143322752680254073e-01 2.194241817700406383e-01
++3.800629535453087238e-01 4.191845097543299148e-01 2.227990620346612660e-01
++3.903897648146955057e-01 4.240414062699767728e-01 2.259290789901750585e-01
++4.007222760346346169e-01 4.289031445516293117e-01 2.288249032905495528e-01
++4.110629393231473583e-01 4.337698031247444463e-01 2.314973656174672545e-01
++4.214141346107081465e-01 4.386413758769234783e-01 2.339572260458537833e-01
++4.317776944235289238e-01 4.435179532313937023e-01 2.362153631413001498e-01
++4.421554582272910761e-01 4.483995629988481446e-01 2.382822640902987343e-01
++4.525491728091692312e-01 4.532862202325000367e-01 2.401679621083726013e-01
++4.629617793452492358e-01 4.581777295849584486e-01 2.418766613523773423e-01
++4.733964081044912953e-01 4.630738873787103027e-01 2.434097398165305792e-01
++4.838512407114513025e-01 4.679753825260214994e-01 2.447870115640884969e-01
++4.943280333549550654e-01 4.728822194350857377e-01 2.460147775573224282e-01
++5.048329973069679566e-01 4.777936355059679285e-01 2.470786486003125892e-01
++5.153613297132805249e-01 4.827109910092828859e-01 2.480074378391989298e-01
++5.259177888805488532e-01 4.876337443949864681e-01 2.487920646168808037e-01
++5.365028531047130178e-01 4.925622747803105050e-01 2.494384427855986242e-01
++5.471168004411860464e-01 4.974969337464568153e-01 2.499544447192391661e-01
++5.577636102245655536e-01 5.024372790562059432e-01 2.503320304175396527e-01
++5.684402705004985012e-01 5.073846875194365502e-01 2.505862169320990929e-01
++5.791517884291441653e-01 5.123382474891868821e-01 2.507078127142677859e-01
++5.898977118592134694e-01 5.172986884163369714e-01 2.507019666506383193e-01
++6.006780609928230596e-01 5.222664305265023454e-01 2.505758843768319810e-01
++6.114977839232860202e-01 5.272408795639659251e-01 2.503116806147138718e-01
++6.223533151135658414e-01 5.322233326069301107e-01 2.499311738427514862e-01
++6.332678499493179514e-01 5.372050254585409856e-01 2.494034423308610915e-01
++6.442492302385145475e-01 5.421770814367210534e-01 2.488390322915944863e-01
++6.553235853574364000e-01 5.471283166651099705e-01 2.482154543042252026e-01
++6.664663550324848584e-01 5.520678623990600276e-01 2.475959486163559209e-01
++6.777036161655425328e-01 5.569846941304811283e-01 2.469507035732461664e-01
++6.890381603900364027e-01 5.618763691265282745e-01 2.463040749474359470e-01
++7.004711944468632323e-01 5.667403668940831363e-01 2.456991151603213352e-01
++7.120126265469914895e-01 5.715693590145963787e-01 2.451873584080898616e-01
++7.236929482815777082e-01 5.763444689764196660e-01 2.448364505953754544e-01
++7.355168651190714391e-01 5.810504769862679941e-01 2.449163925191181757e-01
++7.475258033710173722e-01 5.856296804733571726e-01 2.462013043800762579e-01
++7.577499494457186069e-01 5.908503548553694085e-01 2.547905571379186496e-01
++7.635824979182088690e-01 5.981540408918001317e-01 2.695060335496625714e-01
++7.685008057442868079e-01 6.059656669084559910e-01 2.841339736308181596e-01
++7.731069113227515555e-01 6.139683821427790456e-01 2.985534874705023101e-01
++7.775652489236080100e-01 6.220751351043045663e-01 3.127742014086093980e-01
++7.819223609772602002e-01 6.302590951035305089e-01 3.268597741416817137e-01
++7.862053950616281206e-01 6.385051507786967395e-01 3.408479839175493908e-01
++7.904426037822046558e-01 6.467997885569605199e-01 3.547436291978552925e-01
++7.946574580110756791e-01 6.551326370117361853e-01 3.685463547975237342e-01
++7.988337796012735526e-01 6.635096250178373900e-01 3.823162323281250607e-01
++8.030088001380106810e-01 6.719161948372565085e-01 3.960118210517307724e-01
++8.071531032877933276e-01 6.803638144055433878e-01 4.097046504341926854e-01
++8.113041001849377043e-01 6.888386707654255980e-01 4.233460558902438220e-01
++8.154602754828877975e-01 6.973419981167042758e-01 4.369537331203900976e-01
++8.196058627154122478e-01 7.058802025749554288e-01 4.505666902424197429e-01
++8.237568818874844156e-01 7.144480574336203871e-01 4.641691373089507633e-01
++8.279197418246522222e-01 7.230440823922363869e-01 4.777602014010458586e-01
++8.320913582455962132e-01 7.316701160638459100e-01 4.913552497157864241e-01
++8.362534254444016213e-01 7.403317836360435722e-01 5.050123599879642322e-01
++8.404445466425872757e-01 7.490163102116410565e-01 5.186797759271363217e-01
++8.446648066780128028e-01 7.577248034134459465e-01 5.323633003798176055e-01
++8.489177724746317377e-01 7.664572638824626027e-01 5.460621193928290040e-01
++8.532123511454875464e-01 7.752120992980529035e-01 5.597655879096986586e-01
++8.575441658298394998e-01 7.839918355417494489e-01 5.734875036821195371e-01
++8.619146064360614368e-01 7.927971784487287676e-01 5.872309291049341295e-01
++8.663250853209770730e-01 8.016288174204664330e-01 6.009988751772729065e-01
++8.707820725499390013e-01 8.104859794311163323e-01 6.147852119944903215e-01
++8.752928841127598503e-01 8.193677275097041024e-01 6.285824125979521115e-01
++8.798495959466368088e-01 8.282774528639023082e-01 6.424105990843714808e-01
++8.844600743726268588e-01 8.372140407050960853e-01 6.562614074750376947e-01
++8.891318088448872947e-01 8.461765685160849149e-01 6.701273264224787418e-01
++8.938558100770686021e-01 8.551685709847908212e-01 6.840307207014526547e-01
++8.986544949798678239e-01 8.641851727809914951e-01 6.979374582474833222e-01
++9.035103927619371200e-01 8.732320822602240851e-01 7.118855904188222672e-01
++9.084448340107732500e-01 8.823048446731206473e-01 7.258432784575933328e-01
++9.134526188903524524e-01 8.914059055188421343e-01 7.398268438202468822e-01
++9.185353828258727704e-01 9.005358905803305669e-01 7.538405390559674846e-01
++9.237018976170942031e-01 9.096936780016002810e-01 7.678758238575987827e-01
++9.289597403884261029e-01 9.188785152907725795e-01 7.819264008239902308e-01
++9.343121189309133712e-01 9.280907276838803455e-01 7.959940980655445530e-01
++9.397648981125013012e-01 9.373300331729016444e-01 8.100759042872343052e-01
++9.453185269797627077e-01 9.465973949550759992e-01 8.241789901926560580e-01
++9.509801771850346919e-01 9.558922732509941289e-01 8.382978631896051969e-01
++9.567560362262098606e-01 9.652144306850017896e-01 8.524284880105463813e-01
++9.626518136622860267e-01 9.745638255706342568e-01 8.665671328953633568e-01
++9.686647318914142213e-01 9.839422330504176140e-01 8.807260550903986962e-01
++9.747892173640951841e-01 9.933519398287798952e-01 8.949228432580742520e-01];
++
++   case 'dif' % diff
++      RGB = [3.080165225110909760e-02 1.368487040065790861e-01 2.498464445599150041e-01
++3.427654989146505099e-02 1.437127028532935447e-01 2.573239494162229413e-01
++3.787813715751361943e-02 1.505402390894255427e-01 2.647902048135927777e-01
++4.156812010333730406e-02 1.573357824203455158e-01 2.722473736730874894e-01
++4.517179532760850352e-02 1.641035092921928340e-01 2.796979818302940402e-01
++4.870180895529663961e-02 1.708454227759541588e-01 2.871401983091831367e-01
++5.214717289956722485e-02 1.775659175978645810e-01 2.945787303179320804e-01
++5.551364141943334468e-02 1.842674761732781552e-01 3.020142881481510666e-01
++5.878267145509050856e-02 1.909546841623958602e-01 3.094531346302050734e-01
++6.203222237219494645e-02 1.976272549553735325e-01 3.168486096722107348e-01
++6.521944756836103863e-02 2.042923786219034143e-01 3.242073651148437707e-01
++6.833928990190613062e-02 2.109538539883098474e-01 3.315240779733869547e-01
++7.142525636138788436e-02 2.176109417067573770e-01 3.387875021305949974e-01
++7.444813366291075374e-02 2.242694950814881905e-01 3.459978826653878348e-01
++7.742364240945528997e-02 2.309308575473027481e-01 3.531440825838942366e-01
++8.038349666926730697e-02 2.375958135712563091e-01 3.602034285272879832e-01
++8.335927002300280719e-02 2.442657843736594225e-01 3.671480689795030838e-01
++8.636609239069936717e-02 2.509437864845217581e-01 3.739531368808389766e-01
++8.948430357745071340e-02 2.576279992007458053e-01 3.805657110274591748e-01
++9.284058523033036914e-02 2.643149709823168769e-01 3.868990078988859826e-01
++9.668345778728781870e-02 2.709875997226547928e-01 3.928398106800405909e-01
++1.013388564145758508e-01 2.776155815858447617e-01 3.982760426582682145e-01
++1.072606416994524026e-01 2.841399259508246011e-01 4.031326823215036770e-01
++1.144021508332261350e-01 2.905306843282992602e-01 4.075704938470787742e-01
++1.224943240061644456e-01 2.967876633109050588e-01 4.117594183512530703e-01
++1.310866885733582565e-01 3.029446515900964254e-01 4.158631835078765437e-01
++1.399259448624195767e-01 3.090284381668210734e-01 4.199407082636338884e-01
++1.488880808179499637e-01 3.150548708758020844e-01 4.240166515702193939e-01
++1.578509724192573571e-01 3.210422517899584882e-01 4.281197299059529837e-01
++1.668002459411131178e-01 3.269969805380745775e-01 4.322421588278035354e-01
++1.756791094481522930e-01 3.329300099876690844e-01 4.364047384684796027e-01
++1.845067584338563049e-01 3.388436977327556332e-01 4.405895801655569377e-01
++1.932823885204988379e-01 3.447414431949823999e-01 4.447966430522279913e-01
++2.019870459778479455e-01 3.506290556082184984e-01 4.490357338061347625e-01
++2.106258150884706692e-01 3.565090549124025343e-01 4.533046032331278785e-01
++2.192099721057354511e-01 3.623829850143509002e-01 4.575959954859014078e-01
++2.277275445301833456e-01 3.682546023486205078e-01 4.619233127548696971e-01
++2.361939130992141700e-01 3.741245762230066552e-01 4.662760464071296629e-01
++2.446124256489054516e-01 3.799946234495278352e-01 4.706542744097454434e-01
++2.529874638889413330e-01 3.858660993963552444e-01 4.750577339190826254e-01
++2.613341048773878406e-01 3.917383910736120800e-01 4.794796637798960925e-01
++2.696394299537646644e-01 3.976153747948966699e-01 4.839303534081906277e-01
++2.779049881050036919e-01 4.034985563305431566e-01 4.884111449080716372e-01
++2.861363993124647065e-01 4.093887667782184492e-01 4.929196308795206760e-01
++2.943389940220551004e-01 4.152865778556348864e-01 4.974548265548736636e-01
++3.025334250389247748e-01 4.211897194688838386e-01 5.020046120542877022e-01
++3.106982442651501364e-01 4.271034039757660716e-01 5.065852469354352738e-01
++3.188368260273997667e-01 4.330284571606364818e-01 5.111959566876937977e-01
++3.269657343217935996e-01 4.389628772920392552e-01 5.158284147455556301e-01
++3.350816436419064015e-01 4.449085811856242079e-01 5.204856000258065718e-01
++3.431739289326510289e-01 4.508688325370560634e-01 5.251766674651570099e-01
++3.512656069646695189e-01 4.568402506918622374e-01 5.298868083741347101e-01
++3.593506132834142774e-01 4.628250736129231879e-01 5.346217853574988244e-01
++3.674172478556836929e-01 4.688267836740107053e-01 5.393913336663840319e-01
++3.754973469427250743e-01 4.748398228270848676e-01 5.441739055327718955e-01
++3.835625614368970981e-01 4.808709517650425203e-01 5.489922576544932209e-01
++3.916201861820892138e-01 4.869196696786777800e-01 5.538424587653016928e-01
++3.996888560566008164e-01 4.929829902359726401e-01 5.587113837570589769e-01
++4.077452976164708254e-01 4.990668992329919118e-01 5.636172499463452112e-01
++4.158238363550112449e-01 5.051647578473101863e-01 5.685356950340605398e-01
++4.238869442834262147e-01 5.112855069066921665e-01 5.734980302852201728e-01
++4.319617699154935098e-01 5.174241819464946435e-01 5.784833267853278782e-01
++4.400436018491948320e-01 5.235826893170786311e-01 5.834960386464431714e-01
++4.481312796407512233e-01 5.297621053719542283e-01 5.885383546494945550e-01
++4.562263279894743229e-01 5.359626809225542798e-01 5.936121659102355785e-01
++4.643239808635050703e-01 5.421865887597332456e-01 5.987202656129063660e-01
++4.724486870344450362e-01 5.484289164378903791e-01 6.038441893417568762e-01
++4.805822297704738788e-01 5.546948405817618832e-01 6.089980501349065989e-01
++4.887172410474664441e-01 5.609869159623338541e-01 6.141889435023867305e-01
++4.968703980230008699e-01 5.673022611108096136e-01 6.194017678807255400e-01
++5.050230443352835552e-01 5.736457002325791033e-01 6.246566996141469374e-01
++5.132020014296254651e-01 5.800120364495556791e-01 6.299281926614284099e-01
++5.213837697997298903e-01 5.864072076681272616e-01 6.352414056079356275e-01
++5.295840791882617804e-01 5.928284223714805901e-01 6.405818144094436173e-01
++5.377985006631785803e-01 5.992773867217912054e-01 6.459553074236056291e-01
++5.460310568089291605e-01 6.057538951510261782e-01 6.513591302487201640e-01
++5.542803602235417681e-01 6.122589708601943181e-01 6.567960616850564426e-01
++5.625427909572455754e-01 6.187941687382881861e-01 6.622712272448196824e-01
++5.708318382965930082e-01 6.253570561449082188e-01 6.677719395169281480e-01
++5.791326606499368479e-01 6.319518087895650282e-01 6.733150010032186161e-01
++5.874594162608378634e-01 6.385758077347706285e-01 6.788869295566190010e-01
++5.958021954354665306e-01 6.452321052037962579e-01 6.844994504225663245e-01
++6.041669493667392032e-01 6.519200031142581286e-01 6.901476288957911764e-01
++6.125605719486232337e-01 6.586385467570500252e-01 6.958254420726305289e-01
++6.209702599139194090e-01 6.653915355400340514e-01 7.015478000189213637e-01
++6.294086543235715148e-01 6.721766263526947061e-01 7.073025514622064414e-01
++6.378691230472761653e-01 6.789961486811091351e-01 7.130980827587862780e-01
++6.463529402277414793e-01 6.858505203730194122e-01 7.189343580950778856e-01
++6.548667336608775535e-01 6.927388303718031715e-01 7.248055449230874636e-01
++6.634047329440709850e-01 6.996632326198537477e-01 7.307191763991576217e-01
++6.719706356478575282e-01 7.066235438274829361e-01 7.366725743067246146e-01
++6.805691273316444301e-01 7.136193210595811465e-01 7.426619469578672472e-01
++6.891901686164448870e-01 7.206538297392898196e-01 7.486995567627365844e-01
++6.978417441976546565e-01 7.277258099214434228e-01 7.547780354337728648e-01
++7.065266827690414031e-01 7.348352863051689221e-01 7.608955968203486853e-01
++7.152395659488615109e-01 7.419843878319358765e-01 7.670595168287617227e-01
++7.239821407052556834e-01 7.491734241473727574e-01 7.732692164928602896e-01
++7.327590970387688474e-01 7.564019312463790001e-01 7.795208278459410112e-01
++7.415714112445037642e-01 7.636703716037079870e-01 7.858145260879668692e-01
++7.504112152902991939e-01 7.709814701087125410e-01 7.921602549877707622e-01
++7.592858091842216162e-01 7.783339526866095426e-01 7.985510124613616201e-01
++7.681958083667864701e-01 7.857281516038946423e-01 8.049869935018724165e-01
++7.771415943289318173e-01 7.931642615485536840e-01 8.114683168046802342e-01
++7.861210234635496175e-01 8.006428249211288151e-01 8.179973940806203325e-01
++7.951301023947144886e-01 8.081643845947440452e-01 8.245778955860991744e-01
++8.041728469938760337e-01 8.157266105617665408e-01 8.312032233576642781e-01
++8.132456568435891819e-01 8.233280673585187115e-01 8.378734408880845752e-01
++8.223487919825404058e-01 8.309646782111167473e-01 8.445815347091445435e-01
++8.314739162371332926e-01 8.386323940000459665e-01 8.513263697699344767e-01
++8.406130156021551780e-01 8.463239863842642041e-01 8.581012298825883011e-01
++8.497544923553936869e-01 8.540290636742366992e-01 8.648964939043677358e-01
++8.588848363304528721e-01 8.617324046759308187e-01 8.716956826827835236e-01
++8.679835640163260368e-01 8.694139530371515212e-01 8.784788921095023628e-01
++8.770201283066206832e-01 8.770482020713447069e-01 8.852238656983413279e-01
++8.859648522194258913e-01 8.845997703979764371e-01 8.918910598190278316e-01
++8.947687008355051930e-01 8.920276102541201402e-01 8.984445530744430419e-01
++9.033850238565973578e-01 8.992781133601027710e-01 9.048255526813022698e-01
++9.117454267355319386e-01 9.062912781484097069e-01 9.109792984365244761e-01
++9.197772674046712504e-01 9.129962371365842877e-01 9.168355520637951894e-01
++9.273989381574117008e-01 9.193137785263337802e-01 9.223160826098045773e-01
++9.345265056154450356e-01 9.251567923877340727e-01 9.273308757297369365e-01
++9.410568294999761552e-01 9.304383120413204367e-01 9.318033109548278237e-01
++9.469054517188711939e-01 9.350653892052174232e-01 9.356338452806639561e-01
++9.519782306847331954e-01 9.389521024465230514e-01 9.387414682758670192e-01
++9.561855219785392324e-01 9.420212349770757942e-01 9.410568432390962190e-01
++9.594583919916889192e-01 9.442053410129402913e-01 9.425129916890260251e-01
++9.617359608985257546e-01 9.454553544501299589e-01 9.430685634745854529e-01
++9.629655575123797773e-01 9.457446361853111272e-01 9.427146073591580189e-01
++9.629717304152120017e-01 9.451630117299317790e-01 9.411078740469980275e-01
++9.619086196808096512e-01 9.436969537999753133e-01 9.379427077261371926e-01
++9.599163272304170880e-01 9.412870435035790573e-01 9.337158672983336682e-01
++9.570384080931425563e-01 9.379846152444032414e-01 9.285135912753641474e-01
++9.533354457428268036e-01 9.338571023316933895e-01 9.224353821916627671e-01
++9.488865060103991445e-01 9.289840890976138743e-01 9.155685277230518615e-01
++9.437794827762752137e-01 9.234529155688914193e-01 9.080043258769950887e-01
++9.381021433775925678e-01 9.173543171347293690e-01 8.998514836828582775e-01
++9.319492013404071518e-01 9.107783993290641256e-01 8.911882560099286810e-01
++9.254038313424192141e-01 9.038112443270013285e-01 8.821180550321400249e-01
++9.185496533096065841e-01 8.965322509059643341e-01 8.727092681908217298e-01
++9.114540331246678839e-01 8.890124126067980859e-01 8.630519170031795140e-01
++9.041820632910790856e-01 8.813132734312176808e-01 8.531979805537907025e-01
++8.967869578435456734e-01 8.734867291901790010e-01 8.431978773211421530e-01
++8.893098149893794435e-01 8.655753876269207669e-01 8.331030513350975442e-01
++8.817848418192094639e-01 8.576132802667703059e-01 8.229492517613266056e-01
++8.742401985712474621e-01 8.496268650289525715e-01 8.127582978377587697e-01
++8.666945370128648074e-01 8.416362324606945222e-01 8.025572922175608914e-01
++8.591642949649661576e-01 8.336561546444334336e-01 7.923557697274130618e-01
++8.516606462490278195e-01 8.256972216872984216e-01 7.821629896098961643e-01
++8.441881675648532646e-01 8.177668584523517525e-01 7.719978747167733912e-01
++8.367546003836178192e-01 8.098699298493980958e-01 7.618548556771399527e-01
++8.293628053720738524e-01 8.020095841729102393e-01 7.517385870991303287e-01
++8.220122974103521996e-01 7.941877657343777708e-01 7.416604820361886174e-01
++8.147055831041186691e-01 7.864054338886661277e-01 7.316158935999518276e-01
++8.074428695046120819e-01 7.786629991741689238e-01 7.216062017816766705e-01
++8.002239536861533997e-01 7.709604828947951294e-01 7.116324410842282955e-01
++7.930486047248805903e-01 7.632976487972781277e-01 7.016945092401379869e-01
++7.859155444098100407e-01 7.556741407493390295e-01 6.917956122566603083e-01
++7.788239785472398369e-01 7.480894917424205648e-01 6.819365996758520732e-01
++7.717761666842225532e-01 7.405430431500328314e-01 6.721061511286441359e-01
++7.647695126504651109e-01 7.330343101062176681e-01 6.623117248985945782e-01
++7.578024759469249583e-01 7.255627582077430748e-01 6.525565861539863732e-01
++7.508747011746044198e-01 7.181277940669236193e-01 6.428393514066714776e-01
++7.439860296366358483e-01 7.107288105275537671e-01 6.331578659286328792e-01
++7.371380352230317845e-01 7.033650997305714858e-01 6.235032380461981161e-01
++7.303267295539673798e-01 6.960362660858002704e-01 6.138882457032197593e-01
++7.235516370761116978e-01 6.887417344158411892e-01 6.043120048450656423e-01
++7.168136574616641443e-01 6.814808447026716731e-01 5.947682975771849678e-01
++7.101132300652239770e-01 6.742529573780132734e-01 5.852527166373640011e-01
++7.034464832580180627e-01 6.670577263264326762e-01 5.757776499898806799e-01
++6.968134241386333416e-01 6.598945644190796767e-01 5.663404055906162693e-01
++6.902175511682563380e-01 6.527626219057073298e-01 5.569247166393624937e-01
++6.836530241251399520e-01 6.456617329968893371e-01 5.475506786771059398e-01
++6.771191923792275746e-01 6.385913765706551226e-01 5.382182031186726334e-01
++6.706213406334817773e-01 6.315505441676552145e-01 5.289041000996647091e-01
++6.641534350911151297e-01 6.245391367090507018e-01 5.196292578451316979e-01
++6.577148635275871236e-01 6.175566394334415232e-01 5.103934681036723653e-01
++6.513106015597026621e-01 6.106020304081083427e-01 5.011747507363846221e-01
++6.449339394177714402e-01 6.036753299959042307e-01 4.919966626063084214e-01
++6.385861657554016135e-01 5.967758543247165814e-01 4.828515990278902659e-01
++6.322678284337878152e-01 5.899029749242099552e-01 4.737348355247164577e-01
++6.259767255318442469e-01 5.830569263656453227e-01 4.646452891563762067e-01
++6.197016579332955688e-01 5.762398779913381341e-01 4.556052788341879434e-01
++6.134474028946137469e-01 5.694504347953359691e-01 4.465979423650075497e-01
++6.072178659159134240e-01 5.626871366850844103e-01 4.376111326566481941e-01
++6.010012505217495749e-01 5.559520936787821777e-01 4.286719487404299644e-01
++5.948055640046073789e-01 5.492429546962157572e-01 4.197575498195730836e-01
++5.886326075840858651e-01 5.425588558149744278e-01 4.108591465488395378e-01
++5.824702130202078498e-01 5.359018268492113934e-01 4.020079470557531565e-01
++5.763248263841350694e-01 5.292699281179926718e-01 3.931837482598241618e-01
++5.701972311820494577e-01 5.226623693222695044e-01 3.843824114977716366e-01
++5.640831336223245396e-01 5.160796590123359895e-01 3.756116269725132129e-01
++5.579774433964941327e-01 5.095224539424874077e-01 3.668822207066750885e-01
++5.518860265359687434e-01 5.029888698004121306e-01 3.581753826709989652e-01
++5.458070559295251645e-01 4.964787819395978796e-01 3.494931200704951557e-01
++5.397391255491313933e-01 4.899920506546056598e-01 3.408352402134943726e-01
++5.336730625437067221e-01 4.835304037810426725e-01 3.322231435985951165e-01
++5.276152444526773788e-01 4.770918383518058525e-01 3.236356057173125356e-01
++5.215648631466205387e-01 4.706762498171280229e-01 3.150682292920859440e-01
++5.155189794095078604e-01 4.642837707070938680e-01 3.065265223389798677e-01
++5.094751216031231378e-01 4.579145264501231494e-01 2.980134272377937266e-01
++5.034310278715931064e-01 4.515686733480185899e-01 2.895302566325898552e-01
++4.973847636608849654e-01 4.452464140846874030e-01 2.810755531259728768e-01
++4.913352410442906604e-01 4.389480201490584821e-01 2.726410128949737222e-01
++4.852774212045994351e-01 4.326740360757653225e-01 2.642407735080369302e-01
++4.792095319460407121e-01 4.264249820482975961e-01 2.558674925325885585e-01
++4.731283857839347351e-01 4.202016073968968812e-01 2.475197805445442101e-01
++4.670296949396188224e-01 4.140048440647509653e-01 2.392012072518971966e-01
++4.609095096289907434e-01 4.078358796897652017e-01 2.309089502347338452e-01
++4.547601620003904332e-01 4.016973741434559098e-01 2.226435585187958033e-01
++4.485682425668168771e-01 3.955931855786054552e-01 2.144296211245620976e-01
++4.423342563272031902e-01 3.895240159345254582e-01 2.062390835191822425e-01
++4.360296791131279548e-01 3.834992742811840771e-01 1.981208646399195139e-01
++4.296458451439821302e-01 3.775230805131955525e-01 1.900605950657147936e-01
++4.231474637241839920e-01 3.716087794574343128e-01 1.820957501112273613e-01
++4.164868167567738477e-01 3.657737180218046391e-01 1.742972729554080058e-01
++4.095973903281860951e-01 3.600427549828760787e-01 1.667592074668843294e-01
++4.023838616513769062e-01 3.544471779032521419e-01 1.597054883781360846e-01
++3.947814112345453541e-01 3.489995705485997579e-01 1.534550340717726336e-01
++3.868766298266183568e-01 3.436490149527227644e-01 1.482247271514051945e-01
++3.788659234446942747e-01 3.383142918487055395e-01 1.438533685673206441e-01
++3.708789643993818941e-01 3.329519259272508136e-01 1.400354190966675849e-01
++3.629572903164399733e-01 3.275541151937279016e-01 1.365461363519130944e-01
++3.551085081353937412e-01 3.221231228094754706e-01 1.332624917481727012e-01
++3.473247934253401170e-01 3.166654234722757755e-01 1.301119558630651207e-01
++3.396071981367110304e-01 3.111828368128046196e-01 1.270354172742856058e-01
++3.319394021514575632e-01 3.056815149128923048e-01 1.240384908643338280e-01
++3.243282276863680424e-01 3.001605128554065693e-01 1.210640172441826978e-01
++3.167622056152286647e-01 2.946237048061004504e-01 1.181174627342822525e-01
++3.092325069255885128e-01 2.890737927737177526e-01 1.152025540049777530e-01
++3.017324462072743518e-01 2.835140481503690690e-01 1.122895803439803164e-01
++2.942527745713884313e-01 2.779485572093680079e-01 1.093519738743563285e-01
++2.867898062904237211e-01 2.723775024827345681e-01 1.063941382240281286e-01
++2.793462654071084406e-01 2.667988809657529936e-01 1.034093116060303130e-01
++2.719194579070843831e-01 2.612124593378840620e-01 1.004000094727539039e-01
++2.645072257635520119e-01 2.556177666826844330e-01 9.736769715746559917e-02
++2.571104715415328812e-01 2.500132794565106398e-01 9.430849274229180512e-02
++2.497278694500691398e-01 2.443981535173898045e-01 9.122222486885092629e-02
++2.423563418593929208e-01 2.387720412133358949e-01 8.811155590734742749e-02
++2.350006052093227549e-01 2.331320446993035422e-01 8.496581087820043177e-02
++2.276523216303719677e-01 2.274793513535450784e-01 8.179625154164907319e-02
++2.203179455088669636e-01 2.218103948803600289e-01 7.858901255132699770e-02
++2.129902634426870667e-01 2.161258230519468304e-01 7.535305204258735401e-02
++2.056701553920205483e-01 2.104236534304168016e-01 7.208351221952713495e-02
++1.983573399507774226e-01 2.047021786467214111e-01 6.877728527916648904e-02
++1.910498721129175737e-01 1.989600929322370426e-01 6.543378475478747736e-02
++1.837444391314300429e-01 1.931963704923697345e-01 6.205437817912465986e-02
++1.764424601043844409e-01 1.874084358013911600e-01 5.863230865340122305e-02
++1.691401736478186091e-01 1.815951106612115895e-01 5.516899293098562890e-02
++1.618355962290499162e-01 1.757545129863619104e-01 5.166248843687707565e-02
++1.545273276784393246e-01 1.698844060286744673e-01 4.810942800782175982e-02
++1.472136064507999498e-01 1.639824533449356636e-01 4.450649296503813440e-02
++1.398915640220567136e-01 1.580463968635001659e-01 4.085151092791106803e-02
++1.325571921668454445e-01 1.520740186438245822e-01 3.716809665985362082e-02
++1.252084444586500644e-01 1.460622428214301272e-01 3.362553317766520805e-02
++1.178384206042670801e-01 1.400089579293633535e-01 3.023931012520724576e-02
++1.104210154536264532e-01 1.339166670121798297e-01 2.703939689144004010e-02]; 
++
++   case 'tar' % tarn, the rain anomaly map
++      RGB = [8.982325470083904473e-02 1.386884202488073425e-01 5.339634747542102572e-02
++9.490477059882479471e-02 1.456373382629968793e-01 5.489581825948507826e-02
++9.996820923335580922e-02 1.525451879246892684e-01 5.635425405965687612e-02
++1.049932629133125961e-01 1.594260027028096272e-01 5.767943871793178995e-02
++1.099844886715972414e-01 1.662815862271170841e-01 5.888156855042592924e-02
++1.149326133871393096e-01 1.731199934404946961e-01 5.990900196219744317e-02
++1.198471368660654901e-01 1.799400614735769122e-01 6.079328815375505818e-02
++1.247299637162895547e-01 1.867439924225139936e-01 6.153299800422255134e-02
++1.295805228510759355e-01 1.935349340052088807e-01 6.211473969231569997e-02
++1.343996539632437981e-01 2.003151607373700460e-01 6.253114410253807209e-02
++1.391929081922307909e-01 2.070845521371987852e-01 6.279848839795282300e-02
++1.439554110569007950e-01 2.138477306592140859e-01 6.288007868082229335e-02
++1.487348911403759133e-01 2.205914714224685436e-01 6.284098523281120285e-02
++1.535498540172954285e-01 2.273157827161538247e-01 6.260141657412987559e-02
++1.584099704346516035e-01 2.340203331404673293e-01 6.214047826160282867e-02
++1.633293887964821223e-01 2.407033599878570240e-01 6.143905222634648416e-02
++1.683325411333271293e-01 2.473603962447930571e-01 6.047333430287041983e-02
++1.734516487390746486e-01 2.539840110977820697e-01 5.924078177592304734e-02
++1.787290092053028800e-01 2.605653696981221068e-01 5.769398812038967900e-02
++1.842226903108559743e-01 2.670914347726459082e-01 5.577103201204060973e-02
++1.900442575104325516e-01 2.735335271652731270e-01 5.343902039527659992e-02
++1.964012889997470146e-01 2.798383207240314197e-01 5.059091721484253873e-02
++2.038180981569160388e-01 2.858582487774559699e-01 4.734796165359243109e-02
++2.134803580554236468e-01 2.912137742752328173e-01 4.542335962452376946e-02
++2.246379258326957618e-01 2.959985720226946948e-01 4.791967673999841110e-02
++2.357078843306291693e-01 3.007243105772285929e-01 5.139927647716215769e-02
++2.466644952616644515e-01 3.054215218481723948e-01 5.513668228793693754e-02
++2.575461415550749367e-01 3.100881502728962680e-01 5.896503676513652897e-02
++2.683585986429155579e-01 3.147286848554897709e-01 6.282164605955981029e-02
++2.791275572039774722e-01 3.193399608455813055e-01 6.667246926393996520e-02
++2.898358184319489994e-01 3.239318024263264095e-01 7.050980744893517449e-02
++3.004984152503225037e-01 3.285032192279036534e-01 7.432550653130615137e-02
++3.111553190646883515e-01 3.330438874028457952e-01 7.810231939881484564e-02
++3.218034422925408755e-01 3.375573450510525597e-01 8.184304787716339957e-02
++3.324333011718812458e-01 3.420495081780127733e-01 8.555280814984053683e-02
++3.430769162896195046e-01 3.465110261365142996e-01 8.922112292532158317e-02
++3.537299359050021241e-01 3.509453072047716837e-01 9.285241010232825332e-02
++3.643894401193512600e-01 3.553552732120655588e-01 9.645119893644621412e-02
++3.750453108858616824e-01 3.597467221513847013e-01 1.000256142638818735e-01
++3.857100245562226637e-01 3.641166297482588132e-01 1.035734980914473635e-01
++3.963858021351523986e-01 3.684657518577320601e-01 1.070973667641381966e-01
++4.071213221517259173e-01 3.727752094149718864e-01 1.105826082064781946e-01
++4.178758479312351115e-01 3.770629074315066109e-01 1.140472314573759138e-01
++4.286423372903069851e-01 3.813332614724057046e-01 1.174974726735356911e-01
++4.394433776892578969e-01 3.855777866767184925e-01 1.209275883437508081e-01
++4.502962927333878373e-01 3.897896541113713975e-01 1.243344105962937429e-01
++4.611581205683302209e-01 3.939890872463367444e-01 1.277374475879362037e-01
++4.720563913472620166e-01 3.981648558562365103e-01 1.311281116044327733e-01
++4.830210005713382881e-01 4.023038157279973936e-01 1.344963783804615232e-01
++4.939986962481786592e-01 4.064316868089741797e-01 1.378665047316342263e-01
++5.050443453644228864e-01 4.105232839216421126e-01 1.412177516567701130e-01
++5.161305471961733504e-01 4.145923196985767945e-01 1.445638179668259637e-01
++5.272226932670311950e-01 4.186568461649191053e-01 1.479227047630213288e-01
++5.384231737920478489e-01 4.226667334740543680e-01 1.512491796667267130e-01
++5.496735303963581343e-01 4.266509012024514158e-01 1.545811460866533815e-01
++5.608924552760781168e-01 4.306494794221744082e-01 1.580220317035593569e-01
++5.721888701475891237e-01 4.346087953039819429e-01 1.614907462658664583e-01
++5.835602689975579738e-01 4.385299786869343297e-01 1.649946574397075372e-01
++5.949141655760096237e-01 4.424610896723609743e-01 1.686236738948057867e-01
++6.063474969101482204e-01 4.463528192152232399e-01 1.722929976151095499e-01
++6.178322186277155348e-01 4.502196887286237792e-01 1.760393057804460759e-01
++6.293072576484797231e-01 4.540947330149664452e-01 1.799322501799610063e-01
++6.408487929862468624e-01 4.579376406332680838e-01 1.839101076250921896e-01
++6.524478209436700427e-01 4.617530075872406381e-01 1.879952778619465859e-01
++6.640840089637001231e-01 4.655519164846439462e-01 1.922225103058495532e-01
++6.757077110120256469e-01 4.693624324344119469e-01 1.966573342842017347e-01
++6.873619660726970615e-01 4.731606777592323732e-01 2.012786215471898954e-01
++6.990381205121832808e-01 4.769509785672518265e-01 2.061259388500985001e-01
++7.107469254673900450e-01 4.807250920628522439e-01 2.112467599398395457e-01
++7.224230526312156453e-01 4.845218253861356961e-01 2.167123076670600113e-01
++7.340988344738968996e-01 4.883178461040553198e-01 2.226023859070605515e-01
++7.456126256093577043e-01 4.922084125716105762e-01 2.291293878090427394e-01
++7.569950884983198680e-01 4.961693298634363702e-01 2.364236914878575235e-01
++7.680178179592376253e-01 5.003309692977765399e-01 2.449057676522546911e-01
++7.783432998143535730e-01 5.048913767328344626e-01 2.551145881355684764e-01
++7.872937751334541101e-01 5.102708429127015277e-01 2.676604181065562749e-01
++7.941838547011116356e-01 5.169436808272552808e-01 2.821513140071189585e-01
++7.994756138083272123e-01 5.246737693689591531e-01 2.970255774031809182e-01
++8.039010002452274817e-01 5.330024415850749264e-01 3.115266985520254717e-01
++8.078274978677594254e-01 5.416811012734407127e-01 3.255924452137653469e-01
++8.115188822314253203e-01 5.505337325024400874e-01 3.392264225271887645e-01
++8.149565405173153643e-01 5.595497555166275561e-01 3.527260919316282384e-01
++8.184200486555966991e-01 5.685470713353225625e-01 3.661765482687758810e-01
++8.218871005380722350e-01 5.775395855002405376e-01 3.796232120570560142e-01
++8.253524104820136875e-01 5.865320478639367563e-01 3.930813348872184143e-01
++8.288195980598317414e-01 5.955244594650943579e-01 4.065541730450397684e-01
++8.322893500409468404e-01 6.045186250474157141e-01 4.200438297618293571e-01
++8.357658919205435133e-01 6.135146821751165103e-01 4.335463882212042819e-01
++8.392529397355924514e-01 6.225129167459599877e-01 4.470604854774085646e-01
++8.427490015153409342e-01 6.315159424794672960e-01 4.605928597504284627e-01
++8.462593242877498589e-01 6.405233492783437566e-01 4.741391831670908608e-01
++8.497829397434528698e-01 6.495374502823044738e-01 4.877048504982988697e-01
++8.533243184659659031e-01 6.585581699790050703e-01 5.012868094865198243e-01
++8.568819326669031566e-01 6.675878581525517275e-01 5.148924377083944348e-01
++8.604592156604728981e-01 6.766270650074718285e-01 5.285174957354723535e-01
++8.640624159744237920e-01 6.856750887735367783e-01 5.421555222813166930e-01
++8.676874794762717835e-01 6.947353397221285309e-01 5.558159820355237368e-01
++8.713433578641075483e-01 7.038060956465443940e-01 5.694881225731345253e-01
++8.750269237065777528e-01 7.128903502475765208e-01 5.831797789138876142e-01
++8.787417347404306023e-01 7.219884934452005520e-01 5.968884207063740455e-01
++8.824929186507559642e-01 7.311003788594004904e-01 6.106091378045375162e-01
++8.862780839217170303e-01 7.402286277522096558e-01 6.243484010896452885e-01
++8.901025319225768229e-01 7.493730430239593510e-01 6.381009856311857797e-01
++8.939696421167129259e-01 7.585341679611918853e-01 6.518645964033017437e-01
++8.978784332841047711e-01 7.677140679252760780e-01 6.656434485771917098e-01
++9.018326061682566674e-01 7.769131645138506181e-01 6.794347199822515782e-01
++9.058380869535479496e-01 7.861311730497033690e-01 6.932323184728660381e-01
++9.098936269941250155e-01 7.953702376174893729e-01 7.070408050591605598e-01
++9.140018319746877618e-01 8.046311927664194785e-01 7.208589990654702406e-01
++9.181667424043119530e-01 8.139144268565462470e-01 7.346836216449236234e-01
++9.223937440297114154e-01 8.232199407988282092e-01 7.485094577713424790e-01
++9.266329848317796936e-01 8.325649094757640034e-01 7.624119242822527953e-01
++9.309587852706298072e-01 8.419294436897262202e-01 7.762663931757451952e-01
++9.353308095703787295e-01 8.513275998621367968e-01 7.901346256764255616e-01
++9.397666205989465560e-01 8.607552896628867245e-01 8.039940207918337967e-01
++9.442852447524148207e-01 8.702076963082445715e-01 8.178194726640143353e-01
++9.488564272552421075e-01 8.796932993686320534e-01 8.316532922424306751e-01
++9.535132490174164088e-01 8.891984622715306541e-01 8.454417866111457736e-01
++9.582183040236339489e-01 8.987227701762496856e-01 8.592166709390754997e-01
++9.629681108746700469e-01 9.082408064338201026e-01 8.729337059863773174e-01
++9.677369708112718572e-01 9.177061780026050108e-01 8.865286101605559521e-01
++9.724470492478461958e-01 9.270421466879262828e-01 8.999251032877214618e-01
++9.769577532404692954e-01 9.361234679319003771e-01 9.130099659367507670e-01
++9.810936756020608440e-01 9.447503559760432879e-01 9.255607060964068378e-01
++9.846187877628681528e-01 9.526495821380999152e-01 9.372697834100743863e-01
++9.872037589208276787e-01 9.594994318553785595e-01 9.478188041909386685e-01
++9.885417842181484227e-01 9.649430355113016722e-01 9.568049207415391111e-01
++9.884013930268252812e-01 9.686440358418687557e-01 9.637998740972807399e-01
++9.884162623276403492e-01 9.700501042547021724e-01 9.646078752920302923e-01
++9.882481988456427446e-01 9.691949840717196674e-01 9.590849806168054714e-01
++9.862202098271878326e-01 9.664497051565109631e-01 9.513022380762837793e-01
++9.825317256976796587e-01 9.620307807128735123e-01 9.416222408221766038e-01
++9.774953228979595954e-01 9.562506189604750295e-01 9.303982168749544979e-01
++9.714512581163280425e-01 9.494527517929901572e-01 9.180386343083645206e-01
++9.647328782040082151e-01 9.419601909858620337e-01 9.048410781832560978e-01
++9.576029833882070408e-01 9.340364327380904497e-01 8.911071594609687452e-01
++9.502540208567341606e-01 9.258747025552572785e-01 8.770597493210310347e-01
++9.428203850658012364e-01 9.176036605916164657e-01 8.628094676385467121e-01
++9.353802079259059266e-01 9.093000877222664480e-01 8.484369289828109784e-01
++9.279731512595491560e-01 9.010054158372772237e-01 8.340022711999641736e-01
++9.206162430864484048e-01 8.927397568877493139e-01 8.195491149365338179e-01
++9.133281854005529388e-01 8.845128541542209843e-01 8.050384948242300664e-01
++9.061049708588290175e-01 8.763271129727117081e-01 7.905141123067558340e-01
++8.988722526026153847e-01 8.682095990978259126e-01 7.760244884018141498e-01
++8.913604989190128114e-01 8.602593575538733939e-01 7.616936251859220963e-01
++8.834947766491649812e-01 8.525076069101691356e-01 7.475141723430621665e-01
++8.751348356324997191e-01 8.450011895094009517e-01 7.335968964229397926e-01
++8.660362122016208586e-01 8.378139590610478304e-01 7.202229230673017346e-01
++8.560628191678395504e-01 8.309783491388803567e-01 7.076282794978067114e-01
++8.450850551605781913e-01 8.245041095837670753e-01 6.962540521527236237e-01
++8.331237773418240788e-01 8.183393744081108867e-01 6.865239180889655124e-01
++8.205576283471390786e-01 8.123351983566962087e-01 6.783182715666855600e-01
++8.077229876914296947e-01 8.063801435632871328e-01 6.713153485176399649e-01
++7.947461515019460521e-01 8.004373108778479740e-01 6.653252445665102099e-01
++7.818234645252460924e-01 7.944593749272963468e-01 6.599830880041622772e-01
++7.690043949000203716e-01 7.884424060393956379e-01 6.551042701424648618e-01
++7.562981288404810876e-01 7.823918885846237181e-01 6.505794347324633797e-01
++7.437166688251096724e-01 7.763107155814537030e-01 6.463185559404119873e-01
++7.312864875465606707e-01 7.701962491575811143e-01 6.422364303657139839e-01
++7.189850527082707332e-01 7.640604119000086181e-01 6.382908369799579207e-01
++7.068142314422918293e-01 7.579064471112740842e-01 6.344344908612202794e-01
++6.947742510783049275e-01 7.517375363827888402e-01 6.306282821287318985e-01
++6.828537141789142728e-01 7.455586837934410349e-01 6.268596706266046370e-01
++6.710011548564486228e-01 7.393836600422335481e-01 6.231736409952126632e-01
++6.592657914925743601e-01 7.332038660876558644e-01 6.194650744353706884e-01
++6.476362335539276316e-01 7.270240901258274713e-01 6.157213868460473805e-01
++6.360362802101585666e-01 7.208613432160450030e-01 6.120373156027114625e-01
++6.245080854916185142e-01 7.147082392942302187e-01 6.083234269572357356e-01
++6.130488547076046180e-01 7.085668274101213360e-01 6.045591744160895287e-01
++6.015892322420162142e-01 7.024496994714828357e-01 6.008489625961975777e-01
++5.901987677923722364e-01 6.963445147045469463e-01 5.970628836865409239e-01
++5.787942193155654058e-01 6.902683578483006510e-01 5.932973990580240331e-01
++5.673843957655613224e-01 6.842194608428608937e-01 5.895220675517639508e-01
++5.559759005656629283e-01 6.781954870319548689e-01 5.857224142025272418e-01
++5.445452293547278222e-01 6.721991418209628533e-01 5.819309981473995697e-01
++5.330284999192810291e-01 6.662471887845208274e-01 5.781518614893066399e-01
++5.216118831320554206e-01 6.602860177867492242e-01 5.743450969986969579e-01
++5.100461930662858467e-01 6.543801579393034862e-01 5.705892298512411642e-01
++4.985462196160774240e-01 6.484680127740434230e-01 5.668522387113605898e-01
++4.869212854485653330e-01 6.426004706277155254e-01 5.631503671835994540e-01
++4.753175948425168440e-01 6.367342039857054603e-01 5.594833076156262575e-01
++4.635884121260610002e-01 6.309044987522948178e-01 5.558810414566710545e-01
++4.517937357110975438e-01 6.250933232803836948e-01 5.523287210439038475e-01
++4.399781445380013811e-01 6.192864046496112662e-01 5.488272822016192487e-01
++4.280176465668665831e-01 6.135117804844451017e-01 5.453889520686707737e-01
++4.160613175390713292e-01 6.077287406576958873e-01 5.420126140975655149e-01
++4.039857150007630238e-01 6.019638930796089582e-01 5.387130326489297794e-01
++3.917475183228279478e-01 5.962226288699170595e-01 5.354998204993742794e-01
++3.795396260545044753e-01 5.904576990603345177e-01 5.323562706006824685e-01
++3.671980489650730761e-01 5.847026249394290387e-01 5.292995421656493393e-01
++3.547169039649492039e-01 5.789540227003182604e-01 5.263324098770649773e-01
++3.421991518101316077e-01 5.731858973997910889e-01 5.234530196411122382e-01
++3.296321613618491964e-01 5.673978264587494769e-01 5.206643628468334839e-01
++3.169539434232791497e-01 5.615982678332219757e-01 5.179739584214747561e-01
++3.041848831902358996e-01 5.557790841809171489e-01 5.153814622924314248e-01
++2.913580245785495904e-01 5.499302942311713460e-01 5.128866030358065764e-01
++2.786210115475045712e-01 5.440237902965463501e-01 5.104770287408624263e-01
++2.658767813620477316e-01 5.380746002424073859e-01 5.081635613728290313e-01
++2.531728049963842264e-01 5.320730905152252221e-01 5.059419345415738789e-01
++2.405801746352321802e-01 5.260084224989675095e-01 5.037958873725133513e-01
++2.281731742156575815e-01 5.198710287686101328e-01 5.017115180274238639e-01
++2.160357564123031038e-01 5.136521477693153370e-01 4.996732344467323395e-01
++2.042553268175122949e-01 5.073441845910725556e-01 4.976709295334373340e-01
++1.929455786157068808e-01 5.009402502860922368e-01 4.956743078037426087e-01
++1.822159137211172564e-01 4.944360671084672698e-01 4.936576912144489682e-01
++1.721720047662203268e-01 4.878296612331804449e-01 4.915973661753361701e-01
++1.629121950514905992e-01 4.811217814834132800e-01 4.894661845895681984e-01
++1.545167219577190942e-01 4.743156260955230796e-01 4.872413962325574111e-01
++1.470425142510033700e-01 4.674166983864977420e-01 4.849028953714263346e-01
++1.405113128544070999e-01 4.604338355815827399e-01 4.824271757570474661e-01
++1.349217530726786463e-01 4.533748092665628726e-01 4.798101955391982920e-01
++1.302797342394179658e-01 4.462455116423036938e-01 4.770426757084247904e-01
++1.265939811024292538e-01 4.390496902560914738e-01 4.741166274104288703e-01
++1.236843852121248255e-01 4.318074599363258548e-01 4.710274926158040665e-01
++1.214646610875383670e-01 4.245259430194671113e-01 4.677892044131184979e-01
++1.198403481002758841e-01 4.172122902240388842e-01 4.644123639304529871e-01
++1.184609210323855077e-01 4.098925950294425857e-01 4.609615952184937249e-01
++1.168754986210283897e-01 4.026022451761210874e-01 4.575160089880971337e-01
++1.151007877850314109e-01 3.953385852310392079e-01 4.540805121238136732e-01
++1.131413084296974680e-01 3.881005310447923073e-01 4.506558243985225309e-01
++1.110221391582094097e-01 3.808834919340156611e-01 4.472532258515609649e-01
++1.087511055351796929e-01 3.736854209969548424e-01 4.438760147968137115e-01
++1.063262941094024749e-01 3.665057054845847206e-01 4.405230161394063093e-01
++1.037537167610996236e-01 3.593424059991345287e-01 4.371963158215718681e-01
++1.010396012430455071e-01 3.521934333571229425e-01 4.338979957908608021e-01
++9.820785452879465804e-02 3.450535925989220432e-01 4.306390199340546787e-01
++9.524886735285809092e-02 3.379231538671472745e-01 4.274136452659025309e-01
++9.216708027427711336e-02 3.307999936437661659e-01 4.242225680363120865e-01
++8.898719812499519821e-02 3.236783223748895821e-01 4.210773055644454477e-01
++8.570498821294705860e-02 3.165572544150943024e-01 4.179737087144154706e-01
++8.232861945095013012e-02 3.094336626170069993e-01 4.149138402418848237e-01
++7.888091832597513009e-02 3.023016385852106969e-01 4.119079586942359095e-01
++7.535426196281005962e-02 2.951606915265346798e-01 4.089483103763945637e-01
++7.178216232425585486e-02 2.880027122692483954e-01 4.060506695454764170e-01
++6.815855459758968227e-02 2.808269749834076956e-01 4.032054679392391150e-01
++6.448898508226078019e-02 2.736310489100942100e-01 4.004060238485768752e-01
++6.082018328964860360e-02 2.664035583373736138e-01 3.976774815474886093e-01
++5.716124112921574379e-02 2.591406963233486849e-01 3.950170320465338780e-01
++5.351466965820251415e-02 2.518414268825251989e-01 3.924068662312853450e-01
++4.993186694626653571e-02 2.444935102031051688e-01 3.898697442701583027e-01
++4.643877317377426844e-02 2.370912873691644052e-01 3.873999194228605614e-01
++4.308214165698193848e-02 2.296247589871482364e-01 3.850043813960570827e-01
++3.988193032745831340e-02 2.220895846072232227e-01 3.826648500695101207e-01
++3.696588053809187618e-02 2.144711117753294594e-01 3.803951582141073540e-01
++3.503963119120004355e-02 2.067382236169432175e-01 3.779948138188178319e-01
++3.478421889488789165e-02 1.988679039642712310e-01 3.751470684509792819e-01
++3.605446405610013977e-02 1.908764917041337605e-01 3.717394054831296146e-01
++3.860378491452313293e-02 1.827911805345073526e-01 3.676697392369102646e-01
++4.204158194669544574e-02 1.746484839257387567e-01 3.628639802125444569e-01
++4.580769332477269834e-02 1.664868235304900745e-01 3.572935027519454909e-01
++4.953046775643197425e-02 1.583391239953714225e-01 3.509783278645146609e-01
++5.294794616753940170e-02 1.502287847236943308e-01 3.439780107867805858e-01
++5.589746873554810730e-02 1.421689980048106428e-01 3.363784527482869824e-01
++5.832364005801801005e-02 1.341588757852459068e-01 3.282715328574966618e-01
++6.018929987904993867e-02 1.261942031427702726e-01 3.197538950865533303e-01
++6.152266558088163168e-02 1.182670459661474271e-01 3.108793933905304452e-01];
++      
++   otherwise 
++      error('Unrecognized colormap name.') 
++     
++
++end
++
++
++
++function varargout = colorspace(Conversion,varargin)
++%COLORSPACE  Transform a color image between color representations.
++%   B = COLORSPACE(S,A) transforms the color representation of image A
++%   where S is a string specifying the conversion.  The input array A 
++%   should be a real full double array of size Mx3 or MxNx3.  The output B 
++%   is the same size as A.
++%
++%   S tells the source and destination color spaces, S = 'dest<-src', or 
++%   alternatively, S = 'src->dest'.  Supported color spaces are
++%
++%     'RGB'              sRGB IEC 61966-2-1
++%     'YCbCr'            Luma + Chroma ("digitized" version of Y'PbPr)
++%     'JPEG-YCbCr'       Luma + Chroma space used in JFIF JPEG
++%     'YDbDr'            SECAM Y'DbDr Luma + Chroma
++%     'YPbPr'            Luma (ITU-R BT.601) + Chroma 
++%     'YUV'              NTSC PAL Y'UV Luma + Chroma
++%     'YIQ'              NTSC Y'IQ Luma + Chroma
++%     'HSV' or 'HSB'     Hue Saturation Value/Brightness
++%     'HSL' or 'HLS'     Hue Saturation Luminance
++%     'HSI'              Hue Saturation Intensity
++%     'XYZ'              CIE 1931 XYZ
++%     'Lab'              CIE 1976 L*a*b* (CIELAB)
++%     'Luv'              CIE L*u*v* (CIELUV)
++%     'LCH'              CIE L*C*H* (CIELCH)
++%     'CAT02 LMS'        CIE CAT02 LMS
++%
++%  All conversions assume 2 degree observer and D65 illuminant.
++%
++%  Color space names are case insensitive and spaces are ignored.  When 
++%  sRGB is the source or destination, it can be omitted. For example 
++%  'yuv<-' is short for 'yuv<-rgb'.
++%
++%  For sRGB, the values should be scaled between 0 and 1.  Beware that 
++%  transformations generally do not constrain colors to be "in gamut."  
++%  Particularly, transforming from another space to sRGB may obtain 
++%  R'G'B' values outside of the [0,1] range.  So the result should be 
++%  clamped to [0,1] before displaying:
++%     image(min(max(B,0),1));  % Clamp B to [0,1] and display
++%
++%  sRGB (Red Green Blue) is the (ITU-R BT.709 gamma-corrected) standard
++%  red-green-blue representation of colors used in digital imaging.  The 
++%  components should be scaled between 0 and 1.  The space can be 
++%  visualized geometrically as a cube.
++%  
++%  Y'PbPr, Y'CbCr, Y'DbDr, Y'UV, and Y'IQ are related to sRGB by linear
++%  transformations.  These spaces separate a color into a grayscale
++%  luminance component Y and two chroma components.  The valid ranges of
++%  the components depends on the space.
++%
++%  HSV (Hue Saturation Value) is related to sRGB by
++%     H = hexagonal hue angle   (0 <= H < 360),
++%     S = C/V                   (0 <= S <= 1),
++%     V = max(R',G',B')         (0 <= V <= 1),
++%  where C = max(R',G',B') - min(R',G',B').  The hue angle H is computed on
++%  a hexagon.  The space is geometrically a hexagonal cone.
++%
++%  HSL (Hue Saturation Lightness) is related to sRGB by
++%     H = hexagonal hue angle                (0 <= H < 360),
++%     S = C/(1 - |2L-1|)                     (0 <= S <= 1),
++%     L = (max(R',G',B') + min(R',G',B'))/2  (0 <= L <= 1),
++%  where H and C are the same as in HSV.  Geometrically, the space is a
++%  double hexagonal cone.
++%
++%  HSI (Hue Saturation Intensity) is related to sRGB by
++%     H = polar hue angle        (0 <= H < 360),
++%     S = 1 - min(R',G',B')/I    (0 <= S <= 1),
++%     I = (R'+G'+B')/3           (0 <= I <= 1).
++%  Unlike HSV and HSL, the hue angle H is computed on a circle rather than
++%  a hexagon. 
++%
++%  CIE XYZ is related to sRGB by inverse gamma correction followed by a
++%  linear transform.  Other CIE color spaces are defined relative to XYZ.
++%
++%  CIE L*a*b*, L*u*v*, and L*C*H* are nonlinear functions of XYZ.  The L*
++%  component is designed to match closely with human perception of
++%  lightness.  The other two components describe the chroma.
++%
++%  CIE CAT02 LMS is the linear transformation of XYZ using the MCAT02 
++%  chromatic adaptation matrix.  The space is designed to model the 
++%  response of the three types of cones in the human eye, where L, M, S,
++%  correspond respectively to red ("long"), green ("medium"), and blue
++%  ("short").
++
++% Pascal Getreuer 2005-2010
++
++
++%%% Input parsing %%%
++if nargin < 2, error('Not enough input arguments.'); end
++[SrcSpace,DestSpace] = parse(Conversion);
++
++if nargin == 2
++   Image = varargin{1};
++elseif nargin >= 3
++   Image = cat(3,varargin{:});
++else
++   error('Invalid number of input arguments.');
++end
++
++FlipDims = (size(Image,3) == 1);
++
++if FlipDims, Image = permute(Image,[1,3,2]); end
++if ~isa(Image,'double'), Image = double(Image)/255; end
++if size(Image,3) ~= 3, error('Invalid input size.'); end
++
++SrcT = gettransform(SrcSpace);
++DestT = gettransform(DestSpace);
++
++if ~ischar(SrcT) && ~ischar(DestT)
++   % Both source and destination transforms are affine, so they
++   % can be composed into one affine operation
++   T = [DestT(:,1:3)*SrcT(:,1:3),DestT(:,1:3)*SrcT(:,4)+DestT(:,4)];      
++   Temp = zeros(size(Image));
++   Temp(:,:,1) = T(1)*Image(:,:,1) + T(4)*Image(:,:,2) + T(7)*Image(:,:,3) + T(10);
++   Temp(:,:,2) = T(2)*Image(:,:,1) + T(5)*Image(:,:,2) + T(8)*Image(:,:,3) + T(11);
++   Temp(:,:,3) = T(3)*Image(:,:,1) + T(6)*Image(:,:,2) + T(9)*Image(:,:,3) + T(12);
++   Image = Temp;
++elseif ~ischar(DestT)
++   Image = rgb(Image,SrcSpace);
++   Temp = zeros(size(Image));
++   Temp(:,:,1) = DestT(1)*Image(:,:,1) + DestT(4)*Image(:,:,2) + DestT(7)*Image(:,:,3) + DestT(10);
++   Temp(:,:,2) = DestT(2)*Image(:,:,1) + DestT(5)*Image(:,:,2) + DestT(8)*Image(:,:,3) + DestT(11);
++   Temp(:,:,3) = DestT(3)*Image(:,:,1) + DestT(6)*Image(:,:,2) + DestT(9)*Image(:,:,3) + DestT(12);
++   Image = Temp;
++else
++   Image = feval(DestT,Image,SrcSpace);
++end
++
++%%% Output format %%%
++if nargout > 1
++   varargout = {Image(:,:,1),Image(:,:,2),Image(:,:,3)};
++else
++   if FlipDims, Image = permute(Image,[1,3,2]); end
++   varargout = {Image};
++end
++
++return;
++
++
++function [SrcSpace,DestSpace] = parse(Str)
++% Parse conversion argument
++
++if ischar(Str)
++   Str = lower(strrep(strrep(Str,'-',''),'=',''));
++   k = find(Str == '>');
++   
++   if length(k) == 1         % Interpret the form 'src->dest'
++      SrcSpace = Str(1:k-1);
++      DestSpace = Str(k+1:end);
++   else
++      k = find(Str == '<');
++      
++      if length(k) == 1      % Interpret the form 'dest<-src'
++         DestSpace = Str(1:k-1);
++         SrcSpace = Str(k+1:end);
++      else
++         error(['Invalid conversion, ''',Str,'''.']);
++      end   
++   end
++   
++   SrcSpace = alias(SrcSpace);
++   DestSpace = alias(DestSpace);
++else
++   SrcSpace = 1;             % No source pre-transform
++   DestSpace = Conversion;
++   if any(size(Conversion) ~= 3), error('Transformation matrix must be 3x3.'); end
++end
++return;
++
++
++function Space = alias(Space)
++Space = strrep(strrep(Space,'cie',''),' ','');
++
++if isempty(Space)
++   Space = 'rgb';
++end
++
++switch Space
++case {'ycbcr','ycc'}
++   Space = 'ycbcr';
++case {'hsv','hsb'}
++   Space = 'hsv';
++case {'hsl','hsi','hls'}
++   Space = 'hsl';
++case {'rgb','yuv','yiq','ydbdr','ycbcr','jpegycbcr','xyz','lab','luv','lch'}
++   return;
++end
++return;
++
++
++function T = gettransform(Space)
++% Get a colorspace transform: either a matrix describing an affine transform,
++% or a string referring to a conversion subroutine
++switch Space
++case 'ypbpr'
++   T = [0.299,0.587,0.114,0;-0.1687367,-0.331264,0.5,0;0.5,-0.418688,-0.081312,0];
++case 'yuv'
++   % sRGB to NTSC/PAL YUV
++   % Wikipedia: http://en.wikipedia.org/wiki/YUV
++   T = [0.299,0.587,0.114,0;-0.147,-0.289,0.436,0;0.615,-0.515,-0.100,0];
++case 'ydbdr'
++   % sRGB to SECAM YDbDr
++   % Wikipedia: http://en.wikipedia.org/wiki/YDbDr
++   T = [0.299,0.587,0.114,0;-0.450,-0.883,1.333,0;-1.333,1.116,0.217,0];
++case 'yiq'
++   % sRGB in [0,1] to NTSC YIQ in [0,1];[-0.595716,0.595716];[-0.522591,0.522591];
++   % Wikipedia: http://en.wikipedia.org/wiki/YIQ
++   T = [0.299,0.587,0.114,0;0.595716,-0.274453,-0.321263,0;0.211456,-0.522591,0.311135,0];
++case 'ycbcr'
++   % sRGB (range [0,1]) to ITU-R BRT.601 (CCIR 601) Y'CbCr
++   % Wikipedia: http://en.wikipedia.org/wiki/YCbCr
++   % Poynton, Equation 3, scaling of R'G'B to Y'PbPr conversion
++   T = [65.481,128.553,24.966,16;-37.797,-74.203,112.0,128;112.0,-93.786,-18.214,128];
++case 'jpegycbcr'
++   % Wikipedia: http://en.wikipedia.org/wiki/YCbCr
++   T = [0.299,0.587,0.114,0;-0.168736,-0.331264,0.5,0.5;0.5,-0.418688,-0.081312,0.5]*255;
++case {'rgb','xyz','hsv','hsl','lab','luv','lch','cat02lms'}
++   T = Space;
++otherwise
++   error(['Unknown color space, ''',Space,'''.']);
++end
++return;
++
++
++function Image = rgb(Image,SrcSpace)
++% Convert to sRGB from 'SrcSpace'
++switch SrcSpace
++case 'rgb'
++   return;
++case 'hsv'
++   % Convert HSV to sRGB
++   Image = huetorgb((1 - Image(:,:,2)).*Image(:,:,3),Image(:,:,3),Image(:,:,1));
++case 'hsl'
++   % Convert HSL to sRGB
++   L = Image(:,:,3);
++   Delta = Image(:,:,2).*min(L,1-L);
++   Image = huetorgb(L-Delta,L+Delta,Image(:,:,1));
++case {'xyz','lab','luv','lch','cat02lms'}
++   % Convert to CIE XYZ
++   Image = xyz(Image,SrcSpace);
++   % Convert XYZ to RGB
++   T = [3.2406, -1.5372, -0.4986; -0.9689, 1.8758, 0.0415; 0.0557, -0.2040, 1.057];
++   R = T(1)*Image(:,:,1) + T(4)*Image(:,:,2) + T(7)*Image(:,:,3);  % R
++   G = T(2)*Image(:,:,1) + T(5)*Image(:,:,2) + T(8)*Image(:,:,3);  % G
++   B = T(3)*Image(:,:,1) + T(6)*Image(:,:,2) + T(9)*Image(:,:,3);  % B
++   % Desaturate and rescale to constrain resulting RGB values to [0,1]   
++   AddWhite = -min(min(min(R,G),B),0);
++   R = R + AddWhite;
++   G = G + AddWhite;
++   B = B + AddWhite;
++   % Apply gamma correction to convert linear RGB to sRGB
++   Image(:,:,1) = gammacorrection(R);  % R'
++   Image(:,:,2) = gammacorrection(G);  % G'
++   Image(:,:,3) = gammacorrection(B);  % B'
++otherwise  % Conversion is through an affine transform
++   T = gettransform(SrcSpace);
++   temp = inv(T(:,1:3));
++   T = [temp,-temp*T(:,4)];
++   R = T(1)*Image(:,:,1) + T(4)*Image(:,:,2) + T(7)*Image(:,:,3) + T(10);
++   G = T(2)*Image(:,:,1) + T(5)*Image(:,:,2) + T(8)*Image(:,:,3) + T(11);
++   B = T(3)*Image(:,:,1) + T(6)*Image(:,:,2) + T(9)*Image(:,:,3) + T(12);
++   Image(:,:,1) = R;
++   Image(:,:,2) = G;
++   Image(:,:,3) = B;
++end
++
++% Clip to [0,1]
++Image = min(max(Image,0),1);
++return;
++
++
++function Image = xyz(Image,SrcSpace)
++% Convert to CIE XYZ from 'SrcSpace'
++WhitePoint = [0.950456,1,1.088754];  
++
++switch SrcSpace
++case 'xyz'
++   return;
++case 'luv'
++   % Convert CIE L*uv to XYZ
++   WhitePointU = (4*WhitePoint(1))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
++   WhitePointV = (9*WhitePoint(2))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
++   L = Image(:,:,1);
++   Y = (L + 16)/116;
++   Y = invf(Y)*WhitePoint(2);
++   U = Image(:,:,2)./(13*L + 1e-6*(L==0)) + WhitePointU;
++   V = Image(:,:,3)./(13*L + 1e-6*(L==0)) + WhitePointV;
++   Image(:,:,1) = -(9*Y.*U)./((U-4).*V - U.*V);                  % X
++   Image(:,:,2) = Y;                                             % Y
++   Image(:,:,3) = (9*Y - (15*V.*Y) - (V.*Image(:,:,1)))./(3*V);  % Z
++case {'lab','lch'}
++   Image = lab(Image,SrcSpace);
++   % Convert CIE L*ab to XYZ
++   fY = (Image(:,:,1) + 16)/116;
++   fX = fY + Image(:,:,2)/500;
++   fZ = fY - Image(:,:,3)/200;
++   Image(:,:,1) = WhitePoint(1)*invf(fX);  % X
++   Image(:,:,2) = WhitePoint(2)*invf(fY);  % Y
++   Image(:,:,3) = WhitePoint(3)*invf(fZ);  % Z
++case 'cat02lms'
++    % Convert CAT02 LMS to XYZ
++   T = inv([0.7328, 0.4296, -0.1624;-0.7036, 1.6975, 0.0061; 0.0030, 0.0136, 0.9834]);
++   L = Image(:,:,1);
++   M = Image(:,:,2);
++   S = Image(:,:,3);
++   Image(:,:,1) = T(1)*L + T(4)*M + T(7)*S;  % X 
++   Image(:,:,2) = T(2)*L + T(5)*M + T(8)*S;  % Y
++   Image(:,:,3) = T(3)*L + T(6)*M + T(9)*S;  % Z
++otherwise   % Convert from some gamma-corrected space
++   % Convert to sRGB
++   Image = rgb(Image,SrcSpace);
++   % Undo gamma correction
++   R = invgammacorrection(Image(:,:,1));
++   G = invgammacorrection(Image(:,:,2));
++   B = invgammacorrection(Image(:,:,3));
++   % Convert RGB to XYZ
++   T = inv([3.2406, -1.5372, -0.4986; -0.9689, 1.8758, 0.0415; 0.0557, -0.2040, 1.057]);
++   Image(:,:,1) = T(1)*R + T(4)*G + T(7)*B;  % X 
++   Image(:,:,2) = T(2)*R + T(5)*G + T(8)*B;  % Y
++   Image(:,:,3) = T(3)*R + T(6)*G + T(9)*B;  % Z
++end
++return;
++
++
++function Image = hsv(Image,SrcSpace)
++% Convert to HSV
++Image = rgb(Image,SrcSpace);
++V = max(Image,[],3);
++S = (V - min(Image,[],3))./(V + (V == 0));
++Image(:,:,1) = rgbtohue(Image);
++Image(:,:,2) = S;
++Image(:,:,3) = V;
++return;
++
++
++function Image = hsl(Image,SrcSpace)
++% Convert to HSL 
++switch SrcSpace
++case 'hsv'
++   % Convert HSV to HSL   
++   MaxVal = Image(:,:,3);
++   MinVal = (1 - Image(:,:,2)).*MaxVal;
++   L = 0.5*(MaxVal + MinVal);
++   temp = min(L,1-L);
++   Image(:,:,2) = 0.5*(MaxVal - MinVal)./(temp + (temp == 0));
++   Image(:,:,3) = L;
++otherwise
++   Image = rgb(Image,SrcSpace);  % Convert to sRGB
++   % Convert sRGB to HSL
++   MinVal = min(Image,[],3);
++   MaxVal = max(Image,[],3);
++   L = 0.5*(MaxVal + MinVal);
++   temp = min(L,1-L);
++   S = 0.5*(MaxVal - MinVal)./(temp + (temp == 0));
++   Image(:,:,1) = rgbtohue(Image);
++   Image(:,:,2) = S;
++   Image(:,:,3) = L;
++end
++return;
++
++
++function Image = lab(Image,SrcSpace)
++% Convert to CIE L*a*b* (CIELAB)
++WhitePoint = [0.950456,1,1.088754];
++
++switch SrcSpace
++case 'lab'
++   return;
++case 'lch'
++   % Convert CIE L*CH to CIE L*ab
++   C = Image(:,:,2);
++   Image(:,:,2) = cos(Image(:,:,3)*pi/180).*C;  % a*
++   Image(:,:,3) = sin(Image(:,:,3)*pi/180).*C;  % b*
++otherwise
++   Image = xyz(Image,SrcSpace);  % Convert to XYZ
++   % Convert XYZ to CIE L*a*b*
++   X = Image(:,:,1)/WhitePoint(1);
++   Y = Image(:,:,2)/WhitePoint(2);
++   Z = Image(:,:,3)/WhitePoint(3);
++   fX = f(X);
++   fY = f(Y);
++   fZ = f(Z);
++   Image(:,:,1) = 116*fY - 16;    % L*
++   Image(:,:,2) = 500*(fX - fY);  % a*
++   Image(:,:,3) = 200*(fY - fZ);  % b*
++end
++return;
++
++
++function Image = luv(Image,SrcSpace)
++% Convert to CIE L*u*v* (CIELUV)
++WhitePoint = [0.950456,1,1.088754];
++WhitePointU = (4*WhitePoint(1))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
++WhitePointV = (9*WhitePoint(2))./(WhitePoint(1) + 15*WhitePoint(2) + 3*WhitePoint(3));
++
++Image = xyz(Image,SrcSpace); % Convert to XYZ
++Denom = Image(:,:,1) + 15*Image(:,:,2) + 3*Image(:,:,3);
++U = (4*Image(:,:,1))./(Denom + (Denom == 0));
++V = (9*Image(:,:,2))./(Denom + (Denom == 0));
++Y = Image(:,:,2)/WhitePoint(2);
++L = 116*f(Y) - 16;
++Image(:,:,1) = L;                        % L*
++Image(:,:,2) = 13*L.*(U - WhitePointU);  % u*
++Image(:,:,3) = 13*L.*(V - WhitePointV);  % v*
++return;  
++
++
++function Image = lch(Image,SrcSpace)
++% Convert to CIE L*ch
++Image = lab(Image,SrcSpace);  % Convert to CIE L*ab
++H = atan2(Image(:,:,3),Image(:,:,2));
++H = H*180/pi + 360*(H < 0);
++Image(:,:,2) = sqrt(Image(:,:,2).^2 + Image(:,:,3).^2);  % C
++Image(:,:,3) = H;                                        % H
++return;
++
++
++function Image = cat02lms(Image,SrcSpace)
++% Convert to CAT02 LMS
++Image = xyz(Image,SrcSpace);
++T = [0.7328, 0.4296, -0.1624;-0.7036, 1.6975, 0.0061; 0.0030, 0.0136, 0.9834];
++X = Image(:,:,1);
++Y = Image(:,:,2);
++Z = Image(:,:,3);
++Image(:,:,1) = T(1)*X + T(4)*Y + T(7)*Z;  % L
++Image(:,:,2) = T(2)*X + T(5)*Y + T(8)*Z;  % M
++Image(:,:,3) = T(3)*X + T(6)*Y + T(9)*Z;  % S
++return;
++
++
++function Image = huetorgb(m0,m2,H)
++% Convert HSV or HSL hue to RGB
++N = size(H);
++H = min(max(H(:),0),360)/60;
++m0 = m0(:);
++m2 = m2(:);
++F = H - round(H/2)*2;
++M = [m0, m0 + (m2-m0).*abs(F), m2];
++Num = length(m0);
++j = [2 1 0;1 2 0;0 2 1;0 1 2;1 0 2;2 0 1;2 1 0]*Num;
++k = floor(H) + 1;
++Image = reshape([M(j(k,1)+(1:Num).'),M(j(k,2)+(1:Num).'),M(j(k,3)+(1:Num).')],[N,3]);
++return;
++
++
++function H = rgbtohue(Image)
++% Convert RGB to HSV or HSL hue
++[M,i] = sort(Image,3);
++i = i(:,:,3);
++Delta = M(:,:,3) - M(:,:,1);
++Delta = Delta + (Delta == 0);
++R = Image(:,:,1);
++G = Image(:,:,2);
++B = Image(:,:,3);
++H = zeros(size(R));
++k = (i == 1);
++H(k) = (G(k) - B(k))./Delta(k);
++k = (i == 2);
++H(k) = 2 + (B(k) - R(k))./Delta(k);
++k = (i == 3);
++H(k) = 4 + (R(k) - G(k))./Delta(k);
++H = 60*H + 360*(H < 0);
++H(Delta == 0) = nan;
++return;
++
++
++function Rp = gammacorrection(R)
++Rp = zeros(size(R));
++i = (R <= 0.0031306684425005883);
++Rp(i) = 12.92*R(i);
++Rp(~i) = real(1.055*R(~i).^0.416666666666666667 - 0.055);
++return;
++
++
++function R = invgammacorrection(Rp)
++R = zeros(size(Rp));
++i = (Rp <= 0.0404482362771076);
++R(i) = Rp(i)/12.92;
++R(~i) = real(((Rp(~i) + 0.055)/1.055).^2.4);
++return;
++
++
++function fY = f(Y)
++fY = real(Y.^(1/3));
++i = (Y < 0.008856);
++fY(i) = Y(i)*(841/108) + (4/29);
++return;
++
++
++function Y = invf(fY)
++Y = fY.^3;
++i = (Y < 0.008856);
++Y(i) = (fY(i) - 4/29)*(108/841);
++return;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26519-26520.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26519-26520.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26519-26520.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/test/NightlyRun/test134.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test134.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test134.m	(revision 26520)
+@@ -0,0 +1,15 @@
++%Test Name: SquareShelfConstrainedSampling
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelfConstrained.par');
++md = md.sampling.setparameters(md,2e5,1);
++md.sampling.seed = 100;
++md.cluster=generic('name',oshostname(),'np',1);
++md=solve(md,'smp');
++
++%Fields and tolerances to track changes
++field_names     ={'Sample'};
++field_tolerances={1e-13};
++field_values={...
++	(md.results.SamplingSolution.Sample),...
++	};
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26520-26521.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26520-26521.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26520-26521.diff	(revision 26740)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive134.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26521-26522.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26521-26522.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26521-26522.diff	(revision 26740)
@@ -0,0 +1,696 @@
+Index: ../trunk-jpl/src/jl/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/classes.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/classes.jl	(revision 26522)
+@@ -0,0 +1,166 @@
++using Printf
++
++abstract type AbstractMesh end
++mutable struct Mesh2dTriangle <: AbstractMesh
++	numberofvertices::Int64
++	numberofelements::Int64
++	x::Vector{Float64}
++	y::Vector{Float64}
++	elements::Matrix{Int64}
++	segments::Matrix{Int64}
++	vertexonboundary::Vector{Bool}
++end
++function Mesh2dTriangle() #{{{
++	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
++end# }}}
++function Base.show(io::IO, this::Mesh2dTriangle)# {{{
++
++	println(io,typeof(this),":")
++	for name in fieldnames(typeof(this))
++		a=getfield(this,name)
++		#print(io,"   $(name) = ")
++		@printf "%19s: " name
++		if isa(a,String)
++			println(io, a)
++		elseif length(a)>1
++			if !isempty(a)
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,"empty")
++			end
++		else
++			println(io, a)
++		end
++	end
++end# }}}
++mutable struct Mesh3dPrism{T} <: AbstractMesh
++	numberofvertices::Int64
++	numberofelements::Int64
++	numberoflayers::Int64
++	x::Vector{Float64}
++	y::Vector{Float64}
++	z::Vector{Float64}
++	elements::Matrix{Int64}
++	segments::Matrix{Int64}
++	vertexonboundary::Vector{Bool}
++end
++function Mesh3dPrism() #{{{
++	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
++end# }}}
++
++mutable struct Geometry
++	surface::Vector{Float64}
++	base::Vector{Float64}
++	thickness::Vector{Float64}
++	bed::Vector{Float64}
++end
++function Geometry() #{{{
++	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Mask
++	ocean_levelset::Vector{Float64}
++	ice_levelset::Vector{Float64}
++end
++function Mask() #{{{
++	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Initialization
++	vx::Vector{Float64}
++	vy::Vector{Float64}
++end
++function Initialization() #{{{
++	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Stressbalance
++	spcvx::Vector{Float64}
++	spcvy::Vector{Float64}
++	restol::Float64
++	reltol::Float64
++	abstol::Float64
++	maxiter::Int64
++end
++function Stressbalance() #{{{
++	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 1.e-4, 0.01, 10., 100)
++end# }}}
++function Base.show(io::IO, this::Stressbalance)# {{{
++
++	println(io,typeof(this),":")
++	for name in fieldnames(typeof(this))
++		a=getfield(this,name)
++		#print(io,"   $(name) = ")
++		@printf "%19s: " name
++		if isa(a,String)
++			println(io, a)
++		elseif length(a)>1
++			if !isempty(a)
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,"empty")
++			end
++		else
++			println(io, a)
++		end
++	end
++end# }}}
++
++mutable struct Constants
++	g::Float64
++	yts::Float64
++end
++function Constants() #{{{
++	return Constants( 9.81,  365*24*3600.)
++end# }}}
++
++mutable struct Materials
++	rho_ice::Float64
++	rho_water::Float64
++	rho_freshwater::Float64
++	mu_water::Float64
++	heatcapacity::Float64
++	latentheat::Float64
++	thermalconductivity::Float64
++	temperateiceconductivity::Float64
++	effectiveconductivity_averaging::Int64
++	meltingpoint::Float64
++	beta::Float64
++	mixed_layer_capacity::Float64
++	thermal_exchange_velocity::Float64
++	rheology_B::Vector{Float64}
++	rheology_n::Vector{Float64}
++	rheology_law::String
++end
++function Materials() #{{{
++	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
++end# }}}
++
++mutable struct model
++	mesh::AbstractMesh
++	geometry::Geometry
++	mask::Mask
++	materials::Materials
++	initialization::Initialization
++	stressbalance::Stressbalance
++	constants::Constants
++end
++function model() #{{{
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants())
++end#}}}
++function Base.show(io::IO, md::model)# {{{
++
++	compact = get(io, :compact, false)
++
++	println(io,"Model:")
++	@printf "%19s: %-22s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
++	@printf "%19s: %-22s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
++	@printf "%19s: %-22s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
++	@printf "%19s: %-22s -- %s\n" "materials" typeof(md.materials) "material properties"
++	@printf "%19s: %-22s -- %s\n" "initialization" typeof(md.initialization) "initial state"
++	@printf "%19s: %-22s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
++	@printf "%19s: %-22s -- %s\n" "constants" typeof(md.constants) "physical constants"
++
++end# }}}
++
++
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26521)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26522)
+@@ -1,237 +1,15 @@
+-using Printf
++# Julia version of the Ice-sheet and Sea-level System Model
++#
++# Author: Mathieu Morlighem
++# email:  mathieu.morlighem@dartmouth.edu
+ 
+-#Define classes used by model struct
+-abstract type AbstractMesh end
+-mutable struct Mesh2dTriangle <: AbstractMesh
+-	numberofvertices::Int64
+-	numberofelements::Int64
+-	x::Vector{Float64}
+-	y::Vector{Float64}
+-	elements::Matrix{Int64}
+-end
+-function Mesh2dTriangle() #{{{
+-	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0))
+-end# }}}
+-function Base.show(io::IO, this::Mesh2dTriangle)# {{{
++module ISSM
+ 
+-	println(io,typeof(this),":")
+-	for name in fieldnames(typeof(this))
+-		a=getfield(this,name)
+-		print(io,"   $(name) = ")
+-		if !isempty(a)
+-			println(io, typeof(a), " of size ", size(a))
+-		else
+-			println(io,"empty")
+-		end
+-	end
+-end# }}}
+-mutable struct Mesh3dPrism{T} <: AbstractMesh
+-	numberofvertices::Int64
+-	numberofelements::Int64
+-	numberoflayers::Int64
+-	x::Vector{Float64}
+-	y::Vector{Float64}
+-	z::Vector{Float64}
+-	elements::Matrix{Int64}
+-end
+-function Mesh3dPrism() #{{{
+-	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0))
+-end# }}}
+-mutable struct Geometry
+-	surface::Vector{Float64}
+-	base::Vector{Float64}
+-	thickness::Vector{Float64}
+-	bed::Vector{Float64}
+-end
+-function Geometry() #{{{
+-	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-mutable struct Mask
+-	ocean_levelset::Vector{Float64}
+-	ice_levelset::Vector{Float64}
+-end
+-function Mask() #{{{
+-	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-mutable struct Initialization
+-	vx::Vector{Float64}
+-	vy::Vector{Float64}
+-end
+-function Initialization() #{{{
+-	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-mutable struct Stressbalance
+-	spcvx::Vector{Float64}
+-	spcvy::Vector{Float64}
+-	restol::Float64
+-	reltol::Float64
+-	abstol::Float64
+-	maxiter::Int64
+-end
+-function Stressbalance() #{{{
+-	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 0., 0., 0., 0)
+-end# }}}
+-mutable struct Constants
+-	g::Float64
+-	yts::Float64
+-end
+-function Constants() #{{{
+-	return Constants( 9.81,  365*24*3600.)
+-end# }}}
+-mutable struct Materials
+-	rho_ice::Float64
+-	rho_water::Float64
+-	rho_freshwater::Float64
+-	mu_water::Float64
+-	heatcapacity::Float64
+-	latentheat::Float64
+-	thermalconductivity::Float64
+-	temperateiceconductivity::Float64
+-	effectiveconductivity_averaging::Int64
+-	meltingpoint::Float64
+-	beta::Float64
+-	mixed_layer_capacity::Float64
+-	thermal_exchange_velocity::Float64
+-	rheology_B::Vector{Float64}
+-	rheology_n::Vector{Float64}
+-	rheology_law::String
+-end
+-function Materials() #{{{
+-	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
+-end# }}}
++include("classes.jl")
++include("utils.jl")
++include("triangle.jl")
++include("parameterization.jl")
++include("solve.jl")
++#include("plotmodel.jl")
+ 
+-mutable struct model
+-	mesh::AbstractMesh
+-	geometry::Geometry
+-	mask::Mask
+-	materials::Materials
+-	initialization::Initialization
+-	stressbalance::Stressbalance
+-	constants::Constants
+ end
+-function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants())
+-end#}}}
+-function Base.show(io::IO, md::model)# {{{
+-
+-	compact = get(io, :compact, false)
+-
+-	println(io,"Model:")
+-	@printf "%19s: %-22s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
+-	@printf "%19s: %-22s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
+-	@printf "%19s: %-22s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+-	@printf "%19s: %-22s -- %s\n" "materials" typeof(md.materials) "material properties"
+-	@printf "%19s: %-22s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+-	@printf "%19s: %-22s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
+-	@printf "%19s: %-22s -- %s\n" "constants" typeof(md.constants) "physical constants"
+-
+-end# }}}
+-
+-#utils
+-function issmdir() #{{{
+-	issmdir = ENV["ISSM_DIR"]
+-
+-	if isempty(issmdir)
+-		error("Could not determine the location of ISSM")
+-	else
+-		return issmdir
+-	end
+-end#}}}
+-function archread(filename::String,variablename::String) #{{{
+-
+-	#initialize variables
+-	found = false
+-
+-	#open file
+-	output = open(filename, "r") do f
+-
+-		while !eof(f)
+-			reclen  = bswap(read(f, Int32))
+-			rectype = bswap(read(f, Int32))
+-			if rectype!=1
+-				error("Expected variable of type string")
+-			else
+-				fieldname_length = bswap(read(f, Int32))
+-				field_name = String(read(f, fieldname_length))
+-			end
+-			rec_length = bswap(read(f, Int32))
+-			field_type = bswap(read(f, Int32))
+-			if field_type==2
+-				data = bswap(read(f, Float64))
+-			elseif field_type==3
+-				rows = bswap(read(f, Int32))
+-				cols = bswap(read(f, Int32))
+-				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
+-				data .= ntoh.(data)
+-				data = reshape(data, (rows,cols))
+-				data = collect(data)
+-				if cols == 1
+-					data = vec(data)
+-				end
+-			else
+-				error("Error: Encountered invalid field type when reading data.")
+-			end
+-
+-			if field_name == variablename
+-				found = true
+-				return data
+-			end
+-		end
+-	end
+-
+-	return output
+-end# }}}
+-function InterpFromMeshToMesh2d(index::Array,x::Vector,y::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
+-	#prepare input arrays
+-	nods = Cint(length(x))
+-	nels = Cint(size(index,1))
+-	nods_interp = Cint(length(xout))
+-	Cindex=Array{Cint,1}(undef,length(index))
+-	for i in 1:size(index,1)
+-		for j in 1:3
+-			Cindex[(i-1)*3+j] = Int32(index[i,j])
+-		end
+-	end
+-	Cx    = Array{Cdouble,1}(undef,nods)
+-	Cy    = Array{Cdouble,1}(undef,nods)
+-	Cdata = Array{Cdouble,1}(undef,nods)
+-	for i in 1:nods
+-		Cx[i]    = x[i]
+-		Cy[i]    = y[i]
+-		Cdata[i] = data[i]
+-	end
+-	Cxout = Array{Cdouble,1}(undef,nods_interp)
+-	Cyout = Array{Cdouble,1}(undef,nods_interp)
+-	for i in 1:nods_interp
+-		Cxout[i] = xout[i]
+-		Cyout[i] = yout[i]
+-	end
+-
+-	Cdataout = Vector{Float64}(undef,nods_interp)
+-
+-	#This is not working....
+-	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
+-				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
+-				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
+-				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
+-
+-	#Process output
+-	dataout = Vector{Float64}(undef,nods_interp)
+-	for i in 1:nods_interp
+-		dataout[i] = Cdataout[i]
+-	end
+-
+-	return dataout
+-end #}}}
+-function solve(md::model,solution::String) #{{{
+-
+-	if solution=="sb" || solution=="Stressbalance"
+-		solutionstring = "StressbalanceSolution"
+-	else
+-		error("solutionstring "*solution*" not supported!");
+-	end
+-
+-	IssmCore(md)
+-
+-	return md
+-end #}}}
+Index: ../trunk-jpl/src/jl/parameterization.jl
+===================================================================
+--- ../trunk-jpl/src/jl/parameterization.jl	(revision 26521)
++++ ../trunk-jpl/src/jl/parameterization.jl	(revision 26522)
+@@ -1,4 +1,4 @@
+-include("issm.jl")
++include("classes.jl")
+ include("exp.jl")
+ 
+ # setmask {{{
+Index: ../trunk-jpl/src/jl/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/plotmodel.jl	(revision 26521)
++++ ../trunk-jpl/src/jl/plotmodel.jl	(revision 26522)
+@@ -1,8 +1,10 @@
+ import ColorSchemes.jet
+ 
+ using GLMakie
++include("classes.jl")
++using .ISSM
+ 
+-function plotmodel(md::model,data)
++function plotmodel(md::ISSM.model,data::Vector)
+ 
+ 	vertexcolor  = :black
+ 	facetcolor   = :blue
+Index: ../trunk-jpl/src/jl/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve.jl	(revision 26521)
++++ ../trunk-jpl/src/jl/solve.jl	(revision 26522)
+@@ -1,4 +1,4 @@
+-include("issm.jl")
++include("classes.jl")
+ include("issmenums.jl")
+ 
+ #define classes first
+@@ -208,7 +208,6 @@
+ 	femmodel=ModelProcessor(md)
+ 
+ 	#Solve
+-	error("not there yet")
+ 	Stressbalance(femmodel)
+ 
+ 	#then what??
+@@ -316,8 +315,27 @@
+ 
+ end#}}}
+ function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
+-	error("stop")
++
++	#load constraints from model
++	spcvx = md.stressbalance.spcvx
++	spcvy = md.stressbalance.spcvy
++
++	count = 1
++	for i in 1:md.mesh.numberofvertices
++		if ~isnan(spcvx[i])
++			push!(constraints,Constraint(count,i,1,spcvx[i]))
++			count+=1
++		end
++		if ~isnan(spcvy[i])
++			push!(constraints,Constraint(count,i,2,spcvy[i]))
++			count+=1
++		end
++	end
++
+ end#}}}
++function Stressbalance(femmodel::FemModel)
++	error("STOP")
++end
+ 
+ #Element functions
+ function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26521)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26522)
+@@ -1,11 +1,10 @@
+ #!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+-include("triangle.jl")
+-include("parameterization.jl")
+-include("solve.jl")
++include("issm.jl")
++using .ISSM
+ 
+-md = model()
+-md = triangle(md,"../../test/Exp/Square.exp",180000.)
+-md = setmask(md,"all","")
++md = ISSM.model()
++md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.)
++md = ISSM.setmask(md,"all","")
+ 
+ #Geometry
+ hmin=300.
+@@ -20,11 +19,11 @@
+ md.geometry.bed       = md.geometry.base .-10
+ 
+ #Initial velocity
+-x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+-y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+-vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+-vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+-index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+ md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+ md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
+ 
+@@ -35,4 +34,11 @@
+ md.stressbalance.reltol=0.05
+ md.stressbalance.abstol=NaN
+ 
+-md=solve(md,"Stressbalance")
++#Boundary conditions
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary)
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=ISSM.solve(md,"Stressbalance")
+Index: ../trunk-jpl/src/jl/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/triangle.jl	(revision 26521)
++++ ../trunk-jpl/src/jl/triangle.jl	(revision 26522)
+@@ -50,7 +50,7 @@
+ end# }}}
+ 
+ using Printf #needed for sprintf
+-include("issm.jl")
++include("classes.jl")
+ include("exp.jl")
+ 
+ """
+@@ -161,6 +161,9 @@
+ 	#post process output
+ 	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
+ 	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
++	segments  = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.segmentlist,  (2,Int(ctio_out.numberofsegments)), own=true))' .+1
++	
++	#assign output
+ 	md.mesh = Mesh2dTriangle()
+ 	md.mesh.numberofvertices = ctio_out.numberofpoints
+ 	md.mesh.numberofelements = ctio_out.numberoftriangles
+@@ -167,6 +170,11 @@
+ 	md.mesh.x                = points[:,1]
+ 	md.mesh.y                = points[:,2]
+ 	md.mesh.elements         = triangles
++	md.mesh.segments         = segments
+ 
++	#post processing
++	md.mesh.vertexonboundary = zeros(Bool,md.mesh.numberofvertices)
++	md.mesh.vertexonboundary[md.mesh.segments] .= true
++
+    return md
+ end#}}}
+Index: ../trunk-jpl/src/jl/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/utils.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/utils.jl	(revision 26522)
+@@ -0,0 +1,108 @@
++#utils
++function issmdir() #{{{
++	issmdir = ENV["ISSM_DIR"]
++
++	if isempty(issmdir)
++		error("Could not determine the location of ISSM")
++	else
++		return issmdir
++	end
++end#}}}
++function archread(filename::String,variablename::String) #{{{
++
++	#initialize variables
++	found = false
++
++	#open file
++	output = open(filename, "r") do f
++
++		while !eof(f)
++			reclen  = bswap(read(f, Int32))
++			rectype = bswap(read(f, Int32))
++			if rectype!=1
++				error("Expected variable of type string")
++			else
++				fieldname_length = bswap(read(f, Int32))
++				field_name = String(read(f, fieldname_length))
++			end
++			rec_length = bswap(read(f, Int32))
++			field_type = bswap(read(f, Int32))
++			if field_type==2
++				data = bswap(read(f, Float64))
++			elseif field_type==3
++				rows = bswap(read(f, Int32))
++				cols = bswap(read(f, Int32))
++				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
++				data .= ntoh.(data)
++				data = reshape(data, (rows,cols))
++				data = collect(data)
++				if cols == 1
++					data = vec(data)
++				end
++			else
++				error("Error: Encountered invalid field type when reading data.")
++			end
++
++			if field_name == variablename
++				found = true
++				return data
++			end
++		end
++	end
++
++	return output
++end# }}}
++function InterpFromMeshToMesh2d(index::Array,x::Vector,y::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
++	#prepare input arrays
++	nods = Cint(length(x))
++	nels = Cint(size(index,1))
++	nods_interp = Cint(length(xout))
++	Cindex=Array{Cint,1}(undef,length(index))
++	for i in 1:size(index,1)
++		for j in 1:3
++			Cindex[(i-1)*3+j] = Int32(index[i,j])
++		end
++	end
++	Cx    = Array{Cdouble,1}(undef,nods)
++	Cy    = Array{Cdouble,1}(undef,nods)
++	Cdata = Array{Cdouble,1}(undef,nods)
++	for i in 1:nods
++		Cx[i]    = x[i]
++		Cy[i]    = y[i]
++		Cdata[i] = data[i]
++	end
++	Cxout = Array{Cdouble,1}(undef,nods_interp)
++	Cyout = Array{Cdouble,1}(undef,nods_interp)
++	for i in 1:nods_interp
++		Cxout[i] = xout[i]
++		Cyout[i] = yout[i]
++	end
++
++	Cdataout = Vector{Float64}(undef,nods_interp)
++
++	#This is not working....
++	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
++				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
++				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
++				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
++
++	#Process output
++	dataout = Vector{Float64}(undef,nods_interp)
++	for i in 1:nods_interp
++		dataout[i] = Cdataout[i]
++	end
++
++	return dataout
++end #}}}
++function solve(md::model,solution::String) #{{{
++
++	if solution=="sb" || solution=="Stressbalance"
++		solutionstring = "StressbalanceSolution"
++	else
++		error("solutionstring "*solution*" not supported!");
++	end
++
++	IssmCore(md)
++
++	return md
++end #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26522-26523.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26522-26523.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26522-26523.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26522)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26523)
+@@ -452,6 +452,7 @@
+ 	_printf0_("\n");
+ 
+ 	/*Clean-up and return*/
++	if(solution_type == TransientSolutionEnum) delete femmodel;
+ 	*Jlisti = (*Jlisti) +1;
+ 	xDelete<double>(XU);
+ 	xDelete<double>(XL);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26523-26524.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26523-26524.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26523-26524.diff	(revision 26740)
@@ -0,0 +1,447 @@
+Index: ../trunk-jpl/externalpackages/valgrind/issm.supp
+===================================================================
+--- ../trunk-jpl/externalpackages/valgrind/issm.supp	(revision 26523)
++++ ../trunk-jpl/externalpackages/valgrind/issm.supp	(revision 26524)
+@@ -309,6 +309,7 @@
+ 	  fun:dmumps_ana_driver_
+ 	  fun:dmumps_
+ }
++
+ {
+ 	<iparmetis1>
+ 	  Memcheck:Cond
+@@ -326,3 +327,433 @@
+ 	  fun:mumps_parmetis_
+ }
+ #}}}
++{
++   <main1>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:strdup
++   fun:mca_base_var_enum_create_flag
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-pal.so.20.10.1
++   fun:mca_base_framework_register
++   fun:mca_base_framework_open
++   fun:mca_base_framework_open
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++   fun:main
++}
++{
++   <main2>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:strdup
++   fun:mca_base_var_enum_create_flag
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++   fun:main
++}
++{
++   <main3>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:mca_base_component_repository_open
++   fun:mca_base_component_find
++   fun:mca_base_framework_components_register
++   fun:mca_base_framework_register
++   fun:mca_base_framework_open
++   fun:opal_init
++   fun:orte_init
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++   fun:main
++}
++{
++   <main4>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   obj:*
++   obj:*
++   fun:orte_oob_base_select
++   fun:orte_ess_base_app_setup
++   obj:*
++   fun:orte_init
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++   fun:main
++}
++{
++   <main5>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:PMIx_Store_internal
++   fun:pmix1_store_local
++   fun:orte_ess_base_app_setup
++   obj:*
++   fun:orte_init
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++   fun:main
++}
++{
++   <main6>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   obj:*
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++   fun:main
++}
++{
++   <main7>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:opal_free_list_grow_st
++   fun:opal_rb_tree_init
++   obj:*
++   obj:*
++   fun:mca_base_framework_components_open
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-pal.so.20.10.1
++   fun:mca_base_framework_open
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++   fun:main
++}
++{
++   <Z15>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:strdup
++   obj:*
++   obj:*
++   obj:*
++   obj:*
++   fun:ompi_mtl_base_select
++   obj:*
++   fun:mca_pml_base_select
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++   fun:_Z15EnvironmentInitiPPc
++}
++{
++   <clone1>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   fun:opal_libevent2022_event_base_loop
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   fun:start_thread
++   fun:clone
++}
++{
++   <clone2>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-rte.so.20.10.1
++   fun:orte_oob_base_set_addr
++   fun:opal_libevent2022_event_base_loop
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libopen-pal.so.20.10.1
++   fun:start_thread
++   fun:clone
++}
++{
++   <clone3>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   fun:opal_libevent2022_event_base_loop
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   fun:start_thread
++   fun:clone
++}
++{
++   <clone4>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   fun:opal_libevent2022_event_base_loop
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so
++   fun:start_thread
++   fun:clone
++}
++{
++   <dlopen>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:strdup
++   obj:*
++   fun:call_init
++   fun:_dl_init
++   fun:dl_open_worker
++   fun:_dl_catch_exception
++   fun:_dl_open
++   fun:dlopen_doit
++   fun:_dl_catch_exception
++   fun:_dl_catch_error
++   fun:_dlerror_run
++   fun:dlopen@@GLIBC_2.2.5
++}
++{
++   <ompi1>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   obj:*
++   obj:*
++   obj:*
++   obj:*
++   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
++   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
++   fun:hwloc_topology_set_xmlbuffer
++   obj:*
++   fun:orte_init
++   fun:ompi_mpi_init
++}
++{
++   <pmpi1>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   fun:lt__malloc
++   fun:lt__zalloc
++   obj:/usr/lib/x86_64-linux-gnu/libltdl.so.7.3.1
++   fun:lt_dlopenadvise
++   obj:*
++   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
++   fun:hwloc_topology_init
++   obj:*
++   fun:orte_init
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++}
++{
++   <pmpi2>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   obj:*
++   obj:*
++   obj:*
++   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
++   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
++   fun:hwloc_topology_set_xmlbuffer
++   obj:*
++   fun:orte_init
++   fun:ompi_mpi_init
++   fun:PMPI_Init
++}
++{
++   <hwloc>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   obj:*
++   fun:__pthread_once_slow
++   obj:*
++   obj:*
++   obj:*
++   obj:*
++   obj:*
++   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
++   obj:/usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6
++   fun:hwloc_topology_set_xmlbuffer
++}
++{
++   <petsc4>
++   Memcheck:Leak
++   match-leak-kinds: possible
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:PetscCommDuplicate
++   fun:PetscHeaderCreate_Private
++   fun:MatCreate
++}
++{
++   <petsc5>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:PetscCommDuplicate
++   fun:PetscHeaderCreate_Private
++   fun:MatCreate
++}
++{
++   <petsc6>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:PetscCommDuplicate
++   fun:PetscHeaderCreate_Private
++   fun:VecCreate
++}
++{
++   <petsc7>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:_Z20PetscInitializeMUMPSP6_p_MatP9Mat_MUMPS
++   obj:/usr/lib/x86_64-linux-gnu/libpetsc_real.so.3.7.7
++   fun:MatGetFactor
++}
++{
++   <mumps17>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:MPI_COMM_DUP
++   fun:dmumps_ini_driver_
++   fun:dmumps_
++}
++{
++   <mumps18>
++   Memcheck:Leak
++   match-leak-kinds: possible
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:MPI_COMM_DUP
++   fun:dmumps_ini_driver_
++   fun:dmumps_
++}
++{
++   <mumps19>
++   Memcheck:Leak
++   match-leak-kinds: possible
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:MPI_COMM_DUP
++   fun:dmumps_
++   fun:dmumps_f77_
++}
++{
++   <mumps20>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_dup_with_info
++   fun:PMPI_Comm_dup
++   fun:MPI_COMM_DUP
++   fun:dmumps_
++   fun:dmumps_f77_
++}
++{
++   <mumps21>
++   Memcheck:Leak
++   match-leak-kinds: definite
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_split
++   fun:PMPI_Comm_split
++   fun:MPI_COMM_SPLIT
++   fun:dmumps_fac_driver_
++   fun:dmumps_
++}
++{
++   <mumps22>
++   Memcheck:Leak
++   match-leak-kinds: possible
++   fun:malloc
++   obj:*
++   fun:mca_coll_base_comm_select
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   obj:/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20.10.1
++   fun:opal_progress
++   fun:ompi_comm_activate
++   fun:ompi_comm_split
++   fun:PMPI_Comm_split
++   fun:MPI_COMM_SPLIT
++   fun:dmumps_fac_driver_
++   fun:dmumps_
++}
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26524-26525.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26524-26525.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26524-26525.diff	(revision 26740)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/src/c/classes/Cfsurfacesquare.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfsurfacesquare.cpp	(revision 26524)
++++ ../trunk-jpl/src/c/classes/Cfsurfacesquare.cpp	(revision 26525)
+@@ -82,7 +82,19 @@
+ }
+ /*}}}*/
+ void Cfsurfacesquare::Marshall(MarshallHandle* marshallhandle){/*{{{*/
+-	_error_("not implemented yet!"); 
++
++	int object_enum=CfsurfacesquareEnum;
++	marshallhandle->call(object_enum);
++
++	marshallhandle->call(this->definitionenum);
++	marshallhandle->call(this->local);
++	marshallhandle->call(this->model_enum);
++	marshallhandle->call(this->name);
++	marshallhandle->call(this->observation_enum);
++	marshallhandle->call(this->weights_enum);
++	marshallhandle->call(this->datatime);
++	marshallhandle->call(this->timepassedflag);
++	marshallhandle->call(this->misfit);
+ } 
+ /*}}}*/
+ int Cfsurfacesquare::ObjectEnum(void){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Cfsurfacesquare.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Cfsurfacesquare.h	(revision 26524)
++++ ../trunk-jpl/src/c/classes/Cfsurfacesquare.h	(revision 26525)
+@@ -21,7 +21,6 @@
+ 		int         model_enum;
+ 		char*       name;
+ 		int         observation_enum;
+-		char*       timeinterpolation;
+ 		int         weights_enum;
+ 		IssmDouble	datatime;
+ 		bool			timepassedflag;
+Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp
+===================================================================
+--- ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 26524)
++++ ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 26525)
+@@ -255,6 +255,11 @@
+ 				Cflevelset->Marshall(marshallhandle);
+ 				this->AddObject(Cflevelset);
+ 			}
++			else if(obj_enum==CfsurfacesquareEnum){
++				Cfsurfacesquare* cfsurf=new Cfsurfacesquare();
++				cfsurf->Marshall(marshallhandle);
++				this->AddObject(cfsurf);
++			}
+ 			else if(obj_enum==MassfluxatgateEnum){
+ 				Massfluxatgate<IssmDouble>* massfluxgate=new Massfluxatgate<IssmDouble>();
+ 				massfluxgate->Marshall(marshallhandle);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26525-26526.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26525-26526.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26525-26526.diff	(revision 26740)
@@ -0,0 +1,1250 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26525)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26526)
+@@ -246,6 +246,7 @@
+ 	./modules/ResetConstraintsx/ResetConstraintsx.cpp \
+ 	./modules/ResetFSBasalBoundaryConditionx/ResetFSBasalBoundaryConditionx.cpp \
+ 	./modules/Solverx/Solverx.cpp \
++	./modules/StochasticForcingx/StochasticForcingx.cpp \
+ 	./modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp \
+ 	./cores/ProcessArguments.cpp \
+ 	./cores/ResetBoundaryConditions.cpp \
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26526)
+@@ -146,7 +146,6 @@
+ 			break;
+ 		case FrontalForcingsRignotAutoregressionEnum:
+ 			/*Retrieve autoregressive parameters*/
+-			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.randomflag",FrontalForcingsRandomflagEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_order",FrontalForcingsAutoregressiveOrderEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_initialtime",FrontalForcingsAutoregressionInitialTimeEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.ar_timestep",FrontalForcingsAutoregressionTimestepEnum));
+@@ -159,9 +158,6 @@
+          iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.phi");
+          parameters->AddObject(new DoubleMatParam(FrontalForcingsPhiEnum,transparam,M,N));
+          xDelete<IssmDouble>(transparam);
+-         iomodel->FetchData(&transparam,&M,&N,"md.frontalforcings.covmat");
+-         parameters->AddObject(new DoubleMatParam(FrontalForcingsCovmatEnum,transparam,M,N));
+-         xDelete<IssmDouble>(transparam);
+ 			/*Do not break here, generic FrontalForcingsRignot parameters still to be retrieved*/
+ 		case FrontalForcingsRignotEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.num_basins",FrontalForcingsNumberofBasinsEnum));
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26526)
+@@ -59,25 +59,24 @@
+ 	}
+ 	return false;
+ }/*}}}*/
+-void       Element::AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin,int enum_type){/*{{{*/
++void       Element::AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,int enum_type){/*{{{*/
+ 
+-	const int numvertices = this->GetNumberOfVertices();
++const int numvertices = this->GetNumberOfVertices();
+    int         basinid;
+-   IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin;  
++   IssmDouble  tspin,beta0_basin,beta1_basin,noisespin_basin;
+    IssmDouble* phi_basin   = xNew<IssmDouble>(arorder);
+    IssmDouble* varspin     = xNewZeroInit<IssmDouble>(numvertices*arorder);
+ 
+    /*Get Basin ID and Basin coefficients*/
+-	if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
++   if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
+    if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
+    for(int i=0;i<arorder;i++) phi_basin[i] = phi[basinid*arorder+i];
+    beta0_basin   = beta0[basinid];
+    beta1_basin   = beta1[basinid];
+ 
+-   /*Loop over number of spin-up steps for all vertices*/   
+-   for(int j=0;j<nspin;j++){  
+-      tspin = starttime-((nspin-j)*tstep_ar); 
+-      noisespin_basin = noisespin[j*numbasins+basinid];
++   /*Loop over number of spin-up steps for all vertices*/
++   for(int j=0;j<nspin;j++){
++      tspin = starttime-((nspin-j)*tstep_ar);
+       IssmDouble* oldvarspin = xNew<IssmDouble>(numvertices*arorder);
+       for(int i=0;i<numvertices*arorder;i++) oldvarspin[i]=varspin[i];
+ 
+@@ -84,27 +83,26 @@
+       for(int v=0;v<numvertices;v++){
+          IssmDouble autoregressionterm = 0.;
+          for(int i=0;i<arorder;i++) autoregressionterm += phi_basin[i]*varspin[v+i*numvertices];
+-         varspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm+noisespin_basin;
++         varspin[v] = beta0_basin+beta1_basin*(tspin-tinit_ar)+autoregressionterm;
+       }
+ 
+-      /*Adjustt older values in varspin*/
+-      for(int i=0;i<(arorder-1)*numvertices;i++) varspin[i+numvertices]=oldvarspin[i]; 
++      /*Adjust older values in varspin*/
++      for(int i=0;i<(arorder-1)*numvertices;i++) varspin[i+numvertices]=oldvarspin[i];
+ 
+-      xDelete<IssmDouble>(oldvarspin); 
++      xDelete<IssmDouble>(oldvarspin);
+    }
+-	if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,varspin,numvertices*arorder);
++   if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,varspin,numvertices*arorder);
+    if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,varspin,numvertices*arorder);
+ 
+- 
+    /*Cleanup and return*/
+-   xDelete<IssmDouble>(varspin); 
+-   xDelete<IssmDouble>(phi_basin);
++   xDelete<IssmDouble>(varspin);
++   xDelete<IssmDouble>(phi_basin);	
+ }/*}}}*/
+ void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type){/*{{{*/
+-   
+-   const int numvertices = this->GetNumberOfVertices();
++	
++	const int numvertices = this->GetNumberOfVertices();
+    int         basinid,M,N;
+-   IssmDouble  beta0_basin,beta1_basin,noise_basin;  
++   IssmDouble  beta0_basin,beta1_basin,noise_basin;
+    IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
+    IssmDouble* varlist     = xNew<IssmDouble>(numvertices);
+    IssmDouble* valuesautoregression = NULL;
+@@ -112,7 +110,7 @@
+    /*Get Basin ID and Basin coefficients*/
+    if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
+    if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
+-   for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii]; 
++   for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii];
+    beta0_basin   = beta0[basinid];
+    beta1_basin   = beta1[basinid];
+    noise_basin   = noiseterms[basinid];
+@@ -137,16 +135,14 @@
+       /*Update autoregression TF values*/
+       IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+       /*Assign newest values and shift older values*/
+-      for(int i=0;i<numvertices;i++) temparray[i] = varlist[i]; 
++      for(int i=0;i<numvertices;i++) temparray[i] = varlist[i];
+       for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = valuesautoregression[i];
+-      if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); 
+-      if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder); 
++      if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
++      if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
+       xDelete<IssmDouble>(temparray);
+    }
+-   
+-	//if(this->lid==55){_printf_("varlist: "<<varlist[0]<<"  "<<varlist[1]<<"  "<<varlist[2]<<"  "<<"noise_basin: "<<noise_basin<<"  "<<'\n');}
+ 
+-	/*Add input to element*/
++   /*Add input to element*/
+    if(enum_type==SMBautoregressionEnum)                   this->AddInput(SmbMassBalanceEnum,varlist,P1Enum);
+    if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->AddInput(FrontalForcingsThermalForcingEnum,varlist,P1Enum);
+ 
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26526)
+@@ -126,7 +126,7 @@
+ 
+ 	/*parameters: */
+ 	bool isstressbalance,ismasstransport,isoceantransport,issmb,isthermal,isgroundingline,isesa,issampling;;
+-	bool isslc,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,save_results;
++	bool isslc,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,isstochasticforcing,save_results;
+ 	int  step,sb_coupling_frequency;
+ 	int  domaintype,numoutputs;
+ 
+@@ -149,11 +149,16 @@
+ 	femmodel->parameters->FindParam(&ishydrology,TransientIshydrologyEnum);
+ 	femmodel->parameters->FindParam(&issampling,TransientIssamplingEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
++	femmodel->parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);	
+ 
+ 	#if defined(_HAVE_OCEAN_ )
+ 	if(isoceancoupling) OceanExchangeDatax(femmodel,false);
+ 	#endif
+ 
++	if(isstochasticforcing){
++		StochasticForcingx(femmodel);
++	}
++
+ 	if(isthermal && domaintype==Domain3DEnum){
+ 		if(issmb){
+ 			bool isenthalpy;
+Index: ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26526)
+@@ -38,7 +38,6 @@
+    IssmDouble* beta0    = NULL;
+    IssmDouble* beta1    = NULL;
+    IssmDouble* phi      = NULL;
+-   IssmDouble* covmat   = NULL;
+    femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+    femmodel->parameters->FindParam(&tstep_ar,FrontalForcingsAutoregressionTimestepEnum);
+    femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
+@@ -45,32 +44,12 @@
+    femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
+    femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
+    femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+-   femmodel->parameters->FindParam(&covmat,&M,&N,FrontalForcingsCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
+ 
+-   /*AR model spin-up*/
+-   int nspin{2*arorder+5};
+-   IssmDouble* noisespin = xNewZeroInit<IssmDouble>(numbasins*nspin);
+-   my_rank=IssmComm::GetRank();
+-   if(my_rank==0){
+-      bool randomflag{};
+-      femmodel->parameters->FindParam(&randomflag,FrontalForcingsRandomflagEnum);
+-      int fixedseed;
+-      for(int i=0;i<nspin;i++){
+-         IssmDouble* temparray = NULL;
+-         /*Determine whether random seed is fixed to for loop step (randomflag==false) or random seed truly random (randomflag==true)*/
+-         if(randomflag) fixedseed=-1;
+-         else fixedseed = i;
+-         multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
+-         for(int j=0;j<numbasins;j++){noisespin[i*numbasins+j]=temparray[j];}
+-         xDelete<IssmDouble>(temparray);
+-      }
+-   }
+-   ISSM_MPI_Bcast(noisespin,numbasins*nspin,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-
+-   /*Initialize ThermalforcingValuesAutoregressionEnum*/
++   /*AR model spin-up with 0 noise to initialize ThermalforcingValuesAutoregressionEnum*/
++	int nspin{2*arorder+5};
+    for(Object* &object:femmodel->elements->objects){
+       Element* element      = xDynamicCast<Element*>(object); //generate element object
+-      element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,noisespin,FrontalForcingsRignotAutoregressionEnum);
++      element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,FrontalForcingsRignotAutoregressionEnum);
+    }
+ 
+    /*Cleanup*/
+@@ -77,8 +56,6 @@
+    xDelete<IssmDouble>(beta0);
+    xDelete<IssmDouble>(beta1);
+    xDelete<IssmDouble>(phi);
+-   xDelete<IssmDouble>(noisespin);
+-   xDelete<IssmDouble>(covmat);
+ }/*}}}*/
+ void Thermalforcingautoregressionx(FemModel* femmodel){/*{{{*/
+ 
+@@ -101,6 +78,7 @@
+    #endif
+ 
+    /*Load parameters*/
++	bool isstochastic;
+    int M,N,Nphi,arorder,numbasins,my_rank;
+    femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+    femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
+@@ -108,35 +86,30 @@
+    IssmDouble* beta0      = NULL;
+    IssmDouble* beta1      = NULL;
+    IssmDouble* phi        = NULL;
+-   IssmDouble* covmat     = NULL;
+-   IssmDouble* noiseterms = xNew<IssmDouble>(numbasins);
+-   femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
++   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
++
++	femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
+    femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
+    femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
+    femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+-   femmodel->parameters->FindParam(&covmat,&M,&N,FrontalForcingsCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
+ 
++	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
++	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
++	if(isstochastic){
++		int  numstochasticfields;
++		int* stochasticfields;
++		femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
++		femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
++		for(int i=0;i<numstochasticfields;i++){
++			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum){
++				femmodel->parameters->FindParam(&noiseterms,&M,ThermalforcingAutoregressionNoiseEnum);  _assert_(M==numbasins);
++			}
++		}
++	}
+    /*Time elapsed with respect to AR model initial time*/
+    IssmDouble telapsed_ar = time-tinit_ar;
+ 
+-   /*Before looping through elements: compute noise term specific to each basin from covmat*/
+-   my_rank=IssmComm::GetRank();
+-   if(my_rank==0){
+-      bool randomflag{};
+-      femmodel->parameters->FindParam(&randomflag,FrontalForcingsRandomflagEnum);
+-      /*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+-      int fixedseed;
+-      if(randomflag) fixedseed=-1;
+-      else fixedseed = reCast<int,IssmDouble>((time-starttime)/dt);
+-		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
+-      IssmDouble* temparray = NULL;
+-      multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
+-      for(int i=0;i<numbasins;i++) noiseterms[i]=temparray[i];
+-      xDelete<IssmDouble>(temparray);
+-   }
+-   ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-
+-   /*Loop over each element to compute SMB at vertices*/
++   /*Loop over each element to compute Thermal Forcing at vertices*/
+    for(Object* &object:femmodel->elements->objects){
+       Element* element = xDynamicCast<Element*>(object);
+       element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,FrontalForcingsRignotAutoregressionEnum);
+@@ -147,5 +120,4 @@
+    xDelete<IssmDouble>(beta1);
+    xDelete<IssmDouble>(phi);
+    xDelete<IssmDouble>(noiseterms);
+-   xDelete<IssmDouble>(covmat);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26526)
+@@ -89,6 +89,7 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.isoceancoupling",TransientIsoceancouplingEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.amr_frequency",TransientAmrFrequencyEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.transient.issampling",TransientIssamplingEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.isstochasticforcing",StochasticForcingIsStochasticForcingEnum));
+ 
+ 		/*For stress balance only*/
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isFS",FlowequationIsFSEnum));
+@@ -398,7 +399,6 @@
+ 		case SMBautoregressionEnum:
+          /*Add parameters that are not in standard nbvertices format*/
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.num_basins",SmbNumBasinsEnum));
+-         parameters->AddObject(iomodel->CopyConstantObject("md.smb.randomflag",SmbRandomflagEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_order",SmbAutoregressiveOrderEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_initialtime",SmbAutoregressionInitialTimeEnum));
+          parameters->AddObject(iomodel->CopyConstantObject("md.smb.ar_timestep",SmbAutoregressionTimestepEnum));
+@@ -411,9 +411,6 @@
+          iomodel->FetchData(&transparam,&M,&N,"md.smb.phi");
+          parameters->AddObject(new DoubleMatParam(SmbPhiEnum,transparam,M,N));
+          xDelete<IssmDouble>(transparam);
+-         iomodel->FetchData(&transparam,&M,&N,"md.smb.covmat");
+-         parameters->AddObject(new DoubleMatParam(SmbCovmatEnum,transparam,M,N));
+-         xDelete<IssmDouble>(transparam);
+          break;
+ 		case SMBgembEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIce",SmbAIceEnum));
+@@ -501,6 +498,32 @@
+ 		iomodel->DeleteData(&requestedoutputs,numoutputs,"md.damage.requested_outputs");
+ 	}
+ 
++	bool isstochasticforcing;
++	parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);
++	if(isstochasticforcing){
++		int num_fields;
++		char** fields;
++		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.num_fields",StochasticForcingNumFieldsEnum));
++		iomodel->FindConstant(&fields,&num_fields,"md.stochasticforcing.fields");
++		if(num_fields<1) _error_("no stochasticforcing fields found");
++		int* stochasticforcing_enums = xNew<int>(num_fields);
++		for(int i=0;i<num_fields;i++){
++			stochasticforcing_enums[i] = StringToEnumx(fields[i]);
++			xDelete<char>(fields[i]);
++		}
++		xDelete<char*>(fields);
++		parameters->AddObject(new IntVecParam(StochasticForcingFieldsEnum,stochasticforcing_enums,num_fields));
++		xDelete<int>(stochasticforcing_enums);
++
++      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.randomflag",StochasticForcingRandomflagEnum));
++		iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.dimensions");
++		parameters->AddObject(new IntVecParam(StochasticForcingDimensionsEnum,transparam,N));
++		xDelete<IssmDouble>(transparam);
++		iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.covariance");
++		parameters->AddObject(new DoubleMatParam(StochasticForcingCovarianceEnum,transparam,M,N));
++		xDelete<IssmDouble>(transparam);
++	}
++
+ 	/*Deal with mass flux segments: {{{*/
+ 	iomodel->FetchData(&qmu_mass_flux_present,"md.qmu.mass_flux_segments_present");
+ 	iomodel->FetchData(&autodiff_mass_flux_present,"md.autodiff.mass_flux_segments_present");
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26526)
+@@ -156,7 +156,6 @@
+ 	IssmDouble* beta0    = NULL; 
+ 	IssmDouble* beta1    = NULL;
+ 	IssmDouble* phi      = NULL;
+-	IssmDouble* covmat   = NULL;
+ 	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+    femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
+ 	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+@@ -163,41 +162,17 @@
+ 	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+-	femmodel->parameters->FindParam(&covmat,&M,&N,SmbCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
+ 	
+-	/*AR model spin-up*/
+-	int nspin{2*arorder+5}; 
+-	IssmDouble* noisespin = xNewZeroInit<IssmDouble>(numbasins*nspin); 
+-	my_rank=IssmComm::GetRank();
+-	if(my_rank==0){
+-		bool randomflag{};
+-		femmodel->parameters->FindParam(&randomflag,SmbRandomflagEnum);
+-		int fixedseed;
+-		for(int i=0;i<nspin;i++){
+-			//IssmDouble* temparray = xNew<IssmDouble>(numbasins);
+-			IssmDouble* temparray = NULL;
+-			/*Determine whether random seed is fixed to for loop step (randomflag==false) or random seed truly random (randomflag==true)*/
+-			if(randomflag) fixedseed=-1;
+-			else fixedseed = i;
+-			multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
+-			for(int j=0;j<numbasins;j++){noisespin[i*numbasins+j]=temparray[j];}
+-			xDelete<IssmDouble>(temparray);
+-		}
+-	}
+-	ISSM_MPI_Bcast(noisespin,numbasins*nspin,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-	
+-	/*Initialize SmbValuesAutoregressionEnum*/
++	/*AR model spin-up with 0 noise to initialize SmbValuesAutoregressionEnum*/
++	int nspin{2*arorder+5};
+ 	for(Object* &object:femmodel->elements->objects){
+       Element* element      = xDynamicCast<Element*>(object); //generate element object
+-		element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,noisespin,SMBautoregressionEnum);
++		element->AutoregressionInit(numbasins,arorder,nspin,starttime,tstep_ar,tinit_ar,beta0,beta1,phi,SMBautoregressionEnum);
+ 	}
+-	
+ 	/*Cleanup*/
+ 	xDelete<IssmDouble>(beta0);
+ 	xDelete<IssmDouble>(beta1);
+ 	xDelete<IssmDouble>(phi);
+-	xDelete<IssmDouble>(noisespin);
+-	xDelete<IssmDouble>(covmat);
+ }/*}}}*/
+ void Smbautoregressionx(FemModel* femmodel){/*{{{*/
+ 
+@@ -220,6 +195,7 @@
+ 	#endif
+ 
+ 	/*Load parameters*/
++	bool isstochastic;
+ 	int M,N,Nphi,arorder,numbasins,my_rank;
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+ 	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+@@ -227,34 +203,30 @@
+ 	IssmDouble* beta0      = NULL; 
+ 	IssmDouble* beta1      = NULL;
+ 	IssmDouble* phi        = NULL;
+-	IssmDouble* covmat     = NULL;
+-	IssmDouble* noiseterms = xNew<IssmDouble>(numbasins);
++
+ 	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+ 	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+-	femmodel->parameters->FindParam(&covmat,&M,&N,SmbCovmatEnum); _assert_(M==numbasins); _assert_(N==numbasins);
+ 
++	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
++   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
++	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
++   if(isstochastic){
++		int  numstochasticfields;
++      int* stochasticfields;
++      femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
++      femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
++      for(int i=0;i<numstochasticfields;i++){
++         if(stochasticfields[i]==SMBautoregressionEnum){
++				femmodel->parameters->FindParam(&noiseterms,&M,SmbAutoregressionNoiseEnum);  _assert_(M==numbasins);
++			}
++		}
++		xDelete<int>(stochasticfields);
++	}
+ 	/*Time elapsed with respect to AR model initial time*/
+ 	IssmDouble telapsed_ar = time-tinit_ar; 
+ 
+-	/*Before looping through elements: compute noise term specific to each basin from covmat*/
+-	my_rank=IssmComm::GetRank();
+-	if(my_rank==0){
+-		bool randomflag{};
+-		femmodel->parameters->FindParam(&randomflag,SmbRandomflagEnum);
+-		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+-		int fixedseed;
+-		if(randomflag) fixedseed=-1;
+-		else fixedseed =  reCast<int,IssmDouble>((time-starttime)/dt);
+-		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/	
+-		IssmDouble* temparray = NULL;
+-		multivariateNormal(&temparray,numbasins,0.0,covmat,fixedseed);
+-		for(int i=0;i<numbasins;i++) noiseterms[i]=temparray[i];
+-		xDelete<IssmDouble>(temparray);
+-	}
+-	ISSM_MPI_Bcast(noiseterms,numbasins,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+-
+ 	/*Loop over each element to compute SMB at vertices*/
+ 	for(Object* &object:femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+@@ -266,7 +238,6 @@
+ 	xDelete<IssmDouble>(beta1);
+ 	xDelete<IssmDouble>(phi);
+ 	xDelete<IssmDouble>(noiseterms);
+-	xDelete<IssmDouble>(covmat);
+ }/*}}}*/
+ void Delta18oParameterizationx(FemModel* femmodel){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 26525)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 26526)
+@@ -90,6 +90,7 @@
+ #include "./RheologyBAbsGradientx/RheologyBAbsGradientx.h"
+ #include "./Scotchx/Scotchx.h"
+ #include "./Shp2Kmlx/Shp2Kmlx.h"
++#include "./StochasticForcingx/StochasticForcingx.h"
+ #include "./SurfaceMassBalancex/SurfaceMassBalancex.h"
+ #include "./Solverx/Solverx.h"
+ #include "./SystemMatricesx/SystemMatricesx.h"
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26525)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26526)
+@@ -181,11 +181,9 @@
+ syn keyword cConstant FrontalForcingsAutoregressiveOrderEnum
+ syn keyword cConstant FrontalForcingsBeta0Enum
+ syn keyword cConstant FrontalForcingsBeta1Enum
+-syn keyword cConstant FrontalForcingsCovmatEnum
+ syn keyword cConstant FrontalForcingsNumberofBasinsEnum
+ syn keyword cConstant FrontalForcingsParamEnum
+ syn keyword cConstant FrontalForcingsPhiEnum
+-syn keyword cConstant FrontalForcingsRandomflagEnum
+ syn keyword cConstant GrdModelEnum
+ syn keyword cConstant GroundinglineFrictionInterpolationEnum
+ syn keyword cConstant GroundinglineMeltInterpolationEnum
+@@ -398,6 +396,12 @@
+ syn keyword cConstant SolidearthSettingsMaxiterEnum
+ syn keyword cConstant SolidearthSettingsGrdOceanEnum
+ syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
++syn keyword cConstant StochasticForcingCovarianceEnum
++syn keyword cConstant StochasticForcingDimensionsEnum
++syn keyword cConstant StochasticForcingFieldsEnum
++syn keyword cConstant StochasticForcingIsStochasticForcingEnum
++syn keyword cConstant StochasticForcingNumFieldsEnum
++syn keyword cConstant StochasticForcingRandomflagEnum
+ syn keyword cConstant RotationalPolarMoiEnum
+ syn keyword cConstant SolidearthSettingsReltolEnum
+ syn keyword cConstant SealevelchangeRequestedOutputsEnum
+@@ -423,12 +427,12 @@
+ syn keyword cConstant SmbAccurefEnum
+ syn keyword cConstant SmbAdThreshEnum
+ syn keyword cConstant SmbAutoregressionInitialTimeEnum
++syn keyword cConstant SmbAutoregressionNoiseEnum
+ syn keyword cConstant SmbAutoregressionTimestepEnum
+ syn keyword cConstant SmbAutoregressiveOrderEnum
+ syn keyword cConstant SmbAveragingEnum
+ syn keyword cConstant SmbBeta0Enum
+ syn keyword cConstant SmbBeta1Enum
+-syn keyword cConstant SmbCovmatEnum
+ syn keyword cConstant SmbDesfacEnum
+ syn keyword cConstant SmbDpermilEnum
+ syn keyword cConstant SmbDsnowIdxEnum
+@@ -461,7 +465,6 @@
+ syn keyword cConstant SmbNumRequestedOutputsEnum
+ syn keyword cConstant SmbPfacEnum
+ syn keyword cConstant SmbPhiEnum
+-syn keyword cConstant SmbRandomflagEnum
+ syn keyword cConstant SmbRdlEnum
+ syn keyword cConstant SmbRequestedOutputsEnum
+ syn keyword cConstant SmbRlapsEnum
+@@ -497,6 +500,7 @@
+ syn keyword cConstant StressbalanceRestolEnum
+ syn keyword cConstant StressbalanceRiftPenaltyThresholdEnum
+ syn keyword cConstant StressbalanceShelfDampeningEnum
++syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+ syn keyword cConstant ThermalIsdrainicecolumnEnum
+ syn keyword cConstant ThermalIsdynamicbasalspcEnum
+ syn keyword cConstant ThermalIsenthalpyEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26525)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26526)
+@@ -175,11 +175,9 @@
+    FrontalForcingsAutoregressiveOrderEnum,
+ 	FrontalForcingsBeta0Enum,
+    FrontalForcingsBeta1Enum,
+-   FrontalForcingsCovmatEnum,
+ 	FrontalForcingsNumberofBasinsEnum,
+ 	FrontalForcingsParamEnum,
+    FrontalForcingsPhiEnum,
+-	FrontalForcingsRandomflagEnum,
+ 	GrdModelEnum,
+ 	GroundinglineFrictionInterpolationEnum,
+ 	GroundinglineMeltInterpolationEnum,
+@@ -392,6 +390,12 @@
+ 	SolidearthSettingsMaxiterEnum,
+ 	SolidearthSettingsGrdOceanEnum,
+ 	SolidearthSettingsOceanAreaScalingEnum,
++	StochasticForcingCovarianceEnum,
++	StochasticForcingDimensionsEnum,
++	StochasticForcingFieldsEnum,
++	StochasticForcingIsStochasticForcingEnum,
++	StochasticForcingNumFieldsEnum,
++	StochasticForcingRandomflagEnum,
+ 	RotationalPolarMoiEnum,
+ 	SolidearthSettingsReltolEnum,
+ 	SealevelchangeRequestedOutputsEnum,
+@@ -417,12 +421,12 @@
+ 	SmbAccurefEnum,
+ 	SmbAdThreshEnum,
+ 	SmbAutoregressionInitialTimeEnum,
+-   SmbAutoregressionTimestepEnum,
++   SmbAutoregressionNoiseEnum,
++	SmbAutoregressionTimestepEnum,
+    SmbAutoregressiveOrderEnum,
+ 	SmbAveragingEnum,
+ 	SmbBeta0Enum,
+    SmbBeta1Enum,
+-   SmbCovmatEnum,
+ 	SmbDesfacEnum,
+ 	SmbDpermilEnum,
+ 	SmbDsnowIdxEnum,
+@@ -455,7 +459,6 @@
+ 	SmbNumRequestedOutputsEnum,
+ 	SmbPfacEnum,
+ 	SmbPhiEnum,
+-	SmbRandomflagEnum,
+ 	SmbRdlEnum,
+ 	SmbRequestedOutputsEnum,
+ 	SmbRlapsEnum,
+@@ -491,6 +494,7 @@
+ 	StressbalanceRestolEnum,
+ 	StressbalanceRiftPenaltyThresholdEnum,
+ 	StressbalanceShelfDampeningEnum,
++   ThermalforcingAutoregressionNoiseEnum,
+ 	ThermalIsdrainicecolumnEnum,
+ 	ThermalIsdynamicbasalspcEnum,
+ 	ThermalIsenthalpyEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26526)
+@@ -183,11 +183,9 @@
+ 		case FrontalForcingsAutoregressiveOrderEnum : return "FrontalForcingsAutoregressiveOrder";
+ 		case FrontalForcingsBeta0Enum : return "FrontalForcingsBeta0";
+ 		case FrontalForcingsBeta1Enum : return "FrontalForcingsBeta1";
+-		case FrontalForcingsCovmatEnum : return "FrontalForcingsCovmat";
+ 		case FrontalForcingsNumberofBasinsEnum : return "FrontalForcingsNumberofBasins";
+ 		case FrontalForcingsParamEnum : return "FrontalForcingsParam";
+ 		case FrontalForcingsPhiEnum : return "FrontalForcingsPhi";
+-		case FrontalForcingsRandomflagEnum : return "FrontalForcingsRandomflag";
+ 		case GrdModelEnum : return "GrdModel";
+ 		case GroundinglineFrictionInterpolationEnum : return "GroundinglineFrictionInterpolation";
+ 		case GroundinglineMeltInterpolationEnum : return "GroundinglineMeltInterpolation";
+@@ -400,6 +398,12 @@
+ 		case SolidearthSettingsMaxiterEnum : return "SolidearthSettingsMaxiter";
+ 		case SolidearthSettingsGrdOceanEnum : return "SolidearthSettingsGrdOcean";
+ 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
++		case StochasticForcingCovarianceEnum : return "StochasticForcingCovariance";
++		case StochasticForcingDimensionsEnum : return "StochasticForcingDimensions";
++		case StochasticForcingFieldsEnum : return "StochasticForcingFields";
++		case StochasticForcingIsStochasticForcingEnum : return "StochasticForcingIsStochasticForcing";
++		case StochasticForcingNumFieldsEnum : return "StochasticForcingNumFields";
++		case StochasticForcingRandomflagEnum : return "StochasticForcingRandomflag";
+ 		case RotationalPolarMoiEnum : return "RotationalPolarMoi";
+ 		case SolidearthSettingsReltolEnum : return "SolidearthSettingsReltol";
+ 		case SealevelchangeRequestedOutputsEnum : return "SealevelchangeRequestedOutputs";
+@@ -425,12 +429,12 @@
+ 		case SmbAccurefEnum : return "SmbAccuref";
+ 		case SmbAdThreshEnum : return "SmbAdThresh";
+ 		case SmbAutoregressionInitialTimeEnum : return "SmbAutoregressionInitialTime";
++		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+ 		case SmbAutoregressionTimestepEnum : return "SmbAutoregressionTimestep";
+ 		case SmbAutoregressiveOrderEnum : return "SmbAutoregressiveOrder";
+ 		case SmbAveragingEnum : return "SmbAveraging";
+ 		case SmbBeta0Enum : return "SmbBeta0";
+ 		case SmbBeta1Enum : return "SmbBeta1";
+-		case SmbCovmatEnum : return "SmbCovmat";
+ 		case SmbDesfacEnum : return "SmbDesfac";
+ 		case SmbDpermilEnum : return "SmbDpermil";
+ 		case SmbDsnowIdxEnum : return "SmbDsnowIdx";
+@@ -463,7 +467,6 @@
+ 		case SmbNumRequestedOutputsEnum : return "SmbNumRequestedOutputs";
+ 		case SmbPfacEnum : return "SmbPfac";
+ 		case SmbPhiEnum : return "SmbPhi";
+-		case SmbRandomflagEnum : return "SmbRandomflag";
+ 		case SmbRdlEnum : return "SmbRdl";
+ 		case SmbRequestedOutputsEnum : return "SmbRequestedOutputs";
+ 		case SmbRlapsEnum : return "SmbRlaps";
+@@ -499,6 +502,7 @@
+ 		case StressbalanceRestolEnum : return "StressbalanceRestol";
+ 		case StressbalanceRiftPenaltyThresholdEnum : return "StressbalanceRiftPenaltyThreshold";
+ 		case StressbalanceShelfDampeningEnum : return "StressbalanceShelfDampening";
++		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+ 		case ThermalIsdrainicecolumnEnum : return "ThermalIsdrainicecolumn";
+ 		case ThermalIsdynamicbasalspcEnum : return "ThermalIsdynamicbasalspc";
+ 		case ThermalIsenthalpyEnum : return "ThermalIsenthalpy";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26525)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26526)
+@@ -186,11 +186,9 @@
+ 	      else if (strcmp(name,"FrontalForcingsAutoregressiveOrder")==0) return FrontalForcingsAutoregressiveOrderEnum;
+ 	      else if (strcmp(name,"FrontalForcingsBeta0")==0) return FrontalForcingsBeta0Enum;
+ 	      else if (strcmp(name,"FrontalForcingsBeta1")==0) return FrontalForcingsBeta1Enum;
+-	      else if (strcmp(name,"FrontalForcingsCovmat")==0) return FrontalForcingsCovmatEnum;
+ 	      else if (strcmp(name,"FrontalForcingsNumberofBasins")==0) return FrontalForcingsNumberofBasinsEnum;
+ 	      else if (strcmp(name,"FrontalForcingsParam")==0) return FrontalForcingsParamEnum;
+ 	      else if (strcmp(name,"FrontalForcingsPhi")==0) return FrontalForcingsPhiEnum;
+-	      else if (strcmp(name,"FrontalForcingsRandomflag")==0) return FrontalForcingsRandomflagEnum;
+ 	      else if (strcmp(name,"GrdModel")==0) return GrdModelEnum;
+ 	      else if (strcmp(name,"GroundinglineFrictionInterpolation")==0) return GroundinglineFrictionInterpolationEnum;
+ 	      else if (strcmp(name,"GroundinglineMeltInterpolation")==0) return GroundinglineMeltInterpolationEnum;
+@@ -259,12 +257,12 @@
+ 	      else if (strcmp(name,"InversionMaxsteps")==0) return InversionMaxstepsEnum;
+ 	      else if (strcmp(name,"InversionNsteps")==0) return InversionNstepsEnum;
+ 	      else if (strcmp(name,"InversionNumControlParameters")==0) return InversionNumControlParametersEnum;
++	      else if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
++	      else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
+-	      else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
+-	      else if (strcmp(name,"InversionType")==0) return InversionTypeEnum;
++	      if (strcmp(name,"InversionType")==0) return InversionTypeEnum;
+ 	      else if (strcmp(name,"Ivins")==0) return IvinsEnum;
+ 	      else if (strcmp(name,"IsSlcCoupling")==0) return IsSlcCouplingEnum;
+ 	      else if (strcmp(name,"LevelsetKillIcebergs")==0) return LevelsetKillIcebergsEnum;
+@@ -382,12 +380,12 @@
+ 	      else if (strcmp(name,"SolidearthSettingsElastic")==0) return SolidearthSettingsElasticEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsViscous")==0) return SolidearthSettingsViscousEnum;
+ 	      else if (strcmp(name,"SealevelchangeGeometryDone")==0) return SealevelchangeGeometryDoneEnum;
++	      else if (strcmp(name,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
++	      else if (strcmp(name,"SealevelchangeViscousTimes")==0) return SealevelchangeViscousTimesEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"SealevelchangeViscousNumSteps")==0) return SealevelchangeViscousNumStepsEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousTimes")==0) return SealevelchangeViscousTimesEnum;
+-	      else if (strcmp(name,"SealevelchangeViscousIndex")==0) return SealevelchangeViscousIndexEnum;
++	      if (strcmp(name,"SealevelchangeViscousIndex")==0) return SealevelchangeViscousIndexEnum;
+ 	      else if (strcmp(name,"RotationalEquatorialMoi")==0) return RotationalEquatorialMoiEnum;
+ 	      else if (strcmp(name,"TidalLoveH")==0) return TidalLoveHEnum;
+ 	      else if (strcmp(name,"TidalLoveK")==0) return TidalLoveKEnum;
+@@ -409,6 +407,12 @@
+ 	      else if (strcmp(name,"SolidearthSettingsMaxiter")==0) return SolidearthSettingsMaxiterEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsGrdOcean")==0) return SolidearthSettingsGrdOceanEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
++	      else if (strcmp(name,"StochasticForcingCovariance")==0) return StochasticForcingCovarianceEnum;
++	      else if (strcmp(name,"StochasticForcingDimensions")==0) return StochasticForcingDimensionsEnum;
++	      else if (strcmp(name,"StochasticForcingFields")==0) return StochasticForcingFieldsEnum;
++	      else if (strcmp(name,"StochasticForcingIsStochasticForcing")==0) return StochasticForcingIsStochasticForcingEnum;
++	      else if (strcmp(name,"StochasticForcingNumFields")==0) return StochasticForcingNumFieldsEnum;
++	      else if (strcmp(name,"StochasticForcingRandomflag")==0) return StochasticForcingRandomflagEnum;
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsReltol")==0) return SolidearthSettingsReltolEnum;
+ 	      else if (strcmp(name,"SealevelchangeRequestedOutputs")==0) return SealevelchangeRequestedOutputsEnum;
+@@ -434,12 +438,12 @@
+ 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
+ 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionInitialTime")==0) return SmbAutoregressionInitialTimeEnum;
++	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionTimestep")==0) return SmbAutoregressionTimestepEnum;
+ 	      else if (strcmp(name,"SmbAutoregressiveOrder")==0) return SmbAutoregressiveOrderEnum;
+ 	      else if (strcmp(name,"SmbAveraging")==0) return SmbAveragingEnum;
+ 	      else if (strcmp(name,"SmbBeta0")==0) return SmbBeta0Enum;
+ 	      else if (strcmp(name,"SmbBeta1")==0) return SmbBeta1Enum;
+-	      else if (strcmp(name,"SmbCovmat")==0) return SmbCovmatEnum;
+ 	      else if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
+ 	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
+ 	      else if (strcmp(name,"SmbDsnowIdx")==0) return SmbDsnowIdxEnum;
+@@ -472,7 +476,6 @@
+ 	      else if (strcmp(name,"SmbNumRequestedOutputs")==0) return SmbNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
+ 	      else if (strcmp(name,"SmbPhi")==0) return SmbPhiEnum;
+-	      else if (strcmp(name,"SmbRandomflag")==0) return SmbRandomflagEnum;
+ 	      else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
+ 	      else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
+ 	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+@@ -502,15 +505,16 @@
+ 	      else if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum;
+ 	      else if (strcmp(name,"StressbalanceMaxiter")==0) return StressbalanceMaxiterEnum;
+ 	      else if (strcmp(name,"StressbalanceNumRequestedOutputs")==0) return StressbalanceNumRequestedOutputsEnum;
+-	      else if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum;
+-	      else if (strcmp(name,"StressbalanceReltol")==0) return StressbalanceReltolEnum;
+-	      else if (strcmp(name,"StressbalanceRequestedOutputs")==0) return StressbalanceRequestedOutputsEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
++	      if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum;
++	      else if (strcmp(name,"StressbalanceReltol")==0) return StressbalanceReltolEnum;
++	      else if (strcmp(name,"StressbalanceRequestedOutputs")==0) return StressbalanceRequestedOutputsEnum;
++	      else if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
+ 	      else if (strcmp(name,"StressbalanceRiftPenaltyThreshold")==0) return StressbalanceRiftPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
++	      else if (strcmp(name,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"ThermalIsdrainicecolumn")==0) return ThermalIsdrainicecolumnEnum;
+ 	      else if (strcmp(name,"ThermalIsdynamicbasalspc")==0) return ThermalIsdynamicbasalspcEnum;
+ 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
+@@ -624,14 +628,14 @@
+ 	      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,"CalvingratexAverage")==0) return CalvingratexAverageEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      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 stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"CalvingFluxLevelset")==0) return CalvingFluxLevelsetEnum;
++	      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;
+@@ -747,14 +751,14 @@
+ 	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+ 	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
+ 	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
+-	      else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
++         else stage=7;
++   }
++   if(stage==7){
++	      if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
+ 	      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 stage=7;
+-   }
+-   if(stage==7){
+-	      if (strcmp(name,"Ice")==0) return IceEnum;
++	      else if (strcmp(name,"Ice")==0) return IceEnum;
+ 	      else if (strcmp(name,"IceMaskNodeActivation")==0) return IceMaskNodeActivationEnum;
+ 	      else if (strcmp(name,"Input")==0) return InputEnum;
+ 	      else if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
+@@ -870,14 +874,14 @@
+ 	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+ 	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+ 	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+-	      else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
++         else stage=8;
++   }
++   if(stage==8){
++	      if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGUsubelOcean")==0) return SealevelchangeGUsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelOcean")==0) return SealevelchangeGEsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelOcean")==0) return SealevelchangeGNsubelOceanEnum;
+-         else stage=8;
+-   }
+-   if(stage==8){
+-	      if (strcmp(name,"SealevelchangeGsubelIce")==0) return SealevelchangeGsubelIceEnum;
++	      else if (strcmp(name,"SealevelchangeGsubelIce")==0) return SealevelchangeGsubelIceEnum;
+ 	      else if (strcmp(name,"SealevelchangeGUsubelIce")==0) return SealevelchangeGUsubelIceEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelIce")==0) return SealevelchangeGEsubelIceEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelIce")==0) return SealevelchangeGNsubelIceEnum;
+@@ -993,14 +997,14 @@
+ 	      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,"SmbTini")==0) return SmbTiniEnum;
++         else stage=9;
++   }
++   if(stage==9){
++	      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,"SmbValuesAutoregression")==0) return SmbValuesAutoregressionEnum;
+-         else stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"SmbV")==0) return SmbVEnum;
++	      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;
+@@ -1116,14 +1120,14 @@
+ 	      else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum;
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+-	      else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
+ 	      else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
+ 	      else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
+ 	      else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
++	      else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
+ 	      else if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum;
+ 	      else if (strcmp(name,"Outputdefinition39")==0) return Outputdefinition39Enum;
+ 	      else if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
+@@ -1239,14 +1243,14 @@
+ 	      else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum;
+ 	      else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum;
+ 	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+-	      else if (strcmp(name,"Colinear")==0) return ColinearEnum;
++         else stage=11;
++   }
++   if(stage==11){
++	      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 stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"Contours")==0) return ContoursEnum;
++	      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;
+@@ -1362,14 +1366,14 @@
+ 	      else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
+ 	      else if (strcmp(name,"MLHOApproximation")==0) return MLHOApproximationEnum;
+ 	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
+-	      else if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
++	      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;
+@@ -1485,14 +1489,14 @@
+ 	      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 stage=13;
++   }
++   if(stage==13){
++	      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 stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"SSAFSApproximation")==0) return SSAFSApproximationEnum;
++	      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;
+Index: ../trunk-jpl/src/m/classes/SMBautoregression.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBautoregression.m	(revision 26525)
++++ ../trunk-jpl/src/m/classes/SMBautoregression.m	(revision 26526)
+@@ -12,9 +12,7 @@
+ 		ar_initialtime    = 0;
+ 		ar_timestep       = 0;
+ 		phi               = NaN;
+-		covmat            = NaN;
+ 		basin_id          = NaN;
+-		randomflag        = 1;
+ 		steps_per_step    = 1;
+ 		averaging         = 0;
+ 		requested_outputs = {};
+@@ -56,14 +54,9 @@
+ 				self.phi = zeros(self.num_basins,self.ar_order); %autoregression model of order 0 
+ 				disp('      smb.phi (lag coefficients) not specified: order of autoregressive model set to 0');
+ 			end
+-			if isnan(self.covmat)
+-				self.covmat = 1e-21*eye(self.num_basins); %no stochasticity and no covariance
+-				disp('      smb.covmat not specified: stochasticity set to 0');
+-			end
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 			self.ar_order    = 0.0; %autoregression model of order 0
+-			self.randomflag  = 1;
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) 
+ 
+@@ -76,8 +69,6 @@
+ 				md = checkfield(md,'fieldname','smb.ar_initialtime','numel',1,'NaN',1,'Inf',1); 
+ 				md = checkfield(md,'fieldname','smb.ar_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %autoregression time step cannot be finer than ISSM timestep
+ 				md = checkfield(md,'fieldname','smb.phi','NaN',1,'Inf',1,'size',[md.smb.num_basins,md.smb.ar_order]);
+-				md = checkfield(md,'fieldname','smb.covmat','NaN',1,'Inf',1,'size',[md.smb.num_basins,md.smb.num_basins]);
+-				md = checkfield(md,'fieldname','smb.randomflag','numel',[1],'values',[0 1]);
+ 			end
+ 			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+ 			md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]);
+@@ -93,8 +84,6 @@
+ 			fielddisplay(self,'ar_initialtime','initial time assumed in the autoregressive model parameterization [yr]');
+ 			fielddisplay(self,'ar_timestep','time resolution of the autoregressive model [yr]');
+ 			fielddisplay(self,'phi','basin-specific vectors of lag coefficients [unitless]');
+-			fielddisplay(self,'covmat','inter-basin covariance matrix for multivariate normal noise at each time step [m^2 ice eq. yr^(-2)]');
+-			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+ 			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+ 			disp(sprintf('%51s  0: Arithmetic (default)',' '));
+@@ -116,8 +105,6 @@
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta0','format','DoubleMat','name','md.smb.beta0','scale',1./yts,'yts',yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','beta1','format','DoubleMat','name','md.smb.beta1','scale',1./(yts^2),'yts',yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','phi','format','DoubleMat','name','md.smb.phi','yts',yts); 
+-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','covmat','format','DoubleMat','name','md.smb.covmat','scale',1./(yts^2),'yts',yts);
+-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','randomflag','format','Boolean');
+ 			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
+ 
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m	(revision 26525)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m	(revision 26526)
+@@ -12,9 +12,7 @@
+       ar_initialtime       = 0;
+       ar_timestep          = 0;
+       phi                  = NaN;
+-      covmat               = NaN;
+       basin_id             = NaN;
+-      randomflag           = 1;
+ 		subglacial_discharge = NaN;
+ 	end
+ 	methods
+@@ -45,7 +43,6 @@
+ 			num_basins           = 0;
+ 			subglacial_discharge = NaN;
+ 			self.ar_order        = 0.0; %autoregression model of order 0
+-         self.randomflag      = 1;
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -61,8 +58,6 @@
+          md = checkfield(md,'fieldname','frontalforcings.ar_initialtime','numel',1,'NaN',1,'Inf',1);
+          md = checkfield(md,'fieldname','frontalforcings.ar_timestep','numel',1,'NaN',1,'Inf',1,'>=',md.timestepping.time_step); %autoregression time step cannot be finer than ISSM timestep
+ 			md = checkfield(md,'fieldname','frontalforcings.phi','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.ar_order]);
+-         md = checkfield(md,'fieldname','frontalforcings.covmat','NaN',1,'Inf',1,'size',[md.frontalforcings.num_basins,md.frontalforcings.num_basins]);
+-         md = checkfield(md,'fieldname','frontalforcings.randomflag','numel',[1],'values',[0 1]);
+ 
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -76,8 +71,6 @@
+          fielddisplay(self,'ar_initialtime','initial time assumed in the autoregressive model parameterization [yr]');
+          fielddisplay(self,'ar_timestep','time resolution of the autoregressive model [yr]');
+          fielddisplay(self,'phi','basin-specific vectors of lag coefficients [unitless]');
+-         fielddisplay(self,'covmat','inter-basin covariance matrix for multivariate normal noise at each time step [∘C^2]');
+-         fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 			yts=md.constants.yts;
+@@ -91,8 +84,6 @@
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta0','format','DoubleMat','name','md.frontalforcings.beta0');
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta1','format','DoubleMat','name','md.frontalforcings.beta1','scale',1./yts,'yts',md.constants.yts);
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','phi','format','DoubleMat','name','md.frontalforcings.phi','yts',md.constants.yts);
+-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','covmat','format','DoubleMat','name','md.frontalforcings.covmat');
+-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','randomflag','format','Boolean');
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 26525)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 26526)
+@@ -54,6 +54,7 @@
+ 		radaroverlay     = 0;
+ 		miscellaneous    = 0;
+ 		private          = 0;
++		stochasticforcing= 0;
+ 
+ 		%}}}
+ 	end
+@@ -190,6 +191,8 @@
+ 			end
+ 			%2021 February 17
+ 			if isa(md.sampling,'double'); md.sampling=sampling(); end
++			%VV
++			if ~isa(md.stochasticforcing,'stochasticforcing'); md.stochasticforcing=stochasticforcing(); end
+ 		end% }}}
+ 	end
+ 	methods
+@@ -249,6 +252,7 @@
+ 			disp(sprintf('%19s: %-22s -- %s','results'         ,['[1x1 ' class(self.results) ']'],'model results'));
+ 			disp(sprintf('%19s: %-22s -- %s','radaroverlay'    ,['[1x1 ' class(self.radaroverlay) ']'],'radar image for plot overlay'));
+ 			disp(sprintf('%19s: %-22s -- %s','miscellaneous'   ,['[1x1 ' class(self.miscellaneous) ']'],'miscellaneous fields'));
++			disp(sprintf('%19s: %-22s -- %s','stochasticforcing',['[1x1 ' class(self.stochasticforcing) ']'],'stochasticity applied to model forcings'));
+ 		end % }}}
+ 		function md = setdefaultparameters(md,planet) % {{{
+ 
+@@ -296,6 +300,7 @@
+ 			md.outputdefinition = outputdefinition();
+ 			md.miscellaneous    = miscellaneous();
+ 			md.private          = private();
++			md.stochasticforcing= stochasticforcing();
+ 		end
+ 		%}}}
+ 		function md = checkmessage(md,string) % {{{
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(nonexistent)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26526)
+@@ -0,0 +1,99 @@
++%STOCHASTICFORCING class definition
++%
++%   Usage:
++%      stochasticforcing=stochasticforcing();
++
++classdef stochasticforcing
++	properties (SetAccess=public) 
++		isstochasticforcing  = 0;
++		fields               = NaN;
++		dimensions           = NaN;
++		covariance           = NaN;
++		randomflag           = 1;
++	end
++	methods
++		function self = stochasticforcing(varargin) % {{{
++			switch nargin
++				case 0
++					self=setdefaultparameters(self);
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = extrude(self,md) % {{{
++			%Nothing for now
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++			self.isstochasticforcing  = 0; %stochasticforcing is turned off by default
++			self.randomflag           = 1; %true randomness is implemented by default
++		end % }}}
++		function md = checkconsistency(self,md,solution,analyses) % {{{
++
++			%Early return
++			if ~self.isstochasticforcing, return; end
++
++			num_fields = numel(self.fields);
++			size_tot   = sum(self.dimensions);
++
++			md = checkfield(md,'fieldname','stochasticforcing.isstochasticforcing','values',[0 1]);
++			md = checkfield(md,'fieldname','stochasticforcing.fields','numel',num_fields,'cell',1,'values',supportedstochforcings()); %VV check here 'cell' (19Oct2021)
++			md = checkfield(md,'fieldname','stochasticforcing.dimensions','NaN',1,'Inf',1,'>',0,'size',[1,num_fields]); %specific dimension for each field
++			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot]); %global covariance matrix
++			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
++
++			%Check that all fields agree with the corresponding md class	
++			for field=self.fields
++				if(contains(field,'SMB'))
++					if~(isequal(class(md.smb),char(field)))
++						error('md.smb does not agree with stochasticforcing field %s', char(field));
++					end
++				end
++				if(contains(field,'frontalforcings'))
++					if~(isequal(class(md.frontalforcings),char(field)))
++						error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
++					end
++				end
++			end
++		end % }}}
++		function disp(self) % {{{
++			disp(sprintf('   stochasticforcing parameters:'));
++			fielddisplay(self,'isstochasticforcing','is stochasticity activated?');
++			fielddisplay(self,'fields','fields with stochasticity applied, ex: {''SMBautoregression''}, or {''FrontalForcingsRignotAutoregression''}');
++			fielddisplay(self,'dimensions','dimensionality of each field');
++			fielddisplay(self,'covariance','covariance matrix for within- and between-fields covariance (units must be squared field units)');
++			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
++			disp('Available fields:');
++			disp('   SMBautoregression');
++			disp('   FrontalForcingsRignotAutoregression (thermal forcing)');
++		end % }}}
++		function marshall(self,prefix,md,fid) % {{{
++
++			yts=md.constants.yts;
++			num_fields = numel(self.fields);
++			%Scaling covariance matrix (scale column-by-column and row-by-row)
++			scaledfields = {'SMBautoregression'}; %list of fields that need scaling *1/yts
++			for i=1:num_fields
++            if any(strcmp(scaledfields,self.fields(i)))
++               inds = [1+sum(self.dimensions(1:i-1)):1:sum(self.dimensions(1:i))];
++               for row=inds %scale rows corresponding to scaled field
++                  self.covariance(row,:) = 1./yts*self.covariance(row,:);
++               end
++               for col=inds %scale columns corresponding to scaled field
++                  self.covariance(:,col) = 1./yts*self.covariance(:,col);
++               end
++            end
++         end
++
++			WriteData(fid,prefix,'object',self,'fieldname','isstochasticforcing','format','Boolean');
++			if ~self.isstochasticforcing 
++				return
++			else
++				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
++				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
++				WriteData(fid,prefix,'object',self,'fieldname','dimensions','format','IntMat');
++				WriteData(fid,prefix,'object',self,'fieldname','covariance','format','DoubleMat');
++				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
++			end
++		end % }}}
++	end
++end
+
+Property changes on: ../trunk-jpl/src/m/classes/stochasticforcing.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/m/miscellaneous/supportedstochforcings.m
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/supportedstochforcings.m	(nonexistent)
++++ ../trunk-jpl/src/m/miscellaneous/supportedstochforcings.m	(revision 26526)
+@@ -0,0 +1,8 @@
++function list = supportedstochforcings(),
++	% Defines list of fields supported
++	% by the class md.stochasticforcings
++
++	list = {...
++		'SMBautoregression',...
++		'FrontalForcingsRignotAutoregression'
++		};
+Index: ../trunk-jpl/test/Archives/Archive257.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive543.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(revision 26525)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26526)
+@@ -44,9 +44,14 @@
+ md.smb.ar_order       = 4;
+ md.smb.ar_timestep    = 2.0; %timestep of the autoregressive model [yr]
+ md.smb.phi            = [[0.2,0.1,0.05,0.01];[0.4,0.2,-0.2,0.1];[0.4,-0.4,0.1,-0.1]];
+-md.smb.covmat         = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]];
+-md.smb.randomflag     = 0; %fixed random seeds
+ 
++%Stochastic forcing
++md.stochasticforcing.isstochasticforcing = 1;
++md.stochasticforcing.fields              = [{'SMBautoregression'}];
++md.stochasticforcing.dimensions          = [md.smb.num_basins]; %dimension of each field
++md.stochasticforcing.covariance          = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]]; %global covariance among- and between-fields
++md.stochasticforcing.randomflag          = 0; %fixed random seeds
++
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(revision 26525)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26526)
+@@ -34,9 +34,14 @@
+ md.frontalforcings.ar_order             = 4;
+ md.frontalforcings.ar_timestep          = 2; %timestep of the autoregressive model [yr]
+ md.frontalforcings.phi                  = [[0.1,-0.1,0.01,-0.01];[0.2,-0.2,0.1,0.0]]; %autoregressive parameters
+-md.frontalforcings.covmat               = 1e-4*[[1.5,0.5];[0.5,0.4]];
+-md.frontalforcings.randomflag           = 0;
+ 
++%Stochastic forcing
++md.stochasticforcing.isstochasticforcing = 1;
++md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'}];
++md.stochasticforcing.dimensions          = [md.frontalforcings.num_basins]; %dimension of each field
++md.stochasticforcing.covariance          = 1e-4*[[1.5,0.5];[0.5,0.4]];; %global covariance among- and between-fields
++md.stochasticforcing.randomflag          = 0; %determines true/false randomness
++
+ md.transient.ismovingfront = 1;
+ md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+ md.levelset.migration_max = 1e10;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26526-26527.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26526-26527.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26526-26527.diff	(revision 26740)
@@ -0,0 +1,87 @@
+Index: ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26527)
+@@ -0,0 +1,67 @@
++/*!\file StochasticForcingx
++ * \brief: compute noise terms for the StochasticForcing fields
++ */
++
++#include "./StochasticForcingx.h"
++#include "../../shared/shared.h"
++#include "../../toolkits/toolkits.h"
++#include "../../shared/Random/random.h"
++
++void StochasticForcingx(FemModel* femmodel){/*{{{*/
++
++   /*Retrieve parameters*/
++   bool randomflag;
++   int M,N,numfields,my_rank;
++   int* fields            = NULL;
++   int* dimensions        = NULL;
++   IssmDouble* covariance = NULL;
++   femmodel->parameters->FindParam(&randomflag,StochasticForcingRandomflagEnum);
++   femmodel->parameters->FindParam(&numfields,StochasticForcingNumFieldsEnum);
++   femmodel->parameters->FindParam(&fields,&N,StochasticForcingFieldsEnum);    _assert_(N==numfields);
++   femmodel->parameters->FindParam(&dimensions,&N,StochasticForcingDimensionsEnum);    _assert_(N==numfields);
++   int dimtot=0;
++   for(int i=0;i<numfields;i++) dimtot = dimtot+dimensions[i];
++   femmodel->parameters->FindParam(&covariance,&M,&N,StochasticForcingCovarianceEnum); _assert_(M==dimtot); _assert_(N==dimtot);
++
++   /*Compute noise terms*/
++   IssmDouble* noiseterms = xNew<IssmDouble>(dimtot);
++   my_rank=IssmComm::GetRank();
++   if(my_rank==0){
++      int fixedseed;
++      IssmDouble time,dt,starttime;
++      femmodel->parameters->FindParam(&time,TimeEnum);
++      femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++      femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
++		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
++      if(randomflag) fixedseed=-1;
++      else fixedseed = reCast<int,IssmDouble>((time-starttime)/dt);
++      /*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
++      IssmDouble* temparray = NULL;
++      multivariateNormal(&temparray,dimtot,0.0,covariance,fixedseed);
++      for(int i=0;i<dimtot;i++) noiseterms[i]=temparray[i];
++      xDelete<IssmDouble>(temparray);
++   }
++   ISSM_MPI_Bcast(noiseterms,dimtot,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++   
++	int i=0;
++   for(int j=0;j<numfields;j++){
++      int enum_type;
++      IssmDouble* noisefield = xNew<IssmDouble>(dimensions[j]);
++      for(int k=0;k<dimensions[j];k++){
++         noisefield[k]=noiseterms[i+k];
++      }
++      
++      if(fields[j]==SMBautoregressionEnum)                        enum_type = SmbAutoregressionNoiseEnum;
++		else if(fields[j]==FrontalForcingsRignotAutoregressionEnum) enum_type = ThermalforcingAutoregressionNoiseEnum;
++		else _error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.\n"); 
++      femmodel->parameters->SetParam(noisefield,dimensions[j],enum_type);
++      i=i+dimensions[j];
++      xDelete<IssmDouble>(noisefield);
++   }
++
++	/*Cleanup*/
++   xDelete<int>(fields);
++   xDelete<int>(dimensions);
++   xDelete<IssmDouble>(covariance);
++   xDelete<IssmDouble>(noiseterms);
++}/*}}}*/
+Index: ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.h	(nonexistent)
++++ ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.h	(revision 26527)
+@@ -0,0 +1,10 @@
++#ifndef _STOCHASTICFORCINGX_H
++#define _STOCHASTICFORCINGX_H
++
++#include "../../classes/classes.h"
++#include "../../analyses/analyses.h"
++
++/* local prototypes: */
++void StochasticForcingx(FemModel* femmodel);
++
++#endif
Index: /issm/oecreview/Archive/25834-26739/ISSM-26527-26528.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26527-26528.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26527-26528.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26527)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26528)
+@@ -67,7 +67,7 @@
+ 		/*bool               AllActive(void);*/
+ 		/*bool               AnyActive(void);*/
+ 		bool               AnyFSet(void);
+-		void					 AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noisespin,int enum_type);
++		void					 AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,int enum_type);
+       void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type);
+ 		void               ComputeLambdaS(void);
+ 		void               ComputeNewDamage();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26528-26529.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26528-26529.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26528-26529.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26528)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26529)
+@@ -3921,7 +3921,7 @@
+ 	IssmDouble dz=maxz-minz;
+ 
+ 	/*CFL criterion: */
+-	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy+maxabsvz/dz);
++	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy+maxabsvz/dz + 1.e-18);
+ 
+ 	return dt;
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26528)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26529)
+@@ -5071,7 +5071,7 @@
+ 	IssmDouble dy=maxy-miny;
+ 
+ 	/*CFL criterion: */
+-	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy);
++	IssmDouble dt = C/(maxabsvx/dx+maxabsvy/dy + 1.e-18);
+ 
+ 	return dt;
+ }
Index: /issm/oecreview/Archive/25834-26739/ISSM-26529-26530.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26529-26530.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26529-26530.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/test/Archives/Archive226.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive323.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive324.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26530-26531.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26530-26531.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26530-26531.diff	(revision 26740)
@@ -0,0 +1,109 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26530)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26531)
+@@ -181,40 +181,6 @@
+ 
+ }
+ /*}}}*/
+-void       Penta::Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){/*{{{*/
+-   /* Recover the velocity acording to v=vb+(1-\zeta^{n+1})vsh, where \zeta=(s-z)/H
+-    * The variables vb, vsh, n, H and s are all from the 2D horizontal mesh(Tria), with "numnodes" DOFs
+-    * To project to penta the DOFs are doubled in size
+-    *
+-    */
+-   _assert_(this->inputs);
+-   if(!IsOnBase()) return;
+-   else{
+-      if(targetVel_enum==VxEnum || targetVel_enum==VyEnum){
+-         IssmDouble vel[NUMVERTICES];
+-         IssmDouble* xyz_list = NULL;
+-         Penta* penta = this;
+-         _assert_(NUMVERTICES-2*numnodes==0);
+-
+-         for(;;){
+-            penta->GetVerticesCoordinates(&xyz_list);
+-            for(int i=0;i<numnodes;i++) {
+-               vel[i] = vb[i] + vsh[i]*(1.0-pow((s[i]-xyz_list[i*3+2])/H[i], (n[i]+1)));
+-               vel[i+NUMVERTICES2D] = vb[i] + vsh[i]*(1-pow((s[i]-xyz_list[(i+NUMVERTICES2D)*3+2])/H[i], (n[i]+1)));
+-            }
+-				xDelete<IssmDouble>(xyz_list);
+-
+-            /*Add to the bottom side of the element*/
+-            penta->AddInput(targetVel_enum,&vel[0],P1Enum);
+-            if (penta->IsOnSurface()) break;
+-            penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id);
+-         }
+-      }
+-      else _error_("not implemented yet");
+-   }
+-
+-}
+-/*}}}*/
+ void       Penta::AddInput(int input_enum,IssmDouble* values, int interpolation_enum){/*{{{*/
+ 
+ 	/**/
+@@ -3299,6 +3265,47 @@
+ 	return PentaRef::PressureInterpolation(this->element_type);
+ }
+ /*}}}*/
++void       Penta::Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb,  IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){/*{{{*/
++   /* Recover the velocity acording to v=vb+(1-\zeta^{n+1})vsh, where \zeta=(s-z)/H
++    * The variables vb, vsh, n, H and s are all from the 2D horizontal mesh(Tria), with "numnodes" DOFs
++    * To project to penta the DOFs are doubled in size
++    *
++    */
++   _assert_(this->inputs);
++   if(!IsOnBase()) return;
++   else{
++      if(targetVel_enum==VxEnum || targetVel_enum==VyEnum){
++         IssmDouble vel[NUMVERTICES2D*5];
++         IssmDouble* xyz_list = NULL;
++			IssmDouble zi;
++         Penta* penta = this;
++			numnodes = penta->NumberofNodes(P1xP4Enum);
++         _assert_(NUMVERTICES2D*5-numnodes==0);
++			GaussPenta gauss;
++
++         for(;;){
++            penta->GetVerticesCoordinates(&xyz_list);
++            for(int i=0;i<NUMVERTICES2D;i++) {
++					for (int j=0;j<5;j++){
++						/* Get z-coordinate of the current node */
++						gauss.GaussNode(P1xP4Enum, i+j*NUMVERTICES2D);
++						zi = this->GetZcoord(xyz_list, &gauss);
++	               vel[i+j*NUMVERTICES2D] = vb[i] + vsh[i]*(1.0-pow((s[i]-zi)/H[i], (n[i]+1)));
++					}
++            }
++				xDelete<IssmDouble>(xyz_list);
++
++            /*Add to the bottom side of the element*/
++            penta->AddInput(targetVel_enum,&vel[0],P1xP4Enum);
++            if (penta->IsOnSurface()) break;
++            penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id);
++         }
++      }
++      else _error_("not implemented yet");
++   }
++
++}
++/*}}}*/
+ void       Penta::ReduceMatrices(ElementMatrix* Ke,ElementVector* pe){/*{{{*/
+ 
+ 	int analysis_type;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26530)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26531)
+@@ -2603,6 +2603,7 @@
+ 				for(int i=0;i<3;i++) indices[i] = vertices[i]->lid;
+ 				input->Serve(numindices,&indices[0]);
+ 				break;
++			case P1xP4Enum:
+ 			case P1DGEnum:
+ 			case P1bubbleEnum:
+ 				input->ServeCollapsed(this->lid,this->iscollapsed);
+Index: ../trunk-jpl/test/Archives/Archive335.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26531-26532.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26531-26532.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26531-26532.diff	(revision 26740)
@@ -0,0 +1,145 @@
+Index: ../trunk-jpl/test/Archives/Archive542.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26531)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26532)
+@@ -63,37 +63,48 @@
+ 			fielddisplay(self,'covariance','covariance matrix for within- and between-fields covariance (units must be squared field units)');
+ 			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 			disp('Available fields:');
+-			disp('   SMBautoregression');
+-			disp('   FrontalForcingsRignotAutoregression (thermal forcing)');
++			for field=supportedstochforcings()
++				fprintf('   %s \n',string(field));
++			end
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+ 
+ 			yts=md.constants.yts;
+ 			num_fields = numel(self.fields);
+-			%Scaling covariance matrix (scale column-by-column and row-by-row)
+-			scaledfields = {'SMBautoregression'}; %list of fields that need scaling *1/yts
+-			for i=1:num_fields
+-            if any(strcmp(scaledfields,self.fields(i)))
+-               inds = [1+sum(self.dimensions(1:i-1)):1:sum(self.dimensions(1:i))];
+-               for row=inds %scale rows corresponding to scaled field
+-                  self.covariance(row,:) = 1./yts*self.covariance(row,:);
+-               end
+-               for col=inds %scale columns corresponding to scaled field
+-                  self.covariance(:,col) = 1./yts*self.covariance(:,col);
+-               end
+-            end
+-         end
+ 
+ 			WriteData(fid,prefix,'object',self,'fieldname','isstochasticforcing','format','Boolean');
+ 			if ~self.isstochasticforcing 
+ 				return
+ 			else
++				%Scaling covariance matrix (scale column-by-column and row-by-row)
++				scaledfields = {'SMBautoregression'}; %list of fields that need scaling *1/yts
++				tempcovariance = self.covariance; %copy of covariance to avoid writing back in member variable
++				for i=1:num_fields
++					if any(strcmp(scaledfields,self.fields(i)))
++						inds = [1+sum(self.dimensions(1:i-1)):1:sum(self.dimensions(1:i))];
++						for row=inds %scale rows corresponding to scaled field
++							tempcovariance(row,:) = 1./yts*self.covariance(row,:);
++						end
++						for col=inds %scale columns corresponding to scaled field
++							tempcovariance(:,col) = 1./yts*self.covariance(:,col);
++						end
++					end
++				end
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+ 				WriteData(fid,prefix,'object',self,'fieldname','dimensions','format','IntMat');
+-				WriteData(fid,prefix,'object',self,'fieldname','covariance','format','DoubleMat');
++				WriteData(fid,prefix,'data',tempcovariance,'name','md.stochasticforcing.covariance','format','DoubleMat');
+ 				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
+ 			end
+ 		end % }}}
+ 	end
+ end
++function list = supportedstochforcings() % {{{
++   % Defines list of fields supported
++   % by the class md.stochasticforcing
++
++   list = {...
++      'SMBautoregression',...
++      'FrontalForcingsRignotAutoregression'
++      };
++end % }}}
+Index: ../trunk-jpl/test/Archives/Archive257.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive543.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(revision 26531)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26532)
+@@ -63,28 +63,19 @@
+ 	(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).SmbMassBalance),...
++   (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).IceVolume),...
+-    (md.results.TransientSolution(2).SmbMassBalance),...
++   (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).IceVolume),...
+-    (md.results.TransientSolution(3).SmbMassBalance),...
++   (md.results.TransientSolution(3).SmbMassBalance),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test542.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test542.m	(revision 26531)
++++ ../trunk-jpl/test/NightlyRun/test542.m	(revision 26532)
+@@ -60,8 +60,8 @@
+    (md.results.TransientSolution(1).Base),...
+    (md.results.TransientSolution(1).Surface),...
+    (md.results.TransientSolution(1).Thickness),...
++   (md.results.TransientSolution(1).MaskIceLevelset),...
+    (md.results.TransientSolution(1).CalvingMeltingrate),...
+-   (md.results.TransientSolution(1).MaskIceLevelset),...
+    (md.results.TransientSolution(2).Vx),...
+    (md.results.TransientSolution(2).Vy),...
+    (md.results.TransientSolution(2).Vel),...
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(revision 26531)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26532)
+@@ -69,8 +69,8 @@
+    (md.results.TransientSolution(1).Base),...
+    (md.results.TransientSolution(1).Surface),...
+    (md.results.TransientSolution(1).Thickness),...
++   (md.results.TransientSolution(1).MaskIceLevelset),...
+    (md.results.TransientSolution(1).CalvingMeltingrate),...
+-   (md.results.TransientSolution(1).MaskIceLevelset),...
+    (md.results.TransientSolution(2).Vx),...
+    (md.results.TransientSolution(2).Vy),...
+    (md.results.TransientSolution(2).Vel),...
Index: /issm/oecreview/Archive/25834-26739/ISSM-26532-26533.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26532-26533.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26532-26533.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 26532)
++++ ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 26533)
+@@ -235,7 +235,7 @@
+ 	IssmDouble x2 = xyz_list[3*1+0];
+ 	IssmDouble y2 = xyz_list[3*1+1];
+ 
+-	*Jdet = .5*sqrt(pow(x2-x1,2) + pow(y2-y1,2));
++	*Jdet = .5*sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
+ 	if(*Jdet<0) _error_("negative jacobian determinant!");
+ 
+ }
Index: /issm/oecreview/Archive/25834-26739/ISSM-26533-26534.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26533-26534.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26533-26534.diff	(revision 26740)
@@ -0,0 +1,60 @@
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26533)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26534)
+@@ -9,6 +9,7 @@
+ #endif
+ 
+ #include "./Marshalling.h"
++#include "../../Numerics/isnan.h"
+ 
+ WriteCheckpointFunctor::WriteCheckpointFunctor(char** pmarshalled_data_in) : MarshallHandle(MARSHALLING_WRITE){/*{{{*/
+ 	this->pmarshalled_data = pmarshalled_data_in;
+@@ -82,6 +83,7 @@
+ }/*}}}*/
+ void RegisterInputFunctor::call(IssmDouble & value){/*{{{*/
+ 	_assert_(this->double_count<size_max);
++	_assert_(!xIsNan<IssmDouble>(value));
+ 	this->tape_codi->registerInput(value);
+ 	this->identifiers[this->double_count] = value.getIdentifier();
+ 	this->double_count++;
+@@ -90,6 +92,7 @@
+ 	if(value){
+ 		for(int i=0;i<size;i++){
+ 			_assert_(this->double_count<size_max);
++			_assert_(!xIsNan<IssmDouble>(value[i]));
+ 			this->tape_codi->registerInput(value[i]);
+ 			this->identifiers[this->double_count] = value[i].getIdentifier();
+ 			this->double_count++;
+@@ -106,6 +109,7 @@
+ 	printf("   double_count: %i\n",double_count);
+ }/*}}}*/
+ void RegisterOutputFunctor::call(IssmDouble & value){/*{{{*/
++	_assert_(!xIsNan<IssmDouble>(value));
+ 	this->tape_codi->registerOutput(value);
+ 	this->double_count++;
+ }/*}}}*/
+@@ -112,6 +116,7 @@
+ void RegisterOutputFunctor::call(IssmDouble* & value,int size){/*{{{*/
+ 	if(value){
+ 		for(int i=0;i<size;i++){
++			_assert_(!xIsNan<IssmDouble>(value[i]));
+ 			this->tape_codi->registerOutput(value[i]);
+ 			this->double_count++;
+ 		}
+@@ -130,6 +135,7 @@
+ }/*}}}*/
+ void SetAdjointFunctor::call(IssmDouble & value){/*{{{*/
+ 	_assert_(this->double_count<size_max);
++	_assert_(!xIsNan<IssmDouble>(this->adjoint[this->double_count]));
+ 	value.gradient() = this->adjoint[this->double_count];
+ 	this->double_count++;
+ }/*}}}*/
+@@ -137,6 +143,7 @@
+ 	if(value){
+ 		for(int i=0;i<size;i++){
+ 			_assert_(this->double_count<size_max);
++			_assert_(!xIsNan<IssmDouble>(this->adjoint[this->double_count]));
+ 			value[i].gradient() = this->adjoint[this->double_count];
+ 			this->double_count++;
+ 		}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26534-26535.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26534-26535.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26534-26535.diff	(revision 26740)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26534)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 26535)
+@@ -39,6 +39,7 @@
+ 	paths = {...
+ 		['/u/astrid-r1b/ModelData/ModelData/MCdataset-' ncdate '.nc'],...
+ 		['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
++		['/totten_1/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'],...
+ 		['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+ 		['./' basename '-' ncdate '.nc'],...
+ 		};
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m	(revision 26534)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m	(revision 26535)
+@@ -1,7 +1,7 @@
+ 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';
++filename = '/totten_1/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
+ 
+ %Figure out what subset of the matrix should be read
+ load(filename,'x_m','y_m');
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpSeaRISE.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpSeaRISE.m	(revision 26534)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpSeaRISE.m	(revision 26535)
+@@ -51,6 +51,12 @@
+ 		elseif hemisphere==-1,
+ 			searisenc='/u/astrid-r1b/ModelData/SeaRISE/Antarctica5km_shelves_v1.0/Antarctica_5km_dev1.0.nc';
+ 		end
++	case {'totten'}
++		if hemisphere==1,
++			searisenc='/totten_1/ModelData/SeaRISE/Greenland_5km_dev1.2.nc';
++		elseif hemisphere==-1,
++			searisenc='/totten_1/ModelData/SeaRISE/Antarctica_5km_dev1.0.nc';
++		end
+ 	otherwise
+ 		error('hostname not supported yet');
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26535-26536.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26535-26536.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26535-26536.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26535)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26536)
+@@ -37,6 +37,7 @@
+ 	paths = {...
+ 		['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+ 		['/home/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'],...
++		['/totten_1/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'],...
+ 		['/Users/larour/ModelData/BedMachine/' basename '-' ncdate '.nc'],...
+ 		['./' basename '-' ncdate '.nc'],...
+ 		};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26536-26537.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26536-26537.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26536-26537.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/m/plot/radarpower.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/radarpower.m	(revision 26536)
++++ ../trunk-jpl/src/m/plot/radarpower.m	(revision 26537)
+@@ -37,15 +37,28 @@
+ 		paths = {getfieldvalue(options,'geotiff_name')};
+ 	elseif md.mesh.epsg==3031, %Antarctica
+ 			if highres,
+-				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif','/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif'};
++				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif',...
++					'/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif',...
++					'/totten_1/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif',...
++					};
+ 			else
+-				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif','/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif'};
++				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif',...
++					'/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif',...
++					'/totten_1/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif',...
++					};
+ 			end
+ 	elseif md.mesh.epsg==3413,   %Greenland 
+ 		if highres,
+-			paths = {'/u/astrid-r1b/ModelData/MOG/mog100_r2_hp1.tif','/home/ModelData/Greenland/MOG/mog100_r2_hp1.tif'};
++			paths = {'/u/astrid-r1b/ModelData/MOG/mog100_r2_hp1.tif',...
++				'/home/ModelData/Greenland/MOG/mog100_r2_hp1.tif',...
++				'/totten_1/ModelData/Greenland/MOG/mog100_r2_hp1.tif',...
++				};
+ 		else
+-			paths = {'/u/astrid-r1b/ModelData/MOG/mog500_r2_hp1.tif','/home/ModelData/Greenland/MOG/mog500_r2_hp1.tif','/Users/larour/ModelData/MOG/mog500_r2_hp1.tif'};
++			paths = {'/u/astrid-r1b/ModelData/MOG/mog500_r2_hp1.tif',...
++				'/home/ModelData/Greenland/MOG/mog500_r2_hp1.tif',...
++				'/totten_1/ModelData/Greenland/MOG/mog500_r2_hp1.tif',...
++				'/Users/larour/ModelData/MOG/mog500_r2_hp1.tif',...
++				};
+ 		end
+ 	else
+ 		error('Need to provide geotiff for areas outside of Greenland and Antarctica');
Index: /issm/oecreview/Archive/25834-26739/ISSM-26537-26538.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26537-26538.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26537-26538.diff	(revision 26740)
@@ -0,0 +1,243 @@
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26537)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26538)
+@@ -68,6 +68,7 @@
+ from contourenvelope import contourenvelope
+ from DepthAverage import DepthAverage
+ from sampling import sampling
++from stochasticforcing import stochasticforcing
+ #}}}
+ 
+ 
+@@ -126,6 +127,7 @@
+         self.radaroverlay = None
+         self.miscellaneous = None
+         self.private = None
++        self.stochasticforcing = None
+ 
+         if len(args) == 0:
+             self.setdefaultparameters('earth')
+@@ -182,54 +184,58 @@
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("results", "[%s %s]" % ("1x1", obj.results.__class__.__name__), "model results"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("radaroverlay", "[%s %s]" % ("1x1", obj.radaroverlay.__class__.__name__), "radar image for plot overlay"))
+         s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("miscellaneous", "[%s %s]" % ("1x1", obj.miscellaneous.__class__.__name__), "miscellaneous fields"))
++        s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("stochasticforcing", "[%s %s]" % ("1x1", obj.stochasticforcing.__class__.__name__), "stochasticity applied to model forcings"))
+         return s
+     #}}}
+ 
+     def properties(self): #{{{
+         # ordered list of properties since vars(self) is random
+-        return ['mesh',
+-                'mask',
+-                'geometry',
+-                'constants',
+-                'smb',
+-                'basalforcings',
+-                'materials',
+-                'damage',
+-                'friction',
+-                'flowequation',
+-                'timestepping',
+-                'initialization',
+-                'rifts',
+-                'dsl',
+-                'solidearth',
+-                'debug',
+-                'verbose',
+-                'settings',
+-                'toolkits',
+-                'cluster',
+-                'balancethickness',
+-                'stressbalance',
+-                'groundingline',
+-                'hydrology',
+-                'masstransport',
+-                'thermal',
+-                'steadystate',
+-                'transient',
+-                'levelset',
+-                'calving',
+-                'frontalforcings',
+-                'love',
+-                'esa',
+-                'sampling',
+-                'autodiff',
+-                'inversion',
+-                'qmu',
+-                'amr',
+-                'results',
+-                'outputdefinition',
+-                'radaroverlay',
+-                'miscellaneous',
+-                'private']
++        return [
++            'mesh',
++            'mask',
++            'geometry',
++            'constants',
++            'smb',
++            'basalforcings',
++            'materials',
++            'damage',
++            'friction',
++            'flowequation',
++            'timestepping',
++            'initialization',
++            'rifts',
++            'dsl',
++            'solidearth',
++            'debug',
++            'verbose',
++            'settings',
++            'toolkits',
++            'cluster',
++            'balancethickness',
++            'stressbalance',
++            'groundingline',
++            'hydrology',
++            'masstransport',
++            'thermal',
++            'steadystate',
++            'transient',
++            'levelset',
++            'calving',
++            'frontalforcings',
++            'love',
++            'esa',
++            'sampling',
++            'autodiff',
++            'inversion',
++            'qmu',
++            'amr',
++            'results',
++            'outputdefinition',
++            'radaroverlay',
++            'miscellaneous',
++            'private',
++            'stochasticforcing'
++        ]
+     #}}}
+ 
+     def setdefaultparameters(self, planet): #{{{
+@@ -276,6 +282,7 @@
+         self.outputdefinition = outputdefinition()
+         self.miscellaneous = miscellaneous()
+         self.private = private()
++        self.stochasticforcing = stochasticforcing()
+     #}}}
+ 
+     def checkmessage(self, string): #{{{
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26538)
+@@ -0,0 +1,108 @@
++import numpy as np
++
++from checkfield import checkfield
++from fielddisplay import fielddisplay
++from MatlabFuncs import *
++from WriteData import WriteData
++
++class stochasticforcing(object):
++    """STOCHASTICFORCING class definition
++
++    Usage:
++        stochasticforcing = stochasticforcing()
++    """
++
++    def __init__(self, *args):  # {{{
++        self.isstochasticforcing = 0
++        self.fields = np.nan
++        self.dimensions = np.nan
++        self.covariance = np.nan
++        self.randomflag = 1
++
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            error('constructor not supported')
++
++    def __repr__(self):  # {{{
++        s = '   stochasticforcing parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'isstochasticforcing', 'is stochasticity activated?'))
++        s += '{}\n'.format(fielddisplay(self, 'fields', 'fields with stochasticity applied, ex: [\'SMBautoregression\'], or [\'FrontalForcingsRignotAutoregression\']'))
++        s += '{}\n'.format(fielddisplay(self, 'covariance', 'covariance matrix for within- and between-fields covariance (units must be squared field units)'))
++        s += '{}\n'.format(fielddisplay(self, 'randomflag', 'whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)'))
++        s += 'Available fields:\n'
++        s += '   SMBautoregression\n'
++        s += '   FrontalForcingsRignotAutoregression (thermal forcing)\n'
++        return s
++    #}}}
++
++    def setdefaultparameters(self):  # {{{
++        # Type of stabilization used
++        self.isstochasticforcing = 0 # stochasticforcing is turned off by default
++        self.randomflag          = 1 # true randomness is implemented by default
++        return self
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        # Early return
++        if not self.isstochasticforcing:
++            return md
++
++        num_fields  = numel(self.fields)
++        size_tot    = np.sum(self.dimensions)
++
++        md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', supportedstochforcings()) # VV check here 'cell' (19Oct2021)
++        md = checkfield(md, 'fieldname', 'stochasticforcing.dimensions', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [num_fields]) # specific dimension for each field; NOTE: As opposed to MATLAB implementation, pass list
++        md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot]) # global covariance matrix
++        md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
++
++        # Check that all fields agree with the corresponding md class
++        for field in self.fields:
++            if (contains(field, 'SMB')):
++                if not (type(md.smb) == field):
++                    error('md.smb does not agree with stochasticforcing field {}'.format(field))
++            if (contains(field, 'frontalforcings')):
++                if not (type(md.frontalforcings) == field):
++                    error('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
++        return md
++    # }}}
++
++    def extrude(self, md):  # {{{
++        # Nothing for now
++        return self
++    # }}}
++
++    def marshall(self, prefix, md, fid):  # {{{
++        yts = md.constants.yts
++        num_fields = range(self.fields)
++        # Scaling covariance matrix (scale column-by-column and row-by-row)
++        scaledfields = ['SMBautoregression'] # list of fields that need scaling * 1/yts
++        for i in range(num_fields):
++            print(i)
++            if self.fields[i] in scaledfields:
++                print(self.fields[i])
++                inds = range(1 + np.sum(self.dimensions[0:i]), np.sum(self.dimensions[0:i]))
++                for row in inds: # scale rows corresponding to scaled field
++                    self.covariance[row, :] = 1 / yts * self.covariance[row, :]
++                for col in inds: # scale columns corresponding to scaled field
++                    self.covariance[:, col] = 1 / yts * self.covariance[:, col]
++
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'isstochasticforcing', 'format', 'Boolean')
++        if not self.isstochasticforcing:
++            return md
++        else:
++            WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
++            WriteData(fid, prefix, 'object', self, 'fieldname','dimensions', 'format', 'IntMat')
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'covariance', 'format', 'DoubleMat')
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
++    # }}}
++
++def supportedstochforcings():
++    """ Defines list of fields supported  by the class stochasticforcings
++    """
++    return [
++        'SMBautoregression',
++        'FrontalForcingsRignotAutoregression'
++    ]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26538-26539.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26538-26539.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26538-26539.diff	(revision 26740)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26538)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26539)
+@@ -75,18 +75,17 @@
+ 
+     def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+-        num_fields = range(self.fields)
+-        # Scaling covariance matrix (scale column-by-column and row-by-row)
+-        scaledfields = ['SMBautoregression'] # list of fields that need scaling * 1/yts
+-        for i in range(num_fields):
+-            print(i)
+-            if self.fields[i] in scaledfields:
+-                print(self.fields[i])
+-                inds = range(1 + np.sum(self.dimensions[0:i]), np.sum(self.dimensions[0:i]))
+-                for row in inds: # scale rows corresponding to scaled field
+-                    self.covariance[row, :] = 1 / yts * self.covariance[row, :]
+-                for col in inds: # scale columns corresponding to scaled field
+-                    self.covariance[:, col] = 1 / yts * self.covariance[:, col]
++        if (type(self.fields) is list):
++            num_fields = len(self.fields)
++            # Scaling covariance matrix (scale column-by-column and row-by-row)
++            scaledfields = ['SMBautoregression'] # list of fields that need scaling * 1/yts
++            for i in range(num_fields):
++                if self.fields[i] in scaledfields:
++                    inds = range(1 + np.sum(self.dimensions[0:i]), np.sum(self.dimensions[0:i]))
++                    for row in inds: # scale rows corresponding to scaled field
++                        self.covariance[row, :] = 1 / yts * self.covariance[row, :]
++                    for col in inds: # scale columns corresponding to scaled field
++                        self.covariance[:, col] = 1 / yts * self.covariance[:, col]
+ 
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'isstochasticforcing', 'format', 'Boolean')
+         if not self.isstochasticforcing:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26539-26540.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26539-26540.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26539-26540.diff	(revision 26740)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/src/m/modules/ExpToLevelSet.m
+===================================================================
+--- ../trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26539)
++++ ../trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26540)
+@@ -13,17 +13,37 @@
+ 
+ % Check usage
+ if nargin~=3
+-	help ExpToLevelSet
+-	error('Wrong usage (see above)');
++    help ExpToLevelSet
++    error('Wrong usage (see above)');
+ end
+ 
++multipleShp = 0;
++
+ if ischar(contourname),
+-	[path,name,ext]=fileparts(contourname); 
+-	if strcmpi(ext,'.shp'),
+-		%read contour from shapefile
+-		contourname=shpread(contourname); 
+-	end
++    [path,name,ext]=fileparts(contourname);
++    if strcmpi(ext,'.shp'),
++        %read contour from shapefile
++        contourname=shpread(contourname);
++        if isstruct(contourname)
++            multipleShp = size(contourname, 2);
++        end
++    end
+ end
+ 
+ % Call mex module
+-distance = ExpToLevelSet_matlab(x,y,contourname);
++if multipleShp>0 
++    % shp file contains multiple contours
++    distance = zeros(length(x)+1, multipleShp);
++    for i = 1:multipleShp
++        distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
++        % append the NAME information at the end of the distance
++        if isfield(contourname(i),'NAME')
++            distance(end, i) = contourname(i).NAME;
++        else
++			distance(end, i) = i;
++        end        
++    end
++else
++    % single shape or exp file
++    distance = ExpToLevelSet_matlab(x,y,contourname);
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26540-26541.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26540-26541.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26540-26541.diff	(revision 26740)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/src/m/modules/ExpToLevelSet.m
+===================================================================
+--- ../trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26540)
++++ ../trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26541)
+@@ -13,37 +13,37 @@
+ 
+ % Check usage
+ if nargin~=3
+-    help ExpToLevelSet
+-    error('Wrong usage (see above)');
++	help ExpToLevelSet
++	error('Wrong usage (see above)');
+ end
+ 
+ multipleShp = 0;
+ 
+ if ischar(contourname),
+-    [path,name,ext]=fileparts(contourname);
+-    if strcmpi(ext,'.shp'),
+-        %read contour from shapefile
+-        contourname=shpread(contourname);
+-        if isstruct(contourname)
+-            multipleShp = size(contourname, 2);
+-        end
+-    end
++	[path,name,ext]=fileparts(contourname);
++	if strcmpi(ext,'.shp'),
++		%read contour from shapefile
++		contourname=shpread(contourname);
++		if isstruct(contourname)
++			multipleShp = size(contourname, 2);
++		end
++	end
+ end
+ 
+ % Call mex module
+ if multipleShp>0 
+-    % shp file contains multiple contours
+-    distance = zeros(length(x)+1, multipleShp);
+-    for i = 1:multipleShp
+-        distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
+-        % append the NAME information at the end of the distance
+-        if isfield(contourname(i),'NAME')
+-            distance(end, i) = contourname(i).NAME;
+-        else
++	% shp file contains multiple contours
++	distance = zeros(length(x)+1, multipleShp);
++	for i = 1:multipleShp
++		distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
++		% append the NAME information at the end of the distance
++		if isfield(contourname(i),'NAME')
++			distance(end, i) = contourname(i).NAME;
++		else
+ 			distance(end, i) = i;
+-        end        
+-    end
++		end        
++	end
+ else
+-    % single shape or exp file
+-    distance = ExpToLevelSet_matlab(x,y,contourname);
++	% single shape or exp file
++	distance = ExpToLevelSet_matlab(x,y,contourname);
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26541-26542.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26541-26542.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26541-26542.diff	(revision 26740)
@@ -0,0 +1,86 @@
+Index: ../trunk-jpl/test/MITgcm/code/packages.conf
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code/packages.conf	(revision 26541)
++++ ../trunk-jpl/test/MITgcm/code/packages.conf	(revision 26542)
+@@ -1,6 +1,3 @@
+-# $Header: /u/gcmpack/MITgcm/verification/isomip/code/packages.conf,v 1.2 2010/02/11 22:24:12 dimitri Exp $
+-# $Name:  $
+-
+ gfd
+ timeave
+ shelfice
+Index: ../trunk-jpl/test/MITgcm/code_4003/SIZE.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26541)
++++ ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26542)
+@@ -1,27 +1,35 @@
++CBOP
++C    !ROUTINE: SIZE.h
++C    !INTERFACE:
++C    include SIZE.h
++C    !DESCRIPTION: \bv
++C     *==========================================================*
++C     | SIZE.h Declare size of underlying computational grid.
++C     *==========================================================*
++C     | The design here supports a three-dimensional model grid
++C     | with indices I,J and K. The three-dimensional domain
++C     | is comprised of nPx*nSx blocks (or tiles) of size sNx
++C     | along the first (left-most index) axis, nPy*nSy blocks
++C     | of size sNy along the second axis and one block of size
++C     | Nr along the vertical (third) axis.
++C     | Blocks/tiles have overlap regions of size OLx and OLy
++C     | along the dimensions that are subdivided.
++C     *==========================================================*
++C     \ev
+ C
+-C     /==========================================================\
+-C     | SIZE.h Declare size of underlying computational grid.    |
+-C     |==========================================================|
+-C     | The design here support a three-dimensional model grid   |
+-C     | with indices I,J and K. The three-dimensional domain     |
+-C     | is comprised of nPx*nSx blocks of size sNx along one axis|
+-C     | nPy*nSy blocks of size sNy along another axis and one    |
+-C     | block of size Nz along the final axis.                   |
+-C     | Blocks have overlap regions of size OLx and OLy along the|
+-C     | dimensions that are subdivided.                          |
+-C     \==========================================================/
+-C     Voodoo numbers controlling data layout.
+-C     sNx - No. X points in sub-grid.
+-C     sNy - No. Y points in sub-grid.
+-C     OLx - Overlap extent in X.
+-C     OLy - Overlat extent in Y.
+-C     nSx - No. sub-grids in X.
+-C     nSy - No. sub-grids in Y.
+-C     nPx - No. of processes to use in X.
+-C     nPy - No. of processes to use in Y.
+-C     Nx  - No. points in X for the total domain.
+-C     Ny  - No. points in Y for the total domain.
+-C     Nr  - No. points in Z for full process domain.
++C     Voodoo numbers controlling data layout:
++C     sNx :: Number of X points in tile.
++C     sNy :: Number of Y points in tile.
++C     OLx :: Tile overlap extent in X.
++C     OLy :: Tile overlap extent in Y.
++C     nSx :: Number of tiles per process in X.
++C     nSy :: Number of tiles per process in Y.
++C     nPx :: Number of processes to use in X.
++C     nPy :: Number of processes to use in Y.
++C     Nx  :: Number of points in X for the full domain.
++C     Ny  :: Number of points in Y for the full domain.
++C     Nr  :: Number of points in vertical direction.
++CEOP
+       INTEGER sNx
+       INTEGER sNy
+       INTEGER OLx
+@@ -46,9 +54,9 @@
+      &           Ny  = sNy*nSy*nPy,
+      &           Nr  =  90)
+ 
+-C     MAX_OLX  - Set to the maximum overlap region size of any array
++C     MAX_OLX :: Set to the maximum overlap region size of any array
+ C     MAX_OLY    that will be exchanged. Controls the sizing of exch
+-C                routine buufers.
++C                routine buffers.
+       INTEGER MAX_OLX
+       INTEGER MAX_OLY
+       PARAMETER ( MAX_OLX = OLx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26542-26543.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26542-26543.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26542-26543.diff	(revision 26740)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26542)
++++ ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26543)
+@@ -1,4 +1,3 @@
+-
+ C     Diagnostics Array Dimension
+ C     ---------------------------
+ C     ndiagMax   :: maximum total number of available diagnostics
+@@ -19,11 +18,10 @@
+       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( numDiags = 20*Nr )
++      PARAMETER( nRegions = 2 , sizRegMsk = 1 , nStats = 4 )
+       PARAMETER( diagSt_size = 10*Nr )
+ 
+-
+ CEH3 ;;; Local Variables: ***
+ CEH3 ;;; mode:fortran ***
+ CEH3 ;;; End: ***
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26542)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26543)
+@@ -4,12 +4,13 @@
+ %Script control parameters
+ steps=1:11;
+ steps=1:5;
++steps=6;
+ 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/*
+-!rm -rf Models
++%!rm -rf ${ISSM_DIR}/test/MITgcm/install_dngoldberg
++%!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
++%!rm -rf Models
+ 
+ %Organizer
+ !mkdir Models
+@@ -151,7 +152,7 @@
+     end
+     !\mkdir run
+     !\cp ../MITgcm/build/mitgcmuv run
+-    !\cp ../MITgcm/install_dngoldberg/verification/shelfice_remeshing/input/* run
++    !\cp ../MITgcm/install_dngoldberg/verification/shelfice_2d_remesh/input/* run
+     !\cp ../MITgcm/input_4003/* run
+     !\cp ../MITgcm/input_4003/data_uncoupled run/data
+     !\cp ../MITgcm/input_4003/eedata_uncoupled run/eedata
Index: /issm/oecreview/Archive/25834-26739/ISSM-26543-26544.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26543-26544.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26543-26544.diff	(revision 26740)
@@ -0,0 +1,1932 @@
+Index: ../trunk-jpl/test/MITgcm/code/CPP_EEOPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code/CPP_EEOPTIONS.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code/CPP_EEOPTIONS.h	(revision 26544)
+@@ -62,9 +62,6 @@
+ 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
+Index: ../trunk-jpl/test/MITgcm/code/do_oceanic_phys.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code/do_oceanic_phys.F	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code/do_oceanic_phys.F	(revision 26544)
+@@ -1,5 +1,8 @@
+ #include "PACKAGES_CONFIG.h"
+ #include "CPP_OPTIONS.h"
++#ifdef ALLOW_MOM_COMMON
++# include "MOM_COMMON_OPTIONS.h"
++#endif
+ #ifdef ALLOW_AUTODIFF
+ # include "AUTODIFF_OPTIONS.h"
+ #endif
+@@ -72,6 +75,8 @@
+ C       |
+ C       |-- EXTERNAL_FORCING_SURF
+ C       |
++C       |-- OBCS_ADJUST
++C       |
+ C       |- k loop (Nr:1):
+ C       | - DWNSLP_CALC_RHO
+ C       | - BBL_CALC_RHO
+@@ -119,6 +124,8 @@
+ C       |
+ C       |-- KPP_DO_EXCH
+ C       |
++C       |-- GGL90_EXCHANGES
++C       |
+ C       |-- DIAGS_RHO_G
+ C       |-- DIAGS_OCEANIC_SURF_FLUX
+ C       |-- SALT_PLUME_DIAGNOSTICS_FILL
+@@ -142,8 +149,9 @@
+ 
+ #ifdef ALLOW_AUTODIFF
+ # include "AUTODIFF_MYFIELDS.h"
+-# include "tamc.h"
+-# include "tamc_keys.h"
++# ifdef ALLOW_AUTODIFF_TAMC
++#  include "tamc.h"
++# endif
+ # include "FFIELDS.h"
+ # include "SURFACE.h"
+ # include "EOS.h"
+@@ -195,12 +203,13 @@
+ 
+ C     !LOCAL VARIABLES:
+ C     == Local variables
+-C     rhoK, rhoKm1  :: Density at current level, and level above
++C     rhoKp1,rhoKm1 :: Density at current level, and @ level minus one
+ C     iMin, iMax    :: Ranges and sub-block indices on which calculations
+ C     jMin, jMax       are applied.
+ C     bi, bj        :: tile indices
+ C     msgBuf        :: Temp. for building output string
+ C     i,j,k         :: loop indices
++C     kSrf          :: surface index
+       _RL rhoKp1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+       _RL rhoKm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+       _RL sigmaX  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
+@@ -209,7 +218,7 @@
+       INTEGER iMin, iMax
+       INTEGER jMin, jMax
+       INTEGER bi, bj
+-      INTEGER i, j, k
++      INTEGER i, j, k, kSrf
+       CHARACTER*(MAX_LEN_MBUF) msgBuf
+       INTEGER doDiagsRho
+       LOGICAL calcGMRedi, calcKPP, calcConvect
+@@ -220,6 +229,11 @@
+ #ifdef ALLOW_AUTODIFF
+       _RL thetaRef
+ #endif /* ALLOW_AUTODIFF */
++#ifdef ALLOW_AUTODIFF_TAMC
++      INTEGER act1, act2, act3, act4
++      INTEGER max1, max2, max3
++      INTEGER kkey, itdkey
++#endif
+ CEOP
+ 
+ #ifdef ALLOW_AUTODIFF_TAMC
+@@ -227,6 +241,9 @@
+       itdkey = 1
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
++      kSrf = 1
++      IF ( usingPCoords ) kSrf = Nr
++
+ #ifdef ALLOW_DEBUG
+       IF (debugMode) CALL DEBUG_ENTER('DO_OCEANIC_PHYS',myThid)
+ #endif
+@@ -281,33 +298,19 @@
+ #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
++          adjustColdSST_diag(i,j,bi,bj) = 0. _d 0
++# ifdef ALLOW_SALT_PLUME
+           saltPlumeDepth(i,j,bi,bj) = 0. _d 0
+           saltPlumeFlux(i,j,bi,bj)  = 0. _d 0
+-         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
+@@ -319,37 +322,24 @@
+       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 ALLOW_SEAICE
++CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
++#  endif
++CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE snowHeight, Tsrf  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE sHeating,snowAge  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE hocemxl, icflxsw  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE salt,theta        = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE qnet,qsw, empmr   = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
+ #  ifdef NONLIN_FRSURF
+-CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE hFac_surfC        = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ # endif /* ALLOW_AUTODIFF_TAMC */
+ # ifdef ALLOW_DEBUG
+@@ -362,108 +352,47 @@
+         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
++# ifdef ALLOW_AUTODIFF_TAMC
++CADJ STORE qnet  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE qsw   = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte
+ #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
+-CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
++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 /* ALLOW_AUTODIFF_TAMC */
++#ifdef ALLOW_AUTODIFF_TAMC
++CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=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
++CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
++#  ifdef ALLOW_EXF
++CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uwind,vwind       = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+-#  ifdef SEAICE_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
++CADJ STORE hsalt             = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ #  ifdef ATMOSPHERIC_LOADING
+-CADJ STORE pload               = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
+-CADJ STORE siceload            = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE pload, siceload   = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ #  ifdef NONLIN_FRSURF
+-CADJ STORE recip_hfacc         = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE recip_hfacc       = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ #  ifdef ANNUAL_BALANCE
+-CADJ STORE balance_itcount     = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE balance_itcount   = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif /* ANNUAL_BALANCE */
+ #  ifdef ALLOW_THSICE
+-C-- store thSIce vars before advection (called from SEAICE_MODEL) update them:
+-CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
+-CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
+-CADJ STORE Qice1, Qice2  = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them:
++CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif /* ALLOW_THSICE */
+ # endif /* ALLOW_AUTODIFF_TAMC */
+ # ifdef ALLOW_DEBUG
+@@ -472,9 +401,22 @@
+         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_AUTODIFF_TAMC
++CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE heff  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE area  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uIce  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE vIce  = comlev1, key=ikey_dynamics, kind=isbyte
++# endif
+ # ifdef ALLOW_COST
+         CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
+ # endif
++# ifdef ALLOW_AUTODIFF
++      ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN
++CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte
++        CALL SEAICE_FAKE( myTime, myIter, myThid )
++# endif /* ALLOW_AUTODIFF */
+       ENDIF
+ #endif /* ALLOW_SEAICE */
+ 
+@@ -492,44 +434,13 @@
+ #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
++CADJ STORE sst, sss          = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE qsw               = comlev1, key=ikey_dynamics, kind=isbyte
+ # ifdef ALLOW_SEAICE
+-CADJ STORE area               = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE area              = comlev1, key=ikey_dynamics, 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
+@@ -540,10 +451,8 @@
+        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
++CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uvel, vvel        = comlev1, key=ikey_dynamics, kind=isbyte
+ #endif
+ C     compute temperature and (virtual) salt flux at the
+ C     shelf-ice ocean interface
+@@ -573,7 +482,7 @@
+ #ifdef ALLOW_SALT_PLUME
+       IF ( useSALT_PLUME ) THEN
+ Catn: exchanging saltPlumeFlux:
+-          CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
++        CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
+       ENDIF
+ #endif /* ALLOW_SALT_PLUME */
+ 
+@@ -580,8 +489,7 @@
+ C--   Freeze water at the surface
+       IF ( allowFreezing ) THEN
+ #ifdef ALLOW_AUTODIFF_TAMC
+-CADJ STORE theta = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE theta             = comlev1, key=ikey_dynamics, kind=isbyte
+ #endif
+         CALL FREEZE_SURFACE( myTime, myIter, myThid )
+       ENDIF
+@@ -594,8 +502,7 @@
+ 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
++CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
+ #else  /* ALLOW_AUTODIFF */
+ C--   if fluid is not water, by-pass surfaceForcing, find_rho, gmredi
+ C     and all vertical mixing schemes, but keep OBCS_CALC
+@@ -608,6 +515,18 @@
+      I             iMin, iMax, jMin, jMax,
+      I             myTime, myIter, myThid )
+ 
++#ifdef  ALLOW_OBCS
++      IF (useOBCS) THEN
++C--   After all surface fluxes are known apply balancing fluxes and
++C--   apply tidal forcing to open boundaries
++# ifdef ALLOW_DEBUG
++       IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid)
++# endif
++       CALL OBCS_ADJUST(
++     I      myTime+deltaTClock, myIter+1, myThid )
++      ENDIF
++#endif  /* ALLOW_OBCS */
++
+ #ifdef ALLOW_AUTODIFF_TAMC
+ C--   HPF directive to help TAMC
+ CHPF$ INDEPENDENT
+@@ -644,11 +563,13 @@
+            sigmaX(i,j,k) = 0. _d 0
+            sigmaY(i,j,k) = 0. _d 0
+            sigmaR(i,j,k) = 0. _d 0
++#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
++           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
++#endif
+           ENDDO
+          ENDDO
+         ENDDO
+ 
+-#ifdef ALLOW_AUTODIFF
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+           rhoKm1 (i,j)   = 0. _d 0
+@@ -655,6 +576,7 @@
+           rhoKp1 (i,j)   = 0. _d 0
+          ENDDO
+         ENDDO
++#ifdef ALLOW_AUTODIFF
+ cph all the following init. are necessary for TAF
+ cph although some of these are re-initialised later.
+         DO k=1,Nr
+@@ -696,10 +618,8 @@
+            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
+@@ -735,24 +655,19 @@
+ #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 theta(:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE salt (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE totphihyd(:,:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
+ # ifdef ALLOW_KPP
+-CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
+-CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ STORE uvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE vvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+ # endif
+ # ifdef ALLOW_SALT_PLUME
+-CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
+-CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ STORE saltplumedepth(:,:,bi,bj)
++CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE saltplumeflux(:,:,bi,bj)
++CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
+ # endif
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
+@@ -855,43 +770,53 @@
+      &         .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
++CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
++CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
++CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,kind=isbyte
+ #endif /* ALLOW_AUTODIFF_TAMC */
+-             CALL FIND_RHO_2D(
++             IF ( usingZCoords ) THEN
++              DO j=jMin,jMax
++               DO i=iMin,iMax
++                rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
++               ENDDO
++              ENDDO
++              CALL FIND_RHO_2D(
+      I                 iMin, iMax, jMin, jMax, k,
+      I                 theta(1-OLx,1-OLy,k-1,bi,bj),
+      I                 salt (1-OLx,1-OLy,k-1,bi,bj),
+      O                 rhoKm1,
+      I                 k-1, bi, bj, myThid )
++             ELSE
++              CALL FIND_RHO_2D(
++     I                 iMin, iMax, jMin, jMax, k-1,
++     I                 theta(1-OLx,1-OLy,k,bi,bj),
++     I                 salt (1-OLx,1-OLy,k,bi,bj),
++     O                 rhoKp1,
++     I                 k, bi, bj, myThid )
++              DO j=jMin,jMax
++               DO i=iMin,iMax
++                rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj)
++               ENDDO
++              ENDDO
++             ENDIF
+             ENDIF
+ #ifdef ALLOW_DEBUG
+             IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
+ #endif
+-cph Avoid variable aliasing for adjoint !!!
+-            DO j=jMin,jMax
+-             DO i=iMin,iMax
+-              rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
+-             ENDDO
+-            ENDDO
+             CALL GRAD_SIGMA(
+      I             bi, bj, iMin, iMax, jMin, jMax, k,
+      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
++
++#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
+             DO j=jMin,jMax
+              DO i=iMin,iMax
+               sigmaRfield(i,j,k,bi,bj)=sigmaR(i,j,k)
+              ENDDO
+             ENDDO
+-# endif
+-#endif /* ALLOW_ECCO */
++#endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */
++
+ #ifdef ALLOW_AUTODIFF
+ #ifdef GMREDI_WITH_STABLE_ADJOINT
+ cgf zero out adjoint fields to stabilize pkg/gmredi adjoint
+@@ -928,14 +853,13 @@
+ 
+ #ifdef ALLOW_AUTODIFF_TAMC
+ CADJ STORE IVDConvCount(:,:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ #endif
+ 
+ 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              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
+      I              bi, bj, myTime, myIter, myThid )
+         ENDIF
+ 
+@@ -942,7 +866,7 @@
+ #ifdef ALLOW_SALT_PLUME
+         IF ( useSALT_PLUME ) THEN
+           CALL SALT_PLUME_CALC_DEPTH(
+-     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
++     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
+      I              bi, bj, myTime, myIter, myThid )
+ #ifdef SALT_PLUME_VOLUME
+           CALL SALT_PLUME_VOLFRAC(
+@@ -949,11 +873,11 @@
+      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              1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
+      I              theta, 0,
+      I              myTime, myIter, myThid )
+           CALL SALT_PLUME_APPLY(
+-     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
++     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
+      I              salt, 0,
+      I              myTime, myIter, myThid )
+ C-- need to call this S/R from here to apply just before kpp
+@@ -977,20 +901,13 @@
+ #ifdef ALLOW_AUTODIFF_TAMC
+ cph needed for KPP
+ CADJ STORE surfaceForcingU(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE surfaceForcingV(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE surfaceForcingS(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE surfaceForcingT(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
+-CADJ STORE surfaceForcingTice(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
+ #ifdef  ALLOW_KPP
+@@ -1046,11 +963,11 @@
+ 
+ #ifdef  ALLOW_GGL90
+ #ifdef ALLOW_AUTODIFF_TAMC
+-CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ STORE GGL90TKE(:,:,:,bi,bj)
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ C--     Compute GGL90 mixing coefficients
+-        IF (useGGL90) THEN
++        IF ( useGGL90 .AND. Nr.GT.1 ) THEN
+ #ifdef ALLOW_DEBUG
+           IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
+ #endif
+@@ -1078,12 +995,9 @@
+ 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
++CADJ STORE sigmaX(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE sigmaY(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE sigmaR(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
+ # endif
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
+@@ -1165,6 +1079,11 @@
+       ENDIF
+ #endif /* ALLOW_KPP */
+ 
++#ifdef ALLOW_GGL90
++      IF ( useGGL90 )
++     &  CALL GGL90_EXCHANGES( myThid )
++#endif /* ALLOW_GGL90 */
++
+ #ifdef ALLOW_DIAGNOSTICS
+       IF ( fluidIsWater .AND. useDiagnostics ) THEN
+         CALL DIAGS_RHO_G(
+Index: ../trunk-jpl/test/MITgcm/code/eeboot_minimal.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code/eeboot_minimal.F	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code/eeboot_minimal.F	(revision 26544)
+@@ -39,6 +39,12 @@
+ C                   upper level driver (if there is one).
+       INTEGER myComm
+ 
++C     !FUNCTIONS:
++c     INTEGER  IFNBLNK
++c     EXTERNAL IFNBLNK
++      INTEGER  ILNBLNK
++      EXTERNAL ILNBLNK
++
+ C     !LOCAL VARIABLES:
+ C     == Local variables ==
+ C     myThid     :: Temp. dummy thread number.
+@@ -57,7 +63,9 @@
+       INTEGER mpiIsInitialized
+       LOGICAL doReport
+ #if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE)
+-      INTEGER mpiMyWid
++      INTEGER mpiMyWId
++#elif defined(ALLOW_NEST2W_COMMON)
++      INTEGER mpiMyWId
+ #endif
+ #ifdef ALLOW_CPL_ISSM
+       COMMON /CPL_MPI_ID/ mpiMyWid, toissmcomm
+@@ -66,11 +74,15 @@
+       INTEGER status(MPI_STATUS_SIZE)
+ #endif /* ALLOW_CPL_ISSM */
+ #if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
+-      INTEGER mpiMyWid, color
++      INTEGER mpiMyWId, color
+ #endif
+ #ifdef USE_PDAF
+       INTEGER mpi_task_id
++      CHARACTER*(14) fmtStr
++#else
++      CHARACTER*(6) fmtStr
+ #endif /* USE_PDAF */
++      INTEGER iTmp
+ #endif /* ALLOW_USE_MPI */
+ CEOP
+ 
+@@ -175,6 +187,17 @@
+        CALL NEST_EEINIT( mpiMyWId, color )
+ #endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
+ 
++#ifdef ALLOW_NEST2W_COMMON
++C--    Case with 2-Ways Nest(ing)
++C-     Set the running directory
++       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
++       CALL SETDIR( mpiMyWId )
++
++C-     Setup Nesting Execution Environment
++       CALL NEST2W_EEINIT( mpiMyWId )
++       IF ( eeBootError ) GOTO 999
++#endif /* ALLOW_NEST2W_COMMON */
++
+ #ifdef ALLOW_CPL_ISSM
+ C     add a 1rst preliminary call EESET_PARAMS to set useCoupler
+        CALL MPI_COMM_RANK(MPI_COMM_WORLD, mpiMyWid, mpiRC)
+@@ -215,11 +238,16 @@
+         GOTO 999
+        ENDIF
+        myProcId = mpiMyId
++       iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy))))
+ #ifdef USE_PDAF
+-       WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
++       WRITE(fmtStr,'(4(A,I1),A)')
++     &      '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')'
++       WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId
+ #else
+-       WRITE(myProcessStr,'(I4.4)') myProcId
++       WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')'
++       WRITE(myProcessStr,fmtStr) myProcId
+ #endif /* USE_PDAF */
++       iTmp = ILNBLNK( myProcessStr )
+        mpiPidIo = myProcId
+        pidIO    = mpiPidIo
+        IF ( mpiPidIo .EQ. myProcId ) THEN
+@@ -226,15 +254,9 @@
+ #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
++         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp)
+          OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
+-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
+-#ifdef USE_PDAF
+-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
+-#endif
++         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp)
+          OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
+ #ifdef SINGLE_DISK_IO
+         ELSE
+Index: ../trunk-jpl/test/MITgcm/code/packages.conf
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code/packages.conf	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code/packages.conf	(revision 26544)
+@@ -1,5 +1,6 @@
++#-- list of packages (or group of packages) to compile for this experiment:
+ gfd
+-timeave
++obcs
+ shelfice
+-obcs
+ diagnostics
++timeave
+Index: ../trunk-jpl/test/MITgcm/code_4003/STREAMICE_OPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/STREAMICE_OPTIONS.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/STREAMICE_OPTIONS.h	(nonexistent)
+@@ -1,32 +0,0 @@
+-C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
+-
+-C CPP options file for MYPACKAGE
+-C
+-C Use this file for selecting options within package "streamice"
+-
+-#ifndef STREAMICE_OPTIONS_H
+-#define STREAMICE_OPTIONS_H
+-#include "PACKAGES_CONFIG.h"
+-#ifdef ALLOW_STREAMICE
+-
+-#include "CPP_OPTIONS.h"
+-
+-C Place CPP define/undef flag here
+-
+-#define STREAMICE_CONSTRUCT_MATRIX
+-#define STREAMICE_HYBRID_STRESS
+-#define USE_ALT_RLOW
+-#define STREAMICE_GEOM_FILE_SETUP
+-!#define STREAMICE_SMOOTH_FLOATATION
+-!#define ALLOW_PETSC
+-#undef ALLOW_STREAMICE_2DTRACER
+-#undef STREAMICE_TRACER_AB
+-#undef STREAMICE_SERIAL_TRISOLVE
+-#define STREAMICE_FLOWLINE_BUTTRESS
+-
+-#endif /* ALLOW_MYPACKAGE */
+-#endif /* MYPACKAGE_OPTIONS_H */
+-
+-CEH3 ;;; Local Variables: ***
+-CEH3 ;;; mode:fortran ***
+-CEH3 ;;; End: ***
+Index: ../trunk-jpl/test/MITgcm/code_4003/CPP_EEOPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/CPP_EEOPTIONS.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/CPP_EEOPTIONS.h	(revision 26544)
+@@ -62,9 +62,6 @@
+ 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
+Index: ../trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 26544)
+@@ -53,6 +53,10 @@
+ C o Include/exclude phi_hyd calculation code
+ #define INCLUDE_PHIHYD_CALCULATION_CODE
+ 
++C o Include/exclude sound speed calculation code
++C o (Note that this is a diagnostic from Del Grasso algorithm, not derived from EOS)
++#undef INCLUDE_SOUNDSPEED_CALC_CODE
++
+ C-- Vertical mixing code options:
+ 
+ C o Include/exclude call to S/R CONVECT
+@@ -73,10 +77,14 @@
+ C   near surface & bottom for too thin grid-cell
+ #undef EXCLUDE_PCELL_MIX_CODE
+ 
++C o Exclude/allow to use isotropic 3-D Smagorinsky viscosity as diffusivity
++C   for tracers (after scaling by constant Prandtl number)
++#undef ALLOW_SMAG_3D_DIFFUSIVITY
++
+ C-- Time-stepping code options:
+ 
+ C o Include/exclude combined Surf.Pressure and Drag Implicit solver code
+-#undef ALLOW_SOLVE4_PS_AND_DRAG
++#define ALLOW_SOLVE4_PS_AND_DRAG
+ 
+ C o Include/exclude Implicit vertical advection code
+ #define INCLUDE_IMPLVERTADV_CODE
+@@ -84,6 +92,9 @@
+ C o Include/exclude AdamsBashforth-3rd-Order code
+ #undef ALLOW_ADAMSBASHFORTH_3
+ 
++C o Include/exclude Quasi-Hydrostatic Stagger Time-step AdamsBashforth code
++#undef ALLOW_QHYD_STAGGER_TS
++
+ C-- Model formulation options:
+ 
+ C o Allow/exclude "Exact Convervation" of fluid in Free-Surface formulation
+@@ -93,6 +104,9 @@
+ 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 Disable code for rStar coordinate and/or code for Sigma coordinate
++c#define DISABLE_RSTAR_CODE
++c#define DISABLE_SIGMA_CODE
+ 
+ C o Include/exclude nonHydrostatic code
+ #undef ALLOW_NONHYDROSTATIC
+@@ -102,25 +116,56 @@
+ 
+ C-- Algorithm options:
+ 
+-C o Use Non Self-Adjoint (NSA) conjugate-gradient solver
++C o Include/exclude code for 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
++#define ALLOW_SRCG
+ 
+ C o Choices for implicit solver routines solve_*diagonal.F
+ C   The following has low memory footprint, but not suitable for AD
+-#undef SOLVE_DIAGONAL_LOWMEMORY
++#define SOLVE_DIAGONAL_LOWMEMORY
+ C   The following one suitable for AD but does not vectorize
+ #undef SOLVE_DIAGONAL_KINNER
+ 
+ C-- Retired code options:
+ 
++C o ALLOW isotropic scaling of harmonic and bi-harmonic terms when
++C   using an locally isotropic spherical grid with (dlambda) x (dphi*cos(phi))
++C *only for use on a lat-lon grid*
++C   Setting this flag here affects both momentum and tracer equation unless
++C   it is set/unset again in other header fields (e.g., GAD_OPTIONS.h).
++C   The definition of the flag is commented to avoid interference with
++C   such other header files.
++C   The preferred method is specifying a value for viscAhGrid or viscA4Grid
++C   in data which is then automatically scaled by the grid size;
++C   the old method of specifying viscAh/viscA4 and this flag is provided
++C   for completeness only (and for use with the adjoint).
++c#define ISOTROPIC_COS_SCALING
++
++C o This flag selects the form of COSINE(lat) scaling of bi-harmonic term.
++C *only for use on a lat-lon grid*
++C   Has no effect if ISOTROPIC_COS_SCALING is undefined.
++C   Has no effect on vector invariant momentum equations.
++C   Setting this flag here affects both momentum and tracer equation unless
++C   it is set/unset again in other header fields (e.g., GAD_OPTIONS.h).
++C   The definition of the flag is commented to avoid interference with
++C   such other header files.
++c#define COSINEMETH_III
++
++C o Use "OLD" UV discretisation near boundaries (*not* recommended)
++C   Note - only works with pkg/mom_fluxform and "no_slip_sides=.FALSE."
++C          because the old code did not have no-slip BCs
++#undef OLD_ADV_BCS
++
+ 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 o Use old EXTERNAL_FORCING_U,V,T,S subroutines (for backward compatibility)
++#undef USE_OLD_EXTERNAL_FORCING
++
+ C-- Other option files:
+ 
+ C o Execution environment support options
+Index: ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26544)
+@@ -22,6 +22,7 @@
+       PARAMETER( nRegions = 2 , sizRegMsk = 1 , nStats = 4 )
+       PARAMETER( diagSt_size = 10*Nr )
+ 
++
+ CEH3 ;;; Local Variables: ***
+ CEH3 ;;; mode:fortran ***
+ CEH3 ;;; End: ***
+Index: ../trunk-jpl/test/MITgcm/code_4003/DIAG_OPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/DIAG_OPTIONS.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/DIAG_OPTIONS.h	(revision 26544)
+@@ -1,15 +1,14 @@
+ #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
++#ifdef ALLOW_DIAGNOSTICS
++C     Package-specific Options & Macros go here
+ 
+ C allow to define specific regions and the corresponding mask ;
+ C  used to perform regional statistics over a limited area
+-#undef DIAGSTATS_REGION_MASK
++#define DIAGSTATS_REGION_MASK
+ 
+ C allow to stop & restart at any time (i.e. not at a multiple of
+ C  the diagnostics frequency) reading diagnostics storage arrays
+@@ -18,14 +17,9 @@
+ 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: ../trunk-jpl/test/MITgcm/code_4003/OBCS_OPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/OBCS_OPTIONS.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/OBCS_OPTIONS.h	(revision 26544)
+@@ -1,8 +1,5 @@
+ 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
+@@ -10,6 +7,7 @@
+ #include "CPP_OPTIONS.h"
+ 
+ #ifdef ALLOW_OBCS
++C Package-specific Options & Macros go here
+ 
+ C Enable individual open boundaries
+ #define ALLOW_OBCS_NORTH
+@@ -24,13 +22,29 @@
+ C from a file
+ #define ALLOW_OBCS_PRESCRIBE
+ 
+-C This includes hooks to sponge layer treatment of uvel, vvel
++C Enable OB conditions following Stevens (1990)
++#undef ALLOW_OBCS_STEVENS
++
++C Allow sponge layer treatment of open boundary conditions
+ #define ALLOW_OBCS_SPONGE
+ 
++C Include hooks to sponge layer treatment of pkg/seaice variables
++#undef ALLOW_OBCS_SEAICE_SPONGE
++
+ C balance barotropic velocity
+-C KS16 turn this on
+ #define ALLOW_OBCS_BALANCE
+ 
++C add tidal contributions to normal OB flow
++C NOTE that at the moment tidal forcing is applied
++C only to "normal" flow.
++#undef ALLOW_OBCS_TIDES
++
++C Use older implementation of obcs in seaice-dynamics
++C note: most of the "experimental" options listed below have not yet
++C       been implementated in new version.
++#undef OBCS_UVICE_OLD
++
++#ifdef OBCS_UVICE_OLD
+ C     The following five CPP options are experimental and aim to deal
+ C     with artifacts due to the low-frequency specification of sea-ice
+ C     boundary conditions compared to the model forcing frequency.
+@@ -45,11 +59,12 @@
+ C     Smooth the component of sea ice velocity parallel to the edge.
+ #undef OBCS_SEAICE_SMOOTH_UVICE_PAR
+ 
++C     Compute rather than specify seaice velocities at the edges.
++#undef OBCS_SEAICE_COMPUTE_UVICE
++#endif /* OBCS_UVICE_OLD */
++
+ C     Smooth the tracer sea-ice variables near the edges.
+ #undef OBCS_SEAICE_SMOOTH_EDGE
+ 
+-C     Compute rather than specify seaice velocities at the edges.
+-#undef OBCS_SEAICE_COMPUTE_UVICE
+-
+ #endif /* ALLOW_OBCS */
+ #endif /* OBCS_OPTIONS_H */
+Index: ../trunk-jpl/test/MITgcm/code_4003/do_oceanic_phys.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/do_oceanic_phys.F	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/do_oceanic_phys.F	(revision 26544)
+@@ -1,5 +1,8 @@
+ #include "PACKAGES_CONFIG.h"
+ #include "CPP_OPTIONS.h"
++#ifdef ALLOW_MOM_COMMON
++# include "MOM_COMMON_OPTIONS.h"
++#endif
+ #ifdef ALLOW_AUTODIFF
+ # include "AUTODIFF_OPTIONS.h"
+ #endif
+@@ -72,6 +75,8 @@
+ C       |
+ C       |-- EXTERNAL_FORCING_SURF
+ C       |
++C       |-- OBCS_ADJUST
++C       |
+ C       |- k loop (Nr:1):
+ C       | - DWNSLP_CALC_RHO
+ C       | - BBL_CALC_RHO
+@@ -119,6 +124,8 @@
+ C       |
+ C       |-- KPP_DO_EXCH
+ C       |
++C       |-- GGL90_EXCHANGES
++C       |
+ C       |-- DIAGS_RHO_G
+ C       |-- DIAGS_OCEANIC_SURF_FLUX
+ C       |-- SALT_PLUME_DIAGNOSTICS_FILL
+@@ -142,8 +149,9 @@
+ 
+ #ifdef ALLOW_AUTODIFF
+ # include "AUTODIFF_MYFIELDS.h"
+-# include "tamc.h"
+-# include "tamc_keys.h"
++# ifdef ALLOW_AUTODIFF_TAMC
++#  include "tamc.h"
++# endif
+ # include "FFIELDS.h"
+ # include "SURFACE.h"
+ # include "EOS.h"
+@@ -195,12 +203,13 @@
+ 
+ C     !LOCAL VARIABLES:
+ C     == Local variables
+-C     rhoK, rhoKm1  :: Density at current level, and level above
++C     rhoKp1,rhoKm1 :: Density at current level, and @ level minus one
+ C     iMin, iMax    :: Ranges and sub-block indices on which calculations
+ C     jMin, jMax       are applied.
+ C     bi, bj        :: tile indices
+ C     msgBuf        :: Temp. for building output string
+ C     i,j,k         :: loop indices
++C     kSrf          :: surface index
+       _RL rhoKp1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+       _RL rhoKm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+       _RL sigmaX  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
+@@ -209,7 +218,7 @@
+       INTEGER iMin, iMax
+       INTEGER jMin, jMax
+       INTEGER bi, bj
+-      INTEGER i, j, k
++      INTEGER i, j, k, kSrf
+       CHARACTER*(MAX_LEN_MBUF) msgBuf
+       INTEGER doDiagsRho
+       LOGICAL calcGMRedi, calcKPP, calcConvect
+@@ -220,6 +229,11 @@
+ #ifdef ALLOW_AUTODIFF
+       _RL thetaRef
+ #endif /* ALLOW_AUTODIFF */
++#ifdef ALLOW_AUTODIFF_TAMC
++      INTEGER act1, act2, act3, act4
++      INTEGER max1, max2, max3
++      INTEGER kkey, itdkey
++#endif
+ CEOP
+ 
+ #ifdef ALLOW_AUTODIFF_TAMC
+@@ -227,6 +241,9 @@
+       itdkey = 1
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
++      kSrf = 1
++      IF ( usingPCoords ) kSrf = Nr
++
+ #ifdef ALLOW_DEBUG
+       IF (debugMode) CALL DEBUG_ENTER('DO_OCEANIC_PHYS',myThid)
+ #endif
+@@ -281,33 +298,19 @@
+ #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
++          adjustColdSST_diag(i,j,bi,bj) = 0. _d 0
++# ifdef ALLOW_SALT_PLUME
+           saltPlumeDepth(i,j,bi,bj) = 0. _d 0
+           saltPlumeFlux(i,j,bi,bj)  = 0. _d 0
+-         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
+@@ -319,37 +322,24 @@
+       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 ALLOW_SEAICE
++CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
++#  endif
++CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE snowHeight, Tsrf  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE sHeating,snowAge  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE hocemxl, icflxsw  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE salt,theta        = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE qnet,qsw, empmr   = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
+ #  ifdef NONLIN_FRSURF
+-CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE hFac_surfC        = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ # endif /* ALLOW_AUTODIFF_TAMC */
+ # ifdef ALLOW_DEBUG
+@@ -362,108 +352,47 @@
+         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
++# ifdef ALLOW_AUTODIFF_TAMC
++CADJ STORE qnet  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE qsw   = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte
+ #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
+-CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
++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 /* ALLOW_AUTODIFF_TAMC */
++#ifdef ALLOW_AUTODIFF_TAMC
++CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=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
++CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
++#  ifdef ALLOW_EXF
++CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uwind,vwind       = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+-#  ifdef SEAICE_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
++CADJ STORE hsalt             = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ #  ifdef ATMOSPHERIC_LOADING
+-CADJ STORE pload               = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
+-CADJ STORE siceload            = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE pload, siceload   = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ #  ifdef NONLIN_FRSURF
+-CADJ STORE recip_hfacc         = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE recip_hfacc       = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif
+ #  ifdef ANNUAL_BALANCE
+-CADJ STORE balance_itcount     = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE balance_itcount   = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif /* ANNUAL_BALANCE */
+ #  ifdef ALLOW_THSICE
+-C-- store thSIce vars before advection (called from SEAICE_MODEL) update them:
+-CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
+-CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
+-CADJ STORE Qice1, Qice2  = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them:
++CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
+ #  endif /* ALLOW_THSICE */
+ # endif /* ALLOW_AUTODIFF_TAMC */
+ # ifdef ALLOW_DEBUG
+@@ -472,9 +401,22 @@
+         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_AUTODIFF_TAMC
++CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE heff  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE area  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uIce  = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE vIce  = comlev1, key=ikey_dynamics, kind=isbyte
++# endif
+ # ifdef ALLOW_COST
+         CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
+ # endif
++# ifdef ALLOW_AUTODIFF
++      ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN
++CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte
++        CALL SEAICE_FAKE( myTime, myIter, myThid )
++# endif /* ALLOW_AUTODIFF */
+       ENDIF
+ #endif /* ALLOW_SEAICE */
+ 
+@@ -492,44 +434,13 @@
+ #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
++CADJ STORE sst, sss          = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE qsw               = comlev1, key=ikey_dynamics, kind=isbyte
+ # ifdef ALLOW_SEAICE
+-CADJ STORE area               = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE area              = comlev1, key=ikey_dynamics, 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
+@@ -540,10 +451,8 @@
+        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
++CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
++CADJ STORE uvel, vvel        = comlev1, key=ikey_dynamics, kind=isbyte
+ #endif
+ C     compute temperature and (virtual) salt flux at the
+ C     shelf-ice ocean interface
+@@ -573,7 +482,7 @@
+ #ifdef ALLOW_SALT_PLUME
+       IF ( useSALT_PLUME ) THEN
+ Catn: exchanging saltPlumeFlux:
+-          CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
++        CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
+       ENDIF
+ #endif /* ALLOW_SALT_PLUME */
+ 
+@@ -580,8 +489,7 @@
+ C--   Freeze water at the surface
+       IF ( allowFreezing ) THEN
+ #ifdef ALLOW_AUTODIFF_TAMC
+-CADJ STORE theta = comlev1, key = ikey_dynamics,
+-CADJ &     kind = isbyte
++CADJ STORE theta             = comlev1, key=ikey_dynamics, kind=isbyte
+ #endif
+         CALL FREEZE_SURFACE( myTime, myIter, myThid )
+       ENDIF
+@@ -594,8 +502,7 @@
+ 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
++CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
+ #else  /* ALLOW_AUTODIFF */
+ C--   if fluid is not water, by-pass surfaceForcing, find_rho, gmredi
+ C     and all vertical mixing schemes, but keep OBCS_CALC
+@@ -608,6 +515,18 @@
+      I             iMin, iMax, jMin, jMax,
+      I             myTime, myIter, myThid )
+ 
++#ifdef  ALLOW_OBCS
++      IF (useOBCS) THEN
++C--   After all surface fluxes are known apply balancing fluxes and
++C--   apply tidal forcing to open boundaries
++# ifdef ALLOW_DEBUG
++       IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid)
++# endif
++       CALL OBCS_ADJUST(
++     I      myTime+deltaTClock, myIter+1, myThid )
++      ENDIF
++#endif  /* ALLOW_OBCS */
++
+ #ifdef ALLOW_AUTODIFF_TAMC
+ C--   HPF directive to help TAMC
+ CHPF$ INDEPENDENT
+@@ -644,11 +563,13 @@
+            sigmaX(i,j,k) = 0. _d 0
+            sigmaY(i,j,k) = 0. _d 0
+            sigmaR(i,j,k) = 0. _d 0
++#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
++           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
++#endif
+           ENDDO
+          ENDDO
+         ENDDO
+ 
+-#ifdef ALLOW_AUTODIFF
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+           rhoKm1 (i,j)   = 0. _d 0
+@@ -655,6 +576,7 @@
+           rhoKp1 (i,j)   = 0. _d 0
+          ENDDO
+         ENDDO
++#ifdef ALLOW_AUTODIFF
+ cph all the following init. are necessary for TAF
+ cph although some of these are re-initialised later.
+         DO k=1,Nr
+@@ -696,10 +618,8 @@
+            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
+@@ -735,24 +655,19 @@
+ #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 theta(:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE salt (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE totphihyd(:,:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
+ # ifdef ALLOW_KPP
+-CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
+-CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ STORE uvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE vvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
+ # endif
+ # ifdef ALLOW_SALT_PLUME
+-CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
+-CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ STORE saltplumedepth(:,:,bi,bj)
++CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE saltplumeflux(:,:,bi,bj)
++CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
+ # endif
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
+@@ -855,43 +770,53 @@
+      &         .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
++CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
++CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
++CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,kind=isbyte
+ #endif /* ALLOW_AUTODIFF_TAMC */
+-             CALL FIND_RHO_2D(
++             IF ( usingZCoords ) THEN
++              DO j=jMin,jMax
++               DO i=iMin,iMax
++                rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
++               ENDDO
++              ENDDO
++              CALL FIND_RHO_2D(
+      I                 iMin, iMax, jMin, jMax, k,
+      I                 theta(1-OLx,1-OLy,k-1,bi,bj),
+      I                 salt (1-OLx,1-OLy,k-1,bi,bj),
+      O                 rhoKm1,
+      I                 k-1, bi, bj, myThid )
++             ELSE
++              CALL FIND_RHO_2D(
++     I                 iMin, iMax, jMin, jMax, k-1,
++     I                 theta(1-OLx,1-OLy,k,bi,bj),
++     I                 salt (1-OLx,1-OLy,k,bi,bj),
++     O                 rhoKp1,
++     I                 k, bi, bj, myThid )
++              DO j=jMin,jMax
++               DO i=iMin,iMax
++                rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj)
++               ENDDO
++              ENDDO
++             ENDIF
+             ENDIF
+ #ifdef ALLOW_DEBUG
+             IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
+ #endif
+-cph Avoid variable aliasing for adjoint !!!
+-            DO j=jMin,jMax
+-             DO i=iMin,iMax
+-              rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
+-             ENDDO
+-            ENDDO
+             CALL GRAD_SIGMA(
+      I             bi, bj, iMin, iMax, jMin, jMax, k,
+      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
++
++#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
+             DO j=jMin,jMax
+              DO i=iMin,iMax
+               sigmaRfield(i,j,k,bi,bj)=sigmaR(i,j,k)
+              ENDDO
+             ENDDO
+-# endif
+-#endif /* ALLOW_ECCO */
++#endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */
++
+ #ifdef ALLOW_AUTODIFF
+ #ifdef GMREDI_WITH_STABLE_ADJOINT
+ cgf zero out adjoint fields to stabilize pkg/gmredi adjoint
+@@ -928,14 +853,13 @@
+ 
+ #ifdef ALLOW_AUTODIFF_TAMC
+ CADJ STORE IVDConvCount(:,:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ #endif
+ 
+ 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              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
+      I              bi, bj, myTime, myIter, myThid )
+         ENDIF
+ 
+@@ -942,7 +866,7 @@
+ #ifdef ALLOW_SALT_PLUME
+         IF ( useSALT_PLUME ) THEN
+           CALL SALT_PLUME_CALC_DEPTH(
+-     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
++     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
+      I              bi, bj, myTime, myIter, myThid )
+ #ifdef SALT_PLUME_VOLUME
+           CALL SALT_PLUME_VOLFRAC(
+@@ -949,11 +873,11 @@
+      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              1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
+      I              theta, 0,
+      I              myTime, myIter, myThid )
+           CALL SALT_PLUME_APPLY(
+-     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
++     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
+      I              salt, 0,
+      I              myTime, myIter, myThid )
+ C-- need to call this S/R from here to apply just before kpp
+@@ -977,20 +901,13 @@
+ #ifdef ALLOW_AUTODIFF_TAMC
+ cph needed for KPP
+ CADJ STORE surfaceForcingU(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE surfaceForcingV(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE surfaceForcingS(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ CADJ STORE surfaceForcingT(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
+-CADJ STORE surfaceForcingTice(:,:,bi,bj)
+-CADJ &     = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
+ #ifdef  ALLOW_KPP
+@@ -1046,11 +963,11 @@
+ 
+ #ifdef  ALLOW_GGL90
+ #ifdef ALLOW_AUTODIFF_TAMC
+-CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+-CADJ &     kind = isbyte
++CADJ STORE GGL90TKE(:,:,:,bi,bj)
++CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ C--     Compute GGL90 mixing coefficients
+-        IF (useGGL90) THEN
++        IF ( useGGL90 .AND. Nr.GT.1 ) THEN
+ #ifdef ALLOW_DEBUG
+           IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
+ #endif
+@@ -1078,12 +995,9 @@
+ 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
++CADJ STORE sigmaX(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE sigmaY(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
++CADJ STORE sigmaR(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
+ # endif
+ #endif /* ALLOW_AUTODIFF_TAMC */
+ 
+@@ -1165,6 +1079,11 @@
+       ENDIF
+ #endif /* ALLOW_KPP */
+ 
++#ifdef ALLOW_GGL90
++      IF ( useGGL90 )
++     &  CALL GGL90_EXCHANGES( myThid )
++#endif /* ALLOW_GGL90 */
++
+ #ifdef ALLOW_DIAGNOSTICS
+       IF ( fluidIsWater .AND. useDiagnostics ) THEN
+         CALL DIAGS_RHO_G(
+Index: ../trunk-jpl/test/MITgcm/code_4003/eeboot_minimal.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/eeboot_minimal.F	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/eeboot_minimal.F	(revision 26544)
+@@ -39,6 +39,12 @@
+ C                   upper level driver (if there is one).
+       INTEGER myComm
+ 
++C     !FUNCTIONS:
++c     INTEGER  IFNBLNK
++c     EXTERNAL IFNBLNK
++      INTEGER  ILNBLNK
++      EXTERNAL ILNBLNK
++
+ C     !LOCAL VARIABLES:
+ C     == Local variables ==
+ C     myThid     :: Temp. dummy thread number.
+@@ -57,7 +63,9 @@
+       INTEGER mpiIsInitialized
+       LOGICAL doReport
+ #if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE)
+-      INTEGER mpiMyWid
++      INTEGER mpiMyWId
++#elif defined(ALLOW_NEST2W_COMMON)
++      INTEGER mpiMyWId
+ #endif
+ #ifdef ALLOW_CPL_ISSM
+       COMMON /CPL_MPI_ID/ mpiMyWid, toissmcomm
+@@ -66,11 +74,15 @@
+       INTEGER status(MPI_STATUS_SIZE)
+ #endif /* ALLOW_CPL_ISSM */
+ #if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
+-      INTEGER mpiMyWid, color
++      INTEGER mpiMyWId, color
+ #endif
+ #ifdef USE_PDAF
+       INTEGER mpi_task_id
++      CHARACTER*(14) fmtStr
++#else
++      CHARACTER*(6) fmtStr
+ #endif /* USE_PDAF */
++      INTEGER iTmp
+ #endif /* ALLOW_USE_MPI */
+ CEOP
+ 
+@@ -175,6 +187,17 @@
+        CALL NEST_EEINIT( mpiMyWId, color )
+ #endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
+ 
++#ifdef ALLOW_NEST2W_COMMON
++C--    Case with 2-Ways Nest(ing)
++C-     Set the running directory
++       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
++       CALL SETDIR( mpiMyWId )
++
++C-     Setup Nesting Execution Environment
++       CALL NEST2W_EEINIT( mpiMyWId )
++       IF ( eeBootError ) GOTO 999
++#endif /* ALLOW_NEST2W_COMMON */
++
+ #ifdef ALLOW_CPL_ISSM
+ C     add a 1rst preliminary call EESET_PARAMS to set useCoupler
+        CALL MPI_COMM_RANK(MPI_COMM_WORLD, mpiMyWid, mpiRC)
+@@ -215,11 +238,16 @@
+         GOTO 999
+        ENDIF
+        myProcId = mpiMyId
++       iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy))))
+ #ifdef USE_PDAF
+-       WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
++       WRITE(fmtStr,'(4(A,I1),A)')
++     &      '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')'
++       WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId
+ #else
+-       WRITE(myProcessStr,'(I4.4)') myProcId
++       WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')'
++       WRITE(myProcessStr,fmtStr) myProcId
+ #endif /* USE_PDAF */
++       iTmp = ILNBLNK( myProcessStr )
+        mpiPidIo = myProcId
+        pidIO    = mpiPidIo
+        IF ( mpiPidIo .EQ. myProcId ) THEN
+@@ -226,15 +254,9 @@
+ #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
++         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp)
+          OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
+-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
+-#ifdef USE_PDAF
+-         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
+-#endif
++         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp)
+          OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
+ #ifdef SINGLE_DISK_IO
+         ELSE
+Index: ../trunk-jpl/test/MITgcm/code_4003/packages.conf
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/packages.conf	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/packages.conf	(revision 26544)
+@@ -1,4 +1,5 @@
++#-- list of packages (or group of packages) to compile for this experiment:
+ gfd
++obcs
+ shelfice
+-obcs
+ diagnostics
+Index: ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F	(revision 26544)
+@@ -44,8 +44,10 @@
+ C !LOCAL VARIABLES : ====================================================
+ C     i,j, bi,bj  :: loop indices
+       INTEGER bi,bj,i,j
++#ifdef ALLOW_CPL_ISSM
+       _RL  issm_density
+       issm_density = 917.
++#endif /* ALLOW_CPL_ISSM */
+ 
+       IF ( SHELFICEMassStepping ) THEN
+ 
+Index: ../trunk-jpl/test/MITgcm/code_4003/SIZE.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26543)
++++ ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26544)
+@@ -42,12 +42,12 @@
+       INTEGER Ny
+       INTEGER Nr
+       PARAMETER (
+-     &           sNx =  3,
+-     &           sNy =  200,
++     &           sNx =   1,
++     &           sNy =  50,
+      &           OLx =   3,
+      &           OLy =   3,
+      &           nSx =   1,
+-     &           nSy =   1,
++     &           nSy =   4,
+      &           nPx =   1,
+      &           nPy =   1,
+      &           Nx  = sNx*nSx*nPx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26544-26545.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26544-26545.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26544-26545.diff	(revision 26740)
@@ -0,0 +1,528 @@
+Index: ../trunk-jpl/test/MITgcm/code_4003/SIZE.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26544)
++++ ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26545)
+@@ -47,9 +47,9 @@
+      &           OLx =   3,
+      &           OLy =   3,
+      &           nSx =   1,
+-     &           nSy =   4,
++     &           nSy =   1,
+      &           nPx =   1,
+-     &           nPy =   1,
++     &           nPy =   4,
+      &           Nx  = sNx*nSx*nPx,
+      &           Ny  = sNy*nSy*nPy,
+      &           Nr  =  90)
+@@ -62,6 +62,3 @@
+       PARAMETER ( MAX_OLX = OLx,
+      &            MAX_OLY = OLy )
+ 
+-      INTEGER nobcs
+-      PARAMETER ( nobcs = 4 )
+-
+Index: ../trunk-jpl/test/MITgcm/input_4003/data
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data	(revision 26544)
++++ ../trunk-jpl/test/MITgcm/input_4003/data	(revision 26545)
+@@ -1,70 +1,55 @@
+-#:::====================
++# ====================
+ # | Model parameters |
+ # ====================
+ #
+ # Continuous equation parameters
+  &PARM01
+-# momstepping=.FALSE.,
+-# tempstepping=.FALSE.,
+-# saltstepping=.FALSE.,
+- Tref = 90*-1.9,
+- Sref = 90*34.4,
++ tRef = 90*-1.9,
++ sRef = 90*34.4,
++ eosType='JMD95Z',
++ HeatCapacity_Cp = 3974.0,
++ rhoConst=1030.,
++ gravity=9.81,
+  viscAr=1.E-3,
+-#viscAh=600.0,
+- viscAhGrid=0.2,
+- viscA4Grid=0.02,
++ viscAh= 300.,
+  no_slip_sides=.FALSE.,
+  no_slip_bottom=.FALSE.,
+- diffKhT= 100.0,
+-#diffKhT= 600.0,
++ diffKhT= 10.,
+  diffKrT=5.E-5,
+- diffKhS= 100.0,
+-#diffKhS= 600.0,
++ diffKhS= 10.,
+  diffKrS=5.E-5,
+  bottomDragQuadratic=2.5E-3,
+- staggerTimestep = .true.,
+- tempAdvScheme=30,
+- saltAdvScheme=30,
+- vectorInvariantMomentum = .true.,
+-### momImplVertAdv=.true.,
+- tempImplVertAdv=.true.,
+- saltImplVertAdv=.true.,
+- eosType='JMD95Z',
+-#tAlpha = 2.E-4,
+-#sBeta  = 7.4E-4,
+- HeatCapacity_cp = 3974.0,
+- rhoConst=1000.,
+- rhoNil=1000.,
+- gravity=9.81,
+- gBaro=9.81,
+- implicitDiffusion = .true.,
+- implicitViscosity = .true.,
+- rigidLid=.FALSE.,
++ staggerTimestep = .TRUE.,
++ tempAdvScheme=77,
++ saltAdvScheme=77,
++ vectorInvariantMomentum = .TRUE.,
++# momImplVertAdv=.TRUE.,
++#tempImplVertAdv=.TRUE.,
++#saltImplVertAdv=.TRUE.,
++ implicitDiffusion = .TRUE.,
++ implicitViscosity = .TRUE.,
++ selectImplicitDrag = 2,
+  implicitFreeSurface=.TRUE.,
+- useRealFreshWaterFlux = .true.,
++ useRealFreshWaterFlux = .TRUE.,
+  exactConserv=.TRUE.,
+-# start nlfs with rstar
+-#select_rStar=2,
++# start NLFS (without rstar)
+  nonlinFreeSurf=4,
+- hFacInf=0.2,
++ hFacInf=0.05,
+  hFacSup=2.0,
+-# end nlfs with rstar
+- hFacMin=0.2,
++# end NLFS
++ hFacMin=0.10,
+ #integr_GeoPot = 1,
+-#ivdc_kappa = 0.005.,
+-#implicitDiffusion=.true.,
+-#implicitViscosity=.true.,
+-#useCDscheme=.true.,
+-#nonHydrostatic=.true.,
+-#allowFreezing = .true.,
++ ivdc_kappa = 1.,
++ useJamartWetPoints=.TRUE.,
++ selectBotDragQuadr=1,
++#bottomVisc_pCell=.TRUE.,
++#-
+  readBinaryPrec=64,
+-#writeBinaryPrec=64,
+- debuglevel = 5,
+- selectCoriMap = 0,
+- f0 = 0.0,
++ writeBinaryPrec=64,
+  useSingleCpuIO=.TRUE.,
+- globalFiles=.TRUE.,
+- useCoriolis=.TRUE.,
++#globalFiles=.TRUE.,
++ debuglevel = 2,
++ plotLevel = 0,
+  &
+ 
+ # Elliptic solver parameters
+@@ -71,63 +56,54 @@
+  &PARM02
+  cg2dMaxIters=300,
+  cg2dTargetResidual=1.E-11,
+-# cg2dMinColumnEps = 1.
+-# pReleaseVisc = 1.
+-#cg3dMaxIters=40,
+-#cg3dTargetResidual=1.E-13,
++#printResidualFreq=100,
+  &
+ 
+ #Time stepping parameters
+  &PARM03
+- niter0=11395,
+- nTimeSteps=1440,
+-# nTimeSteps=20,
+-# startTime=0.,
+-# startTime = 0.,
+-#startTime=62208000.,
+-#startTime=15552000.,
+-#endTime=31104000.,
+-#endTime=86400.,
+-# deltaT=300.0,
+- deltaT=60.0,
+-### deltaT=1200.0,
+- forcing_In_AB  = .false.,
+-#rCD = 0.9896,
++#nIter0=2880,
++#nTimeSteps=288,
++#startTime=0.,
++#endTime=2592000.,
++ deltaT=300.0,
++ forcing_In_AB  = .FALSE.,
+  abEps=0.1,
+- cAdjFreq = -1.,
+- pChkptFreq=3000,
+- chkptFreq=3000.0,
+-# pChkptFreq=600.0,
+-# chkptFreq=600.0,
+- dumpFreq=3000,
+-# monitorFreq=15552000.,
+-# monitorSelect=0,
+- monitorFreq=60.,
++ pChkptFreq= 2592000.,
++ chkptFreq = 2592000.,
++ dumpFreq =  86400.,
++ monitorFreq= 7200.,
++ monitorSelect=1,
++ monitorFreq=1800.,
++ dumpFreq = 10800.,
++#- for testing purpose:
++ nIter0=2898,
++ nTimeSteps=20,
++#dumpFreq = 1200.,
++ monitorFreq=1.,
+  &
+ 
+ # Gridding parameters
+  &PARM04
+- useMin4hFacEdges=.TRUE.,
+  usingCartesianGrid=.FALSE.,
+  usingSphericalPolarGrid=.TRUE.,
+-#delR = 10., 10., 10., 10., 10., 10., 10., 10.01, 10.03, 10.11,
+-#10.32, 10.8, 11.76, 13.42, 16.04, 19.82, 24.85, 31.1, 38.42, 46.5,
+-#55., 63.5, 71.58, 78.9, 85.15, 90.18, 93.96, 96.58, 98.25, 99.25,
+-#100.01, 101.33, 104.56, 111.33, 122.83, 139.09, 158.94, 180.83, 203.55, 226.5,
+-#249.5, 272.5, 295.5, 318.5, 341.5, 364.5, 387.5, 410.5, 433.5, 456.5,
+  delR=90*10.,
+- delX=3*.125,
++ delX=1*.125,
+  delY=200*.0078125,
+-# delYFile='dlat.bin',
+-# delY=30*10e3,
+- xgOrigin = -105.5,
+- ygOrigin =  -75.4457,
++ xgOrigin = 0.,
++ ygOrigin = -75.5,
++ pCellMix_select=20,
++ pcellMix_delR = 10.,
++#interViscAr_pCell = .TRUE.,
++#interDiffKr_pCell = .TRUE.,
++ pCellMix_viscAr = 90*1.E-3,
++ pCellMix_diffKr = 90*1.E-4,
++# current default: diffKzT=5.E-5, viscAz=1.E-3,
+  &
+ 
+ # Input datasets
+  &PARM05
+- bathyFile='bathy.box',
+- hydrogThetaFile='theta.init',	
+- hydrogSaltFile='salt.init',
+- pSurfInitFile='etainit.round.bin',
++ bathyFile='bathy_flat.bin',
++ hydrogThetaFile='temp_ini.bin',	
++ hydrogSaltFile ='salt_ini.bin',
++# pSurfInitFile ='etai_ini.bin'
+  &
+Index: ../trunk-jpl/test/MITgcm/input_4003/data.shelfice
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data.shelfice	(revision 26544)
++++ ../trunk-jpl/test/MITgcm/input_4003/data.shelfice	(revision 26545)
+@@ -15,6 +15,8 @@
+  SHELFICEsplitThreshold = 1.12,
+  SHELFICEmergeThreshold = 0.10,
+ #--
+- SHELFICEtopoFile='icetopo.bin',
+- SHELFICEwriteState = .TRUE.,
++ SHELFICEtopoFile='shelficeTopo.Lin.bin',
++ SHELFICEmassFile='shelficeMass.Lin.bin',
++ SHELFICEMassDynTendFile='shelfice_dMdt.r02.bin',
++#SHELFICEwriteState = .TRUE.,
+  &
+Index: ../trunk-jpl/test/MITgcm/input_4003/data_uncoupled
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data_uncoupled	(revision 26544)
++++ ../trunk-jpl/test/MITgcm/input_4003/data_uncoupled	(revision 26545)
+@@ -1,70 +1,55 @@
+-#:::====================
++# ====================
+ # | Model parameters |
+ # ====================
+ #
+ # Continuous equation parameters
+  &PARM01
+-# momstepping=.FALSE.,
+-# tempstepping=.FALSE.,
+-# saltstepping=.FALSE.,
+- Tref = 90*-1.9,
+- Sref = 90*34.4,
++ tRef = 90*-1.9,
++ sRef = 90*34.4,
++ eosType='JMD95Z',
++ HeatCapacity_Cp = 3974.0,
++ rhoConst=1030.,
++ gravity=9.81,
+  viscAr=1.E-3,
+-#viscAh=600.0,
+- viscAhGrid=0.2,
+- viscA4Grid=0.02,
++ viscAh= 300.,
+  no_slip_sides=.FALSE.,
+  no_slip_bottom=.FALSE.,
+- diffKhT= 100.0,
+-#diffKhT= 600.0,
++ diffKhT= 10.,
+  diffKrT=5.E-5,
+- diffKhS= 100.0,
+-#diffKhS= 600.0,
++ diffKhS= 10.,
+  diffKrS=5.E-5,
+  bottomDragQuadratic=2.5E-3,
+- staggerTimestep = .true.,
+- tempAdvScheme=30,
+- saltAdvScheme=30,
+- vectorInvariantMomentum = .true.,
+-### momImplVertAdv=.true.,
+- tempImplVertAdv=.true.,
+- saltImplVertAdv=.true.,
+- eosType='JMD95Z',
+-#tAlpha = 2.E-4,
+-#sBeta  = 7.4E-4,
+- HeatCapacity_cp = 3974.0,
+- rhoConst=1000.,
+- rhoNil=1000.,
+- gravity=9.81,
+- gBaro=9.81,
+- implicitDiffusion = .true.,
+- implicitViscosity = .true.,
+- rigidLid=.FALSE.,
++ staggerTimestep = .TRUE.,
++ tempAdvScheme=77,
++ saltAdvScheme=77,
++ vectorInvariantMomentum = .TRUE.,
++# momImplVertAdv=.TRUE.,
++#tempImplVertAdv=.TRUE.,
++#saltImplVertAdv=.TRUE.,
++ implicitDiffusion = .TRUE.,
++ implicitViscosity = .TRUE.,
++ selectImplicitDrag = 2,
+  implicitFreeSurface=.TRUE.,
+- useRealFreshWaterFlux = .true.,
++ useRealFreshWaterFlux = .TRUE.,
+  exactConserv=.TRUE.,
+-# start nlfs with rstar
+-#select_rStar=2,
++# start NLFS (without rstar)
+  nonlinFreeSurf=4,
+- hFacInf=0.2,
++ hFacInf=0.05,
+  hFacSup=2.0,
+-# end nlfs with rstar
+- hFacMin=0.2,
++# end NLFS
++ hFacMin=0.10,
+ #integr_GeoPot = 1,
+-#ivdc_kappa = 0.005.,
+-#implicitDiffusion=.true.,
+-#implicitViscosity=.true.,
+-#useCDscheme=.true.,
+-#nonHydrostatic=.true.,
+-#allowFreezing = .true.,
++ ivdc_kappa = 1.,
++ useJamartWetPoints=.TRUE.,
++ selectBotDragQuadr=1,
++#bottomVisc_pCell=.TRUE.,
++#-
+  readBinaryPrec=64,
+-#writeBinaryPrec=64,
+- debuglevel = 5,
+- selectCoriMap = 0,
+- f0 = 0.0,
++ writeBinaryPrec=64,
+  useSingleCpuIO=.TRUE.,
+- globalFiles=.TRUE.,
+- useCoriolis=.TRUE.,
++#globalFiles=.TRUE.,
++ debuglevel = 2,
++ plotLevel = 0,
+  &
+ 
+ # Elliptic solver parameters
+@@ -71,61 +56,54 @@
+  &PARM02
+  cg2dMaxIters=300,
+  cg2dTargetResidual=1.E-11,
+-# cg2dMinColumnEps = 1.
+-# pReleaseVisc = 1.
+-#cg3dMaxIters=40,
+-#cg3dTargetResidual=1.E-13,
++#printResidualFreq=100,
+  &
+ 
+ #Time stepping parameters
+  &PARM03
+-  niter0=11395,
+-# nTimeSteps=25920000,
+- nTimeSteps=20,
+-# startTime=0.,
+-# startTime = 0.,
+-#startTime=62208000.,
+-#startTime=15552000.,
+-#endTime=31104000.,
++#nIter0=2880,
++#nTimeSteps=288,
++#startTime=0.,
++#endTime=2592000.,
+  deltaT=300.0,
+-### deltaT=1200.0,
+- forcing_In_AB  = .false.,
+-#rCD = 0.9896,
++ forcing_In_AB  = .FALSE.,
+  abEps=0.1,
+- cAdjFreq = -1.,
+- pChkptFreq=3000,
+- chkptFreq=3000.0,
+-# pChkptFreq=600.0,
+-# chkptFreq=600.0,
+- dumpFreq=3000,
+-# monitorFreq=15552000.,
+-# monitorSelect=0,
+-# monitorFreq=31104000.,
++ pChkptFreq= 2592000.,
++ chkptFreq = 2592000.,
++ dumpFreq =  86400.,
++ monitorFreq= 7200.,
++ monitorSelect=1,
++ monitorFreq=1800.,
++ dumpFreq = 10800.,
++#- for testing purpose:
++ nIter0=2898,
++ nTimeSteps=20,
++#dumpFreq = 1200.,
++ monitorFreq=1.,
+  &
+ 
+ # Gridding parameters
+  &PARM04
+- useMin4hFacEdges=.TRUE.,
+  usingCartesianGrid=.FALSE.,
+  usingSphericalPolarGrid=.TRUE.,
+-#delR = 10., 10., 10., 10., 10., 10., 10., 10.01, 10.03, 10.11,
+-#10.32, 10.8, 11.76, 13.42, 16.04, 19.82, 24.85, 31.1, 38.42, 46.5,
+-#55., 63.5, 71.58, 78.9, 85.15, 90.18, 93.96, 96.58, 98.25, 99.25,
+-#100.01, 101.33, 104.56, 111.33, 122.83, 139.09, 158.94, 180.83, 203.55, 226.5,
+-#249.5, 272.5, 295.5, 318.5, 341.5, 364.5, 387.5, 410.5, 433.5, 456.5,
+  delR=90*10.,
+- delX=3*.125,
++ delX=1*.125,
+  delY=200*.0078125,
+-# delYFile='dlat.bin',
+-# delY=30*10e3,
+- xgOrigin = -105.5,
+- ygOrigin =  -75.4457,
++ xgOrigin = 0.,
++ ygOrigin = -75.5,
++ pCellMix_select=20,
++ pcellMix_delR = 10.,
++#interViscAr_pCell = .TRUE.,
++#interDiffKr_pCell = .TRUE.,
++ pCellMix_viscAr = 90*1.E-3,
++ pCellMix_diffKr = 90*1.E-4,
++# current default: diffKzT=5.E-5, viscAz=1.E-3,
+  &
+ 
+ # Input datasets
+  &PARM05
+- bathyFile='bathy.box',
+- hydrogThetaFile='theta.init',	
+- hydrogSaltFile='salt.init',
+- pSurfInitFile='etainit.round.bin',
++ bathyFile='bathy_flat.bin',
++ hydrogThetaFile='temp_ini.bin',	
++ hydrogSaltFile ='salt_ini.bin',
++# pSurfInitFile ='etai_ini.bin'
+  &
+Index: ../trunk-jpl/test/MITgcm/input_4003/eedata
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/eedata	(revision 26544)
++++ ../trunk-jpl/test/MITgcm/input_4003/eedata	(revision 26545)
+@@ -1,11 +1,11 @@
+ # Example "eedata" file
+ # Lines beginning "#" are comments
+-# nTx - No. threads per process in X
+-# nTy - No. threads per process in Y
++#  nTx      :: No. threads per process in X
++#  nTy      :: No. threads per process in Y
++# debugMode :: print debug msg (sequence of S/R calls)
+  &EEPARMS
+  useCoupler=.TRUE.,
+  debugMode=.TRUE.,
+  &
+-# Note: Some systems use & as the
+-# namelist terminator. Other systems
+-# use a / character (as shown here).
++# Note: Some systems use & as the namelist terminator (as shown here).
++#       Other systems use a / character.
+Index: ../trunk-jpl/test/MITgcm/input_4003/eedata_uncoupled
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/eedata_uncoupled	(revision 26544)
++++ ../trunk-jpl/test/MITgcm/input_4003/eedata_uncoupled	(revision 26545)
+@@ -1,11 +1,10 @@
+ # Example "eedata" file
+ # Lines beginning "#" are comments
+-# nTx - No. threads per process in X
+-# nTy - No. threads per process in Y
++#  nTx      :: No. threads per process in X
++#  nTy      :: No. threads per process in Y
++# debugMode :: print debug msg (sequence of S/R calls)
+  &EEPARMS
+  useCoupler=.FALSE.,
+-# debugMode=.TRUE.,
+  &
+-# Note: Some systems use & as the
+-# namelist terminator. Other systems
+-# use a / character (as shown here).
++# Note: Some systems use & as the namelist terminator (as shown here).
++#       Other systems use a / character.
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26544)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26545)
+@@ -2,15 +2,14 @@
+ %ISSM/MITgcm coupled set-up
+ %
+ %Script control parameters
+-steps=1:11;
+-steps=1:5;
+-steps=6;
++steps=1:12;
++steps=1:6;
+ 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/*
+-%!rm -rf Models
++!rm -rf ${ISSM_DIR}/test/MITgcm/install_dngoldberg
++!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
++!rm -rf Models
+ 
+ %Organizer
+ !mkdir Models
+@@ -20,11 +19,11 @@
+ 
+ % {{{ Parameters:
+ if perform(org,'Parameters'),
+-	Nx=3; %number of longitude cells
++	Nx=1; %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
++	nPy=4; %number of MITgcm processes to use in y direction
+ 	xgOrigin=1; %origin of longitude
+ 	ygOrigin=1; %origin of latitude
+ 	dLong=1; %longitude grid spacing
Index: /issm/oecreview/Archive/25834-26739/ISSM-26545-26546.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26545-26546.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26545-26546.diff	(revision 26740)
@@ -0,0 +1,46 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26545)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26546)
+@@ -11,10 +11,39 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
++	
++	/*intermediary: */
+ 	int finiteelement;
++	int         code,vector_layout;
++	IssmDouble *spcdata = NULL;
++	int         M,N;
++
++	/*Get finite element type for this analysis*/
+ 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
+-	IoModelToDynamicConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+-	//IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
++
++	/*First of, find the record for the enum, and get code  of data type: */
++	iomodel->SetFilePointerToData(&code, &vector_layout,"md.levelset.spclevelset");
++	if(code!=7)_error_("expecting a IssmDouble vector for constraints md.levelset.spclevelset");
++	if(vector_layout!=1)_error_("expecting a nodal vector for constraints md.levelset.spclevelset");
++
++	/*Fetch vector:*/
++	iomodel->FetchData(&spcdata,&M,&N,spc_name);
++
++	/*Call IoModelToConstraintsx*/
++	if(N>1){
++		/*If it is a time series, most likely we are forcing the ice front position and do not want to have a Dynamic Constraint*/
++		_assert_(M==iomodel->numberofvertices+1);
++		IoModelToConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finite_element);
++	}
++	else{
++		/*This is not a time series, we probably have calving on, we need the levelset constraints to update as the levelset moves*/
++		_assert_(N==1);
++		_assert_(M==iomodel->numberofvertices);
++		IoModelToDynamicConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finite_element);
++	}
++
++	/*Clean up*/
++	xDelete<IssmDouble>(spcdata);
+ }
+ /*}}}*/
+ void LevelsetAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26546-26547.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26546-26547.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26546-26547.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26546)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26547)
+@@ -27,7 +27,7 @@
+ 	if(vector_layout!=1)_error_("expecting a nodal vector for constraints md.levelset.spclevelset");
+ 
+ 	/*Fetch vector:*/
+-	iomodel->FetchData(&spcdata,&M,&N,spc_name);
++	iomodel->FetchData(&spcdata,&M,&N,"md.levelset.spclevelset");
+ 
+ 	/*Call IoModelToConstraintsx*/
+ 	if(N>1){
Index: /issm/oecreview/Archive/25834-26739/ISSM-26547-26548.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26547-26548.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26547-26548.diff	(revision 26740)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26547)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26548)
+@@ -33,13 +33,13 @@
+ 	if(N>1){
+ 		/*If it is a time series, most likely we are forcing the ice front position and do not want to have a Dynamic Constraint*/
+ 		_assert_(M==iomodel->numberofvertices+1);
+-		IoModelToConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finite_element);
++		IoModelToConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
+ 	}
+ 	else{
+ 		/*This is not a time series, we probably have calving on, we need the levelset constraints to update as the levelset moves*/
+ 		_assert_(N==1);
+ 		_assert_(M==iomodel->numberofvertices);
+-		IoModelToDynamicConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finite_element);
++		IoModelToDynamicConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
+ 	}
+ 
+ 	/*Clean up*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26548-26549.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26548-26549.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26548-26549.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26548)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26549)
+@@ -83,10 +83,10 @@
+ 					if any(strcmp(scaledfields,self.fields(i)))
+ 						inds = [1+sum(self.dimensions(1:i-1)):1:sum(self.dimensions(1:i))];
+ 						for row=inds %scale rows corresponding to scaled field
+-							tempcovariance(row,:) = 1./yts*self.covariance(row,:);
++							tempcovariance(row,:) = 1./yts*tempcovariance(row,:);
+ 						end
+ 						for col=inds %scale columns corresponding to scaled field
+-							tempcovariance(:,col) = 1./yts*self.covariance(:,col);
++							tempcovariance(:,col) = 1./yts*tempcovariance(:,col);
+ 						end
+ 					end
+ 				end
+Index: ../trunk-jpl/test/Archives/Archive257.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26549-26550.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26549-26550.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26549-26550.diff	(revision 26740)
@@ -0,0 +1,861 @@
+Index: ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26549)
++++ ../trunk-jpl/src/c/analyses/SmbAnalysis.cpp	(revision 26550)
+@@ -74,6 +74,7 @@
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Tini",SmbTiniEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.Sizeini",SmbSizeiniEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.aValue",SmbAValueEnum);
++			iomodel->FetchDataToInput(inputs,elements,"md.smb.dulwrfValue",SmbDulwrfValueEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.teValue",SmbTeValueEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.szaValue",SmbSzaValueEnum);
+ 			iomodel->FetchDataToInput(inputs,elements,"md.smb.cotValue",SmbCotValueEnum);
+@@ -241,6 +242,7 @@
+ 			break;
+ 		case SMBgembEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIdx",SmbAIdxEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.smb.eIdx",SmbEIdxEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.swIdx",SmbSwIdxEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.denIdx",SmbDenIdxEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.dsnowIdx",SmbDsnowIdxEnum));
+@@ -260,9 +262,11 @@
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdensification",SmbIsdensificationEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isturbulentflux",SmbIsturbulentfluxEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isconstrainsurfaceT",SmbIsconstrainsurfaceTEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdeltaLWup",SmbIsdeltaLWupEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.InitDensityScaling",SmbInitDensityScalingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.ThermoDeltaTScaling",SmbThermoDeltaTScalingEnum));
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.adThresh",SmbAdThreshEnum));
++			parameters->AddObject(iomodel->CopyConstantObject("md.smb.teThresh",SmbTeThreshEnum));
+ 			break;
+ 		case SMBpddEnum:
+ 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdelta18o",SmbIsdelta18oEnum));
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26549)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 26550)
+@@ -693,7 +693,7 @@
+ 	*padiff=adiff;
+ 
+ }  /*}}}*/
+-void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT) { /*{{{*/
++void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble eIdx, IssmDouble teValue, IssmDouble dulwrfValue, IssmDouble teThresh, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT, bool isdeltaLWup) { /*{{{*/
+ 
+ 	/* ENGLACIAL THERMODYNAMICS*/
+ 
+@@ -1009,9 +1009,14 @@
+ 		dT_turb = turb  / TCs;
+ 
+ 		// upward longwave contribution
+-		//ulw = - (SB * pow(Ts,4.0)* teValue) * dt; // - deltatest here
+-		IssmDouble deltatest=0;
+-		ulw = - (SB * pow(Ts,4.0)* teValue - deltatest) * dt; // - deltatest here
++		IssmDouble deltaULW=0.0;
++		IssmDouble emissivity=1.0;
++		//If user wants to set a upward long wave bias
++		if(isdeltaLWup) deltaULW = dulwrfValue;
++		//If user wants to directly set emissivity, or grain radius is larger than the
++		// threshold, or eIdx is 2 and we have wet snow or ice, use prescribed emissivity
++		if(eIdx==0 || (teThresh - re[0])<Gdntol || (eIdx==2 && z0>0.001)) emissivity = teValue;
++		ulw = - (SB * pow(Ts,4.0)* emissivity + deltaULW) * dt; 
+ 		ulwrf = ulwrf - ulw/dt0;
+ 
+ 		dT_ulw = ulw / TCs;
+@@ -2201,8 +2206,11 @@
+ 				if (aIdx==1 && swIdx==0){
+ 					if (fabs(adThresh - 820) < Dtol){
+ 						// ERA5 new aIdx=1, swIdx=0, MODIS 820
+-						M0 = max(1.8230 - (0.1645 * log(C)),0.25);
+-						M1 = max(2.5134 - (0.3244 * log(C)),0.25);
++						//M0 = max(1.8230 - (0.1645 * log(C)),0.25);
++						//M1 = max(2.5134 - (0.3244 * log(C)),0.25);
++						// ERA5 new aIdx=1, swIdx=0, MODIS 820, p90 new (ERA5, 40 and e97)
++						M0 = max(1.3045 - (0.0988 * log(C)),0.25);
++						M1 = max(1.3694 - (0.1354 * log(C)),0.25);
+ 					}
+ 					else{
+ 						// ERA5 new aIdx=1, swIdx=0
+@@ -2245,8 +2253,11 @@
+ 				if (aIdx==1 && swIdx==0){
+ 					if (fabs(adThresh - 820) < Dtol){
+ 						// ERA5 new aIdx=1, swIdx=0, MODIS 820
+-						M0 = max(1.4174 - (0.1037 * log(C)),0.25);
+-						M1 = max(2.2010 - (0.2460 * log(C)),0.25);
++						//M0 = max(1.4174 - (0.1037 * log(C)),0.25);
++						//M1 = max(2.2010 - (0.2460 * log(C)),0.25);
++						// ERA5 new aIdx=1, swIdx=0, MODIS 820, p90 new (ERA5 lwt, 40 and e97)
++						M0 = max(1.2138 - (0.1057 * log(C)),0.25);
++						M1 = max(1.4946 - (0.1607 * log(C)),0.25);
+ 					}
+ 					else{
+ 						// ERA5 new aIdx=1, swIdx=0
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26549)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 26550)
+@@ -33,7 +33,7 @@
+ void grainGrowth(IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* T,IssmDouble* dz,IssmDouble* d, IssmDouble* W,IssmDouble smb_dt,int m,int aIdx, int sid);
+ void albedo(IssmDouble** a, IssmDouble** adiff, int aIdx, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble Msurf, IssmDouble clabSnow, IssmDouble clabIce, IssmDouble SZA, IssmDouble COT, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
+ void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble dswdiff, IssmDouble as, IssmDouble asdiff, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
+-void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT);
++void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* re, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble eIdx, IssmDouble teValue, IssmDouble dulwrfValue, IssmDouble teThresh, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid, bool isconstrainsurfaceT, bool isdeltaLWup);
+ void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, IssmDouble* pRa, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
+ void melt(IssmDouble* pM, IssmDouble* pMs, IssmDouble* pR, IssmDouble* pF, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** padiff, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble Ra, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble zY, IssmDouble dIce, int sid);
+ void densification(IssmDouble** pd,IssmDouble** pdz, IssmDouble* T, IssmDouble* re, int denIdx, int aIdx, int swIdx, IssmDouble adThresh, IssmDouble C, IssmDouble dt, IssmDouble Tmean, IssmDouble dIce, int m, int sid);
+Index: ../trunk-jpl/src/m/classes/SMBgemb.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26549)
++++ ../trunk-jpl/src/m/classes/SMBgemb.m	(revision 26550)
+@@ -23,6 +23,7 @@
+ 		isturbulentflux;
+ 		isconstrainsurfaceT;
+ 		isclimatology;
++		isdeltaLWup;
+ 
+ 		%inputs:
+ 		Ta    = NaN; %2 m air temperature, in Kelvin
+@@ -41,7 +42,9 @@
+ 
+ 		%optional inputs:
+ 		aValue = NaN; %Albedo forcing at every element.  Used only if aIdx == 0, or density exceeds adThresh
+-		teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
++		teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1). 
++		               %Used only if eIdx== 0, or effective grain radius exceeds teThresh
++		dulwrfValue = NaN; %Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true;  
+ 
+ 		% Initialization of snow properties
+ 		Dzini = NaN; %cell depth (m)
+@@ -58,12 +61,17 @@
+ 
+ 		%settings:
+ 		aIdx   = NaN; %method for calculating albedo and subsurface absorption (default is 1)
+-		% 0: direct input from aValue parameter
++		% 0: direct input from aValue parameter, no use of adThresh
+ 		% 1: effective grain radius [Gardner & Sharp, 2009]
+ 		% 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003]], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
+ 		% 3: density and cloud amount [Greuell & Konzelmann, 1994]
+ 		% 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+ 
++		eIdx   = NaN; %method for calculating emissivity (default is 1)
++		% 0: direct input from teValue parameter, no use of teThresh
++		% 1: default value of 1, in areas with grain radius below teThresh
++		% 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface
++
+ 		swIdx  = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002))
+ 
+ 		denIdx = NaN; %densification model to use (default is 2):
+@@ -110,6 +118,9 @@
+ 		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).
++		teThresh = NaN; %Apply eIdx method to all areas with grain radii below this value,
++		%or else apply direct input value from teValue, allowing emissivity to be altered.
++		%Default value is a effective grain radius of 10 mm.
+ 
+ 		%densities:
+ 		InitDensityScaling= NaN; %initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
+@@ -151,7 +162,8 @@
+ 			fielddisplay(self,'ismelt','run melting  module (default true)');
+ 			fielddisplay(self,'isdensification','run densification module (default true)');
+ 			fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)');
+-			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change');
++			fielddisplay(self,'isconstrainsurfaceT','constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)');
++			fielddisplay(self,'isdeltaLWup','set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'); 
+ 			fielddisplay(self,'Ta','2 m air temperature, in Kelvin');
+ 			fielddisplay(self,'V','wind speed (m s-1)');
+ 			fielddisplay(self,'dswrf','downward shortwave radiation flux [W/m^2]');
+@@ -182,7 +194,13 @@
+ 				'3: density and cloud amount [Greuell & Konzelmann, 1994]',...
+ 				'4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
+ 
++			fielddisplay(self,'dulwrfValue','Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)');
+ 			fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)');
++			fielddisplay(self,'teThresh',{'Apply eIdx method to all areas with effective grain radius below this value,','or else apply direct input value from teValue, allowing emissivity to be altered.'});
++			fielddisplay(self,'eIdx',{'method for calculating emissivity (default is 1)',...
++				'0: direct input from teValue parameter, no use of teThresh',...
++				'1: default value of 1, in areas with grain radius below teThresh',...
++				'2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface'});
+ 
+ 			%snow properties init
+ 			fielddisplay(self,'Dzini','Initial cell depth when restart [m]');
+@@ -298,7 +316,7 @@
+ 			if ~isnan(self.cciceValue)
+ 				self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
+ 			end
+-			if (aIdx == 0) & ~isnan(self.aValue)
++			if ~isnan(self.aValue)
+ 				self.aValue=project3d(md,'vector',self.aValue,'type','element');
+ 			end
+ 			if ~isnan(self.teValue)
+@@ -305,7 +323,6 @@
+ 				self.teValue=project3d(md,'vector',self.teValue,'type','element');
+ 			end
+ 
+-
+ 		end % }}}
+ 		function list = defaultoutputs(self,md) % {{{
+ 			list = {'SmbMassBalance','SmbAccumulatedMassBalance'};
+@@ -321,8 +338,10 @@
+ 			self.isdensification=1;
+ 			self.isturbulentflux=1;
+ 			self.isconstrainsurfaceT=0;
++			self.isdeltaLWup=0;
+ 
+ 			self.aIdx = 1;
++			self.eIdx = 1;
+ 			self.swIdx = 1;
+ 			self.denIdx = 2;
+ 			self.dsnowIdx = 1;
+@@ -347,9 +366,11 @@
+ 			self.t0dry = 30;
+ 			self.K = 7;
+ 			self.adThresh = 1023;
++			self.teThresh = 10;
+ 
+ 			self.teValue = ones(mesh.numberofelements,1);
+ 			self.aValue = self.aSnow*ones(mesh.numberofelements,1);
++			self.dulwrfValue = zeros(mesh.numberofelements,1);
+ 
+ 			self.dswdiffrf=0.0*ones(mesh.numberofelements,1);
+ 			self.szaValue=0.0*ones(mesh.numberofelements,1);
+@@ -383,6 +404,7 @@
+ 			md = checkfield(md,'fieldname','smb.isdensification','values',[0 1]);
+ 			md = checkfield(md,'fieldname','smb.isturbulentflux','values',[0 1]);
+ 			md = checkfield(md,'fieldname','smb.isconstrainsurfaceT','values',[0 1]);
++			md = checkfield(md,'fieldname','smb.isdeltaLWup','values',[0 1]);
+ 
+ 			md = checkfield(md,'fieldname','smb.Ta','timeseries',1,'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
+ 			md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<',45,'size',size(self.Ta)); %max 500 km/h
+@@ -399,8 +421,10 @@
+ 			md = checkfield(md,'fieldname','smb.Vz','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0,'<=',5000);
+ 
+ 			md = checkfield(md,'fieldname','smb.teValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
++			md = checkfield(md,'fieldname','smb.dulwrfValue','timeseries',1,'NaN',1,'Inf',1);
+ 
+ 			md = checkfield(md,'fieldname','smb.aIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
++			md = checkfield(md,'fieldname','smb.eIdx','NaN',1,'Inf',1,'values',[0,1,2]);
+ 			md = checkfield(md,'fieldname','smb.swIdx','NaN',1,'Inf',1,'values',[0,1]);
+ 			md = checkfield(md,'fieldname','smb.denIdx','NaN',1,'Inf',1,'values',[1,2,3,4,5,6,7]);
+ 			md = checkfield(md,'fieldname','smb.dsnowIdx','NaN',1,'Inf',1,'values',[0,1,2,3,4]);
+@@ -413,10 +437,10 @@
+ 			md = checkfield(md,'fieldname','smb.InitDensityScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
+ 			md = checkfield(md,'fieldname','smb.ThermoDeltaTScaling','NaN',1,'Inf',1,'>=',0,'<=',1);
+ 			md = checkfield(md,'fieldname','smb.adThresh','NaN',1,'Inf',1,'>=',0);
++			md = checkfield(md,'fieldname','smb.teThresh','NaN',1,'Inf',1,'>=',0);
+ 
++			md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
+ 			switch self.aIdx,
+-				case 0
+-					md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
+ 				case {1 2}
+ 					md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'Inf',1,'>=',.64,'<=',.89);
+ 					md = checkfield(md,'fieldname','smb.aIce','NaN',1,'Inf',1,'>=',.27,'<=',.58);
+@@ -459,6 +483,7 @@
+ 			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','isconstrainsurfaceT','format','Boolean');
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdeltaLWup','format','Boolean');
+ 
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+@@ -482,6 +507,7 @@
+ 			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','eIdx','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer');
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsnowIdx','format','Integer');
+@@ -495,9 +521,11 @@
+ 			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','teThresh','format','Double');
+ 
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+ 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+@@ -532,6 +560,9 @@
+ 			if size(md.smb.dswdiffrf,2)>1 & any(md.smb.dswdiffrf(end,:) - md.smb.Ta(end,:) ~= 0)
+ 				error('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!');
+ 			end
++			if size(md.smb.dulwrfValue,2)>1 & any(md.smb.dulwrfValue(end,:) - md.smb.Ta(end,:) ~= 0)
++				error('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!');
++			end
+ 			if size(md.smb.aValue,2)>1 & any(md.smb.aValue(end,:) - md.smb.Ta(end,:) ~= 0)
+ 				error('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!');
+ 			end
+Index: ../trunk-jpl/src/m/classes/SMBgemb.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26549)
++++ ../trunk-jpl/src/m/classes/SMBgemb.py	(revision 26550)
+@@ -30,6 +30,7 @@
+         self.isdensification = 0
+         self.isturbulentflux = 0
+         self.isconstrainsurfaceT = 0
++        self.isdeltaLWup = 0
+         self.isclimatology = np.nan
+ 
+         # Inputs
+@@ -49,7 +50,8 @@
+ 
+         # Optional inputs
+         self.aValue                 = np.nan    # Albedo forcing at every element. Used only if aIdx == 0, or density exceeds adThresh.
+-        self.teValue                = np.nan    # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
++        self.teValue                = np.nan    # Outward longwave radiation thermal emissivity forcing at every element (default in code is 1), Used only if eIdx== 0, or effective grain radius exceeds teThresh
++        dulwrfValue                 = np.nan    #Delta with which to perturn the long wave radiation upwards. Use if isdeltaLWup is true
+ 
+         # Initialization of snow properties
+         self.Dzini                  = np.nan    # cell depth (m)
+@@ -66,11 +68,16 @@
+ 
+         # Settings
+         self.aIdx                   = np.nan    # method for calculating albedo and subsurface absorption (default is 1)
+-        # 0: direct input from aValue parameter
++        # 0: direct input from aValue parameter, no use of adThresh
+         # 1: effective grain radius [Gardner & Sharp, 2009]
+         # 2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)
+         # 3: density and cloud amount [Greuell & Konzelmann, 1994]
+         # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
++        
++        self.eIdx                   = np.nan    #method for calculating emissivity (default is 1)
++        # 0: direct input from teValue parameter, no use of teThresh
++        # 1: default value of 1, in areas with grain radius below teThresh
++        # 2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface
+ 
+         self.swIdx                  = np.nan    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1, if aIdx=2 function of effective radius (Brun et al., 1992) or else dependent on snow density (taken from Bassford, 2002))
+ 
+@@ -118,6 +125,9 @@
+         self.adThresh               = np.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).
++        teThresh                    = np.nan    #Apply eIdx method to all areas with grain radii below this value,
++        #or else apply direct input value from teValue, allowing emissivity to be altered.
++        #Default value is a effective grain radius of 10 mm.
+ 
+         # Densities
+         self.InitDensityScaling     = np.nan    # initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
+@@ -157,7 +167,8 @@
+         s += '{}\n'.format(fielddisplay(self, 'ismelt', 'run melting  module (default true)'))
+         s += '{}\n'.format(fielddisplay(self, 'isdensification', 'run densification module (default true)'))
+         s += '{}\n'.format(fielddisplay(self, 'isturbulentflux', 'run turbulant heat fluxes module (default true)'))
+-        s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change'))
++        s += '{}\n'.format(fielddisplay(self, 'isconstrainsurfaceT', 'constrain surface temperatures to air temperature, turn off EC and surface flux contribution to surface temperature change (default false)'))
++        s += '{}\n'.format(fielddisplay(self, 'isdeltaLWup', 'set to true to invoke a bias in the long wave upward spatially, specified by dulwrfValue (default false)'))
+         s += '{}\n'.format(fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
+         s += '{}\n'.format(fielddisplay(self, 'V', 'wind speed (m s-1)'))
+         s += '{}\n'.format(fielddisplay(self, 'dswrf', 'downward shortwave radiation flux [W/m^2]'))
+@@ -187,7 +198,14 @@
+             '2: effective grain radius [Brun et al., 1992; LeFebre et al., 2003], with swIdx=1, SW penetration follows grain size in 3 spectral bands (Brun et al., 1992)',
+             '3: density and cloud amount [Greuell & Konzelmann, 1994]',
+             '4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
++
++        s += '{}\n'.format(fielddisplay(self, 'dulwrfValue', 'Specified bias to be applied to the outward long wave radiation every element (W/m-2, +upward)'))
+         s += '{}\n'.format(fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
++        s += '{}\n'.format(fielddisplay(self, 'teThresh', ['Apply eIdx method to all areas with effective grain radius below this value,', 'or else apply direct input value from teValue, allowing emissivity to be altered.']))
++        s += '{}\n'.format(fielddisplay(self, 'eIdx', ['method for calculating emissivity (default is 1)',
++            '0: direct input from teValue parameter, no use of teThresh',
++            '1: default value of 1, in areas with grain radius below teThresh',
++            '2: default value of 1, in areas with grain radius below teThresh and areas of dry snow (not bare ice or wet) at the surface']))
+ 
+         # Snow properties init
+         s += '{}\n'.format(fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]'))
+@@ -285,7 +303,7 @@
+         if not np.isnan(self.cciceValue):
+             self.cciceValue=project3d(md,'vector',self.cciceValue,'type','element');
+ 
+-        if (self.aIdx == 0) and (not np.isnan(self.aValue)):
++        if not np.isnan(self.aValue):
+             self.aValue = project3d(md, 'vector', self.aValue, 'type', 'element')
+         if not np.isnan(self.teValue):
+             self.teValue = project3d(md, 'vector', self.teValue, 'type', 'element')
+@@ -307,8 +325,10 @@
+         self.isdensification = 1
+         self.isturbulentflux = 1
+         self.isconstrainsurfaceT = 0
++        self.isdeltaLWup = 0
+ 
+         self.aIdx = 1
++        self.eIdx = 1
+         self.swIdx = 1
+         self.denIdx = 2
+         self.dsnowIdx = 1
+@@ -333,9 +353,11 @@
+         self.t0dry = 30
+         self.K = 7
+         self.adThresh = 1023
++        self.teThresh = 10
+ 
+         self.teValue = np.ones((mesh.numberofelements,))
+         self.aValue = self.aSnow * np.ones(mesh.numberofelements,)
++        self.dulwrfValue = np.zeros((mesh.numberofelements,))
+ 
+         self.dswdiffrf = 0.0 * np.ones(mesh.numberofelements,)
+         self.szaValue = 0.0 * np.ones(mesh.numberofelements,)
+@@ -372,6 +394,7 @@
+         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.isdeltaLWup', 'values',[0, 1])
+         md = checkfield(md, 'fieldname', 'smb.isconstrainsurfaceT', 'values', [0, 1])
+ 
+         md = checkfield(md, 'fieldname', 'smb.Ta', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
+@@ -389,8 +412,10 @@
+         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.dulwrfValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+ 
+         md = checkfield(md, 'fieldname', 'smb.aIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2, 3, 4])
++        md = checkfield(md, 'fieldname', 'smb.eIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2])
+         md = checkfield(md, 'fieldname', 'smb.swIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.denIdx', 'NaN', 1, 'Inf', 1, 'values', [1, 2, 3, 4, 5, 6, 7])
+         md = checkfield(md, 'fieldname', 'smb.dsnowIdx', 'NaN', 1, 'Inf', 1, 'values', [0, 1, 2, 3, 4])
+@@ -403,10 +428,10 @@
+         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 self.aIdx == 0:
+-            md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
+-        elif isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
++        md = checkfield(md, 'fieldname', 'smb.teThresh', 'NaN', 1, 'Inf',1,'>=',0)
++        
++        md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
++        if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
+             md = checkfield(md, 'fieldname', 'smb.aSnow', 'NaN', 1, 'Inf', 1, '> = ', .64, '< = ', .89)
+             md = checkfield(md, 'fieldname', 'smb.aIce', 'NaN', 1, 'Inf', 1, '> = ', .27, '< = ', .58)
+             if self.aIdx == 1:
+@@ -445,6 +470,7 @@
+         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', 'isconstrainsurfaceT', 'format', 'Boolean')
++        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdeltaLWup','format','Boolean')
+ 
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+@@ -468,6 +494,7 @@
+         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', 'eIdx', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'swIdx', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'denIdx', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dsnowIdx', 'format', 'Integer')
+@@ -481,9 +508,11 @@
+         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', 'teThresh', 'format', 'Double')
+ 
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
++        WriteData(fid,prefix,'object',self,'class','smb','fieldname','dulwrfValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+         WriteData(fid,prefix,'object',self,'class','smb','fieldname','szaValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+         WriteData(fid,prefix,'object',self,'class','smb','fieldname','cotValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+         WriteData(fid,prefix,'object',self,'class','smb','fieldname','ccsnowValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
+@@ -513,6 +542,8 @@
+             raise IOError('If GEMB forcing dswdiffrf is transient, it must have the same time steps as input Ta in the final row!')
+         if ((np.ndim(self.aValue)>1) & np.any(self.aValue[-1] - self.Ta[-1] != 0)):
+             raise IOError('If GEMB forcing aValue is transient, it must have the same time steps as input Ta in the final row!')
++        if ((np.ndim(self.dulwrfValue)>1) & np.any(self.dulwrfValue[-1] - self.Ta[-1] != 0)):
++            raise IOError('If GEMB forcing dulwrfValue is transient, it must have the same time steps as input Ta in the final row!')
+         if ((np.ndim(self.szaValue)>1) & np.any(self.szaValue[-1] - self.Ta[-1] != 0)):
+             raise IOError('If GEMB forcing szaValue is transient, it must have the same time steps as input Ta in the final row!')
+         if ((np.ndim(self.cotValue)>1) & np.any(self.cotValue[-1] - self.Ta[-1] != 0)):
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26549)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26550)
+@@ -3777,6 +3777,7 @@
+ 	IssmDouble pAir=0.0;
+ 	IssmDouble teValue=1.0;
+ 	IssmDouble aValue=0.0;
++	IssmDouble dulwrfValue=0.0;
+ 	IssmDouble szaValue=0.0;
+ 	IssmDouble cotValue=0.0;
+ 	IssmDouble ccsnowValue=0.0;
+@@ -3783,6 +3784,7 @@
+ 	IssmDouble cciceValue=0.0;
+ 	IssmDouble dt,time,smb_dt;
+ 	int        aIdx=0;
++	int        eIdx=0;
+ 	int        denIdx=0;
+ 	int        dsnowIdx=0;
+ 	int        swIdx=0;
+@@ -3812,9 +3814,11 @@
+ 	IssmDouble accsumRa=0.0;
+ 	bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux;
+ 	bool isconstrainsurfaceT=false;
++	bool isdeltaLWup=false;
+ 	IssmDouble init_scaling=0.0;
+ 	IssmDouble thermo_scaling=1.0;
+ 	IssmDouble adThresh=1023.0;
++	IssmDouble teThresh=10;
+ 	/*}}}*/
+ 	/*Output variables:{{{ */
+ 	IssmDouble* dz=NULL;
+@@ -3864,6 +3868,7 @@
+ 	parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	parameters->FindParam(&smb_dt,SmbDtEnum);                     /*time period for the smb solution,  usually smaller than the glaciological dt*/
+ 	parameters->FindParam(&aIdx,SmbAIdxEnum);
++	parameters->FindParam(&eIdx,SmbEIdxEnum);
+ 	parameters->FindParam(&denIdx,SmbDenIdxEnum);
+ 	parameters->FindParam(&swIdx,SmbSwIdxEnum);
+ 	parameters->FindParam(&dsnowIdx,SmbDsnowIdxEnum);
+@@ -3880,9 +3885,11 @@
+ 	parameters->FindParam(&isdensification,SmbIsdensificationEnum);
+ 	parameters->FindParam(&isturbulentflux,SmbIsturbulentfluxEnum);
+ 	parameters->FindParam(&isconstrainsurfaceT,SmbIsconstrainsurfaceTEnum);
++	parameters->FindParam(&isdeltaLWup,SmbIsdeltaLWupEnum);
+ 	parameters->FindParam(&init_scaling,SmbInitDensityScalingEnum);
+ 	parameters->FindParam(&thermo_scaling,SmbThermoDeltaTScalingEnum);
+ 	parameters->FindParam(&adThresh,SmbAdThreshEnum);
++	parameters->FindParam(&teThresh,SmbTeThreshEnum);
+ 	/*}}}*/
+ 	/*Retrieve inputs: {{{*/
+ 	Input *zTop_input          = this->GetInput(SmbZTopEnum);         _assert_(zTop_input);
+@@ -4072,6 +4079,7 @@
+ 	Input *pAir_input= this->GetInput(SmbPAirEnum,timeinputs);  _assert_(pAir_input);
+ 	Input *teValue_input= this->GetInput(SmbTeValueEnum,timeinputs); _assert_(teValue_input);
+ 	Input *aValue_input= this->GetInput(SmbAValueEnum,timeinputs); _assert_(aValue_input);
++	Input *dulwrfValue_input= this->GetInput(SmbDulwrfValueEnum,timeinputs); _assert_(dulwrfValue_input);
+ 	Input *szaValue_input= this->GetInput(SmbSzaValueEnum,timeinputs); _assert_(szaValue_input);
+ 	Input *cotValue_input= this->GetInput(SmbCotValueEnum,timeinputs); _assert_(cotValue_input);
+ 	Input *ccsnowValue_input= this->GetInput(SmbCcsnowValueEnum,timeinputs); _assert_(ccsnowValue_input);
+@@ -4087,6 +4095,7 @@
+ 	eAir_input->GetInputValue(&eAir,gauss);  //screen level vapor pressure [Pa]
+ 	pAir_input->GetInputValue(&pAir,gauss);  // screen level air pressure [Pa]
+ 	teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
++	dulwrfValue_input->GetInputValue(&dulwrfValue,gauss);  // LWup perturbation [W m-2]
+ 	aValue_input->GetInputValue(&aValue,gauss);  // Albedo [0 1]
+ 	szaValue_input->GetInputValue(&szaValue,gauss);  // Solar Zenith Angle [degree]
+ 	cotValue_input->GetInputValue(&cotValue,gauss);  // Cloud Optical Thickness
+@@ -4112,7 +4121,7 @@
+ 		if (m>1) T[1]=Ta;
+ 	}
+ 	/*Thermal profile computation:*/
+-	if(isthermal)thermo(&EC, &T, &ulw, dz, d, swf, dlw, Ta, V, eAir, pAir, teValue, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT);
++	if(isthermal)thermo(&EC, &T, &ulw, re, dz, d, swf, dlw, Ta, V, eAir, pAir, eIdx, teValue, dulwrfValue, teThresh, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT,isdeltaLWup);
+ 
+ 	/*Change in thickness of top cell due to evaporation/condensation  assuming same density as top cell.
+ 	 * need to fix this in case all or more of cell evaporates */
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26549)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26550)
+@@ -442,6 +442,7 @@
+ syn keyword cConstant SmbDenIdxEnum
+ syn keyword cConstant SmbDtEnum
+ syn keyword cConstant SmbEnum
++syn keyword cConstant SmbEIdxEnum
+ syn keyword cConstant SmbFEnum
+ syn keyword cConstant SmbInitDensityScalingEnum
+ syn keyword cConstant SmbIsaccumulationEnum
+@@ -450,6 +451,7 @@
+ syn keyword cConstant SmbIsd18opdEnum
+ syn keyword cConstant SmbIsdelta18oEnum
+ syn keyword cConstant SmbIsdensificationEnum
++syn keyword cConstant SmbIsdeltaLWupEnum
+ syn keyword cConstant SmbIsfirnwarmingEnum
+ syn keyword cConstant SmbIsgraingrowthEnum
+ syn keyword cConstant SmbIsmeltEnum
+@@ -477,6 +479,7 @@
+ syn keyword cConstant SmbSwIdxEnum
+ syn keyword cConstant SmbT0dryEnum
+ syn keyword cConstant SmbT0wetEnum
++syn keyword cConstant SmbTeThreshEnum
+ syn keyword cConstant SmbTdiffEnum
+ syn keyword cConstant SmbThermoDeltaTScalingEnum
+ syn keyword cConstant SmbTemperaturesReconstructedYearsEnum
+@@ -912,6 +915,7 @@
+ syn keyword cConstant SmbDailywindspeedEnum
+ syn keyword cConstant SmbDiniEnum
+ syn keyword cConstant SmbDlwrfEnum
++syn keyword cConstant SmbDulwrfValueEnum
+ syn keyword cConstant SmbDswrfEnum
+ syn keyword cConstant SmbDswdiffrfEnum
+ syn keyword cConstant SmbDzAddEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26549)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26550)
+@@ -436,6 +436,7 @@
+ 	SmbDenIdxEnum,
+ 	SmbDtEnum,
+ 	SmbEnum,
++	SmbEIdxEnum,
+ 	SmbFEnum,
+ 	SmbInitDensityScalingEnum,
+ 	SmbIsaccumulationEnum,
+@@ -444,6 +445,7 @@
+ 	SmbIsd18opdEnum,
+ 	SmbIsdelta18oEnum,
+ 	SmbIsdensificationEnum,
++	SmbIsdeltaLWupEnum,
+ 	SmbIsfirnwarmingEnum,
+ 	SmbIsgraingrowthEnum,
+ 	SmbIsmeltEnum,
+@@ -471,6 +473,7 @@
+ 	SmbSwIdxEnum,
+ 	SmbT0dryEnum,
+ 	SmbT0wetEnum,
++	SmbTeThreshEnum,
+ 	SmbTdiffEnum,
+ 	SmbThermoDeltaTScalingEnum,
+ 	SmbTemperaturesReconstructedYearsEnum,
+@@ -908,6 +911,7 @@
+ 	SmbDailywindspeedEnum,
+ 	SmbDiniEnum,
+ 	SmbDlwrfEnum,
++	SmbDulwrfValueEnum,
+ 	SmbDswrfEnum,
+ 	SmbDswdiffrfEnum,
+ 	SmbDzAddEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26549)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26550)
+@@ -444,6 +444,7 @@
+ 		case SmbDenIdxEnum : return "SmbDenIdx";
+ 		case SmbDtEnum : return "SmbDt";
+ 		case SmbEnum : return "Smb";
++		case SmbEIdxEnum : return "SmbEIdx";
+ 		case SmbFEnum : return "SmbF";
+ 		case SmbInitDensityScalingEnum : return "SmbInitDensityScaling";
+ 		case SmbIsaccumulationEnum : return "SmbIsaccumulation";
+@@ -452,6 +453,7 @@
+ 		case SmbIsd18opdEnum : return "SmbIsd18opd";
+ 		case SmbIsdelta18oEnum : return "SmbIsdelta18o";
+ 		case SmbIsdensificationEnum : return "SmbIsdensification";
++		case SmbIsdeltaLWupEnum : return "SmbIsdeltaLWup";
+ 		case SmbIsfirnwarmingEnum : return "SmbIsfirnwarming";
+ 		case SmbIsgraingrowthEnum : return "SmbIsgraingrowth";
+ 		case SmbIsmeltEnum : return "SmbIsmelt";
+@@ -479,6 +481,7 @@
+ 		case SmbSwIdxEnum : return "SmbSwIdx";
+ 		case SmbT0dryEnum : return "SmbT0dry";
+ 		case SmbT0wetEnum : return "SmbT0wet";
++		case SmbTeThreshEnum : return "SmbTeThresh";
+ 		case SmbTdiffEnum : return "SmbTdiff";
+ 		case SmbThermoDeltaTScalingEnum : return "SmbThermoDeltaTScaling";
+ 		case SmbTemperaturesReconstructedYearsEnum : return "SmbTemperaturesReconstructedYears";
+@@ -914,6 +917,7 @@
+ 		case SmbDailywindspeedEnum : return "SmbDailywindspeed";
+ 		case SmbDiniEnum : return "SmbDini";
+ 		case SmbDlwrfEnum : return "SmbDlwrf";
++		case SmbDulwrfValueEnum : return "SmbDulwrfValue";
+ 		case SmbDswrfEnum : return "SmbDswrf";
+ 		case SmbDswdiffrfEnum : return "SmbDswdiffrf";
+ 		case SmbDzAddEnum : return "SmbDzAdd";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26549)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26550)
+@@ -453,6 +453,7 @@
+ 	      else if (strcmp(name,"SmbDenIdx")==0) return SmbDenIdxEnum;
+ 	      else if (strcmp(name,"SmbDt")==0) return SmbDtEnum;
+ 	      else if (strcmp(name,"Smb")==0) return SmbEnum;
++	      else if (strcmp(name,"SmbEIdx")==0) return SmbEIdxEnum;
+ 	      else if (strcmp(name,"SmbF")==0) return SmbFEnum;
+ 	      else if (strcmp(name,"SmbInitDensityScaling")==0) return SmbInitDensityScalingEnum;
+ 	      else if (strcmp(name,"SmbIsaccumulation")==0) return SmbIsaccumulationEnum;
+@@ -461,6 +462,7 @@
+ 	      else if (strcmp(name,"SmbIsd18opd")==0) return SmbIsd18opdEnum;
+ 	      else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum;
+ 	      else if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum;
++	      else if (strcmp(name,"SmbIsdeltaLWup")==0) return SmbIsdeltaLWupEnum;
+ 	      else if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum;
+ 	      else if (strcmp(name,"SmbIsgraingrowth")==0) return SmbIsgraingrowthEnum;
+ 	      else if (strcmp(name,"SmbIsmelt")==0) return SmbIsmeltEnum;
+@@ -488,6 +490,7 @@
+ 	      else if (strcmp(name,"SmbSwIdx")==0) return SmbSwIdxEnum;
+ 	      else if (strcmp(name,"SmbT0dry")==0) return SmbT0dryEnum;
+ 	      else if (strcmp(name,"SmbT0wet")==0) return SmbT0wetEnum;
++	      else if (strcmp(name,"SmbTeThresh")==0) return SmbTeThreshEnum;
+ 	      else if (strcmp(name,"SmbTdiff")==0) return SmbTdiffEnum;
+ 	      else if (strcmp(name,"SmbThermoDeltaTScaling")==0) return SmbThermoDeltaTScalingEnum;
+ 	      else if (strcmp(name,"SmbTemperaturesReconstructedYears")==0) return SmbTemperaturesReconstructedYearsEnum;
+@@ -502,13 +505,13 @@
+ 	      else if (strcmp(name,"Steps")==0) return StepsEnum;
+ 	      else if (strcmp(name,"StressbalanceAbstol")==0) return StressbalanceAbstolEnum;
+ 	      else if (strcmp(name,"StressbalanceFSreconditioning")==0) return StressbalanceFSreconditioningEnum;
+-	      else if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum;
+-	      else if (strcmp(name,"StressbalanceMaxiter")==0) return StressbalanceMaxiterEnum;
+-	      else if (strcmp(name,"StressbalanceNumRequestedOutputs")==0) return StressbalanceNumRequestedOutputsEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum;
++	      if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum;
++	      else if (strcmp(name,"StressbalanceMaxiter")==0) return StressbalanceMaxiterEnum;
++	      else if (strcmp(name,"StressbalanceNumRequestedOutputs")==0) return StressbalanceNumRequestedOutputsEnum;
++	      else if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum;
+ 	      else if (strcmp(name,"StressbalanceReltol")==0) return StressbalanceReltolEnum;
+ 	      else if (strcmp(name,"StressbalanceRequestedOutputs")==0) return StressbalanceRequestedOutputsEnum;
+ 	      else if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
+@@ -625,13 +628,13 @@
+ 	      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 stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"CalvingratexAverage")==0) return CalvingratexAverageEnum;
++	      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,"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;
+@@ -748,13 +751,13 @@
+ 	      else if (strcmp(name,"HydrologyReynolds")==0) return HydrologyReynoldsEnum;
+ 	      else if (strcmp(name,"HydrologySheetConductivity")==0) return HydrologySheetConductivityEnum;
+ 	      else if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
+-	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+-	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
+-	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
++	      if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
++	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
++	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
++	      else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologyWatercolumnMax")==0) return HydrologyWatercolumnMaxEnum;
+ 	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
+ 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
+@@ -871,13 +874,13 @@
+ 	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+ 	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+ 	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+-	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+-	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+-	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
++	      if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
++	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
++	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
++	      else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGUsubelOcean")==0) return SealevelchangeGUsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGEsubelOcean")==0) return SealevelchangeGEsubelOceanEnum;
+ 	      else if (strcmp(name,"SealevelchangeGNsubelOcean")==0) return SealevelchangeGNsubelOceanEnum;
+@@ -935,6 +938,7 @@
+ 	      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,"SmbDulwrfValue")==0) return SmbDulwrfValueEnum;
+ 	      else if (strcmp(name,"SmbDswrf")==0) return SmbDswrfEnum;
+ 	      else if (strcmp(name,"SmbDswdiffrf")==0) return SmbDswdiffrfEnum;
+ 	      else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
+@@ -993,14 +997,14 @@
+ 	      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 stage=9;
++   }
++   if(stage==9){
++	      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 stage=9;
+-   }
+-   if(stage==9){
+-	      if (strcmp(name,"SmbTini")==0) return SmbTiniEnum;
++	      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,"SmbValuesAutoregression")==0) return SmbValuesAutoregressionEnum;
+@@ -1116,14 +1120,14 @@
+ 	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+ 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+-	      else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
+ 	      else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum;
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
++	      else if (strcmp(name,"Outputdefinition33")==0) return Outputdefinition33Enum;
+ 	      else if (strcmp(name,"Outputdefinition34")==0) return Outputdefinition34Enum;
+ 	      else if (strcmp(name,"Outputdefinition35")==0) return Outputdefinition35Enum;
+ 	      else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum;
+@@ -1239,14 +1243,14 @@
+ 	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
+ 	      else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
+ 	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+-	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
++         else stage=11;
++   }
++   if(stage==11){
++	      if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
+ 	      else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum;
+ 	      else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum;
+ 	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+-         else stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"Colinear")==0) return ColinearEnum;
++	      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;
+@@ -1362,14 +1366,14 @@
+ 	      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 stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"J")==0) return JEnum;
+ 	      else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
+ 	      else if (strcmp(name,"MLHOApproximation")==0) return MLHOApproximationEnum;
+ 	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
+-         else stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum;
++	      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;
+@@ -1485,14 +1489,14 @@
+ 	      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 stage=13;
++   }
++   if(stage==13){
++	      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 stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"SMBpdd")==0) return SMBpddEnum;
++	      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;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26550-26551.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26550-26551.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26550-26551.diff	(revision 26740)
@@ -0,0 +1,69 @@
+Index: ../trunk-jpl/src/m/coordsystems/laea_inv.m
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/laea_inv.m	(nonexistent)
++++ ../trunk-jpl/src/m/coordsystems/laea_inv.m	(revision 26551)
+@@ -0,0 +1,63 @@
++function [lat,lon] = laea_inv(x,y,lat1,lon0,falseeasting,falsenorthing)
++% laea_inv performs an inverse Lambert Azimuthal Equal Area projection
++% for a simple spherical Earth of radius 6371000 meters. 
++% 
++%% Syntax 
++% 
++%  [lat,lon] = laea_inv(x,y,lat1,lon0)
++%  [lat,lon] = laea_inv(x,y,lat1,lon0,falseeasting,falsenorthing)
++% 
++%% Description 
++% 
++% [lat,lon] = laea_inv(x,y,lat1,lon0) transforms the coordinates x,y (in 
++% meters) into geographic coordinates lat,lon. Inputs lat1 and lon0 specify 
++% the origin.
++%
++% [lat,lon] = laea_inv(x,y,lat1,lon0,falseeasting,falsenorthing) also allows
++% inclusion of false eastings and northings in meters. 
++% 
++%% Author Info 
++% Function written by Chad A. Greene of NASA Jet Propulsion Laboratory. 
++% December 2020. 
++% Formulas taken directly from Snyder 1987's classic tome, "Map Projections 
++% A Working Manual" starting around page 185. 
++
++%% Parse inputs: 
++
++narginchk(4,6)
++assert(isequal(size(lat1),size(lon0),[1 1]),'Error: Inputs lat1 and lon0 must both be scalars.')
++assert(abs(lat1)<=90,'lat1 cannot exceed +/-90 degrees.') 
++assert(abs(lon0)<=360,'lon0 cannot exceed +/-360 degrees.') 
++assert(isequal(size(x),size(y)),'Dimensions of x and y must match.') 
++
++if nargin<5
++   falseeasting = 0; 
++   falsenorthing = 0; 
++end
++
++%% 
++% Projection formulas:
++% From Snyder 1987, MAP PROJECTIONS-A WORKING MANUAL, page 185: https://pubs.usgs.gov/pp/1395/report.pdf
++
++% Account for false easting, northing: 
++x = x - falseeasting; 
++y = y - falsenorthing; 
++
++% Define constants: 
++R = 6371000; % earth radius (meters) 
++rho = hypot(x,y); 
++c = 2*asind(rho./(2*R)); 
++
++% Unproject: 
++lat = asind(cosd(c) .* sind(lat1) + (y .* sind(c) .* cosd(lat1))./rho); 
++
++switch lon0
++   case 90
++      lon = lon0 + atand(-x./y);
++   case -90
++      lon = lon0 + atand(x./y); 
++   otherwise
++      lon = lon0 + atand((x .* sind(c))./(rho.*cosd(lat1) .*cosd(c) - y.*sind(lat1).*sind(c))); 
++end
++
++end
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26551-26552.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26551-26552.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26551-26552.diff	(revision 26740)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h	(revision 26551)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h	(revision 26552)
+@@ -160,6 +160,8 @@
+ 					_error_("unknown norm !");
+ 					break;
+ 			}
++
++			return 0.;
+ 		}
+ 		/*}}}*/
+ 		void GetSize(int* pM,int* pN){/*{{{*/
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 26551)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 26552)
+@@ -338,6 +338,8 @@
+ 					_error_("unknown norm !");
+ 					break;
+ 			}
++
++			return 0.;
+ 		}
+ 		/*}}}*/
+ 		void GetSize(int* pM,int* pN){/*{{{*/
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 26551)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 26552)
+@@ -361,6 +361,8 @@
+ 					_error_("unknown norm !");
+ 					break;
+ 			}
++
++			return 0.;
+ 		}
+ 		/*}}}*/
+ 		void GetSize(int* pM,int* pN){/*{{{*/
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 26551)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 26552)
+@@ -526,6 +526,7 @@
+ 					_error_("unknown norm !");
+ 					break;
+ 			}
++			return 0.;
+ 		}
+ 		/*}}}*/
+ 		void Scale(doubletype scale_factor){/*{{{*/
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26551)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 26552)
+@@ -264,6 +264,8 @@
+ 					_error_("unknown norm !");
+ 					break;
+ 			}
++
++			return 0.;
+ 		}
+ 		/*}}}*/
+ 		void Scale(doubletype scale_factor){/*{{{*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26552-26553.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26552-26553.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26552-26553.diff	(revision 26740)
@@ -0,0 +1,846 @@
+Index: ../trunk-jpl/src/m/classes/SMBautoregression.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBautoregression.py	(revision 26552)
++++ ../trunk-jpl/src/m/classes/SMBautoregression.py	(revision 26553)
+@@ -6,7 +6,7 @@
+ from WriteData import *
+ 
+ 
+-class SMBcomponents(object):
++class SMBautoregression(object):
+     """SMBAUTOREGRESSION class definition
+ 
+     Usage:
+@@ -21,9 +21,7 @@
+         self.ar_initialtime = 0
+         self.ar_timestep = 0
+         self.phi = np.nan
+-        self.covmat = np.nan
+         self.basin_id = np.nan
+-        self.randomflag = 1
+         self.steps_per_step = 1
+         self.averaging = 0
+         self.requested_outputs = []
+@@ -58,7 +56,6 @@
+ 
+     def setdefaultparameters(self): #{{{
+         self.ar_order = 0.0 # Autoregression model of order 0
+-        self.randomflag = 1
+     # }}}
+ 
+     def extrude(self, md):  # {{{
+@@ -86,9 +83,6 @@
+         if np.all(np.isnan(self.phi)):
+             self.phi = np.zeros((self.num_basins, self.ar_order)) # Autoregression model of order 0
+             print('      smb.phi (lag coefficients) not specified: order of autoregressive model set to 0')
+-        if np.all(np.isnan(self.covmat)):
+-            self.covmat = 1e-21 * np.eye(self.num_basins) # No stochasticity and no covariance
+-            print('      smb.covmat not specified: stochasticity set to 0')
+         return self
+     # }}}
+ 
+@@ -97,13 +91,11 @@
+             md = checkfield(md, 'fieldname', 'smb.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
+             md = checkfield(md, 'fieldname', 'smb.basin_id', 'Inf', 1, '>=', 0, '<=', md.smb.num_basins, 'size', [md.mesh.numberofelements])
+             md = checkfield(md, 'fieldname', 'smb.beta0', 'NaN', 1, 'Inf', 1, 'size', [1, md.smb.num_basins], 'numel', md.smb.num_basins) # Scheme fails if passed as column vector
+-            md = checkfield(md, 'fieldname', 'smb.beta1', 'NaN', 1, 'Inf', 1, 'size', [1, md.smb.num_basins], 'numel', md.smb.num_basins) # Scheme fails if passed as column vector
++            md = checkfield(md, 'fieldname', 'smb.beta1', 'NaN', 1, 'Inf', 1, 'size', [1, md.smb.num_basins], 'numel', md.smb.num_basins) # Scheme fails if passed as column vector; NOTE: As opposed to MATLAB implementation, pass list
+             md = checkfield(md, 'fieldname', 'smb.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
+             md = checkfield(md, 'fieldname', 'smb.ar_initialtime', 'numel', 1, 'NaN', 1, 'Inf', 1)
+             md = checkfield(md, 'fieldname', 'smb.ar_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
+             md = checkfield(md, 'fieldname', 'smb.phi', 'NaN', 1, 'Inf', 1, 'size', [md.smb.num_basins, md.smb.ar_order])
+-            md = checkfield(md, 'fieldname', 'smb.covmat', 'NaN', 1, 'Inf', 1, 'size', [md.smb.num_basins, md.smb.num_basins])
+-            md = checkfield(md, 'fieldname', 'smb.randomflag', 'numel', [1], 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+         md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
+         md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
+@@ -122,8 +114,6 @@
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'beta0', 'format', 'DoubleMat', 'name', 'md.smb.beta0', 'scale', 1 / yts, 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'beta1', 'format', 'DoubleMat', 'name', 'md.smb.beta1', 'scale', 1 / (yts ** 2), 'yts', yts)
+         WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'phi', 'format', 'DoubleMat', 'name', 'md.smb.phi', 'yts', yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'covmat', 'format', 'DoubleMat', 'name', 'md.smb.covmat', 'scale', 1 / (yts ** 2), 'yts', yts)
+-        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'randomflag', 'format', 'Boolean')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+         WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format', 'Integer')
+ 
+Index: ../trunk-jpl/src/m/classes/calvingvonmises.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/calvingvonmises.py	(revision 26552)
++++ ../trunk-jpl/src/m/classes/calvingvonmises.py	(revision 26553)
+@@ -1,22 +1,20 @@
++from checkfield import checkfield
+ from fielddisplay import fielddisplay
+-from checkfield import checkfield
+ from WriteData import WriteData
+ 
+ 
+ class calvingvonmises(object):
+-    """
+-    CALVINGVONMISES class definition
++    """CALVINGVONMISES class definition
+ 
+-       Usage:
+-          calvingvonmises = calvingvonmises()
++    Usage:
++        calvingvonmises = calvingvonmises()
+     """
+ 
+     def __init__(self):  # {{{
++        self.stress_threshold_groundedice = 0
++        self.stress_threshold_floatingice = 0
++        self.min_thickness = 0
+ 
+-        self.stress_threshold_groundedice = 0.
+-        self.stress_threshold_floatingice = 0.
+-        self.min_thickness = 0.
+-
+     #set defaults
+         self.setdefaultparameters()
+ 
+@@ -23,12 +21,11 @@
+     #}}}
+ 
+     def __repr__(self):  # {{{
+-        string = '   Calving VonMises parameters:'
+-        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
+-        string = "%s\n%s" % (string, fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed [m]'))
+-
+-        return string
++        s = '   Calving VonMises parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
++        s += '{}\n'.format(fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed [m]'))
++        return s
+     #}}}
+ 
+     def extrude(self, md):  # {{{
+@@ -36,18 +33,18 @@
+     #}}}
+ 
+     def setdefaultparameters(self):  # {{{
+-        #Default sigma max
++        # Default sigma max
+         self.stress_threshold_groundedice = 1e6
+         self.stress_threshold_floatingice = 150e3
+ 
+-        #turn off min_thickness by default.
++        # Turn off min_thickness by default
+         self.min_thickness = 0.
+         return self
+     #}}}
+ 
+     def checkconsistency(self, md, solution, analyses):  # {{{
+-        #Early return
+-        if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
++        # Early return
++        if solution == 'TransientSolution' or not md.transient.ismovingfront:
+             return
+ 
+         md = checkfield(md, 'fieldname', 'calving.stress_threshold_groundedice', '>', 0, 'nan', 1, 'Inf', 1)
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignot.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignot.py	(revision 26552)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignot.py	(revision 26553)
+@@ -1,3 +1,5 @@
++# -*- coding: utf-8 -*-
++
+ import numpy as np
+ 
+ from checkfield import checkfield
+@@ -6,7 +8,7 @@
+ 
+ 
+ class frontalforcingsrignot(object):
+-    """FRONTAL FORCINGS Rignot class definition
++    """FRONTALFORCINGSRIGNOT class definition
+ 
+     Usage:
+         frontalforcingsrignot = frontalforcingsrignot()
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m	(revision 26552)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m	(revision 26553)
+@@ -6,13 +6,13 @@
+ classdef frontalforcingsrignotautoregression
+ 	properties (SetAccess=public) 
+ 		num_basins           = 0;
+-      beta0                = NaN;
+-      beta1                = NaN;
+-      ar_order             = 0;
+-      ar_initialtime       = 0;
+-      ar_timestep          = 0;
+-      phi                  = NaN;
+-      basin_id             = NaN;
++		beta0                = NaN;
++		beta1                = NaN;
++		ar_order             = 0;
++		ar_initialtime       = 0;
++		ar_timestep          = 0;
++		phi                  = NaN;
++		basin_id             = NaN;
+ 		subglacial_discharge = NaN;
+ 	end
+ 	methods
+@@ -39,10 +39,10 @@
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+ 
+-			basin_id             = NaN;
+-			num_basins           = 0;
+-			subglacial_discharge = NaN;
+-			self.ar_order        = 0.0; %autoregression model of order 0
++			self.basin_id             = NaN;
++			self.num_basins           = 0;
++			self.subglacial_discharge = NaN;
++			self.ar_order             = 0.0; %autoregression model of order 0
+ 
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+@@ -51,7 +51,7 @@
+ 
+ 			md = checkfield(md,'fieldname','frontalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
+          md = checkfield(md,'fieldname','frontalforcings.basin_id','Inf',1,'>=',0,'<=',md.frontalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
+-			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
++			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'NaN',1,'Inf',1,'timeseries',1);
+ 			md = checkfield(md,'fieldname','frontalforcings.beta0','NaN',1,'Inf',1,'size',[1,md.frontalforcings.num_basins],'numel',md.frontalforcings.num_basins); 
+          md = checkfield(md,'fieldname','frontalforcings.beta1','NaN',1,'Inf',1,'size',[1,md.frontalforcings.num_basins],'numel',md.frontalforcings.num_basins); 
+          md = checkfield(md,'fieldname','frontalforcings.ar_order','numel',1,'NaN',1,'Inf',1,'>=',0);
+@@ -76,14 +76,14 @@
+ 			yts=md.constants.yts;
+ 			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',55,'format','Integer');
+ 			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','num_basins','format','Integer');
+-			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_order','format','Integer');
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_initialtime','format','Double','scale',yts);
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','ar_timestep','format','Double','scale',yts);
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','basin_id','data',self.basin_id-1,'name','md.frontalforcings.basin_id','format','IntMat','mattype',2); %0-indexed
+          WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta0','format','DoubleMat','name','md.frontalforcings.beta0');
+-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta1','format','DoubleMat','name','md.frontalforcings.beta1','scale',1./yts,'yts',md.constants.yts);
+-         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','phi','format','DoubleMat','name','md.frontalforcings.phi','yts',md.constants.yts);
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','beta1','format','DoubleMat','name','md.frontalforcings.beta1','scale',1./yts,'yts',yts);
++         WriteData(fid,prefix,'object',self,'class','frontalforcings','fieldname','phi','format','DoubleMat','name','md.frontalforcings.phi','yts',yts);
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.py	(nonexistent)
++++ ../trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.py	(revision 26553)
+@@ -0,0 +1,89 @@
++# -*- coding: utf-8 -*-
++
++import numpy as np
++
++from checkfield import checkfield
++from fielddisplay import fielddisplay
++from MatlabFuncs import *
++from WriteData import WriteData
++
++class frontalforcingsrignotautoregression(object):
++    """FRONTALFORCINGSRIGNOTAUTOREGRESSION class definition
++
++    Usage:
++        frontalforcingsrignotautoregression = frontalforcingsrignotautoregression()
++    """
++
++    def __init__(self, *args):  # {{{
++        self.num_basins = 0
++        self.beta0 = np.nan
++        self.beta1 = np.nan
++        self.ar_order = 0
++        self.ar_initialtime = 0
++        self.ar_timestep = 0
++        self.phi = np.nan
++        self.basin_id = np.nan
++        self.subglacial_discharge = np.nan
++
++        if len(args) == 0:
++            self.setdefaultparameters()
++        else:
++            error('constructor not supported')
++
++    def __repr__(self):  # {{{
++        s = '   Frontalforcings parameters:\n'
++        s += '{}\n'.format(fielddisplay(self, 'num_basins', 'number of different basins [unitless]'))
++        s += '{}\n'.format(fielddisplay(self, 'basin_id', 'basin number assigned to each element [unitless]'))
++        s += '{}\n'.format(fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m/d]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta0', 'basin-specific intercept values [°C]'))
++        s += '{}\n'.format(fielddisplay(self, 'beta1', 'basin-specific trend values [°C yr^(-1)]'))
++        s += '{}\n'.format(fielddisplay(self, 'ar_order', 'order of the autoregressive model [unitless]'))
++        s += '{}\n'.format(fielddisplay(self, 'ar_initialtime', 'initial time assumed in the autoregressive model parameterization [yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'ar_timestep', 'time resolution of the autoregressive model [yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'phi', 'basin-specific vectors of lag coefficients [unitless]'))
++        return s
++    #}}}
++
++    def setdefaultparameters(self):  # {{{
++        self.basin_id = np.nan
++        self.num_basins = 0
++        self.subglacial_discharge = np.nan
++        self.ar_order = 0.0 # Autoregression model of order 0
++        return self
++    #}}}
++
++    def checkconsistency(self, md, solution, analyses):  # {{{
++        # Early return
++        if not (solution == 'TransientSolution') or not md.transient.ismovingfront:
++            return md
++
++        md = checkfield(md, 'fieldname', 'frontalforcings.num_basins', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
++        md = checkfield(md, 'fieldname', 'frontalforcings.basin_id', 'Inf', 1, '>=', 0, '<=', md.frontalforcings.num_basins, 'size', [md.mesh.numberofelements])
++        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
++        md = checkfield(md, 'fieldname', 'frontalforcings.beta0', 'NaN', 1, 'Inf', 1, 'size', [1, md.frontalforcings.num_basins], 'numel', md.frontalforcings.num_basins)
++        md = checkfield(md, 'fieldname', 'frontalforcings.beta1', 'NaN', 1, 'Inf', 1, 'size', [1, md.frontalforcings.num_basins], 'numel', md.frontalforcings.num_basins)
++        md = checkfield(md, 'fieldname', 'frontalforcings.ar_order', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', 0)
++        md = checkfield(md, 'fieldname', 'frontalforcings.ar_initialtime', 'numel', 1, 'NaN', 1, 'Inf', 1)
++        md = checkfield(md, 'fieldname', 'frontalforcings.ar_timestep', 'numel', 1, 'NaN', 1, 'Inf', 1, '>=', md.timestepping.time_step) # Autoregression time step cannot be finer than ISSM timestep
++        md = checkfield(md, 'fieldname', 'frontalforcings.phi', 'NaN', 1, 'Inf', 1, 'size', [md.frontalforcings.num_basins, md.frontalforcings.ar_order])
++        return md
++    # }}}
++
++    def extrude(self, md):  # {{{
++        # Nothing for now
++        return self
++    # }}}
++
++    def marshall(self, prefix, md, fid):  # {{{
++        yts = md.constants.yts
++        WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 55, 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'num_basins', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ar_order', 'format', 'Integer')
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ar_initialtime', 'format', 'Double', 'scale', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'ar_timestep', 'format', 'Double', 'scale', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'basin_id', 'data', self.basin_id, 'name', 'md.frontalforcings.basin_id', 'format', 'IntMat', 'mattype', 2) # 0-indexed
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'beta0', 'format', 'DoubleMat', 'name', 'md.frontalforcings.beta0')
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'beta1', 'format', 'DoubleMat', 'name', 'md.frontalforcings.beta1', 'scale', 1 / yts, 'yts', yts)
++        WriteData(fid, prefix, 'object', self, 'class', 'frontalforcings', 'fieldname', 'phi', 'format', 'DoubleMat', 'name', 'md.frontalforcings.phi', 'yts', yts)
++    # }}}
+Index: ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26552)
++++ ../trunk-jpl/src/m/miscellaneous/MatlabFuncs.py	(revision 26553)
+@@ -51,6 +51,18 @@
+     return np.degrees(np.arctan2(Y, X))
+ # }}}
+ 
++def contains(str, pat):  #{{{
++    """function contains - Determine if pattern is in strings
++
++    Usage:
++        TF = contains(str, pat)
++
++    TODO:
++    - Implement 'IgnoreCase' option
++    """
++
++# }}}
++
+ def cosd(X):  # {{{
+     """function cosd - Cosine of argument in degrees
+ 
+@@ -141,8 +153,25 @@
+     return y
+ # }}}
+ 
++def intersect(A, B):  # {{{
++    """function intersect - Set intersection of two arrays
++
++    Usage:
++        C = intersect(A, B)
++
++    NOTE:
++    - Only the following functionality is currently implemented:
++        - C = intersect(A,B) returns the data common to both A and B, with no 
++        repetitions. C is in sorted order.
++
++    """
++    import numpy as np
++
++    return np.intersect1d(A, B)
++#}}}
++
+ def isa(A, dataType):  # {{{
+-    """FUNCTION ISA
++    """function isa
+ 
+     NOTE:
+     - Takes a type as its second argument (in contrast to the MATLAB function 
+@@ -217,6 +246,17 @@
+     return a % m
+ # }}}
+ 
++def numel(A):  # {{{
++    """function numel - Number of array elements
++
++    Usage:
++        n = numel(A))
++    """
++    import numpy as np
++
++    return np.size(A)
++# }}}
++
+ def pause(n):  # {{{
+     import time
+ 
+Index: ../trunk-jpl/src/m/solve/WriteData.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/WriteData.py	(revision 26552)
++++ ../trunk-jpl/src/m/solve/WriteData.py	(revision 26553)
+@@ -66,7 +66,12 @@
+             if np.ndim(data) > 1 and data.shape[0] == timeserieslength:
+                 #We scale everything but the last line that holds time
+                 data[:-1, :] = scale * data[:-1, :]
+-            else:
++            elif type(data) is list: # Deal with "TypeError: can't multiply sequence by non-int of type 'float'" for type list
++                scaleddata = []
++                for i in range(len(data)):
++                    scaleddata.append(scale * data[i])
++                data = scaleddata
++            else: #
+                 data = scale * data
+         if np.ndim(data) > 1 and data.shape[0] == timeserieslength:
+             yts = options.getfieldvalue('yts')
+Index: ../trunk-jpl/test/NightlyRun/runme.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.py	(revision 26552)
++++ ../trunk-jpl/test/NightlyRun/runme.py	(revision 26553)
+@@ -1,4 +1,11 @@
+ #!/usr/bin/env python
++#
++# NOTE: Switch to,
++#
++#   #!/usr/bin/python3
++#
++# when making Python 3 default
++#
+ import argparse
+ from glob import glob
+ import os
+Index: ../trunk-jpl/test/NightlyRun/test542.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test542.m	(revision 26552)
++++ ../trunk-jpl/test/NightlyRun/test542.m	(revision 26553)
+@@ -33,6 +33,7 @@
+         md.frontalforcings.thermalforcing(md.mesh.elements(elem,1:3)) = 1.5;
+     end
+ end
++
+ md.transient.ismovingfront = 1;
+ md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+ md.levelset.migration_max = 1e10;
+Index: ../trunk-jpl/test/NightlyRun/test542.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test542.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test542.py	(revision 26553)
+@@ -0,0 +1,91 @@
++#Test Name: PigTranFrontalforcingsrignot
++import numpy as np
++
++from calvingvonmises import *
++from frontalforcingsrignot import *
++from MatlabFuncs import *
++from model import *
++from parameterize import *
++from setflowequation import *
++from setmask import *
++from solve import *
++from triangle import *
++
++
++md = triangle(model(), '../Exp/Pig.exp', 10000)
++md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
++md = parameterize(md, '../Par/Pig.py')
++md = setflowequation(md, 'SSA', 'all')
++md.timestepping.time_step  = 2
++md.timestepping.final_time = 50
++
++# Separate domain in 2 basins
++idbasin = np.zeros((md.mesh.numberofelements,))
++iid1 = np.where(md.mesh.x <= -1.6e6)[0]
++for ii in range(md.mesh.numberofelements):
++    for vertex in range(3):
++        if md.mesh.elements[ii][vertex] - 1 in iid1: # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++            idbasin[ii] = 1
++    if idbasin[ii] == 0: # no vertex was found in basin 1
++        idbasin[ii] = 2
++
++# Calving and frontalforcings parameters
++md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
++md.calving = calvingvonmises()
++md.frontalforcings = frontalforcingsrignot()
++md.frontalforcings.num_basins = 2
++md.frontalforcings.basin_id = idbasin - 1 # NOTE: offset because of 1-based vertex indexing
++md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
++md.frontalforcings.thermalforcing = 0.5 * np.ones((md.mesh.numberofvertices,))
++for elem in range(md.mesh.numberofelements):
++    if idbasin[elem] == 2:
++        md.frontalforcings.thermalforcing[md.mesh.elements[elem, 0:3] - 1] = 1.5 # NOTE: offset because of 1-based vertex indexing
++
++md.transient.ismovingfront = 1
++md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
++md.levelset.migration_max = 1e10
++
++md.transient.requested_outputs = ['default', 'CalvingMeltingrate']
++md.cluster = generic('name', oshostname(), 'np', 2)
++md = solve(md, 'Transient')
++
++# Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1', 'CalvingMetlingRate1',
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2', 'CalvingMetlingRate2',
++    'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10', 'CalvingMetlingRate10'
++]
++field_tolerances = [
++    1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12, 1e-9,
++    2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11, 1e-9,
++    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9, 1e-9
++]
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Pressure,
++    md.results.TransientSolution[0].Base,
++    md.results.TransientSolution[0].Surface,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].MaskIceLevelset,
++    md.results.TransientSolution[0].CalvingMeltingrate,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Pressure,
++    md.results.TransientSolution[1].Base,
++    md.results.TransientSolution[1].Surface,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].MaskIceLevelset,
++    md.results.TransientSolution[1].CalvingMeltingrate,
++    md.results.TransientSolution[9].Vx,
++    md.results.TransientSolution[9].Vy,
++    md.results.TransientSolution[9].Vel,
++    md.results.TransientSolution[9].Pressure,
++    md.results.TransientSolution[9].Base,
++    md.results.TransientSolution[9].Surface,
++    md.results.TransientSolution[9].Thickness,
++    md.results.TransientSolution[9].MaskIceLevelset,
++    md.results.TransientSolution[9].CalvingMeltingrate
++]
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26552)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26553)
+@@ -41,7 +41,7 @@
+ 			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot]); %global covariance matrix
+ 			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
+ 
+-			%Check that all fields agree with the corresponding md class	
++			%Check that all fields agree with the corresponding md class
+ 			for field=self.fields
+ 				if(contains(field,'SMB'))
+ 					if~(isequal(class(md.smb),char(field)))
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26552)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26553)
+@@ -39,6 +39,7 @@
+     def setdefaultparameters(self):  # {{{
+         # Type of stabilization used
+         self.isstochasticforcing = 0 # stochasticforcing is turned off by default
++        self.fields              = [] # Need to initialize to list to avoid "RuntimeError: object of type 'float' has no len()" on import of class
+         self.randomflag          = 1 # true randomness is implemented by default
+         return self
+     #}}}
+@@ -75,26 +76,26 @@
+ 
+     def marshall(self, prefix, md, fid):  # {{{
+         yts = md.constants.yts
+-        if (type(self.fields) is list):
+-            num_fields = len(self.fields)
++        num_fields = len(self.fields)
++
++        WriteData(fid, prefix, 'object', self, 'fieldname', 'isstochasticforcing', 'format', 'Boolean')
++        if not self.isstochasticforcing:
++            return md
++        else:
+             # Scaling covariance matrix (scale column-by-column and row-by-row)
+             scaledfields = ['SMBautoregression'] # list of fields that need scaling * 1/yts
++            tempcovariance = self.covariance
+             for i in range(num_fields):
+                 if self.fields[i] in scaledfields:
+-                    inds = range(1 + np.sum(self.dimensions[0:i]), np.sum(self.dimensions[0:i]))
++                    inds = range(int(np.sum(self.dimensions[0:i])), int(np.sum(self.dimensions[0:i + 1])))
+                     for row in inds: # scale rows corresponding to scaled field
+-                        self.covariance[row, :] = 1 / yts * self.covariance[row, :]
++                        tempcovariance[row, :] = 1 / yts * self.covariance[row, :]
+                     for col in inds: # scale columns corresponding to scaled field
+-                        self.covariance[:, col] = 1 / yts * self.covariance[:, col]
+-
+-        WriteData(fid, prefix, 'object', self, 'fieldname', 'isstochasticforcing', 'format', 'Boolean')
+-        if not self.isstochasticforcing:
+-            return md
+-        else:
++                        tempcovariance[:, col] = 1 / yts * self.covariance[:, col]
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+             WriteData(fid, prefix, 'object', self, 'fieldname','dimensions', 'format', 'IntMat')
+-            WriteData(fid, prefix, 'object', self, 'fieldname', 'covariance', 'format', 'DoubleMat')
++            WriteData(fid, prefix, 'data', tempcovariance, 'name', 'md.stochasticforcing.covariance', 'format', 'DoubleMat')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
+     # }}}
+ 
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(revision 26552)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26553)
+@@ -4,7 +4,7 @@
+ md=parameterize(md,'../Par/SquareShelfConstrained.par');
+ md=setflowequation(md,'SSA','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+-md.transient.requested_outputs={'default','IceVolume','SmbMassBalance',};
++md.transient.requested_outputs={'default','IceVolume','SmbMassBalance'};
+ 
+ ymax = max(md.mesh.y);
+ xmax = max(md.mesh.x);
+@@ -65,17 +65,17 @@
+ 	(md.results.TransientSolution(1).Vel),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).IceVolume),...
+-   (md.results.TransientSolution(1).SmbMassBalance),...
++	(md.results.TransientSolution(1).SmbMassBalance),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vel),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).IceVolume),...
+-   (md.results.TransientSolution(2).SmbMassBalance),...
++	(md.results.TransientSolution(2).SmbMassBalance),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vel),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).IceVolume),...
+-   (md.results.TransientSolution(3).SmbMassBalance),...
++	(md.results.TransientSolution(3).SmbMassBalance),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test257.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test257.py	(revision 26553)
+@@ -0,0 +1,94 @@
++#Test Name: SquareShelfSMBautoregression
++from __future__ import division # TODO: Remove this import after ISSM is updated to use Python 3 by default
++
++import numpy as np
++
++from MatlabFuncs import *
++from model import *
++from parameterize import *
++from setflowequation import *
++from setmask import *
++from SMBautoregression import *
++from solve import *
++from triangle import *
++
++
++md = triangle(model(), '../Exp/Square.exp', 80000)
++md = setmask(md, 'all', '')
++md = parameterize(md, '../Par/SquareShelfConstrained.py')
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', oshostname(), 'np', 3)
++md.transient.requested_outputs = ['default', 'IceVolume', 'SmbMassBalance']
++
++ymax = max(md.mesh.y)
++xmax = max(md.mesh.x)
++# Generate basin IDs for 3 basins
++idbasin = np.zeros((md.mesh.numberofelements,))
++iid1 = np.where(md.mesh.y >= 2/3 * ymax)[0]
++iid2 = intersect(np.where(md.mesh.y < 2/3 * ymax)[0], np.where(md.mesh.x >= 1/3 * xmax)[0])
++iid3 = intersect(np.where(md.mesh.y < 2/3 * ymax)[0], np.where(md.mesh.x < 1/3 * xmax)[0])
++for ii in range(md.mesh.numberofelements):
++    for vertex in range(3):
++        if md.mesh.elements[ii][vertex] - 1 in iid1: # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++            idbasin[ii] = 1
++    if idbasin[ii] == 0: # no vertex was found in basin 1
++        for vertex in range(3):
++            if md.mesh.elements[ii][vertex] - 1 in iid2: # one vertex in basin 2; NOTE: offset because of 1-based vertex indexing
++                idbasin[ii] = 2
++    if idbasin[ii] == 0: # no vertex was found in basin 1 and 2
++        idbasin[ii] = 3
++
++# SMB parameters
++md.timestepping.start_time = 0
++md.timestepping.time_step  = 1
++md.timestepping.final_time = 5
++md.smb = SMBautoregression()
++md.smb.num_basins = 3 # number of basins
++md.smb.basin_id = idbasin - 1 # prescribe basin ID number to elements; # NOTE: offset because of 1-based vertex indexing
++md.smb.beta0 = np.array([[0.5, 1.2, 1.5]]) # intercept values of SMB in basins [m ice eq./yr]
++md.smb.beta1 = np.array([[0.0, 0.01, -0.01]]) # trend values of SMB in basins [m ice eq./yr^2]
++md.smb.ar_initialtime = md.timestepping.start_time
++md.smb.ar_order = 4
++md.smb.ar_timestep = 2.0 #timestep of the autoregressive model [yr]
++md.smb.phi = np.array([[0.2, 0.1, 0.05, 0.01], [0.4, 0.2, -0.2, 0.1], [0.4, -0.4, 0.1, -0.1]])
++
++# Stochastic forcing
++md.stochasticforcing.isstochasticforcing = 1
++md.stochasticforcing.fields = ['SMBautoregression']
++md.stochasticforcing.dimensions = [md.smb.num_basins] # dimension of each field
++md.stochasticforcing.covariance = np.array([[0.15, 0.08, -0.02], [0.08, 0.12, -0.05], [-0.02, -0.05, 0.1]]) # global covariance among- and between-fields
++md.stochasticforcing.randomflag = 0 # fixed random seeds
++
++md = solve(md, 'Transient')
++
++# Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Thickness1', 'Volume1', 'SmbMassBalance1',
++    'Vx2', 'Vy2', 'Vel2', 'Thickness2', 'Volume2', 'SmbMassBalance2',
++    'Vx3', 'Vy3', 'Vel3', 'Thickness3', 'Volume3', 'SmbMassBalance3'
++]
++field_tolerances = [
++    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13
++]
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].IceVolume,
++    md.results.TransientSolution[0].SmbMassBalance,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].IceVolume,
++    md.results.TransientSolution[1].SmbMassBalance,
++    md.results.TransientSolution[2].Vx,
++    md.results.TransientSolution[2].Vy,
++    md.results.TransientSolution[2].Vel,
++    md.results.TransientSolution[2].Thickness,
++    md.results.TransientSolution[2].IceVolume,
++    md.results.TransientSolution[2].SmbMassBalance
++]
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(revision 26552)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26553)
+@@ -39,7 +39,7 @@
+ md.stochasticforcing.isstochasticforcing = 1;
+ md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'}];
+ md.stochasticforcing.dimensions          = [md.frontalforcings.num_basins]; %dimension of each field
+-md.stochasticforcing.covariance          = 1e-4*[[1.5,0.5];[0.5,0.4]];; %global covariance among- and between-fields
++md.stochasticforcing.covariance          = 1e-4*[[1.5,0.5];[0.5,0.4]]; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %determines true/false randomness
+ 
+ md.transient.ismovingfront = 1;
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26553)
+@@ -0,0 +1,102 @@
++#Test Name: PigTranFrontalforcingsrignotautoregression
++import numpy as np
++
++from calvingvonmises import *
++from frontalforcingsrignotautoregression import *
++from MatlabFuncs import *
++from model import *
++from parameterize import *
++from setflowequation import *
++from setmask import *
++from solve import *
++from triangle import *
++
++
++md = triangle(model(), '../Exp/Pig.exp', 10000)
++md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
++md = parameterize(md, '../Par/Pig.py')
++md = setflowequation(md, 'SSA', 'all')
++md.timestepping.start_time = 0
++md.timestepping.time_step  = 1
++md.timestepping.final_time = 25
++
++# Separate domain in 2 basins
++idbasin = np.zeros((md.mesh.numberofelements,))
++iid1 = np.where(md.mesh.x <= -1.6e6)[0]
++for ii in range(md.mesh.numberofelements):
++    for vertex in range(3):
++        if md.mesh.elements[ii][vertex] - 1 in iid1: # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++            idbasin[ii] = 1
++    if idbasin[ii] == 0: # no vertex was found in basin 1
++        for vertex in range(3):
++            idbasin[ii] = 2
++
++# Calving and frontalforcings parameters
++md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
++md.calving = calvingvonmises()
++md.frontalforcings = frontalforcingsrignotautoregression()
++md.frontalforcings.num_basins = 2
++md.frontalforcings.basin_id = idbasin - 1 # NOTE: offset because of 1-based vertex indexing
++md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
++md.frontalforcings.beta0 = np.array([[0.05, 0.01]]) # intercept values of TF in basins [C]
++md.frontalforcings.beta1 = np.array([[0.001, 0.0001]]) # trend values of TF in basins [C/yr]
++md.frontalforcings.ar_initialtime = md.timestepping.start_time # initial time in the AR model parameterization [yr]
++md.frontalforcings.ar_order = 4
++md.frontalforcings.ar_timestep = 2 # timestep of the autoregressive model [yr]
++md.frontalforcings.phi = np.array([[0.1, -0.1, 0.01, -0.01], [0.2, -0.2, 0.1, 0.0]]) # autoregressive parameters
++
++# Stochastic forcing
++md.stochasticforcing.isstochasticforcing = 1
++md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression']
++md.stochasticforcing.dimensions = [md.frontalforcings.num_basins] # dimension of each field
++md.stochasticforcing.covariance = 1e-4 * np.array([[1.5, 0.5], [0.5, 0.4]]) # global covariance among- and between-fields
++md.stochasticforcing.randomflag = 0 # determines true/false randomness
++
++md.transient.ismovingfront = 1
++md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
++md.levelset.migration_max = 1e10
++
++md.transient.requested_outputs = ['default', 'CalvingMeltingrate']
++md.cluster = generic('name', oshostname(), 'np', 2)
++md = solve(md, 'Transient')
++
++# Fields and tolerances to track changes
++field_names = [
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1', 'CalvingMetlingRate1',
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2', 'CalvingMetlingRate2',
++    'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10', 'CalvingMetlingRate10'
++]
++field_tolerances = [
++    1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12, 1e-9,
++    2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11, 1e-9,
++    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9, 1e-9
++]
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Pressure,
++    md.results.TransientSolution[0].Base,
++    md.results.TransientSolution[0].Surface,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].MaskIceLevelset,
++    md.results.TransientSolution[0].CalvingMeltingrate,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Pressure,
++    md.results.TransientSolution[1].Base,
++    md.results.TransientSolution[1].Surface,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].MaskIceLevelset,
++    md.results.TransientSolution[1].CalvingMeltingrate,
++    md.results.TransientSolution[9].Vx,
++    md.results.TransientSolution[9].Vy,
++    md.results.TransientSolution[9].Vel,
++    md.results.TransientSolution[9].Pressure,
++    md.results.TransientSolution[9].Base,
++    md.results.TransientSolution[9].Surface,
++    md.results.TransientSolution[9].Thickness,
++    md.results.TransientSolution[9].MaskIceLevelset,
++    md.results.TransientSolution[9].CalvingMeltingrate
++]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26553-26554.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26553-26554.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26553-26554.diff	(revision 26740)
@@ -0,0 +1,173 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(nonexistent)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26554)
+@@ -0,0 +1,6 @@
++/*!\file: randomgenerator
++ * \brief random number generating functions
++ */
++
++#include <iostream>
++#include "./randomgenerator.h"
+
+Property changes on: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(nonexistent)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26554)
+@@ -0,0 +1,64 @@
++/*!\file: randomgenerator.h
++ * \brief prototypes for randomgenerator.h
++ */
++
++#ifndef _RANDOMGENERATOR_H_
++#define _RANDOMGENERATOR_H_
++
++#undef M_PI
++#define M_PI 3.141592653589793238462643
++
++class uniform_distribution_rnd
++{
++
++  private:
++    int a;
++    int c;
++    unsigned int m;
++    unsigned _seed;
++    double a1;
++    double a2;
++
++    int rnd_int() { return( _seed = ( a * _seed + c ) % m ); }
++
++  public:
++    uniform_distribution_rnd() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
++    uniform_distribution_rnd(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
++    void seed( unsigned int s ) { _seed = s; }
++    unsigned int get_seed() { return _seed; }
++    double rnd() { return (a2-a1)*(double) rnd_int()/ m + a1; }
++
++};
++
++class normal_distribution_rnd
++{
++
++  private:
++    unsigned _seed;
++    double mean;
++    double sdev;
++
++  public:
++    normal_distribution_rnd() : _seed( 0 ), mean( 0), sdev(1.0) {}
++    normal_distribution_rnd(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
++    void seed( unsigned int s ) { _seed = s; }
++    double rnd()
++    {
++      uniform_distribution_rnd unifdistri;
++      unifdistri.seed(_seed);
++
++      double u1 = unifdistri.rnd();
++      double u2 = unifdistri.rnd();
++
++      double R = sqrt(-2*log(u1));
++      double theta = 2*M_PI*u2;
++
++      seed(unifdistri.get_seed());
++
++      return mean + sdev * (R*cos(theta));
++
++    }
++
++};
++
++#endif //ifndef _RANDOMGENERATOR_H_
+
+Property changes on: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26553)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26554)
+@@ -7,40 +7,9 @@
+ #include "../shared/shared.h"
+ #include "../modules/modules.h"
+ #include "../analyses/analyses.h"
++#include "../shared/Random/randomgenerator.h"
+ #include <random>
+ 
+-#undef M_PI
+-#define M_PI 3.141592653589793238462643
+-
+-double lcg(long long* seed){/*{{{*/
+-
+-
+-	int N = 5;
+-	long long M = 1LL<<32;
+-	long long a = 1812433253;
+-	long long c = 1;
+-
+-	for(int i=0;i<N;i++){
+-		*seed = a * *seed + c;
+-		*seed = *seed%M;
+-	}
+-
+-  return ((double) *seed) / ((double) M);
+-
+-}
+-
+-double BoxMuller(long long* pseed){
+-
+-	double u1 = lcg(pseed);
+-	double u2 = lcg(pseed);
+-
+-	double R = sqrt(-2*log(u1));
+-	double theta = 2*M_PI*u2;
+-
+-	return R*cos(theta);
+-
+-}
+-
+ void GaussianVector(Vector<IssmDouble>* ppf,int seed){/*{{{*/
+ 
+ 
+@@ -48,6 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
++	normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -58,10 +28,8 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
++	distribution.seed(seed);
+ 
+-	long long seedbis;
+- 	seedbis  = (long long) seed;
+-
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+ 	ppf->GetLocalVector(&local_vector,&local_indices);
+@@ -69,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = BoxMuller(&seedbis);
++		rdnumber = distribution.rnd();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26554-26555.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26554-26555.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26554-26555.diff	(revision 26740)
@@ -0,0 +1,894 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26554)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26555)
+@@ -20,7 +20,6 @@
+ //#define FSANALYTICAL 10
+ //#define LATERALFRICTION 1
+ //#define DISCSLOPE 1 //testing for SSA
+-#define NOSPCSHEARVEL 1 //MLHO
+ 
+ /*Model processing*/
+ void StressbalanceAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+@@ -195,16 +194,10 @@
+ 				}
+ 			}
+ 			else{//MLHO 
+-				#ifdef NOSPCSHEARVEL	
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
+-				#else
+-				/*Default: apply spcs to shear vx and shear vy*/
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0);
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,1);
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,2);
+-				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,3);
+-				#endif
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx_base",StressbalanceAnalysisEnum,finiteelement,0);
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx_shear",StressbalanceAnalysisEnum,finiteelement,1);
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy_base",StressbalanceAnalysisEnum,finiteelement,2);
++				IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy_shear",StressbalanceAnalysisEnum,finiteelement,3);
+ 			}
+ 		}
+ 
+Index: ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.m
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.m	(nonexistent)
++++ ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.m	(revision 26555)
+@@ -0,0 +1,16 @@
++function md=SetMLHOBC(md)
++%SETMLHOBC - Create the boundary conditions for stressbalance for MLHO: VxBase, VyBase, VxShear, VyShear
++%
++%   Usage:
++%      md=SetMLHOBC(md)
++%
++
++
++%node on Dirichlet
++if md.flowequation.isMLHO
++	md.stressbalance.spcvx_base=md.stressbalance.spcvx;
++	md.stressbalance.spcvy_base=md.stressbalance.spcvy;
++
++	md.stressbalance.spcvx_shear=NaN*ones(size(md.stressbalance.spcvx_base));
++	md.stressbalance.spcvy_shear=NaN*ones(size(md.stressbalance.spcvy_base));
++end
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 26554)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 26555)
+@@ -61,10 +61,9 @@
+ 				if isfield(objstruct,'borderstokes'),  self.borderFS  = objstruct.borderstokes;   end; 
+ 			end
+ 
+-			%Oct 8 2020
+-			%Warning if MLHO
++			%Nov 6 2021
+ 			if any(self.vertex_equation==4)
+-				warning(['Monolayer Higher-Order (MLHO) detected in md.flowequation, this is probably a mistake, you need to run setflowequation again']);
++				disp(['Monolayer Higher-Order (MLHO) detected in md.flowequation, this is still under development. Please double check your settings.']);
+ 			end
+ 
+ 		end% }}}
+Index: ../trunk-jpl/src/m/classes/stressbalance.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.m	(revision 26554)
++++ ../trunk-jpl/src/m/classes/stressbalance.m	(revision 26555)
+@@ -7,6 +7,10 @@
+ 	properties (SetAccess=public)
+ 		spcvx                  = NaN;
+ 		spcvy                  = NaN;
++		spcvx_base             = NaN;
++		spcvy_base             = NaN;
++		spcvx_shear            = NaN;
++		spcvy_shear            = NaN;
+ 		spcvz                  = NaN;
+ 		restol                 = 0;
+ 		reltol                 = 0;
+@@ -31,6 +35,13 @@
+ 			self.referential=project3d(md,'vector',self.referential,'type','node');
+ 			self.loadingforce=project3d(md,'vector',self.loadingforce,'type','node');
+ 
++			% for MLHO
++			if md.flowequation.isMLHO
++				self.spcvx_base=project3d(md,'vector',self.spcvx_base,'type','node');
++				self.spcvy_base=project3d(md,'vector',self.spcvy_base,'type','node');
++				self.spcvx_shear=project3d(md,'vector',self.spcvx_shear,'type','poly','degree',4);
++				self.spcvy_shear=project3d(md,'vector',self.spcvy_shear,'type','poly','degree',4);
++			end
+ 		end % }}}
+ 		function self = stressbalance(varargin) % {{{
+ 			switch nargin
+@@ -122,6 +133,13 @@
+ 				end
+ 				md = checkfield(md,'fieldname','stressbalance.FSreconditioning','>',0);
+ 			end
++			% CHECK THIS ONLY WORKS FOR MLHO
++			if md.flowequation.isMLHO
++				md = checkfield(md,'fieldname','stressbalance.spcvx_base','Inf',1,'timeseries',1);
++				md = checkfield(md,'fieldname','stressbalance.spcvy_base','Inf',1,'timeseries',1);
++				md = checkfield(md,'fieldname','stressbalance.spcvx_shear','Inf',1,'timeseries',1);
++				md = checkfield(md,'fieldname','stressbalance.spcvy_shear','Inf',1,'timeseries',1);
++			end
+ 		end % }}}
+ 		function list=defaultoutputs(self,md) % {{{
+ 
+@@ -150,6 +168,12 @@
+ 			fielddisplay(self,'spcvy','y-axis velocity constraint (NaN means no constraint) [m/yr]');
+ 			fielddisplay(self,'spcvz','z-axis velocity constraint (NaN means no constraint) [m/yr]');
+ 
++			disp(sprintf('\n      %s','MLHO boundary conditions:'));
++			fielddisplay(self,'spcvx_base','x-axis basal velocity constraint (NaN means no constraint) [m/yr]');
++			fielddisplay(self,'spcvy_base','y-axis basal velocity constraint (NaN means no constraint) [m/yr]');
++			fielddisplay(self,'spcvx_shear','x-axis shear velocity constraint (NaN means no constraint) [m/yr]');
++			fielddisplay(self,'spcvy_shear','y-axis shear velocity constraint (NaN means no constraint) [m/yr]');
++
+ 			disp(sprintf('\n      %s','Rift options:'));
+ 			fielddisplay(self,'rift_penalty_threshold','threshold for instability of mechanical constraints');
+ 			fielddisplay(self,'rift_penalty_lock','number of iterations before rift penalties are locked');
+@@ -201,6 +225,13 @@
+ 				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+ 			end
+ 			WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray');
++			% for MLHO
++			if (md.flowequation.isMLHO)
++				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx_base','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy_base','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx_shear','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++				WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy_shear','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
++			end
+ 		end % }}}
+ 		function savemodeljs(self,fid,modelname) % {{{
+ 
+@@ -222,6 +253,10 @@
+ 			writejs2Darray(fid,[modelname '.stressbalance.loadingforce'],self.loadingforce);
+ 			writejscellstring(fid,[modelname '.stressbalance.requested_outputs'],self.requested_outputs);
+ 
++			writejs1Darray(fid,[modelname '.stressbalance.spcvx_base'],self.spcvx_shear);
++			writejs1Darray(fid,[modelname '.stressbalance.spcvy_base'],self.spcvy_shear);
++			writejs1Darray(fid,[modelname '.stressbalance.spcvx_shear'],self.spcvx_shear);
++			writejs1Darray(fid,[modelname '.stressbalance.spcvy_shear'],self.spcvy_shear);
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/stressbalance.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stressbalance.py	(revision 26554)
++++ ../trunk-jpl/src/m/classes/stressbalance.py	(revision 26555)
+@@ -19,6 +19,10 @@
+     def __init__(self):  # {{{
+         self.spcvx = np.nan
+         self.spcvy = np.nan
++        self.spcvx_base = np.nan
++        self.spcvy_base = np.nan
++        self.spcvx_shear = np.nan
++        self.spcvy_shear = np.nan
+         self.spcvz = np.nan
+         self.restol = 0
+         self.reltol = 0
+@@ -54,6 +58,11 @@
+         s += '{}\n'.format(fielddisplay(self, 'spcvy', 'y-axis velocity constraint (NaN means no constraint) [m / yr]'))
+         s += '{}\n'.format(fielddisplay(self, 'spcvz', 'z-axis velocity constraint (NaN means no constraint) [m / yr]'))
+         s += '{}\n'.format(fielddisplay(self, 'icefront', 'segments on ice front list (last column 0: Air, 1: Water, 2: Ice'))
++        s += '      MLHO boundary conditions:\n'
++        s += '{}\n'.format(fielddisplay(self, 'spcvx_base', 'x-axis basal velocity constraint (NaN means no constraint) [m / yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'spcvy_base', 'y-axis basal velocity constraint (NaN means no constraint) [m / yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'spcvx_shear', 'x-axis shear velocity constraint (NaN means no constraint) [m / yr]'))
++        s += '{}\n'.format(fielddisplay(self, 'spcvy_shear', 'y-axis shear velocity constraint (NaN means no constraint) [m / yr]'))
+         s += '      Rift options:\n'
+         s += '{}\n'.format(fielddisplay(self, 'rift_penalty_threshold', 'threshold for instability of mechanical constraints'))
+         s += '{}\n'.format(fielddisplay(self, 'rift_penalty_lock', 'number of iterations before rift penalties are locked'))
+@@ -76,6 +85,12 @@
+         self.referential = project3d(md, 'vector', self.referential, 'type', 'node')
+         self.loadingforce = project3d(md, 'vector', self.loadingforce, 'type', 'node')
+ 
++        if md.flowequation.isMLHO:
++            self.spcvx_base = project3d(md, 'vector', self.spcvx_base, 'type', 'node')
++            self.spcvy_base = project3d(md, 'vector', self.spcvy_base, 'type', 'node')
++            self.spcvx_shear = project3d(md, 'vector', self.spcvx_shear, 'type', 'poly', 'degree', 4)
++            self.spcvy_shear = project3d(md, 'vector', self.spcvy_shear, 'type', 'poly', 'degree', 4)
++
+         return self
+     # }}}
+ 
+@@ -160,6 +175,11 @@
+             pos = np.nonzero(np.logical_and(md.mask.ocean_levelset, md.mesh.vertexonbase))
+             if np.any(np.logical_not(np.isnan(md.stressbalance.referential[pos, :]))):
+                 md.checkmessage("no referential should be specified for basal vertices of grounded ice")
++        if md.flowequation.isMLHO:
++            md = checkfield(md, 'fieldname', 'stressbalance.spcvx_base', 'Inf', 1, 'timeseries', 1)
++            md = checkfield(md, 'fieldname', 'stressbalance.spcvy_base', 'Inf', 1, 'timeseries', 1)
++            md = checkfield(md, 'fieldname', 'stressbalance.spcvx_shear', 'Inf', 1, 'timeseries', 1)
++            md = checkfield(md, 'fieldname', 'stressbalance.spcvy_shear', 'Inf', 1, 'timeseries', 1)
+         return md
+     # }}}
+ 
+@@ -194,4 +214,10 @@
+             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')
++        # MLHO
++        if md.flowequation.isMLHO:
++            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx_base', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy_base', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx_shear', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
++            WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy_shear', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+     # }}}
+Index: ../trunk-jpl/src/m/extrusion/project3d.m
+===================================================================
+--- ../trunk-jpl/src/m/extrusion/project3d.m	(revision 26554)
++++ ../trunk-jpl/src/m/extrusion/project3d.m	(revision 26555)
+@@ -6,11 +6,12 @@
+ %   element vector of size (md.mesh.numberofelements2d,N/A). 
+ %   arguments: 
+ %      'vector': 2d vector
+-%      'type': 'element' or 'node'. 
++%      'type': 'element' or 'node' or 'poly'
+ %   options: 
+ %      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
+ %             value of the 2d vector.
+ %      'padding': default to 0 (value adopted by other 3d layers not being projected0
++%		 'degree': degree of polynomials when extrude from bottom to the top
+ %
+ %   Egs:
+ %      extruded_vector=project3d(md,'vector',vector2d,'type','node','layer',1,'padding',NaN);
+@@ -32,6 +33,7 @@
+ type         = getfieldvalue(options,'type');       %mandatory
+ layer        = getfieldvalue(options,'layer',0);    %optional (do all layers otherwise)
+ paddingvalue = getfieldvalue(options,'padding',0);  %0 by default
++polyexponent = getfieldvalue(options,'degree',0);   %0 by default, 0-degree polynomial
+ 
+ if length(vector2d)==1,
+ 	projected_vector=vector2d;
+@@ -79,6 +81,29 @@
+ 		projected_vector( ((layer-1)*md.mesh.numberofelements2d+1):(layer*md.mesh.numberofelements2d),:)=vector2d;
+ 	end
+ 
++elseif strcmpi(type,'poly'), % interpolate values from 0 to 1 with a polynomial degree n
++	%Initialize 3d vector
++	if size(vector2d,1)==md.mesh.numberofvertices2d
++		projected_vector=paddingvalue*ones(md.mesh.numberofvertices, size(vector2d,2));
++	elseif size(vector2d,1)==md.mesh.numberofvertices2d+1
++		projected_vector=paddingvalue*ones(md.mesh.numberofvertices+1,size(vector2d,2));
++		projected_vector(end,:)=vector2d(end,:);
++		vector2d=vector2d(1:end-1,:);
++	else
++		error('vector length not supported')
++	end
++
++	polycoeff = [0:1./(md.mesh.numberoflayers-1):1];
++
++	%Fill in
++	if layer==0,
++		for i=1:md.mesh.numberoflayers,
++			projected_vector(((i-1)*md.mesh.numberofvertices2d+1):(i*md.mesh.numberofvertices2d),:)=vector2d*(1-(1-polycoeff(i)).^polyexponent);
++		end
++	else
++		projected_vector(((layer-1)*md.mesh.numberofvertices2d+1):(layer*md.mesh.numberofvertices2d),:)=vector2d*(1-(1-polycoeff(layer)).^polyexponent);
++	end
++
+ else
+ 	error('project3d error message: unknown projection type');
+ end
+Index: ../trunk-jpl/test/NightlyRun/test127.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test127.m	(revision 26555)
+@@ -17,7 +17,7 @@
+ 	massfluxatgate('name','MassFlux5','profilename',['../Exp/MassFlux5.exp'],'definitionstring','Outputdefinition5'),...
+ 	massfluxatgate('name','MassFlux6','profilename',['../Exp/MassFlux6.exp'],'definitionstring','Outputdefinition6')...
+ 	};
+-
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test128.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test128.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test128.m	(revision 26555)
+@@ -6,6 +6,7 @@
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.transient.requested_outputs={'IceVolume','VxShear','VyShear','VxBase','VyBase','VxSurface','VySurface'};
+ 
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test128.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test128.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test128.py	(revision 26555)
+@@ -15,6 +15,7 @@
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.transient.requested_outputs = ['IceVolume','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase']
+ 
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test129.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test129.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test129.m	(revision 26555)
+@@ -13,6 +13,7 @@
+ md.timestepping.final_time=19;
+ md.settings.output_frequency=2;
+ 
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ md2=solve(md,'Transient','restart',1);
+ 
+Index: ../trunk-jpl/test/NightlyRun/test129.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test129.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test129.py	(revision 26555)
+@@ -22,6 +22,7 @@
+ # time steps and resolution
+ md.timestepping.final_time = 19
+ md.settings.output_frequency = 2
++md = SetMLHOBC(md);
+ 
+ md = solve(md, 'Transient')
+ md2 = copy.deepcopy(md)
+Index: ../trunk-jpl/test/NightlyRun/test248.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test248.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test248.m	(revision 26555)
+@@ -5,6 +5,7 @@
+ md=setflowequation(md,'MLHO','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test248.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test248.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test248.py	(revision 26555)
+@@ -15,6 +15,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test249.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test249.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test249.m	(revision 26555)
+@@ -6,6 +6,7 @@
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.transient.requested_outputs={'default','FloatingArea','GroundedArea','TotalGroundedBmb','TotalFloatingBmb'};
+ md.basalforcings.floatingice_melting_rate(:)=1;
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test249.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test249.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test249.py	(revision 26555)
+@@ -16,6 +16,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.transient.requested_outputs = ['default', 'FloatingArea', 'GroundedArea', 'TotalFloatingBmb', 'TotalGroundedBmb']
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ 
+Index: ../trunk-jpl/test/NightlyRun/test254.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test254.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test254.m	(revision 26555)
+@@ -57,6 +57,7 @@
+ md.mask.ice_levelset=-1+nodeonicefront;
+ 
+ md.stressbalance.requested_outputs={'default','VySurface','VyShear','VyBase'};
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
+Index: ../trunk-jpl/test/NightlyRun/test254.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test254.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test254.py	(revision 26555)
+@@ -69,6 +69,7 @@
+ md.mask.ice_levelset = -1 + nodeonicefront
+ 
+ md.stressbalance.requested_outputs = ['default', 'VySurface', 'VyShear', 'VyBase']
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ # create analytical solution: strain rate is constant = ((rho_ice * g * h) / 4B)^3 (Paterson, 4th Edition, page 292.
+Index: ../trunk-jpl/test/NightlyRun/test255.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test255.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test255.m	(revision 26555)
+@@ -5,6 +5,7 @@
+ md=setflowequation(md,'MLHO','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.masstransport.hydrostatic_adjustment='Incremental';
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test255.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test255.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test255.py	(revision 26555)
+@@ -14,6 +14,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.masstransport.hydrostatic_adjustment = 'Incremental'
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test256.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test256.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test256.m	(revision 26555)
+@@ -6,6 +6,7 @@
+ md.geometry.base=md.geometry.base+50.; md.geometry.surface=md.geometry.surface+50.;
+ md.cluster=generic('name',oshostname(),'np',1);
+ md.masstransport.hydrostatic_adjustment='Incremental';
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test256.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test256.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test256.py	(revision 26555)
+@@ -16,6 +16,7 @@
+ md.geometry.surface = md.geometry.surface + 50.
+ md.cluster = generic('name', gethostname(), 'np', 1)
+ md.masstransport.hydrostatic_adjustment = 'Incremental'
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test330.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test330.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test330.m	(revision 26555)
+@@ -5,6 +5,7 @@
+ md=setflowequation(md,'MLHO','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test330.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test330.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test330.py	(revision 26555)
+@@ -14,6 +14,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test332.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test332.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test332.m	(revision 26555)
+@@ -4,6 +4,7 @@
+ md=parameterize(md,'../Par/SquareSheetConstrained.par');
+ md=setflowequation(md,'MLHO','all');
+ md.cluster=generic('name',oshostname(),'np',3);
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test332.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test332.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test332.py	(revision 26555)
+@@ -13,6 +13,7 @@
+ md = parameterize(md, '../Par/SquareSheetConstrained.py')
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test333.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test333.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test333.m	(revision 26555)
+@@ -18,6 +18,7 @@
+ md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
+ 
+ md.cluster=generic('name',oshostname(),'np',3);
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test333.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test333.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test333.py	(revision 26555)
+@@ -31,6 +31,7 @@
+ md.inversion.vy_obs = md.initialization.vy
+ 
+ md.cluster = generic('name', gethostname(), 'np', 3)
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test334.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test334.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test334.m	(revision 26555)
+@@ -19,6 +19,7 @@
+ md.verbose.control=true;
+ 
+ md.cluster=generic('name',oshostname(),'np',3);
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test334.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test334.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test334.py	(revision 26555)
+@@ -31,6 +31,7 @@
+ 
+ 
+ md.cluster = generic('name', gethostname(), 'np', 3)
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ 
+Index: ../trunk-jpl/test/NightlyRun/test335.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test335.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test335.m	(revision 26555)
+@@ -6,6 +6,7 @@
+ md = extrude(md, 5, 1);
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test335.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test335.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test335.py	(revision 26555)
+@@ -12,6 +12,7 @@
+ md = setmask(md, '', '')
+ md = parameterize(md, '../Par/SquareSheetConstrained.py')
+ md = setflowequation(md, 'MLHO', 'all')
++md = SetMLHOBC(md);
+ md.extrude(5, 1.)
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+Index: ../trunk-jpl/test/NightlyRun/test446.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test446.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test446.m	(revision 26555)
+@@ -5,6 +5,7 @@
+ md=setflowequation(md,'MLHO','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test446.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test446.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test446.py	(revision 26555)
+@@ -14,6 +14,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test447.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test447.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test447.m	(revision 26555)
+@@ -15,6 +15,7 @@
+ md=setflowequation(md,'MLHO','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.transient.requested_outputs={'default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb'};
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test447.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test447.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test447.py	(revision 26555)
+@@ -26,6 +26,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test448.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test448.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test448.m	(revision 26555)
+@@ -24,6 +24,7 @@
+ md.transient.isstressbalance=1;
+ md.transient.isgroundingline=1;
+ 
++md=SetMLHOBC(md);
+ %test different grounding line dynamics.
+ md.groundingline.migration='AggressiveMigration';
+ md=solve(md,'Transient');
+Index: ../trunk-jpl/test/NightlyRun/test448.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test448.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test448.py	(revision 26555)
+@@ -37,6 +37,7 @@
+ 
+ #test different grounding line dynamics.
+ md.groundingline.migration = 'AggressiveMigration'
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ element_on_iceshelf_agressive = md.results.TransientSolution[0].MaskOceanLevelset
+ vel_agressive = md.results.TransientSolution[0].Vel
+Index: ../trunk-jpl/test/NightlyRun/test449.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test449.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test449.m	(revision 26555)
+@@ -44,6 +44,7 @@
+ md.timestepping.time_step=10;
+ 
+ md.cluster=generic('name',oshostname(),'np',3);
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test449.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test449.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test449.py	(revision 26555)
+@@ -55,6 +55,7 @@
+ md.timestepping.time_step = 10
+ 
+ md.cluster = generic('name', gethostname(), 'np', 3)
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ #print md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate
+ #print md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate
+Index: ../trunk-jpl/test/NightlyRun/test518.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test518.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test518.m	(revision 26555)
+@@ -5,6 +5,7 @@
+ md=setflowequation(md,'MLHO','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.stressbalance.requested_outputs={'default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase'};
++md=SetMLHOBC(md);
+ md=solve(md,'Stressbalance');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test518.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test518.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test518.py	(revision 26555)
+@@ -14,6 +14,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test519.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test519.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test519.m	(revision 26555)
+@@ -8,6 +8,7 @@
+ [md.mesh.lat,md.mesh.long] = xy2ll(md.mesh.x,md.mesh.y,-1);
+ md.mesh.scale_factor=0.9*ones(md.mesh.numberofvertices,1);
+ md.transient.requested_outputs={'default','IceVolume','IceVolumeScaled','GroundedArea','GroundedAreaScaled','FloatingArea','FloatingAreaScaled','TotalSmb','TotalSmbScaled','TotalFloatingBmb','TotalFloatingBmbScaled'};
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test519.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test519.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test519.py	(revision 26555)
+@@ -15,6 +15,7 @@
+ md.mesh.scale_factor = 0.9 * np.ones((md.mesh.numberofvertices))
+ md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeScaled', 'GroundedArea', 'GroundedAreaScaled', 'FloatingArea', 'FloatingAreaScaled', 'TotalSmb', 'TotalSmbScaled', 'TotalFloatingBmb', 'TotalFloatingBmbScaled']
+ md.cluster = generic('name', gethostname(), 'np', 3)
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ # Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test810.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test810.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test810.m	(revision 26555)
+@@ -14,6 +14,7 @@
+ md.transient.isthermal=0;
+ md.transient.isgroundingline=1;
+ 
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test810.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test810.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test810.py	(revision 26555)
+@@ -21,6 +21,7 @@
+ md.transient.issmb = True
+ md.transient.isthermal = False
+ md.transient.isgroundingline = True
++md = SetMLHOBC(md);
+ 
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test811.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test811.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test811.m	(revision 26555)
+@@ -17,6 +17,7 @@
+ md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+ md.levelset.migration_max = 1e10;
+ 
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test811.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test811.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test811.py	(revision 26555)
+@@ -27,6 +27,7 @@
+ md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+ md.levelset.migration_max = 1e10
+ 
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test812.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test812.m	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test812.m	(revision 26555)
+@@ -34,6 +34,7 @@
+ 
+ md.transient.requested_outputs={'default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate'};
+ 
++md=SetMLHOBC(md);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test812.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test812.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test812.py	(revision 26555)
+@@ -43,6 +43,7 @@
+ 
+ md.transient.requested_outputs = ['default', 'StrainRateparallel', 'StrainRateperpendicular', 'Calvingratex', 'Calvingratey', 'CalvingCalvingrate']
+ 
++md = SetMLHOBC(md);
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py	(nonexistent)
++++ ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py	(revision 26555)
+@@ -0,0 +1,21 @@
++import os
++import MatlabFuncs as m
++
++
++def SetMLHOBC(md):
++    """
++    SETMLHOBC - Create the boundary conditions for stressbalance for MLHO: VxBase, VyBase, VxShear, VyShear
++
++       Usage:
++          md = SetIceShelfBC(md, varargin)
++
++       Example:
++          md = SetIceShelfBC(md)
++
++    """
++
++    #node on Dirichlet (boundary and ~icefront)
++    md.stressbalance.spcvx_base = md.stressbalance.spcvx
++    md.stressbalance.spcvy_base = md.stressbalance.spcvy
++    md.stressbalance.spcvx_shear = float('nan') * md.stressbalance.spcvx
++    md.stressbalance.spcvy_shear = float('nan') * md.stressbalance.spcvy 
+Index: ../trunk-jpl/src/m/extrusion/project3d.py
+===================================================================
+--- ../trunk-jpl/src/m/extrusion/project3d.py	(revision 26554)
++++ ../trunk-jpl/src/m/extrusion/project3d.py	(revision 26555)
+@@ -14,7 +14,7 @@
+ 
+         arguments:
+             'vector': 2d vector
+-            'type': 'element' or 'node'
++            'type': 'element' or 'node' or 'poly'
+ 
+         options:
+             'layer'     a layer number where vector should keep its values. If 
+@@ -22,6 +22,7 @@
+                         vector.
+             'padding':  default to 0 (value adopted by other 3d layers not 
+                         being projected.
++            'degree':   degree of polynomials when extrude from bottom to the top
+ 
+         Examples:
+             extruded_vector = project3d(md, 'vector', vector2d, 'type', 'node', 'layer', 1, 'padding', NaN)
+@@ -41,6 +42,7 @@
+     vectype = options.getfieldvalue('type')  #mandatory
+     layer = options.getfieldvalue('layer', 0)  #optional (do all layers otherwise)
+     paddingvalue = options.getfieldvalue('padding', 0)  #0 by default
++    polyexponent = options.getfieldvalue('degree', 0)  #0 by default, 0-degree polynomial
+ 
+     #Handle special case where vector2d is single element (differs from representation in MATLAB)
+     if isinstance(vector2d, (bool, int, float)):
+@@ -114,6 +116,37 @@
+                     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() == 'poly':
++        #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*(1.0-(1.0-i/(md.mesh.numberoflayers - 1.0))**polyexponent)
++            else:
++                projected_vector[((layer - 1) * md.mesh.numberofelements2d):(layer * md.mesh.numberofelements2d)] = vector2d*(1.0-(1.0-layer/(md.mesh.numberoflayers - 1.0))**polyexponent)
++        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*(1.0-(1.0-i/(md.mesh.numberoflayers - 1.0))**polyexponent)
++            else:
+ 
+     else:
+         raise TypeError("project3d error message: unknown projection type")
+Index: ../trunk-jpl/test/NightlyRun/test127.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.py	(revision 26554)
++++ ../trunk-jpl/test/NightlyRun/test127.py	(revision 26555)
+@@ -24,7 +24,7 @@
+                                    massfluxatgate('name', 'MassFlux4', 'profilename', '../Exp/MassFlux4.exp', 'definitionstring', 'Outputdefinition4'),
+                                    massfluxatgate('name', 'MassFlux5', 'profilename', '../Exp/MassFlux5.exp', 'definitionstring', 'Outputdefinition5'),
+                                    massfluxatgate('name', 'MassFlux6', 'profilename', '../Exp/MassFlux6.exp', 'definitionstring', 'Outputdefinition6')]
+-
++md = SetMLHOBC(md);
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
Index: /issm/oecreview/Archive/25834-26739/ISSM-26555-26556.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26555-26556.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26555-26556.diff	(revision 26740)
@@ -0,0 +1,955 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 26555)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 26556)
+@@ -966,6 +966,21 @@
+ 
+ 	dnl CoDiPack libraries and header files
+ 	if test "x${HAVE_CODIPACK}" == "xyes"; then
++
++		AC_MSG_CHECKING(for CoDiPack version)
++		CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
++		CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi.hpp | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
++		if test -z "${CODIPACK_MAJOR}"; then
++			 CODIPACK_MAJOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MAJOR_VERSION" | sed 's/#define CODI_MAJOR_VERSION//' | sed 's/ //g'`
++			 CODIPACK_MINOR=`cat ${CODIPACK_ROOT}/include/codi/configure.h | grep "#define CODI_MINOR_VERSION" | sed 's/#define CODI_MINOR_VERSION//' | sed 's/ //g'`
++		fi
++		if test -z "${CODIPACK_MAJOR}"; then
++			AC_MSG_ERROR([Couldn't determine CoDiPack version])
++		fi
++		AC_DEFINE_UNQUOTED([_CODIPACK_MAJOR_], ${CODIPACK_MAJOR}, [CoDiPack version major])
++		AC_DEFINE_UNQUOTED([_CODIPACK_MINOR_], ${CODIPACK_MINOR}, [CoDiPack version minor])
++		AC_MSG_RESULT([${CODIPACK_MAJOR}.${CODIPACK_MINOR}])
++
+ 		CODIPACKINCL="-I${CODIPACK_ROOT}/include"
+ 		AC_DEFINE([_HAVE_CODIPACK_], [1], [with CoDiPack in ISSM src])
+ 		AC_DEFINE([_HAVE_AD_], [1], [with AD in ISSM src])
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 26556)
+@@ -2298,8 +2298,14 @@
+ 			dependents=xNew<IssmPDouble>(num_dependents);
+ 
+ 			#if defined(_HAVE_CODIPACK_)
++			#if _CODIPACK_MAJOR_==2
+ 			auto& tape_codi = IssmDouble::getTape();
++			#elif _CODIPACK_MAJOR_==1
++			auto& tape_codi = IssmDouble::getGlobalTape();
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
+ 			#endif
++			#endif
+ 
+ 			/*Go through our dependent variables, and compute the response:*/
+ 			int i = 0;
+@@ -2310,7 +2316,13 @@
+ 					#if defined(_HAVE_CODIPACK_)
+ 						tape_codi.registerOutput(output_value);
+ 						dependents[i] = output_value.getValue();
++						#if _CODIPACK_MAJOR_==2
+ 						codi_global.output_indices.push_back(output_value.getIdentifier());
++						#elif _CODIPACK_MAJOR_==1
++						codi_global.output_indices.push_back(output_value.getGradientData());
++						#else
++						#error "_CODIPACK_MAJOR_ not supported"
++						#endif
+ 					#else
+ 						output_value>>=dependents[i];
+ 					#endif
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 26556)
+@@ -2062,9 +2062,18 @@
+ 			} else {
+ 				scalar=pscalar;
+ 			}
++			#if _CODIPACK_MAJOR_==2
+ 			auto& tape_codi = IssmDouble::getTape();
+ 			tape_codi.registerInput(scalar);
+ 			codi_global.input_indices.push_back(scalar.getIdentifier());
++			#elif _CODIPACK_MAJOR_==1
++			auto& tape_codi = IssmDouble::getGlobalTape();
++			tape_codi.registerInput(scalar);
++			codi_global.input_indices.push_back(scalar.getGradientData());
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
++
+ 		#else
+ 			if(X){
+ 				scalar<<=X[Xcount];
+@@ -2135,12 +2144,26 @@
+ 			  If we have been supplied an X vector, use it instead of what we just read: */
+ 			#if defined(_HAVE_CODIPACK_)
+ 				// FIXME codi here we just assign instead of using "operator <<="
++				#if _CODIPACK_MAJOR_==2
+ 				auto& tape_codi = IssmDouble::getTape();
++				#elif _CODIPACK_MAJOR_==1
++				auto& tape_codi = IssmDouble::getGlobalTape();
++				#else
++				#error "_CODIPACK_MAJOR_ not supported"
++				#endif
++
+ 				if(X){
+ 					for (int i=0;i<M*N;i++) {
+ 						matrix[i]=X[Xcount+i];
+ 						tape_codi.registerInput(matrix[i]);
++						#if _CODIPACK_MAJOR_==2
+ 						codi_global.input_indices.push_back(matrix[i].getIdentifier());
++						#elif _CODIPACK_MAJOR_==1
++						codi_global.input_indices.push_back(matrix[i].getGradientData());
++						#else
++						#error "_CODIPACK_MAJOR_ not supported"
++						#endif
++
+ 					}
+ 				}
+ 				else{
+@@ -2147,7 +2170,13 @@
+ 					for (int i=0;i<M*N;i++) {
+ 						matrix[i]=buffer[i];
+ 						tape_codi.registerInput(matrix[i]);
++						#if _CODIPACK_MAJOR_==2
+ 						codi_global.input_indices.push_back(matrix[i].getIdentifier());
++						#elif _CODIPACK_MAJOR_==1
++						codi_global.input_indices.push_back(matrix[i].getGradientData());
++						#else
++						#error "_CODIPACK_MAJOR_ not supported"
++						#endif
+ 					}
+ 				}
+ 			#else /*ADOLC*/
+@@ -2960,7 +2989,14 @@
+ 		 * - ADOL-C variant sets a garbage collection parameter for its tape
+ 		 * -> These parameters are not read for the CoDiPack ISSM version!
+ 		 */
++		#if _CODIPACK_MAJOR_==2
+ 		auto& tape_codi = IssmDouble::getTape();
++		#elif _CODIPACK_MAJOR_==1
++		auto& tape_codi = IssmDouble::getGlobalTape();
++		#else
++		#error "_CODIPACK_MAJOR_ not supported"
++		#endif
++
+ 		tape_codi.setActive();
+ 		#if _AD_TAPE_ALLOC_
+ 		//alloc_profiler.Tag(StartInit, true);
+Index: ../trunk-jpl/src/c/cores/ad_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/ad_core.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/cores/ad_core.cpp	(revision 26556)
+@@ -325,7 +325,14 @@
+ 			if(VerboseAutodiff())_printf0_("   start CoDiPack ad core\n");
+ 
+ 			/*First, stop tracing: */
++			#if _CODIPACK_MAJOR_==2
+ 			auto& tape_codi = IssmDouble::getTape();
++			#elif _CODIPACK_MAJOR_==1
++			auto& tape_codi = IssmDouble::getGlobalTape();
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
++
+ 			tape_codi.setPassive();
+ 
+ 			if(VerboseAutodiff()){ /*{{{*/
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 26556)
+@@ -49,7 +49,14 @@
+ 		 * - ADOL-C variant sets a garbage collection parameter for its tape
+ 		 * -> These parameters are not read for the CoDiPack ISSM version!
+ 		 */
++		#if _CODIPACK_MAJOR_==2
+ 		auto& tape_codi = IssmDouble::getTape();
++		#elif _CODIPACK_MAJOR_==1
++		auto& tape_codi = IssmDouble::getGlobalTape();
++		#else
++		#error "_CODIPACK_MAJOR_ not supported"
++		#endif
++
+ 		tape_codi.setActive();
+ 		#if _AD_TAPE_ALLOC_
+ 		//alloc_profiler.Tag(StartInit, true);
+@@ -126,13 +133,27 @@
+ 		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
+ 		#endif
+ 		std::stringstream out_s;
++		#if _CODIPACK_MAJOR_==2
+ 		IssmDouble::getTape().printStatistics(out_s);
++		#elif _CODIPACK_MAJOR_==1
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		#else
++		#error "_CODIPACK_MAJOR_ not supported"
++		#endif
+ 		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
+ 		#endif
+ 	} /*}}}*/
+ 
+ 	#elif defined(_HAVE_CODIPACK_)
++
++	#if _CODIPACK_MAJOR_==2
+ 	auto& tape_codi = IssmDouble::getTape();
++	#elif _CODIPACK_MAJOR_==1
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
++
+ 	tape_codi.setPassive();
+ 	if(VerboseAutodiff()){
+ 		int my_rank=IssmComm::GetRank();
+@@ -190,13 +211,28 @@
+ 	/*{{{*/
+ 	simul_starttrace2(femmodel);
+ 	IssmDouble* aX=xNew<IssmDouble>(n);
++
++	#if _CODIPACK_MAJOR_==2
+ 	auto& tape_codi = IssmDouble::getTape();
++	#elif _CODIPACK_MAJOR_==1
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
++
+ 	codi_global.input_indices.clear();
+ 	if(my_rank==0){
+ 		for (int i=0;i<n;i++) {
+ 			aX[i]=X0[i];
+ 			tape_codi.registerInput(aX[i]);
++			#if _CODIPACK_MAJOR_==2
+ 			codi_global.input_indices.push_back(aX[i].getIdentifier());
++			#elif _CODIPACK_MAJOR_==1
++			codi_global.input_indices.push_back(aX[i].getGradientData());
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
++
+ 		}
+ 	}
+ 	SetControlInputsFromVectorx(femmodel,aX);
+@@ -230,7 +266,14 @@
+ 		if(my_rank==0) {
+ 			tape_codi.registerOutput(output_value);
+ 			dependents[i] = output_value.getValue();
++			#if _CODIPACK_MAJOR_==2
+ 			codi_global.output_indices.push_back(output_value.getIdentifier());
++			#elif _CODIPACK_MAJOR_==1
++			codi_global.output_indices.push_back(output_value.getGradientData());
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
++
+ 			J+=output_value;
+ 		}
+ 	}
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 26556)
+@@ -378,7 +378,13 @@
+ 	delete hdl_countdoubles;
+ 
+ 	/*Start tracing*/
++	#if _CODIPACK_MAJOR_==2
+ 	auto& tape_codi = IssmDouble::getTape();
++	#elif _CODIPACK_MAJOR_==1
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
+ 	tape_codi.setActive();
+ 
+ 	/*Reverse dependent (f)*/
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp	(revision 26556)
+@@ -75,7 +75,14 @@
+ 	this->double_count = 0;
+ 	this->identifiers  = identifiers_in;
+ 	this->size_max         = size_max_in;
++	#if _CODIPACK_MAJOR_==2
+ 	this->tape_codi    = &(IssmDouble::getTape());
++	#elif _CODIPACK_MAJOR_==1
++	this->tape_codi    = &(IssmDouble::getGlobalTape());
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
++
+ }/*}}}*/
+ void RegisterInputFunctor::Echo(void){/*{{{*/
+ 	printf("RegisterInputFunctor Echo:\n");
+@@ -85,7 +92,14 @@
+ 	_assert_(this->double_count<size_max);
+ 	_assert_(!xIsNan<IssmDouble>(value));
+ 	this->tape_codi->registerInput(value);
++	#if _CODIPACK_MAJOR_==2
+ 	this->identifiers[this->double_count] = value.getIdentifier();
++	#elif _CODIPACK_MAJOR_==1
++	this->identifiers[this->double_count] = value.getGradientData();
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
++
+ 	this->double_count++;
+ }/*}}}*/
+ void RegisterInputFunctor::call(IssmDouble* & value,int size){/*{{{*/
+@@ -94,7 +108,14 @@
+ 			_assert_(this->double_count<size_max);
+ 			_assert_(!xIsNan<IssmDouble>(value[i]));
+ 			this->tape_codi->registerInput(value[i]);
++			#if _CODIPACK_MAJOR_==2
+ 			this->identifiers[this->double_count] = value[i].getIdentifier();
++			#elif _CODIPACK_MAJOR_==1
++			this->identifiers[this->double_count] = value[i].getGradientData();
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
++
+ 			this->double_count++;
+ 		}
+ 	}
+@@ -102,7 +123,13 @@
+ 
+ RegisterOutputFunctor::RegisterOutputFunctor(void) : MarshallHandle(AD_REGISTEROUTPUT){/*{{{*/
+ 	this->double_count = 0;
++	#if _CODIPACK_MAJOR_==2
+ 	this->tape_codi    = &(IssmDouble::getTape());
++	#elif _CODIPACK_MAJOR_==1
++	this->tape_codi    = &(IssmDouble::getGlobalTape());
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
+ }/*}}}*/
+ void RegisterOutputFunctor::Echo(void){/*{{{*/
+ 	printf("RegisterOutputFunctor Echo:\n");
+@@ -125,9 +152,15 @@
+ 
+ SetAdjointFunctor::SetAdjointFunctor(double* adjoint_in,int size_max_in) : MarshallHandle(AD_SETADJOINT){/*{{{*/
+ 	this->double_count = 0;
+-	this->tape_codi    = &(IssmDouble::getTape());
+ 	this->adjoint      = adjoint_in;
+ 	this->size_max     = size_max_in;
++	#if _CODIPACK_MAJOR_==2
++	this->tape_codi    = &(IssmDouble::getTape());
++	#elif _CODIPACK_MAJOR_==1
++	this->tape_codi    = &(IssmDouble::getGlobalTape());
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
+ }/*}}}*/
+ void SetAdjointFunctor::Echo(void){/*{{{*/
+ 	printf("SetAdjointFunctor Echo:\n");
+Index: ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 26555)
++++ ../trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h	(revision 26556)
+@@ -107,6 +107,13 @@
+ 		}
+ };/*}}}*/
+ #if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
++#if _CODIPACK_MAJOR_==2
++using Tape = typename IssmDouble::Tape;
++#elif _CODIPACK_MAJOR_==1
++using Tape = typename IssmDouble::TapeType;
++#else
++#error "_CODIPACK_MAJOR_ not supported"
++#endif
+ class CountDoublesFunctor:    public MarshallHandle{ /*{{{*/
+ 
+ 	private:
+@@ -127,7 +134,7 @@
+ 		int  double_count;
+ 		int *identifiers;
+ 		int  size_max;
+-		IssmDouble::Tape *tape_codi;
++		Tape *tape_codi;
+ 
+ 	public:
+ 		RegisterInputFunctor(int* identifiers_in,int size_max_in);
+@@ -141,7 +148,7 @@
+ 
+ 	private:
+ 		int   double_count;
+-		IssmDouble::Tape* tape_codi;
++		Tape *tape_codi;
+ 
+ 	public:
+ 		RegisterOutputFunctor(void);
+@@ -154,10 +161,10 @@
+ class SetAdjointFunctor:      public MarshallHandle{ /*{{{*/
+ 
+ 	private:
+-		int                   double_count;
+-		int                   size_max;
+-		IssmDouble::Tape* tape_codi;
+-		double*               adjoint;
++		int     double_count;
++		int     size_max;
++		Tape   *tape_codi;
++		double *adjoint;
+ 
+ 	public:
+ 		SetAdjointFunctor(double* adjoint_in,int size_max_in);
+Index: ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26555)
++++ ../trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp	(revision 26556)
+@@ -34,7 +34,13 @@
+ template<typename Real, typename Data>
+ inline void getVectorGradData(const Real* vec, Data* dataVec, int n) {
+   for(int i = 0; i < n; ++i) {
++	 #if _CODIPACK_MAJOR_==2
+     dataVec[i]=vec[i].getIdentifier();
++	 #elif _CODIPACK_MAJOR_==1
++	 dataVec[i]=vec[i].getGradientData();
++	 #else
++	 #error "_CODIPACK_MAJOR_ not supported"
++	 #endif
+   }
+ }
+ 
+@@ -42,7 +48,13 @@
+ inline void getVectorPrimalAndGradData(const Real* vec, Passive* pasVec, Data* dataVec, int n) {
+   for(int i = 0; i < n; ++i) {
+     pasVec[i]=vec[i].getValue();
++	 #if _CODIPACK_MAJOR_==2
+     dataVec[i]=vec[i].getIdentifier();
++	 #elif _CODIPACK_MAJOR_==1
++	 dataVec[i]=vec[i].getGradientData();
++	 #else
++	 #error "_CODIPACK_MAJOR_ not supported"
++	 #endif
+   }
+ }
+ 
+@@ -49,16 +61,34 @@
+ template<typename Real, typename Passive, typename Data>
+ inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) {
+   pas=value.getValue();
++  #if _CODIPACK_MAJOR_==2
+   data=value.getIdentifier();
++  #elif _CODIPACK_MAJOR_==1
++  data=value.getGradientData();
++  #else
++  #error "_CODIPACK_MAJOR_ not supported"
++  #endif
+ }
+ 
+ template<typename Real, typename Data>
+ inline void registerVector(Real* vec, Data* dataVec, int n) {
+-  typename Real::Tape& tape = Real::getTape();
++	#if _CODIPACK_MAJOR_==2
++	typename Real::Tape& tape = Real::getTape();
++	#elif _CODIPACK_MAJOR_==1
++	typename Real::TapeType& tape = Real::getGlobalTape();
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
+ 
+   for(int i = 0; i < n; ++i) {
+     tape.registerInput(vec[i]);
++	 #if _CODIPACK_MAJOR_==2
+     dataVec[i]=vec[i].getIdentifier();
++	 #elif _CODIPACK_MAJOR_==1
++	 dataVec[i]=vec[i].getGradientData();
++	 #else
++	 #error "_CODIPACK_MAJOR_ not supported"
++	 #endif
+   }
+ }
+ 
+Index: ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp	(revision 26556)
+@@ -253,6 +253,7 @@
+ #endif
+ 
+ #ifdef _HAVE_CODIPACK_
++#if _CODIPACK_MAJOR_==2
+ using Tape = typename IssmDouble::Tape;
+ using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
+ void SolverxSeq_codi_b(Tape* tape,void* data_in, AccessInterface* ra) {/*{{{*/
+@@ -384,6 +385,142 @@
+   xDelete(valueA);
+ }
+ /*}}}*/
++#elif _CODIPACK_MAJOR_==1
++void SolverxSeq_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
++
++	/*recast data_in and tape*/
++	codi::DataStore* data = (codi::DataStore*)data_in;
++	//IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
++	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++
++	IssmDouble::Real* valueATrans;
++	IssmDouble::GradientData* indexATrans;
++	IssmDouble::GradientData* indexB;
++	IssmDouble::Real* valueX;
++	IssmDouble::GradientData* indexX;
++	int n;
++
++	data->getData(valueATrans);
++	data->getData(indexATrans);
++	data->getData(indexB);
++	data->getData(valueX);
++	data->getData(indexX);
++	data->getData(n);
++
++
++	// create the adjoint vector for x and reset the adjoint values on the tape
++	IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
++	getVectorAdjoint(tape, indexX, adjX, n);
++
++	IssmDouble::GradientValue* sol  = xNew<IssmDouble::GradientValue>(n);
++	SolverxSeq(sol, valueATrans, adjX, n);
++
++	updateVectorAdjoint(tape, indexB, sol, n);
++	for(int i=0; i<n; ++i) {
++		for (int j=0; j<n; ++j) {
++			// we access the transposed matrix here because we stored the indices in a transposed way
++			updateAdjoint(tape, indexATrans[i*n+j], -sol[j]*valueX[i]);
++		}
++	}
++
++	xDelete(sol);
++	xDelete(adjX);
++}
++/*}}}*/
++void SolverxSeq_codi_delete(void* tape_in,void* data_in) {/*{{{*/
++
++	/*recast data_in*/
++	codi::DataStore* data = (codi::DataStore*)data_in;
++
++	IssmDouble::Real* valueATrans;
++	IssmDouble::GradientData* indexATrans;
++	IssmDouble::GradientData* indexB;
++	IssmDouble::Real* valueX;
++	IssmDouble::GradientData* indexX;
++	int n;
++
++	data->getData(valueATrans);
++	data->getData(indexATrans);
++	data->getData(indexB);
++	data->getData(valueX);
++	data->getData(indexX);
++	data->getData(n);
++
++	xDelete(valueATrans);
++	xDelete(indexATrans);
++	xDelete(indexB);
++	xDelete(valueX);
++	xDelete(indexX);
++
++	delete data;
++}
++/*}}}*/
++void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/
++	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++	codi::DataStore* dataHandler = NULL;
++
++	if(tape.isActive()) {
++		dataHandler = new codi::DataStore();
++
++		// create the index vector and the double data for A and B
++		IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(n*n);
++		IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(n*n);
++
++		// read the data for matrix in a transposed fashion
++		for (int i=0; i<n; ++i) {
++			for (int j=0; j<n; ++j) {
++				getPrimalAndGradData(A[i*n+j], valueATrans[j*n+i], indexATrans[j*n+i]);
++			}
++		}
++
++		// read the data from B (primal values are not required vor B
++		IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
++		getVectorGradData(B, indexB, n);
++
++		dataHandler->addData(valueATrans);
++		dataHandler->addData(indexATrans);
++		dataHandler->addData(indexB);
++	}
++
++	// unpack the primal values from the matrix and the vector
++	IssmDouble::Real* valueA = xNew<IssmDouble::Real>(n*n);
++	IssmDouble::Real* valueB = xNew<IssmDouble::Real>(n);
++	// read the data from A and B
++	getVectorPrimal(A, valueA, n*n);
++	getVectorPrimal(B, valueB, n);
++
++	// create the placeholder for X and solve the system
++	IssmDouble::Real* valueX = xNew<IssmDouble::Real>(n);
++	SolverxSeq(valueX, valueA, valueB, n);
++
++	// pack the values into x
++	setVectorPrimal(X, valueX, n);
++
++	if(tape.isActive()) {
++		// create the index vector X and register x as active variables
++		IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
++		registerVector(X, indexX, n);
++
++		dataHandler->addData(valueX);
++		dataHandler->addData(indexX);
++
++		// store other arguments
++		dataHandler->addData(n);
++
++		tape.pushExternalFunctionHandle(&SolverxSeq_codi_b, dataHandler, &SolverxSeq_codi_delete);
++	}
++	else{
++		// if the tape is active valueX is stored in the dataHandler and deleted in the reverse sweep
++		xDelete(valueX);
++	}
++
++	xDelete(valueB);
++	xDelete(valueA);
++}
++/*}}}*/
++#else
++#error "_CODIPACK_MAJOR_ not supported"
++#endif
+ void DenseGslSolve(/*output*/ IssmDouble** px,/*stiffness matrix:*/ IssmDouble* Kff, int Kff_M, int Kff_N, /*right hand side load vector: */ IssmDouble* pf, int pf_M, Parameters* parameters){ /*{{{*/
+ 
+ 	/*Intermediary: */
+@@ -399,4 +536,5 @@
+ 	*px=x;
+ }
+ /*}}}*/
++
+ #endif
+Index: ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 26555)
++++ ../trunk-jpl/src/c/toolkits/mpi/issmmpi.h	(revision 26556)
+@@ -33,8 +33,18 @@
+ 			//#include <codi/externals/codiMpiTypes.hpp>
+ 			//using MpiTypes = CoDiMpiTypes<IssmDouble>;
+ 			/*New implementation*/
++			#if _CODIPACK_MAJOR_==2
+ 			#include <codi/tools/mpi/codiMpiTypes.hpp>
+-         using MpiTypes = codi::CoDiMpiTypes<IssmDouble>;
++			using MpiTypes = codi::CoDiMpiTypes<IssmDouble>;
++
++			#elif _CODIPACK_MAJOR_==1
++			#include <codi/externals/codiMpiTypes.hpp>
++			using MpiTypes = CoDiMpiTypes<IssmDouble>;
++
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
++
+ 			extern MpiTypes* mpiTypes;
+ 			#define AMPI_ADOUBLE mpiTypes->MPI_TYPE
+ 			#elif defined(_HAVE_ADOLC_)
+Index: ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp	(revision 26556)
+@@ -484,9 +484,9 @@
+ #endif
+ 
+ #ifdef _HAVE_CODIPACK_
++#if _CODIPACK_MAJOR_==2
+ using Tape = typename IssmDouble::Tape;
+ using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
+-
+ void MumpsSolve_codi_b(Tape* tape, void* data_in, AccessInterface* ra) {/*{{{*/
+ 
+ 	/*recast data_in and tape*/
+@@ -647,4 +647,172 @@
+   xDelete(valueA);
+ }
+ /*}}}*/
++#elif _CODIPACK_MAJOR_==1
++void MumpsSolve_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
++
++	/*recast data_in and tape*/
++	codi::DataStore* data = (codi::DataStore*)data_in;
++	//IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
++	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++
++
++	IssmDouble::Real* valueATrans;
++	IssmDouble::GradientData* indexATrans;
++	int* irnATrans;
++	int* jcnATrans;
++	IssmDouble::GradientData* indexB;
++	IssmDouble::Real* valueX;
++	IssmDouble::GradientData* indexX;
++	int n;
++	int nnz;
++	int local_nnz;
++	Parameters* parameters;
++
++	data->getData(valueATrans);
++	data->getData(indexATrans);
++	data->getData(irnATrans);
++	data->getData(jcnATrans);
++	data->getData(indexB);
++	data->getData(valueX);
++	data->getData(indexX);
++	data->getData(n);
++	data->getData(nnz);
++	data->getData(local_nnz);
++	data->getData(parameters);
++
++	// create the adjoint vector for x and reset the adjoint values on the tape
++	IssmDouble::GradientValue* adjX = xNew<IssmDouble::GradientValue>(n);
++	getVectorAdjoint(tape, indexX, adjX, n);
++
++	MumpsSolve(n, nnz, local_nnz, irnATrans, jcnATrans, valueATrans, adjX, parameters);
++	// adjX contains now the solution
++
++	updateVectorAdjoint(tape, indexB, adjX, n);
++
++	// bcast dp_y (the solution of the forward system)
++	ISSM_MPI_Bcast(valueX,n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
++	// bcast the adjoint of the right-hand-side, i.e. this solution
++	ISSM_MPI_Bcast(adjX,n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
++
++	for(int i=0; i<local_nnz; ++i) {
++		// we access the transposed matrix here because we stored the indices in a transposed way
++		// -1 is substracted because jcn and irn are stored with fortran indexing
++		updateAdjoint(tape, indexATrans[i], -adjX[jcnATrans[i]-1]*valueX[irnATrans[i]-1]);
++	}
++
++	xDelete(adjX);
++}
++/*}}}*/
++void MumpsSolve_codi_delete(void* tape_in,void* data_in) {/*{{{*/
++
++	/*recast data_in*/
++	codi::DataStore* data = (codi::DataStore*)data_in;
++
++	IssmDouble::Real* valueATrans;
++	IssmDouble::GradientData* indexATrans;
++	int* irnATrans;
++	int* jcnATrans;
++	IssmDouble::GradientData* indexB;
++	IssmDouble::Real* valueX;
++	IssmDouble::GradientData* indexX;
++	int n;
++	int nnz;
++	int local_nnz;
++	Parameters* parameters;
++
++	data->getData(valueATrans);
++	data->getData(indexATrans);
++	data->getData(irnATrans);
++	data->getData(jcnATrans);
++	data->getData(indexB);
++	data->getData(valueX);
++	data->getData(indexX);
++	data->getData(n);
++	data->getData(nnz);
++	data->getData(local_nnz);
++	data->getData(parameters);
++
++	xDelete(valueATrans);
++	xDelete(indexATrans);
++	xDelete(irnATrans);
++	xDelete(jcnATrans);
++	xDelete(indexB);
++	xDelete(valueX);
++	xDelete(indexX);
++
++	delete data;
++}
++/*}}}*/
++void MumpsSolve(int n,int nnz,int local_nnz,int* irn_loc,int* jcn_loc,IssmDouble *a_loc,IssmDouble *rhs,Parameters* parameters){/*{{{*/
++	IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
++	codi::DataStore* dataHandler = NULL;
++
++	if(tape.isActive()) {
++		dataHandler = new codi::DataStore();
++
++		// create the index and double vector for the matrix
++		IssmDouble::Real* valueATrans = xNew<IssmDouble::Real>(local_nnz);
++		IssmDouble::GradientData* indexATrans = xNew<IssmDouble::GradientData>(local_nnz);
++		int* irnATrans = xNew<int>(local_nnz);
++		int* jcnATrans = xNew<int>(local_nnz);
++
++		// read the data for the matrix A in a transposed fashion
++		for (int i=0; i<local_nnz; ++i) {
++			getPrimalAndGradData(a_loc[i], valueATrans[i], indexATrans[i]);
++			irnATrans[i]=jcn_loc[i];  // transposed store
++			jcnATrans[i]=irn_loc[i];  // transposed store
++		}
++
++		// create the index vector for a (primal values are not needed for a)
++		IssmDouble::GradientData* indexB = xNew<IssmDouble::GradientData>(n);
++		getVectorGradData(rhs, indexB, n);
++
++		dataHandler->addData(valueATrans);
++		dataHandler->addData(indexATrans);
++		dataHandler->addData(irnATrans);
++		dataHandler->addData(jcnATrans);
++		dataHandler->addData(indexB);
++	}
++
++	// unpack the primal values from the matrix and the vector
++	IssmDouble::Real* valueA = xNew<IssmDouble::Real>(local_nnz);
++	IssmDouble::Real* valueB = xNew<IssmDouble::Real>(n);
++	// read the data from A and B
++	getVectorPrimal(a_loc, valueA, local_nnz);
++	getVectorPrimal(rhs, valueB, n);
++
++	MumpsSolve(n, nnz, local_nnz, irn_loc, jcn_loc, valueA, valueB, parameters);
++	// valueB contains now the solution
++
++	// pack the values into rhs
++	setVectorPrimal(rhs, valueB, n);
++
++	if(tape.isActive()) {
++		// create the index vector X and register x as active variables
++		IssmDouble::GradientData* indexX = xNew<IssmDouble::GradientData>(n);
++		registerVector(rhs, indexX, n);
++
++		dataHandler->addData(valueB); // contains the values from x
++		dataHandler->addData(indexX);
++
++		// store other arguments
++		dataHandler->addData(n);
++		dataHandler->addData(nnz);
++		dataHandler->addData(local_nnz);
++		dataHandler->addData(parameters); // we assume here that parameters is still intact when the reverse run is called
++
++		//tape.pushExternalFunction(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
++		tape.pushExternalFunctionHandle(&MumpsSolve_codi_b,(void*)dataHandler, &MumpsSolve_codi_delete);
++	}
++	else{
++		// if the tape is active valueB is stored in the dataHandler and deleted in the reverse sweep
++		xDelete(valueB);
++	}
++
++	xDelete(valueA);
++}
++/*}}}*/
++#else
++#error "_CODIPACK_MAJOR_ not supported"
+ #endif
++#endif
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26555)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26556)
+@@ -13,6 +13,7 @@
+ #ifdef _HAVE_CODIPACK_
+ extern CoDi_global codi_global;
+ #include <sstream> // for output of the CoDiPack tape
++#include <fenv.h>
+ void transient_ad(FemModel* femmodel);
+ #endif
+ 
+@@ -74,7 +75,14 @@
+ 		 * - ADOL-C variant sets a garbage collection parameter for its tape
+ 		 * -> These parameters are not read for the CoDiPack ISSM version!
+ 		 */
++		#if _CODIPACK_MAJOR_==2
+ 		auto& tape_codi = IssmDouble::getTape();
++		#elif _CODIPACK_MAJOR_==1
++		auto& tape_codi = IssmDouble::getGlobalTape();
++		#else
++		#error "_CODIPACK_MAJOR_ not supported"
++		#endif
++
+ 		tape_codi.setActive();
+ 		#if _AD_TAPE_ALLOC_
+ 		//alloc_profiler.Tag(StartInit, true);
+@@ -152,13 +160,28 @@
+ 		//_printf_("Allocation time  P(" << my_rank << "): " << alloc_profiler.DeltaTime(StartInit, FinishInit) << "\n");
+ 		#endif
+ 		std::stringstream out_s;
++		#if _CODIPACK_MAJOR_==2
+ 		IssmDouble::getTape().printStatistics(out_s);
++		#elif _CODIPACK_MAJOR_==1
++		IssmDouble::getGlobalTape().printStatistics(out_s);
++		#else
++		#error "_CODIPACK_MAJOR_ not supported"
++		#endif
+ 		_printf0_("CoDiPack Profiling::Tape Statistics :\n" << out_s.str());
+ 		#endif
+ 	} /*}}}*/
+ 
+ 	#elif defined(_HAVE_CODIPACK_)
++
++	/*Get Tape*/
++	#if _CODIPACK_MAJOR_==2
+ 	auto& tape_codi = IssmDouble::getTape();
++	#elif _CODIPACK_MAJOR_==1
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
++
+ 	tape_codi.setPassive();
+ 	if(VerboseAutodiff()){
+ 		int my_rank=IssmComm::GetRank();
+@@ -238,13 +261,29 @@
+ 		}
+ 	}
+ 	#elif defined(_HAVE_CODIPACK_)
++
++	/*Get tape*/
++	#if _CODIPACK_MAJOR_==2
+ 	auto& tape_codi = IssmDouble::getTape();
++	#elif _CODIPACK_MAJOR_==1
++	auto& tape_codi = IssmDouble::getGlobalTape();
++	#else
++	#error "_CODIPACK_MAJOR_ not supported"
++	#endif
++
+ 	codi_global.input_indices.clear();
+ 	if(my_rank==0){
+ 		for (int i=0;i<intn;i++) {
+ 			aX[i]=X[i];
+ 			tape_codi.registerInput(aX[i]);
++			#if _CODIPACK_MAJOR_==2
+ 			codi_global.input_indices.push_back(aX[i].getIdentifier());
++			#elif _CODIPACK_MAJOR_==1
++			codi_global.input_indices.push_back(aX[i].getGradientData());
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
++
+ 		}
+ 	}
+ 	#else
+@@ -284,7 +323,13 @@
+ 			#if defined(_HAVE_CODIPACK_)
+ 			tape_codi.registerOutput(output_value);
+ 			dependents[i] = output_value.getValue();
++			#if _CODIPACK_MAJOR_==2
+ 			codi_global.output_indices.push_back(output_value.getIdentifier());
++			#elif _CODIPACK_MAJOR_==1
++			codi_global.output_indices.push_back(output_value.getGradientData());
++			#else
++			#error "_CODIPACK_MAJOR_ not supported"
++			#endif
+ 
+ 			#elif defined(_HAVE_ADOLC_)
+ 			output_value>>=dependents[i];
+@@ -376,6 +421,8 @@
+ 			}
+ 			tape_codi.setGradient(codi_global.output_indices[dep_index],1.0);
+ 		}
++		feclearexcept(FE_ALL_EXCEPT);
++		feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
+ 		tape_codi.evaluate();
+ 
+ 		/*Get gradient for this dependent */
+@@ -445,6 +492,7 @@
+ 		offset += M[c]*N[c];
+ 	}
+ 	Gnorm = sqrt(Gnorm);
++	_assert_(!xIsNan(Gnorm));
+ 
+ 	/*Print info*/
+ 	_printf0_("       "<<setw(12)<<setprecision(7)<<Gnorm<<" |");
Index: /issm/oecreview/Archive/25834-26739/ISSM-26556-26557.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26556-26557.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26556-26557.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/extrusion/project3d.py
+===================================================================
+--- ../trunk-jpl/src/m/extrusion/project3d.py	(revision 26556)
++++ ../trunk-jpl/src/m/extrusion/project3d.py	(revision 26557)
+@@ -147,7 +147,7 @@
+                 for i in range(md.mesh.numberoflayers - 1):
+                     projected_vector[(i * md.mesh.numberofelements2d):((i + 1) * md.mesh.numberofelements2d), :] = vector2d*(1.0-(1.0-i/(md.mesh.numberoflayers - 1.0))**polyexponent)
+             else:
+-
++                projected_vector[((layer - 1) * md.mesh.numberofelements2d):(layer * md.mesh.numberofelements2d), :] = vector2d*(1.0-(1.0-layer/(md.mesh.numberoflayers - 1.0))**polyexponent)
+     else:
+         raise TypeError("project3d error message: unknown projection type")
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26557-26558.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26557-26558.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26557-26558.diff	(revision 26740)
@@ -0,0 +1,142 @@
+Index: ../trunk-jpl/examples/AMR/mismip.py
+===================================================================
+--- ../trunk-jpl/examples/AMR/mismip.py	(nonexistent)
++++ ../trunk-jpl/examples/AMR/mismip.py	(revision 26558)
+@@ -0,0 +1,54 @@
++import numpy as np
++from SetIceShelfBC import SetIceShelfBC
++
++# creating thickness
++md.geometry.bed = -100 - np.abs(md.mesh.x) / 1000
++md.geometry.base = -90 * np.ones((md.mesh.numberofvertices))
++md.geometry.surface = 10 * np.ones((md.mesh.numberofvertices))
++md.geometry.thickness = md.geometry.surface - md.geometry.base
++md.mask.ocean_levelset = -1 * np.ones((md.mesh.numberofvertices))
++
++# creating basal drag
++md.friction.coefficient = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices))  #q = 1.
++md.friction.p = 3 * np.ones((md.mesh.numberofelements))
++md.friction.q = np.zeros((md.mesh.numberofelements))
++
++# creating flow law paramter
++md.materials.rheology_B = 1 / ((1e-25)**(1 / 3)) * np.ones((md.mesh.numberofvertices))
++md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
++md.materials.rheology_law = 'None'
++
++# creating boundary conditions
++md = SetIceShelfBC(md, './front.exp')
++md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
++md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
++md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
++pos = np.nonzero(np.logical_or((np.abs(md.mesh.y - 50000) < 0.1), np.abs(md.mesh.y) < 0.1))
++md.stressbalance.spcvy[pos] = 0
++pos2 = np.nonzero(np.abs(md.mesh.x) < 0.1)
++md.stressbalance.spcvx[pos2] = 0
++md.stressbalance.spcvz[pos] = np.nan
++md.stressbalance.spcvz[pos2] = np.nan
++
++# creating forcing conditions
++md.smb.mass_balance = 0.5 * np.ones((md.mesh.numberofvertices))
++md.basalforcings.geothermalflux = 0.5 * np.ones((md.mesh.numberofvertices))
++md.thermal.spctemperature = np.nan * np.ones((md.mesh.numberofvertices))
++md.groundingline.migration = 'SubelementMigration'
++
++# setting parameters
++md.materials.rho_ice = 900
++md.materials.rho_water = 1000
++md.constants.g = 9.8
++md.constants.yts = 3600 * 24 * 365
++md.transient.isthermal = 0
++md.transient.isgroundingline = 1
++md.stressbalance.isnewton = 0
++
++# setting inital condition
++md.initialization.vx = np.ones((md.mesh.numberofvertices))
++md.initialization.vy = np.ones((md.mesh.numberofvertices))
++md.initialization.vz = np.ones((md.mesh.numberofvertices))
++md.initialization.vel = np.sqrt(2) * np.ones((md.mesh.numberofvertices))
++md.initialization.pressure = md.constants.g * md.materials.rho_ice * md.geometry.thickness
++md.initialization.temperature = 273 * np.ones((md.mesh.numberofvertices))
+Index: ../trunk-jpl/examples/AMR/runme.py
+===================================================================
+--- ../trunk-jpl/examples/AMR/runme.py	(nonexistent)
++++ ../trunk-jpl/examples/AMR/runme.py	(revision 26558)
+@@ -0,0 +1,78 @@
++# Mismip3D experiment with AMR using BAMG
++from bamg import bamg
++from model import *
++from export_netCDF import export_netCDF
++from setmask import setmask
++from loadmodel import loadmodel
++from parameterize import parameterize
++from generic import generic
++from exportVTK import exportVTK
++from setflowequation import setflowequation
++from solve import solve
++from plotmodel import plotmodel
++
++
++steps = [4]
++
++if 1 in steps:
++    print('   Step 1: Coarse mesh')
++
++    #Generate an unstructured coarse mesh on the MISMIP domain with typical element edge length equal to 10, 000 m
++    md = bamg(model(), 'domain', './domain.exp', 'hmax', 10000, 'splitcorners', 1)
++
++    export_netCDF(md, 'AMRCoarseMesh.nc')
++
++if 2 in steps:
++    print('   Step 2: Parameterization')
++
++    md = loadmodel('AMRCoarseMesh.nc')
++
++    md = setmask(md, '', '')
++
++    # Run parameterization script to set up geometry, inital velocity, material properties, etc.
++    md = parameterize(md, './mismip.py')
++
++    # Set the AMR properties and the refinement criteria
++    # Here, we are refining around the grounding line
++    # We impose the element resolution at grounding equal to 1000 m (1 km)
++    # The criterion used is the element distance to the grounding line
++    # The distance used here is 10000 m (10 km), used in both side around the grouding line (upstream and downstream)
++    md.amr.groundingline_resolution = 1000
++    md.amr.groundingline_distance = 10000
++    md.amr.hmin = 1000  # the same resolution used around the grounding line
++    md.amr.hmax = 10000  # the same coase resolution used to generate the coarse mesh
++    md.amr.gradation = 1.7  # this controls the ratio between two consecutive edges
++    md.amr.fieldname = 'None'  # no field used here
++    md.amr.keepmetric = 0  # no field, no metric
++
++    export_netCDF(md, 'AMRParam.nc')
++
++if 3 in steps:
++    print('   Step 3: Solve!')
++
++    md = loadmodel('AMRParam.nc')
++
++    # Run transient with adaptive mesh refinement
++    md.timestepping.time_step = 1
++    md.timestepping.final_time = 500   # here, as example, only 500 yr.
++    md.settings.output_frequency = 10  # here, save results every 10 yr
++    md.stressbalance.maxiter = 30
++    md.stressbalance.abstol = np.nan
++    md.stressbalance.restol = 1
++    md.settings.solver_residue_threshold = 1e-2  # relaxing (the first stress balance solver iteration presents values higher than the original threshold. This probably happens because the initial velocity is set to one).
++    md.verbose = verbose('convergence', False, 'solution', True)
++
++    # Specify that you want to run the model on your current (local host) computer
++    # Change the number of processors according to your machine (here np = 2)
++    md.cluster = generic('np', 2)
++
++    # Set the AMR frequency, i.e., can be 1 or larger depending on how often the mesh needs to be updated
++    md.transient.amr_frequency = 1  # here, we are refining the mesh in every time step
++
++    # Set the flow equation (SSA) and run
++    md = setflowequation(md, 'SSA', 'all')
++    md = solve(md, 'Transient')
++
++    # Print the solutions and the mesh in VTK format (needs ParaView:    https: / / www.paraview.org)
++    exportVTK('./VTKpy', md)
++    export_netCDF(md, 'AMRTransient.nc')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26558-26559.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26558-26559.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26558-26559.diff	(revision 26740)
@@ -0,0 +1,570 @@
+Index: ../trunk-jpl/examples/Greenland/CheatSheet.py
+===================================================================
+--- ../trunk-jpl/examples/Greenland/CheatSheet.py	(nonexistent)
++++ ../trunk-jpl/examples/Greenland/CheatSheet.py	(revision 26559)
+@@ -0,0 +1,89 @@
++if 7 in steps:
++    #  Step 7: Historical Relaxation run {{{
++    print('   Step 7: Historical Relaxation run')
++    md = loadmodel('./Models/Greenland.Control_drag.nc')
++
++    with open('./smbbox.npz', "rb") as smbFile:
++        SMB = np.load(smbFile)
++        x1 = np.squeeze(SMB['x1'])
++        y1 = np.squeeze(SMB['y1'])
++        smbmean = np.squeeze(SMB['smbmean'])
++
++    #convert mesh x, y into the Box projection
++    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
++    [xi, yi] = ll2xy(md.mesh.lat, md.mesh.long, + 1, 45, 70)
++
++    #Interpolate and set surface mass balance
++    x1 = x1.flatten()
++    y1 = y1.flatten()
++    smbmean = smbmean.flatten()
++    index = BamgTriangulate(x1, y1)
++    smb_mo = InterpFromMeshToMesh2d(index, x1, y1, smbmean, xi, yi)
++    smb = smb_mo * 12 / 1000 * md.materials.rho_freshwater / md.materials.rho_ice
++    md.smb.mass_balance = np.append(smb, 1)
++
++    #Set transient options, run for 20 years, saving every timestep
++    md.timestepping.time_step = 0.2
++    md.timestepping.final_time = 200
++    md.settings.output_frequency = 5
++
++    #Additional options
++    md.inversion.iscontrol = 0
++    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
++    md.verbose = verbose('solution', True, 'module', True)
++
++    #Go solve
++    md.cluster = generic('name', gethostname(), 'np', 2)
++    md = solve(md, 'Transient')
++
++    export_netCDF(md, './Models/Greenland.HistoricTransient_200yr.nc')
++    # }}}
++
++if 8 in steps:
++    # Step 8: Plotting exercise {{{
++    print('   Step 8: Plotting exercise')
++    md = loadmodel('./Models/Greenland.HistoricTransient_200yr.nc')
++
++    #Create Line Plots of relaxation run. Create a figure.
++    fig = plt.figure(tight_layout=True)
++
++    #Save surface mass balance, by looping through 200 years (1000 steps)
++    #Note, the first output will always contain output from time step 1
++
++    Timer = np.arange(0.2, 200.2)
++    surfmb = []
++    for i in range(0, 200):
++        surfmb.append(md.results.TransientSolution[i].SmbMassBalance)
++
++    #Plot surface mass balance time series in first subplot
++    ax = fig.add_subplot(311)
++    ax.plot(Timer, np.nanmean(surfmb, axis=1))
++
++    #Title this plot Mean surface mass balance
++    ax.set_title('Mean Surface mass balance')
++
++    #Save velocity by looping through 200 years
++    vel = []
++    for i in range(0, 200):
++        vel.append(md.results.TransientSolution[i].Vel)
++
++    #Plot velocity time series in second subplot
++    ay = fig.add_subplot(312)
++    ay.plot(Timer, np.nanmean(vel, axis=1))
++
++    #Title this plot Mean Velocity
++    ay.set_title('Mean Velocity')
++
++    #Save Ice Volume by looping through 200 years
++    volume = []
++    for i in range(0, 200):
++        volume.append(md.results.TransientSolution[i].IceVolume)
++
++    #Plot volume time series in third subplot
++    az = fig.add_subplot(313)
++    az.plot(Timer, volume)
++
++    #Title this plot Mean Velocity and add an x label of years
++    az.set_title('Ice Volume')
++    az.set_xlabel('years')
++    # }}}
+Index: ../trunk-jpl/examples/Greenland/Greenland.py
+===================================================================
+--- ../trunk-jpl/examples/Greenland/Greenland.py	(nonexistent)
++++ ../trunk-jpl/examples/Greenland/Greenland.py	(revision 26559)
+@@ -0,0 +1,83 @@
++import numpy as np
++from paterson import paterson
++from netCDF4 import Dataset
++from InterpFromGridToMesh import InterpFromGridToMesh
++
++#Name and Coordinate system
++md.miscellaneous.name = 'SeaRISEgreenland'
++md.mesh.epsg = 3413
++
++print('   Loading SeaRISE data from NetCDF')
++ncdata = Dataset('../Data/Greenland_5km_dev1.2.nc', mode='r')
++x1 = np.squeeze(ncdata.variables['x1'][:].data)
++y1 = np.squeeze(ncdata.variables['y1'][:].data)
++usrf = np.squeeze(ncdata.variables['usrf'][:].data)
++topg = np.squeeze(ncdata.variables['topg'][:].data)
++velx = np.squeeze(ncdata.variables['surfvelx'][:].data)
++vely = np.squeeze(ncdata.variables['surfvely'][:].data)
++temp = np.squeeze(ncdata.variables['airtemp2m'][:].data)
++smb = np.squeeze(ncdata.variables['smb'][:].data)
++gflux = np.squeeze(ncdata.variables['bheatflx'][:].data)
++ncdata.close()
++
++print('   Interpolating surface and bedrock')
++md.geometry.base = InterpFromGridToMesh(x1, y1, topg, md.mesh.x, md.mesh.y, 0)
++md.geometry.surface = InterpFromGridToMesh(x1, y1, usrf, md.mesh.x, md.mesh.y, 0)
++
++print('   Constructing thickness')
++md.geometry.thickness = md.geometry.surface - md.geometry.base
++
++#Set min thickness to 1 meter
++pos0 = np.nonzero(md.geometry.thickness <= 0)
++md.geometry.thickness[pos0] = 1
++md.geometry.surface = md.geometry.thickness + md.geometry.base
++
++print('   Interpolating velocities ')
++md.inversion.vx_obs = InterpFromGridToMesh(x1, y1, velx, md.mesh.x, md.mesh.y, 0)
++md.inversion.vy_obs = InterpFromGridToMesh(x1, y1, vely, md.mesh.x, md.mesh.y, 0)
++md.inversion.vel_obs = np.sqrt(md.inversion.vx_obs**2 + md.inversion.vy_obs**2)
++md.initialization.vx = md.inversion.vx_obs
++md.initialization.vy = md.inversion.vy_obs
++md.initialization.vz = np.zeros((md.mesh.numberofvertices))
++md.initialization.vel = md.inversion.vel_obs
++
++print('   Interpolating temperatures')
++md.initialization.temperature = InterpFromGridToMesh(x1, y1, temp, md.mesh.x, md.mesh.y, 0) + 273.15
++
++print('   Interpolating surface mass balance')
++md.smb.mass_balance = InterpFromGridToMesh(x1, y1, smb, md.mesh.x, md.mesh.y, 0)
++md.smb.mass_balance = md.smb.mass_balance * md.materials.rho_water / md.materials.rho_ice
++
++print('   Construct basal friction parameters')
++md.friction.coefficient = 30 * np.ones((md.mesh.numberofvertices))
++pos = np.nonzero(md.mask.ocean_levelset < 0)
++md.friction.coefficient[pos] = 0  #no friction applied on floating ice
++md.friction.p = np.ones((md.mesh.numberofelements))
++md.friction.q = np.ones((md.mesh.numberofelements))
++
++print('   Construct ice rheological properties')
++md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
++md.materials.rheology_B = paterson(md.initialization.temperature)
++md.friction.q = np.ones((md.mesh.numberofelements))
++md.friction.p = np.ones((md.mesh.numberofelements))
++
++print('   Set other boundary conditions')
++md.mask.ice_levelset[np.nonzero(md.mesh.vertexonboundary == 1)] = 0
++md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices))
++md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
++#impose observed temperature on surface
++md.thermal.spctemperature = md.initialization.temperature
++md.masstransport.spcthickness = np.nan * np.ones((md.mesh.numberofvertices))
++
++print('   Set geothermal heat flux')
++md.basalforcings.geothermalflux = InterpFromGridToMesh(x1, y1, gflux, md.mesh.x, md.mesh.y, 0)
++
++print('   Set Pressure')
++md.initialization.pressure = md.materials.rho_ice * md.constants.g * md.geometry.thickness
++
++print('   Single point constraints')
++#Initialize single point constraint arrays
++md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
++md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
++md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
++md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
+
+Property changes on: ../trunk-jpl/examples/Greenland/Greenland.py
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/Greenland/runme.py
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.py	(nonexistent)
++++ ../trunk-jpl/examples/Greenland/runme.py	(revision 26559)
+@@ -0,0 +1,369 @@
++import numpy as np
++from triangle import triangle
++from model import *
++from netCDF4 import Dataset
++from InterpFromGridToMesh import InterpFromGridToMesh
++from bamg import bamg
++from xy2ll import xy2ll
++from plotmodel import plotmodel
++from export_netCDF import export_netCDF
++from loadmodel import loadmodel
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from socket import gethostname
++from solve import solve
++from ll2xy import ll2xy
++from BamgTriangulate import BamgTriangulate
++from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
++from scipy.interpolate import griddata
++
++steps = [1]
++
++if 1 in steps:
++    # Step 1: Mesh creation {{{
++    print('   Step 1: Mesh creation')
++
++    #Generate initial uniform mesh (resolution = 20000 m)
++    md = triangle(model(), './DomainOutline.exp', 20000)
++
++    ncdata = Dataset('../Data/Greenland_5km_dev1.2.nc', mode='r')
++
++    # Get velocities (Note: You can use ncprint('file') to see an ncdump)
++    x1 = np.squeeze(ncdata.variables['x1'][:].data)
++    y1 = np.squeeze(ncdata.variables['y1'][:].data)
++    velx = np.squeeze(ncdata.variables['surfvelx'][:].data)
++    vely = np.squeeze(ncdata.variables['surfvely'][:].data)
++    ncdata.close()
++
++    vx = InterpFromGridToMesh(x1, y1, velx, md.mesh.x, md.mesh.y, 0)
++    vy = InterpFromGridToMesh(x1, y1, vely, md.mesh.x, md.mesh.y, 0)
++    vel = np.sqrt(vx**2 + vy**2)
++
++    #Mesh Greenland
++    md = bamg(md, 'hmax', 400000, 'hmin', 5000, 'gradation', 1.7, 'field', vel, 'err', 8)
++
++    #convert x, y coordinates (Polar stereo) to lat / lon
++    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
++
++    export_netCDF(md, './Models/Greenland.Mesh_generation.nc')
++    plotmodel(md, 'data', 'mesh')
++    # }}}
++
++if 2 in steps:
++    #  Step 2: Parameterization{{{
++    print('   Step 2: Parameterization')
++    md = loadmodel('./Models/Greenland.Mesh_generation.nc')
++
++    md = setmask(md, '', '')
++    md = parameterize(md, './Greenland.py')
++    md = setflowequation(md, 'SSA', 'all')
++
++    export_netCDF(md, "./Models/Greenland.Parameterization.nc")
++    # }}}
++
++if 3 in steps:
++    #   Step 3: Control method friction {{{
++    print('   Step 3: Control method friction')
++    md = loadmodel('./Models/Greenland.Parameterization.nc')
++    #Control general
++    md.inversion.iscontrol = 1
++    md.inversion.nsteps = 30
++    md.inversion.step_threshold = 0.99 * np.ones((md.inversion.nsteps))
++    md.inversion.maxiter_per_step = 5 * np.ones((md.inversion.nsteps))
++
++    #Cost functions
++    md.inversion.cost_functions = [101, 103, 501]
++    md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 3))
++    md.inversion.cost_functions_coefficients[:, 0] = 350
++    md.inversion.cost_functions_coefficients[:, 1] = 0.6
++    md.inversion.cost_functions_coefficients[:, 2] = 2e-6
++
++    #Controls
++    md.inversion.control_parameters = ['FrictionCoefficient']
++    md.inversion.gradient_scaling = 50 * np.ones((md.inversion.nsteps, 1))
++    md.inversion.min_parameters = 1 * np.ones((md.mesh.numberofvertices, 1))
++    md.inversion.max_parameters = 200 * np.ones((md.mesh.numberofvertices, 1))
++
++    #Additional parameters
++    md.stressbalance.restol = 0.01
++    md.stressbalance.reltol = 0.1
++    md.stressbalance.abstol = np.nan
++    md.stressbalance.loadingforce = np.zeros((md.mesh.numberofvertices, 3))
++
++    #Go solve
++    md.cluster = generic('name', gethostname(), 'np', 2)
++    md.toolkits = toolkits()
++    md.verbose = verbose('solution', True, 'control', True)
++    md = solve(md, 'Stressbalance')
++
++    #Update model friction fields accordingly
++    md.friction.coefficient = md.results.StressbalanceSolution.FrictionCoefficient
++
++    export_netCDF(md, "./Models/Greenland.Control_drag.nc")
++    # }}}
++
++if 4 in steps:
++    #   Step 4: Transient run {{{
++    print('   Step 4: Transient run')
++    md = loadmodel('./Models/Greenland.Control_drag.nc')
++
++    #Set surface mass balance
++    ncdata = Dataset('../Data/Greenland_5km_dev1.2.nc', mode='r')
++    x1 = np.squeeze(ncdata.variables['x1'][:].data)
++    y1 = np.squeeze(ncdata.variables['y1'][:].data)
++    smb = np.squeeze(ncdata.variables['smb'][:].data)
++    ncdata.close()
++
++    smb = InterpFromGridToMesh(x1, y1, smb, md.mesh.x, md.mesh.y, 0)
++    smb = smb * md.materials.rho_freshwater / md.materials.rho_ice
++    smb = np.vstack((smb, smb, smb - 1.0)).T
++    md.smb.mass_balance = np.vstack((smb, np.asarray([[1, 10, 20]])))
++    #Set transient options, run for 20 years, saving every timestep
++    md.timestepping.time_step = 0.2
++    md.timestepping.final_time = 20
++    md.settings.output_frequency = 1
++
++    #Additional options
++    md.inversion.iscontrol = 0
++    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
++    md.verbose = verbose('solution', True, 'module', True, 'convergence', True)
++
++    #Go solve
++    md.cluster = generic('name', gethostname(), 'np', 2)
++    md = solve(md, 'Transient')
++
++    export_netCDF(md, './Models/Greenland.Transient.nc')
++    # }}}
++
++if 5 in steps:
++    #   Step 5: Plotting {{{
++    print('   Step 5: Plotting')
++    md = loadmodel('./Models/Greenland.Transient.nc')
++
++    #Planview plots
++    plotmodel(md, 'data', md.results.TransientSolution[-1].Vel, 'log#1', 1e-1,
++              'caxis#1', [1e-1, 1e4], 'title#1', 'Velocity (m / y)',
++              'data', md.results.TransientSolution[1].SmbMassBalance,
++              'title#2', 'Surface Mass Balance (m / y)',
++              'data', md.results.TransientSolution[-1].Thickness,
++              'title', 'Thickness (m)',
++              'data', md.results.TransientSolution[-1].Surface,
++              'title', 'Surface (m)')
++
++    #Line Plots
++    figure
++
++    #Plot surface mass balance, velocity and volume
++    surfmb = []
++    vel = []
++    volume = []
++    for i in range(0, 100):
++        surfmb.append(md.results.TransientSolution[i].SmbMassBalance)
++        vel.append(md.results.TransientSolution[i].Vel)
++        volume.append(md.results.TransientSolution[i].IceVolume)
++
++    layout, ax = plt.subplots(3, 1, sharex=True, sharey=False, figsize=(5, 5))
++    ax[0].plot(np.arange(0.2, 20.2, 0.2), np.nanmean(surfmb, axis=1))
++    ax[0].set_title('Mean Surface mass balance')
++    ax[1].plot(np.arange(0.2, 20.2, 0.2), np.nanmean(vel, axis=1))
++    ax[1].set_title('Mean Velocity')
++    ax[2].plot(np.arange(0.2, 20.2, 0.2), volume)
++    ax[2].set_title('Ice Volume')
++    ax[2].set_xlabel('years')
++    # }}}
++
++if 6 in steps:
++    #   Step 6: Extract Box SMB{{{
++    print('   Step 6: Extract Box SMB')
++    md = loadmodel('./Models/Greenland.Transient.nc')
++
++    #Set surface mass balance
++    ncbox = Dataset('../Data/Box_Greenland_SMB_monthly_1840-2012_5km_cal_ver20141007.nc', mode='r')
++    lat = np.squeeze(ncbox.variables['lat'][:].data)
++    lon = np.squeeze(ncbox.variables['lon'][:].data)
++    smbbox = np.squeeze(ncbox.variables['MassFlux'][:].data)
++    ncbox.close()
++    [x1, y1] = ll2xy(lat, lon, + 1, 45, 70)
++
++    years_of_simulation = np.arange(1840, 2012 + 1)
++    t = np.arange(years_of_simulation[0], years_of_simulation[-1] + 11 / 12, 1 / 12)
++    #Area of grid for 5km box
++    area_of_grid = 5000 * 5000
++    totalsmb = reshape(np.nansum(smbbox / 1000, axis=(-2, -1)), (len(t), 1)) * area_of_grid
++
++    #save surface mass balance mat dataset
++    smbmean = np.nanmean(smbbox, axis=(0, 1))
++    SMB = {}
++    SMB['smbmean'] = smbmean
++    SMB['totalsmb '] = totalsmb
++    SMB['smbbox'] = smbbox
++    SMB['x1'] = x1
++    SMB['y1'] = y1
++    SMB['t'] = t
++
++    np.savez('./smbbox.npz', **SMB)
++
++    #plot a time series of total SMB
++    fig = plt.figure(tight_layout=True)
++    ax = fig.add_subplot(111)
++    ax.plot(t, totalsmb / 1e9)
++    ax.set_title('Total Surface mass balance, Gt')
++    ax.set_xlabel('year')
++    ax.set_ylabel('Gt/yr')
++
++    del smbbox
++    # }}}
++
++if 7 in steps:
++    #  Step 7: Historical Relaxation run {{{
++    print('   Step 7: Historical Relaxation run')
++    md = loadmodel('./Models/Greenland.Control_drag.nc')
++
++    with open('./smbbox.npz', "rb") as smbFile:
++        SMB = np.load(smbFile)
++        x1 = np.squeeze(SMB['x1'])
++        y1 = np.squeeze(SMB['y1'])
++        smbmean = np.squeeze(SMB['smbmean'])
++
++    #convert mesh x, y into the Box projection
++    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
++    [xi, yi] = ll2xy(md.mesh.lat, md.mesh.long, + 1, 45, 70)
++
++    #Interpolate and set surface mass balance
++    x1 = x1.flatten()
++    y1 = y1.flatten()
++    smbmean = smbmean.flatten()
++    index = BamgTriangulate(x1, y1)
++    smb_mo = InterpFromMeshToMesh2d(index, x1, y1, smbmean, xi, yi)
++    smb = smb_mo * 12 / 1000 * md.materials.rho_freshwater / md.materials.rho_ice
++    md.smb.mass_balance = np.append(smb, 1)
++
++    #Set transient options, run for 20 years, saving every timestep
++    md.timestepping.time_step = 0.2
++    md.timestepping.final_time = 20
++    md.settings.output_frequency = 1
++
++    #Additional options
++    md.inversion.iscontrol = 0
++    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
++    md.verbose = verbose('solution', True, 'module', True)
++
++    #Go solve
++    md.cluster = generic('name', gethostname(), 'np', 2)
++    md = solve(md, 'Transient')
++
++    export_netCDF(md, './Models/Greenland.HistoricTransient.nc')
++    # }}}
++
++if 8 in steps:
++    # Step 8: Plotting exercise {{{
++    print('   Step 8: Plotting exercise')
++    #Load historic transient model
++
++    #Create Line Plots of relaxation run. Create a figure.
++
++    #Save surface mass balance, by looping through 200 years (1000 steps)
++    #Note, the first output will always contain output from time step 1
++
++    #Plot surface mass balance time series in first subplot
++
++    #Title this plot Mean surface mass balance
++
++    #Save velocity by looping through 200 years
++
++    #Plot velocity time series in second subplot
++
++    #Title this plot Mean Velocity
++
++    #Save Ice Volume by looping through 200 years
++
++    #Plot volume time series in third subplot
++
++    #Title this plot Mean Velocity and add an x label of years
++    # }}}
++
++if 9 in steps:
++    # Step 9: Box Transient run{{{
++    print('   Step 9: Box Transient run')
++    md = loadmodel('./Models/Greenland.HistoricTransient.nc')
++
++    #load past transient results
++    md.geometry.base = md.results.TransientSolution[-1].Base
++    md.geometry.thickness = md.results.TransientSolution[-1].Thickness
++    md.geometry.surface = md.geometry.base + md.geometry.thickness
++    md.initialization.vx = md.results.TransientSolution[-1].Vx
++    md.initialization.vy = md.results.TransientSolution[-1].Vy
++    md.results = []
++
++    #convert mesh x, y into the Box projection
++    [md.mesh.lat, md.mesh.long] = xy2ll(md.mesh.x, md.mesh.y, + 1, 39, 71)
++    [xi, yi] = ll2xy(md.mesh.lat, md.mesh.long, + 1, 45, 70)
++
++    #Set surface mass balance
++    with open('./smbbox.npz', "rb") as smbFile:
++        SMB = np.load(smbFile)
++        x1 = np.squeeze(SMB['x1'])
++        y1 = np.squeeze(SMB['y1'])
++        smbbox = np.squeeze(SMB['smbbox'])
++
++    x1 = x1.flatten()
++    y1 = y1.flatten()
++    index = BamgTriangulate(x1, y1)
++    #Set years to run
++    years_of_simulation = np.arange(2003, 2012 + 1)
++
++    #initialize surface mass balance matrix
++    smb = np.nan * np.ones((md.mesh.numberofvertices, len(years_of_simulation) * 12))
++
++    #Interpolate and set surface mass balance
++    for year in years_of_simulation:
++        for month in range(0, 12):
++            smb_mo = griddata((np.double(x1), np.double(y1)), np.double(smbbox[year - 1840, month, :, :].flatten()), (xi, yi), method='nearest')
++            smb[:, (year - years_of_simulation[0]) * 12 + month] = smb_mo
++    smb = smb * 12 / 1000 * md.materials.rho_freshwater / md.materials.rho_ice
++    timer = np.arange(1 / 24, len(years_of_simulation), 1 / 12)
++    md.smb.mass_balance = np.vstack((smb, timer))
++
++    #Set transient options, monthly timestep, saving every month
++    md.timestepping.time_step = 1 / 12
++    md.timestepping.final_time = len(years_of_simulation)
++    md.settings.output_frequency = 1
++
++    #Additional options
++    md.inversion.iscontrol = 0
++    md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'SmbMassBalance']
++    md.verbose = verbose('solution', True, 'module', True)
++
++    #Go solve
++    md.cluster = generic('name', gethostname(), 'np', 2)
++    md = solve(md, 'Transient')
++
++    export_netCDF(md, './Models/Greenland.BoxTransient.nc')
++    # }}}
++
++if 10 in steps:
++    print('   Step 10: Plot Box Transient')
++    md = loadmodel('./Models/Greenland.BoxTransient.nc')
++
++    #Set years run
++    years_of_simulation = np.arange(2003, 2012 + 1)
++    t = np.arange(years_of_simulation[0], years_of_simulation[-1] + 11 / 12, 1 / 12)
++
++    #Line Plots
++    layout, ax = plt.subplots(3, 1, sharex=True, sharey=False, figsize=(5, 5))
++    #Plot surface mass balance
++    surfmb = []
++    vel = []
++    volume = []
++    for i in range(0, len(t)):
++        surfmb.append(md.results.TransientSolution[i].TotalSmb)
++        vel.append(md.results.TransientSolution[i].Vel)
++        volume.append(md.results.TransientSolution[i].IceVolume)
++    ax[0].plot(t, surfmb)
++    ax[0].set_title('Total Surface mass balance')
++    ax[1].plot(t, np.nanmax(vel, axis=1))
++    ax[1].set_title('Max Velocity')
++    ax[2].plot(t, volume)
++    ax[2].set_title('Ice Volume')
++    ax[2].set_xlabel('years')
+
+Property changes on: ../trunk-jpl/examples/Greenland/runme.py
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26559-26560.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26559-26560.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26559-26560.diff	(revision 26740)
@@ -0,0 +1,121 @@
+Index: ../trunk-jpl/examples/Inversion/Square.py
+===================================================================
+--- ../trunk-jpl/examples/Inversion/Square.py	(nonexistent)
++++ ../trunk-jpl/examples/Inversion/Square.py	(revision 26560)
+@@ -0,0 +1,24 @@
++import numpy as np
++from SetIceShelfBC import SetIceShelfBC
++#Start defining model parameters here
++
++print('      creating thickness')
++hmin = 300
++hmax = 1000
++ymin = np.nanmin(md.mesh.y)
++ymax = np.nanmax(md.mesh.y)
++md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin)
++md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
++md.geometry.surface = md.geometry.base + md.geometry.thickness
++
++print('      creating drag')
++md.friction.coefficient = np.where(md.mask.ocean_levelset < 0., 0., 200)
++md.friction.p = np.ones((md.mesh.numberofelements))
++md.friction.q = np.ones((md.mesh.numberofelements))
++
++print('      creating flow law paramter')
++md.materials.rheology_B = np.where(md.mesh.x < md.mesh.y, 1.4 * 1e8, 1.8 * 1e8)
++md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
++
++print('      creating boundary conditions')
++md = SetIceShelfBC(md, 'Front.exp')
+Index: ../trunk-jpl/examples/Inversion/runme.py
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.py	(nonexistent)
++++ ../trunk-jpl/examples/Inversion/runme.py	(revision 26560)
+@@ -0,0 +1,87 @@
++import numpy as np
++from model import *
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from generic import generic
++from solve import solve
++from plotmodel import plotmodel
++from export_netCDF import export_netCDF
++from m1qn3inversion import m1qn3inversion
++from verbose import verbose
++from loadmodel import loadmodel
++from cuffey import cuffey
++steps = [4]
++Clims = [1.3 * 1e8, 1.9 * 1e8]
++
++if 1 in steps:
++    #Generate observations
++    md = model()
++    md = triangle(md, 'DomainOutline.exp', 100000)
++    md = setmask(md, 'all', '')
++    md = parameterize(md, 'Square.py')
++    md = setflowequation(md, 'SSA', 'all')
++    md.cluster = generic('np', 2)
++    md = solve(md, 'Stressbalance')
++    plotmodel(md, 'axis#all', 'tight', 'data', md.materials.rheology_B, 'caxis', Clims, 'title', '"True" B',
++              'data', md.results.StressbalanceSolution.Vel, 'title', '"observed velocities"')
++    export_netCDF(md, 'model1.nc')
++
++if 2 in steps:
++    #Modify rheology, now constant
++    md = loadmodel('model1.nc')
++    md.materials.rheology_B[:] = 1.8 * 1e8
++
++    #results of previous run are taken as observations
++    md.inversion = m1qn3inversion()
++    md.inversion.vx_obs = md.results.StressbalanceSolution.Vx
++    md.inversion.vy_obs = md.results.StressbalanceSolution.Vy
++    md.inversion.vel_obs = md.results.StressbalanceSolution.Vel
++
++    md = solve(md, 'Stressbalance')
++    plotmodel(md, 'axis#all', 'tight', 'data', md.materials.rheology_B, 'caxis', Clims, 'title', 'B first guess',
++              'data', md.results.StressbalanceSolution.Vel, 'title', 'modeled velocities')
++    export_netCDF(md, 'model2.nc')
++
++
++if 3 in steps:
++    #invert for ice rigidity
++    md = loadmodel('model2.nc')
++
++    #Set up inversion parameters
++    maxsteps = 20
++    md.inversion.iscontrol = 1
++    md.inversion.control_parameters = ['MaterialsRheologyBbar']
++    md.inversion.maxsteps = maxsteps
++    md.inversion.cost_functions = [101]
++    md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 1))
++    md.inversion.min_parameters = cuffey(273) * np.ones((md.mesh.numberofvertices, 1))
++    md.inversion.max_parameters = cuffey(200) * np.ones((md.mesh.numberofvertices, 1))
++
++    #Go solve!
++    md.verbose = verbose(0)
++    md = solve(md, 'Stressbalance')
++    plotmodel(md, 'axis#all', 'tight', 'data', md.results.StressbalanceSolution.MaterialsRheologyBbar, 'caxis', Clims, 'title', 'inferred B',
++              'data', md.results.StressbalanceSolution.Vel, 'title', 'modeled velocities')
++
++
++if 4 in steps:
++    #invert for ice rigidity
++    md = loadmodel('model2.nc')
++
++    #Set up inversion parameters
++    maxsteps = 20
++    md.inversion.iscontrol = 1
++    md.inversion.control_parameters = ['MaterialsRheologyBbar']
++    md.inversion.maxsteps = maxsteps
++    md.inversion.cost_functions = [101, 502]
++    md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
++    md.inversion.cost_functions_coefficients[:, 1] = 1e-16
++    md.inversion.min_parameters = cuffey(273) * np.ones((md.mesh.numberofvertices, 1))
++    md.inversion.max_parameters = cuffey(200) * np.ones((md.mesh.numberofvertices, 1))
++
++    #Go solve!
++    md.verbose = verbose(0)
++    md = solve(md, 'Stressbalance')
++    plotmodel(md, 'axis#all', 'tight', 'data', md.results.StressbalanceSolution.MaterialsRheologyBbar, 'caxis', Clims, 'title', 'inferred B',
++              'data', md.results.StressbalanceSolution.Vel, 'title', 'modeled velocities')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26560-26561.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26560-26561.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26560-26561.diff	(revision 26740)
@@ -0,0 +1,354 @@
+Index: ../trunk-jpl/examples/ISMIP/IsmipA.py
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/IsmipA.py	(nonexistent)
++++ ../trunk-jpl/examples/ISMIP/IsmipA.py	(revision 26561)
+@@ -0,0 +1,55 @@
++import numpy as np
++from plotmodel import plotmodel
++from SetIceSheetBC import SetIceSheetBC
++#Parameterization for ISMIP A experiment
++
++#Set the Simulation generic name #md.miscellaneous
++#->
++
++#Geometry
++print('   Constructing Geometry')
++
++#Define the geometry of the simulation #md.geometry
++#surface is [-x*tan(0.5*pi/180)] #md.mesh
++#->
++
++#base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]
++#L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
++#->
++
++#->
++
++#thickness is the difference between surface and base #md.geometry
++#->
++
++#plot the geometry to check it out
++#->
++
++
++print('   Defining friction parameters')
++
++#These parameters will not be used but need to be fixed #md.friction
++#one friciton coefficient per node (md.mesh.numberofvertices,1)
++#->
++
++#one friciton exponent (p,q) per element
++#->
++
++#->
++
++
++print('   Construct ice rheological properties')
++
++#The rheology parameters sit in the material section #md.materials
++#B has one value per vertex
++#->
++
++#n has one value per element
++#->
++
++
++print('   Set boundary conditions')
++
++#Set the default boundary conditions for an ice-sheet
++# help SetIceSheetBC
++#->
+Index: ../trunk-jpl/examples/ISMIP/IsmipF.py
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/IsmipF.py	(nonexistent)
++++ ../trunk-jpl/examples/ISMIP/IsmipF.py	(revision 26561)
+@@ -0,0 +1,67 @@
++import numpy as np
++from plotmodel import plotmodel
++from SetIceSheetBC import SetIceSheetBC
++#Parameterization for ISMIP F experiment
++
++#Set the Simulation generic name #md.miscellaneous
++#->
++
++#Geometry
++print('   Constructing Geometry')
++
++#Define the geometry of the simulation #md.geometry
++#surface is [-x*tan(3.0*pi/180)] #md.mesh
++#->
++
++#base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]
++#L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
++#->
++
++#->
++
++#thickness is the difference between surface and base #md.geometry
++#->
++
++#plot the geometry to check it out
++#->
++
++
++print('   Defining friction parameters')
++
++#These parameters will not be used but need to be fixed #md.friction
++#one friciton coefficient per node (md.mesh.numberofvertices,1)
++#conversion from year to seconds with #md.constants.yts
++#->
++
++#one friction exponent (p,q) per element
++#->
++
++#->
++
++
++print('   Construct ice rheological properties')
++
++#The rheology parameters sit in the material section #md.materials
++#B has one value per vertex
++#->
++
++#n has one value per element
++#->
++
++
++print('   Set boundary conditions')
++
++#Set the default boundary conditions for an ice-sheet
++# #help SetIceSheetBC
++#->
++
++print('   Initializing velocity and pressure')
++
++#initialize the velocity and pressurefields of #md.initialization
++#->
++
++#->
++
++#->
++
++#->
+Index: ../trunk-jpl/examples/ISMIP/runme.py
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.py	(nonexistent)
++++ ../trunk-jpl/examples/ISMIP/runme.py	(revision 26561)
+@@ -0,0 +1,217 @@
++import numpy as np
++from model import *
++from squaremesh import squaremesh
++from plotmodel import plotmodel
++from export_netCDF import export_netCDF
++from loadmodel import loadmodel
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from socket import gethostname
++from solve import solve
++#which steps to perform; steps are from 1 to 8
++#step 7 is specific to ISMIPA
++#step 8 is specific to ISMIPF
++
++steps = [1]
++
++# parameter file to be used, choose between IsmipA.py or IsmipF.py
++ParamFile = 'IsmipA.py'
++
++#Run Steps
++
++#Mesh Generation #1
++if 1 in steps:
++    print("Now generating the mesh")
++    #initialize md as a new model #help(model)
++    #->
++
++    # generate a squaremesh #help(squaremesh)
++    # Side is 80 km long with 20 points
++    #->
++
++    # plot the given mesh #plotdoc
++    #->
++
++    # save the given model
++    #->
++
++#Masks #2
++if 2 in steps:
++    print("Setting the masks")
++    # load the preceding step #help(loadmodel)
++    # path is given by the organizer with the name of the given step
++    #->
++
++    # set the mask #help(setmask)
++    # all MISMIP nodes are grounded
++    #->
++
++    # plot the given mask #md.mask to locate the field
++    #->
++
++    # save the given model
++    #->
++
++#Parameterization #3
++if 3 in steps:
++    print("Parameterizing")
++    # load the preceding step #help(loadmodel)
++    # path is given by the organizer with the name of the given step
++    #->
++
++    # parametrize the model # help(parameterize)
++    # you will need to fil-up the parameter file (given by the
++    # ParamFile variable)
++    #->
++
++    # save the given model
++    #->
++
++
++#Extrusion #4
++if 4 in steps:
++    print("Extruding")
++    # load the preceding step #help(loadmodel)
++    # path is given by the organizer with the name of the given step
++    #->
++
++    # vertically extrude the preceding mesh #help(extrude)
++    # only 5 layers exponent 1
++    #->
++
++    # plot the 3D geometry #plotdoc
++    #->
++
++    # save the given model
++    #->
++
++#Set the flow computing method #5
++if 5 in steps:
++    print("setting flow approximation")
++    # load the preceding step #help(loadmodel)
++    # path is given by the organizer with the name of the given step
++    #->
++
++    # set the approximation for the flow computation #help(setflowequation)
++    # We will be using the Higher Order Model (HO)
++    #->
++
++    # save the given model
++    #->
++
++#Set Boundary Conditions #6
++if 6 in steps:
++    print("setting boundary conditions")
++    # load the preceding step #help(loadmodel)
++    # path is given by the organizer with the name of the given step
++    #->
++
++    # dirichlet boundary condition are known as SPCs
++    # ice frozen to the base, no velocity   #md.stressbalance
++    # SPCs are initialized at NaN one value per vertex
++    #->
++
++    #->
++
++    #->
++
++    # extract the nodenumbers at the base #md.mesh.vertexonbase
++    #->
++
++    # set the sliding to zero on the bed (Vx and Vy)
++    #->
++
++    #->
++
++    # periodic boundaries have to be fixed on the sides
++    # Find the indices of the sides of the domain, for x and then for y
++    # for x
++    # create maxX, list of indices where x is equal to max of x
++    #->
++
++    # create minX, list of indices where x is equal to min of x
++    #->
++
++    # for y
++    # create maxY, list of indices where y is equal to max of y
++    # but not where x is equal to max or min of x
++    # (i.e, indices in maxX and minX should be excluded from maxY and minY)
++    #->
++
++    # create minY, list of indices where y is equal to max of y
++    # but not where x is equal to max or min of x
++    #->
++
++    # set the node that should be paired together, minX with maxX and minY with maxY
++    # #md.stressbalance.vertex_pairing
++    #->
++
++    if ParamFile=='IsmipF.py':
++        # if we are dealing with IsmipF the solution is in masstransport
++        md.masstransport.vertex_pairing = md.stressbalance.vertex_pairing
++
++    # save the given model
++    #->
++
++#Solving #7
++if 7 in steps:
++    print("running the solver for the A case")
++    # load the preceding step #help(loadmodel)
++    # path is given by the organizer with the name of the given step
++    #->
++
++    # Set cluster #md.cluster
++    # generic parameters #help(generic)
++    # set only the name and number of process
++    #->
++
++    # Set which control message you want to see #help(verbose)
++    #->
++
++    # Solve #help(solve)
++    # we are solving a StressBalanc
++    #->
++
++    # save the given model
++    #->
++
++    # plot the surface velocities #plotdoc
++    #->
++
++#Solving #8
++if 8 in steps:
++    print("running the solver for the F case")
++    # load the preceding step #help(loadmodel)
++    # path is given by the organizer with the name of the given step
++    #->
++
++    # Set cluster #md.cluster
++    # generic parameters #help(generic)
++    # set only the name and number of process
++    #->
++
++    # Set which control message you want to see #help(verbose)
++    #->
++
++    # set the transient model to ignore the thermal model
++    # #md.transient
++    #->
++
++    # define the timestepping scheme
++    # everything here should be provided in years #md.timestepping
++    # give the length of the time_step (4 years)
++    #->
++
++    # give final_time (20*4 years time_steps)
++    #->
++
++    # Solve #help(solve)
++    # we are solving a TransientSolution
++    #->
++
++    # save the given model
++    #->
++
++    # plot the surface velocities #plotdoc
++    #->
Index: /issm/oecreview/Archive/25834-26739/ISSM-26561-26562.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26561-26562.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26561-26562.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/examples/Mesh/circles.py
+===================================================================
+--- ../trunk-jpl/examples/Mesh/circles.py	(nonexistent)
++++ ../trunk-jpl/examples/Mesh/circles.py	(revision 26562)
+@@ -0,0 +1,11 @@
++import numpy as np
++
++
++def circles(x, y):
++
++    u = 4 * x - 2
++    v = 4 * y - 2
++
++    vel = np.tanh(30 * (u**2 + v**2 - 0.25)) + np.tanh(30 * ((u - 0.75)**2 + (v - 0.75)**2 - 0.25)) + np.tanh(30 * ((u - 0.75)**2 + (v + 0.75)**2 - 0.25)) + np.tanh(30 * ((u + 0.75)**2 + (v - 0.75)**2 - 0.25)) + np.tanh(30 * ((u + 0.75)**2 + (v + 0.75)**2 - 0.25))
++
++    return vel
+Index: ../trunk-jpl/examples/Mesh/shock.py
+===================================================================
+--- ../trunk-jpl/examples/Mesh/shock.py	(nonexistent)
++++ ../trunk-jpl/examples/Mesh/shock.py	(revision 26562)
+@@ -0,0 +1,7 @@
++import numpy as np
++
++
++def shock(x, y):
++
++    vel = np.exp(-(np.sqrt((x + 0.1)**2 + (y + 0.1)**2) - 0.75)**2 * 1e6) + ((x + 0.1)**2 + (y + 0.1)**2) / 2
++    return vel
Index: /issm/oecreview/Archive/25834-26739/ISSM-26562-26563.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26562-26563.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26562-26563.diff	(revision 26740)
@@ -0,0 +1,58 @@
+Index: ../trunk-jpl/examples/SquareIceShelf/Square.py
+===================================================================
+--- ../trunk-jpl/examples/SquareIceShelf/Square.py	(nonexistent)
++++ ../trunk-jpl/examples/SquareIceShelf/Square.py	(revision 26563)
+@@ -0,0 +1,32 @@
++import numpy as np
++from paterson import paterson
++from SetIceShelfBC import SetIceShelfBC
++#Start defining model parameters here
++
++print('      creating thickness')
++hmin = 300
++hmax = 1000
++ymin = np.nanmin(md.mesh.y)
++ymax = np.nanmax(md.mesh.y)
++md.geometry.thickness = hmax + (hmin - hmax) * (md.mesh.y - ymin) / (ymax - ymin)
++md.geometry.base = - md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
++md.geometry.surface = md.geometry.base + md.geometry.thickness
++
++print('      creating drag')
++md.friction.coefficient = np.where(md.mask.ocean_levelset < 0., 0, 200)
++md.friction.p = np.ones((md.mesh.numberofelements))
++md.friction.q = np.ones((md.mesh.numberofelements))
++
++print('      initial velocity')
++md.initialization.vx = np.zeros((md.mesh.numberofvertices))
++md.initialization.vy = np.zeros((md.mesh.numberofvertices))
++md.initialization.vz = np.zeros((md.mesh.numberofvertices))
++md.initialization.vel = np.zeros((md.mesh.numberofvertices))
++
++print('      creating flow law parameter')
++md.materials.rheology_B = paterson((273 - 20) * np.ones((md.mesh.numberofvertices)))
++md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
++md.damage.D = np.zeros((md.mesh.numberofvertices))
++
++print('      creating boundary conditions')
++md = SetIceShelfBC(md, 'Front.exp')
+Index: ../trunk-jpl/examples/SquareIceShelf/runme.py
+===================================================================
+--- ../trunk-jpl/examples/SquareIceShelf/runme.py	(nonexistent)
++++ ../trunk-jpl/examples/SquareIceShelf/runme.py	(revision 26563)
+@@ -0,0 +1,16 @@
++from model import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from generic import generic
++from socket import gethostname
++from solve import solve
++
++md = model()
++md = triangle(md, 'DomainOutline.exp', 100000)
++md = setmask(md, 'all', '')
++md = parameterize(md, 'Square.py')
++md = setflowequation(md, 'SSA', 'all')
++md.cluster = generic('name', gethostname(), 'np', 2)
++md = solve(md, 'Stressbalance')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26563-26564.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26563-26564.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26563-26564.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/examples/shakti/moulin.py
+===================================================================
+--- ../trunk-jpl/examples/shakti/moulin.py	(revision 26563)
++++ ../trunk-jpl/examples/shakti/moulin.py	(revision 26564)
+@@ -17,7 +17,7 @@
+ 
+ # Materials
+ # Ice flow law parameter (note that the standard parameter A = B^(- 3))
+-md.materials.rheology_B = 5e-25**(-1 / 3) * np.ones(md.mesh.numberofvertices)
++md.materials.rheology_B = 5e-25**(-1. / 3.) * np.ones(md.mesh.numberofvertices)
+ md.initialization.temperature = 273. * np.ones(md.mesh.numberofvertices)
+ md.materials.rheology_n = 3. * np.ones(md.mesh.numberofelements)
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26564-26565.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26564-26565.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26564-26565.diff	(revision 26740)
@@ -0,0 +1,57 @@
+Index: ../trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp	(revision 26564)
++++ ../trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp	(revision 26565)
+@@ -188,6 +188,7 @@
+ 	/*intermediary:*/
+ 	long* lmatrix=NULL;
+ 	bool* bmatrix=NULL;
++	float* smatrix=NULL;
+ 	int i;
+ 	PyObject* py_matrix2=NULL;
+ 
+@@ -211,8 +212,17 @@
+ 				py_matrix=py_matrix2;
+ 			}
+ 
+-			if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) {
++			if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_FLOAT) {
+ 				/*retrieve internal value: */
++				smatrix=(float*)PyArray_DATA((PyArrayObject*)py_matrix);
++
++				/*transform into double matrix: */
++				matrix=xNew<double>(M*N);
++				for(i=0;i<M*N;i++)matrix[i]=(double)smatrix[i];
++			}
++
++			else if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) {
++				/*retrieve internal value: */
+ 				dmatrix=(double*)PyArray_DATA((PyArrayObject*)py_matrix);
+ 
+ 				/*copy matrix: */
+@@ -557,6 +567,7 @@
+ 	/*intermediary:*/
+ 	long* lvector=NULL;
+ 	bool* bvector=NULL;
++	float* svector=NULL;
+ 	int i;
+ 	PyObject* py_vector2=NULL;
+ 
+@@ -583,8 +594,16 @@
+ 				py_vector=py_vector2;
+ 			}
+ 
+-			if      (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_DOUBLE) {
++			if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_FLOAT) {
+ 				/*retrieve internal value: */
++				svector=(float*)PyArray_DATA((PyArrayObject*)py_vector);
++
++				/*transform into double matrix: */
++				vector=xNew<double>(M);
++				for(i=0;i<M;i++)vector[i]=(double)svector[i];
++			}
++			else if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_DOUBLE) {
++				/*retrieve internal value: */
+ 				dvector=(double*)PyArray_DATA((PyArrayObject*)py_vector);
+ 
+ 				/*copy vector: */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26565-26566.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26565-26566.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26565-26566.diff	(revision 26740)
@@ -0,0 +1,79 @@
+Index: ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py
+===================================================================
+--- ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26565)
++++ ../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 26566)
+@@ -7,20 +7,52 @@
+ 
+ 
+ class ResTable:
+-
+     def __init__(self):
+         self.data = []
++        self.sizes = []
+ 
+-    def update(self, row):
+-        if len(np.shape(row)) == 0:
+-            self.data.append(row)
++    def update(self, stepvar):
++        #if we have a scalar we just add it to the en
++        #we save the size of the current step for further treatment
++        if len(np.shape(stepvar)) == 0:
++            self.sizes.append(1)
++            self.data.append(stepvar)
++        # if it is an array we add the values one by one
++        #we save the size of the current step for further treatment
+         else:
+-            for r in row:
++            self.sizes.append(len(stepvar))
++            for r in stepvar:
+                 self.data.append(r)
+ 
+     def finalize(self, rows):
++        #we have more scalars than steps, so we have an array
+         if len(self.data) > rows:
+-            return np.reshape(self.data, newshape=(rows, int(len(self.data) / rows)))
++            #first check if all steps are the same size
++            SameSize = np.sum(np.asarray(self.sizes) - self.sizes[0]) == 0
++            if SameSize:
++                #same size for all steps, just reshape
++                return np.reshape(self.data, newshape=(rows, int(len(self.data) / rows)))
++            else:
++                #different sizes at each steps, first create a table big enough for the biggest step
++                startpoint = 0
++                datadim = len(np.shape(self.data))
++                if datadim == 1:
++                    outdat = np.nan * np.ones((rows, np.nanmax(self.sizes)))
++                    for step in range(rows):
++                        curlen = self.sizes[step]
++                        outdat[step, :curlen] = self.data[startpoint: startpoint + curlen]
++                        startpoint += curlen
++                elif datadim == 2:
++                    outdat = np.nan * np.ones((rows, np.nanmax(self.sizes), np.shape(self.data)[1]))
++                    for step in range(rows):
++                        curlen = self.sizes[step]
++                        outdat[step, :curlen, :] = self.data[startpoint: startpoint + curlen]
++                        startpoint += curlen
++
++                else:
++                    print("ERROR, reult treatment cant cope with dimensions above 2")
++                return outdat
++        #as much scalars as stpes (or less) so just one value per step
+         else:
+             return np.asarray(self.data)
+ 
+@@ -124,6 +156,7 @@
+                         for subfield in subfields:
+                             if subfield not in['errlog', 'outlog']:
+                                 StackedVar = ResTable()
++                                #first loop over the field (result type) to find the index of the last subfield (variable)
+                                 for listindex in range(0, Listsize):
+                                     try:
+                                         Var = md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__[subfield]
+@@ -134,6 +167,7 @@
+                                         #Some fields only exist for the first step
+                                         lastindex = listindex
+                                         continue
++                                    #Add the  subfield at the current step
+                                     Var = SqueezeVar(Var)
+                                     StackedVar.update(Var)
+                                 if verbose > 4:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26566-26567.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26566-26567.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26566-26567.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/io/loadvars.py
+===================================================================
+--- ../trunk-jpl/src/m/io/loadvars.py	(revision 26566)
++++ ../trunk-jpl/src/m/io/loadvars.py	(revision 26567)
+@@ -324,7 +324,6 @@
+                 classe = str(group) + '.' + str(subgroup)
+                 grpclass = str(getattr(NCData.groups[group].groups[subgroup], 'classtype'))
+                 class_dict[classe] = [grpclass, ]
+-                print(class_dict[classe][0])
+                 if class_dict[classe][0] not in ['dict', 'list', 'cell']:
+                     try:
+                         modulename = split(r'\.', class_dict[classe][0])[0]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26567-26568.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26567-26568.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26567-26568.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/modules/InterpFromGridToMesh.py
+===================================================================
+--- ../trunk-jpl/src/m/modules/InterpFromGridToMesh.py	(revision 26567)
++++ ../trunk-jpl/src/m/modules/InterpFromGridToMesh.py	(revision 26568)
+@@ -1,3 +1,4 @@
++import numpy as np
+ from InterpFromGridToMesh_python import InterpFromGridToMesh_python
+ 
+ 
+@@ -20,4 +21,4 @@
+     # Call mex module
+     data_mesh = InterpFromGridToMesh_python(x, y, data, x_mesh, y_mesh, default_value)
+     # Return
+-    return data_mesh
++    return np.squeeze(data_mesh)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26568-26569.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26568-26569.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26568-26569.diff	(revision 26740)
@@ -0,0 +1,317 @@
+Index: ../trunk-jpl/src/m/plot/colormaps/demmap.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/colormaps/demmap.py	(revision 26568)
++++ ../trunk-jpl/src/m/plot/colormaps/demmap.py	(revision 26569)
+@@ -63,8 +63,6 @@
+         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
+Index: ../trunk-jpl/src/m/plot/plotmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotmodel.py	(revision 26568)
++++ ../trunk-jpl/src/m/plot/plotmodel.py	(revision 26569)
+@@ -13,7 +13,7 @@
+ 
+ def plotmodel(md, *args):
+     '''
+-    PLOTMODEL - At command prompt, type 'plotdoc()' for additional 
++    PLOTMODEL - At command prompt, type 'plotdoc()' for additional
+     documentation.
+ 
+     TODO:
+@@ -30,7 +30,7 @@
+     #get number of subplots
+     subplotwidth = ceil(sqrt(numberofplots))
+ 
+-    # TODO: Check that commenting this out is correct; we do not need a hold 
++    # TODO: Check that commenting this out is correct; we do not need a hold
+     # under matplotlib, right?
+     #
+     # #get hold
+@@ -59,7 +59,7 @@
+ 
+     # Go through plots
+     #
+-    # NOTE: The following is where Python + matplolib differs substantially in 
++    # NOTE: The following is where Python + matplolib differs substantially in
+     #       implementation and inteface from MATLAB.
+     #
+     # Sources:
+@@ -82,7 +82,7 @@
+         if plotnum == 1:
+             plotnum = None
+ 
+-        # NOTE: The inline comments for each of the following parameters are 
++        # NOTE: The inline comments for each of the following parameters are
+         #       taken from https://matplotlib.org/api/_as_gen/mpl_toolkits.axes_grid1.axes_grid.ImageGrid.html
+         #
+         direction = options.list[0].getfieldvalue('direction', 'row') # {"row", "column"}, default: "row"
+@@ -94,7 +94,7 @@
+         # Translate MATLAB colorbar mode to matplotlib
+         #
+         # TODO:
+-        # - Add 'edge' option (research if there is a corresponding option in 
++        # - Add 'edge' option (research if there is a corresponding option in
+         #   MATLAB)?
+         #
+         colorbar = options.list[0].getfieldvalue('colorbar', 'on')  # on, off (single)
+@@ -117,7 +117,7 @@
+         #
+         #   rect(float, float, float, float) or int
+         #
+-        # The axes position, as a (left, bottom, width, height) tuple or as a 
++        # The axes position, as a (left, bottom, width, height) tuple or as a
+         # three-digit subplot position code (e.g., "121").
+         #
+         axgrid = ImageGrid(
+@@ -126,7 +126,6 @@
+             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,
+Index: ../trunk-jpl/src/m/plot/processdata.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/processdata.py	(revision 26568)
++++ ../trunk-jpl/src/m/plot/processdata.py	(revision 26569)
+@@ -14,7 +14,7 @@
+ 
+     See also: PLOTMODEL, PROCESSMESH
+     """
+-    # {{{ Initialization and grabbing auxiliaries
++    # Initialization and grabbing auxiliaries {{{
+     # check format
+     if (len(data) == 0 or (len(data) == 1 and not isinstance(data, dict) and np.isnan(data).all())):
+         raise ValueError("processdata error message: 'data' provided is empty")
+@@ -21,10 +21,17 @@
+     # get the shape
+     if 'numberofvertices2d' in dir(md.mesh):
+         numberofvertices2d = md.mesh.numberofvertices2d
+-        numberofelements2d = md.mesh.numberofelements2d
+     else:
+         numberofvertices2d = np.nan
+-        numberofelements2d = np.nan
++
++    if options.exist('amr'):
++        step = options.getfieldvalue('amr', 0)
++        numberofvertices = len(md.results.TransientSolution[step].MeshX)
++        numberofelements = np.shape(md.results.TransientSolution[step].MeshElements)[0]
++    else:
++        numberofvertices = md.mesh.numberofvertices
++        numberofelements = md.mesh.numberofelements
++
+     procdata = np.copy(data)
+     #initialize datatype
+     datatype = 0
+@@ -43,66 +50,64 @@
+     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
++
++    #  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:
++
++    #  quiver plot {{{
++    if datasize[1] > 1 and datasize[0] != numberofvertices + 1:
++        if datasize[0] == numberofvertices and datasize[1] == 2:
+             datatype = 3
+         else:
+             raise ValueError('plotmodel error message: data should have two columns of length md.mesh.numberofvertices for a quiver plot')
+     # }}}
+-    # {{{ element data
+ 
+-    if datasize[0] == md.mesh.numberofelements and datasize[1] == 1:
++    #  element data{{{
++    if datasize[0] == numberofelements and datasize[1] == 1:
+         #initialize datatype if non patch
+         if datatype != 4 and datatype != 5:
+             datatype = 1
+-    # {{{mask
++        # AMR {{{
++        if options.exist('amr'):
++            nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshElements))
++            procdata = procdata[nonan]
++        # }}}
++        # mask {{{
+         if options.exist('mask'):
+             flags = options.getfieldvalue('mask')
+             hide = np.invert(flags)
+-            if np.size(flags) == md.mesh.numberofvertices:
++            if np.size(flags) == numberofvertices:
+                 EltMask = np.asarray([np.any(np.in1d(index, np.where(hide))) for index in md.mesh.elements - 1])
+                 procdata = np.ma.array(procdata, mask=EltMask)
+                 options.addfielddefault('cmap_set_bad', 'w')
+-            elif np.size(flags) == md.mesh.numberofelements:
++            elif np.size(flags) == numberofelements:
+                 procdata = np.ma.array(procdata, mask=hide)
+                 options.addfielddefault('cmap_set_bad', 'w')
+             else:
+                 print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
++        # }}}
++
+     # }}}
+ 
+-    # }}}
+-    # {{{ node data
+-    if datasize[0] == md.mesh.numberofvertices and datasize[1] == 1:
++    #  node data {{{
++    if datasize[0] in [numberofvertices, numberofvertices2d] and datasize[1] == 1:
+         datatype = 2
+-    # {{{ Mask
++        # AMR {{{
++        if options.exist('amr'):
++            nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshX))
++            procdata = procdata[nonan]
++        # }}}
++        #  Mask {{{
+         if options.exist('mask'):
+             flags = options.getfieldvalue('mask')
+             hide = np.invert(flags)
+-            if np.size(flags) == md.mesh.numberofvertices:
++            if np.size(flags) == numberofvertices:
+                 procdata = np.ma.array(procdata, mask=hide)
+                 options.addfielddefault('cmap_set_bad', 'w')
+-            elif np.size(flags) == md.mesh.numberofelements:
++            elif np.size(flags) == numberofelements:
+                 NodeMask = np.zeros(np.shape(md.mesh.x), dtype=bool)
+                 HideElt = md.mesh.elements[np.where(hide)[0]] - 1
+                 NodeMask[HideElt] = True
+@@ -110,10 +115,11 @@
+                 options.addfielddefault('cmap_set_bad', 'w')
+             else:
+                 print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
++        # }}}
+     # }}}
+-    # }}}
+-    # {{{ spc time series
+-    if datasize[0] == md.mesh.numberofvertices + 1:
++
++    #  spc time series {{{
++    if datasize[0] == numberofvertices + 1:
+         datatype = 2
+         spccol = options.getfieldvalue('spccol', 0)
+         print('multiple-column spc field; specify column to plot using option "spccol"')
+@@ -120,17 +126,36 @@
+         print(('column ', spccol, ' plotted for time: ', procdata[-1, spccol]))
+         procdata = procdata[0:-1, spccol]
+ 
+-    #mask?
++        #mask?
+ 
+-    #layer projection?
++        #layer projection?
+ 
+-    #control arrow density if quiver plot
++        #control arrow density if quiver plot
+     # }}}
+-    # {{{ convert rank - 2 array to rank - 1
++
++    # 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
++
++    #  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))
++        #clim looks to be deprecated and replaced by caxis
++        #options.addfielddefault('clim', [lb, ub])
++        options.addfielddefault('cmap_set_under', '1')
++        print(("WARNING: nan's treated as", nanfill, "by default.  Change using pairoption 'nan', nan_fill_value in plotmodel call"))
++    # }}}
++
++    #  if datatype is still zero, error out {{{
+     if datatype == 0:
+         raise ValueError("processdata error: data provided not recognized or not supported")
+     else:
+Index: ../trunk-jpl/src/m/plot/processmesh.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/processmesh.py	(revision 26568)
++++ ../trunk-jpl/src/m/plot/processmesh.py	(revision 26569)
+@@ -40,14 +40,24 @@
+ 
+     if hasattr(md.mesh, 'elements2d'):
+         elements2d = md.mesh.elements2d
++        numofvertices2d = md.mesh.numberofvertices2d
++        numofelements2d = md.mesh.numberofelements2d
++    else:
++        numofvertices2d = np.nan
++        numofelements2d = np.nan
+ 
+     if options.exist('amr'):
+         step = options.getfieldvalue('amr')
+-        x = md.results.TransientSolution[step].MeshX
+-        y = md.results.TransientSolution[step].MeshY
+-        elements = md.results.TransientSolution[step].MeshElements
++        nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshX))
++        x = md.results.TransientSolution[step].MeshX[nonan]
++        y = md.results.TransientSolution[step].MeshY[nonan]
++        nonan = np.nonzero(~np.isnan(md.results.TransientSolution[step].MeshElements))
++        elements = md.results.TransientSolution[step].MeshElements[nonan] - 1
++        eldim = np.shape(md.results.TransientSolution[step].MeshElements)[1]
++        elements = np.reshape(elements, ((int(len(elements) / eldim), eldim)))
++
+     else:
+-        elements = md.mesh.elements
++        elements = md.mesh.elements - 1
+         if options.getfieldvalue('coord', 'xy') != 'latlon':
+             x = md.mesh.x
+             if hasattr(md.mesh, 'x2d'):
+@@ -64,16 +74,15 @@
+     if isinstance(z, str):
+         z = getattr(md, z)
+ 
++    force2D = numofelements2d in np.shape(data) or numofvertices2d in np.shape(data)
+     #is it a 2D plot?
+-    if md.mesh.dimension() == 2 or options.getfieldvalue('layer', 0) >= 1:
++    if md.mesh.dimension() == 2 or options.getfieldvalue('layer', 0) >= 1 or force2D:
+         is2d = 1
+     else:
+         is2d = 0
+ 
+-    elements = md.mesh.elements - 1
+-
+     #layer projection?
+-    if options.getfieldvalue('layer', 0) >= 1:
++    if options.getfieldvalue('layer', 0) >= 1 or force2D:
+         if options.getfieldvalue('coord', 'xy') == 'latlon':
+             raise Exception('processmesh error message: cannot work with 3D meshes for now')
+         #we modify the mesh temporarily to a 2d mesh from which the 3d mesh was extruded
Index: /issm/oecreview/Archive/25834-26739/ISSM-26569-26570.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26569-26570.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26569-26570.diff	(revision 26740)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/classes/clusters/saga.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/clusters/saga.py	(revision 26569)
++++ ../trunk-jpl/src/m/classes/clusters/saga.py	(revision 26570)
+@@ -168,5 +168,8 @@
+     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)
+-    # }}}
++        try:
++            issmscpin(self.name, self.login, self.port, directory, filelist)
++        except OSError:
++            print("File does not exsit, skiping")
++            # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26570-26571.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26570-26571.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26570-26571.diff	(revision 26740)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/m/classes/damage.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.py	(revision 26570)
++++ ../trunk-jpl/src/m/classes/damage.py	(revision 26571)
+@@ -69,9 +69,10 @@
+     # }}}
+ 
+     def extrude(self, md):  # {{{
+-        self.D = project3d(md, 'vector', self.D, 'type', 'node')
+-        self.spcdamage = project3d(md, 'vector', self.spcdamage, 'type', 'node')
+-        return self
++        if self.isdamage:
++            self.D = project3d(md, 'vector', self.D, 'type', 'node')
++            self.spcdamage = project3d(md, 'vector', self.spcdamage, 'type', 'node')
++            return self
+     #}}}
+ 
+     def setdefaultparameters(self):  # {{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26571-26572.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26571-26572.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26571-26572.diff	(revision 26740)
@@ -0,0 +1,102 @@
+Index: ../trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py
+===================================================================
+--- ../trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 26571)
++++ ../trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 26572)
+@@ -66,11 +66,14 @@
+         #%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
++            try:
++                if len(res_struct.__dict__[solution]) > num_of_timesteps:
++                    num_of_timesteps = len(res_struct.__dict__[solution])
++                    num_of_timesteps = int(num_of_timesteps)
++                    if 'Surface' in dict.keys(res_struct.__dict__[solution][0].__dict__):
++                        moving_mesh = True
++            except TypeError:
++                continue
+     else:
+         num_of_timesteps = 1
+     # }}}
+@@ -91,6 +94,7 @@
+     else:
+         raise BadDimension('exportVTK does not support your element type')
+ 
++    #only keep the envelope and not the bulk of the results.
+     if enveloppe:
+         if dim == 3:
+             mesh_alti = '1'
+@@ -251,30 +255,44 @@
+         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])
++                #dealing with results on different timesteps
++                try:
++                    if(len(res_struct.__dict__[sol]) > timestep):
++                        timestep = step
++                    else:
++                        timestep = np.size(res_struct.__dict__[sol])
++                except TypeError:
++                    #result as no len() so no timesteps
++                    timestep = 1
+ 
+-    #getting the  fields in the solution
+-                if(type(res_struct.__dict__[sol]) == list):
++                #getting the  fields in the solution
++                if(type(res_struct.__dict__[sol]).__name__ == 'solution'):
+                     spe_res_struct = res_struct.__dict__[sol].__getitem__(timestep)
+                     fieldnames = dict.keys(spe_res_struct.__dict__)
++                elif(type(res_struct.__dict__[sol]).__name__ == 'solutionstep'):
++                    spe_res_struct = res_struct.__dict__[sol]
++                    fieldnames = dict.keys(spe_res_struct.__dict__)
++                elif(type(res_struct.__dict__[sol]).__name__ == 'results'):  #this is a result without steps
++                    spe_res_struct = res_struct.__dict__[sol]
++                    fieldnames = dict.keys(spe_res_struct.__dict__)
+                 else:
++                    print("WARNING, solution type '{}' is not recognise, exported results might be wrong".format(type(res_struct.__dict__[sol])))
+                     spe_res_struct = res_struct.__dict__[sol]
+                     fieldnames = dict.keys(spe_res_struct.__dict__)
+ 
+-    #Sorting scalars, vectors and tensors
++                #Sorting scalars, vectors and tensors
+                 tensors = [field for field in fieldnames if field[-2:] in ['xx', 'yy', 'xy', 'zz', 'xz', 'yz']]
+                 non_tensor = [field for field in fieldnames if field not in tensors]
+                 vectors = [field for field in non_tensor if field[-1] in ['x', 'y', 'z'] and field[-4:] not in ['Flux']]
+ 
+-    #check which field is a real result and print
++                #check which field is a real result and print
+                 for field in fieldnames:
++                    print("Treating {}".format(field))
+                     if field in treated_res:
++                        print("{} is already done".format(field))
+                         continue
+                     elif field in vectors:
++                        print("{} is a vector".format(field))
+                         try:
+                             Vxstruct = np.squeeze(spe_res_struct.__dict__[field[:-1] + 'x'])
+                             Vystruct = np.squeeze(spe_res_struct.__dict__[field[:-1] + 'y'])
+@@ -298,6 +316,7 @@
+                                 fid.write('{:f} {:f} {:f}\n'.format(Vx, Vy, 0))
+ 
+                     elif field in tensors:
++                        print("{} is a tensor".format(field))
+                         try:
+                             Txxstruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'xx'])
+                             Txystruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'xy'])
+@@ -345,7 +364,6 @@
+                             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:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26572-26573.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26572-26573.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26572-26573.diff	(revision 26740)
@@ -0,0 +1,85 @@
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 26572)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 26573)
+@@ -79,7 +79,7 @@
+         md = model()
+     """
+ 
+-    def __init__(self, *args): #{{{
++    def __init__(self, *args):  #{{{
+         self.mesh = None
+         self.mask = None
+ 
+@@ -188,7 +188,7 @@
+         return s
+     #}}}
+ 
+-    def properties(self): #{{{
++    def properties(self):  #{{{
+         # ordered list of properties since vars(self) is random
+         return [
+             'mesh',
+@@ -238,7 +238,7 @@
+         ]
+     #}}}
+ 
+-    def setdefaultparameters(self, planet): #{{{
++    def setdefaultparameters(self, planet):  #{{{
+         self.mesh = mesh2d()
+         self.mask = mask()
+         self.constants = constants()
+@@ -285,7 +285,7 @@
+         self.stochasticforcing = stochasticforcing()
+     #}}}
+ 
+-    def checkmessage(self, string): #{{{
++    def checkmessage(self, string):  #{{{
+         print("model not consistent: {}".format(string))
+         self.private.isconsistent = False
+         return self
+@@ -292,7 +292,7 @@
+     #}}}
+     #@staticmethod
+ 
+-    def extract(self, area): #{{{
++    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
+@@ -370,7 +370,7 @@
+             #get field
+             field = getattr(md1, fieldi)
+             fieldsize = np.shape(field)
+-            if hasattr(field, '__dict__') and fieldi not in ['results']: #recursive call
++            if hasattr(field, '__dict__') and fieldi not in ['results']:  #recursive call
+                 object_fields = vars(field)
+                 for fieldj in object_fields:
+                     #get field
+@@ -571,7 +571,7 @@
+         return md2
+     #}}}
+ 
+-    def extrude(md, *args): #{{{
++    def extrude(md, *args):  #{{{
+         """EXTRUDE - vertically extrude a 2d mesh
+ 
+         vertically extrude a 2d mesh and create corresponding 3d mesh.
+@@ -758,7 +758,7 @@
+         return md
+     #}}}
+ 
+-    def collapse(md): #{{{
++    def collapse(md):  #{{{
+         """COLLAPSE - collapses a 3d mesh into a 2d mesh
+ 
+         This routine collapses a 3d model into a 2d model and collapses all
+@@ -975,7 +975,7 @@
+         if np.size(md.mesh.scale_factor) == md.mesh.numberofvertices:
+             mesh.scale_factor = project2d(md, md.mesh.scale_factor, 1)
+         if hasattr(md.mesh, 'vertexonboundary') and not np.isnan(md.mesh.vertexonboundary).all():
+-            mesh.vertexonboundary= project2d(md, md.mesh.vertexonboundary, 1)
++            mesh.vertexonboundary = project2d(md, md.mesh.vertexonboundary, 1)
+         if hasattr(md.mesh, 'elementonboundary') and not np.isnan(md.mesh.elementonboundary).all():
+             mesh.elementonboundary = project2d(md, md.mesh.elementonboundary, 1)
+         md.mesh = mesh
Index: /issm/oecreview/Archive/25834-26739/ISSM-26573-26574.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26573-26574.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26573-26574.diff	(revision 26740)
@@ -0,0 +1,202 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26573)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26574)
+@@ -4,3 +4,76 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
++
++#undef M_PI
++#define M_PI 3.141592653589793238462643
++
++namespace rdn
++{
++	uniform_distribution::uniform_distribution(){/*{{{*/
++
++		a   = 1103515245; 	// BSD Formula
++		c  = 12345;					// BSD Formula
++		m = 2147483648;			// BSD Formula
++		_seed = 0;
++		lbound = 0.0;
++		ubound = 1.0;
++		return;
++	}
++	/*}}}*/
++	uniform_distribution::uniform_distribution(double lower,double upper){/*{{{*/
++
++		a   = 1103515245;		// BSD Formula
++		c  = 12345;					// BSD Formula
++		m = 2147483648;			// BSD Formula
++		_seed = 0;
++		lbound = lower;
++		ubound = upper;
++		return;
++	}
++	/*}}}*/
++	uniform_distribution::~uniform_distribution(){}
++	void uniform_distribution::seed( unsigned int s ) { _seed = s; }
++	unsigned int uniform_distribution::get_seed() { return _seed; }
++	double uniform_distribution::generator() {
++		_seed = ( a * _seed + c ) % m ;
++		return (ubound-lbound)*(double) _seed/ m + lbound;
++	}
++
++
++	normal_distribution::normal_distribution(){/*{{{*/
++
++		_seed = 0;
++		mean   = 0;
++		sdev  = 1.0;
++		return;
++	}
++	/*}}}*/
++	normal_distribution::normal_distribution(double m,double s){/*{{{*/
++
++		_seed = 0;
++		mean   = m;
++		sdev  = s;
++		return;
++	}
++	/*}}}*/
++	normal_distribution::~normal_distribution(){}
++	void normal_distribution::seed( unsigned int s ) { _seed = s; }
++	double normal_distribution::generator(){/*{{{*/
++
++		uniform_distribution unifdistri;
++		unifdistri.seed(_seed);
++
++		double u1 = unifdistri.generator();
++		double u2 = unifdistri.generator();
++
++		double R = sqrt(-2*log(u1));
++		double theta = 2*M_PI*u2;
++
++		seed(unifdistri.get_seed());
++
++		return mean + sdev * (R*cos(theta));
++
++	}
++	/*}}}*/
++}
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26573)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26574)
+@@ -5,60 +5,53 @@
+ #ifndef _RANDOMGENERATOR_H_
+ #define _RANDOMGENERATOR_H_
+ 
+-#undef M_PI
+-#define M_PI 3.141592653589793238462643
+-
+-class uniform_distribution_rnd
++namespace rdn
+ {
++  class uniform_distribution
++  {
+ 
+-  private:
+-    int a;
+-    int c;
+-    unsigned int m;
+-    unsigned _seed;
+-    double a1;
+-    double a2;
++    private:
+ 
+-    int rnd_int() { return( _seed = ( a * _seed + c ) % m ); }
++      unsigned int a;       //multiplier of the linear congruential generator
++      unsigned int c;       //increment of the linear congruential generator
++      unsigned int m;       // modulo of the linear congruential generator
++      unsigned int _seed;   // seed value
++      double lbound;        // lower bound of uniform distribution
++      double ubound;        // upper bound of uniform distribution
+ 
+-  public:
+-    uniform_distribution_rnd() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
+-    uniform_distribution_rnd(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
+-    void seed( unsigned int s ) { _seed = s; }
+-    unsigned int get_seed() { return _seed; }
+-    double rnd() { return (a2-a1)*(double) rnd_int()/ m + a1; }
++    public:
+ 
+-};
++      /*constructors, destructors: */
++      uniform_distribution();
++      uniform_distribution(double a_1, double a_2);
++      ~uniform_distribution();
+ 
+-class normal_distribution_rnd
+-{
++      void seed( unsigned int s );
++      unsigned int get_seed();
++      double generator();
+ 
+-  private:
+-    unsigned _seed;
+-    double mean;
+-    double sdev;
++  };
+ 
+-  public:
+-    normal_distribution_rnd() : _seed( 0 ), mean( 0), sdev(1.0) {}
+-    normal_distribution_rnd(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+-    void seed( unsigned int s ) { _seed = s; }
+-    double rnd()
+-    {
+-      uniform_distribution_rnd unifdistri;
+-      unifdistri.seed(_seed);
++  class normal_distribution
++  {
+ 
+-      double u1 = unifdistri.rnd();
+-      double u2 = unifdistri.rnd();
++    private:
++      unsigned int _seed; // seed value
++      double mean;        // mean value
++      double sdev;        // standard deviation
+ 
+-      double R = sqrt(-2*log(u1));
+-      double theta = 2*M_PI*u2;
++    public:
+ 
+-      seed(unifdistri.get_seed());
++      /*constructors, destructors: */
++      normal_distribution();
++      normal_distribution(double m,double s);
++      ~normal_distribution();
+ 
+-      return mean + sdev * (R*cos(theta));
++      void seed( unsigned int s );
++      double generator();
+ 
+-    }
++  };
+ 
+-};
+ 
++}
+ #endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26573)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26574)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	normal_distribution_rnd distribution;
++	rdn::normal_distribution distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.rnd();
++		rdnumber = distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26574-26575.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26574-26575.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26574-26575.diff	(revision 26740)
@@ -0,0 +1,162 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26574)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26575)
+@@ -8,10 +8,9 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-namespace rdn
+-{
+-	uniform_distribution::uniform_distribution(){/*{{{*/
+ 
++uniform_distribution_rnd::uniform_distribution_rnd(){/*{{{*/
++
+ 		a   = 1103515245; 	// BSD Formula
+ 		c  = 12345;					// BSD Formula
+ 		m = 2147483648;			// BSD Formula
+@@ -19,9 +18,9 @@
+ 		lbound = 0.0;
+ 		ubound = 1.0;
+ 		return;
+-	}
++}
+ 	/*}}}*/
+-	uniform_distribution::uniform_distribution(double lower,double upper){/*{{{*/
++uniform_distribution_rnd::uniform_distribution_rnd(double lower,double upper){/*{{{*/
+ 
+ 		a   = 1103515245;		// BSD Formula
+ 		c  = 12345;					// BSD Formula
+@@ -30,38 +29,38 @@
+ 		lbound = lower;
+ 		ubound = upper;
+ 		return;
+-	}
++}
+ 	/*}}}*/
+-	uniform_distribution::~uniform_distribution(){}
+-	void uniform_distribution::seed( unsigned int s ) { _seed = s; }
+-	unsigned int uniform_distribution::get_seed() { return _seed; }
+-	double uniform_distribution::generator() {
++uniform_distribution_rnd::~uniform_distribution_rnd(){}
++void uniform_distribution_rnd::seed( unsigned int s ) { _seed = s; }
++unsigned int uniform_distribution_rnd::get_seed() { return _seed; }
++double uniform_distribution_rnd::generator() {
+ 		_seed = ( a * _seed + c ) % m ;
+ 		return (ubound-lbound)*(double) _seed/ m + lbound;
+-	}
++}
+ 
+ 
+-	normal_distribution::normal_distribution(){/*{{{*/
++normal_distribution_rnd::normal_distribution_rnd(){/*{{{*/
+ 
+ 		_seed = 0;
+ 		mean   = 0;
+ 		sdev  = 1.0;
+ 		return;
+-	}
+-	/*}}}*/
+-	normal_distribution::normal_distribution(double m,double s){/*{{{*/
++}
++/*}}}*/
++normal_distribution_rnd::normal_distribution_rnd(double m,double s){/*{{{*/
+ 
+ 		_seed = 0;
+ 		mean   = m;
+ 		sdev  = s;
+ 		return;
+-	}
++}
+ 	/*}}}*/
+-	normal_distribution::~normal_distribution(){}
+-	void normal_distribution::seed( unsigned int s ) { _seed = s; }
+-	double normal_distribution::generator(){/*{{{*/
++normal_distribution_rnd::~normal_distribution_rnd(){}
++void normal_distribution_rnd::seed( unsigned int s ) { _seed = s; }
++double normal_distribution_rnd::generator(){/*{{{*/
+ 
+-		uniform_distribution unifdistri;
++		uniform_distribution_rnd unifdistri;
+ 		unifdistri.seed(_seed);
+ 
+ 		double u1 = unifdistri.generator();
+@@ -76,4 +75,3 @@
+ 
+ 	}
+ 	/*}}}*/
+-}
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26574)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26575)
+@@ -5,10 +5,8 @@
+ #ifndef _RANDOMGENERATOR_H_
+ #define _RANDOMGENERATOR_H_
+ 
+-namespace rdn
++class uniform_distribution_rnd
+ {
+-  class uniform_distribution
+-  {
+ 
+     private:
+ 
+@@ -22,18 +20,18 @@
+     public:
+ 
+       /*constructors, destructors: */
+-      uniform_distribution();
+-      uniform_distribution(double a_1, double a_2);
+-      ~uniform_distribution();
++      uniform_distribution_rnd();
++      uniform_distribution_rnd(double a_1, double a_2);
++      ~uniform_distribution_rnd();
+ 
+       void seed( unsigned int s );
+       unsigned int get_seed();
+       double generator();
+ 
+-  };
++};
+ 
+-  class normal_distribution
+-  {
++class normal_distribution_rnd
++{
+ 
+     private:
+       unsigned int _seed; // seed value
+@@ -43,15 +41,13 @@
+     public:
+ 
+       /*constructors, destructors: */
+-      normal_distribution();
+-      normal_distribution(double m,double s);
+-      ~normal_distribution();
++      normal_distribution_rnd();
++      normal_distribution_rnd(double m,double s);
++      ~normal_distribution_rnd();
+ 
+       void seed( unsigned int s );
+       double generator();
+ 
+-  };
++};
+ 
+-
+-}
+ #endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26574)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26575)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	rdn::normal_distribution distribution;
++	normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26575-26576.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26575-26576.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26575-26576.diff	(revision 26740)
@@ -0,0 +1,202 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26575)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26576)
+@@ -5,73 +5,12 @@
+ #include <iostream>
+ #include "./randomgenerator.h"
+ 
+-#undef M_PI
+-#define M_PI 3.141592653589793238462643
++class uniform_distribution
++{
+ 
++};
+ 
+-uniform_distribution_rnd::uniform_distribution_rnd(){/*{{{*/
++class normal_distribution
++{
+ 
+-		a   = 1103515245; 	// BSD Formula
+-		c  = 12345;					// BSD Formula
+-		m = 2147483648;			// BSD Formula
+-		_seed = 0;
+-		lbound = 0.0;
+-		ubound = 1.0;
+-		return;
+-}
+-	/*}}}*/
+-uniform_distribution_rnd::uniform_distribution_rnd(double lower,double upper){/*{{{*/
+-
+-		a   = 1103515245;		// BSD Formula
+-		c  = 12345;					// BSD Formula
+-		m = 2147483648;			// BSD Formula
+-		_seed = 0;
+-		lbound = lower;
+-		ubound = upper;
+-		return;
+-}
+-	/*}}}*/
+-uniform_distribution_rnd::~uniform_distribution_rnd(){}
+-void uniform_distribution_rnd::seed( unsigned int s ) { _seed = s; }
+-unsigned int uniform_distribution_rnd::get_seed() { return _seed; }
+-double uniform_distribution_rnd::generator() {
+-		_seed = ( a * _seed + c ) % m ;
+-		return (ubound-lbound)*(double) _seed/ m + lbound;
+-}
+-
+-
+-normal_distribution_rnd::normal_distribution_rnd(){/*{{{*/
+-
+-		_seed = 0;
+-		mean   = 0;
+-		sdev  = 1.0;
+-		return;
+-}
+-/*}}}*/
+-normal_distribution_rnd::normal_distribution_rnd(double m,double s){/*{{{*/
+-
+-		_seed = 0;
+-		mean   = m;
+-		sdev  = s;
+-		return;
+-}
+-	/*}}}*/
+-normal_distribution_rnd::~normal_distribution_rnd(){}
+-void normal_distribution_rnd::seed( unsigned int s ) { _seed = s; }
+-double normal_distribution_rnd::generator(){/*{{{*/
+-
+-		uniform_distribution_rnd unifdistri;
+-		unifdistri.seed(_seed);
+-
+-		double u1 = unifdistri.generator();
+-		double u2 = unifdistri.generator();
+-
+-		double R = sqrt(-2*log(u1));
+-		double theta = 2*M_PI*u2;
+-
+-		seed(unifdistri.get_seed());
+-
+-		return mean + sdev * (R*cos(theta));
+-
+-	}
+-	/*}}}*/
++};
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26575)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26576)
+@@ -5,49 +5,50 @@
+ #ifndef _RANDOMGENERATOR_H_
+ #define _RANDOMGENERATOR_H_
+ 
++#undef M_PI
++#define M_PI 3.141592653589793238462643
++
+ class uniform_distribution_rnd
+ {
+ 
+-    private:
++  private:
+ 
+-      unsigned int a;       //multiplier of the linear congruential generator
+-      unsigned int c;       //increment of the linear congruential generator
+-      unsigned int m;       // modulo of the linear congruential generator
+-      unsigned int _seed;   // seed value
+-      double lbound;        // lower bound of uniform distribution
+-      double ubound;        // upper bound of uniform distribution
++    unsigned int a;
++    unsigned int c;
++    unsigned int m;
++    unsigned _seed;
++    double a1;
++    double a2;
+ 
+-    public:
++    int drnd() { return( _seed = ( a * _seed + c ) % m ); }
+ 
+-      /*constructors, destructors: */
+-      uniform_distribution_rnd();
+-      uniform_distribution_rnd(double a_1, double a_2);
+-      ~uniform_distribution_rnd();
++  public:
+ 
+-      void seed( unsigned int s );
+-      unsigned int get_seed();
+-      double generator();
++    /*constructors, destructors: */
++    uniform_distribution_rnd();
++    uniform_distribution_rnd(double a_1, double a_2);
++    ~uniform_distribution_rnd();
+ 
++    void seed( unsigned int s ) { _seed = s; }
++    unsigned int get_seed() { return _seed; }
++    double rnd() { return (a2-a1)*(double) drnd()/ m + a1; }
++
+ };
+ 
+ class normal_distribution_rnd
+ {
+ 
+-    private:
+-      unsigned int _seed; // seed value
+-      double mean;        // mean value
+-      double sdev;        // standard deviation
++  private:
++    unsigned _seed;
++    double mean;
++    double sdev;
+ 
+-    public:
++  public:
++    normal_distribution_rnd() : _seed( 0 ), mean( 0), sdev(1.0) {}
++    normal_distribution_rnd(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
++    void seed( unsigned int s ) { _seed = s; }
++    double rnd();
+ 
+-      /*constructors, destructors: */
+-      normal_distribution_rnd();
+-      normal_distribution_rnd(double m,double s);
+-      ~normal_distribution_rnd();
+-
+-      void seed( unsigned int s );
+-      double generator();
+-
+ };
+ 
+ #endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26575)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26576)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	normal_distribution_rnd distribution;
++	//normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	distribution.seed(seed);
++	//distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.generator();
++		rdnumber = 1.0;//distribution.rnd();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26576-26577.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26576-26577.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26576-26577.diff	(revision 26740)
@@ -0,0 +1,161 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26576)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26577)
+@@ -5,12 +5,73 @@
+ #include <iostream>
+ #include "./randomgenerator.h"
+ 
+-class uniform_distribution
+-{
++#undef M_PI
++#define M_PI 3.141592653589793238462643
+ 
+-};
+ 
+-class normal_distribution
+-{
++uniform_distribution_rnd::uniform_distribution_rnd(){/*{{{*/
+ 
+-};
++		a   = 1103515245; 	// BSD Formula
++		c  = 12345;					// BSD Formula
++		m = 2147483648;			// BSD Formula
++		_seed = 0;
++		lbound = 0.0;
++		ubound = 1.0;
++		return;
++}
++	/*}}}*/
++uniform_distribution_rnd::uniform_distribution_rnd(double lower,double upper){/*{{{*/
++
++		a   = 1103515245;		// BSD Formula
++		c  = 12345;					// BSD Formula
++		m = 2147483648;			// BSD Formula
++		_seed = 0;
++		lbound = lower;
++		ubound = upper;
++		return;
++}
++	/*}}}*/
++uniform_distribution_rnd::~uniform_distribution_rnd(){}
++void uniform_distribution_rnd::seed( unsigned int s ) { _seed = s; }
++unsigned int uniform_distribution_rnd::get_seed() { return _seed; }
++double uniform_distribution_rnd::generator() {
++		_seed = ( a * _seed + c ) % m ;
++		return (ubound-lbound)*(double) _seed/ m + lbound;
++}
++
++
++normal_distribution_rnd::normal_distribution_rnd(){/*{{{*/
++
++		_seed = 0;
++		mean   = 0;
++		sdev  = 1.0;
++		return;
++}
++/*}}}*/
++normal_distribution_rnd::normal_distribution_rnd(double m,double s){/*{{{*/
++
++		_seed = 0;
++		mean   = m;
++		sdev  = s;
++		return;
++}
++	/*}}}*/
++normal_distribution_rnd::~normal_distribution_rnd(){}
++void normal_distribution_rnd::seed( unsigned int s ) { _seed = s; }
++double normal_distribution_rnd::generator(){/*{{{*/
++
++		uniform_distribution_rnd unifdistri;
++		unifdistri.seed(_seed);
++
++		double u1 = unifdistri.generator();
++		double u2 = unifdistri.generator();
++
++		double R = sqrt(-2*log(u1));
++		double theta = 2*M_PI*u2;
++
++		seed(unifdistri.get_seed());
++
++		return mean + sdev * (R*cos(theta));
++
++	}
++	/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26576)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26577)
+@@ -11,44 +11,46 @@
+ class uniform_distribution_rnd
+ {
+ 
+-  private:
++    private:
+ 
+-    unsigned int a;
+-    unsigned int c;
+-    unsigned int m;
+-    unsigned _seed;
+-    double a1;
+-    double a2;
++      unsigned int a;       //multiplier of the linear congruential generator
++      unsigned int c;       //increment of the linear congruential generator
++      unsigned int m;       // modulo of the linear congruential generator
++      unsigned int _seed;   // seed value
++      double lbound;        // lower bound of uniform distribution
++      double ubound;        // upper bound of uniform distribution
+ 
+-    int drnd() { return( _seed = ( a * _seed + c ) % m ); }
++    public:
+ 
+-  public:
++      /*constructors, destructors: */
++      uniform_distribution_rnd();
++      uniform_distribution_rnd(double a_1, double a_2);
++      ~uniform_distribution_rnd();
+ 
+-    /*constructors, destructors: */
+-    uniform_distribution_rnd();
+-    uniform_distribution_rnd(double a_1, double a_2);
+-    ~uniform_distribution_rnd();
++      void seed( unsigned int s );
++      unsigned int get_seed();
++      double generator();
+ 
+-    void seed( unsigned int s ) { _seed = s; }
+-    unsigned int get_seed() { return _seed; }
+-    double rnd() { return (a2-a1)*(double) drnd()/ m + a1; }
+-
+ };
+ 
+ class normal_distribution_rnd
+ {
+ 
+-  private:
+-    unsigned _seed;
+-    double mean;
+-    double sdev;
++    private:
++      unsigned int _seed; // seed value
++      double mean;        // mean value
++      double sdev;        // standard deviation
+ 
+-  public:
+-    normal_distribution_rnd() : _seed( 0 ), mean( 0), sdev(1.0) {}
+-    normal_distribution_rnd(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+-    void seed( unsigned int s ) { _seed = s; }
+-    double rnd();
++    public:
+ 
++      /*constructors, destructors: */
++      normal_distribution_rnd();
++      normal_distribution_rnd(double m,double s);
++      ~normal_distribution_rnd();
++
++      void seed( unsigned int s );
++      double generator();
++
+ };
+ 
+ #endif //ifndef _RANDOMGENERATOR_H_
Index: /issm/oecreview/Archive/25834-26739/ISSM-26577-26578.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26577-26578.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26577-26578.diff	(revision 26740)
@@ -0,0 +1,254 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26577)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26578)
+@@ -8,70 +8,71 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
++namespace rdngen{
++	uniform_distribution_rnd::uniform_distribution_rnd(){/*{{{*/
+ 
+-uniform_distribution_rnd::uniform_distribution_rnd(){/*{{{*/
++			a   = 1103515245; 	// BSD Formula
++			c  = 12345;					// BSD Formula
++			m = 2147483648;			// BSD Formula
++			_seed = 0;
++			lbound = 0.0;
++			ubound = 1.0;
++			return;
++	}
++		/*}}}*/
++	uniform_distribution_rnd::uniform_distribution_rnd(double lower,double upper){/*{{{*/
+ 
+-		a   = 1103515245; 	// BSD Formula
+-		c  = 12345;					// BSD Formula
+-		m = 2147483648;			// BSD Formula
+-		_seed = 0;
+-		lbound = 0.0;
+-		ubound = 1.0;
+-		return;
+-}
+-	/*}}}*/
+-uniform_distribution_rnd::uniform_distribution_rnd(double lower,double upper){/*{{{*/
++			a   = 1103515245;		// BSD Formula
++			c  = 12345;					// BSD Formula
++			m = 2147483648;			// BSD Formula
++			_seed = 0;
++			lbound = lower;
++			ubound = upper;
++			return;
++	}
++		/*}}}*/
++	uniform_distribution_rnd::~uniform_distribution_rnd(){}
++	void uniform_distribution_rnd::seed( unsigned int s ) { _seed = s; }
++	unsigned int uniform_distribution_rnd::get_seed() { return _seed; }
++	double uniform_distribution_rnd::generator() {
++			_seed = ( a * _seed + c ) % m ;
++			return (ubound-lbound)*(double) _seed/ m + lbound;
++	}
+ 
+-		a   = 1103515245;		// BSD Formula
+-		c  = 12345;					// BSD Formula
+-		m = 2147483648;			// BSD Formula
+-		_seed = 0;
+-		lbound = lower;
+-		ubound = upper;
+-		return;
+-}
+-	/*}}}*/
+-uniform_distribution_rnd::~uniform_distribution_rnd(){}
+-void uniform_distribution_rnd::seed( unsigned int s ) { _seed = s; }
+-unsigned int uniform_distribution_rnd::get_seed() { return _seed; }
+-double uniform_distribution_rnd::generator() {
+-		_seed = ( a * _seed + c ) % m ;
+-		return (ubound-lbound)*(double) _seed/ m + lbound;
+-}
+ 
++	normal_distribution_rnd::normal_distribution_rnd(){/*{{{*/
+ 
+-normal_distribution_rnd::normal_distribution_rnd(){/*{{{*/
++			_seed = 0;
++			mean   = 0;
++			sdev  = 1.0;
++			return;
++	}
++	/*}}}*/
++	normal_distribution_rnd::normal_distribution_rnd(double m,double s){/*{{{*/
+ 
+-		_seed = 0;
+-		mean   = 0;
+-		sdev  = 1.0;
+-		return;
+-}
+-/*}}}*/
+-normal_distribution_rnd::normal_distribution_rnd(double m,double s){/*{{{*/
++			_seed = 0;
++			mean   = m;
++			sdev  = s;
++			return;
++	}
++		/*}}}*/
++	normal_distribution_rnd::~normal_distribution_rnd(){}
++	void normal_distribution_rnd::seed( unsigned int s ) { _seed = s; }
++	double normal_distribution_rnd::generator(){/*{{{*/
+ 
+-		_seed = 0;
+-		mean   = m;
+-		sdev  = s;
+-		return;
+-}
+-	/*}}}*/
+-normal_distribution_rnd::~normal_distribution_rnd(){}
+-void normal_distribution_rnd::seed( unsigned int s ) { _seed = s; }
+-double normal_distribution_rnd::generator(){/*{{{*/
++			uniform_distribution_rnd unifdistri;
++			unifdistri.seed(_seed);
+ 
+-		uniform_distribution_rnd unifdistri;
+-		unifdistri.seed(_seed);
++			double u1 = unifdistri.generator();
++			double u2 = unifdistri.generator();
+ 
+-		double u1 = unifdistri.generator();
+-		double u2 = unifdistri.generator();
++			double R = sqrt(-2*log(u1));
++			double theta = 2*M_PI*u2;
+ 
+-		double R = sqrt(-2*log(u1));
+-		double theta = 2*M_PI*u2;
++			seed(unifdistri.get_seed());
+ 
+-		seed(unifdistri.get_seed());
++			return mean + sdev * (R*cos(theta));
+ 
+-		return mean + sdev * (R*cos(theta));
+-
+-	}
+-	/*}}}*/
++		}
++		/*}}}*/
++}				
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26577)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26578)
+@@ -8,49 +8,51 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-class uniform_distribution_rnd
+-{
++namespace rdngen{
++  class uniform_distribution_rnd
++  {
+ 
+-    private:
++      private:
+ 
+-      unsigned int a;       //multiplier of the linear congruential generator
+-      unsigned int c;       //increment of the linear congruential generator
+-      unsigned int m;       // modulo of the linear congruential generator
+-      unsigned int _seed;   // seed value
+-      double lbound;        // lower bound of uniform distribution
+-      double ubound;        // upper bound of uniform distribution
++        unsigned int a;       //multiplier of the linear congruential generator
++        unsigned int c;       //increment of the linear congruential generator
++        unsigned int m;       // modulo of the linear congruential generator
++        unsigned int _seed;   // seed value
++        double lbound;        // lower bound of uniform distribution
++        double ubound;        // upper bound of uniform distribution
+ 
+-    public:
++      public:
+ 
+-      /*constructors, destructors: */
+-      uniform_distribution_rnd();
+-      uniform_distribution_rnd(double a_1, double a_2);
+-      ~uniform_distribution_rnd();
++        /*constructors, destructors: */
++        uniform_distribution_rnd();
++        uniform_distribution_rnd(double a_1, double a_2);
++        ~uniform_distribution_rnd();
+ 
+-      void seed( unsigned int s );
+-      unsigned int get_seed();
+-      double generator();
++        void seed( unsigned int s );
++        unsigned int get_seed();
++        double generator();
+ 
+-};
++  };
+ 
+-class normal_distribution_rnd
+-{
++  class normal_distribution_rnd
++  {
+ 
+-    private:
+-      unsigned int _seed; // seed value
+-      double mean;        // mean value
+-      double sdev;        // standard deviation
++      private:
++        unsigned int _seed; // seed value
++        double mean;        // mean value
++        double sdev;        // standard deviation
+ 
+-    public:
++      public:
+ 
+-      /*constructors, destructors: */
+-      normal_distribution_rnd();
+-      normal_distribution_rnd(double m,double s);
+-      ~normal_distribution_rnd();
++        /*constructors, destructors: */
++        normal_distribution_rnd();
++        normal_distribution_rnd(double m,double s);
++        ~normal_distribution_rnd();
+ 
+-      void seed( unsigned int s );
+-      double generator();
++        void seed( unsigned int s );
++        double generator();
+ 
+-};
++  };
+ 
++}
+ #endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26577)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26578)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	//normal_distribution_rnd distribution;
++	rdngen::normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	//distribution.seed(seed);
++	distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = 1.0;//distribution.rnd();
++		rdnumber = distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26578-26579.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26578-26579.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26578-26579.diff	(revision 26740)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26578)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26579)
+@@ -8,7 +8,7 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-namespace rdngen{
++
+ 	uniform_distribution_rnd::uniform_distribution_rnd(){/*{{{*/
+ 
+ 			a   = 1103515245; 	// BSD Formula
+@@ -75,4 +75,4 @@
+ 
+ 		}
+ 		/*}}}*/
+-}				
++			
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26578)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26579)
+@@ -8,8 +8,7 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-namespace rdngen{
+-  class uniform_distribution_rnd
++class uniform_distribution_rnd
+   {
+ 
+       private:
+@@ -54,5 +53,4 @@
+ 
+   };
+ 
+-}
+ #endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26578)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26579)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	rdngen::normal_distribution_rnd distribution;
++	normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26579-26580.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26579-26580.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26579-26580.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26579)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26580)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	normal_distribution_rnd distribution;
++	//normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	distribution.seed(seed);
++	//distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.generator();
++		rdnumber = 1.0;//distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26580-26581.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26580-26581.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26580-26581.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26580)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26581)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	//normal_distribution_rnd distribution;
++	normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	//distribution.seed(seed);
++	distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = 1.0;//distribution.generator();
++		rdnumber = distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26581-26582.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26581-26582.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26581-26582.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26581)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26582)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	normal_distribution_rnd distribution;
++	//normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	distribution.seed(seed);
++	//distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.generator();
++		rdnumber = 1.0;//distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26582-26583.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26582-26583.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26582-26583.diff	(revision 26740)
@@ -0,0 +1,207 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26582)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26583)
+@@ -4,75 +4,3 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
+-
+-#undef M_PI
+-#define M_PI 3.141592653589793238462643
+-
+-
+-	uniform_distribution_rnd::uniform_distribution_rnd(){/*{{{*/
+-
+-			a   = 1103515245; 	// BSD Formula
+-			c  = 12345;					// BSD Formula
+-			m = 2147483648;			// BSD Formula
+-			_seed = 0;
+-			lbound = 0.0;
+-			ubound = 1.0;
+-			return;
+-	}
+-		/*}}}*/
+-	uniform_distribution_rnd::uniform_distribution_rnd(double lower,double upper){/*{{{*/
+-
+-			a   = 1103515245;		// BSD Formula
+-			c  = 12345;					// BSD Formula
+-			m = 2147483648;			// BSD Formula
+-			_seed = 0;
+-			lbound = lower;
+-			ubound = upper;
+-			return;
+-	}
+-		/*}}}*/
+-	uniform_distribution_rnd::~uniform_distribution_rnd(){}
+-	void uniform_distribution_rnd::seed( unsigned int s ) { _seed = s; }
+-	unsigned int uniform_distribution_rnd::get_seed() { return _seed; }
+-	double uniform_distribution_rnd::generator() {
+-			_seed = ( a * _seed + c ) % m ;
+-			return (ubound-lbound)*(double) _seed/ m + lbound;
+-	}
+-
+-
+-	normal_distribution_rnd::normal_distribution_rnd(){/*{{{*/
+-
+-			_seed = 0;
+-			mean   = 0;
+-			sdev  = 1.0;
+-			return;
+-	}
+-	/*}}}*/
+-	normal_distribution_rnd::normal_distribution_rnd(double m,double s){/*{{{*/
+-
+-			_seed = 0;
+-			mean   = m;
+-			sdev  = s;
+-			return;
+-	}
+-		/*}}}*/
+-	normal_distribution_rnd::~normal_distribution_rnd(){}
+-	void normal_distribution_rnd::seed( unsigned int s ) { _seed = s; }
+-	double normal_distribution_rnd::generator(){/*{{{*/
+-
+-			uniform_distribution_rnd unifdistri;
+-			unifdistri.seed(_seed);
+-
+-			double u1 = unifdistri.generator();
+-			double u2 = unifdistri.generator();
+-
+-			double R = sqrt(-2*log(u1));
+-			double theta = 2*M_PI*u2;
+-
+-			seed(unifdistri.get_seed());
+-
+-			return mean + sdev * (R*cos(theta));
+-
+-		}
+-		/*}}}*/
+-			
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26582)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26583)
+@@ -9,48 +9,56 @@
+ #define M_PI 3.141592653589793238462643
+ 
+ class uniform_distribution_rnd
+-  {
++{
+ 
+-      private:
++  private:
++    int a;
++    int c;
++    unsigned int m;
++    unsigned _seed;
++    double a1;
++    double a2;
+ 
+-        unsigned int a;       //multiplier of the linear congruential generator
+-        unsigned int c;       //increment of the linear congruential generator
+-        unsigned int m;       // modulo of the linear congruential generator
+-        unsigned int _seed;   // seed value
+-        double lbound;        // lower bound of uniform distribution
+-        double ubound;        // upper bound of uniform distribution
++    int drnd() { return( _seed = ( a * _seed + c ) % m ); }
+ 
+-      public:
++  public:
++    uniform_distribution_rnd() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
++    uniform_distribution_rnd(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
++    void seed( unsigned int s ) { _seed = s; }
++    unsigned int get_seed() { return _seed; }
++    double rnd() { return (a2-a1)*(double) drnd()/ m + a1; }
+ 
+-        /*constructors, destructors: */
+-        uniform_distribution_rnd();
+-        uniform_distribution_rnd(double a_1, double a_2);
+-        ~uniform_distribution_rnd();
++};
+ 
+-        void seed( unsigned int s );
+-        unsigned int get_seed();
+-        double generator();
++class normal_distribution_rnd
++{
+ 
+-  };
++  private:
++    unsigned _seed;
++    double mean;
++    double sdev;
+ 
+-  class normal_distribution_rnd
+-  {
++  public:
++    normal_distribution_rnd() : _seed( 0 ), mean( 0), sdev(1.0) {}
++    normal_distribution_rnd(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
++    void seed( unsigned int s ) { _seed = s; }
++    double rnd()
++    {
++      uniform_distribution_rnd unifdistri;
++      unifdistri.seed(_seed);
+ 
+-      private:
+-        unsigned int _seed; // seed value
+-        double mean;        // mean value
+-        double sdev;        // standard deviation
++      double u1 = unifdistri.rnd();
++      double u2 = unifdistri.rnd();
+ 
+-      public:
++      double R = sqrt(-2*log(u1));
++      double theta = 2*M_PI*u2;
+ 
+-        /*constructors, destructors: */
+-        normal_distribution_rnd();
+-        normal_distribution_rnd(double m,double s);
+-        ~normal_distribution_rnd();
++      seed(unifdistri.get_seed());
+ 
+-        void seed( unsigned int s );
+-        double generator();
++      return mean + sdev * (R*cos(theta));
+ 
+-  };
++    }
+ 
++};
++
+ #endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26582)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26583)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	//normal_distribution_rnd distribution;
++	normal_distribution_rnd distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	//distribution.seed(seed);
++	distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = 1.0;//distribution.generator();
++		rdnumber = distribution.rnd();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26583-26584.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26583-26584.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26583-26584.diff	(revision 26740)
@@ -0,0 +1,83 @@
+Index: ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py
+===================================================================
+--- ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py	(revision 26583)
++++ ../trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py	(revision 26584)
+@@ -1,5 +1,4 @@
+-import os
+-import MatlabFuncs as m
++import numpy as np
+ 
+ 
+ def SetMLHOBC(md):
+@@ -17,5 +16,7 @@
+     #node on Dirichlet (boundary and ~icefront)
+     md.stressbalance.spcvx_base = md.stressbalance.spcvx
+     md.stressbalance.spcvy_base = md.stressbalance.spcvy
+-    md.stressbalance.spcvx_shear = float('nan') * md.stressbalance.spcvx
+-    md.stressbalance.spcvy_shear = float('nan') * md.stressbalance.spcvy 
++    md.stressbalance.spcvx_shear = np.nan * md.stressbalance.spcvx
++    md.stressbalance.spcvy_shear = np.nan * md.stressbalance.spcvy
++
++    return md
+Index: ../trunk-jpl/test/NightlyRun/test127.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test127.py	(revision 26583)
++++ ../trunk-jpl/test/NightlyRun/test127.py	(revision 26584)
+@@ -1,13 +1,14 @@
+ #Test Name: SquareShelfConstrainedStressMLHO2d
+ from model import *
+ from socket import gethostname
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
+ from massfluxatgate import massfluxatgate
+ from generic import generic
++from SetMLHOBC import SetMLHOBC
+ 
+ md = triangle(model(), '../Exp/Square.exp', 50000)
+ md = setmask(md, 'all', '')
+@@ -16,7 +17,7 @@
+ md.cluster = generic('name', gethostname(), 'np', 2)
+ #outputs
+ #FIXME compute the stress components for MLHO
+-md.stressbalance.requested_outputs = ['default','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
++md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+ #md.stressbalance.requested_outputs = ['default', 'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+ md.outputdefinition.definitions = [massfluxatgate('name', 'MassFlux1', 'profilename', '../Exp/MassFlux1.exp', 'definitionstring', 'Outputdefinition1'),
+                                    massfluxatgate('name', 'MassFlux2', 'profilename', '../Exp/MassFlux2.exp', 'definitionstring', 'Outputdefinition2'),
+@@ -24,14 +25,14 @@
+                                    massfluxatgate('name', 'MassFlux4', 'profilename', '../Exp/MassFlux4.exp', 'definitionstring', 'Outputdefinition4'),
+                                    massfluxatgate('name', 'MassFlux5', 'profilename', '../Exp/MassFlux5.exp', 'definitionstring', 'Outputdefinition5'),
+                                    massfluxatgate('name', 'MassFlux6', 'profilename', '../Exp/MassFlux6.exp', 'definitionstring', 'Outputdefinition6')]
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+-field_names = ['Vx', 'Vy', 'Vel', 'Pressure','VxSurface','VySurface','VxShear','VyShear','VxBase','VyBase',
++field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase',
+                'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+-               #'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy',
+-field_tolerances = [3e-13, 1e-13, 1e-13, 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
++#'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy',
++field_tolerances = [3e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                     2e-13, 1e-13, 2e-13,
+                     1e-13, 1e-13, 1e-13,
+                     1e-13, 1e-13, 1e-13]
+@@ -51,6 +52,6 @@
+                 md.results.StressbalanceSolution.MassFlux4,
+                 md.results.StressbalanceSolution.MassFlux5,
+                 md.results.StressbalanceSolution.MassFlux6]
+-                #md.results.StressbalanceSolution.DeviatoricStressxx,
+-                #md.results.StressbalanceSolution.DeviatoricStressyy,
+-                #md.results.StressbalanceSolution.DeviatoricStressxy,
++#md.results.StressbalanceSolution.DeviatoricStressxx,
++#md.results.StressbalanceSolution.DeviatoricStressyy,
++#md.results.StressbalanceSolution.DeviatoricStressxy,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26584-26585.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26584-26585.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26584-26585.diff	(revision 26740)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26584)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26585)
+@@ -197,7 +197,7 @@
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+ 	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<0.) alpha_complement=0.;
++	if(vmag==0. && (s-1.)<=0.) alpha_complement=0.;
+ 	else alpha_complement=pow(Neff,r)*pow(vmag,(s-1));
+ 
+ 	/*Assign output pointers:*/
+@@ -344,7 +344,7 @@
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+ 	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<0.){
++	if(vmag==0. && (s-1.)<=0.){
+ 		alpha2=0.;
+ 	}
+ 	else{
+@@ -540,7 +540,7 @@
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+ 	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<0.) alpha2=0.;
++	if(vmag==0. && (s-1.)<=0.) alpha2=0.;
+ 	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+ 
+ 	/*Assign output pointers:*/
+@@ -586,7 +586,7 @@
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+ 	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<0.) alpha2=0.;
++	if(vmag==0. && (s-1.)<=0.) alpha2=0.;
+ 	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+ 
+ 	/*Assign output pointers:*/
Index: /issm/oecreview/Archive/25834-26739/ISSM-26585-26586.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26585-26586.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26585-26586.diff	(revision 26740)
@@ -0,0 +1,78 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26585)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26586)
+@@ -8,7 +8,7 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-class uniform_distribution_rnd
++class rnd_uniform_distribution
+ {
+ 
+   private:
+@@ -22,15 +22,15 @@
+     int drnd() { return( _seed = ( a * _seed + c ) % m ); }
+ 
+   public:
+-    uniform_distribution_rnd() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
+-    uniform_distribution_rnd(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
++    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
++    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
+     void seed( unsigned int s ) { _seed = s; }
+     unsigned int get_seed() { return _seed; }
+-    double rnd() { return (a2-a1)*(double) drnd()/ m + a1; }
++    double generator() { return (a2-a1)*(double) drnd()/ m + a1; }
+ 
+ };
+ 
+-class normal_distribution_rnd
++class rnd_normal_distribution
+ {
+ 
+   private:
+@@ -39,16 +39,16 @@
+     double sdev;
+ 
+   public:
+-    normal_distribution_rnd() : _seed( 0 ), mean( 0), sdev(1.0) {}
+-    normal_distribution_rnd(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
++    rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
++    rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+     void seed( unsigned int s ) { _seed = s; }
+-    double rnd()
++    double generator()
+     {
+-      uniform_distribution_rnd unifdistri;
++      rnd_uniform_distribution unifdistri;
+       unifdistri.seed(_seed);
+ 
+-      double u1 = unifdistri.rnd();
+-      double u2 = unifdistri.rnd();
++      double u1 = unifdistri.generator();
++      double u2 = unifdistri.generator();
+ 
+       double R = sqrt(-2*log(u1));
+       double theta = 2*M_PI*u2;
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26585)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26586)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	normal_distribution_rnd distribution;
++	rnd_normal_distribution distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.rnd();
++		rdnumber = distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26586-26587.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26586-26587.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26586-26587.diff	(revision 26740)
@@ -0,0 +1,97 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26586)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26587)
+@@ -4,3 +4,46 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
++
++rnd_uniform_distribution::rnd_uniform_distribution()
++{/*{{{*/
++
++	a   = 1103515245; 	// BSD Formula
++	c  = 12345;					// BSD Formula
++	m = 2147483648;			// BSD Formula
++	_seed = 0;
++	lbound = 0.0;
++	ubound = 1.0;
++	return;
++}
++/*}}}*/
++rnd_uniform_distribution::rnd_uniform_distribution(double lower,double upper){/*{{{*/
++
++	a   = 1103515245;		// BSD Formula
++	c  = 12345;					// BSD Formula
++	m = 2147483648;			// BSD Formula
++	_seed = 0;
++	lbound = lower;
++	ubound = upper;
++	return;
++}
++/*}}}*/
++rnd_uniform_distribution::~rnd_uniform_distribution(){}
++
++rnd_normal_distribution::rnd_normal_distribution(){/*{{{*/
++
++	_seed = 0;
++	mean   = 0;
++	sdev  = 1.0;
++	return;
++}
++/*}}}*/
++rnd_normal_distribution::rnd_normal_distribution(double m,double s){/*{{{*/
++
++	_seed = 0;
++	mean   = m;
++	sdev  = s;
++	return;
++}
++/*}}}*/
++rnd_normal_distribution::~rnd_normal_distribution(){}
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26586)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26587)
+@@ -16,17 +16,21 @@
+     int c;
+     unsigned int m;
+     unsigned _seed;
+-    double a1;
+-    double a2;
++    double lbound;
++    double ubound;
+ 
+     int drnd() { return( _seed = ( a * _seed + c ) % m ); }
+ 
+   public:
+-    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
+-    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
++
++    /*constructors, destructors: */
++    rnd_uniform_distribution();
++    rnd_uniform_distribution(double a_1,double a_2);
++    ~rnd_uniform_distribution();
++
+     void seed( unsigned int s ) { _seed = s; }
+     unsigned int get_seed() { return _seed; }
+-    double generator() { return (a2-a1)*(double) drnd()/ m + a1; }
++    double generator() { return (ubound-lbound)*(double) drnd()/ m + lbound; }
+ 
+ };
+ 
+@@ -39,8 +43,12 @@
+     double sdev;
+ 
+   public:
+-    rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
+-    rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
++
++    /*constructors, destructors: */
++    rnd_normal_distribution();
++    rnd_normal_distribution(double m,double s);
++    ~rnd_normal_distribution();
++
+     void seed( unsigned int s ) { _seed = s; }
+     double generator()
+     {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26587-26588.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26587-26588.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26587-26588.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26587)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26588)
+@@ -23,7 +23,7 @@
+ 	c  = 12345;					// BSD Formula
+ 	m = 2147483648;			// BSD Formula
+ 	_seed = 0;
+-	lbound = lower;
++	lbound = 1.0;//lower;
+ 	ubound = upper;
+ 	return;
+ }
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26587)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26588)
+@@ -47,6 +47,7 @@
+     /*constructors, destructors: */
+     rnd_normal_distribution();
+     rnd_normal_distribution(double m,double s);
++    //
+     ~rnd_normal_distribution();
+ 
+     void seed( unsigned int s ) { _seed = s; }
Index: /issm/oecreview/Archive/25834-26739/ISSM-26588-26589.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26588-26589.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26588-26589.diff	(revision 26740)
@@ -0,0 +1,99 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26588)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26589)
+@@ -4,46 +4,3 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
+-
+-rnd_uniform_distribution::rnd_uniform_distribution()
+-{/*{{{*/
+-
+-	a   = 1103515245; 	// BSD Formula
+-	c  = 12345;					// BSD Formula
+-	m = 2147483648;			// BSD Formula
+-	_seed = 0;
+-	lbound = 0.0;
+-	ubound = 1.0;
+-	return;
+-}
+-/*}}}*/
+-rnd_uniform_distribution::rnd_uniform_distribution(double lower,double upper){/*{{{*/
+-
+-	a   = 1103515245;		// BSD Formula
+-	c  = 12345;					// BSD Formula
+-	m = 2147483648;			// BSD Formula
+-	_seed = 0;
+-	lbound = 1.0;//lower;
+-	ubound = upper;
+-	return;
+-}
+-/*}}}*/
+-rnd_uniform_distribution::~rnd_uniform_distribution(){}
+-
+-rnd_normal_distribution::rnd_normal_distribution(){/*{{{*/
+-
+-	_seed = 0;
+-	mean   = 0;
+-	sdev  = 1.0;
+-	return;
+-}
+-/*}}}*/
+-rnd_normal_distribution::rnd_normal_distribution(double m,double s){/*{{{*/
+-
+-	_seed = 0;
+-	mean   = m;
+-	sdev  = s;
+-	return;
+-}
+-/*}}}*/
+-rnd_normal_distribution::~rnd_normal_distribution(){}
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26588)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26589)
+@@ -16,8 +16,8 @@
+     int c;
+     unsigned int m;
+     unsigned _seed;
+-    double lbound;
+-    double ubound;
++    double a1;
++    double a2;
+ 
+     int drnd() { return( _seed = ( a * _seed + c ) % m ); }
+ 
+@@ -24,13 +24,11 @@
+   public:
+ 
+     /*constructors, destructors: */
+-    rnd_uniform_distribution();
+-    rnd_uniform_distribution(double a_1,double a_2);
+-    ~rnd_uniform_distribution();
+-
++    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
++    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
+     void seed( unsigned int s ) { _seed = s; }
+     unsigned int get_seed() { return _seed; }
+-    double generator() { return (ubound-lbound)*(double) drnd()/ m + lbound; }
++    double generator() { return (a2-a1)*(double) drnd()/ m + a1; }
+ 
+ };
+ 
+@@ -43,13 +41,8 @@
+     double sdev;
+ 
+   public:
+-
+-    /*constructors, destructors: */
+-    rnd_normal_distribution();
+-    rnd_normal_distribution(double m,double s);
+-    //
+-    ~rnd_normal_distribution();
+-
++    rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
++    rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+     void seed( unsigned int s ) { _seed = s; }
+     double generator()
+     {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26589-26590.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26589-26590.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26589-26590.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26589)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26590)
+@@ -16,8 +16,8 @@
+     int c;
+     unsigned int m;
+     unsigned _seed;
+-    double a1;
+-    double a2;
++    double lbound;
++    double ubound;
+ 
+     int drnd() { return( _seed = ( a * _seed + c ) % m ); }
+ 
+@@ -24,11 +24,12 @@
+   public:
+ 
+     /*constructors, destructors: */
+-    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(0.0), a2(1.0) {}
+-    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), a1(a_1), a2(a_2) {}
++    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
++    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
++    ~rnd_uniform_distribution(){}
+     void seed( unsigned int s ) { _seed = s; }
+     unsigned int get_seed() { return _seed; }
+-    double generator() { return (a2-a1)*(double) drnd()/ m + a1; }
++    double generator() { return (ubound-lbound)*(double) drnd()/ m + lbound; }
+ 
+ };
+ 
+@@ -43,6 +44,7 @@
+   public:
+     rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
+     rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
++    ~rnd_normal_distribution(){}
+     void seed( unsigned int s ) { _seed = s; }
+     double generator()
+     {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26590-26591.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26590-26591.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26590-26591.diff	(revision 26740)
@@ -0,0 +1,60 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26590)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26591)
+@@ -19,8 +19,6 @@
+     double lbound;
+     double ubound;
+ 
+-    int drnd() { return( _seed = ( a * _seed + c ) % m ); }
+-
+   public:
+ 
+     /*constructors, destructors: */
+@@ -29,7 +27,10 @@
+     ~rnd_uniform_distribution(){}
+     void seed( unsigned int s ) { _seed = s; }
+     unsigned int get_seed() { return _seed; }
+-    double generator() { return (ubound-lbound)*(double) drnd()/ m + lbound; }
++    double generator(){
++      _seed = ( a * _seed + c ) % m;
++      return (ubound-lbound)*(double) _seed/ m + lbound;
++    }
+ 
+ };
+ 
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26590)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26591)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	rnd_normal_distribution distribution;
++	//rnd_normal_distribution distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	distribution.seed(seed);
++	//distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.generator();
++		rdnumber = 1.0;//distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26591-26592.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26591-26592.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26591-26592.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26591)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26592)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	//rnd_normal_distribution distribution;
++	rnd_normal_distribution distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	//distribution.seed(seed);
++	distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = 1.0;//distribution.generator();
++		rdnumber = distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26592-26593.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26592-26593.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26592-26593.diff	(revision 26740)
@@ -0,0 +1,41 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26592)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26593)
+@@ -4,3 +4,8 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
++
++
++rnd_uniform_distribution::~rnd_uniform_distribution(){}
++
++rnd_normal_distribution::~rnd_normal_distribution(){}
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26592)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26593)
+@@ -24,7 +24,8 @@
+     /*constructors, destructors: */
+     rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
+     rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
+-    ~rnd_uniform_distribution(){}
++    ~rnd_uniform_distribution();
++    
+     void seed( unsigned int s ) { _seed = s; }
+     unsigned int get_seed() { return _seed; }
+     double generator(){
+@@ -43,9 +44,12 @@
+     double sdev;
+ 
+   public:
++
++    /*constructors, destructors: */
+     rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
+     rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+-    ~rnd_normal_distribution(){}
++    ~rnd_normal_distribution();
++
+     void seed( unsigned int s ) { _seed = s; }
+     double generator()
+     {
Index: /issm/oecreview/Archive/25834-26739/ISSM-26593-26594.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26593-26594.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26593-26594.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26593)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26594)
+@@ -4,8 +4,3 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
+-
+-
+-rnd_uniform_distribution::~rnd_uniform_distribution(){}
+-
+-rnd_normal_distribution::~rnd_normal_distribution(){}
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26593)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26594)
+@@ -24,8 +24,8 @@
+     /*constructors, destructors: */
+     rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
+     rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
+-    ~rnd_uniform_distribution();
+-    
++    ~rnd_uniform_distribution(){}
++
+     void seed( unsigned int s ) { _seed = s; }
+     unsigned int get_seed() { return _seed; }
+     double generator(){
+@@ -48,7 +48,7 @@
+     /*constructors, destructors: */
+     rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
+     rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+-    ~rnd_normal_distribution();
++    ~rnd_normal_distribution(){}
+ 
+     void seed( unsigned int s ) { _seed = s; }
+     double generator()
Index: /issm/oecreview/Archive/25834-26739/ISSM-26594-26595.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26594-26595.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26594-26595.diff	(revision 26740)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26594)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26595)
+@@ -4,3 +4,18 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
++
++#undef M_PI
++#define M_PI 3.141592653589793238462643
++
++rnd_uniform_distribution::rnd_uniform_distribution(){/*{{{*/
++
++		a   = 1103515245; 	// BSD Formula
++		c  = 12345;					// BSD Formula
++		m = 2147483648;			// BSD Formula
++		_seed = 0;
++		lbound = 0.0;
++		ubound = 1.0;
++		return;
++}
++/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26594)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26595)
+@@ -2,8 +2,8 @@
+  * \brief prototypes for randomgenerator.h
+  */
+ 
+-#ifndef _RANDOMGENERATOR_H_
+-#define _RANDOMGENERATOR_H_
++//#ifndef _RANDOMGENERATOR_H_
++//#define _RANDOMGENERATOR_H_
+ 
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+@@ -22,7 +22,7 @@
+   public:
+ 
+     /*constructors, destructors: */
+-    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
++    rnd_uniform_distribution();
+     rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
+     ~rnd_uniform_distribution(){}
+ 
+@@ -70,4 +70,4 @@
+ 
+ };
+ 
+-#endif //ifndef _RANDOMGENERATOR_H_
++//#endif //ifndef _RANDOMGENERATOR_H_
Index: /issm/oecreview/Archive/25834-26739/ISSM-26595-26596.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26595-26596.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26595-26596.diff	(revision 26740)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 26595)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 26596)
+@@ -187,6 +187,7 @@
+ 	./shared/Elements/DrainageFunctionWaterfraction.cpp \
+ 	./shared/Elements/EstarComponents.cpp \
+ 	./shared/Random/random.cpp \
++	./shared/Random/randomgenerator.cpp \
+ 	./shared/String/DescriptorIndex.cpp \
+ 	./toolkits/issm/IssmToolkitUtils.cpp \
+ 	./toolkits/issm/IssmSolver.cpp \
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26595)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26596)
+@@ -8,14 +8,14 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-rnd_uniform_distribution::rnd_uniform_distribution(){/*{{{*/
++//rnd_uniform_distribution::rnd_uniform_distribution(){/*{{{*/
+ 
+-		a   = 1103515245; 	// BSD Formula
+-		c  = 12345;					// BSD Formula
+-		m = 2147483648;			// BSD Formula
+-		_seed = 0;
+-		lbound = 0.0;
+-		ubound = 1.0;
+-		return;
+-}
++//		a   = 1103515245; 	// BSD Formula
++//		c  = 12345;					// BSD Formula
++//		m = 2147483648;			// BSD Formula
++//		_seed = 0;
++//		lbound = 0.0;
++//		ubound = 1.0;
++//		return;
++//}
+ /*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26595)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26596)
+@@ -22,7 +22,7 @@
+   public:
+ 
+     /*constructors, destructors: */
+-    rnd_uniform_distribution();
++    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
+     rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
+     ~rnd_uniform_distribution(){}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26596-26597.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26596-26597.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26596-26597.diff	(revision 26740)
@@ -0,0 +1,139 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26596)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26597)
+@@ -1,21 +1,3 @@
+ /*!\file: randomgenerator
+  * \brief random number generating functions
+  */
+-
+-#include <iostream>
+-#include "./randomgenerator.h"
+-
+-#undef M_PI
+-#define M_PI 3.141592653589793238462643
+-
+-//rnd_uniform_distribution::rnd_uniform_distribution(){/*{{{*/
+-
+-//		a   = 1103515245; 	// BSD Formula
+-//		c  = 12345;					// BSD Formula
+-//		m = 2147483648;			// BSD Formula
+-//		_seed = 0;
+-//		lbound = 0.0;
+-//		ubound = 1.0;
+-//		return;
+-//}
+-/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26596)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26597)
+@@ -1,73 +1,3 @@
+ /*!\file: randomgenerator.h
+  * \brief prototypes for randomgenerator.h
+  */
+-
+-//#ifndef _RANDOMGENERATOR_H_
+-//#define _RANDOMGENERATOR_H_
+-
+-#undef M_PI
+-#define M_PI 3.141592653589793238462643
+-
+-class rnd_uniform_distribution
+-{
+-
+-  private:
+-    int a;
+-    int c;
+-    unsigned int m;
+-    unsigned _seed;
+-    double lbound;
+-    double ubound;
+-
+-  public:
+-
+-    /*constructors, destructors: */
+-    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
+-    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
+-    ~rnd_uniform_distribution(){}
+-
+-    void seed( unsigned int s ) { _seed = s; }
+-    unsigned int get_seed() { return _seed; }
+-    double generator(){
+-      _seed = ( a * _seed + c ) % m;
+-      return (ubound-lbound)*(double) _seed/ m + lbound;
+-    }
+-
+-};
+-
+-class rnd_normal_distribution
+-{
+-
+-  private:
+-    unsigned _seed;
+-    double mean;
+-    double sdev;
+-
+-  public:
+-
+-    /*constructors, destructors: */
+-    rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
+-    rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+-    ~rnd_normal_distribution(){}
+-
+-    void seed( unsigned int s ) { _seed = s; }
+-    double generator()
+-    {
+-      rnd_uniform_distribution unifdistri;
+-      unifdistri.seed(_seed);
+-
+-      double u1 = unifdistri.generator();
+-      double u2 = unifdistri.generator();
+-
+-      double R = sqrt(-2*log(u1));
+-      double theta = 2*M_PI*u2;
+-
+-      seed(unifdistri.get_seed());
+-
+-      return mean + sdev * (R*cos(theta));
+-
+-    }
+-
+-};
+-
+-//#endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26596)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26597)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	rnd_normal_distribution distribution;
++	//rnd_normal_distribution distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	distribution.seed(seed);
++	//distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.generator();
++		rdnumber = 1.0;// distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26597-26598.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26597-26598.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26597-26598.diff	(revision 26740)
@@ -0,0 +1,97 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26597)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26598)
+@@ -1,3 +1,9 @@
+ /*!\file: randomgenerator
+  * \brief random number generating functions
+  */
++
++#include <iostream>
++#include "./randomgenerator.h"
++
++#undef M_PI
++#define M_PI 3.141592653589793238462643
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26597)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26598)
+@@ -1,3 +1,78 @@
+ /*!\file: randomgenerator.h
+  * \brief prototypes for randomgenerator.h
+  */
++
++#ifndef _RANDOMGENERATOR_H_
++#define _RANDOMGENERATOR_H_
++
++/*Headers:*/
++/*{{{*/
++#include <cmath>
++/*}}}*/
++
++#undef M_PI
++#define M_PI 3.141592653589793238462643
++
++class rnd_uniform_distribution
++{
++
++  private:
++    int a;
++    int c;
++    unsigned int m;
++    unsigned _seed;
++    double lbound;
++    double ubound;
++
++  public:
++
++    /*constructors, destructors: */
++    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
++    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
++    ~rnd_uniform_distribution(){}
++
++    void seed( unsigned int s ) { _seed = s; }
++    unsigned int get_seed() { return _seed; }
++    double generator(){
++      _seed = ( a * _seed + c ) % m;
++      return (ubound-lbound)*(double) _seed/ m + lbound;
++    }
++
++};
++
++class rnd_normal_distribution
++{
++
++  private:
++    unsigned _seed;
++    double mean;
++    double sdev;
++
++  public:
++
++    /*constructors, destructors: */
++    rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
++    rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
++    ~rnd_normal_distribution(){}
++
++    void seed( unsigned int s ) { _seed = s; }
++    double generator()
++    {
++      rnd_uniform_distribution unifdistri;
++      unifdistri.seed(_seed);
++
++      double u1 = unifdistri.generator();
++      double u2 = unifdistri.generator();
++
++      double R = sqrt(-2*log(u1));
++      double theta = 2*M_PI*u2;
++
++      seed(unifdistri.get_seed());
++
++      return mean + sdev * (R*cos(theta));
++
++    }
++
++};
++
++#endif //ifndef _RANDOMGENERATOR_H_
Index: /issm/oecreview/Archive/25834-26739/ISSM-26598-26599.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26598-26599.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26598-26599.diff	(revision 26740)
@@ -0,0 +1,33 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26598)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26599)
+@@ -7,3 +7,15 @@
+ 
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
++
++rnd_uniform_distribution::rnd_uniform_distribution(){/*{{{*/
++
++		a   = 1103515245; 	// BSD Formula
++		c  = 12345;					// BSD Formula
++		m = 2147483648;			// BSD Formula
++		_seed = 0;
++		lbound = 0.0;
++		ubound = 1.0;
++		return;
++}
++/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26598)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26599)
+@@ -27,7 +27,7 @@
+   public:
+ 
+     /*constructors, destructors: */
+-    rnd_uniform_distribution() : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(0.0), ubound(1.0) {}
++    rnd_uniform_distribution();
+     rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
+     ~rnd_uniform_distribution(){}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26599-26600.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26599-26600.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26599-26600.diff	(revision 26740)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/test/Archives/Archive134.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26599)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26600)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	//rnd_normal_distribution distribution;
++	rnd_normal_distribution distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
+@@ -28,7 +28,7 @@
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	//distribution.seed(seed);
++	distribution.seed(seed);
+ 
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = 1.0;// distribution.generator();
++		rdnumber = distribution.generator();
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26600-26601.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26600-26601.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26600-26601.diff	(revision 26740)
@@ -0,0 +1,78 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26600)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26601)
+@@ -196,9 +196,15 @@
+ 	IssmDouble Neff = EffectivePressure(gauss);
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+-	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<=0.) alpha_complement=0.;
+-	else alpha_complement=pow(Neff,r)*pow(vmag,(s-1));
++	if(s==1.){
++		/*This is to make AD happy and avoid 0^0*/
++		alpha_complement=pow(Neff,r);
++	}
++	else{
++		/*Check to prevent dividing by zero if vmag==0*/
++		if(vmag==0. && (s-1.)<0.) alpha_complement=0.;
++		else alpha_complement=pow(Neff,r)*pow(vmag,(s-1.));
++	}
+ 
+ 	/*Assign output pointers:*/
+ 	*palpha_complement=alpha_complement;
+@@ -343,12 +349,14 @@
+ 	IssmDouble Neff = EffectivePressure(gauss);
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+-	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<=0.){
+-		alpha2=0.;
++	if(s==1.){
++		/*This is to make AD happy and avoid 0^0*/
++		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
+ 	}
+ 	else{
+-		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
++		/*Check to prevent dividing by zero if vmag==0*/
++		if(vmag==0. && (s-1.)<0.) alpha2=0.;
++		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+ 	}
+ 
+ 	floatation_thickness=0;
+@@ -540,8 +548,14 @@
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+ 	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<=0.) alpha2=0.;
+-	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
++	if(s==1.){
++		/*This is to make AD happy and avoid 0^0*/
++		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
++	}
++	else{
++		if(vmag==0. && (s-1.)<0.) alpha2=0.;
++		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
++	}
+ 
+ 	/*Assign output pointers:*/
+ 	*palpha2=alpha2;
+@@ -585,9 +599,15 @@
+ 
+ 	IssmDouble vmag = VelMag(gauss);
+ 
+-	/*Check to prevent dividing by zero if vmag==0*/
+-	if(vmag==0. && (s-1.)<=0.) alpha2=0.;
+-	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
++	if(s==1.){
++		/*This is to make AD happy and avoid 0^0*/
++		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r);
++	}
++	else{
++		/*Check to prevent dividing by zero if vmag==0*/
++		if(vmag==0. && (s-1.)<0.) alpha2=0.;
++		else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
++	}
+ 
+ 	/*Assign output pointers:*/
+ 	*palpha2=alpha2;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26601-26602.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26601-26602.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26601-26602.diff	(revision 26740)
@@ -0,0 +1,144 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26601)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26602)
+@@ -4,7 +4,9 @@
+ 
+ #include <iostream>
+ #include "./randomgenerator.h"
++#include <cmath>
+ 
++
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+@@ -19,3 +21,58 @@
+ 		return;
+ }
+ /*}}}*/
++rnd_uniform_distribution::rnd_uniform_distribution(double lower,double upper){/*{{{*/
++
++		a   = 1103515245;		// BSD Formula
++		c  = 12345;					// BSD Formula
++		m = 2147483648;			// BSD Formula
++		_seed = 0;
++		lbound = lower;
++		ubound = upper;
++		return;
++}
++/*}}}*/
++rnd_uniform_distribution::~rnd_uniform_distribution(){}
++void rnd_uniform_distribution::seed( unsigned int s ) { _seed = s; }
++unsigned int rnd_uniform_distribution::get_seed() { return _seed; }
++double rnd_uniform_distribution::generator() {
++		_seed = ( a * _seed + c ) % m ;
++		return (ubound-lbound)*(double) _seed/ m + lbound;
++}
++
++
++rnd_normal_distribution::rnd_normal_distribution(){/*{{{*/
++
++		_seed = 0;
++		mean   = 0;
++		sdev  = 1.0;
++		return;
++}
++/*}}}*/
++rnd_normal_distribution::rnd_normal_distribution(double m,double s){/*{{{*/
++
++		_seed = 0;
++		mean   = m;
++		sdev  = s;
++		return;
++}
++	/*}}}*/
++rnd_normal_distribution::~rnd_normal_distribution(){}
++void rnd_normal_distribution::seed( unsigned int s ) { _seed = s; }
++double rnd_normal_distribution::generator(){/*{{{*/
++
++		rnd_uniform_distribution	unifdistri;
++		unifdistri.seed(_seed);
++
++		double u1 = unifdistri.generator();
++		double u2 = unifdistri.generator();
++
++		double R = sqrt(-2*log(u1));
++		double theta = 2*M_PI*u2;
++
++		seed(unifdistri.get_seed());
++
++		return mean + sdev * (R*cos(theta));
++
++}
++/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26601)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26602)
+@@ -5,11 +5,6 @@
+ #ifndef _RANDOMGENERATOR_H_
+ #define _RANDOMGENERATOR_H_
+ 
+-/*Headers:*/
+-/*{{{*/
+-#include <cmath>
+-/*}}}*/
+-
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+@@ -28,15 +23,12 @@
+ 
+     /*constructors, destructors: */
+     rnd_uniform_distribution();
+-    rnd_uniform_distribution(double a_1,double a_2) : _seed( 0 ), a( 1103515245 ), c( 12345 ), m( 2147483648 ), lbound(a_1), ubound(a_2) {}
+-    ~rnd_uniform_distribution(){}
++    rnd_uniform_distribution(double a_1,double a_2);
++    ~rnd_uniform_distribution();
+ 
+-    void seed( unsigned int s ) { _seed = s; }
+-    unsigned int get_seed() { return _seed; }
+-    double generator(){
+-      _seed = ( a * _seed + c ) % m;
+-      return (ubound-lbound)*(double) _seed/ m + lbound;
+-    }
++    void seed( unsigned int s );
++    unsigned int get_seed();
++    double generator();
+ 
+ };
+ 
+@@ -51,28 +43,13 @@
+   public:
+ 
+     /*constructors, destructors: */
+-    rnd_normal_distribution() : _seed( 0 ), mean( 0), sdev(1.0) {}
+-    rnd_normal_distribution(double m,double s) : _seed( 0 ), mean( m ), sdev(s) {}
+-    ~rnd_normal_distribution(){}
++    rnd_normal_distribution();
++    rnd_normal_distribution(double m,double s);
++    ~rnd_normal_distribution();
+ 
+-    void seed( unsigned int s ) { _seed = s; }
+-    double generator()
+-    {
+-      rnd_uniform_distribution unifdistri;
+-      unifdistri.seed(_seed);
++    void seed( unsigned int s );
++    double generator();
+ 
+-      double u1 = unifdistri.generator();
+-      double u2 = unifdistri.generator();
+-
+-      double R = sqrt(-2*log(u1));
+-      double theta = 2*M_PI*u2;
+-
+-      seed(unifdistri.get_seed());
+-
+-      return mean + sdev * (R*cos(theta));
+-
+-    }
+-
+ };
+ 
+ #endif //ifndef _RANDOMGENERATOR_H_
Index: /issm/oecreview/Archive/25834-26739/ISSM-26602-26603.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26602-26603.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26602-26603.diff	(revision 26740)
@@ -0,0 +1,232 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26602)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26603)
+@@ -10,69 +10,73 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-rnd_uniform_distribution::rnd_uniform_distribution(){/*{{{*/
++namespace rnd{
+ 
+-		a   = 1103515245; 	// BSD Formula
+-		c  = 12345;					// BSD Formula
+-		m = 2147483648;			// BSD Formula
+-		_seed = 0;
+-		lbound = 0.0;
+-		ubound = 1.0;
+-		return;
+-}
+-/*}}}*/
+-rnd_uniform_distribution::rnd_uniform_distribution(double lower,double upper){/*{{{*/
++	uniform_distribution::uniform_distribution(){/*{{{*/
+ 
+-		a   = 1103515245;		// BSD Formula
+-		c  = 12345;					// BSD Formula
+-		m = 2147483648;			// BSD Formula
+-		_seed = 0;
+-		lbound = lower;
+-		ubound = upper;
+-		return;
+-}
+-/*}}}*/
+-rnd_uniform_distribution::~rnd_uniform_distribution(){}
+-void rnd_uniform_distribution::seed( unsigned int s ) { _seed = s; }
+-unsigned int rnd_uniform_distribution::get_seed() { return _seed; }
+-double rnd_uniform_distribution::generator() {
+-		_seed = ( a * _seed + c ) % m ;
+-		return (ubound-lbound)*(double) _seed/ m + lbound;
+-}
++			a   = 1103515245; 	// BSD Formula
++			c  = 12345;					// BSD Formula
++			m = 2147483648;			// BSD Formula
++			_seed = 0;
++			lbound = 0.0;
++			ubound = 1.0;
++			return;
++	}
++	/*}}}*/
++	uniform_distribution::uniform_distribution(double lower,double upper){/*{{{*/
+ 
++			a   = 1103515245;		// BSD Formula
++			c  = 12345;					// BSD Formula
++			m = 2147483648;			// BSD Formula
++			_seed = 0;
++			lbound = lower;
++			ubound = upper;
++			return;
++	}
++	/*}}}*/
++	uniform_distribution::~uniform_distribution(){}
++	void uniform_distribution::seed( unsigned int s ) { _seed = s; }
++	unsigned int uniform_distribution::get_seed() { return _seed; }
++	double uniform_distribution::generator() {
++			_seed = ( a * _seed + c ) % m ;
++			return (ubound-lbound)*(double) _seed/ m + lbound;
++	}
+ 
+-rnd_normal_distribution::rnd_normal_distribution(){/*{{{*/
+ 
+-		_seed = 0;
+-		mean   = 0;
+-		sdev  = 1.0;
+-		return;
+-}
+-/*}}}*/
+-rnd_normal_distribution::rnd_normal_distribution(double m,double s){/*{{{*/
++	normal_distribution::normal_distribution(){/*{{{*/
+ 
+-		_seed = 0;
+-		mean   = m;
+-		sdev  = s;
+-		return;
+-}
++			_seed = 0;
++			mean   = 0;
++			sdev  = 1.0;
++			return;
++	}
+ 	/*}}}*/
+-rnd_normal_distribution::~rnd_normal_distribution(){}
+-void rnd_normal_distribution::seed( unsigned int s ) { _seed = s; }
+-double rnd_normal_distribution::generator(){/*{{{*/
++	normal_distribution::normal_distribution(double m,double s){/*{{{*/
+ 
+-		rnd_uniform_distribution	unifdistri;
+-		unifdistri.seed(_seed);
++			_seed = 0;
++			mean   = m;
++			sdev  = s;
++			return;
++	}
++		/*}}}*/
++	normal_distribution::~normal_distribution(){}
++	void normal_distribution::seed( unsigned int s ) { _seed = s; }
++	double normal_distribution::generator(){/*{{{*/
+ 
+-		double u1 = unifdistri.generator();
+-		double u2 = unifdistri.generator();
++			rnd::uniform_distribution	unifdistri;
++			unifdistri.seed(_seed);
+ 
+-		double R = sqrt(-2*log(u1));
+-		double theta = 2*M_PI*u2;
++			double u1 = unifdistri.generator();
++			double u2 = unifdistri.generator();
+ 
+-		seed(unifdistri.get_seed());
++			double R = sqrt(-2*log(u1));
++			double theta = 2*M_PI*u2;
+ 
+-		return mean + sdev * (R*cos(theta));
++			seed(unifdistri.get_seed());
+ 
++			return mean + sdev * (R*cos(theta));
++
++	}
++	/*}}}*/
++
+ }
+-/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26602)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26603)
+@@ -8,48 +8,52 @@
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
+-class rnd_uniform_distribution
+-{
++namespace rnd{
+ 
+-  private:
+-    int a;
+-    int c;
+-    unsigned int m;
+-    unsigned _seed;
+-    double lbound;
+-    double ubound;
++  class uniform_distribution
++  {
+ 
+-  public:
++    private:
++      int a;
++      int c;
++      unsigned int m;
++      unsigned _seed;
++      double lbound;
++      double ubound;
+ 
+-    /*constructors, destructors: */
+-    rnd_uniform_distribution();
+-    rnd_uniform_distribution(double a_1,double a_2);
+-    ~rnd_uniform_distribution();
++    public:
+ 
+-    void seed( unsigned int s );
+-    unsigned int get_seed();
+-    double generator();
++      /*constructors, destructors: */
++      uniform_distribution();
++      uniform_distribution(double a_1,double a_2);
++      ~uniform_distribution();
+ 
+-};
++      void seed( unsigned int s );
++      unsigned int get_seed();
++      double generator();
+ 
+-class rnd_normal_distribution
+-{
++  };
+ 
+-  private:
+-    unsigned _seed;
+-    double mean;
+-    double sdev;
++  class normal_distribution
++  {
+ 
+-  public:
++    private:
++      unsigned _seed;
++      double mean;
++      double sdev;
+ 
+-    /*constructors, destructors: */
+-    rnd_normal_distribution();
+-    rnd_normal_distribution(double m,double s);
+-    ~rnd_normal_distribution();
++    public:
+ 
+-    void seed( unsigned int s );
+-    double generator();
++      /*constructors, destructors: */
++      normal_distribution();
++      normal_distribution(double m,double s);
++      ~normal_distribution();
+ 
+-};
++      void seed( unsigned int s );
++      double generator();
+ 
++  };
++
++}
++
+ #endif //ifndef _RANDOMGENERATOR_H_
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26602)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26603)
+@@ -17,7 +17,7 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	rnd_normal_distribution distribution;
++	rnd::normal_distribution distribution;
+ 	if(seed<0){
+ 		std::random_device rd;
+ 		seed = rd();
Index: /issm/oecreview/Archive/25834-26739/ISSM-26603-26604.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26603-26604.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26603-26604.diff	(revision 26740)
@@ -0,0 +1,1077 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26603)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26604)
+@@ -68,7 +68,7 @@
+ 		/*bool               AnyActive(void);*/
+ 		bool               AnyFSet(void);
+ 		void					 AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,int enum_type);
+-      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type);
++      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type);
+ 		void               ComputeLambdaS(void);
+ 		void               ComputeNewDamage();
+ 		void               ComputeStrainRate();
+Index: ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26604)
+@@ -79,7 +79,8 @@
+ 
+    /*Load parameters*/
+ 	bool isstochastic;
+-   int M,N,Nphi,arorder,numbasins,my_rank;
++   bool istfstochastic = false;
++	int M,N,Nphi,arorder,numbasins,my_rank;
+    femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+    femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
+    IssmDouble tinit_ar;
+@@ -86,7 +87,6 @@
+    IssmDouble* beta0      = NULL;
+    IssmDouble* beta1      = NULL;
+    IssmDouble* phi        = NULL;
+-   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
+ 
+ 	femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
+    femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
+@@ -93,7 +93,6 @@
+    femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
+    femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 
+-	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
+ 	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+ 	if(isstochastic){
+ 		int  numstochasticfields;
+@@ -101,10 +100,9 @@
+ 		femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+ 		femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+ 		for(int i=0;i<numstochasticfields;i++){
+-			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum){
+-				femmodel->parameters->FindParam(&noiseterms,&M,ThermalforcingAutoregressionNoiseEnum);  _assert_(M==numbasins);
+-			}
++			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum) istfstochastic = true;
+ 		}
++		xDelete<int>(stochasticfields);
+ 	}
+    /*Time elapsed with respect to AR model initial time*/
+    IssmDouble telapsed_ar = time-tinit_ar;
+@@ -112,7 +110,7 @@
+    /*Loop over each element to compute Thermal Forcing at vertices*/
+    for(Object* &object:femmodel->elements->objects){
+       Element* element = xDynamicCast<Element*>(object);
+-      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,FrontalForcingsRignotAutoregressionEnum);
++      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,istfstochastic,FrontalForcingsRignotAutoregressionEnum);
+    }
+ 
+    /*Cleanup*/
+@@ -119,5 +117,4 @@
+    xDelete<IssmDouble>(beta0);
+    xDelete<IssmDouble>(beta1);
+    xDelete<IssmDouble>(phi);
+-   xDelete<IssmDouble>(noiseterms);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26604)
+@@ -35,7 +35,7 @@
+ 		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+       if(randomflag) fixedseed=-1;
+       else fixedseed = reCast<int,IssmDouble>((time-starttime)/dt);
+-      /*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
++		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
+       IssmDouble* temparray = NULL;
+       multivariateNormal(&temparray,dimtot,0.0,covariance,fixedseed);
+       for(int i=0;i<dimtot;i++) noiseterms[i]=temparray[i];
+@@ -45,17 +45,68 @@
+    
+ 	int i=0;
+    for(int j=0;j<numfields;j++){
+-      int enum_type;
++      int dimenum_type,noiseenum_type;
+       IssmDouble* noisefield = xNew<IssmDouble>(dimensions[j]);
+       for(int k=0;k<dimensions[j];k++){
+          noisefield[k]=noiseterms[i+k];
+       }
+-      
+-      if(fields[j]==SMBautoregressionEnum)                        enum_type = SmbAutoregressionNoiseEnum;
+-		else if(fields[j]==FrontalForcingsRignotAutoregressionEnum) enum_type = ThermalforcingAutoregressionNoiseEnum;
+-		else _error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.\n"); 
+-      femmodel->parameters->SetParam(noisefield,dimensions[j],enum_type);
+-      i=i+dimensions[j];
++     
++		int dimensionid;
++
++		/*Deal with the autoregressive models*/
++		if(fields[j]==SMBautoregressionEnum || fields[j]==FrontalForcingsRignotAutoregressionEnum){
++			switch(fields[j]){
++				case SMBautoregressionEnum:
++					dimenum_type   = SmbBasinsIdEnum;
++					noiseenum_type = SmbAutoregressionNoiseEnum;
++					break;
++				case FrontalForcingsRignotAutoregressionEnum:
++					dimenum_type   = FrontalForcingsBasinIdEnum;
++					noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
++					break;
++			}
++			for(Object* &object:femmodel->elements->objects){
++            Element* element = xDynamicCast<Element*>(object);
++            int numvertices  = element->GetNumberOfVertices();
++            IssmDouble* noise_element = xNew<IssmDouble>(numvertices);
++            element->GetInputValue(&dimensionid,dimenum_type);
++            for(int i=0;i<numvertices;i++) noise_element[i] = noisefield[dimensionid];
++            element->AddInput(noiseenum_type,noise_element,P0Enum);
++            xDelete<IssmDouble>(noise_element);
++			}
++		}
++		else{
++			switch(fields[j]){
++				case SMBautoregressionEnum:
++				case FrontalForcingsRignotAutoregressionEnum:
++					/*Already done above*/
++					break;
++				case DefaultCalvingEnum:
++					/*Delete CalvingCalvingrateEnum at previous time step (required if it is transient)*/
++					femmodel->inputs->DeleteInput(CalvingCalvingrateEnum);
++					for(Object* &object:femmodel->elements->objects){
++						Element* element = xDynamicCast<Element*>(object);
++						int numvertices  = element->GetNumberOfVertices();
++						IssmDouble baselinecalvingrate;
++						IssmDouble calvingrate_tot[numvertices];
++						Input* baselinecalvingrate_input  = NULL;
++						baselinecalvingrate_input = element->GetInput(BaselineCalvingCalvingrateEnum); _assert_(baselinecalvingrate_input);
++						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
++						Gauss* gauss = element->NewGauss();
++						for(int i=0;i<numvertices;i++){
++							gauss->GaussVertex(i);
++							baselinecalvingrate_input->GetInputValue(&baselinecalvingrate,gauss);
++							calvingrate_tot[i] = max(0.0,baselinecalvingrate+noisefield[dimensionid]);
++						}
++						element->AddInput(CalvingCalvingrateEnum,&calvingrate_tot[0],P1DGEnum);
++						delete gauss;
++					}
++					break;
++				default:
++					_error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.");
++			}
++		}
++		i=i+dimensions[j];
+       xDelete<IssmDouble>(noisefield);
+    }
+ 
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(revision 26603)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26604)
+@@ -48,7 +48,6 @@
+ %Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1;
+ md.stochasticforcing.fields              = [{'SMBautoregression'}];
+-md.stochasticforcing.dimensions          = [md.smb.num_basins]; %dimension of each field
+ md.stochasticforcing.covariance          = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]]; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %fixed random seeds
+ 
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(revision 26603)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26604)
+@@ -38,7 +38,6 @@
+ %Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1;
+ md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'}];
+-md.stochasticforcing.dimensions          = [md.frontalforcings.num_basins]; %dimension of each field
+ md.stochasticforcing.covariance          = 1e-4*[[1.5,0.5];[0.5,0.4]]; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %determines true/false randomness
+ 
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26604)
+@@ -11,39 +11,10 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+-	
+-	/*intermediary: */
+ 	int finiteelement;
+-	int         code,vector_layout;
+-	IssmDouble *spcdata = NULL;
+-	int         M,N;
+-
+-	/*Get finite element type for this analysis*/
+ 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
+-
+-	/*First of, find the record for the enum, and get code  of data type: */
+-	iomodel->SetFilePointerToData(&code, &vector_layout,"md.levelset.spclevelset");
+-	if(code!=7)_error_("expecting a IssmDouble vector for constraints md.levelset.spclevelset");
+-	if(vector_layout!=1)_error_("expecting a nodal vector for constraints md.levelset.spclevelset");
+-
+-	/*Fetch vector:*/
+-	iomodel->FetchData(&spcdata,&M,&N,"md.levelset.spclevelset");
+-
+-	/*Call IoModelToConstraintsx*/
+-	if(N>1){
+-		/*If it is a time series, most likely we are forcing the ice front position and do not want to have a Dynamic Constraint*/
+-		_assert_(M==iomodel->numberofvertices+1);
+-		IoModelToConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
+-	}
+-	else{
+-		/*This is not a time series, we probably have calving on, we need the levelset constraints to update as the levelset moves*/
+-		_assert_(N==1);
+-		_assert_(M==iomodel->numberofvertices);
+-		IoModelToDynamicConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
+-	}
+-
+-	/*Clean up*/
+-	xDelete<IssmDouble>(spcdata);
++	IoModelToDynamicConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
++	//IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+ }
+ /*}}}*/
+ void LevelsetAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+@@ -82,11 +53,17 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+ 
+ 	/*Get moving front parameters*/
++	bool isstochastic;
+ 	int  calvinglaw;
+ 	iomodel->FindConstant(&calvinglaw,"md.calving.law");
++	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
+ 	switch(calvinglaw){
+ 		case DefaultCalvingEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
++			if(isstochastic){
++				iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
++				iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",BaselineCalvingCalvingrateEnum);
++			}
+ 			break;
+ 		case CalvingLevermannEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.calving.coeff",CalvinglevermannCoeffEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26604)
+@@ -98,24 +98,77 @@
+    xDelete<IssmDouble>(varspin);
+    xDelete<IssmDouble>(phi_basin);	
+ }/*}}}*/
+-void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type){/*{{{*/
+-	
+-	const int numvertices = this->GetNumberOfVertices();
+-   int         basinid,M,N;
+-   IssmDouble  beta0_basin,beta1_basin,noise_basin;
++void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type){/*{{{*/
++   
++   const int numvertices = this->GetNumberOfVertices();
++   int         basinid,M,N,arenum_type,basinenum_type,noiseenum_type,outenum_type;
++   IssmDouble  beta0_basin,beta1_basin,noiseterm;
+    IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
+    IssmDouble* varlist     = xNew<IssmDouble>(numvertices);
+    IssmDouble* valuesautoregression = NULL;
++   Input*      noiseterm_input      = NULL;
+ 
+-   /*Get Basin ID and Basin coefficients*/
+-   if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
++   /*Get field-specific enums*/
++	switch(enum_type){
++      case(SMBautoregressionEnum):
++			arenum_type    = SmbValuesAutoregressionEnum;
++			basinenum_type = SmbBasinsIdEnum;
++			noiseenum_type = SmbAutoregressionNoiseEnum;
++         outenum_type   = SmbMassBalanceEnum;
++			break;
++		case(FrontalForcingsRignotAutoregressionEnum):
++         arenum_type    = ThermalforcingValuesAutoregressionEnum;
++         basinenum_type = FrontalForcingsBasinIdEnum;
++         noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
++         outenum_type   = FrontalForcingsThermalForcingEnum;
++			break;
++	}
++
++	/*Get noise and autoregressive terms*/
++	this->GetInputValue(&basinid,basinenum_type);
++	if(isfieldstochastic){
++      noiseterm_input = this->GetInput(noiseenum_type);
++      Gauss* gauss = this->NewGauss();
++      noiseterm_input->GetInputValue(&noiseterm,gauss);
++      delete gauss;
++   }
++	else noiseterm = 0.0;
++   this->inputs->GetArray(arenum_type,this->lid,&valuesautoregression,&M);
++
++
++	/*
++         this->GetInputValue(&basinid,SmbBasinsIdEnum);
++         if(isfieldstochastic){
++            noiseterm_input = this->GetInput(SmbAutoregressionNoiseEnum);
++            Gauss* gauss = this->NewGauss();
++            noiseterm_input->GetInputValue(&noiseterm,gauss);
++            delete gauss;
++         }
++         else noiseterm = 0.0;
++         this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
++         arenum_type  = SmbValuesAutoregressionEnum;
++         outenum_type = SmbMassBalanceEnum;
++         break;
++      case(FrontalForcingsRignotAutoregressionEnum):
++         this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
++         if(isfieldstochastic){
++            noiseterm_input = this->GetInput(ThermalforcingAutoregressionNoiseEnum);
++            Gauss* gauss = this->NewGauss();
++            noiseterm_input->GetInputValue(&noiseterm,gauss);
++            delete gauss;
++         }
++         else noiseterm = 0.0;
++         this->inputs->GetArray(ThermalforcingValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
++         arenum_type  = ThermalforcingValuesAutoregressionEnum;
++         outenum_type = FrontalForcingsThermalForcingEnum;
++         break;
++   }
++	*/
++
++	/*Get basin coefficients*/
+    for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii];
+    beta0_basin   = beta0[basinid];
+    beta1_basin   = beta1[basinid];
+-   noise_basin   = noiseterms[basinid];
+-   if(enum_type==SMBautoregressionEnum)                   this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
+-   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->GetArray(ThermalforcingValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
+ 
+    /*If not AR model timestep: take the old values of variable*/
+    if(isstepforar==false){
+@@ -130,26 +183,24 @@
+          for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*valuesautoregression[v+ii*numvertices];
+ 
+          /*Stochastic variable value*/
+-         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin;
++         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noiseterm;
+       }
+-      /*Update autoregression TF values*/
++      /*Update autoregression values*/
+       IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+       /*Assign newest values and shift older values*/
+       for(int i=0;i<numvertices;i++) temparray[i] = varlist[i];
+       for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = valuesautoregression[i];
+-      if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
+-      if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
++      this->inputs->SetArrayInput(arenum_type,this->lid,temparray,numvertices*arorder);
+       xDelete<IssmDouble>(temparray);
+    }
+ 
+    /*Add input to element*/
+-   if(enum_type==SMBautoregressionEnum)                   this->AddInput(SmbMassBalanceEnum,varlist,P1Enum);
+-   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->AddInput(FrontalForcingsThermalForcingEnum,varlist,P1Enum);
++   this->AddInput(outenum_type,varlist,P1Enum);
+ 
+    /*Cleanup*/
+    xDelete<IssmDouble>(phi_basin);
+    xDelete<IssmDouble>(varlist);
+-   xDelete<IssmDouble>(valuesautoregression);
++   xDelete<IssmDouble>(valuesautoregression); 
+ }/*}}}*/
+ void       Element::ComputeLambdaS(){/*{{{*/
+ 
+@@ -3777,7 +3828,6 @@
+ 	IssmDouble pAir=0.0;
+ 	IssmDouble teValue=1.0;
+ 	IssmDouble aValue=0.0;
+-	IssmDouble dulwrfValue=0.0;
+ 	IssmDouble szaValue=0.0;
+ 	IssmDouble cotValue=0.0;
+ 	IssmDouble ccsnowValue=0.0;
+@@ -3784,7 +3834,6 @@
+ 	IssmDouble cciceValue=0.0;
+ 	IssmDouble dt,time,smb_dt;
+ 	int        aIdx=0;
+-	int        eIdx=0;
+ 	int        denIdx=0;
+ 	int        dsnowIdx=0;
+ 	int        swIdx=0;
+@@ -3814,11 +3863,9 @@
+ 	IssmDouble accsumRa=0.0;
+ 	bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux;
+ 	bool isconstrainsurfaceT=false;
+-	bool isdeltaLWup=false;
+ 	IssmDouble init_scaling=0.0;
+ 	IssmDouble thermo_scaling=1.0;
+ 	IssmDouble adThresh=1023.0;
+-	IssmDouble teThresh=10;
+ 	/*}}}*/
+ 	/*Output variables:{{{ */
+ 	IssmDouble* dz=NULL;
+@@ -3868,7 +3915,6 @@
+ 	parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	parameters->FindParam(&smb_dt,SmbDtEnum);                     /*time period for the smb solution,  usually smaller than the glaciological dt*/
+ 	parameters->FindParam(&aIdx,SmbAIdxEnum);
+-	parameters->FindParam(&eIdx,SmbEIdxEnum);
+ 	parameters->FindParam(&denIdx,SmbDenIdxEnum);
+ 	parameters->FindParam(&swIdx,SmbSwIdxEnum);
+ 	parameters->FindParam(&dsnowIdx,SmbDsnowIdxEnum);
+@@ -3885,11 +3931,9 @@
+ 	parameters->FindParam(&isdensification,SmbIsdensificationEnum);
+ 	parameters->FindParam(&isturbulentflux,SmbIsturbulentfluxEnum);
+ 	parameters->FindParam(&isconstrainsurfaceT,SmbIsconstrainsurfaceTEnum);
+-	parameters->FindParam(&isdeltaLWup,SmbIsdeltaLWupEnum);
+ 	parameters->FindParam(&init_scaling,SmbInitDensityScalingEnum);
+ 	parameters->FindParam(&thermo_scaling,SmbThermoDeltaTScalingEnum);
+ 	parameters->FindParam(&adThresh,SmbAdThreshEnum);
+-	parameters->FindParam(&teThresh,SmbTeThreshEnum);
+ 	/*}}}*/
+ 	/*Retrieve inputs: {{{*/
+ 	Input *zTop_input          = this->GetInput(SmbZTopEnum);         _assert_(zTop_input);
+@@ -4079,7 +4123,6 @@
+ 	Input *pAir_input= this->GetInput(SmbPAirEnum,timeinputs);  _assert_(pAir_input);
+ 	Input *teValue_input= this->GetInput(SmbTeValueEnum,timeinputs); _assert_(teValue_input);
+ 	Input *aValue_input= this->GetInput(SmbAValueEnum,timeinputs); _assert_(aValue_input);
+-	Input *dulwrfValue_input= this->GetInput(SmbDulwrfValueEnum,timeinputs); _assert_(dulwrfValue_input);
+ 	Input *szaValue_input= this->GetInput(SmbSzaValueEnum,timeinputs); _assert_(szaValue_input);
+ 	Input *cotValue_input= this->GetInput(SmbCotValueEnum,timeinputs); _assert_(cotValue_input);
+ 	Input *ccsnowValue_input= this->GetInput(SmbCcsnowValueEnum,timeinputs); _assert_(ccsnowValue_input);
+@@ -4095,7 +4138,6 @@
+ 	eAir_input->GetInputValue(&eAir,gauss);  //screen level vapor pressure [Pa]
+ 	pAir_input->GetInputValue(&pAir,gauss);  // screen level air pressure [Pa]
+ 	teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
+-	dulwrfValue_input->GetInputValue(&dulwrfValue,gauss);  // LWup perturbation [W m-2]
+ 	aValue_input->GetInputValue(&aValue,gauss);  // Albedo [0 1]
+ 	szaValue_input->GetInputValue(&szaValue,gauss);  // Solar Zenith Angle [degree]
+ 	cotValue_input->GetInputValue(&cotValue,gauss);  // Cloud Optical Thickness
+@@ -4121,7 +4163,7 @@
+ 		if (m>1) T[1]=Ta;
+ 	}
+ 	/*Thermal profile computation:*/
+-	if(isthermal)thermo(&EC, &T, &ulw, re, dz, d, swf, dlw, Ta, V, eAir, pAir, eIdx, teValue, dulwrfValue, teThresh, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT,isdeltaLWup);
++	if(isthermal)thermo(&EC, &T, &ulw, dz, d, swf, dlw, Ta, V, eAir, pAir, teValue, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT);
+ 
+ 	/*Change in thickness of top cell due to evaporation/condensation  assuming same density as top cell.
+ 	 * need to fix this in case all or more of cell evaporates */
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26604)
+@@ -501,9 +501,10 @@
+ 	bool isstochasticforcing;
+ 	parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);
+ 	if(isstochasticforcing){
+-		int num_fields;
++		int num_fields,stochastic_dim;
+ 		char** fields;
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.num_fields",StochasticForcingNumFieldsEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.defaultdimension",StochasticForcingDefaultDimensionEnum));
+ 		iomodel->FindConstant(&fields,&num_fields,"md.stochasticforcing.fields");
+ 		if(num_fields<1) _error_("no stochasticforcing fields found");
+ 		int* stochasticforcing_enums = xNew<int>(num_fields);
+@@ -514,8 +515,7 @@
+ 		xDelete<char*>(fields);
+ 		parameters->AddObject(new IntVecParam(StochasticForcingFieldsEnum,stochasticforcing_enums,num_fields));
+ 		xDelete<int>(stochasticforcing_enums);
+-
+-      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.randomflag",StochasticForcingRandomflagEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.randomflag",StochasticForcingRandomflagEnum));
+ 		iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.dimensions");
+ 		parameters->AddObject(new IntVecParam(StochasticForcingDimensionsEnum,transparam,N));
+ 		xDelete<IssmDouble>(transparam);
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26604)
+@@ -196,6 +196,7 @@
+ 
+ 	/*Load parameters*/
+ 	bool isstochastic;
++	bool issmbstochastic = false;
+ 	int M,N,Nphi,arorder,numbasins,my_rank;
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+ 	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+@@ -209,8 +210,6 @@
+ 	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 
+-	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
+-   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
+ 	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+    if(isstochastic){
+ 		int  numstochasticfields;
+@@ -218,9 +217,7 @@
+       femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+       femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+       for(int i=0;i<numstochasticfields;i++){
+-         if(stochasticfields[i]==SMBautoregressionEnum){
+-				femmodel->parameters->FindParam(&noiseterms,&M,SmbAutoregressionNoiseEnum);  _assert_(M==numbasins);
+-			}
++         if(stochasticfields[i]==SMBautoregressionEnum) issmbstochastic = true;
+ 		}
+ 		xDelete<int>(stochasticfields);
+ 	}
+@@ -230,7 +227,7 @@
+ 	/*Loop over each element to compute SMB at vertices*/
+ 	for(Object* &object:femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,SMBautoregressionEnum);
++		element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,issmbstochastic,SMBautoregressionEnum);
+ 	}
+ 
+ 	/*Cleanup*/
+@@ -237,7 +234,6 @@
+ 	xDelete<IssmDouble>(beta0);
+ 	xDelete<IssmDouble>(beta1);
+ 	xDelete<IssmDouble>(phi);
+-	xDelete<IssmDouble>(noiseterms);
+ }/*}}}*/
+ void Delta18oParameterizationx(FemModel* femmodel){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26603)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26604)
+@@ -397,6 +397,7 @@
+ syn keyword cConstant SolidearthSettingsGrdOceanEnum
+ syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
+ syn keyword cConstant StochasticForcingCovarianceEnum
++syn keyword cConstant StochasticForcingDefaultDimensionEnum
+ syn keyword cConstant StochasticForcingDimensionsEnum
+ syn keyword cConstant StochasticForcingFieldsEnum
+ syn keyword cConstant StochasticForcingIsStochasticForcingEnum
+@@ -427,7 +428,6 @@
+ syn keyword cConstant SmbAccurefEnum
+ syn keyword cConstant SmbAdThreshEnum
+ syn keyword cConstant SmbAutoregressionInitialTimeEnum
+-syn keyword cConstant SmbAutoregressionNoiseEnum
+ syn keyword cConstant SmbAutoregressionTimestepEnum
+ syn keyword cConstant SmbAutoregressiveOrderEnum
+ syn keyword cConstant SmbAveragingEnum
+@@ -503,7 +503,6 @@
+ syn keyword cConstant StressbalanceRestolEnum
+ syn keyword cConstant StressbalanceRiftPenaltyThresholdEnum
+ syn keyword cConstant StressbalanceShelfDampeningEnum
+-syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+ syn keyword cConstant ThermalIsdrainicecolumnEnum
+ syn keyword cConstant ThermalIsdynamicbasalspcEnum
+ syn keyword cConstant ThermalIsenthalpyEnum
+@@ -598,6 +597,7 @@
+ syn keyword cConstant BasalStressyEnum
+ syn keyword cConstant BasalStressEnum
+ syn keyword cConstant BaseEnum
++syn keyword cConstant BaselineCalvingCalvingrateEnum
+ syn keyword cConstant BaseOldEnum
+ syn keyword cConstant BaseSlopeXEnum
+ syn keyword cConstant BaseSlopeYEnum
+@@ -612,6 +612,7 @@
+ syn keyword cConstant BottomPressureEnum
+ syn keyword cConstant BottomPressureOldEnum
+ syn keyword cConstant CalvingCalvingrateEnum
++syn keyword cConstant CalvingCalvingrateNoiseEnum
+ syn keyword cConstant CalvingHabFractionEnum
+ syn keyword cConstant CalvingMeltingrateEnum
+ syn keyword cConstant CalvingStressThresholdFloatingiceEnum
+@@ -894,6 +895,7 @@
+ syn keyword cConstant SmbAccumulationEnum
+ syn keyword cConstant SmbAdiffiniEnum
+ syn keyword cConstant SmbAiniEnum
++syn keyword cConstant SmbAutoregressionNoiseEnum
+ syn keyword cConstant SmbBasinsIdEnum
+ syn keyword cConstant SmbBMaxEnum
+ syn keyword cConstant SmbBMinEnum
+@@ -996,6 +998,7 @@
+ syn keyword cConstant SolidearthExternalDisplacementNorthRateEnum
+ syn keyword cConstant SolidearthExternalDisplacementUpRateEnum
+ syn keyword cConstant SolidearthExternalGeoidRateEnum
++syn keyword cConstant StochasticForcingDefaultIdEnum
+ syn keyword cConstant StrainRateeffectiveEnum
+ syn keyword cConstant StrainRateparallelEnum
+ syn keyword cConstant StrainRateperpendicularEnum
+@@ -1031,6 +1034,7 @@
+ syn keyword cConstant TemperaturePDDEnum
+ syn keyword cConstant TemperaturePicardEnum
+ syn keyword cConstant TemperatureSEMICEnum
++syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+ syn keyword cConstant ThermalforcingValuesAutoregressionEnum
+ syn keyword cConstant ThermalSpctemperatureEnum
+ syn keyword cConstant ThicknessAbsGradientEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26603)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26604)
+@@ -391,6 +391,7 @@
+ 	SolidearthSettingsGrdOceanEnum,
+ 	SolidearthSettingsOceanAreaScalingEnum,
+ 	StochasticForcingCovarianceEnum,
++	StochasticForcingDefaultDimensionEnum,
+ 	StochasticForcingDimensionsEnum,
+ 	StochasticForcingFieldsEnum,
+ 	StochasticForcingIsStochasticForcingEnum,
+@@ -421,7 +422,6 @@
+ 	SmbAccurefEnum,
+ 	SmbAdThreshEnum,
+ 	SmbAutoregressionInitialTimeEnum,
+-   SmbAutoregressionNoiseEnum,
+ 	SmbAutoregressionTimestepEnum,
+    SmbAutoregressiveOrderEnum,
+ 	SmbAveragingEnum,
+@@ -497,7 +497,6 @@
+ 	StressbalanceRestolEnum,
+ 	StressbalanceRiftPenaltyThresholdEnum,
+ 	StressbalanceShelfDampeningEnum,
+-   ThermalforcingAutoregressionNoiseEnum,
+ 	ThermalIsdrainicecolumnEnum,
+ 	ThermalIsdynamicbasalspcEnum,
+ 	ThermalIsenthalpyEnum,
+@@ -594,6 +593,7 @@
+ 	BasalStressyEnum,
+ 	BasalStressEnum,
+ 	BaseEnum,
++	BaselineCalvingCalvingrateEnum,
+ 	BaseOldEnum,
+ 	BaseSlopeXEnum,
+ 	BaseSlopeYEnum,
+@@ -608,6 +608,7 @@
+ 	BottomPressureEnum,
+ 	BottomPressureOldEnum,
+ 	CalvingCalvingrateEnum,
++	CalvingCalvingrateNoiseEnum,
+ 	CalvingHabFractionEnum,
+ 	CalvingMeltingrateEnum,
+ 	CalvingStressThresholdFloatingiceEnum,
+@@ -890,6 +891,7 @@
+ 	SmbAccumulationEnum,
+ 	SmbAdiffiniEnum,
+ 	SmbAiniEnum,
++   SmbAutoregressionNoiseEnum,
+ 	SmbBasinsIdEnum,
+ 	SmbBMaxEnum,
+ 	SmbBMinEnum,
+@@ -993,6 +995,7 @@
+ 	SolidearthExternalDisplacementNorthRateEnum,
+ 	SolidearthExternalDisplacementUpRateEnum,
+ 	SolidearthExternalGeoidRateEnum,
++	StochasticForcingDefaultIdEnum,
+ 	StrainRateeffectiveEnum,
+ 	StrainRateparallelEnum,
+ 	StrainRateperpendicularEnum,
+@@ -1028,6 +1031,7 @@
+ 	TemperaturePDDEnum,
+ 	TemperaturePicardEnum,
+ 	TemperatureSEMICEnum,
++   ThermalforcingAutoregressionNoiseEnum,
+ 	ThermalforcingValuesAutoregressionEnum,	
+ 	ThermalSpctemperatureEnum,
+ 	ThicknessAbsGradientEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26604)
+@@ -399,6 +399,7 @@
+ 		case SolidearthSettingsGrdOceanEnum : return "SolidearthSettingsGrdOcean";
+ 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
+ 		case StochasticForcingCovarianceEnum : return "StochasticForcingCovariance";
++		case StochasticForcingDefaultDimensionEnum : return "StochasticForcingDefaultDimension";
+ 		case StochasticForcingDimensionsEnum : return "StochasticForcingDimensions";
+ 		case StochasticForcingFieldsEnum : return "StochasticForcingFields";
+ 		case StochasticForcingIsStochasticForcingEnum : return "StochasticForcingIsStochasticForcing";
+@@ -429,7 +430,6 @@
+ 		case SmbAccurefEnum : return "SmbAccuref";
+ 		case SmbAdThreshEnum : return "SmbAdThresh";
+ 		case SmbAutoregressionInitialTimeEnum : return "SmbAutoregressionInitialTime";
+-		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+ 		case SmbAutoregressionTimestepEnum : return "SmbAutoregressionTimestep";
+ 		case SmbAutoregressiveOrderEnum : return "SmbAutoregressiveOrder";
+ 		case SmbAveragingEnum : return "SmbAveraging";
+@@ -505,7 +505,6 @@
+ 		case StressbalanceRestolEnum : return "StressbalanceRestol";
+ 		case StressbalanceRiftPenaltyThresholdEnum : return "StressbalanceRiftPenaltyThreshold";
+ 		case StressbalanceShelfDampeningEnum : return "StressbalanceShelfDampening";
+-		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+ 		case ThermalIsdrainicecolumnEnum : return "ThermalIsdrainicecolumn";
+ 		case ThermalIsdynamicbasalspcEnum : return "ThermalIsdynamicbasalspc";
+ 		case ThermalIsenthalpyEnum : return "ThermalIsenthalpy";
+@@ -600,6 +599,7 @@
+ 		case BasalStressyEnum : return "BasalStressy";
+ 		case BasalStressEnum : return "BasalStress";
+ 		case BaseEnum : return "Base";
++		case BaselineCalvingCalvingrateEnum : return "BaselineCalvingCalvingrate";
+ 		case BaseOldEnum : return "BaseOld";
+ 		case BaseSlopeXEnum : return "BaseSlopeX";
+ 		case BaseSlopeYEnum : return "BaseSlopeY";
+@@ -614,6 +614,7 @@
+ 		case BottomPressureEnum : return "BottomPressure";
+ 		case BottomPressureOldEnum : return "BottomPressureOld";
+ 		case CalvingCalvingrateEnum : return "CalvingCalvingrate";
++		case CalvingCalvingrateNoiseEnum : return "CalvingCalvingrateNoise";
+ 		case CalvingHabFractionEnum : return "CalvingHabFraction";
+ 		case CalvingMeltingrateEnum : return "CalvingMeltingrate";
+ 		case CalvingStressThresholdFloatingiceEnum : return "CalvingStressThresholdFloatingice";
+@@ -896,6 +897,7 @@
+ 		case SmbAccumulationEnum : return "SmbAccumulation";
+ 		case SmbAdiffiniEnum : return "SmbAdiffini";
+ 		case SmbAiniEnum : return "SmbAini";
++		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+ 		case SmbBasinsIdEnum : return "SmbBasinsId";
+ 		case SmbBMaxEnum : return "SmbBMax";
+ 		case SmbBMinEnum : return "SmbBMin";
+@@ -998,6 +1000,7 @@
+ 		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
+ 		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+ 		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
++		case StochasticForcingDefaultIdEnum : return "StochasticForcingDefaultId";
+ 		case StrainRateeffectiveEnum : return "StrainRateeffective";
+ 		case StrainRateparallelEnum : return "StrainRateparallel";
+ 		case StrainRateperpendicularEnum : return "StrainRateperpendicular";
+@@ -1033,6 +1036,7 @@
+ 		case TemperaturePDDEnum : return "TemperaturePDD";
+ 		case TemperaturePicardEnum : return "TemperaturePicard";
+ 		case TemperatureSEMICEnum : return "TemperatureSEMIC";
++		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+ 		case ThermalforcingValuesAutoregressionEnum : return "ThermalforcingValuesAutoregression";
+ 		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
+ 		case ThicknessAbsGradientEnum : return "ThicknessAbsGradient";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26603)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26604)
+@@ -408,6 +408,7 @@
+ 	      else if (strcmp(name,"SolidearthSettingsGrdOcean")==0) return SolidearthSettingsGrdOceanEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+ 	      else if (strcmp(name,"StochasticForcingCovariance")==0) return StochasticForcingCovarianceEnum;
++	      else if (strcmp(name,"StochasticForcingDefaultDimension")==0) return StochasticForcingDefaultDimensionEnum;
+ 	      else if (strcmp(name,"StochasticForcingDimensions")==0) return StochasticForcingDimensionsEnum;
+ 	      else if (strcmp(name,"StochasticForcingFields")==0) return StochasticForcingFieldsEnum;
+ 	      else if (strcmp(name,"StochasticForcingIsStochasticForcing")==0) return StochasticForcingIsStochasticForcingEnum;
+@@ -438,7 +439,6 @@
+ 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
+ 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionInitialTime")==0) return SmbAutoregressionInitialTimeEnum;
+-	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionTimestep")==0) return SmbAutoregressionTimestepEnum;
+ 	      else if (strcmp(name,"SmbAutoregressiveOrder")==0) return SmbAutoregressiveOrderEnum;
+ 	      else if (strcmp(name,"SmbAveraging")==0) return SmbAveragingEnum;
+@@ -517,7 +517,6 @@
+ 	      else if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
+ 	      else if (strcmp(name,"StressbalanceRiftPenaltyThreshold")==0) return StressbalanceRiftPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
+-	      else if (strcmp(name,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"ThermalIsdrainicecolumn")==0) return ThermalIsdrainicecolumnEnum;
+ 	      else if (strcmp(name,"ThermalIsdynamicbasalspc")==0) return ThermalIsdynamicbasalspcEnum;
+ 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
+@@ -612,6 +611,7 @@
+ 	      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,"BaselineCalvingCalvingrate")==0) return BaselineCalvingCalvingrateEnum;
+ 	      else if (strcmp(name,"BaseOld")==0) return BaseOldEnum;
+ 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
+ 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
+@@ -626,12 +626,13 @@
+ 	      else if (strcmp(name,"BottomPressure")==0) return BottomPressureEnum;
+ 	      else if (strcmp(name,"BottomPressureOld")==0) return BottomPressureOldEnum;
+ 	      else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
++	      else if (strcmp(name,"CalvingCalvingrateNoise")==0) return CalvingCalvingrateNoiseEnum;
+ 	      else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum;
+-	      else if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;
++	      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,"CalvingratexAverage")==0) return CalvingratexAverageEnum;
+@@ -750,11 +751,11 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
++	      if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
++	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+ 	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
+ 	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
+ 	      else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
+@@ -873,11 +874,11 @@
+ 	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
+ 	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+ 	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+-	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
++	      if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
++	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+ 	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+ 	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+ 	      else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
+@@ -917,6 +918,7 @@
+ 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
+ 	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
+ 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
++	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"SmbBasinsId")==0) return SmbBasinsIdEnum;
+ 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+ 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+@@ -995,12 +997,12 @@
+ 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+ 	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
+ 	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
+-	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
+-	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
++	      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;
+@@ -1022,6 +1024,7 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
++	      else if (strcmp(name,"StochasticForcingDefaultId")==0) return StochasticForcingDefaultIdEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+@@ -1057,6 +1060,7 @@
+ 	      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,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"ThermalforcingValuesAutoregression")==0) return ThermalforcingValuesAutoregressionEnum;
+ 	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
+ 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+@@ -1116,14 +1120,14 @@
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+-	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+ 	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+ 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
++	      else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
+ 	      else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum;
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+@@ -1239,14 +1243,14 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
+ 	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
+ 	      else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
+ 	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+-         else stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
++	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
+ 	      else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum;
+ 	      else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum;
+ 	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+@@ -1362,14 +1366,14 @@
+ 	      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,"Inputs")==0) return InputsEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"Inputs")==0) return InputsEnum;
+ 	      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 stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"J")==0) return JEnum;
++	      else if (strcmp(name,"J")==0) return JEnum;
+ 	      else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
+ 	      else if (strcmp(name,"MLHOApproximation")==0) return MLHOApproximationEnum;
+ 	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
+@@ -1485,14 +1489,14 @@
+ 	      else if (strcmp(name,"SMBautoregression")==0) return SMBautoregressionEnum;
+ 	      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 stage=13;
++   }
++   if(stage==13){
++	      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 stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum;
++	      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;
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26603)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26604)
+@@ -7,7 +7,8 @@
+ 	properties (SetAccess=public) 
+ 		isstochasticforcing  = 0;
+ 		fields               = NaN;
+-		dimensions           = NaN;
++		defaultdimension     = 0;
++      default_id           = NaN;
+ 		covariance           = NaN;
+ 		randomflag           = 1;
+ 	end
+@@ -33,33 +34,68 @@
+ 			if ~self.isstochasticforcing, return; end
+ 
+ 			num_fields = numel(self.fields);
+-			size_tot   = sum(self.dimensions);
++			
++			%Check that covariance matrix is positive definite
++			try
++				chol(self.covariance);
++			catch
++				error('md.stochasticforcing.covariance is not positive definite');
++			end
+ 
++			%Check that all fields agree with the corresponding md class and if any field needs the default params   
++         checkdefaults = false; %need to check defaults only if one of the field does not have its own dimensionality
++			for field=self.fields
++            %Checking agreement of classes
++            if(contains(field,'SMB'))
++               if~(isequal(class(md.smb),char(field)))
++                  error('md.smb does not agree with stochasticforcing field %s', char(field));
++               end
++            end
++            if(contains(field,'frontalforcings'))
++               if~(isequal(class(md.frontalforcings),char(field)))
++                  error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
++               end
++            end
++            %Checking for specific dimensions
++            if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
++               checkdefaults = true; %field with non-specific dimensionality
++            end
++         end
++
++			%Retrieve sum of all the field dimensionalities
++			size_tot   = self.defaultdimension*num_fields;
++			indSMBar = -1; %about to check for index of SMBautoregression
++			indTFar  = -1; %about to check for index of FrontalForcingsRignotAutoregression
++			if any(contains(self.fields,'SMBautoregression'))
++            size_tot = size_tot-self.defaultdimension+md.smb.num_basins;
++				indSMBar = find(contains(self.fields,'SMBautoregression')); %index of SMBar, now check for consistency with TFar timestep (08Nov2021)
++         end
++         if any(contains(self.fields,'FrontalForcingsRignotAutoregression'))
++            size_tot = size_tot-self.defaultdimension+md.frontalforcings.num_basins;
++				indTFar  = find(contains(self.fields,'FrontalForcingsRignotAutoregression')); %index of TFar, now check for consistency with SMBar timestep (08Nov2021)
++         end
++
++			if(indSMBar~=-1 && indTFar~=-1) %both autoregressive models are used: check autoregressive time step consistency
++				if((md.smb.ar_timestep~=md.frontalforcings.ar_timestep) && any(self.covariance(1+sum(self.dimensions(1:indSMBar-1)):sum(self.dimensions(1:indSMBar)),1+sum(self.dimensions(1:indTFar-1)):sum(self.dimensions(1:indTFar)))))
++					error('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance');
++				end
++			end
++
+ 			md = checkfield(md,'fieldname','stochasticforcing.isstochasticforcing','values',[0 1]);
+ 			md = checkfield(md,'fieldname','stochasticforcing.fields','numel',num_fields,'cell',1,'values',supportedstochforcings()); %VV check here 'cell' (19Oct2021)
+-			md = checkfield(md,'fieldname','stochasticforcing.dimensions','NaN',1,'Inf',1,'>',0,'size',[1,num_fields]); %specific dimension for each field
+ 			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot]); %global covariance matrix
+ 			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
+-
+-			%Check that all fields agree with the corresponding md class
+-			for field=self.fields
+-				if(contains(field,'SMB'))
+-					if~(isequal(class(md.smb),char(field)))
+-						error('md.smb does not agree with stochasticforcing field %s', char(field));
+-					end
+-				end
+-				if(contains(field,'frontalforcings'))
+-					if~(isequal(class(md.frontalforcings),char(field)))
+-						error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
+-					end
+-				end
+-			end
++			if(checkdefaults) %need to check the defaults
++            md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
++            md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
++         end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   stochasticforcing parameters:'));
+ 			fielddisplay(self,'isstochasticforcing','is stochasticity activated?');
+ 			fielddisplay(self,'fields','fields with stochasticity applied, ex: {''SMBautoregression''}, or {''FrontalForcingsRignotAutoregression''}');
+-			fielddisplay(self,'dimensions','dimensionality of each field');
++			fielddisplay(self,'defaultdimension','dimensionality of the noise terms (does not apply to fields with their specific dimension)');
++         fielddisplay(self,'default_id','id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)');
+ 			fielddisplay(self,'covariance','covariance matrix for within- and between-fields covariance (units must be squared field units)');
+ 			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 			disp('Available fields:');
+@@ -76,12 +112,27 @@
+ 			if ~self.isstochasticforcing 
+ 				return
+ 			else
++
++				%Retrieve dimensionality of each field
++				dimensions = self.defaultdimension*ones(1,num_fields);
++				ind = 1;
++				for field=self.fields
++					%Checking for specific dimensions
++					if(strcmp(field,'SMBautoregression'))
++						dimensions(ind) = md.smb.num_basins;
++					end
++					if(strcmp(field,'FrontalForcingsRignotAutoregression'))
++						dimensions(ind) = md.frontalforcings.num_basins;
++					end
++					ind = ind+1;
++				end
++
+ 				%Scaling covariance matrix (scale column-by-column and row-by-row)
+-				scaledfields = {'SMBautoregression'}; %list of fields that need scaling *1/yts
++				scaledfields = {'DefaultCalving','SMBautoregression'}; %list of fields that need scaling *1/yts
+ 				tempcovariance = self.covariance; %copy of covariance to avoid writing back in member variable
+ 				for i=1:num_fields
+ 					if any(strcmp(scaledfields,self.fields(i)))
+-						inds = [1+sum(self.dimensions(1:i-1)):1:sum(self.dimensions(1:i))];
++						inds = [1+sum(dimensions(1:i-1)):1:sum(dimensions(1:i))];
+ 						for row=inds %scale rows corresponding to scaled field
+ 							tempcovariance(row,:) = 1./yts*tempcovariance(row,:);
+ 						end
+@@ -92,7 +143,9 @@
+ 				end
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+-				WriteData(fid,prefix,'object',self,'fieldname','dimensions','format','IntMat');
++				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
++            WriteData(fid,prefix,'object',self,'fieldname','default_id','data',self.default_id-1,'format','IntMat','mattype',2); %0-indexed
++				WriteData(fid,prefix,'object',self,'fieldname','defaultdimension','format','Integer');
+ 				WriteData(fid,prefix,'data',tempcovariance,'name','md.stochasticforcing.covariance','format','DoubleMat');
+ 				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
+ 			end
+@@ -104,7 +157,8 @@
+    % by the class md.stochasticforcing
+ 
+    list = {...
+-      'SMBautoregression',...
+-      'FrontalForcingsRignotAutoregression'
++      'DefaultCalving',...
++		'FrontalForcingsRignotAutoregression',...
++      'SMBautoregression'
+       };
+ end % }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26604-26605.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26604-26605.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26604-26605.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 26604)
++++ ../trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h	(revision 26605)
+@@ -8,6 +8,6 @@
+ #include "../../classes/classes.h"
+ 
+ int InterpFromMeshToMesh2dx(double** pdata_interp,int* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
+-			double* data,int M_data,int N_data,double* x_interp,double* y_interp,int N_interp,Options* options);
++			double* data,int M_data,int N_data,double* x_interp,double* y_interp,int N_interp,Options* options=NULL);
+ 
+ #endif
Index: /issm/oecreview/Archive/25834-26739/ISSM-26605-26606.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26605-26606.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26605-26606.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Synchronize.sh
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 26605)
++++ ../trunk-jpl/src/c/shared/Enum/Synchronize.sh	(revision 26606)
+@@ -228,7 +228,25 @@
+ 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
+ #}}}
++#Build Enumjl.vim{{{
++#Header
++cat <<END > $ISSM_DIR/src/c/shared/Enum/Enumjl.vim
++""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++" ISSM specific julia syntax highlighting
++"
++"   WARNING: DO NOT MODIFY THIS FILE
++"            this file has been automatically generated by Synchronize.sh
++"            Please read README for more information
++""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ 
++"ISSM Enums
++END
++cat temp |  awk '{print "syn keyword juliaConstC " $1}' >> $ISSM_DIR/src/c/shared/Enum/Enumjl.vim
++cat <<END >> $ISSM_DIR/src/c/shared/Enum/Enumjl.vim
++"ISSM Enums end
++END
++#}}}
++
+ #clean up{{{
+ rm temp
+ #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26606-26607.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26606-26607.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26606-26607.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/solvers/asmoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmoptions.m	(revision 26606)
++++ ../trunk-jpl/src/m/solvers/asmoptions.m	(revision 26607)
+@@ -1,5 +1,5 @@
+ function asm=asmoptions(varargin)
+-%ASMOPTIONS - return Additive Shwartz Method petsc options
++%ASMOPTIONS - return Additive Schwartz Method petsc options
+ %
+ %   Usage:
+ %      options=asmoptions;
+Index: ../trunk-jpl/src/m/solvers/asmstokesoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmstokesoptions.m	(revision 26606)
++++ ../trunk-jpl/src/m/solvers/asmstokesoptions.m	(revision 26607)
+@@ -16,5 +16,5 @@
+ asm.sub_pc_type=getfieldvalue(options,'sub_pc_type','lu');
+ asm.pc_asm_overlap=getfieldvalue(options,'pc_asm_overlap',1); % COMSOL's default
+ asm.ksp_max_it=getfieldvalue(options,'ksp_max_it',100);
+-asm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-7); %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
+-asm.ksp_atol=getfieldvalue(options,'ksp_atol',1e-10); %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
+\ No newline at end of file
++asm.ksp_rtol=getfieldvalue(options,'ksp_rtol',1e-7);  %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
++asm.ksp_atol=getfieldvalue(options,'ksp_atol',1e-10); %tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
Index: /issm/oecreview/Archive/25834-26739/ISSM-26607-26608.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26607-26608.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26607-26608.diff	(revision 26740)
@@ -0,0 +1,1053 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26607)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26608)
+@@ -68,7 +68,7 @@
+ 		/*bool               AnyActive(void);*/
+ 		bool               AnyFSet(void);
+ 		void					 AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,int enum_type);
+-      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type);
++      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type);
+ 		void               ComputeLambdaS(void);
+ 		void               ComputeNewDamage();
+ 		void               ComputeStrainRate();
+Index: ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26608)
+@@ -79,8 +79,7 @@
+ 
+    /*Load parameters*/
+ 	bool isstochastic;
+-   bool istfstochastic = false;
+-	int M,N,Nphi,arorder,numbasins,my_rank;
++   int M,N,Nphi,arorder,numbasins,my_rank;
+    femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+    femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
+    IssmDouble tinit_ar;
+@@ -87,6 +86,7 @@
+    IssmDouble* beta0      = NULL;
+    IssmDouble* beta1      = NULL;
+    IssmDouble* phi        = NULL;
++   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
+ 
+ 	femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
+    femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
+@@ -93,6 +93,7 @@
+    femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
+    femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 
++	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
+ 	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+ 	if(isstochastic){
+ 		int  numstochasticfields;
+@@ -100,9 +101,10 @@
+ 		femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+ 		femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+ 		for(int i=0;i<numstochasticfields;i++){
+-			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum) istfstochastic = true;
++			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum){
++				femmodel->parameters->FindParam(&noiseterms,&M,ThermalforcingAutoregressionNoiseEnum);  _assert_(M==numbasins);
++			}
+ 		}
+-		xDelete<int>(stochasticfields);
+ 	}
+    /*Time elapsed with respect to AR model initial time*/
+    IssmDouble telapsed_ar = time-tinit_ar;
+@@ -110,7 +112,7 @@
+    /*Loop over each element to compute Thermal Forcing at vertices*/
+    for(Object* &object:femmodel->elements->objects){
+       Element* element = xDynamicCast<Element*>(object);
+-      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,istfstochastic,FrontalForcingsRignotAutoregressionEnum);
++      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,FrontalForcingsRignotAutoregressionEnum);
+    }
+ 
+    /*Cleanup*/
+@@ -117,4 +119,5 @@
+    xDelete<IssmDouble>(beta0);
+    xDelete<IssmDouble>(beta1);
+    xDelete<IssmDouble>(phi);
++   xDelete<IssmDouble>(noiseterms);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26608)
+@@ -501,10 +501,9 @@
+ 	bool isstochasticforcing;
+ 	parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);
+ 	if(isstochasticforcing){
+-		int num_fields,stochastic_dim;
++		int num_fields;
+ 		char** fields;
+ 		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.num_fields",StochasticForcingNumFieldsEnum));
+-		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.defaultdimension",StochasticForcingDefaultDimensionEnum));
+ 		iomodel->FindConstant(&fields,&num_fields,"md.stochasticforcing.fields");
+ 		if(num_fields<1) _error_("no stochasticforcing fields found");
+ 		int* stochasticforcing_enums = xNew<int>(num_fields);
+@@ -515,7 +514,8 @@
+ 		xDelete<char*>(fields);
+ 		parameters->AddObject(new IntVecParam(StochasticForcingFieldsEnum,stochasticforcing_enums,num_fields));
+ 		xDelete<int>(stochasticforcing_enums);
+-		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.randomflag",StochasticForcingRandomflagEnum));
++
++      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.randomflag",StochasticForcingRandomflagEnum));
+ 		iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.dimensions");
+ 		parameters->AddObject(new IntVecParam(StochasticForcingDimensionsEnum,transparam,N));
+ 		xDelete<IssmDouble>(transparam);
+Index: ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26608)
+@@ -35,7 +35,7 @@
+ 		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+       if(randomflag) fixedseed=-1;
+       else fixedseed = reCast<int,IssmDouble>((time-starttime)/dt);
+-		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
++      /*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
+       IssmDouble* temparray = NULL;
+       multivariateNormal(&temparray,dimtot,0.0,covariance,fixedseed);
+       for(int i=0;i<dimtot;i++) noiseterms[i]=temparray[i];
+@@ -45,68 +45,17 @@
+    
+ 	int i=0;
+    for(int j=0;j<numfields;j++){
+-      int dimenum_type,noiseenum_type;
++      int enum_type;
+       IssmDouble* noisefield = xNew<IssmDouble>(dimensions[j]);
+       for(int k=0;k<dimensions[j];k++){
+          noisefield[k]=noiseterms[i+k];
+       }
+-     
+-		int dimensionid;
+-
+-		/*Deal with the autoregressive models*/
+-		if(fields[j]==SMBautoregressionEnum || fields[j]==FrontalForcingsRignotAutoregressionEnum){
+-			switch(fields[j]){
+-				case SMBautoregressionEnum:
+-					dimenum_type   = SmbBasinsIdEnum;
+-					noiseenum_type = SmbAutoregressionNoiseEnum;
+-					break;
+-				case FrontalForcingsRignotAutoregressionEnum:
+-					dimenum_type   = FrontalForcingsBasinIdEnum;
+-					noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
+-					break;
+-			}
+-			for(Object* &object:femmodel->elements->objects){
+-            Element* element = xDynamicCast<Element*>(object);
+-            int numvertices  = element->GetNumberOfVertices();
+-            IssmDouble* noise_element = xNew<IssmDouble>(numvertices);
+-            element->GetInputValue(&dimensionid,dimenum_type);
+-            for(int i=0;i<numvertices;i++) noise_element[i] = noisefield[dimensionid];
+-            element->AddInput(noiseenum_type,noise_element,P0Enum);
+-            xDelete<IssmDouble>(noise_element);
+-			}
+-		}
+-		else{
+-			switch(fields[j]){
+-				case SMBautoregressionEnum:
+-				case FrontalForcingsRignotAutoregressionEnum:
+-					/*Already done above*/
+-					break;
+-				case DefaultCalvingEnum:
+-					/*Delete CalvingCalvingrateEnum at previous time step (required if it is transient)*/
+-					femmodel->inputs->DeleteInput(CalvingCalvingrateEnum);
+-					for(Object* &object:femmodel->elements->objects){
+-						Element* element = xDynamicCast<Element*>(object);
+-						int numvertices  = element->GetNumberOfVertices();
+-						IssmDouble baselinecalvingrate;
+-						IssmDouble calvingrate_tot[numvertices];
+-						Input* baselinecalvingrate_input  = NULL;
+-						baselinecalvingrate_input = element->GetInput(BaselineCalvingCalvingrateEnum); _assert_(baselinecalvingrate_input);
+-						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
+-						Gauss* gauss = element->NewGauss();
+-						for(int i=0;i<numvertices;i++){
+-							gauss->GaussVertex(i);
+-							baselinecalvingrate_input->GetInputValue(&baselinecalvingrate,gauss);
+-							calvingrate_tot[i] = max(0.0,baselinecalvingrate+noisefield[dimensionid]);
+-						}
+-						element->AddInput(CalvingCalvingrateEnum,&calvingrate_tot[0],P1DGEnum);
+-						delete gauss;
+-					}
+-					break;
+-				default:
+-					_error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.");
+-			}
+-		}
+-		i=i+dimensions[j];
++      
++      if(fields[j]==SMBautoregressionEnum)                        enum_type = SmbAutoregressionNoiseEnum;
++		else if(fields[j]==FrontalForcingsRignotAutoregressionEnum) enum_type = ThermalforcingAutoregressionNoiseEnum;
++		else _error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.\n"); 
++      femmodel->parameters->SetParam(noisefield,dimensions[j],enum_type);
++      i=i+dimensions[j];
+       xDelete<IssmDouble>(noisefield);
+    }
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26608)
+@@ -196,7 +196,6 @@
+ 
+ 	/*Load parameters*/
+ 	bool isstochastic;
+-	bool issmbstochastic = false;
+ 	int M,N,Nphi,arorder,numbasins,my_rank;
+ 	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+ 	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+@@ -210,6 +209,8 @@
+ 	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+ 	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 
++	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
++   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
+ 	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+    if(isstochastic){
+ 		int  numstochasticfields;
+@@ -217,7 +218,9 @@
+       femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+       femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+       for(int i=0;i<numstochasticfields;i++){
+-         if(stochasticfields[i]==SMBautoregressionEnum) issmbstochastic = true;
++         if(stochasticfields[i]==SMBautoregressionEnum){
++				femmodel->parameters->FindParam(&noiseterms,&M,SmbAutoregressionNoiseEnum);  _assert_(M==numbasins);
++			}
+ 		}
+ 		xDelete<int>(stochasticfields);
+ 	}
+@@ -227,7 +230,7 @@
+ 	/*Loop over each element to compute SMB at vertices*/
+ 	for(Object* &object:femmodel->elements->objects){
+ 		Element* element = xDynamicCast<Element*>(object);
+-		element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,issmbstochastic,SMBautoregressionEnum);
++		element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,SMBautoregressionEnum);
+ 	}
+ 
+ 	/*Cleanup*/
+@@ -234,6 +237,7 @@
+ 	xDelete<IssmDouble>(beta0);
+ 	xDelete<IssmDouble>(beta1);
+ 	xDelete<IssmDouble>(phi);
++	xDelete<IssmDouble>(noiseterms);
+ }/*}}}*/
+ void Delta18oParameterizationx(FemModel* femmodel){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26608)
+@@ -11,10 +11,39 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
++	
++	/*intermediary: */
+ 	int finiteelement;
++	int         code,vector_layout;
++	IssmDouble *spcdata = NULL;
++	int         M,N;
++
++	/*Get finite element type for this analysis*/
+ 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
+-	IoModelToDynamicConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
+-	//IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,finiteelement);
++
++	/*First of, find the record for the enum, and get code  of data type: */
++	iomodel->SetFilePointerToData(&code, &vector_layout,"md.levelset.spclevelset");
++	if(code!=7)_error_("expecting a IssmDouble vector for constraints md.levelset.spclevelset");
++	if(vector_layout!=1)_error_("expecting a nodal vector for constraints md.levelset.spclevelset");
++
++	/*Fetch vector:*/
++	iomodel->FetchData(&spcdata,&M,&N,"md.levelset.spclevelset");
++
++	/*Call IoModelToConstraintsx*/
++	if(N>1){
++		/*If it is a time series, most likely we are forcing the ice front position and do not want to have a Dynamic Constraint*/
++		_assert_(M==iomodel->numberofvertices+1);
++		IoModelToConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
++	}
++	else{
++		/*This is not a time series, we probably have calving on, we need the levelset constraints to update as the levelset moves*/
++		_assert_(N==1);
++		_assert_(M==iomodel->numberofvertices);
++		IoModelToDynamicConstraintsx(constraints,iomodel,spcdata,M,N,LevelsetAnalysisEnum,finiteelement);
++	}
++
++	/*Clean up*/
++	xDelete<IssmDouble>(spcdata);
+ }
+ /*}}}*/
+ void LevelsetAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+@@ -53,17 +82,11 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+ 
+ 	/*Get moving front parameters*/
+-	bool isstochastic;
+ 	int  calvinglaw;
+ 	iomodel->FindConstant(&calvinglaw,"md.calving.law");
+-	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
+ 	switch(calvinglaw){
+ 		case DefaultCalvingEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
+-			if(isstochastic){
+-				iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
+-				iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",BaselineCalvingCalvingrateEnum);
+-			}
+ 			break;
+ 		case CalvingLevermannEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.calving.coeff",CalvinglevermannCoeffEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26608)
+@@ -98,77 +98,24 @@
+    xDelete<IssmDouble>(varspin);
+    xDelete<IssmDouble>(phi_basin);	
+ }/*}}}*/
+-void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type){/*{{{*/
+-   
+-   const int numvertices = this->GetNumberOfVertices();
+-   int         basinid,M,N,arenum_type,basinenum_type,noiseenum_type,outenum_type;
+-   IssmDouble  beta0_basin,beta1_basin,noiseterm;
++void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type){/*{{{*/
++	
++	const int numvertices = this->GetNumberOfVertices();
++   int         basinid,M,N;
++   IssmDouble  beta0_basin,beta1_basin,noise_basin;
+    IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
+    IssmDouble* varlist     = xNew<IssmDouble>(numvertices);
+    IssmDouble* valuesautoregression = NULL;
+-   Input*      noiseterm_input      = NULL;
+ 
+-   /*Get field-specific enums*/
+-	switch(enum_type){
+-      case(SMBautoregressionEnum):
+-			arenum_type    = SmbValuesAutoregressionEnum;
+-			basinenum_type = SmbBasinsIdEnum;
+-			noiseenum_type = SmbAutoregressionNoiseEnum;
+-         outenum_type   = SmbMassBalanceEnum;
+-			break;
+-		case(FrontalForcingsRignotAutoregressionEnum):
+-         arenum_type    = ThermalforcingValuesAutoregressionEnum;
+-         basinenum_type = FrontalForcingsBasinIdEnum;
+-         noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
+-         outenum_type   = FrontalForcingsThermalForcingEnum;
+-			break;
+-	}
+-
+-	/*Get noise and autoregressive terms*/
+-	this->GetInputValue(&basinid,basinenum_type);
+-	if(isfieldstochastic){
+-      noiseterm_input = this->GetInput(noiseenum_type);
+-      Gauss* gauss = this->NewGauss();
+-      noiseterm_input->GetInputValue(&noiseterm,gauss);
+-      delete gauss;
+-   }
+-	else noiseterm = 0.0;
+-   this->inputs->GetArray(arenum_type,this->lid,&valuesautoregression,&M);
+-
+-
+-	/*
+-         this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-         if(isfieldstochastic){
+-            noiseterm_input = this->GetInput(SmbAutoregressionNoiseEnum);
+-            Gauss* gauss = this->NewGauss();
+-            noiseterm_input->GetInputValue(&noiseterm,gauss);
+-            delete gauss;
+-         }
+-         else noiseterm = 0.0;
+-         this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
+-         arenum_type  = SmbValuesAutoregressionEnum;
+-         outenum_type = SmbMassBalanceEnum;
+-         break;
+-      case(FrontalForcingsRignotAutoregressionEnum):
+-         this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
+-         if(isfieldstochastic){
+-            noiseterm_input = this->GetInput(ThermalforcingAutoregressionNoiseEnum);
+-            Gauss* gauss = this->NewGauss();
+-            noiseterm_input->GetInputValue(&noiseterm,gauss);
+-            delete gauss;
+-         }
+-         else noiseterm = 0.0;
+-         this->inputs->GetArray(ThermalforcingValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
+-         arenum_type  = ThermalforcingValuesAutoregressionEnum;
+-         outenum_type = FrontalForcingsThermalForcingEnum;
+-         break;
+-   }
+-	*/
+-
+-	/*Get basin coefficients*/
++   /*Get Basin ID and Basin coefficients*/
++   if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
+    for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii];
+    beta0_basin   = beta0[basinid];
+    beta1_basin   = beta1[basinid];
++   noise_basin   = noiseterms[basinid];
++   if(enum_type==SMBautoregressionEnum)                   this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->GetArray(ThermalforcingValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
+ 
+    /*If not AR model timestep: take the old values of variable*/
+    if(isstepforar==false){
+@@ -183,24 +130,26 @@
+          for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*valuesautoregression[v+ii*numvertices];
+ 
+          /*Stochastic variable value*/
+-         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noiseterm;
++         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin;
+       }
+-      /*Update autoregression values*/
++      /*Update autoregression TF values*/
+       IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+       /*Assign newest values and shift older values*/
+       for(int i=0;i<numvertices;i++) temparray[i] = varlist[i];
+       for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = valuesautoregression[i];
+-      this->inputs->SetArrayInput(arenum_type,this->lid,temparray,numvertices*arorder);
++      if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
++      if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
+       xDelete<IssmDouble>(temparray);
+    }
+ 
+    /*Add input to element*/
+-   this->AddInput(outenum_type,varlist,P1Enum);
++   if(enum_type==SMBautoregressionEnum)                   this->AddInput(SmbMassBalanceEnum,varlist,P1Enum);
++   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->AddInput(FrontalForcingsThermalForcingEnum,varlist,P1Enum);
+ 
+    /*Cleanup*/
+    xDelete<IssmDouble>(phi_basin);
+    xDelete<IssmDouble>(varlist);
+-   xDelete<IssmDouble>(valuesautoregression); 
++   xDelete<IssmDouble>(valuesautoregression);
+ }/*}}}*/
+ void       Element::ComputeLambdaS(){/*{{{*/
+ 
+@@ -3828,6 +3777,7 @@
+ 	IssmDouble pAir=0.0;
+ 	IssmDouble teValue=1.0;
+ 	IssmDouble aValue=0.0;
++	IssmDouble dulwrfValue=0.0;
+ 	IssmDouble szaValue=0.0;
+ 	IssmDouble cotValue=0.0;
+ 	IssmDouble ccsnowValue=0.0;
+@@ -3834,6 +3784,7 @@
+ 	IssmDouble cciceValue=0.0;
+ 	IssmDouble dt,time,smb_dt;
+ 	int        aIdx=0;
++	int        eIdx=0;
+ 	int        denIdx=0;
+ 	int        dsnowIdx=0;
+ 	int        swIdx=0;
+@@ -3863,9 +3814,11 @@
+ 	IssmDouble accsumRa=0.0;
+ 	bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux;
+ 	bool isconstrainsurfaceT=false;
++	bool isdeltaLWup=false;
+ 	IssmDouble init_scaling=0.0;
+ 	IssmDouble thermo_scaling=1.0;
+ 	IssmDouble adThresh=1023.0;
++	IssmDouble teThresh=10;
+ 	/*}}}*/
+ 	/*Output variables:{{{ */
+ 	IssmDouble* dz=NULL;
+@@ -3915,6 +3868,7 @@
+ 	parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	parameters->FindParam(&smb_dt,SmbDtEnum);                     /*time period for the smb solution,  usually smaller than the glaciological dt*/
+ 	parameters->FindParam(&aIdx,SmbAIdxEnum);
++	parameters->FindParam(&eIdx,SmbEIdxEnum);
+ 	parameters->FindParam(&denIdx,SmbDenIdxEnum);
+ 	parameters->FindParam(&swIdx,SmbSwIdxEnum);
+ 	parameters->FindParam(&dsnowIdx,SmbDsnowIdxEnum);
+@@ -3931,9 +3885,11 @@
+ 	parameters->FindParam(&isdensification,SmbIsdensificationEnum);
+ 	parameters->FindParam(&isturbulentflux,SmbIsturbulentfluxEnum);
+ 	parameters->FindParam(&isconstrainsurfaceT,SmbIsconstrainsurfaceTEnum);
++	parameters->FindParam(&isdeltaLWup,SmbIsdeltaLWupEnum);
+ 	parameters->FindParam(&init_scaling,SmbInitDensityScalingEnum);
+ 	parameters->FindParam(&thermo_scaling,SmbThermoDeltaTScalingEnum);
+ 	parameters->FindParam(&adThresh,SmbAdThreshEnum);
++	parameters->FindParam(&teThresh,SmbTeThreshEnum);
+ 	/*}}}*/
+ 	/*Retrieve inputs: {{{*/
+ 	Input *zTop_input          = this->GetInput(SmbZTopEnum);         _assert_(zTop_input);
+@@ -4123,6 +4079,7 @@
+ 	Input *pAir_input= this->GetInput(SmbPAirEnum,timeinputs);  _assert_(pAir_input);
+ 	Input *teValue_input= this->GetInput(SmbTeValueEnum,timeinputs); _assert_(teValue_input);
+ 	Input *aValue_input= this->GetInput(SmbAValueEnum,timeinputs); _assert_(aValue_input);
++	Input *dulwrfValue_input= this->GetInput(SmbDulwrfValueEnum,timeinputs); _assert_(dulwrfValue_input);
+ 	Input *szaValue_input= this->GetInput(SmbSzaValueEnum,timeinputs); _assert_(szaValue_input);
+ 	Input *cotValue_input= this->GetInput(SmbCotValueEnum,timeinputs); _assert_(cotValue_input);
+ 	Input *ccsnowValue_input= this->GetInput(SmbCcsnowValueEnum,timeinputs); _assert_(ccsnowValue_input);
+@@ -4138,6 +4095,7 @@
+ 	eAir_input->GetInputValue(&eAir,gauss);  //screen level vapor pressure [Pa]
+ 	pAir_input->GetInputValue(&pAir,gauss);  // screen level air pressure [Pa]
+ 	teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
++	dulwrfValue_input->GetInputValue(&dulwrfValue,gauss);  // LWup perturbation [W m-2]
+ 	aValue_input->GetInputValue(&aValue,gauss);  // Albedo [0 1]
+ 	szaValue_input->GetInputValue(&szaValue,gauss);  // Solar Zenith Angle [degree]
+ 	cotValue_input->GetInputValue(&cotValue,gauss);  // Cloud Optical Thickness
+@@ -4163,7 +4121,7 @@
+ 		if (m>1) T[1]=Ta;
+ 	}
+ 	/*Thermal profile computation:*/
+-	if(isthermal)thermo(&EC, &T, &ulw, dz, d, swf, dlw, Ta, V, eAir, pAir, teValue, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT);
++	if(isthermal)thermo(&EC, &T, &ulw, re, dz, d, swf, dlw, Ta, V, eAir, pAir, eIdx, teValue, dulwrfValue, teThresh, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid(),isconstrainsurfaceT,isdeltaLWup);
+ 
+ 	/*Change in thickness of top cell due to evaporation/condensation  assuming same density as top cell.
+ 	 * need to fix this in case all or more of cell evaporates */
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26607)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26608)
+@@ -397,7 +397,6 @@
+ syn keyword cConstant SolidearthSettingsGrdOceanEnum
+ syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
+ syn keyword cConstant StochasticForcingCovarianceEnum
+-syn keyword cConstant StochasticForcingDefaultDimensionEnum
+ syn keyword cConstant StochasticForcingDimensionsEnum
+ syn keyword cConstant StochasticForcingFieldsEnum
+ syn keyword cConstant StochasticForcingIsStochasticForcingEnum
+@@ -428,6 +427,7 @@
+ syn keyword cConstant SmbAccurefEnum
+ syn keyword cConstant SmbAdThreshEnum
+ syn keyword cConstant SmbAutoregressionInitialTimeEnum
++syn keyword cConstant SmbAutoregressionNoiseEnum
+ syn keyword cConstant SmbAutoregressionTimestepEnum
+ syn keyword cConstant SmbAutoregressiveOrderEnum
+ syn keyword cConstant SmbAveragingEnum
+@@ -503,6 +503,7 @@
+ syn keyword cConstant StressbalanceRestolEnum
+ syn keyword cConstant StressbalanceRiftPenaltyThresholdEnum
+ syn keyword cConstant StressbalanceShelfDampeningEnum
++syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+ syn keyword cConstant ThermalIsdrainicecolumnEnum
+ syn keyword cConstant ThermalIsdynamicbasalspcEnum
+ syn keyword cConstant ThermalIsenthalpyEnum
+@@ -597,7 +598,6 @@
+ syn keyword cConstant BasalStressyEnum
+ syn keyword cConstant BasalStressEnum
+ syn keyword cConstant BaseEnum
+-syn keyword cConstant BaselineCalvingCalvingrateEnum
+ syn keyword cConstant BaseOldEnum
+ syn keyword cConstant BaseSlopeXEnum
+ syn keyword cConstant BaseSlopeYEnum
+@@ -612,7 +612,6 @@
+ syn keyword cConstant BottomPressureEnum
+ syn keyword cConstant BottomPressureOldEnum
+ syn keyword cConstant CalvingCalvingrateEnum
+-syn keyword cConstant CalvingCalvingrateNoiseEnum
+ syn keyword cConstant CalvingHabFractionEnum
+ syn keyword cConstant CalvingMeltingrateEnum
+ syn keyword cConstant CalvingStressThresholdFloatingiceEnum
+@@ -895,7 +894,6 @@
+ syn keyword cConstant SmbAccumulationEnum
+ syn keyword cConstant SmbAdiffiniEnum
+ syn keyword cConstant SmbAiniEnum
+-syn keyword cConstant SmbAutoregressionNoiseEnum
+ syn keyword cConstant SmbBasinsIdEnum
+ syn keyword cConstant SmbBMaxEnum
+ syn keyword cConstant SmbBMinEnum
+@@ -998,7 +996,6 @@
+ syn keyword cConstant SolidearthExternalDisplacementNorthRateEnum
+ syn keyword cConstant SolidearthExternalDisplacementUpRateEnum
+ syn keyword cConstant SolidearthExternalGeoidRateEnum
+-syn keyword cConstant StochasticForcingDefaultIdEnum
+ syn keyword cConstant StrainRateeffectiveEnum
+ syn keyword cConstant StrainRateparallelEnum
+ syn keyword cConstant StrainRateperpendicularEnum
+@@ -1034,7 +1031,6 @@
+ syn keyword cConstant TemperaturePDDEnum
+ syn keyword cConstant TemperaturePicardEnum
+ syn keyword cConstant TemperatureSEMICEnum
+-syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+ syn keyword cConstant ThermalforcingValuesAutoregressionEnum
+ syn keyword cConstant ThermalSpctemperatureEnum
+ syn keyword cConstant ThicknessAbsGradientEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26607)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26608)
+@@ -391,7 +391,6 @@
+ 	SolidearthSettingsGrdOceanEnum,
+ 	SolidearthSettingsOceanAreaScalingEnum,
+ 	StochasticForcingCovarianceEnum,
+-	StochasticForcingDefaultDimensionEnum,
+ 	StochasticForcingDimensionsEnum,
+ 	StochasticForcingFieldsEnum,
+ 	StochasticForcingIsStochasticForcingEnum,
+@@ -422,6 +421,7 @@
+ 	SmbAccurefEnum,
+ 	SmbAdThreshEnum,
+ 	SmbAutoregressionInitialTimeEnum,
++   SmbAutoregressionNoiseEnum,
+ 	SmbAutoregressionTimestepEnum,
+    SmbAutoregressiveOrderEnum,
+ 	SmbAveragingEnum,
+@@ -497,6 +497,7 @@
+ 	StressbalanceRestolEnum,
+ 	StressbalanceRiftPenaltyThresholdEnum,
+ 	StressbalanceShelfDampeningEnum,
++   ThermalforcingAutoregressionNoiseEnum,
+ 	ThermalIsdrainicecolumnEnum,
+ 	ThermalIsdynamicbasalspcEnum,
+ 	ThermalIsenthalpyEnum,
+@@ -593,7 +594,6 @@
+ 	BasalStressyEnum,
+ 	BasalStressEnum,
+ 	BaseEnum,
+-	BaselineCalvingCalvingrateEnum,
+ 	BaseOldEnum,
+ 	BaseSlopeXEnum,
+ 	BaseSlopeYEnum,
+@@ -608,7 +608,6 @@
+ 	BottomPressureEnum,
+ 	BottomPressureOldEnum,
+ 	CalvingCalvingrateEnum,
+-	CalvingCalvingrateNoiseEnum,
+ 	CalvingHabFractionEnum,
+ 	CalvingMeltingrateEnum,
+ 	CalvingStressThresholdFloatingiceEnum,
+@@ -891,7 +890,6 @@
+ 	SmbAccumulationEnum,
+ 	SmbAdiffiniEnum,
+ 	SmbAiniEnum,
+-   SmbAutoregressionNoiseEnum,
+ 	SmbBasinsIdEnum,
+ 	SmbBMaxEnum,
+ 	SmbBMinEnum,
+@@ -995,7 +993,6 @@
+ 	SolidearthExternalDisplacementNorthRateEnum,
+ 	SolidearthExternalDisplacementUpRateEnum,
+ 	SolidearthExternalGeoidRateEnum,
+-	StochasticForcingDefaultIdEnum,
+ 	StrainRateeffectiveEnum,
+ 	StrainRateparallelEnum,
+ 	StrainRateperpendicularEnum,
+@@ -1031,7 +1028,6 @@
+ 	TemperaturePDDEnum,
+ 	TemperaturePicardEnum,
+ 	TemperatureSEMICEnum,
+-   ThermalforcingAutoregressionNoiseEnum,
+ 	ThermalforcingValuesAutoregressionEnum,	
+ 	ThermalSpctemperatureEnum,
+ 	ThicknessAbsGradientEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26608)
+@@ -399,7 +399,6 @@
+ 		case SolidearthSettingsGrdOceanEnum : return "SolidearthSettingsGrdOcean";
+ 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
+ 		case StochasticForcingCovarianceEnum : return "StochasticForcingCovariance";
+-		case StochasticForcingDefaultDimensionEnum : return "StochasticForcingDefaultDimension";
+ 		case StochasticForcingDimensionsEnum : return "StochasticForcingDimensions";
+ 		case StochasticForcingFieldsEnum : return "StochasticForcingFields";
+ 		case StochasticForcingIsStochasticForcingEnum : return "StochasticForcingIsStochasticForcing";
+@@ -430,6 +429,7 @@
+ 		case SmbAccurefEnum : return "SmbAccuref";
+ 		case SmbAdThreshEnum : return "SmbAdThresh";
+ 		case SmbAutoregressionInitialTimeEnum : return "SmbAutoregressionInitialTime";
++		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+ 		case SmbAutoregressionTimestepEnum : return "SmbAutoregressionTimestep";
+ 		case SmbAutoregressiveOrderEnum : return "SmbAutoregressiveOrder";
+ 		case SmbAveragingEnum : return "SmbAveraging";
+@@ -505,6 +505,7 @@
+ 		case StressbalanceRestolEnum : return "StressbalanceRestol";
+ 		case StressbalanceRiftPenaltyThresholdEnum : return "StressbalanceRiftPenaltyThreshold";
+ 		case StressbalanceShelfDampeningEnum : return "StressbalanceShelfDampening";
++		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+ 		case ThermalIsdrainicecolumnEnum : return "ThermalIsdrainicecolumn";
+ 		case ThermalIsdynamicbasalspcEnum : return "ThermalIsdynamicbasalspc";
+ 		case ThermalIsenthalpyEnum : return "ThermalIsenthalpy";
+@@ -599,7 +600,6 @@
+ 		case BasalStressyEnum : return "BasalStressy";
+ 		case BasalStressEnum : return "BasalStress";
+ 		case BaseEnum : return "Base";
+-		case BaselineCalvingCalvingrateEnum : return "BaselineCalvingCalvingrate";
+ 		case BaseOldEnum : return "BaseOld";
+ 		case BaseSlopeXEnum : return "BaseSlopeX";
+ 		case BaseSlopeYEnum : return "BaseSlopeY";
+@@ -614,7 +614,6 @@
+ 		case BottomPressureEnum : return "BottomPressure";
+ 		case BottomPressureOldEnum : return "BottomPressureOld";
+ 		case CalvingCalvingrateEnum : return "CalvingCalvingrate";
+-		case CalvingCalvingrateNoiseEnum : return "CalvingCalvingrateNoise";
+ 		case CalvingHabFractionEnum : return "CalvingHabFraction";
+ 		case CalvingMeltingrateEnum : return "CalvingMeltingrate";
+ 		case CalvingStressThresholdFloatingiceEnum : return "CalvingStressThresholdFloatingice";
+@@ -897,7 +896,6 @@
+ 		case SmbAccumulationEnum : return "SmbAccumulation";
+ 		case SmbAdiffiniEnum : return "SmbAdiffini";
+ 		case SmbAiniEnum : return "SmbAini";
+-		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+ 		case SmbBasinsIdEnum : return "SmbBasinsId";
+ 		case SmbBMaxEnum : return "SmbBMax";
+ 		case SmbBMinEnum : return "SmbBMin";
+@@ -1000,7 +998,6 @@
+ 		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
+ 		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+ 		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
+-		case StochasticForcingDefaultIdEnum : return "StochasticForcingDefaultId";
+ 		case StrainRateeffectiveEnum : return "StrainRateeffective";
+ 		case StrainRateparallelEnum : return "StrainRateparallel";
+ 		case StrainRateperpendicularEnum : return "StrainRateperpendicular";
+@@ -1036,7 +1033,6 @@
+ 		case TemperaturePDDEnum : return "TemperaturePDD";
+ 		case TemperaturePicardEnum : return "TemperaturePicard";
+ 		case TemperatureSEMICEnum : return "TemperatureSEMIC";
+-		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+ 		case ThermalforcingValuesAutoregressionEnum : return "ThermalforcingValuesAutoregression";
+ 		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
+ 		case ThicknessAbsGradientEnum : return "ThicknessAbsGradient";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26607)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26608)
+@@ -408,7 +408,6 @@
+ 	      else if (strcmp(name,"SolidearthSettingsGrdOcean")==0) return SolidearthSettingsGrdOceanEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+ 	      else if (strcmp(name,"StochasticForcingCovariance")==0) return StochasticForcingCovarianceEnum;
+-	      else if (strcmp(name,"StochasticForcingDefaultDimension")==0) return StochasticForcingDefaultDimensionEnum;
+ 	      else if (strcmp(name,"StochasticForcingDimensions")==0) return StochasticForcingDimensionsEnum;
+ 	      else if (strcmp(name,"StochasticForcingFields")==0) return StochasticForcingFieldsEnum;
+ 	      else if (strcmp(name,"StochasticForcingIsStochasticForcing")==0) return StochasticForcingIsStochasticForcingEnum;
+@@ -439,6 +438,7 @@
+ 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
+ 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionInitialTime")==0) return SmbAutoregressionInitialTimeEnum;
++	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionTimestep")==0) return SmbAutoregressionTimestepEnum;
+ 	      else if (strcmp(name,"SmbAutoregressiveOrder")==0) return SmbAutoregressiveOrderEnum;
+ 	      else if (strcmp(name,"SmbAveraging")==0) return SmbAveragingEnum;
+@@ -517,6 +517,7 @@
+ 	      else if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
+ 	      else if (strcmp(name,"StressbalanceRiftPenaltyThreshold")==0) return StressbalanceRiftPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
++	      else if (strcmp(name,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"ThermalIsdrainicecolumn")==0) return ThermalIsdrainicecolumnEnum;
+ 	      else if (strcmp(name,"ThermalIsdynamicbasalspc")==0) return ThermalIsdynamicbasalspcEnum;
+ 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
+@@ -611,7 +612,6 @@
+ 	      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,"BaselineCalvingCalvingrate")==0) return BaselineCalvingCalvingrateEnum;
+ 	      else if (strcmp(name,"BaseOld")==0) return BaseOldEnum;
+ 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
+ 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
+@@ -626,13 +626,12 @@
+ 	      else if (strcmp(name,"BottomPressure")==0) return BottomPressureEnum;
+ 	      else if (strcmp(name,"BottomPressureOld")==0) return BottomPressureOldEnum;
+ 	      else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
+-	      else if (strcmp(name,"CalvingCalvingrateNoise")==0) return CalvingCalvingrateNoiseEnum;
+ 	      else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum;
++	      else if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
+-	      else if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;
++	      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,"CalvingratexAverage")==0) return CalvingratexAverageEnum;
+@@ -751,11 +750,11 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
+-	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
++	      if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+ 	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
+ 	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
+ 	      else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
+@@ -874,11 +873,11 @@
+ 	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
+ 	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+ 	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
++	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+-	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
++	      if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+ 	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+ 	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+ 	      else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
+@@ -918,7 +917,6 @@
+ 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
+ 	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
+ 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
+-	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"SmbBasinsId")==0) return SmbBasinsIdEnum;
+ 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+ 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+@@ -997,12 +995,12 @@
+ 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+ 	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
+ 	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
++	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
++	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
+-	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
+-	      else if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
++	      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;
+@@ -1024,7 +1022,6 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
+-	      else if (strcmp(name,"StochasticForcingDefaultId")==0) return StochasticForcingDefaultIdEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+@@ -1060,7 +1057,6 @@
+ 	      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,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"ThermalforcingValuesAutoregression")==0) return ThermalforcingValuesAutoregressionEnum;
+ 	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
+ 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+@@ -1120,14 +1116,14 @@
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
++	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
++	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
++	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
++	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+          else stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+-	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+-	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+-	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+-	      else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
++	      if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
+ 	      else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum;
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+@@ -1243,14 +1239,14 @@
+ 	      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,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
++	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
+-	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
+-	      else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
+-	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+-	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
++	      if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
+ 	      else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum;
+ 	      else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum;
+ 	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+@@ -1366,14 +1362,14 @@
+ 	      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,"Inputs")==0) return InputsEnum;
++	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"Inputs")==0) return InputsEnum;
+-	      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;
++	      if (strcmp(name,"J")==0) return JEnum;
+ 	      else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
+ 	      else if (strcmp(name,"MLHOApproximation")==0) return MLHOApproximationEnum;
+ 	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
+@@ -1489,14 +1485,14 @@
+ 	      else if (strcmp(name,"SMBautoregression")==0) return SMBautoregressionEnum;
+ 	      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 stage=13;
+    }
+    if(stage==13){
+-	      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;
++	      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;
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26607)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26608)
+@@ -7,8 +7,7 @@
+ 	properties (SetAccess=public) 
+ 		isstochasticforcing  = 0;
+ 		fields               = NaN;
+-		defaultdimension     = 0;
+-      default_id           = NaN;
++		dimensions           = NaN;
+ 		covariance           = NaN;
+ 		randomflag           = 1;
+ 	end
+@@ -34,68 +33,33 @@
+ 			if ~self.isstochasticforcing, return; end
+ 
+ 			num_fields = numel(self.fields);
+-			
+-			%Check that covariance matrix is positive definite
+-			try
+-				chol(self.covariance);
+-			catch
+-				error('md.stochasticforcing.covariance is not positive definite');
+-			end
++			size_tot   = sum(self.dimensions);
+ 
+-			%Check that all fields agree with the corresponding md class and if any field needs the default params   
+-         checkdefaults = false; %need to check defaults only if one of the field does not have its own dimensionality
+-			for field=self.fields
+-            %Checking agreement of classes
+-            if(contains(field,'SMB'))
+-               if~(isequal(class(md.smb),char(field)))
+-                  error('md.smb does not agree with stochasticforcing field %s', char(field));
+-               end
+-            end
+-            if(contains(field,'frontalforcings'))
+-               if~(isequal(class(md.frontalforcings),char(field)))
+-                  error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
+-               end
+-            end
+-            %Checking for specific dimensions
+-            if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
+-               checkdefaults = true; %field with non-specific dimensionality
+-            end
+-         end
+-
+-			%Retrieve sum of all the field dimensionalities
+-			size_tot   = self.defaultdimension*num_fields;
+-			indSMBar = -1; %about to check for index of SMBautoregression
+-			indTFar  = -1; %about to check for index of FrontalForcingsRignotAutoregression
+-			if any(contains(self.fields,'SMBautoregression'))
+-            size_tot = size_tot-self.defaultdimension+md.smb.num_basins;
+-				indSMBar = find(contains(self.fields,'SMBautoregression')); %index of SMBar, now check for consistency with TFar timestep (08Nov2021)
+-         end
+-         if any(contains(self.fields,'FrontalForcingsRignotAutoregression'))
+-            size_tot = size_tot-self.defaultdimension+md.frontalforcings.num_basins;
+-				indTFar  = find(contains(self.fields,'FrontalForcingsRignotAutoregression')); %index of TFar, now check for consistency with SMBar timestep (08Nov2021)
+-         end
+-
+-			if(indSMBar~=-1 && indTFar~=-1) %both autoregressive models are used: check autoregressive time step consistency
+-				if((md.smb.ar_timestep~=md.frontalforcings.ar_timestep) && any(self.covariance(1+sum(self.dimensions(1:indSMBar-1)):sum(self.dimensions(1:indSMBar)),1+sum(self.dimensions(1:indTFar-1)):sum(self.dimensions(1:indTFar)))))
+-					error('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance');
+-				end
+-			end
+-
+ 			md = checkfield(md,'fieldname','stochasticforcing.isstochasticforcing','values',[0 1]);
+ 			md = checkfield(md,'fieldname','stochasticforcing.fields','numel',num_fields,'cell',1,'values',supportedstochforcings()); %VV check here 'cell' (19Oct2021)
++			md = checkfield(md,'fieldname','stochasticforcing.dimensions','NaN',1,'Inf',1,'>',0,'size',[1,num_fields]); %specific dimension for each field
+ 			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot]); %global covariance matrix
+ 			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
+-			if(checkdefaults) %need to check the defaults
+-            md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
+-            md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
+-         end
++
++			%Check that all fields agree with the corresponding md class
++			for field=self.fields
++				if(contains(field,'SMB'))
++					if~(isequal(class(md.smb),char(field)))
++						error('md.smb does not agree with stochasticforcing field %s', char(field));
++					end
++				end
++				if(contains(field,'frontalforcings'))
++					if~(isequal(class(md.frontalforcings),char(field)))
++						error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
++					end
++				end
++			end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   stochasticforcing parameters:'));
+ 			fielddisplay(self,'isstochasticforcing','is stochasticity activated?');
+ 			fielddisplay(self,'fields','fields with stochasticity applied, ex: {''SMBautoregression''}, or {''FrontalForcingsRignotAutoregression''}');
+-			fielddisplay(self,'defaultdimension','dimensionality of the noise terms (does not apply to fields with their specific dimension)');
+-         fielddisplay(self,'default_id','id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)');
++			fielddisplay(self,'dimensions','dimensionality of each field');
+ 			fielddisplay(self,'covariance','covariance matrix for within- and between-fields covariance (units must be squared field units)');
+ 			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 			disp('Available fields:');
+@@ -112,27 +76,12 @@
+ 			if ~self.isstochasticforcing 
+ 				return
+ 			else
+-
+-				%Retrieve dimensionality of each field
+-				dimensions = self.defaultdimension*ones(1,num_fields);
+-				ind = 1;
+-				for field=self.fields
+-					%Checking for specific dimensions
+-					if(strcmp(field,'SMBautoregression'))
+-						dimensions(ind) = md.smb.num_basins;
+-					end
+-					if(strcmp(field,'FrontalForcingsRignotAutoregression'))
+-						dimensions(ind) = md.frontalforcings.num_basins;
+-					end
+-					ind = ind+1;
+-				end
+-
+ 				%Scaling covariance matrix (scale column-by-column and row-by-row)
+-				scaledfields = {'DefaultCalving','SMBautoregression'}; %list of fields that need scaling *1/yts
++				scaledfields = {'SMBautoregression'}; %list of fields that need scaling *1/yts
+ 				tempcovariance = self.covariance; %copy of covariance to avoid writing back in member variable
+ 				for i=1:num_fields
+ 					if any(strcmp(scaledfields,self.fields(i)))
+-						inds = [1+sum(dimensions(1:i-1)):1:sum(dimensions(1:i))];
++						inds = [1+sum(self.dimensions(1:i-1)):1:sum(self.dimensions(1:i))];
+ 						for row=inds %scale rows corresponding to scaled field
+ 							tempcovariance(row,:) = 1./yts*tempcovariance(row,:);
+ 						end
+@@ -143,9 +92,7 @@
+ 				end
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+-				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
+-            WriteData(fid,prefix,'object',self,'fieldname','default_id','data',self.default_id-1,'format','IntMat','mattype',2); %0-indexed
+-				WriteData(fid,prefix,'object',self,'fieldname','defaultdimension','format','Integer');
++				WriteData(fid,prefix,'object',self,'fieldname','dimensions','format','IntMat');
+ 				WriteData(fid,prefix,'data',tempcovariance,'name','md.stochasticforcing.covariance','format','DoubleMat');
+ 				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
+ 			end
+@@ -157,8 +104,7 @@
+    % by the class md.stochasticforcing
+ 
+    list = {...
+-      'DefaultCalving',...
+-		'FrontalForcingsRignotAutoregression',...
+-      'SMBautoregression'
++      'SMBautoregression',...
++      'FrontalForcingsRignotAutoregression'
+       };
+ end % }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26608-26609.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26608-26609.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26608-26609.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(revision 26608)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26609)
+@@ -48,6 +48,7 @@
+ %Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1;
+ md.stochasticforcing.fields              = [{'SMBautoregression'}];
++md.stochasticforcing.dimensions          = [md.smb.num_basins]; %dimension of each field
+ md.stochasticforcing.covariance          = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]]; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %fixed random seeds
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26609-26610.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26609-26610.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26609-26610.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(revision 26609)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26610)
+@@ -38,6 +38,7 @@
+ %Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1;
+ md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'}];
++md.stochasticforcing.dimensions          = [md.frontalforcings.num_basins]; %dimension of each field
+ md.stochasticforcing.covariance          = 1e-4*[[1.5,0.5];[0.5,0.4]]; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %determines true/false randomness
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26610-26611.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26610-26611.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26610-26611.diff	(revision 26740)
@@ -0,0 +1,1539 @@
+Index: ../trunk-jpl/src/c/shared/Enum/Enumjl.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(nonexistent)
++++ ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(revision 26611)
+@@ -0,0 +1,1534 @@
++""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++" ISSM specific julia syntax highlighting
++"
++"   WARNING: DO NOT MODIFY THIS FILE
++"            this file has been automatically generated by Synchronize.sh
++"            Please read README for more information
++""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
++
++"ISSM Enums
++syn keyword juliaConstC ParametersSTARTEnum
++syn keyword juliaConstC AdolcParamEnum
++syn keyword juliaConstC AmrDeviatoricErrorGroupThresholdEnum
++syn keyword juliaConstC AmrDeviatoricErrorMaximumEnum
++syn keyword juliaConstC AmrDeviatoricErrorResolutionEnum
++syn keyword juliaConstC AmrDeviatoricErrorThresholdEnum
++syn keyword juliaConstC AmrErrEnum
++syn keyword juliaConstC AmrFieldEnum
++syn keyword juliaConstC AmrGradationEnum
++syn keyword juliaConstC AmrGroundingLineDistanceEnum
++syn keyword juliaConstC AmrGroundingLineResolutionEnum
++syn keyword juliaConstC AmrHmaxEnum
++syn keyword juliaConstC AmrHminEnum
++syn keyword juliaConstC AmrIceFrontDistanceEnum
++syn keyword juliaConstC AmrIceFrontResolutionEnum
++syn keyword juliaConstC AmrKeepMetricEnum
++syn keyword juliaConstC AmrLagEnum
++syn keyword juliaConstC AmrLevelMaxEnum
++syn keyword juliaConstC AmrRestartEnum
++syn keyword juliaConstC AmrThicknessErrorGroupThresholdEnum
++syn keyword juliaConstC AmrThicknessErrorMaximumEnum
++syn keyword juliaConstC AmrThicknessErrorResolutionEnum
++syn keyword juliaConstC AmrThicknessErrorThresholdEnum
++syn keyword juliaConstC AmrTypeEnum
++syn keyword juliaConstC AnalysisCounterEnum
++syn keyword juliaConstC AnalysisTypeEnum
++syn keyword juliaConstC AugmentedLagrangianREnum
++syn keyword juliaConstC AugmentedLagrangianRholambdaEnum
++syn keyword juliaConstC AugmentedLagrangianRhopEnum
++syn keyword juliaConstC AugmentedLagrangianRlambdaEnum
++syn keyword juliaConstC AugmentedLagrangianThetaEnum
++syn keyword juliaConstC AutodiffCbufsizeEnum
++syn keyword juliaConstC AutodiffDependentObjectsEnum
++syn keyword juliaConstC AutodiffDriverEnum
++syn keyword juliaConstC AutodiffFosForwardIndexEnum
++syn keyword juliaConstC AutodiffFosReverseIndexEnum
++syn keyword juliaConstC AutodiffFovForwardIndicesEnum
++syn keyword juliaConstC AutodiffGcTriggerMaxSizeEnum
++syn keyword juliaConstC AutodiffGcTriggerRatioEnum
++syn keyword juliaConstC AutodiffIsautodiffEnum
++syn keyword juliaConstC AutodiffLbufsizeEnum
++syn keyword juliaConstC AutodiffNumDependentsEnum
++syn keyword juliaConstC AutodiffNumIndependentsEnum
++syn keyword juliaConstC AutodiffObufsizeEnum
++syn keyword juliaConstC AutodiffTapeAllocEnum
++syn keyword juliaConstC AutodiffTbufsizeEnum
++syn keyword juliaConstC AutodiffXpEnum
++syn keyword juliaConstC BalancethicknessStabilizationEnum
++syn keyword juliaConstC BarystaticContributionsEnum
++syn keyword juliaConstC BasalforcingsBottomplumedepthEnum
++syn keyword juliaConstC BasalforcingsCrustthicknessEnum
++syn keyword juliaConstC BasalforcingsDeepwaterElevationEnum
++syn keyword juliaConstC BasalforcingsDeepwaterMeltingRateEnum
++syn keyword juliaConstC BasalforcingsDtbgEnum
++syn keyword juliaConstC BasalforcingsEnum
++syn keyword juliaConstC BasalforcingsIsmip6AverageTfEnum
++syn keyword juliaConstC BasalforcingsIsmip6BasinAreaEnum
++syn keyword juliaConstC BasalforcingsIsmip6DeltaTEnum
++syn keyword juliaConstC BasalforcingsIsmip6Gamma0Enum
++syn keyword juliaConstC BasalforcingsIsmip6IsLocalEnum
++syn keyword juliaConstC BasalforcingsIsmip6NumBasinsEnum
++syn keyword juliaConstC BasalforcingsIsmip6TfDepthsEnum
++syn keyword juliaConstC BasalforcingsLowercrustheatEnum
++syn keyword juliaConstC BasalforcingsMantleconductivityEnum
++syn keyword juliaConstC BasalforcingsNusseltEnum
++syn keyword juliaConstC BasalforcingsPicoAverageOverturningEnum
++syn keyword juliaConstC BasalforcingsPicoAverageSalinityEnum
++syn keyword juliaConstC BasalforcingsPicoAverageTemperatureEnum
++syn keyword juliaConstC BasalforcingsPicoBoxAreaEnum
++syn keyword juliaConstC BasalforcingsPicoFarOceansalinityEnum
++syn keyword juliaConstC BasalforcingsPicoFarOceantemperatureEnum
++syn keyword juliaConstC BasalforcingsPicoGammaTEnum
++syn keyword juliaConstC BasalforcingsPicoIsplumeEnum
++syn keyword juliaConstC BasalforcingsPicoMaxboxcountEnum
++syn keyword juliaConstC BasalforcingsPicoNumBasinsEnum
++syn keyword juliaConstC BasalforcingsPlumeradiusEnum
++syn keyword juliaConstC BasalforcingsPlumexEnum
++syn keyword juliaConstC BasalforcingsPlumeyEnum
++syn keyword juliaConstC BasalforcingsThresholdThicknessEnum
++syn keyword juliaConstC BasalforcingsTopplumedepthEnum
++syn keyword juliaConstC BasalforcingsUppercrustheatEnum
++syn keyword juliaConstC BasalforcingsUppercrustthicknessEnum
++syn keyword juliaConstC BasalforcingsUpperdepthMeltEnum
++syn keyword juliaConstC BasalforcingsUpperwaterElevationEnum
++syn keyword juliaConstC BasalforcingsUpperwaterMeltingRateEnum
++syn keyword juliaConstC CalvingCrevasseDepthEnum
++syn keyword juliaConstC CalvingCrevasseThresholdEnum
++syn keyword juliaConstC CalvingHeightAboveFloatationEnum
++syn keyword juliaConstC CalvingLawEnum
++syn keyword juliaConstC CalvingMinthicknessEnum
++syn keyword juliaConstC ConfigurationTypeEnum
++syn keyword juliaConstC ConstantsGEnum
++syn keyword juliaConstC ConstantsNewtonGravityEnum
++syn keyword juliaConstC ConstantsReferencetemperatureEnum
++syn keyword juliaConstC ConstantsYtsEnum
++syn keyword juliaConstC ControlInputSizeMEnum
++syn keyword juliaConstC ControlInputSizeNEnum
++syn keyword juliaConstC ControlInputInterpolationEnum
++syn keyword juliaConstC CumBslcEnum
++syn keyword juliaConstC CumBslcIceEnum
++syn keyword juliaConstC CumBslcHydroEnum
++syn keyword juliaConstC CumBslcOceanEnum
++syn keyword juliaConstC CumBslcIcePartitionEnum
++syn keyword juliaConstC CumBslcHydroPartitionEnum
++syn keyword juliaConstC CumBslcOceanPartitionEnum
++syn keyword juliaConstC CumGmtslcEnum
++syn keyword juliaConstC CumGmslcEnum
++syn keyword juliaConstC DamageC1Enum
++syn keyword juliaConstC DamageC2Enum
++syn keyword juliaConstC DamageC3Enum
++syn keyword juliaConstC DamageC4Enum
++syn keyword juliaConstC DamageEnum
++syn keyword juliaConstC DamageEquivStressEnum
++syn keyword juliaConstC DamageEvolutionNumRequestedOutputsEnum
++syn keyword juliaConstC DamageEvolutionRequestedOutputsEnum
++syn keyword juliaConstC DamageHealingEnum
++syn keyword juliaConstC DamageKappaEnum
++syn keyword juliaConstC DamageLawEnum
++syn keyword juliaConstC DamageMaxDamageEnum
++syn keyword juliaConstC DamageStabilizationEnum
++syn keyword juliaConstC DamageStressThresholdEnum
++syn keyword juliaConstC DamageStressUBoundEnum
++syn keyword juliaConstC DebugProfilingEnum
++syn keyword juliaConstC DomainDimensionEnum
++syn keyword juliaConstC DomainTypeEnum
++syn keyword juliaConstC DslModelEnum
++syn keyword juliaConstC DslModelidEnum
++syn keyword juliaConstC DslNummodelsEnum
++syn keyword juliaConstC SolidearthIsExternalEnum
++syn keyword juliaConstC SolidearthExternalNatureEnum
++syn keyword juliaConstC SolidearthExternalModelidEnum
++syn keyword juliaConstC SolidearthExternalNummodelsEnum
++syn keyword juliaConstC SolidearthSettingsComputeBpGrdEnum
++syn keyword juliaConstC EarthIdEnum
++syn keyword juliaConstC ElasticEnum
++syn keyword juliaConstC EplZigZagCounterEnum
++syn keyword juliaConstC EsaHElasticEnum
++syn keyword juliaConstC EsaHemisphereEnum
++syn keyword juliaConstC EsaRequestedOutputsEnum
++syn keyword juliaConstC EsaUElasticEnum
++syn keyword juliaConstC ExtrapolationVariableEnum
++syn keyword juliaConstC FemModelCommEnum
++syn keyword juliaConstC FieldsEnum
++syn keyword juliaConstC FlowequationFeFSEnum
++syn keyword juliaConstC FlowequationIsFSEnum
++syn keyword juliaConstC FlowequationIsHOEnum
++syn keyword juliaConstC FlowequationIsL1L2Enum
++syn keyword juliaConstC FlowequationIsMLHOEnum
++syn keyword juliaConstC FlowequationIsSIAEnum
++syn keyword juliaConstC FlowequationIsSSAEnum
++syn keyword juliaConstC FlowequationIsNitscheEnum
++syn keyword juliaConstC FeFSNitscheGammaEnum
++syn keyword juliaConstC FrictionCouplingEnum
++syn keyword juliaConstC FrictionDeltaEnum
++syn keyword juliaConstC FrictionEffectivePressureLimitEnum
++syn keyword juliaConstC FrictionFEnum
++syn keyword juliaConstC FrictionGammaEnum
++syn keyword juliaConstC FrictionLawEnum
++syn keyword juliaConstC FrictionPseudoplasticityExponentEnum
++syn keyword juliaConstC FrictionThresholdSpeedEnum
++syn keyword juliaConstC FrictionVoidRatioEnum
++syn keyword juliaConstC FrontalForcingsBasinIcefrontAreaEnum
++syn keyword juliaConstC FrontalForcingsNumberofBasinsEnum
++syn keyword juliaConstC FrontalForcingsParamEnum
++syn keyword juliaConstC GrdModelEnum
++syn keyword juliaConstC GroundinglineFrictionInterpolationEnum
++syn keyword juliaConstC GroundinglineMeltInterpolationEnum
++syn keyword juliaConstC GroundinglineMigrationEnum
++syn keyword juliaConstC HydrologyAveragingEnum
++syn keyword juliaConstC HydrologyCavitySpacingEnum
++syn keyword juliaConstC HydrologyChannelConductivityEnum
++syn keyword juliaConstC HydrologyChannelSheetWidthEnum
++syn keyword juliaConstC HydrologyEnglacialVoidRatioEnum
++syn keyword juliaConstC HydrologyIschannelsEnum
++syn keyword juliaConstC HydrologyMeltFlagEnum
++syn keyword juliaConstC HydrologyModelEnum
++syn keyword juliaConstC HydrologyNumRequestedOutputsEnum
++syn keyword juliaConstC HydrologyPressureMeltCoefficientEnum
++syn keyword juliaConstC HydrologyRelaxationEnum
++syn keyword juliaConstC HydrologyRequestedOutputsEnum
++syn keyword juliaConstC HydrologySedimentKmaxEnum
++syn keyword juliaConstC HydrologyStepsPerStepEnum
++syn keyword juliaConstC HydrologyStorageEnum
++syn keyword juliaConstC HydrologydcEplColapseThicknessEnum
++syn keyword juliaConstC HydrologydcEplConductivityEnum
++syn keyword juliaConstC HydrologydcEplInitialThicknessEnum
++syn keyword juliaConstC HydrologydcEplLayerCompressibilityEnum
++syn keyword juliaConstC HydrologydcEplMaxThicknessEnum
++syn keyword juliaConstC HydrologydcEplPoreWaterMassEnum
++syn keyword juliaConstC HydrologydcEplThickCompEnum
++syn keyword juliaConstC HydrologydcEplflipLockEnum
++syn keyword juliaConstC HydrologydcIsefficientlayerEnum
++syn keyword juliaConstC HydrologydcLeakageFactorEnum
++syn keyword juliaConstC HydrologydcMaxIterEnum
++syn keyword juliaConstC HydrologydcPenaltyFactorEnum
++syn keyword juliaConstC HydrologydcPenaltyLockEnum
++syn keyword juliaConstC HydrologydcRelTolEnum
++syn keyword juliaConstC HydrologydcSedimentlimitEnum
++syn keyword juliaConstC HydrologydcSedimentlimitFlagEnum
++syn keyword juliaConstC HydrologydcSedimentLayerCompressibilityEnum
++syn keyword juliaConstC HydrologydcSedimentPoreWaterMassEnum
++syn keyword juliaConstC HydrologydcSedimentPorosityEnum
++syn keyword juliaConstC HydrologydcSedimentThicknessEnum
++syn keyword juliaConstC HydrologydcTransferFlagEnum
++syn keyword juliaConstC HydrologydcUnconfinedFlagEnum
++syn keyword juliaConstC HydrologyshreveStabilizationEnum
++syn keyword juliaConstC IcecapToEarthCommEnum
++syn keyword juliaConstC IndexEnum
++syn keyword juliaConstC InputFileNameEnum
++syn keyword juliaConstC DirectoryNameEnum
++syn keyword juliaConstC IndicesEnum
++syn keyword juliaConstC InputToDepthaverageInEnum
++syn keyword juliaConstC InputToDepthaverageOutEnum
++syn keyword juliaConstC InputToExtrudeEnum
++syn keyword juliaConstC InputToL2ProjectEnum
++syn keyword juliaConstC InputToSmoothEnum
++syn keyword juliaConstC InversionAlgorithmEnum
++syn keyword juliaConstC InversionControlParametersEnum
++syn keyword juliaConstC InversionControlScalingFactorsEnum
++syn keyword juliaConstC InversionCostFunctionsEnum
++syn keyword juliaConstC InversionDxminEnum
++syn keyword juliaConstC InversionGatolEnum
++syn keyword juliaConstC InversionGradientScalingEnum
++syn keyword juliaConstC InversionGrtolEnum
++syn keyword juliaConstC InversionGttolEnum
++syn keyword juliaConstC InversionIncompleteAdjointEnum
++syn keyword juliaConstC InversionIscontrolEnum
++syn keyword juliaConstC InversionMaxiterEnum
++syn keyword juliaConstC InversionMaxiterPerStepEnum
++syn keyword juliaConstC InversionMaxstepsEnum
++syn keyword juliaConstC InversionNstepsEnum
++syn keyword juliaConstC InversionNumControlParametersEnum
++syn keyword juliaConstC InversionNumCostFunctionsEnum
++syn keyword juliaConstC InversionStepThresholdEnum
++syn keyword juliaConstC InversionTypeEnum
++syn keyword juliaConstC IvinsEnum
++syn keyword juliaConstC IsSlcCouplingEnum
++syn keyword juliaConstC LevelsetKillIcebergsEnum
++syn keyword juliaConstC LevelsetReinitFrequencyEnum
++syn keyword juliaConstC LevelsetStabilizationEnum
++syn keyword juliaConstC LockFileNameEnum
++syn keyword juliaConstC LoveAllowLayerDeletionEnum
++syn keyword juliaConstC LoveCoreMantleBoundaryEnum
++syn keyword juliaConstC LoveEarthMassEnum
++syn keyword juliaConstC LoveForcingTypeEnum
++syn keyword juliaConstC LoveFrequenciesEnum
++syn keyword juliaConstC LoveIsTemporalEnum
++syn keyword juliaConstC LoveG0Enum
++syn keyword juliaConstC LoveGravitationalConstantEnum
++syn keyword juliaConstC LoveInnerCoreBoundaryEnum
++syn keyword juliaConstC LoveComplexComputationEnum
++syn keyword juliaConstC LoveIntStepsPerLayerEnum
++syn keyword juliaConstC LoveKernelsEnum
++syn keyword juliaConstC LoveMu0Enum
++syn keyword juliaConstC LoveNfreqEnum
++syn keyword juliaConstC LoveNTemporalIterationsEnum
++syn keyword juliaConstC LoveNYiEquationsEnum
++syn keyword juliaConstC LoveR0Enum
++syn keyword juliaConstC LoveShNmaxEnum
++syn keyword juliaConstC LoveShNminEnum
++syn keyword juliaConstC LoveStartingLayerEnum
++syn keyword juliaConstC LoveUnderflowTolEnum
++syn keyword juliaConstC MassFluxSegmentsEnum
++syn keyword juliaConstC MassFluxSegmentsPresentEnum
++syn keyword juliaConstC MasstransportHydrostaticAdjustmentEnum
++syn keyword juliaConstC MasstransportIsfreesurfaceEnum
++syn keyword juliaConstC MasstransportMinThicknessEnum
++syn keyword juliaConstC MasstransportNumRequestedOutputsEnum
++syn keyword juliaConstC MasstransportPenaltyFactorEnum
++syn keyword juliaConstC MasstransportRequestedOutputsEnum
++syn keyword juliaConstC MasstransportStabilizationEnum
++syn keyword juliaConstC MaterialsBetaEnum
++syn keyword juliaConstC MaterialsEarthDensityEnum
++syn keyword juliaConstC MaterialsEffectiveconductivityAveragingEnum
++syn keyword juliaConstC MaterialsHeatcapacityEnum
++syn keyword juliaConstC MaterialsLatentheatEnum
++syn keyword juliaConstC MaterialsMeltingpointEnum
++syn keyword juliaConstC MaterialsMixedLayerCapacityEnum
++syn keyword juliaConstC MaterialsMuWaterEnum
++syn keyword juliaConstC MaterialsRheologyLawEnum
++syn keyword juliaConstC MaterialsRhoFreshwaterEnum
++syn keyword juliaConstC MaterialsRhoIceEnum
++syn keyword juliaConstC MaterialsRhoSeawaterEnum
++syn keyword juliaConstC MaterialsTemperateiceconductivityEnum
++syn keyword juliaConstC MaterialsThermalExchangeVelocityEnum
++syn keyword juliaConstC MaterialsThermalconductivityEnum
++syn keyword juliaConstC MeltingOffsetEnum
++syn keyword juliaConstC MeshAverageVertexConnectivityEnum
++syn keyword juliaConstC MeshElementtypeEnum
++syn keyword juliaConstC MeshNumberoflayersEnum
++syn keyword juliaConstC MeshNumberofverticesEnum
++syn keyword juliaConstC MeshNumberofelementsEnum
++syn keyword juliaConstC MigrationMaxEnum
++syn keyword juliaConstC ModelIdEnum
++syn keyword juliaConstC NbinsEnum
++syn keyword juliaConstC NodesEnum
++syn keyword juliaConstC NumModelsEnum
++syn keyword juliaConstC OceanGridNxEnum
++syn keyword juliaConstC OceanGridNyEnum
++syn keyword juliaConstC OceanGridXEnum
++syn keyword juliaConstC OceanGridYEnum
++syn keyword juliaConstC OutputBufferPointerEnum
++syn keyword juliaConstC OutputBufferSizePointerEnum
++syn keyword juliaConstC OutputFileNameEnum
++syn keyword juliaConstC OutputFilePointerEnum
++syn keyword juliaConstC OutputdefinitionEnum
++syn keyword juliaConstC QmuErrNameEnum
++syn keyword juliaConstC QmuInNameEnum
++syn keyword juliaConstC QmuIsdakotaEnum
++syn keyword juliaConstC QmuOutNameEnum
++syn keyword juliaConstC QmuOutputEnum
++syn keyword juliaConstC QmuCurrEvalIdEnum
++syn keyword juliaConstC QmuNsampleEnum
++syn keyword juliaConstC QmuResponsedescriptorsEnum
++syn keyword juliaConstC QmuVariableDescriptorsEnum
++syn keyword juliaConstC QmuVariablePartitionsEnum
++syn keyword juliaConstC QmuVariablePartitionsNpartEnum
++syn keyword juliaConstC QmuVariablePartitionsNtEnum
++syn keyword juliaConstC QmuResponsePartitionsEnum
++syn keyword juliaConstC QmuResponsePartitionsNpartEnum
++syn keyword juliaConstC QmuStatisticsEnum
++syn keyword juliaConstC QmuNumstatisticsEnum
++syn keyword juliaConstC QmuNdirectoriesEnum
++syn keyword juliaConstC QmuNfilesPerDirectoryEnum
++syn keyword juliaConstC QmuStatisticsMethodEnum
++syn keyword juliaConstC QmuMethodsEnum
++syn keyword juliaConstC RestartFileNameEnum
++syn keyword juliaConstC ResultsEnum
++syn keyword juliaConstC RootPathEnum
++syn keyword juliaConstC ModelnameEnum
++syn keyword juliaConstC SamplingAlphaEnum
++syn keyword juliaConstC SamplingPhiEnum
++syn keyword juliaConstC SamplingNumRequestedOutputsEnum
++syn keyword juliaConstC SamplingRequestedOutputsEnum
++syn keyword juliaConstC SamplingRobinEnum
++syn keyword juliaConstC SamplingSeedEnum
++syn keyword juliaConstC SamplingTauEnum
++syn keyword juliaConstC SaveResultsEnum
++syn keyword juliaConstC SolidearthPartitionIceEnum
++syn keyword juliaConstC SolidearthPartitionHydroEnum
++syn keyword juliaConstC SolidearthPartitionOceanEnum
++syn keyword juliaConstC SolidearthNpartIceEnum
++syn keyword juliaConstC SolidearthNpartOceanEnum
++syn keyword juliaConstC SolidearthNpartHydroEnum
++syn keyword juliaConstC SolidearthPlanetRadiusEnum
++syn keyword juliaConstC SolidearthPlanetAreaEnum
++syn keyword juliaConstC SolidearthSettingsAbstolEnum
++syn keyword juliaConstC SolidearthSettingsCrossSectionShapeEnum
++syn keyword juliaConstC RotationalAngularVelocityEnum
++syn keyword juliaConstC SolidearthSettingsElasticEnum
++syn keyword juliaConstC SolidearthSettingsViscousEnum
++syn keyword juliaConstC SealevelchangeGeometryDoneEnum
++syn keyword juliaConstC SealevelchangeViscousNumStepsEnum
++syn keyword juliaConstC SealevelchangeViscousTimesEnum
++syn keyword juliaConstC SealevelchangeViscousIndexEnum
++syn keyword juliaConstC RotationalEquatorialMoiEnum
++syn keyword juliaConstC TidalLoveHEnum
++syn keyword juliaConstC TidalLoveKEnum
++syn keyword juliaConstC TidalLoveLEnum
++syn keyword juliaConstC TidalLoveK2SecularEnum
++syn keyword juliaConstC LoadLoveHEnum
++syn keyword juliaConstC LoadLoveKEnum
++syn keyword juliaConstC LoadLoveLEnum
++syn keyword juliaConstC LoveTimeFreqEnum
++syn keyword juliaConstC LoveIsTimeEnum
++syn keyword juliaConstC SealevelchangeGSelfAttractionEnum
++syn keyword juliaConstC SealevelchangeGViscoElasticEnum
++syn keyword juliaConstC SolidearthSettingsSealevelLoadingEnum
++syn keyword juliaConstC SolidearthSettingsGRDEnum
++syn keyword juliaConstC SolidearthSettingsRunFrequencyEnum
++syn keyword juliaConstC SolidearthSettingsTimeAccEnum
++syn keyword juliaConstC SealevelchangeHViscoElasticEnum
++syn keyword juliaConstC SolidearthSettingsHorizEnum
++syn keyword juliaConstC SolidearthSettingsMaxiterEnum
++syn keyword juliaConstC SolidearthSettingsGrdOceanEnum
++syn keyword juliaConstC SolidearthSettingsOceanAreaScalingEnum
++syn keyword juliaConstC RotationalPolarMoiEnum
++syn keyword juliaConstC SolidearthSettingsReltolEnum
++syn keyword juliaConstC SealevelchangeRequestedOutputsEnum
++syn keyword juliaConstC SolidearthSettingsSelfAttractionEnum
++syn keyword juliaConstC SolidearthSettingsRotationEnum
++syn keyword juliaConstC SolidearthSettingsMaxSHCoeffEnum
++syn keyword juliaConstC SealevelchangeRunCountEnum
++syn keyword juliaConstC SealevelchangeTransitionsEnum
++syn keyword juliaConstC SealevelchangeUViscoElasticEnum
++syn keyword juliaConstC SettingsIoGatherEnum
++syn keyword juliaConstC SettingsNumResultsOnNodesEnum
++syn keyword juliaConstC SettingsOutputFrequencyEnum
++syn keyword juliaConstC SettingsCheckpointFrequencyEnum
++syn keyword juliaConstC SettingsResultsOnNodesEnum
++syn keyword juliaConstC SettingsSbCouplingFrequencyEnum
++syn keyword juliaConstC SettingsSolverResidueThresholdEnum
++syn keyword juliaConstC SettingsWaitonlockEnum
++syn keyword juliaConstC SmbAIceEnum
++syn keyword juliaConstC SmbAIdxEnum
++syn keyword juliaConstC SmbASnowEnum
++syn keyword juliaConstC SmbAccualtiEnum
++syn keyword juliaConstC SmbAccugradEnum
++syn keyword juliaConstC SmbAccurefEnum
++syn keyword juliaConstC SmbAdThreshEnum
++syn keyword juliaConstC SmbAutoregressionInitialTimeEnum
++syn keyword juliaConstC SmbAutoregressionTimestepEnum
++syn keyword juliaConstC SmbAutoregressiveOrderEnum
++syn keyword juliaConstC SmbAveragingEnum
++syn keyword juliaConstC SmbBeta0Enum
++syn keyword juliaConstC SmbBeta1Enum
++syn keyword juliaConstC SmbCovmatEnum
++syn keyword juliaConstC SmbDesfacEnum
++syn keyword juliaConstC SmbDpermilEnum
++syn keyword juliaConstC SmbDsnowIdxEnum
++syn keyword juliaConstC SmbCldFracEnum
++syn keyword juliaConstC SmbDelta18oEnum
++syn keyword juliaConstC SmbDelta18oSurfaceEnum
++syn keyword juliaConstC SmbDenIdxEnum
++syn keyword juliaConstC SmbDtEnum
++syn keyword juliaConstC SmbEnum
++syn keyword juliaConstC SmbFEnum
++syn keyword juliaConstC SmbInitDensityScalingEnum
++syn keyword juliaConstC SmbIsaccumulationEnum
++syn keyword juliaConstC SmbIsalbedoEnum
++syn keyword juliaConstC SmbIsconstrainsurfaceTEnum
++syn keyword juliaConstC SmbIsd18opdEnum
++syn keyword juliaConstC SmbIsdelta18oEnum
++syn keyword juliaConstC SmbIsdensificationEnum
++syn keyword juliaConstC SmbIsfirnwarmingEnum
++syn keyword juliaConstC SmbIsgraingrowthEnum
++syn keyword juliaConstC SmbIsmeltEnum
++syn keyword juliaConstC SmbIsmungsmEnum
++syn keyword juliaConstC SmbIsprecipscaledEnum
++syn keyword juliaConstC SmbIssetpddfacEnum
++syn keyword juliaConstC SmbIsshortwaveEnum
++syn keyword juliaConstC SmbIstemperaturescaledEnum
++syn keyword juliaConstC SmbIsthermalEnum
++syn keyword juliaConstC SmbIsturbulentfluxEnum
++syn keyword juliaConstC SmbKEnum
++syn keyword juliaConstC SmbNumBasinsEnum
++syn keyword juliaConstC SmbNumRequestedOutputsEnum
++syn keyword juliaConstC SmbPfacEnum
++syn keyword juliaConstC SmbPhiEnum
++syn keyword juliaConstC SmbRandomflagEnum
++syn keyword juliaConstC SmbRdlEnum
++syn keyword juliaConstC SmbRequestedOutputsEnum
++syn keyword juliaConstC SmbRlapsEnum
++syn keyword juliaConstC SmbRlapslgmEnum
++syn keyword juliaConstC SmbRunoffaltiEnum
++syn keyword juliaConstC SmbRunoffgradEnum
++syn keyword juliaConstC SmbRunoffrefEnum
++syn keyword juliaConstC SmbSealevEnum
++syn keyword juliaConstC SmbStepsPerStepEnum
++syn keyword juliaConstC SmbSwIdxEnum
++syn keyword juliaConstC SmbT0dryEnum
++syn keyword juliaConstC SmbT0wetEnum
++syn keyword juliaConstC SmbTdiffEnum
++syn keyword juliaConstC SmbThermoDeltaTScalingEnum
++syn keyword juliaConstC SmbTemperaturesReconstructedYearsEnum
++syn keyword juliaConstC SmbPrecipitationsReconstructedYearsEnum
++syn keyword juliaConstC SmoothThicknessMultiplierEnum
++syn keyword juliaConstC SolutionTypeEnum
++syn keyword juliaConstC SteadystateMaxiterEnum
++syn keyword juliaConstC SteadystateNumRequestedOutputsEnum
++syn keyword juliaConstC SteadystateReltolEnum
++syn keyword juliaConstC SteadystateRequestedOutputsEnum
++syn keyword juliaConstC StepEnum
++syn keyword juliaConstC StepsEnum
++syn keyword juliaConstC StressbalanceAbstolEnum
++syn keyword juliaConstC StressbalanceFSreconditioningEnum
++syn keyword juliaConstC StressbalanceIsnewtonEnum
++syn keyword juliaConstC StressbalanceMaxiterEnum
++syn keyword juliaConstC StressbalanceNumRequestedOutputsEnum
++syn keyword juliaConstC StressbalancePenaltyFactorEnum
++syn keyword juliaConstC StressbalanceReltolEnum
++syn keyword juliaConstC StressbalanceRequestedOutputsEnum
++syn keyword juliaConstC StressbalanceRestolEnum
++syn keyword juliaConstC StressbalanceRiftPenaltyThresholdEnum
++syn keyword juliaConstC StressbalanceShelfDampeningEnum
++syn keyword juliaConstC ThermalIsdrainicecolumnEnum
++syn keyword juliaConstC ThermalIsdynamicbasalspcEnum
++syn keyword juliaConstC ThermalIsenthalpyEnum
++syn keyword juliaConstC ThermalMaxiterEnum
++syn keyword juliaConstC ThermalNumRequestedOutputsEnum
++syn keyword juliaConstC ThermalPenaltyFactorEnum
++syn keyword juliaConstC ThermalPenaltyLockEnum
++syn keyword juliaConstC ThermalPenaltyThresholdEnum
++syn keyword juliaConstC ThermalReltolEnum
++syn keyword juliaConstC ThermalRequestedOutputsEnum
++syn keyword juliaConstC ThermalStabilizationEnum
++syn keyword juliaConstC ThermalWatercolumnUpperlimitEnum
++syn keyword juliaConstC TimeEnum
++syn keyword juliaConstC TimesteppingCflCoefficientEnum
++syn keyword juliaConstC TimesteppingCouplingTimeEnum
++syn keyword juliaConstC TimesteppingFinalTimeEnum
++syn keyword juliaConstC TimesteppingInterpForcingEnum
++syn keyword juliaConstC TimesteppingCycleForcingEnum
++syn keyword juliaConstC TimesteppingStartTimeEnum
++syn keyword juliaConstC TimesteppingTimeStepEnum
++syn keyword juliaConstC TimesteppingTimeStepMaxEnum
++syn keyword juliaConstC TimesteppingTimeStepMinEnum
++syn keyword juliaConstC TimesteppingTypeEnum
++syn keyword juliaConstC ToMITgcmCommEnum
++syn keyword juliaConstC ToolkitsFileNameEnum
++syn keyword juliaConstC ToolkitsOptionsAnalysesEnum
++syn keyword juliaConstC ToolkitsOptionsStringsEnum
++syn keyword juliaConstC ToolkitsTypesEnum
++syn keyword juliaConstC TransientAmrFrequencyEnum
++syn keyword juliaConstC TransientIsdamageevolutionEnum
++syn keyword juliaConstC TransientIsesaEnum
++syn keyword juliaConstC TransientIsgiaEnum
++syn keyword juliaConstC TransientIsgroundinglineEnum
++syn keyword juliaConstC TransientIshydrologyEnum
++syn keyword juliaConstC TransientIsmasstransportEnum
++syn keyword juliaConstC TransientIsoceantransportEnum
++syn keyword juliaConstC TransientIsmovingfrontEnum
++syn keyword juliaConstC TransientIsoceancouplingEnum
++syn keyword juliaConstC TransientIssamplingEnum
++syn keyword juliaConstC TransientIsslcEnum
++syn keyword juliaConstC TransientIssmbEnum
++syn keyword juliaConstC TransientIsstressbalanceEnum
++syn keyword juliaConstC TransientIsthermalEnum
++syn keyword juliaConstC TransientNumRequestedOutputsEnum
++syn keyword juliaConstC TransientRequestedOutputsEnum
++syn keyword juliaConstC VelocityEnum
++syn keyword juliaConstC XxeEnum
++syn keyword juliaConstC YyeEnum
++syn keyword juliaConstC ZzeEnum
++syn keyword juliaConstC AreaeEnum
++syn keyword juliaConstC WorldCommEnum
++syn keyword juliaConstC ParametersENDEnum
++syn keyword juliaConstC InputsSTARTEnum
++syn keyword juliaConstC AccumulatedDeltaBottomPressureEnum
++syn keyword juliaConstC AccumulatedDeltaIceThicknessEnum
++syn keyword juliaConstC AccumulatedDeltaTwsEnum
++syn keyword juliaConstC AdjointEnum
++syn keyword juliaConstC AdjointpEnum
++syn keyword juliaConstC AdjointxEnum
++syn keyword juliaConstC AdjointxBaseEnum
++syn keyword juliaConstC AdjointxShearEnum
++syn keyword juliaConstC AdjointyEnum
++syn keyword juliaConstC AdjointyBaseEnum
++syn keyword juliaConstC AdjointyShearEnum
++syn keyword juliaConstC AdjointzEnum
++syn keyword juliaConstC AirEnum
++syn keyword juliaConstC ApproximationEnum
++syn keyword juliaConstC BalancethicknessMisfitEnum
++syn keyword juliaConstC BalancethicknessOmega0Enum
++syn keyword juliaConstC BalancethicknessOmegaEnum
++syn keyword juliaConstC BalancethicknessSpcthicknessEnum
++syn keyword juliaConstC BalancethicknessThickeningRateEnum
++syn keyword juliaConstC BasalCrevasseEnum
++syn keyword juliaConstC BasalforcingsFloatingiceMeltingRateEnum
++syn keyword juliaConstC BasalforcingsGeothermalfluxEnum
++syn keyword juliaConstC BasalforcingsGroundediceMeltingRateEnum
++syn keyword juliaConstC BasalforcingsPerturbationMeltingRateEnum
++syn keyword juliaConstC BasalforcingsIsmip6BasinIdEnum
++syn keyword juliaConstC BasalforcingsIsmip6TfEnum
++syn keyword juliaConstC BasalforcingsIsmip6TfShelfEnum
++syn keyword juliaConstC BasalforcingsIsmip6MeltAnomalyEnum
++syn keyword juliaConstC BasalforcingsMeltrateFactorEnum
++syn keyword juliaConstC BasalforcingsOceanSalinityEnum
++syn keyword juliaConstC BasalforcingsOceanTempEnum
++syn keyword juliaConstC BasalforcingsPicoBasinIdEnum
++syn keyword juliaConstC BasalforcingsPicoBoxIdEnum
++syn keyword juliaConstC BasalforcingsPicoOverturningCoeffEnum
++syn keyword juliaConstC BasalforcingsPicoSubShelfOceanOverturningEnum
++syn keyword juliaConstC BasalforcingsPicoSubShelfOceanSalinityEnum
++syn keyword juliaConstC BasalforcingsPicoSubShelfOceanTempEnum
++syn keyword juliaConstC BasalStressxEnum
++syn keyword juliaConstC BasalStressyEnum
++syn keyword juliaConstC BasalStressEnum
++syn keyword juliaConstC BaseEnum
++syn keyword juliaConstC BaseOldEnum
++syn keyword juliaConstC BaseSlopeXEnum
++syn keyword juliaConstC BaseSlopeYEnum
++syn keyword juliaConstC BedEnum
++syn keyword juliaConstC BedGRDEnum
++syn keyword juliaConstC BedEastEnum
++syn keyword juliaConstC BedEastGRDEnum
++syn keyword juliaConstC BedNorthEnum
++syn keyword juliaConstC BedNorthGRDEnum
++syn keyword juliaConstC BedSlopeXEnum
++syn keyword juliaConstC BedSlopeYEnum
++syn keyword juliaConstC BottomPressureEnum
++syn keyword juliaConstC BottomPressureOldEnum
++syn keyword juliaConstC CalvingCalvingrateEnum
++syn keyword juliaConstC CalvingHabFractionEnum
++syn keyword juliaConstC CalvingMeltingrateEnum
++syn keyword juliaConstC CalvingStressThresholdFloatingiceEnum
++syn keyword juliaConstC CalvingStressThresholdGroundediceEnum
++syn keyword juliaConstC CalvinglevermannCoeffEnum
++syn keyword juliaConstC CalvingratexAverageEnum
++syn keyword juliaConstC CalvingratexEnum
++syn keyword juliaConstC CalvingrateyAverageEnum
++syn keyword juliaConstC CalvingrateyEnum
++syn keyword juliaConstC CalvingFluxLevelsetEnum
++syn keyword juliaConstC CalvingMeltingFluxLevelsetEnum
++syn keyword juliaConstC ConvergedEnum
++syn keyword juliaConstC CrevasseDepthEnum
++syn keyword juliaConstC DamageDEnum
++syn keyword juliaConstC DamageDOldEnum
++syn keyword juliaConstC DamageDbarEnum
++syn keyword juliaConstC DamageDbarOldEnum
++syn keyword juliaConstC DamageFEnum
++syn keyword juliaConstC DegreeOfChannelizationEnum
++syn keyword juliaConstC DepthBelowSurfaceEnum
++syn keyword juliaConstC DeltaIceThicknessEnum
++syn keyword juliaConstC DeltaTwsEnum
++syn keyword juliaConstC DeltaBottomPressureEnum
++syn keyword juliaConstC DeltaDslEnum
++syn keyword juliaConstC DslOldEnum
++syn keyword juliaConstC DslEnum
++syn keyword juliaConstC DeltaStrEnum
++syn keyword juliaConstC StrOldEnum
++syn keyword juliaConstC StrEnum
++syn keyword juliaConstC DeviatoricStresseffectiveEnum
++syn keyword juliaConstC DeviatoricStressxxEnum
++syn keyword juliaConstC DeviatoricStressxyEnum
++syn keyword juliaConstC DeviatoricStressxzEnum
++syn keyword juliaConstC DeviatoricStressyyEnum
++syn keyword juliaConstC DeviatoricStressyzEnum
++syn keyword juliaConstC DeviatoricStresszzEnum
++syn keyword juliaConstC DeviatoricStress1Enum
++syn keyword juliaConstC DeviatoricStress2Enum
++syn keyword juliaConstC DistanceToCalvingfrontEnum
++syn keyword juliaConstC DistanceToGroundinglineEnum
++syn keyword juliaConstC Domain2DhorizontalEnum
++syn keyword juliaConstC Domain2DverticalEnum
++syn keyword juliaConstC Domain3DEnum
++syn keyword juliaConstC DragCoefficientAbsGradientEnum
++syn keyword juliaConstC DrivingStressXEnum
++syn keyword juliaConstC DrivingStressYEnum
++syn keyword juliaConstC DummyEnum
++syn keyword juliaConstC EffectivePressureEnum
++syn keyword juliaConstC EffectivePressureSubstepEnum
++syn keyword juliaConstC EffectivePressureTransientEnum
++syn keyword juliaConstC EnthalpyEnum
++syn keyword juliaConstC EnthalpyPicardEnum
++syn keyword juliaConstC EplHeadEnum
++syn keyword juliaConstC EplHeadOldEnum
++syn keyword juliaConstC EplHeadSlopeXEnum
++syn keyword juliaConstC EplHeadSlopeYEnum
++syn keyword juliaConstC EplHeadSubstepEnum
++syn keyword juliaConstC EplHeadTransientEnum
++syn keyword juliaConstC EsaEmotionEnum
++syn keyword juliaConstC EsaNmotionEnum
++syn keyword juliaConstC EsaRotationrateEnum
++syn keyword juliaConstC EsaStrainratexxEnum
++syn keyword juliaConstC EsaStrainratexyEnum
++syn keyword juliaConstC EsaStrainrateyyEnum
++syn keyword juliaConstC EsaUmotionEnum
++syn keyword juliaConstC EsaXmotionEnum
++syn keyword juliaConstC EsaYmotionEnum
++syn keyword juliaConstC EtaDiffEnum
++syn keyword juliaConstC FlowequationBorderFSEnum
++syn keyword juliaConstC FrictionAsEnum
++syn keyword juliaConstC FrictionCEnum
++syn keyword juliaConstC FrictionCmaxEnum
++syn keyword juliaConstC FrictionCoefficientEnum
++syn keyword juliaConstC FrictionCoefficientcoulombEnum
++syn keyword juliaConstC FrictionEffectivePressureEnum
++syn keyword juliaConstC FrictionMEnum
++syn keyword juliaConstC FrictionPEnum
++syn keyword juliaConstC FrictionPressureAdjustedTemperatureEnum
++syn keyword juliaConstC FrictionQEnum
++syn keyword juliaConstC FrictionSedimentCompressibilityCoefficientEnum
++syn keyword juliaConstC FrictionTillFrictionAngleEnum
++syn keyword juliaConstC FrictionWaterLayerEnum
++syn keyword juliaConstC FrictionfEnum
++syn keyword juliaConstC FrontalForcingsBasinIdEnum
++syn keyword juliaConstC FrontalForcingsSubglacialDischargeEnum
++syn keyword juliaConstC FrontalForcingsThermalForcingEnum
++syn keyword juliaConstC GeometryHydrostaticRatioEnum
++syn keyword juliaConstC NGiaEnum
++syn keyword juliaConstC NGiaRateEnum
++syn keyword juliaConstC UGiaEnum
++syn keyword juliaConstC UGiaRateEnum
++syn keyword juliaConstC GradientEnum
++syn keyword juliaConstC GroundinglineHeightEnum
++syn keyword juliaConstC HydraulicPotentialEnum
++syn keyword juliaConstC HydraulicPotentialOldEnum
++syn keyword juliaConstC HydrologyBasalFluxEnum
++syn keyword juliaConstC HydrologyBumpHeightEnum
++syn keyword juliaConstC HydrologyBumpSpacingEnum
++syn keyword juliaConstC HydrologydcBasalMoulinInputEnum
++syn keyword juliaConstC HydrologydcEplThicknessEnum
++syn keyword juliaConstC HydrologydcEplThicknessOldEnum
++syn keyword juliaConstC HydrologydcEplThicknessSubstepEnum
++syn keyword juliaConstC HydrologydcEplThicknessTransientEnum
++syn keyword juliaConstC HydrologydcMaskEplactiveEltEnum
++syn keyword juliaConstC HydrologydcMaskEplactiveNodeEnum
++syn keyword juliaConstC HydrologydcMaskThawedEltEnum
++syn keyword juliaConstC HydrologydcMaskThawedNodeEnum
++syn keyword juliaConstC HydrologydcSedimentTransmitivityEnum
++syn keyword juliaConstC HydrologyDrainageRateEnum
++syn keyword juliaConstC HydrologyEnglacialInputEnum
++syn keyword juliaConstC HydrologyGapHeightEnum
++syn keyword juliaConstC HydrologyGapHeightXEnum
++syn keyword juliaConstC HydrologyGapHeightXXEnum
++syn keyword juliaConstC HydrologyGapHeightYEnum
++syn keyword juliaConstC HydrologyGapHeightYYEnum
++syn keyword juliaConstC HydrologyHeadEnum
++syn keyword juliaConstC HydrologyHeadOldEnum
++syn keyword juliaConstC HydrologyMoulinInputEnum
++syn keyword juliaConstC HydrologyNeumannfluxEnum
++syn keyword juliaConstC HydrologyReynoldsEnum
++syn keyword juliaConstC HydrologySheetConductivityEnum
++syn keyword juliaConstC HydrologySheetThicknessEnum
++syn keyword juliaConstC HydrologySheetThicknessOldEnum
++syn keyword juliaConstC HydrologyTwsEnum
++syn keyword juliaConstC HydrologyTwsSpcEnum
++syn keyword juliaConstC HydrologyTwsAnalysisEnum
++syn keyword juliaConstC HydrologyWatercolumnMaxEnum
++syn keyword juliaConstC HydrologyWaterVxEnum
++syn keyword juliaConstC HydrologyWaterVyEnum
++syn keyword juliaConstC IceEnum
++syn keyword juliaConstC IceMaskNodeActivationEnum
++syn keyword juliaConstC InputEnum
++syn keyword juliaConstC InversionCostFunctionsCoefficientsEnum
++syn keyword juliaConstC InversionSurfaceObsEnum
++syn keyword juliaConstC InversionThicknessObsEnum
++syn keyword juliaConstC InversionVelObsEnum
++syn keyword juliaConstC InversionVxObsEnum
++syn keyword juliaConstC InversionVyObsEnum
++syn keyword juliaConstC LevelsetfunctionSlopeXEnum
++syn keyword juliaConstC LevelsetfunctionSlopeYEnum
++syn keyword juliaConstC LevelsetObservationEnum
++syn keyword juliaConstC LoadingforceXEnum
++syn keyword juliaConstC LoadingforceYEnum
++syn keyword juliaConstC LoadingforceZEnum
++syn keyword juliaConstC MaskOceanLevelsetEnum
++syn keyword juliaConstC MaskIceLevelsetEnum
++syn keyword juliaConstC MaskIceRefLevelsetEnum
++syn keyword juliaConstC MasstransportSpcthicknessEnum
++syn keyword juliaConstC MaterialsRheologyBEnum
++syn keyword juliaConstC MaterialsRheologyBbarEnum
++syn keyword juliaConstC MaterialsRheologyEEnum
++syn keyword juliaConstC MaterialsRheologyEbarEnum
++syn keyword juliaConstC MaterialsRheologyEcEnum
++syn keyword juliaConstC MaterialsRheologyEcbarEnum
++syn keyword juliaConstC MaterialsRheologyEsEnum
++syn keyword juliaConstC MaterialsRheologyEsbarEnum
++syn keyword juliaConstC MaterialsRheologyNEnum
++syn keyword juliaConstC MeshScaleFactorEnum
++syn keyword juliaConstC MeshVertexonbaseEnum
++syn keyword juliaConstC MeshVertexonboundaryEnum
++syn keyword juliaConstC MeshVertexonsurfaceEnum
++syn keyword juliaConstC MisfitEnum
++syn keyword juliaConstC MovingFrontalVxEnum
++syn keyword juliaConstC MovingFrontalVyEnum
++syn keyword juliaConstC NeumannfluxEnum
++syn keyword juliaConstC NewDamageEnum
++syn keyword juliaConstC NodeEnum
++syn keyword juliaConstC OmegaAbsGradientEnum
++syn keyword juliaConstC OceantransportSpcbottompressureEnum
++syn keyword juliaConstC OceantransportSpcstrEnum
++syn keyword juliaConstC OceantransportSpcdslEnum
++syn keyword juliaConstC P0Enum
++syn keyword juliaConstC P1Enum
++syn keyword juliaConstC PartitioningEnum
++syn keyword juliaConstC PressureEnum
++syn keyword juliaConstC RadarEnum
++syn keyword juliaConstC RadarAttenuationMacGregorEnum
++syn keyword juliaConstC RadarAttenuationWolffEnum
++syn keyword juliaConstC RadarIcePeriodEnum
++syn keyword juliaConstC RadarPowerMacGregorEnum
++syn keyword juliaConstC RadarPowerWolffEnum
++syn keyword juliaConstC RheologyBAbsGradientEnum
++syn keyword juliaConstC RheologyBInitialguessEnum
++syn keyword juliaConstC RheologyBInitialguessMisfitEnum
++syn keyword juliaConstC RheologyBbarAbsGradientEnum
++syn keyword juliaConstC SampleEnum
++syn keyword juliaConstC SamplingBetaEnum
++syn keyword juliaConstC SamplingKappaEnum
++syn keyword juliaConstC SealevelEnum
++syn keyword juliaConstC SealevelGRDEnum
++syn keyword juliaConstC SealevelBarystaticMaskEnum
++syn keyword juliaConstC SealevelBarystaticIceMaskEnum
++syn keyword juliaConstC SealevelBarystaticIceWeightsEnum
++syn keyword juliaConstC SealevelBarystaticIceAreaEnum
++syn keyword juliaConstC SealevelBarystaticIceLatbarEnum
++syn keyword juliaConstC SealevelBarystaticIceLongbarEnum
++syn keyword juliaConstC SealevelBarystaticIceLoadEnum
++syn keyword juliaConstC SealevelBarystaticHydroMaskEnum
++syn keyword juliaConstC SealevelBarystaticHydroWeightsEnum
++syn keyword juliaConstC SealevelBarystaticHydroAreaEnum
++syn keyword juliaConstC SealevelBarystaticHydroLatbarEnum
++syn keyword juliaConstC SealevelBarystaticHydroLongbarEnum
++syn keyword juliaConstC SealevelBarystaticHydroLoadEnum
++syn keyword juliaConstC SealevelBarystaticBpMaskEnum
++syn keyword juliaConstC SealevelBarystaticBpWeightsEnum
++syn keyword juliaConstC SealevelBarystaticBpAreaEnum
++syn keyword juliaConstC SealevelBarystaticBpLoadEnum
++syn keyword juliaConstC SealevelBarystaticOceanMaskEnum
++syn keyword juliaConstC SealevelBarystaticOceanWeightsEnum
++syn keyword juliaConstC SealevelBarystaticOceanAreaEnum
++syn keyword juliaConstC SealevelBarystaticOceanLatbarEnum
++syn keyword juliaConstC SealevelBarystaticOceanLongbarEnum
++syn keyword juliaConstC SealevelBarystaticOceanLoadEnum
++syn keyword juliaConstC SealevelNEsaEnum
++syn keyword juliaConstC SealevelNEsaRateEnum
++syn keyword juliaConstC SealevelRSLEnum
++syn keyword juliaConstC BslcEnum
++syn keyword juliaConstC BslcIceEnum
++syn keyword juliaConstC BslcHydroEnum
++syn keyword juliaConstC BslcOceanEnum
++syn keyword juliaConstC BslcRateEnum
++syn keyword juliaConstC GmtslcEnum
++syn keyword juliaConstC SealevelGrotm1Enum
++syn keyword juliaConstC SealevelGrotm2Enum
++syn keyword juliaConstC SealevelGrotm3Enum
++syn keyword juliaConstC SealevelGUrotm1Enum
++syn keyword juliaConstC SealevelGUrotm2Enum
++syn keyword juliaConstC SealevelGUrotm3Enum
++syn keyword juliaConstC SealevelGNrotm1Enum
++syn keyword juliaConstC SealevelGNrotm2Enum
++syn keyword juliaConstC SealevelGNrotm3Enum
++syn keyword juliaConstC SealevelGErotm1Enum
++syn keyword juliaConstC SealevelGErotm2Enum
++syn keyword juliaConstC SealevelGErotm3Enum
++syn keyword juliaConstC SealevelRSLBarystaticEnum
++syn keyword juliaConstC SealevelRSLRateEnum
++syn keyword juliaConstC SealevelUGrdEnum
++syn keyword juliaConstC SealevelNGrdEnum
++syn keyword juliaConstC SealevelUEastEsaEnum
++syn keyword juliaConstC SealevelUNorthEsaEnum
++syn keyword juliaConstC SealevelchangeIndicesEnum
++syn keyword juliaConstC SealevelchangeGEnum
++syn keyword juliaConstC SealevelchangeGUEnum
++syn keyword juliaConstC SealevelchangeGEEnum
++syn keyword juliaConstC SealevelchangeGNEnum
++syn keyword juliaConstC SealevelchangeGsubelOceanEnum
++syn keyword juliaConstC SealevelchangeGUsubelOceanEnum
++syn keyword juliaConstC SealevelchangeGEsubelOceanEnum
++syn keyword juliaConstC SealevelchangeGNsubelOceanEnum
++syn keyword juliaConstC SealevelchangeGsubelIceEnum
++syn keyword juliaConstC SealevelchangeGUsubelIceEnum
++syn keyword juliaConstC SealevelchangeGEsubelIceEnum
++syn keyword juliaConstC SealevelchangeGNsubelIceEnum
++syn keyword juliaConstC SealevelchangeGsubelHydroEnum
++syn keyword juliaConstC SealevelchangeGUsubelHydroEnum
++syn keyword juliaConstC SealevelchangeGEsubelHydroEnum
++syn keyword juliaConstC SealevelchangeGNsubelHydroEnum
++syn keyword juliaConstC SealevelchangeViscousRSLEnum
++syn keyword juliaConstC SealevelchangeViscousUEnum
++syn keyword juliaConstC SealevelchangeViscousNEnum
++syn keyword juliaConstC SealevelchangeViscousEEnum
++syn keyword juliaConstC SedimentHeadEnum
++syn keyword juliaConstC SedimentHeadOldEnum
++syn keyword juliaConstC SedimentHeadSubstepEnum
++syn keyword juliaConstC SedimentHeadTransientEnum
++syn keyword juliaConstC SedimentHeadResidualEnum
++syn keyword juliaConstC SedimentHeadStackedEnum
++syn keyword juliaConstC SigmaNNEnum
++syn keyword juliaConstC SigmaVMEnum
++syn keyword juliaConstC SmbAccumulatedECEnum
++syn keyword juliaConstC SmbAccumulatedMassBalanceEnum
++syn keyword juliaConstC SmbAccumulatedMeltEnum
++syn keyword juliaConstC SmbAccumulatedPrecipitationEnum
++syn keyword juliaConstC SmbAccumulatedRainEnum
++syn keyword juliaConstC SmbAccumulatedRefreezeEnum
++syn keyword juliaConstC SmbAccumulatedRunoffEnum
++syn keyword juliaConstC SmbAEnum
++syn keyword juliaConstC SmbAdiffEnum
++syn keyword juliaConstC SmbAValueEnum
++syn keyword juliaConstC SmbAccumulationEnum
++syn keyword juliaConstC SmbAdiffiniEnum
++syn keyword juliaConstC SmbAiniEnum
++syn keyword juliaConstC SmbBasinsIdEnum
++syn keyword juliaConstC SmbBMaxEnum
++syn keyword juliaConstC SmbBMinEnum
++syn keyword juliaConstC SmbBNegEnum
++syn keyword juliaConstC SmbBPosEnum
++syn keyword juliaConstC SmbCEnum
++syn keyword juliaConstC SmbCcsnowValueEnum
++syn keyword juliaConstC SmbCciceValueEnum
++syn keyword juliaConstC SmbCotValueEnum
++syn keyword juliaConstC SmbDEnum
++syn keyword juliaConstC SmbDailyairdensityEnum
++syn keyword juliaConstC SmbDailyairhumidityEnum
++syn keyword juliaConstC SmbDailydlradiationEnum
++syn keyword juliaConstC SmbDailydsradiationEnum
++syn keyword juliaConstC SmbDailypressureEnum
++syn keyword juliaConstC SmbDailyrainfallEnum
++syn keyword juliaConstC SmbDailysnowfallEnum
++syn keyword juliaConstC SmbDailytemperatureEnum
++syn keyword juliaConstC SmbDailywindspeedEnum
++syn keyword juliaConstC SmbDiniEnum
++syn keyword juliaConstC SmbDlwrfEnum
++syn keyword juliaConstC SmbDswrfEnum
++syn keyword juliaConstC SmbDswdiffrfEnum
++syn keyword juliaConstC SmbDzAddEnum
++syn keyword juliaConstC SmbDzEnum
++syn keyword juliaConstC SmbDzMinEnum
++syn keyword juliaConstC SmbDzTopEnum
++syn keyword juliaConstC SmbDziniEnum
++syn keyword juliaConstC SmbEAirEnum
++syn keyword juliaConstC SmbECEnum
++syn keyword juliaConstC SmbECDtEnum
++syn keyword juliaConstC SmbECiniEnum
++syn keyword juliaConstC SmbElaEnum
++syn keyword juliaConstC SmbEvaporationEnum
++syn keyword juliaConstC SmbFACEnum
++syn keyword juliaConstC SmbGdnEnum
++syn keyword juliaConstC SmbGdniniEnum
++syn keyword juliaConstC SmbGspEnum
++syn keyword juliaConstC SmbGspiniEnum
++syn keyword juliaConstC SmbHrefEnum
++syn keyword juliaConstC SmbIsInitializedEnum
++syn keyword juliaConstC SmbMAddEnum
++syn keyword juliaConstC SmbMassBalanceEnum
++syn keyword juliaConstC SmbMassBalanceSubstepEnum
++syn keyword juliaConstC SmbMassBalanceTransientEnum
++syn keyword juliaConstC SmbMeanLHFEnum
++syn keyword juliaConstC SmbMeanSHFEnum
++syn keyword juliaConstC SmbMeanULWEnum
++syn keyword juliaConstC SmbMeltEnum
++syn keyword juliaConstC SmbMonthlytemperaturesEnum
++syn keyword juliaConstC SmbMSurfEnum
++syn keyword juliaConstC SmbNetLWEnum
++syn keyword juliaConstC SmbNetSWEnum
++syn keyword juliaConstC SmbPAirEnum
++syn keyword juliaConstC SmbPEnum
++syn keyword juliaConstC SmbPddfacIceEnum
++syn keyword juliaConstC SmbPddfacSnowEnum
++syn keyword juliaConstC SmbPrecipitationEnum
++syn keyword juliaConstC SmbPrecipitationsAnomalyEnum
++syn keyword juliaConstC SmbPrecipitationsLgmEnum
++syn keyword juliaConstC SmbPrecipitationsPresentdayEnum
++syn keyword juliaConstC SmbPrecipitationsReconstructedEnum
++syn keyword juliaConstC SmbRainEnum
++syn keyword juliaConstC SmbReEnum
++syn keyword juliaConstC SmbRefreezeEnum
++syn keyword juliaConstC SmbReiniEnum
++syn keyword juliaConstC SmbRunoffEnum
++syn keyword juliaConstC SmbRunoffSubstepEnum
++syn keyword juliaConstC SmbRunoffTransientEnum
++syn keyword juliaConstC SmbS0gcmEnum
++syn keyword juliaConstC SmbS0pEnum
++syn keyword juliaConstC SmbS0tEnum
++syn keyword juliaConstC SmbSizeiniEnum
++syn keyword juliaConstC SmbSmbCorrEnum
++syn keyword juliaConstC SmbSmbrefEnum
++syn keyword juliaConstC SmbSzaValueEnum
++syn keyword juliaConstC SmbTEnum
++syn keyword juliaConstC SmbTaEnum
++syn keyword juliaConstC SmbTeValueEnum
++syn keyword juliaConstC SmbTemperaturesAnomalyEnum
++syn keyword juliaConstC SmbTemperaturesLgmEnum
++syn keyword juliaConstC SmbTemperaturesPresentdayEnum
++syn keyword juliaConstC SmbTemperaturesReconstructedEnum
++syn keyword juliaConstC SmbTiniEnum
++syn keyword juliaConstC SmbTmeanEnum
++syn keyword juliaConstC SmbTzEnum
++syn keyword juliaConstC SmbValuesAutoregressionEnum
++syn keyword juliaConstC SmbVEnum
++syn keyword juliaConstC SmbVmeanEnum
++syn keyword juliaConstC SmbVzEnum
++syn keyword juliaConstC SmbWEnum
++syn keyword juliaConstC SmbWAddEnum
++syn keyword juliaConstC SmbWiniEnum
++syn keyword juliaConstC SmbZMaxEnum
++syn keyword juliaConstC SmbZMinEnum
++syn keyword juliaConstC SmbZTopEnum
++syn keyword juliaConstC SmbZYEnum
++syn keyword juliaConstC SolidearthExternalDisplacementEastRateEnum
++syn keyword juliaConstC SolidearthExternalDisplacementNorthRateEnum
++syn keyword juliaConstC SolidearthExternalDisplacementUpRateEnum
++syn keyword juliaConstC SolidearthExternalGeoidRateEnum
++syn keyword juliaConstC StrainRateeffectiveEnum
++syn keyword juliaConstC StrainRateparallelEnum
++syn keyword juliaConstC StrainRateperpendicularEnum
++syn keyword juliaConstC StrainRatexxEnum
++syn keyword juliaConstC StrainRatexyEnum
++syn keyword juliaConstC StrainRatexzEnum
++syn keyword juliaConstC StrainRateyyEnum
++syn keyword juliaConstC StrainRateyzEnum
++syn keyword juliaConstC StrainRatezzEnum
++syn keyword juliaConstC StressMaxPrincipalEnum
++syn keyword juliaConstC StressTensorxxEnum
++syn keyword juliaConstC StressTensorxyEnum
++syn keyword juliaConstC StressTensorxzEnum
++syn keyword juliaConstC StressTensoryyEnum
++syn keyword juliaConstC StressTensoryzEnum
++syn keyword juliaConstC StressTensorzzEnum
++syn keyword juliaConstC SurfaceAbsMisfitEnum
++syn keyword juliaConstC SurfaceAbsVelMisfitEnum
++syn keyword juliaConstC AreaEnum
++syn keyword juliaConstC SealevelAreaEnum
++syn keyword juliaConstC SurfaceAreaEnum
++syn keyword juliaConstC SurfaceAverageVelMisfitEnum
++syn keyword juliaConstC SurfaceCrevasseEnum
++syn keyword juliaConstC SurfaceEnum
++syn keyword juliaConstC SurfaceOldEnum
++syn keyword juliaConstC SurfaceLogVelMisfitEnum
++syn keyword juliaConstC SurfaceLogVxVyMisfitEnum
++syn keyword juliaConstC SurfaceObservationEnum
++syn keyword juliaConstC SurfaceRelVelMisfitEnum
++syn keyword juliaConstC SurfaceSlopeXEnum
++syn keyword juliaConstC SurfaceSlopeYEnum
++syn keyword juliaConstC TemperatureEnum
++syn keyword juliaConstC TemperaturePDDEnum
++syn keyword juliaConstC TemperaturePicardEnum
++syn keyword juliaConstC TemperatureSEMICEnum
++syn keyword juliaConstC ThermalSpctemperatureEnum
++syn keyword juliaConstC ThicknessAbsGradientEnum
++syn keyword juliaConstC ThicknessAbsMisfitEnum
++syn keyword juliaConstC ThicknessAcrossGradientEnum
++syn keyword juliaConstC ThicknessAlongGradientEnum
++syn keyword juliaConstC ThicknessEnum
++syn keyword juliaConstC ThicknessOldEnum
++syn keyword juliaConstC ThicknessPositiveEnum
++syn keyword juliaConstC ThicknessResidualEnum
++syn keyword juliaConstC TransientAccumulatedDeltaIceThicknessEnum
++syn keyword juliaConstC VelEnum
++syn keyword juliaConstC VxAverageEnum
++syn keyword juliaConstC VxBaseEnum
++syn keyword juliaConstC VxEnum
++syn keyword juliaConstC VxMeshEnum
++syn keyword juliaConstC VxObsEnum
++syn keyword juliaConstC VxShearEnum
++syn keyword juliaConstC VxSurfaceEnum
++syn keyword juliaConstC VyAverageEnum
++syn keyword juliaConstC VyBaseEnum
++syn keyword juliaConstC VyEnum
++syn keyword juliaConstC VyMeshEnum
++syn keyword juliaConstC VyObsEnum
++syn keyword juliaConstC VyShearEnum
++syn keyword juliaConstC VySurfaceEnum
++syn keyword juliaConstC VzEnum
++syn keyword juliaConstC VzFSEnum
++syn keyword juliaConstC VzHOEnum
++syn keyword juliaConstC VzMeshEnum
++syn keyword juliaConstC VzSSAEnum
++syn keyword juliaConstC WaterColumnOldEnum
++syn keyword juliaConstC WatercolumnEnum
++syn keyword juliaConstC WaterfractionDrainageEnum
++syn keyword juliaConstC WaterfractionDrainageIntegratedEnum
++syn keyword juliaConstC WaterfractionEnum
++syn keyword juliaConstC WaterheightEnum
++syn keyword juliaConstC WeightsLevelsetObservationEnum
++syn keyword juliaConstC WeightsSurfaceObservationEnum
++syn keyword juliaConstC OldAccumulatedDeltaBottomPressureEnum
++syn keyword juliaConstC OldAccumulatedDeltaIceThicknessEnum
++syn keyword juliaConstC OldAccumulatedDeltaTwsEnum
++syn keyword juliaConstC Outputdefinition1Enum
++syn keyword juliaConstC Outputdefinition10Enum
++syn keyword juliaConstC Outputdefinition11Enum
++syn keyword juliaConstC Outputdefinition12Enum
++syn keyword juliaConstC Outputdefinition13Enum
++syn keyword juliaConstC Outputdefinition14Enum
++syn keyword juliaConstC Outputdefinition15Enum
++syn keyword juliaConstC Outputdefinition16Enum
++syn keyword juliaConstC Outputdefinition17Enum
++syn keyword juliaConstC Outputdefinition18Enum
++syn keyword juliaConstC Outputdefinition19Enum
++syn keyword juliaConstC Outputdefinition20Enum
++syn keyword juliaConstC Outputdefinition21Enum
++syn keyword juliaConstC Outputdefinition22Enum
++syn keyword juliaConstC Outputdefinition23Enum
++syn keyword juliaConstC Outputdefinition24Enum
++syn keyword juliaConstC Outputdefinition25Enum
++syn keyword juliaConstC Outputdefinition26Enum
++syn keyword juliaConstC Outputdefinition27Enum
++syn keyword juliaConstC Outputdefinition28Enum
++syn keyword juliaConstC Outputdefinition29Enum
++syn keyword juliaConstC Outputdefinition2Enum
++syn keyword juliaConstC Outputdefinition30Enum
++syn keyword juliaConstC Outputdefinition31Enum
++syn keyword juliaConstC Outputdefinition32Enum
++syn keyword juliaConstC Outputdefinition33Enum
++syn keyword juliaConstC Outputdefinition34Enum
++syn keyword juliaConstC Outputdefinition35Enum
++syn keyword juliaConstC Outputdefinition36Enum
++syn keyword juliaConstC Outputdefinition37Enum
++syn keyword juliaConstC Outputdefinition38Enum
++syn keyword juliaConstC Outputdefinition39Enum
++syn keyword juliaConstC Outputdefinition3Enum
++syn keyword juliaConstC Outputdefinition40Enum
++syn keyword juliaConstC Outputdefinition41Enum
++syn keyword juliaConstC Outputdefinition42Enum
++syn keyword juliaConstC Outputdefinition43Enum
++syn keyword juliaConstC Outputdefinition44Enum
++syn keyword juliaConstC Outputdefinition45Enum
++syn keyword juliaConstC Outputdefinition46Enum
++syn keyword juliaConstC Outputdefinition47Enum
++syn keyword juliaConstC Outputdefinition48Enum
++syn keyword juliaConstC Outputdefinition49Enum
++syn keyword juliaConstC Outputdefinition4Enum
++syn keyword juliaConstC Outputdefinition50Enum
++syn keyword juliaConstC Outputdefinition51Enum
++syn keyword juliaConstC Outputdefinition52Enum
++syn keyword juliaConstC Outputdefinition53Enum
++syn keyword juliaConstC Outputdefinition54Enum
++syn keyword juliaConstC Outputdefinition55Enum
++syn keyword juliaConstC Outputdefinition56Enum
++syn keyword juliaConstC Outputdefinition57Enum
++syn keyword juliaConstC Outputdefinition58Enum
++syn keyword juliaConstC Outputdefinition59Enum
++syn keyword juliaConstC Outputdefinition5Enum
++syn keyword juliaConstC Outputdefinition60Enum
++syn keyword juliaConstC Outputdefinition61Enum
++syn keyword juliaConstC Outputdefinition62Enum
++syn keyword juliaConstC Outputdefinition63Enum
++syn keyword juliaConstC Outputdefinition64Enum
++syn keyword juliaConstC Outputdefinition65Enum
++syn keyword juliaConstC Outputdefinition66Enum
++syn keyword juliaConstC Outputdefinition67Enum
++syn keyword juliaConstC Outputdefinition68Enum
++syn keyword juliaConstC Outputdefinition69Enum
++syn keyword juliaConstC Outputdefinition6Enum
++syn keyword juliaConstC Outputdefinition70Enum
++syn keyword juliaConstC Outputdefinition71Enum
++syn keyword juliaConstC Outputdefinition72Enum
++syn keyword juliaConstC Outputdefinition73Enum
++syn keyword juliaConstC Outputdefinition74Enum
++syn keyword juliaConstC Outputdefinition75Enum
++syn keyword juliaConstC Outputdefinition76Enum
++syn keyword juliaConstC Outputdefinition77Enum
++syn keyword juliaConstC Outputdefinition78Enum
++syn keyword juliaConstC Outputdefinition79Enum
++syn keyword juliaConstC Outputdefinition7Enum
++syn keyword juliaConstC Outputdefinition80Enum
++syn keyword juliaConstC Outputdefinition81Enum
++syn keyword juliaConstC Outputdefinition82Enum
++syn keyword juliaConstC Outputdefinition83Enum
++syn keyword juliaConstC Outputdefinition84Enum
++syn keyword juliaConstC Outputdefinition85Enum
++syn keyword juliaConstC Outputdefinition86Enum
++syn keyword juliaConstC Outputdefinition87Enum
++syn keyword juliaConstC Outputdefinition88Enum
++syn keyword juliaConstC Outputdefinition89Enum
++syn keyword juliaConstC Outputdefinition8Enum
++syn keyword juliaConstC Outputdefinition90Enum
++syn keyword juliaConstC Outputdefinition91Enum
++syn keyword juliaConstC Outputdefinition92Enum
++syn keyword juliaConstC Outputdefinition93Enum
++syn keyword juliaConstC Outputdefinition94Enum
++syn keyword juliaConstC Outputdefinition95Enum
++syn keyword juliaConstC Outputdefinition96Enum
++syn keyword juliaConstC Outputdefinition97Enum
++syn keyword juliaConstC Outputdefinition98Enum
++syn keyword juliaConstC Outputdefinition99Enum
++syn keyword juliaConstC Outputdefinition9Enum
++syn keyword juliaConstC Outputdefinition100Enum
++syn keyword juliaConstC InputsENDEnum
++syn keyword juliaConstC AbsoluteEnum
++syn keyword juliaConstC AdaptiveTimesteppingEnum
++syn keyword juliaConstC AdjointBalancethickness2AnalysisEnum
++syn keyword juliaConstC AdjointBalancethicknessAnalysisEnum
++syn keyword juliaConstC AdjointHorizAnalysisEnum
++syn keyword juliaConstC AggressiveMigrationEnum
++syn keyword juliaConstC AmrBamgEnum
++syn keyword juliaConstC AmrNeopzEnum
++syn keyword juliaConstC AndroidFrictionCoefficientEnum
++syn keyword juliaConstC ArrheniusEnum
++syn keyword juliaConstC AutodiffJacobianEnum
++syn keyword juliaConstC Balancethickness2AnalysisEnum
++syn keyword juliaConstC Balancethickness2SolutionEnum
++syn keyword juliaConstC BalancethicknessAnalysisEnum
++syn keyword juliaConstC BalancethicknessApparentMassbalanceEnum
++syn keyword juliaConstC BalancethicknessSoftAnalysisEnum
++syn keyword juliaConstC BalancethicknessSoftSolutionEnum
++syn keyword juliaConstC BalancethicknessSolutionEnum
++syn keyword juliaConstC BalancevelocityAnalysisEnum
++syn keyword juliaConstC BalancevelocitySolutionEnum
++syn keyword juliaConstC BasalforcingsIsmip6Enum
++syn keyword juliaConstC BasalforcingsPicoEnum
++syn keyword juliaConstC BeckmannGoosseFloatingMeltRateEnum
++syn keyword juliaConstC BedSlopeSolutionEnum
++syn keyword juliaConstC BoolExternalResultEnum
++syn keyword juliaConstC BoolInputEnum
++syn keyword juliaConstC IntInputEnum
++syn keyword juliaConstC DoubleInputEnum
++syn keyword juliaConstC BoolParamEnum
++syn keyword juliaConstC BoundaryEnum
++syn keyword juliaConstC BuddJackaEnum
++syn keyword juliaConstC CalvingDev2Enum
++syn keyword juliaConstC CalvingHabEnum
++syn keyword juliaConstC CalvingLevermannEnum
++syn keyword juliaConstC CalvingVonmisesEnum
++syn keyword juliaConstC CfdragcoeffabsgradEnum
++syn keyword juliaConstC CfsurfacelogvelEnum
++syn keyword juliaConstC CfsurfacesquareEnum
++syn keyword juliaConstC CflevelsetmisfitEnum
++syn keyword juliaConstC ChannelEnum
++syn keyword juliaConstC ChannelAreaEnum
++syn keyword juliaConstC ChannelAreaOldEnum
++syn keyword juliaConstC ChannelDischargeEnum
++syn keyword juliaConstC ClosedEnum
++syn keyword juliaConstC ColinearEnum
++syn keyword juliaConstC ConstraintsEnum
++syn keyword juliaConstC ContactEnum
++syn keyword juliaConstC ContourEnum
++syn keyword juliaConstC ContoursEnum
++syn keyword juliaConstC ControlInputEnum
++syn keyword juliaConstC ControlInputGradEnum
++syn keyword juliaConstC ControlInputMaxsEnum
++syn keyword juliaConstC ControlInputMinsEnum
++syn keyword juliaConstC ControlInputValuesEnum
++syn keyword juliaConstC CrouzeixRaviartEnum
++syn keyword juliaConstC CuffeyEnum
++syn keyword juliaConstC CuffeyTemperateEnum
++syn keyword juliaConstC DamageEvolutionAnalysisEnum
++syn keyword juliaConstC DamageEvolutionSolutionEnum
++syn keyword juliaConstC DataSetEnum
++syn keyword juliaConstC DataSetParamEnum
++syn keyword juliaConstC DatasetInputEnum
++syn keyword juliaConstC DefaultAnalysisEnum
++syn keyword juliaConstC DefaultCalvingEnum
++syn keyword juliaConstC DenseEnum
++syn keyword juliaConstC DependentObjectEnum
++syn keyword juliaConstC DepthAverageAnalysisEnum
++syn keyword juliaConstC DeviatoricStressErrorEstimatorEnum
++syn keyword juliaConstC DivergenceEnum
++syn keyword juliaConstC Domain3DsurfaceEnum
++syn keyword juliaConstC DoubleArrayInputEnum
++syn keyword juliaConstC ArrayInputEnum
++syn keyword juliaConstC DoubleExternalResultEnum
++syn keyword juliaConstC DoubleMatArrayParamEnum
++syn keyword juliaConstC DoubleMatExternalResultEnum
++syn keyword juliaConstC DoubleMatParamEnum
++syn keyword juliaConstC DoubleParamEnum
++syn keyword juliaConstC DoubleVecParamEnum
++syn keyword juliaConstC ElementEnum
++syn keyword juliaConstC ElementHookEnum
++syn keyword juliaConstC ElementSIdEnum
++syn keyword juliaConstC EnthalpyAnalysisEnum
++syn keyword juliaConstC EsaAnalysisEnum
++syn keyword juliaConstC EsaSolutionEnum
++syn keyword juliaConstC EsaTransitionsEnum
++syn keyword juliaConstC ExternalResultEnum
++syn keyword juliaConstC ExtrapolationAnalysisEnum
++syn keyword juliaConstC ExtrudeFromBaseAnalysisEnum
++syn keyword juliaConstC ExtrudeFromTopAnalysisEnum
++syn keyword juliaConstC FSApproximationEnum
++syn keyword juliaConstC FSSolverEnum
++syn keyword juliaConstC FSpressureEnum
++syn keyword juliaConstC FSvelocityEnum
++syn keyword juliaConstC FemModelEnum
++syn keyword juliaConstC FileParamEnum
++syn keyword juliaConstC FixedTimesteppingEnum
++syn keyword juliaConstC FloatingAreaEnum
++syn keyword juliaConstC FloatingAreaScaledEnum
++syn keyword juliaConstC FloatingMeltRateEnum
++syn keyword juliaConstC FreeEnum
++syn keyword juliaConstC FreeSurfaceBaseAnalysisEnum
++syn keyword juliaConstC FreeSurfaceTopAnalysisEnum
++syn keyword juliaConstC FrontalForcingsDefaultEnum
++syn keyword juliaConstC FrontalForcingsRignotEnum
++syn keyword juliaConstC FsetEnum
++syn keyword juliaConstC FullMeltOnPartiallyFloatingEnum
++syn keyword juliaConstC GLheightadvectionAnalysisEnum
++syn keyword juliaConstC GaussPentaEnum
++syn keyword juliaConstC GaussSegEnum
++syn keyword juliaConstC GaussTetraEnum
++syn keyword juliaConstC GaussTriaEnum
++syn keyword juliaConstC GenericOptionEnum
++syn keyword juliaConstC GenericParamEnum
++syn keyword juliaConstC GenericExternalResultEnum
++syn keyword juliaConstC Gradient1Enum
++syn keyword juliaConstC Gradient2Enum
++syn keyword juliaConstC Gradient3Enum
++syn keyword juliaConstC Gradient4Enum
++syn keyword juliaConstC GroundedAreaEnum
++syn keyword juliaConstC GroundedAreaScaledEnum
++syn keyword juliaConstC GroundingOnlyEnum
++syn keyword juliaConstC GroundinglineMassFluxEnum
++syn keyword juliaConstC GsetEnum
++syn keyword juliaConstC GslEnum
++syn keyword juliaConstC HOApproximationEnum
++syn keyword juliaConstC HOFSApproximationEnum
++syn keyword juliaConstC HookEnum
++syn keyword juliaConstC HydrologyDCEfficientAnalysisEnum
++syn keyword juliaConstC HydrologyDCInefficientAnalysisEnum
++syn keyword juliaConstC HydrologyGlaDSAnalysisEnum
++syn keyword juliaConstC HydrologyGlaDSEnum
++syn keyword juliaConstC HydrologyPismAnalysisEnum
++syn keyword juliaConstC HydrologyShaktiAnalysisEnum
++syn keyword juliaConstC HydrologyShreveAnalysisEnum
++syn keyword juliaConstC HydrologySolutionEnum
++syn keyword juliaConstC HydrologydcEnum
++syn keyword juliaConstC HydrologypismEnum
++syn keyword juliaConstC HydrologyshaktiEnum
++syn keyword juliaConstC HydrologyshreveEnum
++syn keyword juliaConstC IceMassEnum
++syn keyword juliaConstC IceMassScaledEnum
++syn keyword juliaConstC IceVolumeAboveFloatationEnum
++syn keyword juliaConstC IceVolumeAboveFloatationScaledEnum
++syn keyword juliaConstC IceVolumeEnum
++syn keyword juliaConstC IceVolumeScaledEnum
++syn keyword juliaConstC IcefrontMassFluxEnum
++syn keyword juliaConstC IcefrontMassFluxLevelsetEnum
++syn keyword juliaConstC IncrementalEnum
++syn keyword juliaConstC IndexedEnum
++syn keyword juliaConstC IntExternalResultEnum
++syn keyword juliaConstC ElementInputEnum
++syn keyword juliaConstC IntMatExternalResultEnum
++syn keyword juliaConstC IntMatParamEnum
++syn keyword juliaConstC IntParamEnum
++syn keyword juliaConstC IntVecParamEnum
++syn keyword juliaConstC InputsEnum
++syn keyword juliaConstC InternalEnum
++syn keyword juliaConstC IntersectEnum
++syn keyword juliaConstC InversionVzObsEnum
++syn keyword juliaConstC JEnum
++syn keyword juliaConstC L1L2ApproximationEnum
++syn keyword juliaConstC MLHOApproximationEnum
++syn keyword juliaConstC L2ProjectionBaseAnalysisEnum
++syn keyword juliaConstC L2ProjectionEPLAnalysisEnum
++syn keyword juliaConstC LACrouzeixRaviartEnum
++syn keyword juliaConstC LATaylorHoodEnum
++syn keyword juliaConstC LambdaSEnum
++syn keyword juliaConstC LevelsetAnalysisEnum
++syn keyword juliaConstC LevelsetfunctionPicardEnum
++syn keyword juliaConstC LinearFloatingMeltRateEnum
++syn keyword juliaConstC LliboutryDuvalEnum
++syn keyword juliaConstC LoadsEnum
++syn keyword juliaConstC LoveAnalysisEnum
++syn keyword juliaConstC LoveHiEnum
++syn keyword juliaConstC LoveHrEnum
++syn keyword juliaConstC LoveKernelsImagEnum
++syn keyword juliaConstC LoveKernelsRealEnum
++syn keyword juliaConstC LoveKiEnum
++syn keyword juliaConstC LoveKrEnum
++syn keyword juliaConstC LoveLiEnum
++syn keyword juliaConstC LoveLrEnum
++syn keyword juliaConstC LoveSolutionEnum
++syn keyword juliaConstC MINIEnum
++syn keyword juliaConstC MINIcondensedEnum
++syn keyword juliaConstC MantlePlumeGeothermalFluxEnum
++syn keyword juliaConstC MassFluxEnum
++syn keyword juliaConstC MassconEnum
++syn keyword juliaConstC MassconaxpbyEnum
++syn keyword juliaConstC MassfluxatgateEnum
++syn keyword juliaConstC MasstransportAnalysisEnum
++syn keyword juliaConstC MasstransportSolutionEnum
++syn keyword juliaConstC MatdamageiceEnum
++syn keyword juliaConstC MatenhancediceEnum
++syn keyword juliaConstC MaterialsEnum
++syn keyword juliaConstC MatestarEnum
++syn keyword juliaConstC MaticeEnum
++syn keyword juliaConstC MatlithoEnum
++syn keyword juliaConstC MathydroEnum
++syn keyword juliaConstC MatrixParamEnum
++syn keyword juliaConstC MaxAbsVxEnum
++syn keyword juliaConstC MaxAbsVyEnum
++syn keyword juliaConstC MaxAbsVzEnum
++syn keyword juliaConstC MaxDivergenceEnum
++syn keyword juliaConstC MaxVelEnum
++syn keyword juliaConstC MaxVxEnum
++syn keyword juliaConstC MaxVyEnum
++syn keyword juliaConstC MaxVzEnum
++syn keyword juliaConstC MelangeEnum
++syn keyword juliaConstC MeltingAnalysisEnum
++syn keyword juliaConstC MeshElementsEnum
++syn keyword juliaConstC MeshXEnum
++syn keyword juliaConstC MeshYEnum
++syn keyword juliaConstC MinVelEnum
++syn keyword juliaConstC MinVxEnum
++syn keyword juliaConstC MinVyEnum
++syn keyword juliaConstC MinVzEnum
++syn keyword juliaConstC MismipFloatingMeltRateEnum
++syn keyword juliaConstC MoulinEnum
++syn keyword juliaConstC MpiDenseEnum
++syn keyword juliaConstC MpiEnum
++syn keyword juliaConstC MpiSparseEnum
++syn keyword juliaConstC MumpsEnum
++syn keyword juliaConstC NoFrictionOnPartiallyFloatingEnum
++syn keyword juliaConstC NoMeltOnPartiallyFloatingEnum
++syn keyword juliaConstC NodalEnum
++syn keyword juliaConstC NodalvalueEnum
++syn keyword juliaConstC NodeSIdEnum
++syn keyword juliaConstC NoneApproximationEnum
++syn keyword juliaConstC NoneEnum
++syn keyword juliaConstC NumberedcostfunctionEnum
++syn keyword juliaConstC NyeCO2Enum
++syn keyword juliaConstC NyeH2OEnum
++syn keyword juliaConstC NumericalfluxEnum
++syn keyword juliaConstC OceantransportAnalysisEnum
++syn keyword juliaConstC OceantransportSolutionEnum
++syn keyword juliaConstC OldGradientEnum
++syn keyword juliaConstC OneLayerP4zEnum
++syn keyword juliaConstC OpenEnum
++syn keyword juliaConstC OptionEnum
++syn keyword juliaConstC ParamEnum
++syn keyword juliaConstC ParametersEnum
++syn keyword juliaConstC P0ArrayEnum
++syn keyword juliaConstC P0DGEnum
++syn keyword juliaConstC P1DGEnum
++syn keyword juliaConstC P1P1Enum
++syn keyword juliaConstC P1P1GLSEnum
++syn keyword juliaConstC P1bubbleEnum
++syn keyword juliaConstC P1bubblecondensedEnum
++syn keyword juliaConstC P1xP2Enum
++syn keyword juliaConstC P1xP3Enum
++syn keyword juliaConstC P1xP4Enum
++syn keyword juliaConstC P2Enum
++syn keyword juliaConstC P2bubbleEnum
++syn keyword juliaConstC P2bubblecondensedEnum
++syn keyword juliaConstC P2xP1Enum
++syn keyword juliaConstC P2xP4Enum
++syn keyword juliaConstC PatersonEnum
++syn keyword juliaConstC PengridEnum
++syn keyword juliaConstC PenpairEnum
++syn keyword juliaConstC PentaEnum
++syn keyword juliaConstC PentaInputEnum
++syn keyword juliaConstC ProfilerEnum
++syn keyword juliaConstC ProfilingCurrentFlopsEnum
++syn keyword juliaConstC ProfilingCurrentMemEnum
++syn keyword juliaConstC ProfilingSolutionTimeEnum
++syn keyword juliaConstC RegionaloutputEnum
++syn keyword juliaConstC RegularEnum
++syn keyword juliaConstC RecoveryAnalysisEnum
++syn keyword juliaConstC RiftfrontEnum
++syn keyword juliaConstC SamplingAnalysisEnum
++syn keyword juliaConstC SamplingSolutionEnum
++syn keyword juliaConstC SIAApproximationEnum
++syn keyword juliaConstC SMBautoregressionEnum
++syn keyword juliaConstC SMBcomponentsEnum
++syn keyword juliaConstC SMBd18opddEnum
++syn keyword juliaConstC SMBforcingEnum
++syn keyword juliaConstC SMBgcmEnum
++syn keyword juliaConstC SMBgembEnum
++syn keyword juliaConstC SMBgradientsEnum
++syn keyword juliaConstC SMBgradientscomponentsEnum
++syn keyword juliaConstC SMBgradientselaEnum
++syn keyword juliaConstC SMBhenningEnum
++syn keyword juliaConstC SMBmeltcomponentsEnum
++syn keyword juliaConstC SMBpddEnum
++syn keyword juliaConstC SMBpddSicopolisEnum
++syn keyword juliaConstC SMBsemicEnum
++syn keyword juliaConstC SSAApproximationEnum
++syn keyword juliaConstC SSAFSApproximationEnum
++syn keyword juliaConstC SSAHOApproximationEnum
++syn keyword juliaConstC ScaledEnum
++syn keyword juliaConstC SealevelAbsoluteEnum
++syn keyword juliaConstC SealevelEmotionEnum
++syn keyword juliaConstC SealevelInertiaTensorXZEnum
++syn keyword juliaConstC SealevelInertiaTensorYZEnum
++syn keyword juliaConstC SealevelInertiaTensorZZEnum
++syn keyword juliaConstC SealevelchangePolarMotionEnum
++syn keyword juliaConstC SealevelNmotionEnum
++syn keyword juliaConstC SealevelUmotionEnum
++syn keyword juliaConstC SealevelchangeAnalysisEnum
++syn keyword juliaConstC SegEnum
++syn keyword juliaConstC SegInputEnum
++syn keyword juliaConstC SegmentEnum
++syn keyword juliaConstC SegmentRiftfrontEnum
++syn keyword juliaConstC SeparateEnum
++syn keyword juliaConstC SeqEnum
++syn keyword juliaConstC SmbAnalysisEnum
++syn keyword juliaConstC SmbSolutionEnum
++syn keyword juliaConstC SmoothAnalysisEnum
++syn keyword juliaConstC SoftMigrationEnum
++syn keyword juliaConstC SpatialLinearFloatingMeltRateEnum
++syn keyword juliaConstC SpcDynamicEnum
++syn keyword juliaConstC SpcStaticEnum
++syn keyword juliaConstC SpcTransientEnum
++syn keyword juliaConstC SsetEnum
++syn keyword juliaConstC StatisticsSolutionEnum
++syn keyword juliaConstC SteadystateSolutionEnum
++syn keyword juliaConstC StressIntensityFactorEnum
++syn keyword juliaConstC StressbalanceAnalysisEnum
++syn keyword juliaConstC StressbalanceConvergenceNumStepsEnum
++syn keyword juliaConstC StressbalanceSIAAnalysisEnum
++syn keyword juliaConstC StressbalanceSolutionEnum
++syn keyword juliaConstC StressbalanceVerticalAnalysisEnum
++syn keyword juliaConstC StringArrayParamEnum
++syn keyword juliaConstC StringExternalResultEnum
++syn keyword juliaConstC StringParamEnum
++syn keyword juliaConstC SubelementFriction1Enum
++syn keyword juliaConstC SubelementFriction2Enum
++syn keyword juliaConstC SubelementMelt1Enum
++syn keyword juliaConstC SubelementMelt2Enum
++syn keyword juliaConstC SubelementMigrationEnum
++syn keyword juliaConstC SurfaceSlopeSolutionEnum
++syn keyword juliaConstC TaylorHoodEnum
++syn keyword juliaConstC TetraEnum
++syn keyword juliaConstC TetraInputEnum
++syn keyword juliaConstC ThermalAnalysisEnum
++syn keyword juliaConstC ThermalSolutionEnum
++syn keyword juliaConstC ThicknessErrorEstimatorEnum
++syn keyword juliaConstC TotalCalvingFluxLevelsetEnum
++syn keyword juliaConstC TotalCalvingMeltingFluxLevelsetEnum
++syn keyword juliaConstC TotalFloatingBmbEnum
++syn keyword juliaConstC TotalFloatingBmbScaledEnum
++syn keyword juliaConstC TotalGroundedBmbEnum
++syn keyword juliaConstC TotalGroundedBmbScaledEnum
++syn keyword juliaConstC TotalSmbEnum
++syn keyword juliaConstC TotalSmbScaledEnum
++syn keyword juliaConstC TransientArrayParamEnum
++syn keyword juliaConstC TransientInputEnum
++syn keyword juliaConstC TransientParamEnum
++syn keyword juliaConstC TransientSolutionEnum
++syn keyword juliaConstC TriaEnum
++syn keyword juliaConstC TriaInputEnum
++syn keyword juliaConstC UzawaPressureAnalysisEnum
++syn keyword juliaConstC VectorParamEnum
++syn keyword juliaConstC VertexEnum
++syn keyword juliaConstC VertexLIdEnum
++syn keyword juliaConstC VertexPIdEnum
++syn keyword juliaConstC VertexSIdEnum
++syn keyword juliaConstC VerticesEnum
++syn keyword juliaConstC ViscousHeatingEnum
++syn keyword juliaConstC WaterEnum
++syn keyword juliaConstC XTaylorHoodEnum
++syn keyword juliaConstC XYEnum
++syn keyword juliaConstC XYZEnum
++syn keyword juliaConstC BalancethicknessD0Enum
++syn keyword juliaConstC BalancethicknessDiffusionCoefficientEnum
++syn keyword juliaConstC BilinearInterpEnum
++syn keyword juliaConstC CalvingdevCoeffEnum
++syn keyword juliaConstC DeviatoricStressEnum
++syn keyword juliaConstC EtaAbsGradientEnum
++syn keyword juliaConstC MeshZEnum
++syn keyword juliaConstC NearestInterpEnum
++syn keyword juliaConstC OutputdefinitionListEnum
++syn keyword juliaConstC SealevelObsEnum
++syn keyword juliaConstC SealevelWeightsEnum
++syn keyword juliaConstC StrainRateEnum
++syn keyword juliaConstC StressTensorEnum
++syn keyword juliaConstC StressbalanceViscosityOvershootEnum
++syn keyword juliaConstC SubelementMigration4Enum
++syn keyword juliaConstC TimesteppingTimeAdaptEnum
++syn keyword juliaConstC TriangleInterpEnum
++syn keyword juliaConstC MaximumNumberOfDefinitionsEnum
++"ISSM Enums end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26611-26612.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26611-26612.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26611-26612.diff	(revision 26740)
@@ -0,0 +1,259 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26611)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_sampling.cpp	(revision 26612)
+@@ -8,7 +8,7 @@
+ #include "../modules/modules.h"
+ #include "../analyses/analyses.h"
+ #include "../shared/Random/randomgenerator.h"
+-#include <random>
++//#include <random>
+ 
+ void GaussianVector(Vector<IssmDouble>* ppf,int seed){/*{{{*/
+ 
+@@ -17,19 +17,19 @@
+ 	double      rdnumber;
+ 
+ 	/*Define seed*/
+-	rnd::normal_distribution distribution;
+-	if(seed<0){
+-		std::random_device rd;
+-		seed = rd();
+-	}
+-	else
++	rnd::linear_congruential_engine random_engine;
++	if(seed>=0)
+ 	{
+ 		int my_rank;
+ 		ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
+ 		seed = seed + 783728*my_rank; // change default seed for parallel simulations (by considering an arbitrary shif based on the rank number)
+ 	}
+-	distribution.seed(seed);
++	random_engine.seed(seed);
+ 
++	/* Define univariate distribution */
++
++	rnd::normal_distribution distribution(0.0,1.0);
++
+ 	int        *local_indices = NULL;
+ 	IssmDouble *local_vector = NULL;
+ 	ppf->GetLocalVector(&local_vector,&local_indices);
+@@ -37,7 +37,7 @@
+   int M;
+ 	ppf->GetLocalSize(&M);
+ 	for(int i=0;i<M;i++){
+-		rdnumber = distribution.generator();
++		rdnumber = distribution.generator(random_engine);
+ 		ppf->SetValue(local_indices[i],rdnumber,INS_VAL);
+ 	}
+ 	ppf->Assemble();
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26611)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26612)
+@@ -12,68 +12,94 @@
+ 
+ namespace rnd{
+ 
+-	uniform_distribution::uniform_distribution(){/*{{{*/
++  /* Linear congruential engine */
+ 
+-			a   = 1103515245; 	// BSD Formula
+-			c  = 12345;					// BSD Formula
+-			m = 2147483648;			// BSD Formula
+-			_seed = 0;
+-			lbound = 0.0;
+-			ubound = 1.0;
++  linear_congruential_engine::linear_congruential_engine(){/*{{{*/
++
++      pseed = new unsigned int;
++			*pseed = std::chrono::steady_clock::now().time_since_epoch()/std::chrono::milliseconds(1);
++      a = 1103515245;		       // BSD Formula
++      c = 12345;					     // BSD Formula
++      m = 2147483648;			     // BSD Formula
+ 			return;
++	}/*}}}*/
++
++  linear_congruential_engine::linear_congruential_engine(unsigned int _a, unsigned int _b, unsigned int _m){/*{{{*/
++
++      pseed = new unsigned int;
++			*pseed = std::chrono::steady_clock::now().time_since_epoch()/std::chrono::milliseconds(1);
++      a = _a;
++      c = _b;
++      m = _m;
++			return;
++	}/*}}}*/
++
++  linear_congruential_engine::~linear_congruential_engine(){}
++
++  unsigned int linear_congruential_engine::get_m() { return m; }
++
++  void linear_congruential_engine::seed( int s ) {
++      if(s<0)
++        *pseed = std::chrono::steady_clock::now().time_since_epoch()/std::chrono::milliseconds(1);
++      else
++        *pseed = (unsigned) s;
++  }
++
++  unsigned int linear_congruential_engine::generator(){
++    *pseed = ( a * *pseed + c ) % m ;
++    return *pseed;
++  }
++
++  /* Uniform distribution */
++
++	uniform_distribution::uniform_distribution(){/*{{{*/
++			a = 0.0;
++			b = 1.0;
++			return;
+ 	}
+ 	/*}}}*/
+-	uniform_distribution::uniform_distribution(double lower,double upper){/*{{{*/
+ 
+-			a   = 1103515245;		// BSD Formula
+-			c  = 12345;					// BSD Formula
+-			m = 2147483648;			// BSD Formula
+-			_seed = 0;
+-			lbound = lower;
+-			ubound = upper;
++	uniform_distribution::uniform_distribution(double _a,double _b){/*{{{*/
++			a = _a;
++			b = _b;
+ 			return;
+ 	}
+ 	/*}}}*/
++
+ 	uniform_distribution::~uniform_distribution(){}
+-	void uniform_distribution::seed( unsigned int s ) { _seed = s; }
+-	unsigned int uniform_distribution::get_seed() { return _seed; }
+-	double uniform_distribution::generator() {
+-			_seed = ( a * _seed + c ) % m ;
+-			return (ubound-lbound)*(double) _seed/ m + lbound;
++
++	double uniform_distribution::generator(rnd::linear_congruential_engine random_engine) {
++			return (b-a)*(double) random_engine.generator()/ random_engine.get_m() + a;
+ 	}
+ 
++  /* Normal distribution */
+ 
+ 	normal_distribution::normal_distribution(){/*{{{*/
+-
+-			_seed = 0;
+ 			mean   = 0;
+ 			sdev  = 1.0;
+ 			return;
+ 	}
+ 	/*}}}*/
++
+ 	normal_distribution::normal_distribution(double m,double s){/*{{{*/
+-
+-			_seed = 0;
+ 			mean   = m;
+ 			sdev  = s;
+ 			return;
+ 	}
+-		/*}}}*/
++	/*}}}*/
++
+ 	normal_distribution::~normal_distribution(){}
+-	void normal_distribution::seed( unsigned int s ) { _seed = s; }
+-	double normal_distribution::generator(){/*{{{*/
+ 
++	double normal_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
++
+ 			rnd::uniform_distribution	unifdistri;
+-			unifdistri.seed(_seed);
+ 
+-			double u1 = unifdistri.generator();
+-			double u2 = unifdistri.generator();
++			double u1 = unifdistri.generator(random_engine);
++			double u2 = unifdistri.generator(random_engine);
+ 
+ 			double R = sqrt(-2*log(u1));
+ 			double theta = 2*M_PI*u2;
+ 
+-			seed(unifdistri.get_seed());
+-
+ 			return mean + sdev * (R*cos(theta));
+ 
+ 	}
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26611)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26612)
+@@ -10,27 +10,42 @@
+ 
+ namespace rnd{
+ 
++  class linear_congruential_engine
++  {
++    private:
++      unsigned int a;
++      unsigned int c;
++      unsigned int m;
++      unsigned int *pseed;
++
++    public:
++
++      /*constructors, destructors: */
++      linear_congruential_engine();
++      linear_congruential_engine(unsigned int _a, unsigned int _b, unsigned int _m);
++      ~linear_congruential_engine();
++
++      unsigned int get_m();
++      void seed( int s );
++      unsigned int generator();
++
++  };
++
+   class uniform_distribution
+   {
+ 
+     private:
+-      int a;
+-      int c;
+-      unsigned int m;
+-      unsigned _seed;
+-      double lbound;
+-      double ubound;
++      double a;  // lower bound of range
++      double b;  // upper bound of range
+ 
+     public:
+ 
+       /*constructors, destructors: */
+       uniform_distribution();
+-      uniform_distribution(double a_1,double a_2);
++      uniform_distribution(double _a,double _b);
+       ~uniform_distribution();
+ 
+-      void seed( unsigned int s );
+-      unsigned int get_seed();
+-      double generator();
++      double generator(rnd::linear_congruential_engine random_engine);
+ 
+   };
+ 
+@@ -38,7 +53,6 @@
+   {
+ 
+     private:
+-      unsigned _seed;
+       double mean;
+       double sdev;
+ 
+@@ -49,11 +63,11 @@
+       normal_distribution(double m,double s);
+       ~normal_distribution();
+ 
+-      void seed( unsigned int s );
+-      double generator();
++      double generator(rnd::linear_congruential_engine random_engine);
+ 
+   };
+ 
++
+ }
+ 
+-#endif //ifndef _RANDOMGENERATOR_H_
++#endif //* _RANDOMGENERATOR_H_ */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26612-26613.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26612-26613.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26612-26613.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26612)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26613)
+@@ -5,8 +5,8 @@
+ #include <iostream>
+ #include "./randomgenerator.h"
+ #include <cmath>
++#include <chrono>
+ 
+-
+ #undef M_PI
+ #define M_PI 3.141592653589793238462643
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26613-26614.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26613-26614.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26613-26614.diff	(revision 26740)
@@ -0,0 +1,248 @@
+Index: ../trunk-jpl/test/MITgcm/get_mitgcm_dngoldberg.sh
+===================================================================
+--- ../trunk-jpl/test/MITgcm/get_mitgcm_dngoldberg.sh	(revision 26613)
++++ ../trunk-jpl/test/MITgcm/get_mitgcm_dngoldberg.sh	(nonexistent)
+@@ -1,15 +0,0 @@
+-#!/bin/bash
+-
+-if [ -e ~/.bashrc ]; then 
+-	source ~/.bashrc
+-fi
+-
+-# Download fresh copy of MITgcm
+-cd ../MITgcm/
+-if [ ! -d install_dngoldberg ]; then
+-    source install_dngoldberg.sh
+-else
+-    cd install_dngoldberg
+-    git pull
+-    cd ..
+-fi
+
+Property changes on: ../trunk-jpl/test/MITgcm/get_mitgcm_dngoldberg.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/test/MITgcm/install_dngoldberg.sh
+===================================================================
+--- ../trunk-jpl/test/MITgcm/install_dngoldberg.sh	(revision 26613)
++++ ../trunk-jpl/test/MITgcm/install_dngoldberg.sh	(nonexistent)
+@@ -1,13 +0,0 @@
+-#!/bin/bash
+-
+-#Some cleanup
+-rm -rf install_dngoldberg
+-
+-#Download code from server
+-git clone https://github.com/dngoldberg/MITgcm
+-cd MITgcm
+-git checkout branch_remeshing
+-cd ..
+-
+-#Move
+-mv MITgcm install_dngoldberg
+
+Property changes on: ../trunk-jpl/test/MITgcm/install_dngoldberg.sh
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/test/MITgcm/build_4003.sh
+===================================================================
+--- ../trunk-jpl/test/MITgcm/build_4003.sh	(revision 26613)
++++ ../trunk-jpl/test/MITgcm/build_4003.sh	(revision 26614)
+@@ -10,9 +10,9 @@
+ fi
+ 
+ # Get MITgcm code, if needed
+-if [ ! -d "$modelpath/../MITgcm/install_dngoldberg" ]; then
++if [ ! -d "$modelpath/../MITgcm/install" ]; then
+     cd $modelpath/../MITgcm
+-    source install_dngoldberg.sh
++    source install.sh
+     cd $modelpath
+ fi
+ 
+@@ -23,11 +23,18 @@
+ 
+ #create MITgcm makefile for this run, if needed
+ if [ ! -f Makefile ]; then
+-    if [ $hostname == "pleiades" ]; then 
+-	$modelpath/../MITgcm/install_dngoldberg/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code_4003 -rd $modelpath/../MITgcm/install_dngoldberg
+-    else
+-	$modelpath/../MITgcm/install_dngoldberg/tools/genmake2 -mpi -mo ../code_4003 -rd $modelpath/../MITgcm/install_dngoldberg
+-    fi
++	case $hostname in
++		"pleiades")
++			$modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code_4003 -rd $modelpath/../MITgcm/install
++			;;
++		"babylon")
++			$modelpath/../MITgcm/install/tools/genmake2 -of $modelpath/../MITgcm/install/tools/build_options/linux_amd64_ifort -mpi -mo $modelpath/../MITgcm/code_4003 -rd $modelpath/../MITgcm/install
++			export LD_LIBRARY_PATH="$ISSM_DIR/externalpackages/petsc/install/lib:/dartfs-hpc/admin/opt/el7/intel/compilers_and_libraries_2019.3.199/linux/compiler/lib/intel64:$ISSM_DIR/externalpackages/triangle/install/lib"
++			;;
++		*)
++			$modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code_4003 -rd $modelpath/../MITgcm/install
++			;;
++	esac
+ fi
+ 
+ #create MITgcm code links for this run, if needed
+@@ -34,5 +41,4 @@
+ if [ ! -f BUILD_INFO.h ]; then
+     make depend
+ fi
+-
+-make -j 4
++make -j 4 &> Makefile.log
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26613)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26614)
+@@ -4,12 +4,13 @@
+ %Script control parameters
+ steps=1:12;
+ steps=1:6;
++steps=7;
+ 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/*
+-!rm -rf Models
++%!rm -rf ${ISSM_DIR}/test/MITgcm/install
++%!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
++%!rm -rf Models
+ 
+ %Organizer
+ !mkdir Models
+@@ -131,7 +132,7 @@
+ %Configure MITgcm
+ % {{{ GetMITgcm:
+ if perform(org,'GetMITgcm'),
+-  system([pwd '/../MITgcm/get_mitgcm_dngoldberg.sh']);
++  system([pwd '/../MITgcm/get_mitgcm.sh']);
+ end
+ % }}}
+ % {{{ BuildMITgcm:
+@@ -151,7 +152,7 @@
+     end
+     !\mkdir run
+     !\cp ../MITgcm/build/mitgcmuv run
+-    !\cp ../MITgcm/install_dngoldberg/verification/shelfice_2d_remesh/input/* run
++    !\cp ../MITgcm/install/verification/shelfice_2d_remesh/input/* run
+     !\cp ../MITgcm/input_4003/* run
+     !\cp ../MITgcm/input_4003/data_uncoupled run/data
+     !\cp ../MITgcm/input_4003/eedata_uncoupled run/eedata
+@@ -169,15 +170,15 @@
+ 	md=model();
+ 
+ 	%Grab lat,long from MITgcm:
+-	long=readbin('run/XG.data',[3 200]);
++	long=readbin('run/XG.data',[Nx Ny]);
+ 	long=[long long(:,end)]; long=[long; -105.1250*ones(1,size(long,2))];
+-	lat=readbin('run/YG.data',[3 200]);
++	lat=readbin('run/YG.data',[Nx Ny]);
+ 	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)
++	Nx=size(lat,1); Ny=size(lat,2);
+ 	index=[];
+ 	%  C  D
+ 	%  A  B
+@@ -363,7 +364,7 @@
+         end
+         !\mkdir run
+         !\cp ../MITgcm/build/mitgcmuv run
+-        !\cp ../MITgcm/install_dngoldberg/verification/shelfice_remeshing/input/* run
++        !\cp ../MITgcm/install/verification/shelfice_remeshing/input/* run
+         !\cp ../MITgcm/input_4003/* run
+         % }}}
+ 		  md.timestepping.coupling_time=time_step;
+@@ -671,42 +672,42 @@
+ % }}}
+ 
+ %Fields and tolerances to track changes
+-fnm=['run/SHICE_fwFlux.0000011400.data'];
+-melting_rate_1=readbin(fnm,[Nx Ny]);
+-fnm=['run/SHICE_fwFlux.0000011450.data'];
+-melting_rate_2=readbin(fnm,[Nx Ny]);
+-fnm=['run/SHICE_fwFlux.0000011500.data'];
+-melting_rate_3=readbin(fnm,[Nx Ny]);
+-fnm=['run/SHICE_fwFlux.0000011550.data'];
+-melting_rate_4=readbin(fnm,[Nx Ny]);
+-field_names     ={'Base1','Melting1','Vx2','Vy2','Thickness2','Base2','MaskOceanLevelset2','FloatingiceMeltingRate2',...
+-	'Melting2','Vx3','Vy3','Thickness3','Base3','MaskOceanLevelset3','FloatingiceMeltingRate3',...
+-	'Melting3','Vx4','Vy4','Thickness4','Base4','MaskOceanLevelset4','FloatingiceMeltingRate4','Melting4'};
+-field_tolerances={2e-13,1e-13,7e-13,7e-13,1e-13,1e-13,1e-13,1e-12,...
+-	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12,...
+-	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12, 1e-13 };
+-field_values={...
+-	(md.results.TransientSolution(1).Base),...
+-	(melting_rate_1(:)),...
+-	(md.results.TransientSolution(2).Vx),...
+-	(md.results.TransientSolution(2).Vy),...
+-	(md.results.TransientSolution(2).Thickness),...
+-	(md.results.TransientSolution(2).Base),...
+-	(md.results.TransientSolution(2).MaskOceanLevelset),...
+-	(md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+-	(melting_rate_2(:)),...
+-	(md.results.TransientSolution(3).Vx),...
+-	(md.results.TransientSolution(3).Vy),...
+-	(md.results.TransientSolution(3).Thickness),...
+-	(md.results.TransientSolution(3).Base),...
+-	(md.results.TransientSolution(3).MaskOceanLevelset),...
+-	(md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+-	(melting_rate_3(:)),...
+-	(md.results.TransientSolution(4).Vx),...
+-	(md.results.TransientSolution(4).Vy),...
+-	(md.results.TransientSolution(4).Thickness),...
+-	(md.results.TransientSolution(4).Base),...
+-	(md.results.TransientSolution(4).MaskOceanLevelset),...
+-	(md.results.TransientSolution(4).BasalforcingsFloatingiceMeltingRate),...
+-	(melting_rate_4(:)),...
+-	};
++%fnm=['run/SHICE_fwFlux.0000011400.data'];
++%melting_rate_1=readbin(fnm,[Nx Ny]);
++%fnm=['run/SHICE_fwFlux.0000011450.data'];
++%melting_rate_2=readbin(fnm,[Nx Ny]);
++%fnm=['run/SHICE_fwFlux.0000011500.data'];
++%melting_rate_3=readbin(fnm,[Nx Ny]);
++%fnm=['run/SHICE_fwFlux.0000011550.data'];
++%melting_rate_4=readbin(fnm,[Nx Ny]);
++%field_names     ={'Base1','Melting1','Vx2','Vy2','Thickness2','Base2','MaskOceanLevelset2','FloatingiceMeltingRate2',...
++%	'Melting2','Vx3','Vy3','Thickness3','Base3','MaskOceanLevelset3','FloatingiceMeltingRate3',...
++%	'Melting3','Vx4','Vy4','Thickness4','Base4','MaskOceanLevelset4','FloatingiceMeltingRate4','Melting4'};
++%field_tolerances={2e-13,1e-13,7e-13,7e-13,1e-13,1e-13,1e-13,1e-12,...
++%	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12,...
++%	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12, 1e-13 };
++%field_values={...
++%	(md.results.TransientSolution(1).Base),...
++%	(melting_rate_1(:)),...
++%	(md.results.TransientSolution(2).Vx),...
++%	(md.results.TransientSolution(2).Vy),...
++%	(md.results.TransientSolution(2).Thickness),...
++%	(md.results.TransientSolution(2).Base),...
++%	(md.results.TransientSolution(2).MaskOceanLevelset),...
++%	(md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
++%	(melting_rate_2(:)),...
++%	(md.results.TransientSolution(3).Vx),...
++%	(md.results.TransientSolution(3).Vy),...
++%	(md.results.TransientSolution(3).Thickness),...
++%	(md.results.TransientSolution(3).Base),...
++%	(md.results.TransientSolution(3).MaskOceanLevelset),...
++%	(md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
++%	(melting_rate_3(:)),...
++%	(md.results.TransientSolution(4).Vx),...
++%	(md.results.TransientSolution(4).Vy),...
++%	(md.results.TransientSolution(4).Thickness),...
++%	(md.results.TransientSolution(4).Base),...
++%	(md.results.TransientSolution(4).MaskOceanLevelset),...
++%	(md.results.TransientSolution(4).BasalforcingsFloatingiceMeltingRate),...
++%	(melting_rate_4(:)),...
++%	};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26614-26615.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26614-26615.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26614-26615.diff	(revision 26740)
@@ -0,0 +1,1239 @@
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26615)
+@@ -82,12 +82,18 @@
+ 	iomodel->FetchDataToInput(inputs,elements,"md.initialization.vy",VyEnum);
+ 
+ 	/*Get moving front parameters*/
+-	int  calvinglaw;
+-	iomodel->FindConstant(&calvinglaw,"md.calving.law");
+-	switch(calvinglaw){
+-		case DefaultCalvingEnum:
+-			iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
+-			break;
++	bool isstochastic;
++   int  calvinglaw;
++   iomodel->FindConstant(&calvinglaw,"md.calving.law");
++   iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
++   switch(calvinglaw){
++      case DefaultCalvingEnum:
++         iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
++         if(isstochastic){
++            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
++            iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",BaselineCalvingCalvingrateEnum);
++         }
++         break;	
+ 		case CalvingLevermannEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.calving.coeff",CalvinglevermannCoeffEnum);
+ 			break;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 26615)
+@@ -98,26 +98,49 @@
+    xDelete<IssmDouble>(varspin);
+    xDelete<IssmDouble>(phi_basin);	
+ }/*}}}*/
+-void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type){/*{{{*/
+-	
+-	const int numvertices = this->GetNumberOfVertices();
+-   int         basinid,M,N;
+-   IssmDouble  beta0_basin,beta1_basin,noise_basin;
++void       Element::Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type){/*{{{*/
++
++   const int numvertices = this->GetNumberOfVertices();
++   int         basinid,M,N,arenum_type,basinenum_type,noiseenum_type,outenum_type;
++   IssmDouble  beta0_basin,beta1_basin,noiseterm;
+    IssmDouble* phi_basin  = xNew<IssmDouble>(arorder);
+    IssmDouble* varlist     = xNew<IssmDouble>(numvertices);
+    IssmDouble* valuesautoregression = NULL;
++   Input*      noiseterm_input      = NULL;
+ 
+-   /*Get Basin ID and Basin coefficients*/
+-   if(enum_type==SMBautoregressionEnum)                   this->GetInputValue(&basinid,SmbBasinsIdEnum);
+-   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->GetInputValue(&basinid,FrontalForcingsBasinIdEnum);
++   /*Get field-specific enums*/
++   switch(enum_type){
++      case(SMBautoregressionEnum):
++         arenum_type    = SmbValuesAutoregressionEnum;
++         basinenum_type = SmbBasinsIdEnum;
++         noiseenum_type = SmbAutoregressionNoiseEnum;
++         outenum_type   = SmbMassBalanceEnum;
++         break;
++      case(FrontalForcingsRignotAutoregressionEnum):
++         arenum_type    = ThermalforcingValuesAutoregressionEnum;
++         basinenum_type = FrontalForcingsBasinIdEnum;
++         noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
++         outenum_type   = FrontalForcingsThermalForcingEnum;
++         break;
++   }
++
++   /*Get noise and autoregressive terms*/
++   this->GetInputValue(&basinid,basinenum_type);
++   if(isfieldstochastic){
++      noiseterm_input = this->GetInput(noiseenum_type);
++      Gauss* gauss = this->NewGauss();
++      noiseterm_input->GetInputValue(&noiseterm,gauss);
++      delete gauss;
++   }
++   else noiseterm = 0.0;
++   this->inputs->GetArray(arenum_type,this->lid,&valuesautoregression,&M);
++
++   /*Get basin coefficients*/
+    for(int ii=0;ii<arorder;ii++) phi_basin[ii] = phi[basinid*arorder+ii];
+    beta0_basin   = beta0[basinid];
+    beta1_basin   = beta1[basinid];
+-   noise_basin   = noiseterms[basinid];
+-   if(enum_type==SMBautoregressionEnum)                   this->inputs->GetArray(SmbValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
+-   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->GetArray(ThermalforcingValuesAutoregressionEnum,this->lid,&valuesautoregression,&M);
+ 
+-   /*If not AR model timestep: take the old values of variable*/
++	/*If not AR model timestep: take the old values of variable*/
+    if(isstepforar==false){
+       for(int i=0;i<numvertices;i++) varlist[i]=valuesautoregression[i];
+    }
+@@ -130,21 +153,19 @@
+          for(int ii=0;ii<arorder;ii++) autoregressionterm += phi_basin[ii]*valuesautoregression[v+ii*numvertices];
+ 
+          /*Stochastic variable value*/
+-         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noise_basin;
++         varlist[v] = beta0_basin+beta1_basin*telapsed_ar+autoregressionterm+noiseterm;
+       }
+-      /*Update autoregression TF values*/
++      /*Update autoregression values*/
+       IssmDouble* temparray = xNew<IssmDouble>(numvertices*arorder);
+       /*Assign newest values and shift older values*/
+       for(int i=0;i<numvertices;i++) temparray[i] = varlist[i];
+       for(int i=0;i<(arorder-1)*numvertices;i++) temparray[i+numvertices] = valuesautoregression[i];
+-      if(enum_type==SMBautoregressionEnum)                   this->inputs->SetArrayInput(SmbValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
+-      if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->inputs->SetArrayInput(ThermalforcingValuesAutoregressionEnum,this->lid,temparray,numvertices*arorder);
++      this->inputs->SetArrayInput(arenum_type,this->lid,temparray,numvertices*arorder);
+       xDelete<IssmDouble>(temparray);
+    }
+ 
+    /*Add input to element*/
+-   if(enum_type==SMBautoregressionEnum)                   this->AddInput(SmbMassBalanceEnum,varlist,P1Enum);
+-   if(enum_type==FrontalForcingsRignotAutoregressionEnum) this->AddInput(FrontalForcingsThermalForcingEnum,varlist,P1Enum);
++   this->AddInput(outenum_type,varlist,P1Enum);
+ 
+    /*Cleanup*/
+    xDelete<IssmDouble>(phi_basin);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26614)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 26615)
+@@ -68,7 +68,7 @@
+ 		/*bool               AnyActive(void);*/
+ 		bool               AnyFSet(void);
+ 		void					 AutoregressionInit(int numbasins,int arorder,int nspin,IssmDouble starttime,IssmDouble tstep_ar,IssmDouble tinit_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,int enum_type);
+-      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,IssmDouble* noiseterms,int enum_type);
++      void               Autoregression(bool isstepforar,int arorder,IssmDouble telapsed_ar,IssmDouble* beta0,IssmDouble* beta1,IssmDouble* phi,bool isfieldstochastic,int enum_type);
+ 		void               ComputeLambdaS(void);
+ 		void               ComputeNewDamage();
+ 		void               ComputeStrainRate();
+Index: ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 26615)
+@@ -79,7 +79,8 @@
+ 
+    /*Load parameters*/
+ 	bool isstochastic;
+-   int M,N,Nphi,arorder,numbasins,my_rank;
++   bool istfstochastic = false;
++	int M,N,Nphi,arorder,numbasins,my_rank;
+    femmodel->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+    femmodel->parameters->FindParam(&arorder,FrontalForcingsAutoregressiveOrderEnum);
+    IssmDouble tinit_ar;
+@@ -86,7 +87,6 @@
+    IssmDouble* beta0      = NULL;
+    IssmDouble* beta1      = NULL;
+    IssmDouble* phi        = NULL;
+-   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
+ 
+ 	femmodel->parameters->FindParam(&tinit_ar,FrontalForcingsAutoregressionInitialTimeEnum);
+    femmodel->parameters->FindParam(&beta0,&M,FrontalForcingsBeta0Enum);    _assert_(M==numbasins);
+@@ -93,7 +93,6 @@
+    femmodel->parameters->FindParam(&beta1,&M,FrontalForcingsBeta1Enum);    _assert_(M==numbasins);
+    femmodel->parameters->FindParam(&phi,&M,&Nphi,FrontalForcingsPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 
+-	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
+ 	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+ 	if(isstochastic){
+ 		int  numstochasticfields;
+@@ -101,10 +100,9 @@
+ 		femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+ 		femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+ 		for(int i=0;i<numstochasticfields;i++){
+-			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum){
+-				femmodel->parameters->FindParam(&noiseterms,&M,ThermalforcingAutoregressionNoiseEnum);  _assert_(M==numbasins);
+-			}
++			if(stochasticfields[i]==FrontalForcingsRignotAutoregressionEnum) istfstochastic = true;
+ 		}
++		xDelete<int>(stochasticfields);
+ 	}
+    /*Time elapsed with respect to AR model initial time*/
+    IssmDouble telapsed_ar = time-tinit_ar;
+@@ -112,7 +110,7 @@
+    /*Loop over each element to compute Thermal Forcing at vertices*/
+    for(Object* &object:femmodel->elements->objects){
+       Element* element = xDynamicCast<Element*>(object);
+-      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,FrontalForcingsRignotAutoregressionEnum);
++      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,istfstochastic,FrontalForcingsRignotAutoregressionEnum);
+    }
+ 
+    /*Cleanup*/
+@@ -119,5 +117,4 @@
+    xDelete<IssmDouble>(beta0);
+    xDelete<IssmDouble>(beta1);
+    xDelete<IssmDouble>(phi);
+-   xDelete<IssmDouble>(noiseterms);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26615)
+@@ -499,30 +499,30 @@
+ 	}
+ 
+ 	bool isstochasticforcing;
+-	parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);
+-	if(isstochasticforcing){
+-		int num_fields;
+-		char** fields;
+-		parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.num_fields",StochasticForcingNumFieldsEnum));
+-		iomodel->FindConstant(&fields,&num_fields,"md.stochasticforcing.fields");
+-		if(num_fields<1) _error_("no stochasticforcing fields found");
+-		int* stochasticforcing_enums = xNew<int>(num_fields);
+-		for(int i=0;i<num_fields;i++){
+-			stochasticforcing_enums[i] = StringToEnumx(fields[i]);
+-			xDelete<char>(fields[i]);
+-		}
+-		xDelete<char*>(fields);
+-		parameters->AddObject(new IntVecParam(StochasticForcingFieldsEnum,stochasticforcing_enums,num_fields));
+-		xDelete<int>(stochasticforcing_enums);
+-
++   parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);
++   if(isstochasticforcing){
++      int num_fields,stochastic_dim;
++      char** fields;
++      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.num_fields",StochasticForcingNumFieldsEnum));
++      parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.defaultdimension",StochasticForcingDefaultDimensionEnum));
++      iomodel->FindConstant(&fields,&num_fields,"md.stochasticforcing.fields");
++      if(num_fields<1) _error_("no stochasticforcing fields found");
++      int* stochasticforcing_enums = xNew<int>(num_fields);
++      for(int i=0;i<num_fields;i++){
++         stochasticforcing_enums[i] = StringToEnumx(fields[i]);
++         xDelete<char>(fields[i]);
++      }
++      xDelete<char*>(fields);
++      parameters->AddObject(new IntVecParam(StochasticForcingFieldsEnum,stochasticforcing_enums,num_fields));
++      xDelete<int>(stochasticforcing_enums);
+       parameters->AddObject(iomodel->CopyConstantObject("md.stochasticforcing.randomflag",StochasticForcingRandomflagEnum));
+-		iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.dimensions");
+-		parameters->AddObject(new IntVecParam(StochasticForcingDimensionsEnum,transparam,N));
+-		xDelete<IssmDouble>(transparam);
+-		iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.covariance");
+-		parameters->AddObject(new DoubleMatParam(StochasticForcingCovarianceEnum,transparam,M,N));
+-		xDelete<IssmDouble>(transparam);
+-	}
++      iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.dimensions");
++      parameters->AddObject(new IntVecParam(StochasticForcingDimensionsEnum,transparam,N));
++      xDelete<IssmDouble>(transparam);
++      iomodel->FetchData(&transparam,&M,&N,"md.stochasticforcing.covariance");
++      parameters->AddObject(new DoubleMatParam(StochasticForcingCovarianceEnum,transparam,M,N));
++      xDelete<IssmDouble>(transparam);
++   }
+ 
+ 	/*Deal with mass flux segments: {{{*/
+ 	iomodel->FetchData(&qmu_mass_flux_present,"md.qmu.mass_flux_segments_present");
+Index: ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26615)
+@@ -35,7 +35,7 @@
+ 		/*Determine whether random seed is fixed to time step (randomflag==false) or random seed truly random (randomflag==true)*/
+       if(randomflag) fixedseed=-1;
+       else fixedseed = reCast<int,IssmDouble>((time-starttime)/dt);
+-      /*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
++		/*multivariateNormal needs to be passed a NULL pointer to avoid memory leak issues*/
+       IssmDouble* temparray = NULL;
+       multivariateNormal(&temparray,dimtot,0.0,covariance,fixedseed);
+       for(int i=0;i<dimtot;i++) noiseterms[i]=temparray[i];
+@@ -45,17 +45,68 @@
+    
+ 	int i=0;
+    for(int j=0;j<numfields;j++){
+-      int enum_type;
++      int dimenum_type,noiseenum_type;
+       IssmDouble* noisefield = xNew<IssmDouble>(dimensions[j]);
+       for(int k=0;k<dimensions[j];k++){
+          noisefield[k]=noiseterms[i+k];
+       }
+-      
+-      if(fields[j]==SMBautoregressionEnum)                        enum_type = SmbAutoregressionNoiseEnum;
+-		else if(fields[j]==FrontalForcingsRignotAutoregressionEnum) enum_type = ThermalforcingAutoregressionNoiseEnum;
+-		else _error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.\n"); 
+-      femmodel->parameters->SetParam(noisefield,dimensions[j],enum_type);
+-      i=i+dimensions[j];
++     
++		int dimensionid;
++
++		/*Deal with the autoregressive models*/
++		if(fields[j]==SMBautoregressionEnum || fields[j]==FrontalForcingsRignotAutoregressionEnum){
++			switch(fields[j]){
++				case SMBautoregressionEnum:
++					dimenum_type   = SmbBasinsIdEnum;
++					noiseenum_type = SmbAutoregressionNoiseEnum;
++					break;
++				case FrontalForcingsRignotAutoregressionEnum:
++					dimenum_type   = FrontalForcingsBasinIdEnum;
++					noiseenum_type = ThermalforcingAutoregressionNoiseEnum;
++					break;
++			}
++			for(Object* &object:femmodel->elements->objects){
++            Element* element = xDynamicCast<Element*>(object);
++            int numvertices  = element->GetNumberOfVertices();
++            IssmDouble* noise_element = xNew<IssmDouble>(numvertices);
++            element->GetInputValue(&dimensionid,dimenum_type);
++            for(int i=0;i<numvertices;i++) noise_element[i] = noisefield[dimensionid];
++            element->AddInput(noiseenum_type,noise_element,P0Enum);
++            xDelete<IssmDouble>(noise_element);
++			}
++		}
++		else{
++			switch(fields[j]){
++				case SMBautoregressionEnum:
++				case FrontalForcingsRignotAutoregressionEnum:
++					/*Already done above*/
++					break;
++				case DefaultCalvingEnum:
++					/*Delete CalvingCalvingrateEnum at previous time step (required if it is transient)*/
++					femmodel->inputs->DeleteInput(CalvingCalvingrateEnum);
++					for(Object* &object:femmodel->elements->objects){
++						Element* element = xDynamicCast<Element*>(object);
++						int numvertices  = element->GetNumberOfVertices();
++						IssmDouble baselinecalvingrate;
++						IssmDouble calvingrate_tot[numvertices];
++						Input* baselinecalvingrate_input  = NULL;
++						baselinecalvingrate_input = element->GetInput(BaselineCalvingCalvingrateEnum); _assert_(baselinecalvingrate_input);
++						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
++						Gauss* gauss = element->NewGauss();
++						for(int i=0;i<numvertices;i++){
++							gauss->GaussVertex(i);
++							baselinecalvingrate_input->GetInputValue(&baselinecalvingrate,gauss);
++							calvingrate_tot[i] = max(0.0,baselinecalvingrate+noisefield[dimensionid]);
++						}
++						element->AddInput(CalvingCalvingrateEnum,&calvingrate_tot[0],P1DGEnum);
++						delete gauss;
++					}
++					break;
++				default:
++					_error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.");
++			}
++		}
++		i=i+dimensions[j];
+       xDelete<IssmDouble>(noisefield);
+    }
+ 
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 26615)
+@@ -176,68 +176,64 @@
+ }/*}}}*/
+ void Smbautoregressionx(FemModel* femmodel){/*{{{*/
+ 
+-	/*Get time parameters*/
+-	IssmDouble time,dt,starttime,tstep_ar;
+-	femmodel->parameters->FindParam(&time,TimeEnum);
+-	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+-	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
++   /*Get time parameters*/
++   IssmDouble time,dt,starttime,tstep_ar;
++   femmodel->parameters->FindParam(&time,TimeEnum);
++   femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
++   femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+    femmodel->parameters->FindParam(&tstep_ar,SmbAutoregressionTimestepEnum);
+ 
+-	/*Initialize module at first time step*/
+-	if(time<=starttime+dt){SmbautoregressionInitx(femmodel);}
+-	/*Determine if this is a time step for the AR model*/
+-	bool isstepforar = false;
++   /*Initialize module at first time step*/
++   if(time<=starttime+dt){SmbautoregressionInitx(femmodel);}
++   /*Determine if this is a time step for the AR model*/
++   bool isstepforar = false;
+ 
+-	#ifndef _HAVE_AD_
++   #ifndef _HAVE_AD_
+    if((fmod(time,tstep_ar)<fmod((time-dt),tstep_ar)) || (time<=starttime+dt) || tstep_ar==dt) isstepforar = true;
+-	#else
+-	_error_("not implemented yet");
+-	#endif
++   #else
++   _error_("not implemented yet");
++   #endif
+ 
+-	/*Load parameters*/
+-	bool isstochastic;
+-	int M,N,Nphi,arorder,numbasins,my_rank;
+-	femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
+-	femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
+-	IssmDouble tinit_ar;
+-	IssmDouble* beta0      = NULL; 
+-	IssmDouble* beta1      = NULL;
+-	IssmDouble* phi        = NULL;
++   /*Load parameters*/
++   bool isstochastic;
++   bool issmbstochastic = false;
++   int M,N,Nphi,arorder,numbasins,my_rank;
++   femmodel->parameters->FindParam(&numbasins,SmbNumBasinsEnum);
++   femmodel->parameters->FindParam(&arorder,SmbAutoregressiveOrderEnum);
++   IssmDouble tinit_ar;
++   IssmDouble* beta0      = NULL; 
++   IssmDouble* beta1      = NULL;
++   IssmDouble* phi        = NULL;
+ 
+-	femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
+-	femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
+-	femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
+-	femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
++   femmodel->parameters->FindParam(&tinit_ar,SmbAutoregressionInitialTimeEnum);
++   femmodel->parameters->FindParam(&beta0,&M,SmbBeta0Enum);    _assert_(M==numbasins);
++   femmodel->parameters->FindParam(&beta1,&M,SmbBeta1Enum);    _assert_(M==numbasins);
++   femmodel->parameters->FindParam(&phi,&M,&Nphi,SmbPhiEnum);  _assert_(M==numbasins); _assert_(Nphi==arorder);
+ 
+-	/*Retrieve noise terms if stochasticity, otherwise leave noiseterms as 0*/
+-   IssmDouble* noiseterms = xNewZeroInit<IssmDouble>(numbasins);
+-	femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
++   femmodel->parameters->FindParam(&isstochastic,StochasticForcingIsStochasticForcingEnum);
+    if(isstochastic){
+-		int  numstochasticfields;
++      int  numstochasticfields;
+       int* stochasticfields;
+       femmodel->parameters->FindParam(&numstochasticfields,StochasticForcingNumFieldsEnum);
+       femmodel->parameters->FindParam(&stochasticfields,&N,StochasticForcingFieldsEnum); _assert_(N==numstochasticfields);
+       for(int i=0;i<numstochasticfields;i++){
+-         if(stochasticfields[i]==SMBautoregressionEnum){
+-				femmodel->parameters->FindParam(&noiseterms,&M,SmbAutoregressionNoiseEnum);  _assert_(M==numbasins);
+-			}
+-		}
+-		xDelete<int>(stochasticfields);
+-	}
+-	/*Time elapsed with respect to AR model initial time*/
+-	IssmDouble telapsed_ar = time-tinit_ar; 
++         if(stochasticfields[i]==SMBautoregressionEnum) issmbstochastic = true;
++      }
++      xDelete<int>(stochasticfields);
++   }
++   /*Time elapsed with respect to AR model initial time*/
++   IssmDouble telapsed_ar = time-tinit_ar;
+ 
+-	/*Loop over each element to compute SMB at vertices*/
+-	for(Object* &object:femmodel->elements->objects){
+-		Element* element = xDynamicCast<Element*>(object);
+-		element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,noiseterms,SMBautoregressionEnum);
+-	}
++   /*Loop over each element to compute SMB at vertices*/
++   for(Object* &object:femmodel->elements->objects){
++      Element* element = xDynamicCast<Element*>(object);
++      element->Autoregression(isstepforar,arorder,telapsed_ar,beta0,beta1,phi,issmbstochastic,SMBautoregressionEnum);
++   }
+ 
+-	/*Cleanup*/
+-	xDelete<IssmDouble>(beta0);
+-	xDelete<IssmDouble>(beta1);
+-	xDelete<IssmDouble>(phi);
+-	xDelete<IssmDouble>(noiseterms);
++   /*Cleanup*/
++   xDelete<IssmDouble>(beta0);
++   xDelete<IssmDouble>(beta1);
++   xDelete<IssmDouble>(phi);
+ }/*}}}*/
+ void Delta18oParameterizationx(FemModel* femmodel){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26614)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26615)
+@@ -397,6 +397,7 @@
+ syn keyword cConstant SolidearthSettingsGrdOceanEnum
+ syn keyword cConstant SolidearthSettingsOceanAreaScalingEnum
+ syn keyword cConstant StochasticForcingCovarianceEnum
++syn keyword cConstant StochasticForcingDefaultDimensionEnum
+ syn keyword cConstant StochasticForcingDimensionsEnum
+ syn keyword cConstant StochasticForcingFieldsEnum
+ syn keyword cConstant StochasticForcingIsStochasticForcingEnum
+@@ -427,7 +428,6 @@
+ syn keyword cConstant SmbAccurefEnum
+ syn keyword cConstant SmbAdThreshEnum
+ syn keyword cConstant SmbAutoregressionInitialTimeEnum
+-syn keyword cConstant SmbAutoregressionNoiseEnum
+ syn keyword cConstant SmbAutoregressionTimestepEnum
+ syn keyword cConstant SmbAutoregressiveOrderEnum
+ syn keyword cConstant SmbAveragingEnum
+@@ -503,7 +503,6 @@
+ syn keyword cConstant StressbalanceRestolEnum
+ syn keyword cConstant StressbalanceRiftPenaltyThresholdEnum
+ syn keyword cConstant StressbalanceShelfDampeningEnum
+-syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+ syn keyword cConstant ThermalIsdrainicecolumnEnum
+ syn keyword cConstant ThermalIsdynamicbasalspcEnum
+ syn keyword cConstant ThermalIsenthalpyEnum
+@@ -601,6 +600,7 @@
+ syn keyword cConstant BaseOldEnum
+ syn keyword cConstant BaseSlopeXEnum
+ syn keyword cConstant BaseSlopeYEnum
++syn keyword cConstant BaselineCalvingCalvingrateEnum
+ syn keyword cConstant BedEnum
+ syn keyword cConstant BedGRDEnum
+ syn keyword cConstant BedEastEnum
+@@ -894,6 +894,7 @@
+ syn keyword cConstant SmbAccumulationEnum
+ syn keyword cConstant SmbAdiffiniEnum
+ syn keyword cConstant SmbAiniEnum
++syn keyword cConstant SmbAutoregressionNoiseEnum
+ syn keyword cConstant SmbBasinsIdEnum
+ syn keyword cConstant SmbBMaxEnum
+ syn keyword cConstant SmbBMinEnum
+@@ -996,6 +997,7 @@
+ syn keyword cConstant SolidearthExternalDisplacementNorthRateEnum
+ syn keyword cConstant SolidearthExternalDisplacementUpRateEnum
+ syn keyword cConstant SolidearthExternalGeoidRateEnum
++syn keyword cConstant StochasticForcingDefaultIdEnum
+ syn keyword cConstant StrainRateeffectiveEnum
+ syn keyword cConstant StrainRateparallelEnum
+ syn keyword cConstant StrainRateperpendicularEnum
+@@ -1031,6 +1033,7 @@
+ syn keyword cConstant TemperaturePDDEnum
+ syn keyword cConstant TemperaturePicardEnum
+ syn keyword cConstant TemperatureSEMICEnum
++syn keyword cConstant ThermalforcingAutoregressionNoiseEnum
+ syn keyword cConstant ThermalforcingValuesAutoregressionEnum
+ syn keyword cConstant ThermalSpctemperatureEnum
+ syn keyword cConstant ThicknessAbsGradientEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26614)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26615)
+@@ -391,6 +391,7 @@
+ 	SolidearthSettingsGrdOceanEnum,
+ 	SolidearthSettingsOceanAreaScalingEnum,
+ 	StochasticForcingCovarianceEnum,
++	StochasticForcingDefaultDimensionEnum,
+ 	StochasticForcingDimensionsEnum,
+ 	StochasticForcingFieldsEnum,
+ 	StochasticForcingIsStochasticForcingEnum,
+@@ -421,7 +422,6 @@
+ 	SmbAccurefEnum,
+ 	SmbAdThreshEnum,
+ 	SmbAutoregressionInitialTimeEnum,
+-   SmbAutoregressionNoiseEnum,
+ 	SmbAutoregressionTimestepEnum,
+    SmbAutoregressiveOrderEnum,
+ 	SmbAveragingEnum,
+@@ -497,7 +497,6 @@
+ 	StressbalanceRestolEnum,
+ 	StressbalanceRiftPenaltyThresholdEnum,
+ 	StressbalanceShelfDampeningEnum,
+-   ThermalforcingAutoregressionNoiseEnum,
+ 	ThermalIsdrainicecolumnEnum,
+ 	ThermalIsdynamicbasalspcEnum,
+ 	ThermalIsenthalpyEnum,
+@@ -597,6 +596,7 @@
+ 	BaseOldEnum,
+ 	BaseSlopeXEnum,
+ 	BaseSlopeYEnum,
++	BaselineCalvingCalvingrateEnum,
+ 	BedEnum,
+ 	BedGRDEnum,
+ 	BedEastEnum,
+@@ -890,6 +890,7 @@
+ 	SmbAccumulationEnum,
+ 	SmbAdiffiniEnum,
+ 	SmbAiniEnum,
++   SmbAutoregressionNoiseEnum,
+ 	SmbBasinsIdEnum,
+ 	SmbBMaxEnum,
+ 	SmbBMinEnum,
+@@ -993,6 +994,7 @@
+ 	SolidearthExternalDisplacementNorthRateEnum,
+ 	SolidearthExternalDisplacementUpRateEnum,
+ 	SolidearthExternalGeoidRateEnum,
++	StochasticForcingDefaultIdEnum,
+ 	StrainRateeffectiveEnum,
+ 	StrainRateparallelEnum,
+ 	StrainRateperpendicularEnum,
+@@ -1028,6 +1030,7 @@
+ 	TemperaturePDDEnum,
+ 	TemperaturePicardEnum,
+ 	TemperatureSEMICEnum,
++   ThermalforcingAutoregressionNoiseEnum,
+ 	ThermalforcingValuesAutoregressionEnum,	
+ 	ThermalSpctemperatureEnum,
+ 	ThicknessAbsGradientEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26615)
+@@ -399,6 +399,7 @@
+ 		case SolidearthSettingsGrdOceanEnum : return "SolidearthSettingsGrdOcean";
+ 		case SolidearthSettingsOceanAreaScalingEnum : return "SolidearthSettingsOceanAreaScaling";
+ 		case StochasticForcingCovarianceEnum : return "StochasticForcingCovariance";
++		case StochasticForcingDefaultDimensionEnum : return "StochasticForcingDefaultDimension";
+ 		case StochasticForcingDimensionsEnum : return "StochasticForcingDimensions";
+ 		case StochasticForcingFieldsEnum : return "StochasticForcingFields";
+ 		case StochasticForcingIsStochasticForcingEnum : return "StochasticForcingIsStochasticForcing";
+@@ -429,7 +430,6 @@
+ 		case SmbAccurefEnum : return "SmbAccuref";
+ 		case SmbAdThreshEnum : return "SmbAdThresh";
+ 		case SmbAutoregressionInitialTimeEnum : return "SmbAutoregressionInitialTime";
+-		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+ 		case SmbAutoregressionTimestepEnum : return "SmbAutoregressionTimestep";
+ 		case SmbAutoregressiveOrderEnum : return "SmbAutoregressiveOrder";
+ 		case SmbAveragingEnum : return "SmbAveraging";
+@@ -505,7 +505,6 @@
+ 		case StressbalanceRestolEnum : return "StressbalanceRestol";
+ 		case StressbalanceRiftPenaltyThresholdEnum : return "StressbalanceRiftPenaltyThreshold";
+ 		case StressbalanceShelfDampeningEnum : return "StressbalanceShelfDampening";
+-		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+ 		case ThermalIsdrainicecolumnEnum : return "ThermalIsdrainicecolumn";
+ 		case ThermalIsdynamicbasalspcEnum : return "ThermalIsdynamicbasalspc";
+ 		case ThermalIsenthalpyEnum : return "ThermalIsenthalpy";
+@@ -603,6 +602,7 @@
+ 		case BaseOldEnum : return "BaseOld";
+ 		case BaseSlopeXEnum : return "BaseSlopeX";
+ 		case BaseSlopeYEnum : return "BaseSlopeY";
++		case BaselineCalvingCalvingrateEnum : return "BaselineCalvingCalvingrate";
+ 		case BedEnum : return "Bed";
+ 		case BedGRDEnum : return "BedGRD";
+ 		case BedEastEnum : return "BedEast";
+@@ -896,6 +896,7 @@
+ 		case SmbAccumulationEnum : return "SmbAccumulation";
+ 		case SmbAdiffiniEnum : return "SmbAdiffini";
+ 		case SmbAiniEnum : return "SmbAini";
++		case SmbAutoregressionNoiseEnum : return "SmbAutoregressionNoise";
+ 		case SmbBasinsIdEnum : return "SmbBasinsId";
+ 		case SmbBMaxEnum : return "SmbBMax";
+ 		case SmbBMinEnum : return "SmbBMin";
+@@ -998,6 +999,7 @@
+ 		case SolidearthExternalDisplacementNorthRateEnum : return "SolidearthExternalDisplacementNorthRate";
+ 		case SolidearthExternalDisplacementUpRateEnum : return "SolidearthExternalDisplacementUpRate";
+ 		case SolidearthExternalGeoidRateEnum : return "SolidearthExternalGeoidRate";
++		case StochasticForcingDefaultIdEnum : return "StochasticForcingDefaultId";
+ 		case StrainRateeffectiveEnum : return "StrainRateeffective";
+ 		case StrainRateparallelEnum : return "StrainRateparallel";
+ 		case StrainRateperpendicularEnum : return "StrainRateperpendicular";
+@@ -1033,6 +1035,7 @@
+ 		case TemperaturePDDEnum : return "TemperaturePDD";
+ 		case TemperaturePicardEnum : return "TemperaturePicard";
+ 		case TemperatureSEMICEnum : return "TemperatureSEMIC";
++		case ThermalforcingAutoregressionNoiseEnum : return "ThermalforcingAutoregressionNoise";
+ 		case ThermalforcingValuesAutoregressionEnum : return "ThermalforcingValuesAutoregression";
+ 		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
+ 		case ThicknessAbsGradientEnum : return "ThicknessAbsGradient";
+Index: ../trunk-jpl/src/c/shared/Enum/Enumjl.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(revision 26614)
++++ ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(revision 26615)
+@@ -169,8 +169,14 @@
+ syn keyword juliaConstC FrictionThresholdSpeedEnum
+ syn keyword juliaConstC FrictionVoidRatioEnum
+ syn keyword juliaConstC FrontalForcingsBasinIcefrontAreaEnum
++syn keyword juliaConstC FrontalForcingsAutoregressionInitialTimeEnum
++syn keyword juliaConstC FrontalForcingsAutoregressionTimestepEnum
++syn keyword juliaConstC FrontalForcingsAutoregressiveOrderEnum
++syn keyword juliaConstC FrontalForcingsBeta0Enum
++syn keyword juliaConstC FrontalForcingsBeta1Enum
+ syn keyword juliaConstC FrontalForcingsNumberofBasinsEnum
+ syn keyword juliaConstC FrontalForcingsParamEnum
++syn keyword juliaConstC FrontalForcingsPhiEnum
+ syn keyword juliaConstC GrdModelEnum
+ syn keyword juliaConstC GroundinglineFrictionInterpolationEnum
+ syn keyword juliaConstC GroundinglineMeltInterpolationEnum
+@@ -383,6 +389,13 @@
+ syn keyword juliaConstC SolidearthSettingsMaxiterEnum
+ syn keyword juliaConstC SolidearthSettingsGrdOceanEnum
+ syn keyword juliaConstC SolidearthSettingsOceanAreaScalingEnum
++syn keyword juliaConstC StochasticForcingCovarianceEnum
++syn keyword juliaConstC StochasticForcingDefaultDimensionEnum
++syn keyword juliaConstC StochasticForcingDimensionsEnum
++syn keyword juliaConstC StochasticForcingFieldsEnum
++syn keyword juliaConstC StochasticForcingIsStochasticForcingEnum
++syn keyword juliaConstC StochasticForcingNumFieldsEnum
++syn keyword juliaConstC StochasticForcingRandomflagEnum
+ syn keyword juliaConstC RotationalPolarMoiEnum
+ syn keyword juliaConstC SolidearthSettingsReltolEnum
+ syn keyword juliaConstC SealevelchangeRequestedOutputsEnum
+@@ -413,7 +426,6 @@
+ syn keyword juliaConstC SmbAveragingEnum
+ syn keyword juliaConstC SmbBeta0Enum
+ syn keyword juliaConstC SmbBeta1Enum
+-syn keyword juliaConstC SmbCovmatEnum
+ syn keyword juliaConstC SmbDesfacEnum
+ syn keyword juliaConstC SmbDpermilEnum
+ syn keyword juliaConstC SmbDsnowIdxEnum
+@@ -423,6 +435,7 @@
+ syn keyword juliaConstC SmbDenIdxEnum
+ syn keyword juliaConstC SmbDtEnum
+ syn keyword juliaConstC SmbEnum
++syn keyword juliaConstC SmbEIdxEnum
+ syn keyword juliaConstC SmbFEnum
+ syn keyword juliaConstC SmbInitDensityScalingEnum
+ syn keyword juliaConstC SmbIsaccumulationEnum
+@@ -431,6 +444,7 @@
+ syn keyword juliaConstC SmbIsd18opdEnum
+ syn keyword juliaConstC SmbIsdelta18oEnum
+ syn keyword juliaConstC SmbIsdensificationEnum
++syn keyword juliaConstC SmbIsdeltaLWupEnum
+ syn keyword juliaConstC SmbIsfirnwarmingEnum
+ syn keyword juliaConstC SmbIsgraingrowthEnum
+ syn keyword juliaConstC SmbIsmeltEnum
+@@ -446,7 +460,6 @@
+ syn keyword juliaConstC SmbNumRequestedOutputsEnum
+ syn keyword juliaConstC SmbPfacEnum
+ syn keyword juliaConstC SmbPhiEnum
+-syn keyword juliaConstC SmbRandomflagEnum
+ syn keyword juliaConstC SmbRdlEnum
+ syn keyword juliaConstC SmbRequestedOutputsEnum
+ syn keyword juliaConstC SmbRlapsEnum
+@@ -459,6 +472,7 @@
+ syn keyword juliaConstC SmbSwIdxEnum
+ syn keyword juliaConstC SmbT0dryEnum
+ syn keyword juliaConstC SmbT0wetEnum
++syn keyword juliaConstC SmbTeThreshEnum
+ syn keyword juliaConstC SmbTdiffEnum
+ syn keyword juliaConstC SmbThermoDeltaTScalingEnum
+ syn keyword juliaConstC SmbTemperaturesReconstructedYearsEnum
+@@ -579,6 +593,7 @@
+ syn keyword juliaConstC BaseOldEnum
+ syn keyword juliaConstC BaseSlopeXEnum
+ syn keyword juliaConstC BaseSlopeYEnum
++syn keyword juliaConstC BaselineCalvingCalvingrateEnum
+ syn keyword juliaConstC BedEnum
+ syn keyword juliaConstC BedGRDEnum
+ syn keyword juliaConstC BedEastEnum
+@@ -872,6 +887,7 @@
+ syn keyword juliaConstC SmbAccumulationEnum
+ syn keyword juliaConstC SmbAdiffiniEnum
+ syn keyword juliaConstC SmbAiniEnum
++syn keyword juliaConstC SmbAutoregressionNoiseEnum
+ syn keyword juliaConstC SmbBasinsIdEnum
+ syn keyword juliaConstC SmbBMaxEnum
+ syn keyword juliaConstC SmbBMinEnum
+@@ -893,6 +909,7 @@
+ syn keyword juliaConstC SmbDailywindspeedEnum
+ syn keyword juliaConstC SmbDiniEnum
+ syn keyword juliaConstC SmbDlwrfEnum
++syn keyword juliaConstC SmbDulwrfValueEnum
+ syn keyword juliaConstC SmbDswrfEnum
+ syn keyword juliaConstC SmbDswdiffrfEnum
+ syn keyword juliaConstC SmbDzAddEnum
+@@ -973,6 +990,7 @@
+ syn keyword juliaConstC SolidearthExternalDisplacementNorthRateEnum
+ syn keyword juliaConstC SolidearthExternalDisplacementUpRateEnum
+ syn keyword juliaConstC SolidearthExternalGeoidRateEnum
++syn keyword juliaConstC StochasticForcingDefaultIdEnum
+ syn keyword juliaConstC StrainRateeffectiveEnum
+ syn keyword juliaConstC StrainRateparallelEnum
+ syn keyword juliaConstC StrainRateperpendicularEnum
+@@ -1008,6 +1026,8 @@
+ syn keyword juliaConstC TemperaturePDDEnum
+ syn keyword juliaConstC TemperaturePicardEnum
+ syn keyword juliaConstC TemperatureSEMICEnum
++syn keyword juliaConstC ThermalforcingAutoregressionNoiseEnum
++syn keyword juliaConstC ThermalforcingValuesAutoregressionEnum
+ syn keyword juliaConstC ThermalSpctemperatureEnum
+ syn keyword juliaConstC ThicknessAbsGradientEnum
+ syn keyword juliaConstC ThicknessAbsMisfitEnum
+@@ -1254,6 +1274,7 @@
+ syn keyword juliaConstC FreeSurfaceTopAnalysisEnum
+ syn keyword juliaConstC FrontalForcingsDefaultEnum
+ syn keyword juliaConstC FrontalForcingsRignotEnum
++syn keyword juliaConstC FrontalForcingsRignotAutoregressionEnum
+ syn keyword juliaConstC FsetEnum
+ syn keyword juliaConstC FullMeltOnPartiallyFloatingEnum
+ syn keyword juliaConstC GLheightadvectionAnalysisEnum
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26614)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26615)
+@@ -408,6 +408,7 @@
+ 	      else if (strcmp(name,"SolidearthSettingsGrdOcean")==0) return SolidearthSettingsGrdOceanEnum;
+ 	      else if (strcmp(name,"SolidearthSettingsOceanAreaScaling")==0) return SolidearthSettingsOceanAreaScalingEnum;
+ 	      else if (strcmp(name,"StochasticForcingCovariance")==0) return StochasticForcingCovarianceEnum;
++	      else if (strcmp(name,"StochasticForcingDefaultDimension")==0) return StochasticForcingDefaultDimensionEnum;
+ 	      else if (strcmp(name,"StochasticForcingDimensions")==0) return StochasticForcingDimensionsEnum;
+ 	      else if (strcmp(name,"StochasticForcingFields")==0) return StochasticForcingFieldsEnum;
+ 	      else if (strcmp(name,"StochasticForcingIsStochasticForcing")==0) return StochasticForcingIsStochasticForcingEnum;
+@@ -438,7 +439,6 @@
+ 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
+ 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionInitialTime")==0) return SmbAutoregressionInitialTimeEnum;
+-	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"SmbAutoregressionTimestep")==0) return SmbAutoregressionTimestepEnum;
+ 	      else if (strcmp(name,"SmbAutoregressiveOrder")==0) return SmbAutoregressiveOrderEnum;
+ 	      else if (strcmp(name,"SmbAveraging")==0) return SmbAveragingEnum;
+@@ -517,7 +517,6 @@
+ 	      else if (strcmp(name,"StressbalanceRestol")==0) return StressbalanceRestolEnum;
+ 	      else if (strcmp(name,"StressbalanceRiftPenaltyThreshold")==0) return StressbalanceRiftPenaltyThresholdEnum;
+ 	      else if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
+-	      else if (strcmp(name,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"ThermalIsdrainicecolumn")==0) return ThermalIsdrainicecolumnEnum;
+ 	      else if (strcmp(name,"ThermalIsdynamicbasalspc")==0) return ThermalIsdynamicbasalspcEnum;
+ 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
+@@ -615,6 +614,7 @@
+ 	      else if (strcmp(name,"BaseOld")==0) return BaseOldEnum;
+ 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
+ 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
++	      else if (strcmp(name,"BaselineCalvingCalvingrate")==0) return BaselineCalvingCalvingrateEnum;
+ 	      else if (strcmp(name,"Bed")==0) return BedEnum;
+ 	      else if (strcmp(name,"BedGRD")==0) return BedGRDEnum;
+ 	      else if (strcmp(name,"BedEast")==0) return BedEastEnum;
+@@ -917,6 +917,7 @@
+ 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
+ 	      else if (strcmp(name,"SmbAdiffini")==0) return SmbAdiffiniEnum;
+ 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
++	      else if (strcmp(name,"SmbAutoregressionNoise")==0) return SmbAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"SmbBasinsId")==0) return SmbBasinsIdEnum;
+ 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+ 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
+ 	      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 stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
++	      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;
+@@ -1022,6 +1023,7 @@
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementNorthRate")==0) return SolidearthExternalDisplacementNorthRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalDisplacementUpRate")==0) return SolidearthExternalDisplacementUpRateEnum;
+ 	      else if (strcmp(name,"SolidearthExternalGeoidRate")==0) return SolidearthExternalGeoidRateEnum;
++	      else if (strcmp(name,"StochasticForcingDefaultId")==0) return StochasticForcingDefaultIdEnum;
+ 	      else if (strcmp(name,"StrainRateeffective")==0) return StrainRateeffectiveEnum;
+ 	      else if (strcmp(name,"StrainRateparallel")==0) return StrainRateparallelEnum;
+ 	      else if (strcmp(name,"StrainRateperpendicular")==0) return StrainRateperpendicularEnum;
+@@ -1057,6 +1059,7 @@
+ 	      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,"ThermalforcingAutoregressionNoise")==0) return ThermalforcingAutoregressionNoiseEnum;
+ 	      else if (strcmp(name,"ThermalforcingValuesAutoregression")==0) return ThermalforcingValuesAutoregressionEnum;
+ 	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
+ 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+@@ -1117,13 +1120,13 @@
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+ 	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+-	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+-	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+-	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+          else stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
++	      if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
++	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
++	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
++	      else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
+ 	      else if (strcmp(name,"Outputdefinition30")==0) return Outputdefinition30Enum;
+ 	      else if (strcmp(name,"Outputdefinition31")==0) return Outputdefinition31Enum;
+ 	      else if (strcmp(name,"Outputdefinition32")==0) return Outputdefinition32Enum;
+@@ -1240,13 +1243,13 @@
+ 	      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,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
+-	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+          else stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
++	      if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
++	      else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
++	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
++	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
+ 	      else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum;
+ 	      else if (strcmp(name,"ChannelDischarge")==0) return ChannelDischargeEnum;
+ 	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+@@ -1363,13 +1366,13 @@
+ 	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
+ 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+ 	      else if (strcmp(name,"Inputs")==0) return InputsEnum;
+-	      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 stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"J")==0) return JEnum;
++	      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,"MLHOApproximation")==0) return MLHOApproximationEnum;
+ 	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
+@@ -1486,13 +1489,13 @@
+ 	      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 stage=13;
+    }
+    if(stage==13){
+-	      if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum;
++	      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;
+Index: ../trunk-jpl/test/NightlyRun/test257.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.m	(revision 26614)
++++ ../trunk-jpl/test/NightlyRun/test257.m	(revision 26615)
+@@ -48,7 +48,6 @@
+ %Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1;
+ md.stochasticforcing.fields              = [{'SMBautoregression'}];
+-md.stochasticforcing.dimensions          = [md.smb.num_basins]; %dimension of each field
+ md.stochasticforcing.covariance          = [[0.15 0.08 -0.02];[0.08 0.12 -0.05];[-0.02 -0.05 0.1]]; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %fixed random seeds
+ 
+Index: ../trunk-jpl/test/NightlyRun/test257.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.py	(revision 26614)
++++ ../trunk-jpl/test/NightlyRun/test257.py	(revision 26615)
+@@ -55,7 +55,6 @@
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+ md.stochasticforcing.fields = ['SMBautoregression']
+-md.stochasticforcing.dimensions = [md.smb.num_basins] # dimension of each field
+ md.stochasticforcing.covariance = np.array([[0.15, 0.08, -0.02], [0.08, 0.12, -0.05], [-0.02, -0.05, 0.1]]) # global covariance among- and between-fields
+ md.stochasticforcing.randomflag = 0 # fixed random seeds
+ 
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(revision 26614)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26615)
+@@ -38,7 +38,6 @@
+ %Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1;
+ md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'}];
+-md.stochasticforcing.dimensions          = [md.frontalforcings.num_basins]; %dimension of each field
+ md.stochasticforcing.covariance          = 1e-4*[[1.5,0.5];[0.5,0.4]]; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %determines true/false randomness
+ 
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26614)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26615)
+@@ -48,7 +48,6 @@
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+ md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression']
+-md.stochasticforcing.dimensions = [md.frontalforcings.num_basins] # dimension of each field
+ md.stochasticforcing.covariance = 1e-4 * np.array([[1.5, 0.5], [0.5, 0.4]]) # global covariance among- and between-fields
+ md.stochasticforcing.randomflag = 0 # determines true/false randomness
+ 
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26614)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26615)
+@@ -7,7 +7,8 @@
+ 	properties (SetAccess=public) 
+ 		isstochasticforcing  = 0;
+ 		fields               = NaN;
+-		dimensions           = NaN;
++		defaultdimension     = 0;
++      default_id           = NaN;
+ 		covariance           = NaN;
+ 		randomflag           = 1;
+ 	end
+@@ -33,33 +34,68 @@
+ 			if ~self.isstochasticforcing, return; end
+ 
+ 			num_fields = numel(self.fields);
+-			size_tot   = sum(self.dimensions);
++			
++			%Check that covariance matrix is positive definite
++			try
++				chol(self.covariance);
++			catch
++				error('md.stochasticforcing.covariance is not positive definite');
++			end
+ 
++			%Check that all fields agree with the corresponding md class and if any field needs the default params   
++         checkdefaults = false; %need to check defaults only if one of the field does not have its own dimensionality
++			for field=self.fields
++            %Checking agreement of classes
++            if(contains(field,'SMB'))
++               if~(isequal(class(md.smb),char(field)))
++                  error('md.smb does not agree with stochasticforcing field %s', char(field));
++               end
++            end
++            if(contains(field,'frontalforcings'))
++               if~(isequal(class(md.frontalforcings),char(field)))
++                  error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
++               end
++            end
++            %Checking for specific dimensions
++            if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
++               checkdefaults = true; %field with non-specific dimensionality
++            end
++         end
++
++			%Retrieve sum of all the field dimensionalities
++			size_tot   = self.defaultdimension*num_fields;
++			indSMBar = -1; %about to check for index of SMBautoregression
++			indTFar  = -1; %about to check for index of FrontalForcingsRignotAutoregression
++			if any(contains(self.fields,'SMBautoregression'))
++            size_tot = size_tot-self.defaultdimension+md.smb.num_basins;
++				indSMBar = find(contains(self.fields,'SMBautoregression')); %index of SMBar, now check for consistency with TFar timestep (08Nov2021)
++         end
++         if any(contains(self.fields,'FrontalForcingsRignotAutoregression'))
++            size_tot = size_tot-self.defaultdimension+md.frontalforcings.num_basins;
++				indTFar  = find(contains(self.fields,'FrontalForcingsRignotAutoregression')); %index of TFar, now check for consistency with SMBar timestep (08Nov2021)
++         end
++
++			if(indSMBar~=-1 && indTFar~=-1) %both autoregressive models are used: check autoregressive time step consistency
++				if((md.smb.ar_timestep~=md.frontalforcings.ar_timestep) && any(self.covariance(1+sum(self.dimensions(1:indSMBar-1)):sum(self.dimensions(1:indSMBar)),1+sum(self.dimensions(1:indTFar-1)):sum(self.dimensions(1:indTFar))))~=0)
++					error('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance');
++				end
++			end
++
+ 			md = checkfield(md,'fieldname','stochasticforcing.isstochasticforcing','values',[0 1]);
+-			md = checkfield(md,'fieldname','stochasticforcing.fields','numel',num_fields,'cell',1,'values',supportedstochforcings()); %VV check here 'cell' (19Oct2021)
+-			md = checkfield(md,'fieldname','stochasticforcing.dimensions','NaN',1,'Inf',1,'>',0,'size',[1,num_fields]); %specific dimension for each field
++			md = checkfield(md,'fieldname','stochasticforcing.fields','numel',num_fields,'cell',1,'values',supportedstochforcings());
+ 			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot]); %global covariance matrix
+ 			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
+-
+-			%Check that all fields agree with the corresponding md class
+-			for field=self.fields
+-				if(contains(field,'SMB'))
+-					if~(isequal(class(md.smb),char(field)))
+-						error('md.smb does not agree with stochasticforcing field %s', char(field));
+-					end
+-				end
+-				if(contains(field,'frontalforcings'))
+-					if~(isequal(class(md.frontalforcings),char(field)))
+-						error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
+-					end
+-				end
+-			end
++			if(checkdefaults) %need to check the defaults
++            md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
++            md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
++         end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   stochasticforcing parameters:'));
+ 			fielddisplay(self,'isstochasticforcing','is stochasticity activated?');
+ 			fielddisplay(self,'fields','fields with stochasticity applied, ex: {''SMBautoregression''}, or {''FrontalForcingsRignotAutoregression''}');
+-			fielddisplay(self,'dimensions','dimensionality of each field');
++			fielddisplay(self,'defaultdimension','dimensionality of the noise terms (does not apply to fields with their specific dimension)');
++         fielddisplay(self,'default_id','id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)');
+ 			fielddisplay(self,'covariance','covariance matrix for within- and between-fields covariance (units must be squared field units)');
+ 			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 			disp('Available fields:');
+@@ -76,12 +112,27 @@
+ 			if ~self.isstochasticforcing 
+ 				return
+ 			else
++
++				%Retrieve dimensionality of each field
++				dimensions = self.defaultdimension*ones(1,num_fields);
++				ind = 1;
++				for field=self.fields
++					%Checking for specific dimensions
++					if(strcmp(field,'SMBautoregression'))
++						dimensions(ind) = md.smb.num_basins;
++					end
++					if(strcmp(field,'FrontalForcingsRignotAutoregression'))
++						dimensions(ind) = md.frontalforcings.num_basins;
++					end
++					ind = ind+1;
++				end
++
+ 				%Scaling covariance matrix (scale column-by-column and row-by-row)
+-				scaledfields = {'SMBautoregression'}; %list of fields that need scaling *1/yts
++				scaledfields = {'DefaultCalving','SMBautoregression'}; %list of fields that need scaling *1/yts
+ 				tempcovariance = self.covariance; %copy of covariance to avoid writing back in member variable
+ 				for i=1:num_fields
+ 					if any(strcmp(scaledfields,self.fields(i)))
+-						inds = [1+sum(self.dimensions(1:i-1)):1:sum(self.dimensions(1:i))];
++						inds = [1+sum(dimensions(1:i-1)):1:sum(dimensions(1:i))];
+ 						for row=inds %scale rows corresponding to scaled field
+ 							tempcovariance(row,:) = 1./yts*tempcovariance(row,:);
+ 						end
+@@ -92,7 +143,9 @@
+ 				end
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+-				WriteData(fid,prefix,'object',self,'fieldname','dimensions','format','IntMat');
++				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
++            WriteData(fid,prefix,'object',self,'fieldname','default_id','data',self.default_id-1,'format','IntMat','mattype',2); %0-indexed
++				WriteData(fid,prefix,'object',self,'fieldname','defaultdimension','format','Integer');
+ 				WriteData(fid,prefix,'data',tempcovariance,'name','md.stochasticforcing.covariance','format','DoubleMat');
+ 				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
+ 			end
+@@ -104,7 +157,8 @@
+    % by the class md.stochasticforcing
+ 
+    list = {...
+-      'SMBautoregression',...
+-      'FrontalForcingsRignotAutoregression'
++      'DefaultCalving',...
++		'FrontalForcingsRignotAutoregression',...
++      'SMBautoregression'
+       };
+ end % }}}
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26614)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26615)
+@@ -14,10 +14,11 @@
+ 
+     def __init__(self, *args):  # {{{
+         self.isstochasticforcing = 0
+-        self.fields = np.nan
+-        self.dimensions = np.nan
+-        self.covariance = np.nan
+-        self.randomflag = 1
++        self.fields              = np.nan
++        self.defaultdimension    = 0
++        self.default_id          = np.nan
++        self.covariance          = np.nan
++        self.randomflag          = 1
+ 
+         if len(args) == 0:
+             self.setdefaultparameters()
+@@ -28,9 +29,12 @@
+         s = '   stochasticforcing parameters:\n'
+         s += '{}\n'.format(fielddisplay(self, 'isstochasticforcing', 'is stochasticity activated?'))
+         s += '{}\n'.format(fielddisplay(self, 'fields', 'fields with stochasticity applied, ex: [\'SMBautoregression\'], or [\'FrontalForcingsRignotAutoregression\']'))
++        s += '{}\n'.format(fielddisplay(self, 'defaultdimension', 'dimensionality of the noise terms (does not apply to fields with their specific dimension)'))
++        s += '{}\n'.format(fielddisplay(self, 'default_id', 'id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)'))
+         s += '{}\n'.format(fielddisplay(self, 'covariance', 'covariance matrix for within- and between-fields covariance (units must be squared field units)'))
+         s += '{}\n'.format(fielddisplay(self, 'randomflag', 'whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)'))
+         s += 'Available fields:\n'
++        s += '   DefaultCalving\n'
+         s += '   SMBautoregression\n'
+         s += '   FrontalForcingsRignotAutoregression (thermal forcing)\n'
+         return s
+@@ -50,15 +54,15 @@
+             return md
+ 
+         num_fields  = numel(self.fields)
+-        size_tot    = np.sum(self.dimensions)
+ 
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', supportedstochforcings()) # VV check here 'cell' (19Oct2021)
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.dimensions', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [num_fields]) # specific dimension for each field; NOTE: As opposed to MATLAB implementation, pass list
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot]) # global covariance matrix
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
++        #Check that covariance matrix is positive definite
++        try:
++            np.linalg.cholesky(self.covariance);
++        except:
++            error('md.stochasticforcing.covariance is not positive definite');
+ 
+         # Check that all fields agree with the corresponding md class
++        checkdefaults = False
+         for field in self.fields:
+             if (contains(field, 'SMB')):
+                 if not (type(md.smb) == field):
+@@ -66,6 +70,32 @@
+             if (contains(field, 'frontalforcings')):
+                 if not (type(md.frontalforcings) == field):
+                     error('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
++            #Checking for specific dimensions
++            if (field!='SMBautoregression' or field!='FrontalForcingsRignotAutoregression'):
++                checkdefaults = True #field with non-specific dimensionality
++
++        #Retrieve sum of all the field dimensionalities
++        size_tot   = self.defaultdimension*num_fields;
++        indSMBar = -1; #about to check for index of SMBautoregression
++        indTFar  = -1; #about to check for index of FrontalForcingsRignotAutoregression
++        if ('SMBautoregression' in self.fields):
++            size_tot = size_tot-self.defaultdimension+md.smb.num_basins
++            indSMBar = np.where(self.fields=='SMBautoregression')[0][0]
++        if ('FrontalForcingsRignotAutoregression' in self.fields):
++            size_tot = size_tot-self.defaultdimension+md.frontalforcings.num_basins
++            indSMBar = np.where(self.fields=='FrontalForcingsRignotAutoregression')[0][0]
++        if (indSMBar!=-1 and indTFar!=-1):
++            if((md.smb.ar_timestep!=md.frontalforcings.ar_timestep) and np.any(self.covariance[np.sum(self.dimensions[0:indSMBar]).astype(int):np.sum(self.dimensions[0:indSMBar+1]).astype(int),np.sum(self.dimensions[0:indTFar]).astype(int):np.sum(self.dimensions[0:indTFar+1]).astype(int)]!=0)):
++                error('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance')
++
++        md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
++        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', supportedstochforcings())
++        #md = checkfield(md, 'fieldname', 'stochasticforcing.dimensions', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [num_fields]) # specific dimension for each field; NOTE: As opposed to MATLAB implementation, pass list
++        md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot]) # global covariance matrix
++        md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
++        if (checkdefaults):
++            md = checkfield(md, 'fieldname', 'stochasticforcing.defaultdimension', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
++            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id', 'Inf', 1, '>=', 0, '<=', self.defaultdimension, 'size', [md.mesh.numberofelements,1])
+         return md
+     # }}}
+ 
+@@ -82,19 +112,30 @@
+         if not self.isstochasticforcing:
+             return md
+         else:
++            #Retrieve dimensionality of each field
++            dimensions = self.defaultdimension*np.ones(num_fields)
++            for ind,field in enumerate(self.fields):
++                #Checking for specific dimensions
++                if (field=='SMBautoregression'):
++                    dimensions[ind] = md.smb.num_basins
++                if (field=='FrontalForcingsRignotAutoregression'):
++                    dimensions[ind] = md.frontalforcings.num_basins
++
+             # Scaling covariance matrix (scale column-by-column and row-by-row)
+-            scaledfields = ['SMBautoregression'] # list of fields that need scaling * 1/yts
+-            tempcovariance = self.covariance
++            scaledfields = ['DefaultCalving','SMBautoregression'] # list of fields that need scaling * 1/yts
++            tempcovariance = np.copy(self.covariance)
+             for i in range(num_fields):
+                 if self.fields[i] in scaledfields:
+                     inds = range(int(np.sum(self.dimensions[0:i])), int(np.sum(self.dimensions[0:i + 1])))
+                     for row in inds: # scale rows corresponding to scaled field
+-                        tempcovariance[row, :] = 1 / yts * self.covariance[row, :]
++                        tempcovariance[row, :] = 1 / yts * tempcovariance[row, :]
+                     for col in inds: # scale columns corresponding to scaled field
+-                        tempcovariance[:, col] = 1 / yts * self.covariance[:, col]
++                        tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+-            WriteData(fid, prefix, 'object', self, 'fieldname','dimensions', 'format', 'IntMat')
++            WriteData(fid, prefix, 'data', 'dimensions', 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'format', 'IntMat') #12Nov2021 make sure this is zero-indexed!
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'defaultdimension', 'format', 'Integer') 
+             WriteData(fid, prefix, 'data', tempcovariance, 'name', 'md.stochasticforcing.covariance', 'format', 'DoubleMat')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
+     # }}}
+@@ -103,6 +144,7 @@
+     """ Defines list of fields supported  by the class stochasticforcings
+     """
+     return [
+-        'SMBautoregression',
+-        'FrontalForcingsRignotAutoregression'
++        'DefaultCalving',
++        'FrontalForcingsRignotAutoregression',
++        'SMBautoregression'
+     ]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26615-26616.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26615-26616.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26615-26616.diff	(revision 26740)
@@ -0,0 +1,170 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26615)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26616)
+@@ -92,10 +92,10 @@
+ 
+ 	double normal_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
+ 
+-			rnd::uniform_distribution	unifdistri;
++			rnd::uniform_distribution	distribution;
+ 
+-			double u1 = unifdistri.generator(random_engine);
+-			double u2 = unifdistri.generator(random_engine);
++			double u1 = distribution.generator(random_engine);
++			double u2 = distribution.generator(random_engine);
+ 
+ 			double R = sqrt(-2*log(u1));
+ 			double theta = 2*M_PI*u2;
+@@ -105,4 +105,87 @@
+ 	}
+ 	/*}}}*/
+ 
++  /* Log-Normal distribution */
++
++  lognormal_distribution::lognormal_distribution(){/*{{{*/
++      logmean   = 0;
++      logsdev  = 1.0;
++      return;
++  }
++  /*}}}*/
++
++  lognormal_distribution::lognormal_distribution(double m,double s){/*{{{*/
++      logmean   = m;
++      logsdev  = s;
++      return;
++  }
++  /*}}}*/
++
++  lognormal_distribution::~lognormal_distribution(){}
++
++  double lognormal_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
++
++      rnd::normal_distribution	distribution(logmean,logsdev);
++
++      return exp(distribution.generator(random_engine));
++
++  }
++  /*}}}*/
++
++  /* Chi-squared distribution */
++
++  chi_squared_distribution::chi_squared_distribution(){/*{{{*/
++      k  = 1;
++      return;
++  }
++  /*}}}*/
++
++  chi_squared_distribution::chi_squared_distribution(unsigned int dof){/*{{{*/
++      k   = dof;
++      return;
++  }
++  /*}}}*/
++
++  chi_squared_distribution::~chi_squared_distribution(){}
++
++  double chi_squared_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
++
++      rnd::normal_distribution	distribution;
++
++      double rand = 0;
++
++      for(int i=0;i<k;i++)
++        rand = rand + pow(distribution.generator(random_engine),2);
++
++      return rand;
++
++  }
++  /*}}}*/
++
++
++  /* Exponential distribution */
++
++  exponential_distribution::exponential_distribution(){/*{{{*/
++      lambda  = 1.0;
++      return;
++  }
++  /*}}}*/
++
++  exponential_distribution::exponential_distribution(double scale){/*{{{*/
++      lambda   = scale;
++      return;
++  }
++  /*}}}*/
++
++  exponential_distribution::~exponential_distribution(){}
++
++  double exponential_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
++
++      rnd::uniform_distribution	distribution;
++
++      return -1.0/lambda*log(1.0-distribution.generator(random_engine));
++
++  }
++  /*}}}*/
++
+ }
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26615)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26616)
+@@ -67,7 +67,59 @@
+ 
+   };
+ 
++  class lognormal_distribution
++  {
+ 
++    private:
++      double logmean;
++      double logsdev;
++
++    public:
++
++      /*constructors, destructors: */
++      lognormal_distribution();
++      lognormal_distribution(double m,double s);
++      ~lognormal_distribution();
++
++      double generator(rnd::linear_congruential_engine random_engine);
++
++  };
++
++  class chi_squared_distribution
++  {
++
++    private:
++      unsigned int k;
++
++    public:
++
++      /*constructors, destructors: */
++      chi_squared_distribution();
++      chi_squared_distribution(unsigned int k);
++      ~chi_squared_distribution();
++
++      double generator(rnd::linear_congruential_engine random_engine);
++
++  };
++
++  class exponential_distribution
++  {
++
++    private:
++      double lambda;
++
++    public:
++
++      /*constructors, destructors: */
++      exponential_distribution();
++      exponential_distribution(double scale);
++      ~exponential_distribution();
++
++      double generator(rnd::linear_congruential_engine random_engine);
++
++  };
++
++
+ }
+ 
+ #endif //* _RANDOMGENERATOR_H_ */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26616-26617.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26616-26617.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26616-26617.diff	(revision 26740)
@@ -0,0 +1,38 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26616)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26617)
+@@ -88,7 +88,7 @@
+ 			if(checkdefaults) %need to check the defaults
+             md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
+             md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
+-         end
++			end
+ 		end % }}}
+ 		function disp(self) % {{{
+ 			disp(sprintf('   stochasticforcing parameters:'));
+@@ -141,6 +141,10 @@
+ 						end
+ 					end
+ 				end
++				%Set dummy default_id vector if defaults not used
++				if isnan(self.default_id)
++					self.default_id = zeros(md.mesh.numberofelements,1);
++				end
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+ 				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26616)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26617)
+@@ -131,6 +131,9 @@
+                         tempcovariance[row, :] = 1 / yts * tempcovariance[row, :]
+                     for col in inds: # scale columns corresponding to scaled field
+                         tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
++            #Set dummy default_id vector if defaults not used
++            if np.isnan(self.default_id)
++               self.default_id = np.zeros(md.mesh.numberofelements);
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+             WriteData(fid, prefix, 'data', 'dimensions', 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26617-26618.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26617-26618.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26617-26618.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26617)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26618)
+@@ -142,9 +142,9 @@
+ 					end
+ 				end
+ 				%Set dummy default_id vector if defaults not used
+-				if isnan(self.default_id)
+-					self.default_id = zeros(md.mesh.numberofelements,1);
+-				end
++				%if isnan(self.default_id)
++				%	self.default_id = zeros(md.mesh.numberofelements,1);
++				%end
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+ 				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26617)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26618)
+@@ -132,8 +132,8 @@
+                     for col in inds: # scale columns corresponding to scaled field
+                         tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
+             #Set dummy default_id vector if defaults not used
+-            if np.isnan(self.default_id)
+-               self.default_id = np.zeros(md.mesh.numberofelements);
++            #if np.isnan(self.default_id)
++              # self.default_id = np.zeros(md.mesh.numberofelements);
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+             WriteData(fid, prefix, 'data', 'dimensions', 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26618-26619.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26618-26619.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26618-26619.diff	(revision 26740)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26618)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26619)
+@@ -188,4 +188,30 @@
+   }
+   /*}}}*/
+ 
++  /* Student-t distribution */
++
++  student_t_distribution::student_t_distribution(){/*{{{*/
++      k  = 1;
++      return;
++  }
++  /*}}}*/
++
++  student_t_distribution::student_t_distribution(unsigned int dof){/*{{{*/
++      k   = dof;
++      return;
++  }
++  /*}}}*/
++
++  student_t_distribution::~student_t_distribution(){}
++
++  double student_t_distribution::generator(rnd::linear_congruential_engine random_engine){/*{{{*/
++
++      rnd::normal_distribution	normal_distribution;
++      rnd::chi_squared_distribution	chi_squared_distribution(k);
++
++      return normal_distribution.generator(random_engine)/sqrt(chi_squared_distribution.generator(random_engine)/k);
++
++  }
++  /*}}}*/
++
+ }
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26618)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26619)
+@@ -119,7 +119,24 @@
+ 
+   };
+ 
++  class student_t_distribution
++  {
+ 
++    private:
++      unsigned int k;
++
++    public:
++
++      /*constructors, destructors: */
++      student_t_distribution();
++      student_t_distribution(unsigned int k);
++      ~student_t_distribution();
++
++      double generator(rnd::linear_congruential_engine random_engine);
++
++  };
++
++
+ }
+ 
+ #endif //* _RANDOMGENERATOR_H_ */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26619-26620.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26619-26620.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26619-26620.diff	(revision 26740)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26619)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26620)
+@@ -142,9 +142,9 @@
+ 					end
+ 				end
+ 				%Set dummy default_id vector if defaults not used
+-				%if isnan(self.default_id)
+-				%	self.default_id = zeros(md.mesh.numberofelements,1);
+-				%end
++				if isnan(self.default_id)
++					self.default_id = zeros(md.mesh.numberofelements,1);
++				end
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+ 				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26619)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26620)
+@@ -132,8 +132,8 @@
+                     for col in inds: # scale columns corresponding to scaled field
+                         tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
+             #Set dummy default_id vector if defaults not used
+-            #if np.isnan(self.default_id)
+-              # self.default_id = np.zeros(md.mesh.numberofelements);
++            if np.isnan(self.default_id):
++               self.default_id = np.zeros(md.mesh.numberofelements)
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+             WriteData(fid, prefix, 'data', 'dimensions', 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26620-26621.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26620-26621.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26620-26621.diff	(revision 26740)
@@ -0,0 +1,113 @@
+Index: ../trunk-jpl/src/c/shared/Random/random.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26620)
++++ ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26621)
+@@ -8,37 +8,42 @@
+ #include <sys/types.h>
+ #include <math.h>
+ #include <float.h>    /*  DBL_EPSILON  */
+-#include <chrono>
+ #include <cstdarg>
+ #include <iostream>
+-#include <random>
+ 
+ #include "../Matrix/matrix.h"
+ #include "../Exceptions/exceptions.h"
+ #include "../MemOps/MemOps.h"
+ #include "../io/io.h"
++#include "./randomgenerator.h"
+ /*}}}*/
+ 
+-void univariateNormal(IssmPDouble* prand, IssmPDouble mean, IssmPDouble sdev, int seedfixed=-1) { /*{{{*/
++void univariateNormal(IssmPDouble* prand, IssmPDouble mean, IssmPDouble sdev, int seed=-1) { /*{{{*/
+ 
+-	unsigned seed;
+-	/*Random seed using time_since_epoch*/
+-	if(seedfixed==-1) seed = std::chrono::steady_clock::now().time_since_epoch().count(); 
+-	/*Seed fixed by input argument*/
+-	else seed = seedfixed;
+-	std::default_random_engine generator(seed);
+-	/*Normal Probability Distribution*/
+-   std::normal_distribution<IssmPDouble> normdistri(mean,sdev); 
+-	*prand = normdistri(generator);
++	/*Seed the pseudo-random number generator*/
++	rnd::linear_congruential_engine randomengine;
++	randomengine.seed(seed);
++	/*Normal distribution*/
++	rnd::normal_distribution distriNormal(mean,sdev);
++	*prand = distriNormal.generator(randomengine);
+ } /*}}}*/
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seedfixed=-1) { /*{{{*/
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
+    
+ 	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+    IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+    IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
+ 
+-	/*True randomness if seedfixed==-1, otherwise random seed is fixed at seedfixed*/
+-	for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0,seedfixed); 
++	/*True randomness if seed<0, otherwise random seed is fixed at seed*/
++	/*Seed the pseudo-random number generator, repeatedly calling univariateNormal does not ensure randomness*/
++	rnd::linear_congruential_engine randomengine;
++	randomengine.seed(seed);
++	/*Normal distribution*/
++	rnd::normal_distribution distriNormal(0.0,1.0);
++	for(int i=0;i<dim;i++){
++		sampleStandardNormal[i] = distriNormal.generator(randomengine);
++	}
++
++	/*Cholsesky decomposition of the covariance matrix*/
+ 	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+    
+ 	/*Matrix by vector multiplication*/
+@@ -54,14 +59,23 @@
+    xDelete<IssmPDouble>(sampleStandardNormal);
+    xDelete<IssmDouble>(Lchol);
+ } /*}}}*/
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seedfixed=-1) { /*{{{*/
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
+ 	
+ 	IssmPDouble* sampleStandardNormal    = xNew<IssmPDouble>(dim);
+ 	IssmDouble* sampleMultivariateNormal = xNew<IssmDouble>(dim);
+ 	IssmDouble* Lchol                    = xNewZeroInit<IssmDouble>(dim*dim);
++	
++	/*True randomness if seed<0, otherwise random seed is fixed at seed*/
++	/*Seed the pseudo-random number generator, repeatedly calling univariateNormal does not ensure randomness*/
++	rnd::linear_congruential_engine randomengine;
++	randomengine.seed(seed);
++	/*Normal distribution*/
++	rnd::normal_distribution distriNormal(0.0,1.0);
++	for(int i=0;i<dim;i++){
++		sampleStandardNormal[i] = distriNormal.generator(randomengine);
++	}
+ 
+-	/*True randomness if seedfixed==-1, otherwise random seed is fixed at seedfixed*/
+-	for(int i=0;i<dim;i++) univariateNormal(&(sampleStandardNormal[i]),0.0,1.0,seedfixed); 
++	/*Cholsesky decomposition of the covariance matrix*/
+ 	CholeskyRealPositiveDefinite(Lchol,covariancematrix,dim);
+ 
+ 	/*Matrix by vector multiplication*/
+Index: ../trunk-jpl/src/c/shared/Random/random.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.h	(revision 26620)
++++ ../trunk-jpl/src/c/shared/Random/random.h	(revision 26621)
+@@ -5,8 +5,8 @@
+ #ifndef _RANDOM_H_
+ #define _RANDOM_H_
+ 
+-void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev, int seedfixed=-1);
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seedfixed=-1);
+-void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seedfixed=-1);
++void univariateNormal(IssmDouble* prand, IssmDouble mean, IssmDouble sdev, int seed=-1);
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seed=-1);
++void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seed=-1);
+ 
+ #endif //ifndef _RANDOM_H_
+Index: ../trunk-jpl/test/Archives/Archive257.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive543.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26621-26622.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26621-26622.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26621-26622.diff	(revision 26740)
@@ -0,0 +1,181 @@
+Index: ../trunk-jpl/src/jl/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/classes.jl	(revision 26621)
++++ ../trunk-jpl/src/jl/classes.jl	(revision 26622)
+@@ -153,14 +153,12 @@
+ 	compact = get(io, :compact, false)
+ 
+ 	println(io,"Model:")
+-	@printf "%19s: %-22s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
+-	@printf "%19s: %-22s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
+-	@printf "%19s: %-22s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+-	@printf "%19s: %-22s -- %s\n" "materials" typeof(md.materials) "material properties"
+-	@printf "%19s: %-22s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+-	@printf "%19s: %-22s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
+-	@printf "%19s: %-22s -- %s\n" "constants" typeof(md.constants) "physical constants"
++	@printf "%19s: %-26s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
++	@printf "%19s: %-26s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
++	@printf "%19s: %-26s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
++	@printf "%19s: %-26s -- %s\n" "materials" typeof(md.materials) "material properties"
++	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
++	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
++	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
+ 
+ end# }}}
+-
+-
+Index: ../trunk-jpl/src/jl/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve.jl	(revision 26621)
++++ ../trunk-jpl/src/jl/solve.jl	(revision 26622)
+@@ -7,10 +7,16 @@
+ 	enum::IssmEnum
+ 	value::Float64
+ end# }}}
++function GetParameterValue(param::DoubleParam) #{{{
++	return param.value
++end#}}}
+ struct IntParam <: Parameter #{{{
+ 	enum::IssmEnum
+ 	value::Int64
+ end# }}}
++function GetParameterValue(param::IntParam) #{{{
++	return param.value
++end#}}}
+ mutable struct Parameters #{{{
+ 	lookup::Dict{IssmEnum,Parameter}
+ end# }}}
+@@ -29,7 +35,13 @@
+ 	parameters.lookup[enum] = IntParam(enum,value)
+ 
+ end#}}}
++function FindParam(parameters::Parameters,enum::IssmEnum) #{{{
+ 
++	param = parameters.lookup[enum]
++	return GetParameterValue(param)
++
++end#}}}
++
+ abstract type Input end
+ struct BoolInput <: Input#{{{
+ 	enum::IssmEnum
+@@ -193,7 +205,7 @@
+ end# }}}
+ 
+ abstract type Analysis end
+-struct StressbalanceAnalysis#{{{
++struct StressbalanceAnalysis <: Analysis#{{{
+ end #}}}
+ 
+ #Modules
+@@ -208,9 +220,11 @@
+ 	femmodel=ModelProcessor(md)
+ 
+ 	#Solve
+-	Stressbalance(femmodel)
++	analysis = StressbalanceAnalysis()
++	Core(analysis,femmodel)
+ 
+ 	#then what??
++	error("STOP")
+ 
+ end# }}}
+ function ModelProcessor(md::model) #{{{
+@@ -236,6 +250,9 @@
+ 	UpdateElements(analysis,elements,inputs,md)
+ 	CreateConstraints(analysis,constraints,md)
+ 
++	#Configure objects
++	ConfigureObjectx(elements,nodes,vertices,parameters,inputs)
++
+ 	#Build FemModel
+ 	return FemModel(elements,vertices,nodes,parameters,inputs,constraints)
+ end# }}}
+@@ -246,7 +263,7 @@
+ 
+ 	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
+ 	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
+-	tempvertices = Vector{Vertex}(undef,0)
++	tempvertices = Vector{Vertex}(undef,3)
+ 	tempnodes    = Vector{Node}(undef,0)
+ 
+ 	count = 0
+@@ -283,7 +300,15 @@
+ 	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+ 	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
+ end# }}}
++function ConfigureObjectx(elements::Vector{Tria},nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) #{{{
+ 
++	for i in 1:length(elements)
++		Configure(elements[i],nodes,vertices,parameters,inputs)
++	end
++
++
++end# }}}
++
+ #Analyses
+ function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+ 	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
+@@ -333,10 +358,44 @@
+ 	end
+ 
+ end#}}}
+-function Stressbalance(femmodel::FemModel)
++function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
++
++	#Fetch parameters relevant to solution sequence
++	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
++	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
++	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
++	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
++
++	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+ 	error("STOP")
+-end
+ 
++end #}}}
++function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
++
++	#Initialize number of iterations
++	count = 0
++	converged = false
++
++	#Get existing solution
++	ug = GetSolutionFromInputsx(analysis,femmodel)
++
++	#Loop until we reach convergence
++	while(~converged)
++
++		error("not implemented yet")
++
++		#Increase count
++		count += 1
++		if(count>maxiter)
++			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
++			converged = true
++		end
++	end
++
++	error("STOP")
++
++end# }}}
++
+ #Element functions
+ function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
+ 	if size(data,1)==inputs.numberofelements
+@@ -359,3 +418,15 @@
+ 		error("not supported yet")
+ 	end
+ end #}}}
++function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) # {{{
++
++   #Configure vertices
++   for i in 1:3
++      element.vertices[i] = vertices[element.vertexids[i]]
++   end
++
++	#Point to real datasets
++	element.parameters = parameters
++	element.inputs     = inputs
++	
++end # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26622-26623.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26622-26623.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26622-26623.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26622)
++++ ../trunk-jpl/src/c/cores/controladm1qn3_core.cpp	(revision 26623)
+@@ -421,8 +421,8 @@
+ 			}
+ 			tape_codi.setGradient(codi_global.output_indices[dep_index],1.0);
+ 		}
+-		feclearexcept(FE_ALL_EXCEPT);
+-		feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
++		//feclearexcept(FE_ALL_EXCEPT);
++		//feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
+ 		tape_codi.evaluate();
+ 
+ 		/*Get gradient for this dependent */
+Index: ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 26622)
++++ ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 26623)
+@@ -10,10 +10,6 @@
+ 
+ int	ConfigureObjectsx( Elements* elements, Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters,Inputs* inputs){
+ 
+-	/*Get analysis type: */
+-	int configuration_type;
+-	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+-
+ 	if(VerboseMProcessor()) _printf0_("      Configuring elements...\n");
+ 	for(Object* & object : elements->objects){
+ 		Element* element=xDynamicCast<Element*>(object);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26623-26624.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26623-26624.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26623-26624.diff	(revision 26740)
@@ -0,0 +1,69 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmap2.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmap2.m	(revision 26623)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmap2.m	(revision 26624)
+@@ -17,7 +17,14 @@
+ %   Usage:
+ %      [dataout] = interpBedmap2(X,Y,string)
+ 
+-nc = '/home/ModelData/Antarctica/BedMap2/bedmap2_bin/Bedmap2.nc';
++switch (oshostname()),
++	case {'ronne'}
++		nc = '/home/ModelData/Antarctica/BedMap2/bedmap2_bin/Bedmap2.nc';
++	case {'totten'}
++		nc = '/totten_1/ModelData/Antarctica/BedMap2/bedmap2_bin/Bedmap2.nc';
++	otherwise
++		error('hostname not supported yet');
++end
+ if exist(nc,'file')
+ 	if strcmp(string,'thickness_uncertainty_5km')
+ 		xdata = double(ncread(nc,'x_5km'));
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpGeoid.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpGeoid.m	(revision 26623)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpGeoid.m	(revision 26624)
+@@ -5,6 +5,8 @@
+ 		rootname=[jplsvn() '/proj-morlighem/DatasetGreenland/Data/Geoid/eigen-6c4-1970.mat'];
+ 	case {'ronne'}
+ 		rootname='/home/ModelData/Global/Geoid/eigen-6c4-1970.mat';
++	case {'totten'}
++		rootname='/totten_1/ModelData/Global/Geoid/eigen-6c4-1970.mat';
+ 	otherwise
+ 		error('machine not supported yet');
+ end
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRACMOant.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRACMOant.m	(revision 26623)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRACMOant.m	(revision 26624)
+@@ -1,6 +1,13 @@
+ function smb = interpRACMOant(x,y);
+ 
+-	smbfile = '/home/ModelData/Antarctica/RACMO2SMB/SMB_RACMO2.3_1979_2011.nc';
++switch oshostname(),
++	case {'ronne'}
++		smbfile = '/home/ModelData/Antarctica/RACMO2SMB/SMB_RACMO2.3_1979_2011.nc';
++	case {'totten'}
++		smbfile = '/totten_1/ModelData/Antarctica/RACMO2SMB/SMB_RACMO2.3_1979_2011.nc';
++	otherwise
++		error('machine not supported yet');
++end
+ 	LAT=ncread(smbfile,'lat2d')';
+ 	LON=ncread(smbfile,'lon2d')';
+ 	SMB=ncread(smbfile,'SMB')';
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpSmith2020.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpSmith2020.m	(revision 26623)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpSmith2020.m	(revision 26624)
+@@ -32,6 +32,12 @@
+ 		else
+ 			path='/home/ModelData/Antarctica/DHDTSmith/';
+ 		end
++	case {'totten'}
++		if strcmp(string,'gris_filt') | strcmp(string,'gris')
++			path='/totten_1/ModelData/Greenland/DHDTSmith/';
++		else
++			path='/totten_1/ModelData/Antarctica/DHDTSmith/';
++		end
+ 	case {'recruta'}
+ 		path='/home/santos/ModelData/ICESat1_ICESat2_mass_change/';
+ 	otherwise
Index: /issm/oecreview/Archive/25834-26739/ISSM-26624-26625.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26624-26625.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26624-26625.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m	(revision 26624)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m	(revision 26625)
+@@ -3,6 +3,8 @@
+ switch oshostname(),
+ 	case {'ronne'}
+ 		rootname='/ronne_2/home/ModelData/Global/DTU19MDT/dtu19mdt.mat';
++	case {'totten'}
++		rootname='/totten_1/ModelData/Global/DTU19MDT/dtu19mdt.mat';
+ 	otherwise
+ 		error('machine not supported yet');
+ end
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpREMA.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpREMA.m	(revision 26624)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpREMA.m	(revision 26625)
+@@ -3,6 +3,8 @@
+ switch oshostname(),
+ 	case {'ronne'}
+ 		remapath='/home/ModelData/Antarctica/REMA/REMA_200m_dem_filled.tif';
++	case {'totten'}
++		remapath='/totten_1/ModelData/Antarctica/REMA/REMA_200m_dem_filled.tif';
+ 	otherwise
+ 		error('machine not supported yet');
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26625-26626.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26625-26626.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26625-26626.diff	(revision 26740)
@@ -0,0 +1,255 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26625)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26626)
+@@ -1237,6 +1237,91 @@
+ 	return this->element_type;
+ }
+ /*}}}*/
++void       Penta::GetFractionGeometry2D(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){/*{{{*/
++
++  /*Compute portion of element that is grounded based on levelset at the 3 lower vertices of the Penta element*/
++   bool               trapezeisnegative=true;
++   int                point;
++   const IssmPDouble  epsilon= 1.e-15;
++   IssmDouble         f1,f2,phi;
++
++   /*Weights*/
++   Gauss* gauss = NULL;
++   IssmDouble loadweights_g[NUMVERTICES2D];
++   IssmDouble total_weight = 0;
++
++   _assert_(!xIsNan<IssmDouble>(gl[0]));
++   _assert_(!xIsNan<IssmDouble>(gl[1]));
++   _assert_(!xIsNan<IssmDouble>(gl[2]));
++
++   /*Be sure that values are not zero*/
++   if(gl[0]==0.) gl[0] = gl[0]+epsilon;
++   if(gl[1]==0.) gl[1] = gl[1]+epsilon;
++   if(gl[2]==0.) gl[2] = gl[2]+epsilon;
++
++   /*Check that not all nodes are positive or negative: */
++   if(gl[0]>0 && gl[1]>0 && gl[2]>0){
++      point = 0;
++      f1    = 1.;
++      f2    = 1.;
++   }
++   else if(gl[0]<0 && gl[1]<0 && gl[2]<0){
++      point = 0;
++      f1    = 0.;
++      f2    = 0.;
++   }
++	else{
++		if(gl[0]*gl[1]*gl[2]<0) trapezeisnegative = false;
++
++		/*Find the similar nodes*/
++		if(gl[0]*gl[1]>0){ 
++			point = 2;
++			f1    = gl[2]/(gl[2]-gl[0]);
++			f2    = gl[2]/(gl[2]-gl[1]);
++		}
++		else if(gl[1]*gl[2]>0){ 
++			point = 0;
++			f1    = gl[0]/(gl[0]-gl[1]);
++			f2    = gl[0]/(gl[0]-gl[2]);
++		}
++		else if(gl[0]*gl[2]>0){ 
++			point = 1;
++			f1    = gl[1]/(gl[1]-gl[2]);
++			f2    = gl[1]/(gl[1]-gl[0]);
++		}
++		else _error_("case not possible");
++	}
++	if(trapezeisnegative) phi = 1-f1*f2;
++	else                  phi = f1*f2;
++	
++	/*Compute weights*/
++	gauss = this->NewGauss(point,f1,f2,trapezeisnegative,2);
++
++	total_weight = 0.0;
++	for(int i=0;i<NUMVERTICES2D;i++)weights[i] = 0;
++	while(gauss->next()){
++		GetNodalFunctions(&loadweights_g[0],gauss,P1Enum);
++		for(int i=0;i<NUMVERTICES2D;i++)weights[i] += loadweights_g[i]*gauss->weight;
++		total_weight += gauss->weight;
++	}
++
++	/*Normalize to phi*/
++	if(total_weight>0.){
++		for(int i=0;i<NUMVERTICES2D;i++) weights[i] = weights[i]*phi/total_weight;
++	}
++	else for(int i=0;i<NUMVERTICES2D;i++) weights[i] = 0.0;
++
++	/*Cleanup*/
++	delete gauss;
++	
++	/*Assign output pointers*/
++	*pphi               = phi;
++	*ppoint1            = point;
++	*pfraction1         = f1;
++	*pfraction2         = f2;
++	*ptrapezeisnegative = trapezeisnegative;
++}
++/*}}}*/
+ void       Penta::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){/*{{{*/
+ 	/*Computeportion of the element that is grounded*/
+ 
+@@ -2098,25 +2183,62 @@
+ 	/*The volume of a troncated prism is base * 1/3 sum(length of edges)*/
+ 	IssmDouble base,height,scalefactor;
+ 	IssmDouble xyz_list[NUMVERTICES][3];
++	IssmDouble lsf[NUMVERTICES];
+ 
+ 	if(!IsIceInElement())return 0;
+ 
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 
+-	/*First calculate the area of the base (cross section triangle)
+-	 * http://en.wikipedia.org/wiki/Pentangle
+-	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+-	base = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
++	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
++	/*Deal with partially ice-covered elements*/
++	if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++		bool        istrapneg;
++		int         point;
++		IssmDouble  f1,f2,phi;
++		IssmDouble* heights = xNew<IssmDouble>(NUMVERTICES2D);
++		IssmDouble  weights[NUMVERTICES2D];
++		IssmDouble  lsf2d[NUMVERTICES2D];
++		for(int i=0;i<NUMVERTICES2D;i++){
++			heights[i] = xyz_list[i+NUMVERTICES2D][2]-xyz_list[i][2];
++			lsf2d[i]   = lsf[i];
++		}
++		GetFractionGeometry2D(weights,&phi,&point,&f1,&f2,&istrapneg,lsf2d);
++		
++		IssmDouble basetot;
++		height = 0.0;
++		for(int i=0;i<NUMVERTICES2D;i++) height += weights[i]*heights[i];
++		basetot = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
++		base    = basetot*phi;	
++	
++		/*Account for scaling factor averaged over subelement 2D area*/
++		if(scaled==true){
++			IssmDouble* scalefactor_vertices   = xNew<IssmDouble>(NUMVERTICES);
++			Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
++			/*Compute loop only over lower vertices: i<NUMVERTICES2D*/
++			scalefactor = 0.0;
++			for(int i=0;i<NUMVERTICES2D;i++) scalefactor += weights[i]*scalefactor_vertices[i];
++			base = base*scalefactor;
++			xDelete<IssmDouble>(scalefactor_vertices);
++		}
++		xDelete<IssmDouble>(heights); 
++	}
+ 
+-	if(scaled==true){ //scale for area projection correction
+-		Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
+-		scalefactor_input->GetInputAverage(&scalefactor);
+-		base=base*scalefactor;
++	else{ 
++		/*First calculate the area of the base (cross section triangle)
++		 * http://en.wikipedia.org/wiki/Pentangle
++		 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
++		base = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
++	
++		if(scaled==true){ //scale for area projection correction
++			Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
++			scalefactor_input->GetInputAverage(&scalefactor);
++			base=base*scalefactor;
++		}
++	
++		/*Now get the average height*/
++		height = 1./3.*((xyz_list[3][2]-xyz_list[0][2])+(xyz_list[4][2]-xyz_list[1][2])+(xyz_list[5][2]-xyz_list[2][2]));
+ 	}
+ 
+-	/*Now get the average height*/
+-	height = 1./3.*((xyz_list[3][2]-xyz_list[0][2])+(xyz_list[4][2]-xyz_list[1][2])+(xyz_list[5][2]-xyz_list[2][2]));
+-
+ 	/*Return: */
+ 	return base*height;
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26625)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 26626)
+@@ -85,6 +85,7 @@
+ 		void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
+ 		IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
+ 		void           GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){_error_("not implemented yet");};
++		void           GetFractionGeometry2D(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl);
+ 		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area,  int levelsetenum){_error_("not implemented yet");};
+ 		void       GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum){_error_("not implemented yet");};
+ 		void        GetBarycenterFromLevelset(IssmDouble* platbar, IssmDouble* plongbar,IssmDouble phi,IssmDouble fraction1,IssmDouble fraction2,IssmDouble late, IssmDouble longe, int point1,int istrapeze1, IssmDouble planetradius){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26625)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26626)
+@@ -3488,6 +3488,7 @@
+ 	int domaintype;
+ 	parameters->FindParam(&domaintype,DomainTypeEnum);
+ 
++	/*Relict code
+ 	if(false && IsIcefront()){
+ 		//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.
+@@ -3542,7 +3543,46 @@
+ 		Haverage=0.;
+ 		for(i=0;i<numthk;i++)	Haverage+=H[i];
+ 		Haverage/=IssmDouble(numthk);
+-	}
++	}*/
++
++   IssmDouble* lsf = xNew<IssmDouble>(NUMVERTICES);
++   Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
++   /*Deal with partially ice-covered elements*/
++	if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++		bool istrapneg;
++      int point;
++      IssmDouble* weights  = xNew<IssmDouble>(NUMVERTICES);
++      IssmDouble* surfaces = xNew<IssmDouble>(NUMVERTICES);
++      IssmDouble* bases    = xNew<IssmDouble>(NUMVERTICES);
++      IssmDouble* Hice     = xNew<IssmDouble>(NUMVERTICES);
++      IssmDouble area_basetot,f1,f2,phi;
++      /*Average thickness over subelement*/
++		Element::GetInputListOnVertices(&surfaces[0],SurfaceEnum);
++      Element::GetInputListOnVertices(&bases[0],BaseEnum);
++      GetFractionGeometry(weights,&phi,&point,&f1,&f2,&istrapneg,lsf);
++      for(int i=0;i<NUMVERTICES;i++) Hice[i] = surfaces[i]-bases[i];
++      Haverage = 0.0;
++      for(int i=0;i<NUMVERTICES;i++) Haverage += weights[i]*Hice[i];
++		/*Get back area of ice-covered base*/
++		area_basetot = this->GetArea();
++		area_base    = phi*area_basetot;
++
++		/*Account for scaling factor averaged over subelement*/
++		if(scaled==true){
++			IssmDouble* scalefactor_vertices = xNew<IssmDouble>(NUMVERTICES);
++			Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
++			scalefactor = 0.0;
++			for(int i=0;i<NUMVERTICES;i++) scalefactor += weights[i]*scalefactor_vertices[i];
++			area_base = area_base*scalefactor;
++			xDelete<IssmDouble>(scalefactor_vertices);
++		}
++
++		/*Cleanup*/
++		xDelete<IssmDouble>(weights);
++		xDelete<IssmDouble>(surfaces);
++		xDelete<IssmDouble>(bases);
++		xDelete<IssmDouble>(Hice);
++   }
+ 	else{
+ 		/*First get back the area of the base*/
+ 		area_base=this->GetArea();
+@@ -3560,10 +3600,12 @@
+ 		Haverage=surface-base;
+ 	}
+ 
++	
+ 	/*Cleanup & return: */
+ 	xDelete<int>(indices);
+ 	xDelete<IssmDouble>(H);
+ 	xDelete<IssmDouble>(SF);
++	xDelete<IssmDouble>(lsf);
+ 
+ 	if(domaintype==Domain2DverticalEnum){
+ 	  return area_base;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26626-26627.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26626-26627.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26626-26627.diff	(revision 26740)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpIBCSO.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpIBCSO.m	(revision 26626)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpIBCSO.m	(revision 26627)
+@@ -5,6 +5,9 @@
+ 	case {'ronne'}
+ 		ncpath='/home/ModelData/Antarctica/IBCSO/ibcso_v1_bed.grd';
+ 		sidpath='/home/ModelData/Antarctica/IBCSO/ibcso_v1_sid.grd';
++	case {'totten'}
++		ncpath='/totten_1/ModelData/Antarctica/IBCSO/ibcso_v1_bed.grd';
++		sidpath='/totten_1/ModelData/Antarctica/IBCSO/ibcso_v1_sid.grd';
+ 	otherwise
+ 		error('hostname not supported yet');
+ end
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m	(revision 26626)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m	(revision 26627)
+@@ -4,6 +4,8 @@
+ switch (oshostname()),
+ 	case {'ronne'}
+ 		nc = '/home/ModelData/Antarctica/MouginotVel/vel_nsidc.CF16_2.nc';
++	case {'totten'}
++		nc = '/totten_1/ModelData/Antarctica/MouginotVel/vel_nsidc.CF16_2.nc';
+ 	otherwise
+ 		error('hostname not supported yet');
+ end
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRTopo2.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRTopo2.m	(revision 26626)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRTopo2.m	(revision 26627)
+@@ -10,6 +10,8 @@
+ switch oshostname(),
+ 	case {'ronne'}
+ 		rootname='/home/ModelData/Global/RTopo-2/RTopo-2.0.1_30sec_bedrock_topography.nc';
++	case {'totten'}
++		rootname='/totten_1/ModelData/Global/RTopo-2/RTopo-2.0.1_30sec_bedrock_topography.nc';
+ 	otherwise
+ 		error('machine not supported yet');
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26627-26628.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26627-26628.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26627-26628.diff	(revision 26740)
@@ -0,0 +1,121 @@
+Index: ../trunk-jpl/src/jl/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve.jl	(revision 26627)
++++ ../trunk-jpl/src/jl/solve.jl	(revision 26628)
+@@ -134,6 +134,26 @@
+ 	sdoflist::Vector{Int64}
+ 	svalues::Vector{Float64}
+ end# }}}
++function Base.show(io::IO, this::Node)# {{{
++
++	println(io,"Node:")
++	println(io,"   id:  ",this.id)
++	println(io,"   sid: ",this.sid)
++	println(io,"   indexingupdate: ",this.indexingupdate)
++	println(io,"   gsize: ",this.gsize)
++	println(io,"   gdoflist: ",this.gdoflist)
++	println(io,"   fdoflist: ",this.fdoflist)
++	println(io,"   sdoflist: ",this.sdoflist)
++	println(io,"   svalues: ",this.svalues)
++end# }}}
++function ApplyConstraint(node::Node,dof::Int8,value::Float64) #{{{
++
++	node.indexingupdate = true
++	node.fdoflist[dof]  = -1
++	node.sdoflist[dof]  = +1
++	node.svalues[dof]   = value
++
++end# }}}
+ struct Constraint #{{{
+ 	id::Int64
+ 	nodeid::Int64
+@@ -140,6 +160,15 @@
+ 	dof::Int8
+ 	value::Float64
+ end# }}}
++function ConstrainNode(constraint::Constraint,nodes::Vector{Node},parameters::Parameters) #{{{
++
++	#Chase through nodes and find the node to which this SpcStatic apply
++	node = nodes[constraint.nodeid]
++
++	#Apply Constraint
++	ApplyConstraint(node,constraint.dof,constraint.value)
++
++end# }}}
+ mutable struct Vertex#{{{
+ 	sid::Int64
+ 	x::Float64
+@@ -253,6 +282,11 @@
+ 	#Configure objects
+ 	ConfigureObjectx(elements,nodes,vertices,parameters,inputs)
+ 
++	#Constrain and Number nodes
++	SpcNodesx(nodes,constraints,parameters)
++	NodesDofx(nodes,parameters)
++   error("STOP")
++
+ 	#Build FemModel
+ 	return FemModel(elements,vertices,nodes,parameters,inputs,constraints)
+ end# }}}
+@@ -264,11 +298,17 @@
+ 	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
+ 	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
+ 	tempvertices = Vector{Vertex}(undef,3)
+-	tempnodes    = Vector{Node}(undef,0)
++	tempnodes    = Vector{Node}(undef,3)
+ 
+ 	count = 0
+ 	for i in 1:md.mesh.numberofelements
+-		push!(elements,Tria(i,count,md.mesh.elements[i,:],tempvertices,Vector{Int64}(undef,0),tempnodes,tempparams,tempinputs))
++
++		#Assume Linear Elements for now
++		vertexids = md.mesh.elements[i,:]
++		nodeids   = md.mesh.elements[i,:]
++
++		#Call constructor and add to dataset elements
++		push!(elements,Tria(i,count,vertexids,tempvertices,nodeids,tempnodes,tempparams,tempinputs))
+ 	end
+ 
+ end# }}}
+@@ -306,9 +346,20 @@
+ 		Configure(elements[i],nodes,vertices,parameters,inputs)
+ 	end
+ 
++end# }}}
++function SpcNodesx(nodes::Vector{Node},constraints::Vector{Constraint},parameters::Parameters) #{{{
+ 
++	for i in 1:length(constraints)
++		ConstrainNode(constraints[i],nodes,parameters)
++	end
++
+ end# }}}
++function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
+ 
++	error("not implemented yet")
++
++end# }}}
++
+ #Analyses
+ function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+ 	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
+@@ -320,7 +371,7 @@
+ 
+ 	numdof = 2
+ 	for i in 1:md.mesh.numberofvertices
+-		push!(nodes,Node(i,i,true,numdof,Vector{Int64}(undef,numdof), Vector{Int64}(undef,numdof), Vector{Int64}(undef,numdof), zeros(numdof)))
++		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+ 	end
+ end#}}}
+ function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+@@ -425,6 +476,11 @@
+       element.vertices[i] = vertices[element.vertexids[i]]
+    end
+ 
++	#Configure nodes (assuming P1 finite elements)
++	for i in 1:3
++		element.nodes[i] = nodes[element.nodeids[i]]
++	end
++
+ 	#Point to real datasets
+ 	element.parameters = parameters
+ 	element.inputs     = inputs
Index: /issm/oecreview/Archive/25834-26739/ISSM-26628-26629.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26628-26629.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26628-26629.diff	(revision 26740)
@@ -0,0 +1,5628 @@
+Index: ../trunk-jpl/src/jl/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/triangle.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/triangle.jl	(nonexistent)
+@@ -1,180 +0,0 @@
+-
+-#Class Triangle's triangulateio
+-mutable struct CTriangulateIO #{{{
+-
+-    pointlist :: Ptr{Cdouble}
+-    pointattributelist :: Ptr{Cdouble}
+-    pointmarkerlist :: Ptr{Cint}
+-    numberofpoints :: Cint
+-    numberofpointattributes :: Cint
+-    
+-    trianglelist :: Ptr{Cint}
+-    triangleattributelist :: Ptr{Cdouble}
+-    trianglearealist :: Ptr{Cdouble}
+-    neighborlist :: Ptr{Cint}
+-    numberoftriangles :: Cint
+-    numberofcorners :: Cint
+-    numberoftriangleattributes :: Cint
+-    
+-    segmentlist :: Ptr{Cint}
+-    segmentmarkerlist :: Ptr{Cint}
+-    numberofsegments :: Cint
+-
+-    holelist :: Ptr{Cdouble}
+-    numberofholes :: Cint
+-
+-    regionlist :: Ptr{Cdouble}
+-    numberofregions :: Cint
+-
+-    edgelist :: Ptr{Cint}
+-    edgemarkerlist :: Ptr{Cint}
+-    normlist :: Ptr{Cdouble}
+-    numberofedges :: Cint
+- end  #}}}
+-function CTriangulateIO() #{{{
+-	return CTriangulateIO(C_NULL, C_NULL, C_NULL, 0, 0,
+-								 C_NULL, C_NULL, C_NULL, C_NULL, 0, 0, 0,
+-								 C_NULL, C_NULL, 0,
+-								 C_NULL, 0,
+-								 C_NULL, 0,
+-								 C_NULL, C_NULL, C_NULL, 0)
+-end# }}}
+-function Base.show(io::IO, tio::CTriangulateIO)# {{{
+-	println(io,"CTriangulateIO(")
+-	for name in fieldnames(typeof(tio))
+-		a=getfield(tio,name)
+-		print(io,"$(name) = ")
+-		println(io,a)
+-	end
+-	println(io,")")
+-end# }}}
+-
+-using Printf #needed for sprintf
+-include("classes.jl")
+-include("exp.jl")
+-
+-"""
+-TRIANGLE - create model mesh using the triangle package
+-
+-	This function creates a model mesh using Triangle and a domain outline, to
+-	within a certain resolution
+-#Arguments
+- - md is a model tuple
+- - domainname is the name of an Argus domain outline file
+- - resolution:  is a characteristic length for the mesh (same unit as the domain outline unit)
+-
+-# Usage:
+- - md=triangle(md,domainname,resolution)
+-# Examples:
+- - md=triangle(md,'DomainOutline.exp',1000);
+- - md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
+-"""
+-function triangle(md::model,domainname::String,resolution::Float64) #{{{
+-
+-	#read input file
+-	contours = expread(domainname)
+-	area     = resolution^2
+-
+-	#Initialize i/o structures
+-	ctio_in  = CTriangulateIO();
+-	ctio_out = CTriangulateIO();
+-	vor_out  = CTriangulateIO();
+-
+-	#Construct input structure
+-	numberofpoints   = 0
+-	numberofsegments = 0
+-	for i in 1:length(contours)
+-		numberofpoints   += contours[i].nods-1
+-		numberofsegments += contours[i].nods-1
+-	end
+-	numberofpointattributes = 1
+-
+-	pointlist=Array{Cdouble,2}(undef,2,numberofpoints)
+-	count = 0
+-	for i in 1:length(contours)
+-		nods = contours[i].nods
+-		pointlist[1,count+1:count+nods-1] = contours[i].x[1:end-1]
+-		pointlist[2,count+1:count+nods-1] = contours[i].y[1:end-1]
+-		count += (nods-1)
+-	end
+-	pointattributelist=Array{Cdouble,1}(undef,numberofpoints)
+-	pointmarkerlist=Array{Cint,1}(undef,numberofpoints)
+-	for i in 1:numberofpoints
+-		pointmarkerlist[i]=0
+-		pointattributelist[i]=0.
+-	end
+-
+-	counter=0;
+-   backcounter=0;
+-	segmentlist=Array{Cint,2}(undef,2,numberofsegments)
+-	segmentmarkerlist=Array{Cint,1}(undef,numberofsegments)
+-	segmentmarkerlist[:].=0
+-	for i in 1:length(contours)
+-		nods = contours[i].nods
+-		segmentlist[1,counter+1:counter+nods-2] = collect(counter+0:counter+nods-3)
+-		segmentlist[2,counter+1:counter+nods-2] = collect(counter+1:counter+nods-2)
+-		counter+=nods-2
+-		#close profile
+-		segmentlist[1,counter+1]=counter
+-		segmentlist[2,counter+1]=backcounter
+-		counter+=1
+-		backcounter=counter
+-	end
+-
+-	numberofregions = 0
+-	numberofholes = length(contours)-1
+-	holelist = Array{Cdouble,2}(undef,2,numberofholes)
+-	if numberofholes>0
+-		 for i in 2:length(contours)
+-			 xA=contours[i].x[1]; xB=contours[i].x[end-1]
+-			 yA=contours[i].y[1]; yB=contours[i].y[end-1]
+-			 xC=(xA+xB)/2;        yC=(yA+yB)/2;
+-			 xD=xC+tan(10. /180. *pi)*(yC-yA);
+-			 yD=yC+tan(10. /180. *pi)*(xA-xC);
+-			 xE=xC-tan(10. /180. *pi)*(yC-yA);
+-			 yE=yC-tan(10. /180. *pi)*(xA-xC);
+-			 holelist[1,i-1] = xD
+-			 holelist[2,i-1] = yD
+-		 end
+-	end
+-
+-	#based on this, prepare input structure
+-	ctio_in.numberofpoints = numberofpoints
+-	ctio_in.pointlist=pointer(pointlist)
+-	ctio_in.numberofpointattributes=numberofpointattributes
+-	ctio_in.pointattributelist=pointer(pointattributelist)
+-	ctio_in.pointmarkerlist=pointer(pointmarkerlist)
+-	ctio_in.numberofsegments=numberofsegments
+-	ctio_in.segmentlist=pointer(segmentlist)
+-	ctio_in.segmentmarkerlist = pointer(segmentmarkerlist)
+-	ctio_in.numberofholes=numberofholes
+-	ctio_in.holelist=pointer(holelist)
+-	ctio_in.numberofregions=0
+-
+-	#Call triangle using ISSM's default options
+-	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
+-	#rc=ccall( (:triangulate,"libtriangle"),
+-	rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
+-				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
+-				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
+-
+-	#post process output
+-	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
+-	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
+-	segments  = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.segmentlist,  (2,Int(ctio_out.numberofsegments)), own=true))' .+1
+-	
+-	#assign output
+-	md.mesh = Mesh2dTriangle()
+-	md.mesh.numberofvertices = ctio_out.numberofpoints
+-	md.mesh.numberofelements = ctio_out.numberoftriangles
+-	md.mesh.x                = points[:,1]
+-	md.mesh.y                = points[:,2]
+-	md.mesh.elements         = triangles
+-	md.mesh.segments         = segments
+-
+-	#post processing
+-	md.mesh.vertexonboundary = zeros(Bool,md.mesh.numberofvertices)
+-	md.mesh.vertexonboundary[md.mesh.segments] .= true
+-
+-   return md
+-end#}}}
+Index: ../trunk-jpl/src/jl/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/utils.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/utils.jl	(nonexistent)
+@@ -1,108 +0,0 @@
+-#utils
+-function issmdir() #{{{
+-	issmdir = ENV["ISSM_DIR"]
+-
+-	if isempty(issmdir)
+-		error("Could not determine the location of ISSM")
+-	else
+-		return issmdir
+-	end
+-end#}}}
+-function archread(filename::String,variablename::String) #{{{
+-
+-	#initialize variables
+-	found = false
+-
+-	#open file
+-	output = open(filename, "r") do f
+-
+-		while !eof(f)
+-			reclen  = bswap(read(f, Int32))
+-			rectype = bswap(read(f, Int32))
+-			if rectype!=1
+-				error("Expected variable of type string")
+-			else
+-				fieldname_length = bswap(read(f, Int32))
+-				field_name = String(read(f, fieldname_length))
+-			end
+-			rec_length = bswap(read(f, Int32))
+-			field_type = bswap(read(f, Int32))
+-			if field_type==2
+-				data = bswap(read(f, Float64))
+-			elseif field_type==3
+-				rows = bswap(read(f, Int32))
+-				cols = bswap(read(f, Int32))
+-				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
+-				data .= ntoh.(data)
+-				data = reshape(data, (rows,cols))
+-				data = collect(data)
+-				if cols == 1
+-					data = vec(data)
+-				end
+-			else
+-				error("Error: Encountered invalid field type when reading data.")
+-			end
+-
+-			if field_name == variablename
+-				found = true
+-				return data
+-			end
+-		end
+-	end
+-
+-	return output
+-end# }}}
+-function InterpFromMeshToMesh2d(index::Array,x::Vector,y::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
+-	#prepare input arrays
+-	nods = Cint(length(x))
+-	nels = Cint(size(index,1))
+-	nods_interp = Cint(length(xout))
+-	Cindex=Array{Cint,1}(undef,length(index))
+-	for i in 1:size(index,1)
+-		for j in 1:3
+-			Cindex[(i-1)*3+j] = Int32(index[i,j])
+-		end
+-	end
+-	Cx    = Array{Cdouble,1}(undef,nods)
+-	Cy    = Array{Cdouble,1}(undef,nods)
+-	Cdata = Array{Cdouble,1}(undef,nods)
+-	for i in 1:nods
+-		Cx[i]    = x[i]
+-		Cy[i]    = y[i]
+-		Cdata[i] = data[i]
+-	end
+-	Cxout = Array{Cdouble,1}(undef,nods_interp)
+-	Cyout = Array{Cdouble,1}(undef,nods_interp)
+-	for i in 1:nods_interp
+-		Cxout[i] = xout[i]
+-		Cyout[i] = yout[i]
+-	end
+-
+-	Cdataout = Vector{Float64}(undef,nods_interp)
+-
+-	#This is not working....
+-	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
+-				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
+-				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
+-				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
+-
+-	#Process output
+-	dataout = Vector{Float64}(undef,nods_interp)
+-	for i in 1:nods_interp
+-		dataout[i] = Cdataout[i]
+-	end
+-
+-	return dataout
+-end #}}}
+-function solve(md::model,solution::String) #{{{
+-
+-	if solution=="sb" || solution=="Stressbalance"
+-		solutionstring = "StressbalanceSolution"
+-	else
+-		error("solutionstring "*solution*" not supported!");
+-	end
+-
+-	IssmCore(md)
+-
+-	return md
+-end #}}}
+Index: ../trunk-jpl/src/jl/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/exp.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/exp.jl	(nonexistent)
+@@ -1,137 +0,0 @@
+-#for exptool, look into this http://juliaplots.org/MakieReferenceImages/gallery//mouse_picking/index.html
+-
+-#exp object definition, constructor, and disp
+-mutable struct ExpStruct #{{{
+-	name::String
+-	nods::Int32
+-	density::Float64
+-	x::Vector{Float64}
+-   y::Vector{Float64}
+-	closed::Bool
+-end  #}}}
+-function ExpStruct() #{{{
+-	return ExpStruct("",0, 0., Vector{Float64}(undef,0), Vector{Float64}(undef,0), false)
+-end# }}}
+-function Base.show(io::IO, exp::ExpStruct)# {{{
+-
+-	compact = get(io, :compact, false)
+-
+-	println(io,"ExpStruct:")
+-	for name in fieldnames(typeof(exp))
+-		a=getfield(exp,name)
+-		print(io,"   $(name) = ")
+-		if !isempty(a)
+-			if compact && eltype(a)<:Number && length(a)>3
+-				println(io, typeof(a), " of size ", size(a))
+-			else
+-				println(io,a)
+-			end
+-		else
+-			println(io,"empty")
+-		end
+-	end
+-end# }}}
+-
+-#methods
+-#expread {{{
+-"""
+-	EXPREAD - read a file exp and build a Structure
+-
+-	This function reads an *.exp* and builds a structure containing the fields x
+-	and y corresponding to the coordinates, one for the filename of the exp
+-	file, for the density, for the nodes, and a field 'closed' to indicate if the
+-	domain is closed.
+-
+-	Usage:
+-		exp=expread(filename)
+-
+-# Examples:
+-```julia-repl
+-julia> exp=expread('domainoutline.exp')
+-```
+-
+-# Arguments:
+-- filename: the ARGUS file to read
+-"""
+-function expread(filename::String)
+-
+-	#initialize output
+-	contours = Vector{ExpStruct}(undef, 0)
+-
+-	#open file
+-	f = open(filename, "r") do f
+-
+-		#initialize some variables
+-		nprof = 0
+-		line = 1
+-
+-		while !eof(f)
+-
+-			#read first line
+-			A = readline(f); line += 1
+-
+-			#if isempty, go to the next line and try again
+-			if isempty(A)
+-				continue
+-			else
+-				#initialize new profile
+-				nprof += 1 
+-				exp = ExpStruct();
+-			end
+-
+-			#extract profile name
+-			if A[1:8]!="## Name:"
+-				println("line $(line): $(A)")
+-				error("Unexpected exp file formatting") 
+-			end
+-			if length(A)>8
+-				exp.name = A[9:end]
+-			end
+-
+-			#read Icon
+-			A = readline(f); line += 1
+-			if A[1:8]!="## Icon:" error("Unexpected exp file formatting") end
+-
+-			#read Info
+-			A = readline(f); line += 1
+-			if A[1:14]!="# Points Count"
+-				println("line $(line): $(A)")
+-				error("Unexpected exp file formatting") 
+-			end
+-
+-			#Reads number of nods and density
+-			A = readline(f); line += 1
+-			A = parse.(Float64, split(A))
+-			if length(A) != 2 error("Unexpected exp file formatting") end
+-			exp.nods = A[1]; exp.density = A[2]
+-
+-			#Allocate arrays
+-			if exp.nods<=0 error("Unexpected exp file formatting") end
+-			exp.x = Vector{Float64}(undef,exp.nods)
+-			exp.y = Vector{Float64}(undef,exp.nods)
+-
+-			#Read coordinates
+-			A = readline(f); line += 1
+-			if A[1:13]!="# X pos Y pos" error("Unexpected exp file formatting") end
+-			for i in 1:exp.nods
+-				A = readline(f); line += 1
+-				A = parse.(Float64, split(A))
+-				if length(A) != 2 error("Unexpected exp file formatting") end
+-				if any(isnan.(A)) error("NaNs found in coordinate") end
+-				exp.x[i] = A[1]; exp.y[i] = A[2]
+-			end
+-
+-			#check if closed
+-			if exp.nods>1 && exp.x[1]==exp.x[end] && exp.y[1]==exp.y[end]
+-				exp.closed = true
+-			else
+-				exp.closed = false
+-			end
+-
+-			#add profile to list
+-			push!(contours, exp)
+-		end
+-	end
+-
+-	return contours
+-end# }}}
+Index: ../trunk-jpl/src/jl/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/solve.jl	(nonexistent)
+@@ -1,488 +0,0 @@
+-include("classes.jl")
+-include("issmenums.jl")
+-
+-#define classes first
+-abstract type Parameter end
+-struct DoubleParam <: Parameter #{{{
+-	enum::IssmEnum
+-	value::Float64
+-end# }}}
+-function GetParameterValue(param::DoubleParam) #{{{
+-	return param.value
+-end#}}}
+-struct IntParam <: Parameter #{{{
+-	enum::IssmEnum
+-	value::Int64
+-end# }}}
+-function GetParameterValue(param::IntParam) #{{{
+-	return param.value
+-end#}}}
+-mutable struct Parameters #{{{
+-	lookup::Dict{IssmEnum,Parameter}
+-end# }}}
+-function AddParam(parameters::Parameters,value::Float64,enum::IssmEnum) #{{{
+-
+-	parameters.lookup[enum] = DoubleParam(enum,value)
+-
+-end#}}}
+-function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
+-
+-	parameters.lookup[enum] = IntParam(enum,value)
+-
+-end#}}}
+-function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
+-
+-	parameters.lookup[enum] = IntParam(enum,value)
+-
+-end#}}}
+-function FindParam(parameters::Parameters,enum::IssmEnum) #{{{
+-
+-	param = parameters.lookup[enum]
+-	return GetParameterValue(param)
+-
+-end#}}}
+-
+-abstract type Input end
+-struct BoolInput <: Input#{{{
+-	enum::IssmEnum
+-	values::Matrix{Bool}
+-end# }}}
+-struct IntInput <: Input#{{{
+-	enum::IssmEnum
+-	values::Matrix{Int64}
+-end# }}}
+-struct ElementInput <: Input#{{{
+-	enum::IssmEnum
+-	interp::IssmEnum
+-	values::Vector{Float64}
+-end# }}}
+-mutable struct Inputs #{{{
+-	numberofelements::Int64
+-	numberofvertices::Int64
+-	lookup::Dict{IssmEnum,Input}
+-end# }}}
+-function SetInput(inputs::Inputs,enum::IssmEnum,index::Int64,value::Bool) #{{{
+-
+-	#Does this input exist
+-	if !haskey(inputs.lookup,enum)
+-		#it does not exist yet, we need to create it...
+-		@assert inputs.numberofelements > 0
+-		input = BoolInput(enum,zeros(Bool,inputs.numberofelements))
+-		inputs.lookup[enum] = BoolInput(enum,zeros(Bool,inputs.numberofelements))
+-	end
+-
+-	#Get this input and check type
+-	input = inputs.lookup[enum]
+-	if typeof(input)!=BoolInput error("not consistent") end
+-
+-	#set value
+-	@assert index>0 && index<=inputs.numberofelements
+-	input.values[index] = value
+-end#}}}
+-function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int64,value::Float64) #{{{
+-
+-	#Does this input exist
+-	if !haskey(inputs.lookup,enum)
+-		#it does not exist yet, we need to create it...
+-		@assert inputs.numberofelements > 0
+-		if interp==P0Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements))
+-		elseif interp==P1Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
+-		else
+-			error("not supported yet")
+-		end
+-	end
+-
+-	#Get this input and check type
+-	input = inputs.lookup[enum]
+-	if typeof(input)!=ElementInput error("input type not consistent") end
+-	if interp!=input.interp        error("input interpolations not consistent") end
+-
+-	#set value
+-	input.values[index] = value
+-end#}}}
+-function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int64},values::Vector{Float64}) #{{{
+-
+-	#Does this input exist
+-	if !haskey(inputs.lookup,enum)
+-		#it does not exist yet, we need to create it...
+-		@assert inputs.numberofvertices>0
+-		if interp==P1Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
+-		else
+-			error("not supported yet")
+-		end
+-	end
+-
+-	#Get this input and check type
+-	input = inputs.lookup[enum]
+-	if typeof(input)!=ElementInput error("input type not consistent") end
+-	if interp!=input.interp        error("input interpolations not consistent") end
+-
+-	#set value
+-	input.values[indices] = values
+-end#}}}
+-
+-mutable struct Node #{{{
+-	id::Int64
+-	sid::Int64
+-	indexingupdate::Bool
+-	gsize::Int64
+-	gdoflist::Vector{Int64}
+-	fdoflist::Vector{Int64}
+-	sdoflist::Vector{Int64}
+-	svalues::Vector{Float64}
+-end# }}}
+-function Base.show(io::IO, this::Node)# {{{
+-
+-	println(io,"Node:")
+-	println(io,"   id:  ",this.id)
+-	println(io,"   sid: ",this.sid)
+-	println(io,"   indexingupdate: ",this.indexingupdate)
+-	println(io,"   gsize: ",this.gsize)
+-	println(io,"   gdoflist: ",this.gdoflist)
+-	println(io,"   fdoflist: ",this.fdoflist)
+-	println(io,"   sdoflist: ",this.sdoflist)
+-	println(io,"   svalues: ",this.svalues)
+-end# }}}
+-function ApplyConstraint(node::Node,dof::Int8,value::Float64) #{{{
+-
+-	node.indexingupdate = true
+-	node.fdoflist[dof]  = -1
+-	node.sdoflist[dof]  = +1
+-	node.svalues[dof]   = value
+-
+-end# }}}
+-struct Constraint #{{{
+-	id::Int64
+-	nodeid::Int64
+-	dof::Int8
+-	value::Float64
+-end# }}}
+-function ConstrainNode(constraint::Constraint,nodes::Vector{Node},parameters::Parameters) #{{{
+-
+-	#Chase through nodes and find the node to which this SpcStatic apply
+-	node = nodes[constraint.nodeid]
+-
+-	#Apply Constraint
+-	ApplyConstraint(node,constraint.dof,constraint.value)
+-
+-end# }}}
+-mutable struct Vertex#{{{
+-	sid::Int64
+-	x::Float64
+-	y::Float64
+-end# }}}
+-mutable struct Tria #{{{
+-	sid::Int64
+-	pid::Int64
+-	#vertexids::Int64[3]
+-	#vertices::Vertex[3]
+-	vertexids::Vector{Int64}
+-	vertices::Vector{Vertex}
+-	nodeids::Vector{Int64}
+-	nodes::Vector{Node}
+-	parameters::Parameters
+-	inputs::Inputs
+-end# }}}
+-mutable struct FemModel #{{{
+-	elements::Vector{Tria}
+-	vertices::Vector{Vertex}
+-	nodes::Vector{Node}
+-	parameters::Parameters
+-	inputs::Inputs
+-	constraints::Vector{Constraint}
+-	#loads::Vector{Loads}
+-end#}}}
+-struct GaussTria #{{{
+-	numgauss::Int64
+-	weights::Vector{Float64}
+-	coords1::Vector{Float64}
+-	coords2::Vector{Float64}
+-	coords3::Vector{Float64}
+-end #}}}
+-function GaussTria(order::Int64) #{{{
+-
+-	#=Gauss quadrature points for the triangle.
+-	Higher-order points from D.A. Dunavant, "High Degree Efficient
+-	Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
+-	Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.=#
+-
+-	if(order==1)
+-		npoints = 1
+-		weights = [1.732050807568877]
+-		coords1 = [0.333333333333333]
+-		coords2 = [0.333333333333333]
+-		coords3 = [0.333333333333333]
+-	elseif(order==2)
+-		weights = [0.577350269189625, 0.577350269189625, 0.577350269189625]
+-		coords1 = [0.666666666666667, 0.166666666666667, 0.166666666666667]
+-		coords2 = [0.166666666666667, 0.666666666666667, 0.166666666666667]
+-		coords3 = [0.166666666666667, 0.166666666666667, 0.666666666666667]
+-	elseif(order==3)
+-		npoints=4
+-		weights = [-0.974278579257493, 0.902109795608790, 0.902109795608790, 0.902109795608790]
+-		coords1 = [0.333333333333333, 0.600000000000000, 0.200000000000000, 0.200000000000000]
+-		coords2 = [0.333333333333333, 0.200000000000000, 0.600000000000000, 0.200000000000000]
+-		coords3 = [0.333333333333333, 0.200000000000000, 0.200000000000000, 0.600000000000000]
+-	else
+-		error("order ",order," not supported yet");
+-	end
+-
+-	return GaussTria(npoints,weights,coords1,coords2,coords3)
+-end# }}}
+-
+-abstract type Analysis end
+-struct StressbalanceAnalysis <: Analysis#{{{
+-end #}}}
+-
+-#Modules
+-function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
+-	for i in 1:length(elements)
+-		InputCreate(elements[i],inputs,data,enum)
+-	end
+-end#}}}
+-function IssmCore(md::model) #{{{
+-	
+-	#Construct FemModel
+-	femmodel=ModelProcessor(md)
+-
+-	#Solve
+-	analysis = StressbalanceAnalysis()
+-	Core(analysis,femmodel)
+-
+-	#then what??
+-	error("STOP")
+-
+-end# }}}
+-function ModelProcessor(md::model) #{{{
+-
+-	#Initialize structures
+-	elements    = Vector{Tria}(undef,0)
+-	vertices    = Vector{Vertex}(undef,0)
+-	nodes       = Vector{Node}(undef,0)
+-	constraints = Vector{Constraint}(undef,0)
+-	parameters  = Parameters(Dict{IssmEnum,Parameter}())
+-	inputs      = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
+-
+-	#Create  elements, vertices and materials (independent of the analysis)
+-	CreateElements(elements,md)
+-	CreateVertices(vertices,md)
+-	CreateParameters(parameters,md)
+-	CreateInputs(inputs,elements,md)
+-
+-	#Now create analysis specific data structure
+-	analysis = StressbalanceAnalysis()
+-	UpdateParameters(analysis,parameters,md)
+-	CreateNodes(analysis,nodes,md)
+-	UpdateElements(analysis,elements,inputs,md)
+-	CreateConstraints(analysis,constraints,md)
+-
+-	#Configure objects
+-	ConfigureObjectx(elements,nodes,vertices,parameters,inputs)
+-
+-	#Constrain and Number nodes
+-	SpcNodesx(nodes,constraints,parameters)
+-	NodesDofx(nodes,parameters)
+-   error("STOP")
+-
+-	#Build FemModel
+-	return FemModel(elements,vertices,nodes,parameters,inputs,constraints)
+-end# }}}
+-function CreateElements(elements::Vector{Tria},md::model) #{{{
+-
+-	#Make sure elements is currently empty
+-	@assert length(elements)==0
+-
+-	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
+-	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
+-	tempvertices = Vector{Vertex}(undef,3)
+-	tempnodes    = Vector{Node}(undef,3)
+-
+-	count = 0
+-	for i in 1:md.mesh.numberofelements
+-
+-		#Assume Linear Elements for now
+-		vertexids = md.mesh.elements[i,:]
+-		nodeids   = md.mesh.elements[i,:]
+-
+-		#Call constructor and add to dataset elements
+-		push!(elements,Tria(i,count,vertexids,tempvertices,nodeids,tempnodes,tempparams,tempinputs))
+-	end
+-
+-end# }}}
+-function CreateVertices(vertices::Vector{Vertex},md::model) #{{{
+-
+-	#Make sure vertices is currently empty
+-	@assert length(vertices)==0
+-
+-	#Get data from md
+-	x = md.mesh.x
+-	y = md.mesh.y
+-
+-	count = 0
+-	for i in 1:md.mesh.numberofvertices
+-		push!(vertices,Vertex(i,x[i],y[i]))
+-	end
+-
+-end# }}}
+-function CreateParameters(parameters::Parameters,md::model) #{{{
+-
+-	#Get data from md
+-	AddParam(parameters,md.materials.rho_ice,MaterialsRhoIceEnum)
+-	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
+-	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
+-end# }}}
+-function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
+-
+-	#Only assume we have Matice for now
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
+-end# }}}
+-function ConfigureObjectx(elements::Vector{Tria},nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) #{{{
+-
+-	for i in 1:length(elements)
+-		Configure(elements[i],nodes,vertices,parameters,inputs)
+-	end
+-
+-end# }}}
+-function SpcNodesx(nodes::Vector{Node},constraints::Vector{Constraint},parameters::Parameters) #{{{
+-
+-	for i in 1:length(constraints)
+-		ConstrainNode(constraints[i],nodes,parameters)
+-	end
+-
+-end# }}}
+-function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
+-
+-	error("not implemented yet")
+-
+-end# }}}
+-
+-#Analyses
+-function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+-	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
+-	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
+-	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
+-	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
+-end#}}}
+-function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
+-
+-	numdof = 2
+-	for i in 1:md.mesh.numberofvertices
+-		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+-	end
+-end#}}}
+-function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+-
+-	#Provide node indices to element
+-	for i in 1:md.mesh.numberofvertices
+-		Update(elements[i],inputs,i,md,P1Enum)
+-	end
+-
+-	#Add necessary inputs to perform this analysis
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
+-	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+-	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
+-
+-end#}}}
+-function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
+-
+-	#load constraints from model
+-	spcvx = md.stressbalance.spcvx
+-	spcvy = md.stressbalance.spcvy
+-
+-	count = 1
+-	for i in 1:md.mesh.numberofvertices
+-		if ~isnan(spcvx[i])
+-			push!(constraints,Constraint(count,i,1,spcvx[i]))
+-			count+=1
+-		end
+-		if ~isnan(spcvy[i])
+-			push!(constraints,Constraint(count,i,2,spcvy[i]))
+-			count+=1
+-		end
+-	end
+-
+-end#}}}
+-function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+-
+-	#Fetch parameters relevant to solution sequence
+-	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
+-	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
+-	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
+-	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
+-
+-	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+-	error("STOP")
+-
+-end #}}}
+-function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
+-
+-	#Initialize number of iterations
+-	count = 0
+-	converged = false
+-
+-	#Get existing solution
+-	ug = GetSolutionFromInputsx(analysis,femmodel)
+-
+-	#Loop until we reach convergence
+-	while(~converged)
+-
+-		error("not implemented yet")
+-
+-		#Increase count
+-		count += 1
+-		if(count>maxiter)
+-			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
+-			converged = true
+-		end
+-	end
+-
+-	error("STOP")
+-
+-end# }}}
+-
+-#Element functions
+-function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
+-	if size(data,1)==inputs.numberofelements
+-		SetTriaInput(inputs,enum,P0Enum,element.sid,data[element.sid])
+-	elseif size(data,1)==inputs.numberofvertices
+-		SetTriaInput(inputs,enum,P1Enum,element.vertexids,data[element.vertexids])
+-	else
+-		error("size ",size(data,1)," not supported yet");
+-	end
+-end #}}}
+-function Update(element::Tria,inputs::Inputs,index::Int64,md::model,finiteelement::IssmEnum) #{{{
+-
+-	if finiteelement==P1Enum
+-		numnodes = 3
+-		element.nodeids    = Vector{Int64}(undef,numnodes)
+-		element.nodeids[1] = md.mesh.elements[index,1]
+-		element.nodeids[2] = md.mesh.elements[index,2]
+-		element.nodeids[3] = md.mesh.elements[index,3]
+-	else
+-		error("not supported yet")
+-	end
+-end #}}}
+-function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) # {{{
+-
+-   #Configure vertices
+-   for i in 1:3
+-      element.vertices[i] = vertices[element.vertexids[i]]
+-   end
+-
+-	#Configure nodes (assuming P1 finite elements)
+-	for i in 1:3
+-		element.nodes[i] = nodes[element.nodeids[i]]
+-	end
+-
+-	#Point to real datasets
+-	element.parameters = parameters
+-	element.inputs     = inputs
+-	
+-end # }}}
+Index: ../trunk-jpl/src/jl/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/classes.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/classes.jl	(nonexistent)
+@@ -1,164 +0,0 @@
+-using Printf
+-
+-abstract type AbstractMesh end
+-mutable struct Mesh2dTriangle <: AbstractMesh
+-	numberofvertices::Int64
+-	numberofelements::Int64
+-	x::Vector{Float64}
+-	y::Vector{Float64}
+-	elements::Matrix{Int64}
+-	segments::Matrix{Int64}
+-	vertexonboundary::Vector{Bool}
+-end
+-function Mesh2dTriangle() #{{{
+-	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+-end# }}}
+-function Base.show(io::IO, this::Mesh2dTriangle)# {{{
+-
+-	println(io,typeof(this),":")
+-	for name in fieldnames(typeof(this))
+-		a=getfield(this,name)
+-		#print(io,"   $(name) = ")
+-		@printf "%19s: " name
+-		if isa(a,String)
+-			println(io, a)
+-		elseif length(a)>1
+-			if !isempty(a)
+-				println(io, typeof(a), " of size ", size(a))
+-			else
+-				println(io,"empty")
+-			end
+-		else
+-			println(io, a)
+-		end
+-	end
+-end# }}}
+-mutable struct Mesh3dPrism{T} <: AbstractMesh
+-	numberofvertices::Int64
+-	numberofelements::Int64
+-	numberoflayers::Int64
+-	x::Vector{Float64}
+-	y::Vector{Float64}
+-	z::Vector{Float64}
+-	elements::Matrix{Int64}
+-	segments::Matrix{Int64}
+-	vertexonboundary::Vector{Bool}
+-end
+-function Mesh3dPrism() #{{{
+-	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+-end# }}}
+-
+-mutable struct Geometry
+-	surface::Vector{Float64}
+-	base::Vector{Float64}
+-	thickness::Vector{Float64}
+-	bed::Vector{Float64}
+-end
+-function Geometry() #{{{
+-	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-
+-mutable struct Mask
+-	ocean_levelset::Vector{Float64}
+-	ice_levelset::Vector{Float64}
+-end
+-function Mask() #{{{
+-	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-
+-mutable struct Initialization
+-	vx::Vector{Float64}
+-	vy::Vector{Float64}
+-end
+-function Initialization() #{{{
+-	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-
+-mutable struct Stressbalance
+-	spcvx::Vector{Float64}
+-	spcvy::Vector{Float64}
+-	restol::Float64
+-	reltol::Float64
+-	abstol::Float64
+-	maxiter::Int64
+-end
+-function Stressbalance() #{{{
+-	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 1.e-4, 0.01, 10., 100)
+-end# }}}
+-function Base.show(io::IO, this::Stressbalance)# {{{
+-
+-	println(io,typeof(this),":")
+-	for name in fieldnames(typeof(this))
+-		a=getfield(this,name)
+-		#print(io,"   $(name) = ")
+-		@printf "%19s: " name
+-		if isa(a,String)
+-			println(io, a)
+-		elseif length(a)>1
+-			if !isempty(a)
+-				println(io, typeof(a), " of size ", size(a))
+-			else
+-				println(io,"empty")
+-			end
+-		else
+-			println(io, a)
+-		end
+-	end
+-end# }}}
+-
+-mutable struct Constants
+-	g::Float64
+-	yts::Float64
+-end
+-function Constants() #{{{
+-	return Constants( 9.81,  365*24*3600.)
+-end# }}}
+-
+-mutable struct Materials
+-	rho_ice::Float64
+-	rho_water::Float64
+-	rho_freshwater::Float64
+-	mu_water::Float64
+-	heatcapacity::Float64
+-	latentheat::Float64
+-	thermalconductivity::Float64
+-	temperateiceconductivity::Float64
+-	effectiveconductivity_averaging::Int64
+-	meltingpoint::Float64
+-	beta::Float64
+-	mixed_layer_capacity::Float64
+-	thermal_exchange_velocity::Float64
+-	rheology_B::Vector{Float64}
+-	rheology_n::Vector{Float64}
+-	rheology_law::String
+-end
+-function Materials() #{{{
+-	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
+-end# }}}
+-
+-mutable struct model
+-	mesh::AbstractMesh
+-	geometry::Geometry
+-	mask::Mask
+-	materials::Materials
+-	initialization::Initialization
+-	stressbalance::Stressbalance
+-	constants::Constants
+-end
+-function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants())
+-end#}}}
+-function Base.show(io::IO, md::model)# {{{
+-
+-	compact = get(io, :compact, false)
+-
+-	println(io,"Model:")
+-	@printf "%19s: %-26s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
+-	@printf "%19s: %-26s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
+-	@printf "%19s: %-26s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+-	@printf "%19s: %-26s -- %s\n" "materials" typeof(md.materials) "material properties"
+-	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+-	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
+-	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
+-
+-end# }}}
+Index: ../trunk-jpl/src/jl/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/plotmodel.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/plotmodel.jl	(nonexistent)
+@@ -1,47 +0,0 @@
+-import ColorSchemes.jet
+-
+-using GLMakie
+-include("classes.jl")
+-using .ISSM
+-
+-function plotmodel(md::ISSM.model,data::Vector)
+-
+-	vertexcolor  = :black
+-	facetcolor   = :blue
+-	showvertices = true
+-	showfacets   = true
+-
+-	if data isa AbstractVector
+-
+-		if length(data)==md.mesh.numberofelements
+-			# vector of polygons
+-			x = md.mesh.x
+-			y = md.mesh.y
+-			index = md.mesh.elements
+-			ps = [Makie.GeometryBasics.Polygon([Point2(x[index[i,1]], y[index[i,1]]), Point2(x[index[i,2]], y[index[i,2]]), Point2(x[index[i,3]], y[index[i,3]])])
+-					for i in 1:md.mesh.numberofelements]
+-
+-			fig, ax, h = Makie.poly(ps, color = data, colormap = jet)
+-
+-			#Add colorbar
+-			Colorbar(fig[1, 2], limits = (minimum(data), maximum(data)), colormap = jet)
+-		elseif length(data)==md.mesh.numberofvertices
+-			fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+-
+-			#Add colorbar
+-			#Colorbar(fig[1, 2], h, width=25)
+-		else
+-			error("data of size "*string(length(data))*" not supported yet!")
+-		end
+-	else
+-		# default to single color
+-		@assert length(data)==1
+-		fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+-	end
+-
+-	if showvertices
+-		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
+-	end
+-
+-	return fig
+-end
+Index: ../trunk-jpl/src/jl/issmenums.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issmenums.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/issmenums.jl	(nonexistent)
+@@ -1,1544 +0,0 @@
+-@enum IssmEnum begin
+-	ParametersSTARTEnum
+-	#Parameters{{{
+-	AdolcParamEnum
+-	AmrDeviatoricErrorGroupThresholdEnum
+-	AmrDeviatoricErrorMaximumEnum
+-	AmrDeviatoricErrorResolutionEnum
+-	AmrDeviatoricErrorThresholdEnum
+-	AmrErrEnum
+-	AmrFieldEnum
+-	AmrGradationEnum
+-	AmrGroundingLineDistanceEnum
+-	AmrGroundingLineResolutionEnum
+-	AmrHmaxEnum
+-	AmrHminEnum
+-	AmrIceFrontDistanceEnum
+-	AmrIceFrontResolutionEnum
+-	AmrKeepMetricEnum
+-	AmrLagEnum
+-	AmrLevelMaxEnum
+-	AmrRestartEnum
+-	AmrThicknessErrorGroupThresholdEnum
+-	AmrThicknessErrorMaximumEnum
+-	AmrThicknessErrorResolutionEnum
+-	AmrThicknessErrorThresholdEnum
+-	AmrTypeEnum
+-	AnalysisCounterEnum
+-	AnalysisTypeEnum
+-	AugmentedLagrangianREnum
+-	AugmentedLagrangianRholambdaEnum
+-	AugmentedLagrangianRhopEnum
+-	AugmentedLagrangianRlambdaEnum
+-	AugmentedLagrangianThetaEnum
+-	AutodiffCbufsizeEnum
+-	AutodiffDependentObjectsEnum
+-	AutodiffDriverEnum
+-	AutodiffFosForwardIndexEnum
+-	AutodiffFosReverseIndexEnum
+-	AutodiffFovForwardIndicesEnum
+-	AutodiffGcTriggerMaxSizeEnum
+-	AutodiffGcTriggerRatioEnum
+-	AutodiffIsautodiffEnum
+-	AutodiffLbufsizeEnum
+-	AutodiffNumDependentsEnum
+-	AutodiffNumIndependentsEnum
+-	AutodiffObufsizeEnum
+-	AutodiffTapeAllocEnum
+-	AutodiffTbufsizeEnum
+-	AutodiffXpEnum
+-	BalancethicknessStabilizationEnum
+-	BarystaticContributionsEnum
+-	BasalforcingsBottomplumedepthEnum
+-	BasalforcingsCrustthicknessEnum
+-	BasalforcingsDeepwaterElevationEnum
+-	BasalforcingsDeepwaterMeltingRateEnum
+-	BasalforcingsDtbgEnum
+-	BasalforcingsEnum
+-	BasalforcingsIsmip6AverageTfEnum
+-	BasalforcingsIsmip6BasinAreaEnum
+-	BasalforcingsIsmip6DeltaTEnum
+-	BasalforcingsIsmip6Gamma0Enum
+-	BasalforcingsIsmip6IsLocalEnum
+-	BasalforcingsIsmip6NumBasinsEnum
+-	BasalforcingsIsmip6TfDepthsEnum
+-	BasalforcingsLowercrustheatEnum
+-	BasalforcingsMantleconductivityEnum
+-	BasalforcingsNusseltEnum
+-	BasalforcingsPicoAverageOverturningEnum
+-	BasalforcingsPicoAverageSalinityEnum
+-	BasalforcingsPicoAverageTemperatureEnum
+-	BasalforcingsPicoBoxAreaEnum
+-	BasalforcingsPicoFarOceansalinityEnum
+-	BasalforcingsPicoFarOceantemperatureEnum
+-	BasalforcingsPicoGammaTEnum
+-	BasalforcingsPicoIsplumeEnum
+-	BasalforcingsPicoMaxboxcountEnum
+-	BasalforcingsPicoNumBasinsEnum
+-	BasalforcingsPlumeradiusEnum
+-	BasalforcingsPlumexEnum
+-	BasalforcingsPlumeyEnum
+-	BasalforcingsThresholdThicknessEnum
+-	BasalforcingsTopplumedepthEnum
+-	BasalforcingsUppercrustheatEnum
+-	BasalforcingsUppercrustthicknessEnum
+-	BasalforcingsUpperdepthMeltEnum
+-	BasalforcingsUpperwaterElevationEnum
+-	BasalforcingsUpperwaterMeltingRateEnum
+-	CalvingCrevasseDepthEnum
+-	CalvingCrevasseThresholdEnum
+-	CalvingHeightAboveFloatationEnum
+-	CalvingLawEnum
+-	CalvingMinthicknessEnum
+-	ConfigurationTypeEnum
+-	ConstantsGEnum
+-	ConstantsNewtonGravityEnum
+-	ConstantsReferencetemperatureEnum
+-	ConstantsYtsEnum
+-	ControlInputSizeMEnum
+-	ControlInputSizeNEnum
+-	ControlInputInterpolationEnum
+-	CumBslcEnum
+-	CumBslcIceEnum
+-	CumBslcHydroEnum
+-	CumBslcOceanEnum
+-	CumBslcIcePartitionEnum
+-	CumBslcHydroPartitionEnum
+-	CumBslcOceanPartitionEnum
+-	CumGmtslcEnum
+-	CumGmslcEnum
+-	DamageC1Enum
+-	DamageC2Enum
+-	DamageC3Enum
+-	DamageC4Enum
+-	DamageEnum
+-	DamageEquivStressEnum
+-	DamageEvolutionNumRequestedOutputsEnum
+-	DamageEvolutionRequestedOutputsEnum
+-	DamageHealingEnum
+-	DamageKappaEnum
+-	DamageLawEnum
+-	DamageMaxDamageEnum
+-	DamageStabilizationEnum
+-	DamageStressThresholdEnum
+-	DamageStressUBoundEnum
+-	DebugProfilingEnum
+-	DomainDimensionEnum
+-	DomainTypeEnum
+-	DslModelEnum
+-	DslModelidEnum
+-	DslNummodelsEnum
+-	SolidearthIsExternalEnum
+-	SolidearthExternalNatureEnum
+-	SolidearthExternalModelidEnum
+-	SolidearthExternalNummodelsEnum
+-	SolidearthSettingsComputeBpGrdEnum
+-	EarthIdEnum
+-	ElasticEnum
+-	EplZigZagCounterEnum
+-	EsaHElasticEnum
+-	EsaHemisphereEnum
+-	EsaRequestedOutputsEnum
+-	EsaUElasticEnum
+-	ExtrapolationVariableEnum
+-	FemModelCommEnum
+-	FieldsEnum
+-	FlowequationFeFSEnum
+-	FlowequationIsFSEnum
+-	FlowequationIsHOEnum
+-	FlowequationIsL1L2Enum
+-	FlowequationIsMLHOEnum
+-	FlowequationIsSIAEnum
+-	FlowequationIsSSAEnum
+-	FlowequationIsNitscheEnum
+-	FeFSNitscheGammaEnum
+-	FrictionCouplingEnum
+-	FrictionDeltaEnum
+-	FrictionEffectivePressureLimitEnum
+-	FrictionFEnum
+-	FrictionGammaEnum
+-	FrictionLawEnum
+-	FrictionPseudoplasticityExponentEnum
+-	FrictionThresholdSpeedEnum
+-	FrictionVoidRatioEnum
+-	FrontalForcingsBasinIcefrontAreaEnum
+-	FrontalForcingsNumberofBasinsEnum
+-	FrontalForcingsParamEnum
+-	GrdModelEnum
+-	GroundinglineFrictionInterpolationEnum
+-	GroundinglineMeltInterpolationEnum
+-	GroundinglineMigrationEnum
+-	HydrologyAveragingEnum
+-	HydrologyCavitySpacingEnum
+-	HydrologyChannelConductivityEnum
+-	HydrologyChannelSheetWidthEnum
+-	HydrologyEnglacialVoidRatioEnum
+-	HydrologyIschannelsEnum
+-	HydrologyMeltFlagEnum
+-	HydrologyModelEnum
+-	HydrologyNumRequestedOutputsEnum
+-	HydrologyPressureMeltCoefficientEnum
+-	HydrologyRelaxationEnum
+-	HydrologyRequestedOutputsEnum
+-	HydrologySedimentKmaxEnum
+-	HydrologyStepsPerStepEnum
+-	HydrologyStorageEnum
+-	HydrologydcEplColapseThicknessEnum
+-	HydrologydcEplConductivityEnum
+-	HydrologydcEplInitialThicknessEnum
+-	HydrologydcEplLayerCompressibilityEnum
+-	HydrologydcEplMaxThicknessEnum
+-	HydrologydcEplPoreWaterMassEnum
+-	HydrologydcEplThickCompEnum
+-	HydrologydcEplflipLockEnum
+-	HydrologydcIsefficientlayerEnum
+-	HydrologydcLeakageFactorEnum
+-	HydrologydcMaxIterEnum
+-	HydrologydcPenaltyFactorEnum
+-	HydrologydcPenaltyLockEnum
+-	HydrologydcRelTolEnum
+-	HydrologydcSedimentlimitEnum
+-	HydrologydcSedimentlimitFlagEnum
+-	HydrologydcSedimentLayerCompressibilityEnum
+-	HydrologydcSedimentPoreWaterMassEnum
+-	HydrologydcSedimentPorosityEnum
+-	HydrologydcSedimentThicknessEnum
+-	HydrologydcTransferFlagEnum
+-	HydrologydcUnconfinedFlagEnum
+-	HydrologyshreveStabilizationEnum
+-	IcecapToEarthCommEnum
+-	IndexEnum
+-	InputFileNameEnum
+-	DirectoryNameEnum
+-	IndicesEnum
+-	InputToDepthaverageInEnum
+-	InputToDepthaverageOutEnum
+-	InputToExtrudeEnum
+-	InputToL2ProjectEnum
+-	InputToSmoothEnum
+-	InversionAlgorithmEnum
+-	InversionControlParametersEnum
+-	InversionControlScalingFactorsEnum
+-	InversionCostFunctionsEnum
+-	InversionDxminEnum
+-	InversionGatolEnum
+-	InversionGradientScalingEnum
+-	InversionGrtolEnum
+-	InversionGttolEnum
+-	InversionIncompleteAdjointEnum
+-	InversionIscontrolEnum
+-	InversionMaxiterEnum
+-	InversionMaxiterPerStepEnum
+-	InversionMaxstepsEnum
+-	InversionNstepsEnum
+-	InversionNumControlParametersEnum
+-	InversionNumCostFunctionsEnum
+-	InversionStepThresholdEnum
+-	InversionTypeEnum
+-	IvinsEnum
+-	IsSlcCouplingEnum
+-	LevelsetKillIcebergsEnum
+-	LevelsetReinitFrequencyEnum
+-	LevelsetStabilizationEnum
+-	LockFileNameEnum
+-	LoveAllowLayerDeletionEnum
+-	LoveCoreMantleBoundaryEnum
+-	LoveEarthMassEnum
+-	LoveForcingTypeEnum
+-	LoveFrequenciesEnum
+-	LoveIsTemporalEnum
+-	LoveG0Enum
+-	LoveGravitationalConstantEnum
+-	LoveInnerCoreBoundaryEnum
+-	LoveComplexComputationEnum
+-	LoveIntStepsPerLayerEnum
+-	LoveKernelsEnum
+-	LoveMu0Enum
+-	LoveNfreqEnum
+-	LoveNTemporalIterationsEnum
+-	LoveNYiEquationsEnum
+-	LoveR0Enum
+-	LoveShNmaxEnum
+-	LoveShNminEnum
+-	LoveStartingLayerEnum
+-	LoveUnderflowTolEnum
+-	MassFluxSegmentsEnum
+-	MassFluxSegmentsPresentEnum
+-	MasstransportHydrostaticAdjustmentEnum
+-	MasstransportIsfreesurfaceEnum
+-	MasstransportMinThicknessEnum
+-	MasstransportNumRequestedOutputsEnum
+-	MasstransportPenaltyFactorEnum
+-	MasstransportRequestedOutputsEnum
+-	MasstransportStabilizationEnum
+-	MaterialsBetaEnum
+-	MaterialsEarthDensityEnum
+-	MaterialsEffectiveconductivityAveragingEnum
+-	MaterialsHeatcapacityEnum
+-	MaterialsLatentheatEnum
+-	MaterialsMeltingpointEnum
+-	MaterialsMixedLayerCapacityEnum
+-	MaterialsMuWaterEnum
+-	MaterialsRheologyLawEnum
+-	MaterialsRhoFreshwaterEnum
+-	MaterialsRhoIceEnum
+-	MaterialsRhoSeawaterEnum
+-	MaterialsTemperateiceconductivityEnum
+-	MaterialsThermalExchangeVelocityEnum
+-	MaterialsThermalconductivityEnum
+-	MeltingOffsetEnum
+-	MeshAverageVertexConnectivityEnum
+-	MeshElementtypeEnum
+-	MeshNumberoflayersEnum
+-	MeshNumberofverticesEnum
+-	MeshNumberofelementsEnum
+-	MigrationMaxEnum
+-	ModelIdEnum
+-	NbinsEnum
+-	NodesEnum
+-	NumModelsEnum
+-	OceanGridNxEnum
+-	OceanGridNyEnum
+-	OceanGridXEnum
+-	OceanGridYEnum
+-	OutputBufferPointerEnum
+-	OutputBufferSizePointerEnum
+-	OutputFileNameEnum
+-	OutputFilePointerEnum
+-	OutputdefinitionEnum
+-	QmuErrNameEnum
+-	QmuInNameEnum
+-	QmuIsdakotaEnum
+-	QmuOutNameEnum
+-	QmuOutputEnum
+-	QmuCurrEvalIdEnum
+-	QmuNsampleEnum
+-	QmuResponsedescriptorsEnum
+-	QmuVariableDescriptorsEnum
+-	QmuVariablePartitionsEnum
+-	QmuVariablePartitionsNpartEnum
+-	QmuVariablePartitionsNtEnum
+-	QmuResponsePartitionsEnum
+-	QmuResponsePartitionsNpartEnum
+-	QmuStatisticsEnum
+-	QmuNumstatisticsEnum
+-	QmuNdirectoriesEnum
+-	QmuNfilesPerDirectoryEnum
+-	QmuStatisticsMethodEnum
+-	QmuMethodsEnum
+-	RestartFileNameEnum
+-	ResultsEnum
+-	RootPathEnum
+-	ModelnameEnum
+-	SamplingAlphaEnum
+-	SamplingPhiEnum
+-	SamplingNumRequestedOutputsEnum
+-	SamplingRequestedOutputsEnum
+-	SamplingRobinEnum
+-	SamplingSeedEnum
+-	SamplingTauEnum
+-	SaveResultsEnum
+-	SolidearthPartitionIceEnum
+-	SolidearthPartitionHydroEnum
+-	SolidearthPartitionOceanEnum
+-	SolidearthNpartIceEnum
+-	SolidearthNpartOceanEnum
+-	SolidearthNpartHydroEnum
+-	SolidearthPlanetRadiusEnum
+-	SolidearthPlanetAreaEnum
+-	SolidearthSettingsAbstolEnum
+-	SolidearthSettingsCrossSectionShapeEnum
+-	RotationalAngularVelocityEnum
+-	SolidearthSettingsElasticEnum
+-	SolidearthSettingsViscousEnum
+-	SealevelchangeGeometryDoneEnum
+-	SealevelchangeViscousNumStepsEnum
+-	SealevelchangeViscousTimesEnum
+-	SealevelchangeViscousIndexEnum
+-	RotationalEquatorialMoiEnum
+-	TidalLoveHEnum
+-	TidalLoveKEnum
+-	TidalLoveLEnum
+-	TidalLoveK2SecularEnum
+-	LoadLoveHEnum
+-	LoadLoveKEnum
+-	LoadLoveLEnum
+-	LoveTimeFreqEnum
+-	LoveIsTimeEnum
+-	SealevelchangeGSelfAttractionEnum
+-	SealevelchangeGViscoElasticEnum
+-	SolidearthSettingsSealevelLoadingEnum
+-	SolidearthSettingsGRDEnum
+-	SolidearthSettingsRunFrequencyEnum
+-	SolidearthSettingsTimeAccEnum
+-	SealevelchangeHViscoElasticEnum
+-	SolidearthSettingsHorizEnum
+-	SolidearthSettingsMaxiterEnum
+-	SolidearthSettingsGrdOceanEnum
+-	SolidearthSettingsOceanAreaScalingEnum
+-	RotationalPolarMoiEnum
+-	SolidearthSettingsReltolEnum
+-	SealevelchangeRequestedOutputsEnum
+-	SolidearthSettingsSelfAttractionEnum
+-	SolidearthSettingsRotationEnum
+-	SolidearthSettingsMaxSHCoeffEnum
+-	SealevelchangeRunCountEnum
+-	SealevelchangeTransitionsEnum
+-	SealevelchangeUViscoElasticEnum
+-	SettingsIoGatherEnum
+-	SettingsNumResultsOnNodesEnum
+-	SettingsOutputFrequencyEnum
+-	SettingsCheckpointFrequencyEnum
+-	SettingsResultsOnNodesEnum
+-	SettingsSbCouplingFrequencyEnum
+-	SettingsSolverResidueThresholdEnum
+-	SettingsWaitonlockEnum
+-	SmbAIceEnum
+-	SmbAIdxEnum
+-	SmbASnowEnum
+-	SmbAccualtiEnum
+-	SmbAccugradEnum
+-	SmbAccurefEnum
+-	SmbAdThreshEnum
+-	SmbAutoregressionInitialTimeEnum
+-	SmbAutoregressionTimestepEnum
+-	SmbAutoregressiveOrderEnum
+-	SmbAveragingEnum
+-	SmbBeta0Enum
+-	SmbBeta1Enum
+-	SmbCovmatEnum
+-	SmbDesfacEnum
+-	SmbDpermilEnum
+-	SmbDsnowIdxEnum
+-	SmbCldFracEnum
+-	SmbDelta18oEnum
+-	SmbDelta18oSurfaceEnum
+-	SmbDenIdxEnum
+-	SmbDtEnum
+-	SmbEnum
+-	SmbFEnum
+-	SmbInitDensityScalingEnum
+-	SmbIsaccumulationEnum
+-	SmbIsalbedoEnum
+-	SmbIsconstrainsurfaceTEnum
+-	SmbIsd18opdEnum
+-	SmbIsdelta18oEnum
+-	SmbIsdensificationEnum
+-	SmbIsfirnwarmingEnum
+-	SmbIsgraingrowthEnum
+-	SmbIsmeltEnum
+-	SmbIsmungsmEnum
+-	SmbIsprecipscaledEnum
+-	SmbIssetpddfacEnum
+-	SmbIsshortwaveEnum
+-	SmbIstemperaturescaledEnum
+-	SmbIsthermalEnum
+-	SmbIsturbulentfluxEnum
+-	SmbKEnum
+-	SmbNumBasinsEnum
+-	SmbNumRequestedOutputsEnum
+-	SmbPfacEnum
+-	SmbPhiEnum
+-	SmbRandomflagEnum
+-	SmbRdlEnum
+-	SmbRequestedOutputsEnum
+-	SmbRlapsEnum
+-	SmbRlapslgmEnum
+-	SmbRunoffaltiEnum
+-	SmbRunoffgradEnum
+-	SmbRunoffrefEnum
+-	SmbSealevEnum
+-	SmbStepsPerStepEnum
+-	SmbSwIdxEnum
+-	SmbT0dryEnum
+-	SmbT0wetEnum
+-	SmbTdiffEnum
+-	SmbThermoDeltaTScalingEnum
+-	SmbTemperaturesReconstructedYearsEnum
+-	SmbPrecipitationsReconstructedYearsEnum
+-	SmoothThicknessMultiplierEnum
+-	SolutionTypeEnum
+-	SteadystateMaxiterEnum
+-	SteadystateNumRequestedOutputsEnum
+-	SteadystateReltolEnum
+-	SteadystateRequestedOutputsEnum
+-	StepEnum
+-	StepsEnum
+-	StressbalanceAbstolEnum
+-	StressbalanceFSreconditioningEnum
+-	StressbalanceIsnewtonEnum
+-	StressbalanceMaxiterEnum
+-	StressbalanceNumRequestedOutputsEnum
+-	StressbalancePenaltyFactorEnum
+-	StressbalanceReltolEnum
+-	StressbalanceRequestedOutputsEnum
+-	StressbalanceRestolEnum
+-	StressbalanceRiftPenaltyThresholdEnum
+-	StressbalanceShelfDampeningEnum
+-	ThermalIsdrainicecolumnEnum
+-	ThermalIsdynamicbasalspcEnum
+-	ThermalIsenthalpyEnum
+-	ThermalMaxiterEnum
+-	ThermalNumRequestedOutputsEnum
+-	ThermalPenaltyFactorEnum
+-	ThermalPenaltyLockEnum
+-	ThermalPenaltyThresholdEnum
+-	ThermalReltolEnum
+-	ThermalRequestedOutputsEnum
+-	ThermalStabilizationEnum
+-	ThermalWatercolumnUpperlimitEnum
+-	TimeEnum
+-	TimesteppingCflCoefficientEnum
+-	TimesteppingCouplingTimeEnum
+-	TimesteppingFinalTimeEnum
+-	TimesteppingInterpForcingEnum
+-	TimesteppingCycleForcingEnum
+-	TimesteppingStartTimeEnum
+-	TimesteppingTimeStepEnum
+-	TimesteppingTimeStepMaxEnum
+-	TimesteppingTimeStepMinEnum
+-	TimesteppingTypeEnum
+-	ToMITgcmCommEnum
+-	ToolkitsFileNameEnum
+-	ToolkitsOptionsAnalysesEnum
+-	ToolkitsOptionsStringsEnum
+-	ToolkitsTypesEnum
+-	TransientAmrFrequencyEnum
+-	TransientIsdamageevolutionEnum
+-	TransientIsesaEnum
+-	TransientIsgiaEnum
+-	TransientIsgroundinglineEnum
+-	TransientIshydrologyEnum
+-	TransientIsmasstransportEnum 
+-	TransientIsoceantransportEnum
+-	TransientIsmovingfrontEnum
+-	TransientIsoceancouplingEnum
+-	TransientIssamplingEnum
+-	TransientIsslcEnum
+-	TransientIssmbEnum
+-	TransientIsstressbalanceEnum
+-	TransientIsthermalEnum
+-	TransientNumRequestedOutputsEnum
+-	TransientRequestedOutputsEnum
+-	VelocityEnum
+-	XxeEnum
+-	YyeEnum
+-	ZzeEnum
+-	AreaeEnum
+-	WorldCommEnum
+-	#}}}
+-	ParametersENDEnum
+-	InputsSTARTEnum
+-	#Inputs{{{
+-	AccumulatedDeltaBottomPressureEnum
+-	AccumulatedDeltaIceThicknessEnum
+-	AccumulatedDeltaTwsEnum
+-	AdjointEnum
+-	AdjointpEnum
+-	AdjointxEnum
+-	AdjointxBaseEnum
+-	AdjointxShearEnum
+-	AdjointyEnum
+-	AdjointyBaseEnum
+-	AdjointyShearEnum
+-	AdjointzEnum
+-	AirEnum
+-	ApproximationEnum
+-	BalancethicknessMisfitEnum
+-	BalancethicknessOmega0Enum
+-	BalancethicknessOmegaEnum
+-	BalancethicknessSpcthicknessEnum
+-	BalancethicknessThickeningRateEnum
+-	BasalCrevasseEnum
+-	BasalforcingsFloatingiceMeltingRateEnum
+-	BasalforcingsGeothermalfluxEnum
+-	BasalforcingsGroundediceMeltingRateEnum
+-	BasalforcingsPerturbationMeltingRateEnum
+-	BasalforcingsIsmip6BasinIdEnum
+-	BasalforcingsIsmip6TfEnum
+-	BasalforcingsIsmip6TfShelfEnum
+-	BasalforcingsIsmip6MeltAnomalyEnum
+-	BasalforcingsMeltrateFactorEnum
+-	BasalforcingsOceanSalinityEnum
+-	BasalforcingsOceanTempEnum
+-	BasalforcingsPicoBasinIdEnum
+-	BasalforcingsPicoBoxIdEnum
+-	BasalforcingsPicoOverturningCoeffEnum
+-	BasalforcingsPicoSubShelfOceanOverturningEnum
+-	BasalforcingsPicoSubShelfOceanSalinityEnum
+-	BasalforcingsPicoSubShelfOceanTempEnum
+-	BasalStressxEnum
+-	BasalStressyEnum
+-	BasalStressEnum
+-	BaseEnum
+-	BaseOldEnum
+-	BaseSlopeXEnum
+-	BaseSlopeYEnum
+-	BedEnum
+-	BedGRDEnum
+-	BedEastEnum
+-	BedEastGRDEnum
+-	BedNorthEnum
+-	BedNorthGRDEnum
+-	BedSlopeXEnum
+-	BedSlopeYEnum
+-	BottomPressureEnum
+-	BottomPressureOldEnum
+-	CalvingCalvingrateEnum
+-	CalvingHabFractionEnum
+-	CalvingMeltingrateEnum
+-	CalvingStressThresholdFloatingiceEnum
+-	CalvingStressThresholdGroundediceEnum
+-	CalvinglevermannCoeffEnum
+-	CalvingratexAverageEnum
+-	CalvingratexEnum
+-	CalvingrateyAverageEnum
+-	CalvingrateyEnum
+-	CalvingFluxLevelsetEnum
+-	CalvingMeltingFluxLevelsetEnum
+-	ConvergedEnum
+-	CrevasseDepthEnum
+-	DamageDEnum
+-	DamageDOldEnum
+-	DamageDbarEnum
+-	DamageDbarOldEnum
+-	DamageFEnum
+-	DegreeOfChannelizationEnum
+-	DepthBelowSurfaceEnum
+-	DeltaIceThicknessEnum
+-	DeltaTwsEnum
+-	DeltaBottomPressureEnum
+-	DeltaDslEnum
+-	DslOldEnum
+-	DslEnum
+-	DeltaStrEnum
+-	StrOldEnum
+-	StrEnum
+-	DeviatoricStresseffectiveEnum
+-	DeviatoricStressxxEnum
+-	DeviatoricStressxyEnum
+-	DeviatoricStressxzEnum
+-	DeviatoricStressyyEnum
+-	DeviatoricStressyzEnum
+-	DeviatoricStresszzEnum
+-	DeviatoricStress1Enum
+-	DeviatoricStress2Enum
+-	DistanceToCalvingfrontEnum
+-	DistanceToGroundinglineEnum
+-	Domain2DhorizontalEnum
+-	Domain2DverticalEnum
+-	Domain3DEnum
+-	DragCoefficientAbsGradientEnum
+-	DrivingStressXEnum
+-	DrivingStressYEnum
+-	DummyEnum
+-	EffectivePressureEnum
+-	EffectivePressureSubstepEnum
+-	EffectivePressureTransientEnum
+-	EnthalpyEnum
+-	EnthalpyPicardEnum
+-	EplHeadEnum
+-	EplHeadOldEnum
+-	EplHeadSlopeXEnum
+-	EplHeadSlopeYEnum
+-	EplHeadSubstepEnum
+-	EplHeadTransientEnum
+-	EsaEmotionEnum
+-	EsaNmotionEnum
+-	EsaRotationrateEnum
+-	EsaStrainratexxEnum
+-	EsaStrainratexyEnum
+-	EsaStrainrateyyEnum
+-	EsaUmotionEnum
+-	EsaXmotionEnum
+-	EsaYmotionEnum
+-	EtaDiffEnum
+-	FlowequationBorderFSEnum
+-	FrictionAsEnum
+-	FrictionCEnum
+-	FrictionCmaxEnum
+-	FrictionCoefficientEnum
+-	FrictionCoefficientcoulombEnum
+-	FrictionEffectivePressureEnum
+-	FrictionMEnum
+-	FrictionPEnum
+-	FrictionPressureAdjustedTemperatureEnum
+-	FrictionQEnum
+-	FrictionSedimentCompressibilityCoefficientEnum
+-	FrictionTillFrictionAngleEnum
+-	FrictionWaterLayerEnum
+-	FrictionfEnum
+-	FrontalForcingsBasinIdEnum
+-	FrontalForcingsSubglacialDischargeEnum
+-	FrontalForcingsThermalForcingEnum
+-	GeometryHydrostaticRatioEnum
+-	NGiaEnum
+-	NGiaRateEnum
+-	UGiaEnum
+-	UGiaRateEnum
+-	GradientEnum
+-	GroundinglineHeightEnum
+-	HydraulicPotentialEnum
+-	HydraulicPotentialOldEnum
+-	HydrologyBasalFluxEnum
+-	HydrologyBumpHeightEnum
+-	HydrologyBumpSpacingEnum
+-	HydrologydcBasalMoulinInputEnum
+-	HydrologydcEplThicknessEnum
+-	HydrologydcEplThicknessOldEnum
+-	HydrologydcEplThicknessSubstepEnum
+-	HydrologydcEplThicknessTransientEnum
+-	HydrologydcMaskEplactiveEltEnum
+-	HydrologydcMaskEplactiveNodeEnum
+-	HydrologydcMaskThawedEltEnum
+-	HydrologydcMaskThawedNodeEnum
+-	HydrologydcSedimentTransmitivityEnum
+-	HydrologyDrainageRateEnum
+-	HydrologyEnglacialInputEnum
+-	HydrologyGapHeightEnum
+-	HydrologyGapHeightXEnum
+-	HydrologyGapHeightXXEnum
+-	HydrologyGapHeightYEnum
+-	HydrologyGapHeightYYEnum
+-	HydrologyHeadEnum
+-	HydrologyHeadOldEnum
+-	HydrologyMoulinInputEnum
+-	HydrologyNeumannfluxEnum
+-	HydrologyReynoldsEnum
+-	HydrologySheetConductivityEnum
+-	HydrologySheetThicknessEnum
+-	HydrologySheetThicknessOldEnum
+-	HydrologyTwsEnum
+-	HydrologyTwsSpcEnum
+-	HydrologyTwsAnalysisEnum
+-	HydrologyWatercolumnMaxEnum
+-	HydrologyWaterVxEnum
+-	HydrologyWaterVyEnum
+-	IceEnum
+-	IceMaskNodeActivationEnum
+-	InputEnum
+-	InversionCostFunctionsCoefficientsEnum
+-	InversionSurfaceObsEnum
+-	InversionThicknessObsEnum
+-	InversionVelObsEnum
+-	InversionVxObsEnum
+-	InversionVyObsEnum
+-	LevelsetfunctionSlopeXEnum
+-	LevelsetfunctionSlopeYEnum
+-	LevelsetObservationEnum
+-	LoadingforceXEnum
+-	LoadingforceYEnum
+-	LoadingforceZEnum
+-	MaskOceanLevelsetEnum
+-	MaskIceLevelsetEnum
+-	MaskIceRefLevelsetEnum
+-	MasstransportSpcthicknessEnum
+-	MaterialsRheologyBEnum
+-	MaterialsRheologyBbarEnum
+-	MaterialsRheologyEEnum
+-	MaterialsRheologyEbarEnum
+-	MaterialsRheologyEcEnum
+-	MaterialsRheologyEcbarEnum
+-	MaterialsRheologyEsEnum
+-	MaterialsRheologyEsbarEnum
+-	MaterialsRheologyNEnum
+-	MeshScaleFactorEnum
+-	MeshVertexonbaseEnum
+-	MeshVertexonboundaryEnum
+-	MeshVertexonsurfaceEnum
+-	MisfitEnum
+-	MovingFrontalVxEnum
+-	MovingFrontalVyEnum
+-	NeumannfluxEnum
+-	NewDamageEnum
+-	NodeEnum
+-	OmegaAbsGradientEnum
+-	OceantransportSpcbottompressureEnum
+-	OceantransportSpcstrEnum
+-	OceantransportSpcdslEnum
+-	P0Enum
+-	P1Enum
+-	PartitioningEnum
+-	PressureEnum
+-	RadarEnum
+-	RadarAttenuationMacGregorEnum
+-	RadarAttenuationWolffEnum
+-	RadarIcePeriodEnum
+-	RadarPowerMacGregorEnum
+-	RadarPowerWolffEnum
+-	RheologyBAbsGradientEnum
+-	RheologyBInitialguessEnum
+-	RheologyBInitialguessMisfitEnum
+-	RheologyBbarAbsGradientEnum
+-	SampleEnum
+-	SamplingBetaEnum
+-	SamplingKappaEnum
+-	SealevelEnum
+-	SealevelGRDEnum
+-	SealevelBarystaticMaskEnum
+-	SealevelBarystaticIceMaskEnum
+-	SealevelBarystaticIceWeightsEnum
+-	SealevelBarystaticIceAreaEnum
+-	SealevelBarystaticIceLatbarEnum
+-	SealevelBarystaticIceLongbarEnum
+-	SealevelBarystaticIceLoadEnum
+-	SealevelBarystaticHydroMaskEnum
+-	SealevelBarystaticHydroWeightsEnum
+-	SealevelBarystaticHydroAreaEnum
+-	SealevelBarystaticHydroLatbarEnum
+-	SealevelBarystaticHydroLongbarEnum
+-	SealevelBarystaticHydroLoadEnum
+-	SealevelBarystaticBpMaskEnum
+-	SealevelBarystaticBpWeightsEnum
+-	SealevelBarystaticBpAreaEnum
+-	SealevelBarystaticBpLoadEnum
+-	SealevelBarystaticOceanMaskEnum
+-	SealevelBarystaticOceanWeightsEnum
+-	SealevelBarystaticOceanAreaEnum
+-	SealevelBarystaticOceanLatbarEnum
+-	SealevelBarystaticOceanLongbarEnum
+-	SealevelBarystaticOceanLoadEnum
+-	SealevelNEsaEnum
+-	SealevelNEsaRateEnum
+-	SealevelRSLEnum
+-	BslcEnum
+-	BslcIceEnum
+-	BslcHydroEnum
+-	BslcOceanEnum
+-	BslcRateEnum
+-	GmtslcEnum
+-	SealevelGrotm1Enum
+-	SealevelGrotm2Enum
+-	SealevelGrotm3Enum
+-	SealevelGUrotm1Enum
+-	SealevelGUrotm2Enum
+-	SealevelGUrotm3Enum
+-	SealevelGNrotm1Enum
+-	SealevelGNrotm2Enum
+-	SealevelGNrotm3Enum
+-	SealevelGErotm1Enum
+-	SealevelGErotm2Enum
+-	SealevelGErotm3Enum
+-	SealevelRSLBarystaticEnum
+-	SealevelRSLRateEnum
+-	SealevelUGrdEnum
+-	SealevelNGrdEnum
+-	SealevelUEastEsaEnum
+-	SealevelUNorthEsaEnum
+-	SealevelchangeIndicesEnum
+-	SealevelchangeGEnum
+-	SealevelchangeGUEnum
+-	SealevelchangeGEEnum
+-	SealevelchangeGNEnum
+-	SealevelchangeGsubelOceanEnum
+-	SealevelchangeGUsubelOceanEnum
+-	SealevelchangeGEsubelOceanEnum
+-	SealevelchangeGNsubelOceanEnum
+-	SealevelchangeGsubelIceEnum
+-	SealevelchangeGUsubelIceEnum
+-	SealevelchangeGEsubelIceEnum
+-	SealevelchangeGNsubelIceEnum
+-	SealevelchangeGsubelHydroEnum
+-	SealevelchangeGUsubelHydroEnum
+-	SealevelchangeGEsubelHydroEnum
+-	SealevelchangeGNsubelHydroEnum
+-	SealevelchangeViscousRSLEnum
+-	SealevelchangeViscousUEnum
+-	SealevelchangeViscousNEnum
+-	SealevelchangeViscousEEnum
+-	SedimentHeadEnum
+-	SedimentHeadOldEnum
+-	SedimentHeadSubstepEnum
+-	SedimentHeadTransientEnum
+-	SedimentHeadResidualEnum
+-	SedimentHeadStackedEnum
+-	SigmaNNEnum
+-	SigmaVMEnum
+-	SmbAccumulatedECEnum
+-	SmbAccumulatedMassBalanceEnum
+-	SmbAccumulatedMeltEnum
+-	SmbAccumulatedPrecipitationEnum
+-	SmbAccumulatedRainEnum
+-	SmbAccumulatedRefreezeEnum
+-	SmbAccumulatedRunoffEnum
+-	SmbAEnum
+-	SmbAdiffEnum
+-	SmbAValueEnum
+-	SmbAccumulationEnum
+-	SmbAdiffiniEnum
+-	SmbAiniEnum
+-	SmbBasinsIdEnum
+-	SmbBMaxEnum
+-	SmbBMinEnum
+-	SmbBNegEnum
+-	SmbBPosEnum
+-	SmbCEnum
+-	SmbCcsnowValueEnum
+-	SmbCciceValueEnum
+-	SmbCotValueEnum
+-	SmbDEnum
+-	SmbDailyairdensityEnum
+-	SmbDailyairhumidityEnum
+-	SmbDailydlradiationEnum
+-	SmbDailydsradiationEnum
+-	SmbDailypressureEnum
+-	SmbDailyrainfallEnum
+-	SmbDailysnowfallEnum
+-	SmbDailytemperatureEnum
+-	SmbDailywindspeedEnum
+-	SmbDiniEnum
+-	SmbDlwrfEnum
+-	SmbDswrfEnum
+-	SmbDswdiffrfEnum
+-	SmbDzAddEnum
+-	SmbDzEnum
+-	SmbDzMinEnum
+-	SmbDzTopEnum
+-	SmbDziniEnum
+-	SmbEAirEnum
+-	SmbECEnum
+-	SmbECDtEnum
+-	SmbECiniEnum
+-	SmbElaEnum
+-	SmbEvaporationEnum
+-	SmbFACEnum
+-	SmbGdnEnum
+-	SmbGdniniEnum
+-	SmbGspEnum
+-	SmbGspiniEnum
+-	SmbHrefEnum
+-	SmbIsInitializedEnum
+-	SmbMAddEnum
+-	SmbMassBalanceEnum
+-	SmbMassBalanceSubstepEnum
+-	SmbMassBalanceTransientEnum
+-	SmbMeanLHFEnum
+-	SmbMeanSHFEnum
+-	SmbMeanULWEnum
+-	SmbMeltEnum
+-	SmbMInitnum
+-	SmbMonthlytemperaturesEnum
+-	SmbMSurfEnum
+-	SmbNetLWEnum
+-	SmbNetSWEnum
+-	SmbPAirEnum
+-	SmbPEnum
+-	SmbPddfacIceEnum
+-	SmbPddfacSnowEnum
+-	SmbPrecipitationEnum
+-	SmbPrecipitationsAnomalyEnum
+-	SmbPrecipitationsLgmEnum
+-	SmbPrecipitationsPresentdayEnum
+-	SmbPrecipitationsReconstructedEnum
+-	SmbRainEnum
+-	SmbReEnum
+-	SmbRefreezeEnum
+-	SmbReiniEnum
+-	SmbRunoffEnum
+-	SmbRunoffSubstepEnum
+-	SmbRunoffTransientEnum
+-	SmbS0gcmEnum
+-	SmbS0pEnum
+-	SmbS0tEnum
+-	SmbSizeiniEnum
+-	SmbSmbCorrEnum
+-	SmbSmbrefEnum
+-	SmbSzaValueEnum
+-	SmbTEnum
+-	SmbTaEnum
+-	SmbTeValueEnum
+-	SmbTemperaturesAnomalyEnum
+-	SmbTemperaturesLgmEnum
+-	SmbTemperaturesPresentdayEnum
+-	SmbTemperaturesReconstructedEnum
+-	SmbTiniEnum
+-	SmbTmeanEnum
+-	SmbTzEnum
+-	SmbValuesAutoregressionEnum
+-	SmbVEnum
+-	SmbVmeanEnum
+-	SmbVzEnum
+-	SmbWEnum
+-	SmbWAddEnum
+-	SmbWiniEnum
+-	SmbZMaxEnum
+-	SmbZMinEnum
+-	SmbZTopEnum
+-	SmbZYEnum
+-	SolidearthExternalDisplacementEastRateEnum
+-	SolidearthExternalDisplacementNorthRateEnum
+-	SolidearthExternalDisplacementUpRateEnum
+-	SolidearthExternalGeoidRateEnum
+-	StrainRateeffectiveEnum
+-	StrainRateparallelEnum
+-	StrainRateperpendicularEnum
+-	StrainRatexxEnum
+-	StrainRatexyEnum
+-	StrainRatexzEnum
+-	StrainRateyyEnum
+-	StrainRateyzEnum
+-	StrainRatezzEnum
+-	StressMaxPrincipalEnum
+-	StressTensorxxEnum
+-	StressTensorxyEnum
+-	StressTensorxzEnum
+-	StressTensoryyEnum
+-	StressTensoryzEnum
+-	StressTensorzzEnum
+-	SurfaceAbsMisfitEnum
+-	SurfaceAbsVelMisfitEnum
+-	AreaEnum
+-	SealevelAreaEnum
+-	SurfaceAreaEnum
+-	SurfaceAverageVelMisfitEnum
+-	SurfaceCrevasseEnum
+-	SurfaceEnum
+-	SurfaceOldEnum
+-	SurfaceLogVelMisfitEnum
+-	SurfaceLogVxVyMisfitEnum
+-	SurfaceObservationEnum
+-	SurfaceRelVelMisfitEnum
+-	SurfaceSlopeXEnum
+-	SurfaceSlopeYEnum
+-	TemperatureEnum
+-	TemperaturePDDEnum
+-	TemperaturePicardEnum
+-	TemperatureSEMICEnum
+-	ThermalSpctemperatureEnum
+-	ThicknessAbsGradientEnum
+-	ThicknessAbsMisfitEnum
+-	ThicknessAcrossGradientEnum
+-	ThicknessAlongGradientEnum
+-	ThicknessEnum
+-	ThicknessOldEnum
+-	ThicknessPositiveEnum
+-	ThicknessResidualEnum
+-	TransientAccumulatedDeltaIceThicknessEnum
+-	VelEnum
+-	VxAverageEnum
+-	VxBaseEnum
+-	VxEnum
+-	VxMeshEnum
+-	VxObsEnum
+-	VxShearEnum
+-	VxSurfaceEnum
+-	VyAverageEnum
+-	VyBaseEnum
+-	VyEnum
+-	VyMeshEnum
+-	VyObsEnum
+-	VyShearEnum
+-	VySurfaceEnum
+-	VzEnum
+-	VzFSEnum
+-	VzHOEnum
+-	VzMeshEnum
+-	VzSSAEnum
+-	WaterColumnOldEnum
+-	WatercolumnEnum
+-	WaterfractionDrainageEnum
+-	WaterfractionDrainageIntegratedEnum
+-	WaterfractionEnum
+-	WaterheightEnum
+-	WeightsLevelsetObservationEnum
+-	WeightsSurfaceObservationEnum
+-	OldAccumulatedDeltaBottomPressureEnum
+-	OldAccumulatedDeltaIceThicknessEnum
+-	OldAccumulatedDeltaTwsEnum
+-	Outputdefinition1Enum
+-	Outputdefinition10Enum
+-	Outputdefinition11Enum
+-	Outputdefinition12Enum
+-	Outputdefinition13Enum
+-	Outputdefinition14Enum
+-	Outputdefinition15Enum
+-	Outputdefinition16Enum
+-	Outputdefinition17Enum
+-	Outputdefinition18Enum
+-	Outputdefinition19Enum
+-	Outputdefinition20Enum
+-	Outputdefinition21Enum
+-	Outputdefinition22Enum
+-	Outputdefinition23Enum
+-	Outputdefinition24Enum
+-	Outputdefinition25Enum
+-	Outputdefinition26Enum
+-	Outputdefinition27Enum
+-	Outputdefinition28Enum
+-	Outputdefinition29Enum
+-	Outputdefinition2Enum
+-	Outputdefinition30Enum
+-	Outputdefinition31Enum
+-	Outputdefinition32Enum
+-	Outputdefinition33Enum
+-	Outputdefinition34Enum
+-	Outputdefinition35Enum
+-	Outputdefinition36Enum
+-	Outputdefinition37Enum
+-	Outputdefinition38Enum
+-	Outputdefinition39Enum
+-	Outputdefinition3Enum
+-	Outputdefinition40Enum
+-	Outputdefinition41Enum
+-	Outputdefinition42Enum
+-	Outputdefinition43Enum
+-	Outputdefinition44Enum
+-	Outputdefinition45Enum
+-	Outputdefinition46Enum
+-	Outputdefinition47Enum
+-	Outputdefinition48Enum
+-	Outputdefinition49Enum
+-	Outputdefinition4Enum
+-	Outputdefinition50Enum
+-	Outputdefinition51Enum
+-	Outputdefinition52Enum
+-	Outputdefinition53Enum
+-	Outputdefinition54Enum
+-	Outputdefinition55Enum
+-	Outputdefinition56Enum
+-	Outputdefinition57Enum
+-	Outputdefinition58Enum
+-	Outputdefinition59Enum
+-	Outputdefinition5Enum
+-	Outputdefinition60Enum
+-	Outputdefinition61Enum
+-	Outputdefinition62Enum
+-	Outputdefinition63Enum
+-	Outputdefinition64Enum
+-	Outputdefinition65Enum
+-	Outputdefinition66Enum
+-	Outputdefinition67Enum
+-	Outputdefinition68Enum
+-	Outputdefinition69Enum
+-	Outputdefinition6Enum
+-	Outputdefinition70Enum
+-	Outputdefinition71Enum
+-	Outputdefinition72Enum
+-	Outputdefinition73Enum
+-	Outputdefinition74Enum
+-	Outputdefinition75Enum
+-	Outputdefinition76Enum
+-	Outputdefinition77Enum
+-	Outputdefinition78Enum
+-	Outputdefinition79Enum
+-	Outputdefinition7Enum
+-	Outputdefinition80Enum
+-	Outputdefinition81Enum
+-	Outputdefinition82Enum
+-	Outputdefinition83Enum
+-	Outputdefinition84Enum
+-	Outputdefinition85Enum
+-	Outputdefinition86Enum
+-	Outputdefinition87Enum
+-	Outputdefinition88Enum
+-	Outputdefinition89Enum
+-	Outputdefinition8Enum
+-	Outputdefinition90Enum
+-	Outputdefinition91Enum
+-	Outputdefinition92Enum
+-	Outputdefinition93Enum
+-	Outputdefinition94Enum
+-	Outputdefinition95Enum
+-	Outputdefinition96Enum
+-	Outputdefinition97Enum
+-	Outputdefinition98Enum
+-	Outputdefinition99Enum
+-	Outputdefinition9Enum
+-	Outputdefinition100Enum
+-	#}}}
+-	InputsENDEnum
+-	#Other{{{
+-	AbsoluteEnum
+-	AdaptiveTimesteppingEnum
+-	AdjointBalancethickness2AnalysisEnum
+-	AdjointBalancethicknessAnalysisEnum
+-	AdjointHorizAnalysisEnum
+-	AggressiveMigrationEnum
+-	AmrBamgEnum
+-	AmrNeopzEnum
+-	AndroidFrictionCoefficientEnum
+-	ArrheniusEnum
+-	AutodiffJacobianEnum
+-	Balancethickness2AnalysisEnum
+-	Balancethickness2SolutionEnum
+-	BalancethicknessAnalysisEnum
+-	BalancethicknessApparentMassbalanceEnum
+-	BalancethicknessSoftAnalysisEnum
+-	BalancethicknessSoftSolutionEnum
+-	BalancethicknessSolutionEnum
+-	BalancevelocityAnalysisEnum
+-	BalancevelocitySolutionEnum
+-	BasalforcingsIsmip6Enum
+-	BasalforcingsPicoEnum
+-	BeckmannGoosseFloatingMeltRateEnum
+-	BedSlopeSolutionEnum
+-	BoolExternalResultEnum
+-	BoolInputEnum
+-	IntInputEnum
+-	DoubleInputEnum
+-	BoolParamEnum
+-	BoundaryEnum
+-	BuddJackaEnum
+-	CalvingDev2Enum
+-	CalvingHabEnum
+-	CalvingLevermannEnum
+-	CalvingVonmisesEnum
+-	CfdragcoeffabsgradEnum
+-	CfsurfacelogvelEnum
+-	CfsurfacesquareEnum
+-	CflevelsetmisfitEnum
+-	ChannelEnum
+-	ChannelAreaEnum
+-	ChannelAreaOldEnum
+-	ChannelDischargeEnum
+-	ClosedEnum
+-	ColinearEnum
+-	ConstraintsEnum
+-	ContactEnum
+-	ContourEnum
+-	ContoursEnum
+-	ControlInputEnum
+-	ControlInputGradEnum
+-	ControlInputMaxsEnum
+-	ControlInputMinsEnum
+-	ControlInputValuesEnum
+-	CrouzeixRaviartEnum
+-	CuffeyEnum
+-	CuffeyTemperateEnum
+-	DamageEvolutionAnalysisEnum
+-	DamageEvolutionSolutionEnum
+-	DataSetEnum
+-	DataSetParamEnum
+-	DatasetInputEnum
+-	DefaultAnalysisEnum
+-	DefaultCalvingEnum
+-	DenseEnum
+-	DependentObjectEnum
+-	DepthAverageAnalysisEnum
+-	DeviatoricStressErrorEstimatorEnum
+-	DivergenceEnum
+-	Domain3DsurfaceEnum
+-	DoubleArrayInputEnum
+-	ArrayInputEnum
+-	DoubleExternalResultEnum
+-	DoubleMatArrayParamEnum
+-	DoubleMatExternalResultEnum
+-	DoubleMatParamEnum
+-	DoubleParamEnum
+-	DoubleVecParamEnum
+-	ElementEnum
+-	ElementHookEnum
+-	ElementSIdEnum
+-	EnthalpyAnalysisEnum
+-	EsaAnalysisEnum
+-	EsaSolutionEnum
+-	EsaTransitionsEnum
+-	ExternalResultEnum
+-	ExtrapolationAnalysisEnum
+-	ExtrudeFromBaseAnalysisEnum
+-	ExtrudeFromTopAnalysisEnum
+-	FSApproximationEnum
+-	FSSolverEnum
+-	FSpressureEnum
+-	FSvelocityEnum
+-	FemModelEnum
+-	FileParamEnum
+-	FixedTimesteppingEnum
+-	FloatingAreaEnum
+-	FloatingAreaScaledEnum
+-	FloatingMeltRateEnum
+-	FreeEnum
+-	FreeSurfaceBaseAnalysisEnum
+-	FreeSurfaceTopAnalysisEnum
+-	FrontalForcingsDefaultEnum
+-	FrontalForcingsRignotEnum
+-	FsetEnum
+-	FullMeltOnPartiallyFloatingEnum
+-	GLheightadvectionAnalysisEnum
+-	GaussPentaEnum
+-	GaussSegEnum
+-	GaussTetraEnum
+-	GaussTriaEnum
+-	GenericOptionEnum
+-	GenericParamEnum
+-	GenericExternalResultEnum
+-	Gradient1Enum
+-	Gradient2Enum
+-	Gradient3Enum
+-	Gradient4Enum
+-	GroundedAreaEnum
+-	GroundedAreaScaledEnum
+-	GroundingOnlyEnum
+-	GroundinglineMassFluxEnum
+-	GsetEnum
+-	GslEnum
+-	HOApproximationEnum
+-	HOFSApproximationEnum
+-	HookEnum
+-	HydrologyDCEfficientAnalysisEnum
+-	HydrologyDCInefficientAnalysisEnum
+-	HydrologyGlaDSAnalysisEnum
+-	HydrologyGlaDSEnum
+-	HydrologyPismAnalysisEnum
+-	HydrologyShaktiAnalysisEnum
+-	HydrologyShreveAnalysisEnum
+-	HydrologySolutionEnum
+-	HydrologydcEnum
+-	HydrologypismEnum
+-	HydrologyshaktiEnum
+-	HydrologyshreveEnum
+-	IceMassEnum
+-	IceMassScaledEnum
+-	IceVolumeAboveFloatationEnum
+-	IceVolumeAboveFloatationScaledEnum
+-	IceVolumeEnum
+-	IceVolumeScaledEnum
+-	IcefrontMassFluxEnum
+-	IcefrontMassFluxLevelsetEnum
+-	IncrementalEnum
+-	IndexedEnum
+-	IntExternalResultEnum
+-	ElementInputEnum
+-	IntMatExternalResultEnum
+-	IntMatParamEnum
+-	IntParamEnum
+-	IntVecParamEnum
+-	InputsEnum
+-	InternalEnum
+-	IntersectEnum
+-	InversionVzObsEnum
+-	JEnum
+-	L1L2ApproximationEnum
+-	MLHOApproximationEnum
+-	L2ProjectionBaseAnalysisEnum
+-	L2ProjectionEPLAnalysisEnum
+-	LACrouzeixRaviartEnum
+-	LATaylorHoodEnum
+-	LambdaSEnum
+-	LevelsetAnalysisEnum
+-	LevelsetfunctionPicardEnum
+-	LinearFloatingMeltRateEnum
+-	LliboutryDuvalEnum
+-	LoadsEnum
+-	LoveAnalysisEnum
+-	LoveHiEnum
+-	LoveHrEnum
+-	LoveKernelsImagEnum
+-	LoveKernelsRealEnum
+-	LoveKiEnum
+-	LoveKrEnum
+-	LoveLiEnum
+-	LoveLrEnum
+-	LoveSolutionEnum
+-	MINIEnum
+-	MINIcondensedEnum
+-	MantlePlumeGeothermalFluxEnum
+-	MassFluxEnum
+-	MassconEnum
+-	MassconaxpbyEnum
+-	MassfluxatgateEnum
+-	MasstransportAnalysisEnum
+-	MasstransportSolutionEnum
+-	MatdamageiceEnum
+-	MatenhancediceEnum
+-	MaterialsEnum
+-	MatestarEnum
+-	MaticeEnum
+-	MatlithoEnum
+-	MathydroEnum
+-	MatrixParamEnum
+-	MaxAbsVxEnum
+-	MaxAbsVyEnum
+-	MaxAbsVzEnum
+-	MaxDivergenceEnum
+-	MaxVelEnum
+-	MaxVxEnum
+-	MaxVyEnum
+-	MaxVzEnum
+-	MelangeEnum
+-	MeltingAnalysisEnum
+-	MeshElementsEnum
+-	MeshXEnum
+-	MeshYEnum
+-	MinVelEnum
+-	MinVxEnum
+-	MinVyEnum
+-	MinVzEnum
+-	MismipFloatingMeltRateEnum
+-	MoulinEnum
+-	MpiDenseEnum
+-	MpiEnum
+-	MpiSparseEnum
+-	MumpsEnum
+-	NoFrictionOnPartiallyFloatingEnum
+-	NoMeltOnPartiallyFloatingEnum
+-	NodalEnum
+-	NodalvalueEnum
+-	NodeSIdEnum
+-	NoneApproximationEnum
+-	NoneEnum
+-	NumberedcostfunctionEnum
+-	NyeCO2Enum
+-	NyeH2OEnum
+-	NumericalfluxEnum
+-	OceantransportAnalysisEnum
+-	OceantransportSolutionEnum
+-	OldGradientEnum
+-	OneLayerP4zEnum
+-	OpenEnum
+-	OptionEnum
+-	ParamEnum
+-	ParametersEnum
+-	P0ArrayEnum
+-	P0DGEnum
+-	P1DGEnum
+-	P1P1Enum
+-	P1P1GLSEnum
+-	P1bubbleEnum
+-	P1bubblecondensedEnum
+-	P1xP2Enum
+-	P1xP3Enum
+-	P1xP4Enum
+-	P2Enum
+-	P2bubbleEnum
+-	P2bubblecondensedEnum
+-	P2xP1Enum
+-	P2xP4Enum
+-	PatersonEnum
+-	PengridEnum
+-	PenpairEnum
+-	PentaEnum
+-	PentaInputEnum
+-	ProfilerEnum
+-	ProfilingCurrentFlopsEnum
+-	ProfilingCurrentMemEnum
+-	ProfilingSolutionTimeEnum
+-	RegionaloutputEnum
+-	RegularEnum
+-	RecoveryAnalysisEnum
+-	RiftfrontEnum
+-	SamplingAnalysisEnum
+-	SamplingSolutionEnum
+-	SIAApproximationEnum
+-	SMBautoregressionEnum
+-	SMBcomponentsEnum
+-	SMBd18opddEnum
+-	SMBforcingEnum
+-	SMBgcmEnum
+-	SMBgembEnum
+-	SMBgradientsEnum
+-	SMBgradientscomponentsEnum
+-	SMBgradientselaEnum
+-	SMBhenningEnum
+-	SMBmeltcomponentsEnum
+-	SMBpddEnum
+-	SMBpddSicopolisEnum
+-	SMBsemicEnum
+-	SSAApproximationEnum
+-	SSAFSApproximationEnum
+-	SSAHOApproximationEnum
+-	ScaledEnum
+-	SealevelAbsoluteEnum
+-	SealevelEmotionEnum
+-	SealevelInertiaTensorXZEnum
+-	SealevelInertiaTensorYZEnum
+-	SealevelInertiaTensorZZEnum
+-	SealevelchangePolarMotionEnum
+-	SealevelNmotionEnum
+-	SealevelUmotionEnum
+-	SealevelchangeAnalysisEnum
+-	SegEnum
+-	SegInputEnum
+-	SegmentEnum
+-	SegmentRiftfrontEnum
+-	SeparateEnum
+-	SeqEnum
+-	SmbAnalysisEnum
+-	SmbSolutionEnum
+-	SmoothAnalysisEnum
+-	SoftMigrationEnum
+-	SpatialLinearFloatingMeltRateEnum
+-	SpcDynamicEnum
+-	SpcStaticEnum
+-	SpcTransientEnum
+-	SsetEnum
+-	StatisticsSolutionEnum
+-	SteadystateSolutionEnum
+-	StressIntensityFactorEnum
+-	StressbalanceAnalysisEnum
+-	StressbalanceConvergenceNumStepsEnum
+-	StressbalanceSIAAnalysisEnum
+-	StressbalanceSolutionEnum
+-	StressbalanceVerticalAnalysisEnum
+-	StringArrayParamEnum
+-	StringExternalResultEnum
+-	StringParamEnum
+-	SubelementFriction1Enum
+-	SubelementFriction2Enum
+-	SubelementMelt1Enum
+-	SubelementMelt2Enum
+-	SubelementMigrationEnum
+-	SurfaceSlopeSolutionEnum
+-	TaylorHoodEnum
+-	TetraEnum
+-	TetraInputEnum
+-	ThermalAnalysisEnum
+-	ThermalSolutionEnum
+-	ThicknessErrorEstimatorEnum
+-	TotalCalvingFluxLevelsetEnum
+-	TotalCalvingMeltingFluxLevelsetEnum
+-	TotalFloatingBmbEnum
+-	TotalFloatingBmbScaledEnum
+-	TotalGroundedBmbEnum
+-	TotalGroundedBmbScaledEnum
+-	TotalSmbEnum
+-	TotalSmbScaledEnum
+-	TransientArrayParamEnum
+-	TransientInputEnum
+-	TransientParamEnum
+-	TransientSolutionEnum
+-	TriaEnum
+-	TriaInputEnum
+-	UzawaPressureAnalysisEnum
+-	VectorParamEnum
+-	VertexEnum
+-	VertexLIdEnum
+-	VertexPIdEnum
+-	VertexSIdEnum
+-	VerticesEnum
+-	ViscousHeatingEnum
+-	WaterEnum
+-	XTaylorHoodEnum
+-	XYEnum
+-	XYZEnum
+-	#}}}
+-	MaximumNumberOfDefinitionsEnum
+-end
+-
+-function EnumToString(enum::IssmEnum)
+-
+-	#Make dictionnary from enums
+-	inst = instances(IssmEnum)
+-	syms = Symbol.(inst)
+-	enumdic = Dict(zip(inst, syms))
+-
+-	return enumdic[enum]
+-end
+-
+-function EnumToString(enum::Int64)
+-	return EnumToString(IssmEnum(enum))
+-end
+-
+-function StringToEnum(string::String)
+-
+-	#Make dictionnary from enums
+-	inst = instances(IssmEnum)
+-	syms = Symbol.(inst)
+-	enumdic = Dict(zip(syms, inst))
+-
+-	return enumdic[Symbol(string)]
+-end
+-
+-function StringToEnumInt(string::String)
+-	return Integer(StringToEnum(string))
+-end
+Index: ../trunk-jpl/src/jl/parameterization.jl
+===================================================================
+--- ../trunk-jpl/src/jl/parameterization.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/parameterization.jl	(nonexistent)
+@@ -1,55 +0,0 @@
+-include("classes.jl")
+-include("exp.jl")
+-
+-# setmask {{{
+-"""
+-SETMASK - establish boundaries between grounded and floating ice.
+-
+-   By default, ice is considered grounded. The contour floatingicename defines nodes 
+-   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+-   that are grounded (ie: ice rises, islands, etc ...)
+-   All input files are in the Argus format (extension .exp).
+-
+-   Usage:
+-      md=setmask(md,floatingicename,groundedicename)
+-
+-   Examples:
+-      md=setmask(md,'all','');
+-      md=setmask(md,'Iceshelves.exp','Islands.exp');
+-"""
+-function setmask(md::model,floatingicename::String,groundedicename::String)
+-
+-	elementonfloatingice = FlagElements( md, floatingicename);
+-	elementongroundedice = FlagElements( md, groundedicename);
+-
+-	elementonfloatingice = convert( Array{Float64}, (elementonfloatingice.>0) .&  (elementongroundedice.==0.))
+-	elementongroundedice = convert( Array{Float64}, elementonfloatingice.==0.)
+-
+-	vertexonfloatingice=zeros(md.mesh.numberofvertices)
+-	vertexongroundedice=zeros(md.mesh.numberofvertices)
+-
+-	vertexongroundedice[md.mesh.elements[findall(elementongroundedice.>0),:]] .= 1.
+-	vertexonfloatingice[findall(vertexongroundedice.==0.)] .= 1.
+-
+-	#define levelsets
+-	md.mask.ocean_levelset = vertexongroundedice
+-	md.mask.ocean_levelset[findall(vertexongroundedice .==0.)] .= -1.
+-	md.mask.ice_levelset = -1*ones(md.mesh.numberofvertices)
+-
+-	return md
+-end
+-#}}}
+-# FlagElements {{{
+-function FlagElements(md::model,region::String)
+-
+-	if isempty(region)
+-		flags = zeros(md.mesh.numberofelements)
+-	elseif region == "all"
+-		flags = ones(md.mesh.numberofelements)
+-	else
+-		flags = InContour(md.mesh.x,md.mesh.y,region);
+-	end
+-
+-	return flags
+-end
+-#}}}
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26628)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26629)
+@@ -5,11 +5,12 @@
+ 
+ module ISSM
+ 
+-include("classes.jl")
+-include("utils.jl")
+-include("triangle.jl")
+-include("parameterization.jl")
+-include("solve.jl")
+-#include("plotmodel.jl")
++include("md/classes.jl")
++include("md/exp.jl")
++include("md/utils.jl")
++include("md/triangle.jl")
++include("md/parameterization.jl")
++include("solve/solve.jl")
++#include("md/plotmodel.jl")
+ 
+ end
+Index: ../trunk-jpl/src/jl/md/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/classes.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/md/classes.jl	(revision 26629)
+@@ -0,0 +1,164 @@
++using Printf
++
++abstract type AbstractMesh end
++mutable struct Mesh2dTriangle <: AbstractMesh
++	numberofvertices::Int64
++	numberofelements::Int64
++	x::Vector{Float64}
++	y::Vector{Float64}
++	elements::Matrix{Int64}
++	segments::Matrix{Int64}
++	vertexonboundary::Vector{Bool}
++end
++function Mesh2dTriangle() #{{{
++	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
++end# }}}
++function Base.show(io::IO, this::Mesh2dTriangle)# {{{
++
++	println(io,typeof(this),":")
++	for name in fieldnames(typeof(this))
++		a=getfield(this,name)
++		#print(io,"   $(name) = ")
++		@printf "%19s: " name
++		if isa(a,String)
++			println(io, a)
++		elseif length(a)>1
++			if !isempty(a)
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,"empty")
++			end
++		else
++			println(io, a)
++		end
++	end
++end# }}}
++mutable struct Mesh3dPrism{T} <: AbstractMesh
++	numberofvertices::Int64
++	numberofelements::Int64
++	numberoflayers::Int64
++	x::Vector{Float64}
++	y::Vector{Float64}
++	z::Vector{Float64}
++	elements::Matrix{Int64}
++	segments::Matrix{Int64}
++	vertexonboundary::Vector{Bool}
++end
++function Mesh3dPrism() #{{{
++	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
++end# }}}
++
++mutable struct Geometry
++	surface::Vector{Float64}
++	base::Vector{Float64}
++	thickness::Vector{Float64}
++	bed::Vector{Float64}
++end
++function Geometry() #{{{
++	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Mask
++	ocean_levelset::Vector{Float64}
++	ice_levelset::Vector{Float64}
++end
++function Mask() #{{{
++	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Initialization
++	vx::Vector{Float64}
++	vy::Vector{Float64}
++end
++function Initialization() #{{{
++	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Stressbalance
++	spcvx::Vector{Float64}
++	spcvy::Vector{Float64}
++	restol::Float64
++	reltol::Float64
++	abstol::Float64
++	maxiter::Int64
++end
++function Stressbalance() #{{{
++	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 1.e-4, 0.01, 10., 100)
++end# }}}
++function Base.show(io::IO, this::Stressbalance)# {{{
++
++	println(io,typeof(this),":")
++	for name in fieldnames(typeof(this))
++		a=getfield(this,name)
++		#print(io,"   $(name) = ")
++		@printf "%19s: " name
++		if isa(a,String)
++			println(io, a)
++		elseif length(a)>1
++			if !isempty(a)
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,"empty")
++			end
++		else
++			println(io, a)
++		end
++	end
++end# }}}
++
++mutable struct Constants
++	g::Float64
++	yts::Float64
++end
++function Constants() #{{{
++	return Constants( 9.81,  365*24*3600.)
++end# }}}
++
++mutable struct Materials
++	rho_ice::Float64
++	rho_water::Float64
++	rho_freshwater::Float64
++	mu_water::Float64
++	heatcapacity::Float64
++	latentheat::Float64
++	thermalconductivity::Float64
++	temperateiceconductivity::Float64
++	effectiveconductivity_averaging::Int64
++	meltingpoint::Float64
++	beta::Float64
++	mixed_layer_capacity::Float64
++	thermal_exchange_velocity::Float64
++	rheology_B::Vector{Float64}
++	rheology_n::Vector{Float64}
++	rheology_law::String
++end
++function Materials() #{{{
++	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
++end# }}}
++
++mutable struct model
++	mesh::AbstractMesh
++	geometry::Geometry
++	mask::Mask
++	materials::Materials
++	initialization::Initialization
++	stressbalance::Stressbalance
++	constants::Constants
++end
++function model() #{{{
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants())
++end#}}}
++function Base.show(io::IO, md::model)# {{{
++
++	compact = get(io, :compact, false)
++
++	println(io,"Model:")
++	@printf "%19s: %-26s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
++	@printf "%19s: %-26s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
++	@printf "%19s: %-26s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
++	@printf "%19s: %-26s -- %s\n" "materials" typeof(md.materials) "material properties"
++	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
++	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
++	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
++
++end# }}}
+Index: ../trunk-jpl/src/jl/md/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/exp.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/md/exp.jl	(revision 26629)
+@@ -0,0 +1,137 @@
++#for exptool, look into this http://juliaplots.org/MakieReferenceImages/gallery//mouse_picking/index.html
++
++#exp object definition, constructor, and disp
++mutable struct ExpStruct #{{{
++	name::String
++	nods::Int32
++	density::Float64
++	x::Vector{Float64}
++   y::Vector{Float64}
++	closed::Bool
++end  #}}}
++function ExpStruct() #{{{
++	return ExpStruct("",0, 0., Vector{Float64}(undef,0), Vector{Float64}(undef,0), false)
++end# }}}
++function Base.show(io::IO, exp::ExpStruct)# {{{
++
++	compact = get(io, :compact, false)
++
++	println(io,"ExpStruct:")
++	for name in fieldnames(typeof(exp))
++		a=getfield(exp,name)
++		print(io,"   $(name) = ")
++		if !isempty(a)
++			if compact && eltype(a)<:Number && length(a)>3
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,a)
++			end
++		else
++			println(io,"empty")
++		end
++	end
++end# }}}
++
++#methods
++#expread {{{
++"""
++	EXPREAD - read a file exp and build a Structure
++
++	This function reads an *.exp* and builds a structure containing the fields x
++	and y corresponding to the coordinates, one for the filename of the exp
++	file, for the density, for the nodes, and a field 'closed' to indicate if the
++	domain is closed.
++
++	Usage:
++		exp=expread(filename)
++
++# Examples:
++```julia-repl
++julia> exp=expread('domainoutline.exp')
++```
++
++# Arguments:
++- filename: the ARGUS file to read
++"""
++function expread(filename::String)
++
++	#initialize output
++	contours = Vector{ExpStruct}(undef, 0)
++
++	#open file
++	f = open(filename, "r") do f
++
++		#initialize some variables
++		nprof = 0
++		line = 1
++
++		while !eof(f)
++
++			#read first line
++			A = readline(f); line += 1
++
++			#if isempty, go to the next line and try again
++			if isempty(A)
++				continue
++			else
++				#initialize new profile
++				nprof += 1 
++				exp = ExpStruct();
++			end
++
++			#extract profile name
++			if A[1:8]!="## Name:"
++				println("line $(line): $(A)")
++				error("Unexpected exp file formatting") 
++			end
++			if length(A)>8
++				exp.name = A[9:end]
++			end
++
++			#read Icon
++			A = readline(f); line += 1
++			if A[1:8]!="## Icon:" error("Unexpected exp file formatting") end
++
++			#read Info
++			A = readline(f); line += 1
++			if A[1:14]!="# Points Count"
++				println("line $(line): $(A)")
++				error("Unexpected exp file formatting") 
++			end
++
++			#Reads number of nods and density
++			A = readline(f); line += 1
++			A = parse.(Float64, split(A))
++			if length(A) != 2 error("Unexpected exp file formatting") end
++			exp.nods = A[1]; exp.density = A[2]
++
++			#Allocate arrays
++			if exp.nods<=0 error("Unexpected exp file formatting") end
++			exp.x = Vector{Float64}(undef,exp.nods)
++			exp.y = Vector{Float64}(undef,exp.nods)
++
++			#Read coordinates
++			A = readline(f); line += 1
++			if A[1:13]!="# X pos Y pos" error("Unexpected exp file formatting") end
++			for i in 1:exp.nods
++				A = readline(f); line += 1
++				A = parse.(Float64, split(A))
++				if length(A) != 2 error("Unexpected exp file formatting") end
++				if any(isnan.(A)) error("NaNs found in coordinate") end
++				exp.x[i] = A[1]; exp.y[i] = A[2]
++			end
++
++			#check if closed
++			if exp.nods>1 && exp.x[1]==exp.x[end] && exp.y[1]==exp.y[end]
++				exp.closed = true
++			else
++				exp.closed = false
++			end
++
++			#add profile to list
++			push!(contours, exp)
++		end
++	end
++
++	return contours
++end# }}}
+Index: ../trunk-jpl/src/jl/md/parameterization.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/parameterization.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/md/parameterization.jl	(revision 26629)
+@@ -0,0 +1,52 @@
++# setmask {{{
++"""
++SETMASK - establish boundaries between grounded and floating ice.
++
++   By default, ice is considered grounded. The contour floatingicename defines nodes 
++   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
++   that are grounded (ie: ice rises, islands, etc ...)
++   All input files are in the Argus format (extension .exp).
++
++   Usage:
++      md=setmask(md,floatingicename,groundedicename)
++
++   Examples:
++      md=setmask(md,'all','');
++      md=setmask(md,'Iceshelves.exp','Islands.exp');
++"""
++function setmask(md::model,floatingicename::String,groundedicename::String)
++
++	elementonfloatingice = FlagElements( md, floatingicename);
++	elementongroundedice = FlagElements( md, groundedicename);
++
++	elementonfloatingice = convert( Array{Float64}, (elementonfloatingice.>0) .&  (elementongroundedice.==0.))
++	elementongroundedice = convert( Array{Float64}, elementonfloatingice.==0.)
++
++	vertexonfloatingice=zeros(md.mesh.numberofvertices)
++	vertexongroundedice=zeros(md.mesh.numberofvertices)
++
++	vertexongroundedice[md.mesh.elements[findall(elementongroundedice.>0),:]] .= 1.
++	vertexonfloatingice[findall(vertexongroundedice.==0.)] .= 1.
++
++	#define levelsets
++	md.mask.ocean_levelset = vertexongroundedice
++	md.mask.ocean_levelset[findall(vertexongroundedice .==0.)] .= -1.
++	md.mask.ice_levelset = -1*ones(md.mesh.numberofvertices)
++
++	return md
++end
++#}}}
++# FlagElements {{{
++function FlagElements(md::model,region::String)
++
++	if isempty(region)
++		flags = zeros(md.mesh.numberofelements)
++	elseif region == "all"
++		flags = ones(md.mesh.numberofelements)
++	else
++		flags = InContour(md.mesh.x,md.mesh.y,region);
++	end
++
++	return flags
++end
++#}}}
+Index: ../trunk-jpl/src/jl/md/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/plotmodel.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/md/plotmodel.jl	(revision 26629)
+@@ -0,0 +1,45 @@
++import ColorSchemes.jet
++using GLMakie
++using .ISSM
++
++function plotmodel(md::ISSM.model,data::Vector)
++
++	vertexcolor  = :black
++	facetcolor   = :blue
++	showvertices = true
++	showfacets   = true
++
++	if data isa AbstractVector
++
++		if length(data)==md.mesh.numberofelements
++			# vector of polygons
++			x = md.mesh.x
++			y = md.mesh.y
++			index = md.mesh.elements
++			ps = [Makie.GeometryBasics.Polygon([Point2(x[index[i,1]], y[index[i,1]]), Point2(x[index[i,2]], y[index[i,2]]), Point2(x[index[i,3]], y[index[i,3]])])
++					for i in 1:md.mesh.numberofelements]
++
++			fig, ax, h = Makie.poly(ps, color = data, colormap = jet)
++
++			#Add colorbar
++			Colorbar(fig[1, 2], limits = (minimum(data), maximum(data)), colormap = jet)
++		elseif length(data)==md.mesh.numberofvertices
++			fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
++
++			#Add colorbar
++			#Colorbar(fig[1, 2], h, width=25)
++		else
++			error("data of size "*string(length(data))*" not supported yet!")
++		end
++	else
++		# default to single color
++		@assert length(data)==1
++		fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
++	end
++
++	if showvertices
++		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
++	end
++
++	return fig
++end
+Index: ../trunk-jpl/src/jl/md/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/triangle.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/md/triangle.jl	(revision 26629)
+@@ -0,0 +1,178 @@
++
++#Class Triangle's triangulateio
++mutable struct CTriangulateIO #{{{
++
++    pointlist :: Ptr{Cdouble}
++    pointattributelist :: Ptr{Cdouble}
++    pointmarkerlist :: Ptr{Cint}
++    numberofpoints :: Cint
++    numberofpointattributes :: Cint
++    
++    trianglelist :: Ptr{Cint}
++    triangleattributelist :: Ptr{Cdouble}
++    trianglearealist :: Ptr{Cdouble}
++    neighborlist :: Ptr{Cint}
++    numberoftriangles :: Cint
++    numberofcorners :: Cint
++    numberoftriangleattributes :: Cint
++    
++    segmentlist :: Ptr{Cint}
++    segmentmarkerlist :: Ptr{Cint}
++    numberofsegments :: Cint
++
++    holelist :: Ptr{Cdouble}
++    numberofholes :: Cint
++
++    regionlist :: Ptr{Cdouble}
++    numberofregions :: Cint
++
++    edgelist :: Ptr{Cint}
++    edgemarkerlist :: Ptr{Cint}
++    normlist :: Ptr{Cdouble}
++    numberofedges :: Cint
++ end  #}}}
++function CTriangulateIO() #{{{
++	return CTriangulateIO(C_NULL, C_NULL, C_NULL, 0, 0,
++								 C_NULL, C_NULL, C_NULL, C_NULL, 0, 0, 0,
++								 C_NULL, C_NULL, 0,
++								 C_NULL, 0,
++								 C_NULL, 0,
++								 C_NULL, C_NULL, C_NULL, 0)
++end# }}}
++function Base.show(io::IO, tio::CTriangulateIO)# {{{
++	println(io,"CTriangulateIO(")
++	for name in fieldnames(typeof(tio))
++		a=getfield(tio,name)
++		print(io,"$(name) = ")
++		println(io,a)
++	end
++	println(io,")")
++end# }}}
++
++using Printf #needed for sprintf
++
++"""
++TRIANGLE - create model mesh using the triangle package
++
++	This function creates a model mesh using Triangle and a domain outline, to
++	within a certain resolution
++#Arguments
++ - md is a model tuple
++ - domainname is the name of an Argus domain outline file
++ - resolution:  is a characteristic length for the mesh (same unit as the domain outline unit)
++
++# Usage:
++ - md=triangle(md,domainname,resolution)
++# Examples:
++ - md=triangle(md,'DomainOutline.exp',1000);
++ - md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
++"""
++function triangle(md::model,domainname::String,resolution::Float64) #{{{
++
++	#read input file
++	contours = expread(domainname)
++	area     = resolution^2
++
++	#Initialize i/o structures
++	ctio_in  = CTriangulateIO();
++	ctio_out = CTriangulateIO();
++	vor_out  = CTriangulateIO();
++
++	#Construct input structure
++	numberofpoints   = 0
++	numberofsegments = 0
++	for i in 1:length(contours)
++		numberofpoints   += contours[i].nods-1
++		numberofsegments += contours[i].nods-1
++	end
++	numberofpointattributes = 1
++
++	pointlist=Array{Cdouble,2}(undef,2,numberofpoints)
++	count = 0
++	for i in 1:length(contours)
++		nods = contours[i].nods
++		pointlist[1,count+1:count+nods-1] = contours[i].x[1:end-1]
++		pointlist[2,count+1:count+nods-1] = contours[i].y[1:end-1]
++		count += (nods-1)
++	end
++	pointattributelist=Array{Cdouble,1}(undef,numberofpoints)
++	pointmarkerlist=Array{Cint,1}(undef,numberofpoints)
++	for i in 1:numberofpoints
++		pointmarkerlist[i]=0
++		pointattributelist[i]=0.
++	end
++
++	counter=0;
++   backcounter=0;
++	segmentlist=Array{Cint,2}(undef,2,numberofsegments)
++	segmentmarkerlist=Array{Cint,1}(undef,numberofsegments)
++	segmentmarkerlist[:].=0
++	for i in 1:length(contours)
++		nods = contours[i].nods
++		segmentlist[1,counter+1:counter+nods-2] = collect(counter+0:counter+nods-3)
++		segmentlist[2,counter+1:counter+nods-2] = collect(counter+1:counter+nods-2)
++		counter+=nods-2
++		#close profile
++		segmentlist[1,counter+1]=counter
++		segmentlist[2,counter+1]=backcounter
++		counter+=1
++		backcounter=counter
++	end
++
++	numberofregions = 0
++	numberofholes = length(contours)-1
++	holelist = Array{Cdouble,2}(undef,2,numberofholes)
++	if numberofholes>0
++		 for i in 2:length(contours)
++			 xA=contours[i].x[1]; xB=contours[i].x[end-1]
++			 yA=contours[i].y[1]; yB=contours[i].y[end-1]
++			 xC=(xA+xB)/2;        yC=(yA+yB)/2;
++			 xD=xC+tan(10. /180. *pi)*(yC-yA);
++			 yD=yC+tan(10. /180. *pi)*(xA-xC);
++			 xE=xC-tan(10. /180. *pi)*(yC-yA);
++			 yE=yC-tan(10. /180. *pi)*(xA-xC);
++			 holelist[1,i-1] = xD
++			 holelist[2,i-1] = yD
++		 end
++	end
++
++	#based on this, prepare input structure
++	ctio_in.numberofpoints = numberofpoints
++	ctio_in.pointlist=pointer(pointlist)
++	ctio_in.numberofpointattributes=numberofpointattributes
++	ctio_in.pointattributelist=pointer(pointattributelist)
++	ctio_in.pointmarkerlist=pointer(pointmarkerlist)
++	ctio_in.numberofsegments=numberofsegments
++	ctio_in.segmentlist=pointer(segmentlist)
++	ctio_in.segmentmarkerlist = pointer(segmentmarkerlist)
++	ctio_in.numberofholes=numberofholes
++	ctio_in.holelist=pointer(holelist)
++	ctio_in.numberofregions=0
++
++	#Call triangle using ISSM's default options
++	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
++	#rc=ccall( (:triangulate,"libtriangle"),
++	rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
++				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
++				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
++
++	#post process output
++	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
++	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
++	segments  = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.segmentlist,  (2,Int(ctio_out.numberofsegments)), own=true))' .+1
++	
++	#assign output
++	md.mesh = Mesh2dTriangle()
++	md.mesh.numberofvertices = ctio_out.numberofpoints
++	md.mesh.numberofelements = ctio_out.numberoftriangles
++	md.mesh.x                = points[:,1]
++	md.mesh.y                = points[:,2]
++	md.mesh.elements         = triangles
++	md.mesh.segments         = segments
++
++	#post processing
++	md.mesh.vertexonboundary = zeros(Bool,md.mesh.numberofvertices)
++	md.mesh.vertexonboundary[md.mesh.segments] .= true
++
++   return md
++end#}}}
+Index: ../trunk-jpl/src/jl/md/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/utils.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/md/utils.jl	(revision 26629)
+@@ -0,0 +1,108 @@
++#utils
++function issmdir() #{{{
++	issmdir = ENV["ISSM_DIR"]
++
++	if isempty(issmdir)
++		error("Could not determine the location of ISSM")
++	else
++		return issmdir
++	end
++end#}}}
++function archread(filename::String,variablename::String) #{{{
++
++	#initialize variables
++	found = false
++
++	#open file
++	output = open(filename, "r") do f
++
++		while !eof(f)
++			reclen  = bswap(read(f, Int32))
++			rectype = bswap(read(f, Int32))
++			if rectype!=1
++				error("Expected variable of type string")
++			else
++				fieldname_length = bswap(read(f, Int32))
++				field_name = String(read(f, fieldname_length))
++			end
++			rec_length = bswap(read(f, Int32))
++			field_type = bswap(read(f, Int32))
++			if field_type==2
++				data = bswap(read(f, Float64))
++			elseif field_type==3
++				rows = bswap(read(f, Int32))
++				cols = bswap(read(f, Int32))
++				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
++				data .= ntoh.(data)
++				data = reshape(data, (rows,cols))
++				data = collect(data)
++				if cols == 1
++					data = vec(data)
++				end
++			else
++				error("Error: Encountered invalid field type when reading data.")
++			end
++
++			if field_name == variablename
++				found = true
++				return data
++			end
++		end
++	end
++
++	return output
++end# }}}
++function InterpFromMeshToMesh2d(index::Array,x::Vector,y::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
++	#prepare input arrays
++	nods = Cint(length(x))
++	nels = Cint(size(index,1))
++	nods_interp = Cint(length(xout))
++	Cindex=Array{Cint,1}(undef,length(index))
++	for i in 1:size(index,1)
++		for j in 1:3
++			Cindex[(i-1)*3+j] = Int32(index[i,j])
++		end
++	end
++	Cx    = Array{Cdouble,1}(undef,nods)
++	Cy    = Array{Cdouble,1}(undef,nods)
++	Cdata = Array{Cdouble,1}(undef,nods)
++	for i in 1:nods
++		Cx[i]    = x[i]
++		Cy[i]    = y[i]
++		Cdata[i] = data[i]
++	end
++	Cxout = Array{Cdouble,1}(undef,nods_interp)
++	Cyout = Array{Cdouble,1}(undef,nods_interp)
++	for i in 1:nods_interp
++		Cxout[i] = xout[i]
++		Cyout[i] = yout[i]
++	end
++
++	Cdataout = Vector{Float64}(undef,nods_interp)
++
++	#This is not working....
++	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
++				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
++				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
++				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
++
++	#Process output
++	dataout = Vector{Float64}(undef,nods_interp)
++	for i in 1:nods_interp
++		dataout[i] = Cdataout[i]
++	end
++
++	return dataout
++end #}}}
++function solve(md::model,solution::String) #{{{
++
++	if solution=="sb" || solution=="Stressbalance"
++		solutionstring = "StressbalanceSolution"
++	else
++		error("solutionstring "*solution*" not supported!");
++	end
++
++	IssmCore(md)
++
++	return md
++end #}}}
+Index: ../trunk-jpl/src/jl/solve/analyses.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26629)
+@@ -0,0 +1,91 @@
++#Analysis class definitions
++abstract type Analysis end
++struct StressbalanceAnalysis <: Analysis#{{{
++end #}}}
++
++#Stress balance analysis
++function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
++	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
++	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
++	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
++	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
++end#}}}
++function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
++
++	numdof = 2
++	for i in 1:md.mesh.numberofvertices
++		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
++	end
++end#}}}
++function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
++
++	#Provide node indices to element
++	for i in 1:md.mesh.numberofvertices
++		Update(elements[i],inputs,i,md,P1Enum)
++	end
++
++	#Add necessary inputs to perform this analysis
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
++
++end#}}}
++function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
++
++	#load constraints from model
++	spcvx = md.stressbalance.spcvx
++	spcvy = md.stressbalance.spcvy
++
++	count = 1
++	for i in 1:md.mesh.numberofvertices
++		if ~isnan(spcvx[i])
++			push!(constraints,Constraint(count,i,1,spcvx[i]))
++			count+=1
++		end
++		if ~isnan(spcvy[i])
++			push!(constraints,Constraint(count,i,2,spcvy[i]))
++			count+=1
++		end
++	end
++
++end#}}}
++function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
++
++	#Fetch parameters relevant to solution sequence
++	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
++	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
++	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
++	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
++
++	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
++	error("STOP")
++
++end #}}}
++function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
++
++	#Initialize number of iterations
++	count = 0
++	converged = false
++
++	#Get existing solution
++	ug = GetSolutionFromInputsx(analysis,femmodel)
++
++	#Loop until we reach convergence
++	while(~converged)
++
++		error("not implemented yet")
++
++		#Increase count
++		count += 1
++		if(count>maxiter)
++			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
++			converged = true
++		end
++	end
++
++	error("STOP")
++
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/constraints.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/constraints.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/constraints.jl	(revision 26629)
+@@ -0,0 +1,18 @@
++#Constraint class definition
++struct Constraint #{{{
++	id::Int64
++	nodeid::Int64
++	dof::Int8
++	value::Float64
++end# }}}
++
++#Constraint functions
++function ConstrainNode(constraint::Constraint,nodes::Vector{Node},parameters::Parameters) #{{{
++
++	#Chase through nodes and find the node to which this SpcStatic apply
++	node = nodes[constraint.nodeid]
++
++	#Apply Constraint
++	ApplyConstraint(node,constraint.dof,constraint.value)
++
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26629)
+@@ -0,0 +1,53 @@
++#Tria class definition
++mutable struct Tria #{{{
++	sid::Int64
++	pid::Int64
++	#vertexids::Int64[3]
++	#vertices::Vertex[3]
++	vertexids::Vector{Int64}
++	vertices::Vector{Vertex}
++	nodeids::Vector{Int64}
++	nodes::Vector{Node}
++	parameters::Parameters
++	inputs::Inputs
++end# }}}
++
++#Element functions
++function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
++	if size(data,1)==inputs.numberofelements
++		SetTriaInput(inputs,enum,P0Enum,element.sid,data[element.sid])
++	elseif size(data,1)==inputs.numberofvertices
++		SetTriaInput(inputs,enum,P1Enum,element.vertexids,data[element.vertexids])
++	else
++		error("size ",size(data,1)," not supported yet");
++	end
++end #}}}
++function Update(element::Tria,inputs::Inputs,index::Int64,md::model,finiteelement::IssmEnum) #{{{
++
++	if finiteelement==P1Enum
++		numnodes = 3
++		element.nodeids    = Vector{Int64}(undef,numnodes)
++		element.nodeids[1] = md.mesh.elements[index,1]
++		element.nodeids[2] = md.mesh.elements[index,2]
++		element.nodeids[3] = md.mesh.elements[index,3]
++	else
++		error("not supported yet")
++	end
++end #}}}
++function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) # {{{
++
++   #Configure vertices
++   for i in 1:3
++      element.vertices[i] = vertices[element.vertexids[i]]
++   end
++
++	#Configure nodes (assuming P1 finite elements)
++	for i in 1:3
++		element.nodes[i] = nodes[element.nodeids[i]]
++	end
++
++	#Point to real datasets
++	element.parameters = parameters
++	element.inputs     = inputs
++	
++end # }}}
+Index: ../trunk-jpl/src/jl/solve/femmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/femmodel.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/femmodel.jl	(revision 26629)
+@@ -0,0 +1,13 @@
++#femmodel class definition
++mutable struct FemModel #{{{
++	elements::Vector{Tria}
++	vertices::Vector{Vertex}
++	nodes::Vector{Node}
++	parameters::Parameters
++	inputs::Inputs
++	constraints::Vector{Constraint}
++	#loads::Vector{Loads}
++end#}}}
++
++#femmodel functions
++
+Index: ../trunk-jpl/src/jl/solve/gauss.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/gauss.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26629)
+@@ -0,0 +1,41 @@
++#Gauss class definition
++struct GaussTria #{{{
++	numgauss::Int64
++	weights::Vector{Float64}
++	coords1::Vector{Float64}
++	coords2::Vector{Float64}
++	coords3::Vector{Float64}
++end #}}}
++
++#Gauss constructor
++function GaussTria(order::Int64) #{{{
++
++	#=Gauss quadrature points for the triangle.
++	Higher-order points from D.A. Dunavant, "High Degree Efficient
++	Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
++	Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.=#
++
++	if(order==1)
++		npoints = 1
++		weights = [1.732050807568877]
++		coords1 = [0.333333333333333]
++		coords2 = [0.333333333333333]
++		coords3 = [0.333333333333333]
++	elseif(order==2)
++		weights = [0.577350269189625, 0.577350269189625, 0.577350269189625]
++		coords1 = [0.666666666666667, 0.166666666666667, 0.166666666666667]
++		coords2 = [0.166666666666667, 0.666666666666667, 0.166666666666667]
++		coords3 = [0.166666666666667, 0.166666666666667, 0.666666666666667]
++	elseif(order==3)
++		npoints=4
++		weights = [-0.974278579257493, 0.902109795608790, 0.902109795608790, 0.902109795608790]
++		coords1 = [0.333333333333333, 0.600000000000000, 0.200000000000000, 0.200000000000000]
++		coords2 = [0.333333333333333, 0.200000000000000, 0.600000000000000, 0.200000000000000]
++		coords3 = [0.333333333333333, 0.200000000000000, 0.200000000000000, 0.600000000000000]
++	else
++		error("order ",order," not supported yet");
++	end
++
++	return GaussTria(npoints,weights,coords1,coords2,coords3)
++end# }}}
++
+Index: ../trunk-jpl/src/jl/solve/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/inputs.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26629)
+@@ -0,0 +1,86 @@
++#Input class definition
++abstract type Input end
++struct BoolInput <: Input#{{{
++	enum::IssmEnum
++	values::Matrix{Bool}
++end# }}}
++struct IntInput <: Input#{{{
++	enum::IssmEnum
++	values::Matrix{Int64}
++end# }}}
++struct ElementInput <: Input#{{{
++	enum::IssmEnum
++	interp::IssmEnum
++	values::Vector{Float64}
++end# }}}
++
++#Inputs dataset definition
++mutable struct Inputs #{{{
++	numberofelements::Int64
++	numberofvertices::Int64
++	lookup::Dict{IssmEnum,Input}
++end# }}}
++
++#Inputs functions
++function SetInput(inputs::Inputs,enum::IssmEnum,index::Int64,value::Bool) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofelements > 0
++		input = BoolInput(enum,zeros(Bool,inputs.numberofelements))
++		inputs.lookup[enum] = BoolInput(enum,zeros(Bool,inputs.numberofelements))
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=BoolInput error("not consistent") end
++
++	#set value
++	@assert index>0 && index<=inputs.numberofelements
++	input.values[index] = value
++end#}}}
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int64,value::Float64) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofelements > 0
++		if interp==P0Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements))
++		elseif interp==P1Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
++		else
++			error("not supported yet")
++		end
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=ElementInput error("input type not consistent") end
++	if interp!=input.interp        error("input interpolations not consistent") end
++
++	#set value
++	input.values[index] = value
++end#}}}
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int64},values::Vector{Float64}) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofvertices>0
++		if interp==P1Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
++		else
++			error("not supported yet")
++		end
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=ElementInput error("input type not consistent") end
++	if interp!=input.interp        error("input interpolations not consistent") end
++
++	#set value
++	input.values[indices] = values
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/issmenums.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/issmenums.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/issmenums.jl	(revision 26629)
+@@ -0,0 +1,1544 @@
++@enum IssmEnum begin
++	ParametersSTARTEnum
++	#Parameters{{{
++	AdolcParamEnum
++	AmrDeviatoricErrorGroupThresholdEnum
++	AmrDeviatoricErrorMaximumEnum
++	AmrDeviatoricErrorResolutionEnum
++	AmrDeviatoricErrorThresholdEnum
++	AmrErrEnum
++	AmrFieldEnum
++	AmrGradationEnum
++	AmrGroundingLineDistanceEnum
++	AmrGroundingLineResolutionEnum
++	AmrHmaxEnum
++	AmrHminEnum
++	AmrIceFrontDistanceEnum
++	AmrIceFrontResolutionEnum
++	AmrKeepMetricEnum
++	AmrLagEnum
++	AmrLevelMaxEnum
++	AmrRestartEnum
++	AmrThicknessErrorGroupThresholdEnum
++	AmrThicknessErrorMaximumEnum
++	AmrThicknessErrorResolutionEnum
++	AmrThicknessErrorThresholdEnum
++	AmrTypeEnum
++	AnalysisCounterEnum
++	AnalysisTypeEnum
++	AugmentedLagrangianREnum
++	AugmentedLagrangianRholambdaEnum
++	AugmentedLagrangianRhopEnum
++	AugmentedLagrangianRlambdaEnum
++	AugmentedLagrangianThetaEnum
++	AutodiffCbufsizeEnum
++	AutodiffDependentObjectsEnum
++	AutodiffDriverEnum
++	AutodiffFosForwardIndexEnum
++	AutodiffFosReverseIndexEnum
++	AutodiffFovForwardIndicesEnum
++	AutodiffGcTriggerMaxSizeEnum
++	AutodiffGcTriggerRatioEnum
++	AutodiffIsautodiffEnum
++	AutodiffLbufsizeEnum
++	AutodiffNumDependentsEnum
++	AutodiffNumIndependentsEnum
++	AutodiffObufsizeEnum
++	AutodiffTapeAllocEnum
++	AutodiffTbufsizeEnum
++	AutodiffXpEnum
++	BalancethicknessStabilizationEnum
++	BarystaticContributionsEnum
++	BasalforcingsBottomplumedepthEnum
++	BasalforcingsCrustthicknessEnum
++	BasalforcingsDeepwaterElevationEnum
++	BasalforcingsDeepwaterMeltingRateEnum
++	BasalforcingsDtbgEnum
++	BasalforcingsEnum
++	BasalforcingsIsmip6AverageTfEnum
++	BasalforcingsIsmip6BasinAreaEnum
++	BasalforcingsIsmip6DeltaTEnum
++	BasalforcingsIsmip6Gamma0Enum
++	BasalforcingsIsmip6IsLocalEnum
++	BasalforcingsIsmip6NumBasinsEnum
++	BasalforcingsIsmip6TfDepthsEnum
++	BasalforcingsLowercrustheatEnum
++	BasalforcingsMantleconductivityEnum
++	BasalforcingsNusseltEnum
++	BasalforcingsPicoAverageOverturningEnum
++	BasalforcingsPicoAverageSalinityEnum
++	BasalforcingsPicoAverageTemperatureEnum
++	BasalforcingsPicoBoxAreaEnum
++	BasalforcingsPicoFarOceansalinityEnum
++	BasalforcingsPicoFarOceantemperatureEnum
++	BasalforcingsPicoGammaTEnum
++	BasalforcingsPicoIsplumeEnum
++	BasalforcingsPicoMaxboxcountEnum
++	BasalforcingsPicoNumBasinsEnum
++	BasalforcingsPlumeradiusEnum
++	BasalforcingsPlumexEnum
++	BasalforcingsPlumeyEnum
++	BasalforcingsThresholdThicknessEnum
++	BasalforcingsTopplumedepthEnum
++	BasalforcingsUppercrustheatEnum
++	BasalforcingsUppercrustthicknessEnum
++	BasalforcingsUpperdepthMeltEnum
++	BasalforcingsUpperwaterElevationEnum
++	BasalforcingsUpperwaterMeltingRateEnum
++	CalvingCrevasseDepthEnum
++	CalvingCrevasseThresholdEnum
++	CalvingHeightAboveFloatationEnum
++	CalvingLawEnum
++	CalvingMinthicknessEnum
++	ConfigurationTypeEnum
++	ConstantsGEnum
++	ConstantsNewtonGravityEnum
++	ConstantsReferencetemperatureEnum
++	ConstantsYtsEnum
++	ControlInputSizeMEnum
++	ControlInputSizeNEnum
++	ControlInputInterpolationEnum
++	CumBslcEnum
++	CumBslcIceEnum
++	CumBslcHydroEnum
++	CumBslcOceanEnum
++	CumBslcIcePartitionEnum
++	CumBslcHydroPartitionEnum
++	CumBslcOceanPartitionEnum
++	CumGmtslcEnum
++	CumGmslcEnum
++	DamageC1Enum
++	DamageC2Enum
++	DamageC3Enum
++	DamageC4Enum
++	DamageEnum
++	DamageEquivStressEnum
++	DamageEvolutionNumRequestedOutputsEnum
++	DamageEvolutionRequestedOutputsEnum
++	DamageHealingEnum
++	DamageKappaEnum
++	DamageLawEnum
++	DamageMaxDamageEnum
++	DamageStabilizationEnum
++	DamageStressThresholdEnum
++	DamageStressUBoundEnum
++	DebugProfilingEnum
++	DomainDimensionEnum
++	DomainTypeEnum
++	DslModelEnum
++	DslModelidEnum
++	DslNummodelsEnum
++	SolidearthIsExternalEnum
++	SolidearthExternalNatureEnum
++	SolidearthExternalModelidEnum
++	SolidearthExternalNummodelsEnum
++	SolidearthSettingsComputeBpGrdEnum
++	EarthIdEnum
++	ElasticEnum
++	EplZigZagCounterEnum
++	EsaHElasticEnum
++	EsaHemisphereEnum
++	EsaRequestedOutputsEnum
++	EsaUElasticEnum
++	ExtrapolationVariableEnum
++	FemModelCommEnum
++	FieldsEnum
++	FlowequationFeFSEnum
++	FlowequationIsFSEnum
++	FlowequationIsHOEnum
++	FlowequationIsL1L2Enum
++	FlowequationIsMLHOEnum
++	FlowequationIsSIAEnum
++	FlowequationIsSSAEnum
++	FlowequationIsNitscheEnum
++	FeFSNitscheGammaEnum
++	FrictionCouplingEnum
++	FrictionDeltaEnum
++	FrictionEffectivePressureLimitEnum
++	FrictionFEnum
++	FrictionGammaEnum
++	FrictionLawEnum
++	FrictionPseudoplasticityExponentEnum
++	FrictionThresholdSpeedEnum
++	FrictionVoidRatioEnum
++	FrontalForcingsBasinIcefrontAreaEnum
++	FrontalForcingsNumberofBasinsEnum
++	FrontalForcingsParamEnum
++	GrdModelEnum
++	GroundinglineFrictionInterpolationEnum
++	GroundinglineMeltInterpolationEnum
++	GroundinglineMigrationEnum
++	HydrologyAveragingEnum
++	HydrologyCavitySpacingEnum
++	HydrologyChannelConductivityEnum
++	HydrologyChannelSheetWidthEnum
++	HydrologyEnglacialVoidRatioEnum
++	HydrologyIschannelsEnum
++	HydrologyMeltFlagEnum
++	HydrologyModelEnum
++	HydrologyNumRequestedOutputsEnum
++	HydrologyPressureMeltCoefficientEnum
++	HydrologyRelaxationEnum
++	HydrologyRequestedOutputsEnum
++	HydrologySedimentKmaxEnum
++	HydrologyStepsPerStepEnum
++	HydrologyStorageEnum
++	HydrologydcEplColapseThicknessEnum
++	HydrologydcEplConductivityEnum
++	HydrologydcEplInitialThicknessEnum
++	HydrologydcEplLayerCompressibilityEnum
++	HydrologydcEplMaxThicknessEnum
++	HydrologydcEplPoreWaterMassEnum
++	HydrologydcEplThickCompEnum
++	HydrologydcEplflipLockEnum
++	HydrologydcIsefficientlayerEnum
++	HydrologydcLeakageFactorEnum
++	HydrologydcMaxIterEnum
++	HydrologydcPenaltyFactorEnum
++	HydrologydcPenaltyLockEnum
++	HydrologydcRelTolEnum
++	HydrologydcSedimentlimitEnum
++	HydrologydcSedimentlimitFlagEnum
++	HydrologydcSedimentLayerCompressibilityEnum
++	HydrologydcSedimentPoreWaterMassEnum
++	HydrologydcSedimentPorosityEnum
++	HydrologydcSedimentThicknessEnum
++	HydrologydcTransferFlagEnum
++	HydrologydcUnconfinedFlagEnum
++	HydrologyshreveStabilizationEnum
++	IcecapToEarthCommEnum
++	IndexEnum
++	InputFileNameEnum
++	DirectoryNameEnum
++	IndicesEnum
++	InputToDepthaverageInEnum
++	InputToDepthaverageOutEnum
++	InputToExtrudeEnum
++	InputToL2ProjectEnum
++	InputToSmoothEnum
++	InversionAlgorithmEnum
++	InversionControlParametersEnum
++	InversionControlScalingFactorsEnum
++	InversionCostFunctionsEnum
++	InversionDxminEnum
++	InversionGatolEnum
++	InversionGradientScalingEnum
++	InversionGrtolEnum
++	InversionGttolEnum
++	InversionIncompleteAdjointEnum
++	InversionIscontrolEnum
++	InversionMaxiterEnum
++	InversionMaxiterPerStepEnum
++	InversionMaxstepsEnum
++	InversionNstepsEnum
++	InversionNumControlParametersEnum
++	InversionNumCostFunctionsEnum
++	InversionStepThresholdEnum
++	InversionTypeEnum
++	IvinsEnum
++	IsSlcCouplingEnum
++	LevelsetKillIcebergsEnum
++	LevelsetReinitFrequencyEnum
++	LevelsetStabilizationEnum
++	LockFileNameEnum
++	LoveAllowLayerDeletionEnum
++	LoveCoreMantleBoundaryEnum
++	LoveEarthMassEnum
++	LoveForcingTypeEnum
++	LoveFrequenciesEnum
++	LoveIsTemporalEnum
++	LoveG0Enum
++	LoveGravitationalConstantEnum
++	LoveInnerCoreBoundaryEnum
++	LoveComplexComputationEnum
++	LoveIntStepsPerLayerEnum
++	LoveKernelsEnum
++	LoveMu0Enum
++	LoveNfreqEnum
++	LoveNTemporalIterationsEnum
++	LoveNYiEquationsEnum
++	LoveR0Enum
++	LoveShNmaxEnum
++	LoveShNminEnum
++	LoveStartingLayerEnum
++	LoveUnderflowTolEnum
++	MassFluxSegmentsEnum
++	MassFluxSegmentsPresentEnum
++	MasstransportHydrostaticAdjustmentEnum
++	MasstransportIsfreesurfaceEnum
++	MasstransportMinThicknessEnum
++	MasstransportNumRequestedOutputsEnum
++	MasstransportPenaltyFactorEnum
++	MasstransportRequestedOutputsEnum
++	MasstransportStabilizationEnum
++	MaterialsBetaEnum
++	MaterialsEarthDensityEnum
++	MaterialsEffectiveconductivityAveragingEnum
++	MaterialsHeatcapacityEnum
++	MaterialsLatentheatEnum
++	MaterialsMeltingpointEnum
++	MaterialsMixedLayerCapacityEnum
++	MaterialsMuWaterEnum
++	MaterialsRheologyLawEnum
++	MaterialsRhoFreshwaterEnum
++	MaterialsRhoIceEnum
++	MaterialsRhoSeawaterEnum
++	MaterialsTemperateiceconductivityEnum
++	MaterialsThermalExchangeVelocityEnum
++	MaterialsThermalconductivityEnum
++	MeltingOffsetEnum
++	MeshAverageVertexConnectivityEnum
++	MeshElementtypeEnum
++	MeshNumberoflayersEnum
++	MeshNumberofverticesEnum
++	MeshNumberofelementsEnum
++	MigrationMaxEnum
++	ModelIdEnum
++	NbinsEnum
++	NodesEnum
++	NumModelsEnum
++	OceanGridNxEnum
++	OceanGridNyEnum
++	OceanGridXEnum
++	OceanGridYEnum
++	OutputBufferPointerEnum
++	OutputBufferSizePointerEnum
++	OutputFileNameEnum
++	OutputFilePointerEnum
++	OutputdefinitionEnum
++	QmuErrNameEnum
++	QmuInNameEnum
++	QmuIsdakotaEnum
++	QmuOutNameEnum
++	QmuOutputEnum
++	QmuCurrEvalIdEnum
++	QmuNsampleEnum
++	QmuResponsedescriptorsEnum
++	QmuVariableDescriptorsEnum
++	QmuVariablePartitionsEnum
++	QmuVariablePartitionsNpartEnum
++	QmuVariablePartitionsNtEnum
++	QmuResponsePartitionsEnum
++	QmuResponsePartitionsNpartEnum
++	QmuStatisticsEnum
++	QmuNumstatisticsEnum
++	QmuNdirectoriesEnum
++	QmuNfilesPerDirectoryEnum
++	QmuStatisticsMethodEnum
++	QmuMethodsEnum
++	RestartFileNameEnum
++	ResultsEnum
++	RootPathEnum
++	ModelnameEnum
++	SamplingAlphaEnum
++	SamplingPhiEnum
++	SamplingNumRequestedOutputsEnum
++	SamplingRequestedOutputsEnum
++	SamplingRobinEnum
++	SamplingSeedEnum
++	SamplingTauEnum
++	SaveResultsEnum
++	SolidearthPartitionIceEnum
++	SolidearthPartitionHydroEnum
++	SolidearthPartitionOceanEnum
++	SolidearthNpartIceEnum
++	SolidearthNpartOceanEnum
++	SolidearthNpartHydroEnum
++	SolidearthPlanetRadiusEnum
++	SolidearthPlanetAreaEnum
++	SolidearthSettingsAbstolEnum
++	SolidearthSettingsCrossSectionShapeEnum
++	RotationalAngularVelocityEnum
++	SolidearthSettingsElasticEnum
++	SolidearthSettingsViscousEnum
++	SealevelchangeGeometryDoneEnum
++	SealevelchangeViscousNumStepsEnum
++	SealevelchangeViscousTimesEnum
++	SealevelchangeViscousIndexEnum
++	RotationalEquatorialMoiEnum
++	TidalLoveHEnum
++	TidalLoveKEnum
++	TidalLoveLEnum
++	TidalLoveK2SecularEnum
++	LoadLoveHEnum
++	LoadLoveKEnum
++	LoadLoveLEnum
++	LoveTimeFreqEnum
++	LoveIsTimeEnum
++	SealevelchangeGSelfAttractionEnum
++	SealevelchangeGViscoElasticEnum
++	SolidearthSettingsSealevelLoadingEnum
++	SolidearthSettingsGRDEnum
++	SolidearthSettingsRunFrequencyEnum
++	SolidearthSettingsTimeAccEnum
++	SealevelchangeHViscoElasticEnum
++	SolidearthSettingsHorizEnum
++	SolidearthSettingsMaxiterEnum
++	SolidearthSettingsGrdOceanEnum
++	SolidearthSettingsOceanAreaScalingEnum
++	RotationalPolarMoiEnum
++	SolidearthSettingsReltolEnum
++	SealevelchangeRequestedOutputsEnum
++	SolidearthSettingsSelfAttractionEnum
++	SolidearthSettingsRotationEnum
++	SolidearthSettingsMaxSHCoeffEnum
++	SealevelchangeRunCountEnum
++	SealevelchangeTransitionsEnum
++	SealevelchangeUViscoElasticEnum
++	SettingsIoGatherEnum
++	SettingsNumResultsOnNodesEnum
++	SettingsOutputFrequencyEnum
++	SettingsCheckpointFrequencyEnum
++	SettingsResultsOnNodesEnum
++	SettingsSbCouplingFrequencyEnum
++	SettingsSolverResidueThresholdEnum
++	SettingsWaitonlockEnum
++	SmbAIceEnum
++	SmbAIdxEnum
++	SmbASnowEnum
++	SmbAccualtiEnum
++	SmbAccugradEnum
++	SmbAccurefEnum
++	SmbAdThreshEnum
++	SmbAutoregressionInitialTimeEnum
++	SmbAutoregressionTimestepEnum
++	SmbAutoregressiveOrderEnum
++	SmbAveragingEnum
++	SmbBeta0Enum
++	SmbBeta1Enum
++	SmbCovmatEnum
++	SmbDesfacEnum
++	SmbDpermilEnum
++	SmbDsnowIdxEnum
++	SmbCldFracEnum
++	SmbDelta18oEnum
++	SmbDelta18oSurfaceEnum
++	SmbDenIdxEnum
++	SmbDtEnum
++	SmbEnum
++	SmbFEnum
++	SmbInitDensityScalingEnum
++	SmbIsaccumulationEnum
++	SmbIsalbedoEnum
++	SmbIsconstrainsurfaceTEnum
++	SmbIsd18opdEnum
++	SmbIsdelta18oEnum
++	SmbIsdensificationEnum
++	SmbIsfirnwarmingEnum
++	SmbIsgraingrowthEnum
++	SmbIsmeltEnum
++	SmbIsmungsmEnum
++	SmbIsprecipscaledEnum
++	SmbIssetpddfacEnum
++	SmbIsshortwaveEnum
++	SmbIstemperaturescaledEnum
++	SmbIsthermalEnum
++	SmbIsturbulentfluxEnum
++	SmbKEnum
++	SmbNumBasinsEnum
++	SmbNumRequestedOutputsEnum
++	SmbPfacEnum
++	SmbPhiEnum
++	SmbRandomflagEnum
++	SmbRdlEnum
++	SmbRequestedOutputsEnum
++	SmbRlapsEnum
++	SmbRlapslgmEnum
++	SmbRunoffaltiEnum
++	SmbRunoffgradEnum
++	SmbRunoffrefEnum
++	SmbSealevEnum
++	SmbStepsPerStepEnum
++	SmbSwIdxEnum
++	SmbT0dryEnum
++	SmbT0wetEnum
++	SmbTdiffEnum
++	SmbThermoDeltaTScalingEnum
++	SmbTemperaturesReconstructedYearsEnum
++	SmbPrecipitationsReconstructedYearsEnum
++	SmoothThicknessMultiplierEnum
++	SolutionTypeEnum
++	SteadystateMaxiterEnum
++	SteadystateNumRequestedOutputsEnum
++	SteadystateReltolEnum
++	SteadystateRequestedOutputsEnum
++	StepEnum
++	StepsEnum
++	StressbalanceAbstolEnum
++	StressbalanceFSreconditioningEnum
++	StressbalanceIsnewtonEnum
++	StressbalanceMaxiterEnum
++	StressbalanceNumRequestedOutputsEnum
++	StressbalancePenaltyFactorEnum
++	StressbalanceReltolEnum
++	StressbalanceRequestedOutputsEnum
++	StressbalanceRestolEnum
++	StressbalanceRiftPenaltyThresholdEnum
++	StressbalanceShelfDampeningEnum
++	ThermalIsdrainicecolumnEnum
++	ThermalIsdynamicbasalspcEnum
++	ThermalIsenthalpyEnum
++	ThermalMaxiterEnum
++	ThermalNumRequestedOutputsEnum
++	ThermalPenaltyFactorEnum
++	ThermalPenaltyLockEnum
++	ThermalPenaltyThresholdEnum
++	ThermalReltolEnum
++	ThermalRequestedOutputsEnum
++	ThermalStabilizationEnum
++	ThermalWatercolumnUpperlimitEnum
++	TimeEnum
++	TimesteppingCflCoefficientEnum
++	TimesteppingCouplingTimeEnum
++	TimesteppingFinalTimeEnum
++	TimesteppingInterpForcingEnum
++	TimesteppingCycleForcingEnum
++	TimesteppingStartTimeEnum
++	TimesteppingTimeStepEnum
++	TimesteppingTimeStepMaxEnum
++	TimesteppingTimeStepMinEnum
++	TimesteppingTypeEnum
++	ToMITgcmCommEnum
++	ToolkitsFileNameEnum
++	ToolkitsOptionsAnalysesEnum
++	ToolkitsOptionsStringsEnum
++	ToolkitsTypesEnum
++	TransientAmrFrequencyEnum
++	TransientIsdamageevolutionEnum
++	TransientIsesaEnum
++	TransientIsgiaEnum
++	TransientIsgroundinglineEnum
++	TransientIshydrologyEnum
++	TransientIsmasstransportEnum 
++	TransientIsoceantransportEnum
++	TransientIsmovingfrontEnum
++	TransientIsoceancouplingEnum
++	TransientIssamplingEnum
++	TransientIsslcEnum
++	TransientIssmbEnum
++	TransientIsstressbalanceEnum
++	TransientIsthermalEnum
++	TransientNumRequestedOutputsEnum
++	TransientRequestedOutputsEnum
++	VelocityEnum
++	XxeEnum
++	YyeEnum
++	ZzeEnum
++	AreaeEnum
++	WorldCommEnum
++	#}}}
++	ParametersENDEnum
++	InputsSTARTEnum
++	#Inputs{{{
++	AccumulatedDeltaBottomPressureEnum
++	AccumulatedDeltaIceThicknessEnum
++	AccumulatedDeltaTwsEnum
++	AdjointEnum
++	AdjointpEnum
++	AdjointxEnum
++	AdjointxBaseEnum
++	AdjointxShearEnum
++	AdjointyEnum
++	AdjointyBaseEnum
++	AdjointyShearEnum
++	AdjointzEnum
++	AirEnum
++	ApproximationEnum
++	BalancethicknessMisfitEnum
++	BalancethicknessOmega0Enum
++	BalancethicknessOmegaEnum
++	BalancethicknessSpcthicknessEnum
++	BalancethicknessThickeningRateEnum
++	BasalCrevasseEnum
++	BasalforcingsFloatingiceMeltingRateEnum
++	BasalforcingsGeothermalfluxEnum
++	BasalforcingsGroundediceMeltingRateEnum
++	BasalforcingsPerturbationMeltingRateEnum
++	BasalforcingsIsmip6BasinIdEnum
++	BasalforcingsIsmip6TfEnum
++	BasalforcingsIsmip6TfShelfEnum
++	BasalforcingsIsmip6MeltAnomalyEnum
++	BasalforcingsMeltrateFactorEnum
++	BasalforcingsOceanSalinityEnum
++	BasalforcingsOceanTempEnum
++	BasalforcingsPicoBasinIdEnum
++	BasalforcingsPicoBoxIdEnum
++	BasalforcingsPicoOverturningCoeffEnum
++	BasalforcingsPicoSubShelfOceanOverturningEnum
++	BasalforcingsPicoSubShelfOceanSalinityEnum
++	BasalforcingsPicoSubShelfOceanTempEnum
++	BasalStressxEnum
++	BasalStressyEnum
++	BasalStressEnum
++	BaseEnum
++	BaseOldEnum
++	BaseSlopeXEnum
++	BaseSlopeYEnum
++	BedEnum
++	BedGRDEnum
++	BedEastEnum
++	BedEastGRDEnum
++	BedNorthEnum
++	BedNorthGRDEnum
++	BedSlopeXEnum
++	BedSlopeYEnum
++	BottomPressureEnum
++	BottomPressureOldEnum
++	CalvingCalvingrateEnum
++	CalvingHabFractionEnum
++	CalvingMeltingrateEnum
++	CalvingStressThresholdFloatingiceEnum
++	CalvingStressThresholdGroundediceEnum
++	CalvinglevermannCoeffEnum
++	CalvingratexAverageEnum
++	CalvingratexEnum
++	CalvingrateyAverageEnum
++	CalvingrateyEnum
++	CalvingFluxLevelsetEnum
++	CalvingMeltingFluxLevelsetEnum
++	ConvergedEnum
++	CrevasseDepthEnum
++	DamageDEnum
++	DamageDOldEnum
++	DamageDbarEnum
++	DamageDbarOldEnum
++	DamageFEnum
++	DegreeOfChannelizationEnum
++	DepthBelowSurfaceEnum
++	DeltaIceThicknessEnum
++	DeltaTwsEnum
++	DeltaBottomPressureEnum
++	DeltaDslEnum
++	DslOldEnum
++	DslEnum
++	DeltaStrEnum
++	StrOldEnum
++	StrEnum
++	DeviatoricStresseffectiveEnum
++	DeviatoricStressxxEnum
++	DeviatoricStressxyEnum
++	DeviatoricStressxzEnum
++	DeviatoricStressyyEnum
++	DeviatoricStressyzEnum
++	DeviatoricStresszzEnum
++	DeviatoricStress1Enum
++	DeviatoricStress2Enum
++	DistanceToCalvingfrontEnum
++	DistanceToGroundinglineEnum
++	Domain2DhorizontalEnum
++	Domain2DverticalEnum
++	Domain3DEnum
++	DragCoefficientAbsGradientEnum
++	DrivingStressXEnum
++	DrivingStressYEnum
++	DummyEnum
++	EffectivePressureEnum
++	EffectivePressureSubstepEnum
++	EffectivePressureTransientEnum
++	EnthalpyEnum
++	EnthalpyPicardEnum
++	EplHeadEnum
++	EplHeadOldEnum
++	EplHeadSlopeXEnum
++	EplHeadSlopeYEnum
++	EplHeadSubstepEnum
++	EplHeadTransientEnum
++	EsaEmotionEnum
++	EsaNmotionEnum
++	EsaRotationrateEnum
++	EsaStrainratexxEnum
++	EsaStrainratexyEnum
++	EsaStrainrateyyEnum
++	EsaUmotionEnum
++	EsaXmotionEnum
++	EsaYmotionEnum
++	EtaDiffEnum
++	FlowequationBorderFSEnum
++	FrictionAsEnum
++	FrictionCEnum
++	FrictionCmaxEnum
++	FrictionCoefficientEnum
++	FrictionCoefficientcoulombEnum
++	FrictionEffectivePressureEnum
++	FrictionMEnum
++	FrictionPEnum
++	FrictionPressureAdjustedTemperatureEnum
++	FrictionQEnum
++	FrictionSedimentCompressibilityCoefficientEnum
++	FrictionTillFrictionAngleEnum
++	FrictionWaterLayerEnum
++	FrictionfEnum
++	FrontalForcingsBasinIdEnum
++	FrontalForcingsSubglacialDischargeEnum
++	FrontalForcingsThermalForcingEnum
++	GeometryHydrostaticRatioEnum
++	NGiaEnum
++	NGiaRateEnum
++	UGiaEnum
++	UGiaRateEnum
++	GradientEnum
++	GroundinglineHeightEnum
++	HydraulicPotentialEnum
++	HydraulicPotentialOldEnum
++	HydrologyBasalFluxEnum
++	HydrologyBumpHeightEnum
++	HydrologyBumpSpacingEnum
++	HydrologydcBasalMoulinInputEnum
++	HydrologydcEplThicknessEnum
++	HydrologydcEplThicknessOldEnum
++	HydrologydcEplThicknessSubstepEnum
++	HydrologydcEplThicknessTransientEnum
++	HydrologydcMaskEplactiveEltEnum
++	HydrologydcMaskEplactiveNodeEnum
++	HydrologydcMaskThawedEltEnum
++	HydrologydcMaskThawedNodeEnum
++	HydrologydcSedimentTransmitivityEnum
++	HydrologyDrainageRateEnum
++	HydrologyEnglacialInputEnum
++	HydrologyGapHeightEnum
++	HydrologyGapHeightXEnum
++	HydrologyGapHeightXXEnum
++	HydrologyGapHeightYEnum
++	HydrologyGapHeightYYEnum
++	HydrologyHeadEnum
++	HydrologyHeadOldEnum
++	HydrologyMoulinInputEnum
++	HydrologyNeumannfluxEnum
++	HydrologyReynoldsEnum
++	HydrologySheetConductivityEnum
++	HydrologySheetThicknessEnum
++	HydrologySheetThicknessOldEnum
++	HydrologyTwsEnum
++	HydrologyTwsSpcEnum
++	HydrologyTwsAnalysisEnum
++	HydrologyWatercolumnMaxEnum
++	HydrologyWaterVxEnum
++	HydrologyWaterVyEnum
++	IceEnum
++	IceMaskNodeActivationEnum
++	InputEnum
++	InversionCostFunctionsCoefficientsEnum
++	InversionSurfaceObsEnum
++	InversionThicknessObsEnum
++	InversionVelObsEnum
++	InversionVxObsEnum
++	InversionVyObsEnum
++	LevelsetfunctionSlopeXEnum
++	LevelsetfunctionSlopeYEnum
++	LevelsetObservationEnum
++	LoadingforceXEnum
++	LoadingforceYEnum
++	LoadingforceZEnum
++	MaskOceanLevelsetEnum
++	MaskIceLevelsetEnum
++	MaskIceRefLevelsetEnum
++	MasstransportSpcthicknessEnum
++	MaterialsRheologyBEnum
++	MaterialsRheologyBbarEnum
++	MaterialsRheologyEEnum
++	MaterialsRheologyEbarEnum
++	MaterialsRheologyEcEnum
++	MaterialsRheologyEcbarEnum
++	MaterialsRheologyEsEnum
++	MaterialsRheologyEsbarEnum
++	MaterialsRheologyNEnum
++	MeshScaleFactorEnum
++	MeshVertexonbaseEnum
++	MeshVertexonboundaryEnum
++	MeshVertexonsurfaceEnum
++	MisfitEnum
++	MovingFrontalVxEnum
++	MovingFrontalVyEnum
++	NeumannfluxEnum
++	NewDamageEnum
++	NodeEnum
++	OmegaAbsGradientEnum
++	OceantransportSpcbottompressureEnum
++	OceantransportSpcstrEnum
++	OceantransportSpcdslEnum
++	P0Enum
++	P1Enum
++	PartitioningEnum
++	PressureEnum
++	RadarEnum
++	RadarAttenuationMacGregorEnum
++	RadarAttenuationWolffEnum
++	RadarIcePeriodEnum
++	RadarPowerMacGregorEnum
++	RadarPowerWolffEnum
++	RheologyBAbsGradientEnum
++	RheologyBInitialguessEnum
++	RheologyBInitialguessMisfitEnum
++	RheologyBbarAbsGradientEnum
++	SampleEnum
++	SamplingBetaEnum
++	SamplingKappaEnum
++	SealevelEnum
++	SealevelGRDEnum
++	SealevelBarystaticMaskEnum
++	SealevelBarystaticIceMaskEnum
++	SealevelBarystaticIceWeightsEnum
++	SealevelBarystaticIceAreaEnum
++	SealevelBarystaticIceLatbarEnum
++	SealevelBarystaticIceLongbarEnum
++	SealevelBarystaticIceLoadEnum
++	SealevelBarystaticHydroMaskEnum
++	SealevelBarystaticHydroWeightsEnum
++	SealevelBarystaticHydroAreaEnum
++	SealevelBarystaticHydroLatbarEnum
++	SealevelBarystaticHydroLongbarEnum
++	SealevelBarystaticHydroLoadEnum
++	SealevelBarystaticBpMaskEnum
++	SealevelBarystaticBpWeightsEnum
++	SealevelBarystaticBpAreaEnum
++	SealevelBarystaticBpLoadEnum
++	SealevelBarystaticOceanMaskEnum
++	SealevelBarystaticOceanWeightsEnum
++	SealevelBarystaticOceanAreaEnum
++	SealevelBarystaticOceanLatbarEnum
++	SealevelBarystaticOceanLongbarEnum
++	SealevelBarystaticOceanLoadEnum
++	SealevelNEsaEnum
++	SealevelNEsaRateEnum
++	SealevelRSLEnum
++	BslcEnum
++	BslcIceEnum
++	BslcHydroEnum
++	BslcOceanEnum
++	BslcRateEnum
++	GmtslcEnum
++	SealevelGrotm1Enum
++	SealevelGrotm2Enum
++	SealevelGrotm3Enum
++	SealevelGUrotm1Enum
++	SealevelGUrotm2Enum
++	SealevelGUrotm3Enum
++	SealevelGNrotm1Enum
++	SealevelGNrotm2Enum
++	SealevelGNrotm3Enum
++	SealevelGErotm1Enum
++	SealevelGErotm2Enum
++	SealevelGErotm3Enum
++	SealevelRSLBarystaticEnum
++	SealevelRSLRateEnum
++	SealevelUGrdEnum
++	SealevelNGrdEnum
++	SealevelUEastEsaEnum
++	SealevelUNorthEsaEnum
++	SealevelchangeIndicesEnum
++	SealevelchangeGEnum
++	SealevelchangeGUEnum
++	SealevelchangeGEEnum
++	SealevelchangeGNEnum
++	SealevelchangeGsubelOceanEnum
++	SealevelchangeGUsubelOceanEnum
++	SealevelchangeGEsubelOceanEnum
++	SealevelchangeGNsubelOceanEnum
++	SealevelchangeGsubelIceEnum
++	SealevelchangeGUsubelIceEnum
++	SealevelchangeGEsubelIceEnum
++	SealevelchangeGNsubelIceEnum
++	SealevelchangeGsubelHydroEnum
++	SealevelchangeGUsubelHydroEnum
++	SealevelchangeGEsubelHydroEnum
++	SealevelchangeGNsubelHydroEnum
++	SealevelchangeViscousRSLEnum
++	SealevelchangeViscousUEnum
++	SealevelchangeViscousNEnum
++	SealevelchangeViscousEEnum
++	SedimentHeadEnum
++	SedimentHeadOldEnum
++	SedimentHeadSubstepEnum
++	SedimentHeadTransientEnum
++	SedimentHeadResidualEnum
++	SedimentHeadStackedEnum
++	SigmaNNEnum
++	SigmaVMEnum
++	SmbAccumulatedECEnum
++	SmbAccumulatedMassBalanceEnum
++	SmbAccumulatedMeltEnum
++	SmbAccumulatedPrecipitationEnum
++	SmbAccumulatedRainEnum
++	SmbAccumulatedRefreezeEnum
++	SmbAccumulatedRunoffEnum
++	SmbAEnum
++	SmbAdiffEnum
++	SmbAValueEnum
++	SmbAccumulationEnum
++	SmbAdiffiniEnum
++	SmbAiniEnum
++	SmbBasinsIdEnum
++	SmbBMaxEnum
++	SmbBMinEnum
++	SmbBNegEnum
++	SmbBPosEnum
++	SmbCEnum
++	SmbCcsnowValueEnum
++	SmbCciceValueEnum
++	SmbCotValueEnum
++	SmbDEnum
++	SmbDailyairdensityEnum
++	SmbDailyairhumidityEnum
++	SmbDailydlradiationEnum
++	SmbDailydsradiationEnum
++	SmbDailypressureEnum
++	SmbDailyrainfallEnum
++	SmbDailysnowfallEnum
++	SmbDailytemperatureEnum
++	SmbDailywindspeedEnum
++	SmbDiniEnum
++	SmbDlwrfEnum
++	SmbDswrfEnum
++	SmbDswdiffrfEnum
++	SmbDzAddEnum
++	SmbDzEnum
++	SmbDzMinEnum
++	SmbDzTopEnum
++	SmbDziniEnum
++	SmbEAirEnum
++	SmbECEnum
++	SmbECDtEnum
++	SmbECiniEnum
++	SmbElaEnum
++	SmbEvaporationEnum
++	SmbFACEnum
++	SmbGdnEnum
++	SmbGdniniEnum
++	SmbGspEnum
++	SmbGspiniEnum
++	SmbHrefEnum
++	SmbIsInitializedEnum
++	SmbMAddEnum
++	SmbMassBalanceEnum
++	SmbMassBalanceSubstepEnum
++	SmbMassBalanceTransientEnum
++	SmbMeanLHFEnum
++	SmbMeanSHFEnum
++	SmbMeanULWEnum
++	SmbMeltEnum
++	SmbMInitnum
++	SmbMonthlytemperaturesEnum
++	SmbMSurfEnum
++	SmbNetLWEnum
++	SmbNetSWEnum
++	SmbPAirEnum
++	SmbPEnum
++	SmbPddfacIceEnum
++	SmbPddfacSnowEnum
++	SmbPrecipitationEnum
++	SmbPrecipitationsAnomalyEnum
++	SmbPrecipitationsLgmEnum
++	SmbPrecipitationsPresentdayEnum
++	SmbPrecipitationsReconstructedEnum
++	SmbRainEnum
++	SmbReEnum
++	SmbRefreezeEnum
++	SmbReiniEnum
++	SmbRunoffEnum
++	SmbRunoffSubstepEnum
++	SmbRunoffTransientEnum
++	SmbS0gcmEnum
++	SmbS0pEnum
++	SmbS0tEnum
++	SmbSizeiniEnum
++	SmbSmbCorrEnum
++	SmbSmbrefEnum
++	SmbSzaValueEnum
++	SmbTEnum
++	SmbTaEnum
++	SmbTeValueEnum
++	SmbTemperaturesAnomalyEnum
++	SmbTemperaturesLgmEnum
++	SmbTemperaturesPresentdayEnum
++	SmbTemperaturesReconstructedEnum
++	SmbTiniEnum
++	SmbTmeanEnum
++	SmbTzEnum
++	SmbValuesAutoregressionEnum
++	SmbVEnum
++	SmbVmeanEnum
++	SmbVzEnum
++	SmbWEnum
++	SmbWAddEnum
++	SmbWiniEnum
++	SmbZMaxEnum
++	SmbZMinEnum
++	SmbZTopEnum
++	SmbZYEnum
++	SolidearthExternalDisplacementEastRateEnum
++	SolidearthExternalDisplacementNorthRateEnum
++	SolidearthExternalDisplacementUpRateEnum
++	SolidearthExternalGeoidRateEnum
++	StrainRateeffectiveEnum
++	StrainRateparallelEnum
++	StrainRateperpendicularEnum
++	StrainRatexxEnum
++	StrainRatexyEnum
++	StrainRatexzEnum
++	StrainRateyyEnum
++	StrainRateyzEnum
++	StrainRatezzEnum
++	StressMaxPrincipalEnum
++	StressTensorxxEnum
++	StressTensorxyEnum
++	StressTensorxzEnum
++	StressTensoryyEnum
++	StressTensoryzEnum
++	StressTensorzzEnum
++	SurfaceAbsMisfitEnum
++	SurfaceAbsVelMisfitEnum
++	AreaEnum
++	SealevelAreaEnum
++	SurfaceAreaEnum
++	SurfaceAverageVelMisfitEnum
++	SurfaceCrevasseEnum
++	SurfaceEnum
++	SurfaceOldEnum
++	SurfaceLogVelMisfitEnum
++	SurfaceLogVxVyMisfitEnum
++	SurfaceObservationEnum
++	SurfaceRelVelMisfitEnum
++	SurfaceSlopeXEnum
++	SurfaceSlopeYEnum
++	TemperatureEnum
++	TemperaturePDDEnum
++	TemperaturePicardEnum
++	TemperatureSEMICEnum
++	ThermalSpctemperatureEnum
++	ThicknessAbsGradientEnum
++	ThicknessAbsMisfitEnum
++	ThicknessAcrossGradientEnum
++	ThicknessAlongGradientEnum
++	ThicknessEnum
++	ThicknessOldEnum
++	ThicknessPositiveEnum
++	ThicknessResidualEnum
++	TransientAccumulatedDeltaIceThicknessEnum
++	VelEnum
++	VxAverageEnum
++	VxBaseEnum
++	VxEnum
++	VxMeshEnum
++	VxObsEnum
++	VxShearEnum
++	VxSurfaceEnum
++	VyAverageEnum
++	VyBaseEnum
++	VyEnum
++	VyMeshEnum
++	VyObsEnum
++	VyShearEnum
++	VySurfaceEnum
++	VzEnum
++	VzFSEnum
++	VzHOEnum
++	VzMeshEnum
++	VzSSAEnum
++	WaterColumnOldEnum
++	WatercolumnEnum
++	WaterfractionDrainageEnum
++	WaterfractionDrainageIntegratedEnum
++	WaterfractionEnum
++	WaterheightEnum
++	WeightsLevelsetObservationEnum
++	WeightsSurfaceObservationEnum
++	OldAccumulatedDeltaBottomPressureEnum
++	OldAccumulatedDeltaIceThicknessEnum
++	OldAccumulatedDeltaTwsEnum
++	Outputdefinition1Enum
++	Outputdefinition10Enum
++	Outputdefinition11Enum
++	Outputdefinition12Enum
++	Outputdefinition13Enum
++	Outputdefinition14Enum
++	Outputdefinition15Enum
++	Outputdefinition16Enum
++	Outputdefinition17Enum
++	Outputdefinition18Enum
++	Outputdefinition19Enum
++	Outputdefinition20Enum
++	Outputdefinition21Enum
++	Outputdefinition22Enum
++	Outputdefinition23Enum
++	Outputdefinition24Enum
++	Outputdefinition25Enum
++	Outputdefinition26Enum
++	Outputdefinition27Enum
++	Outputdefinition28Enum
++	Outputdefinition29Enum
++	Outputdefinition2Enum
++	Outputdefinition30Enum
++	Outputdefinition31Enum
++	Outputdefinition32Enum
++	Outputdefinition33Enum
++	Outputdefinition34Enum
++	Outputdefinition35Enum
++	Outputdefinition36Enum
++	Outputdefinition37Enum
++	Outputdefinition38Enum
++	Outputdefinition39Enum
++	Outputdefinition3Enum
++	Outputdefinition40Enum
++	Outputdefinition41Enum
++	Outputdefinition42Enum
++	Outputdefinition43Enum
++	Outputdefinition44Enum
++	Outputdefinition45Enum
++	Outputdefinition46Enum
++	Outputdefinition47Enum
++	Outputdefinition48Enum
++	Outputdefinition49Enum
++	Outputdefinition4Enum
++	Outputdefinition50Enum
++	Outputdefinition51Enum
++	Outputdefinition52Enum
++	Outputdefinition53Enum
++	Outputdefinition54Enum
++	Outputdefinition55Enum
++	Outputdefinition56Enum
++	Outputdefinition57Enum
++	Outputdefinition58Enum
++	Outputdefinition59Enum
++	Outputdefinition5Enum
++	Outputdefinition60Enum
++	Outputdefinition61Enum
++	Outputdefinition62Enum
++	Outputdefinition63Enum
++	Outputdefinition64Enum
++	Outputdefinition65Enum
++	Outputdefinition66Enum
++	Outputdefinition67Enum
++	Outputdefinition68Enum
++	Outputdefinition69Enum
++	Outputdefinition6Enum
++	Outputdefinition70Enum
++	Outputdefinition71Enum
++	Outputdefinition72Enum
++	Outputdefinition73Enum
++	Outputdefinition74Enum
++	Outputdefinition75Enum
++	Outputdefinition76Enum
++	Outputdefinition77Enum
++	Outputdefinition78Enum
++	Outputdefinition79Enum
++	Outputdefinition7Enum
++	Outputdefinition80Enum
++	Outputdefinition81Enum
++	Outputdefinition82Enum
++	Outputdefinition83Enum
++	Outputdefinition84Enum
++	Outputdefinition85Enum
++	Outputdefinition86Enum
++	Outputdefinition87Enum
++	Outputdefinition88Enum
++	Outputdefinition89Enum
++	Outputdefinition8Enum
++	Outputdefinition90Enum
++	Outputdefinition91Enum
++	Outputdefinition92Enum
++	Outputdefinition93Enum
++	Outputdefinition94Enum
++	Outputdefinition95Enum
++	Outputdefinition96Enum
++	Outputdefinition97Enum
++	Outputdefinition98Enum
++	Outputdefinition99Enum
++	Outputdefinition9Enum
++	Outputdefinition100Enum
++	#}}}
++	InputsENDEnum
++	#Other{{{
++	AbsoluteEnum
++	AdaptiveTimesteppingEnum
++	AdjointBalancethickness2AnalysisEnum
++	AdjointBalancethicknessAnalysisEnum
++	AdjointHorizAnalysisEnum
++	AggressiveMigrationEnum
++	AmrBamgEnum
++	AmrNeopzEnum
++	AndroidFrictionCoefficientEnum
++	ArrheniusEnum
++	AutodiffJacobianEnum
++	Balancethickness2AnalysisEnum
++	Balancethickness2SolutionEnum
++	BalancethicknessAnalysisEnum
++	BalancethicknessApparentMassbalanceEnum
++	BalancethicknessSoftAnalysisEnum
++	BalancethicknessSoftSolutionEnum
++	BalancethicknessSolutionEnum
++	BalancevelocityAnalysisEnum
++	BalancevelocitySolutionEnum
++	BasalforcingsIsmip6Enum
++	BasalforcingsPicoEnum
++	BeckmannGoosseFloatingMeltRateEnum
++	BedSlopeSolutionEnum
++	BoolExternalResultEnum
++	BoolInputEnum
++	IntInputEnum
++	DoubleInputEnum
++	BoolParamEnum
++	BoundaryEnum
++	BuddJackaEnum
++	CalvingDev2Enum
++	CalvingHabEnum
++	CalvingLevermannEnum
++	CalvingVonmisesEnum
++	CfdragcoeffabsgradEnum
++	CfsurfacelogvelEnum
++	CfsurfacesquareEnum
++	CflevelsetmisfitEnum
++	ChannelEnum
++	ChannelAreaEnum
++	ChannelAreaOldEnum
++	ChannelDischargeEnum
++	ClosedEnum
++	ColinearEnum
++	ConstraintsEnum
++	ContactEnum
++	ContourEnum
++	ContoursEnum
++	ControlInputEnum
++	ControlInputGradEnum
++	ControlInputMaxsEnum
++	ControlInputMinsEnum
++	ControlInputValuesEnum
++	CrouzeixRaviartEnum
++	CuffeyEnum
++	CuffeyTemperateEnum
++	DamageEvolutionAnalysisEnum
++	DamageEvolutionSolutionEnum
++	DataSetEnum
++	DataSetParamEnum
++	DatasetInputEnum
++	DefaultAnalysisEnum
++	DefaultCalvingEnum
++	DenseEnum
++	DependentObjectEnum
++	DepthAverageAnalysisEnum
++	DeviatoricStressErrorEstimatorEnum
++	DivergenceEnum
++	Domain3DsurfaceEnum
++	DoubleArrayInputEnum
++	ArrayInputEnum
++	DoubleExternalResultEnum
++	DoubleMatArrayParamEnum
++	DoubleMatExternalResultEnum
++	DoubleMatParamEnum
++	DoubleParamEnum
++	DoubleVecParamEnum
++	ElementEnum
++	ElementHookEnum
++	ElementSIdEnum
++	EnthalpyAnalysisEnum
++	EsaAnalysisEnum
++	EsaSolutionEnum
++	EsaTransitionsEnum
++	ExternalResultEnum
++	ExtrapolationAnalysisEnum
++	ExtrudeFromBaseAnalysisEnum
++	ExtrudeFromTopAnalysisEnum
++	FSApproximationEnum
++	FSSolverEnum
++	FSpressureEnum
++	FSvelocityEnum
++	FemModelEnum
++	FileParamEnum
++	FixedTimesteppingEnum
++	FloatingAreaEnum
++	FloatingAreaScaledEnum
++	FloatingMeltRateEnum
++	FreeEnum
++	FreeSurfaceBaseAnalysisEnum
++	FreeSurfaceTopAnalysisEnum
++	FrontalForcingsDefaultEnum
++	FrontalForcingsRignotEnum
++	FsetEnum
++	FullMeltOnPartiallyFloatingEnum
++	GLheightadvectionAnalysisEnum
++	GaussPentaEnum
++	GaussSegEnum
++	GaussTetraEnum
++	GaussTriaEnum
++	GenericOptionEnum
++	GenericParamEnum
++	GenericExternalResultEnum
++	Gradient1Enum
++	Gradient2Enum
++	Gradient3Enum
++	Gradient4Enum
++	GroundedAreaEnum
++	GroundedAreaScaledEnum
++	GroundingOnlyEnum
++	GroundinglineMassFluxEnum
++	GsetEnum
++	GslEnum
++	HOApproximationEnum
++	HOFSApproximationEnum
++	HookEnum
++	HydrologyDCEfficientAnalysisEnum
++	HydrologyDCInefficientAnalysisEnum
++	HydrologyGlaDSAnalysisEnum
++	HydrologyGlaDSEnum
++	HydrologyPismAnalysisEnum
++	HydrologyShaktiAnalysisEnum
++	HydrologyShreveAnalysisEnum
++	HydrologySolutionEnum
++	HydrologydcEnum
++	HydrologypismEnum
++	HydrologyshaktiEnum
++	HydrologyshreveEnum
++	IceMassEnum
++	IceMassScaledEnum
++	IceVolumeAboveFloatationEnum
++	IceVolumeAboveFloatationScaledEnum
++	IceVolumeEnum
++	IceVolumeScaledEnum
++	IcefrontMassFluxEnum
++	IcefrontMassFluxLevelsetEnum
++	IncrementalEnum
++	IndexedEnum
++	IntExternalResultEnum
++	ElementInputEnum
++	IntMatExternalResultEnum
++	IntMatParamEnum
++	IntParamEnum
++	IntVecParamEnum
++	InputsEnum
++	InternalEnum
++	IntersectEnum
++	InversionVzObsEnum
++	JEnum
++	L1L2ApproximationEnum
++	MLHOApproximationEnum
++	L2ProjectionBaseAnalysisEnum
++	L2ProjectionEPLAnalysisEnum
++	LACrouzeixRaviartEnum
++	LATaylorHoodEnum
++	LambdaSEnum
++	LevelsetAnalysisEnum
++	LevelsetfunctionPicardEnum
++	LinearFloatingMeltRateEnum
++	LliboutryDuvalEnum
++	LoadsEnum
++	LoveAnalysisEnum
++	LoveHiEnum
++	LoveHrEnum
++	LoveKernelsImagEnum
++	LoveKernelsRealEnum
++	LoveKiEnum
++	LoveKrEnum
++	LoveLiEnum
++	LoveLrEnum
++	LoveSolutionEnum
++	MINIEnum
++	MINIcondensedEnum
++	MantlePlumeGeothermalFluxEnum
++	MassFluxEnum
++	MassconEnum
++	MassconaxpbyEnum
++	MassfluxatgateEnum
++	MasstransportAnalysisEnum
++	MasstransportSolutionEnum
++	MatdamageiceEnum
++	MatenhancediceEnum
++	MaterialsEnum
++	MatestarEnum
++	MaticeEnum
++	MatlithoEnum
++	MathydroEnum
++	MatrixParamEnum
++	MaxAbsVxEnum
++	MaxAbsVyEnum
++	MaxAbsVzEnum
++	MaxDivergenceEnum
++	MaxVelEnum
++	MaxVxEnum
++	MaxVyEnum
++	MaxVzEnum
++	MelangeEnum
++	MeltingAnalysisEnum
++	MeshElementsEnum
++	MeshXEnum
++	MeshYEnum
++	MinVelEnum
++	MinVxEnum
++	MinVyEnum
++	MinVzEnum
++	MismipFloatingMeltRateEnum
++	MoulinEnum
++	MpiDenseEnum
++	MpiEnum
++	MpiSparseEnum
++	MumpsEnum
++	NoFrictionOnPartiallyFloatingEnum
++	NoMeltOnPartiallyFloatingEnum
++	NodalEnum
++	NodalvalueEnum
++	NodeSIdEnum
++	NoneApproximationEnum
++	NoneEnum
++	NumberedcostfunctionEnum
++	NyeCO2Enum
++	NyeH2OEnum
++	NumericalfluxEnum
++	OceantransportAnalysisEnum
++	OceantransportSolutionEnum
++	OldGradientEnum
++	OneLayerP4zEnum
++	OpenEnum
++	OptionEnum
++	ParamEnum
++	ParametersEnum
++	P0ArrayEnum
++	P0DGEnum
++	P1DGEnum
++	P1P1Enum
++	P1P1GLSEnum
++	P1bubbleEnum
++	P1bubblecondensedEnum
++	P1xP2Enum
++	P1xP3Enum
++	P1xP4Enum
++	P2Enum
++	P2bubbleEnum
++	P2bubblecondensedEnum
++	P2xP1Enum
++	P2xP4Enum
++	PatersonEnum
++	PengridEnum
++	PenpairEnum
++	PentaEnum
++	PentaInputEnum
++	ProfilerEnum
++	ProfilingCurrentFlopsEnum
++	ProfilingCurrentMemEnum
++	ProfilingSolutionTimeEnum
++	RegionaloutputEnum
++	RegularEnum
++	RecoveryAnalysisEnum
++	RiftfrontEnum
++	SamplingAnalysisEnum
++	SamplingSolutionEnum
++	SIAApproximationEnum
++	SMBautoregressionEnum
++	SMBcomponentsEnum
++	SMBd18opddEnum
++	SMBforcingEnum
++	SMBgcmEnum
++	SMBgembEnum
++	SMBgradientsEnum
++	SMBgradientscomponentsEnum
++	SMBgradientselaEnum
++	SMBhenningEnum
++	SMBmeltcomponentsEnum
++	SMBpddEnum
++	SMBpddSicopolisEnum
++	SMBsemicEnum
++	SSAApproximationEnum
++	SSAFSApproximationEnum
++	SSAHOApproximationEnum
++	ScaledEnum
++	SealevelAbsoluteEnum
++	SealevelEmotionEnum
++	SealevelInertiaTensorXZEnum
++	SealevelInertiaTensorYZEnum
++	SealevelInertiaTensorZZEnum
++	SealevelchangePolarMotionEnum
++	SealevelNmotionEnum
++	SealevelUmotionEnum
++	SealevelchangeAnalysisEnum
++	SegEnum
++	SegInputEnum
++	SegmentEnum
++	SegmentRiftfrontEnum
++	SeparateEnum
++	SeqEnum
++	SmbAnalysisEnum
++	SmbSolutionEnum
++	SmoothAnalysisEnum
++	SoftMigrationEnum
++	SpatialLinearFloatingMeltRateEnum
++	SpcDynamicEnum
++	SpcStaticEnum
++	SpcTransientEnum
++	SsetEnum
++	StatisticsSolutionEnum
++	SteadystateSolutionEnum
++	StressIntensityFactorEnum
++	StressbalanceAnalysisEnum
++	StressbalanceConvergenceNumStepsEnum
++	StressbalanceSIAAnalysisEnum
++	StressbalanceSolutionEnum
++	StressbalanceVerticalAnalysisEnum
++	StringArrayParamEnum
++	StringExternalResultEnum
++	StringParamEnum
++	SubelementFriction1Enum
++	SubelementFriction2Enum
++	SubelementMelt1Enum
++	SubelementMelt2Enum
++	SubelementMigrationEnum
++	SurfaceSlopeSolutionEnum
++	TaylorHoodEnum
++	TetraEnum
++	TetraInputEnum
++	ThermalAnalysisEnum
++	ThermalSolutionEnum
++	ThicknessErrorEstimatorEnum
++	TotalCalvingFluxLevelsetEnum
++	TotalCalvingMeltingFluxLevelsetEnum
++	TotalFloatingBmbEnum
++	TotalFloatingBmbScaledEnum
++	TotalGroundedBmbEnum
++	TotalGroundedBmbScaledEnum
++	TotalSmbEnum
++	TotalSmbScaledEnum
++	TransientArrayParamEnum
++	TransientInputEnum
++	TransientParamEnum
++	TransientSolutionEnum
++	TriaEnum
++	TriaInputEnum
++	UzawaPressureAnalysisEnum
++	VectorParamEnum
++	VertexEnum
++	VertexLIdEnum
++	VertexPIdEnum
++	VertexSIdEnum
++	VerticesEnum
++	ViscousHeatingEnum
++	WaterEnum
++	XTaylorHoodEnum
++	XYEnum
++	XYZEnum
++	#}}}
++	MaximumNumberOfDefinitionsEnum
++end
++
++function EnumToString(enum::IssmEnum)
++
++	#Make dictionnary from enums
++	inst = instances(IssmEnum)
++	syms = Symbol.(inst)
++	enumdic = Dict(zip(inst, syms))
++
++	return enumdic[enum]
++end
++
++function EnumToString(enum::Int64)
++	return EnumToString(IssmEnum(enum))
++end
++
++function StringToEnum(string::String)
++
++	#Make dictionnary from enums
++	inst = instances(IssmEnum)
++	syms = Symbol.(inst)
++	enumdic = Dict(zip(syms, inst))
++
++	return enumdic[Symbol(string)]
++end
++
++function StringToEnumInt(string::String)
++	return Integer(StringToEnum(string))
++end
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26629)
+@@ -0,0 +1,111 @@
++#Model Processor
++function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
++	for i in 1:length(elements)
++		InputCreate(elements[i],inputs,data,enum)
++	end
++end#}}}
++function ModelProcessor(md::model) #{{{
++
++	#Initialize structures
++	elements    = Vector{Tria}(undef,0)
++	vertices    = Vector{Vertex}(undef,0)
++	nodes       = Vector{Node}(undef,0)
++	constraints = Vector{Constraint}(undef,0)
++	parameters  = Parameters(Dict{IssmEnum,Parameter}())
++	inputs      = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
++
++	#Create  elements, vertices and materials (independent of the analysis)
++	CreateElements(elements,md)
++	CreateVertices(vertices,md)
++	CreateParameters(parameters,md)
++	CreateInputs(inputs,elements,md)
++
++	#Now create analysis specific data structure
++	analysis = StressbalanceAnalysis()
++	UpdateParameters(analysis,parameters,md)
++	CreateNodes(analysis,nodes,md)
++	UpdateElements(analysis,elements,inputs,md)
++	CreateConstraints(analysis,constraints,md)
++
++	#Configure objects
++	ConfigureObjectx(elements,nodes,vertices,parameters,inputs)
++
++	#Constrain and Number nodes
++	SpcNodesx(nodes,constraints,parameters)
++	NodesDofx(nodes,parameters)
++	error("STOP")
++
++	#Build FemModel
++	return FemModel(elements,vertices,nodes,parameters,inputs,constraints)
++end# }}}
++function CreateElements(elements::Vector{Tria},md::model) #{{{
++
++	#Make sure elements is currently empty
++	@assert length(elements)==0
++
++	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
++	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
++	tempvertices = Vector{Vertex}(undef,3)
++	tempnodes    = Vector{Node}(undef,3)
++
++	count = 0
++	for i in 1:md.mesh.numberofelements
++
++		#Assume Linear Elements for now
++		vertexids = md.mesh.elements[i,:]
++		nodeids   = md.mesh.elements[i,:]
++
++		#Call constructor and add to dataset elements
++		push!(elements,Tria(i,count,vertexids,tempvertices,nodeids,tempnodes,tempparams,tempinputs))
++	end
++
++end# }}}
++function CreateVertices(vertices::Vector{Vertex},md::model) #{{{
++
++	#Make sure vertices is currently empty
++	@assert length(vertices)==0
++
++	#Get data from md
++	x = md.mesh.x
++	y = md.mesh.y
++
++	count = 0
++	for i in 1:md.mesh.numberofvertices
++		push!(vertices,Vertex(i,x[i],y[i]))
++	end
++
++end# }}}
++function CreateParameters(parameters::Parameters,md::model) #{{{
++
++	#Get data from md
++	AddParam(parameters,md.materials.rho_ice,MaterialsRhoIceEnum)
++	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
++	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
++end# }}}
++function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
++
++	#Only assume we have Matice for now
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
++end# }}}
++
++#Other modules
++function ConfigureObjectx(elements::Vector{Tria},nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) #{{{
++
++	for i in 1:length(elements)
++		Configure(elements[i],nodes,vertices,parameters,inputs)
++	end
++
++end# }}}
++function SpcNodesx(nodes::Vector{Node},constraints::Vector{Constraint},parameters::Parameters) #{{{
++
++	for i in 1:length(constraints)
++		ConstrainNode(constraints[i],nodes,parameters)
++	end
++
++end# }}}
++function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
++
++	error("not implemented yet")
++
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26629)
+@@ -0,0 +1,33 @@
++#Node class definition
++mutable struct Node #{{{
++	id::Int64
++	sid::Int64
++	indexingupdate::Bool
++	gsize::Int64
++	gdoflist::Vector{Int64}
++	fdoflist::Vector{Int64}
++	sdoflist::Vector{Int64}
++	svalues::Vector{Float64}
++end# }}}
++
++#Node functions
++function Base.show(io::IO, this::Node)# {{{
++
++	println(io,"Node:")
++	println(io,"   id:  ",this.id)
++	println(io,"   sid: ",this.sid)
++	println(io,"   indexingupdate: ",this.indexingupdate)
++	println(io,"   gsize: ",this.gsize)
++	println(io,"   gdoflist: ",this.gdoflist)
++	println(io,"   fdoflist: ",this.fdoflist)
++	println(io,"   sdoflist: ",this.sdoflist)
++	println(io,"   svalues: ",this.svalues)
++end# }}}
++function ApplyConstraint(node::Node,dof::Int8,value::Float64) #{{{
++
++	node.indexingupdate = true
++	node.fdoflist[dof]  = -1
++	node.sdoflist[dof]  = +1
++	node.svalues[dof]   = value
++
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/parameters.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/parameters.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/parameters.jl	(revision 26629)
+@@ -0,0 +1,46 @@
++#Parameter class definition
++abstract type Parameter end
++struct DoubleParam <: Parameter #{{{
++	enum::IssmEnum
++	value::Float64
++end# }}}
++struct IntParam <: Parameter #{{{
++	enum::IssmEnum
++	value::Int64
++end# }}}
++
++#Parameters dataset class definition
++mutable struct Parameters #{{{
++	lookup::Dict{IssmEnum,Parameter}
++end# }}}
++
++#Parameter functions
++function GetParameterValue(param::DoubleParam) #{{{
++	return param.value
++end#}}}
++function GetParameterValue(param::IntParam) #{{{
++	return param.value
++end#}}}
++
++#Parameters functions
++function AddParam(parameters::Parameters,value::Float64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = DoubleParam(enum,value)
++
++end#}}}
++function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = IntParam(enum,value)
++
++end#}}}
++function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = IntParam(enum,value)
++
++end#}}}
++function FindParam(parameters::Parameters,enum::IssmEnum) #{{{
++
++	param = parameters.lookup[enum]
++	return GetParameterValue(param)
++
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26629)
+@@ -0,0 +1,26 @@
++include("../md/classes.jl")
++include("./issmenums.jl")
++include("./parameters.jl")
++include("./inputs.jl")
++include("./vertices.jl")
++include("./nodes.jl")
++include("./elements.jl")
++include("./constraints.jl")
++include("./femmodel.jl")
++include("./analyses.jl")
++include("./gauss.jl")
++include("./modules.jl")
++
++function IssmCore(md::model) #{{{
++
++	#Construct FemModel
++	femmodel=ModelProcessor(md)
++
++	#Solve
++	analysis = StressbalanceAnalysis()
++	Core(analysis,femmodel)
++
++	#then what??
++	error("STOP")
++
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/vertices.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/vertices.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/vertices.jl	(revision 26629)
+@@ -0,0 +1,6 @@
++#Vertex class definition
++mutable struct Vertex#{{{
++	sid::Int64
++	x::Float64
++	y::Float64
++end# }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26629-26630.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26629-26630.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26629-26630.diff	(revision 26740)
@@ -0,0 +1,19 @@
+Index: ../trunk-jpl/src/m/solve/loadresultsfromcluster.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultsfromcluster.m	(revision 26629)
++++ ../trunk-jpl/src/m/solve/loadresultsfromcluster.m	(revision 26630)
+@@ -3,9 +3,11 @@
+ %
+ %   Usage:
+ %      md=loadresultsfromcluster(md,varargin);
+-%      options include:
+-%         - runtimename
+-%         - nolog.
++%
++%      Options include: 'runtimename', 'nolog'
++%
++%   Example:
++%     md=loadresultsfromcluster(md,'runtimename','test101-06-15-2021-13-24-18-4883');
+ 
+ %process options: 
+ options=pairoptions(varargin{:});
Index: /issm/oecreview/Archive/25834-26739/ISSM-26630-26631.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26630-26631.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26630-26631.diff	(revision 26740)
@@ -0,0 +1,47 @@
+Index: ../trunk-jpl/src/m/shp/shp2exp.m
+===================================================================
+--- ../trunk-jpl/src/m/shp/shp2exp.m	(revision 26630)
++++ ../trunk-jpl/src/m/shp/shp2exp.m	(revision 26631)
+@@ -47,19 +47,30 @@
+ 		end
+ 	elseif strcmpi(shp(i).Geometry,'Point'),
+ 		x=shp(i).X; y=shp(i).Y;
+-		expstruct(end+1).x=x;
+-		expstruct(end).y=y;
+-		expstruct(end).nods=length(x);
+-		expstruct(end).density=1;
+-		expstruct(end).closed=0;
+-		%exp(end).name=num2str(shp(i).id);
++		if ~isnan(x) && ~isnan(y)
++			expstruct(end+1).x=x;
++			expstruct(end).y=y;
++			expstruct(end).nods=length(x);
++			expstruct(end).density=1;
++			expstruct(end).closed=0;
++			%exp(end).name=num2str(shp(i).id);
++		end
++	elseif strcmpi(shp(i).Geometry,'PointZ'),
++		shp(i)
+ 	elseif strcmpi(shp(i).Geometry,'Line'),
+-		x=shp(i).X; y=shp(i).Y;
+-		expstruct(end+1).x=x;
+-		expstruct(end).y=y;
+-		expstruct(end).nods=length(x);
+-		expstruct(end).density=1;
+-		expstruct(end).closed=0;
++		x=shp(i).X(:); y=shp(i).Y(:);
++		pos = find(~isnan(x) & ~isnan(y));
++		idx=find(diff(pos)~=1);
++		A=[idx(1);diff(idx);numel(pos)-idx(end)];
++		Cx=mat2cell(x(pos),A,1);
++		Cy=mat2cell(y(pos),A,1);
++		for i=1:numel(Cx)
++			expstruct(end+1).x=Cx{i};
++			expstruct(end).y=Cy{i};
++			expstruct(end).nods=length(Cx{i});
++			expstruct(end).density=1;
++			expstruct(end).closed=0;
++		end
+ 	end
+ end
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26631-26632.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26631-26632.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26631-26632.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26631)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26632)
+@@ -356,6 +356,10 @@
+ 		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+ 		frictionheat=alpha2*(vx*vx+vy*vy);
+ 
++		/* *** TEST take out frictional heat for large gap height *** */
++		if(gap>br)
++		 frictionheat=0.;
++
+ 		/*Get water and ice pressures*/
+ 		IssmDouble pressure_ice   = rho_ice*g*thickness;    _assert_(pressure_ice>0.); 
+ 		IssmDouble pressure_water = rho_water*g*(head-bed);
+@@ -647,6 +651,10 @@
+ 		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+ 		frictionheat=alpha2*(vx*vx+vy*vy);
+ 
++		/* *** TEST take out frictional heat for large gap height *** */
++		if(gap>br)
++		 frictionheat=0.;
++
+ 		/*Get water and ice pressures*/
+ 		IssmDouble pressure_ice   = rho_ice*g*thickness;    _assert_(pressure_ice>0.); 
+ 		IssmDouble pressure_water = rho_water*g*(head-bed);
Index: /issm/oecreview/Archive/25834-26739/ISSM-26632-26633.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26632-26633.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26632-26633.diff	(revision 26740)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive350.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/25834-26739/ISSM-26633-26634.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26633-26634.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26633-26634.diff	(revision 26740)
@@ -0,0 +1,182 @@
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26633)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26634)
+@@ -3,7 +3,8 @@
+ using .ISSM
+ 
+ md = ISSM.model()
+-md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.)
++#md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.)
++md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.)
+ md = ISSM.setmask(md,"all","")
+ 
+ #Geometry
+Index: ../trunk-jpl/src/jl/solve/analyses.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26633)
++++ ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26634)
+@@ -52,6 +52,10 @@
+ 	end
+ 
+ end#}}}
++function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
++	error("STOP")
++end#}}}
++
+ function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+ 
+ 	#Fetch parameters relevant to solution sequence
+@@ -64,6 +68,8 @@
+ 	error("STOP")
+ 
+ end #}}}
++
++
+ function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
+ 
+ 	#Initialize number of iterations
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26633)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26634)
+@@ -33,7 +33,6 @@
+ 	#Constrain and Number nodes
+ 	SpcNodesx(nodes,constraints,parameters)
+ 	NodesDofx(nodes,parameters)
+-	error("STOP")
+ 
+ 	#Build FemModel
+ 	return FemModel(elements,vertices,nodes,parameters,inputs,constraints)
+@@ -106,6 +105,36 @@
+ end# }}}
+ function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
+ 
+-	error("not implemented yet")
++	#Do we have any nodes?
++	if length(nodes)==0
++		return
++	end
+ 
++	#Do we really need to update dof indexing
++	if(~RequiresDofReindexing(nodes)) return end
++
++	print("   Renumbering degrees of freedom\n")
++	DistributeDofs(nodes,GsetEnum)
++	DistributeDofs(nodes,FsetEnum)
++	DistributeDofs(nodes,SsetEnum)
++
+ end# }}}
++function GetSolutionFromInputsx(analysis::Analysis,femmodel::FemModel) #{{{
++
++	#Get size of vector
++	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
++
++	println(gsize)
++	error("Stop ===")
++
++	#Initialize solution vector
++	ug = Vector{Float64}(undef,gsize)
++
++	#Go through elements and plug in solution
++	for i=1:length(femmodel.elements)
++		GetSolutionFromInputs(analysis,ug,femmodel.elements[i])
++	end
++
++	return ug
++
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26633)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26634)
+@@ -31,3 +31,89 @@
+ 	node.svalues[dof]   = value
+ 
+ end# }}}
++function DistributeDofs(node::Node,setenum::IssmEnum,dofcount::Int64) #{{{
++
++	if setenum==GsetEnum
++		for i=1:node.gsize
++			node.gdoflist[i] = dofcount
++			dofcount += 1
++		end
++	elseif setenum==FsetEnum
++		for i=1:node.gsize
++			if  node.fdoflist[i]!=-1
++				@assert node.sdoflist[i]==-1
++				node.fdoflist[i] = dofcount
++				dofcount += 1
++			end
++		end
++	elseif setenum==SsetEnum
++		for i=1:node.gsize
++			if  node.sdoflist[i]!=-1
++				@assert node.fdoflist[i]==-1
++				node.sdoflist[i] = dofcount
++				dofcount += 1
++			end
++		end
++	else
++		error("not supported")
++	end
++
++	return dofcount
++end# }}}
++function GetNumberOfDofs(node::Node,setenum::IssmEnum) #{{{
++
++	if setenum==GsetEnum
++		dofcount = node.gsize
++	elseif setenum==FsetEnum
++		dofcount = 0
++		for i=1:node.gsize
++			if  node.fdoflist[i]!=-1
++				dofcount += 1
++			end
++		end
++	elseif setenum==SsetEnum
++		dofcount = 0
++		for i=1:node.gsize
++			if  node.sdoflist[i]!=-1
++				dofcount += 1
++			end
++		end
++	else
++		error("not supported")
++	end
++
++	return dofcount
++
++end# }}}
++
++#Nodes functions
++function RequiresDofReindexing(nodes::Vector{Node}) #{{{
++
++	for i in 1:length(nodes)
++		if nodes[i].indexingupdate
++			return true
++		end
++	end
++
++	return false
++
++end# }}}
++function DistributeDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
++
++	dofcount = 1
++
++	for i in 1:length(nodes)
++		dofcount = DistributeDofs(nodes[i],setenum,dofcount)
++	end
++
++
++end# }}}
++function NumberOfDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
++
++	numdofs = 0
++	for i in 1:length(nodes)
++		numdofs += GetNumberOfDofs(nodes[i],setenum)
++	end
++	return numdofs
++
++end# }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26634-26635.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26634-26635.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26634-26635.diff	(revision 26740)
@@ -0,0 +1,176 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26634)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26635)
+@@ -1,10 +1,9 @@
+ import numpy as np
+-
+ from checkfield import checkfield
+ from fielddisplay import fielddisplay
+-from MatlabFuncs import *
+ from WriteData import WriteData
+ 
++
+ class stochasticforcing(object):
+     """STOCHASTICFORCING class definition
+ 
+@@ -14,16 +13,16 @@
+ 
+     def __init__(self, *args):  # {{{
+         self.isstochasticforcing = 0
+-        self.fields              = np.nan
+-        self.defaultdimension    = 0
+-        self.default_id          = np.nan
+-        self.covariance          = np.nan
+-        self.randomflag          = 1
++        self.fields = np.nan
++        self.defaultdimension = 0
++        self.default_id = np.nan
++        self.covariance = np.nan
++        self.randomflag = 1
+ 
+         if len(args) == 0:
+             self.setdefaultparameters()
+         else:
+-            error('constructor not supported')
++            raise RuntimeError('constructor not supported for stochasticforcing')
+ 
+     def __repr__(self):  # {{{
+         s = '   stochasticforcing parameters:\n'
+@@ -42,9 +41,9 @@
+ 
+     def setdefaultparameters(self):  # {{{
+         # Type of stabilization used
+-        self.isstochasticforcing = 0 # stochasticforcing is turned off by default
+-        self.fields              = [] # Need to initialize to list to avoid "RuntimeError: object of type 'float' has no len()" on import of class
+-        self.randomflag          = 1 # true randomness is implemented by default
++        self.isstochasticforcing = 0  # stochasticforcing is turned off by default
++        self.fields = []  # Need to initialize to list to avoid "RuntimeError: object of type 'float' has no len()" on import of class
++        self.randomflag = 1  # true randomness is implemented by default
+         return self
+     #}}}
+ 
+@@ -53,49 +52,47 @@
+         if not self.isstochasticforcing:
+             return md
+ 
+-        num_fields  = numel(self.fields)
++        num_fields = len(self.fields)
+ 
+-        #Check that covariance matrix is positive definite
+-        try:
+-            np.linalg.cholesky(self.covariance);
+-        except:
+-            error('md.stochasticforcing.covariance is not positive definite');
++        #Check that covariance matrix is positive definite this is done internaly by linalg
++        np.linalg.cholesky(self.covariance)
+ 
+         # Check that all fields agree with the corresponding md class
+         checkdefaults = False
+         for field in self.fields:
+-            if (contains(field, 'SMB')):
+-                if not (type(md.smb) == field):
+-                    error('md.smb does not agree with stochasticforcing field {}'.format(field))
+-            if (contains(field, 'frontalforcings')):
+-                if not (type(md.frontalforcings) == field):
+-                    error('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
++            if 'SMB' in field:
++                if type(md.smb).__name__ != field:
++                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
++            if 'frontalforcings' in field:
++                if type(md.frontalforcings).__name__ != field:
++                    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
+             #Checking for specific dimensions
+-            if (field!='SMBautoregression' or field!='FrontalForcingsRignotAutoregression'):
+-                checkdefaults = True #field with non-specific dimensionality
++            if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
++                checkdefaults = True   #field with non-specific dimensionality
+ 
+         #Retrieve sum of all the field dimensionalities
+-        size_tot   = self.defaultdimension*num_fields;
+-        indSMBar = -1; #about to check for index of SMBautoregression
+-        indTFar  = -1; #about to check for index of FrontalForcingsRignotAutoregression
++        size_tot = self.defaultdimension * num_fields
++        indSMBar = -1  #about to check for index of SMBautoregression
++        indTFar = -1  #about to check for index of FrontalForcingsRignotAutoregression
+         if ('SMBautoregression' in self.fields):
+-            size_tot = size_tot-self.defaultdimension+md.smb.num_basins
+-            indSMBar = np.where(self.fields=='SMBautoregression')[0][0]
++            size_tot = size_tot - self.defaultdimension + md.smb.num_basins
++            indSMBar = self.fields.index('SMBautoregression')
+         if ('FrontalForcingsRignotAutoregression' in self.fields):
+-            size_tot = size_tot-self.defaultdimension+md.frontalforcings.num_basins
+-            indSMBar = np.where(self.fields=='FrontalForcingsRignotAutoregression')[0][0]
+-        if (indSMBar!=-1 and indTFar!=-1):
+-            if((md.smb.ar_timestep!=md.frontalforcings.ar_timestep) and np.any(self.covariance[np.sum(self.dimensions[0:indSMBar]).astype(int):np.sum(self.dimensions[0:indSMBar+1]).astype(int),np.sum(self.dimensions[0:indTFar]).astype(int):np.sum(self.dimensions[0:indTFar+1]).astype(int)]!=0)):
+-                error('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance')
++            size_tot = size_tot - self.defaultdimension + md.frontalforcings.num_basins
++            indSMBar = self.fields.index('FrontalForcingsRignotAutoregression')
++        if (indSMBar != -1 and indTFar != -1):
++            covsum = self.covariance[np.sum(self.defaultdimensions[0:indSMBar]).astype(int):np.sum(self.defaultdimensions[0:indSMBar + 1]).astype(int), np.sum(self.defaultdimensions[0:indTFar]).astype(int):np.sum(self.defaultdimensions[0:indTFar + 1]).astype(int)]
++            if((md.smb.ar_timestep != md.frontalforcings.ar_timestep) and np.any(covsum != 0)):
++                raise IOError('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance')
+ 
+         md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', supportedstochforcings())
+         #md = checkfield(md, 'fieldname', 'stochasticforcing.dimensions', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [num_fields]) # specific dimension for each field; NOTE: As opposed to MATLAB implementation, pass list
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot]) # global covariance matrix
++        md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot])  # global covariance matrix
+         md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
+         if (checkdefaults):
+             md = checkfield(md, 'fieldname', 'stochasticforcing.defaultdimension', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
+-            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id', 'Inf', 1, '>=', 0, '<=', self.defaultdimension, 'size', [md.mesh.numberofelements,1])
++            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id', 'Inf', 1, '>=', 0, '<=', self.defaultdimension, 'size', [md.mesh.numberofelements, 1])
+         return md
+     # }}}
+ 
+@@ -113,36 +110,37 @@
+             return md
+         else:
+             #Retrieve dimensionality of each field
+-            dimensions = self.defaultdimension*np.ones(num_fields)
+-            for ind,field in enumerate(self.fields):
++            dimensions = self.defaultdimension * np.ones(num_fields)
++            for ind, field in enumerate(self.fields):
+                 #Checking for specific dimensions
+-                if (field=='SMBautoregression'):
++                if (field == 'SMBautoregression'):
+                     dimensions[ind] = md.smb.num_basins
+-                if (field=='FrontalForcingsRignotAutoregression'):
++                if (field == 'FrontalForcingsRignotAutoregression'):
+                     dimensions[ind] = md.frontalforcings.num_basins
+ 
+             # Scaling covariance matrix (scale column-by-column and row-by-row)
+-            scaledfields = ['DefaultCalving','SMBautoregression'] # list of fields that need scaling * 1/yts
++            scaledfields = ['DefaultCalving', 'SMBautoregression']  # list of fields that need scaling * 1/yts
+             tempcovariance = np.copy(self.covariance)
+             for i in range(num_fields):
+                 if self.fields[i] in scaledfields:
+-                    inds = range(int(np.sum(self.dimensions[0:i])), int(np.sum(self.dimensions[0:i + 1])))
+-                    for row in inds: # scale rows corresponding to scaled field
++                    inds = range(int(np.sum(dimensions[0:i])), int(np.sum(dimensions[0:i + 1])))
++                    for row in inds:  # scale rows corresponding to scaled field
+                         tempcovariance[row, :] = 1 / yts * tempcovariance[row, :]
+-                    for col in inds: # scale columns corresponding to scaled field
++                    for col in inds:  # scale columns corresponding to scaled field
+                         tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
+             #Set dummy default_id vector if defaults not used
+             if np.isnan(self.default_id):
+-               self.default_id = np.zeros(md.mesh.numberofelements)
++                self.default_id = np.zeros(md.mesh.numberofelements)
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+-            WriteData(fid, prefix, 'data', 'dimensions', 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
+-            WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'format', 'IntMat') #12Nov2021 make sure this is zero-indexed!
+-            WriteData(fid, prefix, 'object', self, 'fieldname', 'defaultdimension', 'format', 'Integer') 
++            WriteData(fid, prefix, 'data', dimensions, 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'format', 'IntMat')  #12Nov2021 make sure this is zero-indexed!
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'defaultdimension', 'format', 'Integer')
+             WriteData(fid, prefix, 'data', tempcovariance, 'name', 'md.stochasticforcing.covariance', 'format', 'DoubleMat')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
+     # }}}
+ 
++
+ def supportedstochforcings():
+     """ Defines list of fields supported  by the class stochasticforcings
+     """
Index: /issm/oecreview/Archive/25834-26739/ISSM-26635-26636.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26635-26636.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26635-26636.diff	(revision 26740)
@@ -0,0 +1,84 @@
+Index: ../trunk-jpl/src/m/extrusion/project3d.py
+===================================================================
+--- ../trunk-jpl/src/m/extrusion/project3d.py	(revision 26635)
++++ ../trunk-jpl/src/m/extrusion/project3d.py	(revision 26636)
+@@ -1,5 +1,4 @@
+ import numpy as np
+-
+ from pairoptions import pairoptions
+ 
+ 
+@@ -7,9 +6,9 @@
+     '''
+     PROJECT3D - vertically project a vector from 2d mesh
+ 
+-        vertically project a vector from 2d mesh (split in noncoll and coll 
++        vertically project a vector from 2d mesh (split in noncoll and coll
+         areas) into a 3d mesh.
+-        This vector can be a node vector of size (md.mesh.numberofvertices2d, 
++        This vector can be a node vector of size (md.mesh.numberofvertices2d,
+         N/A) or an element vector of size (md.mesh.numberofelements2d, N/A).
+ 
+         arguments:
+@@ -17,10 +16,10 @@
+             'type': 'element' or 'node' or 'poly'
+ 
+         options:
+-            'layer'     a layer number where vector should keep its values. If 
+-                        not specified, all layers adopt the value of the 2d 
++            'layer'     a layer number where vector should keep its values. If
++                        not specified, all layers adopt the value of the 2d
+                         vector.
+-            'padding':  default to 0 (value adopted by other 3d layers not 
++            'padding':  default to 0 (value adopted by other 3d layers not
+                         being projected.
+             'degree':   degree of polynomials when extrude from bottom to the top
+ 
+@@ -119,10 +118,10 @@
+     elif vectype.lower() == 'poly':
+         #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)
++            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:
+@@ -130,14 +129,14 @@
+             #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*(1.0-(1.0-i/(md.mesh.numberoflayers - 1.0))**polyexponent)
++                    projected_vector[(i * md.mesh.numberofvertices2d):((i + 1) * md.mesh.numberofvertices2d)] = vector2d * (1.0 - (1.0 - i / (md.mesh.numberoflayers - 1.0))**polyexponent)
+             else:
+-                projected_vector[((layer - 1) * md.mesh.numberofelements2d):(layer * md.mesh.numberofelements2d)] = vector2d*(1.0-(1.0-layer/(md.mesh.numberoflayers - 1.0))**polyexponent)
++                projected_vector[((layer - 1) * md.mesh.numberofvertices2d):(layer * md.mesh.numberofvertices2d)] = vector2d * (1.0 - (1.0 - layer / (md.mesh.numberoflayers - 1.0))**polyexponent)
+         else:
+-            if vector2d.shape[0] == md.mesh.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)
++            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:
+@@ -145,9 +144,9 @@
+             #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*(1.0-(1.0-i/(md.mesh.numberoflayers - 1.0))**polyexponent)
++                    projected_vector[(i * md.mesh.numberofvertices2d):((i + 1) * md.mesh.numberofvertices2d), :] = vector2d * (1.0 - (1.0 - i / (md.mesh.numberoflayers - 1.0))**polyexponent)
+             else:
+-                projected_vector[((layer - 1) * md.mesh.numberofelements2d):(layer * md.mesh.numberofelements2d), :] = vector2d*(1.0-(1.0-layer/(md.mesh.numberoflayers - 1.0))**polyexponent)
++                projected_vector[((layer - 1) * md.mesh.numberofvertices2d):(layer * md.mesh.numberofvertices2d), :] = vector2d * (1.0 - (1.0 - layer / (md.mesh.numberoflayers - 1.0))**polyexponent)
+     else:
+         raise TypeError("project3d error message: unknown projection type")
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26636-26637.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26636-26637.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26636-26637.diff	(revision 26740)
@@ -0,0 +1,474 @@
+Index: ../trunk-jpl/test/NightlyRun/test254.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test254.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test254.py	(revision 26637)
+@@ -2,12 +2,13 @@
+ from model import *
+ from socket import gethostname
+ import numpy as np
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from paterson import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from paterson import paterson
++from solve import solve
++from SetMLHOBC import SetMLHOBC
+ from generic import generic
+ 
+ md = triangle(model(), '../Exp/Square.exp', 150000)
+@@ -69,7 +70,7 @@
+ md.mask.ice_levelset = -1 + nodeonicefront
+ 
+ md.stressbalance.requested_outputs = ['default', 'VySurface', 'VyShear', 'VyBase']
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Stressbalance')
+ 
+ # create analytical solution: strain rate is constant = ((rho_ice * g * h) / 4B)^3 (Paterson, 4th Edition, page 292.
+Index: ../trunk-jpl/test/NightlyRun/test255.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test255.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test255.py	(revision 26637)
+@@ -1,13 +1,13 @@
+ #Test Name: SquareShelfStressMLHO2dTransientIncrHydro
+ from model import *
+ from socket import gethostname
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
+ 
+-
+ md = triangle(model(), '../Exp/Square.exp', 150000.)
+ md = setmask(md, 'all', '')
+ md = parameterize(md, '../Par/SquareShelf.py')
+@@ -14,7 +14,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.masstransport.hydrostatic_adjustment = 'Incremental'
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test330.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test330.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test330.py	(revision 26637)
+@@ -1,11 +1,12 @@
+ #Test Name: SquareSheetConstrainedStressMLHO2d
+ from model import *
+ from socket import gethostname
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
+ 
+ 
+ md = triangle(model(), '../Exp/Square.exp', 150000.)
+@@ -14,7 +15,7 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test332.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test332.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test332.py	(revision 26637)
+@@ -1,19 +1,19 @@
+ #Test Name: SquareSheetConstrainedTranMLHO2d
+ from model import *
+ from socket import gethostname
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
+ 
+-
+ md = triangle(model(), '../Exp/Square.exp', 150000.)
+ md = setmask(md, '', '')
+ md = parameterize(md, '../Par/SquareSheetConstrained.py')
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test335.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test335.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test335.py	(revision 26637)
+@@ -1,11 +1,12 @@
+ #Test Name: SquareSheetConstrainedStressMLHO2d
+ from model import *
+ from socket import gethostname
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
+ 
+ 
+ md = triangle(model(), '../Exp/Square.exp', 200000.)
+@@ -12,7 +13,7 @@
+ md = setmask(md, '', '')
+ md = parameterize(md, '../Par/SquareSheetConstrained.py')
+ md = setflowequation(md, 'MLHO', 'all')
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md.extrude(5, 1.)
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.stressbalance.requested_outputs = ['default', 'VxSurface', 'VySurface', 'VxShear', 'VyShear', 'VxBase', 'VyBase']
+Index: ../trunk-jpl/test/NightlyRun/test447.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test447.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test447.py	(revision 26637)
+@@ -2,13 +2,14 @@
+ import numpy as np
+ from model import *
+ from socket import gethostname
+-
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
+ from frictioncoulomb import frictioncoulomb
++from generic import generic
+ 
+ md = triangle(model(), '../Exp/Square.exp', 150000.)
+ md = setmask(md, '../Exp/SquareShelf.exp', '')
+@@ -26,19 +27,19 @@
+ md = setflowequation(md, 'MLHO', 'all')
+ md.cluster = generic('name', gethostname(), 'np', 3)
+ md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+ field_names = [
+-    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 
+-    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 
++    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1',
++    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2',
+     'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3'
+ ]
+ field_tolerances = [
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
+Index: ../trunk-jpl/test/NightlyRun/test449.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test449.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test449.py	(revision 26637)
+@@ -2,12 +2,15 @@
+ import numpy as np
+ from model import *
+ from socket import gethostname
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
++from generic import generic
+ 
++
+ md = triangle(model(), '../Exp/Square.exp', 100000.)
+ md = setmask(md, '../Exp/SquareShelf.exp', '')
+ md = parameterize(md, '../Par/SquareSheetShelf.py')
+@@ -55,7 +58,7 @@
+ md.timestepping.time_step = 10
+ 
+ md.cluster = generic('name', gethostname(), 'np', 3)
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Transient')
+ #print md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate
+ #print md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate
+Index: ../trunk-jpl/test/NightlyRun/test519.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test519.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test519.py	(revision 26637)
+@@ -1,13 +1,15 @@
+ #Test Name: PigTranMLHO2d
++import numpy as np
+ from model import *
+ from socket import gethostname
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from solve import *
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
++from generic import generic
+ 
+-
+ md = triangle(model(), '../Exp/Pig.exp', 20000.)
+ md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+ md = parameterize(md, '../Par/Pig.py')
+@@ -15,7 +17,7 @@
+ md.mesh.scale_factor = 0.9 * np.ones((md.mesh.numberofvertices))
+ md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeScaled', 'GroundedArea', 'GroundedAreaScaled', 'FloatingArea', 'FloatingAreaScaled', 'TotalSmb', 'TotalSmbScaled', 'TotalFloatingBmb', 'TotalFloatingBmbScaled']
+ md.cluster = generic('name', gethostname(), 'np', 3)
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Transient')
+ 
+ # Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test811.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test811.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test811.py	(revision 26637)
+@@ -1,19 +1,20 @@
+ #Test Name: ValleyGlacierLevelsetCalvingMLHO2d
+ import numpy as np
+-from MatlabFuncs import oshostname
+ from model import *
+-from parameterize import *
+-from setflowequation import *
+-from setmask import *
+-from solve import *
+-from triangle import *
++from socket import gethostname
++from triangle import triangle
++from setmask import setmask
++from parameterize import parameterize
++from setflowequation import setflowequation
++from solve import solve
++from SetMLHOBC import SetMLHOBC
++from generic import generic
+ 
+-
+ md = triangle(model(), '../Exp/Square.exp', 50000)
+ md = setmask(md, '', '')
+ md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+ md = setflowequation(md, 'MLHO', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ #Transient
+ md.transient.isstressbalance = True
+@@ -27,7 +28,7 @@
+ md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+ md.levelset.migration_max = 1e10
+ 
+-md = SetMLHOBC(md);
++md = SetMLHOBC(md)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test257.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test257.py	(revision 26637)
+@@ -24,32 +24,32 @@
+ xmax = max(md.mesh.x)
+ # Generate basin IDs for 3 basins
+ idbasin = np.zeros((md.mesh.numberofelements,))
+-iid1 = np.where(md.mesh.y >= 2/3 * ymax)[0]
+-iid2 = intersect(np.where(md.mesh.y < 2/3 * ymax)[0], np.where(md.mesh.x >= 1/3 * xmax)[0])
+-iid3 = intersect(np.where(md.mesh.y < 2/3 * ymax)[0], np.where(md.mesh.x < 1/3 * xmax)[0])
++iid1 = np.where(md.mesh.y >= 2. / 3. * ymax)[0]
++iid2 = intersect(np.where(md.mesh.y < 2. / 3. * ymax)[0], np.where(md.mesh.x >= 1. / 3. * xmax)[0])
++iid3 = intersect(np.where(md.mesh.y < 2. / 3. * ymax)[0], np.where(md.mesh.x < 1. / 3. * xmax)[0])
+ for ii in range(md.mesh.numberofelements):
+     for vertex in range(3):
+-        if md.mesh.elements[ii][vertex] - 1 in iid1: # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+             idbasin[ii] = 1
+-    if idbasin[ii] == 0: # no vertex was found in basin 1
++    if idbasin[ii] == 0:  # no vertex was found in basin 1
+         for vertex in range(3):
+-            if md.mesh.elements[ii][vertex] - 1 in iid2: # one vertex in basin 2; NOTE: offset because of 1-based vertex indexing
++            if md.mesh.elements[ii][vertex] - 1 in iid2:  # one vertex in basin 2; NOTE: offset because of 1-based vertex indexing
+                 idbasin[ii] = 2
+-    if idbasin[ii] == 0: # no vertex was found in basin 1 and 2
++    if idbasin[ii] == 0:  # no vertex was found in basin 1 and 2
+         idbasin[ii] = 3
+ 
+ # SMB parameters
+ md.timestepping.start_time = 0
+-md.timestepping.time_step  = 1
++md.timestepping.time_step = 1
+ md.timestepping.final_time = 5
+ md.smb = SMBautoregression()
+-md.smb.num_basins = 3 # number of basins
+-md.smb.basin_id = idbasin - 1 # prescribe basin ID number to elements; # NOTE: offset because of 1-based vertex indexing
+-md.smb.beta0 = np.array([[0.5, 1.2, 1.5]]) # intercept values of SMB in basins [m ice eq./yr]
+-md.smb.beta1 = np.array([[0.0, 0.01, -0.01]]) # trend values of SMB in basins [m ice eq./yr^2]
++md.smb.num_basins = 3  # number of basins
++md.smb.basin_id = idbasin - 1  # prescribe basin ID number to elements; # NOTE: offset because of 1-based vertex indexing
++md.smb.beta0 = np.array([[0.5, 1.2, 1.5]])  # intercept values of SMB in basins [m ice eq./yr]
++md.smb.beta1 = np.array([[0.0, 0.01, -0.01]])  # trend values of SMB in basins [m ice eq./yr^2]
+ md.smb.ar_initialtime = md.timestepping.start_time
+ md.smb.ar_order = 4
+-md.smb.ar_timestep = 2.0 #timestep of the autoregressive model [yr]
++md.smb.ar_timestep = 2.0  #timestep of the autoregressive model [yr]
+ md.smb.phi = np.array([[0.2, 0.1, 0.05, 0.01], [0.4, 0.2, -0.2, 0.1], [0.4, -0.4, 0.1, -0.1]])
+ 
+ # Stochastic forcing
+@@ -58,6 +58,7 @@
+ md.stochasticforcing.covariance = np.array([[0.15, 0.08, -0.02], [0.08, 0.12, -0.05], [-0.02, -0.05, 0.1]]) # global covariance among- and between-fields
+ md.stochasticforcing.randomflag = 0 # fixed random seeds
+ 
++
+ md = solve(md, 'Transient')
+ 
+ # Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test542.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test542.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test542.py	(revision 26637)
+@@ -16,7 +16,7 @@
+ 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.time_step = 2
+ md.timestepping.final_time = 50
+ 
+ # Separate domain in 2 basins
+@@ -24,9 +24,9 @@
+ iid1 = np.where(md.mesh.x <= -1.6e6)[0]
+ for ii in range(md.mesh.numberofelements):
+     for vertex in range(3):
+-        if md.mesh.elements[ii][vertex] - 1 in iid1: # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+             idbasin[ii] = 1
+-    if idbasin[ii] == 0: # no vertex was found in basin 1
++    if idbasin[ii] == 0:  # no vertex was found in basin 1
+         idbasin[ii] = 2
+ 
+ # Calving and frontalforcings parameters
+@@ -34,12 +34,12 @@
+ md.calving = calvingvonmises()
+ md.frontalforcings = frontalforcingsrignot()
+ md.frontalforcings.num_basins = 2
+-md.frontalforcings.basin_id = idbasin - 1 # NOTE: offset because of 1-based vertex indexing
++md.frontalforcings.basin_id = idbasin - 1  # NOTE: offset because of 1-based vertex indexing
+ md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
+ md.frontalforcings.thermalforcing = 0.5 * np.ones((md.mesh.numberofvertices,))
+ for elem in range(md.mesh.numberofelements):
+     if idbasin[elem] == 2:
+-        md.frontalforcings.thermalforcing[md.mesh.elements[elem, 0:3] - 1] = 1.5 # NOTE: offset because of 1-based vertex indexing
++        md.frontalforcings.thermalforcing[md.mesh.elements[elem, 0:3] - 1] = 1.5  # NOTE: offset because of 1-based vertex indexing
+ 
+ md.transient.ismovingfront = 1
+ md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26636)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26637)
+@@ -17,7 +17,7 @@
+ md = parameterize(md, '../Par/Pig.py')
+ md = setflowequation(md, 'SSA', 'all')
+ md.timestepping.start_time = 0
+-md.timestepping.time_step  = 1
++md.timestepping.time_step = 1
+ md.timestepping.final_time = 25
+ 
+ # Separate domain in 2 basins
+@@ -25,9 +25,9 @@
+ iid1 = np.where(md.mesh.x <= -1.6e6)[0]
+ for ii in range(md.mesh.numberofelements):
+     for vertex in range(3):
+-        if md.mesh.elements[ii][vertex] - 1 in iid1: # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+             idbasin[ii] = 1
+-    if idbasin[ii] == 0: # no vertex was found in basin 1
++    if idbasin[ii] == 0:  # no vertex was found in basin 1
+         for vertex in range(3):
+             idbasin[ii] = 2
+ 
+@@ -36,21 +36,23 @@
+ md.calving = calvingvonmises()
+ md.frontalforcings = frontalforcingsrignotautoregression()
+ md.frontalforcings.num_basins = 2
+-md.frontalforcings.basin_id = idbasin - 1 # NOTE: offset because of 1-based vertex indexing
++md.frontalforcings.basin_id = idbasin - 1  # NOTE: offset because of 1-based vertex indexing
+ md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
+-md.frontalforcings.beta0 = np.array([[0.05, 0.01]]) # intercept values of TF in basins [C]
+-md.frontalforcings.beta1 = np.array([[0.001, 0.0001]]) # trend values of TF in basins [C/yr]
+-md.frontalforcings.ar_initialtime = md.timestepping.start_time # initial time in the AR model parameterization [yr]
++md.frontalforcings.beta0 = np.array([[0.05, 0.01]])  # intercept values of TF in basins [C]
++md.frontalforcings.beta1 = np.array([[0.001, 0.0001]])  # trend values of TF in basins [C/yr]
++md.frontalforcings.ar_initialtime = md.timestepping.start_time  # initial time in the AR model parameterization [yr]
+ md.frontalforcings.ar_order = 4
+-md.frontalforcings.ar_timestep = 2 # timestep of the autoregressive model [yr]
+-md.frontalforcings.phi = np.array([[0.1, -0.1, 0.01, -0.01], [0.2, -0.2, 0.1, 0.0]]) # autoregressive parameters
++md.frontalforcings.ar_timestep = 2  # timestep of the autoregressive model [yr]
++md.frontalforcings.phi = np.array([[0.1, -0.1, 0.01, -0.01], [0.2, -0.2, 0.1, 0.0]])  # autoregressive parameters
+ 
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+ md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression']
++
+ md.stochasticforcing.covariance = 1e-4 * np.array([[1.5, 0.5], [0.5, 0.4]]) # global covariance among- and between-fields
+ md.stochasticforcing.randomflag = 0 # determines true/false randomness
+ 
++
+ md.transient.ismovingfront = 1
+ md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
+ md.levelset.migration_max = 1e10
Index: /issm/oecreview/Archive/25834-26739/ISSM-26637-26638.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26637-26638.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26637-26638.diff	(revision 26740)
@@ -0,0 +1,521 @@
+Index: ../trunk-jpl/test/NightlyRun/test2001.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test2001.py	(revision 26638)
+@@ -1,7 +1,7 @@
+ #Test Name: SquareSheetConstrainedGia2d
+ #GIA test, based off of test101. Running default GIA Ivins class.
+ import numpy as np
+-
++from socket import gethostname
+ from materials import *
+ from MatlabFuncs import *
+ from model import *
+@@ -55,7 +55,7 @@
+ md.transient.isslc = 1
+ 
+ #Solve for GIA deflection
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ md.verbose.solver = 0
+ md = solve(md, 'Transient')
+ 
+Index: ../trunk-jpl/test/NightlyRun/test2003.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2003.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test2003.py	(revision 26638)
+@@ -1,6 +1,6 @@
+ #Test Name: EarthSlc_rotationalFeedback
+ import numpy as np
+-
++from socket import gethostname
+ from gmshplanet import *
+ from gmtmask import *
+ from lovenumbers import *
+@@ -94,7 +94,7 @@
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 0
+ md.solidearth.settings.viscous = 0
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ #md.verbose = verbose('111111111')
+ md = solve(md, 'Transient')
+ SnoRotation = md.results.TransientSolution.Sealevel
+@@ -107,7 +107,7 @@
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
+ md.solidearth.settings.viscous = 0
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ #md.verbose = verbose('111111111')
+ md = solve(md, 'Transient')
+ SRotation = md.results.TransientSolution.Sealevel
+Index: ../trunk-jpl/test/NightlyRun/test2006.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2006.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test2006.py	(revision 26638)
+@@ -1,6 +1,6 @@
+ #Test Name: EarthSlc Dakota Sampling glaciers
+ import numpy as np
+-
++from socket import gethostname
+ from dmeth_params_set import *
+ from gmshplanet import *
+ from gmtmask import *
+@@ -16,7 +16,7 @@
+ 
+ # Mesh earth
+ md = model()
+-md.cluster = generic('name', oshostname(), 'np', 5)
++md.cluster = generic('name', gethostname(), 'np', 5)
+ md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 700.) #700 km resolution mesh
+ 
+ # Geometry for the bed, arbitrary thickness of 100
+@@ -55,7 +55,7 @@
+ oceanmask[pos] = 1
+ 
+ icemask = np.ones((md.mesh.numberofvertices, 1))
+-# NOTE: Need to be careful here: when addressing with multidimensional array in 
++# NOTE: Need to be careful here: when addressing with multidimensional array in
+ # MATLAB, only first column of values are used as indices
+ #
+ icemask[md.mesh.elements[posant][:,0] - 1] = -1
+Index: ../trunk-jpl/test/NightlyRun/test2010.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2010.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test2010.py	(revision 26638)
+@@ -1,10 +1,9 @@
+ #Test Name: MomentOfIntertia
+ import numpy as np
+-
++from socket import gethostname
+ from gmshplanet import *
+ from gmtmask import *
+ from lovenumbers import *
+-from MatlabFuncs import *
+ from model import *
+ from paterson import *
+ from solve import *
+@@ -104,7 +103,7 @@
+ md.solidearth.settings.elastic = 1
+ md.solidearth.settings.rotation = 1
+ md.solidearth.settings.viscous = 0
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ md = solve(md, 'Transient')
+ 
+ moi_p = md.solidearth.rotational.polarmoi
+Index: ../trunk-jpl/test/NightlyRun/test2084.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test2084.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test2084.py	(revision 26638)
+@@ -1,8 +1,8 @@
+ #Test Name: GiaCaron
+-# Forward Love number solution for a viscoelastic earth, model M3-L70-V01 from 
+-# Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M., Martinec, Z., 
+-# Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A. and King, M. A. 
+-# (2011), A benchmark study for glacial isostatic adjustment codes. Geophysical 
++# Forward Love number solution for a viscoelastic earth, model M3-L70-V01 from
++# Spada, G., Barletta, V. R., Klemann, V., Riva, R. E. M., Martinec, Z.,
++# Gasperini, P., Lund, B., Wolf, D., Vermeersen, L. L. A. and King, M. A.
++# (2011), A benchmark study for glacial isostatic adjustment codes. Geophysical
+ # Journal International, 185: 106--132. doi:10.1111/j.1365-246X.2011.04952.x
+ 
+ import numpy as np
+@@ -9,12 +9,12 @@
+ 
+ from generic import generic
+ from materials import *
+-from MatlabFuncs import *
++from socket import gethostname
+ from model import *
+ from solve import *
+ 
+ md = model()
+-md.cluster = generic('name', oshostname(), 'np', 1)
++md.cluster = generic('name', gethostname(), 'np', 1)
+ 
+ # Set validation=1 for comparing against the Spada benchark
+ validation = 0
+Index: ../trunk-jpl/test/NightlyRun/test350.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test350.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test350.py	(revision 26638)
+@@ -2,7 +2,7 @@
+ import numpy as np
+ 
+ from frictionshakti import frictionshakti
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from operator import itemgetter
+ from parameterize import parameterize
+@@ -20,7 +20,7 @@
+ md.transient = transient.deactivateall(md.transient)
+ md.transient.ishydrology = 1
+ md = setflowequation(md, 'SSA', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 2)
++md.cluster = generic('name', gethostname(), 'np', 2)
+ 
+ #Use hydrology coupled friction law
+ md.friction = frictionshakti(md.friction)
+Index: ../trunk-jpl/test/NightlyRun/test356.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test356.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test356.py	(revision 26638)
+@@ -2,7 +2,7 @@
+ import numpy as np
+ 
+ from frictionschoof import frictionschoof
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import parameterize
+ from setflowequation import setflowequation
+@@ -39,7 +39,7 @@
+ md.inversion.vx_obs = md.initialization.vx
+ md.inversion.vy_obs= md.initialization.vy
+ 
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ md = solve(md, 'Stressbalance')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test440.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test440.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test440.py	(revision 26638)
+@@ -1,5 +1,6 @@
+ #Test Name: SquareSheetShelfDakotaScaledResponseLinearPart
+ import numpy as np
++from socket import gethostname
+ from model import *
+ from triangle import *
+ from setmask import *
+@@ -14,7 +15,7 @@
+ 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.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ #partitioning
+ npart = md.mesh.numberofvertices
+Index: ../trunk-jpl/test/NightlyRun/test444.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test444.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test444.py	(revision 26638)
+@@ -1,7 +1,7 @@
+ #Test Name: SquareShelfTranForceNeg2dDakotaLocal
+ 
+ # TODO:
+-# - Figure out why test fails intermittently on Mac with "IndexError: list 
++# - Figure out why test fails intermittently on Mac with "IndexError: list
+ # index out of range"
+ #
+ 
+@@ -9,7 +9,7 @@
+ 
+ from ContourToMesh import *
+ from dmeth_params_set import *
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from partitioner import *
+@@ -36,7 +36,7 @@
+ 
+ md.settings.output_frequency = 3
+ md = setflowequation(md, 'SSA', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ regionalmask = np.zeros((md.mesh.numberofvertices, ))
+ c_in = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, '../Exp/SquareHalfRight.exp', 'node', 1)
+Index: ../trunk-jpl/test/NightlyRun/test481.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test481.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test481.py	(revision 26638)
+@@ -2,7 +2,7 @@
+ import numpy as np
+ 
+ from frictionschoof import frictionschoof
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import parameterize
+ from setflowequation import setflowequation
+@@ -21,7 +21,7 @@
+ md.friction.C    = pow(20.e4, 0.5) * np.ones((md.mesh.numberofvertices, 1))
+ md.friction.Cmax = 0.5 * np.ones((md.mesh.numberofvertices, 1))
+ md.friction.m    = 1./3.* np.ones((md.mesh.numberofelements, 1))
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test540.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test540.py	(revision 26638)
+@@ -1,7 +1,7 @@
+ #Test Name: PigTranCalvingDevSSA2d
+ import numpy as np
+ from calvingvonmises import *
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -29,7 +29,7 @@
+ 
+ #Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+-md.cluster = generic('name', oshostname(), 'np', 2)
++md.cluster = generic('name', gethostname(), 'np', 2)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26638)
+@@ -1,7 +1,7 @@
+ #Test Name: PigTranCalvingDevdHO3d
+ import numpy as np
+ from calvingvonmises import *
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -29,7 +29,7 @@
+ 
+ #Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+-md.cluster = generic('name', oshostname(), 'np', 2)
++md.cluster = generic('name', gethostname(), 'np', 2)
+ md = solve(md, 'Transient')
+ 
+ #Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test542.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test542.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test542.py	(revision 26638)
+@@ -3,7 +3,7 @@
+ 
+ from calvingvonmises import *
+ from frontalforcingsrignot import *
+-from MatlabFuncs import *
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -46,7 +46,7 @@
+ md.levelset.migration_max = 1e10
+ 
+ md.transient.requested_outputs = ['default', 'CalvingMeltingrate']
+-md.cluster = generic('name', oshostname(), 'np', 2)
++md.cluster = generic('name', gethostname(), 'np', 2)
+ md = solve(md, 'Transient')
+ 
+ # Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26638)
+@@ -3,7 +3,7 @@
+ 
+ from calvingvonmises import *
+ from frontalforcingsrignotautoregression import *
+-from MatlabFuncs import *
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -58,7 +58,7 @@
+ md.levelset.migration_max = 1e10
+ 
+ md.transient.requested_outputs = ['default', 'CalvingMeltingrate']
+-md.cluster = generic('name', oshostname(), 'np', 2)
++md.cluster = generic('name', gethostname(), 'np', 2)
+ md = solve(md, 'Transient')
+ 
+ # Fields and tolerances to track changes
+Index: ../trunk-jpl/test/NightlyRun/test804.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test804.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test804.py	(revision 26638)
+@@ -1,6 +1,6 @@
+ #Test Name: ValleyGlacierLevelsetCalvingSIA2d
+ import numpy as np
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -13,7 +13,7 @@
+ md = setmask(md, '', '')
+ md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+ md = setflowequation(md, 'SIA', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ #Transient
+ md.transient.isstressbalance = True
+Index: ../trunk-jpl/test/NightlyRun/test805.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test805.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test805.py	(revision 26638)
+@@ -1,6 +1,6 @@
+ #Test Name: ValleyGlacierLevelsetEnthCalvingHO3d
+ import numpy as np
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -14,7 +14,7 @@
+ md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+ md.extrude(3, 2.)
+ md = setflowequation(md, 'HO', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ #Thermal model
+ pos_surf = np.nonzero(md.mesh.vertexonsurface)[0]
+Index: ../trunk-jpl/test/NightlyRun/test806.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test806.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test806.py	(revision 26638)
+@@ -1,6 +1,6 @@
+ #Test Name: SquareShelfLevelsetCalvingSSA2dLevermann
+ import numpy as np
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -12,7 +12,7 @@
+ md = setmask(md, 'all', '')
+ md = parameterize(md, '../Par/SquareShelf.py')
+ md = setflowequation(md, 'SSA', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ x = md.mesh.x
+ xmin = min(x)
+Index: ../trunk-jpl/test/NightlyRun/test808.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test808.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test808.py	(revision 26638)
+@@ -1,7 +1,7 @@
+ #Test Name: SquareShelfLevelsetCalvingSSA2dMinThickness
+ import numpy as np
+ from calvingminthickness import *
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -13,7 +13,7 @@
+ md = setmask(md, 'all', '')
+ md = parameterize(md, '../Par/SquareShelf.py')
+ md = setflowequation(md, 'SSA', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ #Do not kill ice bergs as all is floating
+ md.levelset.kill_icebergs = 0
+Index: ../trunk-jpl/test/NightlyRun/test809.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test809.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test809.py	(revision 26638)
+@@ -1,7 +1,7 @@
+ #Test Name: ValleyGlacierLevelsetCalvingSSA2dCrevassedepth
+ import numpy as np
+ from calvingcrevassedepth import *
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -15,7 +15,7 @@
+ md = setflowequation(md, 'SSA', 'all')
+ md.timestepping.time_step = 2
+ md.timestepping.final_time = 50
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ #Transient
+ md.transient.isstressbalance = 1
+Index: ../trunk-jpl/test/NightlyRun/test257.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test257.py	(revision 26638)
+@@ -1,16 +1,14 @@
+ #Test Name: SquareShelfSMBautoregression
+-from __future__ import division # TODO: Remove this import after ISSM is updated to use Python 3 by default
+-
++from __future__ import division  # TODO: Remove this import after ISSM is updated to use Python 3 by default
+ import numpy as np
+-
+-from MatlabFuncs import *
+ from model import *
+-from parameterize import *
+-from setflowequation import *
+-from setmask import *
+-from SMBautoregression import *
+-from solve import *
+-from triangle import *
++from socket import gethostname
++from parameterize import parameterize
++from setflowequation import setflowequation
++from setmask import setmask
++from SMBautoregression import SMBautoregression
++from solve import solve
++from triangle import triangle
+ 
+ 
+ md = triangle(model(), '../Exp/Square.exp', 80000)
+@@ -17,7 +15,7 @@
+ md = setmask(md, 'all', '')
+ md = parameterize(md, '../Par/SquareShelfConstrained.py')
+ md = setflowequation(md, 'SSA', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ md.transient.requested_outputs = ['default', 'IceVolume', 'SmbMassBalance']
+ 
+ ymax = max(md.mesh.y)
+@@ -55,8 +53,8 @@
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+ md.stochasticforcing.fields = ['SMBautoregression']
+-md.stochasticforcing.covariance = np.array([[0.15, 0.08, -0.02], [0.08, 0.12, -0.05], [-0.02, -0.05, 0.1]]) # global covariance among- and between-fields
+-md.stochasticforcing.randomflag = 0 # fixed random seeds
++md.stochasticforcing.covariance = np.array([[0.15, 0.08, -0.02], [0.08, 0.12, -0.05], [-0.02, -0.05, 0.1]])  # global covariance among- and between-fields
++md.stochasticforcing.randomflag = 0  # fixed random seeds
+ 
+ 
+ md = solve(md, 'Transient')
+Index: ../trunk-jpl/test/NightlyRun/test812.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test812.py	(revision 26637)
++++ ../trunk-jpl/test/NightlyRun/test812.py	(revision 26638)
+@@ -1,6 +1,6 @@
+ #Test Name: SquareShelfLevelsetCalvingMLHO2dLevermann
+ import numpy as np
+-from MatlabFuncs import oshostname
++from socket import gethostname
+ from model import *
+ from parameterize import *
+ from setflowequation import *
+@@ -12,7 +12,7 @@
+ md = setmask(md, 'all', '')
+ md = parameterize(md, '../Par/SquareShelf.py')
+ md = setflowequation(md, 'MLHO', 'all')
+-md.cluster = generic('name', oshostname(), 'np', 3)
++md.cluster = generic('name', gethostname(), 'np', 3)
+ 
+ x = md.mesh.x
+ xmin = min(x)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26638-26639.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26638-26639.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26638-26639.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/test/NightlyRun/test257.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test257.py	(revision 26638)
++++ ../trunk-jpl/test/NightlyRun/test257.py	(revision 26639)
+@@ -23,8 +23,8 @@
+ # Generate basin IDs for 3 basins
+ idbasin = np.zeros((md.mesh.numberofelements,))
+ iid1 = np.where(md.mesh.y >= 2. / 3. * ymax)[0]
+-iid2 = intersect(np.where(md.mesh.y < 2. / 3. * ymax)[0], np.where(md.mesh.x >= 1. / 3. * xmax)[0])
+-iid3 = intersect(np.where(md.mesh.y < 2. / 3. * ymax)[0], np.where(md.mesh.x < 1. / 3. * xmax)[0])
++iid2 = np.where(np.logical_and(md.mesh.y < 2. / 3. * ymax, md.mesh.x >= 1. / 3. * xmax))[0]
++iid3 = np.where(np.logical_and(md.mesh.y < 2. / 3. * ymax, md.mesh.x < 1. / 3. * xmax))[0]
+ for ii in range(md.mesh.numberofelements):
+     for vertex in range(3):
+         if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+Index: ../trunk-jpl/test/NightlyRun/test812.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test812.py	(revision 26638)
++++ ../trunk-jpl/test/NightlyRun/test812.py	(revision 26639)
+@@ -2,11 +2,12 @@
+ import numpy as np
+ from socket import gethostname
+ from model import *
+-from parameterize import *
+-from setflowequation import *
+-from setmask import *
+-from solve import *
+-from triangle import *
++from parameterize import parameterize
++from setflowequation import setflowequation
++from setmask import setmask
++from solve import solve
++from triangle import triangle
++from SetMLHOBC import SetMLHOBC
+ 
+ md = triangle(model(), '../Exp/Square.exp', 50000.)
+ md = setmask(md, 'all', '')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26639-26640.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26639-26640.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26639-26640.diff	(revision 26740)
@@ -0,0 +1,509 @@
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 26640)
+@@ -87,11 +87,17 @@
+ 	}
+ 
+ 	/*Get what we need for ocean-induced basal melting*/
++	bool isstochastic;
+ 	int basalforcing_model;
+ 	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
++	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
+ 	switch(basalforcing_model){
+ 		case FloatingMeltRateEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
++			if(isstochastic){
++            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
++            iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
++         }
+ 			break;
+ 		case LinearFloatingMeltRateEnum:
+ 			break;
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 26640)
+@@ -90,7 +90,7 @@
+       case DefaultCalvingEnum:
+          iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
+          if(isstochastic){
+-            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
++				iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
+             iomodel->FetchDataToInput(inputs,elements,"md.calving.calvingrate",BaselineCalvingCalvingrateEnum);
+          }
+          break;	
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 26640)
+@@ -160,11 +160,17 @@
+ 	InputUpdateFromConstantx(inputs,elements,0.,ThicknessResidualEnum);
+ 
+ 	/*Get what we need for ocean-induced basal melting*/
++	bool isstochastic;
+ 	int basalforcing_model;
+ 	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
++	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
+ 	switch(basalforcing_model){
+ 		case FloatingMeltRateEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
++			if(isstochastic){
++            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
++            iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
++         }
+ 			break;
+ 		case LinearFloatingMeltRateEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.perturbation_melting_rate",BasalforcingsPerturbationMeltingRateEnum,0.);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 26640)
+@@ -815,11 +815,17 @@
+ 		iomodel->FetchDataToInput(inputs,elements,"md.initialization.pressure",PressureEnum,0.);
+ 
+ 		/*Add basal forcings to compute melt rate*/
++		bool isstochastic;
+ 		int basalforcing_model;
+ 		iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
++		iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
+ 		switch(basalforcing_model){
+ 			case FloatingMeltRateEnum:
+ 				iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
++				if(isstochastic){
++					iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
++					iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
++				}
+ 				break;
+ 			case LinearFloatingMeltRateEnum:
+ 				break;
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 26640)
+@@ -118,11 +118,17 @@
+ 	#endif
+ 
+ 	/*Add basal forcings to compute melt rate*/
++	bool isstochastic;
+ 	int basalforcing_model;
+ 	iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model");
++	iomodel->FindConstant(&isstochastic,"md.stochasticforcing.isstochasticforcing");
+ 	switch(basalforcing_model){
+ 		case FloatingMeltRateEnum:
+ 			iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum);
++			if(isstochastic){
++            iomodel->FetchDataToInput(inputs,elements,"md.stochasticforcing.default_id",StochasticForcingDefaultIdEnum);
++            iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.floatingice_melting_rate",BaselineBasalforcingsFloatingiceMeltingRateEnum);
++         }
+ 			break;
+ 		case LinearFloatingMeltRateEnum:
+ 			break;
+Index: ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26640)
+@@ -9,6 +9,23 @@
+ 
+ void StochasticForcingx(FemModel* femmodel){/*{{{*/
+ 
++
++	//VV testing (12Nov)
++	/*
++	IssmDouble timeVV,dtVV,starttimeVV;
++	femmodel->parameters->FindParam(&timeVV,TimeEnum);
++   femmodel->parameters->FindParam(&dtVV,TimesteppingTimeStepEnum);
++   femmodel->parameters->FindParam(&starttimeVV,TimesteppingStartTimeEnum);
++	IssmDouble valMean = 0;
++	IssmDouble valSdev = 0.5;
++	int seed;
++	//seed = reCast<int,IssmDouble>((timeVV-starttimeVV)/dtVV);
++	seed = -1;
++	IssmDouble rdmVV;
++	univariateNormal_test0(&rdmVV,valMean,valSdev,seed);
++	_printf_("VV rdmVV: "<<rdmVV<<'\n');
++	*/
++
+    /*Retrieve parameters*/
+    bool randomflag;
+    int M,N,numfields,my_rank;
+@@ -102,6 +119,27 @@
+ 						delete gauss;
+ 					}
+ 					break;
++				case FloatingMeltRateEnum:
++					/*Delete BasalforcingsFloatingiceMeltingRateEnum at previous time step (required if it is transient)*/
++					femmodel->inputs->DeleteInput(BasalforcingsFloatingiceMeltingRateEnum);
++					for(Object* &object:femmodel->elements->objects){
++						Element* element = xDynamicCast<Element*>(object);
++						int numvertices  = element->GetNumberOfVertices();
++						IssmDouble baselinefloatingicemeltrate;
++						IssmDouble floatingicemeltrate_tot[numvertices];
++						Input* baselinefloatingicemeltrate_input  = NULL;
++						baselinefloatingicemeltrate_input = element->GetInput(BaselineBasalforcingsFloatingiceMeltingRateEnum); _assert_(baselinefloatingicemeltrate_input);
++						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
++						Gauss* gauss = element->NewGauss();
++						for(int i=0;i<numvertices;i++){
++							gauss->GaussVertex(i);
++							baselinefloatingicemeltrate_input->GetInputValue(&baselinefloatingicemeltrate,gauss);
++							floatingicemeltrate_tot[i] = max(0.0,baselinefloatingicemeltrate+noisefield[dimensionid]);
++						}
++						element->AddInput(BasalforcingsFloatingiceMeltingRateEnum,&floatingicemeltrate_tot[0],P1DGEnum);
++						delete gauss;
++					}
++					break;
+ 				default:
+ 					_error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.");
+ 			}
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26639)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26640)
+@@ -600,6 +600,7 @@
+ syn keyword cConstant BaseOldEnum
+ syn keyword cConstant BaseSlopeXEnum
+ syn keyword cConstant BaseSlopeYEnum
++syn keyword cConstant BaselineBasalforcingsFloatingiceMeltingRateEnum
+ syn keyword cConstant BaselineCalvingCalvingrateEnum
+ syn keyword cConstant BedEnum
+ syn keyword cConstant BedGRDEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26639)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26640)
+@@ -596,6 +596,7 @@
+ 	BaseOldEnum,
+ 	BaseSlopeXEnum,
+ 	BaseSlopeYEnum,
++	BaselineBasalforcingsFloatingiceMeltingRateEnum,
+ 	BaselineCalvingCalvingrateEnum,
+ 	BedEnum,
+ 	BedGRDEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26640)
+@@ -602,6 +602,7 @@
+ 		case BaseOldEnum : return "BaseOld";
+ 		case BaseSlopeXEnum : return "BaseSlopeX";
+ 		case BaseSlopeYEnum : return "BaseSlopeY";
++		case BaselineBasalforcingsFloatingiceMeltingRateEnum : return "BaselineBasalforcingsFloatingiceMeltingRate";
+ 		case BaselineCalvingCalvingrateEnum : return "BaselineCalvingCalvingrate";
+ 		case BedEnum : return "Bed";
+ 		case BedGRDEnum : return "BedGRD";
+Index: ../trunk-jpl/src/c/shared/Enum/Enumjl.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(revision 26639)
++++ ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(revision 26640)
+@@ -593,6 +593,7 @@
+ syn keyword juliaConstC BaseOldEnum
+ syn keyword juliaConstC BaseSlopeXEnum
+ syn keyword juliaConstC BaseSlopeYEnum
++syn keyword juliaConstC BaselineBasalforcingsFloatingiceMeltingRateEnum
+ syn keyword juliaConstC BaselineCalvingCalvingrateEnum
+ syn keyword juliaConstC BedEnum
+ syn keyword juliaConstC BedGRDEnum
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26639)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26640)
+@@ -614,6 +614,7 @@
+ 	      else if (strcmp(name,"BaseOld")==0) return BaseOldEnum;
+ 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
+ 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
++	      else if (strcmp(name,"BaselineBasalforcingsFloatingiceMeltingRate")==0) return BaselineBasalforcingsFloatingiceMeltingRateEnum;
+ 	      else if (strcmp(name,"BaselineCalvingCalvingrate")==0) return BaselineCalvingCalvingrateEnum;
+ 	      else if (strcmp(name,"Bed")==0) return BedEnum;
+ 	      else if (strcmp(name,"BedGRD")==0) return BedGRDEnum;
+@@ -627,11 +628,11 @@
+ 	      else if (strcmp(name,"BottomPressureOld")==0) return BottomPressureOldEnum;
+ 	      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 stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;
++	      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,"CalvingratexAverage")==0) return CalvingratexAverageEnum;
+@@ -750,11 +751,11 @@
+ 	      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 stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
++	      if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
++	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+ 	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
+ 	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
+ 	      else if (strcmp(name,"HydrologyTwsAnalysis")==0) return HydrologyTwsAnalysisEnum;
+@@ -873,11 +874,11 @@
+ 	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
+ 	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+ 	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+-	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
++	      if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
++	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+ 	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+ 	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+ 	      else if (strcmp(name,"SealevelchangeGsubelOcean")==0) return SealevelchangeGsubelOceanEnum;
+@@ -996,11 +997,11 @@
+ 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
+ 	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
+ 	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
+-	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
++	      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;
+@@ -1119,11 +1120,11 @@
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+-	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+          else stage=10;
+    }
+    if(stage==10){
+-	      if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
++	      if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
++	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+ 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+ 	      else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
+@@ -1242,11 +1243,11 @@
+ 	      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 stage=11;
+    }
+    if(stage==11){
+-	      if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
++	      if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
++	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
+ 	      else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
+ 	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+ 	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
+@@ -1365,11 +1366,11 @@
+ 	      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,"Inputs")==0) return InputsEnum;
+          else stage=12;
+    }
+    if(stage==12){
+-	      if (strcmp(name,"Internal")==0) return InternalEnum;
++	      if (strcmp(name,"Inputs")==0) return InputsEnum;
++	      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;
+@@ -1488,11 +1489,11 @@
+ 	      else if (strcmp(name,"SMBautoregression")==0) return SMBautoregressionEnum;
+ 	      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 stage=13;
+    }
+    if(stage==13){
+-	      if (strcmp(name,"SMBgcm")==0) return SMBgcmEnum;
++	      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;
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26639)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26640)
+@@ -44,18 +44,33 @@
+ 
+ 			%Check that all fields agree with the corresponding md class and if any field needs the default params   
+          checkdefaults = false; %need to check defaults only if one of the field does not have its own dimensionality
++			structstoch   = structstochforcing();
+ 			for field=self.fields
+             %Checking agreement of classes
+             if(contains(field,'SMB'))
+-               if~(isequal(class(md.smb),char(field)))
++					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
++					if~(isequal(class(md.smb),char(mdname)))
+                   error('md.smb does not agree with stochasticforcing field %s', char(field));
+                end
+             end
+-            if(contains(field,'frontalforcings'))
+-               if~(isequal(class(md.frontalforcings),char(field)))
++            if(contains(field,'FrontalForcings'))
++					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
++               if~(isequal(class(md.frontalforcings),char(mdname)))
+                   error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
+                end
+             end
++				if(contains(field,'Calving'))
++					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
++               if~(isequal(class(md.calving),char(mdname)))
++                  error('md.calving does not agree with stochasticforcing field %s', char(field));
++               end
++            end
++				if(contains(field,'BasalforcingsFloatingice'))
++					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
++               if~(isequal(class(md.basalforcings),char(mdname)))
++                  error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
++               end
++            end
+             %Checking for specific dimensions
+             if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
+                checkdefaults = true; %field with non-specific dimensionality
+@@ -128,7 +143,7 @@
+ 				end
+ 
+ 				%Scaling covariance matrix (scale column-by-column and row-by-row)
+-				scaledfields = {'DefaultCalving','SMBautoregression'}; %list of fields that need scaling *1/yts
++				scaledfields = {'DefaultCalving','FloatingMeltRate','SMBautoregression'}; %list of fields that need scaling *1/yts
+ 				tempcovariance = self.covariance; %copy of covariance to avoid writing back in member variable
+ 				for i=1:num_fields
+ 					if any(strcmp(scaledfields,self.fields(i)))
+@@ -160,9 +175,26 @@
+    % Defines list of fields supported
+    % by the class md.stochasticforcing
+ 
+-   list = {...
++   list = structstochforcing(); 
++	list = list.fields;
++end % }}}
++function structure = structstochforcing() % {{{
++	% Defines structure with list of fields
++	% supported and corresponding md names
++	structure.fields = {...
+       'DefaultCalving',...
+-		'FrontalForcingsRignotAutoregression',...
++      'FloatingMeltRate',...
++      'FrontalForcingsRignotAutoregression',...
+       'SMBautoregression'
+       };
++	structure.mdnames = {...
++		'calving',...
++		'basalforcings',...
++		'frontalforcingsrignotautoregression',...
++		'SMBautoregression'
++	};
+ end % }}}
++
++
++
++
+Index: ../trunk-jpl/src/m/miscellaneous/supportedstochforcings.m
+===================================================================
+--- ../trunk-jpl/src/m/miscellaneous/supportedstochforcings.m	(revision 26639)
++++ ../trunk-jpl/src/m/miscellaneous/supportedstochforcings.m	(nonexistent)
+@@ -1,8 +0,0 @@
+-function list = supportedstochforcings(),
+-	% Defines list of fields supported
+-	% by the class md.stochasticforcings
+-
+-	list = {...
+-		'SMBautoregression',...
+-		'FrontalForcingsRignotAutoregression'
+-		};
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26639)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26640)
+@@ -59,14 +59,24 @@
+ 
+         # Check that all fields agree with the corresponding md class
+         checkdefaults = False
++        structstoch   = stochasticforcing.structstochforcing()
+         for field in self.fields:
+             if 'SMB' in field:
+-                if type(md.smb).__name__ != field:
++                mdname = structstoch['mdnames'][structstoch['fields']==field]
++                if type(md.smb).__name__ != mdname:
+                     raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
+-            if 'frontalforcings' in field:
+-                if type(md.frontalforcings).__name__ != field:
++            if 'FrontalForcings' in field:
++                mdname = structstoch['mdnames'][structstoch['fields']==field]
++                if type(md.frontalforcings).__name__ != mdname:
+                     raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
+-            #Checking for specific dimensions
++            if 'Calving' in field:
++                mdname = structstoch['mdnames'][structstoch['fields']==field]
++                if type(md.calving).__name__ != mdname:
++                    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
++            if 'BasalforcingsFloatingice' in field:
++                mdname = structstoch['mdnames'][structstoch['fields']==field]
++                if type(md.basalforcings).__name__ != mdname:
++                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))#Checking for specific dimensions
+             if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
+                 checkdefaults = True   #field with non-specific dimensionality
+ 
+@@ -79,7 +89,7 @@
+             indSMBar = self.fields.index('SMBautoregression')
+         if ('FrontalForcingsRignotAutoregression' in self.fields):
+             size_tot = size_tot - self.defaultdimension + md.frontalforcings.num_basins
+-            indSMBar = self.fields.index('FrontalForcingsRignotAutoregression')
++            indTFar  = self.fields.index('FrontalForcingsRignotAutoregression')
+         if (indSMBar != -1 and indTFar != -1):
+             covsum = self.covariance[np.sum(self.defaultdimensions[0:indSMBar]).astype(int):np.sum(self.defaultdimensions[0:indSMBar + 1]).astype(int), np.sum(self.defaultdimensions[0:indTFar]).astype(int):np.sum(self.defaultdimensions[0:indTFar + 1]).astype(int)]
+             if((md.smb.ar_timestep != md.frontalforcings.ar_timestep) and np.any(covsum != 0)):
+@@ -86,7 +96,7 @@
+                 raise IOError('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance')
+ 
+         md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', supportedstochforcings())
++        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', stochasticforcing.supportedstochforcings())
+         #md = checkfield(md, 'fieldname', 'stochasticforcing.dimensions', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [num_fields]) # specific dimension for each field; NOTE: As opposed to MATLAB implementation, pass list
+         md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot])  # global covariance matrix
+         md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
+@@ -140,12 +150,28 @@
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
+     # }}}
+ 
++    def supportedstochforcings(): # {{{
++        """Defines list of fields supported by the class md.stochasticforcing
++        """
++        list1 = stochasticforcing.structstochforcing()
++        list1 = list1['fields']
++        return(list1) #}}}
+ 
+-def supportedstochforcings():
+-    """ Defines list of fields supported  by the class stochasticforcings
+-    """
+-    return [
+-        'DefaultCalving',
+-        'FrontalForcingsRignotAutoregression',
+-        'SMBautoregression'
+-    ]
++    def structstochforcing(): # {{{
++        """Defines dictionary with list of fields
++           supported and corresponding md names
++        """
++        structure = dict({
++                    'fields':
++                        ['DefaultCalving',
++                        'FloatingMeltRate',
++                        'FrontalForcingsRignotAutoregression',
++                        'SMBautoregression'],
++
++                    'mdnames':
++                        ['calving',
++                        'basalforcings',
++                        'frontalforcingsrignotautoregression',
++                        'SMBautoregression']})
++    return(structure) # }}}
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26640-26641.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26640-26641.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26640-26641.diff	(revision 26740)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26640)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26641)
+@@ -173,5 +173,5 @@
+                         'basalforcings',
+                         'frontalforcingsrignotautoregression',
+                         'SMBautoregression']})
+-    return(structure) # }}}
++        return(structure) # }}}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26641-26642.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26641-26642.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26641-26642.diff	(revision 26740)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26641)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26642)
+@@ -59,7 +59,7 @@
+ 
+         # Check that all fields agree with the corresponding md class
+         checkdefaults = False
+-        structstoch   = stochasticforcing.structstochforcing()
++        structstoch   = self.structstochforcing()
+         for field in self.fields:
+             if 'SMB' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+@@ -96,7 +96,7 @@
+                 raise IOError('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance')
+ 
+         md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
+-        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', stochasticforcing.supportedstochforcings())
++        md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', self.supportedstochforcings())
+         #md = checkfield(md, 'fieldname', 'stochasticforcing.dimensions', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [num_fields]) # specific dimension for each field; NOTE: As opposed to MATLAB implementation, pass list
+         md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot])  # global covariance matrix
+         md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
+@@ -150,14 +150,14 @@
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
+     # }}}
+ 
+-    def supportedstochforcings(): # {{{
++    def supportedstochforcings(self): # {{{
+         """Defines list of fields supported by the class md.stochasticforcing
+         """
+-        list1 = stochasticforcing.structstochforcing()
++        list1 = self.structstochforcing()
+         list1 = list1['fields']
+         return(list1) #}}}
+ 
+-    def structstochforcing(): # {{{
++    def structstochforcing(self): # {{{
+         """Defines dictionary with list of fields
+            supported and corresponding md names
+         """
Index: /issm/oecreview/Archive/25834-26739/ISSM-26642-26643.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26642-26643.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26642-26643.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26642)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26643)
+@@ -63,19 +63,19 @@
+         for field in self.fields:
+             if 'SMB' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if type(md.smb).__name__ != mdname:
++                if (type(md.smb) != mdname):
+                     raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
+             if 'FrontalForcings' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if type(md.frontalforcings).__name__ != mdname:
++                if (type(md.frontalforcings) != mdname):
+                     raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
+             if 'Calving' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if type(md.calving).__name__ != mdname:
++                if (type(md.calving) != mdname):
+                     raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
+             if 'BasalforcingsFloatingice' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if type(md.basalforcings).__name__ != mdname:
++                if (type(md.basalforcings) != mdname):
+                     raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))#Checking for specific dimensions
+             if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
+                 checkdefaults = True   #field with non-specific dimensionality
Index: /issm/oecreview/Archive/25834-26739/ISSM-26643-26644.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26643-26644.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26643-26644.diff	(revision 26740)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26643)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26644)
+@@ -61,22 +61,23 @@
+         checkdefaults = False
+         structstoch   = self.structstochforcing()
+         for field in self.fields:
++            ### Checks are temporarily commented out: need to debug why this does not work (18Nov2021) ###
+             if 'SMB' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if (type(md.smb) != mdname):
+-                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
++                #if (type(md.smb) != mdname):
++                #    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
+             if 'FrontalForcings' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if (type(md.frontalforcings) != mdname):
+-                    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
++                #if (type(md.frontalforcings) != mdname):
++                #    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
+             if 'Calving' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if (type(md.calving) != mdname):
+-                    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
++                #if (type(md.calving) != mdname):
++                #    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
+             if 'BasalforcingsFloatingice' in field:
+                 mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                if (type(md.basalforcings) != mdname):
+-                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))#Checking for specific dimensions
++                #if (type(md.basalforcings) != mdname):
++                #    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))#Checking for specific dimensions
+             if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
+                 checkdefaults = True   #field with non-specific dimensionality
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26644-26645.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26644-26645.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26644-26645.diff	(revision 26740)
@@ -0,0 +1,94 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26644)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26645)
+@@ -59,25 +59,26 @@
+ 
+         # Check that all fields agree with the corresponding md class
+         checkdefaults = False
+-        structstoch   = self.structstochforcing()
++        structstoch = self.structstochforcing()
++        print(type(structstoch))
+         for field in self.fields:
+-            ### Checks are temporarily commented out: need to debug why this does not work (18Nov2021) ###
++            # Checks are temporarily commented out: need to debug why this does not work (18Nov2021) #
+             if 'SMB' in field:
+-                mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                #if (type(md.smb) != mdname):
+-                #    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
++                mdname = structstoch[field]
++                if (type(md.smb).__name__ != mdname):
++                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(mdname))
+             if 'FrontalForcings' in field:
+-                mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                #if (type(md.frontalforcings) != mdname):
+-                #    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
++                mdname = structstoch[field]
++                if (type(md.frontalforcings).__name__ != mdname):
++                    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(mdname))
+             if 'Calving' in field:
+-                mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                #if (type(md.calving) != mdname):
+-                #    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
++                mdname = structstoch[field]
++                if (type(md.calving).__name__ != mdname):
++                    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(mdname))
+             if 'BasalforcingsFloatingice' in field:
+-                mdname = structstoch['mdnames'][structstoch['fields']==field]
+-                #if (type(md.basalforcings) != mdname):
+-                #    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))#Checking for specific dimensions
++                mdname = structstoch[field]
++                if (type(md.basalforcings).__name__ != mdname):
++                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(mdname))  #Checking for specific dimensions
+             if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
+                 checkdefaults = True   #field with non-specific dimensionality
+ 
+@@ -90,7 +91,7 @@
+             indSMBar = self.fields.index('SMBautoregression')
+         if ('FrontalForcingsRignotAutoregression' in self.fields):
+             size_tot = size_tot - self.defaultdimension + md.frontalforcings.num_basins
+-            indTFar  = self.fields.index('FrontalForcingsRignotAutoregression')
++            indTFar = self.fields.index('FrontalForcingsRignotAutoregression')
+         if (indSMBar != -1 and indTFar != -1):
+             covsum = self.covariance[np.sum(self.defaultdimensions[0:indSMBar]).astype(int):np.sum(self.defaultdimensions[0:indSMBar + 1]).astype(int), np.sum(self.defaultdimensions[0:indTFar]).astype(int):np.sum(self.defaultdimensions[0:indTFar + 1]).astype(int)]
+             if((md.smb.ar_timestep != md.frontalforcings.ar_timestep) and np.any(covsum != 0)):
+@@ -151,28 +152,21 @@
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
+     # }}}
+ 
+-    def supportedstochforcings(self): # {{{
++    def supportedstochforcings(self):  # {{{
+         """Defines list of fields supported by the class md.stochasticforcing
+         """
+         list1 = self.structstochforcing()
+-        list1 = list1['fields']
+-        return(list1) #}}}
++        list1 = list1.keys()
++        return list(list1)
++    #}}}
+ 
+-    def structstochforcing(self): # {{{
++    def structstochforcing(self):  # {{{
+         """Defines dictionary with list of fields
+            supported and corresponding md names
+         """
+-        structure = dict({
+-                    'fields':
+-                        ['DefaultCalving',
+-                        'FloatingMeltRate',
+-                        'FrontalForcingsRignotAutoregression',
+-                        'SMBautoregression'],
+-
+-                    'mdnames':
+-                        ['calving',
+-                        'basalforcings',
+-                        'frontalforcingsrignotautoregression',
+-                        'SMBautoregression']})
+-        return(structure) # }}}
+-
++        structure = {'DefaultCalving': 'calving',
++                     'FloatingMeltRate': 'basalforcings',
++                     'FrontalForcingsRignotAutoregression': 'frontalforcingsrignotautoregression',
++                     'SMBautoregression': 'SMBautoregression'}
++        return structure
++    # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26645-26646.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26645-26646.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26645-26646.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26645)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26646)
+@@ -60,7 +60,6 @@
+         # Check that all fields agree with the corresponding md class
+         checkdefaults = False
+         structstoch = self.structstochforcing()
+-        print(type(structstoch))
+         for field in self.fields:
+             # Checks are temporarily commented out: need to debug why this does not work (18Nov2021) #
+             if 'SMB' in field:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26646-26647.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26646-26647.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26646-26647.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26646)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26647)
+@@ -145,7 +145,7 @@
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+             WriteData(fid, prefix, 'data', dimensions, 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
+-            WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'format', 'IntMat')  #12Nov2021 make sure this is zero-indexed!
++            WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'format', 'IntMat', 'mattype', 2)  #12Nov2021 make sure this is zero-indexed!
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'defaultdimension', 'format', 'Integer')
+             WriteData(fid, prefix, 'data', tempcovariance, 'name', 'md.stochasticforcing.covariance', 'format', 'DoubleMat')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'randomflag', 'format', 'Boolean')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26647-26648.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26647-26648.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26647-26648.diff	(revision 26740)
@@ -0,0 +1,130 @@
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26647)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26648)
+@@ -44,8 +44,6 @@
+ 
+ 	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
+ 	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
+-	tempvertices = Vector{Vertex}(undef,3)
+-	tempnodes    = Vector{Node}(undef,3)
+ 
+ 	count = 0
+ 	for i in 1:md.mesh.numberofelements
+@@ -55,7 +53,7 @@
+ 		nodeids   = md.mesh.elements[i,:]
+ 
+ 		#Call constructor and add to dataset elements
+-		push!(elements,Tria(i,count,vertexids,tempvertices,nodeids,tempnodes,tempparams,tempinputs))
++		push!(elements,Tria(i,count,vertexids,Vector{Vertex}(undef,3),nodeids,Vector{Node}(undef,3),tempparams,tempinputs))
+ 	end
+ 
+ end# }}}
+@@ -124,9 +122,6 @@
+ 	#Get size of vector
+ 	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
+ 
+-	println(gsize)
+-	error("Stop ===")
+-
+ 	#Initialize solution vector
+ 	ug = Vector{Float64}(undef,gsize)
+ 
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26647)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26648)
+@@ -85,7 +85,35 @@
+ 	return dofcount
+ 
+ end# }}}
++function GetDofList(node::Node,doflist::Vector{Int64},count::Int64,setenum::IssmEnum) #{{{
+ 
++	if setenum==GsetEnum
++		for i in 1:node.gsize
++			count += 1
++			doflist[count] = node.gdoflist[i]
++		end
++	elseif setenum==FsetEnum
++		for i=1:node.gsize
++			if  node.fdoflist[i]!=-1
++				count += 1
++				doflist[count] = node.fdoflist[i]
++			end
++		end
++	elseif setenum==SsetEnum
++		for i=1:node.gsize
++			if  node.sdoflist[i]!=-1
++				count += 1
++				doflist[count] = node.sdoflist[i]
++			end
++		end
++	else
++		error("not supported")
++	end
++
++	return count
++
++end# }}}
++
+ #Nodes functions
+ function RequiresDofReindexing(nodes::Vector{Node}) #{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/analyses.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26647)
++++ ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26648)
+@@ -53,7 +53,11 @@
+ 
+ end#}}}
+ function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+-	error("STOP")
++
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++	error("S")
++
+ end#}}}
+ 
+ function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26647)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26648)
+@@ -38,7 +38,7 @@
+ 
+    #Configure vertices
+    for i in 1:3
+-      element.vertices[i] = vertices[element.vertexids[i]]
++		element.vertices[i] = vertices[element.vertexids[i]]
+    end
+ 
+ 	#Configure nodes (assuming P1 finite elements)
+@@ -51,3 +51,27 @@
+ 	element.inputs     = inputs
+ 	
+ end # }}}
++function GetDofList(element::Tria,setenum::IssmEnum) # {{{
++
++	#Define number of nodes
++	numnodes = 3
++
++	#Determine size of doflist
++	numdofs = 0
++	for i in 1:numnodes
++		numdofs += GetNumberOfDofs(element.nodes[i],GsetEnum)
++	end
++
++	#Allocate doflist vector
++	doflist = Vector{Int64}(undef,numdofs)
++
++	#enter dofs in doflist vector
++	count = 0
++	for i in 1:numnodes
++		count = GetDofList(element.nodes[i],doflist,count,GsetEnum)
++	end
++
++	println(doflist)
++	error("S")
++
++end # }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26648-26649.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26648-26649.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26648-26649.diff	(revision 26740)
@@ -0,0 +1,215 @@
+Index: ../trunk-jpl/src/jl/solve/analyses.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26648)
++++ ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26649)
+@@ -56,8 +56,28 @@
+ 
+ 	#Get dofs for this finite element
+ 	doflist = GetDofList(element,GsetEnum)
+-	error("S")
++	@assert length(doflist)==6
+ 
++	#Fetch inputs
++	vx_input = GetInput(element, VxEnum)
++	vy_input = GetInput(element, VyEnum)
++
++	#Loop over each node and enter solution in ug
++	count = 0
++	gauss=GaussTria(P1Enum)
++	for i in 1:gauss.numgauss
++		vx = GetInputValue(vx_input, gauss, i)
++		vy = GetInputValue(vy_input, gauss, i)
++
++		count += 1
++		ug[doflist[count]] = vx
++		count += 1
++		ug[doflist[count]] = vy
++	end
++
++	#Make sure we reached all the values
++	@assert count==length(doflist)
++
+ end#}}}
+ 
+ function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+@@ -83,6 +103,8 @@
+ 	#Get existing solution
+ 	ug = GetSolutionFromInputsx(analysis,femmodel)
+ 
++	print(ug)
++
+ 	#Loop until we reach convergence
+ 	while(~converged)
+ 
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26648)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26649)
+@@ -71,7 +71,25 @@
+ 		count = GetDofList(element.nodes[i],doflist,count,GsetEnum)
+ 	end
+ 
+-	println(doflist)
+-	error("S")
++	return doflist
++end # }}}
++function GetInput(element::Tria,enum::IssmEnum) # {{{
+ 
++	input = GetInput(element.inputs,enum)
++	InputServe!(element,input)
++	return input
++
+ end # }}}
++function InputServe!(element::Tria,input::ElementInput) # {{{
++
++	if input.interp==P0Enum
++		input.element_values[1] = input.values[element.sid]
++	elseif input.interp==P1Enum
++		for i in 1:3
++			input.element_values[i] = input.values[element.vertices[i].sid]
++		end
++	else
++		error("interpolation ",input.interp," not supported yet")
++	end
++
++end # }}}
+Index: ../trunk-jpl/src/jl/solve/gauss.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26648)
++++ ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26649)
+@@ -22,16 +22,16 @@
+ 		coords2 = [0.333333333333333]
+ 		coords3 = [0.333333333333333]
+ 	elseif(order==2)
+-		weights = [0.577350269189625, 0.577350269189625, 0.577350269189625]
+-		coords1 = [0.666666666666667, 0.166666666666667, 0.166666666666667]
+-		coords2 = [0.166666666666667, 0.666666666666667, 0.166666666666667]
+-		coords3 = [0.166666666666667, 0.166666666666667, 0.666666666666667]
++		weights = [0.577350269189625; 0.577350269189625; 0.577350269189625]
++		coords1 = [0.666666666666667; 0.166666666666667; 0.166666666666667]
++		coords2 = [0.166666666666667; 0.666666666666667; 0.166666666666667]
++		coords3 = [0.166666666666667; 0.166666666666667; 0.666666666666667]
+ 	elseif(order==3)
+ 		npoints=4
+-		weights = [-0.974278579257493, 0.902109795608790, 0.902109795608790, 0.902109795608790]
+-		coords1 = [0.333333333333333, 0.600000000000000, 0.200000000000000, 0.200000000000000]
+-		coords2 = [0.333333333333333, 0.200000000000000, 0.600000000000000, 0.200000000000000]
+-		coords3 = [0.333333333333333, 0.200000000000000, 0.200000000000000, 0.600000000000000]
++		weights = [-0.974278579257493; 0.902109795608790; 0.902109795608790; 0.902109795608790]
++		coords1 = [ 0.333333333333333; 0.600000000000000; 0.200000000000000; 0.200000000000000]
++		coords2 = [ 0.333333333333333; 0.200000000000000; 0.600000000000000; 0.200000000000000]
++		coords3 = [ 0.333333333333333; 0.200000000000000; 0.200000000000000; 0.600000000000000]
+ 	else
+ 		error("order ",order," not supported yet");
+ 	end
+@@ -38,4 +38,23 @@
+ 
+ 	return GaussTria(npoints,weights,coords1,coords2,coords3)
+ end# }}}
++function GaussTria(finiteelement::IssmEnum) #{{{
+ 
++	if(finiteelement==P0Enum)
++		npoints = 1
++		weights = [1.]
++		coords1 = [0.333333333333333]
++		coords2 = [0.333333333333333]
++		coords3 = [0.333333333333333]
++	elseif(finiteelement==P1Enum)
++			npoints = 3
++			weights = 0.333333333333333*ones(3)
++			coords1 = [1.; 0.; 0.]
++			coords2 = [0.; 1.; 0.]
++			coords3 = [0.; 0.; 1.]
++	else
++		error("finite element ", finiteelement," not supported yet");
++	end
++
++	return GaussTria(npoints,weights,coords1,coords2,coords3)
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26648)
++++ ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26649)
+@@ -12,6 +12,7 @@
+ 	enum::IssmEnum
+ 	interp::IssmEnum
+ 	values::Vector{Float64}
++	element_values::Vector{Float64}
+ end# }}}
+ 
+ #Inputs dataset definition
+@@ -22,6 +23,17 @@
+ end# }}}
+ 
+ #Inputs functions
++function GetInput(inputs::Inputs,enum::IssmEnum) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		error("Input ",enum," not found")
++	end
++
++	#return input
++	return inputs.lookup[enum]
++
++end#}}}
+ function SetInput(inputs::Inputs,enum::IssmEnum,index::Int64,value::Bool) #{{{
+ 
+ 	#Does this input exist
+@@ -47,9 +59,9 @@
+ 		#it does not exist yet, we need to create it...
+ 		@assert inputs.numberofelements > 0
+ 		if interp==P0Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements))
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements),Vector{Float64}(undef,1))
+ 		elseif interp==P1Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
+ 		else
+ 			error("not supported yet")
+ 		end
+@@ -70,7 +82,7 @@
+ 		#it does not exist yet, we need to create it...
+ 		@assert inputs.numberofvertices>0
+ 		if interp==P1Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices))
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
+ 		else
+ 			error("not supported yet")
+ 		end
+@@ -84,3 +96,16 @@
+ 	#set value
+ 	input.values[indices] = values
+ end#}}}
++function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64)
++
++	if input.interp==P0Enum
++		return input.element_value
++	elseif input.interp==P1Enum
++		value = input.element_values[1]*gauss.coords1[i] +  input.element_values[2]*gauss.coords2[i] +  input.element_values[3]*gauss.coords3[i]
++	else
++		error("not implemented yet")
++	end
++
++	return value
++
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26648)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26649)
+@@ -1,5 +1,6 @@
+ include("../md/classes.jl")
+ include("./issmenums.jl")
++include("./gauss.jl")
+ include("./parameters.jl")
+ include("./inputs.jl")
+ include("./vertices.jl")
+@@ -8,7 +9,6 @@
+ include("./constraints.jl")
+ include("./femmodel.jl")
+ include("./analyses.jl")
+-include("./gauss.jl")
+ include("./modules.jl")
+ 
+ function IssmCore(md::model) #{{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26649-26650.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26649-26650.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26649-26650.diff	(revision 26740)
@@ -0,0 +1,139 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26649)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26650)
+@@ -154,6 +154,27 @@
+    parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.relaxation",HydrologyRelaxationEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.storage",HydrologyStorageEnum));
+ 
++	/*Deal with friction parameters*/
++	int frictionlaw;
++	iomodel->FindConstant(&frictionlaw,"md.friction.law");
++	if(frictionlaw==6){
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
++	}
++	if(frictionlaw==4){
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
++	}
++	if(frictionlaw==1 || frictionlaw==3 || frictionlaw==7){
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
++	}
++	if(frictionlaw==9){
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
++		parameters->AddObject(iomodel->CopyConstantObject("md.friction.effective_pressure_limit",FrictionEffectivePressureLimitEnum));
++		parameters->AddObject(new IntParam(FrictionCouplingEnum,0));
++	}
++
+   /*Requested outputs*/
+   iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.hydrology.requested_outputs");
+   parameters->AddObject(new IntParam(HydrologyNumRequestedOutputsEnum,numoutputs));
+@@ -464,7 +485,6 @@
+ 	IssmDouble* values = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Get thickness and base on nodes to apply cap on water head*/
+-   IssmDouble* eff_pressure = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* thickness = xNew<IssmDouble>(numnodes);
+ 	IssmDouble* bed       = xNew<IssmDouble>(numnodes);
+ 	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+@@ -495,9 +515,6 @@
+ 		/*Under-relaxation*/
+ 	   values[i] = head_old[i] - relaxation*(head_old[i]-values[i]);
+ 
+-		/*Calculate effective pressure*/
+-		eff_pressure[i] = rho_ice*g*thickness[i] - rho_water*g*(values[i]-bed[i]);
+-
+ 		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
+ 		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
+ 	}
+@@ -504,7 +521,6 @@
+ 
+ 	/*Add input to the element: */
+ 	element->AddInput(HydrologyHeadEnum,values,element->GetElementType());
+-   element->AddInput(EffectivePressureEnum,eff_pressure,P1Enum);
+ 
+ 	/*Update reynolds number according to new solution*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+@@ -519,6 +535,9 @@
+ 	IssmDouble reynolds = conductivity*sqrt(dh[0]*dh[0]+dh[1]*dh[1])/NU;
+ 	element->AddInput(HydrologyReynoldsEnum,&reynolds,P0Enum);
+ 
++   /*Compute new effective pressure*/
++   this->UpdateEffectivePressure(element);
++
+ 	/*Free resources:*/
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(thickness);
+@@ -525,7 +544,6 @@
+ 	xDelete<IssmDouble>(bed);
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<int>(doflist);
+-	xDelete<IssmDouble>(eff_pressure);
+    xDelete<IssmDouble>(head_old);
+ }/*}}}*/
+ void           HydrologyShaktiAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+@@ -723,3 +741,50 @@
+ 	delete friction;
+ 	delete gauss;
+ }/*}}}*/
++void HydrologyShaktiAnalysis::UpdateEffectivePressure(FemModel* femmodel){/*{{{*/
++
++	for(Object* & object : femmodel->elements->objects){
++		Element* element=xDynamicCast<Element*>(object);
++		UpdateEffectivePressure(element);
++	}
++
++}/*}}}*/
++void HydrologyShaktiAnalysis::UpdateEffectivePressure(Element* element){/*{{{*/
++
++	/*Skip if water or ice shelf element*/
++	if(element->IsAllFloating()) return;
++
++	/*Intermediaries*/
++	IssmDouble bed,thickness,head;
++
++	/* Fetch number of nodes and allocate output*/
++   int numnodes = element->GetNumberOfNodes();
++   IssmDouble* N = xNew<IssmDouble>(numnodes);
++
++	/*Retrieve all inputs and parameters*/
++	IssmDouble  g          = element->FindParam(ConstantsGEnum);
++	IssmDouble  rho_ice    = element->FindParam(MaterialsRhoIceEnum);
++	IssmDouble  rho_water  = element->FindParam(MaterialsRhoFreshwaterEnum);
++	Input* head_input      = element->GetInput(HydrologyHeadEnum); _assert_(head_input);
++	Input* thickness_input = element->GetInput(ThicknessEnum);     _assert_(thickness_input);
++	Input* base_input      = element->GetInput(BaseEnum);          _assert_(base_input);
++
++
++   Gauss* gauss=element->NewGauss();
++   for (int i=0;i<numnodes;i++){
++      gauss->GaussNode(element->GetElementType(),i);
++
++		base_input->GetInputValue(&bed,gauss);
++		thickness_input->GetInputValue(&thickness,gauss);
++		head_input->GetInputValue(&head,gauss);
++
++		N[i] = rho_ice*g*thickness - rho_water*g*(head-bed);
++	}
++
++	/*Add new gap as an input*/
++	element->AddInput(EffectivePressureEnum,N,element->GetElementType());
++
++	/*Clean up and return*/
++   xDelete<IssmDouble>(N);
++	delete gauss;
++}/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 26649)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 26650)
+@@ -35,5 +35,7 @@
+ 		IssmDouble GetConductivity(Element* element);
+ 		void UpdateGapHeight(FemModel* femmodel);
+ 		void UpdateGapHeight(Element* element);
++		void UpdateEffectivePressure(FemModel* femmodel);
++		void UpdateEffectivePressure(Element* element);
+ };
+ #endif
Index: /issm/oecreview/Archive/25834-26739/ISSM-26650-26651.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26650-26651.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26650-26651.diff	(revision 26740)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/c/cores/hydrology_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26650)
++++ ../trunk-jpl/src/c/cores/hydrology_core.cpp	(revision 26651)
+@@ -182,6 +182,11 @@
+ 		femmodel->parameters->SetParam(HydrologyGapHeightYYEnum,InputToL2ProjectEnum);
+ 		solutionsequence_linear(femmodel);
+ 
++		/*Update Effective pressure*/
++		if(VerboseSolution()) _printf0_("   computing effective pressure\n");
++		HydrologyShaktiAnalysis* analysis = new HydrologyShaktiAnalysis();
++		analysis->UpdateEffectivePressure(femmodel);
++
+ 		/*Get new head*/
+ 		femmodel->SetCurrentConfiguration(HydrologyShaktiAnalysisEnum);
+ 		InputDuplicatex(femmodel,HydrologyHeadEnum,HydrologyHeadOldEnum);
+@@ -189,7 +194,6 @@
+ 
+ 		/*Update Gap Height*/
+ 		if(VerboseSolution()) _printf0_("   updating gap height\n");
+-		HydrologyShaktiAnalysis* analysis = new HydrologyShaktiAnalysis();
+ 		analysis->UpdateGapHeight(femmodel);
+ 		delete analysis;
+ 	}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26651-26652.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26651-26652.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26651-26652.diff	(revision 26740)
@@ -0,0 +1,186 @@
+Index: ../trunk-jpl/src/jl/solve/analyses.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26651)
++++ ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26652)
+@@ -79,7 +79,30 @@
+ 	@assert count==length(doflist)
+ 
+ end#}}}
++function InputUpdateFromSolution(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+ 
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++
++	#Get solution vector for this element
++	numdof   = 3*2
++	values = Vector{Float64}(undef,numdof)
++	for i in 1:numdof values[i]=ug[doflist[i]] end
++
++	#Now split solution vector into x and y components
++	numnodes = 3
++	vx= Vector{Float64}(undef,numnodes)
++	vy= Vector{Float64}(undef,numnodes)
++	for i in 1:numnodes 
++		vx[i]=values[2*i-1] 
++		vy[i]=values[2*i] 
++		@assert isfinite(vx[i])
++		@assert isfinite(vy[i])
++	end
++
++	AddInput(element,VxEnum,vx,P1Enum)
++	AddInput(element,VyEnum,vy,P1Enum)
++end#}}}
+ function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+ 
+ 	#Fetch parameters relevant to solution sequence
+@@ -94,30 +117,3 @@
+ end #}}}
+ 
+ 
+-function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
+-
+-	#Initialize number of iterations
+-	count = 0
+-	converged = false
+-
+-	#Get existing solution
+-	ug = GetSolutionFromInputsx(analysis,femmodel)
+-
+-	print(ug)
+-
+-	#Loop until we reach convergence
+-	while(~converged)
+-
+-		error("not implemented yet")
+-
+-		#Increase count
+-		count += 1
+-		if(count>maxiter)
+-			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
+-			converged = true
+-		end
+-	end
+-
+-	error("STOP")
+-
+-end# }}}
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26651)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26652)
+@@ -22,6 +22,14 @@
+ 		error("size ",size(data,1)," not supported yet");
+ 	end
+ end #}}}
++function AddInput(element::Tria,inputenum::IssmEnum,data::Vector{Float64},interpolation::IssmEnum) #{{{
++	if interpolation==P1Enum
++		@assert length(data)==3
++		SetTriaInput(element.inputs,inputenum,P1Enum,element.vertexids,data)
++	else
++		error("interpolation ", interpolation, " not supported yet");
++	end
++end #}}}
+ function Update(element::Tria,inputs::Inputs,index::Int64,md::model,finiteelement::IssmEnum) #{{{
+ 
+ 	if finiteelement==P1Enum
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26651)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26652)
+@@ -133,3 +133,29 @@
+ 	return ug
+ 
+ end#}}}
++function InputUpdateFromSolutionx(analysis::Analysis,ug::Vector{Float64},femmodel::FemModel) #{{{
++
++	#Go through elements and plug in solution
++	for i=1:length(femmodel.elements)
++		InputUpdateFromSolution(analysis,ug,femmodel.elements[i])
++	end
++
++	return ug
++
++end#}}}
++function Reducevectorgtofx(ug::Vector{Float64},nodes::Vector{Node}) #{{{
++
++	#Get size of output vector
++	fsize = NumberOfDofs(nodes,FsetEnum)
++
++	#Initialize output vector
++	uf = Vector{Float64}(undef,fsize)
++
++	#Go through elements and plug in solution
++	for i=1:length(nodes)
++		VecReduce(nodes[i],ug,uf)
++	end
++
++	return ug
++
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26651)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26652)
+@@ -113,7 +113,16 @@
+ 	return count
+ 
+ end# }}}
++function VecReduce(node::Node,ug::Vector{Float64},uf::Vector{Float64}) #{{{
+ 
++	for i=1:node.gsize
++		if node.fdoflist[i]!=-1
++			uf[node.fdoflist[i]] = ug[node.gdoflist[i]]
++		end
++	end
++
++end# }}}
++
+ #Nodes functions
+ function RequiresDofReindexing(nodes::Vector{Node}) #{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26652)
+@@ -0,0 +1,29 @@
++function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
++
++	#Initialize number of iterations
++	count = 0
++	converged = false
++
++	#Get existing solution
++	ug = GetSolutionFromInputsx(analysis,femmodel)
++	uf = Reducevectorgtofx(ug,femmodel.nodes)
++
++	#Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
++	InputUpdateFromSolutionx(analysis,ug,femmodel)
++
++	#Loop until we reach convergence
++	while(~converged)
++
++		error("not implemented yet")
++
++		#Increase count
++		count += 1
++		if(count>maxiter)
++			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
++			converged = true
++		end
++	end
++
++	error("STOP")
++
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26651)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26652)
+@@ -9,6 +9,7 @@
+ include("./constraints.jl")
+ include("./femmodel.jl")
+ include("./analyses.jl")
++include("./solutionsequences.jl")
+ include("./modules.jl")
+ 
+ function IssmCore(md::model) #{{{
Index: /issm/oecreview/Archive/25834-26739/ISSM-26652-26653.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26652-26653.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26652-26653.diff	(revision 26740)
@@ -0,0 +1,229 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26652)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26653)
+@@ -1295,7 +1295,7 @@
+ 	else                  phi = f1*f2;
+ 	
+ 	/*Compute weights*/
+-	gauss = this->NewGauss(point,f1,f2,trapezeisnegative,2);
++	gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2);
+ 
+ 	total_weight = 0.0;
+ 	for(int i=0;i<NUMVERTICES2D;i++)weights[i] = 0;
+@@ -1305,10 +1305,8 @@
+ 		total_weight += gauss->weight;
+ 	}
+ 
+-	/*Normalize to phi*/
+-	if(total_weight>0.){
+-		for(int i=0;i<NUMVERTICES2D;i++) weights[i] = weights[i]*phi/total_weight;
+-	}
++	/*Normalizing to phi such that weights provide coefficients for integration over subelement (for averaging:phi*weights)*/
++   if(total_weight>0.) for(int i=0;i<NUMVERTICES;i++) weights[i] = weights[i]*phi/total_weight;
+ 	else for(int i=0;i<NUMVERTICES2D;i++) weights[i] = 0.0;
+ 
+ 	/*Cleanup*/
+@@ -2206,7 +2204,7 @@
+ 		
+ 		IssmDouble basetot;
+ 		height = 0.0;
+-		for(int i=0;i<NUMVERTICES2D;i++) height += weights[i]*heights[i];
++		for(int i=0;i<NUMVERTICES2D;i++) height += weights[i]/phi*heights[i];
+ 		basetot = 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+ 		base    = basetot*phi;	
+ 	
+@@ -2216,7 +2214,7 @@
+ 			Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
+ 			/*Compute loop only over lower vertices: i<NUMVERTICES2D*/
+ 			scalefactor = 0.0;
+-			for(int i=0;i<NUMVERTICES2D;i++) scalefactor += weights[i]*scalefactor_vertices[i];
++			for(int i=0;i<NUMVERTICES2D;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
+ 			base = base*scalefactor;
+ 			xDelete<IssmDouble>(scalefactor_vertices);
+ 		}
+@@ -4388,6 +4386,7 @@
+ 	/*The smb[Gt yr-1] of one element is area[m2] * smb [ m ice yr^-1] * rho_ice [kg m-3] / 1e+10^12 */
+ 	IssmDouble base,smb,rho_ice,scalefactor;
+ 	IssmDouble Total_Smb=0;
++	IssmDouble lsf[NUMVERTICES];
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+ 	/*Get material parameters :*/
+@@ -4403,16 +4402,47 @@
+ 	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
+ 
+ 	/*Now get the average SMB over the element*/
+-	Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
++	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
++   if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++		/*Partially ice-covered element*/
++		bool mainlyice;
++      int point;
++      IssmDouble* smb_vertices = xNew<IssmDouble>(NUMVERTICES);
++		IssmDouble  weights[NUMVERTICES2D];
++		IssmDouble  lsf2d[NUMVERTICES2D];
++      IssmDouble f1,f2,phi;
++      Element::GetInputListOnVertices(&smb_vertices[0],SmbMassBalanceEnum);
++		for(int i=0;i<NUMVERTICES2D;i++) lsf2d[i] = lsf[i];
++		GetFractionGeometry2D(weights,&phi,&point,&f1,&f2,&mainlyice,lsf2d);
++		smb = 0.0;
++		for(int i=0;i<NUMVERTICES2D;i++) smb += weights[i]*smb_vertices[i];
+ 
+-	smb_input->GetInputAverage(&smb);
+-	if(scaled==true){
+-		Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
+-		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
++		if(scaled==true){
++         IssmDouble* scalefactor_vertices   = xNew<IssmDouble>(NUMVERTICES);
++         Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
++         /*Compute loop only over lower vertices: i<NUMVERTICES2D*/
++         scalefactor = 0.0;
++         for(int i=0;i<NUMVERTICES2D;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
++         xDelete<IssmDouble>(scalefactor_vertices);
++		}
++		else scalefactor = 1.0;
++
++		/*Cleanup*/
++      xDelete<IssmDouble>(smb_vertices);
+ 	}
++
+ 	else{
+-		scalefactor=1.;
++		/*Fully ice-covered element*/
++		Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
++		smb_input->GetInputAverage(&smb);
++
++		if(scaled==true){
++			Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
++			scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
++		}
++		else scalefactor=1.0;
+ 	}
++
+ 	Total_Smb=rho_ice*base*smb*scalefactor;// smb on element in kg s-1
+ 
+ 	/*Return: */
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26652)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26653)
+@@ -1816,7 +1816,7 @@
+ 	else phi=f1*f2;
+ 
+ 	/*Compute weights:*/
+-	gauss = this->NewGauss(point,f1,f2,trapezeisnegative,2); 
++	gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2); //VV correction (16Nov2021)
+ 
+ 	total_weight=0;
+ 	for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
+@@ -1825,7 +1825,7 @@
+ 		for(int i=0;i<NUMVERTICES;i++)weights[i]+=loadweights_g[i]*gauss->weight;
+ 		total_weight+=gauss->weight;
+ 	}
+-	//normalize to phi. 
++	/*Normalizing to phi such that weights provide coefficients for integration over subelement (for averaging:phi*weights)*/  
+ 	if(total_weight>0.) for(int i=0;i<NUMVERTICES;i++)weights[i]/=total_weight/phi; 
+ 	else for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
+ 
+@@ -3545,8 +3545,8 @@
+ 		Haverage/=IssmDouble(numthk);
+ 	}*/
+ 
+-   IssmDouble* lsf = xNew<IssmDouble>(NUMVERTICES);
+-   Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
++   IssmDouble lsf[NUMVERTICES];
++	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+    /*Deal with partially ice-covered elements*/
+ 	if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
+ 		bool istrapneg;
+@@ -3562,7 +3562,8 @@
+       GetFractionGeometry(weights,&phi,&point,&f1,&f2,&istrapneg,lsf);
+       for(int i=0;i<NUMVERTICES;i++) Hice[i] = surfaces[i]-bases[i];
+       Haverage = 0.0;
+-      for(int i=0;i<NUMVERTICES;i++) Haverage += weights[i]*Hice[i];
++		/*Use weights[i]/phi to get average thickness over subelement*/
++      for(int i=0;i<NUMVERTICES;i++) Haverage += weights[i]/phi*Hice[i];
+ 		/*Get back area of ice-covered base*/
+ 		area_basetot = this->GetArea();
+ 		area_base    = phi*area_basetot;
+@@ -3572,7 +3573,7 @@
+ 			IssmDouble* scalefactor_vertices = xNew<IssmDouble>(NUMVERTICES);
+ 			Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
+ 			scalefactor = 0.0;
+-			for(int i=0;i<NUMVERTICES;i++) scalefactor += weights[i]*scalefactor_vertices[i];
++			for(int i=0;i<NUMVERTICES;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
+ 			area_base = area_base*scalefactor;
+ 			xDelete<IssmDouble>(scalefactor_vertices);
+ 		}
+@@ -3605,7 +3606,6 @@
+ 	xDelete<int>(indices);
+ 	xDelete<IssmDouble>(H);
+ 	xDelete<IssmDouble>(SF);
+-	xDelete<IssmDouble>(lsf);
+ 
+ 	if(domaintype==Domain2DverticalEnum){
+ 	  return area_base;
+@@ -5478,6 +5478,7 @@
+ 	/*The smb[kg yr-1] of one element is area[m2] * smb [kg m^-2 yr^-1]*/
+ 	IssmDouble base,smb,rho_ice,scalefactor;
+ 	IssmDouble Total_Smb=0;
++	IssmDouble lsf[NUMVERTICES];
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 
+ 	/*Get material parameters :*/
+@@ -5491,17 +5492,47 @@
+ 	 * http://en.wikipedia.org/wiki/Triangle
+ 	 * base = 1/2 abs((xA-xC)(yB-yA)-(xA-xB)(yC-yA))*/
+ 	base = 1./2. * fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));	// area of element in m2
++	
++	/*Now get the average SMB over the element*/
++	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
++	if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++		/*Partially ice-covered element*/
++		bool mainlyice;
++      int point;
++      IssmDouble* weights       = xNew<IssmDouble>(NUMVERTICES);
++      IssmDouble* smb_vertices  = xNew<IssmDouble>(NUMVERTICES);
++      IssmDouble f1,f2,phi;
++		
++		Element::GetInputListOnVertices(&smb_vertices[0],SmbMassBalanceEnum);
++		GetFractionGeometry(weights,&phi,&point,&f1,&f2,&mainlyice,lsf);
++		smb = 0.0;
++		for(int i=0;i<NUMVERTICES;i++) smb += weights[i]*smb_vertices[i];
++	
++		if(scaled==true){
++         IssmDouble* scalefactor_vertices = xNew<IssmDouble>(NUMVERTICES);
++         Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
++         scalefactor = 0.0;
++         for(int i=0;i<NUMVERTICES;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
++         xDelete<IssmDouble>(scalefactor_vertices);
++      }
++		else scalefactor = 1.0;
+ 
+-	/*Now get the average SMB over the element*/
+-	Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
+-	smb_input->GetInputAverage(&smb);	// average smb on element in m ice s-1
+-	if(scaled==true){
+-		Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
+-		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
++		/*Cleanup*/
++      xDelete<IssmDouble>(weights);
++      xDelete<IssmDouble>(smb_vertices);
+ 	}
+ 	else{
+-		scalefactor=1.;
++		/*Fully ice-covered element*/
++		Input* smb_input = this->GetInput(SmbMassBalanceEnum); _assert_(smb_input);
++		smb_input->GetInputAverage(&smb);   // average smb on element in m ice s-1
++
++		if(scaled==true){
++			Input* scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
++			scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
++		}
++		else scalefactor=1.0;
+ 	}
++	
+    Total_Smb=rho_ice*base*smb*scalefactor;	// smb on element in kg s-1
+ 
+ 	/*Return: */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26653-26654.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26653-26654.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26653-26654.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/jenkins/pine_island-mac-basic
+===================================================================
+--- ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26653)
++++ ../trunk-jpl/jenkins/pine_island-mac-basic	(revision 26654)
+@@ -67,10 +67,7 @@
+ # See documentation in test/NightlyRun/runme.* for more information
+ #
+ # NOTE:
+-# - Tests 257 and 543 are currently excluded on macOS as they rely on random 
+-#	number generation, which is platform-dependent in its current 
+-#	implementation
+ # - test701 is skipped because it uses full Stokes equations
+ #
+-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),257,435,543,701,702,703]"
++MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota'),435,701,702,703]"
+ PYTHON_NROPTIONS=""
Index: /issm/oecreview/Archive/25834-26739/ISSM-26654-26655.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26654-26655.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26654-26655.diff	(revision 26740)
@@ -0,0 +1,349 @@
+Index: ../trunk-jpl/src/jl/solve/analyses.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses.jl	(revision 26654)
++++ ../trunk-jpl/src/jl/solve/analyses.jl	(nonexistent)
+@@ -1,119 +0,0 @@
+-#Analysis class definitions
+-abstract type Analysis end
+-struct StressbalanceAnalysis <: Analysis#{{{
+-end #}}}
+-
+-#Stress balance analysis
+-function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+-	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
+-	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
+-	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
+-	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
+-end#}}}
+-function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
+-
+-	numdof = 2
+-	for i in 1:md.mesh.numberofvertices
+-		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+-	end
+-end#}}}
+-function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+-
+-	#Provide node indices to element
+-	for i in 1:md.mesh.numberofvertices
+-		Update(elements[i],inputs,i,md,P1Enum)
+-	end
+-
+-	#Add necessary inputs to perform this analysis
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
+-	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+-	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
+-
+-end#}}}
+-function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
+-
+-	#load constraints from model
+-	spcvx = md.stressbalance.spcvx
+-	spcvy = md.stressbalance.spcvy
+-
+-	count = 1
+-	for i in 1:md.mesh.numberofvertices
+-		if ~isnan(spcvx[i])
+-			push!(constraints,Constraint(count,i,1,spcvx[i]))
+-			count+=1
+-		end
+-		if ~isnan(spcvy[i])
+-			push!(constraints,Constraint(count,i,2,spcvy[i]))
+-			count+=1
+-		end
+-	end
+-
+-end#}}}
+-function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+-
+-	#Get dofs for this finite element
+-	doflist = GetDofList(element,GsetEnum)
+-	@assert length(doflist)==6
+-
+-	#Fetch inputs
+-	vx_input = GetInput(element, VxEnum)
+-	vy_input = GetInput(element, VyEnum)
+-
+-	#Loop over each node and enter solution in ug
+-	count = 0
+-	gauss=GaussTria(P1Enum)
+-	for i in 1:gauss.numgauss
+-		vx = GetInputValue(vx_input, gauss, i)
+-		vy = GetInputValue(vy_input, gauss, i)
+-
+-		count += 1
+-		ug[doflist[count]] = vx
+-		count += 1
+-		ug[doflist[count]] = vy
+-	end
+-
+-	#Make sure we reached all the values
+-	@assert count==length(doflist)
+-
+-end#}}}
+-function InputUpdateFromSolution(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+-
+-	#Get dofs for this finite element
+-	doflist = GetDofList(element,GsetEnum)
+-
+-	#Get solution vector for this element
+-	numdof   = 3*2
+-	values = Vector{Float64}(undef,numdof)
+-	for i in 1:numdof values[i]=ug[doflist[i]] end
+-
+-	#Now split solution vector into x and y components
+-	numnodes = 3
+-	vx= Vector{Float64}(undef,numnodes)
+-	vy= Vector{Float64}(undef,numnodes)
+-	for i in 1:numnodes 
+-		vx[i]=values[2*i-1] 
+-		vy[i]=values[2*i] 
+-		@assert isfinite(vx[i])
+-		@assert isfinite(vy[i])
+-	end
+-
+-	AddInput(element,VxEnum,vx,P1Enum)
+-	AddInput(element,VyEnum,vy,P1Enum)
+-end#}}}
+-function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+-
+-	#Fetch parameters relevant to solution sequence
+-	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
+-	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
+-	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
+-	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
+-
+-	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+-	error("STOP")
+-
+-end #}}}
+-
+-
+Index: ../trunk-jpl/src/jl/solve/analyses/analysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/analysis.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/analyses/analysis.jl	(revision 26655)
+@@ -0,0 +1,2 @@
++#Analysis class definitions
++abstract type Analysis end
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26654)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26655)
+@@ -14,6 +14,8 @@
+ 	#Loop until we reach convergence
+ 	while(~converged)
+ 
++		#Get new matrices
++		Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
+ 		error("not implemented yet")
+ 
+ 		#Increase count
+Index: ../trunk-jpl/src/jl/solve/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/toolkits.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26655)
+@@ -0,0 +1,15 @@
++
++#Toolkit #1: serial sparse arrays
++using SparseArrays
++mutable struct IssmMatrix #{{{
++	matrix::SparseMatrixCSC{Float64,Int64}
++end #}}}
++function IssmMatrix(M::Int64,N::Int64)#{{{
++	return IssmMatrix(spzeros(M,N))
++end#}}}
++mutable struct IssmVector #{{{
++	vector::Vector{Float64}
++end #}}}
++function IssmVector(M::Int64)#{{{
++	return IssmVector(zeros(M))
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26655)
+@@ -0,0 +1,118 @@
++#StressbalanceAnalysis class definition
++struct StressbalanceAnalysis <: Analysis#{{{
++end #}}}
++
++#Model Processing
++function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
++
++	#load constraints from model
++	spcvx = md.stressbalance.spcvx
++	spcvy = md.stressbalance.spcvy
++
++	count = 1
++	for i in 1:md.mesh.numberofvertices
++		if ~isnan(spcvx[i])
++			push!(constraints,Constraint(count,i,1,spcvx[i]))
++			count+=1
++		end
++		if ~isnan(spcvy[i])
++			push!(constraints,Constraint(count,i,2,spcvy[i]))
++			count+=1
++		end
++	end
++
++end#}}}
++function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
++
++	numdof = 2
++	for i in 1:md.mesh.numberofvertices
++		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
++	end
++end#}}}
++function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
++
++	#Provide node indices to element
++	for i in 1:md.mesh.numberofvertices
++		Update(elements[i],inputs,i,md,P1Enum)
++	end
++
++	#Add necessary inputs to perform this analysis
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
++
++end#}}}
++function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
++	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
++	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
++	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
++	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
++end#}}}
++
++#Finite Element Analysis
++function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
++
++	#Fetch parameters relevant to solution sequence
++	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
++	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
++	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
++	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
++
++	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
++	error("STOP")
++
++end #}}}
++function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
++
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++	@assert length(doflist)==6
++
++	#Fetch inputs
++	vx_input = GetInput(element, VxEnum)
++	vy_input = GetInput(element, VyEnum)
++
++	#Loop over each node and enter solution in ug
++	count = 0
++	gauss=GaussTria(P1Enum)
++	for i in 1:gauss.numgauss
++		vx = GetInputValue(vx_input, gauss, i)
++		vy = GetInputValue(vy_input, gauss, i)
++
++		count += 1
++		ug[doflist[count]] = vx
++		count += 1
++		ug[doflist[count]] = vy
++	end
++
++	#Make sure we reached all the values
++	@assert count==length(doflist)
++
++end#}}}
++function InputUpdateFromSolution(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
++
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++
++	#Get solution vector for this element
++	numdof   = 3*2
++	values = Vector{Float64}(undef,numdof)
++	for i in 1:numdof values[i]=ug[doflist[i]] end
++
++	#Now split solution vector into x and y components
++	numnodes = 3
++	vx= Vector{Float64}(undef,numnodes)
++	vy= Vector{Float64}(undef,numnodes)
++	for i in 1:numnodes 
++		vx[i]=values[2*i-1] 
++		vy[i]=values[2*i] 
++		@assert isfinite(vx[i])
++		@assert isfinite(vy[i])
++	end
++
++	AddInput(element,VxEnum,vx,P1Enum)
++	AddInput(element,VyEnum,vy,P1Enum)
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/elementmatrix.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elementmatrix.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26655)
+@@ -0,0 +1,10 @@
++mutable struct ElementMatrix#{{{
++	nrows::Int64
++	gglobaldoflist::Vector{Int64}
++	fglobaldoflist::Vector{Int64}
++	sglobaldoflist::Vector{Int64}
++	values::Matrix{Float64}
++end #}}}
++function ElementMatrix(nodes::Vector{Node})#{{{
++	error("not implemented yet")
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26654)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26655)
+@@ -159,3 +159,24 @@
+ 	return ug
+ 
+ end#}}}
++function SystemMatricesx(femmodel::FemModel,analysis::Analysis)# {{{
++
++	#Allocate matrices
++	fsize = NumberOfDofs(femmodel.nodes,FsetEnum)
++	ssize = NumberOfDofs(femmodel.nodes,SsetEnum)
++	Kff = IssmMatrix(fsize,fsize)
++	Kfs = IssmMatrix(fsize,ssize)
++	pf  = IssmVector(fsize)
++
++	#Construct Stiffness matrix and load vector from elements
++	for i=1:length(femmodel.elements)
++		Ke = CreateKMatrix(analysis,femmodel.elements[i])
++		pe = CreatePVector(analysis,femmodel.elements[i])
++		print(Ke)
++		error("don't know what to do")
++	end
++	
++	
++	
++	error("STOP")
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26654)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26655)
+@@ -8,9 +8,12 @@
+ include("./elements.jl")
+ include("./constraints.jl")
+ include("./femmodel.jl")
+-include("./analyses.jl")
++include("./analyses/analysis.jl")
++include("./analyses/stressbalanceanalysis.jl")
+ include("./solutionsequences.jl")
+ include("./modules.jl")
++include("./toolkits.jl")
++include("./elementmatrix.jl")
+ 
+ function IssmCore(md::model) #{{{
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26655-26656.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26655-26656.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26655-26656.diff	(revision 26740)
@@ -0,0 +1,38 @@
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26655)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.cpp	(revision 26656)
+@@ -34,7 +34,7 @@
+ 			return;
+ 	}/*}}}*/
+ 
+-  linear_congruential_engine::~linear_congruential_engine(){}
++	linear_congruential_engine::~linear_congruential_engine(){}
+ 
+   unsigned int linear_congruential_engine::get_m() { return m; }
+ 
+@@ -50,6 +50,11 @@
+     return *pseed;
+   }
+ 
++  void linear_congruential_engine::free_resources(){
++	  delete pseed;
++	  return;
++  }
++
+   /* Uniform distribution */
+ 
+ 	uniform_distribution::uniform_distribution(){/*{{{*/
+Index: ../trunk-jpl/src/c/shared/Random/randomgenerator.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26655)
++++ ../trunk-jpl/src/c/shared/Random/randomgenerator.h	(revision 26656)
+@@ -28,7 +28,7 @@
+       unsigned int get_m();
+       void seed( int s );
+       unsigned int generator();
+-
++		void free_resources();
+   };
+ 
+   class uniform_distribution
Index: /issm/oecreview/Archive/25834-26739/ISSM-26656-26657.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26656-26657.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26656-26657.diff	(revision 26740)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/c/shared/Random/random.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26656)
++++ ../trunk-jpl/src/c/shared/Random/random.cpp	(revision 26657)
+@@ -25,7 +25,9 @@
+ 	randomengine.seed(seed);
+ 	/*Normal distribution*/
+ 	rnd::normal_distribution distriNormal(mean,sdev);
++	/*Assign output pointer and cleanup*/
+ 	*prand = distriNormal.generator(randomengine);
++	randomengine.free_resources();
+ } /*}}}*/
+ void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
+    
+@@ -58,6 +60,7 @@
+    *prand = sampleMultivariateNormal;
+    xDelete<IssmPDouble>(sampleStandardNormal);
+    xDelete<IssmDouble>(Lchol);
++	randomengine.free_resources();
+ } /*}}}*/
+ void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
+ 	
+@@ -89,6 +92,7 @@
+ 	*prand = sampleMultivariateNormal;
+ 	xDelete<IssmPDouble>(sampleStandardNormal);
+ 	xDelete<IssmDouble>(Lchol);
++	randomengine.free_resources();
+ } /*}}}*/
+ 
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26657-26658.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26657-26658.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26657-26658.diff	(revision 26740)
@@ -0,0 +1,129 @@
+Index: ../trunk-jpl/src/jl/solve/elementmatrix.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26657)
++++ ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26658)
+@@ -6,5 +6,56 @@
+ 	values::Matrix{Float64}
+ end #}}}
+ function ElementMatrix(nodes::Vector{Node})#{{{
+-	error("not implemented yet")
++
++	#Get matrix size
++	nrows = NumberOfDofs(nodes,GsetEnum)
++
++	#Initialize element matrix with zeros
++	values = zeros(nrows,nrows)
++
++	#Get dof lists
++	gglobaldoflist=GetGlobalDofList(nodes,nrows,GsetEnum)
++	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
++	sglobaldoflist=GetGlobalDofList(nodes,nrows,SsetEnum)
++
++	return ElementMatrix(nrows,gglobaldoflist,fglobaldoflist,sglobaldoflist,values)
+ end#}}}
++function Base.show(io::IO, this::ElementMatrix)# {{{
++
++	println(io,"ElementMatrix:")
++	println(io,"   nrows: ",this.nrows)
++	println(io,"   gglobaldoflist: ",this.gglobaldoflist)
++	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
++	println(io,"   sglobaldoflist: ",this.sglobaldoflist)
++	print(io,"   values: ")
++	display(this.values)
++end# }}}
++
++mutable struct ElementVector#{{{
++	nrows::Int64
++	fglobaldoflist::Vector{Int64}
++	values::Vector{Float64}
++end #}}}
++function ElementVector(nodes::Vector{Node})#{{{
++
++	#Get matrix size
++	nrows = NumberOfDofs(nodes,GsetEnum)
++
++	#Initialize element matrix with zeros
++	values = zeros(nrows,nrows)
++
++	#Get dof list
++	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
++
++	return ElementVector(nrows,fglobaldoflist,values)
++end#}}}
++function Base.show(io::IO, this::ElementVector)# {{{
++
++	println(io,"ElementVector:")
++	println(io,"   nrows: ",this.nrows)
++	println(io,"   gglobaldoflist: ",this.gglobaldoflist)
++	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
++	println(io,"   sglobaldoflist: ",this.sglobaldoflist)
++	print(io,"   values: ")
++	display(this.values)
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26657)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26658)
+@@ -65,6 +65,13 @@
+ 	error("STOP")
+ 
+ end #}}}
++function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
++
++	#Initialize Element matrix
++	Ke = ElementMatrix(element.nodes)
++
++	return Ke
++end #}}}
+ function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+ 
+ 	#Get dofs for this finite element
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26657)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26658)
+@@ -94,17 +94,17 @@
+ 		end
+ 	elseif setenum==FsetEnum
+ 		for i=1:node.gsize
+-			if  node.fdoflist[i]!=-1
++			#if  node.fdoflist[i]!=-1
+ 				count += 1
+ 				doflist[count] = node.fdoflist[i]
+-			end
++			#end
+ 		end
+ 	elseif setenum==SsetEnum
+ 		for i=1:node.gsize
+-			if  node.sdoflist[i]!=-1
++			#if  node.sdoflist[i]!=-1
+ 				count += 1
+ 				doflist[count] = node.sdoflist[i]
+-			end
++			#end
+ 		end
+ 	else
+ 		error("not supported")
+@@ -113,6 +113,22 @@
+ 	return count
+ 
+ end# }}}
++function GetGlobalDofList(nodes::Vector{Node},ndofs::Int64,setenum::IssmEnum) #{{{
++
++	#Allocate list
++	doflist = Vector{Int64}(undef,ndofs)
++
++	#Assign values 
++	count = 0
++	for i in 1:length(nodes)
++		count = GetDofList(nodes[i],doflist,count,setenum)
++	end
++	println(count," ",ndofs)
++	@assert count==ndofs
++
++	return doflist
++
++end# }}}
+ function VecReduce(node::Node,ug::Vector{Float64},uf::Vector{Float64}) #{{{
+ 
+ 	for i=1:node.gsize
Index: /issm/oecreview/Archive/25834-26739/ISSM-26658-26659.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26658-26659.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26658-26659.diff	(revision 26740)
@@ -0,0 +1,189 @@
+Index: ../trunk-jpl/src/jl/solve/gauss.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26659)
+@@ -22,12 +22,13 @@
+ 		coords2 = [0.333333333333333]
+ 		coords3 = [0.333333333333333]
+ 	elseif(order==2)
++		npoints = 3
+ 		weights = [0.577350269189625; 0.577350269189625; 0.577350269189625]
+ 		coords1 = [0.666666666666667; 0.166666666666667; 0.166666666666667]
+ 		coords2 = [0.166666666666667; 0.666666666666667; 0.166666666666667]
+ 		coords3 = [0.166666666666667; 0.166666666666667; 0.666666666666667]
+ 	elseif(order==3)
+-		npoints=4
++		npoints = 4
+ 		weights = [-0.974278579257493; 0.902109795608790; 0.902109795608790; 0.902109795608790]
+ 		coords1 = [ 0.333333333333333; 0.600000000000000; 0.200000000000000; 0.200000000000000]
+ 		coords2 = [ 0.333333333333333; 0.200000000000000; 0.600000000000000; 0.200000000000000]
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26659)
+@@ -68,7 +68,7 @@
+ 
+ 	count = 0
+ 	for i in 1:md.mesh.numberofvertices
+-		push!(vertices,Vertex(i,x[i],y[i]))
++		push!(vertices,Vertex(i,x[i],y[i],0.))
+ 	end
+ 
+ end# }}}
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26659)
+@@ -123,7 +123,6 @@
+ 	for i in 1:length(nodes)
+ 		count = GetDofList(nodes[i],doflist,count,setenum)
+ 	end
+-	println(count," ",ndofs)
+ 	@assert count==ndofs
+ 
+ 	return doflist
+Index: ../trunk-jpl/src/jl/solve/vertices.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/vertices.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/solve/vertices.jl	(revision 26659)
+@@ -3,4 +3,24 @@
+ 	sid::Int64
+ 	x::Float64
+ 	y::Float64
++	z::Float64
+ end# }}}
++
++#vertices functions
++function GetVerticesCoordinates(vertices::Vector{Vertex}) #{{{
++
++	#Intermediaries
++	nbv = length(vertices)
++
++	#Allocate
++	xyz_list = Matrix{Float64}(undef,nbv,3)
++
++	#Assign value to xyz_list
++	for i in 1:nbv
++		xyz_list[i,1]=vertices[i].x
++		xyz_list[i,2]=vertices[i].y
++		xyz_list[i,3]=vertices[i].z
++	end
++
++	return xyz_list
++end #}}}
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26659)
+@@ -5,6 +5,7 @@
+ md = ISSM.model()
+ #md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.)
+ md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.)
++#md = ISSM.triangle(md,"../../test/Exp/Square.exp",1000.)
+ md = ISSM.setmask(md,"all","")
+ 
+ #Geometry
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26659)
+@@ -67,9 +67,35 @@
+ end #}}}
+ function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
+ 
+-	#Initialize Element matrix
++	#Internmediaries
++	numnodes = 3
++	
++	#Initialize Element matrix and basis function derivatives
+ 	Ke = ElementMatrix(element.nodes)
++	dbasis = Matrix{Float64}(undef,numnodes,2)
+ 
++	#Retrieve all inputs and parameters
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	vx_input = GetInput(element, VxEnum)
++	vy_input = GetInput(element, VyEnum)
++	H_input  = GetInput(element, ThicknessEnum)
++
++	#Start integrating
++	gauss = GaussTria(2)
++	for i in 1:gauss.numgauss
++
++		Jdet = JacobianDeterminant(xyz_list, gauss)
++
++		println(Jdet)
++
++		error("STOP")
++		vx = GetInputValue(vx_input, gauss, i)
++		vy = GetInputValue(vy_input, gauss, i)
++	end
++
++
++	error("STOP")
++
+ 	return Ke
+ end #}}}
+ function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26659)
+@@ -101,3 +101,36 @@
+ 	end
+ 
+ end # }}}
++
++#Finite Element stuff
++function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	#Get Jacobian Matrix
++	J = Jacobian(xyz_list)
++
++	#Get its determinant
++	Jdet = Matrix2x2Determinant(J)
++
++	#check and return
++	if(Jdet<0) error("negative Jacobian Determinant") end
++	return Jdet
++
++end#}}}
++function Jacobian(xyz_list::Matrix{Float64}) #{{{
++
++	J = Matrix{Float64}(undef,2,2)
++
++	x1 = xyz_list[1,1]
++	y1 = xyz_list[1,2]
++	x2 = xyz_list[2,1]
++	y2 = xyz_list[2,2]
++	x3 = xyz_list[3,1]
++	y3 = xyz_list[3,2]
++
++	J[1,1] = .5*(x2-x1)
++	J[1,2] = sqrt(3)/6*(2*x3 -x1 -x2)
++	J[2,1] = .5*(y2-y1)
++	J[2,2] = sqrt(3)/6*(2*y3 -y1 -y2)
++
++	return J
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26658)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26659)
+@@ -13,6 +13,7 @@
+ include("./solutionsequences.jl")
+ include("./modules.jl")
+ include("./toolkits.jl")
++include("./utils.jl")
+ include("./elementmatrix.jl")
+ 
+ function IssmCore(md::model) #{{{
+Index: ../trunk-jpl/src/jl/solve/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/utils.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/utils.jl	(revision 26659)
+@@ -0,0 +1,5 @@
++function Matrix2x2Determinant(A::Matrix{Float64}) #{{{
++
++	return  A[1,1]*A[2,2]-A[2,1]*A[1,2]
++
++end#}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26659-26660.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26659-26660.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26659-26660.diff	(revision 26740)
@@ -0,0 +1,318 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26659)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26660)
+@@ -4,13 +4,13 @@
+ %      stochasticforcing=stochasticforcing();
+ 
+ classdef stochasticforcing
+-	properties (SetAccess=public) 
+-		isstochasticforcing  = 0;
+-		fields               = NaN;
+-		defaultdimension     = 0;
+-      default_id           = NaN;
+-		covariance           = NaN;
+-		randomflag           = 1;
++	properties (SetAccess=public)
++		isstochasticforcing	= 0;
++		fields					= NaN;
++		defaultdimension		= 0;
++		default_id				= NaN;
++		covariance				= NaN;
++		randomflag				= 1;
+ 	end
+ 	methods
+ 		function self = stochasticforcing(varargin) % {{{
+@@ -25,8 +25,8 @@
+ 			%Nothing for now
+ 		end % }}}
+ 		function self = setdefaultparameters(self) % {{{
+-			self.isstochasticforcing  = 0; %stochasticforcing is turned off by default
+-			self.randomflag           = 1; %true randomness is implemented by default
++			self.isstochasticforcing	= 0; %stochasticforcing is turned off by default
++			self.randomflag				= 1; %true randomness is implemented by default
+ 		end % }}}
+ 		function md = checkconsistency(self,md,solution,analyses) % {{{
+ 
+@@ -34,7 +34,7 @@
+ 			if ~self.isstochasticforcing, return; end
+ 
+ 			num_fields = numel(self.fields);
+-			
++
+ 			%Check that covariance matrix is positive definite
+ 			try
+ 				chol(self.covariance);
+@@ -42,53 +42,53 @@
+ 				error('md.stochasticforcing.covariance is not positive definite');
+ 			end
+ 
+-			%Check that all fields agree with the corresponding md class and if any field needs the default params   
+-         checkdefaults = false; %need to check defaults only if one of the field does not have its own dimensionality
+-			structstoch   = structstochforcing();
++			%Check that all fields agree with the corresponding md class and if any field needs the default params
++			checkdefaults	= false; %need to check defaults only if one of the fields does not have its own dimensionality
++			structstoch		= structstochforcing();
+ 			for field=self.fields
+-            %Checking agreement of classes
+-            if(contains(field,'SMB'))
++				%Checking agreement of classes
++				if(contains(field,'SMB'))
+ 					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+ 					if~(isequal(class(md.smb),char(mdname)))
+-                  error('md.smb does not agree with stochasticforcing field %s', char(field));
+-               end
+-            end
+-            if(contains(field,'FrontalForcings'))
++						error('md.smb does not agree with stochasticforcing field %s', char(field));
++					end
++				end
++				if(contains(field,'FrontalForcings'))
+ 					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+-               if~(isequal(class(md.frontalforcings),char(mdname)))
+-                  error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
+-               end
+-            end
++					if~(isequal(class(md.frontalforcings),char(mdname)))
++						error('md.frontalforcings does not agree with stochasticforcing field %s', char(field));
++					end
++				end
+ 				if(contains(field,'Calving'))
+ 					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+-               if~(isequal(class(md.calving),char(mdname)))
+-                  error('md.calving does not agree with stochasticforcing field %s', char(field));
+-               end
+-            end
++					if~(isequal(class(md.calving),char(mdname)))
++						error('md.calving does not agree with stochasticforcing field %s', char(field));
++					end
++				end
+ 				if(contains(field,'BasalforcingsFloatingice'))
+ 					mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
+-               if~(isequal(class(md.basalforcings),char(mdname)))
+-                  error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
+-               end
+-            end
+-            %Checking for specific dimensions
+-            if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
+-               checkdefaults = true; %field with non-specific dimensionality
+-            end
+-         end
++					if~(isequal(class(md.basalforcings),char(mdname)))
++						error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
++					end
++				end
++				%Checking for specific dimensions
++				if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
++					checkdefaults = true; %field with non-specific dimensionality
++				end
++			end
+ 
+ 			%Retrieve sum of all the field dimensionalities
+-			size_tot   = self.defaultdimension*num_fields;
+-			indSMBar = -1; %about to check for index of SMBautoregression
+-			indTFar  = -1; %about to check for index of FrontalForcingsRignotAutoregression
++			size_tot	= self.defaultdimension*num_fields;
++			indSMBar	= -1; %about to check for index of SMBautoregression
++			indTFar	= -1; %about to check for index of FrontalForcingsRignotAutoregression
+ 			if any(contains(self.fields,'SMBautoregression'))
+-            size_tot = size_tot-self.defaultdimension+md.smb.num_basins;
++				size_tot = size_tot-self.defaultdimension+md.smb.num_basins;
+ 				indSMBar = find(contains(self.fields,'SMBautoregression')); %index of SMBar, now check for consistency with TFar timestep (08Nov2021)
+-         end
+-         if any(contains(self.fields,'FrontalForcingsRignotAutoregression'))
+-            size_tot = size_tot-self.defaultdimension+md.frontalforcings.num_basins;
+-				indTFar  = find(contains(self.fields,'FrontalForcingsRignotAutoregression')); %index of TFar, now check for consistency with SMBar timestep (08Nov2021)
+-         end
++			end
++			if any(contains(self.fields,'FrontalForcingsRignotAutoregression'))
++				size_tot	= size_tot-self.defaultdimension+md.frontalforcings.num_basins;
++				indTFar	= find(contains(self.fields,'FrontalForcingsRignotAutoregression')); %index of TFar, now check for consistency with SMBar timestep (08Nov2021)
++			end
+ 
+ 			if(indSMBar~=-1 && indTFar~=-1) %both autoregressive models are used: check autoregressive time step consistency
+ 				if((md.smb.ar_timestep~=md.frontalforcings.ar_timestep) && any(self.covariance(1+sum(self.dimensions(1:indSMBar-1)):sum(self.dimensions(1:indSMBar)),1+sum(self.dimensions(1:indTFar-1)):sum(self.dimensions(1:indTFar))))~=0)
+@@ -101,8 +101,8 @@
+ 			md = checkfield(md,'fieldname','stochasticforcing.covariance','NaN',1,'Inf',1,'size',[size_tot,size_tot]); %global covariance matrix
+ 			md = checkfield(md,'fieldname','stochasticforcing.randomflag','numel',[1],'values',[0 1]);
+ 			if(checkdefaults) %need to check the defaults
+-            md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
+-            md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
++				md = checkfield(md,'fieldname','stochasticforcing.defaultdimension','numel',1,'NaN',1,'Inf',1,'>',0);
++				md = checkfield(md,'fieldname','stochasticforcing.default_id','Inf',1,'>=',0,'<=',self.defaultdimension,'size',[md.mesh.numberofelements,1]);
+ 			end
+ 		end % }}}
+ 		function disp(self) % {{{
+@@ -110,12 +110,12 @@
+ 			fielddisplay(self,'isstochasticforcing','is stochasticity activated?');
+ 			fielddisplay(self,'fields','fields with stochasticity applied, ex: {''SMBautoregression''}, or {''FrontalForcingsRignotAutoregression''}');
+ 			fielddisplay(self,'defaultdimension','dimensionality of the noise terms (does not apply to fields with their specific dimension)');
+-         fielddisplay(self,'default_id','id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)');
++			fielddisplay(self,'default_id','id of each element for partitioning of the noise terms (does not apply to fields with their specific partition)');
+ 			fielddisplay(self,'covariance','covariance matrix for within- and between-fields covariance (units must be squared field units)');
+ 			fielddisplay(self,'randomflag','whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)');
+ 			disp('Available fields:');
+ 			for field=supportedstochforcings()
+-				fprintf('   %s \n',string(field));
++				fprintf('   %s\n',string(field));
+ 			end
+ 		end % }}}
+ 		function marshall(self,prefix,md,fid) % {{{
+@@ -163,7 +163,7 @@
+ 				WriteData(fid,prefix,'data',num_fields,'name','md.stochasticforcing.num_fields','format','Integer');
+ 				WriteData(fid,prefix,'object',self,'fieldname','fields','format','StringArray');
+ 				WriteData(fid,prefix,'data',dimensions,'name','md.stochasticforcing.dimensions','format','IntMat');
+-            WriteData(fid,prefix,'object',self,'fieldname','default_id','data',self.default_id-1,'format','IntMat','mattype',2); %0-indexed
++				WriteData(fid,prefix,'object',self,'fieldname','default_id','data',self.default_id-1,'format','IntMat','mattype',2); %0-indexed
+ 				WriteData(fid,prefix,'object',self,'fieldname','defaultdimension','format','Integer');
+ 				WriteData(fid,prefix,'data',tempcovariance,'name','md.stochasticforcing.covariance','format','DoubleMat');
+ 				WriteData(fid,prefix,'object',self,'fieldname','randomflag','format','Boolean');
+@@ -172,10 +172,10 @@
+ 	end
+ end
+ function list = supportedstochforcings() % {{{
+-   % Defines list of fields supported
+-   % by the class md.stochasticforcing
++	% Defines list of fields supported
++	% by the class md.stochasticforcing
+ 
+-   list = structstochforcing(); 
++	list = structstochforcing();
+ 	list = list.fields;
+ end % }}}
+ function structure = structstochforcing() % {{{
+@@ -182,11 +182,11 @@
+ 	% Defines structure with list of fields
+ 	% supported and corresponding md names
+ 	structure.fields = {...
+-      'DefaultCalving',...
+-      'FloatingMeltRate',...
+-      'FrontalForcingsRignotAutoregression',...
+-      'SMBautoregression'
+-      };
++		'DefaultCalving',...
++		'FloatingMeltRate',...
++		'FrontalForcingsRignotAutoregression',...
++		'SMBautoregression'
++		};
+ 	structure.mdnames = {...
+ 		'calving',...
+ 		'basalforcings',...
+@@ -194,7 +194,3 @@
+ 		'SMBautoregression'
+ 	};
+ end % }}}
+-
+-
+-
+-
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26659)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26660)
+@@ -41,9 +41,9 @@
+ 
+     def setdefaultparameters(self):  # {{{
+         # Type of stabilization used
+-        self.isstochasticforcing = 0  # stochasticforcing is turned off by default
+-        self.fields = []  # Need to initialize to list to avoid "RuntimeError: object of type 'float' has no len()" on import of class
+-        self.randomflag = 1  # true randomness is implemented by default
++        self.isstochasticforcing = 0 # stochasticforcing is turned off by default
++        self.fields = [] # Need to initialize to list to avoid "RuntimeError: object of type 'float' has no len()" on import of class
++        self.randomflag = 1 # true randomness is implemented by default
+         return self
+     #}}}
+ 
+@@ -54,14 +54,17 @@
+ 
+         num_fields = len(self.fields)
+ 
+-        #Check that covariance matrix is positive definite this is done internaly by linalg
+-        np.linalg.cholesky(self.covariance)
++        # Check that covariance matrix is positive definite (this is done internally by linalg)
++        try:
++            np.linalg.cholesky(self.covariance)
++        except LinAlgError:
++            error('md.stochasticforcing.covariance is not positive definite')
+ 
+-        # Check that all fields agree with the corresponding md class
+-        checkdefaults = False
++        # Check that all fields agree with the corresponding md class and if any field needs the default params
++        checkdefaults = False # Need to check defaults only if one of the fields does not have its own dimensionality
+         structstoch = self.structstochforcing()
+         for field in self.fields:
+-            # Checks are temporarily commented out: need to debug why this does not work (18Nov2021) #
++            # Checking agreement of classes
+             if 'SMB' in field:
+                 mdname = structstoch[field]
+                 if (type(md.smb).__name__ != mdname):
+@@ -77,21 +80,22 @@
+             if 'BasalforcingsFloatingice' in field:
+                 mdname = structstoch[field]
+                 if (type(md.basalforcings).__name__ != mdname):
+-                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(mdname))  #Checking for specific dimensions
++                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(mdname))
++            # Checking for specific dimensions
+             if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
+-                checkdefaults = True   #field with non-specific dimensionality
++                checkdefaults = True # field with non-specific dimensionality
+ 
+-        #Retrieve sum of all the field dimensionalities
++        # Retrieve sum of all the field dimensionalities
+         size_tot = self.defaultdimension * num_fields
+-        indSMBar = -1  #about to check for index of SMBautoregression
+-        indTFar = -1  #about to check for index of FrontalForcingsRignotAutoregression
++        indSMBar = -1 # About to check for index of SMBautoregression
++        indTFar = -1 # About to check for index of FrontalForcingsRignotAutoregression
+         if ('SMBautoregression' in self.fields):
+             size_tot = size_tot - self.defaultdimension + md.smb.num_basins
+-            indSMBar = self.fields.index('SMBautoregression')
++            indSMBar = self.fields.index('SMBautoregression') # Index of SMBar, now check for consistency with TFar timestep (08Nov2021)
+         if ('FrontalForcingsRignotAutoregression' in self.fields):
+             size_tot = size_tot - self.defaultdimension + md.frontalforcings.num_basins
+-            indTFar = self.fields.index('FrontalForcingsRignotAutoregression')
+-        if (indSMBar != -1 and indTFar != -1):
++            indTFar = self.fields.index('FrontalForcingsRignotAutoregression') # Index of TFar, now check for consistency with SMBar timestep (08Nov2021)
++        if (indSMBar != -1 and indTFar != -1): # Both autoregressive models are used: check autoregressive time step consistency
+             covsum = self.covariance[np.sum(self.defaultdimensions[0:indSMBar]).astype(int):np.sum(self.defaultdimensions[0:indSMBar + 1]).astype(int), np.sum(self.defaultdimensions[0:indTFar]).astype(int):np.sum(self.defaultdimensions[0:indTFar + 1]).astype(int)]
+             if((md.smb.ar_timestep != md.frontalforcings.ar_timestep) and np.any(covsum != 0)):
+                 raise IOError('SMBautoregression and FrontalForcingsRignotAutoregression have different ar_timestep and non-zero covariance')
+@@ -98,7 +102,6 @@
+ 
+         md = checkfield(md, 'fieldname', 'stochasticforcing.isstochasticforcing', 'values', [0, 1])
+         md = checkfield(md, 'fieldname', 'stochasticforcing.fields', 'numel', num_fields, 'cell', 1, 'values', self.supportedstochforcings())
+-        #md = checkfield(md, 'fieldname', 'stochasticforcing.dimensions', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [num_fields]) # specific dimension for each field; NOTE: As opposed to MATLAB implementation, pass list
+         md = checkfield(md, 'fieldname', 'stochasticforcing.covariance', 'NaN', 1, 'Inf', 1, 'size', [size_tot, size_tot])  # global covariance matrix
+         md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
+         if (checkdefaults):
+@@ -120,10 +123,10 @@
+         if not self.isstochasticforcing:
+             return md
+         else:
+-            #Retrieve dimensionality of each field
++            # Retrieve dimensionality of each field
+             dimensions = self.defaultdimension * np.ones(num_fields)
+             for ind, field in enumerate(self.fields):
+-                #Checking for specific dimensions
++                # Checking for specific dimensions
+                 if (field == 'SMBautoregression'):
+                     dimensions[ind] = md.smb.num_basins
+                 if (field == 'FrontalForcingsRignotAutoregression'):
+@@ -130,7 +133,7 @@
+                     dimensions[ind] = md.frontalforcings.num_basins
+ 
+             # Scaling covariance matrix (scale column-by-column and row-by-row)
+-            scaledfields = ['DefaultCalving', 'SMBautoregression']  # list of fields that need scaling * 1/yts
++            scaledfields = ['DefaultCalving', 'SMBautoregression'] # list of fields that need scaling * 1/yts
+             tempcovariance = np.copy(self.covariance)
+             for i in range(num_fields):
+                 if self.fields[i] in scaledfields:
+@@ -139,7 +142,7 @@
+                         tempcovariance[row, :] = 1 / yts * tempcovariance[row, :]
+                     for col in inds:  # scale columns corresponding to scaled field
+                         tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
+-            #Set dummy default_id vector if defaults not used
++            # Set dummy default_id vector if defaults not used
+             if np.isnan(self.default_id):
+                 self.default_id = np.zeros(md.mesh.numberofelements)
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26660-26661.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26660-26661.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26660-26661.diff	(revision 26740)
@@ -0,0 +1,368 @@
+Index: ../trunk-jpl/src/m/classes/calvingdev2.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/calvingdev2.m	(revision 26660)
++++ ../trunk-jpl/src/m/classes/calvingdev2.m	(revision 26661)
+@@ -41,8 +41,8 @@
+ 			%Early return
+ 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+ 
+-			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1);
+-			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
++			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','calving.height_above_floatation','<=',0);
+ 		end % }}}
+ 		function disp(self) % {{{
+Index: ../trunk-jpl/src/m/classes/calvingvonmises.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/calvingvonmises.m	(revision 26660)
++++ ../trunk-jpl/src/m/classes/calvingvonmises.m	(revision 26661)
+@@ -43,8 +43,8 @@
+ 			%Early return
+ 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+ 
+-			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1);
+-			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
++			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1);
++			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1);
+ 			md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
+ 		end % }}}
+ 		function disp(self) % {{{
+Index: ../trunk-jpl/src/m/coordsystems/laea.py
+===================================================================
+--- ../trunk-jpl/src/m/coordsystems/laea.py	(revision 26660)
++++ ../trunk-jpl/src/m/coordsystems/laea.py	(revision 26661)
+@@ -1,6 +1,5 @@
+ def laea(lat, long): #{{{
+-    '''
+-    LAEA - Lambert Azimuthal Equal Area projection at lat, long projection 
++    """LAEA - Lambert Azimuthal Equal Area projection at lat, long projection 
+     center.
+ 
+         Usage:
+@@ -9,7 +8,7 @@
+         Example:
+             string = laea(45, -90)
+             return string = '+proj=laea +lat_0=45 +lon_0=-90 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'
+-    '''
++    """
+ 
+     return '+proj=laea +lat_0={} +lon_0={} +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'.format(lat, long)
+ #}}}
+Index: ../trunk-jpl/src/m/modules/ExpToLevelSet.py
+===================================================================
+--- ../trunk-jpl/src/m/modules/ExpToLevelSet.py	(revision 26660)
++++ ../trunk-jpl/src/m/modules/ExpToLevelSet.py	(revision 26661)
+@@ -29,7 +29,7 @@
+             #read contour from shapefile
+             contourname = shpread(contourname)
+ 
+-    # NOTE: This library does not currently exist! See TODO list in function 
++    # NOTE: This module does not currently exist! See TODO list in function 
+     #       header.
+     distance = ExpToLevelSet_python(x, y, contourname)
+ 
+Index: ../trunk-jpl/src/m/shp/shp2exp.m
+===================================================================
+--- ../trunk-jpl/src/m/shp/shp2exp.m	(revision 26660)
++++ ../trunk-jpl/src/m/shp/shp2exp.m	(revision 26661)
+@@ -1,5 +1,5 @@
+ function shp2exp(shpfilename,expfilename)
+-%SHP2EXP- transform shape file to Argus .exp file
++%SHP2EXP - transform shape file to Argus .exp file
+ %
+ %   Usage:
+ %      shp2exp(shpfilename,expfilename);
+Index: ../trunk-jpl/src/m/shp/shp2exp.py
+===================================================================
+--- ../trunk-jpl/src/m/shp/shp2exp.py	(revision 26660)
++++ ../trunk-jpl/src/m/shp/shp2exp.py	(revision 26661)
+@@ -1,13 +1,13 @@
++import os
+ import shapefile
+-import os
+ from expwrite import expwrite
+ 
+ 
+-def shp2exp(shapefilename, * expfilename):
+-    '''
+-    Convert a shapefile to an .exp file.  Optionally, expfilename can be
+-    specified to give a name for the .exp file to be created, otherwise the
+-    .exp file will have the same prefix as the .shp file.
++def shp2exp(shapefilename, *expfilename):
++    """SHP2EXP - Convert a shapefile to an Argus .exp file. Optionally, 
++    expfilename can be specified to give a name for the .exp file to be 
++    created, otherwise the .exp file will have the same prefix as the .shp 
++    file.
+ 
+     Usage:
+         shp2exp(shapefilename)
+@@ -14,12 +14,14 @@
+         shp2exp(shapefilename, expfilename)
+ 
+     Examples:
+-        shp2exp('Domain.shp') % creates Domain.exp
+-        shp2exp('Domain.shp', 'DomainForISSM.exp')
+-    '''
++        shp2exp('Domain.shp') # Creates Domain.exp
++        shp2exp('Domain.shp', 'Domain.exp')
+ 
++    See also EXPMASTER, EXPDOC
++    """
++
+     if not os.path.exists(shapefilename):
+-        raise IOError("shp2exp error message: file '%s' not found!" % shapefilename)
++        raise IOError('shp2exp error message: file {} not found!'.format(shapefilename))
+     if not len(expfilename):
+         expfile = os.path.splitext(shapefilename)[0] + '.exp'
+     else:
+@@ -32,19 +34,19 @@
+     y = []
+     for i in range(len(shp.shapes())):
+         geom = shp.shapes()[i].shapeType
+-        if geom == 5:  # polygon
++        if geom == 5: # polygon
+             expdict['closed'] = 1
+             tmpx = [p[0] for p in shp.shapes()[i].points]
+             tmpy = [q[1] for q in shp.shapes()[i].points]
+             x.append(tmpx)
+             y.append(tmpy)
+-        elif geom == 3:  # line
++        elif geom == 3: # line
+             expdict['closed'] = 0
+             tmpx = [p[0] for p in shp.shapes()[i].points]
+             tmpy = [q[1] for q in shp.shapes()[i].points]
+             x.append(tmpx)
+             y.append(tmpy)
+-        elif geom == 1:  # point
++        elif geom == 1: # point
+             expdict['closed'] = 0
+             x.append(shp.shapes()[i].points[0][0])
+             y.append(shp.shapes()[i].points[0][1])
+Index: ../trunk-jpl/src/m/solve/loadresultsfromcluster.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26660)
++++ ../trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 26661)
+@@ -21,6 +21,11 @@
+     Usage:
+         md = loadresultsfromcluster(md)
+         md = loadresultsfromcluster(md, 'runtimename', runtimename)
++
++        Options include: 'runtimename', 'nolog'
++
++    Example:
++        md = loadresultsfromcluster(md, 'runtimename', 'test101-06-15-2021-13-24-18-4883')
+     """
+ 
+     # Process options
+Index: ../trunk-jpl/src/m/solvers/asmoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmoptions.m	(revision 26660)
++++ ../trunk-jpl/src/m/solvers/asmoptions.m	(revision 26661)
+@@ -1,5 +1,5 @@
+ function asm=asmoptions(varargin)
+-%ASMOPTIONS - return Additive Schwartz Method petsc options
++%ASMOPTIONS - return Additive Schwartz Method PETSc options
+ %
+ %   Usage:
+ %      options=asmoptions;
+Index: ../trunk-jpl/src/m/solvers/asmoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmoptions.py	(revision 26660)
++++ ../trunk-jpl/src/m/solvers/asmoptions.py	(revision 26661)
+@@ -2,24 +2,27 @@
+ from pairoptions import pairoptions
+ 
+ def asmoptions(*args):
+-    #ASMOPTIONS - return ASM petsc options
+-    #
+-    #   Usage:
+-    #      options = asmoptions
++    """ASMOPTIONS - Return Additive Schwartz Method PETSc options
+ 
+-    #retrieve options provided in *args
++    Usage:
++        options = asmoptions
++    """
++
++    # Retrieve options provided in *args
+     arguments = pairoptions(*args)
+ 
+-    options = [['toolkit', 'petsc'],
+-               ['mat_type', 'mpiaij'],
+-               ['ksp_type', 'gmres'],
+-               ['pc_type', 'asm'],
+-               ['sub_pc_type', 'lu'],
+-               ['pc_asm_overlap', 3],
+-               ['ksp_max_it', 100],
+-               ['ksp_rtol', 1e-30]]
++    options = [
++        ['toolkit', 'petsc'],
++        ['mat_type', 'mpiaij'],
++        ['ksp_type', 'gmres'],
++        ['pc_type', 'asm'],
++        ['sub_pc_type', 'lu'],
++        ['pc_asm_overlap', 3],
++        ['ksp_max_it', 100],
++        ['ksp_rtol', 1e-30]
++    ]
+ 
+-    #now, go through our arguments, and write over default options.
++    # Now, go through our arguments, and write over default options
+     for i in range(len(arguments.list)):
+         arg1 = arguments.list[i][0]
+         arg2 = arguments.list[i][1]
+@@ -32,7 +35,7 @@
+                 found = 1
+                 break
+         if not found:
+-            #this option did not exist, add it:
++            # This option did not exist; add it
+             options.append([arg1, arg2])
+ 
+     asmoptions = OrderedDict()
+Index: ../trunk-jpl/src/m/solvers/asmstokesoptions.m
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmstokesoptions.m	(revision 26660)
++++ ../trunk-jpl/src/m/solvers/asmstokesoptions.m	(revision 26661)
+@@ -1,8 +1,8 @@
+-function asm=asmoptions(varargin)
+-%ASMOPTIONS - return Additive Schwartz Method petsc options
++function asm=asmstokesoptions(varargin)
++%ASMSTOKESOPTIONS - return Additive Schwartz Method Stokes PETSc options
+ %
+ %   Usage:
+-%      options=asmoptions;
++%      options=asmstokesoptions;
+ 
+ %retrieve options provided in varargin
+ options=pairoptions(varargin{:});
+Index: ../trunk-jpl/src/m/solvers/asmstokesoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/solvers/asmstokesoptions.py	(nonexistent)
++++ ../trunk-jpl/src/m/solvers/asmstokesoptions.py	(revision 26661)
+@@ -0,0 +1,46 @@
++from collections import OrderedDict
++from pairoptions import pairoptions
++
++def asmstokesoptions(*args):
++    """ASMSTOKESOPTIONS - Return Additive Schwartz Method Stokes PETSc options
++
++    Usage:
++        options = asmstokesoptions
++    """
++
++    # Retrieve options provided in *args
++    arguments = pairoptions(*args)
++
++    options = [
++        ['toolkit', 'petsc'],
++        ['mat_type', 'mpiaij'],
++        ['ksp_type', 'gmres'],
++        ['pc_type', 'asm'],
++        ['sub_pc_type', 'lu'],
++        ['pc_asm_overlap', 1], # COMSOL's default
++        ['ksp_max_it', 100],
++        ['ksp_rtol', 1e-7], # Tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
++        ['ksp_atol', 1e-10] # Tuned for best performance and to fit ISMIP-HOM-C 5km with MUMPS
++    ]
++
++    # Now, go through our arguments, and write over default options
++    for i in range(len(arguments.list)):
++        arg1 = arguments.list[i][0]
++        arg2 = arguments.list[i][1]
++        found = 0
++        for j in range(len(options)):
++            joption = options[j][0]
++            if joption == arg1:
++                joption[1] = arg2
++                options[j] = joption
++                found = 1
++                break
++        if not found:
++            # This option did not exist; add it
++            options.append([arg1, arg2])
++
++    asmoptions = OrderedDict()
++    for j in range(len(options)):
++        asmoptions[options[j][0]]=options[j][1]
++
++    return asmoptions
+Index: ../trunk-jpl/src/m/exp/expwrite.py
+===================================================================
+--- ../trunk-jpl/src/m/exp/expwrite.py	(revision 26660)
++++ ../trunk-jpl/src/m/exp/expwrite.py	(revision 26661)
+@@ -2,32 +2,31 @@
+ 
+ 
+ def expwrite(contours, filename):
+-    """
+-    EXPWRITE - write an Argus file from a dictionary given in input
++    """EXPWRITE - write an Argus file from a dictionary given in input
+ 
+-       This routine writes an Argus file from a dict containing the fields:
+-       x and y of the coordinates of the points.
+-       The first argument is the list containing the points coordinates
+-       and the second one the file to be written.
++    This routine writes an Argus file from a dict containing the fields:
++    x and y of the coordinates of the points.
++    The first argument is the list containing the points coordinates and the 
++    second one the file to be written.
+ 
+-       Usage:
+-          expwrite(contours, filename)
++    Usage:
++        expwrite(contours, filename)
+ 
+-       Example:
+-          expwrite(coordstruct, 'domainoutline.exp')
++    Example:
++        expwrite(coordstruct, 'domainoutline.exp')
+ 
+-       See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
++    See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+     """
+ 
+     fid = open(filename, 'w')
+     for x, y in zip(contours['x'], contours['y']):
+-        #if np.size(contour['x']) != np.size(contour['y']):
+         if len(x) != len(y):
+-            raise RuntimeError("contours x and y coordinates must be of identical size")
++            raise RuntimeError('contours x and y coordinates must be of identical size')
++
+         if 'name' in contours:
+-            fid.write("%s%s\n" % ('  # Name:', contours['name']))
++            fid.write('{}{}\n'.format('# Name:', contours['name']))
+         else:
+-            fid.write("%s%s\n" % ('  # Name:', filename))
++            fid.write('{}{}\n'.format('# Name:', filename))
+ 
+         #Add density if it's not there FIXME what is this ever used for?
+         #if 'density' not in contours:
+@@ -34,14 +33,18 @@
+         #    contours['density'] = 1
+         density = 1
+ 
+-        fid.write("%s\n" % '  # Icon:0')
+-        fid.write("%s\n" % '  # Points Count Value')
+-    #fid.write("%i %f\n" % (np.size(contour['x']), contour['density']))
+-        fid.write("%i %f\n" % (np.size(x), density))
+-        fid.write("%s\n" % '  # X pos Y pos')
+-    #for x, y in zip(contour['x'], contour['y']):
++        fid.write('{}\n'.format('## Icon:0'))
++        fid.write('{}\n'.format('# Points Count Value')
++        if 'density' in contours:
++            if isinstance(contours['density'], int):
++                fid.write('{} {}\n'.format(np.size(x), density))
++            else:
++                fid.write('{} {}\n'.format(np.size(x), 1.))
++        else:
++            fid.write('{} {}\n'.format(np.size(x), 1.))
++        fid.write('{}\n'.format('# X pos Y pos'))
+         for xi, yi in zip(x, y):
+-            fid.write("%10.10f %10.10f\n" % (xi, yi))
+-        fid.write("\n")
++            fid.write('%10.10f %10.10f\n' % (xi, yi))
++        fid.write('\n')
+ 
+     fid.close()
Index: /issm/oecreview/Archive/25834-26739/ISSM-26661-26662.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26661-26662.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26661-26662.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/src/m/exp/expwrite.py
+===================================================================
+--- ../trunk-jpl/src/m/exp/expwrite.py	(revision 26661)
++++ ../trunk-jpl/src/m/exp/expwrite.py	(revision 26662)
+@@ -28,16 +28,11 @@
+         else:
+             fid.write('{}{}\n'.format('# Name:', filename))
+ 
+-        #Add density if it's not there FIXME what is this ever used for?
+-        #if 'density' not in contours:
+-        #    contours['density'] = 1
+-        density = 1
+-
+         fid.write('{}\n'.format('## Icon:0'))
+-        fid.write('{}\n'.format('# Points Count Value')
++        fid.write('{}\n'.format('# Points Count Value'))
+         if 'density' in contours:
+             if isinstance(contours['density'], int):
+-                fid.write('{} {}\n'.format(np.size(x), density))
++                fid.write('{} {}\n'.format(np.size(x), contours['density']))
+             else:
+                 fid.write('{} {}\n'.format(np.size(x), 1.))
+         else:
Index: /issm/oecreview/Archive/25834-26739/ISSM-26662-26663.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26662-26663.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26662-26663.diff	(revision 26740)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/src/m/plot/radarpower.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/radarpower.m	(revision 26662)
++++ ../trunk-jpl/src/m/plot/radarpower.m	(revision 26663)
+@@ -40,11 +40,13 @@
+ 				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_200m.tif',...
+ 					'/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif',...
+ 					'/totten_1/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_200m.tif',...
++					'./amm125m_v2_200m.tif',...
+ 					};
+ 			else
+ 				paths = {'/Users/larour/ModelData/MosaicTiffRsat/amm125m_v2_1km.tif',...
+ 					'/home/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif',...
+ 					'/totten_1/ModelData/Antarctica/MosaicTiffRsat/amm125m_v2_1km.tif',...
++					'./amm125m_v2_1km.tif',...
+ 					};
+ 			end
+ 	elseif md.mesh.epsg==3413,   %Greenland 
+@@ -52,6 +54,7 @@
+ 			paths = {'/u/astrid-r1b/ModelData/MOG/mog100_r2_hp1.tif',...
+ 				'/home/ModelData/Greenland/MOG/mog100_r2_hp1.tif',...
+ 				'/totten_1/ModelData/Greenland/MOG/mog100_r2_hp1.tif',...
++				'./mog100_r2_hp1.tif',...
+ 				};
+ 		else
+ 			paths = {'/u/astrid-r1b/ModelData/MOG/mog500_r2_hp1.tif',...
+@@ -58,6 +61,7 @@
+ 				'/home/ModelData/Greenland/MOG/mog500_r2_hp1.tif',...
+ 				'/totten_1/ModelData/Greenland/MOG/mog500_r2_hp1.tif',...
+ 				'/Users/larour/ModelData/MOG/mog500_r2_hp1.tif',...
++				'./mog500_r2_hp1.tif',...
+ 				};
+ 		end
+ 	else
Index: /issm/oecreview/Archive/25834-26739/ISSM-26663-26664.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26663-26664.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26663-26664.diff	(revision 26740)
@@ -0,0 +1,587 @@
+Index: ../trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 26663)
++++ ../trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 26664)
+@@ -53,10 +53,6 @@
+ C o Include/exclude phi_hyd calculation code
+ #define INCLUDE_PHIHYD_CALCULATION_CODE
+ 
+-C o Include/exclude sound speed calculation code
+-C o (Note that this is a diagnostic from Del Grasso algorithm, not derived from EOS)
+-#undef INCLUDE_SOUNDSPEED_CALC_CODE
+-
+ C-- Vertical mixing code options:
+ 
+ C o Include/exclude call to S/R CONVECT
+@@ -77,10 +73,6 @@
+ C   near surface & bottom for too thin grid-cell
+ #undef EXCLUDE_PCELL_MIX_CODE
+ 
+-C o Exclude/allow to use isotropic 3-D Smagorinsky viscosity as diffusivity
+-C   for tracers (after scaling by constant Prandtl number)
+-#undef ALLOW_SMAG_3D_DIFFUSIVITY
+-
+ C-- Time-stepping code options:
+ 
+ C o Include/exclude combined Surf.Pressure and Drag Implicit solver code
+@@ -92,9 +84,6 @@
+ C o Include/exclude AdamsBashforth-3rd-Order code
+ #undef ALLOW_ADAMSBASHFORTH_3
+ 
+-C o Include/exclude Quasi-Hydrostatic Stagger Time-step AdamsBashforth code
+-#undef ALLOW_QHYD_STAGGER_TS
+-
+ C-- Model formulation options:
+ 
+ C o Allow/exclude "Exact Convervation" of fluid in Free-Surface formulation
+@@ -104,9 +93,6 @@
+ 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 Disable code for rStar coordinate and/or code for Sigma coordinate
+-c#define DISABLE_RSTAR_CODE
+-c#define DISABLE_SIGMA_CODE
+ 
+ C o Include/exclude nonHydrostatic code
+ #undef ALLOW_NONHYDROSTATIC
+@@ -116,7 +102,7 @@
+ 
+ C-- Algorithm options:
+ 
+-C o Include/exclude code for Non Self-Adjoint (NSA) conjugate-gradient solver
++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
+@@ -130,42 +116,11 @@
+ 
+ C-- Retired code options:
+ 
+-C o ALLOW isotropic scaling of harmonic and bi-harmonic terms when
+-C   using an locally isotropic spherical grid with (dlambda) x (dphi*cos(phi))
+-C *only for use on a lat-lon grid*
+-C   Setting this flag here affects both momentum and tracer equation unless
+-C   it is set/unset again in other header fields (e.g., GAD_OPTIONS.h).
+-C   The definition of the flag is commented to avoid interference with
+-C   such other header files.
+-C   The preferred method is specifying a value for viscAhGrid or viscA4Grid
+-C   in data which is then automatically scaled by the grid size;
+-C   the old method of specifying viscAh/viscA4 and this flag is provided
+-C   for completeness only (and for use with the adjoint).
+-c#define ISOTROPIC_COS_SCALING
+-
+-C o This flag selects the form of COSINE(lat) scaling of bi-harmonic term.
+-C *only for use on a lat-lon grid*
+-C   Has no effect if ISOTROPIC_COS_SCALING is undefined.
+-C   Has no effect on vector invariant momentum equations.
+-C   Setting this flag here affects both momentum and tracer equation unless
+-C   it is set/unset again in other header fields (e.g., GAD_OPTIONS.h).
+-C   The definition of the flag is commented to avoid interference with
+-C   such other header files.
+-c#define COSINEMETH_III
+-
+-C o Use "OLD" UV discretisation near boundaries (*not* recommended)
+-C   Note - only works with pkg/mom_fluxform and "no_slip_sides=.FALSE."
+-C          because the old code did not have no-slip BCs
+-#undef OLD_ADV_BCS
+-
+ 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 o Use old EXTERNAL_FORCING_U,V,T,S subroutines (for backward compatibility)
+-#undef USE_OLD_EXTERNAL_FORCING
+-
+ C-- Other option files:
+ 
+ C o Execution environment support options
+Index: ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26663)
++++ ../trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 26664)
+@@ -22,7 +22,6 @@
+       PARAMETER( nRegions = 2 , sizRegMsk = 1 , nStats = 4 )
+       PARAMETER( diagSt_size = 10*Nr )
+ 
+-
+ CEH3 ;;; Local Variables: ***
+ CEH3 ;;; mode:fortran ***
+ CEH3 ;;; End: ***
+Index: ../trunk-jpl/test/MITgcm/code_4003/SIZE.h
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26663)
++++ ../trunk-jpl/test/MITgcm/code_4003/SIZE.h	(revision 26664)
+@@ -42,14 +42,14 @@
+       INTEGER Ny
+       INTEGER Nr
+       PARAMETER (
+-     &           sNx =   1,
+-     &           sNy =  50,
++     &           sNx =   3,
++     &           sNy =  25,
+      &           OLx =   3,
+      &           OLy =   3,
+      &           nSx =   1,
+      &           nSy =   1,
+      &           nPx =   1,
+-     &           nPy =   4,
++     &           nPy =   8,
+      &           Nx  = sNx*nSx*nPx,
+      &           Ny  = sNy*nSy*nPy,
+      &           Nr  =  90)
+Index: ../trunk-jpl/test/MITgcm/input_4003/data
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data	(revision 26663)
++++ ../trunk-jpl/test/MITgcm/input_4003/data	(revision 26664)
+@@ -61,24 +61,15 @@
+ 
+ #Time stepping parameters
+  &PARM03
+-#nIter0=2880,
+-#nTimeSteps=288,
+-#startTime=0.,
++ startTime=0.,
++ nTimeSteps=192,
+ #endTime=2592000.,
+- deltaT=300.0,
++ deltaT=450.0,
+  forcing_In_AB  = .FALSE.,
+  abEps=0.1,
+  pChkptFreq= 2592000.,
+  chkptFreq = 2592000.,
+  dumpFreq =  86400.,
+- monitorFreq= 7200.,
+- monitorSelect=1,
+- monitorFreq=1800.,
+- dumpFreq = 10800.,
+-#- for testing purpose:
+- nIter0=2898,
+- nTimeSteps=20,
+-#dumpFreq = 1200.,
+  monitorFreq=1.,
+  &
+ 
+@@ -87,7 +78,7 @@
+  usingCartesianGrid=.FALSE.,
+  usingSphericalPolarGrid=.TRUE.,
+  delR=90*10.,
+- delX=1*.125,
++ delX=3*.125,
+  delY=200*.0078125,
+  xgOrigin = 0.,
+  ygOrigin = -75.5,
+Index: ../trunk-jpl/test/MITgcm/input_4003/data.diagnostics
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data.diagnostics	(nonexistent)
++++ ../trunk-jpl/test/MITgcm/input_4003/data.diagnostics	(revision 26664)
+@@ -0,0 +1,69 @@
++# Diagnostic Package Choices
++#-----------------
++# for each output-stream:
++#  filename(n) : prefix of the output file name (only 8.c long) for outp.stream n
++#  frequency(n):< 0 : write snap-shot output every |frequency| seconds
++#               > 0 : write time-average output every frequency seconds
++#  timePhase(n)     : write at time = timePhase + multiple of |frequency|
++#  averagingFreq(n) : frequency (in s) for periodic averaging interval
++#  averagingPhase(n): phase     (in s) for periodic averaging interval
++#  repeatCycle(n)   : number of averaging intervals in 1 cycle
++#  levels(:,n) : list of levels to write to file (Notes: declared as REAL)
++#                 when this entry is missing, select all common levels of this list
++#  fields(:,n) : list of diagnostics fields (8.c) (see "available_diagnostics.log"
++#                 file for the list of all available diag. in this particular config)
++#-----------------
++ &DIAGNOSTICS_LIST
++# diag_mnc     = .FALSE.,
++  dumpAtLast   = .TRUE.,
++  fields(1:13,1) = 'ETAN    ','RSURF   ','oceTAUX ','oceTAUY ',
++                   'oceQnet ','oceFWflx','MXLDEPTH',
++                   'SHIfwFlx','SHIhtFlx','SHIgammT','SHIgammS',
++                   'SHI_mass','SHIuStar',
++#                  'surForcT','surForcS','TFLUX   ','SFLUX   ','oceFreez',
++#                  'TRELAX  ','SRELAX  ',
++#  fields(1,1)='ETAN'
++   filename(1) = 'surfDiag',
++   frequency(1) =  86400.,
++#-
++  fields(1:10,2) = 'UVEL    ','VVEL    ','WVEL    ',
++                   'THETA   ','SALT    ','RHOAnoma', 'CONVADJ'
++                   'hFactorC','hFactorW','hFactorS',
++   filename(2) = 'dynDiag',
++  fileFlags(2) = '  h     ',
++  frequency(2) =  86400.,
++#-
++  fields(1:7,3) =  'ETAN    ','RSURF   ',
++                   'oceQnet ','oceFWflx',
++                   'SHIfwFlx','SHIhtFlx','SHIuStar',
++#  filename(3) = 'surfInst',
++  frequency(3) =  -86400.,
++  timePhase(3) = 0.,
++#-
++  fields(1:8,4)  = 'UVEL    ','VVEL    ','WVEL    ',
++                   'THETA   ','SALT    ',
++                   'hFactorC','hFactorW','hFactorS',
++#  filename(4) = 'dynInst',
++  frequency(4) =  -86400.,
++  timePhase(4) = 0.,
++ &
++
++#--------------------
++# Parameter for Diagnostics of per level statistics:
++#--------------------
++#  diagSt_mnc (logical): write stat-diags to NetCDF files (default=diag_mnc)
++#  diagSt_regMaskFile : file containing the region-mask to read-in
++#  nSetRegMskFile   : number of region-mask sets within the region-mask file
++#  set_regMask(i)   : region-mask set-index that identifies the region "i"
++#  val_regMask(i)   : region "i" identifier value in the region mask
++#--for each output-stream:
++#  stat_fName(n) : prefix of the output file name (max 80c long) for outp.stream n
++#  stat_freq(n):< 0 : write snap-shot output every |stat_freq| seconds
++#               > 0 : write time-average output every stat_freq seconds
++#  stat_phase(n)    : write at time = stat_phase + multiple of |stat_freq|
++#  stat_region(:,n) : list of "regions" (default: 1 region only=global)
++#  stat_fields(:,n) : list of selected diagnostics fields (8.c) in outp.stream n
++#                (see "available_diagnostics.log" file for the full list of diags)
++#--------------------
++ &DIAG_STATIS_PARMS
++ &
+Index: ../trunk-jpl/test/MITgcm/input_4003/data.obcs
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data.obcs	(nonexistent)
++++ ../trunk-jpl/test/MITgcm/input_4003/data.obcs	(revision 26664)
+@@ -0,0 +1,32 @@
++# Open-boundaries
++ &OBCS_PARM01
++ OB_Jnorth=3*200,
++ useOBCSprescribe=.TRUE.,
++#OBWuFile='uVel_obc.bin',
++ OBNvFile='vVel_obc.bin',
++ OBNtFile='temp_obc.bin',
++ OBNsFile='salt_obc.bin',
++ OBCS_u1_adv_T=1,
++ OBCS_u1_adv_S=1,
++#--
++ useOBCSsponge=.TRUE.,
++ useLinearSponge = .TRUE.,
++#- default is =T for these specific switches:
++#OBCSsponge_VatNS=.TRUE.,
++ OBCSsponge_UatNS=.FALSE.,
++#--
++ OBCSprintDiags = .FALSE.,
++ &
++
++# Orlanski parameters (skipped with #undef ALLOW_ORLANSKI)
++#&OBCS_PARM02
++#Cmax=0.45,
++#cVelTimeScale=1000.,
++#&
++
++# Sponge layer parameters
++ &OBCS_PARM03
++ spongeThickness = 10,
++ Vrelaxobcsbound = 864000.,
++ Urelaxobcsbound = 864000.,
++ &
+Index: ../trunk-jpl/test/MITgcm/input_4003/data.pkg
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data.pkg	(nonexistent)
++++ ../trunk-jpl/test/MITgcm/input_4003/data.pkg	(revision 26664)
+@@ -0,0 +1,6 @@
++# Packages (lines beginning "#" are comments)
++ &PACKAGES
++ useOBCS=.TRUE.,
++ useShelfIce=.TRUE.,
++ useDiagnostics = .TRUE.,
++ &
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26663)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26664)
+@@ -4,13 +4,12 @@
+ %Script control parameters
+ steps=1:12;
+ steps=1:6;
+-steps=7;
+ final_time=1/365;
+ 
+ %To download and recompile MITgcm from scratch:
+-%!rm -rf ${ISSM_DIR}/test/MITgcm/install
+-%!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
+-%!rm -rf Models
++!rm -rf ${ISSM_DIR}/test/MITgcm/install
++!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
++!rm -rf Models
+ 
+ %Organizer
+ !mkdir Models
+@@ -20,15 +19,15 @@
+ 
+ % {{{ Parameters:
+ if perform(org,'Parameters'),
+-	Nx=1; %number of longitude cells
++	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=4; %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
++	nPy=8; %number of MITgcm processes to use in y direction
++	xgOrigin=0; %origin of longitude
++	ygOrigin=-75.5; %origin of latitude
++	dLong=.125; %longitude grid spacing
++	dLat=dLong/16; %latitude grid spacing
+ 	delZ=10; %thickness of vertical levels
+ 	icefront_position_ratio=.75;
+ 	ice_thickness=1000;
+@@ -46,7 +45,7 @@
+ 	mlTheta  = -1.9; % open boundary potential temperature (deg C)
+ 	obcUvel  = -0.1; % open boundary velocity (m/s)
+ 
+-	MITgcmDeltaT=600; % MITgcm time step in seconds
++	MITgcmDeltaT=450; % MITgcm time step in seconds
+ 	y2s=31536000; % year to seconds conversion, i.e., seconds per year
+ 
+ 	% start_time and time_step
+@@ -54,7 +53,7 @@
+ 	time_step=1/(365*24); % coupling interval in decimal years
+ 	async_step_MITgcm_multiplier=1; % used to reduce run time for MItgcm
+ 
+-	% bedrock/bathymetry
++	% bathymetry
+ 	hmax=1000;
+ 	trough_depth=200;
+ 	deltah=300;
+@@ -75,26 +74,118 @@
+ if perform(org,'Bathymetry'),
+ 
+     loaddata(org,'Parameters');
+-    %create lat,long
++
++    v0 = 2e3;
++    h0 = 800;
++
++    hfacMin = 0.2;
++
++    eos = 'jmd95z';
++    prec = 'real*8';
++
++    %create lat,lon
++    latg = ygOrigin+[0:Ny-1]*dLat;
++    latc = latg+dLat/2;
++    long = xgOrigin+[0:Nx-1]*dLong;
++    lonc = long+dLong/2;
++    zC=-delZ*([1:Nz]-0.5);
++    zF=-delZ*[0:Nz];
++            
+     lat=(ygOrigin+dLat/2):dLat:(ygOrigin+Ny*dLat);
+-    long=(xgOrigin+dLong/2):dLong:(xgOrigin+Nx*dLong);
+-    [lat long]=meshgrid(lat,long);
++    lon=(xgOrigin+dLong/2):dLong:(xgOrigin+Nx*dLong);
++    [lat lon]=meshgrid(lat,lon);
+ 
+-    longmin=min(long(:));
+-    longmax=max(long(:));
++    longmin=min(lon(:));
++    longmax=max(lon(:));
+     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));
++% Gravity
++gravity= 9.81;
++rhoConst= 1030;
+ 
++% Nominal depth of model (meters)
++H = -900;		%water depth in the ice shelf cavity
++Hmin = -600;		% deepest point of cavern		
++Hmax = -300;		% shallowest point of cavern
++jEnd = Ny*3/4;		 % where ice-shelf ends
++dHdy = (Hmax-Hmin)/dLat/(jEnd-2); %Slope of ice shelf
++
++    %create bathymetry:
++    bathymetry = ones(Nx,Ny)*H;
++    bathymetry(:,1) = 0;
++
+     %save bathymetry file for MITgcm
+-    bathymetry=bedrock-sea_level;
+-    savedata(org,lat,long,bathymetry);
++    savedata(org,lat,lon,bathymetry);
+ 
++j2=jEnd+1;
++hIce=bathymetry;
++for i=1:Nx
++    hIce(i,:)=Hmin+dHdy*[-1:Ny-2]*dLat;
++    hIce(i,1)=0; hIce(i,j2:Ny)=0;
+ end
++
++var=([1:Ny]-2)/(jEnd-2);
++dMdt_fy=bathymetry;
++for i=1:Nx
++    dMdt_fy(i,:)=-cos(pi*var);
++    dMdt_fy(i,1)=0; dMdt_fy(i,j2:Ny)=0;
++end
++
++regMsk=ones(Nx,Ny);
++regMsk(:,1)=0; regMsk(:,j2:Ny)=2;
++
++%- rate of change due to ice-stream dynamics
++rateDyn=rhoConst*0.1/3600;  sfx='r02';
++
++dMdt=rateDyn*dMdt_fy;
++
++dz = delZ*ones(1,Nz);
++zgp1 = [0,cumsum(dz)];
++zc = .5*(zgp1(1:end-1)+zgp1(2:end));
++zg = zgp1(1:end-1);
++dz = diff(zgp1);
++
++T_sfc = -1.9;
++T_bot = 2;
++del_T = (T_bot - T_sfc)/(59*delZ);
++tref=0*dz;
++for k = 1:Nz;
++    tref(k) = T_sfc + del_T*((k-20)*delZ);
++    tref(k)= max(T_sfc,min(tref(k),T_bot));
++end
++
++S_sfc = 34.2;
++S_bot = 34.7;
++del_S = (S_bot - S_sfc)/(59*delZ);
++sref=0*dz;
++for k = 1:Nz;
++    sref(k) = S_sfc + del_S*((k-20)*delZ);
++    sref(k)= max(S_sfc,min(sref(k),S_bot));
++end
++pEOS=-rhoConst*gravity*zC; % in Pa
++pEOS=pEOS*1.e-4; % in dBar
++rhoAn=densjmd95(sref,tref,pEOS);
++rhoAn=rhoAn-rhoConst;
++
++pF=-rhoConst*gravity*zF*1.e-4; % in dBar
++rhoUp=densjmd95(sref,tref,pF(2:end));
++rhoDw=densjmd95(sref,tref,pF(1:Nz));
++dRho=rhoUp(1:Nz-1)-rhoDw(2:Nz);
++NSq=-gravity*dRho/delZ/rhoConst;
++
++mnV=min(NSq); MxV=max(NSq); Avr=mean(NSq);
++
++zax=[1:Nz];
++
++v1=2.5e-2;
++var=1+Nz-2*zax; var=var/(Nz-1);
++vobc=v1*var;
++
++rhoAvr=rhoConst-1.345;
++mIce=-rhoAvr*hIce;
++
++end
+ % }}}
+ % {{{ IceSheetGeometry:
+ if perform(org,'IceSheetGeometry'),
+@@ -152,13 +243,52 @@
+     end
+     !\mkdir run
+     !\cp ../MITgcm/build/mitgcmuv run
+-    !\cp ../MITgcm/install/verification/shelfice_2d_remesh/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
++    
++    namF='bathy_flat.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,bathymetry,prec);fclose(fid);
++    
++    namF='shelficeTopo.Lin.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,hIce,prec);fclose(fid);
++    
++    namF='under_Ice_mask.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,regMsk,prec);fclose(fid);
++    
++    namF=sprintf('%s.%s.%s','shelfice_dMdt',sfx,'bin');
++    fid=fopen(namF,'w','b'); fwrite(fid,dMdt,prec);fclose(fid);
++
++    namF='temp_obc.bin';
++    tref=[tref; tref; tref];
++    fid=fopen(namF,'w','b'); fwrite(fid,tref,prec);fclose(fid);
++
++    namF='salt_obc.bin';
++    sref=[sref; sref; sref];
++    fid=fopen(namF,'w','b'); fwrite(fid,sref,prec);fclose(fid);
++
++    namF='vVel_obc.bin';
++    vobc=[vobc; vobc; vobc];
++    fid=fopen(namF,'w','b'); fwrite(fid,vobc,prec);fclose(fid);
++
++    var=zeros(Nx,Ny,Nz);
++    for i=1:Nx, for j=1:Ny
++            var(i,j,:)=tref(1,:);
++        end, end
++    namF='temp_ini.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
++
++    for i=1:Nx, for j=1:Ny
++            var(i,j,:)=sref(1,:);
++        end, end
++    namF='salt_ini.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
++
++    namF='shelficeMass.Lin.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,mIce,prec);fclose(fid);
++
+     eval(['!mpirun -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+-	 cd ..
++    cd ..
+ end
+ % }}}
+ 
+@@ -670,44 +800,3 @@
+ 	savemodel(org,md);
+ end
+ % }}}
+-
+-%Fields and tolerances to track changes
+-%fnm=['run/SHICE_fwFlux.0000011400.data'];
+-%melting_rate_1=readbin(fnm,[Nx Ny]);
+-%fnm=['run/SHICE_fwFlux.0000011450.data'];
+-%melting_rate_2=readbin(fnm,[Nx Ny]);
+-%fnm=['run/SHICE_fwFlux.0000011500.data'];
+-%melting_rate_3=readbin(fnm,[Nx Ny]);
+-%fnm=['run/SHICE_fwFlux.0000011550.data'];
+-%melting_rate_4=readbin(fnm,[Nx Ny]);
+-%field_names     ={'Base1','Melting1','Vx2','Vy2','Thickness2','Base2','MaskOceanLevelset2','FloatingiceMeltingRate2',...
+-%	'Melting2','Vx3','Vy3','Thickness3','Base3','MaskOceanLevelset3','FloatingiceMeltingRate3',...
+-%	'Melting3','Vx4','Vy4','Thickness4','Base4','MaskOceanLevelset4','FloatingiceMeltingRate4','Melting4'};
+-%field_tolerances={2e-13,1e-13,7e-13,7e-13,1e-13,1e-13,1e-13,1e-12,...
+-%	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12,...
+-%	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12, 1e-13 };
+-%field_values={...
+-%	(md.results.TransientSolution(1).Base),...
+-%	(melting_rate_1(:)),...
+-%	(md.results.TransientSolution(2).Vx),...
+-%	(md.results.TransientSolution(2).Vy),...
+-%	(md.results.TransientSolution(2).Thickness),...
+-%	(md.results.TransientSolution(2).Base),...
+-%	(md.results.TransientSolution(2).MaskOceanLevelset),...
+-%	(md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+-%	(melting_rate_2(:)),...
+-%	(md.results.TransientSolution(3).Vx),...
+-%	(md.results.TransientSolution(3).Vy),...
+-%	(md.results.TransientSolution(3).Thickness),...
+-%	(md.results.TransientSolution(3).Base),...
+-%	(md.results.TransientSolution(3).MaskOceanLevelset),...
+-%	(md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+-%	(melting_rate_3(:)),...
+-%	(md.results.TransientSolution(4).Vx),...
+-%	(md.results.TransientSolution(4).Vy),...
+-%	(md.results.TransientSolution(4).Thickness),...
+-%	(md.results.TransientSolution(4).Base),...
+-%	(md.results.TransientSolution(4).MaskOceanLevelset),...
+-%	(md.results.TransientSolution(4).BasalforcingsFloatingiceMeltingRate),...
+-%	(melting_rate_4(:)),...
+-%	};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26664-26665.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26664-26665.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26664-26665.diff	(revision 26740)
@@ -0,0 +1,339 @@
+Index: ../trunk-jpl/test/Archives/Archive543.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test543.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.m	(revision 26664)
++++ ../trunk-jpl/test/NightlyRun/test543.m	(revision 26665)
+@@ -1,4 +1,4 @@
+-%Test Name: PigTranFrontalforcingsrignotautoregression
++%Test Name: PigTranStochasticforcing
+ md=triangle(model(),'../Exp/Pig.exp',10000.);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+@@ -5,28 +5,48 @@
+ md=setflowequation(md,'SSA','all');
+ md.timestepping.start_time = 0;
+ md.timestepping.time_step  = 1;
+-md.timestepping.final_time = 25;
++md.timestepping.final_time = 10;
+ 
+-%separate domain in 2 basins
+-idbasin = zeros(md.mesh.numberofelements,1);
++%Basin separation TF
++idb_tf  = zeros(md.mesh.numberofelements,1);
+ iid1    = find(md.mesh.x<=-1.6e6);
+ for ii=1:md.mesh.numberofelements
+     for vertex=1:3
+         if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
+-            idbasin(ii) = 1;
++            idb_tf(ii) = 1;
+         end
+     end
+-    if idbasin(ii)==0 %no vertex was found in basin 1
+-        idbasin(ii) = 2;
++    if idb_tf(ii)==0 %no vertex was found in basin 1
++        idb_tf(ii) = 2;
+     end
+ end
++% Basin separation default
++idb_df = zeros(md.mesh.numberofelements,1);
++iid1   = find(md.mesh.x<=-1.62e6);
++for ii=1:md.mesh.numberofelements
++    for vertex=1:3
++        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
++            idb_df(ii) = 1;
++        end
++    end
++    if idb_df(ii)==0 %no vertex was found in basin 1
++        idb_df(ii) = 2;
++    end
++end
++% Dimensionalities
++nb_tf    = 2;
++nb_clv   = 2;
++nb_flmlt = 2;
+ 
+-%calving and frontalforcings parameters
++%Calving parameters
+ md.mask.ice_levelset = 1e4*(md.mask.ice_levelset + 0.5);
+-md.calving=calvingvonmises();
++md.calving.calvingrate = 0.3*ones(md.mesh.numberofvertices,1);
++md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
++md.levelset.migration_max = 10.0; %avoid fast advance/retreat of the front
++%Frontal forcing parameters
+ md.frontalforcings=frontalforcingsrignotautoregression();
+-md.frontalforcings.num_basins = 2;
+-md.frontalforcings.basin_id = idbasin;
++md.frontalforcings.num_basins           = nb_tf;
++md.frontalforcings.basin_id             = idb_tf;
+ md.frontalforcings.subglacial_discharge = 0.1*ones(md.mesh.numberofvertices,1);
+ md.frontalforcings.beta0                = [0.05,0.01]; %intercept values of TF in basins [C]
+ md.frontalforcings.beta1                = [0.001,0.0001]; %trend values of TF in basins [C/yr]
+@@ -35,57 +55,65 @@
+ md.frontalforcings.ar_timestep          = 2; %timestep of the autoregressive model [yr]
+ md.frontalforcings.phi                  = [[0.1,-0.1,0.01,-0.01];[0.2,-0.2,0.1,0.0]]; %autoregressive parameters
+ 
++% Floating Ice Melt parameters
++md.basalforcings.floatingice_melting_rate = 0.1*ones(md.mesh.numberofvertices,1);
++
++% Covariance matrix
++covtf       = 1e-4*eye(nb_tf);
++covclv      = 1e-1*eye(nb_clv);
++covclv(1,1) = 1/10*covclv(1,1);
++covflmlt    = 0.05*eye(nb_flmlt);
++covglob     = blkdiag(covtf,covclv,covflmlt);
++
+ %Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1;
+-md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'}];
+-md.stochasticforcing.covariance          = 1e-4*[[1.5,0.5];[0.5,0.4]]; %global covariance among- and between-fields
++md.stochasticforcing.fields              = [{'FrontalForcingsRignotAutoregression'},{'DefaultCalving'},{'FloatingMeltRate'}];
++md.stochasticforcing.defaultdimension    = 2;
++md.stochasticforcing.default_id          = idb_df;
++md.stochasticforcing.covariance          = covglob; %global covariance among- and between-fields
+ md.stochasticforcing.randomflag          = 0; %determines true/false randomness
+ 
+-md.transient.ismovingfront = 1;
+-md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+-md.levelset.migration_max = 1e10;
++md.transient.ismovingfront   = 1;
++md.transient.isgroundingline = 1;
+ 
+-md.transient.requested_outputs = {'default','CalvingMeltingrate'};
++md.transient.requested_outputs = {'default','CalvingCalvingrate','CalvingMeltingrate','BasalforcingsFloatingiceMeltingRate'};
+ md.cluster=generic('name',oshostname(),'np',2);
+ md=solve(md,'Transient');
+ 
+ %Fields and tolerances to track changes
+ field_names ={...
+-   'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1', 'CalvingMeltingrate1',...
+-   'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2', 'CalvingMeltingrate2',...
+-   'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10', 'CalvingMeltingrate10',...
++   'Vx1' ,'Vy1' ,'Vel1' ,'Thickness1' ,'MaskIceLevelset1' ,'CalvingCalvingrate1' ,'CalvingMeltingrate1' ,'BasalforcingsFloatingiceMeltingRate1',...
++   'Vx2' ,'Vy2' ,'Vel2' ,'Thickness2' ,'MaskIceLevelset2' ,'CalvingCalvingrate1' ,'CalvingMeltingrate2' ,'BasalforcingsFloatingiceMeltingRate2',...
++   'Vx10','Vy10','Vel10','Thickness10','MaskIceLevelset10','CalvingCalvingrate10','CalvingMeltingrate10','BasalforcingsFloatingiceMeltingRate10',...
+    };
+ field_tolerances={...
+-   1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,1e-9,...
+-   2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,1e-9,...
+-   2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-9,...
++   1e-11,2e-11,2e-11,1e-11,1e-9,1e-10,1e-10,1e-10,...
++   2e-11,1e-11,1e-11,9e-11,2e-9,1e-10,1e-10,1e-10,...
++   2e-10,1e-10,1e-10,1e-10,5e-9,1e-10,1e-10,1e-10,...
+    };
+ field_values={...
+    (md.results.TransientSolution(1).Vx),...
+    (md.results.TransientSolution(1).Vy),...
+    (md.results.TransientSolution(1).Vel),...
+-   (md.results.TransientSolution(1).Pressure),...
+-   (md.results.TransientSolution(1).Base),...
+-   (md.results.TransientSolution(1).Surface),...
+    (md.results.TransientSolution(1).Thickness),...
+    (md.results.TransientSolution(1).MaskIceLevelset),...
++   (md.results.TransientSolution(1).CalvingCalvingrate),...
+    (md.results.TransientSolution(1).CalvingMeltingrate),...
+-   (md.results.TransientSolution(2).Vx),...
+-   (md.results.TransientSolution(2).Vy),...
+-   (md.results.TransientSolution(2).Vel),...
+-   (md.results.TransientSolution(2).Pressure),...
+-   (md.results.TransientSolution(2).Base),...
+-   (md.results.TransientSolution(2).Surface),...
+-   (md.results.TransientSolution(2).Thickness),...
+-   (md.results.TransientSolution(2).MaskIceLevelset),...
+-   (md.results.TransientSolution(2).CalvingMeltingrate),...
+-   (md.results.TransientSolution(10).Vx),...
+-   (md.results.TransientSolution(10).Vy),...
+-   (md.results.TransientSolution(10).Vel),...
+-   (md.results.TransientSolution(10).Pressure),...
+-   (md.results.TransientSolution(10).Base),...
+-   (md.results.TransientSolution(10).Surface),...
+-   (md.results.TransientSolution(10).Thickness),...
+-   (md.results.TransientSolution(10).MaskIceLevelset),...
+-   (md.results.TransientSolution(10).CalvingMeltingrate),...
+-   };
++   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
++   (md.results.TransientSolution(5).Vx),...
++   (md.results.TransientSolution(5).Vy),...
++   (md.results.TransientSolution(5).Vel),...
++   (md.results.TransientSolution(5).Thickness),...
++   (md.results.TransientSolution(5).MaskIceLevelset),...
++   (md.results.TransientSolution(5).CalvingCalvingrate),...
++   (md.results.TransientSolution(5).CalvingMeltingrate),...
++   (md.results.TransientSolution(5).BasalforcingsFloatingiceMeltingRate),...
++	(md.results.TransientSolution(10).Vx),...
++	(md.results.TransientSolution(10).Vy),...
++	(md.results.TransientSolution(10).Vel),...
++	(md.results.TransientSolution(10).Thickness),...
++	(md.results.TransientSolution(10).MaskIceLevelset),...
++	(md.results.TransientSolution(10).CalvingCalvingrate),...
++	(md.results.TransientSolution(10).CalvingMeltingrate),...
++	(md.results.TransientSolution(10).BasalforcingsFloatingiceMeltingRate),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26664)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26665)
+@@ -1,7 +1,6 @@
+-#Test Name: PigTranFrontalforcingsrignotautoregression
++#Test Name: PigTranStochasticforcing
+ import numpy as np
+ 
+-from calvingvonmises import *
+ from frontalforcingsrignotautoregression import *
+ from socket import gethostname
+ from model import *
+@@ -18,25 +17,42 @@
+ md = setflowequation(md, 'SSA', 'all')
+ md.timestepping.start_time = 0
+ md.timestepping.time_step = 1
+-md.timestepping.final_time = 25
++md.timestepping.final_time = 10
+ 
+-# Separate domain in 2 basins
+-idbasin = np.zeros((md.mesh.numberofelements,))
++# Basin separation TF
++idb_tf = np.zeros((md.mesh.numberofelements,))
+ iid1 = np.where(md.mesh.x <= -1.6e6)[0]
+ for ii in range(md.mesh.numberofelements):
+     for vertex in range(3):
+         if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+-            idbasin[ii] = 1
++            idb_tf[ii] = 1
+     if idbasin[ii] == 0:  # no vertex was found in basin 1
+         for vertex in range(3):
+-            idbasin[ii] = 2
++            idb_tf[ii] = 2
++# Basin separation default
++idb_df = np.zeros((md.mesh.numberofelements,))
++iid1 = np.where(md.mesh.x <= -1.62e6)[0]
++for ii in range(md.mesh.numberofelements):
++    for vertex in range(3):
++        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++            idb_df[ii] = 1
++    if idbasin[ii] == 0:  # no vertex was found in basin 1
++        for vertex in range(3):
++            idb_df[ii] = 2
++#Dimensionalities
++nb_tf    = 2
++nb_clv   = 2
++nb_flmlt = 2
+ 
+-# Calving and frontalforcings parameters
++# Calving parameters
+ md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
+-md.calving = calvingvonmises()
++md.calving.calvingrate = 0.3*np.ones((md.mesh.numberofvertices,))
++md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
++md.levelset.migration_max = 10.0
++#Frontal forcing parameters
+ md.frontalforcings = frontalforcingsrignotautoregression()
+-md.frontalforcings.num_basins = 2
+-md.frontalforcings.basin_id = idbasin - 1  # NOTE: offset because of 1-based vertex indexing
++md.frontalforcings.num_basins = nb_tf
++md.frontalforcings.basin_id = idb_tf - 1  # NOTE: offset because of 1-based vertex indexing
+ md.frontalforcings.subglacial_discharge = 0.1 * np.ones((md.mesh.numberofvertices,))
+ md.frontalforcings.beta0 = np.array([[0.05, 0.01]])  # intercept values of TF in basins [C]
+ md.frontalforcings.beta1 = np.array([[0.001, 0.0001]])  # trend values of TF in basins [C/yr]
+@@ -44,60 +60,69 @@
+ md.frontalforcings.ar_order = 4
+ md.frontalforcings.ar_timestep = 2  # timestep of the autoregressive model [yr]
+ md.frontalforcings.phi = np.array([[0.1, -0.1, 0.01, -0.01], [0.2, -0.2, 0.1, 0.0]])  # autoregressive parameters
++#Floating Ice Melt parameters
++md.basalforcings.floatingice_melting_rate = 0.1*np.ones((md.mesh.numberofvertices,))
+ 
++#Covariance matrix
++covtf            = 1e-4*np.identity(nb_tf)
++covclv           = 1e-1*np.identity(nb_clv)
++covclv[0,0]      = 1/10*covclv[0,0]
++covflmlt         = 0.05*np.identity(nb_flmlt)
++covglob          = np.zeros([6,6])
++covglob[0:2,0:2] = covtf
++covglob[2:4,2:4] = covclv
++covglob[4:6,4:6] = covflmlt
++
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+-md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression']
++md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression','DefaultCalving','FloatingMeltRate']
++md.stochasticforcing.defauldimension = 2
++md.stochasticforcing.default_id      = idb_df
++md.stochasticforcing.covariance      = covglob # global covariance among- and between-fields
++md.stochasticforcing.randomflag      = 0 # determines true/false randomness
+ 
+-md.stochasticforcing.covariance = 1e-4 * np.array([[1.5, 0.5], [0.5, 0.4]]) # global covariance among- and between-fields
+-md.stochasticforcing.randomflag = 0 # determines true/false randomness
++md.transient.ismovingfront   = 1
++md.transient.isgroundingline = 1
+ 
+-
+-md.transient.ismovingfront = 1
+-md.levelset.spclevelset = np.full((md.mesh.numberofvertices,), np.nan)
+-md.levelset.migration_max = 1e10
+-
+-md.transient.requested_outputs = ['default', 'CalvingMeltingrate']
++md.transient.requested_outputs = ['default', 'CalvingCalvingrate','CalvingMeltingrate','BasalforcingsFloatingiceMeltingRate']
+ md.cluster = generic('name', gethostname(), 'np', 2)
+ md = solve(md, 'Transient')
+ 
+ # Fields and tolerances to track changes
+ field_names = [
+-    'Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1', 'CalvingMetlingRate1',
+-    'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2', 'CalvingMetlingRate2',
+-    'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10', 'CalvingMetlingRate10'
++    'Vx1' ,'Vy1' ,'Vel1' ,'Thickness1' ,'MaskIceLevelset1' ,'CalvingCalvingrate1' ,'CalvingMeltingrate1' ,'BasalforcingsFloatingiceMeltingRate1',
++    'Vx2' ,'Vy2' ,'Vel2' ,'Thickness2' ,'MaskIceLevelset2' ,'CalvingCalvingrate1' ,'CalvingMeltingrate2' ,'BasalforcingsFloatingiceMeltingRate2',
++    'Vx10','Vy10','Vel10','Thickness10','MaskIceLevelset10','CalvingCalvingrate10','CalvingMeltingrate10','BasalforcingsFloatingiceMeltingRate10'
+ ]
++
+ field_tolerances = [
+-    1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12, 1e-9,
+-    2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11, 1e-9,
+-    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9, 1e-9
++    1e-11,2e-11,2e-11,1e-11,1e-9,1e-10,1e-10,1e-10,
++    2e-11,1e-11,1e-11,9e-11,2e-9,1e-10,1e-10,1e-10,
++    2e-10,1e-10,1e-10,1e-10,5e-9,1e-10,1e-10,1e-10
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
+     md.results.TransientSolution[0].Vy,
+     md.results.TransientSolution[0].Vel,
+-    md.results.TransientSolution[0].Pressure,
+-    md.results.TransientSolution[0].Base,
+-    md.results.TransientSolution[0].Surface,
+     md.results.TransientSolution[0].Thickness,
+     md.results.TransientSolution[0].MaskIceLevelset,
++    md.results.TransientSolution[0].CalvingCalvingrate,
+     md.results.TransientSolution[0].CalvingMeltingrate,
+-    md.results.TransientSolution[1].Vx,
+-    md.results.TransientSolution[1].Vy,
+-    md.results.TransientSolution[1].Vel,
+-    md.results.TransientSolution[1].Pressure,
+-    md.results.TransientSolution[1].Base,
+-    md.results.TransientSolution[1].Surface,
+-    md.results.TransientSolution[1].Thickness,
+-    md.results.TransientSolution[1].MaskIceLevelset,
+-    md.results.TransientSolution[1].CalvingMeltingrate,
++    md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
++    md.results.TransientSolution[4].Vx,
++    md.results.TransientSolution[4].Vy,
++    md.results.TransientSolution[4].Vel,
++    md.results.TransientSolution[4].Thickness,
++    md.results.TransientSolution[4].MaskIceLevelset,
++    md.results.TransientSolution[4].CalvingCalvingrate,
++    md.results.TransientSolution[4].CalvingMeltingrate,
++    md.results.TransientSolution[4].BasalforcingsFloatingiceMeltingRate,
+     md.results.TransientSolution[9].Vx,
+     md.results.TransientSolution[9].Vy,
+     md.results.TransientSolution[9].Vel,
+-    md.results.TransientSolution[9].Pressure,
+-    md.results.TransientSolution[9].Base,
+-    md.results.TransientSolution[9].Surface,
+     md.results.TransientSolution[9].Thickness,
+     md.results.TransientSolution[9].MaskIceLevelset,
+-    md.results.TransientSolution[9].CalvingMeltingrate
++    md.results.TransientSolution[9].CalvingCalvingrate,
++    md.results.TransientSolution[9].CalvingMeltingrate,
++    md.results.TransientSolution[9].BasalforcingsFloatingiceMeltingRate
+ ]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26665-26666.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26665-26666.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26665-26666.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26665)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26666)
+@@ -34,6 +34,7 @@
+         s += '{}\n'.format(fielddisplay(self, 'randomflag', 'whether to apply real randomness (true) or pseudo-randomness with fixed seed (false)'))
+         s += 'Available fields:\n'
+         s += '   DefaultCalving\n'
++        s += '   FloatingMeltRate\n'
+         s += '   SMBautoregression\n'
+         s += '   FrontalForcingsRignotAutoregression (thermal forcing)\n'
+         return s
+@@ -57,7 +58,7 @@
+         # Check that covariance matrix is positive definite (this is done internally by linalg)
+         try:
+             np.linalg.cholesky(self.covariance)
+-        except LinAlgError:
++        except:
+             error('md.stochasticforcing.covariance is not positive definite')
+ 
+         # Check that all fields agree with the corresponding md class and if any field needs the default params
Index: /issm/oecreview/Archive/25834-26739/ISSM-26666-26667.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26666-26667.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26666-26667.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26666)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26667)
+@@ -59,7 +59,7 @@
+         try:
+             np.linalg.cholesky(self.covariance)
+         except:
+-            error('md.stochasticforcing.covariance is not positive definite')
++            raise TypeError('md.stochasticforcing.covariance is not positive definite')
+ 
+         # Check that all fields agree with the corresponding md class and if any field needs the default params
+         checkdefaults = False # Need to check defaults only if one of the fields does not have its own dimensionality
Index: /issm/oecreview/Archive/25834-26739/ISSM-26667-26668.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26667-26668.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26667-26668.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26667)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26668)
+@@ -68,11 +68,16 @@
+ covclv           = 1e-1*np.identity(nb_clv)
+ covclv[0,0]      = 1/10*covclv[0,0]
+ covflmlt         = 0.05*np.identity(nb_flmlt)
+-covglob          = np.zeros([6,6])
+-covglob[0:2,0:2] = covtf
+-covglob[2:4,2:4] = covclv
+-covglob[4:6,4:6] = covflmlt
++#covglob          = np.zeros([6,6])
++#covglob[0:2,0:2] = covtf
++#covglob[2:4,2:4] = covclv
++#covglob[4:6,4:6] = covflmlt
+ 
++#Hard-coding covariance matrix because python is complaining
++covglob = np.array([[1e-4,0.,0.,0.,0.,0.],[0.,1e-4,0.,0.,0.,0.],[0.,0.,1e-2,0.,0.,0.],[0.,0.,0.,1e-1,0.,0.],[0.,0.,0.,0.,0.05,0.],[0.,0.,0.,0.,0.,0.05]])
++testchol = np.linalg.cholesky(covglob)
++print(testchol)
++
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+ md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression','DefaultCalving','FloatingMeltRate']
Index: /issm/oecreview/Archive/25834-26739/ISSM-26668-26669.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26668-26669.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26668-26669.diff	(revision 26740)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26668)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26669)
+@@ -107,7 +107,7 @@
+         md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
+         if (checkdefaults):
+             md = checkfield(md, 'fieldname', 'stochasticforcing.defaultdimension', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
+-            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id', 'Inf', 1, '>=', 0, '<=', self.defaultdimension, 'size', [md.mesh.numberofelements, 1])
++            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id', 'Inf', 1, '>=', 0, '<=', self.defaultdimension, 'size', [md.mesh.numberofelements])
+         return md
+     # }}}
+ 
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26668)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26669)
+@@ -26,7 +26,7 @@
+     for vertex in range(3):
+         if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+             idb_tf[ii] = 1
+-    if idbasin[ii] == 0:  # no vertex was found in basin 1
++    if idb_tf[ii] == 0:  # no vertex was found in basin 1
+         for vertex in range(3):
+             idb_tf[ii] = 2
+ # Basin separation default
+@@ -36,7 +36,7 @@
+     for vertex in range(3):
+         if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
+             idb_df[ii] = 1
+-    if idbasin[ii] == 0:  # no vertex was found in basin 1
++    if idb_df[ii] == 0:  # no vertex was found in basin 1
+         for vertex in range(3):
+             idb_df[ii] = 2
+ #Dimensionalities
+@@ -68,13 +68,11 @@
+ covclv           = 1e-1*np.identity(nb_clv)
+ covclv[0,0]      = 1/10*covclv[0,0]
+ covflmlt         = 0.05*np.identity(nb_flmlt)
+-#covglob          = np.zeros([6,6])
+-#covglob[0:2,0:2] = covtf
+-#covglob[2:4,2:4] = covclv
+-#covglob[4:6,4:6] = covflmlt
++covglob          = np.zeros([6,6])
++covglob[0:2,0:2] = covtf
++covglob[2:4,2:4] = covclv
++covglob[4:6,4:6] = covflmlt
+ 
+-#Hard-coding covariance matrix because python is complaining
+-covglob = np.array([[1e-4,0.,0.,0.,0.,0.],[0.,1e-4,0.,0.,0.,0.],[0.,0.,1e-2,0.,0.,0.],[0.,0.,0.,1e-1,0.,0.],[0.,0.,0.,0.,0.05,0.],[0.,0.,0.,0.,0.,0.05]])
+ testchol = np.linalg.cholesky(covglob)
+ print(testchol)
+ 
+@@ -81,10 +79,10 @@
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+ md.stochasticforcing.fields = ['FrontalForcingsRignotAutoregression','DefaultCalving','FloatingMeltRate']
+-md.stochasticforcing.defauldimension = 2
+-md.stochasticforcing.default_id      = idb_df
+-md.stochasticforcing.covariance      = covglob # global covariance among- and between-fields
+-md.stochasticforcing.randomflag      = 0 # determines true/false randomness
++md.stochasticforcing.defaultdimension = 2
++md.stochasticforcing.default_id       = idb_df-1 #NOTE: offset because of 1-based vertex indexing
++md.stochasticforcing.covariance       = covglob # global covariance among- and between-fields
++md.stochasticforcing.randomflag       = 0 # determines true/false randomness
+ 
+ md.transient.ismovingfront   = 1
+ md.transient.isgroundingline = 1
Index: /issm/oecreview/Archive/25834-26739/ISSM-26669-26670.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26669-26670.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26669-26670.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26669)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26670)
+@@ -68,11 +68,13 @@
+ covclv           = 1e-1*np.identity(nb_clv)
+ covclv[0,0]      = 1/10*covclv[0,0]
+ covflmlt         = 0.05*np.identity(nb_flmlt)
+-covglob          = np.zeros([6,6])
+-covglob[0:2,0:2] = covtf
+-covglob[2:4,2:4] = covclv
+-covglob[4:6,4:6] = covflmlt
++#covglob          = np.zeros([6,6])
++#covglob[0:2,0:2] = covtf
++#covglob[2:4,2:4] = covclv
++#covglob[4:6,4:6] = covflmlt
+ 
++#Hard-coding covariance matrix because python is complaining
++covglob = np.array([[1e-4,0.,0.,0.,0.,0.],[0.,1e-4,0.,0.,0.,0.],[0.,0.,1e-2,0.,0.,0.],[0.,0.,0.,1e-1,0.,0.],[0.,0.,0.,0.,0.05,0.],[0.,0.,0.,0.,0.,0.05]])
+ testchol = np.linalg.cholesky(covglob)
+ print(testchol)
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26670-26671.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26670-26671.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26670-26671.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26670)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26671)
+@@ -107,7 +107,7 @@
+         md = checkfield(md, 'fieldname', 'stochasticforcing.randomflag', 'numel', [1], 'values', [0, 1])
+         if (checkdefaults):
+             md = checkfield(md, 'fieldname', 'stochasticforcing.defaultdimension', 'numel', 1, 'NaN', 1, 'Inf', 1, '>', 0)
+-            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id', 'Inf', 1, '>=', 0, '<=', self.defaultdimension, 'size', [md.mesh.numberofelements])
++            md = checkfield(md, 'fieldname', 'stochasticforcing.default_id','Inf',1,'NaN',1,'>=',0,'<=',self.defaultdimension,'size', [md.mesh.numberofelements])
+         return md
+     # }}}
+ 
+@@ -144,7 +144,7 @@
+                     for col in inds:  # scale columns corresponding to scaled field
+                         tempcovariance[:, col] = 1 / yts * tempcovariance[:, col]
+             # Set dummy default_id vector if defaults not used
+-            if np.isnan(self.default_id):
++            if np.any(np.isnan(self.default_id)):
+                 self.default_id = np.zeros(md.mesh.numberofelements)
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26671-26672.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26671-26672.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26671-26672.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26671)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26672)
+@@ -125,7 +125,7 @@
+             return md
+         else:
+             # Retrieve dimensionality of each field
+-            dimensions = self.defaultdimension * np.ones(num_fields)
++            dimensions = self.defaultdimension * np.ones((num_fields,))
+             for ind, field in enumerate(self.fields):
+                 # Checking for specific dimensions
+                 if (field == 'SMBautoregression'):
+@@ -148,7 +148,7 @@
+                 self.default_id = np.zeros(md.mesh.numberofelements)
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+-            WriteData(fid, prefix, 'data', dimensions, 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat')
++            WriteData(fid, prefix, 'data', dimensions, 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat','mattype',2)
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'default_id', 'format', 'IntMat', 'mattype', 2)  #12Nov2021 make sure this is zero-indexed!
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'defaultdimension', 'format', 'Integer')
+             WriteData(fid, prefix, 'data', tempcovariance, 'name', 'md.stochasticforcing.covariance', 'format', 'DoubleMat')
Index: /issm/oecreview/Archive/25834-26739/ISSM-26672-26673.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26672-26673.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26672-26673.diff	(revision 26740)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26672)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26673)
+@@ -146,6 +146,9 @@
+             # Set dummy default_id vector if defaults not used
+             if np.any(np.isnan(self.default_id)):
+                 self.default_id = np.zeros(md.mesh.numberofelements)
++            # Reshape dimensions as column array for marshalling
++            dimensions = dimensions.reshape(1,len(dimensions))
++
+             WriteData(fid, prefix, 'data', num_fields, 'name', 'md.stochasticforcing.num_fields', 'format', 'Integer')
+             WriteData(fid, prefix, 'object', self, 'fieldname', 'fields', 'format', 'StringArray')
+             WriteData(fid, prefix, 'data', dimensions, 'name', 'md.stochasticforcing.dimensions', 'format', 'IntMat','mattype',2)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26673-26674.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26673-26674.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26673-26674.diff	(revision 26740)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26673)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26674)
+@@ -134,7 +134,7 @@
+                     dimensions[ind] = md.frontalforcings.num_basins
+ 
+             # Scaling covariance matrix (scale column-by-column and row-by-row)
+-            scaledfields = ['DefaultCalving', 'SMBautoregression'] # list of fields that need scaling * 1/yts
++            scaledfields = ['DefaultCalving','FloatingMeltRate','SMBautoregression'] # list of fields that need scaling * 1/yts
+             tempcovariance = np.copy(self.covariance)
+             for i in range(num_fields):
+                 if self.fields[i] in scaledfields:
+Index: ../trunk-jpl/test/NightlyRun/test543.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test543.py	(revision 26673)
++++ ../trunk-jpl/test/NightlyRun/test543.py	(revision 26674)
+@@ -75,8 +75,8 @@
+ 
+ #Hard-coding covariance matrix because python is complaining
+ covglob = np.array([[1e-4,0.,0.,0.,0.,0.],[0.,1e-4,0.,0.,0.,0.],[0.,0.,1e-2,0.,0.,0.],[0.,0.,0.,1e-1,0.,0.],[0.,0.,0.,0.,0.05,0.],[0.,0.,0.,0.,0.,0.05]])
+-testchol = np.linalg.cholesky(covglob)
+-print(testchol)
++#testchol = np.linalg.cholesky(covglob)
++#print(testchol)
+ 
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
Index: /issm/oecreview/Archive/25834-26739/ISSM-26674-26675.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26674-26675.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26674-26675.diff	(revision 26740)
@@ -0,0 +1,144 @@
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26674)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26675)
+@@ -80,13 +80,17 @@
+ 	vy_input = GetInput(element, VyEnum)
+ 	H_input  = GetInput(element, ThicknessEnum)
+ 
++	#Prepare material object
++	material = Matice()
++	
+ 	#Start integrating
+ 	gauss = GaussTria(2)
+ 	for i in 1:gauss.numgauss
+ 
+ 		Jdet = JacobianDeterminant(xyz_list, gauss)
++		NodalFunctionsDerivatives(element,dbasis,xyz_list,gauss)
+ 
+-		println(Jdet)
++		H = GetInputValue(H_input, gauss, i)
+ 
+ 		error("STOP")
+ 		vx = GetInputValue(vx_input, gauss, i)
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26674)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26675)
+@@ -128,9 +128,58 @@
+ 	y3 = xyz_list[3,2]
+ 
+ 	J[1,1] = .5*(x2-x1)
+-	J[1,2] = sqrt(3)/6*(2*x3 -x1 -x2)
+-	J[2,1] = .5*(y2-y1)
++	J[1,2] = .5*(y2-y1)
++	J[2,1] = sqrt(3)/6*(2*x3 -x1 -x2)
+ 	J[2,2] = sqrt(3)/6*(2*y3 -y1 -y2)
+ 
+ 	return J
+ end#}}}
++function JacobianInvert(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	#Get Jacobian matrix
++	J = Jacobian(xyz_list)
++
++	#Get its determinant
++	Jinv = Matrix2x2Invert(J)
++
++	return Jinv
++end#}}}
++function NodalFunctionsDerivatives(element::Tria,dbasis::Matrix{Float64},xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	#Get nodal function derivatives in reference element
++	dbasis_ref = Matrix{Float64}(undef,3,2)
++	NodalFunctionsDerivativesReference(dbasis_ref,gauss,P1Enum)
++
++	#Get invert of the Jacobian
++	Jinv = JacobianInvert(xyz_list,gauss)
++
++	#Build dbasis:
++	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
++	#[ dNi/dy ] =        [dNhat_i/ds]
++	for i in 1:3
++		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
++		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
++	end
++
++end#}}}
++function NodalFunctionsDerivativesReference(dbasis::Matrix{Float64}, gauss::GaussTria, finiteelement::IssmEnum) #{{{
++
++	if(finiteelement==P0Enum)
++		#Nodal function 1
++		dbasis[1,1]= 0.
++		dbasis[1,2]= 0.
++
++	elseif(finiteelement==P1Enum)
++		#Nodal function 1
++		dbasis[1,1]= -.5
++		dbasis[1,2]= -sqrt(3)/6
++		#Nodal function 2
++		dbasis[2,1]= .5
++		dbasis[2,2]= -sqrt(3)/6
++		#Nodal function 3
++		dbasis[3,1]= 0
++		dbasis[3,2]= sqrt(3)/3
++	else
++		error("Element type ",finiteelement," not supported yet")
++	end
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/matice.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/matice.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/matice.jl	(revision 26675)
+@@ -0,0 +1,10 @@
++#Matice class definition
++mutable struct Matice#{{{
++end# }}}
++
++#vertices functions
++function GetViscositySSA() #{{{
++
++	error("not implemented")
++	return mu
++end #}}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26674)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26675)
+@@ -7,6 +7,7 @@
+ include("./nodes.jl")
+ include("./elements.jl")
+ include("./constraints.jl")
++include("./matice.jl")
+ include("./femmodel.jl")
+ include("./analyses/analysis.jl")
+ include("./analyses/stressbalanceanalysis.jl")
+Index: ../trunk-jpl/src/jl/solve/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/utils.jl	(revision 26674)
++++ ../trunk-jpl/src/jl/solve/utils.jl	(revision 26675)
+@@ -3,3 +3,24 @@
+ 	return  A[1,1]*A[2,2]-A[2,1]*A[1,2]
+ 
+ end#}}}
++function Matrix2x2Invert(A::Matrix{Float64}) #{{{
++
++	#Initialize output
++	Ainv = Matrix{Float64}(undef,2,2)
++
++	#Compute determinant
++	det = Matrix2x2Determinant(A)
++	if(abs(det)<eps(Float64)) error("Determinant smaller than machine epsilon") end
++
++	#Multiplication is faster than divsion, so we multiply by the reciprocal
++	det_reciprocal = 1/det
++
++	#compute invert matrix
++	Ainv[1,1]=   A[2,2]*det_reciprocal # =  d/det
++   Ainv[1,2]= - A[1,2]*det_reciprocal # = -b/det
++   Ainv[2,1]= - A[2,1]*det_reciprocal # = -c/det
++   Ainv[2,2]=   A[1,1]*det_reciprocal # =  a/det
++
++	return  Ainv
++
++end#}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26675-26676.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26675-26676.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26675-26676.diff	(revision 26740)
@@ -0,0 +1,850 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26675)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 26676)
+@@ -544,9 +544,24 @@
+ 	s=1./drag_p;
+ 
+ 	/*Get effective pressure and basal velocity*/
+-	IssmDouble Neff = EffectivePressure(gauss);
+ 	IssmDouble vmag = VelMag(gauss);
+ 
++	bool ispwStochastic;
++	IssmDouble Neff;
++	element->parameters->FindParam(&ispwStochastic,StochasticForcingIsWaterPressureEnum);
++	if(ispwStochastic){
++		/*Retrieve stochastic water pressure and compute ice pressure*/
++		IssmDouble p_ice,p_water,Neff_limit;
++		element->GetInputValue(&p_water,gauss,FrictionWaterPressureEnum);
++		element->parameters->FindParam(&Neff_limit,FrictionEffectivePressureLimitEnum);
++		p_ice = IcePressure(gauss);
++		Neff  = max(Neff_limit*p_ice, p_ice - p_water);
++	}	
++	else{
++		/*Compute effective pressure directly*/
++		Neff = EffectivePressure(gauss);
++	}
++
+ 	/*Check to prevent dividing by zero if vmag==0*/
+ 	if(s==1.){
+ 		/*This is to make AD happy and avoid 0^0*/
+@@ -844,37 +859,30 @@
+ 	element->parameters->FindParam(&coupled_flag,FrictionCouplingEnum);
+ 	element->parameters->FindParam(&Neff_limit,FrictionEffectivePressureLimitEnum);
+ 
++	/*Compute ice pressure*/
++	p_ice = IcePressure(gauss);
++
+ 	/*From base and thickness, compute effective pressure when drag is viscous, or get Neff from forcing:*/
+ 	switch(coupled_flag){
+ 		case 0:{
+-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
+ 			element->GetInputValue(&base, gauss,BaseEnum);
+ 			element->GetInputValue(&sealevel, gauss,SealevelEnum);
+ 			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+ 			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
+-			p_ice   = gravity*rho_ice*thickness;
+ 			p_water = rho_water*gravity*(sealevel-base);
+ 			Neff = p_ice - p_water;
+ 		}
+ 			break;
+ 		case 1:{
+-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
+-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+-			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
+-			p_ice   = gravity*rho_ice*thickness;
+ 			p_water = 0.;
+ 			Neff = p_ice - p_water;
+ 		}
+ 			break;
+ 		case 2:{
+-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
+ 			element->GetInputValue(&base, gauss,BaseEnum);
+ 			element->GetInputValue(&sealevel, gauss,SealevelEnum);
+ 			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+ 			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
+-			p_ice   = gravity*rho_ice*thickness;
+ 			p_water = max(0.,rho_water*gravity*(sealevel-base));
+ 			Neff = p_ice - p_water;
+ 		}
+@@ -881,18 +889,10 @@
+ 			break;
+ 		case 3:{
+ 			element->GetInputValue(&Neff,gauss,FrictionEffectivePressureEnum);
+-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
+-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+-			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
+-			p_ice   = gravity*rho_ice*thickness;
+ 		}
+ 			break;
+ 		case 4:{
+ 			element->GetInputValue(&Neff,gauss,EffectivePressureEnum);
+-			element->GetInputValue(&thickness, gauss,ThicknessEnum);
+-			IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+-			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
+-			p_ice   = gravity*rho_ice*thickness;
+ 		}
+ 			break;
+ 		default:
+@@ -906,6 +906,68 @@
+ 	return Neff;
+ 
+ }/*}}}*/
++IssmDouble Friction::IcePressure(Gauss* gauss){/*{{{*/
++	/*Get ice pressure*/
++
++	IssmDouble  thickness,p_ice;
++	/*Recover Inputs and Parameters*/
++	element->GetInputValue(&thickness, gauss,ThicknessEnum);
++	IssmDouble rho_ice = element->FindParam(MaterialsRhoIceEnum);
++	IssmDouble gravity = element->FindParam(ConstantsGEnum);
++
++	/*Compute*/
++	p_ice = gravity*rho_ice*thickness;
++
++	/*Return ice pressure*/
++	return p_ice;
++
++}/*}}}*/
++IssmDouble Friction::SubglacialWaterPressure(Gauss* gauss){/*{{{*/
++	/*Get water pressure as a function of  flag */
++
++	int         coupled_flag;
++	IssmDouble  base,sealevel,p_water;
++
++	/*Recover parameters: */
++	element->parameters->FindParam(&coupled_flag,FrictionCouplingEnum);
++
++	switch(coupled_flag){
++		case 0:{
++			element->GetInputValue(&base, gauss,BaseEnum);
++			element->GetInputValue(&sealevel, gauss,SealevelEnum);
++			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
++			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
++			p_water = rho_water*gravity*(sealevel-base);
++		}
++			break;
++		case 1:{
++			p_water = 0.;
++		}
++			break;
++		case 2:{
++			element->GetInputValue(&base, gauss,BaseEnum);
++			element->GetInputValue(&sealevel, gauss,SealevelEnum);
++			IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
++			IssmDouble gravity   = element->FindParam(ConstantsGEnum);
++			p_water = max(0.,rho_water*gravity*(sealevel-base));
++		}
++			break;
++		case 3:{
++			_error_("water pressure not computed for coupling==3 in friction law");
++		}
++			break;
++		case 4:{
++			_error_("water pressure not computed for coupling==4 in friction law");
++		}
++			break;
++		default:
++			_error_("not supported");
++	}
++
++	/*Return water pressure*/
++	return p_water;
++
++}/*}}}*/
+ IssmDouble Friction::VelMag(Gauss* gauss){/*{{{*/
+ 	/*Get the velocity magnitude as a function of flag */
+ 
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26675)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.h	(revision 26676)
+@@ -51,6 +51,8 @@
+ 		void  GetAlpha2Tsai(IssmDouble* palpha2,Gauss* gauss);
+ 
+ 		IssmDouble EffectivePressure(Gauss* gauss);
++		IssmDouble IcePressure(Gauss* gauss);
++		IssmDouble SubglacialWaterPressure(Gauss* gauss);
+ 		IssmDouble VelMag(Gauss* gauss);
+ 		void GetBasalSlidingSpeeds(IssmDouble* pvx, Gauss* gauss);
+ 		void GetBasalSlidingSpeeds(IssmDouble* pvx, IssmDouble* pvy, Gauss* gauss);
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26675)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 26676)
+@@ -500,6 +500,8 @@
+ 
+ 	bool isstochasticforcing;
+    parameters->FindParam(&isstochasticforcing,StochasticForcingIsStochasticForcingEnum);
++	/*Stochastic Effective Pressure false by default*/
++	parameters->AddObject(new BoolParam(StochasticForcingIsWaterPressureEnum,false));
+    if(isstochasticforcing){
+       int num_fields,stochastic_dim;
+       char** fields;
+Index: ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26675)
++++ ../trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp	(revision 26676)
+@@ -3,6 +3,7 @@
+  */
+ 
+ #include "./StochasticForcingx.h"
++#include "../../classes/Loads/Friction.h"
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+ #include "../../shared/Random/random.h"
+@@ -140,6 +141,52 @@
+ 						delete gauss;
+ 					}
+ 					break;
++				//VV working(29Nov2021)
++				case FrictionWaterPressureEnum:
++					/*Specify that WaterPressure is stochastic*/ 
++					femmodel->parameters->SetParam(true,StochasticForcingIsWaterPressureEnum);
++					for(Object* &object:femmodel->elements->objects){
++                  Element* element = xDynamicCast<Element*>(object);
++                  int numvertices  = element->GetNumberOfVertices();
++                  IssmDouble p_water_deterministic[numvertices];
++                  IssmDouble p_water[numvertices];
++						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
++						Gauss* gauss=element->NewGauss();
++						Friction* friction = new Friction(element);
++						for(int i=0;i<numvertices;i++){
++							gauss->GaussVertex(i);
++							p_water_deterministic[i] = friction->SubglacialWaterPressure(gauss);
++							p_water[i]               = p_water_deterministic[i] + noisefield[dimensionid]; //make sure positive (29Nov2021)
++							p_water[i]               = max(0.0,p_water[i]);
++						}
++						element->AddInput(FrictionWaterPressureEnum,p_water,P1DGEnum);
++						delete gauss;
++						delete friction;
++					}
++					break;
++
++				/*
++				case FrictionEffectivePressureEnum:
++					femmodel->parameters->SetParam(true,StochasticForcingIsEffectivePressureEnum);
++					for(Object* &object:femmodel->elements->objects){
++                  Element* element = xDynamicCast<Element*>(object);
++                  int numvertices  = element->GetNumberOfVertices();
++                  IssmDouble Neff[numvertices];
++						element->GetInputValue(&dimensionid,StochasticForcingDefaultIdEnum);
++						Gauss* gauss=element->NewGauss();
++						Friction* friction = new Friction(element);
++						for(int i=0;i<numvertices;i++){
++							gauss->GaussVertex(i);
++							Neff[i] = friction->EffectivePressure(gauss);
++							Neff[i] = Neff[i]+noisefield[dimensionid];
++						}
++						element->AddInput(FrictionEffectivePressureEnum,Neff,P1DGEnum);
++						delete gauss;
++						delete friction;
++					}
++					break;
++				*/
++
+ 				default:
+ 					_error_("Field "<<EnumToStringx(fields[j])<<" does not support stochasticity yet.");
+ 			}
+Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26675)
++++ ../trunk-jpl/src/c/shared/Enum/Enum.vim	(revision 26676)
+@@ -400,7 +400,9 @@
+ syn keyword cConstant StochasticForcingDefaultDimensionEnum
+ syn keyword cConstant StochasticForcingDimensionsEnum
+ syn keyword cConstant StochasticForcingFieldsEnum
++syn keyword cConstant StochasticForcingIsEffectivePressureEnum
+ syn keyword cConstant StochasticForcingIsStochasticForcingEnum
++syn keyword cConstant StochasticForcingIsWaterPressureEnum
+ syn keyword cConstant StochasticForcingNumFieldsEnum
+ syn keyword cConstant StochasticForcingRandomflagEnum
+ syn keyword cConstant RotationalPolarMoiEnum
+@@ -602,6 +604,7 @@
+ syn keyword cConstant BaseSlopeYEnum
+ syn keyword cConstant BaselineBasalforcingsFloatingiceMeltingRateEnum
+ syn keyword cConstant BaselineCalvingCalvingrateEnum
++syn keyword cConstant BaselineFrictionEffectivePressureEnum
+ syn keyword cConstant BedEnum
+ syn keyword cConstant BedGRDEnum
+ syn keyword cConstant BedEastEnum
+@@ -1072,6 +1075,8 @@
+ syn keyword cConstant WaterfractionDrainageIntegratedEnum
+ syn keyword cConstant WaterfractionEnum
+ syn keyword cConstant WaterheightEnum
++syn keyword cConstant FrictionWaterPressureEnum
++syn keyword cConstant FrictionWaterPressureNoiseEnum
+ syn keyword cConstant WeightsLevelsetObservationEnum
+ syn keyword cConstant WeightsSurfaceObservationEnum
+ syn keyword cConstant OldAccumulatedDeltaBottomPressureEnum
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26675)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 26676)
+@@ -394,7 +394,9 @@
+ 	StochasticForcingDefaultDimensionEnum,
+ 	StochasticForcingDimensionsEnum,
+ 	StochasticForcingFieldsEnum,
++	StochasticForcingIsEffectivePressureEnum,
+ 	StochasticForcingIsStochasticForcingEnum,
++	StochasticForcingIsWaterPressureEnum,
+ 	StochasticForcingNumFieldsEnum,
+ 	StochasticForcingRandomflagEnum,
+ 	RotationalPolarMoiEnum,
+@@ -598,6 +600,7 @@
+ 	BaseSlopeYEnum,
+ 	BaselineBasalforcingsFloatingiceMeltingRateEnum,
+ 	BaselineCalvingCalvingrateEnum,
++	BaselineFrictionEffectivePressureEnum,
+ 	BedEnum,
+ 	BedGRDEnum,
+ 	BedEastEnum,
+@@ -1069,6 +1072,8 @@
+ 	WaterfractionDrainageIntegratedEnum,
+ 	WaterfractionEnum,
+ 	WaterheightEnum,
++	FrictionWaterPressureEnum,
++	FrictionWaterPressureNoiseEnum,
+ 	WeightsLevelsetObservationEnum,
+ 	WeightsSurfaceObservationEnum,
+ 	OldAccumulatedDeltaBottomPressureEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26675)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 26676)
+@@ -402,7 +402,9 @@
+ 		case StochasticForcingDefaultDimensionEnum : return "StochasticForcingDefaultDimension";
+ 		case StochasticForcingDimensionsEnum : return "StochasticForcingDimensions";
+ 		case StochasticForcingFieldsEnum : return "StochasticForcingFields";
++		case StochasticForcingIsEffectivePressureEnum : return "StochasticForcingIsEffectivePressure";
+ 		case StochasticForcingIsStochasticForcingEnum : return "StochasticForcingIsStochasticForcing";
++		case StochasticForcingIsWaterPressureEnum : return "StochasticForcingIsWaterPressure";
+ 		case StochasticForcingNumFieldsEnum : return "StochasticForcingNumFields";
+ 		case StochasticForcingRandomflagEnum : return "StochasticForcingRandomflag";
+ 		case RotationalPolarMoiEnum : return "RotationalPolarMoi";
+@@ -604,6 +606,7 @@
+ 		case BaseSlopeYEnum : return "BaseSlopeY";
+ 		case BaselineBasalforcingsFloatingiceMeltingRateEnum : return "BaselineBasalforcingsFloatingiceMeltingRate";
+ 		case BaselineCalvingCalvingrateEnum : return "BaselineCalvingCalvingrate";
++		case BaselineFrictionEffectivePressureEnum : return "BaselineFrictionEffectivePressure";
+ 		case BedEnum : return "Bed";
+ 		case BedGRDEnum : return "BedGRD";
+ 		case BedEastEnum : return "BedEast";
+@@ -1074,6 +1077,8 @@
+ 		case WaterfractionDrainageIntegratedEnum : return "WaterfractionDrainageIntegrated";
+ 		case WaterfractionEnum : return "Waterfraction";
+ 		case WaterheightEnum : return "Waterheight";
++		case FrictionWaterPressureEnum : return "FrictionWaterPressure";
++		case FrictionWaterPressureNoiseEnum : return "FrictionWaterPressureNoise";
+ 		case WeightsLevelsetObservationEnum : return "WeightsLevelsetObservation";
+ 		case WeightsSurfaceObservationEnum : return "WeightsSurfaceObservation";
+ 		case OldAccumulatedDeltaBottomPressureEnum : return "OldAccumulatedDeltaBottomPressure";
+Index: ../trunk-jpl/src/c/shared/Enum/Enumjl.vim
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(revision 26675)
++++ ../trunk-jpl/src/c/shared/Enum/Enumjl.vim	(revision 26676)
+@@ -393,7 +393,9 @@
+ syn keyword juliaConstC StochasticForcingDefaultDimensionEnum
+ syn keyword juliaConstC StochasticForcingDimensionsEnum
+ syn keyword juliaConstC StochasticForcingFieldsEnum
++syn keyword juliaConstC StochasticForcingIsEffectivePressureEnum
+ syn keyword juliaConstC StochasticForcingIsStochasticForcingEnum
++syn keyword juliaConstC StochasticForcingIsWaterPressureEnum
+ syn keyword juliaConstC StochasticForcingNumFieldsEnum
+ syn keyword juliaConstC StochasticForcingRandomflagEnum
+ syn keyword juliaConstC RotationalPolarMoiEnum
+@@ -595,6 +597,7 @@
+ syn keyword juliaConstC BaseSlopeYEnum
+ syn keyword juliaConstC BaselineBasalforcingsFloatingiceMeltingRateEnum
+ syn keyword juliaConstC BaselineCalvingCalvingrateEnum
++syn keyword juliaConstC BaselineFrictionEffectivePressureEnum
+ syn keyword juliaConstC BedEnum
+ syn keyword juliaConstC BedGRDEnum
+ syn keyword juliaConstC BedEastEnum
+@@ -1065,6 +1068,8 @@
+ syn keyword juliaConstC WaterfractionDrainageIntegratedEnum
+ syn keyword juliaConstC WaterfractionEnum
+ syn keyword juliaConstC WaterheightEnum
++syn keyword juliaConstC FrictionWaterPressureEnum
++syn keyword juliaConstC FrictionWaterPressureNoiseEnum
+ syn keyword juliaConstC WeightsLevelsetObservationEnum
+ syn keyword juliaConstC WeightsSurfaceObservationEnum
+ syn keyword juliaConstC OldAccumulatedDeltaBottomPressureEnum
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26675)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 26676)
+@@ -411,7 +411,9 @@
+ 	      else if (strcmp(name,"StochasticForcingDefaultDimension")==0) return StochasticForcingDefaultDimensionEnum;
+ 	      else if (strcmp(name,"StochasticForcingDimensions")==0) return StochasticForcingDimensionsEnum;
+ 	      else if (strcmp(name,"StochasticForcingFields")==0) return StochasticForcingFieldsEnum;
++	      else if (strcmp(name,"StochasticForcingIsEffectivePressure")==0) return StochasticForcingIsEffectivePressureEnum;
+ 	      else if (strcmp(name,"StochasticForcingIsStochasticForcing")==0) return StochasticForcingIsStochasticForcingEnum;
++	      else if (strcmp(name,"StochasticForcingIsWaterPressure")==0) return StochasticForcingIsWaterPressureEnum;
+ 	      else if (strcmp(name,"StochasticForcingNumFields")==0) return StochasticForcingNumFieldsEnum;
+ 	      else if (strcmp(name,"StochasticForcingRandomflag")==0) return StochasticForcingRandomflagEnum;
+ 	      else if (strcmp(name,"RotationalPolarMoi")==0) return RotationalPolarMoiEnum;
+@@ -503,12 +505,12 @@
+ 	      else if (strcmp(name,"SteadystateRequestedOutputs")==0) return SteadystateRequestedOutputsEnum;
+ 	      else if (strcmp(name,"Step")==0) return StepEnum;
+ 	      else if (strcmp(name,"Steps")==0) return StepsEnum;
+-	      else if (strcmp(name,"StressbalanceAbstol")==0) return StressbalanceAbstolEnum;
+-	      else if (strcmp(name,"StressbalanceFSreconditioning")==0) return StressbalanceFSreconditioningEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum;
++	      if (strcmp(name,"StressbalanceAbstol")==0) return StressbalanceAbstolEnum;
++	      else if (strcmp(name,"StressbalanceFSreconditioning")==0) return StressbalanceFSreconditioningEnum;
++	      else if (strcmp(name,"StressbalanceIsnewton")==0) return StressbalanceIsnewtonEnum;
+ 	      else if (strcmp(name,"StressbalanceMaxiter")==0) return StressbalanceMaxiterEnum;
+ 	      else if (strcmp(name,"StressbalanceNumRequestedOutputs")==0) return StressbalanceNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"StressbalancePenaltyFactor")==0) return StressbalancePenaltyFactorEnum;
+@@ -616,6 +618,7 @@
+ 	      else if (strcmp(name,"BaseSlopeY")==0) return BaseSlopeYEnum;
+ 	      else if (strcmp(name,"BaselineBasalforcingsFloatingiceMeltingRate")==0) return BaselineBasalforcingsFloatingiceMeltingRateEnum;
+ 	      else if (strcmp(name,"BaselineCalvingCalvingrate")==0) return BaselineCalvingCalvingrateEnum;
++	      else if (strcmp(name,"BaselineFrictionEffectivePressure")==0) return BaselineFrictionEffectivePressureEnum;
+ 	      else if (strcmp(name,"Bed")==0) return BedEnum;
+ 	      else if (strcmp(name,"BedGRD")==0) return BedGRDEnum;
+ 	      else if (strcmp(name,"BedEast")==0) return BedEastEnum;
+@@ -625,13 +628,13 @@
+ 	      else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
+ 	      else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
+ 	      else if (strcmp(name,"BottomPressure")==0) return BottomPressureEnum;
+-	      else if (strcmp(name,"BottomPressureOld")==0) return BottomPressureOldEnum;
+-	      else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
+-	      else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
++	      if (strcmp(name,"BottomPressureOld")==0) return BottomPressureOldEnum;
++	      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;
+@@ -748,13 +751,13 @@
+ 	      else if (strcmp(name,"HydrologyHead")==0) return HydrologyHeadEnum;
+ 	      else if (strcmp(name,"HydrologyHeadOld")==0) return HydrologyHeadOldEnum;
+ 	      else if (strcmp(name,"HydrologyMoulinInput")==0) return HydrologyMoulinInputEnum;
+-	      else if (strcmp(name,"HydrologyNeumannflux")==0) return HydrologyNeumannfluxEnum;
+-	      else if (strcmp(name,"HydrologyReynolds")==0) return HydrologyReynoldsEnum;
+-	      else if (strcmp(name,"HydrologySheetConductivity")==0) return HydrologySheetConductivityEnum;
+          else stage=7;
+    }
+    if(stage==7){
+-	      if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
++	      if (strcmp(name,"HydrologyNeumannflux")==0) return HydrologyNeumannfluxEnum;
++	      else if (strcmp(name,"HydrologyReynolds")==0) return HydrologyReynoldsEnum;
++	      else if (strcmp(name,"HydrologySheetConductivity")==0) return HydrologySheetConductivityEnum;
++	      else if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
+ 	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+ 	      else if (strcmp(name,"HydrologyTws")==0) return HydrologyTwsEnum;
+ 	      else if (strcmp(name,"HydrologyTwsSpc")==0) return HydrologyTwsSpcEnum;
+@@ -871,13 +874,13 @@
+ 	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
+ 	      else if (strcmp(name,"SealevelUGrd")==0) return SealevelUGrdEnum;
+ 	      else if (strcmp(name,"SealevelNGrd")==0) return SealevelNGrdEnum;
+-	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
+-	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
+-	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
+          else stage=8;
+    }
+    if(stage==8){
+-	      if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
++	      if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
++	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
++	      else if (strcmp(name,"SealevelchangeIndices")==0) return SealevelchangeIndicesEnum;
++	      else if (strcmp(name,"SealevelchangeG")==0) return SealevelchangeGEnum;
+ 	      else if (strcmp(name,"SealevelchangeGU")==0) return SealevelchangeGUEnum;
+ 	      else if (strcmp(name,"SealevelchangeGE")==0) return SealevelchangeGEEnum;
+ 	      else if (strcmp(name,"SealevelchangeGN")==0) return SealevelchangeGNEnum;
+@@ -994,13 +997,13 @@
+ 	      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,"SmbSzaValue")==0) return SmbSzaValueEnum;
+-	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
+          else stage=9;
+    }
+    if(stage==9){
+-	      if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
++	      if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
++	      else if (strcmp(name,"SmbSzaValue")==0) return SmbSzaValueEnum;
++	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
++	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
+ 	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
+ 	      else if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
+ 	      else if (strcmp(name,"SmbTemperaturesLgm")==0) return SmbTemperaturesLgmEnum;
+@@ -1098,6 +1101,8 @@
+ 	      else if (strcmp(name,"WaterfractionDrainageIntegrated")==0) return WaterfractionDrainageIntegratedEnum;
+ 	      else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
+ 	      else if (strcmp(name,"Waterheight")==0) return WaterheightEnum;
++	      else if (strcmp(name,"FrictionWaterPressure")==0) return FrictionWaterPressureEnum;
++	      else if (strcmp(name,"FrictionWaterPressureNoise")==0) return FrictionWaterPressureNoiseEnum;
+ 	      else if (strcmp(name,"WeightsLevelsetObservation")==0) return WeightsLevelsetObservationEnum;
+ 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
+ 	      else if (strcmp(name,"OldAccumulatedDeltaBottomPressure")==0) return OldAccumulatedDeltaBottomPressureEnum;
+@@ -1115,15 +1120,15 @@
+ 	      else if (strcmp(name,"Outputdefinition18")==0) return Outputdefinition18Enum;
+ 	      else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum;
+ 	      else if (strcmp(name,"Outputdefinition20")==0) return Outputdefinition20Enum;
+-	      else if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
++         else stage=10;
++   }
++   if(stage==10){
++	      if (strcmp(name,"Outputdefinition21")==0) return Outputdefinition21Enum;
+ 	      else if (strcmp(name,"Outputdefinition22")==0) return Outputdefinition22Enum;
+ 	      else if (strcmp(name,"Outputdefinition23")==0) return Outputdefinition23Enum;
+ 	      else if (strcmp(name,"Outputdefinition24")==0) return Outputdefinition24Enum;
+ 	      else if (strcmp(name,"Outputdefinition25")==0) return Outputdefinition25Enum;
+-         else stage=10;
+-   }
+-   if(stage==10){
+-	      if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
++	      else if (strcmp(name,"Outputdefinition26")==0) return Outputdefinition26Enum;
+ 	      else if (strcmp(name,"Outputdefinition27")==0) return Outputdefinition27Enum;
+ 	      else if (strcmp(name,"Outputdefinition28")==0) return Outputdefinition28Enum;
+ 	      else if (strcmp(name,"Outputdefinition29")==0) return Outputdefinition29Enum;
+@@ -1238,15 +1243,15 @@
+ 	      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 stage=11;
++   }
++   if(stage==11){
++	      if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
+ 	      else if (strcmp(name,"CalvingHab")==0) return CalvingHabEnum;
+ 	      else if (strcmp(name,"CalvingLevermann")==0) return CalvingLevermannEnum;
+ 	      else if (strcmp(name,"CalvingVonmises")==0) return CalvingVonmisesEnum;
+ 	      else if (strcmp(name,"Cfdragcoeffabsgrad")==0) return CfdragcoeffabsgradEnum;
+-         else stage=11;
+-   }
+-   if(stage==11){
+-	      if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
++	      else if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
+ 	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
+ 	      else if (strcmp(name,"Cflevelsetmisfit")==0) return CflevelsetmisfitEnum;
+ 	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+@@ -1361,15 +1366,15 @@
+ 	      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,"ElementInput")==0) return ElementInputEnum;
++         else stage=12;
++   }
++   if(stage==12){
++	      if (strcmp(name,"ElementInput")==0) return ElementInputEnum;
+ 	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
+ 	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+ 	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
+ 	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+-         else stage=12;
+-   }
+-   if(stage==12){
+-	      if (strcmp(name,"Inputs")==0) return InputsEnum;
++	      else if (strcmp(name,"Inputs")==0) return InputsEnum;
+ 	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+ 	      else if (strcmp(name,"Intersect")==0) return IntersectEnum;
+ 	      else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
+@@ -1484,15 +1489,15 @@
+ 	      else if (strcmp(name,"RecoveryAnalysis")==0) return RecoveryAnalysisEnum;
+ 	      else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
+ 	      else if (strcmp(name,"SamplingAnalysis")==0) return SamplingAnalysisEnum;
+-	      else if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
++         else stage=13;
++   }
++   if(stage==13){
++	      if (strcmp(name,"SamplingSolution")==0) return SamplingSolutionEnum;
+ 	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
+ 	      else if (strcmp(name,"SMBautoregression")==0) return SMBautoregressionEnum;
+ 	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+ 	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
+-         else stage=13;
+-   }
+-   if(stage==13){
+-	      if (strcmp(name,"SMBforcing")==0) return SMBforcingEnum;
++	      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;
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26675)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.m	(revision 26676)
+@@ -71,6 +71,18 @@
+ 						error('md.basalforcings does not agree with stochasticforcing field %s', char(field));
+ 					end
+ 				end
++				if(contains(field,'WaterPressure'))
++               mdname = structstoch.mdnames(find(strcmp(structstoch.fields,char(field))));
++               if~(isequal(class(md.friction),char(mdname)))
++                  error('stochasticforcing field %s is only implemented for default friction', char(field));
++               end
++               if(md.friction.coupling~=0 && md.friction.coupling~=1 && md.friction.coupling~=2)
++                  error('stochasticforcing field %s is only implemented for cases md.friction.coupling 0 or 1 or 2', char(field));
++               end
++               if(any(md.friction.q==0))
++                  error('stochasticforcing field %s requires non-zero q exponent',char(field));
++               end
++            end
+ 				%Checking for specific dimensions
+ 				if ~(strcmp(field,'SMBautoregression') || strcmp(field,'FrontalForcingsRignotAutoregression'))
+ 					checkdefaults = true; %field with non-specific dimensionality
+@@ -184,6 +196,7 @@
+ 	structure.fields = {...
+ 		'DefaultCalving',...
+ 		'FloatingMeltRate',...
++		'FrictionWaterPressure',...
+ 		'FrontalForcingsRignotAutoregression',...
+ 		'SMBautoregression'
+ 		};
+@@ -190,6 +203,7 @@
+ 	structure.mdnames = {...
+ 		'calving',...
+ 		'basalforcings',...
++		'friction',...
+ 		'frontalforcingsrignotautoregression',...
+ 		'SMBautoregression'
+ 	};
+Index: ../trunk-jpl/test/Archives/Archive621.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: ../trunk-jpl/test/Archives/Archive621.arch
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Index: ../trunk-jpl/test/NightlyRun/test621.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test621.m	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test621.m	(revision 26676)
+@@ -0,0 +1,77 @@
++%Test Name: 79NorthStochFrictionWaterPressure
++md=triangle(model(),'../Exp/79North.exp',6000.);
++md=setmask(md,'../Exp/79NorthShelf.exp','');
++md=parameterize(md,'../Par/79North.par');
++md=setflowequation(md,'SSA','all');
++
++%Default friction
++md.friction             = friction();
++md.friction.coefficient = 30*ones(md.mesh.numberofvertices,1);
++md.friction.p           = 1*ones(md.mesh.numberofelements,1);
++md.friction.q           = 1*ones(md.mesh.numberofelements,1);
++
++% Basin separation default
++idb_df = zeros(md.mesh.numberofelements,1);
++iid1   = find(md.mesh.y<=-1.08e6);
++for ii=1:md.mesh.numberofelements
++    for vertex=1:3
++        if any(iid1==md.mesh.elements(ii,vertex)) %one vertex in basin 1
++            idb_df(ii) = 1;
++        end
++    end
++    if idb_df(ii)==0 %no vertex was found in basin 1
++        idb_df(ii) = 2;
++    end
++end
++%Covariance matrix
++covPw      = 0.5e10*eye(2);
++covPw(1,1) = 1.5*covPw(1,1);
++
++%Stochastic forcing
++md.stochasticforcing.isstochasticforcing = 1;
++md.stochasticforcing.fields              = [{'FrictionWaterPressure'}];
++md.stochasticforcing.defaultdimension    = 2;
++md.stochasticforcing.default_id          = idb_df;
++md.stochasticforcing.covariance          = covPw; %global covariance
++md.stochasticforcing.randomflag          = 0; %determines true/false randomness
++
++md.transient.issmb              = 0;
++md.transient.ismasstransport    = 1;
++md.transient.isstressbalance    = 1;
++md.transient.isthermal          = 0;
++md.transient.isgroundingline    = 0;
++
++md.transient.requested_outputs = {'default','FrictionWaterPressure'};
++md.timestepping.start_time = 0;
++md.timestepping.time_step  = 1;
++md.timestepping.final_time = 5;
++md.cluster=generic('name',oshostname(),'np',3);
++md=solve(md,'Transient');
++
++
++%Fields and tolerances to track changes
++field_names      = {'Vx1','Vy1','Vel1','Thickness1','FrictionWaterPressure1',...
++                    'Vx2','Vy2','Vel2','Thickness2','FrictionWaterPressure2',...
++                    'Vx5','Vy5','Vel5','Thickness5','FrictionWaterPressure5'};
++field_tolerances={2e-10,2e-10,2e-10,2e-10,2e-10,...
++                  4e-10,4e-10,4e-10,4e-10,4e-10,...
++                  8e-10,8e-10,8e-10,8e-10,8e-10};
++              
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++    (md.results.TransientSolution(1).Vy),...
++    (md.results.TransientSolution(1).Vel),...
++    (md.results.TransientSolution(1).Thickness),...
++    (md.results.TransientSolution(1).FrictionWaterPressure),...
++    (md.results.TransientSolution(2).Vx),...
++    (md.results.TransientSolution(2).Vy),...
++    (md.results.TransientSolution(2).Vel),...
++    (md.results.TransientSolution(2).Thickness),...
++    (md.results.TransientSolution(2).FrictionWaterPressure),...
++    (md.results.TransientSolution(5).Vx),...
++    (md.results.TransientSolution(5).Vy),...
++    (md.results.TransientSolution(5).Vel),...
++    (md.results.TransientSolution(5).Thickness),...
++    (md.results.TransientSolution(5).FrictionWaterPressure),...
++    };
++
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26675)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26676)
+@@ -69,19 +69,28 @@
+             if 'SMB' in field:
+                 mdname = structstoch[field]
+                 if (type(md.smb).__name__ != mdname):
+-                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(mdname))
++                    raise TypeError('md.smb does not agree with stochasticforcing field {}'.format(field))
+             if 'FrontalForcings' in field:
+                 mdname = structstoch[field]
+                 if (type(md.frontalforcings).__name__ != mdname):
+-                    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(mdname))
++                    raise TypeError('md.frontalforcings does not agree with stochasticforcing field {}'.format(field))
+             if 'Calving' in field:
+                 mdname = structstoch[field]
+                 if (type(md.calving).__name__ != mdname):
+-                    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(mdname))
++                    raise TypeError('md.calving does not agree with stochasticforcing field {}'.format(field))
+             if 'BasalforcingsFloatingice' in field:
+                 mdname = structstoch[field]
+                 if (type(md.basalforcings).__name__ != mdname):
+-                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(mdname))
++                    raise TypeError('md.basalforcings does not agree with stochasticforcing field {}'.format(field))
++            if 'WaterPressure' in field:
++                mdname = structstoch[field]
++                if (type(md.friction).__name__ != mdname):
++                    raise TypeError('stochasticforcing field {} is only implemented for default friction'.format(field))
++                if (md.friction.coupling!=0 and md.friction.coupling!=1 and md.friction.coupling!=2):
++                    raise TypeError('stochasticforcing field {} is only implemented for cases md.friction.coupling 0 or 1 or 2'.format(field))
++                if (np.any(md.friction.q==0):
++                        raise TypeError('stochasticforcing field {} requires non-zero q exponent'.format(field))
++
+             # Checking for specific dimensions
+             if not (field == 'SMBautoregression' or field == 'FrontalForcingsRignotAutoregression'):
+                 checkdefaults = True # field with non-specific dimensionality
+@@ -172,6 +181,7 @@
+         """
+         structure = {'DefaultCalving': 'calving',
+                      'FloatingMeltRate': 'basalforcings',
++                     'FrictionWaterPressure': 'friction',
+                      'FrontalForcingsRignotAutoregression': 'frontalforcingsrignotautoregression',
+                      'SMBautoregression': 'SMBautoregression'}
+         return structure
+Index: ../trunk-jpl/test/NightlyRun/test621.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test621.py	(nonexistent)
++++ ../trunk-jpl/test/NightlyRun/test621.py	(revision 26676)
+@@ -0,0 +1,91 @@
++#Test Name: 79NorthStochFrictionWaterPressure
++import numpy as np
++
++from socket import gethostname
++from model import *
++from parameterize import *
++from setflowequation import *
++from setmask import *
++from solve import *
++from triangle import *
++
++
++md = triangle(model(), '../Exp/79North.exp', 6000)
++md = setmask(md, '../Exp/79NorthShelf.exp')
++md = parameterize(md, '../Par/79North.py')
++md = setflowequation(md, 'SSA', 'all')
++
++#Default friction
++md.friction         = friction()
++md.friction.coefficient = 30*np.ones(md.mesh.numberofvertices)
++md.friction.p           = 1*np.ones((md.mesh.numberofelements))
++md.friction.q           = 1*np.ones((md.mesh.numberofelements))
++
++# Basin separation default
++idb_df = np.zeros((md.mesh.numberofelements,))
++iid1 = np.where(md.mesh.y<=-1.08e6)[0]
++for ii in range(md.mesh.numberofelements):
++    for vertex in range(3):
++        if md.mesh.elements[ii][vertex] - 1 in iid1:  # one vertex in basin 1; NOTE: offset because of 1-based vertex indexing
++            idb_df[ii] = 1
++    if idb_df[ii] == 0:  # no vertex was found in basin 1
++        for vertex in range(3):
++            idb_df[ii] = 2
++#Covariance matrix
++covPw = np.array([[0.75e10,0.0],[0.0,0.5e10]])
++
++# Stochastic forcing
++md.stochasticforcing.isstochasticforcing = 1
++md.stochasticforcing.fields              = ['FrontalForcingsRignotAutoregression','DefaultCalving','FloatingMeltRate']
++md.stochasticforcing.defaultdimension    = 2
++md.stochasticforcing.default_id          = idb_df-1 #NOTE: offset because of 1-based vertex indexing
++md.stochasticforcing.covariance          = covPw # global covariance
++md.stochasticforcing.randomflag          = 0 # determines true/false randomness
++
++md.transient.issmb              = 0;
++md.transient.ismasstransport    = 1;
++md.transient.isstressbalance    = 1;
++md.transient.isthermal          = 0;
++md.transient.isgroundingline    = 0;
++
++md.transient.requested_outputs = ['default', 'FrictionWaterPressure']
++md.timestepping.start_time = 0
++md.timestepping.time_step  = 1
++md.timestepping.final_time = 5
++md.cluster = generic('name',gethostname(),'np',3)
++md = solve(md, 'Transient')
++
++# Fields and tolerances to track changes
++field_names = [
++    'Vx1','Vy1','Vel1','Thickness1','FrictionWaterPressure1',
++    'Vx2','Vy2','Vel2','Thickness2','FrictionWaterPressure2',
++    'Vx10','Vy10','Vel10','Thickness10','FrictionWaterPressure10'
++    ]
++
++field_tolerances = [
++    2e-10,2e-10,2e-10,2e-10,2e-10,
++    4e-10,4e-10,4e-10,4e-10,4e-10,
++    8e-10,8e-10,8e-10,8e-10,8e-10
++    ]
++
++field_values = [
++    md.results.TransientSolution[0].Vx,
++    md.results.TransientSolution[0].Vy,
++    md.results.TransientSolution[0].Vel,
++    md.results.TransientSolution[0].Thickness,
++    md.results.TransientSolution[0].FrictionWaterPressure,
++    md.results.TransientSolution[1].Vx,
++    md.results.TransientSolution[1].Vy,
++    md.results.TransientSolution[1].Vel,
++    md.results.TransientSolution[1].Thickness,
++    md.results.TransientSolution[1].FrictionWaterPressure,
++    md.results.TransientSolution[4].Vx,
++    md.results.TransientSolution[4].Vy,
++    md.results.TransientSolution[4].Vel,
++    md.results.TransientSolution[4].Thickness,
++    md.results.TransientSolution[4].FrictionWaterPressure
++    ]
++    
++
++
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26676-26677.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26676-26677.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26676-26677.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/stochasticforcing.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26676)
++++ ../trunk-jpl/src/m/classes/stochasticforcing.py	(revision 26677)
+@@ -88,7 +88,7 @@
+                     raise TypeError('stochasticforcing field {} is only implemented for default friction'.format(field))
+                 if (md.friction.coupling!=0 and md.friction.coupling!=1 and md.friction.coupling!=2):
+                     raise TypeError('stochasticforcing field {} is only implemented for cases md.friction.coupling 0 or 1 or 2'.format(field))
+-                if (np.any(md.friction.q==0):
++                if (np.any(md.friction.q==0)):
+                         raise TypeError('stochasticforcing field {} requires non-zero q exponent'.format(field))
+ 
+             # Checking for specific dimensions
Index: /issm/oecreview/Archive/25834-26739/ISSM-26677-26678.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26677-26678.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26677-26678.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test621.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test621.py	(revision 26677)
++++ ../trunk-jpl/test/NightlyRun/test621.py	(revision 26678)
+@@ -11,7 +11,7 @@
+ 
+ 
+ md = triangle(model(), '../Exp/79North.exp', 6000)
+-md = setmask(md, '../Exp/79NorthShelf.exp')
++md = setmask(md, '../Exp/79NorthShelf.exp','')
+ md = parameterize(md, '../Par/79North.py')
+ md = setflowequation(md, 'SSA', 'all')
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26678-26679.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26678-26679.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26678-26679.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test621.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test621.py	(revision 26678)
++++ ../trunk-jpl/test/NightlyRun/test621.py	(revision 26679)
+@@ -36,7 +36,7 @@
+ 
+ # Stochastic forcing
+ md.stochasticforcing.isstochasticforcing = 1
+-md.stochasticforcing.fields              = ['FrontalForcingsRignotAutoregression','DefaultCalving','FloatingMeltRate']
++md.stochasticforcing.fields              = ['FrictionWaterPressure']
+ md.stochasticforcing.defaultdimension    = 2
+ md.stochasticforcing.default_id          = idb_df-1 #NOTE: offset because of 1-based vertex indexing
+ md.stochasticforcing.covariance          = covPw # global covariance
Index: /issm/oecreview/Archive/25834-26739/ISSM-26679-26680.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26679-26680.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26679-26680.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m	(revision 26679)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m	(revision 26680)
+@@ -3,6 +3,8 @@
+ switch oshostname(),
+ 	case {'ronne'}
+ 		filename = '/home/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
++	case {'totten'}
++		filename = '/totten_1/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
+ 	otherwise
+ 		error('machine not supported yet');
+ end
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRignot2012.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRignot2012.m	(revision 26679)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpRignot2012.m	(revision 26680)
+@@ -1,6 +1,6 @@
+ function [vxout vyout]= interpRignot2012(X,Y),
+ 
+-filename = '/home/ModelData/Greenland/VelMouginot/RignotGreenland2012Vel.mat';
++filename = '/totten_1/ModelData/Greenland/VelMouginot/RignotGreenland2012Vel.mat';
+ 
+ 
+ %Figure out what subset of the matrix should be read
+Index: ../trunk-jpl/src/m/modules/ExpToLevelSet.m
+===================================================================
+--- ../trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26679)
++++ ../trunk-jpl/src/m/modules/ExpToLevelSet.m	(revision 26680)
+@@ -39,6 +39,9 @@
+ 		% append the NAME information at the end of the distance
+ 		if isfield(contourname(i),'NAME')
+ 			distance(end, i) = contourname(i).NAME;
++		elseif isfield(contourname(i),'Date')
++			distance(end, i) = date2decyear(datenum(contourname(i).Date));
++			% to deal with 
+ 		else
+ 			distance(end, i) = i;
+ 		end        
Index: /issm/oecreview/Archive/25834-26739/ISSM-26680-26681.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26680-26681.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26680-26681.diff	(revision 26740)
@@ -0,0 +1,304 @@
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26680)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26681)
+@@ -88,6 +88,11 @@
+ 	return input
+ 
+ end # }}}
++function FindParam(element::Tria,enum::IssmEnum) # {{{
++
++	return FindParam(element.parameters, enum)
++
++end # }}}
+ function InputServe!(element::Tria,input::ElementInput) # {{{
+ 
+ 	if input.interp==P0Enum
+@@ -144,11 +149,26 @@
+ 
+ 	return Jinv
+ end#}}}
++function NodalFunctions(element::Tria,basis::Vector{Float64}, gauss::GaussTria, ig::Int64, finiteelement::IssmEnum) #{{{
++
++	if(finiteelement==P0Enum)
++		#Nodal function 1
++		basis[1]= 1
++	elseif(finiteelement==P1Enum)
++		basis[1] = gauss.coords1[ig]
++		basis[2] = gauss.coords2[ig]
++		basis[3] = gauss.coords3[ig]
++	else
++		error("Element type ",finiteelement," not supported yet")
++	end
++
++
++end#}}}
+ function NodalFunctionsDerivatives(element::Tria,dbasis::Matrix{Float64},xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+ 
+ 	#Get nodal function derivatives in reference element
+ 	dbasis_ref = Matrix{Float64}(undef,3,2)
+-	NodalFunctionsDerivativesReference(dbasis_ref,gauss,P1Enum)
++	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,P1Enum)
+ 
+ 	#Get invert of the Jacobian
+ 	Jinv = JacobianInvert(xyz_list,gauss)
+@@ -162,12 +182,12 @@
+ 	end
+ 
+ end#}}}
+-function NodalFunctionsDerivativesReference(dbasis::Matrix{Float64}, gauss::GaussTria, finiteelement::IssmEnum) #{{{
++function NodalFunctionsDerivativesReferenceTria(dbasis::Matrix{Float64}, gauss::GaussTria, finiteelement::IssmEnum) #{{{
+ 
+ 	if(finiteelement==P0Enum)
+ 		#Nodal function 1
+-		dbasis[1,1]= 0.
+-		dbasis[1,2]= 0.
++		dbasis[1,1]= 0
++		dbasis[1,2]= 0
+ 
+ 	elseif(finiteelement==P1Enum)
+ 		#Nodal function 1
+@@ -183,3 +203,11 @@
+ 		error("Element type ",finiteelement," not supported yet")
+ 	end
+ end#}}}
++function NumberofNodesTria(finiteelement) #{{{
++
++	if    (finiteelement==P0Enum) return 0
++	elseif(finiteelement==P1Enum) return 3
++	else
++		error("Element type ",finiteelement," not supported yet")
++	end
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26680)
++++ ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26681)
+@@ -96,10 +96,22 @@
+ 	#set value
+ 	input.values[indices] = values
+ end#}}}
+-function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64)
++function GetInputAverageValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
+ 
++	numnodes = NumberofNodesTria(input.interp)
++	value = 0.0
++
++	for i in 1:numnodes
++		value+=input.element_values[i]
++	end
++
++	return value/numnodes
++
++end#}}}
++function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
++
+ 	if input.interp==P0Enum
+-		return input.element_value
++		return input.element_values
+ 	elseif input.interp==P1Enum
+ 		value = input.element_values[1]*gauss.coords1[i] +  input.element_values[2]*gauss.coords2[i] +  input.element_values[3]*gauss.coords3[i]
+ 	else
+@@ -109,3 +121,32 @@
+ 	return value
+ 
+ end#}}}
++function GetInputDerivativeValue(input::ElementInput,xyz_list::Matrix{Float64},gauss::GaussTria,i::Int64) #{{{
++
++	#Get nodal function derivatives in reference element
++	numnodes = NumberofNodesTria(input.interp)
++	dbasis_ref = Matrix{Float64}(undef,numnodes,2)
++	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,input.interp)
++
++	#Get invert of the Jacobian
++	Jinv = JacobianInvert(xyz_list,gauss)
++
++	#Build dbasis:
++	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
++	#[ dNi/dy ] =        [dNhat_i/ds]
++	dbasis = Matrix{Float64}(undef,numnodes,2)
++	for i in 1:3
++		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
++		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
++	end
++
++	#Get derivatives: dp/dx dp/dy
++	dp = [0.0;0.0]
++	for i in 1:3
++		dp[1] += dbasis[i,1]*input.element_values[i]
++		dp[2] += dbasis[i,2]*input.element_values[i]
++	end
++
++	return dp
++
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/matice.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/matice.jl	(revision 26680)
++++ ../trunk-jpl/src/jl/solve/matice.jl	(revision 26681)
+@@ -1,10 +1,44 @@
+ #Matice class definition
+-mutable struct Matice#{{{
++struct Matice#{{{
++	vx_input::ElementInput
++	vy_input::ElementInput
++	B_input::ElementInput
++	n_input::ElementInput
+ end# }}}
+ 
++function Matice(element::Tria) #{{{
++
++	vx_input  = GetInput(element, VxEnum)
++	vy_input  = GetInput(element, VyEnum)
++	B_input   = GetInput(element, MaterialsRheologyBEnum)
++	n_input   = GetInput(element, MaterialsRheologyNEnum)
++
++	return Matice(vx_input, vy_input, B_input, n_input)
++end#}}}
++
+ #vertices functions
+-function GetViscositySSA() #{{{
++function ViscositySSA(matice::Matice, xyz_list::Matrix{Float64}, gauss::GaussTria, i::Int64) #{{{
+ 
+-	error("not implemented")
++	#Get strain rate
++	dvx = GetInputDerivativeValue(matice.vx_input,xyz_list,gauss,i)
++	dvy = GetInputDerivativeValue(matice.vy_input,xyz_list,gauss,i)
++	eps_xx = dvx[1]
++	eps_yy = dvy[2]
++	eps_xy = 0.5*(dvx[2] + dvy[1])
++
++	#In SSA, eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy
++	eps_eff = sqrt(eps_xx*eps_xx + eps_yy*eps_yy + eps_xy*eps_xy + eps_xx*eps_yy)
++
++	#Get B and n
++	n = GetInputValue(matice.n_input, gauss, i)
++	B = GetInputValue(matice.B_input, gauss, i)
++
++	#Compute viscosity
++	if eps_eff==0.
++		mu = 1.e+14/2
++	else
++		mu = B/(2*eps_eff^((n-1)/n))
++	end
++
+ 	return mu
+ end #}}}
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26680)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26681)
+@@ -76,31 +76,69 @@
+ 
+ 	#Retrieve all inputs and parameters
+ 	xyz_list = GetVerticesCoordinates(element.vertices)
+-	vx_input = GetInput(element, VxEnum)
+-	vy_input = GetInput(element, VyEnum)
+ 	H_input  = GetInput(element, ThicknessEnum)
+ 
+ 	#Prepare material object
+-	material = Matice()
++	material = Matice(element)
+ 	
+ 	#Start integrating
+ 	gauss = GaussTria(2)
+-	for i in 1:gauss.numgauss
++	for ig in 1:gauss.numgauss
+ 
+ 		Jdet = JacobianDeterminant(xyz_list, gauss)
+ 		NodalFunctionsDerivatives(element,dbasis,xyz_list,gauss)
+ 
+-		H = GetInputValue(H_input, gauss, i)
++		H  = GetInputValue(H_input, gauss, ig)
++		mu = ViscositySSA(material, xyz_list, gauss, ig)
+ 
+-		error("STOP")
+-		vx = GetInputValue(vx_input, gauss, i)
+-		vy = GetInputValue(vy_input, gauss, i)
++		for i in 1:numnodes
++			for j in 1:numnodes
++				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,1]*dbasis[i,1] + dbasis[j,2]*dbasis[i,2])
++				Ke.values[2*i-1,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,2]*dbasis[i,1] + dbasis[j,1]*dbasis[i,2])
++				Ke.values[2*i  ,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,1]*dbasis[i,2] + dbasis[j,2]*dbasis[i,1])
++				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,2]*dbasis[i,2] + dbasis[j,1]*dbasis[i,1])
++			end
++		end
+ 	end
+ 
++	return Ke
++end #}}}
++function CreatePVector(analysis::StressbalanceAnalysis,element::Tria)# {{{
+ 
++	#Internmediaries
++	numnodes = 3
++
++	#Initialize Element vectro and basis functions
++	pe = ElementVector(element.nodes)
++	basis = Vector{Float64}(undef,numnodes)
++
++	#Retrieve all inputs and parameters
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	H_input  = GetInput(element, ThicknessEnum)
++	s_input  = GetInput(element, SurfaceEnum)
++	rho_ice  = FindParam(element, MaterialsRhoIceEnum)
++	g        = FindParam(element, ConstantsGEnum)
++
++	#Start integrating
++	gauss = GaussTria(2)
++	for ig in 1:gauss.numgauss
++
++		Jdet = JacobianDeterminant(xyz_list, gauss)
++		NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++		H  = GetInputValue(H_input, gauss, ig)
++		ds = GetInputDerivativeValue(s_input, xyz_list, gauss, ig)
++
++		for i in 1:numnodes
++			pe.values[2*i-1] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[1]*basis[i]
++			pe.values[2*i  ] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[2]*basis[i]
++		end
++	end
++
++	print(pe)
+ 	error("STOP")
+ 
+-	return Ke
++	return Pe
+ end #}}}
+ function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/elementmatrix.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26680)
++++ ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26681)
+@@ -42,7 +42,7 @@
+ 	nrows = NumberOfDofs(nodes,GsetEnum)
+ 
+ 	#Initialize element matrix with zeros
+-	values = zeros(nrows,nrows)
++	values = zeros(nrows)
+ 
+ 	#Get dof list
+ 	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
+@@ -53,9 +53,7 @@
+ 
+ 	println(io,"ElementVector:")
+ 	println(io,"   nrows: ",this.nrows)
+-	println(io,"   gglobaldoflist: ",this.gglobaldoflist)
+ 	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
+-	println(io,"   sglobaldoflist: ",this.sglobaldoflist)
+ 	print(io,"   values: ")
+ 	display(this.values)
+ end# }}}
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26680)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26681)
+@@ -78,6 +78,7 @@
+ 	AddParam(parameters,md.materials.rho_ice,MaterialsRhoIceEnum)
+ 	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
+ 	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
++	AddParam(parameters,md.constants.g,ConstantsGEnum)
+ end# }}}
+ function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26681-26682.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26681-26682.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26681-26682.diff	(revision 26740)
@@ -0,0 +1,249 @@
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26681)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26682)
+@@ -135,10 +135,7 @@
+ 		end
+ 	end
+ 
+-	print(pe)
+-	error("STOP")
+-
+-	return Pe
++	return pe
+ end #}}}
+ function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/elementmatrix.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26681)
++++ ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26682)
+@@ -30,7 +30,38 @@
+ 	print(io,"   values: ")
+ 	display(this.values)
+ end# }}}
++function AddToGlobal!(Ke::ElementMatrix,Kff::IssmMatrix,Kfs::IssmMatrix)#{{{
+ 
++	#First check that the element matrix looks alright
++	CheckConsistency(Ke)
++
++	#See if we need to do anything
++	is_fset = false
++	is_sset = false
++	for i in 1:Ke.nrows
++		if(Ke.fglobaldoflist[i]>0) is_fset = true end
++		if(Ke.sglobaldoflist[i]>0) is_sset = true end
++	end
++
++	if is_fset
++		AddValues!(Kff,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.fglobaldoflist,Ke.values)
++	end
++	if is_sset
++		AddValues!(Kfs,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.sglobaldoflist,Ke.values)
++	end
++
++end#}}}
++function CheckConsistency(Ke::ElementMatrix)#{{{
++
++	for i in 1:Ke.nrows
++		for j in 1:Ke.nrows
++			if(isnan(Ke.values[i,j])) error("NaN found in Element Matrix") end
++			if(isinf(Ke.values[i,j])) error("Inf found in Element Matrix") end
++			if(abs(Ke.values[i,j])>1.e+50) error("Element Matrix values exceeds 1.e+50") end
++		end
++	end
++end#}}}
++
+ mutable struct ElementVector#{{{
+ 	nrows::Int64
+ 	fglobaldoflist::Vector{Int64}
+@@ -57,3 +88,30 @@
+ 	print(io,"   values: ")
+ 	display(this.values)
+ end# }}}
++function AddToGlobal!(pe::ElementVector,pf::IssmVector)#{{{
++
++	#First check that the element matrix looks alright
++	CheckConsistency(pe)
++
++	#See if we need to do anything
++	is_fset = false
++	for i in 1:pe.nrows
++		if(pe.fglobaldoflist[i]>0)
++			is_fset = true 
++			break
++		end
++	end
++
++	if is_fset
++		AddValues!(pf,pe.nrows,pe.fglobaldoflist,pe.values)
++	end
++
++end#}}}
++function CheckConsistency(pe::ElementVector)#{{{
++
++	for i in 1:pe.nrows
++		if(isnan(pe.values[i])) error("NaN found in Element Vector") end
++		if(isinf(pe.values[i])) error("Inf found in Element Vector") end
++		if(abs(pe.values[i])>1.e+50) error("Element Vector values exceeds 1.e+50") end
++	end
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26681)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26682)
+@@ -170,14 +170,26 @@
+ 	pf  = IssmVector(fsize)
+ 
+ 	#Construct Stiffness matrix and load vector from elements
+-	for i=1:length(femmodel.elements)
++	for i in 1:length(femmodel.elements)
+ 		Ke = CreateKMatrix(analysis,femmodel.elements[i])
+ 		pe = CreatePVector(analysis,femmodel.elements[i])
+-		print(Ke)
+-		error("don't know what to do")
++
++		AddToGlobal!(Ke,Kff,Kfs)
++		AddToGlobal!(pe,pf)
+ 	end
+ 	
+-	
+-	
+-	error("STOP")
++	return Kff, Kfs, pf
+ end# }}}
++function CreateNodalConstraintsx(nodes::Vector{Node})# {{{
++
++	#Allocate vector
++	ssize=NumberOfDofs(nodes,SsetEnum)
++	ys=IssmVector(ssize)
++
++	#constraints vector with the constraint values
++	for i in 1:length(nodes)
++		CreateNodalConstraints(nodes[i],ys)
++	end
++
++	return ys
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26681)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26682)
+@@ -31,6 +31,13 @@
+ 	node.svalues[dof]   = value
+ 
+ end# }}}
++function CreateNodalConstraints(node::Node,ys::IssmVector) #{{{
++
++	if(SSize(node)>0)
++		SetValues!(ys,node.gsize,node.sdoflist,node.svalues)
++	end
++
++end# }}}
+ function DistributeDofs(node::Node,setenum::IssmEnum,dofcount::Int64) #{{{
+ 
+ 	if setenum==GsetEnum
+@@ -137,7 +144,20 @@
+ 	end
+ 
+ end# }}}
++function SSize(node::Node) #{{{
+ 
++	ssize = 0
++
++	for i=1:node.gsize
++		if node.fdoflist[i]!=-1
++			ssize+=1
++		end
++	end
++
++	return ssize
++
++end# }}}
++
+ #Nodes functions
+ function RequiresDofReindexing(nodes::Vector{Node}) #{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26681)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26682)
+@@ -16,6 +16,10 @@
+ 
+ 		#Get new matrices
+ 		Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
++
++		#Enforce constraints
++		ys = CreateNodalConstraintsx(femmodel.nodes)
++
+ 		error("not implemented yet")
+ 
+ 		#Increase count
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26681)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26682)
+@@ -1,5 +1,6 @@
+ include("../md/classes.jl")
+ include("./issmenums.jl")
++include("./toolkits.jl")
+ include("./gauss.jl")
+ include("./parameters.jl")
+ include("./inputs.jl")
+@@ -13,9 +14,8 @@
+ include("./analyses/stressbalanceanalysis.jl")
+ include("./solutionsequences.jl")
+ include("./modules.jl")
+-include("./toolkits.jl")
++include("./elementmatrix.jl")
+ include("./utils.jl")
+-include("./elementmatrix.jl")
+ 
+ function IssmCore(md::model) #{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26681)
++++ ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26682)
+@@ -7,6 +7,19 @@
+ function IssmMatrix(M::Int64,N::Int64)#{{{
+ 	return IssmMatrix(spzeros(M,N))
+ end#}}}
++function AddValues!(matrix::IssmMatrix,m::Int64,midx::Vector{Int64},n::Int64,nidx::Vector{Int64},values::Matrix{Float64})#{{{
++
++	#This is inefficient now, but it will work
++	for i in 1:m
++		if(midx[i]==-1) continue end
++		for j in 1:n
++			if(nidx[j]==-1) continue end
++			matrix.matrix[midx[i],nidx[j]] += values[i,j]
++		end
++	end
++
++end#}}}
++
+ mutable struct IssmVector #{{{
+ 	vector::Vector{Float64}
+ end #}}}
+@@ -13,3 +26,21 @@
+ function IssmVector(M::Int64)#{{{
+ 	return IssmVector(zeros(M))
+ end#}}}
++function AddValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
++
++	#This is inefficient now, but it will work
++	for i in 1:m
++		if(midx[i]==-1) continue end
++		vector.vector[midx[i]] += values[i]
++	end
++
++end#}}}
++function SetValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
++
++	#This is inefficient now, but it will work
++	for i in 1:m
++		if(midx[i]==-1) continue end
++		vector.vector[midx[i]] = values[i]
++	end
++
++end#}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26682-26683.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26682-26683.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26682-26683.diff	(revision 26740)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26682)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 26683)
+@@ -27,6 +27,7 @@
+ end
+ if nargin<5
+ 	ncdate='2020-07-15'; %BedMachine v2
++	ncdate='2021-11-16'; %BedMachine v2
+ end
+ basename = 'BedMachineAntarctica';
+ 
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m	(revision 26682)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m	(revision 26683)
+@@ -53,6 +53,8 @@
+ switch (oshostname()),
+ 	case {'ronne'}
+ 		nc = '/home/ModelData/Antarctica/MouginotVel/ASE_TimeSeries_1973-2018.nc';
++	case {'totten'}
++		nc = '/totten_1/ModelData/Antarctica/MouginotVel/ASE_TimeSeries_1973-2018.nc';
+ 	otherwise
+ 		error('hostname not supported yet');
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26683-26684.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26683-26684.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26683-26684.diff	(revision 26740)
@@ -0,0 +1,44 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26683)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26684)
+@@ -2189,7 +2189,7 @@
+ 
+ 	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+ 	/*Deal with partially ice-covered elements*/
+-	if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++	if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+ 		bool        istrapneg;
+ 		int         point;
+ 		IssmDouble  f1,f2,phi;
+@@ -4403,7 +4403,7 @@
+ 
+ 	/*Now get the average SMB over the element*/
+ 	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+-   if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++   if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+ 		/*Partially ice-covered element*/
+ 		bool mainlyice;
+       int point;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26683)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26684)
+@@ -3548,7 +3548,7 @@
+    IssmDouble lsf[NUMVERTICES];
+ 	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+    /*Deal with partially ice-covered elements*/
+-	if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++	if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+ 		bool istrapneg;
+       int point;
+       IssmDouble* weights  = xNew<IssmDouble>(NUMVERTICES);
+@@ -5495,7 +5495,7 @@
+ 	
+ 	/*Now get the average SMB over the element*/
+ 	Element::GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+-	if(false && (lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0)){
++	if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+ 		/*Partially ice-covered element*/
+ 		bool mainlyice;
+       int point;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26684-26685.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26684-26685.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26684-26685.diff	(revision 26740)
@@ -0,0 +1,274 @@
+Index: ../trunk-jpl/test/Archives/Archive540.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive541.arch
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/NightlyRun/test540.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.m	(revision 26684)
++++ ../trunk-jpl/test/NightlyRun/test540.m	(revision 26685)
+@@ -16,6 +16,7 @@
+ pos = find(md.mesh.vertexonboundary);
+ md.levelset.spclevelset(pos) = md.mask.ice_levelset(pos);
+ md.levelset.migration_max = 1e10;
++md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb'};
+ 
+ %Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28=1;
+@@ -25,13 +26,19 @@
+ %Fields and tolerances to track changes
+ field_names ={...
+ 	'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1' ,...
++	'IceVolume1' ,'IceVolumeAboveFloatation1' ,'TotalSmb1' ,'TotalGroundedBmb1' ,'TotalFloatingBmb1' ,...
+ 	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,...
++	'IceVolume2' ,'IceVolumeAboveFloatation2' ,'TotalSmb2' ,'TotalGroundedBmb2' ,'TotalFloatingBmb2' ,...
+ 	'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10',...
++	'IceVolume10' ,'IceVolumeAboveFloatation10' ,'TotalSmb10' ,'TotalGroundedBmb10' ,'TotalFloatingBmb10' ,...
+ 	};
+ field_tolerances={...
+ 	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-12,...
++	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-9,...
++	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+@@ -42,6 +49,11 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).MaskIceLevelset),...
++	(md.results.TransientSolution(1).IceVolume),...
++	(md.results.TransientSolution(1).IceVolumeAboveFloatation),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vel),...
+@@ -50,6 +62,11 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).MaskIceLevelset),...
++	(md.results.TransientSolution(2).IceVolume),...
++	(md.results.TransientSolution(2).IceVolumeAboveFloatation),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
+ 	(md.results.TransientSolution(10).Vx),...
+ 	(md.results.TransientSolution(10).Vy),...
+ 	(md.results.TransientSolution(10).Vel),...
+@@ -58,4 +75,9 @@
+ 	(md.results.TransientSolution(10).Surface),...
+ 	(md.results.TransientSolution(10).Thickness),...
+ 	(md.results.TransientSolution(10).MaskIceLevelset),...
++	(md.results.TransientSolution(10).IceVolume),...
++	(md.results.TransientSolution(10).IceVolumeAboveFloatation),...
++	(md.results.TransientSolution(10).TotalSmb),...
++	(md.results.TransientSolution(10).TotalGroundedBmb),...
++	(md.results.TransientSolution(10).TotalFloatingBmb),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test540.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.py	(revision 26684)
++++ ../trunk-jpl/test/NightlyRun/test540.py	(revision 26685)
+@@ -26,6 +26,7 @@
+ pos = np.where(md.mesh.vertexonboundary)
+ md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
+ md.levelset.migration_max = 1e10
++md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb']
+ 
+ #Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+@@ -34,11 +35,17 @@
+ 
+ #Fields and tolerances to track changes
+ field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1',
++               'IceVolume1', 'IceVolumeAboveFloatation1', 'TotalSmb1', 'TotalGroundedBmb1', 'TotalFloatingBmb1',
+                'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2',
+-               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10']
++               'IceVolume2', 'IceVolumeAboveFloatation2', 'TotalSmb2', 'TotalGroundedBmb2', 'TotalFloatingBmb2',
++               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10',
++               'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
+ field_tolerances = [1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-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]
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-9,
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+ field_values = [md.results.TransientSolution[0].Vx,
+                 md.results.TransientSolution[0].Vy,
+                 md.results.TransientSolution[0].Vel,
+@@ -47,6 +54,11 @@
+                 md.results.TransientSolution[0].Surface,
+                 md.results.TransientSolution[0].Thickness,
+                 md.results.TransientSolution[0].MaskIceLevelset,
++                md.results.TransientSolution[0].IceVolume,
++                md.results.TransientSolution[0].IceVolumeAboveFloatation,
++                md.results.TransientSolution[0].TotalSmb,
++                md.results.TransientSolution[0].TotalGroundedBmb,
++                md.results.TransientSolution[0].TotalFloatingBmb,
+                 md.results.TransientSolution[1].Vx,
+                 md.results.TransientSolution[1].Vy,
+                 md.results.TransientSolution[1].Vel,
+@@ -55,6 +67,11 @@
+                 md.results.TransientSolution[1].Surface,
+                 md.results.TransientSolution[1].Thickness,
+                 md.results.TransientSolution[1].MaskIceLevelset,
++                md.results.TransientSolution[1].IceVolume,
++                md.results.TransientSolution[1].IceVolumeAboveFloatation,
++                md.results.TransientSolution[1].TotalSmb,
++                md.results.TransientSolution[1].TotalGroundedBmb,
++                md.results.TransientSolution[1].TotalFloatingBmb,
+                 md.results.TransientSolution[9].Vx,
+                 md.results.TransientSolution[9].Vy,
+                 md.results.TransientSolution[9].Vel,
+@@ -62,4 +79,9 @@
+                 md.results.TransientSolution[9].Base,
+                 md.results.TransientSolution[9].Surface,
+                 md.results.TransientSolution[9].Thickness,
+-                md.results.TransientSolution[9].MaskIceLevelset]
++                md.results.TransientSolution[9].MaskIceLevelset.
++                md.results.TransientSolution[9].IceVolume,
++                md.results.TransientSolution[9].IceVolumeAboveFloatation,
++                md.results.TransientSolution[9].TotalSmb,
++                md.results.TransientSolution[9].TotalGroundedBmb,
++                md.results.TransientSolution[9].TotalFloatingBmb]
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 26684)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 26685)
+@@ -16,6 +16,7 @@
+ pos = find(md.mesh.vertexonboundary);
+ md.levelset.spclevelset(pos) = md.mask.ice_levelset(pos);
+ md.levelset.migration_max = 1e10;
++md.transient.requested_outputs={'default','IceVolume','IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb'};
+ 
+ %Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28=1;
+@@ -25,13 +26,19 @@
+ %Fields and tolerances to track changes
+ field_names ={...
+ 	'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1' ,...
++	'IceVolume1' ,'IceVolumeAboveFloatation1' ,'TotalSmb1' ,'TotalGroundedBmb1' ,'TotalFloatingBmb1' ,...
++	'IceVolume2' ,'IceVolumeAboveFloatation2' ,'TotalSmb2' ,'TotalGroundedBmb2' ,'TotalFloatingBmb2' ,...
+ 	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,...
+ 	'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10',...
++	'IceVolume10' ,'IceVolumeAboveFloatation10' ,'TotalSmb10' ,'TotalGroundedBmb10' ,'TotalFloatingBmb10' ,...
+ 	};
+ field_tolerances={...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
++	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+ 	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
++	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+ 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
++	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+ 	};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+@@ -42,6 +49,11 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).MaskIceLevelset),...
++	(md.results.TransientSolution(1).IceVolume),...
++	(md.results.TransientSolution(1).IceVolumeAboveFloatation),...
++	(md.results.TransientSolution(1).TotalSmb),...
++	(md.results.TransientSolution(1).TotalGroundedBmb),...
++	(md.results.TransientSolution(1).TotalFloatingBmb),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vel),...
+@@ -50,6 +62,11 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).MaskIceLevelset),...
++	(md.results.TransientSolution(2).IceVolume),...
++	(md.results.TransientSolution(2).IceVolumeAboveFloatation),...
++	(md.results.TransientSolution(2).TotalSmb),...
++	(md.results.TransientSolution(2).TotalGroundedBmb),...
++	(md.results.TransientSolution(2).TotalFloatingBmb),...
+ 	(md.results.TransientSolution(10).Vx),...
+ 	(md.results.TransientSolution(10).Vy),...
+ 	(md.results.TransientSolution(10).Vel),...
+@@ -58,4 +75,9 @@
+ 	(md.results.TransientSolution(10).Surface),...
+ 	(md.results.TransientSolution(10).Thickness),...
+ 	(md.results.TransientSolution(10).MaskIceLevelset),...
++	(md.results.TransientSolution(10).IceVolume),...
++	(md.results.TransientSolution(10).IceVolumeAboveFloatation),...
++	(md.results.TransientSolution(10).TotalSmb),...
++	(md.results.TransientSolution(10).TotalGroundedBmb),...
++	(md.results.TransientSolution(10).TotalFloatingBmb),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26684)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26685)
+@@ -26,6 +26,7 @@
+ pos = np.where(md.mesh.vertexonboundary)
+ md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
+ md.levelset.migration_max = 1e10
++md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeAboveFloatation','TotalSmb','TotalGroundedBmb','TotalFloatingBmb']
+ 
+ #Force MUMPS sequential analysis
+ md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+@@ -34,11 +35,17 @@
+ 
+ #Fields and tolerances to track changes
+ field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1',
++               'IceVolume1', 'IceVolumeAboveFloatation1', 'TotalSmb1', 'TotalGroundedBmb1', 'TotalFloatingBmb1',
+                'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2',
+-               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10']
++               'IceVolume2', 'IceVolumeAboveFloatation2', 'TotalSmb2', 'TotalGroundedBmb2', 'TotalFloatingBmb2',
++               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10',
++               'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
+ field_tolerances = [1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12,
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                     2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
+-                    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9]
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
++                    1e-12, 2e-12, 2e-12, 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,
+@@ -47,6 +54,11 @@
+                 md.results.TransientSolution[0].Surface,
+                 md.results.TransientSolution[0].Thickness,
+                 md.results.TransientSolution[0].MaskIceLevelset,
++                md.results.TransientSolution[0].IceVolume,
++                md.results.TransientSolution[0].IceVolumeAboveFloatation,
++                md.results.TransientSolution[0].TotalSmb,
++                md.results.TransientSolution[0].TotalGroundedBmb,
++                md.results.TransientSolution[0].TotalFloatingBmb,
+                 md.results.TransientSolution[1].Vx,
+                 md.results.TransientSolution[1].Vy,
+                 md.results.TransientSolution[1].Vel,
+@@ -55,6 +67,11 @@
+                 md.results.TransientSolution[1].Surface,
+                 md.results.TransientSolution[1].Thickness,
+                 md.results.TransientSolution[1].MaskIceLevelset,
++                md.results.TransientSolution[1].IceVolume,
++                md.results.TransientSolution[1].IceVolumeAboveFloatation,
++                md.results.TransientSolution[1].TotalSmb,
++                md.results.TransientSolution[1].TotalGroundedBmb,
++                md.results.TransientSolution[1].TotalFloatingBmb,
+                 md.results.TransientSolution[9].Vx,
+                 md.results.TransientSolution[9].Vy,
+                 md.results.TransientSolution[9].Vel,
+@@ -62,4 +79,9 @@
+                 md.results.TransientSolution[9].Base,
+                 md.results.TransientSolution[9].Surface,
+                 md.results.TransientSolution[9].Thickness,
+-                md.results.TransientSolution[9].MaskIceLevelset]
++                md.results.TransientSolution[9].MaskIceLevelset,
++                md.results.TransientSolution[9].IceVolume,
++                md.results.TransientSolution[9].IceVolumeAboveFloatation,
++                md.results.TransientSolution[9].TotalSmb,
++                md.results.TransientSolution[9].TotalGroundedBmb,
++                md.results.TransientSolution[9].TotalFloatingBmb]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26685-26686.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26685-26686.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26685-26686.diff	(revision 26740)
@@ -0,0 +1,198 @@
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26685)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26686)
+@@ -137,7 +137,7 @@
+ 
+ 	return pe
+ end #}}}
+-function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
++function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::IssmVector,element::Tria) #{{{
+ 
+ 	#Get dofs for this finite element
+ 	doflist = GetDofList(element,GsetEnum)
+@@ -155,9 +155,9 @@
+ 		vy = GetInputValue(vy_input, gauss, i)
+ 
+ 		count += 1
+-		ug[doflist[count]] = vx
++		ug.vector[doflist[count]] = vx
+ 		count += 1
+-		ug[doflist[count]] = vy
++		ug.vector[doflist[count]] = vy
+ 	end
+ 
+ 	#Make sure we reached all the values
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26685)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26686)
+@@ -124,7 +124,7 @@
+ 	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
+ 
+ 	#Initialize solution vector
+-	ug = Vector{Float64}(undef,gsize)
++	ug = IssmVector(gsize)
+ 
+ 	#Go through elements and plug in solution
+ 	for i=1:length(femmodel.elements)
+@@ -134,32 +134,50 @@
+ 	return ug
+ 
+ end#}}}
+-function InputUpdateFromSolutionx(analysis::Analysis,ug::Vector{Float64},femmodel::FemModel) #{{{
++function InputUpdateFromSolutionx(analysis::Analysis,ug::IssmVector,femmodel::FemModel) #{{{
+ 
+ 	#Go through elements and plug in solution
+ 	for i=1:length(femmodel.elements)
+-		InputUpdateFromSolution(analysis,ug,femmodel.elements[i])
++		InputUpdateFromSolution(analysis,ug.vector,femmodel.elements[i])
+ 	end
+ 
+ 	return ug
+ 
+ end#}}}
+-function Reducevectorgtofx(ug::Vector{Float64},nodes::Vector{Node}) #{{{
++function Reducevectorgtofx(ug::IssmVector,nodes::Vector{Node}) #{{{
+ 
+ 	#Get size of output vector
+ 	fsize = NumberOfDofs(nodes,FsetEnum)
+ 
+ 	#Initialize output vector
+-	uf = Vector{Float64}(undef,fsize)
++	uf = IssmVector(fsize)
+ 
+ 	#Go through elements and plug in solution
+ 	for i=1:length(nodes)
+-		VecReduce(nodes[i],ug,uf)
++		VecReduce(nodes[i],ug.vector,uf)
+ 	end
+ 
+ 	return ug
+ 
+ end#}}}
++function Reduceloadx!(pf::IssmVector, Kfs::IssmMatrix, ys::IssmVector) #{{{
++
++	#Is there anything to do?
++	m, n = GetSize(Kfs)
++
++	if(m*n>0)
++
++		#Allocate Kfs*ys
++		Kfsy_s=IssmVector(m)
++
++		#Perform multiplication
++		MatMult!(Kfs,ys,Kfsy_s)
++
++		#Subtract Kfs*ys from pf
++		AXPY!(pf,-1.0,Kfsy_s)
++
++	end
++end#}}}
+ function SystemMatricesx(femmodel::FemModel,analysis::Analysis)# {{{
+ 
+ 	#Allocate matrices
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26685)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26686)
+@@ -135,11 +135,11 @@
+ 	return doflist
+ 
+ end# }}}
+-function VecReduce(node::Node,ug::Vector{Float64},uf::Vector{Float64}) #{{{
++function VecReduce(node::Node,ug::Vector{Float64},uf::IssmVector) #{{{
+ 
+ 	for i=1:node.gsize
+ 		if node.fdoflist[i]!=-1
+-			uf[node.fdoflist[i]] = ug[node.gdoflist[i]]
++			uf.vector[node.fdoflist[i]] = ug[node.gdoflist[i]]
+ 		end
+ 	end
+ 
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26685)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26686)
+@@ -19,9 +19,15 @@
+ 
+ 		#Enforce constraints
+ 		ys = CreateNodalConstraintsx(femmodel.nodes)
++		Reduceloadx!(pf, Kfs, ys)
+ 
+-		error("not implemented yet")
++		#Solve!
++		old_uf = uf
++		uf = Solverx(Kff, pf, old_uf)
+ 
++		print(uf)
++		error("compare with ISSM...")
++
+ 		#Increase count
+ 		count += 1
+ 		if(count>maxiter)
+Index: ../trunk-jpl/src/jl/solve/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26685)
++++ ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26686)
+@@ -1,6 +1,8 @@
+ 
+ #Toolkit #1: serial sparse arrays
+ using SparseArrays
++
++#Matrix
+ mutable struct IssmMatrix #{{{
+ 	matrix::SparseMatrixCSC{Float64,Int64}
+ end #}}}
+@@ -19,7 +21,13 @@
+ 	end
+ 
+ end#}}}
++function GetSize(matrix::IssmMatrix)#{{{
+ 
++	return size(matrix.matrix)
++
++end#}}}
++
++#Vector
+ mutable struct IssmVector #{{{
+ 	vector::Vector{Float64}
+ end #}}}
+@@ -26,6 +34,11 @@
+ function IssmVector(M::Int64)#{{{
+ 	return IssmVector(zeros(M))
+ end#}}}
++function GetSize(vector::IssmVector)#{{{
++
++	return length(vector.vector)
++
++end#}}}
+ function AddValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
+ 
+ 	#This is inefficient now, but it will work
+@@ -44,3 +57,25 @@
+ 	end
+ 
+ end#}}}
++
++#Operations
++function MatMult!(A::IssmMatrix,x::IssmVector,y::IssmVector) #{{{
++
++	y.vector = A.matrix*x.vector
++
++end#}}}
++function AXPY!(y::IssmVector,alpha::Float64,x::IssmVector) #{{{
++
++	y.vector = alpha*x.vector + y.vector
++
++end#}}}
++function Solverx(A::IssmMatrix,b::IssmVector,xold::IssmVector) #{{{
++
++	x = IssmVector(GetSize(xold))
++	x.vector = (b.vector\A.matrix)' #not sure why we need to transpose... that's a mystery!
++
++	return x
++
++
++end#}}}
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26686-26687.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26686-26687.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26686-26687.diff	(revision 26740)
@@ -0,0 +1,84 @@
+Index: ../trunk-jpl/test/NightlyRun/test540.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.m	(revision 26686)
++++ ../trunk-jpl/test/NightlyRun/test540.m	(revision 26687)
+@@ -34,11 +34,11 @@
+ 	};
+ field_tolerances={...
+ 	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
+-	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-12,2e-12,2e-12,1e-13,1e-13,...
+ 	1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-12,...
+-	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-12,2e-12,2e-12,1e-13,1e-13,...
+ 	1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-9,...
+-	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,...
++	1e-12,2e-12,2e-12,1e-13,1e-13,...
+ 	};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test540.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.py	(revision 26686)
++++ ../trunk-jpl/test/NightlyRun/test540.py	(revision 26687)
+@@ -41,11 +41,11 @@
+                'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10',
+                'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
+ field_tolerances = [1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+                     1e-12, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-12,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+                     1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-9,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13]
+ field_values = [md.results.TransientSolution[0].Vx,
+                 md.results.TransientSolution[0].Vy,
+                 md.results.TransientSolution[0].Vel,
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 26686)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 26687)
+@@ -27,18 +27,18 @@
+ field_names ={...
+ 	'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1' ,...
+ 	'IceVolume1' ,'IceVolumeAboveFloatation1' ,'TotalSmb1' ,'TotalGroundedBmb1' ,'TotalFloatingBmb1' ,...
++	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,...
+ 	'IceVolume2' ,'IceVolumeAboveFloatation2' ,'TotalSmb2' ,'TotalGroundedBmb2' ,'TotalFloatingBmb2' ,...
+-	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,...
+ 	'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10',...
+ 	'IceVolume10' ,'IceVolumeAboveFloatation10' ,'TotalSmb10' ,'TotalGroundedBmb10' ,'TotalFloatingBmb10' ,...
+ 	};
+ field_tolerances={...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+-	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
++	1e-11,2e-11,2e-11,1e-12,2e-11,...
+ 	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
+-	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
++	1e-11,2e-11,2e-11,1e-12,2e-11,...
+ 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+-	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
++	1e-11,2e-11,2e-11,1e-12,2e-11,...
+ 	};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26686)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26687)
+@@ -41,11 +41,11 @@
+                'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10',
+                'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
+ field_tolerances = [1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+                     2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+                     2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
++                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13]
+ field_values = [md.results.TransientSolution[0].Vx,
+                 md.results.TransientSolution[0].Vy,
+                 md.results.TransientSolution[0].Vel,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26687-26688.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26687-26688.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26687-26688.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test540.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test540.py	(revision 26687)
++++ ../trunk-jpl/test/NightlyRun/test540.py	(revision 26688)
+@@ -79,7 +79,7 @@
+                 md.results.TransientSolution[9].Base,
+                 md.results.TransientSolution[9].Surface,
+                 md.results.TransientSolution[9].Thickness,
+-                md.results.TransientSolution[9].MaskIceLevelset.
++                md.results.TransientSolution[9].MaskIceLevelset,
+                 md.results.TransientSolution[9].IceVolume,
+                 md.results.TransientSolution[9].IceVolumeAboveFloatation,
+                 md.results.TransientSolution[9].TotalSmb,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26688-26689.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26688-26689.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26688-26689.diff	(revision 26740)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/test/NightlyRun/test494.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test494.py	(revision 26688)
++++ ../trunk-jpl/test/NightlyRun/test494.py	(revision 26689)
+@@ -38,7 +38,7 @@
+ field_tolerances = [
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+     2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+-    2e-13, 2e-13, 2e-13, 1e-13, 2e-13, 4e-13, 9e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
++    2e-13, 2e-13, 2e-13, 1e-13, 2e-13, 6e-13, 9e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 
+ ]
+ field_values = [
+     md.results.TransientSolution[0].Vx,
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 26688)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 26689)
+@@ -38,7 +38,7 @@
+ 	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,...
+ 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+-	1e-11,2e-11,2e-11,1e-12,2e-11,...
++	1e-11,2e-11,2e-11,2e-08,2e-11,...
+ 	};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26688)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26689)
+@@ -45,7 +45,7 @@
+                     2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
+                     1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+                     2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13]
++                    1e-12, 2e-12, 2e-12, 8e-09, 1e-13]
+ field_values = [md.results.TransientSolution[0].Vx,
+                 md.results.TransientSolution[0].Vy,
+                 md.results.TransientSolution[0].Vel,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26689-26690.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26689-26690.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26689-26690.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26689)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26690)
+@@ -43,7 +43,7 @@
+ field_tolerances = [1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12,
+                     1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+                     2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
++                    1e-12, 2e-12, 2e-12, 2e-08, 1e-13,
+                     2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+                     1e-12, 2e-12, 2e-12, 8e-09, 1e-13]
+ field_values = [md.results.TransientSolution[0].Vx,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26690-26691.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26690-26691.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26690-26691.diff	(revision 26740)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26690)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 26691)
+@@ -3551,10 +3551,10 @@
+ 	if(lsf[0]*lsf[1]<=0 || lsf[0]*lsf[2]<=0 || lsf[1]*lsf[2]<=0){
+ 		bool istrapneg;
+       int point;
+-      IssmDouble* weights  = xNew<IssmDouble>(NUMVERTICES);
+-      IssmDouble* surfaces = xNew<IssmDouble>(NUMVERTICES);
+-      IssmDouble* bases    = xNew<IssmDouble>(NUMVERTICES);
+-      IssmDouble* Hice     = xNew<IssmDouble>(NUMVERTICES);
++      IssmDouble weights[NUMVERTICES];
++      IssmDouble surfaces[NUMVERTICES];
++      IssmDouble bases[NUMVERTICES];
++      IssmDouble Hice[NUMVERTICES];
+       IssmDouble area_basetot,f1,f2,phi;
+       /*Average thickness over subelement*/
+ 		Element::GetInputListOnVertices(&surfaces[0],SurfaceEnum);
+@@ -3577,12 +3577,6 @@
+ 			area_base = area_base*scalefactor;
+ 			xDelete<IssmDouble>(scalefactor_vertices);
+ 		}
+-
+-		/*Cleanup*/
+-		xDelete<IssmDouble>(weights);
+-		xDelete<IssmDouble>(surfaces);
+-		xDelete<IssmDouble>(bases);
+-		xDelete<IssmDouble>(Hice);
+    }
+ 	else{
+ 		/*First get back the area of the base*/
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26690)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26691)
+@@ -2193,7 +2193,7 @@
+ 		bool        istrapneg;
+ 		int         point;
+ 		IssmDouble  f1,f2,phi;
+-		IssmDouble* heights = xNew<IssmDouble>(NUMVERTICES2D);
++		IssmDouble  heights[NUMVERTICES2D];
+ 		IssmDouble  weights[NUMVERTICES2D];
+ 		IssmDouble  lsf2d[NUMVERTICES2D];
+ 		for(int i=0;i<NUMVERTICES2D;i++){
+@@ -2218,7 +2218,6 @@
+ 			base = base*scalefactor;
+ 			xDelete<IssmDouble>(scalefactor_vertices);
+ 		}
+-		xDelete<IssmDouble>(heights); 
+ 	}
+ 
+ 	else{ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26691-26692.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26691-26692.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26691-26692.diff	(revision 26740)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26691)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26692)
+@@ -1246,7 +1246,6 @@
+    IssmDouble         f1,f2,phi;
+ 
+    /*Weights*/
+-   Gauss* gauss = NULL;
+    IssmDouble loadweights_g[NUMVERTICES2D];
+    IssmDouble total_weight = 0;
+ 
+@@ -1291,11 +1290,11 @@
+ 		}
+ 		else _error_("case not possible");
+ 	}
+-	if(trapezeisnegative) phi = 1-f1*f2;
++	if(trapezeisnegative) phi = 1.-f1*f2;
+ 	else                  phi = f1*f2;
+ 	
+ 	/*Compute weights*/
+-	gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2);
++	Gauss* gauss = this->NewGauss(point,f1,f2,1-trapezeisnegative,2);
+ 
+ 	total_weight = 0.0;
+ 	for(int i=0;i<NUMVERTICES2D;i++)weights[i] = 0;
+@@ -1304,13 +1303,11 @@
+ 		for(int i=0;i<NUMVERTICES2D;i++)weights[i] += loadweights_g[i]*gauss->weight;
+ 		total_weight += gauss->weight;
+ 	}
++	delete gauss;
+ 
+ 	/*Normalizing to phi such that weights provide coefficients for integration over subelement (for averaging:phi*weights)*/
+-   if(total_weight>0.) for(int i=0;i<NUMVERTICES;i++) weights[i] = weights[i]*phi/total_weight;
++   if(total_weight>0.) for(int i=0;i<NUMVERTICES2D;i++) weights[i] = weights[i]*phi/total_weight;
+ 	else for(int i=0;i<NUMVERTICES2D;i++) weights[i] = 0.0;
+-
+-	/*Cleanup*/
+-	delete gauss;
+ 	
+ 	/*Assign output pointers*/
+ 	*pphi               = phi;
+@@ -2200,7 +2197,7 @@
+ 			heights[i] = xyz_list[i+NUMVERTICES2D][2]-xyz_list[i][2];
+ 			lsf2d[i]   = lsf[i];
+ 		}
+-		GetFractionGeometry2D(weights,&phi,&point,&f1,&f2,&istrapneg,lsf2d);
++		GetFractionGeometry2D(&weights[0],&phi,&point,&f1,&f2,&istrapneg,lsf2d);
+ 		
+ 		IssmDouble basetot;
+ 		height = 0.0;
Index: /issm/oecreview/Archive/25834-26739/ISSM-26692-26693.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26692-26693.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26692-26693.diff	(revision 26740)
@@ -0,0 +1,71 @@
+Index: ../trunk-jpl/examples/AMR/runme_with_neopz.m
+===================================================================
+--- ../trunk-jpl/examples/AMR/runme_with_neopz.m	(nonexistent)
++++ ../trunk-jpl/examples/AMR/runme_with_neopz.m	(revision 26693)
+@@ -0,0 +1,66 @@
++% Mismip3D experiment with AMR using NeoPZ (requires NeoPZ installation first, see external packages)
++steps=[1:3];
++
++if any(steps==1)
++	disp('   Step 1: Coarse mesh');
++
++	%Generate an unstructured coarse mesh on the MISMIP domain with typical element edge length equal to 10,000 m
++	md=bamg(model,'domain','./domain.exp','hmax',10000,'splitcorners',1);
++
++	save AMRCoarseMesh md
++end
++
++if any(steps==2)
++	disp('   Step 2: Parameterization');
++
++	md=loadmodel('AMRCoarseMesh');
++
++	md=setmask(md,'','');
++
++	% Run parameterization script to set up geometry, inital velocity, material properties, etc.
++	md=parameterize(md,'./mismip.par');
++
++	% Set the AMR properties and the refinement criteria
++	% Here, we are refining around the grounding line
++	% We impose the element resolution at grounding equal to ~1250 m, which corresponds to 3 levels of refinement
++	% The criterion used is the element distance to the grounding line
++	% The distance used here is 10000 m (10 km), used in both side around the grouding line (upstream and downstream)
++	md.amr=amrneopz;
++	md.amr.level_max=3; % refine 3 times so we have about 1250 m around the grounding line
++	md.amr.gradation=2; % maximum ratio between two adjacent edges
++	md.amr.groundingline_distance=10000;
++
++	save AMRParam md
++end
++
++if any(steps==3)
++	disp('   Step 3: Solve!');
++
++	md=loadmodel('AMRParam');
++
++	% Run transient with adaptive mesh refinement
++	md.timestepping.time_step=1;
++	md.timestepping.final_time=500; % here, as example, only 500 yr.
++	md.settings.output_frequency=10;% here, save results every 10 yr
++	md.stressbalance.maxiter=30;
++	md.stressbalance.abstol=NaN;
++	md.stressbalance.restol=1;
++	md.settings.solver_residue_threshold=1e-2; % relaxing (the first stress balance solver iteration presents values higher than the original threshold. This probably happens because the initial velocity is set to one).
++	md.verbose=verbose('convergence',false,'solution',true);
++
++	% Specify that you want to run the model on your current (local host) computer
++	% Change the number of processors according to your machine (here np=2)
++	md.cluster=generic('np',2);
++
++	% Set the AMR frequency, i.e., can be 1 or larger depending on how often the mesh needs to be updated
++	md.transient.amr_frequency=1; % here, we are refining the mesh in every time step
++
++	% Set the flow equation (SSA) and run
++	md=setflowequation(md,'SSA','all');
++	md=solve(md,'Transient');
++
++	% Print the solutions and the mesh in VTK format (needs ParaView:	https://www.paraview.org)
++	AMRexportVTK('./VTK',md);
++
++	save AMRTransient md
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26693-26694.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26693-26694.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26693-26694.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26693)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 26694)
+@@ -1246,7 +1246,7 @@
+    IssmDouble         f1,f2,phi;
+ 
+    /*Weights*/
+-   IssmDouble loadweights_g[NUMVERTICES2D];
++   IssmDouble loadweights_g[NUMVERTICES];
+    IssmDouble total_weight = 0;
+ 
+    _assert_(!xIsNan<IssmDouble>(gl[0]));
+@@ -2180,7 +2180,7 @@
+ 	IssmDouble xyz_list[NUMVERTICES][3];
+ 	IssmDouble lsf[NUMVERTICES];
+ 
+-	if(!IsIceInElement())return 0;
++	if(!IsIceInElement()) return 0;
+ 
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 
+@@ -2207,13 +2207,12 @@
+ 	
+ 		/*Account for scaling factor averaged over subelement 2D area*/
+ 		if(scaled==true){
+-			IssmDouble* scalefactor_vertices   = xNew<IssmDouble>(NUMVERTICES);
++			IssmDouble scalefactor_vertices[NUMVERTICES];
+ 			Element::GetInputListOnVertices(&scalefactor_vertices[0],MeshScaleFactorEnum);
+ 			/*Compute loop only over lower vertices: i<NUMVERTICES2D*/
+ 			scalefactor = 0.0;
+ 			for(int i=0;i<NUMVERTICES2D;i++) scalefactor += weights[i]/phi*scalefactor_vertices[i];
+ 			base = base*scalefactor;
+-			xDelete<IssmDouble>(scalefactor_vertices);
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26694-26695.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26694-26695.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26694-26695.diff	(revision 26740)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/externalpackages/neopz/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/neopz/install.sh	(revision 26694)
++++ ../trunk-jpl/externalpackages/neopz/install.sh	(revision 26695)
+@@ -9,6 +9,11 @@
+ #GIT must be installed first. See $ISSM_DIR/externalpackages/git
+ git clone https://github.com/labmec/neopz.git
+ 
++#use these 3 lines if one would like to change to a stable version
++cd neopz
++git checkout 5b1d4fa3cf61dcc500742b8cfdfb01d86ec724b3
++cd ..
++
+ #Untar and set src directory
+ mv neopz/ install/
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26695-26696.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26695-26696.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26695-26696.diff	(revision 26740)
@@ -0,0 +1,224 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26695)
++++ ../trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 26696)
+@@ -201,7 +201,7 @@
+ 	/*Intermediaries */
+ 	IssmDouble Jdet;
+ 	IssmDouble* xyz_list = NULL;
+-	IssmDouble  gap,bed,thickness,head,g,rho_ice,rho_water,A,B,n,head_old;/***/
++	IssmDouble  gap,bed,thickness,head,g,rho_ice,rho_water,A,B,n;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+@@ -222,7 +222,7 @@
+ 	element->FindParam(&storage,HydrologyStorageEnum);
+ 	element->FindParam(&dt,TimesteppingTimeStepEnum);
+ 
+-        /***Get all inputs and parameters*/
++        /*Get all inputs and parameters*/
+         element->FindParam(&rho_water,MaterialsRhoFreshwaterEnum);
+         element->FindParam(&rho_ice,MaterialsRhoIceEnum);
+         element->FindParam(&g,ConstantsGEnum);
+@@ -232,7 +232,6 @@
+         Input* thickness_input = element->GetInput(ThicknessEnum);                  _assert_(thickness_input);
+         Input* head_input = element->GetInput(HydrologyHeadEnum);              _assert_(head_input);
+         Input* base_input = element->GetInput(BaseEnum);                      _assert_(base_input);
+-	Input* head_old_input = element->GetInput(HydrologyHeadOldEnum);	_assert_(head_old_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGauss(1);
+@@ -247,21 +246,17 @@
+                 thickness_input->GetInputValue(&thickness,gauss);
+                 gap_input->GetInputValue(&gap,gauss);
+                 head_input->GetInputValue(&head,gauss);
+-  		head_old_input->GetInputValue(&head_old,gauss);
+ 
+-                /***Get ice A parameter*/
++                /*Get ice A parameter*/
+                 B_input->GetInputValue(&B,gauss);
+                 n_input->GetInputValue(&n,gauss);
+                 A=pow(B,-n);
+ 
+-                /***Get water and ice pressures*/
++                /*Get water and ice pressures*/
+                 IssmDouble pressure_ice   = rho_ice*g*thickness;    _assert_(pressure_ice>0.);
+                 IssmDouble pressure_water = rho_water*g*(head-bed);
+                 if(pressure_water>pressure_ice) pressure_water = pressure_ice;
+ 
+-                /***Get water pressure from previous time step to use in lagged creep term*/
+-                IssmDouble pressure_water_old = rho_water*g*(head_old-bed);
+-                if(pressure_water_old>pressure_ice) pressure_water_old = pressure_ice;
+ 
+ 
+ 		for(int i=0;i<numnodes;i++){
+@@ -292,8 +287,8 @@
+ 	IssmDouble  alpha2,frictionheat;
+    IssmDouble  PMPheat,dpressure_water[2],dbed[2];	
+ 	IssmDouble* xyz_list = NULL;
+-        IssmDouble dgapxx; /***/
+-	IssmDouble dgapyy; /***/
++//        IssmDouble dgapxx; /***/
++//	IssmDouble dgapyy; /***/
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = element->GetNumberOfNodes();
+@@ -319,8 +314,8 @@
+ 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
+ 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
+    Input* headold_input        = element->GetInput(HydrologyHeadOldEnum);           _assert_(headold_input);
+-	Input* dgapxx_input	    = element->GetInput(HydrologyGapHeightXXEnum); /***/
+-	Input* dgapyy_input	    = element->GetInput(HydrologyGapHeightYYEnum); /***/
++//	Input* dgapxx_input	    = element->GetInput(HydrologyGapHeightXXEnum); /***/
++//	Input* dgapyy_input	    = element->GetInput(HydrologyGapHeightYYEnum); /***/
+ 
+ 	/*Get conductivity from inputs*/
+ 	IssmDouble conductivity = GetConductivity(element);
+@@ -350,8 +345,8 @@
+ 		lr_input->GetInputValue(&lr,gauss);
+ 		br_input->GetInputValue(&br,gauss);
+                 headold_input->GetInputValue(&head_old,gauss);
+-		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
+-		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
++//		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
++//		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
+ 
+ 		/*Get ice A parameter*/
+ 		B_input->GetInputValue(&B,gauss);
+@@ -364,20 +359,12 @@
+ 		else
+ 		 beta = 0.;
+ 
+-		/* TEST Compute lc term */
+-//		if(gap<br)
+-//		 lc = gap*(1-(br-gap)/br);
+-//		else
+-		 lc = gap; 
+-//                lc=gap*tanh(pow(gap,3)/pow(br,3));
+-//		lc=pow(gap,2)/lr;
+-
+ 		/*Compute frictional heat flux*/
+ 		friction->GetAlpha2(&alpha2,gauss);
+ 		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+ 		frictionheat=alpha2*(vx*vx+vy*vy);
+ 
+-		/* *** TEST take out frictional heat for large gap height *** */
++		/* Take out frictional heat for large gap height */
+ 		if(gap>br)
+ 		 frictionheat=0.;
+ 
+@@ -398,28 +385,6 @@
+    	meltrate = 1/latentheat*(G+frictionheat+rho_water*g*conductivity*(dh[0]*dh[0]+dh[1]*dh[1])-PMPheat);
+ 		_assert_(meltrate>0.);
+ 
+-
+-//		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+-//		 (
+-//		  meltrate*(1/rho_water-1/rho_ice)
+-//		  +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice - pressure_water)*gap
+-//		  -beta*sqrt(vx*vx+vy*vy)
+-//		  +ieb
+-//		  +storage*head_old/dt
+-//		  )*basis[i];     
+-
+-		 /* With weighted creep term*/
+-//                 for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+- //                 (
+-  //                 meltrate*(1/rho_water-1/rho_ice)
+-   //                +A*pow(fabs(pressure_ice - pressure_water),n-1)*(pressure_ice + rho_water*g*bed)*gap
+-    //               +(n-1)*A*pow(fabs(pressure_ice - pressure_water),n-1)*(rho_water*g*head)*gap
+-     //              -beta*sqrt(vx*vx+vy*vy)
+-      //             +ieb
+-       //            +storage*head_old/dt
+-        //           )*basis[i];
+-
+-                 /* With weighted creep term */
+                   for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+                    (
+                     meltrate*(1/rho_water-1/rho_ice)
+@@ -442,17 +407,7 @@
+         //             +0.e-5*(dgapxx+dgapyy)
+          //            )*basis[i];
+ 
+-
+ 	
+-//                 /*Test with linear creep rate*/
+- //                for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*
+-  //                (
+-   //                meltrate*(1/rho_water-1/rho_ice)
+-    //               +(pressure_ice - pressure_water)*gap/pow(10,13)
+-     //              -beta*sqrt(vx*vx+vy*vy)
+-      //             +ieb
+-       //            +storage*head_old/dt
+-        //           )*basis[i];
+ 	}
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list);
+@@ -596,8 +551,8 @@
+    IssmDouble  dpressure_water[2],dbed[2],PMPheat;
+ 	IssmDouble q = 0.;
+    IssmDouble channelization = 0.;
+-	IssmDouble dgapxx; /***/
+-	IssmDouble dgapyy; /***/
++//	IssmDouble dgapxx; /***/
++//	IssmDouble dgapyy; /***/
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+@@ -615,8 +570,8 @@
+ 	Input* n_input              = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+ 	Input* lr_input             = element->GetInput(HydrologyBumpSpacingEnum);       _assert_(lr_input);
+ 	Input* br_input             = element->GetInput(HydrologyBumpHeightEnum);        _assert_(br_input);
+-        Input* dgapxx_input         = element->GetInput(HydrologyGapHeightXXEnum); /***/
+-        Input* dgapyy_input         = element->GetInput(HydrologyGapHeightYYEnum); /***/
++ //       Input* dgapxx_input         = element->GetInput(HydrologyGapHeightXXEnum); /***/
++  //      Input* dgapyy_input         = element->GetInput(HydrologyGapHeightYYEnum); /***/
+ 
+ 	/*Get conductivity from inputs*/
+ 	IssmDouble conductivity = GetConductivity(element);
+@@ -642,8 +597,8 @@
+ 		head_input->GetInputDerivativeValue(&dh[0],xyz_list,gauss);
+ 		lr_input->GetInputValue(&lr,gauss);
+ 		br_input->GetInputValue(&br,gauss);
+-		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
+-		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
++//		dgapxx_input->GetInputValue(&dgapxx,gauss); /***/
++//		dgapyy_input->GetInputValue(&dgapyy,gauss); /***/
+ 
+ 		/*Get ice A parameter*/
+ 		B_input->GetInputValue(&B,gauss);
+@@ -656,20 +611,12 @@
+ 		else
+ 		 beta = 0.;
+ 
+-		/* TEST Compute lc term*/
+-//		if(gap<br)
+-//		 lc = gap*(1-(br-gap)/br);
+-//		else
+-		 lc = gap;
+-//               lc=gap*tanh(pow(gap,3)/pow(br,3)); 
+-//		lc = pow(gap,2)/lr;
+-
+ 		/*Compute frictional heat flux*/
+ 		friction->GetAlpha2(&alpha2,gauss);
+ 		friction->GetBasalSlidingSpeeds(&vx, &vy, gauss);
+ 		frictionheat=alpha2*(vx*vx+vy*vy);
+ 
+-		/* *** TEST take out frictional heat for large gap height *** */
++		/* Take out frictional heat for large gap height */
+ 		if(gap>br)
+ 		 frictionheat=0.;
+ 
+@@ -701,12 +648,6 @@
+  //                                        );
+ 
+ 
+-                 /*TEST with linear creep rate*/
+-//                 newgap += gauss->weight*Jdet*(gap+dt*(
+- //                                        meltrate/rho_ice
+-  //                                       -(pressure_ice-pressure_water)*gap/pow(10,13)
+-   //                                      +beta*sqrt(vx*vx+vy*vy)
+-    //                                     ));
+ 		totalweights +=gauss->weight*Jdet;
+ 
+ 		/* Compute basal water flux */
Index: /issm/oecreview/Archive/25834-26739/ISSM-26696-26697.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26696-26697.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26696-26697.diff	(revision 26740)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 26696)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 26697)
+@@ -36,7 +36,7 @@
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,...
+ 	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
+-	1e-11,2e-11,2e-11,1e-12,2e-11,...
++	1e-11,2e-11,2e-11,2e-08,2e-11,...
+ 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+ 	1e-11,2e-11,2e-11,2e-08,2e-11,...
+ 	};
Index: /issm/oecreview/Archive/25834-26739/ISSM-26697-26698.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26697-26698.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26697-26698.diff	(revision 26740)
@@ -0,0 +1,125 @@
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26697)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26698)
+@@ -144,12 +144,48 @@
+ 	end
+ 
+ end# }}}
++function VecMerge(node::Node,ug::IssmVector,uf::Vector{Float64},ys::Vector{Float64}) #{{{
++
++	fsize = FSize(node)
++	ssize = SSize(node)
++
++	if fsize>0
++		indices = Vector{Int64}(undef,fsize)
++		values  = Vector{Float64}(undef,fsize)
++
++		count = 1
++		for i=1:node.gsize
++			if node.fdoflist[i]!=-1
++				indices[count] = node.gdoflist[i]
++				values[count]  = uf[node.fdoflist[i]]
++				count += 1
++			end
++		end
++		SetValues!(ug,fsize,indices,values)
++	end
++
++	if ssize>0
++		indices = Vector{Int64}(undef,ssize)
++		values  = Vector{Float64}(undef,ssize)
++
++		count = 1
++		for i=1:node.gsize
++			if node.sdoflist[i]!=-1
++				indices[count] = node.gdoflist[i]
++				values[count]  = ys[node.sdoflist[i]]
++				count += 1
++			end
++		end
++		SetValues!(ug,ssize,indices,values)
++	end
++
++end# }}}
+ function SSize(node::Node) #{{{
+ 
+ 	ssize = 0
+ 
+ 	for i=1:node.gsize
+-		if node.fdoflist[i]!=-1
++		if node.sdoflist[i]!=-1
+ 			ssize+=1
+ 		end
+ 	end
+@@ -157,7 +193,20 @@
+ 	return ssize
+ 
+ end# }}}
++function FSize(node::Node) #{{{
+ 
++	fsize = 0
++
++	for i=1:node.gsize
++		if node.fdoflist[i]!=-1
++			fsize+=1
++		end
++	end
++
++	return fsize
++
++end# }}}
++
+ #Nodes functions
+ function RequiresDofReindexing(nodes::Vector{Node}) #{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26697)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26698)
+@@ -160,6 +160,16 @@
+ 	return ug
+ 
+ end#}}}
++function Mergesolutionfromftogx(ug::IssmVector, uf::IssmVector, ys::IssmVector, nodes::Vector{Node}) #{{{
++
++	#Go through elements and plug in solution
++	for i=1:length(nodes)
++		VecMerge(nodes[i],ug,uf.vector,ys.vector)
++	end
++
++	return ug
++
++end#}}}
+ function Reduceloadx!(pf::IssmVector, Kfs::IssmMatrix, ys::IssmVector) #{{{
+ 
+ 	#Is there anything to do?
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26697)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26698)
+@@ -25,7 +25,10 @@
+ 		old_uf = uf
+ 		uf = Solverx(Kff, pf, old_uf)
+ 
+-		print(uf)
++		#Merge uf with ys
++		Mergesolutionfromftogx(ug, uf, ys, femmodel.nodes)
++
++		print(ug)
+ 		error("compare with ISSM...")
+ 
+ 		#Increase count
+Index: ../trunk-jpl/src/jl/solve/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26697)
++++ ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26698)
+@@ -72,7 +72,7 @@
+ function Solverx(A::IssmMatrix,b::IssmVector,xold::IssmVector) #{{{
+ 
+ 	x = IssmVector(GetSize(xold))
+-	x.vector = (b.vector\A.matrix)' #not sure why we need to transpose... that's a mystery!
++	x.vector = (A.matrix\b.vector)
+ 
+ 	return x
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26698-26699.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26698-26699.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26698-26699.diff	(revision 26740)
@@ -0,0 +1,162 @@
+Index: ../trunk-jpl/src/jl/solve/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26698)
++++ ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26699)
+@@ -111,7 +111,7 @@
+ function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
+ 
+ 	if input.interp==P0Enum
+-		return input.element_values
++		return input.element_values[1]
+ 	elseif input.interp==P1Enum
+ 		value = input.element_values[1]*gauss.coords1[i] +  input.element_values[2]*gauss.coords2[i] +  input.element_values[3]*gauss.coords3[i]
+ 	else
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26698)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26699)
+@@ -157,7 +157,7 @@
+ 		VecReduce(nodes[i],ug.vector,uf)
+ 	end
+ 
+-	return ug
++	return uf
+ 
+ end#}}}
+ function Mergesolutionfromftogx(ug::IssmVector, uf::IssmVector, ys::IssmVector, nodes::Vector{Node}) #{{{
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26698)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26699)
+@@ -28,8 +28,9 @@
+ 		#Merge uf with ys
+ 		Mergesolutionfromftogx(ug, uf, ys, femmodel.nodes)
+ 
+-		print(ug)
+-		error("compare with ISSM...")
++		#Check for convergence
++		converged = convergence(Kff,pf,uf,old_uf,restol,reltol,abstol)
++		InputUpdateFromSolutionx(analysis,ug,femmodel)
+ 
+ 		#Increase count
+ 		count += 1
+@@ -39,6 +40,69 @@
+ 		end
+ 	end
+ 
++	print("\n   total number of iterations: ",  count,  "\n")
++
+ 	error("STOP")
+ 
+ end# }}}
++function convergence(Kff::IssmMatrix, pf::IssmVector, uf::IssmVector, old_uf::IssmVector, restol::Float64, reltol::Float64, abstol::Float64)#{{{
++
++	print("   checking convergence\n");
++
++	#If solution vector is empty, return true
++	if(IsEmpty(uf))
++		return true
++	end
++
++	#Convergence criterion #1: force equilibrium (Mandatory)
++	#compute K[n]U[n-1] - F
++	KUold  = Duplicate(uf);    MatMult!(Kff,old_uf,KUold)
++	KUoldF = Duplicate(KUold); VecCopy!(KUold, KUoldF); AXPY!(KUoldF, -1.0, pf)
++	nKUoldF = Norm(KUoldF,2)
++	nF      = Norm(pf,2)
++	res = nKUoldF/nF
++	if ~isfinite(res)
++		println("norm nf = ", nF, " and norm kuold = ",nKUoldF)
++		error("mechanical equilibrium convergence criterion is not finite!")
++	end
++	if(res<restol)
++		print("   mechanical equilibrium convergence criterion ", res*100, " < ", restol*100, " %\n")
++		converged=true
++	else
++		print("   mechanical equilibrium convergence criterion ", res*100, " > ", restol*100, " %\n")
++		converged=false;
++	end
++
++	#Convergence criterion #2: norm(du)/norm(u)
++	if ~isnan(reltol)
++		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
++		ndu = Norm(duf, 2); nu = Norm(old_uf, 2)
++		if ~isfinite(ndu) | ~isfinite(nu) 
++			error("convergence criterion is not finite!")
++		end
++		if((ndu/nu)<reltol)
++			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " < ", reltol*100, " %\n")
++		else
++			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " > ", reltol*100, " %\n")
++			converged=false;
++		end
++	end
++
++	#Convergence criterion #3: max(du)
++	if ~isnan(abstol)
++		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
++		nduinf= Norm(duf, 3)
++		if ~isfinite(nduinf) 
++			error("convergence criterion is not finite!")
++		end
++		if(nduinf<abstol)
++			print("   Convergence criterion: max(du)               ", nduinf, " < ", abstol, "\n")
++		else
++			print("   Convergence criterion: max(du)               ", nduinf, " > ", abstol, "\n")
++			converged=false;
++		end
++	end
++
++	return converged
++
++end#}}}
+Index: ../trunk-jpl/src/jl/solve/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26698)
++++ ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26699)
+@@ -57,7 +57,45 @@
+ 	end
+ 
+ end#}}}
++function IsEmpty(vector::IssmVector)#{{{
+ 
++	return GetSize(vector)==0
++
++end#}}}
++function Duplicate(vector::IssmVector)#{{{
++
++	#Copy data structure
++	M=GetSize(vector)
++	return IssmVector(M)
++
++end#}}}
++function VecCopy!(x::IssmVector,y::IssmVector)#{{{
++
++	y.vector = x.vector
++
++end#}}}
++function Norm(x::IssmVector,type::Int64)#{{{
++
++	norm = 0
++
++	if type==2
++		for i in 1:length(x.vector)
++			norm += x.vector[i]^2
++		end
++		norm = sqrt(norm)
++	elseif type==3
++		#Infinite norm
++		for i in 1:length(x.vector)
++			if(abs(x.vector[i])>norm) norm = abs(x.vector[i]) end
++		end
++	else
++		error("type ",type," not supported yet")
++	end
++
++	return norm
++
++end#}}}
++
+ #Operations
+ function MatMult!(A::IssmMatrix,x::IssmVector,y::IssmVector) #{{{
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26699-26700.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26699-26700.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26699-26700.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 26699)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 26700)
+@@ -36,7 +36,7 @@
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,...
+ 	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
+-	1e-11,2e-11,2e-11,2e-08,2e-11,...
++	1e-11,2e-11,2e-11,8e-08,2e-11,...
+ 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+ 	1e-11,2e-11,2e-11,2e-08,2e-11,...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26699)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26700)
+@@ -45,7 +45,7 @@
+                     2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
+                     1e-12, 2e-12, 2e-12, 2e-08, 1e-13,
+                     2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+-                    1e-12, 2e-12, 2e-12, 8e-09, 1e-13]
++                    1e-12, 2e-12, 2e-12, 8e-08, 1e-13]
+ field_values = [md.results.TransientSolution[0].Vx,
+                 md.results.TransientSolution[0].Vy,
+                 md.results.TransientSolution[0].Vel,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26700-26701.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26700-26701.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26700-26701.diff	(revision 26740)
@@ -0,0 +1,92 @@
+Index: ../trunk-jpl/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m	(nonexistent)
++++ ../trunk-jpl/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m	(revision 26701)
+@@ -0,0 +1,40 @@
++% This function calls src/m/contrib/morlighem/modeldata/interpFromGeotiff.m for multiple times to load all avaliable 
++% tif data in  /totten_1/ModelData/Greenland/VelMEaSUREs/Jakobshavn_2008_2021/ within the given time period (in decimal years)
++% For some reason, each .tif file in this folder contains two sets of data, only the first dataset is useful
++
++function dataout = interpFromMEaSUREsGeotiff(X,Y,Tstart,Tend)
++
++foldername = '/totten_1/ModelData/Greenland/VelMEaSUREs/Jakobshavn_2008_2021/';
++
++% get the time info from file names
++templist = dir([foldername,'*.meta']);
++Ndata = length(templist);
++dataTstart = zeros(Ndata,1);
++dataTend = zeros(Ndata,1);
++
++for i = 1:Ndata
++	tempConv = split(templist(i).name, '_');
++	% follow the naming convention
++	dataPrefix(i) = join(tempConv(1:5), '_');
++	dataTstart(i) = date2decyear(datenum(tempConv{3}));
++	dataTend(i) = date2decyear(datenum(tempConv{4}));
++end
++disp(['  Found ', num2str(Ndata), ' records in ', foldername]);
++disp(['    from ', datestr(decyear2date(min(dataTstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date(max(dataTend)),'yyyy-mm-dd') ]);
++
++
++% find all the data files with Tstart<=t<=Tend
++dataInd = (dataTend>=Tstart) & (dataTstart<=Tend);
++disp([' For the selected period: ', datestr(decyear2date((Tstart)),'yyyy-mm-dd'), ' to ', datestr(decyear2date((Tend)),'yyyy-mm-dd'), ', there are ', num2str(sum(dataInd)), ' records' ]);
++
++dataToLoad = dataPrefix(dataInd);
++TstartToload = dataTstart(dataInd);
++TendToload = dataTend(dataInd);
++
++for i = 1:length(dataToLoad)
++	dataout(i).vx = interpFromGeotiff([foldername, dataToLoad{i}, '_vx_v04.0.tif'], X, Y, 2e9);
++	dataout(i).vy = interpFromGeotiff([foldername, dataToLoad{i}, '_vy_v04.0.tif'], X, Y, 2e9);
++	dataout(i).vel = interpFromGeotiff([foldername, dataToLoad{i}, '_vv_v04.0.tif'], X, Y, -1);
++	dataout(i).Tstart = TstartToload(i);
++	dataout(i).Tend = TendToload(i);
++end
+Index: ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m	(revision 26700)
++++ ../trunk-jpl/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m	(revision 26701)
+@@ -1,5 +1,9 @@
+-function dataout = interpFromGeotiff(geotiffname,X,Y),
++function dataout = interpFromGeotiff(geotiffname,X,Y,nanValue),
+ 
++if nargin < 4
++	nanValue = 10^30;
++end
++
+ usemap = 0;
+ if license('test','map_toolbox')==0,
+ 	disp('WARNING: map toolbox not installed, trying house code');
+@@ -20,12 +24,12 @@
+ 
+ 	%Get image info
+ 	Tinfo = imfinfo(geotiffname);
+-	N     = Tinfo.Width;
+-	M     = Tinfo.Height;
+-	dx    = Tinfo.ModelPixelScaleTag(1);
+-	dy    = Tinfo.ModelPixelScaleTag(2);
+-	minx  = Tinfo.ModelTiepointTag(4);
+-	maxy  = Tinfo.ModelTiepointTag(5);
++	N     = Tinfo(1).Width;
++	M     = Tinfo(1).Height;
++	dx    = Tinfo(1).ModelPixelScaleTag(1);
++	dy    = Tinfo(1).ModelPixelScaleTag(2);
++	minx  = Tinfo(1).ModelTiepointTag(4);
++	maxy  = Tinfo(1).ModelTiepointTag(5);
+ 
+ 	%Generate vectors
+ 	xdata = minx + dx/2 + ((0:N-1).*dx);
+@@ -54,7 +58,11 @@
+ 	else
+ 		data=double(flipud(imread(geotiffname)));
+ 	end
+-	data(find(abs(data)>10^30))=NaN;
++	if nanValue > 0
++		data(find(abs(data)>=nanValue))=NaN;
++	else 
++		data(find(data<=nanValue))=NaN;
++	end
+ 
+ end
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26701-26702.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26701-26702.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26701-26702.diff	(revision 26740)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26701)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26702)
+@@ -62,7 +62,6 @@
+ 	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
+ 
+ 	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+-	error("STOP")
+ 
+ end #}}}
+ function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26701)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26702)
+@@ -221,3 +221,7 @@
+ 
+ 	return ys
+ end# }}}
++function RequestedOutputsx(femmodel::FemModel,outputlist::Vector{IssmEnum})# {{{
++
++	error("not implemented")
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26701)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26702)
+@@ -42,8 +42,6 @@
+ 
+ 	print("\n   total number of iterations: ",  count,  "\n")
+ 
+-	error("STOP")
+-
+ end# }}}
+ function convergence(Kff::IssmMatrix, pf::IssmVector, uf::IssmVector, old_uf::IssmVector, restol::Float64, reltol::Float64, abstol::Float64)#{{{
+ 
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26701)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26702)
+@@ -26,7 +26,8 @@
+ 	analysis = StressbalanceAnalysis()
+ 	Core(analysis,femmodel)
+ 
+-	#then what??
++	#Save output
++	RequestedOutputsx(femmodel,[VxEnum,VyEnum])
+ 	error("STOP")
+ 
+ end# }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26702-26703.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26702-26703.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26702-26703.diff	(revision 26740)
@@ -0,0 +1,363 @@
+Index: ../trunk-jpl/src/jl/solve/femmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/femmodel.jl	(revision 26702)
++++ ../trunk-jpl/src/jl/solve/femmodel.jl	(revision 26703)
+@@ -7,6 +7,7 @@
+ 	inputs::Inputs
+ 	constraints::Vector{Constraint}
+ 	#loads::Vector{Loads}
++	results::Vector{Result}
+ end#}}}
+ 
+ #femmodel functions
+Index: ../trunk-jpl/src/jl/solve/results.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/results.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/results.jl	(revision 26703)
+@@ -0,0 +1,5 @@
++mutable struct Result #{{{
++	step::Int64
++	time::Float64
++	value
++end#}}}
+Index: ../trunk-jpl/src/jl/test301.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test301.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/test301.jl	(revision 26703)
+@@ -0,0 +1,45 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("issm.jl")
++using .ISSM
++
++md = ISSM.model()
++md = ISSM.triangle(md,"../../test/Exp/Square.exp",150000.)
++md = ISSM.setmask(md,"","")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness .+20
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base
++
++#Initial velocity
++#x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++#y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++#vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++#vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++#index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
++md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.05
++md.stressbalance.reltol=0.05
++md.stressbalance.abstol=NaN
++
++#Boundary conditions
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary)
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test301.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/md/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/classes.jl	(revision 26702)
++++ ../trunk-jpl/src/jl/md/classes.jl	(revision 26703)
+@@ -14,24 +14,7 @@
+ 	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+ end# }}}
+ function Base.show(io::IO, this::Mesh2dTriangle)# {{{
+-
+-	println(io,typeof(this),":")
+-	for name in fieldnames(typeof(this))
+-		a=getfield(this,name)
+-		#print(io,"   $(name) = ")
+-		@printf "%19s: " name
+-		if isa(a,String)
+-			println(io, a)
+-		elseif length(a)>1
+-			if !isempty(a)
+-				println(io, typeof(a), " of size ", size(a))
+-			else
+-				println(io,"empty")
+-			end
+-		else
+-			println(io, a)
+-		end
+-	end
++	IssmStructDisp(io, this)
+ end# }}}
+ mutable struct Mesh3dPrism{T} <: AbstractMesh
+ 	numberofvertices::Int64
+@@ -65,6 +48,9 @@
+ function Mask() #{{{
+ 	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+ end# }}}
++function Base.show(io::IO, this::Mask)# {{{
++	IssmStructDisp(io, this)
++end# }}}
+ 
+ mutable struct Initialization
+ 	vx::Vector{Float64}
+@@ -86,24 +72,7 @@
+ 	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 1.e-4, 0.01, 10., 100)
+ end# }}}
+ function Base.show(io::IO, this::Stressbalance)# {{{
+-
+-	println(io,typeof(this),":")
+-	for name in fieldnames(typeof(this))
+-		a=getfield(this,name)
+-		#print(io,"   $(name) = ")
+-		@printf "%19s: " name
+-		if isa(a,String)
+-			println(io, a)
+-		elseif length(a)>1
+-			if !isempty(a)
+-				println(io, typeof(a), " of size ", size(a))
+-			else
+-				println(io,"empty")
+-			end
+-		else
+-			println(io, a)
+-		end
+-	end
++	IssmStructDisp(io, this)
+ end# }}}
+ 
+ mutable struct Constants
+@@ -136,6 +105,21 @@
+ 	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
+ end# }}}
+ 
++abstract type AbstractFriction end
++mutable struct BuddFriction <: AbstractFriction
++	coefficient::Vector{Float64}
++end
++function BuddFriction() #{{{
++	return BuddFriction(Vector{Float64}(undef,0))
++end# }}}
++function Base.show(io::IO, this::BuddFriction)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++mutable struct WeertmanFriction <: AbstractFriction
++	C::Vector{Float64}
++	m::Vector{Float64}
++end
++
+ mutable struct model
+ 	mesh::AbstractMesh
+ 	geometry::Geometry
+@@ -144,9 +128,11 @@
+ 	initialization::Initialization
+ 	stressbalance::Stressbalance
+ 	constants::Constants
++	results
++	friction::AbstractFriction
+ end
+ function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants())
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants(), [], BuddFriction())
+ end#}}}
+ function Base.show(io::IO, md::model)# {{{
+ 
+@@ -160,5 +146,6 @@
+ 	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+ 	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
+ 	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
++	@printf "%19s: %-26s -- %s\n" "friction" typeof(md.friction) "basal friction"
+ 
+ end# }}}
+Index: ../trunk-jpl/src/jl/md/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/utils.jl	(revision 26702)
++++ ../trunk-jpl/src/jl/md/utils.jl	(revision 26703)
+@@ -106,3 +106,22 @@
+ 
+ 	return md
+ end #}}}
++function IssmStructDisp(io::IO, modelfield::Any) # {{{
++	println(io,typeof(modelfield),":")
++	for name in fieldnames(typeof(modelfield))
++		a=getfield(modelfield,name)
++		#print(io,"   $(name) = ")
++		@printf "%19s: " name
++		if isa(a,String)
++			println(io, a)
++		elseif length(a)>1
++			if !isempty(a)
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,"empty")
++			end
++		else
++			println(io, a)
++		end
++	end
++end #}}}
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26702)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26703)
+@@ -175,15 +175,19 @@
+ 
+ 	#Now split solution vector into x and y components
+ 	numnodes = 3
+-	vx= Vector{Float64}(undef,numnodes)
+-	vy= Vector{Float64}(undef,numnodes)
++	vx  = Vector{Float64}(undef,numnodes)
++	vy  = Vector{Float64}(undef,numnodes)
++	vel = Vector{Float64}(undef,numnodes)
+ 	for i in 1:numnodes 
+ 		vx[i]=values[2*i-1] 
+ 		vy[i]=values[2*i] 
+ 		@assert isfinite(vx[i])
+ 		@assert isfinite(vy[i])
++
++		vel[i] =sqrt(vx[i]^2 + vy[i]^2)
+ 	end
+ 
+-	AddInput(element,VxEnum,vx,P1Enum)
+-	AddInput(element,VyEnum,vy,P1Enum)
++	AddInput(element, VxEnum,  vx,  P1Enum)
++	AddInput(element, VyEnum,  vy,  P1Enum)
++	AddInput(element, VelEnum, vel, P1Enum)
+ end#}}}
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26702)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26703)
+@@ -11,6 +11,7 @@
+ 	vertices    = Vector{Vertex}(undef,0)
+ 	nodes       = Vector{Node}(undef,0)
+ 	constraints = Vector{Constraint}(undef,0)
++	results     = Vector{Result}(undef,0)
+ 	parameters  = Parameters(Dict{IssmEnum,Parameter}())
+ 	inputs      = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
+ 
+@@ -35,7 +36,7 @@
+ 	NodesDofx(nodes,parameters)
+ 
+ 	#Build FemModel
+-	return FemModel(elements,vertices,nodes,parameters,inputs,constraints)
++	return FemModel(elements, vertices, nodes, parameters, inputs, constraints, results)
+ end# }}}
+ function CreateElements(elements::Vector{Tria},md::model) #{{{
+ 
+@@ -79,6 +80,10 @@
+ 	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
+ 	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
+ 	AddParam(parameters,md.constants.g,ConstantsGEnum)
++	
++	#Set step and time, this will be overwritten if we run a transient
++	AddParam(parameters,1,StepEnum)
++	AddParam(parameters,0.0,TimeEnum)
+ end# }}}
+ function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
+ 
+@@ -86,7 +91,12 @@
+ 	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+ 	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
+ end# }}}
++function OutputResultsx(femmodel::FemModel, md::model)# {{{
+ 
++	md.results = Dict("Stressbalance"=> femmodel.results)
++
++end# }}}
++
+ #Other modules
+ function ConfigureObjectx(elements::Vector{Tria},nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) #{{{
+ 
+@@ -223,5 +233,25 @@
+ end# }}}
+ function RequestedOutputsx(femmodel::FemModel,outputlist::Vector{IssmEnum})# {{{
+ 
+-	error("not implemented")
++	#Get Step and Time from parameters
++	step = FindParam(femmodel.parameters,StepEnum)
++	time = FindParam(femmodel.parameters,TimeEnum)
++	
++	#Now fetch results
++	for i in 1:length(outputlist)
++
++		#See if outputlist[i] is an input
++		if outputlist[i]>InputsSTARTEnum && outputlist[i]<InputsENDEnum
++
++			#Create Result
++			input  = GetInput(femmodel.inputs,outputlist[i])
++			result = Result(step, time, copy(input.values))
++
++			#Add to femmodel.results dataset
++			push!(femmodel.results,result)
++
++		else
++			println("Output ",outputlist[i]," not supported yet")
++		end
++	end
+ end# }}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26702)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26703)
+@@ -8,6 +8,7 @@
+ include("./nodes.jl")
+ include("./elements.jl")
+ include("./constraints.jl")
++include("./results.jl")
+ include("./matice.jl")
+ include("./femmodel.jl")
+ include("./analyses/analysis.jl")
+@@ -19,15 +20,18 @@
+ 
+ function IssmCore(md::model) #{{{
+ 
++
+ 	#Construct FemModel
+ 	femmodel=ModelProcessor(md)
+ 
+ 	#Solve
+ 	analysis = StressbalanceAnalysis()
+-	Core(analysis,femmodel)
++	Core(analysis, femmodel)
+ 
+ 	#Save output
+-	RequestedOutputsx(femmodel,[VxEnum,VyEnum])
+-	error("STOP")
++	RequestedOutputsx(femmodel, [VxEnum,VyEnum,VelEnum])
+ 
++	#move results to md
++	OutputResultsx(femmodel, md)
++
+ end# }}}
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26702)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26703)
+@@ -3,8 +3,8 @@
+ using .ISSM
+ 
+ md = ISSM.model()
+-#md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.)
+-md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.)
++md = ISSM.triangle(md,"../../test/Exp/Square.exp",50000.)
++#md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.)
+ #md = ISSM.triangle(md,"../../test/Exp/Square.exp",1000.)
+ md = ISSM.setmask(md,"all","")
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26703-26704.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26703-26704.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26703-26704.diff	(revision 26740)
@@ -0,0 +1,94 @@
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26703)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(revision 26704)
+@@ -10,6 +10,7 @@
+ include("./constraints.jl")
+ include("./results.jl")
+ include("./matice.jl")
++include("./friction.jl")
+ include("./femmodel.jl")
+ include("./analyses/analysis.jl")
+ include("./analyses/stressbalanceanalysis.jl")
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26703)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26704)
+@@ -44,6 +44,8 @@
+ 	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+ 	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
+ 
++	FetchDataToInput(md,inputs,elements,md.friction.coefficient,FrictionCoefficientEnum)
++
+ end#}}}
+ function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+ 	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
+@@ -100,6 +102,28 @@
+ 		end
+ 	end
+ 
++	#Add basal friction
++	basis = Vector{Float64}(undef,numnodes)
++	friction = Friction(element)
++
++	#Start integrating
++	gauss = GaussTria(2)
++	for ig in 1:gauss.numgauss
++
++		Jdet = JacobianDeterminant(xyz_list, gauss)
++		NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++		alpha2 = Alpha2(friction, gauss, ig)
++
++		for i in 1:numnodes
++			for j in 1:numnodes
++				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*alpha2*basis[i]*basis[j]
++				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*alpha2*basis[i]*basis[j]
++			end
++		end
++	end
++	
++
+ 	return Ke
+ end #}}}
+ function CreatePVector(analysis::StressbalanceAnalysis,element::Tria)# {{{
+Index: ../trunk-jpl/src/jl/solve/friction.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/friction.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/solve/friction.jl	(revision 26704)
+@@ -0,0 +1,35 @@
++#Friction class definition
++struct Friction#{{{
++	H_input::ElementInput
++	b_input::ElementInput
++	c_input::ElementInput
++	rho_ice::Float64
++	rho_water::Float64
++	g::Float64
++end# }}}
++function Friction(element::Tria) #{{{
++
++	H_input  = GetInput(element, ThicknessEnum)
++	b_input  = GetInput(element, BaseEnum)
++	c_input  = GetInput(element, FrictionCoefficientEnum)
++
++	rho_ice   = FindParam(element, MaterialsRhoIceEnum)
++	rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
++	g         = FindParam(element, ConstantsGEnum)
++
++	return Friction(H_input, b_input, c_input, rho_ice, rho_water, g)
++end#}}}
++
++#vertices functions
++function Alpha2(friction::Friction, gauss::GaussTria, i::Int64) #{{{
++
++	#Get effective pressure
++	H = GetInputValue(friction.H_input, gauss, i)
++	b = GetInputValue(friction.b_input, gauss, i)
++	c = GetInputValue(friction.c_input, gauss, i)
++	N = friction.rho_ice*friction.g*H + friction.rho_water*friction.g*b
++
++	if(N<0) N=0 end
++
++	return c^2*N
++end #}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26704-26705.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26704-26705.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26704-26705.diff	(revision 26740)
@@ -0,0 +1,200 @@
+Index: ../trunk-jpl/src/jl/solve/friction.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/friction.jl	(revision 26704)
++++ ../trunk-jpl/src/jl/solve/friction.jl	(revision 26705)
+@@ -1,5 +1,7 @@
+ #Friction class definition
+-struct Friction#{{{
++
++abstract type CoreFriction end
++struct CoreBuddFriction#{{{
+ 	H_input::ElementInput
+ 	b_input::ElementInput
+ 	c_input::ElementInput
+@@ -7,21 +9,27 @@
+ 	rho_water::Float64
+ 	g::Float64
+ end# }}}
+-function Friction(element::Tria) #{{{
++function CoreFriction(element::Tria) #{{{
+ 
+-	H_input  = GetInput(element, ThicknessEnum)
+-	b_input  = GetInput(element, BaseEnum)
+-	c_input  = GetInput(element, FrictionCoefficientEnum)
++	frictionlaw = FindParam(element, FrictionLawEnum)
+ 
+-	rho_ice   = FindParam(element, MaterialsRhoIceEnum)
+-	rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
+-	g         = FindParam(element, ConstantsGEnum)
++	if frictionlaw==1
++		H_input  = GetInput(element, ThicknessEnum)
++		b_input  = GetInput(element, BaseEnum)
++		c_input  = GetInput(element, FrictionCoefficientEnum)
+ 
+-	return Friction(H_input, b_input, c_input, rho_ice, rho_water, g)
++		rho_ice   = FindParam(element, MaterialsRhoIceEnum)
++		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
++		g         = FindParam(element, ConstantsGEnum)
++
++		return CoreBuddFriction(H_input, b_input, c_input, rho_ice, rho_water, g)
++	else
++		error("Friction ",typeof(md.friction)," not supported yet")
++	end
+ end#}}}
+ 
+ #vertices functions
+-function Alpha2(friction::Friction, gauss::GaussTria, i::Int64) #{{{
++function Alpha2(friction::CoreBuddFriction, gauss::GaussTria, i::Int64) #{{{
+ 
+ 	#Get effective pressure
+ 	H = GetInputValue(friction.H_input, gauss, i)
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26704)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26705)
+@@ -43,8 +43,15 @@
+ 	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
+ 	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+ 	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
++	FetchDataToInput(md,inputs,elements,md.mask.ice_levelset, MaskIceLevelsetEnum)
++	FetchDataToInput(md,inputs,elements,md.mask.ocean_levelset, MaskOceanLevelsetEnum)
+ 
+-	FetchDataToInput(md,inputs,elements,md.friction.coefficient,FrictionCoefficientEnum)
++	#Deal with friction
++	if typeof(md.friction)==BuddFriction
++		FetchDataToInput(md,inputs,elements,md.friction.coefficient,FrictionCoefficientEnum)
++	else
++		error("Friction ", typeof(md.friction), " not supported yet")
++	end
+ 
+ end#}}}
+ function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+@@ -52,6 +59,13 @@
+ 	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
+ 	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
+ 	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
++
++	#Deal with friction
++	if typeof(md.friction)==BuddFriction
++		AddParam(parameters, 1, FrictionLawEnum)
++	else
++		error("Friction ", typeof(md.friction), " not supported yet")
++	end
+ end#}}}
+ 
+ #Finite Element Analysis
+@@ -103,26 +117,29 @@
+ 	end
+ 
+ 	#Add basal friction
+-	basis = Vector{Float64}(undef,numnodes)
+-	friction = Friction(element)
++	phi=GetGroundedPortion(element, xyz_list)
+ 
+-	#Start integrating
+-	gauss = GaussTria(2)
+-	for ig in 1:gauss.numgauss
++	if(phi>0)
++		basis = Vector{Float64}(undef,numnodes)
++		friction = CoreFriction(element)
+ 
+-		Jdet = JacobianDeterminant(xyz_list, gauss)
+-		NodalFunctions(element, basis, gauss, ig, P1Enum)
++		#Start integrating
++		gauss = GaussTria(2)
++		for ig in 1:gauss.numgauss
+ 
+-		alpha2 = Alpha2(friction, gauss, ig)
++			Jdet = JacobianDeterminant(xyz_list, gauss)
++			NodalFunctions(element, basis, gauss, ig, P1Enum)
+ 
+-		for i in 1:numnodes
+-			for j in 1:numnodes
+-				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*alpha2*basis[i]*basis[j]
+-				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*alpha2*basis[i]*basis[j]
++			alpha2 = Alpha2(friction, gauss, ig)
++
++			for i in 1:numnodes
++				for j in 1:numnodes
++					Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
++					Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
++				end
+ 			end
+ 		end
+ 	end
+-	
+ 
+ 	return Ke
+ end #}}}
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26704)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26705)
+@@ -88,6 +88,18 @@
+ 	return input
+ 
+ end # }}}
++function GetInputListOnVertices!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
++
++	#Get Input first 
++	input = GetInput(element, enum)
++
++	#Get value at each vertex (i.e. P1 Nodes)
++	gauss=GaussTria(P1Enum)
++	for i in 1:gauss.numgauss
++		vector[i] = GetInputValue(input, gauss, i)
++	end
++
++end # }}}
+ function FindParam(element::Tria,enum::IssmEnum) # {{{
+ 
+ 	return FindParam(element.parameters, enum)
+@@ -106,7 +118,48 @@
+ 	end
+ 
+ end # }}}
++function GetGroundedPortion(element::Tria, xyz_list::Matrix{Float64}) #{{{
+ 
++	level = Vector{Float64}(undef,3)
++	GetInputListOnVertices!(element, level, MaskOceanLevelsetEnum)
++
++	#Be sure that values are not zero
++	epsilon = 1.e-15
++	for i in 1:3
++		if(level[i]==0.) level[i]=level[i]+epsilon end
++	end
++
++	if level[1]>0 && level[2]>0 && level[3]>0
++      #Completely grounded
++		phi = 1.0
++   elseif level[1]<0 && level[2]<0 && level[3]<0
++      #Completely floating
++      phi = 0.0
++   else
++		#Partially floating,
++		if(level[1]*level[2]>0) #Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
++			s1=level[3]/(level[3]-level[2]);
++			s2=level[3]/(level[3]-level[1]);
++		elseif(level[2]*level[3]>0) #Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
++			s1=level[1]/(level[1]-level[2]);
++			s2=level[1]/(level[1]-level[3]);
++		elseif(level[1]*level[3]>0) #Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
++			s1=level[2]/(level[2]-level[1]);
++			s2=level[2]/(level[2]-level[3]);
++		else
++			error("not supposed to be here...")
++		end
++
++		if(level[1]*level[2]*level[3]>0)
++			phi = s1*s2
++		else
++			phi = (1-s1*s2)
++		end
++	end
++
++	return phi
++end#}}}
++
+ #Finite Element stuff
+ function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26705-26706.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26705-26706.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26705-26706.diff	(revision 26740)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26705)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26706)
+@@ -175,6 +175,10 @@
+ 		end
+ 	end
+ 
++	if(IsIcefront(element))
++		error("not supported")
++	end
++
+ 	return pe
+ end #}}}
+ function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::IssmVector,element::Tria) #{{{
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26705)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26706)
+@@ -159,7 +159,23 @@
+ 
+ 	return phi
+ end#}}}
++function IsIcefront(element::Tria) #{{{
+ 
++	level = Vector{Float64}(undef,3)
++	GetInputListOnVertices!(element, level, MaskIceLevelsetEnum)
++
++	nbice = 0
++	for i in 1:3
++		if(level[i]<0.) nbice+=1 end
++	end
++
++	if(nbice==1)
++		return true
++	else
++		return false
++	end
++end#}}}
++
+ #Finite Element stuff
+ function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26706-26707.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26706-26707.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26706-26707.diff	(revision 26740)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 26706)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 26707)
+@@ -35,10 +35,10 @@
+ field_tolerances={...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,...
+-	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
++	2e-11,1e-11,1e-11,9e-12,2e-11,3e-12,2e-11,1e-11,...
+ 	1e-11,2e-11,2e-11,8e-08,2e-11,...
+ 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+-	1e-11,2e-11,2e-11,2e-08,2e-11,...
++	1e-11,2e-11,2e-11,8e-08,2e-11,...
+ 	};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26706)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26707)
+@@ -41,11 +41,11 @@
+                'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10',
+                'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
+ field_tolerances = [1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12,
+-                    1e-12, 2e-12, 2e-12, 1e-13, 1e-13,
+-                    2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
+-                    1e-12, 2e-12, 2e-12, 2e-08, 1e-13,
++                    1e-11, 2e-11, 2e-11, 1e-12, 2e-11,
++                    2e-11, 1e-11, 1e-11, 9e-12, 2e-11, 3e-12, 2e-11, 1e-11,
++                    1e-11, 2e-11, 2e-11, 8e-08, 2e-11,
+                     2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+-                    1e-12, 2e-12, 2e-12, 8e-08, 1e-13]
++                    1e-11, 2e-11, 2e-11, 8e-08, 2e-11]
+ field_values = [md.results.TransientSolution[0].Vx,
+                 md.results.TransientSolution[0].Vy,
+                 md.results.TransientSolution[0].Vel,
Index: /issm/oecreview/Archive/25834-26739/ISSM-26707-26708.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26707-26708.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26707-26708.diff	(revision 26740)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test541.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.m	(revision 26707)
++++ ../trunk-jpl/test/NightlyRun/test541.m	(revision 26708)
+@@ -35,7 +35,7 @@
+ field_tolerances={...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+ 	1e-11,2e-11,2e-11,1e-12,2e-11,...
+-	2e-11,1e-11,1e-11,9e-12,2e-11,3e-12,2e-11,1e-11,...
++	2e-11,1e-11,1e-11,9e-12,2e-11,2e-11,2e-11,1e-11,...
+ 	1e-11,2e-11,2e-11,8e-08,2e-11,...
+ 	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+ 	1e-11,2e-11,2e-11,8e-08,2e-11,...
+Index: ../trunk-jpl/test/NightlyRun/test541.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test541.py	(revision 26707)
++++ ../trunk-jpl/test/NightlyRun/test541.py	(revision 26708)
+@@ -42,7 +42,7 @@
+                'IceVolume10', 'IceVolumeAboveFloatation10', 'TotalSmb10', 'TotalGroundedBmb10', 'TotalFloatingBmb10']
+ field_tolerances = [1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12,
+                     1e-11, 2e-11, 2e-11, 1e-12, 2e-11,
+-                    2e-11, 1e-11, 1e-11, 9e-12, 2e-11, 3e-12, 2e-11, 1e-11,
++                    2e-11, 1e-11, 1e-11, 9e-12, 2e-11, 2e-11, 2e-11, 1e-11,
+                     1e-11, 2e-11, 2e-11, 8e-08, 2e-11,
+                     2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+                     1e-11, 2e-11, 2e-11, 8e-08, 2e-11]
Index: /issm/oecreview/Archive/25834-26739/ISSM-26708-26709.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26708-26709.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26708-26709.diff	(revision 26740)
@@ -0,0 +1,105 @@
+Index: ../trunk-jpl/src/jl/md/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/exp.jl	(revision 26708)
++++ ../trunk-jpl/src/jl/md/exp.jl	(revision 26709)
+@@ -135,3 +135,100 @@
+ 
+ 	return contours
+ end# }}}
++#ContourToNodes{{{
++"""
++	ContourToNodes - Flag points that are in contour
++
++   More doc to come later....
++
++	Usage:
++		exp=expread(filename)
++
++# Examples:
++```julia-repl
++julia> exp=expread('domainoutline.exp')
++```
++
++# Arguments:
++- filename: the ARGUS file to read
++"""
++function ContourToNodes(x::Vector{Float64},y::Vector{Float64},filename::String,edgevalue::Float64)
++
++	#Read input file
++	contours = expread(filename)
++
++	#Initialize output
++	nbpts = length(x)
++	flags = zeros(Bool,nbpts)
++
++	#Loop over contours
++	for c in 1:length(contours)
++
++		#Get current contours
++		contour = contours[c]
++		xp      = contour.x
++		yp      = contour.y
++
++		#Check that we are within box
++		xmin = minimum(xp); xmax = maximum(xp)
++		ymin = minimum(yp); ymax = maximum(yp)
++
++		#Loop over all points provided
++		for ii in 1:nbpts
++
++			#If this node is already within one of the contours, do not change it
++			if(flags[ii]) continue end
++
++			#Are we within bounds?
++			if(x[ii]<xmin || x[ii]>xmax || y[ii]<ymin || y[ii]>ymax) continue end
++
++			#we are potentially inside... perform pnpoly test
++			flags[ii] = pnpoly(xp, yp, x[ii], y[ii], edgevalue)
++		end
++	end
++	
++	return flags
++end# }}}
++
++function pnpoly(xp::Vector{Float64},yp::Vector{Float64},x::Float64,y::Float64,edgevalue::Float64) #{{{
++
++	npol = length(xp)
++
++	#Do we need to test for colinearity?
++	if(edgevalue!=2)
++		i = 1
++		j = npol
++		while(i<=npol)
++
++			n1 = (yp[i]-yp[j])^2 + (xp[i]-xp[j])^2
++			n2 = (y-yp[j])^2 + (x-xp[j])^2
++
++			normp=sqrt(n1*n2)
++			scalar=(yp[i]-yp[j])*(y-yp[j])+(xp[i]-xp[j])*(x-xp[j])
++
++			if (scalar == normp)
++				if (n2<=n1)
++					return edgevalue
++				end
++			end
++
++			j =  i
++			i += 1
++		end
++	end
++
++	#second test : point is neither on a vertex, nor on a side, where is it ?
++	i = 1
++	j = npol
++	c = false
++	while(i<=npol)
++		if (((yp[i]<=y && y<yp[j]) || (yp[j]<=y && y<yp[i])) &&
++            (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
++         c = !c
++		end
++
++		j =  i
++		i += 1
++	end
++	return c
++end# }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26709-26710.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26709-26710.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26709-26710.diff	(revision 26740)
@@ -0,0 +1,246 @@
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26709)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(revision 26710)
+@@ -175,7 +175,63 @@
+ 		return false
+ 	end
+ end#}}}
++function GetIcefrontCoordinates!(element::Tria, xyz_front::Matrix{Float64}, xyz_list::Matrix{Float64}, levelsetenum::IssmEnum) #{{{
+ 
++	#Intermediaries
++	level        = Vector{Float64}(undef,3)
++	indicesfront = Vector{Int64}(undef,3)
++
++	#Recover value of levelset for all vertices
++	GetInputListOnVertices!(element, level, levelsetenum)
++
++	#Get nodes where there is no ice
++	num_frontnodes = 0
++	for i in 1:3
++		if(level[i]>=0.)
++			num_frontnodes += 1
++			indicesfront[num_frontnodes] = i
++		end
++	end
++	@assert num_frontnodes==2
++
++	#Arrange order of frontnodes such that they are oriented counterclockwise
++	NUMVERTICES = 3
++	if((NUMVERTICES+indicesfront[1]-indicesfront[2])%NUMVERTICES != NUMVERTICES-1)
++		index=indicesfront[1]
++		indicesfront[1]=indicesfront[2]
++		indicesfront[2]=index
++	end
++
++	#Return nodes
++	xyz_front[1,:]=xyz_list[indicesfront[1],:]
++	xyz_front[2,:]=xyz_list[indicesfront[2],:]
++
++end#}}}
++function GetArea(element::Tria)#{{{
++
++	#Get xyz list
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
++	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
++	x3 = xyz_list[3,1]; y3 = xyz_list[3,2]
++
++	@assert x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0
++	return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2
++end#}}}
++function NormalSection(element::Tria, xyz_front::Matrix{Float64}) #{{{
++
++	#Build output pointing vector
++	nx =  xyz_front[2,2] - xyz_front[1,2]
++	ny = -xyz_front[2,1] + xyz_front[1,1]
++
++	#normalize
++	norm = sqrt(nx^2 + ny^2)
++	nx = nx/norm
++	ny = ny/norm
++
++	return nx, ny
++end#}}}
++
+ #Finite Element stuff
+ function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+ 
+@@ -190,6 +246,17 @@
+ 	return Jdet
+ 
+ end#}}}
++function JacobianDeterminantSurface(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
++	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
++	Jdet = .5*sqrt((x2-x1)^2 + (y2-y1)^2)
++
++	#check and return
++	if(Jdet<0) error("negative Jacobian Determinant") end
++	return Jdet
++
++end#}}}
+ function Jacobian(xyz_list::Matrix{Float64}) #{{{
+ 
+ 	J = Matrix{Float64}(undef,2,2)
+@@ -280,3 +347,32 @@
+ 		error("Element type ",finiteelement," not supported yet")
+ 	end
+ end#}}}
++function GaussTria(element::Tria, xyz_list::Matrix{Float64}, xyz_list_front::Matrix{Float64}, order::Int64) #{{{
++
++	area_coordinates = Matrix{Float64}(undef,2,3)
++	GetAreaCoordinates!(element, area_coordinates, xyz_list_front, xyz_list)
++
++	return GaussTria(area_coordinates, order)
++end# }}}
++function GetAreaCoordinates!(element::Tria, area_coordinates::Matrix{Float64}, xyz_zero::Matrix{Float64}, xyz_list::Matrix{Float64})#{{{
++
++	numpoints = size(area_coordinates,1)
++	area = GetArea(element)
++
++	#Copy original xyz_list
++	xyz_bis=copy(xyz_list)
++	for i in 1:numpoints
++		for j in 1:3
++
++			#Change appropriate line
++			xyz_bis[j,:] = xyz_zero[i,:]
++
++			#Compute area fraction
++			area_portion=abs(xyz_bis[2,1]*xyz_bis[3,2] - xyz_bis[2,2]*xyz_bis[3,1] + xyz_bis[1,1]*xyz_bis[2,2] - xyz_bis[1,2]*xyz_bis[2,1] + xyz_bis[3,1]*xyz_bis[1,2] - xyz_bis[3,2]*xyz_bis[1,1])/2
++			area_coordinates[i,j] = area_portion/area
++
++			#reinitialize xyz_list
++			xyz_bis[j,:] = xyz_list[j,:]
++		end
++	end
++end #}}}
+Index: ../trunk-jpl/src/jl/solve/gauss.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26709)
++++ ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26710)
+@@ -6,7 +6,16 @@
+ 	coords2::Vector{Float64}
+ 	coords3::Vector{Float64}
+ end #}}}
++function Base.show(io::IO, this::GaussTria)# {{{
+ 
++	println(io,"GaussTria:")
++	println(io,"   numgauss: ",this.numgauss)
++	println(io,"   weights:  ",this.weights)
++	println(io,"   coords1:  ",this.coords1)
++	println(io,"   coords2:  ",this.coords2)
++	println(io,"   coords3:  ",this.coords3)
++end# }}}
++
+ #Gauss constructor
+ function GaussTria(order::Int64) #{{{
+ 
+@@ -59,3 +68,46 @@
+ 
+ 	return GaussTria(npoints,weights,coords1,coords2,coords3)
+ end# }}}
++function GaussTria(area_coordinates::Matrix{Float64}, order::Int64) #{{{
++	#=Gauss-Legendre quadrature points.
++
++	The recurrence coefficients for Legendre polynomials on (-1,1)
++	are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
++
++	alpha(i)=0.
++	beta (i)=1./(4.-1./(i-1)^2))
++
++	For degree p, the required number of Gauss-Legendre points is
++	n>=(p+1)/2.=#
++
++	if(order==1)
++		npoint  = 1
++		weights = [2.000000000000000]
++		coords  = [0.000000000000000]
++	elseif(order==2)
++		npoints = 2
++		weights = [1.000000000000000, 1.000000000000000]
++		coords  = [-0.577350269189626, 0.577350269189626]
++	elseif(order==3)
++		npoints = 3
++		weights = [0.555555555555556, 0.888888888888889, 0.555555555555556]
++		coords  = [-0.774596669241483, 0.000000000000000, 0.774596669241483]
++	elseif(order==4)
++		npoints = 4
++		weights = [0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454]
++		coords  = [-0.861136311594053,-0.339981043584856, 0.339981043584856, 0.861136311594053]
++	else
++      error("order ",order," not supported yet");
++	end
++
++   coords1  = Vector{Float64}(undef,npoints)
++   coords2  = Vector{Float64}(undef,npoints)
++   coords3  = Vector{Float64}(undef,npoints)
++   for i in 1:npoints
++      coords1[i]  = 0.5*(area_coordinates[1,1]+area_coordinates[2,1]) + 0.5*coords[i]*(area_coordinates[2,1]-area_coordinates[1,1]);
++      coords2[i]  = 0.5*(area_coordinates[1,2]+area_coordinates[2,2]) + 0.5*coords[i]*(area_coordinates[2,2]-area_coordinates[1,2]);
++      coords3[i]  = 0.5*(area_coordinates[1,3]+area_coordinates[2,3]) + 0.5*coords[i]*(area_coordinates[2,3]-area_coordinates[1,3]);
++   end
++
++	return GaussTria(npoints, weights, coords1, coords2, coords3)
++end# }}}
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26709)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26710)
+@@ -34,7 +34,7 @@
+ 
+ 		#Increase count
+ 		count += 1
+-		if(count>maxiter)
++		if(count>=maxiter)
+ 			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
+ 			converged = true
+ 		end
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26709)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26710)
+@@ -176,7 +176,40 @@
+ 	end
+ 
+ 	if(IsIcefront(element))
+-		error("not supported")
++		A = zeros(6)
++
++		#Get additional parameters and inputs
++		b_input   = GetInput(element, BaseEnum)
++		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
++
++		#Get normal and ice front coordinates
++		xyz_list_front = Matrix{Float64}(undef,2,3)
++		GetIcefrontCoordinates!(element, xyz_list_front, xyz_list, MaskIceLevelsetEnum)
++		nx, ny = NormalSection(element, xyz_list_front)
++		#println("nx ",nx," ny:",ny)
++
++		gauss = GaussTria(element, xyz_list, xyz_list_front, 3)
++		for ig in 1:gauss.numgauss
++
++			Jdet = JacobianDeterminantSurface(xyz_list_front, gauss)
++			NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++			H  = GetInputValue(H_input, gauss, ig)
++			b  = GetInputValue(b_input, gauss, ig)
++			sl = 0
++
++			term = 0.5*g*rho_ice*H^2 + 0.5*g*rho_water*(min(0, H+b-sl)^2 - min(0, b-sl)^2)
++
++			for i in 1:numnodes
++				#println("1: ",gauss.weights[ig]*Jdet*term*nx*basis[i]," 2: ",gauss.weights[ig]*Jdet*term*ny*basis[i])
++				pe.values[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
++				pe.values[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
++				A[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
++				A[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
++			end
++		end
++		#error("S")
++		display(A)
+ 	end
+ 
+ 	return pe
Index: /issm/oecreview/Archive/25834-26739/ISSM-26710-26711.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26710-26711.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26710-26711.diff	(revision 26740)
@@ -0,0 +1,134 @@
+Index: ../trunk-jpl/src/jl/test201.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test201.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/test201.jl	(revision 26711)
+@@ -0,0 +1,51 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("issm.jl")
++using .ISSM
++
++md = ISSM.model()
++md = ISSM.triangle(md,"../../test/Exp/Square.exp",50000.)
++md = ISSM.setmask(md,"all","")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base .-10
++
++#Initial velocity
++x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
++md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.1
++md.stressbalance.reltol=0.02
++md.stressbalance.abstol=NaN
++
++#Boundary conditions
++nodefront=ISSM.ContourToNodes(md.mesh.x,md.mesh.y,"../../test/Exp/SquareFront.exp",2.0) .& md.mesh.vertexonboundary
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary .& .~nodefront)
++md.mask.ice_levelset[findall(nodefront)] .= 0
++
++segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
++segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
++pos=md.mesh.segments[segments,1:2]
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test201.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26710)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26711)
+@@ -208,8 +208,6 @@
+ 				A[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
+ 			end
+ 		end
+-		#error("S")
+-		display(A)
+ 	end
+ 
+ 	return pe
+Index: ../trunk-jpl/src/jl/test501.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test501.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/test501.jl	(revision 26711)
+@@ -0,0 +1,46 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("issm.jl")
++using .ISSM
++
++md = ISSM.model()
++md = ISSM.triangle(md,"../../test/Exp/Pig.exp",10000.)
++md = ISSM.setmask(md,"../../test/Exp/PigShelves.exp","../../test/Exp/PigIslands.exp")
++error("not implemented yet")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness .+20
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base
++
++#Initial velocity
++#x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++#y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++#vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++#vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++#index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
++md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.05
++md.stressbalance.reltol=0.05
++md.stressbalance.abstol=NaN
++
++#Boundary conditions
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary)
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test501.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26711-26712.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26711-26712.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26711-26712.diff	(revision 26740)
@@ -0,0 +1,80 @@
+Index: ../trunk-jpl/src/jl/md/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/utils.jl	(revision 26711)
++++ ../trunk-jpl/src/jl/md/utils.jl	(revision 26712)
+@@ -52,7 +52,65 @@
+ 
+ 	return output
+ end# }}}
+-function InterpFromMeshToMesh2d(index::Array,x::Vector,y::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
++function InterpFromMeshToMesh2d(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector,default::Float64=NaN) #{{{
++
++	#Allocate output
++	nods_out = length(xout)
++	data_out = default*ones(nods_out)
++
++	#Interpolation type
++	data_length = size(data,1)
++	nods_data   = length(x_data)
++	nels_data   = size(index_data,1)
++	if(data_length==nods_data)
++		interpolation_type=1;
++	elseif (data_length==nels_data)
++		interpolation_type=2
++	else
++		error("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!")
++	end
++	xmin = minimum(xout); xmax = maximum(xout)
++	ymin = minimum(yout); ymax = maximum(yout)
++
++	for i in 1:nels_data
++
++		#skip element if no overlap
++		if (minimum(x_data[index_data[i,:]]) > xmax) continue end
++		if (minimum(y_data[index_data[i,:]]) > ymax) continue end
++		if (maximum(x_data[index_data[i,:]]) < xmin) continue end
++		if (maximum(y_data[index_data[i,:]]) < ymin) continue end
++
++		#get area of the current element (Jacobian = 2 * area)*/
++		#area =x2 * y3 - y2*x3 + x1 * y2 - y1 * x2 + x3 * y1 - y3 * x1;
++		area = (x_data[index_data[i,2]]*y_data[index_data[i,3]]-y_data[index_data[i,2]]*x_data[index_data[i,3]] 
++				  +  x_data[index_data[i,1]]*y_data[index_data[i,2]]-y_data[index_data[i,1]]*x_data[index_data[i,2]] 
++				  +  x_data[index_data[i,3]]*y_data[index_data[i,1]]-y_data[index_data[i,3]]*x_data[index_data[i,1]])
++
++		for j in 1:nods_out
++			#Get first area coordinate = det(x-x3  x2-x3 ; y-y3   y2-y3)/area
++			area_1=((xout[j]-x_data[index_data[i,3]])*(y_data[index_data[i,2]]-y_data[index_data[i,3]])
++					 -  (yout[j]-y_data[index_data[i,3]])*(x_data[index_data[i,2]]-x_data[index_data[i,3]]))/area
++			#Get second area coordinate =det(x1-x3  x-x3 ; y1-y3   y-y3)/area
++			area_2=((x_data[index_data[i,1]]-x_data[index_data[i,3]])*(yout[j]-y_data[index_data[i,3]])
++					  - (y_data[index_data[i,1]]-y_data[index_data[i,3]])*(xout[j]-x_data[index_data[i,3]]))/area
++			#Get third area coordinate = 1-area1-area2
++			area_3=1-area_1-area_2
++
++			if (area_1>=0 && area_2>=0 && area_3>=0)
++				if (interpolation_type==1)
++					#nodal interpolation
++					data_out[j]=area_1*data[index_data[i,1]]+area_2*data[index_data[i,2]]+area_3*data[index_data[i,3]];
++				else
++					#element interpolation
++					data_out[j]=data[i];
++				end
++			end
++		end
++	end
++	return data_out
++
++	#OLD STUFF!!! not working...
++	
+ 	#prepare input arrays
+ 	nods = Cint(length(x))
+ 	nels = Cint(size(index,1))
+@@ -125,3 +183,8 @@
+ 		end
+ 	end
+ end #}}}
++function meshgrid(x::Vector, y::Vector)
++    X = [i for i in x, j in 1:length(y)]
++    Y = [j for i in 1:length(x), j in y]
++    return X, Y
++end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26712-26713.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26712-26713.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26712-26713.diff	(revision 26740)
@@ -0,0 +1,106 @@
+Index: ../trunk-jpl/src/jl/md/parameterization.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/parameterization.jl	(revision 26712)
++++ ../trunk-jpl/src/jl/md/parameterization.jl	(revision 26713)
+@@ -16,8 +16,8 @@
+ """
+ function setmask(md::model,floatingicename::String,groundedicename::String)
+ 
+-	elementonfloatingice = FlagElements( md, floatingicename);
+-	elementongroundedice = FlagElements( md, groundedicename);
++	elementonfloatingice = FlagElements( md, floatingicename)
++	elementongroundedice = FlagElements( md, groundedicename)
+ 
+ 	elementonfloatingice = convert( Array{Float64}, (elementonfloatingice.>0) .&  (elementongroundedice.==0.))
+ 	elementongroundedice = convert( Array{Float64}, elementonfloatingice.==0.)
+@@ -44,7 +44,9 @@
+ 	elseif region == "all"
+ 		flags = ones(md.mesh.numberofelements)
+ 	else
+-		flags = InContour(md.mesh.x,md.mesh.y,region);
++		xcenter = md.mesh.x[md.mesh.elements]*[1;1;1]/3
++		ycenter = md.mesh.y[md.mesh.elements]*[1;1;1]/3
++		flags = ContourToNodes(xcenter, ycenter, region, 2.)
+ 	end
+ 
+ 	return flags
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26712)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26713)
+@@ -25,12 +25,13 @@
+ y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+ vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+ vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+-index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+-md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+-md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++index = Int.(ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
++md.initialization.vx=ISSM.InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y,0.0)
++md.initialization.vy=ISSM.InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y,0.0)
+ 
+ md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+ 
+ md.stressbalance.restol=0.05
+ md.stressbalance.reltol=0.05
+Index: ../trunk-jpl/src/jl/test501.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test501.jl	(revision 26712)
++++ ../trunk-jpl/src/jl/test501.jl	(revision 26713)
+@@ -5,35 +5,31 @@
+ md = ISSM.model()
+ md = ISSM.triangle(md,"../../test/Exp/Pig.exp",10000.)
+ md = ISSM.setmask(md,"../../test/Exp/PigShelves.exp","../../test/Exp/PigIslands.exp")
+-error("not implemented yet")
+ 
+-#Geometry
+-hmin=300.
+-hmax=1000.
+-ymin=minimum(md.mesh.y)
+-ymax=maximum(md.mesh.y)
+-xmin=minimum(md.mesh.x)
+-xmax=maximum(md.mesh.x)
+-md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+-md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness .+20
+-md.geometry.surface   = md.geometry.base+md.geometry.thickness
+-md.geometry.bed       = md.geometry.base
++#Initial velocity and geometry
++x         = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","x")
++y         = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","y")
++vx_obs    = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","vx_obs")
++vy_obs    = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","vy_obs")
++index     = Int.(ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","index"))
++surface   = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","surface")
++thickness = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","thickness")
++bed       = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","bed")
++md.initialization.vx=ISSM.InterpFromMeshToMesh2d(index, x, y, vx_obs, md.mesh.x, md.mesh.y, 0.0)
++md.initialization.vy=ISSM.InterpFromMeshToMesh2d(index, x, y, vy_obs, md.mesh.x, md.mesh.y, 0.0)
++md.geometry.surface = ISSM.InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y, 0.0)
++md.geometry.thickness = ISSM.InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y, 0.0)
++md.geometry.base=md.geometry.surface .- md.geometry.thickness
++md.geometry.bed =md.geometry.base
++pos = findall(md.mask.ocean_levelset.<0)
++md.geometry.bed[pos] = ISSM.InterpFromMeshToMesh2d(index, x, y, bed, md.mesh.x[pos], md.mesh.y[pos])
+ 
+-#Initial velocity
+-#x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+-#y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+-#vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+-#vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+-#index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+-md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+-md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
+-
+ md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+-md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++md.friction.coefficient=50*ones(md.mesh.numberofvertices)
+ 
+ md.stressbalance.restol=0.05
+-md.stressbalance.reltol=0.05
++md.stressbalance.reltol=1.0
+ md.stressbalance.abstol=NaN
+ 
+ #Boundary conditions
Index: /issm/oecreview/Archive/25834-26739/ISSM-26713-26714.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26713-26714.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26713-26714.diff	(revision 26740)
@@ -0,0 +1,23 @@
+Index: ../trunk-jpl/src/jl/test501.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test501.jl	(revision 26713)
++++ ../trunk-jpl/src/jl/test501.jl	(revision 26714)
+@@ -33,9 +33,17 @@
+ md.stressbalance.abstol=NaN
+ 
+ #Boundary conditions
++pos = findall(vec(sum(Int64.(md.mask.ocean_levelset[md.mesh.elements].<0), dims=2)) .> 0.0)
++vertexonfloatingice=zeros(md.mesh.numberofvertices)
++vertexonfloatingice[md.mesh.elements[pos,:]] .= 1
++nodefront=(md.mesh.vertexonboundary .& (vertexonfloatingice.>0))
++md.mask.ice_levelset[findall(nodefront)] .= 0
++
+ md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+ md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+-pos = findall(md.mesh.vertexonboundary)
++segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
++segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
++pos=md.mesh.segments[segments,1:2]
+ md.stressbalance.spcvx[pos] .= 0.0
+ md.stressbalance.spcvy[pos] .= 0.0
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26714-26715.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26714-26715.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26714-26715.diff	(revision 26740)
@@ -0,0 +1,121 @@
+Index: ../trunk-jpl/src/jl/md/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/utils.jl	(revision 26714)
++++ ../trunk-jpl/src/jl/md/utils.jl	(revision 26715)
+@@ -152,6 +152,56 @@
+ 
+ 	return dataout
+ end #}}}
++function InterpFromMeshToMesh2d2(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
++
++	#prepare input arrays
++	nods = Cint(length(x_data))
++	nels = Cint(size(index_data,1))
++	nods_interp = Cint(length(xout))
++	Cindex=Array{Cint,1}(undef,length(index_data))
++	for i in 1:size(index_data,1)
++		for j in 1:3
++			Cindex[(i-1)*3+j] = Int32(index_data[i,j])
++		end
++	end
++	Cx    = Array{Cdouble,1}(undef,nods)
++	Cy    = Array{Cdouble,1}(undef,nods)
++	Cdata = Array{Cdouble,1}(undef,nods)
++	for i in 1:nods
++		Cx[i]    = x_data[i]
++		Cy[i]    = y_data[i]
++		Cdata[i] = data[i]
++	end
++	Cxout    = Array{Cdouble,1}(undef,nods_interp)
++	Cyout    = Array{Cdouble,1}(undef,nods_interp)
++	Cdataout = Array{Cdouble,1}(undef,nods_interp)
++	for i in 1:nods_interp
++		Cxout[i] = xout[i]
++		Cyout[i] = yout[i]
++	end
++
++	#This is not working....
++	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
++	#			Cint, (Ptr{Cdouble},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
++	#			Ref(Cdataout), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
++	#			Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
++	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
++	#			Cint, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint),
++	#			Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels)
++	#
++	#
++	dataout = Vector{Float64}(undef,nods_interp)
++	rc=ccall( (:InterpFromMeshToMesh2dx3,"/Users/mmorligh/Desktop/issmuci/trunk-jpl/src/jl/bamg/libBamg.dylib"),
++				Cint, (Ptr{Cdouble}, Cint),
++				dataout, nods_interp)
++
++	#Process output
++	for i in 1:nods_interp
++		dataout[i] = Cdataout[i]
++	end
++
++	return dataout
++end #}}}
+ function solve(md::model,solution::String) #{{{
+ 
+ 	if solution=="sb" || solution=="Stressbalance"
+Index: ../trunk-jpl/src/jl/md/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/classes.jl	(revision 26714)
++++ ../trunk-jpl/src/jl/md/classes.jl	(revision 26715)
+@@ -134,6 +134,55 @@
+ function model() #{{{
+ 	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants(), [], BuddFriction())
+ end#}}}
++function model(matmd::Dict) #{{{
++
++	#initialize output
++	md = model()
++
++	#Loop over all possible fields
++	for name1 in fieldnames(model)
++		if haskey(matmd, String(name1))
++			mdfield  = getfield(md,name1)
++			matfield = matmd[String(name1)]
++			for name2 in fieldnames(typeof(mdfield))
++				if haskey(matfield, String(name2))
++					println("recovering md.",name1,".",name2)
++					value_matlab = matfield[String(name2)]
++					value_julia  = getfield(mdfield, name2)
++
++					if typeof(value_matlab)==typeof(value_julia)
++						#setfield!(mdfield, name2, convert(typeof(getfield(mdfield, name2)), matfield[String(name2)]))
++						setfield!(mdfield, name2, value_matlab)
++
++					elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Int64
++						setfield!(mdfield, name2, Int64(value_matlab))
++
++					elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Float64}
++						if(size(value_matlab,2)!=1) error("only one column expected") end
++						setfield!(mdfield, name2, value_matlab[:,1])
++
++					elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Matrix{Int64}
++						matrix = Matrix{Int64}(undef,size(value_matlab))
++						for i in 1:length(value_matlab) matrix[i] = Int64(value_matlab[i]) end
++						setfield!(mdfield, name2, matrix)
++
++					elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Bool}
++						if(size(value_matlab,2)!=1) error("only one column expected") end
++						vector = Vector{Bool}(undef,size(value_matlab,1))
++						for i in 1:length(vector) vector[i] = Bool(value_matlab[i]) end
++						setfield!(mdfield, name2, vector)
++
++					else
++						error("Don't know how to convert ",typeof(value_matlab)," to ",typeof(value_julia))
++					end
++				end
++			end
++			#setfield!(md, name1, mdfield)
++		end
++	end
++
++	return md
++end#}}}
+ function Base.show(io::IO, md::model)# {{{
+ 
+ 	compact = get(io, :compact, false)
Index: /issm/oecreview/Archive/25834-26739/ISSM-26715-26716.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26715-26716.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26715-26716.diff	(revision 26740)
@@ -0,0 +1,128 @@
+Index: ../trunk-jpl/src/jl/md/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/classes.jl	(revision 26715)
++++ ../trunk-jpl/src/jl/md/classes.jl	(revision 26716)
+@@ -140,44 +140,45 @@
+ 	md = model()
+ 
+ 	#Loop over all possible fields
+-	for name1 in fieldnames(model)
+-		if haskey(matmd, String(name1))
+-			mdfield  = getfield(md,name1)
+-			matfield = matmd[String(name1)]
+-			for name2 in fieldnames(typeof(mdfield))
+-				if haskey(matfield, String(name2))
+-					println("recovering md.",name1,".",name2)
+-					value_matlab = matfield[String(name2)]
+-					value_julia  = getfield(mdfield, name2)
++	for name1 in keys(matmd)
++		if !(Symbol(name1) in fieldnames(model))
++			println("could not recover md.",name1)
++			continue
++		end
++		mdfield  = getfield(md,Symbol(name1))
++		matfield = matmd[name1]
++		for name2 in keys(matfield)
++			if !(Symbol(name2) in fieldnames(typeof(mdfield)))
++				println("could not recover md.",name1,".",name2)
++				continue
++			end
++			value_matlab = matfield[name2]
++			value_julia  = getfield(mdfield, Symbol(name2))
+ 
+-					if typeof(value_matlab)==typeof(value_julia)
+-						#setfield!(mdfield, name2, convert(typeof(getfield(mdfield, name2)), matfield[String(name2)]))
+-						setfield!(mdfield, name2, value_matlab)
++			if typeof(value_matlab)==typeof(value_julia)
++				setfield!(mdfield, Symbol(name2), value_matlab)
+ 
+-					elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Int64
+-						setfield!(mdfield, name2, Int64(value_matlab))
++			elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Int64
++				setfield!(mdfield, Symbol(name2), Int64(value_matlab))
+ 
+-					elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Float64}
+-						if(size(value_matlab,2)!=1) error("only one column expected") end
+-						setfield!(mdfield, name2, value_matlab[:,1])
++			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Float64}
++				if(size(value_matlab,2)!=1) error("only one column expected") end
++				setfield!(mdfield, Symbol(name2), value_matlab[:,1])
+ 
+-					elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Matrix{Int64}
+-						matrix = Matrix{Int64}(undef,size(value_matlab))
+-						for i in 1:length(value_matlab) matrix[i] = Int64(value_matlab[i]) end
+-						setfield!(mdfield, name2, matrix)
++			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Matrix{Int64}
++				matrix = Matrix{Int64}(undef,size(value_matlab))
++				for i in 1:length(value_matlab) matrix[i] = Int64(value_matlab[i]) end
++				setfield!(mdfield, Symbol(name2), matrix)
+ 
+-					elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Bool}
+-						if(size(value_matlab,2)!=1) error("only one column expected") end
+-						vector = Vector{Bool}(undef,size(value_matlab,1))
+-						for i in 1:length(vector) vector[i] = Bool(value_matlab[i]) end
+-						setfield!(mdfield, name2, vector)
++			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Bool}
++				if(size(value_matlab,2)!=1) error("only one column expected") end
++				vector = Vector{Bool}(undef,size(value_matlab,1))
++				for i in 1:length(vector) vector[i] = Bool(value_matlab[i]) end
++				setfield!(mdfield, Symbol(name2), vector)
+ 
+-					else
+-						error("Don't know how to convert ",typeof(value_matlab)," to ",typeof(value_julia))
+-					end
+-				end
++			else
++				error("Don't know how to convert ",typeof(value_matlab)," to ",typeof(value_julia))
+ 			end
+-			#setfield!(md, name1, mdfield)
+ 		end
+ 	end
+ 
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26715)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26716)
+@@ -26,8 +26,8 @@
+ vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+ vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+ index = Int.(ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
+-md.initialization.vx=ISSM.InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y,0.0)
+-md.initialization.vy=ISSM.InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y,0.0)
++md.initialization.vx=ISSM.InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y,NaN)
++md.initialization.vy=ISSM.InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y,NaN)
+ 
+ md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26715)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26716)
+@@ -176,7 +176,6 @@
+ 	end
+ 
+ 	if(IsIcefront(element))
+-		A = zeros(6)
+ 
+ 		#Get additional parameters and inputs
+ 		b_input   = GetInput(element, BaseEnum)
+@@ -186,7 +185,6 @@
+ 		xyz_list_front = Matrix{Float64}(undef,2,3)
+ 		GetIcefrontCoordinates!(element, xyz_list_front, xyz_list, MaskIceLevelsetEnum)
+ 		nx, ny = NormalSection(element, xyz_list_front)
+-		#println("nx ",nx," ny:",ny)
+ 
+ 		gauss = GaussTria(element, xyz_list, xyz_list_front, 3)
+ 		for ig in 1:gauss.numgauss
+@@ -201,11 +199,8 @@
+ 			term = 0.5*g*rho_ice*H^2 + 0.5*g*rho_water*(min(0, H+b-sl)^2 - min(0, b-sl)^2)
+ 
+ 			for i in 1:numnodes
+-				#println("1: ",gauss.weights[ig]*Jdet*term*nx*basis[i]," 2: ",gauss.weights[ig]*Jdet*term*ny*basis[i])
+ 				pe.values[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
+ 				pe.values[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
+-				A[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
+-				A[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
+ 			end
+ 		end
+ 	end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26716-26717.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26716-26717.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26716-26717.diff	(revision 26740)
@@ -0,0 +1,44 @@
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26716)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26717)
+@@ -12,11 +12,11 @@
+ 	count = 1
+ 	for i in 1:md.mesh.numberofvertices
+ 		if ~isnan(spcvx[i])
+-			push!(constraints,Constraint(count,i,1,spcvx[i]))
++			push!(constraints,Constraint(count,i,1,spcvx[i]/md.constants.yts))
+ 			count+=1
+ 		end
+ 		if ~isnan(spcvy[i])
+-			push!(constraints,Constraint(count,i,2,spcvy[i]))
++			push!(constraints,Constraint(count,i,2,spcvy[i]/md.constants.yts))
+ 			count+=1
+ 		end
+ 	end
+Index: ../trunk-jpl/src/jl/test.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/test.jl	(revision 26717)
+@@ -0,0 +1,14 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("issm.jl")
++using .ISSM
++using MAT
++
++#Load model from MATLAB file
++#file = matopen("Pig.mat")
++file = matopen("/Users/mmorligh/Desktop/issmuci/trunk-jpl/examples/Pig2/Pig.mat")
++mat = read(file, "md")
++close(file)
++md=ISSM.model(mat)
++
++#Solve stress balance
++md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26717-26718.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26717-26718.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26717-26718.diff	(revision 26740)
@@ -0,0 +1,72 @@
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26717)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(revision 26718)
+@@ -215,6 +215,10 @@
+ 		AddToGlobal!(Ke,Kff,Kfs)
+ 		AddToGlobal!(pe,pf)
+ 	end
++
++	Assemble!(Kff)
++	Assemble!(Kfs)
++	Assemble!(pf)
+ 	
+ 	return Kff, Kfs, pf
+ end# }}}
+Index: ../trunk-jpl/src/jl/solve/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26717)
++++ ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26718)
+@@ -4,10 +4,15 @@
+ 
+ #Matrix
+ mutable struct IssmMatrix #{{{
++	M::Int64
++	N::Int64
++	rows::Vector{Int64}
++	cols::Vector{Int64}
++	vals::Vector{Float64}
+ 	matrix::SparseMatrixCSC{Float64,Int64}
+ end #}}}
+ function IssmMatrix(M::Int64,N::Int64)#{{{
+-	return IssmMatrix(spzeros(M,N))
++	return IssmMatrix(M, N, Vector{Int64}(undef,0), Vector{Int64}(undef,0), Vector{Float64}(undef,0), spzeros(0,0))
+ end#}}}
+ function AddValues!(matrix::IssmMatrix,m::Int64,midx::Vector{Int64},n::Int64,nidx::Vector{Int64},values::Matrix{Float64})#{{{
+ 
+@@ -16,7 +21,9 @@
+ 		if(midx[i]==-1) continue end
+ 		for j in 1:n
+ 			if(nidx[j]==-1) continue end
+-			matrix.matrix[midx[i],nidx[j]] += values[i,j]
++			push!(matrix.rows, midx[i])
++			push!(matrix.cols, nidx[j])
++			push!(matrix.vals, values[i,j])
+ 		end
+ 	end
+ 
+@@ -26,7 +33,12 @@
+ 	return size(matrix.matrix)
+ 
+ end#}}}
++function Assemble!(matrix::IssmMatrix)#{{{
+ 
++	matrix.matrix = sparse(matrix.rows, matrix.cols, matrix.vals, matrix.M, matrix.N)
++
++end#}}}
++
+ #Vector
+ mutable struct IssmVector #{{{
+ 	vector::Vector{Float64}
+@@ -74,6 +86,11 @@
+ 	y.vector = x.vector
+ 
+ end#}}}
++function Assemble!(vector::IssmVector)#{{{
++
++	#Nothing to do for this toolkit
++
++end#}}}
+ function Norm(x::IssmVector,type::Int64)#{{{
+ 
+ 	norm = 0
Index: /issm/oecreview/Archive/25834-26739/ISSM-26718-26719.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26718-26719.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26718-26719.diff	(revision 26740)
@@ -0,0 +1,1001 @@
+Index: ../trunk-jpl/test/MITgcm/code_4003/cpl_issm.F
+===================================================================
+--- ../trunk-jpl/test/MITgcm/code_4003/cpl_issm.F	(revision 26718)
++++ ../trunk-jpl/test/MITgcm/code_4003/cpl_issm.F	(revision 26719)
+@@ -66,7 +66,11 @@
+          CALL MPI_BCAST(CouplingTime,1,MPI_DOUBLE,0,
+      &        MPI_COMM_MODEL,mpiRC)
+          _END_MASTER( myThid )
+-C        print*, 'Ocean received CouplingTime: ', CouplingTime
++#ifdef ALLOW_DEBUG
++         IF ( debugLevel .GE. debLevD ) THEN
++            print*, 'Ocean received CouplingTime: ', CouplingTime
++         ENDIF
++#endif
+ 
+ C   I2. MITgcm sends grid size (NX and NY)
+          IF( myProcId .EQ. 0 ) THEN
+@@ -134,7 +138,11 @@
+             _BEGIN_MASTER( myThid )
+             call MPI_Recv(IceModelTime,1,MPI_DOUBLE,0,10001001,
+      &           toissmcomm,mpistatus,mpiRC)
+-C           print*, 'Ocean received IceModelTime: ', IceModelTime
++#ifdef ALLOW_DEBUG
++            IF ( debugLevel .GE. debLevD ) THEN
++               print*, 'Ocean received IceModelTime: ', IceModelTime
++            ENDIF
++#endif
+             _END_MASTER( myThid )
+          ENDIF
+ 
+@@ -175,8 +183,11 @@
+             _END_MASTER( myThid )
+          ENDIF
+          CALL BAR2( myThid )
+-C        print*,'Done Sending shelficeFreshWaterFlux array.'
+-         
++#ifdef ALLOW_DEBUG
++         IF ( debugLevel .GE. debLevD ) THEN
++            print*,'Done Sending shelficeFreshWaterFlux array.'
++         ENDIF
++#endif
+       ENDIF
+ C End recurring step C3.
+ 
+Index: ../trunk-jpl/test/MITgcm/input_4003/data
+===================================================================
+--- ../trunk-jpl/test/MITgcm/input_4003/data	(revision 26718)
++++ ../trunk-jpl/test/MITgcm/input_4003/data	(revision 26719)
+@@ -45,7 +45,7 @@
+ #bottomVisc_pCell=.TRUE.,
+ #-
+  readBinaryPrec=64,
+- writeBinaryPrec=64,
++#writeBinaryPrec=64,
+  useSingleCpuIO=.TRUE.,
+ #globalFiles=.TRUE.,
+  debuglevel = 2,
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26718)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26719)
+@@ -2,9 +2,7 @@
+ %ISSM/MITgcm coupled set-up
+ %
+ %Script control parameters
+-steps=1:12;
+-steps=1:6;
+-final_time=1/365;
++steps=1:11;
+ 
+ %To download and recompile MITgcm from scratch:
+ !rm -rf ${ISSM_DIR}/test/MITgcm/install
+@@ -19,55 +17,31 @@
+ 
+ % {{{ 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=8; %number of MITgcm processes to use in y direction
+-	xgOrigin=0; %origin of longitude
+-	ygOrigin=-75.5; %origin of latitude
+-	dLong=.125; %longitude grid spacing
+-	dLat=dLong/16; %latitude grid spacing
+-	delZ=10; %thickness of vertical levels
+-	icefront_position_ratio=.75;
+-	ice_thickness=1000;
+-	rho_ice=917;
+-	rho_water=1028.14;
+-	di=rho_ice/rho_water;
++    Nx=3;   % number of longitude cells
++    Ny=200; % number of latitude cells
++    Nz=90;  % number of MITgcm vertical cells
++    nPx=1;  % number of MITgcm processes to use in x direction
++    nPy=8;  % number of MITgcm processes to use in y direction
++    xgOrigin=0;     % origin of longitude
++    ygOrigin=-75.5; % origin of latitude
++    dLong=.125;     % longitude grid spacing
++    dLat=dLong/16;  % latitude grid spacing
++    delZ=10;        % thickness of vertical levels (m)
++    gravity= 9.81;  % gravity (m^2/s)
++    rho_ice=917;
++    rho_water=1030;
++    di=rho_ice/rho_water;
++    prec = 'real*8'; % precision of MITgcm input binary files
+ 
+-	% 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)
++    % bathymetry and ice sheet geometry
++    H = -900;	    % water depth in the ice shelf cavity
++    Hmin = -600;    % deepest point of cavern		
++    Hmax = -300;    % shallowest point of cavern
++    jEnd = Ny*3/4;  % where ice-shelf ends
++    j2   = jEnd+1;
+ 
+-	MITgcmDeltaT=450; % 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
+-
+-	% 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);
++    savedata(org, Nx, Ny, nPx, nPy, Nz, dLong, dLat, delZ, xgOrigin, ygOrigin, ...
++             rho_ice, rho_water, di, H, Hmin, Hmax, jEnd, j2, gravity, prec);
+ end
+ % }}}
+ % {{{ Bathymetry:
+@@ -75,42 +49,15 @@
+ 
+     loaddata(org,'Parameters');
+ 
+-    v0 = 2e3;
+-    h0 = 800;
+-
+-    hfacMin = 0.2;
+-
+-    eos = 'jmd95z';
+-    prec = 'real*8';
+-
+     %create lat,lon
+     latg = ygOrigin+[0:Ny-1]*dLat;
+     latc = latg+dLat/2;
+     long = xgOrigin+[0:Nx-1]*dLong;
+     lonc = long+dLong/2;
++    [lat lon]=meshgrid(latc,lonc);
+     zC=-delZ*([1:Nz]-0.5);
+     zF=-delZ*[0:Nz];
+-            
+-    lat=(ygOrigin+dLat/2):dLat:(ygOrigin+Ny*dLat);
+-    lon=(xgOrigin+dLong/2):dLong:(xgOrigin+Nx*dLong);
+-    [lat lon]=meshgrid(lat,lon);
+-
+-    longmin=min(lon(:));
+-    longmax=max(lon(:));
+-    latmin=min(lat(:));
+-    latmax=max(lat(:));
+-
+-% Gravity
+-gravity= 9.81;
+-rhoConst= 1030;
+-
+-% Nominal depth of model (meters)
+-H = -900;		%water depth in the ice shelf cavity
+-Hmin = -600;		% deepest point of cavern		
+-Hmax = -300;		% shallowest point of cavern
+-jEnd = Ny*3/4;		 % where ice-shelf ends
+-dHdy = (Hmax-Hmin)/dLat/(jEnd-2); %Slope of ice shelf
+-
++    
+     %create bathymetry:
+     bathymetry = ones(Nx,Ny)*H;
+     bathymetry(:,1) = 0;
+@@ -118,105 +65,31 @@
+     %save bathymetry file for MITgcm
+     savedata(org,lat,lon,bathymetry);
+ 
+-j2=jEnd+1;
+-hIce=bathymetry;
+-for i=1:Nx
+-    hIce(i,:)=Hmin+dHdy*[-1:Ny-2]*dLat;
+-    hIce(i,1)=0; hIce(i,j2:Ny)=0;
+ end
+-
+-var=([1:Ny]-2)/(jEnd-2);
+-dMdt_fy=bathymetry;
+-for i=1:Nx
+-    dMdt_fy(i,:)=-cos(pi*var);
+-    dMdt_fy(i,1)=0; dMdt_fy(i,j2:Ny)=0;
+-end
+-
+-regMsk=ones(Nx,Ny);
+-regMsk(:,1)=0; regMsk(:,j2:Ny)=2;
+-
+-%- rate of change due to ice-stream dynamics
+-rateDyn=rhoConst*0.1/3600;  sfx='r02';
+-
+-dMdt=rateDyn*dMdt_fy;
+-
+-dz = delZ*ones(1,Nz);
+-zgp1 = [0,cumsum(dz)];
+-zc = .5*(zgp1(1:end-1)+zgp1(2:end));
+-zg = zgp1(1:end-1);
+-dz = diff(zgp1);
+-
+-T_sfc = -1.9;
+-T_bot = 2;
+-del_T = (T_bot - T_sfc)/(59*delZ);
+-tref=0*dz;
+-for k = 1:Nz;
+-    tref(k) = T_sfc + del_T*((k-20)*delZ);
+-    tref(k)= max(T_sfc,min(tref(k),T_bot));
+-end
+-
+-S_sfc = 34.2;
+-S_bot = 34.7;
+-del_S = (S_bot - S_sfc)/(59*delZ);
+-sref=0*dz;
+-for k = 1:Nz;
+-    sref(k) = S_sfc + del_S*((k-20)*delZ);
+-    sref(k)= max(S_sfc,min(sref(k),S_bot));
+-end
+-pEOS=-rhoConst*gravity*zC; % in Pa
+-pEOS=pEOS*1.e-4; % in dBar
+-rhoAn=densjmd95(sref,tref,pEOS);
+-rhoAn=rhoAn-rhoConst;
+-
+-pF=-rhoConst*gravity*zF*1.e-4; % in dBar
+-rhoUp=densjmd95(sref,tref,pF(2:end));
+-rhoDw=densjmd95(sref,tref,pF(1:Nz));
+-dRho=rhoUp(1:Nz-1)-rhoDw(2:Nz);
+-NSq=-gravity*dRho/delZ/rhoConst;
+-
+-mnV=min(NSq); MxV=max(NSq); Avr=mean(NSq);
+-
+-zax=[1:Nz];
+-
+-v1=2.5e-2;
+-var=1+Nz-2*zax; var=var/(Nz-1);
+-vobc=v1*var;
+-
+-rhoAvr=rhoConst-1.345;
+-mIce=-rhoAvr*hIce;
+-
+-end
+ % }}}
+ % {{{ IceSheetGeometry:
+ if perform(org,'IceSheetGeometry'),
+ 
+-	loaddata(org,'Parameters');
+-	loaddata(org,'Bathymetry');
+-	latmin=min(lat(:));
+-	latmax=max(lat(:));
++    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);
++    dHdy = (Hmax-Hmin)/dLat/(jEnd-2); %Slope of ice shelf
++    draft=bathymetry;
++    for i=1:Nx
++        draft(i,:)=Hmin+dHdy*[-1:Ny-2]*dLat;
++        draft(i,1)=0; draft(i,j2:Ny)=0;
++    end
+ 
+-	%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);
++    ice_mask=ones(Nx,Ny);
++    ice_mask(:,j2:Ny)=0;
++    iceshelf_mask=ice_mask;
++    iceshelf_mask(:,1)=0;
++    thickness=abs(draft)/di;
++    thickness(:,1)=thickness(:,2)+draft(:,2);
++    
++    savedata(org,ice_mask,iceshelf_mask,draft,thickness);
+ end
+ % }}}
+ 
+@@ -234,6 +107,11 @@
+ addpath(recursivepath([pwd '/../MITgcm']));
+ % {{{ RunUncoupledMITgcm:
+ if perform(org,'RunUncoupledMITgcm'),
++
++    loaddata(org,'Parameters');
++    loaddata(org,'Bathymetry');
++    loaddata(org,'IceSheetGeometry');
++
+     % rename previous run directory and create new one
+     if exist ('run.old')
+         !\rm -rf run.old
+@@ -245,29 +123,55 @@
+     !\cp ../MITgcm/build/mitgcmuv run
+     !\cp ../MITgcm/input_4003/* run
+     !\cp ../MITgcm/input_4003/eedata_uncoupled run/eedata
+-    cd run
+     
+-    namF='bathy_flat.bin';
++    % {{{ Construct MITgcm binary input files
++    namF='run/bathy_flat.bin';
+     fid=fopen(namF,'w','b'); fwrite(fid,bathymetry,prec);fclose(fid);
+     
+-    namF='shelficeTopo.Lin.bin';
+-    fid=fopen(namF,'w','b'); fwrite(fid,hIce,prec);fclose(fid);
++    namF='run/shelficeTopo.Lin.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,draft,prec);fclose(fid);
+     
+-    namF='under_Ice_mask.bin';
+-    fid=fopen(namF,'w','b'); fwrite(fid,regMsk,prec);fclose(fid);
+-    
+-    namF=sprintf('%s.%s.%s','shelfice_dMdt',sfx,'bin');
++    var=([1:Ny]-2)/(jEnd-2);
++    dMdt_fy=zeros(Nx,Ny);
++    for i=1:Nx
++        dMdt_fy(i,:)=-cos(pi*var);
++        dMdt_fy(i,1)=0; dMdt_fy(i,j2:Ny)=0;
++    end    
++    %- rate of change due to ice-stream dynamics
++    rateDyn=rho_water*0.1/3600;  sfx='r02';
++    dMdt=rateDyn*dMdt_fy;
++    namF=sprintf('%s.%s.%s','run/shelfice_dMdt',sfx,'bin');
+     fid=fopen(namF,'w','b'); fwrite(fid,dMdt,prec);fclose(fid);
+ 
+-    namF='temp_obc.bin';
++    T_sfc = -1.9;
++    T_bot = 2;
++    del_T = (T_bot - T_sfc)/(59*delZ);
++    tref=zeros(1,Nz);
++    for k = 1:Nz;
++        tref(k) = T_sfc + del_T*((k-20)*delZ);
++        tref(k)= max(T_sfc,min(tref(k),T_bot));
++    end
++    namF='run/temp_obc.bin';
+     tref=[tref; tref; tref];
+     fid=fopen(namF,'w','b'); fwrite(fid,tref,prec);fclose(fid);
+ 
+-    namF='salt_obc.bin';
++    S_sfc = 34.2;
++    S_bot = 34.7;
++    del_S = (S_bot - S_sfc)/(59*delZ);
++    sref=zeros(1,Nz);
++    for k = 1:Nz;
++        sref(k) = S_sfc + del_S*((k-20)*delZ);
++        sref(k)= max(S_sfc,min(sref(k),S_bot));
++    end
++    namF='run/salt_obc.bin';
+     sref=[sref; sref; sref];
+     fid=fopen(namF,'w','b'); fwrite(fid,sref,prec);fclose(fid);
+ 
+-    namF='vVel_obc.bin';
++    zax=[1:Nz];
++    v1=2.5e-2;
++    var=1+Nz-2*zax; var=var/(Nz-1);
++    vobc=v1*var;
++    namF='run/vVel_obc.bin';
+     vobc=[vobc; vobc; vobc];
+     fid=fopen(namF,'w','b'); fwrite(fid,vobc,prec);fclose(fid);
+ 
+@@ -275,18 +179,22 @@
+     for i=1:Nx, for j=1:Ny
+             var(i,j,:)=tref(1,:);
+         end, end
+-    namF='temp_ini.bin';
++    namF='run/temp_ini.bin';
+     fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+ 
+     for i=1:Nx, for j=1:Ny
+             var(i,j,:)=sref(1,:);
+         end, end
+-    namF='salt_ini.bin';
++    namF='run/salt_ini.bin';
+     fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+ 
+-    namF='shelficeMass.Lin.bin';
++    rhoAvr=rho_water-1.345;
++    mIce=-rhoAvr*draft;
++    namF='run/shelficeMass.Lin.bin';
+     fid=fopen(namF,'w','b'); fwrite(fid,mIce,prec);fclose(fid);
++    % }}}
+ 
++    cd run
+     eval(['!mpirun -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+     cd ..
+ end
+@@ -296,39 +204,39 @@
+ % {{{ CreateMesh:
+ if perform(org,'CreateMesh'),
+ 
+-	%create model:
+-	md=model();
++    loaddata(org,'Parameters');
+ 
+-	%Grab lat,long from MITgcm:
+-	long=readbin('run/XG.data',[Nx Ny]);
+-	long=[long long(:,end)]; long=[long; -105.1250*ones(1,size(long,2))];
+-	lat=readbin('run/YG.data',[Nx Ny]);
+-	lat=[lat -73.8832*ones(size(lat,1),1)]; lat=[lat; lat(end,:)];
++    %create model:
++    md=model();
+ 
+-	%project lat,long:
+-	[x,y]=ll2xy(lat(:),long(:),-1);
++    %Grab lat,long from MITgcm:
++    long=readbin('run/XG.data',[Nx Ny]);
++    long=[long long(:,end)]; long=[long; 2*long(Nx,:)-long(Nx-1,:)];
++    lat=readbin('run/YG.data',[Nx Ny]);
++    lat=[lat 2*lat(:,Ny)-lat(:,Ny-1)]; lat=[lat; lat(end,:)];
+ 
+-	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
++    %project lat,long:
++    [x,y]=ll2xy(lat(:),long(:),-1);
++    index=[];
++    %  C  D
++    %  A  B
++    for j=1:Ny,
++        for i=1:Nx,
++            A=(j-1)*(Nx+1)+i;
++            B=(j-1)*(Nx+1)+i+1;
++            C=j*(Nx+1)+i;
++            D=j*(Nx+1)+i+1;
++            index(end+1,:)=[A B C];
++            index(end+1,:)=[C B D];
++        end
++    end
+ 
+-	%fill mesh and model:
+-	md=meshconvert(md,index,x,y);
+-	md.mesh.lat=lat(:);
+-	md.mesh.long=long(:);
++    %fill mesh and model:
++    md=meshconvert(md,index,x,y);
++    md.mesh.lat=lat(:);
++    md.mesh.long=long(:);
+ 
+-	savemodel(org,md);
++    savemodel(org,md);
+ 
+ end
+ % }}}
+@@ -335,36 +243,37 @@
+ % {{{ MeshGeometry:
+ if perform(org,'MeshGeometry'),
+ 
+-	loaddata(org,'CreateMesh');
++    loaddata(org,'Parameters');
++    loaddata(org,'CreateMesh');
++    loaddata(org,'Bathymetry');
++    loaddata(org,'IceSheetGeometry');
+ 
+-	%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,:)];
++    %transfer to vertices:
++    bathymetry=[bathymetry bathymetry(:,end)]; bathymetry=[bathymetry(1,:); bathymetry];
++    ice_mask=[ice_mask ice_mask(:,end)]; ice_mask=[ice_mask(1,:); ice_mask];
++    iceshelf_mask=[iceshelf_mask iceshelf_mask(:,end)]; iceshelf_mask=[iceshelf_mask(1,:); iceshelf_mask];
++    thickness=[thickness thickness(:,end)]; thickness=[thickness; thickness(end,:)];
+ 
+-	%start filling some of the fields
+-	md.geometry.bed=bathymetry(:);
+-	md.geometry.thickness=thickness(:);
+-	md.geometry.base=-917/1028*md.geometry.thickness;
+-	md.geometry.surface=md.geometry.base+md.geometry.thickness;
++    %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);
++    %nothing passes icefront:
++    pos=find((~ice_mask(:) & ice_mask(:)~=0) | thickness(:)==0);
++    md.geometry.thickness(pos)=1;
++    md.geometry.surface(pos)=(1-di)*md.geometry.thickness(pos);
++    md.geometry.base(pos)=-di*md.geometry.thickness(pos);
+ 
+-	%level sets:
+-	md.mask.ocean_levelset=iceshelf_mask(:);
+-	md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
++    %level sets:
++    md.mask.ocean_levelset=iceshelf_mask(:);
++    md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+ 
+-	pos=find(~ice_mask(:) & thickness(:)==0); md.mask.ice_levelset(pos)=1;
++    pos=find(~ice_mask(:) & thickness(:)==0); md.mask.ice_levelset(pos)=1;
+ 
+-	savemodel(org,md);
++    savemodel(org,md);
++
+ end
+ % }}}
+ % {{{ ParameterizeIce:
+@@ -462,341 +371,121 @@
+ % {{{ RunCoupledMITgcmISSM:
+ if perform(org,'RunCoupledMITgcmISSM'),
+ 
+-	loaddata(org,'Parameters');
+-	loaddata(org,'ParameterizeIce');
++    loaddata(org,'Parameters');
++    loaddata(org,'Bathymetry');
++    loaddata(org,'IceSheetGeometry');
++    loaddata(org,'ParameterizeIce');
++    md=loadmodel(org,'RunUncoupledISSM');
+ 
+-	md=loadmodel(org,'RunUncoupledISSM');
++    % {{{ prepare ISSM: start from the steady-state
+ 
+-		endtime = round(MITgcmDeltaT * floor(final_time*y2s/MITgcmDeltaT));
+-		outputtime = round(MITgcmDeltaT * floor(time_step*y2s/MITgcmDeltaT));
++    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 ISSM: start from the steady-state
++    % }}}
++    % {{{ prepare MITgcm
++    % rename previous run directory and create new one
++    if exist ('run.old')
++        !\rm -rf run.old
++    end
++    if exist ('run')
++        !\mv run run.old
++    end
++    !\mkdir run
++    !\cp ../MITgcm/build/mitgcmuv run
++    !\cp ../MITgcm/input_4003/* run
++    !\cp ../MITgcm/input_4003/eedata_uncoupled run/eedata
++    
++    % {{{ Construct MITgcm binary input files
++    namF='run/bathy_flat.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,bathymetry,prec);fclose(fid);
++    
++    namF='run/shelficeTopo.Lin.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,draft,prec);fclose(fid);
++    
++    var=([1:Ny]-2)/(jEnd-2);
++    dMdt_fy=zeros(Nx,Ny);
++    for i=1:Nx
++        dMdt_fy(i,:)=-cos(pi*var);
++        dMdt_fy(i,1)=0; dMdt_fy(i,j2:Ny)=0;
++    end    
++    %- rate of change due to ice-stream dynamics
++    rateDyn=rho_water*0.1/3600;  sfx='r02';
++    dMdt=rateDyn*dMdt_fy;
++    namF=sprintf('%s.%s.%s','run/shelfice_dMdt',sfx,'bin');
++    fid=fopen(namF,'w','b'); fwrite(fid,dMdt,prec);fclose(fid);
+ 
+-		  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'};
++    T_sfc = -1.9;
++    T_bot = 2;
++    del_T = (T_bot - T_sfc)/(59*delZ);
++    tref=zeros(1,Nz);
++    for k = 1:Nz;
++        tref(k) = T_sfc + del_T*((k-20)*delZ);
++        tref(k)= max(T_sfc,min(tref(k),T_bot));
++    end
++    namF='run/temp_obc.bin';
++    tref=[tref; tref; tref];
++    fid=fopen(namF,'w','b'); fwrite(fid,tref,prec);fclose(fid);
+ 
+-        % }}}
+-        % {{{ 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/verification/shelfice_remeshing/input/* run
+-        !\cp ../MITgcm/input_4003/* run
+-        % }}}
+-		  md.timestepping.coupling_time=time_step;
+-		  md.timestepping.time_step=time_step;
+-		  md.timestepping.final_time=final_time-time_step;
+-		  md.cluster.npocean=nPx*nPy;
+-		  md.cluster.np=2;
+-		  md.cluster.executionpath=[pwd '/run'];
+-		  md.transient.requested_outputs={'default','MaskOceanLevelset'};
++    S_sfc = 34.2;
++    S_bot = 34.7;
++    del_S = (S_bot - S_sfc)/(59*delZ);
++    sref=zeros(1,Nz);
++    for k = 1:Nz;
++        sref(k) = S_sfc + del_S*((k-20)*delZ);
++        sref(k)= max(S_sfc,min(sref(k),S_bot));
++    end
++    namF='run/salt_obc.bin';
++    sref=[sref; sref; sref];
++    fid=fopen(namF,'w','b'); fwrite(fid,sref,prec);fclose(fid);
+ 
+-		  md=solveiceocean(md,'Transient','runtimename',false);
++    zax=[1:Nz];
++    v1=2.5e-2;
++    var=1+Nz-2*zax; var=var/(Nz-1);
++    vobc=v1*var;
++    namF='run/vVel_obc.bin';
++    vobc=[vobc; vobc; vobc];
++    fid=fopen(namF,'w','b'); fwrite(fid,vobc,prec);fclose(fid);
+ 
+-%	%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'),
++    var=zeros(Nx,Ny,Nz);
++    for i=1:Nx, for j=1:Ny
++            var(i,j,:)=tref(1,:);
++        end, end
++    namF='run/temp_ini.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+ 
+-	%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));
++    for i=1:Nx, for j=1:Ny
++            var(i,j,:)=sref(1,:);
++        end, end
++    namF='run/salt_ini.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,var,prec);fclose(fid);
+ 
+-        % {{{ 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
++    rhoAvr=rho_water-1.345;
++    mIce=-rhoAvr*draft;
++    namF='run/shelficeMass.Lin.bin';
++    fid=fopen(namF,'w','b'); fwrite(fid,mIce,prec);fclose(fid);
++    % }}}
++    % }}}
+ 
+-        % initial salinity
+-        S=iniSalt*ones(Nx,Ny,Nz);
+-        writebin('run/Salt.bin',S);
++    md.timestepping.coupling_time=1/24/365;          % 1 hour in decimal years
++    md.timestepping.time_step=1/24/365;              % 1 hour in decimal years
++    md.timestepping.final_time=23/24/365;            % hour 23 in decimal years
++    md.cluster.npocean=nPx*nPy;
++    md.cluster.np=2;
++    md.cluster.executionpath=[pwd '/run'];
++    md.transient.requested_outputs={'default','MaskOceanLevelset'};
+ 
+-        % initial temperature
+-        T=iniTheta*ones(Nx,Ny,Nz);
+-        writebin('run/Theta.bin',T);
++    md=solveiceocean(md,'Transient','runtimename',false);
+ 
+-        % initial velocity
+-        Z=zeros(Nx,Ny,Nz);
+-        writebin('run/Uvel.bin',Z);
+-        writebin('run/Vvel.bin',Z);
+-
+-        % initial sea surface height
+-        Z=zeros(Nx,Ny);
+-        writebin('run/Etan.bin',Z);
+-
+-        % salinity boundary conditions
+-        S=obcSalt*ones(Ny,Nz);
+-        thk=delZ*ones(Nz,1);
+-        bot=cumsum(thk);
+-        ik=find(bot<=mlDepth);
+-        S(:,ik)=mlSalt;
+-        writebin('run/OBs.bin',S);
+-
+-        % temperature boundary conditions
+-        T=obcTheta*ones(Ny,Nz);
+-        T(:,ik)=mlTheta;
+-        writebin('run/OBt.bin',T);
+-
+-        % zonal velocity boundary conditions
+-        U=obcUvel*ones(Ny,Nz);
+-        writebin('run/OBu.bin',U);
+-
+-        % zero boundary conditions
+-        Z=zeros(Ny,Nz);
+-        writebin('run/zeros.bin',Z);
+-
+-        % build parameter file data.obcs
+-        fidi=fopen('../MITgcm/input/data.obcs','r');
+-        fido=fopen('run/data.obcs','w');
+-        tline = fgetl(fidi);
+-        fprintf(fido,'%s\n',tline);
+-        while 1
+-            tline = fgetl(fidi);
+-            if ~ischar(tline), break, end
+-            %do the change here:
+-            if strcmpi(tline,' OB_Iwest = 40*1,'),
+-                fprintf(fido,'%s%i%s\n',' OB_Iwest = ',Ny,'*1,');
+-                continue;
+-            end
+-            if strcmpi(tline,' OB_Ieast = 40*-1,'),
+-                fprintf(fido,'%s%i%s\n',' OB_Ieast = ',Ny,'*-1,');
+-                continue;
+-            end
+-            fprintf(fido,'%s\n',tline);
+-        end
+-        %close  files
+-        fclose(fidi);
+-        fclose(fido);
+-
+-        %save bathymetry in MITgcm run directory
+-        writebin('run/bathymetry.bin',bathymetry);
+-        % }}}
+-
+-	% {{{ ISSM settings:
+-
+-	setenv('DYLD_LIBRARY_PATH', '/usr/local/gfortran/lib')
+-	%timestepping:
+-	md.timestepping.start_time=start_time;
+-	md.timestepping.final_time=final_time;
+-	md.timestepping.time_step=time_step;
+-	md.cluster=generic('name',oshostname(),'np',2);
+-	md.results.TransientSolution.Base=md.geometry.base;
+-	md.transient.isgroundingline=1;
+-	md.transient.isthermal=0;
+-	md.groundingline.migration='SubelementMigration';
+-	md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating';
+-	md.groundingline.friction_interpolation='SubelementFriction2';
+-
+-	% }}}
+-
+-	%start looping:
+-	results=md.results;
+-
+-	for t=start_time:time_step:final_time
+-            disp(['Year: ' num2str(t)])
+-
+-	    %send draft from ISSM to MITgcm:
+-	    draft=md.results.TransientSolution(end).Base;
+-	    pos=find(md.mask.ice_levelset>0); draft(pos)=0;
+-            if t>start_time
+-                old_draft=readbin('run/icetopo.bin',[Nx,Ny]);
+-            end
+-            writebin('run/icetopo.bin',draft);
+-
+-	    % {{{ generate MITgcm parameter file data
+-	    fidi=fopen('../MITgcm/input/data','r');
+-	    fido=fopen('run/data','w');
+-	    tline = fgetl(fidi);
+-	    fprintf(fido,'%s\n',tline);
+-            while 1
+-                tline = fgetl(fidi);
+-                if ~ischar(tline), break, end
+-		%do the change here:
+-		if strcmpi(tline,' xgOrigin = 0.0,'),
+-		    fprintf(fido,'%s%i%s\n',' xgOrigin = ',xgOrigin,',');
+-		    continue;
+-		end
+-		if strcmpi(tline,' ygOrigin = -80.0,'),
+-		    fprintf(fido,'%s%i%s\n',' ygOrigin = ',ygOrigin,',');
+-		    continue;
+-		end
+-		if strcmpi(tline,' delX = 20*0.25,'),
+-		    fprintf(fido,'%s%i*%g%s\n',' delX = ',Nx,dLong,',');
+-		    continue;
+-		end
+-		if strcmpi(tline,' delY = 20*0.25,'),
+-		    fprintf(fido,'%s%i*%g%s\n',' delY = ',Ny,dLat,',');
+-		    continue;
+-		end
+-                if strcmpi(tline,' delZ = 30*30.0,'),
+-                    fprintf(fido,'%s%i*%g%s\n',' delZ = ',Nz,delZ,',');
+-                    continue;
+-                end
+-		if strcmpi(tline,' endTime=2592000.,'),
+-		    fprintf(fido,'%s%i%s\n',' endTime= ',endtime,',');
+-		    continue;
+-		end
+-		if strcmpi(tline,' deltaT=1200.0,'),
+-		    fprintf(fido,'%s%i%s\n',' deltaT= ',MITgcmDeltaT,',');
+-		    continue;
+-		end
+-		if strcmpi(tline,' pChkptFreq=2592000.,'),
+-		    fprintf(fido,'%s%i%s\n',' pChkptFreq= ',endtime,',');
+-		    continue;
+-		end
+-		if strcmpi(tline,' taveFreq=2592000.,'),
+-		    fprintf(fido,'%s%i%s\n',' taveFreq= ',endtime,',');
+-		    continue;
+-		end
+-                if strcmpi(tline,' rhoConst=1030.,'),
+-                    fprintf(fido,'%s%i%s\n',' rhoConst= ',rho_water,',');
+-                    continue;
+-                end
+-                if strcmpi(tline,' rhoNil=1030.,'),
+-                    fprintf(fido,'%s%i%s\n',' rhoNil= ',rho_water,',');
+-                    continue;
+-                end
+-		fprintf(fido,'%s\n',tline);
+-	    end
+-	    %close  files
+-	    fclose(fidi);
+-	    fclose(fido);
+-	    % }}}
+-
+-	    % {{{ generate initial MITgcm conditions
+-            ds=round(endtime/MITgcmDeltaT);
+-            if t>start_time
+-                % Read pickup file
+-                fnm=['run/pickup.' myint2str(ds,10) '.data'];
+-                U=readbin(fnm,[Nx Ny Nz],1,'real*8',0);
+-                V=readbin(fnm,[Nx Ny Nz],1,'real*8',1);
+-                T=readbin(fnm,[Nx Ny Nz],1,'real*8',2);
+-                S=readbin(fnm,[Nx Ny Nz],1,'real*8',3);
+-                E=readbin(fnm,[Nx Ny],1,'real*8',8*Nz);
+-
+-                % find indices of locations where ice shelf retreated
+-                h=readbin('run/hFacC.data',[Nx Ny Nz]);
+-                msk=sum(h,3);
+-                msk(find(msk))=1;
+-                [iw jw]=find(msk); % horizontal indices where there is water
+-                tmp=reshape(draft,[Nx,Ny])-old_draft;
+-                tmp(find(tmp<0))=0;
+-                [im jm]=find(tmp); % horizontal indices where there is melt
+-
+-                % Extrapolate T/S to locations where ice shelf retreated
+-                for i=1:length(im)
+-
+-                    % first try vertical extrapolation
+-                    in=find(h(im(i),jm(i),:));
+-                    if length(in)>0;
+-                        S(im(i),jm(i),1:min(in)  ) = S(im(i),jm(i),min(in));
+-                        T(im(i),jm(i),1:min(in)  ) = T(im(i),jm(i),min(in));
+-                        continue
+-                    end
+-
+-                    % if not succesful, use closest neighbor horizontal extrapolation
+-                    [y c]=min((iw-im(i)).^2+(jw-jm(i)).^2);
+-                    salt=squeeze(S(iw(c),jw(c),:)); % salinity profile of closest neighbor
+-                    temp=squeeze(T(iw(c),jw(c),:)); % salinity profile of closest neighbor
+-                    in=find(h(iw(c),jw(c),:));
+-                    salt(1:min(in))=salt(min(in));
+-                    temp(1:min(in))=temp(min(in));
+-                    salt(max(in):end)=salt(max(in));
+-                    temp(max(in):end)=temp(max(in));
+-                    S(im(i),jm(i),:)=salt;
+-                    T(im(i),jm(i),:)=temp;
+-                end
+-
+-                % Write initial conditions
+-                writebin('run/Salt.bin' ,S);
+-                writebin('run/Theta.bin',T);
+-                writebin('run/Uvel.bin' ,U);
+-                writebin('run/Vvel.bin' ,V);
+-                writebin('run/Etan.bin' ,E);
+-            end
+-            % }}}
+-
+-            % {{{ system call to run MITgcm
+-            cd run
+-            eval(['!mpiexec -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+-            ts=round((t+time_step)*y2s/MITgcmDeltaT);
+-            eval(['!\mv STDERR.0000 STDERR_' myint2str(ts,10) '.data'])
+-            eval(['!\mv STDOUT.0000 STDOUT_' myint2str(ts,10) '.data'])
+-            eval(['!\cp hFacC.data hFacC_' myint2str(ts,10) '.data'])
+-            eval(['!\cp icetopo.bin icetopo_' myint2str(ts,10) '.data'])
+-            for fld={'S','T','U','V','Eta', ...
+-                     'SHICE_heatFluxtave','SHICE_fwFluxtave'}
+-                eval(['!\mv ' fld{1} '.' myint2str(ds,10) '.data ' ...
+-                      fld{1} '_' myint2str(ts,10) '.data'])
+-            end
+-            cd ..
+-            % }}}
+-
+-	    %get melting rates from MITgcm
+-	    %upward fresh water flux (kg/m^2/s):
+-	    fnm=['run/SHICE_fwFluxtave_' myint2str(ts,10) '.data'];
+-	    melting_rate=readbin(fnm,[Nx Ny]);
+-
+-	    %send averaged melting rate to ISSM
+-	    %downward fresh water flux (m/y):
+-	    melting_rate=-melting_rate(:)*y2s/rho_ice;
+-		 md.basalforcings.floatingice_melting_rate=melting_rate;
+-
+-	    % {{{ run ISSM and recover results
+-
+-	    md.timestepping.start_time=t;
+-	    md.timestepping.final_time=t+time_step;;
+-		md=solve(md,'Transient');
+-
+-		base=md.results.TransientSolution(end).Base;
+-		thickness=md.results.TransientSolution(end).Thickness;
+-		md.geometry.base=base;
+-		md.geometry.thickness=thickness;
+-		md.geometry.surface=md.geometry.base+md.geometry.thickness;
+-		md.initialization.vx=md.results.TransientSolution(end).Vx;
+-		md.initialization.vy=md.results.TransientSolution(end).Vy;
+-		md.initialization.vel=md.results.TransientSolution(end).Vel;
+-		md.initialization.pressure=md.results.TransientSolution(end).Pressure;
+-		md.mask.ocean_levelset=md.results.TransientSolution(end).MaskOceanLevelset;
+-		md.results.TransientSolution(end).FloatingiceMeltingRate=md.basalforcings.floatingice_melting_rate;
+-
+-		%save these results in the model, otherwise, they'll be wiped out
+-		results(end+1)=md.results;
+-
+-		% }}}
+-
+-
+-	end
+-
+-	md.results=results;
+-	savemodel(org,md);
++%eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' ']);
++%eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' : -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+ end
+ % }}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26719-26720.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26719-26720.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26719-26720.diff	(revision 26740)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26719)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26720)
+@@ -402,7 +402,6 @@
+     !\mkdir run
+     !\cp ../MITgcm/build/mitgcmuv run
+     !\cp ../MITgcm/input_4003/* run
+-    !\cp ../MITgcm/input_4003/eedata_uncoupled run/eedata
+     
+     % {{{ Construct MITgcm binary input files
+     namF='run/bathy_flat.bin';
Index: /issm/oecreview/Archive/25834-26739/ISSM-26720-26721.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26720-26721.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26720-26721.diff	(revision 26740)
@@ -0,0 +1,54 @@
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26720)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26721)
+@@ -3,11 +3,12 @@
+ %
+ %Script control parameters
+ steps=1:11;
++steps=[1:3 6:11];
+ 
+ %To download and recompile MITgcm from scratch:
+-!rm -rf ${ISSM_DIR}/test/MITgcm/install
+-!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
+-!rm -rf Models
++%!rm -rf ${ISSM_DIR}/test/MITgcm/install
++%!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
++%!rm -rf Models
+ 
+ %Organizer
+ !mkdir Models
+@@ -60,7 +61,7 @@
+     
+     %create bathymetry:
+     bathymetry = ones(Nx,Ny)*H;
+-    bathymetry(:,1) = 0;
++    bathymetry(:,end) = 0;
+ 
+     %save bathymetry file for MITgcm
+     savedata(org,lat,lon,bathymetry);
+@@ -79,17 +80,21 @@
+     draft=bathymetry;
+     for i=1:Nx
+         draft(i,:)=Hmin+dHdy*[-1:Ny-2]*dLat;
+-        draft(i,1)=0; draft(i,j2:Ny)=0;
+     end
+ 
+     ice_mask=ones(Nx,Ny);
+     ice_mask(:,j2:Ny)=0;
+     iceshelf_mask=ice_mask;
+-    iceshelf_mask(:,1)=0;
+     thickness=abs(draft)/di;
+-    thickness(:,1)=thickness(:,2)+draft(:,2);
+     
+     savedata(org,ice_mask,iceshelf_mask,draft,thickness);
++    
++    close all, figure(2), clf
++    subplot(411), pcolorcen(bathymetry); colorbar, title('bathymetry')
++    subplot(412), pcolorcen(ice_mask); colorbar, title('ice and iceshelf mask')
++    subplot(413), pcolorcen(draft); colorbar, title('draft')
++    subplot(414), pcolorcen(thickness); colorbar, title('thickness')
++    
+ end
+ % }}}
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26721-26722.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26721-26722.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26721-26722.diff	(revision 26740)
@@ -0,0 +1,54 @@
+Index: ../trunk-jpl/test/MITgcm/tools/pcolorcen.m
+===================================================================
+--- ../trunk-jpl/test/MITgcm/tools/pcolorcen.m	(nonexistent)
++++ ../trunk-jpl/test/MITgcm/tools/pcolorcen.m	(revision 26722)
+@@ -0,0 +1,48 @@
++function h=pcolorcen(x,y,z)
++
++% h = pcolorcen(x,y,z);
++% h = pcolorcen(z);
++%
++% like pcolor.m, except it fixes the problem wherein the last row and column of z
++% don't get displayed and values are plotted above and to the right of the corresponding
++% values in x and y. "cen" is for centered.
++%
++% in other words: use pcolor when you're specifying the corners of your grid cells, and
++% pcolorcen when you're specifying the centers.
++%
++% x and y can be vectors; pcolorcen will call meshgrid to save you the trouble.
++%
++% sets shading flat for good measure.
++%
++% neil banas jul 2002
++% (neil@ocean.washington.edu)
++
++if nargin==1
++	z = x;
++	x = 1:size(z,2);
++	y = 1:size(z,1);
++end
++if ~isempty(find(size(x)==1))
++	[x,y] = meshgrid(x,y);
++end
++
++% add a border to the x values
++xnew = [   x(:,1)-(x(:,2)-x(:,1))            x      x(:,end)+(x(:,end)-x(:,end-1))      ];
++xnew = [xnew(1,:)-(xnew(2,:)-xnew(1,:));  xnew;  xnew(end,:)+(xnew(end,:)-xnew(end-1,:))];
++% interpolate to add the grid centers
++xnew = interp2(xnew,1);
++% keep only the grid centers
++xnew = xnew(2:2:end,2:2:end);
++
++% repeat for y
++ynew = [   y(:,1)-(y(:,2)-y(:,1))            y      y(:,end)+(y(:,end)-y(:,end-1))      ];
++ynew = [ynew(1,:)-(ynew(2,:)-ynew(1,:));  ynew;  ynew(end,:)+(ynew(end,:)-ynew(end-1,:))];
++ynew = interp2(ynew,1);
++ynew = ynew(2:2:end,2:2:end);
++
++% add a border of nans to z
++znew = [[z nan.*ones(size(z,1),1)]; nan.*ones(1,size(z,2)+1)];
++
++% now pcolor
++h = pcolor(xnew,ynew,znew);
++shading flat;
+\ No newline at end of file
Index: /issm/oecreview/Archive/25834-26739/ISSM-26722-26723.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26722-26723.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26722-26723.diff	(revision 26740)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26722)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26723)
+@@ -6,11 +6,15 @@
+ module ISSM
+ 
+ include("md/classes.jl")
++export model
+ include("md/exp.jl")
+ include("md/utils.jl")
++export archread
+ include("md/triangle.jl")
++export triangle
+ include("md/parameterization.jl")
++export setmask, InterpFromMeshToMesh2d
+ include("solve/solve.jl")
+-#include("md/plotmodel.jl")
++export solve
+ 
+ end
Index: /issm/oecreview/Archive/25834-26739/ISSM-26723-26724.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26723-26724.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26723-26724.diff	(revision 26740)
@@ -0,0 +1,59 @@
+Index: ../trunk-jpl/src/jl/test.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test.jl	(revision 26723)
++++ ../trunk-jpl/src/jl/test.jl	(revision 26724)
+@@ -8,7 +8,7 @@
+ file = matopen("/Users/mmorligh/Desktop/issmuci/trunk-jpl/examples/Pig2/Pig.mat")
+ mat = read(file, "md")
+ close(file)
+-md=ISSM.model(mat)
++md=model(mat)
+ 
+ #Solve stress balance
+ md=ISSM.solve(md,"Stressbalance")
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26723)
++++ ../trunk-jpl/src/jl/test101.jl	(revision 26724)
+@@ -2,11 +2,11 @@
+ include("issm.jl")
+ using .ISSM
+ 
+-md = ISSM.model()
+-md = ISSM.triangle(md,"../../test/Exp/Square.exp",50000.)
++md = model()
++md = triangle(md,"../../test/Exp/Square.exp",50000.)
+ #md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.)
+ #md = ISSM.triangle(md,"../../test/Exp/Square.exp",1000.)
+-md = ISSM.setmask(md,"all","")
++md = setmask(md,"all","")
+ 
+ #Geometry
+ hmin=300.
+@@ -21,13 +21,13 @@
+ md.geometry.bed       = md.geometry.base .-10
+ 
+ #Initial velocity
+-x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+-y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+-vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+-vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+-index = Int.(ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
+-md.initialization.vx=ISSM.InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y,NaN)
+-md.initialization.vy=ISSM.InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y,NaN)
++x     = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++y     = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++vx    = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++vy    = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++index = Int.(archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
++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.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+@@ -44,4 +44,4 @@
+ md.stressbalance.spcvx[pos] .= 0.0
+ md.stressbalance.spcvy[pos] .= 0.0
+ 
+-md=ISSM.solve(md,"Stressbalance")
++md=solve(md,"Stressbalance")
Index: /issm/oecreview/Archive/25834-26739/ISSM-26724-26725.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26724-26725.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26724-26725.diff	(revision 26740)
@@ -0,0 +1,9871 @@
+Index: ../trunk-jpl/src/jl/test501.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test501.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/test501.jl	(nonexistent)
+@@ -1,50 +0,0 @@
+-#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+-include("issm.jl")
+-using .ISSM
+-
+-md = ISSM.model()
+-md = ISSM.triangle(md,"../../test/Exp/Pig.exp",10000.)
+-md = ISSM.setmask(md,"../../test/Exp/PigShelves.exp","../../test/Exp/PigIslands.exp")
+-
+-#Initial velocity and geometry
+-x         = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","x")
+-y         = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","y")
+-vx_obs    = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","vx_obs")
+-vy_obs    = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","vy_obs")
+-index     = Int.(ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","index"))
+-surface   = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","surface")
+-thickness = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","thickness")
+-bed       = ISSM.archread(ISSM.issmdir()*"/test/Data/Pig.arch","bed")
+-md.initialization.vx=ISSM.InterpFromMeshToMesh2d(index, x, y, vx_obs, md.mesh.x, md.mesh.y, 0.0)
+-md.initialization.vy=ISSM.InterpFromMeshToMesh2d(index, x, y, vy_obs, md.mesh.x, md.mesh.y, 0.0)
+-md.geometry.surface = ISSM.InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y, 0.0)
+-md.geometry.thickness = ISSM.InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y, 0.0)
+-md.geometry.base=md.geometry.surface .- md.geometry.thickness
+-md.geometry.bed =md.geometry.base
+-pos = findall(md.mask.ocean_levelset.<0)
+-md.geometry.bed[pos] = ISSM.InterpFromMeshToMesh2d(index, x, y, bed, md.mesh.x[pos], md.mesh.y[pos])
+-
+-md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+-md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+-md.friction.coefficient=50*ones(md.mesh.numberofvertices)
+-
+-md.stressbalance.restol=0.05
+-md.stressbalance.reltol=1.0
+-md.stressbalance.abstol=NaN
+-
+-#Boundary conditions
+-pos = findall(vec(sum(Int64.(md.mask.ocean_levelset[md.mesh.elements].<0), dims=2)) .> 0.0)
+-vertexonfloatingice=zeros(md.mesh.numberofvertices)
+-vertexonfloatingice[md.mesh.elements[pos,:]] .= 1
+-nodefront=(md.mesh.vertexonboundary .& (vertexonfloatingice.>0))
+-md.mask.ice_levelset[findall(nodefront)] .= 0
+-
+-md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+-md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+-segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
+-segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
+-pos=md.mesh.segments[segments,1:2]
+-md.stressbalance.spcvx[pos] .= 0.0
+-md.stressbalance.spcvy[pos] .= 0.0
+-
+-md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test501.jl
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/md/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/exp.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/md/exp.jl	(nonexistent)
+@@ -1,234 +0,0 @@
+-#for exptool, look into this http://juliaplots.org/MakieReferenceImages/gallery//mouse_picking/index.html
+-
+-#exp object definition, constructor, and disp
+-mutable struct ExpStruct #{{{
+-	name::String
+-	nods::Int32
+-	density::Float64
+-	x::Vector{Float64}
+-   y::Vector{Float64}
+-	closed::Bool
+-end  #}}}
+-function ExpStruct() #{{{
+-	return ExpStruct("",0, 0., Vector{Float64}(undef,0), Vector{Float64}(undef,0), false)
+-end# }}}
+-function Base.show(io::IO, exp::ExpStruct)# {{{
+-
+-	compact = get(io, :compact, false)
+-
+-	println(io,"ExpStruct:")
+-	for name in fieldnames(typeof(exp))
+-		a=getfield(exp,name)
+-		print(io,"   $(name) = ")
+-		if !isempty(a)
+-			if compact && eltype(a)<:Number && length(a)>3
+-				println(io, typeof(a), " of size ", size(a))
+-			else
+-				println(io,a)
+-			end
+-		else
+-			println(io,"empty")
+-		end
+-	end
+-end# }}}
+-
+-#methods
+-#expread {{{
+-"""
+-	EXPREAD - read a file exp and build a Structure
+-
+-	This function reads an *.exp* and builds a structure containing the fields x
+-	and y corresponding to the coordinates, one for the filename of the exp
+-	file, for the density, for the nodes, and a field 'closed' to indicate if the
+-	domain is closed.
+-
+-	Usage:
+-		exp=expread(filename)
+-
+-# Examples:
+-```julia-repl
+-julia> exp=expread('domainoutline.exp')
+-```
+-
+-# Arguments:
+-- filename: the ARGUS file to read
+-"""
+-function expread(filename::String)
+-
+-	#initialize output
+-	contours = Vector{ExpStruct}(undef, 0)
+-
+-	#open file
+-	f = open(filename, "r") do f
+-
+-		#initialize some variables
+-		nprof = 0
+-		line = 1
+-
+-		while !eof(f)
+-
+-			#read first line
+-			A = readline(f); line += 1
+-
+-			#if isempty, go to the next line and try again
+-			if isempty(A)
+-				continue
+-			else
+-				#initialize new profile
+-				nprof += 1 
+-				exp = ExpStruct();
+-			end
+-
+-			#extract profile name
+-			if A[1:8]!="## Name:"
+-				println("line $(line): $(A)")
+-				error("Unexpected exp file formatting") 
+-			end
+-			if length(A)>8
+-				exp.name = A[9:end]
+-			end
+-
+-			#read Icon
+-			A = readline(f); line += 1
+-			if A[1:8]!="## Icon:" error("Unexpected exp file formatting") end
+-
+-			#read Info
+-			A = readline(f); line += 1
+-			if A[1:14]!="# Points Count"
+-				println("line $(line): $(A)")
+-				error("Unexpected exp file formatting") 
+-			end
+-
+-			#Reads number of nods and density
+-			A = readline(f); line += 1
+-			A = parse.(Float64, split(A))
+-			if length(A) != 2 error("Unexpected exp file formatting") end
+-			exp.nods = A[1]; exp.density = A[2]
+-
+-			#Allocate arrays
+-			if exp.nods<=0 error("Unexpected exp file formatting") end
+-			exp.x = Vector{Float64}(undef,exp.nods)
+-			exp.y = Vector{Float64}(undef,exp.nods)
+-
+-			#Read coordinates
+-			A = readline(f); line += 1
+-			if A[1:13]!="# X pos Y pos" error("Unexpected exp file formatting") end
+-			for i in 1:exp.nods
+-				A = readline(f); line += 1
+-				A = parse.(Float64, split(A))
+-				if length(A) != 2 error("Unexpected exp file formatting") end
+-				if any(isnan.(A)) error("NaNs found in coordinate") end
+-				exp.x[i] = A[1]; exp.y[i] = A[2]
+-			end
+-
+-			#check if closed
+-			if exp.nods>1 && exp.x[1]==exp.x[end] && exp.y[1]==exp.y[end]
+-				exp.closed = true
+-			else
+-				exp.closed = false
+-			end
+-
+-			#add profile to list
+-			push!(contours, exp)
+-		end
+-	end
+-
+-	return contours
+-end# }}}
+-#ContourToNodes{{{
+-"""
+-	ContourToNodes - Flag points that are in contour
+-
+-   More doc to come later....
+-
+-	Usage:
+-		exp=expread(filename)
+-
+-# Examples:
+-```julia-repl
+-julia> exp=expread('domainoutline.exp')
+-```
+-
+-# Arguments:
+-- filename: the ARGUS file to read
+-"""
+-function ContourToNodes(x::Vector{Float64},y::Vector{Float64},filename::String,edgevalue::Float64)
+-
+-	#Read input file
+-	contours = expread(filename)
+-
+-	#Initialize output
+-	nbpts = length(x)
+-	flags = zeros(Bool,nbpts)
+-
+-	#Loop over contours
+-	for c in 1:length(contours)
+-
+-		#Get current contours
+-		contour = contours[c]
+-		xp      = contour.x
+-		yp      = contour.y
+-
+-		#Check that we are within box
+-		xmin = minimum(xp); xmax = maximum(xp)
+-		ymin = minimum(yp); ymax = maximum(yp)
+-
+-		#Loop over all points provided
+-		for ii in 1:nbpts
+-
+-			#If this node is already within one of the contours, do not change it
+-			if(flags[ii]) continue end
+-
+-			#Are we within bounds?
+-			if(x[ii]<xmin || x[ii]>xmax || y[ii]<ymin || y[ii]>ymax) continue end
+-
+-			#we are potentially inside... perform pnpoly test
+-			flags[ii] = pnpoly(xp, yp, x[ii], y[ii], edgevalue)
+-		end
+-	end
+-	
+-	return flags
+-end# }}}
+-
+-function pnpoly(xp::Vector{Float64},yp::Vector{Float64},x::Float64,y::Float64,edgevalue::Float64) #{{{
+-
+-	npol = length(xp)
+-
+-	#Do we need to test for colinearity?
+-	if(edgevalue!=2)
+-		i = 1
+-		j = npol
+-		while(i<=npol)
+-
+-			n1 = (yp[i]-yp[j])^2 + (xp[i]-xp[j])^2
+-			n2 = (y-yp[j])^2 + (x-xp[j])^2
+-
+-			normp=sqrt(n1*n2)
+-			scalar=(yp[i]-yp[j])*(y-yp[j])+(xp[i]-xp[j])*(x-xp[j])
+-
+-			if (scalar == normp)
+-				if (n2<=n1)
+-					return edgevalue
+-				end
+-			end
+-
+-			j =  i
+-			i += 1
+-		end
+-	end
+-
+-	#second test : point is neither on a vertex, nor on a side, where is it ?
+-	i = 1
+-	j = npol
+-	c = false
+-	while(i<=npol)
+-		if (((yp[i]<=y && y<yp[j]) || (yp[j]<=y && y<yp[i])) &&
+-            (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
+-         c = !c
+-		end
+-
+-		j =  i
+-		i += 1
+-	end
+-	return c
+-end# }}}
+Index: ../trunk-jpl/src/jl/md/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/classes.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/md/classes.jl	(nonexistent)
+@@ -1,201 +0,0 @@
+-using Printf
+-
+-abstract type AbstractMesh end
+-mutable struct Mesh2dTriangle <: AbstractMesh
+-	numberofvertices::Int64
+-	numberofelements::Int64
+-	x::Vector{Float64}
+-	y::Vector{Float64}
+-	elements::Matrix{Int64}
+-	segments::Matrix{Int64}
+-	vertexonboundary::Vector{Bool}
+-end
+-function Mesh2dTriangle() #{{{
+-	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+-end# }}}
+-function Base.show(io::IO, this::Mesh2dTriangle)# {{{
+-	IssmStructDisp(io, this)
+-end# }}}
+-mutable struct Mesh3dPrism{T} <: AbstractMesh
+-	numberofvertices::Int64
+-	numberofelements::Int64
+-	numberoflayers::Int64
+-	x::Vector{Float64}
+-	y::Vector{Float64}
+-	z::Vector{Float64}
+-	elements::Matrix{Int64}
+-	segments::Matrix{Int64}
+-	vertexonboundary::Vector{Bool}
+-end
+-function Mesh3dPrism() #{{{
+-	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+-end# }}}
+-
+-mutable struct Geometry
+-	surface::Vector{Float64}
+-	base::Vector{Float64}
+-	thickness::Vector{Float64}
+-	bed::Vector{Float64}
+-end
+-function Geometry() #{{{
+-	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-
+-mutable struct Mask
+-	ocean_levelset::Vector{Float64}
+-	ice_levelset::Vector{Float64}
+-end
+-function Mask() #{{{
+-	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-function Base.show(io::IO, this::Mask)# {{{
+-	IssmStructDisp(io, this)
+-end# }}}
+-
+-mutable struct Initialization
+-	vx::Vector{Float64}
+-	vy::Vector{Float64}
+-end
+-function Initialization() #{{{
+-	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+-end# }}}
+-
+-mutable struct Stressbalance
+-	spcvx::Vector{Float64}
+-	spcvy::Vector{Float64}
+-	restol::Float64
+-	reltol::Float64
+-	abstol::Float64
+-	maxiter::Int64
+-end
+-function Stressbalance() #{{{
+-	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 1.e-4, 0.01, 10., 100)
+-end# }}}
+-function Base.show(io::IO, this::Stressbalance)# {{{
+-	IssmStructDisp(io, this)
+-end# }}}
+-
+-mutable struct Constants
+-	g::Float64
+-	yts::Float64
+-end
+-function Constants() #{{{
+-	return Constants( 9.81,  365*24*3600.)
+-end# }}}
+-
+-mutable struct Materials
+-	rho_ice::Float64
+-	rho_water::Float64
+-	rho_freshwater::Float64
+-	mu_water::Float64
+-	heatcapacity::Float64
+-	latentheat::Float64
+-	thermalconductivity::Float64
+-	temperateiceconductivity::Float64
+-	effectiveconductivity_averaging::Int64
+-	meltingpoint::Float64
+-	beta::Float64
+-	mixed_layer_capacity::Float64
+-	thermal_exchange_velocity::Float64
+-	rheology_B::Vector{Float64}
+-	rheology_n::Vector{Float64}
+-	rheology_law::String
+-end
+-function Materials() #{{{
+-	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
+-end# }}}
+-
+-abstract type AbstractFriction end
+-mutable struct BuddFriction <: AbstractFriction
+-	coefficient::Vector{Float64}
+-end
+-function BuddFriction() #{{{
+-	return BuddFriction(Vector{Float64}(undef,0))
+-end# }}}
+-function Base.show(io::IO, this::BuddFriction)# {{{
+-	IssmStructDisp(io, this)
+-end# }}}
+-mutable struct WeertmanFriction <: AbstractFriction
+-	C::Vector{Float64}
+-	m::Vector{Float64}
+-end
+-
+-mutable struct model
+-	mesh::AbstractMesh
+-	geometry::Geometry
+-	mask::Mask
+-	materials::Materials
+-	initialization::Initialization
+-	stressbalance::Stressbalance
+-	constants::Constants
+-	results
+-	friction::AbstractFriction
+-end
+-function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants(), [], BuddFriction())
+-end#}}}
+-function model(matmd::Dict) #{{{
+-
+-	#initialize output
+-	md = model()
+-
+-	#Loop over all possible fields
+-	for name1 in keys(matmd)
+-		if !(Symbol(name1) in fieldnames(model))
+-			println("could not recover md.",name1)
+-			continue
+-		end
+-		mdfield  = getfield(md,Symbol(name1))
+-		matfield = matmd[name1]
+-		for name2 in keys(matfield)
+-			if !(Symbol(name2) in fieldnames(typeof(mdfield)))
+-				println("could not recover md.",name1,".",name2)
+-				continue
+-			end
+-			value_matlab = matfield[name2]
+-			value_julia  = getfield(mdfield, Symbol(name2))
+-
+-			if typeof(value_matlab)==typeof(value_julia)
+-				setfield!(mdfield, Symbol(name2), value_matlab)
+-
+-			elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Int64
+-				setfield!(mdfield, Symbol(name2), Int64(value_matlab))
+-
+-			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Float64}
+-				if(size(value_matlab,2)!=1) error("only one column expected") end
+-				setfield!(mdfield, Symbol(name2), value_matlab[:,1])
+-
+-			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Matrix{Int64}
+-				matrix = Matrix{Int64}(undef,size(value_matlab))
+-				for i in 1:length(value_matlab) matrix[i] = Int64(value_matlab[i]) end
+-				setfield!(mdfield, Symbol(name2), matrix)
+-
+-			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Bool}
+-				if(size(value_matlab,2)!=1) error("only one column expected") end
+-				vector = Vector{Bool}(undef,size(value_matlab,1))
+-				for i in 1:length(vector) vector[i] = Bool(value_matlab[i]) end
+-				setfield!(mdfield, Symbol(name2), vector)
+-
+-			else
+-				error("Don't know how to convert ",typeof(value_matlab)," to ",typeof(value_julia))
+-			end
+-		end
+-	end
+-
+-	return md
+-end#}}}
+-function Base.show(io::IO, md::model)# {{{
+-
+-	compact = get(io, :compact, false)
+-
+-	println(io,"Model:")
+-	@printf "%19s: %-26s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
+-	@printf "%19s: %-26s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
+-	@printf "%19s: %-26s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+-	@printf "%19s: %-26s -- %s\n" "materials" typeof(md.materials) "material properties"
+-	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+-	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
+-	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
+-	@printf "%19s: %-26s -- %s\n" "friction" typeof(md.friction) "basal friction"
+-
+-end# }}}
+Index: ../trunk-jpl/src/jl/md/parameterization.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/parameterization.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/md/parameterization.jl	(nonexistent)
+@@ -1,54 +0,0 @@
+-# setmask {{{
+-"""
+-SETMASK - establish boundaries between grounded and floating ice.
+-
+-   By default, ice is considered grounded. The contour floatingicename defines nodes 
+-   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
+-   that are grounded (ie: ice rises, islands, etc ...)
+-   All input files are in the Argus format (extension .exp).
+-
+-   Usage:
+-      md=setmask(md,floatingicename,groundedicename)
+-
+-   Examples:
+-      md=setmask(md,'all','');
+-      md=setmask(md,'Iceshelves.exp','Islands.exp');
+-"""
+-function setmask(md::model,floatingicename::String,groundedicename::String)
+-
+-	elementonfloatingice = FlagElements( md, floatingicename)
+-	elementongroundedice = FlagElements( md, groundedicename)
+-
+-	elementonfloatingice = convert( Array{Float64}, (elementonfloatingice.>0) .&  (elementongroundedice.==0.))
+-	elementongroundedice = convert( Array{Float64}, elementonfloatingice.==0.)
+-
+-	vertexonfloatingice=zeros(md.mesh.numberofvertices)
+-	vertexongroundedice=zeros(md.mesh.numberofvertices)
+-
+-	vertexongroundedice[md.mesh.elements[findall(elementongroundedice.>0),:]] .= 1.
+-	vertexonfloatingice[findall(vertexongroundedice.==0.)] .= 1.
+-
+-	#define levelsets
+-	md.mask.ocean_levelset = vertexongroundedice
+-	md.mask.ocean_levelset[findall(vertexongroundedice .==0.)] .= -1.
+-	md.mask.ice_levelset = -1*ones(md.mesh.numberofvertices)
+-
+-	return md
+-end
+-#}}}
+-# FlagElements {{{
+-function FlagElements(md::model,region::String)
+-
+-	if isempty(region)
+-		flags = zeros(md.mesh.numberofelements)
+-	elseif region == "all"
+-		flags = ones(md.mesh.numberofelements)
+-	else
+-		xcenter = md.mesh.x[md.mesh.elements]*[1;1;1]/3
+-		ycenter = md.mesh.y[md.mesh.elements]*[1;1;1]/3
+-		flags = ContourToNodes(xcenter, ycenter, region, 2.)
+-	end
+-
+-	return flags
+-end
+-#}}}
+Index: ../trunk-jpl/src/jl/md/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/plotmodel.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/md/plotmodel.jl	(nonexistent)
+@@ -1,45 +0,0 @@
+-import ColorSchemes.jet
+-using GLMakie
+-using .ISSM
+-
+-function plotmodel(md::ISSM.model,data::Vector)
+-
+-	vertexcolor  = :black
+-	facetcolor   = :blue
+-	showvertices = true
+-	showfacets   = true
+-
+-	if data isa AbstractVector
+-
+-		if length(data)==md.mesh.numberofelements
+-			# vector of polygons
+-			x = md.mesh.x
+-			y = md.mesh.y
+-			index = md.mesh.elements
+-			ps = [Makie.GeometryBasics.Polygon([Point2(x[index[i,1]], y[index[i,1]]), Point2(x[index[i,2]], y[index[i,2]]), Point2(x[index[i,3]], y[index[i,3]])])
+-					for i in 1:md.mesh.numberofelements]
+-
+-			fig, ax, h = Makie.poly(ps, color = data, colormap = jet)
+-
+-			#Add colorbar
+-			Colorbar(fig[1, 2], limits = (minimum(data), maximum(data)), colormap = jet)
+-		elseif length(data)==md.mesh.numberofvertices
+-			fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+-
+-			#Add colorbar
+-			#Colorbar(fig[1, 2], h, width=25)
+-		else
+-			error("data of size "*string(length(data))*" not supported yet!")
+-		end
+-	else
+-		# default to single color
+-		@assert length(data)==1
+-		fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+-	end
+-
+-	if showvertices
+-		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
+-	end
+-
+-	return fig
+-end
+Index: ../trunk-jpl/src/jl/md/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/utils.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/md/utils.jl	(nonexistent)
+@@ -1,240 +0,0 @@
+-#utils
+-function issmdir() #{{{
+-	issmdir = ENV["ISSM_DIR"]
+-
+-	if isempty(issmdir)
+-		error("Could not determine the location of ISSM")
+-	else
+-		return issmdir
+-	end
+-end#}}}
+-function archread(filename::String,variablename::String) #{{{
+-
+-	#initialize variables
+-	found = false
+-
+-	#open file
+-	output = open(filename, "r") do f
+-
+-		while !eof(f)
+-			reclen  = bswap(read(f, Int32))
+-			rectype = bswap(read(f, Int32))
+-			if rectype!=1
+-				error("Expected variable of type string")
+-			else
+-				fieldname_length = bswap(read(f, Int32))
+-				field_name = String(read(f, fieldname_length))
+-			end
+-			rec_length = bswap(read(f, Int32))
+-			field_type = bswap(read(f, Int32))
+-			if field_type==2
+-				data = bswap(read(f, Float64))
+-			elseif field_type==3
+-				rows = bswap(read(f, Int32))
+-				cols = bswap(read(f, Int32))
+-				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
+-				data .= ntoh.(data)
+-				data = reshape(data, (rows,cols))
+-				data = collect(data)
+-				if cols == 1
+-					data = vec(data)
+-				end
+-			else
+-				error("Error: Encountered invalid field type when reading data.")
+-			end
+-
+-			if field_name == variablename
+-				found = true
+-				return data
+-			end
+-		end
+-	end
+-
+-	return output
+-end# }}}
+-function InterpFromMeshToMesh2d(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector,default::Float64=NaN) #{{{
+-
+-	#Allocate output
+-	nods_out = length(xout)
+-	data_out = default*ones(nods_out)
+-
+-	#Interpolation type
+-	data_length = size(data,1)
+-	nods_data   = length(x_data)
+-	nels_data   = size(index_data,1)
+-	if(data_length==nods_data)
+-		interpolation_type=1;
+-	elseif (data_length==nels_data)
+-		interpolation_type=2
+-	else
+-		error("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!")
+-	end
+-	xmin = minimum(xout); xmax = maximum(xout)
+-	ymin = minimum(yout); ymax = maximum(yout)
+-
+-	for i in 1:nels_data
+-
+-		#skip element if no overlap
+-		if (minimum(x_data[index_data[i,:]]) > xmax) continue end
+-		if (minimum(y_data[index_data[i,:]]) > ymax) continue end
+-		if (maximum(x_data[index_data[i,:]]) < xmin) continue end
+-		if (maximum(y_data[index_data[i,:]]) < ymin) continue end
+-
+-		#get area of the current element (Jacobian = 2 * area)*/
+-		#area =x2 * y3 - y2*x3 + x1 * y2 - y1 * x2 + x3 * y1 - y3 * x1;
+-		area = (x_data[index_data[i,2]]*y_data[index_data[i,3]]-y_data[index_data[i,2]]*x_data[index_data[i,3]] 
+-				  +  x_data[index_data[i,1]]*y_data[index_data[i,2]]-y_data[index_data[i,1]]*x_data[index_data[i,2]] 
+-				  +  x_data[index_data[i,3]]*y_data[index_data[i,1]]-y_data[index_data[i,3]]*x_data[index_data[i,1]])
+-
+-		for j in 1:nods_out
+-			#Get first area coordinate = det(x-x3  x2-x3 ; y-y3   y2-y3)/area
+-			area_1=((xout[j]-x_data[index_data[i,3]])*(y_data[index_data[i,2]]-y_data[index_data[i,3]])
+-					 -  (yout[j]-y_data[index_data[i,3]])*(x_data[index_data[i,2]]-x_data[index_data[i,3]]))/area
+-			#Get second area coordinate =det(x1-x3  x-x3 ; y1-y3   y-y3)/area
+-			area_2=((x_data[index_data[i,1]]-x_data[index_data[i,3]])*(yout[j]-y_data[index_data[i,3]])
+-					  - (y_data[index_data[i,1]]-y_data[index_data[i,3]])*(xout[j]-x_data[index_data[i,3]]))/area
+-			#Get third area coordinate = 1-area1-area2
+-			area_3=1-area_1-area_2
+-
+-			if (area_1>=0 && area_2>=0 && area_3>=0)
+-				if (interpolation_type==1)
+-					#nodal interpolation
+-					data_out[j]=area_1*data[index_data[i,1]]+area_2*data[index_data[i,2]]+area_3*data[index_data[i,3]];
+-				else
+-					#element interpolation
+-					data_out[j]=data[i];
+-				end
+-			end
+-		end
+-	end
+-	return data_out
+-
+-	#OLD STUFF!!! not working...
+-	
+-	#prepare input arrays
+-	nods = Cint(length(x))
+-	nels = Cint(size(index,1))
+-	nods_interp = Cint(length(xout))
+-	Cindex=Array{Cint,1}(undef,length(index))
+-	for i in 1:size(index,1)
+-		for j in 1:3
+-			Cindex[(i-1)*3+j] = Int32(index[i,j])
+-		end
+-	end
+-	Cx    = Array{Cdouble,1}(undef,nods)
+-	Cy    = Array{Cdouble,1}(undef,nods)
+-	Cdata = Array{Cdouble,1}(undef,nods)
+-	for i in 1:nods
+-		Cx[i]    = x[i]
+-		Cy[i]    = y[i]
+-		Cdata[i] = data[i]
+-	end
+-	Cxout = Array{Cdouble,1}(undef,nods_interp)
+-	Cyout = Array{Cdouble,1}(undef,nods_interp)
+-	for i in 1:nods_interp
+-		Cxout[i] = xout[i]
+-		Cyout[i] = yout[i]
+-	end
+-
+-	Cdataout = Vector{Float64}(undef,nods_interp)
+-
+-	#This is not working....
+-	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
+-				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
+-				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
+-				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
+-
+-	#Process output
+-	dataout = Vector{Float64}(undef,nods_interp)
+-	for i in 1:nods_interp
+-		dataout[i] = Cdataout[i]
+-	end
+-
+-	return dataout
+-end #}}}
+-function InterpFromMeshToMesh2d2(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
+-
+-	#prepare input arrays
+-	nods = Cint(length(x_data))
+-	nels = Cint(size(index_data,1))
+-	nods_interp = Cint(length(xout))
+-	Cindex=Array{Cint,1}(undef,length(index_data))
+-	for i in 1:size(index_data,1)
+-		for j in 1:3
+-			Cindex[(i-1)*3+j] = Int32(index_data[i,j])
+-		end
+-	end
+-	Cx    = Array{Cdouble,1}(undef,nods)
+-	Cy    = Array{Cdouble,1}(undef,nods)
+-	Cdata = Array{Cdouble,1}(undef,nods)
+-	for i in 1:nods
+-		Cx[i]    = x_data[i]
+-		Cy[i]    = y_data[i]
+-		Cdata[i] = data[i]
+-	end
+-	Cxout    = Array{Cdouble,1}(undef,nods_interp)
+-	Cyout    = Array{Cdouble,1}(undef,nods_interp)
+-	Cdataout = Array{Cdouble,1}(undef,nods_interp)
+-	for i in 1:nods_interp
+-		Cxout[i] = xout[i]
+-		Cyout[i] = yout[i]
+-	end
+-
+-	#This is not working....
+-	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
+-	#			Cint, (Ptr{Cdouble},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
+-	#			Ref(Cdataout), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
+-	#			Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
+-	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
+-	#			Cint, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint),
+-	#			Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels)
+-	#
+-	#
+-	dataout = Vector{Float64}(undef,nods_interp)
+-	rc=ccall( (:InterpFromMeshToMesh2dx3,"/Users/mmorligh/Desktop/issmuci/trunk-jpl/src/jl/bamg/libBamg.dylib"),
+-				Cint, (Ptr{Cdouble}, Cint),
+-				dataout, nods_interp)
+-
+-	#Process output
+-	for i in 1:nods_interp
+-		dataout[i] = Cdataout[i]
+-	end
+-
+-	return dataout
+-end #}}}
+-function solve(md::model,solution::String) #{{{
+-
+-	if solution=="sb" || solution=="Stressbalance"
+-		solutionstring = "StressbalanceSolution"
+-	else
+-		error("solutionstring "*solution*" not supported!");
+-	end
+-
+-	IssmCore(md)
+-
+-	return md
+-end #}}}
+-function IssmStructDisp(io::IO, modelfield::Any) # {{{
+-	println(io,typeof(modelfield),":")
+-	for name in fieldnames(typeof(modelfield))
+-		a=getfield(modelfield,name)
+-		#print(io,"   $(name) = ")
+-		@printf "%19s: " name
+-		if isa(a,String)
+-			println(io, a)
+-		elseif length(a)>1
+-			if !isempty(a)
+-				println(io, typeof(a), " of size ", size(a))
+-			else
+-				println(io,"empty")
+-			end
+-		else
+-			println(io, a)
+-		end
+-	end
+-end #}}}
+-function meshgrid(x::Vector, y::Vector)
+-    X = [i for i in x, j in 1:length(y)]
+-    Y = [j for i in 1:length(x), j in y]
+-    return X, Y
+-end
+Index: ../trunk-jpl/src/jl/md/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/md/triangle.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/md/triangle.jl	(nonexistent)
+@@ -1,178 +0,0 @@
+-
+-#Class Triangle's triangulateio
+-mutable struct CTriangulateIO #{{{
+-
+-    pointlist :: Ptr{Cdouble}
+-    pointattributelist :: Ptr{Cdouble}
+-    pointmarkerlist :: Ptr{Cint}
+-    numberofpoints :: Cint
+-    numberofpointattributes :: Cint
+-    
+-    trianglelist :: Ptr{Cint}
+-    triangleattributelist :: Ptr{Cdouble}
+-    trianglearealist :: Ptr{Cdouble}
+-    neighborlist :: Ptr{Cint}
+-    numberoftriangles :: Cint
+-    numberofcorners :: Cint
+-    numberoftriangleattributes :: Cint
+-    
+-    segmentlist :: Ptr{Cint}
+-    segmentmarkerlist :: Ptr{Cint}
+-    numberofsegments :: Cint
+-
+-    holelist :: Ptr{Cdouble}
+-    numberofholes :: Cint
+-
+-    regionlist :: Ptr{Cdouble}
+-    numberofregions :: Cint
+-
+-    edgelist :: Ptr{Cint}
+-    edgemarkerlist :: Ptr{Cint}
+-    normlist :: Ptr{Cdouble}
+-    numberofedges :: Cint
+- end  #}}}
+-function CTriangulateIO() #{{{
+-	return CTriangulateIO(C_NULL, C_NULL, C_NULL, 0, 0,
+-								 C_NULL, C_NULL, C_NULL, C_NULL, 0, 0, 0,
+-								 C_NULL, C_NULL, 0,
+-								 C_NULL, 0,
+-								 C_NULL, 0,
+-								 C_NULL, C_NULL, C_NULL, 0)
+-end# }}}
+-function Base.show(io::IO, tio::CTriangulateIO)# {{{
+-	println(io,"CTriangulateIO(")
+-	for name in fieldnames(typeof(tio))
+-		a=getfield(tio,name)
+-		print(io,"$(name) = ")
+-		println(io,a)
+-	end
+-	println(io,")")
+-end# }}}
+-
+-using Printf #needed for sprintf
+-
+-"""
+-TRIANGLE - create model mesh using the triangle package
+-
+-	This function creates a model mesh using Triangle and a domain outline, to
+-	within a certain resolution
+-#Arguments
+- - md is a model tuple
+- - domainname is the name of an Argus domain outline file
+- - resolution:  is a characteristic length for the mesh (same unit as the domain outline unit)
+-
+-# Usage:
+- - md=triangle(md,domainname,resolution)
+-# Examples:
+- - md=triangle(md,'DomainOutline.exp',1000);
+- - md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
+-"""
+-function triangle(md::model,domainname::String,resolution::Float64) #{{{
+-
+-	#read input file
+-	contours = expread(domainname)
+-	area     = resolution^2
+-
+-	#Initialize i/o structures
+-	ctio_in  = CTriangulateIO();
+-	ctio_out = CTriangulateIO();
+-	vor_out  = CTriangulateIO();
+-
+-	#Construct input structure
+-	numberofpoints   = 0
+-	numberofsegments = 0
+-	for i in 1:length(contours)
+-		numberofpoints   += contours[i].nods-1
+-		numberofsegments += contours[i].nods-1
+-	end
+-	numberofpointattributes = 1
+-
+-	pointlist=Array{Cdouble,2}(undef,2,numberofpoints)
+-	count = 0
+-	for i in 1:length(contours)
+-		nods = contours[i].nods
+-		pointlist[1,count+1:count+nods-1] = contours[i].x[1:end-1]
+-		pointlist[2,count+1:count+nods-1] = contours[i].y[1:end-1]
+-		count += (nods-1)
+-	end
+-	pointattributelist=Array{Cdouble,1}(undef,numberofpoints)
+-	pointmarkerlist=Array{Cint,1}(undef,numberofpoints)
+-	for i in 1:numberofpoints
+-		pointmarkerlist[i]=0
+-		pointattributelist[i]=0.
+-	end
+-
+-	counter=0;
+-   backcounter=0;
+-	segmentlist=Array{Cint,2}(undef,2,numberofsegments)
+-	segmentmarkerlist=Array{Cint,1}(undef,numberofsegments)
+-	segmentmarkerlist[:].=0
+-	for i in 1:length(contours)
+-		nods = contours[i].nods
+-		segmentlist[1,counter+1:counter+nods-2] = collect(counter+0:counter+nods-3)
+-		segmentlist[2,counter+1:counter+nods-2] = collect(counter+1:counter+nods-2)
+-		counter+=nods-2
+-		#close profile
+-		segmentlist[1,counter+1]=counter
+-		segmentlist[2,counter+1]=backcounter
+-		counter+=1
+-		backcounter=counter
+-	end
+-
+-	numberofregions = 0
+-	numberofholes = length(contours)-1
+-	holelist = Array{Cdouble,2}(undef,2,numberofholes)
+-	if numberofholes>0
+-		 for i in 2:length(contours)
+-			 xA=contours[i].x[1]; xB=contours[i].x[end-1]
+-			 yA=contours[i].y[1]; yB=contours[i].y[end-1]
+-			 xC=(xA+xB)/2;        yC=(yA+yB)/2;
+-			 xD=xC+tan(10. /180. *pi)*(yC-yA);
+-			 yD=yC+tan(10. /180. *pi)*(xA-xC);
+-			 xE=xC-tan(10. /180. *pi)*(yC-yA);
+-			 yE=yC-tan(10. /180. *pi)*(xA-xC);
+-			 holelist[1,i-1] = xD
+-			 holelist[2,i-1] = yD
+-		 end
+-	end
+-
+-	#based on this, prepare input structure
+-	ctio_in.numberofpoints = numberofpoints
+-	ctio_in.pointlist=pointer(pointlist)
+-	ctio_in.numberofpointattributes=numberofpointattributes
+-	ctio_in.pointattributelist=pointer(pointattributelist)
+-	ctio_in.pointmarkerlist=pointer(pointmarkerlist)
+-	ctio_in.numberofsegments=numberofsegments
+-	ctio_in.segmentlist=pointer(segmentlist)
+-	ctio_in.segmentmarkerlist = pointer(segmentmarkerlist)
+-	ctio_in.numberofholes=numberofholes
+-	ctio_in.holelist=pointer(holelist)
+-	ctio_in.numberofregions=0
+-
+-	#Call triangle using ISSM's default options
+-	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
+-	#rc=ccall( (:triangulate,"libtriangle"),
+-	rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
+-				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
+-				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
+-
+-	#post process output
+-	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
+-	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
+-	segments  = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.segmentlist,  (2,Int(ctio_out.numberofsegments)), own=true))' .+1
+-	
+-	#assign output
+-	md.mesh = Mesh2dTriangle()
+-	md.mesh.numberofvertices = ctio_out.numberofpoints
+-	md.mesh.numberofelements = ctio_out.numberoftriangles
+-	md.mesh.x                = points[:,1]
+-	md.mesh.y                = points[:,2]
+-	md.mesh.elements         = triangles
+-	md.mesh.segments         = segments
+-
+-	#post processing
+-	md.mesh.vertexonboundary = zeros(Bool,md.mesh.numberofvertices)
+-	md.mesh.vertexonboundary[md.mesh.segments] .= true
+-
+-   return md
+-end#}}}
+Index: ../trunk-jpl/src/jl/test.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/test.jl	(nonexistent)
+@@ -1,14 +0,0 @@
+-#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+-include("issm.jl")
+-using .ISSM
+-using MAT
+-
+-#Load model from MATLAB file
+-#file = matopen("Pig.mat")
+-file = matopen("/Users/mmorligh/Desktop/issmuci/trunk-jpl/examples/Pig2/Pig.mat")
+-mat = read(file, "md")
+-close(file)
+-md=model(mat)
+-
+-#Solve stress balance
+-md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test.jl
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test101.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/test101.jl	(nonexistent)
+@@ -1,47 +0,0 @@
+-#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+-include("issm.jl")
+-using .ISSM
+-
+-md = model()
+-md = triangle(md,"../../test/Exp/Square.exp",50000.)
+-#md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.)
+-#md = ISSM.triangle(md,"../../test/Exp/Square.exp",1000.)
+-md = setmask(md,"all","")
+-
+-#Geometry
+-hmin=300.
+-hmax=1000.
+-ymin=minimum(md.mesh.y)
+-ymax=maximum(md.mesh.y)
+-xmin=minimum(md.mesh.x)
+-xmax=maximum(md.mesh.x)
+-md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+-md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+-md.geometry.surface   = md.geometry.base+md.geometry.thickness
+-md.geometry.bed       = md.geometry.base .-10
+-
+-#Initial velocity
+-x     = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+-y     = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+-vx    = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+-vy    = archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+-index = Int.(archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
+-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.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+-md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+-md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+-
+-md.stressbalance.restol=0.05
+-md.stressbalance.reltol=0.05
+-md.stressbalance.abstol=NaN
+-
+-#Boundary conditions
+-md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+-md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+-pos = findall(md.mesh.vertexonboundary)
+-md.stressbalance.spcvx[pos] .= 0.0
+-md.stressbalance.spcvy[pos] .= 0.0
+-
+-md=solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test101.jl
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/test201.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test201.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/test201.jl	(nonexistent)
+@@ -1,51 +0,0 @@
+-#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+-include("issm.jl")
+-using .ISSM
+-
+-md = ISSM.model()
+-md = ISSM.triangle(md,"../../test/Exp/Square.exp",50000.)
+-md = ISSM.setmask(md,"all","")
+-
+-#Geometry
+-hmin=300.
+-hmax=1000.
+-ymin=minimum(md.mesh.y)
+-ymax=maximum(md.mesh.y)
+-xmin=minimum(md.mesh.x)
+-xmax=maximum(md.mesh.x)
+-md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+-md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+-md.geometry.surface   = md.geometry.base+md.geometry.thickness
+-md.geometry.bed       = md.geometry.base .-10
+-
+-#Initial velocity
+-x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+-y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+-vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+-vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+-index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+-md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+-md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
+-
+-md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+-md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+-md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+-
+-md.stressbalance.restol=0.1
+-md.stressbalance.reltol=0.02
+-md.stressbalance.abstol=NaN
+-
+-#Boundary conditions
+-nodefront=ISSM.ContourToNodes(md.mesh.x,md.mesh.y,"../../test/Exp/SquareFront.exp",2.0) .& md.mesh.vertexonboundary
+-md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+-md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+-pos = findall(md.mesh.vertexonboundary .& .~nodefront)
+-md.mask.ice_levelset[findall(nodefront)] .= 0
+-
+-segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
+-segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
+-pos=md.mesh.segments[segments,1:2]
+-md.stressbalance.spcvx[pos] .= 0.0
+-md.stressbalance.spcvy[pos] .= 0.0
+-
+-md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test201.jl
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/solve/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/utils.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/utils.jl	(nonexistent)
+@@ -1,26 +0,0 @@
+-function Matrix2x2Determinant(A::Matrix{Float64}) #{{{
+-
+-	return  A[1,1]*A[2,2]-A[2,1]*A[1,2]
+-
+-end#}}}
+-function Matrix2x2Invert(A::Matrix{Float64}) #{{{
+-
+-	#Initialize output
+-	Ainv = Matrix{Float64}(undef,2,2)
+-
+-	#Compute determinant
+-	det = Matrix2x2Determinant(A)
+-	if(abs(det)<eps(Float64)) error("Determinant smaller than machine epsilon") end
+-
+-	#Multiplication is faster than divsion, so we multiply by the reciprocal
+-	det_reciprocal = 1/det
+-
+-	#compute invert matrix
+-	Ainv[1,1]=   A[2,2]*det_reciprocal # =  d/det
+-   Ainv[1,2]= - A[1,2]*det_reciprocal # = -b/det
+-   Ainv[2,1]= - A[2,1]*det_reciprocal # = -c/det
+-   Ainv[2,2]=   A[1,1]*det_reciprocal # =  a/det
+-
+-	return  Ainv
+-
+-end#}}}
+Index: ../trunk-jpl/src/jl/solve/results.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/results.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/results.jl	(nonexistent)
+@@ -1,5 +0,0 @@
+-mutable struct Result #{{{
+-	step::Int64
+-	time::Float64
+-	value
+-end#}}}
+Index: ../trunk-jpl/src/jl/solve/matice.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/matice.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/matice.jl	(nonexistent)
+@@ -1,44 +0,0 @@
+-#Matice class definition
+-struct Matice#{{{
+-	vx_input::ElementInput
+-	vy_input::ElementInput
+-	B_input::ElementInput
+-	n_input::ElementInput
+-end# }}}
+-
+-function Matice(element::Tria) #{{{
+-
+-	vx_input  = GetInput(element, VxEnum)
+-	vy_input  = GetInput(element, VyEnum)
+-	B_input   = GetInput(element, MaterialsRheologyBEnum)
+-	n_input   = GetInput(element, MaterialsRheologyNEnum)
+-
+-	return Matice(vx_input, vy_input, B_input, n_input)
+-end#}}}
+-
+-#vertices functions
+-function ViscositySSA(matice::Matice, xyz_list::Matrix{Float64}, gauss::GaussTria, i::Int64) #{{{
+-
+-	#Get strain rate
+-	dvx = GetInputDerivativeValue(matice.vx_input,xyz_list,gauss,i)
+-	dvy = GetInputDerivativeValue(matice.vy_input,xyz_list,gauss,i)
+-	eps_xx = dvx[1]
+-	eps_yy = dvy[2]
+-	eps_xy = 0.5*(dvx[2] + dvy[1])
+-
+-	#In SSA, eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy
+-	eps_eff = sqrt(eps_xx*eps_xx + eps_yy*eps_yy + eps_xy*eps_xy + eps_xx*eps_yy)
+-
+-	#Get B and n
+-	n = GetInputValue(matice.n_input, gauss, i)
+-	B = GetInputValue(matice.B_input, gauss, i)
+-
+-	#Compute viscosity
+-	if eps_eff==0.
+-		mu = 1.e+14/2
+-	else
+-		mu = B/(2*eps_eff^((n-1)/n))
+-	end
+-
+-	return mu
+-end #}}}
+Index: ../trunk-jpl/src/jl/solve/parameters.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/parameters.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/parameters.jl	(nonexistent)
+@@ -1,46 +0,0 @@
+-#Parameter class definition
+-abstract type Parameter end
+-struct DoubleParam <: Parameter #{{{
+-	enum::IssmEnum
+-	value::Float64
+-end# }}}
+-struct IntParam <: Parameter #{{{
+-	enum::IssmEnum
+-	value::Int64
+-end# }}}
+-
+-#Parameters dataset class definition
+-mutable struct Parameters #{{{
+-	lookup::Dict{IssmEnum,Parameter}
+-end# }}}
+-
+-#Parameter functions
+-function GetParameterValue(param::DoubleParam) #{{{
+-	return param.value
+-end#}}}
+-function GetParameterValue(param::IntParam) #{{{
+-	return param.value
+-end#}}}
+-
+-#Parameters functions
+-function AddParam(parameters::Parameters,value::Float64,enum::IssmEnum) #{{{
+-
+-	parameters.lookup[enum] = DoubleParam(enum,value)
+-
+-end#}}}
+-function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
+-
+-	parameters.lookup[enum] = IntParam(enum,value)
+-
+-end#}}}
+-function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
+-
+-	parameters.lookup[enum] = IntParam(enum,value)
+-
+-end#}}}
+-function FindParam(parameters::Parameters,enum::IssmEnum) #{{{
+-
+-	param = parameters.lookup[enum]
+-	return GetParameterValue(param)
+-
+-end#}}}
+Index: ../trunk-jpl/src/jl/solve/constraints.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/constraints.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/constraints.jl	(nonexistent)
+@@ -1,18 +0,0 @@
+-#Constraint class definition
+-struct Constraint #{{{
+-	id::Int64
+-	nodeid::Int64
+-	dof::Int8
+-	value::Float64
+-end# }}}
+-
+-#Constraint functions
+-function ConstrainNode(constraint::Constraint,nodes::Vector{Node},parameters::Parameters) #{{{
+-
+-	#Chase through nodes and find the node to which this SpcStatic apply
+-	node = nodes[constraint.nodeid]
+-
+-	#Apply Constraint
+-	ApplyConstraint(node,constraint.dof,constraint.value)
+-
+-end# }}}
+Index: ../trunk-jpl/src/jl/solve/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/modules.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/modules.jl	(nonexistent)
+@@ -1,261 +0,0 @@
+-#Model Processor
+-function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
+-	for i in 1:length(elements)
+-		InputCreate(elements[i],inputs,data,enum)
+-	end
+-end#}}}
+-function ModelProcessor(md::model) #{{{
+-
+-	#Initialize structures
+-	elements    = Vector{Tria}(undef,0)
+-	vertices    = Vector{Vertex}(undef,0)
+-	nodes       = Vector{Node}(undef,0)
+-	constraints = Vector{Constraint}(undef,0)
+-	results     = Vector{Result}(undef,0)
+-	parameters  = Parameters(Dict{IssmEnum,Parameter}())
+-	inputs      = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
+-
+-	#Create  elements, vertices and materials (independent of the analysis)
+-	CreateElements(elements,md)
+-	CreateVertices(vertices,md)
+-	CreateParameters(parameters,md)
+-	CreateInputs(inputs,elements,md)
+-
+-	#Now create analysis specific data structure
+-	analysis = StressbalanceAnalysis()
+-	UpdateParameters(analysis,parameters,md)
+-	CreateNodes(analysis,nodes,md)
+-	UpdateElements(analysis,elements,inputs,md)
+-	CreateConstraints(analysis,constraints,md)
+-
+-	#Configure objects
+-	ConfigureObjectx(elements,nodes,vertices,parameters,inputs)
+-
+-	#Constrain and Number nodes
+-	SpcNodesx(nodes,constraints,parameters)
+-	NodesDofx(nodes,parameters)
+-
+-	#Build FemModel
+-	return FemModel(elements, vertices, nodes, parameters, inputs, constraints, results)
+-end# }}}
+-function CreateElements(elements::Vector{Tria},md::model) #{{{
+-
+-	#Make sure elements is currently empty
+-	@assert length(elements)==0
+-
+-	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
+-	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
+-
+-	count = 0
+-	for i in 1:md.mesh.numberofelements
+-
+-		#Assume Linear Elements for now
+-		vertexids = md.mesh.elements[i,:]
+-		nodeids   = md.mesh.elements[i,:]
+-
+-		#Call constructor and add to dataset elements
+-		push!(elements,Tria(i,count,vertexids,Vector{Vertex}(undef,3),nodeids,Vector{Node}(undef,3),tempparams,tempinputs))
+-	end
+-
+-end# }}}
+-function CreateVertices(vertices::Vector{Vertex},md::model) #{{{
+-
+-	#Make sure vertices is currently empty
+-	@assert length(vertices)==0
+-
+-	#Get data from md
+-	x = md.mesh.x
+-	y = md.mesh.y
+-
+-	count = 0
+-	for i in 1:md.mesh.numberofvertices
+-		push!(vertices,Vertex(i,x[i],y[i],0.))
+-	end
+-
+-end# }}}
+-function CreateParameters(parameters::Parameters,md::model) #{{{
+-
+-	#Get data from md
+-	AddParam(parameters,md.materials.rho_ice,MaterialsRhoIceEnum)
+-	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
+-	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
+-	AddParam(parameters,md.constants.g,ConstantsGEnum)
+-	
+-	#Set step and time, this will be overwritten if we run a transient
+-	AddParam(parameters,1,StepEnum)
+-	AddParam(parameters,0.0,TimeEnum)
+-end# }}}
+-function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
+-
+-	#Only assume we have Matice for now
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
+-end# }}}
+-function OutputResultsx(femmodel::FemModel, md::model)# {{{
+-
+-	md.results = Dict("Stressbalance"=> femmodel.results)
+-
+-end# }}}
+-
+-#Other modules
+-function ConfigureObjectx(elements::Vector{Tria},nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) #{{{
+-
+-	for i in 1:length(elements)
+-		Configure(elements[i],nodes,vertices,parameters,inputs)
+-	end
+-
+-end# }}}
+-function SpcNodesx(nodes::Vector{Node},constraints::Vector{Constraint},parameters::Parameters) #{{{
+-
+-	for i in 1:length(constraints)
+-		ConstrainNode(constraints[i],nodes,parameters)
+-	end
+-
+-end# }}}
+-function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
+-
+-	#Do we have any nodes?
+-	if length(nodes)==0
+-		return
+-	end
+-
+-	#Do we really need to update dof indexing
+-	if(~RequiresDofReindexing(nodes)) return end
+-
+-	print("   Renumbering degrees of freedom\n")
+-	DistributeDofs(nodes,GsetEnum)
+-	DistributeDofs(nodes,FsetEnum)
+-	DistributeDofs(nodes,SsetEnum)
+-
+-end# }}}
+-function GetSolutionFromInputsx(analysis::Analysis,femmodel::FemModel) #{{{
+-
+-	#Get size of vector
+-	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
+-
+-	#Initialize solution vector
+-	ug = IssmVector(gsize)
+-
+-	#Go through elements and plug in solution
+-	for i=1:length(femmodel.elements)
+-		GetSolutionFromInputs(analysis,ug,femmodel.elements[i])
+-	end
+-
+-	return ug
+-
+-end#}}}
+-function InputUpdateFromSolutionx(analysis::Analysis,ug::IssmVector,femmodel::FemModel) #{{{
+-
+-	#Go through elements and plug in solution
+-	for i=1:length(femmodel.elements)
+-		InputUpdateFromSolution(analysis,ug.vector,femmodel.elements[i])
+-	end
+-
+-	return ug
+-
+-end#}}}
+-function Reducevectorgtofx(ug::IssmVector,nodes::Vector{Node}) #{{{
+-
+-	#Get size of output vector
+-	fsize = NumberOfDofs(nodes,FsetEnum)
+-
+-	#Initialize output vector
+-	uf = IssmVector(fsize)
+-
+-	#Go through elements and plug in solution
+-	for i=1:length(nodes)
+-		VecReduce(nodes[i],ug.vector,uf)
+-	end
+-
+-	return uf
+-
+-end#}}}
+-function Mergesolutionfromftogx(ug::IssmVector, uf::IssmVector, ys::IssmVector, nodes::Vector{Node}) #{{{
+-
+-	#Go through elements and plug in solution
+-	for i=1:length(nodes)
+-		VecMerge(nodes[i],ug,uf.vector,ys.vector)
+-	end
+-
+-	return ug
+-
+-end#}}}
+-function Reduceloadx!(pf::IssmVector, Kfs::IssmMatrix, ys::IssmVector) #{{{
+-
+-	#Is there anything to do?
+-	m, n = GetSize(Kfs)
+-
+-	if(m*n>0)
+-
+-		#Allocate Kfs*ys
+-		Kfsy_s=IssmVector(m)
+-
+-		#Perform multiplication
+-		MatMult!(Kfs,ys,Kfsy_s)
+-
+-		#Subtract Kfs*ys from pf
+-		AXPY!(pf,-1.0,Kfsy_s)
+-
+-	end
+-end#}}}
+-function SystemMatricesx(femmodel::FemModel,analysis::Analysis)# {{{
+-
+-	#Allocate matrices
+-	fsize = NumberOfDofs(femmodel.nodes,FsetEnum)
+-	ssize = NumberOfDofs(femmodel.nodes,SsetEnum)
+-	Kff = IssmMatrix(fsize,fsize)
+-	Kfs = IssmMatrix(fsize,ssize)
+-	pf  = IssmVector(fsize)
+-
+-	#Construct Stiffness matrix and load vector from elements
+-	for i in 1:length(femmodel.elements)
+-		Ke = CreateKMatrix(analysis,femmodel.elements[i])
+-		pe = CreatePVector(analysis,femmodel.elements[i])
+-
+-		AddToGlobal!(Ke,Kff,Kfs)
+-		AddToGlobal!(pe,pf)
+-	end
+-
+-	Assemble!(Kff)
+-	Assemble!(Kfs)
+-	Assemble!(pf)
+-	
+-	return Kff, Kfs, pf
+-end# }}}
+-function CreateNodalConstraintsx(nodes::Vector{Node})# {{{
+-
+-	#Allocate vector
+-	ssize=NumberOfDofs(nodes,SsetEnum)
+-	ys=IssmVector(ssize)
+-
+-	#constraints vector with the constraint values
+-	for i in 1:length(nodes)
+-		CreateNodalConstraints(nodes[i],ys)
+-	end
+-
+-	return ys
+-end# }}}
+-function RequestedOutputsx(femmodel::FemModel,outputlist::Vector{IssmEnum})# {{{
+-
+-	#Get Step and Time from parameters
+-	step = FindParam(femmodel.parameters,StepEnum)
+-	time = FindParam(femmodel.parameters,TimeEnum)
+-	
+-	#Now fetch results
+-	for i in 1:length(outputlist)
+-
+-		#See if outputlist[i] is an input
+-		if outputlist[i]>InputsSTARTEnum && outputlist[i]<InputsENDEnum
+-
+-			#Create Result
+-			input  = GetInput(femmodel.inputs,outputlist[i])
+-			result = Result(step, time, copy(input.values))
+-
+-			#Add to femmodel.results dataset
+-			push!(femmodel.results,result)
+-
+-		else
+-			println("Output ",outputlist[i]," not supported yet")
+-		end
+-	end
+-end# }}}
+Index: ../trunk-jpl/src/jl/solve/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/toolkits.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/toolkits.jl	(nonexistent)
+@@ -1,136 +0,0 @@
+-
+-#Toolkit #1: serial sparse arrays
+-using SparseArrays
+-
+-#Matrix
+-mutable struct IssmMatrix #{{{
+-	M::Int64
+-	N::Int64
+-	rows::Vector{Int64}
+-	cols::Vector{Int64}
+-	vals::Vector{Float64}
+-	matrix::SparseMatrixCSC{Float64,Int64}
+-end #}}}
+-function IssmMatrix(M::Int64,N::Int64)#{{{
+-	return IssmMatrix(M, N, Vector{Int64}(undef,0), Vector{Int64}(undef,0), Vector{Float64}(undef,0), spzeros(0,0))
+-end#}}}
+-function AddValues!(matrix::IssmMatrix,m::Int64,midx::Vector{Int64},n::Int64,nidx::Vector{Int64},values::Matrix{Float64})#{{{
+-
+-	#This is inefficient now, but it will work
+-	for i in 1:m
+-		if(midx[i]==-1) continue end
+-		for j in 1:n
+-			if(nidx[j]==-1) continue end
+-			push!(matrix.rows, midx[i])
+-			push!(matrix.cols, nidx[j])
+-			push!(matrix.vals, values[i,j])
+-		end
+-	end
+-
+-end#}}}
+-function GetSize(matrix::IssmMatrix)#{{{
+-
+-	return size(matrix.matrix)
+-
+-end#}}}
+-function Assemble!(matrix::IssmMatrix)#{{{
+-
+-	matrix.matrix = sparse(matrix.rows, matrix.cols, matrix.vals, matrix.M, matrix.N)
+-
+-end#}}}
+-
+-#Vector
+-mutable struct IssmVector #{{{
+-	vector::Vector{Float64}
+-end #}}}
+-function IssmVector(M::Int64)#{{{
+-	return IssmVector(zeros(M))
+-end#}}}
+-function GetSize(vector::IssmVector)#{{{
+-
+-	return length(vector.vector)
+-
+-end#}}}
+-function AddValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
+-
+-	#This is inefficient now, but it will work
+-	for i in 1:m
+-		if(midx[i]==-1) continue end
+-		vector.vector[midx[i]] += values[i]
+-	end
+-
+-end#}}}
+-function SetValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
+-
+-	#This is inefficient now, but it will work
+-	for i in 1:m
+-		if(midx[i]==-1) continue end
+-		vector.vector[midx[i]] = values[i]
+-	end
+-
+-end#}}}
+-function IsEmpty(vector::IssmVector)#{{{
+-
+-	return GetSize(vector)==0
+-
+-end#}}}
+-function Duplicate(vector::IssmVector)#{{{
+-
+-	#Copy data structure
+-	M=GetSize(vector)
+-	return IssmVector(M)
+-
+-end#}}}
+-function VecCopy!(x::IssmVector,y::IssmVector)#{{{
+-
+-	y.vector = x.vector
+-
+-end#}}}
+-function Assemble!(vector::IssmVector)#{{{
+-
+-	#Nothing to do for this toolkit
+-
+-end#}}}
+-function Norm(x::IssmVector,type::Int64)#{{{
+-
+-	norm = 0
+-
+-	if type==2
+-		for i in 1:length(x.vector)
+-			norm += x.vector[i]^2
+-		end
+-		norm = sqrt(norm)
+-	elseif type==3
+-		#Infinite norm
+-		for i in 1:length(x.vector)
+-			if(abs(x.vector[i])>norm) norm = abs(x.vector[i]) end
+-		end
+-	else
+-		error("type ",type," not supported yet")
+-	end
+-
+-	return norm
+-
+-end#}}}
+-
+-#Operations
+-function MatMult!(A::IssmMatrix,x::IssmVector,y::IssmVector) #{{{
+-
+-	y.vector = A.matrix*x.vector
+-
+-end#}}}
+-function AXPY!(y::IssmVector,alpha::Float64,x::IssmVector) #{{{
+-
+-	y.vector = alpha*x.vector + y.vector
+-
+-end#}}}
+-function Solverx(A::IssmMatrix,b::IssmVector,xold::IssmVector) #{{{
+-
+-	x = IssmVector(GetSize(xold))
+-	x.vector = (A.matrix\b.vector)
+-
+-	return x
+-
+-
+-end#}}}
+-
+Index: ../trunk-jpl/src/jl/solve/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/nodes.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/nodes.jl	(nonexistent)
+@@ -1,240 +0,0 @@
+-#Node class definition
+-mutable struct Node #{{{
+-	id::Int64
+-	sid::Int64
+-	indexingupdate::Bool
+-	gsize::Int64
+-	gdoflist::Vector{Int64}
+-	fdoflist::Vector{Int64}
+-	sdoflist::Vector{Int64}
+-	svalues::Vector{Float64}
+-end# }}}
+-
+-#Node functions
+-function Base.show(io::IO, this::Node)# {{{
+-
+-	println(io,"Node:")
+-	println(io,"   id:  ",this.id)
+-	println(io,"   sid: ",this.sid)
+-	println(io,"   indexingupdate: ",this.indexingupdate)
+-	println(io,"   gsize: ",this.gsize)
+-	println(io,"   gdoflist: ",this.gdoflist)
+-	println(io,"   fdoflist: ",this.fdoflist)
+-	println(io,"   sdoflist: ",this.sdoflist)
+-	println(io,"   svalues: ",this.svalues)
+-end# }}}
+-function ApplyConstraint(node::Node,dof::Int8,value::Float64) #{{{
+-
+-	node.indexingupdate = true
+-	node.fdoflist[dof]  = -1
+-	node.sdoflist[dof]  = +1
+-	node.svalues[dof]   = value
+-
+-end# }}}
+-function CreateNodalConstraints(node::Node,ys::IssmVector) #{{{
+-
+-	if(SSize(node)>0)
+-		SetValues!(ys,node.gsize,node.sdoflist,node.svalues)
+-	end
+-
+-end# }}}
+-function DistributeDofs(node::Node,setenum::IssmEnum,dofcount::Int64) #{{{
+-
+-	if setenum==GsetEnum
+-		for i=1:node.gsize
+-			node.gdoflist[i] = dofcount
+-			dofcount += 1
+-		end
+-	elseif setenum==FsetEnum
+-		for i=1:node.gsize
+-			if  node.fdoflist[i]!=-1
+-				@assert node.sdoflist[i]==-1
+-				node.fdoflist[i] = dofcount
+-				dofcount += 1
+-			end
+-		end
+-	elseif setenum==SsetEnum
+-		for i=1:node.gsize
+-			if  node.sdoflist[i]!=-1
+-				@assert node.fdoflist[i]==-1
+-				node.sdoflist[i] = dofcount
+-				dofcount += 1
+-			end
+-		end
+-	else
+-		error("not supported")
+-	end
+-
+-	return dofcount
+-end# }}}
+-function GetNumberOfDofs(node::Node,setenum::IssmEnum) #{{{
+-
+-	if setenum==GsetEnum
+-		dofcount = node.gsize
+-	elseif setenum==FsetEnum
+-		dofcount = 0
+-		for i=1:node.gsize
+-			if  node.fdoflist[i]!=-1
+-				dofcount += 1
+-			end
+-		end
+-	elseif setenum==SsetEnum
+-		dofcount = 0
+-		for i=1:node.gsize
+-			if  node.sdoflist[i]!=-1
+-				dofcount += 1
+-			end
+-		end
+-	else
+-		error("not supported")
+-	end
+-
+-	return dofcount
+-
+-end# }}}
+-function GetDofList(node::Node,doflist::Vector{Int64},count::Int64,setenum::IssmEnum) #{{{
+-
+-	if setenum==GsetEnum
+-		for i in 1:node.gsize
+-			count += 1
+-			doflist[count] = node.gdoflist[i]
+-		end
+-	elseif setenum==FsetEnum
+-		for i=1:node.gsize
+-			#if  node.fdoflist[i]!=-1
+-				count += 1
+-				doflist[count] = node.fdoflist[i]
+-			#end
+-		end
+-	elseif setenum==SsetEnum
+-		for i=1:node.gsize
+-			#if  node.sdoflist[i]!=-1
+-				count += 1
+-				doflist[count] = node.sdoflist[i]
+-			#end
+-		end
+-	else
+-		error("not supported")
+-	end
+-
+-	return count
+-
+-end# }}}
+-function GetGlobalDofList(nodes::Vector{Node},ndofs::Int64,setenum::IssmEnum) #{{{
+-
+-	#Allocate list
+-	doflist = Vector{Int64}(undef,ndofs)
+-
+-	#Assign values 
+-	count = 0
+-	for i in 1:length(nodes)
+-		count = GetDofList(nodes[i],doflist,count,setenum)
+-	end
+-	@assert count==ndofs
+-
+-	return doflist
+-
+-end# }}}
+-function VecReduce(node::Node,ug::Vector{Float64},uf::IssmVector) #{{{
+-
+-	for i=1:node.gsize
+-		if node.fdoflist[i]!=-1
+-			uf.vector[node.fdoflist[i]] = ug[node.gdoflist[i]]
+-		end
+-	end
+-
+-end# }}}
+-function VecMerge(node::Node,ug::IssmVector,uf::Vector{Float64},ys::Vector{Float64}) #{{{
+-
+-	fsize = FSize(node)
+-	ssize = SSize(node)
+-
+-	if fsize>0
+-		indices = Vector{Int64}(undef,fsize)
+-		values  = Vector{Float64}(undef,fsize)
+-
+-		count = 1
+-		for i=1:node.gsize
+-			if node.fdoflist[i]!=-1
+-				indices[count] = node.gdoflist[i]
+-				values[count]  = uf[node.fdoflist[i]]
+-				count += 1
+-			end
+-		end
+-		SetValues!(ug,fsize,indices,values)
+-	end
+-
+-	if ssize>0
+-		indices = Vector{Int64}(undef,ssize)
+-		values  = Vector{Float64}(undef,ssize)
+-
+-		count = 1
+-		for i=1:node.gsize
+-			if node.sdoflist[i]!=-1
+-				indices[count] = node.gdoflist[i]
+-				values[count]  = ys[node.sdoflist[i]]
+-				count += 1
+-			end
+-		end
+-		SetValues!(ug,ssize,indices,values)
+-	end
+-
+-end# }}}
+-function SSize(node::Node) #{{{
+-
+-	ssize = 0
+-
+-	for i=1:node.gsize
+-		if node.sdoflist[i]!=-1
+-			ssize+=1
+-		end
+-	end
+-
+-	return ssize
+-
+-end# }}}
+-function FSize(node::Node) #{{{
+-
+-	fsize = 0
+-
+-	for i=1:node.gsize
+-		if node.fdoflist[i]!=-1
+-			fsize+=1
+-		end
+-	end
+-
+-	return fsize
+-
+-end# }}}
+-
+-#Nodes functions
+-function RequiresDofReindexing(nodes::Vector{Node}) #{{{
+-
+-	for i in 1:length(nodes)
+-		if nodes[i].indexingupdate
+-			return true
+-		end
+-	end
+-
+-	return false
+-
+-end# }}}
+-function DistributeDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
+-
+-	dofcount = 1
+-
+-	for i in 1:length(nodes)
+-		dofcount = DistributeDofs(nodes[i],setenum,dofcount)
+-	end
+-
+-
+-end# }}}
+-function NumberOfDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
+-
+-	numdofs = 0
+-	for i in 1:length(nodes)
+-		numdofs += GetNumberOfDofs(nodes[i],setenum)
+-	end
+-	return numdofs
+-
+-end# }}}
+Index: ../trunk-jpl/src/jl/solve/analyses/analysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/analysis.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/analyses/analysis.jl	(nonexistent)
+@@ -1,2 +0,0 @@
+-#Analysis class definitions
+-abstract type Analysis end
+Index: ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl	(nonexistent)
+@@ -1,264 +0,0 @@
+-#StressbalanceAnalysis class definition
+-struct StressbalanceAnalysis <: Analysis#{{{
+-end #}}}
+-
+-#Model Processing
+-function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
+-
+-	#load constraints from model
+-	spcvx = md.stressbalance.spcvx
+-	spcvy = md.stressbalance.spcvy
+-
+-	count = 1
+-	for i in 1:md.mesh.numberofvertices
+-		if ~isnan(spcvx[i])
+-			push!(constraints,Constraint(count,i,1,spcvx[i]/md.constants.yts))
+-			count+=1
+-		end
+-		if ~isnan(spcvy[i])
+-			push!(constraints,Constraint(count,i,2,spcvy[i]/md.constants.yts))
+-			count+=1
+-		end
+-	end
+-
+-end#}}}
+-function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
+-
+-	numdof = 2
+-	for i in 1:md.mesh.numberofvertices
+-		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+-	end
+-end#}}}
+-function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+-
+-	#Provide node indices to element
+-	for i in 1:md.mesh.numberofvertices
+-		Update(elements[i],inputs,i,md,P1Enum)
+-	end
+-
+-	#Add necessary inputs to perform this analysis
+-	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
+-	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
+-	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+-	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
+-	FetchDataToInput(md,inputs,elements,md.mask.ice_levelset, MaskIceLevelsetEnum)
+-	FetchDataToInput(md,inputs,elements,md.mask.ocean_levelset, MaskOceanLevelsetEnum)
+-
+-	#Deal with friction
+-	if typeof(md.friction)==BuddFriction
+-		FetchDataToInput(md,inputs,elements,md.friction.coefficient,FrictionCoefficientEnum)
+-	else
+-		error("Friction ", typeof(md.friction), " not supported yet")
+-	end
+-
+-end#}}}
+-function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
+-	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
+-	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
+-	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
+-	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
+-
+-	#Deal with friction
+-	if typeof(md.friction)==BuddFriction
+-		AddParam(parameters, 1, FrictionLawEnum)
+-	else
+-		error("Friction ", typeof(md.friction), " not supported yet")
+-	end
+-end#}}}
+-
+-#Finite Element Analysis
+-function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+-
+-	#Fetch parameters relevant to solution sequence
+-	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
+-	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
+-	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
+-	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
+-
+-	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+-
+-end #}}}
+-function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
+-
+-	#Internmediaries
+-	numnodes = 3
+-	
+-	#Initialize Element matrix and basis function derivatives
+-	Ke = ElementMatrix(element.nodes)
+-	dbasis = Matrix{Float64}(undef,numnodes,2)
+-
+-	#Retrieve all inputs and parameters
+-	xyz_list = GetVerticesCoordinates(element.vertices)
+-	H_input  = GetInput(element, ThicknessEnum)
+-
+-	#Prepare material object
+-	material = Matice(element)
+-	
+-	#Start integrating
+-	gauss = GaussTria(2)
+-	for ig in 1:gauss.numgauss
+-
+-		Jdet = JacobianDeterminant(xyz_list, gauss)
+-		NodalFunctionsDerivatives(element,dbasis,xyz_list,gauss)
+-
+-		H  = GetInputValue(H_input, gauss, ig)
+-		mu = ViscositySSA(material, xyz_list, gauss, ig)
+-
+-		for i in 1:numnodes
+-			for j in 1:numnodes
+-				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,1]*dbasis[i,1] + dbasis[j,2]*dbasis[i,2])
+-				Ke.values[2*i-1,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,2]*dbasis[i,1] + dbasis[j,1]*dbasis[i,2])
+-				Ke.values[2*i  ,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,1]*dbasis[i,2] + dbasis[j,2]*dbasis[i,1])
+-				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,2]*dbasis[i,2] + dbasis[j,1]*dbasis[i,1])
+-			end
+-		end
+-	end
+-
+-	#Add basal friction
+-	phi=GetGroundedPortion(element, xyz_list)
+-
+-	if(phi>0)
+-		basis = Vector{Float64}(undef,numnodes)
+-		friction = CoreFriction(element)
+-
+-		#Start integrating
+-		gauss = GaussTria(2)
+-		for ig in 1:gauss.numgauss
+-
+-			Jdet = JacobianDeterminant(xyz_list, gauss)
+-			NodalFunctions(element, basis, gauss, ig, P1Enum)
+-
+-			alpha2 = Alpha2(friction, gauss, ig)
+-
+-			for i in 1:numnodes
+-				for j in 1:numnodes
+-					Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
+-					Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
+-				end
+-			end
+-		end
+-	end
+-
+-	return Ke
+-end #}}}
+-function CreatePVector(analysis::StressbalanceAnalysis,element::Tria)# {{{
+-
+-	#Internmediaries
+-	numnodes = 3
+-
+-	#Initialize Element vectro and basis functions
+-	pe = ElementVector(element.nodes)
+-	basis = Vector{Float64}(undef,numnodes)
+-
+-	#Retrieve all inputs and parameters
+-	xyz_list = GetVerticesCoordinates(element.vertices)
+-	H_input  = GetInput(element, ThicknessEnum)
+-	s_input  = GetInput(element, SurfaceEnum)
+-	rho_ice  = FindParam(element, MaterialsRhoIceEnum)
+-	g        = FindParam(element, ConstantsGEnum)
+-
+-	#Start integrating
+-	gauss = GaussTria(2)
+-	for ig in 1:gauss.numgauss
+-
+-		Jdet = JacobianDeterminant(xyz_list, gauss)
+-		NodalFunctions(element, basis, gauss, ig, P1Enum)
+-
+-		H  = GetInputValue(H_input, gauss, ig)
+-		ds = GetInputDerivativeValue(s_input, xyz_list, gauss, ig)
+-
+-		for i in 1:numnodes
+-			pe.values[2*i-1] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[1]*basis[i]
+-			pe.values[2*i  ] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[2]*basis[i]
+-		end
+-	end
+-
+-	if(IsIcefront(element))
+-
+-		#Get additional parameters and inputs
+-		b_input   = GetInput(element, BaseEnum)
+-		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
+-
+-		#Get normal and ice front coordinates
+-		xyz_list_front = Matrix{Float64}(undef,2,3)
+-		GetIcefrontCoordinates!(element, xyz_list_front, xyz_list, MaskIceLevelsetEnum)
+-		nx, ny = NormalSection(element, xyz_list_front)
+-
+-		gauss = GaussTria(element, xyz_list, xyz_list_front, 3)
+-		for ig in 1:gauss.numgauss
+-
+-			Jdet = JacobianDeterminantSurface(xyz_list_front, gauss)
+-			NodalFunctions(element, basis, gauss, ig, P1Enum)
+-
+-			H  = GetInputValue(H_input, gauss, ig)
+-			b  = GetInputValue(b_input, gauss, ig)
+-			sl = 0
+-
+-			term = 0.5*g*rho_ice*H^2 + 0.5*g*rho_water*(min(0, H+b-sl)^2 - min(0, b-sl)^2)
+-
+-			for i in 1:numnodes
+-				pe.values[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
+-				pe.values[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
+-			end
+-		end
+-	end
+-
+-	return pe
+-end #}}}
+-function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::IssmVector,element::Tria) #{{{
+-
+-	#Get dofs for this finite element
+-	doflist = GetDofList(element,GsetEnum)
+-	@assert length(doflist)==6
+-
+-	#Fetch inputs
+-	vx_input = GetInput(element, VxEnum)
+-	vy_input = GetInput(element, VyEnum)
+-
+-	#Loop over each node and enter solution in ug
+-	count = 0
+-	gauss=GaussTria(P1Enum)
+-	for i in 1:gauss.numgauss
+-		vx = GetInputValue(vx_input, gauss, i)
+-		vy = GetInputValue(vy_input, gauss, i)
+-
+-		count += 1
+-		ug.vector[doflist[count]] = vx
+-		count += 1
+-		ug.vector[doflist[count]] = vy
+-	end
+-
+-	#Make sure we reached all the values
+-	@assert count==length(doflist)
+-
+-end#}}}
+-function InputUpdateFromSolution(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
+-
+-	#Get dofs for this finite element
+-	doflist = GetDofList(element,GsetEnum)
+-
+-	#Get solution vector for this element
+-	numdof   = 3*2
+-	values = Vector{Float64}(undef,numdof)
+-	for i in 1:numdof values[i]=ug[doflist[i]] end
+-
+-	#Now split solution vector into x and y components
+-	numnodes = 3
+-	vx  = Vector{Float64}(undef,numnodes)
+-	vy  = Vector{Float64}(undef,numnodes)
+-	vel = Vector{Float64}(undef,numnodes)
+-	for i in 1:numnodes 
+-		vx[i]=values[2*i-1] 
+-		vy[i]=values[2*i] 
+-		@assert isfinite(vx[i])
+-		@assert isfinite(vy[i])
+-
+-		vel[i] =sqrt(vx[i]^2 + vy[i]^2)
+-	end
+-
+-	AddInput(element, VxEnum,  vx,  P1Enum)
+-	AddInput(element, VyEnum,  vy,  P1Enum)
+-	AddInput(element, VelEnum, vel, P1Enum)
+-end#}}}
+Index: ../trunk-jpl/src/jl/solve/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elements.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/elements.jl	(nonexistent)
+@@ -1,378 +0,0 @@
+-#Tria class definition
+-mutable struct Tria #{{{
+-	sid::Int64
+-	pid::Int64
+-	#vertexids::Int64[3]
+-	#vertices::Vertex[3]
+-	vertexids::Vector{Int64}
+-	vertices::Vector{Vertex}
+-	nodeids::Vector{Int64}
+-	nodes::Vector{Node}
+-	parameters::Parameters
+-	inputs::Inputs
+-end# }}}
+-
+-#Element functions
+-function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
+-	if size(data,1)==inputs.numberofelements
+-		SetTriaInput(inputs,enum,P0Enum,element.sid,data[element.sid])
+-	elseif size(data,1)==inputs.numberofvertices
+-		SetTriaInput(inputs,enum,P1Enum,element.vertexids,data[element.vertexids])
+-	else
+-		error("size ",size(data,1)," not supported yet");
+-	end
+-end #}}}
+-function AddInput(element::Tria,inputenum::IssmEnum,data::Vector{Float64},interpolation::IssmEnum) #{{{
+-	if interpolation==P1Enum
+-		@assert length(data)==3
+-		SetTriaInput(element.inputs,inputenum,P1Enum,element.vertexids,data)
+-	else
+-		error("interpolation ", interpolation, " not supported yet");
+-	end
+-end #}}}
+-function Update(element::Tria,inputs::Inputs,index::Int64,md::model,finiteelement::IssmEnum) #{{{
+-
+-	if finiteelement==P1Enum
+-		numnodes = 3
+-		element.nodeids    = Vector{Int64}(undef,numnodes)
+-		element.nodeids[1] = md.mesh.elements[index,1]
+-		element.nodeids[2] = md.mesh.elements[index,2]
+-		element.nodeids[3] = md.mesh.elements[index,3]
+-	else
+-		error("not supported yet")
+-	end
+-end #}}}
+-function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) # {{{
+-
+-   #Configure vertices
+-   for i in 1:3
+-		element.vertices[i] = vertices[element.vertexids[i]]
+-   end
+-
+-	#Configure nodes (assuming P1 finite elements)
+-	for i in 1:3
+-		element.nodes[i] = nodes[element.nodeids[i]]
+-	end
+-
+-	#Point to real datasets
+-	element.parameters = parameters
+-	element.inputs     = inputs
+-	
+-end # }}}
+-function GetDofList(element::Tria,setenum::IssmEnum) # {{{
+-
+-	#Define number of nodes
+-	numnodes = 3
+-
+-	#Determine size of doflist
+-	numdofs = 0
+-	for i in 1:numnodes
+-		numdofs += GetNumberOfDofs(element.nodes[i],GsetEnum)
+-	end
+-
+-	#Allocate doflist vector
+-	doflist = Vector{Int64}(undef,numdofs)
+-
+-	#enter dofs in doflist vector
+-	count = 0
+-	for i in 1:numnodes
+-		count = GetDofList(element.nodes[i],doflist,count,GsetEnum)
+-	end
+-
+-	return doflist
+-end # }}}
+-function GetInput(element::Tria,enum::IssmEnum) # {{{
+-
+-	input = GetInput(element.inputs,enum)
+-	InputServe!(element,input)
+-	return input
+-
+-end # }}}
+-function GetInputListOnVertices!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
+-
+-	#Get Input first 
+-	input = GetInput(element, enum)
+-
+-	#Get value at each vertex (i.e. P1 Nodes)
+-	gauss=GaussTria(P1Enum)
+-	for i in 1:gauss.numgauss
+-		vector[i] = GetInputValue(input, gauss, i)
+-	end
+-
+-end # }}}
+-function FindParam(element::Tria,enum::IssmEnum) # {{{
+-
+-	return FindParam(element.parameters, enum)
+-
+-end # }}}
+-function InputServe!(element::Tria,input::ElementInput) # {{{
+-
+-	if input.interp==P0Enum
+-		input.element_values[1] = input.values[element.sid]
+-	elseif input.interp==P1Enum
+-		for i in 1:3
+-			input.element_values[i] = input.values[element.vertices[i].sid]
+-		end
+-	else
+-		error("interpolation ",input.interp," not supported yet")
+-	end
+-
+-end # }}}
+-function GetGroundedPortion(element::Tria, xyz_list::Matrix{Float64}) #{{{
+-
+-	level = Vector{Float64}(undef,3)
+-	GetInputListOnVertices!(element, level, MaskOceanLevelsetEnum)
+-
+-	#Be sure that values are not zero
+-	epsilon = 1.e-15
+-	for i in 1:3
+-		if(level[i]==0.) level[i]=level[i]+epsilon end
+-	end
+-
+-	if level[1]>0 && level[2]>0 && level[3]>0
+-      #Completely grounded
+-		phi = 1.0
+-   elseif level[1]<0 && level[2]<0 && level[3]<0
+-      #Completely floating
+-      phi = 0.0
+-   else
+-		#Partially floating,
+-		if(level[1]*level[2]>0) #Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+-			s1=level[3]/(level[3]-level[2]);
+-			s2=level[3]/(level[3]-level[1]);
+-		elseif(level[2]*level[3]>0) #Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+-			s1=level[1]/(level[1]-level[2]);
+-			s2=level[1]/(level[1]-level[3]);
+-		elseif(level[1]*level[3]>0) #Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+-			s1=level[2]/(level[2]-level[1]);
+-			s2=level[2]/(level[2]-level[3]);
+-		else
+-			error("not supposed to be here...")
+-		end
+-
+-		if(level[1]*level[2]*level[3]>0)
+-			phi = s1*s2
+-		else
+-			phi = (1-s1*s2)
+-		end
+-	end
+-
+-	return phi
+-end#}}}
+-function IsIcefront(element::Tria) #{{{
+-
+-	level = Vector{Float64}(undef,3)
+-	GetInputListOnVertices!(element, level, MaskIceLevelsetEnum)
+-
+-	nbice = 0
+-	for i in 1:3
+-		if(level[i]<0.) nbice+=1 end
+-	end
+-
+-	if(nbice==1)
+-		return true
+-	else
+-		return false
+-	end
+-end#}}}
+-function GetIcefrontCoordinates!(element::Tria, xyz_front::Matrix{Float64}, xyz_list::Matrix{Float64}, levelsetenum::IssmEnum) #{{{
+-
+-	#Intermediaries
+-	level        = Vector{Float64}(undef,3)
+-	indicesfront = Vector{Int64}(undef,3)
+-
+-	#Recover value of levelset for all vertices
+-	GetInputListOnVertices!(element, level, levelsetenum)
+-
+-	#Get nodes where there is no ice
+-	num_frontnodes = 0
+-	for i in 1:3
+-		if(level[i]>=0.)
+-			num_frontnodes += 1
+-			indicesfront[num_frontnodes] = i
+-		end
+-	end
+-	@assert num_frontnodes==2
+-
+-	#Arrange order of frontnodes such that they are oriented counterclockwise
+-	NUMVERTICES = 3
+-	if((NUMVERTICES+indicesfront[1]-indicesfront[2])%NUMVERTICES != NUMVERTICES-1)
+-		index=indicesfront[1]
+-		indicesfront[1]=indicesfront[2]
+-		indicesfront[2]=index
+-	end
+-
+-	#Return nodes
+-	xyz_front[1,:]=xyz_list[indicesfront[1],:]
+-	xyz_front[2,:]=xyz_list[indicesfront[2],:]
+-
+-end#}}}
+-function GetArea(element::Tria)#{{{
+-
+-	#Get xyz list
+-	xyz_list = GetVerticesCoordinates(element.vertices)
+-	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
+-	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
+-	x3 = xyz_list[3,1]; y3 = xyz_list[3,2]
+-
+-	@assert x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0
+-	return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2
+-end#}}}
+-function NormalSection(element::Tria, xyz_front::Matrix{Float64}) #{{{
+-
+-	#Build output pointing vector
+-	nx =  xyz_front[2,2] - xyz_front[1,2]
+-	ny = -xyz_front[2,1] + xyz_front[1,1]
+-
+-	#normalize
+-	norm = sqrt(nx^2 + ny^2)
+-	nx = nx/norm
+-	ny = ny/norm
+-
+-	return nx, ny
+-end#}}}
+-
+-#Finite Element stuff
+-function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+-
+-	#Get Jacobian Matrix
+-	J = Jacobian(xyz_list)
+-
+-	#Get its determinant
+-	Jdet = Matrix2x2Determinant(J)
+-
+-	#check and return
+-	if(Jdet<0) error("negative Jacobian Determinant") end
+-	return Jdet
+-
+-end#}}}
+-function JacobianDeterminantSurface(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+-
+-	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
+-	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
+-	Jdet = .5*sqrt((x2-x1)^2 + (y2-y1)^2)
+-
+-	#check and return
+-	if(Jdet<0) error("negative Jacobian Determinant") end
+-	return Jdet
+-
+-end#}}}
+-function Jacobian(xyz_list::Matrix{Float64}) #{{{
+-
+-	J = Matrix{Float64}(undef,2,2)
+-
+-	x1 = xyz_list[1,1]
+-	y1 = xyz_list[1,2]
+-	x2 = xyz_list[2,1]
+-	y2 = xyz_list[2,2]
+-	x3 = xyz_list[3,1]
+-	y3 = xyz_list[3,2]
+-
+-	J[1,1] = .5*(x2-x1)
+-	J[1,2] = .5*(y2-y1)
+-	J[2,1] = sqrt(3)/6*(2*x3 -x1 -x2)
+-	J[2,2] = sqrt(3)/6*(2*y3 -y1 -y2)
+-
+-	return J
+-end#}}}
+-function JacobianInvert(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+-
+-	#Get Jacobian matrix
+-	J = Jacobian(xyz_list)
+-
+-	#Get its determinant
+-	Jinv = Matrix2x2Invert(J)
+-
+-	return Jinv
+-end#}}}
+-function NodalFunctions(element::Tria,basis::Vector{Float64}, gauss::GaussTria, ig::Int64, finiteelement::IssmEnum) #{{{
+-
+-	if(finiteelement==P0Enum)
+-		#Nodal function 1
+-		basis[1]= 1
+-	elseif(finiteelement==P1Enum)
+-		basis[1] = gauss.coords1[ig]
+-		basis[2] = gauss.coords2[ig]
+-		basis[3] = gauss.coords3[ig]
+-	else
+-		error("Element type ",finiteelement," not supported yet")
+-	end
+-
+-
+-end#}}}
+-function NodalFunctionsDerivatives(element::Tria,dbasis::Matrix{Float64},xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+-
+-	#Get nodal function derivatives in reference element
+-	dbasis_ref = Matrix{Float64}(undef,3,2)
+-	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,P1Enum)
+-
+-	#Get invert of the Jacobian
+-	Jinv = JacobianInvert(xyz_list,gauss)
+-
+-	#Build dbasis:
+-	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
+-	#[ dNi/dy ] =        [dNhat_i/ds]
+-	for i in 1:3
+-		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
+-		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
+-	end
+-
+-end#}}}
+-function NodalFunctionsDerivativesReferenceTria(dbasis::Matrix{Float64}, gauss::GaussTria, finiteelement::IssmEnum) #{{{
+-
+-	if(finiteelement==P0Enum)
+-		#Nodal function 1
+-		dbasis[1,1]= 0
+-		dbasis[1,2]= 0
+-
+-	elseif(finiteelement==P1Enum)
+-		#Nodal function 1
+-		dbasis[1,1]= -.5
+-		dbasis[1,2]= -sqrt(3)/6
+-		#Nodal function 2
+-		dbasis[2,1]= .5
+-		dbasis[2,2]= -sqrt(3)/6
+-		#Nodal function 3
+-		dbasis[3,1]= 0
+-		dbasis[3,2]= sqrt(3)/3
+-	else
+-		error("Element type ",finiteelement," not supported yet")
+-	end
+-end#}}}
+-function NumberofNodesTria(finiteelement) #{{{
+-
+-	if    (finiteelement==P0Enum) return 0
+-	elseif(finiteelement==P1Enum) return 3
+-	else
+-		error("Element type ",finiteelement," not supported yet")
+-	end
+-end#}}}
+-function GaussTria(element::Tria, xyz_list::Matrix{Float64}, xyz_list_front::Matrix{Float64}, order::Int64) #{{{
+-
+-	area_coordinates = Matrix{Float64}(undef,2,3)
+-	GetAreaCoordinates!(element, area_coordinates, xyz_list_front, xyz_list)
+-
+-	return GaussTria(area_coordinates, order)
+-end# }}}
+-function GetAreaCoordinates!(element::Tria, area_coordinates::Matrix{Float64}, xyz_zero::Matrix{Float64}, xyz_list::Matrix{Float64})#{{{
+-
+-	numpoints = size(area_coordinates,1)
+-	area = GetArea(element)
+-
+-	#Copy original xyz_list
+-	xyz_bis=copy(xyz_list)
+-	for i in 1:numpoints
+-		for j in 1:3
+-
+-			#Change appropriate line
+-			xyz_bis[j,:] = xyz_zero[i,:]
+-
+-			#Compute area fraction
+-			area_portion=abs(xyz_bis[2,1]*xyz_bis[3,2] - xyz_bis[2,2]*xyz_bis[3,1] + xyz_bis[1,1]*xyz_bis[2,2] - xyz_bis[1,2]*xyz_bis[2,1] + xyz_bis[3,1]*xyz_bis[1,2] - xyz_bis[3,2]*xyz_bis[1,1])/2
+-			area_coordinates[i,j] = area_portion/area
+-
+-			#reinitialize xyz_list
+-			xyz_bis[j,:] = xyz_list[j,:]
+-		end
+-	end
+-end #}}}
+Index: ../trunk-jpl/src/jl/solve/friction.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/friction.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/friction.jl	(nonexistent)
+@@ -1,43 +0,0 @@
+-#Friction class definition
+-
+-abstract type CoreFriction end
+-struct CoreBuddFriction#{{{
+-	H_input::ElementInput
+-	b_input::ElementInput
+-	c_input::ElementInput
+-	rho_ice::Float64
+-	rho_water::Float64
+-	g::Float64
+-end# }}}
+-function CoreFriction(element::Tria) #{{{
+-
+-	frictionlaw = FindParam(element, FrictionLawEnum)
+-
+-	if frictionlaw==1
+-		H_input  = GetInput(element, ThicknessEnum)
+-		b_input  = GetInput(element, BaseEnum)
+-		c_input  = GetInput(element, FrictionCoefficientEnum)
+-
+-		rho_ice   = FindParam(element, MaterialsRhoIceEnum)
+-		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
+-		g         = FindParam(element, ConstantsGEnum)
+-
+-		return CoreBuddFriction(H_input, b_input, c_input, rho_ice, rho_water, g)
+-	else
+-		error("Friction ",typeof(md.friction)," not supported yet")
+-	end
+-end#}}}
+-
+-#vertices functions
+-function Alpha2(friction::CoreBuddFriction, gauss::GaussTria, i::Int64) #{{{
+-
+-	#Get effective pressure
+-	H = GetInputValue(friction.H_input, gauss, i)
+-	b = GetInputValue(friction.b_input, gauss, i)
+-	c = GetInputValue(friction.c_input, gauss, i)
+-	N = friction.rho_ice*friction.g*H + friction.rho_water*friction.g*b
+-
+-	if(N<0) N=0 end
+-
+-	return c^2*N
+-end #}}}
+Index: ../trunk-jpl/src/jl/solve/elementmatrix.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/elementmatrix.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/elementmatrix.jl	(nonexistent)
+@@ -1,117 +0,0 @@
+-mutable struct ElementMatrix#{{{
+-	nrows::Int64
+-	gglobaldoflist::Vector{Int64}
+-	fglobaldoflist::Vector{Int64}
+-	sglobaldoflist::Vector{Int64}
+-	values::Matrix{Float64}
+-end #}}}
+-function ElementMatrix(nodes::Vector{Node})#{{{
+-
+-	#Get matrix size
+-	nrows = NumberOfDofs(nodes,GsetEnum)
+-
+-	#Initialize element matrix with zeros
+-	values = zeros(nrows,nrows)
+-
+-	#Get dof lists
+-	gglobaldoflist=GetGlobalDofList(nodes,nrows,GsetEnum)
+-	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
+-	sglobaldoflist=GetGlobalDofList(nodes,nrows,SsetEnum)
+-
+-	return ElementMatrix(nrows,gglobaldoflist,fglobaldoflist,sglobaldoflist,values)
+-end#}}}
+-function Base.show(io::IO, this::ElementMatrix)# {{{
+-
+-	println(io,"ElementMatrix:")
+-	println(io,"   nrows: ",this.nrows)
+-	println(io,"   gglobaldoflist: ",this.gglobaldoflist)
+-	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
+-	println(io,"   sglobaldoflist: ",this.sglobaldoflist)
+-	print(io,"   values: ")
+-	display(this.values)
+-end# }}}
+-function AddToGlobal!(Ke::ElementMatrix,Kff::IssmMatrix,Kfs::IssmMatrix)#{{{
+-
+-	#First check that the element matrix looks alright
+-	CheckConsistency(Ke)
+-
+-	#See if we need to do anything
+-	is_fset = false
+-	is_sset = false
+-	for i in 1:Ke.nrows
+-		if(Ke.fglobaldoflist[i]>0) is_fset = true end
+-		if(Ke.sglobaldoflist[i]>0) is_sset = true end
+-	end
+-
+-	if is_fset
+-		AddValues!(Kff,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.fglobaldoflist,Ke.values)
+-	end
+-	if is_sset
+-		AddValues!(Kfs,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.sglobaldoflist,Ke.values)
+-	end
+-
+-end#}}}
+-function CheckConsistency(Ke::ElementMatrix)#{{{
+-
+-	for i in 1:Ke.nrows
+-		for j in 1:Ke.nrows
+-			if(isnan(Ke.values[i,j])) error("NaN found in Element Matrix") end
+-			if(isinf(Ke.values[i,j])) error("Inf found in Element Matrix") end
+-			if(abs(Ke.values[i,j])>1.e+50) error("Element Matrix values exceeds 1.e+50") end
+-		end
+-	end
+-end#}}}
+-
+-mutable struct ElementVector#{{{
+-	nrows::Int64
+-	fglobaldoflist::Vector{Int64}
+-	values::Vector{Float64}
+-end #}}}
+-function ElementVector(nodes::Vector{Node})#{{{
+-
+-	#Get matrix size
+-	nrows = NumberOfDofs(nodes,GsetEnum)
+-
+-	#Initialize element matrix with zeros
+-	values = zeros(nrows)
+-
+-	#Get dof list
+-	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
+-
+-	return ElementVector(nrows,fglobaldoflist,values)
+-end#}}}
+-function Base.show(io::IO, this::ElementVector)# {{{
+-
+-	println(io,"ElementVector:")
+-	println(io,"   nrows: ",this.nrows)
+-	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
+-	print(io,"   values: ")
+-	display(this.values)
+-end# }}}
+-function AddToGlobal!(pe::ElementVector,pf::IssmVector)#{{{
+-
+-	#First check that the element matrix looks alright
+-	CheckConsistency(pe)
+-
+-	#See if we need to do anything
+-	is_fset = false
+-	for i in 1:pe.nrows
+-		if(pe.fglobaldoflist[i]>0)
+-			is_fset = true 
+-			break
+-		end
+-	end
+-
+-	if is_fset
+-		AddValues!(pf,pe.nrows,pe.fglobaldoflist,pe.values)
+-	end
+-
+-end#}}}
+-function CheckConsistency(pe::ElementVector)#{{{
+-
+-	for i in 1:pe.nrows
+-		if(isnan(pe.values[i])) error("NaN found in Element Vector") end
+-		if(isinf(pe.values[i])) error("Inf found in Element Vector") end
+-		if(abs(pe.values[i])>1.e+50) error("Element Vector values exceeds 1.e+50") end
+-	end
+-end#}}}
+Index: ../trunk-jpl/src/jl/solve/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/inputs.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/inputs.jl	(nonexistent)
+@@ -1,152 +0,0 @@
+-#Input class definition
+-abstract type Input end
+-struct BoolInput <: Input#{{{
+-	enum::IssmEnum
+-	values::Matrix{Bool}
+-end# }}}
+-struct IntInput <: Input#{{{
+-	enum::IssmEnum
+-	values::Matrix{Int64}
+-end# }}}
+-struct ElementInput <: Input#{{{
+-	enum::IssmEnum
+-	interp::IssmEnum
+-	values::Vector{Float64}
+-	element_values::Vector{Float64}
+-end# }}}
+-
+-#Inputs dataset definition
+-mutable struct Inputs #{{{
+-	numberofelements::Int64
+-	numberofvertices::Int64
+-	lookup::Dict{IssmEnum,Input}
+-end# }}}
+-
+-#Inputs functions
+-function GetInput(inputs::Inputs,enum::IssmEnum) #{{{
+-
+-	#Does this input exist
+-	if !haskey(inputs.lookup,enum)
+-		error("Input ",enum," not found")
+-	end
+-
+-	#return input
+-	return inputs.lookup[enum]
+-
+-end#}}}
+-function SetInput(inputs::Inputs,enum::IssmEnum,index::Int64,value::Bool) #{{{
+-
+-	#Does this input exist
+-	if !haskey(inputs.lookup,enum)
+-		#it does not exist yet, we need to create it...
+-		@assert inputs.numberofelements > 0
+-		input = BoolInput(enum,zeros(Bool,inputs.numberofelements))
+-		inputs.lookup[enum] = BoolInput(enum,zeros(Bool,inputs.numberofelements))
+-	end
+-
+-	#Get this input and check type
+-	input = inputs.lookup[enum]
+-	if typeof(input)!=BoolInput error("not consistent") end
+-
+-	#set value
+-	@assert index>0 && index<=inputs.numberofelements
+-	input.values[index] = value
+-end#}}}
+-function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int64,value::Float64) #{{{
+-
+-	#Does this input exist
+-	if !haskey(inputs.lookup,enum)
+-		#it does not exist yet, we need to create it...
+-		@assert inputs.numberofelements > 0
+-		if interp==P0Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements),Vector{Float64}(undef,1))
+-		elseif interp==P1Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
+-		else
+-			error("not supported yet")
+-		end
+-	end
+-
+-	#Get this input and check type
+-	input = inputs.lookup[enum]
+-	if typeof(input)!=ElementInput error("input type not consistent") end
+-	if interp!=input.interp        error("input interpolations not consistent") end
+-
+-	#set value
+-	input.values[index] = value
+-end#}}}
+-function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int64},values::Vector{Float64}) #{{{
+-
+-	#Does this input exist
+-	if !haskey(inputs.lookup,enum)
+-		#it does not exist yet, we need to create it...
+-		@assert inputs.numberofvertices>0
+-		if interp==P1Enum
+-			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
+-		else
+-			error("not supported yet")
+-		end
+-	end
+-
+-	#Get this input and check type
+-	input = inputs.lookup[enum]
+-	if typeof(input)!=ElementInput error("input type not consistent") end
+-	if interp!=input.interp        error("input interpolations not consistent") end
+-
+-	#set value
+-	input.values[indices] = values
+-end#}}}
+-function GetInputAverageValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
+-
+-	numnodes = NumberofNodesTria(input.interp)
+-	value = 0.0
+-
+-	for i in 1:numnodes
+-		value+=input.element_values[i]
+-	end
+-
+-	return value/numnodes
+-
+-end#}}}
+-function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
+-
+-	if input.interp==P0Enum
+-		return input.element_values[1]
+-	elseif input.interp==P1Enum
+-		value = input.element_values[1]*gauss.coords1[i] +  input.element_values[2]*gauss.coords2[i] +  input.element_values[3]*gauss.coords3[i]
+-	else
+-		error("not implemented yet")
+-	end
+-
+-	return value
+-
+-end#}}}
+-function GetInputDerivativeValue(input::ElementInput,xyz_list::Matrix{Float64},gauss::GaussTria,i::Int64) #{{{
+-
+-	#Get nodal function derivatives in reference element
+-	numnodes = NumberofNodesTria(input.interp)
+-	dbasis_ref = Matrix{Float64}(undef,numnodes,2)
+-	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,input.interp)
+-
+-	#Get invert of the Jacobian
+-	Jinv = JacobianInvert(xyz_list,gauss)
+-
+-	#Build dbasis:
+-	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
+-	#[ dNi/dy ] =        [dNhat_i/ds]
+-	dbasis = Matrix{Float64}(undef,numnodes,2)
+-	for i in 1:3
+-		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
+-		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
+-	end
+-
+-	#Get derivatives: dp/dx dp/dy
+-	dp = [0.0;0.0]
+-	for i in 1:3
+-		dp[1] += dbasis[i,1]*input.element_values[i]
+-		dp[2] += dbasis[i,2]*input.element_values[i]
+-	end
+-
+-	return dp
+-
+-end#}}}
+Index: ../trunk-jpl/src/jl/solve/gauss.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/gauss.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/gauss.jl	(nonexistent)
+@@ -1,113 +0,0 @@
+-#Gauss class definition
+-struct GaussTria #{{{
+-	numgauss::Int64
+-	weights::Vector{Float64}
+-	coords1::Vector{Float64}
+-	coords2::Vector{Float64}
+-	coords3::Vector{Float64}
+-end #}}}
+-function Base.show(io::IO, this::GaussTria)# {{{
+-
+-	println(io,"GaussTria:")
+-	println(io,"   numgauss: ",this.numgauss)
+-	println(io,"   weights:  ",this.weights)
+-	println(io,"   coords1:  ",this.coords1)
+-	println(io,"   coords2:  ",this.coords2)
+-	println(io,"   coords3:  ",this.coords3)
+-end# }}}
+-
+-#Gauss constructor
+-function GaussTria(order::Int64) #{{{
+-
+-	#=Gauss quadrature points for the triangle.
+-	Higher-order points from D.A. Dunavant, "High Degree Efficient
+-	Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
+-	Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.=#
+-
+-	if(order==1)
+-		npoints = 1
+-		weights = [1.732050807568877]
+-		coords1 = [0.333333333333333]
+-		coords2 = [0.333333333333333]
+-		coords3 = [0.333333333333333]
+-	elseif(order==2)
+-		npoints = 3
+-		weights = [0.577350269189625; 0.577350269189625; 0.577350269189625]
+-		coords1 = [0.666666666666667; 0.166666666666667; 0.166666666666667]
+-		coords2 = [0.166666666666667; 0.666666666666667; 0.166666666666667]
+-		coords3 = [0.166666666666667; 0.166666666666667; 0.666666666666667]
+-	elseif(order==3)
+-		npoints = 4
+-		weights = [-0.974278579257493; 0.902109795608790; 0.902109795608790; 0.902109795608790]
+-		coords1 = [ 0.333333333333333; 0.600000000000000; 0.200000000000000; 0.200000000000000]
+-		coords2 = [ 0.333333333333333; 0.200000000000000; 0.600000000000000; 0.200000000000000]
+-		coords3 = [ 0.333333333333333; 0.200000000000000; 0.200000000000000; 0.600000000000000]
+-	else
+-		error("order ",order," not supported yet");
+-	end
+-
+-	return GaussTria(npoints,weights,coords1,coords2,coords3)
+-end# }}}
+-function GaussTria(finiteelement::IssmEnum) #{{{
+-
+-	if(finiteelement==P0Enum)
+-		npoints = 1
+-		weights = [1.]
+-		coords1 = [0.333333333333333]
+-		coords2 = [0.333333333333333]
+-		coords3 = [0.333333333333333]
+-	elseif(finiteelement==P1Enum)
+-			npoints = 3
+-			weights = 0.333333333333333*ones(3)
+-			coords1 = [1.; 0.; 0.]
+-			coords2 = [0.; 1.; 0.]
+-			coords3 = [0.; 0.; 1.]
+-	else
+-		error("finite element ", finiteelement," not supported yet");
+-	end
+-
+-	return GaussTria(npoints,weights,coords1,coords2,coords3)
+-end# }}}
+-function GaussTria(area_coordinates::Matrix{Float64}, order::Int64) #{{{
+-	#=Gauss-Legendre quadrature points.
+-
+-	The recurrence coefficients for Legendre polynomials on (-1,1)
+-	are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
+-
+-	alpha(i)=0.
+-	beta (i)=1./(4.-1./(i-1)^2))
+-
+-	For degree p, the required number of Gauss-Legendre points is
+-	n>=(p+1)/2.=#
+-
+-	if(order==1)
+-		npoint  = 1
+-		weights = [2.000000000000000]
+-		coords  = [0.000000000000000]
+-	elseif(order==2)
+-		npoints = 2
+-		weights = [1.000000000000000, 1.000000000000000]
+-		coords  = [-0.577350269189626, 0.577350269189626]
+-	elseif(order==3)
+-		npoints = 3
+-		weights = [0.555555555555556, 0.888888888888889, 0.555555555555556]
+-		coords  = [-0.774596669241483, 0.000000000000000, 0.774596669241483]
+-	elseif(order==4)
+-		npoints = 4
+-		weights = [0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454]
+-		coords  = [-0.861136311594053,-0.339981043584856, 0.339981043584856, 0.861136311594053]
+-	else
+-      error("order ",order," not supported yet");
+-	end
+-
+-   coords1  = Vector{Float64}(undef,npoints)
+-   coords2  = Vector{Float64}(undef,npoints)
+-   coords3  = Vector{Float64}(undef,npoints)
+-   for i in 1:npoints
+-      coords1[i]  = 0.5*(area_coordinates[1,1]+area_coordinates[2,1]) + 0.5*coords[i]*(area_coordinates[2,1]-area_coordinates[1,1]);
+-      coords2[i]  = 0.5*(area_coordinates[1,2]+area_coordinates[2,2]) + 0.5*coords[i]*(area_coordinates[2,2]-area_coordinates[1,2]);
+-      coords3[i]  = 0.5*(area_coordinates[1,3]+area_coordinates[2,3]) + 0.5*coords[i]*(area_coordinates[2,3]-area_coordinates[1,3]);
+-   end
+-
+-	return GaussTria(npoints, weights, coords1, coords2, coords3)
+-end# }}}
+Index: ../trunk-jpl/src/jl/solve/issmenums.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/issmenums.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/issmenums.jl	(nonexistent)
+@@ -1,1544 +0,0 @@
+-@enum IssmEnum begin
+-	ParametersSTARTEnum
+-	#Parameters{{{
+-	AdolcParamEnum
+-	AmrDeviatoricErrorGroupThresholdEnum
+-	AmrDeviatoricErrorMaximumEnum
+-	AmrDeviatoricErrorResolutionEnum
+-	AmrDeviatoricErrorThresholdEnum
+-	AmrErrEnum
+-	AmrFieldEnum
+-	AmrGradationEnum
+-	AmrGroundingLineDistanceEnum
+-	AmrGroundingLineResolutionEnum
+-	AmrHmaxEnum
+-	AmrHminEnum
+-	AmrIceFrontDistanceEnum
+-	AmrIceFrontResolutionEnum
+-	AmrKeepMetricEnum
+-	AmrLagEnum
+-	AmrLevelMaxEnum
+-	AmrRestartEnum
+-	AmrThicknessErrorGroupThresholdEnum
+-	AmrThicknessErrorMaximumEnum
+-	AmrThicknessErrorResolutionEnum
+-	AmrThicknessErrorThresholdEnum
+-	AmrTypeEnum
+-	AnalysisCounterEnum
+-	AnalysisTypeEnum
+-	AugmentedLagrangianREnum
+-	AugmentedLagrangianRholambdaEnum
+-	AugmentedLagrangianRhopEnum
+-	AugmentedLagrangianRlambdaEnum
+-	AugmentedLagrangianThetaEnum
+-	AutodiffCbufsizeEnum
+-	AutodiffDependentObjectsEnum
+-	AutodiffDriverEnum
+-	AutodiffFosForwardIndexEnum
+-	AutodiffFosReverseIndexEnum
+-	AutodiffFovForwardIndicesEnum
+-	AutodiffGcTriggerMaxSizeEnum
+-	AutodiffGcTriggerRatioEnum
+-	AutodiffIsautodiffEnum
+-	AutodiffLbufsizeEnum
+-	AutodiffNumDependentsEnum
+-	AutodiffNumIndependentsEnum
+-	AutodiffObufsizeEnum
+-	AutodiffTapeAllocEnum
+-	AutodiffTbufsizeEnum
+-	AutodiffXpEnum
+-	BalancethicknessStabilizationEnum
+-	BarystaticContributionsEnum
+-	BasalforcingsBottomplumedepthEnum
+-	BasalforcingsCrustthicknessEnum
+-	BasalforcingsDeepwaterElevationEnum
+-	BasalforcingsDeepwaterMeltingRateEnum
+-	BasalforcingsDtbgEnum
+-	BasalforcingsEnum
+-	BasalforcingsIsmip6AverageTfEnum
+-	BasalforcingsIsmip6BasinAreaEnum
+-	BasalforcingsIsmip6DeltaTEnum
+-	BasalforcingsIsmip6Gamma0Enum
+-	BasalforcingsIsmip6IsLocalEnum
+-	BasalforcingsIsmip6NumBasinsEnum
+-	BasalforcingsIsmip6TfDepthsEnum
+-	BasalforcingsLowercrustheatEnum
+-	BasalforcingsMantleconductivityEnum
+-	BasalforcingsNusseltEnum
+-	BasalforcingsPicoAverageOverturningEnum
+-	BasalforcingsPicoAverageSalinityEnum
+-	BasalforcingsPicoAverageTemperatureEnum
+-	BasalforcingsPicoBoxAreaEnum
+-	BasalforcingsPicoFarOceansalinityEnum
+-	BasalforcingsPicoFarOceantemperatureEnum
+-	BasalforcingsPicoGammaTEnum
+-	BasalforcingsPicoIsplumeEnum
+-	BasalforcingsPicoMaxboxcountEnum
+-	BasalforcingsPicoNumBasinsEnum
+-	BasalforcingsPlumeradiusEnum
+-	BasalforcingsPlumexEnum
+-	BasalforcingsPlumeyEnum
+-	BasalforcingsThresholdThicknessEnum
+-	BasalforcingsTopplumedepthEnum
+-	BasalforcingsUppercrustheatEnum
+-	BasalforcingsUppercrustthicknessEnum
+-	BasalforcingsUpperdepthMeltEnum
+-	BasalforcingsUpperwaterElevationEnum
+-	BasalforcingsUpperwaterMeltingRateEnum
+-	CalvingCrevasseDepthEnum
+-	CalvingCrevasseThresholdEnum
+-	CalvingHeightAboveFloatationEnum
+-	CalvingLawEnum
+-	CalvingMinthicknessEnum
+-	ConfigurationTypeEnum
+-	ConstantsGEnum
+-	ConstantsNewtonGravityEnum
+-	ConstantsReferencetemperatureEnum
+-	ConstantsYtsEnum
+-	ControlInputSizeMEnum
+-	ControlInputSizeNEnum
+-	ControlInputInterpolationEnum
+-	CumBslcEnum
+-	CumBslcIceEnum
+-	CumBslcHydroEnum
+-	CumBslcOceanEnum
+-	CumBslcIcePartitionEnum
+-	CumBslcHydroPartitionEnum
+-	CumBslcOceanPartitionEnum
+-	CumGmtslcEnum
+-	CumGmslcEnum
+-	DamageC1Enum
+-	DamageC2Enum
+-	DamageC3Enum
+-	DamageC4Enum
+-	DamageEnum
+-	DamageEquivStressEnum
+-	DamageEvolutionNumRequestedOutputsEnum
+-	DamageEvolutionRequestedOutputsEnum
+-	DamageHealingEnum
+-	DamageKappaEnum
+-	DamageLawEnum
+-	DamageMaxDamageEnum
+-	DamageStabilizationEnum
+-	DamageStressThresholdEnum
+-	DamageStressUBoundEnum
+-	DebugProfilingEnum
+-	DomainDimensionEnum
+-	DomainTypeEnum
+-	DslModelEnum
+-	DslModelidEnum
+-	DslNummodelsEnum
+-	SolidearthIsExternalEnum
+-	SolidearthExternalNatureEnum
+-	SolidearthExternalModelidEnum
+-	SolidearthExternalNummodelsEnum
+-	SolidearthSettingsComputeBpGrdEnum
+-	EarthIdEnum
+-	ElasticEnum
+-	EplZigZagCounterEnum
+-	EsaHElasticEnum
+-	EsaHemisphereEnum
+-	EsaRequestedOutputsEnum
+-	EsaUElasticEnum
+-	ExtrapolationVariableEnum
+-	FemModelCommEnum
+-	FieldsEnum
+-	FlowequationFeFSEnum
+-	FlowequationIsFSEnum
+-	FlowequationIsHOEnum
+-	FlowequationIsL1L2Enum
+-	FlowequationIsMLHOEnum
+-	FlowequationIsSIAEnum
+-	FlowequationIsSSAEnum
+-	FlowequationIsNitscheEnum
+-	FeFSNitscheGammaEnum
+-	FrictionCouplingEnum
+-	FrictionDeltaEnum
+-	FrictionEffectivePressureLimitEnum
+-	FrictionFEnum
+-	FrictionGammaEnum
+-	FrictionLawEnum
+-	FrictionPseudoplasticityExponentEnum
+-	FrictionThresholdSpeedEnum
+-	FrictionVoidRatioEnum
+-	FrontalForcingsBasinIcefrontAreaEnum
+-	FrontalForcingsNumberofBasinsEnum
+-	FrontalForcingsParamEnum
+-	GrdModelEnum
+-	GroundinglineFrictionInterpolationEnum
+-	GroundinglineMeltInterpolationEnum
+-	GroundinglineMigrationEnum
+-	HydrologyAveragingEnum
+-	HydrologyCavitySpacingEnum
+-	HydrologyChannelConductivityEnum
+-	HydrologyChannelSheetWidthEnum
+-	HydrologyEnglacialVoidRatioEnum
+-	HydrologyIschannelsEnum
+-	HydrologyMeltFlagEnum
+-	HydrologyModelEnum
+-	HydrologyNumRequestedOutputsEnum
+-	HydrologyPressureMeltCoefficientEnum
+-	HydrologyRelaxationEnum
+-	HydrologyRequestedOutputsEnum
+-	HydrologySedimentKmaxEnum
+-	HydrologyStepsPerStepEnum
+-	HydrologyStorageEnum
+-	HydrologydcEplColapseThicknessEnum
+-	HydrologydcEplConductivityEnum
+-	HydrologydcEplInitialThicknessEnum
+-	HydrologydcEplLayerCompressibilityEnum
+-	HydrologydcEplMaxThicknessEnum
+-	HydrologydcEplPoreWaterMassEnum
+-	HydrologydcEplThickCompEnum
+-	HydrologydcEplflipLockEnum
+-	HydrologydcIsefficientlayerEnum
+-	HydrologydcLeakageFactorEnum
+-	HydrologydcMaxIterEnum
+-	HydrologydcPenaltyFactorEnum
+-	HydrologydcPenaltyLockEnum
+-	HydrologydcRelTolEnum
+-	HydrologydcSedimentlimitEnum
+-	HydrologydcSedimentlimitFlagEnum
+-	HydrologydcSedimentLayerCompressibilityEnum
+-	HydrologydcSedimentPoreWaterMassEnum
+-	HydrologydcSedimentPorosityEnum
+-	HydrologydcSedimentThicknessEnum
+-	HydrologydcTransferFlagEnum
+-	HydrologydcUnconfinedFlagEnum
+-	HydrologyshreveStabilizationEnum
+-	IcecapToEarthCommEnum
+-	IndexEnum
+-	InputFileNameEnum
+-	DirectoryNameEnum
+-	IndicesEnum
+-	InputToDepthaverageInEnum
+-	InputToDepthaverageOutEnum
+-	InputToExtrudeEnum
+-	InputToL2ProjectEnum
+-	InputToSmoothEnum
+-	InversionAlgorithmEnum
+-	InversionControlParametersEnum
+-	InversionControlScalingFactorsEnum
+-	InversionCostFunctionsEnum
+-	InversionDxminEnum
+-	InversionGatolEnum
+-	InversionGradientScalingEnum
+-	InversionGrtolEnum
+-	InversionGttolEnum
+-	InversionIncompleteAdjointEnum
+-	InversionIscontrolEnum
+-	InversionMaxiterEnum
+-	InversionMaxiterPerStepEnum
+-	InversionMaxstepsEnum
+-	InversionNstepsEnum
+-	InversionNumControlParametersEnum
+-	InversionNumCostFunctionsEnum
+-	InversionStepThresholdEnum
+-	InversionTypeEnum
+-	IvinsEnum
+-	IsSlcCouplingEnum
+-	LevelsetKillIcebergsEnum
+-	LevelsetReinitFrequencyEnum
+-	LevelsetStabilizationEnum
+-	LockFileNameEnum
+-	LoveAllowLayerDeletionEnum
+-	LoveCoreMantleBoundaryEnum
+-	LoveEarthMassEnum
+-	LoveForcingTypeEnum
+-	LoveFrequenciesEnum
+-	LoveIsTemporalEnum
+-	LoveG0Enum
+-	LoveGravitationalConstantEnum
+-	LoveInnerCoreBoundaryEnum
+-	LoveComplexComputationEnum
+-	LoveIntStepsPerLayerEnum
+-	LoveKernelsEnum
+-	LoveMu0Enum
+-	LoveNfreqEnum
+-	LoveNTemporalIterationsEnum
+-	LoveNYiEquationsEnum
+-	LoveR0Enum
+-	LoveShNmaxEnum
+-	LoveShNminEnum
+-	LoveStartingLayerEnum
+-	LoveUnderflowTolEnum
+-	MassFluxSegmentsEnum
+-	MassFluxSegmentsPresentEnum
+-	MasstransportHydrostaticAdjustmentEnum
+-	MasstransportIsfreesurfaceEnum
+-	MasstransportMinThicknessEnum
+-	MasstransportNumRequestedOutputsEnum
+-	MasstransportPenaltyFactorEnum
+-	MasstransportRequestedOutputsEnum
+-	MasstransportStabilizationEnum
+-	MaterialsBetaEnum
+-	MaterialsEarthDensityEnum
+-	MaterialsEffectiveconductivityAveragingEnum
+-	MaterialsHeatcapacityEnum
+-	MaterialsLatentheatEnum
+-	MaterialsMeltingpointEnum
+-	MaterialsMixedLayerCapacityEnum
+-	MaterialsMuWaterEnum
+-	MaterialsRheologyLawEnum
+-	MaterialsRhoFreshwaterEnum
+-	MaterialsRhoIceEnum
+-	MaterialsRhoSeawaterEnum
+-	MaterialsTemperateiceconductivityEnum
+-	MaterialsThermalExchangeVelocityEnum
+-	MaterialsThermalconductivityEnum
+-	MeltingOffsetEnum
+-	MeshAverageVertexConnectivityEnum
+-	MeshElementtypeEnum
+-	MeshNumberoflayersEnum
+-	MeshNumberofverticesEnum
+-	MeshNumberofelementsEnum
+-	MigrationMaxEnum
+-	ModelIdEnum
+-	NbinsEnum
+-	NodesEnum
+-	NumModelsEnum
+-	OceanGridNxEnum
+-	OceanGridNyEnum
+-	OceanGridXEnum
+-	OceanGridYEnum
+-	OutputBufferPointerEnum
+-	OutputBufferSizePointerEnum
+-	OutputFileNameEnum
+-	OutputFilePointerEnum
+-	OutputdefinitionEnum
+-	QmuErrNameEnum
+-	QmuInNameEnum
+-	QmuIsdakotaEnum
+-	QmuOutNameEnum
+-	QmuOutputEnum
+-	QmuCurrEvalIdEnum
+-	QmuNsampleEnum
+-	QmuResponsedescriptorsEnum
+-	QmuVariableDescriptorsEnum
+-	QmuVariablePartitionsEnum
+-	QmuVariablePartitionsNpartEnum
+-	QmuVariablePartitionsNtEnum
+-	QmuResponsePartitionsEnum
+-	QmuResponsePartitionsNpartEnum
+-	QmuStatisticsEnum
+-	QmuNumstatisticsEnum
+-	QmuNdirectoriesEnum
+-	QmuNfilesPerDirectoryEnum
+-	QmuStatisticsMethodEnum
+-	QmuMethodsEnum
+-	RestartFileNameEnum
+-	ResultsEnum
+-	RootPathEnum
+-	ModelnameEnum
+-	SamplingAlphaEnum
+-	SamplingPhiEnum
+-	SamplingNumRequestedOutputsEnum
+-	SamplingRequestedOutputsEnum
+-	SamplingRobinEnum
+-	SamplingSeedEnum
+-	SamplingTauEnum
+-	SaveResultsEnum
+-	SolidearthPartitionIceEnum
+-	SolidearthPartitionHydroEnum
+-	SolidearthPartitionOceanEnum
+-	SolidearthNpartIceEnum
+-	SolidearthNpartOceanEnum
+-	SolidearthNpartHydroEnum
+-	SolidearthPlanetRadiusEnum
+-	SolidearthPlanetAreaEnum
+-	SolidearthSettingsAbstolEnum
+-	SolidearthSettingsCrossSectionShapeEnum
+-	RotationalAngularVelocityEnum
+-	SolidearthSettingsElasticEnum
+-	SolidearthSettingsViscousEnum
+-	SealevelchangeGeometryDoneEnum
+-	SealevelchangeViscousNumStepsEnum
+-	SealevelchangeViscousTimesEnum
+-	SealevelchangeViscousIndexEnum
+-	RotationalEquatorialMoiEnum
+-	TidalLoveHEnum
+-	TidalLoveKEnum
+-	TidalLoveLEnum
+-	TidalLoveK2SecularEnum
+-	LoadLoveHEnum
+-	LoadLoveKEnum
+-	LoadLoveLEnum
+-	LoveTimeFreqEnum
+-	LoveIsTimeEnum
+-	SealevelchangeGSelfAttractionEnum
+-	SealevelchangeGViscoElasticEnum
+-	SolidearthSettingsSealevelLoadingEnum
+-	SolidearthSettingsGRDEnum
+-	SolidearthSettingsRunFrequencyEnum
+-	SolidearthSettingsTimeAccEnum
+-	SealevelchangeHViscoElasticEnum
+-	SolidearthSettingsHorizEnum
+-	SolidearthSettingsMaxiterEnum
+-	SolidearthSettingsGrdOceanEnum
+-	SolidearthSettingsOceanAreaScalingEnum
+-	RotationalPolarMoiEnum
+-	SolidearthSettingsReltolEnum
+-	SealevelchangeRequestedOutputsEnum
+-	SolidearthSettingsSelfAttractionEnum
+-	SolidearthSettingsRotationEnum
+-	SolidearthSettingsMaxSHCoeffEnum
+-	SealevelchangeRunCountEnum
+-	SealevelchangeTransitionsEnum
+-	SealevelchangeUViscoElasticEnum
+-	SettingsIoGatherEnum
+-	SettingsNumResultsOnNodesEnum
+-	SettingsOutputFrequencyEnum
+-	SettingsCheckpointFrequencyEnum
+-	SettingsResultsOnNodesEnum
+-	SettingsSbCouplingFrequencyEnum
+-	SettingsSolverResidueThresholdEnum
+-	SettingsWaitonlockEnum
+-	SmbAIceEnum
+-	SmbAIdxEnum
+-	SmbASnowEnum
+-	SmbAccualtiEnum
+-	SmbAccugradEnum
+-	SmbAccurefEnum
+-	SmbAdThreshEnum
+-	SmbAutoregressionInitialTimeEnum
+-	SmbAutoregressionTimestepEnum
+-	SmbAutoregressiveOrderEnum
+-	SmbAveragingEnum
+-	SmbBeta0Enum
+-	SmbBeta1Enum
+-	SmbCovmatEnum
+-	SmbDesfacEnum
+-	SmbDpermilEnum
+-	SmbDsnowIdxEnum
+-	SmbCldFracEnum
+-	SmbDelta18oEnum
+-	SmbDelta18oSurfaceEnum
+-	SmbDenIdxEnum
+-	SmbDtEnum
+-	SmbEnum
+-	SmbFEnum
+-	SmbInitDensityScalingEnum
+-	SmbIsaccumulationEnum
+-	SmbIsalbedoEnum
+-	SmbIsconstrainsurfaceTEnum
+-	SmbIsd18opdEnum
+-	SmbIsdelta18oEnum
+-	SmbIsdensificationEnum
+-	SmbIsfirnwarmingEnum
+-	SmbIsgraingrowthEnum
+-	SmbIsmeltEnum
+-	SmbIsmungsmEnum
+-	SmbIsprecipscaledEnum
+-	SmbIssetpddfacEnum
+-	SmbIsshortwaveEnum
+-	SmbIstemperaturescaledEnum
+-	SmbIsthermalEnum
+-	SmbIsturbulentfluxEnum
+-	SmbKEnum
+-	SmbNumBasinsEnum
+-	SmbNumRequestedOutputsEnum
+-	SmbPfacEnum
+-	SmbPhiEnum
+-	SmbRandomflagEnum
+-	SmbRdlEnum
+-	SmbRequestedOutputsEnum
+-	SmbRlapsEnum
+-	SmbRlapslgmEnum
+-	SmbRunoffaltiEnum
+-	SmbRunoffgradEnum
+-	SmbRunoffrefEnum
+-	SmbSealevEnum
+-	SmbStepsPerStepEnum
+-	SmbSwIdxEnum
+-	SmbT0dryEnum
+-	SmbT0wetEnum
+-	SmbTdiffEnum
+-	SmbThermoDeltaTScalingEnum
+-	SmbTemperaturesReconstructedYearsEnum
+-	SmbPrecipitationsReconstructedYearsEnum
+-	SmoothThicknessMultiplierEnum
+-	SolutionTypeEnum
+-	SteadystateMaxiterEnum
+-	SteadystateNumRequestedOutputsEnum
+-	SteadystateReltolEnum
+-	SteadystateRequestedOutputsEnum
+-	StepEnum
+-	StepsEnum
+-	StressbalanceAbstolEnum
+-	StressbalanceFSreconditioningEnum
+-	StressbalanceIsnewtonEnum
+-	StressbalanceMaxiterEnum
+-	StressbalanceNumRequestedOutputsEnum
+-	StressbalancePenaltyFactorEnum
+-	StressbalanceReltolEnum
+-	StressbalanceRequestedOutputsEnum
+-	StressbalanceRestolEnum
+-	StressbalanceRiftPenaltyThresholdEnum
+-	StressbalanceShelfDampeningEnum
+-	ThermalIsdrainicecolumnEnum
+-	ThermalIsdynamicbasalspcEnum
+-	ThermalIsenthalpyEnum
+-	ThermalMaxiterEnum
+-	ThermalNumRequestedOutputsEnum
+-	ThermalPenaltyFactorEnum
+-	ThermalPenaltyLockEnum
+-	ThermalPenaltyThresholdEnum
+-	ThermalReltolEnum
+-	ThermalRequestedOutputsEnum
+-	ThermalStabilizationEnum
+-	ThermalWatercolumnUpperlimitEnum
+-	TimeEnum
+-	TimesteppingCflCoefficientEnum
+-	TimesteppingCouplingTimeEnum
+-	TimesteppingFinalTimeEnum
+-	TimesteppingInterpForcingEnum
+-	TimesteppingCycleForcingEnum
+-	TimesteppingStartTimeEnum
+-	TimesteppingTimeStepEnum
+-	TimesteppingTimeStepMaxEnum
+-	TimesteppingTimeStepMinEnum
+-	TimesteppingTypeEnum
+-	ToMITgcmCommEnum
+-	ToolkitsFileNameEnum
+-	ToolkitsOptionsAnalysesEnum
+-	ToolkitsOptionsStringsEnum
+-	ToolkitsTypesEnum
+-	TransientAmrFrequencyEnum
+-	TransientIsdamageevolutionEnum
+-	TransientIsesaEnum
+-	TransientIsgiaEnum
+-	TransientIsgroundinglineEnum
+-	TransientIshydrologyEnum
+-	TransientIsmasstransportEnum 
+-	TransientIsoceantransportEnum
+-	TransientIsmovingfrontEnum
+-	TransientIsoceancouplingEnum
+-	TransientIssamplingEnum
+-	TransientIsslcEnum
+-	TransientIssmbEnum
+-	TransientIsstressbalanceEnum
+-	TransientIsthermalEnum
+-	TransientNumRequestedOutputsEnum
+-	TransientRequestedOutputsEnum
+-	VelocityEnum
+-	XxeEnum
+-	YyeEnum
+-	ZzeEnum
+-	AreaeEnum
+-	WorldCommEnum
+-	#}}}
+-	ParametersENDEnum
+-	InputsSTARTEnum
+-	#Inputs{{{
+-	AccumulatedDeltaBottomPressureEnum
+-	AccumulatedDeltaIceThicknessEnum
+-	AccumulatedDeltaTwsEnum
+-	AdjointEnum
+-	AdjointpEnum
+-	AdjointxEnum
+-	AdjointxBaseEnum
+-	AdjointxShearEnum
+-	AdjointyEnum
+-	AdjointyBaseEnum
+-	AdjointyShearEnum
+-	AdjointzEnum
+-	AirEnum
+-	ApproximationEnum
+-	BalancethicknessMisfitEnum
+-	BalancethicknessOmega0Enum
+-	BalancethicknessOmegaEnum
+-	BalancethicknessSpcthicknessEnum
+-	BalancethicknessThickeningRateEnum
+-	BasalCrevasseEnum
+-	BasalforcingsFloatingiceMeltingRateEnum
+-	BasalforcingsGeothermalfluxEnum
+-	BasalforcingsGroundediceMeltingRateEnum
+-	BasalforcingsPerturbationMeltingRateEnum
+-	BasalforcingsIsmip6BasinIdEnum
+-	BasalforcingsIsmip6TfEnum
+-	BasalforcingsIsmip6TfShelfEnum
+-	BasalforcingsIsmip6MeltAnomalyEnum
+-	BasalforcingsMeltrateFactorEnum
+-	BasalforcingsOceanSalinityEnum
+-	BasalforcingsOceanTempEnum
+-	BasalforcingsPicoBasinIdEnum
+-	BasalforcingsPicoBoxIdEnum
+-	BasalforcingsPicoOverturningCoeffEnum
+-	BasalforcingsPicoSubShelfOceanOverturningEnum
+-	BasalforcingsPicoSubShelfOceanSalinityEnum
+-	BasalforcingsPicoSubShelfOceanTempEnum
+-	BasalStressxEnum
+-	BasalStressyEnum
+-	BasalStressEnum
+-	BaseEnum
+-	BaseOldEnum
+-	BaseSlopeXEnum
+-	BaseSlopeYEnum
+-	BedEnum
+-	BedGRDEnum
+-	BedEastEnum
+-	BedEastGRDEnum
+-	BedNorthEnum
+-	BedNorthGRDEnum
+-	BedSlopeXEnum
+-	BedSlopeYEnum
+-	BottomPressureEnum
+-	BottomPressureOldEnum
+-	CalvingCalvingrateEnum
+-	CalvingHabFractionEnum
+-	CalvingMeltingrateEnum
+-	CalvingStressThresholdFloatingiceEnum
+-	CalvingStressThresholdGroundediceEnum
+-	CalvinglevermannCoeffEnum
+-	CalvingratexAverageEnum
+-	CalvingratexEnum
+-	CalvingrateyAverageEnum
+-	CalvingrateyEnum
+-	CalvingFluxLevelsetEnum
+-	CalvingMeltingFluxLevelsetEnum
+-	ConvergedEnum
+-	CrevasseDepthEnum
+-	DamageDEnum
+-	DamageDOldEnum
+-	DamageDbarEnum
+-	DamageDbarOldEnum
+-	DamageFEnum
+-	DegreeOfChannelizationEnum
+-	DepthBelowSurfaceEnum
+-	DeltaIceThicknessEnum
+-	DeltaTwsEnum
+-	DeltaBottomPressureEnum
+-	DeltaDslEnum
+-	DslOldEnum
+-	DslEnum
+-	DeltaStrEnum
+-	StrOldEnum
+-	StrEnum
+-	DeviatoricStresseffectiveEnum
+-	DeviatoricStressxxEnum
+-	DeviatoricStressxyEnum
+-	DeviatoricStressxzEnum
+-	DeviatoricStressyyEnum
+-	DeviatoricStressyzEnum
+-	DeviatoricStresszzEnum
+-	DeviatoricStress1Enum
+-	DeviatoricStress2Enum
+-	DistanceToCalvingfrontEnum
+-	DistanceToGroundinglineEnum
+-	Domain2DhorizontalEnum
+-	Domain2DverticalEnum
+-	Domain3DEnum
+-	DragCoefficientAbsGradientEnum
+-	DrivingStressXEnum
+-	DrivingStressYEnum
+-	DummyEnum
+-	EffectivePressureEnum
+-	EffectivePressureSubstepEnum
+-	EffectivePressureTransientEnum
+-	EnthalpyEnum
+-	EnthalpyPicardEnum
+-	EplHeadEnum
+-	EplHeadOldEnum
+-	EplHeadSlopeXEnum
+-	EplHeadSlopeYEnum
+-	EplHeadSubstepEnum
+-	EplHeadTransientEnum
+-	EsaEmotionEnum
+-	EsaNmotionEnum
+-	EsaRotationrateEnum
+-	EsaStrainratexxEnum
+-	EsaStrainratexyEnum
+-	EsaStrainrateyyEnum
+-	EsaUmotionEnum
+-	EsaXmotionEnum
+-	EsaYmotionEnum
+-	EtaDiffEnum
+-	FlowequationBorderFSEnum
+-	FrictionAsEnum
+-	FrictionCEnum
+-	FrictionCmaxEnum
+-	FrictionCoefficientEnum
+-	FrictionCoefficientcoulombEnum
+-	FrictionEffectivePressureEnum
+-	FrictionMEnum
+-	FrictionPEnum
+-	FrictionPressureAdjustedTemperatureEnum
+-	FrictionQEnum
+-	FrictionSedimentCompressibilityCoefficientEnum
+-	FrictionTillFrictionAngleEnum
+-	FrictionWaterLayerEnum
+-	FrictionfEnum
+-	FrontalForcingsBasinIdEnum
+-	FrontalForcingsSubglacialDischargeEnum
+-	FrontalForcingsThermalForcingEnum
+-	GeometryHydrostaticRatioEnum
+-	NGiaEnum
+-	NGiaRateEnum
+-	UGiaEnum
+-	UGiaRateEnum
+-	GradientEnum
+-	GroundinglineHeightEnum
+-	HydraulicPotentialEnum
+-	HydraulicPotentialOldEnum
+-	HydrologyBasalFluxEnum
+-	HydrologyBumpHeightEnum
+-	HydrologyBumpSpacingEnum
+-	HydrologydcBasalMoulinInputEnum
+-	HydrologydcEplThicknessEnum
+-	HydrologydcEplThicknessOldEnum
+-	HydrologydcEplThicknessSubstepEnum
+-	HydrologydcEplThicknessTransientEnum
+-	HydrologydcMaskEplactiveEltEnum
+-	HydrologydcMaskEplactiveNodeEnum
+-	HydrologydcMaskThawedEltEnum
+-	HydrologydcMaskThawedNodeEnum
+-	HydrologydcSedimentTransmitivityEnum
+-	HydrologyDrainageRateEnum
+-	HydrologyEnglacialInputEnum
+-	HydrologyGapHeightEnum
+-	HydrologyGapHeightXEnum
+-	HydrologyGapHeightXXEnum
+-	HydrologyGapHeightYEnum
+-	HydrologyGapHeightYYEnum
+-	HydrologyHeadEnum
+-	HydrologyHeadOldEnum
+-	HydrologyMoulinInputEnum
+-	HydrologyNeumannfluxEnum
+-	HydrologyReynoldsEnum
+-	HydrologySheetConductivityEnum
+-	HydrologySheetThicknessEnum
+-	HydrologySheetThicknessOldEnum
+-	HydrologyTwsEnum
+-	HydrologyTwsSpcEnum
+-	HydrologyTwsAnalysisEnum
+-	HydrologyWatercolumnMaxEnum
+-	HydrologyWaterVxEnum
+-	HydrologyWaterVyEnum
+-	IceEnum
+-	IceMaskNodeActivationEnum
+-	InputEnum
+-	InversionCostFunctionsCoefficientsEnum
+-	InversionSurfaceObsEnum
+-	InversionThicknessObsEnum
+-	InversionVelObsEnum
+-	InversionVxObsEnum
+-	InversionVyObsEnum
+-	LevelsetfunctionSlopeXEnum
+-	LevelsetfunctionSlopeYEnum
+-	LevelsetObservationEnum
+-	LoadingforceXEnum
+-	LoadingforceYEnum
+-	LoadingforceZEnum
+-	MaskOceanLevelsetEnum
+-	MaskIceLevelsetEnum
+-	MaskIceRefLevelsetEnum
+-	MasstransportSpcthicknessEnum
+-	MaterialsRheologyBEnum
+-	MaterialsRheologyBbarEnum
+-	MaterialsRheologyEEnum
+-	MaterialsRheologyEbarEnum
+-	MaterialsRheologyEcEnum
+-	MaterialsRheologyEcbarEnum
+-	MaterialsRheologyEsEnum
+-	MaterialsRheologyEsbarEnum
+-	MaterialsRheologyNEnum
+-	MeshScaleFactorEnum
+-	MeshVertexonbaseEnum
+-	MeshVertexonboundaryEnum
+-	MeshVertexonsurfaceEnum
+-	MisfitEnum
+-	MovingFrontalVxEnum
+-	MovingFrontalVyEnum
+-	NeumannfluxEnum
+-	NewDamageEnum
+-	NodeEnum
+-	OmegaAbsGradientEnum
+-	OceantransportSpcbottompressureEnum
+-	OceantransportSpcstrEnum
+-	OceantransportSpcdslEnum
+-	P0Enum
+-	P1Enum
+-	PartitioningEnum
+-	PressureEnum
+-	RadarEnum
+-	RadarAttenuationMacGregorEnum
+-	RadarAttenuationWolffEnum
+-	RadarIcePeriodEnum
+-	RadarPowerMacGregorEnum
+-	RadarPowerWolffEnum
+-	RheologyBAbsGradientEnum
+-	RheologyBInitialguessEnum
+-	RheologyBInitialguessMisfitEnum
+-	RheologyBbarAbsGradientEnum
+-	SampleEnum
+-	SamplingBetaEnum
+-	SamplingKappaEnum
+-	SealevelEnum
+-	SealevelGRDEnum
+-	SealevelBarystaticMaskEnum
+-	SealevelBarystaticIceMaskEnum
+-	SealevelBarystaticIceWeightsEnum
+-	SealevelBarystaticIceAreaEnum
+-	SealevelBarystaticIceLatbarEnum
+-	SealevelBarystaticIceLongbarEnum
+-	SealevelBarystaticIceLoadEnum
+-	SealevelBarystaticHydroMaskEnum
+-	SealevelBarystaticHydroWeightsEnum
+-	SealevelBarystaticHydroAreaEnum
+-	SealevelBarystaticHydroLatbarEnum
+-	SealevelBarystaticHydroLongbarEnum
+-	SealevelBarystaticHydroLoadEnum
+-	SealevelBarystaticBpMaskEnum
+-	SealevelBarystaticBpWeightsEnum
+-	SealevelBarystaticBpAreaEnum
+-	SealevelBarystaticBpLoadEnum
+-	SealevelBarystaticOceanMaskEnum
+-	SealevelBarystaticOceanWeightsEnum
+-	SealevelBarystaticOceanAreaEnum
+-	SealevelBarystaticOceanLatbarEnum
+-	SealevelBarystaticOceanLongbarEnum
+-	SealevelBarystaticOceanLoadEnum
+-	SealevelNEsaEnum
+-	SealevelNEsaRateEnum
+-	SealevelRSLEnum
+-	BslcEnum
+-	BslcIceEnum
+-	BslcHydroEnum
+-	BslcOceanEnum
+-	BslcRateEnum
+-	GmtslcEnum
+-	SealevelGrotm1Enum
+-	SealevelGrotm2Enum
+-	SealevelGrotm3Enum
+-	SealevelGUrotm1Enum
+-	SealevelGUrotm2Enum
+-	SealevelGUrotm3Enum
+-	SealevelGNrotm1Enum
+-	SealevelGNrotm2Enum
+-	SealevelGNrotm3Enum
+-	SealevelGErotm1Enum
+-	SealevelGErotm2Enum
+-	SealevelGErotm3Enum
+-	SealevelRSLBarystaticEnum
+-	SealevelRSLRateEnum
+-	SealevelUGrdEnum
+-	SealevelNGrdEnum
+-	SealevelUEastEsaEnum
+-	SealevelUNorthEsaEnum
+-	SealevelchangeIndicesEnum
+-	SealevelchangeGEnum
+-	SealevelchangeGUEnum
+-	SealevelchangeGEEnum
+-	SealevelchangeGNEnum
+-	SealevelchangeGsubelOceanEnum
+-	SealevelchangeGUsubelOceanEnum
+-	SealevelchangeGEsubelOceanEnum
+-	SealevelchangeGNsubelOceanEnum
+-	SealevelchangeGsubelIceEnum
+-	SealevelchangeGUsubelIceEnum
+-	SealevelchangeGEsubelIceEnum
+-	SealevelchangeGNsubelIceEnum
+-	SealevelchangeGsubelHydroEnum
+-	SealevelchangeGUsubelHydroEnum
+-	SealevelchangeGEsubelHydroEnum
+-	SealevelchangeGNsubelHydroEnum
+-	SealevelchangeViscousRSLEnum
+-	SealevelchangeViscousUEnum
+-	SealevelchangeViscousNEnum
+-	SealevelchangeViscousEEnum
+-	SedimentHeadEnum
+-	SedimentHeadOldEnum
+-	SedimentHeadSubstepEnum
+-	SedimentHeadTransientEnum
+-	SedimentHeadResidualEnum
+-	SedimentHeadStackedEnum
+-	SigmaNNEnum
+-	SigmaVMEnum
+-	SmbAccumulatedECEnum
+-	SmbAccumulatedMassBalanceEnum
+-	SmbAccumulatedMeltEnum
+-	SmbAccumulatedPrecipitationEnum
+-	SmbAccumulatedRainEnum
+-	SmbAccumulatedRefreezeEnum
+-	SmbAccumulatedRunoffEnum
+-	SmbAEnum
+-	SmbAdiffEnum
+-	SmbAValueEnum
+-	SmbAccumulationEnum
+-	SmbAdiffiniEnum
+-	SmbAiniEnum
+-	SmbBasinsIdEnum
+-	SmbBMaxEnum
+-	SmbBMinEnum
+-	SmbBNegEnum
+-	SmbBPosEnum
+-	SmbCEnum
+-	SmbCcsnowValueEnum
+-	SmbCciceValueEnum
+-	SmbCotValueEnum
+-	SmbDEnum
+-	SmbDailyairdensityEnum
+-	SmbDailyairhumidityEnum
+-	SmbDailydlradiationEnum
+-	SmbDailydsradiationEnum
+-	SmbDailypressureEnum
+-	SmbDailyrainfallEnum
+-	SmbDailysnowfallEnum
+-	SmbDailytemperatureEnum
+-	SmbDailywindspeedEnum
+-	SmbDiniEnum
+-	SmbDlwrfEnum
+-	SmbDswrfEnum
+-	SmbDswdiffrfEnum
+-	SmbDzAddEnum
+-	SmbDzEnum
+-	SmbDzMinEnum
+-	SmbDzTopEnum
+-	SmbDziniEnum
+-	SmbEAirEnum
+-	SmbECEnum
+-	SmbECDtEnum
+-	SmbECiniEnum
+-	SmbElaEnum
+-	SmbEvaporationEnum
+-	SmbFACEnum
+-	SmbGdnEnum
+-	SmbGdniniEnum
+-	SmbGspEnum
+-	SmbGspiniEnum
+-	SmbHrefEnum
+-	SmbIsInitializedEnum
+-	SmbMAddEnum
+-	SmbMassBalanceEnum
+-	SmbMassBalanceSubstepEnum
+-	SmbMassBalanceTransientEnum
+-	SmbMeanLHFEnum
+-	SmbMeanSHFEnum
+-	SmbMeanULWEnum
+-	SmbMeltEnum
+-	SmbMInitnum
+-	SmbMonthlytemperaturesEnum
+-	SmbMSurfEnum
+-	SmbNetLWEnum
+-	SmbNetSWEnum
+-	SmbPAirEnum
+-	SmbPEnum
+-	SmbPddfacIceEnum
+-	SmbPddfacSnowEnum
+-	SmbPrecipitationEnum
+-	SmbPrecipitationsAnomalyEnum
+-	SmbPrecipitationsLgmEnum
+-	SmbPrecipitationsPresentdayEnum
+-	SmbPrecipitationsReconstructedEnum
+-	SmbRainEnum
+-	SmbReEnum
+-	SmbRefreezeEnum
+-	SmbReiniEnum
+-	SmbRunoffEnum
+-	SmbRunoffSubstepEnum
+-	SmbRunoffTransientEnum
+-	SmbS0gcmEnum
+-	SmbS0pEnum
+-	SmbS0tEnum
+-	SmbSizeiniEnum
+-	SmbSmbCorrEnum
+-	SmbSmbrefEnum
+-	SmbSzaValueEnum
+-	SmbTEnum
+-	SmbTaEnum
+-	SmbTeValueEnum
+-	SmbTemperaturesAnomalyEnum
+-	SmbTemperaturesLgmEnum
+-	SmbTemperaturesPresentdayEnum
+-	SmbTemperaturesReconstructedEnum
+-	SmbTiniEnum
+-	SmbTmeanEnum
+-	SmbTzEnum
+-	SmbValuesAutoregressionEnum
+-	SmbVEnum
+-	SmbVmeanEnum
+-	SmbVzEnum
+-	SmbWEnum
+-	SmbWAddEnum
+-	SmbWiniEnum
+-	SmbZMaxEnum
+-	SmbZMinEnum
+-	SmbZTopEnum
+-	SmbZYEnum
+-	SolidearthExternalDisplacementEastRateEnum
+-	SolidearthExternalDisplacementNorthRateEnum
+-	SolidearthExternalDisplacementUpRateEnum
+-	SolidearthExternalGeoidRateEnum
+-	StrainRateeffectiveEnum
+-	StrainRateparallelEnum
+-	StrainRateperpendicularEnum
+-	StrainRatexxEnum
+-	StrainRatexyEnum
+-	StrainRatexzEnum
+-	StrainRateyyEnum
+-	StrainRateyzEnum
+-	StrainRatezzEnum
+-	StressMaxPrincipalEnum
+-	StressTensorxxEnum
+-	StressTensorxyEnum
+-	StressTensorxzEnum
+-	StressTensoryyEnum
+-	StressTensoryzEnum
+-	StressTensorzzEnum
+-	SurfaceAbsMisfitEnum
+-	SurfaceAbsVelMisfitEnum
+-	AreaEnum
+-	SealevelAreaEnum
+-	SurfaceAreaEnum
+-	SurfaceAverageVelMisfitEnum
+-	SurfaceCrevasseEnum
+-	SurfaceEnum
+-	SurfaceOldEnum
+-	SurfaceLogVelMisfitEnum
+-	SurfaceLogVxVyMisfitEnum
+-	SurfaceObservationEnum
+-	SurfaceRelVelMisfitEnum
+-	SurfaceSlopeXEnum
+-	SurfaceSlopeYEnum
+-	TemperatureEnum
+-	TemperaturePDDEnum
+-	TemperaturePicardEnum
+-	TemperatureSEMICEnum
+-	ThermalSpctemperatureEnum
+-	ThicknessAbsGradientEnum
+-	ThicknessAbsMisfitEnum
+-	ThicknessAcrossGradientEnum
+-	ThicknessAlongGradientEnum
+-	ThicknessEnum
+-	ThicknessOldEnum
+-	ThicknessPositiveEnum
+-	ThicknessResidualEnum
+-	TransientAccumulatedDeltaIceThicknessEnum
+-	VelEnum
+-	VxAverageEnum
+-	VxBaseEnum
+-	VxEnum
+-	VxMeshEnum
+-	VxObsEnum
+-	VxShearEnum
+-	VxSurfaceEnum
+-	VyAverageEnum
+-	VyBaseEnum
+-	VyEnum
+-	VyMeshEnum
+-	VyObsEnum
+-	VyShearEnum
+-	VySurfaceEnum
+-	VzEnum
+-	VzFSEnum
+-	VzHOEnum
+-	VzMeshEnum
+-	VzSSAEnum
+-	WaterColumnOldEnum
+-	WatercolumnEnum
+-	WaterfractionDrainageEnum
+-	WaterfractionDrainageIntegratedEnum
+-	WaterfractionEnum
+-	WaterheightEnum
+-	WeightsLevelsetObservationEnum
+-	WeightsSurfaceObservationEnum
+-	OldAccumulatedDeltaBottomPressureEnum
+-	OldAccumulatedDeltaIceThicknessEnum
+-	OldAccumulatedDeltaTwsEnum
+-	Outputdefinition1Enum
+-	Outputdefinition10Enum
+-	Outputdefinition11Enum
+-	Outputdefinition12Enum
+-	Outputdefinition13Enum
+-	Outputdefinition14Enum
+-	Outputdefinition15Enum
+-	Outputdefinition16Enum
+-	Outputdefinition17Enum
+-	Outputdefinition18Enum
+-	Outputdefinition19Enum
+-	Outputdefinition20Enum
+-	Outputdefinition21Enum
+-	Outputdefinition22Enum
+-	Outputdefinition23Enum
+-	Outputdefinition24Enum
+-	Outputdefinition25Enum
+-	Outputdefinition26Enum
+-	Outputdefinition27Enum
+-	Outputdefinition28Enum
+-	Outputdefinition29Enum
+-	Outputdefinition2Enum
+-	Outputdefinition30Enum
+-	Outputdefinition31Enum
+-	Outputdefinition32Enum
+-	Outputdefinition33Enum
+-	Outputdefinition34Enum
+-	Outputdefinition35Enum
+-	Outputdefinition36Enum
+-	Outputdefinition37Enum
+-	Outputdefinition38Enum
+-	Outputdefinition39Enum
+-	Outputdefinition3Enum
+-	Outputdefinition40Enum
+-	Outputdefinition41Enum
+-	Outputdefinition42Enum
+-	Outputdefinition43Enum
+-	Outputdefinition44Enum
+-	Outputdefinition45Enum
+-	Outputdefinition46Enum
+-	Outputdefinition47Enum
+-	Outputdefinition48Enum
+-	Outputdefinition49Enum
+-	Outputdefinition4Enum
+-	Outputdefinition50Enum
+-	Outputdefinition51Enum
+-	Outputdefinition52Enum
+-	Outputdefinition53Enum
+-	Outputdefinition54Enum
+-	Outputdefinition55Enum
+-	Outputdefinition56Enum
+-	Outputdefinition57Enum
+-	Outputdefinition58Enum
+-	Outputdefinition59Enum
+-	Outputdefinition5Enum
+-	Outputdefinition60Enum
+-	Outputdefinition61Enum
+-	Outputdefinition62Enum
+-	Outputdefinition63Enum
+-	Outputdefinition64Enum
+-	Outputdefinition65Enum
+-	Outputdefinition66Enum
+-	Outputdefinition67Enum
+-	Outputdefinition68Enum
+-	Outputdefinition69Enum
+-	Outputdefinition6Enum
+-	Outputdefinition70Enum
+-	Outputdefinition71Enum
+-	Outputdefinition72Enum
+-	Outputdefinition73Enum
+-	Outputdefinition74Enum
+-	Outputdefinition75Enum
+-	Outputdefinition76Enum
+-	Outputdefinition77Enum
+-	Outputdefinition78Enum
+-	Outputdefinition79Enum
+-	Outputdefinition7Enum
+-	Outputdefinition80Enum
+-	Outputdefinition81Enum
+-	Outputdefinition82Enum
+-	Outputdefinition83Enum
+-	Outputdefinition84Enum
+-	Outputdefinition85Enum
+-	Outputdefinition86Enum
+-	Outputdefinition87Enum
+-	Outputdefinition88Enum
+-	Outputdefinition89Enum
+-	Outputdefinition8Enum
+-	Outputdefinition90Enum
+-	Outputdefinition91Enum
+-	Outputdefinition92Enum
+-	Outputdefinition93Enum
+-	Outputdefinition94Enum
+-	Outputdefinition95Enum
+-	Outputdefinition96Enum
+-	Outputdefinition97Enum
+-	Outputdefinition98Enum
+-	Outputdefinition99Enum
+-	Outputdefinition9Enum
+-	Outputdefinition100Enum
+-	#}}}
+-	InputsENDEnum
+-	#Other{{{
+-	AbsoluteEnum
+-	AdaptiveTimesteppingEnum
+-	AdjointBalancethickness2AnalysisEnum
+-	AdjointBalancethicknessAnalysisEnum
+-	AdjointHorizAnalysisEnum
+-	AggressiveMigrationEnum
+-	AmrBamgEnum
+-	AmrNeopzEnum
+-	AndroidFrictionCoefficientEnum
+-	ArrheniusEnum
+-	AutodiffJacobianEnum
+-	Balancethickness2AnalysisEnum
+-	Balancethickness2SolutionEnum
+-	BalancethicknessAnalysisEnum
+-	BalancethicknessApparentMassbalanceEnum
+-	BalancethicknessSoftAnalysisEnum
+-	BalancethicknessSoftSolutionEnum
+-	BalancethicknessSolutionEnum
+-	BalancevelocityAnalysisEnum
+-	BalancevelocitySolutionEnum
+-	BasalforcingsIsmip6Enum
+-	BasalforcingsPicoEnum
+-	BeckmannGoosseFloatingMeltRateEnum
+-	BedSlopeSolutionEnum
+-	BoolExternalResultEnum
+-	BoolInputEnum
+-	IntInputEnum
+-	DoubleInputEnum
+-	BoolParamEnum
+-	BoundaryEnum
+-	BuddJackaEnum
+-	CalvingDev2Enum
+-	CalvingHabEnum
+-	CalvingLevermannEnum
+-	CalvingVonmisesEnum
+-	CfdragcoeffabsgradEnum
+-	CfsurfacelogvelEnum
+-	CfsurfacesquareEnum
+-	CflevelsetmisfitEnum
+-	ChannelEnum
+-	ChannelAreaEnum
+-	ChannelAreaOldEnum
+-	ChannelDischargeEnum
+-	ClosedEnum
+-	ColinearEnum
+-	ConstraintsEnum
+-	ContactEnum
+-	ContourEnum
+-	ContoursEnum
+-	ControlInputEnum
+-	ControlInputGradEnum
+-	ControlInputMaxsEnum
+-	ControlInputMinsEnum
+-	ControlInputValuesEnum
+-	CrouzeixRaviartEnum
+-	CuffeyEnum
+-	CuffeyTemperateEnum
+-	DamageEvolutionAnalysisEnum
+-	DamageEvolutionSolutionEnum
+-	DataSetEnum
+-	DataSetParamEnum
+-	DatasetInputEnum
+-	DefaultAnalysisEnum
+-	DefaultCalvingEnum
+-	DenseEnum
+-	DependentObjectEnum
+-	DepthAverageAnalysisEnum
+-	DeviatoricStressErrorEstimatorEnum
+-	DivergenceEnum
+-	Domain3DsurfaceEnum
+-	DoubleArrayInputEnum
+-	ArrayInputEnum
+-	DoubleExternalResultEnum
+-	DoubleMatArrayParamEnum
+-	DoubleMatExternalResultEnum
+-	DoubleMatParamEnum
+-	DoubleParamEnum
+-	DoubleVecParamEnum
+-	ElementEnum
+-	ElementHookEnum
+-	ElementSIdEnum
+-	EnthalpyAnalysisEnum
+-	EsaAnalysisEnum
+-	EsaSolutionEnum
+-	EsaTransitionsEnum
+-	ExternalResultEnum
+-	ExtrapolationAnalysisEnum
+-	ExtrudeFromBaseAnalysisEnum
+-	ExtrudeFromTopAnalysisEnum
+-	FSApproximationEnum
+-	FSSolverEnum
+-	FSpressureEnum
+-	FSvelocityEnum
+-	FemModelEnum
+-	FileParamEnum
+-	FixedTimesteppingEnum
+-	FloatingAreaEnum
+-	FloatingAreaScaledEnum
+-	FloatingMeltRateEnum
+-	FreeEnum
+-	FreeSurfaceBaseAnalysisEnum
+-	FreeSurfaceTopAnalysisEnum
+-	FrontalForcingsDefaultEnum
+-	FrontalForcingsRignotEnum
+-	FsetEnum
+-	FullMeltOnPartiallyFloatingEnum
+-	GLheightadvectionAnalysisEnum
+-	GaussPentaEnum
+-	GaussSegEnum
+-	GaussTetraEnum
+-	GaussTriaEnum
+-	GenericOptionEnum
+-	GenericParamEnum
+-	GenericExternalResultEnum
+-	Gradient1Enum
+-	Gradient2Enum
+-	Gradient3Enum
+-	Gradient4Enum
+-	GroundedAreaEnum
+-	GroundedAreaScaledEnum
+-	GroundingOnlyEnum
+-	GroundinglineMassFluxEnum
+-	GsetEnum
+-	GslEnum
+-	HOApproximationEnum
+-	HOFSApproximationEnum
+-	HookEnum
+-	HydrologyDCEfficientAnalysisEnum
+-	HydrologyDCInefficientAnalysisEnum
+-	HydrologyGlaDSAnalysisEnum
+-	HydrologyGlaDSEnum
+-	HydrologyPismAnalysisEnum
+-	HydrologyShaktiAnalysisEnum
+-	HydrologyShreveAnalysisEnum
+-	HydrologySolutionEnum
+-	HydrologydcEnum
+-	HydrologypismEnum
+-	HydrologyshaktiEnum
+-	HydrologyshreveEnum
+-	IceMassEnum
+-	IceMassScaledEnum
+-	IceVolumeAboveFloatationEnum
+-	IceVolumeAboveFloatationScaledEnum
+-	IceVolumeEnum
+-	IceVolumeScaledEnum
+-	IcefrontMassFluxEnum
+-	IcefrontMassFluxLevelsetEnum
+-	IncrementalEnum
+-	IndexedEnum
+-	IntExternalResultEnum
+-	ElementInputEnum
+-	IntMatExternalResultEnum
+-	IntMatParamEnum
+-	IntParamEnum
+-	IntVecParamEnum
+-	InputsEnum
+-	InternalEnum
+-	IntersectEnum
+-	InversionVzObsEnum
+-	JEnum
+-	L1L2ApproximationEnum
+-	MLHOApproximationEnum
+-	L2ProjectionBaseAnalysisEnum
+-	L2ProjectionEPLAnalysisEnum
+-	LACrouzeixRaviartEnum
+-	LATaylorHoodEnum
+-	LambdaSEnum
+-	LevelsetAnalysisEnum
+-	LevelsetfunctionPicardEnum
+-	LinearFloatingMeltRateEnum
+-	LliboutryDuvalEnum
+-	LoadsEnum
+-	LoveAnalysisEnum
+-	LoveHiEnum
+-	LoveHrEnum
+-	LoveKernelsImagEnum
+-	LoveKernelsRealEnum
+-	LoveKiEnum
+-	LoveKrEnum
+-	LoveLiEnum
+-	LoveLrEnum
+-	LoveSolutionEnum
+-	MINIEnum
+-	MINIcondensedEnum
+-	MantlePlumeGeothermalFluxEnum
+-	MassFluxEnum
+-	MassconEnum
+-	MassconaxpbyEnum
+-	MassfluxatgateEnum
+-	MasstransportAnalysisEnum
+-	MasstransportSolutionEnum
+-	MatdamageiceEnum
+-	MatenhancediceEnum
+-	MaterialsEnum
+-	MatestarEnum
+-	MaticeEnum
+-	MatlithoEnum
+-	MathydroEnum
+-	MatrixParamEnum
+-	MaxAbsVxEnum
+-	MaxAbsVyEnum
+-	MaxAbsVzEnum
+-	MaxDivergenceEnum
+-	MaxVelEnum
+-	MaxVxEnum
+-	MaxVyEnum
+-	MaxVzEnum
+-	MelangeEnum
+-	MeltingAnalysisEnum
+-	MeshElementsEnum
+-	MeshXEnum
+-	MeshYEnum
+-	MinVelEnum
+-	MinVxEnum
+-	MinVyEnum
+-	MinVzEnum
+-	MismipFloatingMeltRateEnum
+-	MoulinEnum
+-	MpiDenseEnum
+-	MpiEnum
+-	MpiSparseEnum
+-	MumpsEnum
+-	NoFrictionOnPartiallyFloatingEnum
+-	NoMeltOnPartiallyFloatingEnum
+-	NodalEnum
+-	NodalvalueEnum
+-	NodeSIdEnum
+-	NoneApproximationEnum
+-	NoneEnum
+-	NumberedcostfunctionEnum
+-	NyeCO2Enum
+-	NyeH2OEnum
+-	NumericalfluxEnum
+-	OceantransportAnalysisEnum
+-	OceantransportSolutionEnum
+-	OldGradientEnum
+-	OneLayerP4zEnum
+-	OpenEnum
+-	OptionEnum
+-	ParamEnum
+-	ParametersEnum
+-	P0ArrayEnum
+-	P0DGEnum
+-	P1DGEnum
+-	P1P1Enum
+-	P1P1GLSEnum
+-	P1bubbleEnum
+-	P1bubblecondensedEnum
+-	P1xP2Enum
+-	P1xP3Enum
+-	P1xP4Enum
+-	P2Enum
+-	P2bubbleEnum
+-	P2bubblecondensedEnum
+-	P2xP1Enum
+-	P2xP4Enum
+-	PatersonEnum
+-	PengridEnum
+-	PenpairEnum
+-	PentaEnum
+-	PentaInputEnum
+-	ProfilerEnum
+-	ProfilingCurrentFlopsEnum
+-	ProfilingCurrentMemEnum
+-	ProfilingSolutionTimeEnum
+-	RegionaloutputEnum
+-	RegularEnum
+-	RecoveryAnalysisEnum
+-	RiftfrontEnum
+-	SamplingAnalysisEnum
+-	SamplingSolutionEnum
+-	SIAApproximationEnum
+-	SMBautoregressionEnum
+-	SMBcomponentsEnum
+-	SMBd18opddEnum
+-	SMBforcingEnum
+-	SMBgcmEnum
+-	SMBgembEnum
+-	SMBgradientsEnum
+-	SMBgradientscomponentsEnum
+-	SMBgradientselaEnum
+-	SMBhenningEnum
+-	SMBmeltcomponentsEnum
+-	SMBpddEnum
+-	SMBpddSicopolisEnum
+-	SMBsemicEnum
+-	SSAApproximationEnum
+-	SSAFSApproximationEnum
+-	SSAHOApproximationEnum
+-	ScaledEnum
+-	SealevelAbsoluteEnum
+-	SealevelEmotionEnum
+-	SealevelInertiaTensorXZEnum
+-	SealevelInertiaTensorYZEnum
+-	SealevelInertiaTensorZZEnum
+-	SealevelchangePolarMotionEnum
+-	SealevelNmotionEnum
+-	SealevelUmotionEnum
+-	SealevelchangeAnalysisEnum
+-	SegEnum
+-	SegInputEnum
+-	SegmentEnum
+-	SegmentRiftfrontEnum
+-	SeparateEnum
+-	SeqEnum
+-	SmbAnalysisEnum
+-	SmbSolutionEnum
+-	SmoothAnalysisEnum
+-	SoftMigrationEnum
+-	SpatialLinearFloatingMeltRateEnum
+-	SpcDynamicEnum
+-	SpcStaticEnum
+-	SpcTransientEnum
+-	SsetEnum
+-	StatisticsSolutionEnum
+-	SteadystateSolutionEnum
+-	StressIntensityFactorEnum
+-	StressbalanceAnalysisEnum
+-	StressbalanceConvergenceNumStepsEnum
+-	StressbalanceSIAAnalysisEnum
+-	StressbalanceSolutionEnum
+-	StressbalanceVerticalAnalysisEnum
+-	StringArrayParamEnum
+-	StringExternalResultEnum
+-	StringParamEnum
+-	SubelementFriction1Enum
+-	SubelementFriction2Enum
+-	SubelementMelt1Enum
+-	SubelementMelt2Enum
+-	SubelementMigrationEnum
+-	SurfaceSlopeSolutionEnum
+-	TaylorHoodEnum
+-	TetraEnum
+-	TetraInputEnum
+-	ThermalAnalysisEnum
+-	ThermalSolutionEnum
+-	ThicknessErrorEstimatorEnum
+-	TotalCalvingFluxLevelsetEnum
+-	TotalCalvingMeltingFluxLevelsetEnum
+-	TotalFloatingBmbEnum
+-	TotalFloatingBmbScaledEnum
+-	TotalGroundedBmbEnum
+-	TotalGroundedBmbScaledEnum
+-	TotalSmbEnum
+-	TotalSmbScaledEnum
+-	TransientArrayParamEnum
+-	TransientInputEnum
+-	TransientParamEnum
+-	TransientSolutionEnum
+-	TriaEnum
+-	TriaInputEnum
+-	UzawaPressureAnalysisEnum
+-	VectorParamEnum
+-	VertexEnum
+-	VertexLIdEnum
+-	VertexPIdEnum
+-	VertexSIdEnum
+-	VerticesEnum
+-	ViscousHeatingEnum
+-	WaterEnum
+-	XTaylorHoodEnum
+-	XYEnum
+-	XYZEnum
+-	#}}}
+-	MaximumNumberOfDefinitionsEnum
+-end
+-
+-function EnumToString(enum::IssmEnum)
+-
+-	#Make dictionnary from enums
+-	inst = instances(IssmEnum)
+-	syms = Symbol.(inst)
+-	enumdic = Dict(zip(inst, syms))
+-
+-	return enumdic[enum]
+-end
+-
+-function EnumToString(enum::Int64)
+-	return EnumToString(IssmEnum(enum))
+-end
+-
+-function StringToEnum(string::String)
+-
+-	#Make dictionnary from enums
+-	inst = instances(IssmEnum)
+-	syms = Symbol.(inst)
+-	enumdic = Dict(zip(syms, inst))
+-
+-	return enumdic[Symbol(string)]
+-end
+-
+-function StringToEnumInt(string::String)
+-	return Integer(StringToEnum(string))
+-end
+Index: ../trunk-jpl/src/jl/solve/vertices.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/vertices.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/vertices.jl	(nonexistent)
+@@ -1,26 +0,0 @@
+-#Vertex class definition
+-mutable struct Vertex#{{{
+-	sid::Int64
+-	x::Float64
+-	y::Float64
+-	z::Float64
+-end# }}}
+-
+-#vertices functions
+-function GetVerticesCoordinates(vertices::Vector{Vertex}) #{{{
+-
+-	#Intermediaries
+-	nbv = length(vertices)
+-
+-	#Allocate
+-	xyz_list = Matrix{Float64}(undef,nbv,3)
+-
+-	#Assign value to xyz_list
+-	for i in 1:nbv
+-		xyz_list[i,1]=vertices[i].x
+-		xyz_list[i,2]=vertices[i].y
+-		xyz_list[i,3]=vertices[i].z
+-	end
+-
+-	return xyz_list
+-end #}}}
+Index: ../trunk-jpl/src/jl/solve/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solve.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/solve.jl	(nonexistent)
+@@ -1,38 +0,0 @@
+-include("../md/classes.jl")
+-include("./issmenums.jl")
+-include("./toolkits.jl")
+-include("./gauss.jl")
+-include("./parameters.jl")
+-include("./inputs.jl")
+-include("./vertices.jl")
+-include("./nodes.jl")
+-include("./elements.jl")
+-include("./constraints.jl")
+-include("./results.jl")
+-include("./matice.jl")
+-include("./friction.jl")
+-include("./femmodel.jl")
+-include("./analyses/analysis.jl")
+-include("./analyses/stressbalanceanalysis.jl")
+-include("./solutionsequences.jl")
+-include("./modules.jl")
+-include("./elementmatrix.jl")
+-include("./utils.jl")
+-
+-function IssmCore(md::model) #{{{
+-
+-
+-	#Construct FemModel
+-	femmodel=ModelProcessor(md)
+-
+-	#Solve
+-	analysis = StressbalanceAnalysis()
+-	Core(analysis, femmodel)
+-
+-	#Save output
+-	RequestedOutputsx(femmodel, [VxEnum,VyEnum,VelEnum])
+-
+-	#move results to md
+-	OutputResultsx(femmodel, md)
+-
+-end# }}}
+Index: ../trunk-jpl/src/jl/solve/femmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/femmodel.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/femmodel.jl	(nonexistent)
+@@ -1,14 +0,0 @@
+-#femmodel class definition
+-mutable struct FemModel #{{{
+-	elements::Vector{Tria}
+-	vertices::Vector{Vertex}
+-	nodes::Vector{Node}
+-	parameters::Parameters
+-	inputs::Inputs
+-	constraints::Vector{Constraint}
+-	#loads::Vector{Loads}
+-	results::Vector{Result}
+-end#}}}
+-
+-#femmodel functions
+-
+Index: ../trunk-jpl/src/jl/solve/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/solve/solutionsequences.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/solve/solutionsequences.jl	(nonexistent)
+@@ -1,106 +0,0 @@
+-function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
+-
+-	#Initialize number of iterations
+-	count = 0
+-	converged = false
+-
+-	#Get existing solution
+-	ug = GetSolutionFromInputsx(analysis,femmodel)
+-	uf = Reducevectorgtofx(ug,femmodel.nodes)
+-
+-	#Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
+-	InputUpdateFromSolutionx(analysis,ug,femmodel)
+-
+-	#Loop until we reach convergence
+-	while(~converged)
+-
+-		#Get new matrices
+-		Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
+-
+-		#Enforce constraints
+-		ys = CreateNodalConstraintsx(femmodel.nodes)
+-		Reduceloadx!(pf, Kfs, ys)
+-
+-		#Solve!
+-		old_uf = uf
+-		uf = Solverx(Kff, pf, old_uf)
+-
+-		#Merge uf with ys
+-		Mergesolutionfromftogx(ug, uf, ys, femmodel.nodes)
+-
+-		#Check for convergence
+-		converged = convergence(Kff,pf,uf,old_uf,restol,reltol,abstol)
+-		InputUpdateFromSolutionx(analysis,ug,femmodel)
+-
+-		#Increase count
+-		count += 1
+-		if(count>=maxiter)
+-			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
+-			converged = true
+-		end
+-	end
+-
+-	print("\n   total number of iterations: ",  count,  "\n")
+-
+-end# }}}
+-function convergence(Kff::IssmMatrix, pf::IssmVector, uf::IssmVector, old_uf::IssmVector, restol::Float64, reltol::Float64, abstol::Float64)#{{{
+-
+-	print("   checking convergence\n");
+-
+-	#If solution vector is empty, return true
+-	if(IsEmpty(uf))
+-		return true
+-	end
+-
+-	#Convergence criterion #1: force equilibrium (Mandatory)
+-	#compute K[n]U[n-1] - F
+-	KUold  = Duplicate(uf);    MatMult!(Kff,old_uf,KUold)
+-	KUoldF = Duplicate(KUold); VecCopy!(KUold, KUoldF); AXPY!(KUoldF, -1.0, pf)
+-	nKUoldF = Norm(KUoldF,2)
+-	nF      = Norm(pf,2)
+-	res = nKUoldF/nF
+-	if ~isfinite(res)
+-		println("norm nf = ", nF, " and norm kuold = ",nKUoldF)
+-		error("mechanical equilibrium convergence criterion is not finite!")
+-	end
+-	if(res<restol)
+-		print("   mechanical equilibrium convergence criterion ", res*100, " < ", restol*100, " %\n")
+-		converged=true
+-	else
+-		print("   mechanical equilibrium convergence criterion ", res*100, " > ", restol*100, " %\n")
+-		converged=false;
+-	end
+-
+-	#Convergence criterion #2: norm(du)/norm(u)
+-	if ~isnan(reltol)
+-		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
+-		ndu = Norm(duf, 2); nu = Norm(old_uf, 2)
+-		if ~isfinite(ndu) | ~isfinite(nu) 
+-			error("convergence criterion is not finite!")
+-		end
+-		if((ndu/nu)<reltol)
+-			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " < ", reltol*100, " %\n")
+-		else
+-			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " > ", reltol*100, " %\n")
+-			converged=false;
+-		end
+-	end
+-
+-	#Convergence criterion #3: max(du)
+-	if ~isnan(abstol)
+-		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
+-		nduinf= Norm(duf, 3)
+-		if ~isfinite(nduinf) 
+-			error("convergence criterion is not finite!")
+-		end
+-		if(nduinf<abstol)
+-			print("   Convergence criterion: max(du)               ", nduinf, " < ", abstol, "\n")
+-		else
+-			print("   Convergence criterion: max(du)               ", nduinf, " > ", abstol, "\n")
+-			converged=false;
+-		end
+-	end
+-
+-	return converged
+-
+-end#}}}
+Index: ../trunk-jpl/src/jl/test301.jl
+===================================================================
+--- ../trunk-jpl/src/jl/test301.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/test301.jl	(nonexistent)
+@@ -1,45 +0,0 @@
+-#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
+-include("issm.jl")
+-using .ISSM
+-
+-md = ISSM.model()
+-md = ISSM.triangle(md,"../../test/Exp/Square.exp",150000.)
+-md = ISSM.setmask(md,"","")
+-
+-#Geometry
+-hmin=300.
+-hmax=1000.
+-ymin=minimum(md.mesh.y)
+-ymax=maximum(md.mesh.y)
+-xmin=minimum(md.mesh.x)
+-xmax=maximum(md.mesh.x)
+-md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
+-md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness .+20
+-md.geometry.surface   = md.geometry.base+md.geometry.thickness
+-md.geometry.bed       = md.geometry.base
+-
+-#Initial velocity
+-#x     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
+-#y     = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
+-#vx    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+-#vy    = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+-#index = ISSM.archread(ISSM.issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
+-md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
+-md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
+-
+-md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+-md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+-md.friction.coefficient=20*ones(md.mesh.numberofvertices)
+-
+-md.stressbalance.restol=0.05
+-md.stressbalance.reltol=0.05
+-md.stressbalance.abstol=NaN
+-
+-#Boundary conditions
+-md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
+-md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
+-pos = findall(md.mesh.vertexonboundary)
+-md.stressbalance.spcvx[pos] .= 0.0
+-md.stressbalance.spcvy[pos] .= 0.0
+-
+-md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/test301.jl
+___________________________________________________________________
+Deleted: svn:executable
+## -1 +0,0 ##
+-*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/core/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/modules.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/modules.jl	(revision 26725)
+@@ -0,0 +1,261 @@
++#Model Processor
++function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
++	for i in 1:length(elements)
++		InputCreate(elements[i],inputs,data,enum)
++	end
++end#}}}
++function ModelProcessor(md::model) #{{{
++
++	#Initialize structures
++	elements    = Vector{Tria}(undef,0)
++	vertices    = Vector{Vertex}(undef,0)
++	nodes       = Vector{Node}(undef,0)
++	constraints = Vector{Constraint}(undef,0)
++	results     = Vector{Result}(undef,0)
++	parameters  = Parameters(Dict{IssmEnum,Parameter}())
++	inputs      = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
++
++	#Create  elements, vertices and materials (independent of the analysis)
++	CreateElements(elements,md)
++	CreateVertices(vertices,md)
++	CreateParameters(parameters,md)
++	CreateInputs(inputs,elements,md)
++
++	#Now create analysis specific data structure
++	analysis = StressbalanceAnalysis()
++	UpdateParameters(analysis,parameters,md)
++	CreateNodes(analysis,nodes,md)
++	UpdateElements(analysis,elements,inputs,md)
++	CreateConstraints(analysis,constraints,md)
++
++	#Configure objects
++	ConfigureObjectx(elements,nodes,vertices,parameters,inputs)
++
++	#Constrain and Number nodes
++	SpcNodesx(nodes,constraints,parameters)
++	NodesDofx(nodes,parameters)
++
++	#Build FemModel
++	return FemModel(elements, vertices, nodes, parameters, inputs, constraints, results)
++end# }}}
++function CreateElements(elements::Vector{Tria},md::model) #{{{
++
++	#Make sure elements is currently empty
++	@assert length(elements)==0
++
++	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
++	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
++
++	count = 0
++	for i in 1:md.mesh.numberofelements
++
++		#Assume Linear Elements for now
++		vertexids = md.mesh.elements[i,:]
++		nodeids   = md.mesh.elements[i,:]
++
++		#Call constructor and add to dataset elements
++		push!(elements,Tria(i,count,vertexids,Vector{Vertex}(undef,3),nodeids,Vector{Node}(undef,3),tempparams,tempinputs))
++	end
++
++end# }}}
++function CreateVertices(vertices::Vector{Vertex},md::model) #{{{
++
++	#Make sure vertices is currently empty
++	@assert length(vertices)==0
++
++	#Get data from md
++	x = md.mesh.x
++	y = md.mesh.y
++
++	count = 0
++	for i in 1:md.mesh.numberofvertices
++		push!(vertices,Vertex(i,x[i],y[i],0.))
++	end
++
++end# }}}
++function CreateParameters(parameters::Parameters,md::model) #{{{
++
++	#Get data from md
++	AddParam(parameters,md.materials.rho_ice,MaterialsRhoIceEnum)
++	AddParam(parameters,md.materials.rho_water,MaterialsRhoSeawaterEnum)
++	AddParam(parameters,md.materials.rho_freshwater,MaterialsRhoFreshwaterEnum)
++	AddParam(parameters,md.constants.g,ConstantsGEnum)
++	
++	#Set step and time, this will be overwritten if we run a transient
++	AddParam(parameters,1,StepEnum)
++	AddParam(parameters,0.0,TimeEnum)
++end# }}}
++function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
++
++	#Only assume we have Matice for now
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
++end# }}}
++function OutputResultsx(femmodel::FemModel, md::model)# {{{
++
++	md.results = Dict("Stressbalance"=> femmodel.results)
++
++end# }}}
++
++#Other modules
++function ConfigureObjectx(elements::Vector{Tria},nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) #{{{
++
++	for i in 1:length(elements)
++		Configure(elements[i],nodes,vertices,parameters,inputs)
++	end
++
++end# }}}
++function SpcNodesx(nodes::Vector{Node},constraints::Vector{Constraint},parameters::Parameters) #{{{
++
++	for i in 1:length(constraints)
++		ConstrainNode(constraints[i],nodes,parameters)
++	end
++
++end# }}}
++function NodesDofx(nodes::Vector{Node}, parameters::Parameters) #{{{
++
++	#Do we have any nodes?
++	if length(nodes)==0
++		return
++	end
++
++	#Do we really need to update dof indexing
++	if(~RequiresDofReindexing(nodes)) return end
++
++	print("   Renumbering degrees of freedom\n")
++	DistributeDofs(nodes,GsetEnum)
++	DistributeDofs(nodes,FsetEnum)
++	DistributeDofs(nodes,SsetEnum)
++
++end# }}}
++function GetSolutionFromInputsx(analysis::Analysis,femmodel::FemModel) #{{{
++
++	#Get size of vector
++	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
++
++	#Initialize solution vector
++	ug = IssmVector(gsize)
++
++	#Go through elements and plug in solution
++	for i=1:length(femmodel.elements)
++		GetSolutionFromInputs(analysis,ug,femmodel.elements[i])
++	end
++
++	return ug
++
++end#}}}
++function InputUpdateFromSolutionx(analysis::Analysis,ug::IssmVector,femmodel::FemModel) #{{{
++
++	#Go through elements and plug in solution
++	for i=1:length(femmodel.elements)
++		InputUpdateFromSolution(analysis,ug.vector,femmodel.elements[i])
++	end
++
++	return ug
++
++end#}}}
++function Reducevectorgtofx(ug::IssmVector,nodes::Vector{Node}) #{{{
++
++	#Get size of output vector
++	fsize = NumberOfDofs(nodes,FsetEnum)
++
++	#Initialize output vector
++	uf = IssmVector(fsize)
++
++	#Go through elements and plug in solution
++	for i=1:length(nodes)
++		VecReduce(nodes[i],ug.vector,uf)
++	end
++
++	return uf
++
++end#}}}
++function Mergesolutionfromftogx(ug::IssmVector, uf::IssmVector, ys::IssmVector, nodes::Vector{Node}) #{{{
++
++	#Go through elements and plug in solution
++	for i=1:length(nodes)
++		VecMerge(nodes[i],ug,uf.vector,ys.vector)
++	end
++
++	return ug
++
++end#}}}
++function Reduceloadx!(pf::IssmVector, Kfs::IssmMatrix, ys::IssmVector) #{{{
++
++	#Is there anything to do?
++	m, n = GetSize(Kfs)
++
++	if(m*n>0)
++
++		#Allocate Kfs*ys
++		Kfsy_s=IssmVector(m)
++
++		#Perform multiplication
++		MatMult!(Kfs,ys,Kfsy_s)
++
++		#Subtract Kfs*ys from pf
++		AXPY!(pf,-1.0,Kfsy_s)
++
++	end
++end#}}}
++function SystemMatricesx(femmodel::FemModel,analysis::Analysis)# {{{
++
++	#Allocate matrices
++	fsize = NumberOfDofs(femmodel.nodes,FsetEnum)
++	ssize = NumberOfDofs(femmodel.nodes,SsetEnum)
++	Kff = IssmMatrix(fsize,fsize)
++	Kfs = IssmMatrix(fsize,ssize)
++	pf  = IssmVector(fsize)
++
++	#Construct Stiffness matrix and load vector from elements
++	for i in 1:length(femmodel.elements)
++		Ke = CreateKMatrix(analysis,femmodel.elements[i])
++		pe = CreatePVector(analysis,femmodel.elements[i])
++
++		AddToGlobal!(Ke,Kff,Kfs)
++		AddToGlobal!(pe,pf)
++	end
++
++	Assemble!(Kff)
++	Assemble!(Kfs)
++	Assemble!(pf)
++	
++	return Kff, Kfs, pf
++end# }}}
++function CreateNodalConstraintsx(nodes::Vector{Node})# {{{
++
++	#Allocate vector
++	ssize=NumberOfDofs(nodes,SsetEnum)
++	ys=IssmVector(ssize)
++
++	#constraints vector with the constraint values
++	for i in 1:length(nodes)
++		CreateNodalConstraints(nodes[i],ys)
++	end
++
++	return ys
++end# }}}
++function RequestedOutputsx(femmodel::FemModel,outputlist::Vector{IssmEnum})# {{{
++
++	#Get Step and Time from parameters
++	step = FindParam(femmodel.parameters,StepEnum)
++	time = FindParam(femmodel.parameters,TimeEnum)
++	
++	#Now fetch results
++	for i in 1:length(outputlist)
++
++		#See if outputlist[i] is an input
++		if outputlist[i]>InputsSTARTEnum && outputlist[i]<InputsENDEnum
++
++			#Create Result
++			input  = GetInput(femmodel.inputs,outputlist[i])
++			result = Result(step, time, copy(input.values))
++
++			#Add to femmodel.results dataset
++			push!(femmodel.results,result)
++
++		else
++			println("Output ",outputlist[i]," not supported yet")
++		end
++	end
++end# }}}
+Index: ../trunk-jpl/src/jl/core/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/toolkits.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/toolkits.jl	(revision 26725)
+@@ -0,0 +1,136 @@
++
++#Toolkit #1: serial sparse arrays
++using SparseArrays
++
++#Matrix
++mutable struct IssmMatrix #{{{
++	M::Int64
++	N::Int64
++	rows::Vector{Int64}
++	cols::Vector{Int64}
++	vals::Vector{Float64}
++	matrix::SparseMatrixCSC{Float64,Int64}
++end #}}}
++function IssmMatrix(M::Int64,N::Int64)#{{{
++	return IssmMatrix(M, N, Vector{Int64}(undef,0), Vector{Int64}(undef,0), Vector{Float64}(undef,0), spzeros(0,0))
++end#}}}
++function AddValues!(matrix::IssmMatrix,m::Int64,midx::Vector{Int64},n::Int64,nidx::Vector{Int64},values::Matrix{Float64})#{{{
++
++	#This is inefficient now, but it will work
++	for i in 1:m
++		if(midx[i]==-1) continue end
++		for j in 1:n
++			if(nidx[j]==-1) continue end
++			push!(matrix.rows, midx[i])
++			push!(matrix.cols, nidx[j])
++			push!(matrix.vals, values[i,j])
++		end
++	end
++
++end#}}}
++function GetSize(matrix::IssmMatrix)#{{{
++
++	return size(matrix.matrix)
++
++end#}}}
++function Assemble!(matrix::IssmMatrix)#{{{
++
++	matrix.matrix = sparse(matrix.rows, matrix.cols, matrix.vals, matrix.M, matrix.N)
++
++end#}}}
++
++#Vector
++mutable struct IssmVector #{{{
++	vector::Vector{Float64}
++end #}}}
++function IssmVector(M::Int64)#{{{
++	return IssmVector(zeros(M))
++end#}}}
++function GetSize(vector::IssmVector)#{{{
++
++	return length(vector.vector)
++
++end#}}}
++function AddValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
++
++	#This is inefficient now, but it will work
++	for i in 1:m
++		if(midx[i]==-1) continue end
++		vector.vector[midx[i]] += values[i]
++	end
++
++end#}}}
++function SetValues!(vector::IssmVector,m::Int64,midx::Vector{Int64},values::Vector{Float64})#{{{
++
++	#This is inefficient now, but it will work
++	for i in 1:m
++		if(midx[i]==-1) continue end
++		vector.vector[midx[i]] = values[i]
++	end
++
++end#}}}
++function IsEmpty(vector::IssmVector)#{{{
++
++	return GetSize(vector)==0
++
++end#}}}
++function Duplicate(vector::IssmVector)#{{{
++
++	#Copy data structure
++	M=GetSize(vector)
++	return IssmVector(M)
++
++end#}}}
++function VecCopy!(x::IssmVector,y::IssmVector)#{{{
++
++	y.vector = x.vector
++
++end#}}}
++function Assemble!(vector::IssmVector)#{{{
++
++	#Nothing to do for this toolkit
++
++end#}}}
++function Norm(x::IssmVector,type::Int64)#{{{
++
++	norm = 0
++
++	if type==2
++		for i in 1:length(x.vector)
++			norm += x.vector[i]^2
++		end
++		norm = sqrt(norm)
++	elseif type==3
++		#Infinite norm
++		for i in 1:length(x.vector)
++			if(abs(x.vector[i])>norm) norm = abs(x.vector[i]) end
++		end
++	else
++		error("type ",type," not supported yet")
++	end
++
++	return norm
++
++end#}}}
++
++#Operations
++function MatMult!(A::IssmMatrix,x::IssmVector,y::IssmVector) #{{{
++
++	y.vector = A.matrix*x.vector
++
++end#}}}
++function AXPY!(y::IssmVector,alpha::Float64,x::IssmVector) #{{{
++
++	y.vector = alpha*x.vector + y.vector
++
++end#}}}
++function Solverx(A::IssmMatrix,b::IssmVector,xold::IssmVector) #{{{
++
++	x = IssmVector(GetSize(xold))
++	x.vector = (A.matrix\b.vector)
++
++	return x
++
++
++end#}}}
++
+Index: ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26725)
+@@ -0,0 +1,264 @@
++#StressbalanceAnalysis class definition
++struct StressbalanceAnalysis <: Analysis#{{{
++end #}}}
++
++#Model Processing
++function CreateConstraints(analysis::StressbalanceAnalysis,constraints::Vector{Constraint},md::model) #{{{
++
++	#load constraints from model
++	spcvx = md.stressbalance.spcvx
++	spcvy = md.stressbalance.spcvy
++
++	count = 1
++	for i in 1:md.mesh.numberofvertices
++		if ~isnan(spcvx[i])
++			push!(constraints,Constraint(count,i,1,spcvx[i]/md.constants.yts))
++			count+=1
++		end
++		if ~isnan(spcvy[i])
++			push!(constraints,Constraint(count,i,2,spcvy[i]/md.constants.yts))
++			count+=1
++		end
++	end
++
++end#}}}
++function CreateNodes(analysis::StressbalanceAnalysis,nodes::Vector{Node},md::model) #{{{
++
++	numdof = 2
++	for i in 1:md.mesh.numberofvertices
++		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
++	end
++end#}}}
++function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
++
++	#Provide node indices to element
++	for i in 1:md.mesh.numberofvertices
++		Update(elements[i],inputs,i,md,P1Enum)
++	end
++
++	#Add necessary inputs to perform this analysis
++	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
++	FetchDataToInput(md,inputs,elements,md.mask.ice_levelset, MaskIceLevelsetEnum)
++	FetchDataToInput(md,inputs,elements,md.mask.ocean_levelset, MaskOceanLevelsetEnum)
++
++	#Deal with friction
++	if typeof(md.friction)==BuddFriction
++		FetchDataToInput(md,inputs,elements,md.friction.coefficient,FrictionCoefficientEnum)
++	else
++		error("Friction ", typeof(md.friction), " not supported yet")
++	end
++
++end#}}}
++function UpdateParameters(analysis::StressbalanceAnalysis,parameters::Parameters,md::model) #{{{
++	AddParam(parameters,md.stressbalance.restol,StressbalanceRestolEnum)
++	AddParam(parameters,md.stressbalance.reltol,StressbalanceReltolEnum)
++	AddParam(parameters,md.stressbalance.abstol,StressbalanceAbstolEnum)
++	AddParam(parameters,md.stressbalance.maxiter,StressbalanceMaxiterEnum)
++
++	#Deal with friction
++	if typeof(md.friction)==BuddFriction
++		AddParam(parameters, 1, FrictionLawEnum)
++	else
++		error("Friction ", typeof(md.friction), " not supported yet")
++	end
++end#}}}
++
++#Finite Element Analysis
++function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
++
++	#Fetch parameters relevant to solution sequence
++	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
++	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
++	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
++	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
++
++	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
++
++end #}}}
++function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
++
++	#Internmediaries
++	numnodes = 3
++	
++	#Initialize Element matrix and basis function derivatives
++	Ke = ElementMatrix(element.nodes)
++	dbasis = Matrix{Float64}(undef,numnodes,2)
++
++	#Retrieve all inputs and parameters
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	H_input  = GetInput(element, ThicknessEnum)
++
++	#Prepare material object
++	material = Matice(element)
++	
++	#Start integrating
++	gauss = GaussTria(2)
++	for ig in 1:gauss.numgauss
++
++		Jdet = JacobianDeterminant(xyz_list, gauss)
++		NodalFunctionsDerivatives(element,dbasis,xyz_list,gauss)
++
++		H  = GetInputValue(H_input, gauss, ig)
++		mu = ViscositySSA(material, xyz_list, gauss, ig)
++
++		for i in 1:numnodes
++			for j in 1:numnodes
++				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,1]*dbasis[i,1] + dbasis[j,2]*dbasis[i,2])
++				Ke.values[2*i-1,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,2]*dbasis[i,1] + dbasis[j,1]*dbasis[i,2])
++				Ke.values[2*i  ,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,1]*dbasis[i,2] + dbasis[j,2]*dbasis[i,1])
++				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,2]*dbasis[i,2] + dbasis[j,1]*dbasis[i,1])
++			end
++		end
++	end
++
++	#Add basal friction
++	phi=GetGroundedPortion(element, xyz_list)
++
++	if(phi>0)
++		basis = Vector{Float64}(undef,numnodes)
++		friction = CoreFriction(element)
++
++		#Start integrating
++		gauss = GaussTria(2)
++		for ig in 1:gauss.numgauss
++
++			Jdet = JacobianDeterminant(xyz_list, gauss)
++			NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++			alpha2 = Alpha2(friction, gauss, ig)
++
++			for i in 1:numnodes
++				for j in 1:numnodes
++					Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
++					Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
++				end
++			end
++		end
++	end
++
++	return Ke
++end #}}}
++function CreatePVector(analysis::StressbalanceAnalysis,element::Tria)# {{{
++
++	#Internmediaries
++	numnodes = 3
++
++	#Initialize Element vectro and basis functions
++	pe = ElementVector(element.nodes)
++	basis = Vector{Float64}(undef,numnodes)
++
++	#Retrieve all inputs and parameters
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	H_input  = GetInput(element, ThicknessEnum)
++	s_input  = GetInput(element, SurfaceEnum)
++	rho_ice  = FindParam(element, MaterialsRhoIceEnum)
++	g        = FindParam(element, ConstantsGEnum)
++
++	#Start integrating
++	gauss = GaussTria(2)
++	for ig in 1:gauss.numgauss
++
++		Jdet = JacobianDeterminant(xyz_list, gauss)
++		NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++		H  = GetInputValue(H_input, gauss, ig)
++		ds = GetInputDerivativeValue(s_input, xyz_list, gauss, ig)
++
++		for i in 1:numnodes
++			pe.values[2*i-1] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[1]*basis[i]
++			pe.values[2*i  ] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[2]*basis[i]
++		end
++	end
++
++	if(IsIcefront(element))
++
++		#Get additional parameters and inputs
++		b_input   = GetInput(element, BaseEnum)
++		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
++
++		#Get normal and ice front coordinates
++		xyz_list_front = Matrix{Float64}(undef,2,3)
++		GetIcefrontCoordinates!(element, xyz_list_front, xyz_list, MaskIceLevelsetEnum)
++		nx, ny = NormalSection(element, xyz_list_front)
++
++		gauss = GaussTria(element, xyz_list, xyz_list_front, 3)
++		for ig in 1:gauss.numgauss
++
++			Jdet = JacobianDeterminantSurface(xyz_list_front, gauss)
++			NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++			H  = GetInputValue(H_input, gauss, ig)
++			b  = GetInputValue(b_input, gauss, ig)
++			sl = 0
++
++			term = 0.5*g*rho_ice*H^2 + 0.5*g*rho_water*(min(0, H+b-sl)^2 - min(0, b-sl)^2)
++
++			for i in 1:numnodes
++				pe.values[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
++				pe.values[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
++			end
++		end
++	end
++
++	return pe
++end #}}}
++function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::IssmVector,element::Tria) #{{{
++
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++	@assert length(doflist)==6
++
++	#Fetch inputs
++	vx_input = GetInput(element, VxEnum)
++	vy_input = GetInput(element, VyEnum)
++
++	#Loop over each node and enter solution in ug
++	count = 0
++	gauss=GaussTria(P1Enum)
++	for i in 1:gauss.numgauss
++		vx = GetInputValue(vx_input, gauss, i)
++		vy = GetInputValue(vy_input, gauss, i)
++
++		count += 1
++		ug.vector[doflist[count]] = vx
++		count += 1
++		ug.vector[doflist[count]] = vy
++	end
++
++	#Make sure we reached all the values
++	@assert count==length(doflist)
++
++end#}}}
++function InputUpdateFromSolution(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{
++
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++
++	#Get solution vector for this element
++	numdof   = 3*2
++	values = Vector{Float64}(undef,numdof)
++	for i in 1:numdof values[i]=ug[doflist[i]] end
++
++	#Now split solution vector into x and y components
++	numnodes = 3
++	vx  = Vector{Float64}(undef,numnodes)
++	vy  = Vector{Float64}(undef,numnodes)
++	vel = Vector{Float64}(undef,numnodes)
++	for i in 1:numnodes 
++		vx[i]=values[2*i-1] 
++		vy[i]=values[2*i] 
++		@assert isfinite(vx[i])
++		@assert isfinite(vy[i])
++
++		vel[i] =sqrt(vx[i]^2 + vy[i]^2)
++	end
++
++	AddInput(element, VxEnum,  vx,  P1Enum)
++	AddInput(element, VyEnum,  vy,  P1Enum)
++	AddInput(element, VelEnum, vel, P1Enum)
++end#}}}
+Index: ../trunk-jpl/src/jl/core/analyses/analysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/analysis.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/analyses/analysis.jl	(revision 26725)
+@@ -0,0 +1,2 @@
++#Analysis class definitions
++abstract type Analysis end
+Index: ../trunk-jpl/src/jl/core/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/elements.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/elements.jl	(revision 26725)
+@@ -0,0 +1,378 @@
++#Tria class definition
++mutable struct Tria #{{{
++	sid::Int64
++	pid::Int64
++	#vertexids::Int64[3]
++	#vertices::Vertex[3]
++	vertexids::Vector{Int64}
++	vertices::Vector{Vertex}
++	nodeids::Vector{Int64}
++	nodes::Vector{Node}
++	parameters::Parameters
++	inputs::Inputs
++end# }}}
++
++#Element functions
++function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
++	if size(data,1)==inputs.numberofelements
++		SetTriaInput(inputs,enum,P0Enum,element.sid,data[element.sid])
++	elseif size(data,1)==inputs.numberofvertices
++		SetTriaInput(inputs,enum,P1Enum,element.vertexids,data[element.vertexids])
++	else
++		error("size ",size(data,1)," not supported yet");
++	end
++end #}}}
++function AddInput(element::Tria,inputenum::IssmEnum,data::Vector{Float64},interpolation::IssmEnum) #{{{
++	if interpolation==P1Enum
++		@assert length(data)==3
++		SetTriaInput(element.inputs,inputenum,P1Enum,element.vertexids,data)
++	else
++		error("interpolation ", interpolation, " not supported yet");
++	end
++end #}}}
++function Update(element::Tria,inputs::Inputs,index::Int64,md::model,finiteelement::IssmEnum) #{{{
++
++	if finiteelement==P1Enum
++		numnodes = 3
++		element.nodeids    = Vector{Int64}(undef,numnodes)
++		element.nodeids[1] = md.mesh.elements[index,1]
++		element.nodeids[2] = md.mesh.elements[index,2]
++		element.nodeids[3] = md.mesh.elements[index,3]
++	else
++		error("not supported yet")
++	end
++end #}}}
++function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) # {{{
++
++   #Configure vertices
++   for i in 1:3
++		element.vertices[i] = vertices[element.vertexids[i]]
++   end
++
++	#Configure nodes (assuming P1 finite elements)
++	for i in 1:3
++		element.nodes[i] = nodes[element.nodeids[i]]
++	end
++
++	#Point to real datasets
++	element.parameters = parameters
++	element.inputs     = inputs
++	
++end # }}}
++function GetDofList(element::Tria,setenum::IssmEnum) # {{{
++
++	#Define number of nodes
++	numnodes = 3
++
++	#Determine size of doflist
++	numdofs = 0
++	for i in 1:numnodes
++		numdofs += GetNumberOfDofs(element.nodes[i],GsetEnum)
++	end
++
++	#Allocate doflist vector
++	doflist = Vector{Int64}(undef,numdofs)
++
++	#enter dofs in doflist vector
++	count = 0
++	for i in 1:numnodes
++		count = GetDofList(element.nodes[i],doflist,count,GsetEnum)
++	end
++
++	return doflist
++end # }}}
++function GetInput(element::Tria,enum::IssmEnum) # {{{
++
++	input = GetInput(element.inputs,enum)
++	InputServe!(element,input)
++	return input
++
++end # }}}
++function GetInputListOnVertices!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
++
++	#Get Input first 
++	input = GetInput(element, enum)
++
++	#Get value at each vertex (i.e. P1 Nodes)
++	gauss=GaussTria(P1Enum)
++	for i in 1:gauss.numgauss
++		vector[i] = GetInputValue(input, gauss, i)
++	end
++
++end # }}}
++function FindParam(element::Tria,enum::IssmEnum) # {{{
++
++	return FindParam(element.parameters, enum)
++
++end # }}}
++function InputServe!(element::Tria,input::ElementInput) # {{{
++
++	if input.interp==P0Enum
++		input.element_values[1] = input.values[element.sid]
++	elseif input.interp==P1Enum
++		for i in 1:3
++			input.element_values[i] = input.values[element.vertices[i].sid]
++		end
++	else
++		error("interpolation ",input.interp," not supported yet")
++	end
++
++end # }}}
++function GetGroundedPortion(element::Tria, xyz_list::Matrix{Float64}) #{{{
++
++	level = Vector{Float64}(undef,3)
++	GetInputListOnVertices!(element, level, MaskOceanLevelsetEnum)
++
++	#Be sure that values are not zero
++	epsilon = 1.e-15
++	for i in 1:3
++		if(level[i]==0.) level[i]=level[i]+epsilon end
++	end
++
++	if level[1]>0 && level[2]>0 && level[3]>0
++      #Completely grounded
++		phi = 1.0
++   elseif level[1]<0 && level[2]<0 && level[3]<0
++      #Completely floating
++      phi = 0.0
++   else
++		#Partially floating,
++		if(level[1]*level[2]>0) #Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
++			s1=level[3]/(level[3]-level[2]);
++			s2=level[3]/(level[3]-level[1]);
++		elseif(level[2]*level[3]>0) #Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
++			s1=level[1]/(level[1]-level[2]);
++			s2=level[1]/(level[1]-level[3]);
++		elseif(level[1]*level[3]>0) #Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
++			s1=level[2]/(level[2]-level[1]);
++			s2=level[2]/(level[2]-level[3]);
++		else
++			error("not supposed to be here...")
++		end
++
++		if(level[1]*level[2]*level[3]>0)
++			phi = s1*s2
++		else
++			phi = (1-s1*s2)
++		end
++	end
++
++	return phi
++end#}}}
++function IsIcefront(element::Tria) #{{{
++
++	level = Vector{Float64}(undef,3)
++	GetInputListOnVertices!(element, level, MaskIceLevelsetEnum)
++
++	nbice = 0
++	for i in 1:3
++		if(level[i]<0.) nbice+=1 end
++	end
++
++	if(nbice==1)
++		return true
++	else
++		return false
++	end
++end#}}}
++function GetIcefrontCoordinates!(element::Tria, xyz_front::Matrix{Float64}, xyz_list::Matrix{Float64}, levelsetenum::IssmEnum) #{{{
++
++	#Intermediaries
++	level        = Vector{Float64}(undef,3)
++	indicesfront = Vector{Int64}(undef,3)
++
++	#Recover value of levelset for all vertices
++	GetInputListOnVertices!(element, level, levelsetenum)
++
++	#Get nodes where there is no ice
++	num_frontnodes = 0
++	for i in 1:3
++		if(level[i]>=0.)
++			num_frontnodes += 1
++			indicesfront[num_frontnodes] = i
++		end
++	end
++	@assert num_frontnodes==2
++
++	#Arrange order of frontnodes such that they are oriented counterclockwise
++	NUMVERTICES = 3
++	if((NUMVERTICES+indicesfront[1]-indicesfront[2])%NUMVERTICES != NUMVERTICES-1)
++		index=indicesfront[1]
++		indicesfront[1]=indicesfront[2]
++		indicesfront[2]=index
++	end
++
++	#Return nodes
++	xyz_front[1,:]=xyz_list[indicesfront[1],:]
++	xyz_front[2,:]=xyz_list[indicesfront[2],:]
++
++end#}}}
++function GetArea(element::Tria)#{{{
++
++	#Get xyz list
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
++	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
++	x3 = xyz_list[3,1]; y3 = xyz_list[3,2]
++
++	@assert x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0
++	return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2
++end#}}}
++function NormalSection(element::Tria, xyz_front::Matrix{Float64}) #{{{
++
++	#Build output pointing vector
++	nx =  xyz_front[2,2] - xyz_front[1,2]
++	ny = -xyz_front[2,1] + xyz_front[1,1]
++
++	#normalize
++	norm = sqrt(nx^2 + ny^2)
++	nx = nx/norm
++	ny = ny/norm
++
++	return nx, ny
++end#}}}
++
++#Finite Element stuff
++function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	#Get Jacobian Matrix
++	J = Jacobian(xyz_list)
++
++	#Get its determinant
++	Jdet = Matrix2x2Determinant(J)
++
++	#check and return
++	if(Jdet<0) error("negative Jacobian Determinant") end
++	return Jdet
++
++end#}}}
++function JacobianDeterminantSurface(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	x1 = xyz_list[1,1]; y1 = xyz_list[1,2]
++	x2 = xyz_list[2,1]; y2 = xyz_list[2,2]
++	Jdet = .5*sqrt((x2-x1)^2 + (y2-y1)^2)
++
++	#check and return
++	if(Jdet<0) error("negative Jacobian Determinant") end
++	return Jdet
++
++end#}}}
++function Jacobian(xyz_list::Matrix{Float64}) #{{{
++
++	J = Matrix{Float64}(undef,2,2)
++
++	x1 = xyz_list[1,1]
++	y1 = xyz_list[1,2]
++	x2 = xyz_list[2,1]
++	y2 = xyz_list[2,2]
++	x3 = xyz_list[3,1]
++	y3 = xyz_list[3,2]
++
++	J[1,1] = .5*(x2-x1)
++	J[1,2] = .5*(y2-y1)
++	J[2,1] = sqrt(3)/6*(2*x3 -x1 -x2)
++	J[2,2] = sqrt(3)/6*(2*y3 -y1 -y2)
++
++	return J
++end#}}}
++function JacobianInvert(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	#Get Jacobian matrix
++	J = Jacobian(xyz_list)
++
++	#Get its determinant
++	Jinv = Matrix2x2Invert(J)
++
++	return Jinv
++end#}}}
++function NodalFunctions(element::Tria,basis::Vector{Float64}, gauss::GaussTria, ig::Int64, finiteelement::IssmEnum) #{{{
++
++	if(finiteelement==P0Enum)
++		#Nodal function 1
++		basis[1]= 1
++	elseif(finiteelement==P1Enum)
++		basis[1] = gauss.coords1[ig]
++		basis[2] = gauss.coords2[ig]
++		basis[3] = gauss.coords3[ig]
++	else
++		error("Element type ",finiteelement," not supported yet")
++	end
++
++
++end#}}}
++function NodalFunctionsDerivatives(element::Tria,dbasis::Matrix{Float64},xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
++
++	#Get nodal function derivatives in reference element
++	dbasis_ref = Matrix{Float64}(undef,3,2)
++	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,P1Enum)
++
++	#Get invert of the Jacobian
++	Jinv = JacobianInvert(xyz_list,gauss)
++
++	#Build dbasis:
++	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
++	#[ dNi/dy ] =        [dNhat_i/ds]
++	for i in 1:3
++		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
++		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
++	end
++
++end#}}}
++function NodalFunctionsDerivativesReferenceTria(dbasis::Matrix{Float64}, gauss::GaussTria, finiteelement::IssmEnum) #{{{
++
++	if(finiteelement==P0Enum)
++		#Nodal function 1
++		dbasis[1,1]= 0
++		dbasis[1,2]= 0
++
++	elseif(finiteelement==P1Enum)
++		#Nodal function 1
++		dbasis[1,1]= -.5
++		dbasis[1,2]= -sqrt(3)/6
++		#Nodal function 2
++		dbasis[2,1]= .5
++		dbasis[2,2]= -sqrt(3)/6
++		#Nodal function 3
++		dbasis[3,1]= 0
++		dbasis[3,2]= sqrt(3)/3
++	else
++		error("Element type ",finiteelement," not supported yet")
++	end
++end#}}}
++function NumberofNodesTria(finiteelement) #{{{
++
++	if    (finiteelement==P0Enum) return 0
++	elseif(finiteelement==P1Enum) return 3
++	else
++		error("Element type ",finiteelement," not supported yet")
++	end
++end#}}}
++function GaussTria(element::Tria, xyz_list::Matrix{Float64}, xyz_list_front::Matrix{Float64}, order::Int64) #{{{
++
++	area_coordinates = Matrix{Float64}(undef,2,3)
++	GetAreaCoordinates!(element, area_coordinates, xyz_list_front, xyz_list)
++
++	return GaussTria(area_coordinates, order)
++end# }}}
++function GetAreaCoordinates!(element::Tria, area_coordinates::Matrix{Float64}, xyz_zero::Matrix{Float64}, xyz_list::Matrix{Float64})#{{{
++
++	numpoints = size(area_coordinates,1)
++	area = GetArea(element)
++
++	#Copy original xyz_list
++	xyz_bis=copy(xyz_list)
++	for i in 1:numpoints
++		for j in 1:3
++
++			#Change appropriate line
++			xyz_bis[j,:] = xyz_zero[i,:]
++
++			#Compute area fraction
++			area_portion=abs(xyz_bis[2,1]*xyz_bis[3,2] - xyz_bis[2,2]*xyz_bis[3,1] + xyz_bis[1,1]*xyz_bis[2,2] - xyz_bis[1,2]*xyz_bis[2,1] + xyz_bis[3,1]*xyz_bis[1,2] - xyz_bis[3,2]*xyz_bis[1,1])/2
++			area_coordinates[i,j] = area_portion/area
++
++			#reinitialize xyz_list
++			xyz_bis[j,:] = xyz_list[j,:]
++		end
++	end
++end #}}}
+Index: ../trunk-jpl/src/jl/core/gauss.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/gauss.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/gauss.jl	(revision 26725)
+@@ -0,0 +1,113 @@
++#Gauss class definition
++struct GaussTria #{{{
++	numgauss::Int64
++	weights::Vector{Float64}
++	coords1::Vector{Float64}
++	coords2::Vector{Float64}
++	coords3::Vector{Float64}
++end #}}}
++function Base.show(io::IO, this::GaussTria)# {{{
++
++	println(io,"GaussTria:")
++	println(io,"   numgauss: ",this.numgauss)
++	println(io,"   weights:  ",this.weights)
++	println(io,"   coords1:  ",this.coords1)
++	println(io,"   coords2:  ",this.coords2)
++	println(io,"   coords3:  ",this.coords3)
++end# }}}
++
++#Gauss constructor
++function GaussTria(order::Int64) #{{{
++
++	#=Gauss quadrature points for the triangle.
++	Higher-order points from D.A. Dunavant, "High Degree Efficient
++	Symmetrical Gaussian Quadrature Rules for the Triangle", IJNME,
++	Vol. 21, pp. 1129-1148 (1985), as transcribed for Probe rules3.=#
++
++	if(order==1)
++		npoints = 1
++		weights = [1.732050807568877]
++		coords1 = [0.333333333333333]
++		coords2 = [0.333333333333333]
++		coords3 = [0.333333333333333]
++	elseif(order==2)
++		npoints = 3
++		weights = [0.577350269189625; 0.577350269189625; 0.577350269189625]
++		coords1 = [0.666666666666667; 0.166666666666667; 0.166666666666667]
++		coords2 = [0.166666666666667; 0.666666666666667; 0.166666666666667]
++		coords3 = [0.166666666666667; 0.166666666666667; 0.666666666666667]
++	elseif(order==3)
++		npoints = 4
++		weights = [-0.974278579257493; 0.902109795608790; 0.902109795608790; 0.902109795608790]
++		coords1 = [ 0.333333333333333; 0.600000000000000; 0.200000000000000; 0.200000000000000]
++		coords2 = [ 0.333333333333333; 0.200000000000000; 0.600000000000000; 0.200000000000000]
++		coords3 = [ 0.333333333333333; 0.200000000000000; 0.200000000000000; 0.600000000000000]
++	else
++		error("order ",order," not supported yet");
++	end
++
++	return GaussTria(npoints,weights,coords1,coords2,coords3)
++end# }}}
++function GaussTria(finiteelement::IssmEnum) #{{{
++
++	if(finiteelement==P0Enum)
++		npoints = 1
++		weights = [1.]
++		coords1 = [0.333333333333333]
++		coords2 = [0.333333333333333]
++		coords3 = [0.333333333333333]
++	elseif(finiteelement==P1Enum)
++			npoints = 3
++			weights = 0.333333333333333*ones(3)
++			coords1 = [1.; 0.; 0.]
++			coords2 = [0.; 1.; 0.]
++			coords3 = [0.; 0.; 1.]
++	else
++		error("finite element ", finiteelement," not supported yet");
++	end
++
++	return GaussTria(npoints,weights,coords1,coords2,coords3)
++end# }}}
++function GaussTria(area_coordinates::Matrix{Float64}, order::Int64) #{{{
++	#=Gauss-Legendre quadrature points.
++
++	The recurrence coefficients for Legendre polynomials on (-1,1)
++	are defined (from the ORTHPOL subroutine RECUR with ipoly=1) as:
++
++	alpha(i)=0.
++	beta (i)=1./(4.-1./(i-1)^2))
++
++	For degree p, the required number of Gauss-Legendre points is
++	n>=(p+1)/2.=#
++
++	if(order==1)
++		npoint  = 1
++		weights = [2.000000000000000]
++		coords  = [0.000000000000000]
++	elseif(order==2)
++		npoints = 2
++		weights = [1.000000000000000, 1.000000000000000]
++		coords  = [-0.577350269189626, 0.577350269189626]
++	elseif(order==3)
++		npoints = 3
++		weights = [0.555555555555556, 0.888888888888889, 0.555555555555556]
++		coords  = [-0.774596669241483, 0.000000000000000, 0.774596669241483]
++	elseif(order==4)
++		npoints = 4
++		weights = [0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454]
++		coords  = [-0.861136311594053,-0.339981043584856, 0.339981043584856, 0.861136311594053]
++	else
++      error("order ",order," not supported yet");
++	end
++
++   coords1  = Vector{Float64}(undef,npoints)
++   coords2  = Vector{Float64}(undef,npoints)
++   coords3  = Vector{Float64}(undef,npoints)
++   for i in 1:npoints
++      coords1[i]  = 0.5*(area_coordinates[1,1]+area_coordinates[2,1]) + 0.5*coords[i]*(area_coordinates[2,1]-area_coordinates[1,1]);
++      coords2[i]  = 0.5*(area_coordinates[1,2]+area_coordinates[2,2]) + 0.5*coords[i]*(area_coordinates[2,2]-area_coordinates[1,2]);
++      coords3[i]  = 0.5*(area_coordinates[1,3]+area_coordinates[2,3]) + 0.5*coords[i]*(area_coordinates[2,3]-area_coordinates[1,3]);
++   end
++
++	return GaussTria(npoints, weights, coords1, coords2, coords3)
++end# }}}
+Index: ../trunk-jpl/src/jl/core/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/solutionsequences.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/solutionsequences.jl	(revision 26725)
+@@ -0,0 +1,106 @@
++function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
++
++	#Initialize number of iterations
++	count = 0
++	converged = false
++
++	#Get existing solution
++	ug = GetSolutionFromInputsx(analysis,femmodel)
++	uf = Reducevectorgtofx(ug,femmodel.nodes)
++
++	#Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
++	InputUpdateFromSolutionx(analysis,ug,femmodel)
++
++	#Loop until we reach convergence
++	while(~converged)
++
++		#Get new matrices
++		Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
++
++		#Enforce constraints
++		ys = CreateNodalConstraintsx(femmodel.nodes)
++		Reduceloadx!(pf, Kfs, ys)
++
++		#Solve!
++		old_uf = uf
++		uf = Solverx(Kff, pf, old_uf)
++
++		#Merge uf with ys
++		Mergesolutionfromftogx(ug, uf, ys, femmodel.nodes)
++
++		#Check for convergence
++		converged = convergence(Kff,pf,uf,old_uf,restol,reltol,abstol)
++		InputUpdateFromSolutionx(analysis,ug,femmodel)
++
++		#Increase count
++		count += 1
++		if(count>=maxiter)
++			println("   maximum number of nonlinear iterations (",maxiter,") exceeded")
++			converged = true
++		end
++	end
++
++	print("\n   total number of iterations: ",  count,  "\n")
++
++end# }}}
++function convergence(Kff::IssmMatrix, pf::IssmVector, uf::IssmVector, old_uf::IssmVector, restol::Float64, reltol::Float64, abstol::Float64)#{{{
++
++	print("   checking convergence\n");
++
++	#If solution vector is empty, return true
++	if(IsEmpty(uf))
++		return true
++	end
++
++	#Convergence criterion #1: force equilibrium (Mandatory)
++	#compute K[n]U[n-1] - F
++	KUold  = Duplicate(uf);    MatMult!(Kff,old_uf,KUold)
++	KUoldF = Duplicate(KUold); VecCopy!(KUold, KUoldF); AXPY!(KUoldF, -1.0, pf)
++	nKUoldF = Norm(KUoldF,2)
++	nF      = Norm(pf,2)
++	res = nKUoldF/nF
++	if ~isfinite(res)
++		println("norm nf = ", nF, " and norm kuold = ",nKUoldF)
++		error("mechanical equilibrium convergence criterion is not finite!")
++	end
++	if(res<restol)
++		print("   mechanical equilibrium convergence criterion ", res*100, " < ", restol*100, " %\n")
++		converged=true
++	else
++		print("   mechanical equilibrium convergence criterion ", res*100, " > ", restol*100, " %\n")
++		converged=false;
++	end
++
++	#Convergence criterion #2: norm(du)/norm(u)
++	if ~isnan(reltol)
++		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
++		ndu = Norm(duf, 2); nu = Norm(old_uf, 2)
++		if ~isfinite(ndu) | ~isfinite(nu) 
++			error("convergence criterion is not finite!")
++		end
++		if((ndu/nu)<reltol)
++			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " < ", reltol*100, " %\n")
++		else
++			print("   Convergence criterion: norm(du)/norm(u)      ", ndu/nu*100, " > ", reltol*100, " %\n")
++			converged=false;
++		end
++	end
++
++	#Convergence criterion #3: max(du)
++	if ~isnan(abstol)
++		duf = Duplicate(old_uf); VecCopy!(old_uf,duf); AXPY!(duf, -1.0, uf)
++		nduinf= Norm(duf, 3)
++		if ~isfinite(nduinf) 
++			error("convergence criterion is not finite!")
++		end
++		if(nduinf<abstol)
++			print("   Convergence criterion: max(du)               ", nduinf, " < ", abstol, "\n")
++		else
++			print("   Convergence criterion: max(du)               ", nduinf, " > ", abstol, "\n")
++			converged=false;
++		end
++	end
++
++	return converged
++
++end#}}}
+Index: ../trunk-jpl/src/jl/core/friction.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/friction.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/friction.jl	(revision 26725)
+@@ -0,0 +1,43 @@
++#Friction class definition
++
++abstract type CoreFriction end
++struct CoreBuddFriction#{{{
++	H_input::ElementInput
++	b_input::ElementInput
++	c_input::ElementInput
++	rho_ice::Float64
++	rho_water::Float64
++	g::Float64
++end# }}}
++function CoreFriction(element::Tria) #{{{
++
++	frictionlaw = FindParam(element, FrictionLawEnum)
++
++	if frictionlaw==1
++		H_input  = GetInput(element, ThicknessEnum)
++		b_input  = GetInput(element, BaseEnum)
++		c_input  = GetInput(element, FrictionCoefficientEnum)
++
++		rho_ice   = FindParam(element, MaterialsRhoIceEnum)
++		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
++		g         = FindParam(element, ConstantsGEnum)
++
++		return CoreBuddFriction(H_input, b_input, c_input, rho_ice, rho_water, g)
++	else
++		error("Friction ",typeof(md.friction)," not supported yet")
++	end
++end#}}}
++
++#vertices functions
++function Alpha2(friction::CoreBuddFriction, gauss::GaussTria, i::Int64) #{{{
++
++	#Get effective pressure
++	H = GetInputValue(friction.H_input, gauss, i)
++	b = GetInputValue(friction.b_input, gauss, i)
++	c = GetInputValue(friction.c_input, gauss, i)
++	N = friction.rho_ice*friction.g*H + friction.rho_water*friction.g*b
++
++	if(N<0) N=0 end
++
++	return c^2*N
++end #}}}
+Index: ../trunk-jpl/src/jl/core/femmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/femmodel.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/femmodel.jl	(revision 26725)
+@@ -0,0 +1,14 @@
++#femmodel class definition
++mutable struct FemModel #{{{
++	elements::Vector{Tria}
++	vertices::Vector{Vertex}
++	nodes::Vector{Node}
++	parameters::Parameters
++	inputs::Inputs
++	constraints::Vector{Constraint}
++	#loads::Vector{Loads}
++	results::Vector{Result}
++end#}}}
++
++#femmodel functions
++
+Index: ../trunk-jpl/src/jl/core/results.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/results.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/results.jl	(revision 26725)
+@@ -0,0 +1,5 @@
++mutable struct Result #{{{
++	step::Int64
++	time::Float64
++	value
++end#}}}
+Index: ../trunk-jpl/src/jl/core/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/inputs.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/inputs.jl	(revision 26725)
+@@ -0,0 +1,152 @@
++#Input class definition
++abstract type Input end
++struct BoolInput <: Input#{{{
++	enum::IssmEnum
++	values::Matrix{Bool}
++end# }}}
++struct IntInput <: Input#{{{
++	enum::IssmEnum
++	values::Matrix{Int64}
++end# }}}
++struct ElementInput <: Input#{{{
++	enum::IssmEnum
++	interp::IssmEnum
++	values::Vector{Float64}
++	element_values::Vector{Float64}
++end# }}}
++
++#Inputs dataset definition
++mutable struct Inputs #{{{
++	numberofelements::Int64
++	numberofvertices::Int64
++	lookup::Dict{IssmEnum,Input}
++end# }}}
++
++#Inputs functions
++function GetInput(inputs::Inputs,enum::IssmEnum) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		error("Input ",enum," not found")
++	end
++
++	#return input
++	return inputs.lookup[enum]
++
++end#}}}
++function SetInput(inputs::Inputs,enum::IssmEnum,index::Int64,value::Bool) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofelements > 0
++		input = BoolInput(enum,zeros(Bool,inputs.numberofelements))
++		inputs.lookup[enum] = BoolInput(enum,zeros(Bool,inputs.numberofelements))
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=BoolInput error("not consistent") end
++
++	#set value
++	@assert index>0 && index<=inputs.numberofelements
++	input.values[index] = value
++end#}}}
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,index::Int64,value::Float64) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofelements > 0
++		if interp==P0Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofelements),Vector{Float64}(undef,1))
++		elseif interp==P1Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
++		else
++			error("not supported yet")
++		end
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=ElementInput error("input type not consistent") end
++	if interp!=input.interp        error("input interpolations not consistent") end
++
++	#set value
++	input.values[index] = value
++end#}}}
++function SetTriaInput(inputs::Inputs,enum::IssmEnum,interp::IssmEnum,indices::Vector{Int64},values::Vector{Float64}) #{{{
++
++	#Does this input exist
++	if !haskey(inputs.lookup,enum)
++		#it does not exist yet, we need to create it...
++		@assert inputs.numberofvertices>0
++		if interp==P1Enum
++			inputs.lookup[enum] = ElementInput(enum,interp,zeros(inputs.numberofvertices),Vector{Float64}(undef,3))
++		else
++			error("not supported yet")
++		end
++	end
++
++	#Get this input and check type
++	input = inputs.lookup[enum]
++	if typeof(input)!=ElementInput error("input type not consistent") end
++	if interp!=input.interp        error("input interpolations not consistent") end
++
++	#set value
++	input.values[indices] = values
++end#}}}
++function GetInputAverageValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
++
++	numnodes = NumberofNodesTria(input.interp)
++	value = 0.0
++
++	for i in 1:numnodes
++		value+=input.element_values[i]
++	end
++
++	return value/numnodes
++
++end#}}}
++function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
++
++	if input.interp==P0Enum
++		return input.element_values[1]
++	elseif input.interp==P1Enum
++		value = input.element_values[1]*gauss.coords1[i] +  input.element_values[2]*gauss.coords2[i] +  input.element_values[3]*gauss.coords3[i]
++	else
++		error("not implemented yet")
++	end
++
++	return value
++
++end#}}}
++function GetInputDerivativeValue(input::ElementInput,xyz_list::Matrix{Float64},gauss::GaussTria,i::Int64) #{{{
++
++	#Get nodal function derivatives in reference element
++	numnodes = NumberofNodesTria(input.interp)
++	dbasis_ref = Matrix{Float64}(undef,numnodes,2)
++	NodalFunctionsDerivativesReferenceTria(dbasis_ref,gauss,input.interp)
++
++	#Get invert of the Jacobian
++	Jinv = JacobianInvert(xyz_list,gauss)
++
++	#Build dbasis:
++	#[ dNi/dx ] = Jinv * [dNhat_i/dr]
++	#[ dNi/dy ] =        [dNhat_i/ds]
++	dbasis = Matrix{Float64}(undef,numnodes,2)
++	for i in 1:3
++		dbasis[i,1] = Jinv[1,1]*dbasis_ref[i,1]+Jinv[1,2]*dbasis_ref[i,2]
++		dbasis[i,2] = Jinv[2,1]*dbasis_ref[i,1]+Jinv[2,2]*dbasis_ref[i,2]
++	end
++
++	#Get derivatives: dp/dx dp/dy
++	dp = [0.0;0.0]
++	for i in 1:3
++		dp[1] += dbasis[i,1]*input.element_values[i]
++		dp[2] += dbasis[i,2]*input.element_values[i]
++	end
++
++	return dp
++
++end#}}}
+Index: ../trunk-jpl/src/jl/core/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/nodes.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/nodes.jl	(revision 26725)
+@@ -0,0 +1,240 @@
++#Node class definition
++mutable struct Node #{{{
++	id::Int64
++	sid::Int64
++	indexingupdate::Bool
++	gsize::Int64
++	gdoflist::Vector{Int64}
++	fdoflist::Vector{Int64}
++	sdoflist::Vector{Int64}
++	svalues::Vector{Float64}
++end# }}}
++
++#Node functions
++function Base.show(io::IO, this::Node)# {{{
++
++	println(io,"Node:")
++	println(io,"   id:  ",this.id)
++	println(io,"   sid: ",this.sid)
++	println(io,"   indexingupdate: ",this.indexingupdate)
++	println(io,"   gsize: ",this.gsize)
++	println(io,"   gdoflist: ",this.gdoflist)
++	println(io,"   fdoflist: ",this.fdoflist)
++	println(io,"   sdoflist: ",this.sdoflist)
++	println(io,"   svalues: ",this.svalues)
++end# }}}
++function ApplyConstraint(node::Node,dof::Int8,value::Float64) #{{{
++
++	node.indexingupdate = true
++	node.fdoflist[dof]  = -1
++	node.sdoflist[dof]  = +1
++	node.svalues[dof]   = value
++
++end# }}}
++function CreateNodalConstraints(node::Node,ys::IssmVector) #{{{
++
++	if(SSize(node)>0)
++		SetValues!(ys,node.gsize,node.sdoflist,node.svalues)
++	end
++
++end# }}}
++function DistributeDofs(node::Node,setenum::IssmEnum,dofcount::Int64) #{{{
++
++	if setenum==GsetEnum
++		for i=1:node.gsize
++			node.gdoflist[i] = dofcount
++			dofcount += 1
++		end
++	elseif setenum==FsetEnum
++		for i=1:node.gsize
++			if  node.fdoflist[i]!=-1
++				@assert node.sdoflist[i]==-1
++				node.fdoflist[i] = dofcount
++				dofcount += 1
++			end
++		end
++	elseif setenum==SsetEnum
++		for i=1:node.gsize
++			if  node.sdoflist[i]!=-1
++				@assert node.fdoflist[i]==-1
++				node.sdoflist[i] = dofcount
++				dofcount += 1
++			end
++		end
++	else
++		error("not supported")
++	end
++
++	return dofcount
++end# }}}
++function GetNumberOfDofs(node::Node,setenum::IssmEnum) #{{{
++
++	if setenum==GsetEnum
++		dofcount = node.gsize
++	elseif setenum==FsetEnum
++		dofcount = 0
++		for i=1:node.gsize
++			if  node.fdoflist[i]!=-1
++				dofcount += 1
++			end
++		end
++	elseif setenum==SsetEnum
++		dofcount = 0
++		for i=1:node.gsize
++			if  node.sdoflist[i]!=-1
++				dofcount += 1
++			end
++		end
++	else
++		error("not supported")
++	end
++
++	return dofcount
++
++end# }}}
++function GetDofList(node::Node,doflist::Vector{Int64},count::Int64,setenum::IssmEnum) #{{{
++
++	if setenum==GsetEnum
++		for i in 1:node.gsize
++			count += 1
++			doflist[count] = node.gdoflist[i]
++		end
++	elseif setenum==FsetEnum
++		for i=1:node.gsize
++			#if  node.fdoflist[i]!=-1
++				count += 1
++				doflist[count] = node.fdoflist[i]
++			#end
++		end
++	elseif setenum==SsetEnum
++		for i=1:node.gsize
++			#if  node.sdoflist[i]!=-1
++				count += 1
++				doflist[count] = node.sdoflist[i]
++			#end
++		end
++	else
++		error("not supported")
++	end
++
++	return count
++
++end# }}}
++function GetGlobalDofList(nodes::Vector{Node},ndofs::Int64,setenum::IssmEnum) #{{{
++
++	#Allocate list
++	doflist = Vector{Int64}(undef,ndofs)
++
++	#Assign values 
++	count = 0
++	for i in 1:length(nodes)
++		count = GetDofList(nodes[i],doflist,count,setenum)
++	end
++	@assert count==ndofs
++
++	return doflist
++
++end# }}}
++function VecReduce(node::Node,ug::Vector{Float64},uf::IssmVector) #{{{
++
++	for i=1:node.gsize
++		if node.fdoflist[i]!=-1
++			uf.vector[node.fdoflist[i]] = ug[node.gdoflist[i]]
++		end
++	end
++
++end# }}}
++function VecMerge(node::Node,ug::IssmVector,uf::Vector{Float64},ys::Vector{Float64}) #{{{
++
++	fsize = FSize(node)
++	ssize = SSize(node)
++
++	if fsize>0
++		indices = Vector{Int64}(undef,fsize)
++		values  = Vector{Float64}(undef,fsize)
++
++		count = 1
++		for i=1:node.gsize
++			if node.fdoflist[i]!=-1
++				indices[count] = node.gdoflist[i]
++				values[count]  = uf[node.fdoflist[i]]
++				count += 1
++			end
++		end
++		SetValues!(ug,fsize,indices,values)
++	end
++
++	if ssize>0
++		indices = Vector{Int64}(undef,ssize)
++		values  = Vector{Float64}(undef,ssize)
++
++		count = 1
++		for i=1:node.gsize
++			if node.sdoflist[i]!=-1
++				indices[count] = node.gdoflist[i]
++				values[count]  = ys[node.sdoflist[i]]
++				count += 1
++			end
++		end
++		SetValues!(ug,ssize,indices,values)
++	end
++
++end# }}}
++function SSize(node::Node) #{{{
++
++	ssize = 0
++
++	for i=1:node.gsize
++		if node.sdoflist[i]!=-1
++			ssize+=1
++		end
++	end
++
++	return ssize
++
++end# }}}
++function FSize(node::Node) #{{{
++
++	fsize = 0
++
++	for i=1:node.gsize
++		if node.fdoflist[i]!=-1
++			fsize+=1
++		end
++	end
++
++	return fsize
++
++end# }}}
++
++#Nodes functions
++function RequiresDofReindexing(nodes::Vector{Node}) #{{{
++
++	for i in 1:length(nodes)
++		if nodes[i].indexingupdate
++			return true
++		end
++	end
++
++	return false
++
++end# }}}
++function DistributeDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
++
++	dofcount = 1
++
++	for i in 1:length(nodes)
++		dofcount = DistributeDofs(nodes[i],setenum,dofcount)
++	end
++
++
++end# }}}
++function NumberOfDofs(nodes::Vector{Node},setenum::IssmEnum) #{{{
++
++	numdofs = 0
++	for i in 1:length(nodes)
++		numdofs += GetNumberOfDofs(nodes[i],setenum)
++	end
++	return numdofs
++
++end# }}}
+Index: ../trunk-jpl/src/jl/core/elementmatrix.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/elementmatrix.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/elementmatrix.jl	(revision 26725)
+@@ -0,0 +1,117 @@
++mutable struct ElementMatrix#{{{
++	nrows::Int64
++	gglobaldoflist::Vector{Int64}
++	fglobaldoflist::Vector{Int64}
++	sglobaldoflist::Vector{Int64}
++	values::Matrix{Float64}
++end #}}}
++function ElementMatrix(nodes::Vector{Node})#{{{
++
++	#Get matrix size
++	nrows = NumberOfDofs(nodes,GsetEnum)
++
++	#Initialize element matrix with zeros
++	values = zeros(nrows,nrows)
++
++	#Get dof lists
++	gglobaldoflist=GetGlobalDofList(nodes,nrows,GsetEnum)
++	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
++	sglobaldoflist=GetGlobalDofList(nodes,nrows,SsetEnum)
++
++	return ElementMatrix(nrows,gglobaldoflist,fglobaldoflist,sglobaldoflist,values)
++end#}}}
++function Base.show(io::IO, this::ElementMatrix)# {{{
++
++	println(io,"ElementMatrix:")
++	println(io,"   nrows: ",this.nrows)
++	println(io,"   gglobaldoflist: ",this.gglobaldoflist)
++	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
++	println(io,"   sglobaldoflist: ",this.sglobaldoflist)
++	print(io,"   values: ")
++	display(this.values)
++end# }}}
++function AddToGlobal!(Ke::ElementMatrix,Kff::IssmMatrix,Kfs::IssmMatrix)#{{{
++
++	#First check that the element matrix looks alright
++	CheckConsistency(Ke)
++
++	#See if we need to do anything
++	is_fset = false
++	is_sset = false
++	for i in 1:Ke.nrows
++		if(Ke.fglobaldoflist[i]>0) is_fset = true end
++		if(Ke.sglobaldoflist[i]>0) is_sset = true end
++	end
++
++	if is_fset
++		AddValues!(Kff,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.fglobaldoflist,Ke.values)
++	end
++	if is_sset
++		AddValues!(Kfs,Ke.nrows,Ke.fglobaldoflist,Ke.nrows,Ke.sglobaldoflist,Ke.values)
++	end
++
++end#}}}
++function CheckConsistency(Ke::ElementMatrix)#{{{
++
++	for i in 1:Ke.nrows
++		for j in 1:Ke.nrows
++			if(isnan(Ke.values[i,j])) error("NaN found in Element Matrix") end
++			if(isinf(Ke.values[i,j])) error("Inf found in Element Matrix") end
++			if(abs(Ke.values[i,j])>1.e+50) error("Element Matrix values exceeds 1.e+50") end
++		end
++	end
++end#}}}
++
++mutable struct ElementVector#{{{
++	nrows::Int64
++	fglobaldoflist::Vector{Int64}
++	values::Vector{Float64}
++end #}}}
++function ElementVector(nodes::Vector{Node})#{{{
++
++	#Get matrix size
++	nrows = NumberOfDofs(nodes,GsetEnum)
++
++	#Initialize element matrix with zeros
++	values = zeros(nrows)
++
++	#Get dof list
++	fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum)
++
++	return ElementVector(nrows,fglobaldoflist,values)
++end#}}}
++function Base.show(io::IO, this::ElementVector)# {{{
++
++	println(io,"ElementVector:")
++	println(io,"   nrows: ",this.nrows)
++	println(io,"   fglobaldoflist: ",this.fglobaldoflist)
++	print(io,"   values: ")
++	display(this.values)
++end# }}}
++function AddToGlobal!(pe::ElementVector,pf::IssmVector)#{{{
++
++	#First check that the element matrix looks alright
++	CheckConsistency(pe)
++
++	#See if we need to do anything
++	is_fset = false
++	for i in 1:pe.nrows
++		if(pe.fglobaldoflist[i]>0)
++			is_fset = true 
++			break
++		end
++	end
++
++	if is_fset
++		AddValues!(pf,pe.nrows,pe.fglobaldoflist,pe.values)
++	end
++
++end#}}}
++function CheckConsistency(pe::ElementVector)#{{{
++
++	for i in 1:pe.nrows
++		if(isnan(pe.values[i])) error("NaN found in Element Vector") end
++		if(isinf(pe.values[i])) error("Inf found in Element Vector") end
++		if(abs(pe.values[i])>1.e+50) error("Element Vector values exceeds 1.e+50") end
++	end
++end#}}}
+Index: ../trunk-jpl/src/jl/core/matice.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/matice.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/matice.jl	(revision 26725)
+@@ -0,0 +1,44 @@
++#Matice class definition
++struct Matice#{{{
++	vx_input::ElementInput
++	vy_input::ElementInput
++	B_input::ElementInput
++	n_input::ElementInput
++end# }}}
++
++function Matice(element::Tria) #{{{
++
++	vx_input  = GetInput(element, VxEnum)
++	vy_input  = GetInput(element, VyEnum)
++	B_input   = GetInput(element, MaterialsRheologyBEnum)
++	n_input   = GetInput(element, MaterialsRheologyNEnum)
++
++	return Matice(vx_input, vy_input, B_input, n_input)
++end#}}}
++
++#vertices functions
++function ViscositySSA(matice::Matice, xyz_list::Matrix{Float64}, gauss::GaussTria, i::Int64) #{{{
++
++	#Get strain rate
++	dvx = GetInputDerivativeValue(matice.vx_input,xyz_list,gauss,i)
++	dvy = GetInputDerivativeValue(matice.vy_input,xyz_list,gauss,i)
++	eps_xx = dvx[1]
++	eps_yy = dvy[2]
++	eps_xy = 0.5*(dvx[2] + dvy[1])
++
++	#In SSA, eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy
++	eps_eff = sqrt(eps_xx*eps_xx + eps_yy*eps_yy + eps_xy*eps_xy + eps_xx*eps_yy)
++
++	#Get B and n
++	n = GetInputValue(matice.n_input, gauss, i)
++	B = GetInputValue(matice.B_input, gauss, i)
++
++	#Compute viscosity
++	if eps_eff==0.
++		mu = 1.e+14/2
++	else
++		mu = B/(2*eps_eff^((n-1)/n))
++	end
++
++	return mu
++end #}}}
+Index: ../trunk-jpl/src/jl/core/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/utils.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/utils.jl	(revision 26725)
+@@ -0,0 +1,26 @@
++function Matrix2x2Determinant(A::Matrix{Float64}) #{{{
++
++	return  A[1,1]*A[2,2]-A[2,1]*A[1,2]
++
++end#}}}
++function Matrix2x2Invert(A::Matrix{Float64}) #{{{
++
++	#Initialize output
++	Ainv = Matrix{Float64}(undef,2,2)
++
++	#Compute determinant
++	det = Matrix2x2Determinant(A)
++	if(abs(det)<eps(Float64)) error("Determinant smaller than machine epsilon") end
++
++	#Multiplication is faster than divsion, so we multiply by the reciprocal
++	det_reciprocal = 1/det
++
++	#compute invert matrix
++	Ainv[1,1]=   A[2,2]*det_reciprocal # =  d/det
++   Ainv[1,2]= - A[1,2]*det_reciprocal # = -b/det
++   Ainv[2,1]= - A[2,1]*det_reciprocal # = -c/det
++   Ainv[2,2]=   A[1,1]*det_reciprocal # =  a/det
++
++	return  Ainv
++
++end#}}}
+Index: ../trunk-jpl/src/jl/core/vertices.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/vertices.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/vertices.jl	(revision 26725)
+@@ -0,0 +1,26 @@
++#Vertex class definition
++mutable struct Vertex#{{{
++	sid::Int64
++	x::Float64
++	y::Float64
++	z::Float64
++end# }}}
++
++#vertices functions
++function GetVerticesCoordinates(vertices::Vector{Vertex}) #{{{
++
++	#Intermediaries
++	nbv = length(vertices)
++
++	#Allocate
++	xyz_list = Matrix{Float64}(undef,nbv,3)
++
++	#Assign value to xyz_list
++	for i in 1:nbv
++		xyz_list[i,1]=vertices[i].x
++		xyz_list[i,2]=vertices[i].y
++		xyz_list[i,3]=vertices[i].z
++	end
++
++	return xyz_list
++end #}}}
+Index: ../trunk-jpl/src/jl/core/constraints.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/constraints.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/constraints.jl	(revision 26725)
+@@ -0,0 +1,18 @@
++#Constraint class definition
++struct Constraint #{{{
++	id::Int64
++	nodeid::Int64
++	dof::Int8
++	value::Float64
++end# }}}
++
++#Constraint functions
++function ConstrainNode(constraint::Constraint,nodes::Vector{Node},parameters::Parameters) #{{{
++
++	#Chase through nodes and find the node to which this SpcStatic apply
++	node = nodes[constraint.nodeid]
++
++	#Apply Constraint
++	ApplyConstraint(node,constraint.dof,constraint.value)
++
++end# }}}
+Index: ../trunk-jpl/src/jl/core/issmenums.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/issmenums.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/issmenums.jl	(revision 26725)
+@@ -0,0 +1,1544 @@
++@enum IssmEnum begin
++	ParametersSTARTEnum
++	#Parameters{{{
++	AdolcParamEnum
++	AmrDeviatoricErrorGroupThresholdEnum
++	AmrDeviatoricErrorMaximumEnum
++	AmrDeviatoricErrorResolutionEnum
++	AmrDeviatoricErrorThresholdEnum
++	AmrErrEnum
++	AmrFieldEnum
++	AmrGradationEnum
++	AmrGroundingLineDistanceEnum
++	AmrGroundingLineResolutionEnum
++	AmrHmaxEnum
++	AmrHminEnum
++	AmrIceFrontDistanceEnum
++	AmrIceFrontResolutionEnum
++	AmrKeepMetricEnum
++	AmrLagEnum
++	AmrLevelMaxEnum
++	AmrRestartEnum
++	AmrThicknessErrorGroupThresholdEnum
++	AmrThicknessErrorMaximumEnum
++	AmrThicknessErrorResolutionEnum
++	AmrThicknessErrorThresholdEnum
++	AmrTypeEnum
++	AnalysisCounterEnum
++	AnalysisTypeEnum
++	AugmentedLagrangianREnum
++	AugmentedLagrangianRholambdaEnum
++	AugmentedLagrangianRhopEnum
++	AugmentedLagrangianRlambdaEnum
++	AugmentedLagrangianThetaEnum
++	AutodiffCbufsizeEnum
++	AutodiffDependentObjectsEnum
++	AutodiffDriverEnum
++	AutodiffFosForwardIndexEnum
++	AutodiffFosReverseIndexEnum
++	AutodiffFovForwardIndicesEnum
++	AutodiffGcTriggerMaxSizeEnum
++	AutodiffGcTriggerRatioEnum
++	AutodiffIsautodiffEnum
++	AutodiffLbufsizeEnum
++	AutodiffNumDependentsEnum
++	AutodiffNumIndependentsEnum
++	AutodiffObufsizeEnum
++	AutodiffTapeAllocEnum
++	AutodiffTbufsizeEnum
++	AutodiffXpEnum
++	BalancethicknessStabilizationEnum
++	BarystaticContributionsEnum
++	BasalforcingsBottomplumedepthEnum
++	BasalforcingsCrustthicknessEnum
++	BasalforcingsDeepwaterElevationEnum
++	BasalforcingsDeepwaterMeltingRateEnum
++	BasalforcingsDtbgEnum
++	BasalforcingsEnum
++	BasalforcingsIsmip6AverageTfEnum
++	BasalforcingsIsmip6BasinAreaEnum
++	BasalforcingsIsmip6DeltaTEnum
++	BasalforcingsIsmip6Gamma0Enum
++	BasalforcingsIsmip6IsLocalEnum
++	BasalforcingsIsmip6NumBasinsEnum
++	BasalforcingsIsmip6TfDepthsEnum
++	BasalforcingsLowercrustheatEnum
++	BasalforcingsMantleconductivityEnum
++	BasalforcingsNusseltEnum
++	BasalforcingsPicoAverageOverturningEnum
++	BasalforcingsPicoAverageSalinityEnum
++	BasalforcingsPicoAverageTemperatureEnum
++	BasalforcingsPicoBoxAreaEnum
++	BasalforcingsPicoFarOceansalinityEnum
++	BasalforcingsPicoFarOceantemperatureEnum
++	BasalforcingsPicoGammaTEnum
++	BasalforcingsPicoIsplumeEnum
++	BasalforcingsPicoMaxboxcountEnum
++	BasalforcingsPicoNumBasinsEnum
++	BasalforcingsPlumeradiusEnum
++	BasalforcingsPlumexEnum
++	BasalforcingsPlumeyEnum
++	BasalforcingsThresholdThicknessEnum
++	BasalforcingsTopplumedepthEnum
++	BasalforcingsUppercrustheatEnum
++	BasalforcingsUppercrustthicknessEnum
++	BasalforcingsUpperdepthMeltEnum
++	BasalforcingsUpperwaterElevationEnum
++	BasalforcingsUpperwaterMeltingRateEnum
++	CalvingCrevasseDepthEnum
++	CalvingCrevasseThresholdEnum
++	CalvingHeightAboveFloatationEnum
++	CalvingLawEnum
++	CalvingMinthicknessEnum
++	ConfigurationTypeEnum
++	ConstantsGEnum
++	ConstantsNewtonGravityEnum
++	ConstantsReferencetemperatureEnum
++	ConstantsYtsEnum
++	ControlInputSizeMEnum
++	ControlInputSizeNEnum
++	ControlInputInterpolationEnum
++	CumBslcEnum
++	CumBslcIceEnum
++	CumBslcHydroEnum
++	CumBslcOceanEnum
++	CumBslcIcePartitionEnum
++	CumBslcHydroPartitionEnum
++	CumBslcOceanPartitionEnum
++	CumGmtslcEnum
++	CumGmslcEnum
++	DamageC1Enum
++	DamageC2Enum
++	DamageC3Enum
++	DamageC4Enum
++	DamageEnum
++	DamageEquivStressEnum
++	DamageEvolutionNumRequestedOutputsEnum
++	DamageEvolutionRequestedOutputsEnum
++	DamageHealingEnum
++	DamageKappaEnum
++	DamageLawEnum
++	DamageMaxDamageEnum
++	DamageStabilizationEnum
++	DamageStressThresholdEnum
++	DamageStressUBoundEnum
++	DebugProfilingEnum
++	DomainDimensionEnum
++	DomainTypeEnum
++	DslModelEnum
++	DslModelidEnum
++	DslNummodelsEnum
++	SolidearthIsExternalEnum
++	SolidearthExternalNatureEnum
++	SolidearthExternalModelidEnum
++	SolidearthExternalNummodelsEnum
++	SolidearthSettingsComputeBpGrdEnum
++	EarthIdEnum
++	ElasticEnum
++	EplZigZagCounterEnum
++	EsaHElasticEnum
++	EsaHemisphereEnum
++	EsaRequestedOutputsEnum
++	EsaUElasticEnum
++	ExtrapolationVariableEnum
++	FemModelCommEnum
++	FieldsEnum
++	FlowequationFeFSEnum
++	FlowequationIsFSEnum
++	FlowequationIsHOEnum
++	FlowequationIsL1L2Enum
++	FlowequationIsMLHOEnum
++	FlowequationIsSIAEnum
++	FlowequationIsSSAEnum
++	FlowequationIsNitscheEnum
++	FeFSNitscheGammaEnum
++	FrictionCouplingEnum
++	FrictionDeltaEnum
++	FrictionEffectivePressureLimitEnum
++	FrictionFEnum
++	FrictionGammaEnum
++	FrictionLawEnum
++	FrictionPseudoplasticityExponentEnum
++	FrictionThresholdSpeedEnum
++	FrictionVoidRatioEnum
++	FrontalForcingsBasinIcefrontAreaEnum
++	FrontalForcingsNumberofBasinsEnum
++	FrontalForcingsParamEnum
++	GrdModelEnum
++	GroundinglineFrictionInterpolationEnum
++	GroundinglineMeltInterpolationEnum
++	GroundinglineMigrationEnum
++	HydrologyAveragingEnum
++	HydrologyCavitySpacingEnum
++	HydrologyChannelConductivityEnum
++	HydrologyChannelSheetWidthEnum
++	HydrologyEnglacialVoidRatioEnum
++	HydrologyIschannelsEnum
++	HydrologyMeltFlagEnum
++	HydrologyModelEnum
++	HydrologyNumRequestedOutputsEnum
++	HydrologyPressureMeltCoefficientEnum
++	HydrologyRelaxationEnum
++	HydrologyRequestedOutputsEnum
++	HydrologySedimentKmaxEnum
++	HydrologyStepsPerStepEnum
++	HydrologyStorageEnum
++	HydrologydcEplColapseThicknessEnum
++	HydrologydcEplConductivityEnum
++	HydrologydcEplInitialThicknessEnum
++	HydrologydcEplLayerCompressibilityEnum
++	HydrologydcEplMaxThicknessEnum
++	HydrologydcEplPoreWaterMassEnum
++	HydrologydcEplThickCompEnum
++	HydrologydcEplflipLockEnum
++	HydrologydcIsefficientlayerEnum
++	HydrologydcLeakageFactorEnum
++	HydrologydcMaxIterEnum
++	HydrologydcPenaltyFactorEnum
++	HydrologydcPenaltyLockEnum
++	HydrologydcRelTolEnum
++	HydrologydcSedimentlimitEnum
++	HydrologydcSedimentlimitFlagEnum
++	HydrologydcSedimentLayerCompressibilityEnum
++	HydrologydcSedimentPoreWaterMassEnum
++	HydrologydcSedimentPorosityEnum
++	HydrologydcSedimentThicknessEnum
++	HydrologydcTransferFlagEnum
++	HydrologydcUnconfinedFlagEnum
++	HydrologyshreveStabilizationEnum
++	IcecapToEarthCommEnum
++	IndexEnum
++	InputFileNameEnum
++	DirectoryNameEnum
++	IndicesEnum
++	InputToDepthaverageInEnum
++	InputToDepthaverageOutEnum
++	InputToExtrudeEnum
++	InputToL2ProjectEnum
++	InputToSmoothEnum
++	InversionAlgorithmEnum
++	InversionControlParametersEnum
++	InversionControlScalingFactorsEnum
++	InversionCostFunctionsEnum
++	InversionDxminEnum
++	InversionGatolEnum
++	InversionGradientScalingEnum
++	InversionGrtolEnum
++	InversionGttolEnum
++	InversionIncompleteAdjointEnum
++	InversionIscontrolEnum
++	InversionMaxiterEnum
++	InversionMaxiterPerStepEnum
++	InversionMaxstepsEnum
++	InversionNstepsEnum
++	InversionNumControlParametersEnum
++	InversionNumCostFunctionsEnum
++	InversionStepThresholdEnum
++	InversionTypeEnum
++	IvinsEnum
++	IsSlcCouplingEnum
++	LevelsetKillIcebergsEnum
++	LevelsetReinitFrequencyEnum
++	LevelsetStabilizationEnum
++	LockFileNameEnum
++	LoveAllowLayerDeletionEnum
++	LoveCoreMantleBoundaryEnum
++	LoveEarthMassEnum
++	LoveForcingTypeEnum
++	LoveFrequenciesEnum
++	LoveIsTemporalEnum
++	LoveG0Enum
++	LoveGravitationalConstantEnum
++	LoveInnerCoreBoundaryEnum
++	LoveComplexComputationEnum
++	LoveIntStepsPerLayerEnum
++	LoveKernelsEnum
++	LoveMu0Enum
++	LoveNfreqEnum
++	LoveNTemporalIterationsEnum
++	LoveNYiEquationsEnum
++	LoveR0Enum
++	LoveShNmaxEnum
++	LoveShNminEnum
++	LoveStartingLayerEnum
++	LoveUnderflowTolEnum
++	MassFluxSegmentsEnum
++	MassFluxSegmentsPresentEnum
++	MasstransportHydrostaticAdjustmentEnum
++	MasstransportIsfreesurfaceEnum
++	MasstransportMinThicknessEnum
++	MasstransportNumRequestedOutputsEnum
++	MasstransportPenaltyFactorEnum
++	MasstransportRequestedOutputsEnum
++	MasstransportStabilizationEnum
++	MaterialsBetaEnum
++	MaterialsEarthDensityEnum
++	MaterialsEffectiveconductivityAveragingEnum
++	MaterialsHeatcapacityEnum
++	MaterialsLatentheatEnum
++	MaterialsMeltingpointEnum
++	MaterialsMixedLayerCapacityEnum
++	MaterialsMuWaterEnum
++	MaterialsRheologyLawEnum
++	MaterialsRhoFreshwaterEnum
++	MaterialsRhoIceEnum
++	MaterialsRhoSeawaterEnum
++	MaterialsTemperateiceconductivityEnum
++	MaterialsThermalExchangeVelocityEnum
++	MaterialsThermalconductivityEnum
++	MeltingOffsetEnum
++	MeshAverageVertexConnectivityEnum
++	MeshElementtypeEnum
++	MeshNumberoflayersEnum
++	MeshNumberofverticesEnum
++	MeshNumberofelementsEnum
++	MigrationMaxEnum
++	ModelIdEnum
++	NbinsEnum
++	NodesEnum
++	NumModelsEnum
++	OceanGridNxEnum
++	OceanGridNyEnum
++	OceanGridXEnum
++	OceanGridYEnum
++	OutputBufferPointerEnum
++	OutputBufferSizePointerEnum
++	OutputFileNameEnum
++	OutputFilePointerEnum
++	OutputdefinitionEnum
++	QmuErrNameEnum
++	QmuInNameEnum
++	QmuIsdakotaEnum
++	QmuOutNameEnum
++	QmuOutputEnum
++	QmuCurrEvalIdEnum
++	QmuNsampleEnum
++	QmuResponsedescriptorsEnum
++	QmuVariableDescriptorsEnum
++	QmuVariablePartitionsEnum
++	QmuVariablePartitionsNpartEnum
++	QmuVariablePartitionsNtEnum
++	QmuResponsePartitionsEnum
++	QmuResponsePartitionsNpartEnum
++	QmuStatisticsEnum
++	QmuNumstatisticsEnum
++	QmuNdirectoriesEnum
++	QmuNfilesPerDirectoryEnum
++	QmuStatisticsMethodEnum
++	QmuMethodsEnum
++	RestartFileNameEnum
++	ResultsEnum
++	RootPathEnum
++	ModelnameEnum
++	SamplingAlphaEnum
++	SamplingPhiEnum
++	SamplingNumRequestedOutputsEnum
++	SamplingRequestedOutputsEnum
++	SamplingRobinEnum
++	SamplingSeedEnum
++	SamplingTauEnum
++	SaveResultsEnum
++	SolidearthPartitionIceEnum
++	SolidearthPartitionHydroEnum
++	SolidearthPartitionOceanEnum
++	SolidearthNpartIceEnum
++	SolidearthNpartOceanEnum
++	SolidearthNpartHydroEnum
++	SolidearthPlanetRadiusEnum
++	SolidearthPlanetAreaEnum
++	SolidearthSettingsAbstolEnum
++	SolidearthSettingsCrossSectionShapeEnum
++	RotationalAngularVelocityEnum
++	SolidearthSettingsElasticEnum
++	SolidearthSettingsViscousEnum
++	SealevelchangeGeometryDoneEnum
++	SealevelchangeViscousNumStepsEnum
++	SealevelchangeViscousTimesEnum
++	SealevelchangeViscousIndexEnum
++	RotationalEquatorialMoiEnum
++	TidalLoveHEnum
++	TidalLoveKEnum
++	TidalLoveLEnum
++	TidalLoveK2SecularEnum
++	LoadLoveHEnum
++	LoadLoveKEnum
++	LoadLoveLEnum
++	LoveTimeFreqEnum
++	LoveIsTimeEnum
++	SealevelchangeGSelfAttractionEnum
++	SealevelchangeGViscoElasticEnum
++	SolidearthSettingsSealevelLoadingEnum
++	SolidearthSettingsGRDEnum
++	SolidearthSettingsRunFrequencyEnum
++	SolidearthSettingsTimeAccEnum
++	SealevelchangeHViscoElasticEnum
++	SolidearthSettingsHorizEnum
++	SolidearthSettingsMaxiterEnum
++	SolidearthSettingsGrdOceanEnum
++	SolidearthSettingsOceanAreaScalingEnum
++	RotationalPolarMoiEnum
++	SolidearthSettingsReltolEnum
++	SealevelchangeRequestedOutputsEnum
++	SolidearthSettingsSelfAttractionEnum
++	SolidearthSettingsRotationEnum
++	SolidearthSettingsMaxSHCoeffEnum
++	SealevelchangeRunCountEnum
++	SealevelchangeTransitionsEnum
++	SealevelchangeUViscoElasticEnum
++	SettingsIoGatherEnum
++	SettingsNumResultsOnNodesEnum
++	SettingsOutputFrequencyEnum
++	SettingsCheckpointFrequencyEnum
++	SettingsResultsOnNodesEnum
++	SettingsSbCouplingFrequencyEnum
++	SettingsSolverResidueThresholdEnum
++	SettingsWaitonlockEnum
++	SmbAIceEnum
++	SmbAIdxEnum
++	SmbASnowEnum
++	SmbAccualtiEnum
++	SmbAccugradEnum
++	SmbAccurefEnum
++	SmbAdThreshEnum
++	SmbAutoregressionInitialTimeEnum
++	SmbAutoregressionTimestepEnum
++	SmbAutoregressiveOrderEnum
++	SmbAveragingEnum
++	SmbBeta0Enum
++	SmbBeta1Enum
++	SmbCovmatEnum
++	SmbDesfacEnum
++	SmbDpermilEnum
++	SmbDsnowIdxEnum
++	SmbCldFracEnum
++	SmbDelta18oEnum
++	SmbDelta18oSurfaceEnum
++	SmbDenIdxEnum
++	SmbDtEnum
++	SmbEnum
++	SmbFEnum
++	SmbInitDensityScalingEnum
++	SmbIsaccumulationEnum
++	SmbIsalbedoEnum
++	SmbIsconstrainsurfaceTEnum
++	SmbIsd18opdEnum
++	SmbIsdelta18oEnum
++	SmbIsdensificationEnum
++	SmbIsfirnwarmingEnum
++	SmbIsgraingrowthEnum
++	SmbIsmeltEnum
++	SmbIsmungsmEnum
++	SmbIsprecipscaledEnum
++	SmbIssetpddfacEnum
++	SmbIsshortwaveEnum
++	SmbIstemperaturescaledEnum
++	SmbIsthermalEnum
++	SmbIsturbulentfluxEnum
++	SmbKEnum
++	SmbNumBasinsEnum
++	SmbNumRequestedOutputsEnum
++	SmbPfacEnum
++	SmbPhiEnum
++	SmbRandomflagEnum
++	SmbRdlEnum
++	SmbRequestedOutputsEnum
++	SmbRlapsEnum
++	SmbRlapslgmEnum
++	SmbRunoffaltiEnum
++	SmbRunoffgradEnum
++	SmbRunoffrefEnum
++	SmbSealevEnum
++	SmbStepsPerStepEnum
++	SmbSwIdxEnum
++	SmbT0dryEnum
++	SmbT0wetEnum
++	SmbTdiffEnum
++	SmbThermoDeltaTScalingEnum
++	SmbTemperaturesReconstructedYearsEnum
++	SmbPrecipitationsReconstructedYearsEnum
++	SmoothThicknessMultiplierEnum
++	SolutionTypeEnum
++	SteadystateMaxiterEnum
++	SteadystateNumRequestedOutputsEnum
++	SteadystateReltolEnum
++	SteadystateRequestedOutputsEnum
++	StepEnum
++	StepsEnum
++	StressbalanceAbstolEnum
++	StressbalanceFSreconditioningEnum
++	StressbalanceIsnewtonEnum
++	StressbalanceMaxiterEnum
++	StressbalanceNumRequestedOutputsEnum
++	StressbalancePenaltyFactorEnum
++	StressbalanceReltolEnum
++	StressbalanceRequestedOutputsEnum
++	StressbalanceRestolEnum
++	StressbalanceRiftPenaltyThresholdEnum
++	StressbalanceShelfDampeningEnum
++	ThermalIsdrainicecolumnEnum
++	ThermalIsdynamicbasalspcEnum
++	ThermalIsenthalpyEnum
++	ThermalMaxiterEnum
++	ThermalNumRequestedOutputsEnum
++	ThermalPenaltyFactorEnum
++	ThermalPenaltyLockEnum
++	ThermalPenaltyThresholdEnum
++	ThermalReltolEnum
++	ThermalRequestedOutputsEnum
++	ThermalStabilizationEnum
++	ThermalWatercolumnUpperlimitEnum
++	TimeEnum
++	TimesteppingCflCoefficientEnum
++	TimesteppingCouplingTimeEnum
++	TimesteppingFinalTimeEnum
++	TimesteppingInterpForcingEnum
++	TimesteppingCycleForcingEnum
++	TimesteppingStartTimeEnum
++	TimesteppingTimeStepEnum
++	TimesteppingTimeStepMaxEnum
++	TimesteppingTimeStepMinEnum
++	TimesteppingTypeEnum
++	ToMITgcmCommEnum
++	ToolkitsFileNameEnum
++	ToolkitsOptionsAnalysesEnum
++	ToolkitsOptionsStringsEnum
++	ToolkitsTypesEnum
++	TransientAmrFrequencyEnum
++	TransientIsdamageevolutionEnum
++	TransientIsesaEnum
++	TransientIsgiaEnum
++	TransientIsgroundinglineEnum
++	TransientIshydrologyEnum
++	TransientIsmasstransportEnum 
++	TransientIsoceantransportEnum
++	TransientIsmovingfrontEnum
++	TransientIsoceancouplingEnum
++	TransientIssamplingEnum
++	TransientIsslcEnum
++	TransientIssmbEnum
++	TransientIsstressbalanceEnum
++	TransientIsthermalEnum
++	TransientNumRequestedOutputsEnum
++	TransientRequestedOutputsEnum
++	VelocityEnum
++	XxeEnum
++	YyeEnum
++	ZzeEnum
++	AreaeEnum
++	WorldCommEnum
++	#}}}
++	ParametersENDEnum
++	InputsSTARTEnum
++	#Inputs{{{
++	AccumulatedDeltaBottomPressureEnum
++	AccumulatedDeltaIceThicknessEnum
++	AccumulatedDeltaTwsEnum
++	AdjointEnum
++	AdjointpEnum
++	AdjointxEnum
++	AdjointxBaseEnum
++	AdjointxShearEnum
++	AdjointyEnum
++	AdjointyBaseEnum
++	AdjointyShearEnum
++	AdjointzEnum
++	AirEnum
++	ApproximationEnum
++	BalancethicknessMisfitEnum
++	BalancethicknessOmega0Enum
++	BalancethicknessOmegaEnum
++	BalancethicknessSpcthicknessEnum
++	BalancethicknessThickeningRateEnum
++	BasalCrevasseEnum
++	BasalforcingsFloatingiceMeltingRateEnum
++	BasalforcingsGeothermalfluxEnum
++	BasalforcingsGroundediceMeltingRateEnum
++	BasalforcingsPerturbationMeltingRateEnum
++	BasalforcingsIsmip6BasinIdEnum
++	BasalforcingsIsmip6TfEnum
++	BasalforcingsIsmip6TfShelfEnum
++	BasalforcingsIsmip6MeltAnomalyEnum
++	BasalforcingsMeltrateFactorEnum
++	BasalforcingsOceanSalinityEnum
++	BasalforcingsOceanTempEnum
++	BasalforcingsPicoBasinIdEnum
++	BasalforcingsPicoBoxIdEnum
++	BasalforcingsPicoOverturningCoeffEnum
++	BasalforcingsPicoSubShelfOceanOverturningEnum
++	BasalforcingsPicoSubShelfOceanSalinityEnum
++	BasalforcingsPicoSubShelfOceanTempEnum
++	BasalStressxEnum
++	BasalStressyEnum
++	BasalStressEnum
++	BaseEnum
++	BaseOldEnum
++	BaseSlopeXEnum
++	BaseSlopeYEnum
++	BedEnum
++	BedGRDEnum
++	BedEastEnum
++	BedEastGRDEnum
++	BedNorthEnum
++	BedNorthGRDEnum
++	BedSlopeXEnum
++	BedSlopeYEnum
++	BottomPressureEnum
++	BottomPressureOldEnum
++	CalvingCalvingrateEnum
++	CalvingHabFractionEnum
++	CalvingMeltingrateEnum
++	CalvingStressThresholdFloatingiceEnum
++	CalvingStressThresholdGroundediceEnum
++	CalvinglevermannCoeffEnum
++	CalvingratexAverageEnum
++	CalvingratexEnum
++	CalvingrateyAverageEnum
++	CalvingrateyEnum
++	CalvingFluxLevelsetEnum
++	CalvingMeltingFluxLevelsetEnum
++	ConvergedEnum
++	CrevasseDepthEnum
++	DamageDEnum
++	DamageDOldEnum
++	DamageDbarEnum
++	DamageDbarOldEnum
++	DamageFEnum
++	DegreeOfChannelizationEnum
++	DepthBelowSurfaceEnum
++	DeltaIceThicknessEnum
++	DeltaTwsEnum
++	DeltaBottomPressureEnum
++	DeltaDslEnum
++	DslOldEnum
++	DslEnum
++	DeltaStrEnum
++	StrOldEnum
++	StrEnum
++	DeviatoricStresseffectiveEnum
++	DeviatoricStressxxEnum
++	DeviatoricStressxyEnum
++	DeviatoricStressxzEnum
++	DeviatoricStressyyEnum
++	DeviatoricStressyzEnum
++	DeviatoricStresszzEnum
++	DeviatoricStress1Enum
++	DeviatoricStress2Enum
++	DistanceToCalvingfrontEnum
++	DistanceToGroundinglineEnum
++	Domain2DhorizontalEnum
++	Domain2DverticalEnum
++	Domain3DEnum
++	DragCoefficientAbsGradientEnum
++	DrivingStressXEnum
++	DrivingStressYEnum
++	DummyEnum
++	EffectivePressureEnum
++	EffectivePressureSubstepEnum
++	EffectivePressureTransientEnum
++	EnthalpyEnum
++	EnthalpyPicardEnum
++	EplHeadEnum
++	EplHeadOldEnum
++	EplHeadSlopeXEnum
++	EplHeadSlopeYEnum
++	EplHeadSubstepEnum
++	EplHeadTransientEnum
++	EsaEmotionEnum
++	EsaNmotionEnum
++	EsaRotationrateEnum
++	EsaStrainratexxEnum
++	EsaStrainratexyEnum
++	EsaStrainrateyyEnum
++	EsaUmotionEnum
++	EsaXmotionEnum
++	EsaYmotionEnum
++	EtaDiffEnum
++	FlowequationBorderFSEnum
++	FrictionAsEnum
++	FrictionCEnum
++	FrictionCmaxEnum
++	FrictionCoefficientEnum
++	FrictionCoefficientcoulombEnum
++	FrictionEffectivePressureEnum
++	FrictionMEnum
++	FrictionPEnum
++	FrictionPressureAdjustedTemperatureEnum
++	FrictionQEnum
++	FrictionSedimentCompressibilityCoefficientEnum
++	FrictionTillFrictionAngleEnum
++	FrictionWaterLayerEnum
++	FrictionfEnum
++	FrontalForcingsBasinIdEnum
++	FrontalForcingsSubglacialDischargeEnum
++	FrontalForcingsThermalForcingEnum
++	GeometryHydrostaticRatioEnum
++	NGiaEnum
++	NGiaRateEnum
++	UGiaEnum
++	UGiaRateEnum
++	GradientEnum
++	GroundinglineHeightEnum
++	HydraulicPotentialEnum
++	HydraulicPotentialOldEnum
++	HydrologyBasalFluxEnum
++	HydrologyBumpHeightEnum
++	HydrologyBumpSpacingEnum
++	HydrologydcBasalMoulinInputEnum
++	HydrologydcEplThicknessEnum
++	HydrologydcEplThicknessOldEnum
++	HydrologydcEplThicknessSubstepEnum
++	HydrologydcEplThicknessTransientEnum
++	HydrologydcMaskEplactiveEltEnum
++	HydrologydcMaskEplactiveNodeEnum
++	HydrologydcMaskThawedEltEnum
++	HydrologydcMaskThawedNodeEnum
++	HydrologydcSedimentTransmitivityEnum
++	HydrologyDrainageRateEnum
++	HydrologyEnglacialInputEnum
++	HydrologyGapHeightEnum
++	HydrologyGapHeightXEnum
++	HydrologyGapHeightXXEnum
++	HydrologyGapHeightYEnum
++	HydrologyGapHeightYYEnum
++	HydrologyHeadEnum
++	HydrologyHeadOldEnum
++	HydrologyMoulinInputEnum
++	HydrologyNeumannfluxEnum
++	HydrologyReynoldsEnum
++	HydrologySheetConductivityEnum
++	HydrologySheetThicknessEnum
++	HydrologySheetThicknessOldEnum
++	HydrologyTwsEnum
++	HydrologyTwsSpcEnum
++	HydrologyTwsAnalysisEnum
++	HydrologyWatercolumnMaxEnum
++	HydrologyWaterVxEnum
++	HydrologyWaterVyEnum
++	IceEnum
++	IceMaskNodeActivationEnum
++	InputEnum
++	InversionCostFunctionsCoefficientsEnum
++	InversionSurfaceObsEnum
++	InversionThicknessObsEnum
++	InversionVelObsEnum
++	InversionVxObsEnum
++	InversionVyObsEnum
++	LevelsetfunctionSlopeXEnum
++	LevelsetfunctionSlopeYEnum
++	LevelsetObservationEnum
++	LoadingforceXEnum
++	LoadingforceYEnum
++	LoadingforceZEnum
++	MaskOceanLevelsetEnum
++	MaskIceLevelsetEnum
++	MaskIceRefLevelsetEnum
++	MasstransportSpcthicknessEnum
++	MaterialsRheologyBEnum
++	MaterialsRheologyBbarEnum
++	MaterialsRheologyEEnum
++	MaterialsRheologyEbarEnum
++	MaterialsRheologyEcEnum
++	MaterialsRheologyEcbarEnum
++	MaterialsRheologyEsEnum
++	MaterialsRheologyEsbarEnum
++	MaterialsRheologyNEnum
++	MeshScaleFactorEnum
++	MeshVertexonbaseEnum
++	MeshVertexonboundaryEnum
++	MeshVertexonsurfaceEnum
++	MisfitEnum
++	MovingFrontalVxEnum
++	MovingFrontalVyEnum
++	NeumannfluxEnum
++	NewDamageEnum
++	NodeEnum
++	OmegaAbsGradientEnum
++	OceantransportSpcbottompressureEnum
++	OceantransportSpcstrEnum
++	OceantransportSpcdslEnum
++	P0Enum
++	P1Enum
++	PartitioningEnum
++	PressureEnum
++	RadarEnum
++	RadarAttenuationMacGregorEnum
++	RadarAttenuationWolffEnum
++	RadarIcePeriodEnum
++	RadarPowerMacGregorEnum
++	RadarPowerWolffEnum
++	RheologyBAbsGradientEnum
++	RheologyBInitialguessEnum
++	RheologyBInitialguessMisfitEnum
++	RheologyBbarAbsGradientEnum
++	SampleEnum
++	SamplingBetaEnum
++	SamplingKappaEnum
++	SealevelEnum
++	SealevelGRDEnum
++	SealevelBarystaticMaskEnum
++	SealevelBarystaticIceMaskEnum
++	SealevelBarystaticIceWeightsEnum
++	SealevelBarystaticIceAreaEnum
++	SealevelBarystaticIceLatbarEnum
++	SealevelBarystaticIceLongbarEnum
++	SealevelBarystaticIceLoadEnum
++	SealevelBarystaticHydroMaskEnum
++	SealevelBarystaticHydroWeightsEnum
++	SealevelBarystaticHydroAreaEnum
++	SealevelBarystaticHydroLatbarEnum
++	SealevelBarystaticHydroLongbarEnum
++	SealevelBarystaticHydroLoadEnum
++	SealevelBarystaticBpMaskEnum
++	SealevelBarystaticBpWeightsEnum
++	SealevelBarystaticBpAreaEnum
++	SealevelBarystaticBpLoadEnum
++	SealevelBarystaticOceanMaskEnum
++	SealevelBarystaticOceanWeightsEnum
++	SealevelBarystaticOceanAreaEnum
++	SealevelBarystaticOceanLatbarEnum
++	SealevelBarystaticOceanLongbarEnum
++	SealevelBarystaticOceanLoadEnum
++	SealevelNEsaEnum
++	SealevelNEsaRateEnum
++	SealevelRSLEnum
++	BslcEnum
++	BslcIceEnum
++	BslcHydroEnum
++	BslcOceanEnum
++	BslcRateEnum
++	GmtslcEnum
++	SealevelGrotm1Enum
++	SealevelGrotm2Enum
++	SealevelGrotm3Enum
++	SealevelGUrotm1Enum
++	SealevelGUrotm2Enum
++	SealevelGUrotm3Enum
++	SealevelGNrotm1Enum
++	SealevelGNrotm2Enum
++	SealevelGNrotm3Enum
++	SealevelGErotm1Enum
++	SealevelGErotm2Enum
++	SealevelGErotm3Enum
++	SealevelRSLBarystaticEnum
++	SealevelRSLRateEnum
++	SealevelUGrdEnum
++	SealevelNGrdEnum
++	SealevelUEastEsaEnum
++	SealevelUNorthEsaEnum
++	SealevelchangeIndicesEnum
++	SealevelchangeGEnum
++	SealevelchangeGUEnum
++	SealevelchangeGEEnum
++	SealevelchangeGNEnum
++	SealevelchangeGsubelOceanEnum
++	SealevelchangeGUsubelOceanEnum
++	SealevelchangeGEsubelOceanEnum
++	SealevelchangeGNsubelOceanEnum
++	SealevelchangeGsubelIceEnum
++	SealevelchangeGUsubelIceEnum
++	SealevelchangeGEsubelIceEnum
++	SealevelchangeGNsubelIceEnum
++	SealevelchangeGsubelHydroEnum
++	SealevelchangeGUsubelHydroEnum
++	SealevelchangeGEsubelHydroEnum
++	SealevelchangeGNsubelHydroEnum
++	SealevelchangeViscousRSLEnum
++	SealevelchangeViscousUEnum
++	SealevelchangeViscousNEnum
++	SealevelchangeViscousEEnum
++	SedimentHeadEnum
++	SedimentHeadOldEnum
++	SedimentHeadSubstepEnum
++	SedimentHeadTransientEnum
++	SedimentHeadResidualEnum
++	SedimentHeadStackedEnum
++	SigmaNNEnum
++	SigmaVMEnum
++	SmbAccumulatedECEnum
++	SmbAccumulatedMassBalanceEnum
++	SmbAccumulatedMeltEnum
++	SmbAccumulatedPrecipitationEnum
++	SmbAccumulatedRainEnum
++	SmbAccumulatedRefreezeEnum
++	SmbAccumulatedRunoffEnum
++	SmbAEnum
++	SmbAdiffEnum
++	SmbAValueEnum
++	SmbAccumulationEnum
++	SmbAdiffiniEnum
++	SmbAiniEnum
++	SmbBasinsIdEnum
++	SmbBMaxEnum
++	SmbBMinEnum
++	SmbBNegEnum
++	SmbBPosEnum
++	SmbCEnum
++	SmbCcsnowValueEnum
++	SmbCciceValueEnum
++	SmbCotValueEnum
++	SmbDEnum
++	SmbDailyairdensityEnum
++	SmbDailyairhumidityEnum
++	SmbDailydlradiationEnum
++	SmbDailydsradiationEnum
++	SmbDailypressureEnum
++	SmbDailyrainfallEnum
++	SmbDailysnowfallEnum
++	SmbDailytemperatureEnum
++	SmbDailywindspeedEnum
++	SmbDiniEnum
++	SmbDlwrfEnum
++	SmbDswrfEnum
++	SmbDswdiffrfEnum
++	SmbDzAddEnum
++	SmbDzEnum
++	SmbDzMinEnum
++	SmbDzTopEnum
++	SmbDziniEnum
++	SmbEAirEnum
++	SmbECEnum
++	SmbECDtEnum
++	SmbECiniEnum
++	SmbElaEnum
++	SmbEvaporationEnum
++	SmbFACEnum
++	SmbGdnEnum
++	SmbGdniniEnum
++	SmbGspEnum
++	SmbGspiniEnum
++	SmbHrefEnum
++	SmbIsInitializedEnum
++	SmbMAddEnum
++	SmbMassBalanceEnum
++	SmbMassBalanceSubstepEnum
++	SmbMassBalanceTransientEnum
++	SmbMeanLHFEnum
++	SmbMeanSHFEnum
++	SmbMeanULWEnum
++	SmbMeltEnum
++	SmbMInitnum
++	SmbMonthlytemperaturesEnum
++	SmbMSurfEnum
++	SmbNetLWEnum
++	SmbNetSWEnum
++	SmbPAirEnum
++	SmbPEnum
++	SmbPddfacIceEnum
++	SmbPddfacSnowEnum
++	SmbPrecipitationEnum
++	SmbPrecipitationsAnomalyEnum
++	SmbPrecipitationsLgmEnum
++	SmbPrecipitationsPresentdayEnum
++	SmbPrecipitationsReconstructedEnum
++	SmbRainEnum
++	SmbReEnum
++	SmbRefreezeEnum
++	SmbReiniEnum
++	SmbRunoffEnum
++	SmbRunoffSubstepEnum
++	SmbRunoffTransientEnum
++	SmbS0gcmEnum
++	SmbS0pEnum
++	SmbS0tEnum
++	SmbSizeiniEnum
++	SmbSmbCorrEnum
++	SmbSmbrefEnum
++	SmbSzaValueEnum
++	SmbTEnum
++	SmbTaEnum
++	SmbTeValueEnum
++	SmbTemperaturesAnomalyEnum
++	SmbTemperaturesLgmEnum
++	SmbTemperaturesPresentdayEnum
++	SmbTemperaturesReconstructedEnum
++	SmbTiniEnum
++	SmbTmeanEnum
++	SmbTzEnum
++	SmbValuesAutoregressionEnum
++	SmbVEnum
++	SmbVmeanEnum
++	SmbVzEnum
++	SmbWEnum
++	SmbWAddEnum
++	SmbWiniEnum
++	SmbZMaxEnum
++	SmbZMinEnum
++	SmbZTopEnum
++	SmbZYEnum
++	SolidearthExternalDisplacementEastRateEnum
++	SolidearthExternalDisplacementNorthRateEnum
++	SolidearthExternalDisplacementUpRateEnum
++	SolidearthExternalGeoidRateEnum
++	StrainRateeffectiveEnum
++	StrainRateparallelEnum
++	StrainRateperpendicularEnum
++	StrainRatexxEnum
++	StrainRatexyEnum
++	StrainRatexzEnum
++	StrainRateyyEnum
++	StrainRateyzEnum
++	StrainRatezzEnum
++	StressMaxPrincipalEnum
++	StressTensorxxEnum
++	StressTensorxyEnum
++	StressTensorxzEnum
++	StressTensoryyEnum
++	StressTensoryzEnum
++	StressTensorzzEnum
++	SurfaceAbsMisfitEnum
++	SurfaceAbsVelMisfitEnum
++	AreaEnum
++	SealevelAreaEnum
++	SurfaceAreaEnum
++	SurfaceAverageVelMisfitEnum
++	SurfaceCrevasseEnum
++	SurfaceEnum
++	SurfaceOldEnum
++	SurfaceLogVelMisfitEnum
++	SurfaceLogVxVyMisfitEnum
++	SurfaceObservationEnum
++	SurfaceRelVelMisfitEnum
++	SurfaceSlopeXEnum
++	SurfaceSlopeYEnum
++	TemperatureEnum
++	TemperaturePDDEnum
++	TemperaturePicardEnum
++	TemperatureSEMICEnum
++	ThermalSpctemperatureEnum
++	ThicknessAbsGradientEnum
++	ThicknessAbsMisfitEnum
++	ThicknessAcrossGradientEnum
++	ThicknessAlongGradientEnum
++	ThicknessEnum
++	ThicknessOldEnum
++	ThicknessPositiveEnum
++	ThicknessResidualEnum
++	TransientAccumulatedDeltaIceThicknessEnum
++	VelEnum
++	VxAverageEnum
++	VxBaseEnum
++	VxEnum
++	VxMeshEnum
++	VxObsEnum
++	VxShearEnum
++	VxSurfaceEnum
++	VyAverageEnum
++	VyBaseEnum
++	VyEnum
++	VyMeshEnum
++	VyObsEnum
++	VyShearEnum
++	VySurfaceEnum
++	VzEnum
++	VzFSEnum
++	VzHOEnum
++	VzMeshEnum
++	VzSSAEnum
++	WaterColumnOldEnum
++	WatercolumnEnum
++	WaterfractionDrainageEnum
++	WaterfractionDrainageIntegratedEnum
++	WaterfractionEnum
++	WaterheightEnum
++	WeightsLevelsetObservationEnum
++	WeightsSurfaceObservationEnum
++	OldAccumulatedDeltaBottomPressureEnum
++	OldAccumulatedDeltaIceThicknessEnum
++	OldAccumulatedDeltaTwsEnum
++	Outputdefinition1Enum
++	Outputdefinition10Enum
++	Outputdefinition11Enum
++	Outputdefinition12Enum
++	Outputdefinition13Enum
++	Outputdefinition14Enum
++	Outputdefinition15Enum
++	Outputdefinition16Enum
++	Outputdefinition17Enum
++	Outputdefinition18Enum
++	Outputdefinition19Enum
++	Outputdefinition20Enum
++	Outputdefinition21Enum
++	Outputdefinition22Enum
++	Outputdefinition23Enum
++	Outputdefinition24Enum
++	Outputdefinition25Enum
++	Outputdefinition26Enum
++	Outputdefinition27Enum
++	Outputdefinition28Enum
++	Outputdefinition29Enum
++	Outputdefinition2Enum
++	Outputdefinition30Enum
++	Outputdefinition31Enum
++	Outputdefinition32Enum
++	Outputdefinition33Enum
++	Outputdefinition34Enum
++	Outputdefinition35Enum
++	Outputdefinition36Enum
++	Outputdefinition37Enum
++	Outputdefinition38Enum
++	Outputdefinition39Enum
++	Outputdefinition3Enum
++	Outputdefinition40Enum
++	Outputdefinition41Enum
++	Outputdefinition42Enum
++	Outputdefinition43Enum
++	Outputdefinition44Enum
++	Outputdefinition45Enum
++	Outputdefinition46Enum
++	Outputdefinition47Enum
++	Outputdefinition48Enum
++	Outputdefinition49Enum
++	Outputdefinition4Enum
++	Outputdefinition50Enum
++	Outputdefinition51Enum
++	Outputdefinition52Enum
++	Outputdefinition53Enum
++	Outputdefinition54Enum
++	Outputdefinition55Enum
++	Outputdefinition56Enum
++	Outputdefinition57Enum
++	Outputdefinition58Enum
++	Outputdefinition59Enum
++	Outputdefinition5Enum
++	Outputdefinition60Enum
++	Outputdefinition61Enum
++	Outputdefinition62Enum
++	Outputdefinition63Enum
++	Outputdefinition64Enum
++	Outputdefinition65Enum
++	Outputdefinition66Enum
++	Outputdefinition67Enum
++	Outputdefinition68Enum
++	Outputdefinition69Enum
++	Outputdefinition6Enum
++	Outputdefinition70Enum
++	Outputdefinition71Enum
++	Outputdefinition72Enum
++	Outputdefinition73Enum
++	Outputdefinition74Enum
++	Outputdefinition75Enum
++	Outputdefinition76Enum
++	Outputdefinition77Enum
++	Outputdefinition78Enum
++	Outputdefinition79Enum
++	Outputdefinition7Enum
++	Outputdefinition80Enum
++	Outputdefinition81Enum
++	Outputdefinition82Enum
++	Outputdefinition83Enum
++	Outputdefinition84Enum
++	Outputdefinition85Enum
++	Outputdefinition86Enum
++	Outputdefinition87Enum
++	Outputdefinition88Enum
++	Outputdefinition89Enum
++	Outputdefinition8Enum
++	Outputdefinition90Enum
++	Outputdefinition91Enum
++	Outputdefinition92Enum
++	Outputdefinition93Enum
++	Outputdefinition94Enum
++	Outputdefinition95Enum
++	Outputdefinition96Enum
++	Outputdefinition97Enum
++	Outputdefinition98Enum
++	Outputdefinition99Enum
++	Outputdefinition9Enum
++	Outputdefinition100Enum
++	#}}}
++	InputsENDEnum
++	#Other{{{
++	AbsoluteEnum
++	AdaptiveTimesteppingEnum
++	AdjointBalancethickness2AnalysisEnum
++	AdjointBalancethicknessAnalysisEnum
++	AdjointHorizAnalysisEnum
++	AggressiveMigrationEnum
++	AmrBamgEnum
++	AmrNeopzEnum
++	AndroidFrictionCoefficientEnum
++	ArrheniusEnum
++	AutodiffJacobianEnum
++	Balancethickness2AnalysisEnum
++	Balancethickness2SolutionEnum
++	BalancethicknessAnalysisEnum
++	BalancethicknessApparentMassbalanceEnum
++	BalancethicknessSoftAnalysisEnum
++	BalancethicknessSoftSolutionEnum
++	BalancethicknessSolutionEnum
++	BalancevelocityAnalysisEnum
++	BalancevelocitySolutionEnum
++	BasalforcingsIsmip6Enum
++	BasalforcingsPicoEnum
++	BeckmannGoosseFloatingMeltRateEnum
++	BedSlopeSolutionEnum
++	BoolExternalResultEnum
++	BoolInputEnum
++	IntInputEnum
++	DoubleInputEnum
++	BoolParamEnum
++	BoundaryEnum
++	BuddJackaEnum
++	CalvingDev2Enum
++	CalvingHabEnum
++	CalvingLevermannEnum
++	CalvingVonmisesEnum
++	CfdragcoeffabsgradEnum
++	CfsurfacelogvelEnum
++	CfsurfacesquareEnum
++	CflevelsetmisfitEnum
++	ChannelEnum
++	ChannelAreaEnum
++	ChannelAreaOldEnum
++	ChannelDischargeEnum
++	ClosedEnum
++	ColinearEnum
++	ConstraintsEnum
++	ContactEnum
++	ContourEnum
++	ContoursEnum
++	ControlInputEnum
++	ControlInputGradEnum
++	ControlInputMaxsEnum
++	ControlInputMinsEnum
++	ControlInputValuesEnum
++	CrouzeixRaviartEnum
++	CuffeyEnum
++	CuffeyTemperateEnum
++	DamageEvolutionAnalysisEnum
++	DamageEvolutionSolutionEnum
++	DataSetEnum
++	DataSetParamEnum
++	DatasetInputEnum
++	DefaultAnalysisEnum
++	DefaultCalvingEnum
++	DenseEnum
++	DependentObjectEnum
++	DepthAverageAnalysisEnum
++	DeviatoricStressErrorEstimatorEnum
++	DivergenceEnum
++	Domain3DsurfaceEnum
++	DoubleArrayInputEnum
++	ArrayInputEnum
++	DoubleExternalResultEnum
++	DoubleMatArrayParamEnum
++	DoubleMatExternalResultEnum
++	DoubleMatParamEnum
++	DoubleParamEnum
++	DoubleVecParamEnum
++	ElementEnum
++	ElementHookEnum
++	ElementSIdEnum
++	EnthalpyAnalysisEnum
++	EsaAnalysisEnum
++	EsaSolutionEnum
++	EsaTransitionsEnum
++	ExternalResultEnum
++	ExtrapolationAnalysisEnum
++	ExtrudeFromBaseAnalysisEnum
++	ExtrudeFromTopAnalysisEnum
++	FSApproximationEnum
++	FSSolverEnum
++	FSpressureEnum
++	FSvelocityEnum
++	FemModelEnum
++	FileParamEnum
++	FixedTimesteppingEnum
++	FloatingAreaEnum
++	FloatingAreaScaledEnum
++	FloatingMeltRateEnum
++	FreeEnum
++	FreeSurfaceBaseAnalysisEnum
++	FreeSurfaceTopAnalysisEnum
++	FrontalForcingsDefaultEnum
++	FrontalForcingsRignotEnum
++	FsetEnum
++	FullMeltOnPartiallyFloatingEnum
++	GLheightadvectionAnalysisEnum
++	GaussPentaEnum
++	GaussSegEnum
++	GaussTetraEnum
++	GaussTriaEnum
++	GenericOptionEnum
++	GenericParamEnum
++	GenericExternalResultEnum
++	Gradient1Enum
++	Gradient2Enum
++	Gradient3Enum
++	Gradient4Enum
++	GroundedAreaEnum
++	GroundedAreaScaledEnum
++	GroundingOnlyEnum
++	GroundinglineMassFluxEnum
++	GsetEnum
++	GslEnum
++	HOApproximationEnum
++	HOFSApproximationEnum
++	HookEnum
++	HydrologyDCEfficientAnalysisEnum
++	HydrologyDCInefficientAnalysisEnum
++	HydrologyGlaDSAnalysisEnum
++	HydrologyGlaDSEnum
++	HydrologyPismAnalysisEnum
++	HydrologyShaktiAnalysisEnum
++	HydrologyShreveAnalysisEnum
++	HydrologySolutionEnum
++	HydrologydcEnum
++	HydrologypismEnum
++	HydrologyshaktiEnum
++	HydrologyshreveEnum
++	IceMassEnum
++	IceMassScaledEnum
++	IceVolumeAboveFloatationEnum
++	IceVolumeAboveFloatationScaledEnum
++	IceVolumeEnum
++	IceVolumeScaledEnum
++	IcefrontMassFluxEnum
++	IcefrontMassFluxLevelsetEnum
++	IncrementalEnum
++	IndexedEnum
++	IntExternalResultEnum
++	ElementInputEnum
++	IntMatExternalResultEnum
++	IntMatParamEnum
++	IntParamEnum
++	IntVecParamEnum
++	InputsEnum
++	InternalEnum
++	IntersectEnum
++	InversionVzObsEnum
++	JEnum
++	L1L2ApproximationEnum
++	MLHOApproximationEnum
++	L2ProjectionBaseAnalysisEnum
++	L2ProjectionEPLAnalysisEnum
++	LACrouzeixRaviartEnum
++	LATaylorHoodEnum
++	LambdaSEnum
++	LevelsetAnalysisEnum
++	LevelsetfunctionPicardEnum
++	LinearFloatingMeltRateEnum
++	LliboutryDuvalEnum
++	LoadsEnum
++	LoveAnalysisEnum
++	LoveHiEnum
++	LoveHrEnum
++	LoveKernelsImagEnum
++	LoveKernelsRealEnum
++	LoveKiEnum
++	LoveKrEnum
++	LoveLiEnum
++	LoveLrEnum
++	LoveSolutionEnum
++	MINIEnum
++	MINIcondensedEnum
++	MantlePlumeGeothermalFluxEnum
++	MassFluxEnum
++	MassconEnum
++	MassconaxpbyEnum
++	MassfluxatgateEnum
++	MasstransportAnalysisEnum
++	MasstransportSolutionEnum
++	MatdamageiceEnum
++	MatenhancediceEnum
++	MaterialsEnum
++	MatestarEnum
++	MaticeEnum
++	MatlithoEnum
++	MathydroEnum
++	MatrixParamEnum
++	MaxAbsVxEnum
++	MaxAbsVyEnum
++	MaxAbsVzEnum
++	MaxDivergenceEnum
++	MaxVelEnum
++	MaxVxEnum
++	MaxVyEnum
++	MaxVzEnum
++	MelangeEnum
++	MeltingAnalysisEnum
++	MeshElementsEnum
++	MeshXEnum
++	MeshYEnum
++	MinVelEnum
++	MinVxEnum
++	MinVyEnum
++	MinVzEnum
++	MismipFloatingMeltRateEnum
++	MoulinEnum
++	MpiDenseEnum
++	MpiEnum
++	MpiSparseEnum
++	MumpsEnum
++	NoFrictionOnPartiallyFloatingEnum
++	NoMeltOnPartiallyFloatingEnum
++	NodalEnum
++	NodalvalueEnum
++	NodeSIdEnum
++	NoneApproximationEnum
++	NoneEnum
++	NumberedcostfunctionEnum
++	NyeCO2Enum
++	NyeH2OEnum
++	NumericalfluxEnum
++	OceantransportAnalysisEnum
++	OceantransportSolutionEnum
++	OldGradientEnum
++	OneLayerP4zEnum
++	OpenEnum
++	OptionEnum
++	ParamEnum
++	ParametersEnum
++	P0ArrayEnum
++	P0DGEnum
++	P1DGEnum
++	P1P1Enum
++	P1P1GLSEnum
++	P1bubbleEnum
++	P1bubblecondensedEnum
++	P1xP2Enum
++	P1xP3Enum
++	P1xP4Enum
++	P2Enum
++	P2bubbleEnum
++	P2bubblecondensedEnum
++	P2xP1Enum
++	P2xP4Enum
++	PatersonEnum
++	PengridEnum
++	PenpairEnum
++	PentaEnum
++	PentaInputEnum
++	ProfilerEnum
++	ProfilingCurrentFlopsEnum
++	ProfilingCurrentMemEnum
++	ProfilingSolutionTimeEnum
++	RegionaloutputEnum
++	RegularEnum
++	RecoveryAnalysisEnum
++	RiftfrontEnum
++	SamplingAnalysisEnum
++	SamplingSolutionEnum
++	SIAApproximationEnum
++	SMBautoregressionEnum
++	SMBcomponentsEnum
++	SMBd18opddEnum
++	SMBforcingEnum
++	SMBgcmEnum
++	SMBgembEnum
++	SMBgradientsEnum
++	SMBgradientscomponentsEnum
++	SMBgradientselaEnum
++	SMBhenningEnum
++	SMBmeltcomponentsEnum
++	SMBpddEnum
++	SMBpddSicopolisEnum
++	SMBsemicEnum
++	SSAApproximationEnum
++	SSAFSApproximationEnum
++	SSAHOApproximationEnum
++	ScaledEnum
++	SealevelAbsoluteEnum
++	SealevelEmotionEnum
++	SealevelInertiaTensorXZEnum
++	SealevelInertiaTensorYZEnum
++	SealevelInertiaTensorZZEnum
++	SealevelchangePolarMotionEnum
++	SealevelNmotionEnum
++	SealevelUmotionEnum
++	SealevelchangeAnalysisEnum
++	SegEnum
++	SegInputEnum
++	SegmentEnum
++	SegmentRiftfrontEnum
++	SeparateEnum
++	SeqEnum
++	SmbAnalysisEnum
++	SmbSolutionEnum
++	SmoothAnalysisEnum
++	SoftMigrationEnum
++	SpatialLinearFloatingMeltRateEnum
++	SpcDynamicEnum
++	SpcStaticEnum
++	SpcTransientEnum
++	SsetEnum
++	StatisticsSolutionEnum
++	SteadystateSolutionEnum
++	StressIntensityFactorEnum
++	StressbalanceAnalysisEnum
++	StressbalanceConvergenceNumStepsEnum
++	StressbalanceSIAAnalysisEnum
++	StressbalanceSolutionEnum
++	StressbalanceVerticalAnalysisEnum
++	StringArrayParamEnum
++	StringExternalResultEnum
++	StringParamEnum
++	SubelementFriction1Enum
++	SubelementFriction2Enum
++	SubelementMelt1Enum
++	SubelementMelt2Enum
++	SubelementMigrationEnum
++	SurfaceSlopeSolutionEnum
++	TaylorHoodEnum
++	TetraEnum
++	TetraInputEnum
++	ThermalAnalysisEnum
++	ThermalSolutionEnum
++	ThicknessErrorEstimatorEnum
++	TotalCalvingFluxLevelsetEnum
++	TotalCalvingMeltingFluxLevelsetEnum
++	TotalFloatingBmbEnum
++	TotalFloatingBmbScaledEnum
++	TotalGroundedBmbEnum
++	TotalGroundedBmbScaledEnum
++	TotalSmbEnum
++	TotalSmbScaledEnum
++	TransientArrayParamEnum
++	TransientInputEnum
++	TransientParamEnum
++	TransientSolutionEnum
++	TriaEnum
++	TriaInputEnum
++	UzawaPressureAnalysisEnum
++	VectorParamEnum
++	VertexEnum
++	VertexLIdEnum
++	VertexPIdEnum
++	VertexSIdEnum
++	VerticesEnum
++	ViscousHeatingEnum
++	WaterEnum
++	XTaylorHoodEnum
++	XYEnum
++	XYZEnum
++	#}}}
++	MaximumNumberOfDefinitionsEnum
++end
++
++function EnumToString(enum::IssmEnum)
++
++	#Make dictionnary from enums
++	inst = instances(IssmEnum)
++	syms = Symbol.(inst)
++	enumdic = Dict(zip(inst, syms))
++
++	return enumdic[enum]
++end
++
++function EnumToString(enum::Int64)
++	return EnumToString(IssmEnum(enum))
++end
++
++function StringToEnum(string::String)
++
++	#Make dictionnary from enums
++	inst = instances(IssmEnum)
++	syms = Symbol.(inst)
++	enumdic = Dict(zip(syms, inst))
++
++	return enumdic[Symbol(string)]
++end
++
++function StringToEnumInt(string::String)
++	return Integer(StringToEnum(string))
++end
+Index: ../trunk-jpl/src/jl/core/parameters.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/parameters.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/parameters.jl	(revision 26725)
+@@ -0,0 +1,46 @@
++#Parameter class definition
++abstract type Parameter end
++struct DoubleParam <: Parameter #{{{
++	enum::IssmEnum
++	value::Float64
++end# }}}
++struct IntParam <: Parameter #{{{
++	enum::IssmEnum
++	value::Int64
++end# }}}
++
++#Parameters dataset class definition
++mutable struct Parameters #{{{
++	lookup::Dict{IssmEnum,Parameter}
++end# }}}
++
++#Parameter functions
++function GetParameterValue(param::DoubleParam) #{{{
++	return param.value
++end#}}}
++function GetParameterValue(param::IntParam) #{{{
++	return param.value
++end#}}}
++
++#Parameters functions
++function AddParam(parameters::Parameters,value::Float64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = DoubleParam(enum,value)
++
++end#}}}
++function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = IntParam(enum,value)
++
++end#}}}
++function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
++
++	parameters.lookup[enum] = IntParam(enum,value)
++
++end#}}}
++function FindParam(parameters::Parameters,enum::IssmEnum) #{{{
++
++	param = parameters.lookup[enum]
++	return GetParameterValue(param)
++
++end#}}}
+Index: ../trunk-jpl/src/jl/issm.jl
+===================================================================
+--- ../trunk-jpl/src/jl/issm.jl	(revision 26724)
++++ ../trunk-jpl/src/jl/issm.jl	(revision 26725)
+@@ -5,16 +5,16 @@
+ 
+ module ISSM
+ 
+-include("md/classes.jl")
++include("usr/classes.jl")
+ export model
+-include("md/exp.jl")
+-include("md/utils.jl")
+-export archread
+-include("md/triangle.jl")
++include("usr/exp.jl")
++export expread, ContourToNodes
++include("usr/utils.jl")
++export archread, solve, issmdir
++include("usr/triangle.jl")
+ export triangle
+-include("md/parameterization.jl")
++include("usr/parameterization.jl")
+ export setmask, InterpFromMeshToMesh2d
+-include("solve/solve.jl")
+-export solve
++include("core/solve.jl")
+ 
+ end
+Index: ../trunk-jpl/src/jl/tests/test301.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test301.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/tests/test301.jl	(revision 26725)
+@@ -0,0 +1,45 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("../issm.jl")
++using .ISSM
++
++md = model()
++md = triangle(md,issmdir()*"/test/Exp/Square.exp",150000.)
++md = setmask(md,"","")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness .+20
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base
++
++#Initial velocity
++#x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++#y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++#vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++#vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++#index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
++md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.05
++md.stressbalance.reltol=0.05
++md.stressbalance.abstol=NaN
++
++#Boundary conditions
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary)
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/tests/test301.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/tests/test501.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test501.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/tests/test501.jl	(revision 26725)
+@@ -0,0 +1,50 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("../issm.jl")
++using .ISSM
++
++md = model()
++md = triangle(md,issmdir()*"/test/Exp/Pig.exp",10000.)
++md = setmask( md,issmdir()*"/test/Exp/PigShelves.exp",issmdir()*"/test/Exp/PigIslands.exp")
++
++#Initial velocity and geometry
++x         = archread(issmdir()*"/test/Data/Pig.arch","x")
++y         = archread(issmdir()*"/test/Data/Pig.arch","y")
++vx_obs    = archread(issmdir()*"/test/Data/Pig.arch","vx_obs")
++vy_obs    = archread(issmdir()*"/test/Data/Pig.arch","vy_obs")
++index     = Int.(archread(issmdir()*"/test/Data/Pig.arch","index"))
++surface   = archread(issmdir()*"/test/Data/Pig.arch","surface")
++thickness = archread(issmdir()*"/test/Data/Pig.arch","thickness")
++bed       = archread(issmdir()*"/test/Data/Pig.arch","bed")
++md.initialization.vx=InterpFromMeshToMesh2d(index, x, y, vx_obs, md.mesh.x, md.mesh.y, 0.0)
++md.initialization.vy=InterpFromMeshToMesh2d(index, x, y, vy_obs, md.mesh.x, md.mesh.y, 0.0)
++md.geometry.surface = InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y, 0.0)
++md.geometry.thickness = InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y, 0.0)
++md.geometry.base=md.geometry.surface .- md.geometry.thickness
++md.geometry.bed =md.geometry.base
++pos = findall(md.mask.ocean_levelset.<0)
++md.geometry.bed[pos] = InterpFromMeshToMesh2d(index, x, y, bed, md.mesh.x[pos], md.mesh.y[pos])
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=50*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.05
++md.stressbalance.reltol=1.0
++md.stressbalance.abstol=NaN
++
++#Boundary conditions
++pos = findall(vec(sum(Int64.(md.mask.ocean_levelset[md.mesh.elements].<0), dims=2)) .> 0.0)
++vertexonfloatingice=zeros(md.mesh.numberofvertices)
++vertexonfloatingice[md.mesh.elements[pos,:]] .= 1
++nodefront=(md.mesh.vertexonboundary .& (vertexonfloatingice.>0))
++md.mask.ice_levelset[findall(nodefront)] .= 0
++
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
++segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
++pos=md.mesh.segments[segments,1:2]
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/tests/test501.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/usr/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/classes.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/usr/classes.jl	(revision 26725)
+@@ -0,0 +1,201 @@
++using Printf
++
++abstract type AbstractMesh end
++mutable struct Mesh2dTriangle <: AbstractMesh
++	numberofvertices::Int64
++	numberofelements::Int64
++	x::Vector{Float64}
++	y::Vector{Float64}
++	elements::Matrix{Int64}
++	segments::Matrix{Int64}
++	vertexonboundary::Vector{Bool}
++end
++function Mesh2dTriangle() #{{{
++	return Mesh2dTriangle( 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef, 0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
++end# }}}
++function Base.show(io::IO, this::Mesh2dTriangle)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++mutable struct Mesh3dPrism{T} <: AbstractMesh
++	numberofvertices::Int64
++	numberofelements::Int64
++	numberoflayers::Int64
++	x::Vector{Float64}
++	y::Vector{Float64}
++	z::Vector{Float64}
++	elements::Matrix{Int64}
++	segments::Matrix{Int64}
++	vertexonboundary::Vector{Bool}
++end
++function Mesh3dPrism() #{{{
++	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
++end# }}}
++
++mutable struct Geometry
++	surface::Vector{Float64}
++	base::Vector{Float64}
++	thickness::Vector{Float64}
++	bed::Vector{Float64}
++end
++function Geometry() #{{{
++	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Mask
++	ocean_levelset::Vector{Float64}
++	ice_levelset::Vector{Float64}
++end
++function Mask() #{{{
++	return Mask( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++function Base.show(io::IO, this::Mask)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++
++mutable struct Initialization
++	vx::Vector{Float64}
++	vy::Vector{Float64}
++end
++function Initialization() #{{{
++	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++
++mutable struct Stressbalance
++	spcvx::Vector{Float64}
++	spcvy::Vector{Float64}
++	restol::Float64
++	reltol::Float64
++	abstol::Float64
++	maxiter::Int64
++end
++function Stressbalance() #{{{
++	return Stressbalance( Vector{Float64}(undef,0), Vector{Float64}(undef,0), 1.e-4, 0.01, 10., 100)
++end# }}}
++function Base.show(io::IO, this::Stressbalance)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++
++mutable struct Constants
++	g::Float64
++	yts::Float64
++end
++function Constants() #{{{
++	return Constants( 9.81,  365*24*3600.)
++end# }}}
++
++mutable struct Materials
++	rho_ice::Float64
++	rho_water::Float64
++	rho_freshwater::Float64
++	mu_water::Float64
++	heatcapacity::Float64
++	latentheat::Float64
++	thermalconductivity::Float64
++	temperateiceconductivity::Float64
++	effectiveconductivity_averaging::Int64
++	meltingpoint::Float64
++	beta::Float64
++	mixed_layer_capacity::Float64
++	thermal_exchange_velocity::Float64
++	rheology_B::Vector{Float64}
++	rheology_n::Vector{Float64}
++	rheology_law::String
++end
++function Materials() #{{{
++	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
++end# }}}
++
++abstract type AbstractFriction end
++mutable struct BuddFriction <: AbstractFriction
++	coefficient::Vector{Float64}
++end
++function BuddFriction() #{{{
++	return BuddFriction(Vector{Float64}(undef,0))
++end# }}}
++function Base.show(io::IO, this::BuddFriction)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++mutable struct WeertmanFriction <: AbstractFriction
++	C::Vector{Float64}
++	m::Vector{Float64}
++end
++
++mutable struct model
++	mesh::AbstractMesh
++	geometry::Geometry
++	mask::Mask
++	materials::Materials
++	initialization::Initialization
++	stressbalance::Stressbalance
++	constants::Constants
++	results
++	friction::AbstractFriction
++end
++function model() #{{{
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants(), [], BuddFriction())
++end#}}}
++function model(matmd::Dict) #{{{
++
++	#initialize output
++	md = model()
++
++	#Loop over all possible fields
++	for name1 in keys(matmd)
++		if !(Symbol(name1) in fieldnames(model))
++			println("could not recover md.",name1)
++			continue
++		end
++		mdfield  = getfield(md,Symbol(name1))
++		matfield = matmd[name1]
++		for name2 in keys(matfield)
++			if !(Symbol(name2) in fieldnames(typeof(mdfield)))
++				println("could not recover md.",name1,".",name2)
++				continue
++			end
++			value_matlab = matfield[name2]
++			value_julia  = getfield(mdfield, Symbol(name2))
++
++			if typeof(value_matlab)==typeof(value_julia)
++				setfield!(mdfield, Symbol(name2), value_matlab)
++
++			elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Int64
++				setfield!(mdfield, Symbol(name2), Int64(value_matlab))
++
++			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Float64}
++				if(size(value_matlab,2)!=1) error("only one column expected") end
++				setfield!(mdfield, Symbol(name2), value_matlab[:,1])
++
++			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Matrix{Int64}
++				matrix = Matrix{Int64}(undef,size(value_matlab))
++				for i in 1:length(value_matlab) matrix[i] = Int64(value_matlab[i]) end
++				setfield!(mdfield, Symbol(name2), matrix)
++
++			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Bool}
++				if(size(value_matlab,2)!=1) error("only one column expected") end
++				vector = Vector{Bool}(undef,size(value_matlab,1))
++				for i in 1:length(vector) vector[i] = Bool(value_matlab[i]) end
++				setfield!(mdfield, Symbol(name2), vector)
++
++			else
++				error("Don't know how to convert ",typeof(value_matlab)," to ",typeof(value_julia))
++			end
++		end
++	end
++
++	return md
++end#}}}
++function Base.show(io::IO, md::model)# {{{
++
++	compact = get(io, :compact, false)
++
++	println(io,"Model:")
++	@printf "%19s: %-26s -- %s\n" "mesh" typeof(md.mesh) "mesh properties"
++	@printf "%19s: %-26s -- %s\n" "geometry" typeof(md.geometry) "surface elevation, bedrock topography, ice thickness,..."
++	@printf "%19s: %-26s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
++	@printf "%19s: %-26s -- %s\n" "materials" typeof(md.materials) "material properties"
++	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
++	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
++	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
++	@printf "%19s: %-26s -- %s\n" "friction" typeof(md.friction) "basal friction"
++
++end# }}}
+Index: ../trunk-jpl/src/jl/usr/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/utils.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/usr/utils.jl	(revision 26725)
+@@ -0,0 +1,240 @@
++#utils
++function issmdir() #{{{
++	issmdir = ENV["ISSM_DIR"]
++
++	if isempty(issmdir)
++		error("Could not determine the location of ISSM")
++	else
++		return issmdir
++	end
++end#}}}
++function archread(filename::String,variablename::String) #{{{
++
++	#initialize variables
++	found = false
++
++	#open file
++	output = open(filename, "r") do f
++
++		while !eof(f)
++			reclen  = bswap(read(f, Int32))
++			rectype = bswap(read(f, Int32))
++			if rectype!=1
++				error("Expected variable of type string")
++			else
++				fieldname_length = bswap(read(f, Int32))
++				field_name = String(read(f, fieldname_length))
++			end
++			rec_length = bswap(read(f, Int32))
++			field_type = bswap(read(f, Int32))
++			if field_type==2
++				data = bswap(read(f, Float64))
++			elseif field_type==3
++				rows = bswap(read(f, Int32))
++				cols = bswap(read(f, Int32))
++				data = reinterpret(Float64, read(f, sizeof(Float64)*rows*cols))
++				data .= ntoh.(data)
++				data = reshape(data, (rows,cols))
++				data = collect(data)
++				if cols == 1
++					data = vec(data)
++				end
++			else
++				error("Error: Encountered invalid field type when reading data.")
++			end
++
++			if field_name == variablename
++				found = true
++				return data
++			end
++		end
++	end
++
++	return output
++end# }}}
++function InterpFromMeshToMesh2d(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector,default::Float64=NaN) #{{{
++
++	#Allocate output
++	nods_out = length(xout)
++	data_out = default*ones(nods_out)
++
++	#Interpolation type
++	data_length = size(data,1)
++	nods_data   = length(x_data)
++	nels_data   = size(index_data,1)
++	if(data_length==nods_data)
++		interpolation_type=1;
++	elseif (data_length==nels_data)
++		interpolation_type=2
++	else
++		error("length of vector data not supported yet. It should be of length (number of nodes) or (number of elements)!")
++	end
++	xmin = minimum(xout); xmax = maximum(xout)
++	ymin = minimum(yout); ymax = maximum(yout)
++
++	for i in 1:nels_data
++
++		#skip element if no overlap
++		if (minimum(x_data[index_data[i,:]]) > xmax) continue end
++		if (minimum(y_data[index_data[i,:]]) > ymax) continue end
++		if (maximum(x_data[index_data[i,:]]) < xmin) continue end
++		if (maximum(y_data[index_data[i,:]]) < ymin) continue end
++
++		#get area of the current element (Jacobian = 2 * area)*/
++		#area =x2 * y3 - y2*x3 + x1 * y2 - y1 * x2 + x3 * y1 - y3 * x1;
++		area = (x_data[index_data[i,2]]*y_data[index_data[i,3]]-y_data[index_data[i,2]]*x_data[index_data[i,3]] 
++				  +  x_data[index_data[i,1]]*y_data[index_data[i,2]]-y_data[index_data[i,1]]*x_data[index_data[i,2]] 
++				  +  x_data[index_data[i,3]]*y_data[index_data[i,1]]-y_data[index_data[i,3]]*x_data[index_data[i,1]])
++
++		for j in 1:nods_out
++			#Get first area coordinate = det(x-x3  x2-x3 ; y-y3   y2-y3)/area
++			area_1=((xout[j]-x_data[index_data[i,3]])*(y_data[index_data[i,2]]-y_data[index_data[i,3]])
++					 -  (yout[j]-y_data[index_data[i,3]])*(x_data[index_data[i,2]]-x_data[index_data[i,3]]))/area
++			#Get second area coordinate =det(x1-x3  x-x3 ; y1-y3   y-y3)/area
++			area_2=((x_data[index_data[i,1]]-x_data[index_data[i,3]])*(yout[j]-y_data[index_data[i,3]])
++					  - (y_data[index_data[i,1]]-y_data[index_data[i,3]])*(xout[j]-x_data[index_data[i,3]]))/area
++			#Get third area coordinate = 1-area1-area2
++			area_3=1-area_1-area_2
++
++			if (area_1>=0 && area_2>=0 && area_3>=0)
++				if (interpolation_type==1)
++					#nodal interpolation
++					data_out[j]=area_1*data[index_data[i,1]]+area_2*data[index_data[i,2]]+area_3*data[index_data[i,3]];
++				else
++					#element interpolation
++					data_out[j]=data[i];
++				end
++			end
++		end
++	end
++	return data_out
++
++	#OLD STUFF!!! not working...
++	
++	#prepare input arrays
++	nods = Cint(length(x))
++	nels = Cint(size(index,1))
++	nods_interp = Cint(length(xout))
++	Cindex=Array{Cint,1}(undef,length(index))
++	for i in 1:size(index,1)
++		for j in 1:3
++			Cindex[(i-1)*3+j] = Int32(index[i,j])
++		end
++	end
++	Cx    = Array{Cdouble,1}(undef,nods)
++	Cy    = Array{Cdouble,1}(undef,nods)
++	Cdata = Array{Cdouble,1}(undef,nods)
++	for i in 1:nods
++		Cx[i]    = x[i]
++		Cy[i]    = y[i]
++		Cdata[i] = data[i]
++	end
++	Cxout = Array{Cdouble,1}(undef,nods_interp)
++	Cyout = Array{Cdouble,1}(undef,nods_interp)
++	for i in 1:nods_interp
++		Cxout[i] = xout[i]
++		Cyout[i] = yout[i]
++	end
++
++	Cdataout = Vector{Float64}(undef,nods_interp)
++
++	#This is not working....
++	rc=ccall( (:InterpFromMeshToMesh2dx,"libISSMCore"),
++				Cint, (Ptr{Ptr{Cdouble}},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
++				Ref(Ref(Cdataout)), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
++				Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
++
++	#Process output
++	dataout = Vector{Float64}(undef,nods_interp)
++	for i in 1:nods_interp
++		dataout[i] = Cdataout[i]
++	end
++
++	return dataout
++end #}}}
++function InterpFromMeshToMesh2d2(index_data::Array,x_data::Vector,y_data::Vector,data::Vector,xout::Vector,yout::Vector) #{{{
++
++	#prepare input arrays
++	nods = Cint(length(x_data))
++	nels = Cint(size(index_data,1))
++	nods_interp = Cint(length(xout))
++	Cindex=Array{Cint,1}(undef,length(index_data))
++	for i in 1:size(index_data,1)
++		for j in 1:3
++			Cindex[(i-1)*3+j] = Int32(index_data[i,j])
++		end
++	end
++	Cx    = Array{Cdouble,1}(undef,nods)
++	Cy    = Array{Cdouble,1}(undef,nods)
++	Cdata = Array{Cdouble,1}(undef,nods)
++	for i in 1:nods
++		Cx[i]    = x_data[i]
++		Cy[i]    = y_data[i]
++		Cdata[i] = data[i]
++	end
++	Cxout    = Array{Cdouble,1}(undef,nods_interp)
++	Cyout    = Array{Cdouble,1}(undef,nods_interp)
++	Cdataout = Array{Cdouble,1}(undef,nods_interp)
++	for i in 1:nods_interp
++		Cxout[i] = xout[i]
++		Cyout[i] = yout[i]
++	end
++
++	#This is not working....
++	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
++	#			Cint, (Ptr{Cdouble},Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint),
++	#			Ref(Cdataout), Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels,
++	#			Ref(Cdata), nods, 1, Ref(Cxout), Ref(Cyout), nods_interp)
++	#rc=ccall( (:InterpFromMeshToMesh2dx,"../bamg/libBamg.so"),
++	#			Cint, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cint, Cint),
++	#			Ref(Cindex), Ref(Cx), Ref(Cy), nods, nels)
++	#
++	#
++	dataout = Vector{Float64}(undef,nods_interp)
++	rc=ccall( (:InterpFromMeshToMesh2dx3,"/Users/mmorligh/Desktop/issmuci/trunk-jpl/src/jl/bamg/libBamg.dylib"),
++				Cint, (Ptr{Cdouble}, Cint),
++				dataout, nods_interp)
++
++	#Process output
++	for i in 1:nods_interp
++		dataout[i] = Cdataout[i]
++	end
++
++	return dataout
++end #}}}
++function solve(md::model,solution::String) #{{{
++
++	if solution=="sb" || solution=="Stressbalance"
++		solutionstring = "StressbalanceSolution"
++	else
++		error("solutionstring "*solution*" not supported!");
++	end
++
++	IssmCore(md)
++
++	return md
++end #}}}
++function IssmStructDisp(io::IO, modelfield::Any) # {{{
++	println(io,typeof(modelfield),":")
++	for name in fieldnames(typeof(modelfield))
++		a=getfield(modelfield,name)
++		#print(io,"   $(name) = ")
++		@printf "%19s: " name
++		if isa(a,String)
++			println(io, a)
++		elseif length(a)>1
++			if !isempty(a)
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,"empty")
++			end
++		else
++			println(io, a)
++		end
++	end
++end #}}}
++function meshgrid(x::Vector, y::Vector)
++    X = [i for i in x, j in 1:length(y)]
++    Y = [j for i in 1:length(x), j in y]
++    return X, Y
++end
+Index: ../trunk-jpl/src/jl/usr/parameterization.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/parameterization.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/usr/parameterization.jl	(revision 26725)
+@@ -0,0 +1,54 @@
++# setmask {{{
++"""
++SETMASK - establish boundaries between grounded and floating ice.
++
++   By default, ice is considered grounded. The contour floatingicename defines nodes 
++   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
++   that are grounded (ie: ice rises, islands, etc ...)
++   All input files are in the Argus format (extension .exp).
++
++   Usage:
++      md=setmask(md,floatingicename,groundedicename)
++
++   Examples:
++      md=setmask(md,'all','');
++      md=setmask(md,'Iceshelves.exp','Islands.exp');
++"""
++function setmask(md::model,floatingicename::String,groundedicename::String)
++
++	elementonfloatingice = FlagElements( md, floatingicename)
++	elementongroundedice = FlagElements( md, groundedicename)
++
++	elementonfloatingice = convert( Array{Float64}, (elementonfloatingice.>0) .&  (elementongroundedice.==0.))
++	elementongroundedice = convert( Array{Float64}, elementonfloatingice.==0.)
++
++	vertexonfloatingice=zeros(md.mesh.numberofvertices)
++	vertexongroundedice=zeros(md.mesh.numberofvertices)
++
++	vertexongroundedice[md.mesh.elements[findall(elementongroundedice.>0),:]] .= 1.
++	vertexonfloatingice[findall(vertexongroundedice.==0.)] .= 1.
++
++	#define levelsets
++	md.mask.ocean_levelset = vertexongroundedice
++	md.mask.ocean_levelset[findall(vertexongroundedice .==0.)] .= -1.
++	md.mask.ice_levelset = -1*ones(md.mesh.numberofvertices)
++
++	return md
++end
++#}}}
++# FlagElements {{{
++function FlagElements(md::model,region::String)
++
++	if isempty(region)
++		flags = zeros(md.mesh.numberofelements)
++	elseif region == "all"
++		flags = ones(md.mesh.numberofelements)
++	else
++		xcenter = md.mesh.x[md.mesh.elements]*[1;1;1]/3
++		ycenter = md.mesh.y[md.mesh.elements]*[1;1;1]/3
++		flags = ContourToNodes(xcenter, ycenter, region, 2.)
++	end
++
++	return flags
++end
++#}}}
+Index: ../trunk-jpl/src/jl/usr/exp.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/exp.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/usr/exp.jl	(revision 26725)
+@@ -0,0 +1,234 @@
++#for exptool, look into this http://juliaplots.org/MakieReferenceImages/gallery//mouse_picking/index.html
++
++#exp object definition, constructor, and disp
++mutable struct ExpStruct #{{{
++	name::String
++	nods::Int32
++	density::Float64
++	x::Vector{Float64}
++   y::Vector{Float64}
++	closed::Bool
++end  #}}}
++function ExpStruct() #{{{
++	return ExpStruct("",0, 0., Vector{Float64}(undef,0), Vector{Float64}(undef,0), false)
++end# }}}
++function Base.show(io::IO, exp::ExpStruct)# {{{
++
++	compact = get(io, :compact, false)
++
++	println(io,"ExpStruct:")
++	for name in fieldnames(typeof(exp))
++		a=getfield(exp,name)
++		print(io,"   $(name) = ")
++		if !isempty(a)
++			if compact && eltype(a)<:Number && length(a)>3
++				println(io, typeof(a), " of size ", size(a))
++			else
++				println(io,a)
++			end
++		else
++			println(io,"empty")
++		end
++	end
++end# }}}
++
++#methods
++#expread {{{
++"""
++	EXPREAD - read a file exp and build a Structure
++
++	This function reads an *.exp* and builds a structure containing the fields x
++	and y corresponding to the coordinates, one for the filename of the exp
++	file, for the density, for the nodes, and a field 'closed' to indicate if the
++	domain is closed.
++
++	Usage:
++		exp=expread(filename)
++
++# Examples:
++```julia-repl
++julia> exp=expread('domainoutline.exp')
++```
++
++# Arguments:
++- filename: the ARGUS file to read
++"""
++function expread(filename::String)
++
++	#initialize output
++	contours = Vector{ExpStruct}(undef, 0)
++
++	#open file
++	f = open(filename, "r") do f
++
++		#initialize some variables
++		nprof = 0
++		line = 1
++
++		while !eof(f)
++
++			#read first line
++			A = readline(f); line += 1
++
++			#if isempty, go to the next line and try again
++			if isempty(A)
++				continue
++			else
++				#initialize new profile
++				nprof += 1 
++				exp = ExpStruct();
++			end
++
++			#extract profile name
++			if A[1:8]!="## Name:"
++				println("line $(line): $(A)")
++				error("Unexpected exp file formatting") 
++			end
++			if length(A)>8
++				exp.name = A[9:end]
++			end
++
++			#read Icon
++			A = readline(f); line += 1
++			if A[1:8]!="## Icon:" error("Unexpected exp file formatting") end
++
++			#read Info
++			A = readline(f); line += 1
++			if A[1:14]!="# Points Count"
++				println("line $(line): $(A)")
++				error("Unexpected exp file formatting") 
++			end
++
++			#Reads number of nods and density
++			A = readline(f); line += 1
++			A = parse.(Float64, split(A))
++			if length(A) != 2 error("Unexpected exp file formatting") end
++			exp.nods = A[1]; exp.density = A[2]
++
++			#Allocate arrays
++			if exp.nods<=0 error("Unexpected exp file formatting") end
++			exp.x = Vector{Float64}(undef,exp.nods)
++			exp.y = Vector{Float64}(undef,exp.nods)
++
++			#Read coordinates
++			A = readline(f); line += 1
++			if A[1:13]!="# X pos Y pos" error("Unexpected exp file formatting") end
++			for i in 1:exp.nods
++				A = readline(f); line += 1
++				A = parse.(Float64, split(A))
++				if length(A) != 2 error("Unexpected exp file formatting") end
++				if any(isnan.(A)) error("NaNs found in coordinate") end
++				exp.x[i] = A[1]; exp.y[i] = A[2]
++			end
++
++			#check if closed
++			if exp.nods>1 && exp.x[1]==exp.x[end] && exp.y[1]==exp.y[end]
++				exp.closed = true
++			else
++				exp.closed = false
++			end
++
++			#add profile to list
++			push!(contours, exp)
++		end
++	end
++
++	return contours
++end# }}}
++#ContourToNodes{{{
++"""
++	ContourToNodes - Flag points that are in contour
++
++   More doc to come later....
++
++	Usage:
++		exp=expread(filename)
++
++# Examples:
++```julia-repl
++julia> exp=expread('domainoutline.exp')
++```
++
++# Arguments:
++- filename: the ARGUS file to read
++"""
++function ContourToNodes(x::Vector{Float64},y::Vector{Float64},filename::String,edgevalue::Float64)
++
++	#Read input file
++	contours = expread(filename)
++
++	#Initialize output
++	nbpts = length(x)
++	flags = zeros(Bool,nbpts)
++
++	#Loop over contours
++	for c in 1:length(contours)
++
++		#Get current contours
++		contour = contours[c]
++		xp      = contour.x
++		yp      = contour.y
++
++		#Check that we are within box
++		xmin = minimum(xp); xmax = maximum(xp)
++		ymin = minimum(yp); ymax = maximum(yp)
++
++		#Loop over all points provided
++		for ii in 1:nbpts
++
++			#If this node is already within one of the contours, do not change it
++			if(flags[ii]) continue end
++
++			#Are we within bounds?
++			if(x[ii]<xmin || x[ii]>xmax || y[ii]<ymin || y[ii]>ymax) continue end
++
++			#we are potentially inside... perform pnpoly test
++			flags[ii] = pnpoly(xp, yp, x[ii], y[ii], edgevalue)
++		end
++	end
++	
++	return flags
++end# }}}
++
++function pnpoly(xp::Vector{Float64},yp::Vector{Float64},x::Float64,y::Float64,edgevalue::Float64) #{{{
++
++	npol = length(xp)
++
++	#Do we need to test for colinearity?
++	if(edgevalue!=2)
++		i = 1
++		j = npol
++		while(i<=npol)
++
++			n1 = (yp[i]-yp[j])^2 + (xp[i]-xp[j])^2
++			n2 = (y-yp[j])^2 + (x-xp[j])^2
++
++			normp=sqrt(n1*n2)
++			scalar=(yp[i]-yp[j])*(y-yp[j])+(xp[i]-xp[j])*(x-xp[j])
++
++			if (scalar == normp)
++				if (n2<=n1)
++					return edgevalue
++				end
++			end
++
++			j =  i
++			i += 1
++		end
++	end
++
++	#second test : point is neither on a vertex, nor on a side, where is it ?
++	i = 1
++	j = npol
++	c = false
++	while(i<=npol)
++		if (((yp[i]<=y && y<yp[j]) || (yp[j]<=y && y<yp[i])) &&
++            (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
++         c = !c
++		end
++
++		j =  i
++		i += 1
++	end
++	return c
++end# }}}
+Index: ../trunk-jpl/src/jl/usr/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/plotmodel.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/usr/plotmodel.jl	(revision 26725)
+@@ -0,0 +1,45 @@
++import ColorSchemes.jet
++using GLMakie
++using .ISSM
++
++function plotmodel(md::ISSM.model,data::Vector)
++
++	vertexcolor  = :black
++	facetcolor   = :blue
++	showvertices = true
++	showfacets   = true
++
++	if data isa AbstractVector
++
++		if length(data)==md.mesh.numberofelements
++			# vector of polygons
++			x = md.mesh.x
++			y = md.mesh.y
++			index = md.mesh.elements
++			ps = [Makie.GeometryBasics.Polygon([Point2(x[index[i,1]], y[index[i,1]]), Point2(x[index[i,2]], y[index[i,2]]), Point2(x[index[i,3]], y[index[i,3]])])
++					for i in 1:md.mesh.numberofelements]
++
++			fig, ax, h = Makie.poly(ps, color = data, colormap = jet)
++
++			#Add colorbar
++			Colorbar(fig[1, 2], limits = (minimum(data), maximum(data)), colormap = jet)
++		elseif length(data)==md.mesh.numberofvertices
++			fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
++
++			#Add colorbar
++			#Colorbar(fig[1, 2], h, width=25)
++		else
++			error("data of size "*string(length(data))*" not supported yet!")
++		end
++	else
++		# default to single color
++		@assert length(data)==1
++		fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
++	end
++
++	if showvertices
++		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
++	end
++
++	return fig
++end
+Index: ../trunk-jpl/src/jl/usr/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/triangle.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/usr/triangle.jl	(revision 26725)
+@@ -0,0 +1,178 @@
++
++#Class Triangle's triangulateio
++mutable struct CTriangulateIO #{{{
++
++    pointlist :: Ptr{Cdouble}
++    pointattributelist :: Ptr{Cdouble}
++    pointmarkerlist :: Ptr{Cint}
++    numberofpoints :: Cint
++    numberofpointattributes :: Cint
++    
++    trianglelist :: Ptr{Cint}
++    triangleattributelist :: Ptr{Cdouble}
++    trianglearealist :: Ptr{Cdouble}
++    neighborlist :: Ptr{Cint}
++    numberoftriangles :: Cint
++    numberofcorners :: Cint
++    numberoftriangleattributes :: Cint
++    
++    segmentlist :: Ptr{Cint}
++    segmentmarkerlist :: Ptr{Cint}
++    numberofsegments :: Cint
++
++    holelist :: Ptr{Cdouble}
++    numberofholes :: Cint
++
++    regionlist :: Ptr{Cdouble}
++    numberofregions :: Cint
++
++    edgelist :: Ptr{Cint}
++    edgemarkerlist :: Ptr{Cint}
++    normlist :: Ptr{Cdouble}
++    numberofedges :: Cint
++ end  #}}}
++function CTriangulateIO() #{{{
++	return CTriangulateIO(C_NULL, C_NULL, C_NULL, 0, 0,
++								 C_NULL, C_NULL, C_NULL, C_NULL, 0, 0, 0,
++								 C_NULL, C_NULL, 0,
++								 C_NULL, 0,
++								 C_NULL, 0,
++								 C_NULL, C_NULL, C_NULL, 0)
++end# }}}
++function Base.show(io::IO, tio::CTriangulateIO)# {{{
++	println(io,"CTriangulateIO(")
++	for name in fieldnames(typeof(tio))
++		a=getfield(tio,name)
++		print(io,"$(name) = ")
++		println(io,a)
++	end
++	println(io,")")
++end# }}}
++
++using Printf #needed for sprintf
++
++"""
++TRIANGLE - create model mesh using the triangle package
++
++	This function creates a model mesh using Triangle and a domain outline, to
++	within a certain resolution
++#Arguments
++ - md is a model tuple
++ - domainname is the name of an Argus domain outline file
++ - resolution:  is a characteristic length for the mesh (same unit as the domain outline unit)
++
++# Usage:
++ - md=triangle(md,domainname,resolution)
++# Examples:
++ - md=triangle(md,'DomainOutline.exp',1000);
++ - md=triangle(md,'DomainOutline.exp','Rifts.exp',1500);
++"""
++function triangle(md::model,domainname::String,resolution::Float64) #{{{
++
++	#read input file
++	contours = expread(domainname)
++	area     = resolution^2
++
++	#Initialize i/o structures
++	ctio_in  = CTriangulateIO();
++	ctio_out = CTriangulateIO();
++	vor_out  = CTriangulateIO();
++
++	#Construct input structure
++	numberofpoints   = 0
++	numberofsegments = 0
++	for i in 1:length(contours)
++		numberofpoints   += contours[i].nods-1
++		numberofsegments += contours[i].nods-1
++	end
++	numberofpointattributes = 1
++
++	pointlist=Array{Cdouble,2}(undef,2,numberofpoints)
++	count = 0
++	for i in 1:length(contours)
++		nods = contours[i].nods
++		pointlist[1,count+1:count+nods-1] = contours[i].x[1:end-1]
++		pointlist[2,count+1:count+nods-1] = contours[i].y[1:end-1]
++		count += (nods-1)
++	end
++	pointattributelist=Array{Cdouble,1}(undef,numberofpoints)
++	pointmarkerlist=Array{Cint,1}(undef,numberofpoints)
++	for i in 1:numberofpoints
++		pointmarkerlist[i]=0
++		pointattributelist[i]=0.
++	end
++
++	counter=0;
++   backcounter=0;
++	segmentlist=Array{Cint,2}(undef,2,numberofsegments)
++	segmentmarkerlist=Array{Cint,1}(undef,numberofsegments)
++	segmentmarkerlist[:].=0
++	for i in 1:length(contours)
++		nods = contours[i].nods
++		segmentlist[1,counter+1:counter+nods-2] = collect(counter+0:counter+nods-3)
++		segmentlist[2,counter+1:counter+nods-2] = collect(counter+1:counter+nods-2)
++		counter+=nods-2
++		#close profile
++		segmentlist[1,counter+1]=counter
++		segmentlist[2,counter+1]=backcounter
++		counter+=1
++		backcounter=counter
++	end
++
++	numberofregions = 0
++	numberofholes = length(contours)-1
++	holelist = Array{Cdouble,2}(undef,2,numberofholes)
++	if numberofholes>0
++		 for i in 2:length(contours)
++			 xA=contours[i].x[1]; xB=contours[i].x[end-1]
++			 yA=contours[i].y[1]; yB=contours[i].y[end-1]
++			 xC=(xA+xB)/2;        yC=(yA+yB)/2;
++			 xD=xC+tan(10. /180. *pi)*(yC-yA);
++			 yD=yC+tan(10. /180. *pi)*(xA-xC);
++			 xE=xC-tan(10. /180. *pi)*(yC-yA);
++			 yE=yC-tan(10. /180. *pi)*(xA-xC);
++			 holelist[1,i-1] = xD
++			 holelist[2,i-1] = yD
++		 end
++	end
++
++	#based on this, prepare input structure
++	ctio_in.numberofpoints = numberofpoints
++	ctio_in.pointlist=pointer(pointlist)
++	ctio_in.numberofpointattributes=numberofpointattributes
++	ctio_in.pointattributelist=pointer(pointattributelist)
++	ctio_in.pointmarkerlist=pointer(pointmarkerlist)
++	ctio_in.numberofsegments=numberofsegments
++	ctio_in.segmentlist=pointer(segmentlist)
++	ctio_in.segmentmarkerlist = pointer(segmentmarkerlist)
++	ctio_in.numberofholes=numberofholes
++	ctio_in.holelist=pointer(holelist)
++	ctio_in.numberofregions=0
++
++	#Call triangle using ISSM's default options
++	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
++	#rc=ccall( (:triangulate,"libtriangle"),
++	rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
++				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
++				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
++
++	#post process output
++	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
++	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
++	segments  = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.segmentlist,  (2,Int(ctio_out.numberofsegments)), own=true))' .+1
++	
++	#assign output
++	md.mesh = Mesh2dTriangle()
++	md.mesh.numberofvertices = ctio_out.numberofpoints
++	md.mesh.numberofelements = ctio_out.numberoftriangles
++	md.mesh.x                = points[:,1]
++	md.mesh.y                = points[:,2]
++	md.mesh.elements         = triangles
++	md.mesh.segments         = segments
++
++	#post processing
++	md.mesh.vertexonboundary = zeros(Bool,md.mesh.numberofvertices)
++	md.mesh.vertexonboundary[md.mesh.segments] .= true
++
++   return md
++end#}}}
+Index: ../trunk-jpl/src/jl/core/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/solve.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/solve.jl	(revision 26725)
+@@ -0,0 +1,38 @@
++include("../usr/classes.jl")
++include("./issmenums.jl")
++include("./toolkits.jl")
++include("./gauss.jl")
++include("./parameters.jl")
++include("./inputs.jl")
++include("./vertices.jl")
++include("./nodes.jl")
++include("./elements.jl")
++include("./constraints.jl")
++include("./results.jl")
++include("./matice.jl")
++include("./friction.jl")
++include("./femmodel.jl")
++include("./analyses/analysis.jl")
++include("./analyses/stressbalanceanalysis.jl")
++include("./solutionsequences.jl")
++include("./modules.jl")
++include("./elementmatrix.jl")
++include("./utils.jl")
++
++function IssmCore(md::model) #{{{
++
++
++	#Construct FemModel
++	femmodel=ModelProcessor(md)
++
++	#Solve
++	analysis = StressbalanceAnalysis()
++	Core(analysis, femmodel)
++
++	#Save output
++	RequestedOutputsx(femmodel, [VxEnum,VyEnum,VelEnum])
++
++	#move results to md
++	OutputResultsx(femmodel, md)
++
++end# }}}
+Index: ../trunk-jpl/src/jl/tests/test.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/tests/test.jl	(revision 26725)
+@@ -0,0 +1,14 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("../issm.jl")
++using .ISSM
++using MAT
++
++#Load model from MATLAB file
++file = matopen("Pig.mat")
++#file = matopen("/Users/mmorligh/Desktop/issmuci/trunk-jpl/examples/Pig2/Pig.mat")
++mat = read(file, "md")
++close(file)
++md=model(mat)
++
++#Solve stress balance
++md=ISSM.solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/tests/test.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/tests/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test101.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/tests/test101.jl	(revision 26725)
+@@ -0,0 +1,45 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("../issm.jl")
++using .ISSM
++
++md = model()
++md = triangle(md,issmdir()*"/test/Exp/Square.exp",50000.)
++md = setmask(md,"all","")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base .-10
++
++#Initial velocity
++x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++index = Int.(archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
++md.initialization.vx=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.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.05
++md.stressbalance.reltol=0.05
++md.stressbalance.abstol=NaN
++
++#Boundary conditions
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary)
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/tests/test101.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/tests/test201.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test201.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/tests/test201.jl	(revision 26725)
+@@ -0,0 +1,51 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("../issm.jl")
++using .ISSM
++
++md = model()
++md = triangle(md,issmdir()*"/test/Exp/Square.exp",50000.)
++md = setmask(md,"all","")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base .-10
++
++#Initial velocity
++x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
++md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.1
++md.stressbalance.reltol=0.02
++md.stressbalance.abstol=NaN
++
++#Boundary conditions
++nodefront=ContourToNodes(md.mesh.x,md.mesh.y,issmdir()*"/test/Exp/SquareFront.exp",2.0) .& md.mesh.vertexonboundary
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary .& .~nodefront)
++md.mask.ice_levelset[findall(nodefront)] .= 0
++
++segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
++segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
++pos=md.mesh.segments[segments,1:2]
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md=solve(md,"Stressbalance")
+
+Property changes on: ../trunk-jpl/src/jl/tests/test201.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/25834-26739/ISSM-26725-26726.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26725-26726.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26725-26726.diff	(revision 26740)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/src/jl/tests/test201.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test201.jl	(revision 26725)
++++ ../trunk-jpl/src/jl/tests/test201.jl	(revision 26726)
+@@ -3,8 +3,8 @@
+ using .ISSM
+ 
+ md = model()
+-md = triangle(md,issmdir()*"/test/Exp/Square.exp",50000.)
+-md = setmask(md,"all","")
++md = triangle(md,issmdir()*"/test/Exp/Square.exp", 50000.)
++md = setmask(md, "all", "")
+ 
+ #Geometry
+ hmin=300.
+Index: ../trunk-jpl/src/jl/tests/test.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test.jl	(revision 26725)
++++ ../trunk-jpl/src/jl/tests/test.jl	(revision 26726)
+@@ -4,11 +4,10 @@
+ using MAT
+ 
+ #Load model from MATLAB file
+-file = matopen("Pig.mat")
+-#file = matopen("/Users/mmorligh/Desktop/issmuci/trunk-jpl/examples/Pig2/Pig.mat")
++file = matopen("./Pig.mat")
+ mat = read(file, "md")
+ close(file)
+ md=model(mat)
+ 
+ #Solve stress balance
+-md=ISSM.solve(md,"Stressbalance")
++md=solve(md, "Stressbalance")
+Index: ../trunk-jpl/src/jl/usr/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/plotmodel.jl	(revision 26725)
++++ ../trunk-jpl/src/jl/usr/plotmodel.jl	(revision 26726)
+@@ -1,8 +1,8 @@
+ import ColorSchemes.jet
+-using GLMakie
++using  GLMakie
+ using .ISSM
+ 
+-function plotmodel(md::ISSM.model,data::Vector)
++function plotmodel(md::model,data::Vector)
+ 
+ 	vertexcolor  = :black
+ 	facetcolor   = :blue
Index: /issm/oecreview/Archive/25834-26739/ISSM-26726-26727.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26726-26727.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26726-26727.diff	(revision 26740)
@@ -0,0 +1,1919 @@
+Index: ../trunk-jpl/src/jl/core/issmenums.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/issmenums.jl	(revision 26726)
++++ ../trunk-jpl/src/jl/core/issmenums.jl	(revision 26727)
+@@ -1,6 +1,9 @@
++#   WARNING: DO NOT MODIFY THIS FILE
++#            this file has been automatically generated by Synchronize.sh
++#            Please read README for more information
++
+ @enum IssmEnum begin
+ 	ParametersSTARTEnum
+-	#Parameters{{{
+ 	AdolcParamEnum
+ 	AmrDeviatoricErrorGroupThresholdEnum
+ 	AmrDeviatoricErrorMaximumEnum
+@@ -162,8 +165,14 @@
+ 	FrictionThresholdSpeedEnum
+ 	FrictionVoidRatioEnum
+ 	FrontalForcingsBasinIcefrontAreaEnum
++	FrontalForcingsAutoregressionInitialTimeEnum
++	FrontalForcingsAutoregressionTimestepEnum
++	FrontalForcingsAutoregressiveOrderEnum
++	FrontalForcingsBeta0Enum
++	FrontalForcingsBeta1Enum
+ 	FrontalForcingsNumberofBasinsEnum
+ 	FrontalForcingsParamEnum
++	FrontalForcingsPhiEnum
+ 	GrdModelEnum
+ 	GroundinglineFrictionInterpolationEnum
+ 	GroundinglineMeltInterpolationEnum
+@@ -376,6 +385,15 @@
+ 	SolidearthSettingsMaxiterEnum
+ 	SolidearthSettingsGrdOceanEnum
+ 	SolidearthSettingsOceanAreaScalingEnum
++	StochasticForcingCovarianceEnum
++	StochasticForcingDefaultDimensionEnum
++	StochasticForcingDimensionsEnum
++	StochasticForcingFieldsEnum
++	StochasticForcingIsEffectivePressureEnum
++	StochasticForcingIsStochasticForcingEnum
++	StochasticForcingIsWaterPressureEnum
++	StochasticForcingNumFieldsEnum
++	StochasticForcingRandomflagEnum
+ 	RotationalPolarMoiEnum
+ 	SolidearthSettingsReltolEnum
+ 	SealevelchangeRequestedOutputsEnum
+@@ -406,7 +424,6 @@
+ 	SmbAveragingEnum
+ 	SmbBeta0Enum
+ 	SmbBeta1Enum
+-	SmbCovmatEnum
+ 	SmbDesfacEnum
+ 	SmbDpermilEnum
+ 	SmbDsnowIdxEnum
+@@ -416,6 +433,7 @@
+ 	SmbDenIdxEnum
+ 	SmbDtEnum
+ 	SmbEnum
++	SmbEIdxEnum
+ 	SmbFEnum
+ 	SmbInitDensityScalingEnum
+ 	SmbIsaccumulationEnum
+@@ -424,6 +442,7 @@
+ 	SmbIsd18opdEnum
+ 	SmbIsdelta18oEnum
+ 	SmbIsdensificationEnum
++	SmbIsdeltaLWupEnum
+ 	SmbIsfirnwarmingEnum
+ 	SmbIsgraingrowthEnum
+ 	SmbIsmeltEnum
+@@ -439,7 +458,6 @@
+ 	SmbNumRequestedOutputsEnum
+ 	SmbPfacEnum
+ 	SmbPhiEnum
+-	SmbRandomflagEnum
+ 	SmbRdlEnum
+ 	SmbRequestedOutputsEnum
+ 	SmbRlapsEnum
+@@ -452,6 +470,7 @@
+ 	SmbSwIdxEnum
+ 	SmbT0dryEnum
+ 	SmbT0wetEnum
++	SmbTeThreshEnum
+ 	SmbTdiffEnum
+ 	SmbThermoDeltaTScalingEnum
+ 	SmbTemperaturesReconstructedYearsEnum
+@@ -509,7 +528,7 @@
+ 	TransientIsgiaEnum
+ 	TransientIsgroundinglineEnum
+ 	TransientIshydrologyEnum
+-	TransientIsmasstransportEnum 
++	TransientIsmasstransportEnum
+ 	TransientIsoceantransportEnum
+ 	TransientIsmovingfrontEnum
+ 	TransientIsoceancouplingEnum
+@@ -526,10 +545,8 @@
+ 	ZzeEnum
+ 	AreaeEnum
+ 	WorldCommEnum
+-	#}}}
+ 	ParametersENDEnum
+ 	InputsSTARTEnum
+-	#Inputs{{{
+ 	AccumulatedDeltaBottomPressureEnum
+ 	AccumulatedDeltaIceThicknessEnum
+ 	AccumulatedDeltaTwsEnum
+@@ -574,6 +591,9 @@
+ 	BaseOldEnum
+ 	BaseSlopeXEnum
+ 	BaseSlopeYEnum
++	BaselineBasalforcingsFloatingiceMeltingRateEnum
++	BaselineCalvingCalvingrateEnum
++	BaselineFrictionEffectivePressureEnum
+ 	BedEnum
+ 	BedGRDEnum
+ 	BedEastEnum
+@@ -867,6 +887,7 @@
+ 	SmbAccumulationEnum
+ 	SmbAdiffiniEnum
+ 	SmbAiniEnum
++	SmbAutoregressionNoiseEnum
+ 	SmbBasinsIdEnum
+ 	SmbBMaxEnum
+ 	SmbBMinEnum
+@@ -888,6 +909,7 @@
+ 	SmbDailywindspeedEnum
+ 	SmbDiniEnum
+ 	SmbDlwrfEnum
++	SmbDulwrfValueEnum
+ 	SmbDswrfEnum
+ 	SmbDswdiffrfEnum
+ 	SmbDzAddEnum
+@@ -916,7 +938,6 @@
+ 	SmbMeanSHFEnum
+ 	SmbMeanULWEnum
+ 	SmbMeltEnum
+-	SmbMInitnum
+ 	SmbMonthlytemperaturesEnum
+ 	SmbMSurfEnum
+ 	SmbNetLWEnum
+@@ -969,6 +990,7 @@
+ 	SolidearthExternalDisplacementNorthRateEnum
+ 	SolidearthExternalDisplacementUpRateEnum
+ 	SolidearthExternalGeoidRateEnum
++	StochasticForcingDefaultIdEnum
+ 	StrainRateeffectiveEnum
+ 	StrainRateparallelEnum
+ 	StrainRateperpendicularEnum
+@@ -1004,6 +1026,8 @@
+ 	TemperaturePDDEnum
+ 	TemperaturePicardEnum
+ 	TemperatureSEMICEnum
++	ThermalforcingAutoregressionNoiseEnum
++	ThermalforcingValuesAutoregressionEnum
+ 	ThermalSpctemperatureEnum
+ 	ThicknessAbsGradientEnum
+ 	ThicknessAbsMisfitEnum
+@@ -1040,6 +1064,8 @@
+ 	WaterfractionDrainageIntegratedEnum
+ 	WaterfractionEnum
+ 	WaterheightEnum
++	FrictionWaterPressureEnum
++	FrictionWaterPressureNoiseEnum
+ 	WeightsLevelsetObservationEnum
+ 	WeightsSurfaceObservationEnum
+ 	OldAccumulatedDeltaBottomPressureEnum
+@@ -1145,9 +1171,7 @@
+ 	Outputdefinition99Enum
+ 	Outputdefinition9Enum
+ 	Outputdefinition100Enum
+-	#}}}
+ 	InputsENDEnum
+-	#Other{{{
+ 	AbsoluteEnum
+ 	AdaptiveTimesteppingEnum
+ 	AdjointBalancethickness2AnalysisEnum
+@@ -1252,6 +1276,7 @@
+ 	FreeSurfaceTopAnalysisEnum
+ 	FrontalForcingsDefaultEnum
+ 	FrontalForcingsRignotEnum
++	FrontalForcingsRignotAutoregressionEnum
+ 	FsetEnum
+ 	FullMeltOnPartiallyFloatingEnum
+ 	GLheightadvectionAnalysisEnum
+@@ -1511,34 +1536,1576 @@
+ 	XTaylorHoodEnum
+ 	XYEnum
+ 	XYZEnum
+-	#}}}
++	BalancethicknessD0Enum
++	BalancethicknessDiffusionCoefficientEnum
++	BilinearInterpEnum
++	CalvingdevCoeffEnum
++	DeviatoricStressEnum
++	EtaAbsGradientEnum
++	MeshZEnum
++	NearestInterpEnum
++	OutputdefinitionListEnum
++	SealevelObsEnum
++	SealevelWeightsEnum
++	StrainRateEnum
++	StressTensorEnum
++	StressbalanceViscosityOvershootEnum
++	SubelementMigration4Enum
++	TimesteppingTimeAdaptEnum
++	TriangleInterpEnum
+ 	MaximumNumberOfDefinitionsEnum
+ end
+ 
+ function EnumToString(enum::IssmEnum)
+-
+-	#Make dictionnary from enums
+-	inst = instances(IssmEnum)
+-	syms = Symbol.(inst)
+-	enumdic = Dict(zip(inst, syms))
+-
+-	return enumdic[enum]
++	if(enum==ParametersSTARTEnum) return "ParametersSTART" end
++	if(enum==AdolcParamEnum) return "AdolcParam" end
++	if(enum==AmrDeviatoricErrorGroupThresholdEnum) return "AmrDeviatoricErrorGroupThreshold" end
++	if(enum==AmrDeviatoricErrorMaximumEnum) return "AmrDeviatoricErrorMaximum" end
++	if(enum==AmrDeviatoricErrorResolutionEnum) return "AmrDeviatoricErrorResolution" end
++	if(enum==AmrDeviatoricErrorThresholdEnum) return "AmrDeviatoricErrorThreshold" end
++	if(enum==AmrErrEnum) return "AmrErr" end
++	if(enum==AmrFieldEnum) return "AmrField" end
++	if(enum==AmrGradationEnum) return "AmrGradation" end
++	if(enum==AmrGroundingLineDistanceEnum) return "AmrGroundingLineDistance" end
++	if(enum==AmrGroundingLineResolutionEnum) return "AmrGroundingLineResolution" end
++	if(enum==AmrHmaxEnum) return "AmrHmax" end
++	if(enum==AmrHminEnum) return "AmrHmin" end
++	if(enum==AmrIceFrontDistanceEnum) return "AmrIceFrontDistance" end
++	if(enum==AmrIceFrontResolutionEnum) return "AmrIceFrontResolution" end
++	if(enum==AmrKeepMetricEnum) return "AmrKeepMetric" end
++	if(enum==AmrLagEnum) return "AmrLag" end
++	if(enum==AmrLevelMaxEnum) return "AmrLevelMax" end
++	if(enum==AmrRestartEnum) return "AmrRestart" end
++	if(enum==AmrThicknessErrorGroupThresholdEnum) return "AmrThicknessErrorGroupThreshold" end
++	if(enum==AmrThicknessErrorMaximumEnum) return "AmrThicknessErrorMaximum" end
++	if(enum==AmrThicknessErrorResolutionEnum) return "AmrThicknessErrorResolution" end
++	if(enum==AmrThicknessErrorThresholdEnum) return "AmrThicknessErrorThreshold" end
++	if(enum==AmrTypeEnum) return "AmrType" end
++	if(enum==AnalysisCounterEnum) return "AnalysisCounter" end
++	if(enum==AnalysisTypeEnum) return "AnalysisType" end
++	if(enum==AugmentedLagrangianREnum) return "AugmentedLagrangianR" end
++	if(enum==AugmentedLagrangianRholambdaEnum) return "AugmentedLagrangianRholambda" end
++	if(enum==AugmentedLagrangianRhopEnum) return "AugmentedLagrangianRhop" end
++	if(enum==AugmentedLagrangianRlambdaEnum) return "AugmentedLagrangianRlambda" end
++	if(enum==AugmentedLagrangianThetaEnum) return "AugmentedLagrangianTheta" end
++	if(enum==AutodiffCbufsizeEnum) return "AutodiffCbufsize" end
++	if(enum==AutodiffDependentObjectsEnum) return "AutodiffDependentObjects" end
++	if(enum==AutodiffDriverEnum) return "AutodiffDriver" end
++	if(enum==AutodiffFosForwardIndexEnum) return "AutodiffFosForwardIndex" end
++	if(enum==AutodiffFosReverseIndexEnum) return "AutodiffFosReverseIndex" end
++	if(enum==AutodiffFovForwardIndicesEnum) return "AutodiffFovForwardIndices" end
++	if(enum==AutodiffGcTriggerMaxSizeEnum) return "AutodiffGcTriggerMaxSize" end
++	if(enum==AutodiffGcTriggerRatioEnum) return "AutodiffGcTriggerRatio" end
++	if(enum==AutodiffIsautodiffEnum) return "AutodiffIsautodiff" end
++	if(enum==AutodiffLbufsizeEnum) return "AutodiffLbufsize" end
++	if(enum==AutodiffNumDependentsEnum) return "AutodiffNumDependents" end
++	if(enum==AutodiffNumIndependentsEnum) return "AutodiffNumIndependents" end
++	if(enum==AutodiffObufsizeEnum) return "AutodiffObufsize" end
++	if(enum==AutodiffTapeAllocEnum) return "AutodiffTapeAlloc" end
++	if(enum==AutodiffTbufsizeEnum) return "AutodiffTbufsize" end
++	if(enum==AutodiffXpEnum) return "AutodiffXp" end
++	if(enum==BalancethicknessStabilizationEnum) return "BalancethicknessStabilization" end
++	if(enum==BarystaticContributionsEnum) return "BarystaticContributions" end
++	if(enum==BasalforcingsBottomplumedepthEnum) return "BasalforcingsBottomplumedepth" end
++	if(enum==BasalforcingsCrustthicknessEnum) return "BasalforcingsCrustthickness" end
++	if(enum==BasalforcingsDeepwaterElevationEnum) return "BasalforcingsDeepwaterElevation" end
++	if(enum==BasalforcingsDeepwaterMeltingRateEnum) return "BasalforcingsDeepwaterMeltingRate" end
++	if(enum==BasalforcingsDtbgEnum) return "BasalforcingsDtbg" end
++	if(enum==BasalforcingsEnum) return "Basalforcings" end
++	if(enum==BasalforcingsIsmip6AverageTfEnum) return "BasalforcingsIsmip6AverageTf" end
++	if(enum==BasalforcingsIsmip6BasinAreaEnum) return "BasalforcingsIsmip6BasinArea" end
++	if(enum==BasalforcingsIsmip6DeltaTEnum) return "BasalforcingsIsmip6DeltaT" end
++	if(enum==BasalforcingsIsmip6Gamma0Enum) return "BasalforcingsIsmip6Gamma0" end
++	if(enum==BasalforcingsIsmip6IsLocalEnum) return "BasalforcingsIsmip6IsLocal" end
++	if(enum==BasalforcingsIsmip6NumBasinsEnum) return "BasalforcingsIsmip6NumBasins" end
++	if(enum==BasalforcingsIsmip6TfDepthsEnum) return "BasalforcingsIsmip6TfDepths" end
++	if(enum==BasalforcingsLowercrustheatEnum) return "BasalforcingsLowercrustheat" end
++	if(enum==BasalforcingsMantleconductivityEnum) return "BasalforcingsMantleconductivity" end
++	if(enum==BasalforcingsNusseltEnum) return "BasalforcingsNusselt" end
++	if(enum==BasalforcingsPicoAverageOverturningEnum) return "BasalforcingsPicoAverageOverturning" end
++	if(enum==BasalforcingsPicoAverageSalinityEnum) return "BasalforcingsPicoAverageSalinity" end
++	if(enum==BasalforcingsPicoAverageTemperatureEnum) return "BasalforcingsPicoAverageTemperature" end
++	if(enum==BasalforcingsPicoBoxAreaEnum) return "BasalforcingsPicoBoxArea" end
++	if(enum==BasalforcingsPicoFarOceansalinityEnum) return "BasalforcingsPicoFarOceansalinity" end
++	if(enum==BasalforcingsPicoFarOceantemperatureEnum) return "BasalforcingsPicoFarOceantemperature" end
++	if(enum==BasalforcingsPicoGammaTEnum) return "BasalforcingsPicoGammaT" end
++	if(enum==BasalforcingsPicoIsplumeEnum) return "BasalforcingsPicoIsplume" end
++	if(enum==BasalforcingsPicoMaxboxcountEnum) return "BasalforcingsPicoMaxboxcount" end
++	if(enum==BasalforcingsPicoNumBasinsEnum) return "BasalforcingsPicoNumBasins" end
++	if(enum==BasalforcingsPlumeradiusEnum) return "BasalforcingsPlumeradius" end
++	if(enum==BasalforcingsPlumexEnum) return "BasalforcingsPlumex" end
++	if(enum==BasalforcingsPlumeyEnum) return "BasalforcingsPlumey" end
++	if(enum==BasalforcingsThresholdThicknessEnum) return "BasalforcingsThresholdThickness" end
++	if(enum==BasalforcingsTopplumedepthEnum) return "BasalforcingsTopplumedepth" end
++	if(enum==BasalforcingsUppercrustheatEnum) return "BasalforcingsUppercrustheat" end
++	if(enum==BasalforcingsUppercrustthicknessEnum) return "BasalforcingsUppercrustthickness" end
++	if(enum==BasalforcingsUpperdepthMeltEnum) return "BasalforcingsUpperdepthMelt" end
++	if(enum==BasalforcingsUpperwaterElevationEnum) return "BasalforcingsUpperwaterElevation" end
++	if(enum==BasalforcingsUpperwaterMeltingRateEnum) return "BasalforcingsUpperwaterMeltingRate" end
++	if(enum==CalvingCrevasseDepthEnum) return "CalvingCrevasseDepth" end
++	if(enum==CalvingCrevasseThresholdEnum) return "CalvingCrevasseThreshold" end
++	if(enum==CalvingHeightAboveFloatationEnum) return "CalvingHeightAboveFloatation" end
++	if(enum==CalvingLawEnum) return "CalvingLaw" end
++	if(enum==CalvingMinthicknessEnum) return "CalvingMinthickness" end
++	if(enum==ConfigurationTypeEnum) return "ConfigurationType" end
++	if(enum==ConstantsGEnum) return "ConstantsG" end
++	if(enum==ConstantsNewtonGravityEnum) return "ConstantsNewtonGravity" end
++	if(enum==ConstantsReferencetemperatureEnum) return "ConstantsReferencetemperature" end
++	if(enum==ConstantsYtsEnum) return "ConstantsYts" end
++	if(enum==ControlInputSizeMEnum) return "ControlInputSizeM" end
++	if(enum==ControlInputSizeNEnum) return "ControlInputSizeN" end
++	if(enum==ControlInputInterpolationEnum) return "ControlInputInterpolation" end
++	if(enum==CumBslcEnum) return "CumBslc" end
++	if(enum==CumBslcIceEnum) return "CumBslcIce" end
++	if(enum==CumBslcHydroEnum) return "CumBslcHydro" end
++	if(enum==CumBslcOceanEnum) return "CumBslcOcean" end
++	if(enum==CumBslcIcePartitionEnum) return "CumBslcIcePartition" end
++	if(enum==CumBslcHydroPartitionEnum) return "CumBslcHydroPartition" end
++	if(enum==CumBslcOceanPartitionEnum) return "CumBslcOceanPartition" end
++	if(enum==CumGmtslcEnum) return "CumGmtslc" end
++	if(enum==CumGmslcEnum) return "CumGmslc" end
++	if(enum==DamageC1Enum) return "DamageC1" end
++	if(enum==DamageC2Enum) return "DamageC2" end
++	if(enum==DamageC3Enum) return "DamageC3" end
++	if(enum==DamageC4Enum) return "DamageC4" end
++	if(enum==DamageEnum) return "Damage" end
++	if(enum==DamageEquivStressEnum) return "DamageEquivStress" end
++	if(enum==DamageEvolutionNumRequestedOutputsEnum) return "DamageEvolutionNumRequestedOutputs" end
++	if(enum==DamageEvolutionRequestedOutputsEnum) return "DamageEvolutionRequestedOutputs" end
++	if(enum==DamageHealingEnum) return "DamageHealing" end
++	if(enum==DamageKappaEnum) return "DamageKappa" end
++	if(enum==DamageLawEnum) return "DamageLaw" end
++	if(enum==DamageMaxDamageEnum) return "DamageMaxDamage" end
++	if(enum==DamageStabilizationEnum) return "DamageStabilization" end
++	if(enum==DamageStressThresholdEnum) return "DamageStressThreshold" end
++	if(enum==DamageStressUBoundEnum) return "DamageStressUBound" end
++	if(enum==DebugProfilingEnum) return "DebugProfiling" end
++	if(enum==DomainDimensionEnum) return "DomainDimension" end
++	if(enum==DomainTypeEnum) return "DomainType" end
++	if(enum==DslModelEnum) return "DslModel" end
++	if(enum==DslModelidEnum) return "DslModelid" end
++	if(enum==DslNummodelsEnum) return "DslNummodels" end
++	if(enum==SolidearthIsExternalEnum) return "SolidearthIsExternal" end
++	if(enum==SolidearthExternalNatureEnum) return "SolidearthExternalNature" end
++	if(enum==SolidearthExternalModelidEnum) return "SolidearthExternalModelid" end
++	if(enum==SolidearthExternalNummodelsEnum) return "SolidearthExternalNummodels" end
++	if(enum==SolidearthSettingsComputeBpGrdEnum) return "SolidearthSettingsComputeBpGrd" end
++	if(enum==EarthIdEnum) return "EarthId" end
++	if(enum==ElasticEnum) return "Elastic" end
++	if(enum==EplZigZagCounterEnum) return "EplZigZagCounter" end
++	if(enum==EsaHElasticEnum) return "EsaHElastic" end
++	if(enum==EsaHemisphereEnum) return "EsaHemisphere" end
++	if(enum==EsaRequestedOutputsEnum) return "EsaRequestedOutputs" end
++	if(enum==EsaUElasticEnum) return "EsaUElastic" end
++	if(enum==ExtrapolationVariableEnum) return "ExtrapolationVariable" end
++	if(enum==FemModelCommEnum) return "FemModelComm" end
++	if(enum==FieldsEnum) return "Fields" end
++	if(enum==FlowequationFeFSEnum) return "FlowequationFeFS" end
++	if(enum==FlowequationIsFSEnum) return "FlowequationIsFS" end
++	if(enum==FlowequationIsHOEnum) return "FlowequationIsHO" end
++	if(enum==FlowequationIsL1L2Enum) return "FlowequationIsL1L2" end
++	if(enum==FlowequationIsMLHOEnum) return "FlowequationIsMLHO" end
++	if(enum==FlowequationIsSIAEnum) return "FlowequationIsSIA" end
++	if(enum==FlowequationIsSSAEnum) return "FlowequationIsSSA" end
++	if(enum==FlowequationIsNitscheEnum) return "FlowequationIsNitsche" end
++	if(enum==FeFSNitscheGammaEnum) return "FeFSNitscheGamma" end
++	if(enum==FrictionCouplingEnum) return "FrictionCoupling" end
++	if(enum==FrictionDeltaEnum) return "FrictionDelta" end
++	if(enum==FrictionEffectivePressureLimitEnum) return "FrictionEffectivePressureLimit" end
++	if(enum==FrictionFEnum) return "FrictionF" end
++	if(enum==FrictionGammaEnum) return "FrictionGamma" end
++	if(enum==FrictionLawEnum) return "FrictionLaw" end
++	if(enum==FrictionPseudoplasticityExponentEnum) return "FrictionPseudoplasticityExponent" end
++	if(enum==FrictionThresholdSpeedEnum) return "FrictionThresholdSpeed" end
++	if(enum==FrictionVoidRatioEnum) return "FrictionVoidRatio" end
++	if(enum==FrontalForcingsBasinIcefrontAreaEnum) return "FrontalForcingsBasinIcefrontArea" end
++	if(enum==FrontalForcingsAutoregressionInitialTimeEnum) return "FrontalForcingsAutoregressionInitialTime" end
++	if(enum==FrontalForcingsAutoregressionTimestepEnum) return "FrontalForcingsAutoregressionTimestep" end
++	if(enum==FrontalForcingsAutoregressiveOrderEnum) return "FrontalForcingsAutoregressiveOrder" end
++	if(enum==FrontalForcingsBeta0Enum) return "FrontalForcingsBeta0" end
++	if(enum==FrontalForcingsBeta1Enum) return "FrontalForcingsBeta1" end
++	if(enum==FrontalForcingsNumberofBasinsEnum) return "FrontalForcingsNumberofBasins" end
++	if(enum==FrontalForcingsParamEnum) return "FrontalForcingsParam" end
++	if(enum==FrontalForcingsPhiEnum) return "FrontalForcingsPhi" end
++	if(enum==GrdModelEnum) return "GrdModel" end
++	if(enum==GroundinglineFrictionInterpolationEnum) return "GroundinglineFrictionInterpolation" end
++	if(enum==GroundinglineMeltInterpolationEnum) return "GroundinglineMeltInterpolation" end
++	if(enum==GroundinglineMigrationEnum) return "GroundinglineMigration" end
++	if(enum==HydrologyAveragingEnum) return "HydrologyAveraging" end
++	if(enum==HydrologyCavitySpacingEnum) return "HydrologyCavitySpacing" end
++	if(enum==HydrologyChannelConductivityEnum) return "HydrologyChannelConductivity" end
++	if(enum==HydrologyChannelSheetWidthEnum) return "HydrologyChannelSheetWidth" end
++	if(enum==HydrologyEnglacialVoidRatioEnum) return "HydrologyEnglacialVoidRatio" end
++	if(enum==HydrologyIschannelsEnum) return "HydrologyIschannels" end
++	if(enum==HydrologyMeltFlagEnum) return "HydrologyMeltFlag" end
++	if(enum==HydrologyModelEnum) return "HydrologyModel" end
++	if(enum==HydrologyNumRequestedOutputsEnum) return "HydrologyNumRequestedOutputs" end
++	if(enum==HydrologyPressureMeltCoefficientEnum) return "HydrologyPressureMeltCoefficient" end
++	if(enum==HydrologyRelaxationEnum) return "HydrologyRelaxation" end
++	if(enum==HydrologyRequestedOutputsEnum) return "HydrologyRequestedOutputs" end
++	if(enum==HydrologySedimentKmaxEnum) return "HydrologySedimentKmax" end
++	if(enum==HydrologyStepsPerStepEnum) return "HydrologyStepsPerStep" end
++	if(enum==HydrologyStorageEnum) return "HydrologyStorage" end
++	if(enum==HydrologydcEplColapseThicknessEnum) return "HydrologydcEplColapseThickness" end
++	if(enum==HydrologydcEplConductivityEnum) return "HydrologydcEplConductivity" end
++	if(enum==HydrologydcEplInitialThicknessEnum) return "HydrologydcEplInitialThickness" end
++	if(enum==HydrologydcEplLayerCompressibilityEnum) return "HydrologydcEplLayerCompressibility" end
++	if(enum==HydrologydcEplMaxThicknessEnum) return "HydrologydcEplMaxThickness" end
++	if(enum==HydrologydcEplPoreWaterMassEnum) return "HydrologydcEplPoreWaterMass" end
++	if(enum==HydrologydcEplThickCompEnum) return "HydrologydcEplThickComp" end
++	if(enum==HydrologydcEplflipLockEnum) return "HydrologydcEplflipLock" end
++	if(enum==HydrologydcIsefficientlayerEnum) return "HydrologydcIsefficientlayer" end
++	if(enum==HydrologydcLeakageFactorEnum) return "HydrologydcLeakageFactor" end
++	if(enum==HydrologydcMaxIterEnum) return "HydrologydcMaxIter" end
++	if(enum==HydrologydcPenaltyFactorEnum) return "HydrologydcPenaltyFactor" end
++	if(enum==HydrologydcPenaltyLockEnum) return "HydrologydcPenaltyLock" end
++	if(enum==HydrologydcRelTolEnum) return "HydrologydcRelTol" end
++	if(enum==HydrologydcSedimentlimitEnum) return "HydrologydcSedimentlimit" end
++	if(enum==HydrologydcSedimentlimitFlagEnum) return "HydrologydcSedimentlimitFlag" end
++	if(enum==HydrologydcSedimentLayerCompressibilityEnum) return "HydrologydcSedimentLayerCompressibility" end
++	if(enum==HydrologydcSedimentPoreWaterMassEnum) return "HydrologydcSedimentPoreWaterMass" end
++	if(enum==HydrologydcSedimentPorosityEnum) return "HydrologydcSedimentPorosity" end
++	if(enum==HydrologydcSedimentThicknessEnum) return "HydrologydcSedimentThickness" end
++	if(enum==HydrologydcTransferFlagEnum) return "HydrologydcTransferFlag" end
++	if(enum==HydrologydcUnconfinedFlagEnum) return "HydrologydcUnconfinedFlag" end
++	if(enum==HydrologyshreveStabilizationEnum) return "HydrologyshreveStabilization" end
++	if(enum==IcecapToEarthCommEnum) return "IcecapToEarthComm" end
++	if(enum==IndexEnum) return "Index" end
++	if(enum==InputFileNameEnum) return "InputFileName" end
++	if(enum==DirectoryNameEnum) return "DirectoryName" end
++	if(enum==IndicesEnum) return "Indices" end
++	if(enum==InputToDepthaverageInEnum) return "InputToDepthaverageIn" end
++	if(enum==InputToDepthaverageOutEnum) return "InputToDepthaverageOut" end
++	if(enum==InputToExtrudeEnum) return "InputToExtrude" end
++	if(enum==InputToL2ProjectEnum) return "InputToL2Project" end
++	if(enum==InputToSmoothEnum) return "InputToSmooth" end
++	if(enum==InversionAlgorithmEnum) return "InversionAlgorithm" end
++	if(enum==InversionControlParametersEnum) return "InversionControlParameters" end
++	if(enum==InversionControlScalingFactorsEnum) return "InversionControlScalingFactors" end
++	if(enum==InversionCostFunctionsEnum) return "InversionCostFunctions" end
++	if(enum==InversionDxminEnum) return "InversionDxmin" end
++	if(enum==InversionGatolEnum) return "InversionGatol" end
++	if(enum==InversionGradientScalingEnum) return "InversionGradientScaling" end
++	if(enum==InversionGrtolEnum) return "InversionGrtol" end
++	if(enum==InversionGttolEnum) return "InversionGttol" end
++	if(enum==InversionIncompleteAdjointEnum) return "InversionIncompleteAdjoint" end
++	if(enum==InversionIscontrolEnum) return "InversionIscontrol" end
++	if(enum==InversionMaxiterEnum) return "InversionMaxiter" end
++	if(enum==InversionMaxiterPerStepEnum) return "InversionMaxiterPerStep" end
++	if(enum==InversionMaxstepsEnum) return "InversionMaxsteps" end
++	if(enum==InversionNstepsEnum) return "InversionNsteps" end
++	if(enum==InversionNumControlParametersEnum) return "InversionNumControlParameters" end
++	if(enum==InversionNumCostFunctionsEnum) return "InversionNumCostFunctions" end
++	if(enum==InversionStepThresholdEnum) return "InversionStepThreshold" end
++	if(enum==InversionTypeEnum) return "InversionType" end
++	if(enum==IvinsEnum) return "Ivins" end
++	if(enum==IsSlcCouplingEnum) return "IsSlcCoupling" end
++	if(enum==LevelsetKillIcebergsEnum) return "LevelsetKillIcebergs" end
++	if(enum==LevelsetReinitFrequencyEnum) return "LevelsetReinitFrequency" end
++	if(enum==LevelsetStabilizationEnum) return "LevelsetStabilization" end
++	if(enum==LockFileNameEnum) return "LockFileName" end
++	if(enum==LoveAllowLayerDeletionEnum) return "LoveAllowLayerDeletion" end
++	if(enum==LoveCoreMantleBoundaryEnum) return "LoveCoreMantleBoundary" end
++	if(enum==LoveEarthMassEnum) return "LoveEarthMass" end
++	if(enum==LoveForcingTypeEnum) return "LoveForcingType" end
++	if(enum==LoveFrequenciesEnum) return "LoveFrequencies" end
++	if(enum==LoveIsTemporalEnum) return "LoveIsTemporal" end
++	if(enum==LoveG0Enum) return "LoveG0" end
++	if(enum==LoveGravitationalConstantEnum) return "LoveGravitationalConstant" end
++	if(enum==LoveInnerCoreBoundaryEnum) return "LoveInnerCoreBoundary" end
++	if(enum==LoveComplexComputationEnum) return "LoveComplexComputation" end
++	if(enum==LoveIntStepsPerLayerEnum) return "LoveIntStepsPerLayer" end
++	if(enum==LoveKernelsEnum) return "LoveKernels" end
++	if(enum==LoveMu0Enum) return "LoveMu0" end
++	if(enum==LoveNfreqEnum) return "LoveNfreq" end
++	if(enum==LoveNTemporalIterationsEnum) return "LoveNTemporalIterations" end
++	if(enum==LoveNYiEquationsEnum) return "LoveNYiEquations" end
++	if(enum==LoveR0Enum) return "LoveR0" end
++	if(enum==LoveShNmaxEnum) return "LoveShNmax" end
++	if(enum==LoveShNminEnum) return "LoveShNmin" end
++	if(enum==LoveStartingLayerEnum) return "LoveStartingLayer" end
++	if(enum==LoveUnderflowTolEnum) return "LoveUnderflowTol" end
++	if(enum==MassFluxSegmentsEnum) return "MassFluxSegments" end
++	if(enum==MassFluxSegmentsPresentEnum) return "MassFluxSegmentsPresent" end
++	if(enum==MasstransportHydrostaticAdjustmentEnum) return "MasstransportHydrostaticAdjustment" end
++	if(enum==MasstransportIsfreesurfaceEnum) return "MasstransportIsfreesurface" end
++	if(enum==MasstransportMinThicknessEnum) return "MasstransportMinThickness" end
++	if(enum==MasstransportNumRequestedOutputsEnum) return "MasstransportNumRequestedOutputs" end
++	if(enum==MasstransportPenaltyFactorEnum) return "MasstransportPenaltyFactor" end
++	if(enum==MasstransportRequestedOutputsEnum) return "MasstransportRequestedOutputs" end
++	if(enum==MasstransportStabilizationEnum) return "MasstransportStabilization" end
++	if(enum==MaterialsBetaEnum) return "MaterialsBeta" end
++	if(enum==MaterialsEarthDensityEnum) return "MaterialsEarthDensity" end
++	if(enum==MaterialsEffectiveconductivityAveragingEnum) return "MaterialsEffectiveconductivityAveraging" end
++	if(enum==MaterialsHeatcapacityEnum) return "MaterialsHeatcapacity" end
++	if(enum==MaterialsLatentheatEnum) return "MaterialsLatentheat" end
++	if(enum==MaterialsMeltingpointEnum) return "MaterialsMeltingpoint" end
++	if(enum==MaterialsMixedLayerCapacityEnum) return "MaterialsMixedLayerCapacity" end
++	if(enum==MaterialsMuWaterEnum) return "MaterialsMuWater" end
++	if(enum==MaterialsRheologyLawEnum) return "MaterialsRheologyLaw" end
++	if(enum==MaterialsRhoFreshwaterEnum) return "MaterialsRhoFreshwater" end
++	if(enum==MaterialsRhoIceEnum) return "MaterialsRhoIce" end
++	if(enum==MaterialsRhoSeawaterEnum) return "MaterialsRhoSeawater" end
++	if(enum==MaterialsTemperateiceconductivityEnum) return "MaterialsTemperateiceconductivity" end
++	if(enum==MaterialsThermalExchangeVelocityEnum) return "MaterialsThermalExchangeVelocity" end
++	if(enum==MaterialsThermalconductivityEnum) return "MaterialsThermalconductivity" end
++	if(enum==MeltingOffsetEnum) return "MeltingOffset" end
++	if(enum==MeshAverageVertexConnectivityEnum) return "MeshAverageVertexConnectivity" end
++	if(enum==MeshElementtypeEnum) return "MeshElementtype" end
++	if(enum==MeshNumberoflayersEnum) return "MeshNumberoflayers" end
++	if(enum==MeshNumberofverticesEnum) return "MeshNumberofvertices" end
++	if(enum==MeshNumberofelementsEnum) return "MeshNumberofelements" end
++	if(enum==MigrationMaxEnum) return "MigrationMax" end
++	if(enum==ModelIdEnum) return "ModelId" end
++	if(enum==NbinsEnum) return "Nbins" end
++	if(enum==NodesEnum) return "Nodes" end
++	if(enum==NumModelsEnum) return "NumModels" end
++	if(enum==OceanGridNxEnum) return "OceanGridNx" end
++	if(enum==OceanGridNyEnum) return "OceanGridNy" end
++	if(enum==OceanGridXEnum) return "OceanGridX" end
++	if(enum==OceanGridYEnum) return "OceanGridY" end
++	if(enum==OutputBufferPointerEnum) return "OutputBufferPointer" end
++	if(enum==OutputBufferSizePointerEnum) return "OutputBufferSizePointer" end
++	if(enum==OutputFileNameEnum) return "OutputFileName" end
++	if(enum==OutputFilePointerEnum) return "OutputFilePointer" end
++	if(enum==OutputdefinitionEnum) return "Outputdefinition" end
++	if(enum==QmuErrNameEnum) return "QmuErrName" end
++	if(enum==QmuInNameEnum) return "QmuInName" end
++	if(enum==QmuIsdakotaEnum) return "QmuIsdakota" end
++	if(enum==QmuOutNameEnum) return "QmuOutName" end
++	if(enum==QmuOutputEnum) return "QmuOutput" end
++	if(enum==QmuCurrEvalIdEnum) return "QmuCurrEvalId" end
++	if(enum==QmuNsampleEnum) return "QmuNsample" end
++	if(enum==QmuResponsedescriptorsEnum) return "QmuResponsedescriptors" end
++	if(enum==QmuVariableDescriptorsEnum) return "QmuVariableDescriptors" end
++	if(enum==QmuVariablePartitionsEnum) return "QmuVariablePartitions" end
++	if(enum==QmuVariablePartitionsNpartEnum) return "QmuVariablePartitionsNpart" end
++	if(enum==QmuVariablePartitionsNtEnum) return "QmuVariablePartitionsNt" end
++	if(enum==QmuResponsePartitionsEnum) return "QmuResponsePartitions" end
++	if(enum==QmuResponsePartitionsNpartEnum) return "QmuResponsePartitionsNpart" end
++	if(enum==QmuStatisticsEnum) return "QmuStatistics" end
++	if(enum==QmuNumstatisticsEnum) return "QmuNumstatistics" end
++	if(enum==QmuNdirectoriesEnum) return "QmuNdirectories" end
++	if(enum==QmuNfilesPerDirectoryEnum) return "QmuNfilesPerDirectory" end
++	if(enum==QmuStatisticsMethodEnum) return "QmuStatisticsMethod" end
++	if(enum==QmuMethodsEnum) return "QmuMethods" end
++	if(enum==RestartFileNameEnum) return "RestartFileName" end
++	if(enum==ResultsEnum) return "Results" end
++	if(enum==RootPathEnum) return "RootPath" end
++	if(enum==ModelnameEnum) return "Modelname" end
++	if(enum==SamplingAlphaEnum) return "SamplingAlpha" end
++	if(enum==SamplingPhiEnum) return "SamplingPhi" end
++	if(enum==SamplingNumRequestedOutputsEnum) return "SamplingNumRequestedOutputs" end
++	if(enum==SamplingRequestedOutputsEnum) return "SamplingRequestedOutputs" end
++	if(enum==SamplingRobinEnum) return "SamplingRobin" end
++	if(enum==SamplingSeedEnum) return "SamplingSeed" end
++	if(enum==SamplingTauEnum) return "SamplingTau" end
++	if(enum==SaveResultsEnum) return "SaveResults" end
++	if(enum==SolidearthPartitionIceEnum) return "SolidearthPartitionIce" end
++	if(enum==SolidearthPartitionHydroEnum) return "SolidearthPartitionHydro" end
++	if(enum==SolidearthPartitionOceanEnum) return "SolidearthPartitionOcean" end
++	if(enum==SolidearthNpartIceEnum) return "SolidearthNpartIce" end
++	if(enum==SolidearthNpartOceanEnum) return "SolidearthNpartOcean" end
++	if(enum==SolidearthNpartHydroEnum) return "SolidearthNpartHydro" end
++	if(enum==SolidearthPlanetRadiusEnum) return "SolidearthPlanetRadius" end
++	if(enum==SolidearthPlanetAreaEnum) return "SolidearthPlanetArea" end
++	if(enum==SolidearthSettingsAbstolEnum) return "SolidearthSettingsAbstol" end
++	if(enum==SolidearthSettingsCrossSectionShapeEnum) return "SolidearthSettingsCrossSectionShape" end
++	if(enum==RotationalAngularVelocityEnum) return "RotationalAngularVelocity" end
++	if(enum==SolidearthSettingsElasticEnum) return "SolidearthSettingsElastic" end
++	if(enum==SolidearthSettingsViscousEnum) return "SolidearthSettingsViscous" end
++	if(enum==SealevelchangeGeometryDoneEnum) return "SealevelchangeGeometryDone" end
++	if(enum==SealevelchangeViscousNumStepsEnum) return "SealevelchangeViscousNumSteps" end
++	if(enum==SealevelchangeViscousTimesEnum) return "SealevelchangeViscousTimes" end
++	if(enum==SealevelchangeViscousIndexEnum) return "SealevelchangeViscousIndex" end
++	if(enum==RotationalEquatorialMoiEnum) return "RotationalEquatorialMoi" end
++	if(enum==TidalLoveHEnum) return "TidalLoveH" end
++	if(enum==TidalLoveKEnum) return "TidalLoveK" end
++	if(enum==TidalLoveLEnum) return "TidalLoveL" end
++	if(enum==TidalLoveK2SecularEnum) return "TidalLoveK2Secular" end
++	if(enum==LoadLoveHEnum) return "LoadLoveH" end
++	if(enum==LoadLoveKEnum) return "LoadLoveK" end
++	if(enum==LoadLoveLEnum) return "LoadLoveL" end
++	if(enum==LoveTimeFreqEnum) return "LoveTimeFreq" end
++	if(enum==LoveIsTimeEnum) return "LoveIsTime" end
++	if(enum==SealevelchangeGSelfAttractionEnum) return "SealevelchangeGSelfAttraction" end
++	if(enum==SealevelchangeGViscoElasticEnum) return "SealevelchangeGViscoElastic" end
++	if(enum==SolidearthSettingsSealevelLoadingEnum) return "SolidearthSettingsSealevelLoading" end
++	if(enum==SolidearthSettingsGRDEnum) return "SolidearthSettingsGRD" end
++	if(enum==SolidearthSettingsRunFrequencyEnum) return "SolidearthSettingsRunFrequency" end
++	if(enum==SolidearthSettingsTimeAccEnum) return "SolidearthSettingsTimeAcc" end
++	if(enum==SealevelchangeHViscoElasticEnum) return "SealevelchangeHViscoElastic" end
++	if(enum==SolidearthSettingsHorizEnum) return "SolidearthSettingsHoriz" end
++	if(enum==SolidearthSettingsMaxiterEnum) return "SolidearthSettingsMaxiter" end
++	if(enum==SolidearthSettingsGrdOceanEnum) return "SolidearthSettingsGrdOcean" end
++	if(enum==SolidearthSettingsOceanAreaScalingEnum) return "SolidearthSettingsOceanAreaScaling" end
++	if(enum==StochasticForcingCovarianceEnum) return "StochasticForcingCovariance" end
++	if(enum==StochasticForcingDefaultDimensionEnum) return "StochasticForcingDefaultDimension" end
++	if(enum==StochasticForcingDimensionsEnum) return "StochasticForcingDimensions" end
++	if(enum==StochasticForcingFieldsEnum) return "StochasticForcingFields" end
++	if(enum==StochasticForcingIsEffectivePressureEnum) return "StochasticForcingIsEffectivePressure" end
++	if(enum==StochasticForcingIsStochasticForcingEnum) return "StochasticForcingIsStochasticForcing" end
++	if(enum==StochasticForcingIsWaterPressureEnum) return "StochasticForcingIsWaterPressure" end
++	if(enum==StochasticForcingNumFieldsEnum) return "StochasticForcingNumFields" end
++	if(enum==StochasticForcingRandomflagEnum) return "StochasticForcingRandomflag" end
++	if(enum==RotationalPolarMoiEnum) return "RotationalPolarMoi" end
++	if(enum==SolidearthSettingsReltolEnum) return "SolidearthSettingsReltol" end
++	if(enum==SealevelchangeRequestedOutputsEnum) return "SealevelchangeRequestedOutputs" end
++	if(enum==SolidearthSettingsSelfAttractionEnum) return "SolidearthSettingsSelfAttraction" end
++	if(enum==SolidearthSettingsRotationEnum) return "SolidearthSettingsRotation" end
++	if(enum==SolidearthSettingsMaxSHCoeffEnum) return "SolidearthSettingsMaxSHCoeff" end
++	if(enum==SealevelchangeRunCountEnum) return "SealevelchangeRunCount" end
++	if(enum==SealevelchangeTransitionsEnum) return "SealevelchangeTransitions" end
++	if(enum==SealevelchangeUViscoElasticEnum) return "SealevelchangeUViscoElastic" end
++	if(enum==SettingsIoGatherEnum) return "SettingsIoGather" end
++	if(enum==SettingsNumResultsOnNodesEnum) return "SettingsNumResultsOnNodes" end
++	if(enum==SettingsOutputFrequencyEnum) return "SettingsOutputFrequency" end
++	if(enum==SettingsCheckpointFrequencyEnum) return "SettingsCheckpointFrequency" end
++	if(enum==SettingsResultsOnNodesEnum) return "SettingsResultsOnNodes" end
++	if(enum==SettingsSbCouplingFrequencyEnum) return "SettingsSbCouplingFrequency" end
++	if(enum==SettingsSolverResidueThresholdEnum) return "SettingsSolverResidueThreshold" end
++	if(enum==SettingsWaitonlockEnum) return "SettingsWaitonlock" end
++	if(enum==SmbAIceEnum) return "SmbAIce" end
++	if(enum==SmbAIdxEnum) return "SmbAIdx" end
++	if(enum==SmbASnowEnum) return "SmbASnow" end
++	if(enum==SmbAccualtiEnum) return "SmbAccualti" end
++	if(enum==SmbAccugradEnum) return "SmbAccugrad" end
++	if(enum==SmbAccurefEnum) return "SmbAccuref" end
++	if(enum==SmbAdThreshEnum) return "SmbAdThresh" end
++	if(enum==SmbAutoregressionInitialTimeEnum) return "SmbAutoregressionInitialTime" end
++	if(enum==SmbAutoregressionTimestepEnum) return "SmbAutoregressionTimestep" end
++	if(enum==SmbAutoregressiveOrderEnum) return "SmbAutoregressiveOrder" end
++	if(enum==SmbAveragingEnum) return "SmbAveraging" end
++	if(enum==SmbBeta0Enum) return "SmbBeta0" end
++	if(enum==SmbBeta1Enum) return "SmbBeta1" end
++	if(enum==SmbDesfacEnum) return "SmbDesfac" end
++	if(enum==SmbDpermilEnum) return "SmbDpermil" end
++	if(enum==SmbDsnowIdxEnum) return "SmbDsnowIdx" end
++	if(enum==SmbCldFracEnum) return "SmbCldFrac" end
++	if(enum==SmbDelta18oEnum) return "SmbDelta18o" end
++	if(enum==SmbDelta18oSurfaceEnum) return "SmbDelta18oSurface" end
++	if(enum==SmbDenIdxEnum) return "SmbDenIdx" end
++	if(enum==SmbDtEnum) return "SmbDt" end
++	if(enum==SmbEnum) return "Smb" end
++	if(enum==SmbEIdxEnum) return "SmbEIdx" end
++	if(enum==SmbFEnum) return "SmbF" end
++	if(enum==SmbInitDensityScalingEnum) return "SmbInitDensityScaling" end
++	if(enum==SmbIsaccumulationEnum) return "SmbIsaccumulation" end
++	if(enum==SmbIsalbedoEnum) return "SmbIsalbedo" end
++	if(enum==SmbIsconstrainsurfaceTEnum) return "SmbIsconstrainsurfaceT" end
++	if(enum==SmbIsd18opdEnum) return "SmbIsd18opd" end
++	if(enum==SmbIsdelta18oEnum) return "SmbIsdelta18o" end
++	if(enum==SmbIsdensificationEnum) return "SmbIsdensification" end
++	if(enum==SmbIsdeltaLWupEnum) return "SmbIsdeltaLWup" end
++	if(enum==SmbIsfirnwarmingEnum) return "SmbIsfirnwarming" end
++	if(enum==SmbIsgraingrowthEnum) return "SmbIsgraingrowth" end
++	if(enum==SmbIsmeltEnum) return "SmbIsmelt" end
++	if(enum==SmbIsmungsmEnum) return "SmbIsmungsm" end
++	if(enum==SmbIsprecipscaledEnum) return "SmbIsprecipscaled" end
++	if(enum==SmbIssetpddfacEnum) return "SmbIssetpddfac" end
++	if(enum==SmbIsshortwaveEnum) return "SmbIsshortwave" end
++	if(enum==SmbIstemperaturescaledEnum) return "SmbIstemperaturescaled" end
++	if(enum==SmbIsthermalEnum) return "SmbIsthermal" end
++	if(enum==SmbIsturbulentfluxEnum) return "SmbIsturbulentflux" end
++	if(enum==SmbKEnum) return "SmbK" end
++	if(enum==SmbNumBasinsEnum) return "SmbNumBasins" end
++	if(enum==SmbNumRequestedOutputsEnum) return "SmbNumRequestedOutputs" end
++	if(enum==SmbPfacEnum) return "SmbPfac" end
++	if(enum==SmbPhiEnum) return "SmbPhi" end
++	if(enum==SmbRdlEnum) return "SmbRdl" end
++	if(enum==SmbRequestedOutputsEnum) return "SmbRequestedOutputs" end
++	if(enum==SmbRlapsEnum) return "SmbRlaps" end
++	if(enum==SmbRlapslgmEnum) return "SmbRlapslgm" end
++	if(enum==SmbRunoffaltiEnum) return "SmbRunoffalti" end
++	if(enum==SmbRunoffgradEnum) return "SmbRunoffgrad" end
++	if(enum==SmbRunoffrefEnum) return "SmbRunoffref" end
++	if(enum==SmbSealevEnum) return "SmbSealev" end
++	if(enum==SmbStepsPerStepEnum) return "SmbStepsPerStep" end
++	if(enum==SmbSwIdxEnum) return "SmbSwIdx" end
++	if(enum==SmbT0dryEnum) return "SmbT0dry" end
++	if(enum==SmbT0wetEnum) return "SmbT0wet" end
++	if(enum==SmbTeThreshEnum) return "SmbTeThresh" end
++	if(enum==SmbTdiffEnum) return "SmbTdiff" end
++	if(enum==SmbThermoDeltaTScalingEnum) return "SmbThermoDeltaTScaling" end
++	if(enum==SmbTemperaturesReconstructedYearsEnum) return "SmbTemperaturesReconstructedYears" end
++	if(enum==SmbPrecipitationsReconstructedYearsEnum) return "SmbPrecipitationsReconstructedYears" end
++	if(enum==SmoothThicknessMultiplierEnum) return "SmoothThicknessMultiplier" end
++	if(enum==SolutionTypeEnum) return "SolutionType" end
++	if(enum==SteadystateMaxiterEnum) return "SteadystateMaxiter" end
++	if(enum==SteadystateNumRequestedOutputsEnum) return "SteadystateNumRequestedOutputs" end
++	if(enum==SteadystateReltolEnum) return "SteadystateReltol" end
++	if(enum==SteadystateRequestedOutputsEnum) return "SteadystateRequestedOutputs" end
++	if(enum==StepEnum) return "Step" end
++	if(enum==StepsEnum) return "Steps" end
++	if(enum==StressbalanceAbstolEnum) return "StressbalanceAbstol" end
++	if(enum==StressbalanceFSreconditioningEnum) return "StressbalanceFSreconditioning" end
++	if(enum==StressbalanceIsnewtonEnum) return "StressbalanceIsnewton" end
++	if(enum==StressbalanceMaxiterEnum) return "StressbalanceMaxiter" end
++	if(enum==StressbalanceNumRequestedOutputsEnum) return "StressbalanceNumRequestedOutputs" end
++	if(enum==StressbalancePenaltyFactorEnum) return "StressbalancePenaltyFactor" end
++	if(enum==StressbalanceReltolEnum) return "StressbalanceReltol" end
++	if(enum==StressbalanceRequestedOutputsEnum) return "StressbalanceRequestedOutputs" end
++	if(enum==StressbalanceRestolEnum) return "StressbalanceRestol" end
++	if(enum==StressbalanceRiftPenaltyThresholdEnum) return "StressbalanceRiftPenaltyThreshold" end
++	if(enum==StressbalanceShelfDampeningEnum) return "StressbalanceShelfDampening" end
++	if(enum==ThermalIsdrainicecolumnEnum) return "ThermalIsdrainicecolumn" end
++	if(enum==ThermalIsdynamicbasalspcEnum) return "ThermalIsdynamicbasalspc" end
++	if(enum==ThermalIsenthalpyEnum) return "ThermalIsenthalpy" end
++	if(enum==ThermalMaxiterEnum) return "ThermalMaxiter" end
++	if(enum==ThermalNumRequestedOutputsEnum) return "ThermalNumRequestedOutputs" end
++	if(enum==ThermalPenaltyFactorEnum) return "ThermalPenaltyFactor" end
++	if(enum==ThermalPenaltyLockEnum) return "ThermalPenaltyLock" end
++	if(enum==ThermalPenaltyThresholdEnum) return "ThermalPenaltyThreshold" end
++	if(enum==ThermalReltolEnum) return "ThermalReltol" end
++	if(enum==ThermalRequestedOutputsEnum) return "ThermalRequestedOutputs" end
++	if(enum==ThermalStabilizationEnum) return "ThermalStabilization" end
++	if(enum==ThermalWatercolumnUpperlimitEnum) return "ThermalWatercolumnUpperlimit" end
++	if(enum==TimeEnum) return "Time" end
++	if(enum==TimesteppingCflCoefficientEnum) return "TimesteppingCflCoefficient" end
++	if(enum==TimesteppingCouplingTimeEnum) return "TimesteppingCouplingTime" end
++	if(enum==TimesteppingFinalTimeEnum) return "TimesteppingFinalTime" end
++	if(enum==TimesteppingInterpForcingEnum) return "TimesteppingInterpForcing" end
++	if(enum==TimesteppingCycleForcingEnum) return "TimesteppingCycleForcing" end
++	if(enum==TimesteppingStartTimeEnum) return "TimesteppingStartTime" end
++	if(enum==TimesteppingTimeStepEnum) return "TimesteppingTimeStep" end
++	if(enum==TimesteppingTimeStepMaxEnum) return "TimesteppingTimeStepMax" end
++	if(enum==TimesteppingTimeStepMinEnum) return "TimesteppingTimeStepMin" end
++	if(enum==TimesteppingTypeEnum) return "TimesteppingType" end
++	if(enum==ToMITgcmCommEnum) return "ToMITgcmComm" end
++	if(enum==ToolkitsFileNameEnum) return "ToolkitsFileName" end
++	if(enum==ToolkitsOptionsAnalysesEnum) return "ToolkitsOptionsAnalyses" end
++	if(enum==ToolkitsOptionsStringsEnum) return "ToolkitsOptionsStrings" end
++	if(enum==ToolkitsTypesEnum) return "ToolkitsTypes" end
++	if(enum==TransientAmrFrequencyEnum) return "TransientAmrFrequency" end
++	if(enum==TransientIsdamageevolutionEnum) return "TransientIsdamageevolution" end
++	if(enum==TransientIsesaEnum) return "TransientIsesa" end
++	if(enum==TransientIsgiaEnum) return "TransientIsgia" end
++	if(enum==TransientIsgroundinglineEnum) return "TransientIsgroundingline" end
++	if(enum==TransientIshydrologyEnum) return "TransientIshydrology" end
++	if(enum==TransientIsmasstransportEnum) return "TransientIsmasstransport" end
++	if(enum==TransientIsoceantransportEnum) return "TransientIsoceantransport" end
++	if(enum==TransientIsmovingfrontEnum) return "TransientIsmovingfront" end
++	if(enum==TransientIsoceancouplingEnum) return "TransientIsoceancoupling" end
++	if(enum==TransientIssamplingEnum) return "TransientIssampling" end
++	if(enum==TransientIsslcEnum) return "TransientIsslc" end
++	if(enum==TransientIssmbEnum) return "TransientIssmb" end
++	if(enum==TransientIsstressbalanceEnum) return "TransientIsstressbalance" end
++	if(enum==TransientIsthermalEnum) return "TransientIsthermal" end
++	if(enum==TransientNumRequestedOutputsEnum) return "TransientNumRequestedOutputs" end
++	if(enum==TransientRequestedOutputsEnum) return "TransientRequestedOutputs" end
++	if(enum==VelocityEnum) return "Velocity" end
++	if(enum==XxeEnum) return "Xxe" end
++	if(enum==YyeEnum) return "Yye" end
++	if(enum==ZzeEnum) return "Zze" end
++	if(enum==AreaeEnum) return "Areae" end
++	if(enum==WorldCommEnum) return "WorldComm" end
++	if(enum==ParametersENDEnum) return "ParametersEND" end
++	if(enum==InputsSTARTEnum) return "InputsSTART" end
++	if(enum==AccumulatedDeltaBottomPressureEnum) return "AccumulatedDeltaBottomPressure" end
++	if(enum==AccumulatedDeltaIceThicknessEnum) return "AccumulatedDeltaIceThickness" end
++	if(enum==AccumulatedDeltaTwsEnum) return "AccumulatedDeltaTws" end
++	if(enum==AdjointEnum) return "Adjoint" end
++	if(enum==AdjointpEnum) return "Adjointp" end
++	if(enum==AdjointxEnum) return "Adjointx" end
++	if(enum==AdjointxBaseEnum) return "AdjointxBase" end
++	if(enum==AdjointxShearEnum) return "AdjointxShear" end
++	if(enum==AdjointyEnum) return "Adjointy" end
++	if(enum==AdjointyBaseEnum) return "AdjointyBase" end
++	if(enum==AdjointyShearEnum) return "AdjointyShear" end
++	if(enum==AdjointzEnum) return "Adjointz" end
++	if(enum==AirEnum) return "Air" end
++	if(enum==ApproximationEnum) return "Approximation" end
++	if(enum==BalancethicknessMisfitEnum) return "BalancethicknessMisfit" end
++	if(enum==BalancethicknessOmega0Enum) return "BalancethicknessOmega0" end
++	if(enum==BalancethicknessOmegaEnum) return "BalancethicknessOmega" end
++	if(enum==BalancethicknessSpcthicknessEnum) return "BalancethicknessSpcthickness" end
++	if(enum==BalancethicknessThickeningRateEnum) return "BalancethicknessThickeningRate" end
++	if(enum==BasalCrevasseEnum) return "BasalCrevasse" end
++	if(enum==BasalforcingsFloatingiceMeltingRateEnum) return "BasalforcingsFloatingiceMeltingRate" end
++	if(enum==BasalforcingsGeothermalfluxEnum) return "BasalforcingsGeothermalflux" end
++	if(enum==BasalforcingsGroundediceMeltingRateEnum) return "BasalforcingsGroundediceMeltingRate" end
++	if(enum==BasalforcingsPerturbationMeltingRateEnum) return "BasalforcingsPerturbationMeltingRate" end
++	if(enum==BasalforcingsIsmip6BasinIdEnum) return "BasalforcingsIsmip6BasinId" end
++	if(enum==BasalforcingsIsmip6TfEnum) return "BasalforcingsIsmip6Tf" end
++	if(enum==BasalforcingsIsmip6TfShelfEnum) return "BasalforcingsIsmip6TfShelf" end
++	if(enum==BasalforcingsIsmip6MeltAnomalyEnum) return "BasalforcingsIsmip6MeltAnomaly" end
++	if(enum==BasalforcingsMeltrateFactorEnum) return "BasalforcingsMeltrateFactor" end
++	if(enum==BasalforcingsOceanSalinityEnum) return "BasalforcingsOceanSalinity" end
++	if(enum==BasalforcingsOceanTempEnum) return "BasalforcingsOceanTemp" end
++	if(enum==BasalforcingsPicoBasinIdEnum) return "BasalforcingsPicoBasinId" end
++	if(enum==BasalforcingsPicoBoxIdEnum) return "BasalforcingsPicoBoxId" end
++	if(enum==BasalforcingsPicoOverturningCoeffEnum) return "BasalforcingsPicoOverturningCoeff" end
++	if(enum==BasalforcingsPicoSubShelfOceanOverturningEnum) return "BasalforcingsPicoSubShelfOceanOverturning" end
++	if(enum==BasalforcingsPicoSubShelfOceanSalinityEnum) return "BasalforcingsPicoSubShelfOceanSalinity" end
++	if(enum==BasalforcingsPicoSubShelfOceanTempEnum) return "BasalforcingsPicoSubShelfOceanTemp" end
++	if(enum==BasalStressxEnum) return "BasalStressx" end
++	if(enum==BasalStressyEnum) return "BasalStressy" end
++	if(enum==BasalStressEnum) return "BasalStress" end
++	if(enum==BaseEnum) return "Base" end
++	if(enum==BaseOldEnum) return "BaseOld" end
++	if(enum==BaseSlopeXEnum) return "BaseSlopeX" end
++	if(enum==BaseSlopeYEnum) return "BaseSlopeY" end
++	if(enum==BaselineBasalforcingsFloatingiceMeltingRateEnum) return "BaselineBasalforcingsFloatingiceMeltingRate" end
++	if(enum==BaselineCalvingCalvingrateEnum) return "BaselineCalvingCalvingrate" end
++	if(enum==BaselineFrictionEffectivePressureEnum) return "BaselineFrictionEffectivePressure" end
++	if(enum==BedEnum) return "Bed" end
++	if(enum==BedGRDEnum) return "BedGRD" end
++	if(enum==BedEastEnum) return "BedEast" end
++	if(enum==BedEastGRDEnum) return "BedEastGRD" end
++	if(enum==BedNorthEnum) return "BedNorth" end
++	if(enum==BedNorthGRDEnum) return "BedNorthGRD" end
++	if(enum==BedSlopeXEnum) return "BedSlopeX" end
++	if(enum==BedSlopeYEnum) return "BedSlopeY" end
++	if(enum==BottomPressureEnum) return "BottomPressure" end
++	if(enum==BottomPressureOldEnum) return "BottomPressureOld" end
++	if(enum==CalvingCalvingrateEnum) return "CalvingCalvingrate" end
++	if(enum==CalvingHabFractionEnum) return "CalvingHabFraction" end
++	if(enum==CalvingMeltingrateEnum) return "CalvingMeltingrate" end
++	if(enum==CalvingStressThresholdFloatingiceEnum) return "CalvingStressThresholdFloatingice" end
++	if(enum==CalvingStressThresholdGroundediceEnum) return "CalvingStressThresholdGroundedice" end
++	if(enum==CalvinglevermannCoeffEnum) return "CalvinglevermannCoeff" end
++	if(enum==CalvingratexAverageEnum) return "CalvingratexAverage" end
++	if(enum==CalvingratexEnum) return "Calvingratex" end
++	if(enum==CalvingrateyAverageEnum) return "CalvingrateyAverage" end
++	if(enum==CalvingrateyEnum) return "Calvingratey" end
++	if(enum==CalvingFluxLevelsetEnum) return "CalvingFluxLevelset" end
++	if(enum==CalvingMeltingFluxLevelsetEnum) return "CalvingMeltingFluxLevelset" end
++	if(enum==ConvergedEnum) return "Converged" end
++	if(enum==CrevasseDepthEnum) return "CrevasseDepth" end
++	if(enum==DamageDEnum) return "DamageD" end
++	if(enum==DamageDOldEnum) return "DamageDOld" end
++	if(enum==DamageDbarEnum) return "DamageDbar" end
++	if(enum==DamageDbarOldEnum) return "DamageDbarOld" end
++	if(enum==DamageFEnum) return "DamageF" end
++	if(enum==DegreeOfChannelizationEnum) return "DegreeOfChannelization" end
++	if(enum==DepthBelowSurfaceEnum) return "DepthBelowSurface" end
++	if(enum==DeltaIceThicknessEnum) return "DeltaIceThickness" end
++	if(enum==DeltaTwsEnum) return "DeltaTws" end
++	if(enum==DeltaBottomPressureEnum) return "DeltaBottomPressure" end
++	if(enum==DeltaDslEnum) return "DeltaDsl" end
++	if(enum==DslOldEnum) return "DslOld" end
++	if(enum==DslEnum) return "Dsl" end
++	if(enum==DeltaStrEnum) return "DeltaStr" end
++	if(enum==StrOldEnum) return "StrOld" end
++	if(enum==StrEnum) return "Str" end
++	if(enum==DeviatoricStresseffectiveEnum) return "DeviatoricStresseffective" end
++	if(enum==DeviatoricStressxxEnum) return "DeviatoricStressxx" end
++	if(enum==DeviatoricStressxyEnum) return "DeviatoricStressxy" end
++	if(enum==DeviatoricStressxzEnum) return "DeviatoricStressxz" end
++	if(enum==DeviatoricStressyyEnum) return "DeviatoricStressyy" end
++	if(enum==DeviatoricStressyzEnum) return "DeviatoricStressyz" end
++	if(enum==DeviatoricStresszzEnum) return "DeviatoricStresszz" end
++	if(enum==DeviatoricStress1Enum) return "DeviatoricStress1" end
++	if(enum==DeviatoricStress2Enum) return "DeviatoricStress2" end
++	if(enum==DistanceToCalvingfrontEnum) return "DistanceToCalvingfront" end
++	if(enum==DistanceToGroundinglineEnum) return "DistanceToGroundingline" end
++	if(enum==Domain2DhorizontalEnum) return "Domain2Dhorizontal" end
++	if(enum==Domain2DverticalEnum) return "Domain2Dvertical" end
++	if(enum==Domain3DEnum) return "Domain3D" end
++	if(enum==DragCoefficientAbsGradientEnum) return "DragCoefficientAbsGradient" end
++	if(enum==DrivingStressXEnum) return "DrivingStressX" end
++	if(enum==DrivingStressYEnum) return "DrivingStressY" end
++	if(enum==DummyEnum) return "Dummy" end
++	if(enum==EffectivePressureEnum) return "EffectivePressure" end
++	if(enum==EffectivePressureSubstepEnum) return "EffectivePressureSubstep" end
++	if(enum==EffectivePressureTransientEnum) return "EffectivePressureTransient" end
++	if(enum==EnthalpyEnum) return "Enthalpy" end
++	if(enum==EnthalpyPicardEnum) return "EnthalpyPicard" end
++	if(enum==EplHeadEnum) return "EplHead" end
++	if(enum==EplHeadOldEnum) return "EplHeadOld" end
++	if(enum==EplHeadSlopeXEnum) return "EplHeadSlopeX" end
++	if(enum==EplHeadSlopeYEnum) return "EplHeadSlopeY" end
++	if(enum==EplHeadSubstepEnum) return "EplHeadSubstep" end
++	if(enum==EplHeadTransientEnum) return "EplHeadTransient" end
++	if(enum==EsaEmotionEnum) return "EsaEmotion" end
++	if(enum==EsaNmotionEnum) return "EsaNmotion" end
++	if(enum==EsaRotationrateEnum) return "EsaRotationrate" end
++	if(enum==EsaStrainratexxEnum) return "EsaStrainratexx" end
++	if(enum==EsaStrainratexyEnum) return "EsaStrainratexy" end
++	if(enum==EsaStrainrateyyEnum) return "EsaStrainrateyy" end
++	if(enum==EsaUmotionEnum) return "EsaUmotion" end
++	if(enum==EsaXmotionEnum) return "EsaXmotion" end
++	if(enum==EsaYmotionEnum) return "EsaYmotion" end
++	if(enum==EtaDiffEnum) return "EtaDiff" end
++	if(enum==FlowequationBorderFSEnum) return "FlowequationBorderFS" end
++	if(enum==FrictionAsEnum) return "FrictionAs" end
++	if(enum==FrictionCEnum) return "FrictionC" end
++	if(enum==FrictionCmaxEnum) return "FrictionCmax" end
++	if(enum==FrictionCoefficientEnum) return "FrictionCoefficient" end
++	if(enum==FrictionCoefficientcoulombEnum) return "FrictionCoefficientcoulomb" end
++	if(enum==FrictionEffectivePressureEnum) return "FrictionEffectivePressure" end
++	if(enum==FrictionMEnum) return "FrictionM" end
++	if(enum==FrictionPEnum) return "FrictionP" end
++	if(enum==FrictionPressureAdjustedTemperatureEnum) return "FrictionPressureAdjustedTemperature" end
++	if(enum==FrictionQEnum) return "FrictionQ" end
++	if(enum==FrictionSedimentCompressibilityCoefficientEnum) return "FrictionSedimentCompressibilityCoefficient" end
++	if(enum==FrictionTillFrictionAngleEnum) return "FrictionTillFrictionAngle" end
++	if(enum==FrictionWaterLayerEnum) return "FrictionWaterLayer" end
++	if(enum==FrictionfEnum) return "Frictionf" end
++	if(enum==FrontalForcingsBasinIdEnum) return "FrontalForcingsBasinId" end
++	if(enum==FrontalForcingsSubglacialDischargeEnum) return "FrontalForcingsSubglacialDischarge" end
++	if(enum==FrontalForcingsThermalForcingEnum) return "FrontalForcingsThermalForcing" end
++	if(enum==GeometryHydrostaticRatioEnum) return "GeometryHydrostaticRatio" end
++	if(enum==NGiaEnum) return "NGia" end
++	if(enum==NGiaRateEnum) return "NGiaRate" end
++	if(enum==UGiaEnum) return "UGia" end
++	if(enum==UGiaRateEnum) return "UGiaRate" end
++	if(enum==GradientEnum) return "Gradient" end
++	if(enum==GroundinglineHeightEnum) return "GroundinglineHeight" end
++	if(enum==HydraulicPotentialEnum) return "HydraulicPotential" end
++	if(enum==HydraulicPotentialOldEnum) return "HydraulicPotentialOld" end
++	if(enum==HydrologyBasalFluxEnum) return "HydrologyBasalFlux" end
++	if(enum==HydrologyBumpHeightEnum) return "HydrologyBumpHeight" end
++	if(enum==HydrologyBumpSpacingEnum) return "HydrologyBumpSpacing" end
++	if(enum==HydrologydcBasalMoulinInputEnum) return "HydrologydcBasalMoulinInput" end
++	if(enum==HydrologydcEplThicknessEnum) return "HydrologydcEplThickness" end
++	if(enum==HydrologydcEplThicknessOldEnum) return "HydrologydcEplThicknessOld" end
++	if(enum==HydrologydcEplThicknessSubstepEnum) return "HydrologydcEplThicknessSubstep" end
++	if(enum==HydrologydcEplThicknessTransientEnum) return "HydrologydcEplThicknessTransient" end
++	if(enum==HydrologydcMaskEplactiveEltEnum) return "HydrologydcMaskEplactiveElt" end
++	if(enum==HydrologydcMaskEplactiveNodeEnum) return "HydrologydcMaskEplactiveNode" end
++	if(enum==HydrologydcMaskThawedEltEnum) return "HydrologydcMaskThawedElt" end
++	if(enum==HydrologydcMaskThawedNodeEnum) return "HydrologydcMaskThawedNode" end
++	if(enum==HydrologydcSedimentTransmitivityEnum) return "HydrologydcSedimentTransmitivity" end
++	if(enum==HydrologyDrainageRateEnum) return "HydrologyDrainageRate" end
++	if(enum==HydrologyEnglacialInputEnum) return "HydrologyEnglacialInput" end
++	if(enum==HydrologyGapHeightEnum) return "HydrologyGapHeight" end
++	if(enum==HydrologyGapHeightXEnum) return "HydrologyGapHeightX" end
++	if(enum==HydrologyGapHeightXXEnum) return "HydrologyGapHeightXX" end
++	if(enum==HydrologyGapHeightYEnum) return "HydrologyGapHeightY" end
++	if(enum==HydrologyGapHeightYYEnum) return "HydrologyGapHeightYY" end
++	if(enum==HydrologyHeadEnum) return "HydrologyHead" end
++	if(enum==HydrologyHeadOldEnum) return "HydrologyHeadOld" end
++	if(enum==HydrologyMoulinInputEnum) return "HydrologyMoulinInput" end
++	if(enum==HydrologyNeumannfluxEnum) return "HydrologyNeumannflux" end
++	if(enum==HydrologyReynoldsEnum) return "HydrologyReynolds" end
++	if(enum==HydrologySheetConductivityEnum) return "HydrologySheetConductivity" end
++	if(enum==HydrologySheetThicknessEnum) return "HydrologySheetThickness" end
++	if(enum==HydrologySheetThicknessOldEnum) return "HydrologySheetThicknessOld" end
++	if(enum==HydrologyTwsEnum) return "HydrologyTws" end
++	if(enum==HydrologyTwsSpcEnum) return "HydrologyTwsSpc" end
++	if(enum==HydrologyTwsAnalysisEnum) return "HydrologyTwsAnalysis" end
++	if(enum==HydrologyWatercolumnMaxEnum) return "HydrologyWatercolumnMax" end
++	if(enum==HydrologyWaterVxEnum) return "HydrologyWaterVx" end
++	if(enum==HydrologyWaterVyEnum) return "HydrologyWaterVy" end
++	if(enum==IceEnum) return "Ice" end
++	if(enum==IceMaskNodeActivationEnum) return "IceMaskNodeActivation" end
++	if(enum==InputEnum) return "Input" end
++	if(enum==InversionCostFunctionsCoefficientsEnum) return "InversionCostFunctionsCoefficients" end
++	if(enum==InversionSurfaceObsEnum) return "InversionSurfaceObs" end
++	if(enum==InversionThicknessObsEnum) return "InversionThicknessObs" end
++	if(enum==InversionVelObsEnum) return "InversionVelObs" end
++	if(enum==InversionVxObsEnum) return "InversionVxObs" end
++	if(enum==InversionVyObsEnum) return "InversionVyObs" end
++	if(enum==LevelsetfunctionSlopeXEnum) return "LevelsetfunctionSlopeX" end
++	if(enum==LevelsetfunctionSlopeYEnum) return "LevelsetfunctionSlopeY" end
++	if(enum==LevelsetObservationEnum) return "LevelsetObservation" end
++	if(enum==LoadingforceXEnum) return "LoadingforceX" end
++	if(enum==LoadingforceYEnum) return "LoadingforceY" end
++	if(enum==LoadingforceZEnum) return "LoadingforceZ" end
++	if(enum==MaskOceanLevelsetEnum) return "MaskOceanLevelset" end
++	if(enum==MaskIceLevelsetEnum) return "MaskIceLevelset" end
++	if(enum==MaskIceRefLevelsetEnum) return "MaskIceRefLevelset" end
++	if(enum==MasstransportSpcthicknessEnum) return "MasstransportSpcthickness" end
++	if(enum==MaterialsRheologyBEnum) return "MaterialsRheologyB" end
++	if(enum==MaterialsRheologyBbarEnum) return "MaterialsRheologyBbar" end
++	if(enum==MaterialsRheologyEEnum) return "MaterialsRheologyE" end
++	if(enum==MaterialsRheologyEbarEnum) return "MaterialsRheologyEbar" end
++	if(enum==MaterialsRheologyEcEnum) return "MaterialsRheologyEc" end
++	if(enum==MaterialsRheologyEcbarEnum) return "MaterialsRheologyEcbar" end
++	if(enum==MaterialsRheologyEsEnum) return "MaterialsRheologyEs" end
++	if(enum==MaterialsRheologyEsbarEnum) return "MaterialsRheologyEsbar" end
++	if(enum==MaterialsRheologyNEnum) return "MaterialsRheologyN" end
++	if(enum==MeshScaleFactorEnum) return "MeshScaleFactor" end
++	if(enum==MeshVertexonbaseEnum) return "MeshVertexonbase" end
++	if(enum==MeshVertexonboundaryEnum) return "MeshVertexonboundary" end
++	if(enum==MeshVertexonsurfaceEnum) return "MeshVertexonsurface" end
++	if(enum==MisfitEnum) return "Misfit" end
++	if(enum==MovingFrontalVxEnum) return "MovingFrontalVx" end
++	if(enum==MovingFrontalVyEnum) return "MovingFrontalVy" end
++	if(enum==NeumannfluxEnum) return "Neumannflux" end
++	if(enum==NewDamageEnum) return "NewDamage" end
++	if(enum==NodeEnum) return "Node" end
++	if(enum==OmegaAbsGradientEnum) return "OmegaAbsGradient" end
++	if(enum==OceantransportSpcbottompressureEnum) return "OceantransportSpcbottompressure" end
++	if(enum==OceantransportSpcstrEnum) return "OceantransportSpcstr" end
++	if(enum==OceantransportSpcdslEnum) return "OceantransportSpcdsl" end
++	if(enum==P0Enum) return "P0" end
++	if(enum==P1Enum) return "P1" end
++	if(enum==PartitioningEnum) return "Partitioning" end
++	if(enum==PressureEnum) return "Pressure" end
++	if(enum==RadarEnum) return "Radar" end
++	if(enum==RadarAttenuationMacGregorEnum) return "RadarAttenuationMacGregor" end
++	if(enum==RadarAttenuationWolffEnum) return "RadarAttenuationWolff" end
++	if(enum==RadarIcePeriodEnum) return "RadarIcePeriod" end
++	if(enum==RadarPowerMacGregorEnum) return "RadarPowerMacGregor" end
++	if(enum==RadarPowerWolffEnum) return "RadarPowerWolff" end
++	if(enum==RheologyBAbsGradientEnum) return "RheologyBAbsGradient" end
++	if(enum==RheologyBInitialguessEnum) return "RheologyBInitialguess" end
++	if(enum==RheologyBInitialguessMisfitEnum) return "RheologyBInitialguessMisfit" end
++	if(enum==RheologyBbarAbsGradientEnum) return "RheologyBbarAbsGradient" end
++	if(enum==SampleEnum) return "Sample" end
++	if(enum==SamplingBetaEnum) return "SamplingBeta" end
++	if(enum==SamplingKappaEnum) return "SamplingKappa" end
++	if(enum==SealevelEnum) return "Sealevel" end
++	if(enum==SealevelGRDEnum) return "SealevelGRD" end
++	if(enum==SealevelBarystaticMaskEnum) return "SealevelBarystaticMask" end
++	if(enum==SealevelBarystaticIceMaskEnum) return "SealevelBarystaticIceMask" end
++	if(enum==SealevelBarystaticIceWeightsEnum) return "SealevelBarystaticIceWeights" end
++	if(enum==SealevelBarystaticIceAreaEnum) return "SealevelBarystaticIceArea" end
++	if(enum==SealevelBarystaticIceLatbarEnum) return "SealevelBarystaticIceLatbar" end
++	if(enum==SealevelBarystaticIceLongbarEnum) return "SealevelBarystaticIceLongbar" end
++	if(enum==SealevelBarystaticIceLoadEnum) return "SealevelBarystaticIceLoad" end
++	if(enum==SealevelBarystaticHydroMaskEnum) return "SealevelBarystaticHydroMask" end
++	if(enum==SealevelBarystaticHydroWeightsEnum) return "SealevelBarystaticHydroWeights" end
++	if(enum==SealevelBarystaticHydroAreaEnum) return "SealevelBarystaticHydroArea" end
++	if(enum==SealevelBarystaticHydroLatbarEnum) return "SealevelBarystaticHydroLatbar" end
++	if(enum==SealevelBarystaticHydroLongbarEnum) return "SealevelBarystaticHydroLongbar" end
++	if(enum==SealevelBarystaticHydroLoadEnum) return "SealevelBarystaticHydroLoad" end
++	if(enum==SealevelBarystaticBpMaskEnum) return "SealevelBarystaticBpMask" end
++	if(enum==SealevelBarystaticBpWeightsEnum) return "SealevelBarystaticBpWeights" end
++	if(enum==SealevelBarystaticBpAreaEnum) return "SealevelBarystaticBpArea" end
++	if(enum==SealevelBarystaticBpLoadEnum) return "SealevelBarystaticBpLoad" end
++	if(enum==SealevelBarystaticOceanMaskEnum) return "SealevelBarystaticOceanMask" end
++	if(enum==SealevelBarystaticOceanWeightsEnum) return "SealevelBarystaticOceanWeights" end
++	if(enum==SealevelBarystaticOceanAreaEnum) return "SealevelBarystaticOceanArea" end
++	if(enum==SealevelBarystaticOceanLatbarEnum) return "SealevelBarystaticOceanLatbar" end
++	if(enum==SealevelBarystaticOceanLongbarEnum) return "SealevelBarystaticOceanLongbar" end
++	if(enum==SealevelBarystaticOceanLoadEnum) return "SealevelBarystaticOceanLoad" end
++	if(enum==SealevelNEsaEnum) return "SealevelNEsa" end
++	if(enum==SealevelNEsaRateEnum) return "SealevelNEsaRate" end
++	if(enum==SealevelRSLEnum) return "SealevelRSL" end
++	if(enum==BslcEnum) return "Bslc" end
++	if(enum==BslcIceEnum) return "BslcIce" end
++	if(enum==BslcHydroEnum) return "BslcHydro" end
++	if(enum==BslcOceanEnum) return "BslcOcean" end
++	if(enum==BslcRateEnum) return "BslcRate" end
++	if(enum==GmtslcEnum) return "Gmtslc" end
++	if(enum==SealevelGrotm1Enum) return "SealevelGrotm1" end
++	if(enum==SealevelGrotm2Enum) return "SealevelGrotm2" end
++	if(enum==SealevelGrotm3Enum) return "SealevelGrotm3" end
++	if(enum==SealevelGUrotm1Enum) return "SealevelGUrotm1" end
++	if(enum==SealevelGUrotm2Enum) return "SealevelGUrotm2" end
++	if(enum==SealevelGUrotm3Enum) return "SealevelGUrotm3" end
++	if(enum==SealevelGNrotm1Enum) return "SealevelGNrotm1" end
++	if(enum==SealevelGNrotm2Enum) return "SealevelGNrotm2" end
++	if(enum==SealevelGNrotm3Enum) return "SealevelGNrotm3" end
++	if(enum==SealevelGErotm1Enum) return "SealevelGErotm1" end
++	if(enum==SealevelGErotm2Enum) return "SealevelGErotm2" end
++	if(enum==SealevelGErotm3Enum) return "SealevelGErotm3" end
++	if(enum==SealevelRSLBarystaticEnum) return "SealevelRSLBarystatic" end
++	if(enum==SealevelRSLRateEnum) return "SealevelRSLRate" end
++	if(enum==SealevelUGrdEnum) return "SealevelUGrd" end
++	if(enum==SealevelNGrdEnum) return "SealevelNGrd" end
++	if(enum==SealevelUEastEsaEnum) return "SealevelUEastEsa" end
++	if(enum==SealevelUNorthEsaEnum) return "SealevelUNorthEsa" end
++	if(enum==SealevelchangeIndicesEnum) return "SealevelchangeIndices" end
++	if(enum==SealevelchangeGEnum) return "SealevelchangeG" end
++	if(enum==SealevelchangeGUEnum) return "SealevelchangeGU" end
++	if(enum==SealevelchangeGEEnum) return "SealevelchangeGE" end
++	if(enum==SealevelchangeGNEnum) return "SealevelchangeGN" end
++	if(enum==SealevelchangeGsubelOceanEnum) return "SealevelchangeGsubelOcean" end
++	if(enum==SealevelchangeGUsubelOceanEnum) return "SealevelchangeGUsubelOcean" end
++	if(enum==SealevelchangeGEsubelOceanEnum) return "SealevelchangeGEsubelOcean" end
++	if(enum==SealevelchangeGNsubelOceanEnum) return "SealevelchangeGNsubelOcean" end
++	if(enum==SealevelchangeGsubelIceEnum) return "SealevelchangeGsubelIce" end
++	if(enum==SealevelchangeGUsubelIceEnum) return "SealevelchangeGUsubelIce" end
++	if(enum==SealevelchangeGEsubelIceEnum) return "SealevelchangeGEsubelIce" end
++	if(enum==SealevelchangeGNsubelIceEnum) return "SealevelchangeGNsubelIce" end
++	if(enum==SealevelchangeGsubelHydroEnum) return "SealevelchangeGsubelHydro" end
++	if(enum==SealevelchangeGUsubelHydroEnum) return "SealevelchangeGUsubelHydro" end
++	if(enum==SealevelchangeGEsubelHydroEnum) return "SealevelchangeGEsubelHydro" end
++	if(enum==SealevelchangeGNsubelHydroEnum) return "SealevelchangeGNsubelHydro" end
++	if(enum==SealevelchangeViscousRSLEnum) return "SealevelchangeViscousRSL" end
++	if(enum==SealevelchangeViscousUEnum) return "SealevelchangeViscousU" end
++	if(enum==SealevelchangeViscousNEnum) return "SealevelchangeViscousN" end
++	if(enum==SealevelchangeViscousEEnum) return "SealevelchangeViscousE" end
++	if(enum==SedimentHeadEnum) return "SedimentHead" end
++	if(enum==SedimentHeadOldEnum) return "SedimentHeadOld" end
++	if(enum==SedimentHeadSubstepEnum) return "SedimentHeadSubstep" end
++	if(enum==SedimentHeadTransientEnum) return "SedimentHeadTransient" end
++	if(enum==SedimentHeadResidualEnum) return "SedimentHeadResidual" end
++	if(enum==SedimentHeadStackedEnum) return "SedimentHeadStacked" end
++	if(enum==SigmaNNEnum) return "SigmaNN" end
++	if(enum==SigmaVMEnum) return "SigmaVM" end
++	if(enum==SmbAccumulatedECEnum) return "SmbAccumulatedEC" end
++	if(enum==SmbAccumulatedMassBalanceEnum) return "SmbAccumulatedMassBalance" end
++	if(enum==SmbAccumulatedMeltEnum) return "SmbAccumulatedMelt" end
++	if(enum==SmbAccumulatedPrecipitationEnum) return "SmbAccumulatedPrecipitation" end
++	if(enum==SmbAccumulatedRainEnum) return "SmbAccumulatedRain" end
++	if(enum==SmbAccumulatedRefreezeEnum) return "SmbAccumulatedRefreeze" end
++	if(enum==SmbAccumulatedRunoffEnum) return "SmbAccumulatedRunoff" end
++	if(enum==SmbAEnum) return "SmbA" end
++	if(enum==SmbAdiffEnum) return "SmbAdiff" end
++	if(enum==SmbAValueEnum) return "SmbAValue" end
++	if(enum==SmbAccumulationEnum) return "SmbAccumulation" end
++	if(enum==SmbAdiffiniEnum) return "SmbAdiffini" end
++	if(enum==SmbAiniEnum) return "SmbAini" end
++	if(enum==SmbAutoregressionNoiseEnum) return "SmbAutoregressionNoise" end
++	if(enum==SmbBasinsIdEnum) return "SmbBasinsId" end
++	if(enum==SmbBMaxEnum) return "SmbBMax" end
++	if(enum==SmbBMinEnum) return "SmbBMin" end
++	if(enum==SmbBNegEnum) return "SmbBNeg" end
++	if(enum==SmbBPosEnum) return "SmbBPos" end
++	if(enum==SmbCEnum) return "SmbC" end
++	if(enum==SmbCcsnowValueEnum) return "SmbCcsnowValue" end
++	if(enum==SmbCciceValueEnum) return "SmbCciceValue" end
++	if(enum==SmbCotValueEnum) return "SmbCotValue" end
++	if(enum==SmbDEnum) return "SmbD" end
++	if(enum==SmbDailyairdensityEnum) return "SmbDailyairdensity" end
++	if(enum==SmbDailyairhumidityEnum) return "SmbDailyairhumidity" end
++	if(enum==SmbDailydlradiationEnum) return "SmbDailydlradiation" end
++	if(enum==SmbDailydsradiationEnum) return "SmbDailydsradiation" end
++	if(enum==SmbDailypressureEnum) return "SmbDailypressure" end
++	if(enum==SmbDailyrainfallEnum) return "SmbDailyrainfall" end
++	if(enum==SmbDailysnowfallEnum) return "SmbDailysnowfall" end
++	if(enum==SmbDailytemperatureEnum) return "SmbDailytemperature" end
++	if(enum==SmbDailywindspeedEnum) return "SmbDailywindspeed" end
++	if(enum==SmbDiniEnum) return "SmbDini" end
++	if(enum==SmbDlwrfEnum) return "SmbDlwrf" end
++	if(enum==SmbDulwrfValueEnum) return "SmbDulwrfValue" end
++	if(enum==SmbDswrfEnum) return "SmbDswrf" end
++	if(enum==SmbDswdiffrfEnum) return "SmbDswdiffrf" end
++	if(enum==SmbDzAddEnum) return "SmbDzAdd" end
++	if(enum==SmbDzEnum) return "SmbDz" end
++	if(enum==SmbDzMinEnum) return "SmbDzMin" end
++	if(enum==SmbDzTopEnum) return "SmbDzTop" end
++	if(enum==SmbDziniEnum) return "SmbDzini" end
++	if(enum==SmbEAirEnum) return "SmbEAir" end
++	if(enum==SmbECEnum) return "SmbEC" end
++	if(enum==SmbECDtEnum) return "SmbECDt" end
++	if(enum==SmbECiniEnum) return "SmbECini" end
++	if(enum==SmbElaEnum) return "SmbEla" end
++	if(enum==SmbEvaporationEnum) return "SmbEvaporation" end
++	if(enum==SmbFACEnum) return "SmbFAC" end
++	if(enum==SmbGdnEnum) return "SmbGdn" end
++	if(enum==SmbGdniniEnum) return "SmbGdnini" end
++	if(enum==SmbGspEnum) return "SmbGsp" end
++	if(enum==SmbGspiniEnum) return "SmbGspini" end
++	if(enum==SmbHrefEnum) return "SmbHref" end
++	if(enum==SmbIsInitializedEnum) return "SmbIsInitialized" end
++	if(enum==SmbMAddEnum) return "SmbMAdd" end
++	if(enum==SmbMassBalanceEnum) return "SmbMassBalance" end
++	if(enum==SmbMassBalanceSubstepEnum) return "SmbMassBalanceSubstep" end
++	if(enum==SmbMassBalanceTransientEnum) return "SmbMassBalanceTransient" end
++	if(enum==SmbMeanLHFEnum) return "SmbMeanLHF" end
++	if(enum==SmbMeanSHFEnum) return "SmbMeanSHF" end
++	if(enum==SmbMeanULWEnum) return "SmbMeanULW" end
++	if(enum==SmbMeltEnum) return "SmbMelt" end
++	if(enum==SmbMonthlytemperaturesEnum) return "SmbMonthlytemperatures" end
++	if(enum==SmbMSurfEnum) return "SmbMSurf" end
++	if(enum==SmbNetLWEnum) return "SmbNetLW" end
++	if(enum==SmbNetSWEnum) return "SmbNetSW" end
++	if(enum==SmbPAirEnum) return "SmbPAir" end
++	if(enum==SmbPEnum) return "SmbP" end
++	if(enum==SmbPddfacIceEnum) return "SmbPddfacIce" end
++	if(enum==SmbPddfacSnowEnum) return "SmbPddfacSnow" end
++	if(enum==SmbPrecipitationEnum) return "SmbPrecipitation" end
++	if(enum==SmbPrecipitationsAnomalyEnum) return "SmbPrecipitationsAnomaly" end
++	if(enum==SmbPrecipitationsLgmEnum) return "SmbPrecipitationsLgm" end
++	if(enum==SmbPrecipitationsPresentdayEnum) return "SmbPrecipitationsPresentday" end
++	if(enum==SmbPrecipitationsReconstructedEnum) return "SmbPrecipitationsReconstructed" end
++	if(enum==SmbRainEnum) return "SmbRain" end
++	if(enum==SmbReEnum) return "SmbRe" end
++	if(enum==SmbRefreezeEnum) return "SmbRefreeze" end
++	if(enum==SmbReiniEnum) return "SmbReini" end
++	if(enum==SmbRunoffEnum) return "SmbRunoff" end
++	if(enum==SmbRunoffSubstepEnum) return "SmbRunoffSubstep" end
++	if(enum==SmbRunoffTransientEnum) return "SmbRunoffTransient" end
++	if(enum==SmbS0gcmEnum) return "SmbS0gcm" end
++	if(enum==SmbS0pEnum) return "SmbS0p" end
++	if(enum==SmbS0tEnum) return "SmbS0t" end
++	if(enum==SmbSizeiniEnum) return "SmbSizeini" end
++	if(enum==SmbSmbCorrEnum) return "SmbSmbCorr" end
++	if(enum==SmbSmbrefEnum) return "SmbSmbref" end
++	if(enum==SmbSzaValueEnum) return "SmbSzaValue" end
++	if(enum==SmbTEnum) return "SmbT" end
++	if(enum==SmbTaEnum) return "SmbTa" end
++	if(enum==SmbTeValueEnum) return "SmbTeValue" end
++	if(enum==SmbTemperaturesAnomalyEnum) return "SmbTemperaturesAnomaly" end
++	if(enum==SmbTemperaturesLgmEnum) return "SmbTemperaturesLgm" end
++	if(enum==SmbTemperaturesPresentdayEnum) return "SmbTemperaturesPresentday" end
++	if(enum==SmbTemperaturesReconstructedEnum) return "SmbTemperaturesReconstructed" end
++	if(enum==SmbTiniEnum) return "SmbTini" end
++	if(enum==SmbTmeanEnum) return "SmbTmean" end
++	if(enum==SmbTzEnum) return "SmbTz" end
++	if(enum==SmbValuesAutoregressionEnum) return "SmbValuesAutoregression" end
++	if(enum==SmbVEnum) return "SmbV" end
++	if(enum==SmbVmeanEnum) return "SmbVmean" end
++	if(enum==SmbVzEnum) return "SmbVz" end
++	if(enum==SmbWEnum) return "SmbW" end
++	if(enum==SmbWAddEnum) return "SmbWAdd" end
++	if(enum==SmbWiniEnum) return "SmbWini" end
++	if(enum==SmbZMaxEnum) return "SmbZMax" end
++	if(enum==SmbZMinEnum) return "SmbZMin" end
++	if(enum==SmbZTopEnum) return "SmbZTop" end
++	if(enum==SmbZYEnum) return "SmbZY" end
++	if(enum==SolidearthExternalDisplacementEastRateEnum) return "SolidearthExternalDisplacementEastRate" end
++	if(enum==SolidearthExternalDisplacementNorthRateEnum) return "SolidearthExternalDisplacementNorthRate" end
++	if(enum==SolidearthExternalDisplacementUpRateEnum) return "SolidearthExternalDisplacementUpRate" end
++	if(enum==SolidearthExternalGeoidRateEnum) return "SolidearthExternalGeoidRate" end
++	if(enum==StochasticForcingDefaultIdEnum) return "StochasticForcingDefaultId" end
++	if(enum==StrainRateeffectiveEnum) return "StrainRateeffective" end
++	if(enum==StrainRateparallelEnum) return "StrainRateparallel" end
++	if(enum==StrainRateperpendicularEnum) return "StrainRateperpendicular" end
++	if(enum==StrainRatexxEnum) return "StrainRatexx" end
++	if(enum==StrainRatexyEnum) return "StrainRatexy" end
++	if(enum==StrainRatexzEnum) return "StrainRatexz" end
++	if(enum==StrainRateyyEnum) return "StrainRateyy" end
++	if(enum==StrainRateyzEnum) return "StrainRateyz" end
++	if(enum==StrainRatezzEnum) return "StrainRatezz" end
++	if(enum==StressMaxPrincipalEnum) return "StressMaxPrincipal" end
++	if(enum==StressTensorxxEnum) return "StressTensorxx" end
++	if(enum==StressTensorxyEnum) return "StressTensorxy" end
++	if(enum==StressTensorxzEnum) return "StressTensorxz" end
++	if(enum==StressTensoryyEnum) return "StressTensoryy" end
++	if(enum==StressTensoryzEnum) return "StressTensoryz" end
++	if(enum==StressTensorzzEnum) return "StressTensorzz" end
++	if(enum==SurfaceAbsMisfitEnum) return "SurfaceAbsMisfit" end
++	if(enum==SurfaceAbsVelMisfitEnum) return "SurfaceAbsVelMisfit" end
++	if(enum==AreaEnum) return "Area" end
++	if(enum==SealevelAreaEnum) return "SealevelArea" end
++	if(enum==SurfaceAreaEnum) return "SurfaceArea" end
++	if(enum==SurfaceAverageVelMisfitEnum) return "SurfaceAverageVelMisfit" end
++	if(enum==SurfaceCrevasseEnum) return "SurfaceCrevasse" end
++	if(enum==SurfaceEnum) return "Surface" end
++	if(enum==SurfaceOldEnum) return "SurfaceOld" end
++	if(enum==SurfaceLogVelMisfitEnum) return "SurfaceLogVelMisfit" end
++	if(enum==SurfaceLogVxVyMisfitEnum) return "SurfaceLogVxVyMisfit" end
++	if(enum==SurfaceObservationEnum) return "SurfaceObservation" end
++	if(enum==SurfaceRelVelMisfitEnum) return "SurfaceRelVelMisfit" end
++	if(enum==SurfaceSlopeXEnum) return "SurfaceSlopeX" end
++	if(enum==SurfaceSlopeYEnum) return "SurfaceSlopeY" end
++	if(enum==TemperatureEnum) return "Temperature" end
++	if(enum==TemperaturePDDEnum) return "TemperaturePDD" end
++	if(enum==TemperaturePicardEnum) return "TemperaturePicard" end
++	if(enum==TemperatureSEMICEnum) return "TemperatureSEMIC" end
++	if(enum==ThermalforcingAutoregressionNoiseEnum) return "ThermalforcingAutoregressionNoise" end
++	if(enum==ThermalforcingValuesAutoregressionEnum) return "ThermalforcingValuesAutoregression" end
++	if(enum==ThermalSpctemperatureEnum) return "ThermalSpctemperature" end
++	if(enum==ThicknessAbsGradientEnum) return "ThicknessAbsGradient" end
++	if(enum==ThicknessAbsMisfitEnum) return "ThicknessAbsMisfit" end
++	if(enum==ThicknessAcrossGradientEnum) return "ThicknessAcrossGradient" end
++	if(enum==ThicknessAlongGradientEnum) return "ThicknessAlongGradient" end
++	if(enum==ThicknessEnum) return "Thickness" end
++	if(enum==ThicknessOldEnum) return "ThicknessOld" end
++	if(enum==ThicknessPositiveEnum) return "ThicknessPositive" end
++	if(enum==ThicknessResidualEnum) return "ThicknessResidual" end
++	if(enum==TransientAccumulatedDeltaIceThicknessEnum) return "TransientAccumulatedDeltaIceThickness" end
++	if(enum==VelEnum) return "Vel" end
++	if(enum==VxAverageEnum) return "VxAverage" end
++	if(enum==VxBaseEnum) return "VxBase" end
++	if(enum==VxEnum) return "Vx" end
++	if(enum==VxMeshEnum) return "VxMesh" end
++	if(enum==VxObsEnum) return "VxObs" end
++	if(enum==VxShearEnum) return "VxShear" end
++	if(enum==VxSurfaceEnum) return "VxSurface" end
++	if(enum==VyAverageEnum) return "VyAverage" end
++	if(enum==VyBaseEnum) return "VyBase" end
++	if(enum==VyEnum) return "Vy" end
++	if(enum==VyMeshEnum) return "VyMesh" end
++	if(enum==VyObsEnum) return "VyObs" end
++	if(enum==VyShearEnum) return "VyShear" end
++	if(enum==VySurfaceEnum) return "VySurface" end
++	if(enum==VzEnum) return "Vz" end
++	if(enum==VzFSEnum) return "VzFS" end
++	if(enum==VzHOEnum) return "VzHO" end
++	if(enum==VzMeshEnum) return "VzMesh" end
++	if(enum==VzSSAEnum) return "VzSSA" end
++	if(enum==WaterColumnOldEnum) return "WaterColumnOld" end
++	if(enum==WatercolumnEnum) return "Watercolumn" end
++	if(enum==WaterfractionDrainageEnum) return "WaterfractionDrainage" end
++	if(enum==WaterfractionDrainageIntegratedEnum) return "WaterfractionDrainageIntegrated" end
++	if(enum==WaterfractionEnum) return "Waterfraction" end
++	if(enum==WaterheightEnum) return "Waterheight" end
++	if(enum==FrictionWaterPressureEnum) return "FrictionWaterPressure" end
++	if(enum==FrictionWaterPressureNoiseEnum) return "FrictionWaterPressureNoise" end
++	if(enum==WeightsLevelsetObservationEnum) return "WeightsLevelsetObservation" end
++	if(enum==WeightsSurfaceObservationEnum) return "WeightsSurfaceObservation" end
++	if(enum==OldAccumulatedDeltaBottomPressureEnum) return "OldAccumulatedDeltaBottomPressure" end
++	if(enum==OldAccumulatedDeltaIceThicknessEnum) return "OldAccumulatedDeltaIceThickness" end
++	if(enum==OldAccumulatedDeltaTwsEnum) return "OldAccumulatedDeltaTws" end
++	if(enum==Outputdefinition1Enum) return "Outputdefinition1" end
++	if(enum==Outputdefinition10Enum) return "Outputdefinition10" end
++	if(enum==Outputdefinition11Enum) return "Outputdefinition11" end
++	if(enum==Outputdefinition12Enum) return "Outputdefinition12" end
++	if(enum==Outputdefinition13Enum) return "Outputdefinition13" end
++	if(enum==Outputdefinition14Enum) return "Outputdefinition14" end
++	if(enum==Outputdefinition15Enum) return "Outputdefinition15" end
++	if(enum==Outputdefinition16Enum) return "Outputdefinition16" end
++	if(enum==Outputdefinition17Enum) return "Outputdefinition17" end
++	if(enum==Outputdefinition18Enum) return "Outputdefinition18" end
++	if(enum==Outputdefinition19Enum) return "Outputdefinition19" end
++	if(enum==Outputdefinition20Enum) return "Outputdefinition20" end
++	if(enum==Outputdefinition21Enum) return "Outputdefinition21" end
++	if(enum==Outputdefinition22Enum) return "Outputdefinition22" end
++	if(enum==Outputdefinition23Enum) return "Outputdefinition23" end
++	if(enum==Outputdefinition24Enum) return "Outputdefinition24" end
++	if(enum==Outputdefinition25Enum) return "Outputdefinition25" end
++	if(enum==Outputdefinition26Enum) return "Outputdefinition26" end
++	if(enum==Outputdefinition27Enum) return "Outputdefinition27" end
++	if(enum==Outputdefinition28Enum) return "Outputdefinition28" end
++	if(enum==Outputdefinition29Enum) return "Outputdefinition29" end
++	if(enum==Outputdefinition2Enum) return "Outputdefinition2" end
++	if(enum==Outputdefinition30Enum) return "Outputdefinition30" end
++	if(enum==Outputdefinition31Enum) return "Outputdefinition31" end
++	if(enum==Outputdefinition32Enum) return "Outputdefinition32" end
++	if(enum==Outputdefinition33Enum) return "Outputdefinition33" end
++	if(enum==Outputdefinition34Enum) return "Outputdefinition34" end
++	if(enum==Outputdefinition35Enum) return "Outputdefinition35" end
++	if(enum==Outputdefinition36Enum) return "Outputdefinition36" end
++	if(enum==Outputdefinition37Enum) return "Outputdefinition37" end
++	if(enum==Outputdefinition38Enum) return "Outputdefinition38" end
++	if(enum==Outputdefinition39Enum) return "Outputdefinition39" end
++	if(enum==Outputdefinition3Enum) return "Outputdefinition3" end
++	if(enum==Outputdefinition40Enum) return "Outputdefinition40" end
++	if(enum==Outputdefinition41Enum) return "Outputdefinition41" end
++	if(enum==Outputdefinition42Enum) return "Outputdefinition42" end
++	if(enum==Outputdefinition43Enum) return "Outputdefinition43" end
++	if(enum==Outputdefinition44Enum) return "Outputdefinition44" end
++	if(enum==Outputdefinition45Enum) return "Outputdefinition45" end
++	if(enum==Outputdefinition46Enum) return "Outputdefinition46" end
++	if(enum==Outputdefinition47Enum) return "Outputdefinition47" end
++	if(enum==Outputdefinition48Enum) return "Outputdefinition48" end
++	if(enum==Outputdefinition49Enum) return "Outputdefinition49" end
++	if(enum==Outputdefinition4Enum) return "Outputdefinition4" end
++	if(enum==Outputdefinition50Enum) return "Outputdefinition50" end
++	if(enum==Outputdefinition51Enum) return "Outputdefinition51" end
++	if(enum==Outputdefinition52Enum) return "Outputdefinition52" end
++	if(enum==Outputdefinition53Enum) return "Outputdefinition53" end
++	if(enum==Outputdefinition54Enum) return "Outputdefinition54" end
++	if(enum==Outputdefinition55Enum) return "Outputdefinition55" end
++	if(enum==Outputdefinition56Enum) return "Outputdefinition56" end
++	if(enum==Outputdefinition57Enum) return "Outputdefinition57" end
++	if(enum==Outputdefinition58Enum) return "Outputdefinition58" end
++	if(enum==Outputdefinition59Enum) return "Outputdefinition59" end
++	if(enum==Outputdefinition5Enum) return "Outputdefinition5" end
++	if(enum==Outputdefinition60Enum) return "Outputdefinition60" end
++	if(enum==Outputdefinition61Enum) return "Outputdefinition61" end
++	if(enum==Outputdefinition62Enum) return "Outputdefinition62" end
++	if(enum==Outputdefinition63Enum) return "Outputdefinition63" end
++	if(enum==Outputdefinition64Enum) return "Outputdefinition64" end
++	if(enum==Outputdefinition65Enum) return "Outputdefinition65" end
++	if(enum==Outputdefinition66Enum) return "Outputdefinition66" end
++	if(enum==Outputdefinition67Enum) return "Outputdefinition67" end
++	if(enum==Outputdefinition68Enum) return "Outputdefinition68" end
++	if(enum==Outputdefinition69Enum) return "Outputdefinition69" end
++	if(enum==Outputdefinition6Enum) return "Outputdefinition6" end
++	if(enum==Outputdefinition70Enum) return "Outputdefinition70" end
++	if(enum==Outputdefinition71Enum) return "Outputdefinition71" end
++	if(enum==Outputdefinition72Enum) return "Outputdefinition72" end
++	if(enum==Outputdefinition73Enum) return "Outputdefinition73" end
++	if(enum==Outputdefinition74Enum) return "Outputdefinition74" end
++	if(enum==Outputdefinition75Enum) return "Outputdefinition75" end
++	if(enum==Outputdefinition76Enum) return "Outputdefinition76" end
++	if(enum==Outputdefinition77Enum) return "Outputdefinition77" end
++	if(enum==Outputdefinition78Enum) return "Outputdefinition78" end
++	if(enum==Outputdefinition79Enum) return "Outputdefinition79" end
++	if(enum==Outputdefinition7Enum) return "Outputdefinition7" end
++	if(enum==Outputdefinition80Enum) return "Outputdefinition80" end
++	if(enum==Outputdefinition81Enum) return "Outputdefinition81" end
++	if(enum==Outputdefinition82Enum) return "Outputdefinition82" end
++	if(enum==Outputdefinition83Enum) return "Outputdefinition83" end
++	if(enum==Outputdefinition84Enum) return "Outputdefinition84" end
++	if(enum==Outputdefinition85Enum) return "Outputdefinition85" end
++	if(enum==Outputdefinition86Enum) return "Outputdefinition86" end
++	if(enum==Outputdefinition87Enum) return "Outputdefinition87" end
++	if(enum==Outputdefinition88Enum) return "Outputdefinition88" end
++	if(enum==Outputdefinition89Enum) return "Outputdefinition89" end
++	if(enum==Outputdefinition8Enum) return "Outputdefinition8" end
++	if(enum==Outputdefinition90Enum) return "Outputdefinition90" end
++	if(enum==Outputdefinition91Enum) return "Outputdefinition91" end
++	if(enum==Outputdefinition92Enum) return "Outputdefinition92" end
++	if(enum==Outputdefinition93Enum) return "Outputdefinition93" end
++	if(enum==Outputdefinition94Enum) return "Outputdefinition94" end
++	if(enum==Outputdefinition95Enum) return "Outputdefinition95" end
++	if(enum==Outputdefinition96Enum) return "Outputdefinition96" end
++	if(enum==Outputdefinition97Enum) return "Outputdefinition97" end
++	if(enum==Outputdefinition98Enum) return "Outputdefinition98" end
++	if(enum==Outputdefinition99Enum) return "Outputdefinition99" end
++	if(enum==Outputdefinition9Enum) return "Outputdefinition9" end
++	if(enum==Outputdefinition100Enum) return "Outputdefinition100" end
++	if(enum==InputsENDEnum) return "InputsEND" end
++	if(enum==AbsoluteEnum) return "Absolute" end
++	if(enum==AdaptiveTimesteppingEnum) return "AdaptiveTimestepping" end
++	if(enum==AdjointBalancethickness2AnalysisEnum) return "AdjointBalancethickness2Analysis" end
++	if(enum==AdjointBalancethicknessAnalysisEnum) return "AdjointBalancethicknessAnalysis" end
++	if(enum==AdjointHorizAnalysisEnum) return "AdjointHorizAnalysis" end
++	if(enum==AggressiveMigrationEnum) return "AggressiveMigration" end
++	if(enum==AmrBamgEnum) return "AmrBamg" end
++	if(enum==AmrNeopzEnum) return "AmrNeopz" end
++	if(enum==AndroidFrictionCoefficientEnum) return "AndroidFrictionCoefficient" end
++	if(enum==ArrheniusEnum) return "Arrhenius" end
++	if(enum==AutodiffJacobianEnum) return "AutodiffJacobian" end
++	if(enum==Balancethickness2AnalysisEnum) return "Balancethickness2Analysis" end
++	if(enum==Balancethickness2SolutionEnum) return "Balancethickness2Solution" end
++	if(enum==BalancethicknessAnalysisEnum) return "BalancethicknessAnalysis" end
++	if(enum==BalancethicknessApparentMassbalanceEnum) return "BalancethicknessApparentMassbalance" end
++	if(enum==BalancethicknessSoftAnalysisEnum) return "BalancethicknessSoftAnalysis" end
++	if(enum==BalancethicknessSoftSolutionEnum) return "BalancethicknessSoftSolution" end
++	if(enum==BalancethicknessSolutionEnum) return "BalancethicknessSolution" end
++	if(enum==BalancevelocityAnalysisEnum) return "BalancevelocityAnalysis" end
++	if(enum==BalancevelocitySolutionEnum) return "BalancevelocitySolution" end
++	if(enum==BasalforcingsIsmip6Enum) return "BasalforcingsIsmip6" end
++	if(enum==BasalforcingsPicoEnum) return "BasalforcingsPico" end
++	if(enum==BeckmannGoosseFloatingMeltRateEnum) return "BeckmannGoosseFloatingMeltRate" end
++	if(enum==BedSlopeSolutionEnum) return "BedSlopeSolution" end
++	if(enum==BoolExternalResultEnum) return "BoolExternalResult" end
++	if(enum==BoolInputEnum) return "BoolInput" end
++	if(enum==IntInputEnum) return "IntInput" end
++	if(enum==DoubleInputEnum) return "DoubleInput" end
++	if(enum==BoolParamEnum) return "BoolParam" end
++	if(enum==BoundaryEnum) return "Boundary" end
++	if(enum==BuddJackaEnum) return "BuddJacka" end
++	if(enum==CalvingDev2Enum) return "CalvingDev2" end
++	if(enum==CalvingHabEnum) return "CalvingHab" end
++	if(enum==CalvingLevermannEnum) return "CalvingLevermann" end
++	if(enum==CalvingVonmisesEnum) return "CalvingVonmises" end
++	if(enum==CfdragcoeffabsgradEnum) return "Cfdragcoeffabsgrad" end
++	if(enum==CfsurfacelogvelEnum) return "Cfsurfacelogvel" end
++	if(enum==CfsurfacesquareEnum) return "Cfsurfacesquare" end
++	if(enum==CflevelsetmisfitEnum) return "Cflevelsetmisfit" end
++	if(enum==ChannelEnum) return "Channel" end
++	if(enum==ChannelAreaEnum) return "ChannelArea" end
++	if(enum==ChannelAreaOldEnum) return "ChannelAreaOld" end
++	if(enum==ChannelDischargeEnum) return "ChannelDischarge" end
++	if(enum==ClosedEnum) return "Closed" end
++	if(enum==ColinearEnum) return "Colinear" end
++	if(enum==ConstraintsEnum) return "Constraints" end
++	if(enum==ContactEnum) return "Contact" end
++	if(enum==ContourEnum) return "Contour" end
++	if(enum==ContoursEnum) return "Contours" end
++	if(enum==ControlInputEnum) return "ControlInput" end
++	if(enum==ControlInputGradEnum) return "ControlInputGrad" end
++	if(enum==ControlInputMaxsEnum) return "ControlInputMaxs" end
++	if(enum==ControlInputMinsEnum) return "ControlInputMins" end
++	if(enum==ControlInputValuesEnum) return "ControlInputValues" end
++	if(enum==CrouzeixRaviartEnum) return "CrouzeixRaviart" end
++	if(enum==CuffeyEnum) return "Cuffey" end
++	if(enum==CuffeyTemperateEnum) return "CuffeyTemperate" end
++	if(enum==DamageEvolutionAnalysisEnum) return "DamageEvolutionAnalysis" end
++	if(enum==DamageEvolutionSolutionEnum) return "DamageEvolutionSolution" end
++	if(enum==DataSetEnum) return "DataSet" end
++	if(enum==DataSetParamEnum) return "DataSetParam" end
++	if(enum==DatasetInputEnum) return "DatasetInput" end
++	if(enum==DefaultAnalysisEnum) return "DefaultAnalysis" end
++	if(enum==DefaultCalvingEnum) return "DefaultCalving" end
++	if(enum==DenseEnum) return "Dense" end
++	if(enum==DependentObjectEnum) return "DependentObject" end
++	if(enum==DepthAverageAnalysisEnum) return "DepthAverageAnalysis" end
++	if(enum==DeviatoricStressErrorEstimatorEnum) return "DeviatoricStressErrorEstimator" end
++	if(enum==DivergenceEnum) return "Divergence" end
++	if(enum==Domain3DsurfaceEnum) return "Domain3Dsurface" end
++	if(enum==DoubleArrayInputEnum) return "DoubleArrayInput" end
++	if(enum==ArrayInputEnum) return "ArrayInput" end
++	if(enum==DoubleExternalResultEnum) return "DoubleExternalResult" end
++	if(enum==DoubleMatArrayParamEnum) return "DoubleMatArrayParam" end
++	if(enum==DoubleMatExternalResultEnum) return "DoubleMatExternalResult" end
++	if(enum==DoubleMatParamEnum) return "DoubleMatParam" end
++	if(enum==DoubleParamEnum) return "DoubleParam" end
++	if(enum==DoubleVecParamEnum) return "DoubleVecParam" end
++	if(enum==ElementEnum) return "Element" end
++	if(enum==ElementHookEnum) return "ElementHook" end
++	if(enum==ElementSIdEnum) return "ElementSId" end
++	if(enum==EnthalpyAnalysisEnum) return "EnthalpyAnalysis" end
++	if(enum==EsaAnalysisEnum) return "EsaAnalysis" end
++	if(enum==EsaSolutionEnum) return "EsaSolution" end
++	if(enum==EsaTransitionsEnum) return "EsaTransitions" end
++	if(enum==ExternalResultEnum) return "ExternalResult" end
++	if(enum==ExtrapolationAnalysisEnum) return "ExtrapolationAnalysis" end
++	if(enum==ExtrudeFromBaseAnalysisEnum) return "ExtrudeFromBaseAnalysis" end
++	if(enum==ExtrudeFromTopAnalysisEnum) return "ExtrudeFromTopAnalysis" end
++	if(enum==FSApproximationEnum) return "FSApproximation" end
++	if(enum==FSSolverEnum) return "FSSolver" end
++	if(enum==FSpressureEnum) return "FSpressure" end
++	if(enum==FSvelocityEnum) return "FSvelocity" end
++	if(enum==FemModelEnum) return "FemModel" end
++	if(enum==FileParamEnum) return "FileParam" end
++	if(enum==FixedTimesteppingEnum) return "FixedTimestepping" end
++	if(enum==FloatingAreaEnum) return "FloatingArea" end
++	if(enum==FloatingAreaScaledEnum) return "FloatingAreaScaled" end
++	if(enum==FloatingMeltRateEnum) return "FloatingMeltRate" end
++	if(enum==FreeEnum) return "Free" end
++	if(enum==FreeSurfaceBaseAnalysisEnum) return "FreeSurfaceBaseAnalysis" end
++	if(enum==FreeSurfaceTopAnalysisEnum) return "FreeSurfaceTopAnalysis" end
++	if(enum==FrontalForcingsDefaultEnum) return "FrontalForcingsDefault" end
++	if(enum==FrontalForcingsRignotEnum) return "FrontalForcingsRignot" end
++	if(enum==FrontalForcingsRignotAutoregressionEnum) return "FrontalForcingsRignotAutoregression" end
++	if(enum==FsetEnum) return "Fset" end
++	if(enum==FullMeltOnPartiallyFloatingEnum) return "FullMeltOnPartiallyFloating" end
++	if(enum==GLheightadvectionAnalysisEnum) return "GLheightadvectionAnalysis" end
++	if(enum==GaussPentaEnum) return "GaussPenta" end
++	if(enum==GaussSegEnum) return "GaussSeg" end
++	if(enum==GaussTetraEnum) return "GaussTetra" end
++	if(enum==GaussTriaEnum) return "GaussTria" end
++	if(enum==GenericOptionEnum) return "GenericOption" end
++	if(enum==GenericParamEnum) return "GenericParam" end
++	if(enum==GenericExternalResultEnum) return "GenericExternalResult" end
++	if(enum==Gradient1Enum) return "Gradient1" end
++	if(enum==Gradient2Enum) return "Gradient2" end
++	if(enum==Gradient3Enum) return "Gradient3" end
++	if(enum==Gradient4Enum) return "Gradient4" end
++	if(enum==GroundedAreaEnum) return "GroundedArea" end
++	if(enum==GroundedAreaScaledEnum) return "GroundedAreaScaled" end
++	if(enum==GroundingOnlyEnum) return "GroundingOnly" end
++	if(enum==GroundinglineMassFluxEnum) return "GroundinglineMassFlux" end
++	if(enum==GsetEnum) return "Gset" end
++	if(enum==GslEnum) return "Gsl" end
++	if(enum==HOApproximationEnum) return "HOApproximation" end
++	if(enum==HOFSApproximationEnum) return "HOFSApproximation" end
++	if(enum==HookEnum) return "Hook" end
++	if(enum==HydrologyDCEfficientAnalysisEnum) return "HydrologyDCEfficientAnalysis" end
++	if(enum==HydrologyDCInefficientAnalysisEnum) return "HydrologyDCInefficientAnalysis" end
++	if(enum==HydrologyGlaDSAnalysisEnum) return "HydrologyGlaDSAnalysis" end
++	if(enum==HydrologyGlaDSEnum) return "HydrologyGlaDS" end
++	if(enum==HydrologyPismAnalysisEnum) return "HydrologyPismAnalysis" end
++	if(enum==HydrologyShaktiAnalysisEnum) return "HydrologyShaktiAnalysis" end
++	if(enum==HydrologyShreveAnalysisEnum) return "HydrologyShreveAnalysis" end
++	if(enum==HydrologySolutionEnum) return "HydrologySolution" end
++	if(enum==HydrologydcEnum) return "Hydrologydc" end
++	if(enum==HydrologypismEnum) return "Hydrologypism" end
++	if(enum==HydrologyshaktiEnum) return "Hydrologyshakti" end
++	if(enum==HydrologyshreveEnum) return "Hydrologyshreve" end
++	if(enum==IceMassEnum) return "IceMass" end
++	if(enum==IceMassScaledEnum) return "IceMassScaled" end
++	if(enum==IceVolumeAboveFloatationEnum) return "IceVolumeAboveFloatation" end
++	if(enum==IceVolumeAboveFloatationScaledEnum) return "IceVolumeAboveFloatationScaled" end
++	if(enum==IceVolumeEnum) return "IceVolume" end
++	if(enum==IceVolumeScaledEnum) return "IceVolumeScaled" end
++	if(enum==IcefrontMassFluxEnum) return "IcefrontMassFlux" end
++	if(enum==IcefrontMassFluxLevelsetEnum) return "IcefrontMassFluxLevelset" end
++	if(enum==IncrementalEnum) return "Incremental" end
++	if(enum==IndexedEnum) return "Indexed" end
++	if(enum==IntExternalResultEnum) return "IntExternalResult" end
++	if(enum==ElementInputEnum) return "ElementInput" end
++	if(enum==IntMatExternalResultEnum) return "IntMatExternalResult" end
++	if(enum==IntMatParamEnum) return "IntMatParam" end
++	if(enum==IntParamEnum) return "IntParam" end
++	if(enum==IntVecParamEnum) return "IntVecParam" end
++	if(enum==InputsEnum) return "Inputs" end
++	if(enum==InternalEnum) return "Internal" end
++	if(enum==IntersectEnum) return "Intersect" end
++	if(enum==InversionVzObsEnum) return "InversionVzObs" end
++	if(enum==JEnum) return "J" end
++	if(enum==L1L2ApproximationEnum) return "L1L2Approximation" end
++	if(enum==MLHOApproximationEnum) return "MLHOApproximation" end
++	if(enum==L2ProjectionBaseAnalysisEnum) return "L2ProjectionBaseAnalysis" end
++	if(enum==L2ProjectionEPLAnalysisEnum) return "L2ProjectionEPLAnalysis" end
++	if(enum==LACrouzeixRaviartEnum) return "LACrouzeixRaviart" end
++	if(enum==LATaylorHoodEnum) return "LATaylorHood" end
++	if(enum==LambdaSEnum) return "LambdaS" end
++	if(enum==LevelsetAnalysisEnum) return "LevelsetAnalysis" end
++	if(enum==LevelsetfunctionPicardEnum) return "LevelsetfunctionPicard" end
++	if(enum==LinearFloatingMeltRateEnum) return "LinearFloatingMeltRate" end
++	if(enum==LliboutryDuvalEnum) return "LliboutryDuval" end
++	if(enum==LoadsEnum) return "Loads" end
++	if(enum==LoveAnalysisEnum) return "LoveAnalysis" end
++	if(enum==LoveHiEnum) return "LoveHi" end
++	if(enum==LoveHrEnum) return "LoveHr" end
++	if(enum==LoveKernelsImagEnum) return "LoveKernelsImag" end
++	if(enum==LoveKernelsRealEnum) return "LoveKernelsReal" end
++	if(enum==LoveKiEnum) return "LoveKi" end
++	if(enum==LoveKrEnum) return "LoveKr" end
++	if(enum==LoveLiEnum) return "LoveLi" end
++	if(enum==LoveLrEnum) return "LoveLr" end
++	if(enum==LoveSolutionEnum) return "LoveSolution" end
++	if(enum==MINIEnum) return "MINI" end
++	if(enum==MINIcondensedEnum) return "MINIcondensed" end
++	if(enum==MantlePlumeGeothermalFluxEnum) return "MantlePlumeGeothermalFlux" end
++	if(enum==MassFluxEnum) return "MassFlux" end
++	if(enum==MassconEnum) return "Masscon" end
++	if(enum==MassconaxpbyEnum) return "Massconaxpby" end
++	if(enum==MassfluxatgateEnum) return "Massfluxatgate" end
++	if(enum==MasstransportAnalysisEnum) return "MasstransportAnalysis" end
++	if(enum==MasstransportSolutionEnum) return "MasstransportSolution" end
++	if(enum==MatdamageiceEnum) return "Matdamageice" end
++	if(enum==MatenhancediceEnum) return "Matenhancedice" end
++	if(enum==MaterialsEnum) return "Materials" end
++	if(enum==MatestarEnum) return "Matestar" end
++	if(enum==MaticeEnum) return "Matice" end
++	if(enum==MatlithoEnum) return "Matlitho" end
++	if(enum==MathydroEnum) return "Mathydro" end
++	if(enum==MatrixParamEnum) return "MatrixParam" end
++	if(enum==MaxAbsVxEnum) return "MaxAbsVx" end
++	if(enum==MaxAbsVyEnum) return "MaxAbsVy" end
++	if(enum==MaxAbsVzEnum) return "MaxAbsVz" end
++	if(enum==MaxDivergenceEnum) return "MaxDivergence" end
++	if(enum==MaxVelEnum) return "MaxVel" end
++	if(enum==MaxVxEnum) return "MaxVx" end
++	if(enum==MaxVyEnum) return "MaxVy" end
++	if(enum==MaxVzEnum) return "MaxVz" end
++	if(enum==MelangeEnum) return "Melange" end
++	if(enum==MeltingAnalysisEnum) return "MeltingAnalysis" end
++	if(enum==MeshElementsEnum) return "MeshElements" end
++	if(enum==MeshXEnum) return "MeshX" end
++	if(enum==MeshYEnum) return "MeshY" end
++	if(enum==MinVelEnum) return "MinVel" end
++	if(enum==MinVxEnum) return "MinVx" end
++	if(enum==MinVyEnum) return "MinVy" end
++	if(enum==MinVzEnum) return "MinVz" end
++	if(enum==MismipFloatingMeltRateEnum) return "MismipFloatingMeltRate" end
++	if(enum==MoulinEnum) return "Moulin" end
++	if(enum==MpiDenseEnum) return "MpiDense" end
++	if(enum==MpiEnum) return "Mpi" end
++	if(enum==MpiSparseEnum) return "MpiSparse" end
++	if(enum==MumpsEnum) return "Mumps" end
++	if(enum==NoFrictionOnPartiallyFloatingEnum) return "NoFrictionOnPartiallyFloating" end
++	if(enum==NoMeltOnPartiallyFloatingEnum) return "NoMeltOnPartiallyFloating" end
++	if(enum==NodalEnum) return "Nodal" end
++	if(enum==NodalvalueEnum) return "Nodalvalue" end
++	if(enum==NodeSIdEnum) return "NodeSId" end
++	if(enum==NoneApproximationEnum) return "NoneApproximation" end
++	if(enum==NoneEnum) return "None" end
++	if(enum==NumberedcostfunctionEnum) return "Numberedcostfunction" end
++	if(enum==NyeCO2Enum) return "NyeCO2" end
++	if(enum==NyeH2OEnum) return "NyeH2O" end
++	if(enum==NumericalfluxEnum) return "Numericalflux" end
++	if(enum==OceantransportAnalysisEnum) return "OceantransportAnalysis" end
++	if(enum==OceantransportSolutionEnum) return "OceantransportSolution" end
++	if(enum==OldGradientEnum) return "OldGradient" end
++	if(enum==OneLayerP4zEnum) return "OneLayerP4z" end
++	if(enum==OpenEnum) return "Open" end
++	if(enum==OptionEnum) return "Option" end
++	if(enum==ParamEnum) return "Param" end
++	if(enum==ParametersEnum) return "Parameters" end
++	if(enum==P0ArrayEnum) return "P0Array" end
++	if(enum==P0DGEnum) return "P0DG" end
++	if(enum==P1DGEnum) return "P1DG" end
++	if(enum==P1P1Enum) return "P1P1" end
++	if(enum==P1P1GLSEnum) return "P1P1GLS" end
++	if(enum==P1bubbleEnum) return "P1bubble" end
++	if(enum==P1bubblecondensedEnum) return "P1bubblecondensed" end
++	if(enum==P1xP2Enum) return "P1xP2" end
++	if(enum==P1xP3Enum) return "P1xP3" end
++	if(enum==P1xP4Enum) return "P1xP4" end
++	if(enum==P2Enum) return "P2" end
++	if(enum==P2bubbleEnum) return "P2bubble" end
++	if(enum==P2bubblecondensedEnum) return "P2bubblecondensed" end
++	if(enum==P2xP1Enum) return "P2xP1" end
++	if(enum==P2xP4Enum) return "P2xP4" end
++	if(enum==PatersonEnum) return "Paterson" end
++	if(enum==PengridEnum) return "Pengrid" end
++	if(enum==PenpairEnum) return "Penpair" end
++	if(enum==PentaEnum) return "Penta" end
++	if(enum==PentaInputEnum) return "PentaInput" end
++	if(enum==ProfilerEnum) return "Profiler" end
++	if(enum==ProfilingCurrentFlopsEnum) return "ProfilingCurrentFlops" end
++	if(enum==ProfilingCurrentMemEnum) return "ProfilingCurrentMem" end
++	if(enum==ProfilingSolutionTimeEnum) return "ProfilingSolutionTime" end
++	if(enum==RegionaloutputEnum) return "Regionaloutput" end
++	if(enum==RegularEnum) return "Regular" end
++	if(enum==RecoveryAnalysisEnum) return "RecoveryAnalysis" end
++	if(enum==RiftfrontEnum) return "Riftfront" end
++	if(enum==SamplingAnalysisEnum) return "SamplingAnalysis" end
++	if(enum==SamplingSolutionEnum) return "SamplingSolution" end
++	if(enum==SIAApproximationEnum) return "SIAApproximation" end
++	if(enum==SMBautoregressionEnum) return "SMBautoregression" end
++	if(enum==SMBcomponentsEnum) return "SMBcomponents" end
++	if(enum==SMBd18opddEnum) return "SMBd18opdd" end
++	if(enum==SMBforcingEnum) return "SMBforcing" end
++	if(enum==SMBgcmEnum) return "SMBgcm" end
++	if(enum==SMBgembEnum) return "SMBgemb" end
++	if(enum==SMBgradientsEnum) return "SMBgradients" end
++	if(enum==SMBgradientscomponentsEnum) return "SMBgradientscomponents" end
++	if(enum==SMBgradientselaEnum) return "SMBgradientsela" end
++	if(enum==SMBhenningEnum) return "SMBhenning" end
++	if(enum==SMBmeltcomponentsEnum) return "SMBmeltcomponents" end
++	if(enum==SMBpddEnum) return "SMBpdd" end
++	if(enum==SMBpddSicopolisEnum) return "SMBpddSicopolis" end
++	if(enum==SMBsemicEnum) return "SMBsemic" end
++	if(enum==SSAApproximationEnum) return "SSAApproximation" end
++	if(enum==SSAFSApproximationEnum) return "SSAFSApproximation" end
++	if(enum==SSAHOApproximationEnum) return "SSAHOApproximation" end
++	if(enum==ScaledEnum) return "Scaled" end
++	if(enum==SealevelAbsoluteEnum) return "SealevelAbsolute" end
++	if(enum==SealevelEmotionEnum) return "SealevelEmotion" end
++	if(enum==SealevelInertiaTensorXZEnum) return "SealevelInertiaTensorXZ" end
++	if(enum==SealevelInertiaTensorYZEnum) return "SealevelInertiaTensorYZ" end
++	if(enum==SealevelInertiaTensorZZEnum) return "SealevelInertiaTensorZZ" end
++	if(enum==SealevelchangePolarMotionEnum) return "SealevelchangePolarMotion" end
++	if(enum==SealevelNmotionEnum) return "SealevelNmotion" end
++	if(enum==SealevelUmotionEnum) return "SealevelUmotion" end
++	if(enum==SealevelchangeAnalysisEnum) return "SealevelchangeAnalysis" end
++	if(enum==SegEnum) return "Seg" end
++	if(enum==SegInputEnum) return "SegInput" end
++	if(enum==SegmentEnum) return "Segment" end
++	if(enum==SegmentRiftfrontEnum) return "SegmentRiftfront" end
++	if(enum==SeparateEnum) return "Separate" end
++	if(enum==SeqEnum) return "Seq" end
++	if(enum==SmbAnalysisEnum) return "SmbAnalysis" end
++	if(enum==SmbSolutionEnum) return "SmbSolution" end
++	if(enum==SmoothAnalysisEnum) return "SmoothAnalysis" end
++	if(enum==SoftMigrationEnum) return "SoftMigration" end
++	if(enum==SpatialLinearFloatingMeltRateEnum) return "SpatialLinearFloatingMeltRate" end
++	if(enum==SpcDynamicEnum) return "SpcDynamic" end
++	if(enum==SpcStaticEnum) return "SpcStatic" end
++	if(enum==SpcTransientEnum) return "SpcTransient" end
++	if(enum==SsetEnum) return "Sset" end
++	if(enum==StatisticsSolutionEnum) return "StatisticsSolution" end
++	if(enum==SteadystateSolutionEnum) return "SteadystateSolution" end
++	if(enum==StressIntensityFactorEnum) return "StressIntensityFactor" end
++	if(enum==StressbalanceAnalysisEnum) return "StressbalanceAnalysis" end
++	if(enum==StressbalanceConvergenceNumStepsEnum) return "StressbalanceConvergenceNumSteps" end
++	if(enum==StressbalanceSIAAnalysisEnum) return "StressbalanceSIAAnalysis" end
++	if(enum==StressbalanceSolutionEnum) return "StressbalanceSolution" end
++	if(enum==StressbalanceVerticalAnalysisEnum) return "StressbalanceVerticalAnalysis" end
++	if(enum==StringArrayParamEnum) return "StringArrayParam" end
++	if(enum==StringExternalResultEnum) return "StringExternalResult" end
++	if(enum==StringParamEnum) return "StringParam" end
++	if(enum==SubelementFriction1Enum) return "SubelementFriction1" end
++	if(enum==SubelementFriction2Enum) return "SubelementFriction2" end
++	if(enum==SubelementMelt1Enum) return "SubelementMelt1" end
++	if(enum==SubelementMelt2Enum) return "SubelementMelt2" end
++	if(enum==SubelementMigrationEnum) return "SubelementMigration" end
++	if(enum==SurfaceSlopeSolutionEnum) return "SurfaceSlopeSolution" end
++	if(enum==TaylorHoodEnum) return "TaylorHood" end
++	if(enum==TetraEnum) return "Tetra" end
++	if(enum==TetraInputEnum) return "TetraInput" end
++	if(enum==ThermalAnalysisEnum) return "ThermalAnalysis" end
++	if(enum==ThermalSolutionEnum) return "ThermalSolution" end
++	if(enum==ThicknessErrorEstimatorEnum) return "ThicknessErrorEstimator" end
++	if(enum==TotalCalvingFluxLevelsetEnum) return "TotalCalvingFluxLevelset" end
++	if(enum==TotalCalvingMeltingFluxLevelsetEnum) return "TotalCalvingMeltingFluxLevelset" end
++	if(enum==TotalFloatingBmbEnum) return "TotalFloatingBmb" end
++	if(enum==TotalFloatingBmbScaledEnum) return "TotalFloatingBmbScaled" end
++	if(enum==TotalGroundedBmbEnum) return "TotalGroundedBmb" end
++	if(enum==TotalGroundedBmbScaledEnum) return "TotalGroundedBmbScaled" end
++	if(enum==TotalSmbEnum) return "TotalSmb" end
++	if(enum==TotalSmbScaledEnum) return "TotalSmbScaled" end
++	if(enum==TransientArrayParamEnum) return "TransientArrayParam" end
++	if(enum==TransientInputEnum) return "TransientInput" end
++	if(enum==TransientParamEnum) return "TransientParam" end
++	if(enum==TransientSolutionEnum) return "TransientSolution" end
++	if(enum==TriaEnum) return "Tria" end
++	if(enum==TriaInputEnum) return "TriaInput" end
++	if(enum==UzawaPressureAnalysisEnum) return "UzawaPressureAnalysis" end
++	if(enum==VectorParamEnum) return "VectorParam" end
++	if(enum==VertexEnum) return "Vertex" end
++	if(enum==VertexLIdEnum) return "VertexLId" end
++	if(enum==VertexPIdEnum) return "VertexPId" end
++	if(enum==VertexSIdEnum) return "VertexSId" end
++	if(enum==VerticesEnum) return "Vertices" end
++	if(enum==ViscousHeatingEnum) return "ViscousHeating" end
++	if(enum==WaterEnum) return "Water" end
++	if(enum==XTaylorHoodEnum) return "XTaylorHood" end
++	if(enum==XYEnum) return "XY" end
++	if(enum==XYZEnum) return "XYZ" end
++	if(enum==BalancethicknessD0Enum) return "BalancethicknessD0" end
++	if(enum==BalancethicknessDiffusionCoefficientEnum) return "BalancethicknessDiffusionCoefficient" end
++	if(enum==BilinearInterpEnum) return "BilinearInterp" end
++	if(enum==CalvingdevCoeffEnum) return "CalvingdevCoeff" end
++	if(enum==DeviatoricStressEnum) return "DeviatoricStress" end
++	if(enum==EtaAbsGradientEnum) return "EtaAbsGradient" end
++	if(enum==MeshZEnum) return "MeshZ" end
++	if(enum==NearestInterpEnum) return "NearestInterp" end
++	if(enum==OutputdefinitionListEnum) return "OutputdefinitionList" end
++	if(enum==SealevelObsEnum) return "SealevelObs" end
++	if(enum==SealevelWeightsEnum) return "SealevelWeights" end
++	if(enum==StrainRateEnum) return "StrainRate" end
++	if(enum==StressTensorEnum) return "StressTensor" end
++	if(enum==StressbalanceViscosityOvershootEnum) return "StressbalanceViscosityOvershoot" end
++	if(enum==SubelementMigration4Enum) return "SubelementMigration4" end
++	if(enum==TimesteppingTimeAdaptEnum) return "TimesteppingTimeAdapt" end
++	if(enum==TriangleInterpEnum) return "TriangleInterp" end
++	if(enum==MaximumNumberOfDefinitionsEnum) return "MaximumNumberOfDefinitions" end
+ end
+-
+-function EnumToString(enum::Int64)
+-	return EnumToString(IssmEnum(enum))
+-end
+-
+-function StringToEnum(string::String)
+-
+-	#Make dictionnary from enums
+-	inst = instances(IssmEnum)
+-	syms = Symbol.(inst)
+-	enumdic = Dict(zip(syms, inst))
+-
+-	return enumdic[Symbol(string)]
+-end
+-
+-function StringToEnumInt(string::String)
+-	return Integer(StringToEnum(string))
+-end
+Index: ../trunk-jpl/src/jl/core/results.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/results.jl	(revision 26726)
++++ ../trunk-jpl/src/jl/core/results.jl	(revision 26727)
+@@ -1,4 +1,5 @@
+ mutable struct Result #{{{
++	enum::IssmEnum
+ 	step::Int64
+ 	time::Float64
+ 	value
+Index: ../trunk-jpl/src/jl/usr/plotmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/plotmodel.jl	(revision 26726)
++++ ../trunk-jpl/src/jl/usr/plotmodel.jl	(revision 26727)
+@@ -2,12 +2,10 @@
+ using  GLMakie
+ using .ISSM
+ 
+-function plotmodel(md::model,data::Vector)
++function plotmodel( md::model, data::Vector, showvertices::Bool=false, showfacets::Bool=true)
+ 
+ 	vertexcolor  = :black
+ 	facetcolor   = :blue
+-	showvertices = true
+-	showfacets   = true
+ 
+ 	if data isa AbstractVector
+ 
+@@ -37,6 +35,10 @@
+ 		fig, ax, h = Makie.mesh( [md.mesh.x md.mesh.y], md.mesh.elements, shading = false, color = data, colormap = jet)
+ 	end
+ 
++	if showfacets
++		Makie.wireframe!(ax, h[1][], color=facetcolor)
++	end
++
+ 	if showvertices
+ 		Makie.scatter!( [md.mesh.x md.mesh.y], markersize = 4, color = vertexcolor)
+ 	end
+@@ -43,3 +45,24 @@
+ 
+ 	return fig
+ end
++
++function plotmodel(md::model,data::BitVector) #{{{
++
++	println("Converting BitVector to Vector")
++	data2 = Vector{Float64}(undef,size(data))
++	for i in 1:length(data)
++		data2[i] = Float64(data[i])
++	end
++
++	plotmodel(md,data2)
++
++end#}}}
++function plotmodel(md::model,data::String) #{{{
++
++	if(data=="mesh")
++		poly([md.mesh.x md.mesh.y], md.mesh.elements, strokewidth=1, shading=false)
++	else
++		error(data, " plot not supported yet")
++	end
++
++end#}}}
+Index: ../trunk-jpl/src/jl/core/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/modules.jl	(revision 26726)
++++ ../trunk-jpl/src/jl/core/modules.jl	(revision 26727)
+@@ -1,4 +1,4 @@
+-#Model Processor
++#Model Processor and Core I/O
+ function FetchDataToInput(md::model,inputs::Inputs,elements::Vector{Tria},data::Vector{Float64},enum::IssmEnum) #{{{
+ 	for i in 1:length(elements)
+ 		InputCreate(elements[i],inputs,data,enum)
+@@ -93,7 +93,12 @@
+ end# }}}
+ function OutputResultsx(femmodel::FemModel, md::model)# {{{
+ 
+-	md.results = Dict("Stressbalance"=> femmodel.results)
++	output = Dict()
++	for i in length(femmodel.results)
++		result = femmodel.results[i]
++		output[EnumToString(result.enum)] = result.value
++	end
++	md.results["Stressbalance"] = output
+ 
+ end# }}}
+ 
+@@ -249,7 +254,7 @@
+ 
+ 			#Create Result
+ 			input  = GetInput(femmodel.inputs,outputlist[i])
+-			result = Result(step, time, copy(input.values))
++			result = Result(outputlist[i], step, time, copy(input.values))
+ 
+ 			#Add to femmodel.results dataset
+ 			push!(femmodel.results,result)
+Index: ../trunk-jpl/src/jl/tests/test.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test.jl	(revision 26726)
++++ ../trunk-jpl/src/jl/tests/test.jl	(revision 26727)
+@@ -5,9 +5,9 @@
+ 
+ #Load model from MATLAB file
+ file = matopen("./Pig.mat")
+-mat = read(file, "md")
++mat  = read(file, "md")
+ close(file)
+-md=model(mat)
++md = model(mat)
+ 
+ #Solve stress balance
+-md=solve(md, "Stressbalance")
++md = solve(md, "Stressbalance")
+Index: ../trunk-jpl/src/jl/usr/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/classes.jl	(revision 26726)
++++ ../trunk-jpl/src/jl/usr/classes.jl	(revision 26727)
+@@ -128,11 +128,11 @@
+ 	initialization::Initialization
+ 	stressbalance::Stressbalance
+ 	constants::Constants
+-	results
++	results::Dict
+ 	friction::AbstractFriction
+ end
+ function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants(), [], BuddFriction())
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants(), Dict(), BuddFriction())
+ end#}}}
+ function model(matmd::Dict) #{{{
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26727-26728.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26727-26728.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26727-26728.diff	(revision 26740)
@@ -0,0 +1,110 @@
+Index: ../trunk-jpl/src/jl/usr/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/classes.jl	(revision 26727)
++++ ../trunk-jpl/src/jl/usr/classes.jl	(revision 26728)
+@@ -1,5 +1,7 @@
+ using Printf
+ 
++#Model fields
++#Mesh {{{
+ abstract type AbstractMesh end
+ mutable struct Mesh2dTriangle <: AbstractMesh
+ 	numberofvertices::Int64
+@@ -30,7 +32,8 @@
+ function Mesh3dPrism() #{{{
+ 	return Mesh3dPrism( 0, 0, 0, Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Matrix{Int64}(undef, 0, 0), Matrix{Int64}(undef, 0, 0), Vector{Bool}(undef,0))
+ end# }}}
+-
++#}}}
++#Geometry{{{
+ mutable struct Geometry
+ 	surface::Vector{Float64}
+ 	base::Vector{Float64}
+@@ -40,7 +43,11 @@
+ function Geometry() #{{{
+ 	return Geometry( Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+ end# }}}
+-
++function Base.show(io::IO, this::Geometry)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++#}}}
++#Mask {{{
+ mutable struct Mask
+ 	ocean_levelset::Vector{Float64}
+ 	ice_levelset::Vector{Float64}
+@@ -51,7 +58,8 @@
+ function Base.show(io::IO, this::Mask)# {{{
+ 	IssmStructDisp(io, this)
+ end# }}}
+-
++#}}}
++#Initialization{{{
+ mutable struct Initialization
+ 	vx::Vector{Float64}
+ 	vy::Vector{Float64}
+@@ -59,7 +67,11 @@
+ function Initialization() #{{{
+ 	return Initialization( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
+ end# }}}
+-
++function Base.show(io::IO, this::Initialization)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++#}}}
++#Stressbalance {{{
+ mutable struct Stressbalance
+ 	spcvx::Vector{Float64}
+ 	spcvy::Vector{Float64}
+@@ -74,7 +86,8 @@
+ function Base.show(io::IO, this::Stressbalance)# {{{
+ 	IssmStructDisp(io, this)
+ end# }}}
+-
++#}}}
++#Constants{{{
+ mutable struct Constants
+ 	g::Float64
+ 	yts::Float64
+@@ -82,7 +95,11 @@
+ function Constants() #{{{
+ 	return Constants( 9.81,  365*24*3600.)
+ end# }}}
+-
++function Base.show(io::IO, this::Constants)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++# }}}
++#Materials {{{
+ mutable struct Materials
+ 	rho_ice::Float64
+ 	rho_water::Float64
+@@ -104,7 +121,11 @@
+ function Materials() #{{{
+ 	return Materials(917., 1023., 1000., 0.001787, 2093., 3.34*10^5, 2.4, .24, 1, 273.15, 9.8*10^-8, 3974., 1.00*10^-4, Vector{Float64}(undef,0), Vector{Float64}(undef,0), "Cuffey")
+ end# }}}
+-
++function Base.show(io::IO, this::Materials)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++# }}}
++#Friction {{{
+ abstract type AbstractFriction end
+ mutable struct BuddFriction <: AbstractFriction
+ 	coefficient::Vector{Float64}
+@@ -119,7 +140,9 @@
+ 	C::Vector{Float64}
+ 	m::Vector{Float64}
+ end
++# }}}
+ 
++#Model structure
+ mutable struct model
+ 	mesh::AbstractMesh
+ 	geometry::Geometry
+@@ -199,3 +222,5 @@
+ 	@printf "%19s: %-26s -- %s\n" "friction" typeof(md.friction) "basal friction"
+ 
+ end# }}}
++
++
Index: /issm/oecreview/Archive/25834-26739/ISSM-26728-26729.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26728-26729.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26728-26729.diff	(revision 26740)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/jl/core/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/toolkits.jl	(revision 26728)
++++ ../trunk-jpl/src/jl/core/toolkits.jl	(revision 26729)
+@@ -126,11 +126,14 @@
+ end#}}}
+ function Solverx(A::IssmMatrix,b::IssmVector,xold::IssmVector) #{{{
+ 
+-	x = IssmVector(GetSize(xold))
+-	x.vector = (A.matrix\b.vector)
++	#Initialize output
++	#x = IssmVector(GetSize(xold))
++	x = IssmVector(0)
+ 
++	#Solve linear system
++	x.vector = A.matrix\b.vector
++
+ 	return x
+ 
+ 
+ end#}}}
+-
Index: /issm/oecreview/Archive/25834-26739/ISSM-26729-26730.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26729-26730.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26729-26730.diff	(revision 26740)
@@ -0,0 +1,954 @@
+Index: ../trunk-jpl/src/jl/core/constraints.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/constraints.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/core/constraints.jl	(revision 26730)
+@@ -13,6 +13,6 @@
+ 	node = nodes[constraint.nodeid]
+ 
+ 	#Apply Constraint
+-	ApplyConstraint(node,constraint.dof,constraint.value)
++	ApplyConstraint(node, constraint.dof, constraint.value)
+ 
+ end# }}}
+Index: ../trunk-jpl/src/jl/core/femmodel.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/femmodel.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/core/femmodel.jl	(revision 26730)
+@@ -1,14 +1,40 @@
+ #femmodel class definition
+ mutable struct FemModel #{{{
++	analyses::Vector{Analysis}
+ 	elements::Vector{Tria}
+ 	vertices::Vector{Vertex}
++
+ 	nodes::Vector{Node}
++	nodes_list::Vector{Vector{Node}}
++
+ 	parameters::Parameters
+ 	inputs::Inputs
++
+ 	constraints::Vector{Constraint}
++	constraints_list::Vector{Vector{Constraint}}
++
+ 	#loads::Vector{Loads}
++
+ 	results::Vector{Result}
+ end#}}}
+ 
+ #femmodel functions
++function SetCurrentConfiguration!(femmodel::FemModel, analysis::Analysis) #{{{
+ 
++	#Find the index of this analysis
++	index = -1
++	for i in 1:length(femmodel.analyses)
++		if(typeof(femmodel.analyses[i]) == typeof(analysis)) index = i end
++	end
++	if(index<1) error("Could not find analysis ",analysis, " in femmodel") end
++
++	#Plug right nodes onto element
++	for i in 1:length(femmodel.elements)
++		femmodel.elements[i].nodes = femmodel.elements[i].nodes_list[index]
++	end
++
++	#Plug in nodes and other datasets
++	femmodel.nodes       = femmodel.nodes_list[index]
++	femmodel.constraints = femmodel.constraints_list[index]
++
++end#}}}
+Index: ../trunk-jpl/src/jl/core/parameters.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/parameters.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/core/parameters.jl	(revision 26730)
+@@ -8,6 +8,10 @@
+ 	enum::IssmEnum
+ 	value::Int64
+ end# }}}
++struct BoolParam <: Parameter #{{{
++	enum::IssmEnum
++	value::Bool
++end# }}}
+ 
+ #Parameters dataset class definition
+ mutable struct Parameters #{{{
+@@ -21,6 +25,9 @@
+ function GetParameterValue(param::IntParam) #{{{
+ 	return param.value
+ end#}}}
++function GetParameterValue(param::BoolParam) #{{{
++	return param.value
++end#}}}
+ 
+ #Parameters functions
+ function AddParam(parameters::Parameters,value::Float64,enum::IssmEnum) #{{{
+@@ -28,14 +35,14 @@
+ 	parameters.lookup[enum] = DoubleParam(enum,value)
+ 
+ end#}}}
+-function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
++function AddParam(parameters::Parameters,value::Int64, enum::IssmEnum) #{{{
+ 
+ 	parameters.lookup[enum] = IntParam(enum,value)
+ 
+ end#}}}
+-function AddParam(parameters::Parameters,value::Int64,enum::IssmEnum) #{{{
++function AddParam(parameters::Parameters,value::Bool, enum::IssmEnum) #{{{
+ 
+-	parameters.lookup[enum] = IntParam(enum,value)
++	parameters.lookup[enum] = BoolParam(enum,value)
+ 
+ end#}}}
+ function FindParam(parameters::Parameters,enum::IssmEnum) #{{{
+Index: ../trunk-jpl/src/jl/tests/test.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/tests/test.jl	(revision 26730)
+@@ -4,7 +4,8 @@
+ using MAT
+ 
+ #Load model from MATLAB file
+-file = matopen("./Pig.mat")
++#file = matopen("./Pig.mat")
++file = matopen("/Users/mmorligh/Desktop/issmuci/trunk-jpl/test/NightlyRun/temp.mat")
+ mat  = read(file, "md")
+ close(file)
+ md = model(mat)
+Index: ../trunk-jpl/src/jl/tests/test101.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test101.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/tests/test101.jl	(revision 26730)
+@@ -24,8 +24,8 @@
+ vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
+ vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
+ index = Int.(archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index"))
+-md.initialization.vx=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.initialization.vx=0 .*InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y,0.0)
++md.initialization.vy=0 .*InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y,0.0)
+ 
+ md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
+ md.materials.rheology_n=3*ones(md.mesh.numberofelements)
+Index: ../trunk-jpl/src/jl/tests/test208.jl
+===================================================================
+--- ../trunk-jpl/src/jl/tests/test208.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/tests/test208.jl	(revision 26730)
+@@ -0,0 +1,59 @@
++#!/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia
++include("../issm.jl")
++using .ISSM
++
++md = model()
++md = triangle(md,issmdir()*"/test/Exp/Square.exp", 150000.)
++md = setmask(md, "all", "")
++
++#Geometry
++hmin=300.
++hmax=1000.
++ymin=minimum(md.mesh.y)
++ymax=maximum(md.mesh.y)
++xmin=minimum(md.mesh.x)
++xmax=maximum(md.mesh.x)
++md.geometry.thickness = hmax .+ (hmin-hmax)*(md.mesh.y .- ymin)./(ymax-ymin) .+ 0.1*(hmin-hmax)*(md.mesh.x .- xmin)./(xmax-xmin)
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
++md.geometry.surface   = md.geometry.base+md.geometry.thickness
++md.geometry.bed       = md.geometry.base .-10
++
++#Initial velocity
++x     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","x")
++y     = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","y")
++vx    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vx")
++vy    = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","vy")
++index = archread(issmdir()*"/test/Data/SquareShelfConstrained.arch","index")
++md.initialization.vx=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
++md.initialization.vy=zeros(md.mesh.numberofvertices)#InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
++
++md.materials.rheology_B=1.815730284801701e+08*ones(md.mesh.numberofvertices)
++md.materials.rheology_n=3*ones(md.mesh.numberofelements)
++md.friction.coefficient=20*ones(md.mesh.numberofvertices)
++
++md.stressbalance.restol=0.1
++md.stressbalance.reltol=0.02
++md.stressbalance.abstol=NaN
++md.timestepping.start_time = 0.0
++md.timestepping.final_time = 3.0
++md.timestepping.time_step  = 1.0
++
++#Boundary conditions
++nodefront=ContourToNodes(md.mesh.x,md.mesh.y,issmdir()*"/test/Exp/SquareFront.exp",2.0) .& md.mesh.vertexonboundary
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices)
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices)
++pos = findall(md.mesh.vertexonboundary .& .~nodefront)
++md.mask.ice_levelset[findall(nodefront)] .= 0
++
++segmentsfront=md.mask.ice_levelset[md.mesh.segments[:,1:2]]==0
++segments = findall(vec(sum(Int64.(md.mask.ice_levelset[md.mesh.segments[:,1:2]].==0), dims=2)) .!=2)
++pos=md.mesh.segments[segments,1:2]
++md.stressbalance.spcvx[pos] .= 0.0
++md.stressbalance.spcvy[pos] .= 0.0
++
++md.smb.mass_balance = zeros(md.mesh.numberofvertices)
++md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices)
++md.basalforcings.floatingice_melting_rate = ones(md.mesh.numberofvertices)
++md.masstransport.spcthickness = NaN*ones(md.mesh.numberofvertices)
++
++md=solve(md,"Transient")
+
+Property changes on: ../trunk-jpl/src/jl/tests/test208.jl
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/jl/usr/classes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/classes.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/usr/classes.jl	(revision 26730)
+@@ -141,6 +141,71 @@
+ 	m::Vector{Float64}
+ end
+ # }}}
++#Basalforcings {{{
++mutable struct Basalforcings
++	groundedice_melting_rate::Vector{Float64}
++	floatingice_melting_rate::Vector{Float64}
++end
++function Basalforcings() #{{{
++	return Basalforcings( Vector{Float64}(undef,0), Vector{Float64}(undef,0))
++end# }}}
++function Base.show(io::IO, this::Basalforcings)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++# }}}
++#Surfaceforcings {{{
++mutable struct SMBforcings
++	mass_balance::Vector{Float64}
++end
++function SMBforcings() #{{{
++	return SMBforcings( Vector{Float64}(undef,0))
++end# }}}
++function Base.show(io::IO, this::SMBforcings)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++# }}}
++#Timestepping{{{
++abstract type AbstractTimestepping end
++mutable struct Timestepping <: AbstractTimestepping
++	start_time::Float64
++	final_time::Float64
++	time_step::Float64
++end
++function Timestepping() #{{{
++	return Timestepping( 0., 0., 0.)
++end# }}}
++function Base.show(io::IO, this::Timestepping)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++# }}}
++#Masstransport {{{
++mutable struct Masstransport
++	spcthickness::Vector{Float64}
++	min_thickness::Float64
++	stabilization::Int64
++end
++function Masstransport() #{{{
++	return Masstransport( Vector{Float64}(undef,0), 10.0, 1)
++end# }}}
++function Base.show(io::IO, this::Masstransport)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++# }}}
++#Transient {{{
++mutable struct Transient
++	issmb::Bool
++	ismasstransport::Bool
++	isstressbalance::Bool
++	isgroundingline::Bool
++	ismovingfront::Bool
++end
++function Transient() #{{{
++	return Transient( true, true, true, true, true)
++end# }}}
++function Base.show(io::IO, this::Transient)# {{{
++	IssmStructDisp(io, this)
++end# }}}
++# }}}
+ 
+ #Model structure
+ mutable struct model
+@@ -153,9 +218,17 @@
+ 	constants::Constants
+ 	results::Dict
+ 	friction::AbstractFriction
++	basalforcings::Basalforcings
++	smb::SMBforcings
++	timestepping::Timestepping
++	masstransport::Masstransport
++	transient::Transient
+ end
+ function model() #{{{
+-	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(), Initialization(),Stressbalance(), Constants(), Dict(), BuddFriction())
++	return model( Mesh2dTriangle(), Geometry(), Mask(), Materials(),
++					 Initialization(),Stressbalance(), Constants(), Dict(),
++					 BuddFriction(), Basalforcings(), SMBforcings(), Timestepping(),
++					 Masstransport(), Transient())
+ end#}}}
+ function model(matmd::Dict) #{{{
+ 
+@@ -184,6 +257,9 @@
+ 			elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Int64
+ 				setfield!(mdfield, Symbol(name2), Int64(value_matlab))
+ 
++			elseif typeof(value_matlab)==Float64 && typeof(value_julia)==Bool
++				setfield!(mdfield, Symbol(name2), Bool(value_matlab))
++
+ 			elseif typeof(value_matlab)==Matrix{Float64} && typeof(value_julia)==Vector{Float64}
+ 				if(size(value_matlab,2)!=1) error("only one column expected") end
+ 				setfield!(mdfield, Symbol(name2), value_matlab[:,1])
+@@ -217,10 +293,13 @@
+ 	@printf "%19s: %-26s -- %s\n" "mask" typeof(md.mask) "defines grounded and floating regions"
+ 	@printf "%19s: %-26s -- %s\n" "materials" typeof(md.materials) "material properties"
+ 	@printf "%19s: %-26s -- %s\n" "initialization" typeof(md.initialization) "initial state"
+-	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "stress balance parameters"
+ 	@printf "%19s: %-26s -- %s\n" "constants" typeof(md.constants) "physical constants"
+ 	@printf "%19s: %-26s -- %s\n" "friction" typeof(md.friction) "basal friction"
++	@printf "%19s: %-26s -- %s\n" "basalforcings" typeof(md.basalforcings) "basal forcings"
++	@printf "%19s: %-26s -- %s\n" "smb" typeof(md.smb) "surface mass balance"
++	@printf "%19s: %-26s -- %s\n" "timestepping" typeof(md.timestepping) "time stepping for transient simulations"
++	@printf "%19s: %-26s -- %s\n" "stressbalance" typeof(md.stressbalance) "parameters stress balance simulations"
++	@printf "%19s: %-26s -- %s\n" "masstransport" typeof(md.masstransport) "parameters mass transport simulations"
++	@printf "%19s: %-26s -- %s\n" "transient" typeof(md.transient) "parameters for transient simulations"
+ 
+ end# }}}
+-
+-
+Index: ../trunk-jpl/src/jl/usr/utils.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/utils.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/usr/utils.jl	(revision 26730)
+@@ -206,11 +206,13 @@
+ 
+ 	if solution=="sb" || solution=="Stressbalance"
+ 		solutionstring = "StressbalanceSolution"
++	elseif solution=="tr" || solution=="Transient"
++			solutionstring = "TransientSolution"
+ 	else
+ 		error("solutionstring "*solution*" not supported!");
+ 	end
+ 
+-	IssmCore(md)
++	IssmCore(md, solutionstring)
+ 
+ 	return md
+ end #}}}
+Index: ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl	(revision 26730)
+@@ -0,0 +1,272 @@
++#MasstransportAnalysis class definition
++struct MasstransportAnalysis <: Analysis#{{{
++end #}}}
++
++#Model Processing
++function CreateConstraints(analysis::MasstransportAnalysis,constraints::Vector{Constraint},md::model) #{{{
++
++	#load constraints from model
++	spcthickness = md.masstransport.spcthickness
++
++	count = 1
++	for i in 1:md.mesh.numberofvertices
++		if ~isnan(spcthickness[i])
++			push!(constraints,Constraint(count,i,1,spcthickness[i]))
++			count+=1
++		end
++	end
++
++end#}}}
++function CreateNodes(analysis::MasstransportAnalysis,nodes::Vector{Node},md::model) #{{{
++
++	numdof = 1
++	for i in 1:md.mesh.numberofvertices
++		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
++	end
++end#}}}
++function UpdateElements(analysis::MasstransportAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
++
++	#Provide node indices to element
++	for i in 1:md.mesh.numberofelements
++		Update(elements[i],inputs,i,md,P1Enum)
++	end
++
++	#Add necessary inputs to perform this analysis
++	FetchDataToInput(md,inputs,elements,md.geometry.thickness,ThicknessEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.surface,SurfaceEnum)
++	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
++	FetchDataToInput(md,inputs,elements,md.basalforcings.groundedice_melting_rate./md.constants.yts,BasalforcingsGroundediceMeltingRateEnum)
++	FetchDataToInput(md,inputs,elements,md.basalforcings.floatingice_melting_rate./md.constants.yts,BasalforcingsFloatingiceMeltingRateEnum)
++	FetchDataToInput(md,inputs,elements,md.mask.ice_levelset, MaskIceLevelsetEnum)
++	FetchDataToInput(md,inputs,elements,md.mask.ocean_levelset, MaskOceanLevelsetEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
++	FetchDataToInput(md,inputs,elements,md.initialization.vy./md.constants.yts,VyEnum)
++
++end#}}}
++function UpdateParameters(analysis::MasstransportAnalysis,parameters::Parameters,md::model) #{{{
++
++	AddParam(parameters, md.masstransport.min_thickness, MasstransportMinThicknessEnum)
++	AddParam(parameters, md.masstransport.stabilization, MasstransportStabilizationEnum)
++
++end#}}}
++
++#Finite Element Analysis
++function Core(analysis::MasstransportAnalysis,femmodel::FemModel)# {{{
++
++	error("not supported yet")
++
++	#Save output
++	RequestedOutputsx(femmodel, [ThicknessEnum, SurfaceEnum, BedEnum])
++
++end #}}}
++function CreateKMatrix(analysis::MasstransportAnalysis,element::Tria)# {{{
++
++	error("not supported")
++
++	#Internmediaries
++	numnodes = 3
++	
++	#Initialize Element matrix and basis function derivatives
++	Ke = ElementMatrix(element.nodes)
++	dbasis = Matrix{Float64}(undef,numnodes,2)
++
++	#Retrieve all inputs and parameters
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	H_input  = GetInput(element, ThicknessEnum)
++
++	#Prepare material object
++	material = Matice(element)
++	
++	#Start integrating
++	gauss = GaussTria(2)
++	for ig in 1:gauss.numgauss
++
++		Jdet = JacobianDeterminant(xyz_list, gauss)
++		NodalFunctionsDerivatives(element,dbasis,xyz_list,gauss)
++
++		H  = GetInputValue(H_input, gauss, ig)
++		mu = ViscositySSA(material, xyz_list, gauss, ig)
++
++		for i in 1:numnodes
++			for j in 1:numnodes
++				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,1]*dbasis[i,1] + dbasis[j,2]*dbasis[i,2])
++				Ke.values[2*i-1,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,2]*dbasis[i,1] + dbasis[j,1]*dbasis[i,2])
++				Ke.values[2*i  ,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,1]*dbasis[i,2] + dbasis[j,2]*dbasis[i,1])
++				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,2]*dbasis[i,2] + dbasis[j,1]*dbasis[i,1])
++			end
++		end
++	end
++
++	#Add basal friction
++	phi=GetGroundedPortion(element, xyz_list)
++
++	if(phi>0)
++		basis = Vector{Float64}(undef,numnodes)
++		friction = CoreFriction(element)
++
++		#Start integrating
++		gauss = GaussTria(2)
++		for ig in 1:gauss.numgauss
++
++			Jdet = JacobianDeterminant(xyz_list, gauss)
++			NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++			alpha2 = Alpha2(friction, gauss, ig)
++
++			for i in 1:numnodes
++				for j in 1:numnodes
++					Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
++					Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
++				end
++			end
++		end
++	end
++
++	return Ke
++end #}}}
++function CreatePVector(analysis::MasstransportAnalysis,element::Tria)# {{{
++
++	error("not supported")
++
++	#Internmediaries
++	numnodes = 3
++
++	#Initialize Element vectro and basis functions
++	pe = ElementVector(element.nodes)
++	basis = Vector{Float64}(undef,numnodes)
++
++	#Retrieve all inputs and parameters
++	xyz_list = GetVerticesCoordinates(element.vertices)
++	H_input  = GetInput(element, ThicknessEnum)
++	s_input  = GetInput(element, SurfaceEnum)
++	rho_ice  = FindParam(element, MaterialsRhoIceEnum)
++	g        = FindParam(element, ConstantsGEnum)
++
++	#Start integrating
++	gauss = GaussTria(2)
++	for ig in 1:gauss.numgauss
++
++		Jdet = JacobianDeterminant(xyz_list, gauss)
++		NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++		H  = GetInputValue(H_input, gauss, ig)
++		ds = GetInputDerivativeValue(s_input, xyz_list, gauss, ig)
++
++		for i in 1:numnodes
++			pe.values[2*i-1] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[1]*basis[i]
++			pe.values[2*i  ] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[2]*basis[i]
++		end
++	end
++
++	if(IsIcefront(element))
++
++		#Get additional parameters and inputs
++		b_input   = GetInput(element, BaseEnum)
++		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
++
++		#Get normal and ice front coordinates
++		xyz_list_front = Matrix{Float64}(undef,2,3)
++		GetIcefrontCoordinates!(element, xyz_list_front, xyz_list, MaskIceLevelsetEnum)
++		nx, ny = NormalSection(element, xyz_list_front)
++
++		gauss = GaussTria(element, xyz_list, xyz_list_front, 3)
++		for ig in 1:gauss.numgauss
++
++			Jdet = JacobianDeterminantSurface(xyz_list_front, gauss)
++			NodalFunctions(element, basis, gauss, ig, P1Enum)
++
++			H  = GetInputValue(H_input, gauss, ig)
++			b  = GetInputValue(b_input, gauss, ig)
++			sl = 0
++
++			term = 0.5*g*rho_ice*H^2 + 0.5*g*rho_water*(min(0, H+b-sl)^2 - min(0, b-sl)^2)
++
++			for i in 1:numnodes
++				pe.values[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
++				pe.values[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
++			end
++		end
++	end
++
++	return pe
++end #}}}
++function GetSolutionFromInputs(analysis::MasstransportAnalysis,ug::IssmVector,element::Tria) #{{{
++
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++	@assert length(doflist)==3
++
++	#Fetch inputs
++	thickness_input = GetInput(element, ThicknessEnum)
++
++	#Loop over each node and enter solution in ug
++	count = 0
++	gauss=GaussTria(P1Enum)
++	for i in 1:gauss.numgauss
++		thickness = GetInputValue(thickness_input, gauss, i)
++
++		count += 1
++		ug.vector[doflist[count]] = thickness
++	end
++
++	#Make sure we reached all the values
++	@assert count==length(doflist)
++
++end#}}}
++function InputUpdateFromSolution(analysis::MasstransportAnalysis,ug::Vector{Float64},element::Tria) #{{{
++
++	#Get dofs for this finite element
++	doflist = GetDofList(element,GsetEnum)
++
++	#Get solution vector for this element
++	numdof   = 3
++	values = Vector{Float64}(undef,numdof)
++	for i in 1:numdof values[i]=ug[doflist[i]] end
++
++	#Get some parameters
++	rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
++	rho_ice   = FindParam(element, MaterialsRhoIceEnum)
++	H_min     = FindParam(element, MasstransportMinThicknessEnum)
++
++	#Now split solution vector into x and y components
++	numnodes = 3
++	thickness  = Vector{Float64}(undef,numnodes)
++	for i in 1:numnodes 
++		thickness[i]=values[i] 
++		@assert isfinite(thickness[i])
++
++		#Enforce minimum thickness
++		if(thickness[i]<min_thickness)
++			thickness[i] = min_thickness
++		end
++	end
++	AddInput(element, ThicknessEnum,  thickness,  P1Enum)
++
++	#Update bed and surface accordingly
++	newthickness = Vector{Float64}(undef,3)
++	oldthickness = Vector{Float64}(undef,3)
++	oldbase      = Vector{Float64}(undef,3)
++	oldsurface   = Vector{Float64}(undef,3)
++	phi          = Vector{Float64}(undef,3)
++	GetInputListOnVertices!(element, newthickness, ThicknessEnum)
++   GetInputListOnVertices!(element, oldthickness, ThicknessOldEnum)
++   GetInputListOnVertices!(element, oldbase, BaseOldEnum)
++   GetInputListOnVertices!(element, oldsurface, SurfaceOldEnum)
++   GetInputListOnVertices!(element, phi, MaskOceanLevelsetEnum)
++   sealevel = zeros(3)
++
++   for i in 1:3
++      if(phi[i]>0.)
++         #this is grounded ice: just add thickness to base.
++         newsurface[i] = bed[i]+newthickness[i]; #surface = bed + newthickness
++         newbase[i]    = bed[i];                 #new base at new bed
++      else
++         #this is an ice shelf: hydrostatic equilibrium
++         newsurface[i] = newthickness[i]*(1-rho_ice/rho_water) + sealevel[i]
++         newbase[i]    = newthickness[i]*(-rho_ice/rho_water)  + sealevel[i]
++      end
++   end
++
++	AddInput(element, SurfaceEnum, newsurface, P1Enum)
++	AddInput(element, BaseEnum,    newbase,    P1Enum)
++end#}}}
+Index: ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26730)
+@@ -32,7 +32,7 @@
+ function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+ 
+ 	#Provide node indices to element
+-	for i in 1:md.mesh.numberofvertices
++	for i in 1:md.mesh.numberofelements
+ 		Update(elements[i],inputs,i,md,P1Enum)
+ 	end
+ 
+@@ -71,6 +71,9 @@
+ #Finite Element Analysis
+ function Core(analysis::StressbalanceAnalysis,femmodel::FemModel)# {{{
+ 
++	#Set current analysis to Stressnalance
++	SetCurrentConfiguration!(femmodel, analysis)
++
+ 	#Fetch parameters relevant to solution sequence
+ 	maxiter = FindParam(femmodel.parameters,StressbalanceMaxiterEnum)
+ 	restol  = FindParam(femmodel.parameters,StressbalanceRestolEnum)
+@@ -77,8 +80,12 @@
+ 	reltol  = FindParam(femmodel.parameters,StressbalanceReltolEnum)
+ 	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
+ 
++	#Call solution sequence to compute new speeds
+ 	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+ 
++	#Save output
++	RequestedOutputsx(femmodel, [VxEnum,VyEnum,VelEnum])
++
+ end #}}}
+ function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
+ 
+Index: ../trunk-jpl/src/jl/core/analyses/transientanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/transientanalysis.jl	(nonexistent)
++++ ../trunk-jpl/src/jl/core/analyses/transientanalysis.jl	(revision 26730)
+@@ -0,0 +1,38 @@
++#TransientAnalysis class definition
++struct TransientAnalysis <: Analysis#{{{
++end #}}}
++
++function UpdateParameters(analysis::TransientAnalysis,parameters::Parameters,md::model) #{{{
++
++	AddParam(parameters, md.constants.yts, ConstantsYtsEnum)
++	AddParam(parameters, md.timestepping.start_time/md.constants.yts, TimeEnum)
++	AddParam(parameters, md.timestepping.final_time/md.constants.yts, TimesteppingFinalTimeEnum)
++	AddParam(parameters, md.timestepping.time_step/md.constants.yts,  TimesteppingTimeStepEnum)
++	AddParam(parameters, md.transient.isstressbalance, TransientIsstressbalanceEnum)
++	AddParam(parameters, md.transient.ismasstransport, TransientIsmasstransportEnum)
++
++end#}}}
++function Core(analysis::TransientAnalysis,femmodel::FemModel)# {{{
++
++	step      = FindParam(femmodel.parameters, StepEnum)
++	time      = FindParam(femmodel.parameters, TimeEnum)
++	finaltime = FindParam(femmodel.parameters, TimesteppingFinalTimeEnum)
++	yts       = FindParam(femmodel.parameters, ConstantsYtsEnum)
++	dt        = FindParam(femmodel.parameters, TimesteppingTimeStepEnum)
++
++	isstressbalance = FindParam(femmodel.parameters, TransientIsstressbalanceEnum)
++   ismasstransport = FindParam(femmodel.parameters, TransientIsmasstransportEnum)
++
++   while(time < finaltime - (yts*eps(Float64))) #make sure we run up to finaltime.
++
++		step+=1
++		time+=dt
++		AddParam(femmodel.parameters, time, TimeEnum);
++		AddParam(femmodel.parameters, step, StepEnum);
++      println("iteration ", step, "/", ceil((finaltime-time)/dt)+step," time [yr]: ", time/yts, " (time step: ",  dt/yts, ")")
++
++      if(isstressbalance) Core(StressbalanceAnalysis(), femmodel) end
++      if(ismasstransport) Core(MasstransportAnalysis(), femmodel) end
++   end
++
++end #}}}
+Index: ../trunk-jpl/src/jl/core/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/elements.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/core/elements.jl	(revision 26730)
+@@ -2,16 +2,31 @@
+ mutable struct Tria #{{{
+ 	sid::Int64
+ 	pid::Int64
++
+ 	#vertexids::Int64[3]
+ 	#vertices::Vertex[3]
+ 	vertexids::Vector{Int64}
+ 	vertices::Vector{Vertex}
+-	nodeids::Vector{Int64}
++
+ 	nodes::Vector{Node}
++	nodes_list::Vector{Vector{Node}}
++	nodes_ids_list::Vector{Vector{Int64}}
++
+ 	parameters::Parameters
+ 	inputs::Inputs
+ end# }}}
++function Tria(sid::Int64, pid::Int64, vertexids::Vector{Int64}) #{{{
+ 
++	#This is the default constructor, at this point we don't have much information
++	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
++	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
++	return Tria(sid, pid,
++					vertexids, Vector{Vertex}(undef,3),
++					Vector{Node}(undef,0), Vector{Vector{Node}}(undef,0), Vector{Vector{Int64}}(undef,0),
++					tempparams, tempinputs)
++
++end #}}}
++
+ #Element functions
+ function InputCreate(element::Tria,inputs::Inputs,data::Vector{Float64},enum::IssmEnum) #{{{
+ 	if size(data,1)==inputs.numberofelements
+@@ -30,19 +45,22 @@
+ 		error("interpolation ", interpolation, " not supported yet");
+ 	end
+ end #}}}
+-function Update(element::Tria,inputs::Inputs,index::Int64,md::model,finiteelement::IssmEnum) #{{{
++function Update(element::Tria, inputs::Inputs, index::Int64, md::model, finiteelement::IssmEnum) #{{{
+ 
+ 	if finiteelement==P1Enum
+ 		numnodes = 3
+-		element.nodeids    = Vector{Int64}(undef,numnodes)
+-		element.nodeids[1] = md.mesh.elements[index,1]
+-		element.nodeids[2] = md.mesh.elements[index,2]
+-		element.nodeids[3] = md.mesh.elements[index,3]
++		nodeids    = Vector{Int64}(undef,numnodes)
++		nodeids[1] = md.mesh.elements[index,1]
++		nodeids[2] = md.mesh.elements[index,2]
++		nodeids[3] = md.mesh.elements[index,3]
++
++		push!(element.nodes_ids_list, nodeids)
++		push!(element.nodes_list, Vector{Node}(undef, numnodes))
+ 	else
+ 		error("not supported yet")
+ 	end
+ end #}}}
+-function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) # {{{
++function Configure(element::Tria,nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs,index::Int64) # {{{
+ 
+    #Configure vertices
+    for i in 1:3
+@@ -50,11 +68,14 @@
+    end
+ 
+ 	#Configure nodes (assuming P1 finite elements)
++	nodes_list     = element.nodes_list[index]
++	nodes_ids_list = element.nodes_ids_list[index]
+ 	for i in 1:3
+-		element.nodes[i] = nodes[element.nodeids[i]]
++		nodes_list[i] = nodes[nodes_ids_list[i]]
+ 	end
+ 
+ 	#Point to real datasets
++	element.nodes      = element.nodes_list[index]
+ 	element.parameters = parameters
+ 	element.inputs     = inputs
+ 	
+Index: ../trunk-jpl/src/jl/core/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/modules.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/core/modules.jl	(revision 26730)
+@@ -4,39 +4,62 @@
+ 		InputCreate(elements[i],inputs,data,enum)
+ 	end
+ end#}}}
+-function ModelProcessor(md::model) #{{{
++function ModelProcessor(md::model, solutionstring::String) #{{{
+ 
+ 	#Initialize structures
+ 	elements    = Vector{Tria}(undef,0)
+ 	vertices    = Vector{Vertex}(undef,0)
+-	nodes       = Vector{Node}(undef,0)
+-	constraints = Vector{Constraint}(undef,0)
+ 	results     = Vector{Result}(undef,0)
+ 	parameters  = Parameters(Dict{IssmEnum,Parameter}())
+-	inputs      = Inputs(md.mesh.numberofelements,md.mesh.numberofvertices,Dict{IssmEnum,Input}())
++	inputs      = Inputs(md.mesh.numberofelements, md.mesh.numberofvertices, Dict{IssmEnum,Input}())
+ 
+ 	#Create  elements, vertices and materials (independent of the analysis)
+-	CreateElements(elements,md)
+-	CreateVertices(vertices,md)
+-	CreateParameters(parameters,md)
+-	CreateInputs(inputs,elements,md)
++	CreateElements(elements, md)
++	CreateVertices(vertices, md)
++	CreateParameters(parameters, md)
++	CreateInputs(inputs,elements, md)
++	if solutionstring=="TransientSolution"
++		UpdateParameters(TransientAnalysis(), parameters, md)
++	end
+ 
+ 	#Now create analysis specific data structure
+-	analysis = StressbalanceAnalysis()
+-	UpdateParameters(analysis,parameters,md)
+-	CreateNodes(analysis,nodes,md)
+-	UpdateElements(analysis,elements,inputs,md)
+-	CreateConstraints(analysis,constraints,md)
++	if solutionstring=="StressbalanceSolution"
++		analyses = [StressbalanceAnalysis()]
++	elseif solutionstring=="TransientSolution"
++		analyses = [StressbalanceAnalysis(), MasstransportAnalysis()]
++	else
++		error(solutionstring, " not supported by ModelProcessor")
++	end
+ 
+-	#Configure objects
+-	ConfigureObjectx(elements,nodes,vertices,parameters,inputs)
++	#Initialize analysis specific datasets
++	numanalyses = length(analyses)
++	nodes       = Vector{Vector{Node}}(undef,numanalyses)
++	constraints = Vector{Vector{Constraint}}(undef,numanalyses)
++	for i in 1:numanalyses
++		analysis = analyses[i]
++		println("   creating datasets for analysis ", typeof(analysis))
++		nodes[i]       = Vector{Node}(undef,0)
++		constraints[i] = Vector{Constraint}(undef,0)
+ 
+-	#Constrain and Number nodes
+-	SpcNodesx(nodes,constraints,parameters)
+-	NodesDofx(nodes,parameters)
++		UpdateParameters(analysis, parameters, md)
++		UpdateElements(analysis, elements, inputs, md)
++		CreateNodes(analysis, nodes[i], md)
++		CreateConstraints(analysis, constraints[i], md)
+ 
++		#Configure objects
++		ConfigureObjectx(elements, nodes[i], vertices, parameters, inputs, i)
++
++		#Constrain and Number nodes
++		SpcNodesx(nodes[i], constraints[i], parameters)
++		NodesDofx(nodes[i], parameters)
++	end
++
+ 	#Build FemModel
+-	return FemModel(elements, vertices, nodes, parameters, inputs, constraints, results)
++	return FemModel(analyses, elements, vertices,
++						 Vector{Node}(undef,0), nodes,
++						 parameters, inputs,
++						 Vector{Constraint}(undef,0), constraints,
++						 results)
+ end# }}}
+ function CreateElements(elements::Vector{Tria},md::model) #{{{
+ 
+@@ -43,9 +66,8 @@
+ 	#Make sure elements is currently empty
+ 	@assert length(elements)==0
+ 
+-	tempparams   = Parameters(Dict{IssmEnum,Parameter}())
+-	tempinputs   = Inputs(-1,-1,Dict{IssmEnum,Input}())
+ 
++
+ 	count = 0
+ 	for i in 1:md.mesh.numberofelements
+ 
+@@ -54,7 +76,7 @@
+ 		nodeids   = md.mesh.elements[i,:]
+ 
+ 		#Call constructor and add to dataset elements
+-		push!(elements,Tria(i,count,vertexids,Vector{Vertex}(undef,3),nodeids,Vector{Node}(undef,3),tempparams,tempinputs))
++		push!(elements,Tria(i,count, vertexids))
+ 	end
+ 
+ end# }}}
+@@ -84,6 +106,7 @@
+ 	#Set step and time, this will be overwritten if we run a transient
+ 	AddParam(parameters,1,StepEnum)
+ 	AddParam(parameters,0.0,TimeEnum)
++
+ end# }}}
+ function CreateInputs(inputs::Inputs,elements::Vector{Tria},md::model) #{{{
+ 
+@@ -103,10 +126,10 @@
+ end# }}}
+ 
+ #Other modules
+-function ConfigureObjectx(elements::Vector{Tria},nodes::Vector{Node},vertices::Vector{Vertex},parameters::Parameters,inputs::Inputs) #{{{
++function ConfigureObjectx(elements::Vector{Tria}, nodes::Vector{Node}, vertices::Vector{Vertex}, parameters::Parameters, inputs::Inputs, analysis::Int64) #{{{
+ 
+ 	for i in 1:length(elements)
+-		Configure(elements[i],nodes,vertices,parameters,inputs)
++		Configure(elements[i], nodes, vertices, parameters, inputs, analysis)
+ 	end
+ 
+ end# }}}
+Index: ../trunk-jpl/src/jl/core/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/solve.jl	(revision 26729)
++++ ../trunk-jpl/src/jl/core/solve.jl	(revision 26730)
+@@ -11,27 +11,34 @@
+ include("./results.jl")
+ include("./matice.jl")
+ include("./friction.jl")
++include("./analyses/analysis.jl")
+ include("./femmodel.jl")
+-include("./analyses/analysis.jl")
++
++#All analyses
+ include("./analyses/stressbalanceanalysis.jl")
++include("./analyses/masstransportanalysis.jl")
++include("./analyses/transientanalysis.jl")
++
+ include("./solutionsequences.jl")
+ include("./modules.jl")
+ include("./elementmatrix.jl")
+ include("./utils.jl")
+ 
+-function IssmCore(md::model) #{{{
++function IssmCore(md::model, solutionstring::String) #{{{
+ 
+-
+ 	#Construct FemModel
+-	femmodel=ModelProcessor(md)
++	femmodel=ModelProcessor(md, solutionstring)
+ 
+-	#Solve
+-	analysis = StressbalanceAnalysis()
++	#Solve FIXME: to be improved later...
++	if(solutionstring=="StressbalanceSolution")
++		analysis = StressbalanceAnalysis()
++	elseif (solutionstring=="TransientSolution")
++		analysis = TransientAnalysis()
++	else
++		error("not supported")
++	end
+ 	Core(analysis, femmodel)
+ 
+-	#Save output
+-	RequestedOutputsx(femmodel, [VxEnum,VyEnum,VelEnum])
+-
+ 	#move results to md
+ 	OutputResultsx(femmodel, md)
+ 
Index: /issm/oecreview/Archive/25834-26739/ISSM-26730-26731.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26730-26731.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26730-26731.diff	(revision 26740)
@@ -0,0 +1,468 @@
+Index: ../trunk-jpl/src/jl/core/solve.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/solve.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/solve.jl	(revision 26731)
+@@ -40,6 +40,6 @@
+ 	Core(analysis, femmodel)
+ 
+ 	#move results to md
+-	OutputResultsx(femmodel, md)
++	OutputResultsx(femmodel, md, solutionstring)
+ 
+ end# }}}
+Index: ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl	(revision 26731)
+@@ -37,6 +37,7 @@
+ 	FetchDataToInput(md,inputs,elements,md.geometry.base,BaseEnum)
+ 	FetchDataToInput(md,inputs,elements,md.basalforcings.groundedice_melting_rate./md.constants.yts,BasalforcingsGroundediceMeltingRateEnum)
+ 	FetchDataToInput(md,inputs,elements,md.basalforcings.floatingice_melting_rate./md.constants.yts,BasalforcingsFloatingiceMeltingRateEnum)
++	FetchDataToInput(md,inputs,elements,md.smb.mass_balance./md.constants.yts,SmbMassBalanceEnum)
+ 	FetchDataToInput(md,inputs,elements,md.mask.ice_levelset, MaskIceLevelsetEnum)
+ 	FetchDataToInput(md,inputs,elements,md.mask.ocean_levelset, MaskOceanLevelsetEnum)
+ 	FetchDataToInput(md,inputs,elements,md.initialization.vx./md.constants.yts,VxEnum)
+@@ -53,16 +54,21 @@
+ #Finite Element Analysis
+ function Core(analysis::MasstransportAnalysis,femmodel::FemModel)# {{{
+ 
+-	error("not supported yet")
++	println("   computing mass transport")
++	SetCurrentConfiguration!(femmodel, analysis)
+ 
++	InputDuplicatex(femmodel, ThicknessEnum, ThicknessOldEnum)
++	InputDuplicatex(femmodel, BaseEnum, BaseOldEnum)
++	InputDuplicatex(femmodel, SurfaceEnum, SurfaceOldEnum)
++
++	solutionsequence_linear(femmodel,analysis)
++
+ 	#Save output
+-	RequestedOutputsx(femmodel, [ThicknessEnum, SurfaceEnum, BedEnum])
++	RequestedOutputsx(femmodel, [ThicknessEnum, SurfaceEnum, BaseEnum])
+ 
+ end #}}}
+ function CreateKMatrix(analysis::MasstransportAnalysis,element::Tria)# {{{
+ 
+-	error("not supported")
+-
+ 	#Internmediaries
+ 	numnodes = 3
+ 	
+@@ -69,56 +75,59 @@
+ 	#Initialize Element matrix and basis function derivatives
+ 	Ke = ElementMatrix(element.nodes)
+ 	dbasis = Matrix{Float64}(undef,numnodes,2)
++	basis  = Vector{Float64}(undef,numnodes)
+ 
+ 	#Retrieve all inputs and parameters
+ 	xyz_list = GetVerticesCoordinates(element.vertices)
+-	H_input  = GetInput(element, ThicknessEnum)
++	vx_input      = GetInput(element, VxEnum)
++	vy_input      = GetInput(element, VyEnum)
++	dt            = FindParam(element, TimesteppingTimeStepEnum)
++	stabilization = FindParam(element, MasstransportStabilizationEnum)
+ 
+-	#Prepare material object
+-	material = Matice(element)
+-	
++	h = CharacteristicLength(element)
++
+ 	#Start integrating
+ 	gauss = GaussTria(2)
+ 	for ig in 1:gauss.numgauss
+ 
+ 		Jdet = JacobianDeterminant(xyz_list, gauss)
+-		NodalFunctionsDerivatives(element,dbasis,xyz_list,gauss)
++		NodalFunctionsDerivatives(element, dbasis, xyz_list, gauss)
++		NodalFunctions(element, basis, gauss, ig, P1Enum)
+ 
+-		H  = GetInputValue(H_input, gauss, ig)
+-		mu = ViscositySSA(material, xyz_list, gauss, ig)
+-
++      #Transient term
+ 		for i in 1:numnodes
+ 			for j in 1:numnodes
+-				Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,1]*dbasis[i,1] + dbasis[j,2]*dbasis[i,2])
+-				Ke.values[2*i-1,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,2]*dbasis[i,1] + dbasis[j,1]*dbasis[i,2])
+-				Ke.values[2*i  ,2*j-1] += gauss.weights[ig]*Jdet*mu*H*(2*dbasis[j,1]*dbasis[i,2] + dbasis[j,2]*dbasis[i,1])
+-				Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*mu*H*(4*dbasis[j,2]*dbasis[i,2] + dbasis[j,1]*dbasis[i,1])
++				Ke.values[i ,j] += gauss.weights[ig]*Jdet*basis[i]*basis[j]
+ 			end
+ 		end
+-	end
+ 
+-	#Add basal friction
+-	phi=GetGroundedPortion(element, xyz_list)
++      #Advection term
++		vx  = GetInputValue(vx_input, gauss, ig)
++      vy  = GetInputValue(vy_input, gauss, ig)
++		dvx = GetInputDerivativeValue(vx_input, xyz_list, gauss, ig)
++      dvy = GetInputDerivativeValue(vy_input, xyz_list, gauss, ig)
++      for i in 1:numnodes
++         for j in 1:numnodes
++            #\phi_i \phi_j \nabla\cdot v
++            Ke.values[i ,j] += dt*gauss.weights[ig]*Jdet*basis[i]*basis[j]*(dvx[1] + dvy[2])
++            #\phi_i v\cdot\nabla\phi_j
++            Ke.values[i ,j] += dt*gauss.weights[ig]*Jdet*basis[i]*(vx*dbasis[j,1] + vy*dbasis[j,2])
++         end
++      end
+ 
+-	if(phi>0)
+-		basis = Vector{Float64}(undef,numnodes)
+-		friction = CoreFriction(element)
+-
+-		#Start integrating
+-		gauss = GaussTria(2)
+-		for ig in 1:gauss.numgauss
+-
+-			Jdet = JacobianDeterminant(xyz_list, gauss)
+-			NodalFunctions(element, basis, gauss, ig, P1Enum)
+-
+-			alpha2 = Alpha2(friction, gauss, ig)
+-
+-			for i in 1:numnodes
+-				for j in 1:numnodes
+-					Ke.values[2*i-1,2*j-1] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
+-					Ke.values[2*i  ,2*j  ] += gauss.weights[ig]*Jdet*phi*alpha2*basis[i]*basis[j]
+-				end
+-			end
++		#Stabilization
++		if(stabilization==0)
++			#do nothing
++		elseif (stabilization==1)
++			vx = GetInputAverageValue(vx_input)
++			vy = GetInputAverageValue(vy_input)
++			D  = dt*gauss.weights[ig]*Jdet*[h/2*abs(vx) 0; 0 h/2*abs(vy)]
++			for i in 1:numnodes; for j in 1:numnodes
++					Ke.values[i ,j] += (dbasis[i,1]*(D[1,1]*dbasis[j,1] + D[1,2]*dbasis[j,2]) +
++											  dbasis[i,2]*(D[2,1]*dbasis[j,1] + D[2,2]*dbasis[j,2]))
++			end end
++		else
++			error("Stabilization ",stabilization, " not supported yet")
+ 		end
+ 	end
+ 
+@@ -126,8 +135,6 @@
+ end #}}}
+ function CreatePVector(analysis::MasstransportAnalysis,element::Tria)# {{{
+ 
+-	error("not supported")
+-
+ 	#Internmediaries
+ 	numnodes = 3
+ 
+@@ -137,57 +144,39 @@
+ 
+ 	#Retrieve all inputs and parameters
+ 	xyz_list = GetVerticesCoordinates(element.vertices)
+-	H_input  = GetInput(element, ThicknessEnum)
+-	s_input  = GetInput(element, SurfaceEnum)
+-	rho_ice  = FindParam(element, MaterialsRhoIceEnum)
+-	g        = FindParam(element, ConstantsGEnum)
++	H_input         = GetInput(element, ThicknessEnum)
++	gmb_input       = GetInput(element, BasalforcingsGroundediceMeltingRateEnum)
++	fmb_input       = GetInput(element, BasalforcingsFloatingiceMeltingRateEnum)
++   smb_input       = GetInput(element, SmbMassBalanceEnum)
++	olevelset_input = GetInput(element, MaskOceanLevelsetEnum)
++	dt            = FindParam(element, TimesteppingTimeStepEnum)
++	stabilization = FindParam(element, MasstransportStabilizationEnum)
+ 
++   #How much is actually grounded?
++	phi=GetGroundedPortion(element, xyz_list)
++
+ 	#Start integrating
+-	gauss = GaussTria(2)
++	gauss = GaussTria(3)
+ 	for ig in 1:gauss.numgauss
+ 
+ 		Jdet = JacobianDeterminant(xyz_list, gauss)
+ 		NodalFunctions(element, basis, gauss, ig, P1Enum)
+ 
+-		H  = GetInputValue(H_input, gauss, ig)
+-		ds = GetInputDerivativeValue(s_input, xyz_list, gauss, ig)
++		smb = GetInputValue(smb_input, gauss, ig)
++      H   = GetInputValue(H_input, gauss, ig)
+ 
++      #Only apply melt on fully floating cells
++      if(phi<0.00000001)
++         mb = GetInputValue(fmb_input, gauss, ig)
++      else
++         mb = GetInputValue(gmb_input, gauss, ig)
++      end
++
+ 		for i in 1:numnodes
+-			pe.values[2*i-1] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[1]*basis[i]
+-			pe.values[2*i  ] += -gauss.weights[ig]*Jdet*rho_ice*g*H*ds[2]*basis[i]
++         pe.values[i] += gauss.weights[ig]*Jdet*(H + dt*(smb - mb))*basis[i]
+ 		end
+ 	end
+ 
+-	if(IsIcefront(element))
+-
+-		#Get additional parameters and inputs
+-		b_input   = GetInput(element, BaseEnum)
+-		rho_water = FindParam(element, MaterialsRhoSeawaterEnum)
+-
+-		#Get normal and ice front coordinates
+-		xyz_list_front = Matrix{Float64}(undef,2,3)
+-		GetIcefrontCoordinates!(element, xyz_list_front, xyz_list, MaskIceLevelsetEnum)
+-		nx, ny = NormalSection(element, xyz_list_front)
+-
+-		gauss = GaussTria(element, xyz_list, xyz_list_front, 3)
+-		for ig in 1:gauss.numgauss
+-
+-			Jdet = JacobianDeterminantSurface(xyz_list_front, gauss)
+-			NodalFunctions(element, basis, gauss, ig, P1Enum)
+-
+-			H  = GetInputValue(H_input, gauss, ig)
+-			b  = GetInputValue(b_input, gauss, ig)
+-			sl = 0
+-
+-			term = 0.5*g*rho_ice*H^2 + 0.5*g*rho_water*(min(0, H+b-sl)^2 - min(0, b-sl)^2)
+-
+-			for i in 1:numnodes
+-				pe.values[2*i-1] += gauss.weights[ig]*Jdet*term*nx*basis[i]
+-				pe.values[2*i  ] += gauss.weights[ig]*Jdet*term*ny*basis[i]
+-			end
+-		end
+-	end
+-
+ 	return pe
+ end #}}}
+ function GetSolutionFromInputs(analysis::MasstransportAnalysis,ug::IssmVector,element::Tria) #{{{
+@@ -236,8 +225,8 @@
+ 		@assert isfinite(thickness[i])
+ 
+ 		#Enforce minimum thickness
+-		if(thickness[i]<min_thickness)
+-			thickness[i] = min_thickness
++		if(thickness[i]<H_min)
++			thickness[i] = H_min
+ 		end
+ 	end
+ 	AddInput(element, ThicknessEnum,  thickness,  P1Enum)
+@@ -254,6 +243,8 @@
+    GetInputListOnVertices!(element, oldsurface, SurfaceOldEnum)
+    GetInputListOnVertices!(element, phi, MaskOceanLevelsetEnum)
+    sealevel = zeros(3)
++	newsurface = Vector{Float64}(undef,3)
++	newbase    = Vector{Float64}(undef,3)
+ 
+    for i in 1:3
+       if(phi[i]>0.)
+Index: ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26731)
+@@ -81,6 +81,7 @@
+ 	abstol  = FindParam(femmodel.parameters,StressbalanceAbstolEnum)
+ 
+ 	#Call solution sequence to compute new speeds
++	println("   computing stress balance");
+ 	solutionsequence_nonlinear(femmodel,analysis,maxiter,restol,reltol,abstol)
+ 
+ 	#Save output
+Index: ../trunk-jpl/src/jl/core/analyses/transientanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/transientanalysis.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/analyses/transientanalysis.jl	(revision 26731)
+@@ -5,9 +5,9 @@
+ function UpdateParameters(analysis::TransientAnalysis,parameters::Parameters,md::model) #{{{
+ 
+ 	AddParam(parameters, md.constants.yts, ConstantsYtsEnum)
+-	AddParam(parameters, md.timestepping.start_time/md.constants.yts, TimeEnum)
+-	AddParam(parameters, md.timestepping.final_time/md.constants.yts, TimesteppingFinalTimeEnum)
+-	AddParam(parameters, md.timestepping.time_step/md.constants.yts,  TimesteppingTimeStepEnum)
++	AddParam(parameters, md.timestepping.start_time*md.constants.yts, TimeEnum)
++	AddParam(parameters, md.timestepping.final_time*md.constants.yts, TimesteppingFinalTimeEnum)
++	AddParam(parameters, md.timestepping.time_step*md.constants.yts,  TimesteppingTimeStepEnum)
+ 	AddParam(parameters, md.transient.isstressbalance, TransientIsstressbalanceEnum)
+ 	AddParam(parameters, md.transient.ismasstransport, TransientIsmasstransportEnum)
+ 
+@@ -25,14 +25,15 @@
+ 
+    while(time < finaltime - (yts*eps(Float64))) #make sure we run up to finaltime.
+ 
+-		step+=1
+ 		time+=dt
+-		AddParam(femmodel.parameters, time, TimeEnum);
+-		AddParam(femmodel.parameters, step, StepEnum);
+-      println("iteration ", step, "/", ceil((finaltime-time)/dt)+step," time [yr]: ", time/yts, " (time step: ",  dt/yts, ")")
++		AddParam(femmodel.parameters, time, TimeEnum)
++		AddParam(femmodel.parameters, step, StepEnum)
++		println("iteration ", step, "/", Int(ceil((finaltime-time)/dt))+step," time [yr]: ", time/yts, " (time step: ",  dt/yts, " [yr])")
+ 
+       if(isstressbalance) Core(StressbalanceAnalysis(), femmodel) end
+       if(ismasstransport) Core(MasstransportAnalysis(), femmodel) end
++
++		step+=1
+    end
+ 
+ end #}}}
+Index: ../trunk-jpl/src/jl/core/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/elements.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/elements.jl	(revision 26731)
+@@ -252,7 +252,11 @@
+ 
+ 	return nx, ny
+ end#}}}
++function CharacteristicLength(element::Tria) #{{{
+ 
++	return sqrt(2*GetArea(element))
++end#}}}
++
+ #Finite Element stuff
+ function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{
+ 
+Index: ../trunk-jpl/src/jl/core/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/inputs.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/inputs.jl	(revision 26731)
+@@ -96,7 +96,7 @@
+ 	#set value
+ 	input.values[indices] = values
+ end#}}}
+-function GetInputAverageValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
++function GetInputAverageValue(input::ElementInput) #{{{
+ 
+ 	numnodes = NumberofNodesTria(input.interp)
+ 	value = 0.0
+@@ -150,3 +150,13 @@
+ 	return dp
+ 
+ end#}}}
++function DuplicateInput(inputs::Inputs, old::IssmEnum, new::IssmEnum)#{{{
++
++	#Fetch input that needs to be copied
++	oldinput = inputs.lookup[old]
++
++	if typeof(oldinput)==ElementInput
++		inputs.lookup[new] = ElementInput(new, oldinput.interp, copy(oldinput.values), copy(oldinput.element_values))
++	end
++
++end#}}}
+Index: ../trunk-jpl/src/jl/core/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/modules.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/modules.jl	(revision 26731)
+@@ -114,15 +114,37 @@
+ 	FetchDataToInput(md,inputs,elements,md.materials.rheology_B,MaterialsRheologyBEnum)
+ 	FetchDataToInput(md,inputs,elements,md.materials.rheology_n,MaterialsRheologyNEnum)
+ end# }}}
+-function OutputResultsx(femmodel::FemModel, md::model)# {{{
++function OutputResultsx(femmodel::FemModel, md::model, solution::String)# {{{
+ 
+-	output = Dict()
+-	for i in length(femmodel.results)
+-		result = femmodel.results[i]
+-		output[EnumToString(result.enum)] = result.value
++
++	if solution=="TransientSolution"
++
++		#Compute maximum number of steps
++		maxstep = 0
++		for i in length(femmodel.results)
++			if(femmodel.results[i].step>maxstep) maxstep = femmodel.results[i].step end
++		end
++
++		#Initialize vector now that we know the size
++		output = Vector{Dict}(undef, maxstep)
++		for i in 1:maxstep; output[i] = Dict() end
++
++		#Insert results in vector
++		for i in 1:length(femmodel.results)
++			result = femmodel.results[i]
++			step   = femmodel.results[i].step
++			(output[step])[EnumToString(result.enum)] = result.value
++		end
++	else
++		output = Dict()
++		for i in length(femmodel.results)
++			result = femmodel.results[i]
++			output[EnumToString(result.enum)] = result.value
++		end
+ 	end
+-	md.results["Stressbalance"] = output
+ 
++	md.results[solution] = output
++
+ end# }}}
+ 
+ #Other modules
+@@ -182,6 +204,9 @@
+ 	return ug
+ 
+ end#}}}
++function InputDuplicatex(femmodel::FemModel, oldenum::IssmEnum, newenum::IssmEnum) #{{{
++	DuplicateInput(femmodel.inputs, oldenum, newenum)
++end#}}}
+ function Reducevectorgtofx(ug::IssmVector,nodes::Vector{Node}) #{{{
+ 
+ 	#Get size of output vector
+@@ -280,7 +305,7 @@
+ 			result = Result(outputlist[i], step, time, copy(input.values))
+ 
+ 			#Add to femmodel.results dataset
+-			push!(femmodel.results,result)
++			push!(femmodel.results, result)
+ 
+ 		else
+ 			println("Output ",outputlist[i]," not supported yet")
+Index: ../trunk-jpl/src/jl/core/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/solutionsequences.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/solutionsequences.jl	(revision 26731)
+@@ -1,3 +1,23 @@
++function solutionsequence_linear(femmodel::FemModel,analysis::Analysis) # {{{
++
++	#Get new matrices
++	Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
++
++	#Enforce constraints
++	ys = CreateNodalConstraintsx(femmodel.nodes)
++	Reduceloadx!(pf, Kfs, ys)
++
++	#Solve!
++	uf = Solverx(Kff, pf)
++
++	#Merge uf with ys and update inputs
++	gsize = NumberOfDofs(femmodel.nodes,GsetEnum)
++	ug = IssmVector(gsize)
++	Mergesolutionfromftogx(ug, uf, ys, femmodel.nodes)
++
++	InputUpdateFromSolutionx(analysis, ug, femmodel)
++
++end# }}}
+ function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
+ 
+ 	#Initialize number of iterations
+Index: ../trunk-jpl/src/jl/core/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/toolkits.jl	(revision 26730)
++++ ../trunk-jpl/src/jl/core/toolkits.jl	(revision 26731)
+@@ -124,10 +124,17 @@
+ 	y.vector = alpha*x.vector + y.vector
+ 
+ end#}}}
+-function Solverx(A::IssmMatrix,b::IssmVector,xold::IssmVector) #{{{
++function Solverx(A::IssmMatrix, b::IssmVector, xold::IssmVector) #{{{
+ 
+ 	#Initialize output
+ 	#x = IssmVector(GetSize(xold))
++	
++	return Solverx(A, b)
++
++end#}}}
++function Solverx(A::IssmMatrix, b::IssmVector) #{{{
++
++	#Initialize output
+ 	x = IssmVector(0)
+ 
+ 	#Solve linear system
+@@ -135,5 +142,4 @@
+ 
+ 	return x
+ 
+-
+ end#}}}
Index: /issm/oecreview/Archive/25834-26739/ISSM-26731-26732.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26731-26732.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26731-26732.diff	(revision 26740)
@@ -0,0 +1,2 @@
+Index: ../trunk-jpl/post-commit-mail-test
+===================================================================
Index: /issm/oecreview/Archive/25834-26739/ISSM-26736-26737.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26736-26737.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26736-26737.diff	(revision 26740)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/jl/usr/triangle.jl
+===================================================================
+--- ../trunk-jpl/src/jl/usr/triangle.jl	(revision 26736)
++++ ../trunk-jpl/src/jl/usr/triangle.jl	(revision 26737)
+@@ -7,7 +7,7 @@
+     pointmarkerlist :: Ptr{Cint}
+     numberofpoints :: Cint
+     numberofpointattributes :: Cint
+-    
++
+     trianglelist :: Ptr{Cint}
+     triangleattributelist :: Ptr{Cdouble}
+     trianglearealist :: Ptr{Cdouble}
+@@ -15,7 +15,7 @@
+     numberoftriangles :: Cint
+     numberofcorners :: Cint
+     numberoftriangleattributes :: Cint
+-    
++
+     segmentlist :: Ptr{Cint}
+     segmentmarkerlist :: Ptr{Cint}
+     numberofsegments :: Cint
+@@ -152,7 +152,7 @@
+ 	#Call triangle using ISSM's default options
+ 	triangle_switches = "pQzDq30ia"*@sprintf("%lf",area) #replace V by Q to quiet down the logging
+ 	#rc=ccall( (:triangulate,"libtriangle"),
+-	rc=ccall( (:triangulate,"../../externalpackages/triangle/src/libtriangle.dylib"),
++	rc=ccall( (:triangulate,issmdir()*"/externalpackages/triangle/src/libtriangle.dylib"),
+ 				Cint, ( Cstring, Ref{CTriangulateIO}, Ref{CTriangulateIO}, Ref{CTriangulateIO}),
+ 				triangle_switches, Ref(ctio_in), Ref(ctio_out), Ref(vor_out))
+ 
+@@ -160,7 +160,7 @@
+ 	points    = convert(Array{Cdouble,2}, Base.unsafe_wrap(Array, ctio_out.pointlist,    (2,Int(ctio_out.numberofpoints)), own=true))'
+ 	triangles = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.trianglelist, (3,Int(ctio_out.numberoftriangles)), own=true))' .+1
+ 	segments  = convert(Array{Cint,2},    Base.unsafe_wrap(Array, ctio_out.segmentlist,  (2,Int(ctio_out.numberofsegments)), own=true))' .+1
+-	
++
+ 	#assign output
+ 	md.mesh = Mesh2dTriangle()
+ 	md.mesh.numberofvertices = ctio_out.numberofpoints
Index: /issm/oecreview/Archive/25834-26739/ISSM-26737-26738.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26737-26738.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26737-26738.diff	(revision 26740)
@@ -0,0 +1,387 @@
+Index: ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl	(revision 26738)
+@@ -21,7 +21,7 @@
+ 
+ 	numdof = 1
+ 	for i in 1:md.mesh.numberofvertices
+-		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
++		push!(nodes,Node(i,i,true,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+ 	end
+ end#}}}
+ function UpdateElements(analysis::MasstransportAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+@@ -70,6 +70,9 @@
+ end #}}}
+ function CreateKMatrix(analysis::MasstransportAnalysis,element::Tria)# {{{
+ 
++	#Return if there is no ice in this element
++	if(!IsIceInElement(element)) return end
++
+ 	#Internmediaries
+ 	numnodes = 3
+ 	
+@@ -136,6 +139,9 @@
+ end #}}}
+ function CreatePVector(analysis::MasstransportAnalysis,element::Tria)# {{{
+ 
++	#Return if there is no ice in this element
++	if(!IsIceInElement(element)) return end
++
+ 	#Internmediaries
+ 	numnodes = 3
+ 
+@@ -264,3 +270,6 @@
+ 	AddInput(element, SurfaceEnum, newsurface, P1Enum)
+ 	AddInput(element, BaseEnum,    newbase,    P1Enum)
+ end#}}}
++function UpdateConstraints(analysis::MasstransportAnalysis, femmodel::FemModel) #{{{
++	SetActiveNodesLSMx(femmodel)
++end#}}}
+Index: ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl	(revision 26738)
+@@ -26,7 +26,7 @@
+ 
+ 	numdof = 2
+ 	for i in 1:md.mesh.numberofvertices
+-		push!(nodes,Node(i,i,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
++		push!(nodes,Node(i,i,true,true,numdof,-ones(Int64,numdof), ones(Int64,numdof), -ones(Int64,numdof), zeros(numdof)))
+ 	end
+ end#}}}
+ function UpdateElements(analysis::StressbalanceAnalysis,elements::Vector{Tria}, inputs::Inputs, md::model) #{{{
+@@ -90,6 +90,8 @@
+ end #}}}
+ function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{
+ 
++	if(!IsIceInElement(element)) return end
++
+ 	#Internmediaries
+ 	numnodes = 3
+ 	
+@@ -153,6 +155,8 @@
+ end #}}}
+ function CreatePVector(analysis::StressbalanceAnalysis,element::Tria)# {{{
+ 
++	if(!IsIceInElement(element)) return end
++
+ 	#Internmediaries
+ 	numnodes = 3
+ 
+@@ -270,3 +274,6 @@
+ 	AddInput(element, VyEnum,  vy,  P1Enum)
+ 	AddInput(element, VelEnum, vel, P1Enum)
+ end#}}}
++function UpdateConstraints(analysis::StressbalanceAnalysis, femmodel::FemModel) #{{{
++	SetActiveNodesLSMx(femmodel)
++end#}}}
+Index: ../trunk-jpl/src/jl/core/elements.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/elements.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/elements.jl	(revision 26738)
+@@ -45,6 +45,21 @@
+ 		error("interpolation ", interpolation, " not supported yet");
+ 	end
+ end #}}}
++function InputUpdateFromVector(element::Tria, vector::Vector{Float64}, enum::IssmEnum, layout::IssmEnum) #{{{
++
++	lidlist = element.vertexids
++	data = Vector{Float64}(undef, 3)
++
++	if(layout==VertexSIdEnum)
++		for i in 1:3
++			data[i] = vector[element.vertices[i].sid]
++			@assert isfinite(data[i])
++		end
++		SetTriaInput(element.inputs, enum, P1Enum, lidlist, data)
++	else
++		error("layout ", layout, " not supported yet");
++	end
++end #}}}
+ function Update(element::Tria, inputs::Inputs, index::Int64, md::model, finiteelement::IssmEnum) #{{{
+ 
+ 	if finiteelement==P1Enum
+@@ -109,6 +124,18 @@
+ 	return input
+ 
+ end # }}}
++function GetInputListOnNodes!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
++
++	#Get Input first 
++	input = GetInput(element, enum)
++
++	#Get value at each vertex (i.e. P1 Nodes)
++	gauss=GaussTria(P1Enum)
++	for i in 1:gauss.numgauss
++		vector[i] = GetInputValue(input, gauss, i)
++	end
++
++end # }}}
+ function GetInputListOnVertices!(element::Tria, vector::Vector{Float64}, enum::IssmEnum) # {{{
+ 
+ 	#Get Input first 
+@@ -196,6 +223,18 @@
+ 		return false
+ 	end
+ end#}}}
++function IsIceInElement(element::Tria) #{{{
++	#We consider that an element has ice if at least one of its nodes has a negative level set
++
++	input=GetInput(element, MaskIceLevelsetEnum)
++
++	if GetInputMin(input)<0
++		return true
++	else
++		return false
++	end
++
++end#}}}
+ function GetIcefrontCoordinates!(element::Tria, xyz_front::Matrix{Float64}, xyz_list::Matrix{Float64}, levelsetenum::IssmEnum) #{{{
+ 
+ 	#Intermediaries
+Index: ../trunk-jpl/src/jl/core/inputs.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/inputs.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/inputs.jl	(revision 26738)
+@@ -108,6 +108,11 @@
+ 	return value/numnodes
+ 
+ end#}}}
++function GetInputMin(input::ElementInput) #{{{
++
++	return minimum(input.element_values)
++
++end#}}}
+ function GetInputValue(input::ElementInput,gauss::GaussTria,i::Int64) #{{{
+ 
+ 	if input.interp==P0Enum
+Index: ../trunk-jpl/src/jl/core/modules.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/modules.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/modules.jl	(revision 26738)
+@@ -48,18 +48,20 @@
+ 
+ 		#Configure objects
+ 		ConfigureObjectx(elements, nodes[i], vertices, parameters, inputs, i)
+-
+-		#Constrain and Number nodes
+-		SpcNodesx(nodes[i], constraints[i], parameters)
+-		NodesDofx(nodes[i], parameters)
+ 	end
+ 
+ 	#Build FemModel
+-	return FemModel(analyses, elements, vertices,
+-						 Vector{Node}(undef,0), nodes,
+-						 parameters, inputs,
+-						 Vector{Constraint}(undef,0), constraints,
+-						 results)
++	femmodel = FemModel(analyses, elements, vertices,
++							  Vector{Node}(undef,0), nodes,
++							  parameters, inputs,
++							  Vector{Constraint}(undef,0), constraints,
++							  results)
++
++	println("      detecting active vertices")
++	GetMaskOfIceVerticesLSMx0(femmodel)
++
++	return femmodel
++
+ end# }}}
+ function CreateElements(elements::Vector{Tria},md::model) #{{{
+ 
+@@ -204,6 +206,14 @@
+ 	return ug
+ 
+ end#}}}
++function InputUpdateFromVectorx(femmodel::FemModel, vector::Vector{Float64}, enum::IssmEnum, layout::IssmEnum)
++
++	#Go through elements and plug in solution
++	for i=1:length(femmodel.elements)
++		InputUpdateFromVector(femmodel.elements[i], vector, enum, layout)
++	end
++
++end#}}}
+ function InputDuplicatex(femmodel::FemModel, oldenum::IssmEnum, newenum::IssmEnum) #{{{
+ 	DuplicateInput(femmodel.inputs, oldenum, newenum)
+ end#}}}
+@@ -265,8 +275,8 @@
+ 		Ke = CreateKMatrix(analysis,femmodel.elements[i])
+ 		pe = CreatePVector(analysis,femmodel.elements[i])
+ 
+-		AddToGlobal!(Ke,Kff,Kfs)
+-		AddToGlobal!(pe,pf)
++		if(!isnothing(Ke)) AddToGlobal!(Ke,Kff,Kfs) end
++		if(!isnothing(pe)) AddToGlobal!(pe,pf) end
+ 	end
+ 
+ 	Assemble!(Kff)
+@@ -319,3 +329,60 @@
+ 	end
+ 
+ end# }}}
++function UpdateConstraintsx(femmodel::FemModel, analysis::Analysis)# {{{
++
++	#First, see if the analysis needs to change constraints
++	UpdateConstraints(analysis, femmodel)
++
++	#Second, constraints might be time dependent
++	SpcNodesx(femmodel.nodes, femmodel.constraints, femmodel.parameters)
++
++	#Now, update degrees of freedoms
++	NodesDofx(femmodel.nodes, femmodel.parameters)
++
++end# }}}
++function SetActiveNodesLSMx(femmodel::FemModel) #{{{
++
++	#Check mask of each element to see if element is active
++	numnodes = 3
++	mask = Vector{Float64}(undef, numnodes)
++	for i in 1:length(femmodel.elements)
++		GetInputListOnNodes!(femmodel.elements[i], mask, IceMaskNodeActivationEnum)
++		for j in 1:numnodes
++			node = femmodel.elements[i].nodes[j]
++			if(mask[j]==1.) Activate!(node)
++			else             Deactivate!(node)
++			end
++		end
++
++	end
++end#}}}
++function GetMaskOfIceVerticesLSMx0(femmodel::FemModel) #{{{
++
++	#Initialize vector with number of vertices
++	numvertices=length(femmodel.vertices)
++   if(numvertices==0) return end
++
++	#Initialize vector
++	nbv = 3
++	onesvec      = ones(nbv)
++	vec_mask_ice = IssmVector(numvertices)
++	vertexids    = Vector{Int64}(undef, nbv)
++
++	#Assign values to vector
++	for i in 1:length(femmodel.elements)
++		if (IsIceInElement(femmodel.elements[i]))
++			for j in 1:nbv
++				vertexids[j] = femmodel.elements[i].vertices[j].sid
++			end
++			SetValues!(vec_mask_ice, nbv, vertexids, onesvec)
++		end
++	end
++	Assemble!(vec_mask_ice)
++
++	#Serialize vector
++	vec_mask_ice_serial = ToSerial(vec_mask_ice)
++
++	#Update IceMaskNodeActivationEnum in elements
++	InputUpdateFromVectorx(femmodel, vec_mask_ice_serial, IceMaskNodeActivationEnum, VertexSIdEnum)
++end#}}}
+Index: ../trunk-jpl/src/jl/core/nodes.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/nodes.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/nodes.jl	(revision 26738)
+@@ -3,6 +3,7 @@
+ 	id::Int64
+ 	sid::Int64
+ 	indexingupdate::Bool
++	active::Bool
+ 	gsize::Int64
+ 	gdoflist::Vector{Int64}
+ 	fdoflist::Vector{Int64}
+@@ -23,6 +24,32 @@
+ 	println(io,"   sdoflist: ",this.sdoflist)
+ 	println(io,"   svalues: ",this.svalues)
+ end# }}}
++function Activate!(node::Node) #{{{
++
++	if(!node.active)
++		node.indexingupdate = true
++		node.active = true
++		for i in 1:node.gsize
++			node.fdoflist[i]  = +1
++			node.sdoflist[i]  = -1
++			node.svalues[i]   = 0.0
++		end
++	end
++
++end# }}}
++function Deactivate!(node::Node) #{{{
++
++	if(node.active)
++		node.indexingupdate = true
++		node.active = false
++		for i in 1:node.gsize
++			node.fdoflist[i]  = -1
++			node.sdoflist[i]  = +1
++			node.svalues[i]   = 0.0
++		end
++	end
++
++end# }}}
+ function ApplyConstraint(node::Node,dof::Int8,value::Float64) #{{{
+ 
+ 	node.indexingupdate = true
+@@ -41,12 +68,12 @@
+ function DistributeDofs(node::Node,setenum::IssmEnum,dofcount::Int64) #{{{
+ 
+ 	if setenum==GsetEnum
+-		for i=1:node.gsize
++		for i in 1:node.gsize
+ 			node.gdoflist[i] = dofcount
+ 			dofcount += 1
+ 		end
+ 	elseif setenum==FsetEnum
+-		for i=1:node.gsize
++		for i in 1:node.gsize
+ 			if  node.fdoflist[i]!=-1
+ 				@assert node.sdoflist[i]==-1
+ 				node.fdoflist[i] = dofcount
+@@ -54,7 +81,7 @@
+ 			end
+ 		end
+ 	elseif setenum==SsetEnum
+-		for i=1:node.gsize
++		for i in 1:node.gsize
+ 			if  node.sdoflist[i]!=-1
+ 				@assert node.fdoflist[i]==-1
+ 				node.sdoflist[i] = dofcount
+Index: ../trunk-jpl/src/jl/core/solutionsequences.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/solutionsequences.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/solutionsequences.jl	(revision 26738)
+@@ -1,5 +1,8 @@
+ function solutionsequence_linear(femmodel::FemModel,analysis::Analysis) # {{{
+ 
++	#First, update constraints in case the levelset has changed
++	UpdateConstraintsx(femmodel, analysis)
++
+ 	#Get new matrices
+ 	Kff, Kfs, pf = SystemMatricesx(femmodel,analysis)
+ 
+@@ -20,6 +23,9 @@
+ end# }}}
+ function solutionsequence_nonlinear(femmodel::FemModel,analysis::Analysis,maxiter::Int64,restol::Float64,reltol::Float64,abstol::Float64) # {{{
+ 
++	#First, update constraints in case the levelset has changed
++	UpdateConstraintsx(femmodel, analysis)
++
+ 	#Initialize number of iterations
+ 	count = 0
+ 	converged = false
+Index: ../trunk-jpl/src/jl/core/toolkits.jl
+===================================================================
+--- ../trunk-jpl/src/jl/core/toolkits.jl	(revision 26737)
++++ ../trunk-jpl/src/jl/core/toolkits.jl	(revision 26738)
+@@ -91,6 +91,11 @@
+ 	#Nothing to do for this toolkit
+ 
+ end#}}}
++function ToSerial(vector::IssmVector)#{{{
++
++	return vector.vector
++
++end#}}}
+ function Norm(x::IssmVector,type::Int64)#{{{
+ 
+ 	norm = 0
Index: /issm/oecreview/Archive/25834-26739/ISSM-26738-26739.diff
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-26738-26739.diff	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-26738-26739.diff	(revision 26740)
@@ -0,0 +1,62 @@
+Index: ../trunk-jpl/test/NightlyRun/test4003.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26738)
++++ ../trunk-jpl/test/NightlyRun/test4003.m	(revision 26739)
+@@ -3,12 +3,12 @@
+ %
+ %Script control parameters
+ steps=1:11;
+-steps=[1:3 6:11];
++%steps=[1:3 6:11];
+ 
+ %To download and recompile MITgcm from scratch:
+-%!rm -rf ${ISSM_DIR}/test/MITgcm/install
+-%!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
+-%!rm -rf Models
++!rm -rf ${ISSM_DIR}/test/MITgcm/install
++!rm -rf ${ISSM_DIR}/test/MITgcm/build/*
++!rm -rf Models
+ 
+ %Organizer
+ !mkdir Models
+@@ -272,11 +272,11 @@
+     md.geometry.base(pos)=-di*md.geometry.thickness(pos);
+ 
+     %level sets:
+-    md.mask.ocean_levelset=iceshelf_mask(:);
+-    md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
++    md.mask.ice_levelset=iceshelf_mask(:);
++    pos=find(md.mask.ice_levelset==1); md.mask.ice_levelset(pos)=-1;
++    pos=find(md.mask.ice_levelset==0); md.mask.ice_levelset(pos)=1;
++    md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1);
+ 
+-    pos=find(~ice_mask(:) & thickness(:)==0); md.mask.ice_levelset(pos)=1;
+-
+     savemodel(org,md);
+ 
+ end
+@@ -323,12 +323,12 @@
+ 	%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;
++	md.stressbalance.spcvy(pos)=800;
++	md.stressbalance.spcvx(pos)=0;
+ 
+ 	%deal with boundaries, excluding icefront:
+ 	pos=find(md.mesh.long==min(md.mesh.long) | md.mesh.long==max(md.mesh.long));
+-	md.stressbalance.spcvy(pos)=0;
++	md.stressbalance.spcvx(pos)=0;
+ 
+ 	point1=find(md.mesh.y==min(md.mesh.y)); point2=find(md.mesh.x==max(md.mesh.x));
+ 	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);
+@@ -361,7 +361,7 @@
+ 	md.groundingline.migration='SubelementMigration';
+ 	md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating';
+ 	md.groundingline.friction_interpolation='SubelementFriction2';
+-	md.masstransport.stabilization=0;
++	md.masstransport.stabilization=1;
+ 
+ 	md.cluster=generic('name',oshostname(),'np',2);
+ 	md=solve(md,'Transient');
Index: /issm/oecreview/Archive/25834-26739/ISSM-DocReview-25834-26739.tex
===================================================================
--- /issm/oecreview/Archive/25834-26739/ISSM-DocReview-25834-26739.tex	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/ISSM-DocReview-25834-26739.tex	(revision 26740)
@@ -0,0 +1,67 @@
+\documentclass[]{report}   % list options between brackets
+\usepackage{graphicx}              % list packages between braces
+
+% type user-defined commands here
+
+\begin{document}
+
+\title{JPL EXPORT ADMINISTRATION \\ DOCUMENT REVIEW RECORD}   % type title between braces
+\author{Tom Scavo}         % type author(s) between braces
+\date{October 27, 1995}    % type date between braces
+%\maketitle
+
+
+\begin{center}
+\begin{tabular}{ |c|c| }
+\hline
+JPL EXPORT ADMINISTRATION \\
+\textit{ DOCUMENT REVIEW RECORD} \\
+\hline
+\end{tabular}
+\end{center}
+
+\hfill Log \#: \underline{\input{LogNumber}}
+
+\vspace{1cm}
+\noindent (Note: This form and process do not replace the procedures described in JPL Policy relating to review and approval of proposals and contractual 
+documents. This process is intended to document the review and coordination of requests to ascertain the export control ramifications relating to specific 
+documents. Export Administration signature does not convey authority to export or release the "Exporter of Record" from any export laws or regulations.)\\
+
+\noindent \textbf{Program:} \underline{ISSM: Ice Sheet System Model} \\ \\
+\noindent \textbf{Person Requesting or Initiating Export}: \underline{Dr. Eric Larour}\\ \\
+\noindent \textbf{Date Received}: \underline{\input{Date}}\\ \\
+\noindent \textbf{Document Title/Description}: ISSM changes from revision \input{r1} to revision \input{r2} \\ \\
+\noindent \textbf{Release to:} \underline{http://issm.ess.uci.edu/svn/issm/issm/trunk on ISSM svn repository}\\ \\
+\noindent \textbf{JPL Intranet:} \underline{murdo.jpl.nasa.gov/proj/ice/larour/issm-uci/trunk-jpl}\\ \\
+
+\noindent \textbf{Disposition: 6 } 
+Does not contain export-controlled information. May be released/disclosed as requested subject to 
+Company guidelines on protection of proprietary information (if applicable). \\
+
+\noindent \textbf{Comments:}  see table of changes below. \\ \\
+\noindent \textbf{Reviewed by ISSM Export Transfer Liaison:} Dr. Eric Larour \hfill \textbf{Date:} \input{Date} \\ 
+\includegraphics[scale=1]{signature}
+
+\noindent JPL Export Administration Form TBS – June 29, 2011
+
+\begin{center}
+\line(1,0){250}
+\end{center}
+
+\noindent \textbf{Disposition:} \\
+1:	  Public Domain Information (Ref ITAR Section 120.11) \\
+2:	  Qualifies for ITAR Exemption				 \\
+3:	  Covered by Department of State License/Agreement Number					  \\
+4:	  Covered by Department of Commerce validated license or exception				 \\
+5:	  New License Required \\
+6:	  Does not contain export-controlled information.  May be released/disclosed as requested subject
+   to Company guidelines on protection of proprietary information (if applicable). \\
+7:	 Other (specify)   
+\begin{center}
+\line(1,0){250}
+\end{center}
+
+
+\input{log}
+
+\end{document}
Index: /issm/oecreview/Archive/25834-26739/LogNumber.tex
===================================================================
--- /issm/oecreview/Archive/25834-26739/LogNumber.tex	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/LogNumber.tex	(revision 26740)
@@ -0,0 +1,1 @@
+25834-26739
Index: /issm/oecreview/Archive/25834-26739/Makefile
===================================================================
--- /issm/oecreview/Archive/25834-26739/Makefile	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/Makefile	(revision 26740)
@@ -0,0 +1,8 @@
+TARGET=ISSM-DocReview-25834-26739
+
+all: 
+	pdflatex -interaction=errorstopmode -file-line-error -halt-on-error $(TARGET).tex
+	rm -rf *.log *.aux 
+
+clean:
+	rm -rf *.log *.aux
Index: /issm/oecreview/Archive/25834-26739/log.tex
===================================================================
--- /issm/oecreview/Archive/25834-26739/log.tex	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/log.tex	(revision 26740)
@@ -0,0 +1,6286 @@
+\noindent \textbf{Change \#1} with diff file ISSM-25835-25836.diff: \\
+Function name: \\
+M /issm/trunk-jpl\\
+Export determination: 6. \\
+Rationale: merged trunk and trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#2} with diff file ISSM-25837-25838.diff: \\
+Function name: \\
+M /issm/trunk-jpl M /issm/trunk-jpl/src M /issm/trunk-jpl/test\\
+Export determination: 6. \\
+Rationale: Block revision 25836 from being merged into trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#3} with diff file ISSM-25838-25839.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: CHG: updated version number\\
+\vspace{3em}
+
+\noindent \textbf{Change \#4} with diff file ISSM-25839-25840.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/cores/movingfront\_core.cpp M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/test/Archives/Archive540.arch M /issm/trunk-jpl/test/Archives/Archive541.arch M /issm/trunk-jpl/test/Archives/Archive804.arch M /issm/trunk-jpl/test/Archives/Archive805.arch M /issm/trunk-jpl/test/NightlyRun/test540.m M /issm/trunk-jpl/test/NightlyRun/test541.m M /issm/trunk-jpl/test/NightlyRun/test804.m M /issm/trunk-jpl/test/NightlyRun/test805.m M /issm/trunk-jpl/test/NightlyRun/test806.m M /issm/trunk-jpl/test/NightlyRun/test808.m M /issm/trunk-jpl/test/NightlyRun/test809.m\\
+Export determination: 6. \\
+Rationale: CHG: move the calving laws out from LevelsetAnalysis. The advection velocity in LevelsetAnalysis is now defined by MovingFrontalVxEnum and MovingFrontalVyEnum.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#5} with diff file ISSM-25840-25841.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/modules/Calvingx/Calvingx.cpp M /issm/trunk-jpl/src/c/modules/Calvingx/Calvingx.h M /issm/trunk-jpl/src/c/modules/modules.h\\
+Export determination: 6. \\
+Rationale: BUG: fixed compilation error after updating\\
+\vspace{3em}
+
+\noindent \textbf{Change \#6} with diff file ISSM-25841-25842.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind D /issm/trunk-jpl/jenkins/ross-debian\_linux-trunk M /issm/trunk-jpl/test/NightlyRun/test540.py M /issm/trunk-jpl/test/NightlyRun/test541.py M /issm/trunk-jpl/test/NightlyRun/test804.py M /issm/trunk-jpl/test/NightlyRun/test805.py M /issm/trunk-jpl/test/NightlyRun/test806.py M /issm/trunk-jpl/test/NightlyRun/test808.py A /issm/trunk-jpl/test/NightlyRun/test809.py (from /issm/trunk-jpl/test/NightlyRun/test808.py:25839)\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python; missing comment char; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#7} with diff file ISSM-25842-25843.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/levelset.m\\
+Export determination: 6. \\
+Rationale: CHG: change the default maximum migration rate in the levelset function to be 1e12, instead of 3000 for VM and none for the rest.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#8} with diff file ISSM-25843-25844.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/levelset.py\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#9} with diff file ISSM-25844-25845.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/calving.py A /issm/trunk-jpl/src/m/classes/calvingcrevassedepth.py\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#10} with diff file ISSM-25845-25846.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test809.py\\
+Export determination: 6. \\
+Rationale: BUG: Index offset\\
+\vspace{3em}
+
+\noindent \textbf{Change \#11} with diff file ISSM-25846-25847.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with\_tests.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with\_tests.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-with\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#12} with diff file ISSM-25847-25848.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: Added constant to easily redefine path to external packages\\
+\vspace{3em}
+
+\noindent \textbf{Change \#13} with diff file ISSM-25848-25849.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test905.m\\
+Export determination: 6. \\
+Rationale: CHG: removing output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#14} with diff file ISSM-25849-25850.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: Minor path and documentation corrections\\
+\vspace{3em}
+
+\noindent \textbf{Change \#15} with diff file ISSM-25850-25851.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test350.py\\
+Export determination: 6. \\
+Rationale: BUG: oshostname include\\
+\vspace{3em}
+
+\noindent \textbf{Change \#16} with diff file ISSM-25851-25852.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp M /issm/trunk-jpl/test/Archives/Archive243.arch M /issm/trunk-jpl/test/Archives/Archive244.arch M /issm/trunk-jpl/test/Archives/Archive252.arch M /issm/trunk-jpl/test/Archives/Archive253.arch\\
+Export determination: 6. \\
+Rationale: CHG: rework on GEMB grain growth\\
+\vspace{3em}
+
+\noindent \textbf{Change \#17} with diff file ISSM-25852-25853.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh\\
+Export determination: 6. \\
+Rationale: CHG: for csh use set for ISSM EXT DIR\\
+\vspace{3em}
+
+\noindent \textbf{Change \#18} with diff file ISSM-25853-25854.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test243.m M /issm/trunk-jpl/test/NightlyRun/test243.py M /issm/trunk-jpl/test/NightlyRun/test252.m M /issm/trunk-jpl/test/NightlyRun/test252.py\\
+Export determination: 6. \\
+Rationale: CHG: update some tols for GEMB\\
+\vspace{3em}
+
+\noindent \textbf{Change \#19} with diff file ISSM-25854-25855.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: schoof inversion HO and FS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#20} with diff file ISSM-25855-25856.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/chaco/install-mac-sierra.sh (from /issm/trunk-jpl/externalpackages/chaco/install-macosx64-sierra.sh:25854) D /issm/trunk-jpl/externalpackages/chaco/install-macosx64-sierra.sh D /issm/trunk-jpl/externalpackages/chaco/install-macosx64.sh M /issm/trunk-jpl/externalpackages/chaco/install.sh A /issm/trunk-jpl/externalpackages/chaco/patches/Makefile.mac-sierra.patch (from /issm/trunk-jpl/externalpackages/chaco/patches/Makefile.macosx64-sierra.patch:25854) D /issm/trunk-jpl/externalpackages/chaco/patches/Makefile.macosx64-sierra.patch\\
+Export determination: 6. \\
+Rationale: CHG: Applying path to Mac config; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#21} with diff file ISSM-25856-25857.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh M /issm/trunk-jpl/externalpackages/gmt/install-6-mac-static.sh\\
+Export determination: 6. \\
+Rationale: CHG: Fix for GMT on macOS binaries\\
+\vspace{3em}
+
+\noindent \textbf{Change \#22} with diff file ISSM-25857-25858.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: Fix for GMT on macOS binaries\\
+\vspace{3em}
+
+\noindent \textbf{Change \#23} with diff file ISSM-25858-25859.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: Converting find -> ls to avoid warnings under zsh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#24} with diff file ISSM-25859-25860.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: Silencing no matches under zsh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#25} with diff file ISSM-25860-25861.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install.sh M /issm/trunk-jpl/externalpackages/boost/install-1.7-linux-static.sh M /issm/trunk-jpl/externalpackages/boost/install-1.7-linux-valgrind.sh M /issm/trunk-jpl/externalpackages/boost/install-1.7-linux.sh M /issm/trunk-jpl/externalpackages/boost/install-1.7-mac-static.sh M /issm/trunk-jpl/externalpackages/boost/install-1.7-mac.sh M /issm/trunk-jpl/externalpackages/chaco/install.sh M /issm/trunk-jpl/externalpackages/cmake/install.sh M /issm/trunk-jpl/externalpackages/curl/install-7-linux-static.sh M /issm/trunk-jpl/externalpackages/curl/install-7-linux-with\_tests.sh M /issm/trunk-jpl/externalpackages/curl/install-7-linux.sh M /issm/trunk-jpl/externalpackages/curl/install-7-mac-static.sh M /issm/trunk-jpl/externalpackages/curl/install-7-mac.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh D /issm/trunk-jpl/externalpackages/gdal/install-3-netcdf-static.sh D /issm/trunk-jpl/externalpackages/gdal/install-3-netcdf.sh D /issm/trunk-jpl/externalpackages/gdal/install-3-python-netcdf-static.sh D /issm/trunk-jpl/externalpackages/gdal/install-3-python-netcdf.sh A /issm/trunk-jpl/externalpackages/gdal/install-3-python-static.sh (from /issm/trunk-jpl/externalpackages/gdal/install-3-python-netcdf-static.sh:25859) M /issm/trunk-jpl/externalpackages/gdal/install-3-python.sh A /issm/trunk-jpl/externalpackages/gdal/install-3-static.sh (from /issm/trunk-jpl/externalpackages/gdal/install-3-netcdf-static.sh:25859) M /issm/trunk-jpl/externalpackages/gdal/install-3.sh D /issm/trunk-jpl/externalpackages/gmsh/configs/4.5.6/mac D /issm/trunk-jpl/externalpackages/gmsh/configs/4.7.0/mac D /issm/trunk-jpl/externalpackages/gmsh/install-4-linux-python-static.sh D /issm/trunk-jpl/externalpackages/gmsh/install-4-linux-static.sh D /issm/trunk-jpl/externalpackages/gmsh/install-4-mac-python-static.sh D /issm/trunk-jpl/externalpackages/gmsh/install-4-mac-static.sh A /issm/trunk-jpl/externalpackages/gmsh/install-4-static.sh (from /issm/trunk-jpl/externalpackages/gmsh/install-4-mac-static.sh:25854) M /issm/trunk-jpl/externalpackages/gmsh/install-4.sh D /issm/trunk-jpl/externalpackages/gmsh/install-mac-precompiled.sh D /issm/trunk-jpl/externalpackages/gmsh/install-win64-precompiled.sh M /issm/trunk-jpl/externalpackages/gmt/configs/6/cmake/ConfigUser.cmake M /issm/trunk-jpl/externalpackages/gmt/install-6-linux-static.sh M /issm/trunk-jpl/externalpackages/gmt/install-6-linux.sh M /issm/trunk-jpl/externalpackages/gmt/install-6-mac.sh D /issm/trunk-jpl/externalpackages/gmt/install-mac-precompiled.sh D /issm/trunk-jpl/externalpackages/gmt/install-win64-precompiled.sh M /issm/trunk-jpl/externalpackages/gshhg/install.sh M /issm/trunk-jpl/externalpackages/gsl/install-javascript.sh M /issm/trunk-jpl/externalpackages/gsl/install-static.sh M /issm/trunk-jpl/externalpackages/gsl/install.sh M /issm/trunk-jpl/externalpackages/m1qn3/install.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with\_tests.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with\_tests.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7-with\_tests.sh M /issm/trunk-jpl/externalpackages/netcdf/install-4.7.sh D /issm/trunk-jpl/externalpackages/petsc/install-3.12-linux-solid\_earth-static.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-linux.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-mac.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2-static-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2-static.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2.sh D /issm/trunk-jpl/externalpackages/proj/install.sh A /issm/trunk-jpl/externalpackages/semic/configs A /issm/trunk-jpl/externalpackages/semic/configs/surface\_physics.f90.patch (from /issm/trunk-jpl/externalpackages/semic/surface\_physics.f90.patch:25859) M /issm/trunk-jpl/externalpackages/semic/install.sh D /issm/trunk-jpl/externalpackages/semic/surface\_physics.f90.patch M /issm/trunk-jpl/externalpackages/triangle/install-linux-javascript.sh M /issm/trunk-jpl/externalpackages/triangle/install-linux-static.sh M /issm/trunk-jpl/externalpackages/triangle/install-linux.sh M /issm/trunk-jpl/externalpackages/triangle/install-mac-static.sh M /issm/trunk-jpl/externalpackages/triangle/install-mac.sh M /issm/trunk-jpl/externalpackages/triangle/makefile M /issm/trunk-jpl/externalpackages/valgrind/install-mac.sh M /issm/trunk-jpl/jenkins/aws-amazon\_linux-solid\_earth M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-matlab M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-python M /issm/trunk-jpl/jenkins/pine\_island-mac-dakota M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind M /issm/trunk-jpl/jenkins/pine\_island-mac-python M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-matlab M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-dakota M /issm/trunk-jpl/jenkins/ross-debian\_linux-full M /issm/trunk-jpl/jenkins/ross-debian\_linux-full-valgrind M /issm/trunk-jpl/jenkins/ross-debian\_linux-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth M /issm/trunk-jpl/src/m/coordsystems/gmtmask.m M /issm/trunk-jpl/src/m/coordsystems/gmtmask.py M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m\\
+Export determination: 6. \\
+Rationale: CHG: Simplification of installation script customization needs: should be able to simply set PREFIX in most cases\\
+\vspace{3em}
+
+\noindent \textbf{Change \#26} with diff file ISSM-25861-25862.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle/configs/makefile M /issm/trunk-jpl/externalpackages/triangle/install-linux-static.sh M /issm/trunk-jpl/externalpackages/triangle/install-linux.sh\\
+Export determination: 6. \\
+Rationale: BUG: Bad copy/paste\\
+\vspace{3em}
+
+\noindent \textbf{Change \#27} with diff file ISSM-25862-25863.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/ross-debian\_linux-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: BUG: Path to Gmsh install script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#28} with diff file ISSM-25863-25864.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle/install-linux-javascript.sh\\
+Export determination: 6. \\
+Rationale: BUG: Unbound var\\
+\vspace{3em}
+
+\noindent \textbf{Change \#29} with diff file ISSM-25864-25865.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle/install-linux-javascript.sh\\
+Export determination: 6. \\
+Rationale: BUG: fixing prefix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#30} with diff file ISSM-25865-25866.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/ross-debian\_linux-javascript\\
+Export determination: 6. \\
+Rationale: BUG: Paths to GSL and Triangle\\
+\vspace{3em}
+
+\noindent \textbf{Change \#31} with diff file ISSM-25866-25867.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: Path to Gmsh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#32} with diff file ISSM-25868-25869.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh M /issm/trunk-jpl/externalpackages/curl/install-7-linux-static.sh M /issm/trunk-jpl/externalpackages/curl/install-7-linux-with\_tests.sh M /issm/trunk-jpl/externalpackages/curl/install-7-linux.sh M /issm/trunk-jpl/externalpackages/curl/install-7-mac-static.sh M /issm/trunk-jpl/externalpackages/curl/install-7-mac.sh M /issm/trunk-jpl/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake M /issm/trunk-jpl/externalpackages/gmt/install-6-mac-static.sh\\
+Export determination: 6. \\
+Rationale: BUG: Fix for cURL + GMT on macOS binaries\\
+\vspace{3em}
+
+\noindent \textbf{Change \#33} with diff file ISSM-25869-25870.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/masstransport.m M /issm/trunk-jpl/src/m/classes/masstransport.py\\
+Export determination: 6. \\
+Rationale: CHG: updating description of the stabilization schemes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#34} with diff file ISSM-25870-25871.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.js M /issm/trunk-jpl/src/m/classes/damage.m M /issm/trunk-jpl/src/m/classes/damage.py M /issm/trunk-jpl/src/m/classes/masstransport.js\\
+Export determination: 6. \\
+Rationale: CHG: updating stabilization scheme names\\
+\vspace{3em}
+
+\noindent \textbf{Change \#35} with diff file ISSM-25871-25872.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m\\
+Export determination: 6. \\
+Rationale: CHG: updating greenplanet class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#36} with diff file ISSM-25872-25873.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#37} with diff file ISSM-25873-25874.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: BUG: Need special handling of svn calls in the context of the Jenkins ‘Execute shell’\\
+\vspace{3em}
+
+\noindent \textbf{Change \#38} with diff file ISSM-25874-25875.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: Refinement of macOS packaging and signing scripts\\
+\vspace{3em}
+
+\noindent \textbf{Change \#39} with diff file ISSM-25875-25876.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: Refinement of macOS Binaries packaging and signing scripts (again)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#40} with diff file ISSM-25876-25877.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch M /issm/trunk-jpl/externalpackages/dakota/configs/6.2/CMakeLists.txt.pfe.patch M /issm/trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh M /issm/trunk-jpl/externalpackages/triangle/install-pleiades.sh M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: install scripts for pfe dakota with newest pfe configuration\\
+\vspace{3em}
+
+\noindent \textbf{Change \#41} with diff file ISSM-25877-25878.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Need to update MATLAB licenses (temp change to get builds green again)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#42} with diff file ISSM-25878-25879.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: BUG: Bad commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#43} with diff file ISSM-25879-25880.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: More adjustments to macOS packaging scripts\\
+\vspace{3em}
+
+\noindent \textbf{Change \#44} with diff file ISSM-25880-25881.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: Adding multiple attempts to SVN checkout/commit as JPL firewalls block SSL connections intermittently\\
+\vspace{3em}
+
+\noindent \textbf{Change \#45} with diff file ISSM-25881-25882.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-python\\
+Export determination: 6. \\
+Rationale: BUG: Path to GDAL install script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#46} with diff file ISSM-25882-25883.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#47} with diff file ISSM-25883-25884.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/movingfront\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: do not save by default IceMaskNodeActivationEnum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#48} with diff file ISSM-25884-25885.diff: \\
+Function name: \\
+A /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-matlab.sh A /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh A /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: CHG: Split macOS packaging into multiple scripts\\
+\vspace{3em}
+
+\noindent \textbf{Change \#49} with diff file ISSM-25885-25886.diff: \\
+Function name: \\
+D /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-matlab.sh D /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh D /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: BUG: Bad permissions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#50} with diff file ISSM-25886-25887.diff: \\
+Function name: \\
+A /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-matlab.sh A /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh A /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: BUG: Bad permissions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#51} with diff file ISSM-25887-25888.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: BUG: Need to export credentials from execute shell block\\
+\vspace{3em}
+
+\noindent \textbf{Change \#52} with diff file ISSM-25888-25889.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: CHG: Testing availability of credentials env vars\\
+\vspace{3em}
+
+\noindent \textbf{Change \#53} with diff file ISSM-25889-25890.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: CHG: Trying another method for accessing credentials env vars in called scripts\\
+\vspace{3em}
+
+\noindent \textbf{Change \#54} with diff file ISSM-25890-25891.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: BUG: Credentials are not stored after checkout\\
+\vspace{3em}
+
+\noindent \textbf{Change \#55} with diff file ISSM-25891-25892.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh\\
+Export determination: 6. \\
+Rationale: BUG: Credentials are not stored after checkout\\
+\vspace{3em}
+
+\noindent \textbf{Change \#56} with diff file ISSM-25892-25893.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.discover20.patch\\
+Export determination: 6. \\
+Rationale: CHG: discover patch for dakota\\
+\vspace{3em}
+
+\noindent \textbf{Change \#57} with diff file ISSM-25893-25894.diff: \\
+Function name: \\
+A /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-python.sh (from /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-matlab.sh:25890) M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh A /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh (from /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh:25891) M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh D /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries-matlab.sh A /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh\\
+Export determination: 6. \\
+Rationale: CHG: Split up macOS binaries Python packaging into multiple scripts as well; generalized transfer script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#58} with diff file ISSM-25894-25895.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.7-discover.sh\\
+Export determination: 6. \\
+Rationale: CHG: revert to include discover install script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#59} with diff file ISSM-25895-25896.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: BUG: Need to break on success now that we’re not setting a control variable\\
+\vspace{3em}
+
+\noindent \textbf{Change \#60} with diff file ISSM-25896-25897.diff: \\
+Function name: \\
+A /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh (from /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh:25894) A /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh (from /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh:25894) M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh D /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-solid\_earth.sh D /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-with\_dakota.sh D /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries.sh A /issm/trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh (from /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh:25894) M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh M /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh\\
+Export determination: 6. \\
+Rationale: CHG: Similar packaging script modifications for Linux binaries; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#61} with diff file ISSM-25897-25898.diff: \\
+Function name: \\
+D /issm/trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh D /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh\\
+Export determination: 6. \\
+Rationale: CHG: Fixing permissions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#62} with diff file ISSM-25898-25899.diff: \\
+Function name: \\
+A /issm/trunk-jpl/packagers/linux/transfer-issm-linux-binaries.sh A /issm/trunk-jpl/packagers/mac/transfer-issm-mac-binaries.sh\\
+Export determination: 6. \\
+Rationale: CHG: Fixing permissions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#63} with diff file ISSM-25899-25900.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/boost/configs/1.55/reverse\_iterator.hpp.patch A /issm/trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh\\
+Export determination: 6. \\
+Rationale: CHG: add some updates for lonestar petsc and boost build\\
+\vspace{3em}
+
+\noindent \textbf{Change \#64} with diff file ISSM-25900-25901.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: Missing clean up and directory creation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#65} with diff file ISSM-25901-25902.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/commit\_for\_signing-issm-mac-binaries-python.sh M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: Need to validate unsigned repo; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#66} with diff file ISSM-25902-25903.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: BUG: Syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#67} with diff file ISSM-25903-25904.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: BUG: Proper collection of exit codes from individual scripts\\
+\vspace{3em}
+
+\noindent \textbf{Change \#68} with diff file ISSM-25904-25905.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: BUG: Writing to file named ‘1’ rather than redirecting stdout\\
+\vspace{3em}
+
+\noindent \textbf{Change \#69} with diff file ISSM-25905-25906.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing some xNew to speed up code\\
+\vspace{3em}
+
+\noindent \textbf{Change \#70} with diff file ISSM-25906-25907.diff: \\
+Function name: \\
+A /issm/trunk-jpl/scripts/DownloadExamplesDatasets.sh\\
+Export determination: 6. \\
+Rationale: ADD: New dataset download script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#71} with diff file ISSM-25907-25908.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/lonestar.m\\
+Export determination: 6. \\
+Rationale: CHG: update ls5 modules\\
+\vspace{3em}
+
+\noindent \textbf{Change \#72} with diff file ISSM-25908-25909.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: BUG: Missing copy of entitlements file\\
+\vspace{3em}
+
+\noindent \textbf{Change \#73} with diff file ISSM-25909-25910.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/DownloadExamplesDatasets.sh\\
+Export determination: 6. \\
+Rationale: BUG: Needed output directory in call to unzip\\
+\vspace{3em}
+
+\noindent \textbf{Change \#74} with diff file ISSM-25910-25911.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#75} with diff file ISSM-25911-25912.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Materials/Matestar.h M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.h\\
+Export determination: 6. \\
+Rationale: CHG: minor, rheology\_law not needed anymore since it is a param\\
+\vspace{3em}
+
+\noindent \textbf{Change \#76} with diff file ISSM-25912-25913.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/love\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: add break to speed up calculation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#77} with diff file ISSM-25913-25914.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: Merging (ba)sh environment -> csh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#78} with diff file ISSM-25914-25915.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBgemb.m M /issm/trunk-jpl/src/m/classes/SMBgemb.py\\
+Export determination: 6. \\
+Rationale: CHG: always display aValue for GEMB\\
+\vspace{3em}
+
+\noindent \textbf{Change \#79} with diff file ISSM-25915-25916.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/AMR/runme.m M /issm/trunk-jpl/examples/EsaGRACE/runme.m M /issm/trunk-jpl/examples/EsaWahr/runme.m M /issm/trunk-jpl/examples/Functions/grace.m M /issm/trunk-jpl/examples/Greenland/runme.m D /issm/trunk-jpl/examples/ISMIP/CheatyIsmipA.par D /issm/trunk-jpl/examples/ISMIP/CheatyIsmipF.par D /issm/trunk-jpl/examples/ISMIP/CheatyRunme.m M /issm/trunk-jpl/examples/ISMIP/runme.m M /issm/trunk-jpl/examples/IceBridge/Greenland.par M /issm/trunk-jpl/examples/IceBridge/runme.m M /issm/trunk-jpl/examples/Inversion/runme.m M /issm/trunk-jpl/examples/Jakobshavn/runme.m M /issm/trunk-jpl/examples/LcurveAnalysis/runme.m M /issm/trunk-jpl/examples/Pig/runme.m M /issm/trunk-jpl/examples/Pig2/runme.m M /issm/trunk-jpl/examples/PigSensitivity/runme.m M /issm/trunk-jpl/examples/SlrFarrell/runme.m M /issm/trunk-jpl/examples/SlrGRACE/runme.m M /issm/trunk-jpl/examples/SlrGRACE\_NIMS/runme.m M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m M /issm/trunk-jpl/examples/shakti/runme.m A /issm/trunk-jpl/jenkins/examples\_tests.sh A /issm/trunk-jpl/jenkins/pine\_island-mac-examples (from /issm/trunk-jpl/jenkins/pine\_island-mac-full:25827) M /issm/trunk-jpl/test/NightlyRun/test418.m\\
+Export determination: 6. \\
+Rationale: CHG: Initial commit of changes for example build; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#80} with diff file ISSM-25916-25917.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Initial commit of changes for examples build\\
+\vspace{3em}
+
+\noindent \textbf{Change \#81} with diff file ISSM-25917-25918.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: BUG: Missed two edits\\
+\vspace{3em}
+
+\noindent \textbf{Change \#82} with diff file ISSM-25918-25919.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test418.m\\
+Export determination: 6. \\
+Rationale: BUG: Reverting changes to results from partitioner\\
+\vspace{3em}
+
+\noindent \textbf{Change \#83} with diff file ISSM-25919-25920.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-examples\\
+Export determination: 6. \\
+Rationale: BUG: Path to MATLAB\\
+\vspace{3em}
+
+\noindent \textbf{Change \#84} with diff file ISSM-25920-25921.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/partition/partitioner.m M /issm/trunk-jpl/test/NightlyRun/test418.m M /issm/trunk-jpl/test/NightlyRun/test418.py\\
+Export determination: 6. \\
+Rationale: BUG: Correcting assignment of output from partitioner\\
+\vspace{3em}
+
+\noindent \textbf{Change \#85} with diff file ISSM-25921-25922.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-examples\\
+Export determination: 6. \\
+Rationale: BUG: Path to external packages\\
+\vspace{3em}
+
+\noindent \textbf{Change \#86} with diff file ISSM-25922-25923.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-examples\\
+Export determination: 6. \\
+Rationale: BUG: Path to external packages\\
+\vspace{3em}
+
+\noindent \textbf{Change \#87} with diff file ISSM-25923-25924.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m M /issm/trunk-jpl/test/NightlyRun/test417.m\\
+Export determination: 6. \\
+Rationale: CHG: Committing changes to UQ example (still need to modify plotting of partitions); minor adjustment to output assignment\\
+\vspace{3em}
+
+\noindent \textbf{Change \#88} with diff file ISSM-25924-25925.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/examples\_tests.sh M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Minor clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#89} with diff file ISSM-25925-25926.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: BUG: Bad commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#90} with diff file ISSM-25926-25927.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/examples\_tests.sh M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: BUG: Need to export MATLAB\_PATH so that it is available to example\_tests; not running UQ example until it is fixed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#91} with diff file ISSM-25927-25928.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: BUG: Corrected handling of examples tests logs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#92} with diff file ISSM-25928-25929.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/DownloadExamplesDatasets.sh\\
+Export determination: 6. \\
+Rationale: BUG: Corrected redirection of list of files to download\\
+\vspace{3em}
+
+\noindent \textbf{Change \#93} with diff file ISSM-25929-25930.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/m/plot/applyoptions.m M /issm/trunk-jpl/src/m/plot/plotdoc.m M /issm/trunk-jpl/src/m/plot/plotdoc.py\\
+Export determination: 6. \\
+Rationale: CHG: Changes to plotting of partition overlay; minor clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#94} with diff file ISSM-25930-25931.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Turning on UQ example test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#95} with diff file ISSM-25931-25932.diff: \\
+Function name: \\
+A /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries-solid\_earth.sh (from /issm/trunk-jpl/scripts/test-issm-linux-binaries-solid\_earth.sh:25930) A /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries-with\_dakota.sh (from /issm/trunk-jpl/scripts/test-issm-linux-binaries-with\_dakota.sh:25930) A /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries.sh (from /issm/trunk-jpl/scripts/test-issm-linux-binaries.sh:25930) D /issm/trunk-jpl/scripts/installExternalPackages.sh D /issm/trunk-jpl/scripts/test-issm-linux-binaries-solid\_earth.sh D /issm/trunk-jpl/scripts/test-issm-linux-binaries-with\_dakota.sh D /issm/trunk-jpl/scripts/test-issm-linux-binaries.sh\\
+Export determination: 6. \\
+Rationale: CHG: Clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#96} with diff file ISSM-25932-25933.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/DownloadExternalPackage.sh\\
+Export determination: 6. \\
+Rationale: CHG: use curl first for download\\
+\vspace{3em}
+
+\noindent \textbf{Change \#97} with diff file ISSM-25933-25934.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBgemb.m M /issm/trunk-jpl/src/m/classes/SMBgemb.py\\
+Export determination: 6. \\
+Rationale: CHG: gemb C should be > 0\\
+\vspace{3em}
+
+\noindent \textbf{Change \#98} with diff file ISSM-25934-25935.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: trying to remove some dynamic memory allocation of Gauss points\\
+\vspace{3em}
+
+\noindent \textbf{Change \#99} with diff file ISSM-25935-25936.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/solvers/asmstokesoptions.m\\
+Export determination: 6. \\
+Rationale: NEW: asm solver for FS; settings verified with ISMIP-HOM ExpC, 5km\\
+\vspace{3em}
+
+\noindent \textbf{Change \#100} with diff file ISSM-25936-25937.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed a bug in the Nitsche method, where the viscosity should not be multiplied by 2 in the assembly. Also, some improvment in the coding of GLS, but nothing really changed for GLS.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#101} with diff file ISSM-25937-25938.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: upgraded slr solver parameters etc to comply with the new formulation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#102} with diff file ISSM-25938-25939.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: BUG: transient runs fixed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#103} with diff file ISSM-25939-25940.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE\_NIMS/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: upgraded the script to comply with new solid earth formalism\\
+\vspace{3em}
+
+\noindent \textbf{Change \#104} with diff file ISSM-25940-25941.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/ad/rescalegradient.m\\
+Export determination: 6. \\
+Rationale: CHG: fixing wrong size of vectors\\
+\vspace{3em}
+
+\noindent \textbf{Change \#105} with diff file ISSM-25941-25942.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/m/classes/stressbalance.m\\
+Export determination: 6. \\
+Rationale: CHG: New feature controls vertical velocity options, such as incompressible assumption, internal deformation, and combination of both assumption.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#106} with diff file ISSM-25942-25943.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/m/classes/stressbalance.m\\
+Export determination: 6. \\
+Rationale: BUG: fixing Inwoo's commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#107} with diff file ISSM-25943-25944.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: CHG: added collapse for Josh's friction law\\
+\vspace{3em}
+
+\noindent \textbf{Change \#108} with diff file ISSM-25944-25945.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/fisoc A /issm/trunk-jpl/externalpackages/fisoc/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: added fisoc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#109} with diff file ISSM-25945-25946.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/cores/stressbalance\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: use rotated coordinate system for Nitsches method, tested with ISMIP A-D, works for MINIcondensed and P1P1GLS. This implementation is currently only avaliable for 3D FS.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#110} with diff file ISSM-25946-25947.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: BUG: Modifications to use gnu-sed on Pine Island under zsh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#111} with diff file ISSM-25947-25948.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp A /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp A /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h D /issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp D /issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.h M /issm/trunk-jpl/src/c/analyses/analyses.h M /issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp A /issm/trunk-jpl/src/m/classes/additionalsolidearthsolution.m A /issm/trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m A /issm/trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m A /issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearthsolution.m\\
+Export determination: 6. \\
+Rationale: CHG: created external forcings for solid earth. Completely reorganized the sealevel change core (in particular now we have a clean split between the external forcings, the grd core and the dynamic steric core). Also, we reorganized and renamed the grd components and cores. From eutatic, we now have: barystatic core, sal core, deformation core. No more diagnostics. We also allow the external forcings to be mmes. Lots of cosmetic name changes (rise->change for ex.).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#112} with diff file ISSM-25948-25949.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2003.m M /issm/trunk-jpl/test/NightlyRun/test2004.m\\
+Export determination: 6. \\
+Rationale: Updating tests 2002, 2003, 2004 to the new enums\\
+\vspace{3em}
+
+\noindent \textbf{Change \#113} with diff file ISSM-25949-25950.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/solve.m\\
+Export determination: 6. \\
+Rationale: Renaming Sealevelrise > Sealevelchange in solve\\
+\vspace{3em}
+
+\noindent \textbf{Change \#114} with diff file ISSM-25950-25951.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m\\
+Export determination: 6. \\
+Rationale: More renaming in test2010 and ismodelselfconsistent from Sealevelrise to Sealevelchange\\
+\vspace{3em}
+
+\noindent \textbf{Change \#115} with diff file ISSM-25951-25952.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2010.m\\
+Export determination: 6. \\
+Rationale: More renaming in test2010 and ismodelselfconsistent from Sealevelrise to Sealevelchange\\
+\vspace{3em}
+
+\noindent \textbf{Change \#116} with diff file ISSM-25952-25953.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m\\
+Export determination: 6. \\
+Rationale: More renaming in ismodelselfconsistent from Sealevelrise to Sealevelchange\\
+\vspace{3em}
+
+\noindent \textbf{Change \#117} with diff file ISSM-25953-25954.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing compilation, temporary fix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#118} with diff file ISSM-25954-25955.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h\\
+Export determination: 6. \\
+Rationale: CHG: fixed issue of Dkota dependence in the definition of MmeToInputFromId.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#119} with diff file ISSM-25955-25956.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/solve.js M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py\\
+Export determination: 6. \\
+Rationale: CHG: switchin to sla and sea level change solutions.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#120} with diff file ISSM-25956-25957.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp A /issm/trunk-jpl/src/c/main/issm\_slc.cpp D /issm/trunk-jpl/src/c/main/issm\_slr.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/additionalsolidearthsolution.m M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/localpfe.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.m M /issm/trunk-jpl/src/m/classes/dsl.m M /issm/trunk-jpl/src/m/classes/dslmme.m M /issm/trunk-jpl/src/m/classes/geometry.m M /issm/trunk-jpl/src/m/classes/giamme.m M /issm/trunk-jpl/src/m/classes/lovenumbers.m M /issm/trunk-jpl/src/m/classes/matdamageice.m M /issm/trunk-jpl/src/m/classes/matenhancedice.m M /issm/trunk-jpl/src/m/classes/matestar.m M /issm/trunk-jpl/src/m/classes/matice.m M /issm/trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m M /issm/trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/nodalvalue.m M /issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/qmustatistics.m M /issm/trunk-jpl/src/m/classes/rotational.m M /issm/trunk-jpl/src/m/classes/sealevelmodel.m D /issm/trunk-jpl/src/m/classes/slr.m M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/src/m/classes/surfaceload.m M /issm/trunk-jpl/src/m/classes/toolkits.m M /issm/trunk-jpl/src/m/classes/transient.m M /issm/trunk-jpl/src/m/solve/solveslm.m M /issm/trunk-jpl/test/NightlyRun/GetIds.py M /issm/trunk-jpl/test/NightlyRun/runme.m M /issm/trunk-jpl/test/NightlyRun/runme.py M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2002.py M /issm/trunk-jpl/test/NightlyRun/test2003.m M /issm/trunk-jpl/test/NightlyRun/test2003.py M /issm/trunk-jpl/test/NightlyRun/test2004.m M /issm/trunk-jpl/test/NightlyRun/test2005.m M /issm/trunk-jpl/test/NightlyRun/test2005.py M /issm/trunk-jpl/test/NightlyRun/test2006.m M /issm/trunk-jpl/test/NightlyRun/test2006.py M /issm/trunk-jpl/test/NightlyRun/test2010.m M /issm/trunk-jpl/test/NightlyRun/test2010.py M /issm/trunk-jpl/test/NightlyRun/test2020.m M /issm/trunk-jpl/test/NightlyRun/test2021.m\\
+Export determination: 6. \\
+Rationale: CHG: changing sea level rise to sea level change. Mostly cosmetic.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#121} with diff file ISSM-25957-25958.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: simple fix.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#122} with diff file ISSM-25958-25959.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp M /issm/trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m M /issm/trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/surfaceload.m\\
+Export determination: 6. \\
+Rationale: CHG: switched to rates on solidearth surafce loads.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#123} with diff file ISSM-25959-25960.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/runme.m D /issm/trunk-jpl/externalpackages/autotools/install-debian-linux.sh A /issm/trunk-jpl/externalpackages/autotools/install-linux.sh M /issm/trunk-jpl/externalpackages/cmake/install.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-linux-static.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-linux.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-mac-static.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-mac.sh M /issm/trunk-jpl/jenkins/aws-amazon\_linux-solid\_earth M /issm/trunk-jpl/jenkins/jenkins.sh M /issm/trunk-jpl/jenkins/pine\_island-mac-examples M /issm/trunk-jpl/jenkins/ross-debian\_linux-adolc-ampioff M /issm/trunk-jpl/jenkins/ross-debian\_linux-adolc-ampion M /issm/trunk-jpl/jenkins/ross-debian\_linux-basic M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-matlab M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-codipack M /issm/trunk-jpl/jenkins/ross-debian\_linux-dakota M /issm/trunk-jpl/jenkins/ross-debian\_linux-full M /issm/trunk-jpl/jenkins/ross-debian\_linux-full-valgrind M /issm/trunk-jpl/jenkins/ross-debian\_linux-gia M /issm/trunk-jpl/jenkins/ross-debian\_linux-iceocean M /issm/trunk-jpl/jenkins/ross-debian\_linux-javascript M /issm/trunk-jpl/jenkins/ross-debian\_linux-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: Various pending minor fixes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#124} with diff file ISSM-25960-25961.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp M /issm/trunk-jpl/src/m/classes/surfaceload.m\\
+Export determination: 6. \\
+Rationale: CHG: Partial fixes for SLC\\
+\vspace{3em}
+
+\noindent \textbf{Change \#125} with diff file ISSM-25961-25962.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/transient.py\\
+Export determination: 6. \\
+Rationale: CHG: Quick patch for SLC under Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#126} with diff file ISSM-25962-25963.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/dsl.py M /issm/trunk-jpl/src/m/classes/giamme.py M /issm/trunk-jpl/src/m/classes/solidearth.py\\
+Export determination: 6. \\
+Rationale: CHG: More patches for SLC under Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#127} with diff file ISSM-25963-25964.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/aws-amazon\_linux-solid\_earth M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: Updated benchmark names\\
+\vspace{3em}
+
+\noindent \textbf{Change \#128} with diff file ISSM-25964-25965.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Trying to bring jUnit reports back online for examples\\
+\vspace{3em}
+
+\noindent \textbf{Change \#129} with diff file ISSM-25965-25966.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Different grep for backspace char\\
+\vspace{3em}
+
+\noindent \textbf{Change \#130} with diff file ISSM-25966-25967.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: perl to remove backspace chars from log\\
+\vspace{3em}
+
+\noindent \textbf{Change \#131} with diff file ISSM-25967-25968.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/gdal/install-3-python-static.sh M /issm/trunk-jpl/externalpackages/gdal/install-3-python.sh M /issm/trunk-jpl/externalpackages/gdal/install-3-static.sh M /issm/trunk-jpl/externalpackages/gdal/install-3.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2-static-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2-static.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-6.2.sh\\
+Export determination: 6. \\
+Rationale: BUG: Corrected path to external package server\\
+\vspace{3em}
+
+\noindent \textbf{Change \#132} with diff file ISSM-25968-25969.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/gdal/install-1.10-macosx64.sh M /issm/trunk-jpl/externalpackages/gdal/install-1.11.2-macosx64.sh M /issm/trunk-jpl/externalpackages/mpich/install-3.2-mac-static.sh M /issm/trunk-jpl/externalpackages/sqlite/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: Corrected path to external package server\\
+\vspace{3em}
+
+\noindent \textbf{Change \#133} with diff file ISSM-25969-25970.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearth.py\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#134} with diff file ISSM-25970-25971.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/frictioncoulomb2.m\\
+Export determination: 6. \\
+Rationale: CHG: added frictioncoulomb2.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#135} with diff file ISSM-25971-25972.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/gmsh/install-3.sh M /issm/trunk-jpl/externalpackages/gmsh/install-4-static.sh M /issm/trunk-jpl/externalpackages/gmsh/install-4.sh\\
+Export determination: 6. \\
+Rationale: CHG: Added step to link lib -> lib64 under RHEL.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#136} with diff file ISSM-25972-25973.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removed code not needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#137} with diff file ISSM-25973-25974.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.h M /issm/trunk-jpl/src/m/classes/frictioncoulomb2.m\\
+Export determination: 6. \\
+Rationale: CHG: added coulomb limited friction\\
+\vspace{3em}
+
+\noindent \textbf{Change \#138} with diff file ISSM-25974-25975.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/m/classes/frictioncoulomb2.m\\
+Export determination: 6. \\
+Rationale: CHG: moving coefficient to C\\
+\vspace{3em}
+
+\noindent \textbf{Change \#139} with diff file ISSM-25975-25976.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed coulomb inversion\\
+\vspace{3em}
+
+\noindent \textbf{Change \#140} with diff file ISSM-25976-25977.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp\\
+Export determination: 6. \\
+Rationale: BUG: corrected enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#141} with diff file ISSM-25977-25978.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/shell2junit/README M /issm/trunk-jpl/externalpackages/shell2junit/install.sh D /issm/trunk-jpl/externalpackages/shell2junit/install.sh.old D /issm/trunk-jpl/externalpackages/shell2junit/patch D /issm/trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: New install script; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#142} with diff file ISSM-25978-25979.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/shell2junit/README M /issm/trunk-jpl/externalpackages/shell2junit/install.sh A /issm/trunk-jpl/externalpackages/shell2junit/install.sh.old A /issm/trunk-jpl/externalpackages/shell2junit/patch A /issm/trunk-jpl/externalpackages/shell2junit/patch/sh2ju.sh A /issm/trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip\\
+Export determination: 6. \\
+Rationale: BUG: Reverting changes to shell2junit while working out further bugs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#143} with diff file ISSM-25979-25980.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/shell2junit/README M /issm/trunk-jpl/externalpackages/shell2junit/install.sh D /issm/trunk-jpl/externalpackages/shell2junit/install.sh.old D /issm/trunk-jpl/externalpackages/shell2junit/patch D /issm/trunk-jpl/externalpackages/shell2junit/shell2junit-1.0.0.zip M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: BUG: Fix for shell2junit updates\\
+\vspace{3em}
+
+\noindent \textbf{Change \#144} with diff file ISSM-25980-25981.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/shell2junit/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: Bad commit from local copy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#145} with diff file ISSM-25981-25982.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: BUG: Last plot was not working\\
+\vspace{3em}
+
+\noindent \textbf{Change \#146} with diff file ISSM-25982-25983.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install-linux.sh A /issm/trunk-jpl/externalpackages/autotools/install-mac.sh M /issm/trunk-jpl/externalpackages/autotools/install-win.sh D /issm/trunk-jpl/externalpackages/autotools/install.sh M /issm/trunk-jpl/jenkins/linux64\_caladan\_ad M /issm/trunk-jpl/jenkins/linux64\_caladan\_ampi M /issm/trunk-jpl/jenkins/pine\_island-mac-adolc-ampion M /issm/trunk-jpl/jenkins/pine\_island-mac-basic M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-matlab M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-python M /issm/trunk-jpl/jenkins/pine\_island-mac-dakota M /issm/trunk-jpl/jenkins/pine\_island-mac-examples M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind M /issm/trunk-jpl/jenkins/pine\_island-mac-python M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: Cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#147} with diff file ISSM-25983-25984.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/PigSensitivity/runme.m M /issm/trunk-jpl/jenkins/examples\_tests.sh M /issm/trunk-jpl/jenkins/ross-debian\_linux-full\\
+Export determination: 6. \\
+Rationale: CHG: Updates to Pig Sensitivity example; cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#148} with diff file ISSM-25984-25985.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Disabling Pig2 check\\
+\vspace{3em}
+
+\noindent \textbf{Change \#149} with diff file ISSM-25985-25986.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Mesh/runme.m\\
+Export determination: 6. \\
+Rationale: ADD: Missing runme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#150} with diff file ISSM-25986-25987.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/AMR/runme.m M /issm/trunk-jpl/examples/EsaGRACE/runme.m M /issm/trunk-jpl/examples/EsaWahr/runme.m M /issm/trunk-jpl/examples/Greenland/runme.m M /issm/trunk-jpl/examples/ISMIP/runme.m M /issm/trunk-jpl/examples/IceBridge/runme.m M /issm/trunk-jpl/examples/Inversion/runme.m M /issm/trunk-jpl/examples/Jakobshavn/runme.m M /issm/trunk-jpl/examples/LcurveAnalysis/runme.m D /issm/trunk-jpl/examples/Mesh/runme.m M /issm/trunk-jpl/examples/Pig/runme.m M /issm/trunk-jpl/examples/Pig2/runme.m M /issm/trunk-jpl/examples/PigSensitivity/runme.m M /issm/trunk-jpl/examples/SlrFarrell/runme.m M /issm/trunk-jpl/examples/SlrGRACE/runme.m M /issm/trunk-jpl/examples/SlrGRACE\_NIMS/runme.m M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m M /issm/trunk-jpl/examples/shakti/runme.m M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#151} with diff file ISSM-25987-25988.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: Reordering of steps; added caxis bounds to sensitivity plots\\
+\vspace{3em}
+
+\noindent \textbf{Change \#152} with diff file ISSM-25988-25989.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.js M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/model.py\\
+Export determination: 6. \\
+Rationale: CHG: Minor formatting\\
+\vspace{3em}
+
+\noindent \textbf{Change \#153} with diff file ISSM-25989-25990.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/gmt/install-6-linux-static.sh M /issm/trunk-jpl/externalpackages/gmt/install-6-linux.sh\\
+Export determination: 6. \\
+Rationale: CHG: Need to link lib64 -> lib under RHEL\\
+\vspace{3em}
+
+\noindent \textbf{Change \#154} with diff file ISSM-25990-25991.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install-win.sh\\
+Export determination: 6. \\
+Rationale: BUG: AUTOMAKE\_MIN\_VER needs to be defined for patch\\
+\vspace{3em}
+
+\noindent \textbf{Change \#155} with diff file ISSM-25991-25992.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: Need to start with just step 1 so that example test driver works correctly\\
+\vspace{3em}
+
+\noindent \textbf{Change \#156} with diff file ISSM-25992-25993.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/materials.m\\
+Export determination: 6. \\
+Rationale: adding PREM builder for materials('litho')\\
+\vspace{3em}
+
+\noindent \textbf{Change \#157} with diff file ISSM-25993-25994.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h\\
+Export determination: 6. \\
+Rationale: CHG: add options for Alex's newest Albedo scheme for GEMB\\
+\vspace{3em}
+
+\noindent \textbf{Change \#158} with diff file ISSM-25995-25996.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h M /issm/trunk-jpl/src/c/toolkits/objects/Vector.h\\
+Export determination: 6. \\
+Rationale: CGH: adding elementwise multiplication and power for vectors\\
+\vspace{3em}
+
+\noindent \textbf{Change \#159} with diff file ISSM-25996-25997.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m A /issm/trunk-jpl/src/m/classes/sampling.m M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m\\
+Export determination: 6. \\
+Rationale: NEW: add new class sampling to model for stochastic sampling capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#160} with diff file ISSM-25997-25998.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/SMBgemb.m M /issm/trunk-jpl/src/m/classes/SMBgemb.py\\
+Export determination: 6. \\
+Rationale: CHG: implement inputs for gardner albedo scheme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#161} with diff file ISSM-25998-25999.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor comment update\\
+\vspace{3em}
+
+\noindent \textbf{Change \#162} with diff file ISSM-25999-26000.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: pass in direct and diffuse SW if aIdx is 1\\
+\vspace{3em}
+
+\noindent \textbf{Change \#163} with diff file ISSM-26000-26001.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am A /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.cpp A /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.h M /issm/trunk-jpl/src/c/analyses/analyses.h\\
+Export determination: 6. \\
+Rationale: NEW: add new analysis SamplingAnalysis for stochastic sampler\\
+\vspace{3em}
+
+\noindent \textbf{Change \#164} with diff file ISSM-26001-26002.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.h\\
+Export determination: 6. \\
+Rationale: CHG: Update GradientJ in SamplingAnalysis\\
+\vspace{3em}
+
+\noindent \textbf{Change \#165} with diff file ISSM-26002-26003.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CGH: add new enums for sampling capacity\\
+\vspace{3em}
+
+\noindent \textbf{Change \#166} with diff file ISSM-26003-26004.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CGH: Update sampling analysis Input2 to Input and gauss->begin() to gauss->next()\\
+\vspace{3em}
+
+\noindent \textbf{Change \#167} with diff file ISSM-26004-26005.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/analyses.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.cpp M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/Profiler.h M /issm/trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/cores/cores.h A /issm/trunk-jpl/src/c/cores/sampling\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp A /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequences.h M /issm/trunk-jpl/src/m/solve/solve.m\\
+Export determination: 6. \\
+Rationale: NEW: add core sampling\_core and solution solver solutionsequence\_sampling for sampling capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#168} with diff file ISSM-26005-26006.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: BUG: delete InsertSample in solutionsequence\_sampling.cpp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#169} with diff file ISSM-26006-26007.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/transient.m\\
+Export determination: 6. \\
+Rationale: CGH: updating matlab classes initialization and transient for transient sampling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#170} with diff file ISSM-26007-26008.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/transient.m\\
+Export determination: 6. \\
+Rationale: CGH: remove matlab classes initialization and transient for transient sampling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#171} with diff file ISSM-26008-26009.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/initialization.m\\
+Export determination: 6. \\
+Rationale: CGH: remove matlab classes initialization for transient sampling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#172} with diff file ISSM-26009-26010.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/transient.m\\
+Export determination: 6. \\
+Rationale: CGH: add isampling for transient sampling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#173} with diff file ISSM-26010-26011.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.cpp M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp\\
+Export determination: 6. \\
+Rationale: NEW: add sampling to transient core\\
+\vspace{3em}
+
+\noindent \textbf{Change \#174} with diff file ISSM-26011-26012.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/transient.py\\
+Export determination: 6. \\
+Rationale: CGH: add isampling for transient sampling (python)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#175} with diff file ISSM-26012-26013.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/sampling.py\\
+Export determination: 6. \\
+Rationale: NEW: add python file for sampling class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#176} with diff file ISSM-26013-26014.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/sampling.py M /issm/trunk-jpl/src/m/solve/solve.py\\
+Export determination: 6. \\
+Rationale: NEW: add sampling capability for python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#177} with diff file ISSM-26014-26015.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/initialization.py\\
+Export determination: 6. \\
+Rationale: BUG: fix minor issue in checkfield in initilization.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#178} with diff file ISSM-26015-26016.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/sampling.py\\
+Export determination: 6. \\
+Rationale: BUG: fix issue with sampling.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#179} with diff file ISSM-26016-26017.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/sampling.py\\
+Export determination: 6. \\
+Rationale: CGH: remove sr/m/sampling.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#180} with diff file ISSM-26017-26018.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/sampling.py\\
+Export determination: 6. \\
+Rationale: BUG: fix issue with sampling.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#181} with diff file ISSM-26018-26019.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/sampling.py\\
+Export determination: 6. \\
+Rationale: BUG: fix issue with sampling.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#182} with diff file ISSM-26019-26020.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/sampling.py\\
+Export determination: 6. \\
+Rationale: BUG: fix issue with sampling.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#183} with diff file ISSM-26020-26021.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/sampling.py\\
+Export determination: 6. \\
+Rationale: BUG: fix issue with sampling.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#184} with diff file ISSM-26021-26022.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py\\
+Export determination: 6. \\
+Rationale: BUG: fix issue with ismodelselfconsistent.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#185} with diff file ISSM-26022-26023.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/sampling.py\\
+Export determination: 6. \\
+Rationale: CGH: add requested outputs in sampling.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#186} with diff file ISSM-26023-26024.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/sampling.m M /issm/trunk-jpl/src/m/classes/sampling.py\\
+Export determination: 6. \\
+Rationale: CGH: checkfield samplingbeta only for sampling.robin\\
+\vspace{3em}
+
+\noindent \textbf{Change \#187} with diff file ISSM-26024-26025.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive127.arch A /issm/trunk-jpl/test/Archives/Archive128.arch A /issm/trunk-jpl/test/Archives/Archive129.arch A /issm/trunk-jpl/test/NightlyRun/test127.m A /issm/trunk-jpl/test/NightlyRun/test128.m A /issm/trunk-jpl/test/NightlyRun/test129.m\\
+Export determination: 6. \\
+Rationale: NEW: add nightly runs test127, test128, test129 for sampling capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#188} with diff file ISSM-26025-26026.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive127.arch M /issm/trunk-jpl/test/NightlyRun/test127.m M /issm/trunk-jpl/test/NightlyRun/test128.m\\
+Export determination: 6. \\
+Rationale: CGH: Modifications of Nightly runs for sampling capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#189} with diff file ISSM-26026-26027.diff: \\
+Function name: \\
+D /issm/trunk-jpl/test/Archives/Archive127.arch D /issm/trunk-jpl/test/Archives/Archive128.arch D /issm/trunk-jpl/test/Archives/Archive129.arch D /issm/trunk-jpl/test/NightlyRun/test127.m D /issm/trunk-jpl/test/NightlyRun/test128.m D /issm/trunk-jpl/test/NightlyRun/test129.m\\
+Export determination: 6. \\
+Rationale: BUG: deleting Nightly runs 127, 128, 129\\
+\vspace{3em}
+
+\noindent \textbf{Change \#190} with diff file ISSM-26027-26028.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/IsmipF.par\\
+Export determination: 6. \\
+Rationale: CHG: make text consistent with solution on website\\
+\vspace{3em}
+
+\noindent \textbf{Change \#191} with diff file ISSM-26028-26029.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: explain the find logic more explicitly in the ISMIP comments\\
+\vspace{3em}
+
+\noindent \textbf{Change \#192} with diff file ISSM-26029-26030.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/IsmipF.par M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Synchronizing parametrization file and test driver\\
+\vspace{3em}
+
+\noindent \textbf{Change \#193} with diff file ISSM-26030-26031.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Synchronizing parametrization file and test driver\\
+\vspace{3em}
+
+\noindent \textbf{Change \#194} with diff file ISSM-26031-26032.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: minor update to ISMIP\\
+\vspace{3em}
+
+\noindent \textbf{Change \#195} with diff file ISSM-26032-26033.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/runme.m M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Updated comments\\
+\vspace{3em}
+
+\noindent \textbf{Change \#196} with diff file ISSM-26033-26034.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/IsmipF.par\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#197} with diff file ISSM-26034-26035.diff: \\
+Function name: \\
+M /issm/trunk-jpl/Makefile.am M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/etc/environment.sh A /issm/trunk-jpl/externalpackages/blas/configs/3.8 A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win/msys2 A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/Makefile A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/gcc/make.inc A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64 A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/Makefile A /issm/trunk-jpl/externalpackages/blas/configs/3.8/win/msys2/mingw64/make.inc A /issm/trunk-jpl/externalpackages/blas/install-3-win-msys2-gcc.sh A /issm/trunk-jpl/externalpackages/blas/install-3-win-msys2-mingw.sh A /issm/trunk-jpl/externalpackages/chaco/configs A /issm/trunk-jpl/externalpackages/chaco/configs/win A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2 A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64 A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/main/interface.c A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/bail.c A /issm/trunk-jpl/externalpackages/lapack/configs/3.9 A /issm/trunk-jpl/externalpackages/lapack/configs/3.9/win A /issm/trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2 A /issm/trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw A /issm/trunk-jpl/externalpackages/lapack/configs/3.9/win/msys2/mingw/CMakeLists.txt A /issm/trunk-jpl/externalpackages/lapack/install-3-win-msys2-gcc.sh A /issm/trunk-jpl/externalpackages/lapack/install-3-win-msys2-mingw.sh A /issm/trunk-jpl/externalpackages/metis/configs/5.1 A /issm/trunk-jpl/externalpackages/metis/configs/5.1/win A /issm/trunk-jpl/externalpackages/metis/configs/5.1/win/msys2 A /issm/trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib A /issm/trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk\_arch.h A /issm/trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/GKlib/gk\_getopt.h A /issm/trunk-jpl/externalpackages/metis/configs/5.1/win/msys2/Makefile A /issm/trunk-jpl/externalpackages/metis/install-5-win-msys2-gcc.sh A /issm/trunk-jpl/externalpackages/metis/install-5-win-msys2-mingw.sh A /issm/trunk-jpl/externalpackages/mumps/configs/5.3 A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2 A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/Makefile.inc A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/PORD/lib/Makefile A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/libseq/Makefile A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/gcc/msmpi/src/Makefile A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64 A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/Makefile.inc A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/PORD/lib/Makefile A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/libseq/Makefile A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src A /issm/trunk-jpl/externalpackages/mumps/configs/5.3/win/msys2/mingw64/msmpi/src/Makefile A /issm/trunk-jpl/externalpackages/mumps/install-5-win-msys2-gcc-msmpi.sh A /issm/trunk-jpl/externalpackages/mumps/install-5-win-msys2-mingw-msmpi.sh A /issm/trunk-jpl/externalpackages/parmetis A /issm/trunk-jpl/externalpackages/parmetis/compil.log A /issm/trunk-jpl/externalpackages/parmetis/configs A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0 A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2 A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/CMakeLists.txt A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/Makefile A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/gcc A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/gcc/libparmetis/CMakeLists.txt A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/include A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/include/parmetis.h A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/mingw64 A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis A /issm/trunk-jpl/externalpackages/parmetis/configs/4.0/win/msys2/mingw64/libparmetis/CMakeLists.txt A /issm/trunk-jpl/externalpackages/parmetis/install-4-win-msys2-gcc-msmpi.sh A /issm/trunk-jpl/externalpackages/parmetis/install-4-win-msys2-mingw-msmpi.sh A /issm/trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh A /issm/trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1 A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2 A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/gcc A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/gcc/msmpi/CMakeLists.txt A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64 A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/BLACS/SRC/src-C.c.in A /issm/trunk-jpl/externalpackages/scalapack/configs/2.1/win/msys2/mingw64/msmpi/CMakeLists.txt A /issm/trunk-jpl/externalpackages/scalapack/install-2-win-msys2-gcc-msmpi.sh A /issm/trunk-jpl/externalpackages/scalapack/install-2-win-msys2-mingw-msmpi.sh A /issm/trunk-jpl/externalpackages/triangle/configs/win A /issm/trunk-jpl/externalpackages/triangle/configs/win/msys2 A /issm/trunk-jpl/externalpackages/triangle/configs/win/msys2/gcc A /issm/trunk-jpl/externalpackages/triangle/configs/win/msys2/gcc/configure.make A /issm/trunk-jpl/externalpackages/triangle/configs/win/msys2/mingw64 A /issm/trunk-jpl/externalpackages/triangle/configs/win/msys2/mingw64/configure.make A /issm/trunk-jpl/externalpackages/triangle/install-win-msys2-gcc.sh A /issm/trunk-jpl/externalpackages/triangle/install-win-msys2-mingw.sh M /issm/trunk-jpl/jenkins/jenkins.sh A /issm/trunk-jpl/jenkins/ross-win-msys2-gcc-msmpi-basic A /issm/trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic M /issm/trunk-jpl/m4/issm\_options.m4 A /issm/trunk-jpl/scripts/win-msys2-create\_local\_msmpi\_dir.sh M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/shared/io/Comm/IssmComm.cpp M /issm/trunk-jpl/src/c/shared/io/Print/PrintfFunction.cpp M /issm/trunk-jpl/src/c/toolkits/ToolkitOptions.cpp M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/localpfe.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.m M /issm/trunk-jpl/src/m/dev/devpath.m A /issm/trunk-jpl/src/m/os/ismingw.m M /issm/trunk-jpl/src/m/os/issmscpin.m M /issm/trunk-jpl/src/m/os/issmscpout.m M /issm/trunk-jpl/src/m/os/issmssh.m M /issm/trunk-jpl/src/m/os/oshostname.m M /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.m M /issm/trunk-jpl/src/wrappers/Triangle/Triangle.h M /issm/trunk-jpl/src/wrappers/javascript/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/include/wrapper\_macros.h M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Modifications to build system and additional configurations in support of Windows 10 MSYS2 MinGW build\\
+\vspace{3em}
+
+\noindent \textbf{Change \#198} with diff file ISSM-26035-26036.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/codipack/install.sh M /issm/trunk-jpl/externalpackages/medipack/install.sh M /issm/trunk-jpl/jenkins/linux64\_caladan M /issm/trunk-jpl/jenkins/linux64\_caladan\_ampi M /issm/trunk-jpl/jenkins/pine\_island-mac-adolc-ampion M /issm/trunk-jpl/jenkins/pine\_island-mac-basic M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-matlab M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-python M /issm/trunk-jpl/jenkins/pine\_island-mac-dakota M /issm/trunk-jpl/jenkins/pine\_island-mac-examples M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind M /issm/trunk-jpl/jenkins/pine\_island-mac-python M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/ross-debian\_linux-adolc-ampioff M /issm/trunk-jpl/jenkins/ross-debian\_linux-adolc-ampion M /issm/trunk-jpl/jenkins/ross-debian\_linux-basic M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-codipack M /issm/trunk-jpl/jenkins/ross-debian\_linux-dakota M /issm/trunk-jpl/jenkins/ross-debian\_linux-full M /issm/trunk-jpl/jenkins/ross-debian\_linux-full-valgrind M /issm/trunk-jpl/jenkins/ross-debian\_linux-gia M /issm/trunk-jpl/jenkins/ross-debian\_linux-iceocean M /issm/trunk-jpl/jenkins/ross-debian\_linux-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: Added now separate —with-parmetis-dir option to configs; medipack/codipack source is now expanded to src directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#199} with diff file ISSM-26036-26037.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/wrappers/Triangle/Triangle.h M /issm/trunk-jpl/src/wrappers/javascript/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/include/wrapper\_macros.h M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Reverting temporarily\\
+\vspace{3em}
+
+\noindent \textbf{Change \#200} with diff file ISSM-26037-26038.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: trying to fix Solid Earth run\\
+\vspace{3em}
+
+\noindent \textbf{Change \#201} with diff file ISSM-26038-26039.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing inversion of drag SSA elementwise\\
+\vspace{3em}
+
+\noindent \textbf{Change \#202} with diff file ISSM-26039-26040.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh A /issm/trunk-jpl/externalpackages/mingw-mex A /issm/trunk-jpl/externalpackages/mingw-mex/README A /issm/trunk-jpl/externalpackages/mingw-mex/configuremingw.p A /issm/trunk-jpl/externalpackages/msmpi A /issm/trunk-jpl/externalpackages/msmpi/install.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh M /issm/trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/solve/waitonlock.m\\
+Export determination: 6. \\
+Rationale: CHG: Modified configuration files for Windows build; external packages for MS-MPI and MinGW MEX; minor clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#203} with diff file ISSM-26040-26041.diff: \\
+Function name: \\
+D /issm/trunk-jpl/scripts/win-msys2-create\_local\_msmpi\_dir.sh\\
+Export determination: 6. \\
+Rationale: CHG: Modified configuration files for Windows build; external packages for MS-MPI and MinGW MEX; minor clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#204} with diff file ISSM-26041-26042.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m\\
+Export determination: 6. \\
+Rationale: CHG: can provide path to dataset\\
+\vspace{3em}
+
+\noindent \textbf{Change \#205} with diff file ISSM-26042-26043.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m\\
+Export determination: 6. \\
+Rationale: CHG: added some documentation and made sure that interpBedmachine Ant and Green are similar\\
+\vspace{3em}
+
+\noindent \textbf{Change \#206} with diff file ISSM-26043-26044.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#207} with diff file ISSM-26044-26045.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Recommitting changes for Windows build (tested on macOS now)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#208} with diff file ISSM-26045-26046.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Missing Windows control structures\\
+\vspace{3em}
+
+\noindent \textbf{Change \#209} with diff file ISSM-26046-26047.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Fix for Dakota linked missing symbols\\
+\vspace{3em}
+
+\noindent \textbf{Change \#210} with diff file ISSM-26047-26048.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/analyses.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h M /issm/trunk-jpl/src/c/analyses/Analysis.h M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.h M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h M /issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h M /issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.h M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.h M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.h M /issm/trunk-jpl/src/c/analyses/EsaAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EsaAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h M /issm/trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.h D /issm/trunk-jpl/src/c/analyses/GiaAnalysis.cpp D /issm/trunk-jpl/src/c/analyses/GiaAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h A /issm/trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp A /issm/trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.h M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.h M /issm/trunk-jpl/src/c/analyses/LoveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LoveAnalysis.h M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.h M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.h A /issm/trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp A /issm/trunk-jpl/src/c/analyses/OceantransportAnalysis.h M /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SamplingAnalysis.h M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.h M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.h M /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmoothAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.h M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.h M /issm/trunk-jpl/src/c/analyses/analyses.h M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.h M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/Profiler.h M /issm/trunk-jpl/src/c/cores/CorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/esa\_core.cpp D /issm/trunk-jpl/src/c/cores/gia\_core.cpp M /issm/trunk-jpl/src/c/cores/hydrology\_core.cpp M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp A /issm/trunk-jpl/src/c/cores/oceantransport\_core.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/main/issm.cpp M /issm/trunk-jpl/src/c/main/issm\_slc.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp A /issm/trunk-jpl/src/c/modules/MmeToInputFromIdx A /issm/trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp A /issm/trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.h M /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m M /issm/trunk-jpl/src/m/classes/dsl.m M /issm/trunk-jpl/src/m/classes/dslmme.m M /issm/trunk-jpl/src/m/classes/fourierlove.m M /issm/trunk-jpl/src/m/classes/geometry.m D /issm/trunk-jpl/src/m/classes/giaivins.js D /issm/trunk-jpl/src/m/classes/giaivins.m D /issm/trunk-jpl/src/m/classes/giaivins.py D /issm/trunk-jpl/src/m/classes/giamme.m D /issm/trunk-jpl/src/m/classes/giamme.py M /issm/trunk-jpl/src/m/classes/hydrologyshreve.m A /issm/trunk-jpl/src/m/classes/hydrologytws.m M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/lovenumbers.m M /issm/trunk-jpl/src/m/classes/matdamageice.m M /issm/trunk-jpl/src/m/classes/matenhancedice.m M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/matestar.m M /issm/trunk-jpl/src/m/classes/matice.m M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/sealevelmodel.m M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/src/m/classes/transient.m M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m M /issm/trunk-jpl/src/m/dev/devpath.m M /issm/trunk-jpl/src/m/plot/radarpower.m M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solveslm.m M /issm/trunk-jpl/test/NightlyRun/test2001.m M /issm/trunk-jpl/test/Par/SquareSheetConstrained.par\\
+Export determination: 6. \\
+Rationale: CHG: huge commit on solid earth capability rewrite. Complete cleanup of the sea level core. New mass transport capabilities for ocean and tws. No more giacore. GiaIvins folded into the sea level core. Debugging of Materials.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#211} with diff file ISSM-26048-26049.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed issue with misname.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#212} with diff file ISSM-26049-26050.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.h\\
+Export determination: 6. \\
+Rationale: CHG: removing GIA shielding.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#213} with diff file ISSM-26050-26051.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moving from GIA to SEALEVEL\\
+\vspace{3em}
+
+\noindent \textbf{Change \#214} with diff file ISSM-26051-26052.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#215} with diff file ISSM-26052-26053.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/Profiler.h\\
+Export determination: 6. \\
+Rationale: CHG: removed HAVE\_GIA directives.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#216} with diff file ISSM-26053-26054.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/ValleyGlacierShelf.par M /issm/trunk-jpl/test/Par/ValleyGlacierShelf.py\\
+Export determination: 6. \\
+Rationale: CHG: isgia not needed anymore.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#217} with diff file ISSM-26054-26055.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2005.m M /issm/trunk-jpl/test/NightlyRun/test2005.py M /issm/trunk-jpl/test/NightlyRun/test2006.m M /issm/trunk-jpl/test/NightlyRun/test2006.py M /issm/trunk-jpl/test/NightlyRun/test801.m M /issm/trunk-jpl/test/NightlyRun/test801.py M /issm/trunk-jpl/test/NightlyRun/test802.m M /issm/trunk-jpl/test/NightlyRun/test802.py M /issm/trunk-jpl/test/NightlyRun/test803.m M /issm/trunk-jpl/test/NightlyRun/test803.py M /issm/trunk-jpl/test/NightlyRun/test804.m M /issm/trunk-jpl/test/NightlyRun/test804.py M /issm/trunk-jpl/test/NightlyRun/test805.m M /issm/trunk-jpl/test/NightlyRun/test805.py M /issm/trunk-jpl/test/NightlyRun/test806.m M /issm/trunk-jpl/test/NightlyRun/test806.py M /issm/trunk-jpl/test/NightlyRun/test807.m M /issm/trunk-jpl/test/NightlyRun/test807.py M /issm/trunk-jpl/test/NightlyRun/test808.m M /issm/trunk-jpl/test/NightlyRun/test808.py M /issm/trunk-jpl/test/NightlyRun/test809.m M /issm/trunk-jpl/test/NightlyRun/test809.py\\
+Export determination: 6. \\
+Rationale: CHG: removed isgia flag.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#218} with diff file ISSM-26055-26056.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/esa\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: wrong type of iscoupler, should be int instead of bool.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#219} with diff file ISSM-26056-26057.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing AD\\
+\vspace{3em}
+
+\noindent \textbf{Change \#220} with diff file ISSM-26057-26058.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/main/esmfbinders.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed some valgrind stuff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#221} with diff file ISSM-26058-26059.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: CHG: accidental commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#222} with diff file ISSM-26059-26060.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m M /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py M /issm/trunk-jpl/src/m/classes/dsl.m M /issm/trunk-jpl/src/m/classes/dsl.py M /issm/trunk-jpl/src/m/classes/dslmme.m M /issm/trunk-jpl/src/m/classes/dslmme.py M /issm/trunk-jpl/src/m/classes/fourierlove.m M /issm/trunk-jpl/src/m/classes/fourierlove.py M /issm/trunk-jpl/src/m/classes/geometry.m M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/classes/hydrologydc.py M /issm/trunk-jpl/src/m/classes/hydrologyshreve.m M /issm/trunk-jpl/src/m/classes/hydrologyshreve.py M /issm/trunk-jpl/src/m/classes/hydrologytws.m A /issm/trunk-jpl/src/m/classes/hydrologytws.py M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/matdamageice.m M /issm/trunk-jpl/src/m/classes/matdamageice.py M /issm/trunk-jpl/src/m/classes/matenhancedice.m M /issm/trunk-jpl/src/m/classes/matenhancedice.py M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/matestar.m M /issm/trunk-jpl/src/m/classes/matestar.py M /issm/trunk-jpl/src/m/classes/matice.m M /issm/trunk-jpl/src/m/classes/matice.py M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/classes/sealevelmodel.m M /issm/trunk-jpl/src/m/classes/sealevelmodel.py M /issm/trunk-jpl/src/m/classes/surfaceload.m M /issm/trunk-jpl/src/m/classes/transient.m M /issm/trunk-jpl/src/m/classes/transient.py M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.m M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py A /issm/trunk-jpl/src/m/plot/radarpower.py M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py M /issm/trunk-jpl/src/m/solve/solveslm.m A /issm/trunk-jpl/src/m/solve/solveslm.py M /issm/trunk-jpl/test/NightlyRun/test2001.m M /issm/trunk-jpl/test/NightlyRun/test2001.py\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python API translations for recent SE changes; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#223} with diff file ISSM-26060-26061.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.py\\
+Export determination: 6. \\
+Rationale: CHG: Missing Python translation; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#224} with diff file ISSM-26061-26062.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solvers/mumpsnoneoptions.py M /issm/trunk-jpl/src/m/solvers/mumpsoptions.py\\
+Export determination: 6. \\
+Rationale: BUG: fix to the toolkit writing of mumps options\\
+\vspace{3em}
+
+\noindent \textbf{Change \#225} with diff file ISSM-26062-26063.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/geometry.m M /issm/trunk-jpl/src/m/classes/matice.m\\
+Export determination: 6. \\
+Rationale: BUG: Call to function size; missing end\\
+\vspace{3em}
+
+\noindent \textbf{Change \#226} with diff file ISSM-26063-26064.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/export\_netCDF.py M /issm/trunk-jpl/src/m/io/loadvars.py\\
+Export determination: 6. \\
+Rationale: CHG: update to netCDF import export\\
+\vspace{3em}
+
+\noindent \textbf{Change \#227} with diff file ISSM-26064-26065.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/transient.py\\
+Export determination: 6. \\
+Rationale: BUG: Typo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#228} with diff file ISSM-26065-26066.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/matdamageice.m M /issm/trunk-jpl/src/m/classes/matdamageice.py\\
+Export determination: 6. \\
+Rationale: BUG: Missed class member variable removal; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#229} with diff file ISSM-26066-26067.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/dsl.m M /issm/trunk-jpl/src/m/classes/dsl.py M /issm/trunk-jpl/src/m/parameterization/parameterize.py M /issm/trunk-jpl/test/Par/SquareSheetConstrained.par M /issm/trunk-jpl/test/Par/SquareSheetConstrained.py\\
+Export determination: 6. \\
+Rationale: BUG: Missing initialize member function; removed GIA from parameterization file; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#230} with diff file ISSM-26067-26068.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2002.m\\
+Export determination: 6. \\
+Rationale: CHG: Removed references to solidearth.surfaceload; committing so Eric can advise on solution type\\
+\vspace{3em}
+
+\noindent \textbf{Change \#231} with diff file ISSM-26068-26069.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2002.m\\
+Export determination: 6. \\
+Rationale: CHG: Reverting changes as Eric and Lambert are still working on SE tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#232} with diff file ISSM-26069-26070.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing Ivins Echo statements.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#233} with diff file ISSM-26070-26071.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: making sure delta thickness is computed correctly.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#234} with diff file ISSM-26071-26072.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.h\\
+Export determination: 6. \\
+Rationale: CHG: added DeepEcho(int enum\_type) capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#235} with diff file ISSM-26072-26073.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed segfault.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#236} with diff file ISSM-26073-26074.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/IoModel.h M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.h M /issm/trunk-jpl/test/NightlyRun/test2001.m\\
+Export determination: 6. \\
+Rationale: CHG: fixed test2001 by modifying the mass transport core. Now create inputs directly in the core, not the MassTransportAnalysis::InputUpdateFromSolution. Also need a new IoModel::InputToConstant routine.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#237} with diff file ISSM-26074-26075.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing debugging statements.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#238} with diff file ISSM-26075-26076.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp M /issm/trunk-jpl/src/c/cores/hydrology\_core.cpp M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp M /issm/trunk-jpl/test/NightlyRun/test2001.m\\
+Export determination: 6. \\
+Rationale: CHG: removed GIA rates from the test2001 archives. Transferred new SolidEarthUpdates logic to tws mass transport.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#239} with diff file ISSM-26076-26077.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp M /issm/trunk-jpl/src/c/cores/oceantransport\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: transferred SolidEarthIceUpdates and SolidEarthWaterUpdates to OceantransportAnalysis and oceantransport\_core using a SolidEarthOceanUpdates.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#240} with diff file ISSM-26077-26078.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2003.m M /issm/trunk-jpl/test/NightlyRun/test2004.m\\
+Export determination: 6. \\
+Rationale: update of slc tests to new structure: loads are now in masstransport.spcthickness, solution is now Transient, added configuration in solidearth.settings, initialsealevel now in initialization.sealevel\\
+\vspace{3em}
+
+\noindent \textbf{Change \#241} with diff file ISSM-26078-26079.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2001.m\\
+Export determination: 6. \\
+Rationale: CHG: took out high verbose level.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#242} with diff file ISSM-26079-26080.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: avoid looking for vertex on base if you are a Mesh 3D Surface domain type\\
+\vspace{3em}
+
+\noindent \textbf{Change \#243} with diff file ISSM-26080-26081.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/sealevelmodel.m\\
+Export determination: 6. \\
+Rationale: BUG: wrong syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#244} with diff file ISSM-26081-26082.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/dev/issmversion.m M /issm/trunk-jpl/src/m/dev/issmversion.py\\
+Export determination: 6. \\
+Rationale: CHG: we are in 2021 now...\\
+\vspace{3em}
+
+\noindent \textbf{Change \#245} with diff file ISSM-26082-26083.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: mumps requires parmetis\\
+\vspace{3em}
+
+\noindent \textbf{Change \#246} with diff file ISSM-26083-26084.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/frictioncoulomb2.m M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: CHG: fixing load with changing class names and fields\\
+\vspace{3em}
+
+\noindent \textbf{Change \#247} with diff file ISSM-26084-26085.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/depthaverage\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added exception for 3Dsurface domain type.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#248} with diff file ISSM-26085-26086.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/extrudefrombase\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added exception for 3Dsurface domain type.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#249} with diff file ISSM-26086-26087.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added exception for 3Dsurface domain type.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#250} with diff file ISSM-26087-26088.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2001.m\\
+Export determination: 6. \\
+Rationale: reverting to 3 cpus\\
+\vspace{3em}
+
+\noindent \textbf{Change \#251} with diff file ISSM-26088-26089.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing debug statements.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#252} with diff file ISSM-26089-26090.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/cores/extrudefromtop\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing segfault in 3d surface\\
+\vspace{3em}
+
+\noindent \textbf{Change \#253} with diff file ISSM-26090-26091.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp M /issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp M /issm/trunk-jpl/src/c/classes/Cfsurfacesquare.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp M /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp M /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp M /issm/trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: automatically delete collapsed element without looking at domainttype\\
+\vspace{3em}
+
+\noindent \textbf{Change \#254} with diff file ISSM-26091-26092.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/Vertex.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing some things for test2002\\
+\vspace{3em}
+
+\noindent \textbf{Change \#255} with diff file ISSM-26092-26093.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Adjustments for Windows builds\\
+\vspace{3em}
+
+\noindent \textbf{Change \#256} with diff file ISSM-26093-26094.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/configs/3.14 A /issm/trunk-jpl/externalpackages/petsc/configs/3.14/win A /issm/trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2 A /issm/trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2/mingw64 A /issm/trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config A /issm/trunk-jpl/externalpackages/petsc/configs/3.14/win/msys2/mingw64/config/configure.py M /issm/trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh\\
+Export determination: 6. \\
+Rationale: CHG: Adjustments for Windows builds\\
+\vspace{3em}
+
+\noindent \textbf{Change \#257} with diff file ISSM-26094-26095.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Fix for bad control; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#258} with diff file ISSM-26095-26096.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/jenkins.sh\\
+Export determination: 6. \\
+Rationale: CHG: Stupid typo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#259} with diff file ISSM-26096-26097.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/io/loadvars.py\\
+Export determination: 6. \\
+Rationale: CHG:change to the nc loader to take into account saved field that do not exist anymore.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#260} with diff file ISSM-26097-26098.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed issue with unfound MatLitho.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#261} with diff file ISSM-26098-26099.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/SandBox/test2002.m\\
+Export determination: 6. \\
+Rationale: CHG test to allow transition from svn repo 26083 to ne wclean repo.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#262} with diff file ISSM-26099-26100.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/analyses.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.h M /issm/trunk-jpl/src/c/cores/oceantransport\_core.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp A /issm/trunk-jpl/src/c/modules/ElementCoordinatesx A /issm/trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp A /issm/trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/test/NightlyRun/test2002.m\\
+Export determination: 6. \\
+Rationale: CHG: new ElementCoordinatesx module, use for an optimized version of the sea level core. Many bug fixes to get test2002 to run.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#263} with diff file ISSM-26100-26101.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2003.m\\
+Export determination: 6. \\
+Rationale: CHG: adapting to new framework.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#264} with diff file ISSM-26101-26102.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp\\
+Export determination: 6. \\
+Rationale: BUG: trying to fix AD and rewrote some portions of the code\\
+\vspace{3em}
+
+\noindent \textbf{Change \#265} with diff file ISSM-26102-26103.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/linux64\_caladan\_ad M /issm/trunk-jpl/jenkins/linux64\_caladan\_ampi M /issm/trunk-jpl/jenkins/pine\_island-mac-adolc-ampion M /issm/trunk-jpl/jenkins/ross-debian\_linux-adolc-ampioff M /issm/trunk-jpl/jenkins/ross-debian\_linux-adolc-ampion M /issm/trunk-jpl/jenkins/ross-debian\_linux-codipack M /issm/trunk-jpl/jenkins/ross-debian\_linux-javascript M /issm/trunk-jpl/jenkins/windows M /issm/trunk-jpl/jenkins/windows-par M /issm/trunk-jpl/jenkins/windows\_static\\
+Export determination: 6. \\
+Rationale: CHG: Gia does not exist anymore, replaced by Sealevelchange\\
+\vspace{3em}
+
+\noindent \textbf{Change \#266} with diff file ISSM-26103-26104.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moveing Element Coordinate outside of sealevel stuff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#267} with diff file ISSM-26104-26105.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing AD with Sealevel change\\
+\vspace{3em}
+
+\noindent \textbf{Change \#268} with diff file ISSM-26105-26106.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: GIA -> SEALEVELCHANGE\\
+\vspace{3em}
+
+\noindent \textbf{Change \#269} with diff file ISSM-26106-26107.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: memory leak\\
+\vspace{3em}
+
+\noindent \textbf{Change \#270} with diff file ISSM-26107-26108.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added test on size to avoid segmentation faults\\
+\vspace{3em}
+
+\noindent \textbf{Change \#271} with diff file ISSM-26108-26109.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: Activating 2002 + 2003 on Linux.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#272} with diff file ISSM-26109-26110.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: ommit full extent of modules not needed by Ivins model GIA computations.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#273} with diff file ISSM-26110-26111.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp A /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp A /issm/trunk-jpl/src/c/classes/BarystaticContributions.h M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/classes.h M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h M /issm/trunk-jpl/src/c/toolkits/objects/Matrix.h M /issm/trunk-jpl/src/c/toolkits/objects/Vector.h M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.h M /issm/trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h M /issm/trunk-jpl/test/NightlyRun/test2004.m\\
+Export determination: 6. \\
+Rationale: CHG: new synthesis of the GRD module in sealevelchange\_core using the new approach for convolutions.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#274} with diff file ISSM-26111-26112.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp\\
+Export determination: 6. \\
+Rationale: CHG: missing file.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#275} with diff file ISSM-26112-26113.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/objects/Matrix.h\\
+Export determination: 6. \\
+Rationale: BUG: calling the right method\\
+\vspace{3em}
+
+\noindent \textbf{Change \#276} with diff file ISSM-26113-26114.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.h\\
+Export determination: 6. \\
+Rationale: CHG: not needed.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#277} with diff file ISSM-26114-26115.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h\\
+Export determination: 6. \\
+Rationale: CHG: had taken out these routines which are needed!\\
+\vspace{3em}
+
+\noindent \textbf{Change \#278} with diff file ISSM-26115-26116.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h\\
+Export determination: 6. \\
+Rationale: CHG: new methods implemented.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#279} with diff file ISSM-26116-26117.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removed debug statement.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#280} with diff file ISSM-26117-26118.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/toolkits/objects/Matrix.h M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h M /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatToMPISerial.cpp D /issm/trunk-jpl/src/c/toolkits/petsc/patches/MatToSerial.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h\\
+Export determination: 6. \\
+Rationale: BUG: fixing problem with matrix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#281} with diff file ISSM-26118-26119.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moving some enums from inputs to params.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#282} with diff file ISSM-26119-26120.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: rearranging sea level optimized core.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#283} with diff file ISSM-26120-26121.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh\\
+Export determination: 6. \\
+Rationale: CHG: remove analysis update.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#284} with diff file ISSM-26121-26122.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp M /issm/trunk-jpl/src/c/classes/BarystaticContributions.h M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/Inputs/Input.h M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.h M /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.h M /issm/trunk-jpl/src/c/cores/hydrology\_core.cpp M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp M /issm/trunk-jpl/src/c/cores/oceantransport\_core.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/test/NightlyRun/test2004.m\\
+Export determination: 6. \\
+Rationale: CHG: fully fleshed out implementation of the new sea level convolution based on element load distribution across the cluster.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#285} with diff file ISSM-26122-26123.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c\\
+Export determination: 6. \\
+Rationale: CHG: ignore issm\_slc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#286} with diff file ISSM-26123-26124.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: Check for zsh usage before running setopt\\
+\vspace{3em}
+
+\noindent \textbf{Change \#287} with diff file ISSM-26124-26125.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: CHG: Restoring preferred compiler orders\\
+\vspace{3em}
+
+\noindent \textbf{Change \#288} with diff file ISSM-26125-26126.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/dev/devpath.m\\
+Export determination: 6. \\
+Rationale: BUG: MEALPix pix2ang needed for test2020\\
+\vspace{3em}
+
+\noindent \textbf{Change \#289} with diff file ISSM-26126-26127.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/solidearthsettings.m\\
+Export determination: 6. \\
+Rationale: CHG: fixing bugs in optimized sea level core. Running side by side with optim flag.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#290} with diff file ISSM-26127-26128.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/io/loadvars.py\\
+Export determination: 6. \\
+Rationale: BUG: fix to netCDF load to deal with old files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#291} with diff file ISSM-26128-26129.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/io/loadvars.py\\
+Export determination: 6. \\
+Rationale: BUG: fix to netCDF load to deal with old files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#292} with diff file ISSM-26129-26130.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/io/loadvars.py\\
+Export determination: 6. \\
+Rationale: BUG: fix to netCDF load to deal with old files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#293} with diff file ISSM-26130-26131.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/io/loadvars.py\\
+Export determination: 6. \\
+Rationale: BUG: setting back Debug flag to False\\
+\vspace{3em}
+
+\noindent \textbf{Change \#294} with diff file ISSM-26131-26132.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Node.cpp M /issm/trunk-jpl/src/c/classes/Node.h M /issm/trunk-jpl/src/c/classes/Nodes.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h M /issm/trunk-jpl/src/c/toolkits/issm/Bucket.h M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/patches/NewVec.cpp\\
+Export determination: 6. \\
+Rationale: CHG: big simplification here: we now carry the vectors of fset and sset using the same size as gset, with -1 when they are not in the right set. Example: old\_fset = [1 2 3], new\_fset=[1 -1 2 3 -1 -1]; enjoy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#295} with diff file ISSM-26132-26133.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mono layer HO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#296} with diff file ISSM-26133-26134.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mono layer HO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#297} with diff file ISSM-26134-26135.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mono layer HO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#298} with diff file ISSM-26135-26136.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h\\
+Export determination: 6. \\
+Rationale: BUG: fixing DenseMat with new indices\\
+\vspace{3em}
+
+\noindent \textbf{Change \#299} with diff file ISSM-26136-26137.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Node.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing allocation of doflists with copy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#300} with diff file ISSM-26137-26138.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mono layer HO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#301} with diff file ISSM-26138-26139.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: BUG: reverting melt parameterization\\
+\vspace{3em}
+
+\noindent \textbf{Change \#302} with diff file ISSM-26139-26140.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/lapack/configs/3.9 M /issm/trunk-jpl/jenkins/ross-debian\_linux-dakota M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: Cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#303} with diff file ISSM-26140-26141.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Correcting warning about autom4ke variable names; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#304} with diff file ISSM-26141-26142.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mono layer HO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#305} with diff file ISSM-26142-26143.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: Sean’s updates\\
+\vspace{3em}
+
+\noindent \textbf{Change \#306} with diff file ISSM-26143-26144.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.h\\
+Export determination: 6. \\
+Rationale: CHG: removing some useless fields\\
+\vspace{3em}
+
+\noindent \textbf{Change \#307} with diff file ISSM-26144-26145.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Loads/Channel.cpp M /issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp M /issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp M /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp M /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp M /issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp M /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp M /issm/trunk-jpl/src/c/classes/Node.cpp M /issm/trunk-jpl/src/c/classes/Node.h M /issm/trunk-jpl/src/c/classes/Nodes.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp M /issm/trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: simplifying node as well\\
+\vspace{3em}
+
+\noindent \textbf{Change \#308} with diff file ISSM-26145-26146.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile D /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile.patch A /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c A /issm/trunk-jpl/externalpackages/chaco/install-win-msys2-mingw.sh M /issm/trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic\\
+Export determination: 6. \\
+Rationale: CHG: Remaining packages for Windows basic build\\
+\vspace{3em}
+
+\noindent \textbf{Change \#309} with diff file ISSM-26146-26147.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: various bug fixes.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#310} with diff file ISSM-26147-26148.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp\\
+Export determination: 6. \\
+Rationale: CHG: very serious/crippling bug fix.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#311} with diff file ISSM-26148-26149.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mono layer HO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#312} with diff file ISSM-26149-26150.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp M /issm/trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h\\
+Export determination: 6. \\
+Rationale: CHG: ElementCoordinatesx now also returns areas. BarystaticContributions bsl components have right sign . Tria: idem + debugged GeometryOptim G which was not synced with the variable area.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#313} with diff file ISSM-26150-26151.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#314} with diff file ISSM-26151-26152.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed barystatic average.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#315} with diff file ISSM-26152-26153.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/SealevelMasks.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: SealevelMasks is not working on nel, but rather on local number of elements! sealevelchange\_core and Tria.cpp: need a routine to shift only on ocean for mass conservation.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#316} with diff file ISSM-26153-26154.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: no dummy required.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#317} with diff file ISSM-26154-26155.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test339.m M /issm/trunk-jpl/test/NightlyRun/test339.py\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#318} with diff file ISSM-26155-26156.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp M /issm/trunk-jpl/src/c/cores/stressbalance\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mono layer HO - not fully tested\\
+\vspace{3em}
+
+\noindent \textbf{Change \#319} with diff file ISSM-26156-26157.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/Makefile M /issm/trunk-jpl/externalpackages/chaco/configs/win/msys2/mingw64/src/code/util/seconds.c M /issm/trunk-jpl/externalpackages/semic/install.sh M /issm/trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/modules/Chacox/chaco\_seconds.cpp M /issm/trunk-jpl/test/NightlyRun/IdFromString.m\\
+Export determination: 6. \\
+Rationale: CHG: Further configuration changes to make Chaco work under MSYS2 MinGW; moved SEMIC libraries to /lib; changed awk for cut in IdFromString as there seems to be a quoting issues under Windows and/or MSYS2; expanded Windows Basic build test suite\\
+\vspace{3em}
+
+\noindent \textbf{Change \#320} with diff file ISSM-26157-26158.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: missing Bed in inputs!\\
+\vspace{3em}
+
+\noindent \textbf{Change \#321} with diff file ISSM-26158-26159.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed old code issues with masks in sea level core.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#322} with diff file ISSM-26159-26160.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive131.arch A /issm/trunk-jpl/test/Archives/Archive132.arch A /issm/trunk-jpl/test/Archives/Archive133.arch A /issm/trunk-jpl/test/Archives/Archive491.arch A /issm/trunk-jpl/test/Archives/Archive492.arch A /issm/trunk-jpl/test/Archives/Archive493.arch A /issm/trunk-jpl/test/Archives/Archive494.arch A /issm/trunk-jpl/test/Archives/Archive495.arch A /issm/trunk-jpl/test/NightlyRun/test131.m A /issm/trunk-jpl/test/NightlyRun/test131.py A /issm/trunk-jpl/test/NightlyRun/test132.m A /issm/trunk-jpl/test/NightlyRun/test132.py A /issm/trunk-jpl/test/NightlyRun/test133.m A /issm/trunk-jpl/test/NightlyRun/test133.py A /issm/trunk-jpl/test/NightlyRun/test491.m A /issm/trunk-jpl/test/NightlyRun/test491.py A /issm/trunk-jpl/test/NightlyRun/test492.m A /issm/trunk-jpl/test/NightlyRun/test492.py A /issm/trunk-jpl/test/NightlyRun/test493.m A /issm/trunk-jpl/test/NightlyRun/test493.py A /issm/trunk-jpl/test/NightlyRun/test494.m A /issm/trunk-jpl/test/NightlyRun/test494.py A /issm/trunk-jpl/test/NightlyRun/test495.m A /issm/trunk-jpl/test/NightlyRun/test495.py\\
+Export determination: 6. \\
+Rationale: ADD: added tests to check stabilization schemes for mass transport equation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#323} with diff file ISSM-26160-26161.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: better error message:\\
+\vspace{3em}
+
+\noindent \textbf{Change \#324} with diff file ISSM-26161-26162.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: CHG: added super cool function to refine 4x a mesh automatically\\
+\vspace{3em}
+
+\noindent \textbf{Change \#325} with diff file ISSM-26162-26163.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Inversion/runme.m M /issm/trunk-jpl/jenkins/examples\_tests.sh\\
+Export determination: 6. \\
+Rationale: CHG: Minor formatting\\
+\vspace{3em}
+
+\noindent \textbf{Change \#326} with diff file ISSM-26163-26164.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test494.py\\
+Export determination: 6. \\
+Rationale: CHG: Corrected tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#327} with diff file ISSM-26164-26165.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: test2002 replicated between old and new code.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#328} with diff file ISSM-26165-26166.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/test/NightlyRun/test2001.m M /issm/trunk-jpl/test/NightlyRun/test2002.m\\
+Export determination: 6. \\
+Rationale: CHG: hooking the new optimized code and removing the old one. Moving everything away from FemModel into the sea level core (including Ivins deformation model).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#329} with diff file ISSM-26166-26167.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/dlcheng/zoneaverage.m\\
+Export determination: 6. \\
+Rationale: ADD: initial zoneaverage function for distance/area weighted averaging of fields using another field.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#330} with diff file ISSM-26167-26168.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.h\\
+Export determination: 6. \\
+Rationale: CHG: fixing AD with new LevelsetAverage\\
+\vspace{3em}
+
+\noindent \textbf{Change \#331} with diff file ISSM-26168-26169.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic M /issm/trunk-jpl/src/m/classes/clusters/generic.m\\
+Export determination: 6. \\
+Rationale: CHG: Deactivating tests for restart under Windows (for now)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#332} with diff file ISSM-26169-26170.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test494.m M /issm/trunk-jpl/test/NightlyRun/test494.py\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#333} with diff file ISSM-26170-26171.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: implemented transientinput marshall\\
+\vspace{3em}
+
+\noindent \textbf{Change \#334} with diff file ISSM-26171-26172.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: Better library discovery for Python installed via Homebrew\\
+\vspace{3em}
+
+\noindent \textbf{Change \#335} with diff file ISSM-26172-26173.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added support for DatasetInput\\
+\vspace{3em}
+
+\noindent \textbf{Change \#336} with diff file ISSM-26173-26174.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test494.m M /issm/trunk-jpl/test/NightlyRun/test494.py\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#337} with diff file ISSM-26174-26175.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#338} with diff file ISSM-26175-26176.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp\\
+Export determination: 6. \\
+Rationale: BUG:fixed a bug to get NaN when using Schoof law with AD\\
+\vspace{3em}
+
+\noindent \textbf{Change \#339} with diff file ISSM-26176-26177.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test494.m M /issm/trunk-jpl/test/NightlyRun/test494.py\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#340} with diff file ISSM-26177-26178.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing smb\_core call from hydr as it is dealt with differently now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#341} with diff file ISSM-26178-26179.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/dslmme.py M /issm/trunk-jpl/src/m/classes/lovenumbers.py M /issm/trunk-jpl/src/m/classes/nodalvalue.py M /issm/trunk-jpl/src/m/classes/rotational.py M /issm/trunk-jpl/src/m/classes/solidearthsettings.py M /issm/trunk-jpl/src/m/classes/surfaceload.py M /issm/trunk-jpl/src/m/consistency/checkfield.py M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/export\_netCDF.py M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py\\
+Export determination: 6. \\
+Rationale: CHG: minor syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#342} with diff file ISSM-26179-26180.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/classes/clusters/stallo.m D /issm/trunk-jpl/src/m/classes/clusters/stallo.py\\
+Export determination: 6. \\
+Rationale: CHG: decomissioned clusters\\
+\vspace{3em}
+
+\noindent \textbf{Change \#343} with diff file ISSM-26180-26181.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py\\
+Export determination: 6. \\
+Rationale: CHG: adding range type to some functions type possibilities\\
+\vspace{3em}
+
+\noindent \textbf{Change \#344} with diff file ISSM-26181-26182.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/miscellaneous/prctile\_issm.py\\
+Export determination: 6. \\
+Rationale: CHG: adding special case for ints\\
+\vspace{3em}
+
+\noindent \textbf{Change \#345} with diff file ISSM-26182-26183.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plotmodel.py\\
+Export determination: 6. \\
+Rationale: CHG: better subplot handling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#346} with diff file ISSM-26183-26184.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py D /issm/trunk-jpl/src/m/classes/clusters/hexagon.py D /issm/trunk-jpl/src/m/classes/clusters/vilje.m D /issm/trunk-jpl/src/m/classes/clusters/vilje.py M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/coordsystems/gmtmask.m M /issm/trunk-jpl/src/m/coordsystems/gmtmask.py M /issm/trunk-jpl/src/m/dev/devpath.m M /issm/trunk-jpl/src/m/dev/devpath.py M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py M /issm/trunk-jpl/src/m/miscellaneous/normfit\_issm.py M /issm/trunk-jpl/src/m/partition/partitioner.py M /issm/trunk-jpl/src/m/qmu/dakota\_out\_parse.py M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py\\
+Export determination: 6. \\
+Rationale: CHG: cleaning decomissioned clusters\\
+\vspace{3em}
+
+\noindent \textbf{Change \#347} with diff file ISSM-26184-26185.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py A /issm/trunk-jpl/src/m/classes/clusters/hexagon.py (from /issm/trunk-jpl/src/m/classes/clusters/hexagon.py:26182) A /issm/trunk-jpl/src/m/classes/clusters/vilje.m (from /issm/trunk-jpl/src/m/classes/clusters/vilje.m:26182) A /issm/trunk-jpl/src/m/classes/clusters/vilje.py (from /issm/trunk-jpl/src/m/classes/clusters/vilje.py:26182) M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/coordsystems/gmtmask.m M /issm/trunk-jpl/src/m/coordsystems/gmtmask.py M /issm/trunk-jpl/src/m/dev/devpath.m M /issm/trunk-jpl/src/m/dev/devpath.py M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py M /issm/trunk-jpl/src/m/miscellaneous/normfit\_issm.py M /issm/trunk-jpl/src/m/partition/partitioner.py M /issm/trunk-jpl/src/m/plot/plotmodel.py M /issm/trunk-jpl/src/m/qmu/dakota\_out\_parse.py M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py\\
+Export determination: 6. \\
+Rationale: BUG:reverting unwanted changes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#348} with diff file ISSM-26185-26186.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/classes/clusters/hexagon.py D /issm/trunk-jpl/src/m/classes/clusters/vilje.m D /issm/trunk-jpl/src/m/classes/clusters/vilje.py M /issm/trunk-jpl/src/m/classes/model.py\\
+Export determination: 6. \\
+Rationale: CHG: cleaning decomissioned clusters\\
+\vspace{3em}
+
+\noindent \textbf{Change \#349} with diff file ISSM-26186-26187.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py\\
+Export determination: 6. \\
+Rationale: BUG: range seems to be an issue, reverting for now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#350} with diff file ISSM-26187-26188.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/m/classes/friction.m M /issm/trunk-jpl/src/m/classes/friction.py M /issm/trunk-jpl/src/m/classes/frictionschoof.m M /issm/trunk-jpl/src/m/classes/frictionschoof.py\\
+Export determination: 6. \\
+Rationale: CHG: added possibility to couple with friciton schoof\\
+\vspace{3em}
+
+\noindent \textbf{Change \#351} with diff file ISSM-26188-26189.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m\\
+Export determination: 6. \\
+Rationale: BUG: fixing path\\
+\vspace{3em}
+
+\noindent \textbf{Change \#352} with diff file ISSM-26189-26190.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test494.m M /issm/trunk-jpl/test/NightlyRun/test494.py\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#353} with diff file ISSM-26190-26191.diff: \\
+Function name: \\
+M /issm/trunk-jpl/scripts/DownloadExamplesDatasets.sh\\
+Export determination: 6. \\
+Rationale: CHG: Create optional output directory for examples datasets if if it does not already exist\\
+\vspace{3em}
+
+\noindent \textbf{Change \#354} with diff file ISSM-26191-26192.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/frictionweertman.m\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#355} with diff file ISSM-26192-26193.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m\\
+Export determination: 6. \\
+Rationale: CHG: working on Mono Layer. Keeping Shear velocities in inputs (VxShear/VyShear). VxBase/VyBase are now Vx/Vy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#356} with diff file ISSM-26193-26194.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py\\
+Export determination: 6. \\
+Rationale: CHG: change python file too\\
+\vspace{3em}
+
+\noindent \textbf{Change \#357} with diff file ISSM-26194-26195.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#358} with diff file ISSM-26195-26196.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/timestepping.js M /issm/trunk-jpl/src/m/classes/timestepping.m M /issm/trunk-jpl/src/m/classes/timestepping.py M /issm/trunk-jpl/src/m/classes/timesteppingadaptive.js M /issm/trunk-jpl/src/m/classes/timesteppingadaptive.m M /issm/trunk-jpl/src/m/classes/timesteppingadaptive.py\\
+Export determination: 6. \\
+Rationale: CHG: added cycle through forcing field, not implemented in C++ yet\\
+\vspace{3em}
+
+\noindent \textbf{Change \#359} with diff file ISSM-26196-26197.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.h M /issm/trunk-jpl/src/c/classes/Params/TransientArrayParam.cpp M /issm/trunk-jpl/src/c/classes/Params/TransientArrayParam.h M /issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp M /issm/trunk-jpl/src/c/classes/Params/TransientParam.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: preparing for cycling forcing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#360} with diff file ISSM-26197-26198.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added cycling inputs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#361} with diff file ISSM-26198-26199.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test493.m M /issm/trunk-jpl/test/NightlyRun/test493.py\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#362} with diff file ISSM-26199-26200.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: hack for Nicole\\
+\vspace{3em}
+
+\noindent \textbf{Change \#363} with diff file ISSM-26200-26201.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added comment\\
+\vspace{3em}
+
+\noindent \textbf{Change \#364} with diff file ISSM-26201-26202.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/Makefile.am D /issm/trunk-jpl/src/mobile\\
+Export determination: 6. \\
+Rationale: CHG: not needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#365} with diff file ISSM-26202-26203.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/expcontourlevelzero.m\\
+Export determination: 6. \\
+Rationale: CHG: minor more doc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#366} with diff file ISSM-26203-26204.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac\\
+Export determination: 6. \\
+Rationale: CHG: no more mobile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#367} with diff file ISSM-26204-26205.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py\\
+Export determination: 6. \\
+Rationale: CHG: working on MLHO, adding new Enums: vxBase, vyBase, vxSurface, vySurface\\
+\vspace{3em}
+
+\noindent \textbf{Change \#368} with diff file ISSM-26205-26206.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on mlho: computing vertically averaged velocities\\
+\vspace{3em}
+
+\noindent \textbf{Change \#369} with diff file ISSM-26206-26207.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.h\\
+Export determination: 6. \\
+Rationale: BUG: fixing friction computation for MLHO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#370} with diff file ISSM-26207-26208.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: CGH:minor change in seed for transient sampling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#371} with diff file ISSM-26208-26209.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m M /issm/trunk-jpl/examples/SlrGRACE\_NIMS/runme.m M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/SMBcomponents.m M /issm/trunk-jpl/src/m/classes/SMBcomponents.py M /issm/trunk-jpl/src/m/classes/SMBforcing.m M /issm/trunk-jpl/src/m/classes/SMBforcing.py M /issm/trunk-jpl/src/m/classes/SMBgemb.m M /issm/trunk-jpl/src/m/classes/SMBgemb.py M /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.m M /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/timestepping.m M /issm/trunk-jpl/src/m/classes/timestepping.py M /issm/trunk-jpl/src/m/classes/timesteppingadaptive.m M /issm/trunk-jpl/src/m/classes/timesteppingadaptive.py M /issm/trunk-jpl/test/NightlyRun/test240.m M /issm/trunk-jpl/test/NightlyRun/test240.py M /issm/trunk-jpl/test/NightlyRun/test241.m M /issm/trunk-jpl/test/NightlyRun/test241.py M /issm/trunk-jpl/test/NightlyRun/test242.m M /issm/trunk-jpl/test/NightlyRun/test242.py M /issm/trunk-jpl/test/NightlyRun/test243.m M /issm/trunk-jpl/test/NightlyRun/test243.py M /issm/trunk-jpl/test/NightlyRun/test244.m M /issm/trunk-jpl/test/NightlyRun/test244.py M /issm/trunk-jpl/test/NightlyRun/test247.m M /issm/trunk-jpl/test/NightlyRun/test247.py M /issm/trunk-jpl/test/NightlyRun/test252.m M /issm/trunk-jpl/test/NightlyRun/test252.py M /issm/trunk-jpl/test/NightlyRun/test253.m M /issm/trunk-jpl/test/NightlyRun/test253.py M /issm/trunk-jpl/test/NightlyRun/test292.m M /issm/trunk-jpl/test/NightlyRun/test292.py M /issm/trunk-jpl/test/NightlyRun/test3201.m M /issm/trunk-jpl/test/NightlyRun/test3202.m M /issm/trunk-jpl/test/NightlyRun/test3480.m M /issm/trunk-jpl/test/NightlyRun/test3481.m M /issm/trunk-jpl/test/NightlyRun/test352.m M /issm/trunk-jpl/test/NightlyRun/test352.py M /issm/trunk-jpl/test/NightlyRun/test353.m M /issm/trunk-jpl/test/NightlyRun/test353.py M /issm/trunk-jpl/test/NightlyRun/test354.m M /issm/trunk-jpl/test/NightlyRun/test354.py\\
+Export determination: 6. \\
+Rationale: CHG: clean up GEMB, change interp\_forcings to interp\_forcing, isclimatology is now cycle\_forcing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#372} with diff file ISSM-26209-26210.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBcomponents.m M /issm/trunk-jpl/src/m/classes/SMBforcing.m M /issm/trunk-jpl/src/m/classes/SMBgemb.m M /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.m M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: BUG: isclimatology not transferring correctly to cycle\_forcing from SMB in old models\\
+\vspace{3em}
+
+\noindent \textbf{Change \#373} with diff file ISSM-26210-26211.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing Smb MassBalance Clim enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#374} with diff file ISSM-26211-26212.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: Temporary freeze of MITgcm until inconsistency with repo head is resolved\\
+\vspace{3em}
+
+\noindent \textbf{Change \#375} with diff file ISSM-26212-26213.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/cmake/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: Correction to default install path\\
+\vspace{3em}
+
+\noindent \textbf{Change \#376} with diff file ISSM-26213-26214.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: CHG: fixing solid earth loader\\
+\vspace{3em}
+
+\noindent \textbf{Change \#377} with diff file ISSM-26214-26215.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.csh\\
+Export determination: 6. \\
+Rationale: CHG: remove quotation marks that csh on pfe does not like\\
+\vspace{3em}
+
+\noindent \textbf{Change \#378} with diff file ISSM-26215-26216.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.pfe.patch M /issm/trunk-jpl/externalpackages/dakota/install-6.2-pleiades.sh\\
+Export determination: 6. \\
+Rationale: CHG: use dakota shared libs and update mpi libraries on pfe build\\
+\vspace{3em}
+
+\noindent \textbf{Change \#379} with diff file ISSM-26216-26217.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: Reverting to using repo head\\
+\vspace{3em}
+
+\noindent \textbf{Change \#380} with diff file ISSM-26217-26218.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive4001.arch\\
+Export determination: 6. \\
+Rationale: FIX: updating ice-ocean archive\\
+\vspace{3em}
+
+\noindent \textbf{Change \#381} with diff file ISSM-26218-26219.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive4002.arch\\
+Export determination: 6. \\
+Rationale: FIX: new archive test4002\\
+\vspace{3em}
+
+\noindent \textbf{Change \#382} with diff file ISSM-26219-26220.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/applyoptions.m\\
+Export determination: 6. \\
+Rationale: CHG: new contours rendering routine.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#383} with diff file ISSM-26220-26221.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m\\
+Export determination: 6. \\
+Rationale: CHG: make sure gmshplanet returns a round planet :) Not a tessalated set of triangle planar faces.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#384} with diff file ISSM-26221-26222.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/contourlevelzero.m\\
+Export determination: 6. \\
+Rationale: CHG: extended to a 3D plot type.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#385} with diff file ISSM-26222-26223.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h A /issm/trunk-jpl/src/c/classes/SealevelGeometry.cpp A /issm/trunk-jpl/src/c/classes/SealevelGeometry.h D /issm/trunk-jpl/src/c/classes/SealevelMasks.h M /issm/trunk-jpl/src/c/classes/classes.h A /issm/trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.cpp M /issm/trunk-jpl/src/c/modules/ElementCoordinatesx/ElementCoordinatesx.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/constants.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/test/Archives/Archive2002.arch A /issm/trunk-jpl/test/Archives/Archive2011.arch M /issm/trunk-jpl/test/NightlyRun/test2002.m A /issm/trunk-jpl/test/NightlyRun/test2011.m\\
+Export determination: 6. \\
+Rationale: CHG: Mathieu, here it is, just one year too late :) or one year early depending on how you see it. Dakota: pre core capability, for things called only once prior to sampling, which could not be called in the ModelProcessorx. SealevelGeometry now used to optimize structures passed betweens sea level cores. SealevelMasks: gone. Mask logic now moved to the geometry core in the sea level solution. We now compute barycentres of loads, for elements that can be interesected by up to two levelsets. Allows for loading differentailly for hydro, ice, bp and ocean loads. Essentially a sub-element parameterization of sea level solver.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#386} with diff file ISSM-26223-26224.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/SealevelGeometry.cpp M /issm/trunk-jpl/src/c/classes/SealevelGeometry.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_fct.cpp\\
+Export determination: 6. \\
+Rationale: CHG: trying to fix Eric's commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#387} with diff file ISSM-26224-26225.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: trying to fix Eric's commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#388} with diff file ISSM-26225-26226.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/constants.m M /issm/trunk-jpl/src/m/classes/constants.py\\
+Export determination: 6. \\
+Rationale: CHG: adding .constants.gravitational\_constant to python class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#389} with diff file ISSM-26226-26227.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp M /issm/trunk-jpl/test/Archives/Archive352.arch M /issm/trunk-jpl/test/Archives/Archive353.arch M /issm/trunk-jpl/test/Archives/Archive354.arch\\
+Export determination: 6. \\
+Rationale: CHG: allow for cycle\_forcing before first forcing stamp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#390} with diff file ISSM-26227-26228.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h A /issm/trunk-jpl/src/c/classes/GrdLoads.cpp A /issm/trunk-jpl/src/c/classes/GrdLoads.h M /issm/trunk-jpl/src/c/classes/classes.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: lumping all loads into a new class GrdLoads.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#391} with diff file ISSM-26228-26229.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/tsantos/integrate\_field.m\\
+Export determination: 6. \\
+Rationale: ADD: function to integrate a field over a 2d mesh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#392} with diff file ISSM-26229-26230.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/src/m/classes/solidearthsolution.m\\
+Export determination: 6. \\
+Rationale: CHG: basic checks + rate computation.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#393} with diff file ISSM-26230-26231.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/SealevelGeometry.cpp M /issm/trunk-jpl/src/c/classes/SealevelGeometry.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: speed up of the convolutions by 2/3.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#394} with diff file ISSM-26231-26232.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/additionalsolidearthsolution.m M /issm/trunk-jpl/src/m/classes/dsl.m M /issm/trunk-jpl/src/m/classes/dslmme.m M /issm/trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m M /issm/trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.m\\
+Export determination: 6. \\
+Rationale: dsl class: no need to check consistency if transient.isoceantransport=0; solidearthsolution subclasses: fixing marshall for external.nature\\
+\vspace{3em}
+
+\noindent \textbf{Change \#395} with diff file ISSM-26232-26233.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: Adding support for rotationnal feedback in bed Up, East, North\\
+\vspace{3em}
+
+\noindent \textbf{Change \#396} with diff file ISSM-26233-26234.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/m/classes/fourierlove.m M /issm/trunk-jpl/src/m/classes/lovenumbers.m M /issm/trunk-jpl/src/m/classes/materials.m\\
+Export determination: 6. \\
+Rationale: adding new formalism for lovenumbers\\
+\vspace{3em}
+
+\noindent \textbf{Change \#397} with diff file ISSM-26234-26235.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LoveAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matlitho.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matlitho.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\\
+Export determination: 6. \\
+Rationale: adding new formalism for lovenumbers\\
+\vspace{3em}
+
+\noindent \textbf{Change \#398} with diff file ISSM-26235-26236.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2084.m\\
+Export determination: 6. \\
+Rationale: updating test2084 for fourierlove\\
+\vspace{3em}
+
+\noindent \textbf{Change \#399} with diff file ISSM-26236-26237.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/love\_core.cpp\\
+Export determination: 6. \\
+Rationale: adding new formalism for lovenumbers\\
+\vspace{3em}
+
+\noindent \textbf{Change \#400} with diff file ISSM-26237-26238.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/love\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#401} with diff file ISSM-26238-26239.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: BUG: typo in GErotm1,2,3 and pole singularity in function SealevelchangeGeometryInitial\\
+\vspace{3em}
+
+\noindent \textbf{Change \#402} with diff file ISSM-26239-26240.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/emscripten/install.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.12-linux.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.14-linux.sh\\
+Export determination: 6. \\
+Rationale: CHG: Varied clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#403} with diff file ISSM-26240-26241.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/dakota/configs/6.2/mac/packages A /issm/trunk-jpl/externalpackages/dakota/configs/6.2/packages/VPISparseGrid (from /issm/trunk-jpl/externalpackages/dakota/configs/6.2/mac/packages/VPISparseGrid:26238) M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh\\
+Export determination: 6. \\
+Rationale: CHG: Linux installation with newer versions of GCC need patch used in macOS installation of Dakota\\
+\vspace{3em}
+
+\noindent \textbf{Change \#404} with diff file ISSM-26241-26242.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/basalforcings.py M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/initialization.py\\
+Export determination: 6. \\
+Rationale: CHG: fixing initialization.sealevel to be a time series\\
+\vspace{3em}
+
+\noindent \textbf{Change \#405} with diff file ISSM-26242-26243.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LoveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h M /issm/trunk-jpl/src/c/cores/love\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/shared/Numerics/types.h M /issm/trunk-jpl/src/m/classes/fourierlove.m M /issm/trunk-jpl/src/m/solve/loadresultfromdisk.m M /issm/trunk-jpl/test/NightlyRun/test2084.m\\
+Export determination: 6. \\
+Rationale: CHG: implemented templated version of the love\_core routine, to allow for IssmComplex and (IssmQuad tuypes in the future). Created new IssmComplex type.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#406} with diff file ISSM-26243-26244.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Numerics/types.h\\
+Export determination: 6. \\
+Rationale: BUG: fixing CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#407} with diff file ISSM-26244-26245.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Numerics/types.h\\
+Export determination: 6. \\
+Rationale: BUG: fixing CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#408} with diff file ISSM-26245-26246.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Node.cpp M /issm/trunk-jpl/src/c/cores/love\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing some love stuff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#409} with diff file ISSM-26246-26247.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso A /issm/trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso/src A /issm/trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso/src/misc A /issm/trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src A /issm/trunk-jpl/externalpackages/dakota/configs/6.2/packages/queso/src/misc/src/1DQuadrature.C M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac-static.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh D /issm/trunk-jpl/externalpackages/gmt/configs/6/cmake A /issm/trunk-jpl/externalpackages/gmt/configs/6/linux A /issm/trunk-jpl/externalpackages/gmt/configs/6/linux/cmake A /issm/trunk-jpl/externalpackages/gmt/configs/6/linux/cmake/ConfigUser.cmake A /issm/trunk-jpl/externalpackages/gmt/configs/6/mac A /issm/trunk-jpl/externalpackages/gmt/configs/6/mac/cmake (from /issm/trunk-jpl/externalpackages/gmt/configs/6/cmake:26245) D /issm/trunk-jpl/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake A /issm/trunk-jpl/externalpackages/gmt/configs/6/static/linux A /issm/trunk-jpl/externalpackages/gmt/configs/6/static/linux/cmake A /issm/trunk-jpl/externalpackages/gmt/configs/6/static/linux/cmake/ConfigUser.static.cmake A /issm/trunk-jpl/externalpackages/gmt/configs/6/static/mac A /issm/trunk-jpl/externalpackages/gmt/configs/6/static/mac/cmake A /issm/trunk-jpl/externalpackages/gmt/configs/6/static/mac/cmake/ConfigUser.static.cmake (from /issm/trunk-jpl/externalpackages/gmt/configs/6/static/cmake/ConfigUser.static.cmake:26245) M /issm/trunk-jpl/externalpackages/gmt/install-6-linux-static.sh M /issm/trunk-jpl/externalpackages/gmt/install-6-linux.sh M /issm/trunk-jpl/externalpackages/gmt/install-6-mac-static.sh M /issm/trunk-jpl/externalpackages/gmt/install-6-mac.sh\\
+Export determination: 6. \\
+Rationale: CHG: Modifications to support newer versions of GCC/GFortran\\
+\vspace{3em}
+
+\noindent \textbf{Change \#410} with diff file ISSM-26247-26248.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/SealevelGeometry.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing compiler warnings\\
+\vspace{3em}
+
+\noindent \textbf{Change \#411} with diff file ISSM-26248-26249.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2003.m A /issm/trunk-jpl/test/NightlyRun/test2007.m\\
+Export determination: 6. \\
+Rationale: NEW: test 2007 for class offlinesolidearth solution. CHG: updated tests 2002, 2003 for the new sealevelchange core.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#412} with diff file ISSM-26249-26250.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/love\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: in love\_core: dydx was not reinitialized at each call of yi\_derivatives; la, mu not properly handled in all cases in GetEarthRheology\\
+\vspace{3em}
+
+\noindent \textbf{Change \#413} with diff file ISSM-26250-26251.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux-static.sh M /issm/trunk-jpl/externalpackages/dakota/install-6.2-linux.sh\\
+Export determination: 6. \\
+Rationale: CHG: Removing fortran flag until testing server copy of gfortran is updated\\
+\vspace{3em}
+
+\noindent \textbf{Change \#414} with diff file ISSM-26251-26252.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Numerics/types.h\\
+Export determination: 6. \\
+Rationale: CHG: temporary fix for ADOLC, acomplex is not defined\\
+\vspace{3em}
+
+\noindent \textbf{Change \#415} with diff file ISSM-26252-26253.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am A /issm/trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp A /issm/trunk-jpl/src/c/classes/Cflevelsetmisfit.h M /issm/trunk-jpl/src/c/classes/classes.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h A /issm/trunk-jpl/src/m/classes/cflevelsetmisfit.m M /issm/trunk-jpl/src/m/classes/cfsurfacelogvel.m M /issm/trunk-jpl/src/m/classes/cfsurfacesquare.m\\
+Export determination: 6. \\
+Rationale: NEW: add an output definition for computing the misfit between two levelset functions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#416} with diff file ISSM-26253-26254.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/IoModel.cpp\\
+Export determination: 6. \\
+Rationale: BUG: problem when multiple marshalled Double have the same name\\
+\vspace{3em}
+
+\noindent \textbf{Change \#417} with diff file ISSM-26254-26255.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp\\
+Export determination: 6. \\
+Rationale: CHG: implemented marshall for CflLevelset\\
+\vspace{3em}
+
+\noindent \textbf{Change \#418} with diff file ISSM-26255-26256.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Cflevelsetmisfit.cpp M /issm/trunk-jpl/src/c/datastructures/DataSet.cpp A /issm/trunk-jpl/test/Archives/Archive3203.arch A /issm/trunk-jpl/test/NightlyRun/test3203.m\\
+Export determination: 6. \\
+Rationale: CHG: add marshall and a test for the levelset misfit output definition\\
+\vspace{3em}
+
+\noindent \textbf{Change \#419} with diff file ISSM-26256-26257.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Cflevelsetmisfit.h\\
+Export determination: 6. \\
+Rationale: CHG: Revert LevelsetAnalysis.cpp to r26254 and remove unnecessary variables in Cflevelsetmisfit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#420} with diff file ISSM-26257-26258.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive2002.arch M /issm/trunk-jpl/test/Archives/Archive2003.arch\\
+Export determination: 6. \\
+Rationale: CHG: Updated archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#421} with diff file ISSM-26258-26259.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/EsaGRACE/runme.m M /issm/trunk-jpl/examples/EsaWahr/runme.m M /issm/trunk-jpl/examples/Functions/grace.m M /issm/trunk-jpl/examples/SlrFarrell/runme.m M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: slrGRACE and associated function updated up to steps 5\\
+\vspace{3em}
+
+\noindent \textbf{Change \#422} with diff file ISSM-26259-26260.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: steps 6 and 7 are updated. some aspects are still unclear, e.g., whether GRACE monthly solutions should be cumsum'ed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#423} with diff file ISSM-26260-26261.diff: \\
+Function name: \\
+D /issm/trunk-jpl/examples/SlrGRACE\_NIMS\\
+Export determination: 6. \\
+Rationale: DEL: this was adapted from SlrGRACE for the NIMS workshop, tailored to the Korean folks. I don't think we should keep it here\\
+\vspace{3em}
+
+\noindent \textbf{Change \#424} with diff file ISSM-26261-26262.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: looks like cumsum is not needed for GRACE data, but CumBlsc should be plotted instead of Blsc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#425} with diff file ISSM-26262-26263.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth A /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth-lambert (from /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth:26261) M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: New Jenkins script and removal of failing tests from SE builds so that Lambert can continue to debug\\
+\vspace{3em}
+
+\noindent \textbf{Change \#426} with diff file ISSM-26263-26264.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#427} with diff file ISSM-26264-26265.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/adhikari/wahr.m\\
+Export determination: 6. \\
+Rationale: NEW: a semi-analytic function to compute 3D custal motion due to a disc load\\
+\vspace{3em}
+
+\noindent \textbf{Change \#428} with diff file ISSM-26265-26266.diff: \\
+Function name: \\
+D /issm/trunk-jpl/examples/Functions/wahr.m\\
+Export determination: 6. \\
+Rationale: DEL: this function is now moved to m/contrib/adhikari\\
+\vspace{3em}
+
+\noindent \textbf{Change \#429} with diff file ISSM-26266-26267.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/adhikari/wahr.m\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#430} with diff file ISSM-26267-26268.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/adhikari/wahr.m\\
+Export determination: 6. \\
+Rationale: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#431} with diff file ISSM-26268-26269.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2002.m\\
+Export determination: 6. \\
+Rationale: CHG: viscous field on test2002.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#432} with diff file ISSM-26269-26270.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2003.m\\
+Export determination: 6. \\
+Rationale: CHG: missing viscous field.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#433} with diff file ISSM-26270-26271.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth M /issm/trunk-jpl/test/Archives/Archive2002.arch M /issm/trunk-jpl/test/Archives/Archive2003.arch\\
+Export determination: 6. \\
+Rationale: CHG: Updated archives; modifed test suites\\
+\vspace{3em}
+
+\noindent \textbf{Change \#434} with diff file ISSM-26271-26272.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py M /issm/trunk-jpl/test/Archives/Archive243.arch M /issm/trunk-jpl/test/NightlyRun/test243.m M /issm/trunk-jpl/test/NightlyRun/test243.py\\
+Export determination: 6. \\
+Rationale: CHG: add rain and refreeze outputs to GEMB, update melt to not have rain included\\
+\vspace{3em}
+
+\noindent \textbf{Change \#435} with diff file ISSM-26272-26273.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/cores/love\_core.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/lovenumbers.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.m A /issm/trunk-jpl/test/NightlyRun/test2090.m\\
+Export determination: 6. \\
+Rationale: CHG: visco elastic solid-Earth/sea-level solver now activated.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#436} with diff file ISSM-26273-26274.diff: \\
+Function name: \\
+M /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/complete-issm-linux-binaries-python.sh\\
+Export determination: 6. \\
+Rationale: CHG: Ensure that Linux binaries are written with .tar.gz extension\\
+\vspace{3em}
+
+\noindent \textbf{Change \#437} with diff file ISSM-26274-26275.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/mmeadditionalsolidearthsolution.m M /issm/trunk-jpl/src/m/classes/mmeofflinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/solidearthsolution.m M /issm/trunk-jpl/test/NightlyRun/test2007.m A /issm/trunk-jpl/test/NightlyRun/test2008.m\\
+Export determination: 6. \\
+Rationale: CHG: removing BarystaticSealevel field from SolidEarth External solution. NEW: test2008 for additionalsolidearthsolution class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#438} with diff file ISSM-26275-26276.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: BUG: minus sign missing in polenudge exponent in SealevelchangeInitialGeometry\\
+\vspace{3em}
+
+\noindent \textbf{Change \#439} with diff file ISSM-26276-26277.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing CoDiPack on greenplanet\\
+\vspace{3em}
+
+\noindent \textbf{Change \#440} with diff file ISSM-26277-26278.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing bad for loop variable repeating another one\\
+\vspace{3em}
+
+\noindent \textbf{Change \#441} with diff file ISSM-26278-26279.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#442} with diff file ISSM-26279-26280.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/adhikari/miscellaneous A /issm/trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m\\
+Export determination: 6. \\
+Rationale: NEW: some useful miscellaneous functions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#443} with diff file ISSM-26280-26281.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/m/contrib/adhikari/miscellaneous/fractionYear2Datetime.m\\
+Export determination: 6. \\
+Rationale: DEL: duplicate function\\
+\vspace{3em}
+
+\noindent \textbf{Change \#444} with diff file ISSM-26281-26282.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Massfluxatgate.h M /issm/trunk-jpl/src/c/datastructures/DataSet.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing Massfluxgate in AD when using checkpoint\\
+\vspace{3em}
+
+\noindent \textbf{Change \#445} with diff file ISSM-26282-26283.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp\\
+Export determination: 6. \\
+Rationale: BUG: temporary fix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#446} with diff file ISSM-26283-26284.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp M /issm/trunk-jpl/src/c/classes/BarystaticContributions.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/test/Data/lnb\_temporal.mat M /issm/trunk-jpl/test/NightlyRun/test2090.m\\
+Export determination: 6. \\
+Rationale: CHG: grdcore viscous mode now computes the delta\_deformation between two calls rather than the total deformation, in line with elastic mode. BUG: Fixing issues related to viscous stack \& resetting barystatic contribs every call in order to shift sealevel fields by the delta\_barycontrib instead of cummulated barycontrib.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#447} with diff file ISSM-26284-26285.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2090.m\\
+Export determination: 6. \\
+Rationale: BUG: typo in test2090\\
+\vspace{3em}
+
+\noindent \textbf{Change \#448} with diff file ISSM-26285-26286.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp M /issm/trunk-jpl/src/c/classes/BarystaticContributions.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: easier way to reset barystatic contributors.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#449} with diff file ISSM-26286-26287.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/EsaGRACE/runme.m M /issm/trunk-jpl/examples/EsaWahr/runme.m\\
+Export determination: 6. \\
+Rationale: BUG: Corrected default value of ‘steps’ that jenkins/examples\_tests.sh expects; minor formatting cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#450} with diff file ISSM-26287-26288.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing bad commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#451} with diff file ISSM-26288-26289.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/EsaGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: grace function requires info about whether we want to map data on the vertices or elemental centroids\\
+\vspace{3em}
+
+\noindent \textbf{Change \#452} with diff file ISSM-26289-26290.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/EsaGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: BUG: Corrected default value of ‘steps’ that jenkins/examples\_tests.sh expects\\
+\vspace{3em}
+
+\noindent \textbf{Change \#453} with diff file ISSM-26290-26291.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed ice-oean BC for MLHO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#454} with diff file ISSM-26291-26292.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/lonestar.m\\
+Export determination: 6. \\
+Rationale: lonestar cluster, currectly calculate number of cpus requested\\
+\vspace{3em}
+
+\noindent \textbf{Change \#455} with diff file ISSM-26292-26293.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp M /issm/trunk-jpl/src/c/classes/Materials/Material.h M /issm/trunk-jpl/src/c/classes/Materials/Matestar.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matestar.h M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/Materials/Matlitho.h\\
+Export determination: 6. \\
+Rationale: CHG: added viscosity computation for Mono Layer Higher Order model, and added penalty methods for L1L2 and Mono Layer model\\
+\vspace{3em}
+
+\noindent \textbf{Change \#456} with diff file ISSM-26293-26294.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing Thiago's dim that should be an int and not an IssmDouble\\
+\vspace{3em}
+
+\noindent \textbf{Change \#457} with diff file ISSM-26294-26295.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Materials/Material.h M /issm/trunk-jpl/src/c/classes/Materials/Matestar.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matestar.h M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/Materials/Matlitho.h\\
+Export determination: 6. \\
+Rationale: CHG: updated viscosity computation for MLHO: now we have 4 expressions obtained by numerical integration (it is more consistent).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#458} with diff file ISSM-26295-26296.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added check to make sure each partition has at least one element, otherwise we get weird error messages\\
+\vspace{3em}
+
+\noindent \textbf{Change \#459} with diff file ISSM-26296-26297.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/EsaAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/test/NightlyRun/test2001.m M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2003.m M /issm/trunk-jpl/test/NightlyRun/test2004.m M /issm/trunk-jpl/test/NightlyRun/test2005.m M /issm/trunk-jpl/test/NightlyRun/test2006.m M /issm/trunk-jpl/test/NightlyRun/test2007.m M /issm/trunk-jpl/test/NightlyRun/test2008.m M /issm/trunk-jpl/test/NightlyRun/test2010.m M /issm/trunk-jpl/test/NightlyRun/test2011.m M /issm/trunk-jpl/test/NightlyRun/test2090.m\\
+Export determination: 6. \\
+Rationale: BUG: BarystaticLoad was considering coastline elements that were fully covered by ice as also fully grounded; CHG: lots of renaming in sealevelchange\_core \& analysis; CHG: it is now possible to compute GRD with Barystatic contributions \& ocean mass but without sea-level loading\\
+\vspace{3em}
+
+\noindent \textbf{Change \#460} with diff file ISSM-26297-26298.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Data/SlcTestMesh.mat\\
+Export determination: 6. \\
+Rationale: NEW:Precomputed mesh for SLC tests to circumvent compability issue of gmsh across platforms\\
+\vspace{3em}
+
+\noindent \textbf{Change \#461} with diff file ISSM-26298-26299.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive2001.arch M /issm/trunk-jpl/test/Archives/Archive2002.arch M /issm/trunk-jpl/test/Archives/Archive2003.arch M /issm/trunk-jpl/test/Archives/Archive2005.arch A /issm/trunk-jpl/test/Archives/Archive2007.arch A /issm/trunk-jpl/test/Archives/Archive2008.arch M /issm/trunk-jpl/test/Archives/Archive2010.arch M /issm/trunk-jpl/test/Archives/Archive2011.arch A /issm/trunk-jpl/test/Archives/Archive2090.arch\\
+Export determination: 6. \\
+Rationale: CHG: Updated archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#462} with diff file ISSM-26299-26300.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/geometry.m M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearth.py M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.py M /issm/trunk-jpl/test/NightlyRun/test2001.m M /issm/trunk-jpl/test/NightlyRun/test2001.py\\
+Export determination: 6. \\
+Rationale: CHG: test2001 MATLAB -> Python; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#463} with diff file ISSM-26300-26301.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/array/arrayoperations.js M /issm/trunk-jpl/src/m/classes/SMBforcing.js M /issm/trunk-jpl/src/m/classes/amr.js M /issm/trunk-jpl/src/m/classes/balancethickness.js M /issm/trunk-jpl/src/m/classes/calving.js M /issm/trunk-jpl/src/m/classes/constants.js M /issm/trunk-jpl/src/m/classes/flowequation.js M /issm/trunk-jpl/src/m/classes/fourierlove.js M /issm/trunk-jpl/src/m/classes/friction.js M /issm/trunk-jpl/src/m/classes/geometry.js M /issm/trunk-jpl/src/m/classes/groundingline.js M /issm/trunk-jpl/src/m/classes/initialization.js M /issm/trunk-jpl/src/m/classes/inversion.js M /issm/trunk-jpl/src/m/classes/issmsettings.js M /issm/trunk-jpl/src/m/classes/levelset.js M /issm/trunk-jpl/src/m/classes/mask.js M /issm/trunk-jpl/src/m/classes/mesh3dprisms.js M /issm/trunk-jpl/src/m/classes/qmu.js M /issm/trunk-jpl/src/m/classes/slr.js M /issm/trunk-jpl/src/m/classes/stressbalance.js M /issm/trunk-jpl/src/m/classes/thermal.js M /issm/trunk-jpl/src/m/classes/timestepping.js M /issm/trunk-jpl/src/m/classes/trans.js M /issm/trunk-jpl/src/m/plot/applyoptions.js A /issm/trunk-jpl/src/m/plot/plot\_contour.js M /issm/trunk-jpl/src/m/plot/plot\_manager.js M /issm/trunk-jpl/src/m/plot/plot\_mesh.js M /issm/trunk-jpl/src/m/plot/plot\_overlay.js M /issm/trunk-jpl/src/m/plot/plot\_quiver.js M /issm/trunk-jpl/src/m/plot/plot\_transient\_movie.js M /issm/trunk-jpl/src/m/plot/plot\_unit.js M /issm/trunk-jpl/src/m/plot/plotdoc.js M /issm/trunk-jpl/src/m/plot/plotmodel.js M /issm/trunk-jpl/src/m/solve/WriteData.js M /issm/trunk-jpl/src/m/solve/solve.js\\
+Export determination: 6. \\
+Rationale: CHG (JS): Large update of JS classes in for solid earth/sea level solver.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#464} with diff file ISSM-26301-26302.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/boundaryconditions/getlovenumbers.py M /issm/trunk-jpl/src/m/classes/amr.m M /issm/trunk-jpl/src/m/classes/amr.py M /issm/trunk-jpl/src/m/classes/dsl.m M /issm/trunk-jpl/src/m/classes/dsl.py M /issm/trunk-jpl/src/m/classes/fourierlove.m M /issm/trunk-jpl/src/m/classes/fourierlove.py M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/classes/hydrologyshreve.m M /issm/trunk-jpl/src/m/classes/hydrologyshreve.py M /issm/trunk-jpl/src/m/classes/initialization.m M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/lovenumbers.m M /issm/trunk-jpl/src/m/classes/lovenumbers.py M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/classes/sampling.m M /issm/trunk-jpl/src/m/classes/sampling.py M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.py A /issm/trunk-jpl/src/m/classes/solidearthsolution.py M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py M /issm/trunk-jpl/src/m/miscellaneous/PythonFuncs.py M /issm/trunk-jpl/src/m/solve/marshall.m M /issm/trunk-jpl/src/m/solve/marshall.py M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2002.py\\
+Export determination: 6. \\
+Rationale: CHG: test2002 MATLAB -> Python; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#465} with diff file ISSM-26302-26303.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/initialization.py\\
+Export determination: 6. \\
+Rationale: BUG: reshape(-1, 1) should work but doesn’t\\
+\vspace{3em}
+
+\noindent \textbf{Change \#466} with diff file ISSM-26303-26304.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/timestepping.m M /issm/trunk-jpl/src/m/classes/timestepping.py M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2002.py M /issm/trunk-jpl/test/NightlyRun/test2003.m M /issm/trunk-jpl/test/NightlyRun/test2003.py\\
+Export determination: 6. \\
+Rationale: CHG: More translation; test2003.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#467} with diff file ISSM-26304-26305.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/timestepping.js M /issm/trunk-jpl/src/m/classes/timestepping.m M /issm/trunk-jpl/src/m/classes/timestepping.py\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#468} with diff file ISSM-26305-26306.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/flowequation.js M /issm/trunk-jpl/src/m/classes/fourierlove.js M /issm/trunk-jpl/src/m/classes/friction.js A /issm/trunk-jpl/src/m/classes/frontalforcings.js M /issm/trunk-jpl/src/m/classes/geometry.js M /issm/trunk-jpl/src/m/classes/groundingline.js M /issm/trunk-jpl/src/m/classes/levelset.js A /issm/trunk-jpl/src/m/classes/materials.js M /issm/trunk-jpl/src/m/classes/mesh3dsurface.js M /issm/trunk-jpl/src/m/classes/model.js A /issm/trunk-jpl/src/m/classes/sampling.js D /issm/trunk-jpl/src/m/classes/trans.js A /issm/trunk-jpl/src/m/classes/transient.js (from /issm/trunk-jpl/src/m/classes/trans.js:26304) M /issm/trunk-jpl/src/m/classes/verbose.js M /issm/trunk-jpl/src/m/solve/WriteData.js\\
+Export determination: 6. \\
+Rationale: CHG (JS): Fixes and updates for remaining JS classes for solid earth/sea-level-solver/test2002.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#469} with diff file ISSM-26306-26307.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/materials.js\\
+Export determination: 6. \\
+Rationale: CHG (JS): materials.js default parameters fix.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#470} with diff file ISSM-26307-26308.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/pairoptions.m M /issm/trunk-jpl/src/m/classes/pairoptions.py M /issm/trunk-jpl/src/m/classes/rotational.m M /issm/trunk-jpl/src/m/classes/sealevelmodel.m M /issm/trunk-jpl/src/m/classes/sealevelmodel.py M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearth.py M /issm/trunk-jpl/src/m/classes/solidearthsolution.m M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py\\
+Export determination: 6. \\
+Rationale: CHG: Pending minor cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#471} with diff file ISSM-26308-26309.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/boundaryconditions/getlovenumbers.js M /issm/trunk-jpl/src/m/classes/dsl.js M /issm/trunk-jpl/src/m/classes/hydrologyshreve.js M /issm/trunk-jpl/src/m/classes/masstransport.js M /issm/trunk-jpl/src/m/classes/materials.js M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/model.js A /issm/trunk-jpl/src/m/classes/rotational.js A /issm/trunk-jpl/src/m/classes/sealevelmodel.js A /issm/trunk-jpl/src/m/classes/solidearth.js A /issm/trunk-jpl/src/m/classes/solidearthsettings.js A /issm/trunk-jpl/src/m/classes/solidearthsolution.js A /issm/trunk-jpl/src/m/geometry/planetradius.js A /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.js\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> JS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#472} with diff file ISSM-26309-26310.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/solvers/mumpsoptions.js\\
+Export determination: 6. \\
+Rationale: CHG: mumpsoptions.js\\
+\vspace{3em}
+
+\noindent \textbf{Change \#473} with diff file ISSM-26310-26311.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/hydrologyshreve.m M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.js\\
+Export determination: 6. \\
+Rationale: CHG: Incorporated other functions from Dan; added more functionality to ones/zeros; pending minor cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#474} with diff file ISSM-26311-26312.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h\\
+Export determination: 6. \\
+Rationale: CHG: optimize xMemCpy by calling memcpy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#475} with diff file ISSM-26312-26313.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/materials.js\\
+Export determination: 6. \\
+Rationale: CHG: Diff merge of materials class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#476} with diff file ISSM-26313-26314.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h\\
+Export determination: 6. \\
+Rationale: BUG: fixing ADOLC that does not like memcpy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#477} with diff file ISSM-26314-26315.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/applyoptions.m\\
+Export determination: 6. \\
+Rationale: CHG: use any instead of contains for older matlabs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#478} with diff file ISSM-26315-26316.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota/configs/6.2/linux/cmake/BuildDakotaCustom.cmake\\
+Export determination: 6. \\
+Rationale: CHG: some linux need MPI\_EXTRA\_LIBRARY for queso\\
+\vspace{3em}
+
+\noindent \textbf{Change \#479} with diff file ISSM-26316-26317.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.py\\
+Export determination: 6. \\
+Rationale: NEW: offlinesolidearth for python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#480} with diff file ISSM-26317-26318.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/dsl.py M /issm/trunk-jpl/src/m/classes/dslmme.py M /issm/trunk-jpl/src/m/classes/lovenumbers.py M /issm/trunk-jpl/src/m/classes/matdamageice.py M /issm/trunk-jpl/src/m/classes/matenhancedice.py M /issm/trunk-jpl/src/m/classes/matestar.py M /issm/trunk-jpl/src/m/classes/nodalvalue.py M /issm/trunk-jpl/src/m/classes/rotational.py M /issm/trunk-jpl/src/m/classes/slr.py M /issm/trunk-jpl/src/m/classes/solidearth.py M /issm/trunk-jpl/src/m/classes/solidearthsettings.py M /issm/trunk-jpl/src/m/classes/solidearthsolution.m M /issm/trunk-jpl/src/m/classes/solidearthsolution.py M /issm/trunk-jpl/src/m/classes/surfaceload.py\\
+Export determination: 6. \\
+Rationale: BUG: Name change issues, SealevelRISE to SealevelCHANGE, and other python fixes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#481} with diff file ISSM-26318-26319.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py\\
+Export determination: 6. \\
+Rationale: BUG: More SealevelRISE to SealevelCHANGE stuff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#482} with diff file ISSM-26319-26320.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/dsl.py\\
+Export determination: 6. \\
+Rationale: BUG: fixing checkconsistency returns\\
+\vspace{3em}
+
+\noindent \textbf{Change \#483} with diff file ISSM-26320-26321.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing ToMPISerial\\
+\vspace{3em}
+
+\noindent \textbf{Change \#484} with diff file ISSM-26321-26322.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test455.m M /issm/trunk-jpl/test/NightlyRun/test455.py\\
+Export determination: 6. \\
+Rationale: CHG: Eased tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#485} with diff file ISSM-26322-26323.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.js M /issm/trunk-jpl/src/m/plot/plot\_contour.js\\
+Export determination: 6. \\
+Rationale: CHG (JS): plot\_contour bug fix. ADD (JS): gmshplanet.js.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#486} with diff file ISSM-26323-26324.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: better echo function for transient inputs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#487} with diff file ISSM-26324-26325.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: use Pid instead of Sid to improve scaling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#488} with diff file ISSM-26325-26326.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: use Pid instead of Sid to improve scaling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#489} with diff file ISSM-26326-26327.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added MICI, commented out for now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#490} with diff file ISSM-26327-26328.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing compiler warning\\
+\vspace{3em}
+
+\noindent \textbf{Change \#491} with diff file ISSM-26328-26329.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#492} with diff file ISSM-26329-26330.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp M /issm/trunk-jpl/src/c/classes/Node.h M /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp M /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moving IsFloating to IsAllFloating\\
+\vspace{3em}
+
+\noindent \textbf{Change \#493} with diff file ISSM-26330-26331.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/aurora.m M /issm/trunk-jpl/src/m/classes/clusters/camhpc.m M /issm/trunk-jpl/src/m/classes/clusters/discover.m M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m M /issm/trunk-jpl/src/m/classes/clusters/hpc.m M /issm/trunk-jpl/src/m/classes/clusters/hpc\_simba.m M /issm/trunk-jpl/src/m/classes/clusters/lonestar.m M /issm/trunk-jpl/src/m/classes/clusters/maui.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.py M /issm/trunk-jpl/src/m/classes/clusters/sherlock.m M /issm/trunk-jpl/src/m/classes/clusters/tetralith.m M /issm/trunk-jpl/src/m/classes/clusters/yellowstone.m\\
+Export determination: 6. \\
+Rationale: CHG: Bringing pfe.py up to date (will ping Basile about this); clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#494} with diff file ISSM-26332-26333.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/acenet.m M /issm/trunk-jpl/src/m/classes/clusters/aci.m M /issm/trunk-jpl/src/m/classes/clusters/aurora.m M /issm/trunk-jpl/src/m/classes/clusters/camhpc.m M /issm/trunk-jpl/src/m/classes/clusters/castor.m M /issm/trunk-jpl/src/m/classes/clusters/cloud.m M /issm/trunk-jpl/src/m/classes/clusters/cosmos.m M /issm/trunk-jpl/src/m/classes/clusters/cyclone.py M /issm/trunk-jpl/src/m/classes/clusters/discover.m A /issm/trunk-jpl/src/m/classes/clusters/discover.py M /issm/trunk-jpl/src/m/classes/clusters/fram.py M /issm/trunk-jpl/src/m/classes/clusters/gemini.m M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/clusters/generic\_static.m M /issm/trunk-jpl/src/m/classes/clusters/generic\_static.py M /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m M /issm/trunk-jpl/src/m/classes/clusters/hpc.m M /issm/trunk-jpl/src/m/classes/clusters/hpc\_simba.m M /issm/trunk-jpl/src/m/classes/clusters/local.m M /issm/trunk-jpl/src/m/classes/clusters/localpfe.m M /issm/trunk-jpl/src/m/classes/clusters/lonestar.m M /issm/trunk-jpl/src/m/classes/clusters/maui.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.py M /issm/trunk-jpl/src/m/classes/clusters/pollux.m M /issm/trunk-jpl/src/m/classes/clusters/raijin.m M /issm/trunk-jpl/src/m/classes/clusters/saga.py M /issm/trunk-jpl/src/m/classes/clusters/sherlock.m M /issm/trunk-jpl/src/m/classes/clusters/tetralith.m M /issm/trunk-jpl/src/m/classes/clusters/yellowstone.m M /issm/trunk-jpl/src/m/dev/ISSM.py M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py M /issm/trunk-jpl/src/m/os/issmscpin.py M /issm/trunk-jpl/src/m/os/issmscpout.m M /issm/trunk-jpl/src/m/os/issmscpout.py M /issm/trunk-jpl/src/m/os/issmssh.py M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/solve/waitonlock.py\\
+Export determination: 6. \\
+Rationale: CHG: Translation of discover.m -> py; additional MATLAB builtin function translations; cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#495} with diff file ISSM-26333-26334.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/pfe.py\\
+Export determination: 6. \\
+Rationale: BUG: Minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#496} with diff file ISSM-26334-26335.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: CHG: add collpase of md.materials.rheology\_E\\
+\vspace{3em}
+
+\noindent \textbf{Change \#497} with diff file ISSM-26335-26336.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.14-discover.sh\\
+Export determination: 6. \\
+Rationale: CHG: new petsc for discover\\
+\vspace{3em}
+
+\noindent \textbf{Change \#498} with diff file ISSM-26336-26337.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/triangle/install-discover.sh\\
+Export determination: 6. \\
+Rationale: CHG: update discover triangle install\\
+\vspace{3em}
+
+\noindent \textbf{Change \#499} with diff file ISSM-26337-26338.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/dakota/install-6.2-discover.sh (from /issm/trunk-jpl/externalpackages/dakota/install-6.2-intel20-discover.sh:26335) D /issm/trunk-jpl/externalpackages/dakota/install-6.2-intel15-discover.sh D /issm/trunk-jpl/externalpackages/dakota/install-6.2-intel16-discover.sh D /issm/trunk-jpl/externalpackages/dakota/install-6.2-intel20-discover.sh M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: update discover compile and dakota\\
+\vspace{3em}
+
+\noindent \textbf{Change \#500} with diff file ISSM-26338-26339.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/discover.py\\
+Export determination: 6. \\
+Rationale: CHG: update python launch on discover\\
+\vspace{3em}
+
+\noindent \textbf{Change \#501} with diff file ISSM-26339-26340.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/qmu.m M /issm/trunk-jpl/src/m/classes/qmu.py\\
+Export determination: 6. \\
+Rationale: BUG: qmu should check nprocs function not np, since not all clusters have np\\
+\vspace{3em}
+
+\noindent \textbf{Change \#502} with diff file ISSM-26340-26341.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/discover.py\\
+Export determination: 6. \\
+Rationale: CHG: check version of dakota\\
+\vspace{3em}
+
+\noindent \textbf{Change \#503} with diff file ISSM-26341-26342.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m M /issm/trunk-jpl/src/m/classes/clusters/generic.py\\
+Export determination: 6. \\
+Rationale: BUG: Class method nprocs needs to be defined\\
+\vspace{3em}
+
+\noindent \textbf{Change \#504} with diff file ISSM-26342-26343.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py\\
+Export determination: 6. \\
+Rationale: BUG: helpers missing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#505} with diff file ISSM-26343-26344.diff: \\
+Function name: \\
+M /issm/trunk-jpl/configure.ac M /issm/trunk-jpl/etc/environment.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh A /issm/trunk-jpl/jenkins/pleiades-basic M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/wrappers/javascript/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Adding jenkins script for Pleiades (can be run with jenkins.sh to automatically install packages, configure, and install); now checking first for VERSION file to get Dakota version; missing ParMETIS includes in Makefile.am; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#506} with diff file ISSM-26344-26345.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/cloud.m A /issm/trunk-jpl/src/m/classes/clusters/cloud.py M /issm/trunk-jpl/src/m/classes/clusters/cyclone.py M /issm/trunk-jpl/src/m/classes/clusters/discover.py M /issm/trunk-jpl/src/m/classes/clusters/fram.py M /issm/trunk-jpl/src/m/classes/clusters/pfe.m M /issm/trunk-jpl/src/m/classes/clusters/pfe.py M /issm/trunk-jpl/src/m/classes/clusters/saga.py M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py M /issm/trunk-jpl/src/m/solve/solve.py M /issm/trunk-jpl/src/m/solve/waitonlock.m M /issm/trunk-jpl/src/m/solve/waitonlock.py M /issm/trunk-jpl/src/wrappers/javascript/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Revised pleiades.oy download dialog; various pending minor fixes; cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#507} with diff file ISSM-26345-26346.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/waitonlock.py\\
+Export determination: 6. \\
+Rationale: BUG: Commenting out check of subprocess error for now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#508} with diff file ISSM-26346-26347.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.js\\
+Export determination: 6. \\
+Rationale: CHG: Uncommitted changes to issm-binaries.js -> partial\\
+\vspace{3em}
+
+\noindent \textbf{Change \#509} with diff file ISSM-26347-26348.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/waitonlock.py\\
+Export determination: 6. \\
+Rationale: CHG: Error check works in testing under Debian Linux\\
+\vspace{3em}
+
+\noindent \textbf{Change \#510} with diff file ISSM-26348-26349.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/emscripten/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: It appears that 'git pull' is no longer working on existing installation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#511} with diff file ISSM-26349-26350.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/emscripten/install.sh\\
+Export determination: 6. \\
+Rationale: BUG: Committed with wrong PREFIX path\\
+\vspace{3em}
+
+\noindent \textbf{Change \#512} with diff file ISSM-26350-26351.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.m M /issm/trunk-jpl/test/NightlyRun/runme.py\\
+Export determination: 6. \\
+Rationale: BUG: Corrected parsing of test number from file name\\
+\vspace{3em}
+
+\noindent \textbf{Change \#513} with diff file ISSM-26351-26352.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/materials.py\\
+Export determination: 6. \\
+Rationale: CHG: Removing print\\
+\vspace{3em}
+
+\noindent \textbf{Change \#514} with diff file ISSM-26352-26353.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m M /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py M /issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.m M /issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.py M /issm/trunk-jpl/src/m/classes/qmu/dakota\_method/dmeth\_params\_write.m M /issm/trunk-jpl/src/m/classes/qmu/dakota\_method/dmeth\_params\_write.py M /issm/trunk-jpl/src/m/classes/sealevelmodel.m M /issm/trunk-jpl/src/m/classes/sealevelmodel.py M /issm/trunk-jpl/src/m/classes/slr.py M /issm/trunk-jpl/src/m/classes/solidearthsolution.py M /issm/trunk-jpl/src/m/dev/devpath.py M /issm/trunk-jpl/src/m/materials/nye.m M /issm/trunk-jpl/src/m/materials/nye.py M /issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.py M /issm/trunk-jpl/src/m/parameterization/setflowequation.m M /issm/trunk-jpl/src/m/parameterization/setflowequation.py M /issm/trunk-jpl/src/m/plot/processdata.m M /issm/trunk-jpl/src/m/plot/processdata.py\\
+Export determination: 6. \\
+Rationale: CHG: Cleanup of warning messages\\
+\vspace{3em}
+
+\noindent \textbf{Change \#515} with diff file ISSM-26353-26354.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/clusters/pfe.py M /issm/trunk-jpl/src/m/classes/issmsettings.py M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/classes/solidearthsettings.py M /issm/trunk-jpl/src/m/coordsystems/gdaltransform.m M /issm/trunk-jpl/src/m/dev/devpath.py M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py M /issm/trunk-jpl/src/m/plot/googlemaps.m M /issm/trunk-jpl/src/m/plot/plot\_manager.py M /issm/trunk-jpl/src/m/plot/plot\_overlay.py M /issm/trunk-jpl/src/m/plot/radarpower.m M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py M /issm/trunk-jpl/src/m/solve/waitonlock.m M /issm/trunk-jpl/src/m/solve/waitonlock.py M /issm/trunk-jpl/test/NightlyRun/runme.py\\
+Export determination: 6. \\
+Rationale: CHG: Checking on cluster type rather than name in waitonlock.py; silencing cluster settings warnings by default; formatting; cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#516} with diff file ISSM-26354-26355.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py\\
+Export determination: 6. \\
+Rationale: CHG: Consistent mesh generation on macOS and Linux\\
+\vspace{3em}
+
+\noindent \textbf{Change \#517} with diff file ISSM-26355-26356.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/clusters/frontera.m\\
+Export determination: 6. \\
+Rationale: CHG: added frontera TACC cluster\\
+\vspace{3em}
+
+\noindent \textbf{Change \#518} with diff file ISSM-26356-26357.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim\\
+Export determination: 6. \\
+Rationale: CHG: added julia syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#519} with diff file ISSM-26357-26358.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/frontera.m\\
+Export determination: 6. \\
+Rationale: CHG: minor changes to frontera\\
+\vspace{3em}
+
+\noindent \textbf{Change \#520} with diff file ISSM-26358-26359.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh D /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries-solid\_earth.sh D /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries-with\_dakota.sh D /issm/trunk-jpl/packagers/linux/test-issm-linux-binaries.sh M /issm/trunk-jpl/packagers/mac/test-issm-mac-binaries-matlab.sh M /issm/trunk-jpl/packagers/mac/test-issm-mac-binaries-python.sh M /issm/trunk-jpl/src/m/archive/arch.py M /issm/trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py M /issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py M /issm/trunk-jpl/src/m/classes/SMBcomponents.m M /issm/trunk-jpl/src/m/classes/SMBcomponents.py M /issm/trunk-jpl/src/m/classes/SMBforcing.py M /issm/trunk-jpl/src/m/classes/SMBgemb.m M /issm/trunk-jpl/src/m/classes/SMBgemb.py M /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.m M /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py M /issm/trunk-jpl/src/m/classes/basalforcings.m M /issm/trunk-jpl/src/m/classes/basalforcings.py M /issm/trunk-jpl/src/m/classes/clusters/generic.py M /issm/trunk-jpl/src/m/classes/constants.py M /issm/trunk-jpl/src/m/classes/dsl.m M /issm/trunk-jpl/src/m/classes/dsl.py M /issm/trunk-jpl/src/m/classes/dslmme.m M /issm/trunk-jpl/src/m/classes/dslmme.py M /issm/trunk-jpl/src/m/classes/fourierlove.py M /issm/trunk-jpl/src/m/classes/geometry.py M /issm/trunk-jpl/src/m/classes/groundingline.py M /issm/trunk-jpl/src/m/classes/initialization.py M /issm/trunk-jpl/src/m/classes/issmsettings.py M /issm/trunk-jpl/src/m/classes/levelset.m M /issm/trunk-jpl/src/m/classes/levelset.py M /issm/trunk-jpl/src/m/classes/lovenumbers.py M /issm/trunk-jpl/src/m/classes/matdamageice.m M /issm/trunk-jpl/src/m/classes/matdamageice.py M /issm/trunk-jpl/src/m/classes/matenhancedice.m M /issm/trunk-jpl/src/m/classes/matenhancedice.py M /issm/trunk-jpl/src/m/classes/materials.m M /issm/trunk-jpl/src/m/classes/materials.py M /issm/trunk-jpl/src/m/classes/matestar.m M /issm/trunk-jpl/src/m/classes/matestar.py M /issm/trunk-jpl/src/m/classes/matice.js M /issm/trunk-jpl/src/m/classes/matice.m M /issm/trunk-jpl/src/m/classes/matice.py M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/plumebasalforcings.py M /issm/trunk-jpl/src/m/classes/rotational.m M /issm/trunk-jpl/src/m/classes/rotational.py M /issm/trunk-jpl/src/m/classes/sealevelmodel.m M /issm/trunk-jpl/src/m/classes/sealevelmodel.py M /issm/trunk-jpl/src/m/classes/solidearth.m M /issm/trunk-jpl/src/m/classes/solidearth.py M /issm/trunk-jpl/src/m/classes/solidearthsettings.m M /issm/trunk-jpl/src/m/classes/solidearthsettings.py M /issm/trunk-jpl/src/m/classes/solidearthsolution.m M /issm/trunk-jpl/src/m/classes/solidearthsolution.py M /issm/trunk-jpl/src/m/classes/stressbalance.m M /issm/trunk-jpl/src/m/classes/stressbalance.py M /issm/trunk-jpl/src/m/classes/surfaceload.m M /issm/trunk-jpl/src/m/classes/surfaceload.py M /issm/trunk-jpl/src/m/classes/transient.m M /issm/trunk-jpl/src/m/classes/transient.py M /issm/trunk-jpl/src/m/classes/verbose.py M /issm/trunk-jpl/src/m/consistency/ismodelselfconsistent.py M /issm/trunk-jpl/src/m/coordsystems/ll2xy.py M /issm/trunk-jpl/src/m/coordsystems/xy2ll.py M /issm/trunk-jpl/src/m/materials/cuffey.py M /issm/trunk-jpl/src/m/materials/paterson.py M /issm/trunk-jpl/src/m/mech/mechanicalproperties.m M /issm/trunk-jpl/src/m/mech/mechanicalproperties.py M /issm/trunk-jpl/src/m/mesh/bamg.py M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py M /issm/trunk-jpl/src/m/miscellaneous/pretty\_print.m M /issm/trunk-jpl/src/m/plot/checkplotoptions.py M /issm/trunk-jpl/src/m/solve/loadresultfromdisk.py M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/marshall.m M /issm/trunk-jpl/src/m/solve/marshall.py M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py M /issm/trunk-jpl/src/m/solve/solveslm.m M /issm/trunk-jpl/src/m/solve/solveslm.py M /issm/trunk-jpl/test/Archives/Archive2002.arch M /issm/trunk-jpl/test/Archives/Archive2003.arch M /issm/trunk-jpl/test/Archives/Archive2005.arch M /issm/trunk-jpl/test/Archives/Archive2007.arch M /issm/trunk-jpl/test/Archives/Archive2008.arch M /issm/trunk-jpl/test/Archives/Archive2010.arch M /issm/trunk-jpl/test/Archives/Archive2011.arch M /issm/trunk-jpl/test/Archives/Archive2021.arch M /issm/trunk-jpl/test/Archives/Archive2090.arch M /issm/trunk-jpl/test/Archives/Archive2101.arch M /issm/trunk-jpl/test/NightlyRun/test2001.py M /issm/trunk-jpl/test/NightlyRun/test2002.m M /issm/trunk-jpl/test/NightlyRun/test2002.py M /issm/trunk-jpl/test/NightlyRun/test2003.m M /issm/trunk-jpl/test/NightlyRun/test2003.py M /issm/trunk-jpl/test/NightlyRun/test2004.m M /issm/trunk-jpl/test/NightlyRun/test2004.py M /issm/trunk-jpl/test/NightlyRun/test2005.m M /issm/trunk-jpl/test/NightlyRun/test2005.py M /issm/trunk-jpl/test/NightlyRun/test2006.m M /issm/trunk-jpl/test/NightlyRun/test2006.py M /issm/trunk-jpl/test/NightlyRun/test2007.m M /issm/trunk-jpl/test/NightlyRun/test2008.m M /issm/trunk-jpl/test/NightlyRun/test2010.m M /issm/trunk-jpl/test/NightlyRun/test2010.py M /issm/trunk-jpl/test/NightlyRun/test2011.m M /issm/trunk-jpl/test/NightlyRun/test2021.m M /issm/trunk-jpl/test/NightlyRun/test2084.m M /issm/trunk-jpl/test/NightlyRun/test2084.py M /issm/trunk-jpl/test/NightlyRun/test2090.m M /issm/trunk-jpl/test/NightlyRun/test2101.m M /issm/trunk-jpl/test/NightlyRun/test2101.py M /issm/trunk-jpl/test/Par/SquareSheetConstrained.py\\
+Export determination: 6. \\
+Rationale: CHG: Completed MATLAB -> Python updates for SE; archive updates now that GMSH can be used on macOS and Linux; various minor bug fixes; formatting; cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#521} with diff file ISSM-26359-26360.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBgemb.py M /issm/trunk-jpl/src/m/classes/dsl.py M /issm/trunk-jpl/src/m/classes/matdamageice.py\\
+Export determination: 6. \\
+Rationale: BUG: Member initialization; removed print statement; missing include\\
+\vspace{3em}
+
+\noindent \textbf{Change \#522} with diff file ISSM-26360-26361.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py\\
+Export determination: 6. \\
+Rationale: BUG: Missing variadic args\\
+\vspace{3em}
+
+\noindent \textbf{Change \#523} with diff file ISSM-26361-26362.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-matlab.sh M /issm/trunk-jpl/packagers/linux/package-issm-linux-binaries-python.sh M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py\\
+Export determination: 6. \\
+Rationale: BUG: Gmsh only produces *similar* meshes at certain resolutions with changes. reverting to excluding tests that call gmshplanet under Linux for now. Will add precomputed mesh for Python later and reactivate tests.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#524} with diff file ISSM-26362-26363.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp\\
+Export determination: 6. \\
+Rationale: CHG: P0 controls now working in 3d\\
+\vspace{3em}
+
+\noindent \textbf{Change \#525} with diff file ISSM-26363-26364.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: cannot handle P0 controls\\
+\vspace{3em}
+
+\noindent \textbf{Change \#526} with diff file ISSM-26364-26365.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.m M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/taoinversion.m\\
+Export determination: 6. \\
+Rationale: CHG: deal with P0 controls and md.mesh.scale\_factor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#527} with diff file ISSM-26365-26366.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/marshall.m M /issm/trunk-jpl/src/m/solve/marshall.py\\
+Export determination: 6. \\
+Rationale: CHG: Commented out input bin file save\\
+\vspace{3em}
+
+\noindent \textbf{Change \#528} with diff file ISSM-26366-26367.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/mplapack A /issm/trunk-jpl/externalpackages/mplapack/install-0-linux.sh\\
+Export determination: 6. \\
+Rationale: ADD: External package directory and install script for MPLAPACK\\
+\vspace{3em}
+
+\noindent \textbf{Change \#529} with diff file ISSM-26367-26368.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh A /issm/trunk-jpl/externalpackages/proj/install-8.sh M /issm/trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp M /issm/trunk-jpl/src/m/modules/CoordTransform.m M /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp M /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.h\\
+Export determination: 6. \\
+Rationale: BUG: Corrected CoordTransform; added install script for PROJ 8\\
+\vspace{3em}
+
+\noindent \textbf{Change \#530} with diff file ISSM-26368-26369.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Forgot fence for major version 8\\
+\vspace{3em}
+
+\noindent \textbf{Change \#531} with diff file ISSM-26369-26370.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh A /issm/trunk-jpl/externalpackages/libtiff A /issm/trunk-jpl/externalpackages/libtiff/install-4-mac.sh D /issm/trunk-jpl/externalpackages/proj/install-6.2-static-with\_tests.sh D /issm/trunk-jpl/externalpackages/proj/install-6.2-static.sh D /issm/trunk-jpl/externalpackages/proj/install-6.2-with\_tests.sh D /issm/trunk-jpl/externalpackages/proj/install-6.2.sh A /issm/trunk-jpl/externalpackages/proj/install-8-static-with\_tests.sh (from /issm/trunk-jpl/externalpackages/proj/install-6.2-static-with\_tests.sh:26368) A /issm/trunk-jpl/externalpackages/proj/install-8-static.sh (from /issm/trunk-jpl/externalpackages/proj/install-6.2-static.sh:26368) A /issm/trunk-jpl/externalpackages/proj/install-8-with\_tests.sh (from /issm/trunk-jpl/externalpackages/proj/install-6.2-with\_tests.sh:26368) M /issm/trunk-jpl/externalpackages/proj/install-8.sh M /issm/trunk-jpl/jenkins/aws-amazon\_linux-solid\_earth M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-matlab M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-python M /issm/trunk-jpl/jenkins/pine\_island-mac-dakota M /issm/trunk-jpl/jenkins/pine\_island-mac-examples M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind M /issm/trunk-jpl/jenkins/pine\_island-mac-python M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth-lambert M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-matlab M /issm/trunk-jpl/jenkins/ross-debian\_linux-binaries-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-dakota M /issm/trunk-jpl/jenkins/ross-debian\_linux-full M /issm/trunk-jpl/jenkins/ross-debian\_linux-full-valgrind M /issm/trunk-jpl/jenkins/ross-debian\_linux-python M /issm/trunk-jpl/jenkins/ross-debian\_linux-solid\_earth\\
+Export determination: 6. \\
+Rationale: CHG: Cleanup following switch to PROJ 8\\
+\vspace{3em}
+
+\noindent \textbf{Change \#532} with diff file ISSM-26370-26371.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp M /issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.h M /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: adding value to SpcDynamic constructor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#533} with diff file ISSM-26371-26372.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: adding value to SpcDynamic constructor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#534} with diff file ISSM-26372-26373.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/interp/averaging.py\\
+Export determination: 6. \\
+Rationale: CHG: flatten only takes char inputs or none\\
+\vspace{3em}
+
+\noindent \textbf{Change \#535} with diff file ISSM-26373-26374.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/organizer.py\\
+Export determination: 6. \\
+Rationale: BUG: organizer not checking correct string value\\
+\vspace{3em}
+
+\noindent \textbf{Change \#536} with diff file ISSM-26374-26375.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/exp/contourlevelzero.py A /issm/trunk-jpl/src/m/parameterization/reinitializelevelset.py\\
+Export determination: 6. \\
+Rationale: NEW: add some helpful python versions of routines\\
+\vspace{3em}
+
+\noindent \textbf{Change \#537} with diff file ISSM-26375-26376.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/modules/ExpToLevelSet.py\\
+Export determination: 6. \\
+Rationale: CHG: check for str, got error on basestring\\
+\vspace{3em}
+
+\noindent \textbf{Change \#538} with diff file ISSM-26376-26377.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/interp/averaging.m M /issm/trunk-jpl/src/m/interp/averaging.py\\
+Export determination: 6. \\
+Rationale: CHG: update comment and clean up python averaging\\
+\vspace{3em}
+
+\noindent \textbf{Change \#539} with diff file ISSM-26377-26378.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/wrappers/javascript/Makefile.am M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: Config changes when compiling against Python 3; cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#540} with diff file ISSM-26378-26379.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/proj/install-8-static-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-8-static.sh M /issm/trunk-jpl/externalpackages/proj/install-8-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-8.sh\\
+Export determination: 6. \\
+Rationale: CHG: Adding sqlite lib flag back in\\
+\vspace{3em}
+
+\noindent \textbf{Change \#541} with diff file ISSM-26379-26380.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.15-mac-arm.sh\\
+Export determination: 6. \\
+Rationale: NEW: petsc 3.15 for mac arm\\
+\vspace{3em}
+
+\noindent \textbf{Change \#542} with diff file ISSM-26380-26381.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: Bad commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#543} with diff file ISSM-26381-26382.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/proj/install-8-static-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-8-static.sh M /issm/trunk-jpl/externalpackages/proj/install-8-with\_tests.sh M /issm/trunk-jpl/externalpackages/proj/install-8.sh\\
+Export determination: 6. \\
+Rationale: BUG: disable-tiff, not disable-libtiff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#544} with diff file ISSM-26382-26383.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/plot/colormaps/turbo.m\\
+Export determination: 6. \\
+Rationale: NEW: colormap based on Jet scheme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#545} with diff file ISSM-26383-26384.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solvers/asmoptions.py\\
+Export determination: 6. \\
+Rationale: CHG: asmoptions needs to return a dictionary object\\
+\vspace{3em}
+
+\noindent \textbf{Change \#546} with diff file ISSM-26384-26385.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG adding SHP conditional compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#547} with diff file ISSM-26385-26386.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG adding SHP conditional compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#548} with diff file ISSM-26386-26387.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/modules/ShpRead.m\\
+Export determination: 6. \\
+Rationale: CHG: fixing doc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#549} with diff file ISSM-26387-26388.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/ShpRead/ShpRead.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added support for pointZ\\
+\vspace{3em}
+
+\noindent \textbf{Change \#550} with diff file ISSM-26388-26389.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp\\
+Export determination: 6. \\
+Rationale: BUG: models with no mesh (LoveSolution) could not run with the new partitionning routine\\
+\vspace{3em}
+
+\noindent \textbf{Change \#551} with diff file ISSM-26389-26390.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stressbalance.py\\
+Export determination: 6. \\
+Rationale: CHG: python match spc check in matlab\\
+\vspace{3em}
+
+\noindent \textbf{Change \#552} with diff file ISSM-26390-26391.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/organizer.py\\
+Export determination: 6. \\
+Rationale: CHG: fix indent\\
+\vspace{3em}
+
+\noindent \textbf{Change \#553} with diff file ISSM-26391-26392.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/matice.py\\
+Export determination: 6. \\
+Rationale: CHG: matice can handle rheology\_B of python len 1 or more now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#554} with diff file ISSM-26392-26393.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: BUG: should place AM\_CONDITIONAL outside of if\\
+\vspace{3em}
+
+\noindent \textbf{Change \#555} with diff file ISSM-26393-26394.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/m1qn3/install.sh A /issm/trunk-jpl/externalpackages/m1qn3/patch A /issm/trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch A /issm/trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig\\
+Export determination: 6. \\
+Rationale: CHG: fix compiler warning\\
+\vspace{3em}
+
+\noindent \textbf{Change \#556} with diff file ISSM-26394-26395.diff: \\
+Function name: \\
+D /issm/trunk-jpl/externalpackages/m1qn3/patch/m1qn3.f.patch.orig\\
+Export determination: 6. \\
+Rationale: CHG: fix compiler warning\\
+\vspace{3em}
+
+\noindent \textbf{Change \#557} with diff file ISSM-26395-26396.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp M /issm/trunk-jpl/test/Archives/Archive236.arch M /issm/trunk-jpl/test/Archives/Archive237.arch M /issm/trunk-jpl/test/Archives/Archive245.arch M /issm/trunk-jpl/test/Archives/Archive247.arch\\
+Export determination: 6. \\
+Rationale: CHG: remove smb scaling by 95 percent since we don't know where the logic for it came from\\
+\vspace{3em}
+
+\noindent \textbf{Change \#558} with diff file ISSM-26396-26397.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive238.arch M /issm/trunk-jpl/test/Archives/Archive239.arch M /issm/trunk-jpl/test/Archives/Archive240.arch\\
+Export determination: 6. \\
+Rationale: CHG: update del018 archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#559} with diff file ISSM-26397-26398.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/discover.py\\
+Export determination: 6. \\
+Rationale: CHG: cast time to int\\
+\vspace{3em}
+
+\noindent \textbf{Change \#560} with diff file ISSM-26398-26399.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/coordsystems/ll2xy.py\\
+Export determination: 6. \\
+Rationale: CHG: need to check length of array, not array value\\
+\vspace{3em}
+
+\noindent \textbf{Change \#561} with diff file ISSM-26399-26400.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/subplotmodel.m\\
+Export determination: 6. \\
+Rationale: CHG: added axes option\\
+\vspace{3em}
+
+\noindent \textbf{Change \#562} with diff file ISSM-26400-26401.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh\\
+Export determination: 6. \\
+Rationale: NEW: added install-3.15-discovery.sh for Dartmouth discovery\\
+\vspace{3em}
+
+\noindent \textbf{Change \#563} with diff file ISSM-26401-26402.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/coordsystems/ll2xy.py\\
+Export determination: 6. \\
+Rationale: CHG: ll2xy python should check for arguments and not default to Antarctica\\
+\vspace{3em}
+
+\noindent \textbf{Change \#564} with diff file ISSM-26402-26403.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive247.arch M /issm/trunk-jpl/test/NightlyRun/test247.m M /issm/trunk-jpl/test/NightlyRun/test247.py\\
+Export determination: 6. \\
+Rationale: CHG: lower test resolution to 180km\\
+\vspace{3em}
+
+\noindent \textbf{Change \#565} with diff file ISSM-26403-26404.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: update to newest sea level class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#566} with diff file ISSM-26404-26405.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SlrGRACE/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: add selfattraction\\
+\vspace{3em}
+
+\noindent \textbf{Change \#567} with diff file ISSM-26405-26406.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh\\
+Export determination: 6. \\
+Rationale: NEW: configure petsc 3.25 pleiades\\
+\vspace{3em}
+
+\noindent \textbf{Change \#568} with diff file ISSM-26406-26407.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh\\
+Export determination: 6. \\
+Rationale: CHG: minor added --with-make-np=20\\
+\vspace{3em}
+
+\noindent \textbf{Change \#569} with diff file ISSM-26407-26408.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/matice.py M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py\\
+Export determination: 6. \\
+Rationale: CHG: some updates for test2003 to run\\
+\vspace{3em}
+
+\noindent \textbf{Change \#570} with diff file ISSM-26408-26409.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: use any instead of contains for older matlabs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#571} with diff file ISSM-26409-26410.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: fix the call to any for older matlabs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#572} with diff file ISSM-26410-26411.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.py\\
+Export determination: 6. \\
+Rationale: BUG: fix python gmsh issues\\
+\vspace{3em}
+
+\noindent \textbf{Change \#573} with diff file ISSM-26411-26412.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: memory leak. fixing Bprime never used\\
+\vspace{3em}
+
+\noindent \textbf{Change \#574} with diff file ISSM-26412-26413.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp\\
+Export determination: 6. \\
+Rationale: BUG: memory leak, fixed basal element problem\\
+\vspace{3em}
+
+\noindent \textbf{Change \#575} with diff file ISSM-26413-26414.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh\\
+Export determination: 6. \\
+Rationale: NEW: petsc install with ifort and icc for babylon\\
+\vspace{3em}
+
+\noindent \textbf{Change \#576} with diff file ISSM-26414-26415.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/codipack/install.sh M /issm/trunk-jpl/externalpackages/medipack/install.sh M /issm/trunk-jpl/jenkins/ross-debian\_linux-codipack\\
+Export determination: 6. \\
+Rationale: BUG: Should be unpacking to install/.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#577} with diff file ISSM-26415-26416.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/CoordinateSystemTransformx/CoordinateSystemTransformx.cpp M /issm/trunk-jpl/src/wrappers/CoordTransform/CoordTransform.cpp M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: Fixes for PROJ on Jenkins macOS build node\\
+\vspace{3em}
+
+\noindent \textbf{Change \#578} with diff file ISSM-26416-26417.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/proj/install-6.sh\\
+Export determination: 6. \\
+Rationale: BUG: Fixes for PROJ on Jenkins macOS build node\\
+\vspace{3em}
+
+\noindent \textbf{Change \#579} with diff file ISSM-26417-26418.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-dakota M /issm/trunk-jpl/jenkins/pine\_island-mac-examples M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth-lambert\\
+Export determination: 6. \\
+Rationale: BUG: Fixes for PROJ on Jenkins macOS build node\\
+\vspace{3em}
+
+\noindent \textbf{Change \#580} with diff file ISSM-26418-26419.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/proj/install-6.sh\\
+Export determination: 6. \\
+Rationale: CHG: Need to disable liftoff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#581} with diff file ISSM-26419-26420.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/clusters/smce\_eis.py\\
+Export determination: 6. \\
+Rationale: ADD: Initial commit of cluster class for SMCE EIS pilot study\\
+\vspace{3em}
+
+\noindent \textbf{Change \#582} with diff file ISSM-26420-26421.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added new stabilization schemes for levelset transport\\
+\vspace{3em}
+
+\noindent \textbf{Change \#583} with diff file ISSM-26421-26422.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/levelset.js M /issm/trunk-jpl/src/m/classes/levelset.m M /issm/trunk-jpl/src/m/classes/levelset.py\\
+Export determination: 6. \\
+Rationale: CHG: added new stabilization schemes for levelset transport\\
+\vspace{3em}
+
+\noindent \textbf{Change \#584} with diff file ISSM-26422-26423.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive801.arch\\
+Export determination: 6. \\
+Rationale: CHG: new archive now that Streamline Upwinding works\\
+\vspace{3em}
+
+\noindent \textbf{Change \#585} with diff file ISSM-26423-26424.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#586} with diff file ISSM-26424-26425.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: bad commit revert back\\
+\vspace{3em}
+
+\noindent \textbf{Change \#587} with diff file ISSM-26425-26426.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive805.arch\\
+Export determination: 6. \\
+Rationale: CHG: new archive now that Streamline Upwinding works\\
+\vspace{3em}
+
+\noindent \textbf{Change \#588} with diff file ISSM-26426-26427.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-adolc-ampion M /issm/trunk-jpl/jenkins/pine\_island-mac-basic M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-matlab M /issm/trunk-jpl/jenkins/pine\_island-mac-binaries-python M /issm/trunk-jpl/jenkins/pine\_island-mac-dakota M /issm/trunk-jpl/jenkins/pine\_island-mac-examples M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind M /issm/trunk-jpl/jenkins/pine\_island-mac-python M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth-lambert\\
+Export determination: 6. \\
+Rationale: CHG: New version of gcc on Pine Island\\
+\vspace{3em}
+
+\noindent \textbf{Change \#589} with diff file ISSM-26427-26428.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install-linux.sh M /issm/trunk-jpl/externalpackages/autotools/install-mac.sh M /issm/trunk-jpl/externalpackages/autotools/install-win.sh\\
+Export determination: 6. \\
+Rationale: CHG: Latest version of m4\\
+\vspace{3em}
+
+\noindent \textbf{Change \#590} with diff file ISSM-26428-26429.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-adolc-ampion M /issm/trunk-jpl/jenkins/pine\_island-mac-basic M /issm/trunk-jpl/jenkins/pine\_island-mac-dakota M /issm/trunk-jpl/jenkins/pine\_island-mac-examples M /issm/trunk-jpl/jenkins/pine\_island-mac-full M /issm/trunk-jpl/jenkins/pine\_island-mac-full-valgrind M /issm/trunk-jpl/jenkins/pine\_island-mac-python M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth-lambert\\
+Export determination: 6. \\
+Rationale: BUG: Inconsistent download of MUMPS: reverting to PETSc 3.12\\
+\vspace{3em}
+
+\noindent \textbf{Change \#591} with diff file ISSM-26429-26430.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive801.arch\\
+Export determination: 6. \\
+Rationale: CHG: new streamline upwinding scheme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#592} with diff file ISSM-26430-26431.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-solid\_earth\\
+Export determination: 6. \\
+Rationale: BUG: Missed a revert\\
+\vspace{3em}
+
+\noindent \textbf{Change \#593} with diff file ISSM-26431-26432.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/build.sh\\
+Export determination: 6. \\
+Rationale: fixed mitgcm compilation on babylon\\
+\vspace{3em}
+
+\noindent \textbf{Change \#594} with diff file ISSM-26432-26433.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/cores/ad\_core.cpp M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h M /issm/trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp M /issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h M /issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on integrating CoDiPack 2.0, still not working\\
+\vspace{3em}
+
+\noindent \textbf{Change \#595} with diff file ISSM-26433-26434.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp M /issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp M /issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp\\
+Export determination: 6. \\
+Rationale: CHG: transitioning to CoDiPack v2.0\\
+\vspace{3em}
+
+\noindent \textbf{Change \#596} with diff file ISSM-26434-26435.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing levelset SUPG\\
+\vspace{3em}
+
+\noindent \textbf{Change \#597} with diff file ISSM-26435-26436.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/smce\_eis.py M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/solve/waitonlock.py\\
+Export determination: 6. \\
+Rationale: CHG: Updates to SMCE cluster class to properly download results; waitonlock now supports ID file; minor formatting\\
+\vspace{3em}
+
+\noindent \textbf{Change \#598} with diff file ISSM-26436-26437.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/muq A /issm/trunk-jpl/externalpackages/muq/install.sh\\
+Export determination: 6. \\
+Rationale: NEW: added muq\\
+\vspace{3em}
+
+\noindent \textbf{Change \#599} with diff file ISSM-26437-26438.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive127.arch A /issm/trunk-jpl/test/Archives/Archive128.arch A /issm/trunk-jpl/test/Archives/Archive129.arch A /issm/trunk-jpl/test/NightlyRun/test127.m A /issm/trunk-jpl/test/NightlyRun/test127.py A /issm/trunk-jpl/test/NightlyRun/test128.m A /issm/trunk-jpl/test/NightlyRun/test128.py A /issm/trunk-jpl/test/NightlyRun/test129.m A /issm/trunk-jpl/test/NightlyRun/test129.py\\
+Export determination: 6. \\
+Rationale: NEW: adding NR tests for MOLHO formulation (MLHO)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#600} with diff file ISSM-26438-26439.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive248.arch A /issm/trunk-jpl/test/Archives/Archive249.arch A /issm/trunk-jpl/test/Archives/Archive254.arch A /issm/trunk-jpl/test/NightlyRun/test248.m A /issm/trunk-jpl/test/NightlyRun/test248.py A /issm/trunk-jpl/test/NightlyRun/test249.m A /issm/trunk-jpl/test/NightlyRun/test249.py A /issm/trunk-jpl/test/NightlyRun/test254.m A /issm/trunk-jpl/test/NightlyRun/test254.py\\
+Export determination: 6. \\
+Rationale: NEW: NR tests for MLHO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#601} with diff file ISSM-26439-26440.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive255.arch A /issm/trunk-jpl/test/Archives/Archive256.arch A /issm/trunk-jpl/test/Archives/Archive330.arch A /issm/trunk-jpl/test/Archives/Archive332.arch A /issm/trunk-jpl/test/Archives/Archive446.arch A /issm/trunk-jpl/test/Archives/Archive447.arch A /issm/trunk-jpl/test/Archives/Archive448.arch A /issm/trunk-jpl/test/Archives/Archive449.arch A /issm/trunk-jpl/test/NightlyRun/test255.m A /issm/trunk-jpl/test/NightlyRun/test255.py A /issm/trunk-jpl/test/NightlyRun/test256.m A /issm/trunk-jpl/test/NightlyRun/test256.py A /issm/trunk-jpl/test/NightlyRun/test330.m A /issm/trunk-jpl/test/NightlyRun/test330.py A /issm/trunk-jpl/test/NightlyRun/test332.m A /issm/trunk-jpl/test/NightlyRun/test332.py A /issm/trunk-jpl/test/NightlyRun/test446.m A /issm/trunk-jpl/test/NightlyRun/test446.py A /issm/trunk-jpl/test/NightlyRun/test447.m A /issm/trunk-jpl/test/NightlyRun/test447.py A /issm/trunk-jpl/test/NightlyRun/test448.m A /issm/trunk-jpl/test/NightlyRun/test448.py A /issm/trunk-jpl/test/NightlyRun/test449.m A /issm/trunk-jpl/test/NightlyRun/test449.py\\
+Export determination: 6. \\
+Rationale: NEW: NR tests for MLHO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#602} with diff file ISSM-26440-26441.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive518.arch A /issm/trunk-jpl/test/Archives/Archive519.arch A /issm/trunk-jpl/test/Archives/Archive810.arch A /issm/trunk-jpl/test/Archives/Archive811.arch A /issm/trunk-jpl/test/Archives/Archive812.arch A /issm/trunk-jpl/test/NightlyRun/test518.m A /issm/trunk-jpl/test/NightlyRun/test518.py A /issm/trunk-jpl/test/NightlyRun/test519.m A /issm/trunk-jpl/test/NightlyRun/test519.py A /issm/trunk-jpl/test/NightlyRun/test810.m A /issm/trunk-jpl/test/NightlyRun/test810.py A /issm/trunk-jpl/test/NightlyRun/test811.m A /issm/trunk-jpl/test/NightlyRun/test811.py A /issm/trunk-jpl/test/NightlyRun/test812.m A /issm/trunk-jpl/test/NightlyRun/test812.py\\
+Export determination: 6. \\
+Rationale: NEW: NR test for HO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#603} with diff file ISSM-26441-26442.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py\\
+Export determination: 6. \\
+Rationale: CHG: parsing averaged velocity (MLHO)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#604} with diff file ISSM-26442-26443.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/test/Archives/Archive447.arch M /issm/trunk-jpl/test/Archives/Archive518.arch M /issm/trunk-jpl/test/Archives/Archive519.arch\\
+Export determination: 6. \\
+Rationale: BUG: fixed error in MLHO tests and the forcing term of the calving front when bed is above sea level\\
+\vspace{3em}
+
+\noindent \textbf{Change \#605} with diff file ISSM-26443-26444.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: rewriting/reorganizing crevasse depth law\\
+\vspace{3em}
+
+\noindent \textbf{Change \#606} with diff file ISSM-26444-26445.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/calvingcrevassedepth.m M /issm/trunk-jpl/src/m/classes/calvingcrevassedepth.py\\
+Export determination: 6. \\
+Rationale: NEW: added calving\_threshold\\
+\vspace{3em}
+
+\noindent \textbf{Change \#607} with diff file ISSM-26445-26446.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added one enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#608} with diff file ISSM-26446-26447.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/flowequation.py\\
+Export determination: 6. \\
+Rationale: BUG: Missing checkconsistency case\\
+\vspace{3em}
+
+\noindent \textbf{Change \#609} with diff file ISSM-26447-26448.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/ross-win-msys2-mingw-msmpi-basic\\
+Export determination: 6. \\
+Rationale: BUG: Skipping test because it has restart\\
+\vspace{3em}
+
+\noindent \textbf{Change \#610} with diff file ISSM-26448-26449.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: made Crevasse depth more efficient by removing ToMPISerial\\
+\vspace{3em}
+
+\noindent \textbf{Change \#611} with diff file ISSM-26449-26450.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/MITgcm/code\_4003/shelfice\_step\_icemass.F\\
+Export determination: 6. \\
+Rationale: adding unmodified shelfice\_step\_icemass.F\\
+\vspace{3em}
+
+\noindent \textbf{Change \#612} with diff file ISSM-26450-26451.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: rewriting a bit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#613} with diff file ISSM-26451-26452.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/calvingcrevassedepth.m\\
+Export determination: 6. \\
+Rationale: BUG: wrong check on crevasse depth threshold\\
+\vspace{3em}
+
+\noindent \textbf{Change \#614} with diff file ISSM-26452-26453.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code\_4003/SHELFICE\_OPTIONS.h M /issm/trunk-jpl/test/MITgcm/code\_4003/packages.conf M /issm/trunk-jpl/test/MITgcm/code\_4003/shelfice\_step\_icemass.F M /issm/trunk-jpl/test/MITgcm/coupling\_rules.txt A /issm/trunk-jpl/test/MITgcm/input\_4003/data.shelfice M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: first attempt to modify test4003 for remeshing has not been tested and debugged yet\\
+\vspace{3em}
+
+\noindent \textbf{Change \#615} with diff file ISSM-26453-26454.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code\_4003/shelfice\_step\_icemass.F\\
+Export determination: 6. \\
+Rationale: adding a missing THEN\\
+\vspace{3em}
+
+\noindent \textbf{Change \#616} with diff file ISSM-26454-26455.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test4002.m\\
+Export determination: 6. \\
+Rationale: CHG: no grounding line in test4002\\
+\vspace{3em}
+
+\noindent \textbf{Change \#617} with diff file ISSM-26455-26456.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/basalforcingsismip6.m\\
+Export determination: 6. \\
+Rationale: CHG: add size option in checkconsistency for basalforcingsismip6.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#618} with diff file ISSM-26456-26457.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test4002.m\\
+Export determination: 6. \\
+Rationale: CHG: no grounding line migration in test4002\\
+\vspace{3em}
+
+\noindent \textbf{Change \#619} with diff file ISSM-26457-26458.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.h M /issm/trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h\\
+Export determination: 6. \\
+Rationale: CHG: add VxSurface, VxBase, VySurface, VyBase to all 2D models: SSA, L1L2 and MLHO. Modified friction and misfit functions to use these variables instead of Vx and Vy.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#620} with diff file ISSM-26458-26459.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed basal velocities if 2d model with SSA\\
+\vspace{3em}
+
+\noindent \textbf{Change \#621} with diff file ISSM-26459-26460.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed basal velocities if 2d model with SSA\\
+\vspace{3em}
+
+\noindent \textbf{Change \#622} with diff file ISSM-26460-26461.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed basal velocities if 2d model with SSA\\
+\vspace{3em}
+
+\noindent \textbf{Change \#623} with diff file ISSM-26461-26462.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added migration max to crevasse depth law\\
+\vspace{3em}
+
+\noindent \textbf{Change \#624} with diff file ISSM-26462-26463.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive809.arch\\
+Export determination: 6. \\
+Rationale: CHG: updated archive now that we fixed the factor 2 in CD law\\
+\vspace{3em}
+
+\noindent \textbf{Change \#625} with diff file ISSM-26463-26464.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.h\\
+Export determination: 6. \\
+Rationale: CHG: use Friction.cpp to take care of the choice of basal velocity, set the pointers of the inputs as public attributes of Friction, provide functions to fetch the basal velocities that used for calculating the friciton\\
+\vspace{3em}
+
+\noindent \textbf{Change \#626} with diff file ISSM-26464-26465.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/test/Archives/Archive809.arch\\
+Export determination: 6. \\
+Rationale: CHG: fixing crevasse depth law: missing factor 2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#627} with diff file ISSM-26465-26466.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing memory leak\\
+\vspace{3em}
+
+\noindent \textbf{Change \#628} with diff file ISSM-26466-26467.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.h\\
+Export determination: 6. \\
+Rationale: CHG: update to int double\\
+\vspace{3em}
+
+\noindent \textbf{Change \#629} with diff file ISSM-26467-26468.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/jl A /issm/trunk-jpl/src/jl/exp.jl A /issm/trunk-jpl/src/jl/issm.jl A /issm/trunk-jpl/src/jl/triangle.jl\\
+Export determination: 6. \\
+Rationale: CHG: very preliminary julia stuff\\
+\vspace{3em}
+
+\noindent \textbf{Change \#630} with diff file ISSM-26468-26469.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/classes/AmrBamg.cpp M /issm/trunk-jpl/src/c/classes/AmrNeopz.cpp M /issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp M /issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp M /issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/GrdLoads.cpp M /issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Node.cpp M /issm/trunk-jpl/src/c/classes/SealevelGeometry.cpp M /issm/trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp M /issm/trunk-jpl/src/c/cores/adjointstressbalance\_core.cpp M /issm/trunk-jpl/src/c/cores/balancethickness\_core.cpp M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/src/c/cores/dakota\_core.cpp M /issm/trunk-jpl/src/c/cores/esa\_core.cpp M /issm/trunk-jpl/src/c/cores/hydrology\_core.cpp M /issm/trunk-jpl/src/c/cores/love\_core.cpp M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp M /issm/trunk-jpl/src/c/cores/movingfront\_core.cpp M /issm/trunk-jpl/src/c/cores/oceantransport\_core.cpp M /issm/trunk-jpl/src/c/cores/sealevelchange\_core.cpp M /issm/trunk-jpl/src/c/main/esmfbinders.cpp M /issm/trunk-jpl/src/c/main/issm.cpp M /issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp M /issm/trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp M /issm/trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp M /issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_nonlinear.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_schurcg.cpp M /issm/trunk-jpl/src/c/toolkits/codipack/ampi\_interface.cpp M /issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing extraneous lines\\
+\vspace{3em}
+
+\noindent \textbf{Change \#631} with diff file ISSM-26469-26470.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h M /issm/trunk-jpl/src/c/classes/AmrBamg.h M /issm/trunk-jpl/src/c/classes/BarystaticContributions.h M /issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h M /issm/trunk-jpl/src/c/classes/Cflevelsetmisfit.h M /issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.h M /issm/trunk-jpl/src/c/classes/Cfsurfacesquare.h M /issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.h M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h M /issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h M /issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.h M /issm/trunk-jpl/src/c/classes/Masscon.h M /issm/trunk-jpl/src/c/classes/Massconaxpby.h M /issm/trunk-jpl/src/c/classes/Massfluxatgate.h M /issm/trunk-jpl/src/c/classes/Misfit.h M /issm/trunk-jpl/src/c/classes/Numberedcostfunction.h M /issm/trunk-jpl/src/c/classes/Options/Option.h M /issm/trunk-jpl/src/c/classes/Profiler.h M /issm/trunk-jpl/src/c/classes/Radar.h M /issm/trunk-jpl/src/c/classes/SealevelGeometry.h M /issm/trunk-jpl/src/c/classes/kriging/Covertree.h M /issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h M /issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.h M /issm/trunk-jpl/src/c/classes/kriging/Quadtree.h M /issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.h M /issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStateLocal.h M /issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h M /issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h M /issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.h M /issm/trunk-jpl/src/c/shared/Matrix/matrix.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h M /issm/trunk-jpl/src/c/toolkits/issm/SparseRow.h\\
+Export determination: 6. \\
+Rationale: CHG: removing extraneous lines\\
+\vspace{3em}
+
+\noindent \textbf{Change \#632} with diff file ISSM-26470-26471.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.h\\
+Export determination: 6. \\
+Rationale: BUG: fixed constructor of Friction for dim with different data types\\
+\vspace{3em}
+
+\noindent \textbf{Change \#633} with diff file ISSM-26471-26472.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/issm.jl M /issm/trunk-jpl/src/jl/triangle.jl\\
+Export determination: 6. \\
+Rationale: CHG: slow progress...\\
+\vspace{3em}
+
+\noindent \textbf{Change \#634} with diff file ISSM-26472-26473.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/exp.jl M /issm/trunk-jpl/src/jl/issm.jl A /issm/trunk-jpl/src/jl/plotmodel.jl M /issm/trunk-jpl/src/jl/triangle.jl\\
+Export determination: 6. \\
+Rationale: CHG: working on plotmodel\\
+\vspace{3em}
+
+\noindent \textbf{Change \#635} with diff file ISSM-26473-26474.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/exp.jl M /issm/trunk-jpl/src/jl/plotmodel.jl\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#636} with diff file ISSM-26474-26475.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/coordsystems/ll2xy.m\\
+Export determination: 6. \\
+Rationale: BUG: Corrected help message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#637} with diff file ISSM-26475-26476.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: the coefficient of SurfaceAverageVelMisfit in PVector is 1\\
+\vspace{3em}
+
+\noindent \textbf{Change \#638} with diff file ISSM-26476-26477.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: moving TRIANGLEINCL ahead of PETSCINCL to avoid compatibility issues with PETSc's own triangle.h header file\\
+\vspace{3em}
+
+\noindent \textbf{Change \#639} with diff file ISSM-26477-26478.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Matrix/matrix.h A /issm/trunk-jpl/src/c/shared/Random A /issm/trunk-jpl/src/c/shared/Random/random.cpp A /issm/trunk-jpl/src/c/shared/Random/random.h M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp A /issm/trunk-jpl/src/m/classes/SMBautoregression.m\\
+Export determination: 6. \\
+Rationale: autoregression SMB module, Random utilities, Cholesky decomposition\\
+\vspace{3em}
+
+\noindent \textbf{Change \#640} with diff file ISSM-26478-26479.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Materials/Material.h M /issm/trunk-jpl/src/c/classes/Materials/Matestar.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matestar.h M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/Materials/Matlitho.h M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp M /issm/trunk-jpl/src/m/classes/inversion.m A /issm/trunk-jpl/test/Archives/Archive333.arch A /issm/trunk-jpl/test/Archives/Archive334.arch A /issm/trunk-jpl/test/NightlyRun/test333.m A /issm/trunk-jpl/test/NightlyRun/test333.py A /issm/trunk-jpl/test/NightlyRun/test334.m A /issm/trunk-jpl/test/NightlyRun/test334.py\\
+Export determination: 6. \\
+Rationale: NEW: add adjoint MLHO for friction and rheology\\
+\vspace{3em}
+
+\noindent \textbf{Change \#641} with diff file ISSM-26479-26480.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Random/random.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing style and AD after Vincent's commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#642} with diff file ISSM-26480-26481.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.py\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#643} with diff file ISSM-26481-26482.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#644} with diff file ISSM-26482-26483.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Random/random.cpp\\
+Export determination: 6. \\
+Rationale: CHG: compliance with ISSM coding guidelines, random noise computation uniform accross CPUs in Smbautoregression, remove duplicate code in OceanExchangeDatax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#645} with diff file ISSM-26483-26484.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/shared/Random/random.cpp M /issm/trunk-jpl/src/c/shared/Random/random.h M /issm/trunk-jpl/src/m/classes/SMBautoregression.m\\
+Export determination: 6. \\
+Rationale: NEW: randomflag allows to use fixed random seed in random.cpp, zero-initialization of smbspin for SmbAutoregression\\
+\vspace{3em}
+
+\noindent \textbf{Change \#646} with diff file ISSM-26484-26485.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing AD\\
+\vspace{3em}
+
+\noindent \textbf{Change \#647} with diff file ISSM-26485-26486.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing AD\\
+\vspace{3em}
+
+\noindent \textbf{Change \#648} with diff file ISSM-26486-26487.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBautoregression.m A /issm/trunk-jpl/src/m/classes/SMBautoregression.py M /issm/trunk-jpl/src/m/classes/SMBcomponents.m M /issm/trunk-jpl/src/m/classes/SMBcomponents.py\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#649} with diff file ISSM-26487-26488.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/m/classes/frontalforcingsrignot.m A /issm/trunk-jpl/test/Archives/Archive257.arch A /issm/trunk-jpl/test/Archives/Archive542.arch A /issm/trunk-jpl/test/NightlyRun/test257.m A /issm/trunk-jpl/test/NightlyRun/test542.m\\
+Export determination: 6. \\
+Rationale: CHG: adding Nightly runs for frontalforcingsrignot and SMBautoregression, changed frontalforcingrignot basin\_id variable to be element-specific\\
+\vspace{3em}
+
+\noindent \textbf{Change \#650} with diff file ISSM-26488-26489.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added Enums for Aleah\\
+\vspace{3em}
+
+\noindent \textbf{Change \#651} with diff file ISSM-26489-26490.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp M /issm/trunk-jpl/src/c/cores/hydrology\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added second derivative calculation for Aleah\\
+\vspace{3em}
+
+\noindent \textbf{Change \#652} with diff file ISSM-26490-26491.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: changed the creep closure term in SHAKTI to reduce the nonlinearity and help convergence\\
+\vspace{3em}
+
+\noindent \textbf{Change \#653} with diff file ISSM-26491-26492.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: includes diffusivity-like term for gap height - this is an experiment\\
+\vspace{3em}
+
+\noindent \textbf{Change \#654} with diff file ISSM-26492-26493.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/issm.jl M /issm/trunk-jpl/src/jl/plotmodel.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with archread, phew\\
+\vspace{3em}
+
+\noindent \textbf{Change \#655} with diff file ISSM-26493-26494.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/frontalforcingsrignot.m M /issm/trunk-jpl/src/m/classes/frontalforcingsrignot.py\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#656} with diff file ISSM-26494-26495.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive350.arch\\
+Export determination: 6. \\
+Rationale: CHG: changed the numerics of creep closure term in SHAKTI and experimental diffusivity term\\
+\vspace{3em}
+
+\noindent \textbf{Change \#657} with diff file ISSM-26495-26496.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp M /issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.h M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/IoCodeConversions.cpp A /issm/trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m M /issm/trunk-jpl/test/Archives/Archive257.arch M /issm/trunk-jpl/test/Archives/Archive542.arch A /issm/trunk-jpl/test/Archives/Archive543.arch M /issm/trunk-jpl/test/NightlyRun/test257.m M /issm/trunk-jpl/test/NightlyRun/test542.m A /issm/trunk-jpl/test/NightlyRun/test543.m\\
+Export determination: 6. \\
+Rationale: CHG: added class frontalforcingsrignotautoregression (autoregressive calculation of thermal\_forcing), autoregression routine in Element.cpp is now generic, corrected nightly runs 257 and 542, added nightly run 543\\
+\vspace{3em}
+
+\noindent \textbf{Change \#658} with diff file ISSM-26496-26497.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.16-linux.sh\\
+Export determination: 6. \\
+Rationale: CHG: added newest version of PETSc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#659} with diff file ISSM-26497-26498.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: small constant for gap diffusivity like term\\
+\vspace{3em}
+
+\noindent \textbf{Change \#660} with diff file ISSM-26498-26499.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive350.arch\\
+Export determination: 6. \\
+Rationale: CHG: updated with small constant diffusivity\\
+\vspace{3em}
+
+\noindent \textbf{Change \#661} with diff file ISSM-26499-26500.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: changed pow syntax in diffusivity term\\
+\vspace{3em}
+
+\noindent \textbf{Change \#662} with diff file ISSM-26500-26501.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/issm.jl A /issm/trunk-jpl/src/jl/issmenums.jl A /issm/trunk-jpl/src/jl/parameterization.jl A /issm/trunk-jpl/src/jl/solve.jl A /issm/trunk-jpl/src/jl/test101.jl M /issm/trunk-jpl/src/jl/triangle.jl\\
+Export determination: 6. \\
+Rationale: NEW: added more files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#663} with diff file ISSM-26501-26502.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h\\
+Export determination: 6. \\
+Rationale: ADD: 3D MLHO, Vx and Vy are recovered from vbase and vshear according to the formulation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#664} with diff file ISSM-26502-26503.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive335.arch A /issm/trunk-jpl/test/NightlyRun/test335.m A /issm/trunk-jpl/test/NightlyRun/test335.py\\
+Export determination: 6. \\
+Rationale: ADD: 3D MLHO test, this may fail on MacOS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#665} with diff file ISSM-26503-26504.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing memory leak\\
+\vspace{3em}
+
+\noindent \textbf{Change \#666} with diff file ISSM-26504-26505.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive335.arch\\
+Export determination: 6. \\
+Rationale: BUG: fix test 3D MLHO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#667} with diff file ISSM-26505-26506.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/vim/addons/vim/autoload/LaTeXtoUnicode.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/autoload/generate\_latex\_symbols\_table.jl A /issm/trunk-jpl/externalpackages/vim/addons/vim/autoload/julia A /issm/trunk-jpl/externalpackages/vim/addons/vim/autoload/julia/doc.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/autoload/julia.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/autoload/julia\_blocks.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/autoload/julia\_latex\_symbols.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/doc/generate\_latex\_symbols\_table.jl A /issm/trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U-table.txt A /issm/trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim-L2U.txt A /issm/trunk-jpl/externalpackages/vim/addons/vim/doc/julia-vim.txt A /issm/trunk-jpl/externalpackages/vim/addons/vim/ftdetect A /issm/trunk-jpl/externalpackages/vim/addons/vim/ftdetect/julia.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/ftplugin A /issm/trunk-jpl/externalpackages/vim/addons/vim/ftplugin/julia.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/ftplugin/juliadoc.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/indent/julia.vim A /issm/trunk-jpl/externalpackages/vim/addons/vim/keymap A /issm/trunk-jpl/externalpackages/vim/addons/vim/keymap/generate\_L2U\_keymap.jl A /issm/trunk-jpl/externalpackages/vim/addons/vim/keymap/latex2unicode\_utf-8.vim M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/julia.vim M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/juliadoc.vim M /issm/trunk-jpl/externalpackages/vim/addons/vimrc\\
+Export determination: 6. \\
+Rationale: CHG: added julia files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#668} with diff file ISSM-26506-26507.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test134.m\\
+Export determination: 6. \\
+Rationale: ADD: Added test to check test134\\
+\vspace{3em}
+
+\noindent \textbf{Change \#669} with diff file ISSM-26507-26508.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: ADD: Added test to check test134\\
+\vspace{3em}
+
+\noindent \textbf{Change \#670} with diff file ISSM-26508-26509.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-basic\\
+Export determination: 6. \\
+Rationale: CHG: Currently disabling tests that depend on random number generation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#671} with diff file ISSM-26509-26510.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test134.m\\
+Export determination: 6. \\
+Rationale: BUG: remove plotmodel from test134\\
+\vspace{3em}
+
+\noindent \textbf{Change \#672} with diff file ISSM-26510-26511.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: took out experimental diffusion term for now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#673} with diff file ISSM-26511-26512.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive350.arch\\
+Export determination: 6. \\
+Rationale: CHG: updated test 350 with current SHAKTI code\\
+\vspace{3em}
+
+\noindent \textbf{Change \#674} with diff file ISSM-26512-26513.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: try random generator with Mersenne Twister\\
+\vspace{3em}
+
+\noindent \textbf{Change \#675} with diff file ISSM-26513-26514.diff: \\
+Function name: \\
+D /issm/trunk-jpl/test/Archives/Archive134.arch D /issm/trunk-jpl/test/NightlyRun/test134.m\\
+Export determination: 6. \\
+Rationale: BUG: Remove Nightlyrun134\\
+\vspace{3em}
+
+\noindent \textbf{Change \#676} with diff file ISSM-26514-26515.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Implement a pseudo-random number generator for Gaussian variables in solutionsequence\_sampling.cpp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#677} with diff file ISSM-26515-26516.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test134.m\\
+Export determination: 6. \\
+Rationale: ADD: Added test to check test134\\
+\vspace{3em}
+
+\noindent \textbf{Change \#678} with diff file ISSM-26516-26517.diff: \\
+Function name: \\
+R /issm/trunk-jpl/test/Archives/Archive124.arch\\
+Export determination: 6. \\
+Rationale: CHG: Archive 124\\
+\vspace{3em}
+
+\noindent \textbf{Change \#679} with diff file ISSM-26517-26518.diff: \\
+Function name: \\
+D /issm/trunk-jpl/test/NightlyRun/test134.m\\
+Export determination: 6. \\
+Rationale: BUG: Remove Nightlyrun134\\
+\vspace{3em}
+
+\noindent \textbf{Change \#680} with diff file ISSM-26518-26519.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/issm.jl M /issm/trunk-jpl/src/jl/solve.jl\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#681} with diff file ISSM-26519-26520.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/plot/colormaps/cmocean.m\\
+Export determination: 6. \\
+Rationale: CHG: added cmocean\\
+\vspace{3em}
+
+\noindent \textbf{Change \#682} with diff file ISSM-26520-26521.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test134.m\\
+Export determination: 6. \\
+Rationale: ADD: Added test134 to check for sampling capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#683} with diff file ISSM-26521-26522.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: ADD: Added test134 to check for sampling capability\\
+\vspace{3em}
+
+\noindent \textbf{Change \#684} with diff file ISSM-26522-26523.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/jl/classes.jl M /issm/trunk-jpl/src/jl/issm.jl M /issm/trunk-jpl/src/jl/parameterization.jl M /issm/trunk-jpl/src/jl/plotmodel.jl M /issm/trunk-jpl/src/jl/solve.jl M /issm/trunk-jpl/src/jl/test101.jl M /issm/trunk-jpl/src/jl/triangle.jl A /issm/trunk-jpl/src/jl/utils.jl\\
+Export determination: 6. \\
+Rationale: CHG: changing the structure and done with ModelProcessor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#685} with diff file ISSM-26523-26524.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed memory leak\\
+\vspace{3em}
+
+\noindent \textbf{Change \#686} with diff file ISSM-26524-26525.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/valgrind/issm.supp\\
+Export determination: 6. \\
+Rationale: Adding some linux exceptions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#687} with diff file ISSM-26525-26526.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Cfsurfacesquare.cpp M /issm/trunk-jpl/src/c/classes/Cfsurfacesquare.h M /issm/trunk-jpl/src/c/datastructures/DataSet.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added Marshall to Cfsurfacesquare\\
+\vspace{3em}
+
+\noindent \textbf{Change \#688} with diff file ISSM-26526-26527.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/SMBautoregression.m M /issm/trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m M /issm/trunk-jpl/src/m/classes/model.m A /issm/trunk-jpl/src/m/classes/stochasticforcing.m A /issm/trunk-jpl/src/m/miscellaneous/supportedstochforcings.m M /issm/trunk-jpl/test/Archives/Archive257.arch M /issm/trunk-jpl/test/Archives/Archive543.arch M /issm/trunk-jpl/test/NightlyRun/test257.m M /issm/trunk-jpl/test/NightlyRun/test543.m\\
+Export determination: 6. \\
+Rationale: CHG: matlab stochasticforcing class, update of SMBautoregression and FrontalForcingsRignotAutoregression, no noise in AutoregressionInit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#689} with diff file ISSM-26527-26528.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/modules/StochasticForcingx A /issm/trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp A /issm/trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.h\\
+Export determination: 6. \\
+Rationale: BUG: forgot to add new files in previous commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#690} with diff file ISSM-26528-26529.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h\\
+Export determination: 6. \\
+Rationale: BUG: forgot to add header file in previous commits\\
+\vspace{3em}
+
+\noindent \textbf{Change \#691} with diff file ISSM-26529-26530.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: BUG: should not divide by 0 (detected with CoDiPack)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#692} with diff file ISSM-26530-26531.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive226.arch M /issm/trunk-jpl/test/Archives/Archive323.arch M /issm/trunk-jpl/test/Archives/Archive324.arch\\
+Export determination: 6. \\
+Rationale: CHG: updated archive to avoid division by 0\\
+\vspace{3em}
+
+\noindent \textbf{Change \#693} with diff file ISSM-26531-26532.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/test/Archives/Archive335.arch\\
+Export determination: 6. \\
+Rationale: NEW: use P1xP4 for 3D MLHO\\
+\vspace{3em}
+
+\noindent \textbf{Change \#694} with diff file ISSM-26532-26533.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/test/Archives/Archive257.arch M /issm/trunk-jpl/test/Archives/Archive542.arch M /issm/trunk-jpl/test/Archives/Archive543.arch M /issm/trunk-jpl/test/NightlyRun/test257.m M /issm/trunk-jpl/test/NightlyRun/test542.m M /issm/trunk-jpl/test/NightlyRun/test543.m\\
+Export determination: 6. \\
+Rationale: CHG: cleaning-up stochasticforcing.m, removing supportedstochforcings.m, correcting tests 257,542,543\\
+\vspace{3em}
+
+\noindent \textbf{Change \#695} with diff file ISSM-26533-26534.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp\\
+Export determination: 6. \\
+Rationale: CHG: prevent CoDiPack from complaining about power of a negative number\\
+\vspace{3em}
+
+\noindent \textbf{Change \#696} with diff file ISSM-26534-26535.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp\\
+Export determination: 6. \\
+Rationale: CHG: checking for NaNs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#697} with diff file ISSM-26535-26536.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpSeaRISE.m\\
+Export determination: 6. \\
+Rationale: CHG:change to use totten\\
+\vspace{3em}
+
+\noindent \textbf{Change \#698} with diff file ISSM-26536-26537.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m\\
+Export determination: 6. \\
+Rationale: CHG: adjustment for totten\\
+\vspace{3em}
+
+\noindent \textbf{Change \#699} with diff file ISSM-26537-26538.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/radarpower.m\\
+Export determination: 6. \\
+Rationale: CHG: adjustment for totten\\
+\vspace{3em}
+
+\noindent \textbf{Change \#700} with diff file ISSM-26538-26539.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.py A /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: Patch to get unrelated Python tests passing again\\
+\vspace{3em}
+
+\noindent \textbf{Change \#701} with diff file ISSM-26539-26540.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG: Need to check on field type before taking length\\
+\vspace{3em}
+
+\noindent \textbf{Change \#702} with diff file ISSM-26540-26541.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/modules/ExpToLevelSet.m\\
+Export determination: 6. \\
+Rationale: ADD: exp to levelset can handle multiple records\\
+\vspace{3em}
+
+\noindent \textbf{Change \#703} with diff file ISSM-26541-26542.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/modules/ExpToLevelSet.m\\
+Export determination: 6. \\
+Rationale: CHG:indentation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#704} with diff file ISSM-26542-26543.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code/packages.conf M /issm/trunk-jpl/test/MITgcm/code\_4003/SIZE.h\\
+Export determination: 6. \\
+Rationale: cosmetic chnages\\
+\vspace{3em}
+
+\noindent \textbf{Change \#705} with diff file ISSM-26543-26544.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code\_4003/DIAGNOSTICS\_SIZE.h M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: moving from verification/shelfice\_remeshing to verification/shelfice\_2d\_remesh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#706} with diff file ISSM-26544-26545.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code/CPP\_EEOPTIONS.h M /issm/trunk-jpl/test/MITgcm/code/do\_oceanic\_phys.F M /issm/trunk-jpl/test/MITgcm/code/eeboot\_minimal.F M /issm/trunk-jpl/test/MITgcm/code/packages.conf M /issm/trunk-jpl/test/MITgcm/code\_4003/CPP\_EEOPTIONS.h M /issm/trunk-jpl/test/MITgcm/code\_4003/CPP\_OPTIONS.h M /issm/trunk-jpl/test/MITgcm/code\_4003/DIAGNOSTICS\_SIZE.h M /issm/trunk-jpl/test/MITgcm/code\_4003/DIAG\_OPTIONS.h M /issm/trunk-jpl/test/MITgcm/code\_4003/OBCS\_OPTIONS.h M /issm/trunk-jpl/test/MITgcm/code\_4003/SIZE.h D /issm/trunk-jpl/test/MITgcm/code\_4003/STREAMICE\_OPTIONS.h M /issm/trunk-jpl/test/MITgcm/code\_4003/do\_oceanic\_phys.F M /issm/trunk-jpl/test/MITgcm/code\_4003/eeboot\_minimal.F M /issm/trunk-jpl/test/MITgcm/code\_4003/packages.conf M /issm/trunk-jpl/test/MITgcm/code\_4003/shelfice\_step\_icemass.F\\
+Export determination: 6. \\
+Rationale: updating code and code\_4003 to MItgcm checkpoint68c+\\
+\vspace{3em}
+
+\noindent \textbf{Change \#707} with diff file ISSM-26545-26546.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code\_4003/SIZE.h M /issm/trunk-jpl/test/MITgcm/input\_4003/data M /issm/trunk-jpl/test/MITgcm/input\_4003/data.shelfice M /issm/trunk-jpl/test/MITgcm/input\_4003/data\_uncoupled M /issm/trunk-jpl/test/MITgcm/input\_4003/eedata M /issm/trunk-jpl/test/MITgcm/input\_4003/eedata\_uncoupled M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: working on steps 1-6 of test4003\\
+\vspace{3em}
+
+\noindent \textbf{Change \#708} with diff file ISSM-26546-26547.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: make levelset work for every case (dynamic and forced)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#709} with diff file ISSM-26547-26548.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: was not compiling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#710} with diff file ISSM-26548-26549.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: was not compiling\\
+\vspace{3em}
+
+\noindent \textbf{Change \#711} with diff file ISSM-26549-26550.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/test/Archives/Archive257.arch\\
+Export determination: 6. \\
+Rationale: BUG: fixed use of self.covariance in stochasticforcing.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#712} with diff file ISSM-26550-26551.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/SMBgemb.m M /issm/trunk-jpl/src/m/classes/SMBgemb.py\\
+Export determination: 6. \\
+Rationale: CHG: update how we deal with emissivity, giving user more options to change value on wet snow/ice, and when grain size exceeds a threshold value. Add option to run with a bias correction to outgoing long wave radiation.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#713} with diff file ISSM-26551-26552.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/coordsystems/laea\_inv.m\\
+Export determination: 6. \\
+Rationale: NEW: added lambert to lat lon\\
+\vspace{3em}
+
+\noindent \textbf{Change \#714} with diff file ISSM-26552-26553.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/issm/IssmDenseMat.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h\\
+Export determination: 6. \\
+Rationale: BUG: prevent compiler from complaining about missing output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#715} with diff file ISSM-26553-26554.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBautoregression.py M /issm/trunk-jpl/src/m/classes/calvingvonmises.py M /issm/trunk-jpl/src/m/classes/frontalforcingsrignot.py M /issm/trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.m A /issm/trunk-jpl/src/m/classes/frontalforcingsrignotautoregression.py M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py M /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py M /issm/trunk-jpl/src/m/solve/WriteData.py M /issm/trunk-jpl/test/NightlyRun/runme.py M /issm/trunk-jpl/test/NightlyRun/test257.m A /issm/trunk-jpl/test/NightlyRun/test257.py M /issm/trunk-jpl/test/NightlyRun/test542.m A /issm/trunk-jpl/test/NightlyRun/test542.py M /issm/trunk-jpl/test/NightlyRun/test543.m A /issm/trunk-jpl/test/NightlyRun/test543.py\\
+Export determination: 6. \\
+Rationale: CHG: MATLAB -> Python translations; clean up\\
+\vspace{3em}
+
+\noindent \textbf{Change \#716} with diff file ISSM-26554-26555.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp A /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: NEW: add pseudo-random number generators + use in solutionsequence\_sampling.cpp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#717} with diff file ISSM-26555-26556.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp A /issm/trunk-jpl/src/m/boundaryconditions/SetMLHOBC.m A /issm/trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/stressbalance.m M /issm/trunk-jpl/src/m/classes/stressbalance.py M /issm/trunk-jpl/src/m/extrusion/project3d.m M /issm/trunk-jpl/src/m/extrusion/project3d.py M /issm/trunk-jpl/test/NightlyRun/test127.m M /issm/trunk-jpl/test/NightlyRun/test127.py M /issm/trunk-jpl/test/NightlyRun/test128.m M /issm/trunk-jpl/test/NightlyRun/test128.py M /issm/trunk-jpl/test/NightlyRun/test129.m M /issm/trunk-jpl/test/NightlyRun/test129.py M /issm/trunk-jpl/test/NightlyRun/test248.m M /issm/trunk-jpl/test/NightlyRun/test248.py M /issm/trunk-jpl/test/NightlyRun/test249.m M /issm/trunk-jpl/test/NightlyRun/test249.py M /issm/trunk-jpl/test/NightlyRun/test254.m M /issm/trunk-jpl/test/NightlyRun/test254.py M /issm/trunk-jpl/test/NightlyRun/test255.m M /issm/trunk-jpl/test/NightlyRun/test255.py M /issm/trunk-jpl/test/NightlyRun/test256.m M /issm/trunk-jpl/test/NightlyRun/test256.py M /issm/trunk-jpl/test/NightlyRun/test330.m M /issm/trunk-jpl/test/NightlyRun/test330.py M /issm/trunk-jpl/test/NightlyRun/test332.m M /issm/trunk-jpl/test/NightlyRun/test332.py M /issm/trunk-jpl/test/NightlyRun/test333.m M /issm/trunk-jpl/test/NightlyRun/test333.py M /issm/trunk-jpl/test/NightlyRun/test334.m M /issm/trunk-jpl/test/NightlyRun/test334.py M /issm/trunk-jpl/test/NightlyRun/test335.m M /issm/trunk-jpl/test/NightlyRun/test335.py M /issm/trunk-jpl/test/NightlyRun/test446.m M /issm/trunk-jpl/test/NightlyRun/test446.py M /issm/trunk-jpl/test/NightlyRun/test447.m M /issm/trunk-jpl/test/NightlyRun/test447.py M /issm/trunk-jpl/test/NightlyRun/test448.m M /issm/trunk-jpl/test/NightlyRun/test448.py M /issm/trunk-jpl/test/NightlyRun/test449.m M /issm/trunk-jpl/test/NightlyRun/test449.py M /issm/trunk-jpl/test/NightlyRun/test518.m M /issm/trunk-jpl/test/NightlyRun/test518.py M /issm/trunk-jpl/test/NightlyRun/test519.m M /issm/trunk-jpl/test/NightlyRun/test519.py M /issm/trunk-jpl/test/NightlyRun/test810.m M /issm/trunk-jpl/test/NightlyRun/test810.py M /issm/trunk-jpl/test/NightlyRun/test811.m M /issm/trunk-jpl/test/NightlyRun/test811.py M /issm/trunk-jpl/test/NightlyRun/test812.m M /issm/trunk-jpl/test/NightlyRun/test812.py\\
+Export determination: 6. \\
+Rationale: ADD: shear boundary conditions for MLHO. To keep the tests as they were, all the shear boundary conditions are set to nan.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#718} with diff file ISSM-26556-26557.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4 M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/cores/ad\_core.cpp M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp M /issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h M /issm/trunk-jpl/src/c/toolkits/codipack/CoDiPackCommon.hpp M /issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp M /issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h M /issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp\\
+Export determination: 6. \\
+Rationale: CHG: can now run with CoDiPack 1.9 and 2.0\\
+\vspace{3em}
+
+\noindent \textbf{Change \#719} with diff file ISSM-26557-26558.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/extrusion/project3d.py\\
+Export determination: 6. \\
+Rationale: BUG:fix error for polynomial degree projection in python code\\
+\vspace{3em}
+
+\noindent \textbf{Change \#720} with diff file ISSM-26558-26559.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/AMR/mismip.py A /issm/trunk-jpl/examples/AMR/runme.py\\
+Export determination: 6. \\
+Rationale: NEW: adding AMR tutorial in Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#721} with diff file ISSM-26559-26560.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Greenland/CheatSheet.py A /issm/trunk-jpl/examples/Greenland/Greenland.py A /issm/trunk-jpl/examples/Greenland/runme.py\\
+Export determination: 6. \\
+Rationale: NEW: adding Greenland tutorial in Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#722} with diff file ISSM-26560-26561.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Inversion/Square.py A /issm/trunk-jpl/examples/Inversion/runme.py\\
+Export determination: 6. \\
+Rationale: NEW: adding Inversion tutorial in Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#723} with diff file ISSM-26561-26562.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/ISMIP/IsmipA.py A /issm/trunk-jpl/examples/ISMIP/IsmipF.py A /issm/trunk-jpl/examples/ISMIP/runme.py\\
+Export determination: 6. \\
+Rationale: NEW: adding ISMIP tutorial in Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#724} with diff file ISSM-26562-26563.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Mesh/circles.py A /issm/trunk-jpl/examples/Mesh/shock.py\\
+Export determination: 6. \\
+Rationale: NEW: adding Mesh tutorial in Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#725} with diff file ISSM-26563-26564.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/SquareIceShelf/Square.py A /issm/trunk-jpl/examples/SquareIceShelf/runme.py\\
+Export determination: 6. \\
+Rationale: NEW: adding SquareIceShelf tutorial in Python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#726} with diff file ISSM-26564-26565.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/shakti/moulin.py\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#727} with diff file ISSM-26565-26566.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp\\
+Export determination: 6. \\
+Rationale: NEW: adding some single precision import\\
+\vspace{3em}
+
+\noindent \textbf{Change \#728} with diff file ISSM-26566-26567.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/defleurian/netCDF/export\_netCDF.py\\
+Export determination: 6. \\
+Rationale: NEW: update to deal with AMR models\\
+\vspace{3em}
+
+\noindent \textbf{Change \#729} with diff file ISSM-26567-26568.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/io/loadvars.py\\
+Export determination: 6. \\
+Rationale: BUG removing a print\\
+\vspace{3em}
+
+\noindent \textbf{Change \#730} with diff file ISSM-26568-26569.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/modules/InterpFromGridToMesh.py\\
+Export determination: 6. \\
+Rationale: CHG:squeeze before return\\
+\vspace{3em}
+
+\noindent \textbf{Change \#731} with diff file ISSM-26569-26570.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/colormaps/demmap.py M /issm/trunk-jpl/src/m/plot/plotmodel.py M /issm/trunk-jpl/src/m/plot/processdata.py M /issm/trunk-jpl/src/m/plot/processmesh.py\\
+Export determination: 6. \\
+Rationale: CHG:modification to enable AMR plotting\\
+\vspace{3em}
+
+\noindent \textbf{Change \#732} with diff file ISSM-26570-26571.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/saga.py\\
+Export determination: 6. \\
+Rationale: CHG try scp rather than fail on it\\
+\vspace{3em}
+
+\noindent \textbf{Change \#733} with diff file ISSM-26571-26572.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.py\\
+Export determination: 6. \\
+Rationale: CHG: do not extrude damage if it is not here\\
+\vspace{3em}
+
+\noindent \textbf{Change \#734} with diff file ISSM-26572-26573.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/defleurian/paraview/exportVTK.py\\
+Export determination: 6. \\
+Rationale: NEW:dealing with export on sparse stepping\\
+\vspace{3em}
+
+\noindent \textbf{Change \#735} with diff file ISSM-26573-26574.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.py\\
+Export determination: 6. \\
+Rationale: CHG minor formating\\
+\vspace{3em}
+
+\noindent \textbf{Change \#736} with diff file ISSM-26574-26575.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: CHG: write pseudrandom number generators as a namespace\\
+\vspace{3em}
+
+\noindent \textbf{Change \#737} with diff file ISSM-26575-26576.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#738} with diff file ISSM-26576-26577.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#739} with diff file ISSM-26577-26578.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#740} with diff file ISSM-26578-26579.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#741} with diff file ISSM-26579-26580.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#742} with diff file ISSM-26580-26581.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#743} with diff file ISSM-26581-26582.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#744} with diff file ISSM-26582-26583.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#745} with diff file ISSM-26583-26584.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#746} with diff file ISSM-26584-26585.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/boundaryconditions/SetMLHOBC.py M /issm/trunk-jpl/test/NightlyRun/test127.py\\
+Export determination: 6. \\
+Rationale: BUG:fix to MLHOBC and test127\\
+\vspace{3em}
+
+\noindent \textbf{Change \#747} with diff file ISSM-26585-26586.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing a division by 0 in CoDiPack\\
+\vspace{3em}
+
+\noindent \textbf{Change \#748} with diff file ISSM-26586-26587.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: CHG: change names of random generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#749} with diff file ISSM-26587-26588.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: add member functions for random generators in a separate file\\
+\vspace{3em}
+
+\noindent \textbf{Change \#750} with diff file ISSM-26588-26589.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#751} with diff file ISSM-26589-26590.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs on tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#752} with diff file ISSM-26590-26591.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: some changes in pseudo-random number generator classes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#753} with diff file ISSM-26591-26592.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs pseudo-random number generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#754} with diff file ISSM-26592-26593.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs pseudo-random number generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#755} with diff file ISSM-26593-26594.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: add member functions for random generators in a separate file\\
+\vspace{3em}
+
+\noindent \textbf{Change \#756} with diff file ISSM-26594-26595.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs pseudo-random number generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#757} with diff file ISSM-26595-26596.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: add member functions for random generators in a separate file\\
+\vspace{3em}
+
+\noindent \textbf{Change \#758} with diff file ISSM-26596-26597.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs pseudo-random number generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#759} with diff file ISSM-26597-26598.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: BUG: Try to fix bugs pseudo-random number generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#760} with diff file ISSM-26598-26599.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: a few changes for random generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#761} with diff file ISSM-26599-26600.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: a few changes for random generators\\
+\vspace{3em}
+
+\noindent \textbf{Change \#762} with diff file ISSM-26600-26601.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp M /issm/trunk-jpl/test/Archives/Archive134.arch\\
+Export determination: 6. \\
+Rationale: CHG: update Nightlyrun 134\\
+\vspace{3em}
+
+\noindent \textbf{Change \#763} with diff file ISSM-26601-26602.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp\\
+Export determination: 6. \\
+Rationale: CHG: better way if fixing friction singularity when v=0\\
+\vspace{3em}
+
+\noindent \textbf{Change \#764} with diff file ISSM-26602-26603.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: add member functions for random generators in a separate file\\
+\vspace{3em}
+
+\noindent \textbf{Change \#765} with diff file ISSM-26603-26604.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: CHG: create namespace for pseudo-random number generator\\
+\vspace{3em}
+
+\noindent \textbf{Change \#766} with diff file ISSM-26604-26605.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/test/NightlyRun/test257.m M /issm/trunk-jpl/test/NightlyRun/test543.m\\
+Export determination: 6. \\
+Rationale: CHG: making stochasticforcing.m more generic, extending stochasticforcing capability to DefaultCalving\\
+\vspace{3em}
+
+\noindent \textbf{Change \#767} with diff file ISSM-26605-26606.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h\\
+Export determination: 6. \\
+Rationale: CHG: making last argument optional for Julia\\
+\vspace{3em}
+
+\noindent \textbf{Change \#768} with diff file ISSM-26606-26607.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/Synchronize.sh\\
+Export determination: 6. \\
+Rationale: CHG: adding highlighting for Julia\\
+\vspace{3em}
+
+\noindent \textbf{Change \#769} with diff file ISSM-26607-26608.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solvers/asmoptions.m M /issm/trunk-jpl/src/m/solvers/asmstokesoptions.m\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#770} with diff file ISSM-26608-26609.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/stochasticforcing.m\\
+Export determination: 6. \\
+Rationale: BUG: reverting Vincent's commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#771} with diff file ISSM-26609-26610.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test257.m\\
+Export determination: 6. \\
+Rationale: BUG: reverting Vincent's commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#772} with diff file ISSM-26610-26611.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test543.m\\
+Export determination: 6. \\
+Rationale: BUG: reverting Vincent's commit\\
+\vspace{3em}
+
+\noindent \textbf{Change \#773} with diff file ISSM-26611-26612.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/c/shared/Enum/Enumjl.vim\\
+Export determination: 6. \\
+Rationale: CHG: added Enums for Julia\\
+\vspace{3em}
+
+\noindent \textbf{Change \#774} with diff file ISSM-26612-26613.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_sampling.cpp\\
+Export determination: 6. \\
+Rationale: CGH: include linear congruential generator\\
+\vspace{3em}
+
+\noindent \textbf{Change \#775} with diff file ISSM-26613-26614.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp\\
+Export determination: 6. \\
+Rationale: BUG: include library chrono in randomgenerator.cpp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#776} with diff file ISSM-26614-26615.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/build\_4003.sh D /issm/trunk-jpl/test/MITgcm/get\_mitgcm\_dngoldberg.sh D /issm/trunk-jpl/test/MITgcm/install\_dngoldberg.sh M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: test4003 now uses main MITgcm branch as opposed to dngoldberg branch RunUncoupledMITgcm exactly reproduces MITgcm/verification/shelfice\_2d\_remesh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#777} with diff file ISSM-26615-26616.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enumjl.vim M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py M /issm/trunk-jpl/test/NightlyRun/test257.m M /issm/trunk-jpl/test/NightlyRun/test257.py M /issm/trunk-jpl/test/NightlyRun/test543.m M /issm/trunk-jpl/test/NightlyRun/test543.py\\
+Export determination: 6. \\
+Rationale: CHG: making stochasticforcing.m more generic, extending stochasticforcing capability to DefaultCalving (second attempt)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#778} with diff file ISSM-26616-26617.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CGH: add lognormal, chi-squared, and exponential distributions to pseudo-random generator\\
+\vspace{3em}
+
+\noindent \textbf{Change \#779} with diff file ISSM-26617-26618.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: set md.stochasticforcing.default\_id as dummy if defaults not used\\
+\vspace{3em}
+
+\noindent \textbf{Change \#780} with diff file ISSM-26618-26619.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: fixing bugs in stochasticforcing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#781} with diff file ISSM-26619-26620.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CGH: add student-t distribution to pseudo-random generator\\
+\vspace{3em}
+
+\noindent \textbf{Change \#782} with diff file ISSM-26620-26621.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: set md.stochasticforcing.default\_id as dummy if defaults not used (python syntax fixed)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#783} with diff file ISSM-26621-26622.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/random.cpp M /issm/trunk-jpl/src/c/shared/Random/random.h M /issm/trunk-jpl/test/Archives/Archive257.arch M /issm/trunk-jpl/test/Archives/Archive543.arch\\
+Export determination: 6. \\
+Rationale: CHG: making random number generation in ISSM dependent on classes of randomgenerator.h (should allow cross-platform tests of stochasticity)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#784} with diff file ISSM-26622-26623.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/classes.jl M /issm/trunk-jpl/src/jl/solve.jl\\
+Export determination: 6. \\
+Rationale: CHG: some progress with Joel\\
+\vspace{3em}
+
+\noindent \textbf{Change \#785} with diff file ISSM-26623-26624.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controladm1qn3\_core.cpp M /issm/trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: nor needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#786} with diff file ISSM-26624-26625.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmap2.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpGeoid.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpRACMOant.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpSmith2020.m\\
+Export determination: 6. \\
+Rationale: CHG: updating some scripts for totten\\
+\vspace{3em}
+
+\noindent \textbf{Change \#787} with diff file ISSM-26625-26626.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpREMA.m\\
+Export determination: 6. \\
+Rationale: CHG: added totten support\\
+\vspace{3em}
+
+\noindent \textbf{Change \#788} with diff file ISSM-26626-26627.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: IceVolume() in Tria.cpp and Penta.cpp can account for partial ice coverage of frontal elements (currently disabled using false condition)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#789} with diff file ISSM-26627-26628.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpIBCSO.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpRTopo2.m\\
+Export determination: 6. \\
+Rationale: CHG: added support for totten\\
+\vspace{3em}
+
+\noindent \textbf{Change \#790} with diff file ISSM-26628-26629.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve.jl\\
+Export determination: 6. \\
+Rationale: CHG: working on MP with Joel\\
+\vspace{3em}
+
+\noindent \textbf{Change \#791} with diff file ISSM-26629-26630.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/jl/classes.jl D /issm/trunk-jpl/src/jl/exp.jl M /issm/trunk-jpl/src/jl/issm.jl D /issm/trunk-jpl/src/jl/issmenums.jl A /issm/trunk-jpl/src/jl/md A /issm/trunk-jpl/src/jl/md/classes.jl (from /issm/trunk-jpl/src/jl/classes.jl:26628) A /issm/trunk-jpl/src/jl/md/exp.jl (from /issm/trunk-jpl/src/jl/exp.jl:26628) A /issm/trunk-jpl/src/jl/md/parameterization.jl (from /issm/trunk-jpl/src/jl/parameterization.jl:26628) A /issm/trunk-jpl/src/jl/md/plotmodel.jl (from /issm/trunk-jpl/src/jl/plotmodel.jl:26628) A /issm/trunk-jpl/src/jl/md/triangle.jl (from /issm/trunk-jpl/src/jl/triangle.jl:26628) A /issm/trunk-jpl/src/jl/md/utils.jl (from /issm/trunk-jpl/src/jl/utils.jl:26628) D /issm/trunk-jpl/src/jl/parameterization.jl D /issm/trunk-jpl/src/jl/plotmodel.jl A /issm/trunk-jpl/src/jl/solve A /issm/trunk-jpl/src/jl/solve/analyses.jl A /issm/trunk-jpl/src/jl/solve/constraints.jl A /issm/trunk-jpl/src/jl/solve/elements.jl A /issm/trunk-jpl/src/jl/solve/femmodel.jl A /issm/trunk-jpl/src/jl/solve/gauss.jl A /issm/trunk-jpl/src/jl/solve/inputs.jl A /issm/trunk-jpl/src/jl/solve/issmenums.jl (from /issm/trunk-jpl/src/jl/issmenums.jl:26628) A /issm/trunk-jpl/src/jl/solve/modules.jl A /issm/trunk-jpl/src/jl/solve/nodes.jl A /issm/trunk-jpl/src/jl/solve/parameters.jl A /issm/trunk-jpl/src/jl/solve/solve.jl (from /issm/trunk-jpl/src/jl/solve.jl:26628) A /issm/trunk-jpl/src/jl/solve/vertices.jl D /issm/trunk-jpl/src/jl/solve.jl D /issm/trunk-jpl/src/jl/triangle.jl D /issm/trunk-jpl/src/jl/utils.jl\\
+Export determination: 6. \\
+Rationale: CHG: reorganized project to make it simpler\\
+\vspace{3em}
+
+\noindent \textbf{Change \#792} with diff file ISSM-26630-26631.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.m\\
+Export determination: 6. \\
+Rationale: CHG: better doc\\
+\vspace{3em}
+
+\noindent \textbf{Change \#793} with diff file ISSM-26631-26632.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/shp/shp2exp.m\\
+Export determination: 6. \\
+Rationale: CHG: better way of handling NaNs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#794} with diff file ISSM-26632-26633.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: take out friction heat from melt rate when gap height is greater than bump height\\
+\vspace{3em}
+
+\noindent \textbf{Change \#795} with diff file ISSM-26633-26634.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive350.arch\\
+Export determination: 6. \\
+Rationale: CHG: updated Test 350 with no friction contribution to melt rate when gap height is greater than bump height\\
+\vspace{3em}
+
+\noindent \textbf{Change \#796} with diff file ISSM-26634-26635.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl M /issm/trunk-jpl/src/jl/test101.jl\\
+Export determination: 6. \\
+Rationale: CHG: updated degrees of freedom\\
+\vspace{3em}
+
+\noindent \textbf{Change \#797} with diff file ISSM-26635-26636.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG:fixing Stochasticforcing translation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#798} with diff file ISSM-26636-26637.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/extrusion/project3d.py\\
+Export determination: 6. \\
+Rationale: BUG: fixing extrusion for poly type vectors\\
+\vspace{3em}
+
+\noindent \textbf{Change \#799} with diff file ISSM-26637-26638.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test254.py M /issm/trunk-jpl/test/NightlyRun/test255.py M /issm/trunk-jpl/test/NightlyRun/test257.py M /issm/trunk-jpl/test/NightlyRun/test330.py M /issm/trunk-jpl/test/NightlyRun/test332.py M /issm/trunk-jpl/test/NightlyRun/test335.py M /issm/trunk-jpl/test/NightlyRun/test447.py M /issm/trunk-jpl/test/NightlyRun/test449.py M /issm/trunk-jpl/test/NightlyRun/test519.py M /issm/trunk-jpl/test/NightlyRun/test542.py M /issm/trunk-jpl/test/NightlyRun/test543.py M /issm/trunk-jpl/test/NightlyRun/test811.py\\
+Export determination: 6. \\
+Rationale: BUG: fixing import for SetMLHOBC\\
+\vspace{3em}
+
+\noindent \textbf{Change \#800} with diff file ISSM-26638-26639.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test2001.py M /issm/trunk-jpl/test/NightlyRun/test2003.py M /issm/trunk-jpl/test/NightlyRun/test2006.py M /issm/trunk-jpl/test/NightlyRun/test2010.py M /issm/trunk-jpl/test/NightlyRun/test2084.py M /issm/trunk-jpl/test/NightlyRun/test257.py M /issm/trunk-jpl/test/NightlyRun/test350.py M /issm/trunk-jpl/test/NightlyRun/test356.py M /issm/trunk-jpl/test/NightlyRun/test440.py M /issm/trunk-jpl/test/NightlyRun/test444.py M /issm/trunk-jpl/test/NightlyRun/test481.py M /issm/trunk-jpl/test/NightlyRun/test540.py M /issm/trunk-jpl/test/NightlyRun/test541.py M /issm/trunk-jpl/test/NightlyRun/test542.py M /issm/trunk-jpl/test/NightlyRun/test543.py M /issm/trunk-jpl/test/NightlyRun/test804.py M /issm/trunk-jpl/test/NightlyRun/test805.py M /issm/trunk-jpl/test/NightlyRun/test806.py M /issm/trunk-jpl/test/NightlyRun/test808.py M /issm/trunk-jpl/test/NightlyRun/test809.py M /issm/trunk-jpl/test/NightlyRun/test812.py\\
+Export determination: 6. \\
+Rationale: CHG:changing oshostname to gethostname\\
+\vspace{3em}
+
+\noindent \textbf{Change \#801} with diff file ISSM-26639-26640.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test257.py M /issm/trunk-jpl/test/NightlyRun/test812.py\\
+Export determination: 6. \\
+Rationale: BUG: import and matlab function fix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#802} with diff file ISSM-26640-26641.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enumjl.vim M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py D /issm/trunk-jpl/src/m/miscellaneous/supportedstochforcings.m\\
+Export determination: 6. \\
+Rationale: CHG: added stochasticforcing capability for basalforcings.floatingice\_melting\_rate, corrections in stochasticforcing checkconsistency\\
+\vspace{3em}
+
+\noindent \textbf{Change \#803} with diff file ISSM-26641-26642.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG: fixing python syntax in stochasticforcing.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#804} with diff file ISSM-26642-26643.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG: fixing call to methods in stochasticforcing.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#805} with diff file ISSM-26643-26644.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG: trying to fix field comparisons in stochasticforcing.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#806} with diff file ISSM-26644-26645.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: field comparisons temporarily commented out in stochasticforcing.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#807} with diff file ISSM-26645-26646.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG:fixing stochasticforcing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#808} with diff file ISSM-26646-26647.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG:removing prints\\
+\vspace{3em}
+
+\noindent \textbf{Change \#809} with diff file ISSM-26647-26648.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG: missing mattype\\
+\vspace{3em}
+
+\noindent \textbf{Change \#810} with diff file ISSM-26648-26649.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses.jl M /issm/trunk-jpl/src/jl/solve/elements.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl\\
+Export determination: 6. \\
+Rationale: CHG: fixed problem with vertices being aliased\\
+\vspace{3em}
+
+\noindent \textbf{Change \#811} with diff file ISSM-26649-26650.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses.jl M /issm/trunk-jpl/src/jl/solve/elements.jl M /issm/trunk-jpl/src/jl/solve/gauss.jl M /issm/trunk-jpl/src/jl/solve/inputs.jl M /issm/trunk-jpl/src/jl/solve/solve.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with GetSolutionFromInputs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#812} with diff file ISSM-26650-26651.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h\\
+Export determination: 6. \\
+Rationale: CHG: moving EffectivePressure calculation to another function\\
+\vspace{3em}
+
+\noindent \textbf{Change \#813} with diff file ISSM-26651-26652.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/hydrology\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added calculation of effective pressure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#814} with diff file ISSM-26652-26653.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses.jl M /issm/trunk-jpl/src/jl/solve/elements.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl A /issm/trunk-jpl/src/jl/solve/solutionsequences.jl M /issm/trunk-jpl/src/jl/solve/solve.jl\\
+Export determination: 6. \\
+Rationale: CHG: more work on julia solver\\
+\vspace{3em}
+
+\noindent \textbf{Change \#815} with diff file ISSM-26653-26654.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: correction of weights computation in Tria::GetFractionGeometry and Penta::GetFractionGeometry2D, TotalSmb can account for partially ice-covered elements (feature currently disabled with if(false) condition)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#816} with diff file ISSM-26654-26655.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/pine\_island-mac-basic\\
+Export determination: 6. \\
+Rationale: CHG: Activating tests that rely on RNG\\
+\vspace{3em}
+
+\noindent \textbf{Change \#817} with diff file ISSM-26655-26656.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/jl/solve/analyses A /issm/trunk-jpl/src/jl/solve/analyses/analysis.jl (from /issm/trunk-jpl/src/jl/solve/analyses.jl:26654) A /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl D /issm/trunk-jpl/src/jl/solve/analyses.jl A /issm/trunk-jpl/src/jl/solve/elementmatrix.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/solutionsequences.jl M /issm/trunk-jpl/src/jl/solve/solve.jl A /issm/trunk-jpl/src/jl/solve/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: reorganizing files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#818} with diff file ISSM-26656-26657.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.cpp M /issm/trunk-jpl/src/c/shared/Random/randomgenerator.h\\
+Export determination: 6. \\
+Rationale: CHG: Fix memory leak issues from randomgenerator\\
+\vspace{3em}
+
+\noindent \textbf{Change \#819} with diff file ISSM-26657-26658.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Random/random.cpp\\
+Export determination: 6. \\
+Rationale: CHG: Fix memory leak issues from randomgenerator\\
+\vspace{3em}
+
+\noindent \textbf{Change \#820} with diff file ISSM-26658-26659.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elementmatrix.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl\\
+Export determination: 6. \\
+Rationale: CHG: started working on element matrices\\
+\vspace{3em}
+
+\noindent \textbf{Change \#821} with diff file ISSM-26659-26660.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elements.jl M /issm/trunk-jpl/src/jl/solve/gauss.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl M /issm/trunk-jpl/src/jl/solve/solve.jl A /issm/trunk-jpl/src/jl/solve/utils.jl M /issm/trunk-jpl/src/jl/solve/vertices.jl M /issm/trunk-jpl/src/jl/test101.jl\\
+Export determination: 6. \\
+Rationale: CHG: getting to Jacobian Determinant\\
+\vspace{3em}
+
+\noindent \textbf{Change \#822} with diff file ISSM-26660-26661.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: Review and cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#823} with diff file ISSM-26661-26662.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/calvingdev2.m M /issm/trunk-jpl/src/m/classes/calvingvonmises.m M /issm/trunk-jpl/src/m/coordsystems/laea.py M /issm/trunk-jpl/src/m/exp/expwrite.py M /issm/trunk-jpl/src/m/modules/ExpToLevelSet.py M /issm/trunk-jpl/src/m/shp/shp2exp.m M /issm/trunk-jpl/src/m/shp/shp2exp.py M /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py M /issm/trunk-jpl/src/m/solvers/asmoptions.m M /issm/trunk-jpl/src/m/solvers/asmoptions.py M /issm/trunk-jpl/src/m/solvers/asmstokesoptions.m A /issm/trunk-jpl/src/m/solvers/asmstokesoptions.py\\
+Export determination: 6. \\
+Rationale: CHG: Pending translations; cleanup\\
+\vspace{3em}
+
+\noindent \textbf{Change \#824} with diff file ISSM-26662-26663.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/expwrite.py\\
+Export determination: 6. \\
+Rationale: CHG: Missed a copy/paste\\
+\vspace{3em}
+
+\noindent \textbf{Change \#825} with diff file ISSM-26663-26664.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/radarpower.m\\
+Export determination: 6. \\
+Rationale: CHG: added local directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#826} with diff file ISSM-26664-26665.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code\_4003/CPP\_OPTIONS.h M /issm/trunk-jpl/test/MITgcm/code\_4003/DIAGNOSTICS\_SIZE.h M /issm/trunk-jpl/test/MITgcm/code\_4003/SIZE.h M /issm/trunk-jpl/test/MITgcm/input\_4003/data A /issm/trunk-jpl/test/MITgcm/input\_4003/data.diagnostics A /issm/trunk-jpl/test/MITgcm/input\_4003/data.obcs A /issm/trunk-jpl/test/MITgcm/input\_4003/data.pkg M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: test4003 now runs MITgcm/verification/shelfice\_2d\_remesh except that model domain is 3x200 instead of 1x200 and initial conditions are from time step 0 so no pickup files are needed. Coupling with ISSM is work in progress.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#827} with diff file ISSM-26665-26666.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive543.arch M /issm/trunk-jpl/test/NightlyRun/test543.m M /issm/trunk-jpl/test/NightlyRun/test543.py\\
+Export determination: 6. \\
+Rationale: CHG: Adjusted test543 to test for several stochasticforcing fields\\
+\vspace{3em}
+
+\noindent \textbf{Change \#828} with diff file ISSM-26666-26667.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: Correcting python syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#829} with diff file ISSM-26667-26668.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: Correcting python syntax (2)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#830} with diff file ISSM-26668-26669.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test543.py\\
+Export determination: 6. \\
+Rationale: CHG: Debugging python test543\\
+\vspace{3em}
+
+\noindent \textbf{Change \#831} with diff file ISSM-26669-26670.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py M /issm/trunk-jpl/test/NightlyRun/test543.py\\
+Export determination: 6. \\
+Rationale: CHG: Debugging python test543 (2)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#832} with diff file ISSM-26670-26671.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test543.py\\
+Export determination: 6. \\
+Rationale: CHG: Debugging python test543 (3)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#833} with diff file ISSM-26671-26672.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: Correcting basin\_id initialization in stochasticforcing.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#834} with diff file ISSM-26672-26673.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: Correcting dimensions marshalling in stochasticforcing.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#835} with diff file ISSM-26673-26674.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: CHG: Correcting dimensions marshalling in stochasticforcing.py (2)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#836} with diff file ISSM-26674-26675.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py M /issm/trunk-jpl/test/NightlyRun/test543.py\\
+Export determination: 6. \\
+Rationale: CHG: Adding FloatingMeltRate to the list of scaled fields in stochasticforcing.py\\
+\vspace{3em}
+
+\noindent \textbf{Change \#837} with diff file ISSM-26675-26676.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elements.jl A /issm/trunk-jpl/src/jl/solve/matice.jl M /issm/trunk-jpl/src/jl/solve/solve.jl M /issm/trunk-jpl/src/jl/solve/utils.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with nodal function derivatives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#838} with diff file ISSM-26676-26677.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/StochasticForcingx/StochasticForcingx.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enum.vim M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/Enumjl.vim M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/stochasticforcing.m M /issm/trunk-jpl/src/m/classes/stochasticforcing.py A /issm/trunk-jpl/test/Archives/Archive621.arch A /issm/trunk-jpl/test/NightlyRun/test621.m A /issm/trunk-jpl/test/NightlyRun/test621.py\\
+Export determination: 6. \\
+Rationale: NEW: added FrictionWaterPressure to stochasticforcingfields, new functions Friction::IcePressure() and Friction::SubglacialWaterPressure(), clean-up Friction::EffectivePressure()\\
+\vspace{3em}
+
+\noindent \textbf{Change \#839} with diff file ISSM-26677-26678.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/stochasticforcing.py\\
+Export determination: 6. \\
+Rationale: BUG: fix python syntax\\
+\vspace{3em}
+
+\noindent \textbf{Change \#840} with diff file ISSM-26678-26679.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test621.py\\
+Export determination: 6. \\
+Rationale: CHG: fix python syntax (2)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#841} with diff file ISSM-26679-26680.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test621.py\\
+Export determination: 6. \\
+Rationale: CHG: fix python test621\\
+\vspace{3em}
+
+\noindent \textbf{Change \#842} with diff file ISSM-26680-26681.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpRignot2012.m M /issm/trunk-jpl/src/m/modules/ExpToLevelSet.m\\
+Export determination: 6. \\
+Rationale: CHG: set data path to totten\\
+\vspace{3em}
+
+\noindent \textbf{Change \#843} with diff file ISSM-26681-26682.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elementmatrix.jl M /issm/trunk-jpl/src/jl/solve/elements.jl M /issm/trunk-jpl/src/jl/solve/inputs.jl M /issm/trunk-jpl/src/jl/solve/matice.jl M /issm/trunk-jpl/src/jl/solve/modules.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with load vector and element stiffness matrix\\
+\vspace{3em}
+
+\noindent \textbf{Change \#844} with diff file ISSM-26682-26683.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elementmatrix.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl M /issm/trunk-jpl/src/jl/solve/solutionsequences.jl M /issm/trunk-jpl/src/jl/solve/solve.jl M /issm/trunk-jpl/src/jl/solve/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with ys\\
+\vspace{3em}
+
+\noindent \textbf{Change \#845} with diff file ISSM-26683-26684.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m\\
+Export determination: 6. \\
+Rationale: CHG: more updates now that we are moving to totten\\
+\vspace{3em}
+
+\noindent \textbf{Change \#846} with diff file ISSM-26684-26685.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: activate updated calculation of IceVolume() and TotalSmb() for partially ice-covered elements\\
+\vspace{3em}
+
+\noindent \textbf{Change \#847} with diff file ISSM-26685-26686.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive540.arch M /issm/trunk-jpl/test/Archives/Archive541.arch M /issm/trunk-jpl/test/NightlyRun/test540.m M /issm/trunk-jpl/test/NightlyRun/test540.py M /issm/trunk-jpl/test/NightlyRun/test541.m M /issm/trunk-jpl/test/NightlyRun/test541.py\\
+Export determination: 6. \\
+Rationale: NEW: added volume and other scalar checks for test with partially ice covered elements\\
+\vspace{3em}
+
+\noindent \textbf{Change \#848} with diff file ISSM-26686-26687.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl M /issm/trunk-jpl/src/jl/solve/solutionsequences.jl M /issm/trunk-jpl/src/jl/solve/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: Done down to first uf, which does not look right\\
+\vspace{3em}
+
+\noindent \textbf{Change \#849} with diff file ISSM-26687-26688.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test540.m M /issm/trunk-jpl/test/NightlyRun/test540.py M /issm/trunk-jpl/test/NightlyRun/test541.m M /issm/trunk-jpl/test/NightlyRun/test541.py\\
+Export determination: 6. \\
+Rationale: BUG: fixed minor problem with new scalars in tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#850} with diff file ISSM-26688-26689.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test540.py\\
+Export determination: 6. \\
+Rationale: FIX: minor typo in python test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#851} with diff file ISSM-26689-26690.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test494.py M /issm/trunk-jpl/test/NightlyRun/test541.m M /issm/trunk-jpl/test/NightlyRun/test541.py\\
+Export determination: 6. \\
+Rationale: CHG: minor tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#852} with diff file ISSM-26690-26691.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test541.py\\
+Export determination: 6. \\
+Rationale: CHG: minor tolerance\\
+\vspace{3em}
+
+\noindent \textbf{Change \#853} with diff file ISSM-26691-26692.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: CHG: avoid dynamic allocation if not needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#854} with diff file ISSM-26692-26693.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing problem with indexing of weights\\
+\vspace{3em}
+
+\noindent \textbf{Change \#855} with diff file ISSM-26693-26694.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/AMR/runme\_with\_neopz.m\\
+Export determination: 6. \\
+Rationale: CHG: adding an example of an AMR simulation using NeoPZ\\
+\vspace{3em}
+
+\noindent \textbf{Change \#856} with diff file ISSM-26694-26695.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: CHG: final bug\\
+\vspace{3em}
+
+\noindent \textbf{Change \#857} with diff file ISSM-26695-26696.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/neopz/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: install a tested version of NeoPZ\\
+\vspace{3em}
+
+\noindent \textbf{Change \#858} with diff file ISSM-26696-26697.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cleaned up SHAKTI code\\
+\vspace{3em}
+
+\noindent \textbf{Change \#859} with diff file ISSM-26697-26698.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test541.m\\
+Export determination: 6. \\
+Rationale: CHG: minor tolerance\\
+\vspace{3em}
+
+\noindent \textbf{Change \#860} with diff file ISSM-26698-26699.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/nodes.jl M /issm/trunk-jpl/src/jl/solve/solutionsequences.jl M /issm/trunk-jpl/src/jl/solve/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with VecMerge\\
+\vspace{3em}
+
+\noindent \textbf{Change \#861} with diff file ISSM-26699-26700.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/inputs.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/solutionsequences.jl M /issm/trunk-jpl/src/jl/solve/toolkits.jl\\
+Export determination: 6. \\
+Rationale: NEW: done with convergence criterion\\
+\vspace{3em}
+
+\noindent \textbf{Change \#862} with diff file ISSM-26700-26701.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test541.m M /issm/trunk-jpl/test/NightlyRun/test541.py\\
+Export determination: 6. \\
+Rationale: CHG: minor tolerance again\\
+\vspace{3em}
+
+\noindent \textbf{Change \#863} with diff file ISSM-26701-26702.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/chenggong A /issm/trunk-jpl/src/m/contrib/chenggong/interpFromMEaSUREsGeotiff.m M /issm/trunk-jpl/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m\\
+Export determination: 6. \\
+Rationale: ADD:interpret MEaSUREs Greenland Ice velocity to mesh\\
+\vspace{3em}
+
+\noindent \textbf{Change \#864} with diff file ISSM-26702-26703.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/solutionsequences.jl M /issm/trunk-jpl/src/jl/solve/solve.jl\\
+Export determination: 6. \\
+Rationale: CHG: started working on output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#865} with diff file ISSM-26703-26704.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/md/classes.jl M /issm/trunk-jpl/src/jl/md/utils.jl M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/femmodel.jl M /issm/trunk-jpl/src/jl/solve/modules.jl A /issm/trunk-jpl/src/jl/solve/results.jl M /issm/trunk-jpl/src/jl/solve/solve.jl M /issm/trunk-jpl/src/jl/test101.jl A /issm/trunk-jpl/src/jl/test301.jl\\
+Export determination: 6. \\
+Rationale: CHG: added results and starting test301 with basal friction\\
+\vspace{3em}
+
+\noindent \textbf{Change \#866} with diff file ISSM-26704-26705.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl A /issm/trunk-jpl/src/jl/solve/friction.jl M /issm/trunk-jpl/src/jl/solve/solve.jl\\
+Export determination: 6. \\
+Rationale: CHG: added friction\\
+\vspace{3em}
+
+\noindent \textbf{Change \#867} with diff file ISSM-26705-26706.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elements.jl M /issm/trunk-jpl/src/jl/solve/friction.jl\\
+Export determination: 6. \\
+Rationale: CHG: added subelement GL calculation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#868} with diff file ISSM-26706-26707.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elements.jl\\
+Export determination: 6. \\
+Rationale: CHG: added IsIcefront function\\
+\vspace{3em}
+
+\noindent \textbf{Change \#869} with diff file ISSM-26707-26708.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test541.m M /issm/trunk-jpl/test/NightlyRun/test541.py\\
+Export determination: 6. \\
+Rationale: CHG: Adjustments to field tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#870} with diff file ISSM-26708-26709.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test541.m M /issm/trunk-jpl/test/NightlyRun/test541.py\\
+Export determination: 6. \\
+Rationale: CHG: Adjustments to field tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#871} with diff file ISSM-26709-26710.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/md/exp.jl\\
+Export determination: 6. \\
+Rationale: CHG: added ContourToNodes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#872} with diff file ISSM-26710-26711.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/solve/elements.jl M /issm/trunk-jpl/src/jl/solve/gauss.jl M /issm/trunk-jpl/src/jl/solve/solutionsequences.jl\\
+Export determination: 6. \\
+Rationale: NEW: working on ice front, still not working...\\
+\vspace{3em}
+
+\noindent \textbf{Change \#873} with diff file ISSM-26711-26712.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl A /issm/trunk-jpl/src/jl/test201.jl A /issm/trunk-jpl/src/jl/test501.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with ice front\\
+\vspace{3em}
+
+\noindent \textbf{Change \#874} with diff file ISSM-26712-26713.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/md/utils.jl\\
+Export determination: 6. \\
+Rationale: CHG: fixed interpolation method\\
+\vspace{3em}
+
+\noindent \textbf{Change \#875} with diff file ISSM-26713-26714.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/md/parameterization.jl M /issm/trunk-jpl/src/jl/test101.jl M /issm/trunk-jpl/src/jl/test501.jl\\
+Export determination: 6. \\
+Rationale: CHG: fixing some issues for Pig\\
+\vspace{3em}
+
+\noindent \textbf{Change \#876} with diff file ISSM-26714-26715.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/test501.jl\\
+Export determination: 6. \\
+Rationale: CHG: more change on Pig, still not working, but close\\
+\vspace{3em}
+
+\noindent \textbf{Change \#877} with diff file ISSM-26715-26716.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/md/classes.jl M /issm/trunk-jpl/src/jl/md/utils.jl\\
+Export determination: 6. \\
+Rationale: CHG: can now import models from MATLAB\\
+\vspace{3em}
+
+\noindent \textbf{Change \#878} with diff file ISSM-26716-26717.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/md/classes.jl M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/test101.jl\\
+Export determination: 6. \\
+Rationale: CHG: as usual\\
+\vspace{3em}
+
+\noindent \textbf{Change \#879} with diff file ISSM-26717-26718.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl A /issm/trunk-jpl/src/jl/test.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with Pig\\
+\vspace{3em}
+
+\noindent \textbf{Change \#880} with diff file ISSM-26718-26719.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/solve/modules.jl M /issm/trunk-jpl/src/jl/solve/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: lot more efficient with assembly\\
+\vspace{3em}
+
+\noindent \textbf{Change \#881} with diff file ISSM-26719-26720.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/MITgcm/code\_4003/cpl\_issm.F M /issm/trunk-jpl/test/MITgcm/input\_4003/data M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: updated test4003 with 3*200 domain based on MITgcm/verification/shelfice\_2d\_remesh runs but hangs on step 11: RunCoupledMITgcmISSM\\
+\vspace{3em}
+
+\noindent \textbf{Change \#882} with diff file ISSM-26720-26721.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: add missing "useCoupler=.TRUE." in eedata much better now: MITgcm stops due to EXTREME Pot.Temp :-)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#883} with diff file ISSM-26721-26722.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test4003.m\\
+Export determination: 6. \\
+Rationale: moving ocean boundary to North edge of domain\\
+\vspace{3em}
+
+\noindent \textbf{Change \#884} with diff file ISSM-26722-26723.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/MITgcm/tools/pcolorcen.m\\
+Export determination: 6. \\
+Rationale: adding pcolorcen.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#885} with diff file ISSM-26723-26724.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/issm.jl\\
+Export determination: 6. \\
+Rationale: CHG: exporting some functions to avoid ISSM.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#886} with diff file ISSM-26724-26725.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/test.jl M /issm/trunk-jpl/src/jl/test101.jl\\
+Export determination: 6. \\
+Rationale: CHG: exporting some functions to avoid ISSM.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#887} with diff file ISSM-26725-26726.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/jl/core (from /issm/trunk-jpl/src/jl/solve:26724) M /issm/trunk-jpl/src/jl/core/solve.jl M /issm/trunk-jpl/src/jl/issm.jl D /issm/trunk-jpl/src/jl/md D /issm/trunk-jpl/src/jl/solve D /issm/trunk-jpl/src/jl/test.jl D /issm/trunk-jpl/src/jl/test101.jl D /issm/trunk-jpl/src/jl/test201.jl D /issm/trunk-jpl/src/jl/test301.jl D /issm/trunk-jpl/src/jl/test501.jl A /issm/trunk-jpl/src/jl/tests A /issm/trunk-jpl/src/jl/tests/test.jl (from /issm/trunk-jpl/src/jl/test.jl:26724) A /issm/trunk-jpl/src/jl/tests/test101.jl (from /issm/trunk-jpl/src/jl/test101.jl:26724) A /issm/trunk-jpl/src/jl/tests/test201.jl (from /issm/trunk-jpl/src/jl/test201.jl:26724) A /issm/trunk-jpl/src/jl/tests/test301.jl (from /issm/trunk-jpl/src/jl/test301.jl:26724) A /issm/trunk-jpl/src/jl/tests/test501.jl (from /issm/trunk-jpl/src/jl/test501.jl:26724) A /issm/trunk-jpl/src/jl/usr (from /issm/trunk-jpl/src/jl/md:26724)\\
+Export determination: 6. \\
+Rationale: CHG: moving files around\\
+\vspace{3em}
+
+\noindent \textbf{Change \#888} with diff file ISSM-26726-26727.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/tests/test.jl M /issm/trunk-jpl/src/jl/tests/test201.jl M /issm/trunk-jpl/src/jl/usr/plotmodel.jl\\
+Export determination: 6. \\
+Rationale: CHG: fixing namespace issues\\
+\vspace{3em}
+
+\noindent \textbf{Change \#889} with diff file ISSM-26727-26728.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/core/issmenums.jl M /issm/trunk-jpl/src/jl/core/modules.jl M /issm/trunk-jpl/src/jl/core/results.jl M /issm/trunk-jpl/src/jl/tests/test.jl M /issm/trunk-jpl/src/jl/usr/classes.jl M /issm/trunk-jpl/src/jl/usr/plotmodel.jl\\
+Export determination: 6. \\
+Rationale: CHG: more flexible plotmodel\\
+\vspace{3em}
+
+\noindent \textbf{Change \#890} with diff file ISSM-26728-26729.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/usr/classes.jl\\
+Export determination: 6. \\
+Rationale: CHG: some reorg\\
+\vspace{3em}
+
+\noindent \textbf{Change \#891} with diff file ISSM-26729-26730.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/core/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#892} with diff file ISSM-26730-26731.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl M /issm/trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl A /issm/trunk-jpl/src/jl/core/analyses/transientanalysis.jl M /issm/trunk-jpl/src/jl/core/constraints.jl M /issm/trunk-jpl/src/jl/core/elements.jl M /issm/trunk-jpl/src/jl/core/femmodel.jl M /issm/trunk-jpl/src/jl/core/modules.jl M /issm/trunk-jpl/src/jl/core/parameters.jl M /issm/trunk-jpl/src/jl/core/solve.jl M /issm/trunk-jpl/src/jl/tests/test.jl M /issm/trunk-jpl/src/jl/tests/test101.jl A /issm/trunk-jpl/src/jl/tests/test208.jl M /issm/trunk-jpl/src/jl/usr/classes.jl M /issm/trunk-jpl/src/jl/usr/utils.jl\\
+Export determination: 6. \\
+Rationale: CHG: adding mass transport, not quite working yet\\
+\vspace{3em}
+
+\noindent \textbf{Change \#893} with diff file ISSM-26731-26732.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl M /issm/trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/core/analyses/transientanalysis.jl M /issm/trunk-jpl/src/jl/core/elements.jl M /issm/trunk-jpl/src/jl/core/inputs.jl M /issm/trunk-jpl/src/jl/core/modules.jl M /issm/trunk-jpl/src/jl/core/solutionsequences.jl M /issm/trunk-jpl/src/jl/core/solve.jl M /issm/trunk-jpl/src/jl/core/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: done with transient\\
+\vspace{3em}
+
+\noindent \textbf{Change \#894} with diff file ISSM-26732-26733.diff: \\
+Function name: \\
+A /issm/trunk-jpl/post-commit-mail-test\\
+Export determination: 6. \\
+Rationale: ADD: Testing post commit mail\\
+\vspace{3em}
+
+\noindent \textbf{Change \#895} with diff file ISSM-26733-26734.diff: \\
+Function name: \\
+D /issm/trunk-jpl/post-commit-mail-test\\
+Export determination: 6. \\
+Rationale: DEL: Testing post commit mail\\
+\vspace{3em}
+
+\noindent \textbf{Change \#896} with diff file ISSM-26736-26737.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl M /issm/trunk-jpl/src/jl/core/analyses/transientanalysis.jl M /issm/trunk-jpl/src/jl/core/elements.jl M /issm/trunk-jpl/src/jl/core/modules.jl\\
+Export determination: 6. \\
+Rationale: CHG: adding GL migration\\
+\vspace{3em}
+
+\noindent \textbf{Change \#897} with diff file ISSM-26737-26738.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/usr/triangle.jl\\
+Export determination: 6. \\
+Rationale: CHG: better path to libtriangle\\
+\vspace{3em}
+
+\noindent \textbf{Change \#898} with diff file ISSM-26738-26739.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/jl/core/analyses/masstransportanalysis.jl M /issm/trunk-jpl/src/jl/core/analyses/stressbalanceanalysis.jl M /issm/trunk-jpl/src/jl/core/elements.jl M /issm/trunk-jpl/src/jl/core/inputs.jl M /issm/trunk-jpl/src/jl/core/modules.jl M /issm/trunk-jpl/src/jl/core/nodes.jl M /issm/trunk-jpl/src/jl/core/solutionsequences.jl M /issm/trunk-jpl/src/jl/core/toolkits.jl\\
+Export determination: 6. \\
+Rationale: CHG: account for passive elements now if the ice levelset crosses the domain\\
+\vspace{3em}
+
Index: /issm/oecreview/Archive/25834-26739/r1.tex
===================================================================
--- /issm/oecreview/Archive/25834-26739/r1.tex	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/r1.tex	(revision 26740)
@@ -0,0 +1,1 @@
+25834
Index: /issm/oecreview/Archive/25834-26739/r2.tex
===================================================================
--- /issm/oecreview/Archive/25834-26739/r2.tex	(revision 26740)
+++ /issm/oecreview/Archive/25834-26739/r2.tex	(revision 26740)
@@ -0,0 +1,1 @@
+26739
